nx 15.3.0 → 15.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.
- package/CHANGELOG.md +1 -1
- package/package.json +4 -4
- package/src/core/graph/main.js +1 -1
- package/src/executors/run-commands/schema.json +8 -1
- package/src/lock-file/lock-file.d.ts +18 -3
- package/src/lock-file/lock-file.js +59 -11
- package/src/lock-file/lock-file.js.map +1 -1
- package/src/lock-file/npm.d.ts +2 -1
- package/src/lock-file/npm.js +117 -50
- package/src/lock-file/npm.js.map +1 -1
- package/src/lock-file/pnpm.d.ts +2 -1
- package/src/lock-file/pnpm.js +51 -22
- package/src/lock-file/pnpm.js.map +1 -1
- package/src/lock-file/utils/hashing.d.ts +7 -1
- package/src/lock-file/utils/hashing.js +8 -5
- package/src/lock-file/utils/hashing.js.map +1 -1
- package/src/lock-file/utils/lock-file-type.d.ts +1 -0
- package/src/lock-file/utils/mapping.d.ts +16 -8
- package/src/lock-file/utils/mapping.js +13 -4
- package/src/lock-file/utils/mapping.js.map +1 -1
- package/src/lock-file/utils/pruning.d.ts +13 -0
- package/src/lock-file/utils/pruning.js +50 -0
- package/src/lock-file/utils/pruning.js.map +1 -0
- package/src/lock-file/yarn.d.ts +2 -1
- package/src/lock-file/yarn.js +49 -27
- package/src/lock-file/yarn.js.map +1 -1
- package/src/tasks-runner/create-task-graph.js +6 -0
- package/src/tasks-runner/create-task-graph.js.map +1 -1
- package/src/tasks-runner/utils.js +11 -6
- package/src/tasks-runner/utils.js.map +1 -1
- package/src/utils/object-sort.js +4 -5
- package/src/utils/object-sort.js.map +1 -1
- package/src/utils/package-json.d.ts +1 -0
- package/src/utils/package-json.js.map +1 -1
- package/src/utils/params.d.ts +5 -3
- package/src/utils/params.js +47 -7
- package/src/utils/params.js.map +1 -1
- package/src/lock-file/utils/sorting.d.ts +0 -6
- package/src/lock-file/utils/sorting.js +0 -25
- package/src/lock-file/utils/sorting.js.map +0 -1
package/src/core/graph/main.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see main.js.LICENSE.txt */
|
|
2
|
-
(self.webpackChunk=self.webpackChunk||[]).push([[179],{58607:(e,t,n)=>{"use strict";var r=n(12139),i=function(){return i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i.apply(this,arguments)};var o=n(60382),a=n(70049),s=n(61818),l=n(64223),c=n(77847),u=n.n(c);function d(e){return"function"==typeof e?e():e}function h(e,t){try{return JSON.stringify(e,t)}catch(w){return u()(e,t)}}function f(e,t,n){var r,o,a={};try{for(var s=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}(t),l=s.next();!l.done;l=s.next()){var c=l.value;a[c]=e[c]}}catch(d){r={error:d}}finally{try{l&&!l.done&&(o=s.return)&&o.call(s)}finally{if(r)throw r.error}}var u=JSON.parse(h(a,n));return h(i(i({},e),u))}function p(e,t){e.machine,e.configuration,e.history;var n=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}(e,["machine","configuration","history"]);return f(n,["context","event","_event"],t)}function v(e,t){return f(e.definition,["context"],t)}var g=new Map;var m={url:"https://stately.ai/viz?inspect",iframe:function(){return document.querySelector("iframe[data-xstate]")},devTools:function(){var e,t,n=(e=new Set,t=new Set,{services:e,register:function(n){e.add(n),g.set(n.sessionId,n),t.forEach((function(e){return e(n)})),n.onStop((function(){e.delete(n),g.delete(n.sessionId)}))},unregister:function(t){e.delete(t),g.delete(t.sessionId)},onRegister:function(n){return t.add(n),e.forEach((function(e){return n(e)})),{unsubscribe:function(){t.delete(n)}}}});return globalThis.__xstate__=n,n},serialize:void 0},y=new Set;n(15735),n(6886),n(73439);var b=n(33847),x=0;function w(e,t,n,r,i){var o,a,s={};for(a in t)"ref"==a?o=t[a]:s[a]=t[a];var l={type:e,props:s,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:--x,__source:r,__self:i};if("function"==typeof e&&(o=e.defaultProps))for(a in o)void 0===s[a]&&(s[a]=o[a]);return b.YM.vnode&&b.YM.vnode(l),l}var E=n(19798);let _;function k(){if(!_){D(!0,!1);_=new E.GraphService("cytoscape-graph",D("dark","light"))}return _}const S=document.documentElement,P="nx-dep-graph-theme";let j;function C(e){const t=e.matches?"dark":"light";S.className=t,j=t}function T(e){if(!("matchMedia"in window))return;const t=window.matchMedia("(prefers-color-scheme: dark)");if("system"!==e)t.removeEventListener("change",C),S.className=e,j=e;else{const e=t.matches?"dark":"light";t.addEventListener("change",C),S.className=e,j=e}localStorage.setItem(P,e),k().theme=j}function D(e,t){return"dark"===j?e:t}const N="nx-dep-graph-rankdir";let O;function M(e){O=e,localStorage.setItem(N,e),k().rankDir=O}function A(){return A=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},A.apply(this,arguments)}var R;!function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"}(R||(R={}));const I="popstate";function L(e,t){if(!e){"undefined"!=typeof console&&console.warn(t);try{throw new Error(t)}catch(w){}}}function B(e){return{usr:e.state,key:e.key}}function F(e,t,n,r){return void 0===n&&(n=null),A({pathname:"string"==typeof e?e:e.pathname,search:"",hash:""},"string"==typeof t?V(t):t,{state:n,key:t&&t.key||r||Math.random().toString(36).substr(2,8)})}function z(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&"?"!==n&&(t+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(t+="#"===r.charAt(0)?r:"#"+r),t}function V(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function G(e){let t="undefined"!=typeof window&&void 0!==window.location&&"null"!==window.location.origin?window.location.origin:"unknown://unknown",n="string"==typeof e?e:z(e);return new URL(n,t)}function H(e,t,n,r){void 0===r&&(r={});let{window:i=document.defaultView,v5Compat:o=!1}=r,a=i.history,s=R.Pop,l=null;function c(){s=R.Pop,l&&l({action:s,location:u.location})}let u={get action(){return s},get location(){return e(i,a)},listen(e){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(I,c),l=e,()=>{i.removeEventListener(I,c),l=null}},createHref:e=>t(i,e),encodeLocation(e){let t=G(z(e));return A({},e,{pathname:t.pathname,search:t.search,hash:t.hash})},push:function(e,t){s=R.Push;let r=F(u.location,e,t);n&&n(r,e);let c=B(r),d=u.createHref(r);try{a.pushState(c,"",d)}catch(h){i.location.assign(d)}o&&l&&l({action:s,location:u.location})},replace:function(e,t){s=R.Replace;let r=F(u.location,e,t);n&&n(r,e);let i=B(r),c=u.createHref(r);a.replaceState(i,"",c),o&&l&&l({action:s,location:u.location})},go:e=>a.go(e)};return u}var W;function q(e,t,n){return void 0===t&&(t=[]),void 0===n&&(n=new Set),e.map(((e,r)=>{let i=[...t,r],o="string"==typeof e.id?e.id:i.join("-");if(te(!0!==e.index||!e.children,"Cannot specify children on an index route"),te(!n.has(o),'Found a route id collision on id "'+o+"\". Route id's must be globally unique within Data Router usages"),n.add(o),function(e){return!0===e.index}(e)){return A({},e,{id:o})}return A({},e,{id:o,children:e.children?q(e.children,i,n):void 0})}))}function Y(e,t,n){void 0===n&&(n="/");let r=ee(("string"==typeof t?V(t):t).pathname||"/",n);if(null==r)return null;let i=U(e);!function(e){e.sort(((e,t)=>e.score!==t.score?t.score-e.score:function(e,t){let n=e.length===t.length&&e.slice(0,-1).every(((e,n)=>e===t[n]));return n?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map((e=>e.childrenIndex)),t.routesMeta.map((e=>e.childrenIndex)))))}(i);let o=null;for(let a=0;null==o&&a<i.length;++a)o=Z(i[a],J(r));return o}function U(e,t,n,r){return void 0===t&&(t=[]),void 0===n&&(n=[]),void 0===r&&(r=""),e.forEach(((e,i)=>{let o={relativePath:e.path||"",caseSensitive:!0===e.caseSensitive,childrenIndex:i,route:e};o.relativePath.startsWith("/")&&(te(o.relativePath.startsWith(r),'Absolute route path "'+o.relativePath+'" nested under path "'+r+'" is not valid. An absolute child route path must start with the combined path of all its parent routes.'),o.relativePath=o.relativePath.slice(r.length));let a=ae([r,o.relativePath]),s=n.concat(o);e.children&&e.children.length>0&&(te(!0!==e.index,'Index routes must not have child routes. Please remove all child routes from route path "'+a+'".'),U(e.children,t,s,a)),(null!=e.path||e.index)&&t.push({path:a,score:K(a,e.index),routesMeta:s})})),t}!function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"}(W||(W={}));const X=/^:\w+$/,$=e=>"*"===e;function K(e,t){let n=e.split("/"),r=n.length;return n.some($)&&(r+=-2),t&&(r+=2),n.filter((e=>!$(e))).reduce(((e,t)=>e+(X.test(t)?3:""===t?1:10)),r)}function Z(e,t){let{routesMeta:n}=e,r={},i="/",o=[];for(let a=0;a<n.length;++a){let e=n[a],s=a===n.length-1,l="/"===i?t:t.slice(i.length)||"/",c=Q({path:e.relativePath,caseSensitive:e.caseSensitive,end:s},l);if(!c)return null;Object.assign(r,c.params);let u=e.route;o.push({params:r,pathname:ae([i,c.pathname]),pathnameBase:se(ae([i,c.pathnameBase])),route:u}),"/"!==c.pathnameBase&&(i=ae([i,c.pathnameBase]))}return o}function Q(e,t){"string"==typeof e&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=function(e,t,n){void 0===t&&(t=!1);void 0===n&&(n=!0);ne("*"===e||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were "'+e.replace(/\*$/,"/*")+'" because the `*` character must always follow a `/` in the pattern. To get rid of this warning, please change the route path to "'+e.replace(/\*$/,"/*")+'".');let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^$?{}|()[\]]/g,"\\$&").replace(/:(\w+)/g,((e,t)=>(r.push(t),"([^\\/]+)")));e.endsWith("*")?(r.push("*"),i+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":""!==e&&"/"!==e&&(i+="(?:(?=\\/|$))");return[new RegExp(i,t?void 0:"i"),r]}(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let o=i[0],a=o.replace(/(.)\/+$/,"$1"),s=i.slice(1),l=r.reduce(((e,t,n)=>{if("*"===t){let e=s[n]||"";a=o.slice(0,o.length-e.length).replace(/(.)\/+$/,"$1")}return e[t]=function(e,t){try{return decodeURIComponent(e)}catch(n){return ne(!1,'The value for the URL param "'+t+'" will not be decoded because the string "'+e+'" is a malformed URL segment. This is probably due to a bad percent encoding ('+n+")."),e}}(s[n]||"",t),e}),{});return{params:l,pathname:o,pathnameBase:a,pattern:e}}function J(e){try{return decodeURI(e)}catch(t){return ne(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent encoding ('+t+")."),e}}function ee(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&"/"!==r?null:e.slice(n)||"/"}function te(e,t){if(!1===e||null==e)throw new Error(t)}function ne(e,t){if(!e){"undefined"!=typeof console&&console.warn(t);try{throw new Error(t)}catch(w){}}}function re(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified `to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the `to."+n+'` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.'}function ie(e){return e.filter(((e,t)=>0===t||e.route.path&&e.route.path.length>0))}function oe(e,t,n,r){let i;void 0===r&&(r=!1),"string"==typeof e?i=V(e):(i=A({},e),te(!i.pathname||!i.pathname.includes("?"),re("?","pathname","search",i)),te(!i.pathname||!i.pathname.includes("#"),re("#","pathname","hash",i)),te(!i.search||!i.search.includes("#"),re("#","search","hash",i)));let o,a=""===e||""===i.pathname,s=a?"/":i.pathname;if(r||null==s)o=n;else{let e=t.length-1;if(s.startsWith("..")){let t=s.split("/");for(;".."===t[0];)t.shift(),e-=1;i.pathname=t.join("/")}o=e>=0?t[e]:"/"}let l=function(e,t){void 0===t&&(t="/");let{pathname:n,search:r="",hash:i=""}="string"==typeof e?V(e):e,o=n?n.startsWith("/")?n:function(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach((e=>{".."===e?n.length>1&&n.pop():"."!==e&&n.push(e)})),n.length>1?n.join("/"):"/"}(n,t):t;return{pathname:o,search:le(r),hash:ce(i)}}(i,o),c=s&&"/"!==s&&s.endsWith("/"),u=(a||"."===s)&&n.endsWith("/");return l.pathname.endsWith("/")||!c&&!u||(l.pathname+="/"),l}const ae=e=>e.join("/").replace(/\/\/+/g,"/"),se=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),le=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",ce=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"";class ue extends Error{}class de{constructor(e){let t;this.pendingKeys=new Set,this.subscriber=void 0,te(e&&"object"==typeof e&&!Array.isArray(e),"defer() only accepts plain objects"),this.abortPromise=new Promise(((e,n)=>t=n)),this.controller=new AbortController;let n=()=>t(new ue("Deferred data aborted"));this.unlistenAbortSignal=()=>this.controller.signal.removeEventListener("abort",n),this.controller.signal.addEventListener("abort",n),this.data=Object.entries(e).reduce(((e,t)=>{let[n,r]=t;return Object.assign(e,{[n]:this.trackPromise(n,r)})}),{})}trackPromise(e,t){if(!(t instanceof Promise))return t;this.pendingKeys.add(e);let n=Promise.race([t,this.abortPromise]).then((t=>this.onSettle(n,e,null,t)),(t=>this.onSettle(n,e,t)));return n.catch((()=>{})),Object.defineProperty(n,"_tracked",{get:()=>!0}),n}onSettle(e,t,n,r){if(this.controller.signal.aborted&&n instanceof ue)return this.unlistenAbortSignal(),Object.defineProperty(e,"_error",{get:()=>n}),Promise.reject(n);this.pendingKeys.delete(t),this.done&&this.unlistenAbortSignal();const i=this.subscriber;return n?(Object.defineProperty(e,"_error",{get:()=>n}),i&&i(!1),Promise.reject(n)):(Object.defineProperty(e,"_data",{get:()=>r}),i&&i(!1),r)}subscribe(e){this.subscriber=e}cancel(){this.controller.abort(),this.pendingKeys.forEach(((e,t)=>this.pendingKeys.delete(t)));let e=this.subscriber;e&&e(!0)}async resolveData(e){let t=!1;if(!this.done){let n=()=>this.cancel();e.addEventListener("abort",n),t=await new Promise((t=>{this.subscribe((r=>{e.removeEventListener("abort",n),(r||this.done)&&t(r)}))}))}return t}get done(){return 0===this.pendingKeys.size}get unwrappedData(){return te(null!==this.data&&this.done,"Can only unwrap data on initialized and settled deferreds"),Object.entries(this.data).reduce(((e,t)=>{let[n,r]=t;return Object.assign(e,{[n]:he(r)})}),{})}}function he(e){if(!function(e){return e instanceof Promise&&!0===e._tracked}(e))return e;if(e._error)throw e._error;return e._data}const fe=function(e,t){void 0===t&&(t=302);let n=t;"number"==typeof n?n={status:n}:void 0===n.status&&(n.status=302);let r=new Headers(n.headers);return r.set("Location",e),new Response(null,A({},n,{headers:r}))};class pe{constructor(e,t,n){this.status=e,this.statusText=t||"",this.data=n}}function ve(e){return e instanceof pe}const ge={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0},me={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0},ye=!("undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement);function be(e){te(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let t=q(e.routes),n=null,r=new Set,i=null,o=null,a=null,s=!1,l=Y(t,e.history.location,e.basename),c=null;if(null==l){let{matches:e,route:n,error:r}=Re(t);l=e,c={[n.id]:r}}let u,d,h=!l.some((e=>e.route.loader))||null!=e.hydrationData,f={historyAction:e.history.action,location:e.history.location,matches:l,initialized:h,navigation:ge,restoreScrollPosition:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||c,fetchers:new Map},p=R.Pop,v=!1,g=!1,m=!1,y=[],b=[],x=new Map,w=0,E=-1,_=new Map,k=new Set,S=new Map,P=new Map;function j(e){f=A({},f,e),r.forEach((e=>e(f)))}function C(t,n){var r;j(A({},null!=f.actionData&&null!=f.navigation.formMethod&&"loading"===f.navigation.state&&(null==(r=f.navigation.formAction)?void 0:r.split("?")[0])===t.pathname?{}:{actionData:null},n,n.loaderData?{loaderData:Oe(f.loaderData,n.loaderData,n.matches||[])}:{},{historyAction:p,location:t,initialized:!0,navigation:ge,revalidation:"idle",restoreScrollPosition:!f.navigation.formData&&H(t,n.matches||f.matches),preventScrollReset:v})),g||p===R.Pop||(p===R.Push?e.history.push(t,t.state):p===R.Replace&&e.history.replace(t,t.state)),p=R.Pop,v=!1,g=!1,m=!1,y=[],b=[]}async function T(n,r,s){d&&d.abort(),d=null,p=n,g=!0===(s&&s.startUninterruptedRevalidation),function(e,t){if(i&&o&&a){let n=t.map((e=>qe(e,f.loaderData))),r=o(e,n)||e.key;i[r]=a()}}(f.location,f.matches),v=!0===(s&&s.preventScrollReset);let l=s&&s.overrideNavigation,c=Y(t,r,e.basename);if(!c){let{matches:e,route:n,error:i}=Re(t);return G(),void C(r,{matches:e,loaderData:{},errors:{[n.id]:i}})}if(function(e,t){return e.pathname===t.pathname&&e.search===t.search&&e.hash!==t.hash}(f.location,r))return void C(r,{matches:c});d=new AbortController;let h,_,T=Ce(r,d.signal,s&&s.submission);if(s&&s.pendingError)_={[Me(c).route.id]:s.pendingError};else if(s&&s.submission){let e=await async function(e,t,n,r,i){let o;M(),j({navigation:A({state:"submitting",location:t},n)});let a=Ye(r,t);if(a.route.action){if(o=await je("action",e,a,r,u.basename),e.signal.aborted)return{shortCircuited:!0}}else o=Ie(t);if(Ve(o)){let e=A({state:"loading",location:F(f.location,o.location)},n);return await N(o,e,i&&i.replace),{shortCircuited:!0}}if(ze(o)){let e=Me(r,a.route.id);return!0!==(i&&i.replace)&&(p=R.Push),{pendingActionError:{[e.route.id]:o.error}}}if(Fe(o))throw new Error("defer() is not supported in actions");return{pendingActionData:{[a.route.id]:o.data}}}(T,r,s.submission,c,{replace:s.replace});if(e.shortCircuited)return;h=e.pendingActionData,_=e.pendingActionError,l=A({state:"loading",location:r},s.submission)}let{shortCircuited:D,loaderData:I,errors:L}=await async function(e,t,n,r,i,o,a,s){let l=r;if(!l){l={state:"loading",location:t,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0}}let[c,u]=ke(f,n,i,t,m,y,b,a,s,S);if(G((e=>!(n&&n.some((t=>t.route.id===e)))||c&&c.some((t=>t.route.id===e)))),0===c.length&&0===u.length)return C(t,{matches:n,loaderData:Oe(f.loaderData,{},n),errors:s||null,actionData:a||null}),{shortCircuited:!0};g||(u.forEach((e=>{let[t]=e,n=f.fetchers.get(t),r={state:"loading",data:n&&n.data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0};f.fetchers.set(t,r)})),j(A({navigation:l,actionData:a||f.actionData||null},u.length>0?{fetchers:new Map(f.fetchers)}:{})));E=++w,u.forEach((e=>{let[t]=e;return x.set(t,d)}));let{results:h,loaderResults:p,fetcherResults:v}=await O(f.matches,n,c,u,e);if(e.signal.aborted)return{shortCircuited:!0};u.forEach((e=>{let[t]=e;return x.delete(t)}));let _=Le(h);if(_){let e=Ee(f,_);return await N(_,e,o),{shortCircuited:!0}}let{loaderData:T,errors:D}=Ne(f,n,c,p,s,u,v,P);P.forEach(((e,t)=>{e.subscribe((n=>{(n||e.done)&&P.delete(t)}))})),function(){let e=[];for(let t of k){let n=f.fetchers.get(t);te(n,"Expected fetcher: "+t),"loading"===n.state&&(k.delete(t),e.push(t))}z(e)}();let M=V(E);return A({loaderData:T,errors:D},M||u.length>0?{fetchers:new Map(f.fetchers)}:{})}(T,r,c,l,s&&s.submission,s&&s.replace,h,_);D||(d=null,C(r,{matches:c,loaderData:I,errors:L}))}function D(e){return f.fetchers.get(e)||me}async function N(e,t,n){e.revalidate&&(m=!0),te(t.location,"Expected a location on the redirect navigation"),d=null;let r=!0===n?R.Replace:R.Push;await T(r,t.location,{overrideNavigation:t})}async function O(e,t,n,r,i){let o=await Promise.all([...n.map((e=>je("loader",i,e,t,u.basename))),...r.map((e=>{let[,t,n,r]=e;return je("loader",Ce(t,i.signal),n,r,u.basename)}))]),a=o.slice(0,n.length),s=o.slice(n.length);return await Promise.all([Ge(e,n,a,i.signal,!1,f.loaderData),Ge(e,r.map((e=>{let[,,t]=e;return t})),s,i.signal,!0)]),{results:o,loaderResults:a,fetcherResults:s}}function M(){m=!0,y.push(...G()),S.forEach(((e,t)=>{x.has(t)&&(b.push(t),B(t))}))}function I(e,t,n){let r=Me(f.matches,t);L(e),j({errors:{[r.route.id]:n},fetchers:new Map(f.fetchers)})}function L(e){x.has(e)&&B(e),S.delete(e),_.delete(e),k.delete(e),f.fetchers.delete(e)}function B(e){let t=x.get(e);te(t,"Expected fetch controller: "+e),t.abort(),x.delete(e)}function z(e){for(let t of e){let e={state:"idle",data:D(t).data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0};f.fetchers.set(t,e)}}function V(e){let t=[];for(let[n,r]of _)if(r<e){let e=f.fetchers.get(n);te(e,"Expected fetcher: "+n),"loading"===e.state&&(B(n),_.delete(n),t.push(n))}return z(t),t.length>0}function G(e){let t=[];return P.forEach(((n,r)=>{e&&!e(r)||(n.cancel(),t.push(r),P.delete(r))})),t}function H(e,t){if(i&&o&&a){let n=t.map((e=>qe(e,f.loaderData))),r=o(e,n)||e.key,a=i[r];if("number"==typeof a)return a}return null}return u={get basename(){return e.basename},get state(){return f},get routes(){return t},initialize:function(){return n=e.history.listen((e=>{let{action:t,location:n}=e;return T(t,n)})),f.initialized||T(R.Pop,f.location),u},subscribe:function(e){return r.add(e),()=>r.delete(e)},enableScrollRestoration:function(e,t,n){if(i=e,a=t,o=n||(e=>e.key),!s&&f.navigation===ge){s=!0;let e=H(f.location,f.matches);null!=e&&j({restoreScrollPosition:e})}return()=>{i=null,a=null,o=null}},navigate:async function(t,n){if("number"==typeof t)return void e.history.go(t);let{path:r,submission:i,error:o}=we(t,n),a=F(f.location,r,n&&n.state);a=e.history.encodeLocation(a);let s=!0===(n&&n.replace)||null!=i?R.Replace:R.Push,l=n&&"preventScrollReset"in n?!0===n.preventScrollReset:void 0;return await T(s,a,{submission:i,pendingError:o,preventScrollReset:l,replace:n&&n.replace})},fetch:function(n,r,i,o){if(ye)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");x.has(n)&&B(n);let a=Y(t,i,e.basename);if(!a)return void I(n,r,new pe(404,"Not Found",null));let{path:s,submission:l}=we(i,o,!0),c=Ye(a,s);l?async function(n,r,i,o,a,s){if(M(),S.delete(n),!o.route.action){let{error:e}=Ie(i);return void I(n,r,e)}let l=f.fetchers.get(n),c=A({state:"submitting"},s,{data:l&&l.data});f.fetchers.set(n,c),j({fetchers:new Map(f.fetchers)});let h=new AbortController,v=Ce(i,h.signal,s);x.set(n,h);let g=await je("action",v,o,a,u.basename);if(v.signal.aborted)return void(x.get(n)===h&&x.delete(n));if(Ve(g)){x.delete(n),k.add(n);let e=A({state:"loading"},s,{data:void 0});f.fetchers.set(n,e),j({fetchers:new Map(f.fetchers)});let t=A({state:"loading",location:F(f.location,g.location)},s);return void(await N(g,t))}if(ze(g))return void I(n,r,g.error);Fe(g)&&te(!1,"defer() is not supported in actions");let T=f.navigation.location||f.location,D=Ce(T,h.signal),R="idle"!==f.navigation.state?Y(t,f.navigation.location,e.basename):f.matches;te(R,"Didn't find any matches after fetcher action");let L=++w;_.set(n,L);let B=A({state:"loading",data:g.data},s);f.fetchers.set(n,B);let[z,G]=ke(f,R,s,T,m,y,b,{[o.route.id]:g.data},void 0,S);G.filter((e=>{let[t]=e;return t!==n})).forEach((e=>{let[t]=e,n=f.fetchers.get(t),r={state:"loading",data:n&&n.data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0};f.fetchers.set(t,r),x.set(t,h)})),j({fetchers:new Map(f.fetchers)});let{results:H,loaderResults:W,fetcherResults:q}=await O(f.matches,R,z,G,D);if(h.signal.aborted)return;_.delete(n),x.delete(n),G.forEach((e=>{let[t]=e;return x.delete(t)}));let U=Le(H);if(U){let e=Ee(f,U);return void(await N(U,e))}let{loaderData:X,errors:$}=Ne(f,f.matches,z,W,void 0,G,q,P),K={state:"idle",data:g.data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0};f.fetchers.set(n,K);let Z=V(L);"loading"===f.navigation.state&&L>E?(te(p,"Expected pending action"),d&&d.abort(),C(f.navigation.location,{matches:R,loaderData:X,errors:$,fetchers:new Map(f.fetchers)})):(j(A({errors:$,loaderData:Oe(f.loaderData,X,R)},Z?{fetchers:new Map(f.fetchers)}:{})),m=!1)}(n,r,s,c,a,l):(S.set(n,[s,c,a]),async function(e,t,n,r,i){let o=f.fetchers.get(e),a={state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,data:o&&o.data};f.fetchers.set(e,a),j({fetchers:new Map(f.fetchers)});let s=new AbortController,l=Ce(n,s.signal);x.set(e,s);let c=await je("loader",l,r,i,u.basename);Fe(c)&&(c=await He(c,l.signal,!0)||c);x.get(e)===s&&x.delete(e);if(l.signal.aborted)return;if(Ve(c)){let e=Ee(f,c);return void(await N(c,e))}if(ze(c)){let n=Me(f.matches,t);return f.fetchers.delete(e),void j({fetchers:new Map(f.fetchers),errors:{[n.route.id]:c.error}})}te(!Fe(c),"Unhandled fetcher deferred data");let d={state:"idle",data:c.data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0};f.fetchers.set(e,d),j({fetchers:new Map(f.fetchers)})}(n,r,s,c,a))},revalidate:function(){M(),j({revalidation:"loading"}),"submitting"!==f.navigation.state&&("idle"!==f.navigation.state?T(p||f.historyAction,f.navigation.location,{overrideNavigation:f.navigation}):T(f.historyAction,f.location,{startUninterruptedRevalidation:!0}))},createHref:t=>e.history.createHref(t),getFetcher:D,deleteFetcher:L,dispose:function(){n&&n(),r.clear(),d&&d.abort(),f.fetchers.forEach(((e,t)=>L(t)))},_internalFetchControllers:x,_internalActiveDeferreds:P},u}const xe=new Set(["POST","PUT","PATCH","DELETE"]);new Set(["GET","HEAD",...xe]);function we(e,t,n){void 0===n&&(n=!1);let r="string"==typeof e?e:z(e);if(!t||!("formMethod"in t)&&!("formData"in t))return{path:r};if(null!=t.formMethod&&"get"!==t.formMethod)return{path:r,submission:{formMethod:t.formMethod,formAction:Be(r),formEncType:t&&t.formEncType||"application/x-www-form-urlencoded",formData:t.formData}};if(!t.formData)return{path:r};let i=V(r);try{let e=Te(t.formData);n&&i.search&&We(i.search)&&e.append("index",""),i.search="?"+e}catch(w){return{path:r,error:new pe(400,"Bad Request","Cannot submit binary form data using GET")}}return{path:z(i)}}function Ee(e,t){let{formMethod:n,formAction:r,formEncType:i,formData:o}=e.navigation;return{state:"loading",location:F(e.location,t.location),formMethod:n||void 0,formAction:r||void 0,formEncType:i||void 0,formData:o||void 0}}function _e(e,t){let n=e;if(t){let r=e.findIndex((e=>e.route.id===t));r>=0&&(n=e.slice(0,r))}return n}function ke(e,t,n,r,i,o,a,s,l,c){let u=l?Object.values(l)[0]:s?Object.values(s)[0]:null,d=_e(t,l?Object.keys(l)[0]:void 0).filter(((t,a)=>null!=t.route.loader&&(function(e,t,n){let r=!t||n.route.id!==t.route.id,i=void 0===e[n.route.id];return r||i}(e.loaderData,e.matches[a],t)||o.some((e=>e===t.route.id))||Pe(e.location,e.matches[a],n,r,t,i,u)))),h=[];return c&&c.forEach(((e,t)=>{let[r,o,s]=e;if(a.includes(t))h.push([t,r,o,s]);else if(i){Pe(r,o,n,r,o,i,u)&&h.push([t,r,o,s])}})),[d,h]}function Se(e,t){let n=e.route.path;return e.pathname!==t.pathname||n&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function Pe(e,t,n,r,i,o,a){let s=G(e),l=t.params,c=G(r),u=i.params,d=Se(t,i)||s.toString()===c.toString()||s.search!==c.search||o;if(i.route.shouldRevalidate){let e=i.route.shouldRevalidate(A({currentUrl:s,currentParams:l,nextUrl:c,nextParams:u},n,{actionResult:a,defaultShouldRevalidate:d}));if("boolean"==typeof e)return e}return d}async function je(e,t,n,r,i,o,a){let s,l,c;void 0===o&&(o=!1),void 0===a&&(a=!1);let u=new Promise(((e,t)=>c=t)),d=()=>c();t.signal.addEventListener("abort",d);try{let r=n.route[e];te(r,"Could not find the "+e+' to run on the "'+n.route.id+'" route'),l=await Promise.race([r({request:t,params:n.params}),u])}catch(w){s=W.error,l=w}finally{t.signal.removeEventListener("abort",d)}if(l instanceof Response){let e,c=l.status;if(c>=300&&c<=399){let e=l.headers.get("Location");te(e,"Redirects returned/thrown from loaders/actions must have a Location header");let a=oe(e,ie(r.slice(0,r.indexOf(n)+1)).map((e=>e.pathnameBase)),G(t.url).pathname);if(te(z(a),"Unable to resolve redirect location: "+l.headers.get("Location")),i){let e=a.pathname;a.pathname="/"===e?i:ae([i,e])}if(e=z(a),o)throw l.headers.set("Location",e),l;return{type:W.redirect,status:c,location:e,revalidate:null!==l.headers.get("X-Remix-Revalidate")}}if(a)throw{type:s||W.data,response:l};let u=l.headers.get("Content-Type");return e=u&&u.startsWith("application/json")?await l.json():await l.text(),s===W.error?{type:s,error:new pe(c,l.statusText,e),headers:l.headers}:{type:W.data,data:e,statusCode:l.status,headers:l.headers}}return s===W.error?{type:s,error:l}:l instanceof de?{type:W.deferred,deferredData:l}:{type:W.data,data:l}}function Ce(e,t,n){let r=G(Be(e)).toString(),i={signal:t};if(n){let{formMethod:e,formEncType:t,formData:r}=n;i.method=e.toUpperCase(),i.body="application/x-www-form-urlencoded"===t?Te(r):r}return new Request(r,i)}function Te(e){let t=new URLSearchParams;for(let[n,r]of e.entries())te("string"==typeof r,'File inputs are not supported with encType "application/x-www-form-urlencoded", please use "multipart/form-data" instead.'),t.append(n,r);return t}function De(e,t,n,r,i){let o,a={},s=null,l=!1,c={};return n.forEach(((n,u)=>{let d=t[u].route.id;if(te(!Ve(n),"Cannot handle redirect results in processLoaderData"),ze(n)){let t=Me(e,d),i=n.error;r&&(i=Object.values(r)[0],r=void 0),s=Object.assign(s||{},{[t.route.id]:i}),l||(l=!0,o=ve(n.error)?n.error.status:500),n.headers&&(c[d]=n.headers)}else Fe(n)?(i&&i.set(d,n.deferredData),a[d]=n.deferredData.data):(a[d]=n.data,null==n.statusCode||200===n.statusCode||l||(o=n.statusCode),n.headers&&(c[d]=n.headers))})),r&&(s=r),{loaderData:a,errors:s,statusCode:o||200,loaderHeaders:c}}function Ne(e,t,n,r,i,o,a,s){let{loaderData:l,errors:c}=De(t,n,r,i,s);for(let u=0;u<o.length;u++){let[t,,n]=o[u];te(void 0!==a&&void 0!==a[u],"Did not find corresponding fetcher result");let r=a[u];if(ze(r)){let i=Me(e.matches,n.route.id);c&&c[i.route.id]||(c=A({},c,{[i.route.id]:r.error})),e.fetchers.delete(t)}else{if(Ve(r))throw new Error("Unhandled fetcher revalidation redirect");if(Fe(r))throw new Error("Unhandled fetcher deferred data");{let n={state:"idle",data:r.data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0};e.fetchers.set(t,n)}}}return{loaderData:l,errors:c}}function Oe(e,t,n){let r=A({},t);return n.forEach((n=>{let i=n.route.id;void 0===t[i]&&void 0!==e[i]&&(r[i]=e[i])})),r}function Me(e,t){let n=t?e.slice(0,e.findIndex((e=>e.route.id===t))+1):[...e];return n.reverse().find((e=>!0===e.route.hasErrorBoundary))||e[0]}function Ae(e,t,n){let r=e.find((e=>e.index||!e.path||"/"===e.path))||{id:"__shim-"+t+"-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:r}],route:r,error:new pe(t,n,null)}}function Re(e){return Ae(e,404,"Not Found")}function Ie(e){let t="string"==typeof e?e:z(e);return console.warn("You're trying to submit to a route that does not have an action. To fix this, please add an `action` function to the route for ["+t+"]"),{type:W.error,error:new pe(405,"Method Not Allowed","")}}function Le(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(Ve(n))return n}}function Be(e){return z(A({},"string"==typeof e?V(e):e,{hash:""}))}function Fe(e){return e.type===W.deferred}function ze(e){return e.type===W.error}function Ve(e){return(e&&e.type)===W.redirect}async function Ge(e,t,n,r,i,o){for(let a=0;a<n.length;a++){let s=n[a],l=t[a],c=e.find((e=>e.route.id===l.route.id)),u=null!=c&&!Se(c,l)&&void 0!==(o&&o[l.route.id]);Fe(s)&&(i||u)&&await He(s,r,i).then((e=>{e&&(n[a]=e||n[a])}))}}async function He(e,t,n){if(void 0===n&&(n=!1),!(await e.deferredData.resolveData(t))){if(n)try{return{type:W.data,data:e.deferredData.unwrappedData}}catch(w){return{type:W.error,error:w}}return{type:W.data,data:e.deferredData.data}}}function We(e){return new URLSearchParams(e).getAll("index").some((e=>""===e))}function qe(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],handle:n.handle}}function Ye(e,t){let n="string"==typeof t?V(t).search:t.search;if(e[e.length-1].route.index&&We(n||""))return e[e.length-1];let r=ie(e);return r[r.length-1]}function Ue(){return Ue=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ue.apply(this,arguments)}const Xe="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},{useState:$e,useEffect:Ke,useLayoutEffect:Ze,useDebugValue:Qe}=r;function Je(e){const t=e.getSnapshot,n=e.value;try{const e=t();return!Xe(n,e)}catch(r){return!0}}const et=!!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement)?function(e,t,n){return t()}:function(e,t,n){const r=t(),[{inst:i},o]=$e({inst:{value:r,getSnapshot:t}});return Ze((()=>{i.value=r,i.getSnapshot=t,Je(i)&&o({inst:i})}),[e,r,t]),Ke((()=>{Je(i)&&o({inst:i});return e((()=>{Je(i)&&o({inst:i})}))}),[e]),Qe(r),r};const tt=r.createContext(null);const nt=r.createContext(null);const rt=r.createContext(null);const it=r.createContext(null);const ot=r.createContext(null);const at=r.createContext({outlet:null,matches:[]});const st=r.createContext(null);function lt(){return null!=r.useContext(ot)}function ct(){return lt()||te(!1),r.useContext(ot).location}function ut(){lt()||te(!1);let{basename:e,navigator:t}=r.useContext(it),{matches:n}=r.useContext(at),{pathname:i}=ct(),o=JSON.stringify(ie(n).map((e=>e.pathnameBase))),a=r.useRef(!1);return r.useEffect((()=>{a.current=!0})),r.useCallback((function(n,r){if(void 0===r&&(r={}),!a.current)return;if("number"==typeof n)return void t.go(n);let s=oe(n,JSON.parse(o),i,"path"===r.relative);"/"!==e&&(s.pathname="/"===s.pathname?e:ae([e,s.pathname])),(r.replace?t.replace:t.push)(s,r.state,r)}),[e,t,o,i])}const dt=r.createContext(null);function ht(){let{matches:e}=r.useContext(at),t=e[e.length-1];return t?t.params:{}}function ft(e,t){let{relative:n}=void 0===t?{}:t,{matches:i}=r.useContext(at),{pathname:o}=ct(),a=JSON.stringify(ie(i).map((e=>e.pathnameBase)));return r.useMemo((()=>oe(e,JSON.parse(a),o,"path"===n)),[e,a,o,n])}function pt(){let e=function(){var e;let t=r.useContext(st),n=xt(bt.UseRouteError),i=r.useContext(at),o=i.matches[i.matches.length-1];if(t)return t;return i||te(!1),!o.route.id&&te(!1),null==(e=n.errors)?void 0:e[o.route.id]}(),t=ve(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,i="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:i},a={padding:"2px 4px",backgroundColor:i};return r.createElement(r.Fragment,null,r.createElement("h2",null,"Unhandled Thrown Error!"),r.createElement("h3",{style:{fontStyle:"italic"}},t),n?r.createElement("pre",{style:o},n):null,r.createElement("p",null,"\ud83d\udcbf Hey developer \ud83d\udc4b"),r.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own\xa0",r.createElement("code",{style:a},"errorElement")," props on\xa0",r.createElement("code",{style:a},"<Route>")))}class vt extends r.Component{constructor(e){super(e),this.state={location:e.location,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location?{error:e.error,location:e.location}:{error:e.error||t.error,location:t.location}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return this.state.error?r.createElement(st.Provider,{value:this.state.error,children:this.props.component}):this.props.children}}function gt(e){let{routeContext:t,match:n,children:i}=e,o=r.useContext(tt);return o&&n.route.errorElement&&(o._deepestRenderedBoundaryId=n.route.id),r.createElement(at.Provider,{value:t},i)}function mt(e,t,n){if(void 0===t&&(t=[]),null==e){if(null==n||!n.errors)return null;e=n.matches}let i=e,o=null==n?void 0:n.errors;if(null!=o){let e=i.findIndex((e=>e.route.id&&(null==o?void 0:o[e.route.id])));e>=0||te(!1),i=i.slice(0,Math.min(i.length,e+1))}return i.reduceRight(((e,a,s)=>{let l=a.route.id?null==o?void 0:o[a.route.id]:null,c=n?a.route.errorElement||r.createElement(pt,null):null,u=()=>r.createElement(gt,{match:a,routeContext:{outlet:e,matches:t.concat(i.slice(0,s+1))}},l?c:void 0!==a.route.element?a.route.element:e);return n&&(a.route.errorElement||0===s)?r.createElement(vt,{location:n.location,component:c,error:l,children:u()}):u()}),null)}var yt,bt;function xt(e){let t=r.useContext(rt);return t||te(!1),t}function wt(e){return xt(bt.UseRouteLoaderData).loaderData[e]}!function(e){e.UseRevalidator="useRevalidator"}(yt||(yt={})),function(e){e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator"}(bt||(bt={}));function Et(e){let{fallbackElement:t,router:n}=e,i=et(n.subscribe,(()=>n.state),(()=>n.state)),o=r.useMemo((()=>({createHref:n.createHref,go:e=>n.navigate(e),push:(e,t,r)=>n.navigate(e,{state:t,preventScrollReset:null==r?void 0:r.preventScrollReset}),replace:(e,t,r)=>n.navigate(e,{replace:!0,state:t,preventScrollReset:null==r?void 0:r.preventScrollReset})})),[n]),a=n.basename||"/";return r.createElement(nt.Provider,{value:{router:n,navigator:o,static:!1,basename:a}},r.createElement(rt.Provider,{value:i},r.createElement(St,{basename:n.basename,location:n.state.location,navigationType:n.state.historyAction,navigator:o},n.state.initialized?r.createElement(Pt,null):t)))}function _t(e){return function(e){let t=r.useContext(at).outlet;return t?r.createElement(dt.Provider,{value:e},t):t}(e.context)}function kt(e){te(!1)}function St(e){let{basename:t="/",children:n=null,location:i,navigationType:o=R.Pop,navigator:a,static:s=!1}=e;lt()&&te(!1);let l=t.replace(/^\/*/,"/"),c=r.useMemo((()=>({basename:l,navigator:a,static:s})),[l,a,s]);"string"==typeof i&&(i=V(i));let{pathname:u="/",search:d="",hash:h="",state:f=null,key:p="default"}=i,v=r.useMemo((()=>{let e=ee(u,l);return null==e?null:{pathname:e,search:d,hash:h,state:f,key:p}}),[l,u,d,h,f,p]);return null==v?null:r.createElement(it.Provider,{value:c},r.createElement(ot.Provider,{children:n,value:{location:v,navigationType:o}}))}function Pt(e){let{children:t,location:n}=e,i=r.useContext(nt);return function(e,t){lt()||te(!1);let n=r.useContext(rt),{matches:i}=r.useContext(at),o=i[i.length-1],a=o?o.params:{},s=(o&&o.pathname,o?o.pathnameBase:"/");o&&o.route;let l,c=ct();if(t){var u;let e="string"==typeof t?V(t):t;"/"===s||(null==(u=e.pathname)?void 0:u.startsWith(s))||te(!1),l=e}else l=c;let d=l.pathname||"/",h=Y(e,{pathname:"/"===s?d:d.slice(s.length)||"/"}),f=mt(h&&h.map((e=>Object.assign({},e,{params:Object.assign({},a,e.params),pathname:ae([s,e.pathname]),pathnameBase:"/"===e.pathnameBase?s:ae([s,e.pathnameBase])}))),i,n||void 0);return t&&f?r.createElement(ot.Provider,{value:{location:Ue({pathname:"/",search:"",hash:"",state:null,key:"default"},l),navigationType:R.Pop}},f):f}(i&&!t?i.router.routes:Tt(t),n)}var jt;!function(e){e[e.pending=0]="pending",e[e.success=1]="success",e[e.error=2]="error"}(jt||(jt={}));new Promise((()=>{}));class Ct extends r.Component{constructor(e){super(e),this.state={error:null}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){console.error("<Await> caught the following error during render",e,t)}render(){let{children:e,errorElement:t,resolve:n}=this.props,r=null,i=jt.pending;if(n instanceof Promise)if(this.state.error){jt.error;let e=this.state.error;Promise.reject().catch((()=>{})),Object.defineProperty(r,"_tracked",{get:()=>!0}),Object.defineProperty(r,"_error",{get:()=>e})}else n._tracked?(n,void 0!==r._error?jt.error:void 0!==r._data?jt.success:jt.pending):(jt.pending,Object.defineProperty(n,"_tracked",{get:()=>!0}),n.then((e=>Object.defineProperty(n,"_data",{get:()=>e})),(e=>Object.defineProperty(n,"_error",{get:()=>e}))));else jt.success,Promise.resolve(),Object.defineProperty(r,"_tracked",{get:()=>!0}),Object.defineProperty(r,"_data",{get:()=>n});if(i===jt.error&&r._error instanceof AbortedDeferredError)throw neverSettledPromise;if(i===jt.error&&!t)throw r._error;if(i===jt.error)return React.createElement(AwaitContext.Provider,{value:r,children:t});if(i===jt.success)return React.createElement(AwaitContext.Provider,{value:r,children:e});throw r}}function Tt(e,t){void 0===t&&(t=[]);let n=[];return r.Children.forEach(e,((e,i)=>{if(!r.isValidElement(e))return;if(e.type===r.Fragment)return void n.push.apply(n,Tt(e.props.children,t));e.type!==kt&&te(!1),e.props.index&&e.props.children&&te(!1);let o=[...t,i],a={id:e.props.id||o.join("-"),caseSensitive:e.props.caseSensitive,element:e.props.element,index:e.props.index,path:e.props.path,loader:e.props.loader,action:e.props.action,errorElement:e.props.errorElement,hasErrorBoundary:null!=e.props.errorElement,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle};e.props.children&&(a.children=Tt(e.props.children,o)),n.push(a)})),n}function Dt(e){return e.map((e=>{let t=Ue({},e);return null==t.hasErrorBoundary&&(t.hasErrorBoundary=null!=t.errorElement),t.children&&(t.children=Dt(t.children)),t}))}function Nt(){return Nt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Nt.apply(this,arguments)}function Ot(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}function Mt(e){return void 0===e&&(e=""),new URLSearchParams("string"==typeof e||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce(((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map((e=>[n,e])):[[n,r]])}),[]))}const At=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset"];const Rt=r.forwardRef((function(e,t){let{onClick:n,relative:i,reloadDocument:o,replace:a,state:s,target:l,to:c,preventScrollReset:u}=e,d=Ot(e,At),h=function(e,t){let{relative:n}=void 0===t?{}:t;lt()||te(!1);let{basename:i,navigator:o}=r.useContext(it),{hash:a,pathname:s,search:l}=ft(e,{relative:n}),c=s;return"/"!==i&&(c="/"===s?i:ae([i,s])),o.createHref({pathname:c,search:l,hash:a})}(c,{relative:i}),f=function(e,t){let{target:n,replace:i,state:o,preventScrollReset:a,relative:s}=void 0===t?{}:t,l=ut(),c=ct(),u=ft(e,{relative:s});return r.useCallback((t=>{if(function(e,t){return!(0!==e.button||t&&"_self"!==t||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e))}(t,n)){t.preventDefault();let n=void 0!==i?i:z(c)===z(u);l(e,{replace:n,state:o,preventScrollReset:a,relative:s})}}),[c,l,u,i,o,n,e,a,s])}(c,{replace:a,state:s,target:l,preventScrollReset:u,relative:i});return r.createElement("a",Nt({},d,{href:h,onClick:o?n:function(e){n&&n(e),e.defaultPrevented||f(e)},ref:t,target:l}))}));var It,Lt;function Bt(e){let t=r.useRef(Mt(e)),n=ct(),i=r.useMemo((()=>function(e,t){let n=Mt(e);for(let r of t.keys())n.has(r)||t.getAll(r).forEach((e=>{n.append(r,e)}));return n}(n.search,t.current)),[n.search]),o=ut(),a=r.useCallback(((e,t)=>{const n=Mt("function"==typeof e?e(i):e);o("?"+n,t)}),[o,i]);return[i,a]}(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmitImpl="useSubmitImpl",e.UseFetcher="useFetcher"})(It||(It={})),function(e){e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"}(Lt||(Lt={}));const Ft=r.forwardRef((function({title:e,titleId:t,...n},i){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:i,"aria-labelledby":t},n),e?r.createElement("title",{id:t},e):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.25 11.25l.041-.02a.75.75 0 011.063.852l-.708 2.836a.75.75 0 001.063.853l.041-.021M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9-3.75h.008v.008H12V8.25z"}))}));const zt=r.forwardRef((function({title:e,titleId:t,...n},i){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:i,"aria-labelledby":t},n),e?r.createElement("title",{id:t},e):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.25 9l-3 3m0 0l3 3m-3-3h7.5M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}))}));const Vt=r.forwardRef((function({title:e,titleId:t,...n},i){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:i,"aria-labelledby":t},n),e?r.createElement("title",{id:t},e):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5M16.5 12L12 16.5m0 0L7.5 12m4.5 4.5V3"}))}));var Gt=n(72779),Ht=n.n(Gt);function Wt(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}const qt=["className","children"];const Yt=function(e){const{className:t,children:n}=e,r=Wt(e,qt);return w("select",Object.assign({className:`flex w-auto items-center rounded-md rounded-md border border-slate-300 bg-white px-4 py-2 text-sm font-medium text-slate-700 shadow-sm hover:bg-slate-50 dark:border-slate-600 dark:bg-slate-800 dark:text-slate-300 hover:dark:bg-slate-700 ${t}`},r,{children:n}))},Ut=(0,r.memo)((function({projects:e,selectedProject:t,selectedProjectChange:n,lastPerfReport:r}){return w("div",{"data-cy":"debugger-panel",className:"flex-column flex w-auto items-center items-center justify-items-center justify-items-center gap-4 border-b border-slate-900/10 bg-slate-50 p-4 transition-all dark:border-slate-300/10 dark:bg-transparent",children:[w("h4",{className:"dark:text-sidebar-title-dark mr-4 text-lg font-normal",children:"Debugger"}),w(Yt,{"data-cy":"project-select",onChange:e=>n(e.currentTarget.value),children:e.map((e=>w("option",{value:e.id,selected:e.id===t,children:e.label},e.id)))}),w("p",{className:"text-sm",children:["Last render took ",r.renderTime,"ms:"," ",w("b",{className:"text-medium font-mono",children:[r.numNodes," nodes"]})," ","|"," ",w("b",{className:"text-medium font-mono",children:[r.numEdges," edges"]}),"."]})]})}));function Xt(){return(0,r.useRef)($t()).current}function $t(){return{exclude:window.exclude,watch:window.watch,localMode:window.localMode,projectGraphResponse:window.projectGraphResponse,environment:window.environment,appConfig:Object.assign({},window.appConfig,{showExperimentalFeatures:"true"===localStorage.getItem("showExperimentalFeatures")||window.appConfig.showExperimentalFeatures}),useXstateInspect:window.useXstateInspect}}function Kt(e,t,...n){if(e in t){let r=t[e];return"function"==typeof r?r(...n):r}let r=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map((e=>`"${e}"`)).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,Kt),r}var Zt=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(Zt||{}),Qt=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(Qt||{});function Jt({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:i,visible:o=!0,name:a}){let s=tn(t,e);if(o)return en(s,n,r,a);let l=null!=i?i:0;if(2&l){let{static:e=!1,...t}=s;if(e)return en(t,n,r,a)}if(1&l){let{unmount:e=!0,...t}=s;return Kt(e?0:1,{0:()=>null,1:()=>en({...t,hidden:!0,style:{display:"none"}},n,r,a)})}return en(s,n,r,a)}function en(e,t={},n,i){let{as:o=n,children:a,refName:s="ref",...l}=on(e,["unmount","static"]),c=void 0!==e.ref?{[s]:e.ref}:{},u="function"==typeof a?a(t):a;l.className&&"function"==typeof l.className&&(l.className=l.className(t));let d={};if(t){let e=!1,n=[];for(let[r,i]of Object.entries(t))"boolean"==typeof i&&(e=!0),!0===i&&n.push(r);e&&(d["data-headlessui-state"]=n.join(" "))}if(o===r.Fragment&&Object.keys(rn(l)).length>0){if(!(0,r.isValidElement)(u)||Array.isArray(u)&&u.length>1)throw new Error(['Passing props on "Fragment"!',"",`The current component <${i} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(l).map((e=>` - ${e}`)).join("\n"),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map((e=>` - ${e}`)).join("\n")].join("\n"));return(0,r.cloneElement)(u,Object.assign({},tn(u.props,rn(on(l,["ref"]))),d,c,function(...e){return{ref:e.every((e=>null==e))?void 0:t=>{for(let n of e)null!=n&&("function"==typeof n?n(t):n.current=t)}}}(u.ref,c.ref)))}return(0,r.createElement)(o,Object.assign({},on(l,["ref"]),o!==r.Fragment&&c,o!==r.Fragment&&d),u)}function tn(...e){if(0===e.length)return{};if(1===e.length)return e[0];let t={},n={};for(let r of e)for(let e in r)e.startsWith("on")&&"function"==typeof r[e]?(null!=n[e]||(n[e]=[]),n[e].push(r[e])):t[e]=r[e];if(t.disabled||t["aria-disabled"])return Object.assign(t,Object.fromEntries(Object.keys(n).map((e=>[e,void 0]))));for(let r in n)Object.assign(t,{[r](e,...t){let i=n[r];for(let n of i){if((e instanceof Event||(null==e?void 0:e.nativeEvent)instanceof Event)&&e.defaultPrevented)return;n(e,...t)}}});return t}function nn(e){var t;return Object.assign((0,r.forwardRef)(e),{displayName:null!=(t=e.displayName)?t:e.name})}function rn(e){let t=Object.assign({},e);for(let n in t)void 0===t[n]&&delete t[n];return t}function on(e,t=[]){let n=Object.assign({},e);for(let r of t)r in n&&delete n[r];return n}function an(){let e=[],t=[],n={enqueue(e){t.push(e)},addEventListener:(e,t,r,i)=>(e.addEventListener(t,r,i),n.add((()=>e.removeEventListener(t,r,i)))),requestAnimationFrame(...e){let t=requestAnimationFrame(...e);return n.add((()=>cancelAnimationFrame(t)))},nextFrame:(...e)=>n.requestAnimationFrame((()=>n.requestAnimationFrame(...e))),setTimeout(...e){let t=setTimeout(...e);return n.add((()=>clearTimeout(t)))},microTask(...e){let t={current:!0};return function(e){"function"==typeof queueMicrotask?queueMicrotask(e):Promise.resolve().then(e).catch((e=>setTimeout((()=>{throw e}))))}((()=>{t.current&&e[0]()})),n.add((()=>{t.current=!1}))},add:t=>(e.push(t),()=>{let n=e.indexOf(t);if(n>=0){let[t]=e.splice(n,1);t()}}),dispose(){for(let t of e.splice(0))t()},async workQueue(){for(let e of t.splice(0))await e()}};return n}function sn(){let[e]=(0,r.useState)(an);return(0,r.useEffect)((()=>()=>e.dispose()),[e]),e}const ln="undefined"==typeof window||"undefined"==typeof document;let cn=ln?r.useEffect:r.useLayoutEffect;function un(e){let t=(0,r.useRef)(e);return cn((()=>{t.current=e}),[e]),t}let dn=function(e){let t=un(e);return r.default.useCallback(((...e)=>t.current(...e)),[t])},hn=Symbol();function fn(...e){let t=(0,r.useRef)(e);(0,r.useEffect)((()=>{t.current=e}),[e]);let n=dn((e=>{for(let n of t.current)null!=n&&("function"==typeof n?n(e):n.current=e)}));return e.every((e=>null==e||(null==e?void 0:e[hn])))?void 0:n}let pn={serverHandoffComplete:!1};function vn(){let[e,t]=(0,r.useState)(pn.serverHandoffComplete);return(0,r.useEffect)((()=>{!0!==e&&t(!0)}),[e]),(0,r.useEffect)((()=>{!1===pn.serverHandoffComplete&&(pn.serverHandoffComplete=!0)}),[]),e}var gn;let mn=0;function yn(){return++mn}let bn=null!=(gn=r.default.useId)?gn:function(){let e=vn(),[t,n]=r.default.useState(e?yn:null);return cn((()=>{null===t&&n(yn())}),[t]),null!=t?""+t:void 0};var xn=(e=>(e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.Delete="Delete",e.ArrowLeft="ArrowLeft",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab",e))(xn||{});var wn=(e=>(e[e.First=0]="First",e[e.Previous=1]="Previous",e[e.Next=2]="Next",e[e.Last=3]="Last",e[e.Specific=4]="Specific",e[e.Nothing=5]="Nothing",e))(wn||{});function En(e,t){let n=t.resolveItems();if(n.length<=0)return null;let r=t.resolveActiveIndex(),i=null!=r?r:-1,o=(()=>{switch(e.focus){case 0:return n.findIndex((e=>!t.resolveDisabled(e)));case 1:{let e=n.slice().reverse().findIndex(((e,n,r)=>!(-1!==i&&r.length-n-1>=i)&&!t.resolveDisabled(e)));return-1===e?e:n.length-1-e}case 2:return n.findIndex(((e,n)=>!(n<=i)&&!t.resolveDisabled(e)));case 3:{let e=n.slice().reverse().findIndex((e=>!t.resolveDisabled(e)));return-1===e?e:n.length-1-e}case 4:return n.findIndex((n=>t.resolveId(n)===e.id));case 5:return null;default:!function(e){throw new Error("Unexpected object: "+e)}(e)}})();return-1===o?r:o}function _n(e){let t=e.parentElement,n=null;for(;t&&!(t instanceof HTMLFieldSetElement);)t instanceof HTMLLegendElement&&(n=t),t=t.parentElement;let r=""===(null==t?void 0:t.getAttribute("disabled"));return(!r||!function(e){if(!e)return!1;let t=e.previousElementSibling;for(;null!==t;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}(n))&&r}function kn(e){return ln?null:e instanceof Node?e.ownerDocument:null!=e&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}let Sn=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map((e=>`${e}:not([tabindex='-1'])`)).join(",");var Pn=(e=>(e[e.First=1]="First",e[e.Previous=2]="Previous",e[e.Next=4]="Next",e[e.Last=8]="Last",e[e.WrapAround=16]="WrapAround",e[e.NoScroll=32]="NoScroll",e))(Pn||{}),jn=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(jn||{}),Cn=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(Cn||{});function Tn(e=document.body){return null==e?[]:Array.from(e.querySelectorAll(Sn))}var Dn=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(Dn||{});function Nn(e,t=0){var n;return e!==(null==(n=kn(e))?void 0:n.body)&&Kt(t,{0:()=>e.matches(Sn),1(){let t=e;for(;null!==t;){if(t.matches(Sn))return!0;t=t.parentElement}return!1}})}function On(e){let t=kn(e);an().nextFrame((()=>{t&&!Nn(t.activeElement,0)&&function(e){null==e||e.focus({preventScroll:!0})}(e)}))}let Mn=["textarea","input"].join(",");function An(e,t=(e=>e)){return e.slice().sort(((e,n)=>{let r=t(e),i=t(n);if(null===r||null===i)return 0;let o=r.compareDocumentPosition(i);return o&Node.DOCUMENT_POSITION_FOLLOWING?-1:o&Node.DOCUMENT_POSITION_PRECEDING?1:0}))}function Rn(e,t){return function(e,t,n=!0,r=null){let i=Array.isArray(e)?e.length>0?e[0].ownerDocument:document:e.ownerDocument,o=Array.isArray(e)?n?An(e):e:Tn(e);r=null!=r?r:i.activeElement;let a,s=(()=>{if(5&t)return 1;if(10&t)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),l=(()=>{if(1&t)return 0;if(2&t)return Math.max(0,o.indexOf(r))-1;if(4&t)return Math.max(0,o.indexOf(r))+1;if(8&t)return o.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),c=32&t?{preventScroll:!0}:{},u=0,d=o.length;do{if(u>=d||u+d<=0)return 0;let e=l+u;if(16&t)e=(e+d)%d;else{if(e<0)return 3;if(e>=d)return 1}a=o[e],null==a||a.focus(c),u+=s}while(a!==i.activeElement);return 6&t&&function(e){var t,n;return null!=(n=null==(t=null==e?void 0:e.matches)?void 0:t.call(e,Mn))&&n}(a)&&a.select(),a.hasAttribute("tabindex")||a.setAttribute("tabindex","0"),2}(Tn(),t,!0,e)}function In(e,t,n){let i=un(t);(0,r.useEffect)((()=>{function t(e){i.current(e)}return document.addEventListener(e,t,n),()=>document.removeEventListener(e,t,n)}),[e,n])}let Ln=(0,r.createContext)(null);Ln.displayName="OpenClosedContext";var Bn=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Bn||{});function Fn(){return(0,r.useContext)(Ln)}function zn({value:e,children:t}){return r.default.createElement(Ln.Provider,{value:e},t)}function Vn(e){var t;if(e.type)return e.type;let n=null!=(t=e.as)?t:"button";return"string"==typeof n&&"button"===n.toLowerCase()?"button":void 0}function Gn(e,t){let[n,i]=(0,r.useState)((()=>Vn(e)));return cn((()=>{i(Vn(e))}),[e.type,e.as]),cn((()=>{n||!t.current||t.current instanceof HTMLButtonElement&&!t.current.hasAttribute("type")&&i("button")}),[n,t]),n}var Hn=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Hn||{}),Wn=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(Wn||{}),qn=(e=>(e[e.OpenMenu=0]="OpenMenu",e[e.CloseMenu=1]="CloseMenu",e[e.GoToItem=2]="GoToItem",e[e.Search=3]="Search",e[e.ClearSearch=4]="ClearSearch",e[e.RegisterItem=5]="RegisterItem",e[e.UnregisterItem=6]="UnregisterItem",e))(qn||{});function Yn(e,t=(e=>e)){let n=null!==e.activeItemIndex?e.items[e.activeItemIndex]:null,r=An(t(e.items.slice()),(e=>e.dataRef.current.domRef.current)),i=n?r.indexOf(n):null;return-1===i&&(i=null),{items:r,activeItemIndex:i}}let Un={1:e=>1===e.menuState?e:{...e,activeItemIndex:null,menuState:1},0:e=>0===e.menuState?e:{...e,menuState:0},2:(e,t)=>{var n;let r=Yn(e),i=En(t,{resolveItems:()=>r.items,resolveActiveIndex:()=>r.activeItemIndex,resolveId:e=>e.id,resolveDisabled:e=>e.dataRef.current.disabled});return{...e,...r,searchQuery:"",activeItemIndex:i,activationTrigger:null!=(n=t.trigger)?n:1}},3:(e,t)=>{let n=""!==e.searchQuery?0:1,r=e.searchQuery+t.value.toLowerCase(),i=(null!==e.activeItemIndex?e.items.slice(e.activeItemIndex+n).concat(e.items.slice(0,e.activeItemIndex+n)):e.items).find((e=>{var t;return(null==(t=e.dataRef.current.textValue)?void 0:t.startsWith(r))&&!e.dataRef.current.disabled})),o=i?e.items.indexOf(i):-1;return-1===o||o===e.activeItemIndex?{...e,searchQuery:r}:{...e,searchQuery:r,activeItemIndex:o,activationTrigger:1}},4:e=>""===e.searchQuery?e:{...e,searchQuery:"",searchActiveItemIndex:null},5:(e,t)=>{let n=Yn(e,(e=>[...e,{id:t.id,dataRef:t.dataRef}]));return{...e,...n}},6:(e,t)=>{let n=Yn(e,(e=>{let n=e.findIndex((e=>e.id===t.id));return-1!==n&&e.splice(n,1),e}));return{...e,...n,activationTrigger:1}}},Xn=(0,r.createContext)(null);function $n(e){let t=(0,r.useContext)(Xn);if(null===t){let t=new Error(`<${e} /> is missing a parent <Menu /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,$n),t}return t}function Kn(e,t){return Kt(t.type,Un,e,t)}Xn.displayName="MenuContext";let Zn=r.Fragment,Qn=nn((function(e,t){let n=(0,r.useReducer)(Kn,{menuState:1,buttonRef:(0,r.createRef)(),itemsRef:(0,r.createRef)(),items:[],searchQuery:"",activeItemIndex:null,activationTrigger:1}),[{menuState:i,itemsRef:o,buttonRef:a},s]=n,l=fn(t);!function(e,t,n=!0){let i=(0,r.useRef)(!1);function o(n,r){if(!i.current||n.defaultPrevented)return;let o=function e(t){return"function"==typeof t?e(t()):Array.isArray(t)||t instanceof Set?t:[t]}(e),a=r(n);if(null!==a&&a.ownerDocument.documentElement.contains(a)){for(let e of o){if(null===e)continue;let t=e instanceof HTMLElement?e:e.current;if(null!=t&&t.contains(a))return}return!Nn(a,Dn.Loose)&&-1!==a.tabIndex&&n.preventDefault(),t(n,a)}}(0,r.useEffect)((()=>{requestAnimationFrame((()=>{i.current=n}))}),[n]);let a=(0,r.useRef)(null);In("mousedown",(e=>{var t,n;i.current&&(a.current=(null==(n=null==(t=e.composedPath)?void 0:t.call(e))?void 0:n[0])||e.target)}),!0),In("click",(e=>{!a.current||(o(e,(()=>a.current)),a.current=null)}),!0),In("blur",(e=>o(e,(()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null))),!0)}([a,o],((e,t)=>{var n;s({type:1}),Nn(t,Dn.Loose)||(e.preventDefault(),null==(n=a.current)||n.focus())}),0===i);let c=(0,r.useMemo)((()=>({open:0===i})),[i]),u=e,d={ref:l};return r.default.createElement(Xn.Provider,{value:n},r.default.createElement(zn,{value:Kt(i,{0:Bn.Open,1:Bn.Closed})},Jt({ourProps:d,theirProps:u,slot:c,defaultTag:Zn,name:"Menu"})))})),Jn=nn((function(e,t){var n;let[i,o]=$n("Menu.Button"),a=fn(i.buttonRef,t),s=`headlessui-menu-button-${bn()}`,l=sn(),c=dn((e=>{switch(e.key){case xn.Space:case xn.Enter:case xn.ArrowDown:e.preventDefault(),e.stopPropagation(),o({type:0}),l.nextFrame((()=>o({type:2,focus:wn.First})));break;case xn.ArrowUp:e.preventDefault(),e.stopPropagation(),o({type:0}),l.nextFrame((()=>o({type:2,focus:wn.Last})))}})),u=dn((e=>{if(e.key===xn.Space)e.preventDefault()})),d=dn((t=>{if(_n(t.currentTarget))return t.preventDefault();e.disabled||(0===i.menuState?(o({type:1}),l.nextFrame((()=>{var e;return null==(e=i.buttonRef.current)?void 0:e.focus({preventScroll:!0})}))):(t.preventDefault(),o({type:0})))})),h=(0,r.useMemo)((()=>({open:0===i.menuState})),[i]),f=e;return Jt({ourProps:{ref:a,id:s,type:Gn(e,i.buttonRef),"aria-haspopup":!0,"aria-controls":null==(n=i.itemsRef.current)?void 0:n.id,"aria-expanded":e.disabled?void 0:0===i.menuState,onKeyDown:c,onKeyUp:u,onClick:d},theirProps:f,slot:h,defaultTag:"button",name:"Menu.Button"})})),er=Zt.RenderStrategy|Zt.Static,tr=nn((function(e,t){var n,i;let[o,a]=$n("Menu.Items"),s=fn(o.itemsRef,t),l=function(...e){return(0,r.useMemo)((()=>kn(...e)),[...e])}(o.itemsRef),c=`headlessui-menu-items-${bn()}`,u=sn(),d=Fn(),h=null!==d?d===Bn.Open:0===o.menuState;(0,r.useEffect)((()=>{let e=o.itemsRef.current;!e||0===o.menuState&&e!==(null==l?void 0:l.activeElement)&&e.focus({preventScroll:!0})}),[o.menuState,o.itemsRef,l]),function({container:e,accept:t,walk:n,enabled:i=!0}){let o=(0,r.useRef)(t),a=(0,r.useRef)(n);(0,r.useEffect)((()=>{o.current=t,a.current=n}),[t,n]),cn((()=>{if(!e||!i)return;let t=kn(e);if(!t)return;let n=o.current,r=a.current,s=Object.assign((e=>n(e)),{acceptNode:n}),l=t.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,s,!1);for(;l.nextNode();)r(l.currentNode)}),[e,i,o,a])}({container:o.itemsRef.current,enabled:0===o.menuState,accept:e=>"menuitem"===e.getAttribute("role")?NodeFilter.FILTER_REJECT:e.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT,walk(e){e.setAttribute("role","none")}});let f=dn((e=>{var t,n;switch(u.dispose(),e.key){case xn.Space:if(""!==o.searchQuery)return e.preventDefault(),e.stopPropagation(),a({type:3,value:e.key});case xn.Enter:if(e.preventDefault(),e.stopPropagation(),a({type:1}),null!==o.activeItemIndex){let{dataRef:e}=o.items[o.activeItemIndex];null==(n=null==(t=e.current)?void 0:t.domRef.current)||n.click()}On(o.buttonRef.current);break;case xn.ArrowDown:return e.preventDefault(),e.stopPropagation(),a({type:2,focus:wn.Next});case xn.ArrowUp:return e.preventDefault(),e.stopPropagation(),a({type:2,focus:wn.Previous});case xn.Home:case xn.PageUp:return e.preventDefault(),e.stopPropagation(),a({type:2,focus:wn.First});case xn.End:case xn.PageDown:return e.preventDefault(),e.stopPropagation(),a({type:2,focus:wn.Last});case xn.Escape:e.preventDefault(),e.stopPropagation(),a({type:1}),an().nextFrame((()=>{var e;return null==(e=o.buttonRef.current)?void 0:e.focus({preventScroll:!0})}));break;case xn.Tab:e.preventDefault(),e.stopPropagation(),a({type:1}),an().nextFrame((()=>{Rn(o.buttonRef.current,e.shiftKey?Pn.Previous:Pn.Next)}));break;default:1===e.key.length&&(a({type:3,value:e.key}),u.setTimeout((()=>a({type:4})),350))}})),p=dn((e=>{if(e.key===xn.Space)e.preventDefault()})),v=(0,r.useMemo)((()=>({open:0===o.menuState})),[o]),g=e;return Jt({ourProps:{"aria-activedescendant":null===o.activeItemIndex||null==(n=o.items[o.activeItemIndex])?void 0:n.id,"aria-labelledby":null==(i=o.buttonRef.current)?void 0:i.id,id:c,onKeyDown:f,onKeyUp:p,role:"menu",tabIndex:0,ref:s},theirProps:g,slot:v,defaultTag:"div",features:er,visible:h,name:"Menu.Items"})})),nr=r.Fragment,rr=nn((function(e,t){let{disabled:n=!1,...i}=e,[o,a]=$n("Menu.Item"),s=`headlessui-menu-item-${bn()}`,l=null!==o.activeItemIndex&&o.items[o.activeItemIndex].id===s,c=(0,r.useRef)(null),u=fn(t,c);cn((()=>{if(0!==o.menuState||!l||0===o.activationTrigger)return;let e=an();return e.requestAnimationFrame((()=>{var e,t;null==(t=null==(e=c.current)?void 0:e.scrollIntoView)||t.call(e,{block:"nearest"})})),e.dispose}),[c,l,o.menuState,o.activationTrigger,o.activeItemIndex]);let d=(0,r.useRef)({disabled:n,domRef:c});cn((()=>{d.current.disabled=n}),[d,n]),cn((()=>{var e,t;d.current.textValue=null==(t=null==(e=c.current)?void 0:e.textContent)?void 0:t.toLowerCase()}),[d,c]),cn((()=>(a({type:5,id:s,dataRef:d}),()=>a({type:6,id:s}))),[d,s]);let h=dn((e=>{if(n)return e.preventDefault();a({type:1}),On(o.buttonRef.current)})),f=dn((()=>{if(n)return a({type:2,focus:wn.Nothing});a({type:2,focus:wn.Specific,id:s})})),p=dn((()=>{n||l||a({type:2,focus:wn.Specific,id:s,trigger:0})})),v=dn((()=>{n||!l||a({type:2,focus:wn.Nothing})})),g=(0,r.useMemo)((()=>({active:l,disabled:n})),[l,n]);return Jt({ourProps:{id:s,ref:u,role:"menuitem",tabIndex:!0===n?void 0:-1,"aria-disabled":!0===n||void 0,disabled:void 0,onClick:h,onFocus:f,onPointerMove:p,onMouseMove:p,onPointerLeave:v,onMouseLeave:v},theirProps:i,slot:g,defaultTag:nr,name:"Menu.Item"})})),ir=Object.assign(Qn,{Button:Jn,Items:tr,Item:rr});function or(){let e=(0,r.useRef)(!1);return cn((()=>(e.current=!0,()=>{e.current=!1})),[]),e}function ar(e,...t){e&&t.length>0&&e.classList.add(...t)}function sr(e,...t){e&&t.length>0&&e.classList.remove(...t)}var lr=(e=>(e.Ended="ended",e.Cancelled="cancelled",e))(lr||{});function cr(e,t,n,r){let i=n?"enter":"leave",o=an(),a=void 0!==r?function(e){let t={called:!1};return(...n)=>{if(!t.called)return t.called=!0,e(...n)}}(r):()=>{};"enter"===i&&(e.removeAttribute("hidden"),e.style.display="");let s=Kt(i,{enter:()=>t.enter,leave:()=>t.leave}),l=Kt(i,{enter:()=>t.enterTo,leave:()=>t.leaveTo}),c=Kt(i,{enter:()=>t.enterFrom,leave:()=>t.leaveFrom});return sr(e,...t.enter,...t.enterTo,...t.enterFrom,...t.leave,...t.leaveFrom,...t.leaveTo,...t.entered),ar(e,...s,...c),o.nextFrame((()=>{sr(e,...c),ar(e,...l),function(e,t){let n=an();if(!e)return n.dispose;let{transitionDuration:r,transitionDelay:i}=getComputedStyle(e),[o,a]=[r,i].map((e=>{let[t=0]=e.split(",").filter(Boolean).map((e=>e.includes("ms")?parseFloat(e):1e3*parseFloat(e))).sort(((e,t)=>t-e));return t}));if(o+a!==0){let r=[];r.push(n.addEventListener(e,"transitionrun",(i=>{i.target===i.currentTarget&&(r.splice(0).forEach((e=>e())),r.push(n.addEventListener(e,"transitionend",(e=>{e.target===e.currentTarget&&(t("ended"),r.splice(0).forEach((e=>e())))})),n.addEventListener(e,"transitioncancel",(e=>{e.target===e.currentTarget&&(t("cancelled"),r.splice(0).forEach((e=>e())))}))))})))}else t("ended");n.add((()=>t("cancelled"))),n.dispose}(e,(n=>("ended"===n&&(sr(e,...s),ar(e,...t.entered)),a(n))))})),o.dispose}function ur(e=""){return e.split(" ").filter((e=>e.trim().length>1))}let dr=(0,r.createContext)(null);dr.displayName="TransitionContext";var hr=(e=>(e.Visible="visible",e.Hidden="hidden",e))(hr||{});let fr=(0,r.createContext)(null);function pr(e){return"children"in e?pr(e.children):e.current.filter((({el:e})=>null!==e.current)).filter((({state:e})=>"visible"===e)).length>0}function vr(e,t){let n=un(e),i=(0,r.useRef)([]),o=or(),a=sn(),s=dn(((e,t=Qt.Hidden)=>{let r=i.current.findIndex((({el:t})=>t===e));-1!==r&&(Kt(t,{[Qt.Unmount](){i.current.splice(r,1)},[Qt.Hidden](){i.current[r].state="hidden"}}),a.microTask((()=>{var e;!pr(i)&&o.current&&(null==(e=n.current)||e.call(n))})))})),l=dn((e=>{let t=i.current.find((({el:t})=>t===e));return t?"visible"!==t.state&&(t.state="visible"):i.current.push({el:e,state:"visible"}),()=>s(e,Qt.Unmount)})),c=(0,r.useRef)([]),u=(0,r.useRef)(Promise.resolve()),d=(0,r.useRef)({enter:[],leave:[],idle:[]}),h=dn(((e,n,r)=>{c.current.splice(0),t&&(t.chains.current[n]=t.chains.current[n].filter((([t])=>t!==e))),null==t||t.chains.current[n].push([e,new Promise((e=>{c.current.push(e)}))]),null==t||t.chains.current[n].push([e,new Promise((e=>{Promise.all(d.current[n].map((([e,t])=>t))).then((()=>e()))}))]),"enter"===n?u.current=u.current.then((()=>null==t?void 0:t.wait.current)).then((()=>r(n))):r(n)})),f=dn(((e,t,n)=>{Promise.all(d.current[t].splice(0).map((([e,t])=>t))).then((()=>{var e;null==(e=c.current.shift())||e()})).then((()=>n(t)))}));return(0,r.useMemo)((()=>({children:i,register:l,unregister:s,onStart:h,onStop:f,wait:u,chains:d})),[l,s,i,h,f,d,u])}function gr(){}fr.displayName="NestingContext";let mr=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function yr(e){var t;let n={};for(let r of mr)n[r]=null!=(t=e[r])?t:gr;return n}let br=Zt.RenderStrategy,xr=nn((function(e,t){let{beforeEnter:n,afterEnter:i,beforeLeave:o,afterLeave:a,enter:s,enterFrom:l,enterTo:c,entered:u,leave:d,leaveFrom:h,leaveTo:f,...p}=e,v=(0,r.useRef)(null),g=fn(v,t),m=p.unmount?Qt.Unmount:Qt.Hidden,{show:y,appear:b,initial:x}=function(){let e=(0,r.useContext)(dr);if(null===e)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}(),[w,E]=(0,r.useState)(y?"visible":"hidden"),_=function(){let e=(0,r.useContext)(fr);if(null===e)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}(),{register:k,unregister:S}=_,P=(0,r.useRef)(null);(0,r.useEffect)((()=>k(v)),[k,v]),(0,r.useEffect)((()=>{if(m===Qt.Hidden&&v.current)return y&&"visible"!==w?void E("visible"):Kt(w,{hidden:()=>S(v),visible:()=>k(v)})}),[w,v,k,S,y,m]);let j=un({enter:ur(s),enterFrom:ur(l),enterTo:ur(c),entered:ur(u),leave:ur(d),leaveFrom:ur(h),leaveTo:ur(f)}),C=function(e){let t=(0,r.useRef)(yr(e));return(0,r.useEffect)((()=>{t.current=yr(e)}),[e]),t}({beforeEnter:n,afterEnter:i,beforeLeave:o,afterLeave:a}),T=vn();(0,r.useEffect)((()=>{if(T&&"visible"===w&&null===v.current)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")}),[v,w,T]);let D=x&&!b,N=!T||D||P.current===y?"idle":y?"enter":"leave",O=dn((e=>Kt(e,{enter:()=>C.current.beforeEnter(),leave:()=>C.current.beforeLeave(),idle:()=>{}}))),M=dn((e=>Kt(e,{enter:()=>C.current.afterEnter(),leave:()=>C.current.afterLeave(),idle:()=>{}}))),A=vr((()=>{E("hidden"),S(v)}),_);(function({container:e,direction:t,classes:n,onStart:r,onStop:i}){let o=or(),a=sn(),s=un(t);cn((()=>{let t=an();a.add(t.dispose);let l=e.current;if(l&&"idle"!==s.current&&o.current)return t.dispose(),r.current(s.current),t.add(cr(l,n.current,"enter"===s.current,(e=>{t.dispose(),Kt(e,{[lr.Ended](){i.current(s.current)},[lr.Cancelled]:()=>{}})}))),t.dispose}),[t])})({container:v,classes:j,direction:N,onStart:un((e=>{A.onStart(v,e,O)})),onStop:un((e=>{A.onStop(v,e,M),"leave"===e&&!pr(A)&&(E("hidden"),S(v))}))}),(0,r.useEffect)((()=>{!D||(m===Qt.Hidden?P.current=null:P.current=y)}),[y,D,w]);let R=p,I={ref:g};return r.default.createElement(fr.Provider,{value:A},r.default.createElement(zn,{value:Kt(w,{visible:Bn.Open,hidden:Bn.Closed})},Jt({ourProps:I,theirProps:R,defaultTag:"div",features:br,visible:"visible"===w,name:"Transition.Child"})))})),wr=nn((function(e,t){let{show:n,appear:i=!1,unmount:o,...a}=e,s=(0,r.useRef)(null),l=fn(s,t);vn();let c=Fn();if(void 0===n&&null!==c&&(n=Kt(c,{[Bn.Open]:!0,[Bn.Closed]:!1})),![!0,!1].includes(n))throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[u,d]=(0,r.useState)(n?"visible":"hidden"),h=vr((()=>{d("hidden")})),[f,p]=(0,r.useState)(!0),v=(0,r.useRef)([n]);cn((()=>{!1!==f&&v.current[v.current.length-1]!==n&&(v.current.push(n),p(!1))}),[v,n]);let g=(0,r.useMemo)((()=>({show:n,appear:i,initial:f})),[n,i,f]);(0,r.useEffect)((()=>{if(n)d("visible");else if(pr(h)){let e=s.current;if(!e)return;let t=e.getBoundingClientRect();0===t.x&&0===t.y&&0===t.width&&0===t.height&&d("hidden")}else d("hidden")}),[n,h]);let m={unmount:o};return r.default.createElement(fr.Provider,{value:h},r.default.createElement(dr.Provider,{value:g},Jt({ourProps:{...m,as:r.Fragment,children:r.default.createElement(xr,{ref:l,...m,...a})},theirProps:{},defaultTag:r.Fragment,features:br,visible:"visible"===u,name:"Transition"})))})),Er=nn((function(e,t){let n=null!==(0,r.useContext)(dr),i=null!==Fn();return r.default.createElement(r.default.Fragment,null,!n&&i?r.default.createElement(wr,{ref:t,...e}):r.default.createElement(xr,{ref:t,...e}))})),_r=Object.assign(wr,{Child:Er,Root:wr});const kr=r.forwardRef((function({title:e,titleId:t,...n},i){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:i,"aria-labelledby":t},n),e?r.createElement("title",{id:t},e):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 17.25v1.007a3 3 0 01-.879 2.122L7.5 21h9l-.621-.621A3 3 0 0115 18.257V17.25m6-12V15a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 15V5.25m18 0A2.25 2.25 0 0018.75 3H5.25A2.25 2.25 0 003 5.25m18 0V12a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 12V5.25"}))}));const Sr=r.forwardRef((function({title:e,titleId:t,...n},i){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:i,"aria-labelledby":t},n),e?r.createElement("title",{id:t},e):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 3v2.25m6.364.386l-1.591 1.591M21 12h-2.25m-.386 6.364l-1.591-1.591M12 18.75V21m-4.773-4.227l-1.591 1.591M5.25 12H3m4.227-4.773L5.636 5.636M15.75 12a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0z"}))}));const Pr=r.forwardRef((function({title:e,titleId:t,...n},i){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:i,"aria-labelledby":t},n),e?r.createElement("title",{id:t},e):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21.752 15.002A9.718 9.718 0 0118 15.75c-5.385 0-9.75-4.365-9.75-9.75 0-1.33.266-2.597.748-3.752A9.753 9.753 0 003 11.25C3 16.635 7.365 21 12.75 21a9.753 9.753 0 009.002-5.998z"}))}));function jr(){const[e,t]=(0,r.useState)(localStorage.getItem(P)||"system");return(0,r.useEffect)((()=>{T(e)}),[e]),w(ir,{as:"div",className:"relative inline-block text-left",children:[w("div",{children:w(ir.Button,{className:"inline-flex w-full justify-center rounded-md p-2 text-sm font-medium focus:outline-none focus-visible:ring-2 focus-visible:ring-white focus-visible:ring-opacity-75 dark:text-sky-500","data-cy":"theme-open-modal-button",children:[w("span",{className:"sr-only",children:"Theme switcher"}),"system"===e&&w(kr,{className:"h-4 w-4","aria-hidden":"true"}),"light"===e&&w(Sr,{className:"h-4 w-4","aria-hidden":"true"}),"dark"===e&&w(Pr,{className:"h-4 w-4","aria-hidden":"true"})]})}),w(_r,{as:r.Fragment,enter:"transition ease-out duration-100",enterFrom:"transform opacity-0 scale-95",enterTo:"transform opacity-100 scale-100",leave:"transition ease-in duration-75",leaveFrom:"transform opacity-100 scale-100",leaveTo:"transform opacity-0 scale-95",children:w(ir.Items,{className:"absolute right-0 z-50 mt-2 w-36 origin-top-right rounded-md bg-white text-slate-500 shadow-lg ring-1 ring-slate-900/10 ring-opacity-5 focus:outline-none dark:bg-slate-800 dark:text-slate-400 dark:ring-0",children:w("div",{className:"px-1 py-1",children:[w(ir.Item,{children:({active:n})=>w("button",{"data-cy":"system-theme-button",className:Ht()("system"===e?"text-blue-500 dark:text-sky-500":"",n?"bg-slate-50 dark:bg-slate-600/30":"","group flex w-full items-center rounded-md px-2 py-2 text-sm"),onClick:()=>t("system"),children:[w(kr,{className:"mr-2 h-4 w-4","aria-hidden":"true"}),"System"]})}),w(ir.Item,{children:({active:n})=>w("button",{"data-cy":"light-theme-button",className:Ht()("light"===e?"text-blue-500 dark:text-sky-500":"",n?"bg-slate-50 dark:bg-slate-600/30":"","group flex w-full items-center rounded-md px-2 py-2 text-sm"),onClick:()=>t("light"),children:[w(Sr,{className:"mr-2 h-4 w-4","aria-hidden":"true"}),"Light"]})}),w(ir.Item,{children:({active:n})=>w("button",{"data-cy":"dark-theme-button",className:Ht()("dark"===e?"text-blue-500 dark:text-sky-500":"",n?"bg-slate-50 dark:bg-slate-600/30":"","group flex w-full items-center rounded-md px-2 py-2 text-sm"),onClick:()=>t("dark"),children:[w(Pr,{className:"mr-2 h-4 w-4","aria-hidden":"true"}),"Dark"]})})]})})})]})}const Cr=()=>{const[e,t]=(0,r.useState)(),[n,i]=(0,r.useState)(),o=ct();if(o.pathname===e)return n;t(o.pathname);const a=Y(va(),o).at(-1),{environment:s}=$t();let l;return l="dev"===s?{workspace:a.pathname.split("/")[1],currentPath:`/${a.pathname.split("/").slice(2).join("/")}`}:{workspace:"local",currentPath:a.pathname},i(l),l};const Tr=function(e){return Xt().appConfig.showExperimentalFeatures?r.Children.map(e.children,(e=>(0,r.cloneElement)(e,{"data-cy":"experimental-feature"}))):null};const Dr=r.forwardRef((function({title:e,titleId:t,...n},i){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:i,"aria-labelledby":t},n),e?r.createElement("title",{id:t},e):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 7.5L7.5 3m0 0L12 7.5M7.5 3v13.5m13.5 0L16.5 21m0 0L12 16.5m4.5 4.5V7.5"}))}));const Nr=r.forwardRef((function({title:e,titleId:t,...n},i){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:i,"aria-labelledby":t},n),e?r.createElement("title",{id:t},e):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7.5 21L3 16.5m0 0L7.5 12M3 16.5h13.5m0-13.5L21 7.5m0 0L16.5 12M21 7.5H7.5"}))}));function Or(){const[e,t]=(0,r.useState)(localStorage.getItem(N)||"TB");return(0,r.useEffect)((()=>{M(e)}),[e]),w("div",{className:"relative inline-block text-left",children:w("button",{className:"inline-flex w-full justify-center rounded-md p-2 text-sm font-medium focus:outline-none focus-visible:ring-2 focus-visible:ring-white focus-visible:ring-opacity-75 dark:text-sky-500","data-cy":"rankdir-change-button",children:[w("span",{className:"sr-only",children:"Graph layout direction switcher"}),"TB"===e&&w("button",{title:"Set graph direction to left-to-right","data-cy":"lr-rankdir-button",onClick:()=>t("LR"),children:w(Dr,{className:"h-4 w-4","aria-hidden":"true"})}),"LR"===e&&w("button",{title:"Set graph direction to top-to-bottom","data-cy":"tb-rankdir-button",onClick:()=>t("TB"),children:w(Nr,{className:"h-4 w-4","aria-hidden":"true"})})]})})}var Mr=n(36021);const Ar={on:{updateGraph:{target:"customSelected",actions:[(0,Mr.f0)(((e,t)=>{const n=e.projects.map((e=>e.name)),r=t.projects.map((e=>e.name)).filter((e=>!n.includes(e)));e.selectedProjects=[...e.selectedProjects,...r]})),"setGraph",(0,l.send)(((e,t)=>({type:"notifyGraphUpdateGraph",projects:e.projects,dependencies:e.dependencies,affectedProjects:e.affectedProjects,workspaceLayout:e.workspaceLayout,groupByFolder:e.groupByFolder,selectedProjects:e.selectedProjects})),{to:e=>e.graphActor})]}}},Rr={entry:[(0,Mr.f0)(((e,t)=>{"focusProject"===t.type&&(e.focusedProject=t.projectName)})),"notifyGraphFocusProject"],exit:[(0,Mr.f0)((e=>{e.focusedProject=null}))],on:{incrementSearchDepth:{actions:["incrementSearchDepth","notifyGraphFocusProject"]},decrementSearchDepth:{actions:["decrementSearchDepth","notifyGraphFocusProject"]},setSearchDepthEnabled:{actions:["setSearchDepthEnabled","notifyGraphFocusProject"]},setSearchDepth:{actions:["setSearchDepth","notifyGraphFocusProject"]},unfocusProject:{target:"unselected"},updateGraph:{actions:["setGraph",(0,l.send)(((e,t)=>({type:"notifyGraphUpdateGraph",projects:e.projects,dependencies:e.dependencies,affectedProjects:e.affectedProjects,workspaceLayout:e.workspaceLayout,groupByFolder:e.groupByFolder,selectedProjects:e.selectedProjects})),{to:e=>e.graphActor}),"notifyGraphFocusProject"]}}},Ir=(e,t)=>{const n=k();t((t=>{const{selectedProjectNames:r,perfReport:i}=n.handleProjectEvent(t);e({type:"setSelectedProjectsFromGraph",selectedProjectNames:r,perfReport:i})}))},Lr={entry:[(0,Mr.f0)(((e,t)=>{"filterByText"===t.type&&(e.textFilter=t.search)})),"notifyGraphFilterProjectsByText"],on:{clearTextFilter:{target:"unselected",actions:(0,Mr.f0)((e=>{e.includePath=!1,e.textFilter=""}))},setIncludeProjectsByPath:{actions:["setIncludeProjectsByPath","notifyGraphFilterProjectsByText"]},incrementSearchDepth:{actions:["incrementSearchDepth","notifyGraphFilterProjectsByText"]},decrementSearchDepth:{actions:["decrementSearchDepth","notifyGraphFilterProjectsByText"]},setSearchDepthEnabled:{actions:["setSearchDepthEnabled","notifyGraphFilterProjectsByText"]},updateGraph:{actions:["setGraph",(0,l.send)(((e,t)=>({type:"notifyGraphUpdateGraph",projects:e.projects,dependencies:e.dependencies,affectedProjects:e.affectedProjects,workspaceLayout:e.workspaceLayout,groupByFolder:e.groupByFolder,selectedProjects:e.selectedProjects})),{to:e=>e.graphActor}),"notifyGraphFilterProjectsByText"]}}},Br={entry:[(0,Mr.f0)(((e,t)=>{"setTracingStart"===t.type?e.tracing.start=t.projectName:"setTracingEnd"===t.type&&(e.tracing.end=t.projectName)})),"notifyGraphTracing"],exit:[(0,Mr.f0)(((e,t)=>{"setTracingStart"!==t.type&&"setTracingEnd"!==t.type&&(e.tracing.start=null,e.tracing.end=null)}))],on:{clearTraceStart:{actions:[(0,Mr.f0)((e=>{e.tracing.start=null})),"notifyGraphTracing"]},clearTraceEnd:{actions:[(0,Mr.f0)((e=>{e.tracing.end=null})),"notifyGraphTracing"]}}},Fr={entry:["notifyGraphHideAllProjects"],on:{updateGraph:{target:"customSelected",actions:[(0,Mr.f0)(((e,t)=>{const n=e.projects.map((e=>e.name)),r=t.projects.map((e=>e.name)).filter((e=>!n.includes(e)));e.selectedProjects=[...e.selectedProjects,...r]})),"setGraph",(0,l.send)(((e,t)=>({type:"notifyGraphUpdateGraph",projects:e.projects,dependencies:e.dependencies,affectedProjects:e.affectedProjects,workspaceLayout:e.workspaceLayout,groupByFolder:e.groupByFolder,selectedProjects:e.selectedProjects})),{to:e=>e.graphActor})]}}},zr=(0,s.C)({predictableActionArguments:!0,id:"project-graph",initial:"idle",context:{projects:[],dependencies:{},affectedProjects:[],selectedProjects:[],focusedProject:null,textFilter:"",includePath:!1,searchDepth:1,searchDepthEnabled:!0,groupByFolder:!1,collapseEdges:!1,workspaceLayout:{libsDir:"",appsDir:""},graphActor:null,lastPerfReport:{numEdges:0,numNodes:0,renderTime:0},tracing:{start:null,end:null,algorithm:"shortest"}},states:{idle:{},unselected:Fr,customSelected:Ar,focused:Rr,textFiltered:Lr,tracing:Br},on:{setProjects:{target:"unselected",actions:["setGraph",(0,l.send)(((e,t)=>({type:"notifyGraphInitGraph",projects:e.projects,dependencies:e.dependencies,affectedProjects:e.affectedProjects,workspaceLayout:e.workspaceLayout,groupByFolder:e.groupByFolder,collapseEdges:e.collapseEdges})),{to:e=>e.graphActor})]},setSelectedProjectsFromGraph:{actions:[(0,Mr.f0)(((e,t)=>{e.selectedProjects=t.selectedProjectNames,e.lastPerfReport=t.perfReport}))]},selectProject:{target:"customSelected",actions:["notifyGraphShowProjects"]},selectProjects:{target:"customSelected",actions:["notifyGraphShowProjects"]},selectAll:{target:"customSelected",actions:["notifyGraphShowAllProjects"]},selectAffected:{target:"customSelected",actions:["notifyGraphShowAffectedProjects"]},deselectProject:[{target:"unselected",cond:"deselectLastProject"},{target:"customSelected",actions:["notifyGraphHideProjects"]}],deselectProjects:[{target:"unselected",cond:"deselectLastProject"},{target:"customSelected",actions:["notifyGraphHideProjects"]}],deselectAll:{target:"unselected"},focusProject:{target:"focused"},setTracingStart:{target:"tracing"},setTracingEnd:{target:"tracing"},setCollapseEdges:{actions:["setCollapseEdges",(0,l.send)(((e,t)=>({type:"notifyGraphUpdateGraph",projects:e.projects,dependencies:e.dependencies,affectedProjects:e.affectedProjects,workspaceLayout:e.workspaceLayout,groupByFolder:e.groupByFolder,collapseEdges:e.collapseEdges,selectedProjects:e.selectedProjects})),{to:e=>e.graphActor})]},setGroupByFolder:{actions:["setGroupByFolder",(0,l.send)(((e,t)=>({type:"notifyGraphUpdateGraph",projects:e.projects,dependencies:e.dependencies,affectedProjects:e.affectedProjects,workspaceLayout:e.workspaceLayout,groupByFolder:e.groupByFolder,collapseEdges:e.collapseEdges,selectedProjects:e.selectedProjects})),{to:e=>e.graphActor})]},setIncludeProjectsByPath:{actions:[(0,Mr.f0)(((e,t)=>{e.includePath=t.includeProjectsByPath}))]},incrementSearchDepth:{actions:["incrementSearchDepth"]},decrementSearchDepth:{actions:["decrementSearchDepth"]},setSearchDepthEnabled:{actions:["setSearchDepthEnabled"]},setSearchDepth:{actions:["setSearchDepth"]},setTracingAlgorithm:{actions:[(0,Mr.f0)(((e,t)=>{e.tracing.algorithm=t.algorithm})),"notifyGraphTracing"]},filterByText:{target:"textFiltered"}}},{guards:{deselectLastProject:e=>e.selectedProjects.length<=1},actions:{setGroupByFolder:(0,Mr.f0)(((e,t)=>{"setGroupByFolder"===t.type&&(e.groupByFolder=t.groupByFolder)})),setCollapseEdges:(0,Mr.f0)(((e,t)=>{"setCollapseEdges"===t.type&&(e.collapseEdges=t.collapseEdges)})),incrementSearchDepth:(0,Mr.f0)((e=>{e.searchDepthEnabled=!0,e.searchDepth=e.searchDepth+1})),decrementSearchDepth:(0,Mr.f0)((e=>{e.searchDepthEnabled=!0,e.searchDepth=e.searchDepth>1?e.searchDepth-1:1})),setSearchDepth:(0,Mr.f0)(((e,t)=>{"setSearchDepth"===t.type&&(e.searchDepthEnabled=!0,e.searchDepth=t.searchDepth>1?t.searchDepth:1)})),setSearchDepthEnabled:(0,Mr.f0)(((e,t)=>{"setSearchDepthEnabled"===t.type&&(e.searchDepthEnabled=t.searchDepthEnabled)})),setIncludeProjectsByPath:(0,Mr.f0)(((e,t)=>{"setIncludeProjectsByPath"===t.type&&(e.includePath=t.includeProjectsByPath)})),setGraph:(0,Mr.f0)(((e,t)=>{"setProjects"!==t.type&&"updateGraph"!==t.type||(e.projects=t.projects,e.dependencies=t.dependencies,e.graphActor=(0,o.Cs)(Ir,"graphActor"),"setProjects"===t.type&&(e.workspaceLayout=t.workspaceLayout,e.affectedProjects=t.affectedProjects))})),notifyGraphTracing:(0,l.send)(((e,t)=>({type:"notifyGraphTracing",start:e.tracing.start,end:e.tracing.end,algorithm:e.tracing.algorithm})),{to:e=>e.graphActor}),notifyGraphShowProjects:(0,l.send)(((e,t)=>{if("selectProject"===t.type||"selectProjects"===t.type)return"selectProject"===t.type?{type:"notifyGraphShowProjects",projectNames:[t.projectName]}:{type:"notifyGraphShowProjects",projectNames:t.projectNames}}),{to:e=>e.graphActor}),notifyGraphHideProjects:(0,l.send)(((e,t)=>{if("deselectProject"===t.type||"deselectProjects"===t.type)return"deselectProject"===t.type?{type:"notifyGraphHideProjects",projectNames:[t.projectName]}:{type:"notifyGraphHideProjects",projectNames:t.projectNames}}),{to:e=>e.graphActor}),notifyGraphShowAllProjects:(0,l.send)(((e,t)=>({type:"notifyGraphShowAllProjects"})),{to:e=>e.graphActor}),notifyGraphHideAllProjects:(0,l.send)(((e,t)=>({type:"notifyGraphHideAllProjects"})),{to:e=>e.graphActor}),notifyGraphShowAffectedProjects:(0,l.send)({type:"notifyGraphShowAffectedProjects"},{to:e=>e.graphActor}),notifyGraphFocusProject:(0,l.send)(((e,t)=>({type:"notifyGraphFocusProject",projectName:e.focusedProject,searchDepth:e.searchDepthEnabled?e.searchDepth:-1})),{to:e=>e.graphActor}),notifyGraphFilterProjectsByText:(0,l.send)(((e,t)=>({type:"notifyGraphFilterProjectsByText",search:e.textFilter,includeProjectsByPath:e.includePath,searchDepth:e.searchDepthEnabled?e.searchDepth:-1})),{to:e=>e.graphActor})}});let Vr=(0,o.kJ)(zr,{devTools:!!window.useXstateInspect});function Gr(){return Vr.status===o.TM.NotStarted&&Vr.start(),Vr}const Hr=r.forwardRef((function({title:e,titleId:t,...n},i){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",ref:i,"aria-labelledby":t},n),e?r.createElement("title",{id:t},e):null,r.createElement("path",{fillRule:"evenodd",d:"M11.54 22.351l.07.04.028.016a.76.76 0 00.723 0l.028-.015.071-.041a16.975 16.975 0 001.144-.742 19.58 19.58 0 002.683-2.282c1.944-1.99 3.963-4.98 3.963-8.827a8.25 8.25 0 00-16.5 0c0 3.846 2.02 6.837 3.963 8.827a19.58 19.58 0 002.682 2.282 16.975 16.975 0 001.145.742zM12 13.5a3 3 0 100-6 3 3 0 000 6z",clipRule:"evenodd"}))}));const Wr=r.forwardRef((function({title:e,titleId:t,...n},i){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",ref:i,"aria-labelledby":t},n),e?r.createElement("title",{id:t},e):null,r.createElement("path",{fillRule:"evenodd",d:"M3 2.25a.75.75 0 01.75.75v.54l1.838-.46a9.75 9.75 0 016.725.738l.108.054a8.25 8.25 0 005.58.652l3.109-.732a.75.75 0 01.917.81 47.784 47.784 0 00.005 10.337.75.75 0 01-.574.812l-3.114.733a9.75 9.75 0 01-6.594-.77l-.108-.054a8.25 8.25 0 00-5.69-.625l-2.202.55V21a.75.75 0 01-1.5 0V3A.75.75 0 013 2.25z",clipRule:"evenodd"}))})),qr=["className","children"];const Yr=function(e){let{className:t,children:n}=e,r=Wt(e,qr);return w("span",Object.assign({className:`${t} inline-block rounded-md bg-slate-300 p-2 font-sans text-xs font-semibold uppercase leading-4 tracking-wide text-slate-700`},r,{children:n}))},Ur=["className","children"],Xr=["to","className","children"],$r="inline-flex justify-center rounded-md border border-slate-300 bg-slate-50 py-2 px-4 mt-2 text-slate-500 hover:bg-slate-100 dark:border-slate-600 dark:bg-slate-800 dark:text-slate-300 hover:dark:bg-slate-700";function Kr(e){let{className:t,children:n}=e,r=Wt(e,Ur);return w("button",Object.assign({className:`${$r} ${t}`},r,{children:n}))}function Zr(e){let{to:t,className:n,children:r}=e,i=Wt(e,Xr);return w(Rt,Object.assign({className:`${$r} ${n}`,to:t},i,{children:r}))}const Qr=()=>{const{environment:e}=$t(),{selectedWorkspaceId:t}=ht(),[n]=Bt();return(r,i)=>{let o="";return"object"==typeof r?(o="dev"===e?`/${t}${r.pathname}`:r.pathname,Object.assign({},r,{pathname:o,search:i?n.toString():""})):"string"==typeof r?(o="dev"===e?`/${t}${r}`:r,{pathname:o,search:i?n.toString():""}):void 0}};function Jr(e,t){const n=e.replace(t,"").split("/").filter((e=>""!==e));return n.pop(),n}function ei(e,t){return t.filter((t=>t.type===e)).sort(((e,t)=>e.name.localeCompare(t.name)))}function ti(e,t){let n={};return e.forEach((e=>{const r="app"===e.type||"e2e"===e.type?t.appsDir:t.libsDir,i=Jr(e.data.root,r).join("/");n.hasOwnProperty(i)||(n[i]=[]),n[i].push(e)})),n}const ni=function({type:e,id:t,tags:n}){const r=Gr(),{start:i,end:o,algorithm:a}=r.getSnapshot().context.tracing,s=Qr(),l=ut();return w("div",{className:"text-sm text-slate-700 dark:text-slate-400",children:[w("h4",{children:[w(Yr,{className:"mr-3",children:e}),w("span",{className:"font-mono",children:t})]}),n.length>0?w("p",{className:"my-2",children:[w("strong",{children:"tags"}),w("br",{}),n.join(", ")]}):null,w("div",{className:"grid grid-cols-3 gap-4",children:[w(Zr,{to:s(`/projects/${t}`,!0),children:"Focus"}),w(Kr,{onClick:function(){r.send({type:"deselectProject",projectName:t}),l(s("/projects",!0))},children:"Exclude"}),w(Kr,i?{className:"flex flex-row items-center",onClick:function(){l(s(`/projects/trace/${i}/${t}`,!0))},children:[w(Wr,{className:"mr-2 h-5 w-5 text-slate-500"}),"End"]}:{className:"flex flex-row items-center",onClick:function(){l(s(`/projects/trace/${t}`,!0))},children:[w(Hr,{className:"mr-2 h-5 w-5 text-slate-500"}),"Start"]})]})]})};const ri=function({type:e,source:t,target:n,fileDependencies:r}){return w("div",{className:"text-sm text-slate-700 dark:text-slate-400",children:[w("h4",{className:"implicit"!==e?"mb-3":"",children:[w(Yr,{className:"mr-3",children:null!=e?e:"unknown"}),w("span",{className:"font-mono",children:[t," \u2192 ",n]})]}),"implicit"!==e?w("div",{className:"overflow-hidden rounded-md border border-slate-200 dark:border-slate-800",children:[w("div",{className:"bg-slate-50 px-4 py-2 text-xs font-medium uppercase text-slate-500 dark:bg-slate-800 dark:text-slate-400",children:w("span",{children:"Files"})}),w("ul",{className:"max-h-[300px] divide-y divide-slate-200 overflow-auto dark:divide-slate-800",children:r.map((e=>w("li",{className:"whitespace-nowrap px-4 py-2 text-sm font-medium text-slate-800 dark:text-slate-300",children:w("span",{className:"block truncate font-normal",children:e.fileName})},e.fileName)))})]}):null]})};var ii=n(43100);class oi{constructor(e){this.subscribers=new Set,this.currentTooltip=void 0,e.listen((e=>{switch(e.type){case"GraphRegenerated":this.hideAll();break;case"ProjectNodeClick":this.openProjectNodeToolTip(e.ref,{id:e.data.id,tags:e.data.tags,type:e.data.type});break;case"TaskNodeClick":this.openTaskNodeTooltip(e.ref,Object.assign({},e.data));break;case"EdgeClick":this.openEdgeToolTip(e.ref,{type:e.data.type,target:e.data.target,source:e.data.source,fileDependencies:e.data.fileDependencies})}}))}openProjectNodeToolTip(e,t){this.currentTooltip={type:"projectNode",ref:e,props:t},this.broadcastChange()}openTaskNodeTooltip(e,t){this.currentTooltip={type:"taskNode",ref:e,props:t},this.broadcastChange()}openEdgeToolTip(e,t){this.currentTooltip={type:"projectEdge",ref:e,props:t},this.broadcastChange()}broadcastChange(){this.subscribers.forEach((e=>e(this.currentTooltip)))}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}hideAll(){this.currentTooltip=null,this.broadcastChange()}}let ai;const si=function({id:e,executor:t}){return ht().selectedWorkspaceId,w("div",{className:"text-sm text-slate-700 dark:text-slate-400",children:w("h4",{children:[w(Yr,{className:"mr-3",children:t}),w("span",{className:"font-mono",children:e})]})})};function li(e){return e.split("-")[0]}function ci(e){return e.split("-")[1]}function ui(e){return["top","bottom"].includes(li(e))?"x":"y"}function di(e){return"y"===e?"height":"width"}function hi(e,t,n){let{reference:r,floating:i}=e;const o=r.x+r.width/2-i.width/2,a=r.y+r.height/2-i.height/2,s=ui(t),l=di(s),c=r[l]/2-i[l]/2,u="x"===s;let d;switch(li(t)){case"top":d={x:o,y:r.y-i.height};break;case"bottom":d={x:o,y:r.y+r.height};break;case"right":d={x:r.x+r.width,y:a};break;case"left":d={x:r.x-i.width,y:a};break;default:d={x:r.x,y:r.y}}switch(ci(t)){case"start":d[s]-=c*(n&&u?-1:1);break;case"end":d[s]+=c*(n&&u?-1:1)}return d}function fi(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function pi(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}async function vi(e,t){var n;void 0===t&&(t={});const{x:r,y:i,platform:o,rects:a,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:h=!1,padding:f=0}=t,p=fi(f),v=s[h?"floating"===d?"reference":"floating":d],g=pi(await o.getClippingRect({element:null==(n=await(null==o.isElement?void 0:o.isElement(v)))||n?v:v.contextElement||await(null==o.getDocumentElement?void 0:o.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:l})),m=pi(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({rect:"floating"===d?{...a.floating,x:r,y:i}:a.reference,offsetParent:await(null==o.getOffsetParent?void 0:o.getOffsetParent(s.floating)),strategy:l}):a[d]);return{top:g.top-m.top+p.top,bottom:m.bottom-g.bottom+p.bottom,left:g.left-m.left+p.left,right:m.right-g.right+p.right}}const gi=Math.min,mi=Math.max;function yi(e,t,n){return mi(e,gi(t,n))}const bi=e=>({name:"arrow",options:e,async fn(t){const{element:n,padding:r=0}=null!=e?e:{},{x:i,y:o,placement:a,rects:s,platform:l}=t;if(null==n)return{};const c=fi(r),u={x:i,y:o},d=ui(a),h=ci(a),f=di(d),p=await l.getDimensions(n),v="y"===d?"top":"left",g="y"===d?"bottom":"right",m=s.reference[f]+s.reference[d]-u[d]-s.floating[f],y=u[d]-s.reference[d],b=await(null==l.getOffsetParent?void 0:l.getOffsetParent(n));let x=b?"y"===d?b.clientHeight||0:b.clientWidth||0:0;0===x&&(x=s.floating[f]);const w=m/2-y/2,E=c[v],_=x-p[f]-c[g],k=x/2-p[f]/2+w,S=yi(E,k,_),P=("start"===h?c[v]:c[g])>0&&k!==S&&s.reference[f]<=s.floating[f];return{[d]:u[d]-(P?k<E?E-k:_-k:0),data:{[d]:S,centerOffset:k-S}}}}),xi={left:"right",right:"left",bottom:"top",top:"bottom"};function wi(e){return e.replace(/left|right|bottom|top/g,(e=>xi[e]))}function Ei(e,t,n){void 0===n&&(n=!1);const r=ci(e),i=ui(e),o=di(i);let a="x"===i?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=wi(a)),{main:a,cross:wi(a)}}const _i={start:"end",end:"start"};function ki(e){return e.replace(/start|end/g,(e=>_i[e]))}const Si=["top","right","bottom","left"],Pi=(Si.reduce(((e,t)=>e.concat(t,t+"-start",t+"-end")),[]),function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n;const{placement:r,middlewareData:i,rects:o,initialPlacement:a,platform:s,elements:l}=t,{mainAxis:c=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:h="bestFit",flipAlignment:f=!0,...p}=e,v=li(r),g=d||(v!==a&&f?function(e){const t=wi(e);return[ki(e),t,ki(t)]}(a):[wi(a)]),m=[a,...g],y=await vi(t,p),b=[];let x=(null==(n=i.flip)?void 0:n.overflows)||[];if(c&&b.push(y[v]),u){const{main:e,cross:t}=Ei(r,o,await(null==s.isRTL?void 0:s.isRTL(l.floating)));b.push(y[e],y[t])}if(x=[...x,{placement:r,overflows:b}],!b.every((e=>e<=0))){var w,E;const e=(null!=(w=null==(E=i.flip)?void 0:E.index)?w:0)+1,t=m[e];if(t)return{data:{index:e,overflows:x},reset:{placement:t}};let n="bottom";switch(h){case"bestFit":{var _;const e=null==(_=x.map((e=>[e,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:_[0].placement;e&&(n=e);break}case"initialPlacement":n=a}if(r!==n)return{reset:{placement:n}}}return{}}}});const ji=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,i=await async function(e,t){const{placement:n,platform:r,elements:i}=e,o=await(null==r.isRTL?void 0:r.isRTL(i.floating)),a=li(n),s=ci(n),l="x"===ui(n),c=["left","top"].includes(a)?-1:1,u=o&&l?-1:1,d="function"==typeof t?t(e):t;let{mainAxis:h,crossAxis:f,alignmentAxis:p}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return s&&"number"==typeof p&&(f="end"===s?-1*p:p),l?{x:f*u,y:h*c}:{x:h*c,y:f*u}}(t,e);return{x:n+i.x,y:r+i.y,data:i}}}};function Ci(e){return"x"===e?"y":"x"}const Ti=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=e,c={x:n,y:r},u=await vi(t,l),d=ui(li(i)),h=Ci(d);let f=c[d],p=c[h];if(o){const e="y"===d?"bottom":"right";f=yi(f+u["y"===d?"top":"left"],f,f-u[e])}if(a){const e="y"===h?"bottom":"right";p=yi(p+u["y"===h?"top":"left"],p,p-u[e])}const v=s.fn({...t,[d]:f,[h]:p});return{...v,data:{x:v.x-n,y:v.y-r}}}}};function Di(e){return e&&e.document&&e.location&&e.alert&&e.setInterval}function Ni(e){if(null==e)return window;if(!Di(e)){const t=e.ownerDocument;return t&&t.defaultView||window}return e}function Oi(e){return Ni(e).getComputedStyle(e)}function Mi(e){return Di(e)?"":e?(e.nodeName||"").toLowerCase():""}function Ai(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map((e=>e.brand+"/"+e.version)).join(" "):navigator.userAgent}function Ri(e){return e instanceof Ni(e).HTMLElement}function Ii(e){return e instanceof Ni(e).Element}function Li(e){return"undefined"!=typeof ShadowRoot&&(e instanceof Ni(e).ShadowRoot||e instanceof ShadowRoot)}function Bi(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Oi(e);return/auto|scroll|overlay|hidden/.test(t+r+n)&&!["inline","contents"].includes(i)}function Fi(e){return["table","td","th"].includes(Mi(e))}function zi(e){const t=/firefox/i.test(Ai()),n=Oi(e),r=n.backdropFilter||n.WebkitBackdropFilter;return"none"!==n.transform||"none"!==n.perspective||!!r&&"none"!==r||t&&"filter"===n.willChange||t&&!!n.filter&&"none"!==n.filter||["transform","perspective"].some((e=>n.willChange.includes(e)))||["paint","layout","strict","content"].some((e=>{const t=n.contain;return null!=t&&t.includes(e)}))}function Vi(){return!/^((?!chrome|android).)*safari/i.test(Ai())}function Gi(e){return["html","body","#document"].includes(Mi(e))}const Hi=Math.min,Wi=Math.max,qi=Math.round;function Yi(e,t,n){var r,i,o,a;void 0===t&&(t=!1),void 0===n&&(n=!1);const s=e.getBoundingClientRect();let l=1,c=1;t&&Ri(e)&&(l=e.offsetWidth>0&&qi(s.width)/e.offsetWidth||1,c=e.offsetHeight>0&&qi(s.height)/e.offsetHeight||1);const u=Ii(e)?Ni(e):window,d=!Vi()&&n,h=(s.left+(d&&null!=(r=null==(i=u.visualViewport)?void 0:i.offsetLeft)?r:0))/l,f=(s.top+(d&&null!=(o=null==(a=u.visualViewport)?void 0:a.offsetTop)?o:0))/c,p=s.width/l,v=s.height/c;return{width:p,height:v,top:f,right:h+p,bottom:f+v,left:h,x:h,y:f}}function Ui(e){return(t=e,(t instanceof Ni(t).Node?e.ownerDocument:e.document)||window.document).documentElement;var t}function Xi(e){return Ii(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function $i(e){return Yi(Ui(e)).left+Xi(e).scrollLeft}function Ki(e,t,n){const r=Ri(t),i=Ui(t),o=Yi(e,r&&function(e){const t=Yi(e);return qi(t.width)!==e.offsetWidth||qi(t.height)!==e.offsetHeight}(t),"fixed"===n);let a={scrollLeft:0,scrollTop:0};const s={x:0,y:0};if(r||!r&&"fixed"!==n)if(("body"!==Mi(t)||Bi(i))&&(a=Xi(t)),Ri(t)){const e=Yi(t,!0);s.x=e.x+t.clientLeft,s.y=e.y+t.clientTop}else i&&(s.x=$i(i));return{x:o.left+a.scrollLeft-s.x,y:o.top+a.scrollTop-s.y,width:o.width,height:o.height}}function Zi(e){if("html"===Mi(e))return e;const t=e.assignedSlot||e.parentNode||(Li(e)?e.host:null)||Ui(e);return Li(t)?t.host:t}function Qi(e){return Ri(e)&&"fixed"!==Oi(e).position?e.offsetParent:null}function Ji(e){const t=Ni(e);let n=Qi(e);for(;n&&Fi(n)&&"static"===Oi(n).position;)n=Qi(n);return n&&("html"===Mi(n)||"body"===Mi(n)&&"static"===Oi(n).position&&!zi(n))?t:n||function(e){let t=Zi(e);for(;Ri(t)&&!Gi(t);){if(zi(t))return t;t=Zi(t)}return null}(e)||t}function eo(e){const t=Zi(e);return Gi(t)?e.ownerDocument.body:Ri(t)&&Bi(t)?t:eo(t)}function to(e,t){var n;void 0===t&&(t=[]);const r=eo(e),i=r===(null==(n=e.ownerDocument)?void 0:n.body),o=Ni(r),a=i?[o].concat(o.visualViewport||[],Bi(r)?r:[]):r,s=t.concat(a);return i?s:s.concat(to(a))}function no(e,t,n){return"viewport"===t?pi(function(e,t){const n=Ni(e),r=Ui(e),i=n.visualViewport;let o=r.clientWidth,a=r.clientHeight,s=0,l=0;if(i){o=i.width,a=i.height;const e=Vi();(e||!e&&"fixed"===t)&&(s=i.offsetLeft,l=i.offsetTop)}return{width:o,height:a,x:s,y:l}}(e,n)):Ii(t)?function(e,t){const n=Yi(e,!1,"fixed"===t),r=n.top+e.clientTop,i=n.left+e.clientLeft;return{top:r,left:i,x:i,y:r,right:i+e.clientWidth,bottom:r+e.clientHeight,width:e.clientWidth,height:e.clientHeight}}(t,n):pi(function(e){var t;const n=Ui(e),r=Xi(e),i=null==(t=e.ownerDocument)?void 0:t.body,o=Wi(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=Wi(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0);let s=-r.scrollLeft+$i(e);const l=-r.scrollTop;return"rtl"===Oi(i||n).direction&&(s+=Wi(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:s,y:l}}(Ui(e)))}const ro={getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o="clippingAncestors"===n?function(e){let t=to(e).filter((e=>Ii(e)&&"body"!==Mi(e))),n=null;const r="fixed"===Oi(e).position;let i=r?Zi(e):e;for(;Ii(i)&&!Gi(i);){const e=Oi(i),o=zi(i);(r?o||n:o||"static"!==e.position||!n||!["absolute","fixed"].includes(n.position))?n=e:t=t.filter((e=>e!==i)),i=Zi(i)}return t}(t):[].concat(n),a=[...o,r],s=a[0],l=a.reduce(((e,n)=>{const r=no(t,n,i);return e.top=Wi(r.top,e.top),e.right=Hi(r.right,e.right),e.bottom=Hi(r.bottom,e.bottom),e.left=Wi(r.left,e.left),e}),no(t,s,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:r}=e;const i=Ri(n),o=Ui(n);if(n===o)return t;let a={scrollLeft:0,scrollTop:0};const s={x:0,y:0};if((i||!i&&"fixed"!==r)&&(("body"!==Mi(n)||Bi(o))&&(a=Xi(n)),Ri(n))){const e=Yi(n,!0);s.x=e.x+n.clientLeft,s.y=e.y+n.clientTop}return{...t,x:t.x-a.scrollLeft+s.x,y:t.y-a.scrollTop+s.y}},isElement:Ii,getDimensions:function(e){if(Ri(e))return{width:e.offsetWidth,height:e.offsetHeight};const t=Yi(e);return{width:t.width,height:t.height}},getOffsetParent:Ji,getDocumentElement:Ui,async getElementRects(e){let{reference:t,floating:n,strategy:r}=e;const i=this.getOffsetParent||Ji,o=this.getDimensions;return{reference:Ki(t,await i(n),r),floating:{x:0,y:0,...await o(n)}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>"rtl"===Oi(e).direction};const io=(e,t,n)=>(async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:a}=n,s=o.filter(Boolean),l=await(null==a.isRTL?void 0:a.isRTL(t));let c=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=hi(c,r,l),h=r,f={},p=0;for(let v=0;v<s.length;v++){const{name:n,fn:o}=s[v],{x:g,y:m,data:y,reset:b}=await o({x:u,y:d,initialPlacement:r,placement:h,strategy:i,middlewareData:f,rects:c,platform:a,elements:{reference:e,floating:t}});u=null!=g?g:u,d=null!=m?m:d,f={...f,[n]:{...f[n],...y}},b&&p<=50&&(p++,"object"==typeof b&&(b.placement&&(h=b.placement),b.rects&&(c=!0===b.rects?await a.getElementRects({reference:e,floating:t,strategy:i}):b.rects),({x:u,y:d}=hi(c,h,l))),v=-1)}return{x:u,y:d,placement:h,strategy:i,middlewareData:f}})(e,t,{platform:ro,...n});var oo="undefined"!=typeof document?r.useLayoutEffect:r.useEffect;function ao(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;0!=r--;)if(!ao(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!Object.prototype.hasOwnProperty.call(t,i[r]))return!1;for(r=n;0!=r--;){const n=i[r];if(("_owner"!==n||!e.$$typeof)&&!ao(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function so(e){let{middleware:t=[],placement:n="bottom",strategy:i="absolute",whileElementsMounted:o}=void 0===e?{}:e;const[a,s]=r.useState({x:null,y:null,strategy:i,placement:n,middlewareData:{}}),[l,c]=r.useState(t);ao(l,t)||c(t);const u=r.useRef(null),d=r.useRef(null),h=r.useRef(null),f=r.useRef(a),p=function(e){const t=r.useRef(e);return oo((()=>{t.current=e})),t}(o),v=r.useCallback((()=>{u.current&&d.current&&io(u.current,d.current,{middleware:l,placement:n,strategy:i}).then((e=>{g.current&&!ao(f.current,e)&&(f.current=e,r.flushSync((()=>{s(e)})))}))}),[l,n,i]);oo((()=>{g.current&&v()}),[v]);const g=r.useRef(!1);oo((()=>(g.current=!0,()=>{g.current=!1})),[]);const m=r.useCallback((()=>{if("function"==typeof h.current&&(h.current(),h.current=null),u.current&&d.current)if(p.current){const e=p.current(u.current,d.current,v);h.current=e}else v()}),[v,p]),y=r.useCallback((e=>{u.current=e,m()}),[m]),b=r.useCallback((e=>{d.current=e,m()}),[m]),x=r.useMemo((()=>({reference:u,floating:d})),[]);return r.useMemo((()=>({...a,update:v,refs:x,reference:y,floating:b})),[a,v,x,y,b])}const lo=e=>{const{element:t,padding:n}=e;return{name:"arrow",options:e,fn(e){return r=t,Object.prototype.hasOwnProperty.call(r,"current")?null!=t.current?bi({element:t.current,padding:n}).fn(e):{}:t?bi({element:t,padding:n}).fn(e):{};var r}}};function co({children:e,open:t=!1,content:n,placement:i="top",reference:o,openAction:a="click"}){const[s,l]=(0,r.useState)(t),c=(0,r.useRef)(null),{x:u,y:d,reference:h,floating:f,strategy:p,placement:v,middlewareData:{arrow:{x:g,y:m}={}}}=so({placement:i,middleware:[ji(6),Pi(),Ti({padding:6}),lo({element:c})]}),y={top:"bottom",right:"left",bottom:"top",left:"right"}[v.split("-")[0]];(0,r.useLayoutEffect)((()=>{o&&h(o)}),[h,o]);const x={ref:h};return"click"===a?x.onClick=()=>l(!s):"hover"===a&&(x.onMouseEnter=()=>l(!0),x.onMouseLeave=()=>l(!1)),w(b.HY,{children:[!o&&e?(0,r.cloneElement)(e,x):e,s?w("div",{role:"tooltip",ref:f,style:{position:p,top:null!=d?d:0,left:null!=u?u:0,width:"max-content"},className:"absolute z-0 min-w-[250px] rounded-md border border-slate-500",children:[w("div",{style:{left:null!=g?`${g}px`:"",top:null!=m?`${m}px`:"",right:"",bottom:"",[y]:"-4px"},className:"absolute -z-10 h-4 w-4 rotate-45 bg-slate-500",ref:c}),w("div",{className:"rounded-md bg-white p-3 dark:bg-slate-900 dark:text-slate-400",children:n})]}):null]})}const uo=function(){if(!ai){const e=k();ai=new oi(e)}return ai}();const ho=function(){const e=(0,ii.useSyncExternalStore)((e=>uo.subscribe(e)),(()=>uo.currentTooltip));let t;if(e)switch(e.type){case"projectNode":t=w(ni,Object.assign({},e.props));break;case"projectEdge":t=w(ri,Object.assign({},e.props));break;case"taskNode":t=w(si,Object.assign({},e.props))}return t?w(co,{content:t,open:!0,reference:e.ref,placement:"top",openAction:"manual"}):null};function fo(){const e=Gr(),t=k(),n=(0,ii.useSyncExternalStore)((e=>t.listen(e)),(()=>t.lastPerformanceReport)),r=0!==n.numNodes,i=Xt(),o=Xt(),a=ut(),s=Cr(),{selectedWorkspaceId:l,selectedTaskId:c}=ht(),u=s.currentPath,d=u.startsWith("/tasks")?"/tasks":"/projects";return w(b.HY,{children:[w("div",{className:("nx-console"===o.environment?"absolute top-5 left-5 z-50 bg-white":"relative flex h-full overflow-y-scroll")+" w-72 flex-col pb-10 shadow-lg ring-1 ring-slate-900/10 ring-opacity-10 transition-all dark:ring-slate-300/10",id:"sidebar",children:["nx-console"!==o.environment?w(b.HY,{children:[w("div",{className:"border-b border-slate-900/10 text-slate-700 dark:border-slate-300/10 dark:bg-transparent dark:text-slate-400",children:w("div",{className:"mx-4 my-2 flex items-center justify-between",children:[w("svg",{className:"h-10 w-auto text-slate-900 dark:text-white",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:[w("title",{children:"Nx"}),w("path",{d:"M11.987 14.138l-3.132 4.923-5.193-8.427-.012 8.822H0V4.544h3.691l5.247 8.833.005-3.998 3.044 4.759zm.601-5.761c.024-.048 0-3.784.008-3.833h-3.65c.002.059-.005 3.776-.003 3.833h3.645zm5.634 4.134a2.061 2.061 0 0 0-1.969 1.336 1.963 1.963 0 0 1 2.343-.739c.396.161.917.422 1.33.283a2.1 2.1 0 0 0-1.704-.88zm3.39 1.061c-.375-.13-.8-.277-1.109-.681-.06-.08-.116-.17-.176-.265a2.143 2.143 0 0 0-.533-.642c-.294-.216-.68-.322-1.18-.322a2.482 2.482 0 0 0-2.294 1.536 2.325 2.325 0 0 1 4.002.388.75.75 0 0 0 .836.334c.493-.105.46.36 1.203.518v-.133c-.003-.446-.246-.55-.75-.733zm2.024 1.266a.723.723 0 0 0 .347-.638c-.01-2.957-2.41-5.487-5.37-5.487a5.364 5.364 0 0 0-4.487 2.418c-.01-.026-1.522-2.39-1.538-2.418H8.943l3.463 5.423-3.379 5.32h3.54l1.54-2.366 1.568 2.366h3.541l-3.21-5.052a.7.7 0 0 1-.084-.32 2.69 2.69 0 0 1 2.69-2.691h.001c1.488 0 1.736.89 2.057 1.308.634.826 1.9.464 1.9 1.541a.707.707 0 0 0 1.066.596zm.35.133c-.173.372-.56.338-.755.639-.176.271.114.412.114.412s.337.156.538-.311c.104-.231.14-.488.103-.74z"})]}),w(Yt,{"data-cy":"route-select",defaultValue:u.startsWith("/projects")?"/projects":"/tasks",onChange:t=>{e.send("deselectAll"),"dev"===i.environment?a(`/${s.workspace}${t.currentTarget.value}`):a(`${t.currentTarget.value}`)},children:[{route:"/projects",label:"Projects"},{route:"/tasks",label:"Tasks"}].map((e=>w("option",{value:e.route,children:e.label})))}),w(Tr,{children:w(Or,{})}),w(jr,{})]})}),w("a",{id:"help",className:" mt-3 flex cursor-pointer items-center px-4 text-xs hover:underline ",href:"https://nx.dev/structure/dependency-graph",rel:"noreferrer",target:"_blank",children:[w(Ft,{className:"mr-2 h-4 w-4"}),"Analyse and visualize your workspace."]})]}):null,w(_t,{})]}),w("div",{id:"main-content",className:"flex-grow overflow-hidden transition-all",children:[i.appConfig.showDebugger?w(Ut,{projects:i.appConfig.workspaces,selectedProject:l,lastPerfReport:n,selectedProjectChange:function(e){a(`/${e}${d}`)}}):null,r?null:w("div",{"data-cy":"no-tasks-selected",className:"flex h-full w-full items-center justify-center text-slate-700 dark:text-slate-400",children:[w(zt,{className:"mr-4 h-6 w-6"}),w("h4",{children:["Please select a"," ",u.startsWith("/tasks")?"task":"project"," in the sidebar."]})]}),w("div",{className:"h-full w-full",children:[w("div",{className:"h-full w-full",id:"cytoscape-graph"}),w(ho,{}),w(co,{openAction:"hover",content:"Download Graph as PNG",placement:"right",children:w("button",{type:"button",className:Ht()(r?"":"opacity-0","fixed bottom-4 right-4 z-50 block h-16 w-16 transform rounded-full bg-blue-500 text-white shadow-sm transition duration-300 dark:bg-sky-500"),"data-cy":"downloadImageButton",onClick:function(){const e=k().getImage();let t=document.createElement("a");t.href=e,t.download="graph.png",t.dispatchEvent(new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window}))},children:w(Vt,{className:"absolute top-1/2 left-1/2 -mt-3 -ml-3 h-6 w-6"})})})]})]})]})}var po=n(41110);r.useLayoutEffect;function vo(e){return"state"in e}var go=function(e,t){return e===t};function mo(e,t,n,i){void 0===n&&(n=go);var o=(0,r.useRef)(null),a=(0,r.useCallback)((function(t){return e.subscribe(t).unsubscribe}),[e]),s=(0,r.useCallback)((function(){return i?i(e):function(e,t){if("state"in(i=e)&&"machine"in i){if(0===e.status&&t.current)return t.current;var n=0!==(r=e).status?r.state:r.machine.initialState;return t.current=0===e.status?n:null,n}var r,i;return vo(e)?e.state:void 0}(e,o)}),[e,i]);return(0,po.useSyncExternalStoreWithSelector)(a,s,s,t,n)}function yo(e){return mo(Gr(),e)}const bo=e=>e.context.projects,xo=e=>e.context.workspaceLayout,wo=e=>e.context.selectedProjects,Eo=e=>e.context.focusedProject,_o=e=>({searchDepth:e.context.searchDepth,searchDepthEnabled:e.context.searchDepthEnabled}),ko=e=>e.context.includePath,So=e=>e.context.groupByFolder,Po=e=>e.context.collapseEdges,jo=e=>e.context.textFilter,Co=e=>e.context.affectedProjects.length>0,To=e=>e.context.tracing,Do=(0,r.memo)((({collapseEdges:e,collapseEdgesChanged:t})=>w("div",{className:"px-4",children:w("div",{className:"flex items-start",children:[w("div",{className:"flex h-5 items-center",children:w("input",{id:"collapseEdges",name:"collapseEdges",value:"collapseEdges",type:"checkbox",className:"h-4 w-4 accent-purple-500",onChange:e=>t(e.target.checked),checked:e})}),w("div",{className:"ml-3 text-sm",children:[w("label",{htmlFor:"collapseEdges",className:"cursor-pointer font-medium text-slate-600 dark:text-slate-400",children:"Collapse edges"}),w("p",{className:"text-slate-400 dark:text-slate-500",children:"Display edges between groups rather than libraries"})]})]})})));const No=r.forwardRef((function({title:e,titleId:t,...n},i){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:i,"aria-labelledby":t},n),e?r.createElement("title",{id:t},e):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12.75 15l3-3m0 0l-3-3m3 3h-7.5M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}))}));const Oo=r.forwardRef((function({title:e,titleId:t,...n},i){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:i,"aria-labelledby":t},n),e?r.createElement("title",{id:t},e):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.75 9.75l4.5 4.5m0-4.5l-4.5 4.5M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}))})),Mo=(0,r.memo)((({focusedLabel:e,resetFocus:t})=>w("div",{className:"mt-10 px-4",children:w("div",{className:"group relative flex cursor-pointer items-center overflow-hidden rounded-md border border-slate-200 bg-blue-500 p-2 text-slate-50 shadow-sm dark:border-slate-700 dark:bg-sky-500","data-cy":"unfocusButton",onClick:()=>t(),children:[w("p",{className:"truncate transition duration-200 ease-in-out group-hover:opacity-60",children:[w(No,{className:"-mt-1 mr-1 inline h-6 w-6"}),w("span",{id:"focused-project-name",children:["Focused on ",e]})]}),w("div",{className:"absolute right-2 flex translate-x-32 items-center rounded-md bg-white pl-2 text-sm font-medium text-slate-700 shadow-sm ring-1 ring-slate-500 transition-all duration-200 ease-in-out group-hover:translate-x-0 dark:bg-slate-800 dark:text-slate-300",children:["Reset",w("span",{className:"rounded-md p-1",children:w(Oo,{className:"h-5 w-5"})})]})]})}))),Ao=(0,r.memo)((({checked:e,checkChanged:t,label:n,description:r,name:i})=>w("div",{className:"mt-8 px-4",children:w("div",{className:"flex items-start",children:[w("div",{className:"flex h-5 items-center",children:w("input",{id:i,name:i,value:i,type:"checkbox",className:"h-4 w-4 accent-blue-500 dark:accent-sky-500",onChange:e=>t(e.target.checked),checked:e})}),w("div",{className:"ml-3 text-sm",children:[w("label",{htmlFor:i,className:"cursor-pointer font-medium text-slate-600 dark:text-slate-400",children:n}),w("p",{className:"text-slate-400 dark:text-slate-500",children:r})]})]})}))),Ro=({groupByFolder:e,groupByFolderChanged:t})=>w(Ao,{checked:e,checkChanged:t,name:"groupByFolder",label:"Group by folder",description:"Visually arrange libraries by folders."});const Io=r.forwardRef((function({title:e,titleId:t,...n},i){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:i,"aria-labelledby":t},n),e?r.createElement("title",{id:t},e):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m5.231 13.481L15 17.25m-4.5-15H5.625c-.621 0-1.125.504-1.125 1.125v16.5c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9zm3.75 11.625a2.625 2.625 0 11-5.25 0 2.625 2.625 0 015.25 0z"}))}));const Lo=r.forwardRef((function({title:e,titleId:t,...n},i){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:i,"aria-labelledby":t},n),e?r.createElement("title",{id:t},e):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 10.5a3 3 0 11-6 0 3 3 0 016 0z"}),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 10.5c0 7.142-7.5 11.25-7.5 11.25S4.5 17.642 4.5 10.5a7.5 7.5 0 1115 0z"}))}));const Bo=r.forwardRef((function({title:e,titleId:t,...n},i){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:i,"aria-labelledby":t},n),e?r.createElement("title",{id:t},e):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 3v1.5M3 21v-6m0 0l2.77-.693a9 9 0 016.208.682l.108.054a9 9 0 006.086.71l3.114-.732a48.524 48.524 0 01-.005-10.499l-3.11.732a9 9 0 01-6.085-.711l-.108-.054a9 9 0 00-6.208-.682L3 4.5M3 15V4.5"}))}));const Fo=r.forwardRef((function({title:e,titleId:t,...n},i){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:i,"aria-labelledby":t},n),e?r.createElement("title",{id:t},e):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.036 12.322a1.012 1.012 0 010-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178z"}),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}))}));function zo(e,t,n){let r={};return e.forEach((e=>{const i="app"===e.type||"e2e"===e.type?n.appsDir:n.libsDir,o=Jr(e.data.root,i).join("/");r.hasOwnProperty(o)||(r[o]=[]),r[o].push({projectGraphNode:e,isSelected:t.includes(e.name)})})),r}function Vo({project:e,tracingInfo:t}){const n=Gr(),r=ut(),i=Qr();function o(e,t){t?n.send({type:"deselectProject",projectName:e}):n.send({type:"selectProject",projectName:e}),r(i("/projects",!0))}return w("li",{className:"relative block cursor-default select-none py-1 pl-2 pr-6 text-xs text-slate-600 dark:text-slate-400",children:[w("div",{className:"flex items-center",children:[w(Rt,{"data-cy":`focus-button-${e.projectGraphNode.name}`,className:"mr-1 flex items-center rounded-md border-slate-300 bg-white p-1 font-medium text-slate-500 shadow-sm ring-1 ring-slate-200 transition hover:bg-slate-50 dark:border-slate-600 dark:bg-slate-800 dark:text-slate-400 dark:ring-slate-600 hover:dark:bg-slate-700",title:"Focus on this library",to:i(`/projects/${e.projectGraphNode.name}`,!0),children:w(Io,{className:"h-5 w-5"})}),w(Tr,{children:w("span",{className:"relative z-0 inline-flex rounded-md shadow-sm",children:[w("button",{type:"button",title:"Start Trace",onClick:()=>{return t=e.projectGraphNode.name,void n.send({type:"setTracingStart",projectName:t});var t},className:(t.start===e.projectGraphNode.name?"ring-blue-500 dark:ring-sky-500":"ring-slate-200 dark:ring-slate-600")+" flex items-center rounded-l-md border-slate-300 bg-white p-1 font-medium text-slate-500 shadow-sm ring-1 transition hover:bg-slate-50 dark:border-slate-600 dark:bg-slate-800 dark:text-slate-400 dark:ring-slate-600 hover:dark:bg-slate-700",children:w(Lo,{className:"h-5 w-5"})}),w("button",{type:"button",title:"End Trace",onClick:()=>{return t=e.projectGraphNode.name,void n.send({type:"setTracingEnd",projectName:t});var t},className:(t.end===e.projectGraphNode.name?"ring-blue-500 dark:ring-sky-500":"ring-slate-200 dark:ring-slate-600")+" flex items-center rounded-r-md border-slate-300 bg-white p-1 font-medium text-slate-500 shadow-sm ring-1 transition hover:bg-slate-50 dark:border-slate-600 dark:bg-slate-800 dark:text-slate-400 dark:ring-slate-600 hover:dark:bg-slate-700",children:w(Bo,{className:"h-5 w-5"})})]})}),w("label",{className:"ml-2 block w-full cursor-pointer truncate rounded-md p-2 font-mono font-normal transition hover:bg-slate-50 hover:dark:bg-slate-700","data-project":e.projectGraphNode.name,title:e.projectGraphNode.name,"data-active":e.isSelected.toString(),onClick:()=>o(e.projectGraphNode.name,e.isSelected),children:e.projectGraphNode.name})]}),e.isSelected?w("span",{title:"This library is visible",className:"absolute inset-y-0 right-0 flex cursor-pointer items-center text-blue-500 dark:text-sky-500",onClick:()=>o(e.projectGraphNode.name,e.isSelected),children:w(Fo,{className:"h-5 w-5"})}):null]})}function Go({headerText:e="",projects:t,tracingInfo:n}){const r=Gr();let i=[...t];i.sort(((e,t)=>e.projectGraphNode.name.localeCompare(t.projectGraphNode.name)));const o=t.every((e=>e.isSelected));return w(b.HY,{children:[""!==e?w("div",{className:"relative mt-4 flex justify-between py-2 text-slate-800 dark:text-slate-200",children:[w("h3",{className:"cursor-text text-sm font-semibold uppercase tracking-wide lg:text-xs",children:e}),w("span",{title:o?`Hide all ${e} projects`:`Show all ${e} projects`,className:"absolute inset-y-0 right-0 flex cursor-pointer items-center text-sm font-semibold uppercase tracking-wide lg:text-xs","data-cy":`toggle-folder-visibility-button-${e}`,onClick:()=>function(e){const n=t.map((e=>e.projectGraphNode.name));e?r.send({type:"deselectProjects",projectNames:n}):r.send({type:"selectProjects",projectNames:n})}(o),children:w(Fo,{className:"h-5 w-5"})})]}):null,w("ul",{className:"mt-2 -ml-3",children:i.map((e=>w(Vo,{project:e,tracingInfo:n},e.projectGraphNode.name)))})]})}const Ho=function(){const e=yo(To),t=yo(bo),n=yo(xo),r=yo(wo),i=ei("app",t),o=ei("lib",t),a=ei("e2e",t),s=zo(i,r,n),l=zo(o,r,n),c=zo(a,r,n),u=Object.keys(s).sort(),d=Object.keys(l).sort(),h=Object.keys(c).sort();return w("div",{id:"project-lists",className:"mt-8 border-t border-slate-400/10 px-4",children:[w("h2",{className:"mt-8 border-b border-solid border-slate-200/10 text-lg font-light text-slate-400 dark:text-slate-500",children:"app projects"}),u.map((t=>w(Go,{headerText:t,projects:s[t],tracingInfo:e},"app-"+t))),w("h2",{className:"mt-8 border-b border-solid border-slate-200/10 text-lg font-light text-slate-400 dark:text-slate-500",children:"e2e projects"}),h.map((t=>w(Go,{headerText:t,projects:c[t],tracingInfo:e},"e2e-"+t))),w("h2",{className:"mt-8 border-b border-solid border-slate-200/10 text-lg font-light text-slate-400 dark:text-slate-500",children:"lib projects"}),d.map((t=>w(Go,{headerText:t,projects:l[t],tracingInfo:e},"lib-"+t)))]})};const Wo=r.forwardRef((function({title:e,titleId:t,...n},i){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:i,"aria-labelledby":t},n),e?r.createElement("title",{id:t},e):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 12h-15"}))}));const qo=r.forwardRef((function({title:e,titleId:t,...n},i){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:i,"aria-labelledby":t},n),e?r.createElement("title",{id:t},e):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4.5v15m7.5-7.5h-15"}))})),Yo=(0,r.memo)((({searchDepth:e,searchDepthEnabled:t,searchDepthFilterEnabledChange:n,decrementDepthFilter:r,incrementDepthFilter:i})=>w("div",{className:"mt-4 px-4",children:[w("div",{className:"mt-4 flex items-start",children:[w("div",{className:"flex h-5 items-center",children:w("input",{id:"depthFilter",name:"depthFilter",value:"depthFilterActivated",type:"checkbox",className:"h-4 w-4 accent-blue-500 dark:accent-sky-500",checked:t,onChange:e=>n(e.target.checked)})}),w("div",{className:"ml-3 text-sm",children:[w("label",{htmlFor:"depthFilter",className:"cursor-pointer font-medium text-slate-600 dark:text-slate-400",children:"Activate proximity"}),w("p",{className:"text-slate-400 dark:text-slate-500",children:"Explore connected libraries step by step."})]})]}),w("div",{className:"mt-3 px-10",children:w("div",{className:"flex rounded-md shadow-sm",children:[w("button",{"data-cy":"decrement-depth-filter",title:"Remove ancestor level",className:"inline-flex items-center rounded-l-md border border-slate-300 bg-slate-50 py-2 px-4 text-slate-500 hover:bg-slate-100 dark:border-slate-600 dark:bg-slate-800 dark:text-slate-300 hover:dark:bg-slate-700",onClick:r,children:w(Wo,{className:"h-4 w-4"})}),w("span",{id:"depthFilterValue","data-cy":"depth-value",className:"block w-full flex-1 rounded-none border-t border-b border-slate-300 bg-white p-1.5 text-center font-mono dark:border-slate-600 dark:bg-slate-800 dark:text-slate-300 hover:dark:bg-slate-700",children:e}),w("button",{"data-cy":"increment-depth-filter",title:"Add ancestor level",className:"inline-flex items-center rounded-r-md border border-slate-300 bg-slate-50 py-2 px-4 text-slate-500 hover:bg-slate-100 dark:border-slate-600 dark:bg-slate-800 dark:text-slate-300 hover:dark:bg-slate-700",onClick:i,children:w(qo,{className:"h-4 w-4"})})]})})]})));const Uo=r.forwardRef((function({title:e,titleId:t,...n},i){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:i,"aria-labelledby":t},n),e?r.createElement("title",{id:t},e):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 13.5l10.5-11.25L12 10.5h8.25L9.75 21.75 12 13.5H3.75z"}))}));const Xo=r.forwardRef((function({title:e,titleId:t,...n},i){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:i,"aria-labelledby":t},n),e?r.createElement("title",{id:t},e):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.98 8.223A10.477 10.477 0 001.934 12C3.226 16.338 7.244 19.5 12 19.5c.993 0 1.953-.138 2.863-.395M6.228 6.228A10.45 10.45 0 0112 4.5c4.756 0 8.773 3.162 10.065 7.498a10.523 10.523 0 01-4.293 5.774M6.228 6.228L3 3m3.228 3.228l3.65 3.65m7.894 7.894L21 21m-3.228-3.228l-3.65-3.65m0 0a3 3 0 10-4.243-4.243m4.242 4.242L9.88 9.88"}))})),$o=(0,r.memo)((({showAll:e,hideAll:t,showAffected:n,hasAffected:r,label:i})=>w("div",{className:"mt-8 px-4",children:[w("button",{onClick:e,type:"button",className:"flex w-full items-center rounded-md border border-slate-300 bg-white px-4 py-2 text-sm font-medium text-slate-700 shadow-sm hover:bg-slate-50 dark:border-slate-600 dark:bg-slate-800 dark:text-slate-300 hover:dark:bg-slate-700","data-cy":"selectAllButton",children:[w(Fo,{className:"-ml-1 mr-2 h-5 w-5 text-slate-400"}),"Show all ",i]}),r?w("button",{onClick:n,type:"button",className:"mt-3 flex w-full items-center rounded-md border border-pink-500 bg-pink-400 px-4 py-2 text-sm font-medium text-white shadow-sm hover:bg-pink-500 dark:border-fuchsia-800 dark:bg-fuchsia-700 dark:text-white hover:dark:bg-fuchsia-600","data-cy":"affectedButton",children:[w(Uo,{className:"-ml-1 mr-2 h-5 w-5 text-white"}),"Show affected ",i]}):null,w("button",{onClick:t,type:"button",className:"mt-3 flex w-full items-center rounded-md border border-slate-300 bg-white px-4 py-2 text-sm font-medium text-slate-700 shadow-sm hover:bg-slate-50 dark:border-slate-600 dark:bg-slate-800 dark:text-slate-300 hover:dark:bg-slate-700","data-cy":"deselectAllButton",children:[w(Xo,{className:"-ml-1 mr-2 h-5 w-5 text-slate-500"}),"Hide all ",i]})]})));const Ko=r.forwardRef((function({title:e,titleId:t,...n},i){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:i,"aria-labelledby":t},n),e?r.createElement("title",{id:t},e):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 3c2.755 0 5.455.232 8.083.678.533.09.917.556.917 1.096v1.044a2.25 2.25 0 01-.659 1.591l-5.432 5.432a2.25 2.25 0 00-.659 1.591v2.927a2.25 2.25 0 01-1.244 2.013L9.75 21v-6.568a2.25 2.25 0 00-.659-1.591L3.659 7.409A2.25 2.25 0 013 5.818V4.774c0-.54.384-1.006.917-1.096A48.32 48.32 0 0112 3z"}))}));const Zo=r.forwardRef((function({title:e,titleId:t,...n},i){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:i,"aria-labelledby":t},n),e?r.createElement("title",{id:t},e):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9.75L14.25 12m0 0l2.25 2.25M14.25 12l2.25-2.25M14.25 12L12 14.25m-2.58 4.92l-6.375-6.375a1.125 1.125 0 010-1.59L9.42 4.83c.211-.211.498-.33.796-.33H19.5a2.25 2.25 0 012.25 2.25v10.5a2.25 2.25 0 01-2.25 2.25h-9.284c-.298 0-.585-.119-.796-.33z"}))}));const Qo=function({initialText:e,placeholderText:t,resetTextFilter:n,updateTextFilter:i}){const[o,a]=(0,r.useState)(null!=e?e:""),[s,l]=function(e,t){const[n,i]=(0,r.useState)(e);return(0,r.useEffect)((()=>{const n=setTimeout((()=>{i(e)}),t);return()=>{clearTimeout(n)}}),[e,t]),[n,i]}(o,500);return(0,r.useEffect)((()=>{""!==s&&i(s)}),[s,i]),w("form",{className:"group relative flex rounded-md shadow-sm",onSubmit:e=>e.preventDefault(),children:[w("span",{className:"inline-flex items-center rounded-l-md border border-r-0 border-slate-300 bg-slate-50 p-2 dark:border-slate-900 dark:bg-slate-800",children:w(Ko,{className:"h-4 w-4"})}),w("input",{type:"text",className:"block w-full flex-1 rounded-none rounded-r-md border border-slate-300 bg-white p-1.5 font-light text-slate-400 placeholder:font-light placeholder:text-slate-400 dark:border-slate-900 dark:bg-slate-800 dark:text-white dark:hover:bg-slate-700",placeholder:t,"data-cy":"textFilterInput",name:"filter",value:o,onKeyUp:function(e){"Enter"===e.key&&i(e.currentTarget.value)},onChange:e=>{var t;""===(t=e.currentTarget.value)?(a(""),l(""),n()):a(t)}}),o.length>0?w("button",{"data-cy":"textFilterReset",type:"reset",onClick:function(){a(""),l(""),n()},className:"absolute top-1 right-1 inline-block rounded-md bg-slate-50 p-1 text-slate-400 dark:bg-slate-800",children:w(Zo,{className:"h-5 w-5"})}):null]})};const Jo=function({textFilter:e,resetTextFilter:t,updateTextFilter:n,toggleIncludeLibsInPathChange:r,includePath:i}){return w("div",{children:[w("div",{className:"mt-10 px-4",children:w(Qo,{resetTextFilter:t,updateTextFilter:n,initialText:"",placeholderText:"lib name, other lib name"})}),w("div",{className:"mt-4 px-4",children:w("div",{className:"flex items-start",children:[w("div",{className:"flex h-5 items-center",children:w("input",{disabled:0===e.length,id:"includeInPath",name:"textFilterCheckbox",type:"checkbox",value:"includeInPath",className:"h-4 w-4 accent-blue-500 dark:accent-sky-500",checked:i,onChange:r})}),w("div",{className:"ml-3 text-sm",children:[w("label",{htmlFor:"includeInPath",className:"cursor-pointer font-medium text-slate-600 dark:text-slate-400",children:"Include related libraries"}),w("p",{className:"text-slate-400 dark:text-slate-500",children:"Show libraries that are related to your search."})]})]})})]})};const ea=r.forwardRef((function({title:e,titleId:t,...n},i){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:i,"aria-labelledby":t},n),e?r.createElement("title",{id:t},e):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6.75a.75.75 0 110-1.5.75.75 0 010 1.5zM12 12.75a.75.75 0 110-1.5.75.75 0 010 1.5zM12 18.75a.75.75 0 110-1.5.75.75 0 010 1.5z"}))})),ta=(0,r.memo)((({start:e,end:t,algorithm:n,setAlgorithm:r,resetStart:i,resetEnd:o})=>w("div",{className:"mt-10 px-4",children:w("div",{className:"transition duration-200 ease-in-out group-hover:opacity-60",children:[w("h3",{className:"cursor-text pb-2 text-sm font-semibold uppercase tracking-wide text-slate-800 dark:text-slate-200 lg:text-xs",children:"Tracing Path"}),w("div",{className:"mb-3 flex cursor-pointer flex-row rounded-md border text-center text-xs dark:border-slate-600",children:[w("button",{onClick:()=>r("shortest"),className:("shortest"===n?"border-blue-500 dark:border-sky-500":"border-slate-300 dark:border-slate-600")+" flex-1 rounded-l-md border bg-slate-50 py-2 px-4 text-slate-500 hover:bg-slate-100 dark:border-slate-600 dark:bg-slate-800 dark:text-slate-300 hover:dark:bg-slate-700",children:w("span",{children:"Shortest"})}),w("button",{onClick:()=>r("all"),className:("all"===n?"border-blue-500 dark:border-sky-500":"border-slate-300 dark:border-slate-600")+" flex-1 rounded-r-md border bg-slate-50 py-2 px-4 text-slate-500 hover:bg-slate-100 dark:bg-slate-800 dark:text-slate-300 hover:dark:bg-slate-700",children:w("span",{children:"All"})})]}),w("div",{className:"flex flex-row items-center truncate ",children:[w(Lo,{className:"mr-2 h-5 w-5 text-slate-500 dark:text-slate-400"}),e?w("div",{className:"group relative flex-1 cursor-pointer flex-col items-center overflow-hidden","data-cy":"resetTraceButton",onClick:i,children:[w("div",{className:"flex-1 truncate rounded-md border border-slate-200 bg-blue-500 p-2 text-slate-50 shadow-sm transition duration-200 ease-in-out group-hover:opacity-60 dark:border-slate-700 dark:bg-sky-500",children:w("span",{children:e})}),w("div",{className:"absolute top-2 right-2 flex translate-x-32 items-center rounded-md bg-white pl-2 text-sm font-medium text-slate-700 shadow-sm ring-1 ring-slate-500 transition-all transition duration-200 ease-in-out group-hover:translate-x-0 dark:bg-slate-800 dark:text-slate-300 dark:ring-slate-700",children:["Reset",w("span",{className:"rounded-md p-1",children:w(Oo,{className:"h-5 w-5"})})]})]}):w("p",{className:"text-sm text-slate-500",children:"Select start project"})]}),w("div",{children:w(ea,{className:"h-5 w-5 text-slate-500 dark:text-slate-400"})}),w("div",{className:"flex flex-row items-center truncate ",children:[w(Bo,{className:"mr-2 h-5 w-5 text-slate-500 dark:text-slate-400"}),t?w("div",{className:" group relative flex-1 cursor-pointer flex-col items-center overflow-hidden ","data-cy":"resetTraceButton",onClick:o,children:[w("div",{className:"flex-1 truncate rounded-md border border-slate-200 bg-blue-500 p-2 text-slate-50 shadow-sm transition duration-200 ease-in-out group-hover:opacity-60 dark:border-slate-700 dark:bg-sky-500",children:w("span",{children:t})}),w("div",{className:"absolute top-2 right-2 flex translate-x-32 items-center rounded-md bg-white pl-2 text-sm font-medium text-slate-700 shadow-sm ring-1 ring-slate-500 transition-all transition duration-200 ease-in-out group-hover:translate-x-0 dark:bg-slate-800 dark:text-slate-300 dark:ring-slate-700",children:["Reset",w("span",{className:"rounded-md p-1",children:w(Oo,{className:"h-5 w-5"})})]})]}):w("p",{className:"text-sm text-slate-500",children:"Select end project"})]})]})})));class na{async getHash(){const e=new Request("currentHash",{mode:"no-cors"});return(await fetch(e)).json()}async getProjectGraph(e){const t=new Request(e,{mode:"no-cors"});return(await fetch(t)).json()}async getTaskGraph(e){const t=new Request(e,{mode:"no-cors"});return(await fetch(t)).json()}}class ra{async getHash(){return new Promise((e=>e("some-hash")))}async getProjectGraph(e){return new Promise((e=>e(window.projectGraphResponse)))}async getTaskGraph(e){return new Promise((e=>e(window.taskGraphResponse)))}}class ia{constructor(e=5e3){this.projectGraphsResponse={hash:"79054025255fb1a26e4bc422aef54eb4",layout:{appsDir:"apps",libsDir:"libs"},projects:[{name:"existing-app-1",type:"app",data:{root:"apps/app1",tags:[],files:[{file:"some/file.ts",hash:"ecccd8481d2e5eae0e59928be1bc4c2d071729d7",deps:["existing-lib-1"]}]}},{name:"existing-lib-1",type:"lib",data:{root:"libs/lib1",tags:[],files:[]}}],dependencies:{"existing-app-1":[{source:"existing-app-1",target:"existing-lib-1",type:"static"}],"existing-lib-1":[]},affected:[],focus:null,exclude:[],groupByFolder:!1},this.taskGraphsResponse={taskGraphs:{}},setInterval((()=>this.updateResponse()),e)}async getHash(){return new Promise((e=>e(this.projectGraphsResponse.hash)))}getProjectGraph(e){return new Promise((e=>e(this.projectGraphsResponse)))}getTaskGraph(e){return new Promise((e=>e(this.taskGraphsResponse)))}createNewProject(){const e=Math.random()>.25?"lib":"app",t=`${e}-${this.projectGraphsResponse.projects.length+1}`;return{name:t,type:e,data:{root:"app"===e?`apps/${t}`:`libs/${t}`,tags:[],files:[]}}}updateResponse(){const e=this.createNewProject(),t=this.projectGraphsResponse.projects.filter((e=>"lib"===e.type)),n=t[Math.floor(Math.random()*t.length)],r=[{source:e.name,target:n.name,type:"static"}];this.projectGraphsResponse=Object.assign({},this.projectGraphsResponse,{projects:[...this.projectGraphsResponse.projects,e],dependencies:Object.assign({},this.projectGraphsResponse.dependencies,{[e.name]:r})})}}let oa;function aa(){return void 0===oa&&("dev"===window.environment||"nx-console"===window.environment?oa=new na:"watch"===window.environment?oa=new ia:"release"===window.environment&&(oa="build"===window.localMode?new ra:new na)),oa}const sa=function(){const e=Xt(),t=Gr(),n=yo(Eo),i=yo(_o),o=yo(ko),a=yo(jo),s=yo(Co),l=yo(So),c=yo(Po),u=t.getSnapshot().matches("tracing"),d=yo(To),h=aa(),f=ht(),p=Cr(),[v,g]=Bt(),m=wt("selectedWorkspace"),y=ht(),x=ut(),E=Qr();(0,r.useEffect)((()=>{t.send({type:"setProjects",projects:m.projects,dependencies:m.dependencies,affectedProjects:m.affected,workspaceLayout:m.layout})}),[m]),(0,r.useEffect)((()=>{switch(p.currentPath){case"/projects/all":t.send({type:"selectAll"});break;case"/projects/affected":t.send({type:"selectAffected"})}}),[p]),(0,r.useEffect)((()=>{f.focusedProject&&t.send({type:"focusProject",projectName:f.focusedProject}),f.startTrace&&t.send({type:"setTracingStart",projectName:f.startTrace}),f.endTrace&&t.send({type:"setTracingEnd",projectName:f.endTrace})}),[f]),(0,r.useEffect)((()=>{if(v.has("groupByFolder")&&!1===l?t.send({type:"setGroupByFolder",groupByFolder:!0}):v.has("groupByFolder")||!0!==l||t.send({type:"setGroupByFolder",groupByFolder:!1}),v.has("collapseEdges")&&!1===c?t.send({type:"setCollapseEdges",collapseEdges:!0}):v.has("collapseEdges")||!0!==c||t.send({type:"setCollapseEdges",collapseEdges:!1}),v.has("searchDepth")){const e=parseInt(v.get("searchDepth"),10);0===e&&!1!==i.searchDepthEnabled?t.send({type:"setSearchDepthEnabled",searchDepthEnabled:!1}):0!==e&&t.send({type:"setSearchDepth",searchDepth:e})}else!1!==i.searchDepthEnabled&&1===i.searchDepth||(t.send({type:"setSearchDepthEnabled",searchDepthEnabled:!0}),t.send({type:"setSearchDepth",searchDepth:1}));if(v.has("traceAlgorithm")){const e=v.get("traceAlgorithm");"shortest"!==e&&"all"!==e||t.send({type:"setTracingAlgorithm",algorithm:e})}else"shortest"!==d.algorithm&&t.send({type:"setTracingAlgorithm",algorithm:"shortest"})}),[v]),((e,t,n)=>{const i=(0,r.useRef)((()=>{}));(0,r.useEffect)((()=>{n&&(i.current=e)}),[e,n]),(0,r.useEffect)((()=>{if(n){const e=()=>{i.current()};if(null!==t){let n=setInterval(e,t);return()=>clearInterval(n)}}}),[t,n])})((()=>{var n;const r=null!=(n=y.selectedWorkspaceId)?n:e.appConfig.defaultWorkspaceId,i=e.appConfig.workspaces.find((e=>e.id===r));(async()=>{const e=await h.getProjectGraph(i.projectGraphUrl);t.send({type:"updateGraph",projects:e.projects,dependencies:e.dependencies})})()}),5e3,e.watch);const _=(0,r.useCallback)((e=>{t.send({type:"filterByText",search:e}),x(E("/projects",!0))}),[t]);return w(b.HY,{children:[n?w(Mo,{focusedLabel:n,resetFocus:function(){t.send({type:"unfocusProject"}),x(E("/projects",!0))}}):null,u?w(ta,{start:d.start,end:d.end,algorithm:d.algorithm,setAlgorithm:function(e){g((t=>(t.set("traceAlgorithm",e),t)))},resetStart:function(){t.send({type:"clearTraceStart"}),x(E("/projects",!0))},resetEnd:function(){t.send({type:"clearTraceEnd"}),x(E("/projects",!0))}}):null,w(Jo,{includePath:o,resetTextFilter:function(){t.send({type:"clearTextFilter"})},textFilter:a,toggleIncludeLibsInPathChange:function(){t.send({type:"setIncludeProjectsByPath",includeProjectsByPath:!o})},updateTextFilter:_}),w("div",{children:[w($o,{hideAll:function(){t.send({type:"deselectAll"}),x(E("/projects",!0))},showAll:function(){x(E("/projects/all",!0))},showAffected:function(){x(E("/projects/affected",!0))},hasAffected:s,label:"projects"}),w(Ro,{groupByFolder:l,groupByFolderChanged:function(e){g((t=>(e?t.set("groupByFolder","true"):t.delete("groupByFolder"),t)))}}),w(Yo,{searchDepth:i.searchDepth,searchDepthEnabled:i.searchDepthEnabled,searchDepthFilterEnabledChange:function(e){g((t=>(e&&i.searchDepth>1?t.set("searchDepth",i.searchDepth.toString()):e&&1===i.searchDepth?t.delete("searchDepth"):t.set("searchDepth","0"),t)))},incrementDepthFilter:function(){const e=i.searchDepth+1;g((t=>(1===e?t.delete("searchDepth"):t.set("searchDepth",e.toString()),t)))},decrementDepthFilter:function(){const e=1===i.searchDepth?1:i.searchDepth-1;g((t=>(1===e?t.delete("searchDepth"):t.set("searchDepth",e.toString()),t)))}}),w(Tr,{children:w("div",{className:"mx-4 mt-4 rounded-lg border-2 border-dashed border-purple-500 p-4 shadow-lg dark:border-purple-600 dark:bg-[#0B1221]",children:[w("h3",{className:"cursor-text px-4 py-2 text-sm font-semibold uppercase tracking-wide text-slate-800 dark:text-slate-200 lg:text-xs",children:"Experimental Features"}),w(Do,{collapseEdges:c,collapseEdgesChanged:function(e){g((t=>(e?t.set("collapseEdges","true"):t.delete("collapseEdges"),t)))}})]})})]}),"nx-console"!==e.environment?w(Ho,{}):null]})};function la({project:e,toggleTask:t}){return w("li",{className:"relative block cursor-default select-none pb-0 pl-2 pr-6 text-xs text-slate-600 dark:text-slate-400",children:[w("div",{className:"flex items-center",children:w("label",{className:"block w-full cursor-pointer truncate rounded-md p-2 font-mono font-normal transition hover:bg-slate-50 hover:dark:bg-slate-700","data-project":e.projectGraphNode.name,title:e.projectGraphNode.name,"data-active":e.isSelected.toString(),onClick:()=>t(e.projectGraphNode.name),children:e.projectGraphNode.name})}),e.isSelected?w("span",{title:"This task is visible",className:"absolute inset-y-0 right-0 flex cursor-pointer items-center text-blue-500 dark:text-sky-500",onClick:()=>t(e.projectGraphNode.name),children:w(Fo,{className:"h-5 w-5"})}):null]})}function ca({headerText:e="",projects:t,toggleTask:n}){let r=[...t];return r.sort(((e,t)=>e.projectGraphNode.name.localeCompare(t.projectGraphNode.name))),w(b.HY,{children:[""!==e?w("h3",{className:"mt-4 cursor-text py-2 text-sm font-semibold uppercase tracking-wide text-slate-800 dark:text-slate-200 lg:text-xs",children:e}):null,w("ul",{className:"mt-2 -ml-3",children:r.map((e=>w(la,{project:e,toggleTask:n},e.projectGraphNode.name)))})]})}function ua(e,t){return{projectGraphNode:e,isSelected:t.includes(e.name)}}const da=function({projects:e,workspaceLayout:t,selectedTarget:n,selectedProjects:r,toggleProject:i,children:o}){const a=e.filter((e=>e.data.targets.hasOwnProperty(n))).sort(((e,t)=>e.name.localeCompare(t.name))),s=ei("app",a),l=ei("lib",a),c=ei("e2e",a),u=ti(s,t),d=ti(l,t),h=ti(c,t),f=Object.keys(u).sort(),p=Object.keys(d).sort(),v=Object.keys(h).sort();return w("div",{id:"project-lists",className:"mt-8 border-t border-slate-400/10 px-4",children:[o,w("h2",{className:"mt-8 border-b border-solid border-slate-200/10 text-lg font-light text-slate-400 dark:text-slate-500",children:"app projects"}),f.map((e=>w(ca,{headerText:e,projects:u[e].map((e=>ua(e,r))),toggleTask:i},"app-"+e))),w("h2",{className:"mt-8 border-b border-solid border-slate-200/10 text-lg font-light text-slate-400 dark:text-slate-500",children:"e2e projects"}),v.map((e=>w(ca,{headerText:e,projects:h[e].map((e=>ua(e,r))),toggleTask:i},"e2e-"+e))),w("h2",{className:"mt-8 border-b border-solid border-slate-200/10 text-lg font-light text-slate-400 dark:text-slate-500",children:"lib projects"}),p.map((e=>w(ca,{headerText:e,projects:d[e].map((e=>ua(e,r))),toggleTask:i},"lib-"+e)))]})};const ha=function(){var e;const t=k(),n=ut(),i=ht(),[o,a]=Bt(),s="true"===o.get("groupByProject"),l=wt("selectedWorkspace"),c=l.layout,u=wt("selectedTarget"),{taskGraphs:d}=u,{projects:h,targets:f}=l,p=null!=(e=i.selectedTarget)?e:f[0],[v,g]=(0,r.useState)([]);function m(){g([]);const e=h.map((e=>`${e.name}:${p}`));t.handleTaskEvent({type:"notifyTaskGraphTasksDeselected",taskIds:e})}return(0,r.useEffect)((()=>{g([]),t.handleTaskEvent({type:"notifyTaskGraphSetProjects",projects:l.projects,taskGraphs:d})}),[l]),(0,r.useEffect)((()=>{s?t.handleTaskEvent({type:"setGroupByProject",groupByProject:!0}):t.handleTaskEvent({type:"setGroupByProject",groupByProject:!1})}),[o]),w(b.HY,{children:[w($o,{showAll:()=>function(){const e=h.filter((e=>e.data.targets.hasOwnProperty(p)));g(e.map((e=>e.name))),t.handleTaskEvent({type:"notifyTaskGraphTasksSelected",taskIds:e.map((e=>`${e.name}:${p}`))})}(),hideAll:()=>m(),showAffected:()=>{},hasAffected:!1,label:"tasks"}),w(Ao,{checked:s,checkChanged:function(e){a((t=>(e?t.set("groupByProject","true"):t.delete("groupByProject"),t)),{relative:"path"})},name:"groupByProject",label:"Group by project",description:"Visually arrange tasks by project."}),w(da,{projects:h,selectedProjects:v,workspaceLayout:c,selectedTarget:p,toggleProject:function(e){v.includes(e)?function(e){const n=v.filter((t=>t!==e));g(n);const r=`${e}:${p}`;t.handleTaskEvent({type:"notifyTaskGraphTasksDeselected",taskIds:[r]})}(e):function(e){g([...v,e]);const n=function(e,t,n){return n?`${e}:${t}:${n}`:`${e}:${t}`}(e,p);t.handleTaskEvent({type:"notifyTaskGraphTasksSelected",taskIds:[n]})}(e)},children:[w("label",{htmlFor:"selectedTarget",className:"my-2 block text-sm font-medium text-gray-700",children:"Target Name"}),w(Yt,{id:"selectedTarget",className:"w-full","data-cy":"selected-target-dropdown",defaultValue:p,onChange:e=>{var t;(t=e.currentTarget.value)!==p&&(m(),i.selectedTarget?n({pathname:`../${t}`,search:o.toString()}):n({pathname:`${t}`,search:o.toString()}))},children:f.map((e=>w("option",{value:e,children:e})))})]})]})},{appConfig:fa}=$t(),pa=aa();function va(){return"dev"===$t().environment?ya:ba}const ga=async e=>{const t=fa.workspaces.find((t=>t.id===e)),n=await pa.getProjectGraph(t.projectGraphUrl),r=new Set;n.projects.forEach((e=>{var t;Object.keys(null!=(t=e.data.targets)?t:{}).forEach((e=>{r.add(e)}))}));const i=Array.from(r).sort(((e,t)=>e.localeCompare(t)));return Object.assign({},n,{targets:i})},ma=[{path:"projects",children:[{index:!0,element:w(sa,{})},{path:"all",element:w(sa,{})},{path:"affected",element:w(sa,{})},{path:":focusedProject",element:w(sa,{})},{path:"trace/:startTrace",element:w(sa,{})},{path:"trace/:startTrace/:endTrace",element:w(sa,{})}]},{loader:async({request:e,params:t})=>{var n;return(async e=>{const t=fa.workspaces.find((t=>t.id===e));return await pa.getTaskGraph(t.taskGraphUrl)})(null!=(n=t.selectedWorkspaceId)?n:fa.defaultWorkspaceId)},path:"tasks",id:"selectedTarget",shouldRevalidate:({currentParams:e,nextParams:t})=>!e.selectedWorkspaceId||e.selectedWorkspaceId!==t.selectedWorkspaceId,children:[{index:!0,element:w(ha,{})},{path:":selectedTarget",element:w(ha,{})}]}],ya=[{path:"/",children:[{index:!0,loader:async({request:e,params:t})=>{const{search:n}=new URL(e.url);return fe(`/${fa.defaultWorkspaceId}/projects${n}`)}},{path:":selectedWorkspaceId",id:"selectedWorkspace",element:w(fo,{}),shouldRevalidate:({currentParams:e,nextParams:t})=>e.selectedWorkspaceId!==t.selectedWorkspaceId,loader:async({request:e,params:t})=>{var n;const r=null!=(n=t.selectedWorkspaceId)?n:fa.defaultWorkspaceId;return ga(r)},children:ma}]}],ba=[{path:"/",id:"selectedWorkspace",loader:async({request:e,params:t})=>{const n=fa.defaultWorkspaceId;return ga(n)},shouldRevalidate:()=>!1,element:w(fo,{}),children:[{index:!0,loader:({request:e})=>{const{search:t}=new URL(e.url);return fe(`/projects${t}`)}},...ma]}];var xa;T(null!=(xa=localStorage.getItem(P))?xa:"system"),function(){var e;M(null!=(e=localStorage.getItem(N))?e:"TB")}();let wa=function(e,t){var n,r;return be({basename:null==t?void 0:t.basename,history:(r={window:null==t?void 0:t.window},void 0===r&&(r={}),H((function(e,t){let{pathname:n,search:r,hash:i}=e.location;return F("",{pathname:n,search:r,hash:i},t.state&&t.state.usr||null,t.state&&t.state.key||"default")}),(function(e,t){return"string"==typeof t?t:z(t)}),null,r)),hydrationData:(null==t?void 0:t.hydrationData)||(null==(n=window)?void 0:n.__staticRouterHydrationData),routes:Dt(e)}).initialize()};"build"===$t().localMode&&(wa=function(e,t){var n,r;return be({basename:null==t?void 0:t.basename,history:(r={window:null==t?void 0:t.window},void 0===r&&(r={}),H((function(e,t){let{pathname:n="/",search:r="",hash:i=""}=V(e.location.hash.substr(1));return F("",{pathname:n,search:r,hash:i},t.state&&t.state.usr||null,t.state&&t.state.key||"default")}),(function(e,t){let n=e.document.querySelector("base"),r="";if(n&&n.getAttribute("href")){let t=e.location.href,n=t.indexOf("#");r=-1===n?t:t.slice(0,n)}return r+"#"+("string"==typeof t?t:z(t))}),(function(e,t){L("/"===e.pathname.charAt(0),"relative pathnames are not supported in hash history.push("+JSON.stringify(t)+")")}),r)),hydrationData:(null==t?void 0:t.hydrationData)||(null==(n=window)?void 0:n.__staticRouterHydrationData),routes:Dt(e)}).initialize()});const Ea=wa(va());const _a=function(){return w(Et,{router:Ea})};!0===window.useXstateInspect&&function(e){var t=function(e){var t=i(i({},m),e);return i(i({},t),{url:new URL(t.url),iframe:d(t.iframe),devTools:d(t.devTools)})}(e),n=t.iframe,r=t.url,c=t.devTools;if(null!==n){var u,f,g=function(e,t){void 0===e&&(e=globalThis.__xstate__);var n=new Map,r=e.onRegister((function(e){n.set(e.sessionId,e)}));return(0,s.C)({initial:"pendingConnection",context:{client:void 0},states:{pendingConnection:{},connected:{on:{"service.state":{actions:function(e,t){return e.client.send(t)}},"service.event":{actions:function(e,t){return e.client.send(t)}},"service.register":{actions:function(e,t){return e.client.send(t)}},"service.stop":{actions:function(e,t){return e.client.send(t)}},"xstate.event":{actions:function(e,t){var r=t.event,i=JSON.parse(r),o=n.get(i.origin);null==o||o.send(i)}},unload:{actions:function(e){e.client.send({type:"xstate.disconnect"})}},disconnect:"disconnected"}},disconnected:{entry:function(){r.unsubscribe()},type:"final"}},on:{"xstate.inspecting":{target:".connected",actions:[(0,l.assign)({client:function(e,t){return t.client}}),function(n){e.services.forEach((function(e){var r;null===(r=n.client)||void 0===r||r.send({type:"service.register",machine:v(e.machine,null==t?void 0:t.serialize),state:p(e.state||e.initialState,null==t?void 0:t.serialize),sessionId:e.sessionId})}))}]}}})}(c,e),b=(0,o.kJ)(g).start(),x=new Set,w=b.subscribe((function(e){x.forEach((function(t){return t.next(e)}))})),E=function(e){if("object"==typeof e.data&&null!==e.data&&"type"in e.data){n&&!u&&(u=n.contentWindow),f||(f={send:function(e){u.postMessage(e,r.origin)}});var t=i(i({},e.data),{client:f});b.send(t)}};window.addEventListener("message",E),window.addEventListener("unload",(function(){b.send({type:"unload"})}));var _=function(t){return h(t,null==e?void 0:e.serialize)};return c.onRegister((function(t){var n,r=t.state||t.initialState;if(b.send({type:"service.register",machine:v(t.machine,null==e?void 0:e.serialize),state:p(r,null==e?void 0:e.serialize),sessionId:t.sessionId,id:t.id,parent:null===(n=t.parent)||void 0===n?void 0:n.sessionId}),b.send({type:"service.event",event:_(r._event),sessionId:t.sessionId}),!y.has(t)){y.add(t);var i=t.send.bind(t);t.send=function(e,n){return b.send({type:"service.event",event:_((0,a.g5)((0,a._v)(e,n))),sessionId:t.sessionId}),i(e,n)}}t.subscribe((function(n){void 0!==n&&b.send({type:"service.state",state:p(n,null==e?void 0:e.serialize),sessionId:t.sessionId})})),t.onStop((function(){b.send({type:"service.stop",sessionId:t.sessionId})}))})),n?(n.addEventListener("load",(function(){u=n.contentWindow})),n.setAttribute("src",String(r))):u=window.open(String(r),"xstateinspector"),{send:function(e){b.send(e)},subscribe:function(e,t,n){var r=(0,a.zM)(e,t,n);return x.add(r),r.next(b.state),{unsubscribe:function(){x.delete(r)}}},disconnect:function(){b.send("disconnect"),window.removeEventListener("message",E),w.unsubscribe()}}}console.warn("No suitable <iframe> found to embed the inspector. Please pass an <iframe> element to `inspect(iframe)` or create an <iframe data-xstate></iframe> element.")}({url:"https://stately.ai/viz?inspect",iframe:!1}),window.externalApi=new class{constructor(){this.projectGraphService=Gr()}focusProject(e){this.projectGraphService.send({type:"focusProject",projectName:e})}enableExperimentalFeatures(){localStorage.setItem("showExperimentalFeatures","true"),window.appConfig.showExperimentalFeatures=!0}disableExperimentalFeatures(){localStorage.setItem("showExperimentalFeatures","false"),window.appConfig.showExperimentalFeatures=!1}},window.appConfig?r.render(w(r.StrictMode,{children:w(_a,{})}),document.getElementById("app")):r.render(w("p",{children:["No environment could be found. Please run"," ",w("pre",{children:"npx nx run graph-client:generate-dev-environment-js"}),"."]}),document.getElementById("app"))},19798:(e,t,n)=>{"use strict";n.r(t),n.d(t,{GraphService:()=>k});n(15735),n(6886),n(77950),n(94908);var r=n(93218),i=n.n(r),o=n(81368),a=n.n(o),s=n(10404),l=n.n(s);n(43430),n(43105),n(39529),n(31235),n(85940);let c;!function(e){e.blue_500="hsla(217, 91%, 60%, 1)",e.blue_600="hsla(221, 83%, 53%, 1)",e.sky_500="hsla(199, 89%, 48%, 1)",e.sky_600="hsla(200, 98%, 39%, 1)",e.pink_400="hsla(329, 86%, 70%, 1)",e.pink_500="hsla(330, 81%, 60%, 1)",e.fuchsia_500="hsla(292, 84%, 61%, 1)",e.fuchsia_600="hsla(293, 69%, 49%, 1)",e.fuchsia_700="hsla(295, 72%, 40%, 1)",e.fuchsia_800="hsla(295, 70%, 33%, 1)",e.slate_50="hsla(210, 40%, 98%, 1)",e.slate_100="hsla(210, 40%, 96%, 1)",e.slate_200="hsla(214, 32%, 91%, 1)",e.slate_300="hsla(213, 27%, 84%, 1)",e.slate_400="hsla(213, 27%, 84%, 1)",e.slate_500="hsla(215, 16%, 47%, 1)",e.slate_600="hsla(215, 19%, 35%, 1)",e.slate_700="hsla(215, 25%, 27%, 1)",e.slate_800="hsla(217, 33%, 17%, 1)",e.white="#fff"}(c||(c={}));const u="NX_GRAPH_DARK_MODE";function d(e,t,n){return function(e){return!0===e.scratch(u)}(e)?t:n}const h=[{selector:"edge",style:{width:"1px","line-color":e=>d(e,c.slate_400,c.slate_500),"text-outline-color":e=>d(e,c.slate_400,c.slate_500),"text-outline-width":"0px",color:e=>d(e,c.slate_400,c.slate_500),"curve-style":"unbundled-bezier","target-arrow-shape":"triangle","target-arrow-fill":"filled","target-arrow-color":e=>d(e,c.slate_400,c.slate_500)}},{selector:"edge.affected",style:{"line-color":e=>d(e,c.fuchsia_500,c.pink_500),"target-arrow-color":e=>d(e,c.fuchsia_500,c.pink_500),"curve-style":"unbundled-bezier"}},{selector:"edge.implicit",style:{label:"implicit","font-size":"16px","curve-style":"unbundled-bezier","text-rotation":"autorotate"}},{selector:"edge.dynamic",style:{"line-dash-pattern":[5,5],"line-style":"dashed","curve-style":"unbundled-bezier"}},{selector:"edge.transparent",style:{opacity:.2}}];const f=new class{constructor(){this.cache=new Map,this.ctx=void 0}calculateWidth(e){this.ctx||(this.ctx=document.createElement("canvas").getContext("2d"));const t=e.data("id"),n=e.style("font-style"),r=e.style("font-size"),i=e.style("font-family"),o=e.style("font-weight");this.ctx.font=n+" "+o+" "+r+" "+i;const a=this.cache.get(t);if(a)return a;{const n=this.ctx.measureText(e.data("id")).width;return this.cache.set(t,n),n}}},p=[{selector:"node",style:{"font-size":"32px","font-family":'system-ui, "Helvetica Neue", sans-serif',backgroundColor:e=>d(e,c.slate_600,c.slate_200),"border-style":"solid","border-color":e=>d(e,c.slate_700,c.slate_300),"border-width":"1px","text-halign":"center","text-valign":"center","padding-left":"16px",color:e=>d(e,c.slate_200,c.slate_600),label:"data(id)",width:e=>f.calculateWidth(e),"transition-property":"background-color, border-color, line-color, target-arrow-color","transition-duration":250,"transition-timing-function":"ease-out",shape:"round-rectangle"}},{selector:"node.focused",style:{color:c.white,"border-color":e=>d(e,c.slate_700,c.slate_200),backgroundColor:e=>d(e,c.sky_500,c.blue_500),width:e=>f.calculateWidth(e)}},{selector:"node.affected",style:{color:c.white,"border-color":e=>d(e,c.fuchsia_800,c.pink_500),backgroundColor:e=>d(e,c.fuchsia_700,c.pink_400)}},{selector:"node.parentNode",style:{"background-opacity":e=>d(e,.5,.8),backgroundColor:e=>d(e,c.slate_700,c.slate_50),"border-color":e=>d(e,c.slate_500,c.slate_400),"border-style":"dashed","border-width":2,label:"data(label)","text-halign":"center","text-valign":"top","font-weight":"bold","font-size":"48px"}},{selector:"node.highlight",style:{color:c.white,"border-color":e=>d(e,c.sky_600,c.blue_600),backgroundColor:e=>d(e,c.sky_500,c.blue_500)}},{selector:"node.transparent:childless",style:{opacity:.5}},{selector:"node.transparent:parent",style:{"text-opacity":.5,"background-opacity":.25,"border-opacity":.5}},{selector:"node.taskNode",style:{label:"data(label)"}}],v={name:"dagre",nodeDimensionsIncludeLabels:!0,rankSep:75,rankDir:"TB",edgeSep:50,ranker:"network-simplex"};class g{constructor(e,t,n,r="TB"){this.container=e,this.renderMode=n,this.cy=void 0,this.collapseEdges=!1,this._theme=void 0,this._rankDir="TB",this.listeners=new Map,this._theme=t,this._rankDir=r}set theme(e){this._theme=e,this.render()}set rankDir(e){this._rankDir=e,this.render()}get activeContainer(){return"string"==typeof this.container?document.getElementById(this.container):this.container}broadcast(e){this.listeners.forEach((t=>t(e)))}listen(e){const t=this.listeners.size+1;return this.listeners.set(t,e),()=>{this.listeners.delete(t)}}setElements(e){let t;this.cy&&(t=this.cy.nodes(".focused").first().id(),this.cy.destroy(),delete this.cy),this.cy=i()({headless:null===this.activeContainer,container:this.activeContainer,boxSelectionEnabled:!1,style:[...p,...h],panningEnabled:!0,userZoomingEnabled:"nx-docs"!==this.renderMode}),this.cy.add(e),t&&this.cy.$id(t).addClass("focused"),this.cy.on("zoom pan",(()=>{this.broadcast({type:"GraphRegenerated"})})),this.listenForProjectNodeClicks(),this.listenForEdgeNodeClicks(),this.listenForProjectNodeHovers(),this.listenForTaskNodeClicks()}render(){var e,t,n,r;if(this.cy){const e=this.cy.elements().sort(((e,t)=>e.id().localeCompare(t.id())));e.layout(Object.assign({},v,{rankDir:this._rankDir})).run(),this.collapseEdges&&(this.cy.remove(this.cy.edges()),e.edges().forEach((e=>{const t=e.source(),n=e.target();if(t.parent().first().id()===n.parent().first().id())this.cy.add(e);else{let r,i;const o=e.connectedNodes().commonAncestors();let a,s;if(o.length>0?(r=t.ancestors().filter((e=>!o.contains(e))),i=n.ancestors().filter((e=>!o.contains(e)))):(r=t.ancestors(),i=n.ancestors()),r.length>0&&0===i.length?(a=r.last().id(),s=n.id()):i.length>0&&0===r.length?(a=t.id(),s=i.last().id()):(a=r.last().id(),s=i.last().id()),void 0!==a&&void 0!==s){const e=`${a}|${s}`;if(0===this.cy.$id(e).length){const t={group:"edges",data:{id:e,source:a,target:s}};this.cy.add(t)}}else console.log(`Couldn't figure out how to draw edge ${e.id()}`),console.log("source ancestors",r.map((e=>e.id()))),console.log("target ancestors",i.map((e=>e.id())))}}))),"nx-console"===this.renderMode?this.cy.fit(this.cy.elements(),175).center().resize().panBy({x:150,y:0}):this.cy.fit(this.cy.elements(),25).center().resize(),this.cy.scratch(u,"dark"===this._theme),this.cy.elements().scratch(u,"dark"===this._theme),this.cy.mount(this.activeContainer)}return{numNodes:null!=(e=null==(t=this.cy)?void 0:t.nodes().length)?e:0,numEdges:null!=(n=null==(r=this.cy)?void 0:r.edges().length)?n:0}}listenForProjectNodeClicks(){this.cy.$("node.projectNode").on("click",(e=>{const t=e.target;let n=t.popperRef();this.broadcast({type:"ProjectNodeClick",ref:n,id:t.id(),data:{id:t.id(),type:t.data("type"),tags:t.data("tags")}})}))}listenForTaskNodeClicks(){this.cy.$("node.taskNode").on("click",(e=>{const t=e.target;let n=t.popperRef();this.broadcast({type:"TaskNodeClick",ref:n,id:t.id(),data:{id:t.id(),label:t.data("label"),executor:t.data("executor")}})}))}listenForEdgeNodeClicks(){this.cy.$("edge.projectEdge").on("click",(e=>{const t=e.target;let n=t.popperRef();this.broadcast({type:"EdgeClick",ref:n,id:t.id(),data:{type:t.data("type"),source:t.source().id(),target:t.target().id(),fileDependencies:t.source().data("files").filter((e=>e.deps&&e.deps.includes(t.target().id()))).map((e=>({fileName:e.file.replace(`${t.source().data("root")}/`,""),target:t.target().id()})))}})}))}listenForProjectNodeHovers(){this.cy.on("mouseover",(e=>{const t=e.target;t.isNode&&t.isNode()&&!t.isParent()&&(this.cy.elements().difference(t.outgoers().union(t.incomers())).not(t).addClass("transparent"),t.addClass("highlight").outgoers().union(t.incomers()).addClass("highlight"))})),this.cy.on("mouseout",(e=>{const t=e.target;t.isNode&&t.isNode()&&!t.isParent()&&(this.cy.elements().removeClass("transparent"),t.removeClass("highlight").outgoers().union(t.incomers()).removeClass("highlight"))}))}getImage(){const e=d(this.cy,"#0F172A","#FFFFFF");return this.cy.png({bg:e,full:!0})}setFocussedElement(e){this.cy.$id(e).addClass("focused")}clearFocussedElement(){var e;null==(e=this.cy)||e.nodes(".focused").removeClass("focused")}getCurrentlyShownProjectIds(){var e,t;return null!=(e=null==(t=this.cy)?void 0:t.nodes().map((e=>e.data("id"))))?e:[]}}class m{constructor(e,t){this.project=e,this.workspaceRoot=t,this.affected=!1,this.focused=!1}getCytoscapeNodeDef(e){return{group:"nodes",data:this.getData(e),classes:this.getClasses(),selectable:!1,grabbable:!1,pannable:!0}}getData(e){return{id:this.project.name,type:this.project.type,tags:this.project.data.tags,parent:e&&this.project.data.hasOwnProperty("root")?this.getParentId():null,files:this.project.data.files,root:this.project.data.root}}getClasses(){let e=`projectNode ${this.project.type}`;return this.affected&&(e+=" affected"),e}getParentId(){const e=this.getAncestors();return e.length>0?e[e.length-1].id:null}getAncestors(){if(!this.project.data.root)return[];return function(e,t){const n=e.replace(t,"").split("/").filter((e=>""!==e));return n.pop(),n}(this.project.data.root,this.workspaceRoot).map(((e,t,n)=>{const r=[...n].slice(0,t+1).join("/");return{label:r,id:`dir-${r}`,parentId:t>0?`dir-${[...n].slice(0,t).join("/")}`:null}}))}}class y{constructor(e){this.dep=e,this.affected=!1}getCytosacpeNodeDef(){var e;let t;return t={group:"edges",classes:"projectEdge",data:{id:`${this.dep.source}|${this.dep.target}`,source:this.dep.source,target:this.dep.target,type:this.dep.type}},t.classes+=null!=(e=` ${this.dep.type}`)?e:"",this.affected&&(t.classes+=" affected"),t}}class b{constructor(e){this.config=e}getCytoscapeNodeDef(){return{group:"nodes",classes:"parentNode",data:{id:this.config.id,parent:this.config.parentId,label:this.config.label,type:"dir"},selectable:!1,grabbable:!1,pannable:!0}}}class x{constructor(){this.cy=void 0}setShownProjects(e){let t=this.cy.collection();e.forEach((e=>{t=t.union(this.cy.$id(e))}));const n=t.ancestors(),r=t.union(n),i=r.edgesTo(r);return r.union(i)}showProjects(e,t){let n=this.cy.collection();e.forEach((e=>{n=n.union(this.cy.$id(e))})),t.forEach((e=>{n=n.union(this.cy.$id(e))}));const r=n.ancestors(),i=n.union(r),o=i.edgesTo(i);return i.union(o)}hideProjects(e,t){let n=this.cy.collection();t.forEach((e=>{n=n.union(this.cy.$id(e))}));let r=this.cy.collection();e.forEach((e=>{r=r.union(this.cy.$id(e))}));const i=n.difference(r).difference(r.ancestors()),o=i.ancestors();let a=i.union(o);const s=a.edgesTo(a);return a.union(s)}showAffectedProjects(){const e=this.cy.nodes(".affected"),t=e.ancestors(),n=e.union(t),r=n.edgesTo(n);return n.union(r)}focusProject(e,t=1){const n=this.cy.$id(e),r=this.includeProjectsByDepth(n,t),i=n.union(r),o=i.ancestors(),a=i.union(o),s=a.edgesTo(a);return a.union(s)}showAllProjects(){return this.cy.elements()}hideAllProjects(){return this.cy.collection()}filterProjectsByText(e,t,n=-1){if(""===e)return this.cy.collection();{const r=e.split(",");let i=this.cy.nodes().filter((e=>r.findIndex((t=>e.id().includes(t)))>-1));t&&(i=i.union(this.includeProjectsByDepth(i,n))),i=i.union(i.ancestors());const o=i.edgesTo(i);return i.union(o)}}traceProjects(e,t){const n=this.cy.elements().dijkstra({root:`[id = "${e}"]`,directed:!0}).pathTo(this.cy.$(`[id = "${t}"]`));return n.union(n.ancestors())}traceAllProjects(e,t){const n=[[this.cy.$id(e).nodes().first()]],r=[];let i=0;for(;n.length>0&&i<=1e3;){const e=n.pop(),o=e[e.length-1].outgoers("node");o.length>0&&o.forEach((i=>{const o=[...e,i];i.id()===t?r.push(o):n.push(o)})),i++}i>=1e3&&console.log("failsafe triggered!");let o=this.cy.collection();return r.forEach((e=>{for(let t=0;t<e.length;t++){o=o.union(e[t]);const n=t+1;n<e.length&&(o=o.union(e[t].edgesTo(e[n])))}})),o.union(o.ancestors())}includeProjectsByDepth(e,t=-1){let n,r;if(-1===t)n=e.predecessors();else{n=e.incomers();for(let e=1;e<t;e++)n=n.union(n.incomers())}if(-1===t)r=e.successors();else{r=e.outgoers();for(let e=1;e<t;e++)r=r.union(r.outgoers())}return e.union(n).union(r)}initGraph(e,t,n,r,i,o){this.generateCytoscapeLayout(e,t,n,r,i)}generateCytoscapeLayout(e,t,n,r,o){const a=this.createElements(e,t,n,r,o);this.cy=i()({headless:!0,elements:[...a],boxSelectionEnabled:!1})}createElements(e,t,n,r,i){let o=[];const a=e.map((e=>e.name)),s=[],l=[],c={};e.forEach((e=>{const o="app"===e.type||"e2e"===e.type?n.appsDir:n.libsDir,u=new m(e,o);if(u.affected=i.includes(e.name),s.push(u),r[e.name].forEach((e=>{if(a.includes(e.target)){const t=new y(e);l.push(t)}})),t){u.getAncestors().forEach((e=>c[e.id]=e))}}));const u=s.map((e=>e.getCytoscapeNodeDef(t))),d=l.map((e=>e.getCytosacpeNodeDef()));if(o=u.concat(d),t){o=Object.keys(c).map((e=>new b(c[e]).getCytoscapeNodeDef())).concat(o)}return o}}class w{constructor(e,t){this.task=e,this.project=t}getCytoscapeNodeDef(e){return{group:"nodes",classes:"taskNode",data:this.getData(e),selectable:!1,grabbable:!1,pannable:!0}}getData(e){const t=e?this.task.id.split(":").slice(1).join(":"):this.task.id;return{id:this.task.id,label:t,executor:this.project.data.targets[this.task.target.target].executor,parent:e?this.task.target.project:null}}}class E{constructor(e,t){this.source=e,this.target=t}getCytoscapeNodeDef(){let e;return e={group:"edges",data:{id:`${this.source}|${this.target}`,source:this.source,target:this.target}},e}}class _{constructor(){this.projects=[],this.taskGraphs={},this.cy=void 0,this.groupByProject=!1,this.selectedTasks=new Set}setProjects(e,t){this.selectedTasks.clear(),this.projects=e,this.taskGraphs=t}selectTask(e){return e.forEach((e=>{this.selectedTasks.add(e)})),this.createElements(Array.from(this.selectedTasks),this.groupByProject),this.cy.elements()}setGroupByProject(e){return this.groupByProject=e,this.selectedTasks.size>0?this.createElements(Array.from(this.selectedTasks),e):this.cy=i()({headless:!0,elements:[]}),this.cy.elements()}deselectTask(e){return e.forEach((e=>{this.selectedTasks.delete(e)})),this.createElements(Array.from(this.selectedTasks),this.groupByProject),this.cy.elements()}createElements(e,t){const n=[];e.forEach((e=>{const r=this.taskGraphs[e];if(void 0===r)throw new Error(`Could not find task graph for ${e}`);const i={};for(let o in r.tasks){const e=r.tasks[o],a=this.projects.find((t=>t.name===e.target.project));if(void 0===a)throw new Error(`Could not find project ${a.name}`);n.push(new w(r.tasks[o],a)),t&&(i[a.name]={id:a.name,parentId:null,label:a.name})}for(let t in i)n.push(new b(i[t]));for(let t in r.dependencies)r.dependencies[t].forEach((e=>n.push(new E(t,e))))})),this.cy=i()({headless:!0,elements:n.map((e=>e.getCytoscapeNodeDef(t))),boxSelectionEnabled:!1})}}class k{constructor(e,t,n,i="TB"){this.projectTraversalGraph=void 0,this.taskTraversalGraph=void 0,this.renderGraph=void 0,this.lastPerformanceReport={numEdges:0,numNodes:0,renderTime:0},this.listeners=new Map,(0,r.use)(a()),(0,r.use)(l()),this.renderGraph=new g(e,t,n,i),this.renderGraph.listen((e=>this.broadcast(e))),this.projectTraversalGraph=new x,this.taskTraversalGraph=new _}set theme(e){this.renderGraph.theme=e}set rankDir(e){this.renderGraph.rankDir=e}listen(e){const t=this.listeners.size+1;return this.listeners.set(t,e),()=>{this.listeners.delete(t)}}broadcast(e){this.listeners.forEach((t=>t(e)))}handleProjectEvent(e){const t=Date.now();let n;switch("notifyGraphUpdateGraph"!==e.type&&this.renderGraph.clearFocussedElement(),e.type){case"notifyGraphInitGraph":this.renderGraph.collapseEdges=e.collapseEdges,this.broadcast({type:"GraphRegenerated"}),this.projectTraversalGraph.initGraph(e.projects,e.groupByFolder,e.workspaceLayout,e.dependencies,e.affectedProjects,e.collapseEdges);break;case"notifyGraphUpdateGraph":this.renderGraph.collapseEdges=e.collapseEdges,this.broadcast({type:"GraphRegenerated"}),this.projectTraversalGraph.initGraph(e.projects,e.groupByFolder,e.workspaceLayout,e.dependencies,e.affectedProjects,e.collapseEdges),n=this.projectTraversalGraph.setShownProjects(e.selectedProjects.length>0?e.selectedProjects:this.renderGraph.getCurrentlyShownProjectIds());break;case"notifyGraphFocusProject":n=this.projectTraversalGraph.focusProject(e.projectName,e.searchDepth);break;case"notifyGraphFilterProjectsByText":n=this.projectTraversalGraph.filterProjectsByText(e.search,e.includeProjectsByPath,e.searchDepth);break;case"notifyGraphShowProjects":n=this.projectTraversalGraph.showProjects(e.projectNames,this.renderGraph.getCurrentlyShownProjectIds());break;case"notifyGraphHideProjects":n=this.projectTraversalGraph.hideProjects(e.projectNames,this.renderGraph.getCurrentlyShownProjectIds());break;case"notifyGraphShowAllProjects":n=this.projectTraversalGraph.showAllProjects();break;case"notifyGraphHideAllProjects":n=this.projectTraversalGraph.hideAllProjects();break;case"notifyGraphShowAffectedProjects":n=this.projectTraversalGraph.showAffectedProjects();break;case"notifyGraphTracing":e.start&&e.end&&(n="shortest"===e.algorithm?this.projectTraversalGraph.traceProjects(e.start,e.end):this.projectTraversalGraph.traceAllProjects(e.start,e.end))}let r=[],i={numEdges:0,numNodes:0,renderTime:0};if(this.renderGraph)if(n){var o;this.renderGraph.setElements(n),"notifyGraphFocusProject"===e.type&&this.renderGraph.setFocussedElement(e.projectName);const{numEdges:a,numNodes:s}=this.renderGraph.render();r=(null!=(o=n.nodes('[type!="dir"]'))?o:[]).map((e=>e.id()));i={renderTime:Date.now()-t,numNodes:s,numEdges:a}}else{const{numEdges:e,numNodes:n}=this.renderGraph.render();this.renderGraph.getCurrentlyShownProjectIds();i={renderTime:Date.now()-t,numNodes:n,numEdges:e}}return this.lastPerformanceReport=i,this.broadcast({type:"GraphRegenerated"}),{selectedProjectNames:r,perfReport:i}}handleTaskEvent(e){const t=Date.now();let n;switch(this.broadcast({type:"GraphRegenerated"}),e.type){case"notifyTaskGraphSetProjects":this.taskTraversalGraph.setProjects(e.projects,e.taskGraphs);break;case"notifyTaskGraphTasksSelected":n=this.taskTraversalGraph.selectTask(e.taskIds);break;case"notifyTaskGraphTasksDeselected":n=this.taskTraversalGraph.deselectTask(e.taskIds);break;case"setGroupByProject":n=this.taskTraversalGraph.setGroupByProject(e.groupByProject)}let r=[],i={numEdges:0,numNodes:0,renderTime:0};if(this.renderGraph&&n){var o;this.renderGraph.setElements(n);const{numEdges:e,numNodes:a}=this.renderGraph.render();r=(null!=(o=n.nodes('[type!="dir"]'))?o:[]).map((e=>e.id()));i={renderTime:Date.now()-t,numNodes:a,numEdges:e}}return this.lastPerformanceReport=i,this.broadcast({type:"GraphRegenerated"}),{selectedProjectNames:r,perfReport:i}}getImage(){return this.renderGraph.getImage()}}},52749:(e,t,n)=>{"use strict";n.r(t),n.d(t,{afterMain:()=>E,afterRead:()=>b,afterWrite:()=>S,applyStyles:()=>O,arrow:()=>Q,auto:()=>s,basePlacements:()=>l,beforeMain:()=>x,beforeRead:()=>m,beforeWrite:()=>_,bottom:()=>i,clippingParents:()=>d,computeStyles:()=>ne,createPopper:()=>Oe,createPopperBase:()=>Ne,createPopperLite:()=>Me,detectOverflow:()=>ye,end:()=>u,eventListeners:()=>ie,flip:()=>be,hide:()=>Ee,left:()=>a,main:()=>w,modifierPhases:()=>P,offset:()=>_e,placements:()=>g,popper:()=>f,popperGenerator:()=>De,popperOffsets:()=>ke,preventOverflow:()=>Se,read:()=>y,reference:()=>p,right:()=>o,start:()=>c,top:()=>r,variationPlacements:()=>v,viewport:()=>h,write:()=>k});var r="top",i="bottom",o="right",a="left",s="auto",l=[r,i,o,a],c="start",u="end",d="clippingParents",h="viewport",f="popper",p="reference",v=l.reduce((function(e,t){return e.concat([t+"-"+c,t+"-"+u])}),[]),g=[].concat(l,[s]).reduce((function(e,t){return e.concat([t,t+"-"+c,t+"-"+u])}),[]),m="beforeRead",y="read",b="afterRead",x="beforeMain",w="main",E="afterMain",_="beforeWrite",k="write",S="afterWrite",P=[m,y,b,x,w,E,_,k,S];function j(e){return e?(e.nodeName||"").toLowerCase():null}function C(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function T(e){return e instanceof C(e).Element||e instanceof Element}function D(e){return e instanceof C(e).HTMLElement||e instanceof HTMLElement}function N(e){return"undefined"!=typeof ShadowRoot&&(e instanceof C(e).ShadowRoot||e instanceof ShadowRoot)}const O={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var n=t.styles[e]||{},r=t.attributes[e]||{},i=t.elements[e];D(i)&&j(i)&&(Object.assign(i.style,n),Object.keys(r).forEach((function(e){var t=r[e];!1===t?i.removeAttribute(e):i.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach((function(e){var r=t.elements[e],i=t.attributes[e]||{},o=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{});D(r)&&j(r)&&(Object.assign(r.style,o),Object.keys(i).forEach((function(e){r.removeAttribute(e)})))}))}},requires:["computeStyles"]};function M(e){return e.split("-")[0]}var A=Math.max,R=Math.min,I=Math.round;function L(){var e=navigator.userAgentData;return null!=e&&e.brands?e.brands.map((function(e){return e.brand+"/"+e.version})).join(" "):navigator.userAgent}function B(){return!/^((?!chrome|android).)*safari/i.test(L())}function F(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var r=e.getBoundingClientRect(),i=1,o=1;t&&D(e)&&(i=e.offsetWidth>0&&I(r.width)/e.offsetWidth||1,o=e.offsetHeight>0&&I(r.height)/e.offsetHeight||1);var a=(T(e)?C(e):window).visualViewport,s=!B()&&n,l=(r.left+(s&&a?a.offsetLeft:0))/i,c=(r.top+(s&&a?a.offsetTop:0))/o,u=r.width/i,d=r.height/o;return{width:u,height:d,top:c,right:l+u,bottom:c+d,left:l,x:l,y:c}}function z(e){var t=F(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function V(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&N(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function G(e){return C(e).getComputedStyle(e)}function H(e){return["table","td","th"].indexOf(j(e))>=0}function W(e){return((T(e)?e.ownerDocument:e.document)||window.document).documentElement}function q(e){return"html"===j(e)?e:e.assignedSlot||e.parentNode||(N(e)?e.host:null)||W(e)}function Y(e){return D(e)&&"fixed"!==G(e).position?e.offsetParent:null}function U(e){for(var t=C(e),n=Y(e);n&&H(n)&&"static"===G(n).position;)n=Y(n);return n&&("html"===j(n)||"body"===j(n)&&"static"===G(n).position)?t:n||function(e){var t=/firefox/i.test(L());if(/Trident/i.test(L())&&D(e)&&"fixed"===G(e).position)return null;var n=q(e);for(N(n)&&(n=n.host);D(n)&&["html","body"].indexOf(j(n))<0;){var r=G(n);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||t&&"filter"===r.willChange||t&&r.filter&&"none"!==r.filter)return n;n=n.parentNode}return null}(e)||t}function X(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function $(e,t,n){return A(e,R(t,n))}function K(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function Z(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}const Q={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,s=e.name,c=e.options,u=n.elements.arrow,d=n.modifiersData.popperOffsets,h=M(n.placement),f=X(h),p=[a,o].indexOf(h)>=0?"height":"width";if(u&&d){var v=function(e,t){return K("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:Z(e,l))}(c.padding,n),g=z(u),m="y"===f?r:a,y="y"===f?i:o,b=n.rects.reference[p]+n.rects.reference[f]-d[f]-n.rects.popper[p],x=d[f]-n.rects.reference[f],w=U(u),E=w?"y"===f?w.clientHeight||0:w.clientWidth||0:0,_=b/2-x/2,k=v[m],S=E-g[p]-v[y],P=E/2-g[p]/2+_,j=$(k,P,S),C=f;n.modifiersData[s]=((t={})[C]=j,t.centerOffset=j-P,t)}},effect:function(e){var t=e.state,n=e.options.element,r=void 0===n?"[data-popper-arrow]":n;null!=r&&("string"!=typeof r||(r=t.elements.popper.querySelector(r)))&&V(t.elements.popper,r)&&(t.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function J(e){return e.split("-")[1]}var ee={top:"auto",right:"auto",bottom:"auto",left:"auto"};function te(e){var t,n=e.popper,s=e.popperRect,l=e.placement,c=e.variation,d=e.offsets,h=e.position,f=e.gpuAcceleration,p=e.adaptive,v=e.roundOffsets,g=e.isFixed,m=d.x,y=void 0===m?0:m,b=d.y,x=void 0===b?0:b,w="function"==typeof v?v({x:y,y:x}):{x:y,y:x};y=w.x,x=w.y;var E=d.hasOwnProperty("x"),_=d.hasOwnProperty("y"),k=a,S=r,P=window;if(p){var j=U(n),T="clientHeight",D="clientWidth";if(j===C(n)&&"static"!==G(j=W(n)).position&&"absolute"===h&&(T="scrollHeight",D="scrollWidth"),l===r||(l===a||l===o)&&c===u)S=i,x-=(g&&j===P&&P.visualViewport?P.visualViewport.height:j[T])-s.height,x*=f?1:-1;if(l===a||(l===r||l===i)&&c===u)k=o,y-=(g&&j===P&&P.visualViewport?P.visualViewport.width:j[D])-s.width,y*=f?1:-1}var N,O=Object.assign({position:h},p&&ee),M=!0===v?function(e){var t=e.x,n=e.y,r=window.devicePixelRatio||1;return{x:I(t*r)/r||0,y:I(n*r)/r||0}}({x:y,y:x}):{x:y,y:x};return y=M.x,x=M.y,f?Object.assign({},O,((N={})[S]=_?"0":"",N[k]=E?"0":"",N.transform=(P.devicePixelRatio||1)<=1?"translate("+y+"px, "+x+"px)":"translate3d("+y+"px, "+x+"px, 0)",N)):Object.assign({},O,((t={})[S]=_?x+"px":"",t[k]=E?y+"px":"",t.transform="",t))}const ne={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=void 0===r||r,o=n.adaptive,a=void 0===o||o,s=n.roundOffsets,l=void 0===s||s,c={placement:M(t.placement),variation:J(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,te(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:l})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,te(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}};var re={passive:!0};const ie={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,n=e.instance,r=e.options,i=r.scroll,o=void 0===i||i,a=r.resize,s=void 0===a||a,l=C(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&c.forEach((function(e){e.addEventListener("scroll",n.update,re)})),s&&l.addEventListener("resize",n.update,re),function(){o&&c.forEach((function(e){e.removeEventListener("scroll",n.update,re)})),s&&l.removeEventListener("resize",n.update,re)}},data:{}};var oe={left:"right",right:"left",bottom:"top",top:"bottom"};function ae(e){return e.replace(/left|right|bottom|top/g,(function(e){return oe[e]}))}var se={start:"end",end:"start"};function le(e){return e.replace(/start|end/g,(function(e){return se[e]}))}function ce(e){var t=C(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function ue(e){return F(W(e)).left+ce(e).scrollLeft}function de(e){var t=G(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function he(e){return["html","body","#document"].indexOf(j(e))>=0?e.ownerDocument.body:D(e)&&de(e)?e:he(q(e))}function fe(e,t){var n;void 0===t&&(t=[]);var r=he(e),i=r===(null==(n=e.ownerDocument)?void 0:n.body),o=C(r),a=i?[o].concat(o.visualViewport||[],de(r)?r:[]):r,s=t.concat(a);return i?s:s.concat(fe(q(a)))}function pe(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function ve(e,t,n){return t===h?pe(function(e,t){var n=C(e),r=W(e),i=n.visualViewport,o=r.clientWidth,a=r.clientHeight,s=0,l=0;if(i){o=i.width,a=i.height;var c=B();(c||!c&&"fixed"===t)&&(s=i.offsetLeft,l=i.offsetTop)}return{width:o,height:a,x:s+ue(e),y:l}}(e,n)):T(t)?function(e,t){var n=F(e,!1,"fixed"===t);return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}(t,n):pe(function(e){var t,n=W(e),r=ce(e),i=null==(t=e.ownerDocument)?void 0:t.body,o=A(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=A(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),s=-r.scrollLeft+ue(e),l=-r.scrollTop;return"rtl"===G(i||n).direction&&(s+=A(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:s,y:l}}(W(e)))}function ge(e,t,n,r){var i="clippingParents"===t?function(e){var t=fe(q(e)),n=["absolute","fixed"].indexOf(G(e).position)>=0&&D(e)?U(e):e;return T(n)?t.filter((function(e){return T(e)&&V(e,n)&&"body"!==j(e)})):[]}(e):[].concat(t),o=[].concat(i,[n]),a=o[0],s=o.reduce((function(t,n){var i=ve(e,n,r);return t.top=A(i.top,t.top),t.right=R(i.right,t.right),t.bottom=R(i.bottom,t.bottom),t.left=A(i.left,t.left),t}),ve(e,a,r));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function me(e){var t,n=e.reference,s=e.element,l=e.placement,d=l?M(l):null,h=l?J(l):null,f=n.x+n.width/2-s.width/2,p=n.y+n.height/2-s.height/2;switch(d){case r:t={x:f,y:n.y-s.height};break;case i:t={x:f,y:n.y+n.height};break;case o:t={x:n.x+n.width,y:p};break;case a:t={x:n.x-s.width,y:p};break;default:t={x:n.x,y:n.y}}var v=d?X(d):null;if(null!=v){var g="y"===v?"height":"width";switch(h){case c:t[v]=t[v]-(n[g]/2-s[g]/2);break;case u:t[v]=t[v]+(n[g]/2-s[g]/2)}}return t}function ye(e,t){void 0===t&&(t={});var n=t,a=n.placement,s=void 0===a?e.placement:a,c=n.strategy,u=void 0===c?e.strategy:c,v=n.boundary,g=void 0===v?d:v,m=n.rootBoundary,y=void 0===m?h:m,b=n.elementContext,x=void 0===b?f:b,w=n.altBoundary,E=void 0!==w&&w,_=n.padding,k=void 0===_?0:_,S=K("number"!=typeof k?k:Z(k,l)),P=x===f?p:f,j=e.rects.popper,C=e.elements[E?P:x],D=ge(T(C)?C:C.contextElement||W(e.elements.popper),g,y,u),N=F(e.elements.reference),O=me({reference:N,element:j,strategy:"absolute",placement:s}),M=pe(Object.assign({},j,O)),A=x===f?M:N,R={top:D.top-A.top+S.top,bottom:A.bottom-D.bottom+S.bottom,left:D.left-A.left+S.left,right:A.right-D.right+S.right},I=e.modifiersData.offset;if(x===f&&I){var L=I[s];Object.keys(R).forEach((function(e){var t=[o,i].indexOf(e)>=0?1:-1,n=[r,i].indexOf(e)>=0?"y":"x";R[e]+=L[n]*t}))}return R}const be={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,u=e.name;if(!t.modifiersData[u]._skip){for(var d=n.mainAxis,h=void 0===d||d,f=n.altAxis,p=void 0===f||f,m=n.fallbackPlacements,y=n.padding,b=n.boundary,x=n.rootBoundary,w=n.altBoundary,E=n.flipVariations,_=void 0===E||E,k=n.allowedAutoPlacements,S=t.options.placement,P=M(S),j=m||(P===S||!_?[ae(S)]:function(e){if(M(e)===s)return[];var t=ae(e);return[le(e),t,le(t)]}(S)),C=[S].concat(j).reduce((function(e,n){return e.concat(M(n)===s?function(e,t){void 0===t&&(t={});var n=t,r=n.placement,i=n.boundary,o=n.rootBoundary,a=n.padding,s=n.flipVariations,c=n.allowedAutoPlacements,u=void 0===c?g:c,d=J(r),h=d?s?v:v.filter((function(e){return J(e)===d})):l,f=h.filter((function(e){return u.indexOf(e)>=0}));0===f.length&&(f=h);var p=f.reduce((function(t,n){return t[n]=ye(e,{placement:n,boundary:i,rootBoundary:o,padding:a})[M(n)],t}),{});return Object.keys(p).sort((function(e,t){return p[e]-p[t]}))}(t,{placement:n,boundary:b,rootBoundary:x,padding:y,flipVariations:_,allowedAutoPlacements:k}):n)}),[]),T=t.rects.reference,D=t.rects.popper,N=new Map,O=!0,A=C[0],R=0;R<C.length;R++){var I=C[R],L=M(I),B=J(I)===c,F=[r,i].indexOf(L)>=0,z=F?"width":"height",V=ye(t,{placement:I,boundary:b,rootBoundary:x,altBoundary:w,padding:y}),G=F?B?o:a:B?i:r;T[z]>D[z]&&(G=ae(G));var H=ae(G),W=[];if(h&&W.push(V[L]<=0),p&&W.push(V[G]<=0,V[H]<=0),W.every((function(e){return e}))){A=I,O=!1;break}N.set(I,W)}if(O)for(var q=function(e){var t=C.find((function(t){var n=N.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return A=t,"break"},Y=_?3:1;Y>0;Y--){if("break"===q(Y))break}t.placement!==A&&(t.modifiersData[u]._skip=!0,t.placement=A,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function xe(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function we(e){return[r,o,i,a].some((function(t){return e[t]>=0}))}const Ee={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,o=t.modifiersData.preventOverflow,a=ye(t,{elementContext:"reference"}),s=ye(t,{altBoundary:!0}),l=xe(a,r),c=xe(s,i,o),u=we(l),d=we(c);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}};const _e={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,i=e.name,s=n.offset,l=void 0===s?[0,0]:s,c=g.reduce((function(e,n){return e[n]=function(e,t,n){var i=M(e),s=[a,r].indexOf(i)>=0?-1:1,l="function"==typeof n?n(Object.assign({},t,{placement:e})):n,c=l[0],u=l[1];return c=c||0,u=(u||0)*s,[a,o].indexOf(i)>=0?{x:u,y:c}:{x:c,y:u}}(n,t.rects,l),e}),{}),u=c[t.placement],d=u.x,h=u.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=d,t.modifiersData.popperOffsets.y+=h),t.modifiersData[i]=c}};const ke={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=me({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}};const Se={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,s=e.name,l=n.mainAxis,u=void 0===l||l,d=n.altAxis,h=void 0!==d&&d,f=n.boundary,p=n.rootBoundary,v=n.altBoundary,g=n.padding,m=n.tether,y=void 0===m||m,b=n.tetherOffset,x=void 0===b?0:b,w=ye(t,{boundary:f,rootBoundary:p,padding:g,altBoundary:v}),E=M(t.placement),_=J(t.placement),k=!_,S=X(E),P="x"===S?"y":"x",j=t.modifiersData.popperOffsets,C=t.rects.reference,T=t.rects.popper,D="function"==typeof x?x(Object.assign({},t.rects,{placement:t.placement})):x,N="number"==typeof D?{mainAxis:D,altAxis:D}:Object.assign({mainAxis:0,altAxis:0},D),O=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,I={x:0,y:0};if(j){if(u){var L,B="y"===S?r:a,F="y"===S?i:o,V="y"===S?"height":"width",G=j[S],H=G+w[B],W=G-w[F],q=y?-T[V]/2:0,Y=_===c?C[V]:T[V],K=_===c?-T[V]:-C[V],Z=t.elements.arrow,Q=y&&Z?z(Z):{width:0,height:0},ee=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},te=ee[B],ne=ee[F],re=$(0,C[V],Q[V]),ie=k?C[V]/2-q-re-te-N.mainAxis:Y-re-te-N.mainAxis,oe=k?-C[V]/2+q+re+ne+N.mainAxis:K+re+ne+N.mainAxis,ae=t.elements.arrow&&U(t.elements.arrow),se=ae?"y"===S?ae.clientTop||0:ae.clientLeft||0:0,le=null!=(L=null==O?void 0:O[S])?L:0,ce=G+oe-le,ue=$(y?R(H,G+ie-le-se):H,G,y?A(W,ce):W);j[S]=ue,I[S]=ue-G}if(h){var de,he="x"===S?r:a,fe="x"===S?i:o,pe=j[P],ve="y"===P?"height":"width",ge=pe+w[he],me=pe-w[fe],be=-1!==[r,a].indexOf(E),xe=null!=(de=null==O?void 0:O[P])?de:0,we=be?ge:pe-C[ve]-T[ve]-xe+N.altAxis,Ee=be?pe+C[ve]+T[ve]-xe-N.altAxis:me,_e=y&&be?function(e,t,n){var r=$(e,t,n);return r>n?n:r}(we,pe,Ee):$(y?we:ge,pe,y?Ee:me);j[P]=_e,I[P]=_e-pe}t.modifiersData[s]=I}},requiresIfExists:["offset"]};function Pe(e,t,n){void 0===n&&(n=!1);var r,i,o=D(t),a=D(t)&&function(e){var t=e.getBoundingClientRect(),n=I(t.width)/e.offsetWidth||1,r=I(t.height)/e.offsetHeight||1;return 1!==n||1!==r}(t),s=W(t),l=F(e,a,n),c={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(o||!o&&!n)&&(("body"!==j(t)||de(s))&&(c=(r=t)!==C(r)&&D(r)?{scrollLeft:(i=r).scrollLeft,scrollTop:i.scrollTop}:ce(r)),D(t)?((u=F(t,!0)).x+=t.clientLeft,u.y+=t.clientTop):s&&(u.x=ue(s))),{x:l.left+c.scrollLeft-u.x,y:l.top+c.scrollTop-u.y,width:l.width,height:l.height}}function je(e){var t=new Map,n=new Set,r=[];function i(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var r=t.get(e);r&&i(r)}})),r.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||i(e)})),r}var Ce={placement:"bottom",modifiers:[],strategy:"absolute"};function Te(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some((function(e){return!(e&&"function"==typeof e.getBoundingClientRect)}))}function De(e){void 0===e&&(e={});var t=e,n=t.defaultModifiers,r=void 0===n?[]:n,i=t.defaultOptions,o=void 0===i?Ce:i;return function(e,t,n){void 0===n&&(n=o);var i,a,s={placement:"bottom",orderedModifiers:[],options:Object.assign({},Ce,o),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},l=[],c=!1,u={state:s,setOptions:function(n){var i="function"==typeof n?n(s.options):n;d(),s.options=Object.assign({},o,s.options,i),s.scrollParents={reference:T(e)?fe(e):e.contextElement?fe(e.contextElement):[],popper:fe(t)};var a=function(e){var t=je(e);return P.reduce((function(e,n){return e.concat(t.filter((function(e){return e.phase===n})))}),[])}(function(e){var t=e.reduce((function(e,t){var n=e[t.name];return e[t.name]=n?Object.assign({},n,t,{options:Object.assign({},n.options,t.options),data:Object.assign({},n.data,t.data)}):t,e}),{});return Object.keys(t).map((function(e){return t[e]}))}([].concat(r,s.options.modifiers)));return s.orderedModifiers=a.filter((function(e){return e.enabled})),s.orderedModifiers.forEach((function(e){var t=e.name,n=e.options,r=void 0===n?{}:n,i=e.effect;if("function"==typeof i){var o=i({state:s,name:t,instance:u,options:r}),a=function(){};l.push(o||a)}})),u.update()},forceUpdate:function(){if(!c){var e=s.elements,t=e.reference,n=e.popper;if(Te(t,n)){s.rects={reference:Pe(t,U(n),"fixed"===s.options.strategy),popper:z(n)},s.reset=!1,s.placement=s.options.placement,s.orderedModifiers.forEach((function(e){return s.modifiersData[e.name]=Object.assign({},e.data)}));for(var r=0;r<s.orderedModifiers.length;r++)if(!0!==s.reset){var i=s.orderedModifiers[r],o=i.fn,a=i.options,l=void 0===a?{}:a,d=i.name;"function"==typeof o&&(s=o({state:s,options:l,name:d,instance:u})||s)}else s.reset=!1,r=-1}}},update:(i=function(){return new Promise((function(e){u.forceUpdate(),e(s)}))},function(){return a||(a=new Promise((function(e){Promise.resolve().then((function(){a=void 0,e(i())}))}))),a}),destroy:function(){d(),c=!0}};if(!Te(e,t))return u;function d(){l.forEach((function(e){return e()})),l=[]}return u.setOptions(n).then((function(e){!c&&n.onFirstUpdate&&n.onFirstUpdate(e)})),u}}var Ne=De(),Oe=De({defaultModifiers:[ie,ke,ne,O,_e,be,Se,Q,Ee]}),Me=De({defaultModifiers:[ie,ke,ne,O]})},36021:(e,t,n)=>{"use strict";t.f0=void 0;var r=n(64223),i=n(30412);function o(e){return(0,r.assign)((function(t,n,r){return(0,i.produce)(t,(function(t){e(t,n,r)}))}))}t.f0=o},72779:(e,t)=>{var n;!function(){"use strict";var r={}.hasOwnProperty;function i(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var o=typeof n;if("string"===o||"number"===o)e.push(n);else if(Array.isArray(n)){if(n.length){var a=i.apply(null,n);a&&e.push(a)}}else if("object"===o){if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]")){e.push(n.toString());continue}for(var s in n)r.call(n,s)&&n[s]&&e.push(s)}}}return e.join(" ")}e.exports?(i.default=i,e.exports=i):void 0===(n=(function(){return i}).apply(t,[]))||(e.exports=n)}()},77111:(e,t,n)=>{var r=n(26733),i=n(59821),o=TypeError;e.exports=function(e){if(r(e))return e;throw o(i(e)+" is not a function")}},57988:(e,t,n)=>{var r=n(82359),i=n(59821),o=TypeError;e.exports=function(e){if(r(e))return e;throw o(i(e)+" is not a constructor")}},88505:(e,t,n)=>{var r=n(26733),i=String,o=TypeError;e.exports=function(e){if("object"==typeof e||r(e))return e;throw o("Can't set "+i(e)+" as a prototype")}},9736:(e,t,n)=>{var r=n(70095),i=n(22391),o=n(31787).f,a=r("unscopables"),s=Array.prototype;null==s[a]&&o(s,a,{configurable:!0,value:i(null)}),e.exports=function(e){s[a][e]=!0}},36637:(e,t,n)=>{"use strict";var r=n(30966).charAt;e.exports=function(e,t,n){return t+(n?r(e,t).length:1)}},57728:(e,t,n)=>{var r=n(91321),i=TypeError;e.exports=function(e,t){if(r(t,e))return e;throw i("Incorrect invocation")}},21176:(e,t,n)=>{var r=n(85052),i=String,o=TypeError;e.exports=function(e){if(r(e))return e;throw o(i(e)+" is not an object")}},19540:(e,t,n)=>{var r=n(10905),i=n(43231),o=n(39646),a=function(e){return function(t,n,a){var s,l=r(t),c=o(l),u=i(a,c);if(e&&n!=n){for(;c>u;)if((s=l[u++])!=s)return!0}else for(;c>u;u++)if((e||u in l)&&l[u]===n)return e||u||0;return!e&&-1}};e.exports={includes:a(!0),indexOf:a(!1)}},96038:(e,t,n)=>{"use strict";var r=n(24229);e.exports=function(e,t){var n=[][e];return!!n&&r((function(){n.call(null,t||function(){return 1},1)}))}},69794:(e,t,n)=>{var r=n(43231),i=n(39646),o=n(62324),a=Array,s=Math.max;e.exports=function(e,t,n){for(var l=i(e),c=r(t,l),u=r(void 0===n?l:n,l),d=a(s(u-c,0)),h=0;c<u;c++,h++)o(d,h,e[c]);return d.length=h,d}},1909:(e,t,n)=>{var r=n(65968);e.exports=r([].slice)},33867:(e,t,n)=>{var r=n(69794),i=Math.floor,o=function(e,t){var n=e.length,l=i(n/2);return n<8?a(e,t):s(e,o(r(e,0,l),t),o(r(e,l),t),t)},a=function(e,t){for(var n,r,i=e.length,o=1;o<i;){for(r=o,n=e[o];r&&t(e[r-1],n)>0;)e[r]=e[--r];r!==o++&&(e[r]=n)}return e},s=function(e,t,n,r){for(var i=t.length,o=n.length,a=0,s=0;a<i||s<o;)e[a+s]=a<i&&s<o?r(t[a],n[s])<=0?t[a++]:n[s++]:a<i?t[a++]:n[s++];return e};e.exports=o},74575:(e,t,n)=>{var r=n(70095)("iterator"),i=!1;try{var o=0,a={next:function(){return{done:!!o++}},return:function(){i=!0}};a[r]=function(){return this},Array.from(a,(function(){throw 2}))}catch(s){}e.exports=function(e,t){if(!t&&!i)return!1;var n=!1;try{var o={};o[r]=function(){return{next:function(){return{done:n=!0}}}},e(o)}catch(s){}return n}},27079:(e,t,n)=>{var r=n(56529),i=r({}.toString),o=r("".slice);e.exports=function(e){return o(i(e),8,-1)}},81589:(e,t,n)=>{var r=n(71601),i=n(26733),o=n(27079),a=n(70095)("toStringTag"),s=Object,l="Arguments"==o(function(){return arguments}());e.exports=r?o:function(e){var t,n,r;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(n){}}(t=s(e),a))?n:l?o(t):"Object"==(r=o(t))&&i(t.callee)?"Arguments":r}},77081:(e,t,n)=>{var r=n(98270),i=n(4826),o=n(97933),a=n(31787);e.exports=function(e,t,n){for(var s=i(t),l=a.f,c=o.f,u=0;u<s.length;u++){var d=s[u];r(e,d)||n&&r(n,d)||l(e,d,c(t,d))}}},48127:(e,t,n)=>{var r=n(70095)("match");e.exports=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[r]=!1,"/./"[e](t)}catch(i){}}return!1}},27528:(e,t,n)=>{var r=n(24229);e.exports=!r((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}))},33684:e=>{e.exports=function(e,t){return{value:e,done:t}}},75762:(e,t,n)=>{var r=n(7400),i=n(31787),o=n(65358);e.exports=r?function(e,t,n){return i.f(e,t,o(1,n))}:function(e,t,n){return e[t]=n,e}},65358:e=>{e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},62324:(e,t,n)=>{"use strict";var r=n(39310),i=n(31787),o=n(65358);e.exports=function(e,t,n){var a=r(t);a in e?i.f(e,a,o(0,n)):e[a]=n}},14768:(e,t,n)=>{var r=n(26733),i=n(31787),o=n(16039),a=n(18400);e.exports=function(e,t,n,s){s||(s={});var l=s.enumerable,c=void 0!==s.name?s.name:t;if(r(n)&&o(n,c,s),s.global)l?e[t]=n:a(t,n);else{try{s.unsafe?e[t]&&(l=!0):delete e[t]}catch(u){}l?e[t]=n:i.f(e,t,{value:n,enumerable:!1,configurable:!s.nonConfigurable,writable:!s.nonWritable})}return e}},18400:(e,t,n)=>{var r=n(9859),i=Object.defineProperty;e.exports=function(e,t){try{i(r,e,{value:t,configurable:!0,writable:!0})}catch(n){r[e]=t}return t}},79563:(e,t,n)=>{"use strict";var r=n(59821),i=TypeError;e.exports=function(e,t){if(!delete e[t])throw i("Cannot delete property "+r(t)+" of "+r(e))}},7400:(e,t,n)=>{var r=n(24229);e.exports=!r((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},63777:e=>{var t="object"==typeof document&&document.all,n=void 0===t&&void 0!==t;e.exports={all:t,IS_HTMLDDA:n}},22635:(e,t,n)=>{var r=n(9859),i=n(85052),o=r.document,a=i(o)&&i(o.createElement);e.exports=function(e){return a?o.createElement(e):{}}},95694:e=>{e.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},18865:(e,t,n)=>{var r=n(22635)("span").classList,i=r&&r.constructor&&r.constructor.prototype;e.exports=i===Object.prototype?void 0:i},22671:(e,t,n)=>{var r=n(80598).match(/firefox\/(\d+)/i);e.exports=!!r&&+r[1]},48639:(e,t,n)=>{var r=n(95189),i=n(28801);e.exports=!r&&!i&&"object"==typeof window&&"object"==typeof document},95189:e=>{e.exports="object"==typeof Deno&&Deno&&"object"==typeof Deno.version},48506:(e,t,n)=>{var r=n(80598);e.exports=/MSIE|Trident/.test(r)},8983:(e,t,n)=>{var r=n(80598),i=n(9859);e.exports=/ipad|iphone|ipod/i.test(r)&&void 0!==i.Pebble},32023:(e,t,n)=>{var r=n(80598);e.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(r)},28801:(e,t,n)=>{var r=n(27079),i=n(9859);e.exports="process"==r(i.process)},10263:(e,t,n)=>{var r=n(80598);e.exports=/web0s(?!.*chrome)/i.test(r)},80598:(e,t,n)=>{var r=n(31333);e.exports=r("navigator","userAgent")||""},6358:(e,t,n)=>{var r,i,o=n(9859),a=n(80598),s=o.process,l=o.Deno,c=s&&s.versions||l&&l.version,u=c&&c.v8;u&&(i=(r=u.split("."))[0]>0&&r[0]<4?1:+(r[0]+r[1])),!i&&a&&(!(r=a.match(/Edge\/(\d+)/))||r[1]>=74)&&(r=a.match(/Chrome\/(\d+)/))&&(i=+r[1]),e.exports=i},49811:(e,t,n)=>{var r=n(80598).match(/AppleWebKit\/(\d+)\./);e.exports=!!r&&+r[1]},13837:e=>{e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},23103:(e,t,n)=>{var r=n(9859),i=n(97933).f,o=n(75762),a=n(14768),s=n(18400),l=n(77081),c=n(46541);e.exports=function(e,t){var n,u,d,h,f,p=e.target,v=e.global,g=e.stat;if(n=v?r:g?r[p]||s(p,{}):(r[p]||{}).prototype)for(u in t){if(h=t[u],d=e.dontCallGetSet?(f=i(n,u))&&f.value:n[u],!c(v?u:p+(g?".":"#")+u,e.forced)&&void 0!==d){if(typeof h==typeof d)continue;l(h,d)}(e.sham||d&&d.sham)&&o(h,"sham",!0),a(n,u,h,e)}}},24229:e=>{e.exports=function(e){try{return!!e()}catch(t){return!0}}},94954:(e,t,n)=>{"use strict";n(77950);var r=n(65968),i=n(14768),o=n(63466),a=n(24229),s=n(70095),l=n(75762),c=s("species"),u=RegExp.prototype;e.exports=function(e,t,n,d){var h=s(e),f=!a((function(){var t={};return t[h]=function(){return 7},7!=""[e](t)})),p=f&&!a((function(){var t=!1,n=/a/;return"split"===e&&((n={}).constructor={},n.constructor[c]=function(){return n},n.flags="",n[h]=/./[h]),n.exec=function(){return t=!0,null},n[h](""),!t}));if(!f||!p||n){var v=r(/./[h]),g=t(h,""[e],(function(e,t,n,i,a){var s=r(e),l=t.exec;return l===o||l===u.exec?f&&!a?{done:!0,value:v(t,n,i)}:{done:!0,value:s(n,t,i)}:{done:!1}}));i(String.prototype,e,g[0]),i(u,h,g[1])}d&&l(u[h],"sham",!0)}},53171:(e,t,n)=>{var r=n(57188),i=Function.prototype,o=i.apply,a=i.call;e.exports="object"==typeof Reflect&&Reflect.apply||(r?a.bind(o):function(){return a.apply(o,arguments)})},97636:(e,t,n)=>{var r=n(65968),i=n(77111),o=n(57188),a=r(r.bind);e.exports=function(e,t){return i(e),void 0===t?e:o?a(e,t):function(){return e.apply(t,arguments)}}},57188:(e,t,n)=>{var r=n(24229);e.exports=!r((function(){var e=(function(){}).bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}))},20266:(e,t,n)=>{var r=n(57188),i=Function.prototype.call;e.exports=r?i.bind(i):function(){return i.apply(i,arguments)}},51805:(e,t,n)=>{var r=n(7400),i=n(98270),o=Function.prototype,a=r&&Object.getOwnPropertyDescriptor,s=i(o,"name"),l=s&&"something"===(function(){}).name,c=s&&(!r||r&&a(o,"name").configurable);e.exports={EXISTS:s,PROPER:l,CONFIGURABLE:c}},56529:(e,t,n)=>{var r=n(57188),i=Function.prototype,o=i.call,a=r&&i.bind.bind(o,o);e.exports=r?a:function(e){return function(){return o.apply(e,arguments)}}},65968:(e,t,n)=>{var r=n(27079),i=n(56529);e.exports=function(e){if("Function"===r(e))return i(e)}},31333:(e,t,n)=>{var r=n(9859),i=n(26733),o=function(e){return i(e)?e:void 0};e.exports=function(e,t){return arguments.length<2?o(r[e]):r[e]&&r[e][t]}},78830:(e,t,n)=>{var r=n(81589),i=n(55300),o=n(9650),a=n(45495),s=n(70095)("iterator");e.exports=function(e){if(!o(e))return i(e,s)||i(e,"@@iterator")||a[r(e)]}},28403:(e,t,n)=>{var r=n(20266),i=n(77111),o=n(21176),a=n(59821),s=n(78830),l=TypeError;e.exports=function(e,t){var n=arguments.length<2?s(e):t;if(i(n))return o(r(n,e));throw l(a(e)+" is not iterable")}},55300:(e,t,n)=>{var r=n(77111),i=n(9650);e.exports=function(e,t){var n=e[t];return i(n)?void 0:r(n)}},70017:(e,t,n)=>{var r=n(65968),i=n(92991),o=Math.floor,a=r("".charAt),s=r("".replace),l=r("".slice),c=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,u=/\$([$&'`]|\d{1,2})/g;e.exports=function(e,t,n,r,d,h){var f=n+e.length,p=r.length,v=u;return void 0!==d&&(d=i(d),v=c),s(h,v,(function(i,s){var c;switch(a(s,0)){case"$":return"$";case"&":return e;case"`":return l(t,0,n);case"'":return l(t,f);case"<":c=d[l(s,1,-1)];break;default:var u=+s;if(0===u)return i;if(u>p){var h=o(u/10);return 0===h?i:h<=p?void 0===r[h-1]?a(s,1):r[h-1]+a(s,1):i}c=r[u-1]}return void 0===c?"":c}))}},9859:e=>{var t=function(e){return e&&e.Math==Math&&e};e.exports=t("object"==typeof globalThis&&globalThis)||t("object"==typeof window&&window)||t("object"==typeof self&&self)||t("object"==typeof global&&global)||function(){return this}()||Function("return this")()},98270:(e,t,n)=>{var r=n(65968),i=n(92991),o=r({}.hasOwnProperty);e.exports=Object.hasOwn||function(e,t){return o(i(e),t)}},95977:e=>{e.exports={}},14665:(e,t,n)=>{var r=n(9859);e.exports=function(e,t){var n=r.console;n&&n.error&&(1==arguments.length?n.error(e):n.error(e,t))}},53777:(e,t,n)=>{var r=n(31333);e.exports=r("document","documentElement")},64394:(e,t,n)=>{var r=n(7400),i=n(24229),o=n(22635);e.exports=!r&&!i((function(){return 7!=Object.defineProperty(o("div"),"a",{get:function(){return 7}}).a}))},9337:(e,t,n)=>{var r=n(65968),i=n(24229),o=n(27079),a=Object,s=r("".split);e.exports=i((function(){return!a("z").propertyIsEnumerable(0)}))?function(e){return"String"==o(e)?s(e,""):a(e)}:a},8511:(e,t,n)=>{var r=n(65968),i=n(26733),o=n(85353),a=r(Function.toString);i(o.inspectSource)||(o.inspectSource=function(e){return a(e)}),e.exports=o.inspectSource},56407:(e,t,n)=>{var r,i,o,a=n(51180),s=n(9859),l=n(85052),c=n(75762),u=n(98270),d=n(85353),h=n(44399),f=n(95977),p="Object already initialized",v=s.TypeError,g=s.WeakMap;if(a||d.state){var m=d.state||(d.state=new g);m.get=m.get,m.has=m.has,m.set=m.set,r=function(e,t){if(m.has(e))throw v(p);return t.facade=e,m.set(e,t),t},i=function(e){return m.get(e)||{}},o=function(e){return m.has(e)}}else{var y=h("state");f[y]=!0,r=function(e,t){if(u(e,y))throw v(p);return t.facade=e,c(e,y,t),t},i=function(e){return u(e,y)?e[y]:{}},o=function(e){return u(e,y)}}e.exports={set:r,get:i,has:o,enforce:function(e){return o(e)?i(e):r(e,{})},getterFor:function(e){return function(t){var n;if(!l(t)||(n=i(t)).type!==e)throw v("Incompatible receiver, "+e+" required");return n}}}},91943:(e,t,n)=>{var r=n(70095),i=n(45495),o=r("iterator"),a=Array.prototype;e.exports=function(e){return void 0!==e&&(i.Array===e||a[o]===e)}},26733:(e,t,n)=>{var r=n(63777),i=r.all;e.exports=r.IS_HTMLDDA?function(e){return"function"==typeof e||e===i}:function(e){return"function"==typeof e}},82359:(e,t,n)=>{var r=n(65968),i=n(24229),o=n(26733),a=n(81589),s=n(31333),l=n(8511),c=function(){},u=[],d=s("Reflect","construct"),h=/^\s*(?:class|function)\b/,f=r(h.exec),p=!h.exec(c),v=function(e){if(!o(e))return!1;try{return d(c,u,e),!0}catch(t){return!1}},g=function(e){if(!o(e))return!1;switch(a(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return p||!!f(h,l(e))}catch(t){return!0}};g.sham=!0,e.exports=!d||i((function(){var e;return v(v.call)||!v(Object)||!v((function(){e=!0}))||e}))?g:v},46541:(e,t,n)=>{var r=n(24229),i=n(26733),o=/#|\.prototype\./,a=function(e,t){var n=l[s(e)];return n==u||n!=c&&(i(t)?r(t):!!t)},s=a.normalize=function(e){return String(e).replace(o,".").toLowerCase()},l=a.data={},c=a.NATIVE="N",u=a.POLYFILL="P";e.exports=a},9650:e=>{e.exports=function(e){return null==e}},85052:(e,t,n)=>{var r=n(26733),i=n(63777),o=i.all;e.exports=i.IS_HTMLDDA?function(e){return"object"==typeof e?null!==e:r(e)||e===o}:function(e){return"object"==typeof e?null!==e:r(e)}},24231:e=>{e.exports=!1},48311:(e,t,n)=>{var r=n(85052),i=n(27079),o=n(70095)("match");e.exports=function(e){var t;return r(e)&&(void 0!==(t=e[o])?!!t:"RegExp"==i(e))}},49395:(e,t,n)=>{var r=n(31333),i=n(26733),o=n(91321),a=n(66969),s=Object;e.exports=a?function(e){return"symbol"==typeof e}:function(e){var t=r("Symbol");return i(t)&&o(t.prototype,s(e))}},89003:(e,t,n)=>{var r=n(97636),i=n(20266),o=n(21176),a=n(59821),s=n(91943),l=n(39646),c=n(91321),u=n(28403),d=n(78830),h=n(57281),f=TypeError,p=function(e,t){this.stopped=e,this.result=t},v=p.prototype;e.exports=function(e,t,n){var g,m,y,b,x,w,E,_=n&&n.that,k=!(!n||!n.AS_ENTRIES),S=!(!n||!n.IS_RECORD),P=!(!n||!n.IS_ITERATOR),j=!(!n||!n.INTERRUPTED),C=r(t,_),T=function(e){return g&&h(g,"normal",e),new p(!0,e)},D=function(e){return k?(o(e),j?C(e[0],e[1],T):C(e[0],e[1])):j?C(e,T):C(e)};if(S)g=e.iterator;else if(P)g=e;else{if(!(m=d(e)))throw f(a(e)+" is not iterable");if(s(m)){for(y=0,b=l(e);b>y;y++)if((x=D(e[y]))&&c(v,x))return x;return new p(!1)}g=u(e,m)}for(w=S?e.next:g.next;!(E=i(w,g)).done;){try{x=D(E.value)}catch(N){h(g,"throw",N)}if("object"==typeof x&&x&&c(v,x))return x}return new p(!1)}},57281:(e,t,n)=>{var r=n(20266),i=n(21176),o=n(55300);e.exports=function(e,t,n){var a,s;i(e);try{if(!(a=o(e,"return"))){if("throw"===t)throw n;return n}a=r(a,e)}catch(l){s=!0,a=l}if("throw"===t)throw n;if(s)throw a;return i(a),n}},42247:(e,t,n)=>{"use strict";var r=n(60693).IteratorPrototype,i=n(22391),o=n(65358),a=n(54555),s=n(45495),l=function(){return this};e.exports=function(e,t,n,c){var u=t+" Iterator";return e.prototype=i(r,{next:o(+!c,n)}),a(e,u,!1,!0),s[u]=l,e}},12707:(e,t,n)=>{"use strict";var r=n(23103),i=n(20266),o=n(24231),a=n(51805),s=n(26733),l=n(42247),c=n(67567),u=n(56540),d=n(54555),h=n(75762),f=n(14768),p=n(70095),v=n(45495),g=n(60693),m=a.PROPER,y=a.CONFIGURABLE,b=g.IteratorPrototype,x=g.BUGGY_SAFARI_ITERATORS,w=p("iterator"),E="keys",_="values",k="entries",S=function(){return this};e.exports=function(e,t,n,a,p,g,P){l(n,t,a);var j,C,T,D=function(e){if(e===p&&R)return R;if(!x&&e in M)return M[e];switch(e){case E:case _:case k:return function(){return new n(this,e)}}return function(){return new n(this)}},N=t+" Iterator",O=!1,M=e.prototype,A=M[w]||M["@@iterator"]||p&&M[p],R=!x&&A||D(p),I="Array"==t&&M.entries||A;if(I&&(j=c(I.call(new e)))!==Object.prototype&&j.next&&(o||c(j)===b||(u?u(j,b):s(j[w])||f(j,w,S)),d(j,N,!0,!0),o&&(v[N]=S)),m&&p==_&&A&&A.name!==_&&(!o&&y?h(M,"name",_):(O=!0,R=function(){return i(A,this)})),p)if(C={values:D(_),keys:g?R:D(E),entries:D(k)},P)for(T in C)(x||O||!(T in M))&&f(M,T,C[T]);else r({target:t,proto:!0,forced:x||O},C);return o&&!P||M[w]===R||f(M,w,R,{name:p}),v[t]=R,C}},60693:(e,t,n)=>{"use strict";var r,i,o,a=n(24229),s=n(26733),l=n(85052),c=n(22391),u=n(67567),d=n(14768),h=n(70095),f=n(24231),p=h("iterator"),v=!1;[].keys&&("next"in(o=[].keys())?(i=u(u(o)))!==Object.prototype&&(r=i):v=!0),!l(r)||a((function(){var e={};return r[p].call(e)!==e}))?r={}:f&&(r=c(r)),s(r[p])||d(r,p,(function(){return this})),e.exports={IteratorPrototype:r,BUGGY_SAFARI_ITERATORS:v}},45495:e=>{e.exports={}},39646:(e,t,n)=>{var r=n(34237);e.exports=function(e){return r(e.length)}},16039:(e,t,n)=>{var r=n(24229),i=n(26733),o=n(98270),a=n(7400),s=n(51805).CONFIGURABLE,l=n(8511),c=n(56407),u=c.enforce,d=c.get,h=Object.defineProperty,f=a&&!r((function(){return 8!==h((function(){}),"length",{value:8}).length})),p=String(String).split("String"),v=e.exports=function(e,t,n){"Symbol("===String(t).slice(0,7)&&(t="["+String(t).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),n&&n.getter&&(t="get "+t),n&&n.setter&&(t="set "+t),(!o(e,"name")||s&&e.name!==t)&&(a?h(e,"name",{value:t,configurable:!0}):e.name=t),f&&n&&o(n,"arity")&&e.length!==n.arity&&h(e,"length",{value:n.arity});try{n&&o(n,"constructor")&&n.constructor?a&&h(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(i){}var r=u(e);return o(r,"source")||(r.source=p.join("string"==typeof t?t:"")),e};Function.prototype.toString=v((function(){return i(this)&&d(this).source||l(this)}),"toString")},50917:e=>{var t=Math.ceil,n=Math.floor;e.exports=Math.trunc||function(e){var r=+e;return(r>0?n:t)(r)}},24794:(e,t,n)=>{var r,i,o,a,s,l,c,u,d=n(9859),h=n(97636),f=n(97933).f,p=n(55795).set,v=n(32023),g=n(8983),m=n(10263),y=n(28801),b=d.MutationObserver||d.WebKitMutationObserver,x=d.document,w=d.process,E=d.Promise,_=f(d,"queueMicrotask"),k=_&&_.value;k||(r=function(){var e,t;for(y&&(e=w.domain)&&e.exit();i;){t=i.fn,i=i.next;try{t()}catch(n){throw i?a():o=void 0,n}}o=void 0,e&&e.enter()},v||y||m||!b||!x?!g&&E&&E.resolve?((c=E.resolve(void 0)).constructor=E,u=h(c.then,c),a=function(){u(r)}):y?a=function(){w.nextTick(r)}:(p=h(p,d),a=function(){p(r)}):(s=!0,l=x.createTextNode(""),new b(r).observe(l,{characterData:!0}),a=function(){l.data=s=!s})),e.exports=k||function(e){var t={fn:e,next:void 0};o&&(o.next=t),i||(i=t,a()),o=t}},16485:(e,t,n)=>{"use strict";var r=n(77111),i=TypeError,o=function(e){var t,n;this.promise=new e((function(e,r){if(void 0!==t||void 0!==n)throw i("Bad Promise constructor");t=e,n=r})),this.resolve=r(t),this.reject=r(n)};e.exports.f=function(e){return new o(e)}},47272:(e,t,n)=>{var r=n(48311),i=TypeError;e.exports=function(e){if(r(e))throw i("The method doesn't accept regular expressions");return e}},47:(e,t,n)=>{"use strict";var r=n(7400),i=n(65968),o=n(20266),a=n(24229),s=n(65632),l=n(10894),c=n(19195),u=n(92991),d=n(9337),h=Object.assign,f=Object.defineProperty,p=i([].concat);e.exports=!h||a((function(){if(r&&1!==h({b:1},h(f({},"a",{enumerable:!0,get:function(){f(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},n=Symbol(),i="abcdefghijklmnopqrst";return e[n]=7,i.split("").forEach((function(e){t[e]=e})),7!=h({},e)[n]||s(h({},t)).join("")!=i}))?function(e,t){for(var n=u(e),i=arguments.length,a=1,h=l.f,f=c.f;i>a;)for(var v,g=d(arguments[a++]),m=h?p(s(g),h(g)):s(g),y=m.length,b=0;y>b;)v=m[b++],r&&!o(f,g,v)||(n[v]=g[v]);return n}:h},22391:(e,t,n)=>{var r,i=n(21176),o=n(90219),a=n(13837),s=n(95977),l=n(53777),c=n(22635),u=n(44399),d=u("IE_PROTO"),h=function(){},f=function(e){return"<script>"+e+"</"+"script>"},p=function(e){e.write(f("")),e.close();var t=e.parentWindow.Object;return e=null,t},v=function(){try{r=new ActiveXObject("htmlfile")}catch(i){}var e,t;v="undefined"!=typeof document?document.domain&&r?p(r):((t=c("iframe")).style.display="none",l.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(f("document.F=Object")),e.close(),e.F):p(r);for(var n=a.length;n--;)delete v.prototype[a[n]];return v()};s[d]=!0,e.exports=Object.create||function(e,t){var n;return null!==e?(h.prototype=i(e),n=new h,h.prototype=null,n[d]=e):n=v(),void 0===t?n:o.f(n,t)}},90219:(e,t,n)=>{var r=n(7400),i=n(17137),o=n(31787),a=n(21176),s=n(10905),l=n(65632);t.f=r&&!i?Object.defineProperties:function(e,t){a(e);for(var n,r=s(t),i=l(t),c=i.length,u=0;c>u;)o.f(e,n=i[u++],r[n]);return e}},31787:(e,t,n)=>{var r=n(7400),i=n(64394),o=n(17137),a=n(21176),s=n(39310),l=TypeError,c=Object.defineProperty,u=Object.getOwnPropertyDescriptor,d="enumerable",h="configurable",f="writable";t.f=r?o?function(e,t,n){if(a(e),t=s(t),a(n),"function"==typeof e&&"prototype"===t&&"value"in n&&f in n&&!n.writable){var r=u(e,t);r&&r.writable&&(e[t]=n.value,n={configurable:h in n?n.configurable:r.configurable,enumerable:d in n?n.enumerable:r.enumerable,writable:!1})}return c(e,t,n)}:c:function(e,t,n){if(a(e),t=s(t),a(n),i)try{return c(e,t,n)}catch(r){}if("get"in n||"set"in n)throw l("Accessors not supported");return"value"in n&&(e[t]=n.value),e}},97933:(e,t,n)=>{var r=n(7400),i=n(20266),o=n(19195),a=n(65358),s=n(10905),l=n(39310),c=n(98270),u=n(64394),d=Object.getOwnPropertyDescriptor;t.f=r?d:function(e,t){if(e=s(e),t=l(t),u)try{return d(e,t)}catch(n){}if(c(e,t))return a(!i(o.f,e,t),e[t])}},78151:(e,t,n)=>{var r=n(90140),i=n(13837).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return r(e,i)}},10894:(e,t)=>{t.f=Object.getOwnPropertySymbols},67567:(e,t,n)=>{var r=n(98270),i=n(26733),o=n(92991),a=n(44399),s=n(27528),l=a("IE_PROTO"),c=Object,u=c.prototype;e.exports=s?c.getPrototypeOf:function(e){var t=o(e);if(r(t,l))return t[l];var n=t.constructor;return i(n)&&t instanceof n?n.prototype:t instanceof c?u:null}},91321:(e,t,n)=>{var r=n(65968);e.exports=r({}.isPrototypeOf)},90140:(e,t,n)=>{var r=n(65968),i=n(98270),o=n(10905),a=n(19540).indexOf,s=n(95977),l=r([].push);e.exports=function(e,t){var n,r=o(e),c=0,u=[];for(n in r)!i(s,n)&&i(r,n)&&l(u,n);for(;t.length>c;)i(r,n=t[c++])&&(~a(u,n)||l(u,n));return u}},65632:(e,t,n)=>{var r=n(90140),i=n(13837);e.exports=Object.keys||function(e){return r(e,i)}},19195:(e,t)=>{"use strict";var n={}.propertyIsEnumerable,r=Object.getOwnPropertyDescriptor,i=r&&!n.call({1:2},1);t.f=i?function(e){var t=r(this,e);return!!t&&t.enumerable}:n},56540:(e,t,n)=>{var r=n(65968),i=n(21176),o=n(88505);e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=r(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(n,[]),t=n instanceof Array}catch(a){}return function(n,r){return i(n),o(r),t?e(n,r):n.__proto__=r,n}}():void 0)},32914:(e,t,n)=>{var r=n(20266),i=n(26733),o=n(85052),a=TypeError;e.exports=function(e,t){var n,s;if("string"===t&&i(n=e.toString)&&!o(s=r(n,e)))return s;if(i(n=e.valueOf)&&!o(s=r(n,e)))return s;if("string"!==t&&i(n=e.toString)&&!o(s=r(n,e)))return s;throw a("Can't convert object to primitive value")}},4826:(e,t,n)=>{var r=n(31333),i=n(65968),o=n(78151),a=n(10894),s=n(21176),l=i([].concat);e.exports=r("Reflect","ownKeys")||function(e){var t=o.f(s(e)),n=a.f;return n?l(t,n(e)):t}},64624:e=>{e.exports=function(e){try{return{error:!1,value:e()}}catch(t){return{error:!0,value:t}}}},38321:(e,t,n)=>{var r=n(9859),i=n(74473),o=n(26733),a=n(46541),s=n(8511),l=n(70095),c=n(48639),u=n(95189),d=n(24231),h=n(6358),f=i&&i.prototype,p=l("species"),v=!1,g=o(r.PromiseRejectionEvent),m=a("Promise",(function(){var e=s(i),t=e!==String(i);if(!t&&66===h)return!0;if(d&&(!f.catch||!f.finally))return!0;if(!h||h<51||!/native code/.test(e)){var n=new i((function(e){e(1)})),r=function(e){e((function(){}),(function(){}))};if((n.constructor={})[p]=r,!(v=n.then((function(){}))instanceof r))return!0}return!t&&(c||u)&&!g}));e.exports={CONSTRUCTOR:m,REJECTION_EVENT:g,SUBCLASSING:v}},74473:(e,t,n)=>{var r=n(9859);e.exports=r.Promise},62391:(e,t,n)=>{var r=n(21176),i=n(85052),o=n(16485);e.exports=function(e,t){if(r(e),i(t)&&t.constructor===e)return t;var n=o.f(e);return(0,n.resolve)(t),n.promise}},96866:(e,t,n)=>{var r=n(74473),i=n(74575),o=n(38321).CONSTRUCTOR;e.exports=o||!i((function(e){r.all(e).then(void 0,(function(){}))}))},93358:e=>{var t=function(){this.head=null,this.tail=null};t.prototype={add:function(e){var t={item:e,next:null};this.head?this.tail.next=t:this.head=t,this.tail=t},get:function(){var e=this.head;if(e)return this.head=e.next,this.tail===e&&(this.tail=null),e.item}},e.exports=t},98115:(e,t,n)=>{var r=n(20266),i=n(21176),o=n(26733),a=n(27079),s=n(63466),l=TypeError;e.exports=function(e,t){var n=e.exec;if(o(n)){var c=r(n,e,t);return null!==c&&i(c),c}if("RegExp"===a(e))return r(s,e,t);throw l("RegExp#exec called on incompatible receiver")}},63466:(e,t,n)=>{"use strict";var r,i,o=n(20266),a=n(65968),s=n(83326),l=n(30895),c=n(25650),u=n(33036),d=n(22391),h=n(56407).get,f=n(42926),p=n(10461),v=u("native-string-replace",String.prototype.replace),g=RegExp.prototype.exec,m=g,y=a("".charAt),b=a("".indexOf),x=a("".replace),w=a("".slice),E=(i=/b*/g,o(g,r=/a/,"a"),o(g,i,"a"),0!==r.lastIndex||0!==i.lastIndex),_=c.BROKEN_CARET,k=void 0!==/()??/.exec("")[1];(E||k||_||f||p)&&(m=function(e){var t,n,r,i,a,c,u,f=this,p=h(f),S=s(e),P=p.raw;if(P)return P.lastIndex=f.lastIndex,t=o(m,P,S),f.lastIndex=P.lastIndex,t;var j=p.groups,C=_&&f.sticky,T=o(l,f),D=f.source,N=0,O=S;if(C&&(T=x(T,"y",""),-1===b(T,"g")&&(T+="g"),O=w(S,f.lastIndex),f.lastIndex>0&&(!f.multiline||f.multiline&&"\n"!==y(S,f.lastIndex-1))&&(D="(?: "+D+")",O=" "+O,N++),n=new RegExp("^(?:"+D+")",T)),k&&(n=new RegExp("^"+D+"$(?!\\s)",T)),E&&(r=f.lastIndex),i=o(g,C?n:f,O),C?i?(i.input=w(i.input,N),i[0]=w(i[0],N),i.index=f.lastIndex,f.lastIndex+=i[0].length):f.lastIndex=0:E&&i&&(f.lastIndex=f.global?i.index+i[0].length:r),k&&i&&i.length>1&&o(v,i[0],n,(function(){for(a=1;a<arguments.length-2;a++)void 0===arguments[a]&&(i[a]=void 0)})),i&&j)for(i.groups=c=d(null),a=0;a<j.length;a++)c[(u=j[a])[0]]=i[u[1]];return i}),e.exports=m},30895:(e,t,n)=>{"use strict";var r=n(21176);e.exports=function(){var e=r(this),t="";return e.hasIndices&&(t+="d"),e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.unicodeSets&&(t+="v"),e.sticky&&(t+="y"),t}},25650:(e,t,n)=>{var r=n(24229),i=n(9859).RegExp,o=r((function(){var e=i("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),a=o||r((function(){return!i("a","y").sticky})),s=o||r((function(){var e=i("^r","gy");return e.lastIndex=2,null!=e.exec("str")}));e.exports={BROKEN_CARET:s,MISSED_STICKY:a,UNSUPPORTED_Y:o}},42926:(e,t,n)=>{var r=n(24229),i=n(9859).RegExp;e.exports=r((function(){var e=i(".","s");return!(e.dotAll&&e.exec("\n")&&"s"===e.flags)}))},10461:(e,t,n)=>{var r=n(24229),i=n(9859).RegExp;e.exports=r((function(){var e=i("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")}))},58885:(e,t,n)=>{var r=n(9650),i=TypeError;e.exports=function(e){if(r(e))throw i("Can't call method on "+e);return e}},72101:e=>{e.exports=Object.is||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}},71832:(e,t,n)=>{"use strict";var r=n(31333),i=n(31787),o=n(70095),a=n(7400),s=o("species");e.exports=function(e){var t=r(e),n=i.f;a&&t&&!t[s]&&n(t,s,{configurable:!0,get:function(){return this}})}},54555:(e,t,n)=>{var r=n(31787).f,i=n(98270),o=n(70095)("toStringTag");e.exports=function(e,t,n){e&&!n&&(e=e.prototype),e&&!i(e,o)&&r(e,o,{configurable:!0,value:t})}},44399:(e,t,n)=>{var r=n(33036),i=n(81441),o=r("keys");e.exports=function(e){return o[e]||(o[e]=i(e))}},85353:(e,t,n)=>{var r=n(9859),i=n(18400),o="__core-js_shared__",a=r[o]||i(o,{});e.exports=a},33036:(e,t,n)=>{var r=n(24231),i=n(85353);(e.exports=function(e,t){return i[e]||(i[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.26.0",mode:r?"pure":"global",copyright:"\xa9 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.26.0/LICENSE",source:"https://github.com/zloirock/core-js"})},37942:(e,t,n)=>{var r=n(21176),i=n(57988),o=n(9650),a=n(70095)("species");e.exports=function(e,t){var n,s=r(e).constructor;return void 0===s||o(n=r(s)[a])?t:i(n)}},30966:(e,t,n)=>{var r=n(65968),i=n(43329),o=n(83326),a=n(58885),s=r("".charAt),l=r("".charCodeAt),c=r("".slice),u=function(e){return function(t,n){var r,u,d=o(a(t)),h=i(n),f=d.length;return h<0||h>=f?e?"":void 0:(r=l(d,h))<55296||r>56319||h+1===f||(u=l(d,h+1))<56320||u>57343?e?s(d,h):r:e?c(d,h,h+2):u-56320+(r-55296<<10)+65536}};e.exports={codeAt:u(!1),charAt:u(!0)}},44860:(e,t,n)=>{var r=n(6358),i=n(24229);e.exports=!!Object.getOwnPropertySymbols&&!i((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&r&&r<41}))},55795:(e,t,n)=>{var r,i,o,a,s=n(9859),l=n(53171),c=n(97636),u=n(26733),d=n(98270),h=n(24229),f=n(53777),p=n(1909),v=n(22635),g=n(77579),m=n(32023),y=n(28801),b=s.setImmediate,x=s.clearImmediate,w=s.process,E=s.Dispatch,_=s.Function,k=s.MessageChannel,S=s.String,P=0,j={},C="onreadystatechange";try{r=s.location}catch(M){}var T=function(e){if(d(j,e)){var t=j[e];delete j[e],t()}},D=function(e){return function(){T(e)}},N=function(e){T(e.data)},O=function(e){s.postMessage(S(e),r.protocol+"//"+r.host)};b&&x||(b=function(e){g(arguments.length,1);var t=u(e)?e:_(e),n=p(arguments,1);return j[++P]=function(){l(t,void 0,n)},i(P),P},x=function(e){delete j[e]},y?i=function(e){w.nextTick(D(e))}:E&&E.now?i=function(e){E.now(D(e))}:k&&!m?(a=(o=new k).port2,o.port1.onmessage=N,i=c(a.postMessage,a)):s.addEventListener&&u(s.postMessage)&&!s.importScripts&&r&&"file:"!==r.protocol&&!h(O)?(i=O,s.addEventListener("message",N,!1)):i=C in v("script")?function(e){f.appendChild(v("script")).onreadystatechange=function(){f.removeChild(this),T(e)}}:function(e){setTimeout(D(e),0)}),e.exports={set:b,clear:x}},43231:(e,t,n)=>{var r=n(43329),i=Math.max,o=Math.min;e.exports=function(e,t){var n=r(e);return n<0?i(n+t,0):o(n,t)}},10905:(e,t,n)=>{var r=n(9337),i=n(58885);e.exports=function(e){return r(i(e))}},43329:(e,t,n)=>{var r=n(50917);e.exports=function(e){var t=+e;return t!=t||0===t?0:r(t)}},34237:(e,t,n)=>{var r=n(43329),i=Math.min;e.exports=function(e){return e>0?i(r(e),9007199254740991):0}},92991:(e,t,n)=>{var r=n(58885),i=Object;e.exports=function(e){return i(r(e))}},92066:(e,t,n)=>{var r=n(20266),i=n(85052),o=n(49395),a=n(55300),s=n(32914),l=n(70095),c=TypeError,u=l("toPrimitive");e.exports=function(e,t){if(!i(e)||o(e))return e;var n,l=a(e,u);if(l){if(void 0===t&&(t="default"),n=r(l,e,t),!i(n)||o(n))return n;throw c("Can't convert object to primitive value")}return void 0===t&&(t="number"),s(e,t)}},39310:(e,t,n)=>{var r=n(92066),i=n(49395);e.exports=function(e){var t=r(e,"string");return i(t)?t:t+""}},71601:(e,t,n)=>{var r={};r[n(70095)("toStringTag")]="z",e.exports="[object z]"===String(r)},83326:(e,t,n)=>{var r=n(81589),i=String;e.exports=function(e){if("Symbol"===r(e))throw TypeError("Cannot convert a Symbol value to a string");return i(e)}},59821:e=>{var t=String;e.exports=function(e){try{return t(e)}catch(n){return"Object"}}},81441:(e,t,n)=>{var r=n(65968),i=0,o=Math.random(),a=r(1..toString);e.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+a(++i+o,36)}},66969:(e,t,n)=>{var r=n(44860);e.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},17137:(e,t,n)=>{var r=n(7400),i=n(24229);e.exports=r&&i((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},77579:e=>{var t=TypeError;e.exports=function(e,n){if(e<n)throw t("Not enough arguments");return e}},51180:(e,t,n)=>{var r=n(9859),i=n(26733),o=r.WeakMap;e.exports=i(o)&&/native code/.test(String(o))},70095:(e,t,n)=>{var r=n(9859),i=n(33036),o=n(98270),a=n(81441),s=n(44860),l=n(66969),c=i("wks"),u=r.Symbol,d=u&&u.for,h=l?u:u&&u.withoutSetter||a;e.exports=function(e){if(!o(c,e)||!s&&"string"!=typeof c[e]){var t="Symbol."+e;s&&o(u,e)?c[e]=u[e]:c[e]=l&&d?d(t):h(t)}return c[e]}},39529:(e,t,n)=>{"use strict";var r=n(23103),i=n(19540).includes,o=n(24229),a=n(9736);r({target:"Array",proto:!0,forced:o((function(){return!Array(1).includes()}))},{includes:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),a("includes")},15735:(e,t,n)=>{"use strict";var r=n(10905),i=n(9736),o=n(45495),a=n(56407),s=n(31787).f,l=n(12707),c=n(33684),u=n(24231),d=n(7400),h="Array Iterator",f=a.set,p=a.getterFor(h);e.exports=l(Array,"Array",(function(e,t){f(this,{type:h,target:r(e),index:0,kind:t})}),(function(){var e=p(this),t=e.target,n=e.kind,r=e.index++;return!t||r>=t.length?(e.target=void 0,c(void 0,!0)):c("keys"==n?r:"values"==n?t[r]:[r,t[r]],!1)}),"values");var v=o.Arguments=o.Array;if(i("keys"),i("values"),i("entries"),!u&&d&&"values"!==v.name)try{s(v,"name",{value:"values"})}catch(g){}},43430:(e,t,n)=>{"use strict";var r=n(23103),i=n(65968),o=n(77111),a=n(92991),s=n(39646),l=n(79563),c=n(83326),u=n(24229),d=n(33867),h=n(96038),f=n(22671),p=n(48506),v=n(6358),g=n(49811),m=[],y=i(m.sort),b=i(m.push),x=u((function(){m.sort(void 0)})),w=u((function(){m.sort(null)})),E=h("sort"),_=!u((function(){if(v)return v<70;if(!(f&&f>3)){if(p)return!0;if(g)return g<603;var e,t,n,r,i="";for(e=65;e<76;e++){switch(t=String.fromCharCode(e),e){case 66:case 69:case 70:case 72:n=3;break;case 68:case 71:n=4;break;default:n=2}for(r=0;r<47;r++)m.push({k:t+r,v:n})}for(m.sort((function(e,t){return t.v-e.v})),r=0;r<m.length;r++)t=m[r].k.charAt(0),i.charAt(i.length-1)!==t&&(i+=t);return"DGBEFHACIJK"!==i}}));r({target:"Array",proto:!0,forced:x||!w||!E||!_},{sort:function(e){void 0!==e&&o(e);var t=a(this);if(_)return void 0===e?y(t):y(t,e);var n,r,i=[],u=s(t);for(r=0;r<u;r++)r in t&&b(i,t[r]);for(d(i,function(e){return function(t,n){return void 0===n?-1:void 0===t?1:void 0!==e?+e(t,n)||0:c(t)>c(n)?1:-1}}(e)),n=s(i),r=0;r<n;)t[r]=i[r++];for(;r<u;)l(t,r++);return t}})},43105:(e,t,n)=>{var r=n(23103),i=n(47);r({target:"Object",stat:!0,arity:2,forced:Object.assign!==i},{assign:i})},56032:(e,t,n)=>{"use strict";var r=n(23103),i=n(20266),o=n(77111),a=n(16485),s=n(64624),l=n(89003);r({target:"Promise",stat:!0,forced:n(96866)},{all:function(e){var t=this,n=a.f(t),r=n.resolve,c=n.reject,u=s((function(){var n=o(t.resolve),a=[],s=0,u=1;l(e,(function(e){var o=s++,l=!1;u++,i(n,t,e).then((function(e){l||(l=!0,a[o]=e,--u||r(a))}),c)})),--u||r(a)}));return u.error&&c(u.value),n.promise}})},6135:(e,t,n)=>{"use strict";var r=n(23103),i=n(24231),o=n(38321).CONSTRUCTOR,a=n(74473),s=n(31333),l=n(26733),c=n(14768),u=a&&a.prototype;if(r({target:"Promise",proto:!0,forced:o,real:!0},{catch:function(e){return this.then(void 0,e)}}),!i&&l(a)){var d=s("Promise").prototype.catch;u.catch!==d&&c(u,"catch",d,{unsafe:!0})}},86087:(e,t,n)=>{"use strict";var r,i,o,a=n(23103),s=n(24231),l=n(28801),c=n(9859),u=n(20266),d=n(14768),h=n(56540),f=n(54555),p=n(71832),v=n(77111),g=n(26733),m=n(85052),y=n(57728),b=n(37942),x=n(55795).set,w=n(24794),E=n(14665),_=n(64624),k=n(93358),S=n(56407),P=n(74473),j=n(38321),C=n(16485),T="Promise",D=j.CONSTRUCTOR,N=j.REJECTION_EVENT,O=j.SUBCLASSING,M=S.getterFor(T),A=S.set,R=P&&P.prototype,I=P,L=R,B=c.TypeError,F=c.document,z=c.process,V=C.f,G=V,H=!!(F&&F.createEvent&&c.dispatchEvent),W="unhandledrejection",q=function(e){var t;return!(!m(e)||!g(t=e.then))&&t},Y=function(e,t){var n,r,i,o=t.value,a=1==t.state,s=a?e.ok:e.fail,l=e.resolve,c=e.reject,d=e.domain;try{s?(a||(2===t.rejection&&Z(t),t.rejection=1),!0===s?n=o:(d&&d.enter(),n=s(o),d&&(d.exit(),i=!0)),n===e.promise?c(B("Promise-chain cycle")):(r=q(n))?u(r,n,l,c):l(n)):c(o)}catch(h){d&&!i&&d.exit(),c(h)}},U=function(e,t){e.notified||(e.notified=!0,w((function(){for(var n,r=e.reactions;n=r.get();)Y(n,e);e.notified=!1,t&&!e.rejection&&$(e)})))},X=function(e,t,n){var r,i;H?((r=F.createEvent("Event")).promise=t,r.reason=n,r.initEvent(e,!1,!0),c.dispatchEvent(r)):r={promise:t,reason:n},!N&&(i=c["on"+e])?i(r):e===W&&E("Unhandled promise rejection",n)},$=function(e){u(x,c,(function(){var t,n=e.facade,r=e.value;if(K(e)&&(t=_((function(){l?z.emit("unhandledRejection",r,n):X(W,n,r)})),e.rejection=l||K(e)?2:1,t.error))throw t.value}))},K=function(e){return 1!==e.rejection&&!e.parent},Z=function(e){u(x,c,(function(){var t=e.facade;l?z.emit("rejectionHandled",t):X("rejectionhandled",t,e.value)}))},Q=function(e,t,n){return function(r){e(t,r,n)}},J=function(e,t,n){e.done||(e.done=!0,n&&(e=n),e.value=t,e.state=2,U(e,!0))},ee=function(e,t,n){if(!e.done){e.done=!0,n&&(e=n);try{if(e.facade===t)throw B("Promise can't be resolved itself");var r=q(t);r?w((function(){var n={done:!1};try{u(r,t,Q(ee,n,e),Q(J,n,e))}catch(i){J(n,i,e)}})):(e.value=t,e.state=1,U(e,!1))}catch(i){J({done:!1},i,e)}}};if(D&&(L=(I=function(e){y(this,L),v(e),u(r,this);var t=M(this);try{e(Q(ee,t),Q(J,t))}catch(n){J(t,n)}}).prototype,(r=function(e){A(this,{type:T,done:!1,notified:!1,parent:!1,reactions:new k,rejection:!1,state:0,value:void 0})}).prototype=d(L,"then",(function(e,t){var n=M(this),r=V(b(this,I));return n.parent=!0,r.ok=!g(e)||e,r.fail=g(t)&&t,r.domain=l?z.domain:void 0,0==n.state?n.reactions.add(r):w((function(){Y(r,n)})),r.promise})),i=function(){var e=new r,t=M(e);this.promise=e,this.resolve=Q(ee,t),this.reject=Q(J,t)},C.f=V=function(e){return e===I||undefined===e?new i(e):G(e)},!s&&g(P)&&R!==Object.prototype)){o=R.then,O||d(R,"then",(function(e,t){var n=this;return new I((function(e,t){u(o,n,e,t)})).then(e,t)}),{unsafe:!0});try{delete R.constructor}catch(te){}h&&h(R,L)}a({global:!0,constructor:!0,wrap:!0,forced:D},{Promise:I}),f(I,T,!1,!0),p(T)},73439:(e,t,n)=>{n(86087),n(56032),n(6135),n(26767),n(39320),n(52047)},26767:(e,t,n)=>{"use strict";var r=n(23103),i=n(20266),o=n(77111),a=n(16485),s=n(64624),l=n(89003);r({target:"Promise",stat:!0,forced:n(96866)},{race:function(e){var t=this,n=a.f(t),r=n.reject,c=s((function(){var a=o(t.resolve);l(e,(function(e){i(a,t,e).then(n.resolve,r)}))}));return c.error&&r(c.value),n.promise}})},39320:(e,t,n)=>{"use strict";var r=n(23103),i=n(20266),o=n(16485);r({target:"Promise",stat:!0,forced:n(38321).CONSTRUCTOR},{reject:function(e){var t=o.f(this);return i(t.reject,void 0,e),t.promise}})},52047:(e,t,n)=>{"use strict";var r=n(23103),i=n(31333),o=n(24231),a=n(74473),s=n(38321).CONSTRUCTOR,l=n(62391),c=i("Promise"),u=o&&!s;r({target:"Promise",stat:!0,forced:o||s},{resolve:function(e){return l(u&&this===c?a:this,e)}})},77950:(e,t,n)=>{"use strict";var r=n(23103),i=n(63466);r({target:"RegExp",proto:!0,forced:/./.exec!==i},{exec:i})},31235:(e,t,n)=>{"use strict";var r=n(23103),i=n(65968),o=n(47272),a=n(58885),s=n(83326),l=n(48127),c=i("".indexOf);r({target:"String",proto:!0,forced:!l("includes")},{includes:function(e){return!!~c(s(a(this)),s(o(e)),arguments.length>1?arguments[1]:void 0)}})},85940:(e,t,n)=>{"use strict";var r=n(53171),i=n(20266),o=n(65968),a=n(94954),s=n(24229),l=n(21176),c=n(26733),u=n(9650),d=n(43329),h=n(34237),f=n(83326),p=n(58885),v=n(36637),g=n(55300),m=n(70017),y=n(98115),b=n(70095)("replace"),x=Math.max,w=Math.min,E=o([].concat),_=o([].push),k=o("".indexOf),S=o("".slice),P="$0"==="a".replace(/./,"$0"),j=!!/./[b]&&""===/./[b]("a","$0");a("replace",(function(e,t,n){var o=j?"$":"$0";return[function(e,n){var r=p(this),o=u(e)?void 0:g(e,b);return o?i(o,e,r,n):i(t,f(r),e,n)},function(e,i){var a=l(this),s=f(e);if("string"==typeof i&&-1===k(i,o)&&-1===k(i,"$<")){var u=n(t,a,s,i);if(u.done)return u.value}var p=c(i);p||(i=f(i));var g=a.global;if(g){var b=a.unicode;a.lastIndex=0}for(var P=[];;){var j=y(a,s);if(null===j)break;if(_(P,j),!g)break;""===f(j[0])&&(a.lastIndex=v(s,h(a.lastIndex),b))}for(var C,T="",D=0,N=0;N<P.length;N++){for(var O=f((j=P[N])[0]),M=x(w(d(j.index),s.length),0),A=[],R=1;R<j.length;R++)_(A,void 0===(C=j[R])?C:String(C));var I=j.groups;if(p){var L=E([O],A,M,s);void 0!==I&&_(L,I);var B=f(r(i,void 0,L))}else B=m(O,s,M,A,I,i);M>=D&&(T+=S(s,D,M)+B,D=M+O.length)}return T+S(s,D)}]}),!!s((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}))||!P||j)},94908:(e,t,n)=>{"use strict";var r=n(20266),i=n(94954),o=n(21176),a=n(9650),s=n(58885),l=n(72101),c=n(83326),u=n(55300),d=n(98115);i("search",(function(e,t,n){return[function(t){var n=s(this),i=a(t)?void 0:u(t,e);return i?r(i,t,n):new RegExp(t)[e](c(n))},function(e){var r=o(this),i=c(e),a=n(t,r,i);if(a.done)return a.value;var s=r.lastIndex;l(s,0)||(r.lastIndex=0);var u=d(r,i);return l(r.lastIndex,s)||(r.lastIndex=s),null===u?-1:u.index}]}))},6886:(e,t,n)=>{var r=n(9859),i=n(95694),o=n(18865),a=n(15735),s=n(75762),l=n(70095),c=l("iterator"),u=l("toStringTag"),d=a.values,h=function(e,t){if(e){if(e[c]!==d)try{s(e,c,d)}catch(r){e[c]=d}if(e[u]||s(e,u,t),i[t])for(var n in a)if(e[n]!==a[n])try{s(e,n,a[n])}catch(r){e[n]=a[n]}}};for(var f in i)h(r[f]&&r[f].prototype,f);h(o,"DOMTokenList")},81368:function(e,t,n){var r;r=function(e){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,(function(t){return e[t]}).bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){var r=n(1),i=function(e){e&&e("layout","dagre",r)};"undefined"!=typeof cytoscape&&i(cytoscape),e.exports=i},function(e,t,n){function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}var i=n(2),o=n(3),a=n(4);function s(e){this.options=o({},i,e)}s.prototype.run=function(){var e=this.options,t=e.cy,n=e.eles,i=function(e,t){return"function"==typeof t?t.apply(e,[e]):t},o=e.boundingBox||{x1:0,y1:0,w:t.width(),h:t.height()};void 0===o.x2&&(o.x2=o.x1+o.w),void 0===o.w&&(o.w=o.x2-o.x1),void 0===o.y2&&(o.y2=o.y1+o.h),void 0===o.h&&(o.h=o.y2-o.y1);var s=new a.graphlib.Graph({multigraph:!0,compound:!0}),l={},c=function(e,t){null!=t&&(l[e]=t)};c("nodesep",e.nodeSep),c("edgesep",e.edgeSep),c("ranksep",e.rankSep),c("rankdir",e.rankDir),c("align",e.align),c("ranker",e.ranker),c("acyclicer",e.acyclicer),s.setGraph(l),s.setDefaultEdgeLabel((function(){return{}})),s.setDefaultNodeLabel((function(){return{}}));for(var u=n.nodes(),d=0;d<u.length;d++){var h=u[d],f=h.layoutDimensions(e);s.setNode(h.id(),{width:f.w,height:f.h,name:h.id()})}for(var p=0;p<u.length;p++){var v=u[p];v.isChild()&&s.setParent(v.id(),v.parent().id())}for(var g=n.edges().stdFilter((function(e){return!e.source().isParent()&&!e.target().isParent()})),m=0;m<g.length;m++){var y=g[m];s.setEdge(y.source().id(),y.target().id(),{minlen:i(y,e.minLen),weight:i(y,e.edgeWeight),name:y.id()},y.id())}a.layout(s);for(var b,x=s.nodes(),w=0;w<x.length;w++){var E=x[w],_=s.node(E);t.getElementById(E).scratch().dagre=_}return e.boundingBox?(b={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0},u.forEach((function(e){var t=e.scratch().dagre;b.x1=Math.min(b.x1,t.x),b.x2=Math.max(b.x2,t.x),b.y1=Math.min(b.y1,t.y),b.y2=Math.max(b.y2,t.y)})),b.w=b.x2-b.x1,b.h=b.y2-b.y1):b=o,u.layoutPositions(this,e,(function(t){var n=(t="object"===r(t)?t:this).scratch().dagre;return function(t){if(e.boundingBox){var n=0===b.w?0:(t.x-b.x1)/b.w,r=0===b.h?0:(t.y-b.y1)/b.h;return{x:o.x1+n*o.w,y:o.y1+r*o.h}}return t}({x:n.x,y:n.y})})),this},e.exports=s},function(e,t){var n={nodeSep:void 0,edgeSep:void 0,rankSep:void 0,rankDir:void 0,align:void 0,ranker:void 0,minLen:function(e){return 1},edgeWeight:function(e){return 1},fit:!0,padding:30,spacingFactor:void 0,nodeDimensionsIncludeLabels:!1,animate:!1,animateFilter:function(e,t){return!0},animationDuration:500,animationEasing:void 0,boundingBox:void 0,transform:function(e,t){return t},ready:function(){},stop:function(){}};e.exports=n},function(e,t){e.exports=null!=Object.assign?Object.assign.bind(Object):function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return n.forEach((function(t){Object.keys(t).forEach((function(n){return e[n]=t[n]}))})),e}},function(t,n){t.exports=e}])},e.exports=r(n(46506))},10404:function(e,t,n){var r;r=function(e){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.i=function(e){return e},n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=7)}([function(e,t,n){"use strict";e.exports=null!=Object.assign?Object.assign.bind(Object):function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return n.forEach((function(t){null!=t&&Object.keys(t).forEach((function(n){return e[n]=t[n]}))})),e}},function(e,t,n){"use strict";var r=n(5).getBoundingBox;e.exports={getRef:function(e,t){return{getBoundingClientRect:function(){return r(e,t)}}}}},function(e,t,n){"use strict";var r=n(0),i=n(1).getRef,o=n(6).getContent,a={},s=n(8).createPopper;e.exports={getPopper:function(e,t){var n=i(e,t),l=o(e,t.content),c=r({},a,t.popper);return s(n,l,c)}}},function(e,t,n){"use strict";var r=n(0),i=n(2).getPopper,o=n(1).getRef;function a(e,t){var n=function(e){return e.isNode()?{w:e.renderedWidth(),h:e.renderedHeight()}:{w:3,h:3}},i=e.cy(),o={renderedDimensions:n,renderedPosition:function(e){return e.isNode()?function(e,t){var n=e.renderedPosition(),r=t(e),i=r.w/2,o=r.h/2;return{x:n.x-i,y:n.y-o}}(e,n):function(e){var t=e.midpoint(),n=e.cy().pan(),r=e.cy().zoom();return{x:t.x*r+n.x,y:t.y*r+n.y}}(e)},popper:{},cy:i};return r({},o,t)}function s(e){e.length>1&&(console.warn("Popper.js Extension should only be used on one element."),console.warn("Ignoring all subsequent elements"))}e.exports={popper:function(e){return s(this),i(this[0],a(this[0],e))},popperRef:function(e){return s(this),o(this[0],a(this[0],e))}}},function(e,t,n){"use strict";var r=n(0),i=n(2).getPopper,o=n(1).getRef;function a(e,t){return r({},{boundingBox:{top:0,left:0,right:0,bottom:0,w:3,h:3},renderedDimensions:function(){return{w:3,h:3}},renderedPosition:function(){return{x:0,y:0}},popper:{},cy:e},t)}e.exports={popper:function(e){return i(this,a(this,e))},popperRef:function(e){return o(this,a(this,e))}}},function(e,t,n){"use strict";e.exports={getBoundingBox:function(e,t){var n=t.renderedPosition,r=t.cy,i=t.renderedDimensions,o=r.container().getBoundingClientRect(),a=i(e),s=n(e);return{top:s.y+o.top,left:s.x+o.left,right:s.x+a.w+o.left,bottom:s.y+a.h+o.top,width:a.w,height:a.h}}}},function(e,t,n){"use strict";e.exports={getContent:function(e,t){var n=null;if("function"!=typeof t){if(t instanceof HTMLElement)return t;throw new Error("Can not create popper from 'target' with unknown type")}if(null===(n=t(e)))throw new Error("No 'target' specified to create popper");return n}}},function(e,t,n){"use strict";var r=n(4),i=n(3),o=function(e){e&&(e("core","popper",r.popper),e("collection","popper",i.popper),e("core","popperRef",r.popperRef),e("collection","popperRef",i.popperRef))};"undefined"!=typeof cytoscape&&o(cytoscape),e.exports=o},function(t,n){t.exports=e}])},e.exports=r(n(52749))},93218:(e,t,n)=>{"use strict";var r=n(54073),i=n(71254),o=n(72579),a=n(16765),s=n(25497);function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=l(r),u=l(i),d=l(o),h=l(a),f=l(s);function p(e){return p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},p(e)}function v(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function g(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function m(e,t,n){return t&&g(e.prototype,t),n&&g(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function y(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function b(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,i,o=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);a=!0);}catch(l){s=!0,i=l}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return x(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return x(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function x(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var w="undefined"==typeof window?null:window,E=w?w.navigator:null;w&&w.document;var _=p(""),k=p({}),S=p((function(){})),P="undefined"==typeof HTMLElement?"undefined":p(HTMLElement),j=function(e){return e&&e.instanceString&&T(e.instanceString)?e.instanceString():null},C=function(e){return null!=e&&p(e)==_},T=function(e){return null!=e&&p(e)===S},D=function(e){return!A(e)&&(Array.isArray?Array.isArray(e):null!=e&&e instanceof Array)},N=function(e){return null!=e&&p(e)===k&&!D(e)&&e.constructor===Object},O=function(e){return null!=e&&p(e)===p(1)&&!isNaN(e)},M=function(e){return"undefined"===P?void 0:null!=e&&e instanceof HTMLElement},A=function(e){return R(e)||I(e)},R=function(e){return"collection"===j(e)&&e._private.single},I=function(e){return"collection"===j(e)&&!e._private.single},L=function(e){return"core"===j(e)},B=function(e){return"stylesheet"===j(e)},F=function(e){return null==e||!(""!==e&&!e.match(/^\s+$/))},z=function(e){return function(e){return null!=e&&p(e)===k}(e)&&T(e.then)},V=function(e,t){t||(t=function(){if(1===arguments.length)return arguments[0];if(0===arguments.length)return"undefined";for(var e=[],t=0;t<arguments.length;t++)e.push(arguments[t]);return e.join("$")});var n=function n(){var r,i=this,o=arguments,a=t.apply(i,o),s=n.cache;return(r=s[a])||(r=s[a]=e.apply(i,o)),r};return n.cache={},n},G=V((function(e){return e.replace(/([A-Z])/g,(function(e){return"-"+e.toLowerCase()}))})),H=V((function(e){return e.replace(/(-\w)/g,(function(e){return e[1].toUpperCase()}))})),W=V((function(e,t){return e+t[0].toUpperCase()+t.substring(1)}),(function(e,t){return e+"$"+t})),q=function(e){return F(e)?e:e.charAt(0).toUpperCase()+e.substring(1)},Y="(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))",U=function(e,t){return e<t?-1:e>t?1:0},X=null!=Object.assign?Object.assign.bind(Object):function(e){for(var t=arguments,n=1;n<t.length;n++){var r=t[n];if(null!=r)for(var i=Object.keys(r),o=0;o<i.length;o++){var a=i[o];e[a]=r[a]}}return e},$=function(e){return(D(e)?e:null)||function(e){return K[e.toLowerCase()]}(e)||function(e){if((4===e.length||7===e.length)&&"#"===e[0]){var t,n,r,i=16;return 4===e.length?(t=parseInt(e[1]+e[1],i),n=parseInt(e[2]+e[2],i),r=parseInt(e[3]+e[3],i)):(t=parseInt(e[1]+e[2],i),n=parseInt(e[3]+e[4],i),r=parseInt(e[5]+e[6],i)),[t,n,r]}}(e)||function(e){var t,n=new RegExp("^rgb[a]?\\(((?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))[%]?)\\s*,\\s*((?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))[%]?)\\s*,\\s*((?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))[%]?)(?:\\s*,\\s*((?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))))?\\)$").exec(e);if(n){t=[];for(var r=[],i=1;i<=3;i++){var o=n[i];if("%"===o[o.length-1]&&(r[i]=!0),o=parseFloat(o),r[i]&&(o=o/100*255),o<0||o>255)return;t.push(Math.floor(o))}var a=r[1]||r[2]||r[3],s=r[1]&&r[2]&&r[3];if(a&&!s)return;var l=n[4];if(void 0!==l){if((l=parseFloat(l))<0||l>1)return;t.push(l)}}return t}(e)||function(e){var t,n,r,i,o,a,s,l;function c(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}var u=new RegExp("^hsl[a]?\\(((?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?)))\\s*,\\s*((?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))[%])\\s*,\\s*((?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))[%])(?:\\s*,\\s*((?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))))?\\)$").exec(e);if(u){if((n=parseInt(u[1]))<0?n=(360- -1*n%360)%360:n>360&&(n%=360),n/=360,(r=parseFloat(u[2]))<0||r>100)return;if(r/=100,(i=parseFloat(u[3]))<0||i>100)return;if(i/=100,void 0!==(o=u[4])&&((o=parseFloat(o))<0||o>1))return;if(0===r)a=s=l=Math.round(255*i);else{var d=i<.5?i*(1+r):i+r-i*r,h=2*i-d;a=Math.round(255*c(h,d,n+1/3)),s=Math.round(255*c(h,d,n)),l=Math.round(255*c(h,d,n-1/3))}t=[a,s,l,o]}return t}(e)},K={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]},Z=function(e){for(var t=e.map,n=e.keys,r=n.length,i=0;i<r;i++){var o=n[i];if(N(o))throw Error("Tried to set map with object key");i<n.length-1?(null==t[o]&&(t[o]={}),t=t[o]):t[o]=e.value}},Q=function(e){for(var t=e.map,n=e.keys,r=n.length,i=0;i<r;i++){var o=n[i];if(N(o))throw Error("Tried to get map with object key");if(null==(t=t[o]))return t}return t},J=w?w.performance:null,ee=J&&J.now?function(){return J.now()}:function(){return Date.now()},te=function(){if(w){if(w.requestAnimationFrame)return function(e){w.requestAnimationFrame(e)};if(w.mozRequestAnimationFrame)return function(e){w.mozRequestAnimationFrame(e)};if(w.webkitRequestAnimationFrame)return function(e){w.webkitRequestAnimationFrame(e)};if(w.msRequestAnimationFrame)return function(e){w.msRequestAnimationFrame(e)}}return function(e){e&&setTimeout((function(){e(ee())}),1e3/60)}}(),ne=function(e){return te(e)},re=ee,ie=9261,oe=65599,ae=5381,se=function(e){for(var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ie,r=n;!(t=e.next()).done;)r=r*oe+t.value|0;return r},le=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ie;return t*oe+e|0},ce=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ae;return(t<<5)+t+e|0},ue=function(e){return 2097152*e[0]+e[1]},de=function(e,t){return[le(e[0],t[0]),ce(e[1],t[1])]},he=function(e,t){var n={value:0,done:!1},r=0,i=e.length;return se({next:function(){return r<i?n.value=e.charCodeAt(r++):n.done=!0,n}},t)},fe=function(){return pe(arguments)},pe=function(e){for(var t,n=0;n<e.length;n++){var r=e[n];t=0===n?he(r):he(r,t)}return t},ve=!0,ge=null!=console.warn,me=null!=console.trace,ye=Number.MAX_SAFE_INTEGER||9007199254740991,be=function(){return!0},xe=function(){return!1},we=function(){return 0},Ee=function(){},_e=function(e){throw new Error(e)},ke=function(e){if(void 0===e)return ve;ve=!!e},Se=function(e){ke()&&(ge?console.warn(e):(console.log(e),me&&console.trace()))},Pe=function(e){return null==e?e:D(e)?e.slice():N(e)?function(e){return X({},e)}(e):e},je=function(e,t){for(t=e="";e++<36;t+=51*e&52?(15^e?8^Math.random()*(20^e?16:4):4).toString(16):"-");return t},Ce={},Te=function(){return Ce},De=function(e){var t=Object.keys(e);return function(n){for(var r={},i=0;i<t.length;i++){var o=t[i],a=null==n?void 0:n[o];r[o]=void 0===a?e[o]:a}return r}},Ne=function(e,t,n){for(var r=e.length-1;r>=0&&(e[r]!==t||(e.splice(r,1),!n));r--);},Oe=function(e){e.splice(0,e.length)},Me=function(e,t,n){return n&&(t=W(n,t)),e[t]},Ae=function(e,t,n,r){n&&(t=W(n,t)),e[t]=r},Re="undefined"!=typeof Map?Map:function(){function e(){v(this,e),this._obj={}}return m(e,[{key:"set",value:function(e,t){return this._obj[e]=t,this}},{key:"delete",value:function(e){return this._obj[e]=void 0,this}},{key:"clear",value:function(){this._obj={}}},{key:"has",value:function(e){return void 0!==this._obj[e]}},{key:"get",value:function(e){return this._obj[e]}}]),e}(),Ie=function(){function e(t){if(v(this,e),this._obj=Object.create(null),this.size=0,null!=t){var n;n=null!=t.instanceString&&t.instanceString()===this.instanceString()?t.toArray():t;for(var r=0;r<n.length;r++)this.add(n[r])}}return m(e,[{key:"instanceString",value:function(){return"set"}},{key:"add",value:function(e){var t=this._obj;1!==t[e]&&(t[e]=1,this.size++)}},{key:"delete",value:function(e){var t=this._obj;1===t[e]&&(t[e]=0,this.size--)}},{key:"clear",value:function(){this._obj=Object.create(null)}},{key:"has",value:function(e){return 1===this._obj[e]}},{key:"toArray",value:function(){var e=this;return Object.keys(this._obj).filter((function(t){return e.has(t)}))}},{key:"forEach",value:function(e,t){return this.toArray().forEach(e,t)}}]),e}(),Le="undefined"!==("undefined"==typeof Set?"undefined":p(Set))?Set:Ie,Be=function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(void 0!==e&&void 0!==t&&L(e)){var r=t.group;if(null==r&&(r=t.data&&null!=t.data.source&&null!=t.data.target?"edges":"nodes"),"nodes"===r||"edges"===r){this.length=1,this[0]=this;var i=this._private={cy:e,single:!0,data:t.data||{},position:t.position||{x:0,y:0},autoWidth:void 0,autoHeight:void 0,autoPadding:void 0,compoundBoundsClean:!1,listeners:[],group:r,style:{},rstyle:{},styleCxts:[],styleKeys:{},removed:!0,selected:!!t.selected,selectable:void 0===t.selectable||!!t.selectable,locked:!!t.locked,grabbed:!1,grabbable:void 0===t.grabbable||!!t.grabbable,pannable:void 0===t.pannable?"edges"===r:!!t.pannable,active:!1,classes:new Le,animation:{current:[],queue:[]},rscratch:{},scratch:t.scratch||{},edges:[],children:[],parent:t.parent&&t.parent.isNode()?t.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(null==i.position.x&&(i.position.x=0),null==i.position.y&&(i.position.y=0),t.renderedPosition){var o=t.renderedPosition,a=e.pan(),s=e.zoom();i.position={x:(o.x-a.x)/s,y:(o.y-a.y)/s}}var l=[];D(t.classes)?l=t.classes:C(t.classes)&&(l=t.classes.split(/\s+/));for(var c=0,u=l.length;c<u;c++){var d=l[c];d&&""!==d&&i.classes.add(d)}this.createEmitter();var h=t.style||t.css;h&&(Se("Setting a `style` bypass at element creation should be done only when absolutely necessary. Try to use the stylesheet instead."),this.style(h)),(void 0===n||n)&&this.restore()}else _e("An element must be of type `nodes` or `edges`; you specified `"+r+"`")}else _e("An element must have a core reference and parameters set")},Fe=function(e){return e={bfs:e.bfs||!e.dfs,dfs:e.dfs||!e.bfs},function(t,n,r){var i;N(t)&&!A(t)&&(t=(i=t).roots||i.root,n=i.visit,r=i.directed),r=2!==arguments.length||T(n)?r:n,n=T(n)?n:function(){};for(var o,a=this._private.cy,s=t=C(t)?this.filter(t):t,l=[],c=[],u={},d={},h={},f=0,p=this.byGroup(),v=p.nodes,g=p.edges,m=0;m<s.length;m++){var y=s[m],b=y.id();y.isNode()&&(l.unshift(y),e.bfs&&(h[b]=!0,c.push(y)),d[b]=0)}for(var x=function(){var t=e.bfs?l.shift():l.pop(),i=t.id();if(e.dfs){if(h[i])return"continue";h[i]=!0,c.push(t)}var a,s=d[i],p=u[i],m=null!=p?p.source():null,y=null!=p?p.target():null,b=null==p?void 0:t.same(m)?y[0]:m[0];if(!0===(a=n(t,p,b,f++,s)))return o=t,"break";if(!1===a)return"break";for(var x=t.connectedEdges().filter((function(e){return(!r||e.source().same(t))&&g.has(e)})),w=0;w<x.length;w++){var E=x[w],_=E.connectedNodes().filter((function(e){return!e.same(t)&&v.has(e)})),k=_.id();0===_.length||h[k]||(_=_[0],l.push(_),e.bfs&&(h[k]=!0,c.push(_)),u[k]=E,d[k]=d[i]+1)}};0!==l.length;){var w=x();if("continue"!==w&&"break"===w)break}for(var E=a.collection(),_=0;_<c.length;_++){var k=c[_],S=u[k.id()];null!=S&&E.push(S),E.push(k)}return{path:a.collection(E),found:a.collection(o)}}},ze={breadthFirstSearch:Fe({bfs:!0}),depthFirstSearch:Fe({dfs:!0})};ze.bfs=ze.breadthFirstSearch,ze.dfs=ze.depthFirstSearch;var Ve=De({root:null,weight:function(e){return 1},directed:!1}),Ge={dijkstra:function(e){if(!N(e)){var t=arguments;e={root:t[0],weight:t[1],directed:t[2]}}var n=Ve(e),r=n.root,i=n.weight,o=n.directed,a=this,s=i,l=C(r)?this.filter(r)[0]:r[0],c={},d={},h={},f=this.byGroup(),p=f.nodes,v=f.edges;v.unmergeBy((function(e){return e.isLoop()}));for(var g=function(e){return c[e.id()]},m=function(e,t){c[e.id()]=t,y.updateItem(e)},y=new u.default((function(e,t){return g(e)-g(t)})),b=0;b<p.length;b++){var x=p[b];c[x.id()]=x.same(l)?0:1/0,y.push(x)}for(var w=function(e,t){for(var n,r=(o?e.edgesTo(t):e.edgesWith(t)).intersect(v),i=1/0,a=0;a<r.length;a++){var l=r[a],c=s(l);(c<i||!n)&&(i=c,n=l)}return{edge:n,dist:i}};y.size()>0;){var E=y.pop(),_=g(E),k=E.id();if(h[k]=_,_!==1/0)for(var S=E.neighborhood().intersect(p),P=0;P<S.length;P++){var j=S[P],T=j.id(),D=w(E,j),O=_+D.dist;O<g(j)&&(m(j,O),d[T]={node:E,edge:D.edge})}}return{distanceTo:function(e){var t=C(e)?p.filter(e)[0]:e[0];return h[t.id()]},pathTo:function(e){var t=C(e)?p.filter(e)[0]:e[0],n=[],r=t,i=r.id();if(t.length>0)for(n.unshift(t);d[i];){var o=d[i];n.unshift(o.edge),n.unshift(o.node),i=(r=o.node).id()}return a.spawn(n)}}}},He={kruskal:function(e){e=e||function(e){return 1};for(var t=this.byGroup(),n=t.nodes,r=t.edges,i=n.length,o=new Array(i),a=n,s=function(e){for(var t=0;t<o.length;t++){if(o[t].has(e))return t}},l=0;l<i;l++)o[l]=this.spawn(n[l]);for(var c=r.sort((function(t,n){return e(t)-e(n)})),u=0;u<c.length;u++){var d=c[u],h=d.source()[0],f=d.target()[0],p=s(h),v=s(f),g=o[p],m=o[v];p!==v&&(a.merge(d),g.merge(m),o.splice(v,1))}return a}},We=De({root:null,goal:null,weight:function(e){return 1},heuristic:function(e){return 0},directed:!1}),qe={aStar:function(e){var t=this.cy(),n=We(e),r=n.root,i=n.goal,o=n.heuristic,a=n.directed,s=n.weight;r=t.collection(r)[0],i=t.collection(i)[0];var l,c,d=r.id(),h=i.id(),f={},p={},v={},g=new u.default((function(e,t){return p[e.id()]-p[t.id()]})),m=new Le,y={},b={},x=function(e,t){g.push(e),m.add(t)};x(r,d),f[d]=0,p[d]=o(r);for(var w,E=0;g.size()>0;){if(l=g.pop(),c=l.id(),m.delete(c),E++,c===h){for(var _=[],k=i,S=h,P=b[S];_.unshift(k),null!=P&&_.unshift(P),null!=(k=y[S]);)P=b[S=k.id()];return{found:!0,distance:f[c],path:this.spawn(_),steps:E}}v[c]=!0;for(var j=l._private.edges,C=0;C<j.length;C++){var T=j[C];if(this.hasElementWithId(T.id())&&(!a||T.data("source")===c)){var D=T.source(),N=T.target(),O=D.id()!==c?D:N,M=O.id();if(this.hasElementWithId(M)&&!v[M]){var A=f[c]+s(T);w=M,m.has(w)?A<f[M]&&(f[M]=A,p[M]=A+o(O),y[M]=l,b[M]=T):(f[M]=A,p[M]=A+o(O),x(O,M),y[M]=l,b[M]=T)}}}}return{found:!1,distance:void 0,path:void 0,steps:E}}},Ye=De({weight:function(e){return 1},directed:!1}),Ue={floydWarshall:function(e){for(var t=this.cy(),n=Ye(e),r=n.weight,i=n.directed,o=r,a=this.byGroup(),s=a.nodes,l=a.edges,c=s.length,u=c*c,d=function(e){return s.indexOf(e)},h=function(e){return s[e]},f=new Array(u),p=0;p<u;p++){var v=p%c,g=(p-v)/c;f[p]=g===v?0:1/0}for(var m=new Array(u),y=new Array(u),b=0;b<l.length;b++){var x=l[b],w=x.source()[0],E=x.target()[0];if(w!==E){var _=d(w),k=d(E),S=_*c+k,P=o(x);if(f[S]>P&&(f[S]=P,m[S]=k,y[S]=x),!i){var j=k*c+_;!i&&f[j]>P&&(f[j]=P,m[j]=_,y[j]=x)}}}for(var T=0;T<c;T++)for(var D=0;D<c;D++)for(var N=D*c+T,O=0;O<c;O++){var M=D*c+O,A=T*c+O;f[N]+f[A]<f[M]&&(f[M]=f[N]+f[A],m[M]=m[N])}var R=function(e){return d(function(e){return(C(e)?t.filter(e):e)[0]}(e))},I={distance:function(e,t){var n=R(e),r=R(t);return f[n*c+r]},path:function(e,n){var r=R(e),i=R(n),o=h(r);if(r===i)return o.collection();if(null==m[r*c+i])return t.collection();var a,s=t.collection(),l=r;for(s.merge(o);r!==i;)l=r,r=m[r*c+i],a=y[l*c+r],s.merge(a),s.merge(h(r));return s}};return I}},Xe=De({weight:function(e){return 1},directed:!1,root:null}),$e={bellmanFord:function(e){var t=this,n=Xe(e),r=n.weight,i=n.directed,o=n.root,a=r,s=this,l=this.cy(),c=this.byGroup(),u=c.edges,d=c.nodes,h=d.length,f=new Re,p=!1,v=[];o=l.collection(o)[0],u.unmergeBy((function(e){return e.isLoop()}));for(var g=u.length,m=function(e){var t=f.get(e.id());return t||(t={},f.set(e.id(),t)),t},y=function(e){return(C(e)?l.$(e):e)[0]},b=0;b<h;b++){var x=d[b],w=m(x);x.same(o)?w.dist=0:w.dist=1/0,w.pred=null,w.edge=null}for(var E=!1,_=function(e,t,n,r,i,o){var a=r.dist+o;a<i.dist&&!n.same(r.edge)&&(i.dist=a,i.pred=e,i.edge=n,E=!0)},k=1;k<h;k++){E=!1;for(var S=0;S<g;S++){var P=u[S],j=P.source(),T=P.target(),D=a(P),N=m(j),O=m(T);_(j,0,P,N,O,D),i||_(T,0,P,O,N,D)}if(!E)break}if(E)for(var M=[],A=0;A<g;A++){var R=u[A],I=R.source(),L=R.target(),B=a(R),F=m(I).dist,z=m(L).dist;if(F+B<z||!i&&z+B<F){if(p||(Se("Graph contains a negative weight cycle for Bellman-Ford"),p=!0),!1===e.findNegativeWeightCycles)break;var V=[];F+B<z&&V.push(I),!i&&z+B<F&&V.push(L);for(var G=V.length,H=0;H<G;H++){var W=V[H],q=[W];q.push(m(W).edge);for(var Y=m(W).pred;-1===q.indexOf(Y);)q.push(Y),q.push(m(Y).edge),Y=m(Y).pred;for(var U=(q=q.slice(q.indexOf(Y)))[0].id(),X=0,$=2;$<q.length;$+=2)q[$].id()<U&&(U=q[$].id(),X=$);(q=q.slice(X).concat(q.slice(0,X))).push(q[0]);var K=q.map((function(e){return e.id()})).join(",");-1===M.indexOf(K)&&(v.push(s.spawn(q)),M.push(K))}}}return{distanceTo:function(e){return m(y(e)).dist},pathTo:function(e){for(var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o,r=y(e),i=[],a=r;;){if(null==a)return t.spawn();var l=m(a),c=l.edge,u=l.pred;if(i.unshift(a[0]),a.same(n)&&i.length>0)break;null!=c&&i.unshift(c),a=u}return s.spawn(i)},hasNegativeWeightCycle:p,negativeWeightCycles:v}}},Ke=Math.sqrt(2),Ze=function(e,t,n){0===n.length&&_e("Karger-Stein must be run on a connected (sub)graph");for(var r=n[e],i=r[1],o=r[2],a=t[i],s=t[o],l=n,c=l.length-1;c>=0;c--){var u=l[c],d=u[1],h=u[2];(t[d]===a&&t[h]===s||t[d]===s&&t[h]===a)&&l.splice(c,1)}for(var f=0;f<l.length;f++){var p=l[f];p[1]===s?(l[f]=p.slice(),l[f][1]=a):p[2]===s&&(l[f]=p.slice(),l[f][2]=a)}for(var v=0;v<t.length;v++)t[v]===s&&(t[v]=a);return l},Qe=function(e,t,n,r){for(;n>r;){var i=Math.floor(Math.random()*t.length);t=Ze(i,e,t),n--}return t},Je={kargerStein:function(){var e=this,t=this.byGroup(),n=t.nodes,r=t.edges;r.unmergeBy((function(e){return e.isLoop()}));var i=n.length,o=r.length,a=Math.ceil(Math.pow(Math.log(i)/Math.LN2,2)),s=Math.floor(i/Ke);if(!(i<2)){for(var l=[],c=0;c<o;c++){var u=r[c];l.push([c,n.indexOf(u.source()),n.indexOf(u.target())])}for(var d=1/0,h=[],f=new Array(i),p=new Array(i),v=new Array(i),g=function(e,t){for(var n=0;n<i;n++)t[n]=e[n]},m=0;m<=a;m++){for(var y=0;y<i;y++)p[y]=y;var b=Qe(p,l.slice(),i,s),x=b.slice();g(p,v);var w=Qe(p,b,s,2),E=Qe(v,x,s,2);w.length<=E.length&&w.length<d?(d=w.length,h=w,g(p,f)):E.length<=w.length&&E.length<d&&(d=E.length,h=E,g(v,f))}for(var _=this.spawn(h.map((function(e){return r[e[0]]}))),k=this.spawn(),S=this.spawn(),P=f[0],j=0;j<f.length;j++){var C=f[j],T=n[j];C===P?k.merge(T):S.merge(T)}var D=function(t){var n=e.spawn();return t.forEach((function(t){n.merge(t),t.connectedEdges().forEach((function(t){e.contains(t)&&!_.contains(t)&&n.merge(t)}))})),n},N=[D(k),D(S)];return{cut:_,components:N,partition1:k,partition2:S}}_e("At least 2 nodes are required for Karger-Stein algorithm")}},et=function(e,t,n){return{x:e.x*t+n.x,y:e.y*t+n.y}},tt=function(e,t,n){return{x:(e.x-n.x)/t,y:(e.y-n.y)/t}},nt=function(e){return{x:e[0],y:e[1]}},rt=function(e,t){return Math.atan2(t,e)-Math.PI/2},it=Math.log2||function(e){return Math.log(e)/Math.log(2)},ot=function(e){return e>0?1:e<0?-1:0},at=function(e,t){return Math.sqrt(st(e,t))},st=function(e,t){var n=t.x-e.x,r=t.y-e.y;return n*n+r*r},lt=function(e){for(var t=e.length,n=0,r=0;r<t;r++)n+=e[r];for(var i=0;i<t;i++)e[i]=e[i]/n;return e},ct=function(e,t,n,r){return(1-r)*(1-r)*e+2*(1-r)*r*t+r*r*n},ut=function(e,t,n,r){return{x:ct(e.x,t.x,n.x,r),y:ct(e.y,t.y,n.y,r)}},dt=function(e,t,n){return Math.max(e,Math.min(n,t))},ht=function(e){if(null==e)return{x1:1/0,y1:1/0,x2:-1/0,y2:-1/0,w:0,h:0};if(null!=e.x1&&null!=e.y1){if(null!=e.x2&&null!=e.y2&&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(null!=e.w&&null!=e.h&&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}}},ft=function(e,t,n){e.x1=Math.min(e.x1,t),e.x2=Math.max(e.x2,t),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,n),e.y2=Math.max(e.y2,n),e.h=e.y2-e.y1},pt=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e.x1-=t,e.x2+=t,e.y1-=t,e.y2+=t,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},vt=function(e){var t,n,r,i,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0];if(1===o.length)t=n=r=i=o[0];else if(2===o.length)t=r=o[0],i=n=o[1];else if(4===o.length){var a=b(o,4);t=a[0],n=a[1],r=a[2],i=a[3]}return e.x1-=i,e.x2+=n,e.y1-=t,e.y2+=r,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},gt=function(e,t){e.x1=t.x1,e.y1=t.y1,e.x2=t.x2,e.y2=t.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1},mt=function(e,t){return!(e.x1>t.x2)&&(!(t.x1>e.x2)&&(!(e.x2<t.x1)&&(!(t.x2<e.x1)&&(!(e.y2<t.y1)&&(!(t.y2<e.y1)&&(!(e.y1>t.y2)&&!(t.y1>e.y2)))))))},yt=function(e,t,n){return e.x1<=t&&t<=e.x2&&e.y1<=n&&n<=e.y2},bt=function(e,t){return yt(e,t.x1,t.y1)&&yt(e,t.x2,t.y2)},xt=function(e,t,n,r,i,o,a){var s,l=Bt(i,o),c=i/2,u=o/2,d=r-u-a;if((s=Ot(e,t,n,r,n-c+l-a,d,n+c-l+a,d,!1)).length>0)return s;var h=n+c+a;if((s=Ot(e,t,n,r,h,r-u+l-a,h,r+u-l+a,!1)).length>0)return s;var f=r+u+a;if((s=Ot(e,t,n,r,n-c+l-a,f,n+c-l+a,f,!1)).length>0)return s;var p,v=n-c-a;if((s=Ot(e,t,n,r,v,r-u+l-a,v,r+u-l+a,!1)).length>0)return s;var g=n-c+l,m=r-u+l;if((p=Dt(e,t,n,r,g,m,l+a)).length>0&&p[0]<=g&&p[1]<=m)return[p[0],p[1]];var y=n+c-l,b=r-u+l;if((p=Dt(e,t,n,r,y,b,l+a)).length>0&&p[0]>=y&&p[1]<=b)return[p[0],p[1]];var x=n+c-l,w=r+u-l;if((p=Dt(e,t,n,r,x,w,l+a)).length>0&&p[0]>=x&&p[1]>=w)return[p[0],p[1]];var E=n-c+l,_=r+u-l;return(p=Dt(e,t,n,r,E,_,l+a)).length>0&&p[0]<=E&&p[1]>=_?[p[0],p[1]]:[]},wt=function(e,t,n,r,i,o,a){var s=a,l=Math.min(n,i),c=Math.max(n,i),u=Math.min(r,o),d=Math.max(r,o);return l-s<=e&&e<=c+s&&u-s<=t&&t<=d+s},Et=function(e,t,n,r,i,o,a,s,l){var c=Math.min(n,a,i)-l,u=Math.max(n,a,i)+l,d=Math.min(r,s,o)-l,h=Math.max(r,s,o)+l;return!(e<c||e>u||t<d||t>h)},_t=function(e,t,n,r,i,o,a,s){var l=[];!function(e,t,n,r,i){var o,a,s,l,c,u,d,h;0===e&&(e=1e-5),s=-27*(r/=e)+(t/=e)*(9*(n/=e)-t*t*2),o=(a=(3*n-t*t)/9)*a*a+(s/=54)*s,i[1]=0,d=t/3,o>0?(c=(c=s+Math.sqrt(o))<0?-Math.pow(-c,1/3):Math.pow(c,1/3),u=(u=s-Math.sqrt(o))<0?-Math.pow(-u,1/3):Math.pow(u,1/3),i[0]=-d+c+u,d+=(c+u)/2,i[4]=i[2]=-d,d=Math.sqrt(3)*(-u+c)/2,i[3]=d,i[5]=-d):(i[5]=i[3]=0,0===o?(h=s<0?-Math.pow(-s,1/3):Math.pow(s,1/3),i[0]=2*h-d,i[4]=i[2]=-(h+d)):(l=(a=-a)*a*a,l=Math.acos(s/Math.sqrt(l)),h=2*Math.sqrt(a),i[0]=-d+h*Math.cos(l/3),i[2]=-d+h*Math.cos((l+2*Math.PI)/3),i[4]=-d+h*Math.cos((l+4*Math.PI)/3)))}(1*n*n-4*n*i+2*n*a+4*i*i-4*i*a+a*a+r*r-4*r*o+2*r*s+4*o*o-4*o*s+s*s,9*n*i-3*n*n-3*n*a-6*i*i+3*i*a+9*r*o-3*r*r-3*r*s-6*o*o+3*o*s,3*n*n-6*n*i+n*a-n*e+2*i*i+2*i*e-a*e+3*r*r-6*r*o+r*s-r*t+2*o*o+2*o*t-s*t,1*n*i-n*n+n*e-i*e+r*o-r*r+r*t-o*t,l);for(var c=[],u=0;u<6;u+=2)Math.abs(l[u+1])<1e-7&&l[u]>=0&&l[u]<=1&&c.push(l[u]);c.push(1),c.push(0);for(var d,h,f,p=-1,v=0;v<c.length;v++)d=Math.pow(1-c[v],2)*n+2*(1-c[v])*c[v]*i+c[v]*c[v]*a,h=Math.pow(1-c[v],2)*r+2*(1-c[v])*c[v]*o+c[v]*c[v]*s,f=Math.pow(d-e,2)+Math.pow(h-t,2),p>=0?f<p&&(p=f):p=f;return p},kt=function(e,t,n,r,i,o){var a=[e-n,t-r],s=[i-n,o-r],l=s[0]*s[0]+s[1]*s[1],c=a[0]*a[0]+a[1]*a[1],u=a[0]*s[0]+a[1]*s[1],d=u*u/l;return u<0?c:d>l?(e-i)*(e-i)+(t-o)*(t-o):c-d},St=function(e,t,n){for(var r,i,o,a,s=0,l=0;l<n.length/2;l++)if(r=n[2*l],i=n[2*l+1],l+1<n.length/2?(o=n[2*(l+1)],a=n[2*(l+1)+1]):(o=n[2*(l+1-n.length/2)],a=n[2*(l+1-n.length/2)+1]),r==e&&o==e);else{if(!(r>=e&&e>=o||r<=e&&e<=o))continue;(e-r)/(o-r)*(a-i)+i>t&&s++}return s%2!=0},Pt=function(e,t,n,r,i,o,a,s,l){var c,u=new Array(n.length);null!=s[0]?(c=Math.atan(s[1]/s[0]),s[0]<0?c+=Math.PI/2:c=-c-Math.PI/2):c=s;for(var d,h=Math.cos(-c),f=Math.sin(-c),p=0;p<u.length/2;p++)u[2*p]=o/2*(n[2*p]*h-n[2*p+1]*f),u[2*p+1]=a/2*(n[2*p+1]*h+n[2*p]*f),u[2*p]+=r,u[2*p+1]+=i;if(l>0){var v=Ct(u,-l);d=jt(v)}else d=u;return St(e,t,d)},jt=function(e){for(var t,n,r,i,o,a,s,l,c=new Array(e.length/2),u=0;u<e.length/4;u++){t=e[4*u],n=e[4*u+1],r=e[4*u+2],i=e[4*u+3],u<e.length/4-1?(o=e[4*(u+1)],a=e[4*(u+1)+1],s=e[4*(u+1)+2],l=e[4*(u+1)+3]):(o=e[0],a=e[1],s=e[2],l=e[3]);var d=Ot(t,n,r,i,o,a,s,l,!0);c[2*u]=d[0],c[2*u+1]=d[1]}return c},Ct=function(e,t){for(var n,r,i,o,a=new Array(2*e.length),s=0;s<e.length/2;s++){n=e[2*s],r=e[2*s+1],s<e.length/2-1?(i=e[2*(s+1)],o=e[2*(s+1)+1]):(i=e[0],o=e[1]);var l=o-r,c=-(i-n),u=Math.sqrt(l*l+c*c),d=l/u,h=c/u;a[4*s]=n+d*t,a[4*s+1]=r+h*t,a[4*s+2]=i+d*t,a[4*s+3]=o+h*t}return a},Tt=function(e,t,n,r,i,o,a){return e-=i,t-=o,(e/=n/2+a)*e+(t/=r/2+a)*t<=1},Dt=function(e,t,n,r,i,o,a){var s=[n-e,r-t],l=[e-i,t-o],c=s[0]*s[0]+s[1]*s[1],u=2*(l[0]*s[0]+l[1]*s[1]),d=u*u-4*c*(l[0]*l[0]+l[1]*l[1]-a*a);if(d<0)return[];var h=(-u+Math.sqrt(d))/(2*c),f=(-u-Math.sqrt(d))/(2*c),p=Math.min(h,f),v=Math.max(h,f),g=[];if(p>=0&&p<=1&&g.push(p),v>=0&&v<=1&&g.push(v),0===g.length)return[];var m=g[0]*s[0]+e,y=g[0]*s[1]+t;return g.length>1?g[0]==g[1]?[m,y]:[m,y,g[1]*s[0]+e,g[1]*s[1]+t]:[m,y]},Nt=function(e,t,n){return t<=e&&e<=n||n<=e&&e<=t?e:e<=t&&t<=n||n<=t&&t<=e?t:n},Ot=function(e,t,n,r,i,o,a,s,l){var c=e-i,u=n-e,d=a-i,h=t-o,f=r-t,p=s-o,v=d*h-p*c,g=u*h-f*c,m=p*u-d*f;if(0!==m){var y=v/m,b=g/m,x=-.001;return x<=y&&y<=1.001&&x<=b&&b<=1.001||l?[e+y*u,t+y*f]:[]}return 0===v||0===g?Nt(e,n,a)===a?[a,s]:Nt(e,n,i)===i?[i,o]:Nt(i,a,n)===n?[n,r]:[]:[]},Mt=function(e,t,n,r,i,o,a,s){var l,c,u,d,h,f,p=[],v=new Array(n.length),g=!0;if(null==o&&(g=!1),g){for(var m=0;m<v.length/2;m++)v[2*m]=n[2*m]*o+r,v[2*m+1]=n[2*m+1]*a+i;if(s>0){var y=Ct(v,-s);c=jt(y)}else c=v}else c=n;for(var b=0;b<c.length/2;b++)u=c[2*b],d=c[2*b+1],b<c.length/2-1?(h=c[2*(b+1)],f=c[2*(b+1)+1]):(h=c[0],f=c[1]),0!==(l=Ot(e,t,r,i,u,d,h,f)).length&&p.push(l[0],l[1]);return p},At=function(e,t,n){var r=[e[0]-t[0],e[1]-t[1]],i=Math.sqrt(r[0]*r[0]+r[1]*r[1]),o=(i-n)/i;return o<0&&(o=1e-5),[t[0]+o*r[0],t[1]+o*r[1]]},Rt=function(e,t){var n=Lt(e,t);return n=It(n)},It=function(e){for(var t,n,r=e.length/2,i=1/0,o=1/0,a=-1/0,s=-1/0,l=0;l<r;l++)t=e[2*l],n=e[2*l+1],i=Math.min(i,t),a=Math.max(a,t),o=Math.min(o,n),s=Math.max(s,n);for(var c=2/(a-i),u=2/(s-o),d=0;d<r;d++)t=e[2*d]=e[2*d]*c,n=e[2*d+1]=e[2*d+1]*u,i=Math.min(i,t),a=Math.max(a,t),o=Math.min(o,n),s=Math.max(s,n);if(o<-1)for(var h=0;h<r;h++)n=e[2*h+1]=e[2*h+1]+(-1-o);return e},Lt=function(e,t){var n=1/e*2*Math.PI,r=e%2==0?Math.PI/2+n/2:Math.PI/2;r+=t;for(var i,o=new Array(2*e),a=0;a<e;a++)i=a*n+r,o[2*a]=Math.cos(i),o[2*a+1]=Math.sin(-i);return o},Bt=function(e,t){return Math.min(e/4,t/4,8)},Ft=function(e,t){return Math.min(e/10,t/10,8)},zt=function(e,t){return{heightOffset:Math.min(15,.05*t),widthOffset:Math.min(100,.25*e),ctrlPtOffsetPct:.05}},Vt=De({dampingFactor:.8,precision:1e-6,iterations:200,weight:function(e){return 1}}),Gt={pageRank:function(e){for(var t=Vt(e),n=t.dampingFactor,r=t.precision,i=t.iterations,o=t.weight,a=this._private.cy,s=this.byGroup(),l=s.nodes,c=s.edges,u=l.length,d=u*u,h=c.length,f=new Array(d),p=new Array(u),v=(1-n)/u,g=0;g<u;g++){for(var m=0;m<u;m++){f[g*u+m]=0}p[g]=0}for(var y=0;y<h;y++){var b=c[y],x=b.data("source"),w=b.data("target");if(x!==w){var E=l.indexOfId(x),_=l.indexOfId(w),k=o(b);f[_*u+E]+=k,p[E]+=k}}for(var S=1/u+v,P=0;P<u;P++)if(0===p[P])for(var j=0;j<u;j++){f[j*u+P]=S}else for(var C=0;C<u;C++){var T=C*u+P;f[T]=f[T]/p[P]+v}for(var D,N=new Array(u),O=new Array(u),M=0;M<u;M++)N[M]=1;for(var A=0;A<i;A++){for(var R=0;R<u;R++)O[R]=0;for(var I=0;I<u;I++)for(var L=0;L<u;L++){var B=I*u+L;O[I]+=f[B]*N[L]}lt(O),D=N,N=O,O=D;for(var F=0,z=0;z<u;z++){var V=D[z]-N[z];F+=V*V}if(F<r)break}return{rank:function(e){return e=a.collection(e)[0],N[l.indexOf(e)]}}}},Ht=De({root:null,weight:function(e){return 1},directed:!1,alpha:0}),Wt={degreeCentralityNormalized:function(e){e=Ht(e);var t=this.cy(),n=this.nodes(),r=n.length;if(e.directed){for(var i={},o={},a=0,s=0,l=0;l<r;l++){var c=n[l],u=c.id();e.root=c;var d=this.degreeCentrality(e);a<d.indegree&&(a=d.indegree),s<d.outdegree&&(s=d.outdegree),i[u]=d.indegree,o[u]=d.outdegree}return{indegree:function(e){return 0==a?0:(C(e)&&(e=t.filter(e)),i[e.id()]/a)},outdegree:function(e){return 0===s?0:(C(e)&&(e=t.filter(e)),o[e.id()]/s)}}}for(var h={},f=0,p=0;p<r;p++){var v=n[p];e.root=v;var g=this.degreeCentrality(e);f<g.degree&&(f=g.degree),h[v.id()]=g.degree}return{degree:function(e){return 0===f?0:(C(e)&&(e=t.filter(e)),h[e.id()]/f)}}},degreeCentrality:function(e){e=Ht(e);var t=this.cy(),n=this,r=e,i=r.root,o=r.weight,a=r.directed,s=r.alpha;if(i=t.collection(i)[0],a){for(var l=i.connectedEdges(),c=l.filter((function(e){return e.target().same(i)&&n.has(e)})),u=l.filter((function(e){return e.source().same(i)&&n.has(e)})),d=c.length,h=u.length,f=0,p=0,v=0;v<c.length;v++)f+=o(c[v]);for(var g=0;g<u.length;g++)p+=o(u[g]);return{indegree:Math.pow(d,1-s)*Math.pow(f,s),outdegree:Math.pow(h,1-s)*Math.pow(p,s)}}for(var m=i.connectedEdges().intersection(n),y=m.length,b=0,x=0;x<m.length;x++)b+=o(m[x]);return{degree:Math.pow(y,1-s)*Math.pow(b,s)}}};Wt.dc=Wt.degreeCentrality,Wt.dcn=Wt.degreeCentralityNormalised=Wt.degreeCentralityNormalized;var qt=De({harmonic:!0,weight:function(){return 1},directed:!1,root:null}),Yt={closenessCentralityNormalized:function(e){for(var t=qt(e),n=t.harmonic,r=t.weight,i=t.directed,o=this.cy(),a={},s=0,l=this.nodes(),c=this.floydWarshall({weight:r,directed:i}),u=0;u<l.length;u++){for(var d=0,h=l[u],f=0;f<l.length;f++)if(u!==f){var p=c.distance(h,l[f]);d+=n?1/p:p}n||(d=1/d),s<d&&(s=d),a[h.id()]=d}return{closeness:function(e){return 0==s?0:(e=C(e)?o.filter(e)[0].id():e.id(),a[e]/s)}}},closenessCentrality:function(e){var t=qt(e),n=t.root,r=t.weight,i=t.directed,o=t.harmonic;n=this.filter(n)[0];for(var a=this.dijkstra({root:n,weight:r,directed:i}),s=0,l=this.nodes(),c=0;c<l.length;c++){var u=l[c];if(!u.same(n)){var d=a.distanceTo(u);s+=o?1/d:d}}return o?s:1/s}};Yt.cc=Yt.closenessCentrality,Yt.ccn=Yt.closenessCentralityNormalised=Yt.closenessCentralityNormalized;var Ut=De({weight:null,directed:!1}),Xt={betweennessCentrality:function(e){for(var t=Ut(e),n=t.directed,r=t.weight,i=null!=r,o=this.cy(),a=this.nodes(),s={},l={},c=0,d=function(e,t){l[e]=t,t>c&&(c=t)},h=function(e){return l[e]},f=0;f<a.length;f++){var p=a[f],v=p.id();s[v]=n?p.outgoers().nodes():p.openNeighborhood().nodes(),d(v,0)}for(var g=function(e){for(var t=a[e].id(),n=[],l={},c={},f={},p=new u.default((function(e,t){return f[e]-f[t]})),v=0;v<a.length;v++){var g=a[v].id();l[g]=[],c[g]=0,f[g]=1/0}for(c[t]=1,f[t]=0,p.push(t);!p.empty();){var m=p.pop();if(n.push(m),i)for(var y=0;y<s[m].length;y++){var b=s[m][y],x=o.getElementById(m),w=void 0;w=x.edgesTo(b).length>0?x.edgesTo(b)[0]:b.edgesTo(x)[0];var E=r(w);b=b.id(),f[b]>f[m]+E&&(f[b]=f[m]+E,p.nodes.indexOf(b)<0?p.push(b):p.updateItem(b),c[b]=0,l[b]=[]),f[b]==f[m]+E&&(c[b]=c[b]+c[m],l[b].push(m))}else for(var _=0;_<s[m].length;_++){var k=s[m][_].id();f[k]==1/0&&(p.push(k),f[k]=f[m]+1),f[k]==f[m]+1&&(c[k]=c[k]+c[m],l[k].push(m))}}for(var S={},P=0;P<a.length;P++)S[a[P].id()]=0;for(;n.length>0;){for(var j=n.pop(),C=0;C<l[j].length;C++){var T=l[j][C];S[T]=S[T]+c[T]/c[j]*(1+S[j])}j!=a[e].id()&&d(j,h(j)+S[j])}},m=0;m<a.length;m++)g(m);var y={betweenness:function(e){var t=o.collection(e).id();return h(t)},betweennessNormalized:function(e){if(0==c)return 0;var t=o.collection(e).id();return h(t)/c}};return y.betweennessNormalised=y.betweennessNormalized,y}};Xt.bc=Xt.betweennessCentrality;var $t=De({expandFactor:2,inflateFactor:2,multFactor:1,maxIterations:20,attributes:[function(e){return 1}]}),Kt=function(e,t){for(var n=0,r=0;r<t.length;r++)n+=t[r](e);return n},Zt=function(e,t){for(var n,r=0;r<t;r++){n=0;for(var i=0;i<t;i++)n+=e[i*t+r];for(var o=0;o<t;o++)e[o*t+r]=e[o*t+r]/n}},Qt=function(e,t,n){for(var r=new Array(n*n),i=0;i<n;i++){for(var o=0;o<n;o++)r[i*n+o]=0;for(var a=0;a<n;a++)for(var s=0;s<n;s++)r[i*n+s]+=e[i*n+a]*t[a*n+s]}return r},Jt=function(e,t,n){for(var r=e.slice(0),i=1;i<n;i++)e=Qt(e,r,t);return e},en=function(e,t,n){for(var r=new Array(t*t),i=0;i<t*t;i++)r[i]=Math.pow(e[i],n);return Zt(r,t),r},tn=function(e,t,n,r){for(var i=0;i<n;i++){if(Math.round(e[i]*Math.pow(10,r))/Math.pow(10,r)!==Math.round(t[i]*Math.pow(10,r))/Math.pow(10,r))return!1}return!0},nn=function(e,t){for(var n=0;n<e.length;n++)if(!t[n]||e[n].id()!==t[n].id())return!1;return!0},rn=function(e){for(var t=this.nodes(),n=this.edges(),r=this.cy(),i=function(e){return $t(e)}(e),o={},a=0;a<t.length;a++)o[t[a].id()]=a;for(var s,l=t.length,c=l*l,u=new Array(c),d=0;d<c;d++)u[d]=0;for(var h=0;h<n.length;h++){var f=n[h],p=o[f.source().id()],v=o[f.target().id()],g=Kt(f,i.attributes);u[p*l+v]+=g,u[v*l+p]+=g}!function(e,t,n){for(var r=0;r<t;r++)e[r*t+r]=n}(u,l,i.multFactor),Zt(u,l);for(var m=!0,y=0;m&&y<i.maxIterations;)m=!1,s=Jt(u,l,i.expandFactor),u=en(s,l,i.inflateFactor),tn(u,s,c,4)||(m=!0),y++;var b=function(e,t,n,r){for(var i=[],o=0;o<t;o++){for(var a=[],s=0;s<t;s++)Math.round(1e3*e[o*t+s])/1e3>0&&a.push(n[s]);0!==a.length&&i.push(r.collection(a))}return i}(u,l,t,r);return b=function(e){for(var t=0;t<e.length;t++)for(var n=0;n<e.length;n++)t!=n&&nn(e[t],e[n])&&e.splice(n,1);return e}(b),b},on={markovClustering:rn,mcl:rn},an=function(e){return e},sn=function(e,t){return Math.abs(t-e)},ln=function(e,t,n){return e+sn(t,n)},cn=function(e,t,n){return e+Math.pow(n-t,2)},un=function(e){return Math.sqrt(e)},dn=function(e,t,n){return Math.max(e,sn(t,n))},hn=function(e,t,n,r,i){for(var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:an,a=r,s=0;s<e;s++)a=i(a,t(s),n(s));return o(a)},fn={euclidean:function(e,t,n){return e>=2?hn(e,t,n,0,cn,un):hn(e,t,n,0,ln)},squaredEuclidean:function(e,t,n){return hn(e,t,n,0,cn)},manhattan:function(e,t,n){return hn(e,t,n,0,ln)},max:function(e,t,n){return hn(e,t,n,-1/0,dn)}};function pn(e,t,n,r,i,o){var a;return a=T(e)?e:fn[e]||fn.euclidean,0===t&&T(e)?a(i,o):a(t,n,r,i,o)}fn["squared-euclidean"]=fn.squaredEuclidean,fn.squaredeuclidean=fn.squaredEuclidean;var vn=De({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),gn=function(e){return vn(e)},mn=function(e,t,n,r,i){var o="kMedoids"!==i?function(e){return n[e]}:function(e){return r[e](n)},a=n,s=t;return pn(e,r.length,o,(function(e){return r[e](t)}),a,s)},yn=function(e,t,n){for(var r=n.length,i=new Array(r),o=new Array(r),a=new Array(t),s=null,l=0;l<r;l++)i[l]=e.min(n[l]).value,o[l]=e.max(n[l]).value;for(var c=0;c<t;c++){s=[];for(var u=0;u<r;u++)s[u]=Math.random()*(o[u]-i[u])+i[u];a[c]=s}return a},bn=function(e,t,n,r,i){for(var o=1/0,a=0,s=0;s<t.length;s++){var l=mn(n,e,t[s],r,i);l<o&&(o=l,a=s)}return a},xn=function(e,t,n){for(var r=[],i=null,o=0;o<t.length;o++)n[(i=t[o]).id()]===e&&r.push(i);return r},wn=function(e,t,n){for(var r=0;r<e.length;r++)for(var i=0;i<e[r].length;i++){if(Math.abs(e[r][i]-t[r][i])>n)return!1}return!0},En=function(e,t,n){for(var r=0;r<n;r++)if(e===t[r])return!0;return!1},_n=function(e,t){var n=new Array(t);if(e.length<50)for(var r=0;r<t;r++){for(var i=e[Math.floor(Math.random()*e.length)];En(i,n,r);)i=e[Math.floor(Math.random()*e.length)];n[r]=i}else for(var o=0;o<t;o++)n[o]=e[Math.floor(Math.random()*e.length)];return n},kn=function(e,t,n){for(var r=0,i=0;i<t.length;i++)r+=mn("manhattan",t[i],e,n,"kMedoids");return r},Sn=function(e,t,n,r,i){for(var o,a,s=0;s<t.length;s++)for(var l=0;l<e.length;l++)r[s][l]=Math.pow(n[s][l],i.m);for(var c=0;c<e.length;c++)for(var u=0;u<i.attributes.length;u++){o=0,a=0;for(var d=0;d<t.length;d++)o+=r[d][c]*i.attributes[u](t[d]),a+=r[d][c];e[c][u]=o/a}},Pn=function(e,t,n,r,i){for(var o=0;o<e.length;o++)t[o]=e[o].slice();for(var a,s,l,c=2/(i.m-1),u=0;u<n.length;u++)for(var d=0;d<r.length;d++){a=0;for(var h=0;h<n.length;h++)s=mn(i.distance,r[d],n[u],i.attributes,"cmeans"),l=mn(i.distance,r[d],n[h],i.attributes,"cmeans"),a+=Math.pow(s/l,c);e[d][u]=1/a}},jn=function(e){var t,n,r,i,o,a=this.cy(),s=this.nodes(),l=gn(e);i=new Array(s.length);for(var c=0;c<s.length;c++)i[c]=new Array(l.k);r=new Array(s.length);for(var u=0;u<s.length;u++)r[u]=new Array(l.k);for(var d=0;d<s.length;d++){for(var h=0,f=0;f<l.k;f++)r[d][f]=Math.random(),h+=r[d][f];for(var p=0;p<l.k;p++)r[d][p]=r[d][p]/h}n=new Array(l.k);for(var v=0;v<l.k;v++)n[v]=new Array(l.attributes.length);o=new Array(s.length);for(var g=0;g<s.length;g++)o[g]=new Array(l.k);for(var m=!0,y=0;m&&y<l.maxIterations;)m=!1,Sn(n,s,r,o,l),Pn(r,i,n,s,l),wn(r,i,l.sensitivityThreshold)||(m=!0),y++;return t=function(e,t,n,r){for(var i,o,a=new Array(n.k),s=0;s<a.length;s++)a[s]=[];for(var l=0;l<t.length;l++){i=-1/0,o=-1;for(var c=0;c<t[0].length;c++)t[l][c]>i&&(i=t[l][c],o=c);a[o].push(e[l])}for(var u=0;u<a.length;u++)a[u]=r.collection(a[u]);return a}(s,r,l,a),{clusters:t,degreeOfMembership:r}},Cn={kMeans:function(e){var t,n=this.cy(),r=this.nodes(),i=null,o=gn(e),a=new Array(o.k),s={};o.testMode?"number"==typeof o.testCentroids?(o.testCentroids,t=yn(r,o.k,o.attributes)):t="object"===p(o.testCentroids)?o.testCentroids:yn(r,o.k,o.attributes):t=yn(r,o.k,o.attributes);for(var l,c,u,d=!0,h=0;d&&h<o.maxIterations;){for(var f=0;f<r.length;f++)s[(i=r[f]).id()]=bn(i,t,o.distance,o.attributes,"kMeans");d=!1;for(var v=0;v<o.k;v++){var g=xn(v,r,s);if(0!==g.length){for(var m=o.attributes.length,y=t[v],b=new Array(m),x=new Array(m),w=0;w<m;w++){x[w]=0;for(var E=0;E<g.length;E++)i=g[E],x[w]+=o.attributes[w](i);b[w]=x[w]/g.length,l=b[w],c=y[w],u=o.sensitivityThreshold,Math.abs(c-l)<=u||(d=!0)}t[v]=b,a[v]=n.collection(g)}}h++}return a},kMedoids:function(e){var t,n,r=this.cy(),i=this.nodes(),o=null,a=gn(e),s=new Array(a.k),l={},c=new Array(a.k);a.testMode?"number"==typeof a.testCentroids||(t="object"===p(a.testCentroids)?a.testCentroids:_n(i,a.k)):t=_n(i,a.k);for(var u=!0,d=0;u&&d<a.maxIterations;){for(var h=0;h<i.length;h++)l[(o=i[h]).id()]=bn(o,t,a.distance,a.attributes,"kMedoids");u=!1;for(var f=0;f<t.length;f++){var v=xn(f,i,l);if(0!==v.length){c[f]=kn(t[f],v,a.attributes);for(var g=0;g<v.length;g++)(n=kn(v[g],v,a.attributes))<c[f]&&(c[f]=n,t[f]=v[g],u=!0);s[f]=r.collection(v)}}d++}return s},fuzzyCMeans:jn,fcm:jn},Tn=De({distance:"euclidean",linkage:"min",mode:"threshold",threshold:1/0,addDendrogram:!1,dendrogramDepth:0,attributes:[]}),Dn={single:"min",complete:"max"},Nn=function(e,t,n,r,i){for(var o,a=0,s=1/0,l=i.attributes,c=function(e,t){return pn(i.distance,l.length,(function(t){return l[t](e)}),(function(e){return l[e](t)}),e,t)},u=0;u<e.length;u++){var d=e[u].key,h=n[d][r[d]];h<s&&(a=d,s=h)}if("threshold"===i.mode&&s>=i.threshold||"dendrogram"===i.mode&&1===e.length)return!1;var f,p=t[a],v=t[r[a]];f="dendrogram"===i.mode?{left:p,right:v,key:p.key}:{value:p.value.concat(v.value),key:p.key},e[p.index]=f,e.splice(v.index,1),t[p.key]=f;for(var g=0;g<e.length;g++){var m=e[g];p.key===m.key?o=1/0:"min"===i.linkage?(o=n[p.key][m.key],n[p.key][m.key]>n[v.key][m.key]&&(o=n[v.key][m.key])):"max"===i.linkage?(o=n[p.key][m.key],n[p.key][m.key]<n[v.key][m.key]&&(o=n[v.key][m.key])):o="mean"===i.linkage?(n[p.key][m.key]*p.size+n[v.key][m.key]*v.size)/(p.size+v.size):"dendrogram"===i.mode?c(m.value,p.value):c(m.value[0],p.value[0]),n[p.key][m.key]=n[m.key][p.key]=o}for(var y=0;y<e.length;y++){var b=e[y].key;if(r[b]===p.key||r[b]===v.key){for(var x=b,w=0;w<e.length;w++){var E=e[w].key;n[b][E]<n[b][x]&&(x=E)}r[b]=x}e[y].index=y}return p.key=v.key=p.index=v.index=null,!0},On=function e(t,n,r){t&&(t.value?n.push(t.value):(t.left&&e(t.left,n),t.right&&e(t.right,n)))},Mn=function e(t,n){if(!t)return"";if(t.left&&t.right){var r=e(t.left,n),i=e(t.right,n),o=n.add({group:"nodes",data:{id:r+","+i}});return n.add({group:"edges",data:{source:r,target:o.id()}}),n.add({group:"edges",data:{source:i,target:o.id()}}),o.id()}return t.value?t.value.id():void 0},An=function e(t,n,r){if(!t)return[];var i=[],o=[],a=[];return 0===n?(t.left&&On(t.left,i),t.right&&On(t.right,o),a=i.concat(o),[r.collection(a)]):1===n?t.value?[r.collection(t.value)]:(t.left&&On(t.left,i),t.right&&On(t.right,o),[r.collection(i),r.collection(o)]):t.value?[r.collection(t.value)]:(t.left&&(i=e(t.left,n-1,r)),t.right&&(o=e(t.right,n-1,r)),i.concat(o))},Rn=function(e){for(var t=this.cy(),n=this.nodes(),r=function(e){var t=Tn(e),n=Dn[t.linkage];return null!=n&&(t.linkage=n),t}(e),i=r.attributes,o=function(e,t){return pn(r.distance,i.length,(function(t){return i[t](e)}),(function(e){return i[e](t)}),e,t)},a=[],s=[],l=[],c=[],u=0;u<n.length;u++){var d={value:"dendrogram"===r.mode?n[u]:[n[u]],key:u,index:u};a[u]=d,c[u]=d,s[u]=[],l[u]=0}for(var h=0;h<a.length;h++)for(var f=0;f<=h;f++){var p=void 0;p="dendrogram"===r.mode?h===f?1/0:o(a[h].value,a[f].value):h===f?1/0:o(a[h].value[0],a[f].value[0]),s[h][f]=p,s[f][h]=p,p<s[h][l[h]]&&(l[h]=f)}for(var v,g=Nn(a,c,s,l,r);g;)g=Nn(a,c,s,l,r);return"dendrogram"===r.mode?(v=An(a[0],r.dendrogramDepth,t),r.addDendrogram&&Mn(a[0],t)):(v=new Array(a.length),a.forEach((function(e,n){e.key=e.index=null,v[n]=t.collection(e.value)}))),v},In={hierarchicalClustering:Rn,hca:Rn},Ln=De({distance:"euclidean",preference:"median",damping:.8,maxIterations:1e3,minIterations:100,attributes:[]}),Bn=function(e,t,n,r){var i=function(e,t){return r[t](e)};return-pn(e,r.length,(function(e){return i(t,e)}),(function(e){return i(n,e)}),t,n)},Fn=function(e,t){var n=null;return n="median"===t?function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],i=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];arguments.length>3&&void 0!==arguments[3]&&!arguments[3]?(n<e.length&&e.splice(n,e.length-n),t>0&&e.splice(0,t)):e=e.slice(t,n);for(var o=0,a=e.length-1;a>=0;a--){var s=e[a];i?isFinite(s)||(e[a]=-1/0,o++):e.splice(a,1)}r&&e.sort((function(e,t){return e-t}));var l=e.length,c=Math.floor(l/2);return l%2!=0?e[c+1+o]:(e[c-1+o]+e[c+o])/2}(e):"mean"===t?function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=0,i=0,o=t;o<n;o++){var a=e[o];isFinite(a)&&(r+=a,i++)}return r/i}(e):"min"===t?function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=1/0,i=t;i<n;i++){var o=e[i];isFinite(o)&&(r=Math.min(o,r))}return r}(e):"max"===t?function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=-1/0,i=t;i<n;i++){var o=e[i];isFinite(o)&&(r=Math.max(o,r))}return r}(e):t,n},zn=function(e,t,n){for(var r=[],i=0;i<e;i++){for(var o=-1,a=-1/0,s=0;s<n.length;s++){var l=n[s];t[i*e+l]>a&&(o=l,a=t[i*e+l])}o>0&&r.push(o)}for(var c=0;c<n.length;c++)r[n[c]]=n[c];return r},Vn=function(e){for(var t,n,r,i,o,a,s=this.cy(),l=this.nodes(),c=function(e){var t=e.damping,n=e.preference;.5<=t&&t<1||_e("Damping must range on [0.5, 1). Got: ".concat(t));var r=["median","mean","min","max"];return r.some((function(e){return e===n}))||O(n)||_e("Preference must be one of [".concat(r.map((function(e){return"'".concat(e,"'")})).join(", "),"] or a number. Got: ").concat(n)),Ln(e)}(e),u={},d=0;d<l.length;d++)u[l[d].id()]=d;n=(t=l.length)*t,r=new Array(n);for(var h=0;h<n;h++)r[h]=-1/0;for(var f=0;f<t;f++)for(var p=0;p<t;p++)f!==p&&(r[f*t+p]=Bn(c.distance,l[f],l[p],c.attributes));i=Fn(r,c.preference);for(var v=0;v<t;v++)r[v*t+v]=i;o=new Array(n);for(var g=0;g<n;g++)o[g]=0;a=new Array(n);for(var m=0;m<n;m++)a[m]=0;for(var y=new Array(t),b=new Array(t),x=new Array(t),w=0;w<t;w++)y[w]=0,b[w]=0,x[w]=0;for(var E,_=new Array(t*c.minIterations),k=0;k<_.length;k++)_[k]=0;for(E=0;E<c.maxIterations;E++){for(var S=0;S<t;S++){for(var P=-1/0,j=-1/0,C=-1,T=0,D=0;D<t;D++)y[D]=o[S*t+D],(T=a[S*t+D]+r[S*t+D])>=P?(j=P,P=T,C=D):T>j&&(j=T);for(var N=0;N<t;N++)o[S*t+N]=(1-c.damping)*(r[S*t+N]-P)+c.damping*y[N];o[S*t+C]=(1-c.damping)*(r[S*t+C]-j)+c.damping*y[C]}for(var M=0;M<t;M++){for(var A=0,R=0;R<t;R++)y[R]=a[R*t+M],b[R]=Math.max(0,o[R*t+M]),A+=b[R];A-=b[M],b[M]=o[M*t+M],A+=b[M];for(var I=0;I<t;I++)a[I*t+M]=(1-c.damping)*Math.min(0,A-b[I])+c.damping*y[I];a[M*t+M]=(1-c.damping)*(A-b[M])+c.damping*y[M]}for(var L=0,B=0;B<t;B++){var F=a[B*t+B]+o[B*t+B]>0?1:0;_[E%c.minIterations*t+B]=F,L+=F}if(L>0&&(E>=c.minIterations-1||E==c.maxIterations-1)){for(var z=0,V=0;V<t;V++){x[V]=0;for(var G=0;G<c.minIterations;G++)x[V]+=_[G*t+V];0!==x[V]&&x[V]!==c.minIterations||z++}if(z===t)break}}for(var H=function(e,t,n){for(var r=[],i=0;i<e;i++)t[i*e+i]+n[i*e+i]>0&&r.push(i);return r}(t,o,a),W=function(e,t,n){for(var r=zn(e,t,n),i=0;i<n.length;i++){for(var o=[],a=0;a<r.length;a++)r[a]===n[i]&&o.push(a);for(var s=-1,l=-1/0,c=0;c<o.length;c++){for(var u=0,d=0;d<o.length;d++)u+=t[o[d]*e+o[c]];u>l&&(s=c,l=u)}n[i]=o[s]}return zn(e,t,n)}(t,r,H),q={},Y=0;Y<H.length;Y++)q[H[Y]]=[];for(var U=0;U<l.length;U++){var X=W[u[l[U].id()]];null!=X&&q[X].push(l[U])}for(var $=new Array(H.length),K=0;K<H.length;K++)$[K]=s.collection(q[H[K]]);return $},Gn={affinityPropagation:Vn,ap:Vn},Hn=De({root:void 0,directed:!1}),Wn=function(){var e=this,t={},n=0,r=0,i=[],o=[],a={},s=function s(l,c,u){l===u&&(r+=1),t[c]={id:n,low:n++,cutVertex:!1};var d,h,f,p,v=e.getElementById(c).connectedEdges().intersection(e);0===v.size()?i.push(e.spawn(e.getElementById(c))):v.forEach((function(n){d=n.source().id(),h=n.target().id(),(f=d===c?h:d)!==u&&(p=n.id(),a[p]||(a[p]=!0,o.push({x:c,y:f,edge:n})),f in t?t[c].low=Math.min(t[c].low,t[f].id):(s(l,f,c),t[c].low=Math.min(t[c].low,t[f].low),t[c].id<=t[f].low&&(t[c].cutVertex=!0,function(n,r){for(var a=o.length-1,s=[],l=e.spawn();o[a].x!=n||o[a].y!=r;)s.push(o.pop().edge),a--;s.push(o.pop().edge),s.forEach((function(n){var r=n.connectedNodes().intersection(e);l.merge(n),r.forEach((function(n){var r=n.id(),i=n.connectedEdges().intersection(e);l.merge(n),t[r].cutVertex?l.merge(i.filter((function(e){return e.isLoop()}))):l.merge(i)}))})),i.push(l)}(c,f))))}))};e.forEach((function(e){if(e.isNode()){var n=e.id();n in t||(r=0,s(n,n),t[n].cutVertex=r>1)}}));var l=Object.keys(t).filter((function(e){return t[e].cutVertex})).map((function(t){return e.getElementById(t)}));return{cut:e.spawn(l),components:i}},qn=function(){var e=this,t={},n=0,r=[],i=[],o=e.spawn(e),a=function a(s){if(i.push(s),t[s]={index:n,low:n++,explored:!1},e.getElementById(s).connectedEdges().intersection(e).forEach((function(e){var n=e.target().id();n!==s&&(n in t||a(n),t[n].explored||(t[s].low=Math.min(t[s].low,t[n].low)))})),t[s].index===t[s].low){for(var l=e.spawn();;){var c=i.pop();if(l.merge(e.getElementById(c)),t[c].low=t[s].index,t[c].explored=!0,c===s)break}var u=l.edgesWith(l),d=l.merge(u);r.push(d),o=o.difference(d)}};return e.forEach((function(e){if(e.isNode()){var n=e.id();n in t||a(n)}})),{cut:o,components:r}},Yn={};[ze,Ge,He,qe,Ue,$e,Je,Gt,Wt,Yt,Xt,on,Cn,In,Gn,{hierholzer:function(e){if(!N(e)){var t=arguments;e={root:t[0],directed:t[1]}}var n,r,i,o=Hn(e),a=o.root,s=o.directed,l=this,c=!1;a&&(i=C(a)?this.filter(a)[0].id():a[0].id());var u={},d={};s?l.forEach((function(e){var t=e.id();if(e.isNode()){var i=e.indegree(!0),o=e.outdegree(!0),a=i-o,s=o-i;1==a?n?c=!0:n=t:1==s?r?c=!0:r=t:(s>1||a>1)&&(c=!0),u[t]=[],e.outgoers().forEach((function(e){e.isEdge()&&u[t].push(e.id())}))}else d[t]=[void 0,e.target().id()]})):l.forEach((function(e){var t=e.id();e.isNode()?(e.degree(!0)%2&&(n?r?c=!0:r=t:n=t),u[t]=[],e.connectedEdges().forEach((function(e){return u[t].push(e.id())}))):d[t]=[e.source().id(),e.target().id()]}));var h={found:!1,trail:void 0};if(c)return h;if(r&&n)if(s){if(i&&r!=i)return h;i=r}else{if(i&&r!=i&&n!=i)return h;i||(i=r)}else i||(i=l[0].id());var f=function(e){for(var t,n,r,i=e,o=[e];u[i].length;)t=u[i].shift(),n=d[t][0],i!=(r=d[t][1])?(u[r]=u[r].filter((function(e){return e!=t})),i=r):s||i==n||(u[n]=u[n].filter((function(e){return e!=t})),i=n),o.unshift(t),o.unshift(i);return o},p=[],v=[];for(v=f(i);1!=v.length;)0==u[v[0]].length?(p.unshift(l.getElementById(v.shift())),p.unshift(l.getElementById(v.shift()))):v=f(v.shift()).concat(v);for(var g in p.unshift(l.getElementById(v.shift())),u)if(u[g].length)return h;return h.found=!0,h.trail=this.spawn(p,!0),h}},{hopcroftTarjanBiconnected:Wn,htbc:Wn,htb:Wn,hopcroftTarjanBiconnectedComponents:Wn},{tarjanStronglyConnected:qn,tsc:qn,tscc:qn,tarjanStronglyConnectedComponents:qn}].forEach((function(e){X(Yn,e)}));var Un=function e(t){if(!(this instanceof e))return new e(t);this.id="Thenable/1.0.7",this.state=0,this.fulfillValue=void 0,this.rejectReason=void 0,this.onFulfilled=[],this.onRejected=[],this.proxy={then:this.then.bind(this)},"function"==typeof t&&t.call(this,this.fulfill.bind(this),this.reject.bind(this))};Un.prototype={fulfill:function(e){return Xn(this,1,"fulfillValue",e)},reject:function(e){return Xn(this,2,"rejectReason",e)},then:function(e,t){var n=this,r=new Un;return n.onFulfilled.push(Zn(e,r,"fulfill")),n.onRejected.push(Zn(t,r,"reject")),$n(n),r.proxy}};var Xn=function(e,t,n,r){return 0===e.state&&(e.state=t,e[n]=r,$n(e)),e},$n=function(e){1===e.state?Kn(e,"onFulfilled",e.fulfillValue):2===e.state&&Kn(e,"onRejected",e.rejectReason)},Kn=function(e,t,n){if(0!==e[t].length){var r=e[t];e[t]=[];var i=function(){for(var e=0;e<r.length;e++)r[e](n)};"function"==typeof setImmediate?setImmediate(i):setTimeout(i,0)}},Zn=function(e,t,n){return function(r){if("function"!=typeof e)t[n].call(t,r);else{var i;try{i=e(r)}catch(o){return void t.reject(o)}Qn(t,i)}}},Qn=function e(t,n){if(t!==n&&t.proxy!==n){var r;if("object"===p(n)&&null!==n||"function"==typeof n)try{r=n.then}catch(o){return void t.reject(o)}if("function"!=typeof r)t.fulfill(n);else{var i=!1;try{r.call(n,(function(r){i||(i=!0,r===n?t.reject(new TypeError("circular thenable chain")):e(t,r))}),(function(e){i||(i=!0,t.reject(e))}))}catch(o){i||t.reject(o)}}}else t.reject(new TypeError("cannot resolve promise with itself"))};Un.all=function(e){return new Un((function(t,n){for(var r=new Array(e.length),i=0,o=function(n,o){r[n]=o,++i===e.length&&t(r)},a=0;a<e.length;a++)!function(t){var r=e[t];null!=r&&null!=r.then?r.then((function(e){o(t,e)}),(function(e){n(e)})):o(t,r)}(a)}))},Un.resolve=function(e){return new Un((function(t,n){t(e)}))},Un.reject=function(e){return new Un((function(t,n){n(e)}))};var Jn="undefined"!=typeof Promise?Promise:Un,er=function(e,t,n){var r=L(e),i=!r,o=this._private=X({duration:1e3},t,n);if(o.target=e,o.style=o.style||o.css,o.started=!1,o.playing=!1,o.hooked=!1,o.applying=!1,o.progress=0,o.completes=[],o.frames=[],o.complete&&T(o.complete)&&o.completes.push(o.complete),i){var a=e.position();o.startPosition=o.startPosition||{x:a.x,y:a.y},o.startStyle=o.startStyle||e.cy().style().getAnimationStartStyle(e,o.style)}if(r){var s=e.pan();o.startPan={x:s.x,y:s.y},o.startZoom=e.zoom()}this.length=1,this[0]=this},tr=er.prototype;X(tr,{instanceString:function(){return"animation"},hook:function(){var e=this._private;if(!e.hooked){var t=e.target._private.animation;(e.queue?t.queue:t.current).push(this),A(e.target)&&e.target.cy().addToAnimationPool(e.target),e.hooked=!0}return this},play:function(){var e=this._private;return 1===e.progress&&(e.progress=0),e.playing=!0,e.started=!1,e.stopped=!1,this.hook(),this},playing:function(){return this._private.playing},apply:function(){var e=this._private;return e.applying=!0,e.started=!1,e.stopped=!1,this.hook(),this},applying:function(){return this._private.applying},pause:function(){var e=this._private;return e.playing=!1,e.started=!1,this},stop:function(){var e=this._private;return e.playing=!1,e.started=!1,e.stopped=!0,this},rewind:function(){return this.progress(0)},fastforward:function(){return this.progress(1)},time:function(e){var t=this._private;return void 0===e?t.progress*t.duration:this.progress(e/t.duration)},progress:function(e){var t=this._private,n=t.playing;return void 0===e?t.progress:(n&&this.pause(),t.progress=e,t.started=!1,n&&this.play(),this)},completed:function(){return 1===this._private.progress},reverse:function(){var e=this._private,t=e.playing;t&&this.pause(),e.progress=1-e.progress,e.started=!1;var n=function(t,n){var r=e[t];null!=r&&(e[t]=e[n],e[n]=r)};if(n("zoom","startZoom"),n("pan","startPan"),n("position","startPosition"),e.style)for(var r=0;r<e.style.length;r++){var i=e.style[r],o=i.name,a=e.startStyle[o];e.startStyle[o]=i,e.style[r]=a}return t&&this.play(),this},promise:function(e){var t,n=this._private;if("frame"===e)t=n.frames;else t=n.completes;return new Jn((function(e,n){t.push((function(){e()}))}))}}),tr.complete=tr.completed,tr.run=tr.play,tr.running=tr.playing;var nr={animated:function(){return function(){var e=this,t=void 0!==e.length?e:[e];if(!(this._private.cy||this).styleEnabled())return!1;var n=t[0];return n?n._private.animation.current.length>0:void 0}},clearQueue:function(){return function(){var e=this,t=void 0!==e.length?e:[e];if(!(this._private.cy||this).styleEnabled())return this;for(var n=0;n<t.length;n++){t[n]._private.animation.queue=[]}return this}},delay:function(){return function(e,t){return(this._private.cy||this).styleEnabled()?this.animate({delay:e,duration:e,complete:t}):this}},delayAnimation:function(){return function(e,t){return(this._private.cy||this).styleEnabled()?this.animation({delay:e,duration:e,complete:t}):this}},animation:function(){return function(e,t){var n=this,r=void 0!==n.length,i=r?n:[n],o=this._private.cy||this,a=!r,s=!a;if(!o.styleEnabled())return this;var l=o.style();if(e=X({},e,t),0===Object.keys(e).length)return new er(i[0],e);switch(void 0===e.duration&&(e.duration=400),e.duration){case"slow":e.duration=600;break;case"fast":e.duration=200}if(s&&(e.style=l.getPropsList(e.style||e.css),e.css=void 0),s&&null!=e.renderedPosition){var c=e.renderedPosition,u=o.pan(),d=o.zoom();e.position=tt(c,d,u)}if(a&&null!=e.panBy){var h=e.panBy,f=o.pan();e.pan={x:f.x+h.x,y:f.y+h.y}}var p=e.center||e.centre;if(a&&null!=p){var v=o.getCenterPan(p.eles,e.zoom);null!=v&&(e.pan=v)}if(a&&null!=e.fit){var g=e.fit,m=o.getFitViewport(g.eles||g.boundingBox,g.padding);null!=m&&(e.pan=m.pan,e.zoom=m.zoom)}if(a&&N(e.zoom)){var y=o.getZoomedViewport(e.zoom);null!=y?(y.zoomed&&(e.zoom=y.zoom),y.panned&&(e.pan=y.pan)):e.zoom=null}return new er(i[0],e)}},animate:function(){return function(e,t){var n=this,r=void 0!==n.length?n:[n];if(!(this._private.cy||this).styleEnabled())return this;t&&(e=X({},e,t));for(var i=0;i<r.length;i++){var o=r[i],a=o.animated()&&(void 0===e.queue||e.queue);o.animation(e,a?{queue:!0}:void 0).play()}return this}},stop:function(){return function(e,t){var n=this,r=void 0!==n.length?n:[n],i=this._private.cy||this;if(!i.styleEnabled())return this;for(var o=0;o<r.length;o++){for(var a=r[o]._private,s=a.animation.current,l=0;l<s.length;l++){var c=s[l]._private;t&&(c.duration=0)}e&&(a.animation.queue=[]),t||(a.animation.current=[])}return i.notify("draw"),this}}},rr={data:function(e){return e=X({},{field:"data",bindingEvent:"data",allowBinding:!1,allowSetting:!1,allowGetting:!1,settingEvent:"data",settingTriggersEvent:!1,triggerFnName:"trigger",immutableKeys:{},updateStyle:!1,beforeGet:function(e){},beforeSet:function(e,t){},onSet:function(e){},canSet:function(e){return!0}},e),function(t,n){var r=e,i=this,o=void 0!==i.length,a=o?i:[i],s=o?i[0]:i;if(C(t)){var l,c=-1!==t.indexOf(".")&&f.default(t);if(r.allowGetting&&void 0===n)return s&&(r.beforeGet(s),l=c&&void 0===s._private[r.field][t]?d.default(s._private[r.field],c):s._private[r.field][t]),l;if(r.allowSetting&&void 0!==n&&!r.immutableKeys[t]){var u=y({},t,n);r.beforeSet(i,u);for(var p=0,v=a.length;p<v;p++){var g=a[p];r.canSet(g)&&(c&&void 0===s._private[r.field][t]?h.default(g._private[r.field],c,n):g._private[r.field][t]=n)}r.updateStyle&&i.updateStyle(),r.onSet(i),r.settingTriggersEvent&&i[r.triggerFnName](r.settingEvent)}}else if(r.allowSetting&&N(t)){var m,b,x=t,w=Object.keys(x);r.beforeSet(i,x);for(var E=0;E<w.length;E++){if(b=x[m=w[E]],!r.immutableKeys[m])for(var _=0;_<a.length;_++){var k=a[_];r.canSet(k)&&(k._private[r.field][m]=b)}}r.updateStyle&&i.updateStyle(),r.onSet(i),r.settingTriggersEvent&&i[r.triggerFnName](r.settingEvent)}else if(r.allowBinding&&T(t)){var S=t;i.on(r.bindingEvent,S)}else if(r.allowGetting&&void 0===t){var P;return s&&(r.beforeGet(s),P=s._private[r.field]),P}return i}},removeData:function(e){return e=X({},{field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!1,immutableKeys:{}},e),function(t){var n=e,r=this,i=void 0!==r.length?r:[r];if(C(t)){for(var o=t.split(/\s+/),a=o.length,s=0;s<a;s++){var l=o[s];if(!F(l))if(!n.immutableKeys[l])for(var c=0,u=i.length;c<u;c++)i[c]._private[n.field][l]=void 0}n.triggerEvent&&r[n.triggerFnName](n.event)}else if(void 0===t){for(var d=0,h=i.length;d<h;d++)for(var f=i[d]._private[n.field],p=Object.keys(f),v=0;v<p.length;v++){var g=p[v];!n.immutableKeys[g]&&(f[g]=void 0)}n.triggerEvent&&r[n.triggerFnName](n.event)}return r}}},ir={eventAliasesOn:function(e){var t=e;t.addListener=t.listen=t.bind=t.on,t.unlisten=t.unbind=t.off=t.removeListener,t.trigger=t.emit,t.pon=t.promiseOn=function(e,t){var n=this,r=Array.prototype.slice.call(arguments,0);return new Jn((function(e,t){var i=r.concat([function(t){n.off.apply(n,o),e(t)}]),o=i.concat([]);n.on.apply(n,i)}))}}},or={};[nr,rr,ir].forEach((function(e){X(or,e)}));var ar={animate:or.animate(),animation:or.animation(),animated:or.animated(),clearQueue:or.clearQueue(),delay:or.delay(),delayAnimation:or.delayAnimation(),stop:or.stop()},sr={classes:function(e){var t=this;if(void 0===e){var n=[];return t[0]._private.classes.forEach((function(e){return n.push(e)})),n}D(e)||(e=(e||"").match(/\S+/g)||[]);for(var r=[],i=new Le(e),o=0;o<t.length;o++){for(var a=t[o],s=a._private,l=s.classes,c=!1,u=0;u<e.length;u++){var d=e[u];if(!l.has(d)){c=!0;break}}c||(c=l.size!==e.length),c&&(s.classes=i,r.push(a))}return r.length>0&&this.spawn(r).updateStyle().emit("class"),t},addClass:function(e){return this.toggleClass(e,!0)},hasClass:function(e){var t=this[0];return null!=t&&t._private.classes.has(e)},toggleClass:function(e,t){D(e)||(e=e.match(/\S+/g)||[]);for(var n=this,r=void 0===t,i=[],o=0,a=n.length;o<a;o++)for(var s=n[o],l=s._private.classes,c=!1,u=0;u<e.length;u++){var d=e[u],h=l.has(d),f=!1;t||r&&!h?(l.add(d),f=!0):(!t||r&&h)&&(l.delete(d),f=!0),!c&&f&&(i.push(s),c=!0)}return i.length>0&&this.spawn(i).updateStyle().emit("class"),n},removeClass:function(e){return this.toggleClass(e,!1)},flashClass:function(e,t){var n=this;if(null==t)t=250;else if(0===t)return n;return n.addClass(e),setTimeout((function(){n.removeClass(e)}),t),n}};sr.className=sr.classNames=sr.classes;var lr={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:"\"(?:\\\\\"|[^\"])*\"|'(?:\\\\'|[^'])*'",number:Y,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};lr.variable="(?:[\\w-.]|(?:\\\\"+lr.metaChar+"))+",lr.className="(?:[\\w-]|(?:\\\\"+lr.metaChar+"))+",lr.value=lr.string+"|"+lr.number,lr.id=lr.variable,function(){var e,t,n;for(e=lr.comparatorOp.split("|"),n=0;n<e.length;n++)t=e[n],lr.comparatorOp+="|@"+t;for(e=lr.comparatorOp.split("|"),n=0;n<e.length;n++)(t=e[n]).indexOf("!")>=0||"="!==t&&(lr.comparatorOp+="|\\!"+t)}();var cr=0,ur=1,dr=2,hr=3,fr=4,pr=5,vr=6,gr=7,mr=8,yr=9,br=10,xr=11,wr=12,Er=13,_r=14,kr=15,Sr=16,Pr=17,jr=18,Cr=19,Tr=20,Dr=[{selector:":selected",matches:function(e){return e.selected()}},{selector:":unselected",matches:function(e){return!e.selected()}},{selector:":selectable",matches:function(e){return e.selectable()}},{selector:":unselectable",matches:function(e){return!e.selectable()}},{selector:":locked",matches:function(e){return e.locked()}},{selector:":unlocked",matches:function(e){return!e.locked()}},{selector:":visible",matches:function(e){return e.visible()}},{selector:":hidden",matches:function(e){return!e.visible()}},{selector:":transparent",matches:function(e){return e.transparent()}},{selector:":grabbed",matches:function(e){return e.grabbed()}},{selector:":free",matches:function(e){return!e.grabbed()}},{selector:":removed",matches:function(e){return e.removed()}},{selector:":inside",matches:function(e){return!e.removed()}},{selector:":grabbable",matches:function(e){return e.grabbable()}},{selector:":ungrabbable",matches:function(e){return!e.grabbable()}},{selector:":animated",matches:function(e){return e.animated()}},{selector:":unanimated",matches:function(e){return!e.animated()}},{selector:":parent",matches:function(e){return e.isParent()}},{selector:":childless",matches:function(e){return e.isChildless()}},{selector:":child",matches:function(e){return e.isChild()}},{selector:":orphan",matches:function(e){return e.isOrphan()}},{selector:":nonorphan",matches:function(e){return e.isChild()}},{selector:":compound",matches:function(e){return e.isNode()?e.isParent():e.source().isParent()||e.target().isParent()}},{selector:":loop",matches:function(e){return e.isLoop()}},{selector:":simple",matches:function(e){return e.isSimple()}},{selector:":active",matches:function(e){return e.active()}},{selector:":inactive",matches:function(e){return!e.active()}},{selector:":backgrounding",matches:function(e){return e.backgrounding()}},{selector:":nonbackgrounding",matches:function(e){return!e.backgrounding()}}].sort((function(e,t){return function(e,t){return-1*U(e,t)}(e.selector,t.selector)})),Nr=function(){for(var e,t={},n=0;n<Dr.length;n++)t[(e=Dr[n]).selector]=e.matches;return t}(),Or="("+Dr.map((function(e){return e.selector})).join("|")+")",Mr=function(e){return e.replace(new RegExp("\\\\("+lr.metaChar+")","g"),(function(e,t){return t}))},Ar=function(e,t,n){e[e.length-1]=n},Rr=[{name:"group",query:!0,regex:"("+lr.group+")",populate:function(e,t,n){var r=b(n,1)[0];t.checks.push({type:cr,value:"*"===r?r:r+"s"})}},{name:"state",query:!0,regex:Or,populate:function(e,t,n){var r=b(n,1)[0];t.checks.push({type:gr,value:r})}},{name:"id",query:!0,regex:"\\#("+lr.id+")",populate:function(e,t,n){var r=b(n,1)[0];t.checks.push({type:mr,value:Mr(r)})}},{name:"className",query:!0,regex:"\\.("+lr.className+")",populate:function(e,t,n){var r=b(n,1)[0];t.checks.push({type:yr,value:Mr(r)})}},{name:"dataExists",query:!0,regex:"\\[\\s*("+lr.variable+")\\s*\\]",populate:function(e,t,n){var r=b(n,1)[0];t.checks.push({type:fr,field:Mr(r)})}},{name:"dataCompare",query:!0,regex:"\\[\\s*("+lr.variable+")\\s*("+lr.comparatorOp+")\\s*("+lr.value+")\\s*\\]",populate:function(e,t,n){var r=b(n,3),i=r[0],o=r[1],a=r[2];a=null!=new RegExp("^"+lr.string+"$").exec(a)?a.substring(1,a.length-1):parseFloat(a),t.checks.push({type:hr,field:Mr(i),operator:o,value:a})}},{name:"dataBool",query:!0,regex:"\\[\\s*("+lr.boolOp+")\\s*("+lr.variable+")\\s*\\]",populate:function(e,t,n){var r=b(n,2),i=r[0],o=r[1];t.checks.push({type:pr,field:Mr(o),operator:i})}},{name:"metaCompare",query:!0,regex:"\\[\\[\\s*("+lr.meta+")\\s*("+lr.comparatorOp+")\\s*("+lr.number+")\\s*\\]\\]",populate:function(e,t,n){var r=b(n,3),i=r[0],o=r[1],a=r[2];t.checks.push({type:vr,field:Mr(i),operator:o,value:parseFloat(a)})}},{name:"nextQuery",separator:!0,regex:lr.separator,populate:function(e,t){var n=e.currentSubject,r=e.edgeCount,i=e.compoundCount,o=e[e.length-1];return null!=n&&(o.subject=n,e.currentSubject=null),o.edgeCount=r,o.compoundCount=i,e.edgeCount=0,e.compoundCount=0,e[e.length++]={checks:[]}}},{name:"directedEdge",separator:!0,regex:lr.directedEdge,populate:function(e,t){if(null==e.currentSubject){var n={checks:[]},r=t,i={checks:[]};return n.checks.push({type:xr,source:r,target:i}),Ar(e,0,n),e.edgeCount++,i}var o={checks:[]},a=t,s={checks:[]};return o.checks.push({type:wr,source:a,target:s}),Ar(e,0,o),e.edgeCount++,s}},{name:"undirectedEdge",separator:!0,regex:lr.undirectedEdge,populate:function(e,t){if(null==e.currentSubject){var n={checks:[]},r=t,i={checks:[]};return n.checks.push({type:br,nodes:[r,i]}),Ar(e,0,n),e.edgeCount++,i}var o={checks:[]},a=t,s={checks:[]};return o.checks.push({type:_r,node:a,neighbor:s}),Ar(e,0,o),s}},{name:"child",separator:!0,regex:lr.child,populate:function(e,t){if(null==e.currentSubject){var n={checks:[]},r={checks:[]},i=e[e.length-1];return n.checks.push({type:kr,parent:i,child:r}),Ar(e,0,n),e.compoundCount++,r}if(e.currentSubject===t){var o={checks:[]},a=e[e.length-1],s={checks:[]},l={checks:[]},c={checks:[]},u={checks:[]};return o.checks.push({type:Cr,left:a,right:s,subject:l}),l.checks=t.checks,t.checks=[{type:Tr}],u.checks.push({type:Tr}),s.checks.push({type:Pr,parent:u,child:c}),Ar(e,0,o),e.currentSubject=l,e.compoundCount++,c}var d={checks:[]},h={checks:[]},f=[{type:Pr,parent:d,child:h}];return d.checks=t.checks,t.checks=f,e.compoundCount++,h}},{name:"descendant",separator:!0,regex:lr.descendant,populate:function(e,t){if(null==e.currentSubject){var n={checks:[]},r={checks:[]},i=e[e.length-1];return n.checks.push({type:Sr,ancestor:i,descendant:r}),Ar(e,0,n),e.compoundCount++,r}if(e.currentSubject===t){var o={checks:[]},a=e[e.length-1],s={checks:[]},l={checks:[]},c={checks:[]},u={checks:[]};return o.checks.push({type:Cr,left:a,right:s,subject:l}),l.checks=t.checks,t.checks=[{type:Tr}],u.checks.push({type:Tr}),s.checks.push({type:jr,ancestor:u,descendant:c}),Ar(e,0,o),e.currentSubject=l,e.compoundCount++,c}var d={checks:[]},h={checks:[]},f=[{type:jr,ancestor:d,descendant:h}];return d.checks=t.checks,t.checks=f,e.compoundCount++,h}},{name:"subject",modifier:!0,regex:lr.subject,populate:function(e,t){if(null!=e.currentSubject&&e.currentSubject!==t)return Se("Redefinition of subject in selector `"+e.toString()+"`"),!1;e.currentSubject=t;var n=e[e.length-1].checks[0],r=null==n?null:n.type;r===xr?n.type=Er:r===br&&(n.type=_r,n.node=n.nodes[1],n.neighbor=n.nodes[0],n.nodes=null)}}];Rr.forEach((function(e){return e.regexObj=new RegExp("^"+e.regex)}));var Ir=function(e){for(var t,n,r,i=0;i<Rr.length;i++){var o=Rr[i],a=o.name,s=e.match(o.regexObj);if(null!=s){n=s,t=o,r=a;var l=s[0];e=e.substring(l.length);break}}return{expr:t,match:n,name:r,remaining:e}},Lr={parse:function(e){var t=this,n=t.inputText=e,r=t[0]={checks:[]};for(t.length=1,n=function(e){var t=e.match(/^\s+/);if(t){var n=t[0];e=e.substring(n.length)}return e}(n);;){var i=Ir(n);if(null==i.expr)return Se("The selector `"+e+"`is invalid"),!1;var o=i.match.slice(1),a=i.expr.populate(t,r,o);if(!1===a)return!1;if(null!=a&&(r=a),(n=i.remaining).match(/^\s*$/))break}var s=t[t.length-1];null!=t.currentSubject&&(s.subject=t.currentSubject),s.edgeCount=t.edgeCount,s.compoundCount=t.compoundCount;for(var l=0;l<t.length;l++){var c=t[l];if(c.compoundCount>0&&c.edgeCount>0)return Se("The selector `"+e+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(c.edgeCount>1)return Se("The selector `"+e+"` is invalid because it uses multiple edge selectors"),!1;1===c.edgeCount&&Se("The selector `"+e+"` is deprecated. Edge selectors do not take effect on changes to source and target nodes after an edge is added, for performance reasons. Use a class or data selector on edges instead, updating the class or data of an edge when your app detects a change in source or target nodes.")}return!0},toString:function(){if(null!=this.toStringCache)return this.toStringCache;for(var e=function(e){return null==e?"":e},t=function(t){return C(t)?'"'+t+'"':e(t)},n=function(e){return" "+e+" "},r=function(r,o){var a=r.type,s=r.value;switch(a){case cr:var l=e(s);return l.substring(0,l.length-1);case hr:var c=r.field,u=r.operator;return"["+c+n(e(u))+t(s)+"]";case pr:var d=r.operator,h=r.field;return"["+e(d)+h+"]";case fr:return"["+r.field+"]";case vr:var f=r.operator;return"[["+r.field+n(e(f))+t(s)+"]]";case gr:return s;case mr:return"#"+s;case yr:return"."+s;case Pr:case kr:return i(r.parent,o)+n(">")+i(r.child,o);case jr:case Sr:return i(r.ancestor,o)+" "+i(r.descendant,o);case Cr:var p=i(r.left,o),v=i(r.subject,o),g=i(r.right,o);return p+(p.length>0?" ":"")+v+g;case Tr:return""}},i=function(e,t){return e.checks.reduce((function(n,i,o){return n+(t===e&&0===o?"$":"")+r(i,t)}),"")},o="",a=0;a<this.length;a++){var s=this[a];o+=i(s,s.subject),this.length>1&&a<this.length-1&&(o+=", ")}return this.toStringCache=o,o}},Br=function(e,t,n){var r,i,o,a=C(e),s=O(e),l=C(n),c=!1,u=!1,d=!1;switch(t.indexOf("!")>=0&&(t=t.replace("!",""),u=!0),t.indexOf("@")>=0&&(t=t.replace("@",""),c=!0),(a||l||c)&&(i=a||s?""+e:"",o=""+n),c&&(e=i=i.toLowerCase(),n=o=o.toLowerCase()),t){case"*=":r=i.indexOf(o)>=0;break;case"$=":r=i.indexOf(o,i.length-o.length)>=0;break;case"^=":r=0===i.indexOf(o);break;case"=":r=e===n;break;case">":d=!0,r=e>n;break;case">=":d=!0,r=e>=n;break;case"<":d=!0,r=e<n;break;case"<=":d=!0,r=e<=n;break;default:r=!1}return!u||null==e&&d||(r=!r),r},Fr=function(e,t){return e.data(t)},zr=[],Vr=function(e,t){return e.checks.every((function(e){return zr[e.type](e,t)}))};zr[cr]=function(e,t){var n=e.value;return"*"===n||n===t.group()},zr[gr]=function(e,t){return function(e,t){return Nr[e](t)}(e.value,t)},zr[mr]=function(e,t){var n=e.value;return t.id()===n},zr[yr]=function(e,t){var n=e.value;return t.hasClass(n)},zr[vr]=function(e,t){var n=e.field,r=e.operator,i=e.value;return Br(function(e,t){return e[t]()}(t,n),r,i)},zr[hr]=function(e,t){var n=e.field,r=e.operator,i=e.value;return Br(Fr(t,n),r,i)},zr[pr]=function(e,t){var n=e.field,r=e.operator;return function(e,t){switch(t){case"?":return!!e;case"!":return!e;case"^":return void 0===e}}(Fr(t,n),r)},zr[fr]=function(e,t){var n=e.field;return e.operator,void 0!==Fr(t,n)},zr[br]=function(e,t){var n=e.nodes[0],r=e.nodes[1],i=t.source(),o=t.target();return Vr(n,i)&&Vr(r,o)||Vr(r,i)&&Vr(n,o)},zr[_r]=function(e,t){return Vr(e.node,t)&&t.neighborhood().some((function(t){return t.isNode()&&Vr(e.neighbor,t)}))},zr[xr]=function(e,t){return Vr(e.source,t.source())&&Vr(e.target,t.target())},zr[wr]=function(e,t){return Vr(e.source,t)&&t.outgoers().some((function(t){return t.isNode()&&Vr(e.target,t)}))},zr[Er]=function(e,t){return Vr(e.target,t)&&t.incomers().some((function(t){return t.isNode()&&Vr(e.source,t)}))},zr[kr]=function(e,t){return Vr(e.child,t)&&Vr(e.parent,t.parent())},zr[Pr]=function(e,t){return Vr(e.parent,t)&&t.children().some((function(t){return Vr(e.child,t)}))},zr[Sr]=function(e,t){return Vr(e.descendant,t)&&t.ancestors().some((function(t){return Vr(e.ancestor,t)}))},zr[jr]=function(e,t){return Vr(e.ancestor,t)&&t.descendants().some((function(t){return Vr(e.descendant,t)}))},zr[Cr]=function(e,t){return Vr(e.subject,t)&&Vr(e.left,t)&&Vr(e.right,t)},zr[Tr]=function(){return!0},zr[ur]=function(e,t){return e.value.has(t)},zr[dr]=function(e,t){return(0,e.value)(t)};var Gr={matches:function(e){for(var t=0;t<this.length;t++){var n=this[t];if(Vr(n,e))return!0}return!1},filter:function(e){var t=this;if(1===t.length&&1===t[0].checks.length&&t[0].checks[0].type===mr)return e.getElementById(t[0].checks[0].value).collection();var n=function(e){for(var n=0;n<t.length;n++){var r=t[n];if(Vr(r,e))return!0}return!1};return null==t.text()&&(n=function(){return!0}),e.filter(n)}},Hr=function(e){this.inputText=e,this.currentSubject=null,this.compoundCount=0,this.edgeCount=0,this.length=0,null==e||C(e)&&e.match(/^\s*$/)||(A(e)?this.addQuery({checks:[{type:ur,value:e.collection()}]}):T(e)?this.addQuery({checks:[{type:dr,value:e}]}):C(e)?this.parse(e)||(this.invalid=!0):_e("A selector must be created from a string; found "))},Wr=Hr.prototype;[Lr,Gr].forEach((function(e){return X(Wr,e)})),Wr.text=function(){return this.inputText},Wr.size=function(){return this.length},Wr.eq=function(e){return this[e]},Wr.sameText=function(e){return!this.invalid&&!e.invalid&&this.text()===e.text()},Wr.addQuery=function(e){this[this.length++]=e},Wr.selector=Wr.toString;var qr={allAre:function(e){var t=new Hr(e);return this.every((function(e){return t.matches(e)}))},is:function(e){var t=new Hr(e);return this.some((function(e){return t.matches(e)}))},some:function(e,t){for(var n=0;n<this.length;n++){if(t?e.apply(t,[this[n],n,this]):e(this[n],n,this))return!0}return!1},every:function(e,t){for(var n=0;n<this.length;n++){if(!(t?e.apply(t,[this[n],n,this]):e(this[n],n,this)))return!1}return!0},same:function(e){if(this===e)return!0;e=this.cy().collection(e);var t=this.length;return t===e.length&&(1===t?this[0]===e[0]:this.every((function(t){return e.hasElementWithId(t.id())})))},anySame:function(e){return e=this.cy().collection(e),this.some((function(t){return e.hasElementWithId(t.id())}))},allAreNeighbors:function(e){e=this.cy().collection(e);var t=this.neighborhood();return e.every((function(e){return t.hasElementWithId(e.id())}))},contains:function(e){e=this.cy().collection(e);var t=this;return e.every((function(e){return t.hasElementWithId(e.id())}))}};qr.allAreNeighbours=qr.allAreNeighbors,qr.has=qr.contains,qr.equal=qr.equals=qr.same;var Yr,Ur,Xr=function(e,t){return function(n,r,i,o){var a,s=n,l=this;if(null==s?a="":A(s)&&1===s.length&&(a=s.id()),1===l.length&&a){var c=l[0]._private,u=c.traversalCache=c.traversalCache||{},d=u[t]=u[t]||[],h=he(a),f=d[h];return f||(d[h]=e.call(l,n,r,i,o))}return e.call(l,n,r,i,o)}},$r={parent:function(e){var t=[];if(1===this.length){var n=this[0]._private.parent;if(n)return n}for(var r=0;r<this.length;r++){var i=this[r]._private.parent;i&&t.push(i)}return this.spawn(t,!0).filter(e)},parents:function(e){for(var t=[],n=this.parent();n.nonempty();){for(var r=0;r<n.length;r++){var i=n[r];t.push(i)}n=n.parent()}return this.spawn(t,!0).filter(e)},commonAncestors:function(e){for(var t,n=0;n<this.length;n++){var r=this[n].parents();t=(t=t||r).intersect(r)}return t.filter(e)},orphans:function(e){return this.stdFilter((function(e){return e.isOrphan()})).filter(e)},nonorphans:function(e){return this.stdFilter((function(e){return e.isChild()})).filter(e)},children:Xr((function(e){for(var t=[],n=0;n<this.length;n++)for(var r=this[n]._private.children,i=0;i<r.length;i++)t.push(r[i]);return this.spawn(t,!0).filter(e)}),"children"),siblings:function(e){return this.parent().children().not(this).filter(e)},isParent:function(){var e=this[0];if(e)return e.isNode()&&0!==e._private.children.length},isChildless:function(){var e=this[0];if(e)return e.isNode()&&0===e._private.children.length},isChild:function(){var e=this[0];if(e)return e.isNode()&&null!=e._private.parent},isOrphan:function(){var e=this[0];if(e)return e.isNode()&&null==e._private.parent},descendants:function(e){var t=[];return function e(n){for(var r=0;r<n.length;r++){var i=n[r];t.push(i),i.children().nonempty()&&e(i.children())}}(this.children()),this.spawn(t,!0).filter(e)}};function Kr(e,t,n,r){for(var i=[],o=new Le,a=e.cy().hasCompoundNodes(),s=0;s<e.length;s++){var l=e[s];n?i.push(l):a&&r(i,o,l)}for(;i.length>0;){var c=i.shift();t(c),o.add(c.id()),a&&r(i,o,c)}return e}function Zr(e,t,n){if(n.isParent())for(var r=n._private.children,i=0;i<r.length;i++){var o=r[i];t.has(o.id())||e.push(o)}}function Qr(e,t,n){if(n.isChild()){var r=n._private.parent;t.has(r.id())||e.push(r)}}function Jr(e,t,n){Qr(e,t,n),Zr(e,t,n)}$r.forEachDown=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return Kr(this,e,t,Zr)},$r.forEachUp=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return Kr(this,e,t,Qr)},$r.forEachUpAndDown=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return Kr(this,e,t,Jr)},$r.ancestors=$r.parents,(Yr=Ur={data:or.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),removeData:or.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:or.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:or.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:or.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:or.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var e=this[0];if(e)return e._private.data.id}}).attr=Yr.data,Yr.removeAttr=Yr.removeData;var ei,ti,ni=Ur,ri={};function ii(e){return function(t){var n=this;if(void 0===t&&(t=!0),0!==n.length&&n.isNode()&&!n.removed()){for(var r=0,i=n[0],o=i._private.edges,a=0;a<o.length;a++){var s=o[a];!t&&s.isLoop()||(r+=e(i,s))}return r}}}function oi(e,t){return function(n){for(var r,i=this.nodes(),o=0;o<i.length;o++){var a=i[o][e](n);void 0===a||void 0!==r&&!t(a,r)||(r=a)}return r}}X(ri,{degree:ii((function(e,t){return t.source().same(t.target())?2:1})),indegree:ii((function(e,t){return t.target().same(e)?1:0})),outdegree:ii((function(e,t){return t.source().same(e)?1:0}))}),X(ri,{minDegree:oi("degree",(function(e,t){return e<t})),maxDegree:oi("degree",(function(e,t){return e>t})),minIndegree:oi("indegree",(function(e,t){return e<t})),maxIndegree:oi("indegree",(function(e,t){return e>t})),minOutdegree:oi("outdegree",(function(e,t){return e<t})),maxOutdegree:oi("outdegree",(function(e,t){return e>t}))}),X(ri,{totalDegree:function(e){for(var t=0,n=this.nodes(),r=0;r<n.length;r++)t+=n[r].degree(e);return t}});var ai=function(e,t,n){for(var r=0;r<e.length;r++){var i=e[r];if(!i.locked()){var o=i._private.position,a={x:null!=t.x?t.x-o.x:0,y:null!=t.y?t.y-o.y:0};!i.isParent()||0===a.x&&0===a.y||i.children().shift(a,n),i.dirtyBoundingBoxCache()}}},si={field:"position",bindingEvent:"position",allowBinding:!0,allowSetting:!0,settingEvent:"position",settingTriggersEvent:!0,triggerFnName:"emitAndNotify",allowGetting:!0,validKeys:["x","y"],beforeGet:function(e){e.updateCompoundBounds()},beforeSet:function(e,t){ai(e,t,!1)},onSet:function(e){e.dirtyCompoundBoundsCache()},canSet:function(e){return!e.locked()}};ei=ti={position:or.data(si),silentPosition:or.data(X({},si,{allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!1,beforeSet:function(e,t){ai(e,t,!0)},onSet:function(e){e.dirtyCompoundBoundsCache()}})),positions:function(e,t){if(N(e))t?this.silentPosition(e):this.position(e);else if(T(e)){var n=e,r=this.cy();r.startBatch();for(var i=0;i<this.length;i++){var o,a=this[i];(o=n(a,i))&&(t?a.silentPosition(o):a.position(o))}r.endBatch()}return this},silentPositions:function(e){return this.positions(e,!0)},shift:function(e,t,n){var r;if(N(e)?(r={x:O(e.x)?e.x:0,y:O(e.y)?e.y:0},n=t):C(e)&&O(t)&&((r={x:0,y:0})[e]=t),null!=r){var i=this.cy();i.startBatch();for(var o=0;o<this.length;o++){var a=this[o];if(!(i.hasCompoundNodes()&&a.isChild()&&a.ancestors().anySame(this))){var s=a.position(),l={x:s.x+r.x,y:s.y+r.y};n?a.silentPosition(l):a.position(l)}}i.endBatch()}return this},silentShift:function(e,t){return N(e)?this.shift(e,!0):C(e)&&O(t)&&this.shift(e,t,!0),this},renderedPosition:function(e,t){var n=this[0],r=this.cy(),i=r.zoom(),o=r.pan(),a=N(e)?e:void 0,s=void 0!==a||void 0!==t&&C(e);if(n&&n.isNode()){if(!s){var l=n.position();return a=et(l,i,o),void 0===e?a:a[e]}for(var c=0;c<this.length;c++){var u=this[c];void 0!==t?u.position(e,(t-o[e])/i):void 0!==a&&u.position(tt(a,i,o))}}else if(!s)return;return this},relativePosition:function(e,t){var n=this[0],r=this.cy(),i=N(e)?e:void 0,o=void 0!==i||void 0!==t&&C(e),a=r.hasCompoundNodes();if(n&&n.isNode()){if(!o){var s=n.position(),l=a?n.parent():null,c=l&&l.length>0,u=c;c&&(l=l[0]);var d=u?l.position():{x:0,y:0};return i={x:s.x-d.x,y:s.y-d.y},void 0===e?i:i[e]}for(var h=0;h<this.length;h++){var f=this[h],p=a?f.parent():null,v=p&&p.length>0,g=v;v&&(p=p[0]);var m=g?p.position():{x:0,y:0};void 0!==t?f.position(e,t+m[e]):void 0!==i&&f.position({x:i.x+m.x,y:i.y+m.y})}}else if(!o)return;return this}},ei.modelPosition=ei.point=ei.position,ei.modelPositions=ei.points=ei.positions,ei.renderedPoint=ei.renderedPosition,ei.relativePoint=ei.relativePosition;var li,ci,ui=ti;li=ci={},ci.renderedBoundingBox=function(e){var t=this.boundingBox(e),n=this.cy(),r=n.zoom(),i=n.pan(),o=t.x1*r+i.x,a=t.x2*r+i.x,s=t.y1*r+i.y,l=t.y2*r+i.y;return{x1:o,x2:a,y1:s,y2:l,w:a-o,h:l-s}},ci.dirtyCompoundBoundsCache=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.cy();return t.styleEnabled()&&t.hasCompoundNodes()?(this.forEachUp((function(t){if(t.isParent()){var n=t._private;n.compoundBoundsClean=!1,n.bbCache=null,e||t.emitAndNotify("bounds")}})),this):this},ci.updateCompoundBounds=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.cy();if(!t.styleEnabled()||!t.hasCompoundNodes())return this;if(!e&&t.batching())return this;function n(e){if(e.isParent()){var t=e._private,n=e.children(),r="include"===e.pstyle("compound-sizing-wrt-labels").value,i={width:{val:e.pstyle("min-width").pfValue,left:e.pstyle("min-width-bias-left"),right:e.pstyle("min-width-bias-right")},height:{val:e.pstyle("min-height").pfValue,top:e.pstyle("min-height-bias-top"),bottom:e.pstyle("min-height-bias-bottom")}},o=n.boundingBox({includeLabels:r,includeOverlays:!1,useCache:!1}),a=t.position;0!==o.w&&0!==o.h||((o={w:e.pstyle("width").pfValue,h:e.pstyle("height").pfValue}).x1=a.x-o.w/2,o.x2=a.x+o.w/2,o.y1=a.y-o.h/2,o.y2=a.y+o.h/2);var s=i.width.left.value;"px"===i.width.left.units&&i.width.val>0&&(s=100*s/i.width.val);var l=i.width.right.value;"px"===i.width.right.units&&i.width.val>0&&(l=100*l/i.width.val);var c=i.height.top.value;"px"===i.height.top.units&&i.height.val>0&&(c=100*c/i.height.val);var u=i.height.bottom.value;"px"===i.height.bottom.units&&i.height.val>0&&(u=100*u/i.height.val);var d=m(i.width.val-o.w,s,l),h=d.biasDiff,f=d.biasComplementDiff,p=m(i.height.val-o.h,c,u),v=p.biasDiff,g=p.biasComplementDiff;t.autoPadding=function(e,t,n,r){if("%"!==n.units)return"px"===n.units?n.pfValue:0;switch(r){case"width":return e>0?n.pfValue*e:0;case"height":return t>0?n.pfValue*t:0;case"average":return e>0&&t>0?n.pfValue*(e+t)/2:0;case"min":return e>0&&t>0?e>t?n.pfValue*t:n.pfValue*e:0;case"max":return e>0&&t>0?e>t?n.pfValue*e:n.pfValue*t:0;default:return 0}}(o.w,o.h,e.pstyle("padding"),e.pstyle("padding-relative-to").value),t.autoWidth=Math.max(o.w,i.width.val),a.x=(-h+o.x1+o.x2+f)/2,t.autoHeight=Math.max(o.h,i.height.val),a.y=(-v+o.y1+o.y2+g)/2}function m(e,t,n){var r=0,i=0,o=t+n;return e>0&&o>0&&(r=t/o*e,i=n/o*e),{biasDiff:r,biasComplementDiff:i}}}for(var r=0;r<this.length;r++){var i=this[r],o=i._private;o.compoundBoundsClean&&!e||(n(i),t.batching()||(o.compoundBoundsClean=!0))}return this};var di=function(e){return e===1/0||e===-1/0?0:e},hi=function(e,t,n,r,i){r-t!=0&&i-n!=0&&null!=t&&null!=n&&null!=r&&null!=i&&(e.x1=t<e.x1?t:e.x1,e.x2=r>e.x2?r:e.x2,e.y1=n<e.y1?n:e.y1,e.y2=i>e.y2?i:e.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1)},fi=function(e,t){return null==t?e:hi(e,t.x1,t.y1,t.x2,t.y2)},pi=function(e,t,n){return Me(e,t,n)},vi=function(e,t,n){if(!t.cy().headless()){var r,i,o=t._private,a=o.rstyle,s=a.arrowWidth/2;if("none"!==t.pstyle(n+"-arrow-shape").value){"source"===n?(r=a.srcX,i=a.srcY):"target"===n?(r=a.tgtX,i=a.tgtY):(r=a.midX,i=a.midY);var l=o.arrowBounds=o.arrowBounds||{},c=l[n]=l[n]||{};c.x1=r-s,c.y1=i-s,c.x2=r+s,c.y2=i+s,c.w=c.x2-c.x1,c.h=c.y2-c.y1,pt(c,1),hi(e,c.x1,c.y1,c.x2,c.y2)}}},gi=function(e,t,n){if(!t.cy().headless()){var r;r=n?n+"-":"";var i=t._private,o=i.rstyle;if(t.pstyle(r+"label").strValue){var a,s,l,c,u=t.pstyle("text-halign"),d=t.pstyle("text-valign"),h=pi(o,"labelWidth",n),f=pi(o,"labelHeight",n),p=pi(o,"labelX",n),v=pi(o,"labelY",n),g=t.pstyle(r+"text-margin-x").pfValue,m=t.pstyle(r+"text-margin-y").pfValue,y=t.isEdge(),b=t.pstyle(r+"text-rotation"),x=t.pstyle("text-outline-width").pfValue,w=t.pstyle("text-border-width").pfValue/2,E=t.pstyle("text-background-padding").pfValue,_=f,k=h,S=k/2,P=_/2;if(y)a=p-S,s=p+S,l=v-P,c=v+P;else{switch(u.value){case"left":a=p-k,s=p;break;case"center":a=p-S,s=p+S;break;case"right":a=p,s=p+k}switch(d.value){case"top":l=v-_,c=v;break;case"center":l=v-P,c=v+P;break;case"bottom":l=v,c=v+_}}a+=g-Math.max(x,w)-E-2,s+=g+Math.max(x,w)+E+2,l+=m-Math.max(x,w)-E-2,c+=m+Math.max(x,w)+E+2;var j=n||"main",C=i.labelBounds,T=C[j]=C[j]||{};T.x1=a,T.y1=l,T.x2=s,T.y2=c,T.w=s-a,T.h=c-l;var D=y&&"autorotate"===b.strValue,N=null!=b.pfValue&&0!==b.pfValue;if(D||N){var O=D?pi(i.rstyle,"labelAngle",n):b.pfValue,M=Math.cos(O),A=Math.sin(O),R=(a+s)/2,I=(l+c)/2;if(!y){switch(u.value){case"left":R=s;break;case"right":R=a}switch(d.value){case"top":I=c;break;case"bottom":I=l}}var L=function(e,t){return{x:(e-=R)*M-(t-=I)*A+R,y:e*A+t*M+I}},B=L(a,l),F=L(a,c),z=L(s,l),V=L(s,c);a=Math.min(B.x,F.x,z.x,V.x),s=Math.max(B.x,F.x,z.x,V.x),l=Math.min(B.y,F.y,z.y,V.y),c=Math.max(B.y,F.y,z.y,V.y)}var G=j+"Rot",H=C[G]=C[G]||{};H.x1=a,H.y1=l,H.x2=s,H.y2=c,H.w=s-a,H.h=c-l,hi(e,a,l,s,c),hi(i.labelBounds.all,a,l,s,c)}return e}},mi=function(e){var t=0,n=function(e){return(e?1:0)<<t++},r=0;return r+=n(e.incudeNodes),r+=n(e.includeEdges),r+=n(e.includeLabels),r+=n(e.includeMainLabels),r+=n(e.includeSourceLabels),r+=n(e.includeTargetLabels),r+=n(e.includeOverlays)},yi=function(e){if(e.isEdge()){var t=e.source().position(),n=e.target().position(),r=function(e){return Math.round(e)};return function(e,t){var n={value:0,done:!1},r=0,i=e.length;return se({next:function(){return r<i?n.value=e[r++]:n.done=!0,n}},t)}([r(t.x),r(t.y),r(n.x),r(n.y)])}return 0},bi=function(e,t){var n,r=e._private,i=e.isEdge(),o=(null==t?wi:mi(t))===wi,a=yi(e),s=r.bbCachePosKey===a,l=t.useCache&&s,c=function(e){return null==e._private.bbCache||e._private.styleDirty};if(!l||c(e)||i&&c(e.source())||c(e.target())?(s||e.recalculateRenderedStyle(l),n=function(e,t){var n,r,i,o,a,s,l,c=e._private.cy,u=c.styleEnabled(),d=c.headless(),h=ht(),f=e._private,p=e.isNode(),v=e.isEdge(),g=f.rstyle,m=p&&u?e.pstyle("bounds-expansion").pfValue:[0],y=function(e){return"none"!==e.pstyle("display").value},b=!u||y(e)&&(!v||y(e.source())&&y(e.target()));if(b){var x=0;u&&t.includeOverlays&&0!==e.pstyle("overlay-opacity").value&&(x=e.pstyle("overlay-padding").value);var w=0;u&&t.includeUnderlays&&0!==e.pstyle("underlay-opacity").value&&(w=e.pstyle("underlay-padding").value);var E=Math.max(x,w),_=0;if(u&&(_=e.pstyle("width").pfValue/2),p&&t.includeNodes){var k=e.position();a=k.x,s=k.y;var S=e.outerWidth()/2,P=e.outerHeight()/2;hi(h,n=a-S,i=s-P,r=a+S,o=s+P)}else if(v&&t.includeEdges)if(u&&!d){var j=e.pstyle("curve-style").strValue;if(n=Math.min(g.srcX,g.midX,g.tgtX),r=Math.max(g.srcX,g.midX,g.tgtX),i=Math.min(g.srcY,g.midY,g.tgtY),o=Math.max(g.srcY,g.midY,g.tgtY),hi(h,n-=_,i-=_,r+=_,o+=_),"haystack"===j){var C=g.haystackPts;if(C&&2===C.length){if(n=C[0].x,i=C[0].y,n>(r=C[1].x)){var T=n;n=r,r=T}if(i>(o=C[1].y)){var D=i;i=o,o=D}hi(h,n-_,i-_,r+_,o+_)}}else if("bezier"===j||"unbundled-bezier"===j||"segments"===j||"taxi"===j){var N;switch(j){case"bezier":case"unbundled-bezier":N=g.bezierPts;break;case"segments":case"taxi":N=g.linePts}if(null!=N)for(var O=0;O<N.length;O++){var M=N[O];n=M.x-_,r=M.x+_,i=M.y-_,o=M.y+_,hi(h,n,i,r,o)}}}else{var A=e.source().position(),R=e.target().position();if((n=A.x)>(r=R.x)){var I=n;n=r,r=I}if((i=A.y)>(o=R.y)){var L=i;i=o,o=L}hi(h,n-=_,i-=_,r+=_,o+=_)}if(u&&t.includeEdges&&v&&(vi(h,e,"mid-source"),vi(h,e,"mid-target"),vi(h,e,"source"),vi(h,e,"target")),u&&"yes"===e.pstyle("ghost").value){var B=e.pstyle("ghost-offset-x").pfValue,F=e.pstyle("ghost-offset-y").pfValue;hi(h,h.x1+B,h.y1+F,h.x2+B,h.y2+F)}var z=f.bodyBounds=f.bodyBounds||{};gt(z,h),vt(z,m),pt(z,1),u&&(n=h.x1,r=h.x2,i=h.y1,o=h.y2,hi(h,n-E,i-E,r+E,o+E));var V=f.overlayBounds=f.overlayBounds||{};gt(V,h),vt(V,m),pt(V,1);var G=f.labelBounds=f.labelBounds||{};null!=G.all?((l=G.all).x1=1/0,l.y1=1/0,l.x2=-1/0,l.y2=-1/0,l.w=0,l.h=0):G.all=ht(),u&&t.includeLabels&&(t.includeMainLabels&&gi(h,e,null),v&&(t.includeSourceLabels&&gi(h,e,"source"),t.includeTargetLabels&&gi(h,e,"target")))}return h.x1=di(h.x1),h.y1=di(h.y1),h.x2=di(h.x2),h.y2=di(h.y2),h.w=di(h.x2-h.x1),h.h=di(h.y2-h.y1),h.w>0&&h.h>0&&b&&(vt(h,m),pt(h,1)),h}(e,xi),r.bbCache=n,r.bbCachePosKey=a):n=r.bbCache,!o){var u=e.isNode();n=ht(),(t.includeNodes&&u||t.includeEdges&&!u)&&(t.includeOverlays?fi(n,r.overlayBounds):fi(n,r.bodyBounds)),t.includeLabels&&(t.includeMainLabels&&(!i||t.includeSourceLabels&&t.includeTargetLabels)?fi(n,r.labelBounds.all):(t.includeMainLabels&&fi(n,r.labelBounds.mainRot),t.includeSourceLabels&&fi(n,r.labelBounds.sourceRot),t.includeTargetLabels&&fi(n,r.labelBounds.targetRot))),n.w=n.x2-n.x1,n.h=n.y2-n.y1}return n},xi={includeNodes:!0,includeEdges:!0,includeLabels:!0,includeMainLabels:!0,includeSourceLabels:!0,includeTargetLabels:!0,includeOverlays:!0,includeUnderlays:!0,useCache:!0},wi=mi(xi),Ei=De(xi);ci.boundingBox=function(e){var t;if(1!==this.length||null==this[0]._private.bbCache||this[0]._private.styleDirty||void 0!==e&&void 0!==e.useCache&&!0!==e.useCache){t=ht();var n=Ei(e=e||xi),r=this;if(r.cy().styleEnabled())for(var i=0;i<r.length;i++){var o=r[i],a=o._private,s=yi(o),l=a.bbCachePosKey===s,c=n.useCache&&l&&!a.styleDirty;o.recalculateRenderedStyle(c)}this.updateCompoundBounds(!e.useCache);for(var u=0;u<r.length;u++){var d=r[u];fi(t,bi(d,n))}}else e=void 0===e?xi:Ei(e),t=bi(this[0],e);return t.x1=di(t.x1),t.y1=di(t.y1),t.x2=di(t.x2),t.y2=di(t.y2),t.w=di(t.x2-t.x1),t.h=di(t.y2-t.y1),t},ci.dirtyBoundingBoxCache=function(){for(var e=0;e<this.length;e++){var t=this[e]._private;t.bbCache=null,t.bbCachePosKey=null,t.bodyBounds=null,t.overlayBounds=null,t.labelBounds.all=null,t.labelBounds.source=null,t.labelBounds.target=null,t.labelBounds.main=null,t.labelBounds.sourceRot=null,t.labelBounds.targetRot=null,t.labelBounds.mainRot=null,t.arrowBounds.source=null,t.arrowBounds.target=null,t.arrowBounds["mid-source"]=null,t.arrowBounds["mid-target"]=null}return this.emitAndNotify("bounds"),this},ci.boundingBoxAt=function(e){var t=this.nodes(),n=this.cy(),r=n.hasCompoundNodes(),i=n.collection();if(r&&(i=t.filter((function(e){return e.isParent()})),t=t.not(i)),N(e)){var o=e;e=function(){return o}}n.startBatch(),t.forEach((function(t,n){return t._private.bbAtOldPos=e(t,n)})).silentPositions(e),r&&(i.dirtyCompoundBoundsCache(),i.dirtyBoundingBoxCache(),i.updateCompoundBounds(!0));var a=function(e){return{x1:e.x1,x2:e.x2,w:e.w,y1:e.y1,y2:e.y2,h:e.h}}(this.boundingBox({useCache:!1}));return t.silentPositions((function(e){return e._private.bbAtOldPos})),r&&(i.dirtyCompoundBoundsCache(),i.dirtyBoundingBoxCache(),i.updateCompoundBounds(!0)),n.endBatch(),a},li.boundingbox=li.bb=li.boundingBox,li.renderedBoundingbox=li.renderedBoundingBox;var _i,ki,Si=ci;_i=ki={};var Pi=function(e){e.uppercaseName=q(e.name),e.autoName="auto"+e.uppercaseName,e.labelName="label"+e.uppercaseName,e.outerName="outer"+e.uppercaseName,e.uppercaseOuterName=q(e.outerName),_i[e.name]=function(){var t=this[0],n=t._private,r=n.cy._private.styleEnabled;if(t){if(r){if(t.isParent())return t.updateCompoundBounds(),n[e.autoName]||0;var i=t.pstyle(e.name);return"label"===i.strValue?(t.recalculateRenderedStyle(),n.rstyle[e.labelName]||0):i.pfValue}return 1}},_i["outer"+e.uppercaseName]=function(){var t=this[0],n=t._private.cy._private.styleEnabled;if(t)return n?t[e.name]()+t.pstyle("border-width").pfValue+2*t.padding():1},_i["rendered"+e.uppercaseName]=function(){var t=this[0];if(t)return t[e.name]()*this.cy().zoom()},_i["rendered"+e.uppercaseOuterName]=function(){var t=this[0];if(t)return t[e.outerName]()*this.cy().zoom()}};Pi({name:"width"}),Pi({name:"height"}),ki.padding=function(){var e=this[0],t=e._private;return e.isParent()?(e.updateCompoundBounds(),void 0!==t.autoPadding?t.autoPadding:e.pstyle("padding").pfValue):e.pstyle("padding").pfValue},ki.paddedHeight=function(){var e=this[0];return e.height()+2*e.padding()},ki.paddedWidth=function(){var e=this[0];return e.width()+2*e.padding()};var ji=ki,Ci={controlPoints:{get:function(e){return e.renderer().getControlPoints(e)},mult:!0},segmentPoints:{get:function(e){return e.renderer().getSegmentPoints(e)},mult:!0},sourceEndpoint:{get:function(e){return e.renderer().getSourceEndpoint(e)}},targetEndpoint:{get:function(e){return e.renderer().getTargetEndpoint(e)}},midpoint:{get:function(e){return e.renderer().getEdgeMidpoint(e)}}},Ti=Object.keys(Ci).reduce((function(e,t){var n=Ci[t],r=function(e){return"rendered"+e[0].toUpperCase()+e.substr(1)}(t);return e[t]=function(){return function(e,t){if(e.isEdge())return t(e)}(this,n.get)},n.mult?e[r]=function(){return function(e,t){if(e.isEdge()){var n=e.cy(),r=n.pan(),i=n.zoom();return t(e).map((function(e){return et(e,i,r)}))}}(this,n.get)}:e[r]=function(){return function(e,t){if(e.isEdge()){var n=e.cy();return et(t(e),n.zoom(),n.pan())}}(this,n.get)},e}),{}),Di=X({},ui,Si,ji,Ti),Ni=function(e,t){this.recycle(e,t)};function Oi(){return!1}function Mi(){return!0}Ni.prototype={instanceString:function(){return"event"},recycle:function(e,t){if(this.isImmediatePropagationStopped=this.isPropagationStopped=this.isDefaultPrevented=Oi,null!=e&&e.preventDefault?(this.type=e.type,this.isDefaultPrevented=e.defaultPrevented?Mi:Oi):null!=e&&e.type?t=e:this.type=e,null!=t&&(this.originalEvent=t.originalEvent,this.type=null!=t.type?t.type:this.type,this.cy=t.cy,this.target=t.target,this.position=t.position,this.renderedPosition=t.renderedPosition,this.namespace=t.namespace,this.layout=t.layout),null!=this.cy&&null!=this.position&&null==this.renderedPosition){var n=this.position,r=this.cy.zoom(),i=this.cy.pan();this.renderedPosition={x:n.x*r+i.x,y:n.y*r+i.y}}this.timeStamp=e&&e.timeStamp||Date.now()},preventDefault:function(){this.isDefaultPrevented=Mi;var e=this.originalEvent;e&&e.preventDefault&&e.preventDefault()},stopPropagation:function(){this.isPropagationStopped=Mi;var e=this.originalEvent;e&&e.stopPropagation&&e.stopPropagation()},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=Mi,this.stopPropagation()},isDefaultPrevented:Oi,isPropagationStopped:Oi,isImmediatePropagationStopped:Oi};var Ai=/^([^.]+)(\.(?:[^.]+))?$/,Ri={qualifierCompare:function(e,t){return e===t},eventMatches:function(){return!0},addEventFields:function(){},callbackContext:function(e){return e},beforeEmit:function(){},afterEmit:function(){},bubble:function(){return!1},parent:function(){return null},context:null},Ii=Object.keys(Ri),Li={};function Bi(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Li,t=arguments.length>1?arguments[1]:void 0,n=0;n<Ii.length;n++){var r=Ii[n];this[r]=e[r]||Ri[r]}this.context=t||this.context,this.listeners=[],this.emitting=0}var Fi=Bi.prototype,zi=function(e,t,n,r,i,o,a){T(r)&&(i=r,r=null),a&&(o=null==o?a:X({},o,a));for(var s=D(n)?n:n.split(/\s+/),l=0;l<s.length;l++){var c=s[l];if(!F(c)){var u=c.match(Ai);if(u)if(!1===t(e,c,u[1],u[2]?u[2]:null,r,i,o))break}}},Vi=function(e,t){return e.addEventFields(e.context,t),new Ni(t.type,t)},Gi=function(e,t,n){if("event"!==j(n))if(N(n))t(e,Vi(e,n));else for(var r=D(n)?n:n.split(/\s+/),i=0;i<r.length;i++){var o=r[i];if(!F(o)){var a=o.match(Ai);if(a){var s=a[1],l=a[2]?a[2]:null;t(e,Vi(e,{type:s,namespace:l,target:e.context}))}}}else t(e,n)};Fi.on=Fi.addListener=function(e,t,n,r,i){return zi(this,(function(e,t,n,r,i,o,a){T(o)&&e.listeners.push({event:t,callback:o,type:n,namespace:r,qualifier:i,conf:a})}),e,t,n,r,i),this},Fi.one=function(e,t,n,r){return this.on(e,t,n,r,{one:!0})},Fi.removeListener=Fi.off=function(e,t,n,r){var i=this;0!==this.emitting&&(this.listeners=this.listeners.slice());for(var o=this.listeners,a=function(a){var s=o[a];zi(i,(function(t,n,r,i,l,c){if((s.type===r||"*"===e)&&(!i&&".*"!==s.namespace||s.namespace===i)&&(!l||t.qualifierCompare(s.qualifier,l))&&(!c||s.callback===c))return o.splice(a,1),!1}),e,t,n,r)},s=o.length-1;s>=0;s--)a(s);return this},Fi.removeAllListeners=function(){return this.removeListener("*")},Fi.emit=Fi.trigger=function(e,t,n){var r=this.listeners,i=r.length;return this.emitting++,D(t)||(t=[t]),Gi(this,(function(e,o){null!=n&&(r=[{event:o.event,type:o.type,namespace:o.namespace,callback:n}],i=r.length);for(var a=function(n){var i=r[n];if(i.type===o.type&&(!i.namespace||i.namespace===o.namespace||".*"===i.namespace)&&e.eventMatches(e.context,i,o)){var a=[o];null!=t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];e.push(r)}}(a,t),e.beforeEmit(e.context,i,o),i.conf&&i.conf.one&&(e.listeners=e.listeners.filter((function(e){return e!==i})));var s=e.callbackContext(e.context,i,o),l=i.callback.apply(s,a);e.afterEmit(e.context,i,o),!1===l&&(o.stopPropagation(),o.preventDefault())}},s=0;s<i;s++)a(s);e.bubble(e.context)&&!o.isPropagationStopped()&&e.parent(e.context).emit(o,t)}),e),this.emitting--,this};var Hi={qualifierCompare:function(e,t){return null==e||null==t?null==e&&null==t:e.sameText(t)},eventMatches:function(e,t,n){var r=t.qualifier;return null==r||e!==n.target&&R(n.target)&&r.matches(n.target)},addEventFields:function(e,t){t.cy=e.cy(),t.target=e},callbackContext:function(e,t,n){return null!=t.qualifier?n.target:e},beforeEmit:function(e,t){t.conf&&t.conf.once&&t.conf.onceCollection.removeListener(t.event,t.qualifier,t.callback)},bubble:function(){return!0},parent:function(e){return e.isChild()?e.parent():e.cy()}},Wi=function(e){return C(e)?new Hr(e):e},qi={createEmitter:function(){for(var e=0;e<this.length;e++){var t=this[e],n=t._private;n.emitter||(n.emitter=new Bi(Hi,t))}return this},emitter:function(){return this._private.emitter},on:function(e,t,n){for(var r=Wi(t),i=0;i<this.length;i++){this[i].emitter().on(e,r,n)}return this},removeListener:function(e,t,n){for(var r=Wi(t),i=0;i<this.length;i++){this[i].emitter().removeListener(e,r,n)}return this},removeAllListeners:function(){for(var e=0;e<this.length;e++){this[e].emitter().removeAllListeners()}return this},one:function(e,t,n){for(var r=Wi(t),i=0;i<this.length;i++){this[i].emitter().one(e,r,n)}return this},once:function(e,t,n){for(var r=Wi(t),i=0;i<this.length;i++){this[i].emitter().on(e,r,n,{once:!0,onceCollection:this})}},emit:function(e,t){for(var n=0;n<this.length;n++){this[n].emitter().emit(e,t)}return this},emitAndNotify:function(e,t){if(0!==this.length)return this.cy().notify(e,this),this.emit(e,t),this}};or.eventAliasesOn(qi);var Yi={nodes:function(e){return this.filter((function(e){return e.isNode()})).filter(e)},edges:function(e){return this.filter((function(e){return e.isEdge()})).filter(e)},byGroup:function(){for(var e=this.spawn(),t=this.spawn(),n=0;n<this.length;n++){var r=this[n];r.isNode()?e.push(r):t.push(r)}return{nodes:e,edges:t}},filter:function(e,t){if(void 0===e)return this;if(C(e)||A(e))return new Hr(e).filter(this);if(T(e)){for(var n=this.spawn(),r=this,i=0;i<r.length;i++){var o=r[i];(t?e.apply(t,[o,i,r]):e(o,i,r))&&n.push(o)}return n}return this.spawn()},not:function(e){if(e){C(e)&&(e=this.filter(e));for(var t=this.spawn(),n=0;n<this.length;n++){var r=this[n];e.has(r)||t.push(r)}return t}return this},absoluteComplement:function(){return this.cy().mutableElements().not(this)},intersect:function(e){if(C(e)){var t=e;return this.filter(t)}for(var n=this.spawn(),r=e,i=this.length<e.length,o=i?this:r,a=i?r:this,s=0;s<o.length;s++){var l=o[s];a.has(l)&&n.push(l)}return n},xor:function(e){var t=this._private.cy;C(e)&&(e=t.$(e));var n=this.spawn(),r=e,i=function(e,t){for(var r=0;r<e.length;r++){var i=e[r],o=i._private.data.id;t.hasElementWithId(o)||n.push(i)}};return i(this,r),i(r,this),n},diff:function(e){var t=this._private.cy;C(e)&&(e=t.$(e));var n=this.spawn(),r=this.spawn(),i=this.spawn(),o=e,a=function(e,t,n){for(var r=0;r<e.length;r++){var o=e[r],a=o._private.data.id;t.hasElementWithId(a)?i.merge(o):n.push(o)}};return a(this,o,n),a(o,this,r),{left:n,right:r,both:i}},add:function(e){var t=this._private.cy;if(!e)return this;if(C(e)){var n=e;e=t.mutableElements().filter(n)}for(var r=this.spawnSelf(),i=0;i<e.length;i++){var o=e[i],a=!this.has(o);a&&r.push(o)}return r},merge:function(e){var t=this._private,n=t.cy;if(!e)return this;if(e&&C(e)){var r=e;e=n.mutableElements().filter(r)}for(var i=t.map,o=0;o<e.length;o++){var a=e[o],s=a._private.data.id;if(!i.has(s)){var l=this.length++;this[l]=a,i.set(s,{ele:a,index:l})}}return this},unmergeAt:function(e){var t=this[e].id(),n=this._private.map;this[e]=void 0,n.delete(t);var r=e===this.length-1;if(this.length>1&&!r){var i=this.length-1,o=this[i],a=o._private.data.id;this[i]=void 0,this[e]=o,n.set(a,{ele:o,index:e})}return this.length--,this},unmergeOne:function(e){e=e[0];var t=this._private,n=e._private.data.id,r=t.map.get(n);if(!r)return this;var i=r.index;return this.unmergeAt(i),this},unmerge:function(e){var t=this._private.cy;if(!e)return this;if(e&&C(e)){var n=e;e=t.mutableElements().filter(n)}for(var r=0;r<e.length;r++)this.unmergeOne(e[r]);return this},unmergeBy:function(e){for(var t=this.length-1;t>=0;t--){e(this[t])&&this.unmergeAt(t)}return this},map:function(e,t){for(var n=[],r=this,i=0;i<r.length;i++){var o=r[i],a=t?e.apply(t,[o,i,r]):e(o,i,r);n.push(a)}return n},reduce:function(e,t){for(var n=t,r=this,i=0;i<r.length;i++)n=e(n,r[i],i,r);return n},max:function(e,t){for(var n,r=-1/0,i=this,o=0;o<i.length;o++){var a=i[o],s=t?e.apply(t,[a,o,i]):e(a,o,i);s>r&&(r=s,n=a)}return{value:r,ele:n}},min:function(e,t){for(var n,r=1/0,i=this,o=0;o<i.length;o++){var a=i[o],s=t?e.apply(t,[a,o,i]):e(a,o,i);s<r&&(r=s,n=a)}return{value:r,ele:n}}},Ui=Yi;Ui.u=Ui["|"]=Ui["+"]=Ui.union=Ui.or=Ui.add,Ui["\\"]=Ui["!"]=Ui["-"]=Ui.difference=Ui.relativeComplement=Ui.subtract=Ui.not,Ui.n=Ui["&"]=Ui["."]=Ui.and=Ui.intersection=Ui.intersect,Ui["^"]=Ui["(+)"]=Ui["(-)"]=Ui.symmetricDifference=Ui.symdiff=Ui.xor,Ui.fnFilter=Ui.filterFn=Ui.stdFilter=Ui.filter,Ui.complement=Ui.abscomp=Ui.absoluteComplement;var Xi=function(e,t){var n=e.cy().hasCompoundNodes();function r(e){var t=e.pstyle("z-compound-depth");return"auto"===t.value?n?e.zDepth():0:"bottom"===t.value?-1:"top"===t.value?ye:0}var i=r(e)-r(t);if(0!==i)return i;function o(e){return"auto"===e.pstyle("z-index-compare").value&&e.isNode()?1:0}var a=o(e)-o(t);if(0!==a)return a;var s=e.pstyle("z-index").value-t.pstyle("z-index").value;return 0!==s?s:e.poolIndex()-t.poolIndex()},$i={forEach:function(e,t){if(T(e))for(var n=this.length,r=0;r<n;r++){var i=this[r];if(!1===(t?e.apply(t,[i,r,this]):e(i,r,this)))break}return this},toArray:function(){for(var e=[],t=0;t<this.length;t++)e.push(this[t]);return e},slice:function(e,t){var n=[],r=this.length;null==t&&(t=r),null==e&&(e=0),e<0&&(e=r+e),t<0&&(t=r+t);for(var i=e;i>=0&&i<t&&i<r;i++)n.push(this[i]);return this.spawn(n)},size:function(){return this.length},eq:function(e){return this[e]||this.spawn()},first:function(){return this[0]||this.spawn()},last:function(){return this[this.length-1]||this.spawn()},empty:function(){return 0===this.length},nonempty:function(){return!this.empty()},sort:function(e){if(!T(e))return this;var t=this.toArray().sort(e);return this.spawn(t)},sortByZIndex:function(){return this.sort(Xi)},zDepth:function(){var e=this[0];if(e){var t=e._private;if("nodes"===t.group){var n=t.data.parent?e.parents().size():0;return e.isParent()?n:ye-1}var r=t.source,i=t.target,o=r.zDepth(),a=i.zDepth();return Math.max(o,a,0)}}};$i.each=$i.forEach;var Ki;Ki="undefined",("undefined"==typeof Symbol?"undefined":p(Symbol))!=Ki&&p(Symbol.iterator)!=Ki&&($i[Symbol.iterator]=function(){var e=this,t={value:void 0,done:!1},n=0,r=this.length;return y({next:function(){return n<r?t.value=e[n++]:(t.value=void 0,t.done=!0),t}},Symbol.iterator,(function(){return this}))});var Zi=De({nodeDimensionsIncludeLabels:!1}),Qi={layoutDimensions:function(e){var t;if(e=Zi(e),this.takesUpSpace())if(e.nodeDimensionsIncludeLabels){var n=this.boundingBox();t={w:n.w,h:n.h}}else t={w:this.outerWidth(),h:this.outerHeight()};else t={w:0,h:0};return 0!==t.w&&0!==t.h||(t.w=t.h=1),t},layoutPositions:function(e,t,n){var r=this.nodes().filter((function(e){return!e.isParent()})),i=this.cy(),o=t.eles,a=function(e){return e.id()},s=V(n,a);e.emit({type:"layoutstart",layout:e}),e.animations=[];var l=t.spacingFactor&&1!==t.spacingFactor,c=function(){if(!l)return null;for(var e=ht(),t=0;t<r.length;t++){var n=r[t],i=s(n,t);ft(e,i.x,i.y)}return e}(),u=V((function(e,n){var r=s(e,n);l&&(r=function(e,t,n){var r=t.x1+t.w/2,i=t.y1+t.h/2;return{x:r+(n.x-r)*e,y:i+(n.y-i)*e}}(Math.abs(t.spacingFactor),c,r));return null!=t.transform&&(r=t.transform(e,r)),r}),a);if(t.animate){for(var d=0;d<r.length;d++){var h=r[d],f=u(h,d);if(null==t.animateFilter||t.animateFilter(h,d)){var p=h.animation({position:f,duration:t.animationDuration,easing:t.animationEasing});e.animations.push(p)}else h.position(f)}if(t.fit){var v=i.animation({fit:{boundingBox:o.boundingBoxAt(u),padding:t.padding},duration:t.animationDuration,easing:t.animationEasing});e.animations.push(v)}else if(void 0!==t.zoom&&void 0!==t.pan){var g=i.animation({zoom:t.zoom,pan:t.pan,duration:t.animationDuration,easing:t.animationEasing});e.animations.push(g)}e.animations.forEach((function(e){return e.play()})),e.one("layoutready",t.ready),e.emit({type:"layoutready",layout:e}),Jn.all(e.animations.map((function(e){return e.promise()}))).then((function(){e.one("layoutstop",t.stop),e.emit({type:"layoutstop",layout:e})}))}else r.positions(u),t.fit&&i.fit(t.eles,t.padding),null!=t.zoom&&i.zoom(t.zoom),t.pan&&i.pan(t.pan),e.one("layoutready",t.ready),e.emit({type:"layoutready",layout:e}),e.one("layoutstop",t.stop),e.emit({type:"layoutstop",layout:e});return this},layout:function(e){return this.cy().makeLayout(X({},e,{eles:this}))}};function Ji(e,t,n){var r,i=n._private,o=i.styleCache=i.styleCache||[];return null!=(r=o[e])?r:r=o[e]=t(n)}function eo(e,t){return e=he(e),function(n){return Ji(e,t,n)}}function to(e,t){e=he(e);var n=function(e){return t.call(e)};return function(){var t=this[0];if(t)return Ji(e,n,t)}}Qi.createLayout=Qi.makeLayout=Qi.layout;var no={recalculateRenderedStyle:function(e){var t=this.cy(),n=t.renderer(),r=t.styleEnabled();return n&&r&&n.recalculateRenderedStyle(this,e),this},dirtyStyleCache:function(){var e,t=this.cy(),n=function(e){return e._private.styleCache=null};t.hasCompoundNodes()?((e=this.spawnSelf().merge(this.descendants()).merge(this.parents())).merge(e.connectedEdges()),e.forEach(n)):this.forEach((function(e){n(e),e.connectedEdges().forEach(n)}));return this},updateStyle:function(e){var t=this._private.cy;if(!t.styleEnabled())return this;if(t.batching())return t._private.batchStyleEles.merge(this),this;var n=this;e=!(!e&&void 0!==e),t.hasCompoundNodes()&&(n=this.spawnSelf().merge(this.descendants()).merge(this.parents()));var r=n;return e?r.emitAndNotify("style"):r.emit("style"),n.forEach((function(e){return e._private.styleDirty=!0})),this},cleanStyle:function(){var e=this.cy();if(e.styleEnabled())for(var t=0;t<this.length;t++){var n=this[t];n._private.styleDirty&&(n._private.styleDirty=!1,e.style().apply(n))}},parsedStyle:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this[0],r=n.cy();if(r.styleEnabled()&&n){this.cleanStyle();var i=n._private.style[e];return null!=i?i:t?r.style().getDefaultProperty(e):null}},numericStyle:function(e){var t=this[0];if(t.cy().styleEnabled()&&t){var n=t.pstyle(e);return void 0!==n.pfValue?n.pfValue:n.value}},numericStyleUnits:function(e){var t=this[0];if(t.cy().styleEnabled())return t?t.pstyle(e).units:void 0},renderedStyle:function(e){var t=this.cy();if(!t.styleEnabled())return this;var n=this[0];return n?t.style().getRenderedStyle(n,e):void 0},style:function(e,t){var n=this.cy();if(!n.styleEnabled())return this;var r=n.style();if(N(e)){var i=e;r.applyBypass(this,i,false),this.emitAndNotify("style")}else if(C(e)){if(void 0===t){var o=this[0];return o?r.getStylePropertyValue(o,e):void 0}r.applyBypass(this,e,t,false),this.emitAndNotify("style")}else if(void 0===e){var a=this[0];return a?r.getRawStyle(a):void 0}return this},removeStyle:function(e){var t=this.cy();if(!t.styleEnabled())return this;var n=t.style(),r=this;if(void 0===e)for(var i=0;i<r.length;i++){var o=r[i];n.removeAllBypasses(o,false)}else{e=e.split(/\s+/);for(var a=0;a<r.length;a++){var s=r[a];n.removeBypasses(s,e,false)}}return this.emitAndNotify("style"),this},show:function(){return this.css("display","element"),this},hide:function(){return this.css("display","none"),this},effectiveOpacity:function(){var e=this.cy();if(!e.styleEnabled())return 1;var t=e.hasCompoundNodes(),n=this[0];if(n){var r=n._private,i=n.pstyle("opacity").value;if(!t)return i;var o=r.data.parent?n.parents():null;if(o)for(var a=0;a<o.length;a++){i*=o[a].pstyle("opacity").value}return i}},transparent:function(){if(!this.cy().styleEnabled())return!1;var e=this[0],t=e.cy().hasCompoundNodes();return e?t?0===e.effectiveOpacity():0===e.pstyle("opacity").value:void 0},backgrounding:function(){return!!this.cy().styleEnabled()&&!!this[0]._private.backgrounding}};function ro(e,t){var n=e._private.data.parent?e.parents():null;if(n)for(var r=0;r<n.length;r++){if(!t(n[r]))return!1}return!0}function io(e){var t=e.ok,n=e.edgeOkViaNode||e.ok,r=e.parentOk||e.ok;return function(){var e=this.cy();if(!e.styleEnabled())return!0;var i=this[0],o=e.hasCompoundNodes();if(i){var a=i._private;if(!t(i))return!1;if(i.isNode())return!o||ro(i,r);var s=a.source,l=a.target;return n(s)&&(!o||ro(s,n))&&(s===l||n(l)&&(!o||ro(l,n)))}}}var oo=eo("eleTakesUpSpace",(function(e){return"element"===e.pstyle("display").value&&0!==e.width()&&(!e.isNode()||0!==e.height())}));no.takesUpSpace=to("takesUpSpace",io({ok:oo}));var ao=eo("eleInteractive",(function(e){return"yes"===e.pstyle("events").value&&"visible"===e.pstyle("visibility").value&&oo(e)})),so=eo("parentInteractive",(function(e){return"visible"===e.pstyle("visibility").value&&oo(e)}));no.interactive=to("interactive",io({ok:ao,parentOk:so,edgeOkViaNode:oo})),no.noninteractive=function(){var e=this[0];if(e)return!e.interactive()};var lo=eo("eleVisible",(function(e){return"visible"===e.pstyle("visibility").value&&0!==e.pstyle("opacity").pfValue&&oo(e)})),co=oo;no.visible=to("visible",io({ok:lo,edgeOkViaNode:co})),no.hidden=function(){var e=this[0];if(e)return!e.visible()},no.isBundledBezier=to("isBundledBezier",(function(){return!!this.cy().styleEnabled()&&(!this.removed()&&"bezier"===this.pstyle("curve-style").value&&this.takesUpSpace())})),no.bypass=no.css=no.style,no.renderedCss=no.renderedStyle,no.removeBypass=no.removeCss=no.removeStyle,no.pstyle=no.parsedStyle;var uo={};function ho(e){return function(){var t=arguments,n=[];if(2===t.length){var r=t[0],i=t[1];this.on(e.event,r,i)}else if(1===t.length&&T(t[0])){var o=t[0];this.on(e.event,o)}else if(0===t.length||1===t.length&&D(t[0])){for(var a=1===t.length?t[0]:null,s=0;s<this.length;s++){var l=this[s],c=!e.ableField||l._private[e.ableField],u=l._private[e.field]!=e.value;if(e.overrideAble){var d=e.overrideAble(l);if(void 0!==d&&(c=d,!d))return this}c&&(l._private[e.field]=e.value,u&&n.push(l))}var h=this.spawn(n);h.updateStyle(),h.emit(e.event),a&&h.emit(a)}return this}}function fo(e){uo[e.field]=function(){var t=this[0];if(t){if(e.overrideField){var n=e.overrideField(t);if(void 0!==n)return n}return t._private[e.field]}},uo[e.on]=ho({event:e.on,field:e.field,ableField:e.ableField,overrideAble:e.overrideAble,value:!0}),uo[e.off]=ho({event:e.off,field:e.field,ableField:e.ableField,overrideAble:e.overrideAble,value:!1})}fo({field:"locked",overrideField:function(e){return!!e.cy().autolock()||void 0},on:"lock",off:"unlock"}),fo({field:"grabbable",overrideField:function(e){return!e.cy().autoungrabify()&&!e.pannable()&&void 0},on:"grabify",off:"ungrabify"}),fo({field:"selected",ableField:"selectable",overrideAble:function(e){return!e.cy().autounselectify()&&void 0},on:"select",off:"unselect"}),fo({field:"selectable",overrideField:function(e){return!e.cy().autounselectify()&&void 0},on:"selectify",off:"unselectify"}),uo.deselect=uo.unselect,uo.grabbed=function(){var e=this[0];if(e)return e._private.grabbed},fo({field:"active",on:"activate",off:"unactivate"}),fo({field:"pannable",on:"panify",off:"unpanify"}),uo.inactive=function(){var e=this[0];if(e)return!e._private.active};var po={},vo=function(e){return function(t){for(var n=[],r=0;r<this.length;r++){var i=this[r];if(i.isNode()){for(var o=!1,a=i.connectedEdges(),s=0;s<a.length;s++){var l=a[s],c=l.source(),u=l.target();if(e.noIncomingEdges&&u===i&&c!==i||e.noOutgoingEdges&&c===i&&u!==i){o=!0;break}}o||n.push(i)}}return this.spawn(n,!0).filter(t)}},go=function(e){return function(t){for(var n=[],r=0;r<this.length;r++){var i=this[r];if(i.isNode())for(var o=i.connectedEdges(),a=0;a<o.length;a++){var s=o[a],l=s.source(),c=s.target();e.outgoing&&l===i?(n.push(s),n.push(c)):e.incoming&&c===i&&(n.push(s),n.push(l))}}return this.spawn(n,!0).filter(t)}},mo=function(e){return function(t){for(var n=this,r=[],i={};;){var o=e.outgoing?n.outgoers():n.incomers();if(0===o.length)break;for(var a=!1,s=0;s<o.length;s++){var l=o[s],c=l.id();i[c]||(i[c]=!0,r.push(l),a=!0)}if(!a)break;n=o}return this.spawn(r,!0).filter(t)}};function yo(e){return function(t){for(var n=[],r=0;r<this.length;r++){var i=this[r]._private[e.attr];i&&n.push(i)}return this.spawn(n,!0).filter(t)}}function bo(e){return function(t){var n=[],r=this._private.cy,i=e||{};C(t)&&(t=r.$(t));for(var o=0;o<t.length;o++)for(var a=t[o]._private.edges,s=0;s<a.length;s++){var l=a[s],c=l._private.data,u=this.hasElementWithId(c.source)&&t.hasElementWithId(c.target),d=t.hasElementWithId(c.source)&&this.hasElementWithId(c.target);if(u||d){if(i.thisIsSrc||i.thisIsTgt){if(i.thisIsSrc&&!u)continue;if(i.thisIsTgt&&!d)continue}n.push(l)}}return this.spawn(n,!0)}}function xo(e){return e=X({},{codirected:!1},e),function(t){for(var n=[],r=this.edges(),i=e,o=0;o<r.length;o++)for(var a=r[o]._private,s=a.source,l=s._private.data.id,c=a.data.target,u=s._private.edges,d=0;d<u.length;d++){var h=u[d],f=h._private.data,p=f.target,v=f.source,g=p===c&&v===l,m=l===p&&c===v;(i.codirected&&g||!i.codirected&&(g||m))&&n.push(h)}return this.spawn(n,!0).filter(t)}}po.clearTraversalCache=function(){for(var e=0;e<this.length;e++)this[e]._private.traversalCache=null},X(po,{roots:vo({noIncomingEdges:!0}),leaves:vo({noOutgoingEdges:!0}),outgoers:Xr(go({outgoing:!0}),"outgoers"),successors:mo({outgoing:!0}),incomers:Xr(go({incoming:!0}),"incomers"),predecessors:mo({incoming:!0})}),X(po,{neighborhood:Xr((function(e){for(var t=[],n=this.nodes(),r=0;r<n.length;r++)for(var i=n[r],o=i.connectedEdges(),a=0;a<o.length;a++){var s=o[a],l=s.source(),c=s.target(),u=i===l?c:l;u.length>0&&t.push(u[0]),t.push(s[0])}return this.spawn(t,!0).filter(e)}),"neighborhood"),closedNeighborhood:function(e){return this.neighborhood().add(this).filter(e)},openNeighborhood:function(e){return this.neighborhood(e)}}),po.neighbourhood=po.neighborhood,po.closedNeighbourhood=po.closedNeighborhood,po.openNeighbourhood=po.openNeighborhood,X(po,{source:Xr((function(e){var t,n=this[0];return n&&(t=n._private.source||n.cy().collection()),t&&e?t.filter(e):t}),"source"),target:Xr((function(e){var t,n=this[0];return n&&(t=n._private.target||n.cy().collection()),t&&e?t.filter(e):t}),"target"),sources:yo({attr:"source"}),targets:yo({attr:"target"})}),X(po,{edgesWith:Xr(bo(),"edgesWith"),edgesTo:Xr(bo({thisIsSrc:!0}),"edgesTo")}),X(po,{connectedEdges:Xr((function(e){for(var t=[],n=0;n<this.length;n++){var r=this[n];if(r.isNode())for(var i=r._private.edges,o=0;o<i.length;o++){var a=i[o];t.push(a)}}return this.spawn(t,!0).filter(e)}),"connectedEdges"),connectedNodes:Xr((function(e){for(var t=[],n=0;n<this.length;n++){var r=this[n];r.isEdge()&&(t.push(r.source()[0]),t.push(r.target()[0]))}return this.spawn(t,!0).filter(e)}),"connectedNodes"),parallelEdges:Xr(xo(),"parallelEdges"),codirectedEdges:Xr(xo({codirected:!0}),"codirectedEdges")}),X(po,{components:function(e){var t=this,n=t.cy(),r=n.collection(),i=null==e?t.nodes():e.nodes(),o=[];null!=e&&i.empty()&&(i=e.sources());var a=function(e,t){r.merge(e),i.unmerge(e),t.merge(e)};if(i.empty())return t.spawn();var s=function(){var e=n.collection();o.push(e);var r=i[0];a(r,e),t.bfs({directed:!1,roots:r,visit:function(t){return a(t,e)}}),e.forEach((function(n){n.connectedEdges().forEach((function(n){t.has(n)&&e.has(n.source())&&e.has(n.target())&&e.merge(n)}))}))};do{s()}while(i.length>0);return o},component:function(){var e=this[0];return e.cy().mutableElements().components(e)[0]}}),po.componentsOf=po.components;var wo=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(void 0!==e){var i=new Re,o=!1;if(t){if(t.length>0&&N(t[0])&&!R(t[0])){o=!0;for(var a=[],s=new Le,l=0,c=t.length;l<c;l++){var u=t[l];null==u.data&&(u.data={});var d=u.data;if(null==d.id)d.id=je();else if(e.hasElementWithId(d.id)||s.has(d.id))continue;var h=new Be(e,u,!1);a.push(h),s.add(d.id)}t=a}}else t=[];this.length=0;for(var f=0,p=t.length;f<p;f++){var v=t[f][0];if(null!=v){var g=v._private.data.id;n&&i.has(g)||(n&&i.set(g,{index:this.length,ele:v}),this[this.length]=v,this.length++)}}this._private={eles:this,cy:e,get map(){return null==this.lazyMap&&this.rebuildMap(),this.lazyMap},set map(e){this.lazyMap=e},rebuildMap:function(){for(var e=this.lazyMap=new Re,t=this.eles,n=0;n<t.length;n++){var r=t[n];e.set(r.id(),{index:n,ele:r})}}},n&&(this._private.map=i),o&&!r&&this.restore()}else _e("A collection must have a reference to the core")},Eo=Be.prototype=wo.prototype=Object.create(Array.prototype);Eo.instanceString=function(){return"collection"},Eo.spawn=function(e,t){return new wo(this.cy(),e,t)},Eo.spawnSelf=function(){return this.spawn(this)},Eo.cy=function(){return this._private.cy},Eo.renderer=function(){return this._private.cy.renderer()},Eo.element=function(){return this[0]},Eo.collection=function(){return I(this)?this:new wo(this._private.cy,[this])},Eo.unique=function(){return new wo(this._private.cy,this,!0)},Eo.hasElementWithId=function(e){return e=""+e,this._private.map.has(e)},Eo.getElementById=function(e){e=""+e;var t=this._private.cy,n=this._private.map.get(e);return n?n.ele:new wo(t)},Eo.$id=Eo.getElementById,Eo.poolIndex=function(){var e=this._private.cy._private.elements,t=this[0]._private.data.id;return e._private.map.get(t).index},Eo.indexOf=function(e){var t=e[0]._private.data.id;return this._private.map.get(t).index},Eo.indexOfId=function(e){return e=""+e,this._private.map.get(e).index},Eo.json=function(e){var t=this.element(),n=this.cy();if(null==t&&e)return this;if(null!=t){var r=t._private;if(N(e)){if(n.startBatch(),e.data){t.data(e.data);var i=r.data;if(t.isEdge()){var o=!1,a={},s=e.data.source,l=e.data.target;null!=s&&s!=i.source&&(a.source=""+s,o=!0),null!=l&&l!=i.target&&(a.target=""+l,o=!0),o&&(t=t.move(a))}else{var c="parent"in e.data,u=e.data.parent;!c||null==u&&null==i.parent||u==i.parent||(void 0===u&&(u=null),null!=u&&(u=""+u),t=t.move({parent:u}))}}e.position&&t.position(e.position);var d=function(n,i,o){var a=e[n];null!=a&&a!==r[n]&&(a?t[i]():t[o]())};return d("removed","remove","restore"),d("selected","select","unselect"),d("selectable","selectify","unselectify"),d("locked","lock","unlock"),d("grabbable","grabify","ungrabify"),d("pannable","panify","unpanify"),null!=e.classes&&t.classes(e.classes),n.endBatch(),this}if(void 0===e){var h={data:Pe(r.data),position:Pe(r.position),group:r.group,removed:r.removed,selected:r.selected,selectable:r.selectable,locked:r.locked,grabbable:r.grabbable,pannable:r.pannable,classes:(null,"")},f=0;return r.classes.forEach((function(e){return h.classes+=0==f++?e:" "+e})),h}}},Eo.jsons=function(){for(var e=[],t=0;t<this.length;t++){var n=this[t].json();e.push(n)}return e},Eo.clone=function(){for(var e=this.cy(),t=[],n=0;n<this.length;n++){var r=this[n].json(),i=new Be(e,r,!1);t.push(i)}return new wo(e,t)},Eo.copy=Eo.clone,Eo.restore=function(){for(var e,t,n=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=this,o=i.cy(),a=o._private,s=[],l=[],c=0,u=i.length;c<u;c++){var d=i[c];r&&!d.removed()||(d.isNode()?s.push(d):l.push(d))}e=s.concat(l);var h=function(){e.splice(t,1),t--};for(t=0;t<e.length;t++){var f=e[t],p=f._private,v=p.data;if(f.clearTraversalCache(),r||p.removed)if(void 0===v.id)v.id=je();else if(O(v.id))v.id=""+v.id;else{if(F(v.id)||!C(v.id)){_e("Can not create element with invalid string ID `"+v.id+"`"),h();continue}if(o.hasElementWithId(v.id)){_e("Can not create second element with ID `"+v.id+"`"),h();continue}}else;var g=v.id;if(f.isNode()){var m=p.position;null==m.x&&(m.x=0),null==m.y&&(m.y=0)}if(f.isEdge()){for(var y=f,b=["source","target"],x=b.length,w=!1,E=0;E<x;E++){var _=b[E],k=v[_];O(k)&&(k=v[_]=""+v[_]),null==k||""===k?(_e("Can not create edge `"+g+"` with unspecified "+_),w=!0):o.hasElementWithId(k)||(_e("Can not create edge `"+g+"` with nonexistant "+_+" `"+k+"`"),w=!0)}if(w){h();continue}var S=o.getElementById(v.source),P=o.getElementById(v.target);S.same(P)?S._private.edges.push(y):(S._private.edges.push(y),P._private.edges.push(y)),y._private.source=S,y._private.target=P}p.map=new Re,p.map.set(g,{ele:f,index:0}),p.removed=!1,r&&o.addToPool(f)}for(var j=0;j<s.length;j++){var T=s[j],D=T._private.data;O(D.parent)&&(D.parent=""+D.parent);var N=D.parent,M=null!=N;if(M||T._private.parent){var A=T._private.parent?o.collection().merge(T._private.parent):o.getElementById(N);if(A.empty())D.parent=void 0;else if(A[0].removed())Se("Node added with missing parent, reference to parent removed"),D.parent=void 0,T._private.parent=null;else{for(var R=!1,I=A;!I.empty();){if(T.same(I)){R=!0,D.parent=void 0;break}I=I.parent()}R||(A[0]._private.children.push(T),T._private.parent=A[0],a.hasCompoundNodes=!0)}}}if(e.length>0){for(var L=e.length===i.length?i:new wo(o,e),B=0;B<L.length;B++){var z=L[B];z.isNode()||(z.parallelEdges().clearTraversalCache(),z.source().clearTraversalCache(),z.target().clearTraversalCache())}(a.hasCompoundNodes?o.collection().merge(L).merge(L.connectedNodes()).merge(L.parent()):L).dirtyCompoundBoundsCache().dirtyBoundingBoxCache().updateStyle(n),n?L.emitAndNotify("add"):r&&L.emit("add")}return i},Eo.removed=function(){var e=this[0];return e&&e._private.removed},Eo.inside=function(){var e=this[0];return e&&!e._private.removed},Eo.remove=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this,r=[],i={},o=n._private.cy;function a(e){for(var t=e._private.edges,n=0;n<t.length;n++)l(t[n])}function s(e){for(var t=e._private.children,n=0;n<t.length;n++)l(t[n])}function l(e){var n=i[e.id()];t&&e.removed()||n||(i[e.id()]=!0,e.isNode()?(r.push(e),a(e),s(e)):r.unshift(e))}for(var c=0,u=n.length;c<u;c++){var d=n[c];l(d)}function h(e,t){var n=e._private.edges;Ne(n,t),e.clearTraversalCache()}function f(e){e.clearTraversalCache()}var p=[];function v(e,t){t=t[0];var n=(e=e[0])._private.children,r=e.id();Ne(n,t),t._private.parent=null,p.ids[r]||(p.ids[r]=!0,p.push(e))}p.ids={},n.dirtyCompoundBoundsCache(),t&&o.removeFromPool(r);for(var g=0;g<r.length;g++){var m=r[g];if(m.isEdge()){var y=m.source()[0],b=m.target()[0];h(y,m),h(b,m);for(var x=m.parallelEdges(),w=0;w<x.length;w++){var E=x[w];f(E),E.isBundledBezier()&&E.dirtyBoundingBoxCache()}}else{var _=m.parent();0!==_.length&&v(_,m)}t&&(m._private.removed=!0)}var k=o._private.elements;o._private.hasCompoundNodes=!1;for(var S=0;S<k.length;S++){var P=k[S];if(P.isParent()){o._private.hasCompoundNodes=!0;break}}var j=new wo(this.cy(),r);j.size()>0&&(e?j.emitAndNotify("remove"):t&&j.emit("remove"));for(var C=0;C<p.length;C++){var T=p[C];t&&T.removed()||T.updateStyle()}return j},Eo.move=function(e){var t=this._private.cy,n=this,r=!1,i=!1,o=function(e){return null==e?e:""+e};if(void 0!==e.source||void 0!==e.target){var a=o(e.source),s=o(e.target),l=null!=a&&t.hasElementWithId(a),c=null!=s&&t.hasElementWithId(s);(l||c)&&(t.batch((function(){n.remove(r,i),n.emitAndNotify("moveout");for(var e=0;e<n.length;e++){var t=n[e],o=t._private.data;t.isEdge()&&(l&&(o.source=a),c&&(o.target=s))}n.restore(r,i)})),n.emitAndNotify("move"))}else if(void 0!==e.parent){var u=o(e.parent);if(null===u||t.hasElementWithId(u)){var d=null===u?void 0:u;t.batch((function(){var e=n.remove(r,i);e.emitAndNotify("moveout");for(var t=0;t<n.length;t++){var o=n[t],a=o._private.data;o.isNode()&&(a.parent=d)}e.restore(r,i)})),n.emitAndNotify("move")}}return this},[Yn,ar,sr,qr,$r,ni,ri,Di,qi,Yi,{isNode:function(){return"nodes"===this.group()},isEdge:function(){return"edges"===this.group()},isLoop:function(){return this.isEdge()&&this.source()[0]===this.target()[0]},isSimple:function(){return this.isEdge()&&this.source()[0]!==this.target()[0]},group:function(){var e=this[0];if(e)return e._private.group}},$i,Qi,no,uo,po].forEach((function(e){X(Eo,e)}));var _o={add:function(e){var t,n=this;if(A(e)){var r=e;if(r._private.cy===n)t=r.restore();else{for(var i=[],o=0;o<r.length;o++){var a=r[o];i.push(a.json())}t=new wo(n,i)}}else if(D(e)){t=new wo(n,e)}else if(N(e)&&(D(e.nodes)||D(e.edges))){for(var s=e,l=[],c=["nodes","edges"],u=0,d=c.length;u<d;u++){var h=c[u],f=s[h];if(D(f))for(var p=0,v=f.length;p<v;p++){var g=X({group:h},f[p]);l.push(g)}}t=new wo(n,l)}else{t=new Be(n,e).collection()}return t},remove:function(e){if(A(e));else if(C(e)){var t=e;e=this.$(t)}return e.remove()}};var ko=function(){function e(e){return-e.tension*e.x-e.friction*e.v}function t(t,n,r){var i={x:t.x+r.dx*n,v:t.v+r.dv*n,tension:t.tension,friction:t.friction};return{dx:i.v,dv:e(i)}}function n(n,r){var i={dx:n.v,dv:e(n)},o=t(n,.5*r,i),a=t(n,.5*r,o),s=t(n,r,a),l=1/6*(i.dx+2*(o.dx+a.dx)+s.dx),c=1/6*(i.dv+2*(o.dv+a.dv)+s.dv);return n.x=n.x+l*r,n.v=n.v+c*r,n}return function e(t,r,i){var o,a,s,l={x:-1,v:0,tension:null,friction:null},c=[0],u=0,d=1e-4;for(t=parseFloat(t)||500,r=parseFloat(r)||20,i=i||null,l.tension=t,l.friction=r,a=(o=null!==i)?(u=e(t,r))/i*.016:.016;s=n(s||l,a),c.push(1+s.x),u+=16,Math.abs(s.x)>d&&Math.abs(s.v)>d;);return o?function(e){return c[e*(c.length-1)|0]}:u}}(),So=function(e,t,n,r){var i=function(e,t,n,r){var i=4,o=.001,a=1e-7,s=10,l=11,c=1/(l-1),u="undefined"!=typeof Float32Array;if(4!==arguments.length)return!1;for(var d=0;d<4;++d)if("number"!=typeof arguments[d]||isNaN(arguments[d])||!isFinite(arguments[d]))return!1;e=Math.min(e,1),n=Math.min(n,1),e=Math.max(e,0),n=Math.max(n,0);var h=u?new Float32Array(l):new Array(l);function f(e,t){return 1-3*t+3*e}function p(e,t){return 3*t-6*e}function v(e){return 3*e}function g(e,t,n){return((f(t,n)*e+p(t,n))*e+v(t))*e}function m(e,t,n){return 3*f(t,n)*e*e+2*p(t,n)*e+v(t)}function y(t,r){for(var o=0;o<i;++o){var a=m(r,e,n);if(0===a)return r;r-=(g(r,e,n)-t)/a}return r}function b(){for(var t=0;t<l;++t)h[t]=g(t*c,e,n)}function x(t,r,i){var o,l,c=0;do{(o=g(l=r+(i-r)/2,e,n)-t)>0?i=l:r=l}while(Math.abs(o)>a&&++c<s);return l}function w(t){for(var r=0,i=1,a=l-1;i!==a&&h[i]<=t;++i)r+=c;--i;var s=r+(t-h[i])/(h[i+1]-h[i])*c,u=m(s,e,n);return u>=o?y(t,s):0===u?s:x(t,r,r+c)}var E=!1;function _(){E=!0,e===t&&n===r||b()}var k=function(i){return E||_(),e===t&&n===r?i:0===i?0:1===i?1:g(w(i),t,r)};k.getControlPoints=function(){return[{x:e,y:t},{x:n,y:r}]};var S="generateBezier("+[e,t,n,r]+")";return k.toString=function(){return S},k}(e,t,n,r);return function(e,t,n){return e+(t-e)*i(n)}},Po={linear:function(e,t,n){return e+(t-e)*n},ease:So(.25,.1,.25,1),"ease-in":So(.42,0,1,1),"ease-out":So(0,0,.58,1),"ease-in-out":So(.42,0,.58,1),"ease-in-sine":So(.47,0,.745,.715),"ease-out-sine":So(.39,.575,.565,1),"ease-in-out-sine":So(.445,.05,.55,.95),"ease-in-quad":So(.55,.085,.68,.53),"ease-out-quad":So(.25,.46,.45,.94),"ease-in-out-quad":So(.455,.03,.515,.955),"ease-in-cubic":So(.55,.055,.675,.19),"ease-out-cubic":So(.215,.61,.355,1),"ease-in-out-cubic":So(.645,.045,.355,1),"ease-in-quart":So(.895,.03,.685,.22),"ease-out-quart":So(.165,.84,.44,1),"ease-in-out-quart":So(.77,0,.175,1),"ease-in-quint":So(.755,.05,.855,.06),"ease-out-quint":So(.23,1,.32,1),"ease-in-out-quint":So(.86,0,.07,1),"ease-in-expo":So(.95,.05,.795,.035),"ease-out-expo":So(.19,1,.22,1),"ease-in-out-expo":So(1,0,0,1),"ease-in-circ":So(.6,.04,.98,.335),"ease-out-circ":So(.075,.82,.165,1),"ease-in-out-circ":So(.785,.135,.15,.86),spring:function(e,t,n){if(0===n)return Po.linear;var r=ko(e,t,n);return function(e,t,n){return e+(t-e)*r(n)}},"cubic-bezier":So};function jo(e,t,n,r,i){if(1===r)return n;if(t===n)return n;var o=i(t,n,r);return null==e||((e.roundValue||e.color)&&(o=Math.round(o)),void 0!==e.min&&(o=Math.max(o,e.min)),void 0!==e.max&&(o=Math.min(o,e.max))),o}function Co(e,t){return null!=e.pfValue||null!=e.value?null==e.pfValue||null!=t&&"%"===t.type.units?e.value:e.pfValue:e}function To(e,t,n,r,i){var o=null!=i?i.type:null;n<0?n=0:n>1&&(n=1);var a=Co(e,i),s=Co(t,i);if(O(a)&&O(s))return jo(o,a,s,n,r);if(D(a)&&D(s)){for(var l=[],c=0;c<s.length;c++){var u=a[c],d=s[c];if(null!=u&&null!=d){var h=jo(o,u,d,n,r);l.push(h)}else l.push(d)}return l}}function Do(e,t,n,r){var i=!r,o=e._private,a=t._private,s=a.easing,l=a.startTime,c=(r?e:e.cy()).style();if(!a.easingImpl)if(null==s)a.easingImpl=Po.linear;else{var u,d,h;if(C(s))u=c.parse("transition-timing-function",s).value;else u=s;C(u)?(d=u,h=[]):(d=u[1],h=u.slice(2).map((function(e){return+e}))),h.length>0?("spring"===d&&h.push(a.duration),a.easingImpl=Po[d].apply(null,h)):a.easingImpl=Po[d]}var f,p=a.easingImpl;if(f=0===a.duration?1:(n-l)/a.duration,a.applying&&(f=a.progress),f<0?f=0:f>1&&(f=1),null==a.delay){var v=a.startPosition,g=a.position;if(g&&i&&!e.locked()){var m={};No(v.x,g.x)&&(m.x=To(v.x,g.x,f,p)),No(v.y,g.y)&&(m.y=To(v.y,g.y,f,p)),e.position(m)}var y=a.startPan,b=a.pan,x=o.pan,w=null!=b&&r;w&&(No(y.x,b.x)&&(x.x=To(y.x,b.x,f,p)),No(y.y,b.y)&&(x.y=To(y.y,b.y,f,p)),e.emit("pan"));var E=a.startZoom,_=a.zoom,k=null!=_&&r;k&&(No(E,_)&&(o.zoom=dt(o.minZoom,To(E,_,f,p),o.maxZoom)),e.emit("zoom")),(w||k)&&e.emit("viewport");var S=a.style;if(S&&S.length>0&&i){for(var P=0;P<S.length;P++){var j=S[P],T=j.name,D=j,N=a.startStyle[T],O=To(N,D,f,p,c.properties[N.name]);c.overrideBypass(e,T,O)}e.emit("style")}}return a.progress=f,f}function No(e,t){return null!=e&&null!=t&&(!(!O(e)||!O(t))||!(!e||!t))}function Oo(e,t,n,r){var i=t._private;i.started=!0,i.startTime=n-i.progress*i.duration}function Mo(e,t){var n=t._private.aniEles,r=[];function i(t,n){var i=t._private,o=i.animation.current,a=i.animation.queue,s=!1;if(0===o.length){var l=a.shift();l&&o.push(l)}for(var c=function(e){for(var t=e.length-1;t>=0;t--){(0,e[t])()}e.splice(0,e.length)},u=o.length-1;u>=0;u--){var d=o[u],h=d._private;h.stopped?(o.splice(u,1),h.hooked=!1,h.playing=!1,h.started=!1,c(h.frames)):(h.playing||h.applying)&&(h.playing&&h.applying&&(h.applying=!1),h.started||Oo(0,d,e),Do(t,d,e,n),h.applying&&(h.applying=!1),c(h.frames),null!=h.step&&h.step(e),d.completed()&&(o.splice(u,1),h.hooked=!1,h.playing=!1,h.started=!1,c(h.completes)),s=!0)}return n||0!==o.length||0!==a.length||r.push(t),s}for(var o=!1,a=0;a<n.length;a++){var s=i(n[a]);o=o||s}var l=i(t,!0);(o||l)&&(n.length>0?t.notify("draw",n):t.notify("draw")),n.unmerge(r),t.emit("step")}var Ao={animate:or.animate(),animation:or.animation(),animated:or.animated(),clearQueue:or.clearQueue(),delay:or.delay(),delayAnimation:or.delayAnimation(),stop:or.stop(),addToAnimationPool:function(e){this.styleEnabled()&&this._private.aniEles.merge(e)},stopAnimationLoop:function(){this._private.animationsRunning=!1},startAnimationLoop:function(){var e=this;if(e._private.animationsRunning=!0,e.styleEnabled()){var t=e.renderer();t&&t.beforeRender?t.beforeRender((function(t,n){Mo(n,e)}),t.beforeRenderPriorities.animations):function t(){e._private.animationsRunning&&ne((function(n){Mo(n,e),t()}))}()}}},Ro={qualifierCompare:function(e,t){return null==e||null==t?null==e&&null==t:e.sameText(t)},eventMatches:function(e,t,n){var r=t.qualifier;return null==r||e!==n.target&&R(n.target)&&r.matches(n.target)},addEventFields:function(e,t){t.cy=e,t.target=e},callbackContext:function(e,t,n){return null!=t.qualifier?n.target:e}},Io=function(e){return C(e)?new Hr(e):e},Lo={createEmitter:function(){var e=this._private;return e.emitter||(e.emitter=new Bi(Ro,this)),this},emitter:function(){return this._private.emitter},on:function(e,t,n){return this.emitter().on(e,Io(t),n),this},removeListener:function(e,t,n){return this.emitter().removeListener(e,Io(t),n),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,t,n){return this.emitter().one(e,Io(t),n),this},once:function(e,t,n){return this.emitter().one(e,Io(t),n),this},emit:function(e,t){return this.emitter().emit(e,t),this},emitAndNotify:function(e,t){return this.emit(e),this.notify(e,t),this}};or.eventAliasesOn(Lo);var Bo={png:function(e){return e=e||{},this._private.renderer.png(e)},jpg:function(e){var t=this._private.renderer;return(e=e||{}).bg=e.bg||"#fff",t.jpg(e)}};Bo.jpeg=Bo.jpg;var Fo={layout:function(e){var t=this;if(null!=e)if(null!=e.name){var n=e.name,r=t.extension("layout",n);if(null!=r){var i;i=C(e.eles)?t.$(e.eles):null!=e.eles?e.eles:t.$();var o=new r(X({},e,{cy:t,eles:i}));return o}_e("No such layout `"+n+"` found. Did you forget to import it and `cytoscape.use()` it?")}else _e("A `name` must be specified to make a layout");else _e("Layout options must be specified to make a layout")}};Fo.createLayout=Fo.makeLayout=Fo.layout;var zo={notify:function(e,t){var n=this._private;if(this.batching()){n.batchNotifications=n.batchNotifications||{};var r=n.batchNotifications[e]=n.batchNotifications[e]||this.collection();null!=t&&r.merge(t)}else if(n.notificationsEnabled){var i=this.renderer();!this.destroyed()&&i&&i.notify(e,t)}},notifications:function(e){var t=this._private;return void 0===e?t.notificationsEnabled:(t.notificationsEnabled=!!e,this)},noNotifications:function(e){this.notifications(!1),e(),this.notifications(!0)},batching:function(){return this._private.batchCount>0},startBatch:function(){var e=this._private;return null==e.batchCount&&(e.batchCount=0),0===e.batchCount&&(e.batchStyleEles=this.collection(),e.batchNotifications={}),e.batchCount++,this},endBatch:function(){var e=this._private;if(0===e.batchCount)return this;if(e.batchCount--,0===e.batchCount){e.batchStyleEles.updateStyle();var t=this.renderer();Object.keys(e.batchNotifications).forEach((function(n){var r=e.batchNotifications[n];r.empty()?t.notify(n):t.notify(n,r)}))}return this},batch:function(e){return this.startBatch(),e(),this.endBatch(),this},batchData:function(e){var t=this;return this.batch((function(){for(var n=Object.keys(e),r=0;r<n.length;r++){var i=n[r],o=e[i];t.getElementById(i).data(o)}}))}},Vo=De({hideEdgesOnViewport:!1,textureOnViewport:!1,motionBlur:!1,motionBlurOpacity:.05,pixelRatio:void 0,desktopTapThreshold:4,touchTapThreshold:8,wheelSensitivity:1,debug:!1,showFps:!1}),Go={renderTo:function(e,t,n,r){return this._private.renderer.renderTo(e,t,n,r),this},renderer:function(){return this._private.renderer},forceRender:function(){return this.notify("draw"),this},resize:function(){return this.invalidateSize(),this.emitAndNotify("resize"),this},initRenderer:function(e){var t=this,n=t.extension("renderer",e.name);if(null!=n){void 0!==e.wheelSensitivity&&Se("You have set a custom wheel sensitivity. This will make your app zoom unnaturally when using mainstream mice. You should change this value from the default only if you can guarantee that all your users will use the same hardware and OS configuration as your current machine.");var r=Vo(e);r.cy=t,t._private.renderer=new n(r),this.notify("init")}else _e("Can not initialise: No such renderer `".concat(e.name,"` found. Did you forget to import it and `cytoscape.use()` it?"))},destroyRenderer:function(){var e=this;e.notify("destroy");var t=e.container();if(t)for(t._cyreg=null;t.childNodes.length>0;)t.removeChild(t.childNodes[0]);e._private.renderer=null,e.mutableElements().forEach((function(e){var t=e._private;t.rscratch={},t.rstyle={},t.animation.current=[],t.animation.queue=[]}))},onRender:function(e){return this.on("render",e)},offRender:function(e){return this.off("render",e)}};Go.invalidateDimensions=Go.resize;var Ho={collection:function(e,t){return C(e)?this.$(e):A(e)?e.collection():D(e)?(t||(t={}),new wo(this,e,t.unique,t.removed)):new wo(this)},nodes:function(e){var t=this.$((function(e){return e.isNode()}));return e?t.filter(e):t},edges:function(e){var t=this.$((function(e){return e.isEdge()}));return e?t.filter(e):t},$:function(e){var t=this._private.elements;return e?t.filter(e):t.spawnSelf()},mutableElements:function(){return this._private.elements}};Ho.elements=Ho.filter=Ho.$;var Wo={},qo="t";Wo.apply=function(e){for(var t=this,n=t._private.cy.collection(),r=0;r<e.length;r++){var i=e[r],o=t.getContextMeta(i);if(!o.empty){var a=t.getContextStyle(o),s=t.applyContextStyle(o,a,i);i._private.appliedInitStyle?t.updateTransitions(i,s.diffProps):i._private.appliedInitStyle=!0,t.updateStyleHints(i)&&n.push(i)}}return n},Wo.getPropertiesDiff=function(e,t){var n=this,r=n._private.propDiffs=n._private.propDiffs||{},i=e+"-"+t,o=r[i];if(o)return o;for(var a=[],s={},l=0;l<n.length;l++){var c=n[l],u=e[l]===qo,d=t[l]===qo,h=u!==d,f=c.mappedProperties.length>0;if(h||d&&f){var p=void 0;h&&f||h?p=c.properties:f&&(p=c.mappedProperties);for(var v=0;v<p.length;v++){for(var g=p[v],m=g.name,y=!1,b=l+1;b<n.length;b++){var x=n[b];if(t[b]===qo&&(y=null!=x.properties[g.name]))break}s[m]||y||(s[m]=!0,a.push(m))}}}return r[i]=a,a},Wo.getContextMeta=function(e){for(var t,n=this,r="",i=e._private.styleCxtKey||"",o=0;o<n.length;o++){var a=n[o];r+=a.selector&&a.selector.matches(e)?qo:"f"}return t=n.getPropertiesDiff(i,r),e._private.styleCxtKey=r,{key:r,diffPropNames:t,empty:0===t.length}},Wo.getContextStyle=function(e){var t=e.key,n=this._private.contextStyles=this._private.contextStyles||{};if(n[t])return n[t];for(var r={_private:{key:t}},i=0;i<this.length;i++){var o=this[i];if(t[i]===qo)for(var a=0;a<o.properties.length;a++){var s=o.properties[a];r[s.name]=s}}return n[t]=r,r},Wo.applyContextStyle=function(e,t,n){for(var r=e.diffPropNames,i={},o=this.types,a=0;a<r.length;a++){var s=r[a],l=t[s],c=n.pstyle(s);if(!l){if(!c)continue;l=c.bypass?{name:s,deleteBypassed:!0}:{name:s,delete:!0}}if(c!==l){if(l.mapped===o.fn&&null!=c&&null!=c.mapping&&c.mapping.value===l.value){var u=c.mapping;if((u.fnValue=l.value(n))===u.prevFnValue)continue}var d=i[s]={prev:c};this.applyParsedProperty(n,l),d.next=n.pstyle(s),d.next&&d.next.bypass&&(d.next=d.next.bypassed)}}return{diffProps:i}},Wo.updateStyleHints=function(e){var t=e._private,n=this,r=n.propertyGroupNames,i=n.propertyGroupKeys,o=function(e,t,r){return n.getPropertiesHash(e,t,r)},a=t.styleKey;if(e.removed())return!1;var s="nodes"===t.group,l=e._private.style;r=Object.keys(l);for(var c=0;c<i.length;c++){var u=i[c];t.styleKeys[u]=[ie,ae]}for(var d,h=function(e,n){return t.styleKeys[n][0]=le(e,t.styleKeys[n][0])},f=function(e,n){return t.styleKeys[n][1]=ce(e,t.styleKeys[n][1])},p=function(e,t){h(e,t),f(e,t)},v=function(e,t){for(var n=0;n<e.length;n++){var r=e.charCodeAt(n);h(r,t),f(r,t)}},g=0;g<r.length;g++){var m=r[g],y=l[m];if(null!=y){var b=this.properties[m],x=b.type,w=b.groupKey,E=void 0;null!=b.hashOverride?E=b.hashOverride(e,y):null!=y.pfValue&&(E=y.pfValue);var _=null==b.enums?y.value:null,k=null!=E,S=k||null!=_,P=y.units;if(x.number&&S&&!x.multiple)p(-128<(d=k?E:_)&&d<128&&Math.floor(d)!==d?2e9-(1024*d|0):d,w),k||null==P||v(P,w);else v(y.strValue,w)}}for(var j,C,T=[ie,ae],D=0;D<i.length;D++){var N=i[D],O=t.styleKeys[N];T[0]=le(O[0],T[0]),T[1]=ce(O[1],T[1])}t.styleKey=(j=T[0],C=T[1],2097152*j+C);var M=t.styleKeys;t.labelDimsKey=ue(M.labelDimensions);var A=o(e,["label"],M.labelDimensions);if(t.labelKey=ue(A),t.labelStyleKey=ue(de(M.commonLabel,A)),!s){var R=o(e,["source-label"],M.labelDimensions);t.sourceLabelKey=ue(R),t.sourceLabelStyleKey=ue(de(M.commonLabel,R));var I=o(e,["target-label"],M.labelDimensions);t.targetLabelKey=ue(I),t.targetLabelStyleKey=ue(de(M.commonLabel,I))}if(s){var L=t.styleKeys,B=L.nodeBody,F=L.nodeBorder,z=L.backgroundImage,V=L.compound,G=L.pie,H=[B,F,z,V,G].filter((function(e){return null!=e})).reduce(de,[ie,ae]);t.nodeKey=ue(H),t.hasPie=null!=G&&G[0]!==ie&&G[1]!==ae}return a!==t.styleKey},Wo.clearStyleHints=function(e){var t=e._private;t.styleCxtKey="",t.styleKeys={},t.styleKey=null,t.labelKey=null,t.labelStyleKey=null,t.sourceLabelKey=null,t.sourceLabelStyleKey=null,t.targetLabelKey=null,t.targetLabelStyleKey=null,t.nodeKey=null,t.hasPie=null},Wo.applyParsedProperty=function(e,t){var n,r=this,i=t,o=e._private.style,a=r.types,s=r.properties[i.name].type,l=i.bypass,c=o[i.name],u=c&&c.bypass,d=e._private,h="mapping",f=function(e){return null==e?null:null!=e.pfValue?e.pfValue:e.value},p=function(){var t=f(c),n=f(i);r.checkTriggers(e,i.name,t,n)};if(i&&"pie"===i.name.substr(0,3)&&Se("The pie style properties are deprecated. Create charts using background images instead."),"curve-style"===t.name&&e.isEdge()&&("bezier"!==t.value&&e.isLoop()||"haystack"===t.value&&(e.source().isParent()||e.target().isParent()))&&(i=t=this.parse(t.name,"bezier",l)),i.delete)return o[i.name]=void 0,p(),!0;if(i.deleteBypassed)return c?!!c.bypass&&(c.bypassed=void 0,p(),!0):(p(),!0);if(i.deleteBypass)return c?!!c.bypass&&(o[i.name]=c.bypassed,p(),!0):(p(),!0);var v=function(){Se("Do not assign mappings to elements without corresponding data (i.e. ele `"+e.id()+"` has no mapping for property `"+i.name+"` with data field `"+i.field+"`); try a `["+i.field+"]` selector to limit scope to elements with `"+i.field+"` defined")};switch(i.mapped){case a.mapData:for(var g,m=i.field.split("."),y=d.data,b=0;b<m.length&&y;b++){y=y[m[b]]}if(null==y)return v(),!1;if(!O(y))return Se("Do not use continuous mappers without specifying numeric data (i.e. `"+i.field+": "+y+"` for `"+e.id()+"` is non-numeric)"),!1;var x=i.fieldMax-i.fieldMin;if((g=0===x?0:(y-i.fieldMin)/x)<0?g=0:g>1&&(g=1),s.color){var w=i.valueMin[0],E=i.valueMax[0],_=i.valueMin[1],k=i.valueMax[1],S=i.valueMin[2],P=i.valueMax[2],j=null==i.valueMin[3]?1:i.valueMin[3],C=null==i.valueMax[3]?1:i.valueMax[3],T=[Math.round(w+(E-w)*g),Math.round(_+(k-_)*g),Math.round(S+(P-S)*g),Math.round(j+(C-j)*g)];n={bypass:i.bypass,name:i.name,value:T,strValue:"rgb("+T[0]+", "+T[1]+", "+T[2]+")"}}else{if(!s.number)return!1;var D=i.valueMin+(i.valueMax-i.valueMin)*g;n=this.parse(i.name,D,i.bypass,h)}if(!n)return v(),!1;n.mapping=i,i=n;break;case a.data:for(var N=i.field.split("."),M=d.data,A=0;A<N.length&&M;A++){M=M[N[A]]}if(null!=M&&(n=this.parse(i.name,M,i.bypass,h)),!n)return v(),!1;n.mapping=i,i=n;break;case a.fn:var R=i.value,I=null!=i.fnValue?i.fnValue:R(e);if(i.prevFnValue=I,null==I)return Se("Custom function mappers may not return null (i.e. `"+i.name+"` for ele `"+e.id()+"` is null)"),!1;if(!(n=this.parse(i.name,I,i.bypass,h)))return Se("Custom function mappers may not return invalid values for the property type (i.e. `"+i.name+"` for ele `"+e.id()+"` is invalid)"),!1;n.mapping=Pe(i),i=n;break;case void 0:break;default:return!1}return l?(i.bypassed=u?c.bypassed:c,o[i.name]=i):u?c.bypassed=i:o[i.name]=i,p(),!0},Wo.cleanElements=function(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(this.clearStyleHints(r),r.dirtyCompoundBoundsCache(),r.dirtyBoundingBoxCache(),t)for(var i=r._private.style,o=Object.keys(i),a=0;a<o.length;a++){var s=o[a],l=i[s];null!=l&&(l.bypass?l.bypassed=null:i[s]=null)}else r._private.style={}}},Wo.update=function(){this._private.cy.mutableElements().updateStyle()},Wo.updateTransitions=function(e,t){var n=this,r=e._private,i=e.pstyle("transition-property").value,o=e.pstyle("transition-duration").pfValue,a=e.pstyle("transition-delay").pfValue;if(i.length>0&&o>0){for(var s={},l=!1,c=0;c<i.length;c++){var u=i[c],d=e.pstyle(u),h=t[u];if(h){var f=h.prev,p=null!=h.next?h.next:d,v=!1,g=void 0,m=1e-6;f&&(O(f.pfValue)&&O(p.pfValue)?(v=p.pfValue-f.pfValue,g=f.pfValue+m*v):O(f.value)&&O(p.value)?(v=p.value-f.value,g=f.value+m*v):D(f.value)&&D(p.value)&&(v=f.value[0]!==p.value[0]||f.value[1]!==p.value[1]||f.value[2]!==p.value[2],g=f.strValue),v&&(s[u]=p.strValue,this.applyBypass(e,u,g),l=!0))}}if(!l)return;r.transitioning=!0,new Jn((function(t){a>0?e.delayAnimation(a).play().promise().then(t):t()})).then((function(){return e.animation({style:s,duration:o,easing:e.pstyle("transition-timing-function").value,queue:!1}).play().promise()})).then((function(){n.removeBypasses(e,i),e.emitAndNotify("style"),r.transitioning=!1}))}else r.transitioning&&(this.removeBypasses(e,i),e.emitAndNotify("style"),r.transitioning=!1)},Wo.checkTrigger=function(e,t,n,r,i,o){var a=this.properties[t],s=i(a);null!=s&&s(n,r)&&o(a)},Wo.checkZOrderTrigger=function(e,t,n,r){var i=this;this.checkTrigger(e,t,n,r,(function(e){return e.triggersZOrder}),(function(){i._private.cy.notify("zorder",e)}))},Wo.checkBoundsTrigger=function(e,t,n,r){this.checkTrigger(e,t,n,r,(function(e){return e.triggersBounds}),(function(i){e.dirtyCompoundBoundsCache(),e.dirtyBoundingBoxCache(),!i.triggersBoundsOfParallelBeziers||("curve-style"!==t||"bezier"!==n&&"bezier"!==r)&&("display"!==t||"none"!==n&&"none"!==r)||e.parallelEdges().forEach((function(e){e.isBundledBezier()&&e.dirtyBoundingBoxCache()}))}))},Wo.checkTriggers=function(e,t,n,r){e.dirtyStyleCache(),this.checkZOrderTrigger(e,t,n,r),this.checkBoundsTrigger(e,t,n,r)};var Yo={applyBypass:function(e,t,n,r){var i=[];if("*"===t||"**"===t){if(void 0!==n)for(var o=0;o<this.properties.length;o++){var a=this.properties[o].name,s=this.parse(a,n,!0);s&&i.push(s)}}else if(C(t)){var l=this.parse(t,n,!0);l&&i.push(l)}else{if(!N(t))return!1;var c=t;r=n;for(var u=Object.keys(c),d=0;d<u.length;d++){var h=u[d],f=c[h];if(void 0===f&&(f=c[H(h)]),void 0!==f){var p=this.parse(h,f,!0);p&&i.push(p)}}}if(0===i.length)return!1;for(var v=!1,g=0;g<e.length;g++){for(var m=e[g],y={},b=void 0,x=0;x<i.length;x++){var w=i[x];if(r){var E=m.pstyle(w.name);b=y[w.name]={prev:E}}v=this.applyParsedProperty(m,Pe(w))||v,r&&(b.next=m.pstyle(w.name))}v&&this.updateStyleHints(m),r&&this.updateTransitions(m,y,true)}return v},overrideBypass:function(e,t,n){t=G(t);for(var r=0;r<e.length;r++){var i=e[r],o=i._private.style[t],a=this.properties[t].type,s=a.color,l=a.mutiple,c=o?null!=o.pfValue?o.pfValue:o.value:null;o&&o.bypass?(o.value=n,null!=o.pfValue&&(o.pfValue=n),o.strValue=s?"rgb("+n.join(",")+")":l?n.join(" "):""+n,this.updateStyleHints(i)):this.applyBypass(i,t,n),this.checkTriggers(i,t,c,n)}},removeAllBypasses:function(e,t){return this.removeBypasses(e,this.propertyNames,t)},removeBypasses:function(e,t,n){for(var r=0;r<e.length;r++){for(var i=e[r],o={},a=0;a<t.length;a++){var s=t[a],l=this.properties[s],c=i.pstyle(l.name);if(c&&c.bypass){var u=this.parse(s,"",!0),d=o[l.name]={prev:c};this.applyParsedProperty(i,u),d.next=i.pstyle(l.name)}}this.updateStyleHints(i),n&&this.updateTransitions(i,o,true)}}},Uo={getEmSizeInPixels:function(){var e=this.containerCss("font-size");return null!=e?parseFloat(e):1},containerCss:function(e){var t=this._private.cy.container();if(w&&t&&w.getComputedStyle)return w.getComputedStyle(t).getPropertyValue(e)}},Xo={getRenderedStyle:function(e,t){return t?this.getStylePropertyValue(e,t,!0):this.getRawStyle(e,!0)},getRawStyle:function(e,t){var n=this;if(e=e[0]){for(var r={},i=0;i<n.properties.length;i++){var o=n.properties[i],a=n.getStylePropertyValue(e,o.name,t);null!=a&&(r[o.name]=a,r[H(o.name)]=a)}return r}},getIndexedStyle:function(e,t,n,r){var i=e.pstyle(t)[n][r];return null!=i?i:e.cy().style().getDefaultProperty(t)[n][0]},getStylePropertyValue:function(e,t,n){if(e=e[0]){var r=this.properties[t];r.alias&&(r=r.pointsTo);var i=r.type,o=e.pstyle(r.name);if(o){var a=o.value,s=o.units,l=o.strValue;if(n&&i.number&&null!=a&&O(a)){var c=e.cy().zoom(),u=function(e){return e*c},d=function(e,t){return u(e)+t},h=D(a);return(h?s.every((function(e){return null!=e})):null!=s)?h?a.map((function(e,t){return d(e,s[t])})).join(" "):d(a,s):h?a.map((function(e){return C(e)?e:""+u(e)})).join(" "):""+u(a)}if(null!=l)return l}return null}},getAnimationStartStyle:function(e,t){for(var n={},r=0;r<t.length;r++){var i=t[r].name,o=e.pstyle(i);void 0!==o&&(o=N(o)?this.parse(i,o.strValue):this.parse(i,o)),o&&(n[i]=o)}return n},getPropsList:function(e){var t=[],n=e,r=this.properties;if(n)for(var i=Object.keys(n),o=0;o<i.length;o++){var a=i[o],s=n[a],l=r[a]||r[G(a)],c=this.parse(l.name,s);c&&t.push(c)}return t},getNonDefaultPropertiesHash:function(e,t,n){var r,i,o,a,s,l,c=n.slice();for(s=0;s<t.length;s++)if(r=t[s],null!=(i=e.pstyle(r,!1)))if(null!=i.pfValue)c[0]=le(a,c[0]),c[1]=ce(a,c[1]);else for(o=i.strValue,l=0;l<o.length;l++)a=o.charCodeAt(l),c[0]=le(a,c[0]),c[1]=ce(a,c[1]);return c}};Xo.getPropertiesHash=Xo.getNonDefaultPropertiesHash;var $o={appendFromJson:function(e){for(var t=this,n=0;n<e.length;n++){var r=e[n],i=r.selector,o=r.style||r.css,a=Object.keys(o);t.selector(i);for(var s=0;s<a.length;s++){var l=a[s],c=o[l];t.css(l,c)}}return t},fromJson:function(e){var t=this;return t.resetToDefault(),t.appendFromJson(e),t},json:function(){for(var e=[],t=this.defaultLength;t<this.length;t++){for(var n=this[t],r=n.selector,i=n.properties,o={},a=0;a<i.length;a++){var s=i[a];o[s.name]=s.strValue}e.push({selector:r?r.toString():"core",style:o})}return e}},Ko={appendFromString:function(e){var t,n,r,i=this,o=""+e;function a(){o=o.length>t.length?o.substr(t.length):""}function s(){n=n.length>r.length?n.substr(r.length):""}for(o=o.replace(/[/][*](\s|.)+?[*][/]/g,"");;){if(o.match(/^\s*$/))break;var l=o.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!l){Se("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+o);break}t=l[0];var c=l[1];if("core"!==c)if(new Hr(c).invalid){Se("Skipping parsing of block: Invalid selector found in string stylesheet: "+c),a();continue}var u=l[2],d=!1;n=u;for(var h=[];;){if(n.match(/^\s*$/))break;var f=n.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!f){Se("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+u),d=!0;break}r=f[0];var p=f[1],v=f[2];if(this.properties[p])i.parse(p,v)?(h.push({name:p,val:v}),s()):(Se("Skipping property: Invalid property definition in: "+r),s());else Se("Skipping property: Invalid property name in: "+r),s()}if(d){a();break}i.selector(c);for(var g=0;g<h.length;g++){var m=h[g];i.css(m.name,m.val)}a()}return i},fromString:function(e){var t=this;return t.resetToDefault(),t.appendFromString(e),t}},Zo={};!function(){var e=Y,t=function(e){return"^"+e+"\\s*\\(\\s*([\\w\\.]+)\\s*\\)$"},n=function(t){var n=e+"|\\w+|rgb[a]?\\((?:(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))[%]?)\\s*,\\s*(?:(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))[%]?)\\s*,\\s*(?:(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))[%]?)(?:\\s*,\\s*(?:(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))))?\\)|hsl[a]?\\((?:(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?)))\\s*,\\s*(?:(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))[%])\\s*,\\s*(?:(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))[%])(?:\\s*,\\s*(?:(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))))?\\)|\\#[0-9a-fA-F]{3}|\\#[0-9a-fA-F]{6}";return"^"+t+"\\s*\\(([\\w\\.]+)\\s*\\,\\s*("+e+")\\s*\\,\\s*("+e+")\\s*,\\s*("+n+")\\s*\\,\\s*("+n+")\\)$"},r=["^url\\s*\\(\\s*['\"]?(.+?)['\"]?\\s*\\)$","^(none)$","^(.+)$"];Zo.types={time:{number:!0,min:0,units:"s|ms",implicitUnits:"ms"},percent:{number:!0,min:0,max:100,units:"%",implicitUnits:"%"},percentages:{number:!0,min:0,max:100,units:"%",implicitUnits:"%",multiple:!0},zeroOneNumber:{number:!0,min:0,max:1,unitless:!0},zeroOneNumbers:{number:!0,min:0,max:1,unitless:!0,multiple:!0},nOneOneNumber:{number:!0,min:-1,max:1,unitless:!0},nonNegativeInt:{number:!0,min:0,integer:!0,unitless:!0},position:{enums:["parent","origin"]},nodeSize:{number:!0,min:0,enums:["label"]},number:{number:!0,unitless:!0},numbers:{number:!0,unitless:!0,multiple:!0},positiveNumber:{number:!0,unitless:!0,min:0,strictMin:!0},size:{number:!0,min:0},bidirectionalSize:{number:!0},bidirectionalSizeMaybePercent:{number:!0,allowPercent:!0},bidirectionalSizes:{number:!0,multiple:!0},sizeMaybePercent:{number:!0,min:0,allowPercent:!0},axisDirection:{enums:["horizontal","leftward","rightward","vertical","upward","downward","auto"]},paddingRelativeTo:{enums:["width","height","average","min","max"]},bgWH:{number:!0,min:0,allowPercent:!0,enums:["auto"],multiple:!0},bgPos:{number:!0,allowPercent:!0,multiple:!0},bgRelativeTo:{enums:["inner","include-padding"],multiple:!0},bgRepeat:{enums:["repeat","repeat-x","repeat-y","no-repeat"],multiple:!0},bgFit:{enums:["none","contain","cover"],multiple:!0},bgCrossOrigin:{enums:["anonymous","use-credentials"],multiple:!0},bgClip:{enums:["none","node"],multiple:!0},bgContainment:{enums:["inside","over"],multiple:!0},color:{color:!0},colors:{color:!0,multiple:!0},fill:{enums:["solid","linear-gradient","radial-gradient"]},bool:{enums:["yes","no"]},bools:{enums:["yes","no"],multiple:!0},lineStyle:{enums:["solid","dotted","dashed"]},lineCap:{enums:["butt","round","square"]},borderStyle:{enums:["solid","dotted","dashed","double"]},curveStyle:{enums:["bezier","unbundled-bezier","haystack","segments","straight","straight-triangle","taxi"]},fontFamily:{regex:'^([\\w- \\"]+(?:\\s*,\\s*[\\w- \\"]+)*)$'},fontStyle:{enums:["italic","normal","oblique"]},fontWeight:{enums:["normal","bold","bolder","lighter","100","200","300","400","500","600","800","900",100,200,300,400,500,600,700,800,900]},textDecoration:{enums:["none","underline","overline","line-through"]},textTransform:{enums:["none","uppercase","lowercase"]},textWrap:{enums:["none","wrap","ellipsis"]},textOverflowWrap:{enums:["whitespace","anywhere"]},textBackgroundShape:{enums:["rectangle","roundrectangle","round-rectangle"]},nodeShape:{enums:["rectangle","roundrectangle","round-rectangle","cutrectangle","cut-rectangle","bottomroundrectangle","bottom-round-rectangle","barrel","ellipse","triangle","round-triangle","square","pentagon","round-pentagon","hexagon","round-hexagon","concavehexagon","concave-hexagon","heptagon","round-heptagon","octagon","round-octagon","tag","round-tag","star","diamond","round-diamond","vee","rhomboid","polygon"]},overlayShape:{enums:["roundrectangle","round-rectangle","ellipse"]},compoundIncludeLabels:{enums:["include","exclude"]},arrowShape:{enums:["tee","triangle","triangle-tee","circle-triangle","triangle-cross","triangle-backcurve","vee","square","circle","diamond","chevron","none"]},arrowFill:{enums:["filled","hollow"]},display:{enums:["element","none"]},visibility:{enums:["hidden","visible"]},zCompoundDepth:{enums:["bottom","orphan","auto","top"]},zIndexCompare:{enums:["auto","manual"]},valign:{enums:["top","center","bottom"]},halign:{enums:["left","center","right"]},justification:{enums:["left","center","right","auto"]},text:{string:!0},data:{mapping:!0,regex:t("data")},layoutData:{mapping:!0,regex:t("layoutData")},scratch:{mapping:!0,regex:t("scratch")},mapData:{mapping:!0,regex:n("mapData")},mapLayoutData:{mapping:!0,regex:n("mapLayoutData")},mapScratch:{mapping:!0,regex:n("mapScratch")},fn:{mapping:!0,fn:!0},url:{regexes:r,singleRegexMatchValue:!0},urls:{regexes:r,singleRegexMatchValue:!0,multiple:!0},propList:{propList:!0},angle:{number:!0,units:"deg|rad",implicitUnits:"rad"},textRotation:{number:!0,units:"deg|rad",implicitUnits:"rad",enums:["none","autorotate"]},polygonPointList:{number:!0,multiple:!0,evenMultiple:!0,min:-1,max:1,unitless:!0},edgeDistances:{enums:["intersection","node-position"]},edgeEndpoint:{number:!0,multiple:!0,units:"%|px|em|deg|rad",implicitUnits:"px",enums:["inside-to-node","outside-to-node","outside-to-node-or-label","outside-to-line","outside-to-line-or-label"],singleEnum:!0,validate:function(e,t){switch(e.length){case 2:return"deg"!==t[0]&&"rad"!==t[0]&&"deg"!==t[1]&&"rad"!==t[1];case 1:return C(e[0])||"deg"===t[0]||"rad"===t[0];default:return!1}}},easing:{regexes:["^(spring)\\s*\\(\\s*("+e+")\\s*,\\s*("+e+")\\s*\\)$","^(cubic-bezier)\\s*\\(\\s*("+e+")\\s*,\\s*("+e+")\\s*,\\s*("+e+")\\s*,\\s*("+e+")\\s*\\)$"],enums:["linear","ease","ease-in","ease-out","ease-in-out","ease-in-sine","ease-out-sine","ease-in-out-sine","ease-in-quad","ease-out-quad","ease-in-out-quad","ease-in-cubic","ease-out-cubic","ease-in-out-cubic","ease-in-quart","ease-out-quart","ease-in-out-quart","ease-in-quint","ease-out-quint","ease-in-out-quint","ease-in-expo","ease-out-expo","ease-in-out-expo","ease-in-circ","ease-out-circ","ease-in-out-circ"]},gradientDirection:{enums:["to-bottom","to-top","to-left","to-right","to-bottom-right","to-bottom-left","to-top-right","to-top-left","to-right-bottom","to-left-bottom","to-right-top","to-left-top"]},boundsExpansion:{number:!0,multiple:!0,min:0,validate:function(e){var t=e.length;return 1===t||2===t||4===t}}};var i={zeroNonZero:function(e,t){return(null==e||null==t)&&e!==t||(0==e&&0!=t||0!=e&&0==t)},any:function(e,t){return e!=t},emptyNonEmpty:function(e,t){var n=F(e),r=F(t);return n&&!r||!n&&r}},o=Zo.types,a=[{name:"label",type:o.text,triggersBounds:i.any,triggersZOrder:i.emptyNonEmpty},{name:"text-rotation",type:o.textRotation,triggersBounds:i.any},{name:"text-margin-x",type:o.bidirectionalSize,triggersBounds:i.any},{name:"text-margin-y",type:o.bidirectionalSize,triggersBounds:i.any}],s=[{name:"source-label",type:o.text,triggersBounds:i.any},{name:"source-text-rotation",type:o.textRotation,triggersBounds:i.any},{name:"source-text-margin-x",type:o.bidirectionalSize,triggersBounds:i.any},{name:"source-text-margin-y",type:o.bidirectionalSize,triggersBounds:i.any},{name:"source-text-offset",type:o.size,triggersBounds:i.any}],l=[{name:"target-label",type:o.text,triggersBounds:i.any},{name:"target-text-rotation",type:o.textRotation,triggersBounds:i.any},{name:"target-text-margin-x",type:o.bidirectionalSize,triggersBounds:i.any},{name:"target-text-margin-y",type:o.bidirectionalSize,triggersBounds:i.any},{name:"target-text-offset",type:o.size,triggersBounds:i.any}],c=[{name:"font-family",type:o.fontFamily,triggersBounds:i.any},{name:"font-style",type:o.fontStyle,triggersBounds:i.any},{name:"font-weight",type:o.fontWeight,triggersBounds:i.any},{name:"font-size",type:o.size,triggersBounds:i.any},{name:"text-transform",type:o.textTransform,triggersBounds:i.any},{name:"text-wrap",type:o.textWrap,triggersBounds:i.any},{name:"text-overflow-wrap",type:o.textOverflowWrap,triggersBounds:i.any},{name:"text-max-width",type:o.size,triggersBounds:i.any},{name:"text-outline-width",type:o.size,triggersBounds:i.any},{name:"line-height",type:o.positiveNumber,triggersBounds:i.any}],u=[{name:"text-valign",type:o.valign,triggersBounds:i.any},{name:"text-halign",type:o.halign,triggersBounds:i.any},{name:"color",type:o.color},{name:"text-outline-color",type:o.color},{name:"text-outline-opacity",type:o.zeroOneNumber},{name:"text-background-color",type:o.color},{name:"text-background-opacity",type:o.zeroOneNumber},{name:"text-background-padding",type:o.size,triggersBounds:i.any},{name:"text-border-opacity",type:o.zeroOneNumber},{name:"text-border-color",type:o.color},{name:"text-border-width",type:o.size,triggersBounds:i.any},{name:"text-border-style",type:o.borderStyle,triggersBounds:i.any},{name:"text-background-shape",type:o.textBackgroundShape,triggersBounds:i.any},{name:"text-justification",type:o.justification}],d=[{name:"events",type:o.bool},{name:"text-events",type:o.bool}],h=[{name:"display",type:o.display,triggersZOrder:i.any,triggersBounds:i.any,triggersBoundsOfParallelBeziers:!0},{name:"visibility",type:o.visibility,triggersZOrder:i.any},{name:"opacity",type:o.zeroOneNumber,triggersZOrder:i.zeroNonZero},{name:"text-opacity",type:o.zeroOneNumber},{name:"min-zoomed-font-size",type:o.size},{name:"z-compound-depth",type:o.zCompoundDepth,triggersZOrder:i.any},{name:"z-index-compare",type:o.zIndexCompare,triggersZOrder:i.any},{name:"z-index",type:o.nonNegativeInt,triggersZOrder:i.any}],f=[{name:"overlay-padding",type:o.size,triggersBounds:i.any},{name:"overlay-color",type:o.color},{name:"overlay-opacity",type:o.zeroOneNumber,triggersBounds:i.zeroNonZero},{name:"overlay-shape",type:o.overlayShape,triggersBounds:i.any}],p=[{name:"underlay-padding",type:o.size,triggersBounds:i.any},{name:"underlay-color",type:o.color},{name:"underlay-opacity",type:o.zeroOneNumber,triggersBounds:i.zeroNonZero},{name:"underlay-shape",type:o.overlayShape,triggersBounds:i.any}],v=[{name:"transition-property",type:o.propList},{name:"transition-duration",type:o.time},{name:"transition-delay",type:o.time},{name:"transition-timing-function",type:o.easing}],g=function(e,t){return"label"===t.value?-e.poolIndex():t.pfValue},m=[{name:"height",type:o.nodeSize,triggersBounds:i.any,hashOverride:g},{name:"width",type:o.nodeSize,triggersBounds:i.any,hashOverride:g},{name:"shape",type:o.nodeShape,triggersBounds:i.any},{name:"shape-polygon-points",type:o.polygonPointList,triggersBounds:i.any},{name:"background-color",type:o.color},{name:"background-fill",type:o.fill},{name:"background-opacity",type:o.zeroOneNumber},{name:"background-blacken",type:o.nOneOneNumber},{name:"background-gradient-stop-colors",type:o.colors},{name:"background-gradient-stop-positions",type:o.percentages},{name:"background-gradient-direction",type:o.gradientDirection},{name:"padding",type:o.sizeMaybePercent,triggersBounds:i.any},{name:"padding-relative-to",type:o.paddingRelativeTo,triggersBounds:i.any},{name:"bounds-expansion",type:o.boundsExpansion,triggersBounds:i.any}],y=[{name:"border-color",type:o.color},{name:"border-opacity",type:o.zeroOneNumber},{name:"border-width",type:o.size,triggersBounds:i.any},{name:"border-style",type:o.borderStyle}],b=[{name:"background-image",type:o.urls},{name:"background-image-crossorigin",type:o.bgCrossOrigin},{name:"background-image-opacity",type:o.zeroOneNumbers},{name:"background-image-containment",type:o.bgContainment},{name:"background-image-smoothing",type:o.bools},{name:"background-position-x",type:o.bgPos},{name:"background-position-y",type:o.bgPos},{name:"background-width-relative-to",type:o.bgRelativeTo},{name:"background-height-relative-to",type:o.bgRelativeTo},{name:"background-repeat",type:o.bgRepeat},{name:"background-fit",type:o.bgFit},{name:"background-clip",type:o.bgClip},{name:"background-width",type:o.bgWH},{name:"background-height",type:o.bgWH},{name:"background-offset-x",type:o.bgPos},{name:"background-offset-y",type:o.bgPos}],x=[{name:"position",type:o.position,triggersBounds:i.any},{name:"compound-sizing-wrt-labels",type:o.compoundIncludeLabels,triggersBounds:i.any},{name:"min-width",type:o.size,triggersBounds:i.any},{name:"min-width-bias-left",type:o.sizeMaybePercent,triggersBounds:i.any},{name:"min-width-bias-right",type:o.sizeMaybePercent,triggersBounds:i.any},{name:"min-height",type:o.size,triggersBounds:i.any},{name:"min-height-bias-top",type:o.sizeMaybePercent,triggersBounds:i.any},{name:"min-height-bias-bottom",type:o.sizeMaybePercent,triggersBounds:i.any}],w=[{name:"line-style",type:o.lineStyle},{name:"line-color",type:o.color},{name:"line-fill",type:o.fill},{name:"line-cap",type:o.lineCap},{name:"line-opacity",type:o.zeroOneNumber},{name:"line-dash-pattern",type:o.numbers},{name:"line-dash-offset",type:o.number},{name:"line-gradient-stop-colors",type:o.colors},{name:"line-gradient-stop-positions",type:o.percentages},{name:"curve-style",type:o.curveStyle,triggersBounds:i.any,triggersBoundsOfParallelBeziers:!0},{name:"haystack-radius",type:o.zeroOneNumber,triggersBounds:i.any},{name:"source-endpoint",type:o.edgeEndpoint,triggersBounds:i.any},{name:"target-endpoint",type:o.edgeEndpoint,triggersBounds:i.any},{name:"control-point-step-size",type:o.size,triggersBounds:i.any},{name:"control-point-distances",type:o.bidirectionalSizes,triggersBounds:i.any},{name:"control-point-weights",type:o.numbers,triggersBounds:i.any},{name:"segment-distances",type:o.bidirectionalSizes,triggersBounds:i.any},{name:"segment-weights",type:o.numbers,triggersBounds:i.any},{name:"taxi-turn",type:o.bidirectionalSizeMaybePercent,triggersBounds:i.any},{name:"taxi-turn-min-distance",type:o.size,triggersBounds:i.any},{name:"taxi-direction",type:o.axisDirection,triggersBounds:i.any},{name:"edge-distances",type:o.edgeDistances,triggersBounds:i.any},{name:"arrow-scale",type:o.positiveNumber,triggersBounds:i.any},{name:"loop-direction",type:o.angle,triggersBounds:i.any},{name:"loop-sweep",type:o.angle,triggersBounds:i.any},{name:"source-distance-from-node",type:o.size,triggersBounds:i.any},{name:"target-distance-from-node",type:o.size,triggersBounds:i.any}],E=[{name:"ghost",type:o.bool,triggersBounds:i.any},{name:"ghost-offset-x",type:o.bidirectionalSize,triggersBounds:i.any},{name:"ghost-offset-y",type:o.bidirectionalSize,triggersBounds:i.any},{name:"ghost-opacity",type:o.zeroOneNumber}],_=[{name:"selection-box-color",type:o.color},{name:"selection-box-opacity",type:o.zeroOneNumber},{name:"selection-box-border-color",type:o.color},{name:"selection-box-border-width",type:o.size},{name:"active-bg-color",type:o.color},{name:"active-bg-opacity",type:o.zeroOneNumber},{name:"active-bg-size",type:o.size},{name:"outside-texture-bg-color",type:o.color},{name:"outside-texture-bg-opacity",type:o.zeroOneNumber}],k=[];Zo.pieBackgroundN=16,k.push({name:"pie-size",type:o.sizeMaybePercent});for(var S=1;S<=Zo.pieBackgroundN;S++)k.push({name:"pie-"+S+"-background-color",type:o.color}),k.push({name:"pie-"+S+"-background-size",type:o.percent}),k.push({name:"pie-"+S+"-background-opacity",type:o.zeroOneNumber});var P=[],j=Zo.arrowPrefixes=["source","mid-source","target","mid-target"];[{name:"arrow-shape",type:o.arrowShape,triggersBounds:i.any},{name:"arrow-color",type:o.color},{name:"arrow-fill",type:o.arrowFill}].forEach((function(e){j.forEach((function(t){var n=t+"-"+e.name,r=e.type,i=e.triggersBounds;P.push({name:n,type:r,triggersBounds:i})}))}),{});var T=Zo.properties=[].concat(d,v,h,f,p,E,u,c,a,s,l,m,y,b,k,x,w,P,_),D=Zo.propertyGroups={behavior:d,transition:v,visibility:h,overlay:f,underlay:p,ghost:E,commonLabel:u,labelDimensions:c,mainLabel:a,sourceLabel:s,targetLabel:l,nodeBody:m,nodeBorder:y,backgroundImage:b,pie:k,compound:x,edgeLine:w,edgeArrow:P,core:_},N=Zo.propertyGroupNames={};(Zo.propertyGroupKeys=Object.keys(D)).forEach((function(e){N[e]=D[e].map((function(e){return e.name})),D[e].forEach((function(t){return t.groupKey=e}))}));var O=Zo.aliases=[{name:"content",pointsTo:"label"},{name:"control-point-distance",pointsTo:"control-point-distances"},{name:"control-point-weight",pointsTo:"control-point-weights"},{name:"edge-text-rotation",pointsTo:"text-rotation"},{name:"padding-left",pointsTo:"padding"},{name:"padding-right",pointsTo:"padding"},{name:"padding-top",pointsTo:"padding"},{name:"padding-bottom",pointsTo:"padding"}];Zo.propertyNames=T.map((function(e){return e.name}));for(var M=0;M<T.length;M++){var A=T[M];T[A.name]=A}for(var R=0;R<O.length;R++){var I=O[R],L=T[I.pointsTo],B={name:I.name,alias:!0,pointsTo:L};T.push(B),T[I.name]=B}}(),Zo.getDefaultProperty=function(e){return this.getDefaultProperties()[e]},Zo.getDefaultProperties=function(){var e=this._private;if(null!=e.defaultProperties)return e.defaultProperties;for(var t=X({"selection-box-color":"#ddd","selection-box-opacity":.65,"selection-box-border-color":"#aaa","selection-box-border-width":1,"active-bg-color":"black","active-bg-opacity":.15,"active-bg-size":30,"outside-texture-bg-color":"#000","outside-texture-bg-opacity":.125,events:"yes","text-events":"no","text-valign":"top","text-halign":"center","text-justification":"auto","line-height":1,color:"#000","text-outline-color":"#000","text-outline-width":0,"text-outline-opacity":1,"text-opacity":1,"text-decoration":"none","text-transform":"none","text-wrap":"none","text-overflow-wrap":"whitespace","text-max-width":9999,"text-background-color":"#000","text-background-opacity":0,"text-background-shape":"rectangle","text-background-padding":0,"text-border-opacity":0,"text-border-width":0,"text-border-style":"solid","text-border-color":"#000","font-family":"Helvetica Neue, Helvetica, sans-serif","font-style":"normal","font-weight":"normal","font-size":16,"min-zoomed-font-size":0,"text-rotation":"none","source-text-rotation":"none","target-text-rotation":"none",visibility:"visible",display:"element",opacity:1,"z-compound-depth":"auto","z-index-compare":"auto","z-index":0,label:"","text-margin-x":0,"text-margin-y":0,"source-label":"","source-text-offset":0,"source-text-margin-x":0,"source-text-margin-y":0,"target-label":"","target-text-offset":0,"target-text-margin-x":0,"target-text-margin-y":0,"overlay-opacity":0,"overlay-color":"#000","overlay-padding":10,"overlay-shape":"round-rectangle","underlay-opacity":0,"underlay-color":"#000","underlay-padding":10,"underlay-shape":"round-rectangle","transition-property":"none","transition-duration":0,"transition-delay":0,"transition-timing-function":"linear","background-blacken":0,"background-color":"#999","background-fill":"solid","background-opacity":1,"background-image":"none","background-image-crossorigin":"anonymous","background-image-opacity":1,"background-image-containment":"inside","background-image-smoothing":"yes","background-position-x":"50%","background-position-y":"50%","background-offset-x":0,"background-offset-y":0,"background-width-relative-to":"include-padding","background-height-relative-to":"include-padding","background-repeat":"no-repeat","background-fit":"none","background-clip":"node","background-width":"auto","background-height":"auto","border-color":"#000","border-opacity":1,"border-width":0,"border-style":"solid",height:30,width:30,shape:"ellipse","shape-polygon-points":"-1, -1, 1, -1, 1, 1, -1, 1","bounds-expansion":0,"background-gradient-direction":"to-bottom","background-gradient-stop-colors":"#999","background-gradient-stop-positions":"0%",ghost:"no","ghost-offset-y":0,"ghost-offset-x":0,"ghost-opacity":0,padding:0,"padding-relative-to":"width",position:"origin","compound-sizing-wrt-labels":"include","min-width":0,"min-width-bias-left":0,"min-width-bias-right":0,"min-height":0,"min-height-bias-top":0,"min-height-bias-bottom":0},{"pie-size":"100%"},[{name:"pie-{{i}}-background-color",value:"black"},{name:"pie-{{i}}-background-size",value:"0%"},{name:"pie-{{i}}-background-opacity",value:1}].reduce((function(e,t){for(var n=1;n<=Zo.pieBackgroundN;n++){var r=t.name.replace("{{i}}",n),i=t.value;e[r]=i}return e}),{}),{"line-style":"solid","line-color":"#999","line-fill":"solid","line-cap":"butt","line-opacity":1,"line-gradient-stop-colors":"#999","line-gradient-stop-positions":"0%","control-point-step-size":40,"control-point-weights":.5,"segment-weights":.5,"segment-distances":20,"taxi-turn":"50%","taxi-turn-min-distance":10,"taxi-direction":"auto","edge-distances":"intersection","curve-style":"haystack","haystack-radius":0,"arrow-scale":1,"loop-direction":"-45deg","loop-sweep":"-90deg","source-distance-from-node":0,"target-distance-from-node":0,"source-endpoint":"outside-to-node","target-endpoint":"outside-to-node","line-dash-pattern":[6,3],"line-dash-offset":0},[{name:"arrow-shape",value:"none"},{name:"arrow-color",value:"#999"},{name:"arrow-fill",value:"filled"}].reduce((function(e,t){return Zo.arrowPrefixes.forEach((function(n){var r=n+"-"+t.name,i=t.value;e[r]=i})),e}),{})),n={},r=0;r<this.properties.length;r++){var i=this.properties[r];if(!i.pointsTo){var o=i.name,a=t[o],s=this.parse(o,a);n[o]=s}}return e.defaultProperties=n,e.defaultProperties},Zo.addDefaultStylesheet=function(){this.selector(":parent").css({shape:"rectangle",padding:10,"background-color":"#eee","border-color":"#ccc","border-width":1}).selector("edge").css({width:3}).selector(":loop").css({"curve-style":"bezier"}).selector("edge:compound").css({"curve-style":"bezier","source-endpoint":"outside-to-line","target-endpoint":"outside-to-line"}).selector(":selected").css({"background-color":"#0169D9","line-color":"#0169D9","source-arrow-color":"#0169D9","target-arrow-color":"#0169D9","mid-source-arrow-color":"#0169D9","mid-target-arrow-color":"#0169D9"}).selector(":parent:selected").css({"background-color":"#CCE1F9","border-color":"#aec8e5"}).selector(":active").css({"overlay-color":"black","overlay-padding":10,"overlay-opacity":.25}),this.defaultLength=this.length};var Qo={parse:function(e,t,n,r){var i=this;if(T(t))return i.parseImplWarn(e,t,n,r);var o,a=fe(e,""+t,n?"t":"f","mapping"===r||!0===r||!1===r||null==r?"dontcare":r),s=i.propCache=i.propCache||[];return(o=s[a])||(o=s[a]=i.parseImplWarn(e,t,n,r)),(n||"mapping"===r)&&(o=Pe(o))&&(o.value=Pe(o.value)),o},parseImplWarn:function(e,t,n,r){var i=this.parseImpl(e,t,n,r);return i||null==t||Se("The style property `".concat(e,": ").concat(t,"` is invalid")),!i||"width"!==i.name&&"height"!==i.name||"label"!==t||Se("The style value of `label` is deprecated for `"+i.name+"`"),i}};Qo.parseImpl=function(e,t,n,r){var i=this;e=G(e);var o=i.properties[e],a=t,s=i.types;if(!o)return null;if(void 0===t)return null;o.alias&&(o=o.pointsTo,e=o.name);var l=C(t);l&&(t=t.trim());var c,u,d=o.type;if(!d)return null;if(n&&(""===t||null===t))return{name:e,value:t,bypass:!0,deleteBypass:!0};if(T(t))return{name:e,value:t,strValue:"fn",mapped:s.fn,bypass:n};if(!l||r||t.length<7||"a"!==t[1]);else{if(t.length>=7&&"d"===t[0]&&(c=new RegExp(s.data.regex).exec(t))){if(n)return!1;var h=s.data;return{name:e,value:c,strValue:""+t,mapped:h,field:c[1],bypass:n}}if(t.length>=10&&"m"===t[0]&&(u=new RegExp(s.mapData.regex).exec(t))){if(n)return!1;if(d.multiple)return!1;var f=s.mapData;if(!d.color&&!d.number)return!1;var p=this.parse(e,u[4]);if(!p||p.mapped)return!1;var v=this.parse(e,u[5]);if(!v||v.mapped)return!1;if(p.pfValue===v.pfValue||p.strValue===v.strValue)return Se("`"+e+": "+t+"` is not a valid mapper because the output range is zero; converting to `"+e+": "+p.strValue+"`"),this.parse(e,p.strValue);if(d.color){var g=p.value,m=v.value;if(!(g[0]!==m[0]||g[1]!==m[1]||g[2]!==m[2]||g[3]!==m[3]&&(null!=g[3]&&1!==g[3]||null!=m[3]&&1!==m[3])))return!1}return{name:e,value:u,strValue:""+t,mapped:f,field:u[1],fieldMin:parseFloat(u[2]),fieldMax:parseFloat(u[3]),valueMin:p.value,valueMax:v.value,bypass:n}}}if(d.multiple&&"multiple"!==r){var y;if(y=l?t.split(/\s+/):D(t)?t:[t],d.evenMultiple&&y.length%2!=0)return null;for(var b=[],x=[],w=[],E="",_=!1,k=0;k<y.length;k++){var S=i.parse(e,y[k],n,"multiple");_=_||C(S.value),b.push(S.value),w.push(null!=S.pfValue?S.pfValue:S.value),x.push(S.units),E+=(k>0?" ":"")+S.strValue}return d.validate&&!d.validate(b,x)?null:d.singleEnum&&_?1===b.length&&C(b[0])?{name:e,value:b[0],strValue:b[0],bypass:n}:null:{name:e,value:b,pfValue:w,strValue:E,bypass:n,units:x}}var P,j,N=function(){for(var r=0;r<d.enums.length;r++){if(d.enums[r]===t)return{name:e,value:t,strValue:""+t,bypass:n}}return null};if(d.number){var M,A="px";if(d.units&&(M=d.units),d.implicitUnits&&(A=d.implicitUnits),!d.unitless)if(l){var R="px|em"+(d.allowPercent?"|\\%":"");M&&(R=M);var I=t.match("^("+Y+")("+R+")?$");I&&(t=I[1],M=I[2]||A)}else M&&!d.implicitUnits||(M=A);if(t=parseFloat(t),isNaN(t)&&void 0===d.enums)return null;if(isNaN(t)&&void 0!==d.enums)return t=a,N();if(d.integer&&(!O(j=t)||Math.floor(j)!==j))return null;if(void 0!==d.min&&(t<d.min||d.strictMin&&t===d.min)||void 0!==d.max&&(t>d.max||d.strictMax&&t===d.max))return null;var L={name:e,value:t,strValue:""+t+(M||""),units:M,bypass:n};return d.unitless||"px"!==M&&"em"!==M?L.pfValue=t:L.pfValue="px"!==M&&M?this.getEmSizeInPixels()*t:t,"ms"!==M&&"s"!==M||(L.pfValue="ms"===M?t:1e3*t),"deg"!==M&&"rad"!==M||(L.pfValue="rad"===M?t:(P=t,Math.PI*P/180)),"%"===M&&(L.pfValue=t/100),L}if(d.propList){var B=[],F=""+t;if("none"===F);else{for(var z=F.split(/\s*,\s*|\s+/),V=0;V<z.length;V++){var H=z[V].trim();i.properties[H]?B.push(H):Se("`"+H+"` is not a valid property name")}if(0===B.length)return null}return{name:e,value:B,strValue:0===B.length?"none":B.join(" "),bypass:n}}if(d.color){var W=$(t);return W?{name:e,value:W,pfValue:W,strValue:"rgb("+W[0]+","+W[1]+","+W[2]+")",bypass:n}:null}if(d.regex||d.regexes){if(d.enums){var q=N();if(q)return q}for(var U=d.regexes?d.regexes:[d.regex],X=0;X<U.length;X++){var K=new RegExp(U[X]).exec(t);if(K)return{name:e,value:d.singleRegexMatchValue?K[1]:K,strValue:""+t,bypass:n}}return null}return d.string?{name:e,value:""+t,strValue:""+t,bypass:n}:d.enums?N():null};var Jo=function e(t){if(!(this instanceof e))return new e(t);L(t)?(this._private={cy:t,coreStyle:{}},this.length=0,this.resetToDefault()):_e("A style must have a core reference")},ea=Jo.prototype;ea.instanceString=function(){return"style"},ea.clear=function(){for(var e=this._private,t=e.cy.elements(),n=0;n<this.length;n++)this[n]=void 0;return this.length=0,e.contextStyles={},e.propDiffs={},this.cleanElements(t,!0),t.forEach((function(e){var t=e[0]._private;t.styleDirty=!0,t.appliedInitStyle=!1})),this},ea.resetToDefault=function(){return this.clear(),this.addDefaultStylesheet(),this},ea.core=function(e){return this._private.coreStyle[e]||this.getDefaultProperty(e)},ea.selector=function(e){var t="core"===e?null:new Hr(e),n=this.length++;return this[n]={selector:t,properties:[],mappedProperties:[],index:n},this},ea.css=function(){var e=this,t=arguments;if(1===t.length)for(var n=t[0],r=0;r<e.properties.length;r++){var i=e.properties[r],o=n[i.name];void 0===o&&(o=n[H(i.name)]),void 0!==o&&this.cssRule(i.name,o)}else 2===t.length&&this.cssRule(t[0],t[1]);return this},ea.style=ea.css,ea.cssRule=function(e,t){var n=this.parse(e,t);if(n){var r=this.length-1;this[r].properties.push(n),this[r].properties[n.name]=n,n.name.match(/pie-(\d+)-background-size/)&&n.value&&(this._private.hasPie=!0),n.mapped&&this[r].mappedProperties.push(n),!this[r].selector&&(this._private.coreStyle[n.name]=n)}return this},ea.append=function(e){return B(e)?e.appendToStyle(this):D(e)?this.appendFromJson(e):C(e)&&this.appendFromString(e),this},Jo.fromJson=function(e,t){var n=new Jo(e);return n.fromJson(t),n},Jo.fromString=function(e,t){return new Jo(e).fromString(t)},[Wo,Yo,Uo,Xo,$o,Ko,Zo,Qo].forEach((function(e){X(ea,e)})),Jo.types=ea.types,Jo.properties=ea.properties,Jo.propertyGroups=ea.propertyGroups,Jo.propertyGroupNames=ea.propertyGroupNames,Jo.propertyGroupKeys=ea.propertyGroupKeys;var ta={style:function(e){e&&this.setStyle(e).update();return this._private.style},setStyle:function(e){var t=this._private;return B(e)?t.style=e.generateStyle(this):D(e)?t.style=Jo.fromJson(this,e):C(e)?t.style=Jo.fromString(this,e):t.style=Jo(this),t.style},updateStyle:function(){this.mutableElements().updateStyle()}},na={autolock:function(e){return void 0===e?this._private.autolock:(this._private.autolock=!!e,this)},autoungrabify:function(e){return void 0===e?this._private.autoungrabify:(this._private.autoungrabify=!!e,this)},autounselectify:function(e){return void 0===e?this._private.autounselectify:(this._private.autounselectify=!!e,this)},selectionType:function(e){var t=this._private;return null==t.selectionType&&(t.selectionType="single"),void 0===e?t.selectionType:("additive"!==e&&"single"!==e||(t.selectionType=e),this)},panningEnabled:function(e){return void 0===e?this._private.panningEnabled:(this._private.panningEnabled=!!e,this)},userPanningEnabled:function(e){return void 0===e?this._private.userPanningEnabled:(this._private.userPanningEnabled=!!e,this)},zoomingEnabled:function(e){return void 0===e?this._private.zoomingEnabled:(this._private.zoomingEnabled=!!e,this)},userZoomingEnabled:function(e){return void 0===e?this._private.userZoomingEnabled:(this._private.userZoomingEnabled=!!e,this)},boxSelectionEnabled:function(e){return void 0===e?this._private.boxSelectionEnabled:(this._private.boxSelectionEnabled=!!e,this)},pan:function(){var e,t,n,r,i,o=arguments,a=this._private.pan;switch(o.length){case 0:return a;case 1:if(C(o[0]))return a[e=o[0]];if(N(o[0])){if(!this._private.panningEnabled)return this;r=(n=o[0]).x,i=n.y,O(r)&&(a.x=r),O(i)&&(a.y=i),this.emit("pan viewport")}break;case 2:if(!this._private.panningEnabled)return this;e=o[0],t=o[1],"x"!==e&&"y"!==e||!O(t)||(a[e]=t),this.emit("pan viewport")}return this.notify("viewport"),this},panBy:function(e,t){var n,r,i,o,a,s=arguments,l=this._private.pan;if(!this._private.panningEnabled)return this;switch(s.length){case 1:N(e)&&(o=(i=s[0]).x,a=i.y,O(o)&&(l.x+=o),O(a)&&(l.y+=a),this.emit("pan viewport"));break;case 2:r=t,"x"!==(n=e)&&"y"!==n||!O(r)||(l[n]+=r),this.emit("pan viewport")}return this.notify("viewport"),this},fit:function(e,t){var n=this.getFitViewport(e,t);if(n){var r=this._private;r.zoom=n.zoom,r.pan=n.pan,this.emit("pan zoom viewport"),this.notify("viewport")}return this},getFitViewport:function(e,t){if(O(e)&&void 0===t&&(t=e,e=void 0),this._private.panningEnabled&&this._private.zoomingEnabled){var n,r;if(C(e)){var i=e;e=this.$(i)}else if(N(r=e)&&O(r.x1)&&O(r.x2)&&O(r.y1)&&O(r.y2)){var o=e;(n={x1:o.x1,y1:o.y1,x2:o.x2,y2:o.y2}).w=n.x2-n.x1,n.h=n.y2-n.y1}else A(e)||(e=this.mutableElements());if(!A(e)||!e.empty()){n=n||e.boundingBox();var a,s=this.width(),l=this.height();if(t=O(t)?t:0,!isNaN(s)&&!isNaN(l)&&s>0&&l>0&&!isNaN(n.w)&&!isNaN(n.h)&&n.w>0&&n.h>0)return{zoom:a=(a=(a=Math.min((s-2*t)/n.w,(l-2*t)/n.h))>this._private.maxZoom?this._private.maxZoom:a)<this._private.minZoom?this._private.minZoom:a,pan:{x:(s-a*(n.x1+n.x2))/2,y:(l-a*(n.y1+n.y2))/2}}}}},zoomRange:function(e,t){var n=this._private;if(null==t){var r=e;e=r.min,t=r.max}return O(e)&&O(t)&&e<=t?(n.minZoom=e,n.maxZoom=t):O(e)&&void 0===t&&e<=n.maxZoom?n.minZoom=e:O(t)&&void 0===e&&t>=n.minZoom&&(n.maxZoom=t),this},minZoom:function(e){return void 0===e?this._private.minZoom:this.zoomRange({min:e})},maxZoom:function(e){return void 0===e?this._private.maxZoom:this.zoomRange({max:e})},getZoomedViewport:function(e){var t,n,r=this._private,i=r.pan,o=r.zoom,a=!1;if(r.zoomingEnabled||(a=!0),O(e)?n=e:N(e)&&(n=e.level,null!=e.position?t=et(e.position,o,i):null!=e.renderedPosition&&(t=e.renderedPosition),null==t||r.panningEnabled||(a=!0)),n=(n=n>r.maxZoom?r.maxZoom:n)<r.minZoom?r.minZoom:n,a||!O(n)||n===o||null!=t&&(!O(t.x)||!O(t.y)))return null;if(null!=t){var s=i,l=o,c=n;return{zoomed:!0,panned:!0,zoom:c,pan:{x:-c/l*(t.x-s.x)+t.x,y:-c/l*(t.y-s.y)+t.y}}}return{zoomed:!0,panned:!1,zoom:n,pan:i}},zoom:function(e){if(void 0===e)return this._private.zoom;var t=this.getZoomedViewport(e),n=this._private;return null!=t&&t.zoomed?(n.zoom=t.zoom,t.panned&&(n.pan.x=t.pan.x,n.pan.y=t.pan.y),this.emit("zoom"+(t.panned?" pan":"")+" viewport"),this.notify("viewport"),this):this},viewport:function(e){var t=this._private,n=!0,r=!0,i=[],o=!1,a=!1;if(!e)return this;if(O(e.zoom)||(n=!1),N(e.pan)||(r=!1),!n&&!r)return this;if(n){var s=e.zoom;s<t.minZoom||s>t.maxZoom||!t.zoomingEnabled?o=!0:(t.zoom=s,i.push("zoom"))}if(r&&(!o||!e.cancelOnFailedZoom)&&t.panningEnabled){var l=e.pan;O(l.x)&&(t.pan.x=l.x,a=!1),O(l.y)&&(t.pan.y=l.y,a=!1),a||i.push("pan")}return i.length>0&&(i.push("viewport"),this.emit(i.join(" ")),this.notify("viewport")),this},center:function(e){var t=this.getCenterPan(e);return t&&(this._private.pan=t,this.emit("pan viewport"),this.notify("viewport")),this},getCenterPan:function(e,t){if(this._private.panningEnabled){if(C(e)){var n=e;e=this.mutableElements().filter(n)}else A(e)||(e=this.mutableElements());if(0!==e.length){var r=e.boundingBox(),i=this.width(),o=this.height();return{x:(i-(t=void 0===t?this._private.zoom:t)*(r.x1+r.x2))/2,y:(o-t*(r.y1+r.y2))/2}}}},reset:function(){return this._private.panningEnabled&&this._private.zoomingEnabled?(this.viewport({pan:{x:0,y:0},zoom:1}),this):this},invalidateSize:function(){this._private.sizeCache=null},size:function(){var e,t,n=this._private,r=n.container;return n.sizeCache=n.sizeCache||(r?(e=w.getComputedStyle(r),t=function(t){return parseFloat(e.getPropertyValue(t))},{width:r.clientWidth-t("padding-left")-t("padding-right"),height:r.clientHeight-t("padding-top")-t("padding-bottom")}):{width:1,height:1})},width:function(){return this.size().width},height:function(){return this.size().height},extent:function(){var e=this._private.pan,t=this._private.zoom,n=this.renderedExtent(),r={x1:(n.x1-e.x)/t,x2:(n.x2-e.x)/t,y1:(n.y1-e.y)/t,y2:(n.y2-e.y)/t};return r.w=r.x2-r.x1,r.h=r.y2-r.y1,r},renderedExtent:function(){var e=this.width(),t=this.height();return{x1:0,y1:0,x2:e,y2:t,w:e,h:t}},multiClickDebounceTime:function(e){return e?(this._private.multiClickDebounceTime=e,this):this._private.multiClickDebounceTime}};na.centre=na.center,na.autolockNodes=na.autolock,na.autoungrabifyNodes=na.autoungrabify;var ra={data:or.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:or.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:or.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:or.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};ra.attr=ra.data,ra.removeAttr=ra.removeData;var ia=function(e){var t=this,n=(e=X({},e)).container;n&&!M(n)&&M(n[0])&&(n=n[0]);var r=n?n._cyreg:null;(r=r||{})&&r.cy&&(r.cy.destroy(),r={});var i=r.readies=r.readies||[];n&&(n._cyreg=r),r.cy=t;var o=void 0!==w&&void 0!==n&&!e.headless,a=e;a.layout=X({name:o?"grid":"null"},a.layout),a.renderer=X({name:o?"canvas":"null"},a.renderer);var s=function(e,t,n){return void 0!==t?t:void 0!==n?n:e},l=this._private={container:n,ready:!1,options:a,elements:new wo(this),listeners:[],aniEles:new wo(this),data:a.data||{},scratch:{},layout:null,renderer:null,destroyed:!1,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:s(!0,a.zoomingEnabled),userZoomingEnabled:s(!0,a.userZoomingEnabled),panningEnabled:s(!0,a.panningEnabled),userPanningEnabled:s(!0,a.userPanningEnabled),boxSelectionEnabled:s(!0,a.boxSelectionEnabled),autolock:s(!1,a.autolock,a.autolockNodes),autoungrabify:s(!1,a.autoungrabify,a.autoungrabifyNodes),autounselectify:s(!1,a.autounselectify),styleEnabled:void 0===a.styleEnabled?o:a.styleEnabled,zoom:O(a.zoom)?a.zoom:1,pan:{x:N(a.pan)&&O(a.pan.x)?a.pan.x:0,y:N(a.pan)&&O(a.pan.y)?a.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1,multiClickDebounceTime:s(250,a.multiClickDebounceTime)};this.createEmitter(),this.selectionType(a.selectionType),this.zoomRange({min:a.minZoom,max:a.maxZoom});l.styleEnabled&&t.setStyle([]);var c=X({},a,a.renderer);t.initRenderer(c);!function(e,t){if(e.some(z))return Jn.all(e).then(t);t(e)}([a.style,a.elements],(function(e){var n=e[0],o=e[1];l.styleEnabled&&t.style().append(n),function(e,n,r){t.notifications(!1);var i=t.mutableElements();i.length>0&&i.remove(),null!=e&&(N(e)||D(e))&&t.add(e),t.one("layoutready",(function(e){t.notifications(!0),t.emit(e),t.one("load",n),t.emitAndNotify("load")})).one("layoutstop",(function(){t.one("done",r),t.emit("done")}));var o=X({},t._private.options.layout);o.eles=t.elements(),t.layout(o).run()}(o,(function(){t.startAnimationLoop(),l.ready=!0,T(a.ready)&&t.on("ready",a.ready);for(var e=0;e<i.length;e++){var n=i[e];t.on("ready",n)}r&&(r.readies=[]),t.emit("ready")}),a.done)}))},oa=ia.prototype;X(oa,{instanceString:function(){return"core"},isReady:function(){return this._private.ready},destroyed:function(){return this._private.destroyed},ready:function(e){return this.isReady()?this.emitter().emit("ready",[],e):this.on("ready",e),this},destroy:function(){var e=this;if(!e.destroyed())return e.stopAnimationLoop(),e.destroyRenderer(),this.emit("destroy"),e._private.destroyed=!0,e},hasElementWithId:function(e){return this._private.elements.hasElementWithId(e)},getElementById:function(e){return this._private.elements.getElementById(e)},hasCompoundNodes:function(){return this._private.hasCompoundNodes},headless:function(){return this._private.renderer.isHeadless()},styleEnabled:function(){return this._private.styleEnabled},addToPool:function(e){return this._private.elements.merge(e),this},removeFromPool:function(e){return this._private.elements.unmerge(e),this},container:function(){return this._private.container||null},mount:function(e){if(null!=e){var t=this,n=t._private,r=n.options;return!M(e)&&M(e[0])&&(e=e[0]),t.stopAnimationLoop(),t.destroyRenderer(),n.container=e,n.styleEnabled=!0,t.invalidateSize(),t.initRenderer(X({},r,r.renderer,{name:"null"===r.renderer.name?"canvas":r.renderer.name})),t.startAnimationLoop(),t.style(r.style),t.emit("mount"),t}},unmount:function(){var e=this;return e.stopAnimationLoop(),e.destroyRenderer(),e.initRenderer({name:"null"}),e.emit("unmount"),e},options:function(){return Pe(this._private.options)},json:function(e){var t=this,n=t._private,r=t.mutableElements();if(N(e)){if(t.startBatch(),e.elements){var i={},o=function(e,n){for(var r=[],o=[],a=0;a<e.length;a++){var s=e[a];if(s.data.id){var l=""+s.data.id,c=t.getElementById(l);i[l]=!0,0!==c.length?o.push({ele:c,json:s}):n?(s.group=n,r.push(s)):r.push(s)}else Se("cy.json() cannot handle elements without an ID attribute")}t.add(r);for(var u=0;u<o.length;u++){var d=o[u],h=d.ele,f=d.json;h.json(f)}};if(D(e.elements))o(e.elements);else for(var a=["nodes","edges"],s=0;s<a.length;s++){var l=a[s],c=e.elements[l];D(c)&&o(c,l)}var u=t.collection();r.filter((function(e){return!i[e.id()]})).forEach((function(e){e.isParent()?u.merge(e):e.remove()})),u.forEach((function(e){return e.children().move({parent:null})})),u.forEach((function(e){return function(e){return t.getElementById(e.id())}(e).remove()}))}e.style&&t.style(e.style),null!=e.zoom&&e.zoom!==n.zoom&&t.zoom(e.zoom),e.pan&&(e.pan.x===n.pan.x&&e.pan.y===n.pan.y||t.pan(e.pan)),e.data&&t.data(e.data);for(var d=["minZoom","maxZoom","zoomingEnabled","userZoomingEnabled","panningEnabled","userPanningEnabled","boxSelectionEnabled","autolock","autoungrabify","autounselectify","multiClickDebounceTime"],h=0;h<d.length;h++){var f=d[h];null!=e[f]&&t[f](e[f])}return t.endBatch(),this}var p={};!!e?p.elements=this.elements().map((function(e){return e.json()})):(p.elements={},r.forEach((function(e){var t=e.group();p.elements[t]||(p.elements[t]=[]),p.elements[t].push(e.json())}))),this._private.styleEnabled&&(p.style=t.style().json()),p.data=Pe(t.data());var v=n.options;return p.zoomingEnabled=n.zoomingEnabled,p.userZoomingEnabled=n.userZoomingEnabled,p.zoom=n.zoom,p.minZoom=n.minZoom,p.maxZoom=n.maxZoom,p.panningEnabled=n.panningEnabled,p.userPanningEnabled=n.userPanningEnabled,p.pan=Pe(n.pan),p.boxSelectionEnabled=n.boxSelectionEnabled,p.renderer=Pe(v.renderer),p.hideEdgesOnViewport=v.hideEdgesOnViewport,p.textureOnViewport=v.textureOnViewport,p.wheelSensitivity=v.wheelSensitivity,p.motionBlur=v.motionBlur,p.multiClickDebounceTime=v.multiClickDebounceTime,p}}),oa.$id=oa.getElementById,[_o,Ao,Lo,Bo,Fo,zo,Go,Ho,ta,na,ra].forEach((function(e){X(oa,e)}));var aa={fit:!0,directed:!1,padding:30,circle:!1,grid:!1,spacingFactor:1.75,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,roots:void 0,maximal:!1,depthSort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}},sa=function(e){return e.scratch("breadthfirst")},la=function(e,t){return e.scratch("breadthfirst",t)};function ca(e){this.options=X({},aa,e)}ca.prototype.run=function(){var e,t=this.options,n=t,r=t.cy,i=n.eles,o=i.nodes().filter((function(e){return!e.isParent()})),a=i,s=n.directed,l=n.maximal||n.maximalAdjustments>0,c=ht(n.boundingBox?n.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()});if(A(n.roots))e=n.roots;else if(D(n.roots)){for(var u=[],d=0;d<n.roots.length;d++){var h=n.roots[d],f=r.getElementById(h);u.push(f)}e=r.collection(u)}else if(C(n.roots))e=r.$(n.roots);else if(s)e=o.roots();else{var p=i.components();e=r.collection();for(var v=function(t){var n=p[t],r=n.maxDegree(!1),i=n.filter((function(e){return e.degree(!1)===r}));e=e.add(i)},g=0;g<p.length;g++)v(g)}var m=[],y={},b=function(e,t){null==m[t]&&(m[t]=[]);var n=m[t].length;m[t].push(e),la(e,{index:n,depth:t})};a.bfs({roots:e,directed:n.directed,visit:function(e,t,n,r,i){var o=e[0],a=o.id();b(o,i),y[a]=!0}});for(var x=[],w=0;w<o.length;w++){var E=o[w];y[E.id()]||x.push(E)}var _=function(e){for(var t=m[e],n=0;n<t.length;n++){var r=t[n];null!=r?la(r,{depth:e,index:n}):(t.splice(n,1),n--)}},k=function(){for(var e=0;e<m.length;e++)_(e)},S=function(e,t){for(var n=sa(e),r=e.incomers().filter((function(e){return e.isNode()&&i.has(e)})),o=-1,a=e.id(),s=0;s<r.length;s++){var l=r[s],c=sa(l);o=Math.max(o,c.depth)}return n.depth<=o&&(t[a]?null:(function(e,t){var n=sa(e),r=n.depth,i=n.index;m[r][i]=null,b(e,t)}(e,o+1),t[a]=!0,!0))};if(s&&l){var P=[],j={},T=function(e){return P.push(e)};for(o.forEach((function(e){return P.push(e)}));P.length>0;){var N=P.shift(),O=S(N,j);if(O)N.outgoers().filter((function(e){return e.isNode()&&i.has(e)})).forEach(T);else if(null===O){Se("Detected double maximal shift for node `"+N.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}k();var M=0;if(n.avoidOverlap)for(var R=0;R<o.length;R++){var I=o[R].layoutDimensions(n),L=I.w,B=I.h;M=Math.max(M,L,B)}var F={},z=function(e){if(F[e.id()])return F[e.id()];for(var t=sa(e).depth,n=e.neighborhood(),r=0,i=0,a=0;a<n.length;a++){var s=n[a];if(!s.isEdge()&&!s.isParent()&&o.has(s)){var l=sa(s);if(null!=l){var c=l.index,u=l.depth;if(null!=c&&null!=u){var d=m[u].length;u<t&&(r+=c/d,i++)}}}}return r/=i=Math.max(1,i),0===i&&(r=0),F[e.id()]=r,r},V=function(e,t){var n=z(e)-z(t);return 0===n?U(e.id(),t.id()):n};void 0!==n.depthSort&&(V=n.depthSort);for(var G=0;G<m.length;G++)m[G].sort(V),_(G);for(var H=[],W=0;W<x.length;W++)H.push(x[W]);m.unshift(H),k();for(var q=0,Y=0;Y<m.length;Y++)q=Math.max(m[Y].length,q);var X=c.x1+c.w/2,$=c.x1+c.h/2,K=m.reduce((function(e,t){return Math.max(e,t.length)}),0);return i.nodes().layoutPositions(this,n,(function(e){var t=sa(e),r=t.depth,i=t.index,o=m[r].length,a=Math.max(c.w/((n.grid?K:o)+1),M),s=Math.max(c.h/(m.length+1),M),l=Math.min(c.w/2/m.length,c.h/2/m.length);if(l=Math.max(l,M),n.circle){var u=l*r+l-(m.length>0&&m[0].length<=3?l/2:0),d=2*Math.PI/m[r].length*i;return 0===r&&1===m[0].length&&(u=1),{x:X+u*Math.cos(d),y:$+u*Math.sin(d)}}return{x:X+(i+1-(o+1)/2)*a,y:(r+1)*s}})),this};var ua={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,radius:void 0,startAngle:1.5*Math.PI,sweep:void 0,clockwise:!0,sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function da(e){this.options=X({},ua,e)}da.prototype.run=function(){var e=this.options,t=e,n=e.cy,r=t.eles,i=void 0!==t.counterclockwise?!t.counterclockwise:t.clockwise,o=r.nodes().not(":parent");t.sort&&(o=o.sort(t.sort));for(var a,s=ht(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()}),l=s.x1+s.w/2,c=s.y1+s.h/2,u=(void 0===t.sweep?2*Math.PI-2*Math.PI/o.length:t.sweep)/Math.max(1,o.length-1),d=0,h=0;h<o.length;h++){var f=o[h].layoutDimensions(t),p=f.w,v=f.h;d=Math.max(d,p,v)}if(a=O(t.radius)?t.radius:o.length<=1?0:Math.min(s.h,s.w)/2-d,o.length>1&&t.avoidOverlap){d*=1.75;var g=Math.cos(u)-Math.cos(0),m=Math.sin(u)-Math.sin(0),y=Math.sqrt(d*d/(g*g+m*m));a=Math.max(y,a)}return r.nodes().layoutPositions(this,t,(function(e,n){var r=t.startAngle+n*u*(i?1:-1),o=a*Math.cos(r),s=a*Math.sin(r);return{x:l+o,y:c+s}})),this};var ha,fa={fit:!0,padding:30,startAngle:1.5*Math.PI,sweep:void 0,clockwise:!0,equidistant:!1,minNodeSpacing:10,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,height:void 0,width:void 0,spacingFactor:void 0,concentric:function(e){return e.degree()},levelWidth:function(e){return e.maxDegree()/4},animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function pa(e){this.options=X({},fa,e)}pa.prototype.run=function(){for(var e=this.options,t=e,n=void 0!==t.counterclockwise?!t.counterclockwise:t.clockwise,r=e.cy,i=t.eles,o=i.nodes().not(":parent"),a=ht(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()}),s=a.x1+a.w/2,l=a.y1+a.h/2,c=[],u=0,d=0;d<o.length;d++){var h,f=o[d];h=t.concentric(f),c.push({value:h,node:f}),f._private.scratch.concentric=h}o.updateStyle();for(var p=0;p<o.length;p++){var v=o[p].layoutDimensions(t);u=Math.max(u,v.w,v.h)}c.sort((function(e,t){return t.value-e.value}));for(var g=t.levelWidth(o),m=[[]],y=m[0],b=0;b<c.length;b++){var x=c[b];if(y.length>0)Math.abs(y[0].value-x.value)>=g&&(y=[],m.push(y));y.push(x)}var w=u+t.minNodeSpacing;if(!t.avoidOverlap){var E=m.length>0&&m[0].length>1,_=(Math.min(a.w,a.h)/2-w)/(m.length+E?1:0);w=Math.min(w,_)}for(var k=0,S=0;S<m.length;S++){var P=m[S],j=void 0===t.sweep?2*Math.PI-2*Math.PI/P.length:t.sweep,C=P.dTheta=j/Math.max(1,P.length-1);if(P.length>1&&t.avoidOverlap){var T=Math.cos(C)-Math.cos(0),D=Math.sin(C)-Math.sin(0),N=Math.sqrt(w*w/(T*T+D*D));k=Math.max(N,k)}P.r=k,k+=w}if(t.equidistant){for(var O=0,M=0,A=0;A<m.length;A++){var R=m[A].r-M;O=Math.max(O,R)}M=0;for(var I=0;I<m.length;I++){var L=m[I];0===I&&(M=L.r),L.r=M,M+=O}}for(var B={},F=0;F<m.length;F++)for(var z=m[F],V=z.dTheta,G=z.r,H=0;H<z.length;H++){var W=z[H],q=t.startAngle+(n?1:-1)*V*H,Y={x:s+G*Math.cos(q),y:l+G*Math.sin(q)};B[W.node.id()]=Y}return i.nodes().layoutPositions(this,t,(function(e){var t=e.id();return B[t]})),this};var va={ready:function(){},stop:function(){},animate:!0,animationEasing:void 0,animationDuration:void 0,animateFilter:function(e,t){return!0},animationThreshold:250,refresh:20,fit:!0,padding:30,boundingBox:void 0,nodeDimensionsIncludeLabels:!1,randomize:!1,componentSpacing:40,nodeRepulsion:function(e){return 2048},nodeOverlap:4,idealEdgeLength:function(e){return 32},edgeElasticity:function(e){return 32},nestingFactor:1.2,gravity:1,numIter:1e3,initialTemp:1e3,coolingFactor:.99,minTemp:1};function ga(e){this.options=X({},va,e),this.options.layout=this}ga.prototype.run=function(){var e=this.options,t=e.cy,n=this;n.stopped=!1,!0!==e.animate&&!1!==e.animate||n.emit({type:"layoutstart",layout:n}),ha=!0===e.debug;var r=ma(t,n,e);ha&&undefined(r),e.randomize&&xa(r);var i=re(),o=function(){Ea(r,t,e),!0===e.fit&&t.fit(e.padding)},a=function(t){return!(n.stopped||t>=e.numIter)&&(_a(r,e),r.temperature=r.temperature*e.coolingFactor,!(r.temperature<e.minTemp))},s=function(){if(!0===e.animate||!1===e.animate)o(),n.one("layoutstop",e.stop),n.emit({type:"layoutstop",layout:n});else{var t=e.eles.nodes(),i=wa(r,e,t);t.layoutPositions(n,e,i)}},l=0,c=!0;if(!0===e.animate){!function t(){for(var n=0;c&&n<e.refresh;)c=a(l),l++,n++;c?(re()-i>=e.animationThreshold&&o(),ne(t)):(Ra(r,e),s())}()}else{for(;c;)c=a(l),l++;Ra(r,e),s()}return this},ga.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this},ga.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var ma=function(e,t,n){for(var r=n.eles.edges(),i=n.eles.nodes(),o={isCompound:e.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:i.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:r.size(),temperature:n.initialTemp,clientWidth:e.width(),clientHeight:e.width(),boundingBox:ht(n.boundingBox?n.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()})},a=n.eles.components(),s={},l=0;l<a.length;l++)for(var c=a[l],u=0;u<c.length;u++){s[c[u].id()]=l}for(l=0;l<o.nodeSize;l++){var d=(g=i[l]).layoutDimensions(n);(M={}).isLocked=g.locked(),M.id=g.data("id"),M.parentId=g.data("parent"),M.cmptId=s[g.id()],M.children=[],M.positionX=g.position("x"),M.positionY=g.position("y"),M.offsetX=0,M.offsetY=0,M.height=d.w,M.width=d.h,M.maxX=M.positionX+M.width/2,M.minX=M.positionX-M.width/2,M.maxY=M.positionY+M.height/2,M.minY=M.positionY-M.height/2,M.padLeft=parseFloat(g.style("padding")),M.padRight=parseFloat(g.style("padding")),M.padTop=parseFloat(g.style("padding")),M.padBottom=parseFloat(g.style("padding")),M.nodeRepulsion=T(n.nodeRepulsion)?n.nodeRepulsion(g):n.nodeRepulsion,o.layoutNodes.push(M),o.idToIndex[M.id]=l}var h=[],f=0,p=-1,v=[];for(l=0;l<o.nodeSize;l++){var g,m=(g=o.layoutNodes[l]).parentId;null!=m?o.layoutNodes[o.idToIndex[m]].children.push(g.id):(h[++p]=g.id,v.push(g.id))}for(o.graphSet.push(v);f<=p;){var y=h[f++],b=o.idToIndex[y],x=o.layoutNodes[b].children;if(x.length>0){o.graphSet.push(x);for(l=0;l<x.length;l++)h[++p]=x[l]}}for(l=0;l<o.graphSet.length;l++){var w=o.graphSet[l];for(u=0;u<w.length;u++){var E=o.idToIndex[w[u]];o.indexToGraph[E]=l}}for(l=0;l<o.edgeSize;l++){var _=r[l],k={};k.id=_.data("id"),k.sourceId=_.data("source"),k.targetId=_.data("target");var S=T(n.idealEdgeLength)?n.idealEdgeLength(_):n.idealEdgeLength,P=T(n.edgeElasticity)?n.edgeElasticity(_):n.edgeElasticity,j=o.idToIndex[k.sourceId],C=o.idToIndex[k.targetId];if(o.indexToGraph[j]!=o.indexToGraph[C]){for(var D=ya(k.sourceId,k.targetId,o),N=o.graphSet[D],O=0,M=o.layoutNodes[j];-1===N.indexOf(M.id);)M=o.layoutNodes[o.idToIndex[M.parentId]],O++;for(M=o.layoutNodes[C];-1===N.indexOf(M.id);)M=o.layoutNodes[o.idToIndex[M.parentId]],O++;S*=O*n.nestingFactor}k.idealLength=S,k.elasticity=P,o.layoutEdges.push(k)}return o},ya=function(e,t,n){var r=ba(e,t,0,n);return 2>r.count?0:r.graph},ba=function e(t,n,r,i){var o=i.graphSet[r];if(-1<o.indexOf(t)&&-1<o.indexOf(n))return{count:2,graph:r};for(var a=0,s=0;s<o.length;s++){var l=o[s],c=i.idToIndex[l],u=i.layoutNodes[c].children;if(0!==u.length){var d=e(t,n,i.indexToGraph[i.idToIndex[u[0]]],i);if(0!==d.count){if(1!==d.count)return d;if(2===++a)break}}}return{count:a,graph:r}},xa=function(e,t){for(var n=e.clientWidth,r=e.clientHeight,i=0;i<e.nodeSize;i++){var o=e.layoutNodes[i];0!==o.children.length||o.isLocked||(o.positionX=Math.random()*n,o.positionY=Math.random()*r)}},wa=function(e,t,n){var r=e.boundingBox,i={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0};return t.boundingBox&&(n.forEach((function(t){var n=e.layoutNodes[e.idToIndex[t.data("id")]];i.x1=Math.min(i.x1,n.positionX),i.x2=Math.max(i.x2,n.positionX),i.y1=Math.min(i.y1,n.positionY),i.y2=Math.max(i.y2,n.positionY)})),i.w=i.x2-i.x1,i.h=i.y2-i.y1),function(n,o){var a=e.layoutNodes[e.idToIndex[n.data("id")]];if(t.boundingBox){var s=(a.positionX-i.x1)/i.w,l=(a.positionY-i.y1)/i.h;return{x:r.x1+s*r.w,y:r.y1+l*r.h}}return{x:a.positionX,y:a.positionY}}},Ea=function(e,t,n){var r=n.layout,i=n.eles.nodes(),o=wa(e,n,i);i.positions(o),!0!==e.ready&&(e.ready=!0,r.one("layoutready",n.ready),r.emit({type:"layoutready",layout:this}))},_a=function(e,t,n){ka(e,t),Ta(e),Da(e,t),Na(e),Oa(e)},ka=function(e,t){for(var n=0;n<e.graphSet.length;n++)for(var r=e.graphSet[n],i=r.length,o=0;o<i;o++)for(var a=e.layoutNodes[e.idToIndex[r[o]]],s=o+1;s<i;s++){var l=e.layoutNodes[e.idToIndex[r[s]]];Pa(a,l,e,t)}},Sa=function(e){return-e+2*e*Math.random()},Pa=function(e,t,n,r){if(e.cmptId===t.cmptId||n.isCompound){var i=t.positionX-e.positionX,o=t.positionY-e.positionY;0===i&&0===o&&(i=Sa(1),o=Sa(1));var a=ja(e,t,i,o);if(a>0)var s=(c=r.nodeOverlap*a)*i/(v=Math.sqrt(i*i+o*o)),l=c*o/v;else{var c,u=Ca(e,i,o),d=Ca(t,-1*i,-1*o),h=d.x-u.x,f=d.y-u.y,p=h*h+f*f,v=Math.sqrt(p);s=(c=(e.nodeRepulsion+t.nodeRepulsion)/p)*h/v,l=c*f/v}e.isLocked||(e.offsetX-=s,e.offsetY-=l),t.isLocked||(t.offsetX+=s,t.offsetY+=l)}},ja=function(e,t,n,r){if(n>0)var i=e.maxX-t.minX;else i=t.maxX-e.minX;if(r>0)var o=e.maxY-t.minY;else o=t.maxY-e.minY;return i>=0&&o>=0?Math.sqrt(i*i+o*o):0},Ca=function(e,t,n){var r=e.positionX,i=e.positionY,o=e.height||1,a=e.width||1,s=n/t,l=o/a,c={};return 0===t&&0<n||0===t&&0>n?(c.x=r,c.y=i+o/2,c):0<t&&-1*l<=s&&s<=l?(c.x=r+a/2,c.y=i+a*n/2/t,c):0>t&&-1*l<=s&&s<=l?(c.x=r-a/2,c.y=i-a*n/2/t,c):0<n&&(s<=-1*l||s>=l)?(c.x=r+o*t/2/n,c.y=i+o/2,c):0>n&&(s<=-1*l||s>=l)?(c.x=r-o*t/2/n,c.y=i-o/2,c):c},Ta=function(e,t){for(var n=0;n<e.edgeSize;n++){var r=e.layoutEdges[n],i=e.idToIndex[r.sourceId],o=e.layoutNodes[i],a=e.idToIndex[r.targetId],s=e.layoutNodes[a],l=s.positionX-o.positionX,c=s.positionY-o.positionY;if(0!==l||0!==c){var u=Ca(o,l,c),d=Ca(s,-1*l,-1*c),h=d.x-u.x,f=d.y-u.y,p=Math.sqrt(h*h+f*f),v=Math.pow(r.idealLength-p,2)/r.elasticity;if(0!==p)var g=v*h/p,m=v*f/p;else g=0,m=0;o.isLocked||(o.offsetX+=g,o.offsetY+=m),s.isLocked||(s.offsetX-=g,s.offsetY-=m)}}},Da=function(e,t){if(0!==t.gravity)for(var n=0;n<e.graphSet.length;n++){var r=e.graphSet[n],i=r.length;if(0===n)var o=e.clientHeight/2,a=e.clientWidth/2;else{var s=e.layoutNodes[e.idToIndex[r[0]]],l=e.layoutNodes[e.idToIndex[s.parentId]];o=l.positionX,a=l.positionY}for(var c=0;c<i;c++){var u=e.layoutNodes[e.idToIndex[r[c]]];if(!u.isLocked){var d=o-u.positionX,h=a-u.positionY,f=Math.sqrt(d*d+h*h);if(f>1){var p=t.gravity*d/f,v=t.gravity*h/f;u.offsetX+=p,u.offsetY+=v}}}}},Na=function(e,t){var n=[],r=0,i=-1;for(n.push.apply(n,e.graphSet[0]),i+=e.graphSet[0].length;r<=i;){var o=n[r++],a=e.idToIndex[o],s=e.layoutNodes[a],l=s.children;if(0<l.length&&!s.isLocked){for(var c=s.offsetX,u=s.offsetY,d=0;d<l.length;d++){var h=e.layoutNodes[e.idToIndex[l[d]]];h.offsetX+=c,h.offsetY+=u,n[++i]=l[d]}s.offsetX=0,s.offsetY=0}}},Oa=function(e,t){for(var n=0;n<e.nodeSize;n++){0<(i=e.layoutNodes[n]).children.length&&(i.maxX=void 0,i.minX=void 0,i.maxY=void 0,i.minY=void 0)}for(n=0;n<e.nodeSize;n++){if(!(0<(i=e.layoutNodes[n]).children.length||i.isLocked)){var r=Ma(i.offsetX,i.offsetY,e.temperature);i.positionX+=r.x,i.positionY+=r.y,i.offsetX=0,i.offsetY=0,i.minX=i.positionX-i.width,i.maxX=i.positionX+i.width,i.minY=i.positionY-i.height,i.maxY=i.positionY+i.height,Aa(i,e)}}for(n=0;n<e.nodeSize;n++){var i;0<(i=e.layoutNodes[n]).children.length&&!i.isLocked&&(i.positionX=(i.maxX+i.minX)/2,i.positionY=(i.maxY+i.minY)/2,i.width=i.maxX-i.minX,i.height=i.maxY-i.minY)}},Ma=function(e,t,n){var r=Math.sqrt(e*e+t*t);if(r>n)var i={x:n*e/r,y:n*t/r};else i={x:e,y:t};return i},Aa=function e(t,n){var r=t.parentId;if(null!=r){var i=n.layoutNodes[n.idToIndex[r]],o=!1;return(null==i.maxX||t.maxX+i.padRight>i.maxX)&&(i.maxX=t.maxX+i.padRight,o=!0),(null==i.minX||t.minX-i.padLeft<i.minX)&&(i.minX=t.minX-i.padLeft,o=!0),(null==i.maxY||t.maxY+i.padBottom>i.maxY)&&(i.maxY=t.maxY+i.padBottom,o=!0),(null==i.minY||t.minY-i.padTop<i.minY)&&(i.minY=t.minY-i.padTop,o=!0),o?e(i,n):void 0}},Ra=function(e,t){for(var n=e.layoutNodes,r=[],i=0;i<n.length;i++){var o=n[i],a=o.cmptId;(r[a]=r[a]||[]).push(o)}var s=0;for(i=0;i<r.length;i++){if(v=r[i]){v.x1=1/0,v.x2=-1/0,v.y1=1/0,v.y2=-1/0;for(var l=0;l<v.length;l++){var c=v[l];v.x1=Math.min(v.x1,c.positionX-c.width/2),v.x2=Math.max(v.x2,c.positionX+c.width/2),v.y1=Math.min(v.y1,c.positionY-c.height/2),v.y2=Math.max(v.y2,c.positionY+c.height/2)}v.w=v.x2-v.x1,v.h=v.y2-v.y1,s+=v.w*v.h}}r.sort((function(e,t){return t.w*t.h-e.w*e.h}));var u=0,d=0,h=0,f=0,p=Math.sqrt(s)*e.clientWidth/e.clientHeight;for(i=0;i<r.length;i++){var v;if(v=r[i]){for(l=0;l<v.length;l++){(c=v[l]).isLocked||(c.positionX+=u-v.x1,c.positionY+=d-v.y1)}u+=v.w+t.componentSpacing,h+=v.w+t.componentSpacing,f=Math.max(f,v.h),h>p&&(d+=f+t.componentSpacing,u=0,h=0,f=0)}}},Ia={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,avoidOverlapPadding:10,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,condense:!1,rows:void 0,cols:void 0,position:function(e){},sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function La(e){this.options=X({},Ia,e)}La.prototype.run=function(){var e=this.options,t=e,n=e.cy,r=t.eles,i=r.nodes().not(":parent");t.sort&&(i=i.sort(t.sort));var o=ht(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()});if(0===o.h||0===o.w)r.nodes().layoutPositions(this,t,(function(e){return{x:o.x1,y:o.y1}}));else{var a=i.size(),s=Math.sqrt(a*o.h/o.w),l=Math.round(s),c=Math.round(o.w/o.h*s),u=function(e){if(null==e)return Math.min(l,c);Math.min(l,c)==l?l=e:c=e},d=function(e){if(null==e)return Math.max(l,c);Math.max(l,c)==l?l=e:c=e},h=t.rows,f=null!=t.cols?t.cols:t.columns;if(null!=h&&null!=f)l=h,c=f;else if(null!=h&&null==f)l=h,c=Math.ceil(a/l);else if(null==h&&null!=f)c=f,l=Math.ceil(a/c);else if(c*l>a){var p=u(),v=d();(p-1)*v>=a?u(p-1):(v-1)*p>=a&&d(v-1)}else for(;c*l<a;){var g=u(),m=d();(m+1)*g>=a?d(m+1):u(g+1)}var y=o.w/c,b=o.h/l;if(t.condense&&(y=0,b=0),t.avoidOverlap)for(var x=0;x<i.length;x++){var w=i[x],E=w._private.position;null!=E.x&&null!=E.y||(E.x=0,E.y=0);var _=w.layoutDimensions(t),k=t.avoidOverlapPadding,S=_.w+k,P=_.h+k;y=Math.max(y,S),b=Math.max(b,P)}for(var j={},C=function(e,t){return!!j["c-"+e+"-"+t]},T=function(e,t){j["c-"+e+"-"+t]=!0},D=0,N=0,O=function(){++N>=c&&(N=0,D++)},M={},A=0;A<i.length;A++){var R=i[A],I=t.position(R);if(I&&(void 0!==I.row||void 0!==I.col)){var L={row:I.row,col:I.col};if(void 0===L.col)for(L.col=0;C(L.row,L.col);)L.col++;else if(void 0===L.row)for(L.row=0;C(L.row,L.col);)L.row++;M[R.id()]=L,T(L.row,L.col)}}i.layoutPositions(this,t,(function(e,t){var n,r;if(e.locked()||e.isParent())return!1;var i=M[e.id()];if(i)n=i.col*y+y/2+o.x1,r=i.row*b+b/2+o.y1;else{for(;C(D,N);)O();n=N*y+y/2+o.x1,r=D*b+b/2+o.y1,T(D,N),O()}return{x:n,y:r}}))}return this};var Ba={ready:function(){},stop:function(){}};function Fa(e){this.options=X({},Ba,e)}Fa.prototype.run=function(){var e=this.options,t=e.eles,n=this;return e.cy,n.emit("layoutstart"),t.nodes().positions((function(){return{x:0,y:0}})),n.one("layoutready",e.ready),n.emit("layoutready"),n.one("layoutstop",e.stop),n.emit("layoutstop"),this},Fa.prototype.stop=function(){return this};var za={positions:void 0,zoom:void 0,pan:void 0,fit:!0,padding:30,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function Va(e){this.options=X({},za,e)}Va.prototype.run=function(){var e=this.options,t=e.eles.nodes(),n=T(e.positions);return t.layoutPositions(this,e,(function(t,r){var i=function(t){if(null==e.positions)return function(e){return{x:e.x,y:e.y}}(t.position());if(n)return e.positions(t);var r=e.positions[t._private.data.id];return null==r?null:r}(t);return!t.locked()&&null!=i&&i})),this};var Ga={fit:!0,padding:30,boundingBox:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function Ha(e){this.options=X({},Ga,e)}Ha.prototype.run=function(){var e=this.options,t=e.cy,n=e.eles,r=ht(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:t.width(),h:t.height()});return n.nodes().layoutPositions(this,e,(function(e,t){return{x:r.x1+Math.round(Math.random()*r.w),y:r.y1+Math.round(Math.random()*r.h)}})),this};var Wa=[{name:"breadthfirst",impl:ca},{name:"circle",impl:da},{name:"concentric",impl:pa},{name:"cose",impl:ga},{name:"grid",impl:La},{name:"null",impl:Fa},{name:"preset",impl:Va},{name:"random",impl:Ha}];function qa(e){this.options=e,this.notifications=0}var Ya=function(){},Ua=function(){throw new Error("A headless instance can not render images")};qa.prototype={recalculateRenderedStyle:Ya,notify:function(){this.notifications++},init:Ya,isHeadless:function(){return!0},png:Ua,jpg:Ua};var Xa={arrowShapeWidth:.3,registerArrowShapes:function(){var e=this.arrowShapes={},t=this,n=function(e,t,n,r,i,o,a){var s=i.x-n/2-a,l=i.x+n/2+a,c=i.y-n/2-a,u=i.y+n/2+a;return s<=e&&e<=l&&c<=t&&t<=u},r=function(e,t,n,r,i){var o=e*Math.cos(r)-t*Math.sin(r),a=(e*Math.sin(r)+t*Math.cos(r))*n;return{x:o*n+i.x,y:a+i.y}},i=function(e,t,n,i){for(var o=[],a=0;a<e.length;a+=2){var s=e[a],l=e[a+1];o.push(r(s,l,t,n,i))}return o},o=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];t.push(r.x,r.y)}return t},a=function(e){return e.pstyle("width").pfValue*e.pstyle("arrow-scale").pfValue*2},s=function(r,s){C(s)&&(s=e[s]),e[r]=X({name:r,points:[-.15,-.3,.15,-.3,.15,.3,-.15,.3],collide:function(e,t,n,r,a,s){var l=o(i(this.points,n+2*s,r,a));return St(e,t,l)},roughCollide:n,draw:function(e,n,r,o){var a=i(this.points,n,r,o);t.arrowShapeImpl("polygon")(e,a)},spacing:function(e){return 0},gap:a},s)};s("none",{collide:xe,roughCollide:xe,draw:Ee,spacing:we,gap:we}),s("triangle",{points:[-.15,-.3,0,0,.15,-.3]}),s("arrow","triangle"),s("triangle-backcurve",{points:e.triangle.points,controlPoint:[0,-.15],roughCollide:n,draw:function(e,n,o,a,s){var l=i(this.points,n,o,a),c=this.controlPoint,u=r(c[0],c[1],n,o,a);t.arrowShapeImpl(this.name)(e,l,u)},gap:function(e){return.8*a(e)}}),s("triangle-tee",{points:[0,0,.15,-.3,-.15,-.3,0,0],pointsTee:[-.15,-.4,-.15,-.5,.15,-.5,.15,-.4],collide:function(e,t,n,r,a,s,l){var c=o(i(this.points,n+2*l,r,a)),u=o(i(this.pointsTee,n+2*l,r,a));return St(e,t,c)||St(e,t,u)},draw:function(e,n,r,o,a){var s=i(this.points,n,r,o),l=i(this.pointsTee,n,r,o);t.arrowShapeImpl(this.name)(e,s,l)}}),s("circle-triangle",{radius:.15,pointsTr:[0,-.15,.15,-.45,-.15,-.45,0,-.15],collide:function(e,t,n,r,a,s,l){var c=a,u=Math.pow(c.x-e,2)+Math.pow(c.y-t,2)<=Math.pow((n+2*l)*this.radius,2),d=o(i(this.points,n+2*l,r,a));return St(e,t,d)||u},draw:function(e,n,r,o,a){var s=i(this.pointsTr,n,r,o);t.arrowShapeImpl(this.name)(e,s,o.x,o.y,this.radius*n)},spacing:function(e){return t.getArrowWidth(e.pstyle("width").pfValue,e.pstyle("arrow-scale").value)*this.radius}}),s("triangle-cross",{points:[0,0,.15,-.3,-.15,-.3,0,0],baseCrossLinePts:[-.15,-.4,-.15,-.4,.15,-.4,.15,-.4],crossLinePts:function(e,t){var n=this.baseCrossLinePts.slice(),r=t/e;return n[3]=n[3]-r,n[5]=n[5]-r,n},collide:function(e,t,n,r,a,s,l){var c=o(i(this.points,n+2*l,r,a)),u=o(i(this.crossLinePts(n,s),n+2*l,r,a));return St(e,t,c)||St(e,t,u)},draw:function(e,n,r,o,a){var s=i(this.points,n,r,o),l=i(this.crossLinePts(n,a),n,r,o);t.arrowShapeImpl(this.name)(e,s,l)}}),s("vee",{points:[-.15,-.3,0,0,.15,-.3,0,-.15],gap:function(e){return.525*a(e)}}),s("circle",{radius:.15,collide:function(e,t,n,r,i,o,a){var s=i;return Math.pow(s.x-e,2)+Math.pow(s.y-t,2)<=Math.pow((n+2*a)*this.radius,2)},draw:function(e,n,r,i,o){t.arrowShapeImpl(this.name)(e,i.x,i.y,this.radius*n)},spacing:function(e){return t.getArrowWidth(e.pstyle("width").pfValue,e.pstyle("arrow-scale").value)*this.radius}}),s("tee",{points:[-.15,0,-.15,-.1,.15,-.1,.15,0],spacing:function(e){return 1},gap:function(e){return 1}}),s("square",{points:[-.15,0,.15,0,.15,-.3,-.15,-.3]}),s("diamond",{points:[-.15,-.15,0,-.3,.15,-.15,0,0],gap:function(e){return e.pstyle("width").pfValue*e.pstyle("arrow-scale").value}}),s("chevron",{points:[0,0,-.15,-.15,-.1,-.2,0,-.1,.1,-.2,.15,-.15],gap:function(e){return.95*e.pstyle("width").pfValue*e.pstyle("arrow-scale").value}})}},$a={projectIntoViewport:function(e,t){var n=this.cy,r=this.findContainerClientCoords(),i=r[0],o=r[1],a=r[4],s=n.pan(),l=n.zoom();return[((e-i)/a-s.x)/l,((t-o)/a-s.y)/l]},findContainerClientCoords:function(){if(this.containerBB)return this.containerBB;var e=this.container,t=e.getBoundingClientRect(),n=w.getComputedStyle(e),r=function(e){return parseFloat(n.getPropertyValue(e))},i=r("padding-left"),o=r("padding-right"),a=r("padding-top"),s=r("padding-bottom"),l=r("border-left-width"),c=r("border-right-width"),u=r("border-top-width"),d=(r("border-bottom-width"),e.clientWidth),h=e.clientHeight,f=i+o,p=a+s,v=l+c,g=t.width/(d+v),m=d-f,y=h-p,b=t.left+i+l,x=t.top+a+u;return this.containerBB=[b,x,m,y,g]},invalidateContainerClientCoordsCache:function(){this.containerBB=null},findNearestElement:function(e,t,n,r){return this.findNearestElements(e,t,n,r)[0]},findNearestElements:function(e,t,n,r){var i,o,a=this,s=this,l=s.getCachedZSortedEles(),c=[],u=s.cy.zoom(),d=s.cy.hasCompoundNodes(),h=(r?24:8)/u,f=(r?8:2)/u,p=(r?8:2)/u,v=1/0;function g(e,t){if(e.isNode()){if(o)return;o=e,c.push(e)}if(e.isEdge()&&(null==t||t<v))if(i){if(i.pstyle("z-compound-depth").value===e.pstyle("z-compound-depth").value&&i.pstyle("z-compound-depth").value===e.pstyle("z-compound-depth").value)for(var n=0;n<c.length;n++)if(c[n].isEdge()){c[n]=e,i=e,v=null!=t?t:v;break}}else c.push(e),i=e,v=null!=t?t:v}function m(n){var r=n.outerWidth()+2*f,i=n.outerHeight()+2*f,o=r/2,l=i/2,c=n.position();if(c.x-o<=e&&e<=c.x+o&&c.y-l<=t&&t<=c.y+l&&s.nodeShapes[a.getNodeShape(n)].checkPoint(e,t,0,r,i,c.x,c.y))return g(n,0),!0}function y(n){var r,i=n._private,o=i.rscratch,l=n.pstyle("width").pfValue,u=n.pstyle("arrow-scale").value,f=l/2+h,p=f*f,v=2*f,y=i.source,b=i.target;if("segments"===o.edgeType||"straight"===o.edgeType||"haystack"===o.edgeType){for(var x=o.allpts,w=0;w+3<x.length;w+=2)if(wt(e,t,x[w],x[w+1],x[w+2],x[w+3],v)&&p>(r=kt(e,t,x[w],x[w+1],x[w+2],x[w+3])))return g(n,r),!0}else if("bezier"===o.edgeType||"multibezier"===o.edgeType||"self"===o.edgeType||"compound"===o.edgeType)for(x=o.allpts,w=0;w+5<o.allpts.length;w+=4)if(Et(e,t,x[w],x[w+1],x[w+2],x[w+3],x[w+4],x[w+5],v)&&p>(r=_t(e,t,x[w],x[w+1],x[w+2],x[w+3],x[w+4],x[w+5])))return g(n,r),!0;y=y||i.source,b=b||i.target;var E=a.getArrowWidth(l,u),_=[{name:"source",x:o.arrowStartX,y:o.arrowStartY,angle:o.srcArrowAngle},{name:"target",x:o.arrowEndX,y:o.arrowEndY,angle:o.tgtArrowAngle},{name:"mid-source",x:o.midX,y:o.midY,angle:o.midsrcArrowAngle},{name:"mid-target",x:o.midX,y:o.midY,angle:o.midtgtArrowAngle}];for(w=0;w<_.length;w++){var k=_[w],S=s.arrowShapes[n.pstyle(k.name+"-arrow-shape").value],P=n.pstyle("width").pfValue;if(S.roughCollide(e,t,E,k.angle,{x:k.x,y:k.y},P,h)&&S.collide(e,t,E,k.angle,{x:k.x,y:k.y},P,h))return g(n),!0}d&&c.length>0&&(m(y),m(b))}function b(e,t,n){return Me(e,t,n)}function x(n,r){var i,o=n._private,a=p;i=r?r+"-":"",n.boundingBox();var s=o.labelBounds[r||"main"],l=n.pstyle(i+"label").value;if("yes"===n.pstyle("text-events").strValue&&l){var c=b(o.rscratch,"labelX",r),u=b(o.rscratch,"labelY",r),d=b(o.rscratch,"labelAngle",r),h=n.pstyle(i+"text-margin-x").pfValue,f=n.pstyle(i+"text-margin-y").pfValue,v=s.x1-a-h,m=s.x2+a-h,y=s.y1-a-f,x=s.y2+a-f;if(d){var w=Math.cos(d),E=Math.sin(d),_=function(e,t){return{x:(e-=c)*w-(t-=u)*E+c,y:e*E+t*w+u}},k=_(v,y),S=_(v,x),P=_(m,y),j=_(m,x),C=[k.x+h,k.y+f,P.x+h,P.y+f,j.x+h,j.y+f,S.x+h,S.y+f];if(St(e,t,C))return g(n),!0}else if(yt(s,e,t))return g(n),!0}}n&&(l=l.interactive);for(var w=l.length-1;w>=0;w--){var E=l[w];E.isNode()?m(E)||x(E):y(E)||x(E)||x(E,"source")||x(E,"target")}return c},getAllInBox:function(e,t,n,r){for(var i,o,a=this.getCachedZSortedEles().interactive,s=[],l=Math.min(e,n),c=Math.max(e,n),u=Math.min(t,r),d=Math.max(t,r),h=ht({x1:e=l,y1:t=u,x2:n=c,y2:r=d}),f=0;f<a.length;f++){var p=a[f];if(p.isNode()){var v=p,g=v.boundingBox({includeNodes:!0,includeEdges:!1,includeLabels:!1});mt(h,g)&&!bt(g,h)&&s.push(v)}else{var m=p,y=m._private,b=y.rscratch;if(null!=b.startX&&null!=b.startY&&!yt(h,b.startX,b.startY))continue;if(null!=b.endX&&null!=b.endY&&!yt(h,b.endX,b.endY))continue;if("bezier"===b.edgeType||"multibezier"===b.edgeType||"self"===b.edgeType||"compound"===b.edgeType||"segments"===b.edgeType||"haystack"===b.edgeType){for(var x=y.rstyle.bezierPts||y.rstyle.linePts||y.rstyle.haystackPts,w=!0,E=0;E<x.length;E++)if(i=h,o=x[E],!yt(i,o.x,o.y)){w=!1;break}w&&s.push(m)}else"haystack"!==b.edgeType&&"straight"!==b.edgeType||s.push(m)}}return s}},Ka={calculateArrowAngles:function(e){var t,n,r,i,o,a,s=e._private.rscratch,l="haystack"===s.edgeType,c="bezier"===s.edgeType,u="multibezier"===s.edgeType,d="segments"===s.edgeType,h="compound"===s.edgeType,f="self"===s.edgeType;if(l?(r=s.haystackPts[0],i=s.haystackPts[1],o=s.haystackPts[2],a=s.haystackPts[3]):(r=s.arrowStartX,i=s.arrowStartY,o=s.arrowEndX,a=s.arrowEndY),v=s.midX,g=s.midY,d)t=r-s.segpts[0],n=i-s.segpts[1];else if(u||h||f||c){var p=s.allpts;t=r-ct(p[0],p[2],p[4],.1),n=i-ct(p[1],p[3],p[5],.1)}else t=r-v,n=i-g;s.srcArrowAngle=rt(t,n);var v=s.midX,g=s.midY;if(l&&(v=(r+o)/2,g=(i+a)/2),t=o-r,n=a-i,d)if((p=s.allpts).length/2%2==0){var m=(y=p.length/2)-2;t=p[y]-p[m],n=p[y+1]-p[m+1]}else{m=(y=p.length/2-1)-2;var y,b=y+2;t=p[y]-p[m],n=p[y+1]-p[m+1]}else if(u||h||f){var x,w,E,_,p=s.allpts;if(s.ctrlpts.length/2%2==0){var k=(S=(P=p.length/2-1)+2)+2;x=ct(p[P],p[S],p[k],0),w=ct(p[P+1],p[S+1],p[k+1],0),E=ct(p[P],p[S],p[k],1e-4),_=ct(p[P+1],p[S+1],p[k+1],1e-4)}else{var S,P;k=(S=p.length/2-1)+2;x=ct(p[P=S-2],p[S],p[k],.4999),w=ct(p[P+1],p[S+1],p[k+1],.4999),E=ct(p[P],p[S],p[k],.5),_=ct(p[P+1],p[S+1],p[k+1],.5)}t=E-x,n=_-w}(s.midtgtArrowAngle=rt(t,n),s.midDispX=t,s.midDispY=n,t*=-1,n*=-1,d)&&((p=s.allpts).length/2%2==0||(t=-(p[b=(y=p.length/2-1)+2]-p[y]),n=-(p[b+1]-p[y+1])));if(s.midsrcArrowAngle=rt(t,n),d)t=o-s.segpts[s.segpts.length-2],n=a-s.segpts[s.segpts.length-1];else if(u||h||f||c){var j=(p=s.allpts).length;t=o-ct(p[j-6],p[j-4],p[j-2],.9),n=a-ct(p[j-5],p[j-3],p[j-1],.9)}else t=o-v,n=a-g;s.tgtArrowAngle=rt(t,n)}};Ka.getArrowWidth=Ka.getArrowHeight=function(e,t){var n=this.arrowWidthCache=this.arrowWidthCache||{},r=n[e+", "+t];return r||(r=Math.max(Math.pow(13.37*e,.9),29)*t,n[e+", "+t]=r,r)};var Za={};function Qa(e){var t=[];if(null!=e){for(var n=0;n<e.length;n+=2){var r=e[n],i=e[n+1];t.push({x:r,y:i})}return t}}Za.findHaystackPoints=function(e){for(var t=0;t<e.length;t++){var n=e[t],r=n._private,i=r.rscratch;if(!i.haystack){var o=2*Math.random()*Math.PI;i.source={x:Math.cos(o),y:Math.sin(o)},o=2*Math.random()*Math.PI,i.target={x:Math.cos(o),y:Math.sin(o)}}var a=r.source,s=r.target,l=a.position(),c=s.position(),u=a.width(),d=s.width(),h=a.height(),f=s.height(),p=n.pstyle("haystack-radius").value/2;i.haystackPts=i.allpts=[i.source.x*u*p+l.x,i.source.y*h*p+l.y,i.target.x*d*p+c.x,i.target.y*f*p+c.y],i.midX=(i.allpts[0]+i.allpts[2])/2,i.midY=(i.allpts[1]+i.allpts[3])/2,i.edgeType="haystack",i.haystack=!0,this.storeEdgeProjections(n),this.calculateArrowAngles(n),this.recalculateEdgeLabelProjections(n),this.calculateLabelAngles(n)}},Za.findSegmentsPoints=function(e,t){var n=e._private.rscratch,r=t.posPts,i=t.intersectionPts,o=t.vectorNormInverse,a=e.pstyle("edge-distances").value,s=e.pstyle("segment-weights"),l=e.pstyle("segment-distances"),c=Math.min(s.pfValue.length,l.pfValue.length);n.edgeType="segments",n.segpts=[];for(var u=0;u<c;u++){var d=s.pfValue[u],h=l.pfValue[u],f=1-d,p=d,v="node-position"===a?r:i,g={x:v.x1*f+v.x2*p,y:v.y1*f+v.y2*p};n.segpts.push(g.x+o.x*h,g.y+o.y*h)}},Za.findLoopPoints=function(e,t,n,r){var i=e._private.rscratch,o=t.dirCounts,a=t.srcPos,s=e.pstyle("control-point-distances"),l=s?s.pfValue[0]:void 0,c=e.pstyle("loop-direction").pfValue,u=e.pstyle("loop-sweep").pfValue,d=e.pstyle("control-point-step-size").pfValue;i.edgeType="self";var h=n,f=d;r&&(h=0,f=l);var p=c-Math.PI/2,v=p-u/2,g=p+u/2,m=String(c+"_"+u);h=void 0===o[m]?o[m]=0:++o[m],i.ctrlpts=[a.x+1.4*Math.cos(v)*f*(h/3+1),a.y+1.4*Math.sin(v)*f*(h/3+1),a.x+1.4*Math.cos(g)*f*(h/3+1),a.y+1.4*Math.sin(g)*f*(h/3+1)]},Za.findCompoundLoopPoints=function(e,t,n,r){var i=e._private.rscratch;i.edgeType="compound";var o=t.srcPos,a=t.tgtPos,s=t.srcW,l=t.srcH,c=t.tgtW,u=t.tgtH,d=e.pstyle("control-point-step-size").pfValue,h=e.pstyle("control-point-distances"),f=h?h.pfValue[0]:void 0,p=n,v=d;r&&(p=0,v=f);var g={x:o.x-s/2,y:o.y-l/2},m={x:a.x-c/2,y:a.y-u/2},y={x:Math.min(g.x,m.x),y:Math.min(g.y,m.y)},b=Math.max(.5,Math.log(.01*s)),x=Math.max(.5,Math.log(.01*c));i.ctrlpts=[y.x,y.y-(1+Math.pow(50,1.12)/100)*v*(p/3+1)*b,y.x-(1+Math.pow(50,1.12)/100)*v*(p/3+1)*x,y.y]},Za.findStraightEdgePoints=function(e){e._private.rscratch.edgeType="straight"},Za.findBezierPoints=function(e,t,n,r,i){var o=e._private.rscratch,a=t.vectorNormInverse,s=t.posPts,l=t.intersectionPts,c=e.pstyle("edge-distances").value,u=e.pstyle("control-point-step-size").pfValue,d=e.pstyle("control-point-distances"),h=e.pstyle("control-point-weights"),f=d&&h?Math.min(d.value.length,h.value.length):1,p=d?d.pfValue[0]:void 0,v=h.value[0],g=r;o.edgeType=g?"multibezier":"bezier",o.ctrlpts=[];for(var m=0;m<f;m++){var y=(.5-t.eles.length/2+n)*u*(i?-1:1),b=void 0,x=ot(y);g&&(p=d?d.pfValue[m]:u,v=h.value[m]);var w=void 0!==(b=r?p:void 0!==p?x*p:void 0)?b:y,E=1-v,_=v,k="node-position"===c?s:l,S={x:k.x1*E+k.x2*_,y:k.y1*E+k.y2*_};o.ctrlpts.push(S.x+a.x*w,S.y+a.y*w)}},Za.findTaxiPoints=function(e,t){var n=e._private.rscratch;n.edgeType="segments";var r="vertical",i="horizontal",o="leftward",a="rightward",s="downward",l="upward",c=t.posPts,u=t.srcW,d=t.srcH,h=t.tgtW,f=t.tgtH,p="node-position"!==e.pstyle("edge-distances").value,v=e.pstyle("taxi-direction").value,g=v,m=e.pstyle("taxi-turn"),y="%"===m.units,b=m.pfValue,x=b<0,w=e.pstyle("taxi-turn-min-distance").pfValue,E=p?(u+h)/2:0,_=p?(d+f)/2:0,k=c.x2-c.x1,S=c.y2-c.y1,P=function(e,t){return e>0?Math.max(e-t,0):Math.min(e+t,0)},j=P(k,E),C=P(S,_),T=!1;"auto"===g?v=Math.abs(j)>Math.abs(C)?i:r:g===l||g===s?(v=r,T=!0):g!==o&&g!==a||(v=i,T=!0);var D,N=v===r,O=N?C:j,M=N?S:k,A=ot(M),R=!1;(T&&(y||x)||!(g===s&&M<0||g===l&&M>0||g===o&&M>0||g===a&&M<0)||(O=(A*=-1)*Math.abs(O),R=!0),y)?D=(b<0?1+b:b)*O:D=(b<0?O:0)+b*A;var I=function(e){return Math.abs(e)<w||Math.abs(e)>=Math.abs(O)},L=I(D),B=I(Math.abs(O)-Math.abs(D));if((L||B)&&!R)if(N){var F=Math.abs(M)<=d/2,z=Math.abs(k)<=h/2;if(F){var V=(c.x1+c.x2)/2,G=c.y1,H=c.y2;n.segpts=[V,G,V,H]}else if(z){var W=(c.y1+c.y2)/2,q=c.x1,Y=c.x2;n.segpts=[q,W,Y,W]}else n.segpts=[c.x1,c.y2]}else{var U=Math.abs(M)<=u/2,X=Math.abs(S)<=f/2;if(U){var $=(c.y1+c.y2)/2,K=c.x1,Z=c.x2;n.segpts=[K,$,Z,$]}else if(X){var Q=(c.x1+c.x2)/2,J=c.y1,ee=c.y2;n.segpts=[Q,J,Q,ee]}else n.segpts=[c.x2,c.y1]}else if(N){var te=c.y1+D+(p?d/2*A:0),ne=c.x1,re=c.x2;n.segpts=[ne,te,re,te]}else{var ie=c.x1+D+(p?u/2*A:0),oe=c.y1,ae=c.y2;n.segpts=[ie,oe,ie,ae]}},Za.tryToCorrectInvalidPoints=function(e,t){var n=e._private.rscratch;if("bezier"===n.edgeType){var r=t.srcPos,i=t.tgtPos,o=t.srcW,a=t.srcH,s=t.tgtW,l=t.tgtH,c=t.srcShape,u=t.tgtShape,d=!O(n.startX)||!O(n.startY),h=!O(n.arrowStartX)||!O(n.arrowStartY),f=!O(n.endX)||!O(n.endY),p=!O(n.arrowEndX)||!O(n.arrowEndY),v=3*(this.getArrowWidth(e.pstyle("width").pfValue,e.pstyle("arrow-scale").value)*this.arrowShapeWidth),g=at({x:n.ctrlpts[0],y:n.ctrlpts[1]},{x:n.startX,y:n.startY}),m=g<v,y=at({x:n.ctrlpts[0],y:n.ctrlpts[1]},{x:n.endX,y:n.endY}),b=y<v,x=!1;if(d||h||m){x=!0;var w={x:n.ctrlpts[0]-r.x,y:n.ctrlpts[1]-r.y},E=Math.sqrt(w.x*w.x+w.y*w.y),_={x:w.x/E,y:w.y/E},k=Math.max(o,a),S={x:n.ctrlpts[0]+2*_.x*k,y:n.ctrlpts[1]+2*_.y*k},P=c.intersectLine(r.x,r.y,o,a,S.x,S.y,0);m?(n.ctrlpts[0]=n.ctrlpts[0]+_.x*(v-g),n.ctrlpts[1]=n.ctrlpts[1]+_.y*(v-g)):(n.ctrlpts[0]=P[0]+_.x*v,n.ctrlpts[1]=P[1]+_.y*v)}if(f||p||b){x=!0;var j={x:n.ctrlpts[0]-i.x,y:n.ctrlpts[1]-i.y},C=Math.sqrt(j.x*j.x+j.y*j.y),T={x:j.x/C,y:j.y/C},D=Math.max(o,a),N={x:n.ctrlpts[0]+2*T.x*D,y:n.ctrlpts[1]+2*T.y*D},M=u.intersectLine(i.x,i.y,s,l,N.x,N.y,0);b?(n.ctrlpts[0]=n.ctrlpts[0]+T.x*(v-y),n.ctrlpts[1]=n.ctrlpts[1]+T.y*(v-y)):(n.ctrlpts[0]=M[0]+T.x*v,n.ctrlpts[1]=M[1]+T.y*v)}x&&this.findEndpoints(e)}},Za.storeAllpts=function(e){var t=e._private.rscratch;if("multibezier"===t.edgeType||"bezier"===t.edgeType||"self"===t.edgeType||"compound"===t.edgeType){t.allpts=[],t.allpts.push(t.startX,t.startY);for(var n=0;n+1<t.ctrlpts.length;n+=2)t.allpts.push(t.ctrlpts[n],t.ctrlpts[n+1]),n+3<t.ctrlpts.length&&t.allpts.push((t.ctrlpts[n]+t.ctrlpts[n+2])/2,(t.ctrlpts[n+1]+t.ctrlpts[n+3])/2);var r;t.allpts.push(t.endX,t.endY),t.ctrlpts.length/2%2==0?(r=t.allpts.length/2-1,t.midX=t.allpts[r],t.midY=t.allpts[r+1]):(r=t.allpts.length/2-3,.5,t.midX=ct(t.allpts[r],t.allpts[r+2],t.allpts[r+4],.5),t.midY=ct(t.allpts[r+1],t.allpts[r+3],t.allpts[r+5],.5))}else if("straight"===t.edgeType)t.allpts=[t.startX,t.startY,t.endX,t.endY],t.midX=(t.startX+t.endX+t.arrowStartX+t.arrowEndX)/4,t.midY=(t.startY+t.endY+t.arrowStartY+t.arrowEndY)/4;else if("segments"===t.edgeType)if(t.allpts=[],t.allpts.push(t.startX,t.startY),t.allpts.push.apply(t.allpts,t.segpts),t.allpts.push(t.endX,t.endY),t.segpts.length%4==0){var i=t.segpts.length/2,o=i-2;t.midX=(t.segpts[o]+t.segpts[i])/2,t.midY=(t.segpts[o+1]+t.segpts[i+1])/2}else{var a=t.segpts.length/2-1;t.midX=t.segpts[a],t.midY=t.segpts[a+1]}},Za.checkForInvalidEdgeWarning=function(e){var t=e[0]._private.rscratch;t.nodesOverlap||O(t.startX)&&O(t.startY)&&O(t.endX)&&O(t.endY)?t.loggedErr=!1:t.loggedErr||(t.loggedErr=!0,Se("Edge `"+e.id()+"` has invalid endpoints and so it is impossible to draw. Adjust your edge style (e.g. control points) accordingly or use an alternative edge type. This is expected behaviour when the source node and the target node overlap."))},Za.findEdgeControlPoints=function(e){var t=this;if(e&&0!==e.length){for(var n=this,r=n.cy.hasCompoundNodes(),i={map:new Re,get:function(e){var t=this.map.get(e[0]);return null!=t?t.get(e[1]):null},set:function(e,t){var n=this.map.get(e[0]);null==n&&(n=new Re,this.map.set(e[0],n)),n.set(e[1],t)}},o=[],a=[],s=0;s<e.length;s++){var l=e[s],c=l._private,u=l.pstyle("curve-style").value;if(!l.removed()&&l.takesUpSpace())if("haystack"!==u){var d="unbundled-bezier"===u||"segments"===u||"straight"===u||"straight-triangle"===u||"taxi"===u,h="unbundled-bezier"===u||"bezier"===u,f=c.source,p=c.target,v=[f.poolIndex(),p.poolIndex()].sort(),g=i.get(v);null==g&&(g={eles:[]},i.set(v,g),o.push(v)),g.eles.push(l),d&&(g.hasUnbundled=!0),h&&(g.hasBezier=!0)}else a.push(l)}for(var m=function(e){var a=o[e],s=i.get(a),l=void 0;if(!s.hasUnbundled){var c=s.eles[0].parallelEdges().filter((function(e){return e.isBundledBezier()}));Oe(s.eles),c.forEach((function(e){return s.eles.push(e)})),s.eles.sort((function(e,t){return e.poolIndex()-t.poolIndex()}))}var u=s.eles[0],d=u.source(),h=u.target();if(d.poolIndex()>h.poolIndex()){var f=d;d=h,h=f}var p=s.srcPos=d.position(),v=s.tgtPos=h.position(),g=s.srcW=d.outerWidth(),m=s.srcH=d.outerHeight(),y=s.tgtW=h.outerWidth(),b=s.tgtH=h.outerHeight(),x=s.srcShape=n.nodeShapes[t.getNodeShape(d)],w=s.tgtShape=n.nodeShapes[t.getNodeShape(h)];s.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var E=0;E<s.eles.length;E++){var _=s.eles[E],k=_[0]._private.rscratch,S=_.pstyle("curve-style").value,P="unbundled-bezier"===S||"segments"===S||"taxi"===S,j=!d.same(_.source());if(!s.calculatedIntersection&&d!==h&&(s.hasBezier||s.hasUnbundled)){s.calculatedIntersection=!0;var C=x.intersectLine(p.x,p.y,g,m,v.x,v.y,0),T=s.srcIntn=C,D=w.intersectLine(v.x,v.y,y,b,p.x,p.y,0),N=s.tgtIntn=D,M=s.intersectionPts={x1:C[0],x2:D[0],y1:C[1],y2:D[1]},A=s.posPts={x1:p.x,x2:v.x,y1:p.y,y2:v.y},R=D[1]-C[1],I=D[0]-C[0],L=Math.sqrt(I*I+R*R),B=s.vector={x:I,y:R},F=s.vectorNorm={x:B.x/L,y:B.y/L},z={x:-F.y,y:F.x};s.nodesOverlap=!O(L)||w.checkPoint(C[0],C[1],0,y,b,v.x,v.y)||x.checkPoint(D[0],D[1],0,g,m,p.x,p.y),s.vectorNormInverse=z,l={nodesOverlap:s.nodesOverlap,dirCounts:s.dirCounts,calculatedIntersection:!0,hasBezier:s.hasBezier,hasUnbundled:s.hasUnbundled,eles:s.eles,srcPos:v,tgtPos:p,srcW:y,srcH:b,tgtW:g,tgtH:m,srcIntn:N,tgtIntn:T,srcShape:w,tgtShape:x,posPts:{x1:A.x2,y1:A.y2,x2:A.x1,y2:A.y1},intersectionPts:{x1:M.x2,y1:M.y2,x2:M.x1,y2:M.y1},vector:{x:-B.x,y:-B.y},vectorNorm:{x:-F.x,y:-F.y},vectorNormInverse:{x:-z.x,y:-z.y}}}var V=j?l:s;k.nodesOverlap=V.nodesOverlap,k.srcIntn=V.srcIntn,k.tgtIntn=V.tgtIntn,r&&(d.isParent()||d.isChild()||h.isParent()||h.isChild())&&(d.parents().anySame(h)||h.parents().anySame(d)||d.same(h)&&d.isParent())?t.findCompoundLoopPoints(_,V,E,P):d===h?t.findLoopPoints(_,V,E,P):"segments"===S?t.findSegmentsPoints(_,V):"taxi"===S?t.findTaxiPoints(_,V):"straight"===S||!P&&s.eles.length%2==1&&E===Math.floor(s.eles.length/2)?t.findStraightEdgePoints(_):t.findBezierPoints(_,V,E,P,j),t.findEndpoints(_),t.tryToCorrectInvalidPoints(_,V),t.checkForInvalidEdgeWarning(_),t.storeAllpts(_),t.storeEdgeProjections(_),t.calculateArrowAngles(_),t.recalculateEdgeLabelProjections(_),t.calculateLabelAngles(_)}},y=0;y<o.length;y++)m(y);this.findHaystackPoints(a)}},Za.getSegmentPoints=function(e){var t=e[0]._private.rscratch;if("segments"===t.edgeType)return this.recalculateRenderedStyle(e),Qa(t.segpts)},Za.getControlPoints=function(e){var t=e[0]._private.rscratch,n=t.edgeType;if("bezier"===n||"multibezier"===n||"self"===n||"compound"===n)return this.recalculateRenderedStyle(e),Qa(t.ctrlpts)},Za.getEdgeMidpoint=function(e){var t=e[0]._private.rscratch;return this.recalculateRenderedStyle(e),{x:t.midX,y:t.midY}};var Ja={manualEndptToPx:function(e,t){var n=e.position(),r=e.outerWidth(),i=e.outerHeight();if(2===t.value.length){var o=[t.pfValue[0],t.pfValue[1]];return"%"===t.units[0]&&(o[0]=o[0]*r),"%"===t.units[1]&&(o[1]=o[1]*i),o[0]+=n.x,o[1]+=n.y,o}var a=t.pfValue[0];a=-Math.PI/2+a;var s=2*Math.max(r,i),l=[n.x+Math.cos(a)*s,n.y+Math.sin(a)*s];return this.nodeShapes[this.getNodeShape(e)].intersectLine(n.x,n.y,r,i,l[0],l[1],0)},findEndpoints:function(e){var t,n,r,i,o,a=this,s=e.source()[0],l=e.target()[0],c=s.position(),u=l.position(),d=e.pstyle("target-arrow-shape").value,h=e.pstyle("source-arrow-shape").value,f=e.pstyle("target-distance-from-node").pfValue,p=e.pstyle("source-distance-from-node").pfValue,v=e.pstyle("curve-style").value,g=e._private.rscratch,m=g.edgeType,y="self"===m||"compound"===m,b="bezier"===m||"multibezier"===m||y,x="bezier"!==m,w="straight"===m||"segments"===m,E="segments"===m,_=b||x||w,k=y||"taxi"===v,S=e.pstyle("source-endpoint"),P=k?"outside-to-node":S.value,j=e.pstyle("target-endpoint"),C=k?"outside-to-node":j.value;if(g.srcManEndpt=S,g.tgtManEndpt=j,b){var T=[g.ctrlpts[0],g.ctrlpts[1]];n=x?[g.ctrlpts[g.ctrlpts.length-2],g.ctrlpts[g.ctrlpts.length-1]]:T,r=T}else if(w){var D=E?g.segpts.slice(0,2):[u.x,u.y];n=E?g.segpts.slice(g.segpts.length-2):[c.x,c.y],r=D}if("inside-to-node"===C)t=[u.x,u.y];else if(j.units)t=this.manualEndptToPx(l,j);else if("outside-to-line"===C)t=g.tgtIntn;else if("outside-to-node"===C||"outside-to-node-or-label"===C?i=n:"outside-to-line"!==C&&"outside-to-line-or-label"!==C||(i=[c.x,c.y]),t=a.nodeShapes[this.getNodeShape(l)].intersectLine(u.x,u.y,l.outerWidth(),l.outerHeight(),i[0],i[1],0),"outside-to-node-or-label"===C||"outside-to-line-or-label"===C){var N=l._private.rscratch,M=N.labelWidth,A=N.labelHeight,R=N.labelX,I=N.labelY,L=M/2,B=A/2,F=l.pstyle("text-valign").value;"top"===F?I-=B:"bottom"===F&&(I+=B);var z=l.pstyle("text-halign").value;"left"===z?R-=L:"right"===z&&(R+=L);var V=Mt(i[0],i[1],[R-L,I-B,R+L,I-B,R+L,I+B,R-L,I+B],u.x,u.y);if(V.length>0){var G=c,H=st(G,nt(t)),W=st(G,nt(V)),q=H;if(W<H&&(t=V,q=W),V.length>2)st(G,{x:V[2],y:V[3]})<q&&(t=[V[2],V[3]])}}var Y=At(t,n,a.arrowShapes[d].spacing(e)+f),U=At(t,n,a.arrowShapes[d].gap(e)+f);if(g.endX=U[0],g.endY=U[1],g.arrowEndX=Y[0],g.arrowEndY=Y[1],"inside-to-node"===P)t=[c.x,c.y];else if(S.units)t=this.manualEndptToPx(s,S);else if("outside-to-line"===P)t=g.srcIntn;else if("outside-to-node"===P||"outside-to-node-or-label"===P?o=r:"outside-to-line"!==P&&"outside-to-line-or-label"!==P||(o=[u.x,u.y]),t=a.nodeShapes[this.getNodeShape(s)].intersectLine(c.x,c.y,s.outerWidth(),s.outerHeight(),o[0],o[1],0),"outside-to-node-or-label"===P||"outside-to-line-or-label"===P){var X=s._private.rscratch,$=X.labelWidth,K=X.labelHeight,Z=X.labelX,Q=X.labelY,J=$/2,ee=K/2,te=s.pstyle("text-valign").value;"top"===te?Q-=ee:"bottom"===te&&(Q+=ee);var ne=s.pstyle("text-halign").value;"left"===ne?Z-=J:"right"===ne&&(Z+=J);var re=Mt(o[0],o[1],[Z-J,Q-ee,Z+J,Q-ee,Z+J,Q+ee,Z-J,Q+ee],c.x,c.y);if(re.length>0){var ie=u,oe=st(ie,nt(t)),ae=st(ie,nt(re)),se=oe;if(ae<oe&&(t=[re[0],re[1]],se=ae),re.length>2)st(ie,{x:re[2],y:re[3]})<se&&(t=[re[2],re[3]])}}var le=At(t,r,a.arrowShapes[h].spacing(e)+p),ce=At(t,r,a.arrowShapes[h].gap(e)+p);g.startX=ce[0],g.startY=ce[1],g.arrowStartX=le[0],g.arrowStartY=le[1],_&&(O(g.startX)&&O(g.startY)&&O(g.endX)&&O(g.endY)?g.badLine=!1:g.badLine=!0)},getSourceEndpoint:function(e){var t=e[0]._private.rscratch;return this.recalculateRenderedStyle(e),"haystack"===t.edgeType?{x:t.haystackPts[0],y:t.haystackPts[1]}:{x:t.arrowStartX,y:t.arrowStartY}},getTargetEndpoint:function(e){var t=e[0]._private.rscratch;return this.recalculateRenderedStyle(e),"haystack"===t.edgeType?{x:t.haystackPts[2],y:t.haystackPts[3]}:{x:t.arrowEndX,y:t.arrowEndY}}},es={};function ts(e,t,n){for(var r=function(e,t,n,r){return ct(e,t,n,r)},i=t._private.rstyle.bezierPts,o=0;o<e.bezierProjPcts.length;o++){var a=e.bezierProjPcts[o];i.push({x:r(n[0],n[2],n[4],a),y:r(n[1],n[3],n[5],a)})}}es.storeEdgeProjections=function(e){var t=e._private,n=t.rscratch,r=n.edgeType;if(t.rstyle.bezierPts=null,t.rstyle.linePts=null,t.rstyle.haystackPts=null,"multibezier"===r||"bezier"===r||"self"===r||"compound"===r){t.rstyle.bezierPts=[];for(var i=0;i+5<n.allpts.length;i+=4)ts(this,e,n.allpts.slice(i,i+6))}else if("segments"===r){var o=t.rstyle.linePts=[];for(i=0;i+1<n.allpts.length;i+=2)o.push({x:n.allpts[i],y:n.allpts[i+1]})}else if("haystack"===r){var a=n.haystackPts;t.rstyle.haystackPts=[{x:a[0],y:a[1]},{x:a[2],y:a[3]}]}t.rstyle.arrowWidth=this.getArrowWidth(e.pstyle("width").pfValue,e.pstyle("arrow-scale").value)*this.arrowShapeWidth},es.recalculateEdgeProjections=function(e){this.findEdgeControlPoints(e)};var ns={recalculateNodeLabelProjection:function(e){var t=e.pstyle("label").strValue;if(!F(t)){var n,r,i=e._private,o=e.width(),a=e.height(),s=e.padding(),l=e.position(),c=e.pstyle("text-halign").strValue,u=e.pstyle("text-valign").strValue,d=i.rscratch,h=i.rstyle;switch(c){case"left":n=l.x-o/2-s;break;case"right":n=l.x+o/2+s;break;default:n=l.x}switch(u){case"top":r=l.y-a/2-s;break;case"bottom":r=l.y+a/2+s;break;default:r=l.y}d.labelX=n,d.labelY=r,h.labelX=n,h.labelY=r,this.calculateLabelAngles(e),this.applyLabelDimensions(e)}}},rs=function(e,t){var n=Math.atan(t/e);return 0===e&&n<0&&(n*=-1),n},is=function(e,t){var n=t.x-e.x,r=t.y-e.y;return rs(n,r)};ns.recalculateEdgeLabelProjections=function(e){var t,n=e._private,r=n.rscratch,i=this,o={mid:e.pstyle("label").strValue,source:e.pstyle("source-label").strValue,target:e.pstyle("target-label").strValue};if(o.mid||o.source||o.target){t={x:r.midX,y:r.midY};var a=function(e,t,r){Ae(n.rscratch,e,t,r),Ae(n.rstyle,e,t,r)};a("labelX",null,t.x),a("labelY",null,t.y);var s=rs(r.midDispX,r.midDispY);a("labelAutoAngle",null,s);var l=function e(){if(e.cache)return e.cache;for(var t=[],o=0;o+5<r.allpts.length;o+=4){var a={x:r.allpts[o],y:r.allpts[o+1]},s={x:r.allpts[o+2],y:r.allpts[o+3]},l={x:r.allpts[o+4],y:r.allpts[o+5]};t.push({p0:a,p1:s,p2:l,startDist:0,length:0,segments:[]})}var c=n.rstyle.bezierPts,u=i.bezierProjPcts.length;function d(e,t,n,r,i){var o=at(t,n),a=e.segments[e.segments.length-1],s={p0:t,p1:n,t0:r,t1:i,startDist:a?a.startDist+a.length:0,length:o};e.segments.push(s),e.length+=o}for(var h=0;h<t.length;h++){var f=t[h],p=t[h-1];p&&(f.startDist=p.startDist+p.length),d(f,f.p0,c[h*u],0,i.bezierProjPcts[0]);for(var v=0;v<u-1;v++)d(f,c[h*u+v],c[h*u+v+1],i.bezierProjPcts[v],i.bezierProjPcts[v+1]);d(f,c[h*u+u-1],f.p2,i.bezierProjPcts[u-1],1)}return e.cache=t},c=function(n){var i,s="source"===n;if(o[n]){var c=e.pstyle(n+"-text-offset").pfValue;switch(r.edgeType){case"self":case"compound":case"bezier":case"multibezier":for(var u,d=l(),h=0,f=0,p=0;p<d.length;p++){for(var v=d[s?p:d.length-1-p],g=0;g<v.segments.length;g++){var m=v.segments[s?g:v.segments.length-1-g],y=p===d.length-1&&g===v.segments.length-1;if(h=f,(f+=m.length)>=c||y){u={cp:v,segment:m};break}}if(u)break}var b=u.cp,x=u.segment,w=(c-h)/x.length,E=x.t1-x.t0,_=s?x.t0+E*w:x.t1-E*w;_=dt(0,_,1),t=ut(b.p0,b.p1,b.p2,_),i=function(e,t,n,r){var i=dt(0,r-.001,1),o=dt(0,r+.001,1),a=ut(e,t,n,i),s=ut(e,t,n,o);return is(a,s)}(b.p0,b.p1,b.p2,_);break;case"straight":case"segments":case"haystack":for(var k,S,P,j,C=0,T=r.allpts.length,D=0;D+3<T&&(s?(P={x:r.allpts[D],y:r.allpts[D+1]},j={x:r.allpts[D+2],y:r.allpts[D+3]}):(P={x:r.allpts[T-2-D],y:r.allpts[T-1-D]},j={x:r.allpts[T-4-D],y:r.allpts[T-3-D]}),S=C,!((C+=k=at(P,j))>=c));D+=2);var N=(c-S)/k;N=dt(0,N,1),t=function(e,t,n,r){var i=t.x-e.x,o=t.y-e.y,a=at(e,t),s=i/a,l=o/a;return n=null==n?0:n,r=null!=r?r:n*a,{x:e.x+s*r,y:e.y+l*r}}(P,j,N),i=is(P,j)}a("labelX",n,t.x),a("labelY",n,t.y),a("labelAutoAngle",n,i)}};c("source"),c("target"),this.applyLabelDimensions(e)}},ns.applyLabelDimensions=function(e){this.applyPrefixedLabelDimensions(e),e.isEdge()&&(this.applyPrefixedLabelDimensions(e,"source"),this.applyPrefixedLabelDimensions(e,"target"))},ns.applyPrefixedLabelDimensions=function(e,t){var n=e._private,r=this.getLabelText(e,t),i=this.calculateLabelDimensions(e,r),o=e.pstyle("line-height").pfValue,a=e.pstyle("text-wrap").strValue,s=Me(n.rscratch,"labelWrapCachedLines",t)||[],l="wrap"!==a?1:Math.max(s.length,1),c=i.height/l,u=c*o,d=i.width,h=i.height+(l-1)*(o-1)*c;Ae(n.rstyle,"labelWidth",t,d),Ae(n.rscratch,"labelWidth",t,d),Ae(n.rstyle,"labelHeight",t,h),Ae(n.rscratch,"labelHeight",t,h),Ae(n.rscratch,"labelLineHeight",t,u)},ns.getLabelText=function(e,t){var n=e._private,r=t?t+"-":"",i=e.pstyle(r+"label").strValue,o=e.pstyle("text-transform").value,a=function(e,r){return r?(Ae(n.rscratch,e,t,r),r):Me(n.rscratch,e,t)};if(!i)return"";"none"==o||("uppercase"==o?i=i.toUpperCase():"lowercase"==o&&(i=i.toLowerCase()));var s=e.pstyle("text-wrap").value;if("wrap"===s){var l=a("labelKey");if(null!=l&&a("labelWrapKey")===l)return a("labelWrapCachedText");for(var c=i.split("\n"),u=e.pstyle("text-max-width").pfValue,d="anywhere"===e.pstyle("text-overflow-wrap").value,h=[],f=/[\s\u200b]+/,p=d?"":" ",v=0;v<c.length;v++){var g=c[v],m=this.calculateLabelDimensions(e,g).width;if(d){var y=g.split("").join("\u200b");g=y}if(m>u){for(var b=g.split(f),x="",w=0;w<b.length;w++){var E=b[w],_=0===x.length?E:x+p+E;this.calculateLabelDimensions(e,_).width<=u?x+=E+p:(x&&h.push(x),x=E+p)}x.match(/^[\s\u200b]+$/)||h.push(x)}else h.push(g)}a("labelWrapCachedLines",h),i=a("labelWrapCachedText",h.join("\n")),a("labelWrapKey",l)}else if("ellipsis"===s){var k=e.pstyle("text-max-width").pfValue,S="",P=!1;if(this.calculateLabelDimensions(e,i).width<k)return i;for(var j=0;j<i.length;j++){if(this.calculateLabelDimensions(e,S+i[j]+"\u2026").width>k)break;S+=i[j],j===i.length-1&&(P=!0)}return P||(S+="\u2026"),S}return i},ns.getLabelJustification=function(e){var t=e.pstyle("text-justification").strValue,n=e.pstyle("text-halign").strValue;if("auto"!==t)return t;if(!e.isNode())return"center";switch(n){case"left":return"right";case"right":return"left";default:return"center"}},ns.calculateLabelDimensions=function(e,t){var n=he(t,e._private.labelDimsKey),r=this.labelDimCache||(this.labelDimCache=[]),i=r[n];if(null!=i)return i;var o=e.pstyle("font-style").strValue,a=e.pstyle("font-size").pfValue,s=e.pstyle("font-family").strValue,l=e.pstyle("font-weight").strValue,c=this.labelCalcCanvas,u=this.labelCalcCanvasContext;if(!c){c=this.labelCalcCanvas=document.createElement("canvas"),u=this.labelCalcCanvasContext=c.getContext("2d");var d=c.style;d.position="absolute",d.left="-9999px",d.top="-9999px",d.zIndex="-1",d.visibility="hidden",d.pointerEvents="none"}u.font="".concat(o," ").concat(l," ").concat(a,"px ").concat(s);for(var h=0,f=0,p=t.split("\n"),v=0;v<p.length;v++){var g=p[v],m=u.measureText(g),y=Math.ceil(m.width),b=a;h=Math.max(y,h),f+=b}return h+=0,f+=0,r[n]={width:h,height:f}},ns.calculateLabelAngle=function(e,t){var n=e._private.rscratch,r=e.isEdge(),i=t?t+"-":"",o=e.pstyle(i+"text-rotation"),a=o.strValue;return"none"===a?0:r&&"autorotate"===a?n.labelAutoAngle:"autorotate"===a?0:o.pfValue},ns.calculateLabelAngles=function(e){var t=this,n=e.isEdge(),r=e._private.rscratch;r.labelAngle=t.calculateLabelAngle(e),n&&(r.sourceLabelAngle=t.calculateLabelAngle(e,"source"),r.targetLabelAngle=t.calculateLabelAngle(e,"target"))};var os={},as=!1;os.getNodeShape=function(e){var t=e.pstyle("shape").value;if("cutrectangle"===t&&(e.width()<28||e.height()<28))return as||(Se("The `cutrectangle` node shape can not be used at small sizes so `rectangle` is used instead"),as=!0),"rectangle";if(e.isParent())return"rectangle"===t||"roundrectangle"===t||"round-rectangle"===t||"cutrectangle"===t||"cut-rectangle"===t||"barrel"===t?t:"rectangle";if("polygon"===t){var n=e.pstyle("shape-polygon-points").value;return this.nodeShapes.makePolygon(n).name}return t};var ss={registerCalculationListeners:function(){var e=this.cy,t=e.collection(),n=this,r=function(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(t.merge(e),n)for(var r=0;r<e.length;r++){var i=e[r],o=i._private,a=o.rstyle;a.clean=!1,a.cleanConnected=!1}};n.binder(e).on("bounds.* dirty.*",(function(e){var t=e.target;r(t)})).on("style.* background.*",(function(e){var t=e.target;r(t,!1)}));var i=function(i){if(i){var o=n.onUpdateEleCalcsFns;t.cleanStyle();for(var a=0;a<t.length;a++){var s=t[a],l=s._private.rstyle;s.isNode()&&!l.cleanConnected&&(r(s.connectedEdges()),l.cleanConnected=!0)}if(o)for(var c=0;c<o.length;c++){(0,o[c])(i,t)}n.recalculateRenderedStyle(t),t=e.collection()}};n.flushRenderedStyleQueue=function(){i(!0)},n.beforeRender(i,n.beforeRenderPriorities.eleCalcs)},onUpdateEleCalcs:function(e){(this.onUpdateEleCalcsFns=this.onUpdateEleCalcsFns||[]).push(e)},recalculateRenderedStyle:function(e,t){var n=function(e){return e._private.rstyle.cleanConnected},r=[],i=[];if(!this.destroyed){void 0===t&&(t=!0);for(var o=0;o<e.length;o++){var a=e[o],s=a._private,l=s.rstyle;!a.isEdge()||n(a.source())&&n(a.target())||(l.clean=!1),t&&l.clean||a.removed()||"none"!==a.pstyle("display").value&&("nodes"===s.group?i.push(a):r.push(a),l.clean=!0)}for(var c=0;c<i.length;c++){var u=i[c],d=u._private.rstyle,h=u.position();this.recalculateNodeLabelProjection(u),d.nodeX=h.x,d.nodeY=h.y,d.nodeW=u.pstyle("width").pfValue,d.nodeH=u.pstyle("height").pfValue}this.recalculateEdgeProjections(r);for(var f=0;f<r.length;f++){var p=r[f]._private,v=p.rstyle,g=p.rscratch;v.srcX=g.arrowStartX,v.srcY=g.arrowStartY,v.tgtX=g.arrowEndX,v.tgtY=g.arrowEndY,v.midX=g.midX,v.midY=g.midY,v.labelAngle=g.labelAngle,v.sourceLabelAngle=g.sourceLabelAngle,v.targetLabelAngle=g.targetLabelAngle}}}},ls={updateCachedGrabbedEles:function(){var e=this.cachedZSortedEles;if(e){e.drag=[],e.nondrag=[];for(var t=[],n=0;n<e.length;n++){var r=(i=e[n])._private.rscratch;i.grabbed()&&!i.isParent()?t.push(i):r.inDragLayer?e.drag.push(i):e.nondrag.push(i)}for(n=0;n<t.length;n++){var i=t[n];e.drag.push(i)}}},invalidateCachedZSortedEles:function(){this.cachedZSortedEles=null},getCachedZSortedEles:function(e){if(e||!this.cachedZSortedEles){var t=this.cy.mutableElements().toArray();t.sort(Xi),t.interactive=t.filter((function(e){return e.interactive()})),this.cachedZSortedEles=t,this.updateCachedGrabbedEles()}else t=this.cachedZSortedEles;return t}},cs={};[$a,Ka,Za,Ja,es,ns,os,ss,ls].forEach((function(e){X(cs,e)}));var us={getCachedImage:function(e,t,n){var r=this.imageCache=this.imageCache||{},i=r[e];if(i)return i.image.complete||i.image.addEventListener("load",n),i.image;var o=(i=r[e]=r[e]||{}).image=new Image;o.addEventListener("load",n),o.addEventListener("error",(function(){o.error=!0}));var a="data:";return e.substring(0,a.length).toLowerCase()===a||(o.crossOrigin=t),o.src=e,o}},ds={registerBinding:function(e,t,n,r){var i=Array.prototype.slice.apply(arguments,[1]),o=this.binder(e);return o.on.apply(o,i)}};ds.binder=function(e){var t,n=this,r=e===window||e===document||e===document.body||(t=e,"undefined"!=typeof HTMLElement&&t instanceof HTMLElement);if(null==n.supportsPassiveEvents){var i=!1;try{var o=Object.defineProperty({},"passive",{get:function(){return i=!0,!0}});window.addEventListener("test",null,o)}catch(s){}n.supportsPassiveEvents=i}var a=function(t,i,o){var a=Array.prototype.slice.call(arguments);return r&&n.supportsPassiveEvents&&(a[2]={capture:null!=o&&o,passive:!1,once:!1}),n.bindings.push({target:e,args:a}),(e.addEventListener||e.on).apply(e,a),this};return{on:a,addEventListener:a,addListener:a,bind:a}},ds.nodeIsDraggable=function(e){return e&&e.isNode()&&!e.locked()&&e.grabbable()},ds.nodeIsGrabbable=function(e){return this.nodeIsDraggable(e)&&e.interactive()},ds.load=function(){var e=this,t=function(e){return e.selected()},n=function(t,n,r,i){null==t&&(t=e.cy);for(var o=0;o<n.length;o++){var a=n[o];t.emit({originalEvent:r,type:a,position:i})}},r=function(e){return e.shiftKey||e.metaKey||e.ctrlKey},i=function(t,n){var r=!0;if(e.cy.hasCompoundNodes()&&t&&t.pannable())for(var i=0;n&&i<n.length;i++){if((t=n[i]).isNode()&&t.isParent()&&!t.pannable()){r=!1;break}}else r=!0;return r},o=function(e){e[0]._private.rscratch.inDragLayer=!0},a=function(e){e[0]._private.rscratch.isGrabTarget=!0},s=function(e,t){var n=t.addToList;n.has(e)||!e.grabbable()||e.locked()||(n.merge(e),function(e){e[0]._private.grabbed=!0}(e))},l=function(t,n){n=n||{};var r=t.cy().hasCompoundNodes();n.inDragLayer&&(t.forEach(o),t.neighborhood().stdFilter((function(e){return!r||e.isEdge()})).forEach(o)),n.addToList&&t.forEach((function(e){s(e,n)})),function(e,t){if(e.cy().hasCompoundNodes()&&(null!=t.inDragLayer||null!=t.addToList)){var n=e.descendants();t.inDragLayer&&(n.forEach(o),n.connectedEdges().forEach(o)),t.addToList&&s(n,t)}}(t,n),h(t,{inDragLayer:n.inDragLayer}),e.updateCachedGrabbedEles()},u=l,d=function(t){t&&(e.getCachedZSortedEles().forEach((function(e){!function(e){e[0]._private.grabbed=!1}(e),function(e){e[0]._private.rscratch.inDragLayer=!1}(e),function(e){e[0]._private.rscratch.isGrabTarget=!1}(e)})),e.updateCachedGrabbedEles())},h=function(e,t){if((null!=t.inDragLayer||null!=t.addToList)&&e.cy().hasCompoundNodes()){var n=e.ancestors().orphans();if(!n.same(e)){var r=n.descendants().spawnSelf().merge(n).unmerge(e).unmerge(e.descendants()),i=r.connectedEdges();t.inDragLayer&&(i.forEach(o),r.forEach(o)),t.addToList&&r.forEach((function(e){s(e,t)}))}}},f=function(){null!=document.activeElement&&null!=document.activeElement.blur&&document.activeElement.blur()},p="undefined"!=typeof MutationObserver,v="undefined"!=typeof ResizeObserver;p?(e.removeObserver=new MutationObserver((function(t){for(var n=0;n<t.length;n++){var r=t[n].removedNodes;if(r)for(var i=0;i<r.length;i++){if(r[i]===e.container){e.destroy();break}}}})),e.container.parentNode&&e.removeObserver.observe(e.container.parentNode,{childList:!0})):e.registerBinding(e.container,"DOMNodeRemoved",(function(t){e.destroy()}));var g=c.default((function(){e.cy.resize()}),100);p&&(e.styleObserver=new MutationObserver(g),e.styleObserver.observe(e.container,{attributes:!0})),e.registerBinding(window,"resize",g),v&&(e.resizeObserver=new ResizeObserver(g),e.resizeObserver.observe(e.container));var m=function(){e.invalidateContainerClientCoordsCache()};!function(e,t){for(;null!=e;)t(e),e=e.parentNode}(e.container,(function(t){e.registerBinding(t,"transitionend",m),e.registerBinding(t,"animationend",m),e.registerBinding(t,"scroll",m)})),e.registerBinding(e.container,"contextmenu",(function(e){e.preventDefault()}));var y,b,x,w=function(t){for(var n=e.findContainerClientCoords(),r=n[0],i=n[1],o=n[2],a=n[3],s=t.touches?t.touches:[t],l=!1,c=0;c<s.length;c++){var u=s[c];if(r<=u.clientX&&u.clientX<=r+o&&i<=u.clientY&&u.clientY<=i+a){l=!0;break}}if(!l)return!1;for(var d=e.container,h=t.target.parentNode,f=!1;h;){if(h===d){f=!0;break}h=h.parentNode}return!!f};e.registerBinding(e.container,"mousedown",(function(t){if(w(t)){t.preventDefault(),f(),e.hoverData.capture=!0,e.hoverData.which=t.which;var r=e.cy,i=[t.clientX,t.clientY],o=e.projectIntoViewport(i[0],i[1]),s=e.selection,c=e.findNearestElements(o[0],o[1],!0,!1),d=c[0],h=e.dragData.possibleDragElements;e.hoverData.mdownPos=o,e.hoverData.mdownGPos=i;if(3==t.which){e.hoverData.cxtStarted=!0;var p={originalEvent:t,type:"cxttapstart",position:{x:o[0],y:o[1]}};d?(d.activate(),d.emit(p),e.hoverData.down=d):r.emit(p),e.hoverData.downTime=(new Date).getTime(),e.hoverData.cxtDragged=!1}else if(1==t.which){if(d&&d.activate(),null!=d&&e.nodeIsGrabbable(d)){var v=function(e){return{originalEvent:t,type:e,position:{x:o[0],y:o[1]}}};if(a(d),d.selected()){h=e.dragData.possibleDragElements=r.collection();var g=r.$((function(t){return t.isNode()&&t.selected()&&e.nodeIsGrabbable(t)}));l(g,{addToList:h}),d.emit(v("grabon")),g.forEach((function(e){e.emit(v("grab"))}))}else h=e.dragData.possibleDragElements=r.collection(),u(d,{addToList:h}),d.emit(v("grabon")).emit(v("grab"));e.redrawHint("eles",!0),e.redrawHint("drag",!0)}e.hoverData.down=d,e.hoverData.downs=c,e.hoverData.downTime=(new Date).getTime(),n(d,["mousedown","tapstart","vmousedown"],t,{x:o[0],y:o[1]}),null==d?(s[4]=1,e.data.bgActivePosistion={x:o[0],y:o[1]},e.redrawHint("select",!0),e.redraw()):d.pannable()&&(s[4]=1),e.hoverData.tapholdCancelled=!1,clearTimeout(e.hoverData.tapholdTimeout),e.hoverData.tapholdTimeout=setTimeout((function(){if(!e.hoverData.tapholdCancelled){var n=e.hoverData.down;n?n.emit({originalEvent:t,type:"taphold",position:{x:o[0],y:o[1]}}):r.emit({originalEvent:t,type:"taphold",position:{x:o[0],y:o[1]}})}}),e.tapholdDuration)}s[0]=s[2]=o[0],s[1]=s[3]=o[1]}}),!1),e.registerBinding(window,"mousemove",(function(t){if(e.hoverData.capture||w(t)){var o=!1,a=e.cy,s=a.zoom(),c=[t.clientX,t.clientY],u=e.projectIntoViewport(c[0],c[1]),h=e.hoverData.mdownPos,f=e.hoverData.mdownGPos,p=e.selection,v=null;e.hoverData.draggingEles||e.hoverData.dragging||e.hoverData.selecting||(v=e.findNearestElement(u[0],u[1],!0,!1));var g,m=e.hoverData.last,y=e.hoverData.down,b=[u[0]-p[2],u[1]-p[3]],x=e.dragData.possibleDragElements;if(f){var E=c[0]-f[0],_=E*E,k=c[1]-f[1],S=_+k*k;e.hoverData.isOverThresholdDrag=g=S>=e.desktopTapThreshold2}var P=r(t);g&&(e.hoverData.tapholdCancelled=!0);o=!0,n(v,["mousemove","vmousemove","tapdrag"],t,{x:u[0],y:u[1]});var j=function(){e.data.bgActivePosistion=void 0,e.hoverData.selecting||a.emit({originalEvent:t,type:"boxstart",position:{x:u[0],y:u[1]}}),p[4]=1,e.hoverData.selecting=!0,e.redrawHint("select",!0),e.redraw()};if(3===e.hoverData.which){if(g){var C={originalEvent:t,type:"cxtdrag",position:{x:u[0],y:u[1]}};y?y.emit(C):a.emit(C),e.hoverData.cxtDragged=!0,e.hoverData.cxtOver&&v===e.hoverData.cxtOver||(e.hoverData.cxtOver&&e.hoverData.cxtOver.emit({originalEvent:t,type:"cxtdragout",position:{x:u[0],y:u[1]}}),e.hoverData.cxtOver=v,v&&v.emit({originalEvent:t,type:"cxtdragover",position:{x:u[0],y:u[1]}}))}}else if(e.hoverData.dragging){if(o=!0,a.panningEnabled()&&a.userPanningEnabled()){var T;if(e.hoverData.justStartedPan){var D=e.hoverData.mdownPos;T={x:(u[0]-D[0])*s,y:(u[1]-D[1])*s},e.hoverData.justStartedPan=!1}else T={x:b[0]*s,y:b[1]*s};a.panBy(T),a.emit("dragpan"),e.hoverData.dragged=!0}u=e.projectIntoViewport(t.clientX,t.clientY)}else if(1!=p[4]||null!=y&&!y.pannable()){if(y&&y.pannable()&&y.active()&&y.unactivate(),y&&y.grabbed()||v==m||(m&&n(m,["mouseout","tapdragout"],t,{x:u[0],y:u[1]}),v&&n(v,["mouseover","tapdragover"],t,{x:u[0],y:u[1]}),e.hoverData.last=v),y)if(g){if(a.boxSelectionEnabled()&&P)y&&y.grabbed()&&(d(x),y.emit("freeon"),x.emit("free"),e.dragData.didDrag&&(y.emit("dragfreeon"),x.emit("dragfree"))),j();else if(y&&y.grabbed()&&e.nodeIsDraggable(y)){var N=!e.dragData.didDrag;N&&e.redrawHint("eles",!0),e.dragData.didDrag=!0,e.hoverData.draggingEles||l(x,{inDragLayer:!0});var M={x:0,y:0};if(O(b[0])&&O(b[1])&&(M.x+=b[0],M.y+=b[1],N)){var A=e.hoverData.dragDelta;A&&O(A[0])&&O(A[1])&&(M.x+=A[0],M.y+=A[1])}e.hoverData.draggingEles=!0,x.silentShift(M).emit("position drag"),e.redrawHint("drag",!0),e.redraw()}}else!function(){var t=e.hoverData.dragDelta=e.hoverData.dragDelta||[];0===t.length?(t.push(b[0]),t.push(b[1])):(t[0]+=b[0],t[1]+=b[1])}();o=!0}else if(g){if(e.hoverData.dragging||!a.boxSelectionEnabled()||!P&&a.panningEnabled()&&a.userPanningEnabled()){if(!e.hoverData.selecting&&a.panningEnabled()&&a.userPanningEnabled()){i(y,e.hoverData.downs)&&(e.hoverData.dragging=!0,e.hoverData.justStartedPan=!0,p[4]=0,e.data.bgActivePosistion=nt(h),e.redrawHint("select",!0),e.redraw())}}else j();y&&y.pannable()&&y.active()&&y.unactivate()}return p[2]=u[0],p[3]=u[1],o?(t.stopPropagation&&t.stopPropagation(),t.preventDefault&&t.preventDefault(),!1):void 0}}),!1),e.registerBinding(window,"mouseup",(function(i){if(e.hoverData.capture){e.hoverData.capture=!1;var o=e.cy,a=e.projectIntoViewport(i.clientX,i.clientY),s=e.selection,l=e.findNearestElement(a[0],a[1],!0,!1),c=e.dragData.possibleDragElements,u=e.hoverData.down,h=r(i);if(e.data.bgActivePosistion&&(e.redrawHint("select",!0),e.redraw()),e.hoverData.tapholdCancelled=!0,e.data.bgActivePosistion=void 0,u&&u.unactivate(),3===e.hoverData.which){var f={originalEvent:i,type:"cxttapend",position:{x:a[0],y:a[1]}};if(u?u.emit(f):o.emit(f),!e.hoverData.cxtDragged){var p={originalEvent:i,type:"cxttap",position:{x:a[0],y:a[1]}};u?u.emit(p):o.emit(p)}e.hoverData.cxtDragged=!1,e.hoverData.which=null}else if(1===e.hoverData.which){if(n(l,["mouseup","tapend","vmouseup"],i,{x:a[0],y:a[1]}),e.dragData.didDrag||e.hoverData.dragged||e.hoverData.selecting||e.hoverData.isOverThresholdDrag||(n(u,["click","tap","vclick"],i,{x:a[0],y:a[1]}),b=!1,i.timeStamp-x<=o.multiClickDebounceTime()?(y&&clearTimeout(y),b=!0,x=null,n(u,["dblclick","dbltap","vdblclick"],i,{x:a[0],y:a[1]})):(y=setTimeout((function(){b||n(u,["oneclick","onetap","voneclick"],i,{x:a[0],y:a[1]})}),o.multiClickDebounceTime()),x=i.timeStamp)),null!=u||e.dragData.didDrag||e.hoverData.selecting||e.hoverData.dragged||r(i)||(o.$(t).unselect(["tapunselect"]),c.length>0&&e.redrawHint("eles",!0),e.dragData.possibleDragElements=c=o.collection()),l!=u||e.dragData.didDrag||e.hoverData.selecting||null!=l&&l._private.selectable&&(e.hoverData.dragging||("additive"===o.selectionType()||h?l.selected()?l.unselect(["tapunselect"]):l.select(["tapselect"]):h||(o.$(t).unmerge(l).unselect(["tapunselect"]),l.select(["tapselect"]))),e.redrawHint("eles",!0)),e.hoverData.selecting){var v=o.collection(e.getAllInBox(s[0],s[1],s[2],s[3]));e.redrawHint("select",!0),v.length>0&&e.redrawHint("eles",!0),o.emit({type:"boxend",originalEvent:i,position:{x:a[0],y:a[1]}});var g=function(e){return e.selectable()&&!e.selected()};"additive"===o.selectionType()||h||o.$(t).unmerge(v).unselect(),v.emit("box").stdFilter(g).select().emit("boxselect"),e.redraw()}if(e.hoverData.dragging&&(e.hoverData.dragging=!1,e.redrawHint("select",!0),e.redrawHint("eles",!0),e.redraw()),!s[4]){e.redrawHint("drag",!0),e.redrawHint("eles",!0);var m=u&&u.grabbed();d(c),m&&(u.emit("freeon"),c.emit("free"),e.dragData.didDrag&&(u.emit("dragfreeon"),c.emit("dragfree")))}}s[4]=0,e.hoverData.down=null,e.hoverData.cxtStarted=!1,e.hoverData.draggingEles=!1,e.hoverData.selecting=!1,e.hoverData.isOverThresholdDrag=!1,e.dragData.didDrag=!1,e.hoverData.dragged=!1,e.hoverData.dragDelta=[],e.hoverData.mdownPos=null,e.hoverData.mdownGPos=null}}),!1);var E,_,k,S,P,j,C,T,D,N,M,A,R,I=function(t){if(!e.scrollingPage){var n=e.cy,r=n.zoom(),i=n.pan(),o=e.projectIntoViewport(t.clientX,t.clientY),a=[o[0]*r+i.x,o[1]*r+i.y];if(e.hoverData.draggingEles||e.hoverData.dragging||e.hoverData.cxtStarted||0!==e.selection[4])t.preventDefault();else if(n.panningEnabled()&&n.userPanningEnabled()&&n.zoomingEnabled()&&n.userZoomingEnabled()){var s;t.preventDefault(),e.data.wheelZooming=!0,clearTimeout(e.data.wheelTimeout),e.data.wheelTimeout=setTimeout((function(){e.data.wheelZooming=!1,e.redrawHint("eles",!0),e.redraw()}),150),s=null!=t.deltaY?t.deltaY/-250:null!=t.wheelDeltaY?t.wheelDeltaY/1e3:t.wheelDelta/1e3,s*=e.wheelSensitivity,1===t.deltaMode&&(s*=33);var l=n.zoom()*Math.pow(10,s);"gesturechange"===t.type&&(l=e.gestureStartZoom*t.scale),n.zoom({level:l,renderedPosition:{x:a[0],y:a[1]}}),n.emit("gesturechange"===t.type?"pinchzoom":"scrollzoom")}}};e.registerBinding(e.container,"wheel",I,!0),e.registerBinding(window,"scroll",(function(t){e.scrollingPage=!0,clearTimeout(e.scrollingPageTimeout),e.scrollingPageTimeout=setTimeout((function(){e.scrollingPage=!1}),250)}),!0),e.registerBinding(e.container,"gesturestart",(function(t){e.gestureStartZoom=e.cy.zoom(),e.hasTouchStarted||t.preventDefault()}),!0),e.registerBinding(e.container,"gesturechange",(function(t){e.hasTouchStarted||I(t)}),!0),e.registerBinding(e.container,"mouseout",(function(t){var n=e.projectIntoViewport(t.clientX,t.clientY);e.cy.emit({originalEvent:t,type:"mouseout",position:{x:n[0],y:n[1]}})}),!1),e.registerBinding(e.container,"mouseover",(function(t){var n=e.projectIntoViewport(t.clientX,t.clientY);e.cy.emit({originalEvent:t,type:"mouseover",position:{x:n[0],y:n[1]}})}),!1);var L,B,F,z,V,G,H,W=function(e,t,n,r){return Math.sqrt((n-e)*(n-e)+(r-t)*(r-t))},q=function(e,t,n,r){return(n-e)*(n-e)+(r-t)*(r-t)};if(e.registerBinding(e.container,"touchstart",L=function(t){if(e.hasTouchStarted=!0,w(t)){f(),e.touchData.capture=!0,e.data.bgActivePosistion=void 0;var r=e.cy,i=e.touchData.now,o=e.touchData.earlier;if(t.touches[0]){var s=e.projectIntoViewport(t.touches[0].clientX,t.touches[0].clientY);i[0]=s[0],i[1]=s[1]}if(t.touches[1]){s=e.projectIntoViewport(t.touches[1].clientX,t.touches[1].clientY);i[2]=s[0],i[3]=s[1]}if(t.touches[2]){s=e.projectIntoViewport(t.touches[2].clientX,t.touches[2].clientY);i[4]=s[0],i[5]=s[1]}if(t.touches[1]){e.touchData.singleTouchMoved=!0,d(e.dragData.touchDragEles);var c=e.findContainerClientCoords();D=c[0],N=c[1],M=c[2],A=c[3],E=t.touches[0].clientX-D,_=t.touches[0].clientY-N,k=t.touches[1].clientX-D,S=t.touches[1].clientY-N,R=0<=E&&E<=M&&0<=k&&k<=M&&0<=_&&_<=A&&0<=S&&S<=A;var h=r.pan(),p=r.zoom();P=W(E,_,k,S),j=q(E,_,k,S),T=[((C=[(E+k)/2,(_+S)/2])[0]-h.x)/p,(C[1]-h.y)/p];if(j<4e4&&!t.touches[2]){var v=e.findNearestElement(i[0],i[1],!0,!0),g=e.findNearestElement(i[2],i[3],!0,!0);return v&&v.isNode()?(v.activate().emit({originalEvent:t,type:"cxttapstart",position:{x:i[0],y:i[1]}}),e.touchData.start=v):g&&g.isNode()?(g.activate().emit({originalEvent:t,type:"cxttapstart",position:{x:i[0],y:i[1]}}),e.touchData.start=g):r.emit({originalEvent:t,type:"cxttapstart",position:{x:i[0],y:i[1]}}),e.touchData.start&&(e.touchData.start._private.grabbed=!1),e.touchData.cxt=!0,e.touchData.cxtDragged=!1,e.data.bgActivePosistion=void 0,void e.redraw()}}if(t.touches[2])r.boxSelectionEnabled()&&t.preventDefault();else if(t.touches[1]);else if(t.touches[0]){var m=e.findNearestElements(i[0],i[1],!0,!0),y=m[0];if(null!=y&&(y.activate(),e.touchData.start=y,e.touchData.starts=m,e.nodeIsGrabbable(y))){var b=e.dragData.touchDragEles=r.collection(),x=null;e.redrawHint("eles",!0),e.redrawHint("drag",!0),y.selected()?(x=r.$((function(t){return t.selected()&&e.nodeIsGrabbable(t)})),l(x,{addToList:b})):u(y,{addToList:b}),a(y);var O=function(e){return{originalEvent:t,type:e,position:{x:i[0],y:i[1]}}};y.emit(O("grabon")),x?x.forEach((function(e){e.emit(O("grab"))})):y.emit(O("grab"))}n(y,["touchstart","tapstart","vmousedown"],t,{x:i[0],y:i[1]}),null==y&&(e.data.bgActivePosistion={x:s[0],y:s[1]},e.redrawHint("select",!0),e.redraw()),e.touchData.singleTouchMoved=!1,e.touchData.singleTouchStartTime=+new Date,clearTimeout(e.touchData.tapholdTimeout),e.touchData.tapholdTimeout=setTimeout((function(){!1!==e.touchData.singleTouchMoved||e.pinching||e.touchData.selecting||n(e.touchData.start,["taphold"],t,{x:i[0],y:i[1]})}),e.tapholdDuration)}if(t.touches.length>=1){for(var I=e.touchData.startPosition=[],L=0;L<i.length;L++)I[L]=o[L]=i[L];var B=t.touches[0];e.touchData.startGPosition=[B.clientX,B.clientY]}}},!1),e.registerBinding(window,"touchmove",B=function(t){var r=e.touchData.capture;if(r||w(t)){var o=e.selection,a=e.cy,s=e.touchData.now,c=e.touchData.earlier,u=a.zoom();if(t.touches[0]){var h=e.projectIntoViewport(t.touches[0].clientX,t.touches[0].clientY);s[0]=h[0],s[1]=h[1]}if(t.touches[1]){h=e.projectIntoViewport(t.touches[1].clientX,t.touches[1].clientY);s[2]=h[0],s[3]=h[1]}if(t.touches[2]){h=e.projectIntoViewport(t.touches[2].clientX,t.touches[2].clientY);s[4]=h[0],s[5]=h[1]}var f,p=e.touchData.startGPosition;if(r&&t.touches[0]&&p){for(var v=[],g=0;g<s.length;g++)v[g]=s[g]-c[g];var m=t.touches[0].clientX-p[0],y=m*m,b=t.touches[0].clientY-p[1];f=y+b*b>=e.touchTapThreshold2}if(r&&e.touchData.cxt){t.preventDefault();var x=t.touches[0].clientX-D,C=t.touches[0].clientY-N,M=t.touches[1].clientX-D,A=t.touches[1].clientY-N,I=q(x,C,M,A);if(I/j>=2.25||I>=22500){e.touchData.cxt=!1,e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);var L={originalEvent:t,type:"cxttapend",position:{x:s[0],y:s[1]}};e.touchData.start?(e.touchData.start.unactivate().emit(L),e.touchData.start=null):a.emit(L)}}if(r&&e.touchData.cxt){L={originalEvent:t,type:"cxtdrag",position:{x:s[0],y:s[1]}};e.data.bgActivePosistion=void 0,e.redrawHint("select",!0),e.touchData.start?e.touchData.start.emit(L):a.emit(L),e.touchData.start&&(e.touchData.start._private.grabbed=!1),e.touchData.cxtDragged=!0;var B=e.findNearestElement(s[0],s[1],!0,!0);e.touchData.cxtOver&&B===e.touchData.cxtOver||(e.touchData.cxtOver&&e.touchData.cxtOver.emit({originalEvent:t,type:"cxtdragout",position:{x:s[0],y:s[1]}}),e.touchData.cxtOver=B,B&&B.emit({originalEvent:t,type:"cxtdragover",position:{x:s[0],y:s[1]}}))}else if(r&&t.touches[2]&&a.boxSelectionEnabled())t.preventDefault(),e.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,e.touchData.selecting||a.emit({originalEvent:t,type:"boxstart",position:{x:s[0],y:s[1]}}),e.touchData.selecting=!0,e.touchData.didSelect=!0,o[4]=1,o&&0!==o.length&&void 0!==o[0]?(o[2]=(s[0]+s[2]+s[4])/3,o[3]=(s[1]+s[3]+s[5])/3):(o[0]=(s[0]+s[2]+s[4])/3,o[1]=(s[1]+s[3]+s[5])/3,o[2]=(s[0]+s[2]+s[4])/3+1,o[3]=(s[1]+s[3]+s[5])/3+1),e.redrawHint("select",!0),e.redraw();else if(r&&t.touches[1]&&!e.touchData.didSelect&&a.zoomingEnabled()&&a.panningEnabled()&&a.userZoomingEnabled()&&a.userPanningEnabled()){if(t.preventDefault(),e.data.bgActivePosistion=void 0,e.redrawHint("select",!0),ee=e.dragData.touchDragEles){e.redrawHint("drag",!0);for(var F=0;F<ee.length;F++){var z=ee[F]._private;z.grabbed=!1,z.rscratch.inDragLayer=!1}}var V=e.touchData.start,G=(x=t.touches[0].clientX-D,C=t.touches[0].clientY-N,M=t.touches[1].clientX-D,A=t.touches[1].clientY-N,W(x,C,M,A)),H=G/P;if(R){var Y=(x-E+(M-k))/2,U=(C-_+(A-S))/2,X=a.zoom(),$=X*H,K=a.pan(),Z=T[0]*X+K.x,Q=T[1]*X+K.y,J={x:-$/X*(Z-K.x-Y)+Z,y:-$/X*(Q-K.y-U)+Q};if(V&&V.active()){var ee=e.dragData.touchDragEles;d(ee),e.redrawHint("drag",!0),e.redrawHint("eles",!0),V.unactivate().emit("freeon"),ee.emit("free"),e.dragData.didDrag&&(V.emit("dragfreeon"),ee.emit("dragfree"))}a.viewport({zoom:$,pan:J,cancelOnFailedZoom:!0}),a.emit("pinchzoom"),P=G,E=x,_=C,k=M,S=A,e.pinching=!0}if(t.touches[0]){h=e.projectIntoViewport(t.touches[0].clientX,t.touches[0].clientY);s[0]=h[0],s[1]=h[1]}if(t.touches[1]){h=e.projectIntoViewport(t.touches[1].clientX,t.touches[1].clientY);s[2]=h[0],s[3]=h[1]}if(t.touches[2]){h=e.projectIntoViewport(t.touches[2].clientX,t.touches[2].clientY);s[4]=h[0],s[5]=h[1]}}else if(t.touches[0]&&!e.touchData.didSelect){var te=e.touchData.start,ne=e.touchData.last;if(e.hoverData.draggingEles||e.swipePanning||(B=e.findNearestElement(s[0],s[1],!0,!0)),r&&null!=te&&t.preventDefault(),r&&null!=te&&e.nodeIsDraggable(te))if(f){ee=e.dragData.touchDragEles;var re=!e.dragData.didDrag;re&&l(ee,{inDragLayer:!0}),e.dragData.didDrag=!0;var ie={x:0,y:0};if(O(v[0])&&O(v[1]))if(ie.x+=v[0],ie.y+=v[1],re)e.redrawHint("eles",!0),(oe=e.touchData.dragDelta)&&O(oe[0])&&O(oe[1])&&(ie.x+=oe[0],ie.y+=oe[1]);e.hoverData.draggingEles=!0,ee.silentShift(ie).emit("position drag"),e.redrawHint("drag",!0),e.touchData.startPosition[0]==c[0]&&e.touchData.startPosition[1]==c[1]&&e.redrawHint("eles",!0),e.redraw()}else{var oe;0===(oe=e.touchData.dragDelta=e.touchData.dragDelta||[]).length?(oe.push(v[0]),oe.push(v[1])):(oe[0]+=v[0],oe[1]+=v[1])}if(n(te||B,["touchmove","tapdrag","vmousemove"],t,{x:s[0],y:s[1]}),te&&te.grabbed()||B==ne||(ne&&ne.emit({originalEvent:t,type:"tapdragout",position:{x:s[0],y:s[1]}}),B&&B.emit({originalEvent:t,type:"tapdragover",position:{x:s[0],y:s[1]}})),e.touchData.last=B,r)for(F=0;F<s.length;F++)s[F]&&e.touchData.startPosition[F]&&f&&(e.touchData.singleTouchMoved=!0);if(r&&(null==te||te.pannable())&&a.panningEnabled()&&a.userPanningEnabled()){i(te,e.touchData.starts)&&(t.preventDefault(),e.data.bgActivePosistion||(e.data.bgActivePosistion=nt(e.touchData.startPosition)),e.swipePanning?(a.panBy({x:v[0]*u,y:v[1]*u}),a.emit("dragpan")):f&&(e.swipePanning=!0,a.panBy({x:m*u,y:b*u}),a.emit("dragpan"),te&&(te.unactivate(),e.redrawHint("select",!0),e.touchData.start=null)));h=e.projectIntoViewport(t.touches[0].clientX,t.touches[0].clientY);s[0]=h[0],s[1]=h[1]}}for(g=0;g<s.length;g++)c[g]=s[g];r&&t.touches.length>0&&!e.hoverData.draggingEles&&!e.swipePanning&&null!=e.data.bgActivePosistion&&(e.data.bgActivePosistion=void 0,e.redrawHint("select",!0),e.redraw())}},!1),e.registerBinding(window,"touchcancel",F=function(t){var n=e.touchData.start;e.touchData.capture=!1,n&&n.unactivate()}),e.registerBinding(window,"touchend",z=function(r){var i=e.touchData.start;if(e.touchData.capture){0===r.touches.length&&(e.touchData.capture=!1),r.preventDefault();var o=e.selection;e.swipePanning=!1,e.hoverData.draggingEles=!1;var a,s=e.cy,l=s.zoom(),c=e.touchData.now,u=e.touchData.earlier;if(r.touches[0]){var h=e.projectIntoViewport(r.touches[0].clientX,r.touches[0].clientY);c[0]=h[0],c[1]=h[1]}if(r.touches[1]){h=e.projectIntoViewport(r.touches[1].clientX,r.touches[1].clientY);c[2]=h[0],c[3]=h[1]}if(r.touches[2]){h=e.projectIntoViewport(r.touches[2].clientX,r.touches[2].clientY);c[4]=h[0],c[5]=h[1]}if(i&&i.unactivate(),e.touchData.cxt){if(a={originalEvent:r,type:"cxttapend",position:{x:c[0],y:c[1]}},i?i.emit(a):s.emit(a),!e.touchData.cxtDragged){var f={originalEvent:r,type:"cxttap",position:{x:c[0],y:c[1]}};i?i.emit(f):s.emit(f)}return e.touchData.start&&(e.touchData.start._private.grabbed=!1),e.touchData.cxt=!1,e.touchData.start=null,void e.redraw()}if(!r.touches[2]&&s.boxSelectionEnabled()&&e.touchData.selecting){e.touchData.selecting=!1;var p=s.collection(e.getAllInBox(o[0],o[1],o[2],o[3]));o[0]=void 0,o[1]=void 0,o[2]=void 0,o[3]=void 0,o[4]=0,e.redrawHint("select",!0),s.emit({type:"boxend",originalEvent:r,position:{x:c[0],y:c[1]}});p.emit("box").stdFilter((function(e){return e.selectable()&&!e.selected()})).select().emit("boxselect"),p.nonempty()&&e.redrawHint("eles",!0),e.redraw()}if(null!=i&&i.unactivate(),r.touches[2])e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);else if(r.touches[1]);else if(r.touches[0]);else if(!r.touches[0]){e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);var v=e.dragData.touchDragEles;if(null!=i){var g=i._private.grabbed;d(v),e.redrawHint("drag",!0),e.redrawHint("eles",!0),g&&(i.emit("freeon"),v.emit("free"),e.dragData.didDrag&&(i.emit("dragfreeon"),v.emit("dragfree"))),n(i,["touchend","tapend","vmouseup","tapdragout"],r,{x:c[0],y:c[1]}),i.unactivate(),e.touchData.start=null}else{var m=e.findNearestElement(c[0],c[1],!0,!0);n(m,["touchend","tapend","vmouseup","tapdragout"],r,{x:c[0],y:c[1]})}var y=e.touchData.startPosition[0]-c[0],b=y*y,x=e.touchData.startPosition[1]-c[1],w=(b+x*x)*l*l;e.touchData.singleTouchMoved||(i||s.$(":selected").unselect(["tapunselect"]),n(i,["tap","vclick"],r,{x:c[0],y:c[1]}),V=!1,r.timeStamp-H<=s.multiClickDebounceTime()?(G&&clearTimeout(G),V=!0,H=null,n(i,["dbltap","vdblclick"],r,{x:c[0],y:c[1]})):(G=setTimeout((function(){V||n(i,["onetap","voneclick"],r,{x:c[0],y:c[1]})}),s.multiClickDebounceTime()),H=r.timeStamp)),null!=i&&!e.dragData.didDrag&&i._private.selectable&&w<e.touchTapThreshold2&&!e.pinching&&("single"===s.selectionType()?(s.$(t).unmerge(i).unselect(["tapunselect"]),i.select(["tapselect"])):i.selected()?i.unselect(["tapunselect"]):i.select(["tapselect"]),e.redrawHint("eles",!0)),e.touchData.singleTouchMoved=!0}for(var E=0;E<c.length;E++)u[E]=c[E];e.dragData.didDrag=!1,0===r.touches.length&&(e.touchData.dragDelta=[],e.touchData.startPosition=null,e.touchData.startGPosition=null,e.touchData.didSelect=!1),r.touches.length<2&&(1===r.touches.length&&(e.touchData.startGPosition=[r.touches[0].clientX,r.touches[0].clientY]),e.pinching=!1,e.redrawHint("eles",!0),e.redraw())}},!1),"undefined"==typeof TouchEvent){var Y=[],U=function(e){return{clientX:e.clientX,clientY:e.clientY,force:1,identifier:e.pointerId,pageX:e.pageX,pageY:e.pageY,radiusX:e.width/2,radiusY:e.height/2,screenX:e.screenX,screenY:e.screenY,target:e.target}},X=function(e){Y.push(function(e){return{event:e,touch:U(e)}}(e))},$=function(e){for(var t=0;t<Y.length;t++){if(Y[t].event.pointerId===e.pointerId)return void Y.splice(t,1)}},K=function(e){e.touches=Y.map((function(e){return e.touch}))},Z=function(e){return"mouse"===e.pointerType||4===e.pointerType};e.registerBinding(e.container,"pointerdown",(function(e){Z(e)||(e.preventDefault(),X(e),K(e),L(e))})),e.registerBinding(e.container,"pointerup",(function(e){Z(e)||($(e),K(e),z(e))})),e.registerBinding(e.container,"pointercancel",(function(e){Z(e)||($(e),K(e),F())})),e.registerBinding(e.container,"pointermove",(function(e){Z(e)||(e.preventDefault(),function(e){var t=Y.filter((function(t){return t.event.pointerId===e.pointerId}))[0];t.event=e,t.touch=U(e)}(e),K(e),B(e))}))}};var hs={generatePolygon:function(e,t){return this.nodeShapes[e]={renderer:this,name:e,points:t,draw:function(e,t,n,r,i){this.renderer.nodeShapeImpl("polygon",e,t,n,r,i,this.points)},intersectLine:function(e,t,n,r,i,o,a){return Mt(i,o,this.points,e,t,n/2,r/2,a)},checkPoint:function(e,t,n,r,i,o,a){return Pt(e,t,this.points,o,a,r,i,[0,-1],n)}}}};hs.generateEllipse=function(){return this.nodeShapes.ellipse={renderer:this,name:"ellipse",draw:function(e,t,n,r,i){this.renderer.nodeShapeImpl(this.name,e,t,n,r,i)},intersectLine:function(e,t,n,r,i,o,a){return function(e,t,n,r,i,o){var a=n-e,s=r-t;a/=i,s/=o;var l=Math.sqrt(a*a+s*s),c=l-1;if(c<0)return[];var u=c/l;return[(n-e)*u+e,(r-t)*u+t]}(i,o,e,t,n/2+a,r/2+a)},checkPoint:function(e,t,n,r,i,o,a){return Tt(e,t,r,i,o,a,n)}}},hs.generateRoundPolygon=function(e,t){for(var n=new Array(2*t.length),r=0;r<t.length/2;r++){var i=2*r,o=void 0;o=r<t.length/2-1?2*(r+1):0,n[4*r]=t[i],n[4*r+1]=t[i+1];var a=t[o]-t[i],s=t[o+1]-t[i+1],l=Math.sqrt(a*a+s*s);n[4*r+2]=a/l,n[4*r+3]=s/l}return this.nodeShapes[e]={renderer:this,name:e,points:n,draw:function(e,t,n,r,i){this.renderer.nodeShapeImpl("round-polygon",e,t,n,r,i,this.points)},intersectLine:function(e,t,n,r,i,o,a){return function(e,t,n,r,i,o,a,s){for(var l,c=[],u=new Array(n.length),d=o/2,h=a/2,f=Ft(o,a),p=0;p<n.length/4;p++){var v,g=void 0;g=0===p?n.length-2:4*p-2,v=4*p+2;var m=r+d*n[4*p],y=i+h*n[4*p+1],b=-n[g]*n[v]-n[g+1]*n[v+1],x=f/Math.tan(Math.acos(b)/2),w=m-x*n[g],E=y-x*n[g+1],_=m+x*n[v],k=y+x*n[v+1];0===p?(u[n.length-2]=w,u[n.length-1]=E):(u[4*p-2]=w,u[4*p-1]=E),u[4*p]=_,u[4*p+1]=k;var S=n[g+1],P=-n[g];S*n[v]+P*n[v+1]<0&&(S*=-1,P*=-1),0!==(l=Dt(e,t,r,i,w+S*f,E+P*f,f)).length&&c.push(l[0],l[1])}for(var j=0;j<u.length/4;j++)0!==(l=Ot(e,t,r,i,u[4*j],u[4*j+1],u[4*j+2],u[4*j+3],!1)).length&&c.push(l[0],l[1]);if(c.length>2){for(var C=[c[0],c[1]],T=Math.pow(C[0]-e,2)+Math.pow(C[1]-t,2),D=1;D<c.length/2;D++){var N=Math.pow(c[2*D]-e,2)+Math.pow(c[2*D+1]-t,2);N<=T&&(C[0]=c[2*D],C[1]=c[2*D+1],T=N)}return C}return c}(i,o,this.points,e,t,n,r)},checkPoint:function(e,t,n,r,i,o,a){return function(e,t,n,r,i,o,a){for(var s=new Array(n.length),l=o/2,c=a/2,u=Ft(o,a),d=u*u,h=0;h<n.length/4;h++){var f,p=void 0;p=0===h?n.length-2:4*h-2,f=4*h+2;var v=r+l*n[4*h],g=i+c*n[4*h+1],m=-n[p]*n[f]-n[p+1]*n[f+1],y=u/Math.tan(Math.acos(m)/2),b=v-y*n[p],x=g-y*n[p+1],w=v+y*n[f],E=g+y*n[f+1];s[4*h]=b,s[4*h+1]=x,s[4*h+2]=w,s[4*h+3]=E;var _=n[p+1],k=-n[p];_*n[f]+k*n[f+1]<0&&(_*=-1,k*=-1);var S=b+_*u,P=x+k*u;if(Math.pow(S-e,2)+Math.pow(P-t,2)<=d)return!0}return St(e,t,s)}(e,t,this.points,o,a,r,i)}}},hs.generateRoundRectangle=function(){return this.nodeShapes["round-rectangle"]=this.nodeShapes.roundrectangle={renderer:this,name:"round-rectangle",points:Rt(4,0),draw:function(e,t,n,r,i){this.renderer.nodeShapeImpl(this.name,e,t,n,r,i)},intersectLine:function(e,t,n,r,i,o,a){return xt(i,o,e,t,n,r,a)},checkPoint:function(e,t,n,r,i,o,a){var s=Bt(r,i),l=2*s;return!!Pt(e,t,this.points,o,a,r,i-l,[0,-1],n)||(!!Pt(e,t,this.points,o,a,r-l,i,[0,-1],n)||(!!Tt(e,t,l,l,o-r/2+s,a-i/2+s,n)||(!!Tt(e,t,l,l,o+r/2-s,a-i/2+s,n)||(!!Tt(e,t,l,l,o+r/2-s,a+i/2-s,n)||!!Tt(e,t,l,l,o-r/2+s,a+i/2-s,n)))))}}},hs.generateCutRectangle=function(){return this.nodeShapes["cut-rectangle"]=this.nodeShapes.cutrectangle={renderer:this,name:"cut-rectangle",cornerLength:8,points:Rt(4,0),draw:function(e,t,n,r,i){this.renderer.nodeShapeImpl(this.name,e,t,n,r,i)},generateCutTrianglePts:function(e,t,n,r){var i=this.cornerLength,o=t/2,a=e/2,s=n-a,l=n+a,c=r-o,u=r+o;return{topLeft:[s,c+i,s+i,c,s+i,c+i],topRight:[l-i,c,l,c+i,l-i,c+i],bottomRight:[l,u-i,l-i,u,l-i,u-i],bottomLeft:[s+i,u,s,u-i,s+i,u-i]}},intersectLine:function(e,t,n,r,i,o,a){var s=this.generateCutTrianglePts(n+2*a,r+2*a,e,t),l=[].concat.apply([],[s.topLeft.splice(0,4),s.topRight.splice(0,4),s.bottomRight.splice(0,4),s.bottomLeft.splice(0,4)]);return Mt(i,o,l,e,t)},checkPoint:function(e,t,n,r,i,o,a){if(Pt(e,t,this.points,o,a,r,i-2*this.cornerLength,[0,-1],n))return!0;if(Pt(e,t,this.points,o,a,r-2*this.cornerLength,i,[0,-1],n))return!0;var s=this.generateCutTrianglePts(r,i,o,a);return St(e,t,s.topLeft)||St(e,t,s.topRight)||St(e,t,s.bottomRight)||St(e,t,s.bottomLeft)}}},hs.generateBarrel=function(){return this.nodeShapes.barrel={renderer:this,name:"barrel",points:Rt(4,0),draw:function(e,t,n,r,i){this.renderer.nodeShapeImpl(this.name,e,t,n,r,i)},intersectLine:function(e,t,n,r,i,o,a){var s=this.generateBarrelBezierPts(n+2*a,r+2*a,e,t),l=function(e){var t=ut({x:e[0],y:e[1]},{x:e[2],y:e[3]},{x:e[4],y:e[5]},.15),n=ut({x:e[0],y:e[1]},{x:e[2],y:e[3]},{x:e[4],y:e[5]},.5),r=ut({x:e[0],y:e[1]},{x:e[2],y:e[3]},{x:e[4],y:e[5]},.85);return[e[0],e[1],t.x,t.y,n.x,n.y,r.x,r.y,e[4],e[5]]},c=[].concat(l(s.topLeft),l(s.topRight),l(s.bottomRight),l(s.bottomLeft));return Mt(i,o,c,e,t)},generateBarrelBezierPts:function(e,t,n,r){var i=t/2,o=e/2,a=n-o,s=n+o,l=r-i,c=r+i,u=zt(e,t),d=u.heightOffset,h=u.widthOffset,f=u.ctrlPtOffsetPct*e,p={topLeft:[a,l+d,a+f,l,a+h,l],topRight:[s-h,l,s-f,l,s,l+d],bottomRight:[s,c-d,s-f,c,s-h,c],bottomLeft:[a+h,c,a+f,c,a,c-d]};return p.topLeft.isTop=!0,p.topRight.isTop=!0,p.bottomLeft.isBottom=!0,p.bottomRight.isBottom=!0,p},checkPoint:function(e,t,n,r,i,o,a){var s=zt(r,i),l=s.heightOffset,c=s.widthOffset;if(Pt(e,t,this.points,o,a,r,i-2*l,[0,-1],n))return!0;if(Pt(e,t,this.points,o,a,r-2*c,i,[0,-1],n))return!0;for(var u=this.generateBarrelBezierPts(r,i,o,a),d=function(e,t,n){var r,i,o=n[4],a=n[2],s=n[0],l=n[5],c=n[1],u=Math.min(o,s),d=Math.max(o,s),h=Math.min(l,c),f=Math.max(l,c);if(u<=e&&e<=d&&h<=t&&t<=f){var p=[(r=o)-2*(i=a)+s,2*(i-r),r],v=function(e,t,n,r){var i=t*t-4*e*(n-=r);if(i<0)return[];var o=Math.sqrt(i),a=2*e;return[(-t+o)/a,(-t-o)/a]}(p[0],p[1],p[2],e).filter((function(e){return 0<=e&&e<=1}));if(v.length>0)return v[0]}return null},h=Object.keys(u),f=0;f<h.length;f++){var p=u[h[f]],v=d(e,t,p);if(null!=v){var g=p[5],m=p[3],y=p[1],b=ct(g,m,y,v);if(p.isTop&&b<=t)return!0;if(p.isBottom&&t<=b)return!0}}return!1}}},hs.generateBottomRoundrectangle=function(){return this.nodeShapes["bottom-round-rectangle"]=this.nodeShapes.bottomroundrectangle={renderer:this,name:"bottom-round-rectangle",points:Rt(4,0),draw:function(e,t,n,r,i){this.renderer.nodeShapeImpl(this.name,e,t,n,r,i)},intersectLine:function(e,t,n,r,i,o,a){var s=t-(r/2+a),l=Ot(i,o,e,t,e-(n/2+a),s,e+(n/2+a),s,!1);return l.length>0?l:xt(i,o,e,t,n,r,a)},checkPoint:function(e,t,n,r,i,o,a){var s=Bt(r,i),l=2*s;if(Pt(e,t,this.points,o,a,r,i-l,[0,-1],n))return!0;if(Pt(e,t,this.points,o,a,r-l,i,[0,-1],n))return!0;var c=r/2+2*n,u=i/2+2*n;return!!St(e,t,[o-c,a-u,o-c,a,o+c,a,o+c,a-u])||(!!Tt(e,t,l,l,o+r/2-s,a+i/2-s,n)||!!Tt(e,t,l,l,o-r/2+s,a+i/2-s,n))}}},hs.registerNodeShapes=function(){var e=this.nodeShapes={},t=this;this.generateEllipse(),this.generatePolygon("triangle",Rt(3,0)),this.generateRoundPolygon("round-triangle",Rt(3,0)),this.generatePolygon("rectangle",Rt(4,0)),e.square=e.rectangle,this.generateRoundRectangle(),this.generateCutRectangle(),this.generateBarrel(),this.generateBottomRoundrectangle();var n=[0,1,1,0,0,-1,-1,0];this.generatePolygon("diamond",n),this.generateRoundPolygon("round-diamond",n),this.generatePolygon("pentagon",Rt(5,0)),this.generateRoundPolygon("round-pentagon",Rt(5,0)),this.generatePolygon("hexagon",Rt(6,0)),this.generateRoundPolygon("round-hexagon",Rt(6,0)),this.generatePolygon("heptagon",Rt(7,0)),this.generateRoundPolygon("round-heptagon",Rt(7,0)),this.generatePolygon("octagon",Rt(8,0)),this.generateRoundPolygon("round-octagon",Rt(8,0));var r=new Array(20),i=Lt(5,0),o=Lt(5,Math.PI/5),a=.5*(3-Math.sqrt(5));a*=1.57;for(var s=0;s<o.length/2;s++)o[2*s]*=a,o[2*s+1]*=a;for(s=0;s<5;s++)r[4*s]=i[2*s],r[4*s+1]=i[2*s+1],r[4*s+2]=o[2*s],r[4*s+3]=o[2*s+1];r=It(r),this.generatePolygon("star",r),this.generatePolygon("vee",[-1,-1,0,-.333,1,-1,0,1]),this.generatePolygon("rhomboid",[-1,-1,.333,-1,1,1,-.333,1]),this.nodeShapes.concavehexagon=this.generatePolygon("concave-hexagon",[-1,-.95,-.75,0,-1,.95,1,.95,.75,0,1,-.95]);var l=[-1,-1,.25,-1,1,0,.25,1,-1,1];this.generatePolygon("tag",l),this.generateRoundPolygon("round-tag",l),e.makePolygon=function(e){var n,r="polygon-"+e.join("$");return(n=this[r])?n:t.generatePolygon(r,e)}};var fs={timeToRender:function(){return this.redrawTotalTime/this.redrawCount},redraw:function(e){e=e||Te();var t=this;void 0===t.averageRedrawTime&&(t.averageRedrawTime=0),void 0===t.lastRedrawTime&&(t.lastRedrawTime=0),void 0===t.lastDrawTime&&(t.lastDrawTime=0),t.requestedFrame=!0,t.renderOptions=e},beforeRender:function(e,t){if(!this.destroyed){null==t&&_e("Priority is not optional for beforeRender");var n=this.beforeRenderCallbacks;n.push({fn:e,priority:t}),n.sort((function(e,t){return t.priority-e.priority}))}}},ps=function(e,t,n){for(var r=e.beforeRenderCallbacks,i=0;i<r.length;i++)r[i].fn(t,n)};fs.startRenderLoop=function(){var e=this,t=e.cy;if(!e.renderLoopStarted){e.renderLoopStarted=!0;ne((function n(r){if(!e.destroyed){if(t.batching());else if(e.requestedFrame&&!e.skipFrame){ps(e,!0,r);var i=re();e.render(e.renderOptions);var o=e.lastDrawTime=re();void 0===e.averageRedrawTime&&(e.averageRedrawTime=o-i),void 0===e.redrawCount&&(e.redrawCount=0),e.redrawCount++,void 0===e.redrawTotalTime&&(e.redrawTotalTime=0);var a=o-i;e.redrawTotalTime+=a,e.lastRedrawTime=a,e.averageRedrawTime=e.averageRedrawTime/2+a/2,e.requestedFrame=!1}else ps(e,!1,r);e.skipFrame=!1,ne(n)}}))}};var vs=function(e){this.init(e)},gs=vs.prototype;gs.clientFunctions=["redrawHint","render","renderTo","matchCanvasSize","nodeShapeImpl","arrowShapeImpl"],gs.init=function(e){var t=this;t.options=e,t.cy=e.cy;var n=t.container=e.cy.container();if(w){var r=w.document,i=r.head,o="__________cytoscape_stylesheet",a="__________cytoscape_container",s=null!=r.getElementById(o);if(n.className.indexOf(a)<0&&(n.className=(n.className||"")+" "+a),!s){var l=r.createElement("style");l.id=o,l.innerHTML="."+a+" { position: relative; }",i.insertBefore(l,i.children[0])}"static"===w.getComputedStyle(n).getPropertyValue("position")&&Se("A Cytoscape container has style position:static and so can not use UI extensions properly")}t.selection=[void 0,void 0,void 0,void 0,0],t.bezierProjPcts=[.05,.225,.4,.5,.6,.775,.95],t.hoverData={down:null,last:null,downTime:null,triggerMode:null,dragging:!1,initialPan:[null,null],capture:!1},t.dragData={possibleDragElements:[]},t.touchData={start:null,capture:!1,startPosition:[null,null,null,null,null,null],singleTouchStartTime:null,singleTouchMoved:!0,now:[null,null,null,null,null,null],earlier:[null,null,null,null,null,null]},t.redraws=0,t.showFps=e.showFps,t.debug=e.debug,t.hideEdgesOnViewport=e.hideEdgesOnViewport,t.textureOnViewport=e.textureOnViewport,t.wheelSensitivity=e.wheelSensitivity,t.motionBlurEnabled=e.motionBlur,t.forcedPixelRatio=O(e.pixelRatio)?e.pixelRatio:null,t.motionBlur=e.motionBlur,t.motionBlurOpacity=e.motionBlurOpacity,t.motionBlurTransparency=1-t.motionBlurOpacity,t.motionBlurPxRatio=1,t.mbPxRBlurry=1,t.minMbLowQualFrames=4,t.fullQualityMb=!1,t.clearedForMotionBlur=[],t.desktopTapThreshold=e.desktopTapThreshold,t.desktopTapThreshold2=e.desktopTapThreshold*e.desktopTapThreshold,t.touchTapThreshold=e.touchTapThreshold,t.touchTapThreshold2=e.touchTapThreshold*e.touchTapThreshold,t.tapholdDuration=500,t.bindings=[],t.beforeRenderCallbacks=[],t.beforeRenderPriorities={animations:400,eleCalcs:300,eleTxrDeq:200,lyrTxrDeq:150,lyrTxrSkip:100},t.registerNodeShapes(),t.registerArrowShapes(),t.registerCalculationListeners()},gs.notify=function(e,t){var n=this,r=n.cy;this.destroyed||("init"!==e?"destroy"!==e?(("add"===e||"remove"===e||"move"===e&&r.hasCompoundNodes()||"load"===e||"zorder"===e||"mount"===e)&&n.invalidateCachedZSortedEles(),"viewport"===e&&n.redrawHint("select",!0),"load"!==e&&"resize"!==e&&"mount"!==e||(n.invalidateContainerClientCoordsCache(),n.matchCanvasSize(n.container)),n.redrawHint("eles",!0),n.redrawHint("drag",!0),this.startRenderLoop(),this.redraw()):n.destroy():n.load())},gs.destroy=function(){var e=this;e.destroyed=!0,e.cy.stopAnimationLoop();for(var t=0;t<e.bindings.length;t++){var n=e.bindings[t],r=n.target;(r.off||r.removeEventListener).apply(r,n.args)}if(e.bindings=[],e.beforeRenderCallbacks=[],e.onUpdateEleCalcsFns=[],e.removeObserver&&e.removeObserver.disconnect(),e.styleObserver&&e.styleObserver.disconnect(),e.resizeObserver&&e.resizeObserver.disconnect(),e.labelCalcDiv)try{document.body.removeChild(e.labelCalcDiv)}catch(i){}},gs.isHeadless=function(){return!1},[Xa,cs,us,ds,hs,fs].forEach((function(e){X(gs,e)}));var ms=1e3/60,ys=function(e){return function(){var t=this,n=this.renderer;if(!t.dequeueingSetup){t.dequeueingSetup=!0;var r=c.default((function(){n.redrawHint("eles",!0),n.redrawHint("drag",!0),n.redraw()}),e.deqRedrawThreshold),i=e.priority||Ee;n.beforeRender((function(i,o){var a=re(),s=n.averageRedrawTime,l=n.lastRedrawTime,c=[],u=n.cy.extent(),d=n.getPixelRatio();for(i||n.flushRenderedStyleQueue();;){var h=re(),f=h-a,p=h-o;if(l<ms){var v=ms-(i?s:0);if(p>=e.deqFastCost*v)break}else if(i){if(f>=e.deqCost*l||f>=e.deqAvgCost*s)break}else if(p>=e.deqNoDrawCost*ms)break;var g=e.deq(t,d,u);if(!(g.length>0))break;for(var m=0;m<g.length;m++)c.push(g[m])}c.length>0&&(e.onDeqd(t,c),!i&&e.shouldRedraw(t,c,d,u)&&r())}),i(t))}}},bs=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:xe;v(this,e),this.idsByKey=new Re,this.keyForId=new Re,this.cachesByLvl=new Re,this.lvls=[],this.getKey=t,this.doesEleInvalidateKey=n}return m(e,[{key:"getIdsFor",value:function(e){null==e&&_e("Can not get id list for null key");var t=this.idsByKey,n=this.idsByKey.get(e);return n||(n=new Le,t.set(e,n)),n}},{key:"addIdForKey",value:function(e,t){null!=e&&this.getIdsFor(e).add(t)}},{key:"deleteIdForKey",value:function(e,t){null!=e&&this.getIdsFor(e).delete(t)}},{key:"getNumberOfIdsForKey",value:function(e){return null==e?0:this.getIdsFor(e).size}},{key:"updateKeyMappingFor",value:function(e){var t=e.id(),n=this.keyForId.get(t),r=this.getKey(e);this.deleteIdForKey(n,t),this.addIdForKey(r,t),this.keyForId.set(t,r)}},{key:"deleteKeyMappingFor",value:function(e){var t=e.id(),n=this.keyForId.get(t);this.deleteIdForKey(n,t),this.keyForId.delete(t)}},{key:"keyHasChangedFor",value:function(e){var t=e.id();return this.keyForId.get(t)!==this.getKey(e)}},{key:"isInvalid",value:function(e){return this.keyHasChangedFor(e)||this.doesEleInvalidateKey(e)}},{key:"getCachesAt",value:function(e){var t=this.cachesByLvl,n=this.lvls,r=t.get(e);return r||(r=new Re,t.set(e,r),n.push(e)),r}},{key:"getCache",value:function(e,t){return this.getCachesAt(t).get(e)}},{key:"get",value:function(e,t){var n=this.getKey(e),r=this.getCache(n,t);return null!=r&&this.updateKeyMappingFor(e),r}},{key:"getForCachedKey",value:function(e,t){var n=this.keyForId.get(e.id());return this.getCache(n,t)}},{key:"hasCache",value:function(e,t){return this.getCachesAt(t).has(e)}},{key:"has",value:function(e,t){var n=this.getKey(e);return this.hasCache(n,t)}},{key:"setCache",value:function(e,t,n){n.key=e,this.getCachesAt(t).set(e,n)}},{key:"set",value:function(e,t,n){var r=this.getKey(e);this.setCache(r,t,n),this.updateKeyMappingFor(e)}},{key:"deleteCache",value:function(e,t){this.getCachesAt(t).delete(e)}},{key:"delete",value:function(e,t){var n=this.getKey(e);this.deleteCache(n,t)}},{key:"invalidateKey",value:function(e){var t=this;this.lvls.forEach((function(n){return t.deleteCache(e,n)}))}},{key:"invalidate",value:function(e){var t=e.id(),n=this.keyForId.get(t);this.deleteKeyMappingFor(e);var r=this.doesEleInvalidateKey(e);return r&&this.invalidateKey(n),r||0===this.getNumberOfIdsForKey(n)}}]),e}(),xs={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},ws=De({getKey:null,doesEleInvalidateKey:xe,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:be,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),Es=function(e,t){var n=this;n.renderer=e,n.onDequeues=[];var r=ws(t);X(n,r),n.lookup=new bs(r.getKey,r.doesEleInvalidateKey),n.setupDequeueing()},_s=Es.prototype;_s.reasons=xs,_s.getTextureQueue=function(e){var t=this;return t.eleImgCaches=t.eleImgCaches||{},t.eleImgCaches[e]=t.eleImgCaches[e]||[]},_s.getRetiredTextureQueue=function(e){var t=this.eleImgCaches.retired=this.eleImgCaches.retired||{};return t[e]=t[e]||[]},_s.getElementQueue=function(){return this.eleCacheQueue=this.eleCacheQueue||new u.default((function(e,t){return t.reqs-e.reqs}))},_s.getElementKeyToQueue=function(){return this.eleKeyToCacheQueue=this.eleKeyToCacheQueue||{}},_s.getElement=function(e,t,n,r,i){var o=this,a=this.renderer,s=a.cy.zoom(),l=this.lookup;if(!t||0===t.w||0===t.h||isNaN(t.w)||isNaN(t.h)||!e.visible()||e.removed())return null;if(!o.allowEdgeTxrCaching&&e.isEdge()||!o.allowParentTxrCaching&&e.isParent())return null;if(null==r&&(r=Math.ceil(it(s*n))),r<-4)r=-4;else if(s>=7.99||r>3)return null;var c=Math.pow(2,r),u=t.h*c,d=t.w*c,h=a.eleTextBiggerThanMin(e,c);if(!this.isVisible(e,h))return null;var f,p=l.get(e,r);if(p&&p.invalidated&&(p.invalidated=!1,p.texture.invalidatedWidth-=p.width),p)return p;if(f=u<=25?25:u<=50?50:50*Math.ceil(u/50),u>1024||d>1024)return null;var v=o.getTextureQueue(f),g=v[v.length-2],m=function(){return o.recycleTexture(f,d)||o.addTexture(f,d)};g||(g=v[v.length-1]),g||(g=m()),g.width-g.usedWidth<d&&(g=m());for(var y,b=function(e){return e&&e.scaledLabelShown===h},x=i&&i===xs.dequeue,w=i&&i===xs.highQuality,E=i&&i===xs.downscale,_=r+1;_<=3;_++){var k=l.get(e,_);if(k){y=k;break}}var S=y&&y.level===r+1?y:null,P=function(){g.context.drawImage(S.texture.canvas,S.x,0,S.width,S.height,g.usedWidth,0,d,u)};if(g.context.setTransform(1,0,0,1,0,0),g.context.clearRect(g.usedWidth,0,d,f),b(S))P();else if(b(y)){if(!w)return o.queueElement(e,y.level-1),y;for(var j=y.level;j>r;j--)S=o.getElement(e,t,n,j,xs.downscale);P()}else{var C;if(!x&&!w&&!E)for(var T=r-1;T>=-4;T--){var D=l.get(e,T);if(D){C=D;break}}if(b(C))return o.queueElement(e,r),C;g.context.translate(g.usedWidth,0),g.context.scale(c,c),this.drawElement(g.context,e,t,h,!1),g.context.scale(1/c,1/c),g.context.translate(-g.usedWidth,0)}return p={x:g.usedWidth,texture:g,level:r,scale:c,width:d,height:u,scaledLabelShown:h},g.usedWidth+=Math.ceil(d+8),g.eleCaches.push(p),l.set(e,r,p),o.checkTextureFullness(g),p},_s.invalidateElements=function(e){for(var t=0;t<e.length;t++)this.invalidateElement(e[t])},_s.invalidateElement=function(e){var t=this,n=t.lookup,r=[];if(n.isInvalid(e)){for(var i=-4;i<=3;i++){var o=n.getForCachedKey(e,i);o&&r.push(o)}if(n.invalidate(e))for(var a=0;a<r.length;a++){var s=r[a],l=s.texture;l.invalidatedWidth+=s.width,s.invalidated=!0,t.checkTextureUtility(l)}t.removeFromQueue(e)}},_s.checkTextureUtility=function(e){e.invalidatedWidth>=.2*e.width&&this.retireTexture(e)},_s.checkTextureFullness=function(e){var t=this.getTextureQueue(e.height);e.usedWidth/e.width>.8&&e.fullnessChecks>=10?Ne(t,e):e.fullnessChecks++},_s.retireTexture=function(e){var t=e.height,n=this.getTextureQueue(t),r=this.lookup;Ne(n,e),e.retired=!0;for(var i=e.eleCaches,o=0;o<i.length;o++){var a=i[o];r.deleteCache(a.key,a.level)}Oe(i),this.getRetiredTextureQueue(t).push(e)},_s.addTexture=function(e,t){var n={};return this.getTextureQueue(e).push(n),n.eleCaches=[],n.height=e,n.width=Math.max(1024,t),n.usedWidth=0,n.invalidatedWidth=0,n.fullnessChecks=0,n.canvas=this.renderer.makeOffscreenCanvas(n.width,n.height),n.context=n.canvas.getContext("2d"),n},_s.recycleTexture=function(e,t){for(var n=this.getTextureQueue(e),r=this.getRetiredTextureQueue(e),i=0;i<r.length;i++){var o=r[i];if(o.width>=t)return o.retired=!1,o.usedWidth=0,o.invalidatedWidth=0,o.fullnessChecks=0,Oe(o.eleCaches),o.context.setTransform(1,0,0,1,0,0),o.context.clearRect(0,0,o.width,o.height),Ne(r,o),n.push(o),o}},_s.queueElement=function(e,t){var n=this.getElementQueue(),r=this.getElementKeyToQueue(),i=this.getKey(e),o=r[i];if(o)o.level=Math.max(o.level,t),o.eles.merge(e),o.reqs++,n.updateItem(o);else{var a={eles:e.spawn().merge(e),level:t,reqs:1,key:i};n.push(a),r[i]=a}},_s.dequeue=function(e){for(var t=this,n=t.getElementQueue(),r=t.getElementKeyToQueue(),i=[],o=t.lookup,a=0;a<1&&n.size()>0;a++){var s=n.pop(),l=s.key,c=s.eles[0],u=o.hasCache(c,s.level);if(r[l]=null,!u){i.push(s);var d=t.getBoundingBox(c);t.getElement(c,d,e,s.level,xs.dequeue)}}return i},_s.removeFromQueue=function(e){var t=this.getElementQueue(),n=this.getElementKeyToQueue(),r=this.getKey(e),i=n[r];null!=i&&(1===i.eles.length?(i.reqs=ye,t.updateItem(i),t.pop(),n[r]=null):i.eles.unmerge(e))},_s.onDequeue=function(e){this.onDequeues.push(e)},_s.offDequeue=function(e){Ne(this.onDequeues,e)},_s.setupDequeueing=ys({deqRedrawThreshold:100,deqCost:.15,deqAvgCost:.1,deqNoDrawCost:.9,deqFastCost:.9,deq:function(e,t,n){return e.dequeue(t,n)},onDeqd:function(e,t){for(var n=0;n<e.onDequeues.length;n++){(0,e.onDequeues[n])(t)}},shouldRedraw:function(e,t,n,r){for(var i=0;i<t.length;i++)for(var o=t[i].eles,a=0;a<o.length;a++){var s=o[a].boundingBox();if(mt(s,r))return!0}return!1},priority:function(e){return e.renderer.beforeRenderPriorities.eleTxrDeq}});var ks=function(e){var t=this,n=t.renderer=e,r=n.cy;t.layersByLevel={},t.firstGet=!0,t.lastInvalidationTime=re()-500,t.skipping=!1,t.eleTxrDeqs=r.collection(),t.scheduleElementRefinement=c.default((function(){t.refineElementTextures(t.eleTxrDeqs),t.eleTxrDeqs.unmerge(t.eleTxrDeqs)}),50),n.beforeRender((function(e,n){n-t.lastInvalidationTime<=250?t.skipping=!0:t.skipping=!1}),n.beforeRenderPriorities.lyrTxrSkip);t.layersQueue=new u.default((function(e,t){return t.reqs-e.reqs})),t.setupDequeueing()},Ss=ks.prototype,Ps=0,js=Math.pow(2,53)-1;Ss.makeLayer=function(e,t){var n=Math.pow(2,t),r=Math.ceil(e.w*n),i=Math.ceil(e.h*n),o=this.renderer.makeOffscreenCanvas(r,i),a={id:Ps=++Ps%js,bb:e,level:t,width:r,height:i,canvas:o,context:o.getContext("2d"),eles:[],elesQueue:[],reqs:0},s=a.context,l=-a.bb.x1,c=-a.bb.y1;return s.scale(n,n),s.translate(l,c),a},Ss.getLayers=function(e,t,n){var r=this,i=r.renderer.cy.zoom(),o=r.firstGet;if(r.firstGet=!1,null==n)if((n=Math.ceil(it(i*t)))<-4)n=-4;else if(i>=3.99||n>2)return null;r.validateLayersElesOrdering(n,e);var a,s,l=r.layersByLevel,c=Math.pow(2,n),u=l[n]=l[n]||[];if(r.levelIsComplete(n,e))return u;!function(){var t=function(t){if(r.validateLayersElesOrdering(t,e),r.levelIsComplete(t,e))return s=l[t],!0},i=function(e){if(!s)for(var r=n+e;-4<=r&&r<=2&&!t(r);r+=e);};i(1),i(-1);for(var o=u.length-1;o>=0;o--){var a=u[o];a.invalid&&Ne(u,a)}}();var d=function(t){var i=(t=t||{}).after;if(function(){if(!a){a=ht();for(var t=0;t<e.length;t++)n=a,r=e[t].boundingBox(),n.x1=Math.min(n.x1,r.x1),n.x2=Math.max(n.x2,r.x2),n.w=n.x2-n.x1,n.y1=Math.min(n.y1,r.y1),n.y2=Math.max(n.y2,r.y2),n.h=n.y2-n.y1}var n,r}(),a.w*c*(a.h*c)>16e6)return null;var o=r.makeLayer(a,n);if(null!=i){var s=u.indexOf(i)+1;u.splice(s,0,o)}else(void 0===t.insert||t.insert)&&u.unshift(o);return o};if(r.skipping&&!o)return null;for(var h=null,f=e.length/1,p=!o,v=0;v<e.length;v++){var g=e[v],m=g._private.rscratch,y=m.imgLayerCaches=m.imgLayerCaches||{},b=y[n];if(b)h=b;else{if((!h||h.eles.length>=f||!bt(h.bb,g.boundingBox()))&&!(h=d({insert:!0,after:h})))return null;s||p?r.queueLayer(h,g):r.drawEleInLayer(h,g,n,t),h.eles.push(g),y[n]=h}}return s||(p?null:u)},Ss.getEleLevelForLayerLevel=function(e,t){return e},Ss.drawEleInLayer=function(e,t,n,r){var i=this.renderer,o=e.context,a=t.boundingBox();0!==a.w&&0!==a.h&&t.visible()&&(n=this.getEleLevelForLayerLevel(n,r),i.setImgSmoothing(o,!1),i.drawCachedElement(o,t,null,null,n,true),i.setImgSmoothing(o,!0))},Ss.levelIsComplete=function(e,t){var n=this.layersByLevel[e];if(!n||0===n.length)return!1;for(var r=0,i=0;i<n.length;i++){var o=n[i];if(o.reqs>0)return!1;if(o.invalid)return!1;r+=o.eles.length}return r===t.length},Ss.validateLayersElesOrdering=function(e,t){var n=this.layersByLevel[e];if(n)for(var r=0;r<n.length;r++){for(var i=n[r],o=-1,a=0;a<t.length;a++)if(i.eles[0]===t[a]){o=a;break}if(o<0)this.invalidateLayer(i);else{var s=o;for(a=0;a<i.eles.length;a++)if(i.eles[a]!==t[s+a]){this.invalidateLayer(i);break}}}},Ss.updateElementsInLayers=function(e,t){for(var n=R(e[0]),r=0;r<e.length;r++)for(var i=n?null:e[r],o=n?e[r]:e[r].ele,a=o._private.rscratch,s=a.imgLayerCaches=a.imgLayerCaches||{},l=-4;l<=2;l++){var c=s[l];c&&(i&&this.getEleLevelForLayerLevel(c.level)!==i.level||t(c,o,i))}},Ss.haveLayers=function(){for(var e=!1,t=-4;t<=2;t++){var n=this.layersByLevel[t];if(n&&n.length>0){e=!0;break}}return e},Ss.invalidateElements=function(e){var t=this;0!==e.length&&(t.lastInvalidationTime=re(),0!==e.length&&t.haveLayers()&&t.updateElementsInLayers(e,(function(e,n,r){t.invalidateLayer(e)})))},Ss.invalidateLayer=function(e){if(this.lastInvalidationTime=re(),!e.invalid){var t=e.level,n=e.eles,r=this.layersByLevel[t];Ne(r,e),e.elesQueue=[],e.invalid=!0,e.replacement&&(e.replacement.invalid=!0);for(var i=0;i<n.length;i++){var o=n[i]._private.rscratch.imgLayerCaches;o&&(o[t]=null)}}},Ss.refineElementTextures=function(e){var t=this;t.updateElementsInLayers(e,(function(e,n,r){var i=e.replacement;if(i||((i=e.replacement=t.makeLayer(e.bb,e.level)).replaces=e,i.eles=e.eles),!i.reqs)for(var o=0;o<i.eles.length;o++)t.queueLayer(i,i.eles[o])}))},Ss.enqueueElementRefinement=function(e){this.eleTxrDeqs.merge(e),this.scheduleElementRefinement()},Ss.queueLayer=function(e,t){var n=this.layersQueue,r=e.elesQueue,i=r.hasId=r.hasId||{};if(!e.replacement){if(t){if(i[t.id()])return;r.push(t),i[t.id()]=!0}e.reqs?(e.reqs++,n.updateItem(e)):(e.reqs=1,n.push(e))}},Ss.dequeue=function(e){for(var t=this,n=t.layersQueue,r=[],i=0;i<1&&0!==n.size();){var o=n.peek();if(o.replacement)n.pop();else if(o.replaces&&o!==o.replaces.replacement)n.pop();else if(o.invalid)n.pop();else{var a=o.elesQueue.shift();a&&(t.drawEleInLayer(o,a,o.level,e),i++),0===r.length&&r.push(!0),0===o.elesQueue.length&&(n.pop(),o.reqs=0,o.replaces&&t.applyLayerReplacement(o),t.requestRedraw())}}return r},Ss.applyLayerReplacement=function(e){var t=this.layersByLevel[e.level],n=e.replaces,r=t.indexOf(n);if(!(r<0||n.invalid)){t[r]=e;for(var i=0;i<e.eles.length;i++){var o=e.eles[i]._private,a=o.imgLayerCaches=o.imgLayerCaches||{};a&&(a[e.level]=e)}this.requestRedraw()}},Ss.requestRedraw=c.default((function(){var e=this.renderer;e.redrawHint("eles",!0),e.redrawHint("drag",!0),e.redraw()}),100),Ss.setupDequeueing=ys({deqRedrawThreshold:50,deqCost:.15,deqAvgCost:.1,deqNoDrawCost:.9,deqFastCost:.9,deq:function(e,t){return e.dequeue(t)},onDeqd:Ee,shouldRedraw:be,priority:function(e){return e.renderer.beforeRenderPriorities.lyrTxrDeq}});var Cs,Ts={};function Ds(e,t){for(var n=0;n<t.length;n++){var r=t[n];e.lineTo(r.x,r.y)}}function Ns(e,t,n){for(var r,i=0;i<t.length;i++){var o=t[i];0===i&&(r=o),e.lineTo(o.x,o.y)}e.quadraticCurveTo(n.x,n.y,r.x,r.y)}function Os(e,t,n){e.beginPath&&e.beginPath();for(var r=t,i=0;i<r.length;i++){var o=r[i];e.lineTo(o.x,o.y)}var a=n,s=n[0];e.moveTo(s.x,s.y);for(i=1;i<a.length;i++){o=a[i];e.lineTo(o.x,o.y)}e.closePath&&e.closePath()}function Ms(e,t,n,r,i){e.beginPath&&e.beginPath(),e.arc(n,r,i,0,2*Math.PI,!1);var o=t,a=o[0];e.moveTo(a.x,a.y);for(var s=0;s<o.length;s++){var l=o[s];e.lineTo(l.x,l.y)}e.closePath&&e.closePath()}function As(e,t,n,r){e.arc(t,n,r,0,2*Math.PI,!1)}Ts.arrowShapeImpl=function(e){return(Cs||(Cs={polygon:Ds,"triangle-backcurve":Ns,"triangle-tee":Os,"circle-triangle":Ms,"triangle-cross":Os,circle:As}))[e]};var Rs={drawElement:function(e,t,n,r,i,o){t.isNode()?this.drawNode(e,t,n,r,i,o):this.drawEdge(e,t,n,r,i,o)},drawElementOverlay:function(e,t){t.isNode()?this.drawNodeOverlay(e,t):this.drawEdgeOverlay(e,t)},drawElementUnderlay:function(e,t){t.isNode()?this.drawNodeUnderlay(e,t):this.drawEdgeUnderlay(e,t)},drawCachedElementPortion:function(e,t,n,r,i,o,a,s){var l=this,c=n.getBoundingBox(t);if(0!==c.w&&0!==c.h){var u=n.getElement(t,c,r,i,o);if(null!=u){var d=s(l,t);if(0===d)return;var h,f,p,v,g,m,y=a(l,t),b=c.x1,x=c.y1,w=c.w,E=c.h;if(0!==y){var _=n.getRotationPoint(t);p=_.x,v=_.y,e.translate(p,v),e.rotate(y),(g=l.getImgSmoothing(e))||l.setImgSmoothing(e,!0);var k=n.getRotationOffset(t);h=k.x,f=k.y}else h=b,f=x;1!==d&&(m=e.globalAlpha,e.globalAlpha=m*d),e.drawImage(u.texture.canvas,u.x,0,u.width,u.height,h,f,w,E),1!==d&&(e.globalAlpha=m),0!==y&&(e.rotate(-y),e.translate(-p,-v),g||l.setImgSmoothing(e,!1))}else n.drawElement(e,t)}}},Is=function(){return 0},Ls=function(e,t){return e.getTextAngle(t,null)},Bs=function(e,t){return e.getTextAngle(t,"source")},Fs=function(e,t){return e.getTextAngle(t,"target")},zs=function(e,t){return t.effectiveOpacity()},Vs=function(e,t){return t.pstyle("text-opacity").pfValue*t.effectiveOpacity()};Rs.drawCachedElement=function(e,t,n,r,i,o){var a=this,s=a.data,l=s.eleTxrCache,c=s.lblTxrCache,u=s.slbTxrCache,d=s.tlbTxrCache,h=t.boundingBox(),f=!0===o?l.reasons.highQuality:null;if(0!==h.w&&0!==h.h&&t.visible()&&(!r||mt(h,r))){var p=t.isEdge(),v=t.element()._private.rscratch.badLine;a.drawElementUnderlay(e,t),a.drawCachedElementPortion(e,t,l,n,i,f,Is,zs),p&&v||a.drawCachedElementPortion(e,t,c,n,i,f,Ls,Vs),p&&!v&&(a.drawCachedElementPortion(e,t,u,n,i,f,Bs,Vs),a.drawCachedElementPortion(e,t,d,n,i,f,Fs,Vs)),a.drawElementOverlay(e,t)}},Rs.drawElements=function(e,t){for(var n=0;n<t.length;n++){var r=t[n];this.drawElement(e,r)}},Rs.drawCachedElements=function(e,t,n,r){for(var i=0;i<t.length;i++){var o=t[i];this.drawCachedElement(e,o,n,r)}},Rs.drawCachedNodes=function(e,t,n,r){for(var i=0;i<t.length;i++){var o=t[i];o.isNode()&&this.drawCachedElement(e,o,n,r)}},Rs.drawLayeredElements=function(e,t,n,r){var i=this.data.lyrTxrCache.getLayers(t,n);if(i)for(var o=0;o<i.length;o++){var a=i[o],s=a.bb;0!==s.w&&0!==s.h&&e.drawImage(a.canvas,s.x1,s.y1,s.w,s.h)}else this.drawCachedElements(e,t,n,r)};var Gs={drawEdge:function(e,t,n){var r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],o=!(arguments.length>5&&void 0!==arguments[5])||arguments[5],a=this,s=t._private.rscratch;if((!o||t.visible())&&!s.badLine&&null!=s.allpts&&!isNaN(s.allpts[0])){var l;n&&(l=n,e.translate(-l.x1,-l.y1));var c=o?t.pstyle("opacity").value:1,u=o?t.pstyle("line-opacity").value:1,d=t.pstyle("curve-style").value,h=t.pstyle("line-style").value,f=t.pstyle("width").pfValue,p=t.pstyle("line-cap").value,v=c*u,g=c*u,m=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:v;"straight-triangle"===d?(a.eleStrokeStyle(e,t,n),a.drawEdgeTrianglePath(t,e,s.allpts)):(e.lineWidth=f,e.lineCap=p,a.eleStrokeStyle(e,t,n),a.drawEdgePath(t,e,s.allpts,h),e.lineCap="butt")},y=function(){i&&a.drawEdgeOverlay(e,t)},b=function(){i&&a.drawEdgeUnderlay(e,t)},x=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:g;a.drawArrowheads(e,t,n)},w=function(){a.drawElementText(e,t,null,r)};e.lineJoin="round";var E="yes"===t.pstyle("ghost").value;if(E){var _=t.pstyle("ghost-offset-x").pfValue,k=t.pstyle("ghost-offset-y").pfValue,S=t.pstyle("ghost-opacity").value,P=v*S;e.translate(_,k),m(P),x(P),e.translate(-_,-k)}b(),m(),x(),y(),w(),n&&e.translate(l.x1,l.y1)}}},Hs=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(t,n){if(n.visible()){var r=n.pstyle("".concat(e,"-opacity")).value;if(0!==r){var i=this,o=i.usePaths(),a=n._private.rscratch,s=2*n.pstyle("".concat(e,"-padding")).pfValue,l=n.pstyle("".concat(e,"-color")).value;t.lineWidth=s,"self"!==a.edgeType||o?t.lineCap="round":t.lineCap="butt",i.colorStrokeStyle(t,l[0],l[1],l[2],r),i.drawEdgePath(n,t,a.allpts,"solid")}}}};Gs.drawEdgeOverlay=Hs("overlay"),Gs.drawEdgeUnderlay=Hs("underlay"),Gs.drawEdgePath=function(e,t,n,r){var i,o=e._private.rscratch,a=t,s=!1,l=this.usePaths(),c=e.pstyle("line-dash-pattern").pfValue,u=e.pstyle("line-dash-offset").pfValue;if(l){var d=n.join("$");o.pathCacheKey&&o.pathCacheKey===d?(i=t=o.pathCache,s=!0):(i=t=new Path2D,o.pathCacheKey=d,o.pathCache=i)}if(a.setLineDash)switch(r){case"dotted":a.setLineDash([1,1]);break;case"dashed":a.setLineDash(c),a.lineDashOffset=u;break;case"solid":a.setLineDash([])}if(!s&&!o.badLine)switch(t.beginPath&&t.beginPath(),t.moveTo(n[0],n[1]),o.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var h=2;h+3<n.length;h+=4)t.quadraticCurveTo(n[h],n[h+1],n[h+2],n[h+3]);break;case"straight":case"segments":case"haystack":for(var f=2;f+1<n.length;f+=2)t.lineTo(n[f],n[f+1])}t=a,l?t.stroke(i):t.stroke(),t.setLineDash&&t.setLineDash([])},Gs.drawEdgeTrianglePath=function(e,t,n){t.fillStyle=t.strokeStyle;for(var r=e.pstyle("width").pfValue,i=0;i+1<n.length;i+=2){var o=[n[i+2]-n[i],n[i+3]-n[i+1]],a=Math.sqrt(o[0]*o[0]+o[1]*o[1]),s=[o[1]/a,-o[0]/a],l=[s[0]*r/2,s[1]*r/2];t.beginPath(),t.moveTo(n[i]-l[0],n[i+1]-l[1]),t.lineTo(n[i]+l[0],n[i+1]+l[1]),t.lineTo(n[i+2],n[i+3]),t.closePath(),t.fill()}},Gs.drawArrowheads=function(e,t,n){var r=t._private.rscratch,i="haystack"===r.edgeType;i||this.drawArrowhead(e,t,"source",r.arrowStartX,r.arrowStartY,r.srcArrowAngle,n),this.drawArrowhead(e,t,"mid-target",r.midX,r.midY,r.midtgtArrowAngle,n),this.drawArrowhead(e,t,"mid-source",r.midX,r.midY,r.midsrcArrowAngle,n),i||this.drawArrowhead(e,t,"target",r.arrowEndX,r.arrowEndY,r.tgtArrowAngle,n)},Gs.drawArrowhead=function(e,t,n,r,i,o,a){if(!(isNaN(r)||null==r||isNaN(i)||null==i||isNaN(o)||null==o)){var s=this,l=t.pstyle(n+"-arrow-shape").value;if("none"!==l){var c="hollow"===t.pstyle(n+"-arrow-fill").value?"both":"filled",u=t.pstyle(n+"-arrow-fill").value,d=t.pstyle("width").pfValue,h=t.pstyle("opacity").value;void 0===a&&(a=h);var f=e.globalCompositeOperation;1===a&&"hollow"!==u||(e.globalCompositeOperation="destination-out",s.colorFillStyle(e,255,255,255,1),s.colorStrokeStyle(e,255,255,255,1),s.drawArrowShape(t,e,c,d,l,r,i,o),e.globalCompositeOperation=f);var p=t.pstyle(n+"-arrow-color").value;s.colorFillStyle(e,p[0],p[1],p[2],a),s.colorStrokeStyle(e,p[0],p[1],p[2],a),s.drawArrowShape(t,e,u,d,l,r,i,o)}}},Gs.drawArrowShape=function(e,t,n,r,i,o,a,s){var l,c=this,u=this.usePaths()&&"triangle-cross"!==i,d=!1,h=t,f={x:o,y:a},p=e.pstyle("arrow-scale").value,v=this.getArrowWidth(r,p),g=c.arrowShapes[i];if(u){var m=c.arrowPathCache=c.arrowPathCache||[],y=he(i),b=m[y];null!=b?(l=t=b,d=!0):(l=t=new Path2D,m[y]=l)}d||(t.beginPath&&t.beginPath(),u?g.draw(t,1,0,{x:0,y:0},1):g.draw(t,v,s,f,r),t.closePath&&t.closePath()),t=h,u&&(t.translate(o,a),t.rotate(s),t.scale(v,v)),"filled"!==n&&"both"!==n||(u?t.fill(l):t.fill()),"hollow"!==n&&"both"!==n||(t.lineWidth=(g.matchEdgeWidth?r:1)/(u?v:1),t.lineJoin="miter",u?t.stroke(l):t.stroke()),u&&(t.scale(1/v,1/v),t.rotate(-s),t.translate(-o,-a))};var Ws={safeDrawImage:function(e,t,n,r,i,o,a,s,l,c){if(!(i<=0||o<=0||l<=0||c<=0))try{e.drawImage(t,n,r,i,o,a,s,l,c)}catch(u){Se(u)}},drawInscribedImage:function(e,t,n,r,i){var o=this,a=n.position(),s=a.x,l=a.y,c=n.cy().style(),u=c.getIndexedStyle.bind(c),d=u(n,"background-fit","value",r),h=u(n,"background-repeat","value",r),f=n.width(),p=n.height(),v=2*n.padding(),g=f+("inner"===u(n,"background-width-relative-to","value",r)?0:v),m=p+("inner"===u(n,"background-height-relative-to","value",r)?0:v),y=n._private.rscratch,b="node"===u(n,"background-clip","value",r),x=u(n,"background-image-opacity","value",r)*i,w=u(n,"background-image-smoothing","value",r),E=t.width||t.cachedW,_=t.height||t.cachedH;null!=E&&null!=_||(document.body.appendChild(t),E=t.cachedW=t.width||t.offsetWidth,_=t.cachedH=t.height||t.offsetHeight,document.body.removeChild(t));var k=E,S=_;if("auto"!==u(n,"background-width","value",r)&&(k="%"===u(n,"background-width","units",r)?u(n,"background-width","pfValue",r)*g:u(n,"background-width","pfValue",r)),"auto"!==u(n,"background-height","value",r)&&(S="%"===u(n,"background-height","units",r)?u(n,"background-height","pfValue",r)*m:u(n,"background-height","pfValue",r)),0!==k&&0!==S){if("contain"===d)k*=P=Math.min(g/k,m/S),S*=P;else if("cover"===d){var P;k*=P=Math.max(g/k,m/S),S*=P}var j=s-g/2,C=u(n,"background-position-x","units",r),T=u(n,"background-position-x","pfValue",r);j+="%"===C?(g-k)*T:T;var D=u(n,"background-offset-x","units",r),N=u(n,"background-offset-x","pfValue",r);j+="%"===D?(g-k)*N:N;var O=l-m/2,M=u(n,"background-position-y","units",r),A=u(n,"background-position-y","pfValue",r);O+="%"===M?(m-S)*A:A;var R=u(n,"background-offset-y","units",r),I=u(n,"background-offset-y","pfValue",r);O+="%"===R?(m-S)*I:I,y.pathCache&&(j-=s,O-=l,s=0,l=0);var L=e.globalAlpha;e.globalAlpha=x;var B=o.getImgSmoothing(e),F=!1;if("no"===w&&B?(o.setImgSmoothing(e,!1),F=!0):"yes"!==w||B||(o.setImgSmoothing(e,!0),F=!0),"no-repeat"===h)b&&(e.save(),y.pathCache?e.clip(y.pathCache):(o.nodeShapes[o.getNodeShape(n)].draw(e,s,l,g,m),e.clip())),o.safeDrawImage(e,t,0,0,E,_,j,O,k,S),b&&e.restore();else{var z=e.createPattern(t,h);e.fillStyle=z,o.nodeShapes[o.getNodeShape(n)].draw(e,s,l,g,m),e.translate(j,O),e.fill(),e.translate(-j,-O)}e.globalAlpha=L,F&&o.setImgSmoothing(e,B)}}},qs={};function Ys(e,t,n,r,i){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:5;e.beginPath(),e.moveTo(t+o,n),e.lineTo(t+r-o,n),e.quadraticCurveTo(t+r,n,t+r,n+o),e.lineTo(t+r,n+i-o),e.quadraticCurveTo(t+r,n+i,t+r-o,n+i),e.lineTo(t+o,n+i),e.quadraticCurveTo(t,n+i,t,n+i-o),e.lineTo(t,n+o),e.quadraticCurveTo(t,n,t+o,n),e.closePath(),e.fill()}qs.eleTextBiggerThanMin=function(e,t){if(!t){var n=e.cy().zoom(),r=this.getPixelRatio(),i=Math.ceil(it(n*r));t=Math.pow(2,i)}return!(e.pstyle("font-size").pfValue*t<e.pstyle("min-zoomed-font-size").pfValue)},qs.drawElementText=function(e,t,n,r,i){var o=!(arguments.length>5&&void 0!==arguments[5])||arguments[5],a=this;if(null==r){if(o&&!a.eleTextBiggerThanMin(t))return}else if(!1===r)return;if(t.isNode()){var s=t.pstyle("label");if(!s||!s.value)return;var l=a.getLabelJustification(t);e.textAlign=l,e.textBaseline="bottom"}else{var c=t.element()._private.rscratch.badLine,u=t.pstyle("label"),d=t.pstyle("source-label"),h=t.pstyle("target-label");if(c||(!u||!u.value)&&(!d||!d.value)&&(!h||!h.value))return;e.textAlign="center",e.textBaseline="bottom"}var f,p=!n;n&&(f=n,e.translate(-f.x1,-f.y1)),null==i?(a.drawText(e,t,null,p,o),t.isEdge()&&(a.drawText(e,t,"source",p,o),a.drawText(e,t,"target",p,o))):a.drawText(e,t,i,p,o),n&&e.translate(f.x1,f.y1)},qs.getFontCache=function(e){var t;this.fontCaches=this.fontCaches||[];for(var n=0;n<this.fontCaches.length;n++)if((t=this.fontCaches[n]).context===e)return t;return t={context:e},this.fontCaches.push(t),t},qs.setupTextStyle=function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=t.pstyle("font-style").strValue,i=t.pstyle("font-size").pfValue+"px",o=t.pstyle("font-family").strValue,a=t.pstyle("font-weight").strValue,s=n?t.effectiveOpacity()*t.pstyle("text-opacity").value:1,l=t.pstyle("text-outline-opacity").value*s,c=t.pstyle("color").value,u=t.pstyle("text-outline-color").value;e.font=r+" "+a+" "+i+" "+o,e.lineJoin="round",this.colorFillStyle(e,c[0],c[1],c[2],s),this.colorStrokeStyle(e,u[0],u[1],u[2],l)},qs.getTextAngle=function(e,t){var n=e._private.rscratch,r=t?t+"-":"",i=e.pstyle(r+"text-rotation"),o=Me(n,"labelAngle",t);return"autorotate"===i.strValue?e.isEdge()?o:0:"none"===i.strValue?0:i.pfValue},qs.drawText=function(e,t,n){var r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],o=t._private,a=o.rscratch,s=i?t.effectiveOpacity():1;if(!i||0!==s&&0!==t.pstyle("text-opacity").value){"main"===n&&(n=null);var l,c,u=Me(a,"labelX",n),d=Me(a,"labelY",n),h=this.getLabelText(t,n);if(null!=h&&""!==h&&!isNaN(u)&&!isNaN(d)){this.setupTextStyle(e,t,i);var f,p=n?n+"-":"",v=Me(a,"labelWidth",n),g=Me(a,"labelHeight",n),m=t.pstyle(p+"text-margin-x").pfValue,y=t.pstyle(p+"text-margin-y").pfValue,b=t.isEdge(),x=t.pstyle("text-halign").value,w=t.pstyle("text-valign").value;switch(b&&(x="center",w="center"),u+=m,d+=y,0!==(f=r?this.getTextAngle(t,n):0)&&(l=u,c=d,e.translate(l,c),e.rotate(f),u=0,d=0),w){case"top":break;case"center":d+=g/2;break;case"bottom":d+=g}var E=t.pstyle("text-background-opacity").value,_=t.pstyle("text-border-opacity").value,k=t.pstyle("text-border-width").pfValue,S=t.pstyle("text-background-padding").pfValue;if(E>0||k>0&&_>0){var P=u-S;switch(x){case"left":P-=v;break;case"center":P-=v/2}var j=d-g-S,C=v+2*S,T=g+2*S;if(E>0){var D=e.fillStyle,N=t.pstyle("text-background-color").value;e.fillStyle="rgba("+N[0]+","+N[1]+","+N[2]+","+E*s+")";var O=t.pstyle("text-background-shape").strValue;0===O.indexOf("round")?Ys(e,P,j,C,T,2):e.fillRect(P,j,C,T),e.fillStyle=D}if(k>0&&_>0){var M=e.strokeStyle,A=e.lineWidth,R=t.pstyle("text-border-color").value,I=t.pstyle("text-border-style").value;if(e.strokeStyle="rgba("+R[0]+","+R[1]+","+R[2]+","+_*s+")",e.lineWidth=k,e.setLineDash)switch(I){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash([4,2]);break;case"double":e.lineWidth=k/4,e.setLineDash([]);break;case"solid":e.setLineDash([])}if(e.strokeRect(P,j,C,T),"double"===I){var L=k/2;e.strokeRect(P+L,j+L,C-2*L,T-2*L)}e.setLineDash&&e.setLineDash([]),e.lineWidth=A,e.strokeStyle=M}}var B=2*t.pstyle("text-outline-width").pfValue;if(B>0&&(e.lineWidth=B),"wrap"===t.pstyle("text-wrap").value){var F=Me(a,"labelWrapCachedLines",n),z=Me(a,"labelLineHeight",n),V=v/2,G=this.getLabelJustification(t);switch("auto"===G||("left"===x?"left"===G?u+=-v:"center"===G&&(u+=-V):"center"===x?"left"===G?u+=-V:"right"===G&&(u+=V):"right"===x&&("center"===G?u+=V:"right"===G&&(u+=v))),w){case"top":case"center":case"bottom":d-=(F.length-1)*z}for(var H=0;H<F.length;H++)B>0&&e.strokeText(F[H],u,d),e.fillText(F[H],u,d),d+=z}else B>0&&e.strokeText(h,u,d),e.fillText(h,u,d);0!==f&&(e.rotate(-f),e.translate(-l,-c))}}};var Us={drawNode:function(e,t,n){var r,i,o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],a=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],s=!(arguments.length>5&&void 0!==arguments[5])||arguments[5],l=this,c=t._private,u=c.rscratch,d=t.position();if(O(d.x)&&O(d.y)&&(!s||t.visible())){var h,f,p=s?t.effectiveOpacity():1,v=l.usePaths(),g=!1,m=t.padding();r=t.width()+2*m,i=t.height()+2*m,n&&(f=n,e.translate(-f.x1,-f.y1));for(var y=t.pstyle("background-image"),b=y.value,x=new Array(b.length),w=new Array(b.length),E=0,_=0;_<b.length;_++){var k=b[_],S=x[_]=null!=k&&"none"!==k;if(S){var P=t.cy().style().getIndexedStyle(t,"background-image-crossorigin","value",_);E++,w[_]=l.getCachedImage(k,P,(function(){c.backgroundTimestamp=Date.now(),t.emitAndNotify("background")}))}}var j=t.pstyle("background-blacken").value,C=t.pstyle("border-width").pfValue,T=t.pstyle("background-opacity").value*p,D=t.pstyle("border-color").value,N=t.pstyle("border-style").value,M=t.pstyle("border-opacity").value*p;e.lineJoin="miter";var A=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:T;l.eleFillStyle(e,t,n)},R=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:M;l.colorStrokeStyle(e,D[0],D[1],D[2],t)},I=t.pstyle("shape").strValue,L=t.pstyle("shape-polygon-points").pfValue;if(v){e.translate(d.x,d.y);var B=l.nodePathCache=l.nodePathCache||[],F=fe("polygon"===I?I+","+L.join(","):I,""+i,""+r),z=B[F];null!=z?(h=z,g=!0,u.pathCache=h):(h=new Path2D,B[F]=u.pathCache=h)}var V=function(){if(!g){var n=d;v&&(n={x:0,y:0}),l.nodeShapes[l.getNodeShape(t)].draw(h||e,n.x,n.y,r,i)}v?e.fill(h):e.fill()},G=function(){for(var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:p,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=c.backgrounding,o=0,a=0;a<w.length;a++){var s=t.cy().style().getIndexedStyle(t,"background-image-containment","value",a);r&&"over"===s||!r&&"inside"===s?o++:x[a]&&w[a].complete&&!w[a].error&&(o++,l.drawInscribedImage(e,w[a],t,a,n))}c.backgrounding=!(o===E),i!==c.backgrounding&&t.updateStyle(!1)},H=function(){var n=arguments.length>0&&void 0!==arguments[0]&&arguments[0],o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:p;l.hasPie(t)&&(l.drawPie(e,t,o),n&&(v||l.nodeShapes[l.getNodeShape(t)].draw(e,d.x,d.y,r,i)))},W=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:p,n=(j>0?j:-j)*t,r=j>0?0:255;0!==j&&(l.colorFillStyle(e,r,r,r,n),v?e.fill(h):e.fill())},q=function(){if(C>0){if(e.lineWidth=C,e.lineCap="butt",e.setLineDash)switch(N){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash([4,2]);break;case"solid":case"double":e.setLineDash([])}if(v?e.stroke(h):e.stroke(),"double"===N){e.lineWidth=C/3;var t=e.globalCompositeOperation;e.globalCompositeOperation="destination-out",v?e.stroke(h):e.stroke(),e.globalCompositeOperation=t}e.setLineDash&&e.setLineDash([])}},Y=function(){a&&l.drawNodeOverlay(e,t,d,r,i)},U=function(){a&&l.drawNodeUnderlay(e,t,d,r,i)},X=function(){l.drawElementText(e,t,null,o)},$="yes"===t.pstyle("ghost").value;if($){var K=t.pstyle("ghost-offset-x").pfValue,Z=t.pstyle("ghost-offset-y").pfValue,Q=t.pstyle("ghost-opacity").value,J=Q*p;e.translate(K,Z),A(Q*T),V(),G(J,!0),R(Q*M),q(),H(0!==j||0!==C),G(J,!1),W(J),e.translate(-K,-Z)}v&&e.translate(-d.x,-d.y),U(),v&&e.translate(d.x,d.y),A(),V(),G(p,!0),R(),q(),H(0!==j||0!==C),G(p,!1),W(),v&&e.translate(-d.x,-d.y),X(),Y(),n&&e.translate(f.x1,f.y1)}}},Xs=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(t,n,r,i,o){if(n.visible()){var a=n.pstyle("".concat(e,"-padding")).pfValue,s=n.pstyle("".concat(e,"-opacity")).value,l=n.pstyle("".concat(e,"-color")).value,c=n.pstyle("".concat(e,"-shape")).value;if(s>0){if(r=r||n.position(),null==i||null==o){var u=n.padding();i=n.width()+2*u,o=n.height()+2*u}this.colorFillStyle(t,l[0],l[1],l[2],s),this.nodeShapes[c].draw(t,r.x,r.y,i+2*a,o+2*a),t.fill()}}}};Us.drawNodeOverlay=Xs("overlay"),Us.drawNodeUnderlay=Xs("underlay"),Us.hasPie=function(e){return(e=e[0])._private.hasPie},Us.drawPie=function(e,t,n,r){t=t[0],r=r||t.position();var i=t.cy().style(),o=t.pstyle("pie-size"),a=r.x,s=r.y,l=t.width(),c=t.height(),u=Math.min(l,c)/2,d=0;this.usePaths()&&(a=0,s=0),"%"===o.units?u*=o.pfValue:void 0!==o.pfValue&&(u=o.pfValue/2);for(var h=1;h<=i.pieBackgroundN;h++){var f=t.pstyle("pie-"+h+"-background-size").value,p=t.pstyle("pie-"+h+"-background-color").value,v=t.pstyle("pie-"+h+"-background-opacity").value*n,g=f/100;g+d>1&&(g=1-d);var m=1.5*Math.PI+2*Math.PI*d,y=m+2*Math.PI*g;0===f||d>=1||d+g>1||(e.beginPath(),e.moveTo(a,s),e.arc(a,s,u,m,y),e.closePath(),this.colorFillStyle(e,p[0],p[1],p[2],v),e.fill(),d+=g)}};var $s={};$s.getPixelRatio=function(){var e=this.data.contexts[0];if(null!=this.forcedPixelRatio)return this.forcedPixelRatio;var t=e.backingStorePixelRatio||e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return(window.devicePixelRatio||1)/t},$s.paintCache=function(e){for(var t,n=this.paintCaches=this.paintCaches||[],r=!0,i=0;i<n.length;i++)if((t=n[i]).context===e){r=!1;break}return r&&(t={context:e},n.push(t)),t},$s.createGradientStyleFor=function(e,t,n,r,i){var o,a=this.usePaths(),s=n.pstyle(t+"-gradient-stop-colors").value,l=n.pstyle(t+"-gradient-stop-positions").pfValue;if("radial-gradient"===r)if(n.isEdge()){var c=n.sourceEndpoint(),u=n.targetEndpoint(),d=n.midpoint(),h=at(c,d),f=at(u,d);o=e.createRadialGradient(d.x,d.y,0,d.x,d.y,Math.max(h,f))}else{var p=a?{x:0,y:0}:n.position(),v=n.paddedWidth(),g=n.paddedHeight();o=e.createRadialGradient(p.x,p.y,0,p.x,p.y,Math.max(v,g))}else if(n.isEdge()){var m=n.sourceEndpoint(),y=n.targetEndpoint();o=e.createLinearGradient(m.x,m.y,y.x,y.y)}else{var b=a?{x:0,y:0}:n.position(),x=n.paddedWidth()/2,w=n.paddedHeight()/2;switch(n.pstyle("background-gradient-direction").value){case"to-bottom":o=e.createLinearGradient(b.x,b.y-w,b.x,b.y+w);break;case"to-top":o=e.createLinearGradient(b.x,b.y+w,b.x,b.y-w);break;case"to-left":o=e.createLinearGradient(b.x+x,b.y,b.x-x,b.y);break;case"to-right":o=e.createLinearGradient(b.x-x,b.y,b.x+x,b.y);break;case"to-bottom-right":case"to-right-bottom":o=e.createLinearGradient(b.x-x,b.y-w,b.x+x,b.y+w);break;case"to-top-right":case"to-right-top":o=e.createLinearGradient(b.x-x,b.y+w,b.x+x,b.y-w);break;case"to-bottom-left":case"to-left-bottom":o=e.createLinearGradient(b.x+x,b.y-w,b.x-x,b.y+w);break;case"to-top-left":case"to-left-top":o=e.createLinearGradient(b.x+x,b.y+w,b.x-x,b.y-w)}}if(!o)return null;for(var E=l.length===s.length,_=s.length,k=0;k<_;k++)o.addColorStop(E?l[k]:k/(_-1),"rgba("+s[k][0]+","+s[k][1]+","+s[k][2]+","+i+")");return o},$s.gradientFillStyle=function(e,t,n,r){var i=this.createGradientStyleFor(e,"background",t,n,r);if(!i)return null;e.fillStyle=i},$s.colorFillStyle=function(e,t,n,r,i){e.fillStyle="rgba("+t+","+n+","+r+","+i+")"},$s.eleFillStyle=function(e,t,n){var r=t.pstyle("background-fill").value;if("linear-gradient"===r||"radial-gradient"===r)this.gradientFillStyle(e,t,r,n);else{var i=t.pstyle("background-color").value;this.colorFillStyle(e,i[0],i[1],i[2],n)}},$s.gradientStrokeStyle=function(e,t,n,r){var i=this.createGradientStyleFor(e,"line",t,n,r);if(!i)return null;e.strokeStyle=i},$s.colorStrokeStyle=function(e,t,n,r,i){e.strokeStyle="rgba("+t+","+n+","+r+","+i+")"},$s.eleStrokeStyle=function(e,t,n){var r=t.pstyle("line-fill").value;if("linear-gradient"===r||"radial-gradient"===r)this.gradientStrokeStyle(e,t,r,n);else{var i=t.pstyle("line-color").value;this.colorStrokeStyle(e,i[0],i[1],i[2],n)}},$s.matchCanvasSize=function(e){var t=this,n=t.data,r=t.findContainerClientCoords(),i=r[2],o=r[3],a=t.getPixelRatio(),s=t.motionBlurPxRatio;e!==t.data.bufferCanvases[t.MOTIONBLUR_BUFFER_NODE]&&e!==t.data.bufferCanvases[t.MOTIONBLUR_BUFFER_DRAG]||(a=s);var l,c=i*a,u=o*a;if(c!==t.canvasWidth||u!==t.canvasHeight){t.fontCaches=null;var d=n.canvasContainer;d.style.width=i+"px",d.style.height=o+"px";for(var h=0;h<t.CANVAS_LAYERS;h++)(l=n.canvases[h]).width=c,l.height=u,l.style.width=i+"px",l.style.height=o+"px";for(h=0;h<t.BUFFER_COUNT;h++)(l=n.bufferCanvases[h]).width=c,l.height=u,l.style.width=i+"px",l.style.height=o+"px";t.textureMult=1,a<=1&&(l=n.bufferCanvases[t.TEXTURE_BUFFER],t.textureMult=2,l.width=c*t.textureMult,l.height=u*t.textureMult),t.canvasWidth=c,t.canvasHeight=u}},$s.renderTo=function(e,t,n,r){this.render({forcedContext:e,forcedZoom:t,forcedPan:n,drawAllLayers:!0,forcedPxRatio:r})},$s.render=function(e){var t=(e=e||Te()).forcedContext,n=e.drawAllLayers,r=e.drawOnlyNodeLayer,i=e.forcedZoom,o=e.forcedPan,a=this,s=void 0===e.forcedPxRatio?this.getPixelRatio():e.forcedPxRatio,l=a.cy,c=a.data,u=c.canvasNeedsRedraw,d=a.textureOnViewport&&!t&&(a.pinching||a.hoverData.dragging||a.swipePanning||a.data.wheelZooming),h=void 0!==e.motionBlur?e.motionBlur:a.motionBlur,f=a.motionBlurPxRatio,p=l.hasCompoundNodes(),v=a.hoverData.draggingEles,g=!(!a.hoverData.selecting&&!a.touchData.selecting),m=h=h&&!t&&a.motionBlurEnabled&&!g;t||(a.prevPxRatio!==s&&(a.invalidateContainerClientCoordsCache(),a.matchCanvasSize(a.container),a.redrawHint("eles",!0),a.redrawHint("drag",!0)),a.prevPxRatio=s),!t&&a.motionBlurTimeout&&clearTimeout(a.motionBlurTimeout),h&&(null==a.mbFrames&&(a.mbFrames=0),a.mbFrames++,a.mbFrames<3&&(m=!1),a.mbFrames>a.minMbLowQualFrames&&(a.motionBlurPxRatio=a.mbPxRBlurry)),a.clearingMotionBlur&&(a.motionBlurPxRatio=1),a.textureDrawLastFrame&&!d&&(u[a.NODE]=!0,u[a.SELECT_BOX]=!0);var y=l.style(),b=l.zoom(),x=void 0!==i?i:b,w=l.pan(),E={x:w.x,y:w.y},_={zoom:b,pan:{x:w.x,y:w.y}},k=a.prevViewport;void 0===k||_.zoom!==k.zoom||_.pan.x!==k.pan.x||_.pan.y!==k.pan.y||v&&!p||(a.motionBlurPxRatio=1),o&&(E=o),x*=s,E.x*=s,E.y*=s;var S=a.getCachedZSortedEles();function P(e,t,n,r,i){var o=e.globalCompositeOperation;e.globalCompositeOperation="destination-out",a.colorFillStyle(e,255,255,255,a.motionBlurTransparency),e.fillRect(t,n,r,i),e.globalCompositeOperation=o}function j(e,r){var s,l,u,d;a.clearingMotionBlur||e!==c.bufferContexts[a.MOTIONBLUR_BUFFER_NODE]&&e!==c.bufferContexts[a.MOTIONBLUR_BUFFER_DRAG]?(s=E,l=x,u=a.canvasWidth,d=a.canvasHeight):(s={x:w.x*f,y:w.y*f},l=b*f,u=a.canvasWidth*f,d=a.canvasHeight*f),e.setTransform(1,0,0,1,0,0),"motionBlur"===r?P(e,0,0,u,d):t||void 0!==r&&!r||e.clearRect(0,0,u,d),n||(e.translate(s.x,s.y),e.scale(l,l)),o&&e.translate(o.x,o.y),i&&e.scale(i,i)}if(d||(a.textureDrawLastFrame=!1),d){if(a.textureDrawLastFrame=!0,!a.textureCache){a.textureCache={},a.textureCache.bb=l.mutableElements().boundingBox(),a.textureCache.texture=a.data.bufferCanvases[a.TEXTURE_BUFFER];var C=a.data.bufferContexts[a.TEXTURE_BUFFER];C.setTransform(1,0,0,1,0,0),C.clearRect(0,0,a.canvasWidth*a.textureMult,a.canvasHeight*a.textureMult),a.render({forcedContext:C,drawOnlyNodeLayer:!0,forcedPxRatio:s*a.textureMult}),(_=a.textureCache.viewport={zoom:l.zoom(),pan:l.pan(),width:a.canvasWidth,height:a.canvasHeight}).mpan={x:(0-_.pan.x)/_.zoom,y:(0-_.pan.y)/_.zoom}}u[a.DRAG]=!1,u[a.NODE]=!1;var T=c.contexts[a.NODE],D=a.textureCache.texture;_=a.textureCache.viewport;T.setTransform(1,0,0,1,0,0),h?P(T,0,0,_.width,_.height):T.clearRect(0,0,_.width,_.height);var N=y.core("outside-texture-bg-color").value,O=y.core("outside-texture-bg-opacity").value;a.colorFillStyle(T,N[0],N[1],N[2],O),T.fillRect(0,0,_.width,_.height);b=l.zoom();j(T,!1),T.clearRect(_.mpan.x,_.mpan.y,_.width/_.zoom/s,_.height/_.zoom/s),T.drawImage(D,_.mpan.x,_.mpan.y,_.width/_.zoom/s,_.height/_.zoom/s)}else a.textureOnViewport&&!t&&(a.textureCache=null);var M=l.extent(),A=a.pinching||a.hoverData.dragging||a.swipePanning||a.data.wheelZooming||a.hoverData.draggingEles||a.cy.animated(),R=a.hideEdgesOnViewport&&A,I=[];if(I[a.NODE]=!u[a.NODE]&&h&&!a.clearedForMotionBlur[a.NODE]||a.clearingMotionBlur,I[a.NODE]&&(a.clearedForMotionBlur[a.NODE]=!0),I[a.DRAG]=!u[a.DRAG]&&h&&!a.clearedForMotionBlur[a.DRAG]||a.clearingMotionBlur,I[a.DRAG]&&(a.clearedForMotionBlur[a.DRAG]=!0),u[a.NODE]||n||r||I[a.NODE]){var L=h&&!I[a.NODE]&&1!==f;j(T=t||(L?a.data.bufferContexts[a.MOTIONBLUR_BUFFER_NODE]:c.contexts[a.NODE]),h&&!L?"motionBlur":void 0),R?a.drawCachedNodes(T,S.nondrag,s,M):a.drawLayeredElements(T,S.nondrag,s,M),a.debug&&a.drawDebugPoints(T,S.nondrag),n||h||(u[a.NODE]=!1)}if(!r&&(u[a.DRAG]||n||I[a.DRAG])){L=h&&!I[a.DRAG]&&1!==f;j(T=t||(L?a.data.bufferContexts[a.MOTIONBLUR_BUFFER_DRAG]:c.contexts[a.DRAG]),h&&!L?"motionBlur":void 0),R?a.drawCachedNodes(T,S.drag,s,M):a.drawCachedElements(T,S.drag,s,M),a.debug&&a.drawDebugPoints(T,S.drag),n||h||(u[a.DRAG]=!1)}if(a.showFps||!r&&u[a.SELECT_BOX]&&!n){if(j(T=t||c.contexts[a.SELECT_BOX]),1==a.selection[4]&&(a.hoverData.selecting||a.touchData.selecting)){b=a.cy.zoom();var B=y.core("selection-box-border-width").value/b;T.lineWidth=B,T.fillStyle="rgba("+y.core("selection-box-color").value[0]+","+y.core("selection-box-color").value[1]+","+y.core("selection-box-color").value[2]+","+y.core("selection-box-opacity").value+")",T.fillRect(a.selection[0],a.selection[1],a.selection[2]-a.selection[0],a.selection[3]-a.selection[1]),B>0&&(T.strokeStyle="rgba("+y.core("selection-box-border-color").value[0]+","+y.core("selection-box-border-color").value[1]+","+y.core("selection-box-border-color").value[2]+","+y.core("selection-box-opacity").value+")",T.strokeRect(a.selection[0],a.selection[1],a.selection[2]-a.selection[0],a.selection[3]-a.selection[1]))}if(c.bgActivePosistion&&!a.hoverData.selecting){b=a.cy.zoom();var F=c.bgActivePosistion;T.fillStyle="rgba("+y.core("active-bg-color").value[0]+","+y.core("active-bg-color").value[1]+","+y.core("active-bg-color").value[2]+","+y.core("active-bg-opacity").value+")",T.beginPath(),T.arc(F.x,F.y,y.core("active-bg-size").pfValue/b,0,2*Math.PI),T.fill()}var z=a.lastRedrawTime;if(a.showFps&&z){z=Math.round(z);var V=Math.round(1e3/z);T.setTransform(1,0,0,1,0,0),T.fillStyle="rgba(255, 0, 0, 0.75)",T.strokeStyle="rgba(255, 0, 0, 0.75)",T.lineWidth=1,T.fillText("1 frame = "+z+" ms = "+V+" fps",0,20);T.strokeRect(0,30,250,20),T.fillRect(0,30,250*Math.min(V/60,1),20)}n||(u[a.SELECT_BOX]=!1)}if(h&&1!==f){var G=c.contexts[a.NODE],H=a.data.bufferCanvases[a.MOTIONBLUR_BUFFER_NODE],W=c.contexts[a.DRAG],q=a.data.bufferCanvases[a.MOTIONBLUR_BUFFER_DRAG],Y=function(e,t,n){e.setTransform(1,0,0,1,0,0),n||!m?e.clearRect(0,0,a.canvasWidth,a.canvasHeight):P(e,0,0,a.canvasWidth,a.canvasHeight);var r=f;e.drawImage(t,0,0,a.canvasWidth*r,a.canvasHeight*r,0,0,a.canvasWidth,a.canvasHeight)};(u[a.NODE]||I[a.NODE])&&(Y(G,H,I[a.NODE]),u[a.NODE]=!1),(u[a.DRAG]||I[a.DRAG])&&(Y(W,q,I[a.DRAG]),u[a.DRAG]=!1)}a.prevViewport=_,a.clearingMotionBlur&&(a.clearingMotionBlur=!1,a.motionBlurCleared=!0,a.motionBlur=!0),h&&(a.motionBlurTimeout=setTimeout((function(){a.motionBlurTimeout=null,a.clearedForMotionBlur[a.NODE]=!1,a.clearedForMotionBlur[a.DRAG]=!1,a.motionBlur=!1,a.clearingMotionBlur=!d,a.mbFrames=0,u[a.NODE]=!0,u[a.DRAG]=!0,a.redraw()}),100)),t||l.emit("render")};for(var Ks={drawPolygonPath:function(e,t,n,r,i,o){var a=r/2,s=i/2;e.beginPath&&e.beginPath(),e.moveTo(t+a*o[0],n+s*o[1]);for(var l=1;l<o.length/2;l++)e.lineTo(t+a*o[2*l],n+s*o[2*l+1]);e.closePath()},drawRoundPolygonPath:function(e,t,n,r,i,o){var a=r/2,s=i/2,l=Ft(r,i);e.beginPath&&e.beginPath();for(var c=0;c<o.length/4;c++){var u,d=void 0;d=0===c?o.length-2:4*c-2,u=4*c+2;var h=t+a*o[4*c],f=n+s*o[4*c+1],p=-o[d]*o[u]-o[d+1]*o[u+1],v=l/Math.tan(Math.acos(p)/2),g=h-v*o[d],m=f-v*o[d+1],y=h+v*o[u],b=f+v*o[u+1];0===c?e.moveTo(g,m):e.lineTo(g,m),e.arcTo(h,f,y,b,l)}e.closePath()},drawRoundRectanglePath:function(e,t,n,r,i){var o=r/2,a=i/2,s=Bt(r,i);e.beginPath&&e.beginPath(),e.moveTo(t,n-a),e.arcTo(t+o,n-a,t+o,n,s),e.arcTo(t+o,n+a,t,n+a,s),e.arcTo(t-o,n+a,t-o,n,s),e.arcTo(t-o,n-a,t,n-a,s),e.lineTo(t,n-a),e.closePath()},drawBottomRoundRectanglePath:function(e,t,n,r,i){var o=r/2,a=i/2,s=Bt(r,i);e.beginPath&&e.beginPath(),e.moveTo(t,n-a),e.lineTo(t+o,n-a),e.lineTo(t+o,n),e.arcTo(t+o,n+a,t,n+a,s),e.arcTo(t-o,n+a,t-o,n,s),e.lineTo(t-o,n-a),e.lineTo(t,n-a),e.closePath()},drawCutRectanglePath:function(e,t,n,r,i){var o=r/2,a=i/2;e.beginPath&&e.beginPath(),e.moveTo(t-o+8,n-a),e.lineTo(t+o-8,n-a),e.lineTo(t+o,n-a+8),e.lineTo(t+o,n+a-8),e.lineTo(t+o-8,n+a),e.lineTo(t-o+8,n+a),e.lineTo(t-o,n+a-8),e.lineTo(t-o,n-a+8),e.closePath()},drawBarrelPath:function(e,t,n,r,i){var o=r/2,a=i/2,s=t-o,l=t+o,c=n-a,u=n+a,d=zt(r,i),h=d.widthOffset,f=d.heightOffset,p=d.ctrlPtOffsetPct*h;e.beginPath&&e.beginPath(),e.moveTo(s,c+f),e.lineTo(s,u-f),e.quadraticCurveTo(s+p,u,s+h,u),e.lineTo(l-h,u),e.quadraticCurveTo(l-p,u,l,u-f),e.lineTo(l,c+f),e.quadraticCurveTo(l-p,c,l-h,c),e.lineTo(s+h,c),e.quadraticCurveTo(s+p,c,s,c+f),e.closePath()}},Zs=Math.sin(0),Qs=Math.cos(0),Js={},el={},tl=Math.PI/40,nl=0*Math.PI;nl<2*Math.PI;nl+=tl)Js[nl]=Math.sin(nl),el[nl]=Math.cos(nl);Ks.drawEllipsePath=function(e,t,n,r,i){if(e.beginPath&&e.beginPath(),e.ellipse)e.ellipse(t,n,r/2,i/2,0,0,2*Math.PI);else for(var o,a,s=r/2,l=i/2,c=0*Math.PI;c<2*Math.PI;c+=tl)o=t-s*Js[c]*Zs+s*el[c]*Qs,a=n+l*el[c]*Zs+l*Js[c]*Qs,0===c?e.moveTo(o,a):e.lineTo(o,a);e.closePath()};var rl={};function il(e){var t=e.indexOf(",");return e.substr(t+1)}function ol(e,t,n){var r=function(){return t.toDataURL(n,e.quality)};switch(e.output){case"blob-promise":return new Jn((function(r,i){try{t.toBlob((function(e){null!=e?r(e):i(new Error("`canvas.toBlob()` sent a null value in its callback"))}),n,e.quality)}catch(o){i(o)}}));case"blob":return function(e,t){for(var n=atob(e),r=new ArrayBuffer(n.length),i=new Uint8Array(r),o=0;o<n.length;o++)i[o]=n.charCodeAt(o);return new Blob([r],{type:t})}(il(r()),n);case"base64":return il(r());default:return r()}}rl.createBuffer=function(e,t){var n=document.createElement("canvas");return n.width=e,n.height=t,[n,n.getContext("2d")]},rl.bufferCanvasImage=function(e){var t=this.cy,n=t.mutableElements().boundingBox(),r=this.findContainerClientCoords(),i=e.full?Math.ceil(n.w):r[2],o=e.full?Math.ceil(n.h):r[3],a=O(e.maxWidth)||O(e.maxHeight),s=this.getPixelRatio(),l=1;if(void 0!==e.scale)i*=e.scale,o*=e.scale,l=e.scale;else if(a){var c=1/0,u=1/0;O(e.maxWidth)&&(c=l*e.maxWidth/i),O(e.maxHeight)&&(u=l*e.maxHeight/o),i*=l=Math.min(c,u),o*=l}a||(i*=s,o*=s,l*=s);var d=document.createElement("canvas");d.width=i,d.height=o,d.style.width=i+"px",d.style.height=o+"px";var h=d.getContext("2d");if(i>0&&o>0){h.clearRect(0,0,i,o),h.globalCompositeOperation="source-over";var f=this.getCachedZSortedEles();if(e.full)h.translate(-n.x1*l,-n.y1*l),h.scale(l,l),this.drawElements(h,f),h.scale(1/l,1/l),h.translate(n.x1*l,n.y1*l);else{var p=t.pan(),v={x:p.x*l,y:p.y*l};l*=t.zoom(),h.translate(v.x,v.y),h.scale(l,l),this.drawElements(h,f),h.scale(1/l,1/l),h.translate(-v.x,-v.y)}e.bg&&(h.globalCompositeOperation="destination-over",h.fillStyle=e.bg,h.rect(0,0,i,o),h.fill())}return d},rl.png=function(e){return ol(e,this.bufferCanvasImage(e),"image/png")},rl.jpg=function(e){return ol(e,this.bufferCanvasImage(e),"image/jpeg")};var al={nodeShapeImpl:function(e,t,n,r,i,o,a){switch(e){case"ellipse":return this.drawEllipsePath(t,n,r,i,o);case"polygon":return this.drawPolygonPath(t,n,r,i,o,a);case"round-polygon":return this.drawRoundPolygonPath(t,n,r,i,o,a);case"roundrectangle":case"round-rectangle":return this.drawRoundRectanglePath(t,n,r,i,o);case"cutrectangle":case"cut-rectangle":return this.drawCutRectanglePath(t,n,r,i,o);case"bottomroundrectangle":case"bottom-round-rectangle":return this.drawBottomRoundRectanglePath(t,n,r,i,o);case"barrel":return this.drawBarrelPath(t,n,r,i,o)}}},sl=cl,ll=cl.prototype;function cl(e){var t=this;t.data={canvases:new Array(ll.CANVAS_LAYERS),contexts:new Array(ll.CANVAS_LAYERS),canvasNeedsRedraw:new Array(ll.CANVAS_LAYERS),bufferCanvases:new Array(ll.BUFFER_COUNT),bufferContexts:new Array(ll.CANVAS_LAYERS)};var n="-webkit-tap-highlight-color",r="rgba(0,0,0,0)";t.data.canvasContainer=document.createElement("div");var i=t.data.canvasContainer.style;t.data.canvasContainer.style[n]=r,i.position="relative",i.zIndex="0",i.overflow="hidden";var o=e.cy.container();o.appendChild(t.data.canvasContainer),o.style[n]=r;var a={"-webkit-user-select":"none","-moz-user-select":"-moz-none","user-select":"none","-webkit-tap-highlight-color":"rgba(0,0,0,0)","outline-style":"none"};E&&E.userAgent.match(/msie|trident|edge/i)&&(a["-ms-touch-action"]="none",a["touch-action"]="none");for(var s=0;s<ll.CANVAS_LAYERS;s++){var l=t.data.canvases[s]=document.createElement("canvas");t.data.contexts[s]=l.getContext("2d"),Object.keys(a).forEach((function(e){l.style[e]=a[e]})),l.style.position="absolute",l.setAttribute("data-id","layer"+s),l.style.zIndex=String(ll.CANVAS_LAYERS-s),t.data.canvasContainer.appendChild(l),t.data.canvasNeedsRedraw[s]=!1}t.data.topCanvas=t.data.canvases[0],t.data.canvases[ll.NODE].setAttribute("data-id","layer"+ll.NODE+"-node"),t.data.canvases[ll.SELECT_BOX].setAttribute("data-id","layer"+ll.SELECT_BOX+"-selectbox"),t.data.canvases[ll.DRAG].setAttribute("data-id","layer"+ll.DRAG+"-drag");for(s=0;s<ll.BUFFER_COUNT;s++)t.data.bufferCanvases[s]=document.createElement("canvas"),t.data.bufferContexts[s]=t.data.bufferCanvases[s].getContext("2d"),t.data.bufferCanvases[s].style.position="absolute",t.data.bufferCanvases[s].setAttribute("data-id","buffer"+s),t.data.bufferCanvases[s].style.zIndex=String(-s-1),t.data.bufferCanvases[s].style.visibility="hidden";t.pathsEnabled=!0;var c=ht(),u=function(e){return{x:-e.w/2,y:-e.h/2}},d=function(e){return e.boundingBox(),e[0]._private.bodyBounds},h=function(e){return e.boundingBox(),e[0]._private.labelBounds.main||c},f=function(e){return e.boundingBox(),e[0]._private.labelBounds.source||c},p=function(e){return e.boundingBox(),e[0]._private.labelBounds.target||c},v=function(e,t){return t},g=function(e,t,n){var r=e?e+"-":"";return{x:t.x+n.pstyle(r+"text-margin-x").pfValue,y:t.y+n.pstyle(r+"text-margin-y").pfValue}},m=function(e,t,n){var r=e[0]._private.rscratch;return{x:r[t],y:r[n]}},y=t.data.eleTxrCache=new Es(t,{getKey:function(e){return e[0]._private.nodeKey},doesEleInvalidateKey:function(e){var t=e[0]._private;return!(t.oldBackgroundTimestamp===t.backgroundTimestamp)},drawElement:function(e,n,r,i,o){return t.drawElement(e,n,r,!1,!1,o)},getBoundingBox:d,getRotationPoint:function(e){return{x:((t=d(e)).x1+t.x2)/2,y:(t.y1+t.y2)/2};var t},getRotationOffset:function(e){return u(d(e))},allowEdgeTxrCaching:!1,allowParentTxrCaching:!1}),b=t.data.lblTxrCache=new Es(t,{getKey:function(e){return e[0]._private.labelStyleKey},drawElement:function(e,n,r,i,o){return t.drawElementText(e,n,r,i,"main",o)},getBoundingBox:h,getRotationPoint:function(e){return g("",m(e,"labelX","labelY"),e)},getRotationOffset:function(e){var t=h(e),n=u(h(e));if(e.isNode()){switch(e.pstyle("text-halign").value){case"left":n.x=-t.w;break;case"right":n.x=0}switch(e.pstyle("text-valign").value){case"top":n.y=-t.h;break;case"bottom":n.y=0}}return n},isVisible:v}),x=t.data.slbTxrCache=new Es(t,{getKey:function(e){return e[0]._private.sourceLabelStyleKey},drawElement:function(e,n,r,i,o){return t.drawElementText(e,n,r,i,"source",o)},getBoundingBox:f,getRotationPoint:function(e){return g("source",m(e,"sourceLabelX","sourceLabelY"),e)},getRotationOffset:function(e){return u(f(e))},isVisible:v}),w=t.data.tlbTxrCache=new Es(t,{getKey:function(e){return e[0]._private.targetLabelStyleKey},drawElement:function(e,n,r,i,o){return t.drawElementText(e,n,r,i,"target",o)},getBoundingBox:p,getRotationPoint:function(e){return g("target",m(e,"targetLabelX","targetLabelY"),e)},getRotationOffset:function(e){return u(p(e))},isVisible:v}),_=t.data.lyrTxrCache=new ks(t);t.onUpdateEleCalcs((function(e,t){y.invalidateElements(t),b.invalidateElements(t),x.invalidateElements(t),w.invalidateElements(t),_.invalidateElements(t);for(var n=0;n<t.length;n++){var r=t[n]._private;r.oldBackgroundTimestamp=r.backgroundTimestamp}}));var k=function(e){for(var t=0;t<e.length;t++)_.enqueueElementRefinement(e[t].ele)};y.onDequeue(k),b.onDequeue(k),x.onDequeue(k),w.onDequeue(k)}ll.CANVAS_LAYERS=3,ll.SELECT_BOX=0,ll.DRAG=1,ll.NODE=2,ll.BUFFER_COUNT=3,ll.TEXTURE_BUFFER=0,ll.MOTIONBLUR_BUFFER_NODE=1,ll.MOTIONBLUR_BUFFER_DRAG=2,ll.redrawHint=function(e,t){var n=this;switch(e){case"eles":n.data.canvasNeedsRedraw[ll.NODE]=t;break;case"drag":n.data.canvasNeedsRedraw[ll.DRAG]=t;break;case"select":n.data.canvasNeedsRedraw[ll.SELECT_BOX]=t}};var ul="undefined"!=typeof Path2D;ll.path2dEnabled=function(e){if(void 0===e)return this.pathsEnabled;this.pathsEnabled=!!e},ll.usePaths=function(){return ul&&this.pathsEnabled},ll.setImgSmoothing=function(e,t){null!=e.imageSmoothingEnabled?e.imageSmoothingEnabled=t:(e.webkitImageSmoothingEnabled=t,e.mozImageSmoothingEnabled=t,e.msImageSmoothingEnabled=t)},ll.getImgSmoothing=function(e){return null!=e.imageSmoothingEnabled?e.imageSmoothingEnabled:e.webkitImageSmoothingEnabled||e.mozImageSmoothingEnabled||e.msImageSmoothingEnabled},ll.makeOffscreenCanvas=function(e,t){var n;return"undefined"!==("undefined"==typeof OffscreenCanvas?"undefined":p(OffscreenCanvas))?n=new OffscreenCanvas(e,t):((n=document.createElement("canvas")).width=e,n.height=t),n},[Ts,Rs,Gs,Ws,qs,Us,$s,Ks,rl,al].forEach((function(e){X(ll,e)}));var dl=[{type:"layout",extensions:Wa},{type:"renderer",extensions:[{name:"null",impl:qa},{name:"base",impl:vs},{name:"canvas",impl:sl}]}],hl={},fl={};function pl(e,t,n){var r=n,i=function(n){Se("Can not register `"+t+"` for `"+e+"` since `"+n+"` already exists in the prototype and can not be overridden")};if("core"===e){if(ia.prototype[t])return i(t);ia.prototype[t]=n}else if("collection"===e){if(wo.prototype[t])return i(t);wo.prototype[t]=n}else if("layout"===e){for(var o=function(e){this.options=e,n.call(this,e),N(this._private)||(this._private={}),this._private.cy=e.cy,this._private.listeners=[],this.createEmitter()},a=o.prototype=Object.create(n.prototype),s=[],l=0;l<s.length;l++){var c=s[l];a[c]=a[c]||function(){return this}}a.start&&!a.run?a.run=function(){return this.start(),this}:!a.start&&a.run&&(a.start=function(){return this.run(),this});var u=n.prototype.stop;a.stop=function(){var e=this.options;if(e&&e.animate){var t=this.animations;if(t)for(var n=0;n<t.length;n++)t[n].stop()}return u?u.call(this):this.emit("layoutstop"),this},a.destroy||(a.destroy=function(){return this}),a.cy=function(){return this._private.cy};var d=function(e){return e._private.cy},h={addEventFields:function(e,t){t.layout=e,t.cy=d(e),t.target=e},bubble:function(){return!0},parent:function(e){return d(e)}};X(a,{createEmitter:function(){return this._private.emitter=new Bi(h,this),this},emitter:function(){return this._private.emitter},on:function(e,t){return this.emitter().on(e,t),this},one:function(e,t){return this.emitter().one(e,t),this},once:function(e,t){return this.emitter().one(e,t),this},removeListener:function(e,t){return this.emitter().removeListener(e,t),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},emit:function(e,t){return this.emitter().emit(e,t),this}}),or.eventAliasesOn(a),r=o}else if("renderer"===e&&"null"!==t&&"base"!==t){var f=vl("renderer","base"),p=f.prototype,v=n,g=n.prototype,m=function(){f.apply(this,arguments),v.apply(this,arguments)},y=m.prototype;for(var b in p){var x=p[b];if(null!=g[b])return i(b);y[b]=x}for(var w in g)y[w]=g[w];p.clientFunctions.forEach((function(e){y[e]=y[e]||function(){_e("Renderer does not implement `renderer."+e+"()` on its prototype")}})),r=m}else if("__proto__"===e||"constructor"===e||"prototype"===e)return _e(e+" is an illegal type to be registered, possibly lead to prototype pollutions");return Z({map:hl,keys:[e,t],value:r})}function vl(e,t){return Q({map:hl,keys:[e,t]})}function gl(e,t,n,r,i){return Z({map:fl,keys:[e,t,n,r],value:i})}function ml(e,t,n,r){return Q({map:fl,keys:[e,t,n,r]})}var yl=function(){return 2===arguments.length?vl.apply(null,arguments):3===arguments.length?pl.apply(null,arguments):4===arguments.length?ml.apply(null,arguments):5===arguments.length?gl.apply(null,arguments):void _e("Invalid extension access syntax")};ia.prototype.extension=yl,dl.forEach((function(e){e.extensions.forEach((function(t){pl(e.type,t.name,t.impl)}))}));var bl=function e(){if(!(this instanceof e))return new e;this.length=0},xl=bl.prototype;xl.instanceString=function(){return"stylesheet"},xl.selector=function(e){return this[this.length++]={selector:e,properties:[]},this},xl.css=function(e,t){var n=this.length-1;if(C(e))this[n].properties.push({name:e,value:t});else if(N(e))for(var r=e,i=Object.keys(r),o=0;o<i.length;o++){var a=i[o],s=r[a];if(null!=s){var l=Jo.properties[a]||Jo.properties[H(a)];if(null!=l){var c=l.name,u=s;this[n].properties.push({name:c,value:u})}}}return this},xl.style=xl.css,xl.generateStyle=function(e){var t=new Jo(e);return this.appendToStyle(t)},xl.appendToStyle=function(e){for(var t=0;t<this.length;t++){var n=this[t],r=n.selector,i=n.properties;e.selector(r);for(var o=0;o<i.length;o++){var a=i[o];e.css(a.name,a.value)}}return e};var wl=function(e){return void 0===e&&(e={}),N(e)?new ia(e):C(e)?yl.apply(yl,arguments):void 0};wl.use=function(e){var t=Array.prototype.slice.call(arguments,1);return t.unshift(wl),e.apply(null,t),this},wl.warnings=function(e){return ke(e)},wl.version="3.23.0",wl.stylesheet=wl.Stylesheet=bl,e.exports=wl},46506:(e,t,n)=>{e.exports={graphlib:n(71310),layout:n(42529),debug:n(5512),util:{time:n(8783).time,notime:n(8783).notime},version:n(57589)}},85247:(e,t,n)=>{"use strict";var r=n(43294),i=n(38757);e.exports={run:function(e){var t="greedy"===e.graph().acyclicer?i(e,function(e){return function(t){return e.edge(t).weight}}(e)):function(e){var t=[],n={},i={};function o(a){r.has(i,a)||(i[a]=!0,n[a]=!0,r.forEach(e.outEdges(a),(function(e){r.has(n,e.w)?t.push(e):o(e.w)})),delete n[a])}return r.forEach(e.nodes(),o),t}(e);r.forEach(t,(function(t){var n=e.edge(t);e.removeEdge(t),n.forwardName=t.name,n.reversed=!0,e.setEdge(t.w,t.v,n,r.uniqueId("rev"))}))},undo:function(e){r.forEach(e.edges(),(function(t){var n=e.edge(t);if(n.reversed){e.removeEdge(t);var r=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(t.w,t.v,n,r)}}))}}},49654:(e,t,n)=>{var r=n(43294),i=n(8783);function o(e,t,n,r,o,a){var s={width:0,height:0,rank:a,borderType:t},l=o[t][a-1],c=i.addDummyNode(e,"border",s,n);o[t][a]=c,e.setParent(c,r),l&&e.setEdge(l,c,{weight:1})}e.exports=function(e){r.forEach(e.children(),(function t(n){var i=e.children(n),a=e.node(n);if(i.length&&r.forEach(i,t),r.has(a,"minRank")){a.borderLeft=[],a.borderRight=[];for(var s=a.minRank,l=a.maxRank+1;s<l;++s)o(e,"borderLeft","_bl",n,a,s),o(e,"borderRight","_br",n,a,s)}}))}},25128:(e,t,n)=>{"use strict";var r=n(43294);function i(e){r.forEach(e.nodes(),(function(t){o(e.node(t))})),r.forEach(e.edges(),(function(t){o(e.edge(t))}))}function o(e){var t=e.width;e.width=e.height,e.height=t}function a(e){e.y=-e.y}function s(e){var t=e.x;e.x=e.y,e.y=t}e.exports={adjust:function(e){var t=e.graph().rankdir.toLowerCase();"lr"!==t&&"rl"!==t||i(e)},undo:function(e){var t=e.graph().rankdir.toLowerCase();"bt"!==t&&"rl"!==t||function(e){r.forEach(e.nodes(),(function(t){a(e.node(t))})),r.forEach(e.edges(),(function(t){var n=e.edge(t);r.forEach(n.points,a),r.has(n,"y")&&a(n)}))}(e);"lr"!==t&&"rl"!==t||(!function(e){r.forEach(e.nodes(),(function(t){s(e.node(t))})),r.forEach(e.edges(),(function(t){var n=e.edge(t);r.forEach(n.points,s),r.has(n,"x")&&s(n)}))}(e),i(e))}}},65199:e=>{function t(){var e={};e._next=e._prev=e,this._sentinel=e}function n(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function r(e,t){if("_next"!==e&&"_prev"!==e)return t}e.exports=t,t.prototype.dequeue=function(){var e=this._sentinel,t=e._prev;if(t!==e)return n(t),t},t.prototype.enqueue=function(e){var t=this._sentinel;e._prev&&e._next&&n(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t},t.prototype.toString=function(){for(var e=[],t=this._sentinel,n=t._prev;n!==t;)e.push(JSON.stringify(n,r)),n=n._prev;return"["+e.join(", ")+"]"}},5512:(e,t,n)=>{var r=n(43294),i=n(8783),o=n(71310).Graph;e.exports={debugOrdering:function(e){var t=i.buildLayerMatrix(e),n=new o({compound:!0,multigraph:!0}).setGraph({});return r.forEach(e.nodes(),(function(t){n.setNode(t,{label:t}),n.setParent(t,"layer"+e.node(t).rank)})),r.forEach(e.edges(),(function(e){n.setEdge(e.v,e.w,{},e.name)})),r.forEach(t,(function(e,t){var i="layer"+t;n.setNode(i,{rank:"same"}),r.reduce(e,(function(e,t){return n.setEdge(e,t,{style:"invis"}),t}))})),n}}},71310:(e,t,n)=>{var r;try{r=n(87377)}catch(i){}r||(r=window.graphlib),e.exports=r},38757:(e,t,n)=>{var r=n(43294),i=n(71310).Graph,o=n(65199);e.exports=function(e,t){if(e.nodeCount()<=1)return[];var n=function(e,t){var n=new i,a=0,s=0;r.forEach(e.nodes(),(function(e){n.setNode(e,{v:e,in:0,out:0})})),r.forEach(e.edges(),(function(e){var r=n.edge(e.v,e.w)||0,i=t(e),o=r+i;n.setEdge(e.v,e.w,o),s=Math.max(s,n.node(e.v).out+=i),a=Math.max(a,n.node(e.w).in+=i)}));var c=r.range(s+a+3).map((function(){return new o})),u=a+1;return r.forEach(n.nodes(),(function(e){l(c,u,n.node(e))})),{graph:n,buckets:c,zeroIdx:u}}(e,t||a),c=function(e,t,n){var r,i=[],o=t[t.length-1],a=t[0];for(;e.nodeCount();){for(;r=a.dequeue();)s(e,t,n,r);for(;r=o.dequeue();)s(e,t,n,r);if(e.nodeCount())for(var l=t.length-2;l>0;--l)if(r=t[l].dequeue()){i=i.concat(s(e,t,n,r,!0));break}}return i}(n.graph,n.buckets,n.zeroIdx);return r.flatten(r.map(c,(function(t){return e.outEdges(t.v,t.w)})),!0)};var a=r.constant(1);function s(e,t,n,i,o){var a=o?[]:void 0;return r.forEach(e.inEdges(i.v),(function(r){var i=e.edge(r),s=e.node(r.v);o&&a.push({v:r.v,w:r.w}),s.out-=i,l(t,n,s)})),r.forEach(e.outEdges(i.v),(function(r){var i=e.edge(r),o=r.w,a=e.node(o);a.in-=i,l(t,n,a)})),e.removeNode(i.v),a}function l(e,t,n){n.out?n.in?e[n.out-n.in+t].enqueue(n):e[e.length-1].enqueue(n):e[0].enqueue(n)}},42529:(e,t,n)=>{"use strict";var r=n(43294),i=n(85247),o=n(20450),a=n(64618),s=n(8783).normalizeRanks,l=n(77908),c=n(8783).removeEmptyRanks,u=n(96820),d=n(49654),h=n(25128),f=n(73641),p=n(65784),v=n(8783),g=n(71310).Graph;e.exports=function(e,t){var n=t&&t.debugTiming?v.time:v.notime;n("layout",(function(){var t=n(" buildLayoutGraph",(function(){return function(e){var t=new g({multigraph:!0,compound:!0}),n=P(e.graph());return t.setGraph(r.merge({},y,S(n,m),r.pick(n,b))),r.forEach(e.nodes(),(function(n){var i=P(e.node(n));t.setNode(n,r.defaults(S(i,x),w)),t.setParent(n,e.parent(n))})),r.forEach(e.edges(),(function(n){var i=P(e.edge(n));t.setEdge(n,r.merge({},_,S(i,E),r.pick(i,k)))})),t}(e)}));n(" runLayout",(function(){!function(e,t){t(" makeSpaceForEdgeLabels",(function(){!function(e){var t=e.graph();t.ranksep/=2,r.forEach(e.edges(),(function(n){var r=e.edge(n);r.minlen*=2,"c"!==r.labelpos.toLowerCase()&&("TB"===t.rankdir||"BT"===t.rankdir?r.width+=r.labeloffset:r.height+=r.labeloffset)}))}(e)})),t(" removeSelfEdges",(function(){!function(e){r.forEach(e.edges(),(function(t){if(t.v===t.w){var n=e.node(t.v);n.selfEdges||(n.selfEdges=[]),n.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}}))}(e)})),t(" acyclic",(function(){i.run(e)})),t(" nestingGraph.run",(function(){u.run(e)})),t(" rank",(function(){a(v.asNonCompoundGraph(e))})),t(" injectEdgeLabelProxies",(function(){!function(e){r.forEach(e.edges(),(function(t){var n=e.edge(t);if(n.width&&n.height){var r=e.node(t.v),i={rank:(e.node(t.w).rank-r.rank)/2+r.rank,e:t};v.addDummyNode(e,"edge-proxy",i,"_ep")}}))}(e)})),t(" removeEmptyRanks",(function(){c(e)})),t(" nestingGraph.cleanup",(function(){u.cleanup(e)})),t(" normalizeRanks",(function(){s(e)})),t(" assignRankMinMax",(function(){!function(e){var t=0;r.forEach(e.nodes(),(function(n){var i=e.node(n);i.borderTop&&(i.minRank=e.node(i.borderTop).rank,i.maxRank=e.node(i.borderBottom).rank,t=r.max(t,i.maxRank))})),e.graph().maxRank=t}(e)})),t(" removeEdgeLabelProxies",(function(){!function(e){r.forEach(e.nodes(),(function(t){var n=e.node(t);"edge-proxy"===n.dummy&&(e.edge(n.e).labelRank=n.rank,e.removeNode(t))}))}(e)})),t(" normalize.run",(function(){o.run(e)})),t(" parentDummyChains",(function(){l(e)})),t(" addBorderSegments",(function(){d(e)})),t(" order",(function(){f(e)})),t(" insertSelfEdges",(function(){!function(e){var t=v.buildLayerMatrix(e);r.forEach(t,(function(t){var n=0;r.forEach(t,(function(t,i){var o=e.node(t);o.order=i+n,r.forEach(o.selfEdges,(function(t){v.addDummyNode(e,"selfedge",{width:t.label.width,height:t.label.height,rank:o.rank,order:i+ ++n,e:t.e,label:t.label},"_se")})),delete o.selfEdges}))}))}(e)})),t(" adjustCoordinateSystem",(function(){h.adjust(e)})),t(" position",(function(){p(e)})),t(" positionSelfEdges",(function(){!function(e){r.forEach(e.nodes(),(function(t){var n=e.node(t);if("selfedge"===n.dummy){var r=e.node(n.e.v),i=r.x+r.width/2,o=r.y,a=n.x-i,s=r.height/2;e.setEdge(n.e,n.label),e.removeNode(t),n.label.points=[{x:i+2*a/3,y:o-s},{x:i+5*a/6,y:o-s},{x:i+a,y:o},{x:i+5*a/6,y:o+s},{x:i+2*a/3,y:o+s}],n.label.x=n.x,n.label.y=n.y}}))}(e)})),t(" removeBorderNodes",(function(){!function(e){r.forEach(e.nodes(),(function(t){if(e.children(t).length){var n=e.node(t),i=e.node(n.borderTop),o=e.node(n.borderBottom),a=e.node(r.last(n.borderLeft)),s=e.node(r.last(n.borderRight));n.width=Math.abs(s.x-a.x),n.height=Math.abs(o.y-i.y),n.x=a.x+n.width/2,n.y=i.y+n.height/2}})),r.forEach(e.nodes(),(function(t){"border"===e.node(t).dummy&&e.removeNode(t)}))}(e)})),t(" normalize.undo",(function(){o.undo(e)})),t(" fixupEdgeLabelCoords",(function(){!function(e){r.forEach(e.edges(),(function(t){var n=e.edge(t);if(r.has(n,"x"))switch("l"!==n.labelpos&&"r"!==n.labelpos||(n.width-=n.labeloffset),n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset}}))}(e)})),t(" undoCoordinateSystem",(function(){h.undo(e)})),t(" translateGraph",(function(){!function(e){var t=Number.POSITIVE_INFINITY,n=0,i=Number.POSITIVE_INFINITY,o=0,a=e.graph(),s=a.marginx||0,l=a.marginy||0;function c(e){var r=e.x,a=e.y,s=e.width,l=e.height;t=Math.min(t,r-s/2),n=Math.max(n,r+s/2),i=Math.min(i,a-l/2),o=Math.max(o,a+l/2)}r.forEach(e.nodes(),(function(t){c(e.node(t))})),r.forEach(e.edges(),(function(t){var n=e.edge(t);r.has(n,"x")&&c(n)})),t-=s,i-=l,r.forEach(e.nodes(),(function(n){var r=e.node(n);r.x-=t,r.y-=i})),r.forEach(e.edges(),(function(n){var o=e.edge(n);r.forEach(o.points,(function(e){e.x-=t,e.y-=i})),r.has(o,"x")&&(o.x-=t),r.has(o,"y")&&(o.y-=i)})),a.width=n-t+s,a.height=o-i+l}(e)})),t(" assignNodeIntersects",(function(){!function(e){r.forEach(e.edges(),(function(t){var n,r,i=e.edge(t),o=e.node(t.v),a=e.node(t.w);i.points?(n=i.points[0],r=i.points[i.points.length-1]):(i.points=[],n=a,r=o),i.points.unshift(v.intersectRect(o,n)),i.points.push(v.intersectRect(a,r))}))}(e)})),t(" reversePoints",(function(){!function(e){r.forEach(e.edges(),(function(t){var n=e.edge(t);n.reversed&&n.points.reverse()}))}(e)})),t(" acyclic.undo",(function(){i.undo(e)}))}(t,n)})),n(" updateInputGraph",(function(){!function(e,t){r.forEach(e.nodes(),(function(n){var r=e.node(n),i=t.node(n);r&&(r.x=i.x,r.y=i.y,t.children(n).length&&(r.width=i.width,r.height=i.height))})),r.forEach(e.edges(),(function(n){var i=e.edge(n),o=t.edge(n);i.points=o.points,r.has(o,"x")&&(i.x=o.x,i.y=o.y)})),e.graph().width=t.graph().width,e.graph().height=t.graph().height}(e,t)}))}))};var m=["nodesep","edgesep","ranksep","marginx","marginy"],y={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},b=["acyclicer","ranker","rankdir","align"],x=["width","height"],w={width:0,height:0},E=["minlen","weight","width","height","labeloffset"],_={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},k=["labelpos"];function S(e,t){return r.mapValues(r.pick(e,t),Number)}function P(e){var t={};return r.forEach(e,(function(e,n){t[n.toLowerCase()]=e})),t}},43294:(e,t,n)=>{var r;try{r={cloneDeep:n(9850),constant:n(86874),defaults:n(84573),each:n(79421),filter:n(90882),find:n(55281),flatten:n(35676),forEach:n(59756),forIn:n(20792),has:n(93352),isUndefined:n(84336),last:n(56974),map:n(16760),mapValues:n(34519),max:n(71644),merge:n(98537),min:n(65680),minBy:n(10937),now:n(61100),pick:n(13888),range:n(2689),reduce:n(58215),sortBy:n(829),uniqueId:n(74930),values:n(98346),zipObject:n(46150)}}catch(i){}r||(r=window._),e.exports=r},96820:(e,t,n)=>{var r=n(43294),i=n(8783);function o(e,t,n,a,s,l,c){var u=e.children(c);if(u.length){var d=i.addBorderNode(e,"_bt"),h=i.addBorderNode(e,"_bb"),f=e.node(c);e.setParent(d,c),f.borderTop=d,e.setParent(h,c),f.borderBottom=h,r.forEach(u,(function(r){o(e,t,n,a,s,l,r);var i=e.node(r),u=i.borderTop?i.borderTop:r,f=i.borderBottom?i.borderBottom:r,p=i.borderTop?a:2*a,v=u!==f?1:s-l[c]+1;e.setEdge(d,u,{weight:p,minlen:v,nestingEdge:!0}),e.setEdge(f,h,{weight:p,minlen:v,nestingEdge:!0})})),e.parent(c)||e.setEdge(t,d,{weight:0,minlen:s+l[c]})}else c!==t&&e.setEdge(t,c,{weight:0,minlen:n})}e.exports={run:function(e){var t=i.addDummyNode(e,"root",{},"_root"),n=function(e){var t={};function n(i,o){var a=e.children(i);a&&a.length&&r.forEach(a,(function(e){n(e,o+1)})),t[i]=o}return r.forEach(e.children(),(function(e){n(e,1)})),t}(e),a=r.max(r.values(n))-1,s=2*a+1;e.graph().nestingRoot=t,r.forEach(e.edges(),(function(t){e.edge(t).minlen*=s}));var l=function(e){return r.reduce(e.edges(),(function(t,n){return t+e.edge(n).weight}),0)}(e)+1;r.forEach(e.children(),(function(r){o(e,t,s,l,a,n,r)})),e.graph().nodeRankFactor=s},cleanup:function(e){var t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,r.forEach(e.edges(),(function(t){e.edge(t).nestingEdge&&e.removeEdge(t)}))}}},20450:(e,t,n)=>{"use strict";var r=n(43294),i=n(8783);e.exports={run:function(e){e.graph().dummyChains=[],r.forEach(e.edges(),(function(t){!function(e,t){var n,r,o,a=t.v,s=e.node(a).rank,l=t.w,c=e.node(l).rank,u=t.name,d=e.edge(t),h=d.labelRank;if(c===s+1)return;for(e.removeEdge(t),o=0,++s;s<c;++o,++s)d.points=[],r={width:0,height:0,edgeLabel:d,edgeObj:t,rank:s},n=i.addDummyNode(e,"edge",r,"_d"),s===h&&(r.width=d.width,r.height=d.height,r.dummy="edge-label",r.labelpos=d.labelpos),e.setEdge(a,n,{weight:d.weight},u),0===o&&e.graph().dummyChains.push(n),a=n;e.setEdge(a,l,{weight:d.weight},u)}(e,t)}))},undo:function(e){r.forEach(e.graph().dummyChains,(function(t){var n,r=e.node(t),i=r.edgeLabel;for(e.setEdge(r.edgeObj,i);r.dummy;)n=e.successors(t)[0],e.removeNode(t),i.points.push({x:r.x,y:r.y}),"edge-label"===r.dummy&&(i.x=r.x,i.y=r.y,i.width=r.width,i.height=r.height),t=n,r=e.node(t)}))}}},47897:(e,t,n)=>{var r=n(43294);e.exports=function(e,t,n){var i,o={};r.forEach(n,(function(n){for(var r,a,s=e.parent(n);s;){if((r=e.parent(s))?(a=o[r],o[r]=s):(a=i,i=s),a&&a!==s)return void t.setEdge(a,s);s=r}}))}},29533:(e,t,n)=>{var r=n(43294);e.exports=function(e,t){return r.map(t,(function(t){var n=e.inEdges(t);if(n.length){var i=r.reduce(n,(function(t,n){var r=e.edge(n),i=e.node(n.v);return{sum:t.sum+r.weight*i.order,weight:t.weight+r.weight}}),{sum:0,weight:0});return{v:t,barycenter:i.sum/i.weight,weight:i.weight}}return{v:t}}))}},64622:(e,t,n)=>{var r=n(43294),i=n(71310).Graph;e.exports=function(e,t,n){var o=function(e){var t;for(;e.hasNode(t=r.uniqueId("_root")););return t}(e),a=new i({compound:!0}).setGraph({root:o}).setDefaultNodeLabel((function(t){return e.node(t)}));return r.forEach(e.nodes(),(function(i){var s=e.node(i),l=e.parent(i);(s.rank===t||s.minRank<=t&&t<=s.maxRank)&&(a.setNode(i),a.setParent(i,l||o),r.forEach(e[n](i),(function(t){var n=t.v===i?t.w:t.v,o=a.edge(n,i),s=r.isUndefined(o)?0:o.weight;a.setEdge(n,i,{weight:e.edge(t).weight+s})})),r.has(s,"minRank")&&a.setNode(i,{borderLeft:s.borderLeft[t],borderRight:s.borderRight[t]}))})),a}},6254:(e,t,n)=>{"use strict";var r=n(43294);function i(e,t,n){for(var i=r.zipObject(n,r.map(n,(function(e,t){return t}))),o=r.flatten(r.map(t,(function(t){return r.sortBy(r.map(e.outEdges(t),(function(t){return{pos:i[t.w],weight:e.edge(t).weight}})),"pos")})),!0),a=1;a<n.length;)a<<=1;var s=2*a-1;a-=1;var l=r.map(new Array(s),(function(){return 0})),c=0;return r.forEach(o.forEach((function(e){var t=e.pos+a;l[t]+=e.weight;for(var n=0;t>0;)t%2&&(n+=l[t+1]),l[t=t-1>>1]+=e.weight;c+=e.weight*n}))),c}e.exports=function(e,t){for(var n=0,r=1;r<t.length;++r)n+=i(e,t[r-1],t[r]);return n}},73641:(e,t,n)=>{"use strict";var r=n(43294),i=n(65036),o=n(6254),a=n(83956),s=n(64622),l=n(47897),c=n(71310).Graph,u=n(8783);function d(e,t,n){return r.map(t,(function(t){return s(e,t,n)}))}function h(e,t){var n=new c;r.forEach(e,(function(e){var i=e.graph().root,o=a(e,i,n,t);r.forEach(o.vs,(function(t,n){e.node(t).order=n})),l(e,n,o.vs)}))}function f(e,t){r.forEach(t,(function(t){r.forEach(t,(function(t,n){e.node(t).order=n}))}))}e.exports=function(e){var t=u.maxRank(e),n=d(e,r.range(1,t+1),"inEdges"),a=d(e,r.range(t-1,-1,-1),"outEdges"),s=i(e);f(e,s);for(var l,c=Number.POSITIVE_INFINITY,p=0,v=0;v<4;++p,++v){h(p%2?n:a,p%4>=2),s=u.buildLayerMatrix(e);var g=o(e,s);g<c&&(v=0,l=r.cloneDeep(s),c=g)}f(e,l)}},65036:(e,t,n)=>{"use strict";var r=n(43294);e.exports=function(e){var t={},n=r.filter(e.nodes(),(function(t){return!e.children(t).length})),i=r.max(r.map(n,(function(t){return e.node(t).rank}))),o=r.map(r.range(i+1),(function(){return[]}));var a=r.sortBy(n,(function(t){return e.node(t).rank}));return r.forEach(a,(function n(i){if(r.has(t,i))return;t[i]=!0;var a=e.node(i);o[a.rank].push(i),r.forEach(e.successors(i),n)})),o}},39953:(e,t,n)=>{"use strict";var r=n(43294);e.exports=function(e,t){var n={};return r.forEach(e,(function(e,t){var i=n[e.v]={indegree:0,in:[],out:[],vs:[e.v],i:t};r.isUndefined(e.barycenter)||(i.barycenter=e.barycenter,i.weight=e.weight)})),r.forEach(t.edges(),(function(e){var t=n[e.v],i=n[e.w];r.isUndefined(t)||r.isUndefined(i)||(i.indegree++,t.out.push(n[e.w]))})),function(e){var t=[];function n(e){return function(t){t.merged||(r.isUndefined(t.barycenter)||r.isUndefined(e.barycenter)||t.barycenter>=e.barycenter)&&function(e,t){var n=0,r=0;e.weight&&(n+=e.barycenter*e.weight,r+=e.weight);t.weight&&(n+=t.barycenter*t.weight,r+=t.weight);e.vs=t.vs.concat(e.vs),e.barycenter=n/r,e.weight=r,e.i=Math.min(t.i,e.i),t.merged=!0}(e,t)}}function i(t){return function(n){n.in.push(t),0==--n.indegree&&e.push(n)}}for(;e.length;){var o=e.pop();t.push(o),r.forEach(o.in.reverse(),n(o)),r.forEach(o.out,i(o))}return r.map(r.filter(t,(function(e){return!e.merged})),(function(e){return r.pick(e,["vs","i","barycenter","weight"])}))}(r.filter(n,(function(e){return!e.indegree})))}},83956:(e,t,n)=>{var r=n(43294),i=n(29533),o=n(39953),a=n(11957);e.exports=function e(t,n,s,l){var c=t.children(n),u=t.node(n),d=u?u.borderLeft:void 0,h=u?u.borderRight:void 0,f={};d&&(c=r.filter(c,(function(e){return e!==d&&e!==h})));var p=i(t,c);r.forEach(p,(function(n){if(t.children(n.v).length){var i=e(t,n.v,s,l);f[n.v]=i,r.has(i,"barycenter")&&(o=n,a=i,r.isUndefined(o.barycenter)?(o.barycenter=a.barycenter,o.weight=a.weight):(o.barycenter=(o.barycenter*o.weight+a.barycenter*a.weight)/(o.weight+a.weight),o.weight+=a.weight))}var o,a}));var v=o(p,s);!function(e,t){r.forEach(e,(function(e){e.vs=r.flatten(e.vs.map((function(e){return t[e]?t[e].vs:e})),!0)}))}(v,f);var g=a(v,l);if(d&&(g.vs=r.flatten([d,g.vs,h],!0),t.predecessors(d).length)){var m=t.node(t.predecessors(d)[0]),y=t.node(t.predecessors(h)[0]);r.has(g,"barycenter")||(g.barycenter=0,g.weight=0),g.barycenter=(g.barycenter*g.weight+m.order+y.order)/(g.weight+2),g.weight+=2}return g}},11957:(e,t,n)=>{var r=n(43294),i=n(8783);function o(e,t,n){for(var i;t.length&&(i=r.last(t)).i<=n;)t.pop(),e.push(i.vs),n++;return n}e.exports=function(e,t){var n=i.partition(e,(function(e){return r.has(e,"barycenter")})),a=n.lhs,s=r.sortBy(n.rhs,(function(e){return-e.i})),l=[],c=0,u=0,d=0;a.sort((h=!!t,function(e,t){return e.barycenter<t.barycenter?-1:e.barycenter>t.barycenter?1:h?t.i-e.i:e.i-t.i})),d=o(l,s,d),r.forEach(a,(function(e){d+=e.vs.length,l.push(e.vs),c+=e.barycenter*e.weight,u+=e.weight,d=o(l,s,d)}));var h;var f={vs:r.flatten(l,!0)};u&&(f.barycenter=c/u,f.weight=u);return f}},77908:(e,t,n)=>{var r=n(43294);e.exports=function(e){var t=function(e){var t={},n=0;function i(o){var a=n;r.forEach(e.children(o),i),t[o]={low:a,lim:n++}}return r.forEach(e.children(),i),t}(e);r.forEach(e.graph().dummyChains,(function(n){for(var r=e.node(n),i=r.edgeObj,o=function(e,t,n,r){var i,o,a=[],s=[],l=Math.min(t[n].low,t[r].low),c=Math.max(t[n].lim,t[r].lim);i=n;do{i=e.parent(i),a.push(i)}while(i&&(t[i].low>l||c>t[i].lim));o=i,i=r;for(;(i=e.parent(i))!==o;)s.push(i);return{path:a.concat(s.reverse()),lca:o}}(e,t,i.v,i.w),a=o.path,s=o.lca,l=0,c=a[l],u=!0;n!==i.w;){if(r=e.node(n),u){for(;(c=a[l])!==s&&e.node(c).maxRank<r.rank;)l++;c===s&&(u=!1)}if(!u){for(;l<a.length-1&&e.node(c=a[l+1]).minRank<=r.rank;)l++;c=a[l]}e.setParent(n,c),n=e.successors(n)[0]}}))}},91753:(e,t,n)=>{"use strict";var r=n(43294),i=n(71310).Graph,o=n(8783);function a(e,t){var n={};return r.reduce(t,(function(t,i){var o=0,a=0,s=t.length,c=r.last(i);return r.forEach(i,(function(t,u){var d=function(e,t){if(e.node(t).dummy)return r.find(e.predecessors(t),(function(t){return e.node(t).dummy}))}(e,t),h=d?e.node(d).order:s;(d||t===c)&&(r.forEach(i.slice(a,u+1),(function(t){r.forEach(e.predecessors(t),(function(r){var i=e.node(r),a=i.order;!(a<o||h<a)||i.dummy&&e.node(t).dummy||l(n,r,t)}))})),a=u+1,o=h)})),i})),n}function s(e,t){var n={};function i(t,i,o,a,s){var c;r.forEach(r.range(i,o),(function(i){c=t[i],e.node(c).dummy&&r.forEach(e.predecessors(c),(function(t){var r=e.node(t);r.dummy&&(r.order<a||r.order>s)&&l(n,t,c)}))}))}return r.reduce(t,(function(t,n){var o,a=-1,s=0;return r.forEach(n,(function(r,l){if("border"===e.node(r).dummy){var c=e.predecessors(r);c.length&&(o=e.node(c[0]).order,i(n,s,l,a,o),s=l,a=o)}i(n,s,n.length,o,t.length)})),n})),n}function l(e,t,n){if(t>n){var r=t;t=n,n=r}var i=e[t];i||(e[t]=i={}),i[n]=!0}function c(e,t,n){if(t>n){var i=t;t=n,n=i}return r.has(e[t],n)}function u(e,t,n,i){var o={},a={},s={};return r.forEach(t,(function(e){r.forEach(e,(function(e,t){o[e]=e,a[e]=e,s[e]=t}))})),r.forEach(t,(function(e){var t=-1;r.forEach(e,(function(e){var l=i(e);if(l.length){l=r.sortBy(l,(function(e){return s[e]}));for(var u=(l.length-1)/2,d=Math.floor(u),h=Math.ceil(u);d<=h;++d){var f=l[d];a[e]===e&&t<s[f]&&!c(n,e,f)&&(a[f]=e,a[e]=o[e]=o[f],t=s[f])}}}))})),{root:o,align:a}}function d(e,t,n,o,a){var s={},l=function(e,t,n,o){var a=new i,s=e.graph(),l=function(e,t,n){return function(i,o,a){var s,l=i.node(o),c=i.node(a),u=0;if(u+=l.width/2,r.has(l,"labelpos"))switch(l.labelpos.toLowerCase()){case"l":s=-l.width/2;break;case"r":s=l.width/2}if(s&&(u+=n?s:-s),s=0,u+=(l.dummy?t:e)/2,u+=(c.dummy?t:e)/2,u+=c.width/2,r.has(c,"labelpos"))switch(c.labelpos.toLowerCase()){case"l":s=c.width/2;break;case"r":s=-c.width/2}return s&&(u+=n?s:-s),s=0,u}}(s.nodesep,s.edgesep,o);return r.forEach(t,(function(t){var i;r.forEach(t,(function(t){var r=n[t];if(a.setNode(r),i){var o=n[i],s=a.edge(o,r);a.setEdge(o,r,Math.max(l(e,t,i),s||0))}i=t}))})),a}(e,t,n,a),c=a?"borderLeft":"borderRight";function u(e,t){for(var n=l.nodes(),r=n.pop(),i={};r;)i[r]?e(r):(i[r]=!0,n.push(r),n=n.concat(t(r))),r=n.pop()}return u((function(e){s[e]=l.inEdges(e).reduce((function(e,t){return Math.max(e,s[t.v]+l.edge(t))}),0)}),l.predecessors.bind(l)),u((function(t){var n=l.outEdges(t).reduce((function(e,t){return Math.min(e,s[t.w]-l.edge(t))}),Number.POSITIVE_INFINITY),r=e.node(t);n!==Number.POSITIVE_INFINITY&&r.borderType!==c&&(s[t]=Math.max(s[t],n))}),l.successors.bind(l)),r.forEach(o,(function(e){s[e]=s[n[e]]})),s}function h(e,t){return r.minBy(r.values(t),(function(t){var n=Number.NEGATIVE_INFINITY,i=Number.POSITIVE_INFINITY;return r.forIn(t,(function(t,r){var o=function(e,t){return e.node(t).width}(e,r)/2;n=Math.max(t+o,n),i=Math.min(t-o,i)})),n-i}))}function f(e,t){var n=r.values(t),i=r.min(n),o=r.max(n);r.forEach(["u","d"],(function(n){r.forEach(["l","r"],(function(a){var s,l=n+a,c=e[l];if(c!==t){var u=r.values(c);(s="l"===a?i-r.min(u):o-r.max(u))&&(e[l]=r.mapValues(c,(function(e){return e+s})))}}))}))}function p(e,t){return r.mapValues(e.ul,(function(n,i){if(t)return e[t.toLowerCase()][i];var o=r.sortBy(r.map(e,i));return(o[1]+o[2])/2}))}e.exports={positionX:function(e){var t,n=o.buildLayerMatrix(e),i=r.merge(a(e,n),s(e,n)),l={};r.forEach(["u","d"],(function(o){t="u"===o?n:r.values(n).reverse(),r.forEach(["l","r"],(function(n){"r"===n&&(t=r.map(t,(function(e){return r.values(e).reverse()})));var a=("u"===o?e.predecessors:e.successors).bind(e),s=u(e,t,i,a),c=d(e,t,s.root,s.align,"r"===n);"r"===n&&(c=r.mapValues(c,(function(e){return-e}))),l[o+n]=c}))}));var c=h(e,l);return f(l,c),p(l,e.graph().align)},findType1Conflicts:a,findType2Conflicts:s,addConflict:l,hasConflict:c,verticalAlignment:u,horizontalCompaction:d,alignCoordinates:f,findSmallestWidthAlignment:h,balance:p}},65784:(e,t,n)=>{"use strict";var r=n(43294),i=n(8783),o=n(91753).positionX;e.exports=function(e){(function(e){var t=i.buildLayerMatrix(e),n=e.graph().ranksep,o=0;r.forEach(t,(function(t){var i=r.max(r.map(t,(function(t){return e.node(t).height})));r.forEach(t,(function(t){e.node(t).y=o+i/2})),o+=i+n}))})(e=i.asNonCompoundGraph(e)),r.forEach(o(e),(function(t,n){e.node(n).x=t}))}},49154:(e,t,n)=>{"use strict";var r=n(43294),i=n(71310).Graph,o=n(85986).slack;function a(e,t){return r.forEach(e.nodes(),(function n(i){r.forEach(t.nodeEdges(i),(function(r){var a=r.v,s=i===a?r.w:a;e.hasNode(s)||o(t,r)||(e.setNode(s,{}),e.setEdge(i,s,{}),n(s))}))})),e.nodeCount()}function s(e,t){return r.minBy(t.edges(),(function(n){if(e.hasNode(n.v)!==e.hasNode(n.w))return o(t,n)}))}function l(e,t,n){r.forEach(e.nodes(),(function(e){t.node(e).rank+=n}))}e.exports=function(e){var t,n,r=new i({directed:!1}),c=e.nodes()[0],u=e.nodeCount();r.setNode(c,{});for(;a(r,e)<u;)t=s(r,e),n=r.hasNode(t.v)?o(e,t):-o(e,t),l(r,e,n);return r}},64618:(e,t,n)=>{"use strict";var r=n(85986).longestPath,i=n(49154),o=n(57310);e.exports=function(e){switch(e.graph().ranker){case"network-simplex":default:s(e);break;case"tight-tree":!function(e){r(e),i(e)}(e);break;case"longest-path":a(e)}};var a=r;function s(e){o(e)}},57310:(e,t,n)=>{"use strict";var r=n(43294),i=n(49154),o=n(85986).slack,a=n(85986).longestPath,s=n(71310).alg.preorder,l=n(71310).alg.postorder,c=n(8783).simplify;function u(e){e=c(e),a(e);var t,n=i(e);for(f(n),d(n,e);t=v(n);)m(n,e,t,g(n,e,t))}function d(e,t){var n=l(e,e.nodes());n=n.slice(0,n.length-1),r.forEach(n,(function(n){!function(e,t,n){var r=e.node(n).parent;e.edge(n,r).cutvalue=h(e,t,n)}(e,t,n)}))}function h(e,t,n){var i=e.node(n).parent,o=!0,a=t.edge(n,i),s=0;return a||(o=!1,a=t.edge(i,n)),s=a.weight,r.forEach(t.nodeEdges(n),(function(r){var a,l,c=r.v===n,u=c?r.w:r.v;if(u!==i){var d=c===o,h=t.edge(r).weight;if(s+=d?h:-h,a=n,l=u,e.hasEdge(a,l)){var f=e.edge(n,u).cutvalue;s+=d?-f:f}}})),s}function f(e,t){arguments.length<2&&(t=e.nodes()[0]),p(e,{},1,t)}function p(e,t,n,i,o){var a=n,s=e.node(i);return t[i]=!0,r.forEach(e.neighbors(i),(function(o){r.has(t,o)||(n=p(e,t,n,o,i))})),s.low=a,s.lim=n++,o?s.parent=o:delete s.parent,n}function v(e){return r.find(e.edges(),(function(t){return e.edge(t).cutvalue<0}))}function g(e,t,n){var i=n.v,a=n.w;t.hasEdge(i,a)||(i=n.w,a=n.v);var s=e.node(i),l=e.node(a),c=s,u=!1;s.lim>l.lim&&(c=l,u=!0);var d=r.filter(t.edges(),(function(t){return u===y(e,e.node(t.v),c)&&u!==y(e,e.node(t.w),c)}));return r.minBy(d,(function(e){return o(t,e)}))}function m(e,t,n,i){var o=n.v,a=n.w;e.removeEdge(o,a),e.setEdge(i.v,i.w,{}),f(e),d(e,t),function(e,t){var n=r.find(e.nodes(),(function(e){return!t.node(e).parent})),i=s(e,n);i=i.slice(1),r.forEach(i,(function(n){var r=e.node(n).parent,i=t.edge(n,r),o=!1;i||(i=t.edge(r,n),o=!0),t.node(n).rank=t.node(r).rank+(o?i.minlen:-i.minlen)}))}(e,t)}function y(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}e.exports=u,u.initLowLimValues=f,u.initCutValues=d,u.calcCutValue=h,u.leaveEdge=v,u.enterEdge=g,u.exchangeEdges=m},85986:(e,t,n)=>{"use strict";var r=n(43294);e.exports={longestPath:function(e){var t={};r.forEach(e.sources(),(function n(i){var o=e.node(i);if(r.has(t,i))return o.rank;t[i]=!0;var a=r.min(r.map(e.outEdges(i),(function(t){return n(t.w)-e.edge(t).minlen})));return a!==Number.POSITIVE_INFINITY&&null!=a||(a=0),o.rank=a}))},slack:function(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}}},8783:(e,t,n)=>{"use strict";var r=n(43294),i=n(71310).Graph;function o(e,t,n,i){var o;do{o=r.uniqueId(i)}while(e.hasNode(o));return n.dummy=t,e.setNode(o,n),o}function a(e){return r.max(r.map(e.nodes(),(function(t){var n=e.node(t).rank;if(!r.isUndefined(n))return n})))}e.exports={addDummyNode:o,simplify:function(e){var t=(new i).setGraph(e.graph());return r.forEach(e.nodes(),(function(n){t.setNode(n,e.node(n))})),r.forEach(e.edges(),(function(n){var r=t.edge(n.v,n.w)||{weight:0,minlen:1},i=e.edge(n);t.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})})),t},asNonCompoundGraph:function(e){var t=new i({multigraph:e.isMultigraph()}).setGraph(e.graph());return r.forEach(e.nodes(),(function(n){e.children(n).length||t.setNode(n,e.node(n))})),r.forEach(e.edges(),(function(n){t.setEdge(n,e.edge(n))})),t},successorWeights:function(e){var t=r.map(e.nodes(),(function(t){var n={};return r.forEach(e.outEdges(t),(function(t){n[t.w]=(n[t.w]||0)+e.edge(t).weight})),n}));return r.zipObject(e.nodes(),t)},predecessorWeights:function(e){var t=r.map(e.nodes(),(function(t){var n={};return r.forEach(e.inEdges(t),(function(t){n[t.v]=(n[t.v]||0)+e.edge(t).weight})),n}));return r.zipObject(e.nodes(),t)},intersectRect:function(e,t){var n,r,i=e.x,o=e.y,a=t.x-i,s=t.y-o,l=e.width/2,c=e.height/2;if(!a&&!s)throw new Error("Not possible to find intersection inside of the rectangle");Math.abs(s)*l>Math.abs(a)*c?(s<0&&(c=-c),n=c*a/s,r=c):(a<0&&(l=-l),n=l,r=l*s/a);return{x:i+n,y:o+r}},buildLayerMatrix:function(e){var t=r.map(r.range(a(e)+1),(function(){return[]}));return r.forEach(e.nodes(),(function(n){var i=e.node(n),o=i.rank;r.isUndefined(o)||(t[o][i.order]=n)})),t},normalizeRanks:function(e){var t=r.min(r.map(e.nodes(),(function(t){return e.node(t).rank})));r.forEach(e.nodes(),(function(n){var i=e.node(n);r.has(i,"rank")&&(i.rank-=t)}))},removeEmptyRanks:function(e){var t=r.min(r.map(e.nodes(),(function(t){return e.node(t).rank}))),n=[];r.forEach(e.nodes(),(function(r){var i=e.node(r).rank-t;n[i]||(n[i]=[]),n[i].push(r)}));var i=0,o=e.graph().nodeRankFactor;r.forEach(n,(function(t,n){r.isUndefined(t)&&n%o!=0?--i:i&&r.forEach(t,(function(t){e.node(t).rank+=i}))}))},addBorderNode:function(e,t,n,r){var i={width:0,height:0};arguments.length>=4&&(i.rank=n,i.order=r);return o(e,"border",i,t)},maxRank:a,partition:function(e,t){var n={lhs:[],rhs:[]};return r.forEach(e,(function(e){t(e)?n.lhs.push(e):n.rhs.push(e)})),n},time:function(e,t){var n=r.now();try{return t()}finally{console.log(e+" time: "+(r.now()-n)+"ms")}},notime:function(e,t){return t()}}},57589:e=>{e.exports="0.8.5"},77847:e=>{e.exports=a,a.default=a,a.stable=u,a.stableStringify=u;var t="[...]",n="[Circular]",r=[],i=[];function o(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function a(e,t,n,a){var s;void 0===a&&(a=o()),l(e,"",0,[],void 0,0,a);try{s=0===i.length?JSON.stringify(e,t,n):JSON.stringify(e,h(t),n)}catch(u){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==r.length;){var c=r.pop();4===c.length?Object.defineProperty(c[0],c[1],c[3]):c[0][c[1]]=c[2]}}return s}function s(e,t,n,o){var a=Object.getOwnPropertyDescriptor(o,n);void 0!==a.get?a.configurable?(Object.defineProperty(o,n,{value:e}),r.push([o,n,t,a])):i.push([t,n,e]):(o[n]=e,r.push([o,n,t]))}function l(e,r,i,o,a,c,u){var d;if(c+=1,"object"==typeof e&&null!==e){for(d=0;d<o.length;d++)if(o[d]===e)return void s(n,e,r,a);if(void 0!==u.depthLimit&&c>u.depthLimit)return void s(t,e,r,a);if(void 0!==u.edgesLimit&&i+1>u.edgesLimit)return void s(t,e,r,a);if(o.push(e),Array.isArray(e))for(d=0;d<e.length;d++)l(e[d],d,d,o,e,c,u);else{var h=Object.keys(e);for(d=0;d<h.length;d++){var f=h[d];l(e[f],f,d,o,e,c,u)}}o.pop()}}function c(e,t){return e<t?-1:e>t?1:0}function u(e,t,n,a){void 0===a&&(a=o());var s,l=d(e,"",0,[],void 0,0,a)||e;try{s=0===i.length?JSON.stringify(l,t,n):JSON.stringify(l,h(t),n)}catch(u){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==r.length;){var c=r.pop();4===c.length?Object.defineProperty(c[0],c[1],c[3]):c[0][c[1]]=c[2]}}return s}function d(e,i,o,a,l,u,h){var f;if(u+=1,"object"==typeof e&&null!==e){for(f=0;f<a.length;f++)if(a[f]===e)return void s(n,e,i,l);try{if("function"==typeof e.toJSON)return}catch(m){return}if(void 0!==h.depthLimit&&u>h.depthLimit)return void s(t,e,i,l);if(void 0!==h.edgesLimit&&o+1>h.edgesLimit)return void s(t,e,i,l);if(a.push(e),Array.isArray(e))for(f=0;f<e.length;f++)d(e[f],f,f,a,e,u,h);else{var p={},v=Object.keys(e).sort(c);for(f=0;f<v.length;f++){var g=v[f];d(e[g],g,f,a,e,u,h),p[g]=e[g]}if(void 0===l)return p;r.push([l,i,e]),l[i]=p}a.pop()}}function h(e){return e=void 0!==e?e:function(e,t){return t},function(t,n){if(i.length>0)for(var r=0;r<i.length;r++){var o=i[r];if(o[1]===t&&o[0]===n){n=o[2],i.splice(r,1);break}}return e.call(this,t,n)}}},87377:(e,t,n)=>{var r=n(89);e.exports={Graph:r.Graph,json:n(80109),alg:n(577),version:r.version}},70229:(e,t,n)=>{var r=n(60274);e.exports=function(e){var t,n={},i=[];function o(i){r.has(n,i)||(n[i]=!0,t.push(i),r.each(e.successors(i),o),r.each(e.predecessors(i),o))}return r.each(e.nodes(),(function(e){t=[],o(e),t.length&&i.push(t)})),i}},70223:(e,t,n)=>{var r=n(60274);function i(e,t,n,o,a,s){r.has(o,t)||(o[t]=!0,n||s.push(t),r.each(a(t),(function(t){i(e,t,n,o,a,s)})),n&&s.push(t))}e.exports=function(e,t,n){r.isArray(t)||(t=[t]);var o=(e.isDirected()?e.successors:e.neighbors).bind(e),a=[],s={};return r.each(t,(function(t){if(!e.hasNode(t))throw new Error("Graph does not have node: "+t);i(e,t,"post"===n,s,o,a)})),a}},19487:(e,t,n)=>{var r=n(16493),i=n(60274);e.exports=function(e,t,n){return i.transform(e.nodes(),(function(i,o){i[o]=r(e,o,t,n)}),{})}},16493:(e,t,n)=>{var r=n(60274),i=n(70905);e.exports=function(e,t,n,r){return function(e,t,n,r){var o,a,s={},l=new i,c=function(e){var t=e.v!==o?e.v:e.w,r=s[t],i=n(e),c=a.distance+i;if(i<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+e+" Weight: "+i);c<r.distance&&(r.distance=c,r.predecessor=o,l.decrease(t,c))};e.nodes().forEach((function(e){var n=e===t?0:Number.POSITIVE_INFINITY;s[e]={distance:n},l.add(e,n)}));for(;l.size()>0&&(o=l.removeMin(),(a=s[o]).distance!==Number.POSITIVE_INFINITY);)r(o).forEach(c);return s}(e,String(t),n||o,r||function(t){return e.outEdges(t)})};var o=r.constant(1)},24395:(e,t,n)=>{var r=n(60274),i=n(99289);e.exports=function(e){return r.filter(i(e),(function(t){return t.length>1||1===t.length&&e.hasEdge(t[0],t[0])}))}},92077:(e,t,n)=>{var r=n(60274);e.exports=function(e,t,n){return function(e,t,n){var r={},i=e.nodes();return i.forEach((function(e){r[e]={},r[e][e]={distance:0},i.forEach((function(t){e!==t&&(r[e][t]={distance:Number.POSITIVE_INFINITY})})),n(e).forEach((function(n){var i=n.v===e?n.w:n.v,o=t(n);r[e][i]={distance:o,predecessor:e}}))})),i.forEach((function(e){var t=r[e];i.forEach((function(n){var o=r[n];i.forEach((function(n){var r=o[e],i=t[n],a=o[n],s=r.distance+i.distance;s<a.distance&&(a.distance=s,a.predecessor=i.predecessor)}))}))})),r}(e,t||i,n||function(t){return e.outEdges(t)})};var i=r.constant(1)},577:(e,t,n)=>{e.exports={components:n(70229),dijkstra:n(16493),dijkstraAll:n(19487),findCycles:n(24395),floydWarshall:n(92077),isAcyclic:n(67141),postorder:n(34825),preorder:n(78852),prim:n(78492),tarjan:n(99289),topsort:n(69176)}},67141:(e,t,n)=>{var r=n(69176);e.exports=function(e){try{r(e)}catch(t){if(t instanceof r.CycleException)return!1;throw t}return!0}},34825:(e,t,n)=>{var r=n(70223);e.exports=function(e,t){return r(e,t,"post")}},78852:(e,t,n)=>{var r=n(70223);e.exports=function(e,t){return r(e,t,"pre")}},78492:(e,t,n)=>{var r=n(60274),i=n(53099),o=n(70905);e.exports=function(e,t){var n,a=new i,s={},l=new o;function c(e){var r=e.v===n?e.w:e.v,i=l.priority(r);if(void 0!==i){var o=t(e);o<i&&(s[r]=n,l.decrease(r,o))}}if(0===e.nodeCount())return a;r.each(e.nodes(),(function(e){l.add(e,Number.POSITIVE_INFINITY),a.setNode(e)})),l.decrease(e.nodes()[0],0);var u=!1;for(;l.size()>0;){if(n=l.removeMin(),r.has(s,n))a.setEdge(n,s[n]);else{if(u)throw new Error("Input graph is not connected: "+e);u=!0}e.nodeEdges(n).forEach(c)}return a}},99289:(e,t,n)=>{var r=n(60274);e.exports=function(e){var t=0,n=[],i={},o=[];function a(s){var l=i[s]={onStack:!0,lowlink:t,index:t++};if(n.push(s),e.successors(s).forEach((function(e){r.has(i,e)?i[e].onStack&&(l.lowlink=Math.min(l.lowlink,i[e].index)):(a(e),l.lowlink=Math.min(l.lowlink,i[e].lowlink))})),l.lowlink===l.index){var c,u=[];do{c=n.pop(),i[c].onStack=!1,u.push(c)}while(s!==c);o.push(u)}}return e.nodes().forEach((function(e){r.has(i,e)||a(e)})),o}},69176:(e,t,n)=>{var r=n(60274);function i(e){var t={},n={},i=[];if(r.each(e.sinks(),(function a(s){if(r.has(n,s))throw new o;r.has(t,s)||(n[s]=!0,t[s]=!0,r.each(e.predecessors(s),a),delete n[s],i.push(s))})),r.size(t)!==e.nodeCount())throw new o;return i}function o(){}e.exports=i,i.CycleException=o,o.prototype=new Error},70905:(e,t,n)=>{var r=n(60274);function i(){this._arr=[],this._keyIndices={}}e.exports=i,i.prototype.size=function(){return this._arr.length},i.prototype.keys=function(){return this._arr.map((function(e){return e.key}))},i.prototype.has=function(e){return r.has(this._keyIndices,e)},i.prototype.priority=function(e){var t=this._keyIndices[e];if(void 0!==t)return this._arr[t].priority},i.prototype.min=function(){if(0===this.size())throw new Error("Queue underflow");return this._arr[0].key},i.prototype.add=function(e,t){var n=this._keyIndices;if(e=String(e),!r.has(n,e)){var i=this._arr,o=i.length;return n[e]=o,i.push({key:e,priority:t}),this._decrease(o),!0}return!1},i.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var e=this._arr.pop();return delete this._keyIndices[e.key],this._heapify(0),e.key},i.prototype.decrease=function(e,t){var n=this._keyIndices[e];if(t>this._arr[n].priority)throw new Error("New priority is greater than current priority. Key: "+e+" Old: "+this._arr[n].priority+" New: "+t);this._arr[n].priority=t,this._decrease(n)},i.prototype._heapify=function(e){var t=this._arr,n=2*e,r=n+1,i=e;n<t.length&&(i=t[n].priority<t[i].priority?n:i,r<t.length&&(i=t[r].priority<t[i].priority?r:i),i!==e&&(this._swap(e,i),this._heapify(i)))},i.prototype._decrease=function(e){for(var t,n=this._arr,r=n[e].priority;0!==e&&!(n[t=e>>1].priority<r);)this._swap(e,t),e=t},i.prototype._swap=function(e,t){var n=this._arr,r=this._keyIndices,i=n[e],o=n[t];n[e]=o,n[t]=i,r[o.key]=e,r[i.key]=t}},53099:(e,t,n)=>{"use strict";var r=n(60274);e.exports=o;var i="\0";function o(e){this._isDirected=!r.has(e,"directed")||e.directed,this._isMultigraph=!!r.has(e,"multigraph")&&e.multigraph,this._isCompound=!!r.has(e,"compound")&&e.compound,this._label=void 0,this._defaultNodeLabelFn=r.constant(void 0),this._defaultEdgeLabelFn=r.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children["\0"]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}function a(e,t){e[t]?e[t]++:e[t]=1}function s(e,t){--e[t]||delete e[t]}function l(e,t,n,i){var o=""+t,a=""+n;if(!e&&o>a){var s=o;o=a,a=s}return o+"\x01"+a+"\x01"+(r.isUndefined(i)?"\0":i)}function c(e,t,n,r){var i=""+t,o=""+n;if(!e&&i>o){var a=i;i=o,o=a}var s={v:i,w:o};return r&&(s.name=r),s}function u(e,t){return l(e,t.v,t.w,t.name)}o.prototype._nodeCount=0,o.prototype._edgeCount=0,o.prototype.isDirected=function(){return this._isDirected},o.prototype.isMultigraph=function(){return this._isMultigraph},o.prototype.isCompound=function(){return this._isCompound},o.prototype.setGraph=function(e){return this._label=e,this},o.prototype.graph=function(){return this._label},o.prototype.setDefaultNodeLabel=function(e){return r.isFunction(e)||(e=r.constant(e)),this._defaultNodeLabelFn=e,this},o.prototype.nodeCount=function(){return this._nodeCount},o.prototype.nodes=function(){return r.keys(this._nodes)},o.prototype.sources=function(){var e=this;return r.filter(this.nodes(),(function(t){return r.isEmpty(e._in[t])}))},o.prototype.sinks=function(){var e=this;return r.filter(this.nodes(),(function(t){return r.isEmpty(e._out[t])}))},o.prototype.setNodes=function(e,t){var n=arguments,i=this;return r.each(e,(function(e){n.length>1?i.setNode(e,t):i.setNode(e)})),this},o.prototype.setNode=function(e,t){return r.has(this._nodes,e)?(arguments.length>1&&(this._nodes[e]=t),this):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=i,this._children[e]={},this._children["\0"][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)},o.prototype.node=function(e){return this._nodes[e]},o.prototype.hasNode=function(e){return r.has(this._nodes,e)},o.prototype.removeNode=function(e){var t=this;if(r.has(this._nodes,e)){var n=function(e){t.removeEdge(t._edgeObjs[e])};delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],r.each(this.children(e),(function(e){t.setParent(e)})),delete this._children[e]),r.each(r.keys(this._in[e]),n),delete this._in[e],delete this._preds[e],r.each(r.keys(this._out[e]),n),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this},o.prototype.setParent=function(e,t){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(r.isUndefined(t))t=i;else{for(var n=t+="";!r.isUndefined(n);n=this.parent(n))if(n===e)throw new Error("Setting "+t+" as parent of "+e+" would create a cycle");this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this},o.prototype._removeFromParentsChildList=function(e){delete this._children[this._parent[e]][e]},o.prototype.parent=function(e){if(this._isCompound){var t=this._parent[e];if(t!==i)return t}},o.prototype.children=function(e){if(r.isUndefined(e)&&(e=i),this._isCompound){var t=this._children[e];if(t)return r.keys(t)}else{if(e===i)return this.nodes();if(this.hasNode(e))return[]}},o.prototype.predecessors=function(e){var t=this._preds[e];if(t)return r.keys(t)},o.prototype.successors=function(e){var t=this._sucs[e];if(t)return r.keys(t)},o.prototype.neighbors=function(e){var t=this.predecessors(e);if(t)return r.union(t,this.successors(e))},o.prototype.isLeaf=function(e){return 0===(this.isDirected()?this.successors(e):this.neighbors(e)).length},o.prototype.filterNodes=function(e){var t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph());var n=this;r.each(this._nodes,(function(n,r){e(r)&&t.setNode(r,n)})),r.each(this._edgeObjs,(function(e){t.hasNode(e.v)&&t.hasNode(e.w)&&t.setEdge(e,n.edge(e))}));var i={};function o(e){var r=n.parent(e);return void 0===r||t.hasNode(r)?(i[e]=r,r):r in i?i[r]:o(r)}return this._isCompound&&r.each(t.nodes(),(function(e){t.setParent(e,o(e))})),t},o.prototype.setDefaultEdgeLabel=function(e){return r.isFunction(e)||(e=r.constant(e)),this._defaultEdgeLabelFn=e,this},o.prototype.edgeCount=function(){return this._edgeCount},o.prototype.edges=function(){return r.values(this._edgeObjs)},o.prototype.setPath=function(e,t){var n=this,i=arguments;return r.reduce(e,(function(e,r){return i.length>1?n.setEdge(e,r,t):n.setEdge(e,r),r})),this},o.prototype.setEdge=function(){var e,t,n,i,o=!1,s=arguments[0];"object"==typeof s&&null!==s&&"v"in s?(e=s.v,t=s.w,n=s.name,2===arguments.length&&(i=arguments[1],o=!0)):(e=s,t=arguments[1],n=arguments[3],arguments.length>2&&(i=arguments[2],o=!0)),e=""+e,t=""+t,r.isUndefined(n)||(n=""+n);var u=l(this._isDirected,e,t,n);if(r.has(this._edgeLabels,u))return o&&(this._edgeLabels[u]=i),this;if(!r.isUndefined(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(t),this._edgeLabels[u]=o?i:this._defaultEdgeLabelFn(e,t,n);var d=c(this._isDirected,e,t,n);return e=d.v,t=d.w,Object.freeze(d),this._edgeObjs[u]=d,a(this._preds[t],e),a(this._sucs[e],t),this._in[t][u]=d,this._out[e][u]=d,this._edgeCount++,this},o.prototype.edge=function(e,t,n){var r=1===arguments.length?u(this._isDirected,arguments[0]):l(this._isDirected,e,t,n);return this._edgeLabels[r]},o.prototype.hasEdge=function(e,t,n){var i=1===arguments.length?u(this._isDirected,arguments[0]):l(this._isDirected,e,t,n);return r.has(this._edgeLabels,i)},o.prototype.removeEdge=function(e,t,n){var r=1===arguments.length?u(this._isDirected,arguments[0]):l(this._isDirected,e,t,n),i=this._edgeObjs[r];return i&&(e=i.v,t=i.w,delete this._edgeLabels[r],delete this._edgeObjs[r],s(this._preds[t],e),s(this._sucs[e],t),delete this._in[t][r],delete this._out[e][r],this._edgeCount--),this},o.prototype.inEdges=function(e,t){var n=this._in[e];if(n){var i=r.values(n);return t?r.filter(i,(function(e){return e.v===t})):i}},o.prototype.outEdges=function(e,t){var n=this._out[e];if(n){var i=r.values(n);return t?r.filter(i,(function(e){return e.w===t})):i}},o.prototype.nodeEdges=function(e,t){var n=this.inEdges(e,t);if(n)return n.concat(this.outEdges(e,t))}},89:(e,t,n)=>{e.exports={Graph:n(53099),version:n(90702)}},80109:(e,t,n)=>{var r=n(60274),i=n(53099);function o(e){return r.map(e.nodes(),(function(t){var n=e.node(t),i=e.parent(t),o={v:t};return r.isUndefined(n)||(o.value=n),r.isUndefined(i)||(o.parent=i),o}))}function a(e){return r.map(e.edges(),(function(t){var n=e.edge(t),i={v:t.v,w:t.w};return r.isUndefined(t.name)||(i.name=t.name),r.isUndefined(n)||(i.value=n),i}))}e.exports={write:function(e){var t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:o(e),edges:a(e)};r.isUndefined(e.graph())||(t.value=r.clone(e.graph()));return t},read:function(e){var t=new i(e.options).setGraph(e.value);return r.each(e.nodes,(function(e){t.setNode(e.v,e.value),e.parent&&t.setParent(e.v,e.parent)})),r.each(e.edges,(function(e){t.setEdge({v:e.v,w:e.w,name:e.name},e.value)})),t}}},60274:(e,t,n)=>{var r;try{r={clone:n(54004),constant:n(86874),each:n(79421),filter:n(90882),has:n(93352),isArray:n(86152),isEmpty:n(45455),isFunction:n(61049),isUndefined:n(84336),keys:n(90249),map:n(16760),reduce:n(58215),size:n(36402),transform:n(89466),union:n(26139),values:n(98346)}}catch(i){}r||(r=window._),e.exports=r},90702:e=>{e.exports="2.1.8"},71254:(e,t,n)=>{e.exports=n(38397)},38397:function(e,t){var n,r,i;(function(){var o,a,s,l,c,u,d,h,f,p,v,g,m,y,b;s=Math.floor,p=Math.min,a=function(e,t){return e<t?-1:e>t?1:0},f=function(e,t,n,r,i){var o;if(null==n&&(n=0),null==i&&(i=a),n<0)throw new Error("lo must be non-negative");for(null==r&&(r=e.length);n<r;)i(t,e[o=s((n+r)/2)])<0?r=o:n=o+1;return[].splice.apply(e,[n,n-n].concat(t)),t},u=function(e,t,n){return null==n&&(n=a),e.push(t),y(e,0,e.length-1,n)},c=function(e,t){var n,r;return null==t&&(t=a),n=e.pop(),e.length?(r=e[0],e[0]=n,b(e,0,t)):r=n,r},h=function(e,t,n){var r;return null==n&&(n=a),r=e[0],e[0]=t,b(e,0,n),r},d=function(e,t,n){var r;return null==n&&(n=a),e.length&&n(e[0],t)<0&&(t=(r=[e[0],t])[0],e[0]=r[1],b(e,0,n)),t},l=function(e,t){var n,r,i,o,l,c;for(null==t&&(t=a),o=(function(){c=[];for(var t=0,n=s(e.length/2);0<=n?t<n:t>n;0<=n?t++:t--)c.push(t);return c}).apply(this).reverse(),l=[],r=0,i=o.length;r<i;r++)n=o[r],l.push(b(e,n,t));return l},m=function(e,t,n){var r;if(null==n&&(n=a),-1!==(r=e.indexOf(t)))return y(e,0,r,n),b(e,r,n)},v=function(e,t,n){var r,i,o,s,c;if(null==n&&(n=a),!(i=e.slice(0,t)).length)return i;for(l(i,n),o=0,s=(c=e.slice(t)).length;o<s;o++)r=c[o],d(i,r,n);return i.sort(n).reverse()},g=function(e,t,n){var r,i,o,s,u,d,h,v,g;if(null==n&&(n=a),10*t<=e.length){if(!(o=e.slice(0,t).sort(n)).length)return o;for(i=o[o.length-1],s=0,d=(h=e.slice(t)).length;s<d;s++)n(r=h[s],i)<0&&(f(o,r,0,null,n),o.pop(),i=o[o.length-1]);return o}for(l(e,n),g=[],u=0,v=p(t,e.length);0<=v?u<v:u>v;0<=v?++u:--u)g.push(c(e,n));return g},y=function(e,t,n,r){var i,o,s;for(null==r&&(r=a),i=e[n];n>t&&r(i,o=e[s=n-1>>1])<0;)e[n]=o,n=s;return e[n]=i},b=function(e,t,n){var r,i,o,s,l;for(null==n&&(n=a),i=e.length,l=t,o=e[t],r=2*t+1;r<i;)(s=r+1)<i&&!(n(e[r],e[s])<0)&&(r=s),e[t]=e[r],r=2*(t=r)+1;return e[t]=o,y(e,l,t,n)},o=function(){function e(e){this.cmp=null!=e?e:a,this.nodes=[]}return e.push=u,e.pop=c,e.replace=h,e.pushpop=d,e.heapify=l,e.updateItem=m,e.nlargest=v,e.nsmallest=g,e.prototype.push=function(e){return u(this.nodes,e,this.cmp)},e.prototype.pop=function(){return c(this.nodes,this.cmp)},e.prototype.peek=function(){return this.nodes[0]},e.prototype.contains=function(e){return-1!==this.nodes.indexOf(e)},e.prototype.replace=function(e){return h(this.nodes,e,this.cmp)},e.prototype.pushpop=function(e){return d(this.nodes,e,this.cmp)},e.prototype.heapify=function(){return l(this.nodes,this.cmp)},e.prototype.updateItem=function(e){return m(this.nodes,e,this.cmp)},e.prototype.clear=function(){return this.nodes=[]},e.prototype.empty=function(){return 0===this.nodes.length},e.prototype.size=function(){return this.nodes.length},e.prototype.clone=function(){var t;return(t=new e).nodes=this.nodes.slice(0),t},e.prototype.toArray=function(){return this.nodes.slice(0)},e.prototype.insert=e.prototype.push,e.prototype.top=e.prototype.peek,e.prototype.front=e.prototype.peek,e.prototype.has=e.prototype.contains,e.prototype.copy=e.prototype.clone,e}(),r=[],void 0===(i="function"==typeof(n=function(){return o})?n.apply(t,r):n)||(e.exports=i)}).call(this)},50340:(e,t)=>{function n(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];throw Error("[Immer] minified error nr: "+e+(n.length?" "+n.map((function(e){return"'"+e+"'"})).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function r(e){return!!e&&!!e[X]}function i(e){var t;return!!e&&(function(e){if(!e||"object"!=typeof e)return!1;var t=Object.getPrototypeOf(e);if(null===t)return!0;var n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object||"function"==typeof n&&Function.toString.call(n)===K}(e)||Array.isArray(e)||!!e[U]||!!(null===(t=e.constructor)||void 0===t?void 0:t[U])||d(e)||h(e))}function o(e,t,n){void 0===n&&(n=!1),0===a(e)?(n?Object.keys:Z)(e).forEach((function(r){n&&"symbol"==typeof r||t(r,e[r],e)})):e.forEach((function(n,r){return t(r,n,e)}))}function a(e){var t=e[X];return t?t.t>3?t.t-4:t.t:Array.isArray(e)?1:d(e)?2:h(e)?3:0}function s(e,t){return 2===a(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function l(e,t){return 2===a(e)?e.get(t):e[t]}function c(e,t,n){var r=a(e);2===r?e.set(t,n):3===r?(e.delete(t),e.add(n)):e[t]=n}function u(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function d(e){return H&&e instanceof Map}function h(e){return W&&e instanceof Set}function f(e){return e.i||e.o}function p(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=Q(e);delete t[X];for(var n=Z(t),r=0;r<n.length;r++){var i=n[r],o=t[i];!1===o.writable&&(o.writable=!0,o.configurable=!0),(o.get||o.set)&&(t[i]={configurable:!0,writable:!0,enumerable:o.enumerable,value:e[i]})}return Object.create(Object.getPrototypeOf(e),t)}function v(e,t){return void 0===t&&(t=!1),m(e)||r(e)||!i(e)||(a(e)>1&&(e.set=e.add=e.clear=e.delete=g),Object.freeze(e),t&&o(e,(function(e,t){return v(t,!0)}),!0)),e}function g(){n(2)}function m(e){return null==e||"object"!=typeof e||Object.isFrozen(e)}function y(e){var t=J[e];return t||n(18,e),t}function b(e,t){J[e]||(J[e]=t)}function x(){return V}function w(e,t){t&&(y("Patches"),e.u=[],e.v=[],e.s=t)}function E(e){_(e),e.p.forEach(S),e.p=null}function _(e){e===V&&(V=e.l)}function k(e){return V={p:[],l:V,h:e,_:!0,m:0}}function S(e){var t=e[X];0===t.t||1===t.t?t.j():t.O=!0}function P(e,t){t.m=t.p.length;var r=t.p[0],o=void 0!==e&&e!==r;return t.h.S||y("ES5").P(t,e,o),o?(r[X].M&&(E(t),n(4)),i(e)&&(e=j(t,e),t.l||T(t,e)),t.u&&y("Patches").g(r[X].o,e,t.u,t.v)):e=j(t,r,[]),E(t),t.u&&t.s(t.u,t.v),e!==Y?e:void 0}function j(e,t,n){if(m(t))return t;var r=t[X];if(!r)return o(t,(function(i,o){return C(e,r,t,i,o,n)}),!0),t;if(r.A!==e)return t;if(!r.M)return T(e,r.o,!0),r.o;if(!r.R){r.R=!0,r.A.m--;var i=4===r.t||5===r.t?r.i=p(r.k):r.i;o(3===r.t?new Set(i):i,(function(t,o){return C(e,r,i,t,o,n)})),T(e,i,!1),n&&e.u&&y("Patches").F(r,n,e.u,e.v)}return r.i}function C(e,t,n,o,a,l){if(r(a)){var u=j(e,a,l&&t&&3!==t.t&&!s(t.D,o)?l.concat(o):void 0);if(c(n,o,u),!r(u))return;e._=!1}if(i(a)&&!m(a)){if(!e.h.K&&e.m<1)return;j(e,a),t&&t.A.l||T(e,a)}}function T(e,t,n){void 0===n&&(n=!1),e.h.K&&e._&&v(t,n)}function D(e,t){var n=e[X];return(n?f(n):e)[t]}function N(e,t){if(t in e)for(var n=Object.getPrototypeOf(e);n;){var r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Object.getPrototypeOf(n)}}function O(e){e.M||(e.M=!0,e.l&&O(e.l))}function M(e){e.i||(e.i=p(e.o))}function A(e,t,n){var r=d(t)?y("MapSet").$(t,n):h(t)?y("MapSet").C(t,n):e.S?function(e,t){var n=Array.isArray(e),r={t:n?1:0,A:t?t.A:x(),M:!1,R:!1,D:{},l:t,o:e,k:null,i:null,j:null,I:!1},i=r,o=ee;n&&(i=[r],o=te);var a=Proxy.revocable(i,o),s=a.revoke,l=a.proxy;return r.k=l,r.j=s,l}(t,n):y("ES5").J(t,n);return(n?n.A:x()).p.push(r),r}function R(e){return r(e)||n(22,e),function e(t){if(!i(t))return t;var n,r=t[X],s=a(t);if(r){if(!r.M&&(r.t<4||!y("ES5").N(r)))return r.o;r.R=!0,n=I(t,s),r.R=!1}else n=I(t,s);return o(n,(function(t,i){r&&l(r.o,t)===i||c(n,t,e(i))})),3===s?new Set(n):n}(e)}function I(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return p(e)}function L(){function e(e,t){var n=a[e];return n?n.enumerable=t:a[e]=n={configurable:!0,enumerable:t,get:function(){return ee.get(this[X],e)},set:function(t){ee.set(this[X],e,t)}},n}function t(e){for(var t=e.length-1;t>=0;t--){var r=e[t][X];if(!r.M)switch(r.t){case 5:i(r)&&O(r);break;case 4:n(r)&&O(r)}}}function n(e){for(var t=e.o,n=e.k,r=Z(n),i=r.length-1;i>=0;i--){var o=r[i];if(o!==X){var a=t[o];if(void 0===a&&!s(t,o))return!0;var l=n[o],c=l&&l[X];if(c?c.o!==a:!u(l,a))return!0}}var d=!!t[X];return r.length!==Z(t).length+(d?0:1)}function i(e){var t=e.k;if(t.length!==e.o.length)return!0;var n=Object.getOwnPropertyDescriptor(t,t.length-1);if(n&&!n.get)return!0;for(var r=0;r<t.length;r++)if(!t.hasOwnProperty(r))return!0;return!1}var a={};b("ES5",{J:function(t,n){var r=Array.isArray(t),i=function(t,n){if(t){for(var r=Array(n.length),i=0;i<n.length;i++)Object.defineProperty(r,""+i,e(i,!0));return r}var o=Q(n);delete o[X];for(var a=Z(o),s=0;s<a.length;s++){var l=a[s];o[l]=e(l,t||!!o[l].enumerable)}return Object.create(Object.getPrototypeOf(n),o)}(r,t),o={t:r?5:4,A:n?n.A:x(),M:!1,R:!1,D:{},l:n,o:t,k:i,i:null,O:!1,I:!1};return Object.defineProperty(i,X,{value:o,writable:!0}),i},P:function(e,n,a){a?r(n)&&n[X].A===e&&t(e.p):(e.u&&function e(t){if(t&&"object"==typeof t){var n=t[X];if(n){var r=n.o,a=n.k,l=n.D,c=n.t;if(4===c)o(a,(function(t){t!==X&&(void 0!==r[t]||s(r,t)?l[t]||e(a[t]):(l[t]=!0,O(n)))})),o(r,(function(e){void 0!==a[e]||s(a,e)||(l[e]=!1,O(n))}));else if(5===c){if(i(n)&&(O(n),l.length=!0),a.length<r.length)for(var u=a.length;u<r.length;u++)l[u]=!1;else for(var d=r.length;d<a.length;d++)l[d]=!0;for(var h=Math.min(a.length,r.length),f=0;f<h;f++)a.hasOwnProperty(f)||(l[f]=!0),void 0===l[f]&&e(a[f])}}}}(e.p[0]),t(e.p))},N:function(e){return 4===e.t?n(e):i(e)}})}function B(){function e(t){if(!i(t))return t;if(Array.isArray(t))return t.map(e);if(d(t))return new Map(Array.from(t.entries()).map((function(t){return[t[0],e(t[1])]})));if(h(t))return new Set(Array.from(t).map(e));var n=Object.create(Object.getPrototypeOf(t));for(var r in t)n[r]=e(t[r]);return s(t,U)&&(n[U]=t[U]),n}function t(t){return r(t)?e(t):t}var c="add";b("Patches",{W:function(t,r){return r.forEach((function(r){for(var i=r.path,o=r.op,s=t,u=0;u<i.length-1;u++){var d=a(s),h=""+i[u];0!==d&&1!==d||"__proto__"!==h&&"constructor"!==h||n(24),"function"==typeof s&&"prototype"===h&&n(24),"object"!=typeof(s=l(s,h))&&n(15,i.join("/"))}var f=a(s),p=e(r.value),v=i[i.length-1];switch(o){case"replace":switch(f){case 2:return s.set(v,p);case 3:n(16);default:return s[v]=p}case c:switch(f){case 1:return"-"===v?s.push(p):s.splice(v,0,p);case 2:return s.set(v,p);case 3:return s.add(p);default:return s[v]=p}case"remove":switch(f){case 1:return s.splice(v,1);case 2:return s.delete(v);case 3:return s.delete(r.value);default:return delete s[v]}default:n(17,o)}})),t},F:function(e,n,r,i){switch(e.t){case 0:case 4:case 2:return function(e,n,r,i){var a=e.o,u=e.i;o(e.D,(function(e,o){var d=l(a,e),h=l(u,e),f=o?s(a,e)?"replace":c:"remove";if(d!==h||"replace"!==f){var p=n.concat(e);r.push("remove"===f?{op:f,path:p}:{op:f,path:p,value:h}),i.push(f===c?{op:"remove",path:p}:"remove"===f?{op:c,path:p,value:t(d)}:{op:"replace",path:p,value:t(d)})}}))}(e,n,r,i);case 5:case 1:return function(e,n,r,i){var o=e.o,a=e.D,s=e.i;if(s.length<o.length){var l=[s,o];o=l[0],s=l[1];var u=[i,r];r=u[0],i=u[1]}for(var d=0;d<o.length;d++)if(a[d]&&s[d]!==o[d]){var h=n.concat([d]);r.push({op:"replace",path:h,value:t(s[d])}),i.push({op:"replace",path:h,value:t(o[d])})}for(var f=o.length;f<s.length;f++){var p=n.concat([f]);r.push({op:c,path:p,value:t(s[f])})}o.length<s.length&&i.push({op:"replace",path:n.concat(["length"]),value:o.length})}(e,n,r,i);case 3:return function(e,t,n,r){var i=e.o,o=e.i,a=0;i.forEach((function(e){if(!o.has(e)){var i=t.concat([a]);n.push({op:"remove",path:i,value:e}),r.unshift({op:c,path:i,value:e})}a++})),a=0,o.forEach((function(e){if(!i.has(e)){var o=t.concat([a]);n.push({op:c,path:o,value:e}),r.unshift({op:"remove",path:o,value:e})}a++}))}(e,n,r,i)}},g:function(e,t,n,r){n.push({op:"replace",path:[],value:t===Y?void 0:t}),r.push({op:"replace",path:[],value:e})}})}function F(){function e(e,t){function n(){this.constructor=e}s(e,t),e.prototype=(n.prototype=t.prototype,new n)}function t(e){e.i||(e.D=new Map,e.i=new Map(e.o))}function r(e){e.i||(e.i=new Set,e.o.forEach((function(t){if(i(t)){var n=A(e.A.h,t,e);e.p.set(t,n),e.i.add(n)}else e.i.add(t)})))}function a(e){e.O&&n(3,JSON.stringify(f(e)))}var s=function(e,t){return(s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},l=function(){function n(e,t){return this[X]={t:2,l:t,A:t?t.A:x(),M:!1,R:!1,i:void 0,D:void 0,o:e,k:this,I:!1,O:!1},this}e(n,Map);var r=n.prototype;return Object.defineProperty(r,"size",{get:function(){return f(this[X]).size}}),r.has=function(e){return f(this[X]).has(e)},r.set=function(e,n){var r=this[X];return a(r),f(r).has(e)&&f(r).get(e)===n||(t(r),O(r),r.D.set(e,!0),r.i.set(e,n),r.D.set(e,!0)),this},r.delete=function(e){if(!this.has(e))return!1;var n=this[X];return a(n),t(n),O(n),n.o.has(e)?n.D.set(e,!1):n.D.delete(e),n.i.delete(e),!0},r.clear=function(){var e=this[X];a(e),f(e).size&&(t(e),O(e),e.D=new Map,o(e.o,(function(t){e.D.set(t,!1)})),e.i.clear())},r.forEach=function(e,t){var n=this;f(this[X]).forEach((function(r,i){e.call(t,n.get(i),i,n)}))},r.get=function(e){var n=this[X];a(n);var r=f(n).get(e);if(n.R||!i(r))return r;if(r!==n.o.get(e))return r;var o=A(n.A.h,r,n);return t(n),n.i.set(e,o),o},r.keys=function(){return f(this[X]).keys()},r.values=function(){var e,t=this,n=this.keys();return(e={})[$]=function(){return t.values()},e.next=function(){var e=n.next();return e.done?e:{done:!1,value:t.get(e.value)}},e},r.entries=function(){var e,t=this,n=this.keys();return(e={})[$]=function(){return t.entries()},e.next=function(){var e=n.next();if(e.done)return e;var r=t.get(e.value);return{done:!1,value:[e.value,r]}},e},r[$]=function(){return this.entries()},n}(),c=function(){function t(e,t){return this[X]={t:3,l:t,A:t?t.A:x(),M:!1,R:!1,i:void 0,o:e,k:this,p:new Map,O:!1,I:!1},this}e(t,Set);var n=t.prototype;return Object.defineProperty(n,"size",{get:function(){return f(this[X]).size}}),n.has=function(e){var t=this[X];return a(t),t.i?!!t.i.has(e)||!(!t.p.has(e)||!t.i.has(t.p.get(e))):t.o.has(e)},n.add=function(e){var t=this[X];return a(t),this.has(e)||(r(t),O(t),t.i.add(e)),this},n.delete=function(e){if(!this.has(e))return!1;var t=this[X];return a(t),r(t),O(t),t.i.delete(e)||!!t.p.has(e)&&t.i.delete(t.p.get(e))},n.clear=function(){var e=this[X];a(e),f(e).size&&(r(e),O(e),e.i.clear())},n.values=function(){var e=this[X];return a(e),r(e),e.i.values()},n.entries=function(){var e=this[X];return a(e),r(e),e.i.entries()},n.keys=function(){return this.values()},n[$]=function(){return this.values()},n.forEach=function(e,t){for(var n=this.values(),r=n.next();!r.done;)e.call(t,r.value,r.value,this),r=n.next()},t}();b("MapSet",{$:function(e,t){return new l(e,t)},C:function(e,t){return new c(e,t)}})}var z;Object.defineProperty(t,"__esModule",{value:!0});var V,G="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),H="undefined"!=typeof Map,W="undefined"!=typeof Set,q="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,Y=G?Symbol.for("immer-nothing"):((z={})["immer-nothing"]=!0,z),U=G?Symbol.for("immer-draftable"):"__$immer_draftable",X=G?Symbol.for("immer-state"):"__$immer_state",$="undefined"!=typeof Symbol&&Symbol.iterator||"@@iterator",K=""+Object.prototype.constructor,Z="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,Q=Object.getOwnPropertyDescriptors||function(e){var t={};return Z(e).forEach((function(n){t[n]=Object.getOwnPropertyDescriptor(e,n)})),t},J={},ee={get:function(e,t){if(t===X)return e;var n=f(e);if(!s(n,t))return function(e,t,n){var r,i=N(t,n);return i?"value"in i?i.value:null===(r=i.get)||void 0===r?void 0:r.call(e.k):void 0}(e,n,t);var r=n[t];return e.R||!i(r)?r:r===D(e.o,t)?(M(e),e.i[t]=A(e.A.h,r,e)):r},has:function(e,t){return t in f(e)},ownKeys:function(e){return Reflect.ownKeys(f(e))},set:function(e,t,n){var r=N(f(e),t);if(null==r?void 0:r.set)return r.set.call(e.k,n),!0;if(!e.M){var i=D(f(e),t),o=null==i?void 0:i[X];if(o&&o.o===n)return e.i[t]=n,e.D[t]=!1,!0;if(u(n,i)&&(void 0!==n||s(e.o,t)))return!0;M(e),O(e)}return e.i[t]===n&&"number"!=typeof n&&(void 0!==n||t in e.i)||(e.i[t]=n,e.D[t]=!0,!0)},deleteProperty:function(e,t){return void 0!==D(e.o,t)||t in e.o?(e.D[t]=!1,M(e),O(e)):delete e.D[t],e.i&&delete e.i[t],!0},getOwnPropertyDescriptor:function(e,t){var n=f(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r?{writable:!0,configurable:1!==e.t||"length"!==t,enumerable:r.enumerable,value:n[t]}:r},defineProperty:function(){n(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.o)},setPrototypeOf:function(){n(12)}},te={};o(ee,(function(e,t){te[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),te.deleteProperty=function(e,t){return te.set.call(this,e,t,void 0)},te.set=function(e,t,n){return ee.set.call(this,e[0],t,n,e[0])};var ne=function(){function e(e){var t=this;this.S=q,this.K=!0,this.produce=function(e,r,o){if("function"==typeof e&&"function"!=typeof r){var a=r;r=e;var s=t;return function(e){var t=this;void 0===e&&(e=a);for(var n=arguments.length,i=Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];return s.produce(e,(function(e){var n;return(n=r).call.apply(n,[t,e].concat(i))}))}}var l;if("function"!=typeof r&&n(6),void 0!==o&&"function"!=typeof o&&n(7),i(e)){var c=k(t),u=A(t,e,void 0),d=!0;try{l=r(u),d=!1}finally{d?E(c):_(c)}return"undefined"!=typeof Promise&&l instanceof Promise?l.then((function(e){return w(c,o),P(e,c)}),(function(e){throw E(c),e})):(w(c,o),P(l,c))}if(!e||"object"!=typeof e){if(void 0===(l=r(e))&&(l=e),l===Y&&(l=void 0),t.K&&v(l,!0),o){var h=[],f=[];y("Patches").g(e,l,h,f),o(h,f)}return l}n(21,e)},this.produceWithPatches=function(e,n){if("function"==typeof e)return function(n){for(var r=arguments.length,i=Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];return t.produceWithPatches(n,(function(t){return e.apply(void 0,[t].concat(i))}))};var r,i,o=t.produce(e,n,(function(e,t){r=e,i=t}));return"undefined"!=typeof Promise&&o instanceof Promise?o.then((function(e){return[e,r,i]})):[o,r,i]},"boolean"==typeof(null==e?void 0:e.useProxies)&&this.setUseProxies(e.useProxies),"boolean"==typeof(null==e?void 0:e.autoFreeze)&&this.setAutoFreeze(e.autoFreeze)}var t=e.prototype;return t.createDraft=function(e){i(e)||n(8),r(e)&&(e=R(e));var t=k(this),o=A(this,e,void 0);return o[X].I=!0,_(t),o},t.finishDraft=function(e,t){var n=(e&&e[X]).A;return w(n,t),P(void 0,n)},t.setAutoFreeze=function(e){this.K=e},t.setUseProxies=function(e){e&&!q&&n(20),this.S=e},t.applyPatches=function(e,t){var n;for(n=t.length-1;n>=0;n--){var i=t[n];if(0===i.path.length&&"replace"===i.op){e=i.value;break}}n>-1&&(t=t.slice(n+1));var o=y("Patches").W;return r(e)?o(e,t):this.produce(e,(function(e){return o(e,t)}))},e}(),re=new ne,ie=re.produce,oe=re.produceWithPatches.bind(re),ae=re.setAutoFreeze.bind(re),se=re.setUseProxies.bind(re),le=re.applyPatches.bind(re),ce=re.createDraft.bind(re),ue=re.finishDraft.bind(re);t.Immer=ne,t.applyPatches=le,t.castDraft=function(e){return e},t.castImmutable=function(e){return e},t.createDraft=ce,t.current=R,t.default=ie,t.enableAllPlugins=function(){L(),F(),B()},t.enableES5=L,t.enableMapSet=F,t.enablePatches=B,t.finishDraft=ue,t.freeze=v,t.immerable=U,t.isDraft=r,t.isDraftable=i,t.nothing=Y,t.original=function(e){return r(e)||n(23,e),e[X].o},t.produce=ie,t.produceWithPatches=oe,t.setAutoFreeze=ae,t.setUseProxies=se},30412:(e,t,n)=>{"use strict";e.exports=n(50340)},39515:(e,t,n)=>{var r=n(38761)(n(37772),"DataView");e.exports=r},89612:(e,t,n)=>{var r=n(52118),i=n(96909),o=n(98138),a=n(4174),s=n(7942);function l(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}l.prototype.clear=r,l.prototype.delete=i,l.prototype.get=o,l.prototype.has=a,l.prototype.set=s,e.exports=l},80235:(e,t,n)=>{var r=n(3945),i=n(21846),o=n(88028),a=n(72344),s=n(94769);function l(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}l.prototype.clear=r,l.prototype.delete=i,l.prototype.get=o,l.prototype.has=a,l.prototype.set=s,e.exports=l},10326:(e,t,n)=>{var r=n(38761)(n(37772),"Map");e.exports=r},96738:(e,t,n)=>{var r=n(92411),i=n(36417),o=n(86928),a=n(79493),s=n(24150);function l(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}l.prototype.clear=r,l.prototype.delete=i,l.prototype.get=o,l.prototype.has=a,l.prototype.set=s,e.exports=l},52760:(e,t,n)=>{var r=n(38761)(n(37772),"Promise");e.exports=r},2143:(e,t,n)=>{var r=n(38761)(n(37772),"Set");e.exports=r},45386:(e,t,n)=>{var r=n(96738),i=n(52842),o=n(52482);function a(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new r;++t<n;)this.add(e[t])}a.prototype.add=a.prototype.push=i,a.prototype.has=o,e.exports=a},86571:(e,t,n)=>{var r=n(80235),i=n(15243),o=n(72858),a=n(4417),s=n(8605),l=n(71418);function c(e){var t=this.__data__=new r(e);this.size=t.size}c.prototype.clear=i,c.prototype.delete=o,c.prototype.get=a,c.prototype.has=s,c.prototype.set=l,e.exports=c},50857:(e,t,n)=>{var r=n(37772).Symbol;e.exports=r},79162:(e,t,n)=>{var r=n(37772).Uint8Array;e.exports=r},93215:(e,t,n)=>{var r=n(38761)(n(37772),"WeakMap");e.exports=r},49432:e=>{e.exports=function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}},72517:e=>{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e}},67552:e=>{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,i=0,o=[];++n<r;){var a=e[n];t(a,n,e)&&(o[i++]=a)}return o}},38333:(e,t,n)=>{var r=n(77832);e.exports=function(e,t){return!!(null==e?0:e.length)&&r(e,t,0)>-1}},34893:e=>{e.exports=function(e,t,n){for(var r=-1,i=null==e?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}},1634:(e,t,n)=>{var r=n(36473),i=n(79631),o=n(86152),a=n(73226),s=n(39045),l=n(77598),c=Object.prototype.hasOwnProperty;e.exports=function(e,t){var n=o(e),u=!n&&i(e),d=!n&&!u&&a(e),h=!n&&!u&&!d&&l(e),f=n||u||d||h,p=f?r(e.length,String):[],v=p.length;for(var g in e)!t&&!c.call(e,g)||f&&("length"==g||d&&("offset"==g||"parent"==g)||h&&("buffer"==g||"byteLength"==g||"byteOffset"==g)||s(g,v))||p.push(g);return p}},50343:e=>{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}},65067:e=>{e.exports=function(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}},81207:e=>{e.exports=function(e,t,n,r){var i=-1,o=null==e?0:e.length;for(r&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}},87064:e=>{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}},8589:(e,t,n)=>{var r=n(20256)("length");e.exports=r},28582:(e,t,n)=>{var r=n(13940),i=n(41225);e.exports=function(e,t,n){(void 0!==n&&!i(e[t],n)||void 0===n&&!(t in e))&&r(e,t,n)}},60091:(e,t,n)=>{var r=n(13940),i=n(41225),o=Object.prototype.hasOwnProperty;e.exports=function(e,t,n){var a=e[t];o.call(e,t)&&i(a,n)&&(void 0!==n||t in e)||r(e,t,n)}},22218:(e,t,n)=>{var r=n(41225);e.exports=function(e,t){for(var n=e.length;n--;)if(r(e[n][0],t))return n;return-1}},67993:(e,t,n)=>{var r=n(752),i=n(90249);e.exports=function(e,t){return e&&r(t,i(t),e)}},55906:(e,t,n)=>{var r=n(752),i=n(18582);e.exports=function(e,t){return e&&r(t,i(t),e)}},13940:(e,t,n)=>{var r=n(83043);e.exports=function(e,t,n){"__proto__"==t&&r?r(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}},18874:(e,t,n)=>{var r=n(86571),i=n(72517),o=n(60091),a=n(67993),s=n(55906),l=n(92175),c=n(51522),u=n(7680),d=n(19987),h=n(13483),f=n(76939),p=n(70940),v=n(99917),g=n(8222),m=n(78725),y=n(86152),b=n(73226),x=n(4714),w=n(29259),E=n(43679),_=n(90249),k=n(18582),S="[object Arguments]",P="[object Function]",j="[object Object]",C={};C[S]=C["[object Array]"]=C["[object ArrayBuffer]"]=C["[object DataView]"]=C["[object Boolean]"]=C["[object Date]"]=C["[object Float32Array]"]=C["[object Float64Array]"]=C["[object Int8Array]"]=C["[object Int16Array]"]=C["[object Int32Array]"]=C["[object Map]"]=C["[object Number]"]=C[j]=C["[object RegExp]"]=C["[object Set]"]=C["[object String]"]=C["[object Symbol]"]=C["[object Uint8Array]"]=C["[object Uint8ClampedArray]"]=C["[object Uint16Array]"]=C["[object Uint32Array]"]=!0,C["[object Error]"]=C[P]=C["[object WeakMap]"]=!1,e.exports=function e(t,n,T,D,N,O){var M,A=1&n,R=2&n,I=4&n;if(T&&(M=N?T(t,D,N,O):T(t)),void 0!==M)return M;if(!w(t))return t;var L=y(t);if(L){if(M=v(t),!A)return c(t,M)}else{var B=p(t),F=B==P||"[object GeneratorFunction]"==B;if(b(t))return l(t,A);if(B==j||B==S||F&&!N){if(M=R||F?{}:m(t),!A)return R?d(t,s(M,t)):u(t,a(M,t))}else{if(!C[B])return N?t:{};M=g(t,B,A)}}O||(O=new r);var z=O.get(t);if(z)return z;O.set(t,M),E(t)?t.forEach((function(r){M.add(e(r,n,T,r,t,O))})):x(t)&&t.forEach((function(r,i){M.set(i,e(r,n,T,i,t,O))}));var V=L?void 0:(I?R?f:h:R?k:_)(t);return i(V||t,(function(r,i){V&&(r=t[i=r]),o(M,i,e(r,n,T,i,t,O))})),M}},39413:(e,t,n)=>{var r=n(29259),i=Object.create,o=function(){function e(){}return function(t){if(!r(t))return{};if(i)return i(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();e.exports=o},24303:(e,t,n)=>{var r=n(26548),i=n(92019)(r);e.exports=i},2229:(e,t,n)=>{var r=n(4795);e.exports=function(e,t,n){for(var i=-1,o=e.length;++i<o;){var a=e[i],s=t(a);if(null!=s&&(void 0===l?s==s&&!r(s):n(s,l)))var l=s,c=a}return c}},98043:(e,t,n)=>{var r=n(24303);e.exports=function(e,t){var n=[];return r(e,(function(e,r,i){t(e,r,i)&&n.push(e)})),n}},21359:e=>{e.exports=function(e,t,n,r){for(var i=e.length,o=n+(r?1:-1);r?o--:++o<i;)if(t(e[o],o,e))return o;return-1}},62034:(e,t,n)=>{var r=n(65067),i=n(95882);e.exports=function e(t,n,o,a,s){var l=-1,c=t.length;for(o||(o=i),s||(s=[]);++l<c;){var u=t[l];n>0&&o(u)?n>1?e(u,n-1,o,a,s):r(s,u):a||(s[s.length]=u)}return s}},15308:(e,t,n)=>{var r=n(55463)();e.exports=r},26548:(e,t,n)=>{var r=n(15308),i=n(90249);e.exports=function(e,t){return e&&r(e,t,i)}},13324:(e,t,n)=>{var r=n(17297),i=n(33812);e.exports=function(e,t){for(var n=0,o=(t=r(t,e)).length;null!=e&&n<o;)e=e[i(t[n++])];return n&&n==o?e:void 0}},1897:(e,t,n)=>{var r=n(65067),i=n(86152);e.exports=function(e,t,n){var o=t(e);return i(e)?o:r(o,n(e))}},53366:(e,t,n)=>{var r=n(50857),i=n(62107),o=n(37157),a=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":a&&a in Object(e)?i(e):o(e)}},84134:e=>{e.exports=function(e,t){return e>t}},32726:e=>{var t=Object.prototype.hasOwnProperty;e.exports=function(e,n){return null!=e&&t.call(e,n)}},20187:e=>{e.exports=function(e,t){return null!=e&&t in Object(e)}},77832:(e,t,n)=>{var r=n(21359),i=n(22195),o=n(66024);e.exports=function(e,t,n){return t==t?o(e,t,n):r(e,i,n)}},15183:(e,t,n)=>{var r=n(53366),i=n(15125);e.exports=function(e){return i(e)&&"[object Arguments]"==r(e)}},88746:(e,t,n)=>{var r=n(51952),i=n(15125);e.exports=function e(t,n,o,a,s){return t===n||(null==t||null==n||!i(t)&&!i(n)?t!=t&&n!=n:r(t,n,o,a,e,s))}},51952:(e,t,n)=>{var r=n(86571),i=n(74871),o=n(11491),a=n(17416),s=n(70940),l=n(86152),c=n(73226),u=n(77598),d="[object Arguments]",h="[object Array]",f="[object Object]",p=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,v,g,m){var y=l(e),b=l(t),x=y?h:s(e),w=b?h:s(t),E=(x=x==d?f:x)==f,_=(w=w==d?f:w)==f,k=x==w;if(k&&c(e)){if(!c(t))return!1;y=!0,E=!1}if(k&&!E)return m||(m=new r),y||u(e)?i(e,t,n,v,g,m):o(e,t,x,n,v,g,m);if(!(1&n)){var S=E&&p.call(e,"__wrapped__"),P=_&&p.call(t,"__wrapped__");if(S||P){var j=S?e.value():e,C=P?t.value():t;return m||(m=new r),g(j,C,n,v,m)}}return!!k&&(m||(m=new r),a(e,t,n,v,g,m))}},74511:(e,t,n)=>{var r=n(70940),i=n(15125);e.exports=function(e){return i(e)&&"[object Map]"==r(e)}},37036:(e,t,n)=>{var r=n(86571),i=n(88746);e.exports=function(e,t,n,o){var a=n.length,s=a,l=!o;if(null==e)return!s;for(e=Object(e);a--;){var c=n[a];if(l&&c[2]?c[1]!==e[c[0]]:!(c[0]in e))return!1}for(;++a<s;){var u=(c=n[a])[0],d=e[u],h=c[1];if(l&&c[2]){if(void 0===d&&!(u in e))return!1}else{var f=new r;if(o)var p=o(d,h,u,e,t,f);if(!(void 0===p?i(h,d,3,o,f):p))return!1}}return!0}},22195:e=>{e.exports=function(e){return e!=e}},6840:(e,t,n)=>{var r=n(61049),i=n(47394),o=n(29259),a=n(87035),s=/^\[object .+?Constructor\]$/,l=Function.prototype,c=Object.prototype,u=l.toString,d=c.hasOwnProperty,h=RegExp("^"+u.call(d).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!o(e)||i(e))&&(r(e)?h:s).test(a(e))}},8109:(e,t,n)=>{var r=n(70940),i=n(15125);e.exports=function(e){return i(e)&&"[object Set]"==r(e)}},35522:(e,t,n)=>{var r=n(53366),i=n(61158),o=n(15125),a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a["[object Arguments]"]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a["[object Function]"]=a["[object Map]"]=a["[object Number]"]=a["[object Object]"]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1,e.exports=function(e){return o(e)&&i(e.length)&&!!a[r(e)]}},68286:(e,t,n)=>{var r=n(26423),i=n(74716),o=n(23059),a=n(86152),s=n(65798);e.exports=function(e){return"function"==typeof e?e:null==e?o:"object"==typeof e?a(e)?i(e[0],e[1]):r(e):s(e)}},86411:(e,t,n)=>{var r=n(16001),i=n(54248),o=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return i(e);var t=[];for(var n in Object(e))o.call(e,n)&&"constructor"!=n&&t.push(n);return t}},18390:(e,t,n)=>{var r=n(29259),i=n(16001),o=n(62966),a=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return o(e);var t=i(e),n=[];for(var s in e)("constructor"!=s||!t&&a.call(e,s))&&n.push(s);return n}},17606:e=>{e.exports=function(e,t){return e<t}},93401:(e,t,n)=>{var r=n(24303),i=n(67878);e.exports=function(e,t){var n=-1,o=i(e)?Array(e.length):[];return r(e,(function(e,r,i){o[++n]=t(e,r,i)})),o}},26423:(e,t,n)=>{var r=n(37036),i=n(49882),o=n(73477);e.exports=function(e){var t=i(e);return 1==t.length&&t[0][2]?o(t[0][0],t[0][1]):function(n){return n===e||r(n,e,t)}}},74716:(e,t,n)=>{var r=n(88746),i=n(72579),o=n(95041),a=n(21401),s=n(28792),l=n(73477),c=n(33812);e.exports=function(e,t){return a(e)&&s(t)?l(c(e),t):function(n){var a=i(n,e);return void 0===a&&a===t?o(n,e):r(t,a,3)}}},84565:(e,t,n)=>{var r=n(86571),i=n(28582),o=n(15308),a=n(25561),s=n(29259),l=n(18582),c=n(52434);e.exports=function e(t,n,u,d,h){t!==n&&o(n,(function(o,l){if(h||(h=new r),s(o))a(t,n,l,u,e,d,h);else{var f=d?d(c(t,l),o,l+"",t,n,h):void 0;void 0===f&&(f=o),i(t,l,f)}}),l)}},25561:(e,t,n)=>{var r=n(28582),i=n(92175),o=n(6190),a=n(51522),s=n(78725),l=n(79631),c=n(86152),u=n(93746),d=n(73226),h=n(61049),f=n(29259),p=n(97030),v=n(77598),g=n(52434),m=n(63329);e.exports=function(e,t,n,y,b,x,w){var E=g(e,n),_=g(t,n),k=w.get(_);if(k)r(e,n,k);else{var S=x?x(E,_,n+"",e,t,w):void 0,P=void 0===S;if(P){var j=c(_),C=!j&&d(_),T=!j&&!C&&v(_);S=_,j||C||T?c(E)?S=E:u(E)?S=a(E):C?(P=!1,S=i(_,!0)):T?(P=!1,S=o(_,!0)):S=[]:p(_)||l(_)?(S=E,l(E)?S=m(E):f(E)&&!h(E)||(S=s(_))):P=!1}P&&(w.set(_,S),b(S,_,y,x,w),w.delete(_)),r(e,n,S)}}},23813:(e,t,n)=>{var r=n(50343),i=n(13324),o=n(68286),a=n(93401),s=n(27095),l=n(47826),c=n(18477),u=n(23059),d=n(86152);e.exports=function(e,t,n){t=t.length?r(t,(function(e){return d(e)?function(t){return i(t,1===e.length?e[0]:e)}:e})):[u];var h=-1;t=r(t,l(o));var f=a(e,(function(e,n,i){return{criteria:r(t,(function(t){return t(e)})),index:++h,value:e}}));return s(f,(function(e,t){return c(e,t,n)}))}},92602:(e,t,n)=>{var r=n(93759),i=n(95041);e.exports=function(e,t){return r(e,t,(function(t,n){return i(e,n)}))}},93759:(e,t,n)=>{var r=n(13324),i=n(82857),o=n(17297);e.exports=function(e,t,n){for(var a=-1,s=t.length,l={};++a<s;){var c=t[a],u=r(e,c);n(u,c)&&i(l,o(c,e),u)}return l}},20256:e=>{e.exports=function(e){return function(t){return null==t?void 0:t[e]}}},82952:(e,t,n)=>{var r=n(13324);e.exports=function(e){return function(t){return r(t,e)}}},93228:e=>{var t=Math.ceil,n=Math.max;e.exports=function(e,r,i,o){for(var a=-1,s=n(t((r-e)/(i||1)),0),l=Array(s);s--;)l[o?s:++a]=e,e+=i;return l}},5877:e=>{e.exports=function(e,t,n,r,i){return i(e,(function(e,i,o){n=r?(r=!1,e):t(n,e,i,o)})),n}},36060:(e,t,n)=>{var r=n(23059),i=n(43114),o=n(75251);e.exports=function(e,t){return o(i(e,t,r),e+"")}},82857:(e,t,n)=>{var r=n(60091),i=n(17297),o=n(39045),a=n(29259),s=n(33812);e.exports=function(e,t,n,l){if(!a(e))return e;for(var c=-1,u=(t=i(t,e)).length,d=u-1,h=e;null!=h&&++c<u;){var f=s(t[c]),p=n;if("__proto__"===f||"constructor"===f||"prototype"===f)return e;if(c!=d){var v=h[f];void 0===(p=l?l(v,f,h):void 0)&&(p=a(v)?v:o(t[c+1])?[]:{})}r(h,f,p),h=h[f]}return e}},86532:(e,t,n)=>{var r=n(86874),i=n(83043),o=n(23059),a=i?function(e,t){return i(e,"toString",{configurable:!0,enumerable:!1,value:r(t),writable:!0})}:o;e.exports=a},27095:e=>{e.exports=function(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}},36473:e=>{e.exports=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}},1054:(e,t,n)=>{var r=n(50857),i=n(50343),o=n(86152),a=n(4795),s=r?r.prototype:void 0,l=s?s.toString:void 0;e.exports=function e(t){if("string"==typeof t)return t;if(o(t))return i(t,e)+"";if(a(t))return l?l.call(t):"";var n=t+"";return"0"==n&&1/t==-Infinity?"-0":n}},51704:(e,t,n)=>{var r=n(52153),i=/^\s+/;e.exports=function(e){return e?e.slice(0,r(e)+1).replace(i,""):e}},47826:e=>{e.exports=function(e){return function(t){return e(t)}}},67326:(e,t,n)=>{var r=n(45386),i=n(38333),o=n(34893),a=n(59950),s=n(78803),l=n(16909);e.exports=function(e,t,n){var c=-1,u=i,d=e.length,h=!0,f=[],p=f;if(n)h=!1,u=o;else if(d>=200){var v=t?null:s(e);if(v)return l(v);h=!1,u=a,p=new r}else p=t?[]:f;e:for(;++c<d;){var g=e[c],m=t?t(g):g;if(g=n||0!==g?g:0,h&&m==m){for(var y=p.length;y--;)if(p[y]===m)continue e;t&&p.push(m),f.push(g)}else u(p,m,n)||(p!==f&&p.push(m),f.push(g))}return f}},50753:(e,t,n)=>{var r=n(50343);e.exports=function(e,t){return r(t,(function(t){return e[t]}))}},40509:e=>{e.exports=function(e,t,n){for(var r=-1,i=e.length,o=t.length,a={};++r<i;){var s=r<o?t[r]:void 0;n(a,e[r],s)}return a}},59950:e=>{e.exports=function(e,t){return e.has(t)}},89419:(e,t,n)=>{var r=n(23059);e.exports=function(e){return"function"==typeof e?e:r}},17297:(e,t,n)=>{var r=n(86152),i=n(21401),o=n(54452),a=n(66188);e.exports=function(e,t){return r(e)?e:i(e,t)?[e]:o(a(e))}},79882:(e,t,n)=>{var r=n(79162);e.exports=function(e){var t=new e.constructor(e.byteLength);return new r(t).set(new r(e)),t}},92175:(e,t,n)=>{e=n.nmd(e);var r=n(37772),i=t&&!t.nodeType&&t,o=i&&e&&!e.nodeType&&e,a=o&&o.exports===i?r.Buffer:void 0,s=a?a.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var n=e.length,r=s?s(n):new e.constructor(n);return e.copy(r),r}},34727:(e,t,n)=>{var r=n(79882);e.exports=function(e,t){var n=t?r(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}},96058:e=>{var t=/\w*$/;e.exports=function(e){var n=new e.constructor(e.source,t.exec(e));return n.lastIndex=e.lastIndex,n}},70169:(e,t,n)=>{var r=n(50857),i=r?r.prototype:void 0,o=i?i.valueOf:void 0;e.exports=function(e){return o?Object(o.call(e)):{}}},6190:(e,t,n)=>{var r=n(79882);e.exports=function(e,t){var n=t?r(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}},27520:(e,t,n)=>{var r=n(4795);e.exports=function(e,t){if(e!==t){var n=void 0!==e,i=null===e,o=e==e,a=r(e),s=void 0!==t,l=null===t,c=t==t,u=r(t);if(!l&&!u&&!a&&e>t||a&&s&&c&&!l&&!u||i&&s&&c||!n&&c||!o)return 1;if(!i&&!a&&!u&&e<t||u&&n&&o&&!i&&!a||l&&n&&o||!s&&o||!c)return-1}return 0}},18477:(e,t,n)=>{var r=n(27520);e.exports=function(e,t,n){for(var i=-1,o=e.criteria,a=t.criteria,s=o.length,l=n.length;++i<s;){var c=r(o[i],a[i]);if(c)return i>=l?c:c*("desc"==n[i]?-1:1)}return e.index-t.index}},51522:e=>{e.exports=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}},752:(e,t,n)=>{var r=n(60091),i=n(13940);e.exports=function(e,t,n,o){var a=!n;n||(n={});for(var s=-1,l=t.length;++s<l;){var c=t[s],u=o?o(n[c],e[c],c,n,e):void 0;void 0===u&&(u=e[c]),a?i(n,c,u):r(n,c,u)}return n}},7680:(e,t,n)=>{var r=n(752),i=n(80633);e.exports=function(e,t){return r(e,i(e),t)}},19987:(e,t,n)=>{var r=n(752),i=n(12680);e.exports=function(e,t){return r(e,i(e),t)}},24019:(e,t,n)=>{var r=n(37772)["__core-js_shared__"];e.exports=r},97263:(e,t,n)=>{var r=n(36060),i=n(82406);e.exports=function(e){return r((function(t,n){var r=-1,o=n.length,a=o>1?n[o-1]:void 0,s=o>2?n[2]:void 0;for(a=e.length>3&&"function"==typeof a?(o--,a):void 0,s&&i(n[0],n[1],s)&&(a=o<3?void 0:a,o=1),t=Object(t);++r<o;){var l=n[r];l&&e(t,l,r,a)}return t}))}},92019:(e,t,n)=>{var r=n(67878);e.exports=function(e,t){return function(n,i){if(null==n)return n;if(!r(n))return e(n,i);for(var o=n.length,a=t?o:-1,s=Object(n);(t?a--:++a<o)&&!1!==i(s[a],a,s););return n}}},55463:e=>{e.exports=function(e){return function(t,n,r){for(var i=-1,o=Object(t),a=r(t),s=a.length;s--;){var l=a[e?s:++i];if(!1===n(o[l],l,o))break}return t}}},98776:(e,t,n)=>{var r=n(68286),i=n(67878),o=n(90249);e.exports=function(e){return function(t,n,a){var s=Object(t);if(!i(t)){var l=r(n,3);t=o(t),n=function(e){return l(s[e],e,s)}}var c=e(t,n,a);return c>-1?s[l?t[c]:c]:void 0}}},82941:(e,t,n)=>{var r=n(93228),i=n(82406),o=n(5707);e.exports=function(e){return function(t,n,a){return a&&"number"!=typeof a&&i(t,n,a)&&(n=a=void 0),t=o(t),void 0===n?(n=t,t=0):n=o(n),a=void 0===a?t<n?1:-1:o(a),r(t,n,a,e)}}},78803:(e,t,n)=>{var r=n(2143),i=n(34291),o=n(16909),a=r&&1/o(new r([,-0]))[1]==1/0?function(e){return new r(e)}:i;e.exports=a},83043:(e,t,n)=>{var r=n(38761),i=function(){try{var e=r(Object,"defineProperty");return e({},"",{}),e}catch(t){}}();e.exports=i},74871:(e,t,n)=>{var r=n(45386),i=n(87064),o=n(59950);e.exports=function(e,t,n,a,s,l){var c=1&n,u=e.length,d=t.length;if(u!=d&&!(c&&d>u))return!1;var h=l.get(e),f=l.get(t);if(h&&f)return h==t&&f==e;var p=-1,v=!0,g=2&n?new r:void 0;for(l.set(e,t),l.set(t,e);++p<u;){var m=e[p],y=t[p];if(a)var b=c?a(y,m,p,t,e,l):a(m,y,p,e,t,l);if(void 0!==b){if(b)continue;v=!1;break}if(g){if(!i(t,(function(e,t){if(!o(g,t)&&(m===e||s(m,e,n,a,l)))return g.push(t)}))){v=!1;break}}else if(m!==y&&!s(m,y,n,a,l)){v=!1;break}}return l.delete(e),l.delete(t),v}},11491:(e,t,n)=>{var r=n(50857),i=n(79162),o=n(41225),a=n(74871),s=n(75179),l=n(16909),c=r?r.prototype:void 0,u=c?c.valueOf:void 0;e.exports=function(e,t,n,r,c,d,h){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!d(new i(e),new i(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return o(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var f=s;case"[object Set]":var p=1&r;if(f||(f=l),e.size!=t.size&&!p)return!1;var v=h.get(e);if(v)return v==t;r|=2,h.set(e,t);var g=a(f(e),f(t),r,c,d,h);return h.delete(e),g;case"[object Symbol]":if(u)return u.call(e)==u.call(t)}return!1}},17416:(e,t,n)=>{var r=n(13483),i=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,o,a,s){var l=1&n,c=r(e),u=c.length;if(u!=r(t).length&&!l)return!1;for(var d=u;d--;){var h=c[d];if(!(l?h in t:i.call(t,h)))return!1}var f=s.get(e),p=s.get(t);if(f&&p)return f==t&&p==e;var v=!0;s.set(e,t),s.set(t,e);for(var g=l;++d<u;){var m=e[h=c[d]],y=t[h];if(o)var b=l?o(y,m,h,t,e,s):o(m,y,h,e,t,s);if(!(void 0===b?m===y||a(m,y,n,o,s):b)){v=!1;break}g||(g="constructor"==h)}if(v&&!g){var x=e.constructor,w=t.constructor;x==w||!("constructor"in e)||!("constructor"in t)||"function"==typeof x&&x instanceof x&&"function"==typeof w&&w instanceof w||(v=!1)}return s.delete(e),s.delete(t),v}},29097:(e,t,n)=>{var r=n(35676),i=n(43114),o=n(75251);e.exports=function(e){return o(i(e,void 0,r),e+"")}},51242:e=>{var t="object"==typeof global&&global&&global.Object===Object&&global;e.exports=t},13483:(e,t,n)=>{var r=n(1897),i=n(80633),o=n(90249);e.exports=function(e){return r(e,o,i)}},76939:(e,t,n)=>{var r=n(1897),i=n(12680),o=n(18582);e.exports=function(e){return r(e,o,i)}},27937:(e,t,n)=>{var r=n(98304);e.exports=function(e,t){var n=e.__data__;return r(t)?n["string"==typeof t?"string":"hash"]:n.map}},49882:(e,t,n)=>{var r=n(28792),i=n(90249);e.exports=function(e){for(var t=i(e),n=t.length;n--;){var o=t[n],a=e[o];t[n]=[o,a,r(a)]}return t}},38761:(e,t,n)=>{var r=n(6840),i=n(98109);e.exports=function(e,t){var n=i(e,t);return r(n)?n:void 0}},47353:(e,t,n)=>{var r=n(60241)(Object.getPrototypeOf,Object);e.exports=r},62107:(e,t,n)=>{var r=n(50857),i=Object.prototype,o=i.hasOwnProperty,a=i.toString,s=r?r.toStringTag:void 0;e.exports=function(e){var t=o.call(e,s),n=e[s];try{e[s]=void 0;var r=!0}catch(l){}var i=a.call(e);return r&&(t?e[s]=n:delete e[s]),i}},80633:(e,t,n)=>{var r=n(67552),i=n(30981),o=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols,s=a?function(e){return null==e?[]:(e=Object(e),r(a(e),(function(t){return o.call(e,t)})))}:i;e.exports=s},12680:(e,t,n)=>{var r=n(65067),i=n(47353),o=n(80633),a=n(30981),s=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)r(t,o(e)),e=i(e);return t}:a;e.exports=s},70940:(e,t,n)=>{var r=n(39515),i=n(10326),o=n(52760),a=n(2143),s=n(93215),l=n(53366),c=n(87035),u="[object Map]",d="[object Promise]",h="[object Set]",f="[object WeakMap]",p="[object DataView]",v=c(r),g=c(i),m=c(o),y=c(a),b=c(s),x=l;(r&&x(new r(new ArrayBuffer(1)))!=p||i&&x(new i)!=u||o&&x(o.resolve())!=d||a&&x(new a)!=h||s&&x(new s)!=f)&&(x=function(e){var t=l(e),n="[object Object]"==t?e.constructor:void 0,r=n?c(n):"";if(r)switch(r){case v:return p;case g:return u;case m:return d;case y:return h;case b:return f}return t}),e.exports=x},98109:e=>{e.exports=function(e,t){return null==e?void 0:e[t]}},1369:(e,t,n)=>{var r=n(17297),i=n(79631),o=n(86152),a=n(39045),s=n(61158),l=n(33812);e.exports=function(e,t,n){for(var c=-1,u=(t=r(t,e)).length,d=!1;++c<u;){var h=l(t[c]);if(!(d=null!=e&&n(e,h)))break;e=e[h]}return d||++c!=u?d:!!(u=null==e?0:e.length)&&s(u)&&a(h,u)&&(o(e)||i(e))}},33880:e=>{var t=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");e.exports=function(e){return t.test(e)}},52118:(e,t,n)=>{var r=n(99191);e.exports=function(){this.__data__=r?r(null):{},this.size=0}},96909:e=>{e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},98138:(e,t,n)=>{var r=n(99191),i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(r){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return i.call(t,e)?t[e]:void 0}},4174:(e,t,n)=>{var r=n(99191),i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return r?void 0!==t[e]:i.call(t,e)}},7942:(e,t,n)=>{var r=n(99191);e.exports=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=r&&void 0===t?"__lodash_hash_undefined__":t,this}},99917:e=>{var t=Object.prototype.hasOwnProperty;e.exports=function(e){var n=e.length,r=new e.constructor(n);return n&&"string"==typeof e[0]&&t.call(e,"index")&&(r.index=e.index,r.input=e.input),r}},8222:(e,t,n)=>{var r=n(79882),i=n(34727),o=n(96058),a=n(70169),s=n(6190);e.exports=function(e,t,n){var l=e.constructor;switch(t){case"[object ArrayBuffer]":return r(e);case"[object Boolean]":case"[object Date]":return new l(+e);case"[object DataView]":return i(e,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return s(e,n);case"[object Map]":case"[object Set]":return new l;case"[object Number]":case"[object String]":return new l(e);case"[object RegExp]":return o(e);case"[object Symbol]":return a(e)}}},78725:(e,t,n)=>{var r=n(39413),i=n(47353),o=n(16001);e.exports=function(e){return"function"!=typeof e.constructor||o(e)?{}:r(i(e))}},95882:(e,t,n)=>{var r=n(50857),i=n(79631),o=n(86152),a=r?r.isConcatSpreadable:void 0;e.exports=function(e){return o(e)||i(e)||!!(a&&e&&e[a])}},39045:e=>{var t=/^(?:0|[1-9]\d*)$/;e.exports=function(e,n){var r=typeof e;return!!(n=null==n?9007199254740991:n)&&("number"==r||"symbol"!=r&&t.test(e))&&e>-1&&e%1==0&&e<n}},82406:(e,t,n)=>{var r=n(41225),i=n(67878),o=n(39045),a=n(29259);e.exports=function(e,t,n){if(!a(n))return!1;var s=typeof t;return!!("number"==s?i(n)&&o(t,n.length):"string"==s&&t in n)&&r(n[t],e)}},21401:(e,t,n)=>{var r=n(86152),i=n(4795),o=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;e.exports=function(e,t){if(r(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!i(e))||(a.test(e)||!o.test(e)||null!=t&&e in Object(t))}},98304:e=>{e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},47394:(e,t,n)=>{var r,i=n(24019),o=(r=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";e.exports=function(e){return!!o&&o in e}},16001:e=>{var t=Object.prototype;e.exports=function(e){var n=e&&e.constructor;return e===("function"==typeof n&&n.prototype||t)}},28792:(e,t,n)=>{var r=n(29259);e.exports=function(e){return e==e&&!r(e)}},3945:e=>{e.exports=function(){this.__data__=[],this.size=0}},21846:(e,t,n)=>{var r=n(22218),i=Array.prototype.splice;e.exports=function(e){var t=this.__data__,n=r(t,e);return!(n<0)&&(n==t.length-1?t.pop():i.call(t,n,1),--this.size,!0)}},88028:(e,t,n)=>{var r=n(22218);e.exports=function(e){var t=this.__data__,n=r(t,e);return n<0?void 0:t[n][1]}},72344:(e,t,n)=>{var r=n(22218);e.exports=function(e){return r(this.__data__,e)>-1}},94769:(e,t,n)=>{var r=n(22218);e.exports=function(e,t){var n=this.__data__,i=r(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this}},92411:(e,t,n)=>{var r=n(89612),i=n(80235),o=n(10326);e.exports=function(){this.size=0,this.__data__={hash:new r,map:new(o||i),string:new r}}},36417:(e,t,n)=>{var r=n(27937);e.exports=function(e){var t=r(this,e).delete(e);return this.size-=t?1:0,t}},86928:(e,t,n)=>{var r=n(27937);e.exports=function(e){return r(this,e).get(e)}},79493:(e,t,n)=>{var r=n(27937);e.exports=function(e){return r(this,e).has(e)}},24150:(e,t,n)=>{var r=n(27937);e.exports=function(e,t){var n=r(this,e),i=n.size;return n.set(e,t),this.size+=n.size==i?0:1,this}},75179:e=>{e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}},73477:e=>{e.exports=function(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in Object(n)))}}},77777:(e,t,n)=>{var r=n(30733);e.exports=function(e){var t=r(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t}},99191:(e,t,n)=>{var r=n(38761)(Object,"create");e.exports=r},54248:(e,t,n)=>{var r=n(60241)(Object.keys,Object);e.exports=r},62966:e=>{e.exports=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}},4146:(e,t,n)=>{e=n.nmd(e);var r=n(51242),i=t&&!t.nodeType&&t,o=i&&e&&!e.nodeType&&e,a=o&&o.exports===i&&r.process,s=function(){try{var e=o&&o.require&&o.require("util").types;return e||a&&a.binding&&a.binding("util")}catch(t){}}();e.exports=s},37157:e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},60241:e=>{e.exports=function(e,t){return function(n){return e(t(n))}}},43114:(e,t,n)=>{var r=n(49432),i=Math.max;e.exports=function(e,t,n){return t=i(void 0===t?e.length-1:t,0),function(){for(var o=arguments,a=-1,s=i(o.length-t,0),l=Array(s);++a<s;)l[a]=o[t+a];a=-1;for(var c=Array(t+1);++a<t;)c[a]=o[a];return c[t]=n(l),r(e,this,c)}}},37772:(e,t,n)=>{var r=n(51242),i="object"==typeof self&&self&&self.Object===Object&&self,o=r||i||Function("return this")();e.exports=o},52434:e=>{e.exports=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}},52842:e=>{e.exports=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}},52482:e=>{e.exports=function(e){return this.__data__.has(e)}},16909:e=>{e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}},75251:(e,t,n)=>{var r=n(86532),i=n(97787)(r);e.exports=i},97787:e=>{var t=Date.now;e.exports=function(e){var n=0,r=0;return function(){var i=t(),o=16-(i-r);if(r=i,o>0){if(++n>=800)return arguments[0]}else n=0;return e.apply(void 0,arguments)}}},15243:(e,t,n)=>{var r=n(80235);e.exports=function(){this.__data__=new r,this.size=0}},72858:e=>{e.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},4417:e=>{e.exports=function(e){return this.__data__.get(e)}},8605:e=>{e.exports=function(e){return this.__data__.has(e)}},71418:(e,t,n)=>{var r=n(80235),i=n(10326),o=n(96738);e.exports=function(e,t){var n=this.__data__;if(n instanceof r){var a=n.__data__;if(!i||a.length<199)return a.push([e,t]),this.size=++n.size,this;n=this.__data__=new o(a)}return n.set(e,t),this.size=n.size,this}},66024:e=>{e.exports=function(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}},82302:(e,t,n)=>{var r=n(8589),i=n(33880),o=n(35555);e.exports=function(e){return i(e)?o(e):r(e)}},54452:(e,t,n)=>{var r=n(77777),i=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,o=/\\(\\)?/g,a=r((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(i,(function(e,n,r,i){t.push(r?i.replace(o,"$1"):n||e)})),t}));e.exports=a},33812:(e,t,n)=>{var r=n(4795);e.exports=function(e){if("string"==typeof e||r(e))return e;var t=e+"";return"0"==t&&1/e==-Infinity?"-0":t}},87035:e=>{var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(n){}try{return e+""}catch(n){}}return""}},52153:e=>{var t=/\s/;e.exports=function(e){for(var n=e.length;n--&&t.test(e.charAt(n)););return n}},35555:e=>{var t="[\\ud800-\\udfff]",n="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",r="\\ud83c[\\udffb-\\udfff]",i="[^\\ud800-\\udfff]",o="(?:\\ud83c[\\udde6-\\uddff]){2}",a="[\\ud800-\\udbff][\\udc00-\\udfff]",s="(?:"+n+"|"+r+")"+"?",l="[\\ufe0e\\ufe0f]?",c=l+s+("(?:\\u200d(?:"+[i,o,a].join("|")+")"+l+s+")*"),u="(?:"+[i+n+"?",n,o,a,t].join("|")+")",d=RegExp(r+"(?="+r+")|"+u+c,"g");e.exports=function(e){for(var t=d.lastIndex=0;d.test(e);)++t;return t}},54004:(e,t,n)=>{var r=n(18874);e.exports=function(e){return r(e,4)}},9850:(e,t,n)=>{var r=n(18874);e.exports=function(e){return r(e,5)}},86874:e=>{e.exports=function(e){return function(){return e}}},54073:(e,t,n)=>{var r=n(29259),i=n(61100),o=n(7642),a=Math.max,s=Math.min;e.exports=function(e,t,n){var l,c,u,d,h,f,p=0,v=!1,g=!1,m=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function y(t){var n=l,r=c;return l=c=void 0,p=t,d=e.apply(r,n)}function b(e){return p=e,h=setTimeout(w,t),v?y(e):d}function x(e){var n=e-f;return void 0===f||n>=t||n<0||g&&e-p>=u}function w(){var e=i();if(x(e))return E(e);h=setTimeout(w,function(e){var n=t-(e-f);return g?s(n,u-(e-p)):n}(e))}function E(e){return h=void 0,m&&l?y(e):(l=c=void 0,d)}function _(){var e=i(),n=x(e);if(l=arguments,c=this,f=e,n){if(void 0===h)return b(f);if(g)return clearTimeout(h),h=setTimeout(w,t),y(f)}return void 0===h&&(h=setTimeout(w,t)),d}return t=o(t)||0,r(n)&&(v=!!n.leading,u=(g="maxWait"in n)?a(o(n.maxWait)||0,t):u,m="trailing"in n?!!n.trailing:m),_.cancel=function(){void 0!==h&&clearTimeout(h),p=0,l=f=c=h=void 0},_.flush=function(){return void 0===h?d:E(i())},_}},84573:(e,t,n)=>{var r=n(36060),i=n(41225),o=n(82406),a=n(18582),s=Object.prototype,l=s.hasOwnProperty,c=r((function(e,t){e=Object(e);var n=-1,r=t.length,c=r>2?t[2]:void 0;for(c&&o(t[0],t[1],c)&&(r=1);++n<r;)for(var u=t[n],d=a(u),h=-1,f=d.length;++h<f;){var p=d[h],v=e[p];(void 0===v||i(v,s[p])&&!l.call(e,p))&&(e[p]=u[p])}return e}));e.exports=c},79421:(e,t,n)=>{e.exports=n(59756)},41225:e=>{e.exports=function(e,t){return e===t||e!=e&&t!=t}},90882:(e,t,n)=>{var r=n(67552),i=n(98043),o=n(68286),a=n(86152);e.exports=function(e,t){return(a(e)?r:i)(e,o(t,3))}},55281:(e,t,n)=>{var r=n(98776)(n(12982));e.exports=r},12982:(e,t,n)=>{var r=n(21359),i=n(68286),o=n(38101),a=Math.max;e.exports=function(e,t,n){var s=null==e?0:e.length;if(!s)return-1;var l=null==n?0:o(n);return l<0&&(l=a(s+l,0)),r(e,i(t,3),l)}},35676:(e,t,n)=>{var r=n(62034);e.exports=function(e){return(null==e?0:e.length)?r(e,1):[]}},59756:(e,t,n)=>{var r=n(72517),i=n(24303),o=n(89419),a=n(86152);e.exports=function(e,t){return(a(e)?r:i)(e,o(t))}},20792:(e,t,n)=>{var r=n(15308),i=n(89419),o=n(18582);e.exports=function(e,t){return null==e?e:r(e,i(t),o)}},72579:(e,t,n)=>{var r=n(13324);e.exports=function(e,t,n){var i=null==e?void 0:r(e,t);return void 0===i?n:i}},93352:(e,t,n)=>{var r=n(32726),i=n(1369);e.exports=function(e,t){return null!=e&&i(e,t,r)}},95041:(e,t,n)=>{var r=n(20187),i=n(1369);e.exports=function(e,t){return null!=e&&i(e,t,r)}},23059:e=>{e.exports=function(e){return e}},79631:(e,t,n)=>{var r=n(15183),i=n(15125),o=Object.prototype,a=o.hasOwnProperty,s=o.propertyIsEnumerable,l=r(function(){return arguments}())?r:function(e){return i(e)&&a.call(e,"callee")&&!s.call(e,"callee")};e.exports=l},86152:e=>{var t=Array.isArray;e.exports=t},67878:(e,t,n)=>{var r=n(61049),i=n(61158);e.exports=function(e){return null!=e&&i(e.length)&&!r(e)}},93746:(e,t,n)=>{var r=n(67878),i=n(15125);e.exports=function(e){return i(e)&&r(e)}},73226:(e,t,n)=>{e=n.nmd(e);var r=n(37772),i=n(36330),o=t&&!t.nodeType&&t,a=o&&e&&!e.nodeType&&e,s=a&&a.exports===o?r.Buffer:void 0,l=(s?s.isBuffer:void 0)||i;e.exports=l},45455:(e,t,n)=>{var r=n(86411),i=n(70940),o=n(79631),a=n(86152),s=n(67878),l=n(73226),c=n(16001),u=n(77598),d=Object.prototype.hasOwnProperty;e.exports=function(e){if(null==e)return!0;if(s(e)&&(a(e)||"string"==typeof e||"function"==typeof e.splice||l(e)||u(e)||o(e)))return!e.length;var t=i(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(c(e))return!r(e).length;for(var n in e)if(d.call(e,n))return!1;return!0}},61049:(e,t,n)=>{var r=n(53366),i=n(29259);e.exports=function(e){if(!i(e))return!1;var t=r(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},61158:e=>{e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},4714:(e,t,n)=>{var r=n(74511),i=n(47826),o=n(4146),a=o&&o.isMap,s=a?i(a):r;e.exports=s},29259:e=>{e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},15125:e=>{e.exports=function(e){return null!=e&&"object"==typeof e}},97030:(e,t,n)=>{var r=n(53366),i=n(47353),o=n(15125),a=Function.prototype,s=Object.prototype,l=a.toString,c=s.hasOwnProperty,u=l.call(Object);e.exports=function(e){if(!o(e)||"[object Object]"!=r(e))return!1;var t=i(e);if(null===t)return!0;var n=c.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&l.call(n)==u}},43679:(e,t,n)=>{var r=n(8109),i=n(47826),o=n(4146),a=o&&o.isSet,s=a?i(a):r;e.exports=s},85505:(e,t,n)=>{var r=n(53366),i=n(86152),o=n(15125);e.exports=function(e){return"string"==typeof e||!i(e)&&o(e)&&"[object String]"==r(e)}},4795:(e,t,n)=>{var r=n(53366),i=n(15125);e.exports=function(e){return"symbol"==typeof e||i(e)&&"[object Symbol]"==r(e)}},77598:(e,t,n)=>{var r=n(35522),i=n(47826),o=n(4146),a=o&&o.isTypedArray,s=a?i(a):r;e.exports=s},84336:e=>{e.exports=function(e){return void 0===e}},90249:(e,t,n)=>{var r=n(1634),i=n(86411),o=n(67878);e.exports=function(e){return o(e)?r(e):i(e)}},18582:(e,t,n)=>{var r=n(1634),i=n(18390),o=n(67878);e.exports=function(e){return o(e)?r(e,!0):i(e)}},56974:e=>{e.exports=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}},16760:(e,t,n)=>{var r=n(50343),i=n(68286),o=n(93401),a=n(86152);e.exports=function(e,t){return(a(e)?r:o)(e,i(t,3))}},34519:(e,t,n)=>{var r=n(13940),i=n(26548),o=n(68286);e.exports=function(e,t){var n={};return t=o(t,3),i(e,(function(e,i,o){r(n,i,t(e,i,o))})),n}},71644:(e,t,n)=>{var r=n(2229),i=n(84134),o=n(23059);e.exports=function(e){return e&&e.length?r(e,o,i):void 0}},30733:(e,t,n)=>{var r=n(96738);function i(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(i.Cache||r),n}i.Cache=r,e.exports=i},98537:(e,t,n)=>{var r=n(84565),i=n(97263)((function(e,t,n){r(e,t,n)}));e.exports=i},65680:(e,t,n)=>{var r=n(2229),i=n(17606),o=n(23059);e.exports=function(e){return e&&e.length?r(e,o,i):void 0}},10937:(e,t,n)=>{var r=n(2229),i=n(68286),o=n(17606);e.exports=function(e,t){return e&&e.length?r(e,i(t,2),o):void 0}},34291:e=>{e.exports=function(){}},61100:(e,t,n)=>{var r=n(37772);e.exports=function(){return r.Date.now()}},13888:(e,t,n)=>{var r=n(92602),i=n(29097)((function(e,t){return null==e?{}:r(e,t)}));e.exports=i},65798:(e,t,n)=>{var r=n(20256),i=n(82952),o=n(21401),a=n(33812);e.exports=function(e){return o(e)?r(a(e)):i(e)}},2689:(e,t,n)=>{var r=n(82941)();e.exports=r},58215:(e,t,n)=>{var r=n(81207),i=n(24303),o=n(68286),a=n(5877),s=n(86152);e.exports=function(e,t,n){var l=s(e)?r:a,c=arguments.length<3;return l(e,o(t,4),n,c,i)}},16765:(e,t,n)=>{var r=n(82857);e.exports=function(e,t,n){return null==e?e:r(e,t,n)}},36402:(e,t,n)=>{var r=n(86411),i=n(70940),o=n(67878),a=n(85505),s=n(82302);e.exports=function(e){if(null==e)return 0;if(o(e))return a(e)?s(e):e.length;var t=i(e);return"[object Map]"==t||"[object Set]"==t?e.size:r(e).length}},829:(e,t,n)=>{var r=n(62034),i=n(23813),o=n(36060),a=n(82406),s=o((function(e,t){if(null==e)return[];var n=t.length;return n>1&&a(e,t[0],t[1])?t=[]:n>2&&a(t[0],t[1],t[2])&&(t=[t[0]]),i(e,r(t,1),[])}));e.exports=s},30981:e=>{e.exports=function(){return[]}},36330:e=>{e.exports=function(){return!1}},5707:(e,t,n)=>{var r=n(7642),i=1/0;e.exports=function(e){return e?(e=r(e))===i||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}},38101:(e,t,n)=>{var r=n(5707);e.exports=function(e){var t=r(e),n=t%1;return t==t?n?t-n:t:0}},7642:(e,t,n)=>{var r=n(51704),i=n(29259),o=n(4795),a=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,l=/^0o[0-7]+$/i,c=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(o(e))return NaN;if(i(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=i(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var n=s.test(e);return n||l.test(e)?c(e.slice(2),n?2:8):a.test(e)?NaN:+e}},25497:(e,t,n)=>{var r=n(50343),i=n(51522),o=n(86152),a=n(4795),s=n(54452),l=n(33812),c=n(66188);e.exports=function(e){return o(e)?r(e,l):a(e)?[e]:i(s(c(e)))}},63329:(e,t,n)=>{var r=n(752),i=n(18582);e.exports=function(e){return r(e,i(e))}},66188:(e,t,n)=>{var r=n(1054);e.exports=function(e){return null==e?"":r(e)}},89466:(e,t,n)=>{var r=n(72517),i=n(39413),o=n(26548),a=n(68286),s=n(47353),l=n(86152),c=n(73226),u=n(61049),d=n(29259),h=n(77598);e.exports=function(e,t,n){var f=l(e),p=f||c(e)||h(e);if(t=a(t,4),null==n){var v=e&&e.constructor;n=p?f?new v:[]:d(e)&&u(v)?i(s(e)):{}}return(p?r:o)(e,(function(e,r,i){return t(n,e,r,i)})),n}},26139:(e,t,n)=>{var r=n(62034),i=n(36060),o=n(67326),a=n(93746),s=i((function(e){return o(r(e,1,a,!0))}));e.exports=s},74930:(e,t,n)=>{var r=n(66188),i=0;e.exports=function(e){var t=++i;return r(e)+t}},98346:(e,t,n)=>{var r=n(50753),i=n(90249);e.exports=function(e){return null==e?[]:r(e,i(e))}},46150:(e,t,n)=>{var r=n(60091),i=n(40509);e.exports=function(e,t){return i(e||[],t||[],r)}},12139:(e,t,n)=>{"use strict";n.r(t),n.d(t,{Children:()=>z,Component:()=>a.wA,Fragment:()=>a.HY,PureComponent:()=>A,StrictMode:()=>xe,Suspense:()=>H,SuspenseList:()=>Y,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:()=>de,cloneElement:()=>ve,createContext:()=>a.kr,createElement:()=>a.az,createFactory:()=>fe,createPortal:()=>K,createRef:()=>a.Vf,default:()=>we,findDOMNode:()=>me,flushSync:()=>be,forwardRef:()=>B,hydrate:()=>ne,isValidElement:()=>pe,lazy:()=>q,memo:()=>R,render:()=>te,unmountComponentAtNode:()=>ge,unstable_batchedUpdates:()=>ye,useCallback:()=>E,useContext:()=>_,useDebugValue:()=>k,useEffect:()=>m,useErrorBoundary:()=>S,useImperativeHandle:()=>x,useLayoutEffect:()=>y,useMemo:()=>w,useReducer:()=>g,useRef:()=>b,useState:()=>v,version:()=>he});var r,i,o,a=n(33847),s=0,l=[],c=a.YM.__b,u=a.YM.__r,d=a.YM.diffed,h=a.YM.__c,f=a.YM.unmount;function p(e,t){a.YM.__h&&a.YM.__h(i,e,s||t),s=0;var n=i.__H||(i.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function v(e){return s=1,g(N,e)}function g(e,t,n){var o=p(r++,2);return o.t=e,o.__c||(o.__=[n?n(t):N(void 0,t),function(e){var t=o.t(o.__[0],e);o.__[0]!==t&&(o.__=[t,o.__[1]],o.__c.setState({}))}],o.__c=i),o.__}function m(e,t){var n=p(r++,3);!a.YM.__s&&D(n.__H,t)&&(n.__=e,n.__H=t,i.__H.__h.push(n))}function y(e,t){var n=p(r++,4);!a.YM.__s&&D(n.__H,t)&&(n.__=e,n.__H=t,i.__h.push(n))}function b(e){return s=5,w((function(){return{current:e}}),[])}function x(e,t,n){s=6,y((function(){"function"==typeof e?e(t()):e&&(e.current=t())}),null==n?n:n.concat(e))}function w(e,t){var n=p(r++,7);return D(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function E(e,t){return s=8,w((function(){return e}),t)}function _(e){var t=i.context[e.__c],n=p(r++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(i)),t.props.value):e.__}function k(e,t){a.YM.useDebugValue&&a.YM.useDebugValue(t?t(e):e)}function S(e){var t=p(r++,10),n=v();return t.__=e,i.componentDidCatch||(i.componentDidCatch=function(e){t.__&&t.__(e),n[1](e)}),[n[0],function(){n[1](void 0)}]}function P(){var e;for(l.sort((function(e,t){return e.__v.__b-t.__v.__b}));e=l.pop();)if(e.__P)try{e.__H.__h.forEach(C),e.__H.__h.forEach(T),e.__H.__h=[]}catch(i){e.__H.__h=[],a.YM.__e(i,e.__v)}}a.YM.__b=function(e){i=null,c&&c(e)},a.YM.__r=function(e){u&&u(e),r=0;var t=(i=e.__c).__H;t&&(t.__h.forEach(C),t.__h.forEach(T),t.__h=[])},a.YM.diffed=function(e){d&&d(e);var t=e.__c;t&&t.__H&&t.__H.__h.length&&(1!==l.push(t)&&o===a.YM.requestAnimationFrame||((o=a.YM.requestAnimationFrame)||function(e){var t,n=function(){clearTimeout(r),j&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);j&&(t=requestAnimationFrame(n))})(P)),i=null},a.YM.__c=function(e,t){t.some((function(e){try{e.__h.forEach(C),e.__h=e.__h.filter((function(e){return!e.__||T(e)}))}catch(o){t.some((function(e){e.__h&&(e.__h=[])})),t=[],a.YM.__e(o,e.__v)}})),h&&h(e,t)},a.YM.unmount=function(e){f&&f(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach((function(e){try{C(e)}catch(e){t=e}})),t&&a.YM.__e(t,n.__v))};var j="function"==typeof requestAnimationFrame;function C(e){var t=i,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),i=t}function T(e){var t=i;e.__c=e.__(),i=t}function D(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function N(e,t){return"function"==typeof t?t(e):t}function O(e,t){for(var n in t)e[n]=t[n];return e}function M(e,t){for(var n in e)if("__source"!==n&&!(n in t))return!0;for(var r in t)if("__source"!==r&&e[r]!==t[r])return!0;return!1}function A(e){this.props=e}function R(e,t){function n(e){var n=this.props.ref,r=n==e.ref;return!r&&n&&(n.call?n(null):n.current=null),t?!t(this.props,e)||!r:M(this.props,e)}function r(t){return this.shouldComponentUpdate=n,(0,a.az)(e,t)}return r.displayName="Memo("+(e.displayName||e.name)+")",r.prototype.isReactComponent=!0,r.__f=!0,r}(A.prototype=new a.wA).isPureReactComponent=!0,A.prototype.shouldComponentUpdate=function(e,t){return M(this.props,e)||M(this.state,t)};var I=a.YM.__b;a.YM.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),I&&I(e)};var L="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function B(e){function t(t,n){var r=O({},t);return delete r.ref,e(r,(n=t.ref||n)&&("object"!=typeof n||"current"in n)?n:null)}return t.$$typeof=L,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var F=function(e,t){return null==e?null:(0,a.bR)((0,a.bR)(e).map(t))},z={map:F,forEach:F,count:function(e){return e?(0,a.bR)(e).length:0},only:function(e){var t=(0,a.bR)(e);if(1!==t.length)throw"Children.only";return t[0]},toArray:a.bR},V=a.YM.__e;a.YM.__e=function(e,t,n){if(e.then)for(var r,i=t;i=i.__;)if((r=i.__c)&&r.__c)return null==t.__e&&(t.__e=n.__e,t.__k=n.__k),r.__c(e,t);V(e,t,n)};var G=a.YM.unmount;function H(){this.__u=0,this.t=null,this.__b=null}function W(e){var t=e.__.__c;return t&&t.__e&&t.__e(e)}function q(e){var t,n,r;function i(i){if(t||(t=e()).then((function(e){n=e.default||e}),(function(e){r=e})),r)throw r;if(!n)throw t;return(0,a.az)(n,i)}return i.displayName="Lazy",i.__f=!0,i}function Y(){this.u=null,this.o=null}a.YM.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&!0===e.__h&&(e.type=null),G&&G(e)},(H.prototype=new a.wA).__c=function(e,t){var n=t.__c,r=this;null==r.t&&(r.t=[]),r.t.push(n);var i=W(r.__v),o=!1,a=function(){o||(o=!0,n.__R=null,i?i(s):s())};n.__R=a;var s=function(){if(!--r.__u){if(r.state.__e){var e=r.state.__e;r.__v.__k[0]=function e(t,n,r){return t&&(t.__v=null,t.__k=t.__k&&t.__k.map((function(t){return e(t,n,r)})),t.__c&&t.__c.__P===n&&(t.__e&&r.insertBefore(t.__e,t.__d),t.__c.__e=!0,t.__c.__P=r)),t}(e,e.__c.__P,e.__c.__O)}var t;for(r.setState({__e:r.__b=null});t=r.t.pop();)t.forceUpdate()}},l=!0===t.__h;r.__u++||l||r.setState({__e:r.__b=r.__v.__k[0]}),e.then(a,a)},H.prototype.componentWillUnmount=function(){this.t=[]},H.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=function e(t,n,r){return t&&(t.__c&&t.__c.__H&&(t.__c.__H.__.forEach((function(e){"function"==typeof e.__c&&e.__c()})),t.__c.__H=null),null!=(t=O({},t)).__c&&(t.__c.__P===r&&(t.__c.__P=n),t.__c=null),t.__k=t.__k&&t.__k.map((function(t){return e(t,n,r)}))),t}(this.__b,n,r.__O=r.__P)}this.__b=null}var i=t.__e&&(0,a.az)(a.HY,null,e.fallback);return i&&(i.__h=null),[(0,a.az)(a.HY,null,t.__e?null:e.children),i]};var U=function(e,t,n){if(++n[1]===n[0]&&e.o.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.o.size))for(n=e.u;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.u=n=n[2]}};function X(e){return this.getChildContext=function(){return e.context},e.children}function $(e){var t=this,n=e.i;t.componentWillUnmount=function(){(0,a.sY)(null,t.l),t.l=null,t.i=null},t.i&&t.i!==n&&t.componentWillUnmount(),e.__v?(t.l||(t.i=n,t.l={nodeType:1,parentNode:n,childNodes:[],appendChild:function(e){this.childNodes.push(e),t.i.appendChild(e)},insertBefore:function(e,n){this.childNodes.push(e),t.i.appendChild(e)},removeChild:function(e){this.childNodes.splice(this.childNodes.indexOf(e)>>>1,1),t.i.removeChild(e)}}),(0,a.sY)((0,a.az)(X,{context:t.context},e.__v),t.l)):t.l&&t.componentWillUnmount()}function K(e,t){return(0,a.az)($,{__v:e,i:t})}(Y.prototype=new a.wA).__e=function(e){var t=this,n=W(t.__v),r=t.o.get(e);return r[0]++,function(i){var o=function(){t.props.revealOrder?(r.push(i),U(t,e,r)):i()};n?n(o):o()}},Y.prototype.render=function(e){this.u=null,this.o=new Map;var t=(0,a.bR)(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var n=t.length;n--;)this.o.set(t[n],this.u=[1,0,this.u]);return e.children},Y.prototype.componentDidUpdate=Y.prototype.componentDidMount=function(){var e=this;this.o.forEach((function(t,n){U(e,n,t)}))};var Z="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,Q=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|marker(?!H|W|U)|overline|paint|stop|strikethrough|stroke|text(?!L)|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,J="undefined"!=typeof document,ee=function(e){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/i:/fil|che|ra/i).test(e)};function te(e,t,n){return null==t.__k&&(t.textContent=""),(0,a.sY)(e,t),"function"==typeof n&&n(),e?e.__c:null}function ne(e,t,n){return(0,a.ZB)(e,t),"function"==typeof n&&n(),e?e.__c:null}a.wA.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach((function(e){Object.defineProperty(a.wA.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})}));var re=a.YM.event;function ie(){}function oe(){return this.cancelBubble}function ae(){return this.defaultPrevented}a.YM.event=function(e){return re&&(e=re(e)),e.persist=ie,e.isPropagationStopped=oe,e.isDefaultPrevented=ae,e.nativeEvent=e};var se,le={configurable:!0,get:function(){return this.class}},ce=a.YM.vnode;a.YM.vnode=function(e){var t=e.type,n=e.props,r=n;if("string"==typeof t){var i=-1===t.indexOf("-");for(var o in r={},n){var s=n[o];J&&"children"===o&&"noscript"===t||"value"===o&&"defaultValue"in n&&null==s||("defaultValue"===o&&"value"in n&&null==n.value?o="value":"download"===o&&!0===s?s="":/ondoubleclick/i.test(o)?o="ondblclick":/^onchange(textarea|input)/i.test(o+t)&&!ee(n.type)?o="oninput":/^onfocus$/i.test(o)?o="onfocusin":/^onblur$/i.test(o)?o="onfocusout":/^on(Ani|Tra|Tou|BeforeInp)/.test(o)?o=o.toLowerCase():i&&Q.test(o)?o=o.replace(/[A-Z0-9]/,"-$&").toLowerCase():null===s&&(s=void 0),r[o]=s)}"select"==t&&r.multiple&&Array.isArray(r.value)&&(r.value=(0,a.bR)(n.children).forEach((function(e){e.props.selected=-1!=r.value.indexOf(e.props.value)}))),"select"==t&&null!=r.defaultValue&&(r.value=(0,a.bR)(n.children).forEach((function(e){e.props.selected=r.multiple?-1!=r.defaultValue.indexOf(e.props.value):r.defaultValue==e.props.value}))),e.props=r,n.class!=n.className&&(le.enumerable="className"in n,null!=n.className&&(r.class=n.className),Object.defineProperty(r,"className",le))}e.$$typeof=Z,ce&&ce(e)};var ue=a.YM.__r;a.YM.__r=function(e){ue&&ue(e),se=e.__c};var de={ReactCurrentDispatcher:{current:{readContext:function(e){return se.__n[e.__c].props.value}}}},he="17.0.2";function fe(e){return a.az.bind(null,e)}function pe(e){return!!e&&e.$$typeof===Z}function ve(e){return pe(e)?a.Tm.apply(null,arguments):e}function ge(e){return!!e.__k&&((0,a.sY)(null,e),!0)}function me(e){return e&&(e.base||1===e.nodeType&&e)||null}var ye=function(e,t){return e(t)},be=function(e,t){return e(t)},xe=a.HY;const we={useState:v,useReducer:g,useEffect:m,useLayoutEffect:y,useRef:b,useImperativeHandle:x,useMemo:w,useCallback:E,useContext:_,useDebugValue:k,version:"17.0.2",Children:z,render:te,hydrate:ne,unmountComponentAtNode:ge,createPortal:K,createElement:a.az,createContext:a.kr,createFactory:fe,cloneElement:ve,createRef:a.Vf,Fragment:a.HY,isValidElement:pe,findDOMNode:me,Component:a.wA,PureComponent:A,memo:R,forwardRef:B,flushSync:be,unstable_batchedUpdates:ye,StrictMode:a.HY,Suspense:H,SuspenseList:Y,lazy:q,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:de}},33847:(e,t,n)=>{"use strict";n.d(t,{HY:()=>y,Tm:()=>z,Vf:()=>m,YM:()=>i,ZB:()=>F,az:()=>v,bR:()=>P,kr:()=>V,sY:()=>B,wA:()=>b});var r,i,o,a,s,l,c,u={},d=[],h=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function f(e,t){for(var n in t)e[n]=t[n];return e}function p(e){var t=e.parentNode;t&&t.removeChild(e)}function v(e,t,n){var i,o,a,s={};for(a in t)"key"==a?i=t[a]:"ref"==a?o=t[a]:s[a]=t[a];if(arguments.length>2&&(s.children=arguments.length>3?r.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(a in e.defaultProps)void 0===s[a]&&(s[a]=e.defaultProps[a]);return g(e,s,i,o,null)}function g(e,t,n,r,a){var s={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==a?++o:a};return null==a&&null!=i.vnode&&i.vnode(s),s}function m(){return{current:null}}function y(e){return e.children}function b(e,t){this.props=e,this.context=t}function x(e,t){if(null==t)return e.__?x(e.__,e.__.__k.indexOf(e)+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?x(e):null}function w(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return w(e)}}function E(e){(!e.__d&&(e.__d=!0)&&a.push(e)&&!_.__r++||l!==i.debounceRendering)&&((l=i.debounceRendering)||s)(_)}function _(){for(var e;_.__r=a.length;)e=a.sort((function(e,t){return e.__v.__b-t.__v.__b})),a=[],e.some((function(e){var t,n,r,i,o,a;e.__d&&(o=(i=(t=e).__v).__e,(a=t.__P)&&(n=[],(r=f({},i)).__v=i.__v+1,O(a,i,r,t.__n,void 0!==a.ownerSVGElement,null!=i.__h?[o]:null,n,null==o?x(i):o,i.__h),M(n,i),i.__e!=o&&w(i)))}))}function k(e,t,n,r,i,o,a,s,l,c){var h,f,p,v,m,b,w,E=r&&r.__k||d,_=E.length;for(n.__k=[],h=0;h<t.length;h++)if(null!=(v=n.__k[h]=null==(v=t[h])||"boolean"==typeof v?null:"string"==typeof v||"number"==typeof v||"bigint"==typeof v?g(null,v,null,null,v):Array.isArray(v)?g(y,{children:v},null,null,null):v.__b>0?g(v.type,v.props,v.key,null,v.__v):v)){if(v.__=n,v.__b=n.__b+1,null===(p=E[h])||p&&v.key==p.key&&v.type===p.type)E[h]=void 0;else for(f=0;f<_;f++){if((p=E[f])&&v.key==p.key&&v.type===p.type){E[f]=void 0;break}p=null}O(e,v,p=p||u,i,o,a,s,l,c),m=v.__e,(f=v.ref)&&p.ref!=f&&(w||(w=[]),p.ref&&w.push(p.ref,null,v),w.push(f,v.__c||m,v)),null!=m?(null==b&&(b=m),"function"==typeof v.type&&v.__k===p.__k?v.__d=l=S(v,l,e):l=j(e,v,p,E,m,l),"function"==typeof n.type&&(n.__d=l)):l&&p.__e==l&&l.parentNode!=e&&(l=x(p))}for(n.__e=b,h=_;h--;)null!=E[h]&&("function"==typeof n.type&&null!=E[h].__e&&E[h].__e==n.__d&&(n.__d=x(r,h+1)),I(E[h],E[h]));if(w)for(h=0;h<w.length;h++)R(w[h],w[++h],w[++h])}function S(e,t,n){for(var r,i=e.__k,o=0;i&&o<i.length;o++)(r=i[o])&&(r.__=e,t="function"==typeof r.type?S(r,t,n):j(n,r,r,i,r.__e,t));return t}function P(e,t){return t=t||[],null==e||"boolean"==typeof e||(Array.isArray(e)?e.some((function(e){P(e,t)})):t.push(e)),t}function j(e,t,n,r,i,o){var a,s,l;if(void 0!==t.__d)a=t.__d,t.__d=void 0;else if(null==n||i!=o||null==i.parentNode)e:if(null==o||o.parentNode!==e)e.appendChild(i),a=null;else{for(s=o,l=0;(s=s.nextSibling)&&l<r.length;l+=2)if(s==i)break e;e.insertBefore(i,o),a=o}return void 0!==a?a:i.nextSibling}function C(e,t,n){"-"===t[0]?e.setProperty(t,n):e[t]=null==n?"":"number"!=typeof n||h.test(t)?n:n+"px"}function T(e,t,n,r,i){var o;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||C(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||C(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])o=t!==(t=t.replace(/Capture$/,"")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=n,n?r||e.addEventListener(t,o?N:D,o):e.removeEventListener(t,o?N:D,o);else if("dangerouslySetInnerHTML"!==t){if(i)t=t.replace(/xlink[H:h]/,"h").replace(/sName$/,"s");else if("href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null!=n&&(!1!==n||"a"===t[0]&&"r"===t[1])?e.setAttribute(t,n):e.removeAttribute(t))}}function D(e){this.l[e.type+!1](i.event?i.event(e):e)}function N(e){this.l[e.type+!0](i.event?i.event(e):e)}function O(e,t,n,r,o,a,s,l,c){var u,d,h,p,v,g,m,x,w,E,_,S=t.type;if(void 0!==t.constructor)return null;null!=n.__h&&(c=n.__h,l=t.__e=n.__e,t.__h=null,a=[l]),(u=i.__b)&&u(t);try{e:if("function"==typeof S){if(x=t.props,w=(u=S.contextType)&&r[u.__c],E=u?w?w.props.value:u.__:r,n.__c?m=(d=t.__c=n.__c).__=d.__E:("prototype"in S&&S.prototype.render?t.__c=d=new S(x,E):(t.__c=d=new b(x,E),d.constructor=S,d.render=L),w&&w.sub(d),d.props=x,d.state||(d.state={}),d.context=E,d.__n=r,h=d.__d=!0,d.__h=[]),null==d.__s&&(d.__s=d.state),null!=S.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=f({},d.__s)),f(d.__s,S.getDerivedStateFromProps(x,d.__s))),p=d.props,v=d.state,h)null==S.getDerivedStateFromProps&&null!=d.componentWillMount&&d.componentWillMount(),null!=d.componentDidMount&&d.__h.push(d.componentDidMount);else{if(null==S.getDerivedStateFromProps&&x!==p&&null!=d.componentWillReceiveProps&&d.componentWillReceiveProps(x,E),!d.__e&&null!=d.shouldComponentUpdate&&!1===d.shouldComponentUpdate(x,d.__s,E)||t.__v===n.__v){d.props=x,d.state=d.__s,t.__v!==n.__v&&(d.__d=!1),d.__v=t,t.__e=n.__e,t.__k=n.__k,t.__k.forEach((function(e){e&&(e.__=t)})),d.__h.length&&s.push(d);break e}null!=d.componentWillUpdate&&d.componentWillUpdate(x,d.__s,E),null!=d.componentDidUpdate&&d.__h.push((function(){d.componentDidUpdate(p,v,g)}))}d.context=E,d.props=x,d.state=d.__s,(u=i.__r)&&u(t),d.__d=!1,d.__v=t,d.__P=e,u=d.render(d.props,d.state,d.context),d.state=d.__s,null!=d.getChildContext&&(r=f(f({},r),d.getChildContext())),h||null==d.getSnapshotBeforeUpdate||(g=d.getSnapshotBeforeUpdate(p,v)),_=null!=u&&u.type===y&&null==u.key?u.props.children:u,k(e,Array.isArray(_)?_:[_],t,n,r,o,a,s,l,c),d.base=t.__e,t.__h=null,d.__h.length&&s.push(d),m&&(d.__E=d.__=null),d.__e=!1}else null==a&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=A(n.__e,t,n,r,o,a,s,c);(u=i.diffed)&&u(t)}catch(e){t.__v=null,(c||null!=a)&&(t.__e=l,t.__h=!!c,a[a.indexOf(l)]=null),i.__e(e,t,n)}}function M(e,t){i.__c&&i.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){i.__e(e,t.__v)}}))}function A(e,t,n,i,o,a,s,l){var c,d,h,f=n.props,v=t.props,g=t.type,m=0;if("svg"===g&&(o=!0),null!=a)for(;m<a.length;m++)if((c=a[m])&&"setAttribute"in c==!!g&&(g?c.localName===g:3===c.nodeType)){e=c,a[m]=null;break}if(null==e){if(null===g)return document.createTextNode(v);e=o?document.createElementNS("http://www.w3.org/2000/svg",g):document.createElement(g,v.is&&v),a=null,l=!1}if(null===g)f===v||l&&e.data===v||(e.data=v);else{if(a=a&&r.call(e.childNodes),d=(f=n.props||u).dangerouslySetInnerHTML,h=v.dangerouslySetInnerHTML,!l){if(null!=a)for(f={},m=0;m<e.attributes.length;m++)f[e.attributes[m].name]=e.attributes[m].value;(h||d)&&(h&&(d&&h.__html==d.__html||h.__html===e.innerHTML)||(e.innerHTML=h&&h.__html||""))}if(function(e,t,n,r,i){var o;for(o in n)"children"===o||"key"===o||o in t||T(e,o,null,n[o],r);for(o in t)i&&"function"!=typeof t[o]||"children"===o||"key"===o||"value"===o||"checked"===o||n[o]===t[o]||T(e,o,t[o],n[o],r)}(e,v,f,o,l),h)t.__k=[];else if(m=t.props.children,k(e,Array.isArray(m)?m:[m],t,n,i,o&&"foreignObject"!==g,a,s,a?a[0]:n.__k&&x(n,0),l),null!=a)for(m=a.length;m--;)null!=a[m]&&p(a[m]);l||("value"in v&&void 0!==(m=v.value)&&(m!==f.value||m!==e.value||"progress"===g&&!m)&&T(e,"value",m,f.value,!1),"checked"in v&&void 0!==(m=v.checked)&&m!==e.checked&&T(e,"checked",m,f.checked,!1))}return e}function R(e,t,n){try{"function"==typeof e?e(t):e.current=t}catch(e){i.__e(e,n)}}function I(e,t,n){var r,o;if(i.unmount&&i.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||R(r,null,t)),null!=(r=e.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){i.__e(e,t)}r.base=r.__P=null}if(r=e.__k)for(o=0;o<r.length;o++)r[o]&&I(r[o],t,"function"!=typeof e.type);n||null==e.__e||p(e.__e),e.__e=e.__d=void 0}function L(e,t,n){return this.constructor(e,n)}function B(e,t,n){var o,a,s;i.__&&i.__(e,t),a=(o="function"==typeof n)?null:n&&n.__k||t.__k,s=[],O(t,e=(!o&&n||t).__k=v(y,null,[e]),a||u,u,void 0!==t.ownerSVGElement,!o&&n?[n]:a?null:t.firstChild?r.call(t.childNodes):null,s,!o&&n?n:a?a.__e:t.firstChild,o),M(s,e)}function F(e,t){B(e,t,F)}function z(e,t,n){var i,o,a,s=f({},e.props);for(a in t)"key"==a?i=t[a]:"ref"==a?o=t[a]:s[a]=t[a];return arguments.length>2&&(s.children=arguments.length>3?r.call(arguments,2):n),g(e.type,s,i||e.key,o||e.ref,null)}function V(e,t){var n={__c:t="__cC"+c++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var n,r;return this.getChildContext||(n=[],(r={})[t]=this,this.getChildContext=function(){return r},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&n.some(E)},this.sub=function(e){n.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n.splice(n.indexOf(e),1),t&&t.call(e)}}),e.children}};return n.Provider.__=n.Consumer.contextType=n}r=d.slice,i={__e:function(e,t){for(var n,r,i;t=t.__;)if((n=t.__c)&&!n.__)try{if((r=n.constructor)&&null!=r.getDerivedStateFromError&&(n.setState(r.getDerivedStateFromError(e)),i=n.__d),null!=n.componentDidCatch&&(n.componentDidCatch(e),i=n.__d),i)return n.__E=n}catch(t){e=t}throw e}},o=0,b.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=f({},this.state),"function"==typeof e&&(e=e(f({},n),this.props)),e&&f(n,e),null!=e&&this.__v&&(t&&this.__h.push(t),E(this))},b.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),E(this))},b.prototype.render=y,a=[],s="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,_.__r=0,c=0},20452:(e,t,n)=>{"use strict";var r=n(12139);var i="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=r.useState,a=r.useEffect,s=r.useLayoutEffect,l=r.useDebugValue;function c(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!i(e,n)}catch(r){return!0}}var u="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),r=o({inst:{value:n,getSnapshot:t}}),i=r[0].inst,u=r[1];return s((function(){i.value=n,i.getSnapshot=t,c(i)&&u({inst:i})}),[e,n,t]),a((function(){return c(i)&&u({inst:i}),e((function(){c(i)&&u({inst:i})}))}),[e]),l(n),n};t.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:u},80402:(e,t,n)=>{"use strict";var r=n(12139),i=n(43100);var o="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},a=i.useSyncExternalStore,s=r.useRef,l=r.useEffect,c=r.useMemo,u=r.useDebugValue;t.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var d=s(null);if(null===d.current){var h={hasValue:!1,value:null};d.current=h}else h=d.current;d=c((function(){function e(e){if(!l){if(l=!0,a=e,e=r(e),void 0!==i&&h.hasValue){var t=h.value;if(i(t,e))return s=t}return s=e}if(t=s,o(a,e))return t;var n=r(e);return void 0!==i&&i(t,n)?t:(a=e,s=n)}var a,s,l=!1,c=void 0===n?null:n;return[function(){return e(t())},null===c?void 0:function(){return e(c())}]}),[t,n,r,i]);var f=a(e,d[0],d[1]);return l((function(){h.hasValue=!0,h.value=f}),[f]),u(f),f}},43100:(e,t,n)=>{"use strict";e.exports=n(20452)},41110:(e,t,n)=>{"use strict";e.exports=n(80402)},19140:(e,t,n)=>{"use strict";n.d(t,{Xg:()=>l,f3:()=>c,mu:()=>s,vk:()=>u});var r=n(70572),i=n(70049),o=n(80237);function a(e){var t;return(t={id:e,send:function(){},subscribe:function(){return{unsubscribe:function(){}}},getSnapshot:function(){},toJSON:function(){return{id:e}}})[i.L$]=function(){return this},t}function s(e,t,n,r){var o,s=(0,i.j)(e.src),c=null===(o=null==t?void 0:t.options.services)||void 0===o?void 0:o[s.type],u=e.data?(0,i.QX)(e.data,n,r):void 0,d=c?l(c,e.id,u):a(e.id);return d.meta=e,d}function l(e,t,n){var r=a(t);if(r.deferred=!0,(0,i.O4)(e)){var s=r.state=(0,o.J)(void 0,(function(){return(n?e.withContext(n):e).initialState}));r.getSnapshot=function(){return s}}return r}function c(e){return function(e){try{return"function"==typeof e.send}catch(t){return!1}}(e)&&"id"in e}function u(e){var t;return(0,r.pi)(((t={subscribe:function(){return{unsubscribe:function(){}}},id:"anonymous",getSnapshot:function(){}})[i.L$]=function(){return this},t),e)}},61818:(e,t,n)=>{"use strict";n.d(t,{C:()=>s,J:()=>a});var r=n(26935),i=n(49333),o=!1;function a(e,t,n){return void 0===n&&(n=e.context),new r.n(e,t,n)}function s(e,t){return i.M||e.predictableActionArguments||o||(o=!0,console.warn("It is highly recommended to set `predictableActionArguments` to `true` when using `createMachine`. https://xstate.js.org/docs/guides/actions.html")),new r.n(e,t)}},67732:(e,t,n)=>{"use strict";n.d(t,{TL:()=>u,ZM:()=>h,j1:()=>d,j_:()=>c});var r=n(70572),i=n(84766),o=n(70049),a=n(88297),s=n(60081),l=n(49333);function c(e,t){if(e===t)return!0;if(void 0===e||void 0===t)return!1;if((0,o.HD)(e)||(0,o.HD)(t))return e===t;var n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&n.every((function(n){return c(e[n],t[n])}))}function u(e){return"object"==typeof e&&null!==e&&("value"in e&&"_event"in e)}function d(e,t){var n=e.exec;return(0,r.pi)((0,r.pi)({},e),{exec:void 0!==n?function(){return n(t.context,t.event,{action:e,state:t,_event:t._event})}:void 0})}var h=function(){function e(e){var t,n=this;this.actions=[],this.activities=i.qP,this.meta={},this.events=[],this.value=e.value,this.context=e.context,this._event=e._event,this._sessionid=e._sessionid,this.event=this._event.data,this.historyValue=e.historyValue,this.history=e.history,this.actions=e.actions||[],this.activities=e.activities||i.qP,this.meta=(0,a.xZ)(e.configuration),this.events=e.events||[],this.matches=this.matches.bind(this),this.toStrings=this.toStrings.bind(this),this.configuration=e.configuration,this.transitions=e.transitions,this.children=e.children,this.done=!!e.done,this.tags=null!==(t=Array.isArray(e.tags)?new Set(e.tags):e.tags)&&void 0!==t?t:new Set,this.machine=e.machine,Object.defineProperty(this,"nextEvents",{get:function(){return(0,a.nJ)(n.configuration)}})}return e.from=function(t,n){return t instanceof e?t.context!==n?new e({value:t.value,context:n,_event:t._event,_sessionid:null,historyValue:t.historyValue,history:t.history,actions:[],activities:t.activities,meta:{},events:[],configuration:[],transitions:[],children:{}}):t:new e({value:t,context:n,_event:s.initEvent,_sessionid:null,historyValue:void 0,history:void 0,actions:[],activities:void 0,meta:void 0,events:[],configuration:[],transitions:[],children:{}})},e.create=function(t){return new e(t)},e.inert=function(t,n){if(t instanceof e){if(!t.actions.length)return t;var r=s.initEvent;return new e({value:t.value,context:n,_event:r,_sessionid:null,historyValue:t.historyValue,history:t.history,activities:t.activities,configuration:t.configuration,transitions:[],children:{}})}return e.from(t,n)},e.prototype.toStrings=function(e,t){var n=this;if(void 0===e&&(e=this.value),void 0===t&&(t="."),(0,o.HD)(e))return[e];var i=Object.keys(e);return i.concat.apply(i,(0,r.ev)([],(0,r.CR)(i.map((function(r){return n.toStrings(e[r],t).map((function(e){return r+t+e}))}))),!1))},e.prototype.toJSON=function(){var e=this;e.configuration,e.transitions;var t=e.tags;e.machine;var n=(0,r._T)(e,["configuration","transitions","tags","machine"]);return(0,r.pi)((0,r.pi)({},n),{tags:Array.from(t)})},e.prototype.matches=function(e){return(0,o.W)(e,this.value)},e.prototype.hasTag=function(e){return this.tags.has(e)},e.prototype.can=function(e){var t;l.M&&(0,o.ZK)(!!this.machine,"state.can(...) used outside of a machine-created State object; this will always return false.");var n=null===(t=this.machine)||void 0===t?void 0:t.getTransitionData(this,e);return!!(null==n?void 0:n.transitions.length)&&n.transitions.some((function(e){return void 0!==e.target||e.actions.length}))},e}()},26935:(e,t,n)=>{"use strict";n.d(t,{n:()=>b});var r=n(70572),i=n(70049),o=n(3763),a=n(67732),s=n(20449),l=n(60081),c=n(49333),u=n(84766),d=n(88297),h=n(19140);function f(e){if("string"==typeof e){var t={type:e,toString:function(){return e}};return t}return e}function p(e){return(0,r.pi)((0,r.pi)({type:s.invoke},e),{toJSON:function(){e.onDone,e.onError;var t=(0,r._T)(e,["onDone","onError"]);return(0,r.pi)((0,r.pi)({},t),{type:s.invoke,src:f(e.src)})}})}var v="",g="*",m={},y=function(e){return"#"===e[0]},b=function(){function e(t,n,o,a){void 0===o&&(o="context"in t?t.context:void 0);var s,h=this;this.config=t,this._context=o,this.order=-1,this.__xstatenode=!0,this.__cache={events:void 0,relativeValue:new Map,initialStateValue:void 0,initialState:void 0,on:void 0,transitions:void 0,candidates:{},delayedTransitions:void 0},this.idMap={},this.tags=[],this.options=Object.assign({actions:{},guards:{},services:{},activities:{},delays:{}},n),this.parent=null==a?void 0:a.parent,this.key=this.config.key||(null==a?void 0:a.key)||this.config.id||"(machine)",this.machine=this.parent?this.parent.machine:this,this.path=this.parent?this.parent.path.concat(this.key):[],this.delimiter=this.config.delimiter||(this.parent?this.parent.delimiter:u.iS),this.id=this.config.id||(0,r.ev)([this.machine.key],(0,r.CR)(this.path),!1).join(this.delimiter),this.version=this.parent?this.parent.version:this.config.version,this.type=this.config.type||(this.config.parallel?"parallel":this.config.states&&Object.keys(this.config.states).length?"compound":this.config.history?"history":"atomic"),this.schema=this.parent?this.machine.schema:null!==(s=this.config.schema)&&void 0!==s?s:{},this.description=this.config.description,c.M||(0,i.ZK)(!("parallel"in this.config),'The "parallel" property is deprecated and will be removed in version 4.1. '.concat(this.config.parallel?"Replace with `type: 'parallel'`":"Use `type: '".concat(this.type,"'`")," in the config for state node '").concat(this.id,"' instead.")),this.initial=this.config.initial,this.states=this.config.states?(0,i.Q8)(this.config.states,(function(t,n){var i,o=new e(t,{},void 0,{parent:h,key:n});return Object.assign(h.idMap,(0,r.pi)(((i={})[o.id]=o,i),o.idMap)),o})):m;var f=0;!function e(t){var n,i;t.order=f++;try{for(var o=(0,r.XA)((0,d.nI)(t)),a=o.next();!a.done;a=o.next()){e(a.value)}}catch(s){n={error:s}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}}(this),this.history=!0===this.config.history?"shallow":this.config.history||!1,this._transient=!!this.config.always||!!this.config.on&&(Array.isArray(this.config.on)?this.config.on.some((function(e){return e.event===v})):v in this.config.on),this.strict=!!this.config.strict,this.onEntry=(0,i.qo)(this.config.entry||this.config.onEntry).map((function(e){return(0,l.toActionObject)(e)})),this.onExit=(0,i.qo)(this.config.exit||this.config.onExit).map((function(e){return(0,l.toActionObject)(e)})),this.meta=this.config.meta,this.doneData="final"===this.type?this.config.data:void 0,this.invoke=(0,i.qo)(this.config.invoke).map((function(e,t){var n,o;if((0,i.O4)(e)){var a=(0,i.bx)(h.id,t);return h.machine.options.services=(0,r.pi)(((n={})[a]=e,n),h.machine.options.services),p({src:a,id:a})}if((0,i.HD)(e.src)){a=e.id||(0,i.bx)(h.id,t);return p((0,r.pi)((0,r.pi)({},e),{id:a,src:e.src}))}if((0,i.O4)(e.src)||(0,i.mf)(e.src)){a=e.id||(0,i.bx)(h.id,t);return h.machine.options.services=(0,r.pi)(((o={})[a]=e.src,o),h.machine.options.services),p((0,r.pi)((0,r.pi)({id:a},e),{src:a}))}var s=e.src;return p((0,r.pi)((0,r.pi)({id:(0,i.bx)(h.id,t)},e),{src:s}))})),this.activities=(0,i.qo)(this.config.activities).concat(this.invoke).map((function(e){return(0,l.toActivityDefinition)(e)})),this.transition=this.transition.bind(this),this.tags=(0,i.qo)(this.config.tags)}return e.prototype._init=function(){this.__cache.transitions||(0,d.ac)(this).forEach((function(e){return e.on}))},e.prototype.withConfig=function(t,n){var i=this.options,o=i.actions,a=i.activities,s=i.guards,l=i.services,c=i.delays;return new e(this.config,{actions:(0,r.pi)((0,r.pi)({},o),t.actions),activities:(0,r.pi)((0,r.pi)({},a),t.activities),guards:(0,r.pi)((0,r.pi)({},s),t.guards),services:(0,r.pi)((0,r.pi)({},l),t.services),delays:(0,r.pi)((0,r.pi)({},c),t.delays)},null!=n?n:this.context)},e.prototype.withContext=function(t){return new e(this.config,this.options,t)},Object.defineProperty(e.prototype,"context",{get:function(){return(0,i.mf)(this._context)?this._context():this._context},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"definition",{get:function(){return{id:this.id,key:this.key,version:this.version,context:this.context,type:this.type,initial:this.initial,history:this.history,states:(0,i.Q8)(this.states,(function(e){return e.definition})),on:this.on,transitions:this.transitions,entry:this.onEntry,exit:this.onExit,activities:this.activities||[],meta:this.meta,order:this.order||-1,data:this.doneData,invoke:this.invoke,description:this.description,tags:this.tags}},enumerable:!1,configurable:!0}),e.prototype.toJSON=function(){return this.definition},Object.defineProperty(e.prototype,"on",{get:function(){if(this.__cache.on)return this.__cache.on;var e=this.transitions;return this.__cache.on=e.reduce((function(e,t){return e[t.eventType]=e[t.eventType]||[],e[t.eventType].push(t),e}),{})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"after",{get:function(){return this.__cache.delayedTransitions||(this.__cache.delayedTransitions=this.getDelayedTransitions(),this.__cache.delayedTransitions)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"transitions",{get:function(){return this.__cache.transitions||(this.__cache.transitions=this.formatTransitions(),this.__cache.transitions)},enumerable:!1,configurable:!0}),e.prototype.getCandidates=function(e){if(this.__cache.candidates[e])return this.__cache.candidates[e];var t=e===v,n=this.transitions.filter((function(n){var r=n.eventType===e;return t?r:r||n.eventType===g}));return this.__cache.candidates[e]=n,n},e.prototype.getDelayedTransitions=function(){var e=this,t=this.config.after;if(!t)return[];var n=function(t,n){var r=(0,i.mf)(t)?"".concat(e.id,":delay[").concat(n,"]"):t,o=(0,l.after)(r,e.id);return e.onEntry.push((0,l.send)(o,{delay:t})),e.onExit.push((0,l.cancel)(o)),o};return((0,i.kJ)(t)?t.map((function(e,t){var i=n(e.delay,t);return(0,r.pi)((0,r.pi)({},e),{event:i})})):(0,i.xH)(Object.keys(t).map((function(e,o){var a=t[e],s=(0,i.HD)(a)?{target:a}:a,l=isNaN(+e)?e:+e,c=n(l,o);return(0,i.qo)(s).map((function(e){return(0,r.pi)((0,r.pi)({},e),{event:c,delay:l})}))})))).map((function(t){var n=t.delay;return(0,r.pi)((0,r.pi)({},e.formatTransition(t)),{delay:n})}))},e.prototype.getStateNodes=function(e){var t,n=this;if(!e)return[];var o=e instanceof a.ZM?e.value:(0,i.WM)(e,this.delimiter);if((0,i.HD)(o)){var s=this.getStateNode(o).initial;return void 0!==s?this.getStateNodes(((t={})[o]=s,t)):[this,this.states[o]]}var l=Object.keys(o),c=[this];return c.push.apply(c,(0,r.ev)([],(0,r.CR)((0,i.xH)(l.map((function(e){return n.getStateNode(e).getStateNodes(o[e])})))),!1)),c},e.prototype.handles=function(e){var t=(0,i.x6)(e);return this.events.includes(t)},e.prototype.resolveState=function(e){var t=e instanceof a.ZM?e:a.ZM.create(e),n=Array.from((0,d.P_)([],this.getStateNodes(t.value)));return new a.ZM((0,r.pi)((0,r.pi)({},t),{value:this.resolve(t.value),configuration:n,done:(0,d.Ij)(n,this),tags:(0,d.Oe)(n),machine:this.machine}))},e.prototype.transitionLeafNode=function(e,t,n){var r=this.getStateNode(e).next(t,n);return r&&r.transitions.length?r:this.next(t,n)},e.prototype.transitionCompoundNode=function(e,t,n){var r=Object.keys(e),i=this.getStateNode(r[0])._transition(e[r[0]],t,n);return i&&i.transitions.length?i:this.next(t,n)},e.prototype.transitionParallelNode=function(e,t,n){var o,a,s={};try{for(var l=(0,r.XA)(Object.keys(e)),c=l.next();!c.done;c=l.next()){var u=c.value,d=e[u];if(d){var h=this.getStateNode(u)._transition(d,t,n);h&&(s[u]=h)}}}catch(m){o={error:m}}finally{try{c&&!c.done&&(a=l.return)&&a.call(l)}finally{if(o)throw o.error}}var f=Object.keys(s).map((function(e){return s[e]})),p=(0,i.xH)(f.map((function(e){return e.transitions})));if(!f.some((function(e){return e.transitions.length>0})))return this.next(t,n);var v=(0,i.xH)(f.map((function(e){return e.entrySet}))),g=(0,i.xH)(Object.keys(s).map((function(e){return s[e].configuration})));return{transitions:p,entrySet:v,exitSet:(0,i.xH)(f.map((function(e){return e.exitSet}))),configuration:g,source:t,actions:(0,i.xH)(Object.keys(s).map((function(e){return s[e].actions})))}},e.prototype._transition=function(e,t,n){return(0,i.HD)(e)?this.transitionLeafNode(e,t,n):1===Object.keys(e).length?this.transitionCompoundNode(e,t,n):this.transitionParallelNode(e,t,n)},e.prototype.getTransitionData=function(e,t){return this._transition(e.value,e,(0,i.g5)(t))},e.prototype.next=function(e,t){var n,o,a,s=this,l=t.name,c=[],u=[];try{for(var d=(0,r.XA)(this.getCandidates(l)),h=d.next();!h.done;h=d.next()){var f=h.value,p=f.cond,v=f.in,g=e.context,m=!v||((0,i.HD)(v)&&y(v)?e.matches((0,i.WM)(this.getStateNodeById(v).path,this.delimiter)):(0,i.W)((0,i.WM)(v,this.delimiter),(0,i.ET)(this.path.slice(0,-2))(e.value))),b=!1;try{b=!p||(0,i.vx)(this.machine,p,g,t,e)}catch(_){throw new Error("Unable to evaluate guard '".concat(p.name||p.type,"' in transition for event '").concat(l,"' in state node '").concat(this.id,"':\n").concat(_.message))}if(b&&m){void 0!==f.target&&(u=f.target),c.push.apply(c,(0,r.ev)([],(0,r.CR)(f.actions),!1)),a=f;break}}}catch(k){n={error:k}}finally{try{h&&!h.done&&(o=d.return)&&o.call(d)}finally{if(n)throw n.error}}if(a){if(!u.length)return{transitions:[a],entrySet:[],exitSet:[],configuration:e.value?[this]:[],source:e,actions:c};var x=(0,i.xH)(u.map((function(t){return s.getRelativeStateNodes(t,e.historyValue)}))),w=!!a.internal,E=[];return w||u.forEach((function(e){E.push.apply(E,(0,r.ev)([],(0,r.CR)(s.getExternalReentryNodes(e)),!1))})),{transitions:[a],entrySet:E,exitSet:w?[]:[this],configuration:x,source:e,actions:c}}},e.prototype.getExternalReentryNodes=function(e){for(var t=[],n=(0,r.CR)(e.order>this.order?[e,this]:[this,e],2),i=n[0],o=n[1];i&&i!==o;)t.push(i),i=i.parent;return i!==o?[]:(t.push(o),t)},e.prototype.getActions=function(e,t,n,a,c,u,h){var f,p,v,g,m=this,y=(0,d.P_)([],u?this.getStateNodes(u.value):[this]);try{for(var b=(0,r.XA)(e),x=b.next();!x.done;x=b.next()){var w=x.value;(!(0,d.e$)(y,w)||(0,d.e$)(n.entrySet,w.parent)&&!(0,d.e$)(n.entrySet,w))&&n.entrySet.push(w)}}catch(D){f={error:D}}finally{try{x&&!x.done&&(p=b.return)&&p.call(b)}finally{if(f)throw f.error}}try{for(var E=(0,r.XA)(y),_=E.next();!_.done;_=E.next()){w=_.value;(0,d.e$)(e,w)&&!(0,d.e$)(n.exitSet,w.parent)||n.exitSet.push(w)}}catch(N){v={error:N}}finally{try{_&&!_.done&&(g=E.return)&&g.call(E)}finally{if(v)throw v.error}}var k=(0,i.xH)(n.entrySet.map((function(e){var t=[];if("final"!==e.type)return t;var r=e.parent;if(!r.parent)return t;t.push((0,l.done)(e.id,e.doneData),(0,l.done)(r.id,e.doneData?(0,i.QX)(e.doneData,a,c):void 0));var o=r.parent;return"parallel"===o.type&&(0,d.G)(o).every((function(e){return(0,d.Ij)(n.configuration,e)}))&&t.push((0,l.done)(o.id)),t})));n.exitSet.sort((function(e,t){return t.order-e.order})),n.entrySet.sort((function(e,t){return e.order-t.order}));var S=new Set(n.entrySet),P=new Set(n.exitSet),j=Array.from(S).map((function(e){var t=e.onEntry,n=e.activities.map((function(e){return(0,l.start)(e)}));return(0,l.toActionObjects)(h?(0,r.ev)((0,r.ev)([],(0,r.CR)(t),!1),(0,r.CR)(n),!1):(0,r.ev)((0,r.ev)([],(0,r.CR)(n),!1),(0,r.CR)(t),!1),m.machine.options.actions)})).concat([k.map(l.raise)]),C=Array.from(P).map((function(e){return(0,l.toActionObjects)((0,r.ev)((0,r.ev)([],(0,r.CR)(e.onExit),!1),(0,r.CR)(e.activities.map((function(e){return(0,l.stop)(e)}))),!1),m.machine.options.actions)})).concat([(0,l.toActionObjects)(n.actions,this.machine.options.actions)]).concat(j);if(t){var T=(0,l.toActionObjects)((0,i.xH)((0,r.ev)([],(0,r.CR)(e),!1).sort((function(e,t){return t.order-e.order})).map((function(e){return e.onExit}))),this.machine.options.actions).filter((function(e){return e.type!==s.raise&&(e.type!==s.send||!!e.to&&e.to!==o.K.Internal)}));return C.concat([T])}return C},e.prototype.transition=function(e,t,n,o){void 0===e&&(e=this.initialState);var s,l=(0,i.g5)(t);if(e instanceof a.ZM)s=void 0===n?e:this.resolveState(a.ZM.from(e,n));else{var u=(0,i.HD)(e)?this.resolve((0,i.on)(this.getResolvedPath(e))):this.resolve(e),h=null!=n?n:this.machine.context;s=this.resolveState(a.ZM.from(u,h))}if(!c.M&&l.name===g)throw new Error("An event cannot have the wildcard type ('".concat(g,"')"));if(this.strict&&!this.events.includes(l.name)&&!(0,i.JQ)(l.name))throw new Error("Machine '".concat(this.id,"' does not accept event '").concat(l.name,"'"));var f=this._transition(s.value,s,l)||{transitions:[],configuration:[],entrySet:[],exitSet:[],source:s,actions:[]},p=(0,d.P_)([],this.getStateNodes(s.value)),v=f.configuration.length?(0,d.P_)(p,f.configuration):p;return f.configuration=(0,r.ev)([],(0,r.CR)(v),!1),this.resolveTransition(f,s,s.context,o,l)},e.prototype.resolveRaisedTransition=function(e,t,n,i){var o,a=e.actions;return(e=this.transition(e,t,void 0,i))._event=n,e.event=n.data,(o=e.actions).unshift.apply(o,(0,r.ev)([],(0,r.CR)(a),!1)),e},e.prototype.resolveTransition=function(e,t,n,c,u){var f,p,g,m,y=this;void 0===u&&(u=l.initEvent);var b=e.configuration,x=!t||e.transitions.length>0,w=x?e.configuration:t?t.configuration:[],E=(0,d.Ij)(w,this),_=x?(0,d.NA)(this.machine,b):void 0,k=t?t.historyValue?t.historyValue:e.source?this.machine.historyValue(t.value):void 0:void 0,S=this.getActions(new Set(w),E,e,n,u,t,c),P=t?(0,r.pi)({},t.activities):{};try{for(var j=(0,r.XA)(S),C=j.next();!C.done;C=j.next()){var T=C.value;try{for(var D=(g=void 0,(0,r.XA)(T)),N=D.next();!N.done;N=D.next()){var O=N.value;O.type===s.start?P[O.activity.id||O.activity.type]=O:O.type===s.stop&&(P[O.activity.id||O.activity.type]=!1)}}catch(X){g={error:X}}finally{try{N&&!N.done&&(m=D.return)&&m.call(D)}finally{if(g)throw g.error}}}}catch($){f={error:$}}finally{try{C&&!C.done&&(p=j.return)&&p.call(j)}finally{if(f)throw f.error}}var M=(0,r.CR)((0,l.resolveActions)(this,t,n,u,S,c,this.machine.config.predictableActionArguments||this.machine.config.preserveActionOrder),2),A=M[0],R=M[1],I=(0,r.CR)((0,i.uK)(A,(function(e){return e.type===s.raise||e.type===s.send&&e.to===o.K.Internal})),2),L=I[0],B=I[1],F=A.filter((function(e){var t;return e.type===s.start&&(null===(t=e.activity)||void 0===t?void 0:t.type)===s.invoke})),z=F.reduce((function(e,t){return e[t.activity.id]=(0,h.mu)(t.activity,y.machine,R,u),e}),t?(0,r.pi)({},t.children):{}),V=new a.ZM({value:_||t.value,context:R,_event:u,_sessionid:t?t._sessionid:null,historyValue:_?k?(0,i.yv)(k,_):void 0:t?t.historyValue:void 0,history:!_||e.source?t:void 0,actions:_?B:[],activities:_?P:t?t.activities:{},events:[],configuration:w,transitions:e.transitions,children:z,done:E,tags:(0,d.Oe)(w),machine:this}),G=n!==R;V.changed=u.name===s.update||G;var H=V.history;H&&delete H.history;var W=!E&&(this._transient||b.some((function(e){return e._transient})));if(!(x||W&&u.name!==v))return V;var q=V;if(!E)for(W&&(q=this.resolveRaisedTransition(q,{type:s.nullEvent},u,c));L.length;){var Y=L.shift();q=this.resolveRaisedTransition(q,Y._event,u,c)}var U=q.changed||(H?!!q.actions.length||G||typeof H.value!=typeof q.value||!(0,a.j_)(q.value,H.value):void 0);return q.changed=U,q.history=H,q},e.prototype.getStateNode=function(e){if(y(e))return this.machine.getStateNodeById(e);if(!this.states)throw new Error("Unable to retrieve child state '".concat(e,"' from '").concat(this.id,"'; no child states exist."));var t=this.states[e];if(!t)throw new Error("Child state '".concat(e,"' does not exist on '").concat(this.id,"'"));return t},e.prototype.getStateNodeById=function(e){var t=y(e)?e.slice("#".length):e;if(t===this.id)return this;var n=this.machine.idMap[t];if(!n)throw new Error("Child state node '#".concat(t,"' does not exist on machine '").concat(this.id,"'"));return n},e.prototype.getStateNodeByPath=function(e){if("string"==typeof e&&y(e))try{return this.getStateNodeById(e.slice(1))}catch(o){}for(var t=(0,i.Q9)(e,this.delimiter).slice(),n=this;t.length;){var r=t.shift();if(!r.length)break;n=n.getStateNode(r)}return n},e.prototype.resolve=function(e){var t,n=this;if(!e)return this.initialStateValue||m;switch(this.type){case"parallel":return(0,i.Q8)(this.initialStateValue,(function(t,r){return t?n.getStateNode(r).resolve(e[r]||t):m}));case"compound":if((0,i.HD)(e)){var r=this.getStateNode(e);return"parallel"===r.type||"compound"===r.type?((t={})[e]=r.initialStateValue,t):e}return Object.keys(e).length?(0,i.Q8)(e,(function(e,t){return e?n.getStateNode(t).resolve(e):m})):this.initialStateValue||{};default:return e||m}},e.prototype.getResolvedPath=function(e){if(y(e)){var t=this.machine.idMap[e.slice("#".length)];if(!t)throw new Error("Unable to find state node '".concat(e,"'"));return t.path}return(0,i.Q9)(e,this.delimiter)},Object.defineProperty(e.prototype,"initialStateValue",{get:function(){var e,t;if(this.__cache.initialStateValue)return this.__cache.initialStateValue;if("parallel"===this.type)t=(0,i.ib)(this.states,(function(e){return e.initialStateValue||m}),(function(e){return!("history"===e.type)}));else if(void 0!==this.initial){if(!this.states[this.initial])throw new Error("Initial state '".concat(this.initial,"' not found on '").concat(this.key,"'"));t=(0,d.N9)(this.states[this.initial])?this.initial:((e={})[this.initial]=this.states[this.initial].initialStateValue,e)}else t={};return this.__cache.initialStateValue=t,this.__cache.initialStateValue},enumerable:!1,configurable:!0}),e.prototype.getInitialState=function(e,t){this._init();var n=this.getStateNodes(e);return this.resolveTransition({configuration:n,entrySet:n,exitSet:[],transitions:[],source:void 0,actions:[]},void 0,null!=t?t:this.machine.context,void 0)},Object.defineProperty(e.prototype,"initialState",{get:function(){var e=this.initialStateValue;if(!e)throw new Error("Cannot retrieve initial state from simple state '".concat(this.id,"'."));return this.getInitialState(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"target",{get:function(){var e;if("history"===this.type){var t=this.config;e=(0,i.HD)(t.target)&&y(t.target)?(0,i.on)(this.machine.getStateNodeById(t.target).path.slice(this.path.length-1)):t.target}return e},enumerable:!1,configurable:!0}),e.prototype.getRelativeStateNodes=function(e,t,n){return void 0===n&&(n=!0),n?"history"===e.type?e.resolveHistory(t):e.initialStateNodes:[e]},Object.defineProperty(e.prototype,"initialStateNodes",{get:function(){var e=this;if((0,d.N9)(this))return[this];if("compound"===this.type&&!this.initial)return c.M||(0,i.ZK)(!1,"Compound state node '".concat(this.id,"' has no initial state.")),[this];var t=(0,i.SA)(this.initialStateValue);return(0,i.xH)(t.map((function(t){return e.getFromRelativePath(t)})))},enumerable:!1,configurable:!0}),e.prototype.getFromRelativePath=function(e){if(!e.length)return[this];var t=(0,r.CR)(e),n=t[0],i=t.slice(1);if(!this.states)throw new Error("Cannot retrieve subPath '".concat(n,"' from node with no states"));var o=this.getStateNode(n);if("history"===o.type)return o.resolveHistory();if(!this.states[n])throw new Error("Child state '".concat(n,"' does not exist on '").concat(this.id,"'"));return this.states[n].getFromRelativePath(i)},e.prototype.historyValue=function(e){if(Object.keys(this.states).length)return{current:e||this.initialStateValue,states:(0,i.ib)(this.states,(function(t,n){if(!e)return t.historyValue();var r=(0,i.HD)(e)?void 0:e[n];return t.historyValue(r||t.initialStateValue)}),(function(e){return!e.history}))}},e.prototype.resolveHistory=function(e){var t=this;if("history"!==this.type)return[this];var n=this.parent;if(!e){var r=this.target;return r?(0,i.xH)((0,i.SA)(r).map((function(e){return n.getFromRelativePath(e)}))):n.initialStateNodes}var o=(0,i.gk)(n.path,"states")(e).current;return(0,i.HD)(o)?[n.getStateNode(o)]:(0,i.xH)((0,i.SA)(o).map((function(e){return"deep"===t.history?n.getFromRelativePath(e):[n.states[e[0]]]})))},Object.defineProperty(e.prototype,"stateIds",{get:function(){var e=this,t=(0,i.xH)(Object.keys(this.states).map((function(t){return e.states[t].stateIds})));return[this.id].concat(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"events",{get:function(){var e,t,n,i;if(this.__cache.events)return this.__cache.events;var o=this.states,a=new Set(this.ownEvents);if(o)try{for(var s=(0,r.XA)(Object.keys(o)),l=s.next();!l.done;l=s.next()){var c=o[l.value];if(c.states)try{for(var u=(n=void 0,(0,r.XA)(c.events)),d=u.next();!d.done;d=u.next()){var h=d.value;a.add("".concat(h))}}catch(f){n={error:f}}finally{try{d&&!d.done&&(i=u.return)&&i.call(u)}finally{if(n)throw n.error}}}}catch(p){e={error:p}}finally{try{l&&!l.done&&(t=s.return)&&t.call(s)}finally{if(e)throw e.error}}return this.__cache.events=Array.from(a)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ownEvents",{get:function(){var e=new Set(this.transitions.filter((function(e){return!(!e.target&&!e.actions.length&&e.internal)})).map((function(e){return e.eventType})));return Array.from(e)},enumerable:!1,configurable:!0}),e.prototype.resolveTarget=function(e){var t=this;if(void 0!==e)return e.map((function(e){if(!(0,i.HD)(e))return e;var n=e[0]===t.delimiter;if(n&&!t.parent)return t.getStateNodeByPath(e.slice(1));var r=n?t.key+e:e;if(!t.parent)return t.getStateNodeByPath(r);try{return t.parent.getStateNodeByPath(r)}catch(o){throw new Error("Invalid transition definition for state node '".concat(t.id,"':\n").concat(o.message))}}))},e.prototype.formatTransition=function(e){var t=this,n=(0,i.rg)(e.target),o="internal"in e?e.internal:!n||n.some((function(e){return(0,i.HD)(e)&&e[0]===t.delimiter})),a=this.machine.options.guards,s=this.resolveTarget(n),c=(0,r.pi)((0,r.pi)({},e),{actions:(0,l.toActionObjects)((0,i.qo)(e.actions)),cond:(0,i.Qi)(e.cond,a),target:s,source:this,internal:o,eventType:e.event,toJSON:function(){return(0,r.pi)((0,r.pi)({},c),{target:c.target?c.target.map((function(e){return"#".concat(e.id)})):void 0,source:"#".concat(t.id)})}});return c},e.prototype.formatTransitions=function(){var e,t,n,o=this;if(this.config.on)if(Array.isArray(this.config.on))n=this.config.on;else{var a=this.config.on,s=g,u=a[s],d=void 0===u?[]:u,h=(0,r._T)(a,["*"]);n=(0,i.xH)(Object.keys(h).map((function(e){c.M||e!==v||(0,i.ZK)(!1,"Empty string transition configs (e.g., `{ on: { '': ... }}`) for transient transitions are deprecated. Specify the transition in the `{ always: ... }` property instead. "+'Please check the `on` configuration for "#'.concat(o.id,'".'));var t=(0,i.jh)(e,h[e]);return c.M||function(e,t,n){var r=n.slice(0,-1).some((function(e){return!("cond"in e)&&!("in"in e)&&((0,i.HD)(e.target)||(0,i.O4)(e.target))})),o=t===v?"the transient event":"event '".concat(t,"'");(0,i.ZK)(!r,"One or more transitions for ".concat(o," on state '").concat(e.id,"' are unreachable. ")+"Make sure that the default transition is the last one defined.")}(o,e,t),t})).concat((0,i.jh)(g,d)))}else n=[];var f=this.config.always?(0,i.jh)("",this.config.always):[],p=this.config.onDone?(0,i.jh)(String((0,l.done)(this.id)),this.config.onDone):[];c.M||(0,i.ZK)(!(this.config.onDone&&!this.parent),'Root nodes cannot have an ".onDone" transition. Please check the config of "'.concat(this.id,'".'));var m=(0,i.xH)(this.invoke.map((function(e){var t=[];return e.onDone&&t.push.apply(t,(0,r.ev)([],(0,r.CR)((0,i.jh)(String((0,l.doneInvoke)(e.id)),e.onDone)),!1)),e.onError&&t.push.apply(t,(0,r.ev)([],(0,r.CR)((0,i.jh)(String((0,l.error)(e.id)),e.onError)),!1)),t}))),y=this.after,b=(0,i.xH)((0,r.ev)((0,r.ev)((0,r.ev)((0,r.ev)([],(0,r.CR)(p),!1),(0,r.CR)(m),!1),(0,r.CR)(n),!1),(0,r.CR)(f),!1).map((function(e){return(0,i.qo)(e).map((function(e){return o.formatTransition(e)}))})));try{for(var x=(0,r.XA)(y),w=x.next();!w.done;w=x.next()){var E=w.value;b.push(E)}}catch(_){e={error:_}}finally{try{w&&!w.done&&(t=x.return)&&t.call(x)}finally{if(e)throw e.error}}return b},e}()},70572:(e,t,n)=>{"use strict";n.d(t,{CR:()=>a,XA:()=>o,_T:()=>i,ev:()=>s,pi:()=>r});var r=function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},r.apply(this,arguments)};function i(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}function o(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function a(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function s(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}},20449:(e,t,n)=>{"use strict";n.r(t),n.d(t,{after:()=>d,assign:()=>u,cancel:()=>l,choose:()=>x,doneState:()=>h,error:()=>y,errorExecution:()=>g,errorPlatform:()=>m,init:()=>p,invoke:()=>v,log:()=>f,nullEvent:()=>c,pure:()=>w,raise:()=>a,send:()=>s,start:()=>i,stop:()=>o,update:()=>b});var r=n(3763),i=r.M.Start,o=r.M.Stop,a=r.M.Raise,s=r.M.Send,l=r.M.Cancel,c=r.M.NullEvent,u=r.M.Assign,d=r.M.After,h=r.M.DoneState,f=r.M.Log,p=r.M.Init,v=r.M.Invoke,g=r.M.ErrorExecution,m=r.M.ErrorPlatform,y=r.M.ErrorCustom,b=r.M.Update,x=r.M.Choose,w=r.M.Pure},60081:(e,t,n)=>{"use strict";n.r(t),n.d(t,{actionTypes:()=>o,after:()=>D,assign:()=>C,cancel:()=>k,choose:()=>L,done:()=>N,doneInvoke:()=>O,error:()=>M,escalate:()=>I,forwardTo:()=>R,getActionFunction:()=>c,initEvent:()=>l,isActionObject:()=>T,log:()=>E,pure:()=>A,raise:()=>f,resolveActions:()=>B,resolveLog:()=>_,resolveRaise:()=>p,resolveSend:()=>g,resolveStop:()=>j,respond:()=>x,send:()=>v,sendParent:()=>m,sendTo:()=>y,sendUpdate:()=>b,start:()=>S,stop:()=>P,toActionObject:()=>u,toActionObjects:()=>d,toActivityDefinition:()=>h});var r=n(70572),i=n(3763),o=n(20449),a=n(70049),s=n(49333),l=(0,a.g5)({type:o.init});function c(e,t){return t&&t[e]||void 0}function u(e,t){var n;if((0,a.HD)(e)||"number"==typeof e){var i=c(e,t);n=(0,a.mf)(i)?{type:e,exec:i}:i||{type:e,exec:void 0}}else if((0,a.mf)(e))n={type:e.name||e.toString(),exec:e};else{i=c(e.type,t);if((0,a.mf)(i))n=(0,r.pi)((0,r.pi)({},e),{exec:i});else if(i){var o=i.type||e.type;n=(0,r.pi)((0,r.pi)((0,r.pi)({},i),e),{type:o})}else n=e}return n}var d=function(e,t){return e?((0,a.kJ)(e)?e:[e]).map((function(e){return u(e,t)})):[]};function h(e){var t=u(e);return(0,r.pi)((0,r.pi)({id:(0,a.HD)(e)?e:t.id},t),{type:t.type})}function f(e){return(0,a.HD)(e)?{type:o.raise,event:e}:v(e,{to:i.K.Internal})}function p(e){return{type:o.raise,_event:(0,a.g5)(e.event)}}function v(e,t){return{to:t?t.to:void 0,type:o.send,event:(0,a.mf)(e)?e:(0,a._v)(e),delay:t?t.delay:void 0,id:t&&void 0!==t.id?t.id:(0,a.mf)(e)?e.name:(0,a.x6)(e)}}function g(e,t,n,i){var o,s={_event:n},l=(0,a.g5)((0,a.mf)(e.event)?e.event(t,n.data,s):e.event);if((0,a.HD)(e.delay)){var c=i&&i[e.delay];o=(0,a.mf)(c)?c(t,n.data,s):c}else o=(0,a.mf)(e.delay)?e.delay(t,n.data,s):e.delay;var u=(0,a.mf)(e.to)?e.to(t,n.data,s):e.to;return(0,r.pi)((0,r.pi)({},e),{to:u,_event:l,event:l.data,delay:o})}function m(e,t){return v(e,(0,r.pi)((0,r.pi)({},t),{to:i.K.Parent}))}function y(e,t,n){return v(t,(0,r.pi)((0,r.pi)({},n),{to:e}))}function b(){return m(o.update)}function x(e,t){return v(e,(0,r.pi)((0,r.pi)({},t),{to:function(e,t,n){return n._event.origin}}))}var w=function(e,t){return{context:e,event:t}};function E(e,t){return void 0===e&&(e=w),{type:o.log,label:t,expr:e}}var _=function(e,t,n){return(0,r.pi)((0,r.pi)({},e),{value:(0,a.HD)(e.expr)?e.expr:e.expr(t,n.data,{_event:n})})},k=function(e){return{type:o.cancel,sendId:e}};function S(e){var t=h(e);return{type:i.M.Start,activity:t,exec:void 0}}function P(e){var t=(0,a.mf)(e)?e:h(e);return{type:i.M.Stop,activity:t,exec:void 0}}function j(e,t,n){var r=(0,a.mf)(e.activity)?e.activity(t,n.data):e.activity,o="string"==typeof r?{id:r}:r;return{type:i.M.Stop,activity:o}}var C=function(e){return{type:o.assign,assignment:e}};function T(e){return"object"==typeof e&&"type"in e}function D(e,t){var n=t?"#".concat(t):"";return"".concat(i.M.After,"(").concat(e,")").concat(n)}function N(e,t){var n="".concat(i.M.DoneState,".").concat(e),r={type:n,data:t,toString:function(){return n}};return r}function O(e,t){var n="".concat(i.M.DoneInvoke,".").concat(e),r={type:n,data:t,toString:function(){return n}};return r}function M(e,t){var n="".concat(i.M.ErrorPlatform,".").concat(e),r={type:n,data:t,toString:function(){return n}};return r}function A(e){return{type:i.M.Pure,get:e}}function R(e,t){if(!(s.M||e&&"function"!=typeof e)){var n=e;e=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var i="function"==typeof n?n.apply(void 0,(0,r.ev)([],(0,r.CR)(e),!1)):n;if(!i)throw new Error("Attempted to forward event to undefined actor. This risks an infinite loop in the sender.");return i}}return v((function(e,t){return t}),(0,r.pi)((0,r.pi)({},t),{to:e}))}function I(e,t){return m((function(t,n,r){return{type:o.error,data:(0,a.mf)(e)?e(t,n,r):e}}),(0,r.pi)((0,r.pi)({},t),{to:i.K.Parent}))}function L(e){return{type:i.M.Choose,conds:e}}function B(e,t,n,l,c,h,f){void 0===f&&(f=!1);var v=f?[]:function(e){var t,n,i=[];try{for(var a=(0,r.XA)(e),s=a.next();!s.done;s=a.next())for(var l=s.value,c=0;c<l.length;)l[c].type!==o.assign?c++:(i.push(l[c]),l.splice(c,1))}catch(u){t={error:u}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}return i}(c),m=v.length?(0,a.dt)(n,l,v,t):n,y=f?[n]:void 0,b=[];function x(c){var v;switch(c.type){case o.raise:return p(c);case o.send:var x=g(c,m,l,e.options.delays);return s.M||(0,a.ZK)(!(0,a.HD)(c.delay)||"number"==typeof x.delay,"No delay reference for delay expression '".concat(c.delay,"' was found on machine '").concat(e.id,"'")),h&&x.to!==i.K.Internal&&b.push(x),x;case o.log:var w=_(c,m,l);return null==h||h(w,m,l),w;case o.choose:if(!(P=null===(v=c.conds.find((function(n){var r=(0,a.Qi)(n.cond,e.options.guards);return!r||(0,a.vx)(e,r,m,l,h?void 0:t)})))||void 0===v?void 0:v.actions))return[];var E=(0,r.CR)(B(e,t,m,l,[d((0,a.qo)(P),e.options.actions)],h,f),2),k=E[0],S=E[1];return m=S,null==y||y.push(m),k;case o.pure:var P;if(!(P=c.get(m,l.data)))return[];var C=(0,r.CR)(B(e,t,m,l,[d((0,a.qo)(P),e.options.actions)],h,f),2),T=C[0],D=C[1];return m=D,null==y||y.push(m),T;case o.stop:w=j(c,m,l);return null==h||h(w,n,l),w;case o.assign:m=(0,a.dt)(m,l,[c],h?void 0:t),null==y||y.push(m);break;default:var N=u(c,e.options.actions),O=N.exec;if(h)h(N,m,l);else if(O&&y){var M=y.length-1;N=(0,r.pi)((0,r.pi)({},N),{exec:function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];O.apply(void 0,(0,r.ev)([y[M]],(0,r.CR)(t),!1))}})}return N}}return[(0,a.xH)(c.map((function(e){var t,n,i=[];try{for(var o=(0,r.XA)(e),a=o.next();!a.done;a=o.next()){var s=x(a.value);s&&(i=i.concat(s))}}catch(c){t={error:c}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return b.forEach((function(e){h(e,m,l)})),b.length=0,i}))),m]}},25588:(e,t,n)=>{"use strict";n.d(t,{YP:()=>o});var r=n(19140),i=n(70049);function o(e,t){void 0===t&&(t={});var n=e.initialState,o=new Set,a=[],s=!1,l=(0,r.vk)({id:t.id,send:function(t){a.push(t),function(){if(!s){for(s=!0;a.length>0;){var t=a.shift();n=e.transition(n,t,c),o.forEach((function(e){return e.next(n)}))}s=!1}}()},getSnapshot:function(){return n},subscribe:function(e,t,r){var a=(0,i.zM)(e,t,r);return o.add(a),a.next(n),{unsubscribe:function(){o.delete(a)}}}}),c={parent:t.parent,self:l,id:t.id||"anonymous",observers:o};return n=e.start?e.start(c):n,l}},84766:(e,t,n)=>{"use strict";n.d(t,{TV:()=>o,iS:()=>r,qP:()=>i,rt:()=>a});var r=".",i={},o="xstate.guard",a=""},49333:(e,t,n)=>{"use strict";n.d(t,{M:()=>r});var r=!0},64223:(e,t,n)=>{"use strict";n.r(t),n.d(t,{ActionTypes:()=>g.M,Interpreter:()=>o.Ng,InterpreterStatus:()=>o.TM,Machine:()=>a.J,SpecialTargets:()=>g.K,State:()=>u.ZM,StateNode:()=>p.n,actions:()=>r,assign:()=>m,createMachine:()=>a.C,createSchema:()=>h,doneInvoke:()=>_,forwardTo:()=>E,interpret:()=>o.kJ,mapState:()=>c,matchState:()=>d,matchesState:()=>l.W,raise:()=>k,send:()=>y,sendParent:()=>x,sendTo:()=>b,sendUpdate:()=>w,spawn:()=>o.Cs,spawnBehavior:()=>v.YP,t:()=>f,toActorRef:()=>i.vk,toEventObject:()=>l._v,toObserver:()=>l.zM,toSCXMLEvent:()=>l.g5});var r=n(60081),i=n(19140),o=n(60382),a=n(61818),s=n(70572),l=n(70049);function c(e,t){var n,r,i;try{for(var o=(0,s.XA)(Object.keys(e)),a=o.next();!a.done;a=o.next()){var c=a.value;(0,l.W)(c,t)&&(!i||t.length>i.length)&&(i=c)}}catch(u){n={error:u}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return e[i]}var u=n(67732);function d(e,t,n){var r,i,o=u.ZM.from(e,e instanceof u.ZM?e.context:void 0);try{for(var a=(0,s.XA)(t),l=a.next();!l.done;l=a.next()){var c=(0,s.CR)(l.value,2),d=c[0],h=c[1];if(o.matches(d))return h(o)}}catch(f){r={error:f}}finally{try{l&&!l.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return n(o)}function h(e){return e}var f=h,p=n(26935),v=n(25588),g=n(3763),m=r.assign,y=r.send,b=r.sendTo,x=r.sendParent,w=r.sendUpdate,E=r.forwardTo,_=r.doneInvoke,k=r.raise},60382:(e,t,n)=>{"use strict";n.d(t,{Ng:()=>S,TM:()=>w,kJ:()=>j,Cs:()=>P});var r=n(70572),i=n(3763),o=n(67732),a=n(20449),s=n(60081),l=n(49333),c=n(70049),u={deferEvents:!1},d=function(){function e(e){this.processingEvent=!1,this.queue=[],this.initialized=!1,this.options=(0,r.pi)((0,r.pi)({},u),e)}return e.prototype.initialize=function(e){if(this.initialized=!0,e){if(!this.options.deferEvents)return void this.schedule(e);this.process(e)}this.flushEvents()},e.prototype.schedule=function(e){if(this.initialized&&!this.processingEvent){if(0!==this.queue.length)throw new Error("Event queue should be empty when it is not processing events");this.process(e),this.flushEvents()}else this.queue.push(e)},e.prototype.clear=function(){this.queue=[]},e.prototype.flushEvents=function(){for(var e=this.queue.shift();e;)this.process(e),e=this.queue.shift()},e.prototype.process=function(e){this.processingEvent=!0;try{e()}catch(t){throw this.clear(),t}finally{this.processingEvent=!1}},e}(),h=n(19140),f=new Map,p=0,v=function(){return"x:".concat(p++)},g=function(e,t){return f.set(e,t),e},m=function(e){return f.get(e)},y=function(e){f.delete(e)};function b(){return"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:void(l.M||console.warn("XState could not find a global object in this environment. Please let the maintainers know and raise an issue here: https://github.com/statelyai/xstate/issues"))}function x(e){if(b()){var t=function(){var e=b();if(e&&"__xstate__"in e)return e.__xstate__}();t&&t.register(e)}}var w,E=n(80237),_=n(25588),k={sync:!1,autoForward:!1};!function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"}(w||(w={}));var S=function(){function e(t,n){void 0===n&&(n=e.defaultOptions);var o=this;this.machine=t,this.delayedEventsMap={},this.listeners=new Set,this.contextListeners=new Set,this.stopListeners=new Set,this.doneListeners=new Set,this.eventListeners=new Set,this.sendListeners=new Set,this.initialized=!1,this.status=w.NotStarted,this.children=new Map,this.forwardTo=new Set,this._outgoingQueue=[],this.init=this.start,this.send=function(e,t){if((0,c.kJ)(e))return o.batch(e),o.state;var n=(0,c.g5)((0,c._v)(e,t));if(o.status===w.Stopped)return l.M||(0,c.ZK)(!1,'Event "'.concat(n.name,'" was sent to stopped service "').concat(o.machine.id,'". This service has already reached its final state, and will not transition.\nEvent: ').concat(JSON.stringify(n.data))),o.state;if(o.status!==w.Running&&!o.options.deferEvents)throw new Error('Event "'.concat(n.name,'" was sent to uninitialized service "').concat(o.machine.id,'". Make sure .start() is called for this service, or set { deferEvents: true } in the service options.\nEvent: ').concat(JSON.stringify(n.data)));return o.scheduler.schedule((function(){o.forward(n);var e=o._nextState(n);o.update(e,n)})),o._state},this.sendTo=function(e,t,n){var u=o.parent&&(t===i.K.Parent||o.parent.id===t),d=u?o.parent:(0,c.HD)(t)?o.children.get(t)||m(t):(0,c.Bc)(t)?t:void 0;if(d)if("machine"in d){if(o.status!==w.Stopped||o.parent!==d||o.state.done){var h=(0,r.pi)((0,r.pi)({},e),{name:e.name===a.error?"".concat((0,s.error)(o.id)):e.name,origin:o.sessionId});!n&&o.machine.config.predictableActionArguments?o._outgoingQueue.push([d,h]):d.send(h)}}else!n&&o.machine.config.predictableActionArguments?o._outgoingQueue.push([d,e.data]):d.send(e.data);else{if(!u)throw new Error("Unable to send event to child '".concat(t,"' from service '").concat(o.id,"'."));l.M||(0,c.ZK)(!1,"Service '".concat(o.id,"' has no parent: unable to send event ").concat(e.type))}},this._exec=function(e,t,n,r){void 0===r&&(r=o.machine.options.actions);var u=e.exec||(0,s.getActionFunction)(e.type,r),d=(0,c.mf)(u)?u:u?u.exec:e.exec;if(d)try{return d(t,n.data,o.machine.config.predictableActionArguments?{action:e,_event:n}:{action:e,state:o.state,_event:n})}catch(S){throw o.parent&&o.parent.send({type:"xstate.error",data:S}),S}switch(e.type){case a.send:var h=e;if("number"==typeof h.delay)return void o.defer(h);h.to?o.sendTo(h._event,h.to,n===s.initEvent):o.send(h._event);break;case a.cancel:o.cancel(e.sendId);break;case a.start:if(o.status!==w.Running)return;var f=e.activity;if(!o.machine.config.predictableActionArguments&&!o.state.activities[f.id||f.type])break;if(f.type===i.M.Invoke){var p=(0,c.j)(f.src),v=o.machine.options.services?o.machine.options.services[p.type]:void 0,g=f.id,m=f.data;l.M||(0,c.ZK)(!("forward"in f),"`forward` property is deprecated (found in invocation of '".concat(f.src,"' in in machine '").concat(o.machine.id,"'). ")+"Please use `autoForward` instead.");var y="autoForward"in f?f.autoForward:!!f.forward;if(!v)return void(l.M||(0,c.ZK)(!1,"No service found for invocation '".concat(f.src,"' in machine '").concat(o.machine.id,"'.")));var b=m?(0,c.QX)(m,t,n):void 0;if("string"==typeof v)return;var x=(0,c.mf)(v)?v(t,n.data,{data:b,src:p,meta:f.meta}):v;if(!x)return;var E=void 0;(0,c.O4)(x)&&(x=b?x.withContext(b):x,E={autoForward:y}),o.spawn(x,g,E)}else o.spawnActivity(f);break;case a.stop:o.stopChild(e.activity.id);break;case a.log:var _=e.label,k=e.value;_?o.logger(_,k):o.logger(k);break;default:l.M||(0,c.ZK)(!1,"No implementation found for action type '".concat(e.type,"'"))}};var u=(0,r.pi)((0,r.pi)({},e.defaultOptions),n),h=u.clock,f=u.logger,p=u.parent,g=u.id,y=void 0!==g?g:t.id;this.id=y,this.logger=f,this.clock=h,this.parent=p,this.options=u,this.scheduler=new d({deferEvents:this.options.deferEvents}),this.sessionId=v()}return Object.defineProperty(e.prototype,"initialState",{get:function(){var e=this;return this._initialState?this._initialState:(0,E.J)(this,(function(){return e._initialState=e.machine.initialState,e._initialState}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"state",{get:function(){return l.M||(0,c.ZK)(this.status!==w.NotStarted,"Attempted to read state from uninitialized service '".concat(this.id,"'. Make sure the service is started first.")),this._state},enumerable:!1,configurable:!0}),e.prototype.execute=function(e,t){var n,i;try{for(var o=(0,r.XA)(e.actions),a=o.next();!a.done;a=o.next()){var s=a.value;this.exec(s,e,t)}}catch(l){n={error:l}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}},e.prototype.update=function(e,t){var n,i,o,a,l,u,d,h,f=this;if(e._sessionid=this.sessionId,this._state=e,this.machine.config.predictableActionArguments&&t!==s.initEvent||!this.options.execute)for(var p=void 0;p=this._outgoingQueue.shift();)p[0].send(p[1]);else this.execute(this.state);if(this.children.forEach((function(e){f.state.children[e.id]=e})),this.devTools&&this.devTools.send(t.data,e),e.event)try{for(var v=(0,r.XA)(this.eventListeners),g=v.next();!g.done;g=v.next()){(0,g.value)(e.event)}}catch(S){n={error:S}}finally{try{g&&!g.done&&(i=v.return)&&i.call(v)}finally{if(n)throw n.error}}try{for(var m=(0,r.XA)(this.listeners),y=m.next();!y.done;y=m.next()){(0,y.value)(e,e.event)}}catch(P){o={error:P}}finally{try{y&&!y.done&&(a=m.return)&&a.call(m)}finally{if(o)throw o.error}}try{for(var b=(0,r.XA)(this.contextListeners),x=b.next();!x.done;x=b.next()){(0,x.value)(this.state.context,this.state.history?this.state.history.context:void 0)}}catch(j){l={error:j}}finally{try{x&&!x.done&&(u=b.return)&&u.call(b)}finally{if(l)throw l.error}}if(this.state.done){var w=e.configuration.find((function(e){return"final"===e.type&&e.parent===f.machine})),E=w&&w.doneData?(0,c.QX)(w.doneData,e.context,t):void 0;try{for(var _=(0,r.XA)(this.doneListeners),k=_.next();!k.done;k=_.next()){(0,k.value)((0,s.doneInvoke)(this.id,E))}}catch(C){d={error:C}}finally{try{k&&!k.done&&(h=_.return)&&h.call(_)}finally{if(d)throw d.error}}this._stop(),this._stopChildren()}},e.prototype.onTransition=function(e){return this.listeners.add(e),this.status===w.Running&&e(this.state,this.state.event),this},e.prototype.subscribe=function(e,t,n){var r=this,i=(0,c.zM)(e,t,n);this.listeners.add(i.next),this.status!==w.NotStarted&&i.next(this.state);var o=function(){r.doneListeners.delete(o),r.stopListeners.delete(o),i.complete()};return this.status===w.Stopped?i.complete():(this.onDone(o),this.onStop(o)),{unsubscribe:function(){r.listeners.delete(i.next),r.doneListeners.delete(o),r.stopListeners.delete(o)}}},e.prototype.onEvent=function(e){return this.eventListeners.add(e),this},e.prototype.onSend=function(e){return this.sendListeners.add(e),this},e.prototype.onChange=function(e){return this.contextListeners.add(e),this},e.prototype.onStop=function(e){return this.stopListeners.add(e),this},e.prototype.onDone=function(e){return this.doneListeners.add(e),this},e.prototype.off=function(e){return this.listeners.delete(e),this.eventListeners.delete(e),this.sendListeners.delete(e),this.stopListeners.delete(e),this.doneListeners.delete(e),this.contextListeners.delete(e),this},e.prototype.start=function(e){var t=this;if(this.status===w.Running)return this;this.machine._init(),g(this.sessionId,this),this.initialized=!0,this.status=w.Running;var n=void 0===e?this.initialState:(0,E.J)(this,(function(){return(0,o.TL)(e)?t.machine.resolveState(e):t.machine.resolveState(o.ZM.from(e,t.machine.context))}));return this.options.devTools&&this.attachDev(),this.scheduler.initialize((function(){t.update(n,s.initEvent)})),this},e.prototype._stopChildren=function(){this.children.forEach((function(e){(0,c.mf)(e.stop)&&e.stop()})),this.children.clear()},e.prototype._stop=function(){var e,t,n,i,o,a,s,l,c,u;try{for(var h=(0,r.XA)(this.listeners),f=h.next();!f.done;f=h.next()){var p=f.value;this.listeners.delete(p)}}catch(S){e={error:S}}finally{try{f&&!f.done&&(t=h.return)&&t.call(h)}finally{if(e)throw e.error}}try{for(var v=(0,r.XA)(this.stopListeners),g=v.next();!g.done;g=v.next()){(p=g.value)(),this.stopListeners.delete(p)}}catch(P){n={error:P}}finally{try{g&&!g.done&&(i=v.return)&&i.call(v)}finally{if(n)throw n.error}}try{for(var m=(0,r.XA)(this.contextListeners),y=m.next();!y.done;y=m.next()){p=y.value;this.contextListeners.delete(p)}}catch(j){o={error:j}}finally{try{y&&!y.done&&(a=m.return)&&a.call(m)}finally{if(o)throw o.error}}try{for(var b=(0,r.XA)(this.doneListeners),x=b.next();!x.done;x=b.next()){p=x.value;this.doneListeners.delete(p)}}catch(C){s={error:C}}finally{try{x&&!x.done&&(l=b.return)&&l.call(b)}finally{if(s)throw s.error}}if(!this.initialized)return this;this.initialized=!1,this.status=w.Stopped,this._initialState=void 0;try{for(var E=(0,r.XA)(Object.keys(this.delayedEventsMap)),_=E.next();!_.done;_=E.next()){var k=_.value;this.clock.clearTimeout(this.delayedEventsMap[k])}}catch(T){c={error:T}}finally{try{_&&!_.done&&(u=E.return)&&u.call(E)}finally{if(c)throw c.error}}this.scheduler.clear(),this.scheduler=new d({deferEvents:this.options.deferEvents})},e.prototype.stop=function(){var e=this,t=this.scheduler;return this._stop(),t.schedule((function(){var t=(0,c.g5)({type:"xstate.stop"}),n=(0,E.J)(e,(function(){var n=(0,c.xH)((0,r.ev)([],(0,r.CR)(e.state.configuration),!1).sort((function(e,t){return t.order-e.order})).map((function(t){return(0,s.toActionObjects)(t.onExit,e.machine.options.actions)}))),l=(0,r.CR)((0,s.resolveActions)(e.machine,e.state,e.state.context,t,[n],e.machine.config.predictableActionArguments?e._exec:void 0,e.machine.config.predictableActionArguments||e.machine.config.preserveActionOrder),2),u=l[0],d=l[1],h=new o.ZM({value:e.state.value,context:d,_event:t,_sessionid:e.sessionId,historyValue:void 0,history:e.state,actions:u.filter((function(e){return e.type!==a.raise&&(e.type!==a.send||!!e.to&&e.to!==i.K.Internal)})),activities:{},events:[],configuration:[],transitions:[],children:{},done:e.state.done,tags:e.state.tags,machine:e.machine});return h.changed=!0,h}));e.update(n,t),e._stopChildren(),y(e.sessionId)})),this},e.prototype.batch=function(e){var t=this;if(this.status===w.NotStarted&&this.options.deferEvents)l.M||(0,c.ZK)(!1,"".concat(e.length,' event(s) were sent to uninitialized service "').concat(this.machine.id,'" and are deferred. Make sure .start() is called for this service.\nEvent: ').concat(JSON.stringify(event)));else if(this.status!==w.Running)throw new Error("".concat(e.length,' event(s) were sent to uninitialized service "').concat(this.machine.id,'". Make sure .start() is called for this service, or set { deferEvents: true } in the service options.'));if(e.length){var n=!!this.machine.config.predictableActionArguments&&this._exec;this.scheduler.schedule((function(){var i,a,s=t.state,l=!1,u=[],d=function(e){var i=(0,c.g5)(e);t.forward(i),s=(0,E.J)(t,(function(){return t.machine.transition(s,i,void 0,n||void 0)})),u.push.apply(u,(0,r.ev)([],(0,r.CR)(t.machine.config.predictableActionArguments?s.actions:s.actions.map((function(e){return(0,o.j1)(e,s)}))),!1)),l=l||!!s.changed};try{for(var h=(0,r.XA)(e),f=h.next();!f.done;f=h.next()){d(f.value)}}catch(p){i={error:p}}finally{try{f&&!f.done&&(a=h.return)&&a.call(h)}finally{if(i)throw i.error}}s.changed=l,s.actions=u,t.update(s,(0,c.g5)(e[e.length-1]))}))}},e.prototype.sender=function(e){return this.send.bind(this,e)},e.prototype._nextState=function(e,t){var n=this;void 0===t&&(t=!!this.machine.config.predictableActionArguments&&this._exec);var r=(0,c.g5)(e);if(0===r.name.indexOf(a.errorPlatform)&&!this.state.nextEvents.some((function(e){return 0===e.indexOf(a.errorPlatform)})))throw r.data.data;return(0,E.J)(this,(function(){return n.machine.transition(n.state,r,void 0,t||void 0)}))},e.prototype.nextState=function(e){return this._nextState(e,!1)},e.prototype.forward=function(e){var t,n;try{for(var i=(0,r.XA)(this.forwardTo),o=i.next();!o.done;o=i.next()){var a=o.value,s=this.children.get(a);if(!s)throw new Error("Unable to forward event '".concat(e,"' from interpreter '").concat(this.id,"' to nonexistant child '").concat(a,"'."));s.send(e)}}catch(l){t={error:l}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}},e.prototype.defer=function(e){var t=this;this.delayedEventsMap[e.id]=this.clock.setTimeout((function(){e.to?t.sendTo(e._event,e.to,!0):t.send(e._event)}),e.delay)},e.prototype.cancel=function(e){this.clock.clearTimeout(this.delayedEventsMap[e]),delete this.delayedEventsMap[e]},e.prototype.exec=function(e,t,n){void 0===n&&(n=this.machine.options.actions),this._exec(e,t.context,t._event,n)},e.prototype.removeChild=function(e){var t;this.children.delete(e),this.forwardTo.delete(e),null===(t=this.state)||void 0===t||delete t.children[e]},e.prototype.stopChild=function(e){var t=this.children.get(e);t&&(this.removeChild(e),(0,c.mf)(t.stop)&&t.stop())},e.prototype.spawn=function(e,t,n){if(this.status!==w.Running)return(0,h.Xg)(e,t);if((0,c.y8)(e))return this.spawnPromise(Promise.resolve(e),t);if((0,c.mf)(e))return this.spawnCallback(e,t);if((0,h.f3)(e))return this.spawnActor(e,t);if((0,c.bi)(e))return this.spawnObservable(e,t);if((0,c.O4)(e))return this.spawnMachine(e,(0,r.pi)((0,r.pi)({},n),{id:t}));if((0,c.HV)(e))return this.spawnBehavior(e,t);throw new Error('Unable to spawn entity "'.concat(t,'" of type "').concat(typeof e,'".'))},e.prototype.spawnMachine=function(t,n){var i=this;void 0===n&&(n={});var o=new e(t,(0,r.pi)((0,r.pi)({},this.options),{parent:this,id:n.id||t.id})),s=(0,r.pi)((0,r.pi)({},k),n);s.sync&&o.onTransition((function(e){i.send(a.update,{state:e,id:o.id})}));var l=o;return this.children.set(o.id,l),s.autoForward&&this.forwardTo.add(o.id),o.onDone((function(e){i.removeChild(o.id),i.send((0,c.g5)(e,{origin:o.id}))})).start(),l},e.prototype.spawnBehavior=function(e,t){var n=(0,_.YP)(e,{id:t,parent:this});return this.children.set(t,n),n},e.prototype.spawnPromise=function(e,t){var n,r,i=this,o=!1;e.then((function(e){o||(r=e,i.removeChild(t),i.send((0,c.g5)((0,s.doneInvoke)(t,e),{origin:t})))}),(function(e){if(!o){i.removeChild(t);var n=(0,s.error)(t,e);try{i.send((0,c.g5)(n,{origin:t}))}catch(r){(0,c.v4)(e,r,t),i.devTools&&i.devTools.send(n,i.state),i.machine.strict&&i.stop()}}}));var a=((n={id:t,send:function(){},subscribe:function(t,n,r){var i=(0,c.zM)(t,n,r),o=!1;return e.then((function(e){o||(i.next(e),o||i.complete())}),(function(e){o||i.error(e)})),{unsubscribe:function(){return o=!0}}},stop:function(){o=!0},toJSON:function(){return{id:t}},getSnapshot:function(){return r}})[c.L$]=function(){return this},n);return this.children.set(t,a),a},e.prototype.spawnCallback=function(e,t){var n,r,i,o=this,a=!1,l=new Set,u=new Set;try{i=e((function(e){r=e,u.forEach((function(t){return t(e)})),a||o.send((0,c.g5)(e,{origin:t}))}),(function(e){l.add(e)}))}catch(h){this.send((0,s.error)(t,h))}if((0,c.y8)(i))return this.spawnPromise(i,t);var d=((n={id:t,send:function(e){return l.forEach((function(t){return t(e)}))},subscribe:function(e){var t=(0,c.zM)(e);return u.add(t.next),{unsubscribe:function(){u.delete(t.next)}}},stop:function(){a=!0,(0,c.mf)(i)&&i()},toJSON:function(){return{id:t}},getSnapshot:function(){return r}})[c.L$]=function(){return this},n);return this.children.set(t,d),d},e.prototype.spawnObservable=function(e,t){var n,r,i=this,o=e.subscribe((function(e){r=e,i.send((0,c.g5)(e,{origin:t}))}),(function(e){i.removeChild(t),i.send((0,c.g5)((0,s.error)(t,e),{origin:t}))}),(function(){i.removeChild(t),i.send((0,c.g5)((0,s.doneInvoke)(t),{origin:t}))})),a=((n={id:t,send:function(){},subscribe:function(t,n,r){return e.subscribe(t,n,r)},stop:function(){return o.unsubscribe()},getSnapshot:function(){return r},toJSON:function(){return{id:t}}})[c.L$]=function(){return this},n);return this.children.set(t,a),a},e.prototype.spawnActor=function(e,t){return this.children.set(t,e),e},e.prototype.spawnActivity=function(e){var t=this.machine.options&&this.machine.options.activities?this.machine.options.activities[e.type]:void 0;if(t){var n=t(this.state.context,e);this.spawnEffect(e.id,n)}else l.M||(0,c.ZK)(!1,"No implementation found for activity '".concat(e.type,"'"))},e.prototype.spawnEffect=function(e,t){var n;this.children.set(e,((n={id:e,send:function(){},subscribe:function(){return{unsubscribe:function(){}}},stop:t||void 0,getSnapshot:function(){},toJSON:function(){return{id:e}}})[c.L$]=function(){return this},n))},e.prototype.attachDev=function(){var e=b();if(this.options.devTools&&e){if(e.__REDUX_DEVTOOLS_EXTENSION__){var t="object"==typeof this.options.devTools?this.options.devTools:void 0;this.devTools=e.__REDUX_DEVTOOLS_EXTENSION__.connect((0,r.pi)((0,r.pi)({name:this.id,autoPause:!0,stateSanitizer:function(e){return{value:e.value,context:e.context,actions:e.actions}}},t),{features:(0,r.pi)({jump:!1,skip:!1},t?t.features:void 0)}),this.machine),this.devTools.init(this.state)}x(this)}},e.prototype.toJSON=function(){return{id:this.id}},e.prototype[c.L$]=function(){return this},e.prototype.getSnapshot=function(){return this.status===w.NotStarted?this.initialState:this._state},e.defaultOptions={execute:!0,deferEvents:!0,clock:{setTimeout:function(e,t){return setTimeout(e,t)},clearTimeout:function(e){return clearTimeout(e)}},logger:console.log.bind(console),devTools:!1},e.interpret=j,e}();function P(e,t){var n=function(e){return(0,c.HD)(e)?(0,r.pi)((0,r.pi)({},k),{name:e}):(0,r.pi)((0,r.pi)((0,r.pi)({},k),{name:(0,c.EL)()}),e)}(t);return(0,E.F)((function(t){if(!l.M){var r=(0,c.O4)(e)||(0,c.mf)(e);(0,c.ZK)(!!t||r,'Attempted to spawn an Actor (ID: "'.concat((0,c.O4)(e)?e.id:"undefined",'") outside of a service. This will have no effect.'))}return t?t.spawn(e,n.name,n):(0,h.Xg)(e,n.name)}))}function j(e,t){return new S(e,t)}},80237:(e,t,n)=>{"use strict";n.d(t,{F:()=>o,J:()=>i});var r=[],i=function(e,t){r.push(e);var n=t(e);return r.pop(),n},o=function(e){return e(r[r.length-1])}},88297:(e,t,n)=>{"use strict";n.d(t,{G:()=>s,Ij:()=>v,N9:()=>o,NA:()=>h,Oe:()=>m,P_:()=>c,ac:()=>l,e$:()=>f,nI:()=>a,nJ:()=>p,xZ:()=>g});var r=n(70572),i=n(70049),o=function(e){return"atomic"===e.type||"final"===e.type};function a(e){return Object.keys(e.states).map((function(t){return e.states[t]}))}function s(e){return a(e).filter((function(e){return"history"!==e.type}))}function l(e){var t=[e];return o(e)?t:t.concat((0,i.xH)(s(e).map(l)))}function c(e,t){var n,i,o,a,l,c,u,h,f=d(new Set(e)),p=new Set(t);try{for(var v=(0,r.XA)(p),g=v.next();!g.done;g=v.next())for(var m=(P=g.value).parent;m&&!p.has(m);)p.add(m),m=m.parent}catch(j){n={error:j}}finally{try{g&&!g.done&&(i=v.return)&&i.call(v)}finally{if(n)throw n.error}}var y=d(p);try{for(var b=(0,r.XA)(p),x=b.next();!x.done;x=b.next()){if("compound"!==(P=x.value).type||y.get(P)&&y.get(P).length){if("parallel"===P.type)try{for(var w=(l=void 0,(0,r.XA)(s(P))),E=w.next();!E.done;E=w.next()){var _=E.value;p.has(_)||(p.add(_),f.get(_)?f.get(_).forEach((function(e){return p.add(e)})):_.initialStateNodes.forEach((function(e){return p.add(e)})))}}catch(C){l={error:C}}finally{try{E&&!E.done&&(c=w.return)&&c.call(w)}finally{if(l)throw l.error}}}else f.get(P)?f.get(P).forEach((function(e){return p.add(e)})):P.initialStateNodes.forEach((function(e){return p.add(e)}))}}catch(T){o={error:T}}finally{try{x&&!x.done&&(a=b.return)&&a.call(b)}finally{if(o)throw o.error}}try{for(var k=(0,r.XA)(p),S=k.next();!S.done;S=k.next()){var P;for(m=(P=S.value).parent;m&&!p.has(m);)p.add(m),m=m.parent}}catch(D){u={error:D}}finally{try{S&&!S.done&&(h=k.return)&&h.call(k)}finally{if(u)throw u.error}}return p}function u(e,t){var n=t.get(e);if(!n)return{};if("compound"===e.type){var r=n[0];if(!r)return{};if(o(r))return r.key}var i={};return n.forEach((function(e){i[e.key]=u(e,t)})),i}function d(e){var t,n,i=new Map;try{for(var o=(0,r.XA)(e),a=o.next();!a.done;a=o.next()){var s=a.value;i.has(s)||i.set(s,[]),s.parent&&(i.has(s.parent)||i.set(s.parent,[]),i.get(s.parent).push(s))}}catch(l){t={error:l}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return i}function h(e,t){return u(e,d(c([e],t)))}function f(e,t){return Array.isArray(e)?e.some((function(e){return e===t})):e instanceof Set&&e.has(t)}function p(e){return(0,r.ev)([],(0,r.CR)(new Set((0,i.xH)((0,r.ev)([],(0,r.CR)(e.map((function(e){return e.ownEvents}))),!1)))),!1)}function v(e,t){return"compound"===t.type?s(t).some((function(t){return"final"===t.type&&f(e,t)})):"parallel"===t.type&&s(t).every((function(t){return v(e,t)}))}function g(e){return void 0===e&&(e=[]),e.reduce((function(e,t){return void 0!==t.meta&&(e[t.id]=t.meta),e}),{})}function m(e){return new Set((0,i.xH)(e.map((function(e){return e.tags}))))}},3763:(e,t,n)=>{"use strict";var r,i;n.d(t,{K:()=>i,M:()=>r}),function(e){e.Start="xstate.start",e.Stop="xstate.stop",e.Raise="xstate.raise",e.Send="xstate.send",e.Cancel="xstate.cancel",e.NullEvent="",e.Assign="xstate.assign",e.After="xstate.after",e.DoneState="done.state",e.DoneInvoke="done.invoke",e.Log="xstate.log",e.Init="xstate.init",e.Invoke="xstate.invoke",e.ErrorExecution="error.execution",e.ErrorCommunication="error.communication",e.ErrorPlatform="error.platform",e.ErrorCustom="xstate.error",e.Update="xstate.update",e.Pure="xstate.pure",e.Choose="xstate.choose"}(r||(r={})),function(e){e.Parent="#_parent",e.Internal="#_internal"}(i||(i={}))},70049:(e,t,n)=>{"use strict";n.d(t,{Bc:()=>I,EL:()=>L,ET:()=>p,HD:()=>N,HV:()=>_,JQ:()=>w,L$:()=>A,O4:()=>R,Q8:()=>h,Q9:()=>c,QX:()=>x,Qi:()=>O,SA:()=>g,W:()=>s,WM:()=>u,ZK:()=>C,_v:()=>B,bi:()=>M,bx:()=>Y,dt:()=>j,g5:()=>F,gk:()=>v,ib:()=>f,j:()=>W,jh:()=>z,kJ:()=>T,mf:()=>D,on:()=>d,qo:()=>b,rg:()=>V,uK:()=>k,v4:()=>G,vx:()=>H,x6:()=>l,xH:()=>m,y8:()=>E,yv:()=>P,zM:()=>q});var r,i=n(70572),o=n(84766),a=n(49333);function s(e,t,n){void 0===n&&(n=o.iS);var r=u(e,n),i=u(t,n);return N(i)?!!N(r)&&i===r:N(r)?r in i:Object.keys(r).every((function(e){return e in i&&s(r[e],i[e])}))}function l(e){try{return N(e)||"number"==typeof e?"".concat(e):e.type}catch(t){throw new Error("Events must be strings or objects with a string event.type property.")}}function c(e,t){try{return T(e)?e:e.toString().split(t)}catch(n){throw new Error("'".concat(e,"' is not a valid state path."))}}function u(e,t){return"object"==typeof(n=e)&&"value"in n&&"context"in n&&"event"in n&&"_event"in n?e.value:T(e)?d(e):"string"!=typeof e?e:d(c(e,t));var n}function d(e){if(1===e.length)return e[0];for(var t={},n=t,r=0;r<e.length-1;r++)r===e.length-2?n[e[r]]=e[r+1]:(n[e[r]]={},n=n[e[r]]);return t}function h(e,t){for(var n={},r=Object.keys(e),i=0;i<r.length;i++){var o=r[i];n[o]=t(e[o],o,e,i)}return n}function f(e,t,n){var r,o,a={};try{for(var s=(0,i.XA)(Object.keys(e)),l=s.next();!l.done;l=s.next()){var c=l.value,u=e[c];n(u)&&(a[c]=t(u,c,e))}}catch(d){r={error:d}}finally{try{l&&!l.done&&(o=s.return)&&o.call(s)}finally{if(r)throw r.error}}return a}var p=function(e){return function(t){var n,r,o=t;try{for(var a=(0,i.XA)(e),s=a.next();!s.done;s=a.next()){o=o[s.value]}}catch(l){n={error:l}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return o}};function v(e,t){return function(n){var r,o,a=n;try{for(var s=(0,i.XA)(e),l=s.next();!l.done;l=s.next()){var c=l.value;a=a[t][c]}}catch(u){r={error:u}}finally{try{l&&!l.done&&(o=s.return)&&o.call(s)}finally{if(r)throw r.error}}return a}}function g(e){return e?N(e)?[[e]]:m(Object.keys(e).map((function(t){var n=e[t];return"string"==typeof n||n&&Object.keys(n).length?g(e[t]).map((function(e){return[t].concat(e)})):[[t]]}))):[[]]}function m(e){var t;return(t=[]).concat.apply(t,(0,i.ev)([],(0,i.CR)(e),!1))}function y(e){return T(e)?e:[e]}function b(e){return void 0===e?[]:y(e)}function x(e,t,n){var r,o;if(D(e))return e(t,n.data);var a={};try{for(var s=(0,i.XA)(Object.keys(e)),l=s.next();!l.done;l=s.next()){var c=l.value,u=e[c];D(u)?a[c]=u(t,n.data):a[c]=u}}catch(d){r={error:d}}finally{try{l&&!l.done&&(o=s.return)&&o.call(s)}finally{if(r)throw r.error}}return a}function w(e){return/^(done|error)\./.test(e)}function E(e){return e instanceof Promise||!(null===e||!D(e)&&"object"!=typeof e||!D(e.then))}function _(e){return null!==e&&"object"==typeof e&&"transition"in e&&"function"==typeof e.transition}function k(e,t){var n,r,o=(0,i.CR)([[],[]],2),a=o[0],s=o[1];try{for(var l=(0,i.XA)(e),c=l.next();!c.done;c=l.next()){var u=c.value;t(u)?a.push(u):s.push(u)}}catch(d){n={error:d}}finally{try{c&&!c.done&&(r=l.return)&&r.call(l)}finally{if(n)throw n.error}}return[a,s]}function S(e,t){return h(e.states,(function(e,n){if(e){var r=(N(t)?void 0:t[n])||(e?e.current:void 0);if(r)return{current:r,states:S(e,r)}}}))}function P(e,t){return{current:t,states:S(e,t)}}function j(e,t,n,r){a.M||C(!!e,"Attempting to update undefined context");var o=e?n.reduce((function(e,n){var o,a,s=n.assignment,l={state:r,action:n,_event:t},c={};if(D(s))c=s(e,t.data,l);else try{for(var u=(0,i.XA)(Object.keys(s)),d=u.next();!d.done;d=u.next()){var h=d.value,f=s[h];c[h]=D(f)?f(e,t.data,l):f}}catch(p){o={error:p}}finally{try{d&&!d.done&&(a=u.return)&&a.call(u)}finally{if(o)throw o.error}}return Object.assign({},e,c)}),e):e;return o}var C=function(){};function T(e){return Array.isArray(e)}function D(e){return"function"==typeof e}function N(e){return"string"==typeof e}function O(e,t){if(e)return N(e)?{type:o.TV,name:e,predicate:t?t[e]:void 0}:D(e)?{type:o.TV,name:e.name,predicate:e}:e}function M(e){try{return"subscribe"in e&&D(e.subscribe)}catch(t){return!1}}a.M||(C=function(e,t){var n=e instanceof Error?e:void 0;if((n||!e)&&void 0!==console){var r=["Warning: ".concat(t)];n&&r.push(n),console.warn.apply(console,r)}});var A=function(){return"function"==typeof Symbol&&Symbol.observable||"@@observable"}();(r={})[A]=function(){return this},r[Symbol.observable]=function(){return this};function R(e){return!!e&&"__xstatenode"in e}function I(e){return!!e&&"function"==typeof e.send}var L=function(){var e=0;return function(){return(++e).toString(16)}}();function B(e,t){return N(e)||"number"==typeof e?(0,i.pi)({type:e},t):e}function F(e,t){if(!N(e)&&"$$type"in e&&"scxml"===e.$$type)return e;var n=B(e);return(0,i.pi)({name:n.type,data:n,$$type:"scxml",type:"external"},t)}function z(e,t){return y(t).map((function(t){return void 0===t||"string"==typeof t||R(t)?{target:t,event:e}:(0,i.pi)((0,i.pi)({},t),{event:e})}))}function V(e){if(void 0!==e&&e!==o.rt)return b(e)}function G(e,t,n){if(!a.M){var r=e.stack?" Stacktrace was '".concat(e.stack,"'"):"";if(e===t)console.error("Missing onError handler for invocation '".concat(n,"', error was '").concat(e,"'.").concat(r));else{var i=t.stack?" Stacktrace was '".concat(t.stack,"'"):"";console.error("Missing onError handler and/or unhandled exception/promise rejection for invocation '".concat(n,"'. ")+"Original error: '".concat(e,"'. ").concat(r," Current error is '").concat(t,"'.").concat(i))}}}function H(e,t,n,r,i){var a=e.options.guards,s={state:i,cond:t,_event:r};if(t.type===o.TV)return((null==a?void 0:a[t.name])||t.predicate)(n,r.data,s);var l=null==a?void 0:a[t.type];if(!l)throw new Error("Guard '".concat(t.type,"' is not implemented on machine '").concat(e.id,"'."));return l(n,r.data,s)}function W(e){return"string"==typeof e?{type:e}:e}function q(e,t,n){var r=function(){},i="object"==typeof e,o=i?e:null;return{next:((i?e.next:e)||r).bind(o),error:((i?e.error:t)||r).bind(o),complete:((i?e.complete:n)||r).bind(o)}}function Y(e,t){return"".concat(e,":invocation[").concat(t,"]")}}},e=>{var t;t=58607,e(e.s=t)}]);
|
|
2
|
+
(self.webpackChunk=self.webpackChunk||[]).push([[179],{588:(e,t,n)=>{"use strict";var r=n(12139),i=function(){return i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i.apply(this,arguments)};var o=n(60382),a=n(70049),s=n(61818),l=n(64223),c=n(77847),u=n.n(c);function d(e){return"function"==typeof e?e():e}function h(e,t){try{return JSON.stringify(e,t)}catch(w){return u()(e,t)}}function f(e,t,n){var r,o,a={};try{for(var s=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}(t),l=s.next();!l.done;l=s.next()){var c=l.value;a[c]=e[c]}}catch(d){r={error:d}}finally{try{l&&!l.done&&(o=s.return)&&o.call(s)}finally{if(r)throw r.error}}var u=JSON.parse(h(a,n));return h(i(i({},e),u))}function p(e,t){e.machine,e.configuration,e.history;var n=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}(e,["machine","configuration","history"]);return f(n,["context","event","_event"],t)}function v(e,t){return f(e.definition,["context"],t)}var g=new Map;var m={url:"https://stately.ai/viz?inspect",iframe:function(){return document.querySelector("iframe[data-xstate]")},devTools:function(){var e,t,n=(e=new Set,t=new Set,{services:e,register:function(n){e.add(n),g.set(n.sessionId,n),t.forEach((function(e){return e(n)})),n.onStop((function(){e.delete(n),g.delete(n.sessionId)}))},unregister:function(t){e.delete(t),g.delete(t.sessionId)},onRegister:function(n){return t.add(n),e.forEach((function(e){return n(e)})),{unsubscribe:function(){t.delete(n)}}}});return globalThis.__xstate__=n,n},serialize:void 0},y=new Set;n(15735),n(6886),n(73439);var b=n(33847),x=0;function w(e,t,n,r,i){var o,a,s={};for(a in t)"ref"==a?o=t[a]:s[a]=t[a];var l={type:e,props:s,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:--x,__source:r,__self:i};if("function"==typeof e&&(o=e.defaultProps))for(a in o)void 0===s[a]&&(s[a]=o[a]);return b.YM.vnode&&b.YM.vnode(l),l}var E=n(19798);let _;function k(){if(!_){D(!0,!1);_=new E.GraphService("cytoscape-graph",D("dark","light"))}return _}const S=document.documentElement,P="nx-dep-graph-theme";let j;function C(e){const t=e.matches?"dark":"light";S.className=t,j=t}function T(e){if(!("matchMedia"in window))return;const t=window.matchMedia("(prefers-color-scheme: dark)");if("system"!==e)t.removeEventListener("change",C),S.className=e,j=e;else{const e=t.matches?"dark":"light";t.addEventListener("change",C),S.className=e,j=e}localStorage.setItem(P,e),k().theme=j}function D(e,t){return"dark"===j?e:t}const N="nx-dep-graph-rankdir";let O;function M(e){O=e,localStorage.setItem(N,e),k().rankDir=O}function A(){return A=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},A.apply(this,arguments)}var R;!function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"}(R||(R={}));const I="popstate";function L(e,t){if(!e){"undefined"!=typeof console&&console.warn(t);try{throw new Error(t)}catch(w){}}}function B(e){return{usr:e.state,key:e.key}}function F(e,t,n,r){return void 0===n&&(n=null),A({pathname:"string"==typeof e?e:e.pathname,search:"",hash:""},"string"==typeof t?V(t):t,{state:n,key:t&&t.key||r||Math.random().toString(36).substr(2,8)})}function z(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&"?"!==n&&(t+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(t+="#"===r.charAt(0)?r:"#"+r),t}function V(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function G(e){let t="undefined"!=typeof window&&void 0!==window.location&&"null"!==window.location.origin?window.location.origin:"unknown://unknown",n="string"==typeof e?e:z(e);return new URL(n,t)}function H(e,t,n,r){void 0===r&&(r={});let{window:i=document.defaultView,v5Compat:o=!1}=r,a=i.history,s=R.Pop,l=null;function c(){s=R.Pop,l&&l({action:s,location:u.location})}let u={get action(){return s},get location(){return e(i,a)},listen(e){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(I,c),l=e,()=>{i.removeEventListener(I,c),l=null}},createHref:e=>t(i,e),encodeLocation(e){let t=G(z(e));return A({},e,{pathname:t.pathname,search:t.search,hash:t.hash})},push:function(e,t){s=R.Push;let r=F(u.location,e,t);n&&n(r,e);let c=B(r),d=u.createHref(r);try{a.pushState(c,"",d)}catch(h){i.location.assign(d)}o&&l&&l({action:s,location:u.location})},replace:function(e,t){s=R.Replace;let r=F(u.location,e,t);n&&n(r,e);let i=B(r),c=u.createHref(r);a.replaceState(i,"",c),o&&l&&l({action:s,location:u.location})},go:e=>a.go(e)};return u}var W;function q(e,t,n){return void 0===t&&(t=[]),void 0===n&&(n=new Set),e.map(((e,r)=>{let i=[...t,r],o="string"==typeof e.id?e.id:i.join("-");if(te(!0!==e.index||!e.children,"Cannot specify children on an index route"),te(!n.has(o),'Found a route id collision on id "'+o+"\". Route id's must be globally unique within Data Router usages"),n.add(o),function(e){return!0===e.index}(e)){return A({},e,{id:o})}return A({},e,{id:o,children:e.children?q(e.children,i,n):void 0})}))}function Y(e,t,n){void 0===n&&(n="/");let r=ee(("string"==typeof t?V(t):t).pathname||"/",n);if(null==r)return null;let i=U(e);!function(e){e.sort(((e,t)=>e.score!==t.score?t.score-e.score:function(e,t){let n=e.length===t.length&&e.slice(0,-1).every(((e,n)=>e===t[n]));return n?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map((e=>e.childrenIndex)),t.routesMeta.map((e=>e.childrenIndex)))))}(i);let o=null;for(let a=0;null==o&&a<i.length;++a)o=Z(i[a],J(r));return o}function U(e,t,n,r){return void 0===t&&(t=[]),void 0===n&&(n=[]),void 0===r&&(r=""),e.forEach(((e,i)=>{let o={relativePath:e.path||"",caseSensitive:!0===e.caseSensitive,childrenIndex:i,route:e};o.relativePath.startsWith("/")&&(te(o.relativePath.startsWith(r),'Absolute route path "'+o.relativePath+'" nested under path "'+r+'" is not valid. An absolute child route path must start with the combined path of all its parent routes.'),o.relativePath=o.relativePath.slice(r.length));let a=ae([r,o.relativePath]),s=n.concat(o);e.children&&e.children.length>0&&(te(!0!==e.index,'Index routes must not have child routes. Please remove all child routes from route path "'+a+'".'),U(e.children,t,s,a)),(null!=e.path||e.index)&&t.push({path:a,score:K(a,e.index),routesMeta:s})})),t}!function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"}(W||(W={}));const X=/^:\w+$/,$=e=>"*"===e;function K(e,t){let n=e.split("/"),r=n.length;return n.some($)&&(r+=-2),t&&(r+=2),n.filter((e=>!$(e))).reduce(((e,t)=>e+(X.test(t)?3:""===t?1:10)),r)}function Z(e,t){let{routesMeta:n}=e,r={},i="/",o=[];for(let a=0;a<n.length;++a){let e=n[a],s=a===n.length-1,l="/"===i?t:t.slice(i.length)||"/",c=Q({path:e.relativePath,caseSensitive:e.caseSensitive,end:s},l);if(!c)return null;Object.assign(r,c.params);let u=e.route;o.push({params:r,pathname:ae([i,c.pathname]),pathnameBase:se(ae([i,c.pathnameBase])),route:u}),"/"!==c.pathnameBase&&(i=ae([i,c.pathnameBase]))}return o}function Q(e,t){"string"==typeof e&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=function(e,t,n){void 0===t&&(t=!1);void 0===n&&(n=!0);ne("*"===e||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were "'+e.replace(/\*$/,"/*")+'" because the `*` character must always follow a `/` in the pattern. To get rid of this warning, please change the route path to "'+e.replace(/\*$/,"/*")+'".');let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^$?{}|()[\]]/g,"\\$&").replace(/:(\w+)/g,((e,t)=>(r.push(t),"([^\\/]+)")));e.endsWith("*")?(r.push("*"),i+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":""!==e&&"/"!==e&&(i+="(?:(?=\\/|$))");return[new RegExp(i,t?void 0:"i"),r]}(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let o=i[0],a=o.replace(/(.)\/+$/,"$1"),s=i.slice(1),l=r.reduce(((e,t,n)=>{if("*"===t){let e=s[n]||"";a=o.slice(0,o.length-e.length).replace(/(.)\/+$/,"$1")}return e[t]=function(e,t){try{return decodeURIComponent(e)}catch(n){return ne(!1,'The value for the URL param "'+t+'" will not be decoded because the string "'+e+'" is a malformed URL segment. This is probably due to a bad percent encoding ('+n+")."),e}}(s[n]||"",t),e}),{});return{params:l,pathname:o,pathnameBase:a,pattern:e}}function J(e){try{return decodeURI(e)}catch(t){return ne(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent encoding ('+t+")."),e}}function ee(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&"/"!==r?null:e.slice(n)||"/"}function te(e,t){if(!1===e||null==e)throw new Error(t)}function ne(e,t){if(!e){"undefined"!=typeof console&&console.warn(t);try{throw new Error(t)}catch(w){}}}function re(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified `to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the `to."+n+'` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.'}function ie(e){return e.filter(((e,t)=>0===t||e.route.path&&e.route.path.length>0))}function oe(e,t,n,r){let i;void 0===r&&(r=!1),"string"==typeof e?i=V(e):(i=A({},e),te(!i.pathname||!i.pathname.includes("?"),re("?","pathname","search",i)),te(!i.pathname||!i.pathname.includes("#"),re("#","pathname","hash",i)),te(!i.search||!i.search.includes("#"),re("#","search","hash",i)));let o,a=""===e||""===i.pathname,s=a?"/":i.pathname;if(r||null==s)o=n;else{let e=t.length-1;if(s.startsWith("..")){let t=s.split("/");for(;".."===t[0];)t.shift(),e-=1;i.pathname=t.join("/")}o=e>=0?t[e]:"/"}let l=function(e,t){void 0===t&&(t="/");let{pathname:n,search:r="",hash:i=""}="string"==typeof e?V(e):e,o=n?n.startsWith("/")?n:function(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach((e=>{".."===e?n.length>1&&n.pop():"."!==e&&n.push(e)})),n.length>1?n.join("/"):"/"}(n,t):t;return{pathname:o,search:le(r),hash:ce(i)}}(i,o),c=s&&"/"!==s&&s.endsWith("/"),u=(a||"."===s)&&n.endsWith("/");return l.pathname.endsWith("/")||!c&&!u||(l.pathname+="/"),l}const ae=e=>e.join("/").replace(/\/\/+/g,"/"),se=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),le=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",ce=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"";class ue extends Error{}class de{constructor(e){let t;this.pendingKeys=new Set,this.subscriber=void 0,te(e&&"object"==typeof e&&!Array.isArray(e),"defer() only accepts plain objects"),this.abortPromise=new Promise(((e,n)=>t=n)),this.controller=new AbortController;let n=()=>t(new ue("Deferred data aborted"));this.unlistenAbortSignal=()=>this.controller.signal.removeEventListener("abort",n),this.controller.signal.addEventListener("abort",n),this.data=Object.entries(e).reduce(((e,t)=>{let[n,r]=t;return Object.assign(e,{[n]:this.trackPromise(n,r)})}),{})}trackPromise(e,t){if(!(t instanceof Promise))return t;this.pendingKeys.add(e);let n=Promise.race([t,this.abortPromise]).then((t=>this.onSettle(n,e,null,t)),(t=>this.onSettle(n,e,t)));return n.catch((()=>{})),Object.defineProperty(n,"_tracked",{get:()=>!0}),n}onSettle(e,t,n,r){if(this.controller.signal.aborted&&n instanceof ue)return this.unlistenAbortSignal(),Object.defineProperty(e,"_error",{get:()=>n}),Promise.reject(n);this.pendingKeys.delete(t),this.done&&this.unlistenAbortSignal();const i=this.subscriber;return n?(Object.defineProperty(e,"_error",{get:()=>n}),i&&i(!1),Promise.reject(n)):(Object.defineProperty(e,"_data",{get:()=>r}),i&&i(!1),r)}subscribe(e){this.subscriber=e}cancel(){this.controller.abort(),this.pendingKeys.forEach(((e,t)=>this.pendingKeys.delete(t)));let e=this.subscriber;e&&e(!0)}async resolveData(e){let t=!1;if(!this.done){let n=()=>this.cancel();e.addEventListener("abort",n),t=await new Promise((t=>{this.subscribe((r=>{e.removeEventListener("abort",n),(r||this.done)&&t(r)}))}))}return t}get done(){return 0===this.pendingKeys.size}get unwrappedData(){return te(null!==this.data&&this.done,"Can only unwrap data on initialized and settled deferreds"),Object.entries(this.data).reduce(((e,t)=>{let[n,r]=t;return Object.assign(e,{[n]:he(r)})}),{})}}function he(e){if(!function(e){return e instanceof Promise&&!0===e._tracked}(e))return e;if(e._error)throw e._error;return e._data}const fe=function(e,t){void 0===t&&(t=302);let n=t;"number"==typeof n?n={status:n}:void 0===n.status&&(n.status=302);let r=new Headers(n.headers);return r.set("Location",e),new Response(null,A({},n,{headers:r}))};class pe{constructor(e,t,n){this.status=e,this.statusText=t||"",this.data=n}}function ve(e){return e instanceof pe}const ge={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0},me={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0},ye=!("undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement);function be(e){te(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let t=q(e.routes),n=null,r=new Set,i=null,o=null,a=null,s=!1,l=Y(t,e.history.location,e.basename),c=null;if(null==l){let{matches:e,route:n,error:r}=Re(t);l=e,c={[n.id]:r}}let u,d,h=!l.some((e=>e.route.loader))||null!=e.hydrationData,f={historyAction:e.history.action,location:e.history.location,matches:l,initialized:h,navigation:ge,restoreScrollPosition:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||c,fetchers:new Map},p=R.Pop,v=!1,g=!1,m=!1,y=[],b=[],x=new Map,w=0,E=-1,_=new Map,k=new Set,S=new Map,P=new Map;function j(e){f=A({},f,e),r.forEach((e=>e(f)))}function C(t,n){var r;j(A({},null!=f.actionData&&null!=f.navigation.formMethod&&"loading"===f.navigation.state&&(null==(r=f.navigation.formAction)?void 0:r.split("?")[0])===t.pathname?{}:{actionData:null},n,n.loaderData?{loaderData:Oe(f.loaderData,n.loaderData,n.matches||[])}:{},{historyAction:p,location:t,initialized:!0,navigation:ge,revalidation:"idle",restoreScrollPosition:!f.navigation.formData&&H(t,n.matches||f.matches),preventScrollReset:v})),g||p===R.Pop||(p===R.Push?e.history.push(t,t.state):p===R.Replace&&e.history.replace(t,t.state)),p=R.Pop,v=!1,g=!1,m=!1,y=[],b=[]}async function T(n,r,s){d&&d.abort(),d=null,p=n,g=!0===(s&&s.startUninterruptedRevalidation),function(e,t){if(i&&o&&a){let n=t.map((e=>qe(e,f.loaderData))),r=o(e,n)||e.key;i[r]=a()}}(f.location,f.matches),v=!0===(s&&s.preventScrollReset);let l=s&&s.overrideNavigation,c=Y(t,r,e.basename);if(!c){let{matches:e,route:n,error:i}=Re(t);return G(),void C(r,{matches:e,loaderData:{},errors:{[n.id]:i}})}if(function(e,t){return e.pathname===t.pathname&&e.search===t.search&&e.hash!==t.hash}(f.location,r))return void C(r,{matches:c});d=new AbortController;let h,_,T=Ce(r,d.signal,s&&s.submission);if(s&&s.pendingError)_={[Me(c).route.id]:s.pendingError};else if(s&&s.submission){let e=await async function(e,t,n,r,i){let o;M(),j({navigation:A({state:"submitting",location:t},n)});let a=Ye(r,t);if(a.route.action){if(o=await je("action",e,a,r,u.basename),e.signal.aborted)return{shortCircuited:!0}}else o=Ie(t);if(Ve(o)){let e=A({state:"loading",location:F(f.location,o.location)},n);return await N(o,e,i&&i.replace),{shortCircuited:!0}}if(ze(o)){let e=Me(r,a.route.id);return!0!==(i&&i.replace)&&(p=R.Push),{pendingActionError:{[e.route.id]:o.error}}}if(Fe(o))throw new Error("defer() is not supported in actions");return{pendingActionData:{[a.route.id]:o.data}}}(T,r,s.submission,c,{replace:s.replace});if(e.shortCircuited)return;h=e.pendingActionData,_=e.pendingActionError,l=A({state:"loading",location:r},s.submission)}let{shortCircuited:D,loaderData:I,errors:L}=await async function(e,t,n,r,i,o,a,s){let l=r;if(!l){l={state:"loading",location:t,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0}}let[c,u]=ke(f,n,i,t,m,y,b,a,s,S);if(G((e=>!(n&&n.some((t=>t.route.id===e)))||c&&c.some((t=>t.route.id===e)))),0===c.length&&0===u.length)return C(t,{matches:n,loaderData:Oe(f.loaderData,{},n),errors:s||null,actionData:a||null}),{shortCircuited:!0};g||(u.forEach((e=>{let[t]=e,n=f.fetchers.get(t),r={state:"loading",data:n&&n.data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0};f.fetchers.set(t,r)})),j(A({navigation:l,actionData:a||f.actionData||null},u.length>0?{fetchers:new Map(f.fetchers)}:{})));E=++w,u.forEach((e=>{let[t]=e;return x.set(t,d)}));let{results:h,loaderResults:p,fetcherResults:v}=await O(f.matches,n,c,u,e);if(e.signal.aborted)return{shortCircuited:!0};u.forEach((e=>{let[t]=e;return x.delete(t)}));let _=Le(h);if(_){let e=Ee(f,_);return await N(_,e,o),{shortCircuited:!0}}let{loaderData:T,errors:D}=Ne(f,n,c,p,s,u,v,P);P.forEach(((e,t)=>{e.subscribe((n=>{(n||e.done)&&P.delete(t)}))})),function(){let e=[];for(let t of k){let n=f.fetchers.get(t);te(n,"Expected fetcher: "+t),"loading"===n.state&&(k.delete(t),e.push(t))}z(e)}();let M=V(E);return A({loaderData:T,errors:D},M||u.length>0?{fetchers:new Map(f.fetchers)}:{})}(T,r,c,l,s&&s.submission,s&&s.replace,h,_);D||(d=null,C(r,{matches:c,loaderData:I,errors:L}))}function D(e){return f.fetchers.get(e)||me}async function N(e,t,n){e.revalidate&&(m=!0),te(t.location,"Expected a location on the redirect navigation"),d=null;let r=!0===n?R.Replace:R.Push;await T(r,t.location,{overrideNavigation:t})}async function O(e,t,n,r,i){let o=await Promise.all([...n.map((e=>je("loader",i,e,t,u.basename))),...r.map((e=>{let[,t,n,r]=e;return je("loader",Ce(t,i.signal),n,r,u.basename)}))]),a=o.slice(0,n.length),s=o.slice(n.length);return await Promise.all([Ge(e,n,a,i.signal,!1,f.loaderData),Ge(e,r.map((e=>{let[,,t]=e;return t})),s,i.signal,!0)]),{results:o,loaderResults:a,fetcherResults:s}}function M(){m=!0,y.push(...G()),S.forEach(((e,t)=>{x.has(t)&&(b.push(t),B(t))}))}function I(e,t,n){let r=Me(f.matches,t);L(e),j({errors:{[r.route.id]:n},fetchers:new Map(f.fetchers)})}function L(e){x.has(e)&&B(e),S.delete(e),_.delete(e),k.delete(e),f.fetchers.delete(e)}function B(e){let t=x.get(e);te(t,"Expected fetch controller: "+e),t.abort(),x.delete(e)}function z(e){for(let t of e){let e={state:"idle",data:D(t).data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0};f.fetchers.set(t,e)}}function V(e){let t=[];for(let[n,r]of _)if(r<e){let e=f.fetchers.get(n);te(e,"Expected fetcher: "+n),"loading"===e.state&&(B(n),_.delete(n),t.push(n))}return z(t),t.length>0}function G(e){let t=[];return P.forEach(((n,r)=>{e&&!e(r)||(n.cancel(),t.push(r),P.delete(r))})),t}function H(e,t){if(i&&o&&a){let n=t.map((e=>qe(e,f.loaderData))),r=o(e,n)||e.key,a=i[r];if("number"==typeof a)return a}return null}return u={get basename(){return e.basename},get state(){return f},get routes(){return t},initialize:function(){return n=e.history.listen((e=>{let{action:t,location:n}=e;return T(t,n)})),f.initialized||T(R.Pop,f.location),u},subscribe:function(e){return r.add(e),()=>r.delete(e)},enableScrollRestoration:function(e,t,n){if(i=e,a=t,o=n||(e=>e.key),!s&&f.navigation===ge){s=!0;let e=H(f.location,f.matches);null!=e&&j({restoreScrollPosition:e})}return()=>{i=null,a=null,o=null}},navigate:async function(t,n){if("number"==typeof t)return void e.history.go(t);let{path:r,submission:i,error:o}=we(t,n),a=F(f.location,r,n&&n.state);a=e.history.encodeLocation(a);let s=!0===(n&&n.replace)||null!=i?R.Replace:R.Push,l=n&&"preventScrollReset"in n?!0===n.preventScrollReset:void 0;return await T(s,a,{submission:i,pendingError:o,preventScrollReset:l,replace:n&&n.replace})},fetch:function(n,r,i,o){if(ye)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");x.has(n)&&B(n);let a=Y(t,i,e.basename);if(!a)return void I(n,r,new pe(404,"Not Found",null));let{path:s,submission:l}=we(i,o,!0),c=Ye(a,s);l?async function(n,r,i,o,a,s){if(M(),S.delete(n),!o.route.action){let{error:e}=Ie(i);return void I(n,r,e)}let l=f.fetchers.get(n),c=A({state:"submitting"},s,{data:l&&l.data});f.fetchers.set(n,c),j({fetchers:new Map(f.fetchers)});let h=new AbortController,v=Ce(i,h.signal,s);x.set(n,h);let g=await je("action",v,o,a,u.basename);if(v.signal.aborted)return void(x.get(n)===h&&x.delete(n));if(Ve(g)){x.delete(n),k.add(n);let e=A({state:"loading"},s,{data:void 0});f.fetchers.set(n,e),j({fetchers:new Map(f.fetchers)});let t=A({state:"loading",location:F(f.location,g.location)},s);return void(await N(g,t))}if(ze(g))return void I(n,r,g.error);Fe(g)&&te(!1,"defer() is not supported in actions");let T=f.navigation.location||f.location,D=Ce(T,h.signal),R="idle"!==f.navigation.state?Y(t,f.navigation.location,e.basename):f.matches;te(R,"Didn't find any matches after fetcher action");let L=++w;_.set(n,L);let B=A({state:"loading",data:g.data},s);f.fetchers.set(n,B);let[z,G]=ke(f,R,s,T,m,y,b,{[o.route.id]:g.data},void 0,S);G.filter((e=>{let[t]=e;return t!==n})).forEach((e=>{let[t]=e,n=f.fetchers.get(t),r={state:"loading",data:n&&n.data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0};f.fetchers.set(t,r),x.set(t,h)})),j({fetchers:new Map(f.fetchers)});let{results:H,loaderResults:W,fetcherResults:q}=await O(f.matches,R,z,G,D);if(h.signal.aborted)return;_.delete(n),x.delete(n),G.forEach((e=>{let[t]=e;return x.delete(t)}));let U=Le(H);if(U){let e=Ee(f,U);return void(await N(U,e))}let{loaderData:X,errors:$}=Ne(f,f.matches,z,W,void 0,G,q,P),K={state:"idle",data:g.data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0};f.fetchers.set(n,K);let Z=V(L);"loading"===f.navigation.state&&L>E?(te(p,"Expected pending action"),d&&d.abort(),C(f.navigation.location,{matches:R,loaderData:X,errors:$,fetchers:new Map(f.fetchers)})):(j(A({errors:$,loaderData:Oe(f.loaderData,X,R)},Z?{fetchers:new Map(f.fetchers)}:{})),m=!1)}(n,r,s,c,a,l):(S.set(n,[s,c,a]),async function(e,t,n,r,i){let o=f.fetchers.get(e),a={state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,data:o&&o.data};f.fetchers.set(e,a),j({fetchers:new Map(f.fetchers)});let s=new AbortController,l=Ce(n,s.signal);x.set(e,s);let c=await je("loader",l,r,i,u.basename);Fe(c)&&(c=await He(c,l.signal,!0)||c);x.get(e)===s&&x.delete(e);if(l.signal.aborted)return;if(Ve(c)){let e=Ee(f,c);return void(await N(c,e))}if(ze(c)){let n=Me(f.matches,t);return f.fetchers.delete(e),void j({fetchers:new Map(f.fetchers),errors:{[n.route.id]:c.error}})}te(!Fe(c),"Unhandled fetcher deferred data");let d={state:"idle",data:c.data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0};f.fetchers.set(e,d),j({fetchers:new Map(f.fetchers)})}(n,r,s,c,a))},revalidate:function(){M(),j({revalidation:"loading"}),"submitting"!==f.navigation.state&&("idle"!==f.navigation.state?T(p||f.historyAction,f.navigation.location,{overrideNavigation:f.navigation}):T(f.historyAction,f.location,{startUninterruptedRevalidation:!0}))},createHref:t=>e.history.createHref(t),getFetcher:D,deleteFetcher:L,dispose:function(){n&&n(),r.clear(),d&&d.abort(),f.fetchers.forEach(((e,t)=>L(t)))},_internalFetchControllers:x,_internalActiveDeferreds:P},u}const xe=new Set(["POST","PUT","PATCH","DELETE"]);new Set(["GET","HEAD",...xe]);function we(e,t,n){void 0===n&&(n=!1);let r="string"==typeof e?e:z(e);if(!t||!("formMethod"in t)&&!("formData"in t))return{path:r};if(null!=t.formMethod&&"get"!==t.formMethod)return{path:r,submission:{formMethod:t.formMethod,formAction:Be(r),formEncType:t&&t.formEncType||"application/x-www-form-urlencoded",formData:t.formData}};if(!t.formData)return{path:r};let i=V(r);try{let e=Te(t.formData);n&&i.search&&We(i.search)&&e.append("index",""),i.search="?"+e}catch(w){return{path:r,error:new pe(400,"Bad Request","Cannot submit binary form data using GET")}}return{path:z(i)}}function Ee(e,t){let{formMethod:n,formAction:r,formEncType:i,formData:o}=e.navigation;return{state:"loading",location:F(e.location,t.location),formMethod:n||void 0,formAction:r||void 0,formEncType:i||void 0,formData:o||void 0}}function _e(e,t){let n=e;if(t){let r=e.findIndex((e=>e.route.id===t));r>=0&&(n=e.slice(0,r))}return n}function ke(e,t,n,r,i,o,a,s,l,c){let u=l?Object.values(l)[0]:s?Object.values(s)[0]:null,d=_e(t,l?Object.keys(l)[0]:void 0).filter(((t,a)=>null!=t.route.loader&&(function(e,t,n){let r=!t||n.route.id!==t.route.id,i=void 0===e[n.route.id];return r||i}(e.loaderData,e.matches[a],t)||o.some((e=>e===t.route.id))||Pe(e.location,e.matches[a],n,r,t,i,u)))),h=[];return c&&c.forEach(((e,t)=>{let[r,o,s]=e;if(a.includes(t))h.push([t,r,o,s]);else if(i){Pe(r,o,n,r,o,i,u)&&h.push([t,r,o,s])}})),[d,h]}function Se(e,t){let n=e.route.path;return e.pathname!==t.pathname||n&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function Pe(e,t,n,r,i,o,a){let s=G(e),l=t.params,c=G(r),u=i.params,d=Se(t,i)||s.toString()===c.toString()||s.search!==c.search||o;if(i.route.shouldRevalidate){let e=i.route.shouldRevalidate(A({currentUrl:s,currentParams:l,nextUrl:c,nextParams:u},n,{actionResult:a,defaultShouldRevalidate:d}));if("boolean"==typeof e)return e}return d}async function je(e,t,n,r,i,o,a){let s,l,c;void 0===o&&(o=!1),void 0===a&&(a=!1);let u=new Promise(((e,t)=>c=t)),d=()=>c();t.signal.addEventListener("abort",d);try{let r=n.route[e];te(r,"Could not find the "+e+' to run on the "'+n.route.id+'" route'),l=await Promise.race([r({request:t,params:n.params}),u])}catch(w){s=W.error,l=w}finally{t.signal.removeEventListener("abort",d)}if(l instanceof Response){let e,c=l.status;if(c>=300&&c<=399){let e=l.headers.get("Location");te(e,"Redirects returned/thrown from loaders/actions must have a Location header");let a=oe(e,ie(r.slice(0,r.indexOf(n)+1)).map((e=>e.pathnameBase)),G(t.url).pathname);if(te(z(a),"Unable to resolve redirect location: "+l.headers.get("Location")),i){let e=a.pathname;a.pathname="/"===e?i:ae([i,e])}if(e=z(a),o)throw l.headers.set("Location",e),l;return{type:W.redirect,status:c,location:e,revalidate:null!==l.headers.get("X-Remix-Revalidate")}}if(a)throw{type:s||W.data,response:l};let u=l.headers.get("Content-Type");return e=u&&u.startsWith("application/json")?await l.json():await l.text(),s===W.error?{type:s,error:new pe(c,l.statusText,e),headers:l.headers}:{type:W.data,data:e,statusCode:l.status,headers:l.headers}}return s===W.error?{type:s,error:l}:l instanceof de?{type:W.deferred,deferredData:l}:{type:W.data,data:l}}function Ce(e,t,n){let r=G(Be(e)).toString(),i={signal:t};if(n){let{formMethod:e,formEncType:t,formData:r}=n;i.method=e.toUpperCase(),i.body="application/x-www-form-urlencoded"===t?Te(r):r}return new Request(r,i)}function Te(e){let t=new URLSearchParams;for(let[n,r]of e.entries())te("string"==typeof r,'File inputs are not supported with encType "application/x-www-form-urlencoded", please use "multipart/form-data" instead.'),t.append(n,r);return t}function De(e,t,n,r,i){let o,a={},s=null,l=!1,c={};return n.forEach(((n,u)=>{let d=t[u].route.id;if(te(!Ve(n),"Cannot handle redirect results in processLoaderData"),ze(n)){let t=Me(e,d),i=n.error;r&&(i=Object.values(r)[0],r=void 0),s=Object.assign(s||{},{[t.route.id]:i}),l||(l=!0,o=ve(n.error)?n.error.status:500),n.headers&&(c[d]=n.headers)}else Fe(n)?(i&&i.set(d,n.deferredData),a[d]=n.deferredData.data):(a[d]=n.data,null==n.statusCode||200===n.statusCode||l||(o=n.statusCode),n.headers&&(c[d]=n.headers))})),r&&(s=r),{loaderData:a,errors:s,statusCode:o||200,loaderHeaders:c}}function Ne(e,t,n,r,i,o,a,s){let{loaderData:l,errors:c}=De(t,n,r,i,s);for(let u=0;u<o.length;u++){let[t,,n]=o[u];te(void 0!==a&&void 0!==a[u],"Did not find corresponding fetcher result");let r=a[u];if(ze(r)){let i=Me(e.matches,n.route.id);c&&c[i.route.id]||(c=A({},c,{[i.route.id]:r.error})),e.fetchers.delete(t)}else{if(Ve(r))throw new Error("Unhandled fetcher revalidation redirect");if(Fe(r))throw new Error("Unhandled fetcher deferred data");{let n={state:"idle",data:r.data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0};e.fetchers.set(t,n)}}}return{loaderData:l,errors:c}}function Oe(e,t,n){let r=A({},t);return n.forEach((n=>{let i=n.route.id;void 0===t[i]&&void 0!==e[i]&&(r[i]=e[i])})),r}function Me(e,t){let n=t?e.slice(0,e.findIndex((e=>e.route.id===t))+1):[...e];return n.reverse().find((e=>!0===e.route.hasErrorBoundary))||e[0]}function Ae(e,t,n){let r=e.find((e=>e.index||!e.path||"/"===e.path))||{id:"__shim-"+t+"-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:r}],route:r,error:new pe(t,n,null)}}function Re(e){return Ae(e,404,"Not Found")}function Ie(e){let t="string"==typeof e?e:z(e);return console.warn("You're trying to submit to a route that does not have an action. To fix this, please add an `action` function to the route for ["+t+"]"),{type:W.error,error:new pe(405,"Method Not Allowed","")}}function Le(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(Ve(n))return n}}function Be(e){return z(A({},"string"==typeof e?V(e):e,{hash:""}))}function Fe(e){return e.type===W.deferred}function ze(e){return e.type===W.error}function Ve(e){return(e&&e.type)===W.redirect}async function Ge(e,t,n,r,i,o){for(let a=0;a<n.length;a++){let s=n[a],l=t[a],c=e.find((e=>e.route.id===l.route.id)),u=null!=c&&!Se(c,l)&&void 0!==(o&&o[l.route.id]);Fe(s)&&(i||u)&&await He(s,r,i).then((e=>{e&&(n[a]=e||n[a])}))}}async function He(e,t,n){if(void 0===n&&(n=!1),!(await e.deferredData.resolveData(t))){if(n)try{return{type:W.data,data:e.deferredData.unwrappedData}}catch(w){return{type:W.error,error:w}}return{type:W.data,data:e.deferredData.data}}}function We(e){return new URLSearchParams(e).getAll("index").some((e=>""===e))}function qe(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],handle:n.handle}}function Ye(e,t){let n="string"==typeof t?V(t).search:t.search;if(e[e.length-1].route.index&&We(n||""))return e[e.length-1];let r=ie(e);return r[r.length-1]}function Ue(){return Ue=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ue.apply(this,arguments)}const Xe="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},{useState:$e,useEffect:Ke,useLayoutEffect:Ze,useDebugValue:Qe}=r;function Je(e){const t=e.getSnapshot,n=e.value;try{const e=t();return!Xe(n,e)}catch(r){return!0}}const et=!!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement)?function(e,t,n){return t()}:function(e,t,n){const r=t(),[{inst:i},o]=$e({inst:{value:r,getSnapshot:t}});return Ze((()=>{i.value=r,i.getSnapshot=t,Je(i)&&o({inst:i})}),[e,r,t]),Ke((()=>{Je(i)&&o({inst:i});return e((()=>{Je(i)&&o({inst:i})}))}),[e]),Qe(r),r};const tt=r.createContext(null);const nt=r.createContext(null);const rt=r.createContext(null);const it=r.createContext(null);const ot=r.createContext(null);const at=r.createContext({outlet:null,matches:[]});const st=r.createContext(null);function lt(){return null!=r.useContext(ot)}function ct(){return lt()||te(!1),r.useContext(ot).location}function ut(){lt()||te(!1);let{basename:e,navigator:t}=r.useContext(it),{matches:n}=r.useContext(at),{pathname:i}=ct(),o=JSON.stringify(ie(n).map((e=>e.pathnameBase))),a=r.useRef(!1);return r.useEffect((()=>{a.current=!0})),r.useCallback((function(n,r){if(void 0===r&&(r={}),!a.current)return;if("number"==typeof n)return void t.go(n);let s=oe(n,JSON.parse(o),i,"path"===r.relative);"/"!==e&&(s.pathname="/"===s.pathname?e:ae([e,s.pathname])),(r.replace?t.replace:t.push)(s,r.state,r)}),[e,t,o,i])}const dt=r.createContext(null);function ht(){let{matches:e}=r.useContext(at),t=e[e.length-1];return t?t.params:{}}function ft(e,t){let{relative:n}=void 0===t?{}:t,{matches:i}=r.useContext(at),{pathname:o}=ct(),a=JSON.stringify(ie(i).map((e=>e.pathnameBase)));return r.useMemo((()=>oe(e,JSON.parse(a),o,"path"===n)),[e,a,o,n])}function pt(){let e=function(){var e;let t=r.useContext(st),n=xt(bt.UseRouteError),i=r.useContext(at),o=i.matches[i.matches.length-1];if(t)return t;return i||te(!1),!o.route.id&&te(!1),null==(e=n.errors)?void 0:e[o.route.id]}(),t=ve(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,i="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:i},a={padding:"2px 4px",backgroundColor:i};return r.createElement(r.Fragment,null,r.createElement("h2",null,"Unhandled Thrown Error!"),r.createElement("h3",{style:{fontStyle:"italic"}},t),n?r.createElement("pre",{style:o},n):null,r.createElement("p",null,"\ud83d\udcbf Hey developer \ud83d\udc4b"),r.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own\xa0",r.createElement("code",{style:a},"errorElement")," props on\xa0",r.createElement("code",{style:a},"<Route>")))}class vt extends r.Component{constructor(e){super(e),this.state={location:e.location,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location?{error:e.error,location:e.location}:{error:e.error||t.error,location:t.location}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return this.state.error?r.createElement(st.Provider,{value:this.state.error,children:this.props.component}):this.props.children}}function gt(e){let{routeContext:t,match:n,children:i}=e,o=r.useContext(tt);return o&&n.route.errorElement&&(o._deepestRenderedBoundaryId=n.route.id),r.createElement(at.Provider,{value:t},i)}function mt(e,t,n){if(void 0===t&&(t=[]),null==e){if(null==n||!n.errors)return null;e=n.matches}let i=e,o=null==n?void 0:n.errors;if(null!=o){let e=i.findIndex((e=>e.route.id&&(null==o?void 0:o[e.route.id])));e>=0||te(!1),i=i.slice(0,Math.min(i.length,e+1))}return i.reduceRight(((e,a,s)=>{let l=a.route.id?null==o?void 0:o[a.route.id]:null,c=n?a.route.errorElement||r.createElement(pt,null):null,u=()=>r.createElement(gt,{match:a,routeContext:{outlet:e,matches:t.concat(i.slice(0,s+1))}},l?c:void 0!==a.route.element?a.route.element:e);return n&&(a.route.errorElement||0===s)?r.createElement(vt,{location:n.location,component:c,error:l,children:u()}):u()}),null)}var yt,bt;function xt(e){let t=r.useContext(rt);return t||te(!1),t}function wt(e){return xt(bt.UseRouteLoaderData).loaderData[e]}!function(e){e.UseRevalidator="useRevalidator"}(yt||(yt={})),function(e){e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator"}(bt||(bt={}));function Et(e){let{fallbackElement:t,router:n}=e,i=et(n.subscribe,(()=>n.state),(()=>n.state)),o=r.useMemo((()=>({createHref:n.createHref,go:e=>n.navigate(e),push:(e,t,r)=>n.navigate(e,{state:t,preventScrollReset:null==r?void 0:r.preventScrollReset}),replace:(e,t,r)=>n.navigate(e,{replace:!0,state:t,preventScrollReset:null==r?void 0:r.preventScrollReset})})),[n]),a=n.basename||"/";return r.createElement(nt.Provider,{value:{router:n,navigator:o,static:!1,basename:a}},r.createElement(rt.Provider,{value:i},r.createElement(St,{basename:n.basename,location:n.state.location,navigationType:n.state.historyAction,navigator:o},n.state.initialized?r.createElement(Pt,null):t)))}function _t(e){return function(e){let t=r.useContext(at).outlet;return t?r.createElement(dt.Provider,{value:e},t):t}(e.context)}function kt(e){te(!1)}function St(e){let{basename:t="/",children:n=null,location:i,navigationType:o=R.Pop,navigator:a,static:s=!1}=e;lt()&&te(!1);let l=t.replace(/^\/*/,"/"),c=r.useMemo((()=>({basename:l,navigator:a,static:s})),[l,a,s]);"string"==typeof i&&(i=V(i));let{pathname:u="/",search:d="",hash:h="",state:f=null,key:p="default"}=i,v=r.useMemo((()=>{let e=ee(u,l);return null==e?null:{pathname:e,search:d,hash:h,state:f,key:p}}),[l,u,d,h,f,p]);return null==v?null:r.createElement(it.Provider,{value:c},r.createElement(ot.Provider,{children:n,value:{location:v,navigationType:o}}))}function Pt(e){let{children:t,location:n}=e,i=r.useContext(nt);return function(e,t){lt()||te(!1);let n=r.useContext(rt),{matches:i}=r.useContext(at),o=i[i.length-1],a=o?o.params:{},s=(o&&o.pathname,o?o.pathnameBase:"/");o&&o.route;let l,c=ct();if(t){var u;let e="string"==typeof t?V(t):t;"/"===s||(null==(u=e.pathname)?void 0:u.startsWith(s))||te(!1),l=e}else l=c;let d=l.pathname||"/",h=Y(e,{pathname:"/"===s?d:d.slice(s.length)||"/"}),f=mt(h&&h.map((e=>Object.assign({},e,{params:Object.assign({},a,e.params),pathname:ae([s,e.pathname]),pathnameBase:"/"===e.pathnameBase?s:ae([s,e.pathnameBase])}))),i,n||void 0);return t&&f?r.createElement(ot.Provider,{value:{location:Ue({pathname:"/",search:"",hash:"",state:null,key:"default"},l),navigationType:R.Pop}},f):f}(i&&!t?i.router.routes:Tt(t),n)}var jt;!function(e){e[e.pending=0]="pending",e[e.success=1]="success",e[e.error=2]="error"}(jt||(jt={}));new Promise((()=>{}));class Ct extends r.Component{constructor(e){super(e),this.state={error:null}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){console.error("<Await> caught the following error during render",e,t)}render(){let{children:e,errorElement:t,resolve:n}=this.props,r=null,i=jt.pending;if(n instanceof Promise)if(this.state.error){jt.error;let e=this.state.error;Promise.reject().catch((()=>{})),Object.defineProperty(r,"_tracked",{get:()=>!0}),Object.defineProperty(r,"_error",{get:()=>e})}else n._tracked?(n,void 0!==r._error?jt.error:void 0!==r._data?jt.success:jt.pending):(jt.pending,Object.defineProperty(n,"_tracked",{get:()=>!0}),n.then((e=>Object.defineProperty(n,"_data",{get:()=>e})),(e=>Object.defineProperty(n,"_error",{get:()=>e}))));else jt.success,Promise.resolve(),Object.defineProperty(r,"_tracked",{get:()=>!0}),Object.defineProperty(r,"_data",{get:()=>n});if(i===jt.error&&r._error instanceof AbortedDeferredError)throw neverSettledPromise;if(i===jt.error&&!t)throw r._error;if(i===jt.error)return React.createElement(AwaitContext.Provider,{value:r,children:t});if(i===jt.success)return React.createElement(AwaitContext.Provider,{value:r,children:e});throw r}}function Tt(e,t){void 0===t&&(t=[]);let n=[];return r.Children.forEach(e,((e,i)=>{if(!r.isValidElement(e))return;if(e.type===r.Fragment)return void n.push.apply(n,Tt(e.props.children,t));e.type!==kt&&te(!1),e.props.index&&e.props.children&&te(!1);let o=[...t,i],a={id:e.props.id||o.join("-"),caseSensitive:e.props.caseSensitive,element:e.props.element,index:e.props.index,path:e.props.path,loader:e.props.loader,action:e.props.action,errorElement:e.props.errorElement,hasErrorBoundary:null!=e.props.errorElement,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle};e.props.children&&(a.children=Tt(e.props.children,o)),n.push(a)})),n}function Dt(e){return e.map((e=>{let t=Ue({},e);return null==t.hasErrorBoundary&&(t.hasErrorBoundary=null!=t.errorElement),t.children&&(t.children=Dt(t.children)),t}))}function Nt(){return Nt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Nt.apply(this,arguments)}function Ot(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}function Mt(e){return void 0===e&&(e=""),new URLSearchParams("string"==typeof e||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce(((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map((e=>[n,e])):[[n,r]])}),[]))}const At=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset"];const Rt=r.forwardRef((function(e,t){let{onClick:n,relative:i,reloadDocument:o,replace:a,state:s,target:l,to:c,preventScrollReset:u}=e,d=Ot(e,At),h=function(e,t){let{relative:n}=void 0===t?{}:t;lt()||te(!1);let{basename:i,navigator:o}=r.useContext(it),{hash:a,pathname:s,search:l}=ft(e,{relative:n}),c=s;return"/"!==i&&(c="/"===s?i:ae([i,s])),o.createHref({pathname:c,search:l,hash:a})}(c,{relative:i}),f=function(e,t){let{target:n,replace:i,state:o,preventScrollReset:a,relative:s}=void 0===t?{}:t,l=ut(),c=ct(),u=ft(e,{relative:s});return r.useCallback((t=>{if(function(e,t){return!(0!==e.button||t&&"_self"!==t||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e))}(t,n)){t.preventDefault();let n=void 0!==i?i:z(c)===z(u);l(e,{replace:n,state:o,preventScrollReset:a,relative:s})}}),[c,l,u,i,o,n,e,a,s])}(c,{replace:a,state:s,target:l,preventScrollReset:u,relative:i});return r.createElement("a",Nt({},d,{href:h,onClick:o?n:function(e){n&&n(e),e.defaultPrevented||f(e)},ref:t,target:l}))}));var It,Lt;function Bt(e){let t=r.useRef(Mt(e)),n=ct(),i=r.useMemo((()=>function(e,t){let n=Mt(e);for(let r of t.keys())n.has(r)||t.getAll(r).forEach((e=>{n.append(r,e)}));return n}(n.search,t.current)),[n.search]),o=ut(),a=r.useCallback(((e,t)=>{const n=Mt("function"==typeof e?e(i):e);o("?"+n,t)}),[o,i]);return[i,a]}(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmitImpl="useSubmitImpl",e.UseFetcher="useFetcher"})(It||(It={})),function(e){e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"}(Lt||(Lt={}));const Ft=r.forwardRef((function({title:e,titleId:t,...n},i){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:i,"aria-labelledby":t},n),e?r.createElement("title",{id:t},e):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.25 11.25l.041-.02a.75.75 0 011.063.852l-.708 2.836a.75.75 0 001.063.853l.041-.021M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9-3.75h.008v.008H12V8.25z"}))}));const zt=r.forwardRef((function({title:e,titleId:t,...n},i){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:i,"aria-labelledby":t},n),e?r.createElement("title",{id:t},e):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.25 9l-3 3m0 0l3 3m-3-3h7.5M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}))}));const Vt=r.forwardRef((function({title:e,titleId:t,...n},i){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:i,"aria-labelledby":t},n),e?r.createElement("title",{id:t},e):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5M16.5 12L12 16.5m0 0L7.5 12m4.5 4.5V3"}))}));var Gt=n(72779),Ht=n.n(Gt);function Wt(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}const qt=["className","children"];const Yt=function(e){const{className:t,children:n}=e,r=Wt(e,qt);return w("select",Object.assign({className:`flex w-auto items-center rounded-md rounded-md border border-slate-300 bg-white px-4 py-2 text-sm font-medium text-slate-700 shadow-sm hover:bg-slate-50 dark:border-slate-600 dark:bg-slate-800 dark:text-slate-300 hover:dark:bg-slate-700 ${t}`},r,{children:n}))},Ut=(0,r.memo)((function({projects:e,selectedProject:t,selectedProjectChange:n,lastPerfReport:r}){return w("div",{"data-cy":"debugger-panel",className:"flex-column flex w-auto items-center items-center justify-items-center justify-items-center gap-4 border-b border-slate-900/10 bg-slate-50 p-4 transition-all dark:border-slate-300/10 dark:bg-transparent",children:[w("h4",{className:"dark:text-sidebar-title-dark mr-4 text-lg font-normal",children:"Debugger"}),w(Yt,{"data-cy":"project-select",onChange:e=>n(e.currentTarget.value),children:e.map((e=>w("option",{value:e.id,selected:e.id===t,children:e.label},e.id)))}),w("p",{className:"text-sm",children:["Last render took ",r.renderTime,"ms:"," ",w("b",{className:"text-medium font-mono",children:[r.numNodes," nodes"]})," ","|"," ",w("b",{className:"text-medium font-mono",children:[r.numEdges," edges"]}),"."]})]})}));function Xt(){return(0,r.useRef)($t()).current}function $t(){return{exclude:window.exclude,watch:window.watch,localMode:window.localMode,projectGraphResponse:window.projectGraphResponse,environment:window.environment,appConfig:Object.assign({},window.appConfig,{showExperimentalFeatures:"true"===localStorage.getItem("showExperimentalFeatures")||window.appConfig.showExperimentalFeatures}),useXstateInspect:window.useXstateInspect}}function Kt(e,t,...n){if(e in t){let r=t[e];return"function"==typeof r?r(...n):r}let r=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map((e=>`"${e}"`)).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,Kt),r}var Zt=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(Zt||{}),Qt=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(Qt||{});function Jt({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:i,visible:o=!0,name:a}){let s=tn(t,e);if(o)return en(s,n,r,a);let l=null!=i?i:0;if(2&l){let{static:e=!1,...t}=s;if(e)return en(t,n,r,a)}if(1&l){let{unmount:e=!0,...t}=s;return Kt(e?0:1,{0:()=>null,1:()=>en({...t,hidden:!0,style:{display:"none"}},n,r,a)})}return en(s,n,r,a)}function en(e,t={},n,i){let{as:o=n,children:a,refName:s="ref",...l}=on(e,["unmount","static"]),c=void 0!==e.ref?{[s]:e.ref}:{},u="function"==typeof a?a(t):a;l.className&&"function"==typeof l.className&&(l.className=l.className(t));let d={};if(t){let e=!1,n=[];for(let[r,i]of Object.entries(t))"boolean"==typeof i&&(e=!0),!0===i&&n.push(r);e&&(d["data-headlessui-state"]=n.join(" "))}if(o===r.Fragment&&Object.keys(rn(l)).length>0){if(!(0,r.isValidElement)(u)||Array.isArray(u)&&u.length>1)throw new Error(['Passing props on "Fragment"!',"",`The current component <${i} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(l).map((e=>` - ${e}`)).join("\n"),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map((e=>` - ${e}`)).join("\n")].join("\n"));return(0,r.cloneElement)(u,Object.assign({},tn(u.props,rn(on(l,["ref"]))),d,c,function(...e){return{ref:e.every((e=>null==e))?void 0:t=>{for(let n of e)null!=n&&("function"==typeof n?n(t):n.current=t)}}}(u.ref,c.ref)))}return(0,r.createElement)(o,Object.assign({},on(l,["ref"]),o!==r.Fragment&&c,o!==r.Fragment&&d),u)}function tn(...e){if(0===e.length)return{};if(1===e.length)return e[0];let t={},n={};for(let r of e)for(let e in r)e.startsWith("on")&&"function"==typeof r[e]?(null!=n[e]||(n[e]=[]),n[e].push(r[e])):t[e]=r[e];if(t.disabled||t["aria-disabled"])return Object.assign(t,Object.fromEntries(Object.keys(n).map((e=>[e,void 0]))));for(let r in n)Object.assign(t,{[r](e,...t){let i=n[r];for(let n of i){if((e instanceof Event||(null==e?void 0:e.nativeEvent)instanceof Event)&&e.defaultPrevented)return;n(e,...t)}}});return t}function nn(e){var t;return Object.assign((0,r.forwardRef)(e),{displayName:null!=(t=e.displayName)?t:e.name})}function rn(e){let t=Object.assign({},e);for(let n in t)void 0===t[n]&&delete t[n];return t}function on(e,t=[]){let n=Object.assign({},e);for(let r of t)r in n&&delete n[r];return n}function an(){let e=[],t=[],n={enqueue(e){t.push(e)},addEventListener:(e,t,r,i)=>(e.addEventListener(t,r,i),n.add((()=>e.removeEventListener(t,r,i)))),requestAnimationFrame(...e){let t=requestAnimationFrame(...e);return n.add((()=>cancelAnimationFrame(t)))},nextFrame:(...e)=>n.requestAnimationFrame((()=>n.requestAnimationFrame(...e))),setTimeout(...e){let t=setTimeout(...e);return n.add((()=>clearTimeout(t)))},microTask(...e){let t={current:!0};return function(e){"function"==typeof queueMicrotask?queueMicrotask(e):Promise.resolve().then(e).catch((e=>setTimeout((()=>{throw e}))))}((()=>{t.current&&e[0]()})),n.add((()=>{t.current=!1}))},add:t=>(e.push(t),()=>{let n=e.indexOf(t);if(n>=0){let[t]=e.splice(n,1);t()}}),dispose(){for(let t of e.splice(0))t()},async workQueue(){for(let e of t.splice(0))await e()}};return n}function sn(){let[e]=(0,r.useState)(an);return(0,r.useEffect)((()=>()=>e.dispose()),[e]),e}const ln="undefined"==typeof window||"undefined"==typeof document;let cn=ln?r.useEffect:r.useLayoutEffect;function un(e){let t=(0,r.useRef)(e);return cn((()=>{t.current=e}),[e]),t}let dn=function(e){let t=un(e);return r.default.useCallback(((...e)=>t.current(...e)),[t])},hn=Symbol();function fn(...e){let t=(0,r.useRef)(e);(0,r.useEffect)((()=>{t.current=e}),[e]);let n=dn((e=>{for(let n of t.current)null!=n&&("function"==typeof n?n(e):n.current=e)}));return e.every((e=>null==e||(null==e?void 0:e[hn])))?void 0:n}let pn={serverHandoffComplete:!1};function vn(){let[e,t]=(0,r.useState)(pn.serverHandoffComplete);return(0,r.useEffect)((()=>{!0!==e&&t(!0)}),[e]),(0,r.useEffect)((()=>{!1===pn.serverHandoffComplete&&(pn.serverHandoffComplete=!0)}),[]),e}var gn;let mn=0;function yn(){return++mn}let bn=null!=(gn=r.default.useId)?gn:function(){let e=vn(),[t,n]=r.default.useState(e?yn:null);return cn((()=>{null===t&&n(yn())}),[t]),null!=t?""+t:void 0};var xn=(e=>(e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.Delete="Delete",e.ArrowLeft="ArrowLeft",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab",e))(xn||{});var wn=(e=>(e[e.First=0]="First",e[e.Previous=1]="Previous",e[e.Next=2]="Next",e[e.Last=3]="Last",e[e.Specific=4]="Specific",e[e.Nothing=5]="Nothing",e))(wn||{});function En(e,t){let n=t.resolveItems();if(n.length<=0)return null;let r=t.resolveActiveIndex(),i=null!=r?r:-1,o=(()=>{switch(e.focus){case 0:return n.findIndex((e=>!t.resolveDisabled(e)));case 1:{let e=n.slice().reverse().findIndex(((e,n,r)=>!(-1!==i&&r.length-n-1>=i)&&!t.resolveDisabled(e)));return-1===e?e:n.length-1-e}case 2:return n.findIndex(((e,n)=>!(n<=i)&&!t.resolveDisabled(e)));case 3:{let e=n.slice().reverse().findIndex((e=>!t.resolveDisabled(e)));return-1===e?e:n.length-1-e}case 4:return n.findIndex((n=>t.resolveId(n)===e.id));case 5:return null;default:!function(e){throw new Error("Unexpected object: "+e)}(e)}})();return-1===o?r:o}function _n(e){let t=e.parentElement,n=null;for(;t&&!(t instanceof HTMLFieldSetElement);)t instanceof HTMLLegendElement&&(n=t),t=t.parentElement;let r=""===(null==t?void 0:t.getAttribute("disabled"));return(!r||!function(e){if(!e)return!1;let t=e.previousElementSibling;for(;null!==t;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}(n))&&r}function kn(e){return ln?null:e instanceof Node?e.ownerDocument:null!=e&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}let Sn=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map((e=>`${e}:not([tabindex='-1'])`)).join(",");var Pn=(e=>(e[e.First=1]="First",e[e.Previous=2]="Previous",e[e.Next=4]="Next",e[e.Last=8]="Last",e[e.WrapAround=16]="WrapAround",e[e.NoScroll=32]="NoScroll",e))(Pn||{}),jn=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(jn||{}),Cn=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(Cn||{});function Tn(e=document.body){return null==e?[]:Array.from(e.querySelectorAll(Sn))}var Dn=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(Dn||{});function Nn(e,t=0){var n;return e!==(null==(n=kn(e))?void 0:n.body)&&Kt(t,{0:()=>e.matches(Sn),1(){let t=e;for(;null!==t;){if(t.matches(Sn))return!0;t=t.parentElement}return!1}})}function On(e){let t=kn(e);an().nextFrame((()=>{t&&!Nn(t.activeElement,0)&&function(e){null==e||e.focus({preventScroll:!0})}(e)}))}let Mn=["textarea","input"].join(",");function An(e,t=(e=>e)){return e.slice().sort(((e,n)=>{let r=t(e),i=t(n);if(null===r||null===i)return 0;let o=r.compareDocumentPosition(i);return o&Node.DOCUMENT_POSITION_FOLLOWING?-1:o&Node.DOCUMENT_POSITION_PRECEDING?1:0}))}function Rn(e,t){return function(e,t,n=!0,r=null){let i=Array.isArray(e)?e.length>0?e[0].ownerDocument:document:e.ownerDocument,o=Array.isArray(e)?n?An(e):e:Tn(e);r=null!=r?r:i.activeElement;let a,s=(()=>{if(5&t)return 1;if(10&t)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),l=(()=>{if(1&t)return 0;if(2&t)return Math.max(0,o.indexOf(r))-1;if(4&t)return Math.max(0,o.indexOf(r))+1;if(8&t)return o.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),c=32&t?{preventScroll:!0}:{},u=0,d=o.length;do{if(u>=d||u+d<=0)return 0;let e=l+u;if(16&t)e=(e+d)%d;else{if(e<0)return 3;if(e>=d)return 1}a=o[e],null==a||a.focus(c),u+=s}while(a!==i.activeElement);return 6&t&&function(e){var t,n;return null!=(n=null==(t=null==e?void 0:e.matches)?void 0:t.call(e,Mn))&&n}(a)&&a.select(),a.hasAttribute("tabindex")||a.setAttribute("tabindex","0"),2}(Tn(),t,!0,e)}function In(e,t,n){let i=un(t);(0,r.useEffect)((()=>{function t(e){i.current(e)}return document.addEventListener(e,t,n),()=>document.removeEventListener(e,t,n)}),[e,n])}let Ln=(0,r.createContext)(null);Ln.displayName="OpenClosedContext";var Bn=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Bn||{});function Fn(){return(0,r.useContext)(Ln)}function zn({value:e,children:t}){return r.default.createElement(Ln.Provider,{value:e},t)}function Vn(e){var t;if(e.type)return e.type;let n=null!=(t=e.as)?t:"button";return"string"==typeof n&&"button"===n.toLowerCase()?"button":void 0}function Gn(e,t){let[n,i]=(0,r.useState)((()=>Vn(e)));return cn((()=>{i(Vn(e))}),[e.type,e.as]),cn((()=>{n||!t.current||t.current instanceof HTMLButtonElement&&!t.current.hasAttribute("type")&&i("button")}),[n,t]),n}var Hn=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Hn||{}),Wn=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(Wn||{}),qn=(e=>(e[e.OpenMenu=0]="OpenMenu",e[e.CloseMenu=1]="CloseMenu",e[e.GoToItem=2]="GoToItem",e[e.Search=3]="Search",e[e.ClearSearch=4]="ClearSearch",e[e.RegisterItem=5]="RegisterItem",e[e.UnregisterItem=6]="UnregisterItem",e))(qn||{});function Yn(e,t=(e=>e)){let n=null!==e.activeItemIndex?e.items[e.activeItemIndex]:null,r=An(t(e.items.slice()),(e=>e.dataRef.current.domRef.current)),i=n?r.indexOf(n):null;return-1===i&&(i=null),{items:r,activeItemIndex:i}}let Un={1:e=>1===e.menuState?e:{...e,activeItemIndex:null,menuState:1},0:e=>0===e.menuState?e:{...e,menuState:0},2:(e,t)=>{var n;let r=Yn(e),i=En(t,{resolveItems:()=>r.items,resolveActiveIndex:()=>r.activeItemIndex,resolveId:e=>e.id,resolveDisabled:e=>e.dataRef.current.disabled});return{...e,...r,searchQuery:"",activeItemIndex:i,activationTrigger:null!=(n=t.trigger)?n:1}},3:(e,t)=>{let n=""!==e.searchQuery?0:1,r=e.searchQuery+t.value.toLowerCase(),i=(null!==e.activeItemIndex?e.items.slice(e.activeItemIndex+n).concat(e.items.slice(0,e.activeItemIndex+n)):e.items).find((e=>{var t;return(null==(t=e.dataRef.current.textValue)?void 0:t.startsWith(r))&&!e.dataRef.current.disabled})),o=i?e.items.indexOf(i):-1;return-1===o||o===e.activeItemIndex?{...e,searchQuery:r}:{...e,searchQuery:r,activeItemIndex:o,activationTrigger:1}},4:e=>""===e.searchQuery?e:{...e,searchQuery:"",searchActiveItemIndex:null},5:(e,t)=>{let n=Yn(e,(e=>[...e,{id:t.id,dataRef:t.dataRef}]));return{...e,...n}},6:(e,t)=>{let n=Yn(e,(e=>{let n=e.findIndex((e=>e.id===t.id));return-1!==n&&e.splice(n,1),e}));return{...e,...n,activationTrigger:1}}},Xn=(0,r.createContext)(null);function $n(e){let t=(0,r.useContext)(Xn);if(null===t){let t=new Error(`<${e} /> is missing a parent <Menu /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,$n),t}return t}function Kn(e,t){return Kt(t.type,Un,e,t)}Xn.displayName="MenuContext";let Zn=r.Fragment,Qn=nn((function(e,t){let n=(0,r.useReducer)(Kn,{menuState:1,buttonRef:(0,r.createRef)(),itemsRef:(0,r.createRef)(),items:[],searchQuery:"",activeItemIndex:null,activationTrigger:1}),[{menuState:i,itemsRef:o,buttonRef:a},s]=n,l=fn(t);!function(e,t,n=!0){let i=(0,r.useRef)(!1);function o(n,r){if(!i.current||n.defaultPrevented)return;let o=function e(t){return"function"==typeof t?e(t()):Array.isArray(t)||t instanceof Set?t:[t]}(e),a=r(n);if(null!==a&&a.ownerDocument.documentElement.contains(a)){for(let e of o){if(null===e)continue;let t=e instanceof HTMLElement?e:e.current;if(null!=t&&t.contains(a))return}return!Nn(a,Dn.Loose)&&-1!==a.tabIndex&&n.preventDefault(),t(n,a)}}(0,r.useEffect)((()=>{requestAnimationFrame((()=>{i.current=n}))}),[n]);let a=(0,r.useRef)(null);In("mousedown",(e=>{var t,n;i.current&&(a.current=(null==(n=null==(t=e.composedPath)?void 0:t.call(e))?void 0:n[0])||e.target)}),!0),In("click",(e=>{!a.current||(o(e,(()=>a.current)),a.current=null)}),!0),In("blur",(e=>o(e,(()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null))),!0)}([a,o],((e,t)=>{var n;s({type:1}),Nn(t,Dn.Loose)||(e.preventDefault(),null==(n=a.current)||n.focus())}),0===i);let c=(0,r.useMemo)((()=>({open:0===i})),[i]),u=e,d={ref:l};return r.default.createElement(Xn.Provider,{value:n},r.default.createElement(zn,{value:Kt(i,{0:Bn.Open,1:Bn.Closed})},Jt({ourProps:d,theirProps:u,slot:c,defaultTag:Zn,name:"Menu"})))})),Jn=nn((function(e,t){var n;let[i,o]=$n("Menu.Button"),a=fn(i.buttonRef,t),s=`headlessui-menu-button-${bn()}`,l=sn(),c=dn((e=>{switch(e.key){case xn.Space:case xn.Enter:case xn.ArrowDown:e.preventDefault(),e.stopPropagation(),o({type:0}),l.nextFrame((()=>o({type:2,focus:wn.First})));break;case xn.ArrowUp:e.preventDefault(),e.stopPropagation(),o({type:0}),l.nextFrame((()=>o({type:2,focus:wn.Last})))}})),u=dn((e=>{if(e.key===xn.Space)e.preventDefault()})),d=dn((t=>{if(_n(t.currentTarget))return t.preventDefault();e.disabled||(0===i.menuState?(o({type:1}),l.nextFrame((()=>{var e;return null==(e=i.buttonRef.current)?void 0:e.focus({preventScroll:!0})}))):(t.preventDefault(),o({type:0})))})),h=(0,r.useMemo)((()=>({open:0===i.menuState})),[i]),f=e;return Jt({ourProps:{ref:a,id:s,type:Gn(e,i.buttonRef),"aria-haspopup":!0,"aria-controls":null==(n=i.itemsRef.current)?void 0:n.id,"aria-expanded":e.disabled?void 0:0===i.menuState,onKeyDown:c,onKeyUp:u,onClick:d},theirProps:f,slot:h,defaultTag:"button",name:"Menu.Button"})})),er=Zt.RenderStrategy|Zt.Static,tr=nn((function(e,t){var n,i;let[o,a]=$n("Menu.Items"),s=fn(o.itemsRef,t),l=function(...e){return(0,r.useMemo)((()=>kn(...e)),[...e])}(o.itemsRef),c=`headlessui-menu-items-${bn()}`,u=sn(),d=Fn(),h=null!==d?d===Bn.Open:0===o.menuState;(0,r.useEffect)((()=>{let e=o.itemsRef.current;!e||0===o.menuState&&e!==(null==l?void 0:l.activeElement)&&e.focus({preventScroll:!0})}),[o.menuState,o.itemsRef,l]),function({container:e,accept:t,walk:n,enabled:i=!0}){let o=(0,r.useRef)(t),a=(0,r.useRef)(n);(0,r.useEffect)((()=>{o.current=t,a.current=n}),[t,n]),cn((()=>{if(!e||!i)return;let t=kn(e);if(!t)return;let n=o.current,r=a.current,s=Object.assign((e=>n(e)),{acceptNode:n}),l=t.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,s,!1);for(;l.nextNode();)r(l.currentNode)}),[e,i,o,a])}({container:o.itemsRef.current,enabled:0===o.menuState,accept:e=>"menuitem"===e.getAttribute("role")?NodeFilter.FILTER_REJECT:e.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT,walk(e){e.setAttribute("role","none")}});let f=dn((e=>{var t,n;switch(u.dispose(),e.key){case xn.Space:if(""!==o.searchQuery)return e.preventDefault(),e.stopPropagation(),a({type:3,value:e.key});case xn.Enter:if(e.preventDefault(),e.stopPropagation(),a({type:1}),null!==o.activeItemIndex){let{dataRef:e}=o.items[o.activeItemIndex];null==(n=null==(t=e.current)?void 0:t.domRef.current)||n.click()}On(o.buttonRef.current);break;case xn.ArrowDown:return e.preventDefault(),e.stopPropagation(),a({type:2,focus:wn.Next});case xn.ArrowUp:return e.preventDefault(),e.stopPropagation(),a({type:2,focus:wn.Previous});case xn.Home:case xn.PageUp:return e.preventDefault(),e.stopPropagation(),a({type:2,focus:wn.First});case xn.End:case xn.PageDown:return e.preventDefault(),e.stopPropagation(),a({type:2,focus:wn.Last});case xn.Escape:e.preventDefault(),e.stopPropagation(),a({type:1}),an().nextFrame((()=>{var e;return null==(e=o.buttonRef.current)?void 0:e.focus({preventScroll:!0})}));break;case xn.Tab:e.preventDefault(),e.stopPropagation(),a({type:1}),an().nextFrame((()=>{Rn(o.buttonRef.current,e.shiftKey?Pn.Previous:Pn.Next)}));break;default:1===e.key.length&&(a({type:3,value:e.key}),u.setTimeout((()=>a({type:4})),350))}})),p=dn((e=>{if(e.key===xn.Space)e.preventDefault()})),v=(0,r.useMemo)((()=>({open:0===o.menuState})),[o]),g=e;return Jt({ourProps:{"aria-activedescendant":null===o.activeItemIndex||null==(n=o.items[o.activeItemIndex])?void 0:n.id,"aria-labelledby":null==(i=o.buttonRef.current)?void 0:i.id,id:c,onKeyDown:f,onKeyUp:p,role:"menu",tabIndex:0,ref:s},theirProps:g,slot:v,defaultTag:"div",features:er,visible:h,name:"Menu.Items"})})),nr=r.Fragment,rr=nn((function(e,t){let{disabled:n=!1,...i}=e,[o,a]=$n("Menu.Item"),s=`headlessui-menu-item-${bn()}`,l=null!==o.activeItemIndex&&o.items[o.activeItemIndex].id===s,c=(0,r.useRef)(null),u=fn(t,c);cn((()=>{if(0!==o.menuState||!l||0===o.activationTrigger)return;let e=an();return e.requestAnimationFrame((()=>{var e,t;null==(t=null==(e=c.current)?void 0:e.scrollIntoView)||t.call(e,{block:"nearest"})})),e.dispose}),[c,l,o.menuState,o.activationTrigger,o.activeItemIndex]);let d=(0,r.useRef)({disabled:n,domRef:c});cn((()=>{d.current.disabled=n}),[d,n]),cn((()=>{var e,t;d.current.textValue=null==(t=null==(e=c.current)?void 0:e.textContent)?void 0:t.toLowerCase()}),[d,c]),cn((()=>(a({type:5,id:s,dataRef:d}),()=>a({type:6,id:s}))),[d,s]);let h=dn((e=>{if(n)return e.preventDefault();a({type:1}),On(o.buttonRef.current)})),f=dn((()=>{if(n)return a({type:2,focus:wn.Nothing});a({type:2,focus:wn.Specific,id:s})})),p=dn((()=>{n||l||a({type:2,focus:wn.Specific,id:s,trigger:0})})),v=dn((()=>{n||!l||a({type:2,focus:wn.Nothing})})),g=(0,r.useMemo)((()=>({active:l,disabled:n})),[l,n]);return Jt({ourProps:{id:s,ref:u,role:"menuitem",tabIndex:!0===n?void 0:-1,"aria-disabled":!0===n||void 0,disabled:void 0,onClick:h,onFocus:f,onPointerMove:p,onMouseMove:p,onPointerLeave:v,onMouseLeave:v},theirProps:i,slot:g,defaultTag:nr,name:"Menu.Item"})})),ir=Object.assign(Qn,{Button:Jn,Items:tr,Item:rr});function or(){let e=(0,r.useRef)(!1);return cn((()=>(e.current=!0,()=>{e.current=!1})),[]),e}function ar(e,...t){e&&t.length>0&&e.classList.add(...t)}function sr(e,...t){e&&t.length>0&&e.classList.remove(...t)}var lr=(e=>(e.Ended="ended",e.Cancelled="cancelled",e))(lr||{});function cr(e,t,n,r){let i=n?"enter":"leave",o=an(),a=void 0!==r?function(e){let t={called:!1};return(...n)=>{if(!t.called)return t.called=!0,e(...n)}}(r):()=>{};"enter"===i&&(e.removeAttribute("hidden"),e.style.display="");let s=Kt(i,{enter:()=>t.enter,leave:()=>t.leave}),l=Kt(i,{enter:()=>t.enterTo,leave:()=>t.leaveTo}),c=Kt(i,{enter:()=>t.enterFrom,leave:()=>t.leaveFrom});return sr(e,...t.enter,...t.enterTo,...t.enterFrom,...t.leave,...t.leaveFrom,...t.leaveTo,...t.entered),ar(e,...s,...c),o.nextFrame((()=>{sr(e,...c),ar(e,...l),function(e,t){let n=an();if(!e)return n.dispose;let{transitionDuration:r,transitionDelay:i}=getComputedStyle(e),[o,a]=[r,i].map((e=>{let[t=0]=e.split(",").filter(Boolean).map((e=>e.includes("ms")?parseFloat(e):1e3*parseFloat(e))).sort(((e,t)=>t-e));return t}));if(o+a!==0){let r=[];r.push(n.addEventListener(e,"transitionrun",(i=>{i.target===i.currentTarget&&(r.splice(0).forEach((e=>e())),r.push(n.addEventListener(e,"transitionend",(e=>{e.target===e.currentTarget&&(t("ended"),r.splice(0).forEach((e=>e())))})),n.addEventListener(e,"transitioncancel",(e=>{e.target===e.currentTarget&&(t("cancelled"),r.splice(0).forEach((e=>e())))}))))})))}else t("ended");n.add((()=>t("cancelled"))),n.dispose}(e,(n=>("ended"===n&&(sr(e,...s),ar(e,...t.entered)),a(n))))})),o.dispose}function ur(e=""){return e.split(" ").filter((e=>e.trim().length>1))}let dr=(0,r.createContext)(null);dr.displayName="TransitionContext";var hr=(e=>(e.Visible="visible",e.Hidden="hidden",e))(hr||{});let fr=(0,r.createContext)(null);function pr(e){return"children"in e?pr(e.children):e.current.filter((({el:e})=>null!==e.current)).filter((({state:e})=>"visible"===e)).length>0}function vr(e,t){let n=un(e),i=(0,r.useRef)([]),o=or(),a=sn(),s=dn(((e,t=Qt.Hidden)=>{let r=i.current.findIndex((({el:t})=>t===e));-1!==r&&(Kt(t,{[Qt.Unmount](){i.current.splice(r,1)},[Qt.Hidden](){i.current[r].state="hidden"}}),a.microTask((()=>{var e;!pr(i)&&o.current&&(null==(e=n.current)||e.call(n))})))})),l=dn((e=>{let t=i.current.find((({el:t})=>t===e));return t?"visible"!==t.state&&(t.state="visible"):i.current.push({el:e,state:"visible"}),()=>s(e,Qt.Unmount)})),c=(0,r.useRef)([]),u=(0,r.useRef)(Promise.resolve()),d=(0,r.useRef)({enter:[],leave:[],idle:[]}),h=dn(((e,n,r)=>{c.current.splice(0),t&&(t.chains.current[n]=t.chains.current[n].filter((([t])=>t!==e))),null==t||t.chains.current[n].push([e,new Promise((e=>{c.current.push(e)}))]),null==t||t.chains.current[n].push([e,new Promise((e=>{Promise.all(d.current[n].map((([e,t])=>t))).then((()=>e()))}))]),"enter"===n?u.current=u.current.then((()=>null==t?void 0:t.wait.current)).then((()=>r(n))):r(n)})),f=dn(((e,t,n)=>{Promise.all(d.current[t].splice(0).map((([e,t])=>t))).then((()=>{var e;null==(e=c.current.shift())||e()})).then((()=>n(t)))}));return(0,r.useMemo)((()=>({children:i,register:l,unregister:s,onStart:h,onStop:f,wait:u,chains:d})),[l,s,i,h,f,d,u])}function gr(){}fr.displayName="NestingContext";let mr=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function yr(e){var t;let n={};for(let r of mr)n[r]=null!=(t=e[r])?t:gr;return n}let br=Zt.RenderStrategy,xr=nn((function(e,t){let{beforeEnter:n,afterEnter:i,beforeLeave:o,afterLeave:a,enter:s,enterFrom:l,enterTo:c,entered:u,leave:d,leaveFrom:h,leaveTo:f,...p}=e,v=(0,r.useRef)(null),g=fn(v,t),m=p.unmount?Qt.Unmount:Qt.Hidden,{show:y,appear:b,initial:x}=function(){let e=(0,r.useContext)(dr);if(null===e)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}(),[w,E]=(0,r.useState)(y?"visible":"hidden"),_=function(){let e=(0,r.useContext)(fr);if(null===e)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}(),{register:k,unregister:S}=_,P=(0,r.useRef)(null);(0,r.useEffect)((()=>k(v)),[k,v]),(0,r.useEffect)((()=>{if(m===Qt.Hidden&&v.current)return y&&"visible"!==w?void E("visible"):Kt(w,{hidden:()=>S(v),visible:()=>k(v)})}),[w,v,k,S,y,m]);let j=un({enter:ur(s),enterFrom:ur(l),enterTo:ur(c),entered:ur(u),leave:ur(d),leaveFrom:ur(h),leaveTo:ur(f)}),C=function(e){let t=(0,r.useRef)(yr(e));return(0,r.useEffect)((()=>{t.current=yr(e)}),[e]),t}({beforeEnter:n,afterEnter:i,beforeLeave:o,afterLeave:a}),T=vn();(0,r.useEffect)((()=>{if(T&&"visible"===w&&null===v.current)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")}),[v,w,T]);let D=x&&!b,N=!T||D||P.current===y?"idle":y?"enter":"leave",O=dn((e=>Kt(e,{enter:()=>C.current.beforeEnter(),leave:()=>C.current.beforeLeave(),idle:()=>{}}))),M=dn((e=>Kt(e,{enter:()=>C.current.afterEnter(),leave:()=>C.current.afterLeave(),idle:()=>{}}))),A=vr((()=>{E("hidden"),S(v)}),_);(function({container:e,direction:t,classes:n,onStart:r,onStop:i}){let o=or(),a=sn(),s=un(t);cn((()=>{let t=an();a.add(t.dispose);let l=e.current;if(l&&"idle"!==s.current&&o.current)return t.dispose(),r.current(s.current),t.add(cr(l,n.current,"enter"===s.current,(e=>{t.dispose(),Kt(e,{[lr.Ended](){i.current(s.current)},[lr.Cancelled]:()=>{}})}))),t.dispose}),[t])})({container:v,classes:j,direction:N,onStart:un((e=>{A.onStart(v,e,O)})),onStop:un((e=>{A.onStop(v,e,M),"leave"===e&&!pr(A)&&(E("hidden"),S(v))}))}),(0,r.useEffect)((()=>{!D||(m===Qt.Hidden?P.current=null:P.current=y)}),[y,D,w]);let R=p,I={ref:g};return r.default.createElement(fr.Provider,{value:A},r.default.createElement(zn,{value:Kt(w,{visible:Bn.Open,hidden:Bn.Closed})},Jt({ourProps:I,theirProps:R,defaultTag:"div",features:br,visible:"visible"===w,name:"Transition.Child"})))})),wr=nn((function(e,t){let{show:n,appear:i=!1,unmount:o,...a}=e,s=(0,r.useRef)(null),l=fn(s,t);vn();let c=Fn();if(void 0===n&&null!==c&&(n=Kt(c,{[Bn.Open]:!0,[Bn.Closed]:!1})),![!0,!1].includes(n))throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[u,d]=(0,r.useState)(n?"visible":"hidden"),h=vr((()=>{d("hidden")})),[f,p]=(0,r.useState)(!0),v=(0,r.useRef)([n]);cn((()=>{!1!==f&&v.current[v.current.length-1]!==n&&(v.current.push(n),p(!1))}),[v,n]);let g=(0,r.useMemo)((()=>({show:n,appear:i,initial:f})),[n,i,f]);(0,r.useEffect)((()=>{if(n)d("visible");else if(pr(h)){let e=s.current;if(!e)return;let t=e.getBoundingClientRect();0===t.x&&0===t.y&&0===t.width&&0===t.height&&d("hidden")}else d("hidden")}),[n,h]);let m={unmount:o};return r.default.createElement(fr.Provider,{value:h},r.default.createElement(dr.Provider,{value:g},Jt({ourProps:{...m,as:r.Fragment,children:r.default.createElement(xr,{ref:l,...m,...a})},theirProps:{},defaultTag:r.Fragment,features:br,visible:"visible"===u,name:"Transition"})))})),Er=nn((function(e,t){let n=null!==(0,r.useContext)(dr),i=null!==Fn();return r.default.createElement(r.default.Fragment,null,!n&&i?r.default.createElement(wr,{ref:t,...e}):r.default.createElement(xr,{ref:t,...e}))})),_r=Object.assign(wr,{Child:Er,Root:wr});const kr=r.forwardRef((function({title:e,titleId:t,...n},i){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:i,"aria-labelledby":t},n),e?r.createElement("title",{id:t},e):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 17.25v1.007a3 3 0 01-.879 2.122L7.5 21h9l-.621-.621A3 3 0 0115 18.257V17.25m6-12V15a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 15V5.25m18 0A2.25 2.25 0 0018.75 3H5.25A2.25 2.25 0 003 5.25m18 0V12a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 12V5.25"}))}));const Sr=r.forwardRef((function({title:e,titleId:t,...n},i){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:i,"aria-labelledby":t},n),e?r.createElement("title",{id:t},e):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 3v2.25m6.364.386l-1.591 1.591M21 12h-2.25m-.386 6.364l-1.591-1.591M12 18.75V21m-4.773-4.227l-1.591 1.591M5.25 12H3m4.227-4.773L5.636 5.636M15.75 12a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0z"}))}));const Pr=r.forwardRef((function({title:e,titleId:t,...n},i){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:i,"aria-labelledby":t},n),e?r.createElement("title",{id:t},e):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21.752 15.002A9.718 9.718 0 0118 15.75c-5.385 0-9.75-4.365-9.75-9.75 0-1.33.266-2.597.748-3.752A9.753 9.753 0 003 11.25C3 16.635 7.365 21 12.75 21a9.753 9.753 0 009.002-5.998z"}))}));function jr(){const[e,t]=(0,r.useState)(localStorage.getItem(P)||"system");return(0,r.useEffect)((()=>{T(e)}),[e]),w(ir,{as:"div",className:"relative inline-block text-left",children:[w("div",{children:w(ir.Button,{className:"inline-flex w-full justify-center rounded-md p-2 text-sm font-medium focus:outline-none focus-visible:ring-2 focus-visible:ring-white focus-visible:ring-opacity-75 dark:text-sky-500","data-cy":"theme-open-modal-button",children:[w("span",{className:"sr-only",children:"Theme switcher"}),"system"===e&&w(kr,{className:"h-4 w-4","aria-hidden":"true"}),"light"===e&&w(Sr,{className:"h-4 w-4","aria-hidden":"true"}),"dark"===e&&w(Pr,{className:"h-4 w-4","aria-hidden":"true"})]})}),w(_r,{as:r.Fragment,enter:"transition ease-out duration-100",enterFrom:"transform opacity-0 scale-95",enterTo:"transform opacity-100 scale-100",leave:"transition ease-in duration-75",leaveFrom:"transform opacity-100 scale-100",leaveTo:"transform opacity-0 scale-95",children:w(ir.Items,{className:"absolute right-0 z-50 mt-2 w-36 origin-top-right rounded-md bg-white text-slate-500 shadow-lg ring-1 ring-slate-900/10 ring-opacity-5 focus:outline-none dark:bg-slate-800 dark:text-slate-400 dark:ring-0",children:w("div",{className:"px-1 py-1",children:[w(ir.Item,{children:({active:n})=>w("button",{"data-cy":"system-theme-button",className:Ht()("system"===e?"text-blue-500 dark:text-sky-500":"",n?"bg-slate-50 dark:bg-slate-600/30":"","group flex w-full items-center rounded-md px-2 py-2 text-sm"),onClick:()=>t("system"),children:[w(kr,{className:"mr-2 h-4 w-4","aria-hidden":"true"}),"System"]})}),w(ir.Item,{children:({active:n})=>w("button",{"data-cy":"light-theme-button",className:Ht()("light"===e?"text-blue-500 dark:text-sky-500":"",n?"bg-slate-50 dark:bg-slate-600/30":"","group flex w-full items-center rounded-md px-2 py-2 text-sm"),onClick:()=>t("light"),children:[w(Sr,{className:"mr-2 h-4 w-4","aria-hidden":"true"}),"Light"]})}),w(ir.Item,{children:({active:n})=>w("button",{"data-cy":"dark-theme-button",className:Ht()("dark"===e?"text-blue-500 dark:text-sky-500":"",n?"bg-slate-50 dark:bg-slate-600/30":"","group flex w-full items-center rounded-md px-2 py-2 text-sm"),onClick:()=>t("dark"),children:[w(Pr,{className:"mr-2 h-4 w-4","aria-hidden":"true"}),"Dark"]})})]})})})]})}const Cr=()=>{const[e,t]=(0,r.useState)(),[n,i]=(0,r.useState)(),o=ct();if(o.pathname===e)return n;t(o.pathname);const a=Y(va(),o).at(-1),{environment:s}=$t();let l;return l="dev"===s?{workspace:a.pathname.split("/")[1],currentPath:`/${a.pathname.split("/").slice(2).join("/")}`}:{workspace:"local",currentPath:a.pathname},i(l),l};const Tr=function(e){return Xt().appConfig.showExperimentalFeatures?r.Children.map(e.children,(e=>(0,r.cloneElement)(e,{"data-cy":"experimental-feature"}))):null};const Dr=r.forwardRef((function({title:e,titleId:t,...n},i){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:i,"aria-labelledby":t},n),e?r.createElement("title",{id:t},e):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 7.5L7.5 3m0 0L12 7.5M7.5 3v13.5m13.5 0L16.5 21m0 0L12 16.5m4.5 4.5V7.5"}))}));const Nr=r.forwardRef((function({title:e,titleId:t,...n},i){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:i,"aria-labelledby":t},n),e?r.createElement("title",{id:t},e):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7.5 21L3 16.5m0 0L7.5 12M3 16.5h13.5m0-13.5L21 7.5m0 0L16.5 12M21 7.5H7.5"}))}));function Or(){const[e,t]=(0,r.useState)(localStorage.getItem(N)||"TB");return(0,r.useEffect)((()=>{M(e)}),[e]),w("div",{className:"relative inline-block text-left",children:w("button",{className:"inline-flex w-full justify-center rounded-md p-2 text-sm font-medium focus:outline-none focus-visible:ring-2 focus-visible:ring-white focus-visible:ring-opacity-75 dark:text-sky-500","data-cy":"rankdir-change-button",children:[w("span",{className:"sr-only",children:"Graph layout direction switcher"}),"TB"===e&&w("button",{title:"Set graph direction to left-to-right","data-cy":"lr-rankdir-button",onClick:()=>t("LR"),children:w(Dr,{className:"h-4 w-4","aria-hidden":"true"})}),"LR"===e&&w("button",{title:"Set graph direction to top-to-bottom","data-cy":"tb-rankdir-button",onClick:()=>t("TB"),children:w(Nr,{className:"h-4 w-4","aria-hidden":"true"})})]})})}var Mr=n(36021);const Ar={on:{updateGraph:{target:"customSelected",actions:[(0,Mr.f0)(((e,t)=>{const n=e.projects.map((e=>e.name)),r=t.projects.map((e=>e.name)).filter((e=>!n.includes(e)));e.selectedProjects=[...e.selectedProjects,...r]})),"setGraph",(0,l.send)(((e,t)=>({type:"notifyGraphUpdateGraph",projects:e.projects,dependencies:e.dependencies,affectedProjects:e.affectedProjects,workspaceLayout:e.workspaceLayout,groupByFolder:e.groupByFolder,selectedProjects:e.selectedProjects})),{to:e=>e.graphActor})]}}},Rr={entry:[(0,Mr.f0)(((e,t)=>{"focusProject"===t.type&&(e.focusedProject=t.projectName)})),"notifyGraphFocusProject"],exit:[(0,Mr.f0)((e=>{e.focusedProject=null}))],on:{incrementSearchDepth:{actions:["incrementSearchDepth","notifyGraphFocusProject"]},decrementSearchDepth:{actions:["decrementSearchDepth","notifyGraphFocusProject"]},setSearchDepthEnabled:{actions:["setSearchDepthEnabled","notifyGraphFocusProject"]},setSearchDepth:{actions:["setSearchDepth","notifyGraphFocusProject"]},unfocusProject:{target:"unselected"},updateGraph:{actions:["setGraph",(0,l.send)(((e,t)=>({type:"notifyGraphUpdateGraph",projects:e.projects,dependencies:e.dependencies,affectedProjects:e.affectedProjects,workspaceLayout:e.workspaceLayout,groupByFolder:e.groupByFolder,selectedProjects:e.selectedProjects})),{to:e=>e.graphActor}),"notifyGraphFocusProject"]}}},Ir=(e,t)=>{const n=k();t((t=>{const{selectedProjectNames:r,perfReport:i}=n.handleProjectEvent(t);e({type:"setSelectedProjectsFromGraph",selectedProjectNames:r,perfReport:i})}))},Lr={entry:[(0,Mr.f0)(((e,t)=>{"filterByText"===t.type&&(e.textFilter=t.search)})),"notifyGraphFilterProjectsByText"],on:{clearTextFilter:{target:"unselected",actions:(0,Mr.f0)((e=>{e.includePath=!1,e.textFilter=""}))},setIncludeProjectsByPath:{actions:["setIncludeProjectsByPath","notifyGraphFilterProjectsByText"]},incrementSearchDepth:{actions:["incrementSearchDepth","notifyGraphFilterProjectsByText"]},decrementSearchDepth:{actions:["decrementSearchDepth","notifyGraphFilterProjectsByText"]},setSearchDepthEnabled:{actions:["setSearchDepthEnabled","notifyGraphFilterProjectsByText"]},updateGraph:{actions:["setGraph",(0,l.send)(((e,t)=>({type:"notifyGraphUpdateGraph",projects:e.projects,dependencies:e.dependencies,affectedProjects:e.affectedProjects,workspaceLayout:e.workspaceLayout,groupByFolder:e.groupByFolder,selectedProjects:e.selectedProjects})),{to:e=>e.graphActor}),"notifyGraphFilterProjectsByText"]}}},Br={entry:[(0,Mr.f0)(((e,t)=>{"setTracingStart"===t.type?e.tracing.start=t.projectName:"setTracingEnd"===t.type&&(e.tracing.end=t.projectName)})),"notifyGraphTracing"],exit:[(0,Mr.f0)(((e,t)=>{"setTracingStart"!==t.type&&"setTracingEnd"!==t.type&&(e.tracing.start=null,e.tracing.end=null)}))],on:{clearTraceStart:{actions:[(0,Mr.f0)((e=>{e.tracing.start=null})),"notifyGraphTracing"]},clearTraceEnd:{actions:[(0,Mr.f0)((e=>{e.tracing.end=null})),"notifyGraphTracing"]}}},Fr={entry:["notifyGraphHideAllProjects"],on:{updateGraph:{target:"customSelected",actions:[(0,Mr.f0)(((e,t)=>{const n=e.projects.map((e=>e.name)),r=t.projects.map((e=>e.name)).filter((e=>!n.includes(e)));e.selectedProjects=[...e.selectedProjects,...r]})),"setGraph",(0,l.send)(((e,t)=>({type:"notifyGraphUpdateGraph",projects:e.projects,dependencies:e.dependencies,affectedProjects:e.affectedProjects,workspaceLayout:e.workspaceLayout,groupByFolder:e.groupByFolder,selectedProjects:e.selectedProjects})),{to:e=>e.graphActor})]}}},zr=(0,s.C)({predictableActionArguments:!0,id:"project-graph",initial:"idle",context:{projects:[],dependencies:{},affectedProjects:[],selectedProjects:[],focusedProject:null,textFilter:"",includePath:!1,searchDepth:1,searchDepthEnabled:!0,groupByFolder:!1,collapseEdges:!1,workspaceLayout:{libsDir:"",appsDir:""},graphActor:null,lastPerfReport:{numEdges:0,numNodes:0,renderTime:0},tracing:{start:null,end:null,algorithm:"shortest"}},states:{idle:{},unselected:Fr,customSelected:Ar,focused:Rr,textFiltered:Lr,tracing:Br},on:{setProjects:{target:"unselected",actions:["setGraph",(0,l.send)(((e,t)=>({type:"notifyGraphInitGraph",projects:e.projects,dependencies:e.dependencies,affectedProjects:e.affectedProjects,workspaceLayout:e.workspaceLayout,groupByFolder:e.groupByFolder,collapseEdges:e.collapseEdges})),{to:e=>e.graphActor})]},setSelectedProjectsFromGraph:{actions:[(0,Mr.f0)(((e,t)=>{e.selectedProjects=t.selectedProjectNames,e.lastPerfReport=t.perfReport}))]},selectProject:{target:"customSelected",actions:["notifyGraphShowProjects"]},selectProjects:{target:"customSelected",actions:["notifyGraphShowProjects"]},selectAll:{target:"customSelected",actions:["notifyGraphShowAllProjects"]},selectAffected:{target:"customSelected",actions:["notifyGraphShowAffectedProjects"]},deselectProject:[{target:"unselected",cond:"deselectLastProject"},{target:"customSelected",actions:["notifyGraphHideProjects"]}],deselectProjects:[{target:"unselected",cond:"deselectLastProject"},{target:"customSelected",actions:["notifyGraphHideProjects"]}],deselectAll:{target:"unselected"},focusProject:{target:"focused"},setTracingStart:{target:"tracing"},setTracingEnd:{target:"tracing"},setCollapseEdges:{actions:["setCollapseEdges",(0,l.send)(((e,t)=>({type:"notifyGraphUpdateGraph",projects:e.projects,dependencies:e.dependencies,affectedProjects:e.affectedProjects,workspaceLayout:e.workspaceLayout,groupByFolder:e.groupByFolder,collapseEdges:e.collapseEdges,selectedProjects:e.selectedProjects})),{to:e=>e.graphActor})]},setGroupByFolder:{actions:["setGroupByFolder",(0,l.send)(((e,t)=>({type:"notifyGraphUpdateGraph",projects:e.projects,dependencies:e.dependencies,affectedProjects:e.affectedProjects,workspaceLayout:e.workspaceLayout,groupByFolder:e.groupByFolder,collapseEdges:e.collapseEdges,selectedProjects:e.selectedProjects})),{to:e=>e.graphActor})]},setIncludeProjectsByPath:{actions:[(0,Mr.f0)(((e,t)=>{e.includePath=t.includeProjectsByPath}))]},incrementSearchDepth:{actions:["incrementSearchDepth"]},decrementSearchDepth:{actions:["decrementSearchDepth"]},setSearchDepthEnabled:{actions:["setSearchDepthEnabled"]},setSearchDepth:{actions:["setSearchDepth"]},setTracingAlgorithm:{actions:[(0,Mr.f0)(((e,t)=>{e.tracing.algorithm=t.algorithm})),"notifyGraphTracing"]},filterByText:{target:"textFiltered"}}},{guards:{deselectLastProject:e=>e.selectedProjects.length<=1},actions:{setGroupByFolder:(0,Mr.f0)(((e,t)=>{"setGroupByFolder"===t.type&&(e.groupByFolder=t.groupByFolder)})),setCollapseEdges:(0,Mr.f0)(((e,t)=>{"setCollapseEdges"===t.type&&(e.collapseEdges=t.collapseEdges)})),incrementSearchDepth:(0,Mr.f0)((e=>{e.searchDepthEnabled=!0,e.searchDepth=e.searchDepth+1})),decrementSearchDepth:(0,Mr.f0)((e=>{e.searchDepthEnabled=!0,e.searchDepth=e.searchDepth>1?e.searchDepth-1:1})),setSearchDepth:(0,Mr.f0)(((e,t)=>{"setSearchDepth"===t.type&&(e.searchDepthEnabled=!0,e.searchDepth=t.searchDepth>1?t.searchDepth:1)})),setSearchDepthEnabled:(0,Mr.f0)(((e,t)=>{"setSearchDepthEnabled"===t.type&&(e.searchDepthEnabled=t.searchDepthEnabled)})),setIncludeProjectsByPath:(0,Mr.f0)(((e,t)=>{"setIncludeProjectsByPath"===t.type&&(e.includePath=t.includeProjectsByPath)})),setGraph:(0,Mr.f0)(((e,t)=>{"setProjects"!==t.type&&"updateGraph"!==t.type||(e.projects=t.projects,e.dependencies=t.dependencies,e.graphActor=(0,o.Cs)(Ir,"graphActor"),"setProjects"===t.type&&(e.workspaceLayout=t.workspaceLayout,e.affectedProjects=t.affectedProjects))})),notifyGraphTracing:(0,l.send)(((e,t)=>({type:"notifyGraphTracing",start:e.tracing.start,end:e.tracing.end,algorithm:e.tracing.algorithm})),{to:e=>e.graphActor}),notifyGraphShowProjects:(0,l.send)(((e,t)=>{if("selectProject"===t.type||"selectProjects"===t.type)return"selectProject"===t.type?{type:"notifyGraphShowProjects",projectNames:[t.projectName]}:{type:"notifyGraphShowProjects",projectNames:t.projectNames}}),{to:e=>e.graphActor}),notifyGraphHideProjects:(0,l.send)(((e,t)=>{if("deselectProject"===t.type||"deselectProjects"===t.type)return"deselectProject"===t.type?{type:"notifyGraphHideProjects",projectNames:[t.projectName]}:{type:"notifyGraphHideProjects",projectNames:t.projectNames}}),{to:e=>e.graphActor}),notifyGraphShowAllProjects:(0,l.send)(((e,t)=>({type:"notifyGraphShowAllProjects"})),{to:e=>e.graphActor}),notifyGraphHideAllProjects:(0,l.send)(((e,t)=>({type:"notifyGraphHideAllProjects"})),{to:e=>e.graphActor}),notifyGraphShowAffectedProjects:(0,l.send)({type:"notifyGraphShowAffectedProjects"},{to:e=>e.graphActor}),notifyGraphFocusProject:(0,l.send)(((e,t)=>({type:"notifyGraphFocusProject",projectName:e.focusedProject,searchDepth:e.searchDepthEnabled?e.searchDepth:-1})),{to:e=>e.graphActor}),notifyGraphFilterProjectsByText:(0,l.send)(((e,t)=>({type:"notifyGraphFilterProjectsByText",search:e.textFilter,includeProjectsByPath:e.includePath,searchDepth:e.searchDepthEnabled?e.searchDepth:-1})),{to:e=>e.graphActor})}});let Vr=(0,o.kJ)(zr,{devTools:!!window.useXstateInspect});function Gr(){return Vr.status===o.TM.NotStarted&&Vr.start(),Vr}const Hr=r.forwardRef((function({title:e,titleId:t,...n},i){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",ref:i,"aria-labelledby":t},n),e?r.createElement("title",{id:t},e):null,r.createElement("path",{fillRule:"evenodd",d:"M11.54 22.351l.07.04.028.016a.76.76 0 00.723 0l.028-.015.071-.041a16.975 16.975 0 001.144-.742 19.58 19.58 0 002.683-2.282c1.944-1.99 3.963-4.98 3.963-8.827a8.25 8.25 0 00-16.5 0c0 3.846 2.02 6.837 3.963 8.827a19.58 19.58 0 002.682 2.282 16.975 16.975 0 001.145.742zM12 13.5a3 3 0 100-6 3 3 0 000 6z",clipRule:"evenodd"}))}));const Wr=r.forwardRef((function({title:e,titleId:t,...n},i){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",ref:i,"aria-labelledby":t},n),e?r.createElement("title",{id:t},e):null,r.createElement("path",{fillRule:"evenodd",d:"M3 2.25a.75.75 0 01.75.75v.54l1.838-.46a9.75 9.75 0 016.725.738l.108.054a8.25 8.25 0 005.58.652l3.109-.732a.75.75 0 01.917.81 47.784 47.784 0 00.005 10.337.75.75 0 01-.574.812l-3.114.733a9.75 9.75 0 01-6.594-.77l-.108-.054a8.25 8.25 0 00-5.69-.625l-2.202.55V21a.75.75 0 01-1.5 0V3A.75.75 0 013 2.25z",clipRule:"evenodd"}))})),qr=["className","children"];const Yr=function(e){let{className:t,children:n}=e,r=Wt(e,qr);return w("span",Object.assign({className:`${t} inline-block rounded-md bg-slate-300 p-2 font-sans text-xs font-semibold uppercase leading-4 tracking-wide text-slate-700`},r,{children:n}))},Ur=["className","children"],Xr=["to","className","children"],$r="inline-flex justify-center rounded-md border border-slate-300 bg-slate-50 py-2 px-4 mt-2 text-slate-500 hover:bg-slate-100 dark:border-slate-600 dark:bg-slate-800 dark:text-slate-300 hover:dark:bg-slate-700";function Kr(e){let{className:t,children:n}=e,r=Wt(e,Ur);return w("button",Object.assign({className:`${$r} ${t}`},r,{children:n}))}function Zr(e){let{to:t,className:n,children:r}=e,i=Wt(e,Xr);return w(Rt,Object.assign({className:`${$r} ${n}`,to:t},i,{children:r}))}const Qr=()=>{const{environment:e}=$t(),{selectedWorkspaceId:t}=ht(),[n]=Bt();return(r,i)=>{let o="";return"object"==typeof r?(o="dev"===e?`/${t}${r.pathname}`:r.pathname,Object.assign({},r,{pathname:o,search:i?n.toString():""})):"string"==typeof r?(o="dev"===e?`/${t}${r}`:r,{pathname:o,search:i?n.toString():""}):void 0}};function Jr(e,t){const n=e.replace(t,"").split("/").filter((e=>""!==e));return n.pop(),n}function ei(e,t){return t.filter((t=>t.type===e)).sort(((e,t)=>e.name.localeCompare(t.name)))}function ti(e,t){let n={};return e.forEach((e=>{const r="app"===e.type||"e2e"===e.type?t.appsDir:t.libsDir,i=Jr(e.data.root,r).join("/");n.hasOwnProperty(i)||(n[i]=[]),n[i].push(e)})),n}const ni=function({type:e,id:t,tags:n}){const r=Gr(),{start:i,end:o,algorithm:a}=r.getSnapshot().context.tracing,s=Qr(),l=ut();return w("div",{className:"text-sm text-slate-700 dark:text-slate-400",children:[w("h4",{children:[w(Yr,{className:"mr-3",children:e}),w("span",{className:"font-mono",children:t})]}),n.length>0?w("p",{className:"my-2",children:[w("strong",{children:"tags"}),w("br",{}),n.join(", ")]}):null,w("div",{className:"grid grid-cols-3 gap-4",children:[w(Zr,{to:s(`/projects/${t}`,!0),children:"Focus"}),w(Kr,{onClick:function(){r.send({type:"deselectProject",projectName:t}),l(s("/projects",!0))},children:"Exclude"}),w(Kr,i?{className:"flex flex-row items-center",onClick:function(){l(s(`/projects/trace/${i}/${t}`,!0))},children:[w(Wr,{className:"mr-2 h-5 w-5 text-slate-500"}),"End"]}:{className:"flex flex-row items-center",onClick:function(){l(s(`/projects/trace/${t}`,!0))},children:[w(Hr,{className:"mr-2 h-5 w-5 text-slate-500"}),"Start"]})]})]})};const ri=function({type:e,source:t,target:n,fileDependencies:r}){return w("div",{className:"text-sm text-slate-700 dark:text-slate-400",children:[w("h4",{className:"implicit"!==e?"mb-3":"",children:[w(Yr,{className:"mr-3",children:null!=e?e:"unknown"}),w("span",{className:"font-mono",children:[t," \u2192 ",n]})]}),"implicit"!==e?w("div",{className:"overflow-hidden rounded-md border border-slate-200 dark:border-slate-800",children:[w("div",{className:"bg-slate-50 px-4 py-2 text-xs font-medium uppercase text-slate-500 dark:bg-slate-800 dark:text-slate-400",children:w("span",{children:"Files"})}),w("ul",{className:"max-h-[300px] divide-y divide-slate-200 overflow-auto dark:divide-slate-800",children:r.map((e=>w("li",{className:"whitespace-nowrap px-4 py-2 text-sm font-medium text-slate-800 dark:text-slate-300",children:w("span",{className:"block truncate font-normal",children:e.fileName})},e.fileName)))})]}):null]})};var ii=n(43100);class oi{constructor(e){this.subscribers=new Set,this.currentTooltip=void 0,e.listen((e=>{switch(e.type){case"GraphRegenerated":this.hideAll();break;case"ProjectNodeClick":this.openProjectNodeToolTip(e.ref,{id:e.data.id,tags:e.data.tags,type:e.data.type});break;case"TaskNodeClick":this.openTaskNodeTooltip(e.ref,Object.assign({},e.data));break;case"EdgeClick":this.openEdgeToolTip(e.ref,{type:e.data.type,target:e.data.target,source:e.data.source,fileDependencies:e.data.fileDependencies})}}))}openProjectNodeToolTip(e,t){this.currentTooltip={type:"projectNode",ref:e,props:t},this.broadcastChange()}openTaskNodeTooltip(e,t){this.currentTooltip={type:"taskNode",ref:e,props:t},this.broadcastChange()}openEdgeToolTip(e,t){this.currentTooltip={type:"projectEdge",ref:e,props:t},this.broadcastChange()}broadcastChange(){this.subscribers.forEach((e=>e(this.currentTooltip)))}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}hideAll(){this.currentTooltip=null,this.broadcastChange()}}let ai;const si=function({id:e,executor:t}){return ht().selectedWorkspaceId,w("div",{className:"text-sm text-slate-700 dark:text-slate-400",children:w("h4",{children:[w(Yr,{className:"mr-3",children:t}),w("span",{className:"font-mono",children:e})]})})};function li(e){return e.split("-")[0]}function ci(e){return e.split("-")[1]}function ui(e){return["top","bottom"].includes(li(e))?"x":"y"}function di(e){return"y"===e?"height":"width"}function hi(e,t,n){let{reference:r,floating:i}=e;const o=r.x+r.width/2-i.width/2,a=r.y+r.height/2-i.height/2,s=ui(t),l=di(s),c=r[l]/2-i[l]/2,u="x"===s;let d;switch(li(t)){case"top":d={x:o,y:r.y-i.height};break;case"bottom":d={x:o,y:r.y+r.height};break;case"right":d={x:r.x+r.width,y:a};break;case"left":d={x:r.x-i.width,y:a};break;default:d={x:r.x,y:r.y}}switch(ci(t)){case"start":d[s]-=c*(n&&u?-1:1);break;case"end":d[s]+=c*(n&&u?-1:1)}return d}function fi(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function pi(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}async function vi(e,t){var n;void 0===t&&(t={});const{x:r,y:i,platform:o,rects:a,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:h=!1,padding:f=0}=t,p=fi(f),v=s[h?"floating"===d?"reference":"floating":d],g=pi(await o.getClippingRect({element:null==(n=await(null==o.isElement?void 0:o.isElement(v)))||n?v:v.contextElement||await(null==o.getDocumentElement?void 0:o.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:l})),m=pi(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({rect:"floating"===d?{...a.floating,x:r,y:i}:a.reference,offsetParent:await(null==o.getOffsetParent?void 0:o.getOffsetParent(s.floating)),strategy:l}):a[d]);return{top:g.top-m.top+p.top,bottom:m.bottom-g.bottom+p.bottom,left:g.left-m.left+p.left,right:m.right-g.right+p.right}}const gi=Math.min,mi=Math.max;function yi(e,t,n){return mi(e,gi(t,n))}const bi=e=>({name:"arrow",options:e,async fn(t){const{element:n,padding:r=0}=null!=e?e:{},{x:i,y:o,placement:a,rects:s,platform:l}=t;if(null==n)return{};const c=fi(r),u={x:i,y:o},d=ui(a),h=ci(a),f=di(d),p=await l.getDimensions(n),v="y"===d?"top":"left",g="y"===d?"bottom":"right",m=s.reference[f]+s.reference[d]-u[d]-s.floating[f],y=u[d]-s.reference[d],b=await(null==l.getOffsetParent?void 0:l.getOffsetParent(n));let x=b?"y"===d?b.clientHeight||0:b.clientWidth||0:0;0===x&&(x=s.floating[f]);const w=m/2-y/2,E=c[v],_=x-p[f]-c[g],k=x/2-p[f]/2+w,S=yi(E,k,_),P=("start"===h?c[v]:c[g])>0&&k!==S&&s.reference[f]<=s.floating[f];return{[d]:u[d]-(P?k<E?E-k:_-k:0),data:{[d]:S,centerOffset:k-S}}}}),xi={left:"right",right:"left",bottom:"top",top:"bottom"};function wi(e){return e.replace(/left|right|bottom|top/g,(e=>xi[e]))}function Ei(e,t,n){void 0===n&&(n=!1);const r=ci(e),i=ui(e),o=di(i);let a="x"===i?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=wi(a)),{main:a,cross:wi(a)}}const _i={start:"end",end:"start"};function ki(e){return e.replace(/start|end/g,(e=>_i[e]))}const Si=["top","right","bottom","left"],Pi=(Si.reduce(((e,t)=>e.concat(t,t+"-start",t+"-end")),[]),function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n;const{placement:r,middlewareData:i,rects:o,initialPlacement:a,platform:s,elements:l}=t,{mainAxis:c=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:h="bestFit",flipAlignment:f=!0,...p}=e,v=li(r),g=d||(v!==a&&f?function(e){const t=wi(e);return[ki(e),t,ki(t)]}(a):[wi(a)]),m=[a,...g],y=await vi(t,p),b=[];let x=(null==(n=i.flip)?void 0:n.overflows)||[];if(c&&b.push(y[v]),u){const{main:e,cross:t}=Ei(r,o,await(null==s.isRTL?void 0:s.isRTL(l.floating)));b.push(y[e],y[t])}if(x=[...x,{placement:r,overflows:b}],!b.every((e=>e<=0))){var w,E;const e=(null!=(w=null==(E=i.flip)?void 0:E.index)?w:0)+1,t=m[e];if(t)return{data:{index:e,overflows:x},reset:{placement:t}};let n="bottom";switch(h){case"bestFit":{var _;const e=null==(_=x.map((e=>[e,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:_[0].placement;e&&(n=e);break}case"initialPlacement":n=a}if(r!==n)return{reset:{placement:n}}}return{}}}});const ji=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,i=await async function(e,t){const{placement:n,platform:r,elements:i}=e,o=await(null==r.isRTL?void 0:r.isRTL(i.floating)),a=li(n),s=ci(n),l="x"===ui(n),c=["left","top"].includes(a)?-1:1,u=o&&l?-1:1,d="function"==typeof t?t(e):t;let{mainAxis:h,crossAxis:f,alignmentAxis:p}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return s&&"number"==typeof p&&(f="end"===s?-1*p:p),l?{x:f*u,y:h*c}:{x:h*c,y:f*u}}(t,e);return{x:n+i.x,y:r+i.y,data:i}}}};function Ci(e){return"x"===e?"y":"x"}const Ti=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=e,c={x:n,y:r},u=await vi(t,l),d=ui(li(i)),h=Ci(d);let f=c[d],p=c[h];if(o){const e="y"===d?"bottom":"right";f=yi(f+u["y"===d?"top":"left"],f,f-u[e])}if(a){const e="y"===h?"bottom":"right";p=yi(p+u["y"===h?"top":"left"],p,p-u[e])}const v=s.fn({...t,[d]:f,[h]:p});return{...v,data:{x:v.x-n,y:v.y-r}}}}};function Di(e){return e&&e.document&&e.location&&e.alert&&e.setInterval}function Ni(e){if(null==e)return window;if(!Di(e)){const t=e.ownerDocument;return t&&t.defaultView||window}return e}function Oi(e){return Ni(e).getComputedStyle(e)}function Mi(e){return Di(e)?"":e?(e.nodeName||"").toLowerCase():""}function Ai(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map((e=>e.brand+"/"+e.version)).join(" "):navigator.userAgent}function Ri(e){return e instanceof Ni(e).HTMLElement}function Ii(e){return e instanceof Ni(e).Element}function Li(e){return"undefined"!=typeof ShadowRoot&&(e instanceof Ni(e).ShadowRoot||e instanceof ShadowRoot)}function Bi(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Oi(e);return/auto|scroll|overlay|hidden/.test(t+r+n)&&!["inline","contents"].includes(i)}function Fi(e){return["table","td","th"].includes(Mi(e))}function zi(e){const t=/firefox/i.test(Ai()),n=Oi(e),r=n.backdropFilter||n.WebkitBackdropFilter;return"none"!==n.transform||"none"!==n.perspective||!!r&&"none"!==r||t&&"filter"===n.willChange||t&&!!n.filter&&"none"!==n.filter||["transform","perspective"].some((e=>n.willChange.includes(e)))||["paint","layout","strict","content"].some((e=>{const t=n.contain;return null!=t&&t.includes(e)}))}function Vi(){return!/^((?!chrome|android).)*safari/i.test(Ai())}function Gi(e){return["html","body","#document"].includes(Mi(e))}const Hi=Math.min,Wi=Math.max,qi=Math.round;function Yi(e,t,n){var r,i,o,a;void 0===t&&(t=!1),void 0===n&&(n=!1);const s=e.getBoundingClientRect();let l=1,c=1;t&&Ri(e)&&(l=e.offsetWidth>0&&qi(s.width)/e.offsetWidth||1,c=e.offsetHeight>0&&qi(s.height)/e.offsetHeight||1);const u=Ii(e)?Ni(e):window,d=!Vi()&&n,h=(s.left+(d&&null!=(r=null==(i=u.visualViewport)?void 0:i.offsetLeft)?r:0))/l,f=(s.top+(d&&null!=(o=null==(a=u.visualViewport)?void 0:a.offsetTop)?o:0))/c,p=s.width/l,v=s.height/c;return{width:p,height:v,top:f,right:h+p,bottom:f+v,left:h,x:h,y:f}}function Ui(e){return(t=e,(t instanceof Ni(t).Node?e.ownerDocument:e.document)||window.document).documentElement;var t}function Xi(e){return Ii(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function $i(e){return Yi(Ui(e)).left+Xi(e).scrollLeft}function Ki(e,t,n){const r=Ri(t),i=Ui(t),o=Yi(e,r&&function(e){const t=Yi(e);return qi(t.width)!==e.offsetWidth||qi(t.height)!==e.offsetHeight}(t),"fixed"===n);let a={scrollLeft:0,scrollTop:0};const s={x:0,y:0};if(r||!r&&"fixed"!==n)if(("body"!==Mi(t)||Bi(i))&&(a=Xi(t)),Ri(t)){const e=Yi(t,!0);s.x=e.x+t.clientLeft,s.y=e.y+t.clientTop}else i&&(s.x=$i(i));return{x:o.left+a.scrollLeft-s.x,y:o.top+a.scrollTop-s.y,width:o.width,height:o.height}}function Zi(e){if("html"===Mi(e))return e;const t=e.assignedSlot||e.parentNode||(Li(e)?e.host:null)||Ui(e);return Li(t)?t.host:t}function Qi(e){return Ri(e)&&"fixed"!==Oi(e).position?e.offsetParent:null}function Ji(e){const t=Ni(e);let n=Qi(e);for(;n&&Fi(n)&&"static"===Oi(n).position;)n=Qi(n);return n&&("html"===Mi(n)||"body"===Mi(n)&&"static"===Oi(n).position&&!zi(n))?t:n||function(e){let t=Zi(e);for(;Ri(t)&&!Gi(t);){if(zi(t))return t;t=Zi(t)}return null}(e)||t}function eo(e){const t=Zi(e);return Gi(t)?e.ownerDocument.body:Ri(t)&&Bi(t)?t:eo(t)}function to(e,t){var n;void 0===t&&(t=[]);const r=eo(e),i=r===(null==(n=e.ownerDocument)?void 0:n.body),o=Ni(r),a=i?[o].concat(o.visualViewport||[],Bi(r)?r:[]):r,s=t.concat(a);return i?s:s.concat(to(a))}function no(e,t,n){return"viewport"===t?pi(function(e,t){const n=Ni(e),r=Ui(e),i=n.visualViewport;let o=r.clientWidth,a=r.clientHeight,s=0,l=0;if(i){o=i.width,a=i.height;const e=Vi();(e||!e&&"fixed"===t)&&(s=i.offsetLeft,l=i.offsetTop)}return{width:o,height:a,x:s,y:l}}(e,n)):Ii(t)?function(e,t){const n=Yi(e,!1,"fixed"===t),r=n.top+e.clientTop,i=n.left+e.clientLeft;return{top:r,left:i,x:i,y:r,right:i+e.clientWidth,bottom:r+e.clientHeight,width:e.clientWidth,height:e.clientHeight}}(t,n):pi(function(e){var t;const n=Ui(e),r=Xi(e),i=null==(t=e.ownerDocument)?void 0:t.body,o=Wi(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=Wi(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0);let s=-r.scrollLeft+$i(e);const l=-r.scrollTop;return"rtl"===Oi(i||n).direction&&(s+=Wi(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:s,y:l}}(Ui(e)))}const ro={getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o="clippingAncestors"===n?function(e){let t=to(e).filter((e=>Ii(e)&&"body"!==Mi(e))),n=null;const r="fixed"===Oi(e).position;let i=r?Zi(e):e;for(;Ii(i)&&!Gi(i);){const e=Oi(i),o=zi(i);(r?o||n:o||"static"!==e.position||!n||!["absolute","fixed"].includes(n.position))?n=e:t=t.filter((e=>e!==i)),i=Zi(i)}return t}(t):[].concat(n),a=[...o,r],s=a[0],l=a.reduce(((e,n)=>{const r=no(t,n,i);return e.top=Wi(r.top,e.top),e.right=Hi(r.right,e.right),e.bottom=Hi(r.bottom,e.bottom),e.left=Wi(r.left,e.left),e}),no(t,s,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:r}=e;const i=Ri(n),o=Ui(n);if(n===o)return t;let a={scrollLeft:0,scrollTop:0};const s={x:0,y:0};if((i||!i&&"fixed"!==r)&&(("body"!==Mi(n)||Bi(o))&&(a=Xi(n)),Ri(n))){const e=Yi(n,!0);s.x=e.x+n.clientLeft,s.y=e.y+n.clientTop}return{...t,x:t.x-a.scrollLeft+s.x,y:t.y-a.scrollTop+s.y}},isElement:Ii,getDimensions:function(e){if(Ri(e))return{width:e.offsetWidth,height:e.offsetHeight};const t=Yi(e);return{width:t.width,height:t.height}},getOffsetParent:Ji,getDocumentElement:Ui,async getElementRects(e){let{reference:t,floating:n,strategy:r}=e;const i=this.getOffsetParent||Ji,o=this.getDimensions;return{reference:Ki(t,await i(n),r),floating:{x:0,y:0,...await o(n)}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>"rtl"===Oi(e).direction};const io=(e,t,n)=>(async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:a}=n,s=o.filter(Boolean),l=await(null==a.isRTL?void 0:a.isRTL(t));let c=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=hi(c,r,l),h=r,f={},p=0;for(let v=0;v<s.length;v++){const{name:n,fn:o}=s[v],{x:g,y:m,data:y,reset:b}=await o({x:u,y:d,initialPlacement:r,placement:h,strategy:i,middlewareData:f,rects:c,platform:a,elements:{reference:e,floating:t}});u=null!=g?g:u,d=null!=m?m:d,f={...f,[n]:{...f[n],...y}},b&&p<=50&&(p++,"object"==typeof b&&(b.placement&&(h=b.placement),b.rects&&(c=!0===b.rects?await a.getElementRects({reference:e,floating:t,strategy:i}):b.rects),({x:u,y:d}=hi(c,h,l))),v=-1)}return{x:u,y:d,placement:h,strategy:i,middlewareData:f}})(e,t,{platform:ro,...n});var oo="undefined"!=typeof document?r.useLayoutEffect:r.useEffect;function ao(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;0!=r--;)if(!ao(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!Object.prototype.hasOwnProperty.call(t,i[r]))return!1;for(r=n;0!=r--;){const n=i[r];if(("_owner"!==n||!e.$$typeof)&&!ao(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function so(e){let{middleware:t=[],placement:n="bottom",strategy:i="absolute",whileElementsMounted:o}=void 0===e?{}:e;const[a,s]=r.useState({x:null,y:null,strategy:i,placement:n,middlewareData:{}}),[l,c]=r.useState(t);ao(l,t)||c(t);const u=r.useRef(null),d=r.useRef(null),h=r.useRef(null),f=r.useRef(a),p=function(e){const t=r.useRef(e);return oo((()=>{t.current=e})),t}(o),v=r.useCallback((()=>{u.current&&d.current&&io(u.current,d.current,{middleware:l,placement:n,strategy:i}).then((e=>{g.current&&!ao(f.current,e)&&(f.current=e,r.flushSync((()=>{s(e)})))}))}),[l,n,i]);oo((()=>{g.current&&v()}),[v]);const g=r.useRef(!1);oo((()=>(g.current=!0,()=>{g.current=!1})),[]);const m=r.useCallback((()=>{if("function"==typeof h.current&&(h.current(),h.current=null),u.current&&d.current)if(p.current){const e=p.current(u.current,d.current,v);h.current=e}else v()}),[v,p]),y=r.useCallback((e=>{u.current=e,m()}),[m]),b=r.useCallback((e=>{d.current=e,m()}),[m]),x=r.useMemo((()=>({reference:u,floating:d})),[]);return r.useMemo((()=>({...a,update:v,refs:x,reference:y,floating:b})),[a,v,x,y,b])}const lo=e=>{const{element:t,padding:n}=e;return{name:"arrow",options:e,fn(e){return r=t,Object.prototype.hasOwnProperty.call(r,"current")?null!=t.current?bi({element:t.current,padding:n}).fn(e):{}:t?bi({element:t,padding:n}).fn(e):{};var r}}};function co({children:e,open:t=!1,content:n,placement:i="top",reference:o,openAction:a="click"}){const[s,l]=(0,r.useState)(t),c=(0,r.useRef)(null),{x:u,y:d,reference:h,floating:f,strategy:p,placement:v,middlewareData:{arrow:{x:g,y:m}={}}}=so({placement:i,middleware:[ji(6),Pi(),Ti({padding:6}),lo({element:c})]}),y={top:"bottom",right:"left",bottom:"top",left:"right"}[v.split("-")[0]];(0,r.useLayoutEffect)((()=>{o&&h(o)}),[h,o]);const x={ref:h};return"click"===a?x.onClick=()=>l(!s):"hover"===a&&(x.onMouseEnter=()=>l(!0),x.onMouseLeave=()=>l(!1)),w(b.HY,{children:[!o&&e?(0,r.cloneElement)(e,x):e,s?w("div",{role:"tooltip",ref:f,style:{position:p,top:null!=d?d:0,left:null!=u?u:0,width:"max-content"},className:"absolute z-0 min-w-[250px] rounded-md border border-slate-500",children:[w("div",{style:{left:null!=g?`${g}px`:"",top:null!=m?`${m}px`:"",right:"",bottom:"",[y]:"-4px"},className:"absolute -z-10 h-4 w-4 rotate-45 bg-slate-500",ref:c}),w("div",{className:"rounded-md bg-white p-3 dark:bg-slate-900 dark:text-slate-400",children:n})]}):null]})}const uo=function(){if(!ai){const e=k();ai=new oi(e)}return ai}();const ho=function(){const e=(0,ii.useSyncExternalStore)((e=>uo.subscribe(e)),(()=>uo.currentTooltip));let t;if(e)switch(e.type){case"projectNode":t=w(ni,Object.assign({},e.props));break;case"projectEdge":t=w(ri,Object.assign({},e.props));break;case"taskNode":t=w(si,Object.assign({},e.props))}return t?w(co,{content:t,open:!0,reference:e.ref,placement:"top",openAction:"manual"}):null};function fo(){const e=Gr(),t=k(),n=(0,ii.useSyncExternalStore)((e=>t.listen(e)),(()=>t.lastPerformanceReport)),r=0!==n.numNodes,i=Xt(),o=Xt(),a=ut(),s=Cr(),{selectedWorkspaceId:l,selectedTaskId:c}=ht(),u=s.currentPath,d=u.startsWith("/tasks")?"/tasks":"/projects";return w(b.HY,{children:[w("div",{className:("nx-console"===o.environment?"absolute top-5 left-5 z-50 bg-white":"relative flex h-full overflow-y-scroll")+" w-72 flex-col pb-10 shadow-lg ring-1 ring-slate-900/10 ring-opacity-10 transition-all dark:ring-slate-300/10",id:"sidebar",children:["nx-console"!==o.environment?w(b.HY,{children:[w("div",{className:"border-b border-slate-900/10 text-slate-700 dark:border-slate-300/10 dark:bg-transparent dark:text-slate-400",children:w("div",{className:"mx-4 my-2 flex items-center justify-between",children:[w("svg",{className:"h-10 w-auto text-slate-900 dark:text-white",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:[w("title",{children:"Nx"}),w("path",{d:"M11.987 14.138l-3.132 4.923-5.193-8.427-.012 8.822H0V4.544h3.691l5.247 8.833.005-3.998 3.044 4.759zm.601-5.761c.024-.048 0-3.784.008-3.833h-3.65c.002.059-.005 3.776-.003 3.833h3.645zm5.634 4.134a2.061 2.061 0 0 0-1.969 1.336 1.963 1.963 0 0 1 2.343-.739c.396.161.917.422 1.33.283a2.1 2.1 0 0 0-1.704-.88zm3.39 1.061c-.375-.13-.8-.277-1.109-.681-.06-.08-.116-.17-.176-.265a2.143 2.143 0 0 0-.533-.642c-.294-.216-.68-.322-1.18-.322a2.482 2.482 0 0 0-2.294 1.536 2.325 2.325 0 0 1 4.002.388.75.75 0 0 0 .836.334c.493-.105.46.36 1.203.518v-.133c-.003-.446-.246-.55-.75-.733zm2.024 1.266a.723.723 0 0 0 .347-.638c-.01-2.957-2.41-5.487-5.37-5.487a5.364 5.364 0 0 0-4.487 2.418c-.01-.026-1.522-2.39-1.538-2.418H8.943l3.463 5.423-3.379 5.32h3.54l1.54-2.366 1.568 2.366h3.541l-3.21-5.052a.7.7 0 0 1-.084-.32 2.69 2.69 0 0 1 2.69-2.691h.001c1.488 0 1.736.89 2.057 1.308.634.826 1.9.464 1.9 1.541a.707.707 0 0 0 1.066.596zm.35.133c-.173.372-.56.338-.755.639-.176.271.114.412.114.412s.337.156.538-.311c.104-.231.14-.488.103-.74z"})]}),w(Yt,{"data-cy":"route-select",defaultValue:u.startsWith("/projects")?"/projects":"/tasks",onChange:t=>{e.send("deselectAll"),"dev"===i.environment?a(`/${s.workspace}${t.currentTarget.value}`):a(`${t.currentTarget.value}`)},children:[{route:"/projects",label:"Projects"},{route:"/tasks",label:"Tasks"}].map((e=>w("option",{value:e.route,children:e.label})))}),w(Tr,{children:w(Or,{})}),w(jr,{})]})}),w("a",{id:"help",className:" mt-3 flex cursor-pointer items-center px-4 text-xs hover:underline ",href:"https://nx.dev/structure/dependency-graph",rel:"noreferrer",target:"_blank",children:[w(Ft,{className:"mr-2 h-4 w-4"}),"Analyse and visualize your workspace."]})]}):null,w(_t,{})]}),w("div",{id:"main-content",className:"flex-grow overflow-hidden transition-all",children:[i.appConfig.showDebugger?w(Ut,{projects:i.appConfig.workspaces,selectedProject:l,lastPerfReport:n,selectedProjectChange:function(e){a(`/${e}${d}`)}}):null,r?null:w("div",{"data-cy":"no-tasks-selected",className:"flex h-full w-full items-center justify-center text-slate-700 dark:text-slate-400",children:[w(zt,{className:"mr-4 h-6 w-6"}),w("h4",{children:["Please select a"," ",u.startsWith("/tasks")?"task":"project"," in the sidebar."]})]}),w("div",{className:"h-full w-full",children:[w("div",{className:"h-full w-full",id:"cytoscape-graph"}),w(ho,{}),w(co,{openAction:"hover",content:"Download Graph as PNG",placement:"right",children:w("button",{type:"button",className:Ht()(r?"":"opacity-0","fixed bottom-4 right-4 z-50 block h-16 w-16 transform rounded-full bg-blue-500 text-white shadow-sm transition duration-300 dark:bg-sky-500"),"data-cy":"downloadImageButton",onClick:function(){const e=k().getImage();let t=document.createElement("a");t.href=e,t.download="graph.png",t.dispatchEvent(new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window}))},children:w(Vt,{className:"absolute top-1/2 left-1/2 -mt-3 -ml-3 h-6 w-6"})})})]})]})]})}var po=n(41110);r.useLayoutEffect;function vo(e){return"state"in e}var go=function(e,t){return e===t};function mo(e,t,n,i){void 0===n&&(n=go);var o=(0,r.useRef)(null),a=(0,r.useCallback)((function(t){return e.subscribe(t).unsubscribe}),[e]),s=(0,r.useCallback)((function(){return i?i(e):function(e,t){if("state"in(i=e)&&"machine"in i){if(0===e.status&&t.current)return t.current;var n=0!==(r=e).status?r.state:r.machine.initialState;return t.current=0===e.status?n:null,n}var r,i;return vo(e)?e.state:void 0}(e,o)}),[e,i]);return(0,po.useSyncExternalStoreWithSelector)(a,s,s,t,n)}function yo(e){return mo(Gr(),e)}const bo=e=>e.context.projects,xo=e=>e.context.workspaceLayout,wo=e=>e.context.selectedProjects,Eo=e=>e.context.focusedProject,_o=e=>({searchDepth:e.context.searchDepth,searchDepthEnabled:e.context.searchDepthEnabled}),ko=e=>e.context.includePath,So=e=>e.context.groupByFolder,Po=e=>e.context.collapseEdges,jo=e=>e.context.textFilter,Co=e=>e.context.affectedProjects.length>0,To=e=>e.context.tracing,Do=(0,r.memo)((({collapseEdges:e,collapseEdgesChanged:t})=>w("div",{className:"px-4",children:w("div",{className:"flex items-start",children:[w("div",{className:"flex h-5 items-center",children:w("input",{id:"collapseEdges",name:"collapseEdges",value:"collapseEdges",type:"checkbox",className:"h-4 w-4 accent-purple-500",onChange:e=>t(e.target.checked),checked:e})}),w("div",{className:"ml-3 text-sm",children:[w("label",{htmlFor:"collapseEdges",className:"cursor-pointer font-medium text-slate-600 dark:text-slate-400",children:"Collapse edges"}),w("p",{className:"text-slate-400 dark:text-slate-500",children:"Display edges between groups rather than libraries"})]})]})})));const No=r.forwardRef((function({title:e,titleId:t,...n},i){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:i,"aria-labelledby":t},n),e?r.createElement("title",{id:t},e):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12.75 15l3-3m0 0l-3-3m3 3h-7.5M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}))}));const Oo=r.forwardRef((function({title:e,titleId:t,...n},i){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:i,"aria-labelledby":t},n),e?r.createElement("title",{id:t},e):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.75 9.75l4.5 4.5m0-4.5l-4.5 4.5M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}))})),Mo=(0,r.memo)((({focusedLabel:e,resetFocus:t})=>w("div",{className:"mt-10 px-4",children:w("div",{className:"group relative flex cursor-pointer items-center overflow-hidden rounded-md border border-slate-200 bg-blue-500 p-2 text-slate-50 shadow-sm dark:border-slate-700 dark:bg-sky-500","data-cy":"unfocusButton",onClick:()=>t(),children:[w("p",{className:"truncate transition duration-200 ease-in-out group-hover:opacity-60",children:[w(No,{className:"-mt-1 mr-1 inline h-6 w-6"}),w("span",{id:"focused-project-name",children:["Focused on ",e]})]}),w("div",{className:"absolute right-2 flex translate-x-32 items-center rounded-md bg-white pl-2 text-sm font-medium text-slate-700 shadow-sm ring-1 ring-slate-500 transition-all duration-200 ease-in-out group-hover:translate-x-0 dark:bg-slate-800 dark:text-slate-300",children:["Reset",w("span",{className:"rounded-md p-1",children:w(Oo,{className:"h-5 w-5"})})]})]})}))),Ao=(0,r.memo)((({checked:e,checkChanged:t,label:n,description:r,name:i})=>w("div",{className:"mt-8 px-4",children:w("div",{className:"flex items-start",children:[w("div",{className:"flex h-5 items-center",children:w("input",{id:i,name:i,value:i,type:"checkbox",className:"h-4 w-4 accent-blue-500 dark:accent-sky-500",onChange:e=>t(e.target.checked),checked:e})}),w("div",{className:"ml-3 text-sm",children:[w("label",{htmlFor:i,className:"cursor-pointer font-medium text-slate-600 dark:text-slate-400",children:n}),w("p",{className:"text-slate-400 dark:text-slate-500",children:r})]})]})}))),Ro=({groupByFolder:e,groupByFolderChanged:t})=>w(Ao,{checked:e,checkChanged:t,name:"groupByFolder",label:"Group by folder",description:"Visually arrange libraries by folders."});const Io=r.forwardRef((function({title:e,titleId:t,...n},i){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:i,"aria-labelledby":t},n),e?r.createElement("title",{id:t},e):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m5.231 13.481L15 17.25m-4.5-15H5.625c-.621 0-1.125.504-1.125 1.125v16.5c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9zm3.75 11.625a2.625 2.625 0 11-5.25 0 2.625 2.625 0 015.25 0z"}))}));const Lo=r.forwardRef((function({title:e,titleId:t,...n},i){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:i,"aria-labelledby":t},n),e?r.createElement("title",{id:t},e):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 10.5a3 3 0 11-6 0 3 3 0 016 0z"}),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 10.5c0 7.142-7.5 11.25-7.5 11.25S4.5 17.642 4.5 10.5a7.5 7.5 0 1115 0z"}))}));const Bo=r.forwardRef((function({title:e,titleId:t,...n},i){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:i,"aria-labelledby":t},n),e?r.createElement("title",{id:t},e):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 3v1.5M3 21v-6m0 0l2.77-.693a9 9 0 016.208.682l.108.054a9 9 0 006.086.71l3.114-.732a48.524 48.524 0 01-.005-10.499l-3.11.732a9 9 0 01-6.085-.711l-.108-.054a9 9 0 00-6.208-.682L3 4.5M3 15V4.5"}))}));const Fo=r.forwardRef((function({title:e,titleId:t,...n},i){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:i,"aria-labelledby":t},n),e?r.createElement("title",{id:t},e):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.036 12.322a1.012 1.012 0 010-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178z"}),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}))}));function zo(e,t,n){let r={};return e.forEach((e=>{const i="app"===e.type||"e2e"===e.type?n.appsDir:n.libsDir,o=Jr(e.data.root,i).join("/");r.hasOwnProperty(o)||(r[o]=[]),r[o].push({projectGraphNode:e,isSelected:t.includes(e.name)})})),r}function Vo({project:e,tracingInfo:t}){const n=Gr(),r=ut(),i=Qr();function o(e,t){t?n.send({type:"deselectProject",projectName:e}):n.send({type:"selectProject",projectName:e}),r(i("/projects",!0))}return w("li",{className:"relative block cursor-default select-none py-1 pl-2 pr-6 text-xs text-slate-600 dark:text-slate-400",children:[w("div",{className:"flex items-center",children:[w(Rt,{"data-cy":`focus-button-${e.projectGraphNode.name}`,className:"mr-1 flex items-center rounded-md border-slate-300 bg-white p-1 font-medium text-slate-500 shadow-sm ring-1 ring-slate-200 transition hover:bg-slate-50 dark:border-slate-600 dark:bg-slate-800 dark:text-slate-400 dark:ring-slate-600 hover:dark:bg-slate-700",title:"Focus on this library",to:i(`/projects/${e.projectGraphNode.name}`,!0),children:w(Io,{className:"h-5 w-5"})}),w(Tr,{children:w("span",{className:"relative z-0 inline-flex rounded-md shadow-sm",children:[w("button",{type:"button",title:"Start Trace",onClick:()=>{return t=e.projectGraphNode.name,void n.send({type:"setTracingStart",projectName:t});var t},className:(t.start===e.projectGraphNode.name?"ring-blue-500 dark:ring-sky-500":"ring-slate-200 dark:ring-slate-600")+" flex items-center rounded-l-md border-slate-300 bg-white p-1 font-medium text-slate-500 shadow-sm ring-1 transition hover:bg-slate-50 dark:border-slate-600 dark:bg-slate-800 dark:text-slate-400 dark:ring-slate-600 hover:dark:bg-slate-700",children:w(Lo,{className:"h-5 w-5"})}),w("button",{type:"button",title:"End Trace",onClick:()=>{return t=e.projectGraphNode.name,void n.send({type:"setTracingEnd",projectName:t});var t},className:(t.end===e.projectGraphNode.name?"ring-blue-500 dark:ring-sky-500":"ring-slate-200 dark:ring-slate-600")+" flex items-center rounded-r-md border-slate-300 bg-white p-1 font-medium text-slate-500 shadow-sm ring-1 transition hover:bg-slate-50 dark:border-slate-600 dark:bg-slate-800 dark:text-slate-400 dark:ring-slate-600 hover:dark:bg-slate-700",children:w(Bo,{className:"h-5 w-5"})})]})}),w("label",{className:"ml-2 block w-full cursor-pointer truncate rounded-md p-2 font-mono font-normal transition hover:bg-slate-50 hover:dark:bg-slate-700","data-project":e.projectGraphNode.name,title:e.projectGraphNode.name,"data-active":e.isSelected.toString(),onClick:()=>o(e.projectGraphNode.name,e.isSelected),children:e.projectGraphNode.name})]}),e.isSelected?w("span",{title:"This library is visible",className:"absolute inset-y-0 right-0 flex cursor-pointer items-center text-blue-500 dark:text-sky-500",onClick:()=>o(e.projectGraphNode.name,e.isSelected),children:w(Fo,{className:"h-5 w-5"})}):null]})}function Go({headerText:e="",projects:t,tracingInfo:n}){const r=Gr();let i=[...t];i.sort(((e,t)=>e.projectGraphNode.name.localeCompare(t.projectGraphNode.name)));const o=t.every((e=>e.isSelected));return w(b.HY,{children:[""!==e?w("div",{className:"relative mt-4 flex justify-between py-2 text-slate-800 dark:text-slate-200",children:[w("h3",{className:"cursor-text text-sm font-semibold uppercase tracking-wide lg:text-xs",children:e}),w("span",{title:o?`Hide all ${e} projects`:`Show all ${e} projects`,className:"absolute inset-y-0 right-0 flex cursor-pointer items-center text-sm font-semibold uppercase tracking-wide lg:text-xs","data-cy":`toggle-folder-visibility-button-${e}`,onClick:()=>function(e){const n=t.map((e=>e.projectGraphNode.name));e?r.send({type:"deselectProjects",projectNames:n}):r.send({type:"selectProjects",projectNames:n})}(o),children:w(Fo,{className:"h-5 w-5"})})]}):null,w("ul",{className:"mt-2 -ml-3",children:i.map((e=>w(Vo,{project:e,tracingInfo:n},e.projectGraphNode.name)))})]})}const Ho=function(){const e=yo(To),t=yo(bo),n=yo(xo),r=yo(wo),i=ei("app",t),o=ei("lib",t),a=ei("e2e",t),s=zo(i,r,n),l=zo(o,r,n),c=zo(a,r,n),u=Object.keys(s).sort(),d=Object.keys(l).sort(),h=Object.keys(c).sort();return w("div",{id:"project-lists",className:"mt-8 border-t border-slate-400/10 px-4",children:[w("h2",{className:"mt-8 border-b border-solid border-slate-200/10 text-lg font-light text-slate-400 dark:text-slate-500",children:"app projects"}),u.map((t=>w(Go,{headerText:t,projects:s[t],tracingInfo:e},"app-"+t))),w("h2",{className:"mt-8 border-b border-solid border-slate-200/10 text-lg font-light text-slate-400 dark:text-slate-500",children:"e2e projects"}),h.map((t=>w(Go,{headerText:t,projects:c[t],tracingInfo:e},"e2e-"+t))),w("h2",{className:"mt-8 border-b border-solid border-slate-200/10 text-lg font-light text-slate-400 dark:text-slate-500",children:"lib projects"}),d.map((t=>w(Go,{headerText:t,projects:l[t],tracingInfo:e},"lib-"+t)))]})};const Wo=r.forwardRef((function({title:e,titleId:t,...n},i){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:i,"aria-labelledby":t},n),e?r.createElement("title",{id:t},e):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 12h-15"}))}));const qo=r.forwardRef((function({title:e,titleId:t,...n},i){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:i,"aria-labelledby":t},n),e?r.createElement("title",{id:t},e):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4.5v15m7.5-7.5h-15"}))})),Yo=(0,r.memo)((({searchDepth:e,searchDepthEnabled:t,searchDepthFilterEnabledChange:n,decrementDepthFilter:r,incrementDepthFilter:i})=>w("div",{className:"mt-4 px-4",children:[w("div",{className:"mt-4 flex items-start",children:[w("div",{className:"flex h-5 items-center",children:w("input",{id:"depthFilter",name:"depthFilter",value:"depthFilterActivated",type:"checkbox",className:"h-4 w-4 accent-blue-500 dark:accent-sky-500",checked:t,onChange:e=>n(e.target.checked)})}),w("div",{className:"ml-3 text-sm",children:[w("label",{htmlFor:"depthFilter",className:"cursor-pointer font-medium text-slate-600 dark:text-slate-400",children:"Activate proximity"}),w("p",{className:"text-slate-400 dark:text-slate-500",children:"Explore connected libraries step by step."})]})]}),w("div",{className:"mt-3 px-10",children:w("div",{className:"flex rounded-md shadow-sm",children:[w("button",{"data-cy":"decrement-depth-filter",title:"Remove ancestor level",className:"inline-flex items-center rounded-l-md border border-slate-300 bg-slate-50 py-2 px-4 text-slate-500 hover:bg-slate-100 dark:border-slate-600 dark:bg-slate-800 dark:text-slate-300 hover:dark:bg-slate-700",onClick:r,children:w(Wo,{className:"h-4 w-4"})}),w("span",{id:"depthFilterValue","data-cy":"depth-value",className:"block w-full flex-1 rounded-none border-t border-b border-slate-300 bg-white p-1.5 text-center font-mono dark:border-slate-600 dark:bg-slate-800 dark:text-slate-300 hover:dark:bg-slate-700",children:e}),w("button",{"data-cy":"increment-depth-filter",title:"Add ancestor level",className:"inline-flex items-center rounded-r-md border border-slate-300 bg-slate-50 py-2 px-4 text-slate-500 hover:bg-slate-100 dark:border-slate-600 dark:bg-slate-800 dark:text-slate-300 hover:dark:bg-slate-700",onClick:i,children:w(qo,{className:"h-4 w-4"})})]})})]})));const Uo=r.forwardRef((function({title:e,titleId:t,...n},i){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:i,"aria-labelledby":t},n),e?r.createElement("title",{id:t},e):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 13.5l10.5-11.25L12 10.5h8.25L9.75 21.75 12 13.5H3.75z"}))}));const Xo=r.forwardRef((function({title:e,titleId:t,...n},i){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:i,"aria-labelledby":t},n),e?r.createElement("title",{id:t},e):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.98 8.223A10.477 10.477 0 001.934 12C3.226 16.338 7.244 19.5 12 19.5c.993 0 1.953-.138 2.863-.395M6.228 6.228A10.45 10.45 0 0112 4.5c4.756 0 8.773 3.162 10.065 7.498a10.523 10.523 0 01-4.293 5.774M6.228 6.228L3 3m3.228 3.228l3.65 3.65m7.894 7.894L21 21m-3.228-3.228l-3.65-3.65m0 0a3 3 0 10-4.243-4.243m4.242 4.242L9.88 9.88"}))})),$o=(0,r.memo)((({showAll:e,hideAll:t,showAffected:n,hasAffected:r,label:i})=>w("div",{className:"mt-8 px-4",children:[w("button",{onClick:e,type:"button",className:"flex w-full items-center rounded-md border border-slate-300 bg-white px-4 py-2 text-sm font-medium text-slate-700 shadow-sm hover:bg-slate-50 dark:border-slate-600 dark:bg-slate-800 dark:text-slate-300 hover:dark:bg-slate-700","data-cy":"selectAllButton",children:[w(Fo,{className:"-ml-1 mr-2 h-5 w-5 text-slate-400"}),"Show all ",i]}),r?w("button",{onClick:n,type:"button",className:"mt-3 flex w-full items-center rounded-md border border-pink-500 bg-pink-400 px-4 py-2 text-sm font-medium text-white shadow-sm hover:bg-pink-500 dark:border-fuchsia-800 dark:bg-fuchsia-700 dark:text-white hover:dark:bg-fuchsia-600","data-cy":"affectedButton",children:[w(Uo,{className:"-ml-1 mr-2 h-5 w-5 text-white"}),"Show affected ",i]}):null,w("button",{onClick:t,type:"button",className:"mt-3 flex w-full items-center rounded-md border border-slate-300 bg-white px-4 py-2 text-sm font-medium text-slate-700 shadow-sm hover:bg-slate-50 dark:border-slate-600 dark:bg-slate-800 dark:text-slate-300 hover:dark:bg-slate-700","data-cy":"deselectAllButton",children:[w(Xo,{className:"-ml-1 mr-2 h-5 w-5 text-slate-500"}),"Hide all ",i]})]})));const Ko=r.forwardRef((function({title:e,titleId:t,...n},i){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:i,"aria-labelledby":t},n),e?r.createElement("title",{id:t},e):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 3c2.755 0 5.455.232 8.083.678.533.09.917.556.917 1.096v1.044a2.25 2.25 0 01-.659 1.591l-5.432 5.432a2.25 2.25 0 00-.659 1.591v2.927a2.25 2.25 0 01-1.244 2.013L9.75 21v-6.568a2.25 2.25 0 00-.659-1.591L3.659 7.409A2.25 2.25 0 013 5.818V4.774c0-.54.384-1.006.917-1.096A48.32 48.32 0 0112 3z"}))}));const Zo=r.forwardRef((function({title:e,titleId:t,...n},i){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:i,"aria-labelledby":t},n),e?r.createElement("title",{id:t},e):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9.75L14.25 12m0 0l2.25 2.25M14.25 12l2.25-2.25M14.25 12L12 14.25m-2.58 4.92l-6.375-6.375a1.125 1.125 0 010-1.59L9.42 4.83c.211-.211.498-.33.796-.33H19.5a2.25 2.25 0 012.25 2.25v10.5a2.25 2.25 0 01-2.25 2.25h-9.284c-.298 0-.585-.119-.796-.33z"}))}));const Qo=function({initialText:e,placeholderText:t,resetTextFilter:n,updateTextFilter:i}){const[o,a]=(0,r.useState)(null!=e?e:""),[s,l]=function(e,t){const[n,i]=(0,r.useState)(e);return(0,r.useEffect)((()=>{const n=setTimeout((()=>{i(e)}),t);return()=>{clearTimeout(n)}}),[e,t]),[n,i]}(o,500);return(0,r.useEffect)((()=>{""!==s&&i(s)}),[s,i]),w("form",{className:"group relative flex rounded-md shadow-sm",onSubmit:e=>e.preventDefault(),children:[w("span",{className:"inline-flex items-center rounded-l-md border border-r-0 border-slate-300 bg-slate-50 p-2 dark:border-slate-900 dark:bg-slate-800",children:w(Ko,{className:"h-4 w-4"})}),w("input",{type:"text",className:"block w-full flex-1 rounded-none rounded-r-md border border-slate-300 bg-white p-1.5 font-light text-slate-400 placeholder:font-light placeholder:text-slate-400 dark:border-slate-900 dark:bg-slate-800 dark:text-white dark:hover:bg-slate-700",placeholder:t,"data-cy":"textFilterInput",name:"filter",value:o,onKeyUp:function(e){"Enter"===e.key&&i(e.currentTarget.value)},onChange:e=>{var t;""===(t=e.currentTarget.value)?(a(""),l(""),n()):a(t)}}),o.length>0?w("button",{"data-cy":"textFilterReset",type:"reset",onClick:function(){a(""),l(""),n()},className:"absolute top-1 right-1 inline-block rounded-md bg-slate-50 p-1 text-slate-400 dark:bg-slate-800",children:w(Zo,{className:"h-5 w-5"})}):null]})};const Jo=function({textFilter:e,resetTextFilter:t,updateTextFilter:n,toggleIncludeLibsInPathChange:r,includePath:i}){return w("div",{children:[w("div",{className:"mt-10 px-4",children:w(Qo,{resetTextFilter:t,updateTextFilter:n,initialText:"",placeholderText:"lib name, other lib name"})}),w("div",{className:"mt-4 px-4",children:w("div",{className:"flex items-start",children:[w("div",{className:"flex h-5 items-center",children:w("input",{disabled:0===e.length,id:"includeInPath",name:"textFilterCheckbox",type:"checkbox",value:"includeInPath",className:"h-4 w-4 accent-blue-500 dark:accent-sky-500",checked:i,onChange:r})}),w("div",{className:"ml-3 text-sm",children:[w("label",{htmlFor:"includeInPath",className:"cursor-pointer font-medium text-slate-600 dark:text-slate-400",children:"Include related libraries"}),w("p",{className:"text-slate-400 dark:text-slate-500",children:"Show libraries that are related to your search."})]})]})})]})};const ea=r.forwardRef((function({title:e,titleId:t,...n},i){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:i,"aria-labelledby":t},n),e?r.createElement("title",{id:t},e):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6.75a.75.75 0 110-1.5.75.75 0 010 1.5zM12 12.75a.75.75 0 110-1.5.75.75 0 010 1.5zM12 18.75a.75.75 0 110-1.5.75.75 0 010 1.5z"}))})),ta=(0,r.memo)((({start:e,end:t,algorithm:n,setAlgorithm:r,resetStart:i,resetEnd:o})=>w("div",{className:"mt-10 px-4",children:w("div",{className:"transition duration-200 ease-in-out group-hover:opacity-60",children:[w("h3",{className:"cursor-text pb-2 text-sm font-semibold uppercase tracking-wide text-slate-800 dark:text-slate-200 lg:text-xs",children:"Tracing Path"}),w("div",{className:"mb-3 flex cursor-pointer flex-row rounded-md border text-center text-xs dark:border-slate-600",children:[w("button",{onClick:()=>r("shortest"),className:("shortest"===n?"border-blue-500 dark:border-sky-500":"border-slate-300 dark:border-slate-600")+" flex-1 rounded-l-md border bg-slate-50 py-2 px-4 text-slate-500 hover:bg-slate-100 dark:border-slate-600 dark:bg-slate-800 dark:text-slate-300 hover:dark:bg-slate-700",children:w("span",{children:"Shortest"})}),w("button",{onClick:()=>r("all"),className:("all"===n?"border-blue-500 dark:border-sky-500":"border-slate-300 dark:border-slate-600")+" flex-1 rounded-r-md border bg-slate-50 py-2 px-4 text-slate-500 hover:bg-slate-100 dark:bg-slate-800 dark:text-slate-300 hover:dark:bg-slate-700",children:w("span",{children:"All"})})]}),w("div",{className:"flex flex-row items-center truncate ",children:[w(Lo,{className:"mr-2 h-5 w-5 text-slate-500 dark:text-slate-400"}),e?w("div",{className:"group relative flex-1 cursor-pointer flex-col items-center overflow-hidden","data-cy":"resetTraceButton",onClick:i,children:[w("div",{className:"flex-1 truncate rounded-md border border-slate-200 bg-blue-500 p-2 text-slate-50 shadow-sm transition duration-200 ease-in-out group-hover:opacity-60 dark:border-slate-700 dark:bg-sky-500",children:w("span",{children:e})}),w("div",{className:"absolute top-2 right-2 flex translate-x-32 items-center rounded-md bg-white pl-2 text-sm font-medium text-slate-700 shadow-sm ring-1 ring-slate-500 transition-all transition duration-200 ease-in-out group-hover:translate-x-0 dark:bg-slate-800 dark:text-slate-300 dark:ring-slate-700",children:["Reset",w("span",{className:"rounded-md p-1",children:w(Oo,{className:"h-5 w-5"})})]})]}):w("p",{className:"text-sm text-slate-500",children:"Select start project"})]}),w("div",{children:w(ea,{className:"h-5 w-5 text-slate-500 dark:text-slate-400"})}),w("div",{className:"flex flex-row items-center truncate ",children:[w(Bo,{className:"mr-2 h-5 w-5 text-slate-500 dark:text-slate-400"}),t?w("div",{className:" group relative flex-1 cursor-pointer flex-col items-center overflow-hidden ","data-cy":"resetTraceButton",onClick:o,children:[w("div",{className:"flex-1 truncate rounded-md border border-slate-200 bg-blue-500 p-2 text-slate-50 shadow-sm transition duration-200 ease-in-out group-hover:opacity-60 dark:border-slate-700 dark:bg-sky-500",children:w("span",{children:t})}),w("div",{className:"absolute top-2 right-2 flex translate-x-32 items-center rounded-md bg-white pl-2 text-sm font-medium text-slate-700 shadow-sm ring-1 ring-slate-500 transition-all transition duration-200 ease-in-out group-hover:translate-x-0 dark:bg-slate-800 dark:text-slate-300 dark:ring-slate-700",children:["Reset",w("span",{className:"rounded-md p-1",children:w(Oo,{className:"h-5 w-5"})})]})]}):w("p",{className:"text-sm text-slate-500",children:"Select end project"})]})]})})));class na{async getHash(){const e=new Request("currentHash",{mode:"no-cors"});return(await fetch(e)).json()}async getProjectGraph(e){const t=new Request(e,{mode:"no-cors"});return(await fetch(t)).json()}async getTaskGraph(e){const t=new Request(e,{mode:"no-cors"});return(await fetch(t)).json()}}class ra{async getHash(){return new Promise((e=>e("some-hash")))}async getProjectGraph(e){return new Promise((e=>e(window.projectGraphResponse)))}async getTaskGraph(e){return new Promise((e=>e(window.taskGraphResponse)))}}class ia{constructor(e=5e3){this.projectGraphsResponse={hash:"79054025255fb1a26e4bc422aef54eb4",layout:{appsDir:"apps",libsDir:"libs"},projects:[{name:"existing-app-1",type:"app",data:{root:"apps/app1",tags:[],files:[{file:"some/file.ts",hash:"ecccd8481d2e5eae0e59928be1bc4c2d071729d7",deps:["existing-lib-1"]}]}},{name:"existing-lib-1",type:"lib",data:{root:"libs/lib1",tags:[],files:[]}}],dependencies:{"existing-app-1":[{source:"existing-app-1",target:"existing-lib-1",type:"static"}],"existing-lib-1":[]},affected:[],focus:null,exclude:[],groupByFolder:!1},this.taskGraphsResponse={taskGraphs:{}},setInterval((()=>this.updateResponse()),e)}async getHash(){return new Promise((e=>e(this.projectGraphsResponse.hash)))}getProjectGraph(e){return new Promise((e=>e(this.projectGraphsResponse)))}getTaskGraph(e){return new Promise((e=>e(this.taskGraphsResponse)))}createNewProject(){const e=Math.random()>.25?"lib":"app",t=`${e}-${this.projectGraphsResponse.projects.length+1}`;return{name:t,type:e,data:{root:"app"===e?`apps/${t}`:`libs/${t}`,tags:[],files:[]}}}updateResponse(){const e=this.createNewProject(),t=this.projectGraphsResponse.projects.filter((e=>"lib"===e.type)),n=t[Math.floor(Math.random()*t.length)],r=[{source:e.name,target:n.name,type:"static"}];this.projectGraphsResponse=Object.assign({},this.projectGraphsResponse,{projects:[...this.projectGraphsResponse.projects,e],dependencies:Object.assign({},this.projectGraphsResponse.dependencies,{[e.name]:r})})}}let oa;function aa(){return void 0===oa&&("dev"===window.environment||"nx-console"===window.environment?oa=new na:"watch"===window.environment?oa=new ia:"release"===window.environment&&(oa="build"===window.localMode?new ra:new na)),oa}const sa=function(){const e=Xt(),t=Gr(),n=yo(Eo),i=yo(_o),o=yo(ko),a=yo(jo),s=yo(Co),l=yo(So),c=yo(Po),u=t.getSnapshot().matches("tracing"),d=yo(To),h=aa(),f=ht(),p=Cr(),[v,g]=Bt(),m=wt("selectedWorkspace"),y=ht(),x=ut(),E=Qr();(0,r.useEffect)((()=>{t.send({type:"setProjects",projects:m.projects,dependencies:m.dependencies,affectedProjects:m.affected,workspaceLayout:m.layout})}),[m]),(0,r.useEffect)((()=>{switch(p.currentPath){case"/projects/all":t.send({type:"selectAll"});break;case"/projects/affected":t.send({type:"selectAffected"})}}),[p]),(0,r.useEffect)((()=>{f.focusedProject&&t.send({type:"focusProject",projectName:f.focusedProject}),f.startTrace&&t.send({type:"setTracingStart",projectName:f.startTrace}),f.endTrace&&t.send({type:"setTracingEnd",projectName:f.endTrace})}),[f]),(0,r.useEffect)((()=>{if(v.has("groupByFolder")&&!1===l?t.send({type:"setGroupByFolder",groupByFolder:!0}):v.has("groupByFolder")||!0!==l||t.send({type:"setGroupByFolder",groupByFolder:!1}),v.has("collapseEdges")&&!1===c?t.send({type:"setCollapseEdges",collapseEdges:!0}):v.has("collapseEdges")||!0!==c||t.send({type:"setCollapseEdges",collapseEdges:!1}),v.has("searchDepth")){const e=parseInt(v.get("searchDepth"),10);0===e&&!1!==i.searchDepthEnabled?t.send({type:"setSearchDepthEnabled",searchDepthEnabled:!1}):0!==e&&t.send({type:"setSearchDepth",searchDepth:e})}else!1!==i.searchDepthEnabled&&1===i.searchDepth||(t.send({type:"setSearchDepthEnabled",searchDepthEnabled:!0}),t.send({type:"setSearchDepth",searchDepth:1}));if(v.has("traceAlgorithm")){const e=v.get("traceAlgorithm");"shortest"!==e&&"all"!==e||t.send({type:"setTracingAlgorithm",algorithm:e})}else"shortest"!==d.algorithm&&t.send({type:"setTracingAlgorithm",algorithm:"shortest"})}),[v]),((e,t,n)=>{const i=(0,r.useRef)((()=>{}));(0,r.useEffect)((()=>{n&&(i.current=e)}),[e,n]),(0,r.useEffect)((()=>{if(n){const e=()=>{i.current()};if(null!==t){let n=setInterval(e,t);return()=>clearInterval(n)}}}),[t,n])})((()=>{var n;const r=null!=(n=y.selectedWorkspaceId)?n:e.appConfig.defaultWorkspaceId,i=e.appConfig.workspaces.find((e=>e.id===r));(async()=>{const e=await h.getProjectGraph(i.projectGraphUrl);t.send({type:"updateGraph",projects:e.projects,dependencies:e.dependencies})})()}),5e3,e.watch);const _=(0,r.useCallback)((e=>{t.send({type:"filterByText",search:e}),x(E("/projects",!0))}),[t]);return w(b.HY,{children:[n?w(Mo,{focusedLabel:n,resetFocus:function(){t.send({type:"unfocusProject"}),x(E("/projects",!0))}}):null,u?w(ta,{start:d.start,end:d.end,algorithm:d.algorithm,setAlgorithm:function(e){g((t=>(t.set("traceAlgorithm",e),t)))},resetStart:function(){t.send({type:"clearTraceStart"}),x(E("/projects",!0))},resetEnd:function(){t.send({type:"clearTraceEnd"}),x(E("/projects",!0))}}):null,w(Jo,{includePath:o,resetTextFilter:function(){t.send({type:"clearTextFilter"})},textFilter:a,toggleIncludeLibsInPathChange:function(){t.send({type:"setIncludeProjectsByPath",includeProjectsByPath:!o})},updateTextFilter:_}),w("div",{children:[w($o,{hideAll:function(){t.send({type:"deselectAll"}),x(E("/projects",!0))},showAll:function(){x(E("/projects/all",!0))},showAffected:function(){x(E("/projects/affected",!0))},hasAffected:s,label:"projects"}),w(Ro,{groupByFolder:l,groupByFolderChanged:function(e){g((t=>(e?t.set("groupByFolder","true"):t.delete("groupByFolder"),t)))}}),w(Yo,{searchDepth:i.searchDepth,searchDepthEnabled:i.searchDepthEnabled,searchDepthFilterEnabledChange:function(e){g((t=>(e&&i.searchDepth>1?t.set("searchDepth",i.searchDepth.toString()):e&&1===i.searchDepth?t.delete("searchDepth"):t.set("searchDepth","0"),t)))},incrementDepthFilter:function(){const e=i.searchDepth+1;g((t=>(1===e?t.delete("searchDepth"):t.set("searchDepth",e.toString()),t)))},decrementDepthFilter:function(){const e=1===i.searchDepth?1:i.searchDepth-1;g((t=>(1===e?t.delete("searchDepth"):t.set("searchDepth",e.toString()),t)))}}),w(Tr,{children:w("div",{className:"mx-4 mt-4 rounded-lg border-2 border-dashed border-purple-500 p-4 shadow-lg dark:border-purple-600 dark:bg-[#0B1221]",children:[w("h3",{className:"cursor-text px-4 py-2 text-sm font-semibold uppercase tracking-wide text-slate-800 dark:text-slate-200 lg:text-xs",children:"Experimental Features"}),w(Do,{collapseEdges:c,collapseEdgesChanged:function(e){g((t=>(e?t.set("collapseEdges","true"):t.delete("collapseEdges"),t)))}})]})})]}),"nx-console"!==e.environment?w(Ho,{}):null]})};function la({project:e,toggleTask:t}){return w("li",{className:"relative block cursor-default select-none pb-0 pl-2 pr-6 text-xs text-slate-600 dark:text-slate-400",children:[w("div",{className:"flex items-center",children:w("label",{className:"block w-full cursor-pointer truncate rounded-md p-2 font-mono font-normal transition hover:bg-slate-50 hover:dark:bg-slate-700","data-project":e.projectGraphNode.name,title:e.projectGraphNode.name,"data-active":e.isSelected.toString(),onClick:()=>t(e.projectGraphNode.name),children:e.projectGraphNode.name})}),e.isSelected?w("span",{title:"This task is visible",className:"absolute inset-y-0 right-0 flex cursor-pointer items-center text-blue-500 dark:text-sky-500",onClick:()=>t(e.projectGraphNode.name),children:w(Fo,{className:"h-5 w-5"})}):null]})}function ca({headerText:e="",projects:t,toggleTask:n}){let r=[...t];return r.sort(((e,t)=>e.projectGraphNode.name.localeCompare(t.projectGraphNode.name))),w(b.HY,{children:[""!==e?w("h3",{className:"mt-4 cursor-text py-2 text-sm font-semibold uppercase tracking-wide text-slate-800 dark:text-slate-200 lg:text-xs",children:e}):null,w("ul",{className:"mt-2 -ml-3",children:r.map((e=>w(la,{project:e,toggleTask:n},e.projectGraphNode.name)))})]})}function ua(e,t){return{projectGraphNode:e,isSelected:t.includes(e.name)}}const da=function({projects:e,workspaceLayout:t,selectedTarget:n,selectedProjects:r,toggleProject:i,children:o}){const a=e.filter((e=>e.data.targets.hasOwnProperty(n))).sort(((e,t)=>e.name.localeCompare(t.name))),s=ei("app",a),l=ei("lib",a),c=ei("e2e",a),u=ti(s,t),d=ti(l,t),h=ti(c,t),f=Object.keys(u).sort(),p=Object.keys(d).sort(),v=Object.keys(h).sort();return w("div",{id:"project-lists",className:"mt-8 border-t border-slate-400/10 px-4",children:[o,w("h2",{className:"mt-8 border-b border-solid border-slate-200/10 text-lg font-light text-slate-400 dark:text-slate-500",children:"app projects"}),f.map((e=>w(ca,{headerText:e,projects:u[e].map((e=>ua(e,r))),toggleTask:i},"app-"+e))),w("h2",{className:"mt-8 border-b border-solid border-slate-200/10 text-lg font-light text-slate-400 dark:text-slate-500",children:"e2e projects"}),v.map((e=>w(ca,{headerText:e,projects:h[e].map((e=>ua(e,r))),toggleTask:i},"e2e-"+e))),w("h2",{className:"mt-8 border-b border-solid border-slate-200/10 text-lg font-light text-slate-400 dark:text-slate-500",children:"lib projects"}),p.map((e=>w(ca,{headerText:e,projects:d[e].map((e=>ua(e,r))),toggleTask:i},"lib-"+e)))]})};const ha=function(){var e;const t=k(),n=ut(),i=ht(),[o,a]=Bt(),s="true"===o.get("groupByProject"),l=wt("selectedWorkspace"),c=l.layout,u=wt("selectedTarget"),{taskGraphs:d}=u,{projects:h,targets:f}=l,p=null!=(e=i.selectedTarget)?e:f[0],[v,g]=(0,r.useState)([]);function m(){g([]);const e=h.map((e=>`${e.name}:${p}`));t.handleTaskEvent({type:"notifyTaskGraphTasksDeselected",taskIds:e})}return(0,r.useEffect)((()=>{g([]),t.handleTaskEvent({type:"notifyTaskGraphSetProjects",projects:l.projects,taskGraphs:d})}),[l]),(0,r.useEffect)((()=>{s?t.handleTaskEvent({type:"setGroupByProject",groupByProject:!0}):t.handleTaskEvent({type:"setGroupByProject",groupByProject:!1})}),[o]),w(b.HY,{children:[w($o,{showAll:()=>function(){const e=h.filter((e=>e.data.targets.hasOwnProperty(p)));g(e.map((e=>e.name))),t.handleTaskEvent({type:"notifyTaskGraphTasksSelected",taskIds:e.map((e=>`${e.name}:${p}`))})}(),hideAll:()=>m(),showAffected:()=>{},hasAffected:!1,label:"tasks"}),w(Ao,{checked:s,checkChanged:function(e){a((t=>(e?t.set("groupByProject","true"):t.delete("groupByProject"),t)),{relative:"path"})},name:"groupByProject",label:"Group by project",description:"Visually arrange tasks by project."}),w(da,{projects:h,selectedProjects:v,workspaceLayout:c,selectedTarget:p,toggleProject:function(e){v.includes(e)?function(e){const n=v.filter((t=>t!==e));g(n);const r=`${e}:${p}`;t.handleTaskEvent({type:"notifyTaskGraphTasksDeselected",taskIds:[r]})}(e):function(e){g([...v,e]);const n=function(e,t,n){return n?`${e}:${t}:${n}`:`${e}:${t}`}(e,p);t.handleTaskEvent({type:"notifyTaskGraphTasksSelected",taskIds:[n]})}(e)},children:[w("label",{htmlFor:"selectedTarget",className:"my-2 block text-sm font-medium text-gray-700",children:"Target Name"}),w(Yt,{id:"selectedTarget",className:"w-full","data-cy":"selected-target-dropdown",defaultValue:p,onChange:e=>{var t;(t=e.currentTarget.value)!==p&&(m(),i.selectedTarget?n({pathname:`../${t}`,search:o.toString()}):n({pathname:`${t}`,search:o.toString()}))},children:f.map((e=>w("option",{value:e,children:e})))})]})]})},{appConfig:fa}=$t(),pa=aa();function va(){return"dev"===$t().environment?ya:ba}const ga=async e=>{const t=fa.workspaces.find((t=>t.id===e)),n=await pa.getProjectGraph(t.projectGraphUrl),r=new Set;n.projects.forEach((e=>{var t;Object.keys(null!=(t=e.data.targets)?t:{}).forEach((e=>{r.add(e)}))}));const i=Array.from(r).sort(((e,t)=>e.localeCompare(t)));return Object.assign({},n,{targets:i})},ma=[{path:"projects",children:[{index:!0,element:w(sa,{})},{path:"all",element:w(sa,{})},{path:"affected",element:w(sa,{})},{path:":focusedProject",element:w(sa,{})},{path:"trace/:startTrace",element:w(sa,{})},{path:"trace/:startTrace/:endTrace",element:w(sa,{})}]},{loader:async({request:e,params:t})=>{var n;return(async e=>{const t=fa.workspaces.find((t=>t.id===e));return await pa.getTaskGraph(t.taskGraphUrl)})(null!=(n=t.selectedWorkspaceId)?n:fa.defaultWorkspaceId)},path:"tasks",id:"selectedTarget",shouldRevalidate:({currentParams:e,nextParams:t})=>!e.selectedWorkspaceId||e.selectedWorkspaceId!==t.selectedWorkspaceId,children:[{index:!0,element:w(ha,{})},{path:":selectedTarget",element:w(ha,{})}]}],ya=[{path:"/",children:[{index:!0,loader:async({request:e,params:t})=>{const{search:n}=new URL(e.url);return fe(`/${fa.defaultWorkspaceId}/projects${n}`)}},{path:":selectedWorkspaceId",id:"selectedWorkspace",element:w(fo,{}),shouldRevalidate:({currentParams:e,nextParams:t})=>e.selectedWorkspaceId!==t.selectedWorkspaceId,loader:async({request:e,params:t})=>{var n;const r=null!=(n=t.selectedWorkspaceId)?n:fa.defaultWorkspaceId;return ga(r)},children:ma}]}],ba=[{path:"/",id:"selectedWorkspace",loader:async({request:e,params:t})=>{const n=fa.defaultWorkspaceId;return ga(n)},shouldRevalidate:()=>!1,element:w(fo,{}),children:[{index:!0,loader:({request:e})=>{const{search:t}=new URL(e.url);return fe(`/projects${t}`)}},...ma]}];var xa;T(null!=(xa=localStorage.getItem(P))?xa:"system"),function(){var e;M(null!=(e=localStorage.getItem(N))?e:"TB")}();let wa=function(e,t){var n,r;return be({basename:null==t?void 0:t.basename,history:(r={window:null==t?void 0:t.window},void 0===r&&(r={}),H((function(e,t){let{pathname:n,search:r,hash:i}=e.location;return F("",{pathname:n,search:r,hash:i},t.state&&t.state.usr||null,t.state&&t.state.key||"default")}),(function(e,t){return"string"==typeof t?t:z(t)}),null,r)),hydrationData:(null==t?void 0:t.hydrationData)||(null==(n=window)?void 0:n.__staticRouterHydrationData),routes:Dt(e)}).initialize()};"build"===$t().localMode&&(wa=function(e,t){var n,r;return be({basename:null==t?void 0:t.basename,history:(r={window:null==t?void 0:t.window},void 0===r&&(r={}),H((function(e,t){let{pathname:n="/",search:r="",hash:i=""}=V(e.location.hash.substr(1));return F("",{pathname:n,search:r,hash:i},t.state&&t.state.usr||null,t.state&&t.state.key||"default")}),(function(e,t){let n=e.document.querySelector("base"),r="";if(n&&n.getAttribute("href")){let t=e.location.href,n=t.indexOf("#");r=-1===n?t:t.slice(0,n)}return r+"#"+("string"==typeof t?t:z(t))}),(function(e,t){L("/"===e.pathname.charAt(0),"relative pathnames are not supported in hash history.push("+JSON.stringify(t)+")")}),r)),hydrationData:(null==t?void 0:t.hydrationData)||(null==(n=window)?void 0:n.__staticRouterHydrationData),routes:Dt(e)}).initialize()});const Ea=wa(va());const _a=function(){return w(Et,{router:Ea})};!0===window.useXstateInspect&&function(e){var t=function(e){var t=i(i({},m),e);return i(i({},t),{url:new URL(t.url),iframe:d(t.iframe),devTools:d(t.devTools)})}(e),n=t.iframe,r=t.url,c=t.devTools;if(null!==n){var u,f,g=function(e,t){void 0===e&&(e=globalThis.__xstate__);var n=new Map,r=e.onRegister((function(e){n.set(e.sessionId,e)}));return(0,s.C)({initial:"pendingConnection",context:{client:void 0},states:{pendingConnection:{},connected:{on:{"service.state":{actions:function(e,t){return e.client.send(t)}},"service.event":{actions:function(e,t){return e.client.send(t)}},"service.register":{actions:function(e,t){return e.client.send(t)}},"service.stop":{actions:function(e,t){return e.client.send(t)}},"xstate.event":{actions:function(e,t){var r=t.event,i=JSON.parse(r),o=n.get(i.origin);null==o||o.send(i)}},unload:{actions:function(e){e.client.send({type:"xstate.disconnect"})}},disconnect:"disconnected"}},disconnected:{entry:function(){r.unsubscribe()},type:"final"}},on:{"xstate.inspecting":{target:".connected",actions:[(0,l.assign)({client:function(e,t){return t.client}}),function(n){e.services.forEach((function(e){var r;null===(r=n.client)||void 0===r||r.send({type:"service.register",machine:v(e.machine,null==t?void 0:t.serialize),state:p(e.state||e.initialState,null==t?void 0:t.serialize),sessionId:e.sessionId})}))}]}}})}(c,e),b=(0,o.kJ)(g).start(),x=new Set,w=b.subscribe((function(e){x.forEach((function(t){return t.next(e)}))})),E=function(e){if("object"==typeof e.data&&null!==e.data&&"type"in e.data){n&&!u&&(u=n.contentWindow),f||(f={send:function(e){u.postMessage(e,r.origin)}});var t=i(i({},e.data),{client:f});b.send(t)}};window.addEventListener("message",E),window.addEventListener("unload",(function(){b.send({type:"unload"})}));var _=function(t){return h(t,null==e?void 0:e.serialize)};return c.onRegister((function(t){var n,r=t.state||t.initialState;if(b.send({type:"service.register",machine:v(t.machine,null==e?void 0:e.serialize),state:p(r,null==e?void 0:e.serialize),sessionId:t.sessionId,id:t.id,parent:null===(n=t.parent)||void 0===n?void 0:n.sessionId}),b.send({type:"service.event",event:_(r._event),sessionId:t.sessionId}),!y.has(t)){y.add(t);var i=t.send.bind(t);t.send=function(e,n){return b.send({type:"service.event",event:_((0,a.g5)((0,a._v)(e,n))),sessionId:t.sessionId}),i(e,n)}}t.subscribe((function(n){void 0!==n&&b.send({type:"service.state",state:p(n,null==e?void 0:e.serialize),sessionId:t.sessionId})})),t.onStop((function(){b.send({type:"service.stop",sessionId:t.sessionId})}))})),n?(n.addEventListener("load",(function(){u=n.contentWindow})),n.setAttribute("src",String(r))):u=window.open(String(r),"xstateinspector"),{send:function(e){b.send(e)},subscribe:function(e,t,n){var r=(0,a.zM)(e,t,n);return x.add(r),r.next(b.state),{unsubscribe:function(){x.delete(r)}}},disconnect:function(){b.send("disconnect"),window.removeEventListener("message",E),w.unsubscribe()}}}console.warn("No suitable <iframe> found to embed the inspector. Please pass an <iframe> element to `inspect(iframe)` or create an <iframe data-xstate></iframe> element.")}({url:"https://stately.ai/viz?inspect",iframe:!1}),window.externalApi=new class{constructor(){this.projectGraphService=Gr()}focusProject(e){this.projectGraphService.send({type:"focusProject",projectName:e})}enableExperimentalFeatures(){localStorage.setItem("showExperimentalFeatures","true"),window.appConfig.showExperimentalFeatures=!0}disableExperimentalFeatures(){localStorage.setItem("showExperimentalFeatures","false"),window.appConfig.showExperimentalFeatures=!1}},window.appConfig?r.render(w(r.StrictMode,{children:w(_a,{})}),document.getElementById("app")):r.render(w("p",{children:["No environment could be found. Please run"," ",w("pre",{children:"npx nx run graph-client:generate-dev-environment-js"}),"."]}),document.getElementById("app"))},19798:(e,t,n)=>{"use strict";n.r(t),n.d(t,{GraphService:()=>k});n(15735),n(6886),n(77950),n(94908);var r=n(93218),i=n.n(r),o=n(81368),a=n.n(o),s=n(10404),l=n.n(s);n(43430),n(43105),n(39529),n(31235),n(85940);let c;!function(e){e.blue_500="hsla(217, 91%, 60%, 1)",e.blue_600="hsla(221, 83%, 53%, 1)",e.sky_500="hsla(199, 89%, 48%, 1)",e.sky_600="hsla(200, 98%, 39%, 1)",e.pink_400="hsla(329, 86%, 70%, 1)",e.pink_500="hsla(330, 81%, 60%, 1)",e.fuchsia_500="hsla(292, 84%, 61%, 1)",e.fuchsia_600="hsla(293, 69%, 49%, 1)",e.fuchsia_700="hsla(295, 72%, 40%, 1)",e.fuchsia_800="hsla(295, 70%, 33%, 1)",e.slate_50="hsla(210, 40%, 98%, 1)",e.slate_100="hsla(210, 40%, 96%, 1)",e.slate_200="hsla(214, 32%, 91%, 1)",e.slate_300="hsla(213, 27%, 84%, 1)",e.slate_400="hsla(213, 27%, 84%, 1)",e.slate_500="hsla(215, 16%, 47%, 1)",e.slate_600="hsla(215, 19%, 35%, 1)",e.slate_700="hsla(215, 25%, 27%, 1)",e.slate_800="hsla(217, 33%, 17%, 1)",e.white="#fff"}(c||(c={}));const u="NX_GRAPH_DARK_MODE";function d(e,t,n){return function(e){return!0===e.scratch(u)}(e)?t:n}const h=[{selector:"edge",style:{width:"1px","line-color":e=>d(e,c.slate_400,c.slate_500),"text-outline-color":e=>d(e,c.slate_400,c.slate_500),"text-outline-width":"0px",color:e=>d(e,c.slate_400,c.slate_500),"curve-style":"unbundled-bezier","target-arrow-shape":"triangle","target-arrow-fill":"filled","target-arrow-color":e=>d(e,c.slate_400,c.slate_500)}},{selector:"edge.affected",style:{"line-color":e=>d(e,c.fuchsia_500,c.pink_500),"target-arrow-color":e=>d(e,c.fuchsia_500,c.pink_500),"curve-style":"unbundled-bezier"}},{selector:"edge.implicit",style:{label:"implicit","font-size":"16px","curve-style":"unbundled-bezier","text-rotation":"autorotate"}},{selector:"edge.dynamic",style:{"line-dash-pattern":[5,5],"line-style":"dashed","curve-style":"unbundled-bezier"}},{selector:"edge.transparent",style:{opacity:.2}}];const f=new class{constructor(){this.cache=new Map,this.ctx=void 0}calculateWidth(e){this.ctx||(this.ctx=document.createElement("canvas").getContext("2d"));const t=e.data("id"),n=e.style("font-style"),r=e.style("font-size"),i=e.style("font-family"),o=e.style("font-weight");this.ctx.font=n+" "+o+" "+r+" "+i;const a=this.cache.get(t);if(a)return a;{const n=this.ctx.measureText(e.data("id")).width;return this.cache.set(t,n),n}}},p=[{selector:"node",style:{"font-size":"32px","font-family":'system-ui, "Helvetica Neue", sans-serif',backgroundColor:e=>d(e,c.slate_600,c.slate_200),"border-style":"solid","border-color":e=>d(e,c.slate_700,c.slate_300),"border-width":"1px","text-halign":"center","text-valign":"center","padding-left":"16px",color:e=>d(e,c.slate_200,c.slate_600),label:"data(id)",width:e=>f.calculateWidth(e),"transition-property":"background-color, border-color, line-color, target-arrow-color","transition-duration":250,"transition-timing-function":"ease-out",shape:"round-rectangle"}},{selector:"node.focused",style:{color:c.white,"border-color":e=>d(e,c.slate_700,c.slate_200),backgroundColor:e=>d(e,c.sky_500,c.blue_500),width:e=>f.calculateWidth(e)}},{selector:"node.affected",style:{color:c.white,"border-color":e=>d(e,c.fuchsia_800,c.pink_500),backgroundColor:e=>d(e,c.fuchsia_700,c.pink_400)}},{selector:"node.parentNode",style:{"background-opacity":e=>d(e,.5,.8),backgroundColor:e=>d(e,c.slate_700,c.slate_50),"border-color":e=>d(e,c.slate_500,c.slate_400),"border-style":"dashed","border-width":2,label:"data(label)","text-halign":"center","text-valign":"top","font-weight":"bold","font-size":"48px"}},{selector:"node.highlight",style:{color:c.white,"border-color":e=>d(e,c.sky_600,c.blue_600),backgroundColor:e=>d(e,c.sky_500,c.blue_500)}},{selector:"node.transparent:childless",style:{opacity:.5}},{selector:"node.transparent:parent",style:{"text-opacity":.5,"background-opacity":.25,"border-opacity":.5}},{selector:"node.taskNode",style:{label:"data(label)"}}],v={name:"dagre",nodeDimensionsIncludeLabels:!0,rankSep:75,rankDir:"TB",edgeSep:50,ranker:"network-simplex"};class g{constructor(e,t,n,r="TB"){this.container=e,this.renderMode=n,this.cy=void 0,this.collapseEdges=!1,this._theme=void 0,this._rankDir="TB",this.listeners=new Map,this._theme=t,this._rankDir=r}set theme(e){this._theme=e,this.render()}set rankDir(e){this._rankDir=e,this.render()}get activeContainer(){return"string"==typeof this.container?document.getElementById(this.container):this.container}broadcast(e){this.listeners.forEach((t=>t(e)))}listen(e){const t=this.listeners.size+1;return this.listeners.set(t,e),()=>{this.listeners.delete(t)}}setElements(e){let t;this.cy&&(t=this.cy.nodes(".focused").first().id(),this.cy.destroy(),delete this.cy),this.cy=i()({headless:null===this.activeContainer,container:this.activeContainer,boxSelectionEnabled:!1,style:[...p,...h],panningEnabled:!0,userZoomingEnabled:"nx-docs"!==this.renderMode}),this.cy.add(e),t&&this.cy.$id(t).addClass("focused"),this.cy.on("zoom pan",(()=>{this.broadcast({type:"GraphRegenerated"})})),this.listenForProjectNodeClicks(),this.listenForEdgeNodeClicks(),this.listenForProjectNodeHovers(),this.listenForTaskNodeClicks()}render(){var e,t,n,r;if(this.cy){const e=this.cy.elements().sort(((e,t)=>e.id().localeCompare(t.id())));e.layout(Object.assign({},v,{rankDir:this._rankDir})).run(),this.collapseEdges&&(this.cy.remove(this.cy.edges()),e.edges().forEach((e=>{const t=e.source(),n=e.target();if(t.parent().first().id()===n.parent().first().id())this.cy.add(e);else{let r,i;const o=e.connectedNodes().commonAncestors();let a,s;if(o.length>0?(r=t.ancestors().filter((e=>!o.contains(e))),i=n.ancestors().filter((e=>!o.contains(e)))):(r=t.ancestors(),i=n.ancestors()),r.length>0&&0===i.length?(a=r.last().id(),s=n.id()):i.length>0&&0===r.length?(a=t.id(),s=i.last().id()):(a=r.last().id(),s=i.last().id()),void 0!==a&&void 0!==s){const e=`${a}|${s}`;if(0===this.cy.$id(e).length){const t={group:"edges",data:{id:e,source:a,target:s}};this.cy.add(t)}}else console.log(`Couldn't figure out how to draw edge ${e.id()}`),console.log("source ancestors",r.map((e=>e.id()))),console.log("target ancestors",i.map((e=>e.id())))}}))),"nx-console"===this.renderMode?this.cy.fit(this.cy.elements(),175).center().resize().panBy({x:150,y:0}):this.cy.fit(this.cy.elements(),25).center().resize(),this.cy.scratch(u,"dark"===this._theme),this.cy.elements().scratch(u,"dark"===this._theme),this.cy.mount(this.activeContainer)}return{numNodes:null!=(e=null==(t=this.cy)?void 0:t.nodes().length)?e:0,numEdges:null!=(n=null==(r=this.cy)?void 0:r.edges().length)?n:0}}listenForProjectNodeClicks(){this.cy.$("node.projectNode").on("click",(e=>{const t=e.target;let n=t.popperRef();this.broadcast({type:"ProjectNodeClick",ref:n,id:t.id(),data:{id:t.id(),type:t.data("type"),tags:t.data("tags")}})}))}listenForTaskNodeClicks(){this.cy.$("node.taskNode").on("click",(e=>{const t=e.target;let n=t.popperRef();this.broadcast({type:"TaskNodeClick",ref:n,id:t.id(),data:{id:t.id(),label:t.data("label"),executor:t.data("executor")}})}))}listenForEdgeNodeClicks(){this.cy.$("edge.projectEdge").on("click",(e=>{const t=e.target;let n=t.popperRef();this.broadcast({type:"EdgeClick",ref:n,id:t.id(),data:{type:t.data("type"),source:t.source().id(),target:t.target().id(),fileDependencies:t.source().data("files").filter((e=>e.deps&&e.deps.includes(t.target().id()))).map((e=>({fileName:e.file.replace(`${t.source().data("root")}/`,""),target:t.target().id()})))}})}))}listenForProjectNodeHovers(){this.cy.on("mouseover",(e=>{const t=e.target;t.isNode&&t.isNode()&&!t.isParent()&&(this.cy.elements().difference(t.outgoers().union(t.incomers())).not(t).addClass("transparent"),t.addClass("highlight").outgoers().union(t.incomers()).addClass("highlight"))})),this.cy.on("mouseout",(e=>{const t=e.target;t.isNode&&t.isNode()&&!t.isParent()&&(this.cy.elements().removeClass("transparent"),t.removeClass("highlight").outgoers().union(t.incomers()).removeClass("highlight"))}))}getImage(){const e=d(this.cy,"#0F172A","#FFFFFF");return this.cy.png({bg:e,full:!0})}setFocussedElement(e){this.cy.$id(e).addClass("focused")}clearFocussedElement(){var e;null==(e=this.cy)||e.nodes(".focused").removeClass("focused")}getCurrentlyShownProjectIds(){var e,t;return null!=(e=null==(t=this.cy)?void 0:t.nodes().map((e=>e.data("id"))))?e:[]}}class m{constructor(e,t){this.project=e,this.workspaceRoot=t,this.affected=!1,this.focused=!1}getCytoscapeNodeDef(e){return{group:"nodes",data:this.getData(e),classes:this.getClasses(),selectable:!1,grabbable:!1,pannable:!0}}getData(e){return{id:this.project.name,type:this.project.type,tags:this.project.data.tags,parent:e&&this.project.data.hasOwnProperty("root")?this.getParentId():null,files:this.project.data.files,root:this.project.data.root}}getClasses(){let e=`projectNode ${this.project.type}`;return this.affected&&(e+=" affected"),e}getParentId(){const e=this.getAncestors();return e.length>0?e[e.length-1].id:null}getAncestors(){if(!this.project.data.root)return[];return function(e,t){const n=e.replace(t,"").split("/").filter((e=>""!==e));return n.pop(),n}(this.project.data.root,this.workspaceRoot).map(((e,t,n)=>{const r=[...n].slice(0,t+1).join("/");return{label:r,id:`dir-${r}`,parentId:t>0?`dir-${[...n].slice(0,t).join("/")}`:null}}))}}class y{constructor(e){this.dep=e,this.affected=!1}getCytosacpeNodeDef(){var e;let t;return t={group:"edges",classes:"projectEdge",data:{id:`${this.dep.source}|${this.dep.target}`,source:this.dep.source,target:this.dep.target,type:this.dep.type}},t.classes+=null!=(e=` ${this.dep.type}`)?e:"",this.affected&&(t.classes+=" affected"),t}}class b{constructor(e){this.config=e}getCytoscapeNodeDef(){return{group:"nodes",classes:"parentNode",data:{id:this.config.id,parent:this.config.parentId,label:this.config.label,type:"dir"},selectable:!1,grabbable:!1,pannable:!0}}}class x{constructor(){this.cy=void 0}setShownProjects(e){let t=this.cy.collection();e.forEach((e=>{t=t.union(this.cy.$id(e))}));const n=t.ancestors(),r=t.union(n),i=r.edgesTo(r);return r.union(i)}showProjects(e,t){let n=this.cy.collection();e.forEach((e=>{n=n.union(this.cy.$id(e))})),t.forEach((e=>{n=n.union(this.cy.$id(e))}));const r=n.ancestors(),i=n.union(r),o=i.edgesTo(i);return i.union(o)}hideProjects(e,t){let n=this.cy.collection();t.forEach((e=>{n=n.union(this.cy.$id(e))}));let r=this.cy.collection();e.forEach((e=>{r=r.union(this.cy.$id(e))}));const i=n.difference(r).difference(r.ancestors()),o=i.ancestors();let a=i.union(o);const s=a.edgesTo(a);return a.union(s)}showAffectedProjects(){const e=this.cy.nodes(".affected"),t=e.ancestors(),n=e.union(t),r=n.edgesTo(n);return n.union(r)}focusProject(e,t=1){const n=this.cy.$id(e),r=this.includeProjectsByDepth(n,t),i=n.union(r),o=i.ancestors(),a=i.union(o),s=a.edgesTo(a);return a.union(s)}showAllProjects(){return this.cy.elements()}hideAllProjects(){return this.cy.collection()}filterProjectsByText(e,t,n=-1){if(""===e)return this.cy.collection();{const r=e.split(",");let i=this.cy.nodes().filter((e=>r.findIndex((t=>e.id().includes(t)))>-1));t&&(i=i.union(this.includeProjectsByDepth(i,n))),i=i.union(i.ancestors());const o=i.edgesTo(i);return i.union(o)}}traceProjects(e,t){const n=this.cy.elements().dijkstra({root:`[id = "${e}"]`,directed:!0}).pathTo(this.cy.$(`[id = "${t}"]`));return n.union(n.ancestors())}traceAllProjects(e,t){const n=[[this.cy.$id(e).nodes().first()]],r=[];let i=0;for(;n.length>0&&i<=1e3;){const e=n.pop(),o=e[e.length-1].outgoers("node");o.length>0&&o.forEach((i=>{const o=[...e,i];i.id()===t?r.push(o):n.push(o)})),i++}i>=1e3&&console.log("failsafe triggered!");let o=this.cy.collection();return r.forEach((e=>{for(let t=0;t<e.length;t++){o=o.union(e[t]);const n=t+1;n<e.length&&(o=o.union(e[t].edgesTo(e[n])))}})),o.union(o.ancestors())}includeProjectsByDepth(e,t=-1){let n,r;if(-1===t)n=e.predecessors();else{n=e.incomers();for(let e=1;e<t;e++)n=n.union(n.incomers())}if(-1===t)r=e.successors();else{r=e.outgoers();for(let e=1;e<t;e++)r=r.union(r.outgoers())}return e.union(n).union(r)}initGraph(e,t,n,r,i,o){this.generateCytoscapeLayout(e,t,n,r,i)}generateCytoscapeLayout(e,t,n,r,o){const a=this.createElements(e,t,n,r,o);this.cy=i()({headless:!0,elements:[...a],boxSelectionEnabled:!1})}createElements(e,t,n,r,i){let o=[];const a=e.map((e=>e.name)),s=[],l=[],c={};e.forEach((e=>{const o="app"===e.type||"e2e"===e.type?n.appsDir:n.libsDir,u=new m(e,o);if(u.affected=i.includes(e.name),s.push(u),r[e.name].forEach((e=>{if(a.includes(e.target)){const t=new y(e);l.push(t)}})),t){u.getAncestors().forEach((e=>c[e.id]=e))}}));const u=s.map((e=>e.getCytoscapeNodeDef(t))),d=l.map((e=>e.getCytosacpeNodeDef()));if(o=u.concat(d),t){o=Object.keys(c).map((e=>new b(c[e]).getCytoscapeNodeDef())).concat(o)}return o}}class w{constructor(e,t){this.task=e,this.project=t}getCytoscapeNodeDef(e){return{group:"nodes",classes:"taskNode",data:this.getData(e),selectable:!1,grabbable:!1,pannable:!0}}getData(e){const t=e?this.task.id.split(":").slice(1).join(":"):this.task.id;return{id:this.task.id,label:t,executor:this.project.data.targets[this.task.target.target].executor,parent:e?this.task.target.project:null}}}class E{constructor(e,t){this.source=e,this.target=t}getCytoscapeNodeDef(){let e;return e={group:"edges",data:{id:`${this.source}|${this.target}`,source:this.source,target:this.target}},e}}class _{constructor(){this.projects=[],this.taskGraphs={},this.cy=void 0,this.groupByProject=!1,this.selectedTasks=new Set}setProjects(e,t){this.selectedTasks.clear(),this.projects=e,this.taskGraphs=t}selectTask(e){return e.forEach((e=>{this.selectedTasks.add(e)})),this.createElements(Array.from(this.selectedTasks),this.groupByProject),this.cy.elements()}setGroupByProject(e){return this.groupByProject=e,this.selectedTasks.size>0?this.createElements(Array.from(this.selectedTasks),e):this.cy=i()({headless:!0,elements:[]}),this.cy.elements()}deselectTask(e){return e.forEach((e=>{this.selectedTasks.delete(e)})),this.createElements(Array.from(this.selectedTasks),this.groupByProject),this.cy.elements()}createElements(e,t){const n=[];e.forEach((e=>{const r=this.taskGraphs[e];if(void 0===r)throw new Error(`Could not find task graph for ${e}`);const i={};for(let o in r.tasks){const e=r.tasks[o],a=this.projects.find((t=>t.name===e.target.project));if(void 0===a)throw new Error(`Could not find project ${a.name}`);n.push(new w(r.tasks[o],a)),t&&(i[a.name]={id:a.name,parentId:null,label:a.name})}for(let t in i)n.push(new b(i[t]));for(let t in r.dependencies)r.dependencies[t].forEach((e=>n.push(new E(t,e))))})),this.cy=i()({headless:!0,elements:n.map((e=>e.getCytoscapeNodeDef(t))),boxSelectionEnabled:!1})}}class k{constructor(e,t,n,i="TB"){this.projectTraversalGraph=void 0,this.taskTraversalGraph=void 0,this.renderGraph=void 0,this.lastPerformanceReport={numEdges:0,numNodes:0,renderTime:0},this.listeners=new Map,(0,r.use)(a()),(0,r.use)(l()),this.renderGraph=new g(e,t,n,i),this.renderGraph.listen((e=>this.broadcast(e))),this.projectTraversalGraph=new x,this.taskTraversalGraph=new _}set theme(e){this.renderGraph.theme=e}set rankDir(e){this.renderGraph.rankDir=e}listen(e){const t=this.listeners.size+1;return this.listeners.set(t,e),()=>{this.listeners.delete(t)}}broadcast(e){this.listeners.forEach((t=>t(e)))}handleProjectEvent(e){const t=Date.now();let n;switch("notifyGraphUpdateGraph"!==e.type&&this.renderGraph.clearFocussedElement(),e.type){case"notifyGraphInitGraph":this.renderGraph.collapseEdges=e.collapseEdges,this.broadcast({type:"GraphRegenerated"}),this.projectTraversalGraph.initGraph(e.projects,e.groupByFolder,e.workspaceLayout,e.dependencies,e.affectedProjects,e.collapseEdges);break;case"notifyGraphUpdateGraph":this.renderGraph.collapseEdges=e.collapseEdges,this.broadcast({type:"GraphRegenerated"}),this.projectTraversalGraph.initGraph(e.projects,e.groupByFolder,e.workspaceLayout,e.dependencies,e.affectedProjects,e.collapseEdges),n=this.projectTraversalGraph.setShownProjects(e.selectedProjects.length>0?e.selectedProjects:this.renderGraph.getCurrentlyShownProjectIds());break;case"notifyGraphFocusProject":n=this.projectTraversalGraph.focusProject(e.projectName,e.searchDepth);break;case"notifyGraphFilterProjectsByText":n=this.projectTraversalGraph.filterProjectsByText(e.search,e.includeProjectsByPath,e.searchDepth);break;case"notifyGraphShowProjects":n=this.projectTraversalGraph.showProjects(e.projectNames,this.renderGraph.getCurrentlyShownProjectIds());break;case"notifyGraphHideProjects":n=this.projectTraversalGraph.hideProjects(e.projectNames,this.renderGraph.getCurrentlyShownProjectIds());break;case"notifyGraphShowAllProjects":n=this.projectTraversalGraph.showAllProjects();break;case"notifyGraphHideAllProjects":n=this.projectTraversalGraph.hideAllProjects();break;case"notifyGraphShowAffectedProjects":n=this.projectTraversalGraph.showAffectedProjects();break;case"notifyGraphTracing":e.start&&e.end&&(n="shortest"===e.algorithm?this.projectTraversalGraph.traceProjects(e.start,e.end):this.projectTraversalGraph.traceAllProjects(e.start,e.end))}let r=[],i={numEdges:0,numNodes:0,renderTime:0};if(this.renderGraph)if(n){var o;this.renderGraph.setElements(n),"notifyGraphFocusProject"===e.type&&this.renderGraph.setFocussedElement(e.projectName);const{numEdges:a,numNodes:s}=this.renderGraph.render();r=(null!=(o=n.nodes('[type!="dir"]'))?o:[]).map((e=>e.id()));i={renderTime:Date.now()-t,numNodes:s,numEdges:a}}else{const{numEdges:e,numNodes:n}=this.renderGraph.render();this.renderGraph.getCurrentlyShownProjectIds();i={renderTime:Date.now()-t,numNodes:n,numEdges:e}}return this.lastPerformanceReport=i,this.broadcast({type:"GraphRegenerated"}),{selectedProjectNames:r,perfReport:i}}handleTaskEvent(e){const t=Date.now();let n;switch(this.broadcast({type:"GraphRegenerated"}),e.type){case"notifyTaskGraphSetProjects":this.taskTraversalGraph.setProjects(e.projects,e.taskGraphs);break;case"notifyTaskGraphTasksSelected":n=this.taskTraversalGraph.selectTask(e.taskIds);break;case"notifyTaskGraphTasksDeselected":n=this.taskTraversalGraph.deselectTask(e.taskIds);break;case"setGroupByProject":n=this.taskTraversalGraph.setGroupByProject(e.groupByProject)}let r=[],i={numEdges:0,numNodes:0,renderTime:0};if(this.renderGraph&&n){var o;this.renderGraph.setElements(n);const{numEdges:e,numNodes:a}=this.renderGraph.render();r=(null!=(o=n.nodes('[type!="dir"]'))?o:[]).map((e=>e.id()));i={renderTime:Date.now()-t,numNodes:a,numEdges:e}}return this.lastPerformanceReport=i,this.broadcast({type:"GraphRegenerated"}),{selectedProjectNames:r,perfReport:i}}getImage(){return this.renderGraph.getImage()}}},52749:(e,t,n)=>{"use strict";n.r(t),n.d(t,{afterMain:()=>E,afterRead:()=>b,afterWrite:()=>S,applyStyles:()=>O,arrow:()=>Q,auto:()=>s,basePlacements:()=>l,beforeMain:()=>x,beforeRead:()=>m,beforeWrite:()=>_,bottom:()=>i,clippingParents:()=>d,computeStyles:()=>ne,createPopper:()=>Oe,createPopperBase:()=>Ne,createPopperLite:()=>Me,detectOverflow:()=>ye,end:()=>u,eventListeners:()=>ie,flip:()=>be,hide:()=>Ee,left:()=>a,main:()=>w,modifierPhases:()=>P,offset:()=>_e,placements:()=>g,popper:()=>f,popperGenerator:()=>De,popperOffsets:()=>ke,preventOverflow:()=>Se,read:()=>y,reference:()=>p,right:()=>o,start:()=>c,top:()=>r,variationPlacements:()=>v,viewport:()=>h,write:()=>k});var r="top",i="bottom",o="right",a="left",s="auto",l=[r,i,o,a],c="start",u="end",d="clippingParents",h="viewport",f="popper",p="reference",v=l.reduce((function(e,t){return e.concat([t+"-"+c,t+"-"+u])}),[]),g=[].concat(l,[s]).reduce((function(e,t){return e.concat([t,t+"-"+c,t+"-"+u])}),[]),m="beforeRead",y="read",b="afterRead",x="beforeMain",w="main",E="afterMain",_="beforeWrite",k="write",S="afterWrite",P=[m,y,b,x,w,E,_,k,S];function j(e){return e?(e.nodeName||"").toLowerCase():null}function C(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function T(e){return e instanceof C(e).Element||e instanceof Element}function D(e){return e instanceof C(e).HTMLElement||e instanceof HTMLElement}function N(e){return"undefined"!=typeof ShadowRoot&&(e instanceof C(e).ShadowRoot||e instanceof ShadowRoot)}const O={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var n=t.styles[e]||{},r=t.attributes[e]||{},i=t.elements[e];D(i)&&j(i)&&(Object.assign(i.style,n),Object.keys(r).forEach((function(e){var t=r[e];!1===t?i.removeAttribute(e):i.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach((function(e){var r=t.elements[e],i=t.attributes[e]||{},o=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{});D(r)&&j(r)&&(Object.assign(r.style,o),Object.keys(i).forEach((function(e){r.removeAttribute(e)})))}))}},requires:["computeStyles"]};function M(e){return e.split("-")[0]}var A=Math.max,R=Math.min,I=Math.round;function L(){var e=navigator.userAgentData;return null!=e&&e.brands?e.brands.map((function(e){return e.brand+"/"+e.version})).join(" "):navigator.userAgent}function B(){return!/^((?!chrome|android).)*safari/i.test(L())}function F(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var r=e.getBoundingClientRect(),i=1,o=1;t&&D(e)&&(i=e.offsetWidth>0&&I(r.width)/e.offsetWidth||1,o=e.offsetHeight>0&&I(r.height)/e.offsetHeight||1);var a=(T(e)?C(e):window).visualViewport,s=!B()&&n,l=(r.left+(s&&a?a.offsetLeft:0))/i,c=(r.top+(s&&a?a.offsetTop:0))/o,u=r.width/i,d=r.height/o;return{width:u,height:d,top:c,right:l+u,bottom:c+d,left:l,x:l,y:c}}function z(e){var t=F(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function V(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&N(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function G(e){return C(e).getComputedStyle(e)}function H(e){return["table","td","th"].indexOf(j(e))>=0}function W(e){return((T(e)?e.ownerDocument:e.document)||window.document).documentElement}function q(e){return"html"===j(e)?e:e.assignedSlot||e.parentNode||(N(e)?e.host:null)||W(e)}function Y(e){return D(e)&&"fixed"!==G(e).position?e.offsetParent:null}function U(e){for(var t=C(e),n=Y(e);n&&H(n)&&"static"===G(n).position;)n=Y(n);return n&&("html"===j(n)||"body"===j(n)&&"static"===G(n).position)?t:n||function(e){var t=/firefox/i.test(L());if(/Trident/i.test(L())&&D(e)&&"fixed"===G(e).position)return null;var n=q(e);for(N(n)&&(n=n.host);D(n)&&["html","body"].indexOf(j(n))<0;){var r=G(n);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||t&&"filter"===r.willChange||t&&r.filter&&"none"!==r.filter)return n;n=n.parentNode}return null}(e)||t}function X(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function $(e,t,n){return A(e,R(t,n))}function K(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function Z(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}const Q={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,s=e.name,c=e.options,u=n.elements.arrow,d=n.modifiersData.popperOffsets,h=M(n.placement),f=X(h),p=[a,o].indexOf(h)>=0?"height":"width";if(u&&d){var v=function(e,t){return K("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:Z(e,l))}(c.padding,n),g=z(u),m="y"===f?r:a,y="y"===f?i:o,b=n.rects.reference[p]+n.rects.reference[f]-d[f]-n.rects.popper[p],x=d[f]-n.rects.reference[f],w=U(u),E=w?"y"===f?w.clientHeight||0:w.clientWidth||0:0,_=b/2-x/2,k=v[m],S=E-g[p]-v[y],P=E/2-g[p]/2+_,j=$(k,P,S),C=f;n.modifiersData[s]=((t={})[C]=j,t.centerOffset=j-P,t)}},effect:function(e){var t=e.state,n=e.options.element,r=void 0===n?"[data-popper-arrow]":n;null!=r&&("string"!=typeof r||(r=t.elements.popper.querySelector(r)))&&V(t.elements.popper,r)&&(t.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function J(e){return e.split("-")[1]}var ee={top:"auto",right:"auto",bottom:"auto",left:"auto"};function te(e){var t,n=e.popper,s=e.popperRect,l=e.placement,c=e.variation,d=e.offsets,h=e.position,f=e.gpuAcceleration,p=e.adaptive,v=e.roundOffsets,g=e.isFixed,m=d.x,y=void 0===m?0:m,b=d.y,x=void 0===b?0:b,w="function"==typeof v?v({x:y,y:x}):{x:y,y:x};y=w.x,x=w.y;var E=d.hasOwnProperty("x"),_=d.hasOwnProperty("y"),k=a,S=r,P=window;if(p){var j=U(n),T="clientHeight",D="clientWidth";if(j===C(n)&&"static"!==G(j=W(n)).position&&"absolute"===h&&(T="scrollHeight",D="scrollWidth"),l===r||(l===a||l===o)&&c===u)S=i,x-=(g&&j===P&&P.visualViewport?P.visualViewport.height:j[T])-s.height,x*=f?1:-1;if(l===a||(l===r||l===i)&&c===u)k=o,y-=(g&&j===P&&P.visualViewport?P.visualViewport.width:j[D])-s.width,y*=f?1:-1}var N,O=Object.assign({position:h},p&&ee),M=!0===v?function(e){var t=e.x,n=e.y,r=window.devicePixelRatio||1;return{x:I(t*r)/r||0,y:I(n*r)/r||0}}({x:y,y:x}):{x:y,y:x};return y=M.x,x=M.y,f?Object.assign({},O,((N={})[S]=_?"0":"",N[k]=E?"0":"",N.transform=(P.devicePixelRatio||1)<=1?"translate("+y+"px, "+x+"px)":"translate3d("+y+"px, "+x+"px, 0)",N)):Object.assign({},O,((t={})[S]=_?x+"px":"",t[k]=E?y+"px":"",t.transform="",t))}const ne={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=void 0===r||r,o=n.adaptive,a=void 0===o||o,s=n.roundOffsets,l=void 0===s||s,c={placement:M(t.placement),variation:J(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,te(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:l})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,te(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}};var re={passive:!0};const ie={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,n=e.instance,r=e.options,i=r.scroll,o=void 0===i||i,a=r.resize,s=void 0===a||a,l=C(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&c.forEach((function(e){e.addEventListener("scroll",n.update,re)})),s&&l.addEventListener("resize",n.update,re),function(){o&&c.forEach((function(e){e.removeEventListener("scroll",n.update,re)})),s&&l.removeEventListener("resize",n.update,re)}},data:{}};var oe={left:"right",right:"left",bottom:"top",top:"bottom"};function ae(e){return e.replace(/left|right|bottom|top/g,(function(e){return oe[e]}))}var se={start:"end",end:"start"};function le(e){return e.replace(/start|end/g,(function(e){return se[e]}))}function ce(e){var t=C(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function ue(e){return F(W(e)).left+ce(e).scrollLeft}function de(e){var t=G(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function he(e){return["html","body","#document"].indexOf(j(e))>=0?e.ownerDocument.body:D(e)&&de(e)?e:he(q(e))}function fe(e,t){var n;void 0===t&&(t=[]);var r=he(e),i=r===(null==(n=e.ownerDocument)?void 0:n.body),o=C(r),a=i?[o].concat(o.visualViewport||[],de(r)?r:[]):r,s=t.concat(a);return i?s:s.concat(fe(q(a)))}function pe(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function ve(e,t,n){return t===h?pe(function(e,t){var n=C(e),r=W(e),i=n.visualViewport,o=r.clientWidth,a=r.clientHeight,s=0,l=0;if(i){o=i.width,a=i.height;var c=B();(c||!c&&"fixed"===t)&&(s=i.offsetLeft,l=i.offsetTop)}return{width:o,height:a,x:s+ue(e),y:l}}(e,n)):T(t)?function(e,t){var n=F(e,!1,"fixed"===t);return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}(t,n):pe(function(e){var t,n=W(e),r=ce(e),i=null==(t=e.ownerDocument)?void 0:t.body,o=A(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=A(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),s=-r.scrollLeft+ue(e),l=-r.scrollTop;return"rtl"===G(i||n).direction&&(s+=A(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:s,y:l}}(W(e)))}function ge(e,t,n,r){var i="clippingParents"===t?function(e){var t=fe(q(e)),n=["absolute","fixed"].indexOf(G(e).position)>=0&&D(e)?U(e):e;return T(n)?t.filter((function(e){return T(e)&&V(e,n)&&"body"!==j(e)})):[]}(e):[].concat(t),o=[].concat(i,[n]),a=o[0],s=o.reduce((function(t,n){var i=ve(e,n,r);return t.top=A(i.top,t.top),t.right=R(i.right,t.right),t.bottom=R(i.bottom,t.bottom),t.left=A(i.left,t.left),t}),ve(e,a,r));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function me(e){var t,n=e.reference,s=e.element,l=e.placement,d=l?M(l):null,h=l?J(l):null,f=n.x+n.width/2-s.width/2,p=n.y+n.height/2-s.height/2;switch(d){case r:t={x:f,y:n.y-s.height};break;case i:t={x:f,y:n.y+n.height};break;case o:t={x:n.x+n.width,y:p};break;case a:t={x:n.x-s.width,y:p};break;default:t={x:n.x,y:n.y}}var v=d?X(d):null;if(null!=v){var g="y"===v?"height":"width";switch(h){case c:t[v]=t[v]-(n[g]/2-s[g]/2);break;case u:t[v]=t[v]+(n[g]/2-s[g]/2)}}return t}function ye(e,t){void 0===t&&(t={});var n=t,a=n.placement,s=void 0===a?e.placement:a,c=n.strategy,u=void 0===c?e.strategy:c,v=n.boundary,g=void 0===v?d:v,m=n.rootBoundary,y=void 0===m?h:m,b=n.elementContext,x=void 0===b?f:b,w=n.altBoundary,E=void 0!==w&&w,_=n.padding,k=void 0===_?0:_,S=K("number"!=typeof k?k:Z(k,l)),P=x===f?p:f,j=e.rects.popper,C=e.elements[E?P:x],D=ge(T(C)?C:C.contextElement||W(e.elements.popper),g,y,u),N=F(e.elements.reference),O=me({reference:N,element:j,strategy:"absolute",placement:s}),M=pe(Object.assign({},j,O)),A=x===f?M:N,R={top:D.top-A.top+S.top,bottom:A.bottom-D.bottom+S.bottom,left:D.left-A.left+S.left,right:A.right-D.right+S.right},I=e.modifiersData.offset;if(x===f&&I){var L=I[s];Object.keys(R).forEach((function(e){var t=[o,i].indexOf(e)>=0?1:-1,n=[r,i].indexOf(e)>=0?"y":"x";R[e]+=L[n]*t}))}return R}const be={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,u=e.name;if(!t.modifiersData[u]._skip){for(var d=n.mainAxis,h=void 0===d||d,f=n.altAxis,p=void 0===f||f,m=n.fallbackPlacements,y=n.padding,b=n.boundary,x=n.rootBoundary,w=n.altBoundary,E=n.flipVariations,_=void 0===E||E,k=n.allowedAutoPlacements,S=t.options.placement,P=M(S),j=m||(P===S||!_?[ae(S)]:function(e){if(M(e)===s)return[];var t=ae(e);return[le(e),t,le(t)]}(S)),C=[S].concat(j).reduce((function(e,n){return e.concat(M(n)===s?function(e,t){void 0===t&&(t={});var n=t,r=n.placement,i=n.boundary,o=n.rootBoundary,a=n.padding,s=n.flipVariations,c=n.allowedAutoPlacements,u=void 0===c?g:c,d=J(r),h=d?s?v:v.filter((function(e){return J(e)===d})):l,f=h.filter((function(e){return u.indexOf(e)>=0}));0===f.length&&(f=h);var p=f.reduce((function(t,n){return t[n]=ye(e,{placement:n,boundary:i,rootBoundary:o,padding:a})[M(n)],t}),{});return Object.keys(p).sort((function(e,t){return p[e]-p[t]}))}(t,{placement:n,boundary:b,rootBoundary:x,padding:y,flipVariations:_,allowedAutoPlacements:k}):n)}),[]),T=t.rects.reference,D=t.rects.popper,N=new Map,O=!0,A=C[0],R=0;R<C.length;R++){var I=C[R],L=M(I),B=J(I)===c,F=[r,i].indexOf(L)>=0,z=F?"width":"height",V=ye(t,{placement:I,boundary:b,rootBoundary:x,altBoundary:w,padding:y}),G=F?B?o:a:B?i:r;T[z]>D[z]&&(G=ae(G));var H=ae(G),W=[];if(h&&W.push(V[L]<=0),p&&W.push(V[G]<=0,V[H]<=0),W.every((function(e){return e}))){A=I,O=!1;break}N.set(I,W)}if(O)for(var q=function(e){var t=C.find((function(t){var n=N.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return A=t,"break"},Y=_?3:1;Y>0;Y--){if("break"===q(Y))break}t.placement!==A&&(t.modifiersData[u]._skip=!0,t.placement=A,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function xe(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function we(e){return[r,o,i,a].some((function(t){return e[t]>=0}))}const Ee={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,o=t.modifiersData.preventOverflow,a=ye(t,{elementContext:"reference"}),s=ye(t,{altBoundary:!0}),l=xe(a,r),c=xe(s,i,o),u=we(l),d=we(c);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}};const _e={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,i=e.name,s=n.offset,l=void 0===s?[0,0]:s,c=g.reduce((function(e,n){return e[n]=function(e,t,n){var i=M(e),s=[a,r].indexOf(i)>=0?-1:1,l="function"==typeof n?n(Object.assign({},t,{placement:e})):n,c=l[0],u=l[1];return c=c||0,u=(u||0)*s,[a,o].indexOf(i)>=0?{x:u,y:c}:{x:c,y:u}}(n,t.rects,l),e}),{}),u=c[t.placement],d=u.x,h=u.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=d,t.modifiersData.popperOffsets.y+=h),t.modifiersData[i]=c}};const ke={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=me({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}};const Se={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,s=e.name,l=n.mainAxis,u=void 0===l||l,d=n.altAxis,h=void 0!==d&&d,f=n.boundary,p=n.rootBoundary,v=n.altBoundary,g=n.padding,m=n.tether,y=void 0===m||m,b=n.tetherOffset,x=void 0===b?0:b,w=ye(t,{boundary:f,rootBoundary:p,padding:g,altBoundary:v}),E=M(t.placement),_=J(t.placement),k=!_,S=X(E),P="x"===S?"y":"x",j=t.modifiersData.popperOffsets,C=t.rects.reference,T=t.rects.popper,D="function"==typeof x?x(Object.assign({},t.rects,{placement:t.placement})):x,N="number"==typeof D?{mainAxis:D,altAxis:D}:Object.assign({mainAxis:0,altAxis:0},D),O=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,I={x:0,y:0};if(j){if(u){var L,B="y"===S?r:a,F="y"===S?i:o,V="y"===S?"height":"width",G=j[S],H=G+w[B],W=G-w[F],q=y?-T[V]/2:0,Y=_===c?C[V]:T[V],K=_===c?-T[V]:-C[V],Z=t.elements.arrow,Q=y&&Z?z(Z):{width:0,height:0},ee=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},te=ee[B],ne=ee[F],re=$(0,C[V],Q[V]),ie=k?C[V]/2-q-re-te-N.mainAxis:Y-re-te-N.mainAxis,oe=k?-C[V]/2+q+re+ne+N.mainAxis:K+re+ne+N.mainAxis,ae=t.elements.arrow&&U(t.elements.arrow),se=ae?"y"===S?ae.clientTop||0:ae.clientLeft||0:0,le=null!=(L=null==O?void 0:O[S])?L:0,ce=G+oe-le,ue=$(y?R(H,G+ie-le-se):H,G,y?A(W,ce):W);j[S]=ue,I[S]=ue-G}if(h){var de,he="x"===S?r:a,fe="x"===S?i:o,pe=j[P],ve="y"===P?"height":"width",ge=pe+w[he],me=pe-w[fe],be=-1!==[r,a].indexOf(E),xe=null!=(de=null==O?void 0:O[P])?de:0,we=be?ge:pe-C[ve]-T[ve]-xe+N.altAxis,Ee=be?pe+C[ve]+T[ve]-xe-N.altAxis:me,_e=y&&be?function(e,t,n){var r=$(e,t,n);return r>n?n:r}(we,pe,Ee):$(y?we:ge,pe,y?Ee:me);j[P]=_e,I[P]=_e-pe}t.modifiersData[s]=I}},requiresIfExists:["offset"]};function Pe(e,t,n){void 0===n&&(n=!1);var r,i,o=D(t),a=D(t)&&function(e){var t=e.getBoundingClientRect(),n=I(t.width)/e.offsetWidth||1,r=I(t.height)/e.offsetHeight||1;return 1!==n||1!==r}(t),s=W(t),l=F(e,a,n),c={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(o||!o&&!n)&&(("body"!==j(t)||de(s))&&(c=(r=t)!==C(r)&&D(r)?{scrollLeft:(i=r).scrollLeft,scrollTop:i.scrollTop}:ce(r)),D(t)?((u=F(t,!0)).x+=t.clientLeft,u.y+=t.clientTop):s&&(u.x=ue(s))),{x:l.left+c.scrollLeft-u.x,y:l.top+c.scrollTop-u.y,width:l.width,height:l.height}}function je(e){var t=new Map,n=new Set,r=[];function i(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var r=t.get(e);r&&i(r)}})),r.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||i(e)})),r}var Ce={placement:"bottom",modifiers:[],strategy:"absolute"};function Te(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some((function(e){return!(e&&"function"==typeof e.getBoundingClientRect)}))}function De(e){void 0===e&&(e={});var t=e,n=t.defaultModifiers,r=void 0===n?[]:n,i=t.defaultOptions,o=void 0===i?Ce:i;return function(e,t,n){void 0===n&&(n=o);var i,a,s={placement:"bottom",orderedModifiers:[],options:Object.assign({},Ce,o),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},l=[],c=!1,u={state:s,setOptions:function(n){var i="function"==typeof n?n(s.options):n;d(),s.options=Object.assign({},o,s.options,i),s.scrollParents={reference:T(e)?fe(e):e.contextElement?fe(e.contextElement):[],popper:fe(t)};var a=function(e){var t=je(e);return P.reduce((function(e,n){return e.concat(t.filter((function(e){return e.phase===n})))}),[])}(function(e){var t=e.reduce((function(e,t){var n=e[t.name];return e[t.name]=n?Object.assign({},n,t,{options:Object.assign({},n.options,t.options),data:Object.assign({},n.data,t.data)}):t,e}),{});return Object.keys(t).map((function(e){return t[e]}))}([].concat(r,s.options.modifiers)));return s.orderedModifiers=a.filter((function(e){return e.enabled})),s.orderedModifiers.forEach((function(e){var t=e.name,n=e.options,r=void 0===n?{}:n,i=e.effect;if("function"==typeof i){var o=i({state:s,name:t,instance:u,options:r}),a=function(){};l.push(o||a)}})),u.update()},forceUpdate:function(){if(!c){var e=s.elements,t=e.reference,n=e.popper;if(Te(t,n)){s.rects={reference:Pe(t,U(n),"fixed"===s.options.strategy),popper:z(n)},s.reset=!1,s.placement=s.options.placement,s.orderedModifiers.forEach((function(e){return s.modifiersData[e.name]=Object.assign({},e.data)}));for(var r=0;r<s.orderedModifiers.length;r++)if(!0!==s.reset){var i=s.orderedModifiers[r],o=i.fn,a=i.options,l=void 0===a?{}:a,d=i.name;"function"==typeof o&&(s=o({state:s,options:l,name:d,instance:u})||s)}else s.reset=!1,r=-1}}},update:(i=function(){return new Promise((function(e){u.forceUpdate(),e(s)}))},function(){return a||(a=new Promise((function(e){Promise.resolve().then((function(){a=void 0,e(i())}))}))),a}),destroy:function(){d(),c=!0}};if(!Te(e,t))return u;function d(){l.forEach((function(e){return e()})),l=[]}return u.setOptions(n).then((function(e){!c&&n.onFirstUpdate&&n.onFirstUpdate(e)})),u}}var Ne=De(),Oe=De({defaultModifiers:[ie,ke,ne,O,_e,be,Se,Q,Ee]}),Me=De({defaultModifiers:[ie,ke,ne,O]})},36021:(e,t,n)=>{"use strict";t.f0=void 0;var r=n(64223),i=n(30412);function o(e){return(0,r.assign)((function(t,n,r){return(0,i.produce)(t,(function(t){e(t,n,r)}))}))}t.f0=o},72779:(e,t)=>{var n;!function(){"use strict";var r={}.hasOwnProperty;function i(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var o=typeof n;if("string"===o||"number"===o)e.push(n);else if(Array.isArray(n)){if(n.length){var a=i.apply(null,n);a&&e.push(a)}}else if("object"===o){if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]")){e.push(n.toString());continue}for(var s in n)r.call(n,s)&&n[s]&&e.push(s)}}}return e.join(" ")}e.exports?(i.default=i,e.exports=i):void 0===(n=(function(){return i}).apply(t,[]))||(e.exports=n)}()},77111:(e,t,n)=>{var r=n(26733),i=n(59821),o=TypeError;e.exports=function(e){if(r(e))return e;throw o(i(e)+" is not a function")}},57988:(e,t,n)=>{var r=n(82359),i=n(59821),o=TypeError;e.exports=function(e){if(r(e))return e;throw o(i(e)+" is not a constructor")}},88505:(e,t,n)=>{var r=n(26733),i=String,o=TypeError;e.exports=function(e){if("object"==typeof e||r(e))return e;throw o("Can't set "+i(e)+" as a prototype")}},9736:(e,t,n)=>{var r=n(70095),i=n(22391),o=n(31787).f,a=r("unscopables"),s=Array.prototype;null==s[a]&&o(s,a,{configurable:!0,value:i(null)}),e.exports=function(e){s[a][e]=!0}},36637:(e,t,n)=>{"use strict";var r=n(30966).charAt;e.exports=function(e,t,n){return t+(n?r(e,t).length:1)}},57728:(e,t,n)=>{var r=n(91321),i=TypeError;e.exports=function(e,t){if(r(t,e))return e;throw i("Incorrect invocation")}},21176:(e,t,n)=>{var r=n(85052),i=String,o=TypeError;e.exports=function(e){if(r(e))return e;throw o(i(e)+" is not an object")}},19540:(e,t,n)=>{var r=n(10905),i=n(43231),o=n(39646),a=function(e){return function(t,n,a){var s,l=r(t),c=o(l),u=i(a,c);if(e&&n!=n){for(;c>u;)if((s=l[u++])!=s)return!0}else for(;c>u;u++)if((e||u in l)&&l[u]===n)return e||u||0;return!e&&-1}};e.exports={includes:a(!0),indexOf:a(!1)}},96038:(e,t,n)=>{"use strict";var r=n(24229);e.exports=function(e,t){var n=[][e];return!!n&&r((function(){n.call(null,t||function(){return 1},1)}))}},69794:(e,t,n)=>{var r=n(43231),i=n(39646),o=n(62324),a=Array,s=Math.max;e.exports=function(e,t,n){for(var l=i(e),c=r(t,l),u=r(void 0===n?l:n,l),d=a(s(u-c,0)),h=0;c<u;c++,h++)o(d,h,e[c]);return d.length=h,d}},1909:(e,t,n)=>{var r=n(65968);e.exports=r([].slice)},33867:(e,t,n)=>{var r=n(69794),i=Math.floor,o=function(e,t){var n=e.length,l=i(n/2);return n<8?a(e,t):s(e,o(r(e,0,l),t),o(r(e,l),t),t)},a=function(e,t){for(var n,r,i=e.length,o=1;o<i;){for(r=o,n=e[o];r&&t(e[r-1],n)>0;)e[r]=e[--r];r!==o++&&(e[r]=n)}return e},s=function(e,t,n,r){for(var i=t.length,o=n.length,a=0,s=0;a<i||s<o;)e[a+s]=a<i&&s<o?r(t[a],n[s])<=0?t[a++]:n[s++]:a<i?t[a++]:n[s++];return e};e.exports=o},74575:(e,t,n)=>{var r=n(70095)("iterator"),i=!1;try{var o=0,a={next:function(){return{done:!!o++}},return:function(){i=!0}};a[r]=function(){return this},Array.from(a,(function(){throw 2}))}catch(s){}e.exports=function(e,t){if(!t&&!i)return!1;var n=!1;try{var o={};o[r]=function(){return{next:function(){return{done:n=!0}}}},e(o)}catch(s){}return n}},27079:(e,t,n)=>{var r=n(56529),i=r({}.toString),o=r("".slice);e.exports=function(e){return o(i(e),8,-1)}},81589:(e,t,n)=>{var r=n(71601),i=n(26733),o=n(27079),a=n(70095)("toStringTag"),s=Object,l="Arguments"==o(function(){return arguments}());e.exports=r?o:function(e){var t,n,r;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(n){}}(t=s(e),a))?n:l?o(t):"Object"==(r=o(t))&&i(t.callee)?"Arguments":r}},77081:(e,t,n)=>{var r=n(98270),i=n(4826),o=n(97933),a=n(31787);e.exports=function(e,t,n){for(var s=i(t),l=a.f,c=o.f,u=0;u<s.length;u++){var d=s[u];r(e,d)||n&&r(n,d)||l(e,d,c(t,d))}}},48127:(e,t,n)=>{var r=n(70095)("match");e.exports=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[r]=!1,"/./"[e](t)}catch(i){}}return!1}},27528:(e,t,n)=>{var r=n(24229);e.exports=!r((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}))},33684:e=>{e.exports=function(e,t){return{value:e,done:t}}},75762:(e,t,n)=>{var r=n(7400),i=n(31787),o=n(65358);e.exports=r?function(e,t,n){return i.f(e,t,o(1,n))}:function(e,t,n){return e[t]=n,e}},65358:e=>{e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},62324:(e,t,n)=>{"use strict";var r=n(39310),i=n(31787),o=n(65358);e.exports=function(e,t,n){var a=r(t);a in e?i.f(e,a,o(0,n)):e[a]=n}},14768:(e,t,n)=>{var r=n(26733),i=n(31787),o=n(16039),a=n(18400);e.exports=function(e,t,n,s){s||(s={});var l=s.enumerable,c=void 0!==s.name?s.name:t;if(r(n)&&o(n,c,s),s.global)l?e[t]=n:a(t,n);else{try{s.unsafe?e[t]&&(l=!0):delete e[t]}catch(u){}l?e[t]=n:i.f(e,t,{value:n,enumerable:!1,configurable:!s.nonConfigurable,writable:!s.nonWritable})}return e}},18400:(e,t,n)=>{var r=n(9859),i=Object.defineProperty;e.exports=function(e,t){try{i(r,e,{value:t,configurable:!0,writable:!0})}catch(n){r[e]=t}return t}},79563:(e,t,n)=>{"use strict";var r=n(59821),i=TypeError;e.exports=function(e,t){if(!delete e[t])throw i("Cannot delete property "+r(t)+" of "+r(e))}},7400:(e,t,n)=>{var r=n(24229);e.exports=!r((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},63777:e=>{var t="object"==typeof document&&document.all,n=void 0===t&&void 0!==t;e.exports={all:t,IS_HTMLDDA:n}},22635:(e,t,n)=>{var r=n(9859),i=n(85052),o=r.document,a=i(o)&&i(o.createElement);e.exports=function(e){return a?o.createElement(e):{}}},95694:e=>{e.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},18865:(e,t,n)=>{var r=n(22635)("span").classList,i=r&&r.constructor&&r.constructor.prototype;e.exports=i===Object.prototype?void 0:i},22671:(e,t,n)=>{var r=n(80598).match(/firefox\/(\d+)/i);e.exports=!!r&&+r[1]},48639:(e,t,n)=>{var r=n(95189),i=n(28801);e.exports=!r&&!i&&"object"==typeof window&&"object"==typeof document},95189:e=>{e.exports="object"==typeof Deno&&Deno&&"object"==typeof Deno.version},48506:(e,t,n)=>{var r=n(80598);e.exports=/MSIE|Trident/.test(r)},8983:(e,t,n)=>{var r=n(80598),i=n(9859);e.exports=/ipad|iphone|ipod/i.test(r)&&void 0!==i.Pebble},32023:(e,t,n)=>{var r=n(80598);e.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(r)},28801:(e,t,n)=>{var r=n(27079),i=n(9859);e.exports="process"==r(i.process)},10263:(e,t,n)=>{var r=n(80598);e.exports=/web0s(?!.*chrome)/i.test(r)},80598:(e,t,n)=>{var r=n(31333);e.exports=r("navigator","userAgent")||""},6358:(e,t,n)=>{var r,i,o=n(9859),a=n(80598),s=o.process,l=o.Deno,c=s&&s.versions||l&&l.version,u=c&&c.v8;u&&(i=(r=u.split("."))[0]>0&&r[0]<4?1:+(r[0]+r[1])),!i&&a&&(!(r=a.match(/Edge\/(\d+)/))||r[1]>=74)&&(r=a.match(/Chrome\/(\d+)/))&&(i=+r[1]),e.exports=i},49811:(e,t,n)=>{var r=n(80598).match(/AppleWebKit\/(\d+)\./);e.exports=!!r&&+r[1]},13837:e=>{e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},23103:(e,t,n)=>{var r=n(9859),i=n(97933).f,o=n(75762),a=n(14768),s=n(18400),l=n(77081),c=n(46541);e.exports=function(e,t){var n,u,d,h,f,p=e.target,v=e.global,g=e.stat;if(n=v?r:g?r[p]||s(p,{}):(r[p]||{}).prototype)for(u in t){if(h=t[u],d=e.dontCallGetSet?(f=i(n,u))&&f.value:n[u],!c(v?u:p+(g?".":"#")+u,e.forced)&&void 0!==d){if(typeof h==typeof d)continue;l(h,d)}(e.sham||d&&d.sham)&&o(h,"sham",!0),a(n,u,h,e)}}},24229:e=>{e.exports=function(e){try{return!!e()}catch(t){return!0}}},94954:(e,t,n)=>{"use strict";n(77950);var r=n(65968),i=n(14768),o=n(63466),a=n(24229),s=n(70095),l=n(75762),c=s("species"),u=RegExp.prototype;e.exports=function(e,t,n,d){var h=s(e),f=!a((function(){var t={};return t[h]=function(){return 7},7!=""[e](t)})),p=f&&!a((function(){var t=!1,n=/a/;return"split"===e&&((n={}).constructor={},n.constructor[c]=function(){return n},n.flags="",n[h]=/./[h]),n.exec=function(){return t=!0,null},n[h](""),!t}));if(!f||!p||n){var v=r(/./[h]),g=t(h,""[e],(function(e,t,n,i,a){var s=r(e),l=t.exec;return l===o||l===u.exec?f&&!a?{done:!0,value:v(t,n,i)}:{done:!0,value:s(n,t,i)}:{done:!1}}));i(String.prototype,e,g[0]),i(u,h,g[1])}d&&l(u[h],"sham",!0)}},53171:(e,t,n)=>{var r=n(57188),i=Function.prototype,o=i.apply,a=i.call;e.exports="object"==typeof Reflect&&Reflect.apply||(r?a.bind(o):function(){return a.apply(o,arguments)})},97636:(e,t,n)=>{var r=n(65968),i=n(77111),o=n(57188),a=r(r.bind);e.exports=function(e,t){return i(e),void 0===t?e:o?a(e,t):function(){return e.apply(t,arguments)}}},57188:(e,t,n)=>{var r=n(24229);e.exports=!r((function(){var e=(function(){}).bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}))},20266:(e,t,n)=>{var r=n(57188),i=Function.prototype.call;e.exports=r?i.bind(i):function(){return i.apply(i,arguments)}},51805:(e,t,n)=>{var r=n(7400),i=n(98270),o=Function.prototype,a=r&&Object.getOwnPropertyDescriptor,s=i(o,"name"),l=s&&"something"===(function(){}).name,c=s&&(!r||r&&a(o,"name").configurable);e.exports={EXISTS:s,PROPER:l,CONFIGURABLE:c}},56529:(e,t,n)=>{var r=n(57188),i=Function.prototype,o=i.call,a=r&&i.bind.bind(o,o);e.exports=r?a:function(e){return function(){return o.apply(e,arguments)}}},65968:(e,t,n)=>{var r=n(27079),i=n(56529);e.exports=function(e){if("Function"===r(e))return i(e)}},31333:(e,t,n)=>{var r=n(9859),i=n(26733),o=function(e){return i(e)?e:void 0};e.exports=function(e,t){return arguments.length<2?o(r[e]):r[e]&&r[e][t]}},78830:(e,t,n)=>{var r=n(81589),i=n(55300),o=n(9650),a=n(45495),s=n(70095)("iterator");e.exports=function(e){if(!o(e))return i(e,s)||i(e,"@@iterator")||a[r(e)]}},28403:(e,t,n)=>{var r=n(20266),i=n(77111),o=n(21176),a=n(59821),s=n(78830),l=TypeError;e.exports=function(e,t){var n=arguments.length<2?s(e):t;if(i(n))return o(r(n,e));throw l(a(e)+" is not iterable")}},55300:(e,t,n)=>{var r=n(77111),i=n(9650);e.exports=function(e,t){var n=e[t];return i(n)?void 0:r(n)}},70017:(e,t,n)=>{var r=n(65968),i=n(92991),o=Math.floor,a=r("".charAt),s=r("".replace),l=r("".slice),c=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,u=/\$([$&'`]|\d{1,2})/g;e.exports=function(e,t,n,r,d,h){var f=n+e.length,p=r.length,v=u;return void 0!==d&&(d=i(d),v=c),s(h,v,(function(i,s){var c;switch(a(s,0)){case"$":return"$";case"&":return e;case"`":return l(t,0,n);case"'":return l(t,f);case"<":c=d[l(s,1,-1)];break;default:var u=+s;if(0===u)return i;if(u>p){var h=o(u/10);return 0===h?i:h<=p?void 0===r[h-1]?a(s,1):r[h-1]+a(s,1):i}c=r[u-1]}return void 0===c?"":c}))}},9859:e=>{var t=function(e){return e&&e.Math==Math&&e};e.exports=t("object"==typeof globalThis&&globalThis)||t("object"==typeof window&&window)||t("object"==typeof self&&self)||t("object"==typeof global&&global)||function(){return this}()||Function("return this")()},98270:(e,t,n)=>{var r=n(65968),i=n(92991),o=r({}.hasOwnProperty);e.exports=Object.hasOwn||function(e,t){return o(i(e),t)}},95977:e=>{e.exports={}},14665:(e,t,n)=>{var r=n(9859);e.exports=function(e,t){var n=r.console;n&&n.error&&(1==arguments.length?n.error(e):n.error(e,t))}},53777:(e,t,n)=>{var r=n(31333);e.exports=r("document","documentElement")},64394:(e,t,n)=>{var r=n(7400),i=n(24229),o=n(22635);e.exports=!r&&!i((function(){return 7!=Object.defineProperty(o("div"),"a",{get:function(){return 7}}).a}))},9337:(e,t,n)=>{var r=n(65968),i=n(24229),o=n(27079),a=Object,s=r("".split);e.exports=i((function(){return!a("z").propertyIsEnumerable(0)}))?function(e){return"String"==o(e)?s(e,""):a(e)}:a},8511:(e,t,n)=>{var r=n(65968),i=n(26733),o=n(85353),a=r(Function.toString);i(o.inspectSource)||(o.inspectSource=function(e){return a(e)}),e.exports=o.inspectSource},56407:(e,t,n)=>{var r,i,o,a=n(51180),s=n(9859),l=n(85052),c=n(75762),u=n(98270),d=n(85353),h=n(44399),f=n(95977),p="Object already initialized",v=s.TypeError,g=s.WeakMap;if(a||d.state){var m=d.state||(d.state=new g);m.get=m.get,m.has=m.has,m.set=m.set,r=function(e,t){if(m.has(e))throw v(p);return t.facade=e,m.set(e,t),t},i=function(e){return m.get(e)||{}},o=function(e){return m.has(e)}}else{var y=h("state");f[y]=!0,r=function(e,t){if(u(e,y))throw v(p);return t.facade=e,c(e,y,t),t},i=function(e){return u(e,y)?e[y]:{}},o=function(e){return u(e,y)}}e.exports={set:r,get:i,has:o,enforce:function(e){return o(e)?i(e):r(e,{})},getterFor:function(e){return function(t){var n;if(!l(t)||(n=i(t)).type!==e)throw v("Incompatible receiver, "+e+" required");return n}}}},91943:(e,t,n)=>{var r=n(70095),i=n(45495),o=r("iterator"),a=Array.prototype;e.exports=function(e){return void 0!==e&&(i.Array===e||a[o]===e)}},26733:(e,t,n)=>{var r=n(63777),i=r.all;e.exports=r.IS_HTMLDDA?function(e){return"function"==typeof e||e===i}:function(e){return"function"==typeof e}},82359:(e,t,n)=>{var r=n(65968),i=n(24229),o=n(26733),a=n(81589),s=n(31333),l=n(8511),c=function(){},u=[],d=s("Reflect","construct"),h=/^\s*(?:class|function)\b/,f=r(h.exec),p=!h.exec(c),v=function(e){if(!o(e))return!1;try{return d(c,u,e),!0}catch(t){return!1}},g=function(e){if(!o(e))return!1;switch(a(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return p||!!f(h,l(e))}catch(t){return!0}};g.sham=!0,e.exports=!d||i((function(){var e;return v(v.call)||!v(Object)||!v((function(){e=!0}))||e}))?g:v},46541:(e,t,n)=>{var r=n(24229),i=n(26733),o=/#|\.prototype\./,a=function(e,t){var n=l[s(e)];return n==u||n!=c&&(i(t)?r(t):!!t)},s=a.normalize=function(e){return String(e).replace(o,".").toLowerCase()},l=a.data={},c=a.NATIVE="N",u=a.POLYFILL="P";e.exports=a},9650:e=>{e.exports=function(e){return null==e}},85052:(e,t,n)=>{var r=n(26733),i=n(63777),o=i.all;e.exports=i.IS_HTMLDDA?function(e){return"object"==typeof e?null!==e:r(e)||e===o}:function(e){return"object"==typeof e?null!==e:r(e)}},24231:e=>{e.exports=!1},48311:(e,t,n)=>{var r=n(85052),i=n(27079),o=n(70095)("match");e.exports=function(e){var t;return r(e)&&(void 0!==(t=e[o])?!!t:"RegExp"==i(e))}},49395:(e,t,n)=>{var r=n(31333),i=n(26733),o=n(91321),a=n(66969),s=Object;e.exports=a?function(e){return"symbol"==typeof e}:function(e){var t=r("Symbol");return i(t)&&o(t.prototype,s(e))}},89003:(e,t,n)=>{var r=n(97636),i=n(20266),o=n(21176),a=n(59821),s=n(91943),l=n(39646),c=n(91321),u=n(28403),d=n(78830),h=n(57281),f=TypeError,p=function(e,t){this.stopped=e,this.result=t},v=p.prototype;e.exports=function(e,t,n){var g,m,y,b,x,w,E,_=n&&n.that,k=!(!n||!n.AS_ENTRIES),S=!(!n||!n.IS_RECORD),P=!(!n||!n.IS_ITERATOR),j=!(!n||!n.INTERRUPTED),C=r(t,_),T=function(e){return g&&h(g,"normal",e),new p(!0,e)},D=function(e){return k?(o(e),j?C(e[0],e[1],T):C(e[0],e[1])):j?C(e,T):C(e)};if(S)g=e.iterator;else if(P)g=e;else{if(!(m=d(e)))throw f(a(e)+" is not iterable");if(s(m)){for(y=0,b=l(e);b>y;y++)if((x=D(e[y]))&&c(v,x))return x;return new p(!1)}g=u(e,m)}for(w=S?e.next:g.next;!(E=i(w,g)).done;){try{x=D(E.value)}catch(N){h(g,"throw",N)}if("object"==typeof x&&x&&c(v,x))return x}return new p(!1)}},57281:(e,t,n)=>{var r=n(20266),i=n(21176),o=n(55300);e.exports=function(e,t,n){var a,s;i(e);try{if(!(a=o(e,"return"))){if("throw"===t)throw n;return n}a=r(a,e)}catch(l){s=!0,a=l}if("throw"===t)throw n;if(s)throw a;return i(a),n}},42247:(e,t,n)=>{"use strict";var r=n(60693).IteratorPrototype,i=n(22391),o=n(65358),a=n(54555),s=n(45495),l=function(){return this};e.exports=function(e,t,n,c){var u=t+" Iterator";return e.prototype=i(r,{next:o(+!c,n)}),a(e,u,!1,!0),s[u]=l,e}},12707:(e,t,n)=>{"use strict";var r=n(23103),i=n(20266),o=n(24231),a=n(51805),s=n(26733),l=n(42247),c=n(67567),u=n(56540),d=n(54555),h=n(75762),f=n(14768),p=n(70095),v=n(45495),g=n(60693),m=a.PROPER,y=a.CONFIGURABLE,b=g.IteratorPrototype,x=g.BUGGY_SAFARI_ITERATORS,w=p("iterator"),E="keys",_="values",k="entries",S=function(){return this};e.exports=function(e,t,n,a,p,g,P){l(n,t,a);var j,C,T,D=function(e){if(e===p&&R)return R;if(!x&&e in M)return M[e];switch(e){case E:case _:case k:return function(){return new n(this,e)}}return function(){return new n(this)}},N=t+" Iterator",O=!1,M=e.prototype,A=M[w]||M["@@iterator"]||p&&M[p],R=!x&&A||D(p),I="Array"==t&&M.entries||A;if(I&&(j=c(I.call(new e)))!==Object.prototype&&j.next&&(o||c(j)===b||(u?u(j,b):s(j[w])||f(j,w,S)),d(j,N,!0,!0),o&&(v[N]=S)),m&&p==_&&A&&A.name!==_&&(!o&&y?h(M,"name",_):(O=!0,R=function(){return i(A,this)})),p)if(C={values:D(_),keys:g?R:D(E),entries:D(k)},P)for(T in C)(x||O||!(T in M))&&f(M,T,C[T]);else r({target:t,proto:!0,forced:x||O},C);return o&&!P||M[w]===R||f(M,w,R,{name:p}),v[t]=R,C}},60693:(e,t,n)=>{"use strict";var r,i,o,a=n(24229),s=n(26733),l=n(85052),c=n(22391),u=n(67567),d=n(14768),h=n(70095),f=n(24231),p=h("iterator"),v=!1;[].keys&&("next"in(o=[].keys())?(i=u(u(o)))!==Object.prototype&&(r=i):v=!0),!l(r)||a((function(){var e={};return r[p].call(e)!==e}))?r={}:f&&(r=c(r)),s(r[p])||d(r,p,(function(){return this})),e.exports={IteratorPrototype:r,BUGGY_SAFARI_ITERATORS:v}},45495:e=>{e.exports={}},39646:(e,t,n)=>{var r=n(34237);e.exports=function(e){return r(e.length)}},16039:(e,t,n)=>{var r=n(24229),i=n(26733),o=n(98270),a=n(7400),s=n(51805).CONFIGURABLE,l=n(8511),c=n(56407),u=c.enforce,d=c.get,h=Object.defineProperty,f=a&&!r((function(){return 8!==h((function(){}),"length",{value:8}).length})),p=String(String).split("String"),v=e.exports=function(e,t,n){"Symbol("===String(t).slice(0,7)&&(t="["+String(t).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),n&&n.getter&&(t="get "+t),n&&n.setter&&(t="set "+t),(!o(e,"name")||s&&e.name!==t)&&(a?h(e,"name",{value:t,configurable:!0}):e.name=t),f&&n&&o(n,"arity")&&e.length!==n.arity&&h(e,"length",{value:n.arity});try{n&&o(n,"constructor")&&n.constructor?a&&h(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(i){}var r=u(e);return o(r,"source")||(r.source=p.join("string"==typeof t?t:"")),e};Function.prototype.toString=v((function(){return i(this)&&d(this).source||l(this)}),"toString")},50917:e=>{var t=Math.ceil,n=Math.floor;e.exports=Math.trunc||function(e){var r=+e;return(r>0?n:t)(r)}},24794:(e,t,n)=>{var r,i,o,a,s,l,c,u,d=n(9859),h=n(97636),f=n(97933).f,p=n(55795).set,v=n(32023),g=n(8983),m=n(10263),y=n(28801),b=d.MutationObserver||d.WebKitMutationObserver,x=d.document,w=d.process,E=d.Promise,_=f(d,"queueMicrotask"),k=_&&_.value;k||(r=function(){var e,t;for(y&&(e=w.domain)&&e.exit();i;){t=i.fn,i=i.next;try{t()}catch(n){throw i?a():o=void 0,n}}o=void 0,e&&e.enter()},v||y||m||!b||!x?!g&&E&&E.resolve?((c=E.resolve(void 0)).constructor=E,u=h(c.then,c),a=function(){u(r)}):y?a=function(){w.nextTick(r)}:(p=h(p,d),a=function(){p(r)}):(s=!0,l=x.createTextNode(""),new b(r).observe(l,{characterData:!0}),a=function(){l.data=s=!s})),e.exports=k||function(e){var t={fn:e,next:void 0};o&&(o.next=t),i||(i=t,a()),o=t}},16485:(e,t,n)=>{"use strict";var r=n(77111),i=TypeError,o=function(e){var t,n;this.promise=new e((function(e,r){if(void 0!==t||void 0!==n)throw i("Bad Promise constructor");t=e,n=r})),this.resolve=r(t),this.reject=r(n)};e.exports.f=function(e){return new o(e)}},47272:(e,t,n)=>{var r=n(48311),i=TypeError;e.exports=function(e){if(r(e))throw i("The method doesn't accept regular expressions");return e}},47:(e,t,n)=>{"use strict";var r=n(7400),i=n(65968),o=n(20266),a=n(24229),s=n(65632),l=n(10894),c=n(19195),u=n(92991),d=n(9337),h=Object.assign,f=Object.defineProperty,p=i([].concat);e.exports=!h||a((function(){if(r&&1!==h({b:1},h(f({},"a",{enumerable:!0,get:function(){f(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},n=Symbol(),i="abcdefghijklmnopqrst";return e[n]=7,i.split("").forEach((function(e){t[e]=e})),7!=h({},e)[n]||s(h({},t)).join("")!=i}))?function(e,t){for(var n=u(e),i=arguments.length,a=1,h=l.f,f=c.f;i>a;)for(var v,g=d(arguments[a++]),m=h?p(s(g),h(g)):s(g),y=m.length,b=0;y>b;)v=m[b++],r&&!o(f,g,v)||(n[v]=g[v]);return n}:h},22391:(e,t,n)=>{var r,i=n(21176),o=n(90219),a=n(13837),s=n(95977),l=n(53777),c=n(22635),u=n(44399),d=u("IE_PROTO"),h=function(){},f=function(e){return"<script>"+e+"</"+"script>"},p=function(e){e.write(f("")),e.close();var t=e.parentWindow.Object;return e=null,t},v=function(){try{r=new ActiveXObject("htmlfile")}catch(i){}var e,t;v="undefined"!=typeof document?document.domain&&r?p(r):((t=c("iframe")).style.display="none",l.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(f("document.F=Object")),e.close(),e.F):p(r);for(var n=a.length;n--;)delete v.prototype[a[n]];return v()};s[d]=!0,e.exports=Object.create||function(e,t){var n;return null!==e?(h.prototype=i(e),n=new h,h.prototype=null,n[d]=e):n=v(),void 0===t?n:o.f(n,t)}},90219:(e,t,n)=>{var r=n(7400),i=n(17137),o=n(31787),a=n(21176),s=n(10905),l=n(65632);t.f=r&&!i?Object.defineProperties:function(e,t){a(e);for(var n,r=s(t),i=l(t),c=i.length,u=0;c>u;)o.f(e,n=i[u++],r[n]);return e}},31787:(e,t,n)=>{var r=n(7400),i=n(64394),o=n(17137),a=n(21176),s=n(39310),l=TypeError,c=Object.defineProperty,u=Object.getOwnPropertyDescriptor,d="enumerable",h="configurable",f="writable";t.f=r?o?function(e,t,n){if(a(e),t=s(t),a(n),"function"==typeof e&&"prototype"===t&&"value"in n&&f in n&&!n.writable){var r=u(e,t);r&&r.writable&&(e[t]=n.value,n={configurable:h in n?n.configurable:r.configurable,enumerable:d in n?n.enumerable:r.enumerable,writable:!1})}return c(e,t,n)}:c:function(e,t,n){if(a(e),t=s(t),a(n),i)try{return c(e,t,n)}catch(r){}if("get"in n||"set"in n)throw l("Accessors not supported");return"value"in n&&(e[t]=n.value),e}},97933:(e,t,n)=>{var r=n(7400),i=n(20266),o=n(19195),a=n(65358),s=n(10905),l=n(39310),c=n(98270),u=n(64394),d=Object.getOwnPropertyDescriptor;t.f=r?d:function(e,t){if(e=s(e),t=l(t),u)try{return d(e,t)}catch(n){}if(c(e,t))return a(!i(o.f,e,t),e[t])}},78151:(e,t,n)=>{var r=n(90140),i=n(13837).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return r(e,i)}},10894:(e,t)=>{t.f=Object.getOwnPropertySymbols},67567:(e,t,n)=>{var r=n(98270),i=n(26733),o=n(92991),a=n(44399),s=n(27528),l=a("IE_PROTO"),c=Object,u=c.prototype;e.exports=s?c.getPrototypeOf:function(e){var t=o(e);if(r(t,l))return t[l];var n=t.constructor;return i(n)&&t instanceof n?n.prototype:t instanceof c?u:null}},91321:(e,t,n)=>{var r=n(65968);e.exports=r({}.isPrototypeOf)},90140:(e,t,n)=>{var r=n(65968),i=n(98270),o=n(10905),a=n(19540).indexOf,s=n(95977),l=r([].push);e.exports=function(e,t){var n,r=o(e),c=0,u=[];for(n in r)!i(s,n)&&i(r,n)&&l(u,n);for(;t.length>c;)i(r,n=t[c++])&&(~a(u,n)||l(u,n));return u}},65632:(e,t,n)=>{var r=n(90140),i=n(13837);e.exports=Object.keys||function(e){return r(e,i)}},19195:(e,t)=>{"use strict";var n={}.propertyIsEnumerable,r=Object.getOwnPropertyDescriptor,i=r&&!n.call({1:2},1);t.f=i?function(e){var t=r(this,e);return!!t&&t.enumerable}:n},56540:(e,t,n)=>{var r=n(65968),i=n(21176),o=n(88505);e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=r(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(n,[]),t=n instanceof Array}catch(a){}return function(n,r){return i(n),o(r),t?e(n,r):n.__proto__=r,n}}():void 0)},32914:(e,t,n)=>{var r=n(20266),i=n(26733),o=n(85052),a=TypeError;e.exports=function(e,t){var n,s;if("string"===t&&i(n=e.toString)&&!o(s=r(n,e)))return s;if(i(n=e.valueOf)&&!o(s=r(n,e)))return s;if("string"!==t&&i(n=e.toString)&&!o(s=r(n,e)))return s;throw a("Can't convert object to primitive value")}},4826:(e,t,n)=>{var r=n(31333),i=n(65968),o=n(78151),a=n(10894),s=n(21176),l=i([].concat);e.exports=r("Reflect","ownKeys")||function(e){var t=o.f(s(e)),n=a.f;return n?l(t,n(e)):t}},64624:e=>{e.exports=function(e){try{return{error:!1,value:e()}}catch(t){return{error:!0,value:t}}}},38321:(e,t,n)=>{var r=n(9859),i=n(74473),o=n(26733),a=n(46541),s=n(8511),l=n(70095),c=n(48639),u=n(95189),d=n(24231),h=n(6358),f=i&&i.prototype,p=l("species"),v=!1,g=o(r.PromiseRejectionEvent),m=a("Promise",(function(){var e=s(i),t=e!==String(i);if(!t&&66===h)return!0;if(d&&(!f.catch||!f.finally))return!0;if(!h||h<51||!/native code/.test(e)){var n=new i((function(e){e(1)})),r=function(e){e((function(){}),(function(){}))};if((n.constructor={})[p]=r,!(v=n.then((function(){}))instanceof r))return!0}return!t&&(c||u)&&!g}));e.exports={CONSTRUCTOR:m,REJECTION_EVENT:g,SUBCLASSING:v}},74473:(e,t,n)=>{var r=n(9859);e.exports=r.Promise},62391:(e,t,n)=>{var r=n(21176),i=n(85052),o=n(16485);e.exports=function(e,t){if(r(e),i(t)&&t.constructor===e)return t;var n=o.f(e);return(0,n.resolve)(t),n.promise}},96866:(e,t,n)=>{var r=n(74473),i=n(74575),o=n(38321).CONSTRUCTOR;e.exports=o||!i((function(e){r.all(e).then(void 0,(function(){}))}))},93358:e=>{var t=function(){this.head=null,this.tail=null};t.prototype={add:function(e){var t={item:e,next:null};this.head?this.tail.next=t:this.head=t,this.tail=t},get:function(){var e=this.head;if(e)return this.head=e.next,this.tail===e&&(this.tail=null),e.item}},e.exports=t},98115:(e,t,n)=>{var r=n(20266),i=n(21176),o=n(26733),a=n(27079),s=n(63466),l=TypeError;e.exports=function(e,t){var n=e.exec;if(o(n)){var c=r(n,e,t);return null!==c&&i(c),c}if("RegExp"===a(e))return r(s,e,t);throw l("RegExp#exec called on incompatible receiver")}},63466:(e,t,n)=>{"use strict";var r,i,o=n(20266),a=n(65968),s=n(83326),l=n(30895),c=n(25650),u=n(33036),d=n(22391),h=n(56407).get,f=n(42926),p=n(10461),v=u("native-string-replace",String.prototype.replace),g=RegExp.prototype.exec,m=g,y=a("".charAt),b=a("".indexOf),x=a("".replace),w=a("".slice),E=(i=/b*/g,o(g,r=/a/,"a"),o(g,i,"a"),0!==r.lastIndex||0!==i.lastIndex),_=c.BROKEN_CARET,k=void 0!==/()??/.exec("")[1];(E||k||_||f||p)&&(m=function(e){var t,n,r,i,a,c,u,f=this,p=h(f),S=s(e),P=p.raw;if(P)return P.lastIndex=f.lastIndex,t=o(m,P,S),f.lastIndex=P.lastIndex,t;var j=p.groups,C=_&&f.sticky,T=o(l,f),D=f.source,N=0,O=S;if(C&&(T=x(T,"y",""),-1===b(T,"g")&&(T+="g"),O=w(S,f.lastIndex),f.lastIndex>0&&(!f.multiline||f.multiline&&"\n"!==y(S,f.lastIndex-1))&&(D="(?: "+D+")",O=" "+O,N++),n=new RegExp("^(?:"+D+")",T)),k&&(n=new RegExp("^"+D+"$(?!\\s)",T)),E&&(r=f.lastIndex),i=o(g,C?n:f,O),C?i?(i.input=w(i.input,N),i[0]=w(i[0],N),i.index=f.lastIndex,f.lastIndex+=i[0].length):f.lastIndex=0:E&&i&&(f.lastIndex=f.global?i.index+i[0].length:r),k&&i&&i.length>1&&o(v,i[0],n,(function(){for(a=1;a<arguments.length-2;a++)void 0===arguments[a]&&(i[a]=void 0)})),i&&j)for(i.groups=c=d(null),a=0;a<j.length;a++)c[(u=j[a])[0]]=i[u[1]];return i}),e.exports=m},30895:(e,t,n)=>{"use strict";var r=n(21176);e.exports=function(){var e=r(this),t="";return e.hasIndices&&(t+="d"),e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.unicodeSets&&(t+="v"),e.sticky&&(t+="y"),t}},25650:(e,t,n)=>{var r=n(24229),i=n(9859).RegExp,o=r((function(){var e=i("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),a=o||r((function(){return!i("a","y").sticky})),s=o||r((function(){var e=i("^r","gy");return e.lastIndex=2,null!=e.exec("str")}));e.exports={BROKEN_CARET:s,MISSED_STICKY:a,UNSUPPORTED_Y:o}},42926:(e,t,n)=>{var r=n(24229),i=n(9859).RegExp;e.exports=r((function(){var e=i(".","s");return!(e.dotAll&&e.exec("\n")&&"s"===e.flags)}))},10461:(e,t,n)=>{var r=n(24229),i=n(9859).RegExp;e.exports=r((function(){var e=i("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")}))},58885:(e,t,n)=>{var r=n(9650),i=TypeError;e.exports=function(e){if(r(e))throw i("Can't call method on "+e);return e}},72101:e=>{e.exports=Object.is||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}},71832:(e,t,n)=>{"use strict";var r=n(31333),i=n(31787),o=n(70095),a=n(7400),s=o("species");e.exports=function(e){var t=r(e),n=i.f;a&&t&&!t[s]&&n(t,s,{configurable:!0,get:function(){return this}})}},54555:(e,t,n)=>{var r=n(31787).f,i=n(98270),o=n(70095)("toStringTag");e.exports=function(e,t,n){e&&!n&&(e=e.prototype),e&&!i(e,o)&&r(e,o,{configurable:!0,value:t})}},44399:(e,t,n)=>{var r=n(33036),i=n(81441),o=r("keys");e.exports=function(e){return o[e]||(o[e]=i(e))}},85353:(e,t,n)=>{var r=n(9859),i=n(18400),o="__core-js_shared__",a=r[o]||i(o,{});e.exports=a},33036:(e,t,n)=>{var r=n(24231),i=n(85353);(e.exports=function(e,t){return i[e]||(i[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.26.0",mode:r?"pure":"global",copyright:"\xa9 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.26.0/LICENSE",source:"https://github.com/zloirock/core-js"})},37942:(e,t,n)=>{var r=n(21176),i=n(57988),o=n(9650),a=n(70095)("species");e.exports=function(e,t){var n,s=r(e).constructor;return void 0===s||o(n=r(s)[a])?t:i(n)}},30966:(e,t,n)=>{var r=n(65968),i=n(43329),o=n(83326),a=n(58885),s=r("".charAt),l=r("".charCodeAt),c=r("".slice),u=function(e){return function(t,n){var r,u,d=o(a(t)),h=i(n),f=d.length;return h<0||h>=f?e?"":void 0:(r=l(d,h))<55296||r>56319||h+1===f||(u=l(d,h+1))<56320||u>57343?e?s(d,h):r:e?c(d,h,h+2):u-56320+(r-55296<<10)+65536}};e.exports={codeAt:u(!1),charAt:u(!0)}},44860:(e,t,n)=>{var r=n(6358),i=n(24229);e.exports=!!Object.getOwnPropertySymbols&&!i((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&r&&r<41}))},55795:(e,t,n)=>{var r,i,o,a,s=n(9859),l=n(53171),c=n(97636),u=n(26733),d=n(98270),h=n(24229),f=n(53777),p=n(1909),v=n(22635),g=n(77579),m=n(32023),y=n(28801),b=s.setImmediate,x=s.clearImmediate,w=s.process,E=s.Dispatch,_=s.Function,k=s.MessageChannel,S=s.String,P=0,j={},C="onreadystatechange";try{r=s.location}catch(M){}var T=function(e){if(d(j,e)){var t=j[e];delete j[e],t()}},D=function(e){return function(){T(e)}},N=function(e){T(e.data)},O=function(e){s.postMessage(S(e),r.protocol+"//"+r.host)};b&&x||(b=function(e){g(arguments.length,1);var t=u(e)?e:_(e),n=p(arguments,1);return j[++P]=function(){l(t,void 0,n)},i(P),P},x=function(e){delete j[e]},y?i=function(e){w.nextTick(D(e))}:E&&E.now?i=function(e){E.now(D(e))}:k&&!m?(a=(o=new k).port2,o.port1.onmessage=N,i=c(a.postMessage,a)):s.addEventListener&&u(s.postMessage)&&!s.importScripts&&r&&"file:"!==r.protocol&&!h(O)?(i=O,s.addEventListener("message",N,!1)):i=C in v("script")?function(e){f.appendChild(v("script")).onreadystatechange=function(){f.removeChild(this),T(e)}}:function(e){setTimeout(D(e),0)}),e.exports={set:b,clear:x}},43231:(e,t,n)=>{var r=n(43329),i=Math.max,o=Math.min;e.exports=function(e,t){var n=r(e);return n<0?i(n+t,0):o(n,t)}},10905:(e,t,n)=>{var r=n(9337),i=n(58885);e.exports=function(e){return r(i(e))}},43329:(e,t,n)=>{var r=n(50917);e.exports=function(e){var t=+e;return t!=t||0===t?0:r(t)}},34237:(e,t,n)=>{var r=n(43329),i=Math.min;e.exports=function(e){return e>0?i(r(e),9007199254740991):0}},92991:(e,t,n)=>{var r=n(58885),i=Object;e.exports=function(e){return i(r(e))}},92066:(e,t,n)=>{var r=n(20266),i=n(85052),o=n(49395),a=n(55300),s=n(32914),l=n(70095),c=TypeError,u=l("toPrimitive");e.exports=function(e,t){if(!i(e)||o(e))return e;var n,l=a(e,u);if(l){if(void 0===t&&(t="default"),n=r(l,e,t),!i(n)||o(n))return n;throw c("Can't convert object to primitive value")}return void 0===t&&(t="number"),s(e,t)}},39310:(e,t,n)=>{var r=n(92066),i=n(49395);e.exports=function(e){var t=r(e,"string");return i(t)?t:t+""}},71601:(e,t,n)=>{var r={};r[n(70095)("toStringTag")]="z",e.exports="[object z]"===String(r)},83326:(e,t,n)=>{var r=n(81589),i=String;e.exports=function(e){if("Symbol"===r(e))throw TypeError("Cannot convert a Symbol value to a string");return i(e)}},59821:e=>{var t=String;e.exports=function(e){try{return t(e)}catch(n){return"Object"}}},81441:(e,t,n)=>{var r=n(65968),i=0,o=Math.random(),a=r(1..toString);e.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+a(++i+o,36)}},66969:(e,t,n)=>{var r=n(44860);e.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},17137:(e,t,n)=>{var r=n(7400),i=n(24229);e.exports=r&&i((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},77579:e=>{var t=TypeError;e.exports=function(e,n){if(e<n)throw t("Not enough arguments");return e}},51180:(e,t,n)=>{var r=n(9859),i=n(26733),o=r.WeakMap;e.exports=i(o)&&/native code/.test(String(o))},70095:(e,t,n)=>{var r=n(9859),i=n(33036),o=n(98270),a=n(81441),s=n(44860),l=n(66969),c=i("wks"),u=r.Symbol,d=u&&u.for,h=l?u:u&&u.withoutSetter||a;e.exports=function(e){if(!o(c,e)||!s&&"string"!=typeof c[e]){var t="Symbol."+e;s&&o(u,e)?c[e]=u[e]:c[e]=l&&d?d(t):h(t)}return c[e]}},39529:(e,t,n)=>{"use strict";var r=n(23103),i=n(19540).includes,o=n(24229),a=n(9736);r({target:"Array",proto:!0,forced:o((function(){return!Array(1).includes()}))},{includes:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),a("includes")},15735:(e,t,n)=>{"use strict";var r=n(10905),i=n(9736),o=n(45495),a=n(56407),s=n(31787).f,l=n(12707),c=n(33684),u=n(24231),d=n(7400),h="Array Iterator",f=a.set,p=a.getterFor(h);e.exports=l(Array,"Array",(function(e,t){f(this,{type:h,target:r(e),index:0,kind:t})}),(function(){var e=p(this),t=e.target,n=e.kind,r=e.index++;return!t||r>=t.length?(e.target=void 0,c(void 0,!0)):c("keys"==n?r:"values"==n?t[r]:[r,t[r]],!1)}),"values");var v=o.Arguments=o.Array;if(i("keys"),i("values"),i("entries"),!u&&d&&"values"!==v.name)try{s(v,"name",{value:"values"})}catch(g){}},43430:(e,t,n)=>{"use strict";var r=n(23103),i=n(65968),o=n(77111),a=n(92991),s=n(39646),l=n(79563),c=n(83326),u=n(24229),d=n(33867),h=n(96038),f=n(22671),p=n(48506),v=n(6358),g=n(49811),m=[],y=i(m.sort),b=i(m.push),x=u((function(){m.sort(void 0)})),w=u((function(){m.sort(null)})),E=h("sort"),_=!u((function(){if(v)return v<70;if(!(f&&f>3)){if(p)return!0;if(g)return g<603;var e,t,n,r,i="";for(e=65;e<76;e++){switch(t=String.fromCharCode(e),e){case 66:case 69:case 70:case 72:n=3;break;case 68:case 71:n=4;break;default:n=2}for(r=0;r<47;r++)m.push({k:t+r,v:n})}for(m.sort((function(e,t){return t.v-e.v})),r=0;r<m.length;r++)t=m[r].k.charAt(0),i.charAt(i.length-1)!==t&&(i+=t);return"DGBEFHACIJK"!==i}}));r({target:"Array",proto:!0,forced:x||!w||!E||!_},{sort:function(e){void 0!==e&&o(e);var t=a(this);if(_)return void 0===e?y(t):y(t,e);var n,r,i=[],u=s(t);for(r=0;r<u;r++)r in t&&b(i,t[r]);for(d(i,function(e){return function(t,n){return void 0===n?-1:void 0===t?1:void 0!==e?+e(t,n)||0:c(t)>c(n)?1:-1}}(e)),n=s(i),r=0;r<n;)t[r]=i[r++];for(;r<u;)l(t,r++);return t}})},43105:(e,t,n)=>{var r=n(23103),i=n(47);r({target:"Object",stat:!0,arity:2,forced:Object.assign!==i},{assign:i})},56032:(e,t,n)=>{"use strict";var r=n(23103),i=n(20266),o=n(77111),a=n(16485),s=n(64624),l=n(89003);r({target:"Promise",stat:!0,forced:n(96866)},{all:function(e){var t=this,n=a.f(t),r=n.resolve,c=n.reject,u=s((function(){var n=o(t.resolve),a=[],s=0,u=1;l(e,(function(e){var o=s++,l=!1;u++,i(n,t,e).then((function(e){l||(l=!0,a[o]=e,--u||r(a))}),c)})),--u||r(a)}));return u.error&&c(u.value),n.promise}})},6135:(e,t,n)=>{"use strict";var r=n(23103),i=n(24231),o=n(38321).CONSTRUCTOR,a=n(74473),s=n(31333),l=n(26733),c=n(14768),u=a&&a.prototype;if(r({target:"Promise",proto:!0,forced:o,real:!0},{catch:function(e){return this.then(void 0,e)}}),!i&&l(a)){var d=s("Promise").prototype.catch;u.catch!==d&&c(u,"catch",d,{unsafe:!0})}},86087:(e,t,n)=>{"use strict";var r,i,o,a=n(23103),s=n(24231),l=n(28801),c=n(9859),u=n(20266),d=n(14768),h=n(56540),f=n(54555),p=n(71832),v=n(77111),g=n(26733),m=n(85052),y=n(57728),b=n(37942),x=n(55795).set,w=n(24794),E=n(14665),_=n(64624),k=n(93358),S=n(56407),P=n(74473),j=n(38321),C=n(16485),T="Promise",D=j.CONSTRUCTOR,N=j.REJECTION_EVENT,O=j.SUBCLASSING,M=S.getterFor(T),A=S.set,R=P&&P.prototype,I=P,L=R,B=c.TypeError,F=c.document,z=c.process,V=C.f,G=V,H=!!(F&&F.createEvent&&c.dispatchEvent),W="unhandledrejection",q=function(e){var t;return!(!m(e)||!g(t=e.then))&&t},Y=function(e,t){var n,r,i,o=t.value,a=1==t.state,s=a?e.ok:e.fail,l=e.resolve,c=e.reject,d=e.domain;try{s?(a||(2===t.rejection&&Z(t),t.rejection=1),!0===s?n=o:(d&&d.enter(),n=s(o),d&&(d.exit(),i=!0)),n===e.promise?c(B("Promise-chain cycle")):(r=q(n))?u(r,n,l,c):l(n)):c(o)}catch(h){d&&!i&&d.exit(),c(h)}},U=function(e,t){e.notified||(e.notified=!0,w((function(){for(var n,r=e.reactions;n=r.get();)Y(n,e);e.notified=!1,t&&!e.rejection&&$(e)})))},X=function(e,t,n){var r,i;H?((r=F.createEvent("Event")).promise=t,r.reason=n,r.initEvent(e,!1,!0),c.dispatchEvent(r)):r={promise:t,reason:n},!N&&(i=c["on"+e])?i(r):e===W&&E("Unhandled promise rejection",n)},$=function(e){u(x,c,(function(){var t,n=e.facade,r=e.value;if(K(e)&&(t=_((function(){l?z.emit("unhandledRejection",r,n):X(W,n,r)})),e.rejection=l||K(e)?2:1,t.error))throw t.value}))},K=function(e){return 1!==e.rejection&&!e.parent},Z=function(e){u(x,c,(function(){var t=e.facade;l?z.emit("rejectionHandled",t):X("rejectionhandled",t,e.value)}))},Q=function(e,t,n){return function(r){e(t,r,n)}},J=function(e,t,n){e.done||(e.done=!0,n&&(e=n),e.value=t,e.state=2,U(e,!0))},ee=function(e,t,n){if(!e.done){e.done=!0,n&&(e=n);try{if(e.facade===t)throw B("Promise can't be resolved itself");var r=q(t);r?w((function(){var n={done:!1};try{u(r,t,Q(ee,n,e),Q(J,n,e))}catch(i){J(n,i,e)}})):(e.value=t,e.state=1,U(e,!1))}catch(i){J({done:!1},i,e)}}};if(D&&(L=(I=function(e){y(this,L),v(e),u(r,this);var t=M(this);try{e(Q(ee,t),Q(J,t))}catch(n){J(t,n)}}).prototype,(r=function(e){A(this,{type:T,done:!1,notified:!1,parent:!1,reactions:new k,rejection:!1,state:0,value:void 0})}).prototype=d(L,"then",(function(e,t){var n=M(this),r=V(b(this,I));return n.parent=!0,r.ok=!g(e)||e,r.fail=g(t)&&t,r.domain=l?z.domain:void 0,0==n.state?n.reactions.add(r):w((function(){Y(r,n)})),r.promise})),i=function(){var e=new r,t=M(e);this.promise=e,this.resolve=Q(ee,t),this.reject=Q(J,t)},C.f=V=function(e){return e===I||undefined===e?new i(e):G(e)},!s&&g(P)&&R!==Object.prototype)){o=R.then,O||d(R,"then",(function(e,t){var n=this;return new I((function(e,t){u(o,n,e,t)})).then(e,t)}),{unsafe:!0});try{delete R.constructor}catch(te){}h&&h(R,L)}a({global:!0,constructor:!0,wrap:!0,forced:D},{Promise:I}),f(I,T,!1,!0),p(T)},73439:(e,t,n)=>{n(86087),n(56032),n(6135),n(26767),n(39320),n(52047)},26767:(e,t,n)=>{"use strict";var r=n(23103),i=n(20266),o=n(77111),a=n(16485),s=n(64624),l=n(89003);r({target:"Promise",stat:!0,forced:n(96866)},{race:function(e){var t=this,n=a.f(t),r=n.reject,c=s((function(){var a=o(t.resolve);l(e,(function(e){i(a,t,e).then(n.resolve,r)}))}));return c.error&&r(c.value),n.promise}})},39320:(e,t,n)=>{"use strict";var r=n(23103),i=n(20266),o=n(16485);r({target:"Promise",stat:!0,forced:n(38321).CONSTRUCTOR},{reject:function(e){var t=o.f(this);return i(t.reject,void 0,e),t.promise}})},52047:(e,t,n)=>{"use strict";var r=n(23103),i=n(31333),o=n(24231),a=n(74473),s=n(38321).CONSTRUCTOR,l=n(62391),c=i("Promise"),u=o&&!s;r({target:"Promise",stat:!0,forced:o||s},{resolve:function(e){return l(u&&this===c?a:this,e)}})},77950:(e,t,n)=>{"use strict";var r=n(23103),i=n(63466);r({target:"RegExp",proto:!0,forced:/./.exec!==i},{exec:i})},31235:(e,t,n)=>{"use strict";var r=n(23103),i=n(65968),o=n(47272),a=n(58885),s=n(83326),l=n(48127),c=i("".indexOf);r({target:"String",proto:!0,forced:!l("includes")},{includes:function(e){return!!~c(s(a(this)),s(o(e)),arguments.length>1?arguments[1]:void 0)}})},85940:(e,t,n)=>{"use strict";var r=n(53171),i=n(20266),o=n(65968),a=n(94954),s=n(24229),l=n(21176),c=n(26733),u=n(9650),d=n(43329),h=n(34237),f=n(83326),p=n(58885),v=n(36637),g=n(55300),m=n(70017),y=n(98115),b=n(70095)("replace"),x=Math.max,w=Math.min,E=o([].concat),_=o([].push),k=o("".indexOf),S=o("".slice),P="$0"==="a".replace(/./,"$0"),j=!!/./[b]&&""===/./[b]("a","$0");a("replace",(function(e,t,n){var o=j?"$":"$0";return[function(e,n){var r=p(this),o=u(e)?void 0:g(e,b);return o?i(o,e,r,n):i(t,f(r),e,n)},function(e,i){var a=l(this),s=f(e);if("string"==typeof i&&-1===k(i,o)&&-1===k(i,"$<")){var u=n(t,a,s,i);if(u.done)return u.value}var p=c(i);p||(i=f(i));var g=a.global;if(g){var b=a.unicode;a.lastIndex=0}for(var P=[];;){var j=y(a,s);if(null===j)break;if(_(P,j),!g)break;""===f(j[0])&&(a.lastIndex=v(s,h(a.lastIndex),b))}for(var C,T="",D=0,N=0;N<P.length;N++){for(var O=f((j=P[N])[0]),M=x(w(d(j.index),s.length),0),A=[],R=1;R<j.length;R++)_(A,void 0===(C=j[R])?C:String(C));var I=j.groups;if(p){var L=E([O],A,M,s);void 0!==I&&_(L,I);var B=f(r(i,void 0,L))}else B=m(O,s,M,A,I,i);M>=D&&(T+=S(s,D,M)+B,D=M+O.length)}return T+S(s,D)}]}),!!s((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}))||!P||j)},94908:(e,t,n)=>{"use strict";var r=n(20266),i=n(94954),o=n(21176),a=n(9650),s=n(58885),l=n(72101),c=n(83326),u=n(55300),d=n(98115);i("search",(function(e,t,n){return[function(t){var n=s(this),i=a(t)?void 0:u(t,e);return i?r(i,t,n):new RegExp(t)[e](c(n))},function(e){var r=o(this),i=c(e),a=n(t,r,i);if(a.done)return a.value;var s=r.lastIndex;l(s,0)||(r.lastIndex=0);var u=d(r,i);return l(r.lastIndex,s)||(r.lastIndex=s),null===u?-1:u.index}]}))},6886:(e,t,n)=>{var r=n(9859),i=n(95694),o=n(18865),a=n(15735),s=n(75762),l=n(70095),c=l("iterator"),u=l("toStringTag"),d=a.values,h=function(e,t){if(e){if(e[c]!==d)try{s(e,c,d)}catch(r){e[c]=d}if(e[u]||s(e,u,t),i[t])for(var n in a)if(e[n]!==a[n])try{s(e,n,a[n])}catch(r){e[n]=a[n]}}};for(var f in i)h(r[f]&&r[f].prototype,f);h(o,"DOMTokenList")},81368:function(e,t,n){var r;r=function(e){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,(function(t){return e[t]}).bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){var r=n(1),i=function(e){e&&e("layout","dagre",r)};"undefined"!=typeof cytoscape&&i(cytoscape),e.exports=i},function(e,t,n){function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}var i=n(2),o=n(3),a=n(4);function s(e){this.options=o({},i,e)}s.prototype.run=function(){var e=this.options,t=e.cy,n=e.eles,i=function(e,t){return"function"==typeof t?t.apply(e,[e]):t},o=e.boundingBox||{x1:0,y1:0,w:t.width(),h:t.height()};void 0===o.x2&&(o.x2=o.x1+o.w),void 0===o.w&&(o.w=o.x2-o.x1),void 0===o.y2&&(o.y2=o.y1+o.h),void 0===o.h&&(o.h=o.y2-o.y1);var s=new a.graphlib.Graph({multigraph:!0,compound:!0}),l={},c=function(e,t){null!=t&&(l[e]=t)};c("nodesep",e.nodeSep),c("edgesep",e.edgeSep),c("ranksep",e.rankSep),c("rankdir",e.rankDir),c("align",e.align),c("ranker",e.ranker),c("acyclicer",e.acyclicer),s.setGraph(l),s.setDefaultEdgeLabel((function(){return{}})),s.setDefaultNodeLabel((function(){return{}}));for(var u=n.nodes(),d=0;d<u.length;d++){var h=u[d],f=h.layoutDimensions(e);s.setNode(h.id(),{width:f.w,height:f.h,name:h.id()})}for(var p=0;p<u.length;p++){var v=u[p];v.isChild()&&s.setParent(v.id(),v.parent().id())}for(var g=n.edges().stdFilter((function(e){return!e.source().isParent()&&!e.target().isParent()})),m=0;m<g.length;m++){var y=g[m];s.setEdge(y.source().id(),y.target().id(),{minlen:i(y,e.minLen),weight:i(y,e.edgeWeight),name:y.id()},y.id())}a.layout(s);for(var b,x=s.nodes(),w=0;w<x.length;w++){var E=x[w],_=s.node(E);t.getElementById(E).scratch().dagre=_}return e.boundingBox?(b={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0},u.forEach((function(e){var t=e.scratch().dagre;b.x1=Math.min(b.x1,t.x),b.x2=Math.max(b.x2,t.x),b.y1=Math.min(b.y1,t.y),b.y2=Math.max(b.y2,t.y)})),b.w=b.x2-b.x1,b.h=b.y2-b.y1):b=o,u.layoutPositions(this,e,(function(t){var n=(t="object"===r(t)?t:this).scratch().dagre;return function(t){if(e.boundingBox){var n=0===b.w?0:(t.x-b.x1)/b.w,r=0===b.h?0:(t.y-b.y1)/b.h;return{x:o.x1+n*o.w,y:o.y1+r*o.h}}return t}({x:n.x,y:n.y})})),this},e.exports=s},function(e,t){var n={nodeSep:void 0,edgeSep:void 0,rankSep:void 0,rankDir:void 0,align:void 0,ranker:void 0,minLen:function(e){return 1},edgeWeight:function(e){return 1},fit:!0,padding:30,spacingFactor:void 0,nodeDimensionsIncludeLabels:!1,animate:!1,animateFilter:function(e,t){return!0},animationDuration:500,animationEasing:void 0,boundingBox:void 0,transform:function(e,t){return t},ready:function(){},stop:function(){}};e.exports=n},function(e,t){e.exports=null!=Object.assign?Object.assign.bind(Object):function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return n.forEach((function(t){Object.keys(t).forEach((function(n){return e[n]=t[n]}))})),e}},function(t,n){t.exports=e}])},e.exports=r(n(46506))},10404:function(e,t,n){var r;r=function(e){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.i=function(e){return e},n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=7)}([function(e,t,n){"use strict";e.exports=null!=Object.assign?Object.assign.bind(Object):function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return n.forEach((function(t){null!=t&&Object.keys(t).forEach((function(n){return e[n]=t[n]}))})),e}},function(e,t,n){"use strict";var r=n(5).getBoundingBox;e.exports={getRef:function(e,t){return{getBoundingClientRect:function(){return r(e,t)}}}}},function(e,t,n){"use strict";var r=n(0),i=n(1).getRef,o=n(6).getContent,a={},s=n(8).createPopper;e.exports={getPopper:function(e,t){var n=i(e,t),l=o(e,t.content),c=r({},a,t.popper);return s(n,l,c)}}},function(e,t,n){"use strict";var r=n(0),i=n(2).getPopper,o=n(1).getRef;function a(e,t){var n=function(e){return e.isNode()?{w:e.renderedWidth(),h:e.renderedHeight()}:{w:3,h:3}},i=e.cy(),o={renderedDimensions:n,renderedPosition:function(e){return e.isNode()?function(e,t){var n=e.renderedPosition(),r=t(e),i=r.w/2,o=r.h/2;return{x:n.x-i,y:n.y-o}}(e,n):function(e){var t=e.midpoint(),n=e.cy().pan(),r=e.cy().zoom();return{x:t.x*r+n.x,y:t.y*r+n.y}}(e)},popper:{},cy:i};return r({},o,t)}function s(e){e.length>1&&(console.warn("Popper.js Extension should only be used on one element."),console.warn("Ignoring all subsequent elements"))}e.exports={popper:function(e){return s(this),i(this[0],a(this[0],e))},popperRef:function(e){return s(this),o(this[0],a(this[0],e))}}},function(e,t,n){"use strict";var r=n(0),i=n(2).getPopper,o=n(1).getRef;function a(e,t){return r({},{boundingBox:{top:0,left:0,right:0,bottom:0,w:3,h:3},renderedDimensions:function(){return{w:3,h:3}},renderedPosition:function(){return{x:0,y:0}},popper:{},cy:e},t)}e.exports={popper:function(e){return i(this,a(this,e))},popperRef:function(e){return o(this,a(this,e))}}},function(e,t,n){"use strict";e.exports={getBoundingBox:function(e,t){var n=t.renderedPosition,r=t.cy,i=t.renderedDimensions,o=r.container().getBoundingClientRect(),a=i(e),s=n(e);return{top:s.y+o.top,left:s.x+o.left,right:s.x+a.w+o.left,bottom:s.y+a.h+o.top,width:a.w,height:a.h}}}},function(e,t,n){"use strict";e.exports={getContent:function(e,t){var n=null;if("function"!=typeof t){if(t instanceof HTMLElement)return t;throw new Error("Can not create popper from 'target' with unknown type")}if(null===(n=t(e)))throw new Error("No 'target' specified to create popper");return n}}},function(e,t,n){"use strict";var r=n(4),i=n(3),o=function(e){e&&(e("core","popper",r.popper),e("collection","popper",i.popper),e("core","popperRef",r.popperRef),e("collection","popperRef",i.popperRef))};"undefined"!=typeof cytoscape&&o(cytoscape),e.exports=o},function(t,n){t.exports=e}])},e.exports=r(n(52749))},93218:(e,t,n)=>{"use strict";var r=n(54073),i=n(71254),o=n(72579),a=n(16765),s=n(25497);function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=l(r),u=l(i),d=l(o),h=l(a),f=l(s);function p(e){return p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},p(e)}function v(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function g(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function m(e,t,n){return t&&g(e.prototype,t),n&&g(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function y(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function b(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,i,o=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);a=!0);}catch(l){s=!0,i=l}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return x(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return x(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function x(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var w="undefined"==typeof window?null:window,E=w?w.navigator:null;w&&w.document;var _=p(""),k=p({}),S=p((function(){})),P="undefined"==typeof HTMLElement?"undefined":p(HTMLElement),j=function(e){return e&&e.instanceString&&T(e.instanceString)?e.instanceString():null},C=function(e){return null!=e&&p(e)==_},T=function(e){return null!=e&&p(e)===S},D=function(e){return!A(e)&&(Array.isArray?Array.isArray(e):null!=e&&e instanceof Array)},N=function(e){return null!=e&&p(e)===k&&!D(e)&&e.constructor===Object},O=function(e){return null!=e&&p(e)===p(1)&&!isNaN(e)},M=function(e){return"undefined"===P?void 0:null!=e&&e instanceof HTMLElement},A=function(e){return R(e)||I(e)},R=function(e){return"collection"===j(e)&&e._private.single},I=function(e){return"collection"===j(e)&&!e._private.single},L=function(e){return"core"===j(e)},B=function(e){return"stylesheet"===j(e)},F=function(e){return null==e||!(""!==e&&!e.match(/^\s+$/))},z=function(e){return function(e){return null!=e&&p(e)===k}(e)&&T(e.then)},V=function(e,t){t||(t=function(){if(1===arguments.length)return arguments[0];if(0===arguments.length)return"undefined";for(var e=[],t=0;t<arguments.length;t++)e.push(arguments[t]);return e.join("$")});var n=function n(){var r,i=this,o=arguments,a=t.apply(i,o),s=n.cache;return(r=s[a])||(r=s[a]=e.apply(i,o)),r};return n.cache={},n},G=V((function(e){return e.replace(/([A-Z])/g,(function(e){return"-"+e.toLowerCase()}))})),H=V((function(e){return e.replace(/(-\w)/g,(function(e){return e[1].toUpperCase()}))})),W=V((function(e,t){return e+t[0].toUpperCase()+t.substring(1)}),(function(e,t){return e+"$"+t})),q=function(e){return F(e)?e:e.charAt(0).toUpperCase()+e.substring(1)},Y="(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))",U=function(e,t){return e<t?-1:e>t?1:0},X=null!=Object.assign?Object.assign.bind(Object):function(e){for(var t=arguments,n=1;n<t.length;n++){var r=t[n];if(null!=r)for(var i=Object.keys(r),o=0;o<i.length;o++){var a=i[o];e[a]=r[a]}}return e},$=function(e){return(D(e)?e:null)||function(e){return K[e.toLowerCase()]}(e)||function(e){if((4===e.length||7===e.length)&&"#"===e[0]){var t,n,r,i=16;return 4===e.length?(t=parseInt(e[1]+e[1],i),n=parseInt(e[2]+e[2],i),r=parseInt(e[3]+e[3],i)):(t=parseInt(e[1]+e[2],i),n=parseInt(e[3]+e[4],i),r=parseInt(e[5]+e[6],i)),[t,n,r]}}(e)||function(e){var t,n=new RegExp("^rgb[a]?\\(((?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))[%]?)\\s*,\\s*((?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))[%]?)\\s*,\\s*((?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))[%]?)(?:\\s*,\\s*((?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))))?\\)$").exec(e);if(n){t=[];for(var r=[],i=1;i<=3;i++){var o=n[i];if("%"===o[o.length-1]&&(r[i]=!0),o=parseFloat(o),r[i]&&(o=o/100*255),o<0||o>255)return;t.push(Math.floor(o))}var a=r[1]||r[2]||r[3],s=r[1]&&r[2]&&r[3];if(a&&!s)return;var l=n[4];if(void 0!==l){if((l=parseFloat(l))<0||l>1)return;t.push(l)}}return t}(e)||function(e){var t,n,r,i,o,a,s,l;function c(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}var u=new RegExp("^hsl[a]?\\(((?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?)))\\s*,\\s*((?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))[%])\\s*,\\s*((?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))[%])(?:\\s*,\\s*((?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))))?\\)$").exec(e);if(u){if((n=parseInt(u[1]))<0?n=(360- -1*n%360)%360:n>360&&(n%=360),n/=360,(r=parseFloat(u[2]))<0||r>100)return;if(r/=100,(i=parseFloat(u[3]))<0||i>100)return;if(i/=100,void 0!==(o=u[4])&&((o=parseFloat(o))<0||o>1))return;if(0===r)a=s=l=Math.round(255*i);else{var d=i<.5?i*(1+r):i+r-i*r,h=2*i-d;a=Math.round(255*c(h,d,n+1/3)),s=Math.round(255*c(h,d,n)),l=Math.round(255*c(h,d,n-1/3))}t=[a,s,l,o]}return t}(e)},K={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]},Z=function(e){for(var t=e.map,n=e.keys,r=n.length,i=0;i<r;i++){var o=n[i];if(N(o))throw Error("Tried to set map with object key");i<n.length-1?(null==t[o]&&(t[o]={}),t=t[o]):t[o]=e.value}},Q=function(e){for(var t=e.map,n=e.keys,r=n.length,i=0;i<r;i++){var o=n[i];if(N(o))throw Error("Tried to get map with object key");if(null==(t=t[o]))return t}return t},J=w?w.performance:null,ee=J&&J.now?function(){return J.now()}:function(){return Date.now()},te=function(){if(w){if(w.requestAnimationFrame)return function(e){w.requestAnimationFrame(e)};if(w.mozRequestAnimationFrame)return function(e){w.mozRequestAnimationFrame(e)};if(w.webkitRequestAnimationFrame)return function(e){w.webkitRequestAnimationFrame(e)};if(w.msRequestAnimationFrame)return function(e){w.msRequestAnimationFrame(e)}}return function(e){e&&setTimeout((function(){e(ee())}),1e3/60)}}(),ne=function(e){return te(e)},re=ee,ie=9261,oe=65599,ae=5381,se=function(e){for(var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ie,r=n;!(t=e.next()).done;)r=r*oe+t.value|0;return r},le=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ie;return t*oe+e|0},ce=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ae;return(t<<5)+t+e|0},ue=function(e){return 2097152*e[0]+e[1]},de=function(e,t){return[le(e[0],t[0]),ce(e[1],t[1])]},he=function(e,t){var n={value:0,done:!1},r=0,i=e.length;return se({next:function(){return r<i?n.value=e.charCodeAt(r++):n.done=!0,n}},t)},fe=function(){return pe(arguments)},pe=function(e){for(var t,n=0;n<e.length;n++){var r=e[n];t=0===n?he(r):he(r,t)}return t},ve=!0,ge=null!=console.warn,me=null!=console.trace,ye=Number.MAX_SAFE_INTEGER||9007199254740991,be=function(){return!0},xe=function(){return!1},we=function(){return 0},Ee=function(){},_e=function(e){throw new Error(e)},ke=function(e){if(void 0===e)return ve;ve=!!e},Se=function(e){ke()&&(ge?console.warn(e):(console.log(e),me&&console.trace()))},Pe=function(e){return null==e?e:D(e)?e.slice():N(e)?function(e){return X({},e)}(e):e},je=function(e,t){for(t=e="";e++<36;t+=51*e&52?(15^e?8^Math.random()*(20^e?16:4):4).toString(16):"-");return t},Ce={},Te=function(){return Ce},De=function(e){var t=Object.keys(e);return function(n){for(var r={},i=0;i<t.length;i++){var o=t[i],a=null==n?void 0:n[o];r[o]=void 0===a?e[o]:a}return r}},Ne=function(e,t,n){for(var r=e.length-1;r>=0&&(e[r]!==t||(e.splice(r,1),!n));r--);},Oe=function(e){e.splice(0,e.length)},Me=function(e,t,n){return n&&(t=W(n,t)),e[t]},Ae=function(e,t,n,r){n&&(t=W(n,t)),e[t]=r},Re="undefined"!=typeof Map?Map:function(){function e(){v(this,e),this._obj={}}return m(e,[{key:"set",value:function(e,t){return this._obj[e]=t,this}},{key:"delete",value:function(e){return this._obj[e]=void 0,this}},{key:"clear",value:function(){this._obj={}}},{key:"has",value:function(e){return void 0!==this._obj[e]}},{key:"get",value:function(e){return this._obj[e]}}]),e}(),Ie=function(){function e(t){if(v(this,e),this._obj=Object.create(null),this.size=0,null!=t){var n;n=null!=t.instanceString&&t.instanceString()===this.instanceString()?t.toArray():t;for(var r=0;r<n.length;r++)this.add(n[r])}}return m(e,[{key:"instanceString",value:function(){return"set"}},{key:"add",value:function(e){var t=this._obj;1!==t[e]&&(t[e]=1,this.size++)}},{key:"delete",value:function(e){var t=this._obj;1===t[e]&&(t[e]=0,this.size--)}},{key:"clear",value:function(){this._obj=Object.create(null)}},{key:"has",value:function(e){return 1===this._obj[e]}},{key:"toArray",value:function(){var e=this;return Object.keys(this._obj).filter((function(t){return e.has(t)}))}},{key:"forEach",value:function(e,t){return this.toArray().forEach(e,t)}}]),e}(),Le="undefined"!==("undefined"==typeof Set?"undefined":p(Set))?Set:Ie,Be=function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(void 0!==e&&void 0!==t&&L(e)){var r=t.group;if(null==r&&(r=t.data&&null!=t.data.source&&null!=t.data.target?"edges":"nodes"),"nodes"===r||"edges"===r){this.length=1,this[0]=this;var i=this._private={cy:e,single:!0,data:t.data||{},position:t.position||{x:0,y:0},autoWidth:void 0,autoHeight:void 0,autoPadding:void 0,compoundBoundsClean:!1,listeners:[],group:r,style:{},rstyle:{},styleCxts:[],styleKeys:{},removed:!0,selected:!!t.selected,selectable:void 0===t.selectable||!!t.selectable,locked:!!t.locked,grabbed:!1,grabbable:void 0===t.grabbable||!!t.grabbable,pannable:void 0===t.pannable?"edges"===r:!!t.pannable,active:!1,classes:new Le,animation:{current:[],queue:[]},rscratch:{},scratch:t.scratch||{},edges:[],children:[],parent:t.parent&&t.parent.isNode()?t.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(null==i.position.x&&(i.position.x=0),null==i.position.y&&(i.position.y=0),t.renderedPosition){var o=t.renderedPosition,a=e.pan(),s=e.zoom();i.position={x:(o.x-a.x)/s,y:(o.y-a.y)/s}}var l=[];D(t.classes)?l=t.classes:C(t.classes)&&(l=t.classes.split(/\s+/));for(var c=0,u=l.length;c<u;c++){var d=l[c];d&&""!==d&&i.classes.add(d)}this.createEmitter();var h=t.style||t.css;h&&(Se("Setting a `style` bypass at element creation should be done only when absolutely necessary. Try to use the stylesheet instead."),this.style(h)),(void 0===n||n)&&this.restore()}else _e("An element must be of type `nodes` or `edges`; you specified `"+r+"`")}else _e("An element must have a core reference and parameters set")},Fe=function(e){return e={bfs:e.bfs||!e.dfs,dfs:e.dfs||!e.bfs},function(t,n,r){var i;N(t)&&!A(t)&&(t=(i=t).roots||i.root,n=i.visit,r=i.directed),r=2!==arguments.length||T(n)?r:n,n=T(n)?n:function(){};for(var o,a=this._private.cy,s=t=C(t)?this.filter(t):t,l=[],c=[],u={},d={},h={},f=0,p=this.byGroup(),v=p.nodes,g=p.edges,m=0;m<s.length;m++){var y=s[m],b=y.id();y.isNode()&&(l.unshift(y),e.bfs&&(h[b]=!0,c.push(y)),d[b]=0)}for(var x=function(){var t=e.bfs?l.shift():l.pop(),i=t.id();if(e.dfs){if(h[i])return"continue";h[i]=!0,c.push(t)}var a,s=d[i],p=u[i],m=null!=p?p.source():null,y=null!=p?p.target():null,b=null==p?void 0:t.same(m)?y[0]:m[0];if(!0===(a=n(t,p,b,f++,s)))return o=t,"break";if(!1===a)return"break";for(var x=t.connectedEdges().filter((function(e){return(!r||e.source().same(t))&&g.has(e)})),w=0;w<x.length;w++){var E=x[w],_=E.connectedNodes().filter((function(e){return!e.same(t)&&v.has(e)})),k=_.id();0===_.length||h[k]||(_=_[0],l.push(_),e.bfs&&(h[k]=!0,c.push(_)),u[k]=E,d[k]=d[i]+1)}};0!==l.length;){var w=x();if("continue"!==w&&"break"===w)break}for(var E=a.collection(),_=0;_<c.length;_++){var k=c[_],S=u[k.id()];null!=S&&E.push(S),E.push(k)}return{path:a.collection(E),found:a.collection(o)}}},ze={breadthFirstSearch:Fe({bfs:!0}),depthFirstSearch:Fe({dfs:!0})};ze.bfs=ze.breadthFirstSearch,ze.dfs=ze.depthFirstSearch;var Ve=De({root:null,weight:function(e){return 1},directed:!1}),Ge={dijkstra:function(e){if(!N(e)){var t=arguments;e={root:t[0],weight:t[1],directed:t[2]}}var n=Ve(e),r=n.root,i=n.weight,o=n.directed,a=this,s=i,l=C(r)?this.filter(r)[0]:r[0],c={},d={},h={},f=this.byGroup(),p=f.nodes,v=f.edges;v.unmergeBy((function(e){return e.isLoop()}));for(var g=function(e){return c[e.id()]},m=function(e,t){c[e.id()]=t,y.updateItem(e)},y=new u.default((function(e,t){return g(e)-g(t)})),b=0;b<p.length;b++){var x=p[b];c[x.id()]=x.same(l)?0:1/0,y.push(x)}for(var w=function(e,t){for(var n,r=(o?e.edgesTo(t):e.edgesWith(t)).intersect(v),i=1/0,a=0;a<r.length;a++){var l=r[a],c=s(l);(c<i||!n)&&(i=c,n=l)}return{edge:n,dist:i}};y.size()>0;){var E=y.pop(),_=g(E),k=E.id();if(h[k]=_,_!==1/0)for(var S=E.neighborhood().intersect(p),P=0;P<S.length;P++){var j=S[P],T=j.id(),D=w(E,j),O=_+D.dist;O<g(j)&&(m(j,O),d[T]={node:E,edge:D.edge})}}return{distanceTo:function(e){var t=C(e)?p.filter(e)[0]:e[0];return h[t.id()]},pathTo:function(e){var t=C(e)?p.filter(e)[0]:e[0],n=[],r=t,i=r.id();if(t.length>0)for(n.unshift(t);d[i];){var o=d[i];n.unshift(o.edge),n.unshift(o.node),i=(r=o.node).id()}return a.spawn(n)}}}},He={kruskal:function(e){e=e||function(e){return 1};for(var t=this.byGroup(),n=t.nodes,r=t.edges,i=n.length,o=new Array(i),a=n,s=function(e){for(var t=0;t<o.length;t++){if(o[t].has(e))return t}},l=0;l<i;l++)o[l]=this.spawn(n[l]);for(var c=r.sort((function(t,n){return e(t)-e(n)})),u=0;u<c.length;u++){var d=c[u],h=d.source()[0],f=d.target()[0],p=s(h),v=s(f),g=o[p],m=o[v];p!==v&&(a.merge(d),g.merge(m),o.splice(v,1))}return a}},We=De({root:null,goal:null,weight:function(e){return 1},heuristic:function(e){return 0},directed:!1}),qe={aStar:function(e){var t=this.cy(),n=We(e),r=n.root,i=n.goal,o=n.heuristic,a=n.directed,s=n.weight;r=t.collection(r)[0],i=t.collection(i)[0];var l,c,d=r.id(),h=i.id(),f={},p={},v={},g=new u.default((function(e,t){return p[e.id()]-p[t.id()]})),m=new Le,y={},b={},x=function(e,t){g.push(e),m.add(t)};x(r,d),f[d]=0,p[d]=o(r);for(var w,E=0;g.size()>0;){if(l=g.pop(),c=l.id(),m.delete(c),E++,c===h){for(var _=[],k=i,S=h,P=b[S];_.unshift(k),null!=P&&_.unshift(P),null!=(k=y[S]);)P=b[S=k.id()];return{found:!0,distance:f[c],path:this.spawn(_),steps:E}}v[c]=!0;for(var j=l._private.edges,C=0;C<j.length;C++){var T=j[C];if(this.hasElementWithId(T.id())&&(!a||T.data("source")===c)){var D=T.source(),N=T.target(),O=D.id()!==c?D:N,M=O.id();if(this.hasElementWithId(M)&&!v[M]){var A=f[c]+s(T);w=M,m.has(w)?A<f[M]&&(f[M]=A,p[M]=A+o(O),y[M]=l,b[M]=T):(f[M]=A,p[M]=A+o(O),x(O,M),y[M]=l,b[M]=T)}}}}return{found:!1,distance:void 0,path:void 0,steps:E}}},Ye=De({weight:function(e){return 1},directed:!1}),Ue={floydWarshall:function(e){for(var t=this.cy(),n=Ye(e),r=n.weight,i=n.directed,o=r,a=this.byGroup(),s=a.nodes,l=a.edges,c=s.length,u=c*c,d=function(e){return s.indexOf(e)},h=function(e){return s[e]},f=new Array(u),p=0;p<u;p++){var v=p%c,g=(p-v)/c;f[p]=g===v?0:1/0}for(var m=new Array(u),y=new Array(u),b=0;b<l.length;b++){var x=l[b],w=x.source()[0],E=x.target()[0];if(w!==E){var _=d(w),k=d(E),S=_*c+k,P=o(x);if(f[S]>P&&(f[S]=P,m[S]=k,y[S]=x),!i){var j=k*c+_;!i&&f[j]>P&&(f[j]=P,m[j]=_,y[j]=x)}}}for(var T=0;T<c;T++)for(var D=0;D<c;D++)for(var N=D*c+T,O=0;O<c;O++){var M=D*c+O,A=T*c+O;f[N]+f[A]<f[M]&&(f[M]=f[N]+f[A],m[M]=m[N])}var R=function(e){return d(function(e){return(C(e)?t.filter(e):e)[0]}(e))},I={distance:function(e,t){var n=R(e),r=R(t);return f[n*c+r]},path:function(e,n){var r=R(e),i=R(n),o=h(r);if(r===i)return o.collection();if(null==m[r*c+i])return t.collection();var a,s=t.collection(),l=r;for(s.merge(o);r!==i;)l=r,r=m[r*c+i],a=y[l*c+r],s.merge(a),s.merge(h(r));return s}};return I}},Xe=De({weight:function(e){return 1},directed:!1,root:null}),$e={bellmanFord:function(e){var t=this,n=Xe(e),r=n.weight,i=n.directed,o=n.root,a=r,s=this,l=this.cy(),c=this.byGroup(),u=c.edges,d=c.nodes,h=d.length,f=new Re,p=!1,v=[];o=l.collection(o)[0],u.unmergeBy((function(e){return e.isLoop()}));for(var g=u.length,m=function(e){var t=f.get(e.id());return t||(t={},f.set(e.id(),t)),t},y=function(e){return(C(e)?l.$(e):e)[0]},b=0;b<h;b++){var x=d[b],w=m(x);x.same(o)?w.dist=0:w.dist=1/0,w.pred=null,w.edge=null}for(var E=!1,_=function(e,t,n,r,i,o){var a=r.dist+o;a<i.dist&&!n.same(r.edge)&&(i.dist=a,i.pred=e,i.edge=n,E=!0)},k=1;k<h;k++){E=!1;for(var S=0;S<g;S++){var P=u[S],j=P.source(),T=P.target(),D=a(P),N=m(j),O=m(T);_(j,0,P,N,O,D),i||_(T,0,P,O,N,D)}if(!E)break}if(E)for(var M=[],A=0;A<g;A++){var R=u[A],I=R.source(),L=R.target(),B=a(R),F=m(I).dist,z=m(L).dist;if(F+B<z||!i&&z+B<F){if(p||(Se("Graph contains a negative weight cycle for Bellman-Ford"),p=!0),!1===e.findNegativeWeightCycles)break;var V=[];F+B<z&&V.push(I),!i&&z+B<F&&V.push(L);for(var G=V.length,H=0;H<G;H++){var W=V[H],q=[W];q.push(m(W).edge);for(var Y=m(W).pred;-1===q.indexOf(Y);)q.push(Y),q.push(m(Y).edge),Y=m(Y).pred;for(var U=(q=q.slice(q.indexOf(Y)))[0].id(),X=0,$=2;$<q.length;$+=2)q[$].id()<U&&(U=q[$].id(),X=$);(q=q.slice(X).concat(q.slice(0,X))).push(q[0]);var K=q.map((function(e){return e.id()})).join(",");-1===M.indexOf(K)&&(v.push(s.spawn(q)),M.push(K))}}}return{distanceTo:function(e){return m(y(e)).dist},pathTo:function(e){for(var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o,r=y(e),i=[],a=r;;){if(null==a)return t.spawn();var l=m(a),c=l.edge,u=l.pred;if(i.unshift(a[0]),a.same(n)&&i.length>0)break;null!=c&&i.unshift(c),a=u}return s.spawn(i)},hasNegativeWeightCycle:p,negativeWeightCycles:v}}},Ke=Math.sqrt(2),Ze=function(e,t,n){0===n.length&&_e("Karger-Stein must be run on a connected (sub)graph");for(var r=n[e],i=r[1],o=r[2],a=t[i],s=t[o],l=n,c=l.length-1;c>=0;c--){var u=l[c],d=u[1],h=u[2];(t[d]===a&&t[h]===s||t[d]===s&&t[h]===a)&&l.splice(c,1)}for(var f=0;f<l.length;f++){var p=l[f];p[1]===s?(l[f]=p.slice(),l[f][1]=a):p[2]===s&&(l[f]=p.slice(),l[f][2]=a)}for(var v=0;v<t.length;v++)t[v]===s&&(t[v]=a);return l},Qe=function(e,t,n,r){for(;n>r;){var i=Math.floor(Math.random()*t.length);t=Ze(i,e,t),n--}return t},Je={kargerStein:function(){var e=this,t=this.byGroup(),n=t.nodes,r=t.edges;r.unmergeBy((function(e){return e.isLoop()}));var i=n.length,o=r.length,a=Math.ceil(Math.pow(Math.log(i)/Math.LN2,2)),s=Math.floor(i/Ke);if(!(i<2)){for(var l=[],c=0;c<o;c++){var u=r[c];l.push([c,n.indexOf(u.source()),n.indexOf(u.target())])}for(var d=1/0,h=[],f=new Array(i),p=new Array(i),v=new Array(i),g=function(e,t){for(var n=0;n<i;n++)t[n]=e[n]},m=0;m<=a;m++){for(var y=0;y<i;y++)p[y]=y;var b=Qe(p,l.slice(),i,s),x=b.slice();g(p,v);var w=Qe(p,b,s,2),E=Qe(v,x,s,2);w.length<=E.length&&w.length<d?(d=w.length,h=w,g(p,f)):E.length<=w.length&&E.length<d&&(d=E.length,h=E,g(v,f))}for(var _=this.spawn(h.map((function(e){return r[e[0]]}))),k=this.spawn(),S=this.spawn(),P=f[0],j=0;j<f.length;j++){var C=f[j],T=n[j];C===P?k.merge(T):S.merge(T)}var D=function(t){var n=e.spawn();return t.forEach((function(t){n.merge(t),t.connectedEdges().forEach((function(t){e.contains(t)&&!_.contains(t)&&n.merge(t)}))})),n},N=[D(k),D(S)];return{cut:_,components:N,partition1:k,partition2:S}}_e("At least 2 nodes are required for Karger-Stein algorithm")}},et=function(e,t,n){return{x:e.x*t+n.x,y:e.y*t+n.y}},tt=function(e,t,n){return{x:(e.x-n.x)/t,y:(e.y-n.y)/t}},nt=function(e){return{x:e[0],y:e[1]}},rt=function(e,t){return Math.atan2(t,e)-Math.PI/2},it=Math.log2||function(e){return Math.log(e)/Math.log(2)},ot=function(e){return e>0?1:e<0?-1:0},at=function(e,t){return Math.sqrt(st(e,t))},st=function(e,t){var n=t.x-e.x,r=t.y-e.y;return n*n+r*r},lt=function(e){for(var t=e.length,n=0,r=0;r<t;r++)n+=e[r];for(var i=0;i<t;i++)e[i]=e[i]/n;return e},ct=function(e,t,n,r){return(1-r)*(1-r)*e+2*(1-r)*r*t+r*r*n},ut=function(e,t,n,r){return{x:ct(e.x,t.x,n.x,r),y:ct(e.y,t.y,n.y,r)}},dt=function(e,t,n){return Math.max(e,Math.min(n,t))},ht=function(e){if(null==e)return{x1:1/0,y1:1/0,x2:-1/0,y2:-1/0,w:0,h:0};if(null!=e.x1&&null!=e.y1){if(null!=e.x2&&null!=e.y2&&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(null!=e.w&&null!=e.h&&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}}},ft=function(e,t,n){e.x1=Math.min(e.x1,t),e.x2=Math.max(e.x2,t),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,n),e.y2=Math.max(e.y2,n),e.h=e.y2-e.y1},pt=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e.x1-=t,e.x2+=t,e.y1-=t,e.y2+=t,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},vt=function(e){var t,n,r,i,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0];if(1===o.length)t=n=r=i=o[0];else if(2===o.length)t=r=o[0],i=n=o[1];else if(4===o.length){var a=b(o,4);t=a[0],n=a[1],r=a[2],i=a[3]}return e.x1-=i,e.x2+=n,e.y1-=t,e.y2+=r,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},gt=function(e,t){e.x1=t.x1,e.y1=t.y1,e.x2=t.x2,e.y2=t.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1},mt=function(e,t){return!(e.x1>t.x2)&&(!(t.x1>e.x2)&&(!(e.x2<t.x1)&&(!(t.x2<e.x1)&&(!(e.y2<t.y1)&&(!(t.y2<e.y1)&&(!(e.y1>t.y2)&&!(t.y1>e.y2)))))))},yt=function(e,t,n){return e.x1<=t&&t<=e.x2&&e.y1<=n&&n<=e.y2},bt=function(e,t){return yt(e,t.x1,t.y1)&&yt(e,t.x2,t.y2)},xt=function(e,t,n,r,i,o,a){var s,l=Bt(i,o),c=i/2,u=o/2,d=r-u-a;if((s=Ot(e,t,n,r,n-c+l-a,d,n+c-l+a,d,!1)).length>0)return s;var h=n+c+a;if((s=Ot(e,t,n,r,h,r-u+l-a,h,r+u-l+a,!1)).length>0)return s;var f=r+u+a;if((s=Ot(e,t,n,r,n-c+l-a,f,n+c-l+a,f,!1)).length>0)return s;var p,v=n-c-a;if((s=Ot(e,t,n,r,v,r-u+l-a,v,r+u-l+a,!1)).length>0)return s;var g=n-c+l,m=r-u+l;if((p=Dt(e,t,n,r,g,m,l+a)).length>0&&p[0]<=g&&p[1]<=m)return[p[0],p[1]];var y=n+c-l,b=r-u+l;if((p=Dt(e,t,n,r,y,b,l+a)).length>0&&p[0]>=y&&p[1]<=b)return[p[0],p[1]];var x=n+c-l,w=r+u-l;if((p=Dt(e,t,n,r,x,w,l+a)).length>0&&p[0]>=x&&p[1]>=w)return[p[0],p[1]];var E=n-c+l,_=r+u-l;return(p=Dt(e,t,n,r,E,_,l+a)).length>0&&p[0]<=E&&p[1]>=_?[p[0],p[1]]:[]},wt=function(e,t,n,r,i,o,a){var s=a,l=Math.min(n,i),c=Math.max(n,i),u=Math.min(r,o),d=Math.max(r,o);return l-s<=e&&e<=c+s&&u-s<=t&&t<=d+s},Et=function(e,t,n,r,i,o,a,s,l){var c=Math.min(n,a,i)-l,u=Math.max(n,a,i)+l,d=Math.min(r,s,o)-l,h=Math.max(r,s,o)+l;return!(e<c||e>u||t<d||t>h)},_t=function(e,t,n,r,i,o,a,s){var l=[];!function(e,t,n,r,i){var o,a,s,l,c,u,d,h;0===e&&(e=1e-5),s=-27*(r/=e)+(t/=e)*(9*(n/=e)-t*t*2),o=(a=(3*n-t*t)/9)*a*a+(s/=54)*s,i[1]=0,d=t/3,o>0?(c=(c=s+Math.sqrt(o))<0?-Math.pow(-c,1/3):Math.pow(c,1/3),u=(u=s-Math.sqrt(o))<0?-Math.pow(-u,1/3):Math.pow(u,1/3),i[0]=-d+c+u,d+=(c+u)/2,i[4]=i[2]=-d,d=Math.sqrt(3)*(-u+c)/2,i[3]=d,i[5]=-d):(i[5]=i[3]=0,0===o?(h=s<0?-Math.pow(-s,1/3):Math.pow(s,1/3),i[0]=2*h-d,i[4]=i[2]=-(h+d)):(l=(a=-a)*a*a,l=Math.acos(s/Math.sqrt(l)),h=2*Math.sqrt(a),i[0]=-d+h*Math.cos(l/3),i[2]=-d+h*Math.cos((l+2*Math.PI)/3),i[4]=-d+h*Math.cos((l+4*Math.PI)/3)))}(1*n*n-4*n*i+2*n*a+4*i*i-4*i*a+a*a+r*r-4*r*o+2*r*s+4*o*o-4*o*s+s*s,9*n*i-3*n*n-3*n*a-6*i*i+3*i*a+9*r*o-3*r*r-3*r*s-6*o*o+3*o*s,3*n*n-6*n*i+n*a-n*e+2*i*i+2*i*e-a*e+3*r*r-6*r*o+r*s-r*t+2*o*o+2*o*t-s*t,1*n*i-n*n+n*e-i*e+r*o-r*r+r*t-o*t,l);for(var c=[],u=0;u<6;u+=2)Math.abs(l[u+1])<1e-7&&l[u]>=0&&l[u]<=1&&c.push(l[u]);c.push(1),c.push(0);for(var d,h,f,p=-1,v=0;v<c.length;v++)d=Math.pow(1-c[v],2)*n+2*(1-c[v])*c[v]*i+c[v]*c[v]*a,h=Math.pow(1-c[v],2)*r+2*(1-c[v])*c[v]*o+c[v]*c[v]*s,f=Math.pow(d-e,2)+Math.pow(h-t,2),p>=0?f<p&&(p=f):p=f;return p},kt=function(e,t,n,r,i,o){var a=[e-n,t-r],s=[i-n,o-r],l=s[0]*s[0]+s[1]*s[1],c=a[0]*a[0]+a[1]*a[1],u=a[0]*s[0]+a[1]*s[1],d=u*u/l;return u<0?c:d>l?(e-i)*(e-i)+(t-o)*(t-o):c-d},St=function(e,t,n){for(var r,i,o,a,s=0,l=0;l<n.length/2;l++)if(r=n[2*l],i=n[2*l+1],l+1<n.length/2?(o=n[2*(l+1)],a=n[2*(l+1)+1]):(o=n[2*(l+1-n.length/2)],a=n[2*(l+1-n.length/2)+1]),r==e&&o==e);else{if(!(r>=e&&e>=o||r<=e&&e<=o))continue;(e-r)/(o-r)*(a-i)+i>t&&s++}return s%2!=0},Pt=function(e,t,n,r,i,o,a,s,l){var c,u=new Array(n.length);null!=s[0]?(c=Math.atan(s[1]/s[0]),s[0]<0?c+=Math.PI/2:c=-c-Math.PI/2):c=s;for(var d,h=Math.cos(-c),f=Math.sin(-c),p=0;p<u.length/2;p++)u[2*p]=o/2*(n[2*p]*h-n[2*p+1]*f),u[2*p+1]=a/2*(n[2*p+1]*h+n[2*p]*f),u[2*p]+=r,u[2*p+1]+=i;if(l>0){var v=Ct(u,-l);d=jt(v)}else d=u;return St(e,t,d)},jt=function(e){for(var t,n,r,i,o,a,s,l,c=new Array(e.length/2),u=0;u<e.length/4;u++){t=e[4*u],n=e[4*u+1],r=e[4*u+2],i=e[4*u+3],u<e.length/4-1?(o=e[4*(u+1)],a=e[4*(u+1)+1],s=e[4*(u+1)+2],l=e[4*(u+1)+3]):(o=e[0],a=e[1],s=e[2],l=e[3]);var d=Ot(t,n,r,i,o,a,s,l,!0);c[2*u]=d[0],c[2*u+1]=d[1]}return c},Ct=function(e,t){for(var n,r,i,o,a=new Array(2*e.length),s=0;s<e.length/2;s++){n=e[2*s],r=e[2*s+1],s<e.length/2-1?(i=e[2*(s+1)],o=e[2*(s+1)+1]):(i=e[0],o=e[1]);var l=o-r,c=-(i-n),u=Math.sqrt(l*l+c*c),d=l/u,h=c/u;a[4*s]=n+d*t,a[4*s+1]=r+h*t,a[4*s+2]=i+d*t,a[4*s+3]=o+h*t}return a},Tt=function(e,t,n,r,i,o,a){return e-=i,t-=o,(e/=n/2+a)*e+(t/=r/2+a)*t<=1},Dt=function(e,t,n,r,i,o,a){var s=[n-e,r-t],l=[e-i,t-o],c=s[0]*s[0]+s[1]*s[1],u=2*(l[0]*s[0]+l[1]*s[1]),d=u*u-4*c*(l[0]*l[0]+l[1]*l[1]-a*a);if(d<0)return[];var h=(-u+Math.sqrt(d))/(2*c),f=(-u-Math.sqrt(d))/(2*c),p=Math.min(h,f),v=Math.max(h,f),g=[];if(p>=0&&p<=1&&g.push(p),v>=0&&v<=1&&g.push(v),0===g.length)return[];var m=g[0]*s[0]+e,y=g[0]*s[1]+t;return g.length>1?g[0]==g[1]?[m,y]:[m,y,g[1]*s[0]+e,g[1]*s[1]+t]:[m,y]},Nt=function(e,t,n){return t<=e&&e<=n||n<=e&&e<=t?e:e<=t&&t<=n||n<=t&&t<=e?t:n},Ot=function(e,t,n,r,i,o,a,s,l){var c=e-i,u=n-e,d=a-i,h=t-o,f=r-t,p=s-o,v=d*h-p*c,g=u*h-f*c,m=p*u-d*f;if(0!==m){var y=v/m,b=g/m,x=-.001;return x<=y&&y<=1.001&&x<=b&&b<=1.001||l?[e+y*u,t+y*f]:[]}return 0===v||0===g?Nt(e,n,a)===a?[a,s]:Nt(e,n,i)===i?[i,o]:Nt(i,a,n)===n?[n,r]:[]:[]},Mt=function(e,t,n,r,i,o,a,s){var l,c,u,d,h,f,p=[],v=new Array(n.length),g=!0;if(null==o&&(g=!1),g){for(var m=0;m<v.length/2;m++)v[2*m]=n[2*m]*o+r,v[2*m+1]=n[2*m+1]*a+i;if(s>0){var y=Ct(v,-s);c=jt(y)}else c=v}else c=n;for(var b=0;b<c.length/2;b++)u=c[2*b],d=c[2*b+1],b<c.length/2-1?(h=c[2*(b+1)],f=c[2*(b+1)+1]):(h=c[0],f=c[1]),0!==(l=Ot(e,t,r,i,u,d,h,f)).length&&p.push(l[0],l[1]);return p},At=function(e,t,n){var r=[e[0]-t[0],e[1]-t[1]],i=Math.sqrt(r[0]*r[0]+r[1]*r[1]),o=(i-n)/i;return o<0&&(o=1e-5),[t[0]+o*r[0],t[1]+o*r[1]]},Rt=function(e,t){var n=Lt(e,t);return n=It(n)},It=function(e){for(var t,n,r=e.length/2,i=1/0,o=1/0,a=-1/0,s=-1/0,l=0;l<r;l++)t=e[2*l],n=e[2*l+1],i=Math.min(i,t),a=Math.max(a,t),o=Math.min(o,n),s=Math.max(s,n);for(var c=2/(a-i),u=2/(s-o),d=0;d<r;d++)t=e[2*d]=e[2*d]*c,n=e[2*d+1]=e[2*d+1]*u,i=Math.min(i,t),a=Math.max(a,t),o=Math.min(o,n),s=Math.max(s,n);if(o<-1)for(var h=0;h<r;h++)n=e[2*h+1]=e[2*h+1]+(-1-o);return e},Lt=function(e,t){var n=1/e*2*Math.PI,r=e%2==0?Math.PI/2+n/2:Math.PI/2;r+=t;for(var i,o=new Array(2*e),a=0;a<e;a++)i=a*n+r,o[2*a]=Math.cos(i),o[2*a+1]=Math.sin(-i);return o},Bt=function(e,t){return Math.min(e/4,t/4,8)},Ft=function(e,t){return Math.min(e/10,t/10,8)},zt=function(e,t){return{heightOffset:Math.min(15,.05*t),widthOffset:Math.min(100,.25*e),ctrlPtOffsetPct:.05}},Vt=De({dampingFactor:.8,precision:1e-6,iterations:200,weight:function(e){return 1}}),Gt={pageRank:function(e){for(var t=Vt(e),n=t.dampingFactor,r=t.precision,i=t.iterations,o=t.weight,a=this._private.cy,s=this.byGroup(),l=s.nodes,c=s.edges,u=l.length,d=u*u,h=c.length,f=new Array(d),p=new Array(u),v=(1-n)/u,g=0;g<u;g++){for(var m=0;m<u;m++){f[g*u+m]=0}p[g]=0}for(var y=0;y<h;y++){var b=c[y],x=b.data("source"),w=b.data("target");if(x!==w){var E=l.indexOfId(x),_=l.indexOfId(w),k=o(b);f[_*u+E]+=k,p[E]+=k}}for(var S=1/u+v,P=0;P<u;P++)if(0===p[P])for(var j=0;j<u;j++){f[j*u+P]=S}else for(var C=0;C<u;C++){var T=C*u+P;f[T]=f[T]/p[P]+v}for(var D,N=new Array(u),O=new Array(u),M=0;M<u;M++)N[M]=1;for(var A=0;A<i;A++){for(var R=0;R<u;R++)O[R]=0;for(var I=0;I<u;I++)for(var L=0;L<u;L++){var B=I*u+L;O[I]+=f[B]*N[L]}lt(O),D=N,N=O,O=D;for(var F=0,z=0;z<u;z++){var V=D[z]-N[z];F+=V*V}if(F<r)break}return{rank:function(e){return e=a.collection(e)[0],N[l.indexOf(e)]}}}},Ht=De({root:null,weight:function(e){return 1},directed:!1,alpha:0}),Wt={degreeCentralityNormalized:function(e){e=Ht(e);var t=this.cy(),n=this.nodes(),r=n.length;if(e.directed){for(var i={},o={},a=0,s=0,l=0;l<r;l++){var c=n[l],u=c.id();e.root=c;var d=this.degreeCentrality(e);a<d.indegree&&(a=d.indegree),s<d.outdegree&&(s=d.outdegree),i[u]=d.indegree,o[u]=d.outdegree}return{indegree:function(e){return 0==a?0:(C(e)&&(e=t.filter(e)),i[e.id()]/a)},outdegree:function(e){return 0===s?0:(C(e)&&(e=t.filter(e)),o[e.id()]/s)}}}for(var h={},f=0,p=0;p<r;p++){var v=n[p];e.root=v;var g=this.degreeCentrality(e);f<g.degree&&(f=g.degree),h[v.id()]=g.degree}return{degree:function(e){return 0===f?0:(C(e)&&(e=t.filter(e)),h[e.id()]/f)}}},degreeCentrality:function(e){e=Ht(e);var t=this.cy(),n=this,r=e,i=r.root,o=r.weight,a=r.directed,s=r.alpha;if(i=t.collection(i)[0],a){for(var l=i.connectedEdges(),c=l.filter((function(e){return e.target().same(i)&&n.has(e)})),u=l.filter((function(e){return e.source().same(i)&&n.has(e)})),d=c.length,h=u.length,f=0,p=0,v=0;v<c.length;v++)f+=o(c[v]);for(var g=0;g<u.length;g++)p+=o(u[g]);return{indegree:Math.pow(d,1-s)*Math.pow(f,s),outdegree:Math.pow(h,1-s)*Math.pow(p,s)}}for(var m=i.connectedEdges().intersection(n),y=m.length,b=0,x=0;x<m.length;x++)b+=o(m[x]);return{degree:Math.pow(y,1-s)*Math.pow(b,s)}}};Wt.dc=Wt.degreeCentrality,Wt.dcn=Wt.degreeCentralityNormalised=Wt.degreeCentralityNormalized;var qt=De({harmonic:!0,weight:function(){return 1},directed:!1,root:null}),Yt={closenessCentralityNormalized:function(e){for(var t=qt(e),n=t.harmonic,r=t.weight,i=t.directed,o=this.cy(),a={},s=0,l=this.nodes(),c=this.floydWarshall({weight:r,directed:i}),u=0;u<l.length;u++){for(var d=0,h=l[u],f=0;f<l.length;f++)if(u!==f){var p=c.distance(h,l[f]);d+=n?1/p:p}n||(d=1/d),s<d&&(s=d),a[h.id()]=d}return{closeness:function(e){return 0==s?0:(e=C(e)?o.filter(e)[0].id():e.id(),a[e]/s)}}},closenessCentrality:function(e){var t=qt(e),n=t.root,r=t.weight,i=t.directed,o=t.harmonic;n=this.filter(n)[0];for(var a=this.dijkstra({root:n,weight:r,directed:i}),s=0,l=this.nodes(),c=0;c<l.length;c++){var u=l[c];if(!u.same(n)){var d=a.distanceTo(u);s+=o?1/d:d}}return o?s:1/s}};Yt.cc=Yt.closenessCentrality,Yt.ccn=Yt.closenessCentralityNormalised=Yt.closenessCentralityNormalized;var Ut=De({weight:null,directed:!1}),Xt={betweennessCentrality:function(e){for(var t=Ut(e),n=t.directed,r=t.weight,i=null!=r,o=this.cy(),a=this.nodes(),s={},l={},c=0,d=function(e,t){l[e]=t,t>c&&(c=t)},h=function(e){return l[e]},f=0;f<a.length;f++){var p=a[f],v=p.id();s[v]=n?p.outgoers().nodes():p.openNeighborhood().nodes(),d(v,0)}for(var g=function(e){for(var t=a[e].id(),n=[],l={},c={},f={},p=new u.default((function(e,t){return f[e]-f[t]})),v=0;v<a.length;v++){var g=a[v].id();l[g]=[],c[g]=0,f[g]=1/0}for(c[t]=1,f[t]=0,p.push(t);!p.empty();){var m=p.pop();if(n.push(m),i)for(var y=0;y<s[m].length;y++){var b=s[m][y],x=o.getElementById(m),w=void 0;w=x.edgesTo(b).length>0?x.edgesTo(b)[0]:b.edgesTo(x)[0];var E=r(w);b=b.id(),f[b]>f[m]+E&&(f[b]=f[m]+E,p.nodes.indexOf(b)<0?p.push(b):p.updateItem(b),c[b]=0,l[b]=[]),f[b]==f[m]+E&&(c[b]=c[b]+c[m],l[b].push(m))}else for(var _=0;_<s[m].length;_++){var k=s[m][_].id();f[k]==1/0&&(p.push(k),f[k]=f[m]+1),f[k]==f[m]+1&&(c[k]=c[k]+c[m],l[k].push(m))}}for(var S={},P=0;P<a.length;P++)S[a[P].id()]=0;for(;n.length>0;){for(var j=n.pop(),C=0;C<l[j].length;C++){var T=l[j][C];S[T]=S[T]+c[T]/c[j]*(1+S[j])}j!=a[e].id()&&d(j,h(j)+S[j])}},m=0;m<a.length;m++)g(m);var y={betweenness:function(e){var t=o.collection(e).id();return h(t)},betweennessNormalized:function(e){if(0==c)return 0;var t=o.collection(e).id();return h(t)/c}};return y.betweennessNormalised=y.betweennessNormalized,y}};Xt.bc=Xt.betweennessCentrality;var $t=De({expandFactor:2,inflateFactor:2,multFactor:1,maxIterations:20,attributes:[function(e){return 1}]}),Kt=function(e,t){for(var n=0,r=0;r<t.length;r++)n+=t[r](e);return n},Zt=function(e,t){for(var n,r=0;r<t;r++){n=0;for(var i=0;i<t;i++)n+=e[i*t+r];for(var o=0;o<t;o++)e[o*t+r]=e[o*t+r]/n}},Qt=function(e,t,n){for(var r=new Array(n*n),i=0;i<n;i++){for(var o=0;o<n;o++)r[i*n+o]=0;for(var a=0;a<n;a++)for(var s=0;s<n;s++)r[i*n+s]+=e[i*n+a]*t[a*n+s]}return r},Jt=function(e,t,n){for(var r=e.slice(0),i=1;i<n;i++)e=Qt(e,r,t);return e},en=function(e,t,n){for(var r=new Array(t*t),i=0;i<t*t;i++)r[i]=Math.pow(e[i],n);return Zt(r,t),r},tn=function(e,t,n,r){for(var i=0;i<n;i++){if(Math.round(e[i]*Math.pow(10,r))/Math.pow(10,r)!==Math.round(t[i]*Math.pow(10,r))/Math.pow(10,r))return!1}return!0},nn=function(e,t){for(var n=0;n<e.length;n++)if(!t[n]||e[n].id()!==t[n].id())return!1;return!0},rn=function(e){for(var t=this.nodes(),n=this.edges(),r=this.cy(),i=function(e){return $t(e)}(e),o={},a=0;a<t.length;a++)o[t[a].id()]=a;for(var s,l=t.length,c=l*l,u=new Array(c),d=0;d<c;d++)u[d]=0;for(var h=0;h<n.length;h++){var f=n[h],p=o[f.source().id()],v=o[f.target().id()],g=Kt(f,i.attributes);u[p*l+v]+=g,u[v*l+p]+=g}!function(e,t,n){for(var r=0;r<t;r++)e[r*t+r]=n}(u,l,i.multFactor),Zt(u,l);for(var m=!0,y=0;m&&y<i.maxIterations;)m=!1,s=Jt(u,l,i.expandFactor),u=en(s,l,i.inflateFactor),tn(u,s,c,4)||(m=!0),y++;var b=function(e,t,n,r){for(var i=[],o=0;o<t;o++){for(var a=[],s=0;s<t;s++)Math.round(1e3*e[o*t+s])/1e3>0&&a.push(n[s]);0!==a.length&&i.push(r.collection(a))}return i}(u,l,t,r);return b=function(e){for(var t=0;t<e.length;t++)for(var n=0;n<e.length;n++)t!=n&&nn(e[t],e[n])&&e.splice(n,1);return e}(b),b},on={markovClustering:rn,mcl:rn},an=function(e){return e},sn=function(e,t){return Math.abs(t-e)},ln=function(e,t,n){return e+sn(t,n)},cn=function(e,t,n){return e+Math.pow(n-t,2)},un=function(e){return Math.sqrt(e)},dn=function(e,t,n){return Math.max(e,sn(t,n))},hn=function(e,t,n,r,i){for(var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:an,a=r,s=0;s<e;s++)a=i(a,t(s),n(s));return o(a)},fn={euclidean:function(e,t,n){return e>=2?hn(e,t,n,0,cn,un):hn(e,t,n,0,ln)},squaredEuclidean:function(e,t,n){return hn(e,t,n,0,cn)},manhattan:function(e,t,n){return hn(e,t,n,0,ln)},max:function(e,t,n){return hn(e,t,n,-1/0,dn)}};function pn(e,t,n,r,i,o){var a;return a=T(e)?e:fn[e]||fn.euclidean,0===t&&T(e)?a(i,o):a(t,n,r,i,o)}fn["squared-euclidean"]=fn.squaredEuclidean,fn.squaredeuclidean=fn.squaredEuclidean;var vn=De({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),gn=function(e){return vn(e)},mn=function(e,t,n,r,i){var o="kMedoids"!==i?function(e){return n[e]}:function(e){return r[e](n)},a=n,s=t;return pn(e,r.length,o,(function(e){return r[e](t)}),a,s)},yn=function(e,t,n){for(var r=n.length,i=new Array(r),o=new Array(r),a=new Array(t),s=null,l=0;l<r;l++)i[l]=e.min(n[l]).value,o[l]=e.max(n[l]).value;for(var c=0;c<t;c++){s=[];for(var u=0;u<r;u++)s[u]=Math.random()*(o[u]-i[u])+i[u];a[c]=s}return a},bn=function(e,t,n,r,i){for(var o=1/0,a=0,s=0;s<t.length;s++){var l=mn(n,e,t[s],r,i);l<o&&(o=l,a=s)}return a},xn=function(e,t,n){for(var r=[],i=null,o=0;o<t.length;o++)n[(i=t[o]).id()]===e&&r.push(i);return r},wn=function(e,t,n){for(var r=0;r<e.length;r++)for(var i=0;i<e[r].length;i++){if(Math.abs(e[r][i]-t[r][i])>n)return!1}return!0},En=function(e,t,n){for(var r=0;r<n;r++)if(e===t[r])return!0;return!1},_n=function(e,t){var n=new Array(t);if(e.length<50)for(var r=0;r<t;r++){for(var i=e[Math.floor(Math.random()*e.length)];En(i,n,r);)i=e[Math.floor(Math.random()*e.length)];n[r]=i}else for(var o=0;o<t;o++)n[o]=e[Math.floor(Math.random()*e.length)];return n},kn=function(e,t,n){for(var r=0,i=0;i<t.length;i++)r+=mn("manhattan",t[i],e,n,"kMedoids");return r},Sn=function(e,t,n,r,i){for(var o,a,s=0;s<t.length;s++)for(var l=0;l<e.length;l++)r[s][l]=Math.pow(n[s][l],i.m);for(var c=0;c<e.length;c++)for(var u=0;u<i.attributes.length;u++){o=0,a=0;for(var d=0;d<t.length;d++)o+=r[d][c]*i.attributes[u](t[d]),a+=r[d][c];e[c][u]=o/a}},Pn=function(e,t,n,r,i){for(var o=0;o<e.length;o++)t[o]=e[o].slice();for(var a,s,l,c=2/(i.m-1),u=0;u<n.length;u++)for(var d=0;d<r.length;d++){a=0;for(var h=0;h<n.length;h++)s=mn(i.distance,r[d],n[u],i.attributes,"cmeans"),l=mn(i.distance,r[d],n[h],i.attributes,"cmeans"),a+=Math.pow(s/l,c);e[d][u]=1/a}},jn=function(e){var t,n,r,i,o,a=this.cy(),s=this.nodes(),l=gn(e);i=new Array(s.length);for(var c=0;c<s.length;c++)i[c]=new Array(l.k);r=new Array(s.length);for(var u=0;u<s.length;u++)r[u]=new Array(l.k);for(var d=0;d<s.length;d++){for(var h=0,f=0;f<l.k;f++)r[d][f]=Math.random(),h+=r[d][f];for(var p=0;p<l.k;p++)r[d][p]=r[d][p]/h}n=new Array(l.k);for(var v=0;v<l.k;v++)n[v]=new Array(l.attributes.length);o=new Array(s.length);for(var g=0;g<s.length;g++)o[g]=new Array(l.k);for(var m=!0,y=0;m&&y<l.maxIterations;)m=!1,Sn(n,s,r,o,l),Pn(r,i,n,s,l),wn(r,i,l.sensitivityThreshold)||(m=!0),y++;return t=function(e,t,n,r){for(var i,o,a=new Array(n.k),s=0;s<a.length;s++)a[s]=[];for(var l=0;l<t.length;l++){i=-1/0,o=-1;for(var c=0;c<t[0].length;c++)t[l][c]>i&&(i=t[l][c],o=c);a[o].push(e[l])}for(var u=0;u<a.length;u++)a[u]=r.collection(a[u]);return a}(s,r,l,a),{clusters:t,degreeOfMembership:r}},Cn={kMeans:function(e){var t,n=this.cy(),r=this.nodes(),i=null,o=gn(e),a=new Array(o.k),s={};o.testMode?"number"==typeof o.testCentroids?(o.testCentroids,t=yn(r,o.k,o.attributes)):t="object"===p(o.testCentroids)?o.testCentroids:yn(r,o.k,o.attributes):t=yn(r,o.k,o.attributes);for(var l,c,u,d=!0,h=0;d&&h<o.maxIterations;){for(var f=0;f<r.length;f++)s[(i=r[f]).id()]=bn(i,t,o.distance,o.attributes,"kMeans");d=!1;for(var v=0;v<o.k;v++){var g=xn(v,r,s);if(0!==g.length){for(var m=o.attributes.length,y=t[v],b=new Array(m),x=new Array(m),w=0;w<m;w++){x[w]=0;for(var E=0;E<g.length;E++)i=g[E],x[w]+=o.attributes[w](i);b[w]=x[w]/g.length,l=b[w],c=y[w],u=o.sensitivityThreshold,Math.abs(c-l)<=u||(d=!0)}t[v]=b,a[v]=n.collection(g)}}h++}return a},kMedoids:function(e){var t,n,r=this.cy(),i=this.nodes(),o=null,a=gn(e),s=new Array(a.k),l={},c=new Array(a.k);a.testMode?"number"==typeof a.testCentroids||(t="object"===p(a.testCentroids)?a.testCentroids:_n(i,a.k)):t=_n(i,a.k);for(var u=!0,d=0;u&&d<a.maxIterations;){for(var h=0;h<i.length;h++)l[(o=i[h]).id()]=bn(o,t,a.distance,a.attributes,"kMedoids");u=!1;for(var f=0;f<t.length;f++){var v=xn(f,i,l);if(0!==v.length){c[f]=kn(t[f],v,a.attributes);for(var g=0;g<v.length;g++)(n=kn(v[g],v,a.attributes))<c[f]&&(c[f]=n,t[f]=v[g],u=!0);s[f]=r.collection(v)}}d++}return s},fuzzyCMeans:jn,fcm:jn},Tn=De({distance:"euclidean",linkage:"min",mode:"threshold",threshold:1/0,addDendrogram:!1,dendrogramDepth:0,attributes:[]}),Dn={single:"min",complete:"max"},Nn=function(e,t,n,r,i){for(var o,a=0,s=1/0,l=i.attributes,c=function(e,t){return pn(i.distance,l.length,(function(t){return l[t](e)}),(function(e){return l[e](t)}),e,t)},u=0;u<e.length;u++){var d=e[u].key,h=n[d][r[d]];h<s&&(a=d,s=h)}if("threshold"===i.mode&&s>=i.threshold||"dendrogram"===i.mode&&1===e.length)return!1;var f,p=t[a],v=t[r[a]];f="dendrogram"===i.mode?{left:p,right:v,key:p.key}:{value:p.value.concat(v.value),key:p.key},e[p.index]=f,e.splice(v.index,1),t[p.key]=f;for(var g=0;g<e.length;g++){var m=e[g];p.key===m.key?o=1/0:"min"===i.linkage?(o=n[p.key][m.key],n[p.key][m.key]>n[v.key][m.key]&&(o=n[v.key][m.key])):"max"===i.linkage?(o=n[p.key][m.key],n[p.key][m.key]<n[v.key][m.key]&&(o=n[v.key][m.key])):o="mean"===i.linkage?(n[p.key][m.key]*p.size+n[v.key][m.key]*v.size)/(p.size+v.size):"dendrogram"===i.mode?c(m.value,p.value):c(m.value[0],p.value[0]),n[p.key][m.key]=n[m.key][p.key]=o}for(var y=0;y<e.length;y++){var b=e[y].key;if(r[b]===p.key||r[b]===v.key){for(var x=b,w=0;w<e.length;w++){var E=e[w].key;n[b][E]<n[b][x]&&(x=E)}r[b]=x}e[y].index=y}return p.key=v.key=p.index=v.index=null,!0},On=function e(t,n,r){t&&(t.value?n.push(t.value):(t.left&&e(t.left,n),t.right&&e(t.right,n)))},Mn=function e(t,n){if(!t)return"";if(t.left&&t.right){var r=e(t.left,n),i=e(t.right,n),o=n.add({group:"nodes",data:{id:r+","+i}});return n.add({group:"edges",data:{source:r,target:o.id()}}),n.add({group:"edges",data:{source:i,target:o.id()}}),o.id()}return t.value?t.value.id():void 0},An=function e(t,n,r){if(!t)return[];var i=[],o=[],a=[];return 0===n?(t.left&&On(t.left,i),t.right&&On(t.right,o),a=i.concat(o),[r.collection(a)]):1===n?t.value?[r.collection(t.value)]:(t.left&&On(t.left,i),t.right&&On(t.right,o),[r.collection(i),r.collection(o)]):t.value?[r.collection(t.value)]:(t.left&&(i=e(t.left,n-1,r)),t.right&&(o=e(t.right,n-1,r)),i.concat(o))},Rn=function(e){for(var t=this.cy(),n=this.nodes(),r=function(e){var t=Tn(e),n=Dn[t.linkage];return null!=n&&(t.linkage=n),t}(e),i=r.attributes,o=function(e,t){return pn(r.distance,i.length,(function(t){return i[t](e)}),(function(e){return i[e](t)}),e,t)},a=[],s=[],l=[],c=[],u=0;u<n.length;u++){var d={value:"dendrogram"===r.mode?n[u]:[n[u]],key:u,index:u};a[u]=d,c[u]=d,s[u]=[],l[u]=0}for(var h=0;h<a.length;h++)for(var f=0;f<=h;f++){var p=void 0;p="dendrogram"===r.mode?h===f?1/0:o(a[h].value,a[f].value):h===f?1/0:o(a[h].value[0],a[f].value[0]),s[h][f]=p,s[f][h]=p,p<s[h][l[h]]&&(l[h]=f)}for(var v,g=Nn(a,c,s,l,r);g;)g=Nn(a,c,s,l,r);return"dendrogram"===r.mode?(v=An(a[0],r.dendrogramDepth,t),r.addDendrogram&&Mn(a[0],t)):(v=new Array(a.length),a.forEach((function(e,n){e.key=e.index=null,v[n]=t.collection(e.value)}))),v},In={hierarchicalClustering:Rn,hca:Rn},Ln=De({distance:"euclidean",preference:"median",damping:.8,maxIterations:1e3,minIterations:100,attributes:[]}),Bn=function(e,t,n,r){var i=function(e,t){return r[t](e)};return-pn(e,r.length,(function(e){return i(t,e)}),(function(e){return i(n,e)}),t,n)},Fn=function(e,t){var n=null;return n="median"===t?function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],i=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];arguments.length>3&&void 0!==arguments[3]&&!arguments[3]?(n<e.length&&e.splice(n,e.length-n),t>0&&e.splice(0,t)):e=e.slice(t,n);for(var o=0,a=e.length-1;a>=0;a--){var s=e[a];i?isFinite(s)||(e[a]=-1/0,o++):e.splice(a,1)}r&&e.sort((function(e,t){return e-t}));var l=e.length,c=Math.floor(l/2);return l%2!=0?e[c+1+o]:(e[c-1+o]+e[c+o])/2}(e):"mean"===t?function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=0,i=0,o=t;o<n;o++){var a=e[o];isFinite(a)&&(r+=a,i++)}return r/i}(e):"min"===t?function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=1/0,i=t;i<n;i++){var o=e[i];isFinite(o)&&(r=Math.min(o,r))}return r}(e):"max"===t?function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=-1/0,i=t;i<n;i++){var o=e[i];isFinite(o)&&(r=Math.max(o,r))}return r}(e):t,n},zn=function(e,t,n){for(var r=[],i=0;i<e;i++){for(var o=-1,a=-1/0,s=0;s<n.length;s++){var l=n[s];t[i*e+l]>a&&(o=l,a=t[i*e+l])}o>0&&r.push(o)}for(var c=0;c<n.length;c++)r[n[c]]=n[c];return r},Vn=function(e){for(var t,n,r,i,o,a,s=this.cy(),l=this.nodes(),c=function(e){var t=e.damping,n=e.preference;.5<=t&&t<1||_e("Damping must range on [0.5, 1). Got: ".concat(t));var r=["median","mean","min","max"];return r.some((function(e){return e===n}))||O(n)||_e("Preference must be one of [".concat(r.map((function(e){return"'".concat(e,"'")})).join(", "),"] or a number. Got: ").concat(n)),Ln(e)}(e),u={},d=0;d<l.length;d++)u[l[d].id()]=d;n=(t=l.length)*t,r=new Array(n);for(var h=0;h<n;h++)r[h]=-1/0;for(var f=0;f<t;f++)for(var p=0;p<t;p++)f!==p&&(r[f*t+p]=Bn(c.distance,l[f],l[p],c.attributes));i=Fn(r,c.preference);for(var v=0;v<t;v++)r[v*t+v]=i;o=new Array(n);for(var g=0;g<n;g++)o[g]=0;a=new Array(n);for(var m=0;m<n;m++)a[m]=0;for(var y=new Array(t),b=new Array(t),x=new Array(t),w=0;w<t;w++)y[w]=0,b[w]=0,x[w]=0;for(var E,_=new Array(t*c.minIterations),k=0;k<_.length;k++)_[k]=0;for(E=0;E<c.maxIterations;E++){for(var S=0;S<t;S++){for(var P=-1/0,j=-1/0,C=-1,T=0,D=0;D<t;D++)y[D]=o[S*t+D],(T=a[S*t+D]+r[S*t+D])>=P?(j=P,P=T,C=D):T>j&&(j=T);for(var N=0;N<t;N++)o[S*t+N]=(1-c.damping)*(r[S*t+N]-P)+c.damping*y[N];o[S*t+C]=(1-c.damping)*(r[S*t+C]-j)+c.damping*y[C]}for(var M=0;M<t;M++){for(var A=0,R=0;R<t;R++)y[R]=a[R*t+M],b[R]=Math.max(0,o[R*t+M]),A+=b[R];A-=b[M],b[M]=o[M*t+M],A+=b[M];for(var I=0;I<t;I++)a[I*t+M]=(1-c.damping)*Math.min(0,A-b[I])+c.damping*y[I];a[M*t+M]=(1-c.damping)*(A-b[M])+c.damping*y[M]}for(var L=0,B=0;B<t;B++){var F=a[B*t+B]+o[B*t+B]>0?1:0;_[E%c.minIterations*t+B]=F,L+=F}if(L>0&&(E>=c.minIterations-1||E==c.maxIterations-1)){for(var z=0,V=0;V<t;V++){x[V]=0;for(var G=0;G<c.minIterations;G++)x[V]+=_[G*t+V];0!==x[V]&&x[V]!==c.minIterations||z++}if(z===t)break}}for(var H=function(e,t,n){for(var r=[],i=0;i<e;i++)t[i*e+i]+n[i*e+i]>0&&r.push(i);return r}(t,o,a),W=function(e,t,n){for(var r=zn(e,t,n),i=0;i<n.length;i++){for(var o=[],a=0;a<r.length;a++)r[a]===n[i]&&o.push(a);for(var s=-1,l=-1/0,c=0;c<o.length;c++){for(var u=0,d=0;d<o.length;d++)u+=t[o[d]*e+o[c]];u>l&&(s=c,l=u)}n[i]=o[s]}return zn(e,t,n)}(t,r,H),q={},Y=0;Y<H.length;Y++)q[H[Y]]=[];for(var U=0;U<l.length;U++){var X=W[u[l[U].id()]];null!=X&&q[X].push(l[U])}for(var $=new Array(H.length),K=0;K<H.length;K++)$[K]=s.collection(q[H[K]]);return $},Gn={affinityPropagation:Vn,ap:Vn},Hn=De({root:void 0,directed:!1}),Wn=function(){var e=this,t={},n=0,r=0,i=[],o=[],a={},s=function s(l,c,u){l===u&&(r+=1),t[c]={id:n,low:n++,cutVertex:!1};var d,h,f,p,v=e.getElementById(c).connectedEdges().intersection(e);0===v.size()?i.push(e.spawn(e.getElementById(c))):v.forEach((function(n){d=n.source().id(),h=n.target().id(),(f=d===c?h:d)!==u&&(p=n.id(),a[p]||(a[p]=!0,o.push({x:c,y:f,edge:n})),f in t?t[c].low=Math.min(t[c].low,t[f].id):(s(l,f,c),t[c].low=Math.min(t[c].low,t[f].low),t[c].id<=t[f].low&&(t[c].cutVertex=!0,function(n,r){for(var a=o.length-1,s=[],l=e.spawn();o[a].x!=n||o[a].y!=r;)s.push(o.pop().edge),a--;s.push(o.pop().edge),s.forEach((function(n){var r=n.connectedNodes().intersection(e);l.merge(n),r.forEach((function(n){var r=n.id(),i=n.connectedEdges().intersection(e);l.merge(n),t[r].cutVertex?l.merge(i.filter((function(e){return e.isLoop()}))):l.merge(i)}))})),i.push(l)}(c,f))))}))};e.forEach((function(e){if(e.isNode()){var n=e.id();n in t||(r=0,s(n,n),t[n].cutVertex=r>1)}}));var l=Object.keys(t).filter((function(e){return t[e].cutVertex})).map((function(t){return e.getElementById(t)}));return{cut:e.spawn(l),components:i}},qn=function(){var e=this,t={},n=0,r=[],i=[],o=e.spawn(e),a=function a(s){if(i.push(s),t[s]={index:n,low:n++,explored:!1},e.getElementById(s).connectedEdges().intersection(e).forEach((function(e){var n=e.target().id();n!==s&&(n in t||a(n),t[n].explored||(t[s].low=Math.min(t[s].low,t[n].low)))})),t[s].index===t[s].low){for(var l=e.spawn();;){var c=i.pop();if(l.merge(e.getElementById(c)),t[c].low=t[s].index,t[c].explored=!0,c===s)break}var u=l.edgesWith(l),d=l.merge(u);r.push(d),o=o.difference(d)}};return e.forEach((function(e){if(e.isNode()){var n=e.id();n in t||a(n)}})),{cut:o,components:r}},Yn={};[ze,Ge,He,qe,Ue,$e,Je,Gt,Wt,Yt,Xt,on,Cn,In,Gn,{hierholzer:function(e){if(!N(e)){var t=arguments;e={root:t[0],directed:t[1]}}var n,r,i,o=Hn(e),a=o.root,s=o.directed,l=this,c=!1;a&&(i=C(a)?this.filter(a)[0].id():a[0].id());var u={},d={};s?l.forEach((function(e){var t=e.id();if(e.isNode()){var i=e.indegree(!0),o=e.outdegree(!0),a=i-o,s=o-i;1==a?n?c=!0:n=t:1==s?r?c=!0:r=t:(s>1||a>1)&&(c=!0),u[t]=[],e.outgoers().forEach((function(e){e.isEdge()&&u[t].push(e.id())}))}else d[t]=[void 0,e.target().id()]})):l.forEach((function(e){var t=e.id();e.isNode()?(e.degree(!0)%2&&(n?r?c=!0:r=t:n=t),u[t]=[],e.connectedEdges().forEach((function(e){return u[t].push(e.id())}))):d[t]=[e.source().id(),e.target().id()]}));var h={found:!1,trail:void 0};if(c)return h;if(r&&n)if(s){if(i&&r!=i)return h;i=r}else{if(i&&r!=i&&n!=i)return h;i||(i=r)}else i||(i=l[0].id());var f=function(e){for(var t,n,r,i=e,o=[e];u[i].length;)t=u[i].shift(),n=d[t][0],i!=(r=d[t][1])?(u[r]=u[r].filter((function(e){return e!=t})),i=r):s||i==n||(u[n]=u[n].filter((function(e){return e!=t})),i=n),o.unshift(t),o.unshift(i);return o},p=[],v=[];for(v=f(i);1!=v.length;)0==u[v[0]].length?(p.unshift(l.getElementById(v.shift())),p.unshift(l.getElementById(v.shift()))):v=f(v.shift()).concat(v);for(var g in p.unshift(l.getElementById(v.shift())),u)if(u[g].length)return h;return h.found=!0,h.trail=this.spawn(p,!0),h}},{hopcroftTarjanBiconnected:Wn,htbc:Wn,htb:Wn,hopcroftTarjanBiconnectedComponents:Wn},{tarjanStronglyConnected:qn,tsc:qn,tscc:qn,tarjanStronglyConnectedComponents:qn}].forEach((function(e){X(Yn,e)}));var Un=function e(t){if(!(this instanceof e))return new e(t);this.id="Thenable/1.0.7",this.state=0,this.fulfillValue=void 0,this.rejectReason=void 0,this.onFulfilled=[],this.onRejected=[],this.proxy={then:this.then.bind(this)},"function"==typeof t&&t.call(this,this.fulfill.bind(this),this.reject.bind(this))};Un.prototype={fulfill:function(e){return Xn(this,1,"fulfillValue",e)},reject:function(e){return Xn(this,2,"rejectReason",e)},then:function(e,t){var n=this,r=new Un;return n.onFulfilled.push(Zn(e,r,"fulfill")),n.onRejected.push(Zn(t,r,"reject")),$n(n),r.proxy}};var Xn=function(e,t,n,r){return 0===e.state&&(e.state=t,e[n]=r,$n(e)),e},$n=function(e){1===e.state?Kn(e,"onFulfilled",e.fulfillValue):2===e.state&&Kn(e,"onRejected",e.rejectReason)},Kn=function(e,t,n){if(0!==e[t].length){var r=e[t];e[t]=[];var i=function(){for(var e=0;e<r.length;e++)r[e](n)};"function"==typeof setImmediate?setImmediate(i):setTimeout(i,0)}},Zn=function(e,t,n){return function(r){if("function"!=typeof e)t[n].call(t,r);else{var i;try{i=e(r)}catch(o){return void t.reject(o)}Qn(t,i)}}},Qn=function e(t,n){if(t!==n&&t.proxy!==n){var r;if("object"===p(n)&&null!==n||"function"==typeof n)try{r=n.then}catch(o){return void t.reject(o)}if("function"!=typeof r)t.fulfill(n);else{var i=!1;try{r.call(n,(function(r){i||(i=!0,r===n?t.reject(new TypeError("circular thenable chain")):e(t,r))}),(function(e){i||(i=!0,t.reject(e))}))}catch(o){i||t.reject(o)}}}else t.reject(new TypeError("cannot resolve promise with itself"))};Un.all=function(e){return new Un((function(t,n){for(var r=new Array(e.length),i=0,o=function(n,o){r[n]=o,++i===e.length&&t(r)},a=0;a<e.length;a++)!function(t){var r=e[t];null!=r&&null!=r.then?r.then((function(e){o(t,e)}),(function(e){n(e)})):o(t,r)}(a)}))},Un.resolve=function(e){return new Un((function(t,n){t(e)}))},Un.reject=function(e){return new Un((function(t,n){n(e)}))};var Jn="undefined"!=typeof Promise?Promise:Un,er=function(e,t,n){var r=L(e),i=!r,o=this._private=X({duration:1e3},t,n);if(o.target=e,o.style=o.style||o.css,o.started=!1,o.playing=!1,o.hooked=!1,o.applying=!1,o.progress=0,o.completes=[],o.frames=[],o.complete&&T(o.complete)&&o.completes.push(o.complete),i){var a=e.position();o.startPosition=o.startPosition||{x:a.x,y:a.y},o.startStyle=o.startStyle||e.cy().style().getAnimationStartStyle(e,o.style)}if(r){var s=e.pan();o.startPan={x:s.x,y:s.y},o.startZoom=e.zoom()}this.length=1,this[0]=this},tr=er.prototype;X(tr,{instanceString:function(){return"animation"},hook:function(){var e=this._private;if(!e.hooked){var t=e.target._private.animation;(e.queue?t.queue:t.current).push(this),A(e.target)&&e.target.cy().addToAnimationPool(e.target),e.hooked=!0}return this},play:function(){var e=this._private;return 1===e.progress&&(e.progress=0),e.playing=!0,e.started=!1,e.stopped=!1,this.hook(),this},playing:function(){return this._private.playing},apply:function(){var e=this._private;return e.applying=!0,e.started=!1,e.stopped=!1,this.hook(),this},applying:function(){return this._private.applying},pause:function(){var e=this._private;return e.playing=!1,e.started=!1,this},stop:function(){var e=this._private;return e.playing=!1,e.started=!1,e.stopped=!0,this},rewind:function(){return this.progress(0)},fastforward:function(){return this.progress(1)},time:function(e){var t=this._private;return void 0===e?t.progress*t.duration:this.progress(e/t.duration)},progress:function(e){var t=this._private,n=t.playing;return void 0===e?t.progress:(n&&this.pause(),t.progress=e,t.started=!1,n&&this.play(),this)},completed:function(){return 1===this._private.progress},reverse:function(){var e=this._private,t=e.playing;t&&this.pause(),e.progress=1-e.progress,e.started=!1;var n=function(t,n){var r=e[t];null!=r&&(e[t]=e[n],e[n]=r)};if(n("zoom","startZoom"),n("pan","startPan"),n("position","startPosition"),e.style)for(var r=0;r<e.style.length;r++){var i=e.style[r],o=i.name,a=e.startStyle[o];e.startStyle[o]=i,e.style[r]=a}return t&&this.play(),this},promise:function(e){var t,n=this._private;if("frame"===e)t=n.frames;else t=n.completes;return new Jn((function(e,n){t.push((function(){e()}))}))}}),tr.complete=tr.completed,tr.run=tr.play,tr.running=tr.playing;var nr={animated:function(){return function(){var e=this,t=void 0!==e.length?e:[e];if(!(this._private.cy||this).styleEnabled())return!1;var n=t[0];return n?n._private.animation.current.length>0:void 0}},clearQueue:function(){return function(){var e=this,t=void 0!==e.length?e:[e];if(!(this._private.cy||this).styleEnabled())return this;for(var n=0;n<t.length;n++){t[n]._private.animation.queue=[]}return this}},delay:function(){return function(e,t){return(this._private.cy||this).styleEnabled()?this.animate({delay:e,duration:e,complete:t}):this}},delayAnimation:function(){return function(e,t){return(this._private.cy||this).styleEnabled()?this.animation({delay:e,duration:e,complete:t}):this}},animation:function(){return function(e,t){var n=this,r=void 0!==n.length,i=r?n:[n],o=this._private.cy||this,a=!r,s=!a;if(!o.styleEnabled())return this;var l=o.style();if(e=X({},e,t),0===Object.keys(e).length)return new er(i[0],e);switch(void 0===e.duration&&(e.duration=400),e.duration){case"slow":e.duration=600;break;case"fast":e.duration=200}if(s&&(e.style=l.getPropsList(e.style||e.css),e.css=void 0),s&&null!=e.renderedPosition){var c=e.renderedPosition,u=o.pan(),d=o.zoom();e.position=tt(c,d,u)}if(a&&null!=e.panBy){var h=e.panBy,f=o.pan();e.pan={x:f.x+h.x,y:f.y+h.y}}var p=e.center||e.centre;if(a&&null!=p){var v=o.getCenterPan(p.eles,e.zoom);null!=v&&(e.pan=v)}if(a&&null!=e.fit){var g=e.fit,m=o.getFitViewport(g.eles||g.boundingBox,g.padding);null!=m&&(e.pan=m.pan,e.zoom=m.zoom)}if(a&&N(e.zoom)){var y=o.getZoomedViewport(e.zoom);null!=y?(y.zoomed&&(e.zoom=y.zoom),y.panned&&(e.pan=y.pan)):e.zoom=null}return new er(i[0],e)}},animate:function(){return function(e,t){var n=this,r=void 0!==n.length?n:[n];if(!(this._private.cy||this).styleEnabled())return this;t&&(e=X({},e,t));for(var i=0;i<r.length;i++){var o=r[i],a=o.animated()&&(void 0===e.queue||e.queue);o.animation(e,a?{queue:!0}:void 0).play()}return this}},stop:function(){return function(e,t){var n=this,r=void 0!==n.length?n:[n],i=this._private.cy||this;if(!i.styleEnabled())return this;for(var o=0;o<r.length;o++){for(var a=r[o]._private,s=a.animation.current,l=0;l<s.length;l++){var c=s[l]._private;t&&(c.duration=0)}e&&(a.animation.queue=[]),t||(a.animation.current=[])}return i.notify("draw"),this}}},rr={data:function(e){return e=X({},{field:"data",bindingEvent:"data",allowBinding:!1,allowSetting:!1,allowGetting:!1,settingEvent:"data",settingTriggersEvent:!1,triggerFnName:"trigger",immutableKeys:{},updateStyle:!1,beforeGet:function(e){},beforeSet:function(e,t){},onSet:function(e){},canSet:function(e){return!0}},e),function(t,n){var r=e,i=this,o=void 0!==i.length,a=o?i:[i],s=o?i[0]:i;if(C(t)){var l,c=-1!==t.indexOf(".")&&f.default(t);if(r.allowGetting&&void 0===n)return s&&(r.beforeGet(s),l=c&&void 0===s._private[r.field][t]?d.default(s._private[r.field],c):s._private[r.field][t]),l;if(r.allowSetting&&void 0!==n&&!r.immutableKeys[t]){var u=y({},t,n);r.beforeSet(i,u);for(var p=0,v=a.length;p<v;p++){var g=a[p];r.canSet(g)&&(c&&void 0===s._private[r.field][t]?h.default(g._private[r.field],c,n):g._private[r.field][t]=n)}r.updateStyle&&i.updateStyle(),r.onSet(i),r.settingTriggersEvent&&i[r.triggerFnName](r.settingEvent)}}else if(r.allowSetting&&N(t)){var m,b,x=t,w=Object.keys(x);r.beforeSet(i,x);for(var E=0;E<w.length;E++){if(b=x[m=w[E]],!r.immutableKeys[m])for(var _=0;_<a.length;_++){var k=a[_];r.canSet(k)&&(k._private[r.field][m]=b)}}r.updateStyle&&i.updateStyle(),r.onSet(i),r.settingTriggersEvent&&i[r.triggerFnName](r.settingEvent)}else if(r.allowBinding&&T(t)){var S=t;i.on(r.bindingEvent,S)}else if(r.allowGetting&&void 0===t){var P;return s&&(r.beforeGet(s),P=s._private[r.field]),P}return i}},removeData:function(e){return e=X({},{field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!1,immutableKeys:{}},e),function(t){var n=e,r=this,i=void 0!==r.length?r:[r];if(C(t)){for(var o=t.split(/\s+/),a=o.length,s=0;s<a;s++){var l=o[s];if(!F(l))if(!n.immutableKeys[l])for(var c=0,u=i.length;c<u;c++)i[c]._private[n.field][l]=void 0}n.triggerEvent&&r[n.triggerFnName](n.event)}else if(void 0===t){for(var d=0,h=i.length;d<h;d++)for(var f=i[d]._private[n.field],p=Object.keys(f),v=0;v<p.length;v++){var g=p[v];!n.immutableKeys[g]&&(f[g]=void 0)}n.triggerEvent&&r[n.triggerFnName](n.event)}return r}}},ir={eventAliasesOn:function(e){var t=e;t.addListener=t.listen=t.bind=t.on,t.unlisten=t.unbind=t.off=t.removeListener,t.trigger=t.emit,t.pon=t.promiseOn=function(e,t){var n=this,r=Array.prototype.slice.call(arguments,0);return new Jn((function(e,t){var i=r.concat([function(t){n.off.apply(n,o),e(t)}]),o=i.concat([]);n.on.apply(n,i)}))}}},or={};[nr,rr,ir].forEach((function(e){X(or,e)}));var ar={animate:or.animate(),animation:or.animation(),animated:or.animated(),clearQueue:or.clearQueue(),delay:or.delay(),delayAnimation:or.delayAnimation(),stop:or.stop()},sr={classes:function(e){var t=this;if(void 0===e){var n=[];return t[0]._private.classes.forEach((function(e){return n.push(e)})),n}D(e)||(e=(e||"").match(/\S+/g)||[]);for(var r=[],i=new Le(e),o=0;o<t.length;o++){for(var a=t[o],s=a._private,l=s.classes,c=!1,u=0;u<e.length;u++){var d=e[u];if(!l.has(d)){c=!0;break}}c||(c=l.size!==e.length),c&&(s.classes=i,r.push(a))}return r.length>0&&this.spawn(r).updateStyle().emit("class"),t},addClass:function(e){return this.toggleClass(e,!0)},hasClass:function(e){var t=this[0];return null!=t&&t._private.classes.has(e)},toggleClass:function(e,t){D(e)||(e=e.match(/\S+/g)||[]);for(var n=this,r=void 0===t,i=[],o=0,a=n.length;o<a;o++)for(var s=n[o],l=s._private.classes,c=!1,u=0;u<e.length;u++){var d=e[u],h=l.has(d),f=!1;t||r&&!h?(l.add(d),f=!0):(!t||r&&h)&&(l.delete(d),f=!0),!c&&f&&(i.push(s),c=!0)}return i.length>0&&this.spawn(i).updateStyle().emit("class"),n},removeClass:function(e){return this.toggleClass(e,!1)},flashClass:function(e,t){var n=this;if(null==t)t=250;else if(0===t)return n;return n.addClass(e),setTimeout((function(){n.removeClass(e)}),t),n}};sr.className=sr.classNames=sr.classes;var lr={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:"\"(?:\\\\\"|[^\"])*\"|'(?:\\\\'|[^'])*'",number:Y,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};lr.variable="(?:[\\w-.]|(?:\\\\"+lr.metaChar+"))+",lr.className="(?:[\\w-]|(?:\\\\"+lr.metaChar+"))+",lr.value=lr.string+"|"+lr.number,lr.id=lr.variable,function(){var e,t,n;for(e=lr.comparatorOp.split("|"),n=0;n<e.length;n++)t=e[n],lr.comparatorOp+="|@"+t;for(e=lr.comparatorOp.split("|"),n=0;n<e.length;n++)(t=e[n]).indexOf("!")>=0||"="!==t&&(lr.comparatorOp+="|\\!"+t)}();var cr=0,ur=1,dr=2,hr=3,fr=4,pr=5,vr=6,gr=7,mr=8,yr=9,br=10,xr=11,wr=12,Er=13,_r=14,kr=15,Sr=16,Pr=17,jr=18,Cr=19,Tr=20,Dr=[{selector:":selected",matches:function(e){return e.selected()}},{selector:":unselected",matches:function(e){return!e.selected()}},{selector:":selectable",matches:function(e){return e.selectable()}},{selector:":unselectable",matches:function(e){return!e.selectable()}},{selector:":locked",matches:function(e){return e.locked()}},{selector:":unlocked",matches:function(e){return!e.locked()}},{selector:":visible",matches:function(e){return e.visible()}},{selector:":hidden",matches:function(e){return!e.visible()}},{selector:":transparent",matches:function(e){return e.transparent()}},{selector:":grabbed",matches:function(e){return e.grabbed()}},{selector:":free",matches:function(e){return!e.grabbed()}},{selector:":removed",matches:function(e){return e.removed()}},{selector:":inside",matches:function(e){return!e.removed()}},{selector:":grabbable",matches:function(e){return e.grabbable()}},{selector:":ungrabbable",matches:function(e){return!e.grabbable()}},{selector:":animated",matches:function(e){return e.animated()}},{selector:":unanimated",matches:function(e){return!e.animated()}},{selector:":parent",matches:function(e){return e.isParent()}},{selector:":childless",matches:function(e){return e.isChildless()}},{selector:":child",matches:function(e){return e.isChild()}},{selector:":orphan",matches:function(e){return e.isOrphan()}},{selector:":nonorphan",matches:function(e){return e.isChild()}},{selector:":compound",matches:function(e){return e.isNode()?e.isParent():e.source().isParent()||e.target().isParent()}},{selector:":loop",matches:function(e){return e.isLoop()}},{selector:":simple",matches:function(e){return e.isSimple()}},{selector:":active",matches:function(e){return e.active()}},{selector:":inactive",matches:function(e){return!e.active()}},{selector:":backgrounding",matches:function(e){return e.backgrounding()}},{selector:":nonbackgrounding",matches:function(e){return!e.backgrounding()}}].sort((function(e,t){return function(e,t){return-1*U(e,t)}(e.selector,t.selector)})),Nr=function(){for(var e,t={},n=0;n<Dr.length;n++)t[(e=Dr[n]).selector]=e.matches;return t}(),Or="("+Dr.map((function(e){return e.selector})).join("|")+")",Mr=function(e){return e.replace(new RegExp("\\\\("+lr.metaChar+")","g"),(function(e,t){return t}))},Ar=function(e,t,n){e[e.length-1]=n},Rr=[{name:"group",query:!0,regex:"("+lr.group+")",populate:function(e,t,n){var r=b(n,1)[0];t.checks.push({type:cr,value:"*"===r?r:r+"s"})}},{name:"state",query:!0,regex:Or,populate:function(e,t,n){var r=b(n,1)[0];t.checks.push({type:gr,value:r})}},{name:"id",query:!0,regex:"\\#("+lr.id+")",populate:function(e,t,n){var r=b(n,1)[0];t.checks.push({type:mr,value:Mr(r)})}},{name:"className",query:!0,regex:"\\.("+lr.className+")",populate:function(e,t,n){var r=b(n,1)[0];t.checks.push({type:yr,value:Mr(r)})}},{name:"dataExists",query:!0,regex:"\\[\\s*("+lr.variable+")\\s*\\]",populate:function(e,t,n){var r=b(n,1)[0];t.checks.push({type:fr,field:Mr(r)})}},{name:"dataCompare",query:!0,regex:"\\[\\s*("+lr.variable+")\\s*("+lr.comparatorOp+")\\s*("+lr.value+")\\s*\\]",populate:function(e,t,n){var r=b(n,3),i=r[0],o=r[1],a=r[2];a=null!=new RegExp("^"+lr.string+"$").exec(a)?a.substring(1,a.length-1):parseFloat(a),t.checks.push({type:hr,field:Mr(i),operator:o,value:a})}},{name:"dataBool",query:!0,regex:"\\[\\s*("+lr.boolOp+")\\s*("+lr.variable+")\\s*\\]",populate:function(e,t,n){var r=b(n,2),i=r[0],o=r[1];t.checks.push({type:pr,field:Mr(o),operator:i})}},{name:"metaCompare",query:!0,regex:"\\[\\[\\s*("+lr.meta+")\\s*("+lr.comparatorOp+")\\s*("+lr.number+")\\s*\\]\\]",populate:function(e,t,n){var r=b(n,3),i=r[0],o=r[1],a=r[2];t.checks.push({type:vr,field:Mr(i),operator:o,value:parseFloat(a)})}},{name:"nextQuery",separator:!0,regex:lr.separator,populate:function(e,t){var n=e.currentSubject,r=e.edgeCount,i=e.compoundCount,o=e[e.length-1];return null!=n&&(o.subject=n,e.currentSubject=null),o.edgeCount=r,o.compoundCount=i,e.edgeCount=0,e.compoundCount=0,e[e.length++]={checks:[]}}},{name:"directedEdge",separator:!0,regex:lr.directedEdge,populate:function(e,t){if(null==e.currentSubject){var n={checks:[]},r=t,i={checks:[]};return n.checks.push({type:xr,source:r,target:i}),Ar(e,0,n),e.edgeCount++,i}var o={checks:[]},a=t,s={checks:[]};return o.checks.push({type:wr,source:a,target:s}),Ar(e,0,o),e.edgeCount++,s}},{name:"undirectedEdge",separator:!0,regex:lr.undirectedEdge,populate:function(e,t){if(null==e.currentSubject){var n={checks:[]},r=t,i={checks:[]};return n.checks.push({type:br,nodes:[r,i]}),Ar(e,0,n),e.edgeCount++,i}var o={checks:[]},a=t,s={checks:[]};return o.checks.push({type:_r,node:a,neighbor:s}),Ar(e,0,o),s}},{name:"child",separator:!0,regex:lr.child,populate:function(e,t){if(null==e.currentSubject){var n={checks:[]},r={checks:[]},i=e[e.length-1];return n.checks.push({type:kr,parent:i,child:r}),Ar(e,0,n),e.compoundCount++,r}if(e.currentSubject===t){var o={checks:[]},a=e[e.length-1],s={checks:[]},l={checks:[]},c={checks:[]},u={checks:[]};return o.checks.push({type:Cr,left:a,right:s,subject:l}),l.checks=t.checks,t.checks=[{type:Tr}],u.checks.push({type:Tr}),s.checks.push({type:Pr,parent:u,child:c}),Ar(e,0,o),e.currentSubject=l,e.compoundCount++,c}var d={checks:[]},h={checks:[]},f=[{type:Pr,parent:d,child:h}];return d.checks=t.checks,t.checks=f,e.compoundCount++,h}},{name:"descendant",separator:!0,regex:lr.descendant,populate:function(e,t){if(null==e.currentSubject){var n={checks:[]},r={checks:[]},i=e[e.length-1];return n.checks.push({type:Sr,ancestor:i,descendant:r}),Ar(e,0,n),e.compoundCount++,r}if(e.currentSubject===t){var o={checks:[]},a=e[e.length-1],s={checks:[]},l={checks:[]},c={checks:[]},u={checks:[]};return o.checks.push({type:Cr,left:a,right:s,subject:l}),l.checks=t.checks,t.checks=[{type:Tr}],u.checks.push({type:Tr}),s.checks.push({type:jr,ancestor:u,descendant:c}),Ar(e,0,o),e.currentSubject=l,e.compoundCount++,c}var d={checks:[]},h={checks:[]},f=[{type:jr,ancestor:d,descendant:h}];return d.checks=t.checks,t.checks=f,e.compoundCount++,h}},{name:"subject",modifier:!0,regex:lr.subject,populate:function(e,t){if(null!=e.currentSubject&&e.currentSubject!==t)return Se("Redefinition of subject in selector `"+e.toString()+"`"),!1;e.currentSubject=t;var n=e[e.length-1].checks[0],r=null==n?null:n.type;r===xr?n.type=Er:r===br&&(n.type=_r,n.node=n.nodes[1],n.neighbor=n.nodes[0],n.nodes=null)}}];Rr.forEach((function(e){return e.regexObj=new RegExp("^"+e.regex)}));var Ir=function(e){for(var t,n,r,i=0;i<Rr.length;i++){var o=Rr[i],a=o.name,s=e.match(o.regexObj);if(null!=s){n=s,t=o,r=a;var l=s[0];e=e.substring(l.length);break}}return{expr:t,match:n,name:r,remaining:e}},Lr={parse:function(e){var t=this,n=t.inputText=e,r=t[0]={checks:[]};for(t.length=1,n=function(e){var t=e.match(/^\s+/);if(t){var n=t[0];e=e.substring(n.length)}return e}(n);;){var i=Ir(n);if(null==i.expr)return Se("The selector `"+e+"`is invalid"),!1;var o=i.match.slice(1),a=i.expr.populate(t,r,o);if(!1===a)return!1;if(null!=a&&(r=a),(n=i.remaining).match(/^\s*$/))break}var s=t[t.length-1];null!=t.currentSubject&&(s.subject=t.currentSubject),s.edgeCount=t.edgeCount,s.compoundCount=t.compoundCount;for(var l=0;l<t.length;l++){var c=t[l];if(c.compoundCount>0&&c.edgeCount>0)return Se("The selector `"+e+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(c.edgeCount>1)return Se("The selector `"+e+"` is invalid because it uses multiple edge selectors"),!1;1===c.edgeCount&&Se("The selector `"+e+"` is deprecated. Edge selectors do not take effect on changes to source and target nodes after an edge is added, for performance reasons. Use a class or data selector on edges instead, updating the class or data of an edge when your app detects a change in source or target nodes.")}return!0},toString:function(){if(null!=this.toStringCache)return this.toStringCache;for(var e=function(e){return null==e?"":e},t=function(t){return C(t)?'"'+t+'"':e(t)},n=function(e){return" "+e+" "},r=function(r,o){var a=r.type,s=r.value;switch(a){case cr:var l=e(s);return l.substring(0,l.length-1);case hr:var c=r.field,u=r.operator;return"["+c+n(e(u))+t(s)+"]";case pr:var d=r.operator,h=r.field;return"["+e(d)+h+"]";case fr:return"["+r.field+"]";case vr:var f=r.operator;return"[["+r.field+n(e(f))+t(s)+"]]";case gr:return s;case mr:return"#"+s;case yr:return"."+s;case Pr:case kr:return i(r.parent,o)+n(">")+i(r.child,o);case jr:case Sr:return i(r.ancestor,o)+" "+i(r.descendant,o);case Cr:var p=i(r.left,o),v=i(r.subject,o),g=i(r.right,o);return p+(p.length>0?" ":"")+v+g;case Tr:return""}},i=function(e,t){return e.checks.reduce((function(n,i,o){return n+(t===e&&0===o?"$":"")+r(i,t)}),"")},o="",a=0;a<this.length;a++){var s=this[a];o+=i(s,s.subject),this.length>1&&a<this.length-1&&(o+=", ")}return this.toStringCache=o,o}},Br=function(e,t,n){var r,i,o,a=C(e),s=O(e),l=C(n),c=!1,u=!1,d=!1;switch(t.indexOf("!")>=0&&(t=t.replace("!",""),u=!0),t.indexOf("@")>=0&&(t=t.replace("@",""),c=!0),(a||l||c)&&(i=a||s?""+e:"",o=""+n),c&&(e=i=i.toLowerCase(),n=o=o.toLowerCase()),t){case"*=":r=i.indexOf(o)>=0;break;case"$=":r=i.indexOf(o,i.length-o.length)>=0;break;case"^=":r=0===i.indexOf(o);break;case"=":r=e===n;break;case">":d=!0,r=e>n;break;case">=":d=!0,r=e>=n;break;case"<":d=!0,r=e<n;break;case"<=":d=!0,r=e<=n;break;default:r=!1}return!u||null==e&&d||(r=!r),r},Fr=function(e,t){return e.data(t)},zr=[],Vr=function(e,t){return e.checks.every((function(e){return zr[e.type](e,t)}))};zr[cr]=function(e,t){var n=e.value;return"*"===n||n===t.group()},zr[gr]=function(e,t){return function(e,t){return Nr[e](t)}(e.value,t)},zr[mr]=function(e,t){var n=e.value;return t.id()===n},zr[yr]=function(e,t){var n=e.value;return t.hasClass(n)},zr[vr]=function(e,t){var n=e.field,r=e.operator,i=e.value;return Br(function(e,t){return e[t]()}(t,n),r,i)},zr[hr]=function(e,t){var n=e.field,r=e.operator,i=e.value;return Br(Fr(t,n),r,i)},zr[pr]=function(e,t){var n=e.field,r=e.operator;return function(e,t){switch(t){case"?":return!!e;case"!":return!e;case"^":return void 0===e}}(Fr(t,n),r)},zr[fr]=function(e,t){var n=e.field;return e.operator,void 0!==Fr(t,n)},zr[br]=function(e,t){var n=e.nodes[0],r=e.nodes[1],i=t.source(),o=t.target();return Vr(n,i)&&Vr(r,o)||Vr(r,i)&&Vr(n,o)},zr[_r]=function(e,t){return Vr(e.node,t)&&t.neighborhood().some((function(t){return t.isNode()&&Vr(e.neighbor,t)}))},zr[xr]=function(e,t){return Vr(e.source,t.source())&&Vr(e.target,t.target())},zr[wr]=function(e,t){return Vr(e.source,t)&&t.outgoers().some((function(t){return t.isNode()&&Vr(e.target,t)}))},zr[Er]=function(e,t){return Vr(e.target,t)&&t.incomers().some((function(t){return t.isNode()&&Vr(e.source,t)}))},zr[kr]=function(e,t){return Vr(e.child,t)&&Vr(e.parent,t.parent())},zr[Pr]=function(e,t){return Vr(e.parent,t)&&t.children().some((function(t){return Vr(e.child,t)}))},zr[Sr]=function(e,t){return Vr(e.descendant,t)&&t.ancestors().some((function(t){return Vr(e.ancestor,t)}))},zr[jr]=function(e,t){return Vr(e.ancestor,t)&&t.descendants().some((function(t){return Vr(e.descendant,t)}))},zr[Cr]=function(e,t){return Vr(e.subject,t)&&Vr(e.left,t)&&Vr(e.right,t)},zr[Tr]=function(){return!0},zr[ur]=function(e,t){return e.value.has(t)},zr[dr]=function(e,t){return(0,e.value)(t)};var Gr={matches:function(e){for(var t=0;t<this.length;t++){var n=this[t];if(Vr(n,e))return!0}return!1},filter:function(e){var t=this;if(1===t.length&&1===t[0].checks.length&&t[0].checks[0].type===mr)return e.getElementById(t[0].checks[0].value).collection();var n=function(e){for(var n=0;n<t.length;n++){var r=t[n];if(Vr(r,e))return!0}return!1};return null==t.text()&&(n=function(){return!0}),e.filter(n)}},Hr=function(e){this.inputText=e,this.currentSubject=null,this.compoundCount=0,this.edgeCount=0,this.length=0,null==e||C(e)&&e.match(/^\s*$/)||(A(e)?this.addQuery({checks:[{type:ur,value:e.collection()}]}):T(e)?this.addQuery({checks:[{type:dr,value:e}]}):C(e)?this.parse(e)||(this.invalid=!0):_e("A selector must be created from a string; found "))},Wr=Hr.prototype;[Lr,Gr].forEach((function(e){return X(Wr,e)})),Wr.text=function(){return this.inputText},Wr.size=function(){return this.length},Wr.eq=function(e){return this[e]},Wr.sameText=function(e){return!this.invalid&&!e.invalid&&this.text()===e.text()},Wr.addQuery=function(e){this[this.length++]=e},Wr.selector=Wr.toString;var qr={allAre:function(e){var t=new Hr(e);return this.every((function(e){return t.matches(e)}))},is:function(e){var t=new Hr(e);return this.some((function(e){return t.matches(e)}))},some:function(e,t){for(var n=0;n<this.length;n++){if(t?e.apply(t,[this[n],n,this]):e(this[n],n,this))return!0}return!1},every:function(e,t){for(var n=0;n<this.length;n++){if(!(t?e.apply(t,[this[n],n,this]):e(this[n],n,this)))return!1}return!0},same:function(e){if(this===e)return!0;e=this.cy().collection(e);var t=this.length;return t===e.length&&(1===t?this[0]===e[0]:this.every((function(t){return e.hasElementWithId(t.id())})))},anySame:function(e){return e=this.cy().collection(e),this.some((function(t){return e.hasElementWithId(t.id())}))},allAreNeighbors:function(e){e=this.cy().collection(e);var t=this.neighborhood();return e.every((function(e){return t.hasElementWithId(e.id())}))},contains:function(e){e=this.cy().collection(e);var t=this;return e.every((function(e){return t.hasElementWithId(e.id())}))}};qr.allAreNeighbours=qr.allAreNeighbors,qr.has=qr.contains,qr.equal=qr.equals=qr.same;var Yr,Ur,Xr=function(e,t){return function(n,r,i,o){var a,s=n,l=this;if(null==s?a="":A(s)&&1===s.length&&(a=s.id()),1===l.length&&a){var c=l[0]._private,u=c.traversalCache=c.traversalCache||{},d=u[t]=u[t]||[],h=he(a),f=d[h];return f||(d[h]=e.call(l,n,r,i,o))}return e.call(l,n,r,i,o)}},$r={parent:function(e){var t=[];if(1===this.length){var n=this[0]._private.parent;if(n)return n}for(var r=0;r<this.length;r++){var i=this[r]._private.parent;i&&t.push(i)}return this.spawn(t,!0).filter(e)},parents:function(e){for(var t=[],n=this.parent();n.nonempty();){for(var r=0;r<n.length;r++){var i=n[r];t.push(i)}n=n.parent()}return this.spawn(t,!0).filter(e)},commonAncestors:function(e){for(var t,n=0;n<this.length;n++){var r=this[n].parents();t=(t=t||r).intersect(r)}return t.filter(e)},orphans:function(e){return this.stdFilter((function(e){return e.isOrphan()})).filter(e)},nonorphans:function(e){return this.stdFilter((function(e){return e.isChild()})).filter(e)},children:Xr((function(e){for(var t=[],n=0;n<this.length;n++)for(var r=this[n]._private.children,i=0;i<r.length;i++)t.push(r[i]);return this.spawn(t,!0).filter(e)}),"children"),siblings:function(e){return this.parent().children().not(this).filter(e)},isParent:function(){var e=this[0];if(e)return e.isNode()&&0!==e._private.children.length},isChildless:function(){var e=this[0];if(e)return e.isNode()&&0===e._private.children.length},isChild:function(){var e=this[0];if(e)return e.isNode()&&null!=e._private.parent},isOrphan:function(){var e=this[0];if(e)return e.isNode()&&null==e._private.parent},descendants:function(e){var t=[];return function e(n){for(var r=0;r<n.length;r++){var i=n[r];t.push(i),i.children().nonempty()&&e(i.children())}}(this.children()),this.spawn(t,!0).filter(e)}};function Kr(e,t,n,r){for(var i=[],o=new Le,a=e.cy().hasCompoundNodes(),s=0;s<e.length;s++){var l=e[s];n?i.push(l):a&&r(i,o,l)}for(;i.length>0;){var c=i.shift();t(c),o.add(c.id()),a&&r(i,o,c)}return e}function Zr(e,t,n){if(n.isParent())for(var r=n._private.children,i=0;i<r.length;i++){var o=r[i];t.has(o.id())||e.push(o)}}function Qr(e,t,n){if(n.isChild()){var r=n._private.parent;t.has(r.id())||e.push(r)}}function Jr(e,t,n){Qr(e,t,n),Zr(e,t,n)}$r.forEachDown=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return Kr(this,e,t,Zr)},$r.forEachUp=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return Kr(this,e,t,Qr)},$r.forEachUpAndDown=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return Kr(this,e,t,Jr)},$r.ancestors=$r.parents,(Yr=Ur={data:or.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),removeData:or.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:or.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:or.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:or.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:or.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var e=this[0];if(e)return e._private.data.id}}).attr=Yr.data,Yr.removeAttr=Yr.removeData;var ei,ti,ni=Ur,ri={};function ii(e){return function(t){var n=this;if(void 0===t&&(t=!0),0!==n.length&&n.isNode()&&!n.removed()){for(var r=0,i=n[0],o=i._private.edges,a=0;a<o.length;a++){var s=o[a];!t&&s.isLoop()||(r+=e(i,s))}return r}}}function oi(e,t){return function(n){for(var r,i=this.nodes(),o=0;o<i.length;o++){var a=i[o][e](n);void 0===a||void 0!==r&&!t(a,r)||(r=a)}return r}}X(ri,{degree:ii((function(e,t){return t.source().same(t.target())?2:1})),indegree:ii((function(e,t){return t.target().same(e)?1:0})),outdegree:ii((function(e,t){return t.source().same(e)?1:0}))}),X(ri,{minDegree:oi("degree",(function(e,t){return e<t})),maxDegree:oi("degree",(function(e,t){return e>t})),minIndegree:oi("indegree",(function(e,t){return e<t})),maxIndegree:oi("indegree",(function(e,t){return e>t})),minOutdegree:oi("outdegree",(function(e,t){return e<t})),maxOutdegree:oi("outdegree",(function(e,t){return e>t}))}),X(ri,{totalDegree:function(e){for(var t=0,n=this.nodes(),r=0;r<n.length;r++)t+=n[r].degree(e);return t}});var ai=function(e,t,n){for(var r=0;r<e.length;r++){var i=e[r];if(!i.locked()){var o=i._private.position,a={x:null!=t.x?t.x-o.x:0,y:null!=t.y?t.y-o.y:0};!i.isParent()||0===a.x&&0===a.y||i.children().shift(a,n),i.dirtyBoundingBoxCache()}}},si={field:"position",bindingEvent:"position",allowBinding:!0,allowSetting:!0,settingEvent:"position",settingTriggersEvent:!0,triggerFnName:"emitAndNotify",allowGetting:!0,validKeys:["x","y"],beforeGet:function(e){e.updateCompoundBounds()},beforeSet:function(e,t){ai(e,t,!1)},onSet:function(e){e.dirtyCompoundBoundsCache()},canSet:function(e){return!e.locked()}};ei=ti={position:or.data(si),silentPosition:or.data(X({},si,{allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!1,beforeSet:function(e,t){ai(e,t,!0)},onSet:function(e){e.dirtyCompoundBoundsCache()}})),positions:function(e,t){if(N(e))t?this.silentPosition(e):this.position(e);else if(T(e)){var n=e,r=this.cy();r.startBatch();for(var i=0;i<this.length;i++){var o,a=this[i];(o=n(a,i))&&(t?a.silentPosition(o):a.position(o))}r.endBatch()}return this},silentPositions:function(e){return this.positions(e,!0)},shift:function(e,t,n){var r;if(N(e)?(r={x:O(e.x)?e.x:0,y:O(e.y)?e.y:0},n=t):C(e)&&O(t)&&((r={x:0,y:0})[e]=t),null!=r){var i=this.cy();i.startBatch();for(var o=0;o<this.length;o++){var a=this[o];if(!(i.hasCompoundNodes()&&a.isChild()&&a.ancestors().anySame(this))){var s=a.position(),l={x:s.x+r.x,y:s.y+r.y};n?a.silentPosition(l):a.position(l)}}i.endBatch()}return this},silentShift:function(e,t){return N(e)?this.shift(e,!0):C(e)&&O(t)&&this.shift(e,t,!0),this},renderedPosition:function(e,t){var n=this[0],r=this.cy(),i=r.zoom(),o=r.pan(),a=N(e)?e:void 0,s=void 0!==a||void 0!==t&&C(e);if(n&&n.isNode()){if(!s){var l=n.position();return a=et(l,i,o),void 0===e?a:a[e]}for(var c=0;c<this.length;c++){var u=this[c];void 0!==t?u.position(e,(t-o[e])/i):void 0!==a&&u.position(tt(a,i,o))}}else if(!s)return;return this},relativePosition:function(e,t){var n=this[0],r=this.cy(),i=N(e)?e:void 0,o=void 0!==i||void 0!==t&&C(e),a=r.hasCompoundNodes();if(n&&n.isNode()){if(!o){var s=n.position(),l=a?n.parent():null,c=l&&l.length>0,u=c;c&&(l=l[0]);var d=u?l.position():{x:0,y:0};return i={x:s.x-d.x,y:s.y-d.y},void 0===e?i:i[e]}for(var h=0;h<this.length;h++){var f=this[h],p=a?f.parent():null,v=p&&p.length>0,g=v;v&&(p=p[0]);var m=g?p.position():{x:0,y:0};void 0!==t?f.position(e,t+m[e]):void 0!==i&&f.position({x:i.x+m.x,y:i.y+m.y})}}else if(!o)return;return this}},ei.modelPosition=ei.point=ei.position,ei.modelPositions=ei.points=ei.positions,ei.renderedPoint=ei.renderedPosition,ei.relativePoint=ei.relativePosition;var li,ci,ui=ti;li=ci={},ci.renderedBoundingBox=function(e){var t=this.boundingBox(e),n=this.cy(),r=n.zoom(),i=n.pan(),o=t.x1*r+i.x,a=t.x2*r+i.x,s=t.y1*r+i.y,l=t.y2*r+i.y;return{x1:o,x2:a,y1:s,y2:l,w:a-o,h:l-s}},ci.dirtyCompoundBoundsCache=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.cy();return t.styleEnabled()&&t.hasCompoundNodes()?(this.forEachUp((function(t){if(t.isParent()){var n=t._private;n.compoundBoundsClean=!1,n.bbCache=null,e||t.emitAndNotify("bounds")}})),this):this},ci.updateCompoundBounds=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.cy();if(!t.styleEnabled()||!t.hasCompoundNodes())return this;if(!e&&t.batching())return this;function n(e){if(e.isParent()){var t=e._private,n=e.children(),r="include"===e.pstyle("compound-sizing-wrt-labels").value,i={width:{val:e.pstyle("min-width").pfValue,left:e.pstyle("min-width-bias-left"),right:e.pstyle("min-width-bias-right")},height:{val:e.pstyle("min-height").pfValue,top:e.pstyle("min-height-bias-top"),bottom:e.pstyle("min-height-bias-bottom")}},o=n.boundingBox({includeLabels:r,includeOverlays:!1,useCache:!1}),a=t.position;0!==o.w&&0!==o.h||((o={w:e.pstyle("width").pfValue,h:e.pstyle("height").pfValue}).x1=a.x-o.w/2,o.x2=a.x+o.w/2,o.y1=a.y-o.h/2,o.y2=a.y+o.h/2);var s=i.width.left.value;"px"===i.width.left.units&&i.width.val>0&&(s=100*s/i.width.val);var l=i.width.right.value;"px"===i.width.right.units&&i.width.val>0&&(l=100*l/i.width.val);var c=i.height.top.value;"px"===i.height.top.units&&i.height.val>0&&(c=100*c/i.height.val);var u=i.height.bottom.value;"px"===i.height.bottom.units&&i.height.val>0&&(u=100*u/i.height.val);var d=m(i.width.val-o.w,s,l),h=d.biasDiff,f=d.biasComplementDiff,p=m(i.height.val-o.h,c,u),v=p.biasDiff,g=p.biasComplementDiff;t.autoPadding=function(e,t,n,r){if("%"!==n.units)return"px"===n.units?n.pfValue:0;switch(r){case"width":return e>0?n.pfValue*e:0;case"height":return t>0?n.pfValue*t:0;case"average":return e>0&&t>0?n.pfValue*(e+t)/2:0;case"min":return e>0&&t>0?e>t?n.pfValue*t:n.pfValue*e:0;case"max":return e>0&&t>0?e>t?n.pfValue*e:n.pfValue*t:0;default:return 0}}(o.w,o.h,e.pstyle("padding"),e.pstyle("padding-relative-to").value),t.autoWidth=Math.max(o.w,i.width.val),a.x=(-h+o.x1+o.x2+f)/2,t.autoHeight=Math.max(o.h,i.height.val),a.y=(-v+o.y1+o.y2+g)/2}function m(e,t,n){var r=0,i=0,o=t+n;return e>0&&o>0&&(r=t/o*e,i=n/o*e),{biasDiff:r,biasComplementDiff:i}}}for(var r=0;r<this.length;r++){var i=this[r],o=i._private;o.compoundBoundsClean&&!e||(n(i),t.batching()||(o.compoundBoundsClean=!0))}return this};var di=function(e){return e===1/0||e===-1/0?0:e},hi=function(e,t,n,r,i){r-t!=0&&i-n!=0&&null!=t&&null!=n&&null!=r&&null!=i&&(e.x1=t<e.x1?t:e.x1,e.x2=r>e.x2?r:e.x2,e.y1=n<e.y1?n:e.y1,e.y2=i>e.y2?i:e.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1)},fi=function(e,t){return null==t?e:hi(e,t.x1,t.y1,t.x2,t.y2)},pi=function(e,t,n){return Me(e,t,n)},vi=function(e,t,n){if(!t.cy().headless()){var r,i,o=t._private,a=o.rstyle,s=a.arrowWidth/2;if("none"!==t.pstyle(n+"-arrow-shape").value){"source"===n?(r=a.srcX,i=a.srcY):"target"===n?(r=a.tgtX,i=a.tgtY):(r=a.midX,i=a.midY);var l=o.arrowBounds=o.arrowBounds||{},c=l[n]=l[n]||{};c.x1=r-s,c.y1=i-s,c.x2=r+s,c.y2=i+s,c.w=c.x2-c.x1,c.h=c.y2-c.y1,pt(c,1),hi(e,c.x1,c.y1,c.x2,c.y2)}}},gi=function(e,t,n){if(!t.cy().headless()){var r;r=n?n+"-":"";var i=t._private,o=i.rstyle;if(t.pstyle(r+"label").strValue){var a,s,l,c,u=t.pstyle("text-halign"),d=t.pstyle("text-valign"),h=pi(o,"labelWidth",n),f=pi(o,"labelHeight",n),p=pi(o,"labelX",n),v=pi(o,"labelY",n),g=t.pstyle(r+"text-margin-x").pfValue,m=t.pstyle(r+"text-margin-y").pfValue,y=t.isEdge(),b=t.pstyle(r+"text-rotation"),x=t.pstyle("text-outline-width").pfValue,w=t.pstyle("text-border-width").pfValue/2,E=t.pstyle("text-background-padding").pfValue,_=f,k=h,S=k/2,P=_/2;if(y)a=p-S,s=p+S,l=v-P,c=v+P;else{switch(u.value){case"left":a=p-k,s=p;break;case"center":a=p-S,s=p+S;break;case"right":a=p,s=p+k}switch(d.value){case"top":l=v-_,c=v;break;case"center":l=v-P,c=v+P;break;case"bottom":l=v,c=v+_}}a+=g-Math.max(x,w)-E-2,s+=g+Math.max(x,w)+E+2,l+=m-Math.max(x,w)-E-2,c+=m+Math.max(x,w)+E+2;var j=n||"main",C=i.labelBounds,T=C[j]=C[j]||{};T.x1=a,T.y1=l,T.x2=s,T.y2=c,T.w=s-a,T.h=c-l;var D=y&&"autorotate"===b.strValue,N=null!=b.pfValue&&0!==b.pfValue;if(D||N){var O=D?pi(i.rstyle,"labelAngle",n):b.pfValue,M=Math.cos(O),A=Math.sin(O),R=(a+s)/2,I=(l+c)/2;if(!y){switch(u.value){case"left":R=s;break;case"right":R=a}switch(d.value){case"top":I=c;break;case"bottom":I=l}}var L=function(e,t){return{x:(e-=R)*M-(t-=I)*A+R,y:e*A+t*M+I}},B=L(a,l),F=L(a,c),z=L(s,l),V=L(s,c);a=Math.min(B.x,F.x,z.x,V.x),s=Math.max(B.x,F.x,z.x,V.x),l=Math.min(B.y,F.y,z.y,V.y),c=Math.max(B.y,F.y,z.y,V.y)}var G=j+"Rot",H=C[G]=C[G]||{};H.x1=a,H.y1=l,H.x2=s,H.y2=c,H.w=s-a,H.h=c-l,hi(e,a,l,s,c),hi(i.labelBounds.all,a,l,s,c)}return e}},mi=function(e){var t=0,n=function(e){return(e?1:0)<<t++},r=0;return r+=n(e.incudeNodes),r+=n(e.includeEdges),r+=n(e.includeLabels),r+=n(e.includeMainLabels),r+=n(e.includeSourceLabels),r+=n(e.includeTargetLabels),r+=n(e.includeOverlays)},yi=function(e){if(e.isEdge()){var t=e.source().position(),n=e.target().position(),r=function(e){return Math.round(e)};return function(e,t){var n={value:0,done:!1},r=0,i=e.length;return se({next:function(){return r<i?n.value=e[r++]:n.done=!0,n}},t)}([r(t.x),r(t.y),r(n.x),r(n.y)])}return 0},bi=function(e,t){var n,r=e._private,i=e.isEdge(),o=(null==t?wi:mi(t))===wi,a=yi(e),s=r.bbCachePosKey===a,l=t.useCache&&s,c=function(e){return null==e._private.bbCache||e._private.styleDirty};if(!l||c(e)||i&&c(e.source())||c(e.target())?(s||e.recalculateRenderedStyle(l),n=function(e,t){var n,r,i,o,a,s,l,c=e._private.cy,u=c.styleEnabled(),d=c.headless(),h=ht(),f=e._private,p=e.isNode(),v=e.isEdge(),g=f.rstyle,m=p&&u?e.pstyle("bounds-expansion").pfValue:[0],y=function(e){return"none"!==e.pstyle("display").value},b=!u||y(e)&&(!v||y(e.source())&&y(e.target()));if(b){var x=0;u&&t.includeOverlays&&0!==e.pstyle("overlay-opacity").value&&(x=e.pstyle("overlay-padding").value);var w=0;u&&t.includeUnderlays&&0!==e.pstyle("underlay-opacity").value&&(w=e.pstyle("underlay-padding").value);var E=Math.max(x,w),_=0;if(u&&(_=e.pstyle("width").pfValue/2),p&&t.includeNodes){var k=e.position();a=k.x,s=k.y;var S=e.outerWidth()/2,P=e.outerHeight()/2;hi(h,n=a-S,i=s-P,r=a+S,o=s+P)}else if(v&&t.includeEdges)if(u&&!d){var j=e.pstyle("curve-style").strValue;if(n=Math.min(g.srcX,g.midX,g.tgtX),r=Math.max(g.srcX,g.midX,g.tgtX),i=Math.min(g.srcY,g.midY,g.tgtY),o=Math.max(g.srcY,g.midY,g.tgtY),hi(h,n-=_,i-=_,r+=_,o+=_),"haystack"===j){var C=g.haystackPts;if(C&&2===C.length){if(n=C[0].x,i=C[0].y,n>(r=C[1].x)){var T=n;n=r,r=T}if(i>(o=C[1].y)){var D=i;i=o,o=D}hi(h,n-_,i-_,r+_,o+_)}}else if("bezier"===j||"unbundled-bezier"===j||"segments"===j||"taxi"===j){var N;switch(j){case"bezier":case"unbundled-bezier":N=g.bezierPts;break;case"segments":case"taxi":N=g.linePts}if(null!=N)for(var O=0;O<N.length;O++){var M=N[O];n=M.x-_,r=M.x+_,i=M.y-_,o=M.y+_,hi(h,n,i,r,o)}}}else{var A=e.source().position(),R=e.target().position();if((n=A.x)>(r=R.x)){var I=n;n=r,r=I}if((i=A.y)>(o=R.y)){var L=i;i=o,o=L}hi(h,n-=_,i-=_,r+=_,o+=_)}if(u&&t.includeEdges&&v&&(vi(h,e,"mid-source"),vi(h,e,"mid-target"),vi(h,e,"source"),vi(h,e,"target")),u&&"yes"===e.pstyle("ghost").value){var B=e.pstyle("ghost-offset-x").pfValue,F=e.pstyle("ghost-offset-y").pfValue;hi(h,h.x1+B,h.y1+F,h.x2+B,h.y2+F)}var z=f.bodyBounds=f.bodyBounds||{};gt(z,h),vt(z,m),pt(z,1),u&&(n=h.x1,r=h.x2,i=h.y1,o=h.y2,hi(h,n-E,i-E,r+E,o+E));var V=f.overlayBounds=f.overlayBounds||{};gt(V,h),vt(V,m),pt(V,1);var G=f.labelBounds=f.labelBounds||{};null!=G.all?((l=G.all).x1=1/0,l.y1=1/0,l.x2=-1/0,l.y2=-1/0,l.w=0,l.h=0):G.all=ht(),u&&t.includeLabels&&(t.includeMainLabels&&gi(h,e,null),v&&(t.includeSourceLabels&&gi(h,e,"source"),t.includeTargetLabels&&gi(h,e,"target")))}return h.x1=di(h.x1),h.y1=di(h.y1),h.x2=di(h.x2),h.y2=di(h.y2),h.w=di(h.x2-h.x1),h.h=di(h.y2-h.y1),h.w>0&&h.h>0&&b&&(vt(h,m),pt(h,1)),h}(e,xi),r.bbCache=n,r.bbCachePosKey=a):n=r.bbCache,!o){var u=e.isNode();n=ht(),(t.includeNodes&&u||t.includeEdges&&!u)&&(t.includeOverlays?fi(n,r.overlayBounds):fi(n,r.bodyBounds)),t.includeLabels&&(t.includeMainLabels&&(!i||t.includeSourceLabels&&t.includeTargetLabels)?fi(n,r.labelBounds.all):(t.includeMainLabels&&fi(n,r.labelBounds.mainRot),t.includeSourceLabels&&fi(n,r.labelBounds.sourceRot),t.includeTargetLabels&&fi(n,r.labelBounds.targetRot))),n.w=n.x2-n.x1,n.h=n.y2-n.y1}return n},xi={includeNodes:!0,includeEdges:!0,includeLabels:!0,includeMainLabels:!0,includeSourceLabels:!0,includeTargetLabels:!0,includeOverlays:!0,includeUnderlays:!0,useCache:!0},wi=mi(xi),Ei=De(xi);ci.boundingBox=function(e){var t;if(1!==this.length||null==this[0]._private.bbCache||this[0]._private.styleDirty||void 0!==e&&void 0!==e.useCache&&!0!==e.useCache){t=ht();var n=Ei(e=e||xi),r=this;if(r.cy().styleEnabled())for(var i=0;i<r.length;i++){var o=r[i],a=o._private,s=yi(o),l=a.bbCachePosKey===s,c=n.useCache&&l&&!a.styleDirty;o.recalculateRenderedStyle(c)}this.updateCompoundBounds(!e.useCache);for(var u=0;u<r.length;u++){var d=r[u];fi(t,bi(d,n))}}else e=void 0===e?xi:Ei(e),t=bi(this[0],e);return t.x1=di(t.x1),t.y1=di(t.y1),t.x2=di(t.x2),t.y2=di(t.y2),t.w=di(t.x2-t.x1),t.h=di(t.y2-t.y1),t},ci.dirtyBoundingBoxCache=function(){for(var e=0;e<this.length;e++){var t=this[e]._private;t.bbCache=null,t.bbCachePosKey=null,t.bodyBounds=null,t.overlayBounds=null,t.labelBounds.all=null,t.labelBounds.source=null,t.labelBounds.target=null,t.labelBounds.main=null,t.labelBounds.sourceRot=null,t.labelBounds.targetRot=null,t.labelBounds.mainRot=null,t.arrowBounds.source=null,t.arrowBounds.target=null,t.arrowBounds["mid-source"]=null,t.arrowBounds["mid-target"]=null}return this.emitAndNotify("bounds"),this},ci.boundingBoxAt=function(e){var t=this.nodes(),n=this.cy(),r=n.hasCompoundNodes(),i=n.collection();if(r&&(i=t.filter((function(e){return e.isParent()})),t=t.not(i)),N(e)){var o=e;e=function(){return o}}n.startBatch(),t.forEach((function(t,n){return t._private.bbAtOldPos=e(t,n)})).silentPositions(e),r&&(i.dirtyCompoundBoundsCache(),i.dirtyBoundingBoxCache(),i.updateCompoundBounds(!0));var a=function(e){return{x1:e.x1,x2:e.x2,w:e.w,y1:e.y1,y2:e.y2,h:e.h}}(this.boundingBox({useCache:!1}));return t.silentPositions((function(e){return e._private.bbAtOldPos})),r&&(i.dirtyCompoundBoundsCache(),i.dirtyBoundingBoxCache(),i.updateCompoundBounds(!0)),n.endBatch(),a},li.boundingbox=li.bb=li.boundingBox,li.renderedBoundingbox=li.renderedBoundingBox;var _i,ki,Si=ci;_i=ki={};var Pi=function(e){e.uppercaseName=q(e.name),e.autoName="auto"+e.uppercaseName,e.labelName="label"+e.uppercaseName,e.outerName="outer"+e.uppercaseName,e.uppercaseOuterName=q(e.outerName),_i[e.name]=function(){var t=this[0],n=t._private,r=n.cy._private.styleEnabled;if(t){if(r){if(t.isParent())return t.updateCompoundBounds(),n[e.autoName]||0;var i=t.pstyle(e.name);return"label"===i.strValue?(t.recalculateRenderedStyle(),n.rstyle[e.labelName]||0):i.pfValue}return 1}},_i["outer"+e.uppercaseName]=function(){var t=this[0],n=t._private.cy._private.styleEnabled;if(t)return n?t[e.name]()+t.pstyle("border-width").pfValue+2*t.padding():1},_i["rendered"+e.uppercaseName]=function(){var t=this[0];if(t)return t[e.name]()*this.cy().zoom()},_i["rendered"+e.uppercaseOuterName]=function(){var t=this[0];if(t)return t[e.outerName]()*this.cy().zoom()}};Pi({name:"width"}),Pi({name:"height"}),ki.padding=function(){var e=this[0],t=e._private;return e.isParent()?(e.updateCompoundBounds(),void 0!==t.autoPadding?t.autoPadding:e.pstyle("padding").pfValue):e.pstyle("padding").pfValue},ki.paddedHeight=function(){var e=this[0];return e.height()+2*e.padding()},ki.paddedWidth=function(){var e=this[0];return e.width()+2*e.padding()};var ji=ki,Ci={controlPoints:{get:function(e){return e.renderer().getControlPoints(e)},mult:!0},segmentPoints:{get:function(e){return e.renderer().getSegmentPoints(e)},mult:!0},sourceEndpoint:{get:function(e){return e.renderer().getSourceEndpoint(e)}},targetEndpoint:{get:function(e){return e.renderer().getTargetEndpoint(e)}},midpoint:{get:function(e){return e.renderer().getEdgeMidpoint(e)}}},Ti=Object.keys(Ci).reduce((function(e,t){var n=Ci[t],r=function(e){return"rendered"+e[0].toUpperCase()+e.substr(1)}(t);return e[t]=function(){return function(e,t){if(e.isEdge())return t(e)}(this,n.get)},n.mult?e[r]=function(){return function(e,t){if(e.isEdge()){var n=e.cy(),r=n.pan(),i=n.zoom();return t(e).map((function(e){return et(e,i,r)}))}}(this,n.get)}:e[r]=function(){return function(e,t){if(e.isEdge()){var n=e.cy();return et(t(e),n.zoom(),n.pan())}}(this,n.get)},e}),{}),Di=X({},ui,Si,ji,Ti),Ni=function(e,t){this.recycle(e,t)};function Oi(){return!1}function Mi(){return!0}Ni.prototype={instanceString:function(){return"event"},recycle:function(e,t){if(this.isImmediatePropagationStopped=this.isPropagationStopped=this.isDefaultPrevented=Oi,null!=e&&e.preventDefault?(this.type=e.type,this.isDefaultPrevented=e.defaultPrevented?Mi:Oi):null!=e&&e.type?t=e:this.type=e,null!=t&&(this.originalEvent=t.originalEvent,this.type=null!=t.type?t.type:this.type,this.cy=t.cy,this.target=t.target,this.position=t.position,this.renderedPosition=t.renderedPosition,this.namespace=t.namespace,this.layout=t.layout),null!=this.cy&&null!=this.position&&null==this.renderedPosition){var n=this.position,r=this.cy.zoom(),i=this.cy.pan();this.renderedPosition={x:n.x*r+i.x,y:n.y*r+i.y}}this.timeStamp=e&&e.timeStamp||Date.now()},preventDefault:function(){this.isDefaultPrevented=Mi;var e=this.originalEvent;e&&e.preventDefault&&e.preventDefault()},stopPropagation:function(){this.isPropagationStopped=Mi;var e=this.originalEvent;e&&e.stopPropagation&&e.stopPropagation()},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=Mi,this.stopPropagation()},isDefaultPrevented:Oi,isPropagationStopped:Oi,isImmediatePropagationStopped:Oi};var Ai=/^([^.]+)(\.(?:[^.]+))?$/,Ri={qualifierCompare:function(e,t){return e===t},eventMatches:function(){return!0},addEventFields:function(){},callbackContext:function(e){return e},beforeEmit:function(){},afterEmit:function(){},bubble:function(){return!1},parent:function(){return null},context:null},Ii=Object.keys(Ri),Li={};function Bi(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Li,t=arguments.length>1?arguments[1]:void 0,n=0;n<Ii.length;n++){var r=Ii[n];this[r]=e[r]||Ri[r]}this.context=t||this.context,this.listeners=[],this.emitting=0}var Fi=Bi.prototype,zi=function(e,t,n,r,i,o,a){T(r)&&(i=r,r=null),a&&(o=null==o?a:X({},o,a));for(var s=D(n)?n:n.split(/\s+/),l=0;l<s.length;l++){var c=s[l];if(!F(c)){var u=c.match(Ai);if(u)if(!1===t(e,c,u[1],u[2]?u[2]:null,r,i,o))break}}},Vi=function(e,t){return e.addEventFields(e.context,t),new Ni(t.type,t)},Gi=function(e,t,n){if("event"!==j(n))if(N(n))t(e,Vi(e,n));else for(var r=D(n)?n:n.split(/\s+/),i=0;i<r.length;i++){var o=r[i];if(!F(o)){var a=o.match(Ai);if(a){var s=a[1],l=a[2]?a[2]:null;t(e,Vi(e,{type:s,namespace:l,target:e.context}))}}}else t(e,n)};Fi.on=Fi.addListener=function(e,t,n,r,i){return zi(this,(function(e,t,n,r,i,o,a){T(o)&&e.listeners.push({event:t,callback:o,type:n,namespace:r,qualifier:i,conf:a})}),e,t,n,r,i),this},Fi.one=function(e,t,n,r){return this.on(e,t,n,r,{one:!0})},Fi.removeListener=Fi.off=function(e,t,n,r){var i=this;0!==this.emitting&&(this.listeners=this.listeners.slice());for(var o=this.listeners,a=function(a){var s=o[a];zi(i,(function(t,n,r,i,l,c){if((s.type===r||"*"===e)&&(!i&&".*"!==s.namespace||s.namespace===i)&&(!l||t.qualifierCompare(s.qualifier,l))&&(!c||s.callback===c))return o.splice(a,1),!1}),e,t,n,r)},s=o.length-1;s>=0;s--)a(s);return this},Fi.removeAllListeners=function(){return this.removeListener("*")},Fi.emit=Fi.trigger=function(e,t,n){var r=this.listeners,i=r.length;return this.emitting++,D(t)||(t=[t]),Gi(this,(function(e,o){null!=n&&(r=[{event:o.event,type:o.type,namespace:o.namespace,callback:n}],i=r.length);for(var a=function(n){var i=r[n];if(i.type===o.type&&(!i.namespace||i.namespace===o.namespace||".*"===i.namespace)&&e.eventMatches(e.context,i,o)){var a=[o];null!=t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];e.push(r)}}(a,t),e.beforeEmit(e.context,i,o),i.conf&&i.conf.one&&(e.listeners=e.listeners.filter((function(e){return e!==i})));var s=e.callbackContext(e.context,i,o),l=i.callback.apply(s,a);e.afterEmit(e.context,i,o),!1===l&&(o.stopPropagation(),o.preventDefault())}},s=0;s<i;s++)a(s);e.bubble(e.context)&&!o.isPropagationStopped()&&e.parent(e.context).emit(o,t)}),e),this.emitting--,this};var Hi={qualifierCompare:function(e,t){return null==e||null==t?null==e&&null==t:e.sameText(t)},eventMatches:function(e,t,n){var r=t.qualifier;return null==r||e!==n.target&&R(n.target)&&r.matches(n.target)},addEventFields:function(e,t){t.cy=e.cy(),t.target=e},callbackContext:function(e,t,n){return null!=t.qualifier?n.target:e},beforeEmit:function(e,t){t.conf&&t.conf.once&&t.conf.onceCollection.removeListener(t.event,t.qualifier,t.callback)},bubble:function(){return!0},parent:function(e){return e.isChild()?e.parent():e.cy()}},Wi=function(e){return C(e)?new Hr(e):e},qi={createEmitter:function(){for(var e=0;e<this.length;e++){var t=this[e],n=t._private;n.emitter||(n.emitter=new Bi(Hi,t))}return this},emitter:function(){return this._private.emitter},on:function(e,t,n){for(var r=Wi(t),i=0;i<this.length;i++){this[i].emitter().on(e,r,n)}return this},removeListener:function(e,t,n){for(var r=Wi(t),i=0;i<this.length;i++){this[i].emitter().removeListener(e,r,n)}return this},removeAllListeners:function(){for(var e=0;e<this.length;e++){this[e].emitter().removeAllListeners()}return this},one:function(e,t,n){for(var r=Wi(t),i=0;i<this.length;i++){this[i].emitter().one(e,r,n)}return this},once:function(e,t,n){for(var r=Wi(t),i=0;i<this.length;i++){this[i].emitter().on(e,r,n,{once:!0,onceCollection:this})}},emit:function(e,t){for(var n=0;n<this.length;n++){this[n].emitter().emit(e,t)}return this},emitAndNotify:function(e,t){if(0!==this.length)return this.cy().notify(e,this),this.emit(e,t),this}};or.eventAliasesOn(qi);var Yi={nodes:function(e){return this.filter((function(e){return e.isNode()})).filter(e)},edges:function(e){return this.filter((function(e){return e.isEdge()})).filter(e)},byGroup:function(){for(var e=this.spawn(),t=this.spawn(),n=0;n<this.length;n++){var r=this[n];r.isNode()?e.push(r):t.push(r)}return{nodes:e,edges:t}},filter:function(e,t){if(void 0===e)return this;if(C(e)||A(e))return new Hr(e).filter(this);if(T(e)){for(var n=this.spawn(),r=this,i=0;i<r.length;i++){var o=r[i];(t?e.apply(t,[o,i,r]):e(o,i,r))&&n.push(o)}return n}return this.spawn()},not:function(e){if(e){C(e)&&(e=this.filter(e));for(var t=this.spawn(),n=0;n<this.length;n++){var r=this[n];e.has(r)||t.push(r)}return t}return this},absoluteComplement:function(){return this.cy().mutableElements().not(this)},intersect:function(e){if(C(e)){var t=e;return this.filter(t)}for(var n=this.spawn(),r=e,i=this.length<e.length,o=i?this:r,a=i?r:this,s=0;s<o.length;s++){var l=o[s];a.has(l)&&n.push(l)}return n},xor:function(e){var t=this._private.cy;C(e)&&(e=t.$(e));var n=this.spawn(),r=e,i=function(e,t){for(var r=0;r<e.length;r++){var i=e[r],o=i._private.data.id;t.hasElementWithId(o)||n.push(i)}};return i(this,r),i(r,this),n},diff:function(e){var t=this._private.cy;C(e)&&(e=t.$(e));var n=this.spawn(),r=this.spawn(),i=this.spawn(),o=e,a=function(e,t,n){for(var r=0;r<e.length;r++){var o=e[r],a=o._private.data.id;t.hasElementWithId(a)?i.merge(o):n.push(o)}};return a(this,o,n),a(o,this,r),{left:n,right:r,both:i}},add:function(e){var t=this._private.cy;if(!e)return this;if(C(e)){var n=e;e=t.mutableElements().filter(n)}for(var r=this.spawnSelf(),i=0;i<e.length;i++){var o=e[i],a=!this.has(o);a&&r.push(o)}return r},merge:function(e){var t=this._private,n=t.cy;if(!e)return this;if(e&&C(e)){var r=e;e=n.mutableElements().filter(r)}for(var i=t.map,o=0;o<e.length;o++){var a=e[o],s=a._private.data.id;if(!i.has(s)){var l=this.length++;this[l]=a,i.set(s,{ele:a,index:l})}}return this},unmergeAt:function(e){var t=this[e].id(),n=this._private.map;this[e]=void 0,n.delete(t);var r=e===this.length-1;if(this.length>1&&!r){var i=this.length-1,o=this[i],a=o._private.data.id;this[i]=void 0,this[e]=o,n.set(a,{ele:o,index:e})}return this.length--,this},unmergeOne:function(e){e=e[0];var t=this._private,n=e._private.data.id,r=t.map.get(n);if(!r)return this;var i=r.index;return this.unmergeAt(i),this},unmerge:function(e){var t=this._private.cy;if(!e)return this;if(e&&C(e)){var n=e;e=t.mutableElements().filter(n)}for(var r=0;r<e.length;r++)this.unmergeOne(e[r]);return this},unmergeBy:function(e){for(var t=this.length-1;t>=0;t--){e(this[t])&&this.unmergeAt(t)}return this},map:function(e,t){for(var n=[],r=this,i=0;i<r.length;i++){var o=r[i],a=t?e.apply(t,[o,i,r]):e(o,i,r);n.push(a)}return n},reduce:function(e,t){for(var n=t,r=this,i=0;i<r.length;i++)n=e(n,r[i],i,r);return n},max:function(e,t){for(var n,r=-1/0,i=this,o=0;o<i.length;o++){var a=i[o],s=t?e.apply(t,[a,o,i]):e(a,o,i);s>r&&(r=s,n=a)}return{value:r,ele:n}},min:function(e,t){for(var n,r=1/0,i=this,o=0;o<i.length;o++){var a=i[o],s=t?e.apply(t,[a,o,i]):e(a,o,i);s<r&&(r=s,n=a)}return{value:r,ele:n}}},Ui=Yi;Ui.u=Ui["|"]=Ui["+"]=Ui.union=Ui.or=Ui.add,Ui["\\"]=Ui["!"]=Ui["-"]=Ui.difference=Ui.relativeComplement=Ui.subtract=Ui.not,Ui.n=Ui["&"]=Ui["."]=Ui.and=Ui.intersection=Ui.intersect,Ui["^"]=Ui["(+)"]=Ui["(-)"]=Ui.symmetricDifference=Ui.symdiff=Ui.xor,Ui.fnFilter=Ui.filterFn=Ui.stdFilter=Ui.filter,Ui.complement=Ui.abscomp=Ui.absoluteComplement;var Xi=function(e,t){var n=e.cy().hasCompoundNodes();function r(e){var t=e.pstyle("z-compound-depth");return"auto"===t.value?n?e.zDepth():0:"bottom"===t.value?-1:"top"===t.value?ye:0}var i=r(e)-r(t);if(0!==i)return i;function o(e){return"auto"===e.pstyle("z-index-compare").value&&e.isNode()?1:0}var a=o(e)-o(t);if(0!==a)return a;var s=e.pstyle("z-index").value-t.pstyle("z-index").value;return 0!==s?s:e.poolIndex()-t.poolIndex()},$i={forEach:function(e,t){if(T(e))for(var n=this.length,r=0;r<n;r++){var i=this[r];if(!1===(t?e.apply(t,[i,r,this]):e(i,r,this)))break}return this},toArray:function(){for(var e=[],t=0;t<this.length;t++)e.push(this[t]);return e},slice:function(e,t){var n=[],r=this.length;null==t&&(t=r),null==e&&(e=0),e<0&&(e=r+e),t<0&&(t=r+t);for(var i=e;i>=0&&i<t&&i<r;i++)n.push(this[i]);return this.spawn(n)},size:function(){return this.length},eq:function(e){return this[e]||this.spawn()},first:function(){return this[0]||this.spawn()},last:function(){return this[this.length-1]||this.spawn()},empty:function(){return 0===this.length},nonempty:function(){return!this.empty()},sort:function(e){if(!T(e))return this;var t=this.toArray().sort(e);return this.spawn(t)},sortByZIndex:function(){return this.sort(Xi)},zDepth:function(){var e=this[0];if(e){var t=e._private;if("nodes"===t.group){var n=t.data.parent?e.parents().size():0;return e.isParent()?n:ye-1}var r=t.source,i=t.target,o=r.zDepth(),a=i.zDepth();return Math.max(o,a,0)}}};$i.each=$i.forEach;var Ki;Ki="undefined",("undefined"==typeof Symbol?"undefined":p(Symbol))!=Ki&&p(Symbol.iterator)!=Ki&&($i[Symbol.iterator]=function(){var e=this,t={value:void 0,done:!1},n=0,r=this.length;return y({next:function(){return n<r?t.value=e[n++]:(t.value=void 0,t.done=!0),t}},Symbol.iterator,(function(){return this}))});var Zi=De({nodeDimensionsIncludeLabels:!1}),Qi={layoutDimensions:function(e){var t;if(e=Zi(e),this.takesUpSpace())if(e.nodeDimensionsIncludeLabels){var n=this.boundingBox();t={w:n.w,h:n.h}}else t={w:this.outerWidth(),h:this.outerHeight()};else t={w:0,h:0};return 0!==t.w&&0!==t.h||(t.w=t.h=1),t},layoutPositions:function(e,t,n){var r=this.nodes().filter((function(e){return!e.isParent()})),i=this.cy(),o=t.eles,a=function(e){return e.id()},s=V(n,a);e.emit({type:"layoutstart",layout:e}),e.animations=[];var l=t.spacingFactor&&1!==t.spacingFactor,c=function(){if(!l)return null;for(var e=ht(),t=0;t<r.length;t++){var n=r[t],i=s(n,t);ft(e,i.x,i.y)}return e}(),u=V((function(e,n){var r=s(e,n);l&&(r=function(e,t,n){var r=t.x1+t.w/2,i=t.y1+t.h/2;return{x:r+(n.x-r)*e,y:i+(n.y-i)*e}}(Math.abs(t.spacingFactor),c,r));return null!=t.transform&&(r=t.transform(e,r)),r}),a);if(t.animate){for(var d=0;d<r.length;d++){var h=r[d],f=u(h,d);if(null==t.animateFilter||t.animateFilter(h,d)){var p=h.animation({position:f,duration:t.animationDuration,easing:t.animationEasing});e.animations.push(p)}else h.position(f)}if(t.fit){var v=i.animation({fit:{boundingBox:o.boundingBoxAt(u),padding:t.padding},duration:t.animationDuration,easing:t.animationEasing});e.animations.push(v)}else if(void 0!==t.zoom&&void 0!==t.pan){var g=i.animation({zoom:t.zoom,pan:t.pan,duration:t.animationDuration,easing:t.animationEasing});e.animations.push(g)}e.animations.forEach((function(e){return e.play()})),e.one("layoutready",t.ready),e.emit({type:"layoutready",layout:e}),Jn.all(e.animations.map((function(e){return e.promise()}))).then((function(){e.one("layoutstop",t.stop),e.emit({type:"layoutstop",layout:e})}))}else r.positions(u),t.fit&&i.fit(t.eles,t.padding),null!=t.zoom&&i.zoom(t.zoom),t.pan&&i.pan(t.pan),e.one("layoutready",t.ready),e.emit({type:"layoutready",layout:e}),e.one("layoutstop",t.stop),e.emit({type:"layoutstop",layout:e});return this},layout:function(e){return this.cy().makeLayout(X({},e,{eles:this}))}};function Ji(e,t,n){var r,i=n._private,o=i.styleCache=i.styleCache||[];return null!=(r=o[e])?r:r=o[e]=t(n)}function eo(e,t){return e=he(e),function(n){return Ji(e,t,n)}}function to(e,t){e=he(e);var n=function(e){return t.call(e)};return function(){var t=this[0];if(t)return Ji(e,n,t)}}Qi.createLayout=Qi.makeLayout=Qi.layout;var no={recalculateRenderedStyle:function(e){var t=this.cy(),n=t.renderer(),r=t.styleEnabled();return n&&r&&n.recalculateRenderedStyle(this,e),this},dirtyStyleCache:function(){var e,t=this.cy(),n=function(e){return e._private.styleCache=null};t.hasCompoundNodes()?((e=this.spawnSelf().merge(this.descendants()).merge(this.parents())).merge(e.connectedEdges()),e.forEach(n)):this.forEach((function(e){n(e),e.connectedEdges().forEach(n)}));return this},updateStyle:function(e){var t=this._private.cy;if(!t.styleEnabled())return this;if(t.batching())return t._private.batchStyleEles.merge(this),this;var n=this;e=!(!e&&void 0!==e),t.hasCompoundNodes()&&(n=this.spawnSelf().merge(this.descendants()).merge(this.parents()));var r=n;return e?r.emitAndNotify("style"):r.emit("style"),n.forEach((function(e){return e._private.styleDirty=!0})),this},cleanStyle:function(){var e=this.cy();if(e.styleEnabled())for(var t=0;t<this.length;t++){var n=this[t];n._private.styleDirty&&(n._private.styleDirty=!1,e.style().apply(n))}},parsedStyle:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this[0],r=n.cy();if(r.styleEnabled()&&n){this.cleanStyle();var i=n._private.style[e];return null!=i?i:t?r.style().getDefaultProperty(e):null}},numericStyle:function(e){var t=this[0];if(t.cy().styleEnabled()&&t){var n=t.pstyle(e);return void 0!==n.pfValue?n.pfValue:n.value}},numericStyleUnits:function(e){var t=this[0];if(t.cy().styleEnabled())return t?t.pstyle(e).units:void 0},renderedStyle:function(e){var t=this.cy();if(!t.styleEnabled())return this;var n=this[0];return n?t.style().getRenderedStyle(n,e):void 0},style:function(e,t){var n=this.cy();if(!n.styleEnabled())return this;var r=n.style();if(N(e)){var i=e;r.applyBypass(this,i,false),this.emitAndNotify("style")}else if(C(e)){if(void 0===t){var o=this[0];return o?r.getStylePropertyValue(o,e):void 0}r.applyBypass(this,e,t,false),this.emitAndNotify("style")}else if(void 0===e){var a=this[0];return a?r.getRawStyle(a):void 0}return this},removeStyle:function(e){var t=this.cy();if(!t.styleEnabled())return this;var n=t.style(),r=this;if(void 0===e)for(var i=0;i<r.length;i++){var o=r[i];n.removeAllBypasses(o,false)}else{e=e.split(/\s+/);for(var a=0;a<r.length;a++){var s=r[a];n.removeBypasses(s,e,false)}}return this.emitAndNotify("style"),this},show:function(){return this.css("display","element"),this},hide:function(){return this.css("display","none"),this},effectiveOpacity:function(){var e=this.cy();if(!e.styleEnabled())return 1;var t=e.hasCompoundNodes(),n=this[0];if(n){var r=n._private,i=n.pstyle("opacity").value;if(!t)return i;var o=r.data.parent?n.parents():null;if(o)for(var a=0;a<o.length;a++){i*=o[a].pstyle("opacity").value}return i}},transparent:function(){if(!this.cy().styleEnabled())return!1;var e=this[0],t=e.cy().hasCompoundNodes();return e?t?0===e.effectiveOpacity():0===e.pstyle("opacity").value:void 0},backgrounding:function(){return!!this.cy().styleEnabled()&&!!this[0]._private.backgrounding}};function ro(e,t){var n=e._private.data.parent?e.parents():null;if(n)for(var r=0;r<n.length;r++){if(!t(n[r]))return!1}return!0}function io(e){var t=e.ok,n=e.edgeOkViaNode||e.ok,r=e.parentOk||e.ok;return function(){var e=this.cy();if(!e.styleEnabled())return!0;var i=this[0],o=e.hasCompoundNodes();if(i){var a=i._private;if(!t(i))return!1;if(i.isNode())return!o||ro(i,r);var s=a.source,l=a.target;return n(s)&&(!o||ro(s,n))&&(s===l||n(l)&&(!o||ro(l,n)))}}}var oo=eo("eleTakesUpSpace",(function(e){return"element"===e.pstyle("display").value&&0!==e.width()&&(!e.isNode()||0!==e.height())}));no.takesUpSpace=to("takesUpSpace",io({ok:oo}));var ao=eo("eleInteractive",(function(e){return"yes"===e.pstyle("events").value&&"visible"===e.pstyle("visibility").value&&oo(e)})),so=eo("parentInteractive",(function(e){return"visible"===e.pstyle("visibility").value&&oo(e)}));no.interactive=to("interactive",io({ok:ao,parentOk:so,edgeOkViaNode:oo})),no.noninteractive=function(){var e=this[0];if(e)return!e.interactive()};var lo=eo("eleVisible",(function(e){return"visible"===e.pstyle("visibility").value&&0!==e.pstyle("opacity").pfValue&&oo(e)})),co=oo;no.visible=to("visible",io({ok:lo,edgeOkViaNode:co})),no.hidden=function(){var e=this[0];if(e)return!e.visible()},no.isBundledBezier=to("isBundledBezier",(function(){return!!this.cy().styleEnabled()&&(!this.removed()&&"bezier"===this.pstyle("curve-style").value&&this.takesUpSpace())})),no.bypass=no.css=no.style,no.renderedCss=no.renderedStyle,no.removeBypass=no.removeCss=no.removeStyle,no.pstyle=no.parsedStyle;var uo={};function ho(e){return function(){var t=arguments,n=[];if(2===t.length){var r=t[0],i=t[1];this.on(e.event,r,i)}else if(1===t.length&&T(t[0])){var o=t[0];this.on(e.event,o)}else if(0===t.length||1===t.length&&D(t[0])){for(var a=1===t.length?t[0]:null,s=0;s<this.length;s++){var l=this[s],c=!e.ableField||l._private[e.ableField],u=l._private[e.field]!=e.value;if(e.overrideAble){var d=e.overrideAble(l);if(void 0!==d&&(c=d,!d))return this}c&&(l._private[e.field]=e.value,u&&n.push(l))}var h=this.spawn(n);h.updateStyle(),h.emit(e.event),a&&h.emit(a)}return this}}function fo(e){uo[e.field]=function(){var t=this[0];if(t){if(e.overrideField){var n=e.overrideField(t);if(void 0!==n)return n}return t._private[e.field]}},uo[e.on]=ho({event:e.on,field:e.field,ableField:e.ableField,overrideAble:e.overrideAble,value:!0}),uo[e.off]=ho({event:e.off,field:e.field,ableField:e.ableField,overrideAble:e.overrideAble,value:!1})}fo({field:"locked",overrideField:function(e){return!!e.cy().autolock()||void 0},on:"lock",off:"unlock"}),fo({field:"grabbable",overrideField:function(e){return!e.cy().autoungrabify()&&!e.pannable()&&void 0},on:"grabify",off:"ungrabify"}),fo({field:"selected",ableField:"selectable",overrideAble:function(e){return!e.cy().autounselectify()&&void 0},on:"select",off:"unselect"}),fo({field:"selectable",overrideField:function(e){return!e.cy().autounselectify()&&void 0},on:"selectify",off:"unselectify"}),uo.deselect=uo.unselect,uo.grabbed=function(){var e=this[0];if(e)return e._private.grabbed},fo({field:"active",on:"activate",off:"unactivate"}),fo({field:"pannable",on:"panify",off:"unpanify"}),uo.inactive=function(){var e=this[0];if(e)return!e._private.active};var po={},vo=function(e){return function(t){for(var n=[],r=0;r<this.length;r++){var i=this[r];if(i.isNode()){for(var o=!1,a=i.connectedEdges(),s=0;s<a.length;s++){var l=a[s],c=l.source(),u=l.target();if(e.noIncomingEdges&&u===i&&c!==i||e.noOutgoingEdges&&c===i&&u!==i){o=!0;break}}o||n.push(i)}}return this.spawn(n,!0).filter(t)}},go=function(e){return function(t){for(var n=[],r=0;r<this.length;r++){var i=this[r];if(i.isNode())for(var o=i.connectedEdges(),a=0;a<o.length;a++){var s=o[a],l=s.source(),c=s.target();e.outgoing&&l===i?(n.push(s),n.push(c)):e.incoming&&c===i&&(n.push(s),n.push(l))}}return this.spawn(n,!0).filter(t)}},mo=function(e){return function(t){for(var n=this,r=[],i={};;){var o=e.outgoing?n.outgoers():n.incomers();if(0===o.length)break;for(var a=!1,s=0;s<o.length;s++){var l=o[s],c=l.id();i[c]||(i[c]=!0,r.push(l),a=!0)}if(!a)break;n=o}return this.spawn(r,!0).filter(t)}};function yo(e){return function(t){for(var n=[],r=0;r<this.length;r++){var i=this[r]._private[e.attr];i&&n.push(i)}return this.spawn(n,!0).filter(t)}}function bo(e){return function(t){var n=[],r=this._private.cy,i=e||{};C(t)&&(t=r.$(t));for(var o=0;o<t.length;o++)for(var a=t[o]._private.edges,s=0;s<a.length;s++){var l=a[s],c=l._private.data,u=this.hasElementWithId(c.source)&&t.hasElementWithId(c.target),d=t.hasElementWithId(c.source)&&this.hasElementWithId(c.target);if(u||d){if(i.thisIsSrc||i.thisIsTgt){if(i.thisIsSrc&&!u)continue;if(i.thisIsTgt&&!d)continue}n.push(l)}}return this.spawn(n,!0)}}function xo(e){return e=X({},{codirected:!1},e),function(t){for(var n=[],r=this.edges(),i=e,o=0;o<r.length;o++)for(var a=r[o]._private,s=a.source,l=s._private.data.id,c=a.data.target,u=s._private.edges,d=0;d<u.length;d++){var h=u[d],f=h._private.data,p=f.target,v=f.source,g=p===c&&v===l,m=l===p&&c===v;(i.codirected&&g||!i.codirected&&(g||m))&&n.push(h)}return this.spawn(n,!0).filter(t)}}po.clearTraversalCache=function(){for(var e=0;e<this.length;e++)this[e]._private.traversalCache=null},X(po,{roots:vo({noIncomingEdges:!0}),leaves:vo({noOutgoingEdges:!0}),outgoers:Xr(go({outgoing:!0}),"outgoers"),successors:mo({outgoing:!0}),incomers:Xr(go({incoming:!0}),"incomers"),predecessors:mo({incoming:!0})}),X(po,{neighborhood:Xr((function(e){for(var t=[],n=this.nodes(),r=0;r<n.length;r++)for(var i=n[r],o=i.connectedEdges(),a=0;a<o.length;a++){var s=o[a],l=s.source(),c=s.target(),u=i===l?c:l;u.length>0&&t.push(u[0]),t.push(s[0])}return this.spawn(t,!0).filter(e)}),"neighborhood"),closedNeighborhood:function(e){return this.neighborhood().add(this).filter(e)},openNeighborhood:function(e){return this.neighborhood(e)}}),po.neighbourhood=po.neighborhood,po.closedNeighbourhood=po.closedNeighborhood,po.openNeighbourhood=po.openNeighborhood,X(po,{source:Xr((function(e){var t,n=this[0];return n&&(t=n._private.source||n.cy().collection()),t&&e?t.filter(e):t}),"source"),target:Xr((function(e){var t,n=this[0];return n&&(t=n._private.target||n.cy().collection()),t&&e?t.filter(e):t}),"target"),sources:yo({attr:"source"}),targets:yo({attr:"target"})}),X(po,{edgesWith:Xr(bo(),"edgesWith"),edgesTo:Xr(bo({thisIsSrc:!0}),"edgesTo")}),X(po,{connectedEdges:Xr((function(e){for(var t=[],n=0;n<this.length;n++){var r=this[n];if(r.isNode())for(var i=r._private.edges,o=0;o<i.length;o++){var a=i[o];t.push(a)}}return this.spawn(t,!0).filter(e)}),"connectedEdges"),connectedNodes:Xr((function(e){for(var t=[],n=0;n<this.length;n++){var r=this[n];r.isEdge()&&(t.push(r.source()[0]),t.push(r.target()[0]))}return this.spawn(t,!0).filter(e)}),"connectedNodes"),parallelEdges:Xr(xo(),"parallelEdges"),codirectedEdges:Xr(xo({codirected:!0}),"codirectedEdges")}),X(po,{components:function(e){var t=this,n=t.cy(),r=n.collection(),i=null==e?t.nodes():e.nodes(),o=[];null!=e&&i.empty()&&(i=e.sources());var a=function(e,t){r.merge(e),i.unmerge(e),t.merge(e)};if(i.empty())return t.spawn();var s=function(){var e=n.collection();o.push(e);var r=i[0];a(r,e),t.bfs({directed:!1,roots:r,visit:function(t){return a(t,e)}}),e.forEach((function(n){n.connectedEdges().forEach((function(n){t.has(n)&&e.has(n.source())&&e.has(n.target())&&e.merge(n)}))}))};do{s()}while(i.length>0);return o},component:function(){var e=this[0];return e.cy().mutableElements().components(e)[0]}}),po.componentsOf=po.components;var wo=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(void 0!==e){var i=new Re,o=!1;if(t){if(t.length>0&&N(t[0])&&!R(t[0])){o=!0;for(var a=[],s=new Le,l=0,c=t.length;l<c;l++){var u=t[l];null==u.data&&(u.data={});var d=u.data;if(null==d.id)d.id=je();else if(e.hasElementWithId(d.id)||s.has(d.id))continue;var h=new Be(e,u,!1);a.push(h),s.add(d.id)}t=a}}else t=[];this.length=0;for(var f=0,p=t.length;f<p;f++){var v=t[f][0];if(null!=v){var g=v._private.data.id;n&&i.has(g)||(n&&i.set(g,{index:this.length,ele:v}),this[this.length]=v,this.length++)}}this._private={eles:this,cy:e,get map(){return null==this.lazyMap&&this.rebuildMap(),this.lazyMap},set map(e){this.lazyMap=e},rebuildMap:function(){for(var e=this.lazyMap=new Re,t=this.eles,n=0;n<t.length;n++){var r=t[n];e.set(r.id(),{index:n,ele:r})}}},n&&(this._private.map=i),o&&!r&&this.restore()}else _e("A collection must have a reference to the core")},Eo=Be.prototype=wo.prototype=Object.create(Array.prototype);Eo.instanceString=function(){return"collection"},Eo.spawn=function(e,t){return new wo(this.cy(),e,t)},Eo.spawnSelf=function(){return this.spawn(this)},Eo.cy=function(){return this._private.cy},Eo.renderer=function(){return this._private.cy.renderer()},Eo.element=function(){return this[0]},Eo.collection=function(){return I(this)?this:new wo(this._private.cy,[this])},Eo.unique=function(){return new wo(this._private.cy,this,!0)},Eo.hasElementWithId=function(e){return e=""+e,this._private.map.has(e)},Eo.getElementById=function(e){e=""+e;var t=this._private.cy,n=this._private.map.get(e);return n?n.ele:new wo(t)},Eo.$id=Eo.getElementById,Eo.poolIndex=function(){var e=this._private.cy._private.elements,t=this[0]._private.data.id;return e._private.map.get(t).index},Eo.indexOf=function(e){var t=e[0]._private.data.id;return this._private.map.get(t).index},Eo.indexOfId=function(e){return e=""+e,this._private.map.get(e).index},Eo.json=function(e){var t=this.element(),n=this.cy();if(null==t&&e)return this;if(null!=t){var r=t._private;if(N(e)){if(n.startBatch(),e.data){t.data(e.data);var i=r.data;if(t.isEdge()){var o=!1,a={},s=e.data.source,l=e.data.target;null!=s&&s!=i.source&&(a.source=""+s,o=!0),null!=l&&l!=i.target&&(a.target=""+l,o=!0),o&&(t=t.move(a))}else{var c="parent"in e.data,u=e.data.parent;!c||null==u&&null==i.parent||u==i.parent||(void 0===u&&(u=null),null!=u&&(u=""+u),t=t.move({parent:u}))}}e.position&&t.position(e.position);var d=function(n,i,o){var a=e[n];null!=a&&a!==r[n]&&(a?t[i]():t[o]())};return d("removed","remove","restore"),d("selected","select","unselect"),d("selectable","selectify","unselectify"),d("locked","lock","unlock"),d("grabbable","grabify","ungrabify"),d("pannable","panify","unpanify"),null!=e.classes&&t.classes(e.classes),n.endBatch(),this}if(void 0===e){var h={data:Pe(r.data),position:Pe(r.position),group:r.group,removed:r.removed,selected:r.selected,selectable:r.selectable,locked:r.locked,grabbable:r.grabbable,pannable:r.pannable,classes:(null,"")},f=0;return r.classes.forEach((function(e){return h.classes+=0==f++?e:" "+e})),h}}},Eo.jsons=function(){for(var e=[],t=0;t<this.length;t++){var n=this[t].json();e.push(n)}return e},Eo.clone=function(){for(var e=this.cy(),t=[],n=0;n<this.length;n++){var r=this[n].json(),i=new Be(e,r,!1);t.push(i)}return new wo(e,t)},Eo.copy=Eo.clone,Eo.restore=function(){for(var e,t,n=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=this,o=i.cy(),a=o._private,s=[],l=[],c=0,u=i.length;c<u;c++){var d=i[c];r&&!d.removed()||(d.isNode()?s.push(d):l.push(d))}e=s.concat(l);var h=function(){e.splice(t,1),t--};for(t=0;t<e.length;t++){var f=e[t],p=f._private,v=p.data;if(f.clearTraversalCache(),r||p.removed)if(void 0===v.id)v.id=je();else if(O(v.id))v.id=""+v.id;else{if(F(v.id)||!C(v.id)){_e("Can not create element with invalid string ID `"+v.id+"`"),h();continue}if(o.hasElementWithId(v.id)){_e("Can not create second element with ID `"+v.id+"`"),h();continue}}else;var g=v.id;if(f.isNode()){var m=p.position;null==m.x&&(m.x=0),null==m.y&&(m.y=0)}if(f.isEdge()){for(var y=f,b=["source","target"],x=b.length,w=!1,E=0;E<x;E++){var _=b[E],k=v[_];O(k)&&(k=v[_]=""+v[_]),null==k||""===k?(_e("Can not create edge `"+g+"` with unspecified "+_),w=!0):o.hasElementWithId(k)||(_e("Can not create edge `"+g+"` with nonexistant "+_+" `"+k+"`"),w=!0)}if(w){h();continue}var S=o.getElementById(v.source),P=o.getElementById(v.target);S.same(P)?S._private.edges.push(y):(S._private.edges.push(y),P._private.edges.push(y)),y._private.source=S,y._private.target=P}p.map=new Re,p.map.set(g,{ele:f,index:0}),p.removed=!1,r&&o.addToPool(f)}for(var j=0;j<s.length;j++){var T=s[j],D=T._private.data;O(D.parent)&&(D.parent=""+D.parent);var N=D.parent,M=null!=N;if(M||T._private.parent){var A=T._private.parent?o.collection().merge(T._private.parent):o.getElementById(N);if(A.empty())D.parent=void 0;else if(A[0].removed())Se("Node added with missing parent, reference to parent removed"),D.parent=void 0,T._private.parent=null;else{for(var R=!1,I=A;!I.empty();){if(T.same(I)){R=!0,D.parent=void 0;break}I=I.parent()}R||(A[0]._private.children.push(T),T._private.parent=A[0],a.hasCompoundNodes=!0)}}}if(e.length>0){for(var L=e.length===i.length?i:new wo(o,e),B=0;B<L.length;B++){var z=L[B];z.isNode()||(z.parallelEdges().clearTraversalCache(),z.source().clearTraversalCache(),z.target().clearTraversalCache())}(a.hasCompoundNodes?o.collection().merge(L).merge(L.connectedNodes()).merge(L.parent()):L).dirtyCompoundBoundsCache().dirtyBoundingBoxCache().updateStyle(n),n?L.emitAndNotify("add"):r&&L.emit("add")}return i},Eo.removed=function(){var e=this[0];return e&&e._private.removed},Eo.inside=function(){var e=this[0];return e&&!e._private.removed},Eo.remove=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this,r=[],i={},o=n._private.cy;function a(e){for(var t=e._private.edges,n=0;n<t.length;n++)l(t[n])}function s(e){for(var t=e._private.children,n=0;n<t.length;n++)l(t[n])}function l(e){var n=i[e.id()];t&&e.removed()||n||(i[e.id()]=!0,e.isNode()?(r.push(e),a(e),s(e)):r.unshift(e))}for(var c=0,u=n.length;c<u;c++){var d=n[c];l(d)}function h(e,t){var n=e._private.edges;Ne(n,t),e.clearTraversalCache()}function f(e){e.clearTraversalCache()}var p=[];function v(e,t){t=t[0];var n=(e=e[0])._private.children,r=e.id();Ne(n,t),t._private.parent=null,p.ids[r]||(p.ids[r]=!0,p.push(e))}p.ids={},n.dirtyCompoundBoundsCache(),t&&o.removeFromPool(r);for(var g=0;g<r.length;g++){var m=r[g];if(m.isEdge()){var y=m.source()[0],b=m.target()[0];h(y,m),h(b,m);for(var x=m.parallelEdges(),w=0;w<x.length;w++){var E=x[w];f(E),E.isBundledBezier()&&E.dirtyBoundingBoxCache()}}else{var _=m.parent();0!==_.length&&v(_,m)}t&&(m._private.removed=!0)}var k=o._private.elements;o._private.hasCompoundNodes=!1;for(var S=0;S<k.length;S++){var P=k[S];if(P.isParent()){o._private.hasCompoundNodes=!0;break}}var j=new wo(this.cy(),r);j.size()>0&&(e?j.emitAndNotify("remove"):t&&j.emit("remove"));for(var C=0;C<p.length;C++){var T=p[C];t&&T.removed()||T.updateStyle()}return j},Eo.move=function(e){var t=this._private.cy,n=this,r=!1,i=!1,o=function(e){return null==e?e:""+e};if(void 0!==e.source||void 0!==e.target){var a=o(e.source),s=o(e.target),l=null!=a&&t.hasElementWithId(a),c=null!=s&&t.hasElementWithId(s);(l||c)&&(t.batch((function(){n.remove(r,i),n.emitAndNotify("moveout");for(var e=0;e<n.length;e++){var t=n[e],o=t._private.data;t.isEdge()&&(l&&(o.source=a),c&&(o.target=s))}n.restore(r,i)})),n.emitAndNotify("move"))}else if(void 0!==e.parent){var u=o(e.parent);if(null===u||t.hasElementWithId(u)){var d=null===u?void 0:u;t.batch((function(){var e=n.remove(r,i);e.emitAndNotify("moveout");for(var t=0;t<n.length;t++){var o=n[t],a=o._private.data;o.isNode()&&(a.parent=d)}e.restore(r,i)})),n.emitAndNotify("move")}}return this},[Yn,ar,sr,qr,$r,ni,ri,Di,qi,Yi,{isNode:function(){return"nodes"===this.group()},isEdge:function(){return"edges"===this.group()},isLoop:function(){return this.isEdge()&&this.source()[0]===this.target()[0]},isSimple:function(){return this.isEdge()&&this.source()[0]!==this.target()[0]},group:function(){var e=this[0];if(e)return e._private.group}},$i,Qi,no,uo,po].forEach((function(e){X(Eo,e)}));var _o={add:function(e){var t,n=this;if(A(e)){var r=e;if(r._private.cy===n)t=r.restore();else{for(var i=[],o=0;o<r.length;o++){var a=r[o];i.push(a.json())}t=new wo(n,i)}}else if(D(e)){t=new wo(n,e)}else if(N(e)&&(D(e.nodes)||D(e.edges))){for(var s=e,l=[],c=["nodes","edges"],u=0,d=c.length;u<d;u++){var h=c[u],f=s[h];if(D(f))for(var p=0,v=f.length;p<v;p++){var g=X({group:h},f[p]);l.push(g)}}t=new wo(n,l)}else{t=new Be(n,e).collection()}return t},remove:function(e){if(A(e));else if(C(e)){var t=e;e=this.$(t)}return e.remove()}};var ko=function(){function e(e){return-e.tension*e.x-e.friction*e.v}function t(t,n,r){var i={x:t.x+r.dx*n,v:t.v+r.dv*n,tension:t.tension,friction:t.friction};return{dx:i.v,dv:e(i)}}function n(n,r){var i={dx:n.v,dv:e(n)},o=t(n,.5*r,i),a=t(n,.5*r,o),s=t(n,r,a),l=1/6*(i.dx+2*(o.dx+a.dx)+s.dx),c=1/6*(i.dv+2*(o.dv+a.dv)+s.dv);return n.x=n.x+l*r,n.v=n.v+c*r,n}return function e(t,r,i){var o,a,s,l={x:-1,v:0,tension:null,friction:null},c=[0],u=0,d=1e-4;for(t=parseFloat(t)||500,r=parseFloat(r)||20,i=i||null,l.tension=t,l.friction=r,a=(o=null!==i)?(u=e(t,r))/i*.016:.016;s=n(s||l,a),c.push(1+s.x),u+=16,Math.abs(s.x)>d&&Math.abs(s.v)>d;);return o?function(e){return c[e*(c.length-1)|0]}:u}}(),So=function(e,t,n,r){var i=function(e,t,n,r){var i=4,o=.001,a=1e-7,s=10,l=11,c=1/(l-1),u="undefined"!=typeof Float32Array;if(4!==arguments.length)return!1;for(var d=0;d<4;++d)if("number"!=typeof arguments[d]||isNaN(arguments[d])||!isFinite(arguments[d]))return!1;e=Math.min(e,1),n=Math.min(n,1),e=Math.max(e,0),n=Math.max(n,0);var h=u?new Float32Array(l):new Array(l);function f(e,t){return 1-3*t+3*e}function p(e,t){return 3*t-6*e}function v(e){return 3*e}function g(e,t,n){return((f(t,n)*e+p(t,n))*e+v(t))*e}function m(e,t,n){return 3*f(t,n)*e*e+2*p(t,n)*e+v(t)}function y(t,r){for(var o=0;o<i;++o){var a=m(r,e,n);if(0===a)return r;r-=(g(r,e,n)-t)/a}return r}function b(){for(var t=0;t<l;++t)h[t]=g(t*c,e,n)}function x(t,r,i){var o,l,c=0;do{(o=g(l=r+(i-r)/2,e,n)-t)>0?i=l:r=l}while(Math.abs(o)>a&&++c<s);return l}function w(t){for(var r=0,i=1,a=l-1;i!==a&&h[i]<=t;++i)r+=c;--i;var s=r+(t-h[i])/(h[i+1]-h[i])*c,u=m(s,e,n);return u>=o?y(t,s):0===u?s:x(t,r,r+c)}var E=!1;function _(){E=!0,e===t&&n===r||b()}var k=function(i){return E||_(),e===t&&n===r?i:0===i?0:1===i?1:g(w(i),t,r)};k.getControlPoints=function(){return[{x:e,y:t},{x:n,y:r}]};var S="generateBezier("+[e,t,n,r]+")";return k.toString=function(){return S},k}(e,t,n,r);return function(e,t,n){return e+(t-e)*i(n)}},Po={linear:function(e,t,n){return e+(t-e)*n},ease:So(.25,.1,.25,1),"ease-in":So(.42,0,1,1),"ease-out":So(0,0,.58,1),"ease-in-out":So(.42,0,.58,1),"ease-in-sine":So(.47,0,.745,.715),"ease-out-sine":So(.39,.575,.565,1),"ease-in-out-sine":So(.445,.05,.55,.95),"ease-in-quad":So(.55,.085,.68,.53),"ease-out-quad":So(.25,.46,.45,.94),"ease-in-out-quad":So(.455,.03,.515,.955),"ease-in-cubic":So(.55,.055,.675,.19),"ease-out-cubic":So(.215,.61,.355,1),"ease-in-out-cubic":So(.645,.045,.355,1),"ease-in-quart":So(.895,.03,.685,.22),"ease-out-quart":So(.165,.84,.44,1),"ease-in-out-quart":So(.77,0,.175,1),"ease-in-quint":So(.755,.05,.855,.06),"ease-out-quint":So(.23,1,.32,1),"ease-in-out-quint":So(.86,0,.07,1),"ease-in-expo":So(.95,.05,.795,.035),"ease-out-expo":So(.19,1,.22,1),"ease-in-out-expo":So(1,0,0,1),"ease-in-circ":So(.6,.04,.98,.335),"ease-out-circ":So(.075,.82,.165,1),"ease-in-out-circ":So(.785,.135,.15,.86),spring:function(e,t,n){if(0===n)return Po.linear;var r=ko(e,t,n);return function(e,t,n){return e+(t-e)*r(n)}},"cubic-bezier":So};function jo(e,t,n,r,i){if(1===r)return n;if(t===n)return n;var o=i(t,n,r);return null==e||((e.roundValue||e.color)&&(o=Math.round(o)),void 0!==e.min&&(o=Math.max(o,e.min)),void 0!==e.max&&(o=Math.min(o,e.max))),o}function Co(e,t){return null!=e.pfValue||null!=e.value?null==e.pfValue||null!=t&&"%"===t.type.units?e.value:e.pfValue:e}function To(e,t,n,r,i){var o=null!=i?i.type:null;n<0?n=0:n>1&&(n=1);var a=Co(e,i),s=Co(t,i);if(O(a)&&O(s))return jo(o,a,s,n,r);if(D(a)&&D(s)){for(var l=[],c=0;c<s.length;c++){var u=a[c],d=s[c];if(null!=u&&null!=d){var h=jo(o,u,d,n,r);l.push(h)}else l.push(d)}return l}}function Do(e,t,n,r){var i=!r,o=e._private,a=t._private,s=a.easing,l=a.startTime,c=(r?e:e.cy()).style();if(!a.easingImpl)if(null==s)a.easingImpl=Po.linear;else{var u,d,h;if(C(s))u=c.parse("transition-timing-function",s).value;else u=s;C(u)?(d=u,h=[]):(d=u[1],h=u.slice(2).map((function(e){return+e}))),h.length>0?("spring"===d&&h.push(a.duration),a.easingImpl=Po[d].apply(null,h)):a.easingImpl=Po[d]}var f,p=a.easingImpl;if(f=0===a.duration?1:(n-l)/a.duration,a.applying&&(f=a.progress),f<0?f=0:f>1&&(f=1),null==a.delay){var v=a.startPosition,g=a.position;if(g&&i&&!e.locked()){var m={};No(v.x,g.x)&&(m.x=To(v.x,g.x,f,p)),No(v.y,g.y)&&(m.y=To(v.y,g.y,f,p)),e.position(m)}var y=a.startPan,b=a.pan,x=o.pan,w=null!=b&&r;w&&(No(y.x,b.x)&&(x.x=To(y.x,b.x,f,p)),No(y.y,b.y)&&(x.y=To(y.y,b.y,f,p)),e.emit("pan"));var E=a.startZoom,_=a.zoom,k=null!=_&&r;k&&(No(E,_)&&(o.zoom=dt(o.minZoom,To(E,_,f,p),o.maxZoom)),e.emit("zoom")),(w||k)&&e.emit("viewport");var S=a.style;if(S&&S.length>0&&i){for(var P=0;P<S.length;P++){var j=S[P],T=j.name,D=j,N=a.startStyle[T],O=To(N,D,f,p,c.properties[N.name]);c.overrideBypass(e,T,O)}e.emit("style")}}return a.progress=f,f}function No(e,t){return null!=e&&null!=t&&(!(!O(e)||!O(t))||!(!e||!t))}function Oo(e,t,n,r){var i=t._private;i.started=!0,i.startTime=n-i.progress*i.duration}function Mo(e,t){var n=t._private.aniEles,r=[];function i(t,n){var i=t._private,o=i.animation.current,a=i.animation.queue,s=!1;if(0===o.length){var l=a.shift();l&&o.push(l)}for(var c=function(e){for(var t=e.length-1;t>=0;t--){(0,e[t])()}e.splice(0,e.length)},u=o.length-1;u>=0;u--){var d=o[u],h=d._private;h.stopped?(o.splice(u,1),h.hooked=!1,h.playing=!1,h.started=!1,c(h.frames)):(h.playing||h.applying)&&(h.playing&&h.applying&&(h.applying=!1),h.started||Oo(0,d,e),Do(t,d,e,n),h.applying&&(h.applying=!1),c(h.frames),null!=h.step&&h.step(e),d.completed()&&(o.splice(u,1),h.hooked=!1,h.playing=!1,h.started=!1,c(h.completes)),s=!0)}return n||0!==o.length||0!==a.length||r.push(t),s}for(var o=!1,a=0;a<n.length;a++){var s=i(n[a]);o=o||s}var l=i(t,!0);(o||l)&&(n.length>0?t.notify("draw",n):t.notify("draw")),n.unmerge(r),t.emit("step")}var Ao={animate:or.animate(),animation:or.animation(),animated:or.animated(),clearQueue:or.clearQueue(),delay:or.delay(),delayAnimation:or.delayAnimation(),stop:or.stop(),addToAnimationPool:function(e){this.styleEnabled()&&this._private.aniEles.merge(e)},stopAnimationLoop:function(){this._private.animationsRunning=!1},startAnimationLoop:function(){var e=this;if(e._private.animationsRunning=!0,e.styleEnabled()){var t=e.renderer();t&&t.beforeRender?t.beforeRender((function(t,n){Mo(n,e)}),t.beforeRenderPriorities.animations):function t(){e._private.animationsRunning&&ne((function(n){Mo(n,e),t()}))}()}}},Ro={qualifierCompare:function(e,t){return null==e||null==t?null==e&&null==t:e.sameText(t)},eventMatches:function(e,t,n){var r=t.qualifier;return null==r||e!==n.target&&R(n.target)&&r.matches(n.target)},addEventFields:function(e,t){t.cy=e,t.target=e},callbackContext:function(e,t,n){return null!=t.qualifier?n.target:e}},Io=function(e){return C(e)?new Hr(e):e},Lo={createEmitter:function(){var e=this._private;return e.emitter||(e.emitter=new Bi(Ro,this)),this},emitter:function(){return this._private.emitter},on:function(e,t,n){return this.emitter().on(e,Io(t),n),this},removeListener:function(e,t,n){return this.emitter().removeListener(e,Io(t),n),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,t,n){return this.emitter().one(e,Io(t),n),this},once:function(e,t,n){return this.emitter().one(e,Io(t),n),this},emit:function(e,t){return this.emitter().emit(e,t),this},emitAndNotify:function(e,t){return this.emit(e),this.notify(e,t),this}};or.eventAliasesOn(Lo);var Bo={png:function(e){return e=e||{},this._private.renderer.png(e)},jpg:function(e){var t=this._private.renderer;return(e=e||{}).bg=e.bg||"#fff",t.jpg(e)}};Bo.jpeg=Bo.jpg;var Fo={layout:function(e){var t=this;if(null!=e)if(null!=e.name){var n=e.name,r=t.extension("layout",n);if(null!=r){var i;i=C(e.eles)?t.$(e.eles):null!=e.eles?e.eles:t.$();var o=new r(X({},e,{cy:t,eles:i}));return o}_e("No such layout `"+n+"` found. Did you forget to import it and `cytoscape.use()` it?")}else _e("A `name` must be specified to make a layout");else _e("Layout options must be specified to make a layout")}};Fo.createLayout=Fo.makeLayout=Fo.layout;var zo={notify:function(e,t){var n=this._private;if(this.batching()){n.batchNotifications=n.batchNotifications||{};var r=n.batchNotifications[e]=n.batchNotifications[e]||this.collection();null!=t&&r.merge(t)}else if(n.notificationsEnabled){var i=this.renderer();!this.destroyed()&&i&&i.notify(e,t)}},notifications:function(e){var t=this._private;return void 0===e?t.notificationsEnabled:(t.notificationsEnabled=!!e,this)},noNotifications:function(e){this.notifications(!1),e(),this.notifications(!0)},batching:function(){return this._private.batchCount>0},startBatch:function(){var e=this._private;return null==e.batchCount&&(e.batchCount=0),0===e.batchCount&&(e.batchStyleEles=this.collection(),e.batchNotifications={}),e.batchCount++,this},endBatch:function(){var e=this._private;if(0===e.batchCount)return this;if(e.batchCount--,0===e.batchCount){e.batchStyleEles.updateStyle();var t=this.renderer();Object.keys(e.batchNotifications).forEach((function(n){var r=e.batchNotifications[n];r.empty()?t.notify(n):t.notify(n,r)}))}return this},batch:function(e){return this.startBatch(),e(),this.endBatch(),this},batchData:function(e){var t=this;return this.batch((function(){for(var n=Object.keys(e),r=0;r<n.length;r++){var i=n[r],o=e[i];t.getElementById(i).data(o)}}))}},Vo=De({hideEdgesOnViewport:!1,textureOnViewport:!1,motionBlur:!1,motionBlurOpacity:.05,pixelRatio:void 0,desktopTapThreshold:4,touchTapThreshold:8,wheelSensitivity:1,debug:!1,showFps:!1}),Go={renderTo:function(e,t,n,r){return this._private.renderer.renderTo(e,t,n,r),this},renderer:function(){return this._private.renderer},forceRender:function(){return this.notify("draw"),this},resize:function(){return this.invalidateSize(),this.emitAndNotify("resize"),this},initRenderer:function(e){var t=this,n=t.extension("renderer",e.name);if(null!=n){void 0!==e.wheelSensitivity&&Se("You have set a custom wheel sensitivity. This will make your app zoom unnaturally when using mainstream mice. You should change this value from the default only if you can guarantee that all your users will use the same hardware and OS configuration as your current machine.");var r=Vo(e);r.cy=t,t._private.renderer=new n(r),this.notify("init")}else _e("Can not initialise: No such renderer `".concat(e.name,"` found. Did you forget to import it and `cytoscape.use()` it?"))},destroyRenderer:function(){var e=this;e.notify("destroy");var t=e.container();if(t)for(t._cyreg=null;t.childNodes.length>0;)t.removeChild(t.childNodes[0]);e._private.renderer=null,e.mutableElements().forEach((function(e){var t=e._private;t.rscratch={},t.rstyle={},t.animation.current=[],t.animation.queue=[]}))},onRender:function(e){return this.on("render",e)},offRender:function(e){return this.off("render",e)}};Go.invalidateDimensions=Go.resize;var Ho={collection:function(e,t){return C(e)?this.$(e):A(e)?e.collection():D(e)?(t||(t={}),new wo(this,e,t.unique,t.removed)):new wo(this)},nodes:function(e){var t=this.$((function(e){return e.isNode()}));return e?t.filter(e):t},edges:function(e){var t=this.$((function(e){return e.isEdge()}));return e?t.filter(e):t},$:function(e){var t=this._private.elements;return e?t.filter(e):t.spawnSelf()},mutableElements:function(){return this._private.elements}};Ho.elements=Ho.filter=Ho.$;var Wo={},qo="t";Wo.apply=function(e){for(var t=this,n=t._private.cy.collection(),r=0;r<e.length;r++){var i=e[r],o=t.getContextMeta(i);if(!o.empty){var a=t.getContextStyle(o),s=t.applyContextStyle(o,a,i);i._private.appliedInitStyle?t.updateTransitions(i,s.diffProps):i._private.appliedInitStyle=!0,t.updateStyleHints(i)&&n.push(i)}}return n},Wo.getPropertiesDiff=function(e,t){var n=this,r=n._private.propDiffs=n._private.propDiffs||{},i=e+"-"+t,o=r[i];if(o)return o;for(var a=[],s={},l=0;l<n.length;l++){var c=n[l],u=e[l]===qo,d=t[l]===qo,h=u!==d,f=c.mappedProperties.length>0;if(h||d&&f){var p=void 0;h&&f||h?p=c.properties:f&&(p=c.mappedProperties);for(var v=0;v<p.length;v++){for(var g=p[v],m=g.name,y=!1,b=l+1;b<n.length;b++){var x=n[b];if(t[b]===qo&&(y=null!=x.properties[g.name]))break}s[m]||y||(s[m]=!0,a.push(m))}}}return r[i]=a,a},Wo.getContextMeta=function(e){for(var t,n=this,r="",i=e._private.styleCxtKey||"",o=0;o<n.length;o++){var a=n[o];r+=a.selector&&a.selector.matches(e)?qo:"f"}return t=n.getPropertiesDiff(i,r),e._private.styleCxtKey=r,{key:r,diffPropNames:t,empty:0===t.length}},Wo.getContextStyle=function(e){var t=e.key,n=this._private.contextStyles=this._private.contextStyles||{};if(n[t])return n[t];for(var r={_private:{key:t}},i=0;i<this.length;i++){var o=this[i];if(t[i]===qo)for(var a=0;a<o.properties.length;a++){var s=o.properties[a];r[s.name]=s}}return n[t]=r,r},Wo.applyContextStyle=function(e,t,n){for(var r=e.diffPropNames,i={},o=this.types,a=0;a<r.length;a++){var s=r[a],l=t[s],c=n.pstyle(s);if(!l){if(!c)continue;l=c.bypass?{name:s,deleteBypassed:!0}:{name:s,delete:!0}}if(c!==l){if(l.mapped===o.fn&&null!=c&&null!=c.mapping&&c.mapping.value===l.value){var u=c.mapping;if((u.fnValue=l.value(n))===u.prevFnValue)continue}var d=i[s]={prev:c};this.applyParsedProperty(n,l),d.next=n.pstyle(s),d.next&&d.next.bypass&&(d.next=d.next.bypassed)}}return{diffProps:i}},Wo.updateStyleHints=function(e){var t=e._private,n=this,r=n.propertyGroupNames,i=n.propertyGroupKeys,o=function(e,t,r){return n.getPropertiesHash(e,t,r)},a=t.styleKey;if(e.removed())return!1;var s="nodes"===t.group,l=e._private.style;r=Object.keys(l);for(var c=0;c<i.length;c++){var u=i[c];t.styleKeys[u]=[ie,ae]}for(var d,h=function(e,n){return t.styleKeys[n][0]=le(e,t.styleKeys[n][0])},f=function(e,n){return t.styleKeys[n][1]=ce(e,t.styleKeys[n][1])},p=function(e,t){h(e,t),f(e,t)},v=function(e,t){for(var n=0;n<e.length;n++){var r=e.charCodeAt(n);h(r,t),f(r,t)}},g=0;g<r.length;g++){var m=r[g],y=l[m];if(null!=y){var b=this.properties[m],x=b.type,w=b.groupKey,E=void 0;null!=b.hashOverride?E=b.hashOverride(e,y):null!=y.pfValue&&(E=y.pfValue);var _=null==b.enums?y.value:null,k=null!=E,S=k||null!=_,P=y.units;if(x.number&&S&&!x.multiple)p(-128<(d=k?E:_)&&d<128&&Math.floor(d)!==d?2e9-(1024*d|0):d,w),k||null==P||v(P,w);else v(y.strValue,w)}}for(var j,C,T=[ie,ae],D=0;D<i.length;D++){var N=i[D],O=t.styleKeys[N];T[0]=le(O[0],T[0]),T[1]=ce(O[1],T[1])}t.styleKey=(j=T[0],C=T[1],2097152*j+C);var M=t.styleKeys;t.labelDimsKey=ue(M.labelDimensions);var A=o(e,["label"],M.labelDimensions);if(t.labelKey=ue(A),t.labelStyleKey=ue(de(M.commonLabel,A)),!s){var R=o(e,["source-label"],M.labelDimensions);t.sourceLabelKey=ue(R),t.sourceLabelStyleKey=ue(de(M.commonLabel,R));var I=o(e,["target-label"],M.labelDimensions);t.targetLabelKey=ue(I),t.targetLabelStyleKey=ue(de(M.commonLabel,I))}if(s){var L=t.styleKeys,B=L.nodeBody,F=L.nodeBorder,z=L.backgroundImage,V=L.compound,G=L.pie,H=[B,F,z,V,G].filter((function(e){return null!=e})).reduce(de,[ie,ae]);t.nodeKey=ue(H),t.hasPie=null!=G&&G[0]!==ie&&G[1]!==ae}return a!==t.styleKey},Wo.clearStyleHints=function(e){var t=e._private;t.styleCxtKey="",t.styleKeys={},t.styleKey=null,t.labelKey=null,t.labelStyleKey=null,t.sourceLabelKey=null,t.sourceLabelStyleKey=null,t.targetLabelKey=null,t.targetLabelStyleKey=null,t.nodeKey=null,t.hasPie=null},Wo.applyParsedProperty=function(e,t){var n,r=this,i=t,o=e._private.style,a=r.types,s=r.properties[i.name].type,l=i.bypass,c=o[i.name],u=c&&c.bypass,d=e._private,h="mapping",f=function(e){return null==e?null:null!=e.pfValue?e.pfValue:e.value},p=function(){var t=f(c),n=f(i);r.checkTriggers(e,i.name,t,n)};if(i&&"pie"===i.name.substr(0,3)&&Se("The pie style properties are deprecated. Create charts using background images instead."),"curve-style"===t.name&&e.isEdge()&&("bezier"!==t.value&&e.isLoop()||"haystack"===t.value&&(e.source().isParent()||e.target().isParent()))&&(i=t=this.parse(t.name,"bezier",l)),i.delete)return o[i.name]=void 0,p(),!0;if(i.deleteBypassed)return c?!!c.bypass&&(c.bypassed=void 0,p(),!0):(p(),!0);if(i.deleteBypass)return c?!!c.bypass&&(o[i.name]=c.bypassed,p(),!0):(p(),!0);var v=function(){Se("Do not assign mappings to elements without corresponding data (i.e. ele `"+e.id()+"` has no mapping for property `"+i.name+"` with data field `"+i.field+"`); try a `["+i.field+"]` selector to limit scope to elements with `"+i.field+"` defined")};switch(i.mapped){case a.mapData:for(var g,m=i.field.split("."),y=d.data,b=0;b<m.length&&y;b++){y=y[m[b]]}if(null==y)return v(),!1;if(!O(y))return Se("Do not use continuous mappers without specifying numeric data (i.e. `"+i.field+": "+y+"` for `"+e.id()+"` is non-numeric)"),!1;var x=i.fieldMax-i.fieldMin;if((g=0===x?0:(y-i.fieldMin)/x)<0?g=0:g>1&&(g=1),s.color){var w=i.valueMin[0],E=i.valueMax[0],_=i.valueMin[1],k=i.valueMax[1],S=i.valueMin[2],P=i.valueMax[2],j=null==i.valueMin[3]?1:i.valueMin[3],C=null==i.valueMax[3]?1:i.valueMax[3],T=[Math.round(w+(E-w)*g),Math.round(_+(k-_)*g),Math.round(S+(P-S)*g),Math.round(j+(C-j)*g)];n={bypass:i.bypass,name:i.name,value:T,strValue:"rgb("+T[0]+", "+T[1]+", "+T[2]+")"}}else{if(!s.number)return!1;var D=i.valueMin+(i.valueMax-i.valueMin)*g;n=this.parse(i.name,D,i.bypass,h)}if(!n)return v(),!1;n.mapping=i,i=n;break;case a.data:for(var N=i.field.split("."),M=d.data,A=0;A<N.length&&M;A++){M=M[N[A]]}if(null!=M&&(n=this.parse(i.name,M,i.bypass,h)),!n)return v(),!1;n.mapping=i,i=n;break;case a.fn:var R=i.value,I=null!=i.fnValue?i.fnValue:R(e);if(i.prevFnValue=I,null==I)return Se("Custom function mappers may not return null (i.e. `"+i.name+"` for ele `"+e.id()+"` is null)"),!1;if(!(n=this.parse(i.name,I,i.bypass,h)))return Se("Custom function mappers may not return invalid values for the property type (i.e. `"+i.name+"` for ele `"+e.id()+"` is invalid)"),!1;n.mapping=Pe(i),i=n;break;case void 0:break;default:return!1}return l?(i.bypassed=u?c.bypassed:c,o[i.name]=i):u?c.bypassed=i:o[i.name]=i,p(),!0},Wo.cleanElements=function(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(this.clearStyleHints(r),r.dirtyCompoundBoundsCache(),r.dirtyBoundingBoxCache(),t)for(var i=r._private.style,o=Object.keys(i),a=0;a<o.length;a++){var s=o[a],l=i[s];null!=l&&(l.bypass?l.bypassed=null:i[s]=null)}else r._private.style={}}},Wo.update=function(){this._private.cy.mutableElements().updateStyle()},Wo.updateTransitions=function(e,t){var n=this,r=e._private,i=e.pstyle("transition-property").value,o=e.pstyle("transition-duration").pfValue,a=e.pstyle("transition-delay").pfValue;if(i.length>0&&o>0){for(var s={},l=!1,c=0;c<i.length;c++){var u=i[c],d=e.pstyle(u),h=t[u];if(h){var f=h.prev,p=null!=h.next?h.next:d,v=!1,g=void 0,m=1e-6;f&&(O(f.pfValue)&&O(p.pfValue)?(v=p.pfValue-f.pfValue,g=f.pfValue+m*v):O(f.value)&&O(p.value)?(v=p.value-f.value,g=f.value+m*v):D(f.value)&&D(p.value)&&(v=f.value[0]!==p.value[0]||f.value[1]!==p.value[1]||f.value[2]!==p.value[2],g=f.strValue),v&&(s[u]=p.strValue,this.applyBypass(e,u,g),l=!0))}}if(!l)return;r.transitioning=!0,new Jn((function(t){a>0?e.delayAnimation(a).play().promise().then(t):t()})).then((function(){return e.animation({style:s,duration:o,easing:e.pstyle("transition-timing-function").value,queue:!1}).play().promise()})).then((function(){n.removeBypasses(e,i),e.emitAndNotify("style"),r.transitioning=!1}))}else r.transitioning&&(this.removeBypasses(e,i),e.emitAndNotify("style"),r.transitioning=!1)},Wo.checkTrigger=function(e,t,n,r,i,o){var a=this.properties[t],s=i(a);null!=s&&s(n,r)&&o(a)},Wo.checkZOrderTrigger=function(e,t,n,r){var i=this;this.checkTrigger(e,t,n,r,(function(e){return e.triggersZOrder}),(function(){i._private.cy.notify("zorder",e)}))},Wo.checkBoundsTrigger=function(e,t,n,r){this.checkTrigger(e,t,n,r,(function(e){return e.triggersBounds}),(function(i){e.dirtyCompoundBoundsCache(),e.dirtyBoundingBoxCache(),!i.triggersBoundsOfParallelBeziers||("curve-style"!==t||"bezier"!==n&&"bezier"!==r)&&("display"!==t||"none"!==n&&"none"!==r)||e.parallelEdges().forEach((function(e){e.isBundledBezier()&&e.dirtyBoundingBoxCache()}))}))},Wo.checkTriggers=function(e,t,n,r){e.dirtyStyleCache(),this.checkZOrderTrigger(e,t,n,r),this.checkBoundsTrigger(e,t,n,r)};var Yo={applyBypass:function(e,t,n,r){var i=[];if("*"===t||"**"===t){if(void 0!==n)for(var o=0;o<this.properties.length;o++){var a=this.properties[o].name,s=this.parse(a,n,!0);s&&i.push(s)}}else if(C(t)){var l=this.parse(t,n,!0);l&&i.push(l)}else{if(!N(t))return!1;var c=t;r=n;for(var u=Object.keys(c),d=0;d<u.length;d++){var h=u[d],f=c[h];if(void 0===f&&(f=c[H(h)]),void 0!==f){var p=this.parse(h,f,!0);p&&i.push(p)}}}if(0===i.length)return!1;for(var v=!1,g=0;g<e.length;g++){for(var m=e[g],y={},b=void 0,x=0;x<i.length;x++){var w=i[x];if(r){var E=m.pstyle(w.name);b=y[w.name]={prev:E}}v=this.applyParsedProperty(m,Pe(w))||v,r&&(b.next=m.pstyle(w.name))}v&&this.updateStyleHints(m),r&&this.updateTransitions(m,y,true)}return v},overrideBypass:function(e,t,n){t=G(t);for(var r=0;r<e.length;r++){var i=e[r],o=i._private.style[t],a=this.properties[t].type,s=a.color,l=a.mutiple,c=o?null!=o.pfValue?o.pfValue:o.value:null;o&&o.bypass?(o.value=n,null!=o.pfValue&&(o.pfValue=n),o.strValue=s?"rgb("+n.join(",")+")":l?n.join(" "):""+n,this.updateStyleHints(i)):this.applyBypass(i,t,n),this.checkTriggers(i,t,c,n)}},removeAllBypasses:function(e,t){return this.removeBypasses(e,this.propertyNames,t)},removeBypasses:function(e,t,n){for(var r=0;r<e.length;r++){for(var i=e[r],o={},a=0;a<t.length;a++){var s=t[a],l=this.properties[s],c=i.pstyle(l.name);if(c&&c.bypass){var u=this.parse(s,"",!0),d=o[l.name]={prev:c};this.applyParsedProperty(i,u),d.next=i.pstyle(l.name)}}this.updateStyleHints(i),n&&this.updateTransitions(i,o,true)}}},Uo={getEmSizeInPixels:function(){var e=this.containerCss("font-size");return null!=e?parseFloat(e):1},containerCss:function(e){var t=this._private.cy.container();if(w&&t&&w.getComputedStyle)return w.getComputedStyle(t).getPropertyValue(e)}},Xo={getRenderedStyle:function(e,t){return t?this.getStylePropertyValue(e,t,!0):this.getRawStyle(e,!0)},getRawStyle:function(e,t){var n=this;if(e=e[0]){for(var r={},i=0;i<n.properties.length;i++){var o=n.properties[i],a=n.getStylePropertyValue(e,o.name,t);null!=a&&(r[o.name]=a,r[H(o.name)]=a)}return r}},getIndexedStyle:function(e,t,n,r){var i=e.pstyle(t)[n][r];return null!=i?i:e.cy().style().getDefaultProperty(t)[n][0]},getStylePropertyValue:function(e,t,n){if(e=e[0]){var r=this.properties[t];r.alias&&(r=r.pointsTo);var i=r.type,o=e.pstyle(r.name);if(o){var a=o.value,s=o.units,l=o.strValue;if(n&&i.number&&null!=a&&O(a)){var c=e.cy().zoom(),u=function(e){return e*c},d=function(e,t){return u(e)+t},h=D(a);return(h?s.every((function(e){return null!=e})):null!=s)?h?a.map((function(e,t){return d(e,s[t])})).join(" "):d(a,s):h?a.map((function(e){return C(e)?e:""+u(e)})).join(" "):""+u(a)}if(null!=l)return l}return null}},getAnimationStartStyle:function(e,t){for(var n={},r=0;r<t.length;r++){var i=t[r].name,o=e.pstyle(i);void 0!==o&&(o=N(o)?this.parse(i,o.strValue):this.parse(i,o)),o&&(n[i]=o)}return n},getPropsList:function(e){var t=[],n=e,r=this.properties;if(n)for(var i=Object.keys(n),o=0;o<i.length;o++){var a=i[o],s=n[a],l=r[a]||r[G(a)],c=this.parse(l.name,s);c&&t.push(c)}return t},getNonDefaultPropertiesHash:function(e,t,n){var r,i,o,a,s,l,c=n.slice();for(s=0;s<t.length;s++)if(r=t[s],null!=(i=e.pstyle(r,!1)))if(null!=i.pfValue)c[0]=le(a,c[0]),c[1]=ce(a,c[1]);else for(o=i.strValue,l=0;l<o.length;l++)a=o.charCodeAt(l),c[0]=le(a,c[0]),c[1]=ce(a,c[1]);return c}};Xo.getPropertiesHash=Xo.getNonDefaultPropertiesHash;var $o={appendFromJson:function(e){for(var t=this,n=0;n<e.length;n++){var r=e[n],i=r.selector,o=r.style||r.css,a=Object.keys(o);t.selector(i);for(var s=0;s<a.length;s++){var l=a[s],c=o[l];t.css(l,c)}}return t},fromJson:function(e){var t=this;return t.resetToDefault(),t.appendFromJson(e),t},json:function(){for(var e=[],t=this.defaultLength;t<this.length;t++){for(var n=this[t],r=n.selector,i=n.properties,o={},a=0;a<i.length;a++){var s=i[a];o[s.name]=s.strValue}e.push({selector:r?r.toString():"core",style:o})}return e}},Ko={appendFromString:function(e){var t,n,r,i=this,o=""+e;function a(){o=o.length>t.length?o.substr(t.length):""}function s(){n=n.length>r.length?n.substr(r.length):""}for(o=o.replace(/[/][*](\s|.)+?[*][/]/g,"");;){if(o.match(/^\s*$/))break;var l=o.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!l){Se("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+o);break}t=l[0];var c=l[1];if("core"!==c)if(new Hr(c).invalid){Se("Skipping parsing of block: Invalid selector found in string stylesheet: "+c),a();continue}var u=l[2],d=!1;n=u;for(var h=[];;){if(n.match(/^\s*$/))break;var f=n.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!f){Se("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+u),d=!0;break}r=f[0];var p=f[1],v=f[2];if(this.properties[p])i.parse(p,v)?(h.push({name:p,val:v}),s()):(Se("Skipping property: Invalid property definition in: "+r),s());else Se("Skipping property: Invalid property name in: "+r),s()}if(d){a();break}i.selector(c);for(var g=0;g<h.length;g++){var m=h[g];i.css(m.name,m.val)}a()}return i},fromString:function(e){var t=this;return t.resetToDefault(),t.appendFromString(e),t}},Zo={};!function(){var e=Y,t=function(e){return"^"+e+"\\s*\\(\\s*([\\w\\.]+)\\s*\\)$"},n=function(t){var n=e+"|\\w+|rgb[a]?\\((?:(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))[%]?)\\s*,\\s*(?:(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))[%]?)\\s*,\\s*(?:(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))[%]?)(?:\\s*,\\s*(?:(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))))?\\)|hsl[a]?\\((?:(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?)))\\s*,\\s*(?:(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))[%])\\s*,\\s*(?:(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))[%])(?:\\s*,\\s*(?:(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))))?\\)|\\#[0-9a-fA-F]{3}|\\#[0-9a-fA-F]{6}";return"^"+t+"\\s*\\(([\\w\\.]+)\\s*\\,\\s*("+e+")\\s*\\,\\s*("+e+")\\s*,\\s*("+n+")\\s*\\,\\s*("+n+")\\)$"},r=["^url\\s*\\(\\s*['\"]?(.+?)['\"]?\\s*\\)$","^(none)$","^(.+)$"];Zo.types={time:{number:!0,min:0,units:"s|ms",implicitUnits:"ms"},percent:{number:!0,min:0,max:100,units:"%",implicitUnits:"%"},percentages:{number:!0,min:0,max:100,units:"%",implicitUnits:"%",multiple:!0},zeroOneNumber:{number:!0,min:0,max:1,unitless:!0},zeroOneNumbers:{number:!0,min:0,max:1,unitless:!0,multiple:!0},nOneOneNumber:{number:!0,min:-1,max:1,unitless:!0},nonNegativeInt:{number:!0,min:0,integer:!0,unitless:!0},position:{enums:["parent","origin"]},nodeSize:{number:!0,min:0,enums:["label"]},number:{number:!0,unitless:!0},numbers:{number:!0,unitless:!0,multiple:!0},positiveNumber:{number:!0,unitless:!0,min:0,strictMin:!0},size:{number:!0,min:0},bidirectionalSize:{number:!0},bidirectionalSizeMaybePercent:{number:!0,allowPercent:!0},bidirectionalSizes:{number:!0,multiple:!0},sizeMaybePercent:{number:!0,min:0,allowPercent:!0},axisDirection:{enums:["horizontal","leftward","rightward","vertical","upward","downward","auto"]},paddingRelativeTo:{enums:["width","height","average","min","max"]},bgWH:{number:!0,min:0,allowPercent:!0,enums:["auto"],multiple:!0},bgPos:{number:!0,allowPercent:!0,multiple:!0},bgRelativeTo:{enums:["inner","include-padding"],multiple:!0},bgRepeat:{enums:["repeat","repeat-x","repeat-y","no-repeat"],multiple:!0},bgFit:{enums:["none","contain","cover"],multiple:!0},bgCrossOrigin:{enums:["anonymous","use-credentials"],multiple:!0},bgClip:{enums:["none","node"],multiple:!0},bgContainment:{enums:["inside","over"],multiple:!0},color:{color:!0},colors:{color:!0,multiple:!0},fill:{enums:["solid","linear-gradient","radial-gradient"]},bool:{enums:["yes","no"]},bools:{enums:["yes","no"],multiple:!0},lineStyle:{enums:["solid","dotted","dashed"]},lineCap:{enums:["butt","round","square"]},borderStyle:{enums:["solid","dotted","dashed","double"]},curveStyle:{enums:["bezier","unbundled-bezier","haystack","segments","straight","straight-triangle","taxi"]},fontFamily:{regex:'^([\\w- \\"]+(?:\\s*,\\s*[\\w- \\"]+)*)$'},fontStyle:{enums:["italic","normal","oblique"]},fontWeight:{enums:["normal","bold","bolder","lighter","100","200","300","400","500","600","800","900",100,200,300,400,500,600,700,800,900]},textDecoration:{enums:["none","underline","overline","line-through"]},textTransform:{enums:["none","uppercase","lowercase"]},textWrap:{enums:["none","wrap","ellipsis"]},textOverflowWrap:{enums:["whitespace","anywhere"]},textBackgroundShape:{enums:["rectangle","roundrectangle","round-rectangle"]},nodeShape:{enums:["rectangle","roundrectangle","round-rectangle","cutrectangle","cut-rectangle","bottomroundrectangle","bottom-round-rectangle","barrel","ellipse","triangle","round-triangle","square","pentagon","round-pentagon","hexagon","round-hexagon","concavehexagon","concave-hexagon","heptagon","round-heptagon","octagon","round-octagon","tag","round-tag","star","diamond","round-diamond","vee","rhomboid","polygon"]},overlayShape:{enums:["roundrectangle","round-rectangle","ellipse"]},compoundIncludeLabels:{enums:["include","exclude"]},arrowShape:{enums:["tee","triangle","triangle-tee","circle-triangle","triangle-cross","triangle-backcurve","vee","square","circle","diamond","chevron","none"]},arrowFill:{enums:["filled","hollow"]},display:{enums:["element","none"]},visibility:{enums:["hidden","visible"]},zCompoundDepth:{enums:["bottom","orphan","auto","top"]},zIndexCompare:{enums:["auto","manual"]},valign:{enums:["top","center","bottom"]},halign:{enums:["left","center","right"]},justification:{enums:["left","center","right","auto"]},text:{string:!0},data:{mapping:!0,regex:t("data")},layoutData:{mapping:!0,regex:t("layoutData")},scratch:{mapping:!0,regex:t("scratch")},mapData:{mapping:!0,regex:n("mapData")},mapLayoutData:{mapping:!0,regex:n("mapLayoutData")},mapScratch:{mapping:!0,regex:n("mapScratch")},fn:{mapping:!0,fn:!0},url:{regexes:r,singleRegexMatchValue:!0},urls:{regexes:r,singleRegexMatchValue:!0,multiple:!0},propList:{propList:!0},angle:{number:!0,units:"deg|rad",implicitUnits:"rad"},textRotation:{number:!0,units:"deg|rad",implicitUnits:"rad",enums:["none","autorotate"]},polygonPointList:{number:!0,multiple:!0,evenMultiple:!0,min:-1,max:1,unitless:!0},edgeDistances:{enums:["intersection","node-position"]},edgeEndpoint:{number:!0,multiple:!0,units:"%|px|em|deg|rad",implicitUnits:"px",enums:["inside-to-node","outside-to-node","outside-to-node-or-label","outside-to-line","outside-to-line-or-label"],singleEnum:!0,validate:function(e,t){switch(e.length){case 2:return"deg"!==t[0]&&"rad"!==t[0]&&"deg"!==t[1]&&"rad"!==t[1];case 1:return C(e[0])||"deg"===t[0]||"rad"===t[0];default:return!1}}},easing:{regexes:["^(spring)\\s*\\(\\s*("+e+")\\s*,\\s*("+e+")\\s*\\)$","^(cubic-bezier)\\s*\\(\\s*("+e+")\\s*,\\s*("+e+")\\s*,\\s*("+e+")\\s*,\\s*("+e+")\\s*\\)$"],enums:["linear","ease","ease-in","ease-out","ease-in-out","ease-in-sine","ease-out-sine","ease-in-out-sine","ease-in-quad","ease-out-quad","ease-in-out-quad","ease-in-cubic","ease-out-cubic","ease-in-out-cubic","ease-in-quart","ease-out-quart","ease-in-out-quart","ease-in-quint","ease-out-quint","ease-in-out-quint","ease-in-expo","ease-out-expo","ease-in-out-expo","ease-in-circ","ease-out-circ","ease-in-out-circ"]},gradientDirection:{enums:["to-bottom","to-top","to-left","to-right","to-bottom-right","to-bottom-left","to-top-right","to-top-left","to-right-bottom","to-left-bottom","to-right-top","to-left-top"]},boundsExpansion:{number:!0,multiple:!0,min:0,validate:function(e){var t=e.length;return 1===t||2===t||4===t}}};var i={zeroNonZero:function(e,t){return(null==e||null==t)&&e!==t||(0==e&&0!=t||0!=e&&0==t)},any:function(e,t){return e!=t},emptyNonEmpty:function(e,t){var n=F(e),r=F(t);return n&&!r||!n&&r}},o=Zo.types,a=[{name:"label",type:o.text,triggersBounds:i.any,triggersZOrder:i.emptyNonEmpty},{name:"text-rotation",type:o.textRotation,triggersBounds:i.any},{name:"text-margin-x",type:o.bidirectionalSize,triggersBounds:i.any},{name:"text-margin-y",type:o.bidirectionalSize,triggersBounds:i.any}],s=[{name:"source-label",type:o.text,triggersBounds:i.any},{name:"source-text-rotation",type:o.textRotation,triggersBounds:i.any},{name:"source-text-margin-x",type:o.bidirectionalSize,triggersBounds:i.any},{name:"source-text-margin-y",type:o.bidirectionalSize,triggersBounds:i.any},{name:"source-text-offset",type:o.size,triggersBounds:i.any}],l=[{name:"target-label",type:o.text,triggersBounds:i.any},{name:"target-text-rotation",type:o.textRotation,triggersBounds:i.any},{name:"target-text-margin-x",type:o.bidirectionalSize,triggersBounds:i.any},{name:"target-text-margin-y",type:o.bidirectionalSize,triggersBounds:i.any},{name:"target-text-offset",type:o.size,triggersBounds:i.any}],c=[{name:"font-family",type:o.fontFamily,triggersBounds:i.any},{name:"font-style",type:o.fontStyle,triggersBounds:i.any},{name:"font-weight",type:o.fontWeight,triggersBounds:i.any},{name:"font-size",type:o.size,triggersBounds:i.any},{name:"text-transform",type:o.textTransform,triggersBounds:i.any},{name:"text-wrap",type:o.textWrap,triggersBounds:i.any},{name:"text-overflow-wrap",type:o.textOverflowWrap,triggersBounds:i.any},{name:"text-max-width",type:o.size,triggersBounds:i.any},{name:"text-outline-width",type:o.size,triggersBounds:i.any},{name:"line-height",type:o.positiveNumber,triggersBounds:i.any}],u=[{name:"text-valign",type:o.valign,triggersBounds:i.any},{name:"text-halign",type:o.halign,triggersBounds:i.any},{name:"color",type:o.color},{name:"text-outline-color",type:o.color},{name:"text-outline-opacity",type:o.zeroOneNumber},{name:"text-background-color",type:o.color},{name:"text-background-opacity",type:o.zeroOneNumber},{name:"text-background-padding",type:o.size,triggersBounds:i.any},{name:"text-border-opacity",type:o.zeroOneNumber},{name:"text-border-color",type:o.color},{name:"text-border-width",type:o.size,triggersBounds:i.any},{name:"text-border-style",type:o.borderStyle,triggersBounds:i.any},{name:"text-background-shape",type:o.textBackgroundShape,triggersBounds:i.any},{name:"text-justification",type:o.justification}],d=[{name:"events",type:o.bool},{name:"text-events",type:o.bool}],h=[{name:"display",type:o.display,triggersZOrder:i.any,triggersBounds:i.any,triggersBoundsOfParallelBeziers:!0},{name:"visibility",type:o.visibility,triggersZOrder:i.any},{name:"opacity",type:o.zeroOneNumber,triggersZOrder:i.zeroNonZero},{name:"text-opacity",type:o.zeroOneNumber},{name:"min-zoomed-font-size",type:o.size},{name:"z-compound-depth",type:o.zCompoundDepth,triggersZOrder:i.any},{name:"z-index-compare",type:o.zIndexCompare,triggersZOrder:i.any},{name:"z-index",type:o.nonNegativeInt,triggersZOrder:i.any}],f=[{name:"overlay-padding",type:o.size,triggersBounds:i.any},{name:"overlay-color",type:o.color},{name:"overlay-opacity",type:o.zeroOneNumber,triggersBounds:i.zeroNonZero},{name:"overlay-shape",type:o.overlayShape,triggersBounds:i.any}],p=[{name:"underlay-padding",type:o.size,triggersBounds:i.any},{name:"underlay-color",type:o.color},{name:"underlay-opacity",type:o.zeroOneNumber,triggersBounds:i.zeroNonZero},{name:"underlay-shape",type:o.overlayShape,triggersBounds:i.any}],v=[{name:"transition-property",type:o.propList},{name:"transition-duration",type:o.time},{name:"transition-delay",type:o.time},{name:"transition-timing-function",type:o.easing}],g=function(e,t){return"label"===t.value?-e.poolIndex():t.pfValue},m=[{name:"height",type:o.nodeSize,triggersBounds:i.any,hashOverride:g},{name:"width",type:o.nodeSize,triggersBounds:i.any,hashOverride:g},{name:"shape",type:o.nodeShape,triggersBounds:i.any},{name:"shape-polygon-points",type:o.polygonPointList,triggersBounds:i.any},{name:"background-color",type:o.color},{name:"background-fill",type:o.fill},{name:"background-opacity",type:o.zeroOneNumber},{name:"background-blacken",type:o.nOneOneNumber},{name:"background-gradient-stop-colors",type:o.colors},{name:"background-gradient-stop-positions",type:o.percentages},{name:"background-gradient-direction",type:o.gradientDirection},{name:"padding",type:o.sizeMaybePercent,triggersBounds:i.any},{name:"padding-relative-to",type:o.paddingRelativeTo,triggersBounds:i.any},{name:"bounds-expansion",type:o.boundsExpansion,triggersBounds:i.any}],y=[{name:"border-color",type:o.color},{name:"border-opacity",type:o.zeroOneNumber},{name:"border-width",type:o.size,triggersBounds:i.any},{name:"border-style",type:o.borderStyle}],b=[{name:"background-image",type:o.urls},{name:"background-image-crossorigin",type:o.bgCrossOrigin},{name:"background-image-opacity",type:o.zeroOneNumbers},{name:"background-image-containment",type:o.bgContainment},{name:"background-image-smoothing",type:o.bools},{name:"background-position-x",type:o.bgPos},{name:"background-position-y",type:o.bgPos},{name:"background-width-relative-to",type:o.bgRelativeTo},{name:"background-height-relative-to",type:o.bgRelativeTo},{name:"background-repeat",type:o.bgRepeat},{name:"background-fit",type:o.bgFit},{name:"background-clip",type:o.bgClip},{name:"background-width",type:o.bgWH},{name:"background-height",type:o.bgWH},{name:"background-offset-x",type:o.bgPos},{name:"background-offset-y",type:o.bgPos}],x=[{name:"position",type:o.position,triggersBounds:i.any},{name:"compound-sizing-wrt-labels",type:o.compoundIncludeLabels,triggersBounds:i.any},{name:"min-width",type:o.size,triggersBounds:i.any},{name:"min-width-bias-left",type:o.sizeMaybePercent,triggersBounds:i.any},{name:"min-width-bias-right",type:o.sizeMaybePercent,triggersBounds:i.any},{name:"min-height",type:o.size,triggersBounds:i.any},{name:"min-height-bias-top",type:o.sizeMaybePercent,triggersBounds:i.any},{name:"min-height-bias-bottom",type:o.sizeMaybePercent,triggersBounds:i.any}],w=[{name:"line-style",type:o.lineStyle},{name:"line-color",type:o.color},{name:"line-fill",type:o.fill},{name:"line-cap",type:o.lineCap},{name:"line-opacity",type:o.zeroOneNumber},{name:"line-dash-pattern",type:o.numbers},{name:"line-dash-offset",type:o.number},{name:"line-gradient-stop-colors",type:o.colors},{name:"line-gradient-stop-positions",type:o.percentages},{name:"curve-style",type:o.curveStyle,triggersBounds:i.any,triggersBoundsOfParallelBeziers:!0},{name:"haystack-radius",type:o.zeroOneNumber,triggersBounds:i.any},{name:"source-endpoint",type:o.edgeEndpoint,triggersBounds:i.any},{name:"target-endpoint",type:o.edgeEndpoint,triggersBounds:i.any},{name:"control-point-step-size",type:o.size,triggersBounds:i.any},{name:"control-point-distances",type:o.bidirectionalSizes,triggersBounds:i.any},{name:"control-point-weights",type:o.numbers,triggersBounds:i.any},{name:"segment-distances",type:o.bidirectionalSizes,triggersBounds:i.any},{name:"segment-weights",type:o.numbers,triggersBounds:i.any},{name:"taxi-turn",type:o.bidirectionalSizeMaybePercent,triggersBounds:i.any},{name:"taxi-turn-min-distance",type:o.size,triggersBounds:i.any},{name:"taxi-direction",type:o.axisDirection,triggersBounds:i.any},{name:"edge-distances",type:o.edgeDistances,triggersBounds:i.any},{name:"arrow-scale",type:o.positiveNumber,triggersBounds:i.any},{name:"loop-direction",type:o.angle,triggersBounds:i.any},{name:"loop-sweep",type:o.angle,triggersBounds:i.any},{name:"source-distance-from-node",type:o.size,triggersBounds:i.any},{name:"target-distance-from-node",type:o.size,triggersBounds:i.any}],E=[{name:"ghost",type:o.bool,triggersBounds:i.any},{name:"ghost-offset-x",type:o.bidirectionalSize,triggersBounds:i.any},{name:"ghost-offset-y",type:o.bidirectionalSize,triggersBounds:i.any},{name:"ghost-opacity",type:o.zeroOneNumber}],_=[{name:"selection-box-color",type:o.color},{name:"selection-box-opacity",type:o.zeroOneNumber},{name:"selection-box-border-color",type:o.color},{name:"selection-box-border-width",type:o.size},{name:"active-bg-color",type:o.color},{name:"active-bg-opacity",type:o.zeroOneNumber},{name:"active-bg-size",type:o.size},{name:"outside-texture-bg-color",type:o.color},{name:"outside-texture-bg-opacity",type:o.zeroOneNumber}],k=[];Zo.pieBackgroundN=16,k.push({name:"pie-size",type:o.sizeMaybePercent});for(var S=1;S<=Zo.pieBackgroundN;S++)k.push({name:"pie-"+S+"-background-color",type:o.color}),k.push({name:"pie-"+S+"-background-size",type:o.percent}),k.push({name:"pie-"+S+"-background-opacity",type:o.zeroOneNumber});var P=[],j=Zo.arrowPrefixes=["source","mid-source","target","mid-target"];[{name:"arrow-shape",type:o.arrowShape,triggersBounds:i.any},{name:"arrow-color",type:o.color},{name:"arrow-fill",type:o.arrowFill}].forEach((function(e){j.forEach((function(t){var n=t+"-"+e.name,r=e.type,i=e.triggersBounds;P.push({name:n,type:r,triggersBounds:i})}))}),{});var T=Zo.properties=[].concat(d,v,h,f,p,E,u,c,a,s,l,m,y,b,k,x,w,P,_),D=Zo.propertyGroups={behavior:d,transition:v,visibility:h,overlay:f,underlay:p,ghost:E,commonLabel:u,labelDimensions:c,mainLabel:a,sourceLabel:s,targetLabel:l,nodeBody:m,nodeBorder:y,backgroundImage:b,pie:k,compound:x,edgeLine:w,edgeArrow:P,core:_},N=Zo.propertyGroupNames={};(Zo.propertyGroupKeys=Object.keys(D)).forEach((function(e){N[e]=D[e].map((function(e){return e.name})),D[e].forEach((function(t){return t.groupKey=e}))}));var O=Zo.aliases=[{name:"content",pointsTo:"label"},{name:"control-point-distance",pointsTo:"control-point-distances"},{name:"control-point-weight",pointsTo:"control-point-weights"},{name:"edge-text-rotation",pointsTo:"text-rotation"},{name:"padding-left",pointsTo:"padding"},{name:"padding-right",pointsTo:"padding"},{name:"padding-top",pointsTo:"padding"},{name:"padding-bottom",pointsTo:"padding"}];Zo.propertyNames=T.map((function(e){return e.name}));for(var M=0;M<T.length;M++){var A=T[M];T[A.name]=A}for(var R=0;R<O.length;R++){var I=O[R],L=T[I.pointsTo],B={name:I.name,alias:!0,pointsTo:L};T.push(B),T[I.name]=B}}(),Zo.getDefaultProperty=function(e){return this.getDefaultProperties()[e]},Zo.getDefaultProperties=function(){var e=this._private;if(null!=e.defaultProperties)return e.defaultProperties;for(var t=X({"selection-box-color":"#ddd","selection-box-opacity":.65,"selection-box-border-color":"#aaa","selection-box-border-width":1,"active-bg-color":"black","active-bg-opacity":.15,"active-bg-size":30,"outside-texture-bg-color":"#000","outside-texture-bg-opacity":.125,events:"yes","text-events":"no","text-valign":"top","text-halign":"center","text-justification":"auto","line-height":1,color:"#000","text-outline-color":"#000","text-outline-width":0,"text-outline-opacity":1,"text-opacity":1,"text-decoration":"none","text-transform":"none","text-wrap":"none","text-overflow-wrap":"whitespace","text-max-width":9999,"text-background-color":"#000","text-background-opacity":0,"text-background-shape":"rectangle","text-background-padding":0,"text-border-opacity":0,"text-border-width":0,"text-border-style":"solid","text-border-color":"#000","font-family":"Helvetica Neue, Helvetica, sans-serif","font-style":"normal","font-weight":"normal","font-size":16,"min-zoomed-font-size":0,"text-rotation":"none","source-text-rotation":"none","target-text-rotation":"none",visibility:"visible",display:"element",opacity:1,"z-compound-depth":"auto","z-index-compare":"auto","z-index":0,label:"","text-margin-x":0,"text-margin-y":0,"source-label":"","source-text-offset":0,"source-text-margin-x":0,"source-text-margin-y":0,"target-label":"","target-text-offset":0,"target-text-margin-x":0,"target-text-margin-y":0,"overlay-opacity":0,"overlay-color":"#000","overlay-padding":10,"overlay-shape":"round-rectangle","underlay-opacity":0,"underlay-color":"#000","underlay-padding":10,"underlay-shape":"round-rectangle","transition-property":"none","transition-duration":0,"transition-delay":0,"transition-timing-function":"linear","background-blacken":0,"background-color":"#999","background-fill":"solid","background-opacity":1,"background-image":"none","background-image-crossorigin":"anonymous","background-image-opacity":1,"background-image-containment":"inside","background-image-smoothing":"yes","background-position-x":"50%","background-position-y":"50%","background-offset-x":0,"background-offset-y":0,"background-width-relative-to":"include-padding","background-height-relative-to":"include-padding","background-repeat":"no-repeat","background-fit":"none","background-clip":"node","background-width":"auto","background-height":"auto","border-color":"#000","border-opacity":1,"border-width":0,"border-style":"solid",height:30,width:30,shape:"ellipse","shape-polygon-points":"-1, -1, 1, -1, 1, 1, -1, 1","bounds-expansion":0,"background-gradient-direction":"to-bottom","background-gradient-stop-colors":"#999","background-gradient-stop-positions":"0%",ghost:"no","ghost-offset-y":0,"ghost-offset-x":0,"ghost-opacity":0,padding:0,"padding-relative-to":"width",position:"origin","compound-sizing-wrt-labels":"include","min-width":0,"min-width-bias-left":0,"min-width-bias-right":0,"min-height":0,"min-height-bias-top":0,"min-height-bias-bottom":0},{"pie-size":"100%"},[{name:"pie-{{i}}-background-color",value:"black"},{name:"pie-{{i}}-background-size",value:"0%"},{name:"pie-{{i}}-background-opacity",value:1}].reduce((function(e,t){for(var n=1;n<=Zo.pieBackgroundN;n++){var r=t.name.replace("{{i}}",n),i=t.value;e[r]=i}return e}),{}),{"line-style":"solid","line-color":"#999","line-fill":"solid","line-cap":"butt","line-opacity":1,"line-gradient-stop-colors":"#999","line-gradient-stop-positions":"0%","control-point-step-size":40,"control-point-weights":.5,"segment-weights":.5,"segment-distances":20,"taxi-turn":"50%","taxi-turn-min-distance":10,"taxi-direction":"auto","edge-distances":"intersection","curve-style":"haystack","haystack-radius":0,"arrow-scale":1,"loop-direction":"-45deg","loop-sweep":"-90deg","source-distance-from-node":0,"target-distance-from-node":0,"source-endpoint":"outside-to-node","target-endpoint":"outside-to-node","line-dash-pattern":[6,3],"line-dash-offset":0},[{name:"arrow-shape",value:"none"},{name:"arrow-color",value:"#999"},{name:"arrow-fill",value:"filled"}].reduce((function(e,t){return Zo.arrowPrefixes.forEach((function(n){var r=n+"-"+t.name,i=t.value;e[r]=i})),e}),{})),n={},r=0;r<this.properties.length;r++){var i=this.properties[r];if(!i.pointsTo){var o=i.name,a=t[o],s=this.parse(o,a);n[o]=s}}return e.defaultProperties=n,e.defaultProperties},Zo.addDefaultStylesheet=function(){this.selector(":parent").css({shape:"rectangle",padding:10,"background-color":"#eee","border-color":"#ccc","border-width":1}).selector("edge").css({width:3}).selector(":loop").css({"curve-style":"bezier"}).selector("edge:compound").css({"curve-style":"bezier","source-endpoint":"outside-to-line","target-endpoint":"outside-to-line"}).selector(":selected").css({"background-color":"#0169D9","line-color":"#0169D9","source-arrow-color":"#0169D9","target-arrow-color":"#0169D9","mid-source-arrow-color":"#0169D9","mid-target-arrow-color":"#0169D9"}).selector(":parent:selected").css({"background-color":"#CCE1F9","border-color":"#aec8e5"}).selector(":active").css({"overlay-color":"black","overlay-padding":10,"overlay-opacity":.25}),this.defaultLength=this.length};var Qo={parse:function(e,t,n,r){var i=this;if(T(t))return i.parseImplWarn(e,t,n,r);var o,a=fe(e,""+t,n?"t":"f","mapping"===r||!0===r||!1===r||null==r?"dontcare":r),s=i.propCache=i.propCache||[];return(o=s[a])||(o=s[a]=i.parseImplWarn(e,t,n,r)),(n||"mapping"===r)&&(o=Pe(o))&&(o.value=Pe(o.value)),o},parseImplWarn:function(e,t,n,r){var i=this.parseImpl(e,t,n,r);return i||null==t||Se("The style property `".concat(e,": ").concat(t,"` is invalid")),!i||"width"!==i.name&&"height"!==i.name||"label"!==t||Se("The style value of `label` is deprecated for `"+i.name+"`"),i}};Qo.parseImpl=function(e,t,n,r){var i=this;e=G(e);var o=i.properties[e],a=t,s=i.types;if(!o)return null;if(void 0===t)return null;o.alias&&(o=o.pointsTo,e=o.name);var l=C(t);l&&(t=t.trim());var c,u,d=o.type;if(!d)return null;if(n&&(""===t||null===t))return{name:e,value:t,bypass:!0,deleteBypass:!0};if(T(t))return{name:e,value:t,strValue:"fn",mapped:s.fn,bypass:n};if(!l||r||t.length<7||"a"!==t[1]);else{if(t.length>=7&&"d"===t[0]&&(c=new RegExp(s.data.regex).exec(t))){if(n)return!1;var h=s.data;return{name:e,value:c,strValue:""+t,mapped:h,field:c[1],bypass:n}}if(t.length>=10&&"m"===t[0]&&(u=new RegExp(s.mapData.regex).exec(t))){if(n)return!1;if(d.multiple)return!1;var f=s.mapData;if(!d.color&&!d.number)return!1;var p=this.parse(e,u[4]);if(!p||p.mapped)return!1;var v=this.parse(e,u[5]);if(!v||v.mapped)return!1;if(p.pfValue===v.pfValue||p.strValue===v.strValue)return Se("`"+e+": "+t+"` is not a valid mapper because the output range is zero; converting to `"+e+": "+p.strValue+"`"),this.parse(e,p.strValue);if(d.color){var g=p.value,m=v.value;if(!(g[0]!==m[0]||g[1]!==m[1]||g[2]!==m[2]||g[3]!==m[3]&&(null!=g[3]&&1!==g[3]||null!=m[3]&&1!==m[3])))return!1}return{name:e,value:u,strValue:""+t,mapped:f,field:u[1],fieldMin:parseFloat(u[2]),fieldMax:parseFloat(u[3]),valueMin:p.value,valueMax:v.value,bypass:n}}}if(d.multiple&&"multiple"!==r){var y;if(y=l?t.split(/\s+/):D(t)?t:[t],d.evenMultiple&&y.length%2!=0)return null;for(var b=[],x=[],w=[],E="",_=!1,k=0;k<y.length;k++){var S=i.parse(e,y[k],n,"multiple");_=_||C(S.value),b.push(S.value),w.push(null!=S.pfValue?S.pfValue:S.value),x.push(S.units),E+=(k>0?" ":"")+S.strValue}return d.validate&&!d.validate(b,x)?null:d.singleEnum&&_?1===b.length&&C(b[0])?{name:e,value:b[0],strValue:b[0],bypass:n}:null:{name:e,value:b,pfValue:w,strValue:E,bypass:n,units:x}}var P,j,N=function(){for(var r=0;r<d.enums.length;r++){if(d.enums[r]===t)return{name:e,value:t,strValue:""+t,bypass:n}}return null};if(d.number){var M,A="px";if(d.units&&(M=d.units),d.implicitUnits&&(A=d.implicitUnits),!d.unitless)if(l){var R="px|em"+(d.allowPercent?"|\\%":"");M&&(R=M);var I=t.match("^("+Y+")("+R+")?$");I&&(t=I[1],M=I[2]||A)}else M&&!d.implicitUnits||(M=A);if(t=parseFloat(t),isNaN(t)&&void 0===d.enums)return null;if(isNaN(t)&&void 0!==d.enums)return t=a,N();if(d.integer&&(!O(j=t)||Math.floor(j)!==j))return null;if(void 0!==d.min&&(t<d.min||d.strictMin&&t===d.min)||void 0!==d.max&&(t>d.max||d.strictMax&&t===d.max))return null;var L={name:e,value:t,strValue:""+t+(M||""),units:M,bypass:n};return d.unitless||"px"!==M&&"em"!==M?L.pfValue=t:L.pfValue="px"!==M&&M?this.getEmSizeInPixels()*t:t,"ms"!==M&&"s"!==M||(L.pfValue="ms"===M?t:1e3*t),"deg"!==M&&"rad"!==M||(L.pfValue="rad"===M?t:(P=t,Math.PI*P/180)),"%"===M&&(L.pfValue=t/100),L}if(d.propList){var B=[],F=""+t;if("none"===F);else{for(var z=F.split(/\s*,\s*|\s+/),V=0;V<z.length;V++){var H=z[V].trim();i.properties[H]?B.push(H):Se("`"+H+"` is not a valid property name")}if(0===B.length)return null}return{name:e,value:B,strValue:0===B.length?"none":B.join(" "),bypass:n}}if(d.color){var W=$(t);return W?{name:e,value:W,pfValue:W,strValue:"rgb("+W[0]+","+W[1]+","+W[2]+")",bypass:n}:null}if(d.regex||d.regexes){if(d.enums){var q=N();if(q)return q}for(var U=d.regexes?d.regexes:[d.regex],X=0;X<U.length;X++){var K=new RegExp(U[X]).exec(t);if(K)return{name:e,value:d.singleRegexMatchValue?K[1]:K,strValue:""+t,bypass:n}}return null}return d.string?{name:e,value:""+t,strValue:""+t,bypass:n}:d.enums?N():null};var Jo=function e(t){if(!(this instanceof e))return new e(t);L(t)?(this._private={cy:t,coreStyle:{}},this.length=0,this.resetToDefault()):_e("A style must have a core reference")},ea=Jo.prototype;ea.instanceString=function(){return"style"},ea.clear=function(){for(var e=this._private,t=e.cy.elements(),n=0;n<this.length;n++)this[n]=void 0;return this.length=0,e.contextStyles={},e.propDiffs={},this.cleanElements(t,!0),t.forEach((function(e){var t=e[0]._private;t.styleDirty=!0,t.appliedInitStyle=!1})),this},ea.resetToDefault=function(){return this.clear(),this.addDefaultStylesheet(),this},ea.core=function(e){return this._private.coreStyle[e]||this.getDefaultProperty(e)},ea.selector=function(e){var t="core"===e?null:new Hr(e),n=this.length++;return this[n]={selector:t,properties:[],mappedProperties:[],index:n},this},ea.css=function(){var e=this,t=arguments;if(1===t.length)for(var n=t[0],r=0;r<e.properties.length;r++){var i=e.properties[r],o=n[i.name];void 0===o&&(o=n[H(i.name)]),void 0!==o&&this.cssRule(i.name,o)}else 2===t.length&&this.cssRule(t[0],t[1]);return this},ea.style=ea.css,ea.cssRule=function(e,t){var n=this.parse(e,t);if(n){var r=this.length-1;this[r].properties.push(n),this[r].properties[n.name]=n,n.name.match(/pie-(\d+)-background-size/)&&n.value&&(this._private.hasPie=!0),n.mapped&&this[r].mappedProperties.push(n),!this[r].selector&&(this._private.coreStyle[n.name]=n)}return this},ea.append=function(e){return B(e)?e.appendToStyle(this):D(e)?this.appendFromJson(e):C(e)&&this.appendFromString(e),this},Jo.fromJson=function(e,t){var n=new Jo(e);return n.fromJson(t),n},Jo.fromString=function(e,t){return new Jo(e).fromString(t)},[Wo,Yo,Uo,Xo,$o,Ko,Zo,Qo].forEach((function(e){X(ea,e)})),Jo.types=ea.types,Jo.properties=ea.properties,Jo.propertyGroups=ea.propertyGroups,Jo.propertyGroupNames=ea.propertyGroupNames,Jo.propertyGroupKeys=ea.propertyGroupKeys;var ta={style:function(e){e&&this.setStyle(e).update();return this._private.style},setStyle:function(e){var t=this._private;return B(e)?t.style=e.generateStyle(this):D(e)?t.style=Jo.fromJson(this,e):C(e)?t.style=Jo.fromString(this,e):t.style=Jo(this),t.style},updateStyle:function(){this.mutableElements().updateStyle()}},na={autolock:function(e){return void 0===e?this._private.autolock:(this._private.autolock=!!e,this)},autoungrabify:function(e){return void 0===e?this._private.autoungrabify:(this._private.autoungrabify=!!e,this)},autounselectify:function(e){return void 0===e?this._private.autounselectify:(this._private.autounselectify=!!e,this)},selectionType:function(e){var t=this._private;return null==t.selectionType&&(t.selectionType="single"),void 0===e?t.selectionType:("additive"!==e&&"single"!==e||(t.selectionType=e),this)},panningEnabled:function(e){return void 0===e?this._private.panningEnabled:(this._private.panningEnabled=!!e,this)},userPanningEnabled:function(e){return void 0===e?this._private.userPanningEnabled:(this._private.userPanningEnabled=!!e,this)},zoomingEnabled:function(e){return void 0===e?this._private.zoomingEnabled:(this._private.zoomingEnabled=!!e,this)},userZoomingEnabled:function(e){return void 0===e?this._private.userZoomingEnabled:(this._private.userZoomingEnabled=!!e,this)},boxSelectionEnabled:function(e){return void 0===e?this._private.boxSelectionEnabled:(this._private.boxSelectionEnabled=!!e,this)},pan:function(){var e,t,n,r,i,o=arguments,a=this._private.pan;switch(o.length){case 0:return a;case 1:if(C(o[0]))return a[e=o[0]];if(N(o[0])){if(!this._private.panningEnabled)return this;r=(n=o[0]).x,i=n.y,O(r)&&(a.x=r),O(i)&&(a.y=i),this.emit("pan viewport")}break;case 2:if(!this._private.panningEnabled)return this;e=o[0],t=o[1],"x"!==e&&"y"!==e||!O(t)||(a[e]=t),this.emit("pan viewport")}return this.notify("viewport"),this},panBy:function(e,t){var n,r,i,o,a,s=arguments,l=this._private.pan;if(!this._private.panningEnabled)return this;switch(s.length){case 1:N(e)&&(o=(i=s[0]).x,a=i.y,O(o)&&(l.x+=o),O(a)&&(l.y+=a),this.emit("pan viewport"));break;case 2:r=t,"x"!==(n=e)&&"y"!==n||!O(r)||(l[n]+=r),this.emit("pan viewport")}return this.notify("viewport"),this},fit:function(e,t){var n=this.getFitViewport(e,t);if(n){var r=this._private;r.zoom=n.zoom,r.pan=n.pan,this.emit("pan zoom viewport"),this.notify("viewport")}return this},getFitViewport:function(e,t){if(O(e)&&void 0===t&&(t=e,e=void 0),this._private.panningEnabled&&this._private.zoomingEnabled){var n,r;if(C(e)){var i=e;e=this.$(i)}else if(N(r=e)&&O(r.x1)&&O(r.x2)&&O(r.y1)&&O(r.y2)){var o=e;(n={x1:o.x1,y1:o.y1,x2:o.x2,y2:o.y2}).w=n.x2-n.x1,n.h=n.y2-n.y1}else A(e)||(e=this.mutableElements());if(!A(e)||!e.empty()){n=n||e.boundingBox();var a,s=this.width(),l=this.height();if(t=O(t)?t:0,!isNaN(s)&&!isNaN(l)&&s>0&&l>0&&!isNaN(n.w)&&!isNaN(n.h)&&n.w>0&&n.h>0)return{zoom:a=(a=(a=Math.min((s-2*t)/n.w,(l-2*t)/n.h))>this._private.maxZoom?this._private.maxZoom:a)<this._private.minZoom?this._private.minZoom:a,pan:{x:(s-a*(n.x1+n.x2))/2,y:(l-a*(n.y1+n.y2))/2}}}}},zoomRange:function(e,t){var n=this._private;if(null==t){var r=e;e=r.min,t=r.max}return O(e)&&O(t)&&e<=t?(n.minZoom=e,n.maxZoom=t):O(e)&&void 0===t&&e<=n.maxZoom?n.minZoom=e:O(t)&&void 0===e&&t>=n.minZoom&&(n.maxZoom=t),this},minZoom:function(e){return void 0===e?this._private.minZoom:this.zoomRange({min:e})},maxZoom:function(e){return void 0===e?this._private.maxZoom:this.zoomRange({max:e})},getZoomedViewport:function(e){var t,n,r=this._private,i=r.pan,o=r.zoom,a=!1;if(r.zoomingEnabled||(a=!0),O(e)?n=e:N(e)&&(n=e.level,null!=e.position?t=et(e.position,o,i):null!=e.renderedPosition&&(t=e.renderedPosition),null==t||r.panningEnabled||(a=!0)),n=(n=n>r.maxZoom?r.maxZoom:n)<r.minZoom?r.minZoom:n,a||!O(n)||n===o||null!=t&&(!O(t.x)||!O(t.y)))return null;if(null!=t){var s=i,l=o,c=n;return{zoomed:!0,panned:!0,zoom:c,pan:{x:-c/l*(t.x-s.x)+t.x,y:-c/l*(t.y-s.y)+t.y}}}return{zoomed:!0,panned:!1,zoom:n,pan:i}},zoom:function(e){if(void 0===e)return this._private.zoom;var t=this.getZoomedViewport(e),n=this._private;return null!=t&&t.zoomed?(n.zoom=t.zoom,t.panned&&(n.pan.x=t.pan.x,n.pan.y=t.pan.y),this.emit("zoom"+(t.panned?" pan":"")+" viewport"),this.notify("viewport"),this):this},viewport:function(e){var t=this._private,n=!0,r=!0,i=[],o=!1,a=!1;if(!e)return this;if(O(e.zoom)||(n=!1),N(e.pan)||(r=!1),!n&&!r)return this;if(n){var s=e.zoom;s<t.minZoom||s>t.maxZoom||!t.zoomingEnabled?o=!0:(t.zoom=s,i.push("zoom"))}if(r&&(!o||!e.cancelOnFailedZoom)&&t.panningEnabled){var l=e.pan;O(l.x)&&(t.pan.x=l.x,a=!1),O(l.y)&&(t.pan.y=l.y,a=!1),a||i.push("pan")}return i.length>0&&(i.push("viewport"),this.emit(i.join(" ")),this.notify("viewport")),this},center:function(e){var t=this.getCenterPan(e);return t&&(this._private.pan=t,this.emit("pan viewport"),this.notify("viewport")),this},getCenterPan:function(e,t){if(this._private.panningEnabled){if(C(e)){var n=e;e=this.mutableElements().filter(n)}else A(e)||(e=this.mutableElements());if(0!==e.length){var r=e.boundingBox(),i=this.width(),o=this.height();return{x:(i-(t=void 0===t?this._private.zoom:t)*(r.x1+r.x2))/2,y:(o-t*(r.y1+r.y2))/2}}}},reset:function(){return this._private.panningEnabled&&this._private.zoomingEnabled?(this.viewport({pan:{x:0,y:0},zoom:1}),this):this},invalidateSize:function(){this._private.sizeCache=null},size:function(){var e,t,n=this._private,r=n.container;return n.sizeCache=n.sizeCache||(r?(e=w.getComputedStyle(r),t=function(t){return parseFloat(e.getPropertyValue(t))},{width:r.clientWidth-t("padding-left")-t("padding-right"),height:r.clientHeight-t("padding-top")-t("padding-bottom")}):{width:1,height:1})},width:function(){return this.size().width},height:function(){return this.size().height},extent:function(){var e=this._private.pan,t=this._private.zoom,n=this.renderedExtent(),r={x1:(n.x1-e.x)/t,x2:(n.x2-e.x)/t,y1:(n.y1-e.y)/t,y2:(n.y2-e.y)/t};return r.w=r.x2-r.x1,r.h=r.y2-r.y1,r},renderedExtent:function(){var e=this.width(),t=this.height();return{x1:0,y1:0,x2:e,y2:t,w:e,h:t}},multiClickDebounceTime:function(e){return e?(this._private.multiClickDebounceTime=e,this):this._private.multiClickDebounceTime}};na.centre=na.center,na.autolockNodes=na.autolock,na.autoungrabifyNodes=na.autoungrabify;var ra={data:or.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:or.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:or.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:or.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};ra.attr=ra.data,ra.removeAttr=ra.removeData;var ia=function(e){var t=this,n=(e=X({},e)).container;n&&!M(n)&&M(n[0])&&(n=n[0]);var r=n?n._cyreg:null;(r=r||{})&&r.cy&&(r.cy.destroy(),r={});var i=r.readies=r.readies||[];n&&(n._cyreg=r),r.cy=t;var o=void 0!==w&&void 0!==n&&!e.headless,a=e;a.layout=X({name:o?"grid":"null"},a.layout),a.renderer=X({name:o?"canvas":"null"},a.renderer);var s=function(e,t,n){return void 0!==t?t:void 0!==n?n:e},l=this._private={container:n,ready:!1,options:a,elements:new wo(this),listeners:[],aniEles:new wo(this),data:a.data||{},scratch:{},layout:null,renderer:null,destroyed:!1,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:s(!0,a.zoomingEnabled),userZoomingEnabled:s(!0,a.userZoomingEnabled),panningEnabled:s(!0,a.panningEnabled),userPanningEnabled:s(!0,a.userPanningEnabled),boxSelectionEnabled:s(!0,a.boxSelectionEnabled),autolock:s(!1,a.autolock,a.autolockNodes),autoungrabify:s(!1,a.autoungrabify,a.autoungrabifyNodes),autounselectify:s(!1,a.autounselectify),styleEnabled:void 0===a.styleEnabled?o:a.styleEnabled,zoom:O(a.zoom)?a.zoom:1,pan:{x:N(a.pan)&&O(a.pan.x)?a.pan.x:0,y:N(a.pan)&&O(a.pan.y)?a.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1,multiClickDebounceTime:s(250,a.multiClickDebounceTime)};this.createEmitter(),this.selectionType(a.selectionType),this.zoomRange({min:a.minZoom,max:a.maxZoom});l.styleEnabled&&t.setStyle([]);var c=X({},a,a.renderer);t.initRenderer(c);!function(e,t){if(e.some(z))return Jn.all(e).then(t);t(e)}([a.style,a.elements],(function(e){var n=e[0],o=e[1];l.styleEnabled&&t.style().append(n),function(e,n,r){t.notifications(!1);var i=t.mutableElements();i.length>0&&i.remove(),null!=e&&(N(e)||D(e))&&t.add(e),t.one("layoutready",(function(e){t.notifications(!0),t.emit(e),t.one("load",n),t.emitAndNotify("load")})).one("layoutstop",(function(){t.one("done",r),t.emit("done")}));var o=X({},t._private.options.layout);o.eles=t.elements(),t.layout(o).run()}(o,(function(){t.startAnimationLoop(),l.ready=!0,T(a.ready)&&t.on("ready",a.ready);for(var e=0;e<i.length;e++){var n=i[e];t.on("ready",n)}r&&(r.readies=[]),t.emit("ready")}),a.done)}))},oa=ia.prototype;X(oa,{instanceString:function(){return"core"},isReady:function(){return this._private.ready},destroyed:function(){return this._private.destroyed},ready:function(e){return this.isReady()?this.emitter().emit("ready",[],e):this.on("ready",e),this},destroy:function(){var e=this;if(!e.destroyed())return e.stopAnimationLoop(),e.destroyRenderer(),this.emit("destroy"),e._private.destroyed=!0,e},hasElementWithId:function(e){return this._private.elements.hasElementWithId(e)},getElementById:function(e){return this._private.elements.getElementById(e)},hasCompoundNodes:function(){return this._private.hasCompoundNodes},headless:function(){return this._private.renderer.isHeadless()},styleEnabled:function(){return this._private.styleEnabled},addToPool:function(e){return this._private.elements.merge(e),this},removeFromPool:function(e){return this._private.elements.unmerge(e),this},container:function(){return this._private.container||null},mount:function(e){if(null!=e){var t=this,n=t._private,r=n.options;return!M(e)&&M(e[0])&&(e=e[0]),t.stopAnimationLoop(),t.destroyRenderer(),n.container=e,n.styleEnabled=!0,t.invalidateSize(),t.initRenderer(X({},r,r.renderer,{name:"null"===r.renderer.name?"canvas":r.renderer.name})),t.startAnimationLoop(),t.style(r.style),t.emit("mount"),t}},unmount:function(){var e=this;return e.stopAnimationLoop(),e.destroyRenderer(),e.initRenderer({name:"null"}),e.emit("unmount"),e},options:function(){return Pe(this._private.options)},json:function(e){var t=this,n=t._private,r=t.mutableElements();if(N(e)){if(t.startBatch(),e.elements){var i={},o=function(e,n){for(var r=[],o=[],a=0;a<e.length;a++){var s=e[a];if(s.data.id){var l=""+s.data.id,c=t.getElementById(l);i[l]=!0,0!==c.length?o.push({ele:c,json:s}):n?(s.group=n,r.push(s)):r.push(s)}else Se("cy.json() cannot handle elements without an ID attribute")}t.add(r);for(var u=0;u<o.length;u++){var d=o[u],h=d.ele,f=d.json;h.json(f)}};if(D(e.elements))o(e.elements);else for(var a=["nodes","edges"],s=0;s<a.length;s++){var l=a[s],c=e.elements[l];D(c)&&o(c,l)}var u=t.collection();r.filter((function(e){return!i[e.id()]})).forEach((function(e){e.isParent()?u.merge(e):e.remove()})),u.forEach((function(e){return e.children().move({parent:null})})),u.forEach((function(e){return function(e){return t.getElementById(e.id())}(e).remove()}))}e.style&&t.style(e.style),null!=e.zoom&&e.zoom!==n.zoom&&t.zoom(e.zoom),e.pan&&(e.pan.x===n.pan.x&&e.pan.y===n.pan.y||t.pan(e.pan)),e.data&&t.data(e.data);for(var d=["minZoom","maxZoom","zoomingEnabled","userZoomingEnabled","panningEnabled","userPanningEnabled","boxSelectionEnabled","autolock","autoungrabify","autounselectify","multiClickDebounceTime"],h=0;h<d.length;h++){var f=d[h];null!=e[f]&&t[f](e[f])}return t.endBatch(),this}var p={};!!e?p.elements=this.elements().map((function(e){return e.json()})):(p.elements={},r.forEach((function(e){var t=e.group();p.elements[t]||(p.elements[t]=[]),p.elements[t].push(e.json())}))),this._private.styleEnabled&&(p.style=t.style().json()),p.data=Pe(t.data());var v=n.options;return p.zoomingEnabled=n.zoomingEnabled,p.userZoomingEnabled=n.userZoomingEnabled,p.zoom=n.zoom,p.minZoom=n.minZoom,p.maxZoom=n.maxZoom,p.panningEnabled=n.panningEnabled,p.userPanningEnabled=n.userPanningEnabled,p.pan=Pe(n.pan),p.boxSelectionEnabled=n.boxSelectionEnabled,p.renderer=Pe(v.renderer),p.hideEdgesOnViewport=v.hideEdgesOnViewport,p.textureOnViewport=v.textureOnViewport,p.wheelSensitivity=v.wheelSensitivity,p.motionBlur=v.motionBlur,p.multiClickDebounceTime=v.multiClickDebounceTime,p}}),oa.$id=oa.getElementById,[_o,Ao,Lo,Bo,Fo,zo,Go,Ho,ta,na,ra].forEach((function(e){X(oa,e)}));var aa={fit:!0,directed:!1,padding:30,circle:!1,grid:!1,spacingFactor:1.75,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,roots:void 0,maximal:!1,depthSort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}},sa=function(e){return e.scratch("breadthfirst")},la=function(e,t){return e.scratch("breadthfirst",t)};function ca(e){this.options=X({},aa,e)}ca.prototype.run=function(){var e,t=this.options,n=t,r=t.cy,i=n.eles,o=i.nodes().filter((function(e){return!e.isParent()})),a=i,s=n.directed,l=n.maximal||n.maximalAdjustments>0,c=ht(n.boundingBox?n.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()});if(A(n.roots))e=n.roots;else if(D(n.roots)){for(var u=[],d=0;d<n.roots.length;d++){var h=n.roots[d],f=r.getElementById(h);u.push(f)}e=r.collection(u)}else if(C(n.roots))e=r.$(n.roots);else if(s)e=o.roots();else{var p=i.components();e=r.collection();for(var v=function(t){var n=p[t],r=n.maxDegree(!1),i=n.filter((function(e){return e.degree(!1)===r}));e=e.add(i)},g=0;g<p.length;g++)v(g)}var m=[],y={},b=function(e,t){null==m[t]&&(m[t]=[]);var n=m[t].length;m[t].push(e),la(e,{index:n,depth:t})};a.bfs({roots:e,directed:n.directed,visit:function(e,t,n,r,i){var o=e[0],a=o.id();b(o,i),y[a]=!0}});for(var x=[],w=0;w<o.length;w++){var E=o[w];y[E.id()]||x.push(E)}var _=function(e){for(var t=m[e],n=0;n<t.length;n++){var r=t[n];null!=r?la(r,{depth:e,index:n}):(t.splice(n,1),n--)}},k=function(){for(var e=0;e<m.length;e++)_(e)},S=function(e,t){for(var n=sa(e),r=e.incomers().filter((function(e){return e.isNode()&&i.has(e)})),o=-1,a=e.id(),s=0;s<r.length;s++){var l=r[s],c=sa(l);o=Math.max(o,c.depth)}return n.depth<=o&&(t[a]?null:(function(e,t){var n=sa(e),r=n.depth,i=n.index;m[r][i]=null,b(e,t)}(e,o+1),t[a]=!0,!0))};if(s&&l){var P=[],j={},T=function(e){return P.push(e)};for(o.forEach((function(e){return P.push(e)}));P.length>0;){var N=P.shift(),O=S(N,j);if(O)N.outgoers().filter((function(e){return e.isNode()&&i.has(e)})).forEach(T);else if(null===O){Se("Detected double maximal shift for node `"+N.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}k();var M=0;if(n.avoidOverlap)for(var R=0;R<o.length;R++){var I=o[R].layoutDimensions(n),L=I.w,B=I.h;M=Math.max(M,L,B)}var F={},z=function(e){if(F[e.id()])return F[e.id()];for(var t=sa(e).depth,n=e.neighborhood(),r=0,i=0,a=0;a<n.length;a++){var s=n[a];if(!s.isEdge()&&!s.isParent()&&o.has(s)){var l=sa(s);if(null!=l){var c=l.index,u=l.depth;if(null!=c&&null!=u){var d=m[u].length;u<t&&(r+=c/d,i++)}}}}return r/=i=Math.max(1,i),0===i&&(r=0),F[e.id()]=r,r},V=function(e,t){var n=z(e)-z(t);return 0===n?U(e.id(),t.id()):n};void 0!==n.depthSort&&(V=n.depthSort);for(var G=0;G<m.length;G++)m[G].sort(V),_(G);for(var H=[],W=0;W<x.length;W++)H.push(x[W]);m.unshift(H),k();for(var q=0,Y=0;Y<m.length;Y++)q=Math.max(m[Y].length,q);var X=c.x1+c.w/2,$=c.x1+c.h/2,K=m.reduce((function(e,t){return Math.max(e,t.length)}),0);return i.nodes().layoutPositions(this,n,(function(e){var t=sa(e),r=t.depth,i=t.index,o=m[r].length,a=Math.max(c.w/((n.grid?K:o)+1),M),s=Math.max(c.h/(m.length+1),M),l=Math.min(c.w/2/m.length,c.h/2/m.length);if(l=Math.max(l,M),n.circle){var u=l*r+l-(m.length>0&&m[0].length<=3?l/2:0),d=2*Math.PI/m[r].length*i;return 0===r&&1===m[0].length&&(u=1),{x:X+u*Math.cos(d),y:$+u*Math.sin(d)}}return{x:X+(i+1-(o+1)/2)*a,y:(r+1)*s}})),this};var ua={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,radius:void 0,startAngle:1.5*Math.PI,sweep:void 0,clockwise:!0,sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function da(e){this.options=X({},ua,e)}da.prototype.run=function(){var e=this.options,t=e,n=e.cy,r=t.eles,i=void 0!==t.counterclockwise?!t.counterclockwise:t.clockwise,o=r.nodes().not(":parent");t.sort&&(o=o.sort(t.sort));for(var a,s=ht(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()}),l=s.x1+s.w/2,c=s.y1+s.h/2,u=(void 0===t.sweep?2*Math.PI-2*Math.PI/o.length:t.sweep)/Math.max(1,o.length-1),d=0,h=0;h<o.length;h++){var f=o[h].layoutDimensions(t),p=f.w,v=f.h;d=Math.max(d,p,v)}if(a=O(t.radius)?t.radius:o.length<=1?0:Math.min(s.h,s.w)/2-d,o.length>1&&t.avoidOverlap){d*=1.75;var g=Math.cos(u)-Math.cos(0),m=Math.sin(u)-Math.sin(0),y=Math.sqrt(d*d/(g*g+m*m));a=Math.max(y,a)}return r.nodes().layoutPositions(this,t,(function(e,n){var r=t.startAngle+n*u*(i?1:-1),o=a*Math.cos(r),s=a*Math.sin(r);return{x:l+o,y:c+s}})),this};var ha,fa={fit:!0,padding:30,startAngle:1.5*Math.PI,sweep:void 0,clockwise:!0,equidistant:!1,minNodeSpacing:10,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,height:void 0,width:void 0,spacingFactor:void 0,concentric:function(e){return e.degree()},levelWidth:function(e){return e.maxDegree()/4},animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function pa(e){this.options=X({},fa,e)}pa.prototype.run=function(){for(var e=this.options,t=e,n=void 0!==t.counterclockwise?!t.counterclockwise:t.clockwise,r=e.cy,i=t.eles,o=i.nodes().not(":parent"),a=ht(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()}),s=a.x1+a.w/2,l=a.y1+a.h/2,c=[],u=0,d=0;d<o.length;d++){var h,f=o[d];h=t.concentric(f),c.push({value:h,node:f}),f._private.scratch.concentric=h}o.updateStyle();for(var p=0;p<o.length;p++){var v=o[p].layoutDimensions(t);u=Math.max(u,v.w,v.h)}c.sort((function(e,t){return t.value-e.value}));for(var g=t.levelWidth(o),m=[[]],y=m[0],b=0;b<c.length;b++){var x=c[b];if(y.length>0)Math.abs(y[0].value-x.value)>=g&&(y=[],m.push(y));y.push(x)}var w=u+t.minNodeSpacing;if(!t.avoidOverlap){var E=m.length>0&&m[0].length>1,_=(Math.min(a.w,a.h)/2-w)/(m.length+E?1:0);w=Math.min(w,_)}for(var k=0,S=0;S<m.length;S++){var P=m[S],j=void 0===t.sweep?2*Math.PI-2*Math.PI/P.length:t.sweep,C=P.dTheta=j/Math.max(1,P.length-1);if(P.length>1&&t.avoidOverlap){var T=Math.cos(C)-Math.cos(0),D=Math.sin(C)-Math.sin(0),N=Math.sqrt(w*w/(T*T+D*D));k=Math.max(N,k)}P.r=k,k+=w}if(t.equidistant){for(var O=0,M=0,A=0;A<m.length;A++){var R=m[A].r-M;O=Math.max(O,R)}M=0;for(var I=0;I<m.length;I++){var L=m[I];0===I&&(M=L.r),L.r=M,M+=O}}for(var B={},F=0;F<m.length;F++)for(var z=m[F],V=z.dTheta,G=z.r,H=0;H<z.length;H++){var W=z[H],q=t.startAngle+(n?1:-1)*V*H,Y={x:s+G*Math.cos(q),y:l+G*Math.sin(q)};B[W.node.id()]=Y}return i.nodes().layoutPositions(this,t,(function(e){var t=e.id();return B[t]})),this};var va={ready:function(){},stop:function(){},animate:!0,animationEasing:void 0,animationDuration:void 0,animateFilter:function(e,t){return!0},animationThreshold:250,refresh:20,fit:!0,padding:30,boundingBox:void 0,nodeDimensionsIncludeLabels:!1,randomize:!1,componentSpacing:40,nodeRepulsion:function(e){return 2048},nodeOverlap:4,idealEdgeLength:function(e){return 32},edgeElasticity:function(e){return 32},nestingFactor:1.2,gravity:1,numIter:1e3,initialTemp:1e3,coolingFactor:.99,minTemp:1};function ga(e){this.options=X({},va,e),this.options.layout=this}ga.prototype.run=function(){var e=this.options,t=e.cy,n=this;n.stopped=!1,!0!==e.animate&&!1!==e.animate||n.emit({type:"layoutstart",layout:n}),ha=!0===e.debug;var r=ma(t,n,e);ha&&undefined(r),e.randomize&&xa(r);var i=re(),o=function(){Ea(r,t,e),!0===e.fit&&t.fit(e.padding)},a=function(t){return!(n.stopped||t>=e.numIter)&&(_a(r,e),r.temperature=r.temperature*e.coolingFactor,!(r.temperature<e.minTemp))},s=function(){if(!0===e.animate||!1===e.animate)o(),n.one("layoutstop",e.stop),n.emit({type:"layoutstop",layout:n});else{var t=e.eles.nodes(),i=wa(r,e,t);t.layoutPositions(n,e,i)}},l=0,c=!0;if(!0===e.animate){!function t(){for(var n=0;c&&n<e.refresh;)c=a(l),l++,n++;c?(re()-i>=e.animationThreshold&&o(),ne(t)):(Ra(r,e),s())}()}else{for(;c;)c=a(l),l++;Ra(r,e),s()}return this},ga.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this},ga.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var ma=function(e,t,n){for(var r=n.eles.edges(),i=n.eles.nodes(),o={isCompound:e.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:i.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:r.size(),temperature:n.initialTemp,clientWidth:e.width(),clientHeight:e.width(),boundingBox:ht(n.boundingBox?n.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()})},a=n.eles.components(),s={},l=0;l<a.length;l++)for(var c=a[l],u=0;u<c.length;u++){s[c[u].id()]=l}for(l=0;l<o.nodeSize;l++){var d=(g=i[l]).layoutDimensions(n);(M={}).isLocked=g.locked(),M.id=g.data("id"),M.parentId=g.data("parent"),M.cmptId=s[g.id()],M.children=[],M.positionX=g.position("x"),M.positionY=g.position("y"),M.offsetX=0,M.offsetY=0,M.height=d.w,M.width=d.h,M.maxX=M.positionX+M.width/2,M.minX=M.positionX-M.width/2,M.maxY=M.positionY+M.height/2,M.minY=M.positionY-M.height/2,M.padLeft=parseFloat(g.style("padding")),M.padRight=parseFloat(g.style("padding")),M.padTop=parseFloat(g.style("padding")),M.padBottom=parseFloat(g.style("padding")),M.nodeRepulsion=T(n.nodeRepulsion)?n.nodeRepulsion(g):n.nodeRepulsion,o.layoutNodes.push(M),o.idToIndex[M.id]=l}var h=[],f=0,p=-1,v=[];for(l=0;l<o.nodeSize;l++){var g,m=(g=o.layoutNodes[l]).parentId;null!=m?o.layoutNodes[o.idToIndex[m]].children.push(g.id):(h[++p]=g.id,v.push(g.id))}for(o.graphSet.push(v);f<=p;){var y=h[f++],b=o.idToIndex[y],x=o.layoutNodes[b].children;if(x.length>0){o.graphSet.push(x);for(l=0;l<x.length;l++)h[++p]=x[l]}}for(l=0;l<o.graphSet.length;l++){var w=o.graphSet[l];for(u=0;u<w.length;u++){var E=o.idToIndex[w[u]];o.indexToGraph[E]=l}}for(l=0;l<o.edgeSize;l++){var _=r[l],k={};k.id=_.data("id"),k.sourceId=_.data("source"),k.targetId=_.data("target");var S=T(n.idealEdgeLength)?n.idealEdgeLength(_):n.idealEdgeLength,P=T(n.edgeElasticity)?n.edgeElasticity(_):n.edgeElasticity,j=o.idToIndex[k.sourceId],C=o.idToIndex[k.targetId];if(o.indexToGraph[j]!=o.indexToGraph[C]){for(var D=ya(k.sourceId,k.targetId,o),N=o.graphSet[D],O=0,M=o.layoutNodes[j];-1===N.indexOf(M.id);)M=o.layoutNodes[o.idToIndex[M.parentId]],O++;for(M=o.layoutNodes[C];-1===N.indexOf(M.id);)M=o.layoutNodes[o.idToIndex[M.parentId]],O++;S*=O*n.nestingFactor}k.idealLength=S,k.elasticity=P,o.layoutEdges.push(k)}return o},ya=function(e,t,n){var r=ba(e,t,0,n);return 2>r.count?0:r.graph},ba=function e(t,n,r,i){var o=i.graphSet[r];if(-1<o.indexOf(t)&&-1<o.indexOf(n))return{count:2,graph:r};for(var a=0,s=0;s<o.length;s++){var l=o[s],c=i.idToIndex[l],u=i.layoutNodes[c].children;if(0!==u.length){var d=e(t,n,i.indexToGraph[i.idToIndex[u[0]]],i);if(0!==d.count){if(1!==d.count)return d;if(2===++a)break}}}return{count:a,graph:r}},xa=function(e,t){for(var n=e.clientWidth,r=e.clientHeight,i=0;i<e.nodeSize;i++){var o=e.layoutNodes[i];0!==o.children.length||o.isLocked||(o.positionX=Math.random()*n,o.positionY=Math.random()*r)}},wa=function(e,t,n){var r=e.boundingBox,i={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0};return t.boundingBox&&(n.forEach((function(t){var n=e.layoutNodes[e.idToIndex[t.data("id")]];i.x1=Math.min(i.x1,n.positionX),i.x2=Math.max(i.x2,n.positionX),i.y1=Math.min(i.y1,n.positionY),i.y2=Math.max(i.y2,n.positionY)})),i.w=i.x2-i.x1,i.h=i.y2-i.y1),function(n,o){var a=e.layoutNodes[e.idToIndex[n.data("id")]];if(t.boundingBox){var s=(a.positionX-i.x1)/i.w,l=(a.positionY-i.y1)/i.h;return{x:r.x1+s*r.w,y:r.y1+l*r.h}}return{x:a.positionX,y:a.positionY}}},Ea=function(e,t,n){var r=n.layout,i=n.eles.nodes(),o=wa(e,n,i);i.positions(o),!0!==e.ready&&(e.ready=!0,r.one("layoutready",n.ready),r.emit({type:"layoutready",layout:this}))},_a=function(e,t,n){ka(e,t),Ta(e),Da(e,t),Na(e),Oa(e)},ka=function(e,t){for(var n=0;n<e.graphSet.length;n++)for(var r=e.graphSet[n],i=r.length,o=0;o<i;o++)for(var a=e.layoutNodes[e.idToIndex[r[o]]],s=o+1;s<i;s++){var l=e.layoutNodes[e.idToIndex[r[s]]];Pa(a,l,e,t)}},Sa=function(e){return-e+2*e*Math.random()},Pa=function(e,t,n,r){if(e.cmptId===t.cmptId||n.isCompound){var i=t.positionX-e.positionX,o=t.positionY-e.positionY;0===i&&0===o&&(i=Sa(1),o=Sa(1));var a=ja(e,t,i,o);if(a>0)var s=(c=r.nodeOverlap*a)*i/(v=Math.sqrt(i*i+o*o)),l=c*o/v;else{var c,u=Ca(e,i,o),d=Ca(t,-1*i,-1*o),h=d.x-u.x,f=d.y-u.y,p=h*h+f*f,v=Math.sqrt(p);s=(c=(e.nodeRepulsion+t.nodeRepulsion)/p)*h/v,l=c*f/v}e.isLocked||(e.offsetX-=s,e.offsetY-=l),t.isLocked||(t.offsetX+=s,t.offsetY+=l)}},ja=function(e,t,n,r){if(n>0)var i=e.maxX-t.minX;else i=t.maxX-e.minX;if(r>0)var o=e.maxY-t.minY;else o=t.maxY-e.minY;return i>=0&&o>=0?Math.sqrt(i*i+o*o):0},Ca=function(e,t,n){var r=e.positionX,i=e.positionY,o=e.height||1,a=e.width||1,s=n/t,l=o/a,c={};return 0===t&&0<n||0===t&&0>n?(c.x=r,c.y=i+o/2,c):0<t&&-1*l<=s&&s<=l?(c.x=r+a/2,c.y=i+a*n/2/t,c):0>t&&-1*l<=s&&s<=l?(c.x=r-a/2,c.y=i-a*n/2/t,c):0<n&&(s<=-1*l||s>=l)?(c.x=r+o*t/2/n,c.y=i+o/2,c):0>n&&(s<=-1*l||s>=l)?(c.x=r-o*t/2/n,c.y=i-o/2,c):c},Ta=function(e,t){for(var n=0;n<e.edgeSize;n++){var r=e.layoutEdges[n],i=e.idToIndex[r.sourceId],o=e.layoutNodes[i],a=e.idToIndex[r.targetId],s=e.layoutNodes[a],l=s.positionX-o.positionX,c=s.positionY-o.positionY;if(0!==l||0!==c){var u=Ca(o,l,c),d=Ca(s,-1*l,-1*c),h=d.x-u.x,f=d.y-u.y,p=Math.sqrt(h*h+f*f),v=Math.pow(r.idealLength-p,2)/r.elasticity;if(0!==p)var g=v*h/p,m=v*f/p;else g=0,m=0;o.isLocked||(o.offsetX+=g,o.offsetY+=m),s.isLocked||(s.offsetX-=g,s.offsetY-=m)}}},Da=function(e,t){if(0!==t.gravity)for(var n=0;n<e.graphSet.length;n++){var r=e.graphSet[n],i=r.length;if(0===n)var o=e.clientHeight/2,a=e.clientWidth/2;else{var s=e.layoutNodes[e.idToIndex[r[0]]],l=e.layoutNodes[e.idToIndex[s.parentId]];o=l.positionX,a=l.positionY}for(var c=0;c<i;c++){var u=e.layoutNodes[e.idToIndex[r[c]]];if(!u.isLocked){var d=o-u.positionX,h=a-u.positionY,f=Math.sqrt(d*d+h*h);if(f>1){var p=t.gravity*d/f,v=t.gravity*h/f;u.offsetX+=p,u.offsetY+=v}}}}},Na=function(e,t){var n=[],r=0,i=-1;for(n.push.apply(n,e.graphSet[0]),i+=e.graphSet[0].length;r<=i;){var o=n[r++],a=e.idToIndex[o],s=e.layoutNodes[a],l=s.children;if(0<l.length&&!s.isLocked){for(var c=s.offsetX,u=s.offsetY,d=0;d<l.length;d++){var h=e.layoutNodes[e.idToIndex[l[d]]];h.offsetX+=c,h.offsetY+=u,n[++i]=l[d]}s.offsetX=0,s.offsetY=0}}},Oa=function(e,t){for(var n=0;n<e.nodeSize;n++){0<(i=e.layoutNodes[n]).children.length&&(i.maxX=void 0,i.minX=void 0,i.maxY=void 0,i.minY=void 0)}for(n=0;n<e.nodeSize;n++){if(!(0<(i=e.layoutNodes[n]).children.length||i.isLocked)){var r=Ma(i.offsetX,i.offsetY,e.temperature);i.positionX+=r.x,i.positionY+=r.y,i.offsetX=0,i.offsetY=0,i.minX=i.positionX-i.width,i.maxX=i.positionX+i.width,i.minY=i.positionY-i.height,i.maxY=i.positionY+i.height,Aa(i,e)}}for(n=0;n<e.nodeSize;n++){var i;0<(i=e.layoutNodes[n]).children.length&&!i.isLocked&&(i.positionX=(i.maxX+i.minX)/2,i.positionY=(i.maxY+i.minY)/2,i.width=i.maxX-i.minX,i.height=i.maxY-i.minY)}},Ma=function(e,t,n){var r=Math.sqrt(e*e+t*t);if(r>n)var i={x:n*e/r,y:n*t/r};else i={x:e,y:t};return i},Aa=function e(t,n){var r=t.parentId;if(null!=r){var i=n.layoutNodes[n.idToIndex[r]],o=!1;return(null==i.maxX||t.maxX+i.padRight>i.maxX)&&(i.maxX=t.maxX+i.padRight,o=!0),(null==i.minX||t.minX-i.padLeft<i.minX)&&(i.minX=t.minX-i.padLeft,o=!0),(null==i.maxY||t.maxY+i.padBottom>i.maxY)&&(i.maxY=t.maxY+i.padBottom,o=!0),(null==i.minY||t.minY-i.padTop<i.minY)&&(i.minY=t.minY-i.padTop,o=!0),o?e(i,n):void 0}},Ra=function(e,t){for(var n=e.layoutNodes,r=[],i=0;i<n.length;i++){var o=n[i],a=o.cmptId;(r[a]=r[a]||[]).push(o)}var s=0;for(i=0;i<r.length;i++){if(v=r[i]){v.x1=1/0,v.x2=-1/0,v.y1=1/0,v.y2=-1/0;for(var l=0;l<v.length;l++){var c=v[l];v.x1=Math.min(v.x1,c.positionX-c.width/2),v.x2=Math.max(v.x2,c.positionX+c.width/2),v.y1=Math.min(v.y1,c.positionY-c.height/2),v.y2=Math.max(v.y2,c.positionY+c.height/2)}v.w=v.x2-v.x1,v.h=v.y2-v.y1,s+=v.w*v.h}}r.sort((function(e,t){return t.w*t.h-e.w*e.h}));var u=0,d=0,h=0,f=0,p=Math.sqrt(s)*e.clientWidth/e.clientHeight;for(i=0;i<r.length;i++){var v;if(v=r[i]){for(l=0;l<v.length;l++){(c=v[l]).isLocked||(c.positionX+=u-v.x1,c.positionY+=d-v.y1)}u+=v.w+t.componentSpacing,h+=v.w+t.componentSpacing,f=Math.max(f,v.h),h>p&&(d+=f+t.componentSpacing,u=0,h=0,f=0)}}},Ia={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,avoidOverlapPadding:10,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,condense:!1,rows:void 0,cols:void 0,position:function(e){},sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function La(e){this.options=X({},Ia,e)}La.prototype.run=function(){var e=this.options,t=e,n=e.cy,r=t.eles,i=r.nodes().not(":parent");t.sort&&(i=i.sort(t.sort));var o=ht(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()});if(0===o.h||0===o.w)r.nodes().layoutPositions(this,t,(function(e){return{x:o.x1,y:o.y1}}));else{var a=i.size(),s=Math.sqrt(a*o.h/o.w),l=Math.round(s),c=Math.round(o.w/o.h*s),u=function(e){if(null==e)return Math.min(l,c);Math.min(l,c)==l?l=e:c=e},d=function(e){if(null==e)return Math.max(l,c);Math.max(l,c)==l?l=e:c=e},h=t.rows,f=null!=t.cols?t.cols:t.columns;if(null!=h&&null!=f)l=h,c=f;else if(null!=h&&null==f)l=h,c=Math.ceil(a/l);else if(null==h&&null!=f)c=f,l=Math.ceil(a/c);else if(c*l>a){var p=u(),v=d();(p-1)*v>=a?u(p-1):(v-1)*p>=a&&d(v-1)}else for(;c*l<a;){var g=u(),m=d();(m+1)*g>=a?d(m+1):u(g+1)}var y=o.w/c,b=o.h/l;if(t.condense&&(y=0,b=0),t.avoidOverlap)for(var x=0;x<i.length;x++){var w=i[x],E=w._private.position;null!=E.x&&null!=E.y||(E.x=0,E.y=0);var _=w.layoutDimensions(t),k=t.avoidOverlapPadding,S=_.w+k,P=_.h+k;y=Math.max(y,S),b=Math.max(b,P)}for(var j={},C=function(e,t){return!!j["c-"+e+"-"+t]},T=function(e,t){j["c-"+e+"-"+t]=!0},D=0,N=0,O=function(){++N>=c&&(N=0,D++)},M={},A=0;A<i.length;A++){var R=i[A],I=t.position(R);if(I&&(void 0!==I.row||void 0!==I.col)){var L={row:I.row,col:I.col};if(void 0===L.col)for(L.col=0;C(L.row,L.col);)L.col++;else if(void 0===L.row)for(L.row=0;C(L.row,L.col);)L.row++;M[R.id()]=L,T(L.row,L.col)}}i.layoutPositions(this,t,(function(e,t){var n,r;if(e.locked()||e.isParent())return!1;var i=M[e.id()];if(i)n=i.col*y+y/2+o.x1,r=i.row*b+b/2+o.y1;else{for(;C(D,N);)O();n=N*y+y/2+o.x1,r=D*b+b/2+o.y1,T(D,N),O()}return{x:n,y:r}}))}return this};var Ba={ready:function(){},stop:function(){}};function Fa(e){this.options=X({},Ba,e)}Fa.prototype.run=function(){var e=this.options,t=e.eles,n=this;return e.cy,n.emit("layoutstart"),t.nodes().positions((function(){return{x:0,y:0}})),n.one("layoutready",e.ready),n.emit("layoutready"),n.one("layoutstop",e.stop),n.emit("layoutstop"),this},Fa.prototype.stop=function(){return this};var za={positions:void 0,zoom:void 0,pan:void 0,fit:!0,padding:30,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function Va(e){this.options=X({},za,e)}Va.prototype.run=function(){var e=this.options,t=e.eles.nodes(),n=T(e.positions);return t.layoutPositions(this,e,(function(t,r){var i=function(t){if(null==e.positions)return function(e){return{x:e.x,y:e.y}}(t.position());if(n)return e.positions(t);var r=e.positions[t._private.data.id];return null==r?null:r}(t);return!t.locked()&&null!=i&&i})),this};var Ga={fit:!0,padding:30,boundingBox:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function Ha(e){this.options=X({},Ga,e)}Ha.prototype.run=function(){var e=this.options,t=e.cy,n=e.eles,r=ht(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:t.width(),h:t.height()});return n.nodes().layoutPositions(this,e,(function(e,t){return{x:r.x1+Math.round(Math.random()*r.w),y:r.y1+Math.round(Math.random()*r.h)}})),this};var Wa=[{name:"breadthfirst",impl:ca},{name:"circle",impl:da},{name:"concentric",impl:pa},{name:"cose",impl:ga},{name:"grid",impl:La},{name:"null",impl:Fa},{name:"preset",impl:Va},{name:"random",impl:Ha}];function qa(e){this.options=e,this.notifications=0}var Ya=function(){},Ua=function(){throw new Error("A headless instance can not render images")};qa.prototype={recalculateRenderedStyle:Ya,notify:function(){this.notifications++},init:Ya,isHeadless:function(){return!0},png:Ua,jpg:Ua};var Xa={arrowShapeWidth:.3,registerArrowShapes:function(){var e=this.arrowShapes={},t=this,n=function(e,t,n,r,i,o,a){var s=i.x-n/2-a,l=i.x+n/2+a,c=i.y-n/2-a,u=i.y+n/2+a;return s<=e&&e<=l&&c<=t&&t<=u},r=function(e,t,n,r,i){var o=e*Math.cos(r)-t*Math.sin(r),a=(e*Math.sin(r)+t*Math.cos(r))*n;return{x:o*n+i.x,y:a+i.y}},i=function(e,t,n,i){for(var o=[],a=0;a<e.length;a+=2){var s=e[a],l=e[a+1];o.push(r(s,l,t,n,i))}return o},o=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];t.push(r.x,r.y)}return t},a=function(e){return e.pstyle("width").pfValue*e.pstyle("arrow-scale").pfValue*2},s=function(r,s){C(s)&&(s=e[s]),e[r]=X({name:r,points:[-.15,-.3,.15,-.3,.15,.3,-.15,.3],collide:function(e,t,n,r,a,s){var l=o(i(this.points,n+2*s,r,a));return St(e,t,l)},roughCollide:n,draw:function(e,n,r,o){var a=i(this.points,n,r,o);t.arrowShapeImpl("polygon")(e,a)},spacing:function(e){return 0},gap:a},s)};s("none",{collide:xe,roughCollide:xe,draw:Ee,spacing:we,gap:we}),s("triangle",{points:[-.15,-.3,0,0,.15,-.3]}),s("arrow","triangle"),s("triangle-backcurve",{points:e.triangle.points,controlPoint:[0,-.15],roughCollide:n,draw:function(e,n,o,a,s){var l=i(this.points,n,o,a),c=this.controlPoint,u=r(c[0],c[1],n,o,a);t.arrowShapeImpl(this.name)(e,l,u)},gap:function(e){return.8*a(e)}}),s("triangle-tee",{points:[0,0,.15,-.3,-.15,-.3,0,0],pointsTee:[-.15,-.4,-.15,-.5,.15,-.5,.15,-.4],collide:function(e,t,n,r,a,s,l){var c=o(i(this.points,n+2*l,r,a)),u=o(i(this.pointsTee,n+2*l,r,a));return St(e,t,c)||St(e,t,u)},draw:function(e,n,r,o,a){var s=i(this.points,n,r,o),l=i(this.pointsTee,n,r,o);t.arrowShapeImpl(this.name)(e,s,l)}}),s("circle-triangle",{radius:.15,pointsTr:[0,-.15,.15,-.45,-.15,-.45,0,-.15],collide:function(e,t,n,r,a,s,l){var c=a,u=Math.pow(c.x-e,2)+Math.pow(c.y-t,2)<=Math.pow((n+2*l)*this.radius,2),d=o(i(this.points,n+2*l,r,a));return St(e,t,d)||u},draw:function(e,n,r,o,a){var s=i(this.pointsTr,n,r,o);t.arrowShapeImpl(this.name)(e,s,o.x,o.y,this.radius*n)},spacing:function(e){return t.getArrowWidth(e.pstyle("width").pfValue,e.pstyle("arrow-scale").value)*this.radius}}),s("triangle-cross",{points:[0,0,.15,-.3,-.15,-.3,0,0],baseCrossLinePts:[-.15,-.4,-.15,-.4,.15,-.4,.15,-.4],crossLinePts:function(e,t){var n=this.baseCrossLinePts.slice(),r=t/e;return n[3]=n[3]-r,n[5]=n[5]-r,n},collide:function(e,t,n,r,a,s,l){var c=o(i(this.points,n+2*l,r,a)),u=o(i(this.crossLinePts(n,s),n+2*l,r,a));return St(e,t,c)||St(e,t,u)},draw:function(e,n,r,o,a){var s=i(this.points,n,r,o),l=i(this.crossLinePts(n,a),n,r,o);t.arrowShapeImpl(this.name)(e,s,l)}}),s("vee",{points:[-.15,-.3,0,0,.15,-.3,0,-.15],gap:function(e){return.525*a(e)}}),s("circle",{radius:.15,collide:function(e,t,n,r,i,o,a){var s=i;return Math.pow(s.x-e,2)+Math.pow(s.y-t,2)<=Math.pow((n+2*a)*this.radius,2)},draw:function(e,n,r,i,o){t.arrowShapeImpl(this.name)(e,i.x,i.y,this.radius*n)},spacing:function(e){return t.getArrowWidth(e.pstyle("width").pfValue,e.pstyle("arrow-scale").value)*this.radius}}),s("tee",{points:[-.15,0,-.15,-.1,.15,-.1,.15,0],spacing:function(e){return 1},gap:function(e){return 1}}),s("square",{points:[-.15,0,.15,0,.15,-.3,-.15,-.3]}),s("diamond",{points:[-.15,-.15,0,-.3,.15,-.15,0,0],gap:function(e){return e.pstyle("width").pfValue*e.pstyle("arrow-scale").value}}),s("chevron",{points:[0,0,-.15,-.15,-.1,-.2,0,-.1,.1,-.2,.15,-.15],gap:function(e){return.95*e.pstyle("width").pfValue*e.pstyle("arrow-scale").value}})}},$a={projectIntoViewport:function(e,t){var n=this.cy,r=this.findContainerClientCoords(),i=r[0],o=r[1],a=r[4],s=n.pan(),l=n.zoom();return[((e-i)/a-s.x)/l,((t-o)/a-s.y)/l]},findContainerClientCoords:function(){if(this.containerBB)return this.containerBB;var e=this.container,t=e.getBoundingClientRect(),n=w.getComputedStyle(e),r=function(e){return parseFloat(n.getPropertyValue(e))},i=r("padding-left"),o=r("padding-right"),a=r("padding-top"),s=r("padding-bottom"),l=r("border-left-width"),c=r("border-right-width"),u=r("border-top-width"),d=(r("border-bottom-width"),e.clientWidth),h=e.clientHeight,f=i+o,p=a+s,v=l+c,g=t.width/(d+v),m=d-f,y=h-p,b=t.left+i+l,x=t.top+a+u;return this.containerBB=[b,x,m,y,g]},invalidateContainerClientCoordsCache:function(){this.containerBB=null},findNearestElement:function(e,t,n,r){return this.findNearestElements(e,t,n,r)[0]},findNearestElements:function(e,t,n,r){var i,o,a=this,s=this,l=s.getCachedZSortedEles(),c=[],u=s.cy.zoom(),d=s.cy.hasCompoundNodes(),h=(r?24:8)/u,f=(r?8:2)/u,p=(r?8:2)/u,v=1/0;function g(e,t){if(e.isNode()){if(o)return;o=e,c.push(e)}if(e.isEdge()&&(null==t||t<v))if(i){if(i.pstyle("z-compound-depth").value===e.pstyle("z-compound-depth").value&&i.pstyle("z-compound-depth").value===e.pstyle("z-compound-depth").value)for(var n=0;n<c.length;n++)if(c[n].isEdge()){c[n]=e,i=e,v=null!=t?t:v;break}}else c.push(e),i=e,v=null!=t?t:v}function m(n){var r=n.outerWidth()+2*f,i=n.outerHeight()+2*f,o=r/2,l=i/2,c=n.position();if(c.x-o<=e&&e<=c.x+o&&c.y-l<=t&&t<=c.y+l&&s.nodeShapes[a.getNodeShape(n)].checkPoint(e,t,0,r,i,c.x,c.y))return g(n,0),!0}function y(n){var r,i=n._private,o=i.rscratch,l=n.pstyle("width").pfValue,u=n.pstyle("arrow-scale").value,f=l/2+h,p=f*f,v=2*f,y=i.source,b=i.target;if("segments"===o.edgeType||"straight"===o.edgeType||"haystack"===o.edgeType){for(var x=o.allpts,w=0;w+3<x.length;w+=2)if(wt(e,t,x[w],x[w+1],x[w+2],x[w+3],v)&&p>(r=kt(e,t,x[w],x[w+1],x[w+2],x[w+3])))return g(n,r),!0}else if("bezier"===o.edgeType||"multibezier"===o.edgeType||"self"===o.edgeType||"compound"===o.edgeType)for(x=o.allpts,w=0;w+5<o.allpts.length;w+=4)if(Et(e,t,x[w],x[w+1],x[w+2],x[w+3],x[w+4],x[w+5],v)&&p>(r=_t(e,t,x[w],x[w+1],x[w+2],x[w+3],x[w+4],x[w+5])))return g(n,r),!0;y=y||i.source,b=b||i.target;var E=a.getArrowWidth(l,u),_=[{name:"source",x:o.arrowStartX,y:o.arrowStartY,angle:o.srcArrowAngle},{name:"target",x:o.arrowEndX,y:o.arrowEndY,angle:o.tgtArrowAngle},{name:"mid-source",x:o.midX,y:o.midY,angle:o.midsrcArrowAngle},{name:"mid-target",x:o.midX,y:o.midY,angle:o.midtgtArrowAngle}];for(w=0;w<_.length;w++){var k=_[w],S=s.arrowShapes[n.pstyle(k.name+"-arrow-shape").value],P=n.pstyle("width").pfValue;if(S.roughCollide(e,t,E,k.angle,{x:k.x,y:k.y},P,h)&&S.collide(e,t,E,k.angle,{x:k.x,y:k.y},P,h))return g(n),!0}d&&c.length>0&&(m(y),m(b))}function b(e,t,n){return Me(e,t,n)}function x(n,r){var i,o=n._private,a=p;i=r?r+"-":"",n.boundingBox();var s=o.labelBounds[r||"main"],l=n.pstyle(i+"label").value;if("yes"===n.pstyle("text-events").strValue&&l){var c=b(o.rscratch,"labelX",r),u=b(o.rscratch,"labelY",r),d=b(o.rscratch,"labelAngle",r),h=n.pstyle(i+"text-margin-x").pfValue,f=n.pstyle(i+"text-margin-y").pfValue,v=s.x1-a-h,m=s.x2+a-h,y=s.y1-a-f,x=s.y2+a-f;if(d){var w=Math.cos(d),E=Math.sin(d),_=function(e,t){return{x:(e-=c)*w-(t-=u)*E+c,y:e*E+t*w+u}},k=_(v,y),S=_(v,x),P=_(m,y),j=_(m,x),C=[k.x+h,k.y+f,P.x+h,P.y+f,j.x+h,j.y+f,S.x+h,S.y+f];if(St(e,t,C))return g(n),!0}else if(yt(s,e,t))return g(n),!0}}n&&(l=l.interactive);for(var w=l.length-1;w>=0;w--){var E=l[w];E.isNode()?m(E)||x(E):y(E)||x(E)||x(E,"source")||x(E,"target")}return c},getAllInBox:function(e,t,n,r){for(var i,o,a=this.getCachedZSortedEles().interactive,s=[],l=Math.min(e,n),c=Math.max(e,n),u=Math.min(t,r),d=Math.max(t,r),h=ht({x1:e=l,y1:t=u,x2:n=c,y2:r=d}),f=0;f<a.length;f++){var p=a[f];if(p.isNode()){var v=p,g=v.boundingBox({includeNodes:!0,includeEdges:!1,includeLabels:!1});mt(h,g)&&!bt(g,h)&&s.push(v)}else{var m=p,y=m._private,b=y.rscratch;if(null!=b.startX&&null!=b.startY&&!yt(h,b.startX,b.startY))continue;if(null!=b.endX&&null!=b.endY&&!yt(h,b.endX,b.endY))continue;if("bezier"===b.edgeType||"multibezier"===b.edgeType||"self"===b.edgeType||"compound"===b.edgeType||"segments"===b.edgeType||"haystack"===b.edgeType){for(var x=y.rstyle.bezierPts||y.rstyle.linePts||y.rstyle.haystackPts,w=!0,E=0;E<x.length;E++)if(i=h,o=x[E],!yt(i,o.x,o.y)){w=!1;break}w&&s.push(m)}else"haystack"!==b.edgeType&&"straight"!==b.edgeType||s.push(m)}}return s}},Ka={calculateArrowAngles:function(e){var t,n,r,i,o,a,s=e._private.rscratch,l="haystack"===s.edgeType,c="bezier"===s.edgeType,u="multibezier"===s.edgeType,d="segments"===s.edgeType,h="compound"===s.edgeType,f="self"===s.edgeType;if(l?(r=s.haystackPts[0],i=s.haystackPts[1],o=s.haystackPts[2],a=s.haystackPts[3]):(r=s.arrowStartX,i=s.arrowStartY,o=s.arrowEndX,a=s.arrowEndY),v=s.midX,g=s.midY,d)t=r-s.segpts[0],n=i-s.segpts[1];else if(u||h||f||c){var p=s.allpts;t=r-ct(p[0],p[2],p[4],.1),n=i-ct(p[1],p[3],p[5],.1)}else t=r-v,n=i-g;s.srcArrowAngle=rt(t,n);var v=s.midX,g=s.midY;if(l&&(v=(r+o)/2,g=(i+a)/2),t=o-r,n=a-i,d)if((p=s.allpts).length/2%2==0){var m=(y=p.length/2)-2;t=p[y]-p[m],n=p[y+1]-p[m+1]}else{m=(y=p.length/2-1)-2;var y,b=y+2;t=p[y]-p[m],n=p[y+1]-p[m+1]}else if(u||h||f){var x,w,E,_,p=s.allpts;if(s.ctrlpts.length/2%2==0){var k=(S=(P=p.length/2-1)+2)+2;x=ct(p[P],p[S],p[k],0),w=ct(p[P+1],p[S+1],p[k+1],0),E=ct(p[P],p[S],p[k],1e-4),_=ct(p[P+1],p[S+1],p[k+1],1e-4)}else{var S,P;k=(S=p.length/2-1)+2;x=ct(p[P=S-2],p[S],p[k],.4999),w=ct(p[P+1],p[S+1],p[k+1],.4999),E=ct(p[P],p[S],p[k],.5),_=ct(p[P+1],p[S+1],p[k+1],.5)}t=E-x,n=_-w}(s.midtgtArrowAngle=rt(t,n),s.midDispX=t,s.midDispY=n,t*=-1,n*=-1,d)&&((p=s.allpts).length/2%2==0||(t=-(p[b=(y=p.length/2-1)+2]-p[y]),n=-(p[b+1]-p[y+1])));if(s.midsrcArrowAngle=rt(t,n),d)t=o-s.segpts[s.segpts.length-2],n=a-s.segpts[s.segpts.length-1];else if(u||h||f||c){var j=(p=s.allpts).length;t=o-ct(p[j-6],p[j-4],p[j-2],.9),n=a-ct(p[j-5],p[j-3],p[j-1],.9)}else t=o-v,n=a-g;s.tgtArrowAngle=rt(t,n)}};Ka.getArrowWidth=Ka.getArrowHeight=function(e,t){var n=this.arrowWidthCache=this.arrowWidthCache||{},r=n[e+", "+t];return r||(r=Math.max(Math.pow(13.37*e,.9),29)*t,n[e+", "+t]=r,r)};var Za={};function Qa(e){var t=[];if(null!=e){for(var n=0;n<e.length;n+=2){var r=e[n],i=e[n+1];t.push({x:r,y:i})}return t}}Za.findHaystackPoints=function(e){for(var t=0;t<e.length;t++){var n=e[t],r=n._private,i=r.rscratch;if(!i.haystack){var o=2*Math.random()*Math.PI;i.source={x:Math.cos(o),y:Math.sin(o)},o=2*Math.random()*Math.PI,i.target={x:Math.cos(o),y:Math.sin(o)}}var a=r.source,s=r.target,l=a.position(),c=s.position(),u=a.width(),d=s.width(),h=a.height(),f=s.height(),p=n.pstyle("haystack-radius").value/2;i.haystackPts=i.allpts=[i.source.x*u*p+l.x,i.source.y*h*p+l.y,i.target.x*d*p+c.x,i.target.y*f*p+c.y],i.midX=(i.allpts[0]+i.allpts[2])/2,i.midY=(i.allpts[1]+i.allpts[3])/2,i.edgeType="haystack",i.haystack=!0,this.storeEdgeProjections(n),this.calculateArrowAngles(n),this.recalculateEdgeLabelProjections(n),this.calculateLabelAngles(n)}},Za.findSegmentsPoints=function(e,t){var n=e._private.rscratch,r=t.posPts,i=t.intersectionPts,o=t.vectorNormInverse,a=e.pstyle("edge-distances").value,s=e.pstyle("segment-weights"),l=e.pstyle("segment-distances"),c=Math.min(s.pfValue.length,l.pfValue.length);n.edgeType="segments",n.segpts=[];for(var u=0;u<c;u++){var d=s.pfValue[u],h=l.pfValue[u],f=1-d,p=d,v="node-position"===a?r:i,g={x:v.x1*f+v.x2*p,y:v.y1*f+v.y2*p};n.segpts.push(g.x+o.x*h,g.y+o.y*h)}},Za.findLoopPoints=function(e,t,n,r){var i=e._private.rscratch,o=t.dirCounts,a=t.srcPos,s=e.pstyle("control-point-distances"),l=s?s.pfValue[0]:void 0,c=e.pstyle("loop-direction").pfValue,u=e.pstyle("loop-sweep").pfValue,d=e.pstyle("control-point-step-size").pfValue;i.edgeType="self";var h=n,f=d;r&&(h=0,f=l);var p=c-Math.PI/2,v=p-u/2,g=p+u/2,m=String(c+"_"+u);h=void 0===o[m]?o[m]=0:++o[m],i.ctrlpts=[a.x+1.4*Math.cos(v)*f*(h/3+1),a.y+1.4*Math.sin(v)*f*(h/3+1),a.x+1.4*Math.cos(g)*f*(h/3+1),a.y+1.4*Math.sin(g)*f*(h/3+1)]},Za.findCompoundLoopPoints=function(e,t,n,r){var i=e._private.rscratch;i.edgeType="compound";var o=t.srcPos,a=t.tgtPos,s=t.srcW,l=t.srcH,c=t.tgtW,u=t.tgtH,d=e.pstyle("control-point-step-size").pfValue,h=e.pstyle("control-point-distances"),f=h?h.pfValue[0]:void 0,p=n,v=d;r&&(p=0,v=f);var g={x:o.x-s/2,y:o.y-l/2},m={x:a.x-c/2,y:a.y-u/2},y={x:Math.min(g.x,m.x),y:Math.min(g.y,m.y)},b=Math.max(.5,Math.log(.01*s)),x=Math.max(.5,Math.log(.01*c));i.ctrlpts=[y.x,y.y-(1+Math.pow(50,1.12)/100)*v*(p/3+1)*b,y.x-(1+Math.pow(50,1.12)/100)*v*(p/3+1)*x,y.y]},Za.findStraightEdgePoints=function(e){e._private.rscratch.edgeType="straight"},Za.findBezierPoints=function(e,t,n,r,i){var o=e._private.rscratch,a=t.vectorNormInverse,s=t.posPts,l=t.intersectionPts,c=e.pstyle("edge-distances").value,u=e.pstyle("control-point-step-size").pfValue,d=e.pstyle("control-point-distances"),h=e.pstyle("control-point-weights"),f=d&&h?Math.min(d.value.length,h.value.length):1,p=d?d.pfValue[0]:void 0,v=h.value[0],g=r;o.edgeType=g?"multibezier":"bezier",o.ctrlpts=[];for(var m=0;m<f;m++){var y=(.5-t.eles.length/2+n)*u*(i?-1:1),b=void 0,x=ot(y);g&&(p=d?d.pfValue[m]:u,v=h.value[m]);var w=void 0!==(b=r?p:void 0!==p?x*p:void 0)?b:y,E=1-v,_=v,k="node-position"===c?s:l,S={x:k.x1*E+k.x2*_,y:k.y1*E+k.y2*_};o.ctrlpts.push(S.x+a.x*w,S.y+a.y*w)}},Za.findTaxiPoints=function(e,t){var n=e._private.rscratch;n.edgeType="segments";var r="vertical",i="horizontal",o="leftward",a="rightward",s="downward",l="upward",c=t.posPts,u=t.srcW,d=t.srcH,h=t.tgtW,f=t.tgtH,p="node-position"!==e.pstyle("edge-distances").value,v=e.pstyle("taxi-direction").value,g=v,m=e.pstyle("taxi-turn"),y="%"===m.units,b=m.pfValue,x=b<0,w=e.pstyle("taxi-turn-min-distance").pfValue,E=p?(u+h)/2:0,_=p?(d+f)/2:0,k=c.x2-c.x1,S=c.y2-c.y1,P=function(e,t){return e>0?Math.max(e-t,0):Math.min(e+t,0)},j=P(k,E),C=P(S,_),T=!1;"auto"===g?v=Math.abs(j)>Math.abs(C)?i:r:g===l||g===s?(v=r,T=!0):g!==o&&g!==a||(v=i,T=!0);var D,N=v===r,O=N?C:j,M=N?S:k,A=ot(M),R=!1;(T&&(y||x)||!(g===s&&M<0||g===l&&M>0||g===o&&M>0||g===a&&M<0)||(O=(A*=-1)*Math.abs(O),R=!0),y)?D=(b<0?1+b:b)*O:D=(b<0?O:0)+b*A;var I=function(e){return Math.abs(e)<w||Math.abs(e)>=Math.abs(O)},L=I(D),B=I(Math.abs(O)-Math.abs(D));if((L||B)&&!R)if(N){var F=Math.abs(M)<=d/2,z=Math.abs(k)<=h/2;if(F){var V=(c.x1+c.x2)/2,G=c.y1,H=c.y2;n.segpts=[V,G,V,H]}else if(z){var W=(c.y1+c.y2)/2,q=c.x1,Y=c.x2;n.segpts=[q,W,Y,W]}else n.segpts=[c.x1,c.y2]}else{var U=Math.abs(M)<=u/2,X=Math.abs(S)<=f/2;if(U){var $=(c.y1+c.y2)/2,K=c.x1,Z=c.x2;n.segpts=[K,$,Z,$]}else if(X){var Q=(c.x1+c.x2)/2,J=c.y1,ee=c.y2;n.segpts=[Q,J,Q,ee]}else n.segpts=[c.x2,c.y1]}else if(N){var te=c.y1+D+(p?d/2*A:0),ne=c.x1,re=c.x2;n.segpts=[ne,te,re,te]}else{var ie=c.x1+D+(p?u/2*A:0),oe=c.y1,ae=c.y2;n.segpts=[ie,oe,ie,ae]}},Za.tryToCorrectInvalidPoints=function(e,t){var n=e._private.rscratch;if("bezier"===n.edgeType){var r=t.srcPos,i=t.tgtPos,o=t.srcW,a=t.srcH,s=t.tgtW,l=t.tgtH,c=t.srcShape,u=t.tgtShape,d=!O(n.startX)||!O(n.startY),h=!O(n.arrowStartX)||!O(n.arrowStartY),f=!O(n.endX)||!O(n.endY),p=!O(n.arrowEndX)||!O(n.arrowEndY),v=3*(this.getArrowWidth(e.pstyle("width").pfValue,e.pstyle("arrow-scale").value)*this.arrowShapeWidth),g=at({x:n.ctrlpts[0],y:n.ctrlpts[1]},{x:n.startX,y:n.startY}),m=g<v,y=at({x:n.ctrlpts[0],y:n.ctrlpts[1]},{x:n.endX,y:n.endY}),b=y<v,x=!1;if(d||h||m){x=!0;var w={x:n.ctrlpts[0]-r.x,y:n.ctrlpts[1]-r.y},E=Math.sqrt(w.x*w.x+w.y*w.y),_={x:w.x/E,y:w.y/E},k=Math.max(o,a),S={x:n.ctrlpts[0]+2*_.x*k,y:n.ctrlpts[1]+2*_.y*k},P=c.intersectLine(r.x,r.y,o,a,S.x,S.y,0);m?(n.ctrlpts[0]=n.ctrlpts[0]+_.x*(v-g),n.ctrlpts[1]=n.ctrlpts[1]+_.y*(v-g)):(n.ctrlpts[0]=P[0]+_.x*v,n.ctrlpts[1]=P[1]+_.y*v)}if(f||p||b){x=!0;var j={x:n.ctrlpts[0]-i.x,y:n.ctrlpts[1]-i.y},C=Math.sqrt(j.x*j.x+j.y*j.y),T={x:j.x/C,y:j.y/C},D=Math.max(o,a),N={x:n.ctrlpts[0]+2*T.x*D,y:n.ctrlpts[1]+2*T.y*D},M=u.intersectLine(i.x,i.y,s,l,N.x,N.y,0);b?(n.ctrlpts[0]=n.ctrlpts[0]+T.x*(v-y),n.ctrlpts[1]=n.ctrlpts[1]+T.y*(v-y)):(n.ctrlpts[0]=M[0]+T.x*v,n.ctrlpts[1]=M[1]+T.y*v)}x&&this.findEndpoints(e)}},Za.storeAllpts=function(e){var t=e._private.rscratch;if("multibezier"===t.edgeType||"bezier"===t.edgeType||"self"===t.edgeType||"compound"===t.edgeType){t.allpts=[],t.allpts.push(t.startX,t.startY);for(var n=0;n+1<t.ctrlpts.length;n+=2)t.allpts.push(t.ctrlpts[n],t.ctrlpts[n+1]),n+3<t.ctrlpts.length&&t.allpts.push((t.ctrlpts[n]+t.ctrlpts[n+2])/2,(t.ctrlpts[n+1]+t.ctrlpts[n+3])/2);var r;t.allpts.push(t.endX,t.endY),t.ctrlpts.length/2%2==0?(r=t.allpts.length/2-1,t.midX=t.allpts[r],t.midY=t.allpts[r+1]):(r=t.allpts.length/2-3,.5,t.midX=ct(t.allpts[r],t.allpts[r+2],t.allpts[r+4],.5),t.midY=ct(t.allpts[r+1],t.allpts[r+3],t.allpts[r+5],.5))}else if("straight"===t.edgeType)t.allpts=[t.startX,t.startY,t.endX,t.endY],t.midX=(t.startX+t.endX+t.arrowStartX+t.arrowEndX)/4,t.midY=(t.startY+t.endY+t.arrowStartY+t.arrowEndY)/4;else if("segments"===t.edgeType)if(t.allpts=[],t.allpts.push(t.startX,t.startY),t.allpts.push.apply(t.allpts,t.segpts),t.allpts.push(t.endX,t.endY),t.segpts.length%4==0){var i=t.segpts.length/2,o=i-2;t.midX=(t.segpts[o]+t.segpts[i])/2,t.midY=(t.segpts[o+1]+t.segpts[i+1])/2}else{var a=t.segpts.length/2-1;t.midX=t.segpts[a],t.midY=t.segpts[a+1]}},Za.checkForInvalidEdgeWarning=function(e){var t=e[0]._private.rscratch;t.nodesOverlap||O(t.startX)&&O(t.startY)&&O(t.endX)&&O(t.endY)?t.loggedErr=!1:t.loggedErr||(t.loggedErr=!0,Se("Edge `"+e.id()+"` has invalid endpoints and so it is impossible to draw. Adjust your edge style (e.g. control points) accordingly or use an alternative edge type. This is expected behaviour when the source node and the target node overlap."))},Za.findEdgeControlPoints=function(e){var t=this;if(e&&0!==e.length){for(var n=this,r=n.cy.hasCompoundNodes(),i={map:new Re,get:function(e){var t=this.map.get(e[0]);return null!=t?t.get(e[1]):null},set:function(e,t){var n=this.map.get(e[0]);null==n&&(n=new Re,this.map.set(e[0],n)),n.set(e[1],t)}},o=[],a=[],s=0;s<e.length;s++){var l=e[s],c=l._private,u=l.pstyle("curve-style").value;if(!l.removed()&&l.takesUpSpace())if("haystack"!==u){var d="unbundled-bezier"===u||"segments"===u||"straight"===u||"straight-triangle"===u||"taxi"===u,h="unbundled-bezier"===u||"bezier"===u,f=c.source,p=c.target,v=[f.poolIndex(),p.poolIndex()].sort(),g=i.get(v);null==g&&(g={eles:[]},i.set(v,g),o.push(v)),g.eles.push(l),d&&(g.hasUnbundled=!0),h&&(g.hasBezier=!0)}else a.push(l)}for(var m=function(e){var a=o[e],s=i.get(a),l=void 0;if(!s.hasUnbundled){var c=s.eles[0].parallelEdges().filter((function(e){return e.isBundledBezier()}));Oe(s.eles),c.forEach((function(e){return s.eles.push(e)})),s.eles.sort((function(e,t){return e.poolIndex()-t.poolIndex()}))}var u=s.eles[0],d=u.source(),h=u.target();if(d.poolIndex()>h.poolIndex()){var f=d;d=h,h=f}var p=s.srcPos=d.position(),v=s.tgtPos=h.position(),g=s.srcW=d.outerWidth(),m=s.srcH=d.outerHeight(),y=s.tgtW=h.outerWidth(),b=s.tgtH=h.outerHeight(),x=s.srcShape=n.nodeShapes[t.getNodeShape(d)],w=s.tgtShape=n.nodeShapes[t.getNodeShape(h)];s.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var E=0;E<s.eles.length;E++){var _=s.eles[E],k=_[0]._private.rscratch,S=_.pstyle("curve-style").value,P="unbundled-bezier"===S||"segments"===S||"taxi"===S,j=!d.same(_.source());if(!s.calculatedIntersection&&d!==h&&(s.hasBezier||s.hasUnbundled)){s.calculatedIntersection=!0;var C=x.intersectLine(p.x,p.y,g,m,v.x,v.y,0),T=s.srcIntn=C,D=w.intersectLine(v.x,v.y,y,b,p.x,p.y,0),N=s.tgtIntn=D,M=s.intersectionPts={x1:C[0],x2:D[0],y1:C[1],y2:D[1]},A=s.posPts={x1:p.x,x2:v.x,y1:p.y,y2:v.y},R=D[1]-C[1],I=D[0]-C[0],L=Math.sqrt(I*I+R*R),B=s.vector={x:I,y:R},F=s.vectorNorm={x:B.x/L,y:B.y/L},z={x:-F.y,y:F.x};s.nodesOverlap=!O(L)||w.checkPoint(C[0],C[1],0,y,b,v.x,v.y)||x.checkPoint(D[0],D[1],0,g,m,p.x,p.y),s.vectorNormInverse=z,l={nodesOverlap:s.nodesOverlap,dirCounts:s.dirCounts,calculatedIntersection:!0,hasBezier:s.hasBezier,hasUnbundled:s.hasUnbundled,eles:s.eles,srcPos:v,tgtPos:p,srcW:y,srcH:b,tgtW:g,tgtH:m,srcIntn:N,tgtIntn:T,srcShape:w,tgtShape:x,posPts:{x1:A.x2,y1:A.y2,x2:A.x1,y2:A.y1},intersectionPts:{x1:M.x2,y1:M.y2,x2:M.x1,y2:M.y1},vector:{x:-B.x,y:-B.y},vectorNorm:{x:-F.x,y:-F.y},vectorNormInverse:{x:-z.x,y:-z.y}}}var V=j?l:s;k.nodesOverlap=V.nodesOverlap,k.srcIntn=V.srcIntn,k.tgtIntn=V.tgtIntn,r&&(d.isParent()||d.isChild()||h.isParent()||h.isChild())&&(d.parents().anySame(h)||h.parents().anySame(d)||d.same(h)&&d.isParent())?t.findCompoundLoopPoints(_,V,E,P):d===h?t.findLoopPoints(_,V,E,P):"segments"===S?t.findSegmentsPoints(_,V):"taxi"===S?t.findTaxiPoints(_,V):"straight"===S||!P&&s.eles.length%2==1&&E===Math.floor(s.eles.length/2)?t.findStraightEdgePoints(_):t.findBezierPoints(_,V,E,P,j),t.findEndpoints(_),t.tryToCorrectInvalidPoints(_,V),t.checkForInvalidEdgeWarning(_),t.storeAllpts(_),t.storeEdgeProjections(_),t.calculateArrowAngles(_),t.recalculateEdgeLabelProjections(_),t.calculateLabelAngles(_)}},y=0;y<o.length;y++)m(y);this.findHaystackPoints(a)}},Za.getSegmentPoints=function(e){var t=e[0]._private.rscratch;if("segments"===t.edgeType)return this.recalculateRenderedStyle(e),Qa(t.segpts)},Za.getControlPoints=function(e){var t=e[0]._private.rscratch,n=t.edgeType;if("bezier"===n||"multibezier"===n||"self"===n||"compound"===n)return this.recalculateRenderedStyle(e),Qa(t.ctrlpts)},Za.getEdgeMidpoint=function(e){var t=e[0]._private.rscratch;return this.recalculateRenderedStyle(e),{x:t.midX,y:t.midY}};var Ja={manualEndptToPx:function(e,t){var n=e.position(),r=e.outerWidth(),i=e.outerHeight();if(2===t.value.length){var o=[t.pfValue[0],t.pfValue[1]];return"%"===t.units[0]&&(o[0]=o[0]*r),"%"===t.units[1]&&(o[1]=o[1]*i),o[0]+=n.x,o[1]+=n.y,o}var a=t.pfValue[0];a=-Math.PI/2+a;var s=2*Math.max(r,i),l=[n.x+Math.cos(a)*s,n.y+Math.sin(a)*s];return this.nodeShapes[this.getNodeShape(e)].intersectLine(n.x,n.y,r,i,l[0],l[1],0)},findEndpoints:function(e){var t,n,r,i,o,a=this,s=e.source()[0],l=e.target()[0],c=s.position(),u=l.position(),d=e.pstyle("target-arrow-shape").value,h=e.pstyle("source-arrow-shape").value,f=e.pstyle("target-distance-from-node").pfValue,p=e.pstyle("source-distance-from-node").pfValue,v=e.pstyle("curve-style").value,g=e._private.rscratch,m=g.edgeType,y="self"===m||"compound"===m,b="bezier"===m||"multibezier"===m||y,x="bezier"!==m,w="straight"===m||"segments"===m,E="segments"===m,_=b||x||w,k=y||"taxi"===v,S=e.pstyle("source-endpoint"),P=k?"outside-to-node":S.value,j=e.pstyle("target-endpoint"),C=k?"outside-to-node":j.value;if(g.srcManEndpt=S,g.tgtManEndpt=j,b){var T=[g.ctrlpts[0],g.ctrlpts[1]];n=x?[g.ctrlpts[g.ctrlpts.length-2],g.ctrlpts[g.ctrlpts.length-1]]:T,r=T}else if(w){var D=E?g.segpts.slice(0,2):[u.x,u.y];n=E?g.segpts.slice(g.segpts.length-2):[c.x,c.y],r=D}if("inside-to-node"===C)t=[u.x,u.y];else if(j.units)t=this.manualEndptToPx(l,j);else if("outside-to-line"===C)t=g.tgtIntn;else if("outside-to-node"===C||"outside-to-node-or-label"===C?i=n:"outside-to-line"!==C&&"outside-to-line-or-label"!==C||(i=[c.x,c.y]),t=a.nodeShapes[this.getNodeShape(l)].intersectLine(u.x,u.y,l.outerWidth(),l.outerHeight(),i[0],i[1],0),"outside-to-node-or-label"===C||"outside-to-line-or-label"===C){var N=l._private.rscratch,M=N.labelWidth,A=N.labelHeight,R=N.labelX,I=N.labelY,L=M/2,B=A/2,F=l.pstyle("text-valign").value;"top"===F?I-=B:"bottom"===F&&(I+=B);var z=l.pstyle("text-halign").value;"left"===z?R-=L:"right"===z&&(R+=L);var V=Mt(i[0],i[1],[R-L,I-B,R+L,I-B,R+L,I+B,R-L,I+B],u.x,u.y);if(V.length>0){var G=c,H=st(G,nt(t)),W=st(G,nt(V)),q=H;if(W<H&&(t=V,q=W),V.length>2)st(G,{x:V[2],y:V[3]})<q&&(t=[V[2],V[3]])}}var Y=At(t,n,a.arrowShapes[d].spacing(e)+f),U=At(t,n,a.arrowShapes[d].gap(e)+f);if(g.endX=U[0],g.endY=U[1],g.arrowEndX=Y[0],g.arrowEndY=Y[1],"inside-to-node"===P)t=[c.x,c.y];else if(S.units)t=this.manualEndptToPx(s,S);else if("outside-to-line"===P)t=g.srcIntn;else if("outside-to-node"===P||"outside-to-node-or-label"===P?o=r:"outside-to-line"!==P&&"outside-to-line-or-label"!==P||(o=[u.x,u.y]),t=a.nodeShapes[this.getNodeShape(s)].intersectLine(c.x,c.y,s.outerWidth(),s.outerHeight(),o[0],o[1],0),"outside-to-node-or-label"===P||"outside-to-line-or-label"===P){var X=s._private.rscratch,$=X.labelWidth,K=X.labelHeight,Z=X.labelX,Q=X.labelY,J=$/2,ee=K/2,te=s.pstyle("text-valign").value;"top"===te?Q-=ee:"bottom"===te&&(Q+=ee);var ne=s.pstyle("text-halign").value;"left"===ne?Z-=J:"right"===ne&&(Z+=J);var re=Mt(o[0],o[1],[Z-J,Q-ee,Z+J,Q-ee,Z+J,Q+ee,Z-J,Q+ee],c.x,c.y);if(re.length>0){var ie=u,oe=st(ie,nt(t)),ae=st(ie,nt(re)),se=oe;if(ae<oe&&(t=[re[0],re[1]],se=ae),re.length>2)st(ie,{x:re[2],y:re[3]})<se&&(t=[re[2],re[3]])}}var le=At(t,r,a.arrowShapes[h].spacing(e)+p),ce=At(t,r,a.arrowShapes[h].gap(e)+p);g.startX=ce[0],g.startY=ce[1],g.arrowStartX=le[0],g.arrowStartY=le[1],_&&(O(g.startX)&&O(g.startY)&&O(g.endX)&&O(g.endY)?g.badLine=!1:g.badLine=!0)},getSourceEndpoint:function(e){var t=e[0]._private.rscratch;return this.recalculateRenderedStyle(e),"haystack"===t.edgeType?{x:t.haystackPts[0],y:t.haystackPts[1]}:{x:t.arrowStartX,y:t.arrowStartY}},getTargetEndpoint:function(e){var t=e[0]._private.rscratch;return this.recalculateRenderedStyle(e),"haystack"===t.edgeType?{x:t.haystackPts[2],y:t.haystackPts[3]}:{x:t.arrowEndX,y:t.arrowEndY}}},es={};function ts(e,t,n){for(var r=function(e,t,n,r){return ct(e,t,n,r)},i=t._private.rstyle.bezierPts,o=0;o<e.bezierProjPcts.length;o++){var a=e.bezierProjPcts[o];i.push({x:r(n[0],n[2],n[4],a),y:r(n[1],n[3],n[5],a)})}}es.storeEdgeProjections=function(e){var t=e._private,n=t.rscratch,r=n.edgeType;if(t.rstyle.bezierPts=null,t.rstyle.linePts=null,t.rstyle.haystackPts=null,"multibezier"===r||"bezier"===r||"self"===r||"compound"===r){t.rstyle.bezierPts=[];for(var i=0;i+5<n.allpts.length;i+=4)ts(this,e,n.allpts.slice(i,i+6))}else if("segments"===r){var o=t.rstyle.linePts=[];for(i=0;i+1<n.allpts.length;i+=2)o.push({x:n.allpts[i],y:n.allpts[i+1]})}else if("haystack"===r){var a=n.haystackPts;t.rstyle.haystackPts=[{x:a[0],y:a[1]},{x:a[2],y:a[3]}]}t.rstyle.arrowWidth=this.getArrowWidth(e.pstyle("width").pfValue,e.pstyle("arrow-scale").value)*this.arrowShapeWidth},es.recalculateEdgeProjections=function(e){this.findEdgeControlPoints(e)};var ns={recalculateNodeLabelProjection:function(e){var t=e.pstyle("label").strValue;if(!F(t)){var n,r,i=e._private,o=e.width(),a=e.height(),s=e.padding(),l=e.position(),c=e.pstyle("text-halign").strValue,u=e.pstyle("text-valign").strValue,d=i.rscratch,h=i.rstyle;switch(c){case"left":n=l.x-o/2-s;break;case"right":n=l.x+o/2+s;break;default:n=l.x}switch(u){case"top":r=l.y-a/2-s;break;case"bottom":r=l.y+a/2+s;break;default:r=l.y}d.labelX=n,d.labelY=r,h.labelX=n,h.labelY=r,this.calculateLabelAngles(e),this.applyLabelDimensions(e)}}},rs=function(e,t){var n=Math.atan(t/e);return 0===e&&n<0&&(n*=-1),n},is=function(e,t){var n=t.x-e.x,r=t.y-e.y;return rs(n,r)};ns.recalculateEdgeLabelProjections=function(e){var t,n=e._private,r=n.rscratch,i=this,o={mid:e.pstyle("label").strValue,source:e.pstyle("source-label").strValue,target:e.pstyle("target-label").strValue};if(o.mid||o.source||o.target){t={x:r.midX,y:r.midY};var a=function(e,t,r){Ae(n.rscratch,e,t,r),Ae(n.rstyle,e,t,r)};a("labelX",null,t.x),a("labelY",null,t.y);var s=rs(r.midDispX,r.midDispY);a("labelAutoAngle",null,s);var l=function e(){if(e.cache)return e.cache;for(var t=[],o=0;o+5<r.allpts.length;o+=4){var a={x:r.allpts[o],y:r.allpts[o+1]},s={x:r.allpts[o+2],y:r.allpts[o+3]},l={x:r.allpts[o+4],y:r.allpts[o+5]};t.push({p0:a,p1:s,p2:l,startDist:0,length:0,segments:[]})}var c=n.rstyle.bezierPts,u=i.bezierProjPcts.length;function d(e,t,n,r,i){var o=at(t,n),a=e.segments[e.segments.length-1],s={p0:t,p1:n,t0:r,t1:i,startDist:a?a.startDist+a.length:0,length:o};e.segments.push(s),e.length+=o}for(var h=0;h<t.length;h++){var f=t[h],p=t[h-1];p&&(f.startDist=p.startDist+p.length),d(f,f.p0,c[h*u],0,i.bezierProjPcts[0]);for(var v=0;v<u-1;v++)d(f,c[h*u+v],c[h*u+v+1],i.bezierProjPcts[v],i.bezierProjPcts[v+1]);d(f,c[h*u+u-1],f.p2,i.bezierProjPcts[u-1],1)}return e.cache=t},c=function(n){var i,s="source"===n;if(o[n]){var c=e.pstyle(n+"-text-offset").pfValue;switch(r.edgeType){case"self":case"compound":case"bezier":case"multibezier":for(var u,d=l(),h=0,f=0,p=0;p<d.length;p++){for(var v=d[s?p:d.length-1-p],g=0;g<v.segments.length;g++){var m=v.segments[s?g:v.segments.length-1-g],y=p===d.length-1&&g===v.segments.length-1;if(h=f,(f+=m.length)>=c||y){u={cp:v,segment:m};break}}if(u)break}var b=u.cp,x=u.segment,w=(c-h)/x.length,E=x.t1-x.t0,_=s?x.t0+E*w:x.t1-E*w;_=dt(0,_,1),t=ut(b.p0,b.p1,b.p2,_),i=function(e,t,n,r){var i=dt(0,r-.001,1),o=dt(0,r+.001,1),a=ut(e,t,n,i),s=ut(e,t,n,o);return is(a,s)}(b.p0,b.p1,b.p2,_);break;case"straight":case"segments":case"haystack":for(var k,S,P,j,C=0,T=r.allpts.length,D=0;D+3<T&&(s?(P={x:r.allpts[D],y:r.allpts[D+1]},j={x:r.allpts[D+2],y:r.allpts[D+3]}):(P={x:r.allpts[T-2-D],y:r.allpts[T-1-D]},j={x:r.allpts[T-4-D],y:r.allpts[T-3-D]}),S=C,!((C+=k=at(P,j))>=c));D+=2);var N=(c-S)/k;N=dt(0,N,1),t=function(e,t,n,r){var i=t.x-e.x,o=t.y-e.y,a=at(e,t),s=i/a,l=o/a;return n=null==n?0:n,r=null!=r?r:n*a,{x:e.x+s*r,y:e.y+l*r}}(P,j,N),i=is(P,j)}a("labelX",n,t.x),a("labelY",n,t.y),a("labelAutoAngle",n,i)}};c("source"),c("target"),this.applyLabelDimensions(e)}},ns.applyLabelDimensions=function(e){this.applyPrefixedLabelDimensions(e),e.isEdge()&&(this.applyPrefixedLabelDimensions(e,"source"),this.applyPrefixedLabelDimensions(e,"target"))},ns.applyPrefixedLabelDimensions=function(e,t){var n=e._private,r=this.getLabelText(e,t),i=this.calculateLabelDimensions(e,r),o=e.pstyle("line-height").pfValue,a=e.pstyle("text-wrap").strValue,s=Me(n.rscratch,"labelWrapCachedLines",t)||[],l="wrap"!==a?1:Math.max(s.length,1),c=i.height/l,u=c*o,d=i.width,h=i.height+(l-1)*(o-1)*c;Ae(n.rstyle,"labelWidth",t,d),Ae(n.rscratch,"labelWidth",t,d),Ae(n.rstyle,"labelHeight",t,h),Ae(n.rscratch,"labelHeight",t,h),Ae(n.rscratch,"labelLineHeight",t,u)},ns.getLabelText=function(e,t){var n=e._private,r=t?t+"-":"",i=e.pstyle(r+"label").strValue,o=e.pstyle("text-transform").value,a=function(e,r){return r?(Ae(n.rscratch,e,t,r),r):Me(n.rscratch,e,t)};if(!i)return"";"none"==o||("uppercase"==o?i=i.toUpperCase():"lowercase"==o&&(i=i.toLowerCase()));var s=e.pstyle("text-wrap").value;if("wrap"===s){var l=a("labelKey");if(null!=l&&a("labelWrapKey")===l)return a("labelWrapCachedText");for(var c=i.split("\n"),u=e.pstyle("text-max-width").pfValue,d="anywhere"===e.pstyle("text-overflow-wrap").value,h=[],f=/[\s\u200b]+/,p=d?"":" ",v=0;v<c.length;v++){var g=c[v],m=this.calculateLabelDimensions(e,g).width;if(d){var y=g.split("").join("\u200b");g=y}if(m>u){for(var b=g.split(f),x="",w=0;w<b.length;w++){var E=b[w],_=0===x.length?E:x+p+E;this.calculateLabelDimensions(e,_).width<=u?x+=E+p:(x&&h.push(x),x=E+p)}x.match(/^[\s\u200b]+$/)||h.push(x)}else h.push(g)}a("labelWrapCachedLines",h),i=a("labelWrapCachedText",h.join("\n")),a("labelWrapKey",l)}else if("ellipsis"===s){var k=e.pstyle("text-max-width").pfValue,S="",P=!1;if(this.calculateLabelDimensions(e,i).width<k)return i;for(var j=0;j<i.length;j++){if(this.calculateLabelDimensions(e,S+i[j]+"\u2026").width>k)break;S+=i[j],j===i.length-1&&(P=!0)}return P||(S+="\u2026"),S}return i},ns.getLabelJustification=function(e){var t=e.pstyle("text-justification").strValue,n=e.pstyle("text-halign").strValue;if("auto"!==t)return t;if(!e.isNode())return"center";switch(n){case"left":return"right";case"right":return"left";default:return"center"}},ns.calculateLabelDimensions=function(e,t){var n=he(t,e._private.labelDimsKey),r=this.labelDimCache||(this.labelDimCache=[]),i=r[n];if(null!=i)return i;var o=e.pstyle("font-style").strValue,a=e.pstyle("font-size").pfValue,s=e.pstyle("font-family").strValue,l=e.pstyle("font-weight").strValue,c=this.labelCalcCanvas,u=this.labelCalcCanvasContext;if(!c){c=this.labelCalcCanvas=document.createElement("canvas"),u=this.labelCalcCanvasContext=c.getContext("2d");var d=c.style;d.position="absolute",d.left="-9999px",d.top="-9999px",d.zIndex="-1",d.visibility="hidden",d.pointerEvents="none"}u.font="".concat(o," ").concat(l," ").concat(a,"px ").concat(s);for(var h=0,f=0,p=t.split("\n"),v=0;v<p.length;v++){var g=p[v],m=u.measureText(g),y=Math.ceil(m.width),b=a;h=Math.max(y,h),f+=b}return h+=0,f+=0,r[n]={width:h,height:f}},ns.calculateLabelAngle=function(e,t){var n=e._private.rscratch,r=e.isEdge(),i=t?t+"-":"",o=e.pstyle(i+"text-rotation"),a=o.strValue;return"none"===a?0:r&&"autorotate"===a?n.labelAutoAngle:"autorotate"===a?0:o.pfValue},ns.calculateLabelAngles=function(e){var t=this,n=e.isEdge(),r=e._private.rscratch;r.labelAngle=t.calculateLabelAngle(e),n&&(r.sourceLabelAngle=t.calculateLabelAngle(e,"source"),r.targetLabelAngle=t.calculateLabelAngle(e,"target"))};var os={},as=!1;os.getNodeShape=function(e){var t=e.pstyle("shape").value;if("cutrectangle"===t&&(e.width()<28||e.height()<28))return as||(Se("The `cutrectangle` node shape can not be used at small sizes so `rectangle` is used instead"),as=!0),"rectangle";if(e.isParent())return"rectangle"===t||"roundrectangle"===t||"round-rectangle"===t||"cutrectangle"===t||"cut-rectangle"===t||"barrel"===t?t:"rectangle";if("polygon"===t){var n=e.pstyle("shape-polygon-points").value;return this.nodeShapes.makePolygon(n).name}return t};var ss={registerCalculationListeners:function(){var e=this.cy,t=e.collection(),n=this,r=function(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(t.merge(e),n)for(var r=0;r<e.length;r++){var i=e[r],o=i._private,a=o.rstyle;a.clean=!1,a.cleanConnected=!1}};n.binder(e).on("bounds.* dirty.*",(function(e){var t=e.target;r(t)})).on("style.* background.*",(function(e){var t=e.target;r(t,!1)}));var i=function(i){if(i){var o=n.onUpdateEleCalcsFns;t.cleanStyle();for(var a=0;a<t.length;a++){var s=t[a],l=s._private.rstyle;s.isNode()&&!l.cleanConnected&&(r(s.connectedEdges()),l.cleanConnected=!0)}if(o)for(var c=0;c<o.length;c++){(0,o[c])(i,t)}n.recalculateRenderedStyle(t),t=e.collection()}};n.flushRenderedStyleQueue=function(){i(!0)},n.beforeRender(i,n.beforeRenderPriorities.eleCalcs)},onUpdateEleCalcs:function(e){(this.onUpdateEleCalcsFns=this.onUpdateEleCalcsFns||[]).push(e)},recalculateRenderedStyle:function(e,t){var n=function(e){return e._private.rstyle.cleanConnected},r=[],i=[];if(!this.destroyed){void 0===t&&(t=!0);for(var o=0;o<e.length;o++){var a=e[o],s=a._private,l=s.rstyle;!a.isEdge()||n(a.source())&&n(a.target())||(l.clean=!1),t&&l.clean||a.removed()||"none"!==a.pstyle("display").value&&("nodes"===s.group?i.push(a):r.push(a),l.clean=!0)}for(var c=0;c<i.length;c++){var u=i[c],d=u._private.rstyle,h=u.position();this.recalculateNodeLabelProjection(u),d.nodeX=h.x,d.nodeY=h.y,d.nodeW=u.pstyle("width").pfValue,d.nodeH=u.pstyle("height").pfValue}this.recalculateEdgeProjections(r);for(var f=0;f<r.length;f++){var p=r[f]._private,v=p.rstyle,g=p.rscratch;v.srcX=g.arrowStartX,v.srcY=g.arrowStartY,v.tgtX=g.arrowEndX,v.tgtY=g.arrowEndY,v.midX=g.midX,v.midY=g.midY,v.labelAngle=g.labelAngle,v.sourceLabelAngle=g.sourceLabelAngle,v.targetLabelAngle=g.targetLabelAngle}}}},ls={updateCachedGrabbedEles:function(){var e=this.cachedZSortedEles;if(e){e.drag=[],e.nondrag=[];for(var t=[],n=0;n<e.length;n++){var r=(i=e[n])._private.rscratch;i.grabbed()&&!i.isParent()?t.push(i):r.inDragLayer?e.drag.push(i):e.nondrag.push(i)}for(n=0;n<t.length;n++){var i=t[n];e.drag.push(i)}}},invalidateCachedZSortedEles:function(){this.cachedZSortedEles=null},getCachedZSortedEles:function(e){if(e||!this.cachedZSortedEles){var t=this.cy.mutableElements().toArray();t.sort(Xi),t.interactive=t.filter((function(e){return e.interactive()})),this.cachedZSortedEles=t,this.updateCachedGrabbedEles()}else t=this.cachedZSortedEles;return t}},cs={};[$a,Ka,Za,Ja,es,ns,os,ss,ls].forEach((function(e){X(cs,e)}));var us={getCachedImage:function(e,t,n){var r=this.imageCache=this.imageCache||{},i=r[e];if(i)return i.image.complete||i.image.addEventListener("load",n),i.image;var o=(i=r[e]=r[e]||{}).image=new Image;o.addEventListener("load",n),o.addEventListener("error",(function(){o.error=!0}));var a="data:";return e.substring(0,a.length).toLowerCase()===a||(o.crossOrigin=t),o.src=e,o}},ds={registerBinding:function(e,t,n,r){var i=Array.prototype.slice.apply(arguments,[1]),o=this.binder(e);return o.on.apply(o,i)}};ds.binder=function(e){var t,n=this,r=e===window||e===document||e===document.body||(t=e,"undefined"!=typeof HTMLElement&&t instanceof HTMLElement);if(null==n.supportsPassiveEvents){var i=!1;try{var o=Object.defineProperty({},"passive",{get:function(){return i=!0,!0}});window.addEventListener("test",null,o)}catch(s){}n.supportsPassiveEvents=i}var a=function(t,i,o){var a=Array.prototype.slice.call(arguments);return r&&n.supportsPassiveEvents&&(a[2]={capture:null!=o&&o,passive:!1,once:!1}),n.bindings.push({target:e,args:a}),(e.addEventListener||e.on).apply(e,a),this};return{on:a,addEventListener:a,addListener:a,bind:a}},ds.nodeIsDraggable=function(e){return e&&e.isNode()&&!e.locked()&&e.grabbable()},ds.nodeIsGrabbable=function(e){return this.nodeIsDraggable(e)&&e.interactive()},ds.load=function(){var e=this,t=function(e){return e.selected()},n=function(t,n,r,i){null==t&&(t=e.cy);for(var o=0;o<n.length;o++){var a=n[o];t.emit({originalEvent:r,type:a,position:i})}},r=function(e){return e.shiftKey||e.metaKey||e.ctrlKey},i=function(t,n){var r=!0;if(e.cy.hasCompoundNodes()&&t&&t.pannable())for(var i=0;n&&i<n.length;i++){if((t=n[i]).isNode()&&t.isParent()&&!t.pannable()){r=!1;break}}else r=!0;return r},o=function(e){e[0]._private.rscratch.inDragLayer=!0},a=function(e){e[0]._private.rscratch.isGrabTarget=!0},s=function(e,t){var n=t.addToList;n.has(e)||!e.grabbable()||e.locked()||(n.merge(e),function(e){e[0]._private.grabbed=!0}(e))},l=function(t,n){n=n||{};var r=t.cy().hasCompoundNodes();n.inDragLayer&&(t.forEach(o),t.neighborhood().stdFilter((function(e){return!r||e.isEdge()})).forEach(o)),n.addToList&&t.forEach((function(e){s(e,n)})),function(e,t){if(e.cy().hasCompoundNodes()&&(null!=t.inDragLayer||null!=t.addToList)){var n=e.descendants();t.inDragLayer&&(n.forEach(o),n.connectedEdges().forEach(o)),t.addToList&&s(n,t)}}(t,n),h(t,{inDragLayer:n.inDragLayer}),e.updateCachedGrabbedEles()},u=l,d=function(t){t&&(e.getCachedZSortedEles().forEach((function(e){!function(e){e[0]._private.grabbed=!1}(e),function(e){e[0]._private.rscratch.inDragLayer=!1}(e),function(e){e[0]._private.rscratch.isGrabTarget=!1}(e)})),e.updateCachedGrabbedEles())},h=function(e,t){if((null!=t.inDragLayer||null!=t.addToList)&&e.cy().hasCompoundNodes()){var n=e.ancestors().orphans();if(!n.same(e)){var r=n.descendants().spawnSelf().merge(n).unmerge(e).unmerge(e.descendants()),i=r.connectedEdges();t.inDragLayer&&(i.forEach(o),r.forEach(o)),t.addToList&&r.forEach((function(e){s(e,t)}))}}},f=function(){null!=document.activeElement&&null!=document.activeElement.blur&&document.activeElement.blur()},p="undefined"!=typeof MutationObserver,v="undefined"!=typeof ResizeObserver;p?(e.removeObserver=new MutationObserver((function(t){for(var n=0;n<t.length;n++){var r=t[n].removedNodes;if(r)for(var i=0;i<r.length;i++){if(r[i]===e.container){e.destroy();break}}}})),e.container.parentNode&&e.removeObserver.observe(e.container.parentNode,{childList:!0})):e.registerBinding(e.container,"DOMNodeRemoved",(function(t){e.destroy()}));var g=c.default((function(){e.cy.resize()}),100);p&&(e.styleObserver=new MutationObserver(g),e.styleObserver.observe(e.container,{attributes:!0})),e.registerBinding(window,"resize",g),v&&(e.resizeObserver=new ResizeObserver(g),e.resizeObserver.observe(e.container));var m=function(){e.invalidateContainerClientCoordsCache()};!function(e,t){for(;null!=e;)t(e),e=e.parentNode}(e.container,(function(t){e.registerBinding(t,"transitionend",m),e.registerBinding(t,"animationend",m),e.registerBinding(t,"scroll",m)})),e.registerBinding(e.container,"contextmenu",(function(e){e.preventDefault()}));var y,b,x,w=function(t){for(var n=e.findContainerClientCoords(),r=n[0],i=n[1],o=n[2],a=n[3],s=t.touches?t.touches:[t],l=!1,c=0;c<s.length;c++){var u=s[c];if(r<=u.clientX&&u.clientX<=r+o&&i<=u.clientY&&u.clientY<=i+a){l=!0;break}}if(!l)return!1;for(var d=e.container,h=t.target.parentNode,f=!1;h;){if(h===d){f=!0;break}h=h.parentNode}return!!f};e.registerBinding(e.container,"mousedown",(function(t){if(w(t)){t.preventDefault(),f(),e.hoverData.capture=!0,e.hoverData.which=t.which;var r=e.cy,i=[t.clientX,t.clientY],o=e.projectIntoViewport(i[0],i[1]),s=e.selection,c=e.findNearestElements(o[0],o[1],!0,!1),d=c[0],h=e.dragData.possibleDragElements;e.hoverData.mdownPos=o,e.hoverData.mdownGPos=i;if(3==t.which){e.hoverData.cxtStarted=!0;var p={originalEvent:t,type:"cxttapstart",position:{x:o[0],y:o[1]}};d?(d.activate(),d.emit(p),e.hoverData.down=d):r.emit(p),e.hoverData.downTime=(new Date).getTime(),e.hoverData.cxtDragged=!1}else if(1==t.which){if(d&&d.activate(),null!=d&&e.nodeIsGrabbable(d)){var v=function(e){return{originalEvent:t,type:e,position:{x:o[0],y:o[1]}}};if(a(d),d.selected()){h=e.dragData.possibleDragElements=r.collection();var g=r.$((function(t){return t.isNode()&&t.selected()&&e.nodeIsGrabbable(t)}));l(g,{addToList:h}),d.emit(v("grabon")),g.forEach((function(e){e.emit(v("grab"))}))}else h=e.dragData.possibleDragElements=r.collection(),u(d,{addToList:h}),d.emit(v("grabon")).emit(v("grab"));e.redrawHint("eles",!0),e.redrawHint("drag",!0)}e.hoverData.down=d,e.hoverData.downs=c,e.hoverData.downTime=(new Date).getTime(),n(d,["mousedown","tapstart","vmousedown"],t,{x:o[0],y:o[1]}),null==d?(s[4]=1,e.data.bgActivePosistion={x:o[0],y:o[1]},e.redrawHint("select",!0),e.redraw()):d.pannable()&&(s[4]=1),e.hoverData.tapholdCancelled=!1,clearTimeout(e.hoverData.tapholdTimeout),e.hoverData.tapholdTimeout=setTimeout((function(){if(!e.hoverData.tapholdCancelled){var n=e.hoverData.down;n?n.emit({originalEvent:t,type:"taphold",position:{x:o[0],y:o[1]}}):r.emit({originalEvent:t,type:"taphold",position:{x:o[0],y:o[1]}})}}),e.tapholdDuration)}s[0]=s[2]=o[0],s[1]=s[3]=o[1]}}),!1),e.registerBinding(window,"mousemove",(function(t){if(e.hoverData.capture||w(t)){var o=!1,a=e.cy,s=a.zoom(),c=[t.clientX,t.clientY],u=e.projectIntoViewport(c[0],c[1]),h=e.hoverData.mdownPos,f=e.hoverData.mdownGPos,p=e.selection,v=null;e.hoverData.draggingEles||e.hoverData.dragging||e.hoverData.selecting||(v=e.findNearestElement(u[0],u[1],!0,!1));var g,m=e.hoverData.last,y=e.hoverData.down,b=[u[0]-p[2],u[1]-p[3]],x=e.dragData.possibleDragElements;if(f){var E=c[0]-f[0],_=E*E,k=c[1]-f[1],S=_+k*k;e.hoverData.isOverThresholdDrag=g=S>=e.desktopTapThreshold2}var P=r(t);g&&(e.hoverData.tapholdCancelled=!0);o=!0,n(v,["mousemove","vmousemove","tapdrag"],t,{x:u[0],y:u[1]});var j=function(){e.data.bgActivePosistion=void 0,e.hoverData.selecting||a.emit({originalEvent:t,type:"boxstart",position:{x:u[0],y:u[1]}}),p[4]=1,e.hoverData.selecting=!0,e.redrawHint("select",!0),e.redraw()};if(3===e.hoverData.which){if(g){var C={originalEvent:t,type:"cxtdrag",position:{x:u[0],y:u[1]}};y?y.emit(C):a.emit(C),e.hoverData.cxtDragged=!0,e.hoverData.cxtOver&&v===e.hoverData.cxtOver||(e.hoverData.cxtOver&&e.hoverData.cxtOver.emit({originalEvent:t,type:"cxtdragout",position:{x:u[0],y:u[1]}}),e.hoverData.cxtOver=v,v&&v.emit({originalEvent:t,type:"cxtdragover",position:{x:u[0],y:u[1]}}))}}else if(e.hoverData.dragging){if(o=!0,a.panningEnabled()&&a.userPanningEnabled()){var T;if(e.hoverData.justStartedPan){var D=e.hoverData.mdownPos;T={x:(u[0]-D[0])*s,y:(u[1]-D[1])*s},e.hoverData.justStartedPan=!1}else T={x:b[0]*s,y:b[1]*s};a.panBy(T),a.emit("dragpan"),e.hoverData.dragged=!0}u=e.projectIntoViewport(t.clientX,t.clientY)}else if(1!=p[4]||null!=y&&!y.pannable()){if(y&&y.pannable()&&y.active()&&y.unactivate(),y&&y.grabbed()||v==m||(m&&n(m,["mouseout","tapdragout"],t,{x:u[0],y:u[1]}),v&&n(v,["mouseover","tapdragover"],t,{x:u[0],y:u[1]}),e.hoverData.last=v),y)if(g){if(a.boxSelectionEnabled()&&P)y&&y.grabbed()&&(d(x),y.emit("freeon"),x.emit("free"),e.dragData.didDrag&&(y.emit("dragfreeon"),x.emit("dragfree"))),j();else if(y&&y.grabbed()&&e.nodeIsDraggable(y)){var N=!e.dragData.didDrag;N&&e.redrawHint("eles",!0),e.dragData.didDrag=!0,e.hoverData.draggingEles||l(x,{inDragLayer:!0});var M={x:0,y:0};if(O(b[0])&&O(b[1])&&(M.x+=b[0],M.y+=b[1],N)){var A=e.hoverData.dragDelta;A&&O(A[0])&&O(A[1])&&(M.x+=A[0],M.y+=A[1])}e.hoverData.draggingEles=!0,x.silentShift(M).emit("position drag"),e.redrawHint("drag",!0),e.redraw()}}else!function(){var t=e.hoverData.dragDelta=e.hoverData.dragDelta||[];0===t.length?(t.push(b[0]),t.push(b[1])):(t[0]+=b[0],t[1]+=b[1])}();o=!0}else if(g){if(e.hoverData.dragging||!a.boxSelectionEnabled()||!P&&a.panningEnabled()&&a.userPanningEnabled()){if(!e.hoverData.selecting&&a.panningEnabled()&&a.userPanningEnabled()){i(y,e.hoverData.downs)&&(e.hoverData.dragging=!0,e.hoverData.justStartedPan=!0,p[4]=0,e.data.bgActivePosistion=nt(h),e.redrawHint("select",!0),e.redraw())}}else j();y&&y.pannable()&&y.active()&&y.unactivate()}return p[2]=u[0],p[3]=u[1],o?(t.stopPropagation&&t.stopPropagation(),t.preventDefault&&t.preventDefault(),!1):void 0}}),!1),e.registerBinding(window,"mouseup",(function(i){if(e.hoverData.capture){e.hoverData.capture=!1;var o=e.cy,a=e.projectIntoViewport(i.clientX,i.clientY),s=e.selection,l=e.findNearestElement(a[0],a[1],!0,!1),c=e.dragData.possibleDragElements,u=e.hoverData.down,h=r(i);if(e.data.bgActivePosistion&&(e.redrawHint("select",!0),e.redraw()),e.hoverData.tapholdCancelled=!0,e.data.bgActivePosistion=void 0,u&&u.unactivate(),3===e.hoverData.which){var f={originalEvent:i,type:"cxttapend",position:{x:a[0],y:a[1]}};if(u?u.emit(f):o.emit(f),!e.hoverData.cxtDragged){var p={originalEvent:i,type:"cxttap",position:{x:a[0],y:a[1]}};u?u.emit(p):o.emit(p)}e.hoverData.cxtDragged=!1,e.hoverData.which=null}else if(1===e.hoverData.which){if(n(l,["mouseup","tapend","vmouseup"],i,{x:a[0],y:a[1]}),e.dragData.didDrag||e.hoverData.dragged||e.hoverData.selecting||e.hoverData.isOverThresholdDrag||(n(u,["click","tap","vclick"],i,{x:a[0],y:a[1]}),b=!1,i.timeStamp-x<=o.multiClickDebounceTime()?(y&&clearTimeout(y),b=!0,x=null,n(u,["dblclick","dbltap","vdblclick"],i,{x:a[0],y:a[1]})):(y=setTimeout((function(){b||n(u,["oneclick","onetap","voneclick"],i,{x:a[0],y:a[1]})}),o.multiClickDebounceTime()),x=i.timeStamp)),null!=u||e.dragData.didDrag||e.hoverData.selecting||e.hoverData.dragged||r(i)||(o.$(t).unselect(["tapunselect"]),c.length>0&&e.redrawHint("eles",!0),e.dragData.possibleDragElements=c=o.collection()),l!=u||e.dragData.didDrag||e.hoverData.selecting||null!=l&&l._private.selectable&&(e.hoverData.dragging||("additive"===o.selectionType()||h?l.selected()?l.unselect(["tapunselect"]):l.select(["tapselect"]):h||(o.$(t).unmerge(l).unselect(["tapunselect"]),l.select(["tapselect"]))),e.redrawHint("eles",!0)),e.hoverData.selecting){var v=o.collection(e.getAllInBox(s[0],s[1],s[2],s[3]));e.redrawHint("select",!0),v.length>0&&e.redrawHint("eles",!0),o.emit({type:"boxend",originalEvent:i,position:{x:a[0],y:a[1]}});var g=function(e){return e.selectable()&&!e.selected()};"additive"===o.selectionType()||h||o.$(t).unmerge(v).unselect(),v.emit("box").stdFilter(g).select().emit("boxselect"),e.redraw()}if(e.hoverData.dragging&&(e.hoverData.dragging=!1,e.redrawHint("select",!0),e.redrawHint("eles",!0),e.redraw()),!s[4]){e.redrawHint("drag",!0),e.redrawHint("eles",!0);var m=u&&u.grabbed();d(c),m&&(u.emit("freeon"),c.emit("free"),e.dragData.didDrag&&(u.emit("dragfreeon"),c.emit("dragfree")))}}s[4]=0,e.hoverData.down=null,e.hoverData.cxtStarted=!1,e.hoverData.draggingEles=!1,e.hoverData.selecting=!1,e.hoverData.isOverThresholdDrag=!1,e.dragData.didDrag=!1,e.hoverData.dragged=!1,e.hoverData.dragDelta=[],e.hoverData.mdownPos=null,e.hoverData.mdownGPos=null}}),!1);var E,_,k,S,P,j,C,T,D,N,M,A,R,I=function(t){if(!e.scrollingPage){var n=e.cy,r=n.zoom(),i=n.pan(),o=e.projectIntoViewport(t.clientX,t.clientY),a=[o[0]*r+i.x,o[1]*r+i.y];if(e.hoverData.draggingEles||e.hoverData.dragging||e.hoverData.cxtStarted||0!==e.selection[4])t.preventDefault();else if(n.panningEnabled()&&n.userPanningEnabled()&&n.zoomingEnabled()&&n.userZoomingEnabled()){var s;t.preventDefault(),e.data.wheelZooming=!0,clearTimeout(e.data.wheelTimeout),e.data.wheelTimeout=setTimeout((function(){e.data.wheelZooming=!1,e.redrawHint("eles",!0),e.redraw()}),150),s=null!=t.deltaY?t.deltaY/-250:null!=t.wheelDeltaY?t.wheelDeltaY/1e3:t.wheelDelta/1e3,s*=e.wheelSensitivity,1===t.deltaMode&&(s*=33);var l=n.zoom()*Math.pow(10,s);"gesturechange"===t.type&&(l=e.gestureStartZoom*t.scale),n.zoom({level:l,renderedPosition:{x:a[0],y:a[1]}}),n.emit("gesturechange"===t.type?"pinchzoom":"scrollzoom")}}};e.registerBinding(e.container,"wheel",I,!0),e.registerBinding(window,"scroll",(function(t){e.scrollingPage=!0,clearTimeout(e.scrollingPageTimeout),e.scrollingPageTimeout=setTimeout((function(){e.scrollingPage=!1}),250)}),!0),e.registerBinding(e.container,"gesturestart",(function(t){e.gestureStartZoom=e.cy.zoom(),e.hasTouchStarted||t.preventDefault()}),!0),e.registerBinding(e.container,"gesturechange",(function(t){e.hasTouchStarted||I(t)}),!0),e.registerBinding(e.container,"mouseout",(function(t){var n=e.projectIntoViewport(t.clientX,t.clientY);e.cy.emit({originalEvent:t,type:"mouseout",position:{x:n[0],y:n[1]}})}),!1),e.registerBinding(e.container,"mouseover",(function(t){var n=e.projectIntoViewport(t.clientX,t.clientY);e.cy.emit({originalEvent:t,type:"mouseover",position:{x:n[0],y:n[1]}})}),!1);var L,B,F,z,V,G,H,W=function(e,t,n,r){return Math.sqrt((n-e)*(n-e)+(r-t)*(r-t))},q=function(e,t,n,r){return(n-e)*(n-e)+(r-t)*(r-t)};if(e.registerBinding(e.container,"touchstart",L=function(t){if(e.hasTouchStarted=!0,w(t)){f(),e.touchData.capture=!0,e.data.bgActivePosistion=void 0;var r=e.cy,i=e.touchData.now,o=e.touchData.earlier;if(t.touches[0]){var s=e.projectIntoViewport(t.touches[0].clientX,t.touches[0].clientY);i[0]=s[0],i[1]=s[1]}if(t.touches[1]){s=e.projectIntoViewport(t.touches[1].clientX,t.touches[1].clientY);i[2]=s[0],i[3]=s[1]}if(t.touches[2]){s=e.projectIntoViewport(t.touches[2].clientX,t.touches[2].clientY);i[4]=s[0],i[5]=s[1]}if(t.touches[1]){e.touchData.singleTouchMoved=!0,d(e.dragData.touchDragEles);var c=e.findContainerClientCoords();D=c[0],N=c[1],M=c[2],A=c[3],E=t.touches[0].clientX-D,_=t.touches[0].clientY-N,k=t.touches[1].clientX-D,S=t.touches[1].clientY-N,R=0<=E&&E<=M&&0<=k&&k<=M&&0<=_&&_<=A&&0<=S&&S<=A;var h=r.pan(),p=r.zoom();P=W(E,_,k,S),j=q(E,_,k,S),T=[((C=[(E+k)/2,(_+S)/2])[0]-h.x)/p,(C[1]-h.y)/p];if(j<4e4&&!t.touches[2]){var v=e.findNearestElement(i[0],i[1],!0,!0),g=e.findNearestElement(i[2],i[3],!0,!0);return v&&v.isNode()?(v.activate().emit({originalEvent:t,type:"cxttapstart",position:{x:i[0],y:i[1]}}),e.touchData.start=v):g&&g.isNode()?(g.activate().emit({originalEvent:t,type:"cxttapstart",position:{x:i[0],y:i[1]}}),e.touchData.start=g):r.emit({originalEvent:t,type:"cxttapstart",position:{x:i[0],y:i[1]}}),e.touchData.start&&(e.touchData.start._private.grabbed=!1),e.touchData.cxt=!0,e.touchData.cxtDragged=!1,e.data.bgActivePosistion=void 0,void e.redraw()}}if(t.touches[2])r.boxSelectionEnabled()&&t.preventDefault();else if(t.touches[1]);else if(t.touches[0]){var m=e.findNearestElements(i[0],i[1],!0,!0),y=m[0];if(null!=y&&(y.activate(),e.touchData.start=y,e.touchData.starts=m,e.nodeIsGrabbable(y))){var b=e.dragData.touchDragEles=r.collection(),x=null;e.redrawHint("eles",!0),e.redrawHint("drag",!0),y.selected()?(x=r.$((function(t){return t.selected()&&e.nodeIsGrabbable(t)})),l(x,{addToList:b})):u(y,{addToList:b}),a(y);var O=function(e){return{originalEvent:t,type:e,position:{x:i[0],y:i[1]}}};y.emit(O("grabon")),x?x.forEach((function(e){e.emit(O("grab"))})):y.emit(O("grab"))}n(y,["touchstart","tapstart","vmousedown"],t,{x:i[0],y:i[1]}),null==y&&(e.data.bgActivePosistion={x:s[0],y:s[1]},e.redrawHint("select",!0),e.redraw()),e.touchData.singleTouchMoved=!1,e.touchData.singleTouchStartTime=+new Date,clearTimeout(e.touchData.tapholdTimeout),e.touchData.tapholdTimeout=setTimeout((function(){!1!==e.touchData.singleTouchMoved||e.pinching||e.touchData.selecting||n(e.touchData.start,["taphold"],t,{x:i[0],y:i[1]})}),e.tapholdDuration)}if(t.touches.length>=1){for(var I=e.touchData.startPosition=[],L=0;L<i.length;L++)I[L]=o[L]=i[L];var B=t.touches[0];e.touchData.startGPosition=[B.clientX,B.clientY]}}},!1),e.registerBinding(window,"touchmove",B=function(t){var r=e.touchData.capture;if(r||w(t)){var o=e.selection,a=e.cy,s=e.touchData.now,c=e.touchData.earlier,u=a.zoom();if(t.touches[0]){var h=e.projectIntoViewport(t.touches[0].clientX,t.touches[0].clientY);s[0]=h[0],s[1]=h[1]}if(t.touches[1]){h=e.projectIntoViewport(t.touches[1].clientX,t.touches[1].clientY);s[2]=h[0],s[3]=h[1]}if(t.touches[2]){h=e.projectIntoViewport(t.touches[2].clientX,t.touches[2].clientY);s[4]=h[0],s[5]=h[1]}var f,p=e.touchData.startGPosition;if(r&&t.touches[0]&&p){for(var v=[],g=0;g<s.length;g++)v[g]=s[g]-c[g];var m=t.touches[0].clientX-p[0],y=m*m,b=t.touches[0].clientY-p[1];f=y+b*b>=e.touchTapThreshold2}if(r&&e.touchData.cxt){t.preventDefault();var x=t.touches[0].clientX-D,C=t.touches[0].clientY-N,M=t.touches[1].clientX-D,A=t.touches[1].clientY-N,I=q(x,C,M,A);if(I/j>=2.25||I>=22500){e.touchData.cxt=!1,e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);var L={originalEvent:t,type:"cxttapend",position:{x:s[0],y:s[1]}};e.touchData.start?(e.touchData.start.unactivate().emit(L),e.touchData.start=null):a.emit(L)}}if(r&&e.touchData.cxt){L={originalEvent:t,type:"cxtdrag",position:{x:s[0],y:s[1]}};e.data.bgActivePosistion=void 0,e.redrawHint("select",!0),e.touchData.start?e.touchData.start.emit(L):a.emit(L),e.touchData.start&&(e.touchData.start._private.grabbed=!1),e.touchData.cxtDragged=!0;var B=e.findNearestElement(s[0],s[1],!0,!0);e.touchData.cxtOver&&B===e.touchData.cxtOver||(e.touchData.cxtOver&&e.touchData.cxtOver.emit({originalEvent:t,type:"cxtdragout",position:{x:s[0],y:s[1]}}),e.touchData.cxtOver=B,B&&B.emit({originalEvent:t,type:"cxtdragover",position:{x:s[0],y:s[1]}}))}else if(r&&t.touches[2]&&a.boxSelectionEnabled())t.preventDefault(),e.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,e.touchData.selecting||a.emit({originalEvent:t,type:"boxstart",position:{x:s[0],y:s[1]}}),e.touchData.selecting=!0,e.touchData.didSelect=!0,o[4]=1,o&&0!==o.length&&void 0!==o[0]?(o[2]=(s[0]+s[2]+s[4])/3,o[3]=(s[1]+s[3]+s[5])/3):(o[0]=(s[0]+s[2]+s[4])/3,o[1]=(s[1]+s[3]+s[5])/3,o[2]=(s[0]+s[2]+s[4])/3+1,o[3]=(s[1]+s[3]+s[5])/3+1),e.redrawHint("select",!0),e.redraw();else if(r&&t.touches[1]&&!e.touchData.didSelect&&a.zoomingEnabled()&&a.panningEnabled()&&a.userZoomingEnabled()&&a.userPanningEnabled()){if(t.preventDefault(),e.data.bgActivePosistion=void 0,e.redrawHint("select",!0),ee=e.dragData.touchDragEles){e.redrawHint("drag",!0);for(var F=0;F<ee.length;F++){var z=ee[F]._private;z.grabbed=!1,z.rscratch.inDragLayer=!1}}var V=e.touchData.start,G=(x=t.touches[0].clientX-D,C=t.touches[0].clientY-N,M=t.touches[1].clientX-D,A=t.touches[1].clientY-N,W(x,C,M,A)),H=G/P;if(R){var Y=(x-E+(M-k))/2,U=(C-_+(A-S))/2,X=a.zoom(),$=X*H,K=a.pan(),Z=T[0]*X+K.x,Q=T[1]*X+K.y,J={x:-$/X*(Z-K.x-Y)+Z,y:-$/X*(Q-K.y-U)+Q};if(V&&V.active()){var ee=e.dragData.touchDragEles;d(ee),e.redrawHint("drag",!0),e.redrawHint("eles",!0),V.unactivate().emit("freeon"),ee.emit("free"),e.dragData.didDrag&&(V.emit("dragfreeon"),ee.emit("dragfree"))}a.viewport({zoom:$,pan:J,cancelOnFailedZoom:!0}),a.emit("pinchzoom"),P=G,E=x,_=C,k=M,S=A,e.pinching=!0}if(t.touches[0]){h=e.projectIntoViewport(t.touches[0].clientX,t.touches[0].clientY);s[0]=h[0],s[1]=h[1]}if(t.touches[1]){h=e.projectIntoViewport(t.touches[1].clientX,t.touches[1].clientY);s[2]=h[0],s[3]=h[1]}if(t.touches[2]){h=e.projectIntoViewport(t.touches[2].clientX,t.touches[2].clientY);s[4]=h[0],s[5]=h[1]}}else if(t.touches[0]&&!e.touchData.didSelect){var te=e.touchData.start,ne=e.touchData.last;if(e.hoverData.draggingEles||e.swipePanning||(B=e.findNearestElement(s[0],s[1],!0,!0)),r&&null!=te&&t.preventDefault(),r&&null!=te&&e.nodeIsDraggable(te))if(f){ee=e.dragData.touchDragEles;var re=!e.dragData.didDrag;re&&l(ee,{inDragLayer:!0}),e.dragData.didDrag=!0;var ie={x:0,y:0};if(O(v[0])&&O(v[1]))if(ie.x+=v[0],ie.y+=v[1],re)e.redrawHint("eles",!0),(oe=e.touchData.dragDelta)&&O(oe[0])&&O(oe[1])&&(ie.x+=oe[0],ie.y+=oe[1]);e.hoverData.draggingEles=!0,ee.silentShift(ie).emit("position drag"),e.redrawHint("drag",!0),e.touchData.startPosition[0]==c[0]&&e.touchData.startPosition[1]==c[1]&&e.redrawHint("eles",!0),e.redraw()}else{var oe;0===(oe=e.touchData.dragDelta=e.touchData.dragDelta||[]).length?(oe.push(v[0]),oe.push(v[1])):(oe[0]+=v[0],oe[1]+=v[1])}if(n(te||B,["touchmove","tapdrag","vmousemove"],t,{x:s[0],y:s[1]}),te&&te.grabbed()||B==ne||(ne&&ne.emit({originalEvent:t,type:"tapdragout",position:{x:s[0],y:s[1]}}),B&&B.emit({originalEvent:t,type:"tapdragover",position:{x:s[0],y:s[1]}})),e.touchData.last=B,r)for(F=0;F<s.length;F++)s[F]&&e.touchData.startPosition[F]&&f&&(e.touchData.singleTouchMoved=!0);if(r&&(null==te||te.pannable())&&a.panningEnabled()&&a.userPanningEnabled()){i(te,e.touchData.starts)&&(t.preventDefault(),e.data.bgActivePosistion||(e.data.bgActivePosistion=nt(e.touchData.startPosition)),e.swipePanning?(a.panBy({x:v[0]*u,y:v[1]*u}),a.emit("dragpan")):f&&(e.swipePanning=!0,a.panBy({x:m*u,y:b*u}),a.emit("dragpan"),te&&(te.unactivate(),e.redrawHint("select",!0),e.touchData.start=null)));h=e.projectIntoViewport(t.touches[0].clientX,t.touches[0].clientY);s[0]=h[0],s[1]=h[1]}}for(g=0;g<s.length;g++)c[g]=s[g];r&&t.touches.length>0&&!e.hoverData.draggingEles&&!e.swipePanning&&null!=e.data.bgActivePosistion&&(e.data.bgActivePosistion=void 0,e.redrawHint("select",!0),e.redraw())}},!1),e.registerBinding(window,"touchcancel",F=function(t){var n=e.touchData.start;e.touchData.capture=!1,n&&n.unactivate()}),e.registerBinding(window,"touchend",z=function(r){var i=e.touchData.start;if(e.touchData.capture){0===r.touches.length&&(e.touchData.capture=!1),r.preventDefault();var o=e.selection;e.swipePanning=!1,e.hoverData.draggingEles=!1;var a,s=e.cy,l=s.zoom(),c=e.touchData.now,u=e.touchData.earlier;if(r.touches[0]){var h=e.projectIntoViewport(r.touches[0].clientX,r.touches[0].clientY);c[0]=h[0],c[1]=h[1]}if(r.touches[1]){h=e.projectIntoViewport(r.touches[1].clientX,r.touches[1].clientY);c[2]=h[0],c[3]=h[1]}if(r.touches[2]){h=e.projectIntoViewport(r.touches[2].clientX,r.touches[2].clientY);c[4]=h[0],c[5]=h[1]}if(i&&i.unactivate(),e.touchData.cxt){if(a={originalEvent:r,type:"cxttapend",position:{x:c[0],y:c[1]}},i?i.emit(a):s.emit(a),!e.touchData.cxtDragged){var f={originalEvent:r,type:"cxttap",position:{x:c[0],y:c[1]}};i?i.emit(f):s.emit(f)}return e.touchData.start&&(e.touchData.start._private.grabbed=!1),e.touchData.cxt=!1,e.touchData.start=null,void e.redraw()}if(!r.touches[2]&&s.boxSelectionEnabled()&&e.touchData.selecting){e.touchData.selecting=!1;var p=s.collection(e.getAllInBox(o[0],o[1],o[2],o[3]));o[0]=void 0,o[1]=void 0,o[2]=void 0,o[3]=void 0,o[4]=0,e.redrawHint("select",!0),s.emit({type:"boxend",originalEvent:r,position:{x:c[0],y:c[1]}});p.emit("box").stdFilter((function(e){return e.selectable()&&!e.selected()})).select().emit("boxselect"),p.nonempty()&&e.redrawHint("eles",!0),e.redraw()}if(null!=i&&i.unactivate(),r.touches[2])e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);else if(r.touches[1]);else if(r.touches[0]);else if(!r.touches[0]){e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);var v=e.dragData.touchDragEles;if(null!=i){var g=i._private.grabbed;d(v),e.redrawHint("drag",!0),e.redrawHint("eles",!0),g&&(i.emit("freeon"),v.emit("free"),e.dragData.didDrag&&(i.emit("dragfreeon"),v.emit("dragfree"))),n(i,["touchend","tapend","vmouseup","tapdragout"],r,{x:c[0],y:c[1]}),i.unactivate(),e.touchData.start=null}else{var m=e.findNearestElement(c[0],c[1],!0,!0);n(m,["touchend","tapend","vmouseup","tapdragout"],r,{x:c[0],y:c[1]})}var y=e.touchData.startPosition[0]-c[0],b=y*y,x=e.touchData.startPosition[1]-c[1],w=(b+x*x)*l*l;e.touchData.singleTouchMoved||(i||s.$(":selected").unselect(["tapunselect"]),n(i,["tap","vclick"],r,{x:c[0],y:c[1]}),V=!1,r.timeStamp-H<=s.multiClickDebounceTime()?(G&&clearTimeout(G),V=!0,H=null,n(i,["dbltap","vdblclick"],r,{x:c[0],y:c[1]})):(G=setTimeout((function(){V||n(i,["onetap","voneclick"],r,{x:c[0],y:c[1]})}),s.multiClickDebounceTime()),H=r.timeStamp)),null!=i&&!e.dragData.didDrag&&i._private.selectable&&w<e.touchTapThreshold2&&!e.pinching&&("single"===s.selectionType()?(s.$(t).unmerge(i).unselect(["tapunselect"]),i.select(["tapselect"])):i.selected()?i.unselect(["tapunselect"]):i.select(["tapselect"]),e.redrawHint("eles",!0)),e.touchData.singleTouchMoved=!0}for(var E=0;E<c.length;E++)u[E]=c[E];e.dragData.didDrag=!1,0===r.touches.length&&(e.touchData.dragDelta=[],e.touchData.startPosition=null,e.touchData.startGPosition=null,e.touchData.didSelect=!1),r.touches.length<2&&(1===r.touches.length&&(e.touchData.startGPosition=[r.touches[0].clientX,r.touches[0].clientY]),e.pinching=!1,e.redrawHint("eles",!0),e.redraw())}},!1),"undefined"==typeof TouchEvent){var Y=[],U=function(e){return{clientX:e.clientX,clientY:e.clientY,force:1,identifier:e.pointerId,pageX:e.pageX,pageY:e.pageY,radiusX:e.width/2,radiusY:e.height/2,screenX:e.screenX,screenY:e.screenY,target:e.target}},X=function(e){Y.push(function(e){return{event:e,touch:U(e)}}(e))},$=function(e){for(var t=0;t<Y.length;t++){if(Y[t].event.pointerId===e.pointerId)return void Y.splice(t,1)}},K=function(e){e.touches=Y.map((function(e){return e.touch}))},Z=function(e){return"mouse"===e.pointerType||4===e.pointerType};e.registerBinding(e.container,"pointerdown",(function(e){Z(e)||(e.preventDefault(),X(e),K(e),L(e))})),e.registerBinding(e.container,"pointerup",(function(e){Z(e)||($(e),K(e),z(e))})),e.registerBinding(e.container,"pointercancel",(function(e){Z(e)||($(e),K(e),F())})),e.registerBinding(e.container,"pointermove",(function(e){Z(e)||(e.preventDefault(),function(e){var t=Y.filter((function(t){return t.event.pointerId===e.pointerId}))[0];t.event=e,t.touch=U(e)}(e),K(e),B(e))}))}};var hs={generatePolygon:function(e,t){return this.nodeShapes[e]={renderer:this,name:e,points:t,draw:function(e,t,n,r,i){this.renderer.nodeShapeImpl("polygon",e,t,n,r,i,this.points)},intersectLine:function(e,t,n,r,i,o,a){return Mt(i,o,this.points,e,t,n/2,r/2,a)},checkPoint:function(e,t,n,r,i,o,a){return Pt(e,t,this.points,o,a,r,i,[0,-1],n)}}}};hs.generateEllipse=function(){return this.nodeShapes.ellipse={renderer:this,name:"ellipse",draw:function(e,t,n,r,i){this.renderer.nodeShapeImpl(this.name,e,t,n,r,i)},intersectLine:function(e,t,n,r,i,o,a){return function(e,t,n,r,i,o){var a=n-e,s=r-t;a/=i,s/=o;var l=Math.sqrt(a*a+s*s),c=l-1;if(c<0)return[];var u=c/l;return[(n-e)*u+e,(r-t)*u+t]}(i,o,e,t,n/2+a,r/2+a)},checkPoint:function(e,t,n,r,i,o,a){return Tt(e,t,r,i,o,a,n)}}},hs.generateRoundPolygon=function(e,t){for(var n=new Array(2*t.length),r=0;r<t.length/2;r++){var i=2*r,o=void 0;o=r<t.length/2-1?2*(r+1):0,n[4*r]=t[i],n[4*r+1]=t[i+1];var a=t[o]-t[i],s=t[o+1]-t[i+1],l=Math.sqrt(a*a+s*s);n[4*r+2]=a/l,n[4*r+3]=s/l}return this.nodeShapes[e]={renderer:this,name:e,points:n,draw:function(e,t,n,r,i){this.renderer.nodeShapeImpl("round-polygon",e,t,n,r,i,this.points)},intersectLine:function(e,t,n,r,i,o,a){return function(e,t,n,r,i,o,a,s){for(var l,c=[],u=new Array(n.length),d=o/2,h=a/2,f=Ft(o,a),p=0;p<n.length/4;p++){var v,g=void 0;g=0===p?n.length-2:4*p-2,v=4*p+2;var m=r+d*n[4*p],y=i+h*n[4*p+1],b=-n[g]*n[v]-n[g+1]*n[v+1],x=f/Math.tan(Math.acos(b)/2),w=m-x*n[g],E=y-x*n[g+1],_=m+x*n[v],k=y+x*n[v+1];0===p?(u[n.length-2]=w,u[n.length-1]=E):(u[4*p-2]=w,u[4*p-1]=E),u[4*p]=_,u[4*p+1]=k;var S=n[g+1],P=-n[g];S*n[v]+P*n[v+1]<0&&(S*=-1,P*=-1),0!==(l=Dt(e,t,r,i,w+S*f,E+P*f,f)).length&&c.push(l[0],l[1])}for(var j=0;j<u.length/4;j++)0!==(l=Ot(e,t,r,i,u[4*j],u[4*j+1],u[4*j+2],u[4*j+3],!1)).length&&c.push(l[0],l[1]);if(c.length>2){for(var C=[c[0],c[1]],T=Math.pow(C[0]-e,2)+Math.pow(C[1]-t,2),D=1;D<c.length/2;D++){var N=Math.pow(c[2*D]-e,2)+Math.pow(c[2*D+1]-t,2);N<=T&&(C[0]=c[2*D],C[1]=c[2*D+1],T=N)}return C}return c}(i,o,this.points,e,t,n,r)},checkPoint:function(e,t,n,r,i,o,a){return function(e,t,n,r,i,o,a){for(var s=new Array(n.length),l=o/2,c=a/2,u=Ft(o,a),d=u*u,h=0;h<n.length/4;h++){var f,p=void 0;p=0===h?n.length-2:4*h-2,f=4*h+2;var v=r+l*n[4*h],g=i+c*n[4*h+1],m=-n[p]*n[f]-n[p+1]*n[f+1],y=u/Math.tan(Math.acos(m)/2),b=v-y*n[p],x=g-y*n[p+1],w=v+y*n[f],E=g+y*n[f+1];s[4*h]=b,s[4*h+1]=x,s[4*h+2]=w,s[4*h+3]=E;var _=n[p+1],k=-n[p];_*n[f]+k*n[f+1]<0&&(_*=-1,k*=-1);var S=b+_*u,P=x+k*u;if(Math.pow(S-e,2)+Math.pow(P-t,2)<=d)return!0}return St(e,t,s)}(e,t,this.points,o,a,r,i)}}},hs.generateRoundRectangle=function(){return this.nodeShapes["round-rectangle"]=this.nodeShapes.roundrectangle={renderer:this,name:"round-rectangle",points:Rt(4,0),draw:function(e,t,n,r,i){this.renderer.nodeShapeImpl(this.name,e,t,n,r,i)},intersectLine:function(e,t,n,r,i,o,a){return xt(i,o,e,t,n,r,a)},checkPoint:function(e,t,n,r,i,o,a){var s=Bt(r,i),l=2*s;return!!Pt(e,t,this.points,o,a,r,i-l,[0,-1],n)||(!!Pt(e,t,this.points,o,a,r-l,i,[0,-1],n)||(!!Tt(e,t,l,l,o-r/2+s,a-i/2+s,n)||(!!Tt(e,t,l,l,o+r/2-s,a-i/2+s,n)||(!!Tt(e,t,l,l,o+r/2-s,a+i/2-s,n)||!!Tt(e,t,l,l,o-r/2+s,a+i/2-s,n)))))}}},hs.generateCutRectangle=function(){return this.nodeShapes["cut-rectangle"]=this.nodeShapes.cutrectangle={renderer:this,name:"cut-rectangle",cornerLength:8,points:Rt(4,0),draw:function(e,t,n,r,i){this.renderer.nodeShapeImpl(this.name,e,t,n,r,i)},generateCutTrianglePts:function(e,t,n,r){var i=this.cornerLength,o=t/2,a=e/2,s=n-a,l=n+a,c=r-o,u=r+o;return{topLeft:[s,c+i,s+i,c,s+i,c+i],topRight:[l-i,c,l,c+i,l-i,c+i],bottomRight:[l,u-i,l-i,u,l-i,u-i],bottomLeft:[s+i,u,s,u-i,s+i,u-i]}},intersectLine:function(e,t,n,r,i,o,a){var s=this.generateCutTrianglePts(n+2*a,r+2*a,e,t),l=[].concat.apply([],[s.topLeft.splice(0,4),s.topRight.splice(0,4),s.bottomRight.splice(0,4),s.bottomLeft.splice(0,4)]);return Mt(i,o,l,e,t)},checkPoint:function(e,t,n,r,i,o,a){if(Pt(e,t,this.points,o,a,r,i-2*this.cornerLength,[0,-1],n))return!0;if(Pt(e,t,this.points,o,a,r-2*this.cornerLength,i,[0,-1],n))return!0;var s=this.generateCutTrianglePts(r,i,o,a);return St(e,t,s.topLeft)||St(e,t,s.topRight)||St(e,t,s.bottomRight)||St(e,t,s.bottomLeft)}}},hs.generateBarrel=function(){return this.nodeShapes.barrel={renderer:this,name:"barrel",points:Rt(4,0),draw:function(e,t,n,r,i){this.renderer.nodeShapeImpl(this.name,e,t,n,r,i)},intersectLine:function(e,t,n,r,i,o,a){var s=this.generateBarrelBezierPts(n+2*a,r+2*a,e,t),l=function(e){var t=ut({x:e[0],y:e[1]},{x:e[2],y:e[3]},{x:e[4],y:e[5]},.15),n=ut({x:e[0],y:e[1]},{x:e[2],y:e[3]},{x:e[4],y:e[5]},.5),r=ut({x:e[0],y:e[1]},{x:e[2],y:e[3]},{x:e[4],y:e[5]},.85);return[e[0],e[1],t.x,t.y,n.x,n.y,r.x,r.y,e[4],e[5]]},c=[].concat(l(s.topLeft),l(s.topRight),l(s.bottomRight),l(s.bottomLeft));return Mt(i,o,c,e,t)},generateBarrelBezierPts:function(e,t,n,r){var i=t/2,o=e/2,a=n-o,s=n+o,l=r-i,c=r+i,u=zt(e,t),d=u.heightOffset,h=u.widthOffset,f=u.ctrlPtOffsetPct*e,p={topLeft:[a,l+d,a+f,l,a+h,l],topRight:[s-h,l,s-f,l,s,l+d],bottomRight:[s,c-d,s-f,c,s-h,c],bottomLeft:[a+h,c,a+f,c,a,c-d]};return p.topLeft.isTop=!0,p.topRight.isTop=!0,p.bottomLeft.isBottom=!0,p.bottomRight.isBottom=!0,p},checkPoint:function(e,t,n,r,i,o,a){var s=zt(r,i),l=s.heightOffset,c=s.widthOffset;if(Pt(e,t,this.points,o,a,r,i-2*l,[0,-1],n))return!0;if(Pt(e,t,this.points,o,a,r-2*c,i,[0,-1],n))return!0;for(var u=this.generateBarrelBezierPts(r,i,o,a),d=function(e,t,n){var r,i,o=n[4],a=n[2],s=n[0],l=n[5],c=n[1],u=Math.min(o,s),d=Math.max(o,s),h=Math.min(l,c),f=Math.max(l,c);if(u<=e&&e<=d&&h<=t&&t<=f){var p=[(r=o)-2*(i=a)+s,2*(i-r),r],v=function(e,t,n,r){var i=t*t-4*e*(n-=r);if(i<0)return[];var o=Math.sqrt(i),a=2*e;return[(-t+o)/a,(-t-o)/a]}(p[0],p[1],p[2],e).filter((function(e){return 0<=e&&e<=1}));if(v.length>0)return v[0]}return null},h=Object.keys(u),f=0;f<h.length;f++){var p=u[h[f]],v=d(e,t,p);if(null!=v){var g=p[5],m=p[3],y=p[1],b=ct(g,m,y,v);if(p.isTop&&b<=t)return!0;if(p.isBottom&&t<=b)return!0}}return!1}}},hs.generateBottomRoundrectangle=function(){return this.nodeShapes["bottom-round-rectangle"]=this.nodeShapes.bottomroundrectangle={renderer:this,name:"bottom-round-rectangle",points:Rt(4,0),draw:function(e,t,n,r,i){this.renderer.nodeShapeImpl(this.name,e,t,n,r,i)},intersectLine:function(e,t,n,r,i,o,a){var s=t-(r/2+a),l=Ot(i,o,e,t,e-(n/2+a),s,e+(n/2+a),s,!1);return l.length>0?l:xt(i,o,e,t,n,r,a)},checkPoint:function(e,t,n,r,i,o,a){var s=Bt(r,i),l=2*s;if(Pt(e,t,this.points,o,a,r,i-l,[0,-1],n))return!0;if(Pt(e,t,this.points,o,a,r-l,i,[0,-1],n))return!0;var c=r/2+2*n,u=i/2+2*n;return!!St(e,t,[o-c,a-u,o-c,a,o+c,a,o+c,a-u])||(!!Tt(e,t,l,l,o+r/2-s,a+i/2-s,n)||!!Tt(e,t,l,l,o-r/2+s,a+i/2-s,n))}}},hs.registerNodeShapes=function(){var e=this.nodeShapes={},t=this;this.generateEllipse(),this.generatePolygon("triangle",Rt(3,0)),this.generateRoundPolygon("round-triangle",Rt(3,0)),this.generatePolygon("rectangle",Rt(4,0)),e.square=e.rectangle,this.generateRoundRectangle(),this.generateCutRectangle(),this.generateBarrel(),this.generateBottomRoundrectangle();var n=[0,1,1,0,0,-1,-1,0];this.generatePolygon("diamond",n),this.generateRoundPolygon("round-diamond",n),this.generatePolygon("pentagon",Rt(5,0)),this.generateRoundPolygon("round-pentagon",Rt(5,0)),this.generatePolygon("hexagon",Rt(6,0)),this.generateRoundPolygon("round-hexagon",Rt(6,0)),this.generatePolygon("heptagon",Rt(7,0)),this.generateRoundPolygon("round-heptagon",Rt(7,0)),this.generatePolygon("octagon",Rt(8,0)),this.generateRoundPolygon("round-octagon",Rt(8,0));var r=new Array(20),i=Lt(5,0),o=Lt(5,Math.PI/5),a=.5*(3-Math.sqrt(5));a*=1.57;for(var s=0;s<o.length/2;s++)o[2*s]*=a,o[2*s+1]*=a;for(s=0;s<5;s++)r[4*s]=i[2*s],r[4*s+1]=i[2*s+1],r[4*s+2]=o[2*s],r[4*s+3]=o[2*s+1];r=It(r),this.generatePolygon("star",r),this.generatePolygon("vee",[-1,-1,0,-.333,1,-1,0,1]),this.generatePolygon("rhomboid",[-1,-1,.333,-1,1,1,-.333,1]),this.nodeShapes.concavehexagon=this.generatePolygon("concave-hexagon",[-1,-.95,-.75,0,-1,.95,1,.95,.75,0,1,-.95]);var l=[-1,-1,.25,-1,1,0,.25,1,-1,1];this.generatePolygon("tag",l),this.generateRoundPolygon("round-tag",l),e.makePolygon=function(e){var n,r="polygon-"+e.join("$");return(n=this[r])?n:t.generatePolygon(r,e)}};var fs={timeToRender:function(){return this.redrawTotalTime/this.redrawCount},redraw:function(e){e=e||Te();var t=this;void 0===t.averageRedrawTime&&(t.averageRedrawTime=0),void 0===t.lastRedrawTime&&(t.lastRedrawTime=0),void 0===t.lastDrawTime&&(t.lastDrawTime=0),t.requestedFrame=!0,t.renderOptions=e},beforeRender:function(e,t){if(!this.destroyed){null==t&&_e("Priority is not optional for beforeRender");var n=this.beforeRenderCallbacks;n.push({fn:e,priority:t}),n.sort((function(e,t){return t.priority-e.priority}))}}},ps=function(e,t,n){for(var r=e.beforeRenderCallbacks,i=0;i<r.length;i++)r[i].fn(t,n)};fs.startRenderLoop=function(){var e=this,t=e.cy;if(!e.renderLoopStarted){e.renderLoopStarted=!0;ne((function n(r){if(!e.destroyed){if(t.batching());else if(e.requestedFrame&&!e.skipFrame){ps(e,!0,r);var i=re();e.render(e.renderOptions);var o=e.lastDrawTime=re();void 0===e.averageRedrawTime&&(e.averageRedrawTime=o-i),void 0===e.redrawCount&&(e.redrawCount=0),e.redrawCount++,void 0===e.redrawTotalTime&&(e.redrawTotalTime=0);var a=o-i;e.redrawTotalTime+=a,e.lastRedrawTime=a,e.averageRedrawTime=e.averageRedrawTime/2+a/2,e.requestedFrame=!1}else ps(e,!1,r);e.skipFrame=!1,ne(n)}}))}};var vs=function(e){this.init(e)},gs=vs.prototype;gs.clientFunctions=["redrawHint","render","renderTo","matchCanvasSize","nodeShapeImpl","arrowShapeImpl"],gs.init=function(e){var t=this;t.options=e,t.cy=e.cy;var n=t.container=e.cy.container();if(w){var r=w.document,i=r.head,o="__________cytoscape_stylesheet",a="__________cytoscape_container",s=null!=r.getElementById(o);if(n.className.indexOf(a)<0&&(n.className=(n.className||"")+" "+a),!s){var l=r.createElement("style");l.id=o,l.innerHTML="."+a+" { position: relative; }",i.insertBefore(l,i.children[0])}"static"===w.getComputedStyle(n).getPropertyValue("position")&&Se("A Cytoscape container has style position:static and so can not use UI extensions properly")}t.selection=[void 0,void 0,void 0,void 0,0],t.bezierProjPcts=[.05,.225,.4,.5,.6,.775,.95],t.hoverData={down:null,last:null,downTime:null,triggerMode:null,dragging:!1,initialPan:[null,null],capture:!1},t.dragData={possibleDragElements:[]},t.touchData={start:null,capture:!1,startPosition:[null,null,null,null,null,null],singleTouchStartTime:null,singleTouchMoved:!0,now:[null,null,null,null,null,null],earlier:[null,null,null,null,null,null]},t.redraws=0,t.showFps=e.showFps,t.debug=e.debug,t.hideEdgesOnViewport=e.hideEdgesOnViewport,t.textureOnViewport=e.textureOnViewport,t.wheelSensitivity=e.wheelSensitivity,t.motionBlurEnabled=e.motionBlur,t.forcedPixelRatio=O(e.pixelRatio)?e.pixelRatio:null,t.motionBlur=e.motionBlur,t.motionBlurOpacity=e.motionBlurOpacity,t.motionBlurTransparency=1-t.motionBlurOpacity,t.motionBlurPxRatio=1,t.mbPxRBlurry=1,t.minMbLowQualFrames=4,t.fullQualityMb=!1,t.clearedForMotionBlur=[],t.desktopTapThreshold=e.desktopTapThreshold,t.desktopTapThreshold2=e.desktopTapThreshold*e.desktopTapThreshold,t.touchTapThreshold=e.touchTapThreshold,t.touchTapThreshold2=e.touchTapThreshold*e.touchTapThreshold,t.tapholdDuration=500,t.bindings=[],t.beforeRenderCallbacks=[],t.beforeRenderPriorities={animations:400,eleCalcs:300,eleTxrDeq:200,lyrTxrDeq:150,lyrTxrSkip:100},t.registerNodeShapes(),t.registerArrowShapes(),t.registerCalculationListeners()},gs.notify=function(e,t){var n=this,r=n.cy;this.destroyed||("init"!==e?"destroy"!==e?(("add"===e||"remove"===e||"move"===e&&r.hasCompoundNodes()||"load"===e||"zorder"===e||"mount"===e)&&n.invalidateCachedZSortedEles(),"viewport"===e&&n.redrawHint("select",!0),"load"!==e&&"resize"!==e&&"mount"!==e||(n.invalidateContainerClientCoordsCache(),n.matchCanvasSize(n.container)),n.redrawHint("eles",!0),n.redrawHint("drag",!0),this.startRenderLoop(),this.redraw()):n.destroy():n.load())},gs.destroy=function(){var e=this;e.destroyed=!0,e.cy.stopAnimationLoop();for(var t=0;t<e.bindings.length;t++){var n=e.bindings[t],r=n.target;(r.off||r.removeEventListener).apply(r,n.args)}if(e.bindings=[],e.beforeRenderCallbacks=[],e.onUpdateEleCalcsFns=[],e.removeObserver&&e.removeObserver.disconnect(),e.styleObserver&&e.styleObserver.disconnect(),e.resizeObserver&&e.resizeObserver.disconnect(),e.labelCalcDiv)try{document.body.removeChild(e.labelCalcDiv)}catch(i){}},gs.isHeadless=function(){return!1},[Xa,cs,us,ds,hs,fs].forEach((function(e){X(gs,e)}));var ms=1e3/60,ys=function(e){return function(){var t=this,n=this.renderer;if(!t.dequeueingSetup){t.dequeueingSetup=!0;var r=c.default((function(){n.redrawHint("eles",!0),n.redrawHint("drag",!0),n.redraw()}),e.deqRedrawThreshold),i=e.priority||Ee;n.beforeRender((function(i,o){var a=re(),s=n.averageRedrawTime,l=n.lastRedrawTime,c=[],u=n.cy.extent(),d=n.getPixelRatio();for(i||n.flushRenderedStyleQueue();;){var h=re(),f=h-a,p=h-o;if(l<ms){var v=ms-(i?s:0);if(p>=e.deqFastCost*v)break}else if(i){if(f>=e.deqCost*l||f>=e.deqAvgCost*s)break}else if(p>=e.deqNoDrawCost*ms)break;var g=e.deq(t,d,u);if(!(g.length>0))break;for(var m=0;m<g.length;m++)c.push(g[m])}c.length>0&&(e.onDeqd(t,c),!i&&e.shouldRedraw(t,c,d,u)&&r())}),i(t))}}},bs=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:xe;v(this,e),this.idsByKey=new Re,this.keyForId=new Re,this.cachesByLvl=new Re,this.lvls=[],this.getKey=t,this.doesEleInvalidateKey=n}return m(e,[{key:"getIdsFor",value:function(e){null==e&&_e("Can not get id list for null key");var t=this.idsByKey,n=this.idsByKey.get(e);return n||(n=new Le,t.set(e,n)),n}},{key:"addIdForKey",value:function(e,t){null!=e&&this.getIdsFor(e).add(t)}},{key:"deleteIdForKey",value:function(e,t){null!=e&&this.getIdsFor(e).delete(t)}},{key:"getNumberOfIdsForKey",value:function(e){return null==e?0:this.getIdsFor(e).size}},{key:"updateKeyMappingFor",value:function(e){var t=e.id(),n=this.keyForId.get(t),r=this.getKey(e);this.deleteIdForKey(n,t),this.addIdForKey(r,t),this.keyForId.set(t,r)}},{key:"deleteKeyMappingFor",value:function(e){var t=e.id(),n=this.keyForId.get(t);this.deleteIdForKey(n,t),this.keyForId.delete(t)}},{key:"keyHasChangedFor",value:function(e){var t=e.id();return this.keyForId.get(t)!==this.getKey(e)}},{key:"isInvalid",value:function(e){return this.keyHasChangedFor(e)||this.doesEleInvalidateKey(e)}},{key:"getCachesAt",value:function(e){var t=this.cachesByLvl,n=this.lvls,r=t.get(e);return r||(r=new Re,t.set(e,r),n.push(e)),r}},{key:"getCache",value:function(e,t){return this.getCachesAt(t).get(e)}},{key:"get",value:function(e,t){var n=this.getKey(e),r=this.getCache(n,t);return null!=r&&this.updateKeyMappingFor(e),r}},{key:"getForCachedKey",value:function(e,t){var n=this.keyForId.get(e.id());return this.getCache(n,t)}},{key:"hasCache",value:function(e,t){return this.getCachesAt(t).has(e)}},{key:"has",value:function(e,t){var n=this.getKey(e);return this.hasCache(n,t)}},{key:"setCache",value:function(e,t,n){n.key=e,this.getCachesAt(t).set(e,n)}},{key:"set",value:function(e,t,n){var r=this.getKey(e);this.setCache(r,t,n),this.updateKeyMappingFor(e)}},{key:"deleteCache",value:function(e,t){this.getCachesAt(t).delete(e)}},{key:"delete",value:function(e,t){var n=this.getKey(e);this.deleteCache(n,t)}},{key:"invalidateKey",value:function(e){var t=this;this.lvls.forEach((function(n){return t.deleteCache(e,n)}))}},{key:"invalidate",value:function(e){var t=e.id(),n=this.keyForId.get(t);this.deleteKeyMappingFor(e);var r=this.doesEleInvalidateKey(e);return r&&this.invalidateKey(n),r||0===this.getNumberOfIdsForKey(n)}}]),e}(),xs={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},ws=De({getKey:null,doesEleInvalidateKey:xe,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:be,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),Es=function(e,t){var n=this;n.renderer=e,n.onDequeues=[];var r=ws(t);X(n,r),n.lookup=new bs(r.getKey,r.doesEleInvalidateKey),n.setupDequeueing()},_s=Es.prototype;_s.reasons=xs,_s.getTextureQueue=function(e){var t=this;return t.eleImgCaches=t.eleImgCaches||{},t.eleImgCaches[e]=t.eleImgCaches[e]||[]},_s.getRetiredTextureQueue=function(e){var t=this.eleImgCaches.retired=this.eleImgCaches.retired||{};return t[e]=t[e]||[]},_s.getElementQueue=function(){return this.eleCacheQueue=this.eleCacheQueue||new u.default((function(e,t){return t.reqs-e.reqs}))},_s.getElementKeyToQueue=function(){return this.eleKeyToCacheQueue=this.eleKeyToCacheQueue||{}},_s.getElement=function(e,t,n,r,i){var o=this,a=this.renderer,s=a.cy.zoom(),l=this.lookup;if(!t||0===t.w||0===t.h||isNaN(t.w)||isNaN(t.h)||!e.visible()||e.removed())return null;if(!o.allowEdgeTxrCaching&&e.isEdge()||!o.allowParentTxrCaching&&e.isParent())return null;if(null==r&&(r=Math.ceil(it(s*n))),r<-4)r=-4;else if(s>=7.99||r>3)return null;var c=Math.pow(2,r),u=t.h*c,d=t.w*c,h=a.eleTextBiggerThanMin(e,c);if(!this.isVisible(e,h))return null;var f,p=l.get(e,r);if(p&&p.invalidated&&(p.invalidated=!1,p.texture.invalidatedWidth-=p.width),p)return p;if(f=u<=25?25:u<=50?50:50*Math.ceil(u/50),u>1024||d>1024)return null;var v=o.getTextureQueue(f),g=v[v.length-2],m=function(){return o.recycleTexture(f,d)||o.addTexture(f,d)};g||(g=v[v.length-1]),g||(g=m()),g.width-g.usedWidth<d&&(g=m());for(var y,b=function(e){return e&&e.scaledLabelShown===h},x=i&&i===xs.dequeue,w=i&&i===xs.highQuality,E=i&&i===xs.downscale,_=r+1;_<=3;_++){var k=l.get(e,_);if(k){y=k;break}}var S=y&&y.level===r+1?y:null,P=function(){g.context.drawImage(S.texture.canvas,S.x,0,S.width,S.height,g.usedWidth,0,d,u)};if(g.context.setTransform(1,0,0,1,0,0),g.context.clearRect(g.usedWidth,0,d,f),b(S))P();else if(b(y)){if(!w)return o.queueElement(e,y.level-1),y;for(var j=y.level;j>r;j--)S=o.getElement(e,t,n,j,xs.downscale);P()}else{var C;if(!x&&!w&&!E)for(var T=r-1;T>=-4;T--){var D=l.get(e,T);if(D){C=D;break}}if(b(C))return o.queueElement(e,r),C;g.context.translate(g.usedWidth,0),g.context.scale(c,c),this.drawElement(g.context,e,t,h,!1),g.context.scale(1/c,1/c),g.context.translate(-g.usedWidth,0)}return p={x:g.usedWidth,texture:g,level:r,scale:c,width:d,height:u,scaledLabelShown:h},g.usedWidth+=Math.ceil(d+8),g.eleCaches.push(p),l.set(e,r,p),o.checkTextureFullness(g),p},_s.invalidateElements=function(e){for(var t=0;t<e.length;t++)this.invalidateElement(e[t])},_s.invalidateElement=function(e){var t=this,n=t.lookup,r=[];if(n.isInvalid(e)){for(var i=-4;i<=3;i++){var o=n.getForCachedKey(e,i);o&&r.push(o)}if(n.invalidate(e))for(var a=0;a<r.length;a++){var s=r[a],l=s.texture;l.invalidatedWidth+=s.width,s.invalidated=!0,t.checkTextureUtility(l)}t.removeFromQueue(e)}},_s.checkTextureUtility=function(e){e.invalidatedWidth>=.2*e.width&&this.retireTexture(e)},_s.checkTextureFullness=function(e){var t=this.getTextureQueue(e.height);e.usedWidth/e.width>.8&&e.fullnessChecks>=10?Ne(t,e):e.fullnessChecks++},_s.retireTexture=function(e){var t=e.height,n=this.getTextureQueue(t),r=this.lookup;Ne(n,e),e.retired=!0;for(var i=e.eleCaches,o=0;o<i.length;o++){var a=i[o];r.deleteCache(a.key,a.level)}Oe(i),this.getRetiredTextureQueue(t).push(e)},_s.addTexture=function(e,t){var n={};return this.getTextureQueue(e).push(n),n.eleCaches=[],n.height=e,n.width=Math.max(1024,t),n.usedWidth=0,n.invalidatedWidth=0,n.fullnessChecks=0,n.canvas=this.renderer.makeOffscreenCanvas(n.width,n.height),n.context=n.canvas.getContext("2d"),n},_s.recycleTexture=function(e,t){for(var n=this.getTextureQueue(e),r=this.getRetiredTextureQueue(e),i=0;i<r.length;i++){var o=r[i];if(o.width>=t)return o.retired=!1,o.usedWidth=0,o.invalidatedWidth=0,o.fullnessChecks=0,Oe(o.eleCaches),o.context.setTransform(1,0,0,1,0,0),o.context.clearRect(0,0,o.width,o.height),Ne(r,o),n.push(o),o}},_s.queueElement=function(e,t){var n=this.getElementQueue(),r=this.getElementKeyToQueue(),i=this.getKey(e),o=r[i];if(o)o.level=Math.max(o.level,t),o.eles.merge(e),o.reqs++,n.updateItem(o);else{var a={eles:e.spawn().merge(e),level:t,reqs:1,key:i};n.push(a),r[i]=a}},_s.dequeue=function(e){for(var t=this,n=t.getElementQueue(),r=t.getElementKeyToQueue(),i=[],o=t.lookup,a=0;a<1&&n.size()>0;a++){var s=n.pop(),l=s.key,c=s.eles[0],u=o.hasCache(c,s.level);if(r[l]=null,!u){i.push(s);var d=t.getBoundingBox(c);t.getElement(c,d,e,s.level,xs.dequeue)}}return i},_s.removeFromQueue=function(e){var t=this.getElementQueue(),n=this.getElementKeyToQueue(),r=this.getKey(e),i=n[r];null!=i&&(1===i.eles.length?(i.reqs=ye,t.updateItem(i),t.pop(),n[r]=null):i.eles.unmerge(e))},_s.onDequeue=function(e){this.onDequeues.push(e)},_s.offDequeue=function(e){Ne(this.onDequeues,e)},_s.setupDequeueing=ys({deqRedrawThreshold:100,deqCost:.15,deqAvgCost:.1,deqNoDrawCost:.9,deqFastCost:.9,deq:function(e,t,n){return e.dequeue(t,n)},onDeqd:function(e,t){for(var n=0;n<e.onDequeues.length;n++){(0,e.onDequeues[n])(t)}},shouldRedraw:function(e,t,n,r){for(var i=0;i<t.length;i++)for(var o=t[i].eles,a=0;a<o.length;a++){var s=o[a].boundingBox();if(mt(s,r))return!0}return!1},priority:function(e){return e.renderer.beforeRenderPriorities.eleTxrDeq}});var ks=function(e){var t=this,n=t.renderer=e,r=n.cy;t.layersByLevel={},t.firstGet=!0,t.lastInvalidationTime=re()-500,t.skipping=!1,t.eleTxrDeqs=r.collection(),t.scheduleElementRefinement=c.default((function(){t.refineElementTextures(t.eleTxrDeqs),t.eleTxrDeqs.unmerge(t.eleTxrDeqs)}),50),n.beforeRender((function(e,n){n-t.lastInvalidationTime<=250?t.skipping=!0:t.skipping=!1}),n.beforeRenderPriorities.lyrTxrSkip);t.layersQueue=new u.default((function(e,t){return t.reqs-e.reqs})),t.setupDequeueing()},Ss=ks.prototype,Ps=0,js=Math.pow(2,53)-1;Ss.makeLayer=function(e,t){var n=Math.pow(2,t),r=Math.ceil(e.w*n),i=Math.ceil(e.h*n),o=this.renderer.makeOffscreenCanvas(r,i),a={id:Ps=++Ps%js,bb:e,level:t,width:r,height:i,canvas:o,context:o.getContext("2d"),eles:[],elesQueue:[],reqs:0},s=a.context,l=-a.bb.x1,c=-a.bb.y1;return s.scale(n,n),s.translate(l,c),a},Ss.getLayers=function(e,t,n){var r=this,i=r.renderer.cy.zoom(),o=r.firstGet;if(r.firstGet=!1,null==n)if((n=Math.ceil(it(i*t)))<-4)n=-4;else if(i>=3.99||n>2)return null;r.validateLayersElesOrdering(n,e);var a,s,l=r.layersByLevel,c=Math.pow(2,n),u=l[n]=l[n]||[];if(r.levelIsComplete(n,e))return u;!function(){var t=function(t){if(r.validateLayersElesOrdering(t,e),r.levelIsComplete(t,e))return s=l[t],!0},i=function(e){if(!s)for(var r=n+e;-4<=r&&r<=2&&!t(r);r+=e);};i(1),i(-1);for(var o=u.length-1;o>=0;o--){var a=u[o];a.invalid&&Ne(u,a)}}();var d=function(t){var i=(t=t||{}).after;if(function(){if(!a){a=ht();for(var t=0;t<e.length;t++)n=a,r=e[t].boundingBox(),n.x1=Math.min(n.x1,r.x1),n.x2=Math.max(n.x2,r.x2),n.w=n.x2-n.x1,n.y1=Math.min(n.y1,r.y1),n.y2=Math.max(n.y2,r.y2),n.h=n.y2-n.y1}var n,r}(),a.w*c*(a.h*c)>16e6)return null;var o=r.makeLayer(a,n);if(null!=i){var s=u.indexOf(i)+1;u.splice(s,0,o)}else(void 0===t.insert||t.insert)&&u.unshift(o);return o};if(r.skipping&&!o)return null;for(var h=null,f=e.length/1,p=!o,v=0;v<e.length;v++){var g=e[v],m=g._private.rscratch,y=m.imgLayerCaches=m.imgLayerCaches||{},b=y[n];if(b)h=b;else{if((!h||h.eles.length>=f||!bt(h.bb,g.boundingBox()))&&!(h=d({insert:!0,after:h})))return null;s||p?r.queueLayer(h,g):r.drawEleInLayer(h,g,n,t),h.eles.push(g),y[n]=h}}return s||(p?null:u)},Ss.getEleLevelForLayerLevel=function(e,t){return e},Ss.drawEleInLayer=function(e,t,n,r){var i=this.renderer,o=e.context,a=t.boundingBox();0!==a.w&&0!==a.h&&t.visible()&&(n=this.getEleLevelForLayerLevel(n,r),i.setImgSmoothing(o,!1),i.drawCachedElement(o,t,null,null,n,true),i.setImgSmoothing(o,!0))},Ss.levelIsComplete=function(e,t){var n=this.layersByLevel[e];if(!n||0===n.length)return!1;for(var r=0,i=0;i<n.length;i++){var o=n[i];if(o.reqs>0)return!1;if(o.invalid)return!1;r+=o.eles.length}return r===t.length},Ss.validateLayersElesOrdering=function(e,t){var n=this.layersByLevel[e];if(n)for(var r=0;r<n.length;r++){for(var i=n[r],o=-1,a=0;a<t.length;a++)if(i.eles[0]===t[a]){o=a;break}if(o<0)this.invalidateLayer(i);else{var s=o;for(a=0;a<i.eles.length;a++)if(i.eles[a]!==t[s+a]){this.invalidateLayer(i);break}}}},Ss.updateElementsInLayers=function(e,t){for(var n=R(e[0]),r=0;r<e.length;r++)for(var i=n?null:e[r],o=n?e[r]:e[r].ele,a=o._private.rscratch,s=a.imgLayerCaches=a.imgLayerCaches||{},l=-4;l<=2;l++){var c=s[l];c&&(i&&this.getEleLevelForLayerLevel(c.level)!==i.level||t(c,o,i))}},Ss.haveLayers=function(){for(var e=!1,t=-4;t<=2;t++){var n=this.layersByLevel[t];if(n&&n.length>0){e=!0;break}}return e},Ss.invalidateElements=function(e){var t=this;0!==e.length&&(t.lastInvalidationTime=re(),0!==e.length&&t.haveLayers()&&t.updateElementsInLayers(e,(function(e,n,r){t.invalidateLayer(e)})))},Ss.invalidateLayer=function(e){if(this.lastInvalidationTime=re(),!e.invalid){var t=e.level,n=e.eles,r=this.layersByLevel[t];Ne(r,e),e.elesQueue=[],e.invalid=!0,e.replacement&&(e.replacement.invalid=!0);for(var i=0;i<n.length;i++){var o=n[i]._private.rscratch.imgLayerCaches;o&&(o[t]=null)}}},Ss.refineElementTextures=function(e){var t=this;t.updateElementsInLayers(e,(function(e,n,r){var i=e.replacement;if(i||((i=e.replacement=t.makeLayer(e.bb,e.level)).replaces=e,i.eles=e.eles),!i.reqs)for(var o=0;o<i.eles.length;o++)t.queueLayer(i,i.eles[o])}))},Ss.enqueueElementRefinement=function(e){this.eleTxrDeqs.merge(e),this.scheduleElementRefinement()},Ss.queueLayer=function(e,t){var n=this.layersQueue,r=e.elesQueue,i=r.hasId=r.hasId||{};if(!e.replacement){if(t){if(i[t.id()])return;r.push(t),i[t.id()]=!0}e.reqs?(e.reqs++,n.updateItem(e)):(e.reqs=1,n.push(e))}},Ss.dequeue=function(e){for(var t=this,n=t.layersQueue,r=[],i=0;i<1&&0!==n.size();){var o=n.peek();if(o.replacement)n.pop();else if(o.replaces&&o!==o.replaces.replacement)n.pop();else if(o.invalid)n.pop();else{var a=o.elesQueue.shift();a&&(t.drawEleInLayer(o,a,o.level,e),i++),0===r.length&&r.push(!0),0===o.elesQueue.length&&(n.pop(),o.reqs=0,o.replaces&&t.applyLayerReplacement(o),t.requestRedraw())}}return r},Ss.applyLayerReplacement=function(e){var t=this.layersByLevel[e.level],n=e.replaces,r=t.indexOf(n);if(!(r<0||n.invalid)){t[r]=e;for(var i=0;i<e.eles.length;i++){var o=e.eles[i]._private,a=o.imgLayerCaches=o.imgLayerCaches||{};a&&(a[e.level]=e)}this.requestRedraw()}},Ss.requestRedraw=c.default((function(){var e=this.renderer;e.redrawHint("eles",!0),e.redrawHint("drag",!0),e.redraw()}),100),Ss.setupDequeueing=ys({deqRedrawThreshold:50,deqCost:.15,deqAvgCost:.1,deqNoDrawCost:.9,deqFastCost:.9,deq:function(e,t){return e.dequeue(t)},onDeqd:Ee,shouldRedraw:be,priority:function(e){return e.renderer.beforeRenderPriorities.lyrTxrDeq}});var Cs,Ts={};function Ds(e,t){for(var n=0;n<t.length;n++){var r=t[n];e.lineTo(r.x,r.y)}}function Ns(e,t,n){for(var r,i=0;i<t.length;i++){var o=t[i];0===i&&(r=o),e.lineTo(o.x,o.y)}e.quadraticCurveTo(n.x,n.y,r.x,r.y)}function Os(e,t,n){e.beginPath&&e.beginPath();for(var r=t,i=0;i<r.length;i++){var o=r[i];e.lineTo(o.x,o.y)}var a=n,s=n[0];e.moveTo(s.x,s.y);for(i=1;i<a.length;i++){o=a[i];e.lineTo(o.x,o.y)}e.closePath&&e.closePath()}function Ms(e,t,n,r,i){e.beginPath&&e.beginPath(),e.arc(n,r,i,0,2*Math.PI,!1);var o=t,a=o[0];e.moveTo(a.x,a.y);for(var s=0;s<o.length;s++){var l=o[s];e.lineTo(l.x,l.y)}e.closePath&&e.closePath()}function As(e,t,n,r){e.arc(t,n,r,0,2*Math.PI,!1)}Ts.arrowShapeImpl=function(e){return(Cs||(Cs={polygon:Ds,"triangle-backcurve":Ns,"triangle-tee":Os,"circle-triangle":Ms,"triangle-cross":Os,circle:As}))[e]};var Rs={drawElement:function(e,t,n,r,i,o){t.isNode()?this.drawNode(e,t,n,r,i,o):this.drawEdge(e,t,n,r,i,o)},drawElementOverlay:function(e,t){t.isNode()?this.drawNodeOverlay(e,t):this.drawEdgeOverlay(e,t)},drawElementUnderlay:function(e,t){t.isNode()?this.drawNodeUnderlay(e,t):this.drawEdgeUnderlay(e,t)},drawCachedElementPortion:function(e,t,n,r,i,o,a,s){var l=this,c=n.getBoundingBox(t);if(0!==c.w&&0!==c.h){var u=n.getElement(t,c,r,i,o);if(null!=u){var d=s(l,t);if(0===d)return;var h,f,p,v,g,m,y=a(l,t),b=c.x1,x=c.y1,w=c.w,E=c.h;if(0!==y){var _=n.getRotationPoint(t);p=_.x,v=_.y,e.translate(p,v),e.rotate(y),(g=l.getImgSmoothing(e))||l.setImgSmoothing(e,!0);var k=n.getRotationOffset(t);h=k.x,f=k.y}else h=b,f=x;1!==d&&(m=e.globalAlpha,e.globalAlpha=m*d),e.drawImage(u.texture.canvas,u.x,0,u.width,u.height,h,f,w,E),1!==d&&(e.globalAlpha=m),0!==y&&(e.rotate(-y),e.translate(-p,-v),g||l.setImgSmoothing(e,!1))}else n.drawElement(e,t)}}},Is=function(){return 0},Ls=function(e,t){return e.getTextAngle(t,null)},Bs=function(e,t){return e.getTextAngle(t,"source")},Fs=function(e,t){return e.getTextAngle(t,"target")},zs=function(e,t){return t.effectiveOpacity()},Vs=function(e,t){return t.pstyle("text-opacity").pfValue*t.effectiveOpacity()};Rs.drawCachedElement=function(e,t,n,r,i,o){var a=this,s=a.data,l=s.eleTxrCache,c=s.lblTxrCache,u=s.slbTxrCache,d=s.tlbTxrCache,h=t.boundingBox(),f=!0===o?l.reasons.highQuality:null;if(0!==h.w&&0!==h.h&&t.visible()&&(!r||mt(h,r))){var p=t.isEdge(),v=t.element()._private.rscratch.badLine;a.drawElementUnderlay(e,t),a.drawCachedElementPortion(e,t,l,n,i,f,Is,zs),p&&v||a.drawCachedElementPortion(e,t,c,n,i,f,Ls,Vs),p&&!v&&(a.drawCachedElementPortion(e,t,u,n,i,f,Bs,Vs),a.drawCachedElementPortion(e,t,d,n,i,f,Fs,Vs)),a.drawElementOverlay(e,t)}},Rs.drawElements=function(e,t){for(var n=0;n<t.length;n++){var r=t[n];this.drawElement(e,r)}},Rs.drawCachedElements=function(e,t,n,r){for(var i=0;i<t.length;i++){var o=t[i];this.drawCachedElement(e,o,n,r)}},Rs.drawCachedNodes=function(e,t,n,r){for(var i=0;i<t.length;i++){var o=t[i];o.isNode()&&this.drawCachedElement(e,o,n,r)}},Rs.drawLayeredElements=function(e,t,n,r){var i=this.data.lyrTxrCache.getLayers(t,n);if(i)for(var o=0;o<i.length;o++){var a=i[o],s=a.bb;0!==s.w&&0!==s.h&&e.drawImage(a.canvas,s.x1,s.y1,s.w,s.h)}else this.drawCachedElements(e,t,n,r)};var Gs={drawEdge:function(e,t,n){var r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],o=!(arguments.length>5&&void 0!==arguments[5])||arguments[5],a=this,s=t._private.rscratch;if((!o||t.visible())&&!s.badLine&&null!=s.allpts&&!isNaN(s.allpts[0])){var l;n&&(l=n,e.translate(-l.x1,-l.y1));var c=o?t.pstyle("opacity").value:1,u=o?t.pstyle("line-opacity").value:1,d=t.pstyle("curve-style").value,h=t.pstyle("line-style").value,f=t.pstyle("width").pfValue,p=t.pstyle("line-cap").value,v=c*u,g=c*u,m=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:v;"straight-triangle"===d?(a.eleStrokeStyle(e,t,n),a.drawEdgeTrianglePath(t,e,s.allpts)):(e.lineWidth=f,e.lineCap=p,a.eleStrokeStyle(e,t,n),a.drawEdgePath(t,e,s.allpts,h),e.lineCap="butt")},y=function(){i&&a.drawEdgeOverlay(e,t)},b=function(){i&&a.drawEdgeUnderlay(e,t)},x=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:g;a.drawArrowheads(e,t,n)},w=function(){a.drawElementText(e,t,null,r)};e.lineJoin="round";var E="yes"===t.pstyle("ghost").value;if(E){var _=t.pstyle("ghost-offset-x").pfValue,k=t.pstyle("ghost-offset-y").pfValue,S=t.pstyle("ghost-opacity").value,P=v*S;e.translate(_,k),m(P),x(P),e.translate(-_,-k)}b(),m(),x(),y(),w(),n&&e.translate(l.x1,l.y1)}}},Hs=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(t,n){if(n.visible()){var r=n.pstyle("".concat(e,"-opacity")).value;if(0!==r){var i=this,o=i.usePaths(),a=n._private.rscratch,s=2*n.pstyle("".concat(e,"-padding")).pfValue,l=n.pstyle("".concat(e,"-color")).value;t.lineWidth=s,"self"!==a.edgeType||o?t.lineCap="round":t.lineCap="butt",i.colorStrokeStyle(t,l[0],l[1],l[2],r),i.drawEdgePath(n,t,a.allpts,"solid")}}}};Gs.drawEdgeOverlay=Hs("overlay"),Gs.drawEdgeUnderlay=Hs("underlay"),Gs.drawEdgePath=function(e,t,n,r){var i,o=e._private.rscratch,a=t,s=!1,l=this.usePaths(),c=e.pstyle("line-dash-pattern").pfValue,u=e.pstyle("line-dash-offset").pfValue;if(l){var d=n.join("$");o.pathCacheKey&&o.pathCacheKey===d?(i=t=o.pathCache,s=!0):(i=t=new Path2D,o.pathCacheKey=d,o.pathCache=i)}if(a.setLineDash)switch(r){case"dotted":a.setLineDash([1,1]);break;case"dashed":a.setLineDash(c),a.lineDashOffset=u;break;case"solid":a.setLineDash([])}if(!s&&!o.badLine)switch(t.beginPath&&t.beginPath(),t.moveTo(n[0],n[1]),o.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var h=2;h+3<n.length;h+=4)t.quadraticCurveTo(n[h],n[h+1],n[h+2],n[h+3]);break;case"straight":case"segments":case"haystack":for(var f=2;f+1<n.length;f+=2)t.lineTo(n[f],n[f+1])}t=a,l?t.stroke(i):t.stroke(),t.setLineDash&&t.setLineDash([])},Gs.drawEdgeTrianglePath=function(e,t,n){t.fillStyle=t.strokeStyle;for(var r=e.pstyle("width").pfValue,i=0;i+1<n.length;i+=2){var o=[n[i+2]-n[i],n[i+3]-n[i+1]],a=Math.sqrt(o[0]*o[0]+o[1]*o[1]),s=[o[1]/a,-o[0]/a],l=[s[0]*r/2,s[1]*r/2];t.beginPath(),t.moveTo(n[i]-l[0],n[i+1]-l[1]),t.lineTo(n[i]+l[0],n[i+1]+l[1]),t.lineTo(n[i+2],n[i+3]),t.closePath(),t.fill()}},Gs.drawArrowheads=function(e,t,n){var r=t._private.rscratch,i="haystack"===r.edgeType;i||this.drawArrowhead(e,t,"source",r.arrowStartX,r.arrowStartY,r.srcArrowAngle,n),this.drawArrowhead(e,t,"mid-target",r.midX,r.midY,r.midtgtArrowAngle,n),this.drawArrowhead(e,t,"mid-source",r.midX,r.midY,r.midsrcArrowAngle,n),i||this.drawArrowhead(e,t,"target",r.arrowEndX,r.arrowEndY,r.tgtArrowAngle,n)},Gs.drawArrowhead=function(e,t,n,r,i,o,a){if(!(isNaN(r)||null==r||isNaN(i)||null==i||isNaN(o)||null==o)){var s=this,l=t.pstyle(n+"-arrow-shape").value;if("none"!==l){var c="hollow"===t.pstyle(n+"-arrow-fill").value?"both":"filled",u=t.pstyle(n+"-arrow-fill").value,d=t.pstyle("width").pfValue,h=t.pstyle("opacity").value;void 0===a&&(a=h);var f=e.globalCompositeOperation;1===a&&"hollow"!==u||(e.globalCompositeOperation="destination-out",s.colorFillStyle(e,255,255,255,1),s.colorStrokeStyle(e,255,255,255,1),s.drawArrowShape(t,e,c,d,l,r,i,o),e.globalCompositeOperation=f);var p=t.pstyle(n+"-arrow-color").value;s.colorFillStyle(e,p[0],p[1],p[2],a),s.colorStrokeStyle(e,p[0],p[1],p[2],a),s.drawArrowShape(t,e,u,d,l,r,i,o)}}},Gs.drawArrowShape=function(e,t,n,r,i,o,a,s){var l,c=this,u=this.usePaths()&&"triangle-cross"!==i,d=!1,h=t,f={x:o,y:a},p=e.pstyle("arrow-scale").value,v=this.getArrowWidth(r,p),g=c.arrowShapes[i];if(u){var m=c.arrowPathCache=c.arrowPathCache||[],y=he(i),b=m[y];null!=b?(l=t=b,d=!0):(l=t=new Path2D,m[y]=l)}d||(t.beginPath&&t.beginPath(),u?g.draw(t,1,0,{x:0,y:0},1):g.draw(t,v,s,f,r),t.closePath&&t.closePath()),t=h,u&&(t.translate(o,a),t.rotate(s),t.scale(v,v)),"filled"!==n&&"both"!==n||(u?t.fill(l):t.fill()),"hollow"!==n&&"both"!==n||(t.lineWidth=(g.matchEdgeWidth?r:1)/(u?v:1),t.lineJoin="miter",u?t.stroke(l):t.stroke()),u&&(t.scale(1/v,1/v),t.rotate(-s),t.translate(-o,-a))};var Ws={safeDrawImage:function(e,t,n,r,i,o,a,s,l,c){if(!(i<=0||o<=0||l<=0||c<=0))try{e.drawImage(t,n,r,i,o,a,s,l,c)}catch(u){Se(u)}},drawInscribedImage:function(e,t,n,r,i){var o=this,a=n.position(),s=a.x,l=a.y,c=n.cy().style(),u=c.getIndexedStyle.bind(c),d=u(n,"background-fit","value",r),h=u(n,"background-repeat","value",r),f=n.width(),p=n.height(),v=2*n.padding(),g=f+("inner"===u(n,"background-width-relative-to","value",r)?0:v),m=p+("inner"===u(n,"background-height-relative-to","value",r)?0:v),y=n._private.rscratch,b="node"===u(n,"background-clip","value",r),x=u(n,"background-image-opacity","value",r)*i,w=u(n,"background-image-smoothing","value",r),E=t.width||t.cachedW,_=t.height||t.cachedH;null!=E&&null!=_||(document.body.appendChild(t),E=t.cachedW=t.width||t.offsetWidth,_=t.cachedH=t.height||t.offsetHeight,document.body.removeChild(t));var k=E,S=_;if("auto"!==u(n,"background-width","value",r)&&(k="%"===u(n,"background-width","units",r)?u(n,"background-width","pfValue",r)*g:u(n,"background-width","pfValue",r)),"auto"!==u(n,"background-height","value",r)&&(S="%"===u(n,"background-height","units",r)?u(n,"background-height","pfValue",r)*m:u(n,"background-height","pfValue",r)),0!==k&&0!==S){if("contain"===d)k*=P=Math.min(g/k,m/S),S*=P;else if("cover"===d){var P;k*=P=Math.max(g/k,m/S),S*=P}var j=s-g/2,C=u(n,"background-position-x","units",r),T=u(n,"background-position-x","pfValue",r);j+="%"===C?(g-k)*T:T;var D=u(n,"background-offset-x","units",r),N=u(n,"background-offset-x","pfValue",r);j+="%"===D?(g-k)*N:N;var O=l-m/2,M=u(n,"background-position-y","units",r),A=u(n,"background-position-y","pfValue",r);O+="%"===M?(m-S)*A:A;var R=u(n,"background-offset-y","units",r),I=u(n,"background-offset-y","pfValue",r);O+="%"===R?(m-S)*I:I,y.pathCache&&(j-=s,O-=l,s=0,l=0);var L=e.globalAlpha;e.globalAlpha=x;var B=o.getImgSmoothing(e),F=!1;if("no"===w&&B?(o.setImgSmoothing(e,!1),F=!0):"yes"!==w||B||(o.setImgSmoothing(e,!0),F=!0),"no-repeat"===h)b&&(e.save(),y.pathCache?e.clip(y.pathCache):(o.nodeShapes[o.getNodeShape(n)].draw(e,s,l,g,m),e.clip())),o.safeDrawImage(e,t,0,0,E,_,j,O,k,S),b&&e.restore();else{var z=e.createPattern(t,h);e.fillStyle=z,o.nodeShapes[o.getNodeShape(n)].draw(e,s,l,g,m),e.translate(j,O),e.fill(),e.translate(-j,-O)}e.globalAlpha=L,F&&o.setImgSmoothing(e,B)}}},qs={};function Ys(e,t,n,r,i){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:5;e.beginPath(),e.moveTo(t+o,n),e.lineTo(t+r-o,n),e.quadraticCurveTo(t+r,n,t+r,n+o),e.lineTo(t+r,n+i-o),e.quadraticCurveTo(t+r,n+i,t+r-o,n+i),e.lineTo(t+o,n+i),e.quadraticCurveTo(t,n+i,t,n+i-o),e.lineTo(t,n+o),e.quadraticCurveTo(t,n,t+o,n),e.closePath(),e.fill()}qs.eleTextBiggerThanMin=function(e,t){if(!t){var n=e.cy().zoom(),r=this.getPixelRatio(),i=Math.ceil(it(n*r));t=Math.pow(2,i)}return!(e.pstyle("font-size").pfValue*t<e.pstyle("min-zoomed-font-size").pfValue)},qs.drawElementText=function(e,t,n,r,i){var o=!(arguments.length>5&&void 0!==arguments[5])||arguments[5],a=this;if(null==r){if(o&&!a.eleTextBiggerThanMin(t))return}else if(!1===r)return;if(t.isNode()){var s=t.pstyle("label");if(!s||!s.value)return;var l=a.getLabelJustification(t);e.textAlign=l,e.textBaseline="bottom"}else{var c=t.element()._private.rscratch.badLine,u=t.pstyle("label"),d=t.pstyle("source-label"),h=t.pstyle("target-label");if(c||(!u||!u.value)&&(!d||!d.value)&&(!h||!h.value))return;e.textAlign="center",e.textBaseline="bottom"}var f,p=!n;n&&(f=n,e.translate(-f.x1,-f.y1)),null==i?(a.drawText(e,t,null,p,o),t.isEdge()&&(a.drawText(e,t,"source",p,o),a.drawText(e,t,"target",p,o))):a.drawText(e,t,i,p,o),n&&e.translate(f.x1,f.y1)},qs.getFontCache=function(e){var t;this.fontCaches=this.fontCaches||[];for(var n=0;n<this.fontCaches.length;n++)if((t=this.fontCaches[n]).context===e)return t;return t={context:e},this.fontCaches.push(t),t},qs.setupTextStyle=function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=t.pstyle("font-style").strValue,i=t.pstyle("font-size").pfValue+"px",o=t.pstyle("font-family").strValue,a=t.pstyle("font-weight").strValue,s=n?t.effectiveOpacity()*t.pstyle("text-opacity").value:1,l=t.pstyle("text-outline-opacity").value*s,c=t.pstyle("color").value,u=t.pstyle("text-outline-color").value;e.font=r+" "+a+" "+i+" "+o,e.lineJoin="round",this.colorFillStyle(e,c[0],c[1],c[2],s),this.colorStrokeStyle(e,u[0],u[1],u[2],l)},qs.getTextAngle=function(e,t){var n=e._private.rscratch,r=t?t+"-":"",i=e.pstyle(r+"text-rotation"),o=Me(n,"labelAngle",t);return"autorotate"===i.strValue?e.isEdge()?o:0:"none"===i.strValue?0:i.pfValue},qs.drawText=function(e,t,n){var r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],o=t._private,a=o.rscratch,s=i?t.effectiveOpacity():1;if(!i||0!==s&&0!==t.pstyle("text-opacity").value){"main"===n&&(n=null);var l,c,u=Me(a,"labelX",n),d=Me(a,"labelY",n),h=this.getLabelText(t,n);if(null!=h&&""!==h&&!isNaN(u)&&!isNaN(d)){this.setupTextStyle(e,t,i);var f,p=n?n+"-":"",v=Me(a,"labelWidth",n),g=Me(a,"labelHeight",n),m=t.pstyle(p+"text-margin-x").pfValue,y=t.pstyle(p+"text-margin-y").pfValue,b=t.isEdge(),x=t.pstyle("text-halign").value,w=t.pstyle("text-valign").value;switch(b&&(x="center",w="center"),u+=m,d+=y,0!==(f=r?this.getTextAngle(t,n):0)&&(l=u,c=d,e.translate(l,c),e.rotate(f),u=0,d=0),w){case"top":break;case"center":d+=g/2;break;case"bottom":d+=g}var E=t.pstyle("text-background-opacity").value,_=t.pstyle("text-border-opacity").value,k=t.pstyle("text-border-width").pfValue,S=t.pstyle("text-background-padding").pfValue;if(E>0||k>0&&_>0){var P=u-S;switch(x){case"left":P-=v;break;case"center":P-=v/2}var j=d-g-S,C=v+2*S,T=g+2*S;if(E>0){var D=e.fillStyle,N=t.pstyle("text-background-color").value;e.fillStyle="rgba("+N[0]+","+N[1]+","+N[2]+","+E*s+")";var O=t.pstyle("text-background-shape").strValue;0===O.indexOf("round")?Ys(e,P,j,C,T,2):e.fillRect(P,j,C,T),e.fillStyle=D}if(k>0&&_>0){var M=e.strokeStyle,A=e.lineWidth,R=t.pstyle("text-border-color").value,I=t.pstyle("text-border-style").value;if(e.strokeStyle="rgba("+R[0]+","+R[1]+","+R[2]+","+_*s+")",e.lineWidth=k,e.setLineDash)switch(I){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash([4,2]);break;case"double":e.lineWidth=k/4,e.setLineDash([]);break;case"solid":e.setLineDash([])}if(e.strokeRect(P,j,C,T),"double"===I){var L=k/2;e.strokeRect(P+L,j+L,C-2*L,T-2*L)}e.setLineDash&&e.setLineDash([]),e.lineWidth=A,e.strokeStyle=M}}var B=2*t.pstyle("text-outline-width").pfValue;if(B>0&&(e.lineWidth=B),"wrap"===t.pstyle("text-wrap").value){var F=Me(a,"labelWrapCachedLines",n),z=Me(a,"labelLineHeight",n),V=v/2,G=this.getLabelJustification(t);switch("auto"===G||("left"===x?"left"===G?u+=-v:"center"===G&&(u+=-V):"center"===x?"left"===G?u+=-V:"right"===G&&(u+=V):"right"===x&&("center"===G?u+=V:"right"===G&&(u+=v))),w){case"top":case"center":case"bottom":d-=(F.length-1)*z}for(var H=0;H<F.length;H++)B>0&&e.strokeText(F[H],u,d),e.fillText(F[H],u,d),d+=z}else B>0&&e.strokeText(h,u,d),e.fillText(h,u,d);0!==f&&(e.rotate(-f),e.translate(-l,-c))}}};var Us={drawNode:function(e,t,n){var r,i,o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],a=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],s=!(arguments.length>5&&void 0!==arguments[5])||arguments[5],l=this,c=t._private,u=c.rscratch,d=t.position();if(O(d.x)&&O(d.y)&&(!s||t.visible())){var h,f,p=s?t.effectiveOpacity():1,v=l.usePaths(),g=!1,m=t.padding();r=t.width()+2*m,i=t.height()+2*m,n&&(f=n,e.translate(-f.x1,-f.y1));for(var y=t.pstyle("background-image"),b=y.value,x=new Array(b.length),w=new Array(b.length),E=0,_=0;_<b.length;_++){var k=b[_],S=x[_]=null!=k&&"none"!==k;if(S){var P=t.cy().style().getIndexedStyle(t,"background-image-crossorigin","value",_);E++,w[_]=l.getCachedImage(k,P,(function(){c.backgroundTimestamp=Date.now(),t.emitAndNotify("background")}))}}var j=t.pstyle("background-blacken").value,C=t.pstyle("border-width").pfValue,T=t.pstyle("background-opacity").value*p,D=t.pstyle("border-color").value,N=t.pstyle("border-style").value,M=t.pstyle("border-opacity").value*p;e.lineJoin="miter";var A=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:T;l.eleFillStyle(e,t,n)},R=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:M;l.colorStrokeStyle(e,D[0],D[1],D[2],t)},I=t.pstyle("shape").strValue,L=t.pstyle("shape-polygon-points").pfValue;if(v){e.translate(d.x,d.y);var B=l.nodePathCache=l.nodePathCache||[],F=fe("polygon"===I?I+","+L.join(","):I,""+i,""+r),z=B[F];null!=z?(h=z,g=!0,u.pathCache=h):(h=new Path2D,B[F]=u.pathCache=h)}var V=function(){if(!g){var n=d;v&&(n={x:0,y:0}),l.nodeShapes[l.getNodeShape(t)].draw(h||e,n.x,n.y,r,i)}v?e.fill(h):e.fill()},G=function(){for(var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:p,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=c.backgrounding,o=0,a=0;a<w.length;a++){var s=t.cy().style().getIndexedStyle(t,"background-image-containment","value",a);r&&"over"===s||!r&&"inside"===s?o++:x[a]&&w[a].complete&&!w[a].error&&(o++,l.drawInscribedImage(e,w[a],t,a,n))}c.backgrounding=!(o===E),i!==c.backgrounding&&t.updateStyle(!1)},H=function(){var n=arguments.length>0&&void 0!==arguments[0]&&arguments[0],o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:p;l.hasPie(t)&&(l.drawPie(e,t,o),n&&(v||l.nodeShapes[l.getNodeShape(t)].draw(e,d.x,d.y,r,i)))},W=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:p,n=(j>0?j:-j)*t,r=j>0?0:255;0!==j&&(l.colorFillStyle(e,r,r,r,n),v?e.fill(h):e.fill())},q=function(){if(C>0){if(e.lineWidth=C,e.lineCap="butt",e.setLineDash)switch(N){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash([4,2]);break;case"solid":case"double":e.setLineDash([])}if(v?e.stroke(h):e.stroke(),"double"===N){e.lineWidth=C/3;var t=e.globalCompositeOperation;e.globalCompositeOperation="destination-out",v?e.stroke(h):e.stroke(),e.globalCompositeOperation=t}e.setLineDash&&e.setLineDash([])}},Y=function(){a&&l.drawNodeOverlay(e,t,d,r,i)},U=function(){a&&l.drawNodeUnderlay(e,t,d,r,i)},X=function(){l.drawElementText(e,t,null,o)},$="yes"===t.pstyle("ghost").value;if($){var K=t.pstyle("ghost-offset-x").pfValue,Z=t.pstyle("ghost-offset-y").pfValue,Q=t.pstyle("ghost-opacity").value,J=Q*p;e.translate(K,Z),A(Q*T),V(),G(J,!0),R(Q*M),q(),H(0!==j||0!==C),G(J,!1),W(J),e.translate(-K,-Z)}v&&e.translate(-d.x,-d.y),U(),v&&e.translate(d.x,d.y),A(),V(),G(p,!0),R(),q(),H(0!==j||0!==C),G(p,!1),W(),v&&e.translate(-d.x,-d.y),X(),Y(),n&&e.translate(f.x1,f.y1)}}},Xs=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(t,n,r,i,o){if(n.visible()){var a=n.pstyle("".concat(e,"-padding")).pfValue,s=n.pstyle("".concat(e,"-opacity")).value,l=n.pstyle("".concat(e,"-color")).value,c=n.pstyle("".concat(e,"-shape")).value;if(s>0){if(r=r||n.position(),null==i||null==o){var u=n.padding();i=n.width()+2*u,o=n.height()+2*u}this.colorFillStyle(t,l[0],l[1],l[2],s),this.nodeShapes[c].draw(t,r.x,r.y,i+2*a,o+2*a),t.fill()}}}};Us.drawNodeOverlay=Xs("overlay"),Us.drawNodeUnderlay=Xs("underlay"),Us.hasPie=function(e){return(e=e[0])._private.hasPie},Us.drawPie=function(e,t,n,r){t=t[0],r=r||t.position();var i=t.cy().style(),o=t.pstyle("pie-size"),a=r.x,s=r.y,l=t.width(),c=t.height(),u=Math.min(l,c)/2,d=0;this.usePaths()&&(a=0,s=0),"%"===o.units?u*=o.pfValue:void 0!==o.pfValue&&(u=o.pfValue/2);for(var h=1;h<=i.pieBackgroundN;h++){var f=t.pstyle("pie-"+h+"-background-size").value,p=t.pstyle("pie-"+h+"-background-color").value,v=t.pstyle("pie-"+h+"-background-opacity").value*n,g=f/100;g+d>1&&(g=1-d);var m=1.5*Math.PI+2*Math.PI*d,y=m+2*Math.PI*g;0===f||d>=1||d+g>1||(e.beginPath(),e.moveTo(a,s),e.arc(a,s,u,m,y),e.closePath(),this.colorFillStyle(e,p[0],p[1],p[2],v),e.fill(),d+=g)}};var $s={};$s.getPixelRatio=function(){var e=this.data.contexts[0];if(null!=this.forcedPixelRatio)return this.forcedPixelRatio;var t=e.backingStorePixelRatio||e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return(window.devicePixelRatio||1)/t},$s.paintCache=function(e){for(var t,n=this.paintCaches=this.paintCaches||[],r=!0,i=0;i<n.length;i++)if((t=n[i]).context===e){r=!1;break}return r&&(t={context:e},n.push(t)),t},$s.createGradientStyleFor=function(e,t,n,r,i){var o,a=this.usePaths(),s=n.pstyle(t+"-gradient-stop-colors").value,l=n.pstyle(t+"-gradient-stop-positions").pfValue;if("radial-gradient"===r)if(n.isEdge()){var c=n.sourceEndpoint(),u=n.targetEndpoint(),d=n.midpoint(),h=at(c,d),f=at(u,d);o=e.createRadialGradient(d.x,d.y,0,d.x,d.y,Math.max(h,f))}else{var p=a?{x:0,y:0}:n.position(),v=n.paddedWidth(),g=n.paddedHeight();o=e.createRadialGradient(p.x,p.y,0,p.x,p.y,Math.max(v,g))}else if(n.isEdge()){var m=n.sourceEndpoint(),y=n.targetEndpoint();o=e.createLinearGradient(m.x,m.y,y.x,y.y)}else{var b=a?{x:0,y:0}:n.position(),x=n.paddedWidth()/2,w=n.paddedHeight()/2;switch(n.pstyle("background-gradient-direction").value){case"to-bottom":o=e.createLinearGradient(b.x,b.y-w,b.x,b.y+w);break;case"to-top":o=e.createLinearGradient(b.x,b.y+w,b.x,b.y-w);break;case"to-left":o=e.createLinearGradient(b.x+x,b.y,b.x-x,b.y);break;case"to-right":o=e.createLinearGradient(b.x-x,b.y,b.x+x,b.y);break;case"to-bottom-right":case"to-right-bottom":o=e.createLinearGradient(b.x-x,b.y-w,b.x+x,b.y+w);break;case"to-top-right":case"to-right-top":o=e.createLinearGradient(b.x-x,b.y+w,b.x+x,b.y-w);break;case"to-bottom-left":case"to-left-bottom":o=e.createLinearGradient(b.x+x,b.y-w,b.x-x,b.y+w);break;case"to-top-left":case"to-left-top":o=e.createLinearGradient(b.x+x,b.y+w,b.x-x,b.y-w)}}if(!o)return null;for(var E=l.length===s.length,_=s.length,k=0;k<_;k++)o.addColorStop(E?l[k]:k/(_-1),"rgba("+s[k][0]+","+s[k][1]+","+s[k][2]+","+i+")");return o},$s.gradientFillStyle=function(e,t,n,r){var i=this.createGradientStyleFor(e,"background",t,n,r);if(!i)return null;e.fillStyle=i},$s.colorFillStyle=function(e,t,n,r,i){e.fillStyle="rgba("+t+","+n+","+r+","+i+")"},$s.eleFillStyle=function(e,t,n){var r=t.pstyle("background-fill").value;if("linear-gradient"===r||"radial-gradient"===r)this.gradientFillStyle(e,t,r,n);else{var i=t.pstyle("background-color").value;this.colorFillStyle(e,i[0],i[1],i[2],n)}},$s.gradientStrokeStyle=function(e,t,n,r){var i=this.createGradientStyleFor(e,"line",t,n,r);if(!i)return null;e.strokeStyle=i},$s.colorStrokeStyle=function(e,t,n,r,i){e.strokeStyle="rgba("+t+","+n+","+r+","+i+")"},$s.eleStrokeStyle=function(e,t,n){var r=t.pstyle("line-fill").value;if("linear-gradient"===r||"radial-gradient"===r)this.gradientStrokeStyle(e,t,r,n);else{var i=t.pstyle("line-color").value;this.colorStrokeStyle(e,i[0],i[1],i[2],n)}},$s.matchCanvasSize=function(e){var t=this,n=t.data,r=t.findContainerClientCoords(),i=r[2],o=r[3],a=t.getPixelRatio(),s=t.motionBlurPxRatio;e!==t.data.bufferCanvases[t.MOTIONBLUR_BUFFER_NODE]&&e!==t.data.bufferCanvases[t.MOTIONBLUR_BUFFER_DRAG]||(a=s);var l,c=i*a,u=o*a;if(c!==t.canvasWidth||u!==t.canvasHeight){t.fontCaches=null;var d=n.canvasContainer;d.style.width=i+"px",d.style.height=o+"px";for(var h=0;h<t.CANVAS_LAYERS;h++)(l=n.canvases[h]).width=c,l.height=u,l.style.width=i+"px",l.style.height=o+"px";for(h=0;h<t.BUFFER_COUNT;h++)(l=n.bufferCanvases[h]).width=c,l.height=u,l.style.width=i+"px",l.style.height=o+"px";t.textureMult=1,a<=1&&(l=n.bufferCanvases[t.TEXTURE_BUFFER],t.textureMult=2,l.width=c*t.textureMult,l.height=u*t.textureMult),t.canvasWidth=c,t.canvasHeight=u}},$s.renderTo=function(e,t,n,r){this.render({forcedContext:e,forcedZoom:t,forcedPan:n,drawAllLayers:!0,forcedPxRatio:r})},$s.render=function(e){var t=(e=e||Te()).forcedContext,n=e.drawAllLayers,r=e.drawOnlyNodeLayer,i=e.forcedZoom,o=e.forcedPan,a=this,s=void 0===e.forcedPxRatio?this.getPixelRatio():e.forcedPxRatio,l=a.cy,c=a.data,u=c.canvasNeedsRedraw,d=a.textureOnViewport&&!t&&(a.pinching||a.hoverData.dragging||a.swipePanning||a.data.wheelZooming),h=void 0!==e.motionBlur?e.motionBlur:a.motionBlur,f=a.motionBlurPxRatio,p=l.hasCompoundNodes(),v=a.hoverData.draggingEles,g=!(!a.hoverData.selecting&&!a.touchData.selecting),m=h=h&&!t&&a.motionBlurEnabled&&!g;t||(a.prevPxRatio!==s&&(a.invalidateContainerClientCoordsCache(),a.matchCanvasSize(a.container),a.redrawHint("eles",!0),a.redrawHint("drag",!0)),a.prevPxRatio=s),!t&&a.motionBlurTimeout&&clearTimeout(a.motionBlurTimeout),h&&(null==a.mbFrames&&(a.mbFrames=0),a.mbFrames++,a.mbFrames<3&&(m=!1),a.mbFrames>a.minMbLowQualFrames&&(a.motionBlurPxRatio=a.mbPxRBlurry)),a.clearingMotionBlur&&(a.motionBlurPxRatio=1),a.textureDrawLastFrame&&!d&&(u[a.NODE]=!0,u[a.SELECT_BOX]=!0);var y=l.style(),b=l.zoom(),x=void 0!==i?i:b,w=l.pan(),E={x:w.x,y:w.y},_={zoom:b,pan:{x:w.x,y:w.y}},k=a.prevViewport;void 0===k||_.zoom!==k.zoom||_.pan.x!==k.pan.x||_.pan.y!==k.pan.y||v&&!p||(a.motionBlurPxRatio=1),o&&(E=o),x*=s,E.x*=s,E.y*=s;var S=a.getCachedZSortedEles();function P(e,t,n,r,i){var o=e.globalCompositeOperation;e.globalCompositeOperation="destination-out",a.colorFillStyle(e,255,255,255,a.motionBlurTransparency),e.fillRect(t,n,r,i),e.globalCompositeOperation=o}function j(e,r){var s,l,u,d;a.clearingMotionBlur||e!==c.bufferContexts[a.MOTIONBLUR_BUFFER_NODE]&&e!==c.bufferContexts[a.MOTIONBLUR_BUFFER_DRAG]?(s=E,l=x,u=a.canvasWidth,d=a.canvasHeight):(s={x:w.x*f,y:w.y*f},l=b*f,u=a.canvasWidth*f,d=a.canvasHeight*f),e.setTransform(1,0,0,1,0,0),"motionBlur"===r?P(e,0,0,u,d):t||void 0!==r&&!r||e.clearRect(0,0,u,d),n||(e.translate(s.x,s.y),e.scale(l,l)),o&&e.translate(o.x,o.y),i&&e.scale(i,i)}if(d||(a.textureDrawLastFrame=!1),d){if(a.textureDrawLastFrame=!0,!a.textureCache){a.textureCache={},a.textureCache.bb=l.mutableElements().boundingBox(),a.textureCache.texture=a.data.bufferCanvases[a.TEXTURE_BUFFER];var C=a.data.bufferContexts[a.TEXTURE_BUFFER];C.setTransform(1,0,0,1,0,0),C.clearRect(0,0,a.canvasWidth*a.textureMult,a.canvasHeight*a.textureMult),a.render({forcedContext:C,drawOnlyNodeLayer:!0,forcedPxRatio:s*a.textureMult}),(_=a.textureCache.viewport={zoom:l.zoom(),pan:l.pan(),width:a.canvasWidth,height:a.canvasHeight}).mpan={x:(0-_.pan.x)/_.zoom,y:(0-_.pan.y)/_.zoom}}u[a.DRAG]=!1,u[a.NODE]=!1;var T=c.contexts[a.NODE],D=a.textureCache.texture;_=a.textureCache.viewport;T.setTransform(1,0,0,1,0,0),h?P(T,0,0,_.width,_.height):T.clearRect(0,0,_.width,_.height);var N=y.core("outside-texture-bg-color").value,O=y.core("outside-texture-bg-opacity").value;a.colorFillStyle(T,N[0],N[1],N[2],O),T.fillRect(0,0,_.width,_.height);b=l.zoom();j(T,!1),T.clearRect(_.mpan.x,_.mpan.y,_.width/_.zoom/s,_.height/_.zoom/s),T.drawImage(D,_.mpan.x,_.mpan.y,_.width/_.zoom/s,_.height/_.zoom/s)}else a.textureOnViewport&&!t&&(a.textureCache=null);var M=l.extent(),A=a.pinching||a.hoverData.dragging||a.swipePanning||a.data.wheelZooming||a.hoverData.draggingEles||a.cy.animated(),R=a.hideEdgesOnViewport&&A,I=[];if(I[a.NODE]=!u[a.NODE]&&h&&!a.clearedForMotionBlur[a.NODE]||a.clearingMotionBlur,I[a.NODE]&&(a.clearedForMotionBlur[a.NODE]=!0),I[a.DRAG]=!u[a.DRAG]&&h&&!a.clearedForMotionBlur[a.DRAG]||a.clearingMotionBlur,I[a.DRAG]&&(a.clearedForMotionBlur[a.DRAG]=!0),u[a.NODE]||n||r||I[a.NODE]){var L=h&&!I[a.NODE]&&1!==f;j(T=t||(L?a.data.bufferContexts[a.MOTIONBLUR_BUFFER_NODE]:c.contexts[a.NODE]),h&&!L?"motionBlur":void 0),R?a.drawCachedNodes(T,S.nondrag,s,M):a.drawLayeredElements(T,S.nondrag,s,M),a.debug&&a.drawDebugPoints(T,S.nondrag),n||h||(u[a.NODE]=!1)}if(!r&&(u[a.DRAG]||n||I[a.DRAG])){L=h&&!I[a.DRAG]&&1!==f;j(T=t||(L?a.data.bufferContexts[a.MOTIONBLUR_BUFFER_DRAG]:c.contexts[a.DRAG]),h&&!L?"motionBlur":void 0),R?a.drawCachedNodes(T,S.drag,s,M):a.drawCachedElements(T,S.drag,s,M),a.debug&&a.drawDebugPoints(T,S.drag),n||h||(u[a.DRAG]=!1)}if(a.showFps||!r&&u[a.SELECT_BOX]&&!n){if(j(T=t||c.contexts[a.SELECT_BOX]),1==a.selection[4]&&(a.hoverData.selecting||a.touchData.selecting)){b=a.cy.zoom();var B=y.core("selection-box-border-width").value/b;T.lineWidth=B,T.fillStyle="rgba("+y.core("selection-box-color").value[0]+","+y.core("selection-box-color").value[1]+","+y.core("selection-box-color").value[2]+","+y.core("selection-box-opacity").value+")",T.fillRect(a.selection[0],a.selection[1],a.selection[2]-a.selection[0],a.selection[3]-a.selection[1]),B>0&&(T.strokeStyle="rgba("+y.core("selection-box-border-color").value[0]+","+y.core("selection-box-border-color").value[1]+","+y.core("selection-box-border-color").value[2]+","+y.core("selection-box-opacity").value+")",T.strokeRect(a.selection[0],a.selection[1],a.selection[2]-a.selection[0],a.selection[3]-a.selection[1]))}if(c.bgActivePosistion&&!a.hoverData.selecting){b=a.cy.zoom();var F=c.bgActivePosistion;T.fillStyle="rgba("+y.core("active-bg-color").value[0]+","+y.core("active-bg-color").value[1]+","+y.core("active-bg-color").value[2]+","+y.core("active-bg-opacity").value+")",T.beginPath(),T.arc(F.x,F.y,y.core("active-bg-size").pfValue/b,0,2*Math.PI),T.fill()}var z=a.lastRedrawTime;if(a.showFps&&z){z=Math.round(z);var V=Math.round(1e3/z);T.setTransform(1,0,0,1,0,0),T.fillStyle="rgba(255, 0, 0, 0.75)",T.strokeStyle="rgba(255, 0, 0, 0.75)",T.lineWidth=1,T.fillText("1 frame = "+z+" ms = "+V+" fps",0,20);T.strokeRect(0,30,250,20),T.fillRect(0,30,250*Math.min(V/60,1),20)}n||(u[a.SELECT_BOX]=!1)}if(h&&1!==f){var G=c.contexts[a.NODE],H=a.data.bufferCanvases[a.MOTIONBLUR_BUFFER_NODE],W=c.contexts[a.DRAG],q=a.data.bufferCanvases[a.MOTIONBLUR_BUFFER_DRAG],Y=function(e,t,n){e.setTransform(1,0,0,1,0,0),n||!m?e.clearRect(0,0,a.canvasWidth,a.canvasHeight):P(e,0,0,a.canvasWidth,a.canvasHeight);var r=f;e.drawImage(t,0,0,a.canvasWidth*r,a.canvasHeight*r,0,0,a.canvasWidth,a.canvasHeight)};(u[a.NODE]||I[a.NODE])&&(Y(G,H,I[a.NODE]),u[a.NODE]=!1),(u[a.DRAG]||I[a.DRAG])&&(Y(W,q,I[a.DRAG]),u[a.DRAG]=!1)}a.prevViewport=_,a.clearingMotionBlur&&(a.clearingMotionBlur=!1,a.motionBlurCleared=!0,a.motionBlur=!0),h&&(a.motionBlurTimeout=setTimeout((function(){a.motionBlurTimeout=null,a.clearedForMotionBlur[a.NODE]=!1,a.clearedForMotionBlur[a.DRAG]=!1,a.motionBlur=!1,a.clearingMotionBlur=!d,a.mbFrames=0,u[a.NODE]=!0,u[a.DRAG]=!0,a.redraw()}),100)),t||l.emit("render")};for(var Ks={drawPolygonPath:function(e,t,n,r,i,o){var a=r/2,s=i/2;e.beginPath&&e.beginPath(),e.moveTo(t+a*o[0],n+s*o[1]);for(var l=1;l<o.length/2;l++)e.lineTo(t+a*o[2*l],n+s*o[2*l+1]);e.closePath()},drawRoundPolygonPath:function(e,t,n,r,i,o){var a=r/2,s=i/2,l=Ft(r,i);e.beginPath&&e.beginPath();for(var c=0;c<o.length/4;c++){var u,d=void 0;d=0===c?o.length-2:4*c-2,u=4*c+2;var h=t+a*o[4*c],f=n+s*o[4*c+1],p=-o[d]*o[u]-o[d+1]*o[u+1],v=l/Math.tan(Math.acos(p)/2),g=h-v*o[d],m=f-v*o[d+1],y=h+v*o[u],b=f+v*o[u+1];0===c?e.moveTo(g,m):e.lineTo(g,m),e.arcTo(h,f,y,b,l)}e.closePath()},drawRoundRectanglePath:function(e,t,n,r,i){var o=r/2,a=i/2,s=Bt(r,i);e.beginPath&&e.beginPath(),e.moveTo(t,n-a),e.arcTo(t+o,n-a,t+o,n,s),e.arcTo(t+o,n+a,t,n+a,s),e.arcTo(t-o,n+a,t-o,n,s),e.arcTo(t-o,n-a,t,n-a,s),e.lineTo(t,n-a),e.closePath()},drawBottomRoundRectanglePath:function(e,t,n,r,i){var o=r/2,a=i/2,s=Bt(r,i);e.beginPath&&e.beginPath(),e.moveTo(t,n-a),e.lineTo(t+o,n-a),e.lineTo(t+o,n),e.arcTo(t+o,n+a,t,n+a,s),e.arcTo(t-o,n+a,t-o,n,s),e.lineTo(t-o,n-a),e.lineTo(t,n-a),e.closePath()},drawCutRectanglePath:function(e,t,n,r,i){var o=r/2,a=i/2;e.beginPath&&e.beginPath(),e.moveTo(t-o+8,n-a),e.lineTo(t+o-8,n-a),e.lineTo(t+o,n-a+8),e.lineTo(t+o,n+a-8),e.lineTo(t+o-8,n+a),e.lineTo(t-o+8,n+a),e.lineTo(t-o,n+a-8),e.lineTo(t-o,n-a+8),e.closePath()},drawBarrelPath:function(e,t,n,r,i){var o=r/2,a=i/2,s=t-o,l=t+o,c=n-a,u=n+a,d=zt(r,i),h=d.widthOffset,f=d.heightOffset,p=d.ctrlPtOffsetPct*h;e.beginPath&&e.beginPath(),e.moveTo(s,c+f),e.lineTo(s,u-f),e.quadraticCurveTo(s+p,u,s+h,u),e.lineTo(l-h,u),e.quadraticCurveTo(l-p,u,l,u-f),e.lineTo(l,c+f),e.quadraticCurveTo(l-p,c,l-h,c),e.lineTo(s+h,c),e.quadraticCurveTo(s+p,c,s,c+f),e.closePath()}},Zs=Math.sin(0),Qs=Math.cos(0),Js={},el={},tl=Math.PI/40,nl=0*Math.PI;nl<2*Math.PI;nl+=tl)Js[nl]=Math.sin(nl),el[nl]=Math.cos(nl);Ks.drawEllipsePath=function(e,t,n,r,i){if(e.beginPath&&e.beginPath(),e.ellipse)e.ellipse(t,n,r/2,i/2,0,0,2*Math.PI);else for(var o,a,s=r/2,l=i/2,c=0*Math.PI;c<2*Math.PI;c+=tl)o=t-s*Js[c]*Zs+s*el[c]*Qs,a=n+l*el[c]*Zs+l*Js[c]*Qs,0===c?e.moveTo(o,a):e.lineTo(o,a);e.closePath()};var rl={};function il(e){var t=e.indexOf(",");return e.substr(t+1)}function ol(e,t,n){var r=function(){return t.toDataURL(n,e.quality)};switch(e.output){case"blob-promise":return new Jn((function(r,i){try{t.toBlob((function(e){null!=e?r(e):i(new Error("`canvas.toBlob()` sent a null value in its callback"))}),n,e.quality)}catch(o){i(o)}}));case"blob":return function(e,t){for(var n=atob(e),r=new ArrayBuffer(n.length),i=new Uint8Array(r),o=0;o<n.length;o++)i[o]=n.charCodeAt(o);return new Blob([r],{type:t})}(il(r()),n);case"base64":return il(r());default:return r()}}rl.createBuffer=function(e,t){var n=document.createElement("canvas");return n.width=e,n.height=t,[n,n.getContext("2d")]},rl.bufferCanvasImage=function(e){var t=this.cy,n=t.mutableElements().boundingBox(),r=this.findContainerClientCoords(),i=e.full?Math.ceil(n.w):r[2],o=e.full?Math.ceil(n.h):r[3],a=O(e.maxWidth)||O(e.maxHeight),s=this.getPixelRatio(),l=1;if(void 0!==e.scale)i*=e.scale,o*=e.scale,l=e.scale;else if(a){var c=1/0,u=1/0;O(e.maxWidth)&&(c=l*e.maxWidth/i),O(e.maxHeight)&&(u=l*e.maxHeight/o),i*=l=Math.min(c,u),o*=l}a||(i*=s,o*=s,l*=s);var d=document.createElement("canvas");d.width=i,d.height=o,d.style.width=i+"px",d.style.height=o+"px";var h=d.getContext("2d");if(i>0&&o>0){h.clearRect(0,0,i,o),h.globalCompositeOperation="source-over";var f=this.getCachedZSortedEles();if(e.full)h.translate(-n.x1*l,-n.y1*l),h.scale(l,l),this.drawElements(h,f),h.scale(1/l,1/l),h.translate(n.x1*l,n.y1*l);else{var p=t.pan(),v={x:p.x*l,y:p.y*l};l*=t.zoom(),h.translate(v.x,v.y),h.scale(l,l),this.drawElements(h,f),h.scale(1/l,1/l),h.translate(-v.x,-v.y)}e.bg&&(h.globalCompositeOperation="destination-over",h.fillStyle=e.bg,h.rect(0,0,i,o),h.fill())}return d},rl.png=function(e){return ol(e,this.bufferCanvasImage(e),"image/png")},rl.jpg=function(e){return ol(e,this.bufferCanvasImage(e),"image/jpeg")};var al={nodeShapeImpl:function(e,t,n,r,i,o,a){switch(e){case"ellipse":return this.drawEllipsePath(t,n,r,i,o);case"polygon":return this.drawPolygonPath(t,n,r,i,o,a);case"round-polygon":return this.drawRoundPolygonPath(t,n,r,i,o,a);case"roundrectangle":case"round-rectangle":return this.drawRoundRectanglePath(t,n,r,i,o);case"cutrectangle":case"cut-rectangle":return this.drawCutRectanglePath(t,n,r,i,o);case"bottomroundrectangle":case"bottom-round-rectangle":return this.drawBottomRoundRectanglePath(t,n,r,i,o);case"barrel":return this.drawBarrelPath(t,n,r,i,o)}}},sl=cl,ll=cl.prototype;function cl(e){var t=this;t.data={canvases:new Array(ll.CANVAS_LAYERS),contexts:new Array(ll.CANVAS_LAYERS),canvasNeedsRedraw:new Array(ll.CANVAS_LAYERS),bufferCanvases:new Array(ll.BUFFER_COUNT),bufferContexts:new Array(ll.CANVAS_LAYERS)};var n="-webkit-tap-highlight-color",r="rgba(0,0,0,0)";t.data.canvasContainer=document.createElement("div");var i=t.data.canvasContainer.style;t.data.canvasContainer.style[n]=r,i.position="relative",i.zIndex="0",i.overflow="hidden";var o=e.cy.container();o.appendChild(t.data.canvasContainer),o.style[n]=r;var a={"-webkit-user-select":"none","-moz-user-select":"-moz-none","user-select":"none","-webkit-tap-highlight-color":"rgba(0,0,0,0)","outline-style":"none"};E&&E.userAgent.match(/msie|trident|edge/i)&&(a["-ms-touch-action"]="none",a["touch-action"]="none");for(var s=0;s<ll.CANVAS_LAYERS;s++){var l=t.data.canvases[s]=document.createElement("canvas");t.data.contexts[s]=l.getContext("2d"),Object.keys(a).forEach((function(e){l.style[e]=a[e]})),l.style.position="absolute",l.setAttribute("data-id","layer"+s),l.style.zIndex=String(ll.CANVAS_LAYERS-s),t.data.canvasContainer.appendChild(l),t.data.canvasNeedsRedraw[s]=!1}t.data.topCanvas=t.data.canvases[0],t.data.canvases[ll.NODE].setAttribute("data-id","layer"+ll.NODE+"-node"),t.data.canvases[ll.SELECT_BOX].setAttribute("data-id","layer"+ll.SELECT_BOX+"-selectbox"),t.data.canvases[ll.DRAG].setAttribute("data-id","layer"+ll.DRAG+"-drag");for(s=0;s<ll.BUFFER_COUNT;s++)t.data.bufferCanvases[s]=document.createElement("canvas"),t.data.bufferContexts[s]=t.data.bufferCanvases[s].getContext("2d"),t.data.bufferCanvases[s].style.position="absolute",t.data.bufferCanvases[s].setAttribute("data-id","buffer"+s),t.data.bufferCanvases[s].style.zIndex=String(-s-1),t.data.bufferCanvases[s].style.visibility="hidden";t.pathsEnabled=!0;var c=ht(),u=function(e){return{x:-e.w/2,y:-e.h/2}},d=function(e){return e.boundingBox(),e[0]._private.bodyBounds},h=function(e){return e.boundingBox(),e[0]._private.labelBounds.main||c},f=function(e){return e.boundingBox(),e[0]._private.labelBounds.source||c},p=function(e){return e.boundingBox(),e[0]._private.labelBounds.target||c},v=function(e,t){return t},g=function(e,t,n){var r=e?e+"-":"";return{x:t.x+n.pstyle(r+"text-margin-x").pfValue,y:t.y+n.pstyle(r+"text-margin-y").pfValue}},m=function(e,t,n){var r=e[0]._private.rscratch;return{x:r[t],y:r[n]}},y=t.data.eleTxrCache=new Es(t,{getKey:function(e){return e[0]._private.nodeKey},doesEleInvalidateKey:function(e){var t=e[0]._private;return!(t.oldBackgroundTimestamp===t.backgroundTimestamp)},drawElement:function(e,n,r,i,o){return t.drawElement(e,n,r,!1,!1,o)},getBoundingBox:d,getRotationPoint:function(e){return{x:((t=d(e)).x1+t.x2)/2,y:(t.y1+t.y2)/2};var t},getRotationOffset:function(e){return u(d(e))},allowEdgeTxrCaching:!1,allowParentTxrCaching:!1}),b=t.data.lblTxrCache=new Es(t,{getKey:function(e){return e[0]._private.labelStyleKey},drawElement:function(e,n,r,i,o){return t.drawElementText(e,n,r,i,"main",o)},getBoundingBox:h,getRotationPoint:function(e){return g("",m(e,"labelX","labelY"),e)},getRotationOffset:function(e){var t=h(e),n=u(h(e));if(e.isNode()){switch(e.pstyle("text-halign").value){case"left":n.x=-t.w;break;case"right":n.x=0}switch(e.pstyle("text-valign").value){case"top":n.y=-t.h;break;case"bottom":n.y=0}}return n},isVisible:v}),x=t.data.slbTxrCache=new Es(t,{getKey:function(e){return e[0]._private.sourceLabelStyleKey},drawElement:function(e,n,r,i,o){return t.drawElementText(e,n,r,i,"source",o)},getBoundingBox:f,getRotationPoint:function(e){return g("source",m(e,"sourceLabelX","sourceLabelY"),e)},getRotationOffset:function(e){return u(f(e))},isVisible:v}),w=t.data.tlbTxrCache=new Es(t,{getKey:function(e){return e[0]._private.targetLabelStyleKey},drawElement:function(e,n,r,i,o){return t.drawElementText(e,n,r,i,"target",o)},getBoundingBox:p,getRotationPoint:function(e){return g("target",m(e,"targetLabelX","targetLabelY"),e)},getRotationOffset:function(e){return u(p(e))},isVisible:v}),_=t.data.lyrTxrCache=new ks(t);t.onUpdateEleCalcs((function(e,t){y.invalidateElements(t),b.invalidateElements(t),x.invalidateElements(t),w.invalidateElements(t),_.invalidateElements(t);for(var n=0;n<t.length;n++){var r=t[n]._private;r.oldBackgroundTimestamp=r.backgroundTimestamp}}));var k=function(e){for(var t=0;t<e.length;t++)_.enqueueElementRefinement(e[t].ele)};y.onDequeue(k),b.onDequeue(k),x.onDequeue(k),w.onDequeue(k)}ll.CANVAS_LAYERS=3,ll.SELECT_BOX=0,ll.DRAG=1,ll.NODE=2,ll.BUFFER_COUNT=3,ll.TEXTURE_BUFFER=0,ll.MOTIONBLUR_BUFFER_NODE=1,ll.MOTIONBLUR_BUFFER_DRAG=2,ll.redrawHint=function(e,t){var n=this;switch(e){case"eles":n.data.canvasNeedsRedraw[ll.NODE]=t;break;case"drag":n.data.canvasNeedsRedraw[ll.DRAG]=t;break;case"select":n.data.canvasNeedsRedraw[ll.SELECT_BOX]=t}};var ul="undefined"!=typeof Path2D;ll.path2dEnabled=function(e){if(void 0===e)return this.pathsEnabled;this.pathsEnabled=!!e},ll.usePaths=function(){return ul&&this.pathsEnabled},ll.setImgSmoothing=function(e,t){null!=e.imageSmoothingEnabled?e.imageSmoothingEnabled=t:(e.webkitImageSmoothingEnabled=t,e.mozImageSmoothingEnabled=t,e.msImageSmoothingEnabled=t)},ll.getImgSmoothing=function(e){return null!=e.imageSmoothingEnabled?e.imageSmoothingEnabled:e.webkitImageSmoothingEnabled||e.mozImageSmoothingEnabled||e.msImageSmoothingEnabled},ll.makeOffscreenCanvas=function(e,t){var n;return"undefined"!==("undefined"==typeof OffscreenCanvas?"undefined":p(OffscreenCanvas))?n=new OffscreenCanvas(e,t):((n=document.createElement("canvas")).width=e,n.height=t),n},[Ts,Rs,Gs,Ws,qs,Us,$s,Ks,rl,al].forEach((function(e){X(ll,e)}));var dl=[{type:"layout",extensions:Wa},{type:"renderer",extensions:[{name:"null",impl:qa},{name:"base",impl:vs},{name:"canvas",impl:sl}]}],hl={},fl={};function pl(e,t,n){var r=n,i=function(n){Se("Can not register `"+t+"` for `"+e+"` since `"+n+"` already exists in the prototype and can not be overridden")};if("core"===e){if(ia.prototype[t])return i(t);ia.prototype[t]=n}else if("collection"===e){if(wo.prototype[t])return i(t);wo.prototype[t]=n}else if("layout"===e){for(var o=function(e){this.options=e,n.call(this,e),N(this._private)||(this._private={}),this._private.cy=e.cy,this._private.listeners=[],this.createEmitter()},a=o.prototype=Object.create(n.prototype),s=[],l=0;l<s.length;l++){var c=s[l];a[c]=a[c]||function(){return this}}a.start&&!a.run?a.run=function(){return this.start(),this}:!a.start&&a.run&&(a.start=function(){return this.run(),this});var u=n.prototype.stop;a.stop=function(){var e=this.options;if(e&&e.animate){var t=this.animations;if(t)for(var n=0;n<t.length;n++)t[n].stop()}return u?u.call(this):this.emit("layoutstop"),this},a.destroy||(a.destroy=function(){return this}),a.cy=function(){return this._private.cy};var d=function(e){return e._private.cy},h={addEventFields:function(e,t){t.layout=e,t.cy=d(e),t.target=e},bubble:function(){return!0},parent:function(e){return d(e)}};X(a,{createEmitter:function(){return this._private.emitter=new Bi(h,this),this},emitter:function(){return this._private.emitter},on:function(e,t){return this.emitter().on(e,t),this},one:function(e,t){return this.emitter().one(e,t),this},once:function(e,t){return this.emitter().one(e,t),this},removeListener:function(e,t){return this.emitter().removeListener(e,t),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},emit:function(e,t){return this.emitter().emit(e,t),this}}),or.eventAliasesOn(a),r=o}else if("renderer"===e&&"null"!==t&&"base"!==t){var f=vl("renderer","base"),p=f.prototype,v=n,g=n.prototype,m=function(){f.apply(this,arguments),v.apply(this,arguments)},y=m.prototype;for(var b in p){var x=p[b];if(null!=g[b])return i(b);y[b]=x}for(var w in g)y[w]=g[w];p.clientFunctions.forEach((function(e){y[e]=y[e]||function(){_e("Renderer does not implement `renderer."+e+"()` on its prototype")}})),r=m}else if("__proto__"===e||"constructor"===e||"prototype"===e)return _e(e+" is an illegal type to be registered, possibly lead to prototype pollutions");return Z({map:hl,keys:[e,t],value:r})}function vl(e,t){return Q({map:hl,keys:[e,t]})}function gl(e,t,n,r,i){return Z({map:fl,keys:[e,t,n,r],value:i})}function ml(e,t,n,r){return Q({map:fl,keys:[e,t,n,r]})}var yl=function(){return 2===arguments.length?vl.apply(null,arguments):3===arguments.length?pl.apply(null,arguments):4===arguments.length?ml.apply(null,arguments):5===arguments.length?gl.apply(null,arguments):void _e("Invalid extension access syntax")};ia.prototype.extension=yl,dl.forEach((function(e){e.extensions.forEach((function(t){pl(e.type,t.name,t.impl)}))}));var bl=function e(){if(!(this instanceof e))return new e;this.length=0},xl=bl.prototype;xl.instanceString=function(){return"stylesheet"},xl.selector=function(e){return this[this.length++]={selector:e,properties:[]},this},xl.css=function(e,t){var n=this.length-1;if(C(e))this[n].properties.push({name:e,value:t});else if(N(e))for(var r=e,i=Object.keys(r),o=0;o<i.length;o++){var a=i[o],s=r[a];if(null!=s){var l=Jo.properties[a]||Jo.properties[H(a)];if(null!=l){var c=l.name,u=s;this[n].properties.push({name:c,value:u})}}}return this},xl.style=xl.css,xl.generateStyle=function(e){var t=new Jo(e);return this.appendToStyle(t)},xl.appendToStyle=function(e){for(var t=0;t<this.length;t++){var n=this[t],r=n.selector,i=n.properties;e.selector(r);for(var o=0;o<i.length;o++){var a=i[o];e.css(a.name,a.value)}}return e};var wl=function(e){return void 0===e&&(e={}),N(e)?new ia(e):C(e)?yl.apply(yl,arguments):void 0};wl.use=function(e){var t=Array.prototype.slice.call(arguments,1);return t.unshift(wl),e.apply(null,t),this},wl.warnings=function(e){return ke(e)},wl.version="3.23.0",wl.stylesheet=wl.Stylesheet=bl,e.exports=wl},46506:(e,t,n)=>{e.exports={graphlib:n(71310),layout:n(42529),debug:n(5512),util:{time:n(8783).time,notime:n(8783).notime},version:n(57589)}},85247:(e,t,n)=>{"use strict";var r=n(43294),i=n(38757);e.exports={run:function(e){var t="greedy"===e.graph().acyclicer?i(e,function(e){return function(t){return e.edge(t).weight}}(e)):function(e){var t=[],n={},i={};function o(a){r.has(i,a)||(i[a]=!0,n[a]=!0,r.forEach(e.outEdges(a),(function(e){r.has(n,e.w)?t.push(e):o(e.w)})),delete n[a])}return r.forEach(e.nodes(),o),t}(e);r.forEach(t,(function(t){var n=e.edge(t);e.removeEdge(t),n.forwardName=t.name,n.reversed=!0,e.setEdge(t.w,t.v,n,r.uniqueId("rev"))}))},undo:function(e){r.forEach(e.edges(),(function(t){var n=e.edge(t);if(n.reversed){e.removeEdge(t);var r=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(t.w,t.v,n,r)}}))}}},49654:(e,t,n)=>{var r=n(43294),i=n(8783);function o(e,t,n,r,o,a){var s={width:0,height:0,rank:a,borderType:t},l=o[t][a-1],c=i.addDummyNode(e,"border",s,n);o[t][a]=c,e.setParent(c,r),l&&e.setEdge(l,c,{weight:1})}e.exports=function(e){r.forEach(e.children(),(function t(n){var i=e.children(n),a=e.node(n);if(i.length&&r.forEach(i,t),r.has(a,"minRank")){a.borderLeft=[],a.borderRight=[];for(var s=a.minRank,l=a.maxRank+1;s<l;++s)o(e,"borderLeft","_bl",n,a,s),o(e,"borderRight","_br",n,a,s)}}))}},25128:(e,t,n)=>{"use strict";var r=n(43294);function i(e){r.forEach(e.nodes(),(function(t){o(e.node(t))})),r.forEach(e.edges(),(function(t){o(e.edge(t))}))}function o(e){var t=e.width;e.width=e.height,e.height=t}function a(e){e.y=-e.y}function s(e){var t=e.x;e.x=e.y,e.y=t}e.exports={adjust:function(e){var t=e.graph().rankdir.toLowerCase();"lr"!==t&&"rl"!==t||i(e)},undo:function(e){var t=e.graph().rankdir.toLowerCase();"bt"!==t&&"rl"!==t||function(e){r.forEach(e.nodes(),(function(t){a(e.node(t))})),r.forEach(e.edges(),(function(t){var n=e.edge(t);r.forEach(n.points,a),r.has(n,"y")&&a(n)}))}(e);"lr"!==t&&"rl"!==t||(!function(e){r.forEach(e.nodes(),(function(t){s(e.node(t))})),r.forEach(e.edges(),(function(t){var n=e.edge(t);r.forEach(n.points,s),r.has(n,"x")&&s(n)}))}(e),i(e))}}},65199:e=>{function t(){var e={};e._next=e._prev=e,this._sentinel=e}function n(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function r(e,t){if("_next"!==e&&"_prev"!==e)return t}e.exports=t,t.prototype.dequeue=function(){var e=this._sentinel,t=e._prev;if(t!==e)return n(t),t},t.prototype.enqueue=function(e){var t=this._sentinel;e._prev&&e._next&&n(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t},t.prototype.toString=function(){for(var e=[],t=this._sentinel,n=t._prev;n!==t;)e.push(JSON.stringify(n,r)),n=n._prev;return"["+e.join(", ")+"]"}},5512:(e,t,n)=>{var r=n(43294),i=n(8783),o=n(71310).Graph;e.exports={debugOrdering:function(e){var t=i.buildLayerMatrix(e),n=new o({compound:!0,multigraph:!0}).setGraph({});return r.forEach(e.nodes(),(function(t){n.setNode(t,{label:t}),n.setParent(t,"layer"+e.node(t).rank)})),r.forEach(e.edges(),(function(e){n.setEdge(e.v,e.w,{},e.name)})),r.forEach(t,(function(e,t){var i="layer"+t;n.setNode(i,{rank:"same"}),r.reduce(e,(function(e,t){return n.setEdge(e,t,{style:"invis"}),t}))})),n}}},71310:(e,t,n)=>{var r;try{r=n(87377)}catch(i){}r||(r=window.graphlib),e.exports=r},38757:(e,t,n)=>{var r=n(43294),i=n(71310).Graph,o=n(65199);e.exports=function(e,t){if(e.nodeCount()<=1)return[];var n=function(e,t){var n=new i,a=0,s=0;r.forEach(e.nodes(),(function(e){n.setNode(e,{v:e,in:0,out:0})})),r.forEach(e.edges(),(function(e){var r=n.edge(e.v,e.w)||0,i=t(e),o=r+i;n.setEdge(e.v,e.w,o),s=Math.max(s,n.node(e.v).out+=i),a=Math.max(a,n.node(e.w).in+=i)}));var c=r.range(s+a+3).map((function(){return new o})),u=a+1;return r.forEach(n.nodes(),(function(e){l(c,u,n.node(e))})),{graph:n,buckets:c,zeroIdx:u}}(e,t||a),c=function(e,t,n){var r,i=[],o=t[t.length-1],a=t[0];for(;e.nodeCount();){for(;r=a.dequeue();)s(e,t,n,r);for(;r=o.dequeue();)s(e,t,n,r);if(e.nodeCount())for(var l=t.length-2;l>0;--l)if(r=t[l].dequeue()){i=i.concat(s(e,t,n,r,!0));break}}return i}(n.graph,n.buckets,n.zeroIdx);return r.flatten(r.map(c,(function(t){return e.outEdges(t.v,t.w)})),!0)};var a=r.constant(1);function s(e,t,n,i,o){var a=o?[]:void 0;return r.forEach(e.inEdges(i.v),(function(r){var i=e.edge(r),s=e.node(r.v);o&&a.push({v:r.v,w:r.w}),s.out-=i,l(t,n,s)})),r.forEach(e.outEdges(i.v),(function(r){var i=e.edge(r),o=r.w,a=e.node(o);a.in-=i,l(t,n,a)})),e.removeNode(i.v),a}function l(e,t,n){n.out?n.in?e[n.out-n.in+t].enqueue(n):e[e.length-1].enqueue(n):e[0].enqueue(n)}},42529:(e,t,n)=>{"use strict";var r=n(43294),i=n(85247),o=n(20450),a=n(64618),s=n(8783).normalizeRanks,l=n(77908),c=n(8783).removeEmptyRanks,u=n(96820),d=n(49654),h=n(25128),f=n(73641),p=n(65784),v=n(8783),g=n(71310).Graph;e.exports=function(e,t){var n=t&&t.debugTiming?v.time:v.notime;n("layout",(function(){var t=n(" buildLayoutGraph",(function(){return function(e){var t=new g({multigraph:!0,compound:!0}),n=P(e.graph());return t.setGraph(r.merge({},y,S(n,m),r.pick(n,b))),r.forEach(e.nodes(),(function(n){var i=P(e.node(n));t.setNode(n,r.defaults(S(i,x),w)),t.setParent(n,e.parent(n))})),r.forEach(e.edges(),(function(n){var i=P(e.edge(n));t.setEdge(n,r.merge({},_,S(i,E),r.pick(i,k)))})),t}(e)}));n(" runLayout",(function(){!function(e,t){t(" makeSpaceForEdgeLabels",(function(){!function(e){var t=e.graph();t.ranksep/=2,r.forEach(e.edges(),(function(n){var r=e.edge(n);r.minlen*=2,"c"!==r.labelpos.toLowerCase()&&("TB"===t.rankdir||"BT"===t.rankdir?r.width+=r.labeloffset:r.height+=r.labeloffset)}))}(e)})),t(" removeSelfEdges",(function(){!function(e){r.forEach(e.edges(),(function(t){if(t.v===t.w){var n=e.node(t.v);n.selfEdges||(n.selfEdges=[]),n.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}}))}(e)})),t(" acyclic",(function(){i.run(e)})),t(" nestingGraph.run",(function(){u.run(e)})),t(" rank",(function(){a(v.asNonCompoundGraph(e))})),t(" injectEdgeLabelProxies",(function(){!function(e){r.forEach(e.edges(),(function(t){var n=e.edge(t);if(n.width&&n.height){var r=e.node(t.v),i={rank:(e.node(t.w).rank-r.rank)/2+r.rank,e:t};v.addDummyNode(e,"edge-proxy",i,"_ep")}}))}(e)})),t(" removeEmptyRanks",(function(){c(e)})),t(" nestingGraph.cleanup",(function(){u.cleanup(e)})),t(" normalizeRanks",(function(){s(e)})),t(" assignRankMinMax",(function(){!function(e){var t=0;r.forEach(e.nodes(),(function(n){var i=e.node(n);i.borderTop&&(i.minRank=e.node(i.borderTop).rank,i.maxRank=e.node(i.borderBottom).rank,t=r.max(t,i.maxRank))})),e.graph().maxRank=t}(e)})),t(" removeEdgeLabelProxies",(function(){!function(e){r.forEach(e.nodes(),(function(t){var n=e.node(t);"edge-proxy"===n.dummy&&(e.edge(n.e).labelRank=n.rank,e.removeNode(t))}))}(e)})),t(" normalize.run",(function(){o.run(e)})),t(" parentDummyChains",(function(){l(e)})),t(" addBorderSegments",(function(){d(e)})),t(" order",(function(){f(e)})),t(" insertSelfEdges",(function(){!function(e){var t=v.buildLayerMatrix(e);r.forEach(t,(function(t){var n=0;r.forEach(t,(function(t,i){var o=e.node(t);o.order=i+n,r.forEach(o.selfEdges,(function(t){v.addDummyNode(e,"selfedge",{width:t.label.width,height:t.label.height,rank:o.rank,order:i+ ++n,e:t.e,label:t.label},"_se")})),delete o.selfEdges}))}))}(e)})),t(" adjustCoordinateSystem",(function(){h.adjust(e)})),t(" position",(function(){p(e)})),t(" positionSelfEdges",(function(){!function(e){r.forEach(e.nodes(),(function(t){var n=e.node(t);if("selfedge"===n.dummy){var r=e.node(n.e.v),i=r.x+r.width/2,o=r.y,a=n.x-i,s=r.height/2;e.setEdge(n.e,n.label),e.removeNode(t),n.label.points=[{x:i+2*a/3,y:o-s},{x:i+5*a/6,y:o-s},{x:i+a,y:o},{x:i+5*a/6,y:o+s},{x:i+2*a/3,y:o+s}],n.label.x=n.x,n.label.y=n.y}}))}(e)})),t(" removeBorderNodes",(function(){!function(e){r.forEach(e.nodes(),(function(t){if(e.children(t).length){var n=e.node(t),i=e.node(n.borderTop),o=e.node(n.borderBottom),a=e.node(r.last(n.borderLeft)),s=e.node(r.last(n.borderRight));n.width=Math.abs(s.x-a.x),n.height=Math.abs(o.y-i.y),n.x=a.x+n.width/2,n.y=i.y+n.height/2}})),r.forEach(e.nodes(),(function(t){"border"===e.node(t).dummy&&e.removeNode(t)}))}(e)})),t(" normalize.undo",(function(){o.undo(e)})),t(" fixupEdgeLabelCoords",(function(){!function(e){r.forEach(e.edges(),(function(t){var n=e.edge(t);if(r.has(n,"x"))switch("l"!==n.labelpos&&"r"!==n.labelpos||(n.width-=n.labeloffset),n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset}}))}(e)})),t(" undoCoordinateSystem",(function(){h.undo(e)})),t(" translateGraph",(function(){!function(e){var t=Number.POSITIVE_INFINITY,n=0,i=Number.POSITIVE_INFINITY,o=0,a=e.graph(),s=a.marginx||0,l=a.marginy||0;function c(e){var r=e.x,a=e.y,s=e.width,l=e.height;t=Math.min(t,r-s/2),n=Math.max(n,r+s/2),i=Math.min(i,a-l/2),o=Math.max(o,a+l/2)}r.forEach(e.nodes(),(function(t){c(e.node(t))})),r.forEach(e.edges(),(function(t){var n=e.edge(t);r.has(n,"x")&&c(n)})),t-=s,i-=l,r.forEach(e.nodes(),(function(n){var r=e.node(n);r.x-=t,r.y-=i})),r.forEach(e.edges(),(function(n){var o=e.edge(n);r.forEach(o.points,(function(e){e.x-=t,e.y-=i})),r.has(o,"x")&&(o.x-=t),r.has(o,"y")&&(o.y-=i)})),a.width=n-t+s,a.height=o-i+l}(e)})),t(" assignNodeIntersects",(function(){!function(e){r.forEach(e.edges(),(function(t){var n,r,i=e.edge(t),o=e.node(t.v),a=e.node(t.w);i.points?(n=i.points[0],r=i.points[i.points.length-1]):(i.points=[],n=a,r=o),i.points.unshift(v.intersectRect(o,n)),i.points.push(v.intersectRect(a,r))}))}(e)})),t(" reversePoints",(function(){!function(e){r.forEach(e.edges(),(function(t){var n=e.edge(t);n.reversed&&n.points.reverse()}))}(e)})),t(" acyclic.undo",(function(){i.undo(e)}))}(t,n)})),n(" updateInputGraph",(function(){!function(e,t){r.forEach(e.nodes(),(function(n){var r=e.node(n),i=t.node(n);r&&(r.x=i.x,r.y=i.y,t.children(n).length&&(r.width=i.width,r.height=i.height))})),r.forEach(e.edges(),(function(n){var i=e.edge(n),o=t.edge(n);i.points=o.points,r.has(o,"x")&&(i.x=o.x,i.y=o.y)})),e.graph().width=t.graph().width,e.graph().height=t.graph().height}(e,t)}))}))};var m=["nodesep","edgesep","ranksep","marginx","marginy"],y={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},b=["acyclicer","ranker","rankdir","align"],x=["width","height"],w={width:0,height:0},E=["minlen","weight","width","height","labeloffset"],_={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},k=["labelpos"];function S(e,t){return r.mapValues(r.pick(e,t),Number)}function P(e){var t={};return r.forEach(e,(function(e,n){t[n.toLowerCase()]=e})),t}},43294:(e,t,n)=>{var r;try{r={cloneDeep:n(9850),constant:n(86874),defaults:n(84573),each:n(79421),filter:n(90882),find:n(55281),flatten:n(35676),forEach:n(59756),forIn:n(20792),has:n(93352),isUndefined:n(84336),last:n(56974),map:n(16760),mapValues:n(34519),max:n(71644),merge:n(98537),min:n(65680),minBy:n(10937),now:n(61100),pick:n(13888),range:n(2689),reduce:n(58215),sortBy:n(829),uniqueId:n(74930),values:n(98346),zipObject:n(46150)}}catch(i){}r||(r=window._),e.exports=r},96820:(e,t,n)=>{var r=n(43294),i=n(8783);function o(e,t,n,a,s,l,c){var u=e.children(c);if(u.length){var d=i.addBorderNode(e,"_bt"),h=i.addBorderNode(e,"_bb"),f=e.node(c);e.setParent(d,c),f.borderTop=d,e.setParent(h,c),f.borderBottom=h,r.forEach(u,(function(r){o(e,t,n,a,s,l,r);var i=e.node(r),u=i.borderTop?i.borderTop:r,f=i.borderBottom?i.borderBottom:r,p=i.borderTop?a:2*a,v=u!==f?1:s-l[c]+1;e.setEdge(d,u,{weight:p,minlen:v,nestingEdge:!0}),e.setEdge(f,h,{weight:p,minlen:v,nestingEdge:!0})})),e.parent(c)||e.setEdge(t,d,{weight:0,minlen:s+l[c]})}else c!==t&&e.setEdge(t,c,{weight:0,minlen:n})}e.exports={run:function(e){var t=i.addDummyNode(e,"root",{},"_root"),n=function(e){var t={};function n(i,o){var a=e.children(i);a&&a.length&&r.forEach(a,(function(e){n(e,o+1)})),t[i]=o}return r.forEach(e.children(),(function(e){n(e,1)})),t}(e),a=r.max(r.values(n))-1,s=2*a+1;e.graph().nestingRoot=t,r.forEach(e.edges(),(function(t){e.edge(t).minlen*=s}));var l=function(e){return r.reduce(e.edges(),(function(t,n){return t+e.edge(n).weight}),0)}(e)+1;r.forEach(e.children(),(function(r){o(e,t,s,l,a,n,r)})),e.graph().nodeRankFactor=s},cleanup:function(e){var t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,r.forEach(e.edges(),(function(t){e.edge(t).nestingEdge&&e.removeEdge(t)}))}}},20450:(e,t,n)=>{"use strict";var r=n(43294),i=n(8783);e.exports={run:function(e){e.graph().dummyChains=[],r.forEach(e.edges(),(function(t){!function(e,t){var n,r,o,a=t.v,s=e.node(a).rank,l=t.w,c=e.node(l).rank,u=t.name,d=e.edge(t),h=d.labelRank;if(c===s+1)return;for(e.removeEdge(t),o=0,++s;s<c;++o,++s)d.points=[],r={width:0,height:0,edgeLabel:d,edgeObj:t,rank:s},n=i.addDummyNode(e,"edge",r,"_d"),s===h&&(r.width=d.width,r.height=d.height,r.dummy="edge-label",r.labelpos=d.labelpos),e.setEdge(a,n,{weight:d.weight},u),0===o&&e.graph().dummyChains.push(n),a=n;e.setEdge(a,l,{weight:d.weight},u)}(e,t)}))},undo:function(e){r.forEach(e.graph().dummyChains,(function(t){var n,r=e.node(t),i=r.edgeLabel;for(e.setEdge(r.edgeObj,i);r.dummy;)n=e.successors(t)[0],e.removeNode(t),i.points.push({x:r.x,y:r.y}),"edge-label"===r.dummy&&(i.x=r.x,i.y=r.y,i.width=r.width,i.height=r.height),t=n,r=e.node(t)}))}}},47897:(e,t,n)=>{var r=n(43294);e.exports=function(e,t,n){var i,o={};r.forEach(n,(function(n){for(var r,a,s=e.parent(n);s;){if((r=e.parent(s))?(a=o[r],o[r]=s):(a=i,i=s),a&&a!==s)return void t.setEdge(a,s);s=r}}))}},29533:(e,t,n)=>{var r=n(43294);e.exports=function(e,t){return r.map(t,(function(t){var n=e.inEdges(t);if(n.length){var i=r.reduce(n,(function(t,n){var r=e.edge(n),i=e.node(n.v);return{sum:t.sum+r.weight*i.order,weight:t.weight+r.weight}}),{sum:0,weight:0});return{v:t,barycenter:i.sum/i.weight,weight:i.weight}}return{v:t}}))}},64622:(e,t,n)=>{var r=n(43294),i=n(71310).Graph;e.exports=function(e,t,n){var o=function(e){var t;for(;e.hasNode(t=r.uniqueId("_root")););return t}(e),a=new i({compound:!0}).setGraph({root:o}).setDefaultNodeLabel((function(t){return e.node(t)}));return r.forEach(e.nodes(),(function(i){var s=e.node(i),l=e.parent(i);(s.rank===t||s.minRank<=t&&t<=s.maxRank)&&(a.setNode(i),a.setParent(i,l||o),r.forEach(e[n](i),(function(t){var n=t.v===i?t.w:t.v,o=a.edge(n,i),s=r.isUndefined(o)?0:o.weight;a.setEdge(n,i,{weight:e.edge(t).weight+s})})),r.has(s,"minRank")&&a.setNode(i,{borderLeft:s.borderLeft[t],borderRight:s.borderRight[t]}))})),a}},6254:(e,t,n)=>{"use strict";var r=n(43294);function i(e,t,n){for(var i=r.zipObject(n,r.map(n,(function(e,t){return t}))),o=r.flatten(r.map(t,(function(t){return r.sortBy(r.map(e.outEdges(t),(function(t){return{pos:i[t.w],weight:e.edge(t).weight}})),"pos")})),!0),a=1;a<n.length;)a<<=1;var s=2*a-1;a-=1;var l=r.map(new Array(s),(function(){return 0})),c=0;return r.forEach(o.forEach((function(e){var t=e.pos+a;l[t]+=e.weight;for(var n=0;t>0;)t%2&&(n+=l[t+1]),l[t=t-1>>1]+=e.weight;c+=e.weight*n}))),c}e.exports=function(e,t){for(var n=0,r=1;r<t.length;++r)n+=i(e,t[r-1],t[r]);return n}},73641:(e,t,n)=>{"use strict";var r=n(43294),i=n(65036),o=n(6254),a=n(83956),s=n(64622),l=n(47897),c=n(71310).Graph,u=n(8783);function d(e,t,n){return r.map(t,(function(t){return s(e,t,n)}))}function h(e,t){var n=new c;r.forEach(e,(function(e){var i=e.graph().root,o=a(e,i,n,t);r.forEach(o.vs,(function(t,n){e.node(t).order=n})),l(e,n,o.vs)}))}function f(e,t){r.forEach(t,(function(t){r.forEach(t,(function(t,n){e.node(t).order=n}))}))}e.exports=function(e){var t=u.maxRank(e),n=d(e,r.range(1,t+1),"inEdges"),a=d(e,r.range(t-1,-1,-1),"outEdges"),s=i(e);f(e,s);for(var l,c=Number.POSITIVE_INFINITY,p=0,v=0;v<4;++p,++v){h(p%2?n:a,p%4>=2),s=u.buildLayerMatrix(e);var g=o(e,s);g<c&&(v=0,l=r.cloneDeep(s),c=g)}f(e,l)}},65036:(e,t,n)=>{"use strict";var r=n(43294);e.exports=function(e){var t={},n=r.filter(e.nodes(),(function(t){return!e.children(t).length})),i=r.max(r.map(n,(function(t){return e.node(t).rank}))),o=r.map(r.range(i+1),(function(){return[]}));var a=r.sortBy(n,(function(t){return e.node(t).rank}));return r.forEach(a,(function n(i){if(r.has(t,i))return;t[i]=!0;var a=e.node(i);o[a.rank].push(i),r.forEach(e.successors(i),n)})),o}},39953:(e,t,n)=>{"use strict";var r=n(43294);e.exports=function(e,t){var n={};return r.forEach(e,(function(e,t){var i=n[e.v]={indegree:0,in:[],out:[],vs:[e.v],i:t};r.isUndefined(e.barycenter)||(i.barycenter=e.barycenter,i.weight=e.weight)})),r.forEach(t.edges(),(function(e){var t=n[e.v],i=n[e.w];r.isUndefined(t)||r.isUndefined(i)||(i.indegree++,t.out.push(n[e.w]))})),function(e){var t=[];function n(e){return function(t){t.merged||(r.isUndefined(t.barycenter)||r.isUndefined(e.barycenter)||t.barycenter>=e.barycenter)&&function(e,t){var n=0,r=0;e.weight&&(n+=e.barycenter*e.weight,r+=e.weight);t.weight&&(n+=t.barycenter*t.weight,r+=t.weight);e.vs=t.vs.concat(e.vs),e.barycenter=n/r,e.weight=r,e.i=Math.min(t.i,e.i),t.merged=!0}(e,t)}}function i(t){return function(n){n.in.push(t),0==--n.indegree&&e.push(n)}}for(;e.length;){var o=e.pop();t.push(o),r.forEach(o.in.reverse(),n(o)),r.forEach(o.out,i(o))}return r.map(r.filter(t,(function(e){return!e.merged})),(function(e){return r.pick(e,["vs","i","barycenter","weight"])}))}(r.filter(n,(function(e){return!e.indegree})))}},83956:(e,t,n)=>{var r=n(43294),i=n(29533),o=n(39953),a=n(11957);e.exports=function e(t,n,s,l){var c=t.children(n),u=t.node(n),d=u?u.borderLeft:void 0,h=u?u.borderRight:void 0,f={};d&&(c=r.filter(c,(function(e){return e!==d&&e!==h})));var p=i(t,c);r.forEach(p,(function(n){if(t.children(n.v).length){var i=e(t,n.v,s,l);f[n.v]=i,r.has(i,"barycenter")&&(o=n,a=i,r.isUndefined(o.barycenter)?(o.barycenter=a.barycenter,o.weight=a.weight):(o.barycenter=(o.barycenter*o.weight+a.barycenter*a.weight)/(o.weight+a.weight),o.weight+=a.weight))}var o,a}));var v=o(p,s);!function(e,t){r.forEach(e,(function(e){e.vs=r.flatten(e.vs.map((function(e){return t[e]?t[e].vs:e})),!0)}))}(v,f);var g=a(v,l);if(d&&(g.vs=r.flatten([d,g.vs,h],!0),t.predecessors(d).length)){var m=t.node(t.predecessors(d)[0]),y=t.node(t.predecessors(h)[0]);r.has(g,"barycenter")||(g.barycenter=0,g.weight=0),g.barycenter=(g.barycenter*g.weight+m.order+y.order)/(g.weight+2),g.weight+=2}return g}},11957:(e,t,n)=>{var r=n(43294),i=n(8783);function o(e,t,n){for(var i;t.length&&(i=r.last(t)).i<=n;)t.pop(),e.push(i.vs),n++;return n}e.exports=function(e,t){var n=i.partition(e,(function(e){return r.has(e,"barycenter")})),a=n.lhs,s=r.sortBy(n.rhs,(function(e){return-e.i})),l=[],c=0,u=0,d=0;a.sort((h=!!t,function(e,t){return e.barycenter<t.barycenter?-1:e.barycenter>t.barycenter?1:h?t.i-e.i:e.i-t.i})),d=o(l,s,d),r.forEach(a,(function(e){d+=e.vs.length,l.push(e.vs),c+=e.barycenter*e.weight,u+=e.weight,d=o(l,s,d)}));var h;var f={vs:r.flatten(l,!0)};u&&(f.barycenter=c/u,f.weight=u);return f}},77908:(e,t,n)=>{var r=n(43294);e.exports=function(e){var t=function(e){var t={},n=0;function i(o){var a=n;r.forEach(e.children(o),i),t[o]={low:a,lim:n++}}return r.forEach(e.children(),i),t}(e);r.forEach(e.graph().dummyChains,(function(n){for(var r=e.node(n),i=r.edgeObj,o=function(e,t,n,r){var i,o,a=[],s=[],l=Math.min(t[n].low,t[r].low),c=Math.max(t[n].lim,t[r].lim);i=n;do{i=e.parent(i),a.push(i)}while(i&&(t[i].low>l||c>t[i].lim));o=i,i=r;for(;(i=e.parent(i))!==o;)s.push(i);return{path:a.concat(s.reverse()),lca:o}}(e,t,i.v,i.w),a=o.path,s=o.lca,l=0,c=a[l],u=!0;n!==i.w;){if(r=e.node(n),u){for(;(c=a[l])!==s&&e.node(c).maxRank<r.rank;)l++;c===s&&(u=!1)}if(!u){for(;l<a.length-1&&e.node(c=a[l+1]).minRank<=r.rank;)l++;c=a[l]}e.setParent(n,c),n=e.successors(n)[0]}}))}},91753:(e,t,n)=>{"use strict";var r=n(43294),i=n(71310).Graph,o=n(8783);function a(e,t){var n={};return r.reduce(t,(function(t,i){var o=0,a=0,s=t.length,c=r.last(i);return r.forEach(i,(function(t,u){var d=function(e,t){if(e.node(t).dummy)return r.find(e.predecessors(t),(function(t){return e.node(t).dummy}))}(e,t),h=d?e.node(d).order:s;(d||t===c)&&(r.forEach(i.slice(a,u+1),(function(t){r.forEach(e.predecessors(t),(function(r){var i=e.node(r),a=i.order;!(a<o||h<a)||i.dummy&&e.node(t).dummy||l(n,r,t)}))})),a=u+1,o=h)})),i})),n}function s(e,t){var n={};function i(t,i,o,a,s){var c;r.forEach(r.range(i,o),(function(i){c=t[i],e.node(c).dummy&&r.forEach(e.predecessors(c),(function(t){var r=e.node(t);r.dummy&&(r.order<a||r.order>s)&&l(n,t,c)}))}))}return r.reduce(t,(function(t,n){var o,a=-1,s=0;return r.forEach(n,(function(r,l){if("border"===e.node(r).dummy){var c=e.predecessors(r);c.length&&(o=e.node(c[0]).order,i(n,s,l,a,o),s=l,a=o)}i(n,s,n.length,o,t.length)})),n})),n}function l(e,t,n){if(t>n){var r=t;t=n,n=r}var i=e[t];i||(e[t]=i={}),i[n]=!0}function c(e,t,n){if(t>n){var i=t;t=n,n=i}return r.has(e[t],n)}function u(e,t,n,i){var o={},a={},s={};return r.forEach(t,(function(e){r.forEach(e,(function(e,t){o[e]=e,a[e]=e,s[e]=t}))})),r.forEach(t,(function(e){var t=-1;r.forEach(e,(function(e){var l=i(e);if(l.length){l=r.sortBy(l,(function(e){return s[e]}));for(var u=(l.length-1)/2,d=Math.floor(u),h=Math.ceil(u);d<=h;++d){var f=l[d];a[e]===e&&t<s[f]&&!c(n,e,f)&&(a[f]=e,a[e]=o[e]=o[f],t=s[f])}}}))})),{root:o,align:a}}function d(e,t,n,o,a){var s={},l=function(e,t,n,o){var a=new i,s=e.graph(),l=function(e,t,n){return function(i,o,a){var s,l=i.node(o),c=i.node(a),u=0;if(u+=l.width/2,r.has(l,"labelpos"))switch(l.labelpos.toLowerCase()){case"l":s=-l.width/2;break;case"r":s=l.width/2}if(s&&(u+=n?s:-s),s=0,u+=(l.dummy?t:e)/2,u+=(c.dummy?t:e)/2,u+=c.width/2,r.has(c,"labelpos"))switch(c.labelpos.toLowerCase()){case"l":s=c.width/2;break;case"r":s=-c.width/2}return s&&(u+=n?s:-s),s=0,u}}(s.nodesep,s.edgesep,o);return r.forEach(t,(function(t){var i;r.forEach(t,(function(t){var r=n[t];if(a.setNode(r),i){var o=n[i],s=a.edge(o,r);a.setEdge(o,r,Math.max(l(e,t,i),s||0))}i=t}))})),a}(e,t,n,a),c=a?"borderLeft":"borderRight";function u(e,t){for(var n=l.nodes(),r=n.pop(),i={};r;)i[r]?e(r):(i[r]=!0,n.push(r),n=n.concat(t(r))),r=n.pop()}return u((function(e){s[e]=l.inEdges(e).reduce((function(e,t){return Math.max(e,s[t.v]+l.edge(t))}),0)}),l.predecessors.bind(l)),u((function(t){var n=l.outEdges(t).reduce((function(e,t){return Math.min(e,s[t.w]-l.edge(t))}),Number.POSITIVE_INFINITY),r=e.node(t);n!==Number.POSITIVE_INFINITY&&r.borderType!==c&&(s[t]=Math.max(s[t],n))}),l.successors.bind(l)),r.forEach(o,(function(e){s[e]=s[n[e]]})),s}function h(e,t){return r.minBy(r.values(t),(function(t){var n=Number.NEGATIVE_INFINITY,i=Number.POSITIVE_INFINITY;return r.forIn(t,(function(t,r){var o=function(e,t){return e.node(t).width}(e,r)/2;n=Math.max(t+o,n),i=Math.min(t-o,i)})),n-i}))}function f(e,t){var n=r.values(t),i=r.min(n),o=r.max(n);r.forEach(["u","d"],(function(n){r.forEach(["l","r"],(function(a){var s,l=n+a,c=e[l];if(c!==t){var u=r.values(c);(s="l"===a?i-r.min(u):o-r.max(u))&&(e[l]=r.mapValues(c,(function(e){return e+s})))}}))}))}function p(e,t){return r.mapValues(e.ul,(function(n,i){if(t)return e[t.toLowerCase()][i];var o=r.sortBy(r.map(e,i));return(o[1]+o[2])/2}))}e.exports={positionX:function(e){var t,n=o.buildLayerMatrix(e),i=r.merge(a(e,n),s(e,n)),l={};r.forEach(["u","d"],(function(o){t="u"===o?n:r.values(n).reverse(),r.forEach(["l","r"],(function(n){"r"===n&&(t=r.map(t,(function(e){return r.values(e).reverse()})));var a=("u"===o?e.predecessors:e.successors).bind(e),s=u(e,t,i,a),c=d(e,t,s.root,s.align,"r"===n);"r"===n&&(c=r.mapValues(c,(function(e){return-e}))),l[o+n]=c}))}));var c=h(e,l);return f(l,c),p(l,e.graph().align)},findType1Conflicts:a,findType2Conflicts:s,addConflict:l,hasConflict:c,verticalAlignment:u,horizontalCompaction:d,alignCoordinates:f,findSmallestWidthAlignment:h,balance:p}},65784:(e,t,n)=>{"use strict";var r=n(43294),i=n(8783),o=n(91753).positionX;e.exports=function(e){(function(e){var t=i.buildLayerMatrix(e),n=e.graph().ranksep,o=0;r.forEach(t,(function(t){var i=r.max(r.map(t,(function(t){return e.node(t).height})));r.forEach(t,(function(t){e.node(t).y=o+i/2})),o+=i+n}))})(e=i.asNonCompoundGraph(e)),r.forEach(o(e),(function(t,n){e.node(n).x=t}))}},49154:(e,t,n)=>{"use strict";var r=n(43294),i=n(71310).Graph,o=n(85986).slack;function a(e,t){return r.forEach(e.nodes(),(function n(i){r.forEach(t.nodeEdges(i),(function(r){var a=r.v,s=i===a?r.w:a;e.hasNode(s)||o(t,r)||(e.setNode(s,{}),e.setEdge(i,s,{}),n(s))}))})),e.nodeCount()}function s(e,t){return r.minBy(t.edges(),(function(n){if(e.hasNode(n.v)!==e.hasNode(n.w))return o(t,n)}))}function l(e,t,n){r.forEach(e.nodes(),(function(e){t.node(e).rank+=n}))}e.exports=function(e){var t,n,r=new i({directed:!1}),c=e.nodes()[0],u=e.nodeCount();r.setNode(c,{});for(;a(r,e)<u;)t=s(r,e),n=r.hasNode(t.v)?o(e,t):-o(e,t),l(r,e,n);return r}},64618:(e,t,n)=>{"use strict";var r=n(85986).longestPath,i=n(49154),o=n(57310);e.exports=function(e){switch(e.graph().ranker){case"network-simplex":default:s(e);break;case"tight-tree":!function(e){r(e),i(e)}(e);break;case"longest-path":a(e)}};var a=r;function s(e){o(e)}},57310:(e,t,n)=>{"use strict";var r=n(43294),i=n(49154),o=n(85986).slack,a=n(85986).longestPath,s=n(71310).alg.preorder,l=n(71310).alg.postorder,c=n(8783).simplify;function u(e){e=c(e),a(e);var t,n=i(e);for(f(n),d(n,e);t=v(n);)m(n,e,t,g(n,e,t))}function d(e,t){var n=l(e,e.nodes());n=n.slice(0,n.length-1),r.forEach(n,(function(n){!function(e,t,n){var r=e.node(n).parent;e.edge(n,r).cutvalue=h(e,t,n)}(e,t,n)}))}function h(e,t,n){var i=e.node(n).parent,o=!0,a=t.edge(n,i),s=0;return a||(o=!1,a=t.edge(i,n)),s=a.weight,r.forEach(t.nodeEdges(n),(function(r){var a,l,c=r.v===n,u=c?r.w:r.v;if(u!==i){var d=c===o,h=t.edge(r).weight;if(s+=d?h:-h,a=n,l=u,e.hasEdge(a,l)){var f=e.edge(n,u).cutvalue;s+=d?-f:f}}})),s}function f(e,t){arguments.length<2&&(t=e.nodes()[0]),p(e,{},1,t)}function p(e,t,n,i,o){var a=n,s=e.node(i);return t[i]=!0,r.forEach(e.neighbors(i),(function(o){r.has(t,o)||(n=p(e,t,n,o,i))})),s.low=a,s.lim=n++,o?s.parent=o:delete s.parent,n}function v(e){return r.find(e.edges(),(function(t){return e.edge(t).cutvalue<0}))}function g(e,t,n){var i=n.v,a=n.w;t.hasEdge(i,a)||(i=n.w,a=n.v);var s=e.node(i),l=e.node(a),c=s,u=!1;s.lim>l.lim&&(c=l,u=!0);var d=r.filter(t.edges(),(function(t){return u===y(e,e.node(t.v),c)&&u!==y(e,e.node(t.w),c)}));return r.minBy(d,(function(e){return o(t,e)}))}function m(e,t,n,i){var o=n.v,a=n.w;e.removeEdge(o,a),e.setEdge(i.v,i.w,{}),f(e),d(e,t),function(e,t){var n=r.find(e.nodes(),(function(e){return!t.node(e).parent})),i=s(e,n);i=i.slice(1),r.forEach(i,(function(n){var r=e.node(n).parent,i=t.edge(n,r),o=!1;i||(i=t.edge(r,n),o=!0),t.node(n).rank=t.node(r).rank+(o?i.minlen:-i.minlen)}))}(e,t)}function y(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}e.exports=u,u.initLowLimValues=f,u.initCutValues=d,u.calcCutValue=h,u.leaveEdge=v,u.enterEdge=g,u.exchangeEdges=m},85986:(e,t,n)=>{"use strict";var r=n(43294);e.exports={longestPath:function(e){var t={};r.forEach(e.sources(),(function n(i){var o=e.node(i);if(r.has(t,i))return o.rank;t[i]=!0;var a=r.min(r.map(e.outEdges(i),(function(t){return n(t.w)-e.edge(t).minlen})));return a!==Number.POSITIVE_INFINITY&&null!=a||(a=0),o.rank=a}))},slack:function(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}}},8783:(e,t,n)=>{"use strict";var r=n(43294),i=n(71310).Graph;function o(e,t,n,i){var o;do{o=r.uniqueId(i)}while(e.hasNode(o));return n.dummy=t,e.setNode(o,n),o}function a(e){return r.max(r.map(e.nodes(),(function(t){var n=e.node(t).rank;if(!r.isUndefined(n))return n})))}e.exports={addDummyNode:o,simplify:function(e){var t=(new i).setGraph(e.graph());return r.forEach(e.nodes(),(function(n){t.setNode(n,e.node(n))})),r.forEach(e.edges(),(function(n){var r=t.edge(n.v,n.w)||{weight:0,minlen:1},i=e.edge(n);t.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})})),t},asNonCompoundGraph:function(e){var t=new i({multigraph:e.isMultigraph()}).setGraph(e.graph());return r.forEach(e.nodes(),(function(n){e.children(n).length||t.setNode(n,e.node(n))})),r.forEach(e.edges(),(function(n){t.setEdge(n,e.edge(n))})),t},successorWeights:function(e){var t=r.map(e.nodes(),(function(t){var n={};return r.forEach(e.outEdges(t),(function(t){n[t.w]=(n[t.w]||0)+e.edge(t).weight})),n}));return r.zipObject(e.nodes(),t)},predecessorWeights:function(e){var t=r.map(e.nodes(),(function(t){var n={};return r.forEach(e.inEdges(t),(function(t){n[t.v]=(n[t.v]||0)+e.edge(t).weight})),n}));return r.zipObject(e.nodes(),t)},intersectRect:function(e,t){var n,r,i=e.x,o=e.y,a=t.x-i,s=t.y-o,l=e.width/2,c=e.height/2;if(!a&&!s)throw new Error("Not possible to find intersection inside of the rectangle");Math.abs(s)*l>Math.abs(a)*c?(s<0&&(c=-c),n=c*a/s,r=c):(a<0&&(l=-l),n=l,r=l*s/a);return{x:i+n,y:o+r}},buildLayerMatrix:function(e){var t=r.map(r.range(a(e)+1),(function(){return[]}));return r.forEach(e.nodes(),(function(n){var i=e.node(n),o=i.rank;r.isUndefined(o)||(t[o][i.order]=n)})),t},normalizeRanks:function(e){var t=r.min(r.map(e.nodes(),(function(t){return e.node(t).rank})));r.forEach(e.nodes(),(function(n){var i=e.node(n);r.has(i,"rank")&&(i.rank-=t)}))},removeEmptyRanks:function(e){var t=r.min(r.map(e.nodes(),(function(t){return e.node(t).rank}))),n=[];r.forEach(e.nodes(),(function(r){var i=e.node(r).rank-t;n[i]||(n[i]=[]),n[i].push(r)}));var i=0,o=e.graph().nodeRankFactor;r.forEach(n,(function(t,n){r.isUndefined(t)&&n%o!=0?--i:i&&r.forEach(t,(function(t){e.node(t).rank+=i}))}))},addBorderNode:function(e,t,n,r){var i={width:0,height:0};arguments.length>=4&&(i.rank=n,i.order=r);return o(e,"border",i,t)},maxRank:a,partition:function(e,t){var n={lhs:[],rhs:[]};return r.forEach(e,(function(e){t(e)?n.lhs.push(e):n.rhs.push(e)})),n},time:function(e,t){var n=r.now();try{return t()}finally{console.log(e+" time: "+(r.now()-n)+"ms")}},notime:function(e,t){return t()}}},57589:e=>{e.exports="0.8.5"},77847:e=>{e.exports=a,a.default=a,a.stable=u,a.stableStringify=u;var t="[...]",n="[Circular]",r=[],i=[];function o(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function a(e,t,n,a){var s;void 0===a&&(a=o()),l(e,"",0,[],void 0,0,a);try{s=0===i.length?JSON.stringify(e,t,n):JSON.stringify(e,h(t),n)}catch(u){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==r.length;){var c=r.pop();4===c.length?Object.defineProperty(c[0],c[1],c[3]):c[0][c[1]]=c[2]}}return s}function s(e,t,n,o){var a=Object.getOwnPropertyDescriptor(o,n);void 0!==a.get?a.configurable?(Object.defineProperty(o,n,{value:e}),r.push([o,n,t,a])):i.push([t,n,e]):(o[n]=e,r.push([o,n,t]))}function l(e,r,i,o,a,c,u){var d;if(c+=1,"object"==typeof e&&null!==e){for(d=0;d<o.length;d++)if(o[d]===e)return void s(n,e,r,a);if(void 0!==u.depthLimit&&c>u.depthLimit)return void s(t,e,r,a);if(void 0!==u.edgesLimit&&i+1>u.edgesLimit)return void s(t,e,r,a);if(o.push(e),Array.isArray(e))for(d=0;d<e.length;d++)l(e[d],d,d,o,e,c,u);else{var h=Object.keys(e);for(d=0;d<h.length;d++){var f=h[d];l(e[f],f,d,o,e,c,u)}}o.pop()}}function c(e,t){return e<t?-1:e>t?1:0}function u(e,t,n,a){void 0===a&&(a=o());var s,l=d(e,"",0,[],void 0,0,a)||e;try{s=0===i.length?JSON.stringify(l,t,n):JSON.stringify(l,h(t),n)}catch(u){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==r.length;){var c=r.pop();4===c.length?Object.defineProperty(c[0],c[1],c[3]):c[0][c[1]]=c[2]}}return s}function d(e,i,o,a,l,u,h){var f;if(u+=1,"object"==typeof e&&null!==e){for(f=0;f<a.length;f++)if(a[f]===e)return void s(n,e,i,l);try{if("function"==typeof e.toJSON)return}catch(m){return}if(void 0!==h.depthLimit&&u>h.depthLimit)return void s(t,e,i,l);if(void 0!==h.edgesLimit&&o+1>h.edgesLimit)return void s(t,e,i,l);if(a.push(e),Array.isArray(e))for(f=0;f<e.length;f++)d(e[f],f,f,a,e,u,h);else{var p={},v=Object.keys(e).sort(c);for(f=0;f<v.length;f++){var g=v[f];d(e[g],g,f,a,e,u,h),p[g]=e[g]}if(void 0===l)return p;r.push([l,i,e]),l[i]=p}a.pop()}}function h(e){return e=void 0!==e?e:function(e,t){return t},function(t,n){if(i.length>0)for(var r=0;r<i.length;r++){var o=i[r];if(o[1]===t&&o[0]===n){n=o[2],i.splice(r,1);break}}return e.call(this,t,n)}}},87377:(e,t,n)=>{var r=n(89);e.exports={Graph:r.Graph,json:n(80109),alg:n(577),version:r.version}},70229:(e,t,n)=>{var r=n(60274);e.exports=function(e){var t,n={},i=[];function o(i){r.has(n,i)||(n[i]=!0,t.push(i),r.each(e.successors(i),o),r.each(e.predecessors(i),o))}return r.each(e.nodes(),(function(e){t=[],o(e),t.length&&i.push(t)})),i}},70223:(e,t,n)=>{var r=n(60274);function i(e,t,n,o,a,s){r.has(o,t)||(o[t]=!0,n||s.push(t),r.each(a(t),(function(t){i(e,t,n,o,a,s)})),n&&s.push(t))}e.exports=function(e,t,n){r.isArray(t)||(t=[t]);var o=(e.isDirected()?e.successors:e.neighbors).bind(e),a=[],s={};return r.each(t,(function(t){if(!e.hasNode(t))throw new Error("Graph does not have node: "+t);i(e,t,"post"===n,s,o,a)})),a}},19487:(e,t,n)=>{var r=n(16493),i=n(60274);e.exports=function(e,t,n){return i.transform(e.nodes(),(function(i,o){i[o]=r(e,o,t,n)}),{})}},16493:(e,t,n)=>{var r=n(60274),i=n(70905);e.exports=function(e,t,n,r){return function(e,t,n,r){var o,a,s={},l=new i,c=function(e){var t=e.v!==o?e.v:e.w,r=s[t],i=n(e),c=a.distance+i;if(i<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+e+" Weight: "+i);c<r.distance&&(r.distance=c,r.predecessor=o,l.decrease(t,c))};e.nodes().forEach((function(e){var n=e===t?0:Number.POSITIVE_INFINITY;s[e]={distance:n},l.add(e,n)}));for(;l.size()>0&&(o=l.removeMin(),(a=s[o]).distance!==Number.POSITIVE_INFINITY);)r(o).forEach(c);return s}(e,String(t),n||o,r||function(t){return e.outEdges(t)})};var o=r.constant(1)},24395:(e,t,n)=>{var r=n(60274),i=n(99289);e.exports=function(e){return r.filter(i(e),(function(t){return t.length>1||1===t.length&&e.hasEdge(t[0],t[0])}))}},92077:(e,t,n)=>{var r=n(60274);e.exports=function(e,t,n){return function(e,t,n){var r={},i=e.nodes();return i.forEach((function(e){r[e]={},r[e][e]={distance:0},i.forEach((function(t){e!==t&&(r[e][t]={distance:Number.POSITIVE_INFINITY})})),n(e).forEach((function(n){var i=n.v===e?n.w:n.v,o=t(n);r[e][i]={distance:o,predecessor:e}}))})),i.forEach((function(e){var t=r[e];i.forEach((function(n){var o=r[n];i.forEach((function(n){var r=o[e],i=t[n],a=o[n],s=r.distance+i.distance;s<a.distance&&(a.distance=s,a.predecessor=i.predecessor)}))}))})),r}(e,t||i,n||function(t){return e.outEdges(t)})};var i=r.constant(1)},577:(e,t,n)=>{e.exports={components:n(70229),dijkstra:n(16493),dijkstraAll:n(19487),findCycles:n(24395),floydWarshall:n(92077),isAcyclic:n(67141),postorder:n(34825),preorder:n(78852),prim:n(78492),tarjan:n(99289),topsort:n(69176)}},67141:(e,t,n)=>{var r=n(69176);e.exports=function(e){try{r(e)}catch(t){if(t instanceof r.CycleException)return!1;throw t}return!0}},34825:(e,t,n)=>{var r=n(70223);e.exports=function(e,t){return r(e,t,"post")}},78852:(e,t,n)=>{var r=n(70223);e.exports=function(e,t){return r(e,t,"pre")}},78492:(e,t,n)=>{var r=n(60274),i=n(53099),o=n(70905);e.exports=function(e,t){var n,a=new i,s={},l=new o;function c(e){var r=e.v===n?e.w:e.v,i=l.priority(r);if(void 0!==i){var o=t(e);o<i&&(s[r]=n,l.decrease(r,o))}}if(0===e.nodeCount())return a;r.each(e.nodes(),(function(e){l.add(e,Number.POSITIVE_INFINITY),a.setNode(e)})),l.decrease(e.nodes()[0],0);var u=!1;for(;l.size()>0;){if(n=l.removeMin(),r.has(s,n))a.setEdge(n,s[n]);else{if(u)throw new Error("Input graph is not connected: "+e);u=!0}e.nodeEdges(n).forEach(c)}return a}},99289:(e,t,n)=>{var r=n(60274);e.exports=function(e){var t=0,n=[],i={},o=[];function a(s){var l=i[s]={onStack:!0,lowlink:t,index:t++};if(n.push(s),e.successors(s).forEach((function(e){r.has(i,e)?i[e].onStack&&(l.lowlink=Math.min(l.lowlink,i[e].index)):(a(e),l.lowlink=Math.min(l.lowlink,i[e].lowlink))})),l.lowlink===l.index){var c,u=[];do{c=n.pop(),i[c].onStack=!1,u.push(c)}while(s!==c);o.push(u)}}return e.nodes().forEach((function(e){r.has(i,e)||a(e)})),o}},69176:(e,t,n)=>{var r=n(60274);function i(e){var t={},n={},i=[];if(r.each(e.sinks(),(function a(s){if(r.has(n,s))throw new o;r.has(t,s)||(n[s]=!0,t[s]=!0,r.each(e.predecessors(s),a),delete n[s],i.push(s))})),r.size(t)!==e.nodeCount())throw new o;return i}function o(){}e.exports=i,i.CycleException=o,o.prototype=new Error},70905:(e,t,n)=>{var r=n(60274);function i(){this._arr=[],this._keyIndices={}}e.exports=i,i.prototype.size=function(){return this._arr.length},i.prototype.keys=function(){return this._arr.map((function(e){return e.key}))},i.prototype.has=function(e){return r.has(this._keyIndices,e)},i.prototype.priority=function(e){var t=this._keyIndices[e];if(void 0!==t)return this._arr[t].priority},i.prototype.min=function(){if(0===this.size())throw new Error("Queue underflow");return this._arr[0].key},i.prototype.add=function(e,t){var n=this._keyIndices;if(e=String(e),!r.has(n,e)){var i=this._arr,o=i.length;return n[e]=o,i.push({key:e,priority:t}),this._decrease(o),!0}return!1},i.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var e=this._arr.pop();return delete this._keyIndices[e.key],this._heapify(0),e.key},i.prototype.decrease=function(e,t){var n=this._keyIndices[e];if(t>this._arr[n].priority)throw new Error("New priority is greater than current priority. Key: "+e+" Old: "+this._arr[n].priority+" New: "+t);this._arr[n].priority=t,this._decrease(n)},i.prototype._heapify=function(e){var t=this._arr,n=2*e,r=n+1,i=e;n<t.length&&(i=t[n].priority<t[i].priority?n:i,r<t.length&&(i=t[r].priority<t[i].priority?r:i),i!==e&&(this._swap(e,i),this._heapify(i)))},i.prototype._decrease=function(e){for(var t,n=this._arr,r=n[e].priority;0!==e&&!(n[t=e>>1].priority<r);)this._swap(e,t),e=t},i.prototype._swap=function(e,t){var n=this._arr,r=this._keyIndices,i=n[e],o=n[t];n[e]=o,n[t]=i,r[o.key]=e,r[i.key]=t}},53099:(e,t,n)=>{"use strict";var r=n(60274);e.exports=o;var i="\0";function o(e){this._isDirected=!r.has(e,"directed")||e.directed,this._isMultigraph=!!r.has(e,"multigraph")&&e.multigraph,this._isCompound=!!r.has(e,"compound")&&e.compound,this._label=void 0,this._defaultNodeLabelFn=r.constant(void 0),this._defaultEdgeLabelFn=r.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children["\0"]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}function a(e,t){e[t]?e[t]++:e[t]=1}function s(e,t){--e[t]||delete e[t]}function l(e,t,n,i){var o=""+t,a=""+n;if(!e&&o>a){var s=o;o=a,a=s}return o+"\x01"+a+"\x01"+(r.isUndefined(i)?"\0":i)}function c(e,t,n,r){var i=""+t,o=""+n;if(!e&&i>o){var a=i;i=o,o=a}var s={v:i,w:o};return r&&(s.name=r),s}function u(e,t){return l(e,t.v,t.w,t.name)}o.prototype._nodeCount=0,o.prototype._edgeCount=0,o.prototype.isDirected=function(){return this._isDirected},o.prototype.isMultigraph=function(){return this._isMultigraph},o.prototype.isCompound=function(){return this._isCompound},o.prototype.setGraph=function(e){return this._label=e,this},o.prototype.graph=function(){return this._label},o.prototype.setDefaultNodeLabel=function(e){return r.isFunction(e)||(e=r.constant(e)),this._defaultNodeLabelFn=e,this},o.prototype.nodeCount=function(){return this._nodeCount},o.prototype.nodes=function(){return r.keys(this._nodes)},o.prototype.sources=function(){var e=this;return r.filter(this.nodes(),(function(t){return r.isEmpty(e._in[t])}))},o.prototype.sinks=function(){var e=this;return r.filter(this.nodes(),(function(t){return r.isEmpty(e._out[t])}))},o.prototype.setNodes=function(e,t){var n=arguments,i=this;return r.each(e,(function(e){n.length>1?i.setNode(e,t):i.setNode(e)})),this},o.prototype.setNode=function(e,t){return r.has(this._nodes,e)?(arguments.length>1&&(this._nodes[e]=t),this):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=i,this._children[e]={},this._children["\0"][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)},o.prototype.node=function(e){return this._nodes[e]},o.prototype.hasNode=function(e){return r.has(this._nodes,e)},o.prototype.removeNode=function(e){var t=this;if(r.has(this._nodes,e)){var n=function(e){t.removeEdge(t._edgeObjs[e])};delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],r.each(this.children(e),(function(e){t.setParent(e)})),delete this._children[e]),r.each(r.keys(this._in[e]),n),delete this._in[e],delete this._preds[e],r.each(r.keys(this._out[e]),n),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this},o.prototype.setParent=function(e,t){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(r.isUndefined(t))t=i;else{for(var n=t+="";!r.isUndefined(n);n=this.parent(n))if(n===e)throw new Error("Setting "+t+" as parent of "+e+" would create a cycle");this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this},o.prototype._removeFromParentsChildList=function(e){delete this._children[this._parent[e]][e]},o.prototype.parent=function(e){if(this._isCompound){var t=this._parent[e];if(t!==i)return t}},o.prototype.children=function(e){if(r.isUndefined(e)&&(e=i),this._isCompound){var t=this._children[e];if(t)return r.keys(t)}else{if(e===i)return this.nodes();if(this.hasNode(e))return[]}},o.prototype.predecessors=function(e){var t=this._preds[e];if(t)return r.keys(t)},o.prototype.successors=function(e){var t=this._sucs[e];if(t)return r.keys(t)},o.prototype.neighbors=function(e){var t=this.predecessors(e);if(t)return r.union(t,this.successors(e))},o.prototype.isLeaf=function(e){return 0===(this.isDirected()?this.successors(e):this.neighbors(e)).length},o.prototype.filterNodes=function(e){var t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph());var n=this;r.each(this._nodes,(function(n,r){e(r)&&t.setNode(r,n)})),r.each(this._edgeObjs,(function(e){t.hasNode(e.v)&&t.hasNode(e.w)&&t.setEdge(e,n.edge(e))}));var i={};function o(e){var r=n.parent(e);return void 0===r||t.hasNode(r)?(i[e]=r,r):r in i?i[r]:o(r)}return this._isCompound&&r.each(t.nodes(),(function(e){t.setParent(e,o(e))})),t},o.prototype.setDefaultEdgeLabel=function(e){return r.isFunction(e)||(e=r.constant(e)),this._defaultEdgeLabelFn=e,this},o.prototype.edgeCount=function(){return this._edgeCount},o.prototype.edges=function(){return r.values(this._edgeObjs)},o.prototype.setPath=function(e,t){var n=this,i=arguments;return r.reduce(e,(function(e,r){return i.length>1?n.setEdge(e,r,t):n.setEdge(e,r),r})),this},o.prototype.setEdge=function(){var e,t,n,i,o=!1,s=arguments[0];"object"==typeof s&&null!==s&&"v"in s?(e=s.v,t=s.w,n=s.name,2===arguments.length&&(i=arguments[1],o=!0)):(e=s,t=arguments[1],n=arguments[3],arguments.length>2&&(i=arguments[2],o=!0)),e=""+e,t=""+t,r.isUndefined(n)||(n=""+n);var u=l(this._isDirected,e,t,n);if(r.has(this._edgeLabels,u))return o&&(this._edgeLabels[u]=i),this;if(!r.isUndefined(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(t),this._edgeLabels[u]=o?i:this._defaultEdgeLabelFn(e,t,n);var d=c(this._isDirected,e,t,n);return e=d.v,t=d.w,Object.freeze(d),this._edgeObjs[u]=d,a(this._preds[t],e),a(this._sucs[e],t),this._in[t][u]=d,this._out[e][u]=d,this._edgeCount++,this},o.prototype.edge=function(e,t,n){var r=1===arguments.length?u(this._isDirected,arguments[0]):l(this._isDirected,e,t,n);return this._edgeLabels[r]},o.prototype.hasEdge=function(e,t,n){var i=1===arguments.length?u(this._isDirected,arguments[0]):l(this._isDirected,e,t,n);return r.has(this._edgeLabels,i)},o.prototype.removeEdge=function(e,t,n){var r=1===arguments.length?u(this._isDirected,arguments[0]):l(this._isDirected,e,t,n),i=this._edgeObjs[r];return i&&(e=i.v,t=i.w,delete this._edgeLabels[r],delete this._edgeObjs[r],s(this._preds[t],e),s(this._sucs[e],t),delete this._in[t][r],delete this._out[e][r],this._edgeCount--),this},o.prototype.inEdges=function(e,t){var n=this._in[e];if(n){var i=r.values(n);return t?r.filter(i,(function(e){return e.v===t})):i}},o.prototype.outEdges=function(e,t){var n=this._out[e];if(n){var i=r.values(n);return t?r.filter(i,(function(e){return e.w===t})):i}},o.prototype.nodeEdges=function(e,t){var n=this.inEdges(e,t);if(n)return n.concat(this.outEdges(e,t))}},89:(e,t,n)=>{e.exports={Graph:n(53099),version:n(90702)}},80109:(e,t,n)=>{var r=n(60274),i=n(53099);function o(e){return r.map(e.nodes(),(function(t){var n=e.node(t),i=e.parent(t),o={v:t};return r.isUndefined(n)||(o.value=n),r.isUndefined(i)||(o.parent=i),o}))}function a(e){return r.map(e.edges(),(function(t){var n=e.edge(t),i={v:t.v,w:t.w};return r.isUndefined(t.name)||(i.name=t.name),r.isUndefined(n)||(i.value=n),i}))}e.exports={write:function(e){var t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:o(e),edges:a(e)};r.isUndefined(e.graph())||(t.value=r.clone(e.graph()));return t},read:function(e){var t=new i(e.options).setGraph(e.value);return r.each(e.nodes,(function(e){t.setNode(e.v,e.value),e.parent&&t.setParent(e.v,e.parent)})),r.each(e.edges,(function(e){t.setEdge({v:e.v,w:e.w,name:e.name},e.value)})),t}}},60274:(e,t,n)=>{var r;try{r={clone:n(54004),constant:n(86874),each:n(79421),filter:n(90882),has:n(93352),isArray:n(86152),isEmpty:n(45455),isFunction:n(61049),isUndefined:n(84336),keys:n(90249),map:n(16760),reduce:n(58215),size:n(36402),transform:n(89466),union:n(26139),values:n(98346)}}catch(i){}r||(r=window._),e.exports=r},90702:e=>{e.exports="2.1.8"},71254:(e,t,n)=>{e.exports=n(38397)},38397:function(e,t){var n,r,i;(function(){var o,a,s,l,c,u,d,h,f,p,v,g,m,y,b;s=Math.floor,p=Math.min,a=function(e,t){return e<t?-1:e>t?1:0},f=function(e,t,n,r,i){var o;if(null==n&&(n=0),null==i&&(i=a),n<0)throw new Error("lo must be non-negative");for(null==r&&(r=e.length);n<r;)i(t,e[o=s((n+r)/2)])<0?r=o:n=o+1;return[].splice.apply(e,[n,n-n].concat(t)),t},u=function(e,t,n){return null==n&&(n=a),e.push(t),y(e,0,e.length-1,n)},c=function(e,t){var n,r;return null==t&&(t=a),n=e.pop(),e.length?(r=e[0],e[0]=n,b(e,0,t)):r=n,r},h=function(e,t,n){var r;return null==n&&(n=a),r=e[0],e[0]=t,b(e,0,n),r},d=function(e,t,n){var r;return null==n&&(n=a),e.length&&n(e[0],t)<0&&(t=(r=[e[0],t])[0],e[0]=r[1],b(e,0,n)),t},l=function(e,t){var n,r,i,o,l,c;for(null==t&&(t=a),o=(function(){c=[];for(var t=0,n=s(e.length/2);0<=n?t<n:t>n;0<=n?t++:t--)c.push(t);return c}).apply(this).reverse(),l=[],r=0,i=o.length;r<i;r++)n=o[r],l.push(b(e,n,t));return l},m=function(e,t,n){var r;if(null==n&&(n=a),-1!==(r=e.indexOf(t)))return y(e,0,r,n),b(e,r,n)},v=function(e,t,n){var r,i,o,s,c;if(null==n&&(n=a),!(i=e.slice(0,t)).length)return i;for(l(i,n),o=0,s=(c=e.slice(t)).length;o<s;o++)r=c[o],d(i,r,n);return i.sort(n).reverse()},g=function(e,t,n){var r,i,o,s,u,d,h,v,g;if(null==n&&(n=a),10*t<=e.length){if(!(o=e.slice(0,t).sort(n)).length)return o;for(i=o[o.length-1],s=0,d=(h=e.slice(t)).length;s<d;s++)n(r=h[s],i)<0&&(f(o,r,0,null,n),o.pop(),i=o[o.length-1]);return o}for(l(e,n),g=[],u=0,v=p(t,e.length);0<=v?u<v:u>v;0<=v?++u:--u)g.push(c(e,n));return g},y=function(e,t,n,r){var i,o,s;for(null==r&&(r=a),i=e[n];n>t&&r(i,o=e[s=n-1>>1])<0;)e[n]=o,n=s;return e[n]=i},b=function(e,t,n){var r,i,o,s,l;for(null==n&&(n=a),i=e.length,l=t,o=e[t],r=2*t+1;r<i;)(s=r+1)<i&&!(n(e[r],e[s])<0)&&(r=s),e[t]=e[r],r=2*(t=r)+1;return e[t]=o,y(e,l,t,n)},o=function(){function e(e){this.cmp=null!=e?e:a,this.nodes=[]}return e.push=u,e.pop=c,e.replace=h,e.pushpop=d,e.heapify=l,e.updateItem=m,e.nlargest=v,e.nsmallest=g,e.prototype.push=function(e){return u(this.nodes,e,this.cmp)},e.prototype.pop=function(){return c(this.nodes,this.cmp)},e.prototype.peek=function(){return this.nodes[0]},e.prototype.contains=function(e){return-1!==this.nodes.indexOf(e)},e.prototype.replace=function(e){return h(this.nodes,e,this.cmp)},e.prototype.pushpop=function(e){return d(this.nodes,e,this.cmp)},e.prototype.heapify=function(){return l(this.nodes,this.cmp)},e.prototype.updateItem=function(e){return m(this.nodes,e,this.cmp)},e.prototype.clear=function(){return this.nodes=[]},e.prototype.empty=function(){return 0===this.nodes.length},e.prototype.size=function(){return this.nodes.length},e.prototype.clone=function(){var t;return(t=new e).nodes=this.nodes.slice(0),t},e.prototype.toArray=function(){return this.nodes.slice(0)},e.prototype.insert=e.prototype.push,e.prototype.top=e.prototype.peek,e.prototype.front=e.prototype.peek,e.prototype.has=e.prototype.contains,e.prototype.copy=e.prototype.clone,e}(),r=[],void 0===(i="function"==typeof(n=function(){return o})?n.apply(t,r):n)||(e.exports=i)}).call(this)},50340:(e,t)=>{function n(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];throw Error("[Immer] minified error nr: "+e+(n.length?" "+n.map((function(e){return"'"+e+"'"})).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function r(e){return!!e&&!!e[X]}function i(e){var t;return!!e&&(function(e){if(!e||"object"!=typeof e)return!1;var t=Object.getPrototypeOf(e);if(null===t)return!0;var n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object||"function"==typeof n&&Function.toString.call(n)===K}(e)||Array.isArray(e)||!!e[U]||!!(null===(t=e.constructor)||void 0===t?void 0:t[U])||d(e)||h(e))}function o(e,t,n){void 0===n&&(n=!1),0===a(e)?(n?Object.keys:Z)(e).forEach((function(r){n&&"symbol"==typeof r||t(r,e[r],e)})):e.forEach((function(n,r){return t(r,n,e)}))}function a(e){var t=e[X];return t?t.t>3?t.t-4:t.t:Array.isArray(e)?1:d(e)?2:h(e)?3:0}function s(e,t){return 2===a(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function l(e,t){return 2===a(e)?e.get(t):e[t]}function c(e,t,n){var r=a(e);2===r?e.set(t,n):3===r?(e.delete(t),e.add(n)):e[t]=n}function u(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function d(e){return H&&e instanceof Map}function h(e){return W&&e instanceof Set}function f(e){return e.i||e.o}function p(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=Q(e);delete t[X];for(var n=Z(t),r=0;r<n.length;r++){var i=n[r],o=t[i];!1===o.writable&&(o.writable=!0,o.configurable=!0),(o.get||o.set)&&(t[i]={configurable:!0,writable:!0,enumerable:o.enumerable,value:e[i]})}return Object.create(Object.getPrototypeOf(e),t)}function v(e,t){return void 0===t&&(t=!1),m(e)||r(e)||!i(e)||(a(e)>1&&(e.set=e.add=e.clear=e.delete=g),Object.freeze(e),t&&o(e,(function(e,t){return v(t,!0)}),!0)),e}function g(){n(2)}function m(e){return null==e||"object"!=typeof e||Object.isFrozen(e)}function y(e){var t=J[e];return t||n(18,e),t}function b(e,t){J[e]||(J[e]=t)}function x(){return V}function w(e,t){t&&(y("Patches"),e.u=[],e.v=[],e.s=t)}function E(e){_(e),e.p.forEach(S),e.p=null}function _(e){e===V&&(V=e.l)}function k(e){return V={p:[],l:V,h:e,_:!0,m:0}}function S(e){var t=e[X];0===t.t||1===t.t?t.j():t.O=!0}function P(e,t){t.m=t.p.length;var r=t.p[0],o=void 0!==e&&e!==r;return t.h.S||y("ES5").P(t,e,o),o?(r[X].M&&(E(t),n(4)),i(e)&&(e=j(t,e),t.l||T(t,e)),t.u&&y("Patches").g(r[X].o,e,t.u,t.v)):e=j(t,r,[]),E(t),t.u&&t.s(t.u,t.v),e!==Y?e:void 0}function j(e,t,n){if(m(t))return t;var r=t[X];if(!r)return o(t,(function(i,o){return C(e,r,t,i,o,n)}),!0),t;if(r.A!==e)return t;if(!r.M)return T(e,r.o,!0),r.o;if(!r.R){r.R=!0,r.A.m--;var i=4===r.t||5===r.t?r.i=p(r.k):r.i;o(3===r.t?new Set(i):i,(function(t,o){return C(e,r,i,t,o,n)})),T(e,i,!1),n&&e.u&&y("Patches").F(r,n,e.u,e.v)}return r.i}function C(e,t,n,o,a,l){if(r(a)){var u=j(e,a,l&&t&&3!==t.t&&!s(t.D,o)?l.concat(o):void 0);if(c(n,o,u),!r(u))return;e._=!1}if(i(a)&&!m(a)){if(!e.h.K&&e.m<1)return;j(e,a),t&&t.A.l||T(e,a)}}function T(e,t,n){void 0===n&&(n=!1),e.h.K&&e._&&v(t,n)}function D(e,t){var n=e[X];return(n?f(n):e)[t]}function N(e,t){if(t in e)for(var n=Object.getPrototypeOf(e);n;){var r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Object.getPrototypeOf(n)}}function O(e){e.M||(e.M=!0,e.l&&O(e.l))}function M(e){e.i||(e.i=p(e.o))}function A(e,t,n){var r=d(t)?y("MapSet").$(t,n):h(t)?y("MapSet").C(t,n):e.S?function(e,t){var n=Array.isArray(e),r={t:n?1:0,A:t?t.A:x(),M:!1,R:!1,D:{},l:t,o:e,k:null,i:null,j:null,I:!1},i=r,o=ee;n&&(i=[r],o=te);var a=Proxy.revocable(i,o),s=a.revoke,l=a.proxy;return r.k=l,r.j=s,l}(t,n):y("ES5").J(t,n);return(n?n.A:x()).p.push(r),r}function R(e){return r(e)||n(22,e),function e(t){if(!i(t))return t;var n,r=t[X],s=a(t);if(r){if(!r.M&&(r.t<4||!y("ES5").N(r)))return r.o;r.R=!0,n=I(t,s),r.R=!1}else n=I(t,s);return o(n,(function(t,i){r&&l(r.o,t)===i||c(n,t,e(i))})),3===s?new Set(n):n}(e)}function I(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return p(e)}function L(){function e(e,t){var n=a[e];return n?n.enumerable=t:a[e]=n={configurable:!0,enumerable:t,get:function(){return ee.get(this[X],e)},set:function(t){ee.set(this[X],e,t)}},n}function t(e){for(var t=e.length-1;t>=0;t--){var r=e[t][X];if(!r.M)switch(r.t){case 5:i(r)&&O(r);break;case 4:n(r)&&O(r)}}}function n(e){for(var t=e.o,n=e.k,r=Z(n),i=r.length-1;i>=0;i--){var o=r[i];if(o!==X){var a=t[o];if(void 0===a&&!s(t,o))return!0;var l=n[o],c=l&&l[X];if(c?c.o!==a:!u(l,a))return!0}}var d=!!t[X];return r.length!==Z(t).length+(d?0:1)}function i(e){var t=e.k;if(t.length!==e.o.length)return!0;var n=Object.getOwnPropertyDescriptor(t,t.length-1);if(n&&!n.get)return!0;for(var r=0;r<t.length;r++)if(!t.hasOwnProperty(r))return!0;return!1}var a={};b("ES5",{J:function(t,n){var r=Array.isArray(t),i=function(t,n){if(t){for(var r=Array(n.length),i=0;i<n.length;i++)Object.defineProperty(r,""+i,e(i,!0));return r}var o=Q(n);delete o[X];for(var a=Z(o),s=0;s<a.length;s++){var l=a[s];o[l]=e(l,t||!!o[l].enumerable)}return Object.create(Object.getPrototypeOf(n),o)}(r,t),o={t:r?5:4,A:n?n.A:x(),M:!1,R:!1,D:{},l:n,o:t,k:i,i:null,O:!1,I:!1};return Object.defineProperty(i,X,{value:o,writable:!0}),i},P:function(e,n,a){a?r(n)&&n[X].A===e&&t(e.p):(e.u&&function e(t){if(t&&"object"==typeof t){var n=t[X];if(n){var r=n.o,a=n.k,l=n.D,c=n.t;if(4===c)o(a,(function(t){t!==X&&(void 0!==r[t]||s(r,t)?l[t]||e(a[t]):(l[t]=!0,O(n)))})),o(r,(function(e){void 0!==a[e]||s(a,e)||(l[e]=!1,O(n))}));else if(5===c){if(i(n)&&(O(n),l.length=!0),a.length<r.length)for(var u=a.length;u<r.length;u++)l[u]=!1;else for(var d=r.length;d<a.length;d++)l[d]=!0;for(var h=Math.min(a.length,r.length),f=0;f<h;f++)a.hasOwnProperty(f)||(l[f]=!0),void 0===l[f]&&e(a[f])}}}}(e.p[0]),t(e.p))},N:function(e){return 4===e.t?n(e):i(e)}})}function B(){function e(t){if(!i(t))return t;if(Array.isArray(t))return t.map(e);if(d(t))return new Map(Array.from(t.entries()).map((function(t){return[t[0],e(t[1])]})));if(h(t))return new Set(Array.from(t).map(e));var n=Object.create(Object.getPrototypeOf(t));for(var r in t)n[r]=e(t[r]);return s(t,U)&&(n[U]=t[U]),n}function t(t){return r(t)?e(t):t}var c="add";b("Patches",{W:function(t,r){return r.forEach((function(r){for(var i=r.path,o=r.op,s=t,u=0;u<i.length-1;u++){var d=a(s),h=""+i[u];0!==d&&1!==d||"__proto__"!==h&&"constructor"!==h||n(24),"function"==typeof s&&"prototype"===h&&n(24),"object"!=typeof(s=l(s,h))&&n(15,i.join("/"))}var f=a(s),p=e(r.value),v=i[i.length-1];switch(o){case"replace":switch(f){case 2:return s.set(v,p);case 3:n(16);default:return s[v]=p}case c:switch(f){case 1:return"-"===v?s.push(p):s.splice(v,0,p);case 2:return s.set(v,p);case 3:return s.add(p);default:return s[v]=p}case"remove":switch(f){case 1:return s.splice(v,1);case 2:return s.delete(v);case 3:return s.delete(r.value);default:return delete s[v]}default:n(17,o)}})),t},F:function(e,n,r,i){switch(e.t){case 0:case 4:case 2:return function(e,n,r,i){var a=e.o,u=e.i;o(e.D,(function(e,o){var d=l(a,e),h=l(u,e),f=o?s(a,e)?"replace":c:"remove";if(d!==h||"replace"!==f){var p=n.concat(e);r.push("remove"===f?{op:f,path:p}:{op:f,path:p,value:h}),i.push(f===c?{op:"remove",path:p}:"remove"===f?{op:c,path:p,value:t(d)}:{op:"replace",path:p,value:t(d)})}}))}(e,n,r,i);case 5:case 1:return function(e,n,r,i){var o=e.o,a=e.D,s=e.i;if(s.length<o.length){var l=[s,o];o=l[0],s=l[1];var u=[i,r];r=u[0],i=u[1]}for(var d=0;d<o.length;d++)if(a[d]&&s[d]!==o[d]){var h=n.concat([d]);r.push({op:"replace",path:h,value:t(s[d])}),i.push({op:"replace",path:h,value:t(o[d])})}for(var f=o.length;f<s.length;f++){var p=n.concat([f]);r.push({op:c,path:p,value:t(s[f])})}o.length<s.length&&i.push({op:"replace",path:n.concat(["length"]),value:o.length})}(e,n,r,i);case 3:return function(e,t,n,r){var i=e.o,o=e.i,a=0;i.forEach((function(e){if(!o.has(e)){var i=t.concat([a]);n.push({op:"remove",path:i,value:e}),r.unshift({op:c,path:i,value:e})}a++})),a=0,o.forEach((function(e){if(!i.has(e)){var o=t.concat([a]);n.push({op:c,path:o,value:e}),r.unshift({op:"remove",path:o,value:e})}a++}))}(e,n,r,i)}},g:function(e,t,n,r){n.push({op:"replace",path:[],value:t===Y?void 0:t}),r.push({op:"replace",path:[],value:e})}})}function F(){function e(e,t){function n(){this.constructor=e}s(e,t),e.prototype=(n.prototype=t.prototype,new n)}function t(e){e.i||(e.D=new Map,e.i=new Map(e.o))}function r(e){e.i||(e.i=new Set,e.o.forEach((function(t){if(i(t)){var n=A(e.A.h,t,e);e.p.set(t,n),e.i.add(n)}else e.i.add(t)})))}function a(e){e.O&&n(3,JSON.stringify(f(e)))}var s=function(e,t){return(s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},l=function(){function n(e,t){return this[X]={t:2,l:t,A:t?t.A:x(),M:!1,R:!1,i:void 0,D:void 0,o:e,k:this,I:!1,O:!1},this}e(n,Map);var r=n.prototype;return Object.defineProperty(r,"size",{get:function(){return f(this[X]).size}}),r.has=function(e){return f(this[X]).has(e)},r.set=function(e,n){var r=this[X];return a(r),f(r).has(e)&&f(r).get(e)===n||(t(r),O(r),r.D.set(e,!0),r.i.set(e,n),r.D.set(e,!0)),this},r.delete=function(e){if(!this.has(e))return!1;var n=this[X];return a(n),t(n),O(n),n.o.has(e)?n.D.set(e,!1):n.D.delete(e),n.i.delete(e),!0},r.clear=function(){var e=this[X];a(e),f(e).size&&(t(e),O(e),e.D=new Map,o(e.o,(function(t){e.D.set(t,!1)})),e.i.clear())},r.forEach=function(e,t){var n=this;f(this[X]).forEach((function(r,i){e.call(t,n.get(i),i,n)}))},r.get=function(e){var n=this[X];a(n);var r=f(n).get(e);if(n.R||!i(r))return r;if(r!==n.o.get(e))return r;var o=A(n.A.h,r,n);return t(n),n.i.set(e,o),o},r.keys=function(){return f(this[X]).keys()},r.values=function(){var e,t=this,n=this.keys();return(e={})[$]=function(){return t.values()},e.next=function(){var e=n.next();return e.done?e:{done:!1,value:t.get(e.value)}},e},r.entries=function(){var e,t=this,n=this.keys();return(e={})[$]=function(){return t.entries()},e.next=function(){var e=n.next();if(e.done)return e;var r=t.get(e.value);return{done:!1,value:[e.value,r]}},e},r[$]=function(){return this.entries()},n}(),c=function(){function t(e,t){return this[X]={t:3,l:t,A:t?t.A:x(),M:!1,R:!1,i:void 0,o:e,k:this,p:new Map,O:!1,I:!1},this}e(t,Set);var n=t.prototype;return Object.defineProperty(n,"size",{get:function(){return f(this[X]).size}}),n.has=function(e){var t=this[X];return a(t),t.i?!!t.i.has(e)||!(!t.p.has(e)||!t.i.has(t.p.get(e))):t.o.has(e)},n.add=function(e){var t=this[X];return a(t),this.has(e)||(r(t),O(t),t.i.add(e)),this},n.delete=function(e){if(!this.has(e))return!1;var t=this[X];return a(t),r(t),O(t),t.i.delete(e)||!!t.p.has(e)&&t.i.delete(t.p.get(e))},n.clear=function(){var e=this[X];a(e),f(e).size&&(r(e),O(e),e.i.clear())},n.values=function(){var e=this[X];return a(e),r(e),e.i.values()},n.entries=function(){var e=this[X];return a(e),r(e),e.i.entries()},n.keys=function(){return this.values()},n[$]=function(){return this.values()},n.forEach=function(e,t){for(var n=this.values(),r=n.next();!r.done;)e.call(t,r.value,r.value,this),r=n.next()},t}();b("MapSet",{$:function(e,t){return new l(e,t)},C:function(e,t){return new c(e,t)}})}var z;Object.defineProperty(t,"__esModule",{value:!0});var V,G="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),H="undefined"!=typeof Map,W="undefined"!=typeof Set,q="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,Y=G?Symbol.for("immer-nothing"):((z={})["immer-nothing"]=!0,z),U=G?Symbol.for("immer-draftable"):"__$immer_draftable",X=G?Symbol.for("immer-state"):"__$immer_state",$="undefined"!=typeof Symbol&&Symbol.iterator||"@@iterator",K=""+Object.prototype.constructor,Z="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,Q=Object.getOwnPropertyDescriptors||function(e){var t={};return Z(e).forEach((function(n){t[n]=Object.getOwnPropertyDescriptor(e,n)})),t},J={},ee={get:function(e,t){if(t===X)return e;var n=f(e);if(!s(n,t))return function(e,t,n){var r,i=N(t,n);return i?"value"in i?i.value:null===(r=i.get)||void 0===r?void 0:r.call(e.k):void 0}(e,n,t);var r=n[t];return e.R||!i(r)?r:r===D(e.o,t)?(M(e),e.i[t]=A(e.A.h,r,e)):r},has:function(e,t){return t in f(e)},ownKeys:function(e){return Reflect.ownKeys(f(e))},set:function(e,t,n){var r=N(f(e),t);if(null==r?void 0:r.set)return r.set.call(e.k,n),!0;if(!e.M){var i=D(f(e),t),o=null==i?void 0:i[X];if(o&&o.o===n)return e.i[t]=n,e.D[t]=!1,!0;if(u(n,i)&&(void 0!==n||s(e.o,t)))return!0;M(e),O(e)}return e.i[t]===n&&"number"!=typeof n&&(void 0!==n||t in e.i)||(e.i[t]=n,e.D[t]=!0,!0)},deleteProperty:function(e,t){return void 0!==D(e.o,t)||t in e.o?(e.D[t]=!1,M(e),O(e)):delete e.D[t],e.i&&delete e.i[t],!0},getOwnPropertyDescriptor:function(e,t){var n=f(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r?{writable:!0,configurable:1!==e.t||"length"!==t,enumerable:r.enumerable,value:n[t]}:r},defineProperty:function(){n(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.o)},setPrototypeOf:function(){n(12)}},te={};o(ee,(function(e,t){te[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),te.deleteProperty=function(e,t){return te.set.call(this,e,t,void 0)},te.set=function(e,t,n){return ee.set.call(this,e[0],t,n,e[0])};var ne=function(){function e(e){var t=this;this.S=q,this.K=!0,this.produce=function(e,r,o){if("function"==typeof e&&"function"!=typeof r){var a=r;r=e;var s=t;return function(e){var t=this;void 0===e&&(e=a);for(var n=arguments.length,i=Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];return s.produce(e,(function(e){var n;return(n=r).call.apply(n,[t,e].concat(i))}))}}var l;if("function"!=typeof r&&n(6),void 0!==o&&"function"!=typeof o&&n(7),i(e)){var c=k(t),u=A(t,e,void 0),d=!0;try{l=r(u),d=!1}finally{d?E(c):_(c)}return"undefined"!=typeof Promise&&l instanceof Promise?l.then((function(e){return w(c,o),P(e,c)}),(function(e){throw E(c),e})):(w(c,o),P(l,c))}if(!e||"object"!=typeof e){if(void 0===(l=r(e))&&(l=e),l===Y&&(l=void 0),t.K&&v(l,!0),o){var h=[],f=[];y("Patches").g(e,l,h,f),o(h,f)}return l}n(21,e)},this.produceWithPatches=function(e,n){if("function"==typeof e)return function(n){for(var r=arguments.length,i=Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];return t.produceWithPatches(n,(function(t){return e.apply(void 0,[t].concat(i))}))};var r,i,o=t.produce(e,n,(function(e,t){r=e,i=t}));return"undefined"!=typeof Promise&&o instanceof Promise?o.then((function(e){return[e,r,i]})):[o,r,i]},"boolean"==typeof(null==e?void 0:e.useProxies)&&this.setUseProxies(e.useProxies),"boolean"==typeof(null==e?void 0:e.autoFreeze)&&this.setAutoFreeze(e.autoFreeze)}var t=e.prototype;return t.createDraft=function(e){i(e)||n(8),r(e)&&(e=R(e));var t=k(this),o=A(this,e,void 0);return o[X].I=!0,_(t),o},t.finishDraft=function(e,t){var n=(e&&e[X]).A;return w(n,t),P(void 0,n)},t.setAutoFreeze=function(e){this.K=e},t.setUseProxies=function(e){e&&!q&&n(20),this.S=e},t.applyPatches=function(e,t){var n;for(n=t.length-1;n>=0;n--){var i=t[n];if(0===i.path.length&&"replace"===i.op){e=i.value;break}}n>-1&&(t=t.slice(n+1));var o=y("Patches").W;return r(e)?o(e,t):this.produce(e,(function(e){return o(e,t)}))},e}(),re=new ne,ie=re.produce,oe=re.produceWithPatches.bind(re),ae=re.setAutoFreeze.bind(re),se=re.setUseProxies.bind(re),le=re.applyPatches.bind(re),ce=re.createDraft.bind(re),ue=re.finishDraft.bind(re);t.Immer=ne,t.applyPatches=le,t.castDraft=function(e){return e},t.castImmutable=function(e){return e},t.createDraft=ce,t.current=R,t.default=ie,t.enableAllPlugins=function(){L(),F(),B()},t.enableES5=L,t.enableMapSet=F,t.enablePatches=B,t.finishDraft=ue,t.freeze=v,t.immerable=U,t.isDraft=r,t.isDraftable=i,t.nothing=Y,t.original=function(e){return r(e)||n(23,e),e[X].o},t.produce=ie,t.produceWithPatches=oe,t.setAutoFreeze=ae,t.setUseProxies=se},30412:(e,t,n)=>{"use strict";e.exports=n(50340)},39515:(e,t,n)=>{var r=n(38761)(n(37772),"DataView");e.exports=r},89612:(e,t,n)=>{var r=n(52118),i=n(96909),o=n(98138),a=n(4174),s=n(7942);function l(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}l.prototype.clear=r,l.prototype.delete=i,l.prototype.get=o,l.prototype.has=a,l.prototype.set=s,e.exports=l},80235:(e,t,n)=>{var r=n(3945),i=n(21846),o=n(88028),a=n(72344),s=n(94769);function l(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}l.prototype.clear=r,l.prototype.delete=i,l.prototype.get=o,l.prototype.has=a,l.prototype.set=s,e.exports=l},10326:(e,t,n)=>{var r=n(38761)(n(37772),"Map");e.exports=r},96738:(e,t,n)=>{var r=n(92411),i=n(36417),o=n(86928),a=n(79493),s=n(24150);function l(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}l.prototype.clear=r,l.prototype.delete=i,l.prototype.get=o,l.prototype.has=a,l.prototype.set=s,e.exports=l},52760:(e,t,n)=>{var r=n(38761)(n(37772),"Promise");e.exports=r},2143:(e,t,n)=>{var r=n(38761)(n(37772),"Set");e.exports=r},45386:(e,t,n)=>{var r=n(96738),i=n(52842),o=n(52482);function a(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new r;++t<n;)this.add(e[t])}a.prototype.add=a.prototype.push=i,a.prototype.has=o,e.exports=a},86571:(e,t,n)=>{var r=n(80235),i=n(15243),o=n(72858),a=n(4417),s=n(8605),l=n(71418);function c(e){var t=this.__data__=new r(e);this.size=t.size}c.prototype.clear=i,c.prototype.delete=o,c.prototype.get=a,c.prototype.has=s,c.prototype.set=l,e.exports=c},50857:(e,t,n)=>{var r=n(37772).Symbol;e.exports=r},79162:(e,t,n)=>{var r=n(37772).Uint8Array;e.exports=r},93215:(e,t,n)=>{var r=n(38761)(n(37772),"WeakMap");e.exports=r},49432:e=>{e.exports=function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}},72517:e=>{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e}},67552:e=>{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,i=0,o=[];++n<r;){var a=e[n];t(a,n,e)&&(o[i++]=a)}return o}},38333:(e,t,n)=>{var r=n(77832);e.exports=function(e,t){return!!(null==e?0:e.length)&&r(e,t,0)>-1}},34893:e=>{e.exports=function(e,t,n){for(var r=-1,i=null==e?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}},1634:(e,t,n)=>{var r=n(36473),i=n(79631),o=n(86152),a=n(73226),s=n(39045),l=n(77598),c=Object.prototype.hasOwnProperty;e.exports=function(e,t){var n=o(e),u=!n&&i(e),d=!n&&!u&&a(e),h=!n&&!u&&!d&&l(e),f=n||u||d||h,p=f?r(e.length,String):[],v=p.length;for(var g in e)!t&&!c.call(e,g)||f&&("length"==g||d&&("offset"==g||"parent"==g)||h&&("buffer"==g||"byteLength"==g||"byteOffset"==g)||s(g,v))||p.push(g);return p}},50343:e=>{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}},65067:e=>{e.exports=function(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}},81207:e=>{e.exports=function(e,t,n,r){var i=-1,o=null==e?0:e.length;for(r&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}},87064:e=>{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}},8589:(e,t,n)=>{var r=n(20256)("length");e.exports=r},28582:(e,t,n)=>{var r=n(13940),i=n(41225);e.exports=function(e,t,n){(void 0!==n&&!i(e[t],n)||void 0===n&&!(t in e))&&r(e,t,n)}},60091:(e,t,n)=>{var r=n(13940),i=n(41225),o=Object.prototype.hasOwnProperty;e.exports=function(e,t,n){var a=e[t];o.call(e,t)&&i(a,n)&&(void 0!==n||t in e)||r(e,t,n)}},22218:(e,t,n)=>{var r=n(41225);e.exports=function(e,t){for(var n=e.length;n--;)if(r(e[n][0],t))return n;return-1}},67993:(e,t,n)=>{var r=n(752),i=n(90249);e.exports=function(e,t){return e&&r(t,i(t),e)}},55906:(e,t,n)=>{var r=n(752),i=n(18582);e.exports=function(e,t){return e&&r(t,i(t),e)}},13940:(e,t,n)=>{var r=n(83043);e.exports=function(e,t,n){"__proto__"==t&&r?r(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}},18874:(e,t,n)=>{var r=n(86571),i=n(72517),o=n(60091),a=n(67993),s=n(55906),l=n(92175),c=n(51522),u=n(7680),d=n(19987),h=n(13483),f=n(76939),p=n(70940),v=n(99917),g=n(8222),m=n(78725),y=n(86152),b=n(73226),x=n(4714),w=n(29259),E=n(43679),_=n(90249),k=n(18582),S="[object Arguments]",P="[object Function]",j="[object Object]",C={};C[S]=C["[object Array]"]=C["[object ArrayBuffer]"]=C["[object DataView]"]=C["[object Boolean]"]=C["[object Date]"]=C["[object Float32Array]"]=C["[object Float64Array]"]=C["[object Int8Array]"]=C["[object Int16Array]"]=C["[object Int32Array]"]=C["[object Map]"]=C["[object Number]"]=C[j]=C["[object RegExp]"]=C["[object Set]"]=C["[object String]"]=C["[object Symbol]"]=C["[object Uint8Array]"]=C["[object Uint8ClampedArray]"]=C["[object Uint16Array]"]=C["[object Uint32Array]"]=!0,C["[object Error]"]=C[P]=C["[object WeakMap]"]=!1,e.exports=function e(t,n,T,D,N,O){var M,A=1&n,R=2&n,I=4&n;if(T&&(M=N?T(t,D,N,O):T(t)),void 0!==M)return M;if(!w(t))return t;var L=y(t);if(L){if(M=v(t),!A)return c(t,M)}else{var B=p(t),F=B==P||"[object GeneratorFunction]"==B;if(b(t))return l(t,A);if(B==j||B==S||F&&!N){if(M=R||F?{}:m(t),!A)return R?d(t,s(M,t)):u(t,a(M,t))}else{if(!C[B])return N?t:{};M=g(t,B,A)}}O||(O=new r);var z=O.get(t);if(z)return z;O.set(t,M),E(t)?t.forEach((function(r){M.add(e(r,n,T,r,t,O))})):x(t)&&t.forEach((function(r,i){M.set(i,e(r,n,T,i,t,O))}));var V=L?void 0:(I?R?f:h:R?k:_)(t);return i(V||t,(function(r,i){V&&(r=t[i=r]),o(M,i,e(r,n,T,i,t,O))})),M}},39413:(e,t,n)=>{var r=n(29259),i=Object.create,o=function(){function e(){}return function(t){if(!r(t))return{};if(i)return i(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();e.exports=o},24303:(e,t,n)=>{var r=n(26548),i=n(92019)(r);e.exports=i},2229:(e,t,n)=>{var r=n(4795);e.exports=function(e,t,n){for(var i=-1,o=e.length;++i<o;){var a=e[i],s=t(a);if(null!=s&&(void 0===l?s==s&&!r(s):n(s,l)))var l=s,c=a}return c}},98043:(e,t,n)=>{var r=n(24303);e.exports=function(e,t){var n=[];return r(e,(function(e,r,i){t(e,r,i)&&n.push(e)})),n}},21359:e=>{e.exports=function(e,t,n,r){for(var i=e.length,o=n+(r?1:-1);r?o--:++o<i;)if(t(e[o],o,e))return o;return-1}},62034:(e,t,n)=>{var r=n(65067),i=n(95882);e.exports=function e(t,n,o,a,s){var l=-1,c=t.length;for(o||(o=i),s||(s=[]);++l<c;){var u=t[l];n>0&&o(u)?n>1?e(u,n-1,o,a,s):r(s,u):a||(s[s.length]=u)}return s}},15308:(e,t,n)=>{var r=n(55463)();e.exports=r},26548:(e,t,n)=>{var r=n(15308),i=n(90249);e.exports=function(e,t){return e&&r(e,t,i)}},13324:(e,t,n)=>{var r=n(17297),i=n(33812);e.exports=function(e,t){for(var n=0,o=(t=r(t,e)).length;null!=e&&n<o;)e=e[i(t[n++])];return n&&n==o?e:void 0}},1897:(e,t,n)=>{var r=n(65067),i=n(86152);e.exports=function(e,t,n){var o=t(e);return i(e)?o:r(o,n(e))}},53366:(e,t,n)=>{var r=n(50857),i=n(62107),o=n(37157),a=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":a&&a in Object(e)?i(e):o(e)}},84134:e=>{e.exports=function(e,t){return e>t}},32726:e=>{var t=Object.prototype.hasOwnProperty;e.exports=function(e,n){return null!=e&&t.call(e,n)}},20187:e=>{e.exports=function(e,t){return null!=e&&t in Object(e)}},77832:(e,t,n)=>{var r=n(21359),i=n(22195),o=n(66024);e.exports=function(e,t,n){return t==t?o(e,t,n):r(e,i,n)}},15183:(e,t,n)=>{var r=n(53366),i=n(15125);e.exports=function(e){return i(e)&&"[object Arguments]"==r(e)}},88746:(e,t,n)=>{var r=n(51952),i=n(15125);e.exports=function e(t,n,o,a,s){return t===n||(null==t||null==n||!i(t)&&!i(n)?t!=t&&n!=n:r(t,n,o,a,e,s))}},51952:(e,t,n)=>{var r=n(86571),i=n(74871),o=n(11491),a=n(17416),s=n(70940),l=n(86152),c=n(73226),u=n(77598),d="[object Arguments]",h="[object Array]",f="[object Object]",p=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,v,g,m){var y=l(e),b=l(t),x=y?h:s(e),w=b?h:s(t),E=(x=x==d?f:x)==f,_=(w=w==d?f:w)==f,k=x==w;if(k&&c(e)){if(!c(t))return!1;y=!0,E=!1}if(k&&!E)return m||(m=new r),y||u(e)?i(e,t,n,v,g,m):o(e,t,x,n,v,g,m);if(!(1&n)){var S=E&&p.call(e,"__wrapped__"),P=_&&p.call(t,"__wrapped__");if(S||P){var j=S?e.value():e,C=P?t.value():t;return m||(m=new r),g(j,C,n,v,m)}}return!!k&&(m||(m=new r),a(e,t,n,v,g,m))}},74511:(e,t,n)=>{var r=n(70940),i=n(15125);e.exports=function(e){return i(e)&&"[object Map]"==r(e)}},37036:(e,t,n)=>{var r=n(86571),i=n(88746);e.exports=function(e,t,n,o){var a=n.length,s=a,l=!o;if(null==e)return!s;for(e=Object(e);a--;){var c=n[a];if(l&&c[2]?c[1]!==e[c[0]]:!(c[0]in e))return!1}for(;++a<s;){var u=(c=n[a])[0],d=e[u],h=c[1];if(l&&c[2]){if(void 0===d&&!(u in e))return!1}else{var f=new r;if(o)var p=o(d,h,u,e,t,f);if(!(void 0===p?i(h,d,3,o,f):p))return!1}}return!0}},22195:e=>{e.exports=function(e){return e!=e}},6840:(e,t,n)=>{var r=n(61049),i=n(47394),o=n(29259),a=n(87035),s=/^\[object .+?Constructor\]$/,l=Function.prototype,c=Object.prototype,u=l.toString,d=c.hasOwnProperty,h=RegExp("^"+u.call(d).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!o(e)||i(e))&&(r(e)?h:s).test(a(e))}},8109:(e,t,n)=>{var r=n(70940),i=n(15125);e.exports=function(e){return i(e)&&"[object Set]"==r(e)}},35522:(e,t,n)=>{var r=n(53366),i=n(61158),o=n(15125),a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a["[object Arguments]"]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a["[object Function]"]=a["[object Map]"]=a["[object Number]"]=a["[object Object]"]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1,e.exports=function(e){return o(e)&&i(e.length)&&!!a[r(e)]}},68286:(e,t,n)=>{var r=n(26423),i=n(74716),o=n(23059),a=n(86152),s=n(65798);e.exports=function(e){return"function"==typeof e?e:null==e?o:"object"==typeof e?a(e)?i(e[0],e[1]):r(e):s(e)}},86411:(e,t,n)=>{var r=n(16001),i=n(54248),o=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return i(e);var t=[];for(var n in Object(e))o.call(e,n)&&"constructor"!=n&&t.push(n);return t}},18390:(e,t,n)=>{var r=n(29259),i=n(16001),o=n(62966),a=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return o(e);var t=i(e),n=[];for(var s in e)("constructor"!=s||!t&&a.call(e,s))&&n.push(s);return n}},17606:e=>{e.exports=function(e,t){return e<t}},93401:(e,t,n)=>{var r=n(24303),i=n(67878);e.exports=function(e,t){var n=-1,o=i(e)?Array(e.length):[];return r(e,(function(e,r,i){o[++n]=t(e,r,i)})),o}},26423:(e,t,n)=>{var r=n(37036),i=n(49882),o=n(73477);e.exports=function(e){var t=i(e);return 1==t.length&&t[0][2]?o(t[0][0],t[0][1]):function(n){return n===e||r(n,e,t)}}},74716:(e,t,n)=>{var r=n(88746),i=n(72579),o=n(95041),a=n(21401),s=n(28792),l=n(73477),c=n(33812);e.exports=function(e,t){return a(e)&&s(t)?l(c(e),t):function(n){var a=i(n,e);return void 0===a&&a===t?o(n,e):r(t,a,3)}}},84565:(e,t,n)=>{var r=n(86571),i=n(28582),o=n(15308),a=n(25561),s=n(29259),l=n(18582),c=n(52434);e.exports=function e(t,n,u,d,h){t!==n&&o(n,(function(o,l){if(h||(h=new r),s(o))a(t,n,l,u,e,d,h);else{var f=d?d(c(t,l),o,l+"",t,n,h):void 0;void 0===f&&(f=o),i(t,l,f)}}),l)}},25561:(e,t,n)=>{var r=n(28582),i=n(92175),o=n(6190),a=n(51522),s=n(78725),l=n(79631),c=n(86152),u=n(93746),d=n(73226),h=n(61049),f=n(29259),p=n(97030),v=n(77598),g=n(52434),m=n(63329);e.exports=function(e,t,n,y,b,x,w){var E=g(e,n),_=g(t,n),k=w.get(_);if(k)r(e,n,k);else{var S=x?x(E,_,n+"",e,t,w):void 0,P=void 0===S;if(P){var j=c(_),C=!j&&d(_),T=!j&&!C&&v(_);S=_,j||C||T?c(E)?S=E:u(E)?S=a(E):C?(P=!1,S=i(_,!0)):T?(P=!1,S=o(_,!0)):S=[]:p(_)||l(_)?(S=E,l(E)?S=m(E):f(E)&&!h(E)||(S=s(_))):P=!1}P&&(w.set(_,S),b(S,_,y,x,w),w.delete(_)),r(e,n,S)}}},23813:(e,t,n)=>{var r=n(50343),i=n(13324),o=n(68286),a=n(93401),s=n(27095),l=n(47826),c=n(18477),u=n(23059),d=n(86152);e.exports=function(e,t,n){t=t.length?r(t,(function(e){return d(e)?function(t){return i(t,1===e.length?e[0]:e)}:e})):[u];var h=-1;t=r(t,l(o));var f=a(e,(function(e,n,i){return{criteria:r(t,(function(t){return t(e)})),index:++h,value:e}}));return s(f,(function(e,t){return c(e,t,n)}))}},92602:(e,t,n)=>{var r=n(93759),i=n(95041);e.exports=function(e,t){return r(e,t,(function(t,n){return i(e,n)}))}},93759:(e,t,n)=>{var r=n(13324),i=n(82857),o=n(17297);e.exports=function(e,t,n){for(var a=-1,s=t.length,l={};++a<s;){var c=t[a],u=r(e,c);n(u,c)&&i(l,o(c,e),u)}return l}},20256:e=>{e.exports=function(e){return function(t){return null==t?void 0:t[e]}}},82952:(e,t,n)=>{var r=n(13324);e.exports=function(e){return function(t){return r(t,e)}}},93228:e=>{var t=Math.ceil,n=Math.max;e.exports=function(e,r,i,o){for(var a=-1,s=n(t((r-e)/(i||1)),0),l=Array(s);s--;)l[o?s:++a]=e,e+=i;return l}},5877:e=>{e.exports=function(e,t,n,r,i){return i(e,(function(e,i,o){n=r?(r=!1,e):t(n,e,i,o)})),n}},36060:(e,t,n)=>{var r=n(23059),i=n(43114),o=n(75251);e.exports=function(e,t){return o(i(e,t,r),e+"")}},82857:(e,t,n)=>{var r=n(60091),i=n(17297),o=n(39045),a=n(29259),s=n(33812);e.exports=function(e,t,n,l){if(!a(e))return e;for(var c=-1,u=(t=i(t,e)).length,d=u-1,h=e;null!=h&&++c<u;){var f=s(t[c]),p=n;if("__proto__"===f||"constructor"===f||"prototype"===f)return e;if(c!=d){var v=h[f];void 0===(p=l?l(v,f,h):void 0)&&(p=a(v)?v:o(t[c+1])?[]:{})}r(h,f,p),h=h[f]}return e}},86532:(e,t,n)=>{var r=n(86874),i=n(83043),o=n(23059),a=i?function(e,t){return i(e,"toString",{configurable:!0,enumerable:!1,value:r(t),writable:!0})}:o;e.exports=a},27095:e=>{e.exports=function(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}},36473:e=>{e.exports=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}},1054:(e,t,n)=>{var r=n(50857),i=n(50343),o=n(86152),a=n(4795),s=r?r.prototype:void 0,l=s?s.toString:void 0;e.exports=function e(t){if("string"==typeof t)return t;if(o(t))return i(t,e)+"";if(a(t))return l?l.call(t):"";var n=t+"";return"0"==n&&1/t==-Infinity?"-0":n}},51704:(e,t,n)=>{var r=n(52153),i=/^\s+/;e.exports=function(e){return e?e.slice(0,r(e)+1).replace(i,""):e}},47826:e=>{e.exports=function(e){return function(t){return e(t)}}},67326:(e,t,n)=>{var r=n(45386),i=n(38333),o=n(34893),a=n(59950),s=n(78803),l=n(16909);e.exports=function(e,t,n){var c=-1,u=i,d=e.length,h=!0,f=[],p=f;if(n)h=!1,u=o;else if(d>=200){var v=t?null:s(e);if(v)return l(v);h=!1,u=a,p=new r}else p=t?[]:f;e:for(;++c<d;){var g=e[c],m=t?t(g):g;if(g=n||0!==g?g:0,h&&m==m){for(var y=p.length;y--;)if(p[y]===m)continue e;t&&p.push(m),f.push(g)}else u(p,m,n)||(p!==f&&p.push(m),f.push(g))}return f}},50753:(e,t,n)=>{var r=n(50343);e.exports=function(e,t){return r(t,(function(t){return e[t]}))}},40509:e=>{e.exports=function(e,t,n){for(var r=-1,i=e.length,o=t.length,a={};++r<i;){var s=r<o?t[r]:void 0;n(a,e[r],s)}return a}},59950:e=>{e.exports=function(e,t){return e.has(t)}},89419:(e,t,n)=>{var r=n(23059);e.exports=function(e){return"function"==typeof e?e:r}},17297:(e,t,n)=>{var r=n(86152),i=n(21401),o=n(54452),a=n(66188);e.exports=function(e,t){return r(e)?e:i(e,t)?[e]:o(a(e))}},79882:(e,t,n)=>{var r=n(79162);e.exports=function(e){var t=new e.constructor(e.byteLength);return new r(t).set(new r(e)),t}},92175:(e,t,n)=>{e=n.nmd(e);var r=n(37772),i=t&&!t.nodeType&&t,o=i&&e&&!e.nodeType&&e,a=o&&o.exports===i?r.Buffer:void 0,s=a?a.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var n=e.length,r=s?s(n):new e.constructor(n);return e.copy(r),r}},34727:(e,t,n)=>{var r=n(79882);e.exports=function(e,t){var n=t?r(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}},96058:e=>{var t=/\w*$/;e.exports=function(e){var n=new e.constructor(e.source,t.exec(e));return n.lastIndex=e.lastIndex,n}},70169:(e,t,n)=>{var r=n(50857),i=r?r.prototype:void 0,o=i?i.valueOf:void 0;e.exports=function(e){return o?Object(o.call(e)):{}}},6190:(e,t,n)=>{var r=n(79882);e.exports=function(e,t){var n=t?r(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}},27520:(e,t,n)=>{var r=n(4795);e.exports=function(e,t){if(e!==t){var n=void 0!==e,i=null===e,o=e==e,a=r(e),s=void 0!==t,l=null===t,c=t==t,u=r(t);if(!l&&!u&&!a&&e>t||a&&s&&c&&!l&&!u||i&&s&&c||!n&&c||!o)return 1;if(!i&&!a&&!u&&e<t||u&&n&&o&&!i&&!a||l&&n&&o||!s&&o||!c)return-1}return 0}},18477:(e,t,n)=>{var r=n(27520);e.exports=function(e,t,n){for(var i=-1,o=e.criteria,a=t.criteria,s=o.length,l=n.length;++i<s;){var c=r(o[i],a[i]);if(c)return i>=l?c:c*("desc"==n[i]?-1:1)}return e.index-t.index}},51522:e=>{e.exports=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}},752:(e,t,n)=>{var r=n(60091),i=n(13940);e.exports=function(e,t,n,o){var a=!n;n||(n={});for(var s=-1,l=t.length;++s<l;){var c=t[s],u=o?o(n[c],e[c],c,n,e):void 0;void 0===u&&(u=e[c]),a?i(n,c,u):r(n,c,u)}return n}},7680:(e,t,n)=>{var r=n(752),i=n(80633);e.exports=function(e,t){return r(e,i(e),t)}},19987:(e,t,n)=>{var r=n(752),i=n(12680);e.exports=function(e,t){return r(e,i(e),t)}},24019:(e,t,n)=>{var r=n(37772)["__core-js_shared__"];e.exports=r},97263:(e,t,n)=>{var r=n(36060),i=n(82406);e.exports=function(e){return r((function(t,n){var r=-1,o=n.length,a=o>1?n[o-1]:void 0,s=o>2?n[2]:void 0;for(a=e.length>3&&"function"==typeof a?(o--,a):void 0,s&&i(n[0],n[1],s)&&(a=o<3?void 0:a,o=1),t=Object(t);++r<o;){var l=n[r];l&&e(t,l,r,a)}return t}))}},92019:(e,t,n)=>{var r=n(67878);e.exports=function(e,t){return function(n,i){if(null==n)return n;if(!r(n))return e(n,i);for(var o=n.length,a=t?o:-1,s=Object(n);(t?a--:++a<o)&&!1!==i(s[a],a,s););return n}}},55463:e=>{e.exports=function(e){return function(t,n,r){for(var i=-1,o=Object(t),a=r(t),s=a.length;s--;){var l=a[e?s:++i];if(!1===n(o[l],l,o))break}return t}}},98776:(e,t,n)=>{var r=n(68286),i=n(67878),o=n(90249);e.exports=function(e){return function(t,n,a){var s=Object(t);if(!i(t)){var l=r(n,3);t=o(t),n=function(e){return l(s[e],e,s)}}var c=e(t,n,a);return c>-1?s[l?t[c]:c]:void 0}}},82941:(e,t,n)=>{var r=n(93228),i=n(82406),o=n(5707);e.exports=function(e){return function(t,n,a){return a&&"number"!=typeof a&&i(t,n,a)&&(n=a=void 0),t=o(t),void 0===n?(n=t,t=0):n=o(n),a=void 0===a?t<n?1:-1:o(a),r(t,n,a,e)}}},78803:(e,t,n)=>{var r=n(2143),i=n(34291),o=n(16909),a=r&&1/o(new r([,-0]))[1]==1/0?function(e){return new r(e)}:i;e.exports=a},83043:(e,t,n)=>{var r=n(38761),i=function(){try{var e=r(Object,"defineProperty");return e({},"",{}),e}catch(t){}}();e.exports=i},74871:(e,t,n)=>{var r=n(45386),i=n(87064),o=n(59950);e.exports=function(e,t,n,a,s,l){var c=1&n,u=e.length,d=t.length;if(u!=d&&!(c&&d>u))return!1;var h=l.get(e),f=l.get(t);if(h&&f)return h==t&&f==e;var p=-1,v=!0,g=2&n?new r:void 0;for(l.set(e,t),l.set(t,e);++p<u;){var m=e[p],y=t[p];if(a)var b=c?a(y,m,p,t,e,l):a(m,y,p,e,t,l);if(void 0!==b){if(b)continue;v=!1;break}if(g){if(!i(t,(function(e,t){if(!o(g,t)&&(m===e||s(m,e,n,a,l)))return g.push(t)}))){v=!1;break}}else if(m!==y&&!s(m,y,n,a,l)){v=!1;break}}return l.delete(e),l.delete(t),v}},11491:(e,t,n)=>{var r=n(50857),i=n(79162),o=n(41225),a=n(74871),s=n(75179),l=n(16909),c=r?r.prototype:void 0,u=c?c.valueOf:void 0;e.exports=function(e,t,n,r,c,d,h){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!d(new i(e),new i(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return o(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var f=s;case"[object Set]":var p=1&r;if(f||(f=l),e.size!=t.size&&!p)return!1;var v=h.get(e);if(v)return v==t;r|=2,h.set(e,t);var g=a(f(e),f(t),r,c,d,h);return h.delete(e),g;case"[object Symbol]":if(u)return u.call(e)==u.call(t)}return!1}},17416:(e,t,n)=>{var r=n(13483),i=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,o,a,s){var l=1&n,c=r(e),u=c.length;if(u!=r(t).length&&!l)return!1;for(var d=u;d--;){var h=c[d];if(!(l?h in t:i.call(t,h)))return!1}var f=s.get(e),p=s.get(t);if(f&&p)return f==t&&p==e;var v=!0;s.set(e,t),s.set(t,e);for(var g=l;++d<u;){var m=e[h=c[d]],y=t[h];if(o)var b=l?o(y,m,h,t,e,s):o(m,y,h,e,t,s);if(!(void 0===b?m===y||a(m,y,n,o,s):b)){v=!1;break}g||(g="constructor"==h)}if(v&&!g){var x=e.constructor,w=t.constructor;x==w||!("constructor"in e)||!("constructor"in t)||"function"==typeof x&&x instanceof x&&"function"==typeof w&&w instanceof w||(v=!1)}return s.delete(e),s.delete(t),v}},29097:(e,t,n)=>{var r=n(35676),i=n(43114),o=n(75251);e.exports=function(e){return o(i(e,void 0,r),e+"")}},51242:e=>{var t="object"==typeof global&&global&&global.Object===Object&&global;e.exports=t},13483:(e,t,n)=>{var r=n(1897),i=n(80633),o=n(90249);e.exports=function(e){return r(e,o,i)}},76939:(e,t,n)=>{var r=n(1897),i=n(12680),o=n(18582);e.exports=function(e){return r(e,o,i)}},27937:(e,t,n)=>{var r=n(98304);e.exports=function(e,t){var n=e.__data__;return r(t)?n["string"==typeof t?"string":"hash"]:n.map}},49882:(e,t,n)=>{var r=n(28792),i=n(90249);e.exports=function(e){for(var t=i(e),n=t.length;n--;){var o=t[n],a=e[o];t[n]=[o,a,r(a)]}return t}},38761:(e,t,n)=>{var r=n(6840),i=n(98109);e.exports=function(e,t){var n=i(e,t);return r(n)?n:void 0}},47353:(e,t,n)=>{var r=n(60241)(Object.getPrototypeOf,Object);e.exports=r},62107:(e,t,n)=>{var r=n(50857),i=Object.prototype,o=i.hasOwnProperty,a=i.toString,s=r?r.toStringTag:void 0;e.exports=function(e){var t=o.call(e,s),n=e[s];try{e[s]=void 0;var r=!0}catch(l){}var i=a.call(e);return r&&(t?e[s]=n:delete e[s]),i}},80633:(e,t,n)=>{var r=n(67552),i=n(30981),o=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols,s=a?function(e){return null==e?[]:(e=Object(e),r(a(e),(function(t){return o.call(e,t)})))}:i;e.exports=s},12680:(e,t,n)=>{var r=n(65067),i=n(47353),o=n(80633),a=n(30981),s=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)r(t,o(e)),e=i(e);return t}:a;e.exports=s},70940:(e,t,n)=>{var r=n(39515),i=n(10326),o=n(52760),a=n(2143),s=n(93215),l=n(53366),c=n(87035),u="[object Map]",d="[object Promise]",h="[object Set]",f="[object WeakMap]",p="[object DataView]",v=c(r),g=c(i),m=c(o),y=c(a),b=c(s),x=l;(r&&x(new r(new ArrayBuffer(1)))!=p||i&&x(new i)!=u||o&&x(o.resolve())!=d||a&&x(new a)!=h||s&&x(new s)!=f)&&(x=function(e){var t=l(e),n="[object Object]"==t?e.constructor:void 0,r=n?c(n):"";if(r)switch(r){case v:return p;case g:return u;case m:return d;case y:return h;case b:return f}return t}),e.exports=x},98109:e=>{e.exports=function(e,t){return null==e?void 0:e[t]}},1369:(e,t,n)=>{var r=n(17297),i=n(79631),o=n(86152),a=n(39045),s=n(61158),l=n(33812);e.exports=function(e,t,n){for(var c=-1,u=(t=r(t,e)).length,d=!1;++c<u;){var h=l(t[c]);if(!(d=null!=e&&n(e,h)))break;e=e[h]}return d||++c!=u?d:!!(u=null==e?0:e.length)&&s(u)&&a(h,u)&&(o(e)||i(e))}},33880:e=>{var t=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");e.exports=function(e){return t.test(e)}},52118:(e,t,n)=>{var r=n(99191);e.exports=function(){this.__data__=r?r(null):{},this.size=0}},96909:e=>{e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},98138:(e,t,n)=>{var r=n(99191),i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(r){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return i.call(t,e)?t[e]:void 0}},4174:(e,t,n)=>{var r=n(99191),i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return r?void 0!==t[e]:i.call(t,e)}},7942:(e,t,n)=>{var r=n(99191);e.exports=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=r&&void 0===t?"__lodash_hash_undefined__":t,this}},99917:e=>{var t=Object.prototype.hasOwnProperty;e.exports=function(e){var n=e.length,r=new e.constructor(n);return n&&"string"==typeof e[0]&&t.call(e,"index")&&(r.index=e.index,r.input=e.input),r}},8222:(e,t,n)=>{var r=n(79882),i=n(34727),o=n(96058),a=n(70169),s=n(6190);e.exports=function(e,t,n){var l=e.constructor;switch(t){case"[object ArrayBuffer]":return r(e);case"[object Boolean]":case"[object Date]":return new l(+e);case"[object DataView]":return i(e,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return s(e,n);case"[object Map]":case"[object Set]":return new l;case"[object Number]":case"[object String]":return new l(e);case"[object RegExp]":return o(e);case"[object Symbol]":return a(e)}}},78725:(e,t,n)=>{var r=n(39413),i=n(47353),o=n(16001);e.exports=function(e){return"function"!=typeof e.constructor||o(e)?{}:r(i(e))}},95882:(e,t,n)=>{var r=n(50857),i=n(79631),o=n(86152),a=r?r.isConcatSpreadable:void 0;e.exports=function(e){return o(e)||i(e)||!!(a&&e&&e[a])}},39045:e=>{var t=/^(?:0|[1-9]\d*)$/;e.exports=function(e,n){var r=typeof e;return!!(n=null==n?9007199254740991:n)&&("number"==r||"symbol"!=r&&t.test(e))&&e>-1&&e%1==0&&e<n}},82406:(e,t,n)=>{var r=n(41225),i=n(67878),o=n(39045),a=n(29259);e.exports=function(e,t,n){if(!a(n))return!1;var s=typeof t;return!!("number"==s?i(n)&&o(t,n.length):"string"==s&&t in n)&&r(n[t],e)}},21401:(e,t,n)=>{var r=n(86152),i=n(4795),o=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;e.exports=function(e,t){if(r(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!i(e))||(a.test(e)||!o.test(e)||null!=t&&e in Object(t))}},98304:e=>{e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},47394:(e,t,n)=>{var r,i=n(24019),o=(r=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";e.exports=function(e){return!!o&&o in e}},16001:e=>{var t=Object.prototype;e.exports=function(e){var n=e&&e.constructor;return e===("function"==typeof n&&n.prototype||t)}},28792:(e,t,n)=>{var r=n(29259);e.exports=function(e){return e==e&&!r(e)}},3945:e=>{e.exports=function(){this.__data__=[],this.size=0}},21846:(e,t,n)=>{var r=n(22218),i=Array.prototype.splice;e.exports=function(e){var t=this.__data__,n=r(t,e);return!(n<0)&&(n==t.length-1?t.pop():i.call(t,n,1),--this.size,!0)}},88028:(e,t,n)=>{var r=n(22218);e.exports=function(e){var t=this.__data__,n=r(t,e);return n<0?void 0:t[n][1]}},72344:(e,t,n)=>{var r=n(22218);e.exports=function(e){return r(this.__data__,e)>-1}},94769:(e,t,n)=>{var r=n(22218);e.exports=function(e,t){var n=this.__data__,i=r(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this}},92411:(e,t,n)=>{var r=n(89612),i=n(80235),o=n(10326);e.exports=function(){this.size=0,this.__data__={hash:new r,map:new(o||i),string:new r}}},36417:(e,t,n)=>{var r=n(27937);e.exports=function(e){var t=r(this,e).delete(e);return this.size-=t?1:0,t}},86928:(e,t,n)=>{var r=n(27937);e.exports=function(e){return r(this,e).get(e)}},79493:(e,t,n)=>{var r=n(27937);e.exports=function(e){return r(this,e).has(e)}},24150:(e,t,n)=>{var r=n(27937);e.exports=function(e,t){var n=r(this,e),i=n.size;return n.set(e,t),this.size+=n.size==i?0:1,this}},75179:e=>{e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}},73477:e=>{e.exports=function(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in Object(n)))}}},77777:(e,t,n)=>{var r=n(30733);e.exports=function(e){var t=r(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t}},99191:(e,t,n)=>{var r=n(38761)(Object,"create");e.exports=r},54248:(e,t,n)=>{var r=n(60241)(Object.keys,Object);e.exports=r},62966:e=>{e.exports=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}},4146:(e,t,n)=>{e=n.nmd(e);var r=n(51242),i=t&&!t.nodeType&&t,o=i&&e&&!e.nodeType&&e,a=o&&o.exports===i&&r.process,s=function(){try{var e=o&&o.require&&o.require("util").types;return e||a&&a.binding&&a.binding("util")}catch(t){}}();e.exports=s},37157:e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},60241:e=>{e.exports=function(e,t){return function(n){return e(t(n))}}},43114:(e,t,n)=>{var r=n(49432),i=Math.max;e.exports=function(e,t,n){return t=i(void 0===t?e.length-1:t,0),function(){for(var o=arguments,a=-1,s=i(o.length-t,0),l=Array(s);++a<s;)l[a]=o[t+a];a=-1;for(var c=Array(t+1);++a<t;)c[a]=o[a];return c[t]=n(l),r(e,this,c)}}},37772:(e,t,n)=>{var r=n(51242),i="object"==typeof self&&self&&self.Object===Object&&self,o=r||i||Function("return this")();e.exports=o},52434:e=>{e.exports=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}},52842:e=>{e.exports=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}},52482:e=>{e.exports=function(e){return this.__data__.has(e)}},16909:e=>{e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}},75251:(e,t,n)=>{var r=n(86532),i=n(97787)(r);e.exports=i},97787:e=>{var t=Date.now;e.exports=function(e){var n=0,r=0;return function(){var i=t(),o=16-(i-r);if(r=i,o>0){if(++n>=800)return arguments[0]}else n=0;return e.apply(void 0,arguments)}}},15243:(e,t,n)=>{var r=n(80235);e.exports=function(){this.__data__=new r,this.size=0}},72858:e=>{e.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},4417:e=>{e.exports=function(e){return this.__data__.get(e)}},8605:e=>{e.exports=function(e){return this.__data__.has(e)}},71418:(e,t,n)=>{var r=n(80235),i=n(10326),o=n(96738);e.exports=function(e,t){var n=this.__data__;if(n instanceof r){var a=n.__data__;if(!i||a.length<199)return a.push([e,t]),this.size=++n.size,this;n=this.__data__=new o(a)}return n.set(e,t),this.size=n.size,this}},66024:e=>{e.exports=function(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}},82302:(e,t,n)=>{var r=n(8589),i=n(33880),o=n(35555);e.exports=function(e){return i(e)?o(e):r(e)}},54452:(e,t,n)=>{var r=n(77777),i=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,o=/\\(\\)?/g,a=r((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(i,(function(e,n,r,i){t.push(r?i.replace(o,"$1"):n||e)})),t}));e.exports=a},33812:(e,t,n)=>{var r=n(4795);e.exports=function(e){if("string"==typeof e||r(e))return e;var t=e+"";return"0"==t&&1/e==-Infinity?"-0":t}},87035:e=>{var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(n){}try{return e+""}catch(n){}}return""}},52153:e=>{var t=/\s/;e.exports=function(e){for(var n=e.length;n--&&t.test(e.charAt(n)););return n}},35555:e=>{var t="[\\ud800-\\udfff]",n="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",r="\\ud83c[\\udffb-\\udfff]",i="[^\\ud800-\\udfff]",o="(?:\\ud83c[\\udde6-\\uddff]){2}",a="[\\ud800-\\udbff][\\udc00-\\udfff]",s="(?:"+n+"|"+r+")"+"?",l="[\\ufe0e\\ufe0f]?",c=l+s+("(?:\\u200d(?:"+[i,o,a].join("|")+")"+l+s+")*"),u="(?:"+[i+n+"?",n,o,a,t].join("|")+")",d=RegExp(r+"(?="+r+")|"+u+c,"g");e.exports=function(e){for(var t=d.lastIndex=0;d.test(e);)++t;return t}},54004:(e,t,n)=>{var r=n(18874);e.exports=function(e){return r(e,4)}},9850:(e,t,n)=>{var r=n(18874);e.exports=function(e){return r(e,5)}},86874:e=>{e.exports=function(e){return function(){return e}}},54073:(e,t,n)=>{var r=n(29259),i=n(61100),o=n(7642),a=Math.max,s=Math.min;e.exports=function(e,t,n){var l,c,u,d,h,f,p=0,v=!1,g=!1,m=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function y(t){var n=l,r=c;return l=c=void 0,p=t,d=e.apply(r,n)}function b(e){return p=e,h=setTimeout(w,t),v?y(e):d}function x(e){var n=e-f;return void 0===f||n>=t||n<0||g&&e-p>=u}function w(){var e=i();if(x(e))return E(e);h=setTimeout(w,function(e){var n=t-(e-f);return g?s(n,u-(e-p)):n}(e))}function E(e){return h=void 0,m&&l?y(e):(l=c=void 0,d)}function _(){var e=i(),n=x(e);if(l=arguments,c=this,f=e,n){if(void 0===h)return b(f);if(g)return clearTimeout(h),h=setTimeout(w,t),y(f)}return void 0===h&&(h=setTimeout(w,t)),d}return t=o(t)||0,r(n)&&(v=!!n.leading,u=(g="maxWait"in n)?a(o(n.maxWait)||0,t):u,m="trailing"in n?!!n.trailing:m),_.cancel=function(){void 0!==h&&clearTimeout(h),p=0,l=f=c=h=void 0},_.flush=function(){return void 0===h?d:E(i())},_}},84573:(e,t,n)=>{var r=n(36060),i=n(41225),o=n(82406),a=n(18582),s=Object.prototype,l=s.hasOwnProperty,c=r((function(e,t){e=Object(e);var n=-1,r=t.length,c=r>2?t[2]:void 0;for(c&&o(t[0],t[1],c)&&(r=1);++n<r;)for(var u=t[n],d=a(u),h=-1,f=d.length;++h<f;){var p=d[h],v=e[p];(void 0===v||i(v,s[p])&&!l.call(e,p))&&(e[p]=u[p])}return e}));e.exports=c},79421:(e,t,n)=>{e.exports=n(59756)},41225:e=>{e.exports=function(e,t){return e===t||e!=e&&t!=t}},90882:(e,t,n)=>{var r=n(67552),i=n(98043),o=n(68286),a=n(86152);e.exports=function(e,t){return(a(e)?r:i)(e,o(t,3))}},55281:(e,t,n)=>{var r=n(98776)(n(12982));e.exports=r},12982:(e,t,n)=>{var r=n(21359),i=n(68286),o=n(38101),a=Math.max;e.exports=function(e,t,n){var s=null==e?0:e.length;if(!s)return-1;var l=null==n?0:o(n);return l<0&&(l=a(s+l,0)),r(e,i(t,3),l)}},35676:(e,t,n)=>{var r=n(62034);e.exports=function(e){return(null==e?0:e.length)?r(e,1):[]}},59756:(e,t,n)=>{var r=n(72517),i=n(24303),o=n(89419),a=n(86152);e.exports=function(e,t){return(a(e)?r:i)(e,o(t))}},20792:(e,t,n)=>{var r=n(15308),i=n(89419),o=n(18582);e.exports=function(e,t){return null==e?e:r(e,i(t),o)}},72579:(e,t,n)=>{var r=n(13324);e.exports=function(e,t,n){var i=null==e?void 0:r(e,t);return void 0===i?n:i}},93352:(e,t,n)=>{var r=n(32726),i=n(1369);e.exports=function(e,t){return null!=e&&i(e,t,r)}},95041:(e,t,n)=>{var r=n(20187),i=n(1369);e.exports=function(e,t){return null!=e&&i(e,t,r)}},23059:e=>{e.exports=function(e){return e}},79631:(e,t,n)=>{var r=n(15183),i=n(15125),o=Object.prototype,a=o.hasOwnProperty,s=o.propertyIsEnumerable,l=r(function(){return arguments}())?r:function(e){return i(e)&&a.call(e,"callee")&&!s.call(e,"callee")};e.exports=l},86152:e=>{var t=Array.isArray;e.exports=t},67878:(e,t,n)=>{var r=n(61049),i=n(61158);e.exports=function(e){return null!=e&&i(e.length)&&!r(e)}},93746:(e,t,n)=>{var r=n(67878),i=n(15125);e.exports=function(e){return i(e)&&r(e)}},73226:(e,t,n)=>{e=n.nmd(e);var r=n(37772),i=n(36330),o=t&&!t.nodeType&&t,a=o&&e&&!e.nodeType&&e,s=a&&a.exports===o?r.Buffer:void 0,l=(s?s.isBuffer:void 0)||i;e.exports=l},45455:(e,t,n)=>{var r=n(86411),i=n(70940),o=n(79631),a=n(86152),s=n(67878),l=n(73226),c=n(16001),u=n(77598),d=Object.prototype.hasOwnProperty;e.exports=function(e){if(null==e)return!0;if(s(e)&&(a(e)||"string"==typeof e||"function"==typeof e.splice||l(e)||u(e)||o(e)))return!e.length;var t=i(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(c(e))return!r(e).length;for(var n in e)if(d.call(e,n))return!1;return!0}},61049:(e,t,n)=>{var r=n(53366),i=n(29259);e.exports=function(e){if(!i(e))return!1;var t=r(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},61158:e=>{e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},4714:(e,t,n)=>{var r=n(74511),i=n(47826),o=n(4146),a=o&&o.isMap,s=a?i(a):r;e.exports=s},29259:e=>{e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},15125:e=>{e.exports=function(e){return null!=e&&"object"==typeof e}},97030:(e,t,n)=>{var r=n(53366),i=n(47353),o=n(15125),a=Function.prototype,s=Object.prototype,l=a.toString,c=s.hasOwnProperty,u=l.call(Object);e.exports=function(e){if(!o(e)||"[object Object]"!=r(e))return!1;var t=i(e);if(null===t)return!0;var n=c.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&l.call(n)==u}},43679:(e,t,n)=>{var r=n(8109),i=n(47826),o=n(4146),a=o&&o.isSet,s=a?i(a):r;e.exports=s},85505:(e,t,n)=>{var r=n(53366),i=n(86152),o=n(15125);e.exports=function(e){return"string"==typeof e||!i(e)&&o(e)&&"[object String]"==r(e)}},4795:(e,t,n)=>{var r=n(53366),i=n(15125);e.exports=function(e){return"symbol"==typeof e||i(e)&&"[object Symbol]"==r(e)}},77598:(e,t,n)=>{var r=n(35522),i=n(47826),o=n(4146),a=o&&o.isTypedArray,s=a?i(a):r;e.exports=s},84336:e=>{e.exports=function(e){return void 0===e}},90249:(e,t,n)=>{var r=n(1634),i=n(86411),o=n(67878);e.exports=function(e){return o(e)?r(e):i(e)}},18582:(e,t,n)=>{var r=n(1634),i=n(18390),o=n(67878);e.exports=function(e){return o(e)?r(e,!0):i(e)}},56974:e=>{e.exports=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}},16760:(e,t,n)=>{var r=n(50343),i=n(68286),o=n(93401),a=n(86152);e.exports=function(e,t){return(a(e)?r:o)(e,i(t,3))}},34519:(e,t,n)=>{var r=n(13940),i=n(26548),o=n(68286);e.exports=function(e,t){var n={};return t=o(t,3),i(e,(function(e,i,o){r(n,i,t(e,i,o))})),n}},71644:(e,t,n)=>{var r=n(2229),i=n(84134),o=n(23059);e.exports=function(e){return e&&e.length?r(e,o,i):void 0}},30733:(e,t,n)=>{var r=n(96738);function i(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(i.Cache||r),n}i.Cache=r,e.exports=i},98537:(e,t,n)=>{var r=n(84565),i=n(97263)((function(e,t,n){r(e,t,n)}));e.exports=i},65680:(e,t,n)=>{var r=n(2229),i=n(17606),o=n(23059);e.exports=function(e){return e&&e.length?r(e,o,i):void 0}},10937:(e,t,n)=>{var r=n(2229),i=n(68286),o=n(17606);e.exports=function(e,t){return e&&e.length?r(e,i(t,2),o):void 0}},34291:e=>{e.exports=function(){}},61100:(e,t,n)=>{var r=n(37772);e.exports=function(){return r.Date.now()}},13888:(e,t,n)=>{var r=n(92602),i=n(29097)((function(e,t){return null==e?{}:r(e,t)}));e.exports=i},65798:(e,t,n)=>{var r=n(20256),i=n(82952),o=n(21401),a=n(33812);e.exports=function(e){return o(e)?r(a(e)):i(e)}},2689:(e,t,n)=>{var r=n(82941)();e.exports=r},58215:(e,t,n)=>{var r=n(81207),i=n(24303),o=n(68286),a=n(5877),s=n(86152);e.exports=function(e,t,n){var l=s(e)?r:a,c=arguments.length<3;return l(e,o(t,4),n,c,i)}},16765:(e,t,n)=>{var r=n(82857);e.exports=function(e,t,n){return null==e?e:r(e,t,n)}},36402:(e,t,n)=>{var r=n(86411),i=n(70940),o=n(67878),a=n(85505),s=n(82302);e.exports=function(e){if(null==e)return 0;if(o(e))return a(e)?s(e):e.length;var t=i(e);return"[object Map]"==t||"[object Set]"==t?e.size:r(e).length}},829:(e,t,n)=>{var r=n(62034),i=n(23813),o=n(36060),a=n(82406),s=o((function(e,t){if(null==e)return[];var n=t.length;return n>1&&a(e,t[0],t[1])?t=[]:n>2&&a(t[0],t[1],t[2])&&(t=[t[0]]),i(e,r(t,1),[])}));e.exports=s},30981:e=>{e.exports=function(){return[]}},36330:e=>{e.exports=function(){return!1}},5707:(e,t,n)=>{var r=n(7642),i=1/0;e.exports=function(e){return e?(e=r(e))===i||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}},38101:(e,t,n)=>{var r=n(5707);e.exports=function(e){var t=r(e),n=t%1;return t==t?n?t-n:t:0}},7642:(e,t,n)=>{var r=n(51704),i=n(29259),o=n(4795),a=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,l=/^0o[0-7]+$/i,c=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(o(e))return NaN;if(i(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=i(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var n=s.test(e);return n||l.test(e)?c(e.slice(2),n?2:8):a.test(e)?NaN:+e}},25497:(e,t,n)=>{var r=n(50343),i=n(51522),o=n(86152),a=n(4795),s=n(54452),l=n(33812),c=n(66188);e.exports=function(e){return o(e)?r(e,l):a(e)?[e]:i(s(c(e)))}},63329:(e,t,n)=>{var r=n(752),i=n(18582);e.exports=function(e){return r(e,i(e))}},66188:(e,t,n)=>{var r=n(1054);e.exports=function(e){return null==e?"":r(e)}},89466:(e,t,n)=>{var r=n(72517),i=n(39413),o=n(26548),a=n(68286),s=n(47353),l=n(86152),c=n(73226),u=n(61049),d=n(29259),h=n(77598);e.exports=function(e,t,n){var f=l(e),p=f||c(e)||h(e);if(t=a(t,4),null==n){var v=e&&e.constructor;n=p?f?new v:[]:d(e)&&u(v)?i(s(e)):{}}return(p?r:o)(e,(function(e,r,i){return t(n,e,r,i)})),n}},26139:(e,t,n)=>{var r=n(62034),i=n(36060),o=n(67326),a=n(93746),s=i((function(e){return o(r(e,1,a,!0))}));e.exports=s},74930:(e,t,n)=>{var r=n(66188),i=0;e.exports=function(e){var t=++i;return r(e)+t}},98346:(e,t,n)=>{var r=n(50753),i=n(90249);e.exports=function(e){return null==e?[]:r(e,i(e))}},46150:(e,t,n)=>{var r=n(60091),i=n(40509);e.exports=function(e,t){return i(e||[],t||[],r)}},12139:(e,t,n)=>{"use strict";n.r(t),n.d(t,{Children:()=>z,Component:()=>a.wA,Fragment:()=>a.HY,PureComponent:()=>A,StrictMode:()=>xe,Suspense:()=>H,SuspenseList:()=>Y,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:()=>de,cloneElement:()=>ve,createContext:()=>a.kr,createElement:()=>a.az,createFactory:()=>fe,createPortal:()=>K,createRef:()=>a.Vf,default:()=>we,findDOMNode:()=>me,flushSync:()=>be,forwardRef:()=>B,hydrate:()=>ne,isValidElement:()=>pe,lazy:()=>q,memo:()=>R,render:()=>te,unmountComponentAtNode:()=>ge,unstable_batchedUpdates:()=>ye,useCallback:()=>E,useContext:()=>_,useDebugValue:()=>k,useEffect:()=>m,useErrorBoundary:()=>S,useImperativeHandle:()=>x,useLayoutEffect:()=>y,useMemo:()=>w,useReducer:()=>g,useRef:()=>b,useState:()=>v,version:()=>he});var r,i,o,a=n(33847),s=0,l=[],c=a.YM.__b,u=a.YM.__r,d=a.YM.diffed,h=a.YM.__c,f=a.YM.unmount;function p(e,t){a.YM.__h&&a.YM.__h(i,e,s||t),s=0;var n=i.__H||(i.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function v(e){return s=1,g(N,e)}function g(e,t,n){var o=p(r++,2);return o.t=e,o.__c||(o.__=[n?n(t):N(void 0,t),function(e){var t=o.t(o.__[0],e);o.__[0]!==t&&(o.__=[t,o.__[1]],o.__c.setState({}))}],o.__c=i),o.__}function m(e,t){var n=p(r++,3);!a.YM.__s&&D(n.__H,t)&&(n.__=e,n.__H=t,i.__H.__h.push(n))}function y(e,t){var n=p(r++,4);!a.YM.__s&&D(n.__H,t)&&(n.__=e,n.__H=t,i.__h.push(n))}function b(e){return s=5,w((function(){return{current:e}}),[])}function x(e,t,n){s=6,y((function(){"function"==typeof e?e(t()):e&&(e.current=t())}),null==n?n:n.concat(e))}function w(e,t){var n=p(r++,7);return D(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function E(e,t){return s=8,w((function(){return e}),t)}function _(e){var t=i.context[e.__c],n=p(r++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(i)),t.props.value):e.__}function k(e,t){a.YM.useDebugValue&&a.YM.useDebugValue(t?t(e):e)}function S(e){var t=p(r++,10),n=v();return t.__=e,i.componentDidCatch||(i.componentDidCatch=function(e){t.__&&t.__(e),n[1](e)}),[n[0],function(){n[1](void 0)}]}function P(){var e;for(l.sort((function(e,t){return e.__v.__b-t.__v.__b}));e=l.pop();)if(e.__P)try{e.__H.__h.forEach(C),e.__H.__h.forEach(T),e.__H.__h=[]}catch(i){e.__H.__h=[],a.YM.__e(i,e.__v)}}a.YM.__b=function(e){i=null,c&&c(e)},a.YM.__r=function(e){u&&u(e),r=0;var t=(i=e.__c).__H;t&&(t.__h.forEach(C),t.__h.forEach(T),t.__h=[])},a.YM.diffed=function(e){d&&d(e);var t=e.__c;t&&t.__H&&t.__H.__h.length&&(1!==l.push(t)&&o===a.YM.requestAnimationFrame||((o=a.YM.requestAnimationFrame)||function(e){var t,n=function(){clearTimeout(r),j&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);j&&(t=requestAnimationFrame(n))})(P)),i=null},a.YM.__c=function(e,t){t.some((function(e){try{e.__h.forEach(C),e.__h=e.__h.filter((function(e){return!e.__||T(e)}))}catch(o){t.some((function(e){e.__h&&(e.__h=[])})),t=[],a.YM.__e(o,e.__v)}})),h&&h(e,t)},a.YM.unmount=function(e){f&&f(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach((function(e){try{C(e)}catch(e){t=e}})),t&&a.YM.__e(t,n.__v))};var j="function"==typeof requestAnimationFrame;function C(e){var t=i,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),i=t}function T(e){var t=i;e.__c=e.__(),i=t}function D(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function N(e,t){return"function"==typeof t?t(e):t}function O(e,t){for(var n in t)e[n]=t[n];return e}function M(e,t){for(var n in e)if("__source"!==n&&!(n in t))return!0;for(var r in t)if("__source"!==r&&e[r]!==t[r])return!0;return!1}function A(e){this.props=e}function R(e,t){function n(e){var n=this.props.ref,r=n==e.ref;return!r&&n&&(n.call?n(null):n.current=null),t?!t(this.props,e)||!r:M(this.props,e)}function r(t){return this.shouldComponentUpdate=n,(0,a.az)(e,t)}return r.displayName="Memo("+(e.displayName||e.name)+")",r.prototype.isReactComponent=!0,r.__f=!0,r}(A.prototype=new a.wA).isPureReactComponent=!0,A.prototype.shouldComponentUpdate=function(e,t){return M(this.props,e)||M(this.state,t)};var I=a.YM.__b;a.YM.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),I&&I(e)};var L="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function B(e){function t(t,n){var r=O({},t);return delete r.ref,e(r,(n=t.ref||n)&&("object"!=typeof n||"current"in n)?n:null)}return t.$$typeof=L,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var F=function(e,t){return null==e?null:(0,a.bR)((0,a.bR)(e).map(t))},z={map:F,forEach:F,count:function(e){return e?(0,a.bR)(e).length:0},only:function(e){var t=(0,a.bR)(e);if(1!==t.length)throw"Children.only";return t[0]},toArray:a.bR},V=a.YM.__e;a.YM.__e=function(e,t,n){if(e.then)for(var r,i=t;i=i.__;)if((r=i.__c)&&r.__c)return null==t.__e&&(t.__e=n.__e,t.__k=n.__k),r.__c(e,t);V(e,t,n)};var G=a.YM.unmount;function H(){this.__u=0,this.t=null,this.__b=null}function W(e){var t=e.__.__c;return t&&t.__e&&t.__e(e)}function q(e){var t,n,r;function i(i){if(t||(t=e()).then((function(e){n=e.default||e}),(function(e){r=e})),r)throw r;if(!n)throw t;return(0,a.az)(n,i)}return i.displayName="Lazy",i.__f=!0,i}function Y(){this.u=null,this.o=null}a.YM.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&!0===e.__h&&(e.type=null),G&&G(e)},(H.prototype=new a.wA).__c=function(e,t){var n=t.__c,r=this;null==r.t&&(r.t=[]),r.t.push(n);var i=W(r.__v),o=!1,a=function(){o||(o=!0,n.__R=null,i?i(s):s())};n.__R=a;var s=function(){if(!--r.__u){if(r.state.__e){var e=r.state.__e;r.__v.__k[0]=function e(t,n,r){return t&&(t.__v=null,t.__k=t.__k&&t.__k.map((function(t){return e(t,n,r)})),t.__c&&t.__c.__P===n&&(t.__e&&r.insertBefore(t.__e,t.__d),t.__c.__e=!0,t.__c.__P=r)),t}(e,e.__c.__P,e.__c.__O)}var t;for(r.setState({__e:r.__b=null});t=r.t.pop();)t.forceUpdate()}},l=!0===t.__h;r.__u++||l||r.setState({__e:r.__b=r.__v.__k[0]}),e.then(a,a)},H.prototype.componentWillUnmount=function(){this.t=[]},H.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=function e(t,n,r){return t&&(t.__c&&t.__c.__H&&(t.__c.__H.__.forEach((function(e){"function"==typeof e.__c&&e.__c()})),t.__c.__H=null),null!=(t=O({},t)).__c&&(t.__c.__P===r&&(t.__c.__P=n),t.__c=null),t.__k=t.__k&&t.__k.map((function(t){return e(t,n,r)}))),t}(this.__b,n,r.__O=r.__P)}this.__b=null}var i=t.__e&&(0,a.az)(a.HY,null,e.fallback);return i&&(i.__h=null),[(0,a.az)(a.HY,null,t.__e?null:e.children),i]};var U=function(e,t,n){if(++n[1]===n[0]&&e.o.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.o.size))for(n=e.u;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.u=n=n[2]}};function X(e){return this.getChildContext=function(){return e.context},e.children}function $(e){var t=this,n=e.i;t.componentWillUnmount=function(){(0,a.sY)(null,t.l),t.l=null,t.i=null},t.i&&t.i!==n&&t.componentWillUnmount(),e.__v?(t.l||(t.i=n,t.l={nodeType:1,parentNode:n,childNodes:[],appendChild:function(e){this.childNodes.push(e),t.i.appendChild(e)},insertBefore:function(e,n){this.childNodes.push(e),t.i.appendChild(e)},removeChild:function(e){this.childNodes.splice(this.childNodes.indexOf(e)>>>1,1),t.i.removeChild(e)}}),(0,a.sY)((0,a.az)(X,{context:t.context},e.__v),t.l)):t.l&&t.componentWillUnmount()}function K(e,t){return(0,a.az)($,{__v:e,i:t})}(Y.prototype=new a.wA).__e=function(e){var t=this,n=W(t.__v),r=t.o.get(e);return r[0]++,function(i){var o=function(){t.props.revealOrder?(r.push(i),U(t,e,r)):i()};n?n(o):o()}},Y.prototype.render=function(e){this.u=null,this.o=new Map;var t=(0,a.bR)(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var n=t.length;n--;)this.o.set(t[n],this.u=[1,0,this.u]);return e.children},Y.prototype.componentDidUpdate=Y.prototype.componentDidMount=function(){var e=this;this.o.forEach((function(t,n){U(e,n,t)}))};var Z="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,Q=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|marker(?!H|W|U)|overline|paint|stop|strikethrough|stroke|text(?!L)|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,J="undefined"!=typeof document,ee=function(e){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/i:/fil|che|ra/i).test(e)};function te(e,t,n){return null==t.__k&&(t.textContent=""),(0,a.sY)(e,t),"function"==typeof n&&n(),e?e.__c:null}function ne(e,t,n){return(0,a.ZB)(e,t),"function"==typeof n&&n(),e?e.__c:null}a.wA.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach((function(e){Object.defineProperty(a.wA.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})}));var re=a.YM.event;function ie(){}function oe(){return this.cancelBubble}function ae(){return this.defaultPrevented}a.YM.event=function(e){return re&&(e=re(e)),e.persist=ie,e.isPropagationStopped=oe,e.isDefaultPrevented=ae,e.nativeEvent=e};var se,le={configurable:!0,get:function(){return this.class}},ce=a.YM.vnode;a.YM.vnode=function(e){var t=e.type,n=e.props,r=n;if("string"==typeof t){var i=-1===t.indexOf("-");for(var o in r={},n){var s=n[o];J&&"children"===o&&"noscript"===t||"value"===o&&"defaultValue"in n&&null==s||("defaultValue"===o&&"value"in n&&null==n.value?o="value":"download"===o&&!0===s?s="":/ondoubleclick/i.test(o)?o="ondblclick":/^onchange(textarea|input)/i.test(o+t)&&!ee(n.type)?o="oninput":/^onfocus$/i.test(o)?o="onfocusin":/^onblur$/i.test(o)?o="onfocusout":/^on(Ani|Tra|Tou|BeforeInp)/.test(o)?o=o.toLowerCase():i&&Q.test(o)?o=o.replace(/[A-Z0-9]/,"-$&").toLowerCase():null===s&&(s=void 0),r[o]=s)}"select"==t&&r.multiple&&Array.isArray(r.value)&&(r.value=(0,a.bR)(n.children).forEach((function(e){e.props.selected=-1!=r.value.indexOf(e.props.value)}))),"select"==t&&null!=r.defaultValue&&(r.value=(0,a.bR)(n.children).forEach((function(e){e.props.selected=r.multiple?-1!=r.defaultValue.indexOf(e.props.value):r.defaultValue==e.props.value}))),e.props=r,n.class!=n.className&&(le.enumerable="className"in n,null!=n.className&&(r.class=n.className),Object.defineProperty(r,"className",le))}e.$$typeof=Z,ce&&ce(e)};var ue=a.YM.__r;a.YM.__r=function(e){ue&&ue(e),se=e.__c};var de={ReactCurrentDispatcher:{current:{readContext:function(e){return se.__n[e.__c].props.value}}}},he="17.0.2";function fe(e){return a.az.bind(null,e)}function pe(e){return!!e&&e.$$typeof===Z}function ve(e){return pe(e)?a.Tm.apply(null,arguments):e}function ge(e){return!!e.__k&&((0,a.sY)(null,e),!0)}function me(e){return e&&(e.base||1===e.nodeType&&e)||null}var ye=function(e,t){return e(t)},be=function(e,t){return e(t)},xe=a.HY;const we={useState:v,useReducer:g,useEffect:m,useLayoutEffect:y,useRef:b,useImperativeHandle:x,useMemo:w,useCallback:E,useContext:_,useDebugValue:k,version:"17.0.2",Children:z,render:te,hydrate:ne,unmountComponentAtNode:ge,createPortal:K,createElement:a.az,createContext:a.kr,createFactory:fe,cloneElement:ve,createRef:a.Vf,Fragment:a.HY,isValidElement:pe,findDOMNode:me,Component:a.wA,PureComponent:A,memo:R,forwardRef:B,flushSync:be,unstable_batchedUpdates:ye,StrictMode:a.HY,Suspense:H,SuspenseList:Y,lazy:q,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:de}},33847:(e,t,n)=>{"use strict";n.d(t,{HY:()=>y,Tm:()=>z,Vf:()=>m,YM:()=>i,ZB:()=>F,az:()=>v,bR:()=>P,kr:()=>V,sY:()=>B,wA:()=>b});var r,i,o,a,s,l,c,u={},d=[],h=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function f(e,t){for(var n in t)e[n]=t[n];return e}function p(e){var t=e.parentNode;t&&t.removeChild(e)}function v(e,t,n){var i,o,a,s={};for(a in t)"key"==a?i=t[a]:"ref"==a?o=t[a]:s[a]=t[a];if(arguments.length>2&&(s.children=arguments.length>3?r.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(a in e.defaultProps)void 0===s[a]&&(s[a]=e.defaultProps[a]);return g(e,s,i,o,null)}function g(e,t,n,r,a){var s={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==a?++o:a};return null==a&&null!=i.vnode&&i.vnode(s),s}function m(){return{current:null}}function y(e){return e.children}function b(e,t){this.props=e,this.context=t}function x(e,t){if(null==t)return e.__?x(e.__,e.__.__k.indexOf(e)+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?x(e):null}function w(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return w(e)}}function E(e){(!e.__d&&(e.__d=!0)&&a.push(e)&&!_.__r++||l!==i.debounceRendering)&&((l=i.debounceRendering)||s)(_)}function _(){for(var e;_.__r=a.length;)e=a.sort((function(e,t){return e.__v.__b-t.__v.__b})),a=[],e.some((function(e){var t,n,r,i,o,a;e.__d&&(o=(i=(t=e).__v).__e,(a=t.__P)&&(n=[],(r=f({},i)).__v=i.__v+1,O(a,i,r,t.__n,void 0!==a.ownerSVGElement,null!=i.__h?[o]:null,n,null==o?x(i):o,i.__h),M(n,i),i.__e!=o&&w(i)))}))}function k(e,t,n,r,i,o,a,s,l,c){var h,f,p,v,m,b,w,E=r&&r.__k||d,_=E.length;for(n.__k=[],h=0;h<t.length;h++)if(null!=(v=n.__k[h]=null==(v=t[h])||"boolean"==typeof v?null:"string"==typeof v||"number"==typeof v||"bigint"==typeof v?g(null,v,null,null,v):Array.isArray(v)?g(y,{children:v},null,null,null):v.__b>0?g(v.type,v.props,v.key,null,v.__v):v)){if(v.__=n,v.__b=n.__b+1,null===(p=E[h])||p&&v.key==p.key&&v.type===p.type)E[h]=void 0;else for(f=0;f<_;f++){if((p=E[f])&&v.key==p.key&&v.type===p.type){E[f]=void 0;break}p=null}O(e,v,p=p||u,i,o,a,s,l,c),m=v.__e,(f=v.ref)&&p.ref!=f&&(w||(w=[]),p.ref&&w.push(p.ref,null,v),w.push(f,v.__c||m,v)),null!=m?(null==b&&(b=m),"function"==typeof v.type&&v.__k===p.__k?v.__d=l=S(v,l,e):l=j(e,v,p,E,m,l),"function"==typeof n.type&&(n.__d=l)):l&&p.__e==l&&l.parentNode!=e&&(l=x(p))}for(n.__e=b,h=_;h--;)null!=E[h]&&("function"==typeof n.type&&null!=E[h].__e&&E[h].__e==n.__d&&(n.__d=x(r,h+1)),I(E[h],E[h]));if(w)for(h=0;h<w.length;h++)R(w[h],w[++h],w[++h])}function S(e,t,n){for(var r,i=e.__k,o=0;i&&o<i.length;o++)(r=i[o])&&(r.__=e,t="function"==typeof r.type?S(r,t,n):j(n,r,r,i,r.__e,t));return t}function P(e,t){return t=t||[],null==e||"boolean"==typeof e||(Array.isArray(e)?e.some((function(e){P(e,t)})):t.push(e)),t}function j(e,t,n,r,i,o){var a,s,l;if(void 0!==t.__d)a=t.__d,t.__d=void 0;else if(null==n||i!=o||null==i.parentNode)e:if(null==o||o.parentNode!==e)e.appendChild(i),a=null;else{for(s=o,l=0;(s=s.nextSibling)&&l<r.length;l+=2)if(s==i)break e;e.insertBefore(i,o),a=o}return void 0!==a?a:i.nextSibling}function C(e,t,n){"-"===t[0]?e.setProperty(t,n):e[t]=null==n?"":"number"!=typeof n||h.test(t)?n:n+"px"}function T(e,t,n,r,i){var o;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||C(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||C(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])o=t!==(t=t.replace(/Capture$/,"")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=n,n?r||e.addEventListener(t,o?N:D,o):e.removeEventListener(t,o?N:D,o);else if("dangerouslySetInnerHTML"!==t){if(i)t=t.replace(/xlink[H:h]/,"h").replace(/sName$/,"s");else if("href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null!=n&&(!1!==n||"a"===t[0]&&"r"===t[1])?e.setAttribute(t,n):e.removeAttribute(t))}}function D(e){this.l[e.type+!1](i.event?i.event(e):e)}function N(e){this.l[e.type+!0](i.event?i.event(e):e)}function O(e,t,n,r,o,a,s,l,c){var u,d,h,p,v,g,m,x,w,E,_,S=t.type;if(void 0!==t.constructor)return null;null!=n.__h&&(c=n.__h,l=t.__e=n.__e,t.__h=null,a=[l]),(u=i.__b)&&u(t);try{e:if("function"==typeof S){if(x=t.props,w=(u=S.contextType)&&r[u.__c],E=u?w?w.props.value:u.__:r,n.__c?m=(d=t.__c=n.__c).__=d.__E:("prototype"in S&&S.prototype.render?t.__c=d=new S(x,E):(t.__c=d=new b(x,E),d.constructor=S,d.render=L),w&&w.sub(d),d.props=x,d.state||(d.state={}),d.context=E,d.__n=r,h=d.__d=!0,d.__h=[]),null==d.__s&&(d.__s=d.state),null!=S.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=f({},d.__s)),f(d.__s,S.getDerivedStateFromProps(x,d.__s))),p=d.props,v=d.state,h)null==S.getDerivedStateFromProps&&null!=d.componentWillMount&&d.componentWillMount(),null!=d.componentDidMount&&d.__h.push(d.componentDidMount);else{if(null==S.getDerivedStateFromProps&&x!==p&&null!=d.componentWillReceiveProps&&d.componentWillReceiveProps(x,E),!d.__e&&null!=d.shouldComponentUpdate&&!1===d.shouldComponentUpdate(x,d.__s,E)||t.__v===n.__v){d.props=x,d.state=d.__s,t.__v!==n.__v&&(d.__d=!1),d.__v=t,t.__e=n.__e,t.__k=n.__k,t.__k.forEach((function(e){e&&(e.__=t)})),d.__h.length&&s.push(d);break e}null!=d.componentWillUpdate&&d.componentWillUpdate(x,d.__s,E),null!=d.componentDidUpdate&&d.__h.push((function(){d.componentDidUpdate(p,v,g)}))}d.context=E,d.props=x,d.state=d.__s,(u=i.__r)&&u(t),d.__d=!1,d.__v=t,d.__P=e,u=d.render(d.props,d.state,d.context),d.state=d.__s,null!=d.getChildContext&&(r=f(f({},r),d.getChildContext())),h||null==d.getSnapshotBeforeUpdate||(g=d.getSnapshotBeforeUpdate(p,v)),_=null!=u&&u.type===y&&null==u.key?u.props.children:u,k(e,Array.isArray(_)?_:[_],t,n,r,o,a,s,l,c),d.base=t.__e,t.__h=null,d.__h.length&&s.push(d),m&&(d.__E=d.__=null),d.__e=!1}else null==a&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=A(n.__e,t,n,r,o,a,s,c);(u=i.diffed)&&u(t)}catch(e){t.__v=null,(c||null!=a)&&(t.__e=l,t.__h=!!c,a[a.indexOf(l)]=null),i.__e(e,t,n)}}function M(e,t){i.__c&&i.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){i.__e(e,t.__v)}}))}function A(e,t,n,i,o,a,s,l){var c,d,h,f=n.props,v=t.props,g=t.type,m=0;if("svg"===g&&(o=!0),null!=a)for(;m<a.length;m++)if((c=a[m])&&"setAttribute"in c==!!g&&(g?c.localName===g:3===c.nodeType)){e=c,a[m]=null;break}if(null==e){if(null===g)return document.createTextNode(v);e=o?document.createElementNS("http://www.w3.org/2000/svg",g):document.createElement(g,v.is&&v),a=null,l=!1}if(null===g)f===v||l&&e.data===v||(e.data=v);else{if(a=a&&r.call(e.childNodes),d=(f=n.props||u).dangerouslySetInnerHTML,h=v.dangerouslySetInnerHTML,!l){if(null!=a)for(f={},m=0;m<e.attributes.length;m++)f[e.attributes[m].name]=e.attributes[m].value;(h||d)&&(h&&(d&&h.__html==d.__html||h.__html===e.innerHTML)||(e.innerHTML=h&&h.__html||""))}if(function(e,t,n,r,i){var o;for(o in n)"children"===o||"key"===o||o in t||T(e,o,null,n[o],r);for(o in t)i&&"function"!=typeof t[o]||"children"===o||"key"===o||"value"===o||"checked"===o||n[o]===t[o]||T(e,o,t[o],n[o],r)}(e,v,f,o,l),h)t.__k=[];else if(m=t.props.children,k(e,Array.isArray(m)?m:[m],t,n,i,o&&"foreignObject"!==g,a,s,a?a[0]:n.__k&&x(n,0),l),null!=a)for(m=a.length;m--;)null!=a[m]&&p(a[m]);l||("value"in v&&void 0!==(m=v.value)&&(m!==f.value||m!==e.value||"progress"===g&&!m)&&T(e,"value",m,f.value,!1),"checked"in v&&void 0!==(m=v.checked)&&m!==e.checked&&T(e,"checked",m,f.checked,!1))}return e}function R(e,t,n){try{"function"==typeof e?e(t):e.current=t}catch(e){i.__e(e,n)}}function I(e,t,n){var r,o;if(i.unmount&&i.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||R(r,null,t)),null!=(r=e.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){i.__e(e,t)}r.base=r.__P=null}if(r=e.__k)for(o=0;o<r.length;o++)r[o]&&I(r[o],t,"function"!=typeof e.type);n||null==e.__e||p(e.__e),e.__e=e.__d=void 0}function L(e,t,n){return this.constructor(e,n)}function B(e,t,n){var o,a,s;i.__&&i.__(e,t),a=(o="function"==typeof n)?null:n&&n.__k||t.__k,s=[],O(t,e=(!o&&n||t).__k=v(y,null,[e]),a||u,u,void 0!==t.ownerSVGElement,!o&&n?[n]:a?null:t.firstChild?r.call(t.childNodes):null,s,!o&&n?n:a?a.__e:t.firstChild,o),M(s,e)}function F(e,t){B(e,t,F)}function z(e,t,n){var i,o,a,s=f({},e.props);for(a in t)"key"==a?i=t[a]:"ref"==a?o=t[a]:s[a]=t[a];return arguments.length>2&&(s.children=arguments.length>3?r.call(arguments,2):n),g(e.type,s,i||e.key,o||e.ref,null)}function V(e,t){var n={__c:t="__cC"+c++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var n,r;return this.getChildContext||(n=[],(r={})[t]=this,this.getChildContext=function(){return r},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&n.some(E)},this.sub=function(e){n.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n.splice(n.indexOf(e),1),t&&t.call(e)}}),e.children}};return n.Provider.__=n.Consumer.contextType=n}r=d.slice,i={__e:function(e,t){for(var n,r,i;t=t.__;)if((n=t.__c)&&!n.__)try{if((r=n.constructor)&&null!=r.getDerivedStateFromError&&(n.setState(r.getDerivedStateFromError(e)),i=n.__d),null!=n.componentDidCatch&&(n.componentDidCatch(e),i=n.__d),i)return n.__E=n}catch(t){e=t}throw e}},o=0,b.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=f({},this.state),"function"==typeof e&&(e=e(f({},n),this.props)),e&&f(n,e),null!=e&&this.__v&&(t&&this.__h.push(t),E(this))},b.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),E(this))},b.prototype.render=y,a=[],s="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,_.__r=0,c=0},20452:(e,t,n)=>{"use strict";var r=n(12139);var i="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=r.useState,a=r.useEffect,s=r.useLayoutEffect,l=r.useDebugValue;function c(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!i(e,n)}catch(r){return!0}}var u="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),r=o({inst:{value:n,getSnapshot:t}}),i=r[0].inst,u=r[1];return s((function(){i.value=n,i.getSnapshot=t,c(i)&&u({inst:i})}),[e,n,t]),a((function(){return c(i)&&u({inst:i}),e((function(){c(i)&&u({inst:i})}))}),[e]),l(n),n};t.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:u},80402:(e,t,n)=>{"use strict";var r=n(12139),i=n(43100);var o="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},a=i.useSyncExternalStore,s=r.useRef,l=r.useEffect,c=r.useMemo,u=r.useDebugValue;t.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var d=s(null);if(null===d.current){var h={hasValue:!1,value:null};d.current=h}else h=d.current;d=c((function(){function e(e){if(!l){if(l=!0,a=e,e=r(e),void 0!==i&&h.hasValue){var t=h.value;if(i(t,e))return s=t}return s=e}if(t=s,o(a,e))return t;var n=r(e);return void 0!==i&&i(t,n)?t:(a=e,s=n)}var a,s,l=!1,c=void 0===n?null:n;return[function(){return e(t())},null===c?void 0:function(){return e(c())}]}),[t,n,r,i]);var f=a(e,d[0],d[1]);return l((function(){h.hasValue=!0,h.value=f}),[f]),u(f),f}},43100:(e,t,n)=>{"use strict";e.exports=n(20452)},41110:(e,t,n)=>{"use strict";e.exports=n(80402)},19140:(e,t,n)=>{"use strict";n.d(t,{Xg:()=>l,f3:()=>c,mu:()=>s,vk:()=>u});var r=n(70572),i=n(70049),o=n(80237);function a(e){var t;return(t={id:e,send:function(){},subscribe:function(){return{unsubscribe:function(){}}},getSnapshot:function(){},toJSON:function(){return{id:e}}})[i.L$]=function(){return this},t}function s(e,t,n,r){var o,s=(0,i.j)(e.src),c=null===(o=null==t?void 0:t.options.services)||void 0===o?void 0:o[s.type],u=e.data?(0,i.QX)(e.data,n,r):void 0,d=c?l(c,e.id,u):a(e.id);return d.meta=e,d}function l(e,t,n){var r=a(t);if(r.deferred=!0,(0,i.O4)(e)){var s=r.state=(0,o.J)(void 0,(function(){return(n?e.withContext(n):e).initialState}));r.getSnapshot=function(){return s}}return r}function c(e){return function(e){try{return"function"==typeof e.send}catch(t){return!1}}(e)&&"id"in e}function u(e){var t;return(0,r.pi)(((t={subscribe:function(){return{unsubscribe:function(){}}},id:"anonymous",getSnapshot:function(){}})[i.L$]=function(){return this},t),e)}},61818:(e,t,n)=>{"use strict";n.d(t,{C:()=>s,J:()=>a});var r=n(26935),i=n(49333),o=!1;function a(e,t,n){return void 0===n&&(n=e.context),new r.n(e,t,n)}function s(e,t){return i.M||e.predictableActionArguments||o||(o=!0,console.warn("It is highly recommended to set `predictableActionArguments` to `true` when using `createMachine`. https://xstate.js.org/docs/guides/actions.html")),new r.n(e,t)}},67732:(e,t,n)=>{"use strict";n.d(t,{TL:()=>u,ZM:()=>h,j1:()=>d,j_:()=>c});var r=n(70572),i=n(84766),o=n(70049),a=n(88297),s=n(60081),l=n(49333);function c(e,t){if(e===t)return!0;if(void 0===e||void 0===t)return!1;if((0,o.HD)(e)||(0,o.HD)(t))return e===t;var n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&n.every((function(n){return c(e[n],t[n])}))}function u(e){return"object"==typeof e&&null!==e&&("value"in e&&"_event"in e)}function d(e,t){var n=e.exec;return(0,r.pi)((0,r.pi)({},e),{exec:void 0!==n?function(){return n(t.context,t.event,{action:e,state:t,_event:t._event})}:void 0})}var h=function(){function e(e){var t,n=this;this.actions=[],this.activities=i.qP,this.meta={},this.events=[],this.value=e.value,this.context=e.context,this._event=e._event,this._sessionid=e._sessionid,this.event=this._event.data,this.historyValue=e.historyValue,this.history=e.history,this.actions=e.actions||[],this.activities=e.activities||i.qP,this.meta=(0,a.xZ)(e.configuration),this.events=e.events||[],this.matches=this.matches.bind(this),this.toStrings=this.toStrings.bind(this),this.configuration=e.configuration,this.transitions=e.transitions,this.children=e.children,this.done=!!e.done,this.tags=null!==(t=Array.isArray(e.tags)?new Set(e.tags):e.tags)&&void 0!==t?t:new Set,this.machine=e.machine,Object.defineProperty(this,"nextEvents",{get:function(){return(0,a.nJ)(n.configuration)}})}return e.from=function(t,n){return t instanceof e?t.context!==n?new e({value:t.value,context:n,_event:t._event,_sessionid:null,historyValue:t.historyValue,history:t.history,actions:[],activities:t.activities,meta:{},events:[],configuration:[],transitions:[],children:{}}):t:new e({value:t,context:n,_event:s.initEvent,_sessionid:null,historyValue:void 0,history:void 0,actions:[],activities:void 0,meta:void 0,events:[],configuration:[],transitions:[],children:{}})},e.create=function(t){return new e(t)},e.inert=function(t,n){if(t instanceof e){if(!t.actions.length)return t;var r=s.initEvent;return new e({value:t.value,context:n,_event:r,_sessionid:null,historyValue:t.historyValue,history:t.history,activities:t.activities,configuration:t.configuration,transitions:[],children:{}})}return e.from(t,n)},e.prototype.toStrings=function(e,t){var n=this;if(void 0===e&&(e=this.value),void 0===t&&(t="."),(0,o.HD)(e))return[e];var i=Object.keys(e);return i.concat.apply(i,(0,r.ev)([],(0,r.CR)(i.map((function(r){return n.toStrings(e[r],t).map((function(e){return r+t+e}))}))),!1))},e.prototype.toJSON=function(){var e=this;e.configuration,e.transitions;var t=e.tags;e.machine;var n=(0,r._T)(e,["configuration","transitions","tags","machine"]);return(0,r.pi)((0,r.pi)({},n),{tags:Array.from(t)})},e.prototype.matches=function(e){return(0,o.W)(e,this.value)},e.prototype.hasTag=function(e){return this.tags.has(e)},e.prototype.can=function(e){var t;l.M&&(0,o.ZK)(!!this.machine,"state.can(...) used outside of a machine-created State object; this will always return false.");var n=null===(t=this.machine)||void 0===t?void 0:t.getTransitionData(this,e);return!!(null==n?void 0:n.transitions.length)&&n.transitions.some((function(e){return void 0!==e.target||e.actions.length}))},e}()},26935:(e,t,n)=>{"use strict";n.d(t,{n:()=>b});var r=n(70572),i=n(70049),o=n(3763),a=n(67732),s=n(20449),l=n(60081),c=n(49333),u=n(84766),d=n(88297),h=n(19140);function f(e){if("string"==typeof e){var t={type:e,toString:function(){return e}};return t}return e}function p(e){return(0,r.pi)((0,r.pi)({type:s.invoke},e),{toJSON:function(){e.onDone,e.onError;var t=(0,r._T)(e,["onDone","onError"]);return(0,r.pi)((0,r.pi)({},t),{type:s.invoke,src:f(e.src)})}})}var v="",g="*",m={},y=function(e){return"#"===e[0]},b=function(){function e(t,n,o,a){void 0===o&&(o="context"in t?t.context:void 0);var s,h=this;this.config=t,this._context=o,this.order=-1,this.__xstatenode=!0,this.__cache={events:void 0,relativeValue:new Map,initialStateValue:void 0,initialState:void 0,on:void 0,transitions:void 0,candidates:{},delayedTransitions:void 0},this.idMap={},this.tags=[],this.options=Object.assign({actions:{},guards:{},services:{},activities:{},delays:{}},n),this.parent=null==a?void 0:a.parent,this.key=this.config.key||(null==a?void 0:a.key)||this.config.id||"(machine)",this.machine=this.parent?this.parent.machine:this,this.path=this.parent?this.parent.path.concat(this.key):[],this.delimiter=this.config.delimiter||(this.parent?this.parent.delimiter:u.iS),this.id=this.config.id||(0,r.ev)([this.machine.key],(0,r.CR)(this.path),!1).join(this.delimiter),this.version=this.parent?this.parent.version:this.config.version,this.type=this.config.type||(this.config.parallel?"parallel":this.config.states&&Object.keys(this.config.states).length?"compound":this.config.history?"history":"atomic"),this.schema=this.parent?this.machine.schema:null!==(s=this.config.schema)&&void 0!==s?s:{},this.description=this.config.description,c.M||(0,i.ZK)(!("parallel"in this.config),'The "parallel" property is deprecated and will be removed in version 4.1. '.concat(this.config.parallel?"Replace with `type: 'parallel'`":"Use `type: '".concat(this.type,"'`")," in the config for state node '").concat(this.id,"' instead.")),this.initial=this.config.initial,this.states=this.config.states?(0,i.Q8)(this.config.states,(function(t,n){var i,o=new e(t,{},void 0,{parent:h,key:n});return Object.assign(h.idMap,(0,r.pi)(((i={})[o.id]=o,i),o.idMap)),o})):m;var f=0;!function e(t){var n,i;t.order=f++;try{for(var o=(0,r.XA)((0,d.nI)(t)),a=o.next();!a.done;a=o.next()){e(a.value)}}catch(s){n={error:s}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}}(this),this.history=!0===this.config.history?"shallow":this.config.history||!1,this._transient=!!this.config.always||!!this.config.on&&(Array.isArray(this.config.on)?this.config.on.some((function(e){return e.event===v})):v in this.config.on),this.strict=!!this.config.strict,this.onEntry=(0,i.qo)(this.config.entry||this.config.onEntry).map((function(e){return(0,l.toActionObject)(e)})),this.onExit=(0,i.qo)(this.config.exit||this.config.onExit).map((function(e){return(0,l.toActionObject)(e)})),this.meta=this.config.meta,this.doneData="final"===this.type?this.config.data:void 0,this.invoke=(0,i.qo)(this.config.invoke).map((function(e,t){var n,o;if((0,i.O4)(e)){var a=(0,i.bx)(h.id,t);return h.machine.options.services=(0,r.pi)(((n={})[a]=e,n),h.machine.options.services),p({src:a,id:a})}if((0,i.HD)(e.src)){a=e.id||(0,i.bx)(h.id,t);return p((0,r.pi)((0,r.pi)({},e),{id:a,src:e.src}))}if((0,i.O4)(e.src)||(0,i.mf)(e.src)){a=e.id||(0,i.bx)(h.id,t);return h.machine.options.services=(0,r.pi)(((o={})[a]=e.src,o),h.machine.options.services),p((0,r.pi)((0,r.pi)({id:a},e),{src:a}))}var s=e.src;return p((0,r.pi)((0,r.pi)({id:(0,i.bx)(h.id,t)},e),{src:s}))})),this.activities=(0,i.qo)(this.config.activities).concat(this.invoke).map((function(e){return(0,l.toActivityDefinition)(e)})),this.transition=this.transition.bind(this),this.tags=(0,i.qo)(this.config.tags)}return e.prototype._init=function(){this.__cache.transitions||(0,d.ac)(this).forEach((function(e){return e.on}))},e.prototype.withConfig=function(t,n){var i=this.options,o=i.actions,a=i.activities,s=i.guards,l=i.services,c=i.delays;return new e(this.config,{actions:(0,r.pi)((0,r.pi)({},o),t.actions),activities:(0,r.pi)((0,r.pi)({},a),t.activities),guards:(0,r.pi)((0,r.pi)({},s),t.guards),services:(0,r.pi)((0,r.pi)({},l),t.services),delays:(0,r.pi)((0,r.pi)({},c),t.delays)},null!=n?n:this.context)},e.prototype.withContext=function(t){return new e(this.config,this.options,t)},Object.defineProperty(e.prototype,"context",{get:function(){return(0,i.mf)(this._context)?this._context():this._context},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"definition",{get:function(){return{id:this.id,key:this.key,version:this.version,context:this.context,type:this.type,initial:this.initial,history:this.history,states:(0,i.Q8)(this.states,(function(e){return e.definition})),on:this.on,transitions:this.transitions,entry:this.onEntry,exit:this.onExit,activities:this.activities||[],meta:this.meta,order:this.order||-1,data:this.doneData,invoke:this.invoke,description:this.description,tags:this.tags}},enumerable:!1,configurable:!0}),e.prototype.toJSON=function(){return this.definition},Object.defineProperty(e.prototype,"on",{get:function(){if(this.__cache.on)return this.__cache.on;var e=this.transitions;return this.__cache.on=e.reduce((function(e,t){return e[t.eventType]=e[t.eventType]||[],e[t.eventType].push(t),e}),{})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"after",{get:function(){return this.__cache.delayedTransitions||(this.__cache.delayedTransitions=this.getDelayedTransitions(),this.__cache.delayedTransitions)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"transitions",{get:function(){return this.__cache.transitions||(this.__cache.transitions=this.formatTransitions(),this.__cache.transitions)},enumerable:!1,configurable:!0}),e.prototype.getCandidates=function(e){if(this.__cache.candidates[e])return this.__cache.candidates[e];var t=e===v,n=this.transitions.filter((function(n){var r=n.eventType===e;return t?r:r||n.eventType===g}));return this.__cache.candidates[e]=n,n},e.prototype.getDelayedTransitions=function(){var e=this,t=this.config.after;if(!t)return[];var n=function(t,n){var r=(0,i.mf)(t)?"".concat(e.id,":delay[").concat(n,"]"):t,o=(0,l.after)(r,e.id);return e.onEntry.push((0,l.send)(o,{delay:t})),e.onExit.push((0,l.cancel)(o)),o};return((0,i.kJ)(t)?t.map((function(e,t){var i=n(e.delay,t);return(0,r.pi)((0,r.pi)({},e),{event:i})})):(0,i.xH)(Object.keys(t).map((function(e,o){var a=t[e],s=(0,i.HD)(a)?{target:a}:a,l=isNaN(+e)?e:+e,c=n(l,o);return(0,i.qo)(s).map((function(e){return(0,r.pi)((0,r.pi)({},e),{event:c,delay:l})}))})))).map((function(t){var n=t.delay;return(0,r.pi)((0,r.pi)({},e.formatTransition(t)),{delay:n})}))},e.prototype.getStateNodes=function(e){var t,n=this;if(!e)return[];var o=e instanceof a.ZM?e.value:(0,i.WM)(e,this.delimiter);if((0,i.HD)(o)){var s=this.getStateNode(o).initial;return void 0!==s?this.getStateNodes(((t={})[o]=s,t)):[this,this.states[o]]}var l=Object.keys(o),c=[this];return c.push.apply(c,(0,r.ev)([],(0,r.CR)((0,i.xH)(l.map((function(e){return n.getStateNode(e).getStateNodes(o[e])})))),!1)),c},e.prototype.handles=function(e){var t=(0,i.x6)(e);return this.events.includes(t)},e.prototype.resolveState=function(e){var t=e instanceof a.ZM?e:a.ZM.create(e),n=Array.from((0,d.P_)([],this.getStateNodes(t.value)));return new a.ZM((0,r.pi)((0,r.pi)({},t),{value:this.resolve(t.value),configuration:n,done:(0,d.Ij)(n,this),tags:(0,d.Oe)(n),machine:this.machine}))},e.prototype.transitionLeafNode=function(e,t,n){var r=this.getStateNode(e).next(t,n);return r&&r.transitions.length?r:this.next(t,n)},e.prototype.transitionCompoundNode=function(e,t,n){var r=Object.keys(e),i=this.getStateNode(r[0])._transition(e[r[0]],t,n);return i&&i.transitions.length?i:this.next(t,n)},e.prototype.transitionParallelNode=function(e,t,n){var o,a,s={};try{for(var l=(0,r.XA)(Object.keys(e)),c=l.next();!c.done;c=l.next()){var u=c.value,d=e[u];if(d){var h=this.getStateNode(u)._transition(d,t,n);h&&(s[u]=h)}}}catch(m){o={error:m}}finally{try{c&&!c.done&&(a=l.return)&&a.call(l)}finally{if(o)throw o.error}}var f=Object.keys(s).map((function(e){return s[e]})),p=(0,i.xH)(f.map((function(e){return e.transitions})));if(!f.some((function(e){return e.transitions.length>0})))return this.next(t,n);var v=(0,i.xH)(f.map((function(e){return e.entrySet}))),g=(0,i.xH)(Object.keys(s).map((function(e){return s[e].configuration})));return{transitions:p,entrySet:v,exitSet:(0,i.xH)(f.map((function(e){return e.exitSet}))),configuration:g,source:t,actions:(0,i.xH)(Object.keys(s).map((function(e){return s[e].actions})))}},e.prototype._transition=function(e,t,n){return(0,i.HD)(e)?this.transitionLeafNode(e,t,n):1===Object.keys(e).length?this.transitionCompoundNode(e,t,n):this.transitionParallelNode(e,t,n)},e.prototype.getTransitionData=function(e,t){return this._transition(e.value,e,(0,i.g5)(t))},e.prototype.next=function(e,t){var n,o,a,s=this,l=t.name,c=[],u=[];try{for(var d=(0,r.XA)(this.getCandidates(l)),h=d.next();!h.done;h=d.next()){var f=h.value,p=f.cond,v=f.in,g=e.context,m=!v||((0,i.HD)(v)&&y(v)?e.matches((0,i.WM)(this.getStateNodeById(v).path,this.delimiter)):(0,i.W)((0,i.WM)(v,this.delimiter),(0,i.ET)(this.path.slice(0,-2))(e.value))),b=!1;try{b=!p||(0,i.vx)(this.machine,p,g,t,e)}catch(_){throw new Error("Unable to evaluate guard '".concat(p.name||p.type,"' in transition for event '").concat(l,"' in state node '").concat(this.id,"':\n").concat(_.message))}if(b&&m){void 0!==f.target&&(u=f.target),c.push.apply(c,(0,r.ev)([],(0,r.CR)(f.actions),!1)),a=f;break}}}catch(k){n={error:k}}finally{try{h&&!h.done&&(o=d.return)&&o.call(d)}finally{if(n)throw n.error}}if(a){if(!u.length)return{transitions:[a],entrySet:[],exitSet:[],configuration:e.value?[this]:[],source:e,actions:c};var x=(0,i.xH)(u.map((function(t){return s.getRelativeStateNodes(t,e.historyValue)}))),w=!!a.internal,E=[];return w||u.forEach((function(e){E.push.apply(E,(0,r.ev)([],(0,r.CR)(s.getExternalReentryNodes(e)),!1))})),{transitions:[a],entrySet:E,exitSet:w?[]:[this],configuration:x,source:e,actions:c}}},e.prototype.getExternalReentryNodes=function(e){for(var t=[],n=(0,r.CR)(e.order>this.order?[e,this]:[this,e],2),i=n[0],o=n[1];i&&i!==o;)t.push(i),i=i.parent;return i!==o?[]:(t.push(o),t)},e.prototype.getActions=function(e,t,n,a,c,u,h){var f,p,v,g,m=this,y=(0,d.P_)([],u?this.getStateNodes(u.value):[this]);try{for(var b=(0,r.XA)(e),x=b.next();!x.done;x=b.next()){var w=x.value;(!(0,d.e$)(y,w)||(0,d.e$)(n.entrySet,w.parent)&&!(0,d.e$)(n.entrySet,w))&&n.entrySet.push(w)}}catch(D){f={error:D}}finally{try{x&&!x.done&&(p=b.return)&&p.call(b)}finally{if(f)throw f.error}}try{for(var E=(0,r.XA)(y),_=E.next();!_.done;_=E.next()){w=_.value;(0,d.e$)(e,w)&&!(0,d.e$)(n.exitSet,w.parent)||n.exitSet.push(w)}}catch(N){v={error:N}}finally{try{_&&!_.done&&(g=E.return)&&g.call(E)}finally{if(v)throw v.error}}var k=(0,i.xH)(n.entrySet.map((function(e){var t=[];if("final"!==e.type)return t;var r=e.parent;if(!r.parent)return t;t.push((0,l.done)(e.id,e.doneData),(0,l.done)(r.id,e.doneData?(0,i.QX)(e.doneData,a,c):void 0));var o=r.parent;return"parallel"===o.type&&(0,d.G)(o).every((function(e){return(0,d.Ij)(n.configuration,e)}))&&t.push((0,l.done)(o.id)),t})));n.exitSet.sort((function(e,t){return t.order-e.order})),n.entrySet.sort((function(e,t){return e.order-t.order}));var S=new Set(n.entrySet),P=new Set(n.exitSet),j=Array.from(S).map((function(e){var t=e.onEntry,n=e.activities.map((function(e){return(0,l.start)(e)}));return(0,l.toActionObjects)(h?(0,r.ev)((0,r.ev)([],(0,r.CR)(t),!1),(0,r.CR)(n),!1):(0,r.ev)((0,r.ev)([],(0,r.CR)(n),!1),(0,r.CR)(t),!1),m.machine.options.actions)})).concat([k.map(l.raise)]),C=Array.from(P).map((function(e){return(0,l.toActionObjects)((0,r.ev)((0,r.ev)([],(0,r.CR)(e.onExit),!1),(0,r.CR)(e.activities.map((function(e){return(0,l.stop)(e)}))),!1),m.machine.options.actions)})).concat([(0,l.toActionObjects)(n.actions,this.machine.options.actions)]).concat(j);if(t){var T=(0,l.toActionObjects)((0,i.xH)((0,r.ev)([],(0,r.CR)(e),!1).sort((function(e,t){return t.order-e.order})).map((function(e){return e.onExit}))),this.machine.options.actions).filter((function(e){return e.type!==s.raise&&(e.type!==s.send||!!e.to&&e.to!==o.K.Internal)}));return C.concat([T])}return C},e.prototype.transition=function(e,t,n,o){void 0===e&&(e=this.initialState);var s,l=(0,i.g5)(t);if(e instanceof a.ZM)s=void 0===n?e:this.resolveState(a.ZM.from(e,n));else{var u=(0,i.HD)(e)?this.resolve((0,i.on)(this.getResolvedPath(e))):this.resolve(e),h=null!=n?n:this.machine.context;s=this.resolveState(a.ZM.from(u,h))}if(!c.M&&l.name===g)throw new Error("An event cannot have the wildcard type ('".concat(g,"')"));if(this.strict&&!this.events.includes(l.name)&&!(0,i.JQ)(l.name))throw new Error("Machine '".concat(this.id,"' does not accept event '").concat(l.name,"'"));var f=this._transition(s.value,s,l)||{transitions:[],configuration:[],entrySet:[],exitSet:[],source:s,actions:[]},p=(0,d.P_)([],this.getStateNodes(s.value)),v=f.configuration.length?(0,d.P_)(p,f.configuration):p;return f.configuration=(0,r.ev)([],(0,r.CR)(v),!1),this.resolveTransition(f,s,s.context,o,l)},e.prototype.resolveRaisedTransition=function(e,t,n,i){var o,a=e.actions;return(e=this.transition(e,t,void 0,i))._event=n,e.event=n.data,(o=e.actions).unshift.apply(o,(0,r.ev)([],(0,r.CR)(a),!1)),e},e.prototype.resolveTransition=function(e,t,n,c,u){var f,p,g,m,y=this;void 0===u&&(u=l.initEvent);var b=e.configuration,x=!t||e.transitions.length>0,w=x?e.configuration:t?t.configuration:[],E=(0,d.Ij)(w,this),_=x?(0,d.NA)(this.machine,b):void 0,k=t?t.historyValue?t.historyValue:e.source?this.machine.historyValue(t.value):void 0:void 0,S=this.getActions(new Set(w),E,e,n,u,t,c),P=t?(0,r.pi)({},t.activities):{};try{for(var j=(0,r.XA)(S),C=j.next();!C.done;C=j.next()){var T=C.value;try{for(var D=(g=void 0,(0,r.XA)(T)),N=D.next();!N.done;N=D.next()){var O=N.value;O.type===s.start?P[O.activity.id||O.activity.type]=O:O.type===s.stop&&(P[O.activity.id||O.activity.type]=!1)}}catch(X){g={error:X}}finally{try{N&&!N.done&&(m=D.return)&&m.call(D)}finally{if(g)throw g.error}}}}catch($){f={error:$}}finally{try{C&&!C.done&&(p=j.return)&&p.call(j)}finally{if(f)throw f.error}}var M=(0,r.CR)((0,l.resolveActions)(this,t,n,u,S,c,this.machine.config.predictableActionArguments||this.machine.config.preserveActionOrder),2),A=M[0],R=M[1],I=(0,r.CR)((0,i.uK)(A,(function(e){return e.type===s.raise||e.type===s.send&&e.to===o.K.Internal})),2),L=I[0],B=I[1],F=A.filter((function(e){var t;return e.type===s.start&&(null===(t=e.activity)||void 0===t?void 0:t.type)===s.invoke})),z=F.reduce((function(e,t){return e[t.activity.id]=(0,h.mu)(t.activity,y.machine,R,u),e}),t?(0,r.pi)({},t.children):{}),V=new a.ZM({value:_||t.value,context:R,_event:u,_sessionid:t?t._sessionid:null,historyValue:_?k?(0,i.yv)(k,_):void 0:t?t.historyValue:void 0,history:!_||e.source?t:void 0,actions:_?B:[],activities:_?P:t?t.activities:{},events:[],configuration:w,transitions:e.transitions,children:z,done:E,tags:(0,d.Oe)(w),machine:this}),G=n!==R;V.changed=u.name===s.update||G;var H=V.history;H&&delete H.history;var W=!E&&(this._transient||b.some((function(e){return e._transient})));if(!(x||W&&u.name!==v))return V;var q=V;if(!E)for(W&&(q=this.resolveRaisedTransition(q,{type:s.nullEvent},u,c));L.length;){var Y=L.shift();q=this.resolveRaisedTransition(q,Y._event,u,c)}var U=q.changed||(H?!!q.actions.length||G||typeof H.value!=typeof q.value||!(0,a.j_)(q.value,H.value):void 0);return q.changed=U,q.history=H,q},e.prototype.getStateNode=function(e){if(y(e))return this.machine.getStateNodeById(e);if(!this.states)throw new Error("Unable to retrieve child state '".concat(e,"' from '").concat(this.id,"'; no child states exist."));var t=this.states[e];if(!t)throw new Error("Child state '".concat(e,"' does not exist on '").concat(this.id,"'"));return t},e.prototype.getStateNodeById=function(e){var t=y(e)?e.slice("#".length):e;if(t===this.id)return this;var n=this.machine.idMap[t];if(!n)throw new Error("Child state node '#".concat(t,"' does not exist on machine '").concat(this.id,"'"));return n},e.prototype.getStateNodeByPath=function(e){if("string"==typeof e&&y(e))try{return this.getStateNodeById(e.slice(1))}catch(o){}for(var t=(0,i.Q9)(e,this.delimiter).slice(),n=this;t.length;){var r=t.shift();if(!r.length)break;n=n.getStateNode(r)}return n},e.prototype.resolve=function(e){var t,n=this;if(!e)return this.initialStateValue||m;switch(this.type){case"parallel":return(0,i.Q8)(this.initialStateValue,(function(t,r){return t?n.getStateNode(r).resolve(e[r]||t):m}));case"compound":if((0,i.HD)(e)){var r=this.getStateNode(e);return"parallel"===r.type||"compound"===r.type?((t={})[e]=r.initialStateValue,t):e}return Object.keys(e).length?(0,i.Q8)(e,(function(e,t){return e?n.getStateNode(t).resolve(e):m})):this.initialStateValue||{};default:return e||m}},e.prototype.getResolvedPath=function(e){if(y(e)){var t=this.machine.idMap[e.slice("#".length)];if(!t)throw new Error("Unable to find state node '".concat(e,"'"));return t.path}return(0,i.Q9)(e,this.delimiter)},Object.defineProperty(e.prototype,"initialStateValue",{get:function(){var e,t;if(this.__cache.initialStateValue)return this.__cache.initialStateValue;if("parallel"===this.type)t=(0,i.ib)(this.states,(function(e){return e.initialStateValue||m}),(function(e){return!("history"===e.type)}));else if(void 0!==this.initial){if(!this.states[this.initial])throw new Error("Initial state '".concat(this.initial,"' not found on '").concat(this.key,"'"));t=(0,d.N9)(this.states[this.initial])?this.initial:((e={})[this.initial]=this.states[this.initial].initialStateValue,e)}else t={};return this.__cache.initialStateValue=t,this.__cache.initialStateValue},enumerable:!1,configurable:!0}),e.prototype.getInitialState=function(e,t){this._init();var n=this.getStateNodes(e);return this.resolveTransition({configuration:n,entrySet:n,exitSet:[],transitions:[],source:void 0,actions:[]},void 0,null!=t?t:this.machine.context,void 0)},Object.defineProperty(e.prototype,"initialState",{get:function(){var e=this.initialStateValue;if(!e)throw new Error("Cannot retrieve initial state from simple state '".concat(this.id,"'."));return this.getInitialState(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"target",{get:function(){var e;if("history"===this.type){var t=this.config;e=(0,i.HD)(t.target)&&y(t.target)?(0,i.on)(this.machine.getStateNodeById(t.target).path.slice(this.path.length-1)):t.target}return e},enumerable:!1,configurable:!0}),e.prototype.getRelativeStateNodes=function(e,t,n){return void 0===n&&(n=!0),n?"history"===e.type?e.resolveHistory(t):e.initialStateNodes:[e]},Object.defineProperty(e.prototype,"initialStateNodes",{get:function(){var e=this;if((0,d.N9)(this))return[this];if("compound"===this.type&&!this.initial)return c.M||(0,i.ZK)(!1,"Compound state node '".concat(this.id,"' has no initial state.")),[this];var t=(0,i.SA)(this.initialStateValue);return(0,i.xH)(t.map((function(t){return e.getFromRelativePath(t)})))},enumerable:!1,configurable:!0}),e.prototype.getFromRelativePath=function(e){if(!e.length)return[this];var t=(0,r.CR)(e),n=t[0],i=t.slice(1);if(!this.states)throw new Error("Cannot retrieve subPath '".concat(n,"' from node with no states"));var o=this.getStateNode(n);if("history"===o.type)return o.resolveHistory();if(!this.states[n])throw new Error("Child state '".concat(n,"' does not exist on '").concat(this.id,"'"));return this.states[n].getFromRelativePath(i)},e.prototype.historyValue=function(e){if(Object.keys(this.states).length)return{current:e||this.initialStateValue,states:(0,i.ib)(this.states,(function(t,n){if(!e)return t.historyValue();var r=(0,i.HD)(e)?void 0:e[n];return t.historyValue(r||t.initialStateValue)}),(function(e){return!e.history}))}},e.prototype.resolveHistory=function(e){var t=this;if("history"!==this.type)return[this];var n=this.parent;if(!e){var r=this.target;return r?(0,i.xH)((0,i.SA)(r).map((function(e){return n.getFromRelativePath(e)}))):n.initialStateNodes}var o=(0,i.gk)(n.path,"states")(e).current;return(0,i.HD)(o)?[n.getStateNode(o)]:(0,i.xH)((0,i.SA)(o).map((function(e){return"deep"===t.history?n.getFromRelativePath(e):[n.states[e[0]]]})))},Object.defineProperty(e.prototype,"stateIds",{get:function(){var e=this,t=(0,i.xH)(Object.keys(this.states).map((function(t){return e.states[t].stateIds})));return[this.id].concat(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"events",{get:function(){var e,t,n,i;if(this.__cache.events)return this.__cache.events;var o=this.states,a=new Set(this.ownEvents);if(o)try{for(var s=(0,r.XA)(Object.keys(o)),l=s.next();!l.done;l=s.next()){var c=o[l.value];if(c.states)try{for(var u=(n=void 0,(0,r.XA)(c.events)),d=u.next();!d.done;d=u.next()){var h=d.value;a.add("".concat(h))}}catch(f){n={error:f}}finally{try{d&&!d.done&&(i=u.return)&&i.call(u)}finally{if(n)throw n.error}}}}catch(p){e={error:p}}finally{try{l&&!l.done&&(t=s.return)&&t.call(s)}finally{if(e)throw e.error}}return this.__cache.events=Array.from(a)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ownEvents",{get:function(){var e=new Set(this.transitions.filter((function(e){return!(!e.target&&!e.actions.length&&e.internal)})).map((function(e){return e.eventType})));return Array.from(e)},enumerable:!1,configurable:!0}),e.prototype.resolveTarget=function(e){var t=this;if(void 0!==e)return e.map((function(e){if(!(0,i.HD)(e))return e;var n=e[0]===t.delimiter;if(n&&!t.parent)return t.getStateNodeByPath(e.slice(1));var r=n?t.key+e:e;if(!t.parent)return t.getStateNodeByPath(r);try{return t.parent.getStateNodeByPath(r)}catch(o){throw new Error("Invalid transition definition for state node '".concat(t.id,"':\n").concat(o.message))}}))},e.prototype.formatTransition=function(e){var t=this,n=(0,i.rg)(e.target),o="internal"in e?e.internal:!n||n.some((function(e){return(0,i.HD)(e)&&e[0]===t.delimiter})),a=this.machine.options.guards,s=this.resolveTarget(n),c=(0,r.pi)((0,r.pi)({},e),{actions:(0,l.toActionObjects)((0,i.qo)(e.actions)),cond:(0,i.Qi)(e.cond,a),target:s,source:this,internal:o,eventType:e.event,toJSON:function(){return(0,r.pi)((0,r.pi)({},c),{target:c.target?c.target.map((function(e){return"#".concat(e.id)})):void 0,source:"#".concat(t.id)})}});return c},e.prototype.formatTransitions=function(){var e,t,n,o=this;if(this.config.on)if(Array.isArray(this.config.on))n=this.config.on;else{var a=this.config.on,s=g,u=a[s],d=void 0===u?[]:u,h=(0,r._T)(a,["*"]);n=(0,i.xH)(Object.keys(h).map((function(e){c.M||e!==v||(0,i.ZK)(!1,"Empty string transition configs (e.g., `{ on: { '': ... }}`) for transient transitions are deprecated. Specify the transition in the `{ always: ... }` property instead. "+'Please check the `on` configuration for "#'.concat(o.id,'".'));var t=(0,i.jh)(e,h[e]);return c.M||function(e,t,n){var r=n.slice(0,-1).some((function(e){return!("cond"in e)&&!("in"in e)&&((0,i.HD)(e.target)||(0,i.O4)(e.target))})),o=t===v?"the transient event":"event '".concat(t,"'");(0,i.ZK)(!r,"One or more transitions for ".concat(o," on state '").concat(e.id,"' are unreachable. ")+"Make sure that the default transition is the last one defined.")}(o,e,t),t})).concat((0,i.jh)(g,d)))}else n=[];var f=this.config.always?(0,i.jh)("",this.config.always):[],p=this.config.onDone?(0,i.jh)(String((0,l.done)(this.id)),this.config.onDone):[];c.M||(0,i.ZK)(!(this.config.onDone&&!this.parent),'Root nodes cannot have an ".onDone" transition. Please check the config of "'.concat(this.id,'".'));var m=(0,i.xH)(this.invoke.map((function(e){var t=[];return e.onDone&&t.push.apply(t,(0,r.ev)([],(0,r.CR)((0,i.jh)(String((0,l.doneInvoke)(e.id)),e.onDone)),!1)),e.onError&&t.push.apply(t,(0,r.ev)([],(0,r.CR)((0,i.jh)(String((0,l.error)(e.id)),e.onError)),!1)),t}))),y=this.after,b=(0,i.xH)((0,r.ev)((0,r.ev)((0,r.ev)((0,r.ev)([],(0,r.CR)(p),!1),(0,r.CR)(m),!1),(0,r.CR)(n),!1),(0,r.CR)(f),!1).map((function(e){return(0,i.qo)(e).map((function(e){return o.formatTransition(e)}))})));try{for(var x=(0,r.XA)(y),w=x.next();!w.done;w=x.next()){var E=w.value;b.push(E)}}catch(_){e={error:_}}finally{try{w&&!w.done&&(t=x.return)&&t.call(x)}finally{if(e)throw e.error}}return b},e}()},70572:(e,t,n)=>{"use strict";n.d(t,{CR:()=>a,XA:()=>o,_T:()=>i,ev:()=>s,pi:()=>r});var r=function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},r.apply(this,arguments)};function i(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}function o(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function a(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function s(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}},20449:(e,t,n)=>{"use strict";n.r(t),n.d(t,{after:()=>d,assign:()=>u,cancel:()=>l,choose:()=>x,doneState:()=>h,error:()=>y,errorExecution:()=>g,errorPlatform:()=>m,init:()=>p,invoke:()=>v,log:()=>f,nullEvent:()=>c,pure:()=>w,raise:()=>a,send:()=>s,start:()=>i,stop:()=>o,update:()=>b});var r=n(3763),i=r.M.Start,o=r.M.Stop,a=r.M.Raise,s=r.M.Send,l=r.M.Cancel,c=r.M.NullEvent,u=r.M.Assign,d=r.M.After,h=r.M.DoneState,f=r.M.Log,p=r.M.Init,v=r.M.Invoke,g=r.M.ErrorExecution,m=r.M.ErrorPlatform,y=r.M.ErrorCustom,b=r.M.Update,x=r.M.Choose,w=r.M.Pure},60081:(e,t,n)=>{"use strict";n.r(t),n.d(t,{actionTypes:()=>o,after:()=>D,assign:()=>C,cancel:()=>k,choose:()=>L,done:()=>N,doneInvoke:()=>O,error:()=>M,escalate:()=>I,forwardTo:()=>R,getActionFunction:()=>c,initEvent:()=>l,isActionObject:()=>T,log:()=>E,pure:()=>A,raise:()=>f,resolveActions:()=>B,resolveLog:()=>_,resolveRaise:()=>p,resolveSend:()=>g,resolveStop:()=>j,respond:()=>x,send:()=>v,sendParent:()=>m,sendTo:()=>y,sendUpdate:()=>b,start:()=>S,stop:()=>P,toActionObject:()=>u,toActionObjects:()=>d,toActivityDefinition:()=>h});var r=n(70572),i=n(3763),o=n(20449),a=n(70049),s=n(49333),l=(0,a.g5)({type:o.init});function c(e,t){return t&&t[e]||void 0}function u(e,t){var n;if((0,a.HD)(e)||"number"==typeof e){var i=c(e,t);n=(0,a.mf)(i)?{type:e,exec:i}:i||{type:e,exec:void 0}}else if((0,a.mf)(e))n={type:e.name||e.toString(),exec:e};else{i=c(e.type,t);if((0,a.mf)(i))n=(0,r.pi)((0,r.pi)({},e),{exec:i});else if(i){var o=i.type||e.type;n=(0,r.pi)((0,r.pi)((0,r.pi)({},i),e),{type:o})}else n=e}return n}var d=function(e,t){return e?((0,a.kJ)(e)?e:[e]).map((function(e){return u(e,t)})):[]};function h(e){var t=u(e);return(0,r.pi)((0,r.pi)({id:(0,a.HD)(e)?e:t.id},t),{type:t.type})}function f(e){return(0,a.HD)(e)?{type:o.raise,event:e}:v(e,{to:i.K.Internal})}function p(e){return{type:o.raise,_event:(0,a.g5)(e.event)}}function v(e,t){return{to:t?t.to:void 0,type:o.send,event:(0,a.mf)(e)?e:(0,a._v)(e),delay:t?t.delay:void 0,id:t&&void 0!==t.id?t.id:(0,a.mf)(e)?e.name:(0,a.x6)(e)}}function g(e,t,n,i){var o,s={_event:n},l=(0,a.g5)((0,a.mf)(e.event)?e.event(t,n.data,s):e.event);if((0,a.HD)(e.delay)){var c=i&&i[e.delay];o=(0,a.mf)(c)?c(t,n.data,s):c}else o=(0,a.mf)(e.delay)?e.delay(t,n.data,s):e.delay;var u=(0,a.mf)(e.to)?e.to(t,n.data,s):e.to;return(0,r.pi)((0,r.pi)({},e),{to:u,_event:l,event:l.data,delay:o})}function m(e,t){return v(e,(0,r.pi)((0,r.pi)({},t),{to:i.K.Parent}))}function y(e,t,n){return v(t,(0,r.pi)((0,r.pi)({},n),{to:e}))}function b(){return m(o.update)}function x(e,t){return v(e,(0,r.pi)((0,r.pi)({},t),{to:function(e,t,n){return n._event.origin}}))}var w=function(e,t){return{context:e,event:t}};function E(e,t){return void 0===e&&(e=w),{type:o.log,label:t,expr:e}}var _=function(e,t,n){return(0,r.pi)((0,r.pi)({},e),{value:(0,a.HD)(e.expr)?e.expr:e.expr(t,n.data,{_event:n})})},k=function(e){return{type:o.cancel,sendId:e}};function S(e){var t=h(e);return{type:i.M.Start,activity:t,exec:void 0}}function P(e){var t=(0,a.mf)(e)?e:h(e);return{type:i.M.Stop,activity:t,exec:void 0}}function j(e,t,n){var r=(0,a.mf)(e.activity)?e.activity(t,n.data):e.activity,o="string"==typeof r?{id:r}:r;return{type:i.M.Stop,activity:o}}var C=function(e){return{type:o.assign,assignment:e}};function T(e){return"object"==typeof e&&"type"in e}function D(e,t){var n=t?"#".concat(t):"";return"".concat(i.M.After,"(").concat(e,")").concat(n)}function N(e,t){var n="".concat(i.M.DoneState,".").concat(e),r={type:n,data:t,toString:function(){return n}};return r}function O(e,t){var n="".concat(i.M.DoneInvoke,".").concat(e),r={type:n,data:t,toString:function(){return n}};return r}function M(e,t){var n="".concat(i.M.ErrorPlatform,".").concat(e),r={type:n,data:t,toString:function(){return n}};return r}function A(e){return{type:i.M.Pure,get:e}}function R(e,t){if(!(s.M||e&&"function"!=typeof e)){var n=e;e=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var i="function"==typeof n?n.apply(void 0,(0,r.ev)([],(0,r.CR)(e),!1)):n;if(!i)throw new Error("Attempted to forward event to undefined actor. This risks an infinite loop in the sender.");return i}}return v((function(e,t){return t}),(0,r.pi)((0,r.pi)({},t),{to:e}))}function I(e,t){return m((function(t,n,r){return{type:o.error,data:(0,a.mf)(e)?e(t,n,r):e}}),(0,r.pi)((0,r.pi)({},t),{to:i.K.Parent}))}function L(e){return{type:i.M.Choose,conds:e}}function B(e,t,n,l,c,h,f){void 0===f&&(f=!1);var v=f?[]:function(e){var t,n,i=[];try{for(var a=(0,r.XA)(e),s=a.next();!s.done;s=a.next())for(var l=s.value,c=0;c<l.length;)l[c].type!==o.assign?c++:(i.push(l[c]),l.splice(c,1))}catch(u){t={error:u}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}return i}(c),m=v.length?(0,a.dt)(n,l,v,t):n,y=f?[n]:void 0,b=[];function x(c){var v;switch(c.type){case o.raise:return p(c);case o.send:var x=g(c,m,l,e.options.delays);return s.M||(0,a.ZK)(!(0,a.HD)(c.delay)||"number"==typeof x.delay,"No delay reference for delay expression '".concat(c.delay,"' was found on machine '").concat(e.id,"'")),h&&x.to!==i.K.Internal&&b.push(x),x;case o.log:var w=_(c,m,l);return null==h||h(w,m,l),w;case o.choose:if(!(P=null===(v=c.conds.find((function(n){var r=(0,a.Qi)(n.cond,e.options.guards);return!r||(0,a.vx)(e,r,m,l,h?void 0:t)})))||void 0===v?void 0:v.actions))return[];var E=(0,r.CR)(B(e,t,m,l,[d((0,a.qo)(P),e.options.actions)],h,f),2),k=E[0],S=E[1];return m=S,null==y||y.push(m),k;case o.pure:var P;if(!(P=c.get(m,l.data)))return[];var C=(0,r.CR)(B(e,t,m,l,[d((0,a.qo)(P),e.options.actions)],h,f),2),T=C[0],D=C[1];return m=D,null==y||y.push(m),T;case o.stop:w=j(c,m,l);return null==h||h(w,n,l),w;case o.assign:m=(0,a.dt)(m,l,[c],h?void 0:t),null==y||y.push(m);break;default:var N=u(c,e.options.actions),O=N.exec;if(h)h(N,m,l);else if(O&&y){var M=y.length-1;N=(0,r.pi)((0,r.pi)({},N),{exec:function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];O.apply(void 0,(0,r.ev)([y[M]],(0,r.CR)(t),!1))}})}return N}}return[(0,a.xH)(c.map((function(e){var t,n,i=[];try{for(var o=(0,r.XA)(e),a=o.next();!a.done;a=o.next()){var s=x(a.value);s&&(i=i.concat(s))}}catch(c){t={error:c}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return b.forEach((function(e){h(e,m,l)})),b.length=0,i}))),m]}},25588:(e,t,n)=>{"use strict";n.d(t,{YP:()=>o});var r=n(19140),i=n(70049);function o(e,t){void 0===t&&(t={});var n=e.initialState,o=new Set,a=[],s=!1,l=(0,r.vk)({id:t.id,send:function(t){a.push(t),function(){if(!s){for(s=!0;a.length>0;){var t=a.shift();n=e.transition(n,t,c),o.forEach((function(e){return e.next(n)}))}s=!1}}()},getSnapshot:function(){return n},subscribe:function(e,t,r){var a=(0,i.zM)(e,t,r);return o.add(a),a.next(n),{unsubscribe:function(){o.delete(a)}}}}),c={parent:t.parent,self:l,id:t.id||"anonymous",observers:o};return n=e.start?e.start(c):n,l}},84766:(e,t,n)=>{"use strict";n.d(t,{TV:()=>o,iS:()=>r,qP:()=>i,rt:()=>a});var r=".",i={},o="xstate.guard",a=""},49333:(e,t,n)=>{"use strict";n.d(t,{M:()=>r});var r=!0},64223:(e,t,n)=>{"use strict";n.r(t),n.d(t,{ActionTypes:()=>g.M,Interpreter:()=>o.Ng,InterpreterStatus:()=>o.TM,Machine:()=>a.J,SpecialTargets:()=>g.K,State:()=>u.ZM,StateNode:()=>p.n,actions:()=>r,assign:()=>m,createMachine:()=>a.C,createSchema:()=>h,doneInvoke:()=>_,forwardTo:()=>E,interpret:()=>o.kJ,mapState:()=>c,matchState:()=>d,matchesState:()=>l.W,raise:()=>k,send:()=>y,sendParent:()=>x,sendTo:()=>b,sendUpdate:()=>w,spawn:()=>o.Cs,spawnBehavior:()=>v.YP,t:()=>f,toActorRef:()=>i.vk,toEventObject:()=>l._v,toObserver:()=>l.zM,toSCXMLEvent:()=>l.g5});var r=n(60081),i=n(19140),o=n(60382),a=n(61818),s=n(70572),l=n(70049);function c(e,t){var n,r,i;try{for(var o=(0,s.XA)(Object.keys(e)),a=o.next();!a.done;a=o.next()){var c=a.value;(0,l.W)(c,t)&&(!i||t.length>i.length)&&(i=c)}}catch(u){n={error:u}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return e[i]}var u=n(67732);function d(e,t,n){var r,i,o=u.ZM.from(e,e instanceof u.ZM?e.context:void 0);try{for(var a=(0,s.XA)(t),l=a.next();!l.done;l=a.next()){var c=(0,s.CR)(l.value,2),d=c[0],h=c[1];if(o.matches(d))return h(o)}}catch(f){r={error:f}}finally{try{l&&!l.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return n(o)}function h(e){return e}var f=h,p=n(26935),v=n(25588),g=n(3763),m=r.assign,y=r.send,b=r.sendTo,x=r.sendParent,w=r.sendUpdate,E=r.forwardTo,_=r.doneInvoke,k=r.raise},60382:(e,t,n)=>{"use strict";n.d(t,{Ng:()=>S,TM:()=>w,kJ:()=>j,Cs:()=>P});var r=n(70572),i=n(3763),o=n(67732),a=n(20449),s=n(60081),l=n(49333),c=n(70049),u={deferEvents:!1},d=function(){function e(e){this.processingEvent=!1,this.queue=[],this.initialized=!1,this.options=(0,r.pi)((0,r.pi)({},u),e)}return e.prototype.initialize=function(e){if(this.initialized=!0,e){if(!this.options.deferEvents)return void this.schedule(e);this.process(e)}this.flushEvents()},e.prototype.schedule=function(e){if(this.initialized&&!this.processingEvent){if(0!==this.queue.length)throw new Error("Event queue should be empty when it is not processing events");this.process(e),this.flushEvents()}else this.queue.push(e)},e.prototype.clear=function(){this.queue=[]},e.prototype.flushEvents=function(){for(var e=this.queue.shift();e;)this.process(e),e=this.queue.shift()},e.prototype.process=function(e){this.processingEvent=!0;try{e()}catch(t){throw this.clear(),t}finally{this.processingEvent=!1}},e}(),h=n(19140),f=new Map,p=0,v=function(){return"x:".concat(p++)},g=function(e,t){return f.set(e,t),e},m=function(e){return f.get(e)},y=function(e){f.delete(e)};function b(){return"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:void(l.M||console.warn("XState could not find a global object in this environment. Please let the maintainers know and raise an issue here: https://github.com/statelyai/xstate/issues"))}function x(e){if(b()){var t=function(){var e=b();if(e&&"__xstate__"in e)return e.__xstate__}();t&&t.register(e)}}var w,E=n(80237),_=n(25588),k={sync:!1,autoForward:!1};!function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"}(w||(w={}));var S=function(){function e(t,n){void 0===n&&(n=e.defaultOptions);var o=this;this.machine=t,this.delayedEventsMap={},this.listeners=new Set,this.contextListeners=new Set,this.stopListeners=new Set,this.doneListeners=new Set,this.eventListeners=new Set,this.sendListeners=new Set,this.initialized=!1,this.status=w.NotStarted,this.children=new Map,this.forwardTo=new Set,this._outgoingQueue=[],this.init=this.start,this.send=function(e,t){if((0,c.kJ)(e))return o.batch(e),o.state;var n=(0,c.g5)((0,c._v)(e,t));if(o.status===w.Stopped)return l.M||(0,c.ZK)(!1,'Event "'.concat(n.name,'" was sent to stopped service "').concat(o.machine.id,'". This service has already reached its final state, and will not transition.\nEvent: ').concat(JSON.stringify(n.data))),o.state;if(o.status!==w.Running&&!o.options.deferEvents)throw new Error('Event "'.concat(n.name,'" was sent to uninitialized service "').concat(o.machine.id,'". Make sure .start() is called for this service, or set { deferEvents: true } in the service options.\nEvent: ').concat(JSON.stringify(n.data)));return o.scheduler.schedule((function(){o.forward(n);var e=o._nextState(n);o.update(e,n)})),o._state},this.sendTo=function(e,t,n){var u=o.parent&&(t===i.K.Parent||o.parent.id===t),d=u?o.parent:(0,c.HD)(t)?o.children.get(t)||m(t):(0,c.Bc)(t)?t:void 0;if(d)if("machine"in d){if(o.status!==w.Stopped||o.parent!==d||o.state.done){var h=(0,r.pi)((0,r.pi)({},e),{name:e.name===a.error?"".concat((0,s.error)(o.id)):e.name,origin:o.sessionId});!n&&o.machine.config.predictableActionArguments?o._outgoingQueue.push([d,h]):d.send(h)}}else!n&&o.machine.config.predictableActionArguments?o._outgoingQueue.push([d,e.data]):d.send(e.data);else{if(!u)throw new Error("Unable to send event to child '".concat(t,"' from service '").concat(o.id,"'."));l.M||(0,c.ZK)(!1,"Service '".concat(o.id,"' has no parent: unable to send event ").concat(e.type))}},this._exec=function(e,t,n,r){void 0===r&&(r=o.machine.options.actions);var u=e.exec||(0,s.getActionFunction)(e.type,r),d=(0,c.mf)(u)?u:u?u.exec:e.exec;if(d)try{return d(t,n.data,o.machine.config.predictableActionArguments?{action:e,_event:n}:{action:e,state:o.state,_event:n})}catch(S){throw o.parent&&o.parent.send({type:"xstate.error",data:S}),S}switch(e.type){case a.send:var h=e;if("number"==typeof h.delay)return void o.defer(h);h.to?o.sendTo(h._event,h.to,n===s.initEvent):o.send(h._event);break;case a.cancel:o.cancel(e.sendId);break;case a.start:if(o.status!==w.Running)return;var f=e.activity;if(!o.machine.config.predictableActionArguments&&!o.state.activities[f.id||f.type])break;if(f.type===i.M.Invoke){var p=(0,c.j)(f.src),v=o.machine.options.services?o.machine.options.services[p.type]:void 0,g=f.id,m=f.data;l.M||(0,c.ZK)(!("forward"in f),"`forward` property is deprecated (found in invocation of '".concat(f.src,"' in in machine '").concat(o.machine.id,"'). ")+"Please use `autoForward` instead.");var y="autoForward"in f?f.autoForward:!!f.forward;if(!v)return void(l.M||(0,c.ZK)(!1,"No service found for invocation '".concat(f.src,"' in machine '").concat(o.machine.id,"'.")));var b=m?(0,c.QX)(m,t,n):void 0;if("string"==typeof v)return;var x=(0,c.mf)(v)?v(t,n.data,{data:b,src:p,meta:f.meta}):v;if(!x)return;var E=void 0;(0,c.O4)(x)&&(x=b?x.withContext(b):x,E={autoForward:y}),o.spawn(x,g,E)}else o.spawnActivity(f);break;case a.stop:o.stopChild(e.activity.id);break;case a.log:var _=e.label,k=e.value;_?o.logger(_,k):o.logger(k);break;default:l.M||(0,c.ZK)(!1,"No implementation found for action type '".concat(e.type,"'"))}};var u=(0,r.pi)((0,r.pi)({},e.defaultOptions),n),h=u.clock,f=u.logger,p=u.parent,g=u.id,y=void 0!==g?g:t.id;this.id=y,this.logger=f,this.clock=h,this.parent=p,this.options=u,this.scheduler=new d({deferEvents:this.options.deferEvents}),this.sessionId=v()}return Object.defineProperty(e.prototype,"initialState",{get:function(){var e=this;return this._initialState?this._initialState:(0,E.J)(this,(function(){return e._initialState=e.machine.initialState,e._initialState}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"state",{get:function(){return l.M||(0,c.ZK)(this.status!==w.NotStarted,"Attempted to read state from uninitialized service '".concat(this.id,"'. Make sure the service is started first.")),this._state},enumerable:!1,configurable:!0}),e.prototype.execute=function(e,t){var n,i;try{for(var o=(0,r.XA)(e.actions),a=o.next();!a.done;a=o.next()){var s=a.value;this.exec(s,e,t)}}catch(l){n={error:l}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}},e.prototype.update=function(e,t){var n,i,o,a,l,u,d,h,f=this;if(e._sessionid=this.sessionId,this._state=e,this.machine.config.predictableActionArguments&&t!==s.initEvent||!this.options.execute)for(var p=void 0;p=this._outgoingQueue.shift();)p[0].send(p[1]);else this.execute(this.state);if(this.children.forEach((function(e){f.state.children[e.id]=e})),this.devTools&&this.devTools.send(t.data,e),e.event)try{for(var v=(0,r.XA)(this.eventListeners),g=v.next();!g.done;g=v.next()){(0,g.value)(e.event)}}catch(S){n={error:S}}finally{try{g&&!g.done&&(i=v.return)&&i.call(v)}finally{if(n)throw n.error}}try{for(var m=(0,r.XA)(this.listeners),y=m.next();!y.done;y=m.next()){(0,y.value)(e,e.event)}}catch(P){o={error:P}}finally{try{y&&!y.done&&(a=m.return)&&a.call(m)}finally{if(o)throw o.error}}try{for(var b=(0,r.XA)(this.contextListeners),x=b.next();!x.done;x=b.next()){(0,x.value)(this.state.context,this.state.history?this.state.history.context:void 0)}}catch(j){l={error:j}}finally{try{x&&!x.done&&(u=b.return)&&u.call(b)}finally{if(l)throw l.error}}if(this.state.done){var w=e.configuration.find((function(e){return"final"===e.type&&e.parent===f.machine})),E=w&&w.doneData?(0,c.QX)(w.doneData,e.context,t):void 0;try{for(var _=(0,r.XA)(this.doneListeners),k=_.next();!k.done;k=_.next()){(0,k.value)((0,s.doneInvoke)(this.id,E))}}catch(C){d={error:C}}finally{try{k&&!k.done&&(h=_.return)&&h.call(_)}finally{if(d)throw d.error}}this._stop(),this._stopChildren()}},e.prototype.onTransition=function(e){return this.listeners.add(e),this.status===w.Running&&e(this.state,this.state.event),this},e.prototype.subscribe=function(e,t,n){var r=this,i=(0,c.zM)(e,t,n);this.listeners.add(i.next),this.status!==w.NotStarted&&i.next(this.state);var o=function(){r.doneListeners.delete(o),r.stopListeners.delete(o),i.complete()};return this.status===w.Stopped?i.complete():(this.onDone(o),this.onStop(o)),{unsubscribe:function(){r.listeners.delete(i.next),r.doneListeners.delete(o),r.stopListeners.delete(o)}}},e.prototype.onEvent=function(e){return this.eventListeners.add(e),this},e.prototype.onSend=function(e){return this.sendListeners.add(e),this},e.prototype.onChange=function(e){return this.contextListeners.add(e),this},e.prototype.onStop=function(e){return this.stopListeners.add(e),this},e.prototype.onDone=function(e){return this.doneListeners.add(e),this},e.prototype.off=function(e){return this.listeners.delete(e),this.eventListeners.delete(e),this.sendListeners.delete(e),this.stopListeners.delete(e),this.doneListeners.delete(e),this.contextListeners.delete(e),this},e.prototype.start=function(e){var t=this;if(this.status===w.Running)return this;this.machine._init(),g(this.sessionId,this),this.initialized=!0,this.status=w.Running;var n=void 0===e?this.initialState:(0,E.J)(this,(function(){return(0,o.TL)(e)?t.machine.resolveState(e):t.machine.resolveState(o.ZM.from(e,t.machine.context))}));return this.options.devTools&&this.attachDev(),this.scheduler.initialize((function(){t.update(n,s.initEvent)})),this},e.prototype._stopChildren=function(){this.children.forEach((function(e){(0,c.mf)(e.stop)&&e.stop()})),this.children.clear()},e.prototype._stop=function(){var e,t,n,i,o,a,s,l,c,u;try{for(var h=(0,r.XA)(this.listeners),f=h.next();!f.done;f=h.next()){var p=f.value;this.listeners.delete(p)}}catch(S){e={error:S}}finally{try{f&&!f.done&&(t=h.return)&&t.call(h)}finally{if(e)throw e.error}}try{for(var v=(0,r.XA)(this.stopListeners),g=v.next();!g.done;g=v.next()){(p=g.value)(),this.stopListeners.delete(p)}}catch(P){n={error:P}}finally{try{g&&!g.done&&(i=v.return)&&i.call(v)}finally{if(n)throw n.error}}try{for(var m=(0,r.XA)(this.contextListeners),y=m.next();!y.done;y=m.next()){p=y.value;this.contextListeners.delete(p)}}catch(j){o={error:j}}finally{try{y&&!y.done&&(a=m.return)&&a.call(m)}finally{if(o)throw o.error}}try{for(var b=(0,r.XA)(this.doneListeners),x=b.next();!x.done;x=b.next()){p=x.value;this.doneListeners.delete(p)}}catch(C){s={error:C}}finally{try{x&&!x.done&&(l=b.return)&&l.call(b)}finally{if(s)throw s.error}}if(!this.initialized)return this;this.initialized=!1,this.status=w.Stopped,this._initialState=void 0;try{for(var E=(0,r.XA)(Object.keys(this.delayedEventsMap)),_=E.next();!_.done;_=E.next()){var k=_.value;this.clock.clearTimeout(this.delayedEventsMap[k])}}catch(T){c={error:T}}finally{try{_&&!_.done&&(u=E.return)&&u.call(E)}finally{if(c)throw c.error}}this.scheduler.clear(),this.scheduler=new d({deferEvents:this.options.deferEvents})},e.prototype.stop=function(){var e=this,t=this.scheduler;return this._stop(),t.schedule((function(){var t=(0,c.g5)({type:"xstate.stop"}),n=(0,E.J)(e,(function(){var n=(0,c.xH)((0,r.ev)([],(0,r.CR)(e.state.configuration),!1).sort((function(e,t){return t.order-e.order})).map((function(t){return(0,s.toActionObjects)(t.onExit,e.machine.options.actions)}))),l=(0,r.CR)((0,s.resolveActions)(e.machine,e.state,e.state.context,t,[n],e.machine.config.predictableActionArguments?e._exec:void 0,e.machine.config.predictableActionArguments||e.machine.config.preserveActionOrder),2),u=l[0],d=l[1],h=new o.ZM({value:e.state.value,context:d,_event:t,_sessionid:e.sessionId,historyValue:void 0,history:e.state,actions:u.filter((function(e){return e.type!==a.raise&&(e.type!==a.send||!!e.to&&e.to!==i.K.Internal)})),activities:{},events:[],configuration:[],transitions:[],children:{},done:e.state.done,tags:e.state.tags,machine:e.machine});return h.changed=!0,h}));e.update(n,t),e._stopChildren(),y(e.sessionId)})),this},e.prototype.batch=function(e){var t=this;if(this.status===w.NotStarted&&this.options.deferEvents)l.M||(0,c.ZK)(!1,"".concat(e.length,' event(s) were sent to uninitialized service "').concat(this.machine.id,'" and are deferred. Make sure .start() is called for this service.\nEvent: ').concat(JSON.stringify(event)));else if(this.status!==w.Running)throw new Error("".concat(e.length,' event(s) were sent to uninitialized service "').concat(this.machine.id,'". Make sure .start() is called for this service, or set { deferEvents: true } in the service options.'));if(e.length){var n=!!this.machine.config.predictableActionArguments&&this._exec;this.scheduler.schedule((function(){var i,a,s=t.state,l=!1,u=[],d=function(e){var i=(0,c.g5)(e);t.forward(i),s=(0,E.J)(t,(function(){return t.machine.transition(s,i,void 0,n||void 0)})),u.push.apply(u,(0,r.ev)([],(0,r.CR)(t.machine.config.predictableActionArguments?s.actions:s.actions.map((function(e){return(0,o.j1)(e,s)}))),!1)),l=l||!!s.changed};try{for(var h=(0,r.XA)(e),f=h.next();!f.done;f=h.next()){d(f.value)}}catch(p){i={error:p}}finally{try{f&&!f.done&&(a=h.return)&&a.call(h)}finally{if(i)throw i.error}}s.changed=l,s.actions=u,t.update(s,(0,c.g5)(e[e.length-1]))}))}},e.prototype.sender=function(e){return this.send.bind(this,e)},e.prototype._nextState=function(e,t){var n=this;void 0===t&&(t=!!this.machine.config.predictableActionArguments&&this._exec);var r=(0,c.g5)(e);if(0===r.name.indexOf(a.errorPlatform)&&!this.state.nextEvents.some((function(e){return 0===e.indexOf(a.errorPlatform)})))throw r.data.data;return(0,E.J)(this,(function(){return n.machine.transition(n.state,r,void 0,t||void 0)}))},e.prototype.nextState=function(e){return this._nextState(e,!1)},e.prototype.forward=function(e){var t,n;try{for(var i=(0,r.XA)(this.forwardTo),o=i.next();!o.done;o=i.next()){var a=o.value,s=this.children.get(a);if(!s)throw new Error("Unable to forward event '".concat(e,"' from interpreter '").concat(this.id,"' to nonexistant child '").concat(a,"'."));s.send(e)}}catch(l){t={error:l}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}},e.prototype.defer=function(e){var t=this;this.delayedEventsMap[e.id]=this.clock.setTimeout((function(){e.to?t.sendTo(e._event,e.to,!0):t.send(e._event)}),e.delay)},e.prototype.cancel=function(e){this.clock.clearTimeout(this.delayedEventsMap[e]),delete this.delayedEventsMap[e]},e.prototype.exec=function(e,t,n){void 0===n&&(n=this.machine.options.actions),this._exec(e,t.context,t._event,n)},e.prototype.removeChild=function(e){var t;this.children.delete(e),this.forwardTo.delete(e),null===(t=this.state)||void 0===t||delete t.children[e]},e.prototype.stopChild=function(e){var t=this.children.get(e);t&&(this.removeChild(e),(0,c.mf)(t.stop)&&t.stop())},e.prototype.spawn=function(e,t,n){if(this.status!==w.Running)return(0,h.Xg)(e,t);if((0,c.y8)(e))return this.spawnPromise(Promise.resolve(e),t);if((0,c.mf)(e))return this.spawnCallback(e,t);if((0,h.f3)(e))return this.spawnActor(e,t);if((0,c.bi)(e))return this.spawnObservable(e,t);if((0,c.O4)(e))return this.spawnMachine(e,(0,r.pi)((0,r.pi)({},n),{id:t}));if((0,c.HV)(e))return this.spawnBehavior(e,t);throw new Error('Unable to spawn entity "'.concat(t,'" of type "').concat(typeof e,'".'))},e.prototype.spawnMachine=function(t,n){var i=this;void 0===n&&(n={});var o=new e(t,(0,r.pi)((0,r.pi)({},this.options),{parent:this,id:n.id||t.id})),s=(0,r.pi)((0,r.pi)({},k),n);s.sync&&o.onTransition((function(e){i.send(a.update,{state:e,id:o.id})}));var l=o;return this.children.set(o.id,l),s.autoForward&&this.forwardTo.add(o.id),o.onDone((function(e){i.removeChild(o.id),i.send((0,c.g5)(e,{origin:o.id}))})).start(),l},e.prototype.spawnBehavior=function(e,t){var n=(0,_.YP)(e,{id:t,parent:this});return this.children.set(t,n),n},e.prototype.spawnPromise=function(e,t){var n,r,i=this,o=!1;e.then((function(e){o||(r=e,i.removeChild(t),i.send((0,c.g5)((0,s.doneInvoke)(t,e),{origin:t})))}),(function(e){if(!o){i.removeChild(t);var n=(0,s.error)(t,e);try{i.send((0,c.g5)(n,{origin:t}))}catch(r){(0,c.v4)(e,r,t),i.devTools&&i.devTools.send(n,i.state),i.machine.strict&&i.stop()}}}));var a=((n={id:t,send:function(){},subscribe:function(t,n,r){var i=(0,c.zM)(t,n,r),o=!1;return e.then((function(e){o||(i.next(e),o||i.complete())}),(function(e){o||i.error(e)})),{unsubscribe:function(){return o=!0}}},stop:function(){o=!0},toJSON:function(){return{id:t}},getSnapshot:function(){return r}})[c.L$]=function(){return this},n);return this.children.set(t,a),a},e.prototype.spawnCallback=function(e,t){var n,r,i,o=this,a=!1,l=new Set,u=new Set;try{i=e((function(e){r=e,u.forEach((function(t){return t(e)})),a||o.send((0,c.g5)(e,{origin:t}))}),(function(e){l.add(e)}))}catch(h){this.send((0,s.error)(t,h))}if((0,c.y8)(i))return this.spawnPromise(i,t);var d=((n={id:t,send:function(e){return l.forEach((function(t){return t(e)}))},subscribe:function(e){var t=(0,c.zM)(e);return u.add(t.next),{unsubscribe:function(){u.delete(t.next)}}},stop:function(){a=!0,(0,c.mf)(i)&&i()},toJSON:function(){return{id:t}},getSnapshot:function(){return r}})[c.L$]=function(){return this},n);return this.children.set(t,d),d},e.prototype.spawnObservable=function(e,t){var n,r,i=this,o=e.subscribe((function(e){r=e,i.send((0,c.g5)(e,{origin:t}))}),(function(e){i.removeChild(t),i.send((0,c.g5)((0,s.error)(t,e),{origin:t}))}),(function(){i.removeChild(t),i.send((0,c.g5)((0,s.doneInvoke)(t),{origin:t}))})),a=((n={id:t,send:function(){},subscribe:function(t,n,r){return e.subscribe(t,n,r)},stop:function(){return o.unsubscribe()},getSnapshot:function(){return r},toJSON:function(){return{id:t}}})[c.L$]=function(){return this},n);return this.children.set(t,a),a},e.prototype.spawnActor=function(e,t){return this.children.set(t,e),e},e.prototype.spawnActivity=function(e){var t=this.machine.options&&this.machine.options.activities?this.machine.options.activities[e.type]:void 0;if(t){var n=t(this.state.context,e);this.spawnEffect(e.id,n)}else l.M||(0,c.ZK)(!1,"No implementation found for activity '".concat(e.type,"'"))},e.prototype.spawnEffect=function(e,t){var n;this.children.set(e,((n={id:e,send:function(){},subscribe:function(){return{unsubscribe:function(){}}},stop:t||void 0,getSnapshot:function(){},toJSON:function(){return{id:e}}})[c.L$]=function(){return this},n))},e.prototype.attachDev=function(){var e=b();if(this.options.devTools&&e){if(e.__REDUX_DEVTOOLS_EXTENSION__){var t="object"==typeof this.options.devTools?this.options.devTools:void 0;this.devTools=e.__REDUX_DEVTOOLS_EXTENSION__.connect((0,r.pi)((0,r.pi)({name:this.id,autoPause:!0,stateSanitizer:function(e){return{value:e.value,context:e.context,actions:e.actions}}},t),{features:(0,r.pi)({jump:!1,skip:!1},t?t.features:void 0)}),this.machine),this.devTools.init(this.state)}x(this)}},e.prototype.toJSON=function(){return{id:this.id}},e.prototype[c.L$]=function(){return this},e.prototype.getSnapshot=function(){return this.status===w.NotStarted?this.initialState:this._state},e.defaultOptions={execute:!0,deferEvents:!0,clock:{setTimeout:function(e,t){return setTimeout(e,t)},clearTimeout:function(e){return clearTimeout(e)}},logger:console.log.bind(console),devTools:!1},e.interpret=j,e}();function P(e,t){var n=function(e){return(0,c.HD)(e)?(0,r.pi)((0,r.pi)({},k),{name:e}):(0,r.pi)((0,r.pi)((0,r.pi)({},k),{name:(0,c.EL)()}),e)}(t);return(0,E.F)((function(t){if(!l.M){var r=(0,c.O4)(e)||(0,c.mf)(e);(0,c.ZK)(!!t||r,'Attempted to spawn an Actor (ID: "'.concat((0,c.O4)(e)?e.id:"undefined",'") outside of a service. This will have no effect.'))}return t?t.spawn(e,n.name,n):(0,h.Xg)(e,n.name)}))}function j(e,t){return new S(e,t)}},80237:(e,t,n)=>{"use strict";n.d(t,{F:()=>o,J:()=>i});var r=[],i=function(e,t){r.push(e);var n=t(e);return r.pop(),n},o=function(e){return e(r[r.length-1])}},88297:(e,t,n)=>{"use strict";n.d(t,{G:()=>s,Ij:()=>v,N9:()=>o,NA:()=>h,Oe:()=>m,P_:()=>c,ac:()=>l,e$:()=>f,nI:()=>a,nJ:()=>p,xZ:()=>g});var r=n(70572),i=n(70049),o=function(e){return"atomic"===e.type||"final"===e.type};function a(e){return Object.keys(e.states).map((function(t){return e.states[t]}))}function s(e){return a(e).filter((function(e){return"history"!==e.type}))}function l(e){var t=[e];return o(e)?t:t.concat((0,i.xH)(s(e).map(l)))}function c(e,t){var n,i,o,a,l,c,u,h,f=d(new Set(e)),p=new Set(t);try{for(var v=(0,r.XA)(p),g=v.next();!g.done;g=v.next())for(var m=(P=g.value).parent;m&&!p.has(m);)p.add(m),m=m.parent}catch(j){n={error:j}}finally{try{g&&!g.done&&(i=v.return)&&i.call(v)}finally{if(n)throw n.error}}var y=d(p);try{for(var b=(0,r.XA)(p),x=b.next();!x.done;x=b.next()){if("compound"!==(P=x.value).type||y.get(P)&&y.get(P).length){if("parallel"===P.type)try{for(var w=(l=void 0,(0,r.XA)(s(P))),E=w.next();!E.done;E=w.next()){var _=E.value;p.has(_)||(p.add(_),f.get(_)?f.get(_).forEach((function(e){return p.add(e)})):_.initialStateNodes.forEach((function(e){return p.add(e)})))}}catch(C){l={error:C}}finally{try{E&&!E.done&&(c=w.return)&&c.call(w)}finally{if(l)throw l.error}}}else f.get(P)?f.get(P).forEach((function(e){return p.add(e)})):P.initialStateNodes.forEach((function(e){return p.add(e)}))}}catch(T){o={error:T}}finally{try{x&&!x.done&&(a=b.return)&&a.call(b)}finally{if(o)throw o.error}}try{for(var k=(0,r.XA)(p),S=k.next();!S.done;S=k.next()){var P;for(m=(P=S.value).parent;m&&!p.has(m);)p.add(m),m=m.parent}}catch(D){u={error:D}}finally{try{S&&!S.done&&(h=k.return)&&h.call(k)}finally{if(u)throw u.error}}return p}function u(e,t){var n=t.get(e);if(!n)return{};if("compound"===e.type){var r=n[0];if(!r)return{};if(o(r))return r.key}var i={};return n.forEach((function(e){i[e.key]=u(e,t)})),i}function d(e){var t,n,i=new Map;try{for(var o=(0,r.XA)(e),a=o.next();!a.done;a=o.next()){var s=a.value;i.has(s)||i.set(s,[]),s.parent&&(i.has(s.parent)||i.set(s.parent,[]),i.get(s.parent).push(s))}}catch(l){t={error:l}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return i}function h(e,t){return u(e,d(c([e],t)))}function f(e,t){return Array.isArray(e)?e.some((function(e){return e===t})):e instanceof Set&&e.has(t)}function p(e){return(0,r.ev)([],(0,r.CR)(new Set((0,i.xH)((0,r.ev)([],(0,r.CR)(e.map((function(e){return e.ownEvents}))),!1)))),!1)}function v(e,t){return"compound"===t.type?s(t).some((function(t){return"final"===t.type&&f(e,t)})):"parallel"===t.type&&s(t).every((function(t){return v(e,t)}))}function g(e){return void 0===e&&(e=[]),e.reduce((function(e,t){return void 0!==t.meta&&(e[t.id]=t.meta),e}),{})}function m(e){return new Set((0,i.xH)(e.map((function(e){return e.tags}))))}},3763:(e,t,n)=>{"use strict";var r,i;n.d(t,{K:()=>i,M:()=>r}),function(e){e.Start="xstate.start",e.Stop="xstate.stop",e.Raise="xstate.raise",e.Send="xstate.send",e.Cancel="xstate.cancel",e.NullEvent="",e.Assign="xstate.assign",e.After="xstate.after",e.DoneState="done.state",e.DoneInvoke="done.invoke",e.Log="xstate.log",e.Init="xstate.init",e.Invoke="xstate.invoke",e.ErrorExecution="error.execution",e.ErrorCommunication="error.communication",e.ErrorPlatform="error.platform",e.ErrorCustom="xstate.error",e.Update="xstate.update",e.Pure="xstate.pure",e.Choose="xstate.choose"}(r||(r={})),function(e){e.Parent="#_parent",e.Internal="#_internal"}(i||(i={}))},70049:(e,t,n)=>{"use strict";n.d(t,{Bc:()=>I,EL:()=>L,ET:()=>p,HD:()=>N,HV:()=>_,JQ:()=>w,L$:()=>A,O4:()=>R,Q8:()=>h,Q9:()=>c,QX:()=>x,Qi:()=>O,SA:()=>g,W:()=>s,WM:()=>u,ZK:()=>C,_v:()=>B,bi:()=>M,bx:()=>Y,dt:()=>j,g5:()=>F,gk:()=>v,ib:()=>f,j:()=>W,jh:()=>z,kJ:()=>T,mf:()=>D,on:()=>d,qo:()=>b,rg:()=>V,uK:()=>k,v4:()=>G,vx:()=>H,x6:()=>l,xH:()=>m,y8:()=>E,yv:()=>P,zM:()=>q});var r,i=n(70572),o=n(84766),a=n(49333);function s(e,t,n){void 0===n&&(n=o.iS);var r=u(e,n),i=u(t,n);return N(i)?!!N(r)&&i===r:N(r)?r in i:Object.keys(r).every((function(e){return e in i&&s(r[e],i[e])}))}function l(e){try{return N(e)||"number"==typeof e?"".concat(e):e.type}catch(t){throw new Error("Events must be strings or objects with a string event.type property.")}}function c(e,t){try{return T(e)?e:e.toString().split(t)}catch(n){throw new Error("'".concat(e,"' is not a valid state path."))}}function u(e,t){return"object"==typeof(n=e)&&"value"in n&&"context"in n&&"event"in n&&"_event"in n?e.value:T(e)?d(e):"string"!=typeof e?e:d(c(e,t));var n}function d(e){if(1===e.length)return e[0];for(var t={},n=t,r=0;r<e.length-1;r++)r===e.length-2?n[e[r]]=e[r+1]:(n[e[r]]={},n=n[e[r]]);return t}function h(e,t){for(var n={},r=Object.keys(e),i=0;i<r.length;i++){var o=r[i];n[o]=t(e[o],o,e,i)}return n}function f(e,t,n){var r,o,a={};try{for(var s=(0,i.XA)(Object.keys(e)),l=s.next();!l.done;l=s.next()){var c=l.value,u=e[c];n(u)&&(a[c]=t(u,c,e))}}catch(d){r={error:d}}finally{try{l&&!l.done&&(o=s.return)&&o.call(s)}finally{if(r)throw r.error}}return a}var p=function(e){return function(t){var n,r,o=t;try{for(var a=(0,i.XA)(e),s=a.next();!s.done;s=a.next()){o=o[s.value]}}catch(l){n={error:l}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return o}};function v(e,t){return function(n){var r,o,a=n;try{for(var s=(0,i.XA)(e),l=s.next();!l.done;l=s.next()){var c=l.value;a=a[t][c]}}catch(u){r={error:u}}finally{try{l&&!l.done&&(o=s.return)&&o.call(s)}finally{if(r)throw r.error}}return a}}function g(e){return e?N(e)?[[e]]:m(Object.keys(e).map((function(t){var n=e[t];return"string"==typeof n||n&&Object.keys(n).length?g(e[t]).map((function(e){return[t].concat(e)})):[[t]]}))):[[]]}function m(e){var t;return(t=[]).concat.apply(t,(0,i.ev)([],(0,i.CR)(e),!1))}function y(e){return T(e)?e:[e]}function b(e){return void 0===e?[]:y(e)}function x(e,t,n){var r,o;if(D(e))return e(t,n.data);var a={};try{for(var s=(0,i.XA)(Object.keys(e)),l=s.next();!l.done;l=s.next()){var c=l.value,u=e[c];D(u)?a[c]=u(t,n.data):a[c]=u}}catch(d){r={error:d}}finally{try{l&&!l.done&&(o=s.return)&&o.call(s)}finally{if(r)throw r.error}}return a}function w(e){return/^(done|error)\./.test(e)}function E(e){return e instanceof Promise||!(null===e||!D(e)&&"object"!=typeof e||!D(e.then))}function _(e){return null!==e&&"object"==typeof e&&"transition"in e&&"function"==typeof e.transition}function k(e,t){var n,r,o=(0,i.CR)([[],[]],2),a=o[0],s=o[1];try{for(var l=(0,i.XA)(e),c=l.next();!c.done;c=l.next()){var u=c.value;t(u)?a.push(u):s.push(u)}}catch(d){n={error:d}}finally{try{c&&!c.done&&(r=l.return)&&r.call(l)}finally{if(n)throw n.error}}return[a,s]}function S(e,t){return h(e.states,(function(e,n){if(e){var r=(N(t)?void 0:t[n])||(e?e.current:void 0);if(r)return{current:r,states:S(e,r)}}}))}function P(e,t){return{current:t,states:S(e,t)}}function j(e,t,n,r){a.M||C(!!e,"Attempting to update undefined context");var o=e?n.reduce((function(e,n){var o,a,s=n.assignment,l={state:r,action:n,_event:t},c={};if(D(s))c=s(e,t.data,l);else try{for(var u=(0,i.XA)(Object.keys(s)),d=u.next();!d.done;d=u.next()){var h=d.value,f=s[h];c[h]=D(f)?f(e,t.data,l):f}}catch(p){o={error:p}}finally{try{d&&!d.done&&(a=u.return)&&a.call(u)}finally{if(o)throw o.error}}return Object.assign({},e,c)}),e):e;return o}var C=function(){};function T(e){return Array.isArray(e)}function D(e){return"function"==typeof e}function N(e){return"string"==typeof e}function O(e,t){if(e)return N(e)?{type:o.TV,name:e,predicate:t?t[e]:void 0}:D(e)?{type:o.TV,name:e.name,predicate:e}:e}function M(e){try{return"subscribe"in e&&D(e.subscribe)}catch(t){return!1}}a.M||(C=function(e,t){var n=e instanceof Error?e:void 0;if((n||!e)&&void 0!==console){var r=["Warning: ".concat(t)];n&&r.push(n),console.warn.apply(console,r)}});var A=function(){return"function"==typeof Symbol&&Symbol.observable||"@@observable"}();(r={})[A]=function(){return this},r[Symbol.observable]=function(){return this};function R(e){return!!e&&"__xstatenode"in e}function I(e){return!!e&&"function"==typeof e.send}var L=function(){var e=0;return function(){return(++e).toString(16)}}();function B(e,t){return N(e)||"number"==typeof e?(0,i.pi)({type:e},t):e}function F(e,t){if(!N(e)&&"$$type"in e&&"scxml"===e.$$type)return e;var n=B(e);return(0,i.pi)({name:n.type,data:n,$$type:"scxml",type:"external"},t)}function z(e,t){return y(t).map((function(t){return void 0===t||"string"==typeof t||R(t)?{target:t,event:e}:(0,i.pi)((0,i.pi)({},t),{event:e})}))}function V(e){if(void 0!==e&&e!==o.rt)return b(e)}function G(e,t,n){if(!a.M){var r=e.stack?" Stacktrace was '".concat(e.stack,"'"):"";if(e===t)console.error("Missing onError handler for invocation '".concat(n,"', error was '").concat(e,"'.").concat(r));else{var i=t.stack?" Stacktrace was '".concat(t.stack,"'"):"";console.error("Missing onError handler and/or unhandled exception/promise rejection for invocation '".concat(n,"'. ")+"Original error: '".concat(e,"'. ").concat(r," Current error is '").concat(t,"'.").concat(i))}}}function H(e,t,n,r,i){var a=e.options.guards,s={state:i,cond:t,_event:r};if(t.type===o.TV)return((null==a?void 0:a[t.name])||t.predicate)(n,r.data,s);var l=null==a?void 0:a[t.type];if(!l)throw new Error("Guard '".concat(t.type,"' is not implemented on machine '").concat(e.id,"'."));return l(n,r.data,s)}function W(e){return"string"==typeof e?{type:e}:e}function q(e,t,n){var r=function(){},i="object"==typeof e,o=i?e:null;return{next:((i?e.next:e)||r).bind(o),error:((i?e.error:t)||r).bind(o),complete:((i?e.complete:n)||r).bind(o)}}function Y(e,t){return"".concat(e,":invocation[").concat(t,"]")}}},e=>{var t;t=588,e(e.s=t)}]);
|