@igorjpimenta/manifold 0.0.0-bootstrap.1
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/.migrations/ops/0000_futuristic_karma.sql +111 -0
- package/.migrations/ops/0001_low_maximus.sql +7 -0
- package/.migrations/ops/meta/0000_snapshot.json +763 -0
- package/.migrations/ops/meta/0001_snapshot.json +173 -0
- package/.migrations/ops/meta/_journal.json +20 -0
- package/.migrations/runtime/0000_real_boomer.sql +180 -0
- package/.migrations/runtime/0001_hot_dakota_north.sql +2 -0
- package/.migrations/runtime/0002_breezy_vertigo.sql +8 -0
- package/.migrations/runtime/0003_dashing_jack_flag.sql +5 -0
- package/.migrations/runtime/0004_panoramic_ego.sql +1 -0
- package/.migrations/runtime/0005_tidy_ben_grimm.sql +10 -0
- package/.migrations/runtime/0006_wet_nightmare.sql +57 -0
- package/.migrations/runtime/0007_ambiguous_chronomancer.sql +8 -0
- package/.migrations/runtime/0008_wealthy_thundra.sql +301 -0
- package/.migrations/runtime/0009_lying_shocker.sql +96 -0
- package/.migrations/runtime/0010_solid_phantom_reporter.sql +160 -0
- package/.migrations/runtime/0011_windy_demogoblin.sql +175 -0
- package/.migrations/runtime/0012_restore_harness_fks.sql +103 -0
- package/.migrations/runtime/meta/0000_snapshot.json +1181 -0
- package/.migrations/runtime/meta/0001_snapshot.json +1209 -0
- package/.migrations/runtime/meta/0002_snapshot.json +1261 -0
- package/.migrations/runtime/meta/0003_snapshot.json +1292 -0
- package/.migrations/runtime/meta/0004_snapshot.json +1240 -0
- package/.migrations/runtime/meta/0006_snapshot.json +1310 -0
- package/.migrations/runtime/meta/0007_snapshot.json +1362 -0
- package/.migrations/runtime/meta/0008_snapshot.json +1742 -0
- package/.migrations/runtime/meta/0009_snapshot.json +2413 -0
- package/.migrations/runtime/meta/0010_snapshot.json +2562 -0
- package/.migrations/runtime/meta/0011_snapshot.json +2812 -0
- package/.migrations/runtime/meta/0012_snapshot.json +2812 -0
- package/.migrations/runtime/meta/_journal.json +97 -0
- package/README.md +1584 -0
- package/RELEASING.md +89 -0
- package/agent/fleet.js +100 -0
- package/bin/cli.js +854 -0
- package/bin/manifold.js +4 -0
- package/boot/flow-revival.js +536 -0
- package/budget/index.js +495 -0
- package/budget/lib.js +59 -0
- package/dashboard/cost.js +528 -0
- package/dashboard/dist/assets/index-CUfp63sj.css +1 -0
- package/dashboard/dist/assets/index-Qy9JMpma.js +371 -0
- package/dashboard/dist/index.html +13 -0
- package/dashboard/event-log.js +267 -0
- package/dashboard/index.html +12 -0
- package/dashboard/package-lock.json +2877 -0
- package/dashboard/package.json +37 -0
- package/dashboard/pipeline-graph.js +131 -0
- package/dashboard/postcss.config.js +6 -0
- package/dashboard/search.js +183 -0
- package/dashboard/server.js +1015 -0
- package/dashboard/src/App.tsx +42 -0
- package/dashboard/src/api/client.ts +118 -0
- package/dashboard/src/api/types.ts +510 -0
- package/dashboard/src/api/ws.tsx +112 -0
- package/dashboard/src/components/CancelButton.tsx +63 -0
- package/dashboard/src/components/ClickToCopy.tsx +68 -0
- package/dashboard/src/components/CopyButton.tsx +61 -0
- package/dashboard/src/components/DailyCostTrend.tsx +85 -0
- package/dashboard/src/components/DailyTimeTrend.tsx +94 -0
- package/dashboard/src/components/Funnel.tsx +149 -0
- package/dashboard/src/components/GateForm.tsx +158 -0
- package/dashboard/src/components/GraphView.tsx +302 -0
- package/dashboard/src/components/GroupPathsSummary.tsx +47 -0
- package/dashboard/src/components/Histogram.tsx +292 -0
- package/dashboard/src/components/Layout.tsx +28 -0
- package/dashboard/src/components/NeedsAttention.tsx +98 -0
- package/dashboard/src/components/NodeContextCard.tsx +132 -0
- package/dashboard/src/components/PathTrail.tsx +35 -0
- package/dashboard/src/components/PipelineCostBreakdown.tsx +277 -0
- package/dashboard/src/components/RerunButton.tsx +46 -0
- package/dashboard/src/components/RunComparison.tsx +53 -0
- package/dashboard/src/components/Sparkline.tsx +94 -0
- package/dashboard/src/components/StatStrip.tsx +147 -0
- package/dashboard/src/components/StateTree.tsx +84 -0
- package/dashboard/src/components/StatusBadge.tsx +18 -0
- package/dashboard/src/components/SubflowPathPills.tsx +38 -0
- package/dashboard/src/components/SubflowSummary.tsx +24 -0
- package/dashboard/src/components/SubflowsCard.tsx +327 -0
- package/dashboard/src/components/TodayStrip.tsx +86 -0
- package/dashboard/src/components/TranscriptPane.tsx +99 -0
- package/dashboard/src/components/TranscriptRow.tsx +69 -0
- package/dashboard/src/components/ui/badge.tsx +38 -0
- package/dashboard/src/components/ui/button.tsx +28 -0
- package/dashboard/src/components/ui/card.tsx +42 -0
- package/dashboard/src/components/ui/skeleton.tsx +9 -0
- package/dashboard/src/components/ui/table.tsx +62 -0
- package/dashboard/src/index.css +26 -0
- package/dashboard/src/lib/anomaly.ts +42 -0
- package/dashboard/src/lib/format.ts +30 -0
- package/dashboard/src/lib/step-history.ts +13 -0
- package/dashboard/src/lib/subflow.ts +154 -0
- package/dashboard/src/lib/use-click-outside.ts +28 -0
- package/dashboard/src/lib/use-ignored-clusters.ts +67 -0
- package/dashboard/src/lib/utils.ts +6 -0
- package/dashboard/src/main.tsx +10 -0
- package/dashboard/src/types/shims.d.ts +4 -0
- package/dashboard/src/views/Home.tsx +478 -0
- package/dashboard/src/views/PipelineDetail.tsx +1185 -0
- package/dashboard/src/views/PipelinesList.tsx +111 -0
- package/dashboard/src/views/RunDetail.tsx +248 -0
- package/dashboard/src/views/Search.tsx +196 -0
- package/dashboard/stats.js +668 -0
- package/dashboard/tailwind.config.ts +43 -0
- package/dashboard/tree-stats.js +12 -0
- package/dashboard/tsconfig.json +25 -0
- package/dashboard/views.js +231 -0
- package/dashboard/vite.config.ts +34 -0
- package/drizzle.config.js +12 -0
- package/drizzle.config.ops.js +12 -0
- package/elevation.js +116 -0
- package/engine/admission-promotion-resume.js +127 -0
- package/engine/agent-dispatch.js +64 -0
- package/engine/child-resume-trigger.js +315 -0
- package/engine/executor-budget.js +87 -0
- package/engine/executor-cancel.js +83 -0
- package/engine/executor-errors.js +122 -0
- package/engine/executor-helpers.js +254 -0
- package/engine/executor-nodes.js +292 -0
- package/engine/executor-persist.js +212 -0
- package/engine/executor-subflow-children.js +275 -0
- package/engine/executor.js +1013 -0
- package/engine/global-concurrency.js +33 -0
- package/engine/loader.js +528 -0
- package/engine/needs-resolver.js +229 -0
- package/engine/pipelines-watcher.js +133 -0
- package/engine/result-replay.js +34 -0
- package/engine/revival-messages.js +11 -0
- package/engine/spawn-child.js +55 -0
- package/engine/wait-for-flow-settlement.js +109 -0
- package/events/catalog.js +26 -0
- package/events/emit.js +44 -0
- package/events/kinds.js +118 -0
- package/events/serve-ws.js +74 -0
- package/events/stream.js +35 -0
- package/events/ws-dialog.js +257 -0
- package/events/ws-frame.js +194 -0
- package/events/ws-run-events.js +70 -0
- package/events.js +32 -0
- package/gates/gate-resolver.js +576 -0
- package/gates/paused-flows.js +55 -0
- package/graphql/columns.js +67 -0
- package/graphql/schema.js +333 -0
- package/index.js +49 -0
- package/mcp/http.js +159 -0
- package/mcp/identity.js +94 -0
- package/mcp/stdio.js +80 -0
- package/mcp/tools.js +245 -0
- package/mcp/wire-ops.js +178 -0
- package/package.json +51 -0
- package/routes/bearer-auth.js +57 -0
- package/routes/discuss-audio.js +87 -0
- package/routes/discuss-component.js +39 -0
- package/routes/discuss-draft.js +159 -0
- package/routes/discuss-helpers.js +20 -0
- package/routes/discuss.js +848 -0
- package/routes/failures.js +104 -0
- package/routes/graphql.js +61 -0
- package/routes/health.js +54 -0
- package/routes/operator-discuss.js +193 -0
- package/routes/operator-resume.js +32 -0
- package/routes/operator-retry.js +301 -0
- package/routes/operator.js +539 -0
- package/routes/pipelines.js +118 -0
- package/routes/runs.js +1129 -0
- package/scripts/ci/import-check.mjs +50 -0
- package/scripts/link-core-self.mjs +31 -0
- package/scripts/with-guard.sh +24 -0
- package/server/app.js +503 -0
- package/server/registry.js +53 -0
- package/server/serve.js +163 -0
- package/state/admission-queue-store.js +325 -0
- package/state/attribution-registries.js +102 -0
- package/state/batch-writer.js +162 -0
- package/state/db-guard.js +63 -0
- package/state/db-health.js +27 -0
- package/state/db.js +122 -0
- package/state/discuss-store.js +299 -0
- package/state/failure-store.js +427 -0
- package/state/migrate.js +104 -0
- package/state/node-cost.js +67 -0
- package/state/node-executions.js +775 -0
- package/state/node-health-store.js +124 -0
- package/state/ops-merge.js +93 -0
- package/state/paths.js +146 -0
- package/state/pipeline-dirs.js +99 -0
- package/state/pipeline-registry.js +449 -0
- package/state/run-store.js +697 -0
- package/state/schema.js +438 -0
- package/state/schema.ops.js +44 -0
- package/state/session-index.js +177 -0
- package/state/session-keys.js +39 -0
- package/state/state-store.js +311 -0
- package/state/subflow-state.js +126 -0
- package/state/tool-handoff.js +169 -0
- package/telemetry/budget-alert.js +353 -0
- package/telemetry/cli.js +331 -0
- package/telemetry/grammar.js +119 -0
- package/telemetry/http-budget.js +132 -0
- package/telemetry/http-cost.js +670 -0
- package/telemetry/http-helpers.js +134 -0
- package/telemetry/http-tree.js +349 -0
- package/telemetry/http.js +44 -0
- package/telemetry/index.js +307 -0
- package/telemetry/ingest.js +134 -0
- package/telemetry/labels.js +115 -0
- package/telemetry/pricer.js +77 -0
- package/telemetry/resolver.js +314 -0
- package/telemetry/store.js +147 -0
- package/utils/run-patch.js +43 -0
|
@@ -0,0 +1,371 @@
|
|
|
1
|
+
(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))n(a);new MutationObserver(a=>{for(const i of a)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&n(s)}).observe(document,{childList:!0,subtree:!0});function r(a){const i={};return a.integrity&&(i.integrity=a.integrity),a.referrerPolicy&&(i.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?i.credentials="include":a.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function n(a){if(a.ep)return;a.ep=!0;const i=r(a);fetch(a.href,i)}})();var Hs=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function sN(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var oN={exports:{}},cc={},lN={exports:{}},Be={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var Uo=Symbol.for("react.element"),qI=Symbol.for("react.portal"),FI=Symbol.for("react.fragment"),$I=Symbol.for("react.strict_mode"),zI=Symbol.for("react.profiler"),VI=Symbol.for("react.provider"),UI=Symbol.for("react.context"),GI=Symbol.for("react.forward_ref"),HI=Symbol.for("react.suspense"),WI=Symbol.for("react.memo"),KI=Symbol.for("react.lazy"),V1=Symbol.iterator;function YI(t){return t===null||typeof t!="object"?null:(t=V1&&t[V1]||t["@@iterator"],typeof t=="function"?t:null)}var uN={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},cN=Object.assign,dN={};function us(t,e,r){this.props=t,this.context=e,this.refs=dN,this.updater=r||uN}us.prototype.isReactComponent={};us.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")};us.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function fN(){}fN.prototype=us.prototype;function Q0(t,e,r){this.props=t,this.context=e,this.refs=dN,this.updater=r||uN}var J0=Q0.prototype=new fN;J0.constructor=Q0;cN(J0,us.prototype);J0.isPureReactComponent=!0;var U1=Array.isArray,vN=Object.prototype.hasOwnProperty,ex={current:null},hN={key:!0,ref:!0,__self:!0,__source:!0};function pN(t,e,r){var n,a={},i=null,s=null;if(e!=null)for(n in e.ref!==void 0&&(s=e.ref),e.key!==void 0&&(i=""+e.key),e)vN.call(e,n)&&!hN.hasOwnProperty(n)&&(a[n]=e[n]);var o=arguments.length-2;if(o===1)a.children=r;else if(1<o){for(var l=Array(o),u=0;u<o;u++)l[u]=arguments[u+2];a.children=l}if(t&&t.defaultProps)for(n in o=t.defaultProps,o)a[n]===void 0&&(a[n]=o[n]);return{$$typeof:Uo,type:t,key:i,ref:s,props:a,_owner:ex.current}}function XI(t,e){return{$$typeof:Uo,type:t.type,key:e,ref:t.ref,props:t.props,_owner:t._owner}}function tx(t){return typeof t=="object"&&t!==null&&t.$$typeof===Uo}function ZI(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(r){return e[r]})}var G1=/\/+/g;function cd(t,e){return typeof t=="object"&&t!==null&&t.key!=null?ZI(""+t.key):e.toString(36)}function Ql(t,e,r,n,a){var i=typeof t;(i==="undefined"||i==="boolean")&&(t=null);var s=!1;if(t===null)s=!0;else switch(i){case"string":case"number":s=!0;break;case"object":switch(t.$$typeof){case Uo:case qI:s=!0}}if(s)return s=t,a=a(s),t=n===""?"."+cd(s,0):n,U1(a)?(r="",t!=null&&(r=t.replace(G1,"$&/")+"/"),Ql(a,e,r,"",function(u){return u})):a!=null&&(tx(a)&&(a=XI(a,r+(!a.key||s&&s.key===a.key?"":(""+a.key).replace(G1,"$&/")+"/")+t)),e.push(a)),1;if(s=0,n=n===""?".":n+":",U1(t))for(var o=0;o<t.length;o++){i=t[o];var l=n+cd(i,o);s+=Ql(i,e,r,l,a)}else if(l=YI(t),typeof l=="function")for(t=l.call(t),o=0;!(i=t.next()).done;)i=i.value,l=n+cd(i,o++),s+=Ql(i,e,r,l,a);else if(i==="object")throw e=String(t),Error("Objects are not valid as a React child (found: "+(e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead.");return s}function gl(t,e,r){if(t==null)return t;var n=[],a=0;return Ql(t,n,"","",function(i){return e.call(r,i,a++)}),n}function QI(t){if(t._status===-1){var e=t._result;e=e(),e.then(function(r){(t._status===0||t._status===-1)&&(t._status=1,t._result=r)},function(r){(t._status===0||t._status===-1)&&(t._status=2,t._result=r)}),t._status===-1&&(t._status=0,t._result=e)}if(t._status===1)return t._result.default;throw t._result}var ur={current:null},Jl={transition:null},JI={ReactCurrentDispatcher:ur,ReactCurrentBatchConfig:Jl,ReactCurrentOwner:ex};function gN(){throw Error("act(...) is not supported in production builds of React.")}Be.Children={map:gl,forEach:function(t,e,r){gl(t,function(){e.apply(this,arguments)},r)},count:function(t){var e=0;return gl(t,function(){e++}),e},toArray:function(t){return gl(t,function(e){return e})||[]},only:function(t){if(!tx(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};Be.Component=us;Be.Fragment=FI;Be.Profiler=zI;Be.PureComponent=Q0;Be.StrictMode=$I;Be.Suspense=HI;Be.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=JI;Be.act=gN;Be.cloneElement=function(t,e,r){if(t==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+t+".");var n=cN({},t.props),a=t.key,i=t.ref,s=t._owner;if(e!=null){if(e.ref!==void 0&&(i=e.ref,s=ex.current),e.key!==void 0&&(a=""+e.key),t.type&&t.type.defaultProps)var o=t.type.defaultProps;for(l in e)vN.call(e,l)&&!hN.hasOwnProperty(l)&&(n[l]=e[l]===void 0&&o!==void 0?o[l]:e[l])}var l=arguments.length-2;if(l===1)n.children=r;else if(1<l){o=Array(l);for(var u=0;u<l;u++)o[u]=arguments[u+2];n.children=o}return{$$typeof:Uo,type:t.type,key:a,ref:i,props:n,_owner:s}};Be.createContext=function(t){return t={$$typeof:UI,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},t.Provider={$$typeof:VI,_context:t},t.Consumer=t};Be.createElement=pN;Be.createFactory=function(t){var e=pN.bind(null,t);return e.type=t,e};Be.createRef=function(){return{current:null}};Be.forwardRef=function(t){return{$$typeof:GI,render:t}};Be.isValidElement=tx;Be.lazy=function(t){return{$$typeof:KI,_payload:{_status:-1,_result:t},_init:QI}};Be.memo=function(t,e){return{$$typeof:WI,type:t,compare:e===void 0?null:e}};Be.startTransition=function(t){var e=Jl.transition;Jl.transition={};try{t()}finally{Jl.transition=e}};Be.unstable_act=gN;Be.useCallback=function(t,e){return ur.current.useCallback(t,e)};Be.useContext=function(t){return ur.current.useContext(t)};Be.useDebugValue=function(){};Be.useDeferredValue=function(t){return ur.current.useDeferredValue(t)};Be.useEffect=function(t,e){return ur.current.useEffect(t,e)};Be.useId=function(){return ur.current.useId()};Be.useImperativeHandle=function(t,e,r){return ur.current.useImperativeHandle(t,e,r)};Be.useInsertionEffect=function(t,e){return ur.current.useInsertionEffect(t,e)};Be.useLayoutEffect=function(t,e){return ur.current.useLayoutEffect(t,e)};Be.useMemo=function(t,e){return ur.current.useMemo(t,e)};Be.useReducer=function(t,e,r){return ur.current.useReducer(t,e,r)};Be.useRef=function(t){return ur.current.useRef(t)};Be.useState=function(t){return ur.current.useState(t)};Be.useSyncExternalStore=function(t,e,r){return ur.current.useSyncExternalStore(t,e,r)};Be.useTransition=function(){return ur.current.useTransition()};Be.version="18.3.1";lN.exports=Be;var Z=lN.exports;const eM=sN(Z);/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.production.min.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var tM=Z,rM=Symbol.for("react.element"),nM=Symbol.for("react.fragment"),aM=Object.prototype.hasOwnProperty,iM=tM.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,sM={key:!0,ref:!0,__self:!0,__source:!0};function mN(t,e,r){var n,a={},i=null,s=null;r!==void 0&&(i=""+r),e.key!==void 0&&(i=""+e.key),e.ref!==void 0&&(s=e.ref);for(n in e)aM.call(e,n)&&!sM.hasOwnProperty(n)&&(a[n]=e[n]);if(t&&t.defaultProps)for(n in e=t.defaultProps,e)a[n]===void 0&&(a[n]=e[n]);return{$$typeof:rM,type:t,key:i,ref:s,props:a,_owner:iM.current}}cc.Fragment=nM;cc.jsx=mN;cc.jsxs=mN;oN.exports=cc;var g=oN.exports,My={},yN={exports:{}},Rr={},xN={exports:{}},bN={};/**
|
|
18
|
+
* @license React
|
|
19
|
+
* scheduler.production.min.js
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
22
|
+
*
|
|
23
|
+
* This source code is licensed under the MIT license found in the
|
|
24
|
+
* LICENSE file in the root directory of this source tree.
|
|
25
|
+
*/(function(t){function e(j,F){var O=j.length;j.push(F);e:for(;0<O;){var B=O-1>>>1,V=j[B];if(0<a(V,F))j[B]=F,j[O]=V,O=B;else break e}}function r(j){return j.length===0?null:j[0]}function n(j){if(j.length===0)return null;var F=j[0],O=j.pop();if(O!==F){j[0]=O;e:for(var B=0,V=j.length,J=V>>>1;B<J;){var q=2*(B+1)-1,$=j[q],z=q+1,W=j[z];if(0>a($,O))z<V&&0>a(W,$)?(j[B]=W,j[z]=O,B=z):(j[B]=$,j[q]=O,B=q);else if(z<V&&0>a(W,O))j[B]=W,j[z]=O,B=z;else break e}}return F}function a(j,F){var O=j.sortIndex-F.sortIndex;return O!==0?O:j.id-F.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;t.unstable_now=function(){return i.now()}}else{var s=Date,o=s.now();t.unstable_now=function(){return s.now()-o}}var l=[],u=[],c=1,d=null,f=3,h=!1,v=!1,x=!1,b=typeof setTimeout=="function"?setTimeout:null,m=typeof clearTimeout=="function"?clearTimeout:null,p=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y(j){for(var F=r(u);F!==null;){if(F.callback===null)n(u);else if(F.startTime<=j)n(u),F.sortIndex=F.expirationTime,e(l,F);else break;F=r(u)}}function w(j){if(x=!1,y(j),!v)if(r(l)!==null)v=!0,D(E);else{var F=r(u);F!==null&&L(w,F.startTime-j)}}function E(j,F){v=!1,x&&(x=!1,m(k),k=-1),h=!0;var O=f;try{for(y(F),d=r(l);d!==null&&(!(d.expirationTime>F)||j&&!N());){var B=d.callback;if(typeof B=="function"){d.callback=null,f=d.priorityLevel;var V=B(d.expirationTime<=F);F=t.unstable_now(),typeof V=="function"?d.callback=V:d===r(l)&&n(l),y(F)}else n(l);d=r(l)}if(d!==null)var J=!0;else{var q=r(u);q!==null&&L(w,q.startTime-F),J=!1}return J}finally{d=null,f=O,h=!1}}var S=!1,C=null,k=-1,T=5,_=-1;function N(){return!(t.unstable_now()-_<T)}function P(){if(C!==null){var j=t.unstable_now();_=j;var F=!0;try{F=C(!0,j)}finally{F?R():(S=!1,C=null)}}else S=!1}var R;if(typeof p=="function")R=function(){p(P)};else if(typeof MessageChannel<"u"){var I=new MessageChannel,M=I.port2;I.port1.onmessage=P,R=function(){M.postMessage(null)}}else R=function(){b(P,0)};function D(j){C=j,S||(S=!0,R())}function L(j,F){k=b(function(){j(t.unstable_now())},F)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(j){j.callback=null},t.unstable_continueExecution=function(){v||h||(v=!0,D(E))},t.unstable_forceFrameRate=function(j){0>j||125<j?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):T=0<j?Math.floor(1e3/j):5},t.unstable_getCurrentPriorityLevel=function(){return f},t.unstable_getFirstCallbackNode=function(){return r(l)},t.unstable_next=function(j){switch(f){case 1:case 2:case 3:var F=3;break;default:F=f}var O=f;f=F;try{return j()}finally{f=O}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(j,F){switch(j){case 1:case 2:case 3:case 4:case 5:break;default:j=3}var O=f;f=j;try{return F()}finally{f=O}},t.unstable_scheduleCallback=function(j,F,O){var B=t.unstable_now();switch(typeof O=="object"&&O!==null?(O=O.delay,O=typeof O=="number"&&0<O?B+O:B):O=B,j){case 1:var V=-1;break;case 2:V=250;break;case 5:V=1073741823;break;case 4:V=1e4;break;default:V=5e3}return V=O+V,j={id:c++,callback:F,priorityLevel:j,startTime:O,expirationTime:V,sortIndex:-1},O>B?(j.sortIndex=O,e(u,j),r(l)===null&&j===r(u)&&(x?(m(k),k=-1):x=!0,L(w,O-B))):(j.sortIndex=V,e(l,j),v||h||(v=!0,D(E))),j},t.unstable_shouldYield=N,t.unstable_wrapCallback=function(j){var F=f;return function(){var O=f;f=F;try{return j.apply(this,arguments)}finally{f=O}}}})(bN);xN.exports=bN;var oM=xN.exports;/**
|
|
26
|
+
* @license React
|
|
27
|
+
* react-dom.production.min.js
|
|
28
|
+
*
|
|
29
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
30
|
+
*
|
|
31
|
+
* This source code is licensed under the MIT license found in the
|
|
32
|
+
* LICENSE file in the root directory of this source tree.
|
|
33
|
+
*/var lM=Z,Nr=oM;function se(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,r=1;r<arguments.length;r++)e+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var wN=new Set,mo={};function li(t,e){Qi(t,e),Qi(t+"Capture",e)}function Qi(t,e){for(mo[t]=e,t=0;t<e.length;t++)wN.add(e[t])}var jn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Dy=Object.prototype.hasOwnProperty,uM=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,H1={},W1={};function cM(t){return Dy.call(W1,t)?!0:Dy.call(H1,t)?!1:uM.test(t)?W1[t]=!0:(H1[t]=!0,!1)}function dM(t,e,r,n){if(r!==null&&r.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function fM(t,e,r,n){if(e===null||typeof e>"u"||dM(t,e,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function cr(t,e,r,n,a,i,s){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=n,this.attributeNamespace=a,this.mustUseProperty=r,this.propertyName=t,this.type=e,this.sanitizeURL=i,this.removeEmptyString=s}var Wt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){Wt[t]=new cr(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];Wt[e]=new cr(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){Wt[t]=new cr(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){Wt[t]=new cr(t,2,!1,t,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(t){Wt[t]=new cr(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){Wt[t]=new cr(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){Wt[t]=new cr(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){Wt[t]=new cr(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){Wt[t]=new cr(t,5,!1,t.toLowerCase(),null,!1,!1)});var rx=/[\-:]([a-z])/g;function nx(t){return t[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(t){var e=t.replace(rx,nx);Wt[e]=new cr(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(rx,nx);Wt[e]=new cr(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(rx,nx);Wt[e]=new cr(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){Wt[t]=new cr(t,1,!1,t.toLowerCase(),null,!1,!1)});Wt.xlinkHref=new cr("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){Wt[t]=new cr(t,1,!1,t.toLowerCase(),null,!0,!0)});function ax(t,e,r,n){var a=Wt.hasOwnProperty(e)?Wt[e]:null;(a!==null?a.type!==0:n||!(2<e.length)||e[0]!=="o"&&e[0]!=="O"||e[1]!=="n"&&e[1]!=="N")&&(fM(e,r,a,n)&&(r=null),n||a===null?cM(e)&&(r===null?t.removeAttribute(e):t.setAttribute(e,""+r)):a.mustUseProperty?t[a.propertyName]=r===null?a.type===3?!1:"":r:(e=a.attributeName,n=a.attributeNamespace,r===null?t.removeAttribute(e):(a=a.type,r=a===3||a===4&&r===!0?"":""+r,n?t.setAttributeNS(n,e,r):t.setAttribute(e,r))))}var On=lM.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,ml=Symbol.for("react.element"),Ti=Symbol.for("react.portal"),_i=Symbol.for("react.fragment"),ix=Symbol.for("react.strict_mode"),Ly=Symbol.for("react.profiler"),SN=Symbol.for("react.provider"),EN=Symbol.for("react.context"),sx=Symbol.for("react.forward_ref"),By=Symbol.for("react.suspense"),Oy=Symbol.for("react.suspense_list"),ox=Symbol.for("react.memo"),Yn=Symbol.for("react.lazy"),CN=Symbol.for("react.offscreen"),K1=Symbol.iterator;function _s(t){return t===null||typeof t!="object"?null:(t=K1&&t[K1]||t["@@iterator"],typeof t=="function"?t:null)}var mt=Object.assign,dd;function Ws(t){if(dd===void 0)try{throw Error()}catch(r){var e=r.stack.trim().match(/\n( *(at )?)/);dd=e&&e[1]||""}return`
|
|
34
|
+
`+dd+t}var fd=!1;function vd(t,e){if(!t||fd)return"";fd=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(e)if(e=function(){throw Error()},Object.defineProperty(e.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(e,[])}catch(u){var n=u}Reflect.construct(t,[],e)}else{try{e.call()}catch(u){n=u}t.call(e.prototype)}else{try{throw Error()}catch(u){n=u}t()}}catch(u){if(u&&n&&typeof u.stack=="string"){for(var a=u.stack.split(`
|
|
35
|
+
`),i=n.stack.split(`
|
|
36
|
+
`),s=a.length-1,o=i.length-1;1<=s&&0<=o&&a[s]!==i[o];)o--;for(;1<=s&&0<=o;s--,o--)if(a[s]!==i[o]){if(s!==1||o!==1)do if(s--,o--,0>o||a[s]!==i[o]){var l=`
|
|
37
|
+
`+a[s].replace(" at new "," at ");return t.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",t.displayName)),l}while(1<=s&&0<=o);break}}}finally{fd=!1,Error.prepareStackTrace=r}return(t=t?t.displayName||t.name:"")?Ws(t):""}function vM(t){switch(t.tag){case 5:return Ws(t.type);case 16:return Ws("Lazy");case 13:return Ws("Suspense");case 19:return Ws("SuspenseList");case 0:case 2:case 15:return t=vd(t.type,!1),t;case 11:return t=vd(t.type.render,!1),t;case 1:return t=vd(t.type,!0),t;default:return""}}function qy(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case _i:return"Fragment";case Ti:return"Portal";case Ly:return"Profiler";case ix:return"StrictMode";case By:return"Suspense";case Oy:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case EN:return(t.displayName||"Context")+".Consumer";case SN:return(t._context.displayName||"Context")+".Provider";case sx:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case ox:return e=t.displayName||null,e!==null?e:qy(t.type)||"Memo";case Yn:e=t._payload,t=t._init;try{return qy(t(e))}catch{}}return null}function hM(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return qy(e);case 8:return e===ix?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function ga(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function kN(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function pM(t){var e=kN(t)?"checked":"value",r=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),n=""+t[e];if(!t.hasOwnProperty(e)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var a=r.get,i=r.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return a.call(this)},set:function(s){n=""+s,i.call(this,s)}}),Object.defineProperty(t,e,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(s){n=""+s},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function yl(t){t._valueTracker||(t._valueTracker=pM(t))}function TN(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var r=e.getValue(),n="";return t&&(n=kN(t)?t.checked?"true":"false":t.value),t=n,t!==r?(e.setValue(t),!0):!1}function Eu(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function Fy(t,e){var r=e.checked;return mt({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??t._wrapperState.initialChecked})}function Y1(t,e){var r=e.defaultValue==null?"":e.defaultValue,n=e.checked!=null?e.checked:e.defaultChecked;r=ga(e.value!=null?e.value:r),t._wrapperState={initialChecked:n,initialValue:r,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function _N(t,e){e=e.checked,e!=null&&ax(t,"checked",e,!1)}function $y(t,e){_N(t,e);var r=ga(e.value),n=e.type;if(r!=null)n==="number"?(r===0&&t.value===""||t.value!=r)&&(t.value=""+r):t.value!==""+r&&(t.value=""+r);else if(n==="submit"||n==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?zy(t,e.type,r):e.hasOwnProperty("defaultValue")&&zy(t,e.type,ga(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function X1(t,e,r){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var n=e.type;if(!(n!=="submit"&&n!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,r||e===t.value||(t.value=e),t.defaultValue=e}r=t.name,r!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,r!==""&&(t.name=r)}function zy(t,e,r){(e!=="number"||Eu(t.ownerDocument)!==t)&&(r==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+r&&(t.defaultValue=""+r))}var Ks=Array.isArray;function $i(t,e,r,n){if(t=t.options,e){e={};for(var a=0;a<r.length;a++)e["$"+r[a]]=!0;for(r=0;r<t.length;r++)a=e.hasOwnProperty("$"+t[r].value),t[r].selected!==a&&(t[r].selected=a),a&&n&&(t[r].defaultSelected=!0)}else{for(r=""+ga(r),e=null,a=0;a<t.length;a++){if(t[a].value===r){t[a].selected=!0,n&&(t[a].defaultSelected=!0);return}e!==null||t[a].disabled||(e=t[a])}e!==null&&(e.selected=!0)}}function Vy(t,e){if(e.dangerouslySetInnerHTML!=null)throw Error(se(91));return mt({},e,{value:void 0,defaultValue:void 0,children:""+t._wrapperState.initialValue})}function Z1(t,e){var r=e.value;if(r==null){if(r=e.children,e=e.defaultValue,r!=null){if(e!=null)throw Error(se(92));if(Ks(r)){if(1<r.length)throw Error(se(93));r=r[0]}e=r}e==null&&(e=""),r=e}t._wrapperState={initialValue:ga(r)}}function NN(t,e){var r=ga(e.value),n=ga(e.defaultValue);r!=null&&(r=""+r,r!==t.value&&(t.value=r),e.defaultValue==null&&t.defaultValue!==r&&(t.defaultValue=r)),n!=null&&(t.defaultValue=""+n)}function Q1(t){var e=t.textContent;e===t._wrapperState.initialValue&&e!==""&&e!==null&&(t.value=e)}function RN(t){switch(t){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Uy(t,e){return t==null||t==="http://www.w3.org/1999/xhtml"?RN(e):t==="http://www.w3.org/2000/svg"&&e==="foreignObject"?"http://www.w3.org/1999/xhtml":t}var xl,PN=function(t){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(e,r,n,a){MSApp.execUnsafeLocalFunction(function(){return t(e,r,n,a)})}:t}(function(t,e){if(t.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in t)t.innerHTML=e;else{for(xl=xl||document.createElement("div"),xl.innerHTML="<svg>"+e.valueOf().toString()+"</svg>",e=xl.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function yo(t,e){if(e){var r=t.firstChild;if(r&&r===t.lastChild&&r.nodeType===3){r.nodeValue=e;return}}t.textContent=e}var ao={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},gM=["Webkit","ms","Moz","O"];Object.keys(ao).forEach(function(t){gM.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),ao[e]=ao[t]})});function AN(t,e,r){return e==null||typeof e=="boolean"||e===""?"":r||typeof e!="number"||e===0||ao.hasOwnProperty(t)&&ao[t]?(""+e).trim():e+"px"}function jN(t,e){t=t.style;for(var r in e)if(e.hasOwnProperty(r)){var n=r.indexOf("--")===0,a=AN(r,e[r],n);r==="float"&&(r="cssFloat"),n?t.setProperty(r,a):t[r]=a}}var mM=mt({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Gy(t,e){if(e){if(mM[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(se(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(se(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(se(61))}if(e.style!=null&&typeof e.style!="object")throw Error(se(62))}}function Hy(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Wy=null;function lx(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Ky=null,zi=null,Vi=null;function J1(t){if(t=Wo(t)){if(typeof Ky!="function")throw Error(se(280));var e=t.stateNode;e&&(e=pc(e),Ky(t.stateNode,t.type,e))}}function IN(t){zi?Vi?Vi.push(t):Vi=[t]:zi=t}function MN(){if(zi){var t=zi,e=Vi;if(Vi=zi=null,J1(t),e)for(t=0;t<e.length;t++)J1(e[t])}}function DN(t,e){return t(e)}function LN(){}var hd=!1;function BN(t,e,r){if(hd)return t(e,r);hd=!0;try{return DN(t,e,r)}finally{hd=!1,(zi!==null||Vi!==null)&&(LN(),MN())}}function xo(t,e){var r=t.stateNode;if(r===null)return null;var n=pc(r);if(n===null)return null;r=n[e];e:switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(n=!n.disabled)||(t=t.type,n=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!n;break e;default:t=!1}if(t)return null;if(r&&typeof r!="function")throw Error(se(231,e,typeof r));return r}var Yy=!1;if(jn)try{var Ns={};Object.defineProperty(Ns,"passive",{get:function(){Yy=!0}}),window.addEventListener("test",Ns,Ns),window.removeEventListener("test",Ns,Ns)}catch{Yy=!1}function yM(t,e,r,n,a,i,s,o,l){var u=Array.prototype.slice.call(arguments,3);try{e.apply(r,u)}catch(c){this.onError(c)}}var io=!1,Cu=null,ku=!1,Xy=null,xM={onError:function(t){io=!0,Cu=t}};function bM(t,e,r,n,a,i,s,o,l){io=!1,Cu=null,yM.apply(xM,arguments)}function wM(t,e,r,n,a,i,s,o,l){if(bM.apply(this,arguments),io){if(io){var u=Cu;io=!1,Cu=null}else throw Error(se(198));ku||(ku=!0,Xy=u)}}function ui(t){var e=t,r=t;if(t.alternate)for(;e.return;)e=e.return;else{t=e;do e=t,e.flags&4098&&(r=e.return),t=e.return;while(t)}return e.tag===3?r:null}function ON(t){if(t.tag===13){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function eb(t){if(ui(t)!==t)throw Error(se(188))}function SM(t){var e=t.alternate;if(!e){if(e=ui(t),e===null)throw Error(se(188));return e!==t?null:t}for(var r=t,n=e;;){var a=r.return;if(a===null)break;var i=a.alternate;if(i===null){if(n=a.return,n!==null){r=n;continue}break}if(a.child===i.child){for(i=a.child;i;){if(i===r)return eb(a),t;if(i===n)return eb(a),e;i=i.sibling}throw Error(se(188))}if(r.return!==n.return)r=a,n=i;else{for(var s=!1,o=a.child;o;){if(o===r){s=!0,r=a,n=i;break}if(o===n){s=!0,n=a,r=i;break}o=o.sibling}if(!s){for(o=i.child;o;){if(o===r){s=!0,r=i,n=a;break}if(o===n){s=!0,n=i,r=a;break}o=o.sibling}if(!s)throw Error(se(189))}}if(r.alternate!==n)throw Error(se(190))}if(r.tag!==3)throw Error(se(188));return r.stateNode.current===r?t:e}function qN(t){return t=SM(t),t!==null?FN(t):null}function FN(t){if(t.tag===5||t.tag===6)return t;for(t=t.child;t!==null;){var e=FN(t);if(e!==null)return e;t=t.sibling}return null}var $N=Nr.unstable_scheduleCallback,tb=Nr.unstable_cancelCallback,EM=Nr.unstable_shouldYield,CM=Nr.unstable_requestPaint,St=Nr.unstable_now,kM=Nr.unstable_getCurrentPriorityLevel,ux=Nr.unstable_ImmediatePriority,zN=Nr.unstable_UserBlockingPriority,Tu=Nr.unstable_NormalPriority,TM=Nr.unstable_LowPriority,VN=Nr.unstable_IdlePriority,dc=null,pn=null;function _M(t){if(pn&&typeof pn.onCommitFiberRoot=="function")try{pn.onCommitFiberRoot(dc,t,void 0,(t.current.flags&128)===128)}catch{}}var Qr=Math.clz32?Math.clz32:PM,NM=Math.log,RM=Math.LN2;function PM(t){return t>>>=0,t===0?32:31-(NM(t)/RM|0)|0}var bl=64,wl=4194304;function Ys(t){switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function _u(t,e){var r=t.pendingLanes;if(r===0)return 0;var n=0,a=t.suspendedLanes,i=t.pingedLanes,s=r&268435455;if(s!==0){var o=s&~a;o!==0?n=Ys(o):(i&=s,i!==0&&(n=Ys(i)))}else s=r&~a,s!==0?n=Ys(s):i!==0&&(n=Ys(i));if(n===0)return 0;if(e!==0&&e!==n&&!(e&a)&&(a=n&-n,i=e&-e,a>=i||a===16&&(i&4194240)!==0))return e;if(n&4&&(n|=r&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=n;0<e;)r=31-Qr(e),a=1<<r,n|=t[r],e&=~a;return n}function AM(t,e){switch(t){case 1:case 2:case 4:return e+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function jM(t,e){for(var r=t.suspendedLanes,n=t.pingedLanes,a=t.expirationTimes,i=t.pendingLanes;0<i;){var s=31-Qr(i),o=1<<s,l=a[s];l===-1?(!(o&r)||o&n)&&(a[s]=AM(o,e)):l<=e&&(t.expiredLanes|=o),i&=~o}}function Zy(t){return t=t.pendingLanes&-1073741825,t!==0?t:t&1073741824?1073741824:0}function UN(){var t=bl;return bl<<=1,!(bl&4194240)&&(bl=64),t}function pd(t){for(var e=[],r=0;31>r;r++)e.push(t);return e}function Go(t,e,r){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-Qr(e),t[e]=r}function IM(t,e){var r=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var n=t.eventTimes;for(t=t.expirationTimes;0<r;){var a=31-Qr(r),i=1<<a;e[a]=0,n[a]=-1,t[a]=-1,r&=~i}}function cx(t,e){var r=t.entangledLanes|=e;for(t=t.entanglements;r;){var n=31-Qr(r),a=1<<n;a&e|t[n]&e&&(t[n]|=e),r&=~a}}var Xe=0;function GN(t){return t&=-t,1<t?4<t?t&268435455?16:536870912:4:1}var HN,dx,WN,KN,YN,Qy=!1,Sl=[],sa=null,oa=null,la=null,bo=new Map,wo=new Map,Qn=[],MM="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function rb(t,e){switch(t){case"focusin":case"focusout":sa=null;break;case"dragenter":case"dragleave":oa=null;break;case"mouseover":case"mouseout":la=null;break;case"pointerover":case"pointerout":bo.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":wo.delete(e.pointerId)}}function Rs(t,e,r,n,a,i){return t===null||t.nativeEvent!==i?(t={blockedOn:e,domEventName:r,eventSystemFlags:n,nativeEvent:i,targetContainers:[a]},e!==null&&(e=Wo(e),e!==null&&dx(e)),t):(t.eventSystemFlags|=n,e=t.targetContainers,a!==null&&e.indexOf(a)===-1&&e.push(a),t)}function DM(t,e,r,n,a){switch(e){case"focusin":return sa=Rs(sa,t,e,r,n,a),!0;case"dragenter":return oa=Rs(oa,t,e,r,n,a),!0;case"mouseover":return la=Rs(la,t,e,r,n,a),!0;case"pointerover":var i=a.pointerId;return bo.set(i,Rs(bo.get(i)||null,t,e,r,n,a)),!0;case"gotpointercapture":return i=a.pointerId,wo.set(i,Rs(wo.get(i)||null,t,e,r,n,a)),!0}return!1}function XN(t){var e=Va(t.target);if(e!==null){var r=ui(e);if(r!==null){if(e=r.tag,e===13){if(e=ON(r),e!==null){t.blockedOn=e,YN(t.priority,function(){WN(r)});return}}else if(e===3&&r.stateNode.current.memoizedState.isDehydrated){t.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}t.blockedOn=null}function eu(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var r=Jy(t.domEventName,t.eventSystemFlags,e[0],t.nativeEvent);if(r===null){r=t.nativeEvent;var n=new r.constructor(r.type,r);Wy=n,r.target.dispatchEvent(n),Wy=null}else return e=Wo(r),e!==null&&dx(e),t.blockedOn=r,!1;e.shift()}return!0}function nb(t,e,r){eu(t)&&r.delete(e)}function LM(){Qy=!1,sa!==null&&eu(sa)&&(sa=null),oa!==null&&eu(oa)&&(oa=null),la!==null&&eu(la)&&(la=null),bo.forEach(nb),wo.forEach(nb)}function Ps(t,e){t.blockedOn===e&&(t.blockedOn=null,Qy||(Qy=!0,Nr.unstable_scheduleCallback(Nr.unstable_NormalPriority,LM)))}function So(t){function e(a){return Ps(a,t)}if(0<Sl.length){Ps(Sl[0],t);for(var r=1;r<Sl.length;r++){var n=Sl[r];n.blockedOn===t&&(n.blockedOn=null)}}for(sa!==null&&Ps(sa,t),oa!==null&&Ps(oa,t),la!==null&&Ps(la,t),bo.forEach(e),wo.forEach(e),r=0;r<Qn.length;r++)n=Qn[r],n.blockedOn===t&&(n.blockedOn=null);for(;0<Qn.length&&(r=Qn[0],r.blockedOn===null);)XN(r),r.blockedOn===null&&Qn.shift()}var Ui=On.ReactCurrentBatchConfig,Nu=!0;function BM(t,e,r,n){var a=Xe,i=Ui.transition;Ui.transition=null;try{Xe=1,fx(t,e,r,n)}finally{Xe=a,Ui.transition=i}}function OM(t,e,r,n){var a=Xe,i=Ui.transition;Ui.transition=null;try{Xe=4,fx(t,e,r,n)}finally{Xe=a,Ui.transition=i}}function fx(t,e,r,n){if(Nu){var a=Jy(t,e,r,n);if(a===null)kd(t,e,n,Ru,r),rb(t,n);else if(DM(a,t,e,r,n))n.stopPropagation();else if(rb(t,n),e&4&&-1<MM.indexOf(t)){for(;a!==null;){var i=Wo(a);if(i!==null&&HN(i),i=Jy(t,e,r,n),i===null&&kd(t,e,n,Ru,r),i===a)break;a=i}a!==null&&n.stopPropagation()}else kd(t,e,n,null,r)}}var Ru=null;function Jy(t,e,r,n){if(Ru=null,t=lx(n),t=Va(t),t!==null)if(e=ui(t),e===null)t=null;else if(r=e.tag,r===13){if(t=ON(e),t!==null)return t;t=null}else if(r===3){if(e.stateNode.current.memoizedState.isDehydrated)return e.tag===3?e.stateNode.containerInfo:null;t=null}else e!==t&&(t=null);return Ru=t,null}function ZN(t){switch(t){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(kM()){case ux:return 1;case zN:return 4;case Tu:case TM:return 16;case VN:return 536870912;default:return 16}default:return 16}}var ea=null,vx=null,tu=null;function QN(){if(tu)return tu;var t,e=vx,r=e.length,n,a="value"in ea?ea.value:ea.textContent,i=a.length;for(t=0;t<r&&e[t]===a[t];t++);var s=r-t;for(n=1;n<=s&&e[r-n]===a[i-n];n++);return tu=a.slice(t,1<n?1-n:void 0)}function ru(t){var e=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&e===13&&(t=13)):t=e,t===10&&(t=13),32<=t||t===13?t:0}function El(){return!0}function ab(){return!1}function Pr(t){function e(r,n,a,i,s){this._reactName=r,this._targetInst=a,this.type=n,this.nativeEvent=i,this.target=s,this.currentTarget=null;for(var o in t)t.hasOwnProperty(o)&&(r=t[o],this[o]=r?r(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?El:ab,this.isPropagationStopped=ab,this}return mt(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=El)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=El)},persist:function(){},isPersistent:El}),e}var cs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},hx=Pr(cs),Ho=mt({},cs,{view:0,detail:0}),qM=Pr(Ho),gd,md,As,fc=mt({},Ho,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:px,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==As&&(As&&t.type==="mousemove"?(gd=t.screenX-As.screenX,md=t.screenY-As.screenY):md=gd=0,As=t),gd)},movementY:function(t){return"movementY"in t?t.movementY:md}}),ib=Pr(fc),FM=mt({},fc,{dataTransfer:0}),$M=Pr(FM),zM=mt({},Ho,{relatedTarget:0}),yd=Pr(zM),VM=mt({},cs,{animationName:0,elapsedTime:0,pseudoElement:0}),UM=Pr(VM),GM=mt({},cs,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),HM=Pr(GM),WM=mt({},cs,{data:0}),sb=Pr(WM),KM={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},YM={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},XM={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ZM(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=XM[t])?!!e[t]:!1}function px(){return ZM}var QM=mt({},Ho,{key:function(t){if(t.key){var e=KM[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=ru(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?YM[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:px,charCode:function(t){return t.type==="keypress"?ru(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?ru(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),JM=Pr(QM),eD=mt({},fc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),ob=Pr(eD),tD=mt({},Ho,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:px}),rD=Pr(tD),nD=mt({},cs,{propertyName:0,elapsedTime:0,pseudoElement:0}),aD=Pr(nD),iD=mt({},fc,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),sD=Pr(iD),oD=[9,13,27,32],gx=jn&&"CompositionEvent"in window,so=null;jn&&"documentMode"in document&&(so=document.documentMode);var lD=jn&&"TextEvent"in window&&!so,JN=jn&&(!gx||so&&8<so&&11>=so),lb=" ",ub=!1;function eR(t,e){switch(t){case"keyup":return oD.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function tR(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Ni=!1;function uD(t,e){switch(t){case"compositionend":return tR(e);case"keypress":return e.which!==32?null:(ub=!0,lb);case"textInput":return t=e.data,t===lb&&ub?null:t;default:return null}}function cD(t,e){if(Ni)return t==="compositionend"||!gx&&eR(t,e)?(t=QN(),tu=vx=ea=null,Ni=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1<e.char.length)return e.char;if(e.which)return String.fromCharCode(e.which)}return null;case"compositionend":return JN&&e.locale!=="ko"?null:e.data;default:return null}}var dD={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function cb(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!dD[t.type]:e==="textarea"}function rR(t,e,r,n){IN(n),e=Pu(e,"onChange"),0<e.length&&(r=new hx("onChange","change",null,r,n),t.push({event:r,listeners:e}))}var oo=null,Eo=null;function fD(t){vR(t,0)}function vc(t){var e=Ai(t);if(TN(e))return t}function vD(t,e){if(t==="change")return e}var nR=!1;if(jn){var xd;if(jn){var bd="oninput"in document;if(!bd){var db=document.createElement("div");db.setAttribute("oninput","return;"),bd=typeof db.oninput=="function"}xd=bd}else xd=!1;nR=xd&&(!document.documentMode||9<document.documentMode)}function fb(){oo&&(oo.detachEvent("onpropertychange",aR),Eo=oo=null)}function aR(t){if(t.propertyName==="value"&&vc(Eo)){var e=[];rR(e,Eo,t,lx(t)),BN(fD,e)}}function hD(t,e,r){t==="focusin"?(fb(),oo=e,Eo=r,oo.attachEvent("onpropertychange",aR)):t==="focusout"&&fb()}function pD(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return vc(Eo)}function gD(t,e){if(t==="click")return vc(e)}function mD(t,e){if(t==="input"||t==="change")return vc(e)}function yD(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var tn=typeof Object.is=="function"?Object.is:yD;function Co(t,e){if(tn(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;var r=Object.keys(t),n=Object.keys(e);if(r.length!==n.length)return!1;for(n=0;n<r.length;n++){var a=r[n];if(!Dy.call(e,a)||!tn(t[a],e[a]))return!1}return!0}function vb(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function hb(t,e){var r=vb(t);t=0;for(var n;r;){if(r.nodeType===3){if(n=t+r.textContent.length,t<=e&&n>=e)return{node:r,offset:e-t};t=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=vb(r)}}function iR(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?iR(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function sR(){for(var t=window,e=Eu();e instanceof t.HTMLIFrameElement;){try{var r=typeof e.contentWindow.location.href=="string"}catch{r=!1}if(r)t=e.contentWindow;else break;e=Eu(t.document)}return e}function mx(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function xD(t){var e=sR(),r=t.focusedElem,n=t.selectionRange;if(e!==r&&r&&r.ownerDocument&&iR(r.ownerDocument.documentElement,r)){if(n!==null&&mx(r)){if(e=n.start,t=n.end,t===void 0&&(t=e),"selectionStart"in r)r.selectionStart=e,r.selectionEnd=Math.min(t,r.value.length);else if(t=(e=r.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var a=r.textContent.length,i=Math.min(n.start,a);n=n.end===void 0?i:Math.min(n.end,a),!t.extend&&i>n&&(a=n,n=i,i=a),a=hb(r,i);var s=hb(r,n);a&&s&&(t.rangeCount!==1||t.anchorNode!==a.node||t.anchorOffset!==a.offset||t.focusNode!==s.node||t.focusOffset!==s.offset)&&(e=e.createRange(),e.setStart(a.node,a.offset),t.removeAllRanges(),i>n?(t.addRange(e),t.extend(s.node,s.offset)):(e.setEnd(s.node,s.offset),t.addRange(e)))}}for(e=[],t=r;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r<e.length;r++)t=e[r],t.element.scrollLeft=t.left,t.element.scrollTop=t.top}}var bD=jn&&"documentMode"in document&&11>=document.documentMode,Ri=null,e0=null,lo=null,t0=!1;function pb(t,e,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;t0||Ri==null||Ri!==Eu(n)||(n=Ri,"selectionStart"in n&&mx(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),lo&&Co(lo,n)||(lo=n,n=Pu(e0,"onSelect"),0<n.length&&(e=new hx("onSelect","select",null,e,r),t.push({event:e,listeners:n}),e.target=Ri)))}function Cl(t,e){var r={};return r[t.toLowerCase()]=e.toLowerCase(),r["Webkit"+t]="webkit"+e,r["Moz"+t]="moz"+e,r}var Pi={animationend:Cl("Animation","AnimationEnd"),animationiteration:Cl("Animation","AnimationIteration"),animationstart:Cl("Animation","AnimationStart"),transitionend:Cl("Transition","TransitionEnd")},wd={},oR={};jn&&(oR=document.createElement("div").style,"AnimationEvent"in window||(delete Pi.animationend.animation,delete Pi.animationiteration.animation,delete Pi.animationstart.animation),"TransitionEvent"in window||delete Pi.transitionend.transition);function hc(t){if(wd[t])return wd[t];if(!Pi[t])return t;var e=Pi[t],r;for(r in e)if(e.hasOwnProperty(r)&&r in oR)return wd[t]=e[r];return t}var lR=hc("animationend"),uR=hc("animationiteration"),cR=hc("animationstart"),dR=hc("transitionend"),fR=new Map,gb="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function ka(t,e){fR.set(t,e),li(e,[t])}for(var Sd=0;Sd<gb.length;Sd++){var Ed=gb[Sd],wD=Ed.toLowerCase(),SD=Ed[0].toUpperCase()+Ed.slice(1);ka(wD,"on"+SD)}ka(lR,"onAnimationEnd");ka(uR,"onAnimationIteration");ka(cR,"onAnimationStart");ka("dblclick","onDoubleClick");ka("focusin","onFocus");ka("focusout","onBlur");ka(dR,"onTransitionEnd");Qi("onMouseEnter",["mouseout","mouseover"]);Qi("onMouseLeave",["mouseout","mouseover"]);Qi("onPointerEnter",["pointerout","pointerover"]);Qi("onPointerLeave",["pointerout","pointerover"]);li("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));li("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));li("onBeforeInput",["compositionend","keypress","textInput","paste"]);li("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));li("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));li("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Xs="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),ED=new Set("cancel close invalid load scroll toggle".split(" ").concat(Xs));function mb(t,e,r){var n=t.type||"unknown-event";t.currentTarget=r,wM(n,e,void 0,t),t.currentTarget=null}function vR(t,e){e=(e&4)!==0;for(var r=0;r<t.length;r++){var n=t[r],a=n.event;n=n.listeners;e:{var i=void 0;if(e)for(var s=n.length-1;0<=s;s--){var o=n[s],l=o.instance,u=o.currentTarget;if(o=o.listener,l!==i&&a.isPropagationStopped())break e;mb(a,o,u),i=l}else for(s=0;s<n.length;s++){if(o=n[s],l=o.instance,u=o.currentTarget,o=o.listener,l!==i&&a.isPropagationStopped())break e;mb(a,o,u),i=l}}}if(ku)throw t=Xy,ku=!1,Xy=null,t}function it(t,e){var r=e[s0];r===void 0&&(r=e[s0]=new Set);var n=t+"__bubble";r.has(n)||(hR(e,t,2,!1),r.add(n))}function Cd(t,e,r){var n=0;e&&(n|=4),hR(r,t,n,e)}var kl="_reactListening"+Math.random().toString(36).slice(2);function ko(t){if(!t[kl]){t[kl]=!0,wN.forEach(function(r){r!=="selectionchange"&&(ED.has(r)||Cd(r,!1,t),Cd(r,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[kl]||(e[kl]=!0,Cd("selectionchange",!1,e))}}function hR(t,e,r,n){switch(ZN(e)){case 1:var a=BM;break;case 4:a=OM;break;default:a=fx}r=a.bind(null,e,r,t),a=void 0,!Yy||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(a=!0),n?a!==void 0?t.addEventListener(e,r,{capture:!0,passive:a}):t.addEventListener(e,r,!0):a!==void 0?t.addEventListener(e,r,{passive:a}):t.addEventListener(e,r,!1)}function kd(t,e,r,n,a){var i=n;if(!(e&1)&&!(e&2)&&n!==null)e:for(;;){if(n===null)return;var s=n.tag;if(s===3||s===4){var o=n.stateNode.containerInfo;if(o===a||o.nodeType===8&&o.parentNode===a)break;if(s===4)for(s=n.return;s!==null;){var l=s.tag;if((l===3||l===4)&&(l=s.stateNode.containerInfo,l===a||l.nodeType===8&&l.parentNode===a))return;s=s.return}for(;o!==null;){if(s=Va(o),s===null)return;if(l=s.tag,l===5||l===6){n=i=s;continue e}o=o.parentNode}}n=n.return}BN(function(){var u=i,c=lx(r),d=[];e:{var f=fR.get(t);if(f!==void 0){var h=hx,v=t;switch(t){case"keypress":if(ru(r)===0)break e;case"keydown":case"keyup":h=JM;break;case"focusin":v="focus",h=yd;break;case"focusout":v="blur",h=yd;break;case"beforeblur":case"afterblur":h=yd;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":h=ib;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=$M;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=rD;break;case lR:case uR:case cR:h=UM;break;case dR:h=aD;break;case"scroll":h=qM;break;case"wheel":h=sD;break;case"copy":case"cut":case"paste":h=HM;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=ob}var x=(e&4)!==0,b=!x&&t==="scroll",m=x?f!==null?f+"Capture":null:f;x=[];for(var p=u,y;p!==null;){y=p;var w=y.stateNode;if(y.tag===5&&w!==null&&(y=w,m!==null&&(w=xo(p,m),w!=null&&x.push(To(p,w,y)))),b)break;p=p.return}0<x.length&&(f=new h(f,v,null,r,c),d.push({event:f,listeners:x}))}}if(!(e&7)){e:{if(f=t==="mouseover"||t==="pointerover",h=t==="mouseout"||t==="pointerout",f&&r!==Wy&&(v=r.relatedTarget||r.fromElement)&&(Va(v)||v[In]))break e;if((h||f)&&(f=c.window===c?c:(f=c.ownerDocument)?f.defaultView||f.parentWindow:window,h?(v=r.relatedTarget||r.toElement,h=u,v=v?Va(v):null,v!==null&&(b=ui(v),v!==b||v.tag!==5&&v.tag!==6)&&(v=null)):(h=null,v=u),h!==v)){if(x=ib,w="onMouseLeave",m="onMouseEnter",p="mouse",(t==="pointerout"||t==="pointerover")&&(x=ob,w="onPointerLeave",m="onPointerEnter",p="pointer"),b=h==null?f:Ai(h),y=v==null?f:Ai(v),f=new x(w,p+"leave",h,r,c),f.target=b,f.relatedTarget=y,w=null,Va(c)===u&&(x=new x(m,p+"enter",v,r,c),x.target=y,x.relatedTarget=b,w=x),b=w,h&&v)t:{for(x=h,m=v,p=0,y=x;y;y=gi(y))p++;for(y=0,w=m;w;w=gi(w))y++;for(;0<p-y;)x=gi(x),p--;for(;0<y-p;)m=gi(m),y--;for(;p--;){if(x===m||m!==null&&x===m.alternate)break t;x=gi(x),m=gi(m)}x=null}else x=null;h!==null&&yb(d,f,h,x,!1),v!==null&&b!==null&&yb(d,b,v,x,!0)}}e:{if(f=u?Ai(u):window,h=f.nodeName&&f.nodeName.toLowerCase(),h==="select"||h==="input"&&f.type==="file")var E=vD;else if(cb(f))if(nR)E=mD;else{E=pD;var S=hD}else(h=f.nodeName)&&h.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(E=gD);if(E&&(E=E(t,u))){rR(d,E,r,c);break e}S&&S(t,f,u),t==="focusout"&&(S=f._wrapperState)&&S.controlled&&f.type==="number"&&zy(f,"number",f.value)}switch(S=u?Ai(u):window,t){case"focusin":(cb(S)||S.contentEditable==="true")&&(Ri=S,e0=u,lo=null);break;case"focusout":lo=e0=Ri=null;break;case"mousedown":t0=!0;break;case"contextmenu":case"mouseup":case"dragend":t0=!1,pb(d,r,c);break;case"selectionchange":if(bD)break;case"keydown":case"keyup":pb(d,r,c)}var C;if(gx)e:{switch(t){case"compositionstart":var k="onCompositionStart";break e;case"compositionend":k="onCompositionEnd";break e;case"compositionupdate":k="onCompositionUpdate";break e}k=void 0}else Ni?eR(t,r)&&(k="onCompositionEnd"):t==="keydown"&&r.keyCode===229&&(k="onCompositionStart");k&&(JN&&r.locale!=="ko"&&(Ni||k!=="onCompositionStart"?k==="onCompositionEnd"&&Ni&&(C=QN()):(ea=c,vx="value"in ea?ea.value:ea.textContent,Ni=!0)),S=Pu(u,k),0<S.length&&(k=new sb(k,t,null,r,c),d.push({event:k,listeners:S}),C?k.data=C:(C=tR(r),C!==null&&(k.data=C)))),(C=lD?uD(t,r):cD(t,r))&&(u=Pu(u,"onBeforeInput"),0<u.length&&(c=new sb("onBeforeInput","beforeinput",null,r,c),d.push({event:c,listeners:u}),c.data=C))}vR(d,e)})}function To(t,e,r){return{instance:t,listener:e,currentTarget:r}}function Pu(t,e){for(var r=e+"Capture",n=[];t!==null;){var a=t,i=a.stateNode;a.tag===5&&i!==null&&(a=i,i=xo(t,r),i!=null&&n.unshift(To(t,i,a)),i=xo(t,e),i!=null&&n.push(To(t,i,a))),t=t.return}return n}function gi(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5);return t||null}function yb(t,e,r,n,a){for(var i=e._reactName,s=[];r!==null&&r!==n;){var o=r,l=o.alternate,u=o.stateNode;if(l!==null&&l===n)break;o.tag===5&&u!==null&&(o=u,a?(l=xo(r,i),l!=null&&s.unshift(To(r,l,o))):a||(l=xo(r,i),l!=null&&s.push(To(r,l,o)))),r=r.return}s.length!==0&&t.push({event:e,listeners:s})}var CD=/\r\n?/g,kD=/\u0000|\uFFFD/g;function xb(t){return(typeof t=="string"?t:""+t).replace(CD,`
|
|
38
|
+
`).replace(kD,"")}function Tl(t,e,r){if(e=xb(e),xb(t)!==e&&r)throw Error(se(425))}function Au(){}var r0=null,n0=null;function a0(t,e){return t==="textarea"||t==="noscript"||typeof e.children=="string"||typeof e.children=="number"||typeof e.dangerouslySetInnerHTML=="object"&&e.dangerouslySetInnerHTML!==null&&e.dangerouslySetInnerHTML.__html!=null}var i0=typeof setTimeout=="function"?setTimeout:void 0,TD=typeof clearTimeout=="function"?clearTimeout:void 0,bb=typeof Promise=="function"?Promise:void 0,_D=typeof queueMicrotask=="function"?queueMicrotask:typeof bb<"u"?function(t){return bb.resolve(null).then(t).catch(ND)}:i0;function ND(t){setTimeout(function(){throw t})}function Td(t,e){var r=e,n=0;do{var a=r.nextSibling;if(t.removeChild(r),a&&a.nodeType===8)if(r=a.data,r==="/$"){if(n===0){t.removeChild(a),So(e);return}n--}else r!=="$"&&r!=="$?"&&r!=="$!"||n++;r=a}while(r);So(e)}function ua(t){for(;t!=null;t=t.nextSibling){var e=t.nodeType;if(e===1||e===3)break;if(e===8){if(e=t.data,e==="$"||e==="$!"||e==="$?")break;if(e==="/$")return null}}return t}function wb(t){t=t.previousSibling;for(var e=0;t;){if(t.nodeType===8){var r=t.data;if(r==="$"||r==="$!"||r==="$?"){if(e===0)return t;e--}else r==="/$"&&e++}t=t.previousSibling}return null}var ds=Math.random().toString(36).slice(2),fn="__reactFiber$"+ds,_o="__reactProps$"+ds,In="__reactContainer$"+ds,s0="__reactEvents$"+ds,RD="__reactListeners$"+ds,PD="__reactHandles$"+ds;function Va(t){var e=t[fn];if(e)return e;for(var r=t.parentNode;r;){if(e=r[In]||r[fn]){if(r=e.alternate,e.child!==null||r!==null&&r.child!==null)for(t=wb(t);t!==null;){if(r=t[fn])return r;t=wb(t)}return e}t=r,r=t.parentNode}return null}function Wo(t){return t=t[fn]||t[In],!t||t.tag!==5&&t.tag!==6&&t.tag!==13&&t.tag!==3?null:t}function Ai(t){if(t.tag===5||t.tag===6)return t.stateNode;throw Error(se(33))}function pc(t){return t[_o]||null}var o0=[],ji=-1;function Ta(t){return{current:t}}function ot(t){0>ji||(t.current=o0[ji],o0[ji]=null,ji--)}function rt(t,e){ji++,o0[ji]=t.current,t.current=e}var ma={},er=Ta(ma),br=Ta(!1),Ya=ma;function Ji(t,e){var r=t.type.contextTypes;if(!r)return ma;var n=t.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===e)return n.__reactInternalMemoizedMaskedChildContext;var a={},i;for(i in r)a[i]=e[i];return n&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=a),a}function wr(t){return t=t.childContextTypes,t!=null}function ju(){ot(br),ot(er)}function Sb(t,e,r){if(er.current!==ma)throw Error(se(168));rt(er,e),rt(br,r)}function pR(t,e,r){var n=t.stateNode;if(e=e.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var a in n)if(!(a in e))throw Error(se(108,hM(t)||"Unknown",a));return mt({},r,n)}function Iu(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||ma,Ya=er.current,rt(er,t),rt(br,br.current),!0}function Eb(t,e,r){var n=t.stateNode;if(!n)throw Error(se(169));r?(t=pR(t,e,Ya),n.__reactInternalMemoizedMergedChildContext=t,ot(br),ot(er),rt(er,t)):ot(br),rt(br,r)}var Tn=null,gc=!1,_d=!1;function gR(t){Tn===null?Tn=[t]:Tn.push(t)}function AD(t){gc=!0,gR(t)}function _a(){if(!_d&&Tn!==null){_d=!0;var t=0,e=Xe;try{var r=Tn;for(Xe=1;t<r.length;t++){var n=r[t];do n=n(!0);while(n!==null)}Tn=null,gc=!1}catch(a){throw Tn!==null&&(Tn=Tn.slice(t+1)),$N(ux,_a),a}finally{Xe=e,_d=!1}}return null}var Ii=[],Mi=0,Mu=null,Du=0,Ir=[],Mr=0,Xa=null,Nn=1,Rn="";function Ba(t,e){Ii[Mi++]=Du,Ii[Mi++]=Mu,Mu=t,Du=e}function mR(t,e,r){Ir[Mr++]=Nn,Ir[Mr++]=Rn,Ir[Mr++]=Xa,Xa=t;var n=Nn;t=Rn;var a=32-Qr(n)-1;n&=~(1<<a),r+=1;var i=32-Qr(e)+a;if(30<i){var s=a-a%5;i=(n&(1<<s)-1).toString(32),n>>=s,a-=s,Nn=1<<32-Qr(e)+a|r<<a|n,Rn=i+t}else Nn=1<<i|r<<a|n,Rn=t}function yx(t){t.return!==null&&(Ba(t,1),mR(t,1,0))}function xx(t){for(;t===Mu;)Mu=Ii[--Mi],Ii[Mi]=null,Du=Ii[--Mi],Ii[Mi]=null;for(;t===Xa;)Xa=Ir[--Mr],Ir[Mr]=null,Rn=Ir[--Mr],Ir[Mr]=null,Nn=Ir[--Mr],Ir[Mr]=null}var Tr=null,kr=null,ut=!1,Zr=null;function yR(t,e){var r=Lr(5,null,null,0);r.elementType="DELETED",r.stateNode=e,r.return=t,e=t.deletions,e===null?(t.deletions=[r],t.flags|=16):e.push(r)}function Cb(t,e){switch(t.tag){case 5:var r=t.type;return e=e.nodeType!==1||r.toLowerCase()!==e.nodeName.toLowerCase()?null:e,e!==null?(t.stateNode=e,Tr=t,kr=ua(e.firstChild),!0):!1;case 6:return e=t.pendingProps===""||e.nodeType!==3?null:e,e!==null?(t.stateNode=e,Tr=t,kr=null,!0):!1;case 13:return e=e.nodeType!==8?null:e,e!==null?(r=Xa!==null?{id:Nn,overflow:Rn}:null,t.memoizedState={dehydrated:e,treeContext:r,retryLane:1073741824},r=Lr(18,null,null,0),r.stateNode=e,r.return=t,t.child=r,Tr=t,kr=null,!0):!1;default:return!1}}function l0(t){return(t.mode&1)!==0&&(t.flags&128)===0}function u0(t){if(ut){var e=kr;if(e){var r=e;if(!Cb(t,e)){if(l0(t))throw Error(se(418));e=ua(r.nextSibling);var n=Tr;e&&Cb(t,e)?yR(n,r):(t.flags=t.flags&-4097|2,ut=!1,Tr=t)}}else{if(l0(t))throw Error(se(418));t.flags=t.flags&-4097|2,ut=!1,Tr=t}}}function kb(t){for(t=t.return;t!==null&&t.tag!==5&&t.tag!==3&&t.tag!==13;)t=t.return;Tr=t}function _l(t){if(t!==Tr)return!1;if(!ut)return kb(t),ut=!0,!1;var e;if((e=t.tag!==3)&&!(e=t.tag!==5)&&(e=t.type,e=e!=="head"&&e!=="body"&&!a0(t.type,t.memoizedProps)),e&&(e=kr)){if(l0(t))throw xR(),Error(se(418));for(;e;)yR(t,e),e=ua(e.nextSibling)}if(kb(t),t.tag===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(se(317));e:{for(t=t.nextSibling,e=0;t;){if(t.nodeType===8){var r=t.data;if(r==="/$"){if(e===0){kr=ua(t.nextSibling);break e}e--}else r!=="$"&&r!=="$!"&&r!=="$?"||e++}t=t.nextSibling}kr=null}}else kr=Tr?ua(t.stateNode.nextSibling):null;return!0}function xR(){for(var t=kr;t;)t=ua(t.nextSibling)}function es(){kr=Tr=null,ut=!1}function bx(t){Zr===null?Zr=[t]:Zr.push(t)}var jD=On.ReactCurrentBatchConfig;function js(t,e,r){if(t=r.ref,t!==null&&typeof t!="function"&&typeof t!="object"){if(r._owner){if(r=r._owner,r){if(r.tag!==1)throw Error(se(309));var n=r.stateNode}if(!n)throw Error(se(147,t));var a=n,i=""+t;return e!==null&&e.ref!==null&&typeof e.ref=="function"&&e.ref._stringRef===i?e.ref:(e=function(s){var o=a.refs;s===null?delete o[i]:o[i]=s},e._stringRef=i,e)}if(typeof t!="string")throw Error(se(284));if(!r._owner)throw Error(se(290,t))}return t}function Nl(t,e){throw t=Object.prototype.toString.call(e),Error(se(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t))}function Tb(t){var e=t._init;return e(t._payload)}function bR(t){function e(m,p){if(t){var y=m.deletions;y===null?(m.deletions=[p],m.flags|=16):y.push(p)}}function r(m,p){if(!t)return null;for(;p!==null;)e(m,p),p=p.sibling;return null}function n(m,p){for(m=new Map;p!==null;)p.key!==null?m.set(p.key,p):m.set(p.index,p),p=p.sibling;return m}function a(m,p){return m=va(m,p),m.index=0,m.sibling=null,m}function i(m,p,y){return m.index=y,t?(y=m.alternate,y!==null?(y=y.index,y<p?(m.flags|=2,p):y):(m.flags|=2,p)):(m.flags|=1048576,p)}function s(m){return t&&m.alternate===null&&(m.flags|=2),m}function o(m,p,y,w){return p===null||p.tag!==6?(p=Md(y,m.mode,w),p.return=m,p):(p=a(p,y),p.return=m,p)}function l(m,p,y,w){var E=y.type;return E===_i?c(m,p,y.props.children,w,y.key):p!==null&&(p.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===Yn&&Tb(E)===p.type)?(w=a(p,y.props),w.ref=js(m,p,y),w.return=m,w):(w=uu(y.type,y.key,y.props,null,m.mode,w),w.ref=js(m,p,y),w.return=m,w)}function u(m,p,y,w){return p===null||p.tag!==4||p.stateNode.containerInfo!==y.containerInfo||p.stateNode.implementation!==y.implementation?(p=Dd(y,m.mode,w),p.return=m,p):(p=a(p,y.children||[]),p.return=m,p)}function c(m,p,y,w,E){return p===null||p.tag!==7?(p=Ka(y,m.mode,w,E),p.return=m,p):(p=a(p,y),p.return=m,p)}function d(m,p,y){if(typeof p=="string"&&p!==""||typeof p=="number")return p=Md(""+p,m.mode,y),p.return=m,p;if(typeof p=="object"&&p!==null){switch(p.$$typeof){case ml:return y=uu(p.type,p.key,p.props,null,m.mode,y),y.ref=js(m,null,p),y.return=m,y;case Ti:return p=Dd(p,m.mode,y),p.return=m,p;case Yn:var w=p._init;return d(m,w(p._payload),y)}if(Ks(p)||_s(p))return p=Ka(p,m.mode,y,null),p.return=m,p;Nl(m,p)}return null}function f(m,p,y,w){var E=p!==null?p.key:null;if(typeof y=="string"&&y!==""||typeof y=="number")return E!==null?null:o(m,p,""+y,w);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case ml:return y.key===E?l(m,p,y,w):null;case Ti:return y.key===E?u(m,p,y,w):null;case Yn:return E=y._init,f(m,p,E(y._payload),w)}if(Ks(y)||_s(y))return E!==null?null:c(m,p,y,w,null);Nl(m,y)}return null}function h(m,p,y,w,E){if(typeof w=="string"&&w!==""||typeof w=="number")return m=m.get(y)||null,o(p,m,""+w,E);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case ml:return m=m.get(w.key===null?y:w.key)||null,l(p,m,w,E);case Ti:return m=m.get(w.key===null?y:w.key)||null,u(p,m,w,E);case Yn:var S=w._init;return h(m,p,y,S(w._payload),E)}if(Ks(w)||_s(w))return m=m.get(y)||null,c(p,m,w,E,null);Nl(p,w)}return null}function v(m,p,y,w){for(var E=null,S=null,C=p,k=p=0,T=null;C!==null&&k<y.length;k++){C.index>k?(T=C,C=null):T=C.sibling;var _=f(m,C,y[k],w);if(_===null){C===null&&(C=T);break}t&&C&&_.alternate===null&&e(m,C),p=i(_,p,k),S===null?E=_:S.sibling=_,S=_,C=T}if(k===y.length)return r(m,C),ut&&Ba(m,k),E;if(C===null){for(;k<y.length;k++)C=d(m,y[k],w),C!==null&&(p=i(C,p,k),S===null?E=C:S.sibling=C,S=C);return ut&&Ba(m,k),E}for(C=n(m,C);k<y.length;k++)T=h(C,m,k,y[k],w),T!==null&&(t&&T.alternate!==null&&C.delete(T.key===null?k:T.key),p=i(T,p,k),S===null?E=T:S.sibling=T,S=T);return t&&C.forEach(function(N){return e(m,N)}),ut&&Ba(m,k),E}function x(m,p,y,w){var E=_s(y);if(typeof E!="function")throw Error(se(150));if(y=E.call(y),y==null)throw Error(se(151));for(var S=E=null,C=p,k=p=0,T=null,_=y.next();C!==null&&!_.done;k++,_=y.next()){C.index>k?(T=C,C=null):T=C.sibling;var N=f(m,C,_.value,w);if(N===null){C===null&&(C=T);break}t&&C&&N.alternate===null&&e(m,C),p=i(N,p,k),S===null?E=N:S.sibling=N,S=N,C=T}if(_.done)return r(m,C),ut&&Ba(m,k),E;if(C===null){for(;!_.done;k++,_=y.next())_=d(m,_.value,w),_!==null&&(p=i(_,p,k),S===null?E=_:S.sibling=_,S=_);return ut&&Ba(m,k),E}for(C=n(m,C);!_.done;k++,_=y.next())_=h(C,m,k,_.value,w),_!==null&&(t&&_.alternate!==null&&C.delete(_.key===null?k:_.key),p=i(_,p,k),S===null?E=_:S.sibling=_,S=_);return t&&C.forEach(function(P){return e(m,P)}),ut&&Ba(m,k),E}function b(m,p,y,w){if(typeof y=="object"&&y!==null&&y.type===_i&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case ml:e:{for(var E=y.key,S=p;S!==null;){if(S.key===E){if(E=y.type,E===_i){if(S.tag===7){r(m,S.sibling),p=a(S,y.props.children),p.return=m,m=p;break e}}else if(S.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===Yn&&Tb(E)===S.type){r(m,S.sibling),p=a(S,y.props),p.ref=js(m,S,y),p.return=m,m=p;break e}r(m,S);break}else e(m,S);S=S.sibling}y.type===_i?(p=Ka(y.props.children,m.mode,w,y.key),p.return=m,m=p):(w=uu(y.type,y.key,y.props,null,m.mode,w),w.ref=js(m,p,y),w.return=m,m=w)}return s(m);case Ti:e:{for(S=y.key;p!==null;){if(p.key===S)if(p.tag===4&&p.stateNode.containerInfo===y.containerInfo&&p.stateNode.implementation===y.implementation){r(m,p.sibling),p=a(p,y.children||[]),p.return=m,m=p;break e}else{r(m,p);break}else e(m,p);p=p.sibling}p=Dd(y,m.mode,w),p.return=m,m=p}return s(m);case Yn:return S=y._init,b(m,p,S(y._payload),w)}if(Ks(y))return v(m,p,y,w);if(_s(y))return x(m,p,y,w);Nl(m,y)}return typeof y=="string"&&y!==""||typeof y=="number"?(y=""+y,p!==null&&p.tag===6?(r(m,p.sibling),p=a(p,y),p.return=m,m=p):(r(m,p),p=Md(y,m.mode,w),p.return=m,m=p),s(m)):r(m,p)}return b}var ts=bR(!0),wR=bR(!1),Lu=Ta(null),Bu=null,Di=null,wx=null;function Sx(){wx=Di=Bu=null}function Ex(t){var e=Lu.current;ot(Lu),t._currentValue=e}function c0(t,e,r){for(;t!==null;){var n=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,n!==null&&(n.childLanes|=e)):n!==null&&(n.childLanes&e)!==e&&(n.childLanes|=e),t===r)break;t=t.return}}function Gi(t,e){Bu=t,wx=Di=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(mr=!0),t.firstContext=null)}function qr(t){var e=t._currentValue;if(wx!==t)if(t={context:t,memoizedValue:e,next:null},Di===null){if(Bu===null)throw Error(se(308));Di=t,Bu.dependencies={lanes:0,firstContext:t}}else Di=Di.next=t;return e}var Ua=null;function Cx(t){Ua===null?Ua=[t]:Ua.push(t)}function SR(t,e,r,n){var a=e.interleaved;return a===null?(r.next=r,Cx(e)):(r.next=a.next,a.next=r),e.interleaved=r,Mn(t,n)}function Mn(t,e){t.lanes|=e;var r=t.alternate;for(r!==null&&(r.lanes|=e),r=t,t=t.return;t!==null;)t.childLanes|=e,r=t.alternate,r!==null&&(r.childLanes|=e),r=t,t=t.return;return r.tag===3?r.stateNode:null}var Xn=!1;function kx(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function ER(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function An(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function ca(t,e,r){var n=t.updateQueue;if(n===null)return null;if(n=n.shared,Ve&2){var a=n.pending;return a===null?e.next=e:(e.next=a.next,a.next=e),n.pending=e,Mn(t,r)}return a=n.interleaved,a===null?(e.next=e,Cx(n)):(e.next=a.next,a.next=e),n.interleaved=e,Mn(t,r)}function nu(t,e,r){if(e=e.updateQueue,e!==null&&(e=e.shared,(r&4194240)!==0)){var n=e.lanes;n&=t.pendingLanes,r|=n,e.lanes=r,cx(t,r)}}function _b(t,e){var r=t.updateQueue,n=t.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var a=null,i=null;if(r=r.firstBaseUpdate,r!==null){do{var s={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};i===null?a=i=s:i=i.next=s,r=r.next}while(r!==null);i===null?a=i=e:i=i.next=e}else a=i=e;r={baseState:n.baseState,firstBaseUpdate:a,lastBaseUpdate:i,shared:n.shared,effects:n.effects},t.updateQueue=r;return}t=r.lastBaseUpdate,t===null?r.firstBaseUpdate=e:t.next=e,r.lastBaseUpdate=e}function Ou(t,e,r,n){var a=t.updateQueue;Xn=!1;var i=a.firstBaseUpdate,s=a.lastBaseUpdate,o=a.shared.pending;if(o!==null){a.shared.pending=null;var l=o,u=l.next;l.next=null,s===null?i=u:s.next=u,s=l;var c=t.alternate;c!==null&&(c=c.updateQueue,o=c.lastBaseUpdate,o!==s&&(o===null?c.firstBaseUpdate=u:o.next=u,c.lastBaseUpdate=l))}if(i!==null){var d=a.baseState;s=0,c=u=l=null,o=i;do{var f=o.lane,h=o.eventTime;if((n&f)===f){c!==null&&(c=c.next={eventTime:h,lane:0,tag:o.tag,payload:o.payload,callback:o.callback,next:null});e:{var v=t,x=o;switch(f=e,h=r,x.tag){case 1:if(v=x.payload,typeof v=="function"){d=v.call(h,d,f);break e}d=v;break e;case 3:v.flags=v.flags&-65537|128;case 0:if(v=x.payload,f=typeof v=="function"?v.call(h,d,f):v,f==null)break e;d=mt({},d,f);break e;case 2:Xn=!0}}o.callback!==null&&o.lane!==0&&(t.flags|=64,f=a.effects,f===null?a.effects=[o]:f.push(o))}else h={eventTime:h,lane:f,tag:o.tag,payload:o.payload,callback:o.callback,next:null},c===null?(u=c=h,l=d):c=c.next=h,s|=f;if(o=o.next,o===null){if(o=a.shared.pending,o===null)break;f=o,o=f.next,f.next=null,a.lastBaseUpdate=f,a.shared.pending=null}}while(!0);if(c===null&&(l=d),a.baseState=l,a.firstBaseUpdate=u,a.lastBaseUpdate=c,e=a.shared.interleaved,e!==null){a=e;do s|=a.lane,a=a.next;while(a!==e)}else i===null&&(a.shared.lanes=0);Qa|=s,t.lanes=s,t.memoizedState=d}}function Nb(t,e,r){if(t=e.effects,e.effects=null,t!==null)for(e=0;e<t.length;e++){var n=t[e],a=n.callback;if(a!==null){if(n.callback=null,n=r,typeof a!="function")throw Error(se(191,a));a.call(n)}}}var Ko={},gn=Ta(Ko),No=Ta(Ko),Ro=Ta(Ko);function Ga(t){if(t===Ko)throw Error(se(174));return t}function Tx(t,e){switch(rt(Ro,e),rt(No,t),rt(gn,Ko),t=e.nodeType,t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:Uy(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=Uy(e,t)}ot(gn),rt(gn,e)}function rs(){ot(gn),ot(No),ot(Ro)}function CR(t){Ga(Ro.current);var e=Ga(gn.current),r=Uy(e,t.type);e!==r&&(rt(No,t),rt(gn,r))}function _x(t){No.current===t&&(ot(gn),ot(No))}var ht=Ta(0);function qu(t){for(var e=t;e!==null;){if(e.tag===13){var r=e.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if(e.flags&128)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var Nd=[];function Nx(){for(var t=0;t<Nd.length;t++)Nd[t]._workInProgressVersionPrimary=null;Nd.length=0}var au=On.ReactCurrentDispatcher,Rd=On.ReactCurrentBatchConfig,Za=0,pt=null,Pt=null,Ot=null,Fu=!1,uo=!1,Po=0,ID=0;function Zt(){throw Error(se(321))}function Rx(t,e){if(e===null)return!1;for(var r=0;r<e.length&&r<t.length;r++)if(!tn(t[r],e[r]))return!1;return!0}function Px(t,e,r,n,a,i){if(Za=i,pt=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,au.current=t===null||t.memoizedState===null?BD:OD,t=r(n,a),uo){i=0;do{if(uo=!1,Po=0,25<=i)throw Error(se(301));i+=1,Ot=Pt=null,e.updateQueue=null,au.current=qD,t=r(n,a)}while(uo)}if(au.current=$u,e=Pt!==null&&Pt.next!==null,Za=0,Ot=Pt=pt=null,Fu=!1,e)throw Error(se(300));return t}function Ax(){var t=Po!==0;return Po=0,t}function dn(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ot===null?pt.memoizedState=Ot=t:Ot=Ot.next=t,Ot}function Fr(){if(Pt===null){var t=pt.alternate;t=t!==null?t.memoizedState:null}else t=Pt.next;var e=Ot===null?pt.memoizedState:Ot.next;if(e!==null)Ot=e,Pt=t;else{if(t===null)throw Error(se(310));Pt=t,t={memoizedState:Pt.memoizedState,baseState:Pt.baseState,baseQueue:Pt.baseQueue,queue:Pt.queue,next:null},Ot===null?pt.memoizedState=Ot=t:Ot=Ot.next=t}return Ot}function Ao(t,e){return typeof e=="function"?e(t):e}function Pd(t){var e=Fr(),r=e.queue;if(r===null)throw Error(se(311));r.lastRenderedReducer=t;var n=Pt,a=n.baseQueue,i=r.pending;if(i!==null){if(a!==null){var s=a.next;a.next=i.next,i.next=s}n.baseQueue=a=i,r.pending=null}if(a!==null){i=a.next,n=n.baseState;var o=s=null,l=null,u=i;do{var c=u.lane;if((Za&c)===c)l!==null&&(l=l.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),n=u.hasEagerState?u.eagerState:t(n,u.action);else{var d={lane:c,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};l===null?(o=l=d,s=n):l=l.next=d,pt.lanes|=c,Qa|=c}u=u.next}while(u!==null&&u!==i);l===null?s=n:l.next=o,tn(n,e.memoizedState)||(mr=!0),e.memoizedState=n,e.baseState=s,e.baseQueue=l,r.lastRenderedState=n}if(t=r.interleaved,t!==null){a=t;do i=a.lane,pt.lanes|=i,Qa|=i,a=a.next;while(a!==t)}else a===null&&(r.lanes=0);return[e.memoizedState,r.dispatch]}function Ad(t){var e=Fr(),r=e.queue;if(r===null)throw Error(se(311));r.lastRenderedReducer=t;var n=r.dispatch,a=r.pending,i=e.memoizedState;if(a!==null){r.pending=null;var s=a=a.next;do i=t(i,s.action),s=s.next;while(s!==a);tn(i,e.memoizedState)||(mr=!0),e.memoizedState=i,e.baseQueue===null&&(e.baseState=i),r.lastRenderedState=i}return[i,n]}function kR(){}function TR(t,e){var r=pt,n=Fr(),a=e(),i=!tn(n.memoizedState,a);if(i&&(n.memoizedState=a,mr=!0),n=n.queue,jx(RR.bind(null,r,n,t),[t]),n.getSnapshot!==e||i||Ot!==null&&Ot.memoizedState.tag&1){if(r.flags|=2048,jo(9,NR.bind(null,r,n,a,e),void 0,null),qt===null)throw Error(se(349));Za&30||_R(r,e,a)}return a}function _R(t,e,r){t.flags|=16384,t={getSnapshot:e,value:r},e=pt.updateQueue,e===null?(e={lastEffect:null,stores:null},pt.updateQueue=e,e.stores=[t]):(r=e.stores,r===null?e.stores=[t]:r.push(t))}function NR(t,e,r,n){e.value=r,e.getSnapshot=n,PR(e)&&AR(t)}function RR(t,e,r){return r(function(){PR(e)&&AR(t)})}function PR(t){var e=t.getSnapshot;t=t.value;try{var r=e();return!tn(t,r)}catch{return!0}}function AR(t){var e=Mn(t,1);e!==null&&Jr(e,t,1,-1)}function Rb(t){var e=dn();return typeof t=="function"&&(t=t()),e.memoizedState=e.baseState=t,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Ao,lastRenderedState:t},e.queue=t,t=t.dispatch=LD.bind(null,pt,t),[e.memoizedState,t]}function jo(t,e,r,n){return t={tag:t,create:e,destroy:r,deps:n,next:null},e=pt.updateQueue,e===null?(e={lastEffect:null,stores:null},pt.updateQueue=e,e.lastEffect=t.next=t):(r=e.lastEffect,r===null?e.lastEffect=t.next=t:(n=r.next,r.next=t,t.next=n,e.lastEffect=t)),t}function jR(){return Fr().memoizedState}function iu(t,e,r,n){var a=dn();pt.flags|=t,a.memoizedState=jo(1|e,r,void 0,n===void 0?null:n)}function mc(t,e,r,n){var a=Fr();n=n===void 0?null:n;var i=void 0;if(Pt!==null){var s=Pt.memoizedState;if(i=s.destroy,n!==null&&Rx(n,s.deps)){a.memoizedState=jo(e,r,i,n);return}}pt.flags|=t,a.memoizedState=jo(1|e,r,i,n)}function Pb(t,e){return iu(8390656,8,t,e)}function jx(t,e){return mc(2048,8,t,e)}function IR(t,e){return mc(4,2,t,e)}function MR(t,e){return mc(4,4,t,e)}function DR(t,e){if(typeof e=="function")return t=t(),e(t),function(){e(null)};if(e!=null)return t=t(),e.current=t,function(){e.current=null}}function LR(t,e,r){return r=r!=null?r.concat([t]):null,mc(4,4,DR.bind(null,e,t),r)}function Ix(){}function BR(t,e){var r=Fr();e=e===void 0?null:e;var n=r.memoizedState;return n!==null&&e!==null&&Rx(e,n[1])?n[0]:(r.memoizedState=[t,e],t)}function OR(t,e){var r=Fr();e=e===void 0?null:e;var n=r.memoizedState;return n!==null&&e!==null&&Rx(e,n[1])?n[0]:(t=t(),r.memoizedState=[t,e],t)}function qR(t,e,r){return Za&21?(tn(r,e)||(r=UN(),pt.lanes|=r,Qa|=r,t.baseState=!0),e):(t.baseState&&(t.baseState=!1,mr=!0),t.memoizedState=r)}function MD(t,e){var r=Xe;Xe=r!==0&&4>r?r:4,t(!0);var n=Rd.transition;Rd.transition={};try{t(!1),e()}finally{Xe=r,Rd.transition=n}}function FR(){return Fr().memoizedState}function DD(t,e,r){var n=fa(t);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},$R(t))zR(e,r);else if(r=SR(t,e,r,n),r!==null){var a=or();Jr(r,t,n,a),VR(r,e,n)}}function LD(t,e,r){var n=fa(t),a={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if($R(t))zR(e,a);else{var i=t.alternate;if(t.lanes===0&&(i===null||i.lanes===0)&&(i=e.lastRenderedReducer,i!==null))try{var s=e.lastRenderedState,o=i(s,r);if(a.hasEagerState=!0,a.eagerState=o,tn(o,s)){var l=e.interleaved;l===null?(a.next=a,Cx(e)):(a.next=l.next,l.next=a),e.interleaved=a;return}}catch{}finally{}r=SR(t,e,a,n),r!==null&&(a=or(),Jr(r,t,n,a),VR(r,e,n))}}function $R(t){var e=t.alternate;return t===pt||e!==null&&e===pt}function zR(t,e){uo=Fu=!0;var r=t.pending;r===null?e.next=e:(e.next=r.next,r.next=e),t.pending=e}function VR(t,e,r){if(r&4194240){var n=e.lanes;n&=t.pendingLanes,r|=n,e.lanes=r,cx(t,r)}}var $u={readContext:qr,useCallback:Zt,useContext:Zt,useEffect:Zt,useImperativeHandle:Zt,useInsertionEffect:Zt,useLayoutEffect:Zt,useMemo:Zt,useReducer:Zt,useRef:Zt,useState:Zt,useDebugValue:Zt,useDeferredValue:Zt,useTransition:Zt,useMutableSource:Zt,useSyncExternalStore:Zt,useId:Zt,unstable_isNewReconciler:!1},BD={readContext:qr,useCallback:function(t,e){return dn().memoizedState=[t,e===void 0?null:e],t},useContext:qr,useEffect:Pb,useImperativeHandle:function(t,e,r){return r=r!=null?r.concat([t]):null,iu(4194308,4,DR.bind(null,e,t),r)},useLayoutEffect:function(t,e){return iu(4194308,4,t,e)},useInsertionEffect:function(t,e){return iu(4,2,t,e)},useMemo:function(t,e){var r=dn();return e=e===void 0?null:e,t=t(),r.memoizedState=[t,e],t},useReducer:function(t,e,r){var n=dn();return e=r!==void 0?r(e):e,n.memoizedState=n.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},n.queue=t,t=t.dispatch=DD.bind(null,pt,t),[n.memoizedState,t]},useRef:function(t){var e=dn();return t={current:t},e.memoizedState=t},useState:Rb,useDebugValue:Ix,useDeferredValue:function(t){return dn().memoizedState=t},useTransition:function(){var t=Rb(!1),e=t[0];return t=MD.bind(null,t[1]),dn().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,r){var n=pt,a=dn();if(ut){if(r===void 0)throw Error(se(407));r=r()}else{if(r=e(),qt===null)throw Error(se(349));Za&30||_R(n,e,r)}a.memoizedState=r;var i={value:r,getSnapshot:e};return a.queue=i,Pb(RR.bind(null,n,i,t),[t]),n.flags|=2048,jo(9,NR.bind(null,n,i,r,e),void 0,null),r},useId:function(){var t=dn(),e=qt.identifierPrefix;if(ut){var r=Rn,n=Nn;r=(n&~(1<<32-Qr(n)-1)).toString(32)+r,e=":"+e+"R"+r,r=Po++,0<r&&(e+="H"+r.toString(32)),e+=":"}else r=ID++,e=":"+e+"r"+r.toString(32)+":";return t.memoizedState=e},unstable_isNewReconciler:!1},OD={readContext:qr,useCallback:BR,useContext:qr,useEffect:jx,useImperativeHandle:LR,useInsertionEffect:IR,useLayoutEffect:MR,useMemo:OR,useReducer:Pd,useRef:jR,useState:function(){return Pd(Ao)},useDebugValue:Ix,useDeferredValue:function(t){var e=Fr();return qR(e,Pt.memoizedState,t)},useTransition:function(){var t=Pd(Ao)[0],e=Fr().memoizedState;return[t,e]},useMutableSource:kR,useSyncExternalStore:TR,useId:FR,unstable_isNewReconciler:!1},qD={readContext:qr,useCallback:BR,useContext:qr,useEffect:jx,useImperativeHandle:LR,useInsertionEffect:IR,useLayoutEffect:MR,useMemo:OR,useReducer:Ad,useRef:jR,useState:function(){return Ad(Ao)},useDebugValue:Ix,useDeferredValue:function(t){var e=Fr();return Pt===null?e.memoizedState=t:qR(e,Pt.memoizedState,t)},useTransition:function(){var t=Ad(Ao)[0],e=Fr().memoizedState;return[t,e]},useMutableSource:kR,useSyncExternalStore:TR,useId:FR,unstable_isNewReconciler:!1};function Kr(t,e){if(t&&t.defaultProps){e=mt({},e),t=t.defaultProps;for(var r in t)e[r]===void 0&&(e[r]=t[r]);return e}return e}function d0(t,e,r,n){e=t.memoizedState,r=r(n,e),r=r==null?e:mt({},e,r),t.memoizedState=r,t.lanes===0&&(t.updateQueue.baseState=r)}var yc={isMounted:function(t){return(t=t._reactInternals)?ui(t)===t:!1},enqueueSetState:function(t,e,r){t=t._reactInternals;var n=or(),a=fa(t),i=An(n,a);i.payload=e,r!=null&&(i.callback=r),e=ca(t,i,a),e!==null&&(Jr(e,t,a,n),nu(e,t,a))},enqueueReplaceState:function(t,e,r){t=t._reactInternals;var n=or(),a=fa(t),i=An(n,a);i.tag=1,i.payload=e,r!=null&&(i.callback=r),e=ca(t,i,a),e!==null&&(Jr(e,t,a,n),nu(e,t,a))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var r=or(),n=fa(t),a=An(r,n);a.tag=2,e!=null&&(a.callback=e),e=ca(t,a,n),e!==null&&(Jr(e,t,n,r),nu(e,t,n))}};function Ab(t,e,r,n,a,i,s){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(n,i,s):e.prototype&&e.prototype.isPureReactComponent?!Co(r,n)||!Co(a,i):!0}function UR(t,e,r){var n=!1,a=ma,i=e.contextType;return typeof i=="object"&&i!==null?i=qr(i):(a=wr(e)?Ya:er.current,n=e.contextTypes,i=(n=n!=null)?Ji(t,a):ma),e=new e(r,i),t.memoizedState=e.state!==null&&e.state!==void 0?e.state:null,e.updater=yc,t.stateNode=e,e._reactInternals=t,n&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=a,t.__reactInternalMemoizedMaskedChildContext=i),e}function jb(t,e,r,n){t=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(r,n),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(r,n),e.state!==t&&yc.enqueueReplaceState(e,e.state,null)}function f0(t,e,r,n){var a=t.stateNode;a.props=r,a.state=t.memoizedState,a.refs={},kx(t);var i=e.contextType;typeof i=="object"&&i!==null?a.context=qr(i):(i=wr(e)?Ya:er.current,a.context=Ji(t,i)),a.state=t.memoizedState,i=e.getDerivedStateFromProps,typeof i=="function"&&(d0(t,e,i,r),a.state=t.memoizedState),typeof e.getDerivedStateFromProps=="function"||typeof a.getSnapshotBeforeUpdate=="function"||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(e=a.state,typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount(),e!==a.state&&yc.enqueueReplaceState(a,a.state,null),Ou(t,r,a,n),a.state=t.memoizedState),typeof a.componentDidMount=="function"&&(t.flags|=4194308)}function ns(t,e){try{var r="",n=e;do r+=vM(n),n=n.return;while(n);var a=r}catch(i){a=`
|
|
39
|
+
Error generating stack: `+i.message+`
|
|
40
|
+
`+i.stack}return{value:t,source:e,stack:a,digest:null}}function jd(t,e,r){return{value:t,source:null,stack:r??null,digest:e??null}}function v0(t,e){try{console.error(e.value)}catch(r){setTimeout(function(){throw r})}}var FD=typeof WeakMap=="function"?WeakMap:Map;function GR(t,e,r){r=An(-1,r),r.tag=3,r.payload={element:null};var n=e.value;return r.callback=function(){Vu||(Vu=!0,E0=n),v0(t,e)},r}function HR(t,e,r){r=An(-1,r),r.tag=3;var n=t.type.getDerivedStateFromError;if(typeof n=="function"){var a=e.value;r.payload=function(){return n(a)},r.callback=function(){v0(t,e)}}var i=t.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(r.callback=function(){v0(t,e),typeof n!="function"&&(da===null?da=new Set([this]):da.add(this));var s=e.stack;this.componentDidCatch(e.value,{componentStack:s!==null?s:""})}),r}function Ib(t,e,r){var n=t.pingCache;if(n===null){n=t.pingCache=new FD;var a=new Set;n.set(e,a)}else a=n.get(e),a===void 0&&(a=new Set,n.set(e,a));a.has(r)||(a.add(r),t=eL.bind(null,t,e,r),e.then(t,t))}function Mb(t){do{var e;if((e=t.tag===13)&&(e=t.memoizedState,e=e!==null?e.dehydrated!==null:!0),e)return t;t=t.return}while(t!==null);return null}function Db(t,e,r,n,a){return t.mode&1?(t.flags|=65536,t.lanes=a,t):(t===e?t.flags|=65536:(t.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(e=An(-1,1),e.tag=2,ca(r,e,1))),r.lanes|=1),t)}var $D=On.ReactCurrentOwner,mr=!1;function ir(t,e,r,n){e.child=t===null?wR(e,null,r,n):ts(e,t.child,r,n)}function Lb(t,e,r,n,a){r=r.render;var i=e.ref;return Gi(e,a),n=Px(t,e,r,n,i,a),r=Ax(),t!==null&&!mr?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~a,Dn(t,e,a)):(ut&&r&&yx(e),e.flags|=1,ir(t,e,n,a),e.child)}function Bb(t,e,r,n,a){if(t===null){var i=r.type;return typeof i=="function"&&!$x(i)&&i.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(e.tag=15,e.type=i,WR(t,e,i,n,a)):(t=uu(r.type,null,n,e,e.mode,a),t.ref=e.ref,t.return=e,e.child=t)}if(i=t.child,!(t.lanes&a)){var s=i.memoizedProps;if(r=r.compare,r=r!==null?r:Co,r(s,n)&&t.ref===e.ref)return Dn(t,e,a)}return e.flags|=1,t=va(i,n),t.ref=e.ref,t.return=e,e.child=t}function WR(t,e,r,n,a){if(t!==null){var i=t.memoizedProps;if(Co(i,n)&&t.ref===e.ref)if(mr=!1,e.pendingProps=n=i,(t.lanes&a)!==0)t.flags&131072&&(mr=!0);else return e.lanes=t.lanes,Dn(t,e,a)}return h0(t,e,r,n,a)}function KR(t,e,r){var n=e.pendingProps,a=n.children,i=t!==null?t.memoizedState:null;if(n.mode==="hidden")if(!(e.mode&1))e.memoizedState={baseLanes:0,cachePool:null,transitions:null},rt(Bi,Cr),Cr|=r;else{if(!(r&1073741824))return t=i!==null?i.baseLanes|r:r,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:t,cachePool:null,transitions:null},e.updateQueue=null,rt(Bi,Cr),Cr|=t,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=i!==null?i.baseLanes:r,rt(Bi,Cr),Cr|=n}else i!==null?(n=i.baseLanes|r,e.memoizedState=null):n=r,rt(Bi,Cr),Cr|=n;return ir(t,e,a,r),e.child}function YR(t,e){var r=e.ref;(t===null&&r!==null||t!==null&&t.ref!==r)&&(e.flags|=512,e.flags|=2097152)}function h0(t,e,r,n,a){var i=wr(r)?Ya:er.current;return i=Ji(e,i),Gi(e,a),r=Px(t,e,r,n,i,a),n=Ax(),t!==null&&!mr?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~a,Dn(t,e,a)):(ut&&n&&yx(e),e.flags|=1,ir(t,e,r,a),e.child)}function Ob(t,e,r,n,a){if(wr(r)){var i=!0;Iu(e)}else i=!1;if(Gi(e,a),e.stateNode===null)su(t,e),UR(e,r,n),f0(e,r,n,a),n=!0;else if(t===null){var s=e.stateNode,o=e.memoizedProps;s.props=o;var l=s.context,u=r.contextType;typeof u=="object"&&u!==null?u=qr(u):(u=wr(r)?Ya:er.current,u=Ji(e,u));var c=r.getDerivedStateFromProps,d=typeof c=="function"||typeof s.getSnapshotBeforeUpdate=="function";d||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(o!==n||l!==u)&&jb(e,s,n,u),Xn=!1;var f=e.memoizedState;s.state=f,Ou(e,n,s,a),l=e.memoizedState,o!==n||f!==l||br.current||Xn?(typeof c=="function"&&(d0(e,r,c,n),l=e.memoizedState),(o=Xn||Ab(e,r,o,n,f,l,u))?(d||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(e.flags|=4194308)):(typeof s.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=n,e.memoizedState=l),s.props=n,s.state=l,s.context=u,n=o):(typeof s.componentDidMount=="function"&&(e.flags|=4194308),n=!1)}else{s=e.stateNode,ER(t,e),o=e.memoizedProps,u=e.type===e.elementType?o:Kr(e.type,o),s.props=u,d=e.pendingProps,f=s.context,l=r.contextType,typeof l=="object"&&l!==null?l=qr(l):(l=wr(r)?Ya:er.current,l=Ji(e,l));var h=r.getDerivedStateFromProps;(c=typeof h=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(o!==d||f!==l)&&jb(e,s,n,l),Xn=!1,f=e.memoizedState,s.state=f,Ou(e,n,s,a);var v=e.memoizedState;o!==d||f!==v||br.current||Xn?(typeof h=="function"&&(d0(e,r,h,n),v=e.memoizedState),(u=Xn||Ab(e,r,u,n,f,v,l)||!1)?(c||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(n,v,l),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(n,v,l)),typeof s.componentDidUpdate=="function"&&(e.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof s.componentDidUpdate!="function"||o===t.memoizedProps&&f===t.memoizedState||(e.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||o===t.memoizedProps&&f===t.memoizedState||(e.flags|=1024),e.memoizedProps=n,e.memoizedState=v),s.props=n,s.state=v,s.context=l,n=u):(typeof s.componentDidUpdate!="function"||o===t.memoizedProps&&f===t.memoizedState||(e.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||o===t.memoizedProps&&f===t.memoizedState||(e.flags|=1024),n=!1)}return p0(t,e,r,n,i,a)}function p0(t,e,r,n,a,i){YR(t,e);var s=(e.flags&128)!==0;if(!n&&!s)return a&&Eb(e,r,!1),Dn(t,e,i);n=e.stateNode,$D.current=e;var o=s&&typeof r.getDerivedStateFromError!="function"?null:n.render();return e.flags|=1,t!==null&&s?(e.child=ts(e,t.child,null,i),e.child=ts(e,null,o,i)):ir(t,e,o,i),e.memoizedState=n.state,a&&Eb(e,r,!0),e.child}function XR(t){var e=t.stateNode;e.pendingContext?Sb(t,e.pendingContext,e.pendingContext!==e.context):e.context&&Sb(t,e.context,!1),Tx(t,e.containerInfo)}function qb(t,e,r,n,a){return es(),bx(a),e.flags|=256,ir(t,e,r,n),e.child}var g0={dehydrated:null,treeContext:null,retryLane:0};function m0(t){return{baseLanes:t,cachePool:null,transitions:null}}function ZR(t,e,r){var n=e.pendingProps,a=ht.current,i=!1,s=(e.flags&128)!==0,o;if((o=s)||(o=t!==null&&t.memoizedState===null?!1:(a&2)!==0),o?(i=!0,e.flags&=-129):(t===null||t.memoizedState!==null)&&(a|=1),rt(ht,a&1),t===null)return u0(e),t=e.memoizedState,t!==null&&(t=t.dehydrated,t!==null)?(e.mode&1?t.data==="$!"?e.lanes=8:e.lanes=1073741824:e.lanes=1,null):(s=n.children,t=n.fallback,i?(n=e.mode,i=e.child,s={mode:"hidden",children:s},!(n&1)&&i!==null?(i.childLanes=0,i.pendingProps=s):i=wc(s,n,0,null),t=Ka(t,n,r,null),i.return=e,t.return=e,i.sibling=t,e.child=i,e.child.memoizedState=m0(r),e.memoizedState=g0,t):Mx(e,s));if(a=t.memoizedState,a!==null&&(o=a.dehydrated,o!==null))return zD(t,e,s,n,o,a,r);if(i){i=n.fallback,s=e.mode,a=t.child,o=a.sibling;var l={mode:"hidden",children:n.children};return!(s&1)&&e.child!==a?(n=e.child,n.childLanes=0,n.pendingProps=l,e.deletions=null):(n=va(a,l),n.subtreeFlags=a.subtreeFlags&14680064),o!==null?i=va(o,i):(i=Ka(i,s,r,null),i.flags|=2),i.return=e,n.return=e,n.sibling=i,e.child=n,n=i,i=e.child,s=t.child.memoizedState,s=s===null?m0(r):{baseLanes:s.baseLanes|r,cachePool:null,transitions:s.transitions},i.memoizedState=s,i.childLanes=t.childLanes&~r,e.memoizedState=g0,n}return i=t.child,t=i.sibling,n=va(i,{mode:"visible",children:n.children}),!(e.mode&1)&&(n.lanes=r),n.return=e,n.sibling=null,t!==null&&(r=e.deletions,r===null?(e.deletions=[t],e.flags|=16):r.push(t)),e.child=n,e.memoizedState=null,n}function Mx(t,e){return e=wc({mode:"visible",children:e},t.mode,0,null),e.return=t,t.child=e}function Rl(t,e,r,n){return n!==null&&bx(n),ts(e,t.child,null,r),t=Mx(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function zD(t,e,r,n,a,i,s){if(r)return e.flags&256?(e.flags&=-257,n=jd(Error(se(422))),Rl(t,e,s,n)):e.memoizedState!==null?(e.child=t.child,e.flags|=128,null):(i=n.fallback,a=e.mode,n=wc({mode:"visible",children:n.children},a,0,null),i=Ka(i,a,s,null),i.flags|=2,n.return=e,i.return=e,n.sibling=i,e.child=n,e.mode&1&&ts(e,t.child,null,s),e.child.memoizedState=m0(s),e.memoizedState=g0,i);if(!(e.mode&1))return Rl(t,e,s,null);if(a.data==="$!"){if(n=a.nextSibling&&a.nextSibling.dataset,n)var o=n.dgst;return n=o,i=Error(se(419)),n=jd(i,n,void 0),Rl(t,e,s,n)}if(o=(s&t.childLanes)!==0,mr||o){if(n=qt,n!==null){switch(s&-s){case 4:a=2;break;case 16:a=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:a=32;break;case 536870912:a=268435456;break;default:a=0}a=a&(n.suspendedLanes|s)?0:a,a!==0&&a!==i.retryLane&&(i.retryLane=a,Mn(t,a),Jr(n,t,a,-1))}return Fx(),n=jd(Error(se(421))),Rl(t,e,s,n)}return a.data==="$?"?(e.flags|=128,e.child=t.child,e=tL.bind(null,t),a._reactRetry=e,null):(t=i.treeContext,kr=ua(a.nextSibling),Tr=e,ut=!0,Zr=null,t!==null&&(Ir[Mr++]=Nn,Ir[Mr++]=Rn,Ir[Mr++]=Xa,Nn=t.id,Rn=t.overflow,Xa=e),e=Mx(e,n.children),e.flags|=4096,e)}function Fb(t,e,r){t.lanes|=e;var n=t.alternate;n!==null&&(n.lanes|=e),c0(t.return,e,r)}function Id(t,e,r,n,a){var i=t.memoizedState;i===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:a}:(i.isBackwards=e,i.rendering=null,i.renderingStartTime=0,i.last=n,i.tail=r,i.tailMode=a)}function QR(t,e,r){var n=e.pendingProps,a=n.revealOrder,i=n.tail;if(ir(t,e,n.children,r),n=ht.current,n&2)n=n&1|2,e.flags|=128;else{if(t!==null&&t.flags&128)e:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&Fb(t,r,e);else if(t.tag===19)Fb(t,r,e);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}n&=1}if(rt(ht,n),!(e.mode&1))e.memoizedState=null;else switch(a){case"forwards":for(r=e.child,a=null;r!==null;)t=r.alternate,t!==null&&qu(t)===null&&(a=r),r=r.sibling;r=a,r===null?(a=e.child,e.child=null):(a=r.sibling,r.sibling=null),Id(e,!1,a,r,i);break;case"backwards":for(r=null,a=e.child,e.child=null;a!==null;){if(t=a.alternate,t!==null&&qu(t)===null){e.child=a;break}t=a.sibling,a.sibling=r,r=a,a=t}Id(e,!0,r,null,i);break;case"together":Id(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function su(t,e){!(e.mode&1)&&t!==null&&(t.alternate=null,e.alternate=null,e.flags|=2)}function Dn(t,e,r){if(t!==null&&(e.dependencies=t.dependencies),Qa|=e.lanes,!(r&e.childLanes))return null;if(t!==null&&e.child!==t.child)throw Error(se(153));if(e.child!==null){for(t=e.child,r=va(t,t.pendingProps),e.child=r,r.return=e;t.sibling!==null;)t=t.sibling,r=r.sibling=va(t,t.pendingProps),r.return=e;r.sibling=null}return e.child}function VD(t,e,r){switch(e.tag){case 3:XR(e),es();break;case 5:CR(e);break;case 1:wr(e.type)&&Iu(e);break;case 4:Tx(e,e.stateNode.containerInfo);break;case 10:var n=e.type._context,a=e.memoizedProps.value;rt(Lu,n._currentValue),n._currentValue=a;break;case 13:if(n=e.memoizedState,n!==null)return n.dehydrated!==null?(rt(ht,ht.current&1),e.flags|=128,null):r&e.child.childLanes?ZR(t,e,r):(rt(ht,ht.current&1),t=Dn(t,e,r),t!==null?t.sibling:null);rt(ht,ht.current&1);break;case 19:if(n=(r&e.childLanes)!==0,t.flags&128){if(n)return QR(t,e,r);e.flags|=128}if(a=e.memoizedState,a!==null&&(a.rendering=null,a.tail=null,a.lastEffect=null),rt(ht,ht.current),n)break;return null;case 22:case 23:return e.lanes=0,KR(t,e,r)}return Dn(t,e,r)}var JR,y0,eP,tP;JR=function(t,e){for(var r=e.child;r!==null;){if(r.tag===5||r.tag===6)t.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===e)break;for(;r.sibling===null;){if(r.return===null||r.return===e)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};y0=function(){};eP=function(t,e,r,n){var a=t.memoizedProps;if(a!==n){t=e.stateNode,Ga(gn.current);var i=null;switch(r){case"input":a=Fy(t,a),n=Fy(t,n),i=[];break;case"select":a=mt({},a,{value:void 0}),n=mt({},n,{value:void 0}),i=[];break;case"textarea":a=Vy(t,a),n=Vy(t,n),i=[];break;default:typeof a.onClick!="function"&&typeof n.onClick=="function"&&(t.onclick=Au)}Gy(r,n);var s;r=null;for(u in a)if(!n.hasOwnProperty(u)&&a.hasOwnProperty(u)&&a[u]!=null)if(u==="style"){var o=a[u];for(s in o)o.hasOwnProperty(s)&&(r||(r={}),r[s]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(mo.hasOwnProperty(u)?i||(i=[]):(i=i||[]).push(u,null));for(u in n){var l=n[u];if(o=a!=null?a[u]:void 0,n.hasOwnProperty(u)&&l!==o&&(l!=null||o!=null))if(u==="style")if(o){for(s in o)!o.hasOwnProperty(s)||l&&l.hasOwnProperty(s)||(r||(r={}),r[s]="");for(s in l)l.hasOwnProperty(s)&&o[s]!==l[s]&&(r||(r={}),r[s]=l[s])}else r||(i||(i=[]),i.push(u,r)),r=l;else u==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,o=o?o.__html:void 0,l!=null&&o!==l&&(i=i||[]).push(u,l)):u==="children"?typeof l!="string"&&typeof l!="number"||(i=i||[]).push(u,""+l):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(mo.hasOwnProperty(u)?(l!=null&&u==="onScroll"&&it("scroll",t),i||o===l||(i=[])):(i=i||[]).push(u,l))}r&&(i=i||[]).push("style",r);var u=i;(e.updateQueue=u)&&(e.flags|=4)}};tP=function(t,e,r,n){r!==n&&(e.flags|=4)};function Is(t,e){if(!ut)switch(t.tailMode){case"hidden":e=t.tail;for(var r=null;e!==null;)e.alternate!==null&&(r=e),e=e.sibling;r===null?t.tail=null:r.sibling=null;break;case"collapsed":r=t.tail;for(var n=null;r!==null;)r.alternate!==null&&(n=r),r=r.sibling;n===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:n.sibling=null}}function Qt(t){var e=t.alternate!==null&&t.alternate.child===t.child,r=0,n=0;if(e)for(var a=t.child;a!==null;)r|=a.lanes|a.childLanes,n|=a.subtreeFlags&14680064,n|=a.flags&14680064,a.return=t,a=a.sibling;else for(a=t.child;a!==null;)r|=a.lanes|a.childLanes,n|=a.subtreeFlags,n|=a.flags,a.return=t,a=a.sibling;return t.subtreeFlags|=n,t.childLanes=r,e}function UD(t,e,r){var n=e.pendingProps;switch(xx(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Qt(e),null;case 1:return wr(e.type)&&ju(),Qt(e),null;case 3:return n=e.stateNode,rs(),ot(br),ot(er),Nx(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(t===null||t.child===null)&&(_l(e)?e.flags|=4:t===null||t.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,Zr!==null&&(T0(Zr),Zr=null))),y0(t,e),Qt(e),null;case 5:_x(e);var a=Ga(Ro.current);if(r=e.type,t!==null&&e.stateNode!=null)eP(t,e,r,n,a),t.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!n){if(e.stateNode===null)throw Error(se(166));return Qt(e),null}if(t=Ga(gn.current),_l(e)){n=e.stateNode,r=e.type;var i=e.memoizedProps;switch(n[fn]=e,n[_o]=i,t=(e.mode&1)!==0,r){case"dialog":it("cancel",n),it("close",n);break;case"iframe":case"object":case"embed":it("load",n);break;case"video":case"audio":for(a=0;a<Xs.length;a++)it(Xs[a],n);break;case"source":it("error",n);break;case"img":case"image":case"link":it("error",n),it("load",n);break;case"details":it("toggle",n);break;case"input":Y1(n,i),it("invalid",n);break;case"select":n._wrapperState={wasMultiple:!!i.multiple},it("invalid",n);break;case"textarea":Z1(n,i),it("invalid",n)}Gy(r,i),a=null;for(var s in i)if(i.hasOwnProperty(s)){var o=i[s];s==="children"?typeof o=="string"?n.textContent!==o&&(i.suppressHydrationWarning!==!0&&Tl(n.textContent,o,t),a=["children",o]):typeof o=="number"&&n.textContent!==""+o&&(i.suppressHydrationWarning!==!0&&Tl(n.textContent,o,t),a=["children",""+o]):mo.hasOwnProperty(s)&&o!=null&&s==="onScroll"&&it("scroll",n)}switch(r){case"input":yl(n),X1(n,i,!0);break;case"textarea":yl(n),Q1(n);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(n.onclick=Au)}n=a,e.updateQueue=n,n!==null&&(e.flags|=4)}else{s=a.nodeType===9?a:a.ownerDocument,t==="http://www.w3.org/1999/xhtml"&&(t=RN(r)),t==="http://www.w3.org/1999/xhtml"?r==="script"?(t=s.createElement("div"),t.innerHTML="<script><\/script>",t=t.removeChild(t.firstChild)):typeof n.is=="string"?t=s.createElement(r,{is:n.is}):(t=s.createElement(r),r==="select"&&(s=t,n.multiple?s.multiple=!0:n.size&&(s.size=n.size))):t=s.createElementNS(t,r),t[fn]=e,t[_o]=n,JR(t,e,!1,!1),e.stateNode=t;e:{switch(s=Hy(r,n),r){case"dialog":it("cancel",t),it("close",t),a=n;break;case"iframe":case"object":case"embed":it("load",t),a=n;break;case"video":case"audio":for(a=0;a<Xs.length;a++)it(Xs[a],t);a=n;break;case"source":it("error",t),a=n;break;case"img":case"image":case"link":it("error",t),it("load",t),a=n;break;case"details":it("toggle",t),a=n;break;case"input":Y1(t,n),a=Fy(t,n),it("invalid",t);break;case"option":a=n;break;case"select":t._wrapperState={wasMultiple:!!n.multiple},a=mt({},n,{value:void 0}),it("invalid",t);break;case"textarea":Z1(t,n),a=Vy(t,n),it("invalid",t);break;default:a=n}Gy(r,a),o=a;for(i in o)if(o.hasOwnProperty(i)){var l=o[i];i==="style"?jN(t,l):i==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&PN(t,l)):i==="children"?typeof l=="string"?(r!=="textarea"||l!=="")&&yo(t,l):typeof l=="number"&&yo(t,""+l):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(mo.hasOwnProperty(i)?l!=null&&i==="onScroll"&&it("scroll",t):l!=null&&ax(t,i,l,s))}switch(r){case"input":yl(t),X1(t,n,!1);break;case"textarea":yl(t),Q1(t);break;case"option":n.value!=null&&t.setAttribute("value",""+ga(n.value));break;case"select":t.multiple=!!n.multiple,i=n.value,i!=null?$i(t,!!n.multiple,i,!1):n.defaultValue!=null&&$i(t,!!n.multiple,n.defaultValue,!0);break;default:typeof a.onClick=="function"&&(t.onclick=Au)}switch(r){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}}n&&(e.flags|=4)}e.ref!==null&&(e.flags|=512,e.flags|=2097152)}return Qt(e),null;case 6:if(t&&e.stateNode!=null)tP(t,e,t.memoizedProps,n);else{if(typeof n!="string"&&e.stateNode===null)throw Error(se(166));if(r=Ga(Ro.current),Ga(gn.current),_l(e)){if(n=e.stateNode,r=e.memoizedProps,n[fn]=e,(i=n.nodeValue!==r)&&(t=Tr,t!==null))switch(t.tag){case 3:Tl(n.nodeValue,r,(t.mode&1)!==0);break;case 5:t.memoizedProps.suppressHydrationWarning!==!0&&Tl(n.nodeValue,r,(t.mode&1)!==0)}i&&(e.flags|=4)}else n=(r.nodeType===9?r:r.ownerDocument).createTextNode(n),n[fn]=e,e.stateNode=n}return Qt(e),null;case 13:if(ot(ht),n=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(ut&&kr!==null&&e.mode&1&&!(e.flags&128))xR(),es(),e.flags|=98560,i=!1;else if(i=_l(e),n!==null&&n.dehydrated!==null){if(t===null){if(!i)throw Error(se(318));if(i=e.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(se(317));i[fn]=e}else es(),!(e.flags&128)&&(e.memoizedState=null),e.flags|=4;Qt(e),i=!1}else Zr!==null&&(T0(Zr),Zr=null),i=!0;if(!i)return e.flags&65536?e:null}return e.flags&128?(e.lanes=r,e):(n=n!==null,n!==(t!==null&&t.memoizedState!==null)&&n&&(e.child.flags|=8192,e.mode&1&&(t===null||ht.current&1?At===0&&(At=3):Fx())),e.updateQueue!==null&&(e.flags|=4),Qt(e),null);case 4:return rs(),y0(t,e),t===null&&ko(e.stateNode.containerInfo),Qt(e),null;case 10:return Ex(e.type._context),Qt(e),null;case 17:return wr(e.type)&&ju(),Qt(e),null;case 19:if(ot(ht),i=e.memoizedState,i===null)return Qt(e),null;if(n=(e.flags&128)!==0,s=i.rendering,s===null)if(n)Is(i,!1);else{if(At!==0||t!==null&&t.flags&128)for(t=e.child;t!==null;){if(s=qu(t),s!==null){for(e.flags|=128,Is(i,!1),n=s.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),e.subtreeFlags=0,n=r,r=e.child;r!==null;)i=r,t=n,i.flags&=14680066,s=i.alternate,s===null?(i.childLanes=0,i.lanes=t,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=s.childLanes,i.lanes=s.lanes,i.child=s.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=s.memoizedProps,i.memoizedState=s.memoizedState,i.updateQueue=s.updateQueue,i.type=s.type,t=s.dependencies,i.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),r=r.sibling;return rt(ht,ht.current&1|2),e.child}t=t.sibling}i.tail!==null&&St()>as&&(e.flags|=128,n=!0,Is(i,!1),e.lanes=4194304)}else{if(!n)if(t=qu(s),t!==null){if(e.flags|=128,n=!0,r=t.updateQueue,r!==null&&(e.updateQueue=r,e.flags|=4),Is(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!ut)return Qt(e),null}else 2*St()-i.renderingStartTime>as&&r!==1073741824&&(e.flags|=128,n=!0,Is(i,!1),e.lanes=4194304);i.isBackwards?(s.sibling=e.child,e.child=s):(r=i.last,r!==null?r.sibling=s:e.child=s,i.last=s)}return i.tail!==null?(e=i.tail,i.rendering=e,i.tail=e.sibling,i.renderingStartTime=St(),e.sibling=null,r=ht.current,rt(ht,n?r&1|2:r&1),e):(Qt(e),null);case 22:case 23:return qx(),n=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==n&&(e.flags|=8192),n&&e.mode&1?Cr&1073741824&&(Qt(e),e.subtreeFlags&6&&(e.flags|=8192)):Qt(e),null;case 24:return null;case 25:return null}throw Error(se(156,e.tag))}function GD(t,e){switch(xx(e),e.tag){case 1:return wr(e.type)&&ju(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return rs(),ot(br),ot(er),Nx(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return _x(e),null;case 13:if(ot(ht),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(se(340));es()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return ot(ht),null;case 4:return rs(),null;case 10:return Ex(e.type._context),null;case 22:case 23:return qx(),null;case 24:return null;default:return null}}var Pl=!1,Jt=!1,HD=typeof WeakSet=="function"?WeakSet:Set,he=null;function Li(t,e){var r=t.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){bt(t,e,n)}else r.current=null}function x0(t,e,r){try{r()}catch(n){bt(t,e,n)}}var $b=!1;function WD(t,e){if(r0=Nu,t=sR(),mx(t)){if("selectionStart"in t)var r={start:t.selectionStart,end:t.selectionEnd};else e:{r=(r=t.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var a=n.anchorOffset,i=n.focusNode;n=n.focusOffset;try{r.nodeType,i.nodeType}catch{r=null;break e}var s=0,o=-1,l=-1,u=0,c=0,d=t,f=null;t:for(;;){for(var h;d!==r||a!==0&&d.nodeType!==3||(o=s+a),d!==i||n!==0&&d.nodeType!==3||(l=s+n),d.nodeType===3&&(s+=d.nodeValue.length),(h=d.firstChild)!==null;)f=d,d=h;for(;;){if(d===t)break t;if(f===r&&++u===a&&(o=s),f===i&&++c===n&&(l=s),(h=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=h}r=o===-1||l===-1?null:{start:o,end:l}}else r=null}r=r||{start:0,end:0}}else r=null;for(n0={focusedElem:t,selectionRange:r},Nu=!1,he=e;he!==null;)if(e=he,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,he=t;else for(;he!==null;){e=he;try{var v=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var x=v.memoizedProps,b=v.memoizedState,m=e.stateNode,p=m.getSnapshotBeforeUpdate(e.elementType===e.type?x:Kr(e.type,x),b);m.__reactInternalSnapshotBeforeUpdate=p}break;case 3:var y=e.stateNode.containerInfo;y.nodeType===1?y.textContent="":y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(se(163))}}catch(w){bt(e,e.return,w)}if(t=e.sibling,t!==null){t.return=e.return,he=t;break}he=e.return}return v=$b,$b=!1,v}function co(t,e,r){var n=e.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var a=n=n.next;do{if((a.tag&t)===t){var i=a.destroy;a.destroy=void 0,i!==void 0&&x0(e,r,i)}a=a.next}while(a!==n)}}function xc(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var r=e=e.next;do{if((r.tag&t)===t){var n=r.create;r.destroy=n()}r=r.next}while(r!==e)}}function b0(t){var e=t.ref;if(e!==null){var r=t.stateNode;switch(t.tag){case 5:t=r;break;default:t=r}typeof e=="function"?e(t):e.current=t}}function rP(t){var e=t.alternate;e!==null&&(t.alternate=null,rP(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[fn],delete e[_o],delete e[s0],delete e[RD],delete e[PD])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function nP(t){return t.tag===5||t.tag===3||t.tag===4}function zb(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||nP(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function w0(t,e,r){var n=t.tag;if(n===5||n===6)t=t.stateNode,e?r.nodeType===8?r.parentNode.insertBefore(t,e):r.insertBefore(t,e):(r.nodeType===8?(e=r.parentNode,e.insertBefore(t,r)):(e=r,e.appendChild(t)),r=r._reactRootContainer,r!=null||e.onclick!==null||(e.onclick=Au));else if(n!==4&&(t=t.child,t!==null))for(w0(t,e,r),t=t.sibling;t!==null;)w0(t,e,r),t=t.sibling}function S0(t,e,r){var n=t.tag;if(n===5||n===6)t=t.stateNode,e?r.insertBefore(t,e):r.appendChild(t);else if(n!==4&&(t=t.child,t!==null))for(S0(t,e,r),t=t.sibling;t!==null;)S0(t,e,r),t=t.sibling}var Vt=null,Yr=!1;function Un(t,e,r){for(r=r.child;r!==null;)aP(t,e,r),r=r.sibling}function aP(t,e,r){if(pn&&typeof pn.onCommitFiberUnmount=="function")try{pn.onCommitFiberUnmount(dc,r)}catch{}switch(r.tag){case 5:Jt||Li(r,e);case 6:var n=Vt,a=Yr;Vt=null,Un(t,e,r),Vt=n,Yr=a,Vt!==null&&(Yr?(t=Vt,r=r.stateNode,t.nodeType===8?t.parentNode.removeChild(r):t.removeChild(r)):Vt.removeChild(r.stateNode));break;case 18:Vt!==null&&(Yr?(t=Vt,r=r.stateNode,t.nodeType===8?Td(t.parentNode,r):t.nodeType===1&&Td(t,r),So(t)):Td(Vt,r.stateNode));break;case 4:n=Vt,a=Yr,Vt=r.stateNode.containerInfo,Yr=!0,Un(t,e,r),Vt=n,Yr=a;break;case 0:case 11:case 14:case 15:if(!Jt&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){a=n=n.next;do{var i=a,s=i.destroy;i=i.tag,s!==void 0&&(i&2||i&4)&&x0(r,e,s),a=a.next}while(a!==n)}Un(t,e,r);break;case 1:if(!Jt&&(Li(r,e),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(o){bt(r,e,o)}Un(t,e,r);break;case 21:Un(t,e,r);break;case 22:r.mode&1?(Jt=(n=Jt)||r.memoizedState!==null,Un(t,e,r),Jt=n):Un(t,e,r);break;default:Un(t,e,r)}}function Vb(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var r=t.stateNode;r===null&&(r=t.stateNode=new HD),e.forEach(function(n){var a=rL.bind(null,t,n);r.has(n)||(r.add(n),n.then(a,a))})}}function Wr(t,e){var r=e.deletions;if(r!==null)for(var n=0;n<r.length;n++){var a=r[n];try{var i=t,s=e,o=s;e:for(;o!==null;){switch(o.tag){case 5:Vt=o.stateNode,Yr=!1;break e;case 3:Vt=o.stateNode.containerInfo,Yr=!0;break e;case 4:Vt=o.stateNode.containerInfo,Yr=!0;break e}o=o.return}if(Vt===null)throw Error(se(160));aP(i,s,a),Vt=null,Yr=!1;var l=a.alternate;l!==null&&(l.return=null),a.return=null}catch(u){bt(a,e,u)}}if(e.subtreeFlags&12854)for(e=e.child;e!==null;)iP(e,t),e=e.sibling}function iP(t,e){var r=t.alternate,n=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(Wr(e,t),on(t),n&4){try{co(3,t,t.return),xc(3,t)}catch(x){bt(t,t.return,x)}try{co(5,t,t.return)}catch(x){bt(t,t.return,x)}}break;case 1:Wr(e,t),on(t),n&512&&r!==null&&Li(r,r.return);break;case 5:if(Wr(e,t),on(t),n&512&&r!==null&&Li(r,r.return),t.flags&32){var a=t.stateNode;try{yo(a,"")}catch(x){bt(t,t.return,x)}}if(n&4&&(a=t.stateNode,a!=null)){var i=t.memoizedProps,s=r!==null?r.memoizedProps:i,o=t.type,l=t.updateQueue;if(t.updateQueue=null,l!==null)try{o==="input"&&i.type==="radio"&&i.name!=null&&_N(a,i),Hy(o,s);var u=Hy(o,i);for(s=0;s<l.length;s+=2){var c=l[s],d=l[s+1];c==="style"?jN(a,d):c==="dangerouslySetInnerHTML"?PN(a,d):c==="children"?yo(a,d):ax(a,c,d,u)}switch(o){case"input":$y(a,i);break;case"textarea":NN(a,i);break;case"select":var f=a._wrapperState.wasMultiple;a._wrapperState.wasMultiple=!!i.multiple;var h=i.value;h!=null?$i(a,!!i.multiple,h,!1):f!==!!i.multiple&&(i.defaultValue!=null?$i(a,!!i.multiple,i.defaultValue,!0):$i(a,!!i.multiple,i.multiple?[]:"",!1))}a[_o]=i}catch(x){bt(t,t.return,x)}}break;case 6:if(Wr(e,t),on(t),n&4){if(t.stateNode===null)throw Error(se(162));a=t.stateNode,i=t.memoizedProps;try{a.nodeValue=i}catch(x){bt(t,t.return,x)}}break;case 3:if(Wr(e,t),on(t),n&4&&r!==null&&r.memoizedState.isDehydrated)try{So(e.containerInfo)}catch(x){bt(t,t.return,x)}break;case 4:Wr(e,t),on(t);break;case 13:Wr(e,t),on(t),a=t.child,a.flags&8192&&(i=a.memoizedState!==null,a.stateNode.isHidden=i,!i||a.alternate!==null&&a.alternate.memoizedState!==null||(Bx=St())),n&4&&Vb(t);break;case 22:if(c=r!==null&&r.memoizedState!==null,t.mode&1?(Jt=(u=Jt)||c,Wr(e,t),Jt=u):Wr(e,t),on(t),n&8192){if(u=t.memoizedState!==null,(t.stateNode.isHidden=u)&&!c&&t.mode&1)for(he=t,c=t.child;c!==null;){for(d=he=c;he!==null;){switch(f=he,h=f.child,f.tag){case 0:case 11:case 14:case 15:co(4,f,f.return);break;case 1:Li(f,f.return);var v=f.stateNode;if(typeof v.componentWillUnmount=="function"){n=f,r=f.return;try{e=n,v.props=e.memoizedProps,v.state=e.memoizedState,v.componentWillUnmount()}catch(x){bt(n,r,x)}}break;case 5:Li(f,f.return);break;case 22:if(f.memoizedState!==null){Gb(d);continue}}h!==null?(h.return=f,he=h):Gb(d)}c=c.sibling}e:for(c=null,d=t;;){if(d.tag===5){if(c===null){c=d;try{a=d.stateNode,u?(i=a.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(o=d.stateNode,l=d.memoizedProps.style,s=l!=null&&l.hasOwnProperty("display")?l.display:null,o.style.display=AN("display",s))}catch(x){bt(t,t.return,x)}}}else if(d.tag===6){if(c===null)try{d.stateNode.nodeValue=u?"":d.memoizedProps}catch(x){bt(t,t.return,x)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===t)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===t)break e;for(;d.sibling===null;){if(d.return===null||d.return===t)break e;c===d&&(c=null),d=d.return}c===d&&(c=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:Wr(e,t),on(t),n&4&&Vb(t);break;case 21:break;default:Wr(e,t),on(t)}}function on(t){var e=t.flags;if(e&2){try{e:{for(var r=t.return;r!==null;){if(nP(r)){var n=r;break e}r=r.return}throw Error(se(160))}switch(n.tag){case 5:var a=n.stateNode;n.flags&32&&(yo(a,""),n.flags&=-33);var i=zb(t);S0(t,i,a);break;case 3:case 4:var s=n.stateNode.containerInfo,o=zb(t);w0(t,o,s);break;default:throw Error(se(161))}}catch(l){bt(t,t.return,l)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function KD(t,e,r){he=t,sP(t)}function sP(t,e,r){for(var n=(t.mode&1)!==0;he!==null;){var a=he,i=a.child;if(a.tag===22&&n){var s=a.memoizedState!==null||Pl;if(!s){var o=a.alternate,l=o!==null&&o.memoizedState!==null||Jt;o=Pl;var u=Jt;if(Pl=s,(Jt=l)&&!u)for(he=a;he!==null;)s=he,l=s.child,s.tag===22&&s.memoizedState!==null?Hb(a):l!==null?(l.return=s,he=l):Hb(a);for(;i!==null;)he=i,sP(i),i=i.sibling;he=a,Pl=o,Jt=u}Ub(t)}else a.subtreeFlags&8772&&i!==null?(i.return=a,he=i):Ub(t)}}function Ub(t){for(;he!==null;){var e=he;if(e.flags&8772){var r=e.alternate;try{if(e.flags&8772)switch(e.tag){case 0:case 11:case 15:Jt||xc(5,e);break;case 1:var n=e.stateNode;if(e.flags&4&&!Jt)if(r===null)n.componentDidMount();else{var a=e.elementType===e.type?r.memoizedProps:Kr(e.type,r.memoizedProps);n.componentDidUpdate(a,r.memoizedState,n.__reactInternalSnapshotBeforeUpdate)}var i=e.updateQueue;i!==null&&Nb(e,i,n);break;case 3:var s=e.updateQueue;if(s!==null){if(r=null,e.child!==null)switch(e.child.tag){case 5:r=e.child.stateNode;break;case 1:r=e.child.stateNode}Nb(e,s,r)}break;case 5:var o=e.stateNode;if(r===null&&e.flags&4){r=o;var l=e.memoizedProps;switch(e.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&r.focus();break;case"img":l.src&&(r.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(e.memoizedState===null){var u=e.alternate;if(u!==null){var c=u.memoizedState;if(c!==null){var d=c.dehydrated;d!==null&&So(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(se(163))}Jt||e.flags&512&&b0(e)}catch(f){bt(e,e.return,f)}}if(e===t){he=null;break}if(r=e.sibling,r!==null){r.return=e.return,he=r;break}he=e.return}}function Gb(t){for(;he!==null;){var e=he;if(e===t){he=null;break}var r=e.sibling;if(r!==null){r.return=e.return,he=r;break}he=e.return}}function Hb(t){for(;he!==null;){var e=he;try{switch(e.tag){case 0:case 11:case 15:var r=e.return;try{xc(4,e)}catch(l){bt(e,r,l)}break;case 1:var n=e.stateNode;if(typeof n.componentDidMount=="function"){var a=e.return;try{n.componentDidMount()}catch(l){bt(e,a,l)}}var i=e.return;try{b0(e)}catch(l){bt(e,i,l)}break;case 5:var s=e.return;try{b0(e)}catch(l){bt(e,s,l)}}}catch(l){bt(e,e.return,l)}if(e===t){he=null;break}var o=e.sibling;if(o!==null){o.return=e.return,he=o;break}he=e.return}}var YD=Math.ceil,zu=On.ReactCurrentDispatcher,Dx=On.ReactCurrentOwner,Or=On.ReactCurrentBatchConfig,Ve=0,qt=null,Tt=null,Ut=0,Cr=0,Bi=Ta(0),At=0,Io=null,Qa=0,bc=0,Lx=0,fo=null,hr=null,Bx=0,as=1/0,kn=null,Vu=!1,E0=null,da=null,Al=!1,ta=null,Uu=0,vo=0,C0=null,ou=-1,lu=0;function or(){return Ve&6?St():ou!==-1?ou:ou=St()}function fa(t){return t.mode&1?Ve&2&&Ut!==0?Ut&-Ut:jD.transition!==null?(lu===0&&(lu=UN()),lu):(t=Xe,t!==0||(t=window.event,t=t===void 0?16:ZN(t.type)),t):1}function Jr(t,e,r,n){if(50<vo)throw vo=0,C0=null,Error(se(185));Go(t,r,n),(!(Ve&2)||t!==qt)&&(t===qt&&(!(Ve&2)&&(bc|=r),At===4&&Jn(t,Ut)),Sr(t,n),r===1&&Ve===0&&!(e.mode&1)&&(as=St()+500,gc&&_a()))}function Sr(t,e){var r=t.callbackNode;jM(t,e);var n=_u(t,t===qt?Ut:0);if(n===0)r!==null&&tb(r),t.callbackNode=null,t.callbackPriority=0;else if(e=n&-n,t.callbackPriority!==e){if(r!=null&&tb(r),e===1)t.tag===0?AD(Wb.bind(null,t)):gR(Wb.bind(null,t)),_D(function(){!(Ve&6)&&_a()}),r=null;else{switch(GN(n)){case 1:r=ux;break;case 4:r=zN;break;case 16:r=Tu;break;case 536870912:r=VN;break;default:r=Tu}r=hP(r,oP.bind(null,t))}t.callbackPriority=e,t.callbackNode=r}}function oP(t,e){if(ou=-1,lu=0,Ve&6)throw Error(se(327));var r=t.callbackNode;if(Hi()&&t.callbackNode!==r)return null;var n=_u(t,t===qt?Ut:0);if(n===0)return null;if(n&30||n&t.expiredLanes||e)e=Gu(t,n);else{e=n;var a=Ve;Ve|=2;var i=uP();(qt!==t||Ut!==e)&&(kn=null,as=St()+500,Wa(t,e));do try{QD();break}catch(o){lP(t,o)}while(!0);Sx(),zu.current=i,Ve=a,Tt!==null?e=0:(qt=null,Ut=0,e=At)}if(e!==0){if(e===2&&(a=Zy(t),a!==0&&(n=a,e=k0(t,a))),e===1)throw r=Io,Wa(t,0),Jn(t,n),Sr(t,St()),r;if(e===6)Jn(t,n);else{if(a=t.current.alternate,!(n&30)&&!XD(a)&&(e=Gu(t,n),e===2&&(i=Zy(t),i!==0&&(n=i,e=k0(t,i))),e===1))throw r=Io,Wa(t,0),Jn(t,n),Sr(t,St()),r;switch(t.finishedWork=a,t.finishedLanes=n,e){case 0:case 1:throw Error(se(345));case 2:Oa(t,hr,kn);break;case 3:if(Jn(t,n),(n&130023424)===n&&(e=Bx+500-St(),10<e)){if(_u(t,0)!==0)break;if(a=t.suspendedLanes,(a&n)!==n){or(),t.pingedLanes|=t.suspendedLanes&a;break}t.timeoutHandle=i0(Oa.bind(null,t,hr,kn),e);break}Oa(t,hr,kn);break;case 4:if(Jn(t,n),(n&4194240)===n)break;for(e=t.eventTimes,a=-1;0<n;){var s=31-Qr(n);i=1<<s,s=e[s],s>a&&(a=s),n&=~i}if(n=a,n=St()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*YD(n/1960))-n,10<n){t.timeoutHandle=i0(Oa.bind(null,t,hr,kn),n);break}Oa(t,hr,kn);break;case 5:Oa(t,hr,kn);break;default:throw Error(se(329))}}}return Sr(t,St()),t.callbackNode===r?oP.bind(null,t):null}function k0(t,e){var r=fo;return t.current.memoizedState.isDehydrated&&(Wa(t,e).flags|=256),t=Gu(t,e),t!==2&&(e=hr,hr=r,e!==null&&T0(e)),t}function T0(t){hr===null?hr=t:hr.push.apply(hr,t)}function XD(t){for(var e=t;;){if(e.flags&16384){var r=e.updateQueue;if(r!==null&&(r=r.stores,r!==null))for(var n=0;n<r.length;n++){var a=r[n],i=a.getSnapshot;a=a.value;try{if(!tn(i(),a))return!1}catch{return!1}}}if(r=e.child,e.subtreeFlags&16384&&r!==null)r.return=e,e=r;else{if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return!0;e=e.return}e.sibling.return=e.return,e=e.sibling}}return!0}function Jn(t,e){for(e&=~Lx,e&=~bc,t.suspendedLanes|=e,t.pingedLanes&=~e,t=t.expirationTimes;0<e;){var r=31-Qr(e),n=1<<r;t[r]=-1,e&=~n}}function Wb(t){if(Ve&6)throw Error(se(327));Hi();var e=_u(t,0);if(!(e&1))return Sr(t,St()),null;var r=Gu(t,e);if(t.tag!==0&&r===2){var n=Zy(t);n!==0&&(e=n,r=k0(t,n))}if(r===1)throw r=Io,Wa(t,0),Jn(t,e),Sr(t,St()),r;if(r===6)throw Error(se(345));return t.finishedWork=t.current.alternate,t.finishedLanes=e,Oa(t,hr,kn),Sr(t,St()),null}function Ox(t,e){var r=Ve;Ve|=1;try{return t(e)}finally{Ve=r,Ve===0&&(as=St()+500,gc&&_a())}}function Ja(t){ta!==null&&ta.tag===0&&!(Ve&6)&&Hi();var e=Ve;Ve|=1;var r=Or.transition,n=Xe;try{if(Or.transition=null,Xe=1,t)return t()}finally{Xe=n,Or.transition=r,Ve=e,!(Ve&6)&&_a()}}function qx(){Cr=Bi.current,ot(Bi)}function Wa(t,e){t.finishedWork=null,t.finishedLanes=0;var r=t.timeoutHandle;if(r!==-1&&(t.timeoutHandle=-1,TD(r)),Tt!==null)for(r=Tt.return;r!==null;){var n=r;switch(xx(n),n.tag){case 1:n=n.type.childContextTypes,n!=null&&ju();break;case 3:rs(),ot(br),ot(er),Nx();break;case 5:_x(n);break;case 4:rs();break;case 13:ot(ht);break;case 19:ot(ht);break;case 10:Ex(n.type._context);break;case 22:case 23:qx()}r=r.return}if(qt=t,Tt=t=va(t.current,null),Ut=Cr=e,At=0,Io=null,Lx=bc=Qa=0,hr=fo=null,Ua!==null){for(e=0;e<Ua.length;e++)if(r=Ua[e],n=r.interleaved,n!==null){r.interleaved=null;var a=n.next,i=r.pending;if(i!==null){var s=i.next;i.next=a,n.next=s}r.pending=n}Ua=null}return t}function lP(t,e){do{var r=Tt;try{if(Sx(),au.current=$u,Fu){for(var n=pt.memoizedState;n!==null;){var a=n.queue;a!==null&&(a.pending=null),n=n.next}Fu=!1}if(Za=0,Ot=Pt=pt=null,uo=!1,Po=0,Dx.current=null,r===null||r.return===null){At=1,Io=e,Tt=null;break}e:{var i=t,s=r.return,o=r,l=e;if(e=Ut,o.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var u=l,c=o,d=c.tag;if(!(c.mode&1)&&(d===0||d===11||d===15)){var f=c.alternate;f?(c.updateQueue=f.updateQueue,c.memoizedState=f.memoizedState,c.lanes=f.lanes):(c.updateQueue=null,c.memoizedState=null)}var h=Mb(s);if(h!==null){h.flags&=-257,Db(h,s,o,i,e),h.mode&1&&Ib(i,u,e),e=h,l=u;var v=e.updateQueue;if(v===null){var x=new Set;x.add(l),e.updateQueue=x}else v.add(l);break e}else{if(!(e&1)){Ib(i,u,e),Fx();break e}l=Error(se(426))}}else if(ut&&o.mode&1){var b=Mb(s);if(b!==null){!(b.flags&65536)&&(b.flags|=256),Db(b,s,o,i,e),bx(ns(l,o));break e}}i=l=ns(l,o),At!==4&&(At=2),fo===null?fo=[i]:fo.push(i),i=s;do{switch(i.tag){case 3:i.flags|=65536,e&=-e,i.lanes|=e;var m=GR(i,l,e);_b(i,m);break e;case 1:o=l;var p=i.type,y=i.stateNode;if(!(i.flags&128)&&(typeof p.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(da===null||!da.has(y)))){i.flags|=65536,e&=-e,i.lanes|=e;var w=HR(i,o,e);_b(i,w);break e}}i=i.return}while(i!==null)}dP(r)}catch(E){e=E,Tt===r&&r!==null&&(Tt=r=r.return);continue}break}while(!0)}function uP(){var t=zu.current;return zu.current=$u,t===null?$u:t}function Fx(){(At===0||At===3||At===2)&&(At=4),qt===null||!(Qa&268435455)&&!(bc&268435455)||Jn(qt,Ut)}function Gu(t,e){var r=Ve;Ve|=2;var n=uP();(qt!==t||Ut!==e)&&(kn=null,Wa(t,e));do try{ZD();break}catch(a){lP(t,a)}while(!0);if(Sx(),Ve=r,zu.current=n,Tt!==null)throw Error(se(261));return qt=null,Ut=0,At}function ZD(){for(;Tt!==null;)cP(Tt)}function QD(){for(;Tt!==null&&!EM();)cP(Tt)}function cP(t){var e=vP(t.alternate,t,Cr);t.memoizedProps=t.pendingProps,e===null?dP(t):Tt=e,Dx.current=null}function dP(t){var e=t;do{var r=e.alternate;if(t=e.return,e.flags&32768){if(r=GD(r,e),r!==null){r.flags&=32767,Tt=r;return}if(t!==null)t.flags|=32768,t.subtreeFlags=0,t.deletions=null;else{At=6,Tt=null;return}}else if(r=UD(r,e,Cr),r!==null){Tt=r;return}if(e=e.sibling,e!==null){Tt=e;return}Tt=e=t}while(e!==null);At===0&&(At=5)}function Oa(t,e,r){var n=Xe,a=Or.transition;try{Or.transition=null,Xe=1,JD(t,e,r,n)}finally{Or.transition=a,Xe=n}return null}function JD(t,e,r,n){do Hi();while(ta!==null);if(Ve&6)throw Error(se(327));r=t.finishedWork;var a=t.finishedLanes;if(r===null)return null;if(t.finishedWork=null,t.finishedLanes=0,r===t.current)throw Error(se(177));t.callbackNode=null,t.callbackPriority=0;var i=r.lanes|r.childLanes;if(IM(t,i),t===qt&&(Tt=qt=null,Ut=0),!(r.subtreeFlags&2064)&&!(r.flags&2064)||Al||(Al=!0,hP(Tu,function(){return Hi(),null})),i=(r.flags&15990)!==0,r.subtreeFlags&15990||i){i=Or.transition,Or.transition=null;var s=Xe;Xe=1;var o=Ve;Ve|=4,Dx.current=null,WD(t,r),iP(r,t),xD(n0),Nu=!!r0,n0=r0=null,t.current=r,KD(r),CM(),Ve=o,Xe=s,Or.transition=i}else t.current=r;if(Al&&(Al=!1,ta=t,Uu=a),i=t.pendingLanes,i===0&&(da=null),_M(r.stateNode),Sr(t,St()),e!==null)for(n=t.onRecoverableError,r=0;r<e.length;r++)a=e[r],n(a.value,{componentStack:a.stack,digest:a.digest});if(Vu)throw Vu=!1,t=E0,E0=null,t;return Uu&1&&t.tag!==0&&Hi(),i=t.pendingLanes,i&1?t===C0?vo++:(vo=0,C0=t):vo=0,_a(),null}function Hi(){if(ta!==null){var t=GN(Uu),e=Or.transition,r=Xe;try{if(Or.transition=null,Xe=16>t?16:t,ta===null)var n=!1;else{if(t=ta,ta=null,Uu=0,Ve&6)throw Error(se(331));var a=Ve;for(Ve|=4,he=t.current;he!==null;){var i=he,s=i.child;if(he.flags&16){var o=i.deletions;if(o!==null){for(var l=0;l<o.length;l++){var u=o[l];for(he=u;he!==null;){var c=he;switch(c.tag){case 0:case 11:case 15:co(8,c,i)}var d=c.child;if(d!==null)d.return=c,he=d;else for(;he!==null;){c=he;var f=c.sibling,h=c.return;if(rP(c),c===u){he=null;break}if(f!==null){f.return=h,he=f;break}he=h}}}var v=i.alternate;if(v!==null){var x=v.child;if(x!==null){v.child=null;do{var b=x.sibling;x.sibling=null,x=b}while(x!==null)}}he=i}}if(i.subtreeFlags&2064&&s!==null)s.return=i,he=s;else e:for(;he!==null;){if(i=he,i.flags&2048)switch(i.tag){case 0:case 11:case 15:co(9,i,i.return)}var m=i.sibling;if(m!==null){m.return=i.return,he=m;break e}he=i.return}}var p=t.current;for(he=p;he!==null;){s=he;var y=s.child;if(s.subtreeFlags&2064&&y!==null)y.return=s,he=y;else e:for(s=p;he!==null;){if(o=he,o.flags&2048)try{switch(o.tag){case 0:case 11:case 15:xc(9,o)}}catch(E){bt(o,o.return,E)}if(o===s){he=null;break e}var w=o.sibling;if(w!==null){w.return=o.return,he=w;break e}he=o.return}}if(Ve=a,_a(),pn&&typeof pn.onPostCommitFiberRoot=="function")try{pn.onPostCommitFiberRoot(dc,t)}catch{}n=!0}return n}finally{Xe=r,Or.transition=e}}return!1}function Kb(t,e,r){e=ns(r,e),e=GR(t,e,1),t=ca(t,e,1),e=or(),t!==null&&(Go(t,1,e),Sr(t,e))}function bt(t,e,r){if(t.tag===3)Kb(t,t,r);else for(;e!==null;){if(e.tag===3){Kb(e,t,r);break}else if(e.tag===1){var n=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(da===null||!da.has(n))){t=ns(r,t),t=HR(e,t,1),e=ca(e,t,1),t=or(),e!==null&&(Go(e,1,t),Sr(e,t));break}}e=e.return}}function eL(t,e,r){var n=t.pingCache;n!==null&&n.delete(e),e=or(),t.pingedLanes|=t.suspendedLanes&r,qt===t&&(Ut&r)===r&&(At===4||At===3&&(Ut&130023424)===Ut&&500>St()-Bx?Wa(t,0):Lx|=r),Sr(t,e)}function fP(t,e){e===0&&(t.mode&1?(e=wl,wl<<=1,!(wl&130023424)&&(wl=4194304)):e=1);var r=or();t=Mn(t,e),t!==null&&(Go(t,e,r),Sr(t,r))}function tL(t){var e=t.memoizedState,r=0;e!==null&&(r=e.retryLane),fP(t,r)}function rL(t,e){var r=0;switch(t.tag){case 13:var n=t.stateNode,a=t.memoizedState;a!==null&&(r=a.retryLane);break;case 19:n=t.stateNode;break;default:throw Error(se(314))}n!==null&&n.delete(e),fP(t,r)}var vP;vP=function(t,e,r){if(t!==null)if(t.memoizedProps!==e.pendingProps||br.current)mr=!0;else{if(!(t.lanes&r)&&!(e.flags&128))return mr=!1,VD(t,e,r);mr=!!(t.flags&131072)}else mr=!1,ut&&e.flags&1048576&&mR(e,Du,e.index);switch(e.lanes=0,e.tag){case 2:var n=e.type;su(t,e),t=e.pendingProps;var a=Ji(e,er.current);Gi(e,r),a=Px(null,e,n,t,a,r);var i=Ax();return e.flags|=1,typeof a=="object"&&a!==null&&typeof a.render=="function"&&a.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,wr(n)?(i=!0,Iu(e)):i=!1,e.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,kx(e),a.updater=yc,e.stateNode=a,a._reactInternals=e,f0(e,n,t,r),e=p0(null,e,n,!0,i,r)):(e.tag=0,ut&&i&&yx(e),ir(null,e,a,r),e=e.child),e;case 16:n=e.elementType;e:{switch(su(t,e),t=e.pendingProps,a=n._init,n=a(n._payload),e.type=n,a=e.tag=aL(n),t=Kr(n,t),a){case 0:e=h0(null,e,n,t,r);break e;case 1:e=Ob(null,e,n,t,r);break e;case 11:e=Lb(null,e,n,t,r);break e;case 14:e=Bb(null,e,n,Kr(n.type,t),r);break e}throw Error(se(306,n,""))}return e;case 0:return n=e.type,a=e.pendingProps,a=e.elementType===n?a:Kr(n,a),h0(t,e,n,a,r);case 1:return n=e.type,a=e.pendingProps,a=e.elementType===n?a:Kr(n,a),Ob(t,e,n,a,r);case 3:e:{if(XR(e),t===null)throw Error(se(387));n=e.pendingProps,i=e.memoizedState,a=i.element,ER(t,e),Ou(e,n,null,r);var s=e.memoizedState;if(n=s.element,i.isDehydrated)if(i={element:n,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},e.updateQueue.baseState=i,e.memoizedState=i,e.flags&256){a=ns(Error(se(423)),e),e=qb(t,e,n,r,a);break e}else if(n!==a){a=ns(Error(se(424)),e),e=qb(t,e,n,r,a);break e}else for(kr=ua(e.stateNode.containerInfo.firstChild),Tr=e,ut=!0,Zr=null,r=wR(e,null,n,r),e.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(es(),n===a){e=Dn(t,e,r);break e}ir(t,e,n,r)}e=e.child}return e;case 5:return CR(e),t===null&&u0(e),n=e.type,a=e.pendingProps,i=t!==null?t.memoizedProps:null,s=a.children,a0(n,a)?s=null:i!==null&&a0(n,i)&&(e.flags|=32),YR(t,e),ir(t,e,s,r),e.child;case 6:return t===null&&u0(e),null;case 13:return ZR(t,e,r);case 4:return Tx(e,e.stateNode.containerInfo),n=e.pendingProps,t===null?e.child=ts(e,null,n,r):ir(t,e,n,r),e.child;case 11:return n=e.type,a=e.pendingProps,a=e.elementType===n?a:Kr(n,a),Lb(t,e,n,a,r);case 7:return ir(t,e,e.pendingProps,r),e.child;case 8:return ir(t,e,e.pendingProps.children,r),e.child;case 12:return ir(t,e,e.pendingProps.children,r),e.child;case 10:e:{if(n=e.type._context,a=e.pendingProps,i=e.memoizedProps,s=a.value,rt(Lu,n._currentValue),n._currentValue=s,i!==null)if(tn(i.value,s)){if(i.children===a.children&&!br.current){e=Dn(t,e,r);break e}}else for(i=e.child,i!==null&&(i.return=e);i!==null;){var o=i.dependencies;if(o!==null){s=i.child;for(var l=o.firstContext;l!==null;){if(l.context===n){if(i.tag===1){l=An(-1,r&-r),l.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?l.next=l:(l.next=c.next,c.next=l),u.pending=l}}i.lanes|=r,l=i.alternate,l!==null&&(l.lanes|=r),c0(i.return,r,e),o.lanes|=r;break}l=l.next}}else if(i.tag===10)s=i.type===e.type?null:i.child;else if(i.tag===18){if(s=i.return,s===null)throw Error(se(341));s.lanes|=r,o=s.alternate,o!==null&&(o.lanes|=r),c0(s,r,e),s=i.sibling}else s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===e){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}ir(t,e,a.children,r),e=e.child}return e;case 9:return a=e.type,n=e.pendingProps.children,Gi(e,r),a=qr(a),n=n(a),e.flags|=1,ir(t,e,n,r),e.child;case 14:return n=e.type,a=Kr(n,e.pendingProps),a=Kr(n.type,a),Bb(t,e,n,a,r);case 15:return WR(t,e,e.type,e.pendingProps,r);case 17:return n=e.type,a=e.pendingProps,a=e.elementType===n?a:Kr(n,a),su(t,e),e.tag=1,wr(n)?(t=!0,Iu(e)):t=!1,Gi(e,r),UR(e,n,a),f0(e,n,a,r),p0(null,e,n,!0,t,r);case 19:return QR(t,e,r);case 22:return KR(t,e,r)}throw Error(se(156,e.tag))};function hP(t,e){return $N(t,e)}function nL(t,e,r,n){this.tag=t,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Lr(t,e,r,n){return new nL(t,e,r,n)}function $x(t){return t=t.prototype,!(!t||!t.isReactComponent)}function aL(t){if(typeof t=="function")return $x(t)?1:0;if(t!=null){if(t=t.$$typeof,t===sx)return 11;if(t===ox)return 14}return 2}function va(t,e){var r=t.alternate;return r===null?(r=Lr(t.tag,e,t.key,t.mode),r.elementType=t.elementType,r.type=t.type,r.stateNode=t.stateNode,r.alternate=t,t.alternate=r):(r.pendingProps=e,r.type=t.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=t.flags&14680064,r.childLanes=t.childLanes,r.lanes=t.lanes,r.child=t.child,r.memoizedProps=t.memoizedProps,r.memoizedState=t.memoizedState,r.updateQueue=t.updateQueue,e=t.dependencies,r.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},r.sibling=t.sibling,r.index=t.index,r.ref=t.ref,r}function uu(t,e,r,n,a,i){var s=2;if(n=t,typeof t=="function")$x(t)&&(s=1);else if(typeof t=="string")s=5;else e:switch(t){case _i:return Ka(r.children,a,i,e);case ix:s=8,a|=8;break;case Ly:return t=Lr(12,r,e,a|2),t.elementType=Ly,t.lanes=i,t;case By:return t=Lr(13,r,e,a),t.elementType=By,t.lanes=i,t;case Oy:return t=Lr(19,r,e,a),t.elementType=Oy,t.lanes=i,t;case CN:return wc(r,a,i,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case SN:s=10;break e;case EN:s=9;break e;case sx:s=11;break e;case ox:s=14;break e;case Yn:s=16,n=null;break e}throw Error(se(130,t==null?t:typeof t,""))}return e=Lr(s,r,e,a),e.elementType=t,e.type=n,e.lanes=i,e}function Ka(t,e,r,n){return t=Lr(7,t,n,e),t.lanes=r,t}function wc(t,e,r,n){return t=Lr(22,t,n,e),t.elementType=CN,t.lanes=r,t.stateNode={isHidden:!1},t}function Md(t,e,r){return t=Lr(6,t,null,e),t.lanes=r,t}function Dd(t,e,r){return e=Lr(4,t.children!==null?t.children:[],t.key,e),e.lanes=r,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function iL(t,e,r,n,a){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=pd(0),this.expirationTimes=pd(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=pd(0),this.identifierPrefix=n,this.onRecoverableError=a,this.mutableSourceEagerHydrationData=null}function zx(t,e,r,n,a,i,s,o,l){return t=new iL(t,e,r,o,l),e===1?(e=1,i===!0&&(e|=8)):e=0,i=Lr(3,null,null,e),t.current=i,i.stateNode=t,i.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},kx(i),t}function sL(t,e,r){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Ti,key:n==null?null:""+n,children:t,containerInfo:e,implementation:r}}function pP(t){if(!t)return ma;t=t._reactInternals;e:{if(ui(t)!==t||t.tag!==1)throw Error(se(170));var e=t;do{switch(e.tag){case 3:e=e.stateNode.context;break e;case 1:if(wr(e.type)){e=e.stateNode.__reactInternalMemoizedMergedChildContext;break e}}e=e.return}while(e!==null);throw Error(se(171))}if(t.tag===1){var r=t.type;if(wr(r))return pR(t,r,e)}return e}function gP(t,e,r,n,a,i,s,o,l){return t=zx(r,n,!0,t,a,i,s,o,l),t.context=pP(null),r=t.current,n=or(),a=fa(r),i=An(n,a),i.callback=e??null,ca(r,i,a),t.current.lanes=a,Go(t,a,n),Sr(t,n),t}function Sc(t,e,r,n){var a=e.current,i=or(),s=fa(a);return r=pP(r),e.context===null?e.context=r:e.pendingContext=r,e=An(i,s),e.payload={element:t},n=n===void 0?null:n,n!==null&&(e.callback=n),t=ca(a,e,s),t!==null&&(Jr(t,a,s,i),nu(t,a,s)),s}function Hu(t){if(t=t.current,!t.child)return null;switch(t.child.tag){case 5:return t.child.stateNode;default:return t.child.stateNode}}function Yb(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var r=t.retryLane;t.retryLane=r!==0&&r<e?r:e}}function Vx(t,e){Yb(t,e),(t=t.alternate)&&Yb(t,e)}function oL(){return null}var mP=typeof reportError=="function"?reportError:function(t){console.error(t)};function Ux(t){this._internalRoot=t}Ec.prototype.render=Ux.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(se(409));Sc(t,e,null,null)};Ec.prototype.unmount=Ux.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;Ja(function(){Sc(null,t,null,null)}),e[In]=null}};function Ec(t){this._internalRoot=t}Ec.prototype.unstable_scheduleHydration=function(t){if(t){var e=KN();t={blockedOn:null,target:t,priority:e};for(var r=0;r<Qn.length&&e!==0&&e<Qn[r].priority;r++);Qn.splice(r,0,t),r===0&&XN(t)}};function Gx(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function Cc(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11&&(t.nodeType!==8||t.nodeValue!==" react-mount-point-unstable "))}function Xb(){}function lL(t,e,r,n,a){if(a){if(typeof n=="function"){var i=n;n=function(){var u=Hu(s);i.call(u)}}var s=gP(e,n,t,0,null,!1,!1,"",Xb);return t._reactRootContainer=s,t[In]=s.current,ko(t.nodeType===8?t.parentNode:t),Ja(),s}for(;a=t.lastChild;)t.removeChild(a);if(typeof n=="function"){var o=n;n=function(){var u=Hu(l);o.call(u)}}var l=zx(t,0,!1,null,null,!1,!1,"",Xb);return t._reactRootContainer=l,t[In]=l.current,ko(t.nodeType===8?t.parentNode:t),Ja(function(){Sc(e,l,r,n)}),l}function kc(t,e,r,n,a){var i=r._reactRootContainer;if(i){var s=i;if(typeof a=="function"){var o=a;a=function(){var l=Hu(s);o.call(l)}}Sc(e,s,t,a)}else s=lL(r,e,t,a,n);return Hu(s)}HN=function(t){switch(t.tag){case 3:var e=t.stateNode;if(e.current.memoizedState.isDehydrated){var r=Ys(e.pendingLanes);r!==0&&(cx(e,r|1),Sr(e,St()),!(Ve&6)&&(as=St()+500,_a()))}break;case 13:Ja(function(){var n=Mn(t,1);if(n!==null){var a=or();Jr(n,t,1,a)}}),Vx(t,1)}};dx=function(t){if(t.tag===13){var e=Mn(t,134217728);if(e!==null){var r=or();Jr(e,t,134217728,r)}Vx(t,134217728)}};WN=function(t){if(t.tag===13){var e=fa(t),r=Mn(t,e);if(r!==null){var n=or();Jr(r,t,e,n)}Vx(t,e)}};KN=function(){return Xe};YN=function(t,e){var r=Xe;try{return Xe=t,e()}finally{Xe=r}};Ky=function(t,e,r){switch(e){case"input":if($y(t,r),e=r.name,r.type==="radio"&&e!=null){for(r=t;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+e)+'][type="radio"]'),e=0;e<r.length;e++){var n=r[e];if(n!==t&&n.form===t.form){var a=pc(n);if(!a)throw Error(se(90));TN(n),$y(n,a)}}}break;case"textarea":NN(t,r);break;case"select":e=r.value,e!=null&&$i(t,!!r.multiple,e,!1)}};DN=Ox;LN=Ja;var uL={usingClientEntryPoint:!1,Events:[Wo,Ai,pc,IN,MN,Ox]},Ms={findFiberByHostInstance:Va,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},cL={bundleType:Ms.bundleType,version:Ms.version,rendererPackageName:Ms.rendererPackageName,rendererConfig:Ms.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:On.ReactCurrentDispatcher,findHostInstanceByFiber:function(t){return t=qN(t),t===null?null:t.stateNode},findFiberByHostInstance:Ms.findFiberByHostInstance||oL,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var jl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!jl.isDisabled&&jl.supportsFiber)try{dc=jl.inject(cL),pn=jl}catch{}}Rr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=uL;Rr.createPortal=function(t,e){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Gx(e))throw Error(se(200));return sL(t,e,null,r)};Rr.createRoot=function(t,e){if(!Gx(t))throw Error(se(299));var r=!1,n="",a=mP;return e!=null&&(e.unstable_strictMode===!0&&(r=!0),e.identifierPrefix!==void 0&&(n=e.identifierPrefix),e.onRecoverableError!==void 0&&(a=e.onRecoverableError)),e=zx(t,1,!1,null,null,r,!1,n,a),t[In]=e.current,ko(t.nodeType===8?t.parentNode:t),new Ux(e)};Rr.findDOMNode=function(t){if(t==null)return null;if(t.nodeType===1)return t;var e=t._reactInternals;if(e===void 0)throw typeof t.render=="function"?Error(se(188)):(t=Object.keys(t).join(","),Error(se(268,t)));return t=qN(e),t=t===null?null:t.stateNode,t};Rr.flushSync=function(t){return Ja(t)};Rr.hydrate=function(t,e,r){if(!Cc(e))throw Error(se(200));return kc(null,t,e,!0,r)};Rr.hydrateRoot=function(t,e,r){if(!Gx(t))throw Error(se(405));var n=r!=null&&r.hydratedSources||null,a=!1,i="",s=mP;if(r!=null&&(r.unstable_strictMode===!0&&(a=!0),r.identifierPrefix!==void 0&&(i=r.identifierPrefix),r.onRecoverableError!==void 0&&(s=r.onRecoverableError)),e=gP(e,null,t,1,r??null,a,!1,i,s),t[In]=e.current,ko(t),n)for(t=0;t<n.length;t++)r=n[t],a=r._getVersion,a=a(r._source),e.mutableSourceEagerHydrationData==null?e.mutableSourceEagerHydrationData=[r,a]:e.mutableSourceEagerHydrationData.push(r,a);return new Ec(e)};Rr.render=function(t,e,r){if(!Cc(e))throw Error(se(200));return kc(null,t,e,!1,r)};Rr.unmountComponentAtNode=function(t){if(!Cc(t))throw Error(se(40));return t._reactRootContainer?(Ja(function(){kc(null,null,t,!1,function(){t._reactRootContainer=null,t[In]=null})}),!0):!1};Rr.unstable_batchedUpdates=Ox;Rr.unstable_renderSubtreeIntoContainer=function(t,e,r,n){if(!Cc(r))throw Error(se(200));if(t==null||t._reactInternals===void 0)throw Error(se(38));return kc(t,e,r,!1,n)};Rr.version="18.3.1-next-f1338f8080-20240426";function yP(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(yP)}catch(t){console.error(t)}}yP(),yN.exports=Rr;var dL=yN.exports,Zb=dL;My.createRoot=Zb.createRoot,My.hydrateRoot=Zb.hydrateRoot;const Hx=Z.createContext(null);function fL(){return`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/graph/api/events/ws`}function vL({children:t}){const[e,r]=Z.useState("connecting"),n=Z.useRef(new Set),a=Z.useRef(null);Z.useEffect(()=>{let s=!1,o=null;function l(){if(s)return;r("connecting");let u;try{u=new WebSocket(fL())}catch{if(s)return;r("dead"),o=setTimeout(l,1500);return}a.current=u,u.onopen=()=>{s||r("live")};const c=()=>{if(!s){r("dead");try{u.close()}catch{}o=setTimeout(l,1500)}};u.onerror=c,u.onclose=c,u.onmessage=d=>{let f=null;try{f=JSON.parse(d.data)}catch{return}if(f)for(const h of n.current)try{h(f)}catch(v){console.warn("ws listener error",v)}}}return l(),()=>{var u;s=!0,o&&clearTimeout(o);try{(u=a.current)==null||u.close()}catch{}}},[]);const i=Z.useCallback(s=>(n.current.add(s),()=>{n.current.delete(s)}),[]);return g.jsx(Hx.Provider,{value:{state:e,subscribe:i},children:t})}function hL(){const t=Z.useContext(Hx);return(t==null?void 0:t.state)??"connecting"}function Tc(t){const e=Z.useContext(Hx),r=Z.useRef(t);Z.useEffect(()=>{r.current=t},[t]),Z.useEffect(()=>{if(e)return e.subscribe(n=>r.current(n))},[e])}function xP(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t)){var a=t.length;for(e=0;e<a;e++)t[e]&&(r=xP(t[e]))&&(n&&(n+=" "),n+=r)}else for(r in t)t[r]&&(n&&(n+=" "),n+=r);return n}function bP(){for(var t,e,r=0,n="",a=arguments.length;r<a;r++)(t=arguments[r])&&(e=xP(t))&&(n&&(n+=" "),n+=e);return n}const Wx="-",pL=t=>{const e=mL(t),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=t;return{getClassGroupId:s=>{const o=s.split(Wx);return o[0]===""&&o.length!==1&&o.shift(),wP(o,e)||gL(s)},getConflictingClassGroupIds:(s,o)=>{const l=r[s]||[];return o&&n[s]?[...l,...n[s]]:l}}},wP=(t,e)=>{var s;if(t.length===0)return e.classGroupId;const r=t[0],n=e.nextPart.get(r),a=n?wP(t.slice(1),n):void 0;if(a)return a;if(e.validators.length===0)return;const i=t.join(Wx);return(s=e.validators.find(({validator:o})=>o(i)))==null?void 0:s.classGroupId},Qb=/^\[(.+)\]$/,gL=t=>{if(Qb.test(t)){const e=Qb.exec(t)[1],r=e==null?void 0:e.substring(0,e.indexOf(":"));if(r)return"arbitrary.."+r}},mL=t=>{const{theme:e,prefix:r}=t,n={nextPart:new Map,validators:[]};return xL(Object.entries(t.classGroups),r).forEach(([i,s])=>{_0(s,n,i,e)}),n},_0=(t,e,r,n)=>{t.forEach(a=>{if(typeof a=="string"){const i=a===""?e:Jb(e,a);i.classGroupId=r;return}if(typeof a=="function"){if(yL(a)){_0(a(n),e,r,n);return}e.validators.push({validator:a,classGroupId:r});return}Object.entries(a).forEach(([i,s])=>{_0(s,Jb(e,i),r,n)})})},Jb=(t,e)=>{let r=t;return e.split(Wx).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},yL=t=>t.isThemeGetter,xL=(t,e)=>e?t.map(([r,n])=>{const a=n.map(i=>typeof i=="string"?e+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([s,o])=>[e+s,o])):i);return[r,a]}):t,bL=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,r=new Map,n=new Map;const a=(i,s)=>{r.set(i,s),e++,e>t&&(e=0,n=r,r=new Map)};return{get(i){let s=r.get(i);if(s!==void 0)return s;if((s=n.get(i))!==void 0)return a(i,s),s},set(i,s){r.has(i)?r.set(i,s):a(i,s)}}},SP="!",wL=t=>{const{separator:e,experimentalParseClassName:r}=t,n=e.length===1,a=e[0],i=e.length,s=o=>{const l=[];let u=0,c=0,d;for(let b=0;b<o.length;b++){let m=o[b];if(u===0){if(m===a&&(n||o.slice(b,b+i)===e)){l.push(o.slice(c,b)),c=b+i;continue}if(m==="/"){d=b;continue}}m==="["?u++:m==="]"&&u--}const f=l.length===0?o:o.substring(c),h=f.startsWith(SP),v=h?f.substring(1):f,x=d&&d>c?d-c:void 0;return{modifiers:l,hasImportantModifier:h,baseClassName:v,maybePostfixModifierPosition:x}};return r?o=>r({className:o,parseClassName:s}):s},SL=t=>{if(t.length<=1)return t;const e=[];let r=[];return t.forEach(n=>{n[0]==="["?(e.push(...r.sort(),n),r=[]):r.push(n)}),e.push(...r.sort()),e},EL=t=>({cache:bL(t.cacheSize),parseClassName:wL(t),...pL(t)}),CL=/\s+/,kL=(t,e)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:a}=e,i=[],s=t.trim().split(CL);let o="";for(let l=s.length-1;l>=0;l-=1){const u=s[l],{modifiers:c,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:h}=r(u);let v=!!h,x=n(v?f.substring(0,h):f);if(!x){if(!v){o=u+(o.length>0?" "+o:o);continue}if(x=n(f),!x){o=u+(o.length>0?" "+o:o);continue}v=!1}const b=SL(c).join(":"),m=d?b+SP:b,p=m+x;if(i.includes(p))continue;i.push(p);const y=a(x,v);for(let w=0;w<y.length;++w){const E=y[w];i.push(m+E)}o=u+(o.length>0?" "+o:o)}return o};function TL(){let t=0,e,r,n="";for(;t<arguments.length;)(e=arguments[t++])&&(r=EP(e))&&(n&&(n+=" "),n+=r);return n}const EP=t=>{if(typeof t=="string")return t;let e,r="";for(let n=0;n<t.length;n++)t[n]&&(e=EP(t[n]))&&(r&&(r+=" "),r+=e);return r};function _L(t,...e){let r,n,a,i=s;function s(l){const u=e.reduce((c,d)=>d(c),t());return r=EL(u),n=r.cache.get,a=r.cache.set,i=o,o(l)}function o(l){const u=n(l);if(u)return u;const c=kL(l,r);return a(l,c),c}return function(){return i(TL.apply(null,arguments))}}const at=t=>{const e=r=>r[t]||[];return e.isThemeGetter=!0,e},CP=/^\[(?:([a-z-]+):)?(.+)\]$/i,NL=/^\d+\/\d+$/,RL=new Set(["px","full","screen"]),PL=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,AL=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,jL=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,IL=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ML=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,En=t=>Wi(t)||RL.has(t)||NL.test(t),Gn=t=>fs(t,"length",zL),Wi=t=>!!t&&!Number.isNaN(Number(t)),Ld=t=>fs(t,"number",Wi),Ds=t=>!!t&&Number.isInteger(Number(t)),DL=t=>t.endsWith("%")&&Wi(t.slice(0,-1)),Ae=t=>CP.test(t),Hn=t=>PL.test(t),LL=new Set(["length","size","percentage"]),BL=t=>fs(t,LL,kP),OL=t=>fs(t,"position",kP),qL=new Set(["image","url"]),FL=t=>fs(t,qL,UL),$L=t=>fs(t,"",VL),Ls=()=>!0,fs=(t,e,r)=>{const n=CP.exec(t);return n?n[1]?typeof e=="string"?n[1]===e:e.has(n[1]):r(n[2]):!1},zL=t=>AL.test(t)&&!jL.test(t),kP=()=>!1,VL=t=>IL.test(t),UL=t=>ML.test(t),GL=()=>{const t=at("colors"),e=at("spacing"),r=at("blur"),n=at("brightness"),a=at("borderColor"),i=at("borderRadius"),s=at("borderSpacing"),o=at("borderWidth"),l=at("contrast"),u=at("grayscale"),c=at("hueRotate"),d=at("invert"),f=at("gap"),h=at("gradientColorStops"),v=at("gradientColorStopPositions"),x=at("inset"),b=at("margin"),m=at("opacity"),p=at("padding"),y=at("saturate"),w=at("scale"),E=at("sepia"),S=at("skew"),C=at("space"),k=at("translate"),T=()=>["auto","contain","none"],_=()=>["auto","hidden","clip","visible","scroll"],N=()=>["auto",Ae,e],P=()=>[Ae,e],R=()=>["",En,Gn],I=()=>["auto",Wi,Ae],M=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],D=()=>["solid","dashed","dotted","double","none"],L=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],j=()=>["start","end","center","between","around","evenly","stretch"],F=()=>["","0",Ae],O=()=>["auto","avoid","all","avoid-page","page","left","right","column"],B=()=>[Wi,Ae];return{cacheSize:500,separator:":",theme:{colors:[Ls],spacing:[En,Gn],blur:["none","",Hn,Ae],brightness:B(),borderColor:[t],borderRadius:["none","","full",Hn,Ae],borderSpacing:P(),borderWidth:R(),contrast:B(),grayscale:F(),hueRotate:B(),invert:F(),gap:P(),gradientColorStops:[t],gradientColorStopPositions:[DL,Gn],inset:N(),margin:N(),opacity:B(),padding:P(),saturate:B(),scale:B(),sepia:F(),skew:B(),space:P(),translate:P()},classGroups:{aspect:[{aspect:["auto","square","video",Ae]}],container:["container"],columns:[{columns:[Hn]}],"break-after":[{"break-after":O()}],"break-before":[{"break-before":O()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...M(),Ae]}],overflow:[{overflow:_()}],"overflow-x":[{"overflow-x":_()}],"overflow-y":[{"overflow-y":_()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[x]}],"inset-x":[{"inset-x":[x]}],"inset-y":[{"inset-y":[x]}],start:[{start:[x]}],end:[{end:[x]}],top:[{top:[x]}],right:[{right:[x]}],bottom:[{bottom:[x]}],left:[{left:[x]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Ds,Ae]}],basis:[{basis:N()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Ae]}],grow:[{grow:F()}],shrink:[{shrink:F()}],order:[{order:["first","last","none",Ds,Ae]}],"grid-cols":[{"grid-cols":[Ls]}],"col-start-end":[{col:["auto",{span:["full",Ds,Ae]},Ae]}],"col-start":[{"col-start":I()}],"col-end":[{"col-end":I()}],"grid-rows":[{"grid-rows":[Ls]}],"row-start-end":[{row:["auto",{span:[Ds,Ae]},Ae]}],"row-start":[{"row-start":I()}],"row-end":[{"row-end":I()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Ae]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Ae]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...j()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...j(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...j(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[p]}],px:[{px:[p]}],py:[{py:[p]}],ps:[{ps:[p]}],pe:[{pe:[p]}],pt:[{pt:[p]}],pr:[{pr:[p]}],pb:[{pb:[p]}],pl:[{pl:[p]}],m:[{m:[b]}],mx:[{mx:[b]}],my:[{my:[b]}],ms:[{ms:[b]}],me:[{me:[b]}],mt:[{mt:[b]}],mr:[{mr:[b]}],mb:[{mb:[b]}],ml:[{ml:[b]}],"space-x":[{"space-x":[C]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[C]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Ae,e]}],"min-w":[{"min-w":[Ae,e,"min","max","fit"]}],"max-w":[{"max-w":[Ae,e,"none","full","min","max","fit","prose",{screen:[Hn]},Hn]}],h:[{h:[Ae,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Ae,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Ae,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Ae,e,"auto","min","max","fit"]}],"font-size":[{text:["base",Hn,Gn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Ld]}],"font-family":[{font:[Ls]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Ae]}],"line-clamp":[{"line-clamp":["none",Wi,Ld]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",En,Ae]}],"list-image":[{"list-image":["none",Ae]}],"list-style-type":[{list:["none","disc","decimal",Ae]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[t]}],"placeholder-opacity":[{"placeholder-opacity":[m]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[t]}],"text-opacity":[{"text-opacity":[m]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...D(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",En,Gn]}],"underline-offset":[{"underline-offset":["auto",En,Ae]}],"text-decoration-color":[{decoration:[t]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:P()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ae]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ae]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[m]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...M(),OL]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",BL]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},FL]}],"bg-color":[{bg:[t]}],"gradient-from-pos":[{from:[v]}],"gradient-via-pos":[{via:[v]}],"gradient-to-pos":[{to:[v]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[o]}],"border-w-x":[{"border-x":[o]}],"border-w-y":[{"border-y":[o]}],"border-w-s":[{"border-s":[o]}],"border-w-e":[{"border-e":[o]}],"border-w-t":[{"border-t":[o]}],"border-w-r":[{"border-r":[o]}],"border-w-b":[{"border-b":[o]}],"border-w-l":[{"border-l":[o]}],"border-opacity":[{"border-opacity":[m]}],"border-style":[{border:[...D(),"hidden"]}],"divide-x":[{"divide-x":[o]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[o]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[m]}],"divide-style":[{divide:D()}],"border-color":[{border:[a]}],"border-color-x":[{"border-x":[a]}],"border-color-y":[{"border-y":[a]}],"border-color-s":[{"border-s":[a]}],"border-color-e":[{"border-e":[a]}],"border-color-t":[{"border-t":[a]}],"border-color-r":[{"border-r":[a]}],"border-color-b":[{"border-b":[a]}],"border-color-l":[{"border-l":[a]}],"divide-color":[{divide:[a]}],"outline-style":[{outline:["",...D()]}],"outline-offset":[{"outline-offset":[En,Ae]}],"outline-w":[{outline:[En,Gn]}],"outline-color":[{outline:[t]}],"ring-w":[{ring:R()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[t]}],"ring-opacity":[{"ring-opacity":[m]}],"ring-offset-w":[{"ring-offset":[En,Gn]}],"ring-offset-color":[{"ring-offset":[t]}],shadow:[{shadow:["","inner","none",Hn,$L]}],"shadow-color":[{shadow:[Ls]}],opacity:[{opacity:[m]}],"mix-blend":[{"mix-blend":[...L(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":L()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Hn,Ae]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[c]}],invert:[{invert:[d]}],saturate:[{saturate:[y]}],sepia:[{sepia:[E]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[c]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[m]}],"backdrop-saturate":[{"backdrop-saturate":[y]}],"backdrop-sepia":[{"backdrop-sepia":[E]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Ae]}],duration:[{duration:B()}],ease:[{ease:["linear","in","out","in-out",Ae]}],delay:[{delay:B()}],animate:[{animate:["none","spin","ping","pulse","bounce",Ae]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[w]}],"scale-x":[{"scale-x":[w]}],"scale-y":[{"scale-y":[w]}],rotate:[{rotate:[Ds,Ae]}],"translate-x":[{"translate-x":[k]}],"translate-y":[{"translate-y":[k]}],"skew-x":[{"skew-x":[S]}],"skew-y":[{"skew-y":[S]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Ae]}],accent:[{accent:["auto",t]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ae]}],"caret-color":[{caret:[t]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":P()}],"scroll-mx":[{"scroll-mx":P()}],"scroll-my":[{"scroll-my":P()}],"scroll-ms":[{"scroll-ms":P()}],"scroll-me":[{"scroll-me":P()}],"scroll-mt":[{"scroll-mt":P()}],"scroll-mr":[{"scroll-mr":P()}],"scroll-mb":[{"scroll-mb":P()}],"scroll-ml":[{"scroll-ml":P()}],"scroll-p":[{"scroll-p":P()}],"scroll-px":[{"scroll-px":P()}],"scroll-py":[{"scroll-py":P()}],"scroll-ps":[{"scroll-ps":P()}],"scroll-pe":[{"scroll-pe":P()}],"scroll-pt":[{"scroll-pt":P()}],"scroll-pr":[{"scroll-pr":P()}],"scroll-pb":[{"scroll-pb":P()}],"scroll-pl":[{"scroll-pl":P()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ae]}],fill:[{fill:[t,"none"]}],"stroke-w":[{stroke:[En,Gn,Ld]}],stroke:[{stroke:[t,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},HL=_L(GL);function qe(...t){return HL(bP(t))}function WL({children:t}){const e=hL();return g.jsxs("div",{className:"min-h-screen",children:[g.jsxs("header",{className:"sticky top-0 z-10 flex items-center gap-3 sm:gap-4 bg-bg-elev px-3 sm:px-5 py-[10px] border-b border-border",children:[g.jsx("a",{href:"#/",className:"font-mono font-semibold tracking-wide text-fg",children:"manifold"}),g.jsxs("nav",{className:"flex gap-3 sm:gap-4 flex-1",children:[g.jsx("a",{href:"#/",className:"text-fg-dim py-1 hover:no-underline hover:text-fg",children:"runs"}),g.jsx("a",{href:"#/pipelines",className:"text-fg-dim py-1 hover:no-underline hover:text-fg",children:"pipelines"}),g.jsx("a",{href:"#/search",className:"text-fg-dim py-1 hover:no-underline hover:text-fg",children:"search"})]}),g.jsx("div",{className:qe("font-mono text-xs",e==="live"?"text-status-green":e==="dead"?"text-status-red":"text-fg-dim"),children:e==="live"?"live":e==="dead"?"disconnected":"connecting…"})]}),g.jsx("main",{className:"max-w-[1400px] mx-auto p-3 sm:p-5",children:t})]})}const Me=Z.forwardRef(({className:t,...e},r)=>g.jsx("div",{ref:r,className:qe("bg-bg-elev border border-border rounded-md p-3 sm:p-4 mb-4",t),...e}));Me.displayName="Card";const Qe=Z.forwardRef(({className:t,...e},r)=>g.jsx("div",{ref:r,className:qe("flex items-center justify-between mb-3",t),...e}));Qe.displayName="CardHeader";const tt=Z.forwardRef(({className:t,...e},r)=>g.jsx("h3",{ref:r,className:qe("text-sm font-semibold m-0",t),...e}));tt.displayName="CardTitle";const KL=Z.forwardRef(({className:t,...e},r)=>g.jsx("div",{ref:r,className:qe("",t),...e}));KL.displayName="CardContent";const ew=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,tw=bP,TP=(t,e)=>r=>{var n;if((e==null?void 0:e.variants)==null)return tw(t,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:a,defaultVariants:i}=e,s=Object.keys(a).map(u=>{const c=r==null?void 0:r[u],d=i==null?void 0:i[u];if(c===null)return null;const f=ew(c)||ew(d);return a[u][f]}),o=r&&Object.entries(r).reduce((u,c)=>{let[d,f]=c;return f===void 0||(u[d]=f),u},{}),l=e==null||(n=e.compoundVariants)===null||n===void 0?void 0:n.reduce((u,c)=>{let{class:d,className:f,...h}=c;return Object.entries(h).every(v=>{let[x,b]=v;return Array.isArray(b)?b.includes({...i,...o}[x]):{...i,...o}[x]===b})?[...u,d,f]:u},[]);return tw(t,s,l,r==null?void 0:r.class,r==null?void 0:r.className)},YL=TP("inline-flex items-center justify-center font-mono transition-colors disabled:opacity-50 disabled:pointer-events-none",{variants:{variant:{default:"bg-bg-elev2 text-fg border border-border rounded-md px-3 py-1.5 text-xs hover:bg-bg-elev",link:"bg-transparent text-accent border-0 p-0 hover:underline",chip:"bg-transparent text-fg-dim border border-border rounded-full px-[10px] py-[3px] text-[12px] hover:bg-bg-elev2"}},defaultVariants:{variant:"default"}}),ra=Z.forwardRef(({className:t,variant:e,...r},n)=>g.jsx("button",{ref:n,className:qe(YL({variant:e}),t),...r}));ra.displayName="Button";const ei=Z.forwardRef(({className:t,...e},r)=>g.jsx("div",{className:"-mx-3 sm:-mx-4 px-3 sm:px-4 overflow-x-auto",children:g.jsx("table",{ref:r,className:qe("min-w-full border-collapse text-[13px] whitespace-nowrap",t),...e})}));ei.displayName="Table";const ti=Z.forwardRef(({className:t,...e},r)=>g.jsx("thead",{ref:r,className:qe("",t),...e}));ti.displayName="THead";const ri=Z.forwardRef(({className:t,...e},r)=>g.jsx("tbody",{ref:r,className:qe("",t),...e}));ri.displayName="TBody";const yr=Z.forwardRef(({className:t,...e},r)=>g.jsx("tr",{ref:r,className:qe("[&:not(:last-child)]:border-b border-border",t),...e}));yr.displayName="TR";const We=Z.forwardRef(({className:t,...e},r)=>g.jsx("th",{ref:r,className:qe("text-left px-[10px] py-[6px] text-fg-dim font-normal uppercase tracking-[0.4px] text-[11px] border-b border-border",t),...e}));We.displayName="TH";const He=Z.forwardRef(({className:t,...e},r)=>g.jsx("td",{ref:r,className:qe("text-left px-[10px] py-[6px]",t),...e}));He.displayName="TD";const XL=TP("inline-block px-2 py-[2px] rounded-[10px] font-mono text-[11px] border border-transparent leading-snug whitespace-nowrap",{variants:{variant:{default:"bg-bg-elev2 text-fg-dim border-border",running:"bg-status-green/15 text-status-green border-status-green/40",waiting:"bg-status-amber/15 text-status-amber border-status-amber/40",blocked:"bg-status-amber/15 text-status-amber border-status-amber/40",succeeded:"bg-status-blue/15 text-[#79b8ff] border-status-blue/40",failed:"bg-status-red/15 text-status-red border-status-red/40",cancelled:"bg-status-grey/15 text-status-grey border-status-grey/40",kind:"bg-bg-elev2 text-fg-dim border-border",historical:"bg-status-grey/15 text-fg-dim border-border"},size:{default:"text-[11px] px-2",sm:"text-[10px] px-[6px] py-px"}},defaultVariants:{variant:"default",size:"default"}});function mn({className:t,variant:e,size:r,...n}){return g.jsx("span",{className:qe(XL({variant:e,size:r}),t),...n})}const ZL={running:"running",blocked:"blocked",succeeded:"succeeded",failed:"failed",cancelled:"cancelled",skipped:"cancelled"};function is({status:t}){const e=t&&ZL[t]||"default";return g.jsx(mn,{variant:e,children:t??"?"})}function sr(t){if(t==null)return"—";if(t<1e3)return`${t.toFixed(0)}ms`;const e=t/1e3;if(e<60)return`${e.toFixed(1)}s`;const r=e/60;return r<60?`${r.toFixed(1)}m`:`${(r/60).toFixed(1)}h`}function vn(t){if(!t)return"";const r=new Date(t).toISOString();return`${r.slice(0,10)} ${r.slice(11,19)}`}function QL(t){return t==null?"":t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/1024/1024).toFixed(1)} MB`}function Bs(t){return t==null?"—":Number.isInteger(t)?String(t):t.toFixed(1)}function JL(t){return t==null?"":t>=.7?"text-status-green":t>=.4?"text-status-amber":"text-status-red"}function Il(t,e){return e>0?`${(t/e*100).toFixed(1)}%`:"0%"}function _P({stats:t,searchScope:e}){const{total:r,succeeded:n,failed:a,cancelled:i,active:s=0,terminated:o,successRate:l,duration:u}=t,c=d=>{if(!e)return null;const f=new URLSearchParams({q:e});return d&&f.set("status",d),`#/search?${f.toString()}`};return g.jsxs("div",{className:"grid gap-3 mb-4 grid-cols-[repeat(auto-fit,minmax(150px,1fr))]",children:[g.jsxs(Os,{label:"runs",value:String(r),valueHref:c(),valueHrefTitle:"see all runs in search",children:[g.jsxs("div",{className:"flex h-1.5 rounded mt-2 bg-bg-elev2 overflow-hidden",title:`${n} succeeded · ${a} failed · ${i} cancelled · ${s} active`,children:[g.jsx("span",{className:"bg-status-blue",style:{width:Il(n,r)}}),g.jsx("span",{className:"bg-status-red",style:{width:Il(a,r)}}),g.jsx("span",{className:"bg-status-grey",style:{width:Il(i,r)}}),g.jsx("span",{className:"bg-status-green",style:{width:Il(s,r)}})]}),g.jsxs("div",{className:"text-fg-dim text-xs mt-1 font-mono",children:[g.jsx(Ml,{count:n,label:"ok",href:c("succeeded")})," · ",g.jsx(Ml,{count:a,label:"fail",href:c("failed")})," · ",g.jsx(Ml,{count:i,label:"canc",href:c("cancelled")}),s>0&&g.jsxs(g.Fragment,{children:[" · ",g.jsx(Ml,{count:s,label:"active",href:c("running")})]})]})]}),g.jsx(Os,{label:"success rate",value:l!=null?`${(l*100).toFixed(1)}%`:"—",valueClassName:JL(l),sub:`${n} / ${o} terminated`}),g.jsx(Os,{label:"median duration",value:sr(u.p50Ms),sub:`p95 ${sr(u.p95Ms)} · n=${u.n}`}),g.jsx(Os,{label:"mean duration",value:sr(u.meanMs),sub:`across ${u.n} succeeded`}),t.revision&&g.jsx(Os,{label:"median revisions",value:t.revision.p50!=null?String(t.revision.p50):"—",sub:`p95 ${t.revision.p95??"—"} · n=${t.revision.n}`})]})}function Os({label:t,value:e,sub:r,children:n,valueClassName:a,valueHref:i,valueHrefTitle:s}){const o=g.jsx("span",{className:qe("font-mono text-2xl font-semibold leading-tight mt-0.5 inline-block",a),children:e});return g.jsxs("div",{className:"bg-bg-elev border border-border rounded-md px-[14px] py-3",children:[g.jsx("div",{className:"text-fg-dim text-[11px] uppercase tracking-[0.5px]",children:t}),g.jsx("div",{children:i?g.jsx("a",{href:i,title:s,className:"hover:bg-bg-elev2 rounded px-1 -mx-1 transition-colors",children:o}):o}),n,r&&g.jsx("div",{className:"text-fg-dim text-xs font-mono mt-0.5",children:r})]})}function Ml({count:t,label:e,href:r}){const n=g.jsxs(g.Fragment,{children:[g.jsx("span",{className:"text-fg",children:t})," ",e]});return r?g.jsx("a",{href:r,title:`see ${e==="ok"?"succeeded":e==="canc"?"cancelled":e==="active"?"running":e} runs in search`,className:"hover:bg-bg-elev2 rounded px-0.5 -mx-0.5 transition-colors",children:n}):g.jsx("span",{children:n})}function Yo(t,e){Z.useEffect(()=>{function r(n){const a=t.current,i=n.target;!a||!(i instanceof Node)||a.contains(i)||e()}return document.addEventListener("mousedown",r),document.addEventListener("touchstart",r),()=>{document.removeEventListener("mousedown",r),document.removeEventListener("touchstart",r)}},[t,e])}function Xo(t,e,r=1.5){const n=new Set,a=new Map;if(!t||t.length<3)return{flagged:n,ratios:a};if(t.reduce((s,o)=>s+(e(o)>0?1:0),0)<3)return{flagged:n,ratios:a};for(const s of t){const o=e(s);if(o<=0)continue;const l=t.filter(d=>d.day!==s.day).map(e).filter(d=>d>0);if(l.length<2)continue;const u=l.reduce((d,f)=>d+f,0)/l.length;if(u<=0)continue;const c=o/u;c>r&&(n.add(s.day),a.set(s.day,c))}return{flagged:n,ratios:a}}function eB({buckets:t,pinned:e,onPinChange:r}){var f,h;const[n,a]=Z.useState(null),i=e!==void 0?e:n,s=v=>{e===void 0&&a(v),r==null||r(v)},o=Z.useRef(null);Yo(o,()=>s(null));const l=Z.useMemo(()=>Xo(t??[],v=>v.total),[t]);if(!(t!=null&&t.length))return g.jsx("div",{className:"italic text-fg-dim py-4",children:"no daily data"});const u=Math.max(1,...t.map(v=>v.total)),c=i?t.find(v=>v.day===i):null,d=c?l.ratios.get(c.day):void 0;return g.jsxs("div",{ref:o,children:[l.flagged.size>0&&g.jsxs("div",{className:"text-[9px] text-status-amber font-mono mb-1",title:"amber bars (inner success fill) exceed the other days' mean by 1.5×+ — outliers in the window",children:["▲ ",l.flagged.size," outlier",l.flagged.size===1?"":"s"]}),g.jsx("div",{className:"text-right text-[10px] text-fg font-mono mb-1 min-h-[14px]",children:c&&g.jsxs("span",{children:[c.day,": ",c.total," runs (",c.succeeded," ok · ",c.failed," fail · ",c.cancelled," canc)",d!=null&&g.jsxs("span",{className:"text-status-amber",children:[" · ",d.toFixed(1),"× mean"]})]})}),g.jsx("div",{className:"flex gap-[2px] h-12",children:t.map(v=>{const x=Math.round(v.total/u*100),b=v.total>0?v.succeeded/v.total:0,m=l.flagged.has(v.day),p=l.ratios.get(v.day),y=m&&p!=null?`${v.day}: ${v.total} runs (${v.succeeded} ok) · ${p.toFixed(1)}× mean`:`${v.day}: ${v.total} runs (${v.succeeded} ok)`,w=i===v.day,E=i!==null&&!w,S=m?"bg-status-amber":"bg-status-blue";return g.jsx("button",{type:"button",onClick:()=>s(w?null:v.day),className:"flex-1 min-w-[6px] relative h-full",title:y,children:g.jsx("span",{className:`absolute left-0 right-0 bottom-0 bg-bg-elev2 rounded-[1px] ${E?"opacity-65":""}`,style:{height:`${x}%`},children:g.jsx("span",{className:`absolute left-0 right-0 bottom-0 rounded-[1px] ${S}`,style:{height:`${Math.round(b*100)}%`}})})},v.day)})}),g.jsxs("div",{className:"flex justify-between mt-1.5 text-fg-dim font-mono text-[11px]",children:[g.jsx("span",{children:(f=t[0])==null?void 0:f.day}),g.jsxs("span",{children:[t.length," day",t.length===1?"":"s"]}),g.jsx("span",{children:(h=t[t.length-1])==null?void 0:h.day})]})]})}const Kx="gf-ignored-clusters-v1";function rw(){try{const t=localStorage.getItem(Kx);if(!t)return{};const e=JSON.parse(t);return e&&typeof e=="object"?e:{}}catch{return{}}}function nw(t){try{localStorage.setItem(Kx,JSON.stringify(t))}catch{}}function aw(t,e){return`${t??"?"}::${e}`}function tB(){const[t,e]=Z.useState(()=>rw());Z.useEffect(()=>{function a(i){i.key===Kx&&e(rw())}return window.addEventListener("storage",a),()=>window.removeEventListener("storage",a)},[]);const r=Z.useCallback(a=>{e(i=>{const s={...i,[a]:{at:Date.now()}};return nw(s),s})},[]),n=Z.useCallback(a=>{e(i=>{const s={...i};return delete s[a],nw(s),s})},[]);return{ignored:t,ignore:r,unignore:n}}const Dl=864e5;function Bd(t){if(!t)return{text:"text-fg-dim/60",label:"no data"};const e=Date.now()-t;return e<Dl?{text:"text-status-red",label:"today"}:e<7*Dl?{text:"text-status-amber",label:`${Math.floor(e/Dl)}d ago`}:{text:"text-fg-dim/60",label:`${Math.floor(e/Dl)}d ago`}}function rB({perDay:t}){if(!(t!=null&&t.length))return null;const e=Math.max(1,...t.map(r=>r.count));return g.jsx("span",{className:"inline-flex items-end gap-[1px] h-3 align-middle","aria-hidden":!0,children:t.map(r=>{const n=r.count>0?Math.max(20,Math.round(r.count/e*100)):8;return g.jsx("span",{className:`w-[3px] rounded-[1px] ${r.count>0?"bg-status-amber":"bg-bg-elev2"}`,style:{height:`${n}%`},title:`${r.day}: ${r.count}`},r.day)})})}function NP({entries:t,limit:e=8,showPipeline:r=!1}){const[n,a]=Z.useState("impact"),[i,s]=Z.useState(null),{ignored:o,ignore:l,unignore:u}=tB(),[c,d]=Z.useState(!1);if(!(t!=null&&t.length))return g.jsx("div",{className:"italic text-fg-dim py-4",children:"none"});const f=t.some(S=>(S.impactMs??0)>0),h=t.some(S=>(S.lastFailedAt??0)>0),v=n==="count"||!f?[...t].sort((S,C)=>C.count-S.count):n==="recency"?[...t].sort((S,C)=>(C.lastFailedAt??0)-(S.lastFailedAt??0)):t,x=S=>aw(S.pipelineId,S.key)in o,b=v.filter(x).length,p=(c?v.filter(x):v.filter(S=>!x(S))).slice(0,e),y=S=>n==="count"?S.count:S.impactMs??S.count,w=Math.max(...p.map(y)),E=(()=>{if(!r)return[{pipelineId:null,rows:p}];const S=new Map,C=[];for(const k of p){const T=k.pipelineId??"?";S.has(T)||(S.set(T,[]),C.push(T)),S.get(T).push(k)}return C.map(k=>({pipelineId:k,rows:S.get(k)}))})();return g.jsxs("div",{children:[f&&g.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[g.jsxs("div",{className:"text-xs text-fg-dim",children:["failure clusters — ",n==="impact"?"by impact":n==="count"?"by count":"most recent"]}),g.jsxs("div",{className:"ml-auto inline-flex rounded border border-border overflow-hidden text-[10px] font-mono",children:[g.jsx("button",{type:"button",onClick:()=>a("impact"),className:n==="impact"?"px-2 py-0.5 bg-status-blue/20 text-fg":"px-2 py-0.5 text-fg-dim hover:text-fg",children:"impact"}),g.jsx("button",{type:"button",onClick:()=>a("count"),className:n==="count"?"px-2 py-0.5 border-l border-border bg-status-blue/20 text-fg":"px-2 py-0.5 border-l border-border text-fg-dim hover:text-fg",children:"count"}),h&&g.jsx("button",{type:"button",onClick:()=>a("recency"),className:n==="recency"?"px-2 py-0.5 border-l border-border bg-status-blue/20 text-fg":"px-2 py-0.5 border-l border-border text-fg-dim hover:text-fg",children:"recent"})]})]}),E.map((S,C)=>g.jsxs("div",{className:r?"border border-border rounded mb-2 last:mb-0":"",children:[r&&S.pipelineId&&(()=>{const k=S.rows.reduce((P,R)=>P+R.count,0),T=S.rows.reduce((P,R)=>{var I;return P+(((I=R.errors)==null?void 0:I.length)??0)},0),_=Math.max(0,...S.rows.map(P=>P.lastFailedAt??0)),N=Bd(_||null);return g.jsxs("div",{className:"flex items-center gap-2 px-2 py-1 border-b border-border/60 bg-bg-elev2/30",children:[g.jsx("span",{className:"font-mono text-[11px] text-fg truncate",children:S.pipelineId}),g.jsx("span",{className:`text-[10px] ${N.text}`,children:N.label}),g.jsxs("span",{className:"ml-auto text-[10px] text-fg-dim tabular-nums",children:[S.rows.length," step",S.rows.length===1?"":"s"," ·"," ",k," occurrence",k===1?"":"s",T>0&&g.jsxs(g.Fragment,{children:[" · ",T," distinct error",T===1?"":"s"]})]})]})})(),g.jsx("div",{className:`grid grid-cols-[auto_1fr_auto_auto_auto] items-center gap-x-2.5 gap-y-1.5 font-mono text-xs ${r?"px-2 py-1.5":""}`,children:S.rows.map((k,T)=>{var R,I;const _=Bd(k.lastFailedAt),N=`${k.pipelineId??""}::${k.key}::${C}::${T}`,P=i===N;return g.jsxs(Z.Fragment,{children:[g.jsxs("button",{type:"button",onClick:()=>s(P?null:N),"aria-expanded":P,className:"contents text-left group",children:[g.jsx("span",{className:"min-w-0 max-w-[260px] group-hover:bg-bg-elev2/40 rounded-l-[2px] pl-0.5",title:`${r&&k.pipelineId?`${k.pipelineId} · `:""}${k.key}`,children:g.jsxs("span",{className:"flex items-center gap-1 whitespace-nowrap",children:[g.jsx("span",{className:`truncate ${_.text}`,children:k.key}),g.jsx("span",{className:"text-[10px] text-fg-dim shrink-0",children:P?"▾":"▸"})]})}),g.jsx("span",{className:"relative h-3 bg-bg-elev2 rounded-[2px] overflow-hidden group-hover:bg-bg-elev2/60",children:g.jsx("span",{className:"absolute top-0 left-0 bottom-0 bg-status-amber opacity-75",style:{width:`${(y(k)/Math.max(1,w)*100).toFixed(1)}%`}})}),g.jsx("span",{className:"px-1 group-hover:bg-bg-elev2/40",children:k.perDay&&k.perDay.length>0?g.jsx(rB,{perDay:k.perDay}):null}),g.jsx("span",{className:`text-right whitespace-nowrap text-[10px] ${_.text} group-hover:bg-bg-elev2/40`,title:k.lastFailedAt?new Date(k.lastFailedAt).toISOString():"",children:_.label}),g.jsx("span",{className:"text-right text-fg-dim whitespace-nowrap tabular-nums pr-0.5 group-hover:bg-bg-elev2/40 rounded-r-[2px]",title:k.p50BlockMs!=null?`${k.count} × ${sr(k.p50BlockMs)} median block`:`${k.count} occurrences`,children:n==="count"?k.count:k.p50BlockMs!=null?`${k.count}×${sr(k.p50BlockMs)}`:`${k.count}`})]}),P&&g.jsxs("div",{className:"col-span-5 pl-1 pr-1 pt-0.5 pb-1.5 text-[10px] text-fg-dim space-y-2",children:[k.errors&&k.errors.length>0?k.errors.map((M,D)=>{const L=Bd(M.lastFailedAt);return g.jsxs("div",{className:"border-l border-border pl-2",children:[g.jsxs("div",{className:"flex items-baseline gap-2 mb-0.5",children:[g.jsxs("span",{className:"tabular-nums text-fg",children:[M.count,"×"]}),g.jsx("span",{className:`text-[10px] ${L.text}`,children:L.label}),g.jsx("span",{className:"text-fg-dim truncate",children:M.signature})]}),M.exemplarMessage&&M.exemplarMessage!==M.signature&&g.jsx("pre",{className:"font-mono text-[10px] whitespace-pre-wrap break-words bg-bg-elev2 border border-border rounded px-1.5 py-1 text-fg-dim max-h-40 overflow-auto",children:M.exemplarMessage}),M.recentRuns&&M.recentRuns.length>0&&g.jsxs("div",{className:"flex flex-wrap gap-1.5 mt-1",children:[g.jsx("span",{className:"text-fg-dim",children:"recent:"}),M.recentRuns.map(j=>g.jsx("a",{href:`#/runs/${j.flowId}`,onClick:F=>F.stopPropagation(),className:"font-mono text-fg-dim hover:text-fg underline-offset-2 hover:underline",title:j.at?new Date(j.at).toISOString():"",children:j.flowId.slice(0,8)},j.flowId))]})]},D)}):g.jsx("p",{className:"italic",children:"no error messages recorded"}),g.jsxs("div",{className:"flex items-center gap-2 pt-1 font-mono text-fg-dim/80",children:[g.jsxs("span",{children:[k.count," total occurrence",k.count===1?"":"s"," across ",((R=k.errors)==null?void 0:R.length)??0," distinct error",(((I=k.errors)==null?void 0:I.length)??0)===1?"":"s",k.p50BlockMs!=null&&g.jsxs(g.Fragment,{children:[" · median block ",sr(k.p50BlockMs)]}),k.impactMs!=null&&k.impactMs>0&&g.jsxs(g.Fragment,{children:[" · total impact ",sr(k.impactMs)]})]}),(()=>{const M=aw(k.pipelineId,k.key),D=M in o;return g.jsx("button",{type:"button",onClick:L=>{L.stopPropagation(),D?u(M):l(M)},className:"ml-auto text-[10px] text-fg-dim hover:text-fg underline-offset-2 hover:underline",title:D?"stop ignoring — bring this cluster back into the active queue":"ignore this cluster — hide from the active queue until unignored",children:D?"unignore":"ignore cluster"})})()]})]})]},N)})})]},S.pipelineId??`g${C}`)),b>0&&g.jsx("div",{className:"mt-2 text-[10px] font-mono text-fg-dim",children:c?g.jsxs(g.Fragment,{children:["showing ",b," ignored cluster",b===1?"":"s"," · ",g.jsx("button",{type:"button",onClick:()=>d(!1),className:"underline-offset-2 hover:underline hover:text-fg",children:"back to active"})]}):g.jsxs(g.Fragment,{children:[b," cluster",b===1?"":"s"," ignored · ",g.jsx("button",{type:"button",onClick:()=>d(!0),className:"underline-offset-2 hover:underline hover:text-fg",children:"show"})]})})]})}const iw="gf:cost-by-pipeline:show-historical";function nB({entries:t,pipelines:e}){const[r,n]=Z.useState("cost"),[a,i]=Z.useState(null),[s,o]=Z.useState(()=>typeof localStorage>"u"?!1:localStorage.getItem(iw)==="1");Z.useEffect(()=>{typeof localStorage>"u"||localStorage.setItem(iw,s?"1":"0")},[s]);const l=new Map(e.map(x=>[x.id,x])),u=t.filter(x=>{var b;return(b=l.get(x.pipelineId))!=null&&b.historical?!0:x.total>0||(x.p50Ms??0)>0}),c=u.filter(x=>{var b;return(b=l.get(x.pipelineId))==null?void 0:b.historical}).length,d=s?u:u.filter(x=>{var b;return!((b=l.get(x.pipelineId))!=null&&b.historical)});if(d.length===0&&c===0)return g.jsx("div",{className:"italic text-fg-dim py-2 text-xs",children:"no pipelines in window"});const f=d.reduce((x,b)=>x+b.total,0),h=Math.max(...r==="cost"?d.map(x=>x.total):d.map(x=>x.p50Ms??0)),v=d.reduce((x,b)=>x+(b.p50Ms??0)*b.runs,0);return g.jsxs("div",{children:[g.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[g.jsxs("div",{className:"text-xs text-fg-dim",children:["by pipeline — ",r==="cost"?"spend":"typical-run latency"]}),g.jsxs("div",{className:"ml-auto inline-flex items-center gap-2",children:[c>0&&g.jsx("button",{type:"button",onClick:()=>o(x=>!x),className:"text-[10px] font-mono text-fg-dim hover:text-fg underline-offset-2 hover:underline",title:s?`hide historical pipelines (source removed but runs in DB) — ${c} hidden`:`show ${c} historical pipeline${c===1?"":"s"} — source file removed, kept for run-history context`,children:s?`hide historical (${c})`:`+${c} historical`}),g.jsxs("div",{className:"inline-flex rounded border border-border overflow-hidden text-[10px] font-mono",children:[g.jsx("button",{onClick:()=>n("cost"),className:qe("px-2 py-0.5",r==="cost"?"bg-status-blue/20 text-fg":"text-fg-dim hover:text-fg"),children:"$"}),g.jsx("button",{onClick:()=>n("time"),className:qe("px-2 py-0.5 border-l border-border",r==="time"?"bg-status-blue/20 text-fg":"text-fg-dim hover:text-fg"),children:"time"})]})]})]}),g.jsx("div",{className:"grid grid-cols-[auto_1fr_auto_auto] items-center gap-x-2 gap-y-1",children:d.map(x=>{var k;const b=a===x.pipelineId,m=sr(x.p50Ms),p=sr(x.p95Ms),y=r==="cost"?x.total:x.p50Ms??0,w=h>0?Math.round(y/h*100):0,E=r==="cost"?f>0?x.total/f*100:0:v>0?(x.p50Ms??0)*x.runs/v*100:0,S=r==="cost"?`$${x.total.toFixed(2)}`:m,C=((k=l.get(x.pipelineId))==null?void 0:k.historical)===!0;return g.jsxs(Z.Fragment,{children:[g.jsxs("button",{type:"button",onClick:()=>i(b?null:x.pipelineId),"aria-expanded":b,className:"contents text-left group",title:`${x.pipelineId} · ${x.runs} run${x.runs===1?"":"s"} · $${x.total.toFixed(4)} · p50 ${m} · p95 ${p}`,children:[g.jsxs("span",{className:qe("flex items-center gap-1.5 min-w-0 text-xs group-hover:bg-bg-elev2/40 rounded-l-[2px] pl-0.5",C&&"opacity-65 italic"),children:[g.jsx("a",{href:`#/pipelines/${encodeURIComponent(x.pipelineId)}`,onClick:T=>T.stopPropagation(),className:"font-mono truncate hover:underline underline-offset-2",children:x.pipelineId}),g.jsx("span",{className:"text-[10px] text-fg-dim shrink-0",children:b?"▾":"▸"}),C&&g.jsx("span",{className:"bg-bg-elev2 text-fg-dim border border-border rounded-[10px] px-1.5 py-px font-mono text-[9px] shrink-0",title:"pipeline source no longer on disk — kept for historical run context",children:"historical"})]}),g.jsx("span",{className:"relative h-2 w-full bg-bg-elev2 rounded-[1px]",children:g.jsx("span",{className:"absolute left-0 top-0 bottom-0 bg-status-blue rounded-[1px]",style:{width:`${w}%`}})}),g.jsx("span",{className:"font-mono text-fg-dim tabular-nums text-right whitespace-nowrap text-xs group-hover:bg-bg-elev2/40",children:S}),g.jsxs("span",{className:"font-mono text-fg-dim tabular-nums text-right whitespace-nowrap text-[10px] group-hover:bg-bg-elev2/40 rounded-r-[2px] pr-0.5",children:["(",E.toFixed(0),"%)"]})]}),b&&g.jsxs("div",{className:"col-span-4 pl-5 pr-1 pt-0.5 pb-1 text-[10px] font-mono text-fg-dim grid grid-cols-2 sm:grid-cols-4 gap-x-3 gap-y-0.5",children:[g.jsxs("span",{children:[g.jsx("span",{className:"text-fg-dim",children:"runs:"})," ",x.runs]}),g.jsxs("span",{children:[g.jsx("span",{className:"text-fg-dim",children:"succeeded:"})," ",x.succeeded]}),g.jsxs("span",{children:[g.jsx("span",{className:"text-fg-dim",children:"$ / ok:"})," ",x.costPerSuccess!=null?`$${x.costPerSuccess.toFixed(2)}`:"—"]}),g.jsxs("span",{children:[g.jsx("span",{className:"text-fg-dim",children:"$ total:"})," $",x.total.toFixed(4)]}),g.jsxs("span",{children:[g.jsx("span",{className:"text-fg-dim",children:"p50 time:"})," ",m]}),g.jsxs("span",{children:[g.jsx("span",{className:"text-fg-dim",children:"p95 time:"})," ",p]}),g.jsxs("span",{children:[g.jsx("span",{className:"text-fg-dim",children:"p50 $/run:"})," ",x.p50Cost!=null?`$${x.p50Cost.toFixed(4)}`:"—"]}),g.jsxs("span",{children:[g.jsx("span",{className:"text-fg-dim",children:"p95 $/run:"})," ",x.p95Cost!=null?`$${x.p95Cost.toFixed(4)}`:"—"]}),(r==="time"||x.total>0)&&g.jsx(aB,{perDay:x.perDay,mode:r})]})]},x.pipelineId)})}),g.jsxs("p",{className:"text-[10px] text-fg-dim mt-1",children:["columns: ",g.jsxs("span",{className:"font-mono",children:["pipeline · bar · ",r==="cost"?"$ (share of spend)":"p50 (share of typical wall time)"]})," — tap a row for full detail."]})]})}function aB({perDay:t,mode:e}){const[r,n]=Z.useState("total"),[a,i]=Z.useState(null),s=Z.useRef(null);if(Yo(s,()=>i(null)),!t||t.length===0)return g.jsx("span",{className:"col-span-2 sm:col-span-4 text-fg-dim italic",children:"no per-day samples yet"});const o=v=>e==="time"?v.p50Ms:r==="p50"?v.p50Cost:v.cost,l=Math.max(1e-4,...t.map(v=>o(v)??0)),u=a?t.find(v=>v.day===a):null,c=Xo(t,v=>o(v)??0),d=u?c.ratios.get(u.day):void 0,f=v=>e==="cost"?r==="p50"?`${v.day}: p50 $${(v.p50Cost??0).toFixed(4)} · ${v.runs} run${v.runs===1?"":"s"}`:`${v.day}: total $${v.cost.toFixed(4)} · ${v.runs} run${v.runs===1?"":"s"}`:`${v.day}: p50 ${sr(v.p50Ms??0)} · ${v.runs} run${v.runs===1?"":"s"}`,h=e==="cost"?`daily ${r==="p50"?"p50 $/run":"$ total"}`:"daily p50 latency";return g.jsxs("div",{ref:s,className:"col-span-2 sm:col-span-4 mt-1",children:[g.jsxs("div",{className:"flex items-center justify-between mb-1",children:[g.jsx("span",{className:"text-[9px] text-fg-dim font-mono",children:h}),e==="cost"&&g.jsxs("div",{className:"inline-flex rounded border border-border overflow-hidden text-[9px] font-mono",onClick:v=>v.stopPropagation(),children:[g.jsx("button",{type:"button",onClick:()=>n("total"),className:r==="total"?"px-1.5 py-px bg-status-blue/20 text-fg":"px-1.5 py-px text-fg-dim hover:text-fg",children:"total"}),g.jsx("button",{type:"button",onClick:()=>n("p50"),className:r==="p50"?"px-1.5 py-px border-l border-border bg-status-blue/20 text-fg":"px-1.5 py-px border-l border-border text-fg-dim hover:text-fg",children:"p50"})]})]}),g.jsx("div",{className:"text-right text-[9px] text-fg font-mono mb-0.5 min-h-[12px]",children:u&&g.jsxs("span",{children:[f(u),d!=null&&g.jsxs("span",{className:"text-status-amber",children:[" · ",d.toFixed(1),"× mean"]})]})}),g.jsx("div",{className:"flex gap-[2px] h-10",children:t.map(v=>{const x=o(v)??0,b=x>0?Math.max(2,Math.round(x/l*100)):2,m=a===v.day,p=a!==null&&!m,y=c.flagged.has(v.day),w=c.ratios.get(v.day),E=x>0?y?"bg-status-amber":"bg-status-blue":"bg-bg-elev2",S=y&&w!=null?`${f(v)} · ${w.toFixed(1)}× mean`:f(v);return g.jsx("button",{type:"button",onClick:C=>{C.stopPropagation(),i(m?null:v.day)},className:"flex-1 min-w-[4px] relative h-full",title:S,children:g.jsx("span",{className:`absolute bottom-0 left-0 right-0 rounded-[1px] ${E} ${p?"opacity-65":""}`,style:{height:`${b}%`}})},v.day)})}),g.jsxs("div",{className:"flex justify-between mt-1 text-[9px] text-fg-dim font-mono",children:[g.jsx("span",{children:t[0].day}),g.jsxs("span",{children:[t.length,"d"]}),g.jsx("span",{children:t[t.length-1].day})]})]})}function RP({perDay:t}){const[e,r]=Z.useState(null),n=Z.useRef(null);Yo(n,()=>r(null));const a=Z.useMemo(()=>Xo(t??[],l=>l.cost),[t]);if(!(t!=null&&t.length))return null;const i=Math.max(1e-4,...t.map(l=>l.cost)),s=e?t.find(l=>l.day===e):null,o=s?a.ratios.get(s.day):void 0;return g.jsxs("div",{ref:n,className:"border border-border rounded p-2 flex-1 flex flex-col",children:[g.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[g.jsx("div",{className:"text-xs text-fg-dim",children:"daily cost"}),a.flagged.size>0&&g.jsxs("span",{className:"text-[9px] text-status-amber font-mono",title:"amber bars exceed the other days' mean by 1.5×+ — outliers in the window",children:["▲ ",a.flagged.size," outlier",a.flagged.size===1?"":"s"]})]}),g.jsx("div",{className:"text-right text-[10px] text-fg font-mono mb-1 min-h-[14px]",children:s&&g.jsxs("span",{children:[s.day,": $",s.cost.toFixed(4)," · ",s.runs," run",s.runs===1?"":"s",o!=null&&g.jsxs("span",{className:"text-status-amber",children:[" · ",o.toFixed(1),"× mean"]})]})}),g.jsx("div",{className:"flex gap-[2px] flex-1 min-h-12",children:t.map(l=>{const u=l.cost>0?Math.max(2,Math.round(l.cost/i*100)):2,c=e===l.day,d=e!==null&&!c,f=a.flagged.has(l.day),h=a.ratios.get(l.day),v=l.cost>0?f?"bg-status-amber":"bg-status-blue":"bg-bg-elev2",x=f&&h!=null?`${l.day}: $${l.cost.toFixed(4)} · ${l.runs} run${l.runs===1?"":"s"} · ${h.toFixed(1)}× mean`:`${l.day}: $${l.cost.toFixed(4)} · ${l.runs} run${l.runs===1?"":"s"}`;return g.jsx("button",{type:"button",onClick:()=>r(c?null:l.day),className:"flex-1 min-w-[6px] relative h-full",title:x,children:g.jsx("span",{className:`absolute bottom-0 left-0 right-0 rounded-[1px] ${v} ${d?"opacity-65":""}`,style:{height:`${u}%`}})},l.day)})}),g.jsxs("div",{className:"flex justify-between mt-1.5 text-fg-dim font-mono text-[11px]",children:[g.jsx("span",{children:t[0].day}),g.jsxs("span",{children:[t.length," day",t.length===1?"":"s"]}),g.jsx("span",{children:t[t.length-1].day})]})]})}function PP({perDay:t}){const[e,r]=Z.useState("p50"),[n,a]=Z.useState(null),i=Z.useRef(null);if(Yo(i,()=>a(null)),!(t!=null&&t.length))return null;const s=d=>e==="p95"?d.p95Ms??0:d.p50Ms??0,o=Math.max(1,...t.map(s)),l=n?t.find(d=>d.day===n):null,u=Z.useMemo(()=>Xo(t,s),[t,e]),c=l?u.ratios.get(l.day):void 0;return g.jsxs("div",{ref:i,className:"border border-border rounded p-2 flex-1 flex flex-col",children:[g.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[g.jsxs("div",{className:"text-xs text-fg-dim",children:["daily ",e," run duration"]}),u.flagged.size>0&&g.jsxs("span",{className:"text-[9px] text-status-amber font-mono",title:"amber bars exceed the other days' mean by 1.5×+ — outliers in the window",children:["▲ ",u.flagged.size]}),g.jsxs("div",{className:"ml-auto inline-flex rounded border border-border overflow-hidden text-[10px] font-mono",children:[g.jsx("button",{type:"button",onClick:()=>r("p50"),className:e==="p50"?"px-2 py-0.5 bg-status-blue/20 text-fg":"px-2 py-0.5 text-fg-dim hover:text-fg",children:"p50"}),g.jsx("button",{type:"button",onClick:()=>r("p95"),className:e==="p95"?"px-2 py-0.5 border-l border-border bg-status-blue/20 text-fg":"px-2 py-0.5 border-l border-border text-fg-dim hover:text-fg",children:"p95"})]})]}),g.jsx("div",{className:"text-right text-[10px] text-fg font-mono mb-1 min-h-[14px]",children:l&&g.jsxs("span",{children:[l.day,": ",e," ",sr(s(l))," · ",l.runs," run",l.runs===1?"":"s",c!=null&&g.jsxs("span",{className:"text-status-amber",children:[" · ",c.toFixed(1),"× mean"]})]})}),g.jsx("div",{className:"flex gap-[2px] flex-1 min-h-12",children:t.map(d=>{const f=s(d),h=f>0?Math.max(2,Math.round(f/o*100)):2,v=n===d.day,x=n!==null&&!v,b=u.flagged.has(d.day),m=u.ratios.get(d.day),p=f>0?b?"bg-status-amber":"bg-status-blue":"bg-bg-elev2",y=b&&m!=null?`${d.day}: ${e} ${sr(f)} · ${d.runs} run${d.runs===1?"":"s"} · ${m.toFixed(1)}× mean`:`${d.day}: ${e} ${sr(f)} · ${d.runs} run${d.runs===1?"":"s"}`;return g.jsx("button",{type:"button",onClick:()=>a(v?null:d.day),className:"flex-1 min-w-[6px] relative h-full",title:y,children:g.jsx("span",{className:`absolute bottom-0 left-0 right-0 rounded-[1px] ${p} ${x?"opacity-65":""}`,style:{height:`${h}%`}})},d.day)})}),g.jsxs("div",{className:"flex justify-between mt-1.5 text-fg-dim font-mono text-[11px]",children:[g.jsx("span",{children:t[0].day}),g.jsxs("span",{children:[t.length," day",t.length===1?"":"s"]}),g.jsx("span",{children:t[t.length-1].day})]})]})}function ge({className:t}){return g.jsx("div",{className:qe("bg-bg-elev2 rounded animate-pulse",t)})}const Yx=864e5;function Wu({runs:t,newFailures:e,spent:r,loading:n,className:a}){return n?g.jsxs("div",{className:qe("bg-bg-elev border border-border rounded-md px-3 py-2 mt-3 flex items-center gap-4",a),children:[g.jsx(ge,{className:"h-3 w-12"}),g.jsx(ge,{className:"h-3 w-20"}),g.jsx(ge,{className:"h-3 w-32"}),g.jsx(ge,{className:"h-3 w-24"})]}):g.jsxs("div",{className:qe("bg-bg-elev border border-border rounded-md px-3 py-2 mt-3 flex items-center gap-4 flex-wrap font-mono text-xs",a),children:[g.jsx("span",{className:"text-fg-dim uppercase tracking-[0.5px] text-[11px]",children:"last 24h"}),g.jsxs("span",{className:t.total===0?"text-fg-dim":"text-fg",title:`${t.ok} ok · ${t.failed} fail · ${t.active} active`,children:[g.jsx("span",{className:"tabular-nums",children:t.total})," run",t.total===1?"":"s"]}),g.jsxs("span",{className:e===0?"text-fg-dim":"text-status-red",children:[g.jsx("span",{className:"tabular-nums",children:e})," new failure cluster",e===1?"":"s"]}),g.jsxs("span",{className:r.value===0?"text-fg-dim":"text-fg",title:r.title,children:[g.jsxs("span",{className:"tabular-nums",children:["~$",r.value.toFixed(2)]})," spent"]})]})}function AP(t){var d,f;const e=Date.now(),r=new Date(e),n=Date.UTC(r.getUTCFullYear(),r.getUTCMonth(),r.getUTCDate()),a=(e-n)/36e5,i=Math.max(0,Math.min(1,(24-a)/24)),s=h=>`${h.getUTCFullYear()}-${String(h.getUTCMonth()+1).padStart(2,"0")}-${String(h.getUTCDate()).padStart(2,"0")}`,o=s(r),l=s(new Date(e-Yx)),u=((d=t.find(h=>h.day===o))==null?void 0:d.cost)??0,c=((f=t.find(h=>h.day===l))==null?void 0:f.cost)??0;return{value:u+c*i,title:`≈ today's UTC bucket ($${u.toFixed(2)}) + ${Math.round(i*100)}% of yesterday's ($${c.toFixed(2)})`}}function iB({groups:t}){if(!t||t.length===0)return g.jsx("span",{className:"text-fg-dim",children:"—"});let e=0,r=0,n=0,a=0,i=0;for(const l of t)e+=l.total,r+=l.done,n+=l.awaiting,a+=l.failed,i+=l.running;const s=l=>e>0?`${(l/e*100).toFixed(1)}%`:"0%",o=t.map(l=>`${l.groupId}: ${l.total} · ${l.done} done · ${l.awaiting} awaiting · ${l.failed} failed · ${l.running} running`).join(" | ");return g.jsxs("div",{className:"flex items-center min-w-[100px]",title:o,children:[g.jsxs("div",{className:"flex h-1.5 flex-1 rounded-[3px] overflow-hidden bg-bg-elev2",children:[g.jsx("span",{className:"bg-status-blue",style:{width:s(r)}}),g.jsx("span",{className:"bg-status-green",style:{width:s(i)}}),g.jsx("span",{className:"bg-status-red",style:{width:s(a)}}),g.jsx("span",{className:"bg-status-grey",style:{width:s(n)}})]}),g.jsxs("span",{className:"ml-1.5 font-mono text-[11px] text-fg-dim",children:[r,"/",e]})]})}const sB=36e5,oB=864e5;function lB(t){const e=Date.now(),r=t.filter(i=>i.status==="blocked"&&i.updatedAt!=null&&e-i.updatedAt>sB),n=t.filter(i=>i.status==="failed"&&i.updatedAt!=null&&e-i.updatedAt<oB),a=[];return r.length&&a.push({label:"stuck > 1h",className:"text-status-amber",runs:r}),n.length&&a.push({label:"failed in last 24h",className:"text-status-red",runs:n}),a}function uB({runs:t}){const[e,r]=Z.useState(null),n=lB(t);return n.length===0?null:g.jsxs(Me,{className:"border-status-amber/30 bg-status-amber/[0.04]",children:[g.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[g.jsx("span",{className:"text-status-amber font-semibold uppercase tracking-[0.5px] text-xs",children:"needs attention"}),g.jsx("span",{className:"text-fg-dim text-xs",children:"— glanceable signals; expand to see the runs"})]}),g.jsx("div",{className:"flex flex-wrap gap-2",children:n.map(a=>g.jsxs("button",{onClick:()=>r(e===a.label?null:a.label),className:qe("font-mono text-xs px-2.5 py-1 rounded-full border border-border bg-bg-elev hover:bg-bg-elev2 transition-colors",e===a.label&&"bg-bg-elev2"),children:[g.jsx("span",{className:a.className,children:a.runs.length})," ",a.label]},a.label))}),e&&(()=>{const a=n.find(i=>i.label===e);return a?g.jsxs("div",{className:"mt-3 border-t border-border pt-2 grid grid-cols-1 gap-1 text-sm",children:[a.runs.slice(0,8).map(i=>g.jsxs("a",{href:`#/runs/${i.flowId}`,className:"flex items-center gap-3 py-1 hover:bg-bg-elev2 rounded px-2 -mx-2 min-w-0",children:[g.jsx("span",{className:"font-mono text-xs text-fg-dim w-[72px] shrink-0",children:i.flowId.slice(0,8)}),g.jsx("span",{className:"font-mono flex-1 min-w-0 truncate",children:i.pipelineId??"?"}),g.jsx("span",{className:"font-mono text-fg-dim text-xs truncate hidden sm:inline",children:i.currentStep??"?"}),g.jsx("span",{className:"text-fg-dim text-xs whitespace-nowrap shrink-0",children:vn(i.updatedAt)})]},i.flowId)),a.runs.length>8&&g.jsxs("div",{className:"text-fg-dim text-xs italic px-2 mt-1",children:["…and ",a.runs.length-8," more — refine filters to see them all"]})]}):null})()]})}function jP({value:t,label:e="copy",className:r,children:n}){const[a,i]=Z.useState("idle");async function s(o){var l;o.preventDefault(),o.stopPropagation();try{if((l=navigator.clipboard)!=null&&l.writeText)await navigator.clipboard.writeText(t);else{const u=document.createElement("textarea");u.value=t,u.style.position="fixed",u.style.opacity="0",document.body.appendChild(u),u.select(),document.execCommand("copy"),document.body.removeChild(u)}i("ok")}catch{i("err")}setTimeout(()=>i("idle"),1200)}return g.jsxs("span",{role:"button",tabIndex:0,onClick:s,onKeyDown:o=>{(o.key==="Enter"||o.key===" ")&&s(o)},title:`${e}: ${t}`,"aria-label":`${e} ${t}`,className:qe("cursor-copy hover:text-fg transition-colors",a==="ok"&&"text-status-green",a==="err"&&"text-status-red",r),children:[n,a==="ok"&&g.jsx("span",{"aria-hidden":!0,className:"ml-1 text-status-green",children:"✓"})]})}const vt="/graph/api";async function Lt(t){const e=await fetch(t);if(!e.ok)throw new Error(`${t}: HTTP ${e.status}`);return e.json()}async function Ll(t,e){const r=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),n=await r.json().catch(()=>({}));if(!r.ok){const a=typeof(n==null?void 0:n.error)=="string"?n.error:`HTTP ${r.status}`;throw new Error(`${t}: ${a}`)}return n}const st={pipelines:()=>Lt(`${vt}/pipelines`),pipeline:t=>Lt(`${vt}/pipelines/${encodeURIComponent(t)}`),runs:(t={})=>{const e=new URLSearchParams;return t.status&&e.set("status",t.status),t.pipelineId&&e.set("pipelineId",t.pipelineId),t.limit&&e.set("limit",String(t.limit)),t.since!=null&&e.set("since",String(t.since)),t.until!=null&&e.set("until",String(t.until)),Lt(`${vt}/runs?${e.toString()}`)},run:t=>Lt(`${vt}/runs/${t}`),runEvents:t=>Lt(`${vt}/runs/${t}/events`),runArtifacts:t=>Lt(`${vt}/runs/${t}/artifacts`),runTranscripts:t=>Lt(`${vt}/runs/${t}/transcripts`),runCompare:t=>Lt(`${vt}/runs/${t}/compare`),runSubflows:t=>Lt(`${vt}/runs/${t}/subflows`),runTree:t=>Lt(`${vt}/runs/${t}/tree`),stats:()=>Lt(`${vt}/stats`),pipelineStats:t=>Lt(`${vt}/stats/pipelines/${encodeURIComponent(t)}`),pipelineNodeStats:(t,e)=>Lt(`${vt}/pipelines/${encodeURIComponent(t)}/nodes/${encodeURIComponent(e)}/stats`),search:(t,e={})=>{const r=e.limit??50,n=new URLSearchParams;return t&&n.set("q",t),e.status&&n.set("status",e.status),n.set("limit",String(r)),Lt(`${vt}/search?${n.toString()}`)},runCost:t=>Lt(`${vt}/runs/${t}/cost`),pipelineCost:(t,e=30)=>Lt(`${vt}/stats/pipelines/${encodeURIComponent(t)}/cost?sinceDays=${e}`),allPipelinesCost:(t=30)=>Lt(`${vt}/stats/cost?sinceDays=${t}`),pipelineViews:(t,e=30)=>Lt(`${vt}/stats/pipelines/${encodeURIComponent(t)}/views?sinceDays=${e}`),approve:(t,e)=>Ll(`${vt}/runs/${t}/approve`,e),cancel:t=>Ll(`${vt}/runs/${t}/cancel`,{}),rerun:(t,e={})=>Ll(`${vt}/runs/${t}/rerun`,e),respond:(t,e)=>Ll(`${vt}/runs/${t}/respond`,{text:e})},cB=(t,e)=>`${vt}/runs/${t}/artifacts/${encodeURIComponent(e)}`,dB=["","running","blocked","succeeded","failed","cancelled"],N0={all:null,"1h":36e5,"24h":864e5,"7d":6048e5,"30d":2592e6};function fB(){const t=window.location.hash||"#/",e=t.indexOf("?"),r=e>=0?t.slice(e+1):"",n=new URLSearchParams(r),a=n.get("range")??"all";return{status:n.get("status")??"",pipeline:n.get("pipeline")??"",range:a in N0?a:"all",query:n.get("q")??""}}function vB(t){const e=new URLSearchParams;t.status&&e.set("status",t.status),t.pipeline&&e.set("pipeline",t.pipeline),t.range!=="all"&&e.set("range",t.range),t.query&&e.set("q",t.query);const r=e.toString(),n=r?`#/?${r}`:"#/";n!==window.location.hash&&window.history.replaceState(null,"",n)}function hB(){const[t,e]=Z.useState(null),[r,n]=Z.useState(null),[a,i]=Z.useState(null),[s,o]=Z.useState(null),[l,u]=Z.useState(null),[c,d]=Z.useState(null),f=fB(),[h,v]=Z.useState(f.status),[x,b]=Z.useState(f.pipeline),[m,p]=Z.useState(f.range),[y,w]=Z.useState(f.query),E=()=>{st.stats().then(e)},S=()=>{st.pipelines().then(n)},C=()=>{const R={status:h,pipelineId:x||void 0,limit:200};if(c){const I=Date.UTC(Number(c.slice(0,4)),Number(c.slice(5,7))-1,Number(c.slice(8,10)));R.since=I,R.until=I+864e5,R.limit=1e3}st.runs(R).then(o)},k=()=>{st.runs({limit:200}).then(u)},T=()=>{st.allPipelinesCost(30).then(i).catch(()=>i(null))};Z.useEffect(()=>{E(),S(),k(),T()},[]),Z.useEffect(()=>{vB({status:h,pipeline:x,range:m,query:y}),C()},[h,x,m,y,c]),Tc(R=>{R.kind==="run.created"||R.kind==="run.updated"||R.kind==="run.ended"?(C(),k(),E()):R.kind==="pipeline.catalog.updated"&&(S(),T())});const _=Z.useMemo(()=>{const R=N0[m],I=R!=null?Date.now()-R:null,M=y.trim().toLowerCase(),D=c?Date.UTC(Number(c.slice(0,4)),Number(c.slice(5,7))-1,Number(c.slice(8,10))):null,L=D!=null?D+864e5:null;return(s??[]).filter(j=>{if(I!=null&&(j.updatedAt??0)<I)return!1;if(D!=null&&L!=null){const F=j.createdAt??0;if(F<D||F>=L)return!1}return!(M&&![j.pipelineId,j.currentStep,j.flowId,j.statusReason,j.waitKind].filter(Boolean).join(" ").toLowerCase().includes(M))})},[s,m,y,c]),N=!!(h||x||m!=="all"||y||c),P=()=>{v(""),b(""),p("all"),w(""),d(null)};return g.jsxs(g.Fragment,{children:[g.jsx(uB,{runs:l??[]}),(()=>{if(l===null||t===null||a===null)return g.jsx(Wu,{loading:!0,runs:{total:0,ok:0,failed:0,active:0},newFailures:0,spent:{value:0}});const I=Date.now()-Yx,M=l.filter(D=>(D.updatedAt??0)>=I);return g.jsx(Wu,{runs:{total:M.length,ok:M.filter(D=>D.status==="succeeded").length,failed:M.filter(D=>D.status==="failed").length,active:M.filter(D=>D.status==="running"||D.status==="blocked").length},newFailures:(t.failureStops??[]).filter(D=>(D.lastFailedAt??0)>=I).length,spent:AP(a.total.perDay)})})(),g.jsx("h2",{className:"text-[15px] font-semibold uppercase tracking-[0.5px] text-fg-dim mt-6 mb-2.5",children:"overview"}),t?g.jsx(_P,{stats:t}):g.jsx("div",{className:"grid gap-3 mb-4 grid-cols-[repeat(auto-fit,minmax(150px,1fr))]",children:[0,1,2,3].map(R=>g.jsxs("div",{className:"bg-bg-elev border border-border rounded-md px-[14px] py-3",children:[g.jsx(ge,{className:"h-3 w-16 mb-2"}),g.jsx(ge,{className:"h-7 w-20"}),g.jsx(ge,{className:"h-2 w-24 mt-2"})]},R))}),a===null&&g.jsxs(Me,{children:[g.jsx(Qe,{children:g.jsx(tt,{children:"cost (last 30d)"})}),g.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-3",children:[0,1,2].map(R=>g.jsxs("div",{className:"border border-border rounded p-2",children:[g.jsx(ge,{className:"h-3 w-20 mb-1.5"}),g.jsx(ge,{className:"h-6 w-24"}),g.jsx(ge,{className:"h-2 w-32 mt-2"})]},R))}),g.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3 mt-4",children:[g.jsxs("div",{className:"border border-border rounded p-2",children:[g.jsx(ge,{className:"h-3 w-28 mb-2"}),[0,1,2,3].map(R=>g.jsxs("div",{className:"flex items-center gap-2 mb-1.5",children:[g.jsx(ge,{className:"h-3 w-32"}),g.jsx(ge,{className:"h-2 flex-1"}),g.jsx(ge,{className:"h-3 w-12"})]},R))]}),g.jsx("div",{className:"flex flex-col gap-3",children:[0,1].map(R=>g.jsxs("div",{className:"border border-border rounded p-2 flex-1",children:[g.jsx(ge,{className:"h-3 w-20 mb-2"}),g.jsx(ge,{className:"h-3 w-full mb-1"}),g.jsx("div",{className:"flex gap-[2px] h-12",children:[0,1,2,3,4,5].map(I=>g.jsx(ge,{className:"flex-1 rounded-[1px]"},I))})]},R))})]})]}),a&&a.total.spend>0&&g.jsxs(Me,{children:[g.jsx(Qe,{children:g.jsx(tt,{children:"cost (last 30d)"})}),g.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-3 text-sm",children:[g.jsx(Od,{label:"total spend",value:`$${a.total.spend.toFixed(2)}`,sub:`${a.total.runs} run${a.total.runs===1?"":"s"} across ${a.pipelines.length} pipeline${a.pipelines.length===1?"":"s"}`}),g.jsx(Od,{label:"mean / run",value:a.total.mean!=null?`$${a.total.mean.toFixed(2)}`:"—",sub:a.total.p95Cost!=null?`p95 $${a.total.p95Cost.toFixed(2)}`:void 0}),g.jsx(Od,{label:"cost / success",value:a.total.costPerSuccess!=null?`$${a.total.costPerSuccess.toFixed(2)}`:"—",sub:a.total.succeeded>0?`${a.total.succeeded} succeeded`:"no successes yet"})]}),g.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3 mt-4",children:[g.jsx(nB,{entries:a.pipelines,pipelines:r??[]}),g.jsxs("div",{className:"flex flex-col gap-3",children:[g.jsx(RP,{perDay:a.total.perDay}),g.jsx(PP,{perDay:a.total.perDay})]})]})]}),g.jsxs("div",{className:"flex flex-col md:flex-row gap-3 md:gap-5",children:[g.jsx("div",{className:"flex-1 min-w-0",children:g.jsxs(Me,{className:"mb-0",children:[g.jsx(Qe,{children:g.jsx(tt,{children:"runs / day (last 30d)"})}),t?g.jsx(eB,{buckets:t.perDay,pinned:c,onPinChange:d}):g.jsxs(g.Fragment,{children:[g.jsx(ge,{className:"h-3 w-20 self-end mb-1 ml-auto"}),g.jsx("div",{className:"flex gap-[2px] h-9 mt-1.5",children:Array.from({length:14},(R,I)=>g.jsx(ge,{className:"flex-1 min-w-[4px] rounded-[1px]"},I))}),g.jsxs("div",{className:"flex justify-between mt-1.5",children:[g.jsx(ge,{className:"h-2.5 w-16"}),g.jsx(ge,{className:"h-2.5 w-12"}),g.jsx(ge,{className:"h-2.5 w-16"})]})]})]})}),g.jsx("div",{className:"flex-1 min-w-0",children:g.jsxs(Me,{className:"mb-0",children:[g.jsx(Qe,{children:g.jsx(tt,{children:"top failure / cancel steps"})}),t?g.jsx(NP,{entries:t.failureStops,showPipeline:!0}):g.jsx("div",{className:"space-y-2",children:[0,1].map(R=>g.jsxs("div",{className:"border border-border rounded",children:[g.jsx("div",{className:"px-2 py-1 border-b border-border/60",children:g.jsx(ge,{className:"h-3 w-40"})}),g.jsx("div",{className:"px-2 py-1.5 space-y-1.5",children:[0,1].map(I=>g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(ge,{className:"h-3 w-32"}),g.jsx(ge,{className:"h-3 flex-1"}),g.jsx(ge,{className:"h-3 w-10"})]},I))})]},R))})]})})]}),g.jsx("div",{children:g.jsxs("div",{children:[g.jsxs("div",{className:"flex items-baseline justify-between mb-2.5 gap-3 flex-wrap",children:[g.jsx("h2",{className:"text-[15px] font-semibold uppercase tracking-[0.5px] text-fg-dim",children:"runs"}),g.jsxs("span",{className:"font-mono text-xs text-fg-dim",children:[s===null?"…":_.length===s.length?`${s.length}`:`${_.length} / ${s.length}`,N&&g.jsx("button",{onClick:P,className:"ml-2 underline hover:text-fg",children:"clear filters"})]})]}),g.jsxs("div",{className:"flex gap-2 mb-2 flex-wrap",children:[g.jsxs("select",{value:x,onChange:R=>b(R.target.value),className:"bg-bg-elev border border-border rounded px-2 py-1 text-sm font-mono text-fg min-w-0",children:[g.jsx("option",{value:"",children:"all pipelines"}),(r??[]).map(R=>g.jsxs("option",{value:R.id,children:[R.id,R.historical?" (historical)":""]},R.id))]}),g.jsx("select",{value:m,onChange:R=>p(R.target.value),className:"bg-bg-elev border border-border rounded px-2 py-1 text-sm font-mono text-fg",children:Object.keys(N0).map(R=>g.jsx("option",{value:R,children:R==="all"?"all time":`last ${R}`},R))}),g.jsx("input",{type:"search",value:y,onChange:R=>w(R.target.value),placeholder:"search step / pipeline / flowId…",className:"bg-bg-elev border border-border rounded px-2 py-1 text-sm text-fg flex-1 min-w-[160px]"})]}),g.jsx("div",{className:"flex gap-2 flex-wrap mb-3 items-center",children:dB.map(R=>g.jsx(ra,{variant:"chip",onClick:()=>v(R),className:qe(h===R&&"bg-bg-elev2 text-fg border-fg-dim"),children:R||"all"},R||"all"))}),g.jsx(Me,{children:s===null?g.jsx("div",{className:"space-y-2",children:[0,1,2,3,4,5].map(R=>g.jsxs("div",{className:"flex items-center gap-3 py-1",children:[g.jsx(ge,{className:"h-3 w-16"}),g.jsx(ge,{className:"h-3 w-40"}),g.jsx(ge,{className:"h-4 w-16"}),g.jsx(ge,{className:"h-3 w-24"}),g.jsx(ge,{className:"h-3 w-12 ml-auto"})]},R))}):_.length===0?g.jsxs("div",{className:"text-fg-dim italic",children:["no runs",N&&" matching the current filters"]}):g.jsxs(g.Fragment,{children:[g.jsx("div",{className:"sm:hidden flex flex-col gap-2",children:_.map(R=>g.jsxs("a",{href:`#/runs/${R.flowId}`,className:"block rounded border border-border bg-bg-elev2/30 hover:bg-bg-elev2 px-3 py-2",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(is,{status:R.status}),g.jsx("span",{className:"font-mono text-sm truncate flex-1",children:R.pipelineId??"?"}),g.jsx("span",{className:"text-[10px] text-fg-dim shrink-0",children:vn(R.updatedAt)})]}),g.jsxs("div",{className:"flex items-baseline gap-2 mt-0.5 text-xs text-fg-dim font-mono",children:[g.jsx("span",{children:R.flowId.slice(0,8)}),R.currentStep&&g.jsxs("span",{children:["· ",R.currentStep]})]})]},R.flowId))}),g.jsx("div",{className:"hidden sm:block",children:g.jsxs(ei,{children:[g.jsx(ti,{children:g.jsxs(yr,{children:[g.jsx(We,{children:"flow"}),g.jsx(We,{children:"pipeline"}),g.jsx(We,{children:"status"}),g.jsx(We,{children:"step"}),g.jsx(We,{children:"wait"}),g.jsx(We,{children:"subflows"}),g.jsx(We,{children:"updated"})]})}),g.jsx(ri,{children:_.map(R=>g.jsxs(yr,{className:"cursor-pointer hover:bg-bg-elev2",onClick:()=>{window.location.hash=`#/runs/${R.flowId}`},children:[g.jsx(He,{className:"font-mono text-xs",children:g.jsx(jP,{value:R.flowId,label:"copy flowId",children:R.flowId.slice(0,8)})}),g.jsx(He,{className:"font-mono",children:R.pipelineId??"?"}),g.jsx(He,{children:g.jsx(is,{status:R.status})}),g.jsx(He,{className:"font-mono text-fg-dim",children:R.currentStep??"?"}),g.jsx(He,{className:"font-mono text-fg-dim",children:R.waitKind??""}),g.jsx(He,{children:g.jsx(iB,{groups:R.subflows})}),g.jsx(He,{className:"text-fg-dim",children:vn(R.updatedAt)})]},R.flowId))})]})})]})})]})})]})}function Od({label:t,value:e,sub:r}){return g.jsxs("div",{className:"border border-border rounded p-2",children:[g.jsx("div",{className:"text-xs text-fg-dim",children:t}),g.jsx("div",{className:"font-mono text-lg",children:e}),r&&g.jsx("div",{className:"text-xs text-fg-dim mt-0.5",children:r})]})}function pB(){const[t,e]=Z.useState(null),r=()=>{st.pipelines().then(e)};return Z.useEffect(r,[]),Tc(n=>{n.kind==="pipeline.catalog.updated"&&r()}),g.jsxs(g.Fragment,{children:[g.jsx("h2",{className:"text-[15px] font-semibold uppercase tracking-[0.5px] text-fg-dim mt-6 mb-2.5",children:"pipelines"}),g.jsx(Me,{children:t===null?g.jsx("div",{className:"space-y-2",children:[0,1,2,3,4].map(n=>g.jsxs("div",{className:"flex items-center gap-3 py-1",children:[g.jsx(ge,{className:"h-3 w-60"}),g.jsx(ge,{className:"h-3 w-8"}),g.jsx(ge,{className:"h-3 w-72"}),g.jsx(ge,{className:"h-3 w-24 ml-auto"}),g.jsx(ge,{className:"h-4 w-20"})]},n))}):t.length===0?g.jsx("div",{className:"text-fg-dim italic",children:"no pipelines loaded"}):g.jsxs(g.Fragment,{children:[g.jsx("div",{className:"sm:hidden flex flex-col gap-2",children:t.map(n=>g.jsxs("a",{href:`#/pipelines/${encodeURIComponent(n.id)}`,className:qe("block rounded border border-border bg-bg-elev2/30 hover:bg-bg-elev2 px-3 py-2",n.historical&&"opacity-65 italic"),children:[g.jsxs("div",{className:"flex items-baseline gap-2",children:[g.jsx("span",{className:"font-mono text-sm truncate flex-1",children:n.id}),n.historical?g.jsx(mn,{variant:"historical",children:"historical"}):g.jsxs("span",{className:"text-[10px] font-mono text-fg-dim shrink-0",children:[n.nodes.length-2," nodes"]})]}),g.jsx("div",{className:"text-xs text-fg-dim mt-0.5 line-clamp-2",children:n.historical?g.jsxs(g.Fragment,{children:["no longer on disk · ",n.runs," run",n.runs===1?"":"s"," in DB"]}):n.goal??""})]},n.id))}),g.jsx("div",{className:"hidden sm:block",children:g.jsxs(ei,{children:[g.jsx(ti,{children:g.jsxs(yr,{children:[g.jsx(We,{children:"id"}),g.jsx(We,{children:"nodes"}),g.jsx(We,{children:"goal"}),g.jsx(We,{children:"file"}),g.jsx(We,{children:"status"})]})}),g.jsx(ri,{children:t.map(n=>g.jsxs(yr,{className:qe("cursor-pointer hover:bg-bg-elev2",n.historical&&"opacity-65 italic"),onClick:()=>{window.location.hash=`#/pipelines/${encodeURIComponent(n.id)}`},children:[g.jsx(He,{className:"font-mono",children:g.jsx("a",{href:`#/pipelines/${encodeURIComponent(n.id)}`,children:n.id})}),g.jsx(He,{className:"text-fg-dim",children:n.historical?"—":n.nodes.length-2}),g.jsx(He,{className:"text-fg-dim",children:n.historical?g.jsxs("span",{className:"text-fg-dim",children:["no longer on disk · ",n.runs," run(s) in DB"]}):(n.goal??"").slice(0,100)}),g.jsx(He,{className:"font-mono text-fg-dim text-xs",children:n.historical?"—":(n.file??"").replace(/^.*\//,"")}),g.jsx(He,{children:n.historical?g.jsx(mn,{variant:"historical",children:"historical"}):g.jsx(mn,{variant:"succeeded",children:"implemented"})})]},n.id))})]})})]})})]})}function R0(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function gB(t){if(Array.isArray(t))return t}function mB(t){if(Array.isArray(t))return R0(t)}function Na(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function yB(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,MP(n.key),n)}}function Ra(t,e,r){return e&&yB(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function xr(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=Xx(t))||e){r&&(t=r);var n=0,a=function(){};return{s:a,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:a}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
41
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i,s=!0,o=!1;return{s:function(){r=r.call(t)},n:function(){var l=r.next();return s=l.done,l},e:function(l){o=!0,i=l},f:function(){try{s||r.return==null||r.return()}finally{if(o)throw i}}}}function IP(t,e,r){return(e=MP(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function xB(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function bB(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,a,i,s,o=[],l=!0,u=!1;try{if(i=(r=r.call(t)).next,e===0){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=i.call(r)).done)&&(o.push(n.value),o.length!==e);l=!0);}catch(c){u=!0,a=c}finally{try{if(!l&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw a}}return o}}function wB(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
42
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function SB(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
43
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function kt(t,e){return gB(t)||bB(t,e)||Xx(t,e)||wB()}function Ku(t){return mB(t)||xB(t)||Xx(t)||SB()}function EB(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function MP(t){var e=EB(t,"string");return typeof e=="symbol"?e:e+""}function It(t){"@babel/helpers - typeof";return It=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},It(t)}function Xx(t,e){if(t){if(typeof t=="string")return R0(t,e);var r={}.toString.call(t).slice(8,-1);return r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set"?Array.from(t):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?R0(t,e):void 0}}var Rt=typeof window>"u"?null:window,sw=Rt?Rt.navigator:null;Rt&&Rt.document;var CB=It(""),DP=It({}),kB=It(function(){}),TB=typeof HTMLElement>"u"?"undefined":It(HTMLElement),Zo=function(e){return e&&e.instanceString&>(e.instanceString)?e.instanceString():null},Ee=function(e){return e!=null&&It(e)==CB},gt=function(e){return e!=null&&It(e)===kB},Je=function(e){return!_r(e)&&(Array.isArray?Array.isArray(e):e!=null&&e instanceof Array)},Ue=function(e){return e!=null&&It(e)===DP&&!Je(e)&&e.constructor===Object},_B=function(e){return e!=null&&It(e)===DP},le=function(e){return e!=null&&It(e)===It(1)&&!isNaN(e)},NB=function(e){return le(e)&&Math.floor(e)===e},Yu=function(e){if(TB!=="undefined")return e!=null&&e instanceof HTMLElement},_r=function(e){return Qo(e)||LP(e)},Qo=function(e){return Zo(e)==="collection"&&e._private.single},LP=function(e){return Zo(e)==="collection"&&!e._private.single},Zx=function(e){return Zo(e)==="core"},BP=function(e){return Zo(e)==="stylesheet"},RB=function(e){return Zo(e)==="event"},ya=function(e){return e==null?!0:!!(e===""||e.match(/^\s+$/))},PB=function(e){return typeof HTMLElement>"u"?!1:e instanceof HTMLElement},AB=function(e){return Ue(e)&&le(e.x1)&&le(e.x2)&&le(e.y1)&&le(e.y2)},jB=function(e){return _B(e)&>(e.then)},IB=function(){return sw&&sw.userAgent.match(/msie|trident|edge/i)},ss=function(e,r){r||(r=function(){if(arguments.length===1)return arguments[0];if(arguments.length===0)return"undefined";for(var i=[],s=0;s<arguments.length;s++)i.push(arguments[s]);return i.join("$")});var n=function(){var i=this,s=arguments,o,l=r.apply(i,s),u=n.cache;return(o=u[l])||(o=u[l]=e.apply(i,s)),o};return n.cache={},n},Qx=ss(function(t){return t.replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()})}),_c=ss(function(t){return t.replace(/(-\w)/g,function(e){return e[1].toUpperCase()})}),OP=ss(function(t,e){return t+e[0].toUpperCase()+e.substring(1)},function(t,e){return t+"$"+e}),ow=function(e){return ya(e)?e:e.charAt(0).toUpperCase()+e.substring(1)},na=function(e,r){return e.slice(-1*r.length)===r},jt="(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))",MB="rgb[a]?\\(("+jt+"[%]?)\\s*,\\s*("+jt+"[%]?)\\s*,\\s*("+jt+"[%]?)(?:\\s*,\\s*("+jt+"))?\\)",DB="rgb[a]?\\((?:"+jt+"[%]?)\\s*,\\s*(?:"+jt+"[%]?)\\s*,\\s*(?:"+jt+"[%]?)(?:\\s*,\\s*(?:"+jt+"))?\\)",LB="hsl[a]?\\(("+jt+")\\s*,\\s*("+jt+"[%])\\s*,\\s*("+jt+"[%])(?:\\s*,\\s*("+jt+"))?\\)",BB="hsl[a]?\\((?:"+jt+")\\s*,\\s*(?:"+jt+"[%])\\s*,\\s*(?:"+jt+"[%])(?:\\s*,\\s*(?:"+jt+"))?\\)",OB="\\#[0-9a-fA-F]{3}",qB="\\#[0-9a-fA-F]{6}",qP=function(e,r){return e<r?-1:e>r?1:0},FB=function(e,r){return-1*qP(e,r)},Te=Object.assign!=null?Object.assign.bind(Object):function(t){for(var e=arguments,r=1;r<e.length;r++){var n=e[r];if(n!=null)for(var a=Object.keys(n),i=0;i<a.length;i++){var s=a[i];t[s]=n[s]}}return t},$B=function(e){if(!(!(e.length===4||e.length===7)||e[0]!=="#")){var r=e.length===4,n,a,i,s=16;return r?(n=parseInt(e[1]+e[1],s),a=parseInt(e[2]+e[2],s),i=parseInt(e[3]+e[3],s)):(n=parseInt(e[1]+e[2],s),a=parseInt(e[3]+e[4],s),i=parseInt(e[5]+e[6],s)),[n,a,i]}},zB=function(e){var r,n,a,i,s,o,l,u;function c(v,x,b){return b<0&&(b+=1),b>1&&(b-=1),b<1/6?v+(x-v)*6*b:b<1/2?x:b<2/3?v+(x-v)*(2/3-b)*6:v}var d=new RegExp("^"+LB+"$").exec(e);if(d){if(n=parseInt(d[1]),n<0?n=(360- -1*n%360)%360:n>360&&(n=n%360),n/=360,a=parseFloat(d[2]),a<0||a>100||(a=a/100,i=parseFloat(d[3]),i<0||i>100)||(i=i/100,s=d[4],s!==void 0&&(s=parseFloat(s),s<0||s>1)))return;if(a===0)o=l=u=Math.round(i*255);else{var f=i<.5?i*(1+a):i+a-i*a,h=2*i-f;o=Math.round(255*c(h,f,n+1/3)),l=Math.round(255*c(h,f,n)),u=Math.round(255*c(h,f,n-1/3))}r=[o,l,u,s]}return r},VB=function(e){var r,n=new RegExp("^"+MB+"$").exec(e);if(n){r=[];for(var a=[],i=1;i<=3;i++){var s=n[i];if(s[s.length-1]==="%"&&(a[i]=!0),s=parseFloat(s),a[i]&&(s=s/100*255),s<0||s>255)return;r.push(Math.floor(s))}var o=a[1]||a[2]||a[3],l=a[1]&&a[2]&&a[3];if(o&&!l)return;var u=n[4];if(u!==void 0){if(u=parseFloat(u),u<0||u>1)return;r.push(u)}}return r},UB=function(e){return GB[e.toLowerCase()]},FP=function(e){return(Je(e)?e:null)||UB(e)||$B(e)||VB(e)||zB(e)},GB={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]},$P=function(e){for(var r=e.map,n=e.keys,a=n.length,i=0;i<a;i++){var s=n[i];if(Ue(s))throw Error("Tried to set map with object key");i<n.length-1?(r[s]==null&&(r[s]={}),r=r[s]):r[s]=e.value}},zP=function(e){for(var r=e.map,n=e.keys,a=n.length,i=0;i<a;i++){var s=n[i];if(Ue(s))throw Error("Tried to get map with object key");if(r=r[s],r==null)return r}return r},Bl=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Jo(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var qd,lw;function el(){if(lw)return qd;lw=1;function t(e){var r=typeof e;return e!=null&&(r=="object"||r=="function")}return qd=t,qd}var Fd,uw;function HB(){if(uw)return Fd;uw=1;var t=typeof Bl=="object"&&Bl&&Bl.Object===Object&&Bl;return Fd=t,Fd}var $d,cw;function Nc(){if(cw)return $d;cw=1;var t=HB(),e=typeof self=="object"&&self&&self.Object===Object&&self,r=t||e||Function("return this")();return $d=r,$d}var zd,dw;function WB(){if(dw)return zd;dw=1;var t=Nc(),e=function(){return t.Date.now()};return zd=e,zd}var Vd,fw;function KB(){if(fw)return Vd;fw=1;var t=/\s/;function e(r){for(var n=r.length;n--&&t.test(r.charAt(n)););return n}return Vd=e,Vd}var Ud,vw;function YB(){if(vw)return Ud;vw=1;var t=KB(),e=/^\s+/;function r(n){return n&&n.slice(0,t(n)+1).replace(e,"")}return Ud=r,Ud}var Gd,hw;function Jx(){if(hw)return Gd;hw=1;var t=Nc(),e=t.Symbol;return Gd=e,Gd}var Hd,pw;function XB(){if(pw)return Hd;pw=1;var t=Jx(),e=Object.prototype,r=e.hasOwnProperty,n=e.toString,a=t?t.toStringTag:void 0;function i(s){var o=r.call(s,a),l=s[a];try{s[a]=void 0;var u=!0}catch{}var c=n.call(s);return u&&(o?s[a]=l:delete s[a]),c}return Hd=i,Hd}var Wd,gw;function ZB(){if(gw)return Wd;gw=1;var t=Object.prototype,e=t.toString;function r(n){return e.call(n)}return Wd=r,Wd}var Kd,mw;function VP(){if(mw)return Kd;mw=1;var t=Jx(),e=XB(),r=ZB(),n="[object Null]",a="[object Undefined]",i=t?t.toStringTag:void 0;function s(o){return o==null?o===void 0?a:n:i&&i in Object(o)?e(o):r(o)}return Kd=s,Kd}var Yd,yw;function QB(){if(yw)return Yd;yw=1;function t(e){return e!=null&&typeof e=="object"}return Yd=t,Yd}var Xd,xw;function tl(){if(xw)return Xd;xw=1;var t=VP(),e=QB(),r="[object Symbol]";function n(a){return typeof a=="symbol"||e(a)&&t(a)==r}return Xd=n,Xd}var Zd,bw;function JB(){if(bw)return Zd;bw=1;var t=YB(),e=el(),r=tl(),n=NaN,a=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,s=/^0o[0-7]+$/i,o=parseInt;function l(u){if(typeof u=="number")return u;if(r(u))return n;if(e(u)){var c=typeof u.valueOf=="function"?u.valueOf():u;u=e(c)?c+"":c}if(typeof u!="string")return u===0?u:+u;u=t(u);var d=i.test(u);return d||s.test(u)?o(u.slice(2),d?2:8):a.test(u)?n:+u}return Zd=l,Zd}var Qd,ww;function eO(){if(ww)return Qd;ww=1;var t=el(),e=WB(),r=JB(),n="Expected a function",a=Math.max,i=Math.min;function s(o,l,u){var c,d,f,h,v,x,b=0,m=!1,p=!1,y=!0;if(typeof o!="function")throw new TypeError(n);l=r(l)||0,t(u)&&(m=!!u.leading,p="maxWait"in u,f=p?a(r(u.maxWait)||0,l):f,y="trailing"in u?!!u.trailing:y);function w(R){var I=c,M=d;return c=d=void 0,b=R,h=o.apply(M,I),h}function E(R){return b=R,v=setTimeout(k,l),m?w(R):h}function S(R){var I=R-x,M=R-b,D=l-I;return p?i(D,f-M):D}function C(R){var I=R-x,M=R-b;return x===void 0||I>=l||I<0||p&&M>=f}function k(){var R=e();if(C(R))return T(R);v=setTimeout(k,S(R))}function T(R){return v=void 0,y&&c?w(R):(c=d=void 0,h)}function _(){v!==void 0&&clearTimeout(v),b=0,c=x=d=v=void 0}function N(){return v===void 0?h:T(e())}function P(){var R=e(),I=C(R);if(c=arguments,d=this,x=R,I){if(v===void 0)return E(x);if(p)return clearTimeout(v),v=setTimeout(k,l),w(x)}return v===void 0&&(v=setTimeout(k,l)),h}return P.cancel=_,P.flush=N,P}return Qd=s,Qd}var tO=eO(),rl=Jo(tO),Jd=Rt?Rt.performance:null,UP=Jd&&Jd.now?function(){return Jd.now()}:function(){return Date.now()},rO=function(){if(Rt){if(Rt.requestAnimationFrame)return function(t){Rt.requestAnimationFrame(t)};if(Rt.mozRequestAnimationFrame)return function(t){Rt.mozRequestAnimationFrame(t)};if(Rt.webkitRequestAnimationFrame)return function(t){Rt.webkitRequestAnimationFrame(t)};if(Rt.msRequestAnimationFrame)return function(t){Rt.msRequestAnimationFrame(t)}}return function(t){t&&setTimeout(function(){t(UP())},1e3/60)}}(),Xu=function(e){return rO(e)},Ln=UP,$a=9261,GP=65599,ki=5381,HP=function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:$a,n=r,a;a=e.next(),!a.done;)n=n*GP+a.value|0;return n},Mo=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:$a;return r*GP+e|0},Do=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ki;return(r<<5)+r+e|0},nO=function(e,r){return e*2097152+r},Wn=function(e){return e[0]*2097152+e[1]},Ol=function(e,r){return[Mo(e[0],r[0]),Do(e[1],r[1])]},Sw=function(e,r){var n={value:0,done:!1},a=0,i=e.length,s={next:function(){return a<i?n.value=e[a++]:n.done=!0,n}};return HP(s,r)},ni=function(e,r){var n={value:0,done:!1},a=0,i=e.length,s={next:function(){return a<i?n.value=e.charCodeAt(a++):n.done=!0,n}};return HP(s,r)},WP=function(){return aO(arguments)},aO=function(e){for(var r,n=0;n<e.length;n++){var a=e[n];n===0?r=ni(a):r=ni(a,r)}return r};function iO(t,e,r,n,a){var i=a*Math.PI/180,s=Math.cos(i)*(t-r)-Math.sin(i)*(e-n)+r,o=Math.sin(i)*(t-r)+Math.cos(i)*(e-n)+n;return{x:s,y:o}}var sO=function(e,r,n,a,i,s){return{x:(e-n)*i+n,y:(r-a)*s+a}};function oO(t,e,r){if(r===0)return t;var n=(e.x1+e.x2)/2,a=(e.y1+e.y2)/2,i=e.w/e.h,s=1/i,o=iO(t.x,t.y,n,a,r),l=sO(o.x,o.y,n,a,i,s);return{x:l.x,y:l.y}}var Ew=!0,lO=console.warn!=null,uO=console.trace!=null,e1=Number.MAX_SAFE_INTEGER||9007199254740991,KP=function(){return!0},Zu=function(){return!1},Cw=function(){return 0},t1=function(){},ct=function(e){throw new Error(e)},YP=function(e){if(e!==void 0)Ew=!!e;else return Ew},Ye=function(e){YP()&&(lO?console.warn(e):(console.log(e),uO&&console.trace()))},cO=function(e){return Te({},e)},hn=function(e){return e==null?e:Je(e)?e.slice():Ue(e)?cO(e):e},dO=function(e){return e.slice()},XP=function(e,r){for(r=e="";e++<36;r+=e*51&52?(e^15?8^Math.random()*(e^20?16:4):4).toString(16):"-");return r},fO={},ZP=function(){return fO},Kt=function(e){var r=Object.keys(e);return function(n){for(var a={},i=0;i<r.length;i++){var s=r[i],o=n==null?void 0:n[s];a[s]=o===void 0?e[s]:o}return a}},xa=function(e,r,n){for(var a=e.length-1;a>=0;a--)e[a]===r&&e.splice(a,1)},r1=function(e){e.splice(0,e.length)},vO=function(e,r){for(var n=0;n<r.length;n++){var a=r[n];e.push(a)}},pr=function(e,r,n){return n&&(r=OP(n,r)),e[r]},_n=function(e,r,n,a){n&&(r=OP(n,r)),e[r]=a},hO=function(){function t(){Na(this,t),this._obj={}}return Ra(t,[{key:"set",value:function(r,n){return this._obj[r]=n,this}},{key:"delete",value:function(r){return this._obj[r]=void 0,this}},{key:"clear",value:function(){this._obj={}}},{key:"has",value:function(r){return this._obj[r]!==void 0}},{key:"get",value:function(r){return this._obj[r]}}])}(),Pn=typeof Map<"u"?Map:hO,pO="undefined",gO=function(){function t(e){if(Na(this,t),this._obj=Object.create(null),this.size=0,e!=null){var r;e.instanceString!=null&&e.instanceString()===this.instanceString()?r=e.toArray():r=e;for(var n=0;n<r.length;n++)this.add(r[n])}}return Ra(t,[{key:"instanceString",value:function(){return"set"}},{key:"add",value:function(r){var n=this._obj;n[r]!==1&&(n[r]=1,this.size++)}},{key:"delete",value:function(r){var n=this._obj;n[r]===1&&(n[r]=0,this.size--)}},{key:"clear",value:function(){this._obj=Object.create(null)}},{key:"has",value:function(r){return this._obj[r]===1}},{key:"toArray",value:function(){var r=this;return Object.keys(this._obj).filter(function(n){return r.has(n)})}},{key:"forEach",value:function(r,n){return this.toArray().forEach(r,n)}}])}(),vs=(typeof Set>"u"?"undefined":It(Set))!==pO?Set:gO,Rc=function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0||r===void 0||!Zx(e)){ct("An element must have a core reference and parameters set");return}var a=r.group;if(a==null&&(r.data&&r.data.source!=null&&r.data.target!=null?a="edges":a="nodes"),a!=="nodes"&&a!=="edges"){ct("An element must be of type `nodes` or `edges`; you specified `"+a+"`");return}this.length=1,this[0]=this;var i=this._private={cy:e,single:!0,data:r.data||{},position:r.position||{x:0,y:0},autoWidth:void 0,autoHeight:void 0,autoPadding:void 0,compoundBoundsClean:!1,listeners:[],group:a,style:{},rstyle:{},styleCxts:[],styleKeys:{},removed:!0,selected:!!r.selected,selectable:r.selectable===void 0?!0:!!r.selectable,locked:!!r.locked,grabbed:!1,grabbable:r.grabbable===void 0?!0:!!r.grabbable,pannable:r.pannable===void 0?a==="edges":!!r.pannable,active:!1,classes:new vs,animation:{current:[],queue:[]},rscratch:{},scratch:r.scratch||{},edges:[],children:[],parent:r.parent&&r.parent.isNode()?r.parent:null,traversalCache:{},backgrounding:!1,bbCache:null,bbCacheShift:{x:0,y:0},bodyBounds:null,overlayBounds:null,labelBounds:{all:null,source:null,target:null,main:null},arrowBounds:{source:null,target:null,"mid-source":null,"mid-target":null}};if(i.position.x==null&&(i.position.x=0),i.position.y==null&&(i.position.y=0),r.renderedPosition){var s=r.renderedPosition,o=e.pan(),l=e.zoom();i.position={x:(s.x-o.x)/l,y:(s.y-o.y)/l}}var u=[];Je(r.classes)?u=r.classes:Ee(r.classes)&&(u=r.classes.split(/\s+/));for(var c=0,d=u.length;c<d;c++){var f=u[c];!f||f===""||i.classes.add(f)}this.createEmitter(),(n===void 0||n)&&this.restore();var h=r.style||r.css;h&&(Ye("Setting a `style` bypass at element creation should be done only when absolutely necessary. Try to use the stylesheet instead."),this.style(h))},kw=function(e){return e={bfs:e.bfs||!e.dfs,dfs:e.dfs||!e.bfs},function(n,a,i){var s;Ue(n)&&!_r(n)&&(s=n,n=s.roots||s.root,a=s.visit,i=s.directed),i=arguments.length===2&&!gt(a)?a:i,a=gt(a)?a:function(){};for(var o=this._private.cy,l=n=Ee(n)?this.filter(n):n,u=[],c=[],d={},f={},h={},v=0,x,b=this.byGroup(),m=b.nodes,p=b.edges,y=0;y<l.length;y++){var w=l[y],E=w.id();w.isNode()&&(u.unshift(w),e.bfs&&(h[E]=!0,c.push(w)),f[E]=0)}for(var S=function(){var R=e.bfs?u.shift():u.pop(),I=R.id();if(e.dfs){if(h[I])return 0;h[I]=!0,c.push(R)}var M=f[I],D=d[I],L=D!=null?D.source():null,j=D!=null?D.target():null,F=D==null?void 0:R.same(L)?j[0]:L[0],O;if(O=a(R,D,F,v++,M),O===!0)return x=R,1;if(O===!1)return 1;for(var B=R.connectedEdges().filter(function(z){return(!i||z.source().same(R))&&p.has(z)}),V=0;V<B.length;V++){var J=B[V],q=J.connectedNodes().filter(function(z){return!z.same(R)&&m.has(z)}),$=q.id();q.length!==0&&!h[$]&&(q=q[0],u.push(q),e.bfs&&(h[$]=!0,c.push(q)),d[$]=J,f[$]=f[I]+1)}},C;u.length!==0&&(C=S(),!(C!==0&&C===1)););for(var k=o.collection(),T=0;T<c.length;T++){var _=c[T],N=d[_.id()];N!=null&&k.push(N),k.push(_)}return{path:o.collection(k),found:o.collection(x)}}},Lo={breadthFirstSearch:kw({bfs:!0}),depthFirstSearch:kw({dfs:!0})};Lo.bfs=Lo.breadthFirstSearch;Lo.dfs=Lo.depthFirstSearch;var cu={exports:{}},mO=cu.exports,Tw;function yO(){return Tw||(Tw=1,function(t,e){(function(){var r,n,a,i,s,o,l,u,c,d,f,h,v,x,b;a=Math.floor,d=Math.min,n=function(m,p){return m<p?-1:m>p?1:0},c=function(m,p,y,w,E){var S;if(y==null&&(y=0),E==null&&(E=n),y<0)throw new Error("lo must be non-negative");for(w==null&&(w=m.length);y<w;)S=a((y+w)/2),E(p,m[S])<0?w=S:y=S+1;return[].splice.apply(m,[y,y-y].concat(p)),p},o=function(m,p,y){return y==null&&(y=n),m.push(p),x(m,0,m.length-1,y)},s=function(m,p){var y,w;return p==null&&(p=n),y=m.pop(),m.length?(w=m[0],m[0]=y,b(m,0,p)):w=y,w},u=function(m,p,y){var w;return y==null&&(y=n),w=m[0],m[0]=p,b(m,0,y),w},l=function(m,p,y){var w;return y==null&&(y=n),m.length&&y(m[0],p)<0&&(w=[m[0],p],p=w[0],m[0]=w[1],b(m,0,y)),p},i=function(m,p){var y,w,E,S,C,k;for(p==null&&(p=n),S=(function(){k=[];for(var T=0,_=a(m.length/2);0<=_?T<_:T>_;0<=_?T++:T--)k.push(T);return k}).apply(this).reverse(),C=[],w=0,E=S.length;w<E;w++)y=S[w],C.push(b(m,y,p));return C},v=function(m,p,y){var w;if(y==null&&(y=n),w=m.indexOf(p),w!==-1)return x(m,0,w,y),b(m,w,y)},f=function(m,p,y){var w,E,S,C,k;if(y==null&&(y=n),E=m.slice(0,p),!E.length)return E;for(i(E,y),k=m.slice(p),S=0,C=k.length;S<C;S++)w=k[S],l(E,w,y);return E.sort(y).reverse()},h=function(m,p,y){var w,E,S,C,k,T,_,N,P;if(y==null&&(y=n),p*10<=m.length){if(S=m.slice(0,p).sort(y),!S.length)return S;for(E=S[S.length-1],_=m.slice(p),C=0,T=_.length;C<T;C++)w=_[C],y(w,E)<0&&(c(S,w,0,null,y),S.pop(),E=S[S.length-1]);return S}for(i(m,y),P=[],k=0,N=d(p,m.length);0<=N?k<N:k>N;0<=N?++k:--k)P.push(s(m,y));return P},x=function(m,p,y,w){var E,S,C;for(w==null&&(w=n),E=m[y];y>p;){if(C=y-1>>1,S=m[C],w(E,S)<0){m[y]=S,y=C;continue}break}return m[y]=E},b=function(m,p,y){var w,E,S,C,k;for(y==null&&(y=n),E=m.length,k=p,S=m[p],w=2*p+1;w<E;)C=w+1,C<E&&!(y(m[w],m[C])<0)&&(w=C),m[p]=m[w],p=w,w=2*p+1;return m[p]=S,x(m,k,p,y)},r=function(){m.push=o,m.pop=s,m.replace=u,m.pushpop=l,m.heapify=i,m.updateItem=v,m.nlargest=f,m.nsmallest=h;function m(p){this.cmp=p??n,this.nodes=[]}return m.prototype.push=function(p){return o(this.nodes,p,this.cmp)},m.prototype.pop=function(){return s(this.nodes,this.cmp)},m.prototype.peek=function(){return this.nodes[0]},m.prototype.contains=function(p){return this.nodes.indexOf(p)!==-1},m.prototype.replace=function(p){return u(this.nodes,p,this.cmp)},m.prototype.pushpop=function(p){return l(this.nodes,p,this.cmp)},m.prototype.heapify=function(){return i(this.nodes,this.cmp)},m.prototype.updateItem=function(p){return v(this.nodes,p,this.cmp)},m.prototype.clear=function(){return this.nodes=[]},m.prototype.empty=function(){return this.nodes.length===0},m.prototype.size=function(){return this.nodes.length},m.prototype.clone=function(){var p;return p=new m,p.nodes=this.nodes.slice(0),p},m.prototype.toArray=function(){return this.nodes.slice(0)},m.prototype.insert=m.prototype.push,m.prototype.top=m.prototype.peek,m.prototype.front=m.prototype.peek,m.prototype.has=m.prototype.contains,m.prototype.copy=m.prototype.clone,m}(),function(m,p){return t.exports=p()}(this,function(){return r})}).call(mO)}(cu)),cu.exports}var ef,_w;function xO(){return _w||(_w=1,ef=yO()),ef}var bO=xO(),nl=Jo(bO),wO=Kt({root:null,weight:function(e){return 1},directed:!1}),SO={dijkstra:function(e){if(!Ue(e)){var r=arguments;e={root:r[0],weight:r[1],directed:r[2]}}var n=wO(e),a=n.root,i=n.weight,s=n.directed,o=this,l=i,u=Ee(a)?this.filter(a)[0]:a[0],c={},d={},f={},h=this.byGroup(),v=h.nodes,x=h.edges;x.unmergeBy(function(M){return M.isLoop()});for(var b=function(D){return c[D.id()]},m=function(D,L){c[D.id()]=L,p.updateItem(D)},p=new nl(function(M,D){return b(M)-b(D)}),y=0;y<v.length;y++){var w=v[y];c[w.id()]=w.same(u)?0:1/0,p.push(w)}for(var E=function(D,L){for(var j=(s?D.edgesTo(L):D.edgesWith(L)).intersect(x),F=1/0,O,B=0;B<j.length;B++){var V=j[B],J=l(V);(J<F||!O)&&(F=J,O=V)}return{edge:O,dist:F}};p.size()>0;){var S=p.pop(),C=b(S),k=S.id();if(f[k]=C,C!==1/0)for(var T=S.neighborhood().intersect(v),_=0;_<T.length;_++){var N=T[_],P=N.id(),R=E(S,N),I=C+R.dist;I<b(N)&&(m(N,I),d[P]={node:S,edge:R.edge})}}return{distanceTo:function(D){var L=Ee(D)?v.filter(D)[0]:D[0];return f[L.id()]},pathTo:function(D){var L=Ee(D)?v.filter(D)[0]:D[0],j=[],F=L,O=F.id();if(L.length>0)for(j.unshift(L);d[O];){var B=d[O];j.unshift(B.edge),j.unshift(B.node),F=B.node,O=F.id()}return o.spawn(j)}}}},EO={kruskal:function(e){e=e||function(y){return 1};for(var r=this.byGroup(),n=r.nodes,a=r.edges,i=n.length,s=new Array(i),o=n,l=function(w){for(var E=0;E<s.length;E++){var S=s[E];if(S.has(w))return E}},u=0;u<i;u++)s[u]=this.spawn(n[u]);for(var c=a.sort(function(y,w){return e(y)-e(w)}),d=0;d<c.length;d++){var f=c[d],h=f.source()[0],v=f.target()[0],x=l(h),b=l(v),m=s[x],p=s[b];x!==b&&(o.merge(f),m.merge(p),s.splice(b,1))}return o}},CO=Kt({root:null,goal:null,weight:function(e){return 1},heuristic:function(e){return 0},directed:!1}),kO={aStar:function(e){var r=this.cy(),n=CO(e),a=n.root,i=n.goal,s=n.heuristic,o=n.directed,l=n.weight;a=r.collection(a)[0],i=r.collection(i)[0];var u=a.id(),c=i.id(),d={},f={},h={},v=new nl(function(O,B){return f[O.id()]-f[B.id()]}),x=new vs,b={},m={},p=function(B,V){v.push(B),x.add(V)},y,w,E=function(){y=v.pop(),w=y.id(),x.delete(w)},S=function(B){return x.has(B)};p(a,u),d[u]=0,f[u]=s(a);for(var C=0;v.size()>0;){if(E(),C++,w===c){for(var k=[],T=i,_=c,N=m[_];k.unshift(T),N!=null&&k.unshift(N),T=b[_],T!=null;)_=T.id(),N=m[_];return{found:!0,distance:d[w],path:this.spawn(k),steps:C}}h[w]=!0;for(var P=y._private.edges,R=0;R<P.length;R++){var I=P[R];if(this.hasElementWithId(I.id())&&!(o&&I.data("source")!==w)){var M=I.source(),D=I.target(),L=M.id()!==w?M:D,j=L.id();if(this.hasElementWithId(j)&&!h[j]){var F=d[w]+l(I);if(!S(j)){d[j]=F,f[j]=F+s(L),p(L,j),b[j]=y,m[j]=I;continue}F<d[j]&&(d[j]=F,f[j]=F+s(L),b[j]=y,m[j]=I)}}}}return{found:!1,distance:void 0,path:void 0,steps:C}}},TO=Kt({weight:function(e){return 1},directed:!1}),_O={floydWarshall:function(e){for(var r=this.cy(),n=TO(e),a=n.weight,i=n.directed,s=a,o=this.byGroup(),l=o.nodes,u=o.edges,c=l.length,d=c*c,f=function(J){return l.indexOf(J)},h=function(J){return l[J]},v=new Array(d),x=0;x<d;x++){var b=x%c,m=(x-b)/c;m===b?v[x]=0:v[x]=1/0}for(var p=new Array(d),y=new Array(d),w=0;w<u.length;w++){var E=u[w],S=E.source()[0],C=E.target()[0];if(S!==C){var k=f(S),T=f(C),_=k*c+T,N=s(E);if(v[_]>N&&(v[_]=N,p[_]=T,y[_]=E),!i){var P=T*c+k;!i&&v[P]>N&&(v[P]=N,p[P]=k,y[P]=E)}}}for(var R=0;R<c;R++)for(var I=0;I<c;I++)for(var M=I*c+R,D=0;D<c;D++){var L=I*c+D,j=R*c+D;v[M]+v[j]<v[L]&&(v[L]=v[M]+v[j],p[L]=p[M])}var F=function(J){return(Ee(J)?r.filter(J):J)[0]},O=function(J){return f(F(J))},B={distance:function(J,q){var $=O(J),z=O(q);return v[$*c+z]},path:function(J,q){var $=O(J),z=O(q),W=h($);if($===z)return W.collection();if(p[$*c+z]==null)return r.collection();var ne=r.collection(),X=$,U;for(ne.merge(W);$!==z;)X=$,$=p[$*c+z],U=y[X*c+$],ne.merge(U),ne.merge(h($));return ne}};return B}},NO=Kt({weight:function(e){return 1},directed:!1,root:null}),RO={bellmanFord:function(e){var r=this,n=NO(e),a=n.weight,i=n.directed,s=n.root,o=a,l=this,u=this.cy(),c=this.byGroup(),d=c.edges,f=c.nodes,h=f.length,v=new Pn,x=!1,b=[];s=u.collection(s)[0],d.unmergeBy(function(ue){return ue.isLoop()});for(var m=d.length,p=function(Se){var be=v.get(Se.id());return be||(be={},v.set(Se.id(),be)),be},y=function(Se){return(Ee(Se)?u.$(Se):Se)[0]},w=function(Se){return p(y(Se)).dist},E=function(Se){for(var be=arguments.length>1&&arguments[1]!==void 0?arguments[1]:s,de=y(Se),xe=[],fe=de;;){if(fe==null)return r.spawn();var we=p(fe),Ce=we.edge,Ne=we.pred;if(xe.unshift(fe[0]),fe.same(be)&&xe.length>0)break;Ce!=null&&xe.unshift(Ce),fe=Ne}return l.spawn(xe)},S=0;S<h;S++){var C=f[S],k=p(C);C.same(s)?k.dist=0:k.dist=1/0,k.pred=null,k.edge=null}for(var T=!1,_=function(Se,be,de,xe,fe,we){var Ce=xe.dist+we;Ce<fe.dist&&!de.same(xe.edge)&&(fe.dist=Ce,fe.pred=Se,fe.edge=de,T=!0)},N=1;N<h;N++){T=!1;for(var P=0;P<m;P++){var R=d[P],I=R.source(),M=R.target(),D=o(R),L=p(I),j=p(M);_(I,M,R,L,j,D),i||_(M,I,R,j,L,D)}if(!T)break}if(T)for(var F=[],O=0;O<m;O++){var B=d[O],V=B.source(),J=B.target(),q=o(B),$=p(V).dist,z=p(J).dist;if($+q<z||!i&&z+q<$)if(x||(Ye("Graph contains a negative weight cycle for Bellman-Ford"),x=!0),e.findNegativeWeightCycles!==!1){var W=[];$+q<z&&W.push(V),!i&&z+q<$&&W.push(J);for(var ne=W.length,X=0;X<ne;X++){var U=W[X],H=[U];H.push(p(U).edge);for(var Y=p(U).pred;H.indexOf(Y)===-1;)H.push(Y),H.push(p(Y).edge),Y=p(Y).pred;H=H.slice(H.indexOf(Y));for(var ee=H[0].id(),ie=0,oe=2;oe<H.length;oe+=2)H[oe].id()<ee&&(ee=H[oe].id(),ie=oe);H=H.slice(ie).concat(H.slice(0,ie)),H.push(H[0]);var Re=H.map(function(ue){return ue.id()}).join(",");F.indexOf(Re)===-1&&(b.push(l.spawn(H)),F.push(Re))}}else break}return{distanceTo:w,pathTo:E,hasNegativeWeightCycle:x,negativeWeightCycles:b}}},PO=Math.sqrt(2),AO=function(e,r,n){n.length===0&&ct("Karger-Stein must be run on a connected (sub)graph");for(var a=n[e],i=a[1],s=a[2],o=r[i],l=r[s],u=n,c=u.length-1;c>=0;c--){var d=u[c],f=d[1],h=d[2];(r[f]===o&&r[h]===l||r[f]===l&&r[h]===o)&&u.splice(c,1)}for(var v=0;v<u.length;v++){var x=u[v];x[1]===l?(u[v]=x.slice(),u[v][1]=o):x[2]===l&&(u[v]=x.slice(),u[v][2]=o)}for(var b=0;b<r.length;b++)r[b]===l&&(r[b]=o);return u},tf=function(e,r,n,a){for(;n>a;){var i=Math.floor(Math.random()*r.length);r=AO(i,e,r),n--}return r},jO={kargerStein:function(){var e=this,r=this.byGroup(),n=r.nodes,a=r.edges;a.unmergeBy(function(j){return j.isLoop()});var i=n.length,s=a.length,o=Math.ceil(Math.pow(Math.log(i)/Math.LN2,2)),l=Math.floor(i/PO);if(i<2){ct("At least 2 nodes are required for Karger-Stein algorithm");return}for(var u=[],c=0;c<s;c++){var d=a[c];u.push([c,n.indexOf(d.source()),n.indexOf(d.target())])}for(var f=1/0,h=[],v=new Array(i),x=new Array(i),b=new Array(i),m=function(F,O){for(var B=0;B<i;B++)O[B]=F[B]},p=0;p<=o;p++){for(var y=0;y<i;y++)x[y]=y;var w=tf(x,u.slice(),i,l),E=w.slice();m(x,b);var S=tf(x,w,l,2),C=tf(b,E,l,2);S.length<=C.length&&S.length<f?(f=S.length,h=S,m(x,v)):C.length<=S.length&&C.length<f&&(f=C.length,h=C,m(b,v))}for(var k=this.spawn(h.map(function(j){return a[j[0]]})),T=this.spawn(),_=this.spawn(),N=v[0],P=0;P<v.length;P++){var R=v[P],I=n[P];R===N?T.merge(I):_.merge(I)}var M=function(F){var O=e.spawn();return F.forEach(function(B){O.merge(B),B.connectedEdges().forEach(function(V){e.contains(V)&&!k.contains(V)&&O.merge(V)})}),O},D=[M(T),M(_)],L={cut:k,components:D,partition1:T,partition2:_};return L}},rf,IO=function(e){return{x:e.x,y:e.y}},Pc=function(e,r,n){return{x:e.x*r+n.x,y:e.y*r+n.y}},QP=function(e,r,n){return{x:(e.x-n.x)/r,y:(e.y-n.y)/r}},Oi=function(e){return{x:e[0],y:e[1]}},MO=function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,a=1/0,i=r;i<n;i++){var s=e[i];isFinite(s)&&(a=Math.min(s,a))}return a},DO=function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,a=-1/0,i=r;i<n;i++){var s=e[i];isFinite(s)&&(a=Math.max(s,a))}return a},LO=function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,a=0,i=0,s=r;s<n;s++){var o=e[s];isFinite(o)&&(a+=o,i++)}return a/i},BO=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;a?e=e.slice(r,n):(n<e.length&&e.splice(n,e.length-n),r>0&&e.splice(0,r));for(var o=0,l=e.length-1;l>=0;l--){var u=e[l];s?isFinite(u)||(e[l]=-1/0,o++):e.splice(l,1)}i&&e.sort(function(f,h){return f-h});var c=e.length,d=Math.floor(c/2);return c%2!==0?e[d+1+o]:(e[d-1+o]+e[d+o])/2},OO=function(e){return Math.PI*e/180},ql=function(e,r){return Math.atan2(r,e)-Math.PI/2},n1=Math.log2||function(t){return Math.log(t)/Math.log(2)},a1=function(e){return e>0?1:e<0?-1:0},ai=function(e,r){return Math.sqrt(qa(e,r))},qa=function(e,r){var n=r.x-e.x,a=r.y-e.y;return n*n+a*a},qO=function(e){for(var r=e.length,n=0,a=0;a<r;a++)n+=e[a];for(var i=0;i<r;i++)e[i]=e[i]/n;return e},Bt=function(e,r,n,a){return(1-a)*(1-a)*e+2*(1-a)*a*r+a*a*n},Ki=function(e,r,n,a){return{x:Bt(e.x,r.x,n.x,a),y:Bt(e.y,r.y,n.y,a)}},FO=function(e,r,n,a){var i={x:r.x-e.x,y:r.y-e.y},s=ai(e,r),o={x:i.x/s,y:i.y/s};return n=n??0,a=a??n*s,{x:e.x+o.x*a,y:e.y+o.y*a}},Bo=function(e,r,n){return Math.max(e,Math.min(n,r))},lr=function(e){if(e==null)return{x1:1/0,y1:1/0,x2:-1/0,y2:-1/0,w:0,h:0};if(e.x1!=null&&e.y1!=null){if(e.x2!=null&&e.y2!=null&&e.x2>=e.x1&&e.y2>=e.y1)return{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,w:e.x2-e.x1,h:e.y2-e.y1};if(e.w!=null&&e.h!=null&&e.w>=0&&e.h>=0)return{x1:e.x1,y1:e.y1,x2:e.x1+e.w,y2:e.y1+e.h,w:e.w,h:e.h}}},$O=function(e){return{x1:e.x1,x2:e.x2,w:e.w,y1:e.y1,y2:e.y2,h:e.h}},zO=function(e){e.x1=1/0,e.y1=1/0,e.x2=-1/0,e.y2=-1/0,e.w=0,e.h=0},VO=function(e,r){e.x1=Math.min(e.x1,r.x1),e.x2=Math.max(e.x2,r.x2),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,r.y1),e.y2=Math.max(e.y2,r.y2),e.h=e.y2-e.y1},JP=function(e,r,n){e.x1=Math.min(e.x1,r),e.x2=Math.max(e.x2,r),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,n),e.y2=Math.max(e.y2,n),e.h=e.y2-e.y1},du=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return e.x1-=r,e.x2+=r,e.y1-=r,e.y2+=r,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},fu=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0],n,a,i,s;if(r.length===1)n=a=i=s=r[0];else if(r.length===2)n=i=r[0],s=a=r[1];else if(r.length===4){var o=kt(r,4);n=o[0],a=o[1],i=o[2],s=o[3]}return e.x1-=s,e.x2+=a,e.y1-=n,e.y2+=i,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},Nw=function(e,r){e.x1=r.x1,e.y1=r.y1,e.x2=r.x2,e.y2=r.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1},i1=function(e,r){return!(e.x1>r.x2||r.x1>e.x2||e.x2<r.x1||r.x2<e.x1||e.y2<r.y1||r.y2<e.y1||e.y1>r.y2||r.y1>e.y2)},aa=function(e,r,n){return e.x1<=r&&r<=e.x2&&e.y1<=n&&n<=e.y2},Rw=function(e,r){return aa(e,r.x,r.y)},eA=function(e,r){return aa(e,r.x1,r.y1)&&aa(e,r.x2,r.y2)},UO=(rf=Math.hypot)!==null&&rf!==void 0?rf:function(t,e){return Math.sqrt(t*t+e*e)};function GO(t,e){if(t.length<3)throw new Error("Need at least 3 vertices");var r=function(k,T){return{x:k.x+T.x,y:k.y+T.y}},n=function(k,T){return{x:k.x-T.x,y:k.y-T.y}},a=function(k,T){return{x:k.x*T,y:k.y*T}},i=function(k,T){return k.x*T.y-k.y*T.x},s=function(k){var T=UO(k.x,k.y);return T===0?{x:0,y:0}:{x:k.x/T,y:k.y/T}},o=function(k){for(var T=0,_=0;_<k.length;_++){var N=k[_],P=k[(_+1)%k.length];T+=N.x*P.y-P.x*N.y}return T/2},l=function(k,T,_,N){var P=n(T,k),R=n(N,_),I=i(P,R);if(Math.abs(I)<1e-9)return r(k,a(P,.5));var M=i(n(_,k),R)/I;return r(k,a(P,M))},u=t.map(function(C){return{x:C.x,y:C.y}});o(u)<0&&u.reverse();for(var c=u.length,d=[],f=0;f<c;f++){var h=u[f],v=u[(f+1)%c],x=n(v,h),b=s({x:x.y,y:-x.x});d.push(b)}for(var m=d.map(function(C,k){var T=r(u[k],a(C,e)),_=r(u[(k+1)%c],a(C,e));return{p1:T,p2:_}}),p=[],y=0;y<c;y++){var w=m[(y-1+c)%c],E=m[y],S=l(w.p1,w.p2,E.p1,E.p2);p.push(S)}return p}function HO(t,e,r,n,a,i){var s=t5(t,e,r,n,a),o=GO(s,i),l=lr();return o.forEach(function(u){return JP(l,u.x,u.y)}),l}var tA=function(e,r,n,a,i,s,o){var l=arguments.length>7&&arguments[7]!==void 0?arguments[7]:"auto",u=l==="auto"?ba(i,s):l,c=i/2,d=s/2;u=Math.min(u,c,d);var f=u!==c,h=u!==d,v;if(f){var x=n-c+u-o,b=a-d-o,m=n+c-u+o,p=b;if(v=ia(e,r,n,a,x,b,m,p,!1),v.length>0)return v}if(h){var y=n+c+o,w=a-d+u-o,E=y,S=a+d-u+o;if(v=ia(e,r,n,a,y,w,E,S,!1),v.length>0)return v}if(f){var C=n-c+u-o,k=a+d+o,T=n+c-u+o,_=k;if(v=ia(e,r,n,a,C,k,T,_,!1),v.length>0)return v}if(h){var N=n-c-o,P=a-d+u-o,R=N,I=a+d-u+o;if(v=ia(e,r,n,a,N,P,R,I,!1),v.length>0)return v}var M;{var D=n-c+u,L=a-d+u;if(M=Zs(e,r,n,a,D,L,u+o),M.length>0&&M[0]<=D&&M[1]<=L)return[M[0],M[1]]}{var j=n+c-u,F=a-d+u;if(M=Zs(e,r,n,a,j,F,u+o),M.length>0&&M[0]>=j&&M[1]<=F)return[M[0],M[1]]}{var O=n+c-u,B=a+d-u;if(M=Zs(e,r,n,a,O,B,u+o),M.length>0&&M[0]>=O&&M[1]>=B)return[M[0],M[1]]}{var V=n-c+u,J=a+d-u;if(M=Zs(e,r,n,a,V,J,u+o),M.length>0&&M[0]<=V&&M[1]>=J)return[M[0],M[1]]}return[]},WO=function(e,r,n,a,i,s,o){var l=o,u=Math.min(n,i),c=Math.max(n,i),d=Math.min(a,s),f=Math.max(a,s);return u-l<=e&&e<=c+l&&d-l<=r&&r<=f+l},KO=function(e,r,n,a,i,s,o,l,u){var c={x1:Math.min(n,o,i)-u,x2:Math.max(n,o,i)+u,y1:Math.min(a,l,s)-u,y2:Math.max(a,l,s)+u};return!(e<c.x1||e>c.x2||r<c.y1||r>c.y2)},YO=function(e,r,n,a){n-=a;var i=r*r-4*e*n;if(i<0)return[];var s=Math.sqrt(i),o=2*e,l=(-r+s)/o,u=(-r-s)/o;return[l,u]},XO=function(e,r,n,a,i){var s=1e-5;e===0&&(e=s),r/=e,n/=e,a/=e;var o,l,u,c,d,f,h,v;if(l=(3*n-r*r)/9,u=-(27*a)+r*(9*n-2*(r*r)),u/=54,o=l*l*l+u*u,i[1]=0,h=r/3,o>0){d=u+Math.sqrt(o),d=d<0?-Math.pow(-d,1/3):Math.pow(d,1/3),f=u-Math.sqrt(o),f=f<0?-Math.pow(-f,1/3):Math.pow(f,1/3),i[0]=-h+d+f,h+=(d+f)/2,i[4]=i[2]=-h,h=Math.sqrt(3)*(-f+d)/2,i[3]=h,i[5]=-h;return}if(i[5]=i[3]=0,o===0){v=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3),i[0]=-h+2*v,i[4]=i[2]=-(v+h);return}l=-l,c=l*l*l,c=Math.acos(u/Math.sqrt(c)),v=2*Math.sqrt(l),i[0]=-h+v*Math.cos(c/3),i[2]=-h+v*Math.cos((c+2*Math.PI)/3),i[4]=-h+v*Math.cos((c+4*Math.PI)/3)},ZO=function(e,r,n,a,i,s,o,l){var u=1*n*n-4*n*i+2*n*o+4*i*i-4*i*o+o*o+a*a-4*a*s+2*a*l+4*s*s-4*s*l+l*l,c=1*9*n*i-3*n*n-3*n*o-6*i*i+3*i*o+9*a*s-3*a*a-3*a*l-6*s*s+3*s*l,d=1*3*n*n-6*n*i+n*o-n*e+2*i*i+2*i*e-o*e+3*a*a-6*a*s+a*l-a*r+2*s*s+2*s*r-l*r,f=1*n*i-n*n+n*e-i*e+a*s-a*a+a*r-s*r,h=[];XO(u,c,d,f,h);for(var v=1e-7,x=[],b=0;b<6;b+=2)Math.abs(h[b+1])<v&&h[b]>=0&&h[b]<=1&&x.push(h[b]);x.push(1),x.push(0);for(var m=-1,p,y,w,E=0;E<x.length;E++)p=Math.pow(1-x[E],2)*n+2*(1-x[E])*x[E]*i+x[E]*x[E]*o,y=Math.pow(1-x[E],2)*a+2*(1-x[E])*x[E]*s+x[E]*x[E]*l,w=Math.pow(p-e,2)+Math.pow(y-r,2),m>=0?w<m&&(m=w):m=w;return m},QO=function(e,r,n,a,i,s){var o=[e-n,r-a],l=[i-n,s-a],u=l[0]*l[0]+l[1]*l[1],c=o[0]*o[0]+o[1]*o[1],d=o[0]*l[0]+o[1]*l[1],f=d*d/u;return d<0?c:f>u?(e-i)*(e-i)+(r-s)*(r-s):c-f},gr=function(e,r,n){for(var a,i,s,o,l,u=0,c=0;c<n.length/2;c++)if(a=n[c*2],i=n[c*2+1],c+1<n.length/2?(s=n[(c+1)*2],o=n[(c+1)*2+1]):(s=n[(c+1-n.length/2)*2],o=n[(c+1-n.length/2)*2+1]),!(a==e&&s==e))if(a>=e&&e>=s||a<=e&&e<=s)l=(e-a)/(s-a)*(o-i)+i,l>r&&u++;else continue;return u%2!==0},Bn=function(e,r,n,a,i,s,o,l,u){var c=new Array(n.length),d;l[0]!=null?(d=Math.atan(l[1]/l[0]),l[0]<0?d=d+Math.PI/2:d=-d-Math.PI/2):d=l;for(var f=Math.cos(-d),h=Math.sin(-d),v=0;v<c.length/2;v++)c[v*2]=s/2*(n[v*2]*f-n[v*2+1]*h),c[v*2+1]=o/2*(n[v*2+1]*f+n[v*2]*h),c[v*2]+=a,c[v*2+1]+=i;var x;if(u>0){var b=Ju(c,-u);x=Qu(b)}else x=c;return gr(e,r,x)},JO=function(e,r,n,a,i,s,o,l){for(var u=new Array(n.length*2),c=0;c<l.length;c++){var d=l[c];u[c*4+0]=d.startX,u[c*4+1]=d.startY,u[c*4+2]=d.stopX,u[c*4+3]=d.stopY;var f=Math.pow(d.cx-e,2)+Math.pow(d.cy-r,2);if(f<=Math.pow(d.radius,2))return!0}return gr(e,r,u)},Qu=function(e){for(var r=new Array(e.length/2),n,a,i,s,o,l,u,c,d=0;d<e.length/4;d++){n=e[d*4],a=e[d*4+1],i=e[d*4+2],s=e[d*4+3],d<e.length/4-1?(o=e[(d+1)*4],l=e[(d+1)*4+1],u=e[(d+1)*4+2],c=e[(d+1)*4+3]):(o=e[0],l=e[1],u=e[2],c=e[3]);var f=ia(n,a,i,s,o,l,u,c,!0);r[d*2]=f[0],r[d*2+1]=f[1]}return r},Ju=function(e,r){for(var n=new Array(e.length*2),a,i,s,o,l=0;l<e.length/2;l++){a=e[l*2],i=e[l*2+1],l<e.length/2-1?(s=e[(l+1)*2],o=e[(l+1)*2+1]):(s=e[0],o=e[1]);var u=o-i,c=-(s-a),d=Math.sqrt(u*u+c*c),f=u/d,h=c/d;n[l*4]=a+f*r,n[l*4+1]=i+h*r,n[l*4+2]=s+f*r,n[l*4+3]=o+h*r}return n},e5=function(e,r,n,a,i,s){var o=n-e,l=a-r;o/=i,l/=s;var u=Math.sqrt(o*o+l*l),c=u-1;if(c<0)return[];var d=c/u;return[(n-e)*d+e,(a-r)*d+r]},Ha=function(e,r,n,a,i,s,o){return e-=i,r-=s,e/=n/2+o,r/=a/2+o,e*e+r*r<=1},Zs=function(e,r,n,a,i,s,o){var l=[n-e,a-r],u=[e-i,r-s],c=l[0]*l[0]+l[1]*l[1],d=2*(u[0]*l[0]+u[1]*l[1]),f=u[0]*u[0]+u[1]*u[1]-o*o,h=d*d-4*c*f;if(h<0)return[];var v=(-d+Math.sqrt(h))/(2*c),x=(-d-Math.sqrt(h))/(2*c),b=Math.min(v,x),m=Math.max(v,x),p=[];if(b>=0&&b<=1&&p.push(b),m>=0&&m<=1&&p.push(m),p.length===0)return[];var y=p[0]*l[0]+e,w=p[0]*l[1]+r;if(p.length>1){if(p[0]==p[1])return[y,w];var E=p[1]*l[0]+e,S=p[1]*l[1]+r;return[y,w,E,S]}else return[y,w]},nf=function(e,r,n){return r<=e&&e<=n||n<=e&&e<=r?e:e<=r&&r<=n||n<=r&&r<=e?r:n},ia=function(e,r,n,a,i,s,o,l,u){var c=e-i,d=n-e,f=o-i,h=r-s,v=a-r,x=l-s,b=f*h-x*c,m=d*h-v*c,p=x*d-f*v;if(p!==0){var y=b/p,w=m/p,E=.001,S=0-E,C=1+E;return S<=y&&y<=C&&S<=w&&w<=C?[e+y*d,r+y*v]:u?[e+y*d,r+y*v]:[]}else return b===0||m===0?nf(e,n,o)===o?[o,l]:nf(e,n,i)===i?[i,s]:nf(i,o,n)===n?[n,a]:[]:[]},t5=function(e,r,n,a,i){var s=[],o=a/2,l=i/2,u=r,c=n;s.push({x:u+o*e[0],y:c+l*e[1]});for(var d=1;d<e.length/2;d++)s.push({x:u+o*e[d*2],y:c+l*e[d*2+1]});return s},Oo=function(e,r,n,a,i,s,o,l){var u=[],c,d=new Array(n.length),f=!0;s==null&&(f=!1);var h;if(f){for(var v=0;v<d.length/2;v++)d[v*2]=n[v*2]*s+a,d[v*2+1]=n[v*2+1]*o+i;if(l>0){var x=Ju(d,-l);h=Qu(x)}else h=d}else h=n;for(var b,m,p,y,w=0;w<h.length/2;w++)b=h[w*2],m=h[w*2+1],w<h.length/2-1?(p=h[(w+1)*2],y=h[(w+1)*2+1]):(p=h[0],y=h[1]),c=ia(e,r,a,i,b,m,p,y),c.length!==0&&u.push(c[0],c[1]);return u},r5=function(e,r,n,a,i,s,o,l,u){var c=[],d,f=new Array(n.length*2);u.forEach(function(p,y){y===0?(f[f.length-2]=p.startX,f[f.length-1]=p.startY):(f[y*4-2]=p.startX,f[y*4-1]=p.startY),f[y*4]=p.stopX,f[y*4+1]=p.stopY,d=Zs(e,r,a,i,p.cx,p.cy,p.radius),d.length!==0&&c.push(d[0],d[1])});for(var h=0;h<f.length/4;h++)d=ia(e,r,a,i,f[h*4],f[h*4+1],f[h*4+2],f[h*4+3],!1),d.length!==0&&c.push(d[0],d[1]);if(c.length>2){for(var v=[c[0],c[1]],x=Math.pow(v[0]-e,2)+Math.pow(v[1]-r,2),b=1;b<c.length/2;b++){var m=Math.pow(c[b*2]-e,2)+Math.pow(c[b*2+1]-r,2);m<=x&&(v[0]=c[b*2],v[1]=c[b*2+1],x=m)}return v}return c},Fl=function(e,r,n){var a=[e[0]-r[0],e[1]-r[1]],i=Math.sqrt(a[0]*a[0]+a[1]*a[1]),s=(i-n)/i;return s<0&&(s=1e-5),[r[0]+s*a[0],r[1]+s*a[1]]},ar=function(e,r){var n=P0(e,r);return n=rA(n),n},rA=function(e){for(var r,n,a=e.length/2,i=1/0,s=1/0,o=-1/0,l=-1/0,u=0;u<a;u++)r=e[2*u],n=e[2*u+1],i=Math.min(i,r),o=Math.max(o,r),s=Math.min(s,n),l=Math.max(l,n);for(var c=2/(o-i),d=2/(l-s),f=0;f<a;f++)r=e[2*f]=e[2*f]*c,n=e[2*f+1]=e[2*f+1]*d,i=Math.min(i,r),o=Math.max(o,r),s=Math.min(s,n),l=Math.max(l,n);if(s<-1)for(var h=0;h<a;h++)n=e[2*h+1]=e[2*h+1]+(-1-s);return e},P0=function(e,r){var n=1/e*2*Math.PI,a=e%2===0?Math.PI/2+n/2:Math.PI/2;a+=r;for(var i=new Array(e*2),s,o=0;o<e;o++)s=o*n+a,i[2*o]=Math.cos(s),i[2*o+1]=Math.sin(-s);return i},ba=function(e,r){return Math.min(e/4,r/4,8)},nA=function(e,r){return Math.min(e/10,r/10,8)},s1=function(){return 8},n5=function(e,r,n){return[e-2*r+n,2*(r-e),e]},A0=function(e,r){return{heightOffset:Math.min(15,.05*r),widthOffset:Math.min(100,.25*e),ctrlPtOffsetPct:.05}};function af(t,e){function r(d){for(var f=[],h=0;h<d.length;h++){var v=d[h],x=d[(h+1)%d.length],b={x:x.x-v.x,y:x.y-v.y},m={x:-b.y,y:b.x},p=Math.sqrt(m.x*m.x+m.y*m.y);f.push({x:m.x/p,y:m.y/p})}return f}function n(d,f){var h=1/0,v=-1/0,x=xr(d),b;try{for(x.s();!(b=x.n()).done;){var m=b.value,p=m.x*f.x+m.y*f.y;h=Math.min(h,p),v=Math.max(v,p)}}catch(y){x.e(y)}finally{x.f()}return{min:h,max:v}}function a(d,f){return!(d.max<f.min||f.max<d.min)}var i=[].concat(Ku(r(t)),Ku(r(e))),s=xr(i),o;try{for(s.s();!(o=s.n()).done;){var l=o.value,u=n(t,l),c=n(e,l);if(!a(u,c))return!1}}catch(d){s.e(d)}finally{s.f()}return!0}var a5=Kt({dampingFactor:.8,precision:1e-6,iterations:200,weight:function(e){return 1}}),i5={pageRank:function(e){for(var r=a5(e),n=r.dampingFactor,a=r.precision,i=r.iterations,s=r.weight,o=this._private.cy,l=this.byGroup(),u=l.nodes,c=l.edges,d=u.length,f=d*d,h=c.length,v=new Array(f),x=new Array(d),b=(1-n)/d,m=0;m<d;m++){for(var p=0;p<d;p++){var y=m*d+p;v[y]=0}x[m]=0}for(var w=0;w<h;w++){var E=c[w],S=E.data("source"),C=E.data("target");if(S!==C){var k=u.indexOfId(S),T=u.indexOfId(C),_=s(E),N=T*d+k;v[N]+=_,x[k]+=_}}for(var P=1/d+b,R=0;R<d;R++)if(x[R]===0)for(var I=0;I<d;I++){var M=I*d+R;v[M]=P}else for(var D=0;D<d;D++){var L=D*d+R;v[L]=v[L]/x[R]+b}for(var j=new Array(d),F=new Array(d),O,B=0;B<d;B++)j[B]=1;for(var V=0;V<i;V++){for(var J=0;J<d;J++)F[J]=0;for(var q=0;q<d;q++)for(var $=0;$<d;$++){var z=q*d+$;F[q]+=v[z]*j[$]}qO(F),O=j,j=F,F=O;for(var W=0,ne=0;ne<d;ne++){var X=O[ne]-j[ne];W+=X*X}if(W<a)break}var U={rank:function(Y){return Y=o.collection(Y)[0],j[u.indexOf(Y)]}};return U}},Pw=Kt({root:null,weight:function(e){return 1},directed:!1,alpha:0}),Yi={degreeCentralityNormalized:function(e){e=Pw(e);var r=this.cy(),n=this.nodes(),a=n.length;if(e.directed){for(var c={},d={},f=0,h=0,v=0;v<a;v++){var x=n[v],b=x.id();e.root=x;var m=this.degreeCentrality(e);f<m.indegree&&(f=m.indegree),h<m.outdegree&&(h=m.outdegree),c[b]=m.indegree,d[b]=m.outdegree}return{indegree:function(y){return f==0?0:(Ee(y)&&(y=r.filter(y)),c[y.id()]/f)},outdegree:function(y){return h===0?0:(Ee(y)&&(y=r.filter(y)),d[y.id()]/h)}}}else{for(var i={},s=0,o=0;o<a;o++){var l=n[o];e.root=l;var u=this.degreeCentrality(e);s<u.degree&&(s=u.degree),i[l.id()]=u.degree}return{degree:function(y){return s===0?0:(Ee(y)&&(y=r.filter(y)),i[y.id()]/s)}}}},degreeCentrality:function(e){e=Pw(e);var r=this.cy(),n=this,a=e,i=a.root,s=a.weight,o=a.directed,l=a.alpha;if(i=r.collection(i)[0],o){for(var h=i.connectedEdges(),v=h.filter(function(S){return S.target().same(i)&&n.has(S)}),x=h.filter(function(S){return S.source().same(i)&&n.has(S)}),b=v.length,m=x.length,p=0,y=0,w=0;w<v.length;w++)p+=s(v[w]);for(var E=0;E<x.length;E++)y+=s(x[E]);return{indegree:Math.pow(b,1-l)*Math.pow(p,l),outdegree:Math.pow(m,1-l)*Math.pow(y,l)}}else{for(var u=i.connectedEdges().intersection(n),c=u.length,d=0,f=0;f<u.length;f++)d+=s(u[f]);return{degree:Math.pow(c,1-l)*Math.pow(d,l)}}}};Yi.dc=Yi.degreeCentrality;Yi.dcn=Yi.degreeCentralityNormalised=Yi.degreeCentralityNormalized;var Aw=Kt({harmonic:!0,weight:function(){return 1},directed:!1,root:null}),Xi={closenessCentralityNormalized:function(e){for(var r=Aw(e),n=r.harmonic,a=r.weight,i=r.directed,s=this.cy(),o={},l=0,u=this.nodes(),c=this.floydWarshall({weight:a,directed:i}),d=0;d<u.length;d++){for(var f=0,h=u[d],v=0;v<u.length;v++)if(d!==v){var x=c.distance(h,u[v]);n?f+=1/x:f+=x}n||(f=1/f),l<f&&(l=f),o[h.id()]=f}return{closeness:function(m){return l==0?0:(Ee(m)?m=s.filter(m)[0].id():m=m.id(),o[m]/l)}}},closenessCentrality:function(e){var r=Aw(e),n=r.root,a=r.weight,i=r.directed,s=r.harmonic;n=this.filter(n)[0];for(var o=this.dijkstra({root:n,weight:a,directed:i}),l=0,u=this.nodes(),c=0;c<u.length;c++){var d=u[c];if(!d.same(n)){var f=o.distanceTo(d);s?l+=1/f:l+=f}}return s?l:1/l}};Xi.cc=Xi.closenessCentrality;Xi.ccn=Xi.closenessCentralityNormalised=Xi.closenessCentralityNormalized;var s5=Kt({weight:null,directed:!1}),j0={betweennessCentrality:function(e){for(var r=s5(e),n=r.directed,a=r.weight,i=a!=null,s=this.cy(),o=this.nodes(),l={},u={},c=0,d={set:function(y,w){u[y]=w,w>c&&(c=w)},get:function(y){return u[y]}},f=0;f<o.length;f++){var h=o[f],v=h.id();n?l[v]=h.outgoers().nodes():l[v]=h.openNeighborhood().nodes(),d.set(v,0)}for(var x=function(){for(var y=o[b].id(),w=[],E={},S={},C={},k=new nl(function(q,$){return C[q]-C[$]}),T=0;T<o.length;T++){var _=o[T].id();E[_]=[],S[_]=0,C[_]=1/0}for(S[y]=1,C[y]=0,k.push(y);!k.empty();){var N=k.pop();if(w.push(N),i)for(var P=0;P<l[N].length;P++){var R=l[N][P],I=s.getElementById(N),M=void 0;I.edgesTo(R).length>0?M=I.edgesTo(R)[0]:M=R.edgesTo(I)[0];var D=a(M);R=R.id(),C[R]>C[N]+D&&(C[R]=C[N]+D,k.nodes.indexOf(R)<0?k.push(R):k.updateItem(R),S[R]=0,E[R]=[]),C[R]==C[N]+D&&(S[R]=S[R]+S[N],E[R].push(N))}else for(var L=0;L<l[N].length;L++){var j=l[N][L].id();C[j]==1/0&&(k.push(j),C[j]=C[N]+1),C[j]==C[N]+1&&(S[j]=S[j]+S[N],E[j].push(N))}}for(var F={},O=0;O<o.length;O++)F[o[O].id()]=0;for(;w.length>0;){for(var B=w.pop(),V=0;V<E[B].length;V++){var J=E[B][V];F[J]=F[J]+S[J]/S[B]*(1+F[B])}B!=o[b].id()&&d.set(B,d.get(B)+F[B])}},b=0;b<o.length;b++)x();var m={betweenness:function(y){var w=s.collection(y).id();return d.get(w)},betweennessNormalized:function(y){if(c==0)return 0;var w=s.collection(y).id();return d.get(w)/c}};return m.betweennessNormalised=m.betweennessNormalized,m}};j0.bc=j0.betweennessCentrality;var o5=Kt({expandFactor:2,inflateFactor:2,multFactor:1,maxIterations:20,attributes:[function(t){return 1}]}),l5=function(e){return o5(e)},u5=function(e,r){for(var n=0,a=0;a<r.length;a++)n+=r[a](e);return n},c5=function(e,r,n){for(var a=0;a<r;a++)e[a*r+a]=n},aA=function(e,r){for(var n,a=0;a<r;a++){n=0;for(var i=0;i<r;i++)n+=e[i*r+a];for(var s=0;s<r;s++)e[s*r+a]=e[s*r+a]/n}},d5=function(e,r,n){for(var a=new Array(n*n),i=0;i<n;i++){for(var s=0;s<n;s++)a[i*n+s]=0;for(var o=0;o<n;o++)for(var l=0;l<n;l++)a[i*n+l]+=e[i*n+o]*r[o*n+l]}return a},f5=function(e,r,n){for(var a=e.slice(0),i=1;i<n;i++)e=d5(e,a,r);return e},v5=function(e,r,n){for(var a=new Array(r*r),i=0;i<r*r;i++)a[i]=Math.pow(e[i],n);return aA(a,r),a},h5=function(e,r,n,a){for(var i=0;i<n;i++){var s=Math.round(e[i]*Math.pow(10,a))/Math.pow(10,a),o=Math.round(r[i]*Math.pow(10,a))/Math.pow(10,a);if(s!==o)return!1}return!0},p5=function(e,r,n,a){for(var i=[],s=0;s<r;s++){for(var o=[],l=0;l<r;l++)Math.round(e[s*r+l]*1e3)/1e3>0&&o.push(n[l]);o.length!==0&&i.push(a.collection(o))}return i},g5=function(e,r){for(var n=0;n<e.length;n++)if(!r[n]||e[n].id()!==r[n].id())return!1;return!0},m5=function(e){for(var r=0;r<e.length;r++)for(var n=0;n<e.length;n++)r!=n&&g5(e[r],e[n])&&e.splice(n,1);return e},jw=function(e){for(var r=this.nodes(),n=this.edges(),a=this.cy(),i=l5(e),s={},o=0;o<r.length;o++)s[r[o].id()]=o;for(var l=r.length,u=l*l,c=new Array(u),d,f=0;f<u;f++)c[f]=0;for(var h=0;h<n.length;h++){var v=n[h],x=s[v.source().id()],b=s[v.target().id()],m=u5(v,i.attributes);c[x*l+b]+=m,c[b*l+x]+=m}c5(c,l,i.multFactor),aA(c,l);for(var p=!0,y=0;p&&y<i.maxIterations;)p=!1,d=f5(c,l,i.expandFactor),c=v5(d,l,i.inflateFactor),h5(c,d,u,4)||(p=!0),y++;var w=p5(c,l,r,a);return w=m5(w),w},y5={markovClustering:jw,mcl:jw},x5=function(e){return e},iA=function(e,r){return Math.abs(r-e)},Iw=function(e,r,n){return e+iA(r,n)},Mw=function(e,r,n){return e+Math.pow(n-r,2)},b5=function(e){return Math.sqrt(e)},w5=function(e,r,n){return Math.max(e,iA(r,n))},qs=function(e,r,n,a,i){for(var s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:x5,o=a,l,u,c=0;c<e;c++)l=r(c),u=n(c),o=i(o,l,u);return s(o)},os={euclidean:function(e,r,n){return e>=2?qs(e,r,n,0,Mw,b5):qs(e,r,n,0,Iw)},squaredEuclidean:function(e,r,n){return qs(e,r,n,0,Mw)},manhattan:function(e,r,n){return qs(e,r,n,0,Iw)},max:function(e,r,n){return qs(e,r,n,-1/0,w5)}};os["squared-euclidean"]=os.squaredEuclidean;os.squaredeuclidean=os.squaredEuclidean;function Ac(t,e,r,n,a,i){var s;return gt(t)?s=t:s=os[t]||os.euclidean,e===0&>(t)?s(a,i):s(e,r,n,a,i)}var S5=Kt({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),o1=function(e){return S5(e)},ec=function(e,r,n,a,i){var s=i!=="kMedoids",o=s?function(d){return n[d]}:function(d){return a[d](n)},l=function(f){return a[f](r)},u=n,c=r;return Ac(e,a.length,o,l,u,c)},sf=function(e,r,n){for(var a=n.length,i=new Array(a),s=new Array(a),o=new Array(r),l=null,u=0;u<a;u++)i[u]=e.min(n[u]).value,s[u]=e.max(n[u]).value;for(var c=0;c<r;c++){l=[];for(var d=0;d<a;d++)l[d]=Math.random()*(s[d]-i[d])+i[d];o[c]=l}return o},sA=function(e,r,n,a,i){for(var s=1/0,o=0,l=0;l<r.length;l++){var u=ec(n,e,r[l],a,i);u<s&&(s=u,o=l)}return o},oA=function(e,r,n){for(var a=[],i=null,s=0;s<r.length;s++)i=r[s],n[i.id()]===e&&a.push(i);return a},E5=function(e,r,n){return Math.abs(r-e)<=n},C5=function(e,r,n){for(var a=0;a<e.length;a++)for(var i=0;i<e[a].length;i++){var s=Math.abs(e[a][i]-r[a][i]);if(s>n)return!1}return!0},k5=function(e,r,n){for(var a=0;a<n;a++)if(e===r[a])return!0;return!1},Dw=function(e,r){var n=new Array(r);if(e.length<50)for(var a=0;a<r;a++){for(var i=e[Math.floor(Math.random()*e.length)];k5(i,n,a);)i=e[Math.floor(Math.random()*e.length)];n[a]=i}else for(var s=0;s<r;s++)n[s]=e[Math.floor(Math.random()*e.length)];return n},Lw=function(e,r,n){for(var a=0,i=0;i<r.length;i++)a+=ec("manhattan",r[i],e,n,"kMedoids");return a},T5=function(e){var r=this.cy(),n=this.nodes(),a=null,i=o1(e),s=new Array(i.k),o={},l;i.testMode?typeof i.testCentroids=="number"?(i.testCentroids,l=sf(n,i.k,i.attributes)):It(i.testCentroids)==="object"?l=i.testCentroids:l=sf(n,i.k,i.attributes):l=sf(n,i.k,i.attributes);for(var u=!0,c=0;u&&c<i.maxIterations;){for(var d=0;d<n.length;d++)a=n[d],o[a.id()]=sA(a,l,i.distance,i.attributes,"kMeans");u=!1;for(var f=0;f<i.k;f++){var h=oA(f,n,o);if(h.length!==0){for(var v=i.attributes.length,x=l[f],b=new Array(v),m=new Array(v),p=0;p<v;p++){m[p]=0;for(var y=0;y<h.length;y++)a=h[y],m[p]+=i.attributes[p](a);b[p]=m[p]/h.length,E5(b[p],x[p],i.sensitivityThreshold)||(u=!0)}l[f]=b,s[f]=r.collection(h)}}c++}return s},_5=function(e){var r=this.cy(),n=this.nodes(),a=null,i=o1(e),s=new Array(i.k),o,l={},u,c=new Array(i.k);i.testMode?typeof i.testCentroids=="number"||(It(i.testCentroids)==="object"?o=i.testCentroids:o=Dw(n,i.k)):o=Dw(n,i.k);for(var d=!0,f=0;d&&f<i.maxIterations;){for(var h=0;h<n.length;h++)a=n[h],l[a.id()]=sA(a,o,i.distance,i.attributes,"kMedoids");d=!1;for(var v=0;v<o.length;v++){var x=oA(v,n,l);if(x.length!==0){c[v]=Lw(o[v],x,i.attributes);for(var b=0;b<x.length;b++)u=Lw(x[b],x,i.attributes),u<c[v]&&(c[v]=u,o[v]=x[b],d=!0);s[v]=r.collection(x)}}f++}return s},N5=function(e,r,n,a,i){for(var s,o,l=0;l<r.length;l++)for(var u=0;u<e.length;u++)a[l][u]=Math.pow(n[l][u],i.m);for(var c=0;c<e.length;c++)for(var d=0;d<i.attributes.length;d++){s=0,o=0;for(var f=0;f<r.length;f++)s+=a[f][c]*i.attributes[d](r[f]),o+=a[f][c];e[c][d]=s/o}},R5=function(e,r,n,a,i){for(var s=0;s<e.length;s++)r[s]=e[s].slice();for(var o,l,u,c=2/(i.m-1),d=0;d<n.length;d++)for(var f=0;f<a.length;f++){o=0;for(var h=0;h<n.length;h++)l=ec(i.distance,a[f],n[d],i.attributes,"cmeans"),u=ec(i.distance,a[f],n[h],i.attributes,"cmeans"),o+=Math.pow(l/u,c);e[f][d]=1/o}},P5=function(e,r,n,a){for(var i=new Array(n.k),s=0;s<i.length;s++)i[s]=[];for(var o,l,u=0;u<r.length;u++){o=-1/0,l=-1;for(var c=0;c<r[0].length;c++)r[u][c]>o&&(o=r[u][c],l=c);i[l].push(e[u])}for(var d=0;d<i.length;d++)i[d]=a.collection(i[d]);return i},Bw=function(e){var r=this.cy(),n=this.nodes(),a=o1(e),i,s,o,l,u;l=new Array(n.length);for(var c=0;c<n.length;c++)l[c]=new Array(a.k);o=new Array(n.length);for(var d=0;d<n.length;d++)o[d]=new Array(a.k);for(var f=0;f<n.length;f++){for(var h=0,v=0;v<a.k;v++)o[f][v]=Math.random(),h+=o[f][v];for(var x=0;x<a.k;x++)o[f][x]=o[f][x]/h}s=new Array(a.k);for(var b=0;b<a.k;b++)s[b]=new Array(a.attributes.length);u=new Array(n.length);for(var m=0;m<n.length;m++)u[m]=new Array(a.k);for(var p=!0,y=0;p&&y<a.maxIterations;)p=!1,N5(s,n,o,u,a),R5(o,l,s,n,a),C5(o,l,a.sensitivityThreshold)||(p=!0),y++;return i=P5(n,o,a,r),{clusters:i,degreeOfMembership:o}},A5={kMeans:T5,kMedoids:_5,fuzzyCMeans:Bw,fcm:Bw},j5=Kt({distance:"euclidean",linkage:"min",mode:"threshold",threshold:1/0,addDendrogram:!1,dendrogramDepth:0,attributes:[]}),I5={single:"min",complete:"max"},M5=function(e){var r=j5(e),n=I5[r.linkage];return n!=null&&(r.linkage=n),r},Ow=function(e,r,n,a,i){for(var s=0,o=1/0,l,u=i.attributes,c=function(T,_){return Ac(i.distance,u.length,function(N){return u[N](T)},function(N){return u[N](_)},T,_)},d=0;d<e.length;d++){var f=e[d].key,h=n[f][a[f]];h<o&&(s=f,o=h)}if(i.mode==="threshold"&&o>=i.threshold||i.mode==="dendrogram"&&e.length===1)return!1;var v=r[s],x=r[a[s]],b;i.mode==="dendrogram"?b={left:v,right:x,key:v.key}:b={value:v.value.concat(x.value),key:v.key},e[v.index]=b,e.splice(x.index,1),r[v.key]=b;for(var m=0;m<e.length;m++){var p=e[m];v.key===p.key?l=1/0:i.linkage==="min"?(l=n[v.key][p.key],n[v.key][p.key]>n[x.key][p.key]&&(l=n[x.key][p.key])):i.linkage==="max"?(l=n[v.key][p.key],n[v.key][p.key]<n[x.key][p.key]&&(l=n[x.key][p.key])):i.linkage==="mean"?l=(n[v.key][p.key]*v.size+n[x.key][p.key]*x.size)/(v.size+x.size):i.mode==="dendrogram"?l=c(p.value,v.value):l=c(p.value[0],v.value[0]),n[v.key][p.key]=n[p.key][v.key]=l}for(var y=0;y<e.length;y++){var w=e[y].key;if(a[w]===v.key||a[w]===x.key){for(var E=w,S=0;S<e.length;S++){var C=e[S].key;n[w][C]<n[w][E]&&(E=C)}a[w]=E}e[y].index=y}return v.key=x.key=v.index=x.index=null,!0},qi=function(e,r,n){e&&(e.value?r.push(e.value):(e.left&&qi(e.left,r),e.right&&qi(e.right,r)))},I0=function(e,r){if(!e)return"";if(e.left&&e.right){var n=I0(e.left,r),a=I0(e.right,r),i=r.add({group:"nodes",data:{id:n+","+a}});return r.add({group:"edges",data:{source:n,target:i.id()}}),r.add({group:"edges",data:{source:a,target:i.id()}}),i.id()}else if(e.value)return e.value.id()},M0=function(e,r,n){if(!e)return[];var a=[],i=[],s=[];return r===0?(e.left&&qi(e.left,a),e.right&&qi(e.right,i),s=a.concat(i),[n.collection(s)]):r===1?e.value?[n.collection(e.value)]:(e.left&&qi(e.left,a),e.right&&qi(e.right,i),[n.collection(a),n.collection(i)]):e.value?[n.collection(e.value)]:(e.left&&(a=M0(e.left,r-1,n)),e.right&&(i=M0(e.right,r-1,n)),a.concat(i))},qw=function(e){for(var r=this.cy(),n=this.nodes(),a=M5(e),i=a.attributes,s=function(y,w){return Ac(a.distance,i.length,function(E){return i[E](y)},function(E){return i[E](w)},y,w)},o=[],l=[],u=[],c=[],d=0;d<n.length;d++){var f={value:a.mode==="dendrogram"?n[d]:[n[d]],key:d,index:d};o[d]=f,c[d]=f,l[d]=[],u[d]=0}for(var h=0;h<o.length;h++)for(var v=0;v<=h;v++){var x=void 0;a.mode==="dendrogram"?x=h===v?1/0:s(o[h].value,o[v].value):x=h===v?1/0:s(o[h].value[0],o[v].value[0]),l[h][v]=x,l[v][h]=x,x<l[h][u[h]]&&(u[h]=v)}for(var b=Ow(o,c,l,u,a);b;)b=Ow(o,c,l,u,a);var m;return a.mode==="dendrogram"?(m=M0(o[0],a.dendrogramDepth,r),a.addDendrogram&&I0(o[0],r)):(m=new Array(o.length),o.forEach(function(p,y){p.key=p.index=null,m[y]=r.collection(p.value)})),m},D5={hierarchicalClustering:qw,hca:qw},L5=Kt({distance:"euclidean",preference:"median",damping:.8,maxIterations:1e3,minIterations:100,attributes:[]}),B5=function(e){var r=e.damping,n=e.preference;.5<=r&&r<1||ct("Damping must range on [0.5, 1). Got: ".concat(r));var a=["median","mean","min","max"];return a.some(function(i){return i===n})||le(n)||ct("Preference must be one of [".concat(a.map(function(i){return"'".concat(i,"'")}).join(", "),"] or a number. Got: ").concat(n)),L5(e)},O5=function(e,r,n,a){var i=function(o,l){return a[l](o)};return-Ac(e,a.length,function(s){return i(r,s)},function(s){return i(n,s)},r,n)},q5=function(e,r){var n=null;return r==="median"?n=BO(e):r==="mean"?n=LO(e):r==="min"?n=MO(e):r==="max"?n=DO(e):n=r,n},F5=function(e,r,n){for(var a=[],i=0;i<e;i++)r[i*e+i]+n[i*e+i]>0&&a.push(i);return a},Fw=function(e,r,n){for(var a=[],i=0;i<e;i++){for(var s=-1,o=-1/0,l=0;l<n.length;l++){var u=n[l];r[i*e+u]>o&&(s=u,o=r[i*e+u])}s>0&&a.push(s)}for(var c=0;c<n.length;c++)a[n[c]]=n[c];return a},$5=function(e,r,n){for(var a=Fw(e,r,n),i=0;i<n.length;i++){for(var s=[],o=0;o<a.length;o++)a[o]===n[i]&&s.push(o);for(var l=-1,u=-1/0,c=0;c<s.length;c++){for(var d=0,f=0;f<s.length;f++)d+=r[s[f]*e+s[c]];d>u&&(l=c,u=d)}n[i]=s[l]}return a=Fw(e,r,n),a},$w=function(e){for(var r=this.cy(),n=this.nodes(),a=B5(e),i={},s=0;s<n.length;s++)i[n[s].id()]=s;var o,l,u,c,d,f;o=n.length,l=o*o,u=new Array(l);for(var h=0;h<l;h++)u[h]=-1/0;for(var v=0;v<o;v++)for(var x=0;x<o;x++)v!==x&&(u[v*o+x]=O5(a.distance,n[v],n[x],a.attributes));c=q5(u,a.preference);for(var b=0;b<o;b++)u[b*o+b]=c;d=new Array(l);for(var m=0;m<l;m++)d[m]=0;f=new Array(l);for(var p=0;p<l;p++)f[p]=0;for(var y=new Array(o),w=new Array(o),E=new Array(o),S=0;S<o;S++)y[S]=0,w[S]=0,E[S]=0;for(var C=new Array(o*a.minIterations),k=0;k<C.length;k++)C[k]=0;var T;for(T=0;T<a.maxIterations;T++){for(var _=0;_<o;_++){for(var N=-1/0,P=-1/0,R=-1,I=0,M=0;M<o;M++)y[M]=d[_*o+M],I=f[_*o+M]+u[_*o+M],I>=N?(P=N,N=I,R=M):I>P&&(P=I);for(var D=0;D<o;D++)d[_*o+D]=(1-a.damping)*(u[_*o+D]-N)+a.damping*y[D];d[_*o+R]=(1-a.damping)*(u[_*o+R]-P)+a.damping*y[R]}for(var L=0;L<o;L++){for(var j=0,F=0;F<o;F++)y[F]=f[F*o+L],w[F]=Math.max(0,d[F*o+L]),j+=w[F];j-=w[L],w[L]=d[L*o+L],j+=w[L];for(var O=0;O<o;O++)f[O*o+L]=(1-a.damping)*Math.min(0,j-w[O])+a.damping*y[O];f[L*o+L]=(1-a.damping)*(j-w[L])+a.damping*y[L]}for(var B=0,V=0;V<o;V++){var J=f[V*o+V]+d[V*o+V]>0?1:0;C[T%a.minIterations*o+V]=J,B+=J}if(B>0&&(T>=a.minIterations-1||T==a.maxIterations-1)){for(var q=0,$=0;$<o;$++){E[$]=0;for(var z=0;z<a.minIterations;z++)E[$]+=C[z*o+$];(E[$]===0||E[$]===a.minIterations)&&q++}if(q===o)break}}for(var W=F5(o,d,f),ne=$5(o,u,W),X={},U=0;U<W.length;U++)X[W[U]]=[];for(var H=0;H<n.length;H++){var Y=i[n[H].id()],ee=ne[Y];ee!=null&&X[ee].push(n[H])}for(var ie=new Array(W.length),oe=0;oe<W.length;oe++)ie[oe]=r.collection(X[W[oe]]);return ie},z5={affinityPropagation:$w,ap:$w},V5=Kt({root:void 0,directed:!1}),U5={hierholzer:function(e){if(!Ue(e)){var r=arguments;e={root:r[0],directed:r[1]}}var n=V5(e),a=n.root,i=n.directed,s=this,o=!1,l,u,c;a&&(c=Ee(a)?this.filter(a)[0].id():a[0].id());var d={},f={};i?s.forEach(function(p){var y=p.id();if(p.isNode()){var w=p.indegree(!0),E=p.outdegree(!0),S=w-E,C=E-w;S==1?l?o=!0:l=y:C==1?u?o=!0:u=y:(C>1||S>1)&&(o=!0),d[y]=[],p.outgoers().forEach(function(k){k.isEdge()&&d[y].push(k.id())})}else f[y]=[void 0,p.target().id()]}):s.forEach(function(p){var y=p.id();if(p.isNode()){var w=p.degree(!0);w%2&&(l?u?o=!0:u=y:l=y),d[y]=[],p.connectedEdges().forEach(function(E){return d[y].push(E.id())})}else f[y]=[p.source().id(),p.target().id()]});var h={found:!1,trail:void 0};if(o)return h;if(u&&l)if(i){if(c&&u!=c)return h;c=u}else{if(c&&u!=c&&l!=c)return h;c||(c=u)}else c||(c=s[0].id());var v=function(y){for(var w=y,E=[y],S,C,k;d[w].length;)S=d[w].shift(),C=f[S][0],k=f[S][1],w!=k?(d[k]=d[k].filter(function(T){return T!=S}),w=k):!i&&w!=C&&(d[C]=d[C].filter(function(T){return T!=S}),w=C),E.unshift(S),E.unshift(w);return E},x=[],b=[];for(b=v(c);b.length!=1;)d[b[0]].length==0?(x.unshift(s.getElementById(b.shift())),x.unshift(s.getElementById(b.shift()))):b=v(b.shift()).concat(b);x.unshift(s.getElementById(b.shift()));for(var m in d)if(d[m].length)return h;return h.found=!0,h.trail=this.spawn(x,!0),h}},$l=function(){var e=this,r={},n=0,a=0,i=[],s=[],o={},l=function(f,h){for(var v=s.length-1,x=[],b=e.spawn();s[v].x!=f||s[v].y!=h;)x.push(s.pop().edge),v--;x.push(s.pop().edge),x.forEach(function(m){var p=m.connectedNodes().intersection(e);b.merge(m),p.forEach(function(y){var w=y.id(),E=y.connectedEdges().intersection(e);b.merge(y),r[w].cutVertex?b.merge(E.filter(function(S){return S.isLoop()})):b.merge(E)})}),i.push(b)},u=function(f,h,v){f===v&&(a+=1),r[h]={id:n,low:n++,cutVertex:!1};var x=e.getElementById(h).connectedEdges().intersection(e);if(x.size()===0)i.push(e.spawn(e.getElementById(h)));else{var b,m,p,y;x.forEach(function(w){b=w.source().id(),m=w.target().id(),p=b===h?m:b,p!==v&&(y=w.id(),o[y]||(o[y]=!0,s.push({x:h,y:p,edge:w})),p in r?r[h].low=Math.min(r[h].low,r[p].id):(u(f,p,h),r[h].low=Math.min(r[h].low,r[p].low),r[h].id<=r[p].low&&(r[h].cutVertex=!0,l(h,p))))})}};e.forEach(function(d){if(d.isNode()){var f=d.id();f in r||(a=0,u(f,f),r[f].cutVertex=a>1)}});var c=Object.keys(r).filter(function(d){return r[d].cutVertex}).map(function(d){return e.getElementById(d)});return{cut:e.spawn(c),components:i}},G5={hopcroftTarjanBiconnected:$l,htbc:$l,htb:$l,hopcroftTarjanBiconnectedComponents:$l},zl=function(){var e=this,r={},n=0,a=[],i=[],s=e.spawn(e),o=function(u){i.push(u),r[u]={index:n,low:n++,explored:!1};var c=e.getElementById(u).connectedEdges().intersection(e);if(c.forEach(function(x){var b=x.target().id();b!==u&&(b in r||o(b),r[b].explored||(r[u].low=Math.min(r[u].low,r[b].low)))}),r[u].index===r[u].low){for(var d=e.spawn();;){var f=i.pop();if(d.merge(e.getElementById(f)),r[f].low=r[u].index,r[f].explored=!0,f===u)break}var h=d.edgesWith(d),v=d.merge(h);a.push(v),s=s.difference(v)}};return e.forEach(function(l){if(l.isNode()){var u=l.id();u in r||o(u)}}),{cut:s,components:a}},H5={tarjanStronglyConnected:zl,tsc:zl,tscc:zl,tarjanStronglyConnectedComponents:zl},lA={};[Lo,SO,EO,kO,_O,RO,jO,i5,Yi,Xi,j0,y5,A5,D5,z5,U5,G5,H5].forEach(function(t){Te(lA,t)});/*!
|
|
44
|
+
Embeddable Minimum Strictly-Compliant Promises/A+ 1.1.1 Thenable
|
|
45
|
+
Copyright (c) 2013-2014 Ralf S. Engelschall (http://engelschall.com)
|
|
46
|
+
Licensed under The MIT License (http://opensource.org/licenses/MIT)
|
|
47
|
+
*/var uA=0,cA=1,dA=2,rn=function(e){if(!(this instanceof rn))return new rn(e);this.id="Thenable/1.0.7",this.state=uA,this.fulfillValue=void 0,this.rejectReason=void 0,this.onFulfilled=[],this.onRejected=[],this.proxy={then:this.then.bind(this)},typeof e=="function"&&e.call(this,this.fulfill.bind(this),this.reject.bind(this))};rn.prototype={fulfill:function(e){return zw(this,cA,"fulfillValue",e)},reject:function(e){return zw(this,dA,"rejectReason",e)},then:function(e,r){var n=this,a=new rn;return n.onFulfilled.push(Uw(e,a,"fulfill")),n.onRejected.push(Uw(r,a,"reject")),fA(n),a.proxy}};var zw=function(e,r,n,a){return e.state===uA&&(e.state=r,e[n]=a,fA(e)),e},fA=function(e){e.state===cA?Vw(e,"onFulfilled",e.fulfillValue):e.state===dA&&Vw(e,"onRejected",e.rejectReason)},Vw=function(e,r,n){if(e[r].length!==0){var a=e[r];e[r]=[];var i=function(){for(var o=0;o<a.length;o++)a[o](n)};typeof setImmediate=="function"?setImmediate(i):setTimeout(i,0)}},Uw=function(e,r,n){return function(a){if(typeof e!="function")r[n].call(r,a);else{var i;try{i=e(a)}catch(s){r.reject(s);return}vA(r,i)}}},vA=function(e,r){if(e===r||e.proxy===r){e.reject(new TypeError("cannot resolve promise with itself"));return}var n;if(It(r)==="object"&&r!==null||typeof r=="function")try{n=r.then}catch(i){e.reject(i);return}if(typeof n=="function"){var a=!1;try{n.call(r,function(i){a||(a=!0,i===r?e.reject(new TypeError("circular thenable chain")):vA(e,i))},function(i){a||(a=!0,e.reject(i))})}catch(i){a||e.reject(i)}return}e.fulfill(r)};rn.all=function(t){return new rn(function(e,r){for(var n=new Array(t.length),a=0,i=function(l,u){n[l]=u,a++,a===t.length&&e(n)},s=0;s<t.length;s++)(function(o){var l=t[o],u=l!=null&&l.then!=null;if(u)l.then(function(d){i(o,d)},function(d){r(d)});else{var c=l;i(o,c)}})(s)})};rn.resolve=function(t){return new rn(function(e,r){e(t)})};rn.reject=function(t){return new rn(function(e,r){r(t)})};var hs=typeof Promise<"u"?Promise:rn,D0=function(e,r,n){var a=Zx(e),i=!a,s=this._private=Te({duration:1e3},r,n);if(s.target=e,s.style=s.style||s.css,s.started=!1,s.playing=!1,s.hooked=!1,s.applying=!1,s.progress=0,s.completes=[],s.frames=[],s.complete&>(s.complete)&&s.completes.push(s.complete),i){var o=e.position();s.startPosition=s.startPosition||{x:o.x,y:o.y},s.startStyle=s.startStyle||e.cy().style().getAnimationStartStyle(e,s.style)}if(a){var l=e.pan();s.startPan={x:l.x,y:l.y},s.startZoom=e.zoom()}this.length=1,this[0]=this},ii=D0.prototype;Te(ii,{instanceString:function(){return"animation"},hook:function(){var e=this._private;if(!e.hooked){var r,n=e.target._private.animation;e.queue?r=n.queue:r=n.current,r.push(this),_r(e.target)&&e.target.cy().addToAnimationPool(e.target),e.hooked=!0}return this},play:function(){var e=this._private;return e.progress===1&&(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 r=this._private;return e===void 0?r.progress*r.duration:this.progress(e/r.duration)},progress:function(e){var r=this._private,n=r.playing;return e===void 0?r.progress:(n&&this.pause(),r.progress=e,r.started=!1,n&&this.play(),this)},completed:function(){return this._private.progress===1},reverse:function(){var e=this._private,r=e.playing;r&&this.pause(),e.progress=1-e.progress,e.started=!1;var n=function(u,c){var d=e[u];d!=null&&(e[u]=e[c],e[c]=d)};if(n("zoom","startZoom"),n("pan","startPan"),n("position","startPosition"),e.style)for(var a=0;a<e.style.length;a++){var i=e.style[a],s=i.name,o=e.startStyle[s];e.startStyle[s]=i,e.style[a]=o}return r&&this.play(),this},promise:function(e){var r=this._private,n;switch(e){case"frame":n=r.frames;break;default:case"complete":case"completed":n=r.completes}return new hs(function(a,i){n.push(function(){a()})})}});ii.complete=ii.completed;ii.run=ii.play;ii.running=ii.playing;var W5={animated:function(){return function(){var r=this,n=r.length!==void 0,a=n?r:[r],i=this._private.cy||this;if(!i.styleEnabled())return!1;var s=a[0];if(s)return s._private.animation.current.length>0}},clearQueue:function(){return function(){var r=this,n=r.length!==void 0,a=n?r:[r],i=this._private.cy||this;if(!i.styleEnabled())return this;for(var s=0;s<a.length;s++){var o=a[s];o._private.animation.queue=[]}return this}},delay:function(){return function(r,n){var a=this._private.cy||this;return a.styleEnabled()?this.animate({delay:r,duration:r,complete:n}):this}},delayAnimation:function(){return function(r,n){var a=this._private.cy||this;return a.styleEnabled()?this.animation({delay:r,duration:r,complete:n}):this}},animation:function(){return function(r,n){var a=this,i=a.length!==void 0,s=i?a:[a],o=this._private.cy||this,l=!i,u=!l;if(!o.styleEnabled())return this;var c=o.style();r=Te({},r,n);var d=Object.keys(r).length===0;if(d)return new D0(s[0],r);switch(r.duration===void 0&&(r.duration=400),r.duration){case"slow":r.duration=600;break;case"fast":r.duration=200;break}if(u&&(r.style=c.getPropsList(r.style||r.css),r.css=void 0),u&&r.renderedPosition!=null){var f=r.renderedPosition,h=o.pan(),v=o.zoom();r.position=QP(f,v,h)}if(l&&r.panBy!=null){var x=r.panBy,b=o.pan();r.pan={x:b.x+x.x,y:b.y+x.y}}var m=r.center||r.centre;if(l&&m!=null){var p=o.getCenterPan(m.eles,r.zoom);p!=null&&(r.pan=p)}if(l&&r.fit!=null){var y=r.fit,w=o.getFitViewport(y.eles||y.boundingBox,y.padding);w!=null&&(r.pan=w.pan,r.zoom=w.zoom)}if(l&&Ue(r.zoom)){var E=o.getZoomedViewport(r.zoom);E!=null?(E.zoomed&&(r.zoom=E.zoom),E.panned&&(r.pan=E.pan)):r.zoom=null}return new D0(s[0],r)}},animate:function(){return function(r,n){var a=this,i=a.length!==void 0,s=i?a:[a],o=this._private.cy||this;if(!o.styleEnabled())return this;n&&(r=Te({},r,n));for(var l=0;l<s.length;l++){var u=s[l],c=u.animated()&&(r.queue===void 0||r.queue),d=u.animation(r,c?{queue:!0}:void 0);d.play()}return this}},stop:function(){return function(r,n){var a=this,i=a.length!==void 0,s=i?a:[a],o=this._private.cy||this;if(!o.styleEnabled())return this;for(var l=0;l<s.length;l++){for(var u=s[l],c=u._private,d=c.animation.current,f=0;f<d.length;f++){var h=d[f],v=h._private;n&&(v.duration=0)}r&&(c.animation.queue=[]),n||(c.animation.current=[])}return o.notify("draw"),this}}},of,Gw;function jc(){if(Gw)return of;Gw=1;var t=Array.isArray;return of=t,of}var lf,Hw;function K5(){if(Hw)return lf;Hw=1;var t=jc(),e=tl(),r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;function a(i,s){if(t(i))return!1;var o=typeof i;return o=="number"||o=="symbol"||o=="boolean"||i==null||e(i)?!0:n.test(i)||!r.test(i)||s!=null&&i in Object(s)}return lf=a,lf}var uf,Ww;function Y5(){if(Ww)return uf;Ww=1;var t=VP(),e=el(),r="[object AsyncFunction]",n="[object Function]",a="[object GeneratorFunction]",i="[object Proxy]";function s(o){if(!e(o))return!1;var l=t(o);return l==n||l==a||l==r||l==i}return uf=s,uf}var cf,Kw;function X5(){if(Kw)return cf;Kw=1;var t=Nc(),e=t["__core-js_shared__"];return cf=e,cf}var df,Yw;function Z5(){if(Yw)return df;Yw=1;var t=X5(),e=function(){var n=/[^.]+$/.exec(t&&t.keys&&t.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}();function r(n){return!!e&&e in n}return df=r,df}var ff,Xw;function Q5(){if(Xw)return ff;Xw=1;var t=Function.prototype,e=t.toString;function r(n){if(n!=null){try{return e.call(n)}catch{}try{return n+""}catch{}}return""}return ff=r,ff}var vf,Zw;function J5(){if(Zw)return vf;Zw=1;var t=Y5(),e=Z5(),r=el(),n=Q5(),a=/[\\^$.*+?()[\]{}|]/g,i=/^\[object .+?Constructor\]$/,s=Function.prototype,o=Object.prototype,l=s.toString,u=o.hasOwnProperty,c=RegExp("^"+l.call(u).replace(a,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function d(f){if(!r(f)||e(f))return!1;var h=t(f)?c:i;return h.test(n(f))}return vf=d,vf}var hf,Qw;function eq(){if(Qw)return hf;Qw=1;function t(e,r){return e==null?void 0:e[r]}return hf=t,hf}var pf,Jw;function l1(){if(Jw)return pf;Jw=1;var t=J5(),e=eq();function r(n,a){var i=e(n,a);return t(i)?i:void 0}return pf=r,pf}var gf,eS;function Ic(){if(eS)return gf;eS=1;var t=l1(),e=t(Object,"create");return gf=e,gf}var mf,tS;function tq(){if(tS)return mf;tS=1;var t=Ic();function e(){this.__data__=t?t(null):{},this.size=0}return mf=e,mf}var yf,rS;function rq(){if(rS)return yf;rS=1;function t(e){var r=this.has(e)&&delete this.__data__[e];return this.size-=r?1:0,r}return yf=t,yf}var xf,nS;function nq(){if(nS)return xf;nS=1;var t=Ic(),e="__lodash_hash_undefined__",r=Object.prototype,n=r.hasOwnProperty;function a(i){var s=this.__data__;if(t){var o=s[i];return o===e?void 0:o}return n.call(s,i)?s[i]:void 0}return xf=a,xf}var bf,aS;function aq(){if(aS)return bf;aS=1;var t=Ic(),e=Object.prototype,r=e.hasOwnProperty;function n(a){var i=this.__data__;return t?i[a]!==void 0:r.call(i,a)}return bf=n,bf}var wf,iS;function iq(){if(iS)return wf;iS=1;var t=Ic(),e="__lodash_hash_undefined__";function r(n,a){var i=this.__data__;return this.size+=this.has(n)?0:1,i[n]=t&&a===void 0?e:a,this}return wf=r,wf}var Sf,sS;function sq(){if(sS)return Sf;sS=1;var t=tq(),e=rq(),r=nq(),n=aq(),a=iq();function i(s){var o=-1,l=s==null?0:s.length;for(this.clear();++o<l;){var u=s[o];this.set(u[0],u[1])}}return i.prototype.clear=t,i.prototype.delete=e,i.prototype.get=r,i.prototype.has=n,i.prototype.set=a,Sf=i,Sf}var Ef,oS;function oq(){if(oS)return Ef;oS=1;function t(){this.__data__=[],this.size=0}return Ef=t,Ef}var Cf,lS;function hA(){if(lS)return Cf;lS=1;function t(e,r){return e===r||e!==e&&r!==r}return Cf=t,Cf}var kf,uS;function Mc(){if(uS)return kf;uS=1;var t=hA();function e(r,n){for(var a=r.length;a--;)if(t(r[a][0],n))return a;return-1}return kf=e,kf}var Tf,cS;function lq(){if(cS)return Tf;cS=1;var t=Mc(),e=Array.prototype,r=e.splice;function n(a){var i=this.__data__,s=t(i,a);if(s<0)return!1;var o=i.length-1;return s==o?i.pop():r.call(i,s,1),--this.size,!0}return Tf=n,Tf}var _f,dS;function uq(){if(dS)return _f;dS=1;var t=Mc();function e(r){var n=this.__data__,a=t(n,r);return a<0?void 0:n[a][1]}return _f=e,_f}var Nf,fS;function cq(){if(fS)return Nf;fS=1;var t=Mc();function e(r){return t(this.__data__,r)>-1}return Nf=e,Nf}var Rf,vS;function dq(){if(vS)return Rf;vS=1;var t=Mc();function e(r,n){var a=this.__data__,i=t(a,r);return i<0?(++this.size,a.push([r,n])):a[i][1]=n,this}return Rf=e,Rf}var Pf,hS;function fq(){if(hS)return Pf;hS=1;var t=oq(),e=lq(),r=uq(),n=cq(),a=dq();function i(s){var o=-1,l=s==null?0:s.length;for(this.clear();++o<l;){var u=s[o];this.set(u[0],u[1])}}return i.prototype.clear=t,i.prototype.delete=e,i.prototype.get=r,i.prototype.has=n,i.prototype.set=a,Pf=i,Pf}var Af,pS;function vq(){if(pS)return Af;pS=1;var t=l1(),e=Nc(),r=t(e,"Map");return Af=r,Af}var jf,gS;function hq(){if(gS)return jf;gS=1;var t=sq(),e=fq(),r=vq();function n(){this.size=0,this.__data__={hash:new t,map:new(r||e),string:new t}}return jf=n,jf}var If,mS;function pq(){if(mS)return If;mS=1;function t(e){var r=typeof e;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?e!=="__proto__":e===null}return If=t,If}var Mf,yS;function Dc(){if(yS)return Mf;yS=1;var t=pq();function e(r,n){var a=r.__data__;return t(n)?a[typeof n=="string"?"string":"hash"]:a.map}return Mf=e,Mf}var Df,xS;function gq(){if(xS)return Df;xS=1;var t=Dc();function e(r){var n=t(this,r).delete(r);return this.size-=n?1:0,n}return Df=e,Df}var Lf,bS;function mq(){if(bS)return Lf;bS=1;var t=Dc();function e(r){return t(this,r).get(r)}return Lf=e,Lf}var Bf,wS;function yq(){if(wS)return Bf;wS=1;var t=Dc();function e(r){return t(this,r).has(r)}return Bf=e,Bf}var Of,SS;function xq(){if(SS)return Of;SS=1;var t=Dc();function e(r,n){var a=t(this,r),i=a.size;return a.set(r,n),this.size+=a.size==i?0:1,this}return Of=e,Of}var qf,ES;function bq(){if(ES)return qf;ES=1;var t=hq(),e=gq(),r=mq(),n=yq(),a=xq();function i(s){var o=-1,l=s==null?0:s.length;for(this.clear();++o<l;){var u=s[o];this.set(u[0],u[1])}}return i.prototype.clear=t,i.prototype.delete=e,i.prototype.get=r,i.prototype.has=n,i.prototype.set=a,qf=i,qf}var Ff,CS;function wq(){if(CS)return Ff;CS=1;var t=bq(),e="Expected a function";function r(n,a){if(typeof n!="function"||a!=null&&typeof a!="function")throw new TypeError(e);var i=function(){var s=arguments,o=a?a.apply(this,s):s[0],l=i.cache;if(l.has(o))return l.get(o);var u=n.apply(this,s);return i.cache=l.set(o,u)||l,u};return i.cache=new(r.Cache||t),i}return r.Cache=t,Ff=r,Ff}var $f,kS;function Sq(){if(kS)return $f;kS=1;var t=wq(),e=500;function r(n){var a=t(n,function(s){return i.size===e&&i.clear(),s}),i=a.cache;return a}return $f=r,$f}var zf,TS;function pA(){if(TS)return zf;TS=1;var t=Sq(),e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,r=/\\(\\)?/g,n=t(function(a){var i=[];return a.charCodeAt(0)===46&&i.push(""),a.replace(e,function(s,o,l,u){i.push(l?u.replace(r,"$1"):o||s)}),i});return zf=n,zf}var Vf,_S;function gA(){if(_S)return Vf;_S=1;function t(e,r){for(var n=-1,a=e==null?0:e.length,i=Array(a);++n<a;)i[n]=r(e[n],n,e);return i}return Vf=t,Vf}var Uf,NS;function Eq(){if(NS)return Uf;NS=1;var t=Jx(),e=gA(),r=jc(),n=tl(),a=t?t.prototype:void 0,i=a?a.toString:void 0;function s(o){if(typeof o=="string")return o;if(r(o))return e(o,s)+"";if(n(o))return i?i.call(o):"";var l=o+"";return l=="0"&&1/o==-1/0?"-0":l}return Uf=s,Uf}var Gf,RS;function mA(){if(RS)return Gf;RS=1;var t=Eq();function e(r){return r==null?"":t(r)}return Gf=e,Gf}var Hf,PS;function yA(){if(PS)return Hf;PS=1;var t=jc(),e=K5(),r=pA(),n=mA();function a(i,s){return t(i)?i:e(i,s)?[i]:r(n(i))}return Hf=a,Hf}var Wf,AS;function u1(){if(AS)return Wf;AS=1;var t=tl();function e(r){if(typeof r=="string"||t(r))return r;var n=r+"";return n=="0"&&1/r==-1/0?"-0":n}return Wf=e,Wf}var Kf,jS;function Cq(){if(jS)return Kf;jS=1;var t=yA(),e=u1();function r(n,a){a=t(a,n);for(var i=0,s=a.length;n!=null&&i<s;)n=n[e(a[i++])];return i&&i==s?n:void 0}return Kf=r,Kf}var Yf,IS;function kq(){if(IS)return Yf;IS=1;var t=Cq();function e(r,n,a){var i=r==null?void 0:t(r,n);return i===void 0?a:i}return Yf=e,Yf}var Tq=kq(),_q=Jo(Tq),Xf,MS;function Nq(){if(MS)return Xf;MS=1;var t=l1(),e=function(){try{var r=t(Object,"defineProperty");return r({},"",{}),r}catch{}}();return Xf=e,Xf}var Zf,DS;function Rq(){if(DS)return Zf;DS=1;var t=Nq();function e(r,n,a){n=="__proto__"&&t?t(r,n,{configurable:!0,enumerable:!0,value:a,writable:!0}):r[n]=a}return Zf=e,Zf}var Qf,LS;function Pq(){if(LS)return Qf;LS=1;var t=Rq(),e=hA(),r=Object.prototype,n=r.hasOwnProperty;function a(i,s,o){var l=i[s];(!(n.call(i,s)&&e(l,o))||o===void 0&&!(s in i))&&t(i,s,o)}return Qf=a,Qf}var Jf,BS;function Aq(){if(BS)return Jf;BS=1;var t=9007199254740991,e=/^(?:0|[1-9]\d*)$/;function r(n,a){var i=typeof n;return a=a??t,!!a&&(i=="number"||i!="symbol"&&e.test(n))&&n>-1&&n%1==0&&n<a}return Jf=r,Jf}var ev,OS;function jq(){if(OS)return ev;OS=1;var t=Pq(),e=yA(),r=Aq(),n=el(),a=u1();function i(s,o,l,u){if(!n(s))return s;o=e(o,s);for(var c=-1,d=o.length,f=d-1,h=s;h!=null&&++c<d;){var v=a(o[c]),x=l;if(v==="__proto__"||v==="constructor"||v==="prototype")return s;if(c!=f){var b=h[v];x=u?u(b,v,h):void 0,x===void 0&&(x=n(b)?b:r(o[c+1])?[]:{})}t(h,v,x),h=h[v]}return s}return ev=i,ev}var tv,qS;function Iq(){if(qS)return tv;qS=1;var t=jq();function e(r,n,a){return r==null?r:t(r,n,a)}return tv=e,tv}var Mq=Iq(),Dq=Jo(Mq),rv,FS;function Lq(){if(FS)return rv;FS=1;function t(e,r){var n=-1,a=e.length;for(r||(r=Array(a));++n<a;)r[n]=e[n];return r}return rv=t,rv}var nv,$S;function Bq(){if($S)return nv;$S=1;var t=gA(),e=Lq(),r=jc(),n=tl(),a=pA(),i=u1(),s=mA();function o(l){return r(l)?t(l,i):n(l)?[l]:e(a(s(l)))}return nv=o,nv}var Oq=Bq(),qq=Jo(Oq),Fq={data:function(e){var r={field:"data",bindingEvent:"data",allowBinding:!1,allowSetting:!1,allowGetting:!1,settingEvent:"data",settingTriggersEvent:!1,triggerFnName:"trigger",immutableKeys:{},updateStyle:!1,beforeGet:function(a){},beforeSet:function(a,i){},onSet:function(a){},canSet:function(a){return!0}};return e=Te({},r,e),function(a,i){var s=e,o=this,l=o.length!==void 0,u=l?o:[o],c=l?o[0]:o;if(Ee(a)){var d=a.indexOf(".")!==-1,f=d&&qq(a);if(s.allowGetting&&i===void 0){var h;return c&&(s.beforeGet(c),f&&c._private[s.field][a]===void 0?h=_q(c._private[s.field],f):h=c._private[s.field][a]),h}else if(s.allowSetting&&i!==void 0){var v=!s.immutableKeys[a];if(v){var x=IP({},a,i);s.beforeSet(o,x);for(var b=0,m=u.length;b<m;b++){var p=u[b];s.canSet(p)&&(f&&c._private[s.field][a]===void 0?Dq(p._private[s.field],f,i):p._private[s.field][a]=i)}s.updateStyle&&o.updateStyle(),s.onSet(o),s.settingTriggersEvent&&o[s.triggerFnName](s.settingEvent)}}}else if(s.allowSetting&&Ue(a)){var y=a,w,E,S=Object.keys(y);s.beforeSet(o,y);for(var C=0;C<S.length;C++){w=S[C],E=y[w];var k=!s.immutableKeys[w];if(k)for(var T=0;T<u.length;T++){var _=u[T];s.canSet(_)&&(_._private[s.field][w]=E)}}s.updateStyle&&o.updateStyle(),s.onSet(o),s.settingTriggersEvent&&o[s.triggerFnName](s.settingEvent)}else if(s.allowBinding&>(a)){var N=a;o.on(s.bindingEvent,N)}else if(s.allowGetting&&a===void 0){var P;return c&&(s.beforeGet(c),P=c._private[s.field]),P}return o}},removeData:function(e){var r={field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!1,immutableKeys:{}};return e=Te({},r,e),function(a){var i=e,s=this,o=s.length!==void 0,l=o?s:[s];if(Ee(a)){for(var u=a.split(/\s+/),c=u.length,d=0;d<c;d++){var f=u[d];if(!ya(f)){var h=!i.immutableKeys[f];if(h)for(var v=0,x=l.length;v<x;v++)l[v]._private[i.field][f]=void 0}}i.triggerEvent&&s[i.triggerFnName](i.event)}else if(a===void 0){for(var b=0,m=l.length;b<m;b++)for(var p=l[b]._private[i.field],y=Object.keys(p),w=0;w<y.length;w++){var E=y[w],S=!i.immutableKeys[E];S&&(p[E]=void 0)}i.triggerEvent&&s[i.triggerFnName](i.event)}return s}}},$q={eventAliasesOn:function(e){var r=e;r.addListener=r.listen=r.bind=r.on,r.unlisten=r.unbind=r.off=r.removeListener,r.trigger=r.emit,r.pon=r.promiseOn=function(n,a){var i=this,s=Array.prototype.slice.call(arguments,0);return new hs(function(o,l){var u=function(h){i.off.apply(i,d),o(h)},c=s.concat([u]),d=c.concat([]);i.on.apply(i,c)})}}},Ke={};[W5,Fq,$q].forEach(function(t){Te(Ke,t)});var zq={animate:Ke.animate(),animation:Ke.animation(),animated:Ke.animated(),clearQueue:Ke.clearQueue(),delay:Ke.delay(),delayAnimation:Ke.delayAnimation(),stop:Ke.stop()},vu={classes:function(e){var r=this;if(e===void 0){var n=[];return r[0]._private.classes.forEach(function(v){return n.push(v)}),n}else Je(e)||(e=(e||"").match(/\S+/g)||[]);for(var a=[],i=new vs(e),s=0;s<r.length;s++){for(var o=r[s],l=o._private,u=l.classes,c=!1,d=0;d<e.length;d++){var f=e[d],h=u.has(f);if(!h){c=!0;break}}c||(c=u.size!==e.length),c&&(l.classes=i,a.push(o))}return a.length>0&&this.spawn(a).updateStyle().emit("class"),r},addClass:function(e){return this.toggleClass(e,!0)},hasClass:function(e){var r=this[0];return r!=null&&r._private.classes.has(e)},toggleClass:function(e,r){Je(e)||(e=e.match(/\S+/g)||[]);for(var n=this,a=r===void 0,i=[],s=0,o=n.length;s<o;s++)for(var l=n[s],u=l._private.classes,c=!1,d=0;d<e.length;d++){var f=e[d],h=u.has(f),v=!1;r||a&&!h?(u.add(f),v=!0):(!r||a&&h)&&(u.delete(f),v=!0),!c&&v&&(i.push(l),c=!0)}return i.length>0&&this.spawn(i).updateStyle().emit("class"),n},removeClass:function(e){return this.toggleClass(e,!1)},flashClass:function(e,r){var n=this;if(r==null)r=250;else if(r===0)return n;return n.addClass(e),setTimeout(function(){n.removeClass(e)},r),n}};vu.className=vu.classNames=vu.classes;var ze={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:`"(?:\\\\"|[^"])*"|'(?:\\\\'|[^'])*'`,number:jt,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};ze.variable="(?:[\\w-.]|(?:\\\\"+ze.metaChar+"))+";ze.className="(?:[\\w-]|(?:\\\\"+ze.metaChar+"))+";ze.value=ze.string+"|"+ze.number;ze.id=ze.variable;(function(){var t,e,r;for(t=ze.comparatorOp.split("|"),r=0;r<t.length;r++)e=t[r],ze.comparatorOp+="|@"+e;for(t=ze.comparatorOp.split("|"),r=0;r<t.length;r++)e=t[r],!(e.indexOf("!")>=0)&&e!=="="&&(ze.comparatorOp+="|\\!"+e)})();var Ze=function(){return{checks:[]}},pe={GROUP:0,COLLECTION:1,FILTER:2,DATA_COMPARE:3,DATA_EXIST:4,DATA_BOOL:5,META_COMPARE:6,STATE:7,ID:8,CLASS:9,UNDIRECTED_EDGE:10,DIRECTED_EDGE:11,NODE_SOURCE:12,NODE_TARGET:13,NODE_NEIGHBOR:14,CHILD:15,DESCENDANT:16,PARENT:17,ANCESTOR:18,COMPOUND_SPLIT:19,TRUE:20},L0=[{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(t,e){return FB(t.selector,e.selector)}),Vq=function(){for(var t={},e,r=0;r<L0.length;r++)e=L0[r],t[e.selector]=e.matches;return t}(),Uq=function(e,r){return Vq[e](r)},Gq="("+L0.map(function(t){return t.selector}).join("|")+")",mi=function(e){return e.replace(new RegExp("\\\\("+ze.metaChar+")","g"),function(r,n){return n})},Kn=function(e,r,n){e[e.length-1]=n},B0=[{name:"group",query:!0,regex:"("+ze.group+")",populate:function(e,r,n){var a=kt(n,1),i=a[0];r.checks.push({type:pe.GROUP,value:i==="*"?i:i+"s"})}},{name:"state",query:!0,regex:Gq,populate:function(e,r,n){var a=kt(n,1),i=a[0];r.checks.push({type:pe.STATE,value:i})}},{name:"id",query:!0,regex:"\\#("+ze.id+")",populate:function(e,r,n){var a=kt(n,1),i=a[0];r.checks.push({type:pe.ID,value:mi(i)})}},{name:"className",query:!0,regex:"\\.("+ze.className+")",populate:function(e,r,n){var a=kt(n,1),i=a[0];r.checks.push({type:pe.CLASS,value:mi(i)})}},{name:"dataExists",query:!0,regex:"\\[\\s*("+ze.variable+")\\s*\\]",populate:function(e,r,n){var a=kt(n,1),i=a[0];r.checks.push({type:pe.DATA_EXIST,field:mi(i)})}},{name:"dataCompare",query:!0,regex:"\\[\\s*("+ze.variable+")\\s*("+ze.comparatorOp+")\\s*("+ze.value+")\\s*\\]",populate:function(e,r,n){var a=kt(n,3),i=a[0],s=a[1],o=a[2],l=new RegExp("^"+ze.string+"$").exec(o)!=null;l?o=o.substring(1,o.length-1):o=parseFloat(o),r.checks.push({type:pe.DATA_COMPARE,field:mi(i),operator:s,value:o})}},{name:"dataBool",query:!0,regex:"\\[\\s*("+ze.boolOp+")\\s*("+ze.variable+")\\s*\\]",populate:function(e,r,n){var a=kt(n,2),i=a[0],s=a[1];r.checks.push({type:pe.DATA_BOOL,field:mi(s),operator:i})}},{name:"metaCompare",query:!0,regex:"\\[\\[\\s*("+ze.meta+")\\s*("+ze.comparatorOp+")\\s*("+ze.number+")\\s*\\]\\]",populate:function(e,r,n){var a=kt(n,3),i=a[0],s=a[1],o=a[2];r.checks.push({type:pe.META_COMPARE,field:mi(i),operator:s,value:parseFloat(o)})}},{name:"nextQuery",separator:!0,regex:ze.separator,populate:function(e,r){var n=e.currentSubject,a=e.edgeCount,i=e.compoundCount,s=e[e.length-1];n!=null&&(s.subject=n,e.currentSubject=null),s.edgeCount=a,s.compoundCount=i,e.edgeCount=0,e.compoundCount=0;var o=e[e.length++]=Ze();return o}},{name:"directedEdge",separator:!0,regex:ze.directedEdge,populate:function(e,r){if(e.currentSubject==null){var n=Ze(),a=r,i=Ze();return n.checks.push({type:pe.DIRECTED_EDGE,source:a,target:i}),Kn(e,r,n),e.edgeCount++,i}else{var s=Ze(),o=r,l=Ze();return s.checks.push({type:pe.NODE_SOURCE,source:o,target:l}),Kn(e,r,s),e.edgeCount++,l}}},{name:"undirectedEdge",separator:!0,regex:ze.undirectedEdge,populate:function(e,r){if(e.currentSubject==null){var n=Ze(),a=r,i=Ze();return n.checks.push({type:pe.UNDIRECTED_EDGE,nodes:[a,i]}),Kn(e,r,n),e.edgeCount++,i}else{var s=Ze(),o=r,l=Ze();return s.checks.push({type:pe.NODE_NEIGHBOR,node:o,neighbor:l}),Kn(e,r,s),l}}},{name:"child",separator:!0,regex:ze.child,populate:function(e,r){if(e.currentSubject==null){var n=Ze(),a=Ze(),i=e[e.length-1];return n.checks.push({type:pe.CHILD,parent:i,child:a}),Kn(e,r,n),e.compoundCount++,a}else if(e.currentSubject===r){var s=Ze(),o=e[e.length-1],l=Ze(),u=Ze(),c=Ze(),d=Ze();return s.checks.push({type:pe.COMPOUND_SPLIT,left:o,right:l,subject:u}),u.checks=r.checks,r.checks=[{type:pe.TRUE}],d.checks.push({type:pe.TRUE}),l.checks.push({type:pe.PARENT,parent:d,child:c}),Kn(e,o,s),e.currentSubject=u,e.compoundCount++,c}else{var f=Ze(),h=Ze(),v=[{type:pe.PARENT,parent:f,child:h}];return f.checks=r.checks,r.checks=v,e.compoundCount++,h}}},{name:"descendant",separator:!0,regex:ze.descendant,populate:function(e,r){if(e.currentSubject==null){var n=Ze(),a=Ze(),i=e[e.length-1];return n.checks.push({type:pe.DESCENDANT,ancestor:i,descendant:a}),Kn(e,r,n),e.compoundCount++,a}else if(e.currentSubject===r){var s=Ze(),o=e[e.length-1],l=Ze(),u=Ze(),c=Ze(),d=Ze();return s.checks.push({type:pe.COMPOUND_SPLIT,left:o,right:l,subject:u}),u.checks=r.checks,r.checks=[{type:pe.TRUE}],d.checks.push({type:pe.TRUE}),l.checks.push({type:pe.ANCESTOR,ancestor:d,descendant:c}),Kn(e,o,s),e.currentSubject=u,e.compoundCount++,c}else{var f=Ze(),h=Ze(),v=[{type:pe.ANCESTOR,ancestor:f,descendant:h}];return f.checks=r.checks,r.checks=v,e.compoundCount++,h}}},{name:"subject",modifier:!0,regex:ze.subject,populate:function(e,r){if(e.currentSubject!=null&&e.currentSubject!==r)return Ye("Redefinition of subject in selector `"+e.toString()+"`"),!1;e.currentSubject=r;var n=e[e.length-1],a=n.checks[0],i=a==null?null:a.type;i===pe.DIRECTED_EDGE?a.type=pe.NODE_TARGET:i===pe.UNDIRECTED_EDGE&&(a.type=pe.NODE_NEIGHBOR,a.node=a.nodes[1],a.neighbor=a.nodes[0],a.nodes=null)}}];B0.forEach(function(t){return t.regexObj=new RegExp("^"+t.regex)});var Hq=function(e){for(var r,n,a,i=0;i<B0.length;i++){var s=B0[i],o=s.name,l=e.match(s.regexObj);if(l!=null){n=l,r=s,a=o;var u=l[0];e=e.substring(u.length);break}}return{expr:r,match:n,name:a,remaining:e}},Wq=function(e){var r=e.match(/^\s+/);if(r){var n=r[0];e=e.substring(n.length)}return e},Kq=function(e){var r=this,n=r.inputText=e,a=r[0]=Ze();for(r.length=1,n=Wq(n);;){var i=Hq(n);if(i.expr==null)return Ye("The selector `"+e+"`is invalid"),!1;var s=i.match.slice(1),o=i.expr.populate(r,a,s);if(o===!1)return!1;if(o!=null&&(a=o),n=i.remaining,n.match(/^\s*$/))break}var l=r[r.length-1];r.currentSubject!=null&&(l.subject=r.currentSubject),l.edgeCount=r.edgeCount,l.compoundCount=r.compoundCount;for(var u=0;u<r.length;u++){var c=r[u];if(c.compoundCount>0&&c.edgeCount>0)return Ye("The selector `"+e+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(c.edgeCount>1)return Ye("The selector `"+e+"` is invalid because it uses multiple edge selectors"),!1;c.edgeCount===1&&Ye("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},Yq=function(){if(this.toStringCache!=null)return this.toStringCache;for(var e=function(c){return c??""},r=function(c){return Ee(c)?'"'+c+'"':e(c)},n=function(c){return" "+c+" "},a=function(c,d){var f=c.type,h=c.value;switch(f){case pe.GROUP:{var v=e(h);return v.substring(0,v.length-1)}case pe.DATA_COMPARE:{var x=c.field,b=c.operator;return"["+x+n(e(b))+r(h)+"]"}case pe.DATA_BOOL:{var m=c.operator,p=c.field;return"["+e(m)+p+"]"}case pe.DATA_EXIST:{var y=c.field;return"["+y+"]"}case pe.META_COMPARE:{var w=c.operator,E=c.field;return"[["+E+n(e(w))+r(h)+"]]"}case pe.STATE:return h;case pe.ID:return"#"+h;case pe.CLASS:return"."+h;case pe.PARENT:case pe.CHILD:return i(c.parent,d)+n(">")+i(c.child,d);case pe.ANCESTOR:case pe.DESCENDANT:return i(c.ancestor,d)+" "+i(c.descendant,d);case pe.COMPOUND_SPLIT:{var S=i(c.left,d),C=i(c.subject,d),k=i(c.right,d);return S+(S.length>0?" ":"")+C+k}case pe.TRUE:return""}},i=function(c,d){return c.checks.reduce(function(f,h,v){return f+(d===c&&v===0?"$":"")+a(h,d)},"")},s="",o=0;o<this.length;o++){var l=this[o];s+=i(l,l.subject),this.length>1&&o<this.length-1&&(s+=", ")}return this.toStringCache=s,s},Xq={parse:Kq,toString:Yq},xA=function(e,r,n){var a,i=Ee(e),s=le(e),o=Ee(n),l,u,c=!1,d=!1,f=!1;switch(r.indexOf("!")>=0&&(r=r.replace("!",""),d=!0),r.indexOf("@")>=0&&(r=r.replace("@",""),c=!0),(i||o||c)&&(l=!i&&!s?"":""+e,u=""+n),c&&(e=l=l.toLowerCase(),n=u=u.toLowerCase()),r){case"*=":a=l.indexOf(u)>=0;break;case"$=":a=l.indexOf(u,l.length-u.length)>=0;break;case"^=":a=l.indexOf(u)===0;break;case"=":a=e===n;break;case">":f=!0,a=e>n;break;case">=":f=!0,a=e>=n;break;case"<":f=!0,a=e<n;break;case"<=":f=!0,a=e<=n;break;default:a=!1;break}return d&&(e!=null||!f)&&(a=!a),a},Zq=function(e,r){switch(r){case"?":return!!e;case"!":return!e;case"^":return e===void 0}},Qq=function(e){return e!==void 0},c1=function(e,r){return e.data(r)},Jq=function(e,r){return e[r]()},wt=[],lt=function(e,r){return e.checks.every(function(n){return wt[n.type](n,r)})};wt[pe.GROUP]=function(t,e){var r=t.value;return r==="*"||r===e.group()};wt[pe.STATE]=function(t,e){var r=t.value;return Uq(r,e)};wt[pe.ID]=function(t,e){var r=t.value;return e.id()===r};wt[pe.CLASS]=function(t,e){var r=t.value;return e.hasClass(r)};wt[pe.META_COMPARE]=function(t,e){var r=t.field,n=t.operator,a=t.value;return xA(Jq(e,r),n,a)};wt[pe.DATA_COMPARE]=function(t,e){var r=t.field,n=t.operator,a=t.value;return xA(c1(e,r),n,a)};wt[pe.DATA_BOOL]=function(t,e){var r=t.field,n=t.operator;return Zq(c1(e,r),n)};wt[pe.DATA_EXIST]=function(t,e){var r=t.field;return t.operator,Qq(c1(e,r))};wt[pe.UNDIRECTED_EDGE]=function(t,e){var r=t.nodes[0],n=t.nodes[1],a=e.source(),i=e.target();return lt(r,a)&<(n,i)||lt(n,a)&<(r,i)};wt[pe.NODE_NEIGHBOR]=function(t,e){return lt(t.node,e)&&e.neighborhood().some(function(r){return r.isNode()&<(t.neighbor,r)})};wt[pe.DIRECTED_EDGE]=function(t,e){return lt(t.source,e.source())&<(t.target,e.target())};wt[pe.NODE_SOURCE]=function(t,e){return lt(t.source,e)&&e.outgoers().some(function(r){return r.isNode()&<(t.target,r)})};wt[pe.NODE_TARGET]=function(t,e){return lt(t.target,e)&&e.incomers().some(function(r){return r.isNode()&<(t.source,r)})};wt[pe.CHILD]=function(t,e){return lt(t.child,e)&<(t.parent,e.parent())};wt[pe.PARENT]=function(t,e){return lt(t.parent,e)&&e.children().some(function(r){return lt(t.child,r)})};wt[pe.DESCENDANT]=function(t,e){return lt(t.descendant,e)&&e.ancestors().some(function(r){return lt(t.ancestor,r)})};wt[pe.ANCESTOR]=function(t,e){return lt(t.ancestor,e)&&e.descendants().some(function(r){return lt(t.descendant,r)})};wt[pe.COMPOUND_SPLIT]=function(t,e){return lt(t.subject,e)&<(t.left,e)&<(t.right,e)};wt[pe.TRUE]=function(){return!0};wt[pe.COLLECTION]=function(t,e){var r=t.value;return r.has(e)};wt[pe.FILTER]=function(t,e){var r=t.value;return r(e)};var eF=function(e){var r=this;if(r.length===1&&r[0].checks.length===1&&r[0].checks[0].type===pe.ID)return e.getElementById(r[0].checks[0].value).collection();var n=function(i){for(var s=0;s<r.length;s++){var o=r[s];if(lt(o,i))return!0}return!1};return r.text()==null&&(n=function(){return!0}),e.filter(n)},tF=function(e){for(var r=this,n=0;n<r.length;n++){var a=r[n];if(lt(a,e))return!0}return!1},rF={matches:tF,filter:eF},wa=function(e){this.inputText=e,this.currentSubject=null,this.compoundCount=0,this.edgeCount=0,this.length=0,e==null||Ee(e)&&e.match(/^\s*$/)||(_r(e)?this.addQuery({checks:[{type:pe.COLLECTION,value:e.collection()}]}):gt(e)?this.addQuery({checks:[{type:pe.FILTER,value:e}]}):Ee(e)?this.parse(e)||(this.invalid=!0):ct("A selector must be created from a string; found "))},Sa=wa.prototype;[Xq,rF].forEach(function(t){return Te(Sa,t)});Sa.text=function(){return this.inputText};Sa.size=function(){return this.length};Sa.eq=function(t){return this[t]};Sa.sameText=function(t){return!this.invalid&&!t.invalid&&this.text()===t.text()};Sa.addQuery=function(t){this[this.length++]=t};Sa.selector=Sa.toString;var ha={allAre:function(e){var r=new wa(e);return this.every(function(n){return r.matches(n)})},is:function(e){var r=new wa(e);return this.some(function(n){return r.matches(n)})},some:function(e,r){for(var n=0;n<this.length;n++){var a=r?e.apply(r,[this[n],n,this]):e(this[n],n,this);if(a)return!0}return!1},every:function(e,r){for(var n=0;n<this.length;n++){var a=r?e.apply(r,[this[n],n,this]):e(this[n],n,this);if(!a)return!1}return!0},same:function(e){if(this===e)return!0;e=this.cy().collection(e);var r=this.length,n=e.length;return r!==n?!1:r===1?this[0]===e[0]:this.every(function(a){return e.hasElementWithId(a.id())})},anySame:function(e){return e=this.cy().collection(e),this.some(function(r){return e.hasElementWithId(r.id())})},allAreNeighbors:function(e){e=this.cy().collection(e);var r=this.neighborhood();return e.every(function(n){return r.hasElementWithId(n.id())})},contains:function(e){e=this.cy().collection(e);var r=this;return e.every(function(n){return r.hasElementWithId(n.id())})}};ha.allAreNeighbours=ha.allAreNeighbors;ha.has=ha.contains;ha.equal=ha.equals=ha.same;var Br=function(e,r){return function(a,i,s,o){var l=a,u=this,c;if(l==null?c="":_r(l)&&l.length===1&&(c=l.id()),u.length===1&&c){var d=u[0]._private,f=d.traversalCache=d.traversalCache||{},h=f[r]=f[r]||[],v=ni(c),x=h[v];return x||(h[v]=e.call(u,a,i,s,o))}else return e.call(u,a,i,s,o)}},ls={parent:function(e){var r=[];if(this.length===1){var n=this[0]._private.parent;if(n)return n}for(var a=0;a<this.length;a++){var i=this[a],s=i._private.parent;s&&r.push(s)}return this.spawn(r,!0).filter(e)},parents:function(e){for(var r=[],n=this.parent();n.nonempty();){for(var a=0;a<n.length;a++){var i=n[a];r.push(i)}n=n.parent()}return this.spawn(r,!0).filter(e)},commonAncestors:function(e){for(var r,n=0;n<this.length;n++){var a=this[n],i=a.parents();r=r||i,r=r.intersect(i)}return r.filter(e)},orphans:function(e){return this.stdFilter(function(r){return r.isOrphan()}).filter(e)},nonorphans:function(e){return this.stdFilter(function(r){return r.isChild()}).filter(e)},children:Br(function(t){for(var e=[],r=0;r<this.length;r++)for(var n=this[r],a=n._private.children,i=0;i<a.length;i++)e.push(a[i]);return this.spawn(e,!0).filter(t)},"children"),siblings:function(e){return this.parent().children().not(this).filter(e)},isParent:function(){var e=this[0];if(e)return e.isNode()&&e._private.children.length!==0},isChildless:function(){var e=this[0];if(e)return e.isNode()&&e._private.children.length===0},isChild:function(){var e=this[0];if(e)return e.isNode()&&e._private.parent!=null},isOrphan:function(){var e=this[0];if(e)return e.isNode()&&e._private.parent==null},descendants:function(e){var r=[];function n(a){for(var i=0;i<a.length;i++){var s=a[i];r.push(s),s.children().nonempty()&&n(s.children())}}return n(this.children()),this.spawn(r,!0).filter(e)}};function d1(t,e,r,n){for(var a=[],i=new vs,s=t.cy(),o=s.hasCompoundNodes(),l=0;l<t.length;l++){var u=t[l];r?a.push(u):o&&n(a,i,u)}for(;a.length>0;){var c=a.shift();e(c),i.add(c.id()),o&&n(a,i,c)}return t}function bA(t,e,r){if(r.isParent())for(var n=r._private.children,a=0;a<n.length;a++){var i=n[a];e.has(i.id())||t.push(i)}}ls.forEachDown=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return d1(this,t,e,bA)};function wA(t,e,r){if(r.isChild()){var n=r._private.parent;e.has(n.id())||t.push(n)}}ls.forEachUp=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return d1(this,t,e,wA)};function nF(t,e,r){wA(t,e,r),bA(t,e,r)}ls.forEachUpAndDown=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return d1(this,t,e,nF)};ls.ancestors=ls.parents;var qo,SA;qo=SA={data:Ke.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:Ke.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:Ke.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:Ke.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:Ke.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:Ke.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var e=this[0];if(e)return e._private.data.id}};qo.attr=qo.data;qo.removeAttr=qo.removeData;var aF=SA,Lc={};function av(t){return function(e){var r=this;if(e===void 0&&(e=!0),r.length!==0)if(r.isNode()&&!r.removed()){for(var n=0,a=r[0],i=a._private.edges,s=0;s<i.length;s++){var o=i[s];!e&&o.isLoop()||(n+=t(a,o))}return n}else return}}Te(Lc,{degree:av(function(t,e){return e.source().same(e.target())?2:1}),indegree:av(function(t,e){return e.target().same(t)?1:0}),outdegree:av(function(t,e){return e.source().same(t)?1:0})});function yi(t,e){return function(r){for(var n,a=this.nodes(),i=0;i<a.length;i++){var s=a[i],o=s[t](r);o!==void 0&&(n===void 0||e(o,n))&&(n=o)}return n}}Te(Lc,{minDegree:yi("degree",function(t,e){return t<e}),maxDegree:yi("degree",function(t,e){return t>e}),minIndegree:yi("indegree",function(t,e){return t<e}),maxIndegree:yi("indegree",function(t,e){return t>e}),minOutdegree:yi("outdegree",function(t,e){return t<e}),maxOutdegree:yi("outdegree",function(t,e){return t>e})});Te(Lc,{totalDegree:function(e){for(var r=0,n=this.nodes(),a=0;a<n.length;a++)r+=n[a].degree(e);return r}});var en,EA,CA=function(e,r,n){for(var a=0;a<e.length;a++){var i=e[a];if(!i.locked()){var s=i._private.position,o={x:r.x!=null?r.x-s.x:0,y:r.y!=null?r.y-s.y:0};i.isParent()&&!(o.x===0&&o.y===0)&&i.children().shift(o,n),i.dirtyBoundingBoxCache()}}},zS={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,r){CA(e,r,!1)},onSet:function(e){e.dirtyCompoundBoundsCache()},canSet:function(e){return!e.locked()}};en=EA={position:Ke.data(zS),silentPosition:Ke.data(Te({},zS,{allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!1,beforeSet:function(e,r){CA(e,r,!0)},onSet:function(e){e.dirtyCompoundBoundsCache()}})),positions:function(e,r){if(Ue(e))r?this.silentPosition(e):this.position(e);else if(gt(e)){var n=e,a=this.cy();a.startBatch();for(var i=0;i<this.length;i++){var s=this[i],o=void 0;(o=n(s,i))&&(r?s.silentPosition(o):s.position(o))}a.endBatch()}return this},silentPositions:function(e){return this.positions(e,!0)},shift:function(e,r,n){var a;if(Ue(e)?(a={x:le(e.x)?e.x:0,y:le(e.y)?e.y:0},n=r):Ee(e)&&le(r)&&(a={x:0,y:0},a[e]=r),a!=null){var i=this.cy();i.startBatch();for(var s=0;s<this.length;s++){var o=this[s];if(!(i.hasCompoundNodes()&&o.isChild()&&o.ancestors().anySame(this))){var l=o.position(),u={x:l.x+a.x,y:l.y+a.y};n?o.silentPosition(u):o.position(u)}}i.endBatch()}return this},silentShift:function(e,r){return Ue(e)?this.shift(e,!0):Ee(e)&&le(r)&&this.shift(e,r,!0),this},renderedPosition:function(e,r){var n=this[0],a=this.cy(),i=a.zoom(),s=a.pan(),o=Ue(e)?e:void 0,l=o!==void 0||r!==void 0&&Ee(e);if(n&&n.isNode())if(l)for(var u=0;u<this.length;u++){var c=this[u];r!==void 0?c.position(e,(r-s[e])/i):o!==void 0&&c.position(QP(o,i,s))}else{var d=n.position();return o=Pc(d,i,s),e===void 0?o:o[e]}else if(!l)return;return this},relativePosition:function(e,r){var n=this[0],a=this.cy(),i=Ue(e)?e:void 0,s=i!==void 0||r!==void 0&&Ee(e),o=a.hasCompoundNodes();if(n&&n.isNode())if(s)for(var l=0;l<this.length;l++){var u=this[l],c=o?u.parent():null,d=c&&c.length>0,f=d;d&&(c=c[0]);var h=f?c.position():{x:0,y:0};r!==void 0?u.position(e,r+h[e]):i!==void 0&&u.position({x:i.x+h.x,y:i.y+h.y})}else{var v=n.position(),x=o?n.parent():null,b=x&&x.length>0,m=b;b&&(x=x[0]);var p=m?x.position():{x:0,y:0};return i={x:v.x-p.x,y:v.y-p.y},e===void 0?i:i[e]}else if(!s)return;return this}};en.modelPosition=en.point=en.position;en.modelPositions=en.points=en.positions;en.renderedPoint=en.renderedPosition;en.relativePoint=en.relativePosition;var iF=EA,Zi,Pa;Zi=Pa={};Pa.renderedBoundingBox=function(t){var e=this.boundingBox(t),r=this.cy(),n=r.zoom(),a=r.pan(),i=e.x1*n+a.x,s=e.x2*n+a.x,o=e.y1*n+a.y,l=e.y2*n+a.y;return{x1:i,x2:s,y1:o,y2:l,w:s-i,h:l-o}};Pa.dirtyCompoundBoundsCache=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.cy();return!e.styleEnabled()||!e.hasCompoundNodes()?this:(this.forEachUp(function(r){if(r.isParent()){var n=r._private;n.compoundBoundsClean=!1,n.bbCache=null,t||r.emitAndNotify("bounds")}}),this)};Pa.updateCompoundBounds=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.cy();if(!e.styleEnabled()||!e.hasCompoundNodes())return this;if(!t&&e.batching())return this;function r(s){if(!s.isParent())return;var o=s._private,l=s.children(),u=s.pstyle("compound-sizing-wrt-labels").value==="include",c={width:{val:s.pstyle("min-width").pfValue,left:s.pstyle("min-width-bias-left"),right:s.pstyle("min-width-bias-right")},height:{val:s.pstyle("min-height").pfValue,top:s.pstyle("min-height-bias-top"),bottom:s.pstyle("min-height-bias-bottom")}},d=l.boundingBox({includeLabels:u,includeOverlays:!1,useCache:!1}),f=o.position;(d.w===0||d.h===0)&&(d={w:s.pstyle("width").pfValue,h:s.pstyle("height").pfValue},d.x1=f.x-d.w/2,d.x2=f.x+d.w/2,d.y1=f.y-d.h/2,d.y2=f.y+d.h/2);function h(T,_,N){var P=0,R=0,I=_+N;return T>0&&I>0&&(P=_/I*T,R=N/I*T),{biasDiff:P,biasComplementDiff:R}}function v(T,_,N,P){if(N.units==="%")switch(P){case"width":return T>0?N.pfValue*T:0;case"height":return _>0?N.pfValue*_:0;case"average":return T>0&&_>0?N.pfValue*(T+_)/2:0;case"min":return T>0&&_>0?T>_?N.pfValue*_:N.pfValue*T:0;case"max":return T>0&&_>0?T>_?N.pfValue*T:N.pfValue*_:0;default:return 0}else return N.units==="px"?N.pfValue:0}var x=c.width.left.value;c.width.left.units==="px"&&c.width.val>0&&(x=x*100/c.width.val);var b=c.width.right.value;c.width.right.units==="px"&&c.width.val>0&&(b=b*100/c.width.val);var m=c.height.top.value;c.height.top.units==="px"&&c.height.val>0&&(m=m*100/c.height.val);var p=c.height.bottom.value;c.height.bottom.units==="px"&&c.height.val>0&&(p=p*100/c.height.val);var y=h(c.width.val-d.w,x,b),w=y.biasDiff,E=y.biasComplementDiff,S=h(c.height.val-d.h,m,p),C=S.biasDiff,k=S.biasComplementDiff;o.autoPadding=v(d.w,d.h,s.pstyle("padding"),s.pstyle("padding-relative-to").value),o.autoWidth=Math.max(d.w,c.width.val),f.x=(-w+d.x1+d.x2+E)/2,o.autoHeight=Math.max(d.h,c.height.val),f.y=(-C+d.y1+d.y2+k)/2}for(var n=0;n<this.length;n++){var a=this[n],i=a._private;(!i.compoundBoundsClean||t)&&(r(a),e.batching()||(i.compoundBoundsClean=!0))}return this};var Dr=function(e){return e===1/0||e===-1/0?0:e},Xr=function(e,r,n,a,i){a-r===0||i-n===0||r==null||n==null||a==null||i==null||(e.x1=r<e.x1?r:e.x1,e.x2=a>e.x2?a: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)},Zn=function(e,r){return r==null?e:Xr(e,r.x1,r.y1,r.x2,r.y2)},Fs=function(e,r,n){return pr(e,r,n)},Vl=function(e,r,n){if(!r.cy().headless()){var a=r._private,i=a.rstyle,s=i.arrowWidth/2,o=r.pstyle(n+"-arrow-shape").value,l,u;if(o!=="none"){n==="source"?(l=i.srcX,u=i.srcY):n==="target"?(l=i.tgtX,u=i.tgtY):(l=i.midX,u=i.midY);var c=a.arrowBounds=a.arrowBounds||{},d=c[n]=c[n]||{};d.x1=l-s,d.y1=u-s,d.x2=l+s,d.y2=u+s,d.w=d.x2-d.x1,d.h=d.y2-d.y1,du(d,1),Xr(e,d.x1,d.y1,d.x2,d.y2)}}},iv=function(e,r,n){if(!r.cy().headless()){var a;n?a=n+"-":a="";var i=r._private,s=i.rstyle,o=r.pstyle(a+"label").strValue;if(o){var l=r.pstyle("text-halign"),u=r.pstyle("text-valign"),c=Fs(s,"labelWidth",n),d=Fs(s,"labelHeight",n),f=Fs(s,"labelX",n),h=Fs(s,"labelY",n),v=r.pstyle(a+"text-margin-x").pfValue,x=r.pstyle(a+"text-margin-y").pfValue,b=r.isEdge(),m=r.pstyle(a+"text-rotation"),p=r.pstyle("text-outline-width").pfValue,y=r.pstyle("text-border-width").pfValue,w=y/2,E=r.pstyle("text-background-padding").pfValue,S=2,C=d,k=c,T=k/2,_=C/2,N,P,R,I;if(b)N=f-T,P=f+T,R=h-_,I=h+_;else{switch(l.value){case"left":N=f-k,P=f;break;case"center":N=f-T,P=f+T;break;case"right":N=f,P=f+k;break}switch(u.value){case"top":R=h-C,I=h;break;case"center":R=h-_,I=h+_;break;case"bottom":R=h,I=h+C;break}}var M=v-Math.max(p,w)-E-S,D=v+Math.max(p,w)+E+S,L=x-Math.max(p,w)-E-S,j=x+Math.max(p,w)+E+S;N+=M,P+=D,R+=L,I+=j;var F=n||"main",O=i.labelBounds,B=O[F]=O[F]||{};B.x1=N,B.y1=R,B.x2=P,B.y2=I,B.w=P-N,B.h=I-R,B.leftPad=M,B.rightPad=D,B.topPad=L,B.botPad=j;var V=b&&m.strValue==="autorotate",J=m.pfValue!=null&&m.pfValue!==0;if(V||J){var q=V?Fs(i.rstyle,"labelAngle",n):m.pfValue,$=Math.cos(q),z=Math.sin(q),W=(N+P)/2,ne=(R+I)/2;if(!b){switch(l.value){case"left":W=P;break;case"right":W=N;break}switch(u.value){case"top":ne=I;break;case"bottom":ne=R;break}}var X=function(ue,Se){return ue=ue-W,Se=Se-ne,{x:ue*$-Se*z+W,y:ue*z+Se*$+ne}},U=X(N,R),H=X(N,I),Y=X(P,R),ee=X(P,I);N=Math.min(U.x,H.x,Y.x,ee.x),P=Math.max(U.x,H.x,Y.x,ee.x),R=Math.min(U.y,H.y,Y.y,ee.y),I=Math.max(U.y,H.y,Y.y,ee.y)}var ie=F+"Rot",oe=O[ie]=O[ie]||{};oe.x1=N,oe.y1=R,oe.x2=P,oe.y2=I,oe.w=P-N,oe.h=I-R,Xr(e,N,R,P,I),Xr(i.labelBounds.all,N,R,P,I)}return e}},VS=function(e,r){if(!r.cy().headless()){var n=r.pstyle("outline-opacity").value,a=r.pstyle("outline-width").value,i=r.pstyle("outline-offset").value,s=a+i;kA(e,r,n,s,"outside",s/2)}},kA=function(e,r,n,a,i,s){if(!(n===0||a<=0||i==="inside")){var o=r.cy(),l=o.renderer(),u=l.nodeShapes[l.getNodeShape(r)];if(u){var c=r.position(),d=c.x,f=c.y,h=r.width(),v=r.height();if(u.hasMiterBounds){i==="center"&&(a/=2);var x=u.miterBounds(d,f,h,v,a);Zn(e,x)}else s!=null&&s>0&&fu(e,[s,s,s,s])}}},sF=function(e,r){if(!r.cy().headless()){var n=r.pstyle("border-opacity").value,a=r.pstyle("border-width").pfValue,i=r.pstyle("border-position").value;kA(e,r,n,a,i)}},oF=function(e,r){var n=e._private.cy,a=n.styleEnabled(),i=n.headless(),s=lr(),o=e._private,l=e.isNode(),u=e.isEdge(),c,d,f,h,v,x,b=o.rstyle,m=l&&a?e.pstyle("bounds-expansion").pfValue:[0],p=function(Re){return Re.pstyle("display").value!=="none"},y=!a||p(e)&&(!u||p(e.source())&&p(e.target()));if(y){var w=0,E=0;a&&r.includeOverlays&&(w=e.pstyle("overlay-opacity").value,w!==0&&(E=e.pstyle("overlay-padding").value));var S=0,C=0;a&&r.includeUnderlays&&(S=e.pstyle("underlay-opacity").value,S!==0&&(C=e.pstyle("underlay-padding").value));var k=Math.max(E,C),T=0,_=0;if(a&&(T=e.pstyle("width").pfValue,_=T/2),l&&r.includeNodes){var N=e.position();v=N.x,x=N.y;var P=e.outerWidth(),R=P/2,I=e.outerHeight(),M=I/2;c=v-R,d=v+R,f=x-M,h=x+M,Xr(s,c,f,d,h),a&&VS(s,e),a&&r.includeOutlines&&!i&&VS(s,e),a&&sF(s,e)}else if(u&&r.includeEdges)if(a&&!i){var D=e.pstyle("curve-style").strValue;if(c=Math.min(b.srcX,b.midX,b.tgtX),d=Math.max(b.srcX,b.midX,b.tgtX),f=Math.min(b.srcY,b.midY,b.tgtY),h=Math.max(b.srcY,b.midY,b.tgtY),c-=_,d+=_,f-=_,h+=_,Xr(s,c,f,d,h),D==="haystack"){var L=b.haystackPts;if(L&&L.length===2){if(c=L[0].x,f=L[0].y,d=L[1].x,h=L[1].y,c>d){var j=c;c=d,d=j}if(f>h){var F=f;f=h,h=F}Xr(s,c-_,f-_,d+_,h+_)}}else if(D==="bezier"||D==="unbundled-bezier"||na(D,"segments")||na(D,"taxi")){var O;switch(D){case"bezier":case"unbundled-bezier":O=b.bezierPts;break;case"segments":case"taxi":case"round-segments":case"round-taxi":O=b.linePts;break}if(O!=null)for(var B=0;B<O.length;B++){var V=O[B];c=V.x-_,d=V.x+_,f=V.y-_,h=V.y+_,Xr(s,c,f,d,h)}}}else{var J=e.source(),q=J.position(),$=e.target(),z=$.position();if(c=q.x,d=z.x,f=q.y,h=z.y,c>d){var W=c;c=d,d=W}if(f>h){var ne=f;f=h,h=ne}c-=_,d+=_,f-=_,h+=_,Xr(s,c,f,d,h)}if(a&&r.includeEdges&&u&&(Vl(s,e,"mid-source"),Vl(s,e,"mid-target"),Vl(s,e,"source"),Vl(s,e,"target")),a){var X=e.pstyle("ghost").value==="yes";if(X){var U=e.pstyle("ghost-offset-x").pfValue,H=e.pstyle("ghost-offset-y").pfValue;Xr(s,s.x1+U,s.y1+H,s.x2+U,s.y2+H)}}var Y=o.bodyBounds=o.bodyBounds||{};Nw(Y,s),fu(Y,m),du(Y,1),a&&(c=s.x1,d=s.x2,f=s.y1,h=s.y2,Xr(s,c-k,f-k,d+k,h+k));var ee=o.overlayBounds=o.overlayBounds||{};Nw(ee,s),fu(ee,m),du(ee,1);var ie=o.labelBounds=o.labelBounds||{};ie.all!=null?zO(ie.all):ie.all=lr(),a&&r.includeLabels&&(r.includeMainLabels&&iv(s,e,null),u&&(r.includeSourceLabels&&iv(s,e,"source"),r.includeTargetLabels&&iv(s,e,"target")))}return s.x1=Dr(s.x1),s.y1=Dr(s.y1),s.x2=Dr(s.x2),s.y2=Dr(s.y2),s.w=Dr(s.x2-s.x1),s.h=Dr(s.y2-s.y1),s.w>0&&s.h>0&&y&&(fu(s,m),du(s,1)),s},TA=function(e){var r=0,n=function(s){return(s?1:0)<<r++},a=0;return a+=n(e.incudeNodes),a+=n(e.includeEdges),a+=n(e.includeLabels),a+=n(e.includeMainLabels),a+=n(e.includeSourceLabels),a+=n(e.includeTargetLabels),a+=n(e.includeOverlays),a+=n(e.includeOutlines),a},_A=function(e){var r=function(o){return Math.round(o)};if(e.isEdge()){var n=e.source().position(),a=e.target().position();return Sw([r(n.x),r(n.y),r(a.x),r(a.y)])}else{var i=e.position();return Sw([r(i.x),r(i.y)])}},US=function(e,r){var n=e._private,a,i=e.isEdge(),s=r==null?GS:TA(r),o=s===GS;if(n.bbCache==null?(a=oF(e,Fo),n.bbCache=a,n.bbCachePosKey=_A(e)):a=n.bbCache,!o){var l=e.isNode();a=lr(),(r.includeNodes&&l||r.includeEdges&&!l)&&(r.includeOverlays?Zn(a,n.overlayBounds):Zn(a,n.bodyBounds)),r.includeLabels&&(r.includeMainLabels&&(!i||r.includeSourceLabels&&r.includeTargetLabels)?Zn(a,n.labelBounds.all):(r.includeMainLabels&&Zn(a,n.labelBounds.mainRot),r.includeSourceLabels&&Zn(a,n.labelBounds.sourceRot),r.includeTargetLabels&&Zn(a,n.labelBounds.targetRot))),a.w=a.x2-a.x1,a.h=a.y2-a.y1}return a},Fo={includeNodes:!0,includeEdges:!0,includeLabels:!0,includeMainLabels:!0,includeSourceLabels:!0,includeTargetLabels:!0,includeOverlays:!0,includeUnderlays:!0,includeOutlines:!0,useCache:!0},GS=TA(Fo),HS=Kt(Fo);Pa.boundingBox=function(t){var e,r=t===void 0||t.useCache===void 0||t.useCache===!0,n=ss(function(c){var d=c._private;return d.bbCache==null||d.styleDirty||d.bbCachePosKey!==_A(c)},function(c){return c.id()});if(r&&this.length===1&&!n(this[0]))t===void 0?t=Fo:t=HS(t),e=US(this[0],t);else{e=lr(),t=t||Fo;var a=HS(t),i=this,s=i.cy(),o=s.styleEnabled();this.edges().forEach(n),this.nodes().forEach(n),o&&this.recalculateRenderedStyle(r),this.updateCompoundBounds(!r);for(var l=0;l<i.length;l++){var u=i[l];n(u)&&u.dirtyBoundingBoxCache(),Zn(e,US(u,a))}}return e.x1=Dr(e.x1),e.y1=Dr(e.y1),e.x2=Dr(e.x2),e.y2=Dr(e.y2),e.w=Dr(e.x2-e.x1),e.h=Dr(e.y2-e.y1),e};Pa.dirtyBoundingBoxCache=function(){for(var t=0;t<this.length;t++){var e=this[t]._private;e.bbCache=null,e.bbCachePosKey=null,e.bodyBounds=null,e.overlayBounds=null,e.labelBounds.all=null,e.labelBounds.source=null,e.labelBounds.target=null,e.labelBounds.main=null,e.labelBounds.sourceRot=null,e.labelBounds.targetRot=null,e.labelBounds.mainRot=null,e.arrowBounds.source=null,e.arrowBounds.target=null,e.arrowBounds["mid-source"]=null,e.arrowBounds["mid-target"]=null}return this.emitAndNotify("bounds"),this};Pa.boundingBoxAt=function(t){var e=this.nodes(),r=this.cy(),n=r.hasCompoundNodes(),a=r.collection();if(n&&(a=e.filter(function(u){return u.isParent()}),e=e.not(a)),Ue(t)){var i=t;t=function(){return i}}var s=function(c,d){return c._private.bbAtOldPos=t(c,d)},o=function(c){return c._private.bbAtOldPos};r.startBatch(),e.forEach(s).silentPositions(t),n&&(a.dirtyCompoundBoundsCache(),a.dirtyBoundingBoxCache(),a.updateCompoundBounds(!0));var l=$O(this.boundingBox({useCache:!1}));return e.silentPositions(o),n&&(a.dirtyCompoundBoundsCache(),a.dirtyBoundingBoxCache(),a.updateCompoundBounds(!0)),r.endBatch(),l};Zi.boundingbox=Zi.bb=Zi.boundingBox;Zi.renderedBoundingbox=Zi.renderedBoundingBox;var lF=Pa,Qs,al;Qs=al={};var NA=function(e){e.uppercaseName=ow(e.name),e.autoName="auto"+e.uppercaseName,e.labelName="label"+e.uppercaseName,e.outerName="outer"+e.uppercaseName,e.uppercaseOuterName=ow(e.outerName),Qs[e.name]=function(){var n=this[0],a=n._private,i=a.cy,s=i._private.styleEnabled;if(n)if(s){if(n.isParent())return n.updateCompoundBounds(),a[e.autoName]||0;var o=n.pstyle(e.name);switch(o.strValue){case"label":return n.recalculateRenderedStyle(),a.rstyle[e.labelName]||0;default:return o.pfValue}}else return 1},Qs["outer"+e.uppercaseName]=function(){var n=this[0],a=n._private,i=a.cy,s=i._private.styleEnabled;if(n)if(s){var o=n[e.name](),l=n.pstyle("border-position").value,u;l==="center"?u=n.pstyle("border-width").pfValue:l==="outside"?u=2*n.pstyle("border-width").pfValue:u=0;var c=2*n.padding();return o+u+c}else return 1},Qs["rendered"+e.uppercaseName]=function(){var n=this[0];if(n){var a=n[e.name]();return a*this.cy().zoom()}},Qs["rendered"+e.uppercaseOuterName]=function(){var n=this[0];if(n){var a=n[e.outerName]();return a*this.cy().zoom()}}};NA({name:"width"});NA({name:"height"});al.padding=function(){var t=this[0],e=t._private;return t.isParent()?(t.updateCompoundBounds(),e.autoPadding!==void 0?e.autoPadding:t.pstyle("padding").pfValue):t.pstyle("padding").pfValue};al.paddedHeight=function(){var t=this[0];return t.height()+2*t.padding()};al.paddedWidth=function(){var t=this[0];return t.width()+2*t.padding()};var uF=al,cF=function(e,r){if(e.isEdge()&&e.takesUpSpace())return r(e)},dF=function(e,r){if(e.isEdge()&&e.takesUpSpace()){var n=e.cy();return Pc(r(e),n.zoom(),n.pan())}},fF=function(e,r){if(e.isEdge()&&e.takesUpSpace()){var n=e.cy(),a=n.pan(),i=n.zoom();return r(e).map(function(s){return Pc(s,i,a)})}},vF=function(e){return e.renderer().getControlPoints(e)},hF=function(e){return e.renderer().getSegmentPoints(e)},pF=function(e){return e.renderer().getSourceEndpoint(e)},gF=function(e){return e.renderer().getTargetEndpoint(e)},mF=function(e){return e.renderer().getEdgeMidpoint(e)},WS={controlPoints:{get:vF,mult:!0},segmentPoints:{get:hF,mult:!0},sourceEndpoint:{get:pF},targetEndpoint:{get:gF},midpoint:{get:mF}},yF=function(e){return"rendered"+e[0].toUpperCase()+e.substr(1)},xF=Object.keys(WS).reduce(function(t,e){var r=WS[e],n=yF(e);return t[e]=function(){return cF(this,r.get)},r.mult?t[n]=function(){return fF(this,r.get)}:t[n]=function(){return dF(this,r.get)},t},{}),bF=Te({},iF,lF,uF,xF);/*!
|
|
48
|
+
Event object based on jQuery events, MIT license
|
|
49
|
+
|
|
50
|
+
https://jquery.org/license/
|
|
51
|
+
https://tldrlegal.com/license/mit-license
|
|
52
|
+
https://github.com/jquery/jquery/blob/master/src/event.js
|
|
53
|
+
*/var RA=function(e,r){this.recycle(e,r)};function $s(){return!1}function Ul(){return!0}RA.prototype={instanceString:function(){return"event"},recycle:function(e,r){if(this.isImmediatePropagationStopped=this.isPropagationStopped=this.isDefaultPrevented=$s,e!=null&&e.preventDefault?(this.type=e.type,this.isDefaultPrevented=e.defaultPrevented?Ul:$s):e!=null&&e.type?r=e:this.type=e,r!=null&&(this.originalEvent=r.originalEvent,this.type=r.type!=null?r.type:this.type,this.cy=r.cy,this.target=r.target,this.position=r.position,this.renderedPosition=r.renderedPosition,this.namespace=r.namespace,this.layout=r.layout),this.cy!=null&&this.position!=null&&this.renderedPosition==null){var n=this.position,a=this.cy.zoom(),i=this.cy.pan();this.renderedPosition={x:n.x*a+i.x,y:n.y*a+i.y}}this.timeStamp=e&&e.timeStamp||Date.now()},preventDefault:function(){this.isDefaultPrevented=Ul;var e=this.originalEvent;e&&e.preventDefault&&e.preventDefault()},stopPropagation:function(){this.isPropagationStopped=Ul;var e=this.originalEvent;e&&e.stopPropagation&&e.stopPropagation()},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=Ul,this.stopPropagation()},isDefaultPrevented:$s,isPropagationStopped:$s,isImmediatePropagationStopped:$s};var PA=/^([^.]+)(\.(?:[^.]+))?$/,wF=".*",AA={qualifierCompare:function(e,r){return e===r},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},KS=Object.keys(AA),SF={};function Bc(){for(var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:SF,e=arguments.length>1?arguments[1]:void 0,r=0;r<KS.length;r++){var n=KS[r];this[n]=t[n]||AA[n]}this.context=e||this.context,this.listeners=[],this.emitting=0}var Ea=Bc.prototype,jA=function(e,r,n,a,i,s,o){gt(a)&&(i=a,a=null),o&&(s==null?s=o:s=Te({},s,o));for(var l=Je(n)?n:n.split(/\s+/),u=0;u<l.length;u++){var c=l[u];if(!ya(c)){var d=c.match(PA);if(d){var f=d[1],h=d[2]?d[2]:null,v=r(e,c,f,h,a,i,s);if(v===!1)break}}}},YS=function(e,r){return e.addEventFields(e.context,r),new RA(r.type,r)},EF=function(e,r,n){if(RB(n)){r(e,n);return}else if(Ue(n)){r(e,YS(e,n));return}for(var a=Je(n)?n:n.split(/\s+/),i=0;i<a.length;i++){var s=a[i];if(!ya(s)){var o=s.match(PA);if(o){var l=o[1],u=o[2]?o[2]:null,c=YS(e,{type:l,namespace:u,target:e.context});r(e,c)}}}};Ea.on=Ea.addListener=function(t,e,r,n,a){return jA(this,function(i,s,o,l,u,c,d){gt(c)&&i.listeners.push({event:s,callback:c,type:o,namespace:l,qualifier:u,conf:d})},t,e,r,n,a),this};Ea.one=function(t,e,r,n){return this.on(t,e,r,n,{one:!0})};Ea.removeListener=Ea.off=function(t,e,r,n){var a=this;this.emitting!==0&&(this.listeners=dO(this.listeners));for(var i=this.listeners,s=function(u){var c=i[u];jA(a,function(d,f,h,v,x,b){if((c.type===h||t==="*")&&(!v&&c.namespace!==".*"||c.namespace===v)&&(!x||d.qualifierCompare(c.qualifier,x))&&(!b||c.callback===b))return i.splice(u,1),!1},t,e,r,n)},o=i.length-1;o>=0;o--)s(o);return this};Ea.removeAllListeners=function(){return this.removeListener("*")};Ea.emit=Ea.trigger=function(t,e,r){var n=this.listeners,a=n.length;return this.emitting++,Je(e)||(e=[e]),EF(this,function(i,s){r!=null&&(n=[{event:s.event,type:s.type,namespace:s.namespace,callback:r}],a=n.length);for(var o=function(){var c=n[l];if(c.type===s.type&&(!c.namespace||c.namespace===s.namespace||c.namespace===wF)&&i.eventMatches(i.context,c,s)){var d=[s];e!=null&&vO(d,e),i.beforeEmit(i.context,c,s),c.conf&&c.conf.one&&(i.listeners=i.listeners.filter(function(v){return v!==c}));var f=i.callbackContext(i.context,c,s),h=c.callback.apply(f,d);i.afterEmit(i.context,c,s),h===!1&&(s.stopPropagation(),s.preventDefault())}},l=0;l<a;l++)o();i.bubble(i.context)&&!s.isPropagationStopped()&&i.parent(i.context).emit(s,e)},t),this.emitting--,this};var CF={qualifierCompare:function(e,r){return e==null||r==null?e==null&&r==null:e.sameText(r)},eventMatches:function(e,r,n){var a=r.qualifier;return a!=null?e!==n.target&&Qo(n.target)&&a.matches(n.target):!0},addEventFields:function(e,r){r.cy=e.cy(),r.target=e},callbackContext:function(e,r,n){return r.qualifier!=null?n.target:e},beforeEmit:function(e,r){r.conf&&r.conf.once&&r.conf.onceCollection.removeListener(r.event,r.qualifier,r.callback)},bubble:function(){return!0},parent:function(e){return e.isChild()?e.parent():e.cy()}},Gl=function(e){return Ee(e)?new wa(e):e},IA={createEmitter:function(){for(var e=0;e<this.length;e++){var r=this[e],n=r._private;n.emitter||(n.emitter=new Bc(CF,r))}return this},emitter:function(){return this._private.emitter},on:function(e,r,n){for(var a=Gl(r),i=0;i<this.length;i++){var s=this[i];s.emitter().on(e,a,n)}return this},removeListener:function(e,r,n){for(var a=Gl(r),i=0;i<this.length;i++){var s=this[i];s.emitter().removeListener(e,a,n)}return this},removeAllListeners:function(){for(var e=0;e<this.length;e++){var r=this[e];r.emitter().removeAllListeners()}return this},one:function(e,r,n){for(var a=Gl(r),i=0;i<this.length;i++){var s=this[i];s.emitter().one(e,a,n)}return this},once:function(e,r,n){for(var a=Gl(r),i=0;i<this.length;i++){var s=this[i];s.emitter().on(e,a,n,{once:!0,onceCollection:this})}},emit:function(e,r){for(var n=0;n<this.length;n++){var a=this[n];a.emitter().emit(e,r)}return this},emitAndNotify:function(e,r){if(this.length!==0)return this.cy().notify(e,this),this.emit(e,r),this}};Ke.eventAliasesOn(IA);var MA={nodes:function(e){return this.filter(function(r){return r.isNode()}).filter(e)},edges:function(e){return this.filter(function(r){return r.isEdge()}).filter(e)},byGroup:function(){for(var e=this.spawn(),r=this.spawn(),n=0;n<this.length;n++){var a=this[n];a.isNode()?e.push(a):r.push(a)}return{nodes:e,edges:r}},filter:function(e,r){if(e===void 0)return this;if(Ee(e)||_r(e))return new wa(e).filter(this);if(gt(e)){for(var n=this.spawn(),a=this,i=0;i<a.length;i++){var s=a[i],o=r?e.apply(r,[s,i,a]):e(s,i,a);o&&n.push(s)}return n}return this.spawn()},not:function(e){if(e){Ee(e)&&(e=this.filter(e));for(var r=this.spawn(),n=0;n<this.length;n++){var a=this[n],i=e.has(a);i||r.push(a)}return r}else return this},absoluteComplement:function(){var e=this.cy();return e.mutableElements().not(this)},intersect:function(e){if(Ee(e)){var r=e;return this.filter(r)}for(var n=this.spawn(),a=this,i=e,s=this.length<e.length,o=s?a:i,l=s?i:a,u=0;u<o.length;u++){var c=o[u];l.has(c)&&n.push(c)}return n},xor:function(e){var r=this._private.cy;Ee(e)&&(e=r.$(e));var n=this.spawn(),a=this,i=e,s=function(l,u){for(var c=0;c<l.length;c++){var d=l[c],f=d._private.data.id,h=u.hasElementWithId(f);h||n.push(d)}};return s(a,i),s(i,a),n},diff:function(e){var r=this._private.cy;Ee(e)&&(e=r.$(e));var n=this.spawn(),a=this.spawn(),i=this.spawn(),s=this,o=e,l=function(c,d,f){for(var h=0;h<c.length;h++){var v=c[h],x=v._private.data.id,b=d.hasElementWithId(x);b?i.merge(v):f.push(v)}};return l(s,o,n),l(o,s,a),{left:n,right:a,both:i}},add:function(e){var r=this._private.cy;if(!e)return this;if(Ee(e)){var n=e;e=r.mutableElements().filter(n)}for(var a=this.spawnSelf(),i=0;i<e.length;i++){var s=e[i],o=!this.has(s);o&&a.push(s)}return a},merge:function(e){var r=this._private,n=r.cy;if(!e)return this;if(e&&Ee(e)){var a=e;e=n.mutableElements().filter(a)}for(var i=r.map,s=0;s<e.length;s++){var o=e[s],l=o._private.data.id,u=!i.has(l);if(u){var c=this.length++;this[c]=o,i.set(l,{ele:o,index:c})}}return this},unmergeAt:function(e){var r=this[e],n=r.id(),a=this._private,i=a.map;this[e]=void 0,i.delete(n);var s=e===this.length-1;if(this.length>1&&!s){var o=this.length-1,l=this[o],u=l._private.data.id;this[o]=void 0,this[e]=l,i.set(u,{ele:l,index:e})}return this.length--,this},unmergeOne:function(e){e=e[0];var r=this._private,n=e._private.data.id,a=r.map,i=a.get(n);if(!i)return this;var s=i.index;return this.unmergeAt(s),this},unmerge:function(e){var r=this._private.cy;if(!e)return this;if(e&&Ee(e)){var n=e;e=r.mutableElements().filter(n)}for(var a=0;a<e.length;a++)this.unmergeOne(e[a]);return this},unmergeBy:function(e){for(var r=this.length-1;r>=0;r--){var n=this[r];e(n)&&this.unmergeAt(r)}return this},map:function(e,r){for(var n=[],a=this,i=0;i<a.length;i++){var s=a[i],o=r?e.apply(r,[s,i,a]):e(s,i,a);n.push(o)}return n},reduce:function(e,r){for(var n=r,a=this,i=0;i<a.length;i++)n=e(n,a[i],i,a);return n},max:function(e,r){for(var n=-1/0,a,i=this,s=0;s<i.length;s++){var o=i[s],l=r?e.apply(r,[o,s,i]):e(o,s,i);l>n&&(n=l,a=o)}return{value:n,ele:a}},min:function(e,r){for(var n=1/0,a,i=this,s=0;s<i.length;s++){var o=i[s],l=r?e.apply(r,[o,s,i]):e(o,s,i);l<n&&(n=l,a=o)}return{value:n,ele:a}}},Ge=MA;Ge.u=Ge["|"]=Ge["+"]=Ge.union=Ge.or=Ge.add;Ge["\\"]=Ge["!"]=Ge["-"]=Ge.difference=Ge.relativeComplement=Ge.subtract=Ge.not;Ge.n=Ge["&"]=Ge["."]=Ge.and=Ge.intersection=Ge.intersect;Ge["^"]=Ge["(+)"]=Ge["(-)"]=Ge.symmetricDifference=Ge.symdiff=Ge.xor;Ge.fnFilter=Ge.filterFn=Ge.stdFilter=Ge.filter;Ge.complement=Ge.abscomp=Ge.absoluteComplement;var kF={isNode:function(){return this.group()==="nodes"},isEdge:function(){return this.group()==="edges"},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}},DA=function(e,r){var n=e.cy(),a=n.hasCompoundNodes();function i(c){var d=c.pstyle("z-compound-depth");return d.value==="auto"?a?c.zDepth():0:d.value==="bottom"?-1:d.value==="top"?e1:0}var s=i(e)-i(r);if(s!==0)return s;function o(c){var d=c.pstyle("z-index-compare");return d.value==="auto"&&c.isNode()?1:0}var l=o(e)-o(r);if(l!==0)return l;var u=e.pstyle("z-index").value-r.pstyle("z-index").value;return u!==0?u:e.poolIndex()-r.poolIndex()},tc={forEach:function(e,r){if(gt(e))for(var n=this.length,a=0;a<n;a++){var i=this[a],s=r?e.apply(r,[i,a,this]):e(i,a,this);if(s===!1)break}return this},toArray:function(){for(var e=[],r=0;r<this.length;r++)e.push(this[r]);return e},slice:function(e,r){var n=[],a=this.length;r==null&&(r=a),e==null&&(e=0),e<0&&(e=a+e),r<0&&(r=a+r);for(var i=e;i>=0&&i<r&&i<a;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 this.length===0},nonempty:function(){return!this.empty()},sort:function(e){if(!gt(e))return this;var r=this.toArray().sort(e);return this.spawn(r)},sortByZIndex:function(){return this.sort(DA)},zDepth:function(){var e=this[0];if(e){var r=e._private,n=r.group;if(n==="nodes"){var a=r.data.parent?e.parents().size():0;return e.isParent()?a:e1-1}else{var i=r.source,s=r.target,o=i.zDepth(),l=s.zDepth();return Math.max(o,l,0)}}}};tc.each=tc.forEach;var TF=function(){var e="undefined",r=(typeof Symbol>"u"?"undefined":It(Symbol))!=e&&It(Symbol.iterator)!=e;r&&(tc[Symbol.iterator]=function(){var n=this,a={value:void 0,done:!1},i=0,s=this.length;return IP({next:function(){return i<s?a.value=n[i++]:(a.value=void 0,a.done=!0),a}},Symbol.iterator,function(){return this})})};TF();var _F=Kt({nodeDimensionsIncludeLabels:!1}),hu={layoutDimensions:function(e){e=_F(e);var r;if(!this.takesUpSpace())r={w:0,h:0};else if(e.nodeDimensionsIncludeLabels){var n=this.boundingBox();r={w:n.w,h:n.h}}else r={w:this.outerWidth(),h:this.outerHeight()};return(r.w===0||r.h===0)&&(r.w=r.h=1),r},layoutPositions:function(e,r,n){var a=this.nodes().filter(function(E){return!E.isParent()}),i=this.cy(),s=r.eles,o=function(S){return S.id()},l=ss(n,o);e.emit({type:"layoutstart",layout:e}),e.animations=[];var u=function(S,C,k){var T={x:C.x1+C.w/2,y:C.y1+C.h/2},_={x:(k.x-T.x)*S,y:(k.y-T.y)*S};return{x:T.x+_.x,y:T.y+_.y}},c=r.spacingFactor&&r.spacingFactor!==1,d=function(){if(!c)return null;for(var S=lr(),C=0;C<a.length;C++){var k=a[C],T=l(k,C);JP(S,T.x,T.y)}return S},f=d(),h=ss(function(E,S){var C=l(E,S);if(c){var k=Math.abs(r.spacingFactor);C=u(k,f,C)}return r.transform!=null&&(C=r.transform(E,C)),C},o);if(r.animate){for(var v=0;v<a.length;v++){var x=a[v],b=h(x,v),m=r.animateFilter==null||r.animateFilter(x,v);if(m){var p=x.animation({position:b,duration:r.animationDuration,easing:r.animationEasing});e.animations.push(p)}else x.position(b)}if(r.fit){var y=i.animation({fit:{boundingBox:s.boundingBoxAt(h),padding:r.padding},duration:r.animationDuration,easing:r.animationEasing});e.animations.push(y)}else if(r.zoom!==void 0&&r.pan!==void 0){var w=i.animation({zoom:r.zoom,pan:r.pan,duration:r.animationDuration,easing:r.animationEasing});e.animations.push(w)}e.animations.forEach(function(E){return E.play()}),e.one("layoutready",r.ready),e.emit({type:"layoutready",layout:e}),hs.all(e.animations.map(function(E){return E.promise()})).then(function(){e.one("layoutstop",r.stop),e.emit({type:"layoutstop",layout:e})})}else a.positions(h),r.fit&&i.fit(r.eles,r.padding),r.zoom!=null&&i.zoom(r.zoom),r.pan&&i.pan(r.pan),e.one("layoutready",r.ready),e.emit({type:"layoutready",layout:e}),e.one("layoutstop",r.stop),e.emit({type:"layoutstop",layout:e});return this},layout:function(e){var r=this.cy();return r.makeLayout(Te({},e,{eles:this}))}};hu.createLayout=hu.makeLayout=hu.layout;function LA(t,e,r){var n=r._private,a=n.styleCache=n.styleCache||[],i;return(i=a[t])!=null||(i=a[t]=e(r)),i}function Oc(t,e){return t=ni(t),function(n){return LA(t,e,n)}}function qc(t,e){t=ni(t);var r=function(a){return e.call(a)};return function(){var a=this[0];if(a)return LA(t,r,a)}}var Gt={recalculateRenderedStyle:function(e){var r=this.cy(),n=r.renderer(),a=r.styleEnabled();return n&&a&&n.recalculateRenderedStyle(this,e),this},dirtyStyleCache:function(){var e=this.cy(),r=function(i){return i._private.styleCache=null};if(e.hasCompoundNodes()){var n;n=this.spawnSelf().merge(this.descendants()).merge(this.parents()),n.merge(n.connectedEdges()),n.forEach(r)}else this.forEach(function(a){r(a),a.connectedEdges().forEach(r)});return this},updateStyle:function(e){var r=this._private.cy;if(!r.styleEnabled())return this;if(r.batching()){var n=r._private.batchStyleEles;return n.merge(this),this}var a=r.hasCompoundNodes(),i=this;e=!!(e||e===void 0),a&&(i=this.spawnSelf().merge(this.descendants()).merge(this.parents()));var s=i;return e?s.emitAndNotify("style"):s.emit("style"),i.forEach(function(o){return o._private.styleDirty=!0}),this},cleanStyle:function(){var e=this.cy();if(e.styleEnabled())for(var r=0;r<this.length;r++){var n=this[r];n._private.styleDirty&&(n._private.styleDirty=!1,e.style().apply(n))}},parsedStyle:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=this[0],a=n.cy();if(a.styleEnabled()&&n){n._private.styleDirty&&(n._private.styleDirty=!1,a.style().apply(n));var i=n._private.style[e];return i??(r?a.style().getDefaultProperty(e):null)}},numericStyle:function(e){var r=this[0];if(r.cy().styleEnabled()&&r){var n=r.pstyle(e);return n.pfValue!==void 0?n.pfValue:n.value}},numericStyleUnits:function(e){var r=this[0];if(r.cy().styleEnabled()&&r)return r.pstyle(e).units},renderedStyle:function(e){var r=this.cy();if(!r.styleEnabled())return this;var n=this[0];if(n)return r.style().getRenderedStyle(n,e)},style:function(e,r){var n=this.cy();if(!n.styleEnabled())return this;var a=!1,i=n.style();if(Ue(e)){var s=e;i.applyBypass(this,s,a),this.emitAndNotify("style")}else if(Ee(e))if(r===void 0){var o=this[0];return o?i.getStylePropertyValue(o,e):void 0}else i.applyBypass(this,e,r,a),this.emitAndNotify("style");else if(e===void 0){var l=this[0];return l?i.getRawStyle(l):void 0}return this},removeStyle:function(e){var r=this.cy();if(!r.styleEnabled())return this;var n=!1,a=r.style(),i=this;if(e===void 0)for(var s=0;s<i.length;s++){var o=i[s];a.removeAllBypasses(o,n)}else{e=e.split(/\s+/);for(var l=0;l<i.length;l++){var u=i[l];a.removeBypasses(u,e,n)}}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 r=e.hasCompoundNodes(),n=this[0];if(n){var a=n._private,i=n.pstyle("opacity").value;if(!r)return i;var s=a.data.parent?n.parents():null;if(s)for(var o=0;o<s.length;o++){var l=s[o],u=l.pstyle("opacity").value;i=u*i}return i}},transparent:function(){var e=this.cy();if(!e.styleEnabled())return!1;var r=this[0],n=r.cy().hasCompoundNodes();if(r)return n?r.effectiveOpacity()===0:r.pstyle("opacity").value===0},backgrounding:function(){var e=this.cy();if(!e.styleEnabled())return!1;var r=this[0];return!!r._private.backgrounding}};function sv(t,e){var r=t._private,n=r.data.parent?t.parents():null;if(n)for(var a=0;a<n.length;a++){var i=n[a];if(!e(i))return!1}return!0}function f1(t){var e=t.ok,r=t.edgeOkViaNode||t.ok,n=t.parentOk||t.ok;return function(){var a=this.cy();if(!a.styleEnabled())return!0;var i=this[0],s=a.hasCompoundNodes();if(i){var o=i._private;if(!e(i))return!1;if(i.isNode())return!s||sv(i,n);var l=o.source,u=o.target;return r(l)&&(!s||sv(l,r))&&(l===u||r(u)&&(!s||sv(u,r)))}}}var ps=Oc("eleTakesUpSpace",function(t){return t.pstyle("display").value==="element"&&t.width()!==0&&(t.isNode()?t.height()!==0:!0)});Gt.takesUpSpace=qc("takesUpSpace",f1({ok:ps}));var NF=Oc("eleInteractive",function(t){return t.pstyle("events").value==="yes"&&t.pstyle("visibility").value==="visible"&&ps(t)}),RF=Oc("parentInteractive",function(t){return t.pstyle("visibility").value==="visible"&&ps(t)});Gt.interactive=qc("interactive",f1({ok:NF,parentOk:RF,edgeOkViaNode:ps}));Gt.noninteractive=function(){var t=this[0];if(t)return!t.interactive()};var PF=Oc("eleVisible",function(t){return t.pstyle("visibility").value==="visible"&&t.pstyle("opacity").pfValue!==0&&ps(t)}),AF=ps;Gt.visible=qc("visible",f1({ok:PF,edgeOkViaNode:AF}));Gt.hidden=function(){var t=this[0];if(t)return!t.visible()};Gt.isBundledBezier=qc("isBundledBezier",function(){return this.cy().styleEnabled()?!this.removed()&&this.pstyle("curve-style").value==="bezier"&&this.takesUpSpace():!1});Gt.bypass=Gt.css=Gt.style;Gt.renderedCss=Gt.renderedStyle;Gt.removeBypass=Gt.removeCss=Gt.removeStyle;Gt.pstyle=Gt.parsedStyle;var pa={};function XS(t){return function(){var e=arguments,r=[];if(e.length===2){var n=e[0],a=e[1];this.on(t.event,n,a)}else if(e.length===1&>(e[0])){var i=e[0];this.on(t.event,i)}else if(e.length===0||e.length===1&&Je(e[0])){for(var s=e.length===1?e[0]:null,o=0;o<this.length;o++){var l=this[o],u=!t.ableField||l._private[t.ableField],c=l._private[t.field]!=t.value;if(t.overrideAble){var d=t.overrideAble(l);if(d!==void 0&&(u=d,!d))return this}u&&(l._private[t.field]=t.value,c&&r.push(l))}var f=this.spawn(r);f.updateStyle(),f.emit(t.event),s&&f.emit(s)}return this}}function gs(t){pa[t.field]=function(){var e=this[0];if(e){if(t.overrideField){var r=t.overrideField(e);if(r!==void 0)return r}return e._private[t.field]}},pa[t.on]=XS({event:t.on,field:t.field,ableField:t.ableField,overrideAble:t.overrideAble,value:!0}),pa[t.off]=XS({event:t.off,field:t.field,ableField:t.ableField,overrideAble:t.overrideAble,value:!1})}gs({field:"locked",overrideField:function(e){return e.cy().autolock()?!0:void 0},on:"lock",off:"unlock"});gs({field:"grabbable",overrideField:function(e){return e.cy().autoungrabify()||e.pannable()?!1:void 0},on:"grabify",off:"ungrabify"});gs({field:"selected",ableField:"selectable",overrideAble:function(e){return e.cy().autounselectify()?!1:void 0},on:"select",off:"unselect"});gs({field:"selectable",overrideField:function(e){return e.cy().autounselectify()?!1:void 0},on:"selectify",off:"unselectify"});pa.deselect=pa.unselect;pa.grabbed=function(){var t=this[0];if(t)return t._private.grabbed};gs({field:"active",on:"activate",off:"unactivate"});gs({field:"pannable",on:"panify",off:"unpanify"});pa.inactive=function(){var t=this[0];if(t)return!t._private.active};var tr={},ZS=function(e){return function(n){for(var a=this,i=[],s=0;s<a.length;s++){var o=a[s];if(o.isNode()){for(var l=!1,u=o.connectedEdges(),c=0;c<u.length;c++){var d=u[c],f=d.source(),h=d.target();if(e.noIncomingEdges&&h===o&&f!==o||e.noOutgoingEdges&&f===o&&h!==o){l=!0;break}}l||i.push(o)}}return this.spawn(i,!0).filter(n)}},QS=function(e){return function(r){for(var n=this,a=[],i=0;i<n.length;i++){var s=n[i];if(s.isNode())for(var o=s.connectedEdges(),l=0;l<o.length;l++){var u=o[l],c=u.source(),d=u.target();e.outgoing&&c===s?(a.push(u),a.push(d)):e.incoming&&d===s&&(a.push(u),a.push(c))}}return this.spawn(a,!0).filter(r)}},JS=function(e){return function(r){for(var n=this,a=[],i={};;){var s=e.outgoing?n.outgoers():n.incomers();if(s.length===0)break;for(var o=!1,l=0;l<s.length;l++){var u=s[l],c=u.id();i[c]||(i[c]=!0,a.push(u),o=!0)}if(!o)break;n=s}return this.spawn(a,!0).filter(r)}};tr.clearTraversalCache=function(){for(var t=0;t<this.length;t++)this[t]._private.traversalCache=null};Te(tr,{roots:ZS({noIncomingEdges:!0}),leaves:ZS({noOutgoingEdges:!0}),outgoers:Br(QS({outgoing:!0}),"outgoers"),successors:JS({outgoing:!0}),incomers:Br(QS({incoming:!0}),"incomers"),predecessors:JS({})});Te(tr,{neighborhood:Br(function(t){for(var e=[],r=this.nodes(),n=0;n<r.length;n++)for(var a=r[n],i=a.connectedEdges(),s=0;s<i.length;s++){var o=i[s],l=o.source(),u=o.target(),c=a===l?u:l;c.length>0&&e.push(c[0]),e.push(o[0])}return this.spawn(e,!0).filter(t)},"neighborhood"),closedNeighborhood:function(e){return this.neighborhood().add(this).filter(e)},openNeighborhood:function(e){return this.neighborhood(e)}});tr.neighbourhood=tr.neighborhood;tr.closedNeighbourhood=tr.closedNeighborhood;tr.openNeighbourhood=tr.openNeighborhood;Te(tr,{source:Br(function(e){var r=this[0],n;return r&&(n=r._private.source||r.cy().collection()),n&&e?n.filter(e):n},"source"),target:Br(function(e){var r=this[0],n;return r&&(n=r._private.target||r.cy().collection()),n&&e?n.filter(e):n},"target"),sources:eE({attr:"source"}),targets:eE({attr:"target"})});function eE(t){return function(r){for(var n=[],a=0;a<this.length;a++){var i=this[a],s=i._private[t.attr];s&&n.push(s)}return this.spawn(n,!0).filter(r)}}Te(tr,{edgesWith:Br(tE(),"edgesWith"),edgesTo:Br(tE({thisIsSrc:!0}),"edgesTo")});function tE(t){return function(r){var n=[],a=this._private.cy,i=t||{};Ee(r)&&(r=a.$(r));for(var s=0;s<r.length;s++)for(var o=r[s]._private.edges,l=0;l<o.length;l++){var u=o[l],c=u._private.data,d=this.hasElementWithId(c.source)&&r.hasElementWithId(c.target),f=r.hasElementWithId(c.source)&&this.hasElementWithId(c.target),h=d||f;h&&((i.thisIsSrc||i.thisIsTgt)&&(i.thisIsSrc&&!d||i.thisIsTgt&&!f)||n.push(u))}return this.spawn(n,!0)}}Te(tr,{connectedEdges:Br(function(t){for(var e=[],r=this,n=0;n<r.length;n++){var a=r[n];if(a.isNode())for(var i=a._private.edges,s=0;s<i.length;s++){var o=i[s];e.push(o)}}return this.spawn(e,!0).filter(t)},"connectedEdges"),connectedNodes:Br(function(t){for(var e=[],r=this,n=0;n<r.length;n++){var a=r[n];a.isEdge()&&(e.push(a.source()[0]),e.push(a.target()[0]))}return this.spawn(e,!0).filter(t)},"connectedNodes"),parallelEdges:Br(rE(),"parallelEdges"),codirectedEdges:Br(rE({codirected:!0}),"codirectedEdges")});function rE(t){var e={codirected:!1};return t=Te({},e,t),function(n){for(var a=[],i=this.edges(),s=t,o=0;o<i.length;o++)for(var l=i[o],u=l._private,c=u.source,d=c._private.data.id,f=u.data.target,h=c._private.edges,v=0;v<h.length;v++){var x=h[v],b=x._private.data,m=b.target,p=b.source,y=m===f&&p===d,w=d===m&&f===p;(s.codirected&&y||!s.codirected&&(y||w))&&a.push(x)}return this.spawn(a,!0).filter(n)}}Te(tr,{components:function(e){var r=this,n=r.cy(),a=n.collection(),i=e==null?r.nodes():e.nodes(),s=[];e!=null&&i.empty()&&(i=e.sources());var o=function(c,d){a.merge(c),i.unmerge(c),d.merge(c)};if(i.empty())return r.spawn();var l=function(){var c=n.collection();s.push(c);var d=i[0];o(d,c),r.bfs({directed:!1,roots:d,visit:function(h){return o(h,c)}}),c.forEach(function(f){f.connectedEdges().forEach(function(h){r.has(h)&&c.has(h.source())&&c.has(h.target())&&c.merge(h)})})};do l();while(i.length>0);return s},component:function(){var e=this[0];return e.cy().mutableElements().components(e)[0]}});tr.componentsOf=tr.components;var Ht=function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(e===void 0){ct("A collection must have a reference to the core");return}var i=new Pn,s=!1;if(!r)r=[];else if(r.length>0&&Ue(r[0])&&!Qo(r[0])){s=!0;for(var o=[],l=new vs,u=0,c=r.length;u<c;u++){var d=r[u];d.data==null&&(d.data={});var f=d.data;if(f.id==null)f.id=XP();else if(e.hasElementWithId(f.id)||l.has(f.id))continue;var h=new Rc(e,d,!1);o.push(h),l.add(f.id)}r=o}this.length=0;for(var v=0,x=r.length;v<x;v++){var b=r[v][0];if(b!=null){var m=b._private.data.id;(!n||!i.has(m))&&(n&&i.set(m,{index:this.length,ele:b}),this[this.length]=b,this.length++)}}this._private={eles:this,cy:e,get map(){return this.lazyMap==null&&this.rebuildMap(),this.lazyMap},set map(p){this.lazyMap=p},rebuildMap:function(){for(var y=this.lazyMap=new Pn,w=this.eles,E=0;E<w.length;E++){var S=w[E];y.set(S.id(),{index:E,ele:S})}}},n&&(this._private.map=i),s&&!a&&this.restore()},nt=Rc.prototype=Ht.prototype=Object.create(Array.prototype);nt.instanceString=function(){return"collection"};nt.spawn=function(t,e){return new Ht(this.cy(),t,e)};nt.spawnSelf=function(){return this.spawn(this)};nt.cy=function(){return this._private.cy};nt.renderer=function(){return this._private.cy.renderer()};nt.element=function(){return this[0]};nt.collection=function(){return LP(this)?this:new Ht(this._private.cy,[this])};nt.unique=function(){return new Ht(this._private.cy,this,!0)};nt.hasElementWithId=function(t){return t=""+t,this._private.map.has(t)};nt.getElementById=function(t){t=""+t;var e=this._private.cy,r=this._private.map.get(t);return r?r.ele:new Ht(e)};nt.$id=nt.getElementById;nt.poolIndex=function(){var t=this._private.cy,e=t._private.elements,r=this[0]._private.data.id;return e._private.map.get(r).index};nt.indexOf=function(t){var e=t[0]._private.data.id;return this._private.map.get(e).index};nt.indexOfId=function(t){return t=""+t,this._private.map.get(t).index};nt.json=function(t){var e=this.element(),r=this.cy();if(e==null&&t)return this;if(e!=null){var n=e._private;if(Ue(t)){if(r.startBatch(),t.data){e.data(t.data);var a=n.data;if(e.isEdge()){var i=!1,s={},o=t.data.source,l=t.data.target;o!=null&&o!=a.source&&(s.source=""+o,i=!0),l!=null&&l!=a.target&&(s.target=""+l,i=!0),i&&(e=e.move(s))}else{var u="parent"in t.data,c=t.data.parent;u&&(c!=null||a.parent!=null)&&c!=a.parent&&(c===void 0&&(c=null),c!=null&&(c=""+c),e=e.move({parent:c}))}}t.position&&e.position(t.position);var d=function(x,b,m){var p=t[x];p!=null&&p!==n[x]&&(p?e[b]():e[m]())};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"),t.classes!=null&&e.classes(t.classes),r.endBatch(),this}else if(t===void 0){var f={data:hn(n.data),position:hn(n.position),group:n.group,removed:n.removed,selected:n.selected,selectable:n.selectable,locked:n.locked,grabbable:n.grabbable,pannable:n.pannable,classes:null};f.classes="";var h=0;return n.classes.forEach(function(v){return f.classes+=h++===0?v:" "+v}),f}}};nt.jsons=function(){for(var t=[],e=0;e<this.length;e++){var r=this[e],n=r.json();t.push(n)}return t};nt.clone=function(){for(var t=this.cy(),e=[],r=0;r<this.length;r++){var n=this[r],a=n.json(),i=new Rc(t,a,!1);e.push(i)}return new Ht(t,e)};nt.copy=nt.clone;nt.restore=function(){for(var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=this,n=r.cy(),a=n._private,i=[],s=[],o,l=0,u=r.length;l<u;l++){var c=r[l];e&&!c.removed()||(c.isNode()?i.push(c):s.push(c))}o=i.concat(s);var d,f=function(){o.splice(d,1),d--};for(d=0;d<o.length;d++){var h=o[d],v=h._private,x=v.data;if(h.clearTraversalCache(),!(!e&&!v.removed)){if(x.id===void 0)x.id=XP();else if(le(x.id))x.id=""+x.id;else if(ya(x.id)||!Ee(x.id)){ct("Can not create element with invalid string ID `"+x.id+"`"),f();continue}else if(n.hasElementWithId(x.id)){ct("Can not create second element with ID `"+x.id+"`"),f();continue}}var b=x.id;if(h.isNode()){var m=v.position;m.x==null&&(m.x=0),m.y==null&&(m.y=0)}if(h.isEdge()){for(var p=h,y=["source","target"],w=y.length,E=!1,S=0;S<w;S++){var C=y[S],k=x[C];le(k)&&(k=x[C]=""+x[C]),k==null||k===""?(ct("Can not create edge `"+b+"` with unspecified "+C),E=!0):n.hasElementWithId(k)||(ct("Can not create edge `"+b+"` with nonexistent "+C+" `"+k+"`"),E=!0)}if(E){f();continue}var T=n.getElementById(x.source),_=n.getElementById(x.target);T.same(_)?T._private.edges.push(p):(T._private.edges.push(p),_._private.edges.push(p)),p._private.source=T,p._private.target=_}v.map=new Pn,v.map.set(b,{ele:h,index:0}),v.removed=!1,e&&n.addToPool(h)}for(var N=0;N<i.length;N++){var P=i[N],R=P._private.data;le(R.parent)&&(R.parent=""+R.parent);var I=R.parent,M=I!=null;if(M||P._private.parent){var D=P._private.parent?n.collection().merge(P._private.parent):n.getElementById(I);if(D.empty())R.parent=void 0;else if(D[0].removed())Ye("Node added with missing parent, reference to parent removed"),R.parent=void 0,P._private.parent=null;else{for(var L=!1,j=D;!j.empty();){if(P.same(j)){L=!0,R.parent=void 0;break}j=j.parent()}L||(D[0]._private.children.push(P),P._private.parent=D[0],a.hasCompoundNodes=!0)}}}if(o.length>0){for(var F=o.length===r.length?r:new Ht(n,o),O=0;O<F.length;O++){var B=F[O];B.isNode()||(B.parallelEdges().clearTraversalCache(),B.source().clearTraversalCache(),B.target().clearTraversalCache())}var V;a.hasCompoundNodes?V=n.collection().merge(F).merge(F.connectedNodes()).merge(F.parent()):V=F,V.dirtyCompoundBoundsCache().dirtyBoundingBoxCache().updateStyle(t),t?F.emitAndNotify("add"):e&&F.emit("add")}return r};nt.removed=function(){var t=this[0];return t&&t._private.removed};nt.inside=function(){var t=this[0];return t&&!t._private.removed};nt.remove=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=this,n=[],a={},i=r._private.cy;function s(I){for(var M=I._private.edges,D=0;D<M.length;D++)l(M[D])}function o(I){for(var M=I._private.children,D=0;D<M.length;D++)l(M[D])}function l(I){var M=a[I.id()];e&&I.removed()||M||(a[I.id()]=!0,I.isNode()?(n.push(I),s(I),o(I)):n.unshift(I))}for(var u=0,c=r.length;u<c;u++){var d=r[u];l(d)}function f(I,M){var D=I._private.edges;xa(D,M),I.clearTraversalCache()}function h(I){I.clearTraversalCache()}var v=[];v.ids={};function x(I,M){M=M[0],I=I[0];var D=I._private.children,L=I.id();xa(D,M),M._private.parent=null,v.ids[L]||(v.ids[L]=!0,v.push(I))}r.dirtyCompoundBoundsCache(),e&&i.removeFromPool(n);for(var b=0;b<n.length;b++){var m=n[b];if(m.isEdge()){var p=m.source()[0],y=m.target()[0];f(p,m),f(y,m);for(var w=m.parallelEdges(),E=0;E<w.length;E++){var S=w[E];h(S),S.isBundledBezier()&&S.dirtyBoundingBoxCache()}}else{var C=m.parent();C.length!==0&&x(C,m)}e&&(m._private.removed=!0)}var k=i._private.elements;i._private.hasCompoundNodes=!1;for(var T=0;T<k.length;T++){var _=k[T];if(_.isParent()){i._private.hasCompoundNodes=!0;break}}var N=new Ht(this.cy(),n);N.size()>0&&(t?N.emitAndNotify("remove"):e&&N.emit("remove"));for(var P=0;P<v.length;P++){var R=v[P];(!e||!R.removed())&&R.updateStyle()}return N};nt.move=function(t){var e=this._private.cy,r=this,n=!1,a=!1,i=function(v){return v==null?v:""+v};if(t.source!==void 0||t.target!==void 0){var s=i(t.source),o=i(t.target),l=s!=null&&e.hasElementWithId(s),u=o!=null&&e.hasElementWithId(o);(l||u)&&(e.batch(function(){r.remove(n,a),r.emitAndNotify("moveout");for(var h=0;h<r.length;h++){var v=r[h],x=v._private.data;v.isEdge()&&(l&&(x.source=s),u&&(x.target=o))}r.restore(n,a)}),r.emitAndNotify("move"))}else if(t.parent!==void 0){var c=i(t.parent),d=c===null||e.hasElementWithId(c);if(d){var f=c===null?void 0:c;e.batch(function(){var h=r.remove(n,a);h.emitAndNotify("moveout");for(var v=0;v<r.length;v++){var x=r[v],b=x._private.data;x.isNode()&&(b.parent=f)}h.restore(n,a)}),r.emitAndNotify("move")}}return this};[lA,zq,vu,ha,ls,aF,Lc,bF,IA,MA,kF,tc,hu,Gt,pa,tr].forEach(function(t){Te(nt,t)});var jF={add:function(e){var r,n=this;if(_r(e)){var a=e;if(a._private.cy===n)r=a.restore();else{for(var i=[],s=0;s<a.length;s++){var o=a[s];i.push(o.json())}r=new Ht(n,i)}}else if(Je(e)){var l=e;r=new Ht(n,l)}else if(Ue(e)&&(Je(e.nodes)||Je(e.edges))){for(var u=e,c=[],d=["nodes","edges"],f=0,h=d.length;f<h;f++){var v=d[f],x=u[v];if(Je(x))for(var b=0,m=x.length;b<m;b++){var p=Te({group:v},x[b]);c.push(p)}}r=new Ht(n,c)}else{var y=e;r=new Rc(n,y).collection()}return r},remove:function(e){if(!_r(e)){if(Ee(e)){var r=e;e=this.$(r)}}return e.remove()}};/*! Bezier curve function generator. Copyright Gaetan Renaudeau. MIT License: http://en.wikipedia.org/wiki/MIT_License */function IF(t,e,r,n){var a=4,i=.001,s=1e-7,o=10,l=11,u=1/(l-1),c=typeof Float32Array<"u";if(arguments.length!==4)return!1;for(var d=0;d<4;++d)if(typeof arguments[d]!="number"||isNaN(arguments[d])||!isFinite(arguments[d]))return!1;t=Math.min(t,1),r=Math.min(r,1),t=Math.max(t,0),r=Math.max(r,0);var f=c?new Float32Array(l):new Array(l);function h(_,N){return 1-3*N+3*_}function v(_,N){return 3*N-6*_}function x(_){return 3*_}function b(_,N,P){return((h(N,P)*_+v(N,P))*_+x(N))*_}function m(_,N,P){return 3*h(N,P)*_*_+2*v(N,P)*_+x(N)}function p(_,N){for(var P=0;P<a;++P){var R=m(N,t,r);if(R===0)return N;var I=b(N,t,r)-_;N-=I/R}return N}function y(){for(var _=0;_<l;++_)f[_]=b(_*u,t,r)}function w(_,N,P){var R,I,M=0;do I=N+(P-N)/2,R=b(I,t,r)-_,R>0?P=I:N=I;while(Math.abs(R)>s&&++M<o);return I}function E(_){for(var N=0,P=1,R=l-1;P!==R&&f[P]<=_;++P)N+=u;--P;var I=(_-f[P])/(f[P+1]-f[P]),M=N+I*u,D=m(M,t,r);return D>=i?p(_,M):D===0?M:w(_,N,N+u)}var S=!1;function C(){S=!0,(t!==e||r!==n)&&y()}var k=function(N){return S||C(),t===e&&r===n?N:N===0?0:N===1?1:b(E(N),e,n)};k.getControlPoints=function(){return[{x:t,y:e},{x:r,y:n}]};var T="generateBezier("+[t,e,r,n]+")";return k.toString=function(){return T},k}/*! Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License */var MF=function(){function t(n){return-n.tension*n.x-n.friction*n.v}function e(n,a,i){var s={x:n.x+i.dx*a,v:n.v+i.dv*a,tension:n.tension,friction:n.friction};return{dx:s.v,dv:t(s)}}function r(n,a){var i={dx:n.v,dv:t(n)},s=e(n,a*.5,i),o=e(n,a*.5,s),l=e(n,a,o),u=1/6*(i.dx+2*(s.dx+o.dx)+l.dx),c=1/6*(i.dv+2*(s.dv+o.dv)+l.dv);return n.x=n.x+u*a,n.v=n.v+c*a,n}return function n(a,i,s){var o={x:-1,v:0,tension:null,friction:null},l=[0],u=0,c=1/1e4,d=16/1e3,f,h,v;for(a=parseFloat(a)||500,i=parseFloat(i)||20,s=s||null,o.tension=a,o.friction=i,f=s!==null,f?(u=n(a,i),h=u/s*d):h=d;v=r(v||o,h),l.push(1+v.x),u+=16,Math.abs(v.x)>c&&Math.abs(v.v)>c;);return f?function(x){return l[x*(l.length-1)|0]}:u}}(),et=function(e,r,n,a){var i=IF(e,r,n,a);return function(s,o,l){return s+(o-s)*i(l)}},pu={linear:function(e,r,n){return e+(r-e)*n},ease:et(.25,.1,.25,1),"ease-in":et(.42,0,1,1),"ease-out":et(0,0,.58,1),"ease-in-out":et(.42,0,.58,1),"ease-in-sine":et(.47,0,.745,.715),"ease-out-sine":et(.39,.575,.565,1),"ease-in-out-sine":et(.445,.05,.55,.95),"ease-in-quad":et(.55,.085,.68,.53),"ease-out-quad":et(.25,.46,.45,.94),"ease-in-out-quad":et(.455,.03,.515,.955),"ease-in-cubic":et(.55,.055,.675,.19),"ease-out-cubic":et(.215,.61,.355,1),"ease-in-out-cubic":et(.645,.045,.355,1),"ease-in-quart":et(.895,.03,.685,.22),"ease-out-quart":et(.165,.84,.44,1),"ease-in-out-quart":et(.77,0,.175,1),"ease-in-quint":et(.755,.05,.855,.06),"ease-out-quint":et(.23,1,.32,1),"ease-in-out-quint":et(.86,0,.07,1),"ease-in-expo":et(.95,.05,.795,.035),"ease-out-expo":et(.19,1,.22,1),"ease-in-out-expo":et(1,0,0,1),"ease-in-circ":et(.6,.04,.98,.335),"ease-out-circ":et(.075,.82,.165,1),"ease-in-out-circ":et(.785,.135,.15,.86),spring:function(e,r,n){if(n===0)return pu.linear;var a=MF(e,r,n);return function(i,s,o){return i+(s-i)*a(o)}},"cubic-bezier":et};function nE(t,e,r,n,a){if(n===1||e===r)return r;var i=a(e,r,n);return t==null||((t.roundValue||t.color)&&(i=Math.round(i)),t.min!==void 0&&(i=Math.max(i,t.min)),t.max!==void 0&&(i=Math.min(i,t.max))),i}function aE(t,e){return t.pfValue!=null||t.value!=null?t.pfValue!=null&&(e==null||e.type.units!=="%")?t.pfValue:t.value:t}function xi(t,e,r,n,a){var i=a!=null?a.type:null;r<0?r=0:r>1&&(r=1);var s=aE(t,a),o=aE(e,a);if(le(s)&&le(o))return nE(i,s,o,r,n);if(Je(s)&&Je(o)){for(var l=[],u=0;u<o.length;u++){var c=s[u],d=o[u];if(c!=null&&d!=null){var f=nE(i,c,d,r,n);l.push(f)}else l.push(d)}return l}}function DF(t,e,r,n){var a=!n,i=t._private,s=e._private,o=s.easing,l=s.startTime,u=n?t:t.cy(),c=u.style();if(!s.easingImpl)if(o==null)s.easingImpl=pu.linear;else{var d;if(Ee(o)){var f=c.parse("transition-timing-function",o);d=f.value}else d=o;var h,v;Ee(d)?(h=d,v=[]):(h=d[1],v=d.slice(2).map(function(F){return+F})),v.length>0?(h==="spring"&&v.push(s.duration),s.easingImpl=pu[h].apply(null,v)):s.easingImpl=pu[h]}var x=s.easingImpl,b;if(s.duration===0?b=1:b=(r-l)/s.duration,s.applying&&(b=s.progress),b<0?b=0:b>1&&(b=1),s.delay==null){var m=s.startPosition,p=s.position;if(p&&a&&!t.locked()){var y={};zs(m.x,p.x)&&(y.x=xi(m.x,p.x,b,x)),zs(m.y,p.y)&&(y.y=xi(m.y,p.y,b,x)),t.position(y)}var w=s.startPan,E=s.pan,S=i.pan,C=E!=null&&n;C&&(zs(w.x,E.x)&&(S.x=xi(w.x,E.x,b,x)),zs(w.y,E.y)&&(S.y=xi(w.y,E.y,b,x)),t.emit("pan"));var k=s.startZoom,T=s.zoom,_=T!=null&&n;_&&(zs(k,T)&&(i.zoom=Bo(i.minZoom,xi(k,T,b,x),i.maxZoom)),t.emit("zoom")),(C||_)&&t.emit("viewport");var N=s.style;if(N&&N.length>0&&a){for(var P=0;P<N.length;P++){var R=N[P],I=R.name,M=R,D=s.startStyle[I],L=c.properties[D.name],j=xi(D,M,b,x,L);c.overrideBypass(t,I,j)}t.emit("style")}}return s.progress=b,b}function zs(t,e){return t==null||e==null?!1:le(t)&&le(e)?!0:!!(t&&e)}function LF(t,e,r,n){var a=e._private;a.started=!0,a.startTime=r-a.progress*a.duration}function iE(t,e){var r=e._private.aniEles,n=[];function a(c,d){var f=c._private,h=f.animation.current,v=f.animation.queue,x=!1;if(h.length===0){var b=v.shift();b&&h.push(b)}for(var m=function(S){for(var C=S.length-1;C>=0;C--){var k=S[C];k()}S.splice(0,S.length)},p=h.length-1;p>=0;p--){var y=h[p],w=y._private;if(w.stopped){h.splice(p,1),w.hooked=!1,w.playing=!1,w.started=!1,m(w.frames);continue}!w.playing&&!w.applying||(w.playing&&w.applying&&(w.applying=!1),w.started||LF(c,y,t),DF(c,y,t,d),w.applying&&(w.applying=!1),m(w.frames),w.step!=null&&w.step(t),y.completed()&&(h.splice(p,1),w.hooked=!1,w.playing=!1,w.started=!1,m(w.completes)),x=!0)}return!d&&h.length===0&&v.length===0&&n.push(c),x}for(var i=!1,s=0;s<r.length;s++){var o=r[s],l=a(o);i=i||l}var u=a(e,!0);(i||u)&&(r.length>0?e.notify("draw",r):e.notify("draw")),r.unmerge(n),e.emit("step")}var BF={animate:Ke.animate(),animation:Ke.animation(),animated:Ke.animated(),clearQueue:Ke.clearQueue(),delay:Ke.delay(),delayAnimation:Ke.delayAnimation(),stop:Ke.stop(),addToAnimationPool:function(e){var r=this;r.styleEnabled()&&r._private.aniEles.merge(e)},stopAnimationLoop:function(){this._private.animationsRunning=!1},startAnimationLoop:function(){var e=this;if(e._private.animationsRunning=!0,!e.styleEnabled())return;function r(){e._private.animationsRunning&&Xu(function(i){iE(i,e),r()})}var n=e.renderer();n&&n.beforeRender?n.beforeRender(function(i,s){iE(s,e)},n.beforeRenderPriorities.animations):r()}},OF={qualifierCompare:function(e,r){return e==null||r==null?e==null&&r==null:e.sameText(r)},eventMatches:function(e,r,n){var a=r.qualifier;return a!=null?e!==n.target&&Qo(n.target)&&a.matches(n.target):!0},addEventFields:function(e,r){r.cy=e,r.target=e},callbackContext:function(e,r,n){return r.qualifier!=null?n.target:e}},Hl=function(e){return Ee(e)?new wa(e):e},BA={createEmitter:function(){var e=this._private;return e.emitter||(e.emitter=new Bc(OF,this)),this},emitter:function(){return this._private.emitter},on:function(e,r,n){return this.emitter().on(e,Hl(r),n),this},removeListener:function(e,r,n){return this.emitter().removeListener(e,Hl(r),n),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,r,n){return this.emitter().one(e,Hl(r),n),this},once:function(e,r,n){return this.emitter().one(e,Hl(r),n),this},emit:function(e,r){return this.emitter().emit(e,r),this},emitAndNotify:function(e,r){return this.emit(e),this.notify(e,r),this}};Ke.eventAliasesOn(BA);var O0={png:function(e){var r=this._private.renderer;return e=e||{},r.png(e)},jpg:function(e){var r=this._private.renderer;return e=e||{},e.bg=e.bg||"#fff",r.jpg(e)}};O0.jpeg=O0.jpg;var gu={layout:function(e){var r=this;if(e==null){ct("Layout options must be specified to make a layout");return}if(e.name==null){ct("A `name` must be specified to make a layout");return}var n=e.name,a=r.extension("layout",n);if(a==null){ct("No such layout `"+n+"` found. Did you forget to import it and `cytoscape.use()` it?");return}var i;Ee(e.eles)?i=r.$(e.eles):i=e.eles!=null?e.eles:r.$();var s=new a(Te({},e,{cy:r,eles:i}));return s}};gu.createLayout=gu.makeLayout=gu.layout;var qF={notify:function(e,r){var n=this._private;if(this.batching()){n.batchNotifications=n.batchNotifications||{};var a=n.batchNotifications[e]=n.batchNotifications[e]||this.collection();r!=null&&a.merge(r);return}if(n.notificationsEnabled){var i=this.renderer();this.destroyed()||!i||i.notify(e,r)}},notifications:function(e){var r=this._private;return e===void 0?r.notificationsEnabled:(r.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 e.batchCount==null&&(e.batchCount=0),e.batchCount===0&&(e.batchStyleEles=this.collection(),e.batchNotifications={}),e.batchCount++,this},endBatch:function(){var e=this._private;if(e.batchCount===0)return this;if(e.batchCount--,e.batchCount===0){e.batchStyleEles.updateStyle();var r=this.renderer();Object.keys(e.batchNotifications).forEach(function(n){var a=e.batchNotifications[n];a.empty()?r.notify(n):r.notify(n,a)})}return this},batch:function(e){return this.startBatch(),e(),this.endBatch(),this},batchData:function(e){var r=this;return this.batch(function(){for(var n=Object.keys(e),a=0;a<n.length;a++){var i=n[a],s=e[i],o=r.getElementById(i);o.data(s)}})}},FF=Kt({hideEdgesOnViewport:!1,textureOnViewport:!1,motionBlur:!1,motionBlurOpacity:.05,pixelRatio:void 0,desktopTapThreshold:4,touchTapThreshold:8,wheelSensitivity:1,debug:!1,showFps:!1,webgl:!1,webglDebug:!1,webglDebugShowAtlases:!1,webglTexSize:2048,webglTexRows:36,webglTexRowsNodes:18,webglBatchSize:2048,webglTexPerBatch:14,webglBgColor:[255,255,255]}),q0={renderTo:function(e,r,n,a){var i=this._private.renderer;return i.renderTo(e,r,n,a),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 r=this,n=r.extension("renderer",e.name);if(n==null){ct("Can not initialise: No such renderer `".concat(e.name,"` found. Did you forget to import it and `cytoscape.use()` it?"));return}e.wheelSensitivity!==void 0&&Ye("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 a=FF(e);a.cy=r,r._private.renderer=new n(a),this.notify("init")},destroyRenderer:function(){var e=this;e.notify("destroy");var r=e.container();if(r)for(r._cyreg=null;r.childNodes.length>0;)r.removeChild(r.childNodes[0]);e._private.renderer=null,e.mutableElements().forEach(function(n){var a=n._private;a.rscratch={},a.rstyle={},a.animation.current=[],a.animation.queue=[]})},onRender:function(e){return this.on("render",e)},offRender:function(e){return this.off("render",e)}};q0.invalidateDimensions=q0.resize;var mu={collection:function(e,r){return Ee(e)?this.$(e):_r(e)?e.collection():Je(e)?(r||(r={}),new Ht(this,e,r.unique,r.removed)):new Ht(this)},nodes:function(e){var r=this.$(function(n){return n.isNode()});return e?r.filter(e):r},edges:function(e){var r=this.$(function(n){return n.isEdge()});return e?r.filter(e):r},$:function(e){var r=this._private.elements;return e?r.filter(e):r.spawnSelf()},mutableElements:function(){return this._private.elements}};mu.elements=mu.filter=mu.$;var $t={},ho="t",$F="f";$t.apply=function(t){for(var e=this,r=e._private,n=r.cy,a=n.collection(),i=0;i<t.length;i++){var s=t[i],o=e.getContextMeta(s);if(!o.empty){var l=e.getContextStyle(o),u=e.applyContextStyle(o,l,s);s._private.appliedInitStyle?e.updateTransitions(s,u.diffProps):s._private.appliedInitStyle=!0;var c=e.updateStyleHints(s);c&&a.push(s)}}return a};$t.getPropertiesDiff=function(t,e){var r=this,n=r._private.propDiffs=r._private.propDiffs||{},a=t+"-"+e,i=n[a];if(i)return i;for(var s=[],o={},l=0;l<r.length;l++){var u=r[l],c=t[l]===ho,d=e[l]===ho,f=c!==d,h=u.mappedProperties.length>0;if(f||d&&h){var v=void 0;f&&h||f?v=u.properties:h&&(v=u.mappedProperties);for(var x=0;x<v.length;x++){for(var b=v[x],m=b.name,p=!1,y=l+1;y<r.length;y++){var w=r[y],E=e[y]===ho;if(E&&(p=w.properties[b.name]!=null,p))break}!o[m]&&!p&&(o[m]=!0,s.push(m))}}}return n[a]=s,s};$t.getContextMeta=function(t){for(var e=this,r="",n,a=t._private.styleCxtKey||"",i=0;i<e.length;i++){var s=e[i],o=s.selector&&s.selector.matches(t);o?r+=ho:r+=$F}return n=e.getPropertiesDiff(a,r),t._private.styleCxtKey=r,{key:r,diffPropNames:n,empty:n.length===0}};$t.getContextStyle=function(t){var e=t.key,r=this,n=this._private.contextStyles=this._private.contextStyles||{};if(n[e])return n[e];for(var a={_private:{key:e}},i=0;i<r.length;i++){var s=r[i],o=e[i]===ho;if(o)for(var l=0;l<s.properties.length;l++){var u=s.properties[l];a[u.name]=u}}return n[e]=a,a};$t.applyContextStyle=function(t,e,r){for(var n=this,a=t.diffPropNames,i={},s=n.types,o=0;o<a.length;o++){var l=a[o],u=e[l],c=r.pstyle(l);if(!u)if(c)c.bypass?u={name:l,deleteBypassed:!0}:u={name:l,delete:!0};else continue;if(c!==u){if(u.mapped===s.fn&&c!=null&&c.mapping!=null&&c.mapping.value===u.value){var d=c.mapping,f=d.fnValue=u.value(r);if(f===d.prevFnValue)continue}var h=i[l]={prev:c};n.applyParsedProperty(r,u),h.next=r.pstyle(l),h.next&&h.next.bypass&&(h.next=h.next.bypassed)}}return{diffProps:i}};$t.updateStyleHints=function(t){var e=t._private,r=this,n=r.propertyGroupNames,a=r.propertyGroupKeys,i=function(Y,ee,ie){return r.getPropertiesHash(Y,ee,ie)},s=e.styleKey;if(t.removed())return!1;var o=e.group==="nodes",l=t._private.style;n=Object.keys(l);for(var u=0;u<a.length;u++){var c=a[u];e.styleKeys[c]=[$a,ki]}for(var d=function(Y,ee){return e.styleKeys[ee][0]=Mo(Y,e.styleKeys[ee][0])},f=function(Y,ee){return e.styleKeys[ee][1]=Do(Y,e.styleKeys[ee][1])},h=function(Y,ee){d(Y,ee),f(Y,ee)},v=function(Y,ee){for(var ie=0;ie<Y.length;ie++){var oe=Y.charCodeAt(ie);d(oe,ee),f(oe,ee)}},x=2e9,b=function(Y){return-128<Y&&Y<128&&Math.floor(Y)!==Y?x-(Y*1024|0):Y},m=0;m<n.length;m++){var p=n[m],y=l[p];if(y!=null){var w=this.properties[p],E=w.type,S=w.groupKey,C=void 0;w.hashOverride!=null?C=w.hashOverride(t,y):y.pfValue!=null&&(C=y.pfValue);var k=w.enums==null?y.value:null,T=C!=null,_=k!=null,N=T||_,P=y.units;if(E.number&&N&&!E.multiple){var R=T?C:k;h(b(R),S),!T&&P!=null&&v(P,S)}else v(y.strValue,S)}}for(var I=[$a,ki],M=0;M<a.length;M++){var D=a[M],L=e.styleKeys[D];I[0]=Mo(L[0],I[0]),I[1]=Do(L[1],I[1])}e.styleKey=nO(I[0],I[1]);var j=e.styleKeys;e.labelDimsKey=Wn(j.labelDimensions);var F=i(t,["label"],j.labelDimensions);if(e.labelKey=Wn(F),e.labelStyleKey=Wn(Ol(j.commonLabel,F)),!o){var O=i(t,["source-label"],j.labelDimensions);e.sourceLabelKey=Wn(O),e.sourceLabelStyleKey=Wn(Ol(j.commonLabel,O));var B=i(t,["target-label"],j.labelDimensions);e.targetLabelKey=Wn(B),e.targetLabelStyleKey=Wn(Ol(j.commonLabel,B))}if(o){var V=e.styleKeys,J=V.nodeBody,q=V.nodeBorder,$=V.nodeOutline,z=V.backgroundImage,W=V.compound,ne=V.pie,X=V.stripe,U=[J,q,$,z,W,ne,X].filter(function(H){return H!=null}).reduce(Ol,[$a,ki]);e.nodeKey=Wn(U),e.hasPie=ne!=null&&ne[0]!==$a&&ne[1]!==ki,e.hasStripe=X!=null&&X[0]!==$a&&X[1]!==ki}return s!==e.styleKey};$t.clearStyleHints=function(t){var e=t._private;e.styleCxtKey="",e.styleKeys={},e.styleKey=null,e.labelKey=null,e.labelStyleKey=null,e.sourceLabelKey=null,e.sourceLabelStyleKey=null,e.targetLabelKey=null,e.targetLabelStyleKey=null,e.nodeKey=null,e.hasPie=null,e.hasStripe=null};$t.applyParsedProperty=function(t,e){var r=this,n=e,a=t._private.style,i,s=r.types,o=r.properties[n.name].type,l=n.bypass,u=a[n.name],c=u&&u.bypass,d=t._private,f="mapping",h=function(J){return J==null?null:J.pfValue!=null?J.pfValue:J.value},v=function(){var J=h(u),q=h(n);r.checkTriggers(t,n.name,J,q)};if(e.name==="curve-style"&&t.isEdge()&&(e.value!=="bezier"&&t.isLoop()||e.value==="haystack"&&(t.source().isParent()||t.target().isParent()))&&(n=e=this.parse(e.name,"bezier",l)),n.delete)return a[n.name]=void 0,v(),!0;if(n.deleteBypassed)return u?u.bypass?(u.bypassed=void 0,v(),!0):!1:(v(),!0);if(n.deleteBypass)return u?u.bypass?(a[n.name]=u.bypassed,v(),!0):!1:(v(),!0);var x=function(){Ye("Do not assign mappings to elements without corresponding data (i.e. ele `"+t.id()+"` has no mapping for property `"+n.name+"` with data field `"+n.field+"`); try a `["+n.field+"]` selector to limit scope to elements with `"+n.field+"` defined")};switch(n.mapped){case s.mapData:{for(var b=n.field.split("."),m=d.data,p=0;p<b.length&&m;p++){var y=b[p];m=m[y]}if(m==null)return x(),!1;var w;if(le(m)){var E=n.fieldMax-n.fieldMin;E===0?w=0:w=(m-n.fieldMin)/E}else return Ye("Do not use continuous mappers without specifying numeric data (i.e. `"+n.field+": "+m+"` for `"+t.id()+"` is non-numeric)"),!1;if(w<0?w=0:w>1&&(w=1),o.color){var S=n.valueMin[0],C=n.valueMax[0],k=n.valueMin[1],T=n.valueMax[1],_=n.valueMin[2],N=n.valueMax[2],P=n.valueMin[3]==null?1:n.valueMin[3],R=n.valueMax[3]==null?1:n.valueMax[3],I=[Math.round(S+(C-S)*w),Math.round(k+(T-k)*w),Math.round(_+(N-_)*w),Math.round(P+(R-P)*w)];i={bypass:n.bypass,name:n.name,value:I,strValue:"rgb("+I[0]+", "+I[1]+", "+I[2]+")"}}else if(o.number){var M=n.valueMin+(n.valueMax-n.valueMin)*w;i=this.parse(n.name,M,n.bypass,f)}else return!1;if(!i)return x(),!1;i.mapping=n,n=i;break}case s.data:{for(var D=n.field.split("."),L=d.data,j=0;j<D.length&&L;j++){var F=D[j];L=L[F]}if(L!=null&&(i=this.parse(n.name,L,n.bypass,f)),!i)return x(),!1;i.mapping=n,n=i;break}case s.fn:{var O=n.value,B=n.fnValue!=null?n.fnValue:O(t);if(n.prevFnValue=B,B==null)return Ye("Custom function mappers may not return null (i.e. `"+n.name+"` for ele `"+t.id()+"` is null)"),!1;if(i=this.parse(n.name,B,n.bypass,f),!i)return Ye("Custom function mappers may not return invalid values for the property type (i.e. `"+n.name+"` for ele `"+t.id()+"` is invalid)"),!1;i.mapping=hn(n),n=i;break}case void 0:break;default:return!1}return l?(c?n.bypassed=u.bypassed:n.bypassed=u,a[n.name]=n):c?u.bypassed=n:a[n.name]=n,v(),!0};$t.cleanElements=function(t,e){for(var r=0;r<t.length;r++){var n=t[r];if(this.clearStyleHints(n),n.dirtyCompoundBoundsCache(),n.dirtyBoundingBoxCache(),!e)n._private.style={};else for(var a=n._private.style,i=Object.keys(a),s=0;s<i.length;s++){var o=i[s],l=a[o];l!=null&&(l.bypass?l.bypassed=null:a[o]=null)}}};$t.update=function(){var t=this._private.cy,e=t.mutableElements();e.updateStyle()};$t.updateTransitions=function(t,e){var r=this,n=t._private,a=t.pstyle("transition-property").value,i=t.pstyle("transition-duration").pfValue,s=t.pstyle("transition-delay").pfValue;if(a.length>0&&i>0){for(var o={},l=!1,u=0;u<a.length;u++){var c=a[u],d=t.pstyle(c),f=e[c];if(f){var h=f.prev,v=h,x=f.next!=null?f.next:d,b=!1,m=void 0,p=1e-6;v&&(le(v.pfValue)&&le(x.pfValue)?(b=x.pfValue-v.pfValue,m=v.pfValue+p*b):le(v.value)&&le(x.value)?(b=x.value-v.value,m=v.value+p*b):Je(v.value)&&Je(x.value)&&(b=v.value[0]!==x.value[0]||v.value[1]!==x.value[1]||v.value[2]!==x.value[2],m=v.strValue),b&&(o[c]=x.strValue,this.applyBypass(t,c,m),l=!0))}}if(!l)return;n.transitioning=!0,new hs(function(y){s>0?t.delayAnimation(s).play().promise().then(y):y()}).then(function(){return t.animation({style:o,duration:i,easing:t.pstyle("transition-timing-function").value,queue:!1}).play().promise()}).then(function(){r.removeBypasses(t,a),t.emitAndNotify("style"),n.transitioning=!1})}else n.transitioning&&(this.removeBypasses(t,a),t.emitAndNotify("style"),n.transitioning=!1)};$t.checkTrigger=function(t,e,r,n,a,i){var s=this.properties[e],o=a(s);t.removed()||o!=null&&o(r,n,t)&&i(s)};$t.checkZOrderTrigger=function(t,e,r,n){var a=this;this.checkTrigger(t,e,r,n,function(i){return i.triggersZOrder},function(){a._private.cy.notify("zorder",t)})};$t.checkBoundsTrigger=function(t,e,r,n){this.checkTrigger(t,e,r,n,function(a){return a.triggersBounds},function(a){t.dirtyCompoundBoundsCache(),t.dirtyBoundingBoxCache()})};$t.checkConnectedEdgesBoundsTrigger=function(t,e,r,n){this.checkTrigger(t,e,r,n,function(a){return a.triggersBoundsOfConnectedEdges},function(a){t.connectedEdges().forEach(function(i){i.dirtyBoundingBoxCache()})})};$t.checkParallelEdgesBoundsTrigger=function(t,e,r,n){this.checkTrigger(t,e,r,n,function(a){return a.triggersBoundsOfParallelEdges},function(a){t.parallelEdges().forEach(function(i){i.dirtyBoundingBoxCache()})})};$t.checkTriggers=function(t,e,r,n){t.dirtyStyleCache(),this.checkZOrderTrigger(t,e,r,n),this.checkBoundsTrigger(t,e,r,n),this.checkConnectedEdgesBoundsTrigger(t,e,r,n),this.checkParallelEdgesBoundsTrigger(t,e,r,n)};var il={};il.applyBypass=function(t,e,r,n){var a=this,i=[],s=!0;if(e==="*"||e==="**"){if(r!==void 0)for(var o=0;o<a.properties.length;o++){var l=a.properties[o],u=l.name,c=this.parse(u,r,!0);c&&i.push(c)}}else if(Ee(e)){var d=this.parse(e,r,!0);d&&i.push(d)}else if(Ue(e)){var f=e;n=r;for(var h=Object.keys(f),v=0;v<h.length;v++){var x=h[v],b=f[x];if(b===void 0&&(b=f[_c(x)]),b!==void 0){var m=this.parse(x,b,!0);m&&i.push(m)}}}else return!1;if(i.length===0)return!1;for(var p=!1,y=0;y<t.length;y++){for(var w=t[y],E={},S=void 0,C=0;C<i.length;C++){var k=i[C];if(n){var T=w.pstyle(k.name);S=E[k.name]={prev:T}}p=this.applyParsedProperty(w,hn(k))||p,n&&(S.next=w.pstyle(k.name))}p&&this.updateStyleHints(w),n&&this.updateTransitions(w,E,s)}return p};il.overrideBypass=function(t,e,r){e=Qx(e);for(var n=0;n<t.length;n++){var a=t[n],i=a._private.style[e],s=this.properties[e].type,o=s.color,l=s.mutiple,u=i?i.pfValue!=null?i.pfValue:i.value:null;!i||!i.bypass?this.applyBypass(a,e,r):(i.value=r,i.pfValue!=null&&(i.pfValue=r),o?i.strValue="rgb("+r.join(",")+")":l?i.strValue=r.join(" "):i.strValue=""+r,this.updateStyleHints(a)),this.checkTriggers(a,e,u,r)}};il.removeAllBypasses=function(t,e){return this.removeBypasses(t,this.propertyNames,e)};il.removeBypasses=function(t,e,r){for(var n=!0,a=0;a<t.length;a++){for(var i=t[a],s={},o=0;o<e.length;o++){var l=e[o],u=this.properties[l],c=i.pstyle(u.name);if(!(!c||!c.bypass)){var d="",f=this.parse(l,d,!0),h=s[u.name]={prev:c};this.applyParsedProperty(i,f),h.next=i.pstyle(u.name)}}this.updateStyleHints(i),r&&this.updateTransitions(i,s,n)}};var v1={};v1.getEmSizeInPixels=function(){var t=this.containerCss("font-size");return t!=null?parseFloat(t):1};v1.containerCss=function(t){var e=this._private.cy,r=e.container(),n=e.window();if(n&&r&&n.getComputedStyle)return n.getComputedStyle(r).getPropertyValue(t)};var yn={};yn.getRenderedStyle=function(t,e){return e?this.getStylePropertyValue(t,e,!0):this.getRawStyle(t,!0)};yn.getRawStyle=function(t,e){var r=this;if(t=t[0],t){for(var n={},a=0;a<r.properties.length;a++){var i=r.properties[a],s=r.getStylePropertyValue(t,i.name,e);s!=null&&(n[i.name]=s,n[_c(i.name)]=s)}return n}};yn.getIndexedStyle=function(t,e,r,n){var a=t.pstyle(e)[r][n];return a??t.cy().style().getDefaultProperty(e)[r][0]};yn.getStylePropertyValue=function(t,e,r){var n=this;if(t=t[0],t){var a=n.properties[e];a.alias&&(a=a.pointsTo);var i=a.type,s=t.pstyle(a.name);if(s){var o=s.value,l=s.units,u=s.strValue;if(r&&i.number&&o!=null&&le(o)){var c=t.cy().zoom(),d=function(b){return b*c},f=function(b,m){return d(b)+m},h=Je(o),v=h?l.every(function(x){return x!=null}):l!=null;return v?h?o.map(function(x,b){return f(x,l[b])}).join(" "):f(o,l):h?o.map(function(x){return Ee(x)?x:""+d(x)}).join(" "):""+d(o)}else if(u!=null)return u}return null}};yn.getAnimationStartStyle=function(t,e){for(var r={},n=0;n<e.length;n++){var a=e[n],i=a.name,s=t.pstyle(i);s!==void 0&&(Ue(s)?s=this.parse(i,s.strValue):s=this.parse(i,s)),s&&(r[i]=s)}return r};yn.getPropsList=function(t){var e=this,r=[],n=t,a=e.properties;if(n)for(var i=Object.keys(n),s=0;s<i.length;s++){var o=i[s],l=n[o],u=a[o]||a[Qx(o)],c=this.parse(u.name,l);c&&r.push(c)}return r};yn.getNonDefaultPropertiesHash=function(t,e,r){var n=r.slice(),a,i,s,o,l,u;for(l=0;l<e.length;l++)if(a=e[l],i=t.pstyle(a,!1),i!=null)if(i.pfValue!=null)n[0]=Mo(o,n[0]),n[1]=Do(o,n[1]);else for(s=i.strValue,u=0;u<s.length;u++)o=s.charCodeAt(u),n[0]=Mo(o,n[0]),n[1]=Do(o,n[1]);return n};yn.getPropertiesHash=yn.getNonDefaultPropertiesHash;var Fc={};Fc.appendFromJson=function(t){for(var e=this,r=0;r<t.length;r++){var n=t[r],a=n.selector,i=n.style||n.css,s=Object.keys(i);e.selector(a);for(var o=0;o<s.length;o++){var l=s[o],u=i[l];e.css(l,u)}}return e};Fc.fromJson=function(t){var e=this;return e.resetToDefault(),e.appendFromJson(t),e};Fc.json=function(){for(var t=[],e=this.defaultLength;e<this.length;e++){for(var r=this[e],n=r.selector,a=r.properties,i={},s=0;s<a.length;s++){var o=a[s];i[o.name]=o.strValue}t.push({selector:n?n.toString():"core",style:i})}return t};var h1={};h1.appendFromString=function(t){var e=this,r=this,n=""+t,a,i,s;n=n.replace(/[/][*](\s|.)+?[*][/]/g,"");function o(){n.length>a.length?n=n.substr(a.length):n=""}function l(){i.length>s.length?i=i.substr(s.length):i=""}for(;;){var u=n.match(/^\s*$/);if(u)break;var c=n.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!c){Ye("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+n);break}a=c[0];var d=c[1];if(d!=="core"){var f=new wa(d);if(f.invalid){Ye("Skipping parsing of block: Invalid selector found in string stylesheet: "+d),o();continue}}var h=c[2],v=!1;i=h;for(var x=[];;){var b=i.match(/^\s*$/);if(b)break;var m=i.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!m){Ye("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+h),v=!0;break}s=m[0];var p=m[1],y=m[2],w=e.properties[p];if(!w){Ye("Skipping property: Invalid property name in: "+s),l();continue}var E=r.parse(p,y);if(!E){Ye("Skipping property: Invalid property definition in: "+s),l();continue}x.push({name:p,val:y}),l()}if(v){o();break}r.selector(d);for(var S=0;S<x.length;S++){var C=x[S];r.css(C.name,C.val)}o()}return r};h1.fromString=function(t){var e=this;return e.resetToDefault(),e.appendFromString(t),e};var Ct={};(function(){var t=jt,e=DB,r=BB,n=OB,a=qB,i=function(H){return"^"+H+"\\s*\\(\\s*([\\w\\.]+)\\s*\\)$"},s=function(H){var Y=t+"|\\w+|"+e+"|"+r+"|"+n+"|"+a;return"^"+H+"\\s*\\(([\\w\\.]+)\\s*\\,\\s*("+t+")\\s*\\,\\s*("+t+")\\s*,\\s*("+Y+")\\s*\\,\\s*("+Y+")\\)$"},o=[`^url\\s*\\(\\s*['"]?(.+?)['"]?\\s*\\)$`,"^(none)$","^(.+)$"];Ct.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},nonNegativeNumber:{number:!0,min: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"]},axisDirectionExplicit:{enums:["leftward","rightward","upward","downward"]},axisDirectionPrimary:{enums:["horizontal","vertical"]},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","null"],multiple:!0},bgClip:{enums:["none","node"],multiple:!0},bgContainment:{enums:["inside","over"],multiple:!0},boxSelection:{enums:["contain","overlap","none"]},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"]},linePosition:{enums:["center","inside","outside"]},lineJoin:{enums:["round","bevel","miter"]},borderStyle:{enums:["solid","dotted","dashed","double"]},curveStyle:{enums:["bezier","unbundled-bezier","haystack","segments","straight","straight-triangle","taxi","round-segments","round-taxi"]},radiusType:{enums:["arc-radius","influence-radius"],multiple:!0},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","circle"]},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","right-rhomboid","polygon"]},overlayShape:{enums:["roundrectangle","round-rectangle","ellipse"]},cornerRadius:{number:!0,min:0,units:"px|em",implicitUnits:"px",enums:["auto"]},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"]},arrowWidth:{number:!0,units:"%|px|em",implicitUnits:"px",enums:["match-line"]},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:i("data")},layoutData:{mapping:!0,regex:i("layoutData")},scratch:{mapping:!0,regex:i("scratch")},mapData:{mapping:!0,regex:s("mapData")},mapLayoutData:{mapping:!0,regex:s("mapLayoutData")},mapScratch:{mapping:!0,regex:s("mapScratch")},fn:{mapping:!0,fn:!0},url:{regexes:o,singleRegexMatchValue:!0},urls:{regexes:o,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","endpoints"]},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(H,Y){switch(H.length){case 2:return Y[0]!=="deg"&&Y[0]!=="rad"&&Y[1]!=="deg"&&Y[1]!=="rad";case 1:return Ee(H[0])||Y[0]==="deg"||Y[0]==="rad";default:return!1}}},easing:{regexes:["^(spring)\\s*\\(\\s*("+t+")\\s*,\\s*("+t+")\\s*\\)$","^(cubic-bezier)\\s*\\(\\s*("+t+")\\s*,\\s*("+t+")\\s*,\\s*("+t+")\\s*,\\s*("+t+")\\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(H){var Y=H.length;return Y===1||Y===2||Y===4}}};var l={zeroNonZero:function(H,Y){return(H==null||Y==null)&&H!==Y||H==0&&Y!=0?!0:H!=0&&Y==0},any:function(H,Y){return H!=Y},emptyNonEmpty:function(H,Y){var ee=ya(H),ie=ya(Y);return ee&&!ie||!ee&&ie}},u=Ct.types,c=[{name:"label",type:u.text,triggersBounds:l.any,triggersZOrder:l.emptyNonEmpty},{name:"text-rotation",type:u.textRotation,triggersBounds:l.any},{name:"text-margin-x",type:u.bidirectionalSize,triggersBounds:l.any},{name:"text-margin-y",type:u.bidirectionalSize,triggersBounds:l.any}],d=[{name:"source-label",type:u.text,triggersBounds:l.any},{name:"source-text-rotation",type:u.textRotation,triggersBounds:l.any},{name:"source-text-margin-x",type:u.bidirectionalSize,triggersBounds:l.any},{name:"source-text-margin-y",type:u.bidirectionalSize,triggersBounds:l.any},{name:"source-text-offset",type:u.size,triggersBounds:l.any}],f=[{name:"target-label",type:u.text,triggersBounds:l.any},{name:"target-text-rotation",type:u.textRotation,triggersBounds:l.any},{name:"target-text-margin-x",type:u.bidirectionalSize,triggersBounds:l.any},{name:"target-text-margin-y",type:u.bidirectionalSize,triggersBounds:l.any},{name:"target-text-offset",type:u.size,triggersBounds:l.any}],h=[{name:"font-family",type:u.fontFamily,triggersBounds:l.any},{name:"font-style",type:u.fontStyle,triggersBounds:l.any},{name:"font-weight",type:u.fontWeight,triggersBounds:l.any},{name:"font-size",type:u.size,triggersBounds:l.any},{name:"text-transform",type:u.textTransform,triggersBounds:l.any},{name:"text-wrap",type:u.textWrap,triggersBounds:l.any},{name:"text-overflow-wrap",type:u.textOverflowWrap,triggersBounds:l.any},{name:"text-max-width",type:u.size,triggersBounds:l.any},{name:"text-outline-width",type:u.size,triggersBounds:l.any},{name:"line-height",type:u.positiveNumber,triggersBounds:l.any}],v=[{name:"text-valign",type:u.valign,triggersBounds:l.any},{name:"text-halign",type:u.halign,triggersBounds:l.any},{name:"color",type:u.color},{name:"text-outline-color",type:u.color},{name:"text-outline-opacity",type:u.zeroOneNumber},{name:"text-background-color",type:u.color},{name:"text-background-opacity",type:u.zeroOneNumber},{name:"text-background-padding",type:u.size,triggersBounds:l.any},{name:"text-border-opacity",type:u.zeroOneNumber},{name:"text-border-color",type:u.color},{name:"text-border-width",type:u.size,triggersBounds:l.any},{name:"text-border-style",type:u.borderStyle,triggersBounds:l.any},{name:"text-background-shape",type:u.textBackgroundShape,triggersBounds:l.any},{name:"text-justification",type:u.justification},{name:"box-select-labels",type:u.bool,triggersBounds:l.any}],x=[{name:"events",type:u.bool,triggersZOrder:l.any},{name:"text-events",type:u.bool,triggersZOrder:l.any},{name:"box-selection",type:u.boxSelection,triggersZOrder:l.any}],b=[{name:"display",type:u.display,triggersZOrder:l.any,triggersBounds:l.any,triggersBoundsOfConnectedEdges:l.any,triggersBoundsOfParallelEdges:function(H,Y,ee){return H===Y?!1:ee.pstyle("curve-style").value==="bezier"}},{name:"visibility",type:u.visibility,triggersZOrder:l.any},{name:"opacity",type:u.zeroOneNumber,triggersZOrder:l.zeroNonZero},{name:"text-opacity",type:u.zeroOneNumber},{name:"min-zoomed-font-size",type:u.size},{name:"z-compound-depth",type:u.zCompoundDepth,triggersZOrder:l.any},{name:"z-index-compare",type:u.zIndexCompare,triggersZOrder:l.any},{name:"z-index",type:u.number,triggersZOrder:l.any}],m=[{name:"overlay-padding",type:u.size,triggersBounds:l.any},{name:"overlay-color",type:u.color},{name:"overlay-opacity",type:u.zeroOneNumber,triggersBounds:l.zeroNonZero},{name:"overlay-shape",type:u.overlayShape,triggersBounds:l.any},{name:"overlay-corner-radius",type:u.cornerRadius}],p=[{name:"underlay-padding",type:u.size,triggersBounds:l.any},{name:"underlay-color",type:u.color},{name:"underlay-opacity",type:u.zeroOneNumber,triggersBounds:l.zeroNonZero},{name:"underlay-shape",type:u.overlayShape,triggersBounds:l.any},{name:"underlay-corner-radius",type:u.cornerRadius}],y=[{name:"transition-property",type:u.propList},{name:"transition-duration",type:u.time},{name:"transition-delay",type:u.time},{name:"transition-timing-function",type:u.easing}],w=function(H,Y){return Y.value==="label"?-H.poolIndex():Y.pfValue},E=[{name:"height",type:u.nodeSize,triggersBounds:l.any,hashOverride:w},{name:"width",type:u.nodeSize,triggersBounds:l.any,hashOverride:w},{name:"shape",type:u.nodeShape,triggersBounds:l.any},{name:"shape-polygon-points",type:u.polygonPointList,triggersBounds:l.any},{name:"corner-radius",type:u.cornerRadius},{name:"background-color",type:u.color},{name:"background-fill",type:u.fill},{name:"background-opacity",type:u.zeroOneNumber},{name:"background-blacken",type:u.nOneOneNumber},{name:"background-gradient-stop-colors",type:u.colors},{name:"background-gradient-stop-positions",type:u.percentages},{name:"background-gradient-direction",type:u.gradientDirection},{name:"padding",type:u.sizeMaybePercent,triggersBounds:l.any},{name:"padding-relative-to",type:u.paddingRelativeTo,triggersBounds:l.any},{name:"bounds-expansion",type:u.boundsExpansion,triggersBounds:l.any}],S=[{name:"border-color",type:u.color},{name:"border-opacity",type:u.zeroOneNumber},{name:"border-width",type:u.size,triggersBounds:l.any},{name:"border-style",type:u.borderStyle},{name:"border-cap",type:u.lineCap},{name:"border-join",type:u.lineJoin},{name:"border-dash-pattern",type:u.numbers},{name:"border-dash-offset",type:u.number},{name:"border-position",type:u.linePosition}],C=[{name:"outline-color",type:u.color},{name:"outline-opacity",type:u.zeroOneNumber},{name:"outline-width",type:u.size,triggersBounds:l.any},{name:"outline-style",type:u.borderStyle},{name:"outline-offset",type:u.size,triggersBounds:l.any}],k=[{name:"background-image",type:u.urls},{name:"background-image-crossorigin",type:u.bgCrossOrigin},{name:"background-image-opacity",type:u.zeroOneNumbers},{name:"background-image-containment",type:u.bgContainment},{name:"background-image-smoothing",type:u.bools},{name:"background-position-x",type:u.bgPos},{name:"background-position-y",type:u.bgPos},{name:"background-width-relative-to",type:u.bgRelativeTo},{name:"background-height-relative-to",type:u.bgRelativeTo},{name:"background-repeat",type:u.bgRepeat},{name:"background-fit",type:u.bgFit},{name:"background-clip",type:u.bgClip},{name:"background-width",type:u.bgWH},{name:"background-height",type:u.bgWH},{name:"background-offset-x",type:u.bgPos},{name:"background-offset-y",type:u.bgPos}],T=[{name:"position",type:u.position,triggersBounds:l.any},{name:"compound-sizing-wrt-labels",type:u.compoundIncludeLabels,triggersBounds:l.any},{name:"min-width",type:u.size,triggersBounds:l.any},{name:"min-width-bias-left",type:u.sizeMaybePercent,triggersBounds:l.any},{name:"min-width-bias-right",type:u.sizeMaybePercent,triggersBounds:l.any},{name:"min-height",type:u.size,triggersBounds:l.any},{name:"min-height-bias-top",type:u.sizeMaybePercent,triggersBounds:l.any},{name:"min-height-bias-bottom",type:u.sizeMaybePercent,triggersBounds:l.any}],_=[{name:"line-style",type:u.lineStyle},{name:"line-color",type:u.color},{name:"line-fill",type:u.fill},{name:"line-cap",type:u.lineCap},{name:"line-opacity",type:u.zeroOneNumber},{name:"line-dash-pattern",type:u.numbers},{name:"line-dash-offset",type:u.number},{name:"line-outline-width",type:u.size},{name:"line-outline-color",type:u.color},{name:"line-gradient-stop-colors",type:u.colors},{name:"line-gradient-stop-positions",type:u.percentages},{name:"curve-style",type:u.curveStyle,triggersBounds:l.any,triggersBoundsOfParallelEdges:function(H,Y){return H===Y?!1:H==="bezier"||Y==="bezier"}},{name:"haystack-radius",type:u.zeroOneNumber,triggersBounds:l.any},{name:"source-endpoint",type:u.edgeEndpoint,triggersBounds:l.any},{name:"target-endpoint",type:u.edgeEndpoint,triggersBounds:l.any},{name:"control-point-step-size",type:u.size,triggersBounds:l.any},{name:"control-point-distances",type:u.bidirectionalSizes,triggersBounds:l.any},{name:"control-point-weights",type:u.numbers,triggersBounds:l.any},{name:"segment-distances",type:u.bidirectionalSizes,triggersBounds:l.any},{name:"segment-weights",type:u.numbers,triggersBounds:l.any},{name:"segment-radii",type:u.numbers,triggersBounds:l.any},{name:"radius-type",type:u.radiusType,triggersBounds:l.any},{name:"taxi-turn",type:u.bidirectionalSizeMaybePercent,triggersBounds:l.any},{name:"taxi-turn-min-distance",type:u.size,triggersBounds:l.any},{name:"taxi-direction",type:u.axisDirection,triggersBounds:l.any},{name:"taxi-radius",type:u.number,triggersBounds:l.any},{name:"edge-distances",type:u.edgeDistances,triggersBounds:l.any},{name:"arrow-scale",type:u.positiveNumber,triggersBounds:l.any},{name:"loop-direction",type:u.angle,triggersBounds:l.any},{name:"loop-sweep",type:u.angle,triggersBounds:l.any},{name:"source-distance-from-node",type:u.size,triggersBounds:l.any},{name:"target-distance-from-node",type:u.size,triggersBounds:l.any}],N=[{name:"ghost",type:u.bool,triggersBounds:l.any},{name:"ghost-offset-x",type:u.bidirectionalSize,triggersBounds:l.any},{name:"ghost-offset-y",type:u.bidirectionalSize,triggersBounds:l.any},{name:"ghost-opacity",type:u.zeroOneNumber}],P=[{name:"selection-box-color",type:u.color},{name:"selection-box-opacity",type:u.zeroOneNumber},{name:"selection-box-border-color",type:u.color},{name:"selection-box-border-width",type:u.size},{name:"active-bg-color",type:u.color},{name:"active-bg-opacity",type:u.zeroOneNumber},{name:"active-bg-size",type:u.size},{name:"outside-texture-bg-color",type:u.color},{name:"outside-texture-bg-opacity",type:u.zeroOneNumber}],R=[];Ct.pieBackgroundN=16,R.push({name:"pie-size",type:u.sizeMaybePercent}),R.push({name:"pie-hole",type:u.sizeMaybePercent}),R.push({name:"pie-start-angle",type:u.angle});for(var I=1;I<=Ct.pieBackgroundN;I++)R.push({name:"pie-"+I+"-background-color",type:u.color}),R.push({name:"pie-"+I+"-background-size",type:u.percent}),R.push({name:"pie-"+I+"-background-opacity",type:u.zeroOneNumber});var M=[];Ct.stripeBackgroundN=16,M.push({name:"stripe-size",type:u.sizeMaybePercent}),M.push({name:"stripe-direction",type:u.axisDirectionPrimary});for(var D=1;D<=Ct.stripeBackgroundN;D++)M.push({name:"stripe-"+D+"-background-color",type:u.color}),M.push({name:"stripe-"+D+"-background-size",type:u.percent}),M.push({name:"stripe-"+D+"-background-opacity",type:u.zeroOneNumber});var L=[],j=Ct.arrowPrefixes=["source","mid-source","target","mid-target"];[{name:"arrow-shape",type:u.arrowShape,triggersBounds:l.any},{name:"arrow-color",type:u.color},{name:"arrow-fill",type:u.arrowFill},{name:"arrow-width",type:u.arrowWidth}].forEach(function(U){j.forEach(function(H){var Y=H+"-"+U.name,ee=U.type,ie=U.triggersBounds;L.push({name:Y,type:ee,triggersBounds:ie})})},{});var F=Ct.properties=[].concat(x,y,b,m,p,N,v,h,c,d,f,E,S,C,k,R,M,T,_,L,P),O=Ct.propertyGroups={behavior:x,transition:y,visibility:b,overlay:m,underlay:p,ghost:N,commonLabel:v,labelDimensions:h,mainLabel:c,sourceLabel:d,targetLabel:f,nodeBody:E,nodeBorder:S,nodeOutline:C,backgroundImage:k,pie:R,stripe:M,compound:T,edgeLine:_,edgeArrow:L,core:P},B=Ct.propertyGroupNames={},V=Ct.propertyGroupKeys=Object.keys(O);V.forEach(function(U){B[U]=O[U].map(function(H){return H.name}),O[U].forEach(function(H){return H.groupKey=U})});var J=Ct.aliases=[{name:"content",pointsTo:"label"},{name:"control-point-distance",pointsTo:"control-point-distances"},{name:"control-point-weight",pointsTo:"control-point-weights"},{name:"segment-distance",pointsTo:"segment-distances"},{name:"segment-weight",pointsTo:"segment-weights"},{name:"segment-radius",pointsTo:"segment-radii"},{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"}];Ct.propertyNames=F.map(function(U){return U.name});for(var q=0;q<F.length;q++){var $=F[q];F[$.name]=$}for(var z=0;z<J.length;z++){var W=J[z],ne=F[W.pointsTo],X={name:W.name,alias:!0,pointsTo:ne};F.push(X),F[W.name]=X}})();Ct.getDefaultProperty=function(t){return this.getDefaultProperties()[t]};Ct.getDefaultProperties=function(){var t=this._private;if(t.defaultProperties!=null)return t.defaultProperties;for(var e=Te({"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","box-selection":"contain","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","overlay-corner-radius":"auto","underlay-opacity":0,"underlay-color":"#000","underlay-padding":10,"underlay-shape":"round-rectangle","underlay-corner-radius":"auto","transition-property":"none","transition-duration":0,"transition-delay":0,"transition-timing-function":"linear","box-select-labels":"no","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","border-dash-pattern":[4,2],"border-dash-offset":0,"border-cap":"butt","border-join":"miter","border-position":"center","outline-color":"#999","outline-opacity":1,"outline-width":0,"outline-offset":0,"outline-style":"solid",height:30,width:30,shape:"ellipse","shape-polygon-points":"-1, -1, 1, -1, 1, 1, -1, 1","corner-radius":"auto","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%","pie-hole":0,"pie-start-angle":"0deg"},[{name:"pie-{{i}}-background-color",value:"black"},{name:"pie-{{i}}-background-size",value:"0%"},{name:"pie-{{i}}-background-opacity",value:1}].reduce(function(l,u){for(var c=1;c<=Ct.pieBackgroundN;c++){var d=u.name.replace("{{i}}",c),f=u.value;l[d]=f}return l},{}),{"stripe-size":"100%","stripe-direction":"horizontal"},[{name:"stripe-{{i}}-background-color",value:"black"},{name:"stripe-{{i}}-background-size",value:"0%"},{name:"stripe-{{i}}-background-opacity",value:1}].reduce(function(l,u){for(var c=1;c<=Ct.stripeBackgroundN;c++){var d=u.name.replace("{{i}}",c),f=u.value;l[d]=f}return l},{}),{"line-style":"solid","line-color":"#999","line-fill":"solid","line-cap":"butt","line-opacity":1,"line-outline-width":0,"line-outline-color":"#000","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,"segment-radii":15,"radius-type":"arc-radius","taxi-turn":"50%","taxi-radius":15,"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"},{name:"arrow-width",value:1}].reduce(function(l,u){return Ct.arrowPrefixes.forEach(function(c){var d=c+"-"+u.name,f=u.value;l[d]=f}),l},{})),r={},n=0;n<this.properties.length;n++){var a=this.properties[n];if(!a.pointsTo){var i=a.name,s=e[i],o=this.parse(i,s);r[i]=o}}return t.defaultProperties=r,t.defaultProperties};Ct.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 $c={};$c.parse=function(t,e,r,n){var a=this;if(gt(e))return a.parseImplWarn(t,e,r,n);var i=n==="mapping"||n===!0||n===!1||n==null?"dontcare":n,s=r?"t":"f",o=""+e,l=WP(t,o,s,i),u=a.propCache=a.propCache||[],c;return(c=u[l])||(c=u[l]=a.parseImplWarn(t,e,r,n)),(r||n==="mapping")&&(c=hn(c),c&&(c.value=hn(c.value))),c};$c.parseImplWarn=function(t,e,r,n){var a=this.parseImpl(t,e,r,n);return!a&&e!=null&&Ye("The style property `".concat(t,": ").concat(e,"` is invalid")),a&&(a.name==="width"||a.name==="height")&&e==="label"&&Ye("The style value of `label` is deprecated for `"+a.name+"`"),a};$c.parseImpl=function(t,e,r,n){var a=this;t=Qx(t);var i=a.properties[t],s=e,o=a.types;if(!i||e===void 0)return null;i.alias&&(i=i.pointsTo,t=i.name);var l=Ee(e);l&&(e=e.trim());var u=i.type;if(!u)return null;if(r&&(e===""||e===null))return{name:t,value:e,bypass:!0,deleteBypass:!0};if(gt(e))return{name:t,value:e,strValue:"fn",mapped:o.fn,bypass:r};var c,d;if(!(!l||n||e.length<7||e[1]!=="a")){if(e.length>=7&&e[0]==="d"&&(c=new RegExp(o.data.regex).exec(e))){if(r)return!1;var f=o.data;return{name:t,value:c,strValue:""+e,mapped:f,field:c[1],bypass:r}}else if(e.length>=10&&e[0]==="m"&&(d=new RegExp(o.mapData.regex).exec(e))){if(r||u.multiple)return!1;var h=o.mapData;if(!(u.color||u.number))return!1;var v=this.parse(t,d[4]);if(!v||v.mapped)return!1;var x=this.parse(t,d[5]);if(!x||x.mapped)return!1;if(v.pfValue===x.pfValue||v.strValue===x.strValue)return Ye("`"+t+": "+e+"` is not a valid mapper because the output range is zero; converting to `"+t+": "+v.strValue+"`"),this.parse(t,v.strValue);if(u.color){var b=v.value,m=x.value,p=b[0]===m[0]&&b[1]===m[1]&&b[2]===m[2]&&(b[3]===m[3]||(b[3]==null||b[3]===1)&&(m[3]==null||m[3]===1));if(p)return!1}return{name:t,value:d,strValue:""+e,mapped:h,field:d[1],fieldMin:parseFloat(d[2]),fieldMax:parseFloat(d[3]),valueMin:v.value,valueMax:x.value,bypass:r}}}if(u.multiple&&n!=="multiple"){var y;if(l?y=e.split(/\s+/):Je(e)?y=e:y=[e],u.evenMultiple&&y.length%2!==0)return null;for(var w=[],E=[],S=[],C="",k=!1,T=0;T<y.length;T++){var _=a.parse(t,y[T],r,"multiple");k=k||Ee(_.value),w.push(_.value),S.push(_.pfValue!=null?_.pfValue:_.value),E.push(_.units),C+=(T>0?" ":"")+_.strValue}return u.validate&&!u.validate(w,E)?null:u.singleEnum&&k?w.length===1&&Ee(w[0])?{name:t,value:w[0],strValue:w[0],bypass:r}:null:{name:t,value:w,pfValue:S,strValue:C,bypass:r,units:E}}var N=function(){for(var X=0;X<u.enums.length;X++){var U=u.enums[X];if(U===e)return{name:t,value:e,strValue:""+e,bypass:r}}return null};if(u.number){var P,R="px";if(u.units&&(P=u.units),u.implicitUnits&&(R=u.implicitUnits),!u.unitless)if(l){var I="px|em"+(u.allowPercent?"|\\%":"");P&&(I=P);var M=e.match("^("+jt+")("+I+")?$");M&&(e=M[1],P=M[2]||R)}else(!P||u.implicitUnits)&&(P=R);if(e=parseFloat(e),isNaN(e)&&u.enums===void 0)return null;if(isNaN(e)&&u.enums!==void 0)return e=s,N();if(u.integer&&!NB(e)||u.min!==void 0&&(e<u.min||u.strictMin&&e===u.min)||u.max!==void 0&&(e>u.max||u.strictMax&&e===u.max))return null;var D={name:t,value:e,strValue:""+e+(P||""),units:P,bypass:r};return u.unitless||P!=="px"&&P!=="em"?D.pfValue=e:D.pfValue=P==="px"||!P?e:this.getEmSizeInPixels()*e,(P==="ms"||P==="s")&&(D.pfValue=P==="ms"?e:1e3*e),(P==="deg"||P==="rad")&&(D.pfValue=P==="rad"?e:OO(e)),P==="%"&&(D.pfValue=e/100),D}else if(u.propList){var L=[],j=""+e;if(j!=="none"){for(var F=j.split(/\s*,\s*|\s+/),O=0;O<F.length;O++){var B=F[O].trim();a.properties[B]?L.push(B):Ye("`"+B+"` is not a valid property name")}if(L.length===0)return null}return{name:t,value:L,strValue:L.length===0?"none":L.join(" "),bypass:r}}else if(u.color){var V=FP(e);return V?{name:t,value:V,pfValue:V,strValue:"rgb("+V[0]+","+V[1]+","+V[2]+")",bypass:r}:null}else if(u.regex||u.regexes){if(u.enums){var J=N();if(J)return J}for(var q=u.regexes?u.regexes:[u.regex],$=0;$<q.length;$++){var z=new RegExp(q[$]),W=z.exec(e);if(W)return{name:t,value:u.singleRegexMatchValue?W[1]:W,strValue:""+e,bypass:r}}return null}else return u.string?{name:t,value:""+e,strValue:""+e,bypass:r}:u.enums?N():null};var Ft=function(e){if(!(this instanceof Ft))return new Ft(e);if(!Zx(e)){ct("A style must have a core reference");return}this._private={cy:e,coreStyle:{}},this.length=0,this.resetToDefault()},rr=Ft.prototype;rr.instanceString=function(){return"style"};rr.clear=function(){for(var t=this._private,e=t.cy,r=e.elements(),n=0;n<this.length;n++)this[n]=void 0;return this.length=0,t.contextStyles={},t.propDiffs={},this.cleanElements(r,!0),r.forEach(function(a){var i=a[0]._private;i.styleDirty=!0,i.appliedInitStyle=!1}),this};rr.resetToDefault=function(){return this.clear(),this.addDefaultStylesheet(),this};rr.core=function(t){return this._private.coreStyle[t]||this.getDefaultProperty(t)};rr.selector=function(t){var e=t==="core"?null:new wa(t),r=this.length++;return this[r]={selector:e,properties:[],mappedProperties:[],index:r},this};rr.css=function(){var t=this,e=arguments;if(e.length===1)for(var r=e[0],n=0;n<t.properties.length;n++){var a=t.properties[n],i=r[a.name];i===void 0&&(i=r[_c(a.name)]),i!==void 0&&this.cssRule(a.name,i)}else e.length===2&&this.cssRule(e[0],e[1]);return this};rr.style=rr.css;rr.cssRule=function(t,e){var r=this.parse(t,e);if(r){var n=this.length-1;this[n].properties.push(r),this[n].properties[r.name]=r,r.name.match(/pie-(\d+)-background-size/)&&r.value&&(this._private.hasPie=!0),r.name.match(/stripe-(\d+)-background-size/)&&r.value&&(this._private.hasStripe=!0),r.mapped&&this[n].mappedProperties.push(r);var a=!this[n].selector;a&&(this._private.coreStyle[r.name]=r)}return this};rr.append=function(t){return BP(t)?t.appendToStyle(this):Je(t)?this.appendFromJson(t):Ee(t)&&this.appendFromString(t),this};Ft.fromJson=function(t,e){var r=new Ft(t);return r.fromJson(e),r};Ft.fromString=function(t,e){return new Ft(t).fromString(e)};[$t,il,v1,yn,Fc,h1,Ct,$c].forEach(function(t){Te(rr,t)});Ft.types=rr.types;Ft.properties=rr.properties;Ft.propertyGroups=rr.propertyGroups;Ft.propertyGroupNames=rr.propertyGroupNames;Ft.propertyGroupKeys=rr.propertyGroupKeys;var zF={style:function(e){if(e){var r=this.setStyle(e);r.update()}return this._private.style},setStyle:function(e){var r=this._private;return BP(e)?r.style=e.generateStyle(this):Je(e)?r.style=Ft.fromJson(this,e):Ee(e)?r.style=Ft.fromString(this,e):r.style=Ft(this),r.style},updateStyle:function(){this.mutableElements().updateStyle()}},VF="single",si={autolock:function(e){if(e!==void 0)this._private.autolock=!!e;else return this._private.autolock;return this},autoungrabify:function(e){if(e!==void 0)this._private.autoungrabify=!!e;else return this._private.autoungrabify;return this},autounselectify:function(e){if(e!==void 0)this._private.autounselectify=!!e;else return this._private.autounselectify;return this},selectionType:function(e){var r=this._private;if(r.selectionType==null&&(r.selectionType=VF),e!==void 0)(e==="additive"||e==="single")&&(r.selectionType=e);else return r.selectionType;return this},panningEnabled:function(e){if(e!==void 0)this._private.panningEnabled=!!e;else return this._private.panningEnabled;return this},userPanningEnabled:function(e){if(e!==void 0)this._private.userPanningEnabled=!!e;else return this._private.userPanningEnabled;return this},zoomingEnabled:function(e){if(e!==void 0)this._private.zoomingEnabled=!!e;else return this._private.zoomingEnabled;return this},userZoomingEnabled:function(e){if(e!==void 0)this._private.userZoomingEnabled=!!e;else return this._private.userZoomingEnabled;return this},boxSelectionEnabled:function(e){if(e!==void 0)this._private.boxSelectionEnabled=!!e;else return this._private.boxSelectionEnabled;return this},pan:function(){var e=arguments,r=this._private.pan,n,a,i,s,o;switch(e.length){case 0:return r;case 1:if(Ee(e[0]))return n=e[0],r[n];if(Ue(e[0])){if(!this._private.panningEnabled)return this;i=e[0],s=i.x,o=i.y,le(s)&&(r.x=s),le(o)&&(r.y=o),this.emit("pan viewport")}break;case 2:if(!this._private.panningEnabled)return this;n=e[0],a=e[1],(n==="x"||n==="y")&&le(a)&&(r[n]=a),this.emit("pan viewport");break}return this.notify("viewport"),this},panBy:function(e,r){var n=arguments,a=this._private.pan,i,s,o,l,u;if(!this._private.panningEnabled)return this;switch(n.length){case 1:Ue(e)&&(o=n[0],l=o.x,u=o.y,le(l)&&(a.x+=l),le(u)&&(a.y+=u),this.emit("pan viewport"));break;case 2:i=e,s=r,(i==="x"||i==="y")&&le(s)&&(a[i]+=s),this.emit("pan viewport");break}return this.notify("viewport"),this},gc:function(){this.notify("gc")},fit:function(e,r){var n=this.getFitViewport(e,r);if(n){var a=this._private;a.zoom=n.zoom,a.pan=n.pan,this.emit("pan zoom viewport"),this.notify("viewport")}return this},getFitViewport:function(e,r){if(le(e)&&r===void 0&&(r=e,e=void 0),!(!this._private.panningEnabled||!this._private.zoomingEnabled)){var n;if(Ee(e)){var a=e;e=this.$(a)}else if(AB(e)){var i=e;n={x1:i.x1,y1:i.y1,x2:i.x2,y2:i.y2},n.w=n.x2-n.x1,n.h=n.y2-n.y1}else _r(e)||(e=this.mutableElements());if(!(_r(e)&&e.empty())){n=n||e.boundingBox();var s=this.width(),o=this.height(),l;if(r=le(r)?r:0,!isNaN(s)&&!isNaN(o)&&s>0&&o>0&&!isNaN(n.w)&&!isNaN(n.h)&&n.w>0&&n.h>0){l=Math.min((s-2*r)/n.w,(o-2*r)/n.h),l=l>this._private.maxZoom?this._private.maxZoom:l,l=l<this._private.minZoom?this._private.minZoom:l;var u={x:(s-l*(n.x1+n.x2))/2,y:(o-l*(n.y1+n.y2))/2};return{zoom:l,pan:u}}}}},zoomRange:function(e,r){var n=this._private;if(r==null){var a=e;e=a.min,r=a.max}return le(e)&&le(r)&&e<=r?(n.minZoom=e,n.maxZoom=r):le(e)&&r===void 0&&e<=n.maxZoom?n.minZoom=e:le(r)&&e===void 0&&r>=n.minZoom&&(n.maxZoom=r),this},minZoom:function(e){return e===void 0?this._private.minZoom:this.zoomRange({min:e})},maxZoom:function(e){return e===void 0?this._private.maxZoom:this.zoomRange({max:e})},getZoomedViewport:function(e){var r=this._private,n=r.pan,a=r.zoom,i,s,o=!1;if(r.zoomingEnabled||(o=!0),le(e)?s=e:Ue(e)&&(s=e.level,e.position!=null?i=Pc(e.position,a,n):e.renderedPosition!=null&&(i=e.renderedPosition),i!=null&&!r.panningEnabled&&(o=!0)),s=s>r.maxZoom?r.maxZoom:s,s=s<r.minZoom?r.minZoom:s,o||!le(s)||s===a||i!=null&&(!le(i.x)||!le(i.y)))return null;if(i!=null){var l=n,u=a,c=s,d={x:-c/u*(i.x-l.x)+i.x,y:-c/u*(i.y-l.y)+i.y};return{zoomed:!0,panned:!0,zoom:c,pan:d}}else return{zoomed:!0,panned:!1,zoom:s,pan:n}},zoom:function(e){if(e===void 0)return this._private.zoom;var r=this.getZoomedViewport(e),n=this._private;return r==null||!r.zoomed?this:(n.zoom=r.zoom,r.panned&&(n.pan.x=r.pan.x,n.pan.y=r.pan.y),this.emit("zoom"+(r.panned?" pan":"")+" viewport"),this.notify("viewport"),this)},viewport:function(e){var r=this._private,n=!0,a=!0,i=[],s=!1,o=!1;if(!e)return this;if(le(e.zoom)||(n=!1),Ue(e.pan)||(a=!1),!n&&!a)return this;if(n){var l=e.zoom;l<r.minZoom||l>r.maxZoom||!r.zoomingEnabled?s=!0:(r.zoom=l,i.push("zoom"))}if(a&&(!s||!e.cancelOnFailedZoom)&&r.panningEnabled){var u=e.pan;le(u.x)&&(r.pan.x=u.x,o=!1),le(u.y)&&(r.pan.y=u.y,o=!1),o||i.push("pan")}return i.length>0&&(i.push("viewport"),this.emit(i.join(" ")),this.notify("viewport")),this},center:function(e){var r=this.getCenterPan(e);return r&&(this._private.pan=r,this.emit("pan viewport"),this.notify("viewport")),this},getCenterPan:function(e,r){if(this._private.panningEnabled){if(Ee(e)){var n=e;e=this.mutableElements().filter(n)}else _r(e)||(e=this.mutableElements());if(e.length!==0){var a=e.boundingBox(),i=this.width(),s=this.height();r=r===void 0?this._private.zoom:r;var o={x:(i-r*(a.x1+a.x2))/2,y:(s-r*(a.y1+a.y2))/2};return o}}},reset:function(){return!this._private.panningEnabled||!this._private.zoomingEnabled?this:(this.viewport({pan:{x:0,y:0},zoom:1}),this)},invalidateSize:function(){this._private.sizeCache=null},size:function(){var e=this._private,r=e.container,n=this;return e.sizeCache=e.sizeCache||(r?function(){var a=n.window().getComputedStyle(r),i=function(o){return parseFloat(a.getPropertyValue(o))};return{width:r.clientWidth-i("padding-left")-i("padding-right"),height:r.clientHeight-i("padding-top")-i("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,r=this._private.zoom,n=this.renderedExtent(),a={x1:(n.x1-e.x)/r,x2:(n.x2-e.x)/r,y1:(n.y1-e.y)/r,y2:(n.y2-e.y)/r};return a.w=a.x2-a.x1,a.h=a.y2-a.y1,a},renderedExtent:function(){var e=this.width(),r=this.height();return{x1:0,y1:0,x2:e,y2:r,w:e,h:r}},multiClickDebounceTime:function(e){if(e)this._private.multiClickDebounceTime=e;else return this._private.multiClickDebounceTime;return this}};si.centre=si.center;si.autolockNodes=si.autolock;si.autoungrabifyNodes=si.autoungrabify;var $o={data:Ke.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:Ke.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:Ke.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:Ke.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};$o.attr=$o.data;$o.removeAttr=$o.removeData;var zo=function(e){var r=this;e=Te({},e);var n=e.container;n&&!Yu(n)&&Yu(n[0])&&(n=n[0]);var a=n?n._cyreg:null;a=a||{},a&&a.cy&&(a.cy.destroy(),a={});var i=a.readies=a.readies||[];n&&(n._cyreg=a),a.cy=r;var s=Rt!==void 0&&n!==void 0&&!e.headless,o=e;o.layout=Te({name:s?"grid":"null"},o.layout),o.renderer=Te({name:s?"canvas":"null"},o.renderer);var l=function(v,x,b){return x!==void 0?x:b!==void 0?b:v},u=this._private={container:n,ready:!1,options:o,elements:new Ht(this),listeners:[],aniEles:new Ht(this),data:o.data||{},scratch:{},layout:null,renderer:null,destroyed:!1,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:l(!0,o.zoomingEnabled),userZoomingEnabled:l(!0,o.userZoomingEnabled),panningEnabled:l(!0,o.panningEnabled),userPanningEnabled:l(!0,o.userPanningEnabled),boxSelectionEnabled:l(!0,o.boxSelectionEnabled),autolock:l(!1,o.autolock,o.autolockNodes),autoungrabify:l(!1,o.autoungrabify,o.autoungrabifyNodes),autounselectify:l(!1,o.autounselectify),styleEnabled:o.styleEnabled===void 0?s:o.styleEnabled,zoom:le(o.zoom)?o.zoom:1,pan:{x:Ue(o.pan)&&le(o.pan.x)?o.pan.x:0,y:Ue(o.pan)&&le(o.pan.y)?o.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1,multiClickDebounceTime:l(250,o.multiClickDebounceTime)};this.createEmitter(),this.selectionType(o.selectionType),this.zoomRange({min:o.minZoom,max:o.maxZoom});var c=function(v,x){var b=v.some(jB);if(b)return hs.all(v).then(x);x(v)};u.styleEnabled&&r.setStyle([]);var d=Te({},o,o.renderer);r.initRenderer(d);var f=function(v,x,b){r.notifications(!1);var m=r.mutableElements();m.length>0&&m.remove(),v!=null&&(Ue(v)||Je(v))&&r.add(v),r.one("layoutready",function(y){r.notifications(!0),r.emit(y),r.one("load",x),r.emitAndNotify("load")}).one("layoutstop",function(){r.one("done",b),r.emit("done")});var p=Te({},r._private.options.layout);p.eles=r.elements(),r.layout(p).run()};c([o.style,o.elements],function(h){var v=h[0],x=h[1];u.styleEnabled&&r.style().append(v),f(x,function(){r.startAnimationLoop(),u.ready=!0,gt(o.ready)&&r.on("ready",o.ready);for(var b=0;b<i.length;b++){var m=i[b];r.on("ready",m)}a&&(a.readies=[]),r.emit("ready")},o.done)})},rc=zo.prototype;Te(rc,{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},window:function(){var e=this._private.container;if(e==null)return Rt;var r=this._private.container.ownerDocument;return r===void 0||r==null?Rt:r.defaultView||Rt},mount:function(e){if(e!=null){var r=this,n=r._private,a=n.options;return!Yu(e)&&Yu(e[0])&&(e=e[0]),r.stopAnimationLoop(),r.destroyRenderer(),n.container=e,n.styleEnabled=!0,r.invalidateSize(),r.initRenderer(Te({},a,a.renderer,{name:a.renderer.name==="null"?"canvas":a.renderer.name})),r.startAnimationLoop(),r.style(a.style),r.emit("mount"),r}},unmount:function(){var e=this;return e.stopAnimationLoop(),e.destroyRenderer(),e.initRenderer({name:"null"}),e.emit("unmount"),e},options:function(){return hn(this._private.options)},json:function(e){var r=this,n=r._private,a=r.mutableElements(),i=function(w){return r.getElementById(w.id())};if(Ue(e)){if(r.startBatch(),e.elements){var s={},o=function(w,E){for(var S=[],C=[],k=0;k<w.length;k++){var T=w[k];if(!T.data.id){Ye("cy.json() cannot handle elements without an ID attribute");continue}var _=""+T.data.id,N=r.getElementById(_);s[_]=!0,N.length!==0?C.push({ele:N,json:T}):(E&&(T.group=E),S.push(T))}r.add(S);for(var P=0;P<C.length;P++){var R=C[P],I=R.ele,M=R.json;I.json(M)}};if(Je(e.elements))o(e.elements);else for(var l=["nodes","edges"],u=0;u<l.length;u++){var c=l[u],d=e.elements[c];Je(d)&&o(d,c)}var f=r.collection();a.filter(function(y){return!s[y.id()]}).forEach(function(y){y.isParent()?f.merge(y):y.remove()}),f.forEach(function(y){return y.children().move({parent:null})}),f.forEach(function(y){return i(y).remove()})}e.style&&r.style(e.style),e.zoom!=null&&e.zoom!==n.zoom&&r.zoom(e.zoom),e.pan&&(e.pan.x!==n.pan.x||e.pan.y!==n.pan.y)&&r.pan(e.pan),e.data&&r.data(e.data);for(var h=["minZoom","maxZoom","zoomingEnabled","userZoomingEnabled","panningEnabled","userPanningEnabled","boxSelectionEnabled","autolock","autoungrabify","autounselectify","multiClickDebounceTime"],v=0;v<h.length;v++){var x=h[v];e[x]!=null&&r[x](e[x])}return r.endBatch(),this}else{var b=!!e,m={};b?m.elements=this.elements().map(function(y){return y.json()}):(m.elements={},a.forEach(function(y){var w=y.group();m.elements[w]||(m.elements[w]=[]),m.elements[w].push(y.json())})),this._private.styleEnabled&&(m.style=r.style().json()),m.data=hn(r.data());var p=n.options;return m.zoomingEnabled=n.zoomingEnabled,m.userZoomingEnabled=n.userZoomingEnabled,m.zoom=n.zoom,m.minZoom=n.minZoom,m.maxZoom=n.maxZoom,m.panningEnabled=n.panningEnabled,m.userPanningEnabled=n.userPanningEnabled,m.pan=hn(n.pan),m.boxSelectionEnabled=n.boxSelectionEnabled,m.renderer=hn(p.renderer),m.hideEdgesOnViewport=p.hideEdgesOnViewport,m.textureOnViewport=p.textureOnViewport,m.wheelSensitivity=p.wheelSensitivity,m.motionBlur=p.motionBlur,m.multiClickDebounceTime=p.multiClickDebounceTime,m}}});rc.$id=rc.getElementById;[jF,BF,BA,O0,gu,qF,q0,mu,zF,si,$o].forEach(function(t){Te(rc,t)});var UF={fit:!0,directed:!1,direction:"downward",padding:30,circle:!1,grid:!1,spacingFactor:1.75,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,roots:void 0,depthSort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}},GF={maximal:!1,acyclic:!1},bi=function(e){return e.scratch("breadthfirst")},sE=function(e,r){return e.scratch("breadthfirst",r)};function OA(t){this.options=Te({},UF,GF,t)}OA.prototype.run=function(){var t=this.options,e=t.cy,r=t.eles,n=r.nodes().filter(function(be){return be.isChildless()}),a=r,i=t.directed,s=t.acyclic||t.maximal||t.maximalAdjustments>0,o=!!t.boundingBox,l=lr(o?t.boundingBox:structuredClone(e.extent())),u;if(_r(t.roots))u=t.roots;else if(Je(t.roots)){for(var c=[],d=0;d<t.roots.length;d++){var f=t.roots[d],h=e.getElementById(f);c.push(h)}u=e.collection(c)}else if(Ee(t.roots))u=e.$(t.roots);else if(i)u=n.roots();else{var v=r.components();u=e.collection();for(var x=function(){var de=v[b],xe=de.maxDegree(!1),fe=de.filter(function(we){return we.degree(!1)===xe});u=u.add(fe)},b=0;b<v.length;b++)x()}var m=[],p={},y=function(de,xe){m[xe]==null&&(m[xe]=[]);var fe=m[xe].length;m[xe].push(de),sE(de,{index:fe,depth:xe})},w=function(de,xe){var fe=bi(de),we=fe.depth,Ce=fe.index;m[we][Ce]=null,de.isChildless()&&y(de,xe)};a.bfs({roots:u,directed:t.directed,visit:function(de,xe,fe,we,Ce){var Ne=de[0],De=Ne.id();Ne.isChildless()&&y(Ne,Ce),p[De]=!0}});for(var E=[],S=0;S<n.length;S++){var C=n[S];p[C.id()]||E.push(C)}var k=function(de){for(var xe=m[de],fe=0;fe<xe.length;fe++){var we=xe[fe];if(we==null){xe.splice(fe,1),fe--;continue}sE(we,{depth:de,index:fe})}},T=function(de,xe){for(var fe=bi(de),we=de.incomers().filter(function(te){return te.isNode()&&r.has(te)}),Ce=-1,Ne=de.id(),De=0;De<we.length;De++){var $e=we[De],je=bi($e);Ce=Math.max(Ce,je.depth)}if(fe.depth<=Ce){if(!t.acyclic&&xe[Ne])return null;var Oe=Ce+1;return w(de,Oe),xe[Ne]=Oe,!0}return!1};if(i&&s){var _=[],N={},P=function(de){return _.push(de)},R=function(){return _.shift()};for(n.forEach(function(be){return _.push(be)});_.length>0;){var I=R(),M=T(I,N);if(M)I.outgoers().filter(function(be){return be.isNode()&&r.has(be)}).forEach(P);else if(M===null){Ye("Detected double maximal shift for node `"+I.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}var D=0;if(t.avoidOverlap)for(var L=0;L<n.length;L++){var j=n[L],F=j.layoutDimensions(t),O=F.w,B=F.h;D=Math.max(D,O,B)}var V={},J=function(de){if(V[de.id()])return V[de.id()];for(var xe=bi(de).depth,fe=de.neighborhood(),we=0,Ce=0,Ne=0;Ne<fe.length;Ne++){var De=fe[Ne];if(!(De.isEdge()||De.isParent()||!n.has(De))){var $e=bi(De);if($e!=null){var je=$e.index,Oe=$e.depth;if(!(je==null||Oe==null)){var te=m[Oe].length;Oe<xe&&(we+=je/te,Ce++)}}}}return Ce=Math.max(1,Ce),we=we/Ce,Ce===0&&(we=0),V[de.id()]=we,we},q=function(de,xe){var fe=J(de),we=J(xe),Ce=fe-we;return Ce===0?qP(de.id(),xe.id()):Ce};t.depthSort!==void 0&&(q=t.depthSort);for(var $=m.length,z=0;z<$;z++)m[z].sort(q),k(z);for(var W=[],ne=0;ne<E.length;ne++)W.push(E[ne]);var X=function(){for(var de=0;de<$;de++)k(de)};W.length&&(m.unshift(W),$=m.length,X());for(var U=0,H=0;H<$;H++)U=Math.max(m[H].length,U);var Y={x:l.x1+l.w/2,y:l.y1+l.h/2},ee=n.reduce(function(be,de){return function(xe){return{w:be.w===-1?xe.w:(be.w+xe.w)/2,h:be.h===-1?xe.h:(be.h+xe.h)/2}}(de.boundingBox({includeLabels:t.nodeDimensionsIncludeLabels}))},{w:-1,h:-1}),ie=Math.max($===1?0:o?(l.h-t.padding*2-ee.h)/($-1):(l.h-t.padding*2-ee.h)/($+1),D),oe=m.reduce(function(be,de){return Math.max(be,de.length)},0),Re=function(de){var xe=bi(de),fe=xe.depth,we=xe.index;if(t.circle){var Ce=Math.min(l.w/2/$,l.h/2/$);Ce=Math.max(Ce,D);var Ne=Ce*fe+Ce-($>0&&m[0].length<=3?Ce/2:0),De=2*Math.PI/m[fe].length*we;return fe===0&&m[0].length===1&&(Ne=1),{x:Y.x+Ne*Math.cos(De),y:Y.y+Ne*Math.sin(De)}}else{var $e=m[fe].length,je=Math.max($e===1?0:o?(l.w-t.padding*2-ee.w)/((t.grid?oe:$e)-1):(l.w-t.padding*2-ee.w)/((t.grid?oe:$e)+1),D),Oe={x:Y.x+(we+1-($e+1)/2)*je,y:Y.y+(fe+1-($+1)/2)*ie};return Oe}},ue={downward:0,leftward:90,upward:180,rightward:-90};Object.keys(ue).indexOf(t.direction)===-1&&ct("Invalid direction '".concat(t.direction,"' specified for breadthfirst layout. Valid values are: ").concat(Object.keys(ue).join(", ")));var Se=function(de){return oO(Re(de),l,ue[t.direction])};return r.nodes().layoutPositions(this,t,Se),this};var HF={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,radius:void 0,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function qA(t){this.options=Te({},HF,t)}qA.prototype.run=function(){var t=this.options,e=t,r=t.cy,n=e.eles,a=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,i=n.nodes().not(":parent");e.sort&&(i=i.sort(e.sort));for(var s=lr(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()}),o={x:s.x1+s.w/2,y:s.y1+s.h/2},l=e.sweep===void 0?2*Math.PI-2*Math.PI/i.length:e.sweep,u=l/Math.max(1,i.length-1),c,d=0,f=0;f<i.length;f++){var h=i[f],v=h.layoutDimensions(e),x=v.w,b=v.h;d=Math.max(d,x,b)}if(le(e.radius)?c=e.radius:i.length<=1?c=0:c=Math.min(s.h,s.w)/2-d,i.length>1&&e.avoidOverlap){d*=1.75;var m=Math.cos(u)-Math.cos(0),p=Math.sin(u)-Math.sin(0),y=Math.sqrt(d*d/(m*m+p*p));c=Math.max(y,c)}var w=function(S,C){var k=e.startAngle+C*u*(a?1:-1),T=c*Math.cos(k),_=c*Math.sin(k),N={x:o.x+T,y:o.y+_};return N};return n.nodes().layoutPositions(this,e,w),this};var WF={fit:!0,padding:30,startAngle:3/2*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,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function FA(t){this.options=Te({},WF,t)}FA.prototype.run=function(){for(var t=this.options,e=t,r=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,n=t.cy,a=e.eles,i=a.nodes().not(":parent"),s=lr(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()}),o={x:s.x1+s.w/2,y:s.y1+s.h/2},l=[],u=0,c=0;c<i.length;c++){var d=i[c],f=void 0;f=e.concentric(d),l.push({value:f,node:d}),d._private.scratch.concentric=f}i.updateStyle();for(var h=0;h<i.length;h++){var v=i[h],x=v.layoutDimensions(e);u=Math.max(u,x.w,x.h)}l.sort(function(ie,oe){return oe.value-ie.value});for(var b=e.levelWidth(i),m=[[]],p=m[0],y=0;y<l.length;y++){var w=l[y];if(p.length>0){var E=Math.abs(p[0].value-w.value);E>=b&&(p=[],m.push(p))}p.push(w)}var S=u+e.minNodeSpacing;if(!e.avoidOverlap){var C=m.length>0&&m[0].length>1,k=Math.min(s.w,s.h)/2-S,T=k/(m.length+C?1:0);S=Math.min(S,T)}for(var _=0,N=0;N<m.length;N++){var P=m[N],R=e.sweep===void 0?2*Math.PI-2*Math.PI/P.length:e.sweep,I=P.dTheta=R/Math.max(1,P.length-1);if(P.length>1&&e.avoidOverlap){var M=Math.cos(I)-Math.cos(0),D=Math.sin(I)-Math.sin(0),L=Math.sqrt(S*S/(M*M+D*D));_=Math.max(L,_)}P.r=_,_+=S}if(e.equidistant){for(var j=0,F=0,O=0;O<m.length;O++){var B=m[O],V=B.r-F;j=Math.max(j,V)}F=0;for(var J=0;J<m.length;J++){var q=m[J];J===0&&(F=q.r),q.r=F,F+=j}}for(var $={},z=0;z<m.length;z++)for(var W=m[z],ne=W.dTheta,X=W.r,U=0;U<W.length;U++){var H=W[U],Y=e.startAngle+(r?1:-1)*ne*U,ee={x:o.x+X*Math.cos(Y),y:o.y+X*Math.sin(Y)};$[H.node.id()]=ee}return a.nodes().layoutPositions(this,e,function(ie){var oe=ie.id();return $[oe]}),this};var ov,KF={ready:function(){},stop:function(){},animate:!0,animationEasing:void 0,animationDuration:void 0,animateFilter:function(e,r){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 zc(t){this.options=Te({},KF,t),this.options.layout=this;var e=this.options.eles.nodes(),r=this.options.eles.edges(),n=r.filter(function(a){var i=a.source().data("id"),s=a.target().data("id"),o=e.some(function(u){return u.data("id")===i}),l=e.some(function(u){return u.data("id")===s});return!o||!l});this.options.eles=this.options.eles.not(n)}zc.prototype.run=function(){var t=this.options,e=t.cy,r=this;r.stopped=!1,(t.animate===!0||t.animate===!1)&&r.emit({type:"layoutstart",layout:r}),t.debug===!0?ov=!0:ov=!1;var n=YF(e,r,t);ov&&ZF(n),t.randomize&&QF(n);var a=Ln(),i=function(){JF(n,e,t),t.fit===!0&&e.fit(t.padding)},s=function(f){return!(r.stopped||f>=t.numIter||(e$(n,t),n.temperature=n.temperature*t.coolingFactor,n.temperature<t.minTemp))},o=function(){if(t.animate===!0||t.animate===!1)i(),r.one("layoutstop",t.stop),r.emit({type:"layoutstop",layout:r});else{var f=t.eles.nodes(),h=zA(n,t,f);f.layoutPositions(r,t,h)}},l=0,u=!0;if(t.animate===!0){var c=function(){for(var f=0;u&&f<t.refresh;)u=s(l),l++,f++;if(!u)lE(n,t),o();else{var h=Ln();h-a>=t.animationThreshold&&i(),Xu(c)}};c()}else{for(;u;)u=s(l),l++;lE(n,t),o()}return this};zc.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this};zc.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var YF=function(e,r,n){for(var a=n.eles.edges(),i=n.eles.nodes(),s=lr(n.boundingBox?n.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),o={isCompound:e.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:i.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:a.size(),temperature:n.initialTemp,clientWidth:s.w,clientHeight:s.h,boundingBox:s},l=n.eles.components(),u={},c=0;c<l.length;c++)for(var d=l[c],f=0;f<d.length;f++){var h=d[f];u[h.id()]=c}for(var c=0;c<o.nodeSize;c++){var v=i[c],x=v.layoutDimensions(n),b={};b.isLocked=v.locked(),b.id=v.data("id"),b.parentId=v.data("parent"),b.cmptId=u[v.id()],b.children=[],b.positionX=v.position("x"),b.positionY=v.position("y"),b.offsetX=0,b.offsetY=0,b.height=x.w,b.width=x.h,b.maxX=b.positionX+b.width/2,b.minX=b.positionX-b.width/2,b.maxY=b.positionY+b.height/2,b.minY=b.positionY-b.height/2,b.padLeft=parseFloat(v.style("padding")),b.padRight=parseFloat(v.style("padding")),b.padTop=parseFloat(v.style("padding")),b.padBottom=parseFloat(v.style("padding")),b.nodeRepulsion=gt(n.nodeRepulsion)?n.nodeRepulsion(v):n.nodeRepulsion,o.layoutNodes.push(b),o.idToIndex[b.id]=c}for(var m=[],p=0,y=-1,w=[],c=0;c<o.nodeSize;c++){var v=o.layoutNodes[c],E=v.parentId;E!=null?o.layoutNodes[o.idToIndex[E]].children.push(v.id):(m[++y]=v.id,w.push(v.id))}for(o.graphSet.push(w);p<=y;){var S=m[p++],C=o.idToIndex[S],h=o.layoutNodes[C],k=h.children;if(k.length>0){o.graphSet.push(k);for(var c=0;c<k.length;c++)m[++y]=k[c]}}for(var c=0;c<o.graphSet.length;c++)for(var T=o.graphSet[c],f=0;f<T.length;f++){var _=o.idToIndex[T[f]];o.indexToGraph[_]=c}for(var c=0;c<o.edgeSize;c++){var N=a[c],P={};P.id=N.data("id"),P.sourceId=N.data("source"),P.targetId=N.data("target");var R=gt(n.idealEdgeLength)?n.idealEdgeLength(N):n.idealEdgeLength,I=gt(n.edgeElasticity)?n.edgeElasticity(N):n.edgeElasticity,M=o.idToIndex[P.sourceId],D=o.idToIndex[P.targetId],L=o.indexToGraph[M],j=o.indexToGraph[D];if(L!=j){for(var F=XF(P.sourceId,P.targetId,o),O=o.graphSet[F],B=0,b=o.layoutNodes[M];O.indexOf(b.id)===-1;)b=o.layoutNodes[o.idToIndex[b.parentId]],B++;for(b=o.layoutNodes[D];O.indexOf(b.id)===-1;)b=o.layoutNodes[o.idToIndex[b.parentId]],B++;R*=B*n.nestingFactor}P.idealLength=R,P.elasticity=I,o.layoutEdges.push(P)}return o},XF=function(e,r,n){var a=$A(e,r,0,n);return 2>a.count?0:a.graph},$A=function(e,r,n,a){var i=a.graphSet[n];if(-1<i.indexOf(e)&&-1<i.indexOf(r))return{count:2,graph:n};for(var s=0,o=0;o<i.length;o++){var l=i[o],u=a.idToIndex[l],c=a.layoutNodes[u].children;if(c.length!==0){var d=a.indexToGraph[a.idToIndex[c[0]]],f=$A(e,r,d,a);if(f.count!==0)if(f.count===1){if(s++,s===2)break}else return f}}return{count:s,graph:n}},ZF,QF=function(e,r){for(var n=e.clientWidth,a=e.clientHeight,i=0;i<e.nodeSize;i++){var s=e.layoutNodes[i];s.children.length===0&&!s.isLocked&&(s.positionX=Math.random()*n,s.positionY=Math.random()*a)}},zA=function(e,r,n){var a=e.boundingBox,i={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0};return r.boundingBox&&(n.forEach(function(s){var o=e.layoutNodes[e.idToIndex[s.data("id")]];i.x1=Math.min(i.x1,o.positionX),i.x2=Math.max(i.x2,o.positionX),i.y1=Math.min(i.y1,o.positionY),i.y2=Math.max(i.y2,o.positionY)}),i.w=i.x2-i.x1,i.h=i.y2-i.y1),function(s,o){var l=e.layoutNodes[e.idToIndex[s.data("id")]];if(r.boundingBox){var u=i.w===0?.5:(l.positionX-i.x1)/i.w,c=i.h===0?.5:(l.positionY-i.y1)/i.h;return{x:a.x1+u*a.w,y:a.y1+c*a.h}}else return{x:l.positionX,y:l.positionY}}},JF=function(e,r,n){var a=n.layout,i=n.eles.nodes(),s=zA(e,n,i);i.positions(s),e.ready!==!0&&(e.ready=!0,a.one("layoutready",n.ready),a.emit({type:"layoutready",layout:this}))},e$=function(e,r,n){t$(e,r),a$(e),i$(e,r),s$(e),o$(e)},t$=function(e,r){for(var n=0;n<e.graphSet.length;n++)for(var a=e.graphSet[n],i=a.length,s=0;s<i;s++)for(var o=e.layoutNodes[e.idToIndex[a[s]]],l=s+1;l<i;l++){var u=e.layoutNodes[e.idToIndex[a[l]]];r$(o,u,e,r)}},oE=function(e){return-1+2*e*Math.random()},r$=function(e,r,n,a){var i=e.cmptId,s=r.cmptId;if(!(i!==s&&!n.isCompound)){var o=r.positionX-e.positionX,l=r.positionY-e.positionY,u=1;o===0&&l===0&&(o=oE(u),l=oE(u));var c=n$(e,r,o,l);if(c>0)var d=a.nodeOverlap*c,f=Math.sqrt(o*o+l*l),h=d*o/f,v=d*l/f;else var x=nc(e,o,l),b=nc(r,-1*o,-1*l),m=b.x-x.x,p=b.y-x.y,y=m*m+p*p,f=Math.sqrt(y),d=(e.nodeRepulsion+r.nodeRepulsion)/y,h=d*m/f,v=d*p/f;e.isLocked||(e.offsetX-=h,e.offsetY-=v),r.isLocked||(r.offsetX+=h,r.offsetY+=v)}},n$=function(e,r,n,a){if(n>0)var i=e.maxX-r.minX;else var i=r.maxX-e.minX;if(a>0)var s=e.maxY-r.minY;else var s=r.maxY-e.minY;return i>=0&&s>=0?Math.sqrt(i*i+s*s):0},nc=function(e,r,n){var a=e.positionX,i=e.positionY,s=e.height||1,o=e.width||1,l=n/r,u=s/o,c={};return r===0&&0<n||r===0&&0>n?(c.x=a,c.y=i+s/2,c):0<r&&-1*u<=l&&l<=u?(c.x=a+o/2,c.y=i+o*n/2/r,c):0>r&&-1*u<=l&&l<=u?(c.x=a-o/2,c.y=i-o*n/2/r,c):0<n&&(l<=-1*u||l>=u)?(c.x=a+s*r/2/n,c.y=i+s/2,c):(0>n&&(l<=-1*u||l>=u)&&(c.x=a-s*r/2/n,c.y=i-s/2),c)},a$=function(e,r){for(var n=0;n<e.edgeSize;n++){var a=e.layoutEdges[n],i=e.idToIndex[a.sourceId],s=e.layoutNodes[i],o=e.idToIndex[a.targetId],l=e.layoutNodes[o],u=l.positionX-s.positionX,c=l.positionY-s.positionY;if(!(u===0&&c===0)){var d=nc(s,u,c),f=nc(l,-1*u,-1*c),h=f.x-d.x,v=f.y-d.y,x=Math.sqrt(h*h+v*v),b=Math.pow(a.idealLength-x,2)/a.elasticity;if(x!==0)var m=b*h/x,p=b*v/x;else var m=0,p=0;s.isLocked||(s.offsetX+=m,s.offsetY+=p),l.isLocked||(l.offsetX-=m,l.offsetY-=p)}}},i$=function(e,r){if(r.gravity!==0)for(var n=1,a=0;a<e.graphSet.length;a++){var i=e.graphSet[a],s=i.length;if(a===0)var o=e.clientHeight/2,l=e.clientWidth/2;else var u=e.layoutNodes[e.idToIndex[i[0]]],c=e.layoutNodes[e.idToIndex[u.parentId]],o=c.positionX,l=c.positionY;for(var d=0;d<s;d++){var f=e.layoutNodes[e.idToIndex[i[d]]];if(!f.isLocked){var h=o-f.positionX,v=l-f.positionY,x=Math.sqrt(h*h+v*v);if(x>n){var b=r.gravity*h/x,m=r.gravity*v/x;f.offsetX+=b,f.offsetY+=m}}}}},s$=function(e,r){var n=[],a=0,i=-1;for(n.push.apply(n,e.graphSet[0]),i+=e.graphSet[0].length;a<=i;){var s=n[a++],o=e.idToIndex[s],l=e.layoutNodes[o],u=l.children;if(0<u.length&&!l.isLocked){for(var c=l.offsetX,d=l.offsetY,f=0;f<u.length;f++){var h=e.layoutNodes[e.idToIndex[u[f]]];h.offsetX+=c,h.offsetY+=d,n[++i]=u[f]}l.offsetX=0,l.offsetY=0}}},o$=function(e,r){for(var n=0;n<e.nodeSize;n++){var a=e.layoutNodes[n];0<a.children.length&&(a.maxX=void 0,a.minX=void 0,a.maxY=void 0,a.minY=void 0)}for(var n=0;n<e.nodeSize;n++){var a=e.layoutNodes[n];if(!(0<a.children.length||a.isLocked)){var i=l$(a.offsetX,a.offsetY,e.temperature);a.positionX+=i.x,a.positionY+=i.y,a.offsetX=0,a.offsetY=0,a.minX=a.positionX-a.width,a.maxX=a.positionX+a.width,a.minY=a.positionY-a.height,a.maxY=a.positionY+a.height,VA(a,e)}}for(var n=0;n<e.nodeSize;n++){var a=e.layoutNodes[n];0<a.children.length&&!a.isLocked&&(a.positionX=(a.maxX+a.minX)/2,a.positionY=(a.maxY+a.minY)/2,a.width=a.maxX-a.minX,a.height=a.maxY-a.minY)}},l$=function(e,r,n){var a=Math.sqrt(e*e+r*r);if(a>n)var i={x:n*e/a,y:n*r/a};else var i={x:e,y:r};return i},VA=function(e,r){var n=e.parentId;if(n!=null){var a=r.layoutNodes[r.idToIndex[n]],i=!1;if((a.maxX==null||e.maxX+a.padRight>a.maxX)&&(a.maxX=e.maxX+a.padRight,i=!0),(a.minX==null||e.minX-a.padLeft<a.minX)&&(a.minX=e.minX-a.padLeft,i=!0),(a.maxY==null||e.maxY+a.padBottom>a.maxY)&&(a.maxY=e.maxY+a.padBottom,i=!0),(a.minY==null||e.minY-a.padTop<a.minY)&&(a.minY=e.minY-a.padTop,i=!0),i)return VA(a,r)}},lE=function(e,r){for(var n=e.layoutNodes,a=[],i=0;i<n.length;i++){var s=n[i],o=s.cmptId,l=a[o]=a[o]||[];l.push(s)}for(var u=0,i=0;i<a.length;i++){var c=a[i];if(c){c.x1=1/0,c.x2=-1/0,c.y1=1/0,c.y2=-1/0;for(var d=0;d<c.length;d++){var f=c[d];c.x1=Math.min(c.x1,f.positionX-f.width/2),c.x2=Math.max(c.x2,f.positionX+f.width/2),c.y1=Math.min(c.y1,f.positionY-f.height/2),c.y2=Math.max(c.y2,f.positionY+f.height/2)}c.w=c.x2-c.x1,c.h=c.y2-c.y1,u+=c.w*c.h}}a.sort(function(p,y){return y.w*y.h-p.w*p.h});for(var h=0,v=0,x=0,b=0,m=Math.sqrt(u)*e.clientWidth/e.clientHeight,i=0;i<a.length;i++){var c=a[i];if(c){for(var d=0;d<c.length;d++){var f=c[d];f.isLocked||(f.positionX+=h-c.x1,f.positionY+=v-c.y1)}h+=c.w+r.componentSpacing,x+=c.w+r.componentSpacing,b=Math.max(b,c.h),x>m&&(v+=b+r.componentSpacing,h=0,x=0,b=0)}}},u$={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,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function UA(t){this.options=Te({},u$,t)}UA.prototype.run=function(){var t=this.options,e=t,r=t.cy,n=e.eles,a=n.nodes().not(":parent");e.sort&&(a=a.sort(e.sort));var i=lr(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()});if(i.h===0||i.w===0)n.nodes().layoutPositions(this,e,function(J){return{x:i.x1,y:i.y1}});else{var s=a.size(),o=Math.sqrt(s*i.h/i.w),l=Math.round(o),u=Math.round(i.w/i.h*o),c=function(q){if(q==null)return Math.min(l,u);var $=Math.min(l,u);$==l?l=q:u=q},d=function(q){if(q==null)return Math.max(l,u);var $=Math.max(l,u);$==l?l=q:u=q},f=e.rows,h=e.cols!=null?e.cols:e.columns;if(f!=null&&h!=null)l=f,u=h;else if(f!=null&&h==null)l=f,u=Math.ceil(s/l);else if(f==null&&h!=null)u=h,l=Math.ceil(s/u);else if(u*l>s){var v=c(),x=d();(v-1)*x>=s?c(v-1):(x-1)*v>=s&&d(x-1)}else for(;u*l<s;){var b=c(),m=d();(m+1)*b>=s?d(m+1):c(b+1)}var p=i.w/u,y=i.h/l;if(e.condense&&(p=0,y=0),e.avoidOverlap)for(var w=0;w<a.length;w++){var E=a[w],S=E._private.position;(S.x==null||S.y==null)&&(S.x=0,S.y=0);var C=E.layoutDimensions(e),k=e.avoidOverlapPadding,T=C.w+k,_=C.h+k;p=Math.max(p,T),y=Math.max(y,_)}for(var N={},P=function(q,$){return!!N["c-"+q+"-"+$]},R=function(q,$){N["c-"+q+"-"+$]=!0},I=0,M=0,D=function(){M++,M>=u&&(M=0,I++)},L={},j=0;j<a.length;j++){var F=a[j],O=e.position(F);if(O&&(O.row!==void 0||O.col!==void 0)){var B={row:O.row,col:O.col};if(B.col===void 0)for(B.col=0;P(B.row,B.col);)B.col++;else if(B.row===void 0)for(B.row=0;P(B.row,B.col);)B.row++;L[F.id()]=B,R(B.row,B.col)}}var V=function(q,$){var z,W;if(q.locked()||q.isParent())return!1;var ne=L[q.id()];if(ne)z=ne.col*p+p/2+i.x1,W=ne.row*y+y/2+i.y1;else{for(;P(I,M);)D();z=M*p+p/2+i.x1,W=I*y+y/2+i.y1,R(I,M),D()}return{x:z,y:W}};a.layoutPositions(this,e,V)}return this};var c$={ready:function(){},stop:function(){}};function p1(t){this.options=Te({},c$,t)}p1.prototype.run=function(){var t=this.options,e=t.eles,r=this;return t.cy,r.emit("layoutstart"),e.nodes().positions(function(){return{x:0,y:0}}),r.one("layoutready",t.ready),r.emit("layoutready"),r.one("layoutstop",t.stop),r.emit("layoutstop"),this};p1.prototype.stop=function(){return this};var d$={positions:void 0,zoom:void 0,pan:void 0,fit:!0,padding:30,spacingFactor:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function GA(t){this.options=Te({},d$,t)}GA.prototype.run=function(){var t=this.options,e=t.eles,r=e.nodes(),n=gt(t.positions);function a(i){if(t.positions==null)return IO(i.position());if(n)return t.positions(i);var s=t.positions[i._private.data.id];return s??null}return r.layoutPositions(this,t,function(i,s){var o=a(i);return i.locked()||o==null?!1:o}),this};var f$={fit:!0,padding:30,boundingBox:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function HA(t){this.options=Te({},f$,t)}HA.prototype.run=function(){var t=this.options,e=t.cy,r=t.eles,n=lr(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),a=function(s,o){return{x:n.x1+Math.round(Math.random()*n.w),y:n.y1+Math.round(Math.random()*n.h)}};return r.nodes().layoutPositions(this,t,a),this};var v$=[{name:"breadthfirst",impl:OA},{name:"circle",impl:qA},{name:"concentric",impl:FA},{name:"cose",impl:zc},{name:"grid",impl:UA},{name:"null",impl:p1},{name:"preset",impl:GA},{name:"random",impl:HA}];function WA(t){this.options=t,this.notifications=0}var uE=function(){},cE=function(){throw new Error("A headless instance can not render images")};WA.prototype={recalculateRenderedStyle:uE,notify:function(){this.notifications++},init:uE,isHeadless:function(){return!0},png:cE,jpg:cE};var g1={};g1.arrowShapeWidth=.3;g1.registerArrowShapes=function(){var t=this.arrowShapes={},e=this,r=function(u,c,d,f,h,v,x){var b=h.x-d/2-x,m=h.x+d/2+x,p=h.y-d/2-x,y=h.y+d/2+x,w=b<=u&&u<=m&&p<=c&&c<=y;return w},n=function(u,c,d,f,h){var v=u*Math.cos(f)-c*Math.sin(f),x=u*Math.sin(f)+c*Math.cos(f),b=v*d,m=x*d,p=b+h.x,y=m+h.y;return{x:p,y}},a=function(u,c,d,f){for(var h=[],v=0;v<u.length;v+=2){var x=u[v],b=u[v+1];h.push(n(x,b,c,d,f))}return h},i=function(u){for(var c=[],d=0;d<u.length;d++){var f=u[d];c.push(f.x,f.y)}return c},s=function(u){return u.pstyle("width").pfValue*u.pstyle("arrow-scale").pfValue*2},o=function(u,c){Ee(c)&&(c=t[c]),t[u]=Te({name:u,points:[-.15,-.3,.15,-.3,.15,.3,-.15,.3],collide:function(f,h,v,x,b,m){var p=i(a(this.points,v+2*m,x,b)),y=gr(f,h,p);return y},roughCollide:r,draw:function(f,h,v,x){var b=a(this.points,h,v,x);e.arrowShapeImpl("polygon")(f,b)},spacing:function(f){return 0},gap:s},c)};o("none",{collide:Zu,roughCollide:Zu,draw:t1,spacing:Cw,gap:Cw}),o("triangle",{points:[-.15,-.3,0,0,.15,-.3]}),o("arrow","triangle"),o("triangle-backcurve",{points:t.triangle.points,controlPoint:[0,-.15],roughCollide:r,draw:function(u,c,d,f,h){var v=a(this.points,c,d,f),x=this.controlPoint,b=n(x[0],x[1],c,d,f);e.arrowShapeImpl(this.name)(u,v,b)},gap:function(u){return s(u)*.8}}),o("triangle-tee",{points:[0,0,.15,-.3,-.15,-.3,0,0],pointsTee:[-.15,-.4,-.15,-.5,.15,-.5,.15,-.4],collide:function(u,c,d,f,h,v,x){var b=i(a(this.points,d+2*x,f,h)),m=i(a(this.pointsTee,d+2*x,f,h)),p=gr(u,c,b)||gr(u,c,m);return p},draw:function(u,c,d,f,h){var v=a(this.points,c,d,f),x=a(this.pointsTee,c,d,f);e.arrowShapeImpl(this.name)(u,v,x)}}),o("circle-triangle",{radius:.15,pointsTr:[0,-.15,.15,-.45,-.15,-.45,0,-.15],collide:function(u,c,d,f,h,v,x){var b=h,m=Math.pow(b.x-u,2)+Math.pow(b.y-c,2)<=Math.pow((d+2*x)*this.radius,2),p=i(a(this.points,d+2*x,f,h));return gr(u,c,p)||m},draw:function(u,c,d,f,h){var v=a(this.pointsTr,c,d,f);e.arrowShapeImpl(this.name)(u,v,f.x,f.y,this.radius*c)},spacing:function(u){return e.getArrowWidth(u.pstyle("width").pfValue,u.pstyle("arrow-scale").value)*this.radius}}),o("triangle-cross",{points:[0,0,.15,-.3,-.15,-.3,0,0],baseCrossLinePts:[-.15,-.4,-.15,-.4,.15,-.4,.15,-.4],crossLinePts:function(u,c){var d=this.baseCrossLinePts.slice(),f=c/u,h=3,v=5;return d[h]=d[h]-f,d[v]=d[v]-f,d},collide:function(u,c,d,f,h,v,x){var b=i(a(this.points,d+2*x,f,h)),m=i(a(this.crossLinePts(d,v),d+2*x,f,h)),p=gr(u,c,b)||gr(u,c,m);return p},draw:function(u,c,d,f,h){var v=a(this.points,c,d,f),x=a(this.crossLinePts(c,h),c,d,f);e.arrowShapeImpl(this.name)(u,v,x)}}),o("vee",{points:[-.15,-.3,0,0,.15,-.3,0,-.15],gap:function(u){return s(u)*.525}}),o("circle",{radius:.15,collide:function(u,c,d,f,h,v,x){var b=h,m=Math.pow(b.x-u,2)+Math.pow(b.y-c,2)<=Math.pow((d+2*x)*this.radius,2);return m},draw:function(u,c,d,f,h){e.arrowShapeImpl(this.name)(u,f.x,f.y,this.radius*c)},spacing:function(u){return e.getArrowWidth(u.pstyle("width").pfValue,u.pstyle("arrow-scale").value)*this.radius}}),o("tee",{points:[-.15,0,-.15,-.1,.15,-.1,.15,0],spacing:function(u){return 1},gap:function(u){return 1}}),o("square",{points:[-.15,0,.15,0,.15,-.3,-.15,-.3]}),o("diamond",{points:[-.15,-.15,0,-.3,.15,-.15,0,0],gap:function(u){return u.pstyle("width").pfValue*u.pstyle("arrow-scale").value}}),o("chevron",{points:[0,0,-.15,-.15,-.1,-.2,0,-.1,.1,-.2,.15,-.15],gap:function(u){return .95*u.pstyle("width").pfValue*u.pstyle("arrow-scale").value}})};var ci={};ci.projectIntoViewport=function(t,e){var r=this.cy,n=this.findContainerClientCoords(),a=n[0],i=n[1],s=n[4],o=r.pan(),l=r.zoom(),u=((t-a)/s-o.x)/l,c=((e-i)/s-o.y)/l;return[u,c]};ci.findContainerClientCoords=function(){if(this.containerBB)return this.containerBB;var t=this.container,e=t.getBoundingClientRect(),r=this.cy.window().getComputedStyle(t),n=function(m){return parseFloat(r.getPropertyValue(m))},a={left:n("padding-left"),right:n("padding-right"),top:n("padding-top"),bottom:n("padding-bottom")},i={left:n("border-left-width"),right:n("border-right-width"),top:n("border-top-width"),bottom:n("border-bottom-width")},s=t.clientWidth,o=t.clientHeight,l=a.left+a.right,u=a.top+a.bottom,c=i.left+i.right,d=e.width/(s+c),f=s-l,h=o-u,v=e.left+a.left+i.left,x=e.top+a.top+i.top;return this.containerBB=[v,x,f,h,d]};ci.invalidateContainerClientCoordsCache=function(){this.containerBB=null};ci.findNearestElement=function(t,e,r,n){return this.findNearestElements(t,e,r,n)[0]};ci.findNearestElements=function(t,e,r,n){var a=this,i=this,s=i.getCachedZSortedEles(),o=[],l=i.cy.zoom(),u=i.cy.hasCompoundNodes(),c=(n?24:8)/l,d=(n?8:2)/l,f=(n?8:2)/l,h=1/0,v,x;r&&(s=s.interactive);function b(C,k){if(C.isNode()){if(x)return;x=C,o.push(C)}if(C.isEdge()&&(k==null||k<h))if(v){if(v.pstyle("z-compound-depth").value===C.pstyle("z-compound-depth").value&&v.pstyle("z-compound-depth").value===C.pstyle("z-compound-depth").value){for(var T=0;T<o.length;T++)if(o[T].isEdge()){o[T]=C,v=C,h=k??h;break}}}else o.push(C),v=C,h=k??h}function m(C){var k=C.outerWidth()+2*d,T=C.outerHeight()+2*d,_=k/2,N=T/2,P=C.position(),R=C.pstyle("corner-radius").value==="auto"?"auto":C.pstyle("corner-radius").pfValue,I=C._private.rscratch;if(P.x-_<=t&&t<=P.x+_&&P.y-N<=e&&e<=P.y+N){var M=i.nodeShapes[a.getNodeShape(C)];if(M.checkPoint(t,e,0,k,T,P.x,P.y,R,I))return b(C,0),!0}}function p(C){var k=C._private,T=k.rscratch,_=C.pstyle("width").pfValue,N=C.pstyle("arrow-scale").value,P=_/2+c,R=P*P,I=P*2,j=k.source,F=k.target,M;if(T.edgeType==="segments"||T.edgeType==="straight"||T.edgeType==="haystack"){for(var D=T.allpts,L=0;L+3<D.length;L+=2)if(WO(t,e,D[L],D[L+1],D[L+2],D[L+3],I)&&R>(M=QO(t,e,D[L],D[L+1],D[L+2],D[L+3])))return b(C,M),!0}else if(T.edgeType==="bezier"||T.edgeType==="multibezier"||T.edgeType==="self"||T.edgeType==="compound"){for(var D=T.allpts,L=0;L+5<T.allpts.length;L+=4)if(KO(t,e,D[L],D[L+1],D[L+2],D[L+3],D[L+4],D[L+5],I)&&R>(M=ZO(t,e,D[L],D[L+1],D[L+2],D[L+3],D[L+4],D[L+5])))return b(C,M),!0}for(var j=j||k.source,F=F||k.target,O=a.getArrowWidth(_,N),B=[{name:"source",x:T.arrowStartX,y:T.arrowStartY,angle:T.srcArrowAngle},{name:"target",x:T.arrowEndX,y:T.arrowEndY,angle:T.tgtArrowAngle},{name:"mid-source",x:T.midX,y:T.midY,angle:T.midsrcArrowAngle},{name:"mid-target",x:T.midX,y:T.midY,angle:T.midtgtArrowAngle}],L=0;L<B.length;L++){var V=B[L],J=i.arrowShapes[C.pstyle(V.name+"-arrow-shape").value],q=C.pstyle("width").pfValue;if(J.roughCollide(t,e,O,V.angle,{x:V.x,y:V.y},q,c)&&J.collide(t,e,O,V.angle,{x:V.x,y:V.y},q,c))return b(C),!0}u&&o.length>0&&(m(j),m(F))}function y(C,k,T){return pr(C,k,T)}function w(C,k){var T=C._private,_=f,N;k?N=k+"-":N="",C.boundingBox();var P=T.labelBounds[k||"main"],R=C.pstyle(N+"label").value,I=C.pstyle("text-events").strValue==="yes";if(!(!I||!R)){var M=y(T.rscratch,"labelX",k),D=y(T.rscratch,"labelY",k),L=y(T.rscratch,"labelAngle",k),j=C.pstyle(N+"text-margin-x").pfValue,F=C.pstyle(N+"text-margin-y").pfValue,O=P.x1-_-j,B=P.x2+_-j,V=P.y1-_-F,J=P.y2+_-F;if(L){var q=Math.cos(L),$=Math.sin(L),z=function(ee,ie){return ee=ee-M,ie=ie-D,{x:ee*q-ie*$+M,y:ee*$+ie*q+D}},W=z(O,V),ne=z(O,J),X=z(B,V),U=z(B,J),H=[W.x+j,W.y+F,X.x+j,X.y+F,U.x+j,U.y+F,ne.x+j,ne.y+F];if(gr(t,e,H))return b(C),!0}else if(aa(P,t,e))return b(C),!0}}for(var E=s.length-1;E>=0;E--){var S=s[E];S.isNode()?m(S)||w(S):p(S)||w(S)||w(S,"source")||w(S,"target")}return o};ci.getAllInBox=function(t,e,r,n){var a=this.getCachedZSortedEles().interactive,i=this.cy.zoom(),s=2/i,o=[],l=Math.min(t,r),u=Math.max(t,r),c=Math.min(e,n),d=Math.max(e,n);t=l,r=u,e=c,n=d;var f=lr({x1:t,y1:e,x2:r,y2:n}),h=[{x:f.x1,y:f.y1},{x:f.x2,y:f.y1},{x:f.x2,y:f.y2},{x:f.x1,y:f.y2}],v=[[h[0],h[1]],[h[1],h[2]],[h[2],h[3]],[h[3],h[0]]];function x(ee,ie,oe){return pr(ee,ie,oe)}function b(ee,ie){var oe=ee._private,Re=s,ue="";ee.boundingBox();var Se=oe.labelBounds.main;if(!Se)return null;var be=x(oe.rscratch,"labelX",ie),de=x(oe.rscratch,"labelY",ie),xe=x(oe.rscratch,"labelAngle",ie),fe=ee.pstyle(ue+"text-margin-x").pfValue,we=ee.pstyle(ue+"text-margin-y").pfValue,Ce=Se.x1-Re-fe,Ne=Se.x2+Re-fe,De=Se.y1-Re-we,$e=Se.y2+Re-we;if(xe){var je=Math.cos(xe),Oe=Math.sin(xe),te=function(G,K){return G=G-be,K=K-de,{x:G*je-K*Oe+be,y:G*Oe+K*je+de}};return[te(Ce,De),te(Ne,De),te(Ne,$e),te(Ce,$e)]}else return[{x:Ce,y:De},{x:Ne,y:De},{x:Ne,y:$e},{x:Ce,y:$e}]}function m(ee,ie,oe,Re){function ue(Se,be,de){return(de.y-Se.y)*(be.x-Se.x)>(be.y-Se.y)*(de.x-Se.x)}return ue(ee,oe,Re)!==ue(ie,oe,Re)&&ue(ee,ie,oe)!==ue(ee,ie,Re)}for(var p=0;p<a.length;p++){var y=a[p];if(y.isNode()){var w=y,E=w.pstyle("text-events").strValue==="yes",S=w.pstyle("box-selection").strValue,C=w.pstyle("box-select-labels").strValue==="yes";if(S==="none")continue;var k=(S==="overlap"||C)&&E,T=w.boundingBox({includeNodes:!0,includeEdges:!1,includeLabels:k});if(S==="contain"){var _=!1;if(C&&E){var N=b(w);N&&af(N,h)&&(o.push(w),_=!0)}!_&&eA(f,T)&&o.push(w)}else if(S==="overlap"&&i1(f,T)){var P=w.boundingBox({includeNodes:!0,includeEdges:!0,includeLabels:!1,includeMainLabels:!1,includeSourceLabels:!1,includeTargetLabels:!1}),R=[{x:P.x1,y:P.y1},{x:P.x2,y:P.y1},{x:P.x2,y:P.y2},{x:P.x1,y:P.y2}];if(af(R,h))o.push(w);else{var I=b(w);I&&af(I,h)&&o.push(w)}}}else{var M=y,D=M._private,L=D.rscratch,j=M.pstyle("box-selection").strValue;if(j==="none")continue;if(j==="contain"){if(L.startX!=null&&L.startY!=null&&!aa(f,L.startX,L.startY)||L.endX!=null&&L.endY!=null&&!aa(f,L.endX,L.endY))continue;if(L.edgeType==="bezier"||L.edgeType==="multibezier"||L.edgeType==="self"||L.edgeType==="compound"||L.edgeType==="segments"||L.edgeType==="haystack"){for(var F=D.rstyle.bezierPts||D.rstyle.linePts||D.rstyle.haystackPts,O=!0,B=0;B<F.length;B++)if(!Rw(f,F[B])){O=!1;break}O&&o.push(M)}else L.edgeType==="straight"&&o.push(M)}else if(j==="overlap"){var V=!1;if(L.startX!=null&&L.startY!=null&&L.endX!=null&&L.endY!=null&&(aa(f,L.startX,L.startY)||aa(f,L.endX,L.endY)))o.push(M),V=!0;else if(!V&&L.edgeType==="haystack"){for(var J=D.rstyle.haystackPts,q=0;q<J.length;q++)if(Rw(f,J[q])){o.push(M),V=!0;break}}if(!V){var $=D.rstyle.bezierPts||D.rstyle.linePts||D.rstyle.haystackPts;if((!$||$.length<2)&&L.edgeType==="straight"&&L.startX!=null&&L.startY!=null&&L.endX!=null&&L.endY!=null&&($=[{x:L.startX,y:L.startY},{x:L.endX,y:L.endY}]),!$||$.length<2)continue;for(var z=0;z<$.length-1;z++){for(var W=$[z],ne=$[z+1],X=0;X<v.length;X++){var U=kt(v[X],2),H=U[0],Y=U[1];if(m(W,ne,H,Y)){o.push(M),V=!0;break}}if(V)break}}}}}return o};var ac={};ac.calculateArrowAngles=function(t){var e=t._private.rscratch,r=e.edgeType==="haystack",n=e.edgeType==="bezier",a=e.edgeType==="multibezier",i=e.edgeType==="segments",s=e.edgeType==="compound",o=e.edgeType==="self",l,u,c,d,f,h,m,p;if(r?(c=e.haystackPts[0],d=e.haystackPts[1],f=e.haystackPts[2],h=e.haystackPts[3]):(c=e.arrowStartX,d=e.arrowStartY,f=e.arrowEndX,h=e.arrowEndY),m=e.midX,p=e.midY,i)l=c-e.segpts[0],u=d-e.segpts[1];else if(a||s||o||n){var v=e.allpts,x=Bt(v[0],v[2],v[4],.1),b=Bt(v[1],v[3],v[5],.1);l=c-x,u=d-b}else l=c-m,u=d-p;e.srcArrowAngle=ql(l,u);var m=e.midX,p=e.midY;if(r&&(m=(c+f)/2,p=(d+h)/2),l=f-c,u=h-d,i){var v=e.allpts;if(v.length/2%2===0){var y=v.length/2,w=y-2;l=v[y]-v[w],u=v[y+1]-v[w+1]}else if(e.isRound)l=e.midVector[1],u=-e.midVector[0];else{var y=v.length/2-1,w=y-2;l=v[y]-v[w],u=v[y+1]-v[w+1]}}else if(a||s||o){var v=e.allpts,E=e.ctrlpts,S,C,k,T;if(E.length/2%2===0){var _=v.length/2-1,N=_+2,P=N+2;S=Bt(v[_],v[N],v[P],0),C=Bt(v[_+1],v[N+1],v[P+1],0),k=Bt(v[_],v[N],v[P],1e-4),T=Bt(v[_+1],v[N+1],v[P+1],1e-4)}else{var N=v.length/2-1,_=N-2,P=N+2;S=Bt(v[_],v[N],v[P],.4999),C=Bt(v[_+1],v[N+1],v[P+1],.4999),k=Bt(v[_],v[N],v[P],.5),T=Bt(v[_+1],v[N+1],v[P+1],.5)}l=k-S,u=T-C}if(e.midtgtArrowAngle=ql(l,u),e.midDispX=l,e.midDispY=u,l*=-1,u*=-1,i){var v=e.allpts;if(v.length/2%2!==0){if(!e.isRound){var y=v.length/2-1,R=y+2;l=-(v[R]-v[y]),u=-(v[R+1]-v[y+1])}}}if(e.midsrcArrowAngle=ql(l,u),i)l=f-e.segpts[e.segpts.length-2],u=h-e.segpts[e.segpts.length-1];else if(a||s||o||n){var v=e.allpts,I=v.length,x=Bt(v[I-6],v[I-4],v[I-2],.9),b=Bt(v[I-5],v[I-3],v[I-1],.9);l=f-x,u=h-b}else l=f-m,u=h-p;e.tgtArrowAngle=ql(l,u)};ac.getArrowWidth=ac.getArrowHeight=function(t,e){var r=this.arrowWidthCache=this.arrowWidthCache||{},n=r[t+", "+e];return n||(n=Math.max(Math.pow(t*13.37,.9),29)*e,r[t+", "+e]=n,n)};var F0,$0,cn={},jr={},dE,fE,za,yu,Cn,Da,Fa,ln,wi,Wl,KA,YA,z0,V0,vE,hE=function(e,r,n){n.x=r.x-e.x,n.y=r.y-e.y,n.len=Math.sqrt(n.x*n.x+n.y*n.y),n.nx=n.x/n.len,n.ny=n.y/n.len,n.ang=Math.atan2(n.ny,n.nx)},h$=function(e,r){r.x=e.x*-1,r.y=e.y*-1,r.nx=e.nx*-1,r.ny=e.ny*-1,r.ang=e.ang>0?-(Math.PI-e.ang):Math.PI+e.ang},p$=function(e,r,n,a,i){if(e!==vE?hE(r,e,cn):h$(jr,cn),hE(r,n,jr),dE=cn.nx*jr.ny-cn.ny*jr.nx,fE=cn.nx*jr.nx-cn.ny*-jr.ny,Cn=Math.asin(Math.max(-1,Math.min(1,dE))),Math.abs(Cn)<1e-6){F0=r.x,$0=r.y,Fa=wi=0;return}za=1,yu=!1,fE<0?Cn<0?Cn=Math.PI+Cn:(Cn=Math.PI-Cn,za=-1,yu=!0):Cn>0&&(za=-1,yu=!0),r.radius!==void 0?wi=r.radius:wi=a,Da=Cn/2,Wl=Math.min(cn.len/2,jr.len/2),i?(ln=Math.abs(Math.cos(Da)*wi/Math.sin(Da)),ln>Wl?(ln=Wl,Fa=Math.abs(ln*Math.sin(Da)/Math.cos(Da))):Fa=wi):(ln=Math.min(Wl,wi),Fa=Math.abs(ln*Math.sin(Da)/Math.cos(Da))),z0=r.x+jr.nx*ln,V0=r.y+jr.ny*ln,F0=z0-jr.ny*Fa*za,$0=V0+jr.nx*Fa*za,KA=r.x+cn.nx*ln,YA=r.y+cn.ny*ln,vE=r};function XA(t,e){e.radius===0?t.lineTo(e.cx,e.cy):t.arc(e.cx,e.cy,e.radius,e.startAngle,e.endAngle,e.counterClockwise)}function m1(t,e,r,n){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;return n===0||e.radius===0?{cx:e.x,cy:e.y,radius:0,startX:e.x,startY:e.y,stopX:e.x,stopY:e.y,startAngle:void 0,endAngle:void 0,counterClockwise:void 0}:(p$(t,e,r,n,a),{cx:F0,cy:$0,radius:Fa,startX:KA,startY:YA,stopX:z0,stopY:V0,startAngle:cn.ang+Math.PI/2*za,endAngle:jr.ang-Math.PI/2*za,counterClockwise:yu})}var Vo=.01,g$=Math.sqrt(2*Vo),nr={};nr.findMidptPtsEtc=function(t,e){var r=e.posPts,n=e.intersectionPts,a=e.vectorNormInverse,i,s=t.pstyle("source-endpoint"),o=t.pstyle("target-endpoint"),l=s.units!=null&&o.units!=null,u=function(E,S,C,k){var T=k-S,_=C-E,N=Math.sqrt(_*_+T*T);return{x:-T/N,y:_/N}},c=t.pstyle("edge-distances").value;switch(c){case"node-position":i=r;break;case"intersection":i=n;break;case"endpoints":{if(l){var d=this.manualEndptToPx(t.source()[0],s),f=kt(d,2),h=f[0],v=f[1],x=this.manualEndptToPx(t.target()[0],o),b=kt(x,2),m=b[0],p=b[1],y={x1:h,y1:v,x2:m,y2:p};a=u(h,v,m,p),i=y}else Ye("Edge ".concat(t.id()," has edge-distances:endpoints specified without manual endpoints specified via source-endpoint and target-endpoint. Falling back on edge-distances:intersection (default).")),i=n;break}}return{midptPts:i,vectorNormInverse:a}};nr.findHaystackPoints=function(t){for(var e=0;e<t.length;e++){var r=t[e],n=r._private,a=n.rscratch;if(!a.haystack){var i=Math.random()*2*Math.PI;a.source={x:Math.cos(i),y:Math.sin(i)},i=Math.random()*2*Math.PI,a.target={x:Math.cos(i),y:Math.sin(i)}}var s=n.source,o=n.target,l=s.position(),u=o.position(),c=s.width(),d=o.width(),f=s.height(),h=o.height(),v=r.pstyle("haystack-radius").value,x=v/2;a.haystackPts=a.allpts=[a.source.x*c*x+l.x,a.source.y*f*x+l.y,a.target.x*d*x+u.x,a.target.y*h*x+u.y],a.midX=(a.allpts[0]+a.allpts[2])/2,a.midY=(a.allpts[1]+a.allpts[3])/2,a.edgeType="haystack",a.haystack=!0,this.storeEdgeProjections(r),this.calculateArrowAngles(r),this.recalculateEdgeLabelProjections(r),this.calculateLabelAngles(r)}};nr.findSegmentsPoints=function(t,e){var r=t._private.rscratch,n=t.pstyle("segment-weights"),a=t.pstyle("segment-distances"),i=t.pstyle("segment-radii"),s=t.pstyle("radius-type"),o=Math.min(n.pfValue.length,a.pfValue.length),l=i.pfValue[i.pfValue.length-1],u=s.pfValue[s.pfValue.length-1];r.edgeType="segments",r.segpts=[],r.radii=[],r.isArcRadius=[];for(var c=0;c<o;c++){var d=n.pfValue[c],f=a.pfValue[c],h=1-d,v=d,x=this.findMidptPtsEtc(t,e),b=x.midptPts,m=x.vectorNormInverse,p={x:b.x1*h+b.x2*v,y:b.y1*h+b.y2*v};r.segpts.push(p.x+m.x*f,p.y+m.y*f),r.radii.push(i.pfValue[c]!==void 0?i.pfValue[c]:l),r.isArcRadius.push((s.pfValue[c]!==void 0?s.pfValue[c]:u)==="arc-radius")}};nr.findLoopPoints=function(t,e,r,n){var a=t._private.rscratch,i=e.dirCounts,s=e.srcPos,o=t.pstyle("control-point-distances"),l=o?o.pfValue[0]:void 0,u=t.pstyle("loop-direction").pfValue,c=t.pstyle("loop-sweep").pfValue,d=t.pstyle("control-point-step-size").pfValue;a.edgeType="self";var f=r,h=d;n&&(f=0,h=l);var v=u-Math.PI/2,x=v-c/2,b=v+c/2,m=u+"_"+c;f=i[m]===void 0?i[m]=0:++i[m],a.ctrlpts=[s.x+Math.cos(x)*1.4*h*(f/3+1),s.y+Math.sin(x)*1.4*h*(f/3+1),s.x+Math.cos(b)*1.4*h*(f/3+1),s.y+Math.sin(b)*1.4*h*(f/3+1)]};nr.findCompoundLoopPoints=function(t,e,r,n){var a=t._private.rscratch;a.edgeType="compound";var i=e.srcPos,s=e.tgtPos,o=e.srcW,l=e.srcH,u=e.tgtW,c=e.tgtH,d=t.pstyle("control-point-step-size").pfValue,f=t.pstyle("control-point-distances"),h=f?f.pfValue[0]:void 0,v=r,x=d;n&&(v=0,x=h);var b=50,m={x:i.x-o/2,y:i.y-l/2},p={x:s.x-u/2,y:s.y-c/2},y={x:Math.min(m.x,p.x),y:Math.min(m.y,p.y)},w=.5,E=Math.max(w,Math.log(o*Vo)),S=Math.max(w,Math.log(u*Vo));a.ctrlpts=[y.x,y.y-(1+Math.pow(b,1.12)/100)*x*(v/3+1)*E,y.x-(1+Math.pow(b,1.12)/100)*x*(v/3+1)*S,y.y]};nr.findStraightEdgePoints=function(t){t._private.rscratch.edgeType="straight"};nr.findBezierPoints=function(t,e,r,n,a){var i=t._private.rscratch,s=t.pstyle("control-point-step-size").pfValue,o=t.pstyle("control-point-distances"),l=t.pstyle("control-point-weights"),u=o&&l?Math.min(o.value.length,l.value.length):1,c=o?o.pfValue[0]:void 0,d=l.value[0],f=n;i.edgeType=f?"multibezier":"bezier",i.ctrlpts=[];for(var h=0;h<u;h++){var v=(.5-e.eles.length/2+r)*s*(a?-1:1),x=void 0,b=a1(v);f&&(c=o?o.pfValue[h]:s,d=l.value[h]),n?x=c:x=c!==void 0?b*c:void 0;var m=x!==void 0?x:v,p=1-d,y=d,w=this.findMidptPtsEtc(t,e),E=w.midptPts,S=w.vectorNormInverse,C={x:E.x1*p+E.x2*y,y:E.y1*p+E.y2*y};i.ctrlpts.push(C.x+S.x*m,C.y+S.y*m)}};nr.findTaxiPoints=function(t,e){var r=t._private.rscratch;r.edgeType="segments";var n="vertical",a="horizontal",i="leftward",s="rightward",o="downward",l="upward",u="auto",c=e.posPts,d=e.srcW,f=e.srcH,h=e.tgtW,v=e.tgtH,x=t.pstyle("edge-distances").value,b=x!=="node-position",m=t.pstyle("taxi-direction").value,p=m,y=t.pstyle("taxi-turn"),w=y.units==="%",E=y.pfValue,S=E<0,C=t.pstyle("taxi-turn-min-distance").pfValue,k=b?(d+h)/2:0,T=b?(f+v)/2:0,_=c.x2-c.x1,N=c.y2-c.y1,P=function(K,Q){return K>0?Math.max(K-Q,0):Math.min(K+Q,0)},R=P(_,k),I=P(N,T),M=!1;p===u?m=Math.abs(R)>Math.abs(I)?a:n:p===l||p===o?(m=n,M=!0):(p===i||p===s)&&(m=a,M=!0);var D=m===n,L=D?I:R,j=D?N:_,F=a1(j),O=!1;!(M&&(w||S))&&(p===o&&j<0||p===l&&j>0||p===i&&j>0||p===s&&j<0)&&(F*=-1,L=F*Math.abs(L),O=!0);var B;if(w){var V=E<0?1+E:E;B=V*L}else{var J=E<0?L:0;B=J+E*F}var q=function(K){return Math.abs(K)<C||Math.abs(K)>=Math.abs(L)},$=q(B),z=q(Math.abs(L)-Math.abs(B)),W=$||z;if(W&&!O)if(D){var ne=Math.abs(j)<=f/2,X=Math.abs(_)<=h/2;if(ne){var U=(c.x1+c.x2)/2,H=c.y1,Y=c.y2;r.segpts=[U,H,U,Y]}else if(X){var ee=(c.y1+c.y2)/2,ie=c.x1,oe=c.x2;r.segpts=[ie,ee,oe,ee]}else r.segpts=[c.x1,c.y2]}else{var Re=Math.abs(j)<=d/2,ue=Math.abs(N)<=v/2;if(Re){var Se=(c.y1+c.y2)/2,be=c.x1,de=c.x2;r.segpts=[be,Se,de,Se]}else if(ue){var xe=(c.x1+c.x2)/2,fe=c.y1,we=c.y2;r.segpts=[xe,fe,xe,we]}else r.segpts=[c.x2,c.y1]}else if(D){var Ce=c.y1+B+(b?f/2*F:0),Ne=c.x1,De=c.x2;r.segpts=[Ne,Ce,De,Ce]}else{var $e=c.x1+B+(b?d/2*F:0),je=c.y1,Oe=c.y2;r.segpts=[$e,je,$e,Oe]}if(r.isRound){var te=t.pstyle("taxi-radius").value,A=t.pstyle("radius-type").value[0]==="arc-radius";r.radii=new Array(r.segpts.length/2).fill(te),r.isArcRadius=new Array(r.segpts.length/2).fill(A)}};nr.tryToCorrectInvalidPoints=function(t,e){var r=t._private.rscratch;if(r.edgeType==="bezier"){var n=e.srcPos,a=e.tgtPos,i=e.srcW,s=e.srcH,o=e.tgtW,l=e.tgtH,u=e.srcShape,c=e.tgtShape,d=e.srcCornerRadius,f=e.tgtCornerRadius,h=e.srcRs,v=e.tgtRs,x=!le(r.startX)||!le(r.startY),b=!le(r.arrowStartX)||!le(r.arrowStartY),m=!le(r.endX)||!le(r.endY),p=!le(r.arrowEndX)||!le(r.arrowEndY),y=3,w=this.getArrowWidth(t.pstyle("width").pfValue,t.pstyle("arrow-scale").value)*this.arrowShapeWidth,E=y*w,S=ai({x:r.ctrlpts[0],y:r.ctrlpts[1]},{x:r.startX,y:r.startY}),C=S<E,k=ai({x:r.ctrlpts[0],y:r.ctrlpts[1]},{x:r.endX,y:r.endY}),T=k<E,_=!1;if(x||b||C){_=!0;var N={x:r.ctrlpts[0]-n.x,y:r.ctrlpts[1]-n.y},P=Math.sqrt(N.x*N.x+N.y*N.y),R={x:N.x/P,y:N.y/P},I=Math.max(i,s),M={x:r.ctrlpts[0]+R.x*2*I,y:r.ctrlpts[1]+R.y*2*I},D=u.intersectLine(n.x,n.y,i,s,M.x,M.y,0,d,h);C?(r.ctrlpts[0]=r.ctrlpts[0]+R.x*(E-S),r.ctrlpts[1]=r.ctrlpts[1]+R.y*(E-S)):(r.ctrlpts[0]=D[0]+R.x*E,r.ctrlpts[1]=D[1]+R.y*E)}if(m||p||T){_=!0;var L={x:r.ctrlpts[0]-a.x,y:r.ctrlpts[1]-a.y},j=Math.sqrt(L.x*L.x+L.y*L.y),F={x:L.x/j,y:L.y/j},O=Math.max(i,s),B={x:r.ctrlpts[0]+F.x*2*O,y:r.ctrlpts[1]+F.y*2*O},V=c.intersectLine(a.x,a.y,o,l,B.x,B.y,0,f,v);T?(r.ctrlpts[0]=r.ctrlpts[0]+F.x*(E-k),r.ctrlpts[1]=r.ctrlpts[1]+F.y*(E-k)):(r.ctrlpts[0]=V[0]+F.x*E,r.ctrlpts[1]=V[1]+F.y*E)}_&&this.findEndpoints(t)}};nr.storeAllpts=function(t){var e=t._private.rscratch;if(e.edgeType==="multibezier"||e.edgeType==="bezier"||e.edgeType==="self"||e.edgeType==="compound"){e.allpts=[],e.allpts.push(e.startX,e.startY);for(var r=0;r+1<e.ctrlpts.length;r+=2)e.allpts.push(e.ctrlpts[r],e.ctrlpts[r+1]),r+3<e.ctrlpts.length&&e.allpts.push((e.ctrlpts[r]+e.ctrlpts[r+2])/2,(e.ctrlpts[r+1]+e.ctrlpts[r+3])/2);e.allpts.push(e.endX,e.endY);var n,a;e.ctrlpts.length/2%2===0?(n=e.allpts.length/2-1,e.midX=e.allpts[n],e.midY=e.allpts[n+1]):(n=e.allpts.length/2-3,a=.5,e.midX=Bt(e.allpts[n],e.allpts[n+2],e.allpts[n+4],a),e.midY=Bt(e.allpts[n+1],e.allpts[n+3],e.allpts[n+5],a))}else if(e.edgeType==="straight")e.allpts=[e.startX,e.startY,e.endX,e.endY],e.midX=(e.startX+e.endX+e.arrowStartX+e.arrowEndX)/4,e.midY=(e.startY+e.endY+e.arrowStartY+e.arrowEndY)/4;else if(e.edgeType==="segments"){if(e.allpts=[],e.allpts.push(e.startX,e.startY),e.allpts.push.apply(e.allpts,e.segpts),e.allpts.push(e.endX,e.endY),e.isRound){e.roundCorners=[];for(var i=2;i+3<e.allpts.length;i+=2){var s=e.radii[i/2-1],o=e.isArcRadius[i/2-1];e.roundCorners.push(m1({x:e.allpts[i-2],y:e.allpts[i-1]},{x:e.allpts[i],y:e.allpts[i+1],radius:s},{x:e.allpts[i+2],y:e.allpts[i+3]},s,o))}}if(e.segpts.length%4===0){var l=e.segpts.length/2,u=l-2;e.midX=(e.segpts[u]+e.segpts[l])/2,e.midY=(e.segpts[u+1]+e.segpts[l+1])/2}else{var c=e.segpts.length/2-1;if(!e.isRound)e.midX=e.segpts[c],e.midY=e.segpts[c+1];else{var d={x:e.segpts[c],y:e.segpts[c+1]},f=e.roundCorners[c/2];if(f.radius===0){var h={x:e.segpts[c+2],y:e.segpts[c+3]};e.midX=d.x,e.midY=d.y,e.midVector=[d.y-h.y,h.x-d.x]}else{var v=[d.x-f.cx,d.y-f.cy],x=f.radius/Math.sqrt(Math.pow(v[0],2)+Math.pow(v[1],2));v=v.map(function(b){return b*x}),e.midX=f.cx+v[0],e.midY=f.cy+v[1],e.midVector=v}}}}};nr.checkForInvalidEdgeWarning=function(t){var e=t[0]._private.rscratch;e.nodesOverlap||le(e.startX)&&le(e.startY)&&le(e.endX)&&le(e.endY)?e.loggedErr=!1:e.loggedErr||(e.loggedErr=!0,Ye("Edge `"+t.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."))};nr.findEdgeControlPoints=function(t){var e=this;if(!(!t||t.length===0)){for(var r=this,n=r.cy,a=n.hasCompoundNodes(),i=new Pn,s=function(T,_){return[].concat(Ku(T),[_?1:0]).join("-")},o=[],l=[],u=0;u<t.length;u++){var c=t[u],d=c._private,f=c.pstyle("curve-style").value;if(!(c.removed()||!c.takesUpSpace())){if(f==="haystack"){l.push(c);continue}var h=f==="unbundled-bezier"||na(f,"segments")||f==="straight"||f==="straight-triangle"||na(f,"taxi"),v=f==="unbundled-bezier"||f==="bezier",x=d.source,b=d.target,m=x.poolIndex(),p=b.poolIndex(),y=[m,p].sort(),w=s(y,h),E=i.get(w);E==null&&(E={eles:[]},o.push({pairId:y,edgeIsUnbundled:h}),i.set(w,E)),E.eles.push(c),h&&(E.hasUnbundled=!0),v&&(E.hasBezier=!0)}}for(var S=function(){var T=o[C],_=T.pairId,N=T.edgeIsUnbundled,P=s(_,N),R=i.get(P),I;if(!R.hasUnbundled){var M=R.eles[0].parallelEdges().filter(function(A){return A.isBundledBezier()});r1(R.eles),M.forEach(function(A){return R.eles.push(A)}),R.eles.sort(function(A,G){return A.poolIndex()-G.poolIndex()})}var D=R.eles[0],L=D.source(),j=D.target();if(L.poolIndex()>j.poolIndex()){var F=L;L=j,j=F}var O=R.srcPos=L.position(),B=R.tgtPos=j.position(),V=R.srcW=L.outerWidth(),J=R.srcH=L.outerHeight(),q=R.tgtW=j.outerWidth(),$=R.tgtH=j.outerHeight(),z=R.srcShape=r.nodeShapes[e.getNodeShape(L)],W=R.tgtShape=r.nodeShapes[e.getNodeShape(j)],ne=R.srcCornerRadius=L.pstyle("corner-radius").value==="auto"?"auto":L.pstyle("corner-radius").pfValue,X=R.tgtCornerRadius=j.pstyle("corner-radius").value==="auto"?"auto":j.pstyle("corner-radius").pfValue,U=R.tgtRs=j._private.rscratch,H=R.srcRs=L._private.rscratch;R.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var Y=0;Y<R.eles.length;Y++){var ee=R.eles[Y],ie=ee[0]._private.rscratch,oe=ee.pstyle("curve-style").value,Re=oe==="unbundled-bezier"||na(oe,"segments")||na(oe,"taxi"),ue=!L.same(ee.source());if(!R.calculatedIntersection&&L!==j&&(R.hasBezier||R.hasUnbundled)){R.calculatedIntersection=!0;var Se=z.intersectLine(O.x,O.y,V,J,B.x,B.y,0,ne,H),be=R.srcIntn=Se,de=W.intersectLine(B.x,B.y,q,$,O.x,O.y,0,X,U),xe=R.tgtIntn=de,fe=R.intersectionPts={x1:Se[0],x2:de[0],y1:Se[1],y2:de[1]},we=R.posPts={x1:O.x,x2:B.x,y1:O.y,y2:B.y},Ce=de[1]-Se[1],Ne=de[0]-Se[0],De=Math.sqrt(Ne*Ne+Ce*Ce);le(De)&&De>=g$||(De=Math.sqrt(Math.max(Ne*Ne,Vo)+Math.max(Ce*Ce,Vo)));var $e=R.vector={x:Ne,y:Ce},je=R.vectorNorm={x:$e.x/De,y:$e.y/De},Oe={x:-je.y,y:je.x};R.nodesOverlap=!le(De)||W.checkPoint(Se[0],Se[1],0,q,$,B.x,B.y,X,U)||z.checkPoint(de[0],de[1],0,V,J,O.x,O.y,ne,H),R.vectorNormInverse=Oe,I={nodesOverlap:R.nodesOverlap,dirCounts:R.dirCounts,calculatedIntersection:!0,hasBezier:R.hasBezier,hasUnbundled:R.hasUnbundled,eles:R.eles,srcPos:B,srcRs:U,tgtPos:O,tgtRs:H,srcW:q,srcH:$,tgtW:V,tgtH:J,srcIntn:xe,tgtIntn:be,srcShape:W,tgtShape:z,posPts:{x1:we.x2,y1:we.y2,x2:we.x1,y2:we.y1},intersectionPts:{x1:fe.x2,y1:fe.y2,x2:fe.x1,y2:fe.y1},vector:{x:-$e.x,y:-$e.y},vectorNorm:{x:-je.x,y:-je.y},vectorNormInverse:{x:-Oe.x,y:-Oe.y}}}var te=ue?I:R;ie.nodesOverlap=te.nodesOverlap,ie.srcIntn=te.srcIntn,ie.tgtIntn=te.tgtIntn,ie.isRound=oe.startsWith("round"),a&&(L.isParent()||L.isChild()||j.isParent()||j.isChild())&&(L.parents().anySame(j)||j.parents().anySame(L)||L.same(j)&&L.isParent())?e.findCompoundLoopPoints(ee,te,Y,Re):L===j?e.findLoopPoints(ee,te,Y,Re):oe.endsWith("segments")?e.findSegmentsPoints(ee,te):oe.endsWith("taxi")?e.findTaxiPoints(ee,te):oe==="straight"||!Re&&R.eles.length%2===1&&Y===Math.floor(R.eles.length/2)?e.findStraightEdgePoints(ee):e.findBezierPoints(ee,te,Y,Re,ue),e.findEndpoints(ee),e.tryToCorrectInvalidPoints(ee,te),e.checkForInvalidEdgeWarning(ee),e.storeAllpts(ee),e.storeEdgeProjections(ee),e.calculateArrowAngles(ee),e.recalculateEdgeLabelProjections(ee),e.calculateLabelAngles(ee)}},C=0;C<o.length;C++)S();this.findHaystackPoints(l)}};function ZA(t){var e=[];if(t!=null){for(var r=0;r<t.length;r+=2){var n=t[r],a=t[r+1];e.push({x:n,y:a})}return e}}nr.getSegmentPoints=function(t){var e=t[0]._private.rscratch;this.recalculateRenderedStyle(t);var r=e.edgeType;if(r==="segments")return ZA(e.segpts)};nr.getControlPoints=function(t){var e=t[0]._private.rscratch;this.recalculateRenderedStyle(t);var r=e.edgeType;if(r==="bezier"||r==="multibezier"||r==="self"||r==="compound")return ZA(e.ctrlpts)};nr.getEdgeMidpoint=function(t){var e=t[0]._private.rscratch;return this.recalculateRenderedStyle(t),{x:e.midX,y:e.midY}};var sl={};sl.manualEndptToPx=function(t,e){var r=this,n=t.position(),a=t.outerWidth(),i=t.outerHeight(),s=t._private.rscratch;if(e.value.length===2){var o=[e.pfValue[0],e.pfValue[1]];return e.units[0]==="%"&&(o[0]=o[0]*a),e.units[1]==="%"&&(o[1]=o[1]*i),o[0]+=n.x,o[1]+=n.y,o}else{var l=e.pfValue[0];l=-Math.PI/2+l;var u=2*Math.max(a,i),c=[n.x+Math.cos(l)*u,n.y+Math.sin(l)*u];return r.nodeShapes[this.getNodeShape(t)].intersectLine(n.x,n.y,a,i,c[0],c[1],0,t.pstyle("corner-radius").value==="auto"?"auto":t.pstyle("corner-radius").pfValue,s)}};sl.findEndpoints=function(t){var e,r,n,a,i=this,s,o=t.source()[0],l=t.target()[0],u=o.position(),c=l.position(),d=t.pstyle("target-arrow-shape").value,f=t.pstyle("source-arrow-shape").value,h=t.pstyle("target-distance-from-node").pfValue,v=t.pstyle("source-distance-from-node").pfValue,x=o._private.rscratch,b=l._private.rscratch,m=t.pstyle("curve-style").value,p=t._private.rscratch,y=p.edgeType,w=na(m,"taxi"),E=y==="self"||y==="compound",S=y==="bezier"||y==="multibezier"||E,C=y!=="bezier",k=y==="straight"||y==="segments",T=y==="segments",_=S||C||k,N=E||w,P=t.pstyle("source-endpoint"),R=N?"outside-to-node":P.value,I=o.pstyle("corner-radius").value==="auto"?"auto":o.pstyle("corner-radius").pfValue,M=t.pstyle("target-endpoint"),D=N?"outside-to-node":M.value,L=l.pstyle("corner-radius").value==="auto"?"auto":l.pstyle("corner-radius").pfValue;p.srcManEndpt=P,p.tgtManEndpt=M;var j,F,O,B,V=(e=(M==null||(r=M.pfValue)===null||r===void 0?void 0:r.length)===2?M.pfValue:null)!==null&&e!==void 0?e:[0,0],J=(n=(P==null||(a=P.pfValue)===null||a===void 0?void 0:a.length)===2?P.pfValue:null)!==null&&n!==void 0?n:[0,0];if(S){var q=[p.ctrlpts[0],p.ctrlpts[1]],$=C?[p.ctrlpts[p.ctrlpts.length-2],p.ctrlpts[p.ctrlpts.length-1]]:q;j=$,F=q}else if(k){var z=T?p.segpts.slice(0,2):[c.x+V[0],c.y+V[1]],W=T?p.segpts.slice(p.segpts.length-2):[u.x+J[0],u.y+J[1]];j=W,F=z}if(D==="inside-to-node")s=[c.x,c.y];else if(M.units)s=this.manualEndptToPx(l,M);else if(D==="outside-to-line")s=p.tgtIntn;else if(D==="outside-to-node"||D==="outside-to-node-or-label"?O=j:(D==="outside-to-line"||D==="outside-to-line-or-label")&&(O=[u.x,u.y]),s=i.nodeShapes[this.getNodeShape(l)].intersectLine(c.x,c.y,l.outerWidth(),l.outerHeight(),O[0],O[1],0,L,b),D==="outside-to-node-or-label"||D==="outside-to-line-or-label"){var ne=l._private.rscratch,X=ne.labelWidth,U=ne.labelHeight,H=ne.labelX,Y=ne.labelY,ee=X/2,ie=U/2,oe=l.pstyle("text-valign").value;oe==="top"?Y-=ie:oe==="bottom"&&(Y+=ie);var Re=l.pstyle("text-halign").value;Re==="left"?H-=ee:Re==="right"&&(H+=ee);var ue=Oo(O[0],O[1],[H-ee,Y-ie,H+ee,Y-ie,H+ee,Y+ie,H-ee,Y+ie],c.x,c.y);if(ue.length>0){var Se=u,be=qa(Se,Oi(s)),de=qa(Se,Oi(ue)),xe=be;if(de<be&&(s=ue,xe=de),ue.length>2){var fe=qa(Se,{x:ue[2],y:ue[3]});fe<xe&&(s=[ue[2],ue[3]])}}}var we=Fl(s,j,i.arrowShapes[d].spacing(t)+h),Ce=Fl(s,j,i.arrowShapes[d].gap(t)+h);if(p.endX=Ce[0],p.endY=Ce[1],p.arrowEndX=we[0],p.arrowEndY=we[1],R==="inside-to-node")s=[u.x,u.y];else if(P.units)s=this.manualEndptToPx(o,P);else if(R==="outside-to-line")s=p.srcIntn;else if(R==="outside-to-node"||R==="outside-to-node-or-label"?B=F:(R==="outside-to-line"||R==="outside-to-line-or-label")&&(B=[c.x,c.y]),s=i.nodeShapes[this.getNodeShape(o)].intersectLine(u.x,u.y,o.outerWidth(),o.outerHeight(),B[0],B[1],0,I,x),R==="outside-to-node-or-label"||R==="outside-to-line-or-label"){var Ne=o._private.rscratch,De=Ne.labelWidth,$e=Ne.labelHeight,je=Ne.labelX,Oe=Ne.labelY,te=De/2,A=$e/2,G=o.pstyle("text-valign").value;G==="top"?Oe-=A:G==="bottom"&&(Oe+=A);var K=o.pstyle("text-halign").value;K==="left"?je-=te:K==="right"&&(je+=te);var Q=Oo(B[0],B[1],[je-te,Oe-A,je+te,Oe-A,je+te,Oe+A,je-te,Oe+A],u.x,u.y);if(Q.length>0){var re=c,me=qa(re,Oi(s)),ae=qa(re,Oi(Q)),ce=me;if(ae<me&&(s=[Q[0],Q[1]],ce=ae),Q.length>2){var ve=qa(re,{x:Q[2],y:Q[3]});ve<ce&&(s=[Q[2],Q[3]])}}}var ke=Fl(s,F,i.arrowShapes[f].spacing(t)+v),_e=Fl(s,F,i.arrowShapes[f].gap(t)+v);p.startX=_e[0],p.startY=_e[1],p.arrowStartX=ke[0],p.arrowStartY=ke[1],_&&(!le(p.startX)||!le(p.startY)||!le(p.endX)||!le(p.endY)?p.badLine=!0:p.badLine=!1)};sl.getSourceEndpoint=function(t){var e=t[0]._private.rscratch;switch(this.recalculateRenderedStyle(t),e.edgeType){case"haystack":return{x:e.haystackPts[0],y:e.haystackPts[1]};default:return{x:e.arrowStartX,y:e.arrowStartY}}};sl.getTargetEndpoint=function(t){var e=t[0]._private.rscratch;switch(this.recalculateRenderedStyle(t),e.edgeType){case"haystack":return{x:e.haystackPts[2],y:e.haystackPts[3]};default:return{x:e.arrowEndX,y:e.arrowEndY}}};var y1={};function m$(t,e,r){for(var n=function(u,c,d,f){return Bt(u,c,d,f)},a=e._private,i=a.rstyle.bezierPts,s=0;s<t.bezierProjPcts.length;s++){var o=t.bezierProjPcts[s];i.push({x:n(r[0],r[2],r[4],o),y:n(r[1],r[3],r[5],o)})}}y1.storeEdgeProjections=function(t){var e=t._private,r=e.rscratch,n=r.edgeType;if(e.rstyle.bezierPts=null,e.rstyle.linePts=null,e.rstyle.haystackPts=null,n==="multibezier"||n==="bezier"||n==="self"||n==="compound"){e.rstyle.bezierPts=[];for(var a=0;a+5<r.allpts.length;a+=4)m$(this,t,r.allpts.slice(a,a+6))}else if(n==="segments")for(var i=e.rstyle.linePts=[],a=0;a+1<r.allpts.length;a+=2)i.push({x:r.allpts[a],y:r.allpts[a+1]});else if(n==="haystack"){var s=r.haystackPts;e.rstyle.haystackPts=[{x:s[0],y:s[1]},{x:s[2],y:s[3]}]}e.rstyle.arrowWidth=this.getArrowWidth(t.pstyle("width").pfValue,t.pstyle("arrow-scale").value)*this.arrowShapeWidth};y1.recalculateEdgeProjections=function(t){this.findEdgeControlPoints(t)};var xn={};xn.recalculateNodeLabelProjection=function(t){var e=t.pstyle("label").strValue;if(!ya(e)){var r,n,a=t._private,i=t.width(),s=t.height(),o=t.padding(),l=t.position(),u=t.pstyle("text-halign").strValue,c=t.pstyle("text-valign").strValue,d=a.rscratch,f=a.rstyle;switch(u){case"left":r=l.x-i/2-o;break;case"right":r=l.x+i/2+o;break;default:r=l.x}switch(c){case"top":n=l.y-s/2-o;break;case"bottom":n=l.y+s/2+o;break;default:n=l.y}d.labelX=r,d.labelY=n,f.labelX=r,f.labelY=n,this.calculateLabelAngles(t),this.applyLabelDimensions(t)}};var QA=function(e,r){var n=Math.atan(r/e);return e===0&&n<0&&(n=n*-1),n},JA=function(e,r){var n=r.x-e.x,a=r.y-e.y;return QA(n,a)},y$=function(e,r,n,a){var i=Bo(0,a-.001,1),s=Bo(0,a+.001,1),o=Ki(e,r,n,i),l=Ki(e,r,n,s);return JA(o,l)};xn.recalculateEdgeLabelProjections=function(t){var e,r=t._private,n=r.rscratch,a=this,i={mid:t.pstyle("label").strValue,source:t.pstyle("source-label").strValue,target:t.pstyle("target-label").strValue};if(i.mid||i.source||i.target){e={x:n.midX,y:n.midY};var s=function(d,f,h){_n(r.rscratch,d,f,h),_n(r.rstyle,d,f,h)};s("labelX",null,e.x),s("labelY",null,e.y);var o=QA(n.midDispX,n.midDispY);s("labelAutoAngle",null,o);var l=function(){if(l.cache)return l.cache;for(var d=[],f=0;f+5<n.allpts.length;f+=4){var h={x:n.allpts[f],y:n.allpts[f+1]},v={x:n.allpts[f+2],y:n.allpts[f+3]},x={x:n.allpts[f+4],y:n.allpts[f+5]};d.push({p0:h,p1:v,p2:x,startDist:0,length:0,segments:[]})}var b=r.rstyle.bezierPts,m=a.bezierProjPcts.length;function p(C,k,T,_,N){var P=ai(k,T),R=C.segments[C.segments.length-1],I={p0:k,p1:T,t0:_,t1:N,startDist:R?R.startDist+R.length:0,length:P};C.segments.push(I),C.length+=P}for(var y=0;y<d.length;y++){var w=d[y],E=d[y-1];E&&(w.startDist=E.startDist+E.length),p(w,w.p0,b[y*m],0,a.bezierProjPcts[0]);for(var S=0;S<m-1;S++)p(w,b[y*m+S],b[y*m+S+1],a.bezierProjPcts[S],a.bezierProjPcts[S+1]);p(w,b[y*m+m-1],w.p2,a.bezierProjPcts[m-1],1)}return l.cache=d},u=function(d){var f,h=d==="source";if(i[d]){var v=t.pstyle(d+"-text-offset").pfValue;switch(n.edgeType){case"self":case"compound":case"bezier":case"multibezier":{for(var x=l(),b,m=0,p=0,y=0;y<x.length;y++){for(var w=x[h?y:x.length-1-y],E=0;E<w.segments.length;E++){var S=w.segments[h?E:w.segments.length-1-E],C=y===x.length-1&&E===w.segments.length-1;if(m=p,p+=S.length,p>=v||C){b={cp:w,segment:S};break}}if(b)break}var k=b.cp,T=b.segment,_=(v-m)/T.length,N=T.t1-T.t0,P=h?T.t0+N*_:T.t1-N*_;P=Bo(0,P,1),e=Ki(k.p0,k.p1,k.p2,P),f=y$(k.p0,k.p1,k.p2,P);break}case"straight":case"segments":case"haystack":{for(var R=0,I,M,D,L,j=n.allpts.length,F=0;F+3<j&&(h?(D={x:n.allpts[F],y:n.allpts[F+1]},L={x:n.allpts[F+2],y:n.allpts[F+3]}):(D={x:n.allpts[j-2-F],y:n.allpts[j-1-F]},L={x:n.allpts[j-4-F],y:n.allpts[j-3-F]}),I=ai(D,L),M=R,R+=I,!(R>=v));F+=2);var O=v-M,B=O/I;B=Bo(0,B,1),e=FO(D,L,B),f=JA(D,L);break}}s("labelX",d,e.x),s("labelY",d,e.y),s("labelAutoAngle",d,f)}};u("source"),u("target"),this.applyLabelDimensions(t)}};xn.applyLabelDimensions=function(t){this.applyPrefixedLabelDimensions(t),t.isEdge()&&(this.applyPrefixedLabelDimensions(t,"source"),this.applyPrefixedLabelDimensions(t,"target"))};xn.applyPrefixedLabelDimensions=function(t,e){var r=t._private,n=this.getLabelText(t,e),a=ni(n,t._private.labelDimsKey);if(pr(r.rscratch,"prefixedLabelDimsKey",e)!==a){_n(r.rscratch,"prefixedLabelDimsKey",e,a);var i=this.calculateLabelDimensions(t,n),s=t.pstyle("line-height").pfValue,o=t.pstyle("text-wrap").strValue,l=pr(r.rscratch,"labelWrapCachedLines",e)||[],u=o!=="wrap"?1:Math.max(l.length,1),c=i.height/u,d=c*s,f=i.width,h=i.height+(u-1)*(s-1)*c;_n(r.rstyle,"labelWidth",e,f),_n(r.rscratch,"labelWidth",e,f),_n(r.rstyle,"labelHeight",e,h),_n(r.rscratch,"labelHeight",e,h),_n(r.rscratch,"labelLineHeight",e,d)}};xn.getLabelText=function(t,e){var r=t._private,n=e?e+"-":"",a=t.pstyle(n+"label").strValue,i=t.pstyle("text-transform").value,s=function(J,q){return q?(_n(r.rscratch,J,e,q),q):pr(r.rscratch,J,e)};if(!a)return"";i=="none"||(i=="uppercase"?a=a.toUpperCase():i=="lowercase"&&(a=a.toLowerCase()));var o=t.pstyle("text-wrap").value;if(o==="wrap"){var l=s("labelKey");if(l!=null&&s("labelWrapKey")===l)return s("labelWrapCachedText");for(var u="",c=a.split(`
|
|
54
|
+
`),d=t.pstyle("text-max-width").pfValue,f=t.pstyle("text-overflow-wrap").value,h=f==="anywhere",v=[],x=/[\s\u200b]+|$/g,b=0;b<c.length;b++){var m=c[b],p=this.calculateLabelDimensions(t,m),y=p.width;if(h){var w=m.split("").join(u);m=w}if(y>d){var E=m.matchAll(x),S="",C=0,k=xr(E),T;try{for(k.s();!(T=k.n()).done;){var _=T.value,N=_[0],P=m.substring(C,_.index);C=_.index+N.length;var R=S.length===0?P:S+P+N,I=this.calculateLabelDimensions(t,R),M=I.width;M<=d?S+=P+N:(S&&v.push(S),S=P+N)}}catch(V){k.e(V)}finally{k.f()}S.match(/^[\s\u200b]+$/)||v.push(S)}else v.push(m)}s("labelWrapCachedLines",v),a=s("labelWrapCachedText",v.join(`
|
|
55
|
+
`)),s("labelWrapKey",l)}else if(o==="ellipsis"){var D=t.pstyle("text-max-width").pfValue,L="",j="…",F=!1;if(this.calculateLabelDimensions(t,a).width<D)return a;for(var O=0;O<a.length;O++){var B=this.calculateLabelDimensions(t,L+a[O]+j).width;if(B>D)break;L+=a[O],O===a.length-1&&(F=!0)}return F||(L+=j),L}return a};xn.getLabelJustification=function(t){var e=t.pstyle("text-justification").strValue,r=t.pstyle("text-halign").strValue;if(e==="auto")if(t.isNode())switch(r){case"left":return"right";case"right":return"left";default:return"center"}else return"center";else return e};xn.calculateLabelDimensions=function(t,e){var r=this,n=r.cy.window(),a=n.document,i=0,s=t.pstyle("font-style").strValue,o=t.pstyle("font-size").pfValue,l=t.pstyle("font-family").strValue,u=t.pstyle("font-weight").strValue,c=this.labelCalcCanvas,d=this.labelCalcCanvasContext;if(!c){c=this.labelCalcCanvas=a.createElement("canvas"),d=this.labelCalcCanvasContext=c.getContext("2d");var f=c.style;f.position="absolute",f.left="-9999px",f.top="-9999px",f.zIndex="-1",f.visibility="hidden",f.pointerEvents="none"}d.font="".concat(s," ").concat(u," ").concat(o,"px ").concat(l);for(var h=0,v=0,x=e.split(`
|
|
56
|
+
`),b=0;b<x.length;b++){var m=x[b],p=d.measureText(m),y=Math.ceil(p.width),w=o;h=Math.max(y,h),v+=w}return h+=i,v+=i,{width:h,height:v}};xn.calculateLabelAngle=function(t,e){var r=t._private,n=r.rscratch,a=t.isEdge(),i=e?e+"-":"",s=t.pstyle(i+"text-rotation"),o=s.strValue;return o==="none"?0:a&&o==="autorotate"?n.labelAutoAngle:o==="autorotate"?0:s.pfValue};xn.calculateLabelAngles=function(t){var e=this,r=t.isEdge(),n=t._private,a=n.rscratch;a.labelAngle=e.calculateLabelAngle(t),r&&(a.sourceLabelAngle=e.calculateLabelAngle(t,"source"),a.targetLabelAngle=e.calculateLabelAngle(t,"target"))};var ej={},pE=28,gE=!1;ej.getNodeShape=function(t){var e=this,r=t.pstyle("shape").value;if(r==="cutrectangle"&&(t.width()<pE||t.height()<pE))return gE||(Ye("The `cutrectangle` node shape can not be used at small sizes so `rectangle` is used instead"),gE=!0),"rectangle";if(t.isParent())return r==="rectangle"||r==="roundrectangle"||r==="round-rectangle"||r==="cutrectangle"||r==="cut-rectangle"||r==="barrel"?r:"rectangle";if(r==="polygon"){var n=t.pstyle("shape-polygon-points").value;return e.nodeShapes.makePolygon(n).name}return r};var Vc={};Vc.registerCalculationListeners=function(){var t=this.cy,e=t.collection(),r=this,n=function(s){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e.merge(s),o)for(var l=0;l<s.length;l++){var u=s[l],c=u._private,d=c.rstyle;d.clean=!1,d.cleanConnected=!1}};r.binder(t).on("bounds.* dirty.*",function(s){var o=s.target;n(o)}).on("style.* background.*",function(s){var o=s.target;n(o,!1)});var a=function(s){if(s){var o=r.onUpdateEleCalcsFns;e.cleanStyle();for(var l=0;l<e.length;l++){var u=e[l],c=u._private.rstyle;u.isNode()&&!c.cleanConnected&&(n(u.connectedEdges()),c.cleanConnected=!0)}if(o)for(var d=0;d<o.length;d++){var f=o[d];f(s,e)}r.recalculateRenderedStyle(e),e=t.collection()}};r.flushRenderedStyleQueue=function(){a(!0)},r.beforeRender(a,r.beforeRenderPriorities.eleCalcs)};Vc.onUpdateEleCalcs=function(t){var e=this.onUpdateEleCalcsFns=this.onUpdateEleCalcsFns||[];e.push(t)};Vc.recalculateRenderedStyle=function(t,e){var r=function(w){return w._private.rstyle.cleanConnected};if(t.length!==0){var n=[],a=[];if(!this.destroyed){e===void 0&&(e=!0);for(var i=0;i<t.length;i++){var s=t[i],o=s._private,l=o.rstyle;s.isEdge()&&(!r(s.source())||!r(s.target()))&&(l.clean=!1),s.isEdge()&&s.isBundledBezier()&&s.parallelEdges().some(function(y){return!y._private.rstyle.clean&&y.isBundledBezier()})&&(l.clean=!1),!(e&&l.clean||s.removed())&&s.pstyle("display").value!=="none"&&(o.group==="nodes"?a.push(s):n.push(s),l.clean=!0)}for(var u=0;u<a.length;u++){var c=a[u],d=c._private,f=d.rstyle,h=c.position();this.recalculateNodeLabelProjection(c),f.nodeX=h.x,f.nodeY=h.y,f.nodeW=c.pstyle("width").pfValue,f.nodeH=c.pstyle("height").pfValue}this.recalculateEdgeProjections(n);for(var v=0;v<n.length;v++){var x=n[v],b=x._private,m=b.rstyle,p=b.rscratch;m.srcX=p.arrowStartX,m.srcY=p.arrowStartY,m.tgtX=p.arrowEndX,m.tgtY=p.arrowEndY,m.midX=p.midX,m.midY=p.midY,m.labelAngle=p.labelAngle,m.sourceLabelAngle=p.sourceLabelAngle,m.targetLabelAngle=p.targetLabelAngle}}}};var Uc={};Uc.updateCachedGrabbedEles=function(){var t=this.cachedZSortedEles;if(t){t.drag=[],t.nondrag=[];for(var e=[],r=0;r<t.length;r++){var n=t[r],a=n._private.rscratch;n.grabbed()&&!n.isParent()?e.push(n):a.inDragLayer?t.drag.push(n):t.nondrag.push(n)}for(var r=0;r<e.length;r++){var n=e[r];t.drag.push(n)}}};Uc.invalidateCachedZSortedEles=function(){this.cachedZSortedEles=null};Uc.getCachedZSortedEles=function(t){if(t||!this.cachedZSortedEles){var e=this.cy.mutableElements().toArray();e.sort(DA),e.interactive=e.filter(function(r){return r.interactive()}),this.cachedZSortedEles=e,this.updateCachedGrabbedEles()}else e=this.cachedZSortedEles;return e};var tj={};[ci,ac,nr,sl,y1,xn,ej,Vc,Uc].forEach(function(t){Te(tj,t)});var rj={};rj.getCachedImage=function(t,e,r){var n=this,a=n.imageCache=n.imageCache||{},i=a[t];if(i)return i.image.complete||i.image.addEventListener("load",r),i.image;i=a[t]=a[t]||{};var s=i.image=new Image;s.addEventListener("load",r),s.addEventListener("error",function(){s.error=!0});var o="data:",l=t.substring(0,o.length).toLowerCase()===o;return l||(e=e==="null"?null:e,s.crossOrigin=e),s.src=t,s};var nj=function(e,r){var n=e[0];!n||n._private.grabbed===r||(n._private.grabbed=r,e.updateStyle(!1))},x$=function(e){nj(e,!0)},b$=function(e){nj(e,!1)},ms={};ms.registerBinding=function(t,e,r,n){var a=Array.prototype.slice.apply(arguments,[1]);if(Array.isArray(t)){for(var i=[],s=0;s<t.length;s++){var o=t[s];if(o!==void 0){var l=this.binder(o);i.push(l.on.apply(l,a))}}return i}var l=this.binder(t);return l.on.apply(l,a)};ms.binder=function(t){var e=this,r=e.cy.window(),n=t===r||t===r.document||t===r.document.body||PB(t);if(e.supportsPassiveEvents==null){var a=!1;try{var i=Object.defineProperty({},"passive",{get:function(){return a=!0,!0}});r.addEventListener("test",null,i)}catch{}e.supportsPassiveEvents=a}var s=function(l,u,c){var d=Array.prototype.slice.call(arguments);return n&&e.supportsPassiveEvents&&(d[2]={capture:c??!1,passive:!1,once:!1}),e.bindings.push({target:t,args:d}),(t.addEventListener||t.on).apply(t,d),this};return{on:s,addEventListener:s,addListener:s,bind:s}};ms.nodeIsDraggable=function(t){return t&&t.isNode()&&!t.locked()&&t.grabbable()};ms.nodeIsGrabbable=function(t){return this.nodeIsDraggable(t)&&t.interactive()};ms.load=function(){var t=this,e=t.cy.window(),r=function(A){return A.selected()},n=function(A){var G=A.getRootNode();if(G&&G.nodeType===11&&G.host!==void 0)return G},a=function(A,G,K,Q){A==null&&(A=t.cy);for(var re=0;re<G.length;re++){var me=G[re];A.emit({originalEvent:K,type:me,position:Q})}},i=function(A){return A.shiftKey||A.metaKey||A.ctrlKey},s=function(A,G){var K=!0;if(t.cy.hasCompoundNodes()&&A&&A.pannable())for(var Q=0;G&&Q<G.length;Q++){var A=G[Q];if(A.isNode()&&A.isParent()&&!A.pannable()){K=!1;break}}else K=!0;return K},o=function(A){A[0]._private.rscratch.inDragLayer=!0},l=function(A){A[0]._private.rscratch.inDragLayer=!1},u=function(A){A[0]._private.rscratch.isGrabTarget=!0},c=function(A){A[0]._private.rscratch.isGrabTarget=!1},d=function(A,G){var K=G.addToList,Q=K.has(A);!Q&&A.grabbable()&&!A.locked()&&(K.merge(A),x$(A))},f=function(A,G){if(A.cy().hasCompoundNodes()&&!(G.inDragLayer==null&&G.addToList==null)){var K=A.descendants();G.inDragLayer&&(K.forEach(o),K.connectedEdges().forEach(o)),G.addToList&&d(K,G)}},h=function(A,G){G=G||{};var K=A.cy().hasCompoundNodes();G.inDragLayer&&(A.forEach(o),A.neighborhood().stdFilter(function(Q){return!K||Q.isEdge()}).forEach(o)),G.addToList&&A.forEach(function(Q){d(Q,G)}),f(A,G),b(A,{inDragLayer:G.inDragLayer}),t.updateCachedGrabbedEles()},v=h,x=function(A){A&&(t.getCachedZSortedEles().forEach(function(G){b$(G),l(G),c(G)}),t.updateCachedGrabbedEles())},b=function(A,G){if(!(G.inDragLayer==null&&G.addToList==null)&&A.cy().hasCompoundNodes()){var K=A.ancestors().orphans();if(!K.same(A)){var Q=K.descendants().spawnSelf().merge(K).unmerge(A).unmerge(A.descendants()),re=Q.connectedEdges();G.inDragLayer&&(re.forEach(o),Q.forEach(o)),G.addToList&&Q.forEach(function(me){d(me,G)})}}},m=function(){document.activeElement!=null&&document.activeElement.blur!=null&&document.activeElement.blur()},p=typeof MutationObserver<"u",y=typeof ResizeObserver<"u";p?(t.removeObserver=new MutationObserver(function(te){for(var A=0;A<te.length;A++){var G=te[A],K=G.removedNodes;if(K)for(var Q=0;Q<K.length;Q++){var re=K[Q];if(re===t.container){t.destroy();break}}}}),t.container.parentNode&&t.removeObserver.observe(t.container.parentNode,{childList:!0})):t.registerBinding(t.container,"DOMNodeRemoved",function(te){t.destroy()});var w=rl(function(){t.cy.resize()},100);p&&(t.styleObserver=new MutationObserver(w),t.styleObserver.observe(t.container,{attributes:!0})),t.registerBinding(e,"resize",w),y&&(t.resizeObserver=new ResizeObserver(w),t.resizeObserver.observe(t.container));var E=function(A,G){for(;A!=null;)G(A),A=A.parentNode},S=function(){t.invalidateContainerClientCoordsCache()};E(t.container,function(te){t.registerBinding(te,"transitionend",S),t.registerBinding(te,"animationend",S),t.registerBinding(te,"scroll",S)}),t.registerBinding(t.container,"contextmenu",function(te){te.preventDefault()});var C=function(){return t.selection[4]!==0},k=function(A){for(var G=t.findContainerClientCoords(),K=G[0],Q=G[1],re=G[2],me=G[3],ae=A.touches?A.touches:[A],ce=!1,ve=0;ve<ae.length;ve++){var ke=ae[ve];if(K<=ke.clientX&&ke.clientX<=K+re&&Q<=ke.clientY&&ke.clientY<=Q+me){ce=!0;break}}if(!ce)return!1;for(var _e=t.container,Pe=A.target,ye=Pe.parentNode,Le=!1;ye;){if(ye===_e){Le=!0;break}ye=ye.parentNode}return!!Le};t.registerBinding(t.container,"mousedown",function(A){if(k(A)&&!(t.hoverData.which===1&&A.which!==1)){A.preventDefault(),m(),t.hoverData.capture=!0,t.hoverData.which=A.which;var G=t.cy,K=[A.clientX,A.clientY],Q=t.projectIntoViewport(K[0],K[1]),re=t.selection,me=t.findNearestElements(Q[0],Q[1],!0,!1),ae=me[0],ce=t.dragData.possibleDragElements;t.hoverData.mdownPos=Q,t.hoverData.mdownGPos=K;var ve=function(Fe){return{originalEvent:A,type:Fe,position:{x:Q[0],y:Q[1]}}},ke=function(){t.hoverData.tapholdCancelled=!1,clearTimeout(t.hoverData.tapholdTimeout),t.hoverData.tapholdTimeout=setTimeout(function(){if(!t.hoverData.tapholdCancelled){var Fe=t.hoverData.down;Fe?Fe.emit(ve("taphold")):G.emit(ve("taphold"))}},t.tapholdDuration)};if(A.which==3){t.hoverData.cxtStarted=!0;var _e={originalEvent:A,type:"cxttapstart",position:{x:Q[0],y:Q[1]}};ae?(ae.activate(),ae.emit(_e),t.hoverData.down=ae):G.emit(_e),t.hoverData.downTime=new Date().getTime(),t.hoverData.cxtDragged=!1}else if(A.which==1){ae&&ae.activate();{if(ae!=null&&t.nodeIsGrabbable(ae)){var Pe=function(Fe){Fe.emit(ve("grab"))};if(u(ae),!ae.selected())ce=t.dragData.possibleDragElements=G.collection(),v(ae,{addToList:ce}),ae.emit(ve("grabon")).emit(ve("grab"));else{ce=t.dragData.possibleDragElements=G.collection();var ye=G.$(function(Le){return Le.isNode()&&Le.selected()&&t.nodeIsGrabbable(Le)});h(ye,{addToList:ce}),ae.emit(ve("grabon")),ye.forEach(Pe)}t.redrawHint("eles",!0),t.redrawHint("drag",!0)}t.hoverData.down=ae,t.hoverData.downs=me,t.hoverData.downTime=new Date().getTime()}a(ae,["mousedown","tapstart","vmousedown"],A,{x:Q[0],y:Q[1]}),ae==null?(re[4]=1,t.data.bgActivePosistion={x:Q[0],y:Q[1]},t.redrawHint("select",!0),t.redraw()):ae.pannable()&&(re[4]=1),ke()}re[0]=re[2]=Q[0],re[1]=re[3]=Q[1]}},!1);var T=n(t.container);t.registerBinding([e,T],"mousemove",function(A){var G=t.hoverData.capture;if(!(!G&&!k(A))){var K=!1,Q=t.cy,re=Q.zoom(),me=[A.clientX,A.clientY],ae=t.projectIntoViewport(me[0],me[1]),ce=t.hoverData.mdownPos,ve=t.hoverData.mdownGPos,ke=t.selection,_e=null;!t.hoverData.draggingEles&&!t.hoverData.dragging&&!t.hoverData.selecting&&(_e=t.findNearestElement(ae[0],ae[1],!0,!1));var Pe=t.hoverData.last,ye=t.hoverData.down,Le=[ae[0]-ke[2],ae[1]-ke[3]],Fe=t.dragData.possibleDragElements,Dt;if(ve){var yt=me[0]-ve[0],Vr=yt*yt,xt=me[1]-ve[1],Et=xt*xt,Nt=Vr+Et;t.hoverData.isOverThresholdDrag=Dt=Nt>=t.desktopTapThreshold2}var zt=i(A);Dt&&(t.hoverData.tapholdCancelled=!0);var sn=function(){var Ar=t.hoverData.dragDelta=t.hoverData.dragDelta||[];Ar.length===0?(Ar.push(Le[0]),Ar.push(Le[1])):(Ar[0]+=Le[0],Ar[1]+=Le[1])};K=!0,a(_e,["mousemove","vmousemove","tapdrag"],A,{x:ae[0],y:ae[1]});var ft=function(Ar){return{originalEvent:A,type:Ar,position:{x:ae[0],y:ae[1]}}},Sn=function(){t.data.bgActivePosistion=void 0,t.hoverData.selecting||Q.emit(ft("boxstart")),ke[4]=1,t.hoverData.selecting=!0,t.redrawHint("select",!0),t.redraw()};if(t.hoverData.which===3){if(Dt){var Ur=ft("cxtdrag");ye?ye.emit(Ur):Q.emit(Ur),t.hoverData.cxtDragged=!0,(!t.hoverData.cxtOver||_e!==t.hoverData.cxtOver)&&(t.hoverData.cxtOver&&t.hoverData.cxtOver.emit(ft("cxtdragout")),t.hoverData.cxtOver=_e,_e&&_e.emit(ft("cxtdragover")))}}else if(t.hoverData.dragging){if(K=!0,Q.panningEnabled()&&Q.userPanningEnabled()){var Vn;if(t.hoverData.justStartedPan){var hl=t.hoverData.mdownPos;Vn={x:(ae[0]-hl[0])*re,y:(ae[1]-hl[1])*re},t.hoverData.justStartedPan=!1}else Vn={x:Le[0]*re,y:Le[1]*re};Q.panBy(Vn),Q.emit(ft("dragpan")),t.hoverData.dragged=!0}ae=t.projectIntoViewport(A.clientX,A.clientY)}else if(ke[4]==1&&(ye==null||ye.pannable())){if(Dt){if(!t.hoverData.dragging&&Q.boxSelectionEnabled()&&(zt||!Q.panningEnabled()||!Q.userPanningEnabled()))Sn();else if(!t.hoverData.selecting&&Q.panningEnabled()&&Q.userPanningEnabled()){var Ma=s(ye,t.hoverData.downs);Ma&&(t.hoverData.dragging=!0,t.hoverData.justStartedPan=!0,ke[4]=0,t.data.bgActivePosistion=Oi(ce),t.redrawHint("select",!0),t.redraw())}ye&&ye.pannable()&&ye.active()&&ye.unactivate()}}else{if(ye&&ye.pannable()&&ye.active()&&ye.unactivate(),(!ye||!ye.grabbed())&&_e!=Pe&&(Pe&&a(Pe,["mouseout","tapdragout"],A,{x:ae[0],y:ae[1]}),_e&&a(_e,["mouseover","tapdragover"],A,{x:ae[0],y:ae[1]}),t.hoverData.last=_e),ye)if(Dt){if(Q.boxSelectionEnabled()&&zt)ye&&ye.grabbed()&&(x(Fe),ye.emit(ft("freeon")),Fe.emit(ft("free")),t.dragData.didDrag&&(ye.emit(ft("dragfreeon")),Fe.emit(ft("dragfree")))),Sn();else if(ye&&ye.grabbed()&&t.nodeIsDraggable(ye)){var fr=!t.dragData.didDrag;fr&&t.redrawHint("eles",!0),t.dragData.didDrag=!0,t.hoverData.draggingEles||h(Fe,{inDragLayer:!0});var Xt={x:0,y:0};if(le(Le[0])&&le(Le[1])&&(Xt.x+=Le[0],Xt.y+=Le[1],fr)){var vr=t.hoverData.dragDelta;vr&&le(vr[0])&&le(vr[1])&&(Xt.x+=vr[0],Xt.y+=vr[1])}t.hoverData.draggingEles=!0,Fe.silentShift(Xt).emit(ft("position")).emit(ft("drag")),t.redrawHint("drag",!0),t.redraw()}}else sn();K=!0}if(ke[2]=ae[0],ke[3]=ae[1],K)return A.stopPropagation&&A.stopPropagation(),A.preventDefault&&A.preventDefault(),!1}},!1);var _,N,P;t.registerBinding(e,"mouseup",function(A){if(!(t.hoverData.which===1&&A.which!==1&&t.hoverData.capture)){var G=t.hoverData.capture;if(G){t.hoverData.capture=!1;var K=t.cy,Q=t.projectIntoViewport(A.clientX,A.clientY),re=t.selection,me=t.findNearestElement(Q[0],Q[1],!0,!1),ae=t.dragData.possibleDragElements,ce=t.hoverData.down,ve=i(A);t.data.bgActivePosistion&&(t.redrawHint("select",!0),t.redraw()),t.hoverData.tapholdCancelled=!0,t.data.bgActivePosistion=void 0,ce&&ce.unactivate();var ke=function(yt){return{originalEvent:A,type:yt,position:{x:Q[0],y:Q[1]}}};if(t.hoverData.which===3){var _e=ke("cxttapend");if(ce?ce.emit(_e):K.emit(_e),!t.hoverData.cxtDragged){var Pe=ke("cxttap");ce?ce.emit(Pe):K.emit(Pe)}t.hoverData.cxtDragged=!1,t.hoverData.which=null}else if(t.hoverData.which===1){if(a(me,["mouseup","tapend","vmouseup"],A,{x:Q[0],y:Q[1]}),!t.dragData.didDrag&&!t.hoverData.dragged&&!t.hoverData.selecting&&!t.hoverData.isOverThresholdDrag&&(a(ce,["click","tap","vclick"],A,{x:Q[0],y:Q[1]}),N=!1,A.timeStamp-P<=K.multiClickDebounceTime()?(_&&clearTimeout(_),N=!0,P=null,a(ce,["dblclick","dbltap","vdblclick"],A,{x:Q[0],y:Q[1]})):(_=setTimeout(function(){N||a(ce,["oneclick","onetap","voneclick"],A,{x:Q[0],y:Q[1]})},K.multiClickDebounceTime()),P=A.timeStamp)),ce==null&&!t.dragData.didDrag&&!t.hoverData.selecting&&!t.hoverData.dragged&&!i(A)&&(K.$(r).unselect(["tapunselect"]),ae.length>0&&t.redrawHint("eles",!0),t.dragData.possibleDragElements=ae=K.collection()),me==ce&&!t.dragData.didDrag&&!t.hoverData.selecting&&me!=null&&me._private.selectable&&(t.hoverData.dragging||(K.selectionType()==="additive"||ve?me.selected()?me.unselect(["tapunselect"]):me.select(["tapselect"]):ve||(K.$(r).unmerge(me).unselect(["tapunselect"]),me.select(["tapselect"]))),t.redrawHint("eles",!0)),t.hoverData.selecting){var ye=K.collection(t.getAllInBox(re[0],re[1],re[2],re[3]));t.redrawHint("select",!0),ye.length>0&&t.redrawHint("eles",!0),K.emit(ke("boxend"));var Le=function(yt){return yt.selectable()&&!yt.selected()};K.selectionType()==="additive"||ve||K.$(r).unmerge(ye).unselect(),ye.emit(ke("box")).stdFilter(Le).select().emit(ke("boxselect")),t.redraw()}if(t.hoverData.dragging&&(t.hoverData.dragging=!1,t.redrawHint("select",!0),t.redrawHint("eles",!0),t.redraw()),!re[4]){t.redrawHint("drag",!0),t.redrawHint("eles",!0);var Fe=ce&&ce.grabbed();x(ae),Fe&&(ce.emit(ke("freeon")),ae.emit(ke("free")),t.dragData.didDrag&&(ce.emit(ke("dragfreeon")),ae.emit(ke("dragfree"))))}}re[4]=0,t.hoverData.down=null,t.hoverData.cxtStarted=!1,t.hoverData.draggingEles=!1,t.hoverData.selecting=!1,t.hoverData.isOverThresholdDrag=!1,t.dragData.didDrag=!1,t.hoverData.dragged=!1,t.hoverData.dragDelta=[],t.hoverData.mdownPos=null,t.hoverData.mdownGPos=null,t.hoverData.which=null}}},!1);var R=[],I=4,M,D=1e5,L=function(A,G){for(var K=0;K<A.length;K++)if(A[K]%G!==0)return!1;return!0},j=function(A){for(var G=Math.abs(A[0]),K=1;K<A.length;K++)if(Math.abs(A[K])!==G)return!1;return!0},F=function(A){var G=!1,K=A.deltaY;if(K==null&&(A.wheelDeltaY!=null?K=A.wheelDeltaY/4:A.wheelDelta!=null&&(K=A.wheelDelta/4)),K!==0){if(M==null)if(R.length>=I){var Q=R;if(M=L(Q,5),!M){var re=Math.abs(Q[0]);M=j(Q)&&re>5}if(M)for(var me=0;me<Q.length;me++)D=Math.min(Math.abs(Q[me]),D)}else R.push(K),G=!0;else M&&(D=Math.min(Math.abs(K),D));if(!t.scrollingPage){var ae=t.cy,ce=ae.zoom(),ve=ae.pan(),ke=t.projectIntoViewport(A.clientX,A.clientY),_e=[ke[0]*ce+ve.x,ke[1]*ce+ve.y];if(t.hoverData.draggingEles||t.hoverData.dragging||t.hoverData.cxtStarted||C()){A.preventDefault();return}if(ae.panningEnabled()&&ae.userPanningEnabled()&&ae.zoomingEnabled()&&ae.userZoomingEnabled()){A.preventDefault(),t.data.wheelZooming=!0,clearTimeout(t.data.wheelTimeout),t.data.wheelTimeout=setTimeout(function(){t.data.wheelZooming=!1,t.redrawHint("eles",!0),t.redraw()},150);var Pe;G&&Math.abs(K)>5&&(K=a1(K)*5),Pe=K/-250,M&&(Pe/=D,Pe*=3),Pe=Pe*t.wheelSensitivity;var ye=A.deltaMode===1;ye&&(Pe*=33);var Le=ae.zoom()*Math.pow(10,Pe);A.type==="gesturechange"&&(Le=t.gestureStartZoom*A.scale),ae.zoom({level:Le,renderedPosition:{x:_e[0],y:_e[1]}}),ae.emit({type:A.type==="gesturechange"?"pinchzoom":"scrollzoom",originalEvent:A,position:{x:ke[0],y:ke[1]}})}}}};t.registerBinding(t.container,"wheel",F,!0),t.registerBinding(e,"scroll",function(A){t.scrollingPage=!0,clearTimeout(t.scrollingPageTimeout),t.scrollingPageTimeout=setTimeout(function(){t.scrollingPage=!1},250)},!0),t.registerBinding(t.container,"gesturestart",function(A){t.gestureStartZoom=t.cy.zoom(),t.hasTouchStarted||A.preventDefault()},!0),t.registerBinding(t.container,"gesturechange",function(te){t.hasTouchStarted||F(te)},!0),t.registerBinding(t.container,"mouseout",function(A){var G=t.projectIntoViewport(A.clientX,A.clientY);t.cy.emit({originalEvent:A,type:"mouseout",position:{x:G[0],y:G[1]}})},!1),t.registerBinding(t.container,"mouseover",function(A){var G=t.projectIntoViewport(A.clientX,A.clientY);t.cy.emit({originalEvent:A,type:"mouseover",position:{x:G[0],y:G[1]}})},!1);var O,B,V,J,q,$,z,W,ne,X,U,H,Y,ee=function(A,G,K,Q){return Math.sqrt((K-A)*(K-A)+(Q-G)*(Q-G))},ie=function(A,G,K,Q){return(K-A)*(K-A)+(Q-G)*(Q-G)},oe;t.registerBinding(t.container,"touchstart",oe=function(A){if(t.hasTouchStarted=!0,!!k(A)){m(),t.touchData.capture=!0,t.data.bgActivePosistion=void 0;var G=t.cy,K=t.touchData.now,Q=t.touchData.earlier;if(A.touches[0]){var re=t.projectIntoViewport(A.touches[0].clientX,A.touches[0].clientY);K[0]=re[0],K[1]=re[1]}if(A.touches[1]){var re=t.projectIntoViewport(A.touches[1].clientX,A.touches[1].clientY);K[2]=re[0],K[3]=re[1]}if(A.touches[2]){var re=t.projectIntoViewport(A.touches[2].clientX,A.touches[2].clientY);K[4]=re[0],K[5]=re[1]}var me=function(zt){return{originalEvent:A,type:zt,position:{x:K[0],y:K[1]}}};if(A.touches[1]){t.touchData.singleTouchMoved=!0,x(t.dragData.touchDragEles);var ae=t.findContainerClientCoords();ne=ae[0],X=ae[1],U=ae[2],H=ae[3],O=A.touches[0].clientX-ne,B=A.touches[0].clientY-X,V=A.touches[1].clientX-ne,J=A.touches[1].clientY-X,Y=0<=O&&O<=U&&0<=V&&V<=U&&0<=B&&B<=H&&0<=J&&J<=H;var ce=G.pan(),ve=G.zoom();q=ee(O,B,V,J),$=ie(O,B,V,J),z=[(O+V)/2,(B+J)/2],W=[(z[0]-ce.x)/ve,(z[1]-ce.y)/ve];var ke=200,_e=ke*ke;if($<_e&&!A.touches[2]){var Pe=t.findNearestElement(K[0],K[1],!0,!0),ye=t.findNearestElement(K[2],K[3],!0,!0);Pe&&Pe.isNode()?(Pe.activate().emit(me("cxttapstart")),t.touchData.start=Pe):ye&&ye.isNode()?(ye.activate().emit(me("cxttapstart")),t.touchData.start=ye):G.emit(me("cxttapstart")),t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxt=!0,t.touchData.cxtDragged=!1,t.data.bgActivePosistion=void 0,t.redraw();return}}if(A.touches[2])G.boxSelectionEnabled()&&A.preventDefault();else if(!A.touches[1]){if(A.touches[0]){var Le=t.findNearestElements(K[0],K[1],!0,!0),Fe=Le[0];if(Fe!=null&&(Fe.activate(),t.touchData.start=Fe,t.touchData.starts=Le,t.nodeIsGrabbable(Fe))){var Dt=t.dragData.touchDragEles=G.collection(),yt=null;t.redrawHint("eles",!0),t.redrawHint("drag",!0),Fe.selected()?(yt=G.$(function(Nt){return Nt.selected()&&t.nodeIsGrabbable(Nt)}),h(yt,{addToList:Dt})):v(Fe,{addToList:Dt}),u(Fe),Fe.emit(me("grabon")),yt?yt.forEach(function(Nt){Nt.emit(me("grab"))}):Fe.emit(me("grab"))}a(Fe,["touchstart","tapstart","vmousedown"],A,{x:K[0],y:K[1]}),Fe==null&&(t.data.bgActivePosistion={x:re[0],y:re[1]},t.redrawHint("select",!0),t.redraw()),t.touchData.singleTouchMoved=!1,t.touchData.singleTouchStartTime=+new Date,clearTimeout(t.touchData.tapholdTimeout),t.touchData.tapholdTimeout=setTimeout(function(){t.touchData.singleTouchMoved===!1&&!t.pinching&&!t.touchData.selecting&&a(t.touchData.start,["taphold"],A,{x:K[0],y:K[1]})},t.tapholdDuration)}}if(A.touches.length>=1){for(var Vr=t.touchData.startPosition=[null,null,null,null,null,null],xt=0;xt<K.length;xt++)Vr[xt]=Q[xt]=K[xt];var Et=A.touches[0];t.touchData.startGPosition=[Et.clientX,Et.clientY]}}},!1);var Re;t.registerBinding(e,"touchmove",Re=function(A){var G=t.touchData.capture;if(!(!G&&!k(A))){var K=t.selection,Q=t.cy,re=t.touchData.now,me=t.touchData.earlier,ae=Q.zoom();if(A.touches[0]){var ce=t.projectIntoViewport(A.touches[0].clientX,A.touches[0].clientY);re[0]=ce[0],re[1]=ce[1]}if(A.touches[1]){var ce=t.projectIntoViewport(A.touches[1].clientX,A.touches[1].clientY);re[2]=ce[0],re[3]=ce[1]}if(A.touches[2]){var ce=t.projectIntoViewport(A.touches[2].clientX,A.touches[2].clientY);re[4]=ce[0],re[5]=ce[1]}var ve=function(OI){return{originalEvent:A,type:OI,position:{x:re[0],y:re[1]}}},ke=t.touchData.startGPosition,_e;if(G&&A.touches[0]&&ke){for(var Pe=[],ye=0;ye<re.length;ye++)Pe[ye]=re[ye]-me[ye];var Le=A.touches[0].clientX-ke[0],Fe=Le*Le,Dt=A.touches[0].clientY-ke[1],yt=Dt*Dt,Vr=Fe+yt;_e=Vr>=t.touchTapThreshold2}if(G&&t.touchData.cxt){A.preventDefault();var xt=A.touches[0].clientX-ne,Et=A.touches[0].clientY-X,Nt=A.touches[1].clientX-ne,zt=A.touches[1].clientY-X,sn=ie(xt,Et,Nt,zt),ft=sn/$,Sn=150,Ur=Sn*Sn,Vn=1.5,hl=Vn*Vn;if(ft>=hl||sn>=Ur){t.touchData.cxt=!1,t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var Ma=ve("cxttapend");t.touchData.start?(t.touchData.start.unactivate().emit(Ma),t.touchData.start=null):Q.emit(Ma)}}if(G&&t.touchData.cxt){var Ma=ve("cxtdrag");t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.touchData.start?t.touchData.start.emit(Ma):Q.emit(Ma),t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxtDragged=!0;var fr=t.findNearestElement(re[0],re[1],!0,!0);(!t.touchData.cxtOver||fr!==t.touchData.cxtOver)&&(t.touchData.cxtOver&&t.touchData.cxtOver.emit(ve("cxtdragout")),t.touchData.cxtOver=fr,fr&&fr.emit(ve("cxtdragover")))}else if(G&&A.touches[2]&&Q.boxSelectionEnabled())A.preventDefault(),t.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,t.touchData.selecting||Q.emit(ve("boxstart")),t.touchData.selecting=!0,t.touchData.didSelect=!0,K[4]=1,!K||K.length===0||K[0]===void 0?(K[0]=(re[0]+re[2]+re[4])/3,K[1]=(re[1]+re[3]+re[5])/3,K[2]=(re[0]+re[2]+re[4])/3+1,K[3]=(re[1]+re[3]+re[5])/3+1):(K[2]=(re[0]+re[2]+re[4])/3,K[3]=(re[1]+re[3]+re[5])/3),t.redrawHint("select",!0),t.redraw();else if(G&&A.touches[1]&&!t.touchData.didSelect&&Q.zoomingEnabled()&&Q.panningEnabled()&&Q.userZoomingEnabled()&&Q.userPanningEnabled()){A.preventDefault(),t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var Xt=t.dragData.touchDragEles;if(Xt){t.redrawHint("drag",!0);for(var vr=0;vr<Xt.length;vr++){var Cs=Xt[vr]._private;Cs.grabbed=!1,Cs.rscratch.inDragLayer=!1}}var Ar=t.touchData.start,xt=A.touches[0].clientX-ne,Et=A.touches[0].clientY-X,Nt=A.touches[1].clientX-ne,zt=A.touches[1].clientY-X,q1=ee(xt,Et,Nt,zt),RI=q1/q;if(Y){var PI=xt-O,AI=Et-B,jI=Nt-V,II=zt-J,MI=(PI+jI)/2,DI=(AI+II)/2,ks=Q.zoom(),ld=ks*RI,pl=Q.pan(),F1=W[0]*ks+pl.x,$1=W[1]*ks+pl.y,LI={x:-ld/ks*(F1-pl.x-MI)+F1,y:-ld/ks*($1-pl.y-DI)+$1};if(Ar&&Ar.active()){var Xt=t.dragData.touchDragEles;x(Xt),t.redrawHint("drag",!0),t.redrawHint("eles",!0),Ar.unactivate().emit(ve("freeon")),Xt.emit(ve("free")),t.dragData.didDrag&&(Ar.emit(ve("dragfreeon")),Xt.emit(ve("dragfree")))}Q.viewport({zoom:ld,pan:LI,cancelOnFailedZoom:!0}),Q.emit(ve("pinchzoom")),q=q1,O=xt,B=Et,V=Nt,J=zt,t.pinching=!0}if(A.touches[0]){var ce=t.projectIntoViewport(A.touches[0].clientX,A.touches[0].clientY);re[0]=ce[0],re[1]=ce[1]}if(A.touches[1]){var ce=t.projectIntoViewport(A.touches[1].clientX,A.touches[1].clientY);re[2]=ce[0],re[3]=ce[1]}if(A.touches[2]){var ce=t.projectIntoViewport(A.touches[2].clientX,A.touches[2].clientY);re[4]=ce[0],re[5]=ce[1]}}else if(A.touches[0]&&!t.touchData.didSelect){var Gr=t.touchData.start,ud=t.touchData.last,fr;if(!t.hoverData.draggingEles&&!t.swipePanning&&(fr=t.findNearestElement(re[0],re[1],!0,!0)),G&&Gr!=null&&A.preventDefault(),G&&Gr!=null&&t.nodeIsDraggable(Gr))if(_e){var Xt=t.dragData.touchDragEles,z1=!t.dragData.didDrag;z1&&h(Xt,{inDragLayer:!0}),t.dragData.didDrag=!0;var Ts={x:0,y:0};if(le(Pe[0])&&le(Pe[1])&&(Ts.x+=Pe[0],Ts.y+=Pe[1],z1)){t.redrawHint("eles",!0);var Hr=t.touchData.dragDelta;Hr&&le(Hr[0])&&le(Hr[1])&&(Ts.x+=Hr[0],Ts.y+=Hr[1])}t.hoverData.draggingEles=!0,Xt.silentShift(Ts).emit(ve("position")).emit(ve("drag")),t.redrawHint("drag",!0),t.touchData.startPosition[0]==me[0]&&t.touchData.startPosition[1]==me[1]&&t.redrawHint("eles",!0),t.redraw()}else{var Hr=t.touchData.dragDelta=t.touchData.dragDelta||[];Hr.length===0?(Hr.push(Pe[0]),Hr.push(Pe[1])):(Hr[0]+=Pe[0],Hr[1]+=Pe[1])}if(a(Gr||fr,["touchmove","tapdrag","vmousemove"],A,{x:re[0],y:re[1]}),(!Gr||!Gr.grabbed())&&fr!=ud&&(ud&&ud.emit(ve("tapdragout")),fr&&fr.emit(ve("tapdragover"))),t.touchData.last=fr,G)for(var vr=0;vr<re.length;vr++)re[vr]&&t.touchData.startPosition[vr]&&_e&&(t.touchData.singleTouchMoved=!0);if(G&&(Gr==null||Gr.pannable())&&Q.panningEnabled()&&Q.userPanningEnabled()){var BI=s(Gr,t.touchData.starts);BI&&(A.preventDefault(),t.data.bgActivePosistion||(t.data.bgActivePosistion=Oi(t.touchData.startPosition)),t.swipePanning?(Q.panBy({x:Pe[0]*ae,y:Pe[1]*ae}),Q.emit(ve("dragpan"))):_e&&(t.swipePanning=!0,Q.panBy({x:Le*ae,y:Dt*ae}),Q.emit(ve("dragpan")),Gr&&(Gr.unactivate(),t.redrawHint("select",!0),t.touchData.start=null)));var ce=t.projectIntoViewport(A.touches[0].clientX,A.touches[0].clientY);re[0]=ce[0],re[1]=ce[1]}}for(var ye=0;ye<re.length;ye++)me[ye]=re[ye];G&&A.touches.length>0&&!t.hoverData.draggingEles&&!t.swipePanning&&t.data.bgActivePosistion!=null&&(t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.redraw())}},!1);var ue;t.registerBinding(e,"touchcancel",ue=function(A){var G=t.touchData.start;t.touchData.capture=!1,G&&G.unactivate()});var Se,be,de,xe;if(t.registerBinding(e,"touchend",Se=function(A){var G=t.touchData.start,K=t.touchData.capture;if(K)A.touches.length===0&&(t.touchData.capture=!1),A.preventDefault();else return;var Q=t.selection;t.swipePanning=!1,t.hoverData.draggingEles=!1;var re=t.cy,me=re.zoom(),ae=t.touchData.now,ce=t.touchData.earlier;if(A.touches[0]){var ve=t.projectIntoViewport(A.touches[0].clientX,A.touches[0].clientY);ae[0]=ve[0],ae[1]=ve[1]}if(A.touches[1]){var ve=t.projectIntoViewport(A.touches[1].clientX,A.touches[1].clientY);ae[2]=ve[0],ae[3]=ve[1]}if(A.touches[2]){var ve=t.projectIntoViewport(A.touches[2].clientX,A.touches[2].clientY);ae[4]=ve[0],ae[5]=ve[1]}var ke=function(Ur){return{originalEvent:A,type:Ur,position:{x:ae[0],y:ae[1]}}};G&&G.unactivate();var _e;if(t.touchData.cxt){if(_e=ke("cxttapend"),G?G.emit(_e):re.emit(_e),!t.touchData.cxtDragged){var Pe=ke("cxttap");G?G.emit(Pe):re.emit(Pe)}t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxt=!1,t.touchData.start=null,t.redraw();return}if(!A.touches[2]&&re.boxSelectionEnabled()&&t.touchData.selecting){t.touchData.selecting=!1;var ye=re.collection(t.getAllInBox(Q[0],Q[1],Q[2],Q[3]));Q[0]=void 0,Q[1]=void 0,Q[2]=void 0,Q[3]=void 0,Q[4]=0,t.redrawHint("select",!0),re.emit(ke("boxend"));var Le=function(Ur){return Ur.selectable()&&!Ur.selected()};ye.emit(ke("box")).stdFilter(Le).select().emit(ke("boxselect")),ye.nonempty()&&t.redrawHint("eles",!0),t.redraw()}if(G!=null&&G.unactivate(),A.touches[2])t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);else if(!A.touches[1]){if(!A.touches[0]){if(!A.touches[0]){t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var Fe=t.dragData.touchDragEles;if(G!=null){var Dt=G._private.grabbed;x(Fe),t.redrawHint("drag",!0),t.redrawHint("eles",!0),Dt&&(G.emit(ke("freeon")),Fe.emit(ke("free")),t.dragData.didDrag&&(G.emit(ke("dragfreeon")),Fe.emit(ke("dragfree")))),a(G,["touchend","tapend","vmouseup","tapdragout"],A,{x:ae[0],y:ae[1]}),G.unactivate(),t.touchData.start=null}else{var yt=t.findNearestElement(ae[0],ae[1],!0,!0);a(yt,["touchend","tapend","vmouseup","tapdragout"],A,{x:ae[0],y:ae[1]})}var Vr=t.touchData.startPosition[0]-ae[0],xt=Vr*Vr,Et=t.touchData.startPosition[1]-ae[1],Nt=Et*Et,zt=xt+Nt,sn=zt*me*me;t.touchData.singleTouchMoved||(G||re.$(":selected").unselect(["tapunselect"]),a(G,["tap","vclick"],A,{x:ae[0],y:ae[1]}),be=!1,A.timeStamp-xe<=re.multiClickDebounceTime()?(de&&clearTimeout(de),be=!0,xe=null,a(G,["dbltap","vdblclick"],A,{x:ae[0],y:ae[1]})):(de=setTimeout(function(){be||a(G,["onetap","voneclick"],A,{x:ae[0],y:ae[1]})},re.multiClickDebounceTime()),xe=A.timeStamp)),G!=null&&!t.dragData.didDrag&&G._private.selectable&&sn<t.touchTapThreshold2&&!t.pinching&&(re.selectionType()==="single"?(re.$(r).unmerge(G).unselect(["tapunselect"]),G.select(["tapselect"])):G.selected()?G.unselect(["tapunselect"]):G.select(["tapselect"]),t.redrawHint("eles",!0)),t.touchData.singleTouchMoved=!0}}}for(var ft=0;ft<ae.length;ft++)ce[ft]=ae[ft];t.dragData.didDrag=!1,A.touches.length===0&&(t.touchData.dragDelta=[],t.touchData.startPosition=[null,null,null,null,null,null],t.touchData.startGPosition=null,t.touchData.didSelect=!1),A.touches.length<2&&(A.touches.length===1&&(t.touchData.startGPosition=[A.touches[0].clientX,A.touches[0].clientY]),t.pinching=!1,t.redrawHint("eles",!0),t.redraw())},!1),typeof TouchEvent>"u"){var fe=[],we=function(A){return{clientX:A.clientX,clientY:A.clientY,force:1,identifier:A.pointerId,pageX:A.pageX,pageY:A.pageY,radiusX:A.width/2,radiusY:A.height/2,screenX:A.screenX,screenY:A.screenY,target:A.target}},Ce=function(A){return{event:A,touch:we(A)}},Ne=function(A){fe.push(Ce(A))},De=function(A){for(var G=0;G<fe.length;G++){var K=fe[G];if(K.event.pointerId===A.pointerId){fe.splice(G,1);return}}},$e=function(A){var G=fe.filter(function(K){return K.event.pointerId===A.pointerId})[0];G.event=A,G.touch=we(A)},je=function(A){A.touches=fe.map(function(G){return G.touch})},Oe=function(A){return A.pointerType==="mouse"||A.pointerType===4};t.registerBinding(t.container,"pointerdown",function(te){Oe(te)||(te.preventDefault(),Ne(te),je(te),oe(te))}),t.registerBinding(t.container,"pointerup",function(te){Oe(te)||(De(te),je(te),Se(te))}),t.registerBinding(t.container,"pointercancel",function(te){Oe(te)||(De(te),je(te),ue(te))}),t.registerBinding(t.container,"pointermove",function(te){Oe(te)||(te.preventDefault(),$e(te),je(te),Re(te))})}};var qn={};qn.generatePolygon=function(t,e){return this.nodeShapes[t]={renderer:this,name:t,points:e,draw:function(n,a,i,s,o,l){this.renderer.nodeShapeImpl("polygon",n,a,i,s,o,this.points)},intersectLine:function(n,a,i,s,o,l,u,c){return Oo(o,l,this.points,n,a,i/2,s/2,u)},checkPoint:function(n,a,i,s,o,l,u,c){return Bn(n,a,this.points,l,u,s,o,[0,-1],i)},hasMiterBounds:t!=="rectangle",miterBounds:function(n,a,i,s,o,l){return HO(this.points,n,a,i,s,o)}}};qn.generateEllipse=function(){return this.nodeShapes.ellipse={renderer:this,name:"ellipse",draw:function(e,r,n,a,i,s){this.renderer.nodeShapeImpl(this.name,e,r,n,a,i)},intersectLine:function(e,r,n,a,i,s,o,l){return e5(i,s,e,r,n/2+o,a/2+o)},checkPoint:function(e,r,n,a,i,s,o,l){return Ha(e,r,a,i,s,o,n)}}};qn.generateRoundPolygon=function(t,e){return this.nodeShapes[t]={renderer:this,name:t,points:e,getOrCreateCorners:function(n,a,i,s,o,l,u){if(l[u]!==void 0&&l[u+"-cx"]===n&&l[u+"-cy"]===a)return l[u];l[u]=new Array(e.length/2),l[u+"-cx"]=n,l[u+"-cy"]=a;var c=i/2,d=s/2;o=o==="auto"?nA(i,s):o;for(var f=new Array(e.length/2),h=0;h<e.length/2;h++)f[h]={x:n+c*e[h*2],y:a+d*e[h*2+1]};var v,x,b,m,p=f.length;for(x=f[p-1],v=0;v<p;v++)b=f[v%p],m=f[(v+1)%p],l[u][v]=m1(x,b,m,o),x=b,b=m;return l[u]},draw:function(n,a,i,s,o,l,u){this.renderer.nodeShapeImpl("round-polygon",n,a,i,s,o,this.points,this.getOrCreateCorners(a,i,s,o,l,u,"drawCorners"))},intersectLine:function(n,a,i,s,o,l,u,c,d){return r5(o,l,this.points,n,a,i,s,u,this.getOrCreateCorners(n,a,i,s,c,d,"corners"))},checkPoint:function(n,a,i,s,o,l,u,c,d){return JO(n,a,this.points,l,u,s,o,this.getOrCreateCorners(l,u,s,o,c,d,"corners"))}}};qn.generateRoundRectangle=function(){return this.nodeShapes["round-rectangle"]=this.nodeShapes.roundrectangle={renderer:this,name:"round-rectangle",points:ar(4,0),draw:function(e,r,n,a,i,s){this.renderer.nodeShapeImpl(this.name,e,r,n,a,i,this.points,s)},intersectLine:function(e,r,n,a,i,s,o,l){return tA(i,s,e,r,n,a,o,l)},checkPoint:function(e,r,n,a,i,s,o,l){var u=a/2,c=i/2;l=l==="auto"?ba(a,i):l,l=Math.min(u,c,l);var d=l*2;return!!(Bn(e,r,this.points,s,o,a,i-d,[0,-1],n)||Bn(e,r,this.points,s,o,a-d,i,[0,-1],n)||Ha(e,r,d,d,s-u+l,o-c+l,n)||Ha(e,r,d,d,s+u-l,o-c+l,n)||Ha(e,r,d,d,s+u-l,o+c-l,n)||Ha(e,r,d,d,s-u+l,o+c-l,n))}}};qn.generateCutRectangle=function(){return this.nodeShapes["cut-rectangle"]=this.nodeShapes.cutrectangle={renderer:this,name:"cut-rectangle",cornerLength:s1(),points:ar(4,0),draw:function(e,r,n,a,i,s){this.renderer.nodeShapeImpl(this.name,e,r,n,a,i,null,s)},generateCutTrianglePts:function(e,r,n,a,i){var s=i==="auto"?this.cornerLength:i,o=r/2,l=e/2,u=n-l,c=n+l,d=a-o,f=a+o;return{topLeft:[u,d+s,u+s,d,u+s,d+s],topRight:[c-s,d,c,d+s,c-s,d+s],bottomRight:[c,f-s,c-s,f,c-s,f-s],bottomLeft:[u+s,f,u,f-s,u+s,f-s]}},intersectLine:function(e,r,n,a,i,s,o,l){var u=this.generateCutTrianglePts(n+2*o,a+2*o,e,r,l),c=[].concat.apply([],[u.topLeft.splice(0,4),u.topRight.splice(0,4),u.bottomRight.splice(0,4),u.bottomLeft.splice(0,4)]);return Oo(i,s,c,e,r)},checkPoint:function(e,r,n,a,i,s,o,l){var u=l==="auto"?this.cornerLength:l;if(Bn(e,r,this.points,s,o,a,i-2*u,[0,-1],n)||Bn(e,r,this.points,s,o,a-2*u,i,[0,-1],n))return!0;var c=this.generateCutTrianglePts(a,i,s,o);return gr(e,r,c.topLeft)||gr(e,r,c.topRight)||gr(e,r,c.bottomRight)||gr(e,r,c.bottomLeft)}}};qn.generateBarrel=function(){return this.nodeShapes.barrel={renderer:this,name:"barrel",points:ar(4,0),draw:function(e,r,n,a,i,s){this.renderer.nodeShapeImpl(this.name,e,r,n,a,i)},intersectLine:function(e,r,n,a,i,s,o,l){var u=.15,c=.5,d=.85,f=this.generateBarrelBezierPts(n+2*o,a+2*o,e,r),h=function(b){var m=Ki({x:b[0],y:b[1]},{x:b[2],y:b[3]},{x:b[4],y:b[5]},u),p=Ki({x:b[0],y:b[1]},{x:b[2],y:b[3]},{x:b[4],y:b[5]},c),y=Ki({x:b[0],y:b[1]},{x:b[2],y:b[3]},{x:b[4],y:b[5]},d);return[b[0],b[1],m.x,m.y,p.x,p.y,y.x,y.y,b[4],b[5]]},v=[].concat(h(f.topLeft),h(f.topRight),h(f.bottomRight),h(f.bottomLeft));return Oo(i,s,v,e,r)},generateBarrelBezierPts:function(e,r,n,a){var i=r/2,s=e/2,o=n-s,l=n+s,u=a-i,c=a+i,d=A0(e,r),f=d.heightOffset,h=d.widthOffset,v=d.ctrlPtOffsetPct*e,x={topLeft:[o,u+f,o+v,u,o+h,u],topRight:[l-h,u,l-v,u,l,u+f],bottomRight:[l,c-f,l-v,c,l-h,c],bottomLeft:[o+h,c,o+v,c,o,c-f]};return x.topLeft.isTop=!0,x.topRight.isTop=!0,x.bottomLeft.isBottom=!0,x.bottomRight.isBottom=!0,x},checkPoint:function(e,r,n,a,i,s,o,l){var u=A0(a,i),c=u.heightOffset,d=u.widthOffset;if(Bn(e,r,this.points,s,o,a,i-2*c,[0,-1],n)||Bn(e,r,this.points,s,o,a-2*d,i,[0,-1],n))return!0;for(var f=this.generateBarrelBezierPts(a,i,s,o),h=function(k,T,_){var N=_[4],P=_[2],R=_[0],I=_[5],M=_[1],D=Math.min(N,R),L=Math.max(N,R),j=Math.min(I,M),F=Math.max(I,M);if(D<=k&&k<=L&&j<=T&&T<=F){var O=n5(N,P,R),B=YO(O[0],O[1],O[2],k),V=B.filter(function(J){return 0<=J&&J<=1});if(V.length>0)return V[0]}return null},v=Object.keys(f),x=0;x<v.length;x++){var b=v[x],m=f[b],p=h(e,r,m);if(p!=null){var y=m[5],w=m[3],E=m[1],S=Bt(y,w,E,p);if(m.isTop&&S<=r||m.isBottom&&r<=S)return!0}}return!1}}};qn.generateBottomRoundrectangle=function(){return this.nodeShapes["bottom-round-rectangle"]=this.nodeShapes.bottomroundrectangle={renderer:this,name:"bottom-round-rectangle",points:ar(4,0),draw:function(e,r,n,a,i,s){this.renderer.nodeShapeImpl(this.name,e,r,n,a,i,this.points,s)},intersectLine:function(e,r,n,a,i,s,o,l){var u=e-(n/2+o),c=r-(a/2+o),d=c,f=e+(n/2+o),h=ia(i,s,e,r,u,c,f,d,!1);return h.length>0?h:tA(i,s,e,r,n,a,o,l)},checkPoint:function(e,r,n,a,i,s,o,l){l=l==="auto"?ba(a,i):l;var u=2*l;if(Bn(e,r,this.points,s,o,a,i-u,[0,-1],n)||Bn(e,r,this.points,s,o,a-u,i,[0,-1],n))return!0;var c=a/2+2*n,d=i/2+2*n,f=[s-c,o-d,s-c,o,s+c,o,s+c,o-d];return!!(gr(e,r,f)||Ha(e,r,u,u,s+a/2-l,o+i/2-l,n)||Ha(e,r,u,u,s-a/2+l,o+i/2-l,n))}}};qn.registerNodeShapes=function(){var t=this.nodeShapes={},e=this;this.generateEllipse(),this.generatePolygon("triangle",ar(3,0)),this.generateRoundPolygon("round-triangle",ar(3,0)),this.generatePolygon("rectangle",ar(4,0)),t.square=t.rectangle,this.generateRoundRectangle(),this.generateCutRectangle(),this.generateBarrel(),this.generateBottomRoundrectangle();{var r=[0,1,1,0,0,-1,-1,0];this.generatePolygon("diamond",r),this.generateRoundPolygon("round-diamond",r)}this.generatePolygon("pentagon",ar(5,0)),this.generateRoundPolygon("round-pentagon",ar(5,0)),this.generatePolygon("hexagon",ar(6,0)),this.generateRoundPolygon("round-hexagon",ar(6,0)),this.generatePolygon("heptagon",ar(7,0)),this.generateRoundPolygon("round-heptagon",ar(7,0)),this.generatePolygon("octagon",ar(8,0)),this.generateRoundPolygon("round-octagon",ar(8,0));var n=new Array(20);{var a=P0(5,0),i=P0(5,Math.PI/5),s=.5*(3-Math.sqrt(5));s*=1.57;for(var o=0;o<i.length/2;o++)i[o*2]*=s,i[o*2+1]*=s;for(var o=0;o<20/4;o++)n[o*4]=a[o*2],n[o*4+1]=a[o*2+1],n[o*4+2]=i[o*2],n[o*4+3]=i[o*2+1]}n=rA(n),this.generatePolygon("star",n),this.generatePolygon("vee",[-1,-1,0,-.333,1,-1,0,1]),this.generatePolygon("rhomboid",[-1,-1,.333,-1,1,1,-.333,1]),this.generatePolygon("right-rhomboid",[-.333,-1,1,-1,.333,1,-1,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)}t.makePolygon=function(u){var c=u.join("$"),d="polygon-"+c,f;return(f=this[d])?f:e.generatePolygon(d,u)}};var ol={};ol.timeToRender=function(){return this.redrawTotalTime/this.redrawCount};ol.redraw=function(t){t=t||ZP();var e=this;e.averageRedrawTime===void 0&&(e.averageRedrawTime=0),e.lastRedrawTime===void 0&&(e.lastRedrawTime=0),e.lastDrawTime===void 0&&(e.lastDrawTime=0),e.requestedFrame=!0,e.renderOptions=t};ol.beforeRender=function(t,e){if(!this.destroyed){e==null&&ct("Priority is not optional for beforeRender");var r=this.beforeRenderCallbacks;r.push({fn:t,priority:e}),r.sort(function(n,a){return a.priority-n.priority})}};var mE=function(e,r,n){for(var a=e.beforeRenderCallbacks,i=0;i<a.length;i++)a[i].fn(r,n)};ol.startRenderLoop=function(){var t=this,e=t.cy;if(!t.renderLoopStarted){t.renderLoopStarted=!0;var r=function(a){if(!t.destroyed){if(!e.batching())if(t.requestedFrame&&!t.skipFrame){mE(t,!0,a);var i=Ln();t.render(t.renderOptions);var s=t.lastDrawTime=Ln();t.averageRedrawTime===void 0&&(t.averageRedrawTime=s-i),t.redrawCount===void 0&&(t.redrawCount=0),t.redrawCount++,t.redrawTotalTime===void 0&&(t.redrawTotalTime=0);var o=s-i;t.redrawTotalTime+=o,t.lastRedrawTime=o,t.averageRedrawTime=t.averageRedrawTime/2+o/2,t.requestedFrame=!1}else mE(t,!1,a);t.skipFrame=!1,Xu(r)}};Xu(r)}};var w$=function(e){this.init(e)},aj=w$,ys=aj.prototype;ys.clientFunctions=["redrawHint","render","renderTo","matchCanvasSize","nodeShapeImpl","arrowShapeImpl"];ys.init=function(t){var e=this;e.options=t,e.cy=t.cy;var r=e.container=t.cy.container(),n=e.cy.window();if(n){var a=n.document,i=a.head,s="__________cytoscape_stylesheet",o="__________cytoscape_container",l=a.getElementById(s)!=null;if(r.className.indexOf(o)<0&&(r.className=(r.className||"")+" "+o),!l){var u=a.createElement("style");u.id=s,u.textContent="."+o+" { position: relative; }",i.insertBefore(u,i.children[0])}var c=n.getComputedStyle(r),d=c.getPropertyValue("position");d==="static"&&Ye("A Cytoscape container has style position:static and so can not use UI extensions properly")}e.selection=[void 0,void 0,void 0,void 0,0],e.bezierProjPcts=[.05,.225,.4,.5,.6,.775,.95],e.hoverData={down:null,last:null,downTime:null,triggerMode:null,dragging:!1,initialPan:[null,null],capture:!1},e.dragData={possibleDragElements:[]},e.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]},e.redraws=0,e.showFps=t.showFps,e.debug=t.debug,e.webgl=t.webgl,e.hideEdgesOnViewport=t.hideEdgesOnViewport,e.textureOnViewport=t.textureOnViewport,e.wheelSensitivity=t.wheelSensitivity,e.motionBlurEnabled=t.motionBlur,e.forcedPixelRatio=le(t.pixelRatio)?t.pixelRatio:null,e.motionBlur=t.motionBlur,e.motionBlurOpacity=t.motionBlurOpacity,e.motionBlurTransparency=1-e.motionBlurOpacity,e.motionBlurPxRatio=1,e.mbPxRBlurry=1,e.minMbLowQualFrames=4,e.fullQualityMb=!1,e.clearedForMotionBlur=[],e.desktopTapThreshold=t.desktopTapThreshold,e.desktopTapThreshold2=t.desktopTapThreshold*t.desktopTapThreshold,e.touchTapThreshold=t.touchTapThreshold,e.touchTapThreshold2=t.touchTapThreshold*t.touchTapThreshold,e.tapholdDuration=500,e.bindings=[],e.beforeRenderCallbacks=[],e.beforeRenderPriorities={animations:400,eleCalcs:300,eleTxrDeq:200,lyrTxrDeq:150,lyrTxrSkip:100},e.registerNodeShapes(),e.registerArrowShapes(),e.registerCalculationListeners()};ys.notify=function(t,e){var r=this,n=r.cy;if(!this.destroyed){if(t==="init"){r.load();return}if(t==="destroy"){r.destroy();return}(t==="add"||t==="remove"||t==="move"&&n.hasCompoundNodes()||t==="load"||t==="zorder"||t==="mount")&&r.invalidateCachedZSortedEles(),t==="viewport"&&r.redrawHint("select",!0),t==="gc"&&r.redrawHint("gc",!0),(t==="load"||t==="resize"||t==="mount")&&(r.invalidateContainerClientCoordsCache(),r.matchCanvasSize(r.container)),r.redrawHint("eles",!0),r.redrawHint("drag",!0),this.startRenderLoop(),this.redraw()}};ys.destroy=function(){var t=this;t.destroyed=!0,t.cy.stopAnimationLoop();for(var e=0;e<t.bindings.length;e++){var r=t.bindings[e],n=r,a=n.target;(a.off||a.removeEventListener).apply(a,n.args)}if(t.bindings=[],t.beforeRenderCallbacks=[],t.onUpdateEleCalcsFns=[],t.removeObserver&&t.removeObserver.disconnect(),t.styleObserver&&t.styleObserver.disconnect(),t.resizeObserver&&t.resizeObserver.disconnect(),t.labelCalcDiv)try{document.body.removeChild(t.labelCalcDiv)}catch{}};ys.isHeadless=function(){return!1};[g1,tj,rj,ms,qn,ol].forEach(function(t){Te(ys,t)});var lv=1e3/60,ij={setupDequeueing:function(e){return function(){var n=this,a=this.renderer;if(!n.dequeueingSetup){n.dequeueingSetup=!0;var i=rl(function(){a.redrawHint("eles",!0),a.redrawHint("drag",!0),a.redraw()},e.deqRedrawThreshold),s=function(u,c){var d=Ln(),f=a.averageRedrawTime,h=a.lastRedrawTime,v=[],x=a.cy.extent(),b=a.getPixelRatio();for(u||a.flushRenderedStyleQueue();;){var m=Ln(),p=m-d,y=m-c;if(h<lv){var w=lv-(u?f:0);if(y>=e.deqFastCost*w)break}else if(u){if(p>=e.deqCost*h||p>=e.deqAvgCost*f)break}else if(y>=e.deqNoDrawCost*lv)break;var E=e.deq(n,b,x);if(E.length>0)for(var S=0;S<E.length;S++)v.push(E[S]);else break}v.length>0&&(e.onDeqd(n,v),!u&&e.shouldRedraw(n,v,b,x)&&i())},o=e.priority||t1;a.beforeRender(s,o(n))}}}},S$=function(){function t(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Zu;Na(this,t),this.idsByKey=new Pn,this.keyForId=new Pn,this.cachesByLvl=new Pn,this.lvls=[],this.getKey=e,this.doesEleInvalidateKey=r}return Ra(t,[{key:"getIdsFor",value:function(r){r==null&&ct("Can not get id list for null key");var n=this.idsByKey,a=this.idsByKey.get(r);return a||(a=new vs,n.set(r,a)),a}},{key:"addIdForKey",value:function(r,n){r!=null&&this.getIdsFor(r).add(n)}},{key:"deleteIdForKey",value:function(r,n){r!=null&&this.getIdsFor(r).delete(n)}},{key:"getNumberOfIdsForKey",value:function(r){return r==null?0:this.getIdsFor(r).size}},{key:"updateKeyMappingFor",value:function(r){var n=r.id(),a=this.keyForId.get(n),i=this.getKey(r);this.deleteIdForKey(a,n),this.addIdForKey(i,n),this.keyForId.set(n,i)}},{key:"deleteKeyMappingFor",value:function(r){var n=r.id(),a=this.keyForId.get(n);this.deleteIdForKey(a,n),this.keyForId.delete(n)}},{key:"keyHasChangedFor",value:function(r){var n=r.id(),a=this.keyForId.get(n),i=this.getKey(r);return a!==i}},{key:"isInvalid",value:function(r){return this.keyHasChangedFor(r)||this.doesEleInvalidateKey(r)}},{key:"getCachesAt",value:function(r){var n=this.cachesByLvl,a=this.lvls,i=n.get(r);return i||(i=new Pn,n.set(r,i),a.push(r)),i}},{key:"getCache",value:function(r,n){return this.getCachesAt(n).get(r)}},{key:"get",value:function(r,n){var a=this.getKey(r),i=this.getCache(a,n);return i!=null&&this.updateKeyMappingFor(r),i}},{key:"getForCachedKey",value:function(r,n){var a=this.keyForId.get(r.id()),i=this.getCache(a,n);return i}},{key:"hasCache",value:function(r,n){return this.getCachesAt(n).has(r)}},{key:"has",value:function(r,n){var a=this.getKey(r);return this.hasCache(a,n)}},{key:"setCache",value:function(r,n,a){a.key=r,this.getCachesAt(n).set(r,a)}},{key:"set",value:function(r,n,a){var i=this.getKey(r);this.setCache(i,n,a),this.updateKeyMappingFor(r)}},{key:"deleteCache",value:function(r,n){this.getCachesAt(n).delete(r)}},{key:"delete",value:function(r,n){var a=this.getKey(r);this.deleteCache(a,n)}},{key:"invalidateKey",value:function(r){var n=this;this.lvls.forEach(function(a){return n.deleteCache(r,a)})}},{key:"invalidate",value:function(r){var n=r.id(),a=this.keyForId.get(n);this.deleteKeyMappingFor(r);var i=this.doesEleInvalidateKey(r);return i&&this.invalidateKey(a),i||this.getNumberOfIdsForKey(a)===0}}])}(),yE=25,Kl=50,xu=-4,U0=3,sj=7.99,E$=8,C$=1024,k$=1024,T$=1024,_$=.2,N$=.8,R$=10,P$=.15,A$=.1,j$=.9,I$=.9,M$=100,D$=1,Fi={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},L$=Kt({getKey:null,doesEleInvalidateKey:Zu,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:KP,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),Js=function(e,r){var n=this;n.renderer=e,n.onDequeues=[];var a=L$(r);Te(n,a),n.lookup=new S$(a.getKey,a.doesEleInvalidateKey),n.setupDequeueing()},Mt=Js.prototype;Mt.reasons=Fi;Mt.getTextureQueue=function(t){var e=this;return e.eleImgCaches=e.eleImgCaches||{},e.eleImgCaches[t]=e.eleImgCaches[t]||[]};Mt.getRetiredTextureQueue=function(t){var e=this,r=e.eleImgCaches.retired=e.eleImgCaches.retired||{},n=r[t]=r[t]||[];return n};Mt.getElementQueue=function(){var t=this,e=t.eleCacheQueue=t.eleCacheQueue||new nl(function(r,n){return n.reqs-r.reqs});return e};Mt.getElementKeyToQueue=function(){var t=this,e=t.eleKeyToCacheQueue=t.eleKeyToCacheQueue||{};return e};Mt.getElement=function(t,e,r,n,a){var i=this,s=this.renderer,o=s.cy.zoom(),l=this.lookup;if(!e||e.w===0||e.h===0||isNaN(e.w)||isNaN(e.h)||!t.visible()||t.removed()||!i.allowEdgeTxrCaching&&t.isEdge()||!i.allowParentTxrCaching&&t.isParent())return null;if(n==null&&(n=Math.ceil(n1(o*r))),n<xu)n=xu;else if(o>=sj||n>U0)return null;var u=Math.pow(2,n),c=e.h*u,d=e.w*u,f=s.eleTextBiggerThanMin(t,u);if(!this.isVisible(t,f))return null;var h=l.get(t,n);if(h&&h.invalidated&&(h.invalidated=!1,h.texture.invalidatedWidth-=h.width),h)return h;var v;if(c<=yE?v=yE:c<=Kl?v=Kl:v=Math.ceil(c/Kl)*Kl,c>T$||d>k$)return null;var x=i.getTextureQueue(v),b=x[x.length-2],m=function(){return i.recycleTexture(v,d)||i.addTexture(v,d)};b||(b=x[x.length-1]),b||(b=m()),b.width-b.usedWidth<d&&(b=m());for(var p=function(D){return D&&D.scaledLabelShown===f},y=a&&a===Fi.dequeue,w=a&&a===Fi.highQuality,E=a&&a===Fi.downscale,S,C=n+1;C<=U0;C++){var k=l.get(t,C);if(k){S=k;break}}var T=S&&S.level===n+1?S:null,_=function(){b.context.drawImage(T.texture.canvas,T.x,0,T.width,T.height,b.usedWidth,0,d,c)};if(b.context.setTransform(1,0,0,1,0,0),b.context.clearRect(b.usedWidth,0,d,v),p(T))_();else if(p(S))if(w){for(var N=S.level;N>n;N--)T=i.getElement(t,e,r,N,Fi.downscale);_()}else return i.queueElement(t,S.level-1),S;else{var P;if(!y&&!w&&!E)for(var R=n-1;R>=xu;R--){var I=l.get(t,R);if(I){P=I;break}}if(p(P))return i.queueElement(t,n),P;b.context.translate(b.usedWidth,0),b.context.scale(u,u),this.drawElement(b.context,t,e,f,!1),b.context.scale(1/u,1/u),b.context.translate(-b.usedWidth,0)}return h={x:b.usedWidth,texture:b,level:n,scale:u,width:d,height:c,scaledLabelShown:f},b.usedWidth+=Math.ceil(d+E$),b.eleCaches.push(h),l.set(t,n,h),i.checkTextureFullness(b),h};Mt.invalidateElements=function(t){for(var e=0;e<t.length;e++)this.invalidateElement(t[e])};Mt.invalidateElement=function(t){var e=this,r=e.lookup,n=[],a=r.isInvalid(t);if(a){for(var i=xu;i<=U0;i++){var s=r.getForCachedKey(t,i);s&&n.push(s)}var o=r.invalidate(t);if(o)for(var l=0;l<n.length;l++){var u=n[l],c=u.texture;c.invalidatedWidth+=u.width,u.invalidated=!0,e.checkTextureUtility(c)}e.removeFromQueue(t)}};Mt.checkTextureUtility=function(t){t.invalidatedWidth>=_$*t.width&&this.retireTexture(t)};Mt.checkTextureFullness=function(t){var e=this,r=e.getTextureQueue(t.height);t.usedWidth/t.width>N$&&t.fullnessChecks>=R$?xa(r,t):t.fullnessChecks++};Mt.retireTexture=function(t){var e=this,r=t.height,n=e.getTextureQueue(r),a=this.lookup;xa(n,t),t.retired=!0;for(var i=t.eleCaches,s=0;s<i.length;s++){var o=i[s];a.deleteCache(o.key,o.level)}r1(i);var l=e.getRetiredTextureQueue(r);l.push(t)};Mt.addTexture=function(t,e){var r=this,n=r.getTextureQueue(t),a={};return n.push(a),a.eleCaches=[],a.height=t,a.width=Math.max(C$,e),a.usedWidth=0,a.invalidatedWidth=0,a.fullnessChecks=0,a.canvas=r.renderer.makeOffscreenCanvas(a.width,a.height),a.context=a.canvas.getContext("2d"),a};Mt.recycleTexture=function(t,e){for(var r=this,n=r.getTextureQueue(t),a=r.getRetiredTextureQueue(t),i=0;i<a.length;i++){var s=a[i];if(s.width>=e)return s.retired=!1,s.usedWidth=0,s.invalidatedWidth=0,s.fullnessChecks=0,r1(s.eleCaches),s.context.setTransform(1,0,0,1,0,0),s.context.clearRect(0,0,s.width,s.height),xa(a,s),n.push(s),s}};Mt.queueElement=function(t,e){var r=this,n=r.getElementQueue(),a=r.getElementKeyToQueue(),i=this.getKey(t),s=a[i];if(s)s.level=Math.max(s.level,e),s.eles.merge(t),s.reqs++,n.updateItem(s);else{var o={eles:t.spawn().merge(t),level:e,reqs:1,key:i};n.push(o),a[i]=o}};Mt.dequeue=function(t){for(var e=this,r=e.getElementQueue(),n=e.getElementKeyToQueue(),a=[],i=e.lookup,s=0;s<D$&&r.size()>0;s++){var o=r.pop(),l=o.key,u=o.eles[0],c=i.hasCache(u,o.level);if(n[l]=null,c)continue;a.push(o);var d=e.getBoundingBox(u);e.getElement(u,d,t,o.level,Fi.dequeue)}return a};Mt.removeFromQueue=function(t){var e=this,r=e.getElementQueue(),n=e.getElementKeyToQueue(),a=this.getKey(t),i=n[a];i!=null&&(i.eles.length===1?(i.reqs=e1,r.updateItem(i),r.pop(),n[a]=null):i.eles.unmerge(t))};Mt.onDequeue=function(t){this.onDequeues.push(t)};Mt.offDequeue=function(t){xa(this.onDequeues,t)};Mt.setupDequeueing=ij.setupDequeueing({deqRedrawThreshold:M$,deqCost:P$,deqAvgCost:A$,deqNoDrawCost:j$,deqFastCost:I$,deq:function(e,r,n){return e.dequeue(r,n)},onDeqd:function(e,r){for(var n=0;n<e.onDequeues.length;n++){var a=e.onDequeues[n];a(r)}},shouldRedraw:function(e,r,n,a){for(var i=0;i<r.length;i++)for(var s=r[i].eles,o=0;o<s.length;o++){var l=s[o].boundingBox();if(i1(l,a))return!0}return!1},priority:function(e){return e.renderer.beforeRenderPriorities.eleTxrDeq}});var B$=1,po=-4,ic=2,O$=3.99,q$=50,F$=50,$$=.15,z$=.1,V$=.9,U$=.9,G$=1,xE=250,H$=4e3*4e3,bE=32767,W$=!0,oj=function(e){var r=this,n=r.renderer=e,a=n.cy;r.layersByLevel={},r.firstGet=!0,r.lastInvalidationTime=Ln()-2*xE,r.skipping=!1,r.eleTxrDeqs=a.collection(),r.scheduleElementRefinement=rl(function(){r.refineElementTextures(r.eleTxrDeqs),r.eleTxrDeqs.unmerge(r.eleTxrDeqs)},F$),n.beforeRender(function(s,o){o-r.lastInvalidationTime<=xE?r.skipping=!0:r.skipping=!1},n.beforeRenderPriorities.lyrTxrSkip);var i=function(o,l){return l.reqs-o.reqs};r.layersQueue=new nl(i),r.setupDequeueing()},Yt=oj.prototype,wE=0,K$=Math.pow(2,53)-1;Yt.makeLayer=function(t,e){var r=Math.pow(2,e),n=Math.ceil(t.w*r),a=Math.ceil(t.h*r),i=this.renderer.makeOffscreenCanvas(n,a),s={id:wE=++wE%K$,bb:t,level:e,width:n,height:a,canvas:i,context:i.getContext("2d"),eles:[],elesQueue:[],reqs:0},o=s.context,l=-s.bb.x1,u=-s.bb.y1;return o.scale(r,r),o.translate(l,u),s};Yt.getLayers=function(t,e,r){var n=this,a=n.renderer,i=a.cy,s=i.zoom(),o=n.firstGet;if(n.firstGet=!1,r==null){if(r=Math.ceil(n1(s*e)),r<po)r=po;else if(s>=O$||r>ic)return null}n.validateLayersElesOrdering(r,t);var l=n.layersByLevel,u=Math.pow(2,r),c=l[r]=l[r]||[],d,f=n.levelIsComplete(r,t),h,v=function(){var _=function(M){if(n.validateLayersElesOrdering(M,t),n.levelIsComplete(M,t))return h=l[M],!0},N=function(M){if(!h)for(var D=r+M;po<=D&&D<=ic&&!_(D);D+=M);};N(1),N(-1);for(var P=c.length-1;P>=0;P--){var R=c[P];R.invalid&&xa(c,R)}};if(!f)v();else return c;var x=function(){if(!d){d=lr();for(var _=0;_<t.length;_++)VO(d,t[_].boundingBox())}return d},b=function(_){_=_||{};var N=_.after;x();var P=Math.ceil(d.w*u),R=Math.ceil(d.h*u);if(P>bE||R>bE)return null;var I=P*R;if(I>H$)return null;var M=n.makeLayer(d,r);if(N!=null){var D=c.indexOf(N)+1;c.splice(D,0,M)}else(_.insert===void 0||_.insert)&&c.unshift(M);return M};if(n.skipping&&!o)return null;for(var m=null,p=t.length/B$,y=!o,w=0;w<t.length;w++){var E=t[w],S=E._private.rscratch,C=S.imgLayerCaches=S.imgLayerCaches||{},k=C[r];if(k){m=k;continue}if((!m||m.eles.length>=p||!eA(m.bb,E.boundingBox()))&&(m=b({insert:!0,after:m}),!m))return null;h||y?n.queueLayer(m,E):n.drawEleInLayer(m,E,r,e),m.eles.push(E),C[r]=m}return h||(y?null:c)};Yt.getEleLevelForLayerLevel=function(t,e){return t};Yt.drawEleInLayer=function(t,e,r,n){var a=this,i=this.renderer,s=t.context,o=e.boundingBox();o.w===0||o.h===0||!e.visible()||(r=a.getEleLevelForLayerLevel(r,n),i.setImgSmoothing(s,!1),i.drawCachedElement(s,e,null,null,r,W$),i.setImgSmoothing(s,!0))};Yt.levelIsComplete=function(t,e){var r=this,n=r.layersByLevel[t];if(!n||n.length===0)return!1;for(var a=0,i=0;i<n.length;i++){var s=n[i];if(s.reqs>0||s.invalid)return!1;a+=s.eles.length}return a===e.length};Yt.validateLayersElesOrdering=function(t,e){var r=this.layersByLevel[t];if(r)for(var n=0;n<r.length;n++){for(var a=r[n],i=-1,s=0;s<e.length;s++)if(a.eles[0]===e[s]){i=s;break}if(i<0){this.invalidateLayer(a);continue}for(var o=i,s=0;s<a.eles.length;s++)if(a.eles[s]!==e[o+s]){this.invalidateLayer(a);break}}};Yt.updateElementsInLayers=function(t,e){for(var r=this,n=Qo(t[0]),a=0;a<t.length;a++)for(var i=n?null:t[a],s=n?t[a]:t[a].ele,o=s._private.rscratch,l=o.imgLayerCaches=o.imgLayerCaches||{},u=po;u<=ic;u++){var c=l[u];c&&(i&&r.getEleLevelForLayerLevel(c.level)!==i.level||e(c,s,i))}};Yt.haveLayers=function(){for(var t=this,e=!1,r=po;r<=ic;r++){var n=t.layersByLevel[r];if(n&&n.length>0){e=!0;break}}return e};Yt.invalidateElements=function(t){var e=this;t.length!==0&&(e.lastInvalidationTime=Ln(),!(t.length===0||!e.haveLayers())&&e.updateElementsInLayers(t,function(n,a,i){e.invalidateLayer(n)}))};Yt.invalidateLayer=function(t){if(this.lastInvalidationTime=Ln(),!t.invalid){var e=t.level,r=t.eles,n=this.layersByLevel[e];xa(n,t),t.elesQueue=[],t.invalid=!0,t.replacement&&(t.replacement.invalid=!0);for(var a=0;a<r.length;a++){var i=r[a]._private.rscratch.imgLayerCaches;i&&(i[e]=null)}}};Yt.refineElementTextures=function(t){var e=this;e.updateElementsInLayers(t,function(n,a,i){var s=n.replacement;if(s||(s=n.replacement=e.makeLayer(n.bb,n.level),s.replaces=n,s.eles=n.eles),!s.reqs)for(var o=0;o<s.eles.length;o++)e.queueLayer(s,s.eles[o])})};Yt.enqueueElementRefinement=function(t){this.eleTxrDeqs.merge(t),this.scheduleElementRefinement()};Yt.queueLayer=function(t,e){var r=this,n=r.layersQueue,a=t.elesQueue,i=a.hasId=a.hasId||{};if(!t.replacement){if(e){if(i[e.id()])return;a.push(e),i[e.id()]=!0}t.reqs?(t.reqs++,n.updateItem(t)):(t.reqs=1,n.push(t))}};Yt.dequeue=function(t){for(var e=this,r=e.layersQueue,n=[],a=0;a<G$&&r.size()!==0;){var i=r.peek();if(i.replacement){r.pop();continue}if(i.replaces&&i!==i.replaces.replacement){r.pop();continue}if(i.invalid){r.pop();continue}var s=i.elesQueue.shift();s&&(e.drawEleInLayer(i,s,i.level,t),a++),n.length===0&&n.push(!0),i.elesQueue.length===0&&(r.pop(),i.reqs=0,i.replaces&&e.applyLayerReplacement(i),e.requestRedraw())}return n};Yt.applyLayerReplacement=function(t){var e=this,r=e.layersByLevel[t.level],n=t.replaces,a=r.indexOf(n);if(!(a<0||n.invalid)){r[a]=t;for(var i=0;i<t.eles.length;i++){var s=t.eles[i]._private,o=s.imgLayerCaches=s.imgLayerCaches||{};o&&(o[t.level]=t)}e.requestRedraw()}};Yt.requestRedraw=rl(function(){var t=this.renderer;t.redrawHint("eles",!0),t.redrawHint("drag",!0),t.redraw()},100);Yt.setupDequeueing=ij.setupDequeueing({deqRedrawThreshold:q$,deqCost:$$,deqAvgCost:z$,deqNoDrawCost:V$,deqFastCost:U$,deq:function(e,r){return e.dequeue(r)},onDeqd:t1,shouldRedraw:KP,priority:function(e){return e.renderer.beforeRenderPriorities.lyrTxrDeq}});var lj={},SE;function Y$(t,e){for(var r=0;r<e.length;r++){var n=e[r];t.lineTo(n.x,n.y)}}function X$(t,e,r){for(var n,a=0;a<e.length;a++){var i=e[a];a===0&&(n=i),t.lineTo(i.x,i.y)}t.quadraticCurveTo(r.x,r.y,n.x,n.y)}function EE(t,e,r){t.beginPath&&t.beginPath();for(var n=e,a=0;a<n.length;a++){var i=n[a];t.lineTo(i.x,i.y)}var s=r,o=r[0];t.moveTo(o.x,o.y);for(var a=1;a<s.length;a++){var i=s[a];t.lineTo(i.x,i.y)}t.closePath&&t.closePath()}function Z$(t,e,r,n,a){t.beginPath&&t.beginPath(),t.arc(r,n,a,0,Math.PI*2,!1);var i=e,s=i[0];t.moveTo(s.x,s.y);for(var o=0;o<i.length;o++){var l=i[o];t.lineTo(l.x,l.y)}t.closePath&&t.closePath()}function Q$(t,e,r,n){t.arc(e,r,n,0,Math.PI*2,!1)}lj.arrowShapeImpl=function(t){return(SE||(SE={polygon:Y$,"triangle-backcurve":X$,"triangle-tee":EE,"circle-triangle":Z$,"triangle-cross":EE,circle:Q$}))[t]};var bn={};bn.drawElement=function(t,e,r,n,a,i){var s=this;e.isNode()?s.drawNode(t,e,r,n,a,i):s.drawEdge(t,e,r,n,a,i)};bn.drawElementOverlay=function(t,e){var r=this;e.isNode()?r.drawNodeOverlay(t,e):r.drawEdgeOverlay(t,e)};bn.drawElementUnderlay=function(t,e){var r=this;e.isNode()?r.drawNodeUnderlay(t,e):r.drawEdgeUnderlay(t,e)};bn.drawCachedElementPortion=function(t,e,r,n,a,i,s,o){var l=this,u=r.getBoundingBox(e);if(!(u.w===0||u.h===0)){var c=r.getElement(e,u,n,a,i);if(c!=null){var d=o(l,e);if(d===0)return;var f=s(l,e),h=u.x1,v=u.y1,x=u.w,b=u.h,m,p,y,w,E;if(f!==0){var S=r.getRotationPoint(e);y=S.x,w=S.y,t.translate(y,w),t.rotate(f),E=l.getImgSmoothing(t),E||l.setImgSmoothing(t,!0);var C=r.getRotationOffset(e);m=C.x,p=C.y}else m=h,p=v;var k;d!==1&&(k=t.globalAlpha,t.globalAlpha=k*d),t.drawImage(c.texture.canvas,c.x,0,c.width,c.height,m,p,x,b),d!==1&&(t.globalAlpha=k),f!==0&&(t.rotate(-f),t.translate(-y,-w),E||l.setImgSmoothing(t,!1))}else r.drawElement(t,e)}};var J$=function(){return 0},e3=function(e,r){return e.getTextAngle(r,null)},t3=function(e,r){return e.getTextAngle(r,"source")},r3=function(e,r){return e.getTextAngle(r,"target")},n3=function(e,r){return r.effectiveOpacity()},uv=function(e,r){return r.pstyle("text-opacity").pfValue*r.effectiveOpacity()};bn.drawCachedElement=function(t,e,r,n,a,i){var s=this,o=s.data,l=o.eleTxrCache,u=o.lblTxrCache,c=o.slbTxrCache,d=o.tlbTxrCache,f=e.boundingBox(),h=i===!0?l.reasons.highQuality:null;if(!(f.w===0||f.h===0||!e.visible())&&(!n||i1(f,n))){var v=e.isEdge(),x=e.element()._private.rscratch.badLine;s.drawElementUnderlay(t,e),s.drawCachedElementPortion(t,e,l,r,a,h,J$,n3),(!v||!x)&&s.drawCachedElementPortion(t,e,u,r,a,h,e3,uv),v&&!x&&(s.drawCachedElementPortion(t,e,c,r,a,h,t3,uv),s.drawCachedElementPortion(t,e,d,r,a,h,r3,uv)),s.drawElementOverlay(t,e)}};bn.drawElements=function(t,e){for(var r=this,n=0;n<e.length;n++){var a=e[n];r.drawElement(t,a)}};bn.drawCachedElements=function(t,e,r,n){for(var a=this,i=0;i<e.length;i++){var s=e[i];a.drawCachedElement(t,s,r,n)}};bn.drawCachedNodes=function(t,e,r,n){for(var a=this,i=0;i<e.length;i++){var s=e[i];s.isNode()&&a.drawCachedElement(t,s,r,n)}};bn.drawLayeredElements=function(t,e,r,n){var a=this,i=a.data.lyrTxrCache.getLayers(e,r);if(i)for(var s=0;s<i.length;s++){var o=i[s],l=o.bb;l.w===0||l.h===0||t.drawImage(o.canvas,l.x1,l.y1,l.w,l.h)}else a.drawCachedElements(t,e,r,n)};var Fn={};Fn.drawEdge=function(t,e,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,s=this,o=e._private.rscratch;if(!(i&&!e.visible())&&!(o.badLine||o.allpts==null||isNaN(o.allpts[0]))){var l;r&&(l=r,t.translate(-l.x1,-l.y1));var u=i?e.pstyle("opacity").value:1,c=i?e.pstyle("line-opacity").value:1,d=e.pstyle("curve-style").value,f=e.pstyle("line-style").value,h=e.pstyle("width").pfValue,v=e.pstyle("line-cap").value,x=e.pstyle("line-outline-width").value,b=e.pstyle("line-outline-color").value,m=u*c,p=u*c,y=function(){var M=arguments.length>0&&arguments[0]!==void 0?arguments[0]:m;d==="straight-triangle"?(s.eleStrokeStyle(t,e,M),s.drawEdgeTrianglePath(e,t,o.allpts)):(t.lineWidth=h,t.lineCap=v,s.eleStrokeStyle(t,e,M),s.drawEdgePath(e,t,o.allpts,f),t.lineCap="butt")},w=function(){var M=arguments.length>0&&arguments[0]!==void 0?arguments[0]:m;if(t.lineWidth=h+x,t.lineCap=v,x>0)s.colorStrokeStyle(t,b[0],b[1],b[2],M);else{t.lineCap="butt";return}d==="straight-triangle"?s.drawEdgeTrianglePath(e,t,o.allpts):(s.drawEdgePath(e,t,o.allpts,f),t.lineCap="butt")},E=function(){a&&s.drawEdgeOverlay(t,e)},S=function(){a&&s.drawEdgeUnderlay(t,e)},C=function(){var M=arguments.length>0&&arguments[0]!==void 0?arguments[0]:p;s.drawArrowheads(t,e,M)},k=function(){s.drawElementText(t,e,null,n)};t.lineJoin="round";var T=e.pstyle("ghost").value==="yes";if(T){var _=e.pstyle("ghost-offset-x").pfValue,N=e.pstyle("ghost-offset-y").pfValue,P=e.pstyle("ghost-opacity").value,R=m*P;t.translate(_,N),y(R),C(R),t.translate(-_,-N)}else w();S(),y(),C(),E(),k(),r&&t.translate(l.x1,l.y1)}};var uj=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(r,n){if(n.visible()){var a=n.pstyle("".concat(e,"-opacity")).value;if(a!==0){var i=this,s=i.usePaths(),o=n._private.rscratch,l=n.pstyle("".concat(e,"-padding")).pfValue,u=2*l,c=n.pstyle("".concat(e,"-color")).value;r.lineWidth=u,o.edgeType==="self"&&!s?r.lineCap="butt":r.lineCap="round",i.colorStrokeStyle(r,c[0],c[1],c[2],a),i.drawEdgePath(n,r,o.allpts,"solid")}}}};Fn.drawEdgeOverlay=uj("overlay");Fn.drawEdgeUnderlay=uj("underlay");Fn.drawEdgePath=function(t,e,r,n){var a=t._private.rscratch,i=e,s,o=!1,l=this.usePaths(),u=t.pstyle("line-dash-pattern").pfValue,c=t.pstyle("line-dash-offset").pfValue;if(l){var d=r.join("$"),f=a.pathCacheKey&&a.pathCacheKey===d;f?(s=e=a.pathCache,o=!0):(s=e=new Path2D,a.pathCacheKey=d,a.pathCache=s)}if(i.setLineDash)switch(n){case"dotted":i.setLineDash([1,1]);break;case"dashed":i.setLineDash(u),i.lineDashOffset=c;break;case"solid":i.setLineDash([]);break}if(!o&&!a.badLine)switch(e.beginPath&&e.beginPath(),e.moveTo(r[0],r[1]),a.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var h=2;h+3<r.length;h+=4)e.quadraticCurveTo(r[h],r[h+1],r[h+2],r[h+3]);break;case"straight":case"haystack":for(var v=2;v+1<r.length;v+=2)e.lineTo(r[v],r[v+1]);break;case"segments":if(a.isRound){var x=xr(a.roundCorners),b;try{for(x.s();!(b=x.n()).done;){var m=b.value;XA(e,m)}}catch(y){x.e(y)}finally{x.f()}e.lineTo(r[r.length-2],r[r.length-1])}else for(var p=2;p+1<r.length;p+=2)e.lineTo(r[p],r[p+1]);break}e=i,l?e.stroke(s):e.stroke(),e.setLineDash&&e.setLineDash([])};Fn.drawEdgeTrianglePath=function(t,e,r){e.fillStyle=e.strokeStyle;for(var n=t.pstyle("width").pfValue,a=0;a+1<r.length;a+=2){var i=[r[a+2]-r[a],r[a+3]-r[a+1]],s=Math.sqrt(i[0]*i[0]+i[1]*i[1]),o=[i[1]/s,-i[0]/s],l=[o[0]*n/2,o[1]*n/2];e.beginPath(),e.moveTo(r[a]-l[0],r[a+1]-l[1]),e.lineTo(r[a]+l[0],r[a+1]+l[1]),e.lineTo(r[a+2],r[a+3]),e.closePath(),e.fill()}};Fn.drawArrowheads=function(t,e,r){var n=e._private.rscratch,a=n.edgeType==="haystack";a||this.drawArrowhead(t,e,"source",n.arrowStartX,n.arrowStartY,n.srcArrowAngle,r),this.drawArrowhead(t,e,"mid-target",n.midX,n.midY,n.midtgtArrowAngle,r),this.drawArrowhead(t,e,"mid-source",n.midX,n.midY,n.midsrcArrowAngle,r),a||this.drawArrowhead(t,e,"target",n.arrowEndX,n.arrowEndY,n.tgtArrowAngle,r)};Fn.drawArrowhead=function(t,e,r,n,a,i,s){if(!(isNaN(n)||n==null||isNaN(a)||a==null||isNaN(i)||i==null)){var o=this,l=e.pstyle(r+"-arrow-shape").value;if(l!=="none"){var u=e.pstyle(r+"-arrow-fill").value==="hollow"?"both":"filled",c=e.pstyle(r+"-arrow-fill").value,d=e.pstyle("width").pfValue,f=e.pstyle(r+"-arrow-width"),h=f.value==="match-line"?d:f.pfValue;f.units==="%"&&(h*=d);var v=e.pstyle("opacity").value;s===void 0&&(s=v);var x=t.globalCompositeOperation;(s!==1||c==="hollow")&&(t.globalCompositeOperation="destination-out",o.colorFillStyle(t,255,255,255,1),o.colorStrokeStyle(t,255,255,255,1),o.drawArrowShape(e,t,u,d,l,h,n,a,i),t.globalCompositeOperation=x);var b=e.pstyle(r+"-arrow-color").value;o.colorFillStyle(t,b[0],b[1],b[2],s),o.colorStrokeStyle(t,b[0],b[1],b[2],s),o.drawArrowShape(e,t,c,d,l,h,n,a,i)}}};Fn.drawArrowShape=function(t,e,r,n,a,i,s,o,l){var u=this,c=this.usePaths()&&a!=="triangle-cross",d=!1,f,h=e,v={x:s,y:o},x=t.pstyle("arrow-scale").value,b=this.getArrowWidth(n,x),m=u.arrowShapes[a];if(c){var p=u.arrowPathCache=u.arrowPathCache||[],y=ni(a),w=p[y];w!=null?(f=e=w,d=!0):(f=e=new Path2D,p[y]=f)}d||(e.beginPath&&e.beginPath(),c?m.draw(e,1,0,{x:0,y:0},1):m.draw(e,b,l,v,n),e.closePath&&e.closePath()),e=h,c&&(e.translate(s,o),e.rotate(l),e.scale(b,b)),(r==="filled"||r==="both")&&(c?e.fill(f):e.fill()),(r==="hollow"||r==="both")&&(e.lineWidth=i/(c?b:1),e.lineJoin="miter",c?e.stroke(f):e.stroke()),c&&(e.scale(1/b,1/b),e.rotate(-l),e.translate(-s,-o))};var x1={};x1.safeDrawImage=function(t,e,r,n,a,i,s,o,l,u){if(!(a<=0||i<=0||l<=0||u<=0))try{t.drawImage(e,r,n,a,i,s,o,l,u)}catch(c){Ye(c)}};x1.drawInscribedImage=function(t,e,r,n,a){var i=this,s=r.position(),o=s.x,l=s.y,u=r.cy().style(),c=u.getIndexedStyle.bind(u),d=c(r,"background-fit","value",n),f=c(r,"background-repeat","value",n),h=r.width(),v=r.height(),x=r.padding()*2,b=h+(c(r,"background-width-relative-to","value",n)==="inner"?0:x),m=v+(c(r,"background-height-relative-to","value",n)==="inner"?0:x),p=r._private.rscratch,y=c(r,"background-clip","value",n),w=y==="node",E=c(r,"background-image-opacity","value",n)*a,S=c(r,"background-image-smoothing","value",n),C=r.pstyle("corner-radius").value;C!=="auto"&&(C=r.pstyle("corner-radius").pfValue);var k=e.width||e.cachedW,T=e.height||e.cachedH;(k==null||T==null)&&(document.body.appendChild(e),k=e.cachedW=e.width||e.offsetWidth,T=e.cachedH=e.height||e.offsetHeight,document.body.removeChild(e));var _=k,N=T;if(c(r,"background-width","value",n)!=="auto"&&(c(r,"background-width","units",n)==="%"?_=c(r,"background-width","pfValue",n)*b:_=c(r,"background-width","pfValue",n)),c(r,"background-height","value",n)!=="auto"&&(c(r,"background-height","units",n)==="%"?N=c(r,"background-height","pfValue",n)*m:N=c(r,"background-height","pfValue",n)),!(_===0||N===0)){if(d==="contain"){var P=Math.min(b/_,m/N);_*=P,N*=P}else if(d==="cover"){var P=Math.max(b/_,m/N);_*=P,N*=P}var R=o-b/2,I=c(r,"background-position-x","units",n),M=c(r,"background-position-x","pfValue",n);I==="%"?R+=(b-_)*M:R+=M;var D=c(r,"background-offset-x","units",n),L=c(r,"background-offset-x","pfValue",n);D==="%"?R+=(b-_)*L:R+=L;var j=l-m/2,F=c(r,"background-position-y","units",n),O=c(r,"background-position-y","pfValue",n);F==="%"?j+=(m-N)*O:j+=O;var B=c(r,"background-offset-y","units",n),V=c(r,"background-offset-y","pfValue",n);B==="%"?j+=(m-N)*V:j+=V,p.pathCache&&(R-=o,j-=l,o=0,l=0);var J=t.globalAlpha;t.globalAlpha=E;var q=i.getImgSmoothing(t),$=!1;if(S==="no"&&q?(i.setImgSmoothing(t,!1),$=!0):S==="yes"&&!q&&(i.setImgSmoothing(t,!0),$=!0),f==="no-repeat")w&&(t.save(),p.pathCache?t.clip(p.pathCache):(i.nodeShapes[i.getNodeShape(r)].draw(t,o,l,b,m,C,p),t.clip())),i.safeDrawImage(t,e,0,0,k,T,R,j,_,N),w&&t.restore();else{var z=t.createPattern(e,f);t.fillStyle=z,i.nodeShapes[i.getNodeShape(r)].draw(t,o,l,b,m,C,p),t.translate(R,j),t.fill(),t.translate(-R,-j)}t.globalAlpha=J,$&&i.setImgSmoothing(t,q)}};var di={};di.eleTextBiggerThanMin=function(t,e){if(!e){var r=t.cy().zoom(),n=this.getPixelRatio(),a=Math.ceil(n1(r*n));e=Math.pow(2,a)}var i=t.pstyle("font-size").pfValue*e,s=t.pstyle("min-zoomed-font-size").pfValue;return!(i<s)};di.drawElementText=function(t,e,r,n,a){var i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,s=this;if(n==null){if(i&&!s.eleTextBiggerThanMin(e))return}else if(n===!1)return;if(e.isNode()){var o=e.pstyle("label");if(!o||!o.value)return;var l=s.getLabelJustification(e);t.textAlign=l,t.textBaseline="bottom"}else{var u=e.element()._private.rscratch.badLine,c=e.pstyle("label"),d=e.pstyle("source-label"),f=e.pstyle("target-label");if(u||(!c||!c.value)&&(!d||!d.value)&&(!f||!f.value))return;t.textAlign="center",t.textBaseline="bottom"}var h=!r,v;r&&(v=r,t.translate(-v.x1,-v.y1)),a==null?(s.drawText(t,e,null,h,i),e.isEdge()&&(s.drawText(t,e,"source",h,i),s.drawText(t,e,"target",h,i))):s.drawText(t,e,a,h,i),r&&t.translate(v.x1,v.y1)};di.getFontCache=function(t){var e;this.fontCaches=this.fontCaches||[];for(var r=0;r<this.fontCaches.length;r++)if(e=this.fontCaches[r],e.context===t)return e;return e={context:t},this.fontCaches.push(e),e};di.setupTextStyle=function(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,n=e.pstyle("font-style").strValue,a=e.pstyle("font-size").pfValue+"px",i=e.pstyle("font-family").strValue,s=e.pstyle("font-weight").strValue,o=r?e.effectiveOpacity()*e.pstyle("text-opacity").value:1,l=e.pstyle("text-outline-opacity").value*o,u=e.pstyle("color").value,c=e.pstyle("text-outline-color").value;t.font=n+" "+s+" "+a+" "+i,t.lineJoin="round",this.colorFillStyle(t,u[0],u[1],u[2],o),this.colorStrokeStyle(t,c[0],c[1],c[2],l)};function a3(t,e,r,n,a){var i=Math.min(n,a),s=i/2,o=e+n/2,l=r+a/2;t.beginPath(),t.arc(o,l,s,0,Math.PI*2),t.closePath()}function CE(t,e,r,n,a){var i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:5,s=Math.min(i,n/2,a/2);t.beginPath(),t.moveTo(e+s,r),t.lineTo(e+n-s,r),t.quadraticCurveTo(e+n,r,e+n,r+s),t.lineTo(e+n,r+a-s),t.quadraticCurveTo(e+n,r+a,e+n-s,r+a),t.lineTo(e+s,r+a),t.quadraticCurveTo(e,r+a,e,r+a-s),t.lineTo(e,r+s),t.quadraticCurveTo(e,r,e+s,r),t.closePath()}di.getTextAngle=function(t,e){var r,n=t._private,a=n.rscratch,i=e?e+"-":"",s=t.pstyle(i+"text-rotation");if(s.strValue==="autorotate"){var o=pr(a,"labelAngle",e);r=t.isEdge()?o:0}else s.strValue==="none"?r=0:r=s.pfValue;return r};di.drawText=function(t,e,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=e._private,s=i.rscratch,o=a?e.effectiveOpacity():1;if(!(a&&(o===0||e.pstyle("text-opacity").value===0))){r==="main"&&(r=null);var l=pr(s,"labelX",r),u=pr(s,"labelY",r),c,d,f=this.getLabelText(e,r);if(f!=null&&f!==""&&!isNaN(l)&&!isNaN(u)){this.setupTextStyle(t,e,a);var h=r?r+"-":"",v=pr(s,"labelWidth",r),x=pr(s,"labelHeight",r),b=e.pstyle(h+"text-margin-x").pfValue,m=e.pstyle(h+"text-margin-y").pfValue,p=e.isEdge(),y=e.pstyle("text-halign").value,w=e.pstyle("text-valign").value;p&&(y="center",w="center"),l+=b,u+=m;var E;switch(n?E=this.getTextAngle(e,r):E=0,E!==0&&(c=l,d=u,t.translate(c,d),t.rotate(E),l=0,u=0),w){case"top":break;case"center":u+=x/2;break;case"bottom":u+=x;break}var S=e.pstyle("text-background-opacity").value,C=e.pstyle("text-border-opacity").value,k=e.pstyle("text-border-width").pfValue,T=e.pstyle("text-background-padding").pfValue,_=e.pstyle("text-background-shape").strValue,N=_==="round-rectangle"||_==="roundrectangle",P=_==="circle",R=2;if(S>0||k>0&&C>0){var I=t.fillStyle,M=t.strokeStyle,D=t.lineWidth,L=e.pstyle("text-background-color").value,j=e.pstyle("text-border-color").value,F=e.pstyle("text-border-style").value,O=S>0,B=k>0&&C>0,V=l-T;switch(y){case"left":V-=v;break;case"center":V-=v/2;break}var J=u-x-T,q=v+2*T,$=x+2*T;if(O&&(t.fillStyle="rgba(".concat(L[0],",").concat(L[1],",").concat(L[2],",").concat(S*o,")")),B&&(t.strokeStyle="rgba(".concat(j[0],",").concat(j[1],",").concat(j[2],",").concat(C*o,")"),t.lineWidth=k,t.setLineDash))switch(F){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"double":t.lineWidth=k/4,t.setLineDash([]);break;case"solid":default:t.setLineDash([]);break}if(N?(t.beginPath(),CE(t,V,J,q,$,R)):P?(t.beginPath(),a3(t,V,J,q,$)):(t.beginPath(),t.rect(V,J,q,$)),O&&t.fill(),B&&t.stroke(),B&&F==="double"){var z=k/2;t.beginPath(),N?CE(t,V+z,J+z,q-2*z,$-2*z,R):t.rect(V+z,J+z,q-2*z,$-2*z),t.stroke()}t.fillStyle=I,t.strokeStyle=M,t.lineWidth=D,t.setLineDash&&t.setLineDash([])}var W=2*e.pstyle("text-outline-width").pfValue;if(W>0&&(t.lineWidth=W),e.pstyle("text-wrap").value==="wrap"){var ne=pr(s,"labelWrapCachedLines",r),X=pr(s,"labelLineHeight",r),U=v/2,H=this.getLabelJustification(e);switch(H==="auto"||(y==="left"?H==="left"?l+=-v:H==="center"&&(l+=-U):y==="center"?H==="left"?l+=-U:H==="right"&&(l+=U):y==="right"&&(H==="center"?l+=U:H==="right"&&(l+=v))),w){case"top":u-=(ne.length-1)*X;break;case"center":case"bottom":u-=(ne.length-1)*X;break}for(var Y=0;Y<ne.length;Y++)W>0&&t.strokeText(ne[Y],l,u),t.fillText(ne[Y],l,u),u+=X}else W>0&&t.strokeText(f,l,u),t.fillText(f,l,u);E!==0&&(t.rotate(-E),t.translate(-c,-d))}}};var Aa={};Aa.drawNode=function(t,e,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,s=this,o,l,u=e._private,c=u.rscratch,d=e.position();if(!(!le(d.x)||!le(d.y))&&!(i&&!e.visible())){var f=i?e.effectiveOpacity():1,h=s.usePaths(),v,x=!1,b=e.padding();o=e.width()+2*b,l=e.height()+2*b;var m;r&&(m=r,t.translate(-m.x1,-m.y1));for(var p=e.pstyle("background-image"),y=p.value,w=new Array(y.length),E=new Array(y.length),S=0,C=0;C<y.length;C++){var k=y[C],T=w[C]=k!=null&&k!=="none";if(T){var _=e.cy().style().getIndexedStyle(e,"background-image-crossorigin","value",C);S++,E[C]=s.getCachedImage(k,_,function(){u.backgroundTimestamp=Date.now(),e.emitAndNotify("background")})}}var N=e.pstyle("background-blacken").value,P=e.pstyle("border-width").pfValue,R=e.pstyle("background-opacity").value*f,I=e.pstyle("border-color").value,M=e.pstyle("border-style").value,D=e.pstyle("border-join").value,L=e.pstyle("border-cap").value,j=e.pstyle("border-position").value,F=e.pstyle("border-dash-pattern").pfValue,O=e.pstyle("border-dash-offset").pfValue,B=e.pstyle("border-opacity").value*f,V=e.pstyle("outline-width").pfValue,J=e.pstyle("outline-color").value,q=e.pstyle("outline-style").value,$=e.pstyle("outline-opacity").value*f,z=e.pstyle("outline-offset").value,W=e.pstyle("corner-radius").value;W!=="auto"&&(W=e.pstyle("corner-radius").pfValue);var ne=function(){var A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:R;s.eleFillStyle(t,e,A)},X=function(){var A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:B;s.colorStrokeStyle(t,I[0],I[1],I[2],A)},U=function(){var A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:$;s.colorStrokeStyle(t,J[0],J[1],J[2],A)},H=function(A,G,K,Q){var re=s.nodePathCache=s.nodePathCache||[],me=WP(K==="polygon"?K+","+Q.join(","):K,""+G,""+A,""+W),ae=re[me],ce,ve=!1;return ae!=null?(ce=ae,ve=!0,c.pathCache=ce):(ce=new Path2D,re[me]=c.pathCache=ce),{path:ce,cacheHit:ve}},Y=e.pstyle("shape").strValue,ee=e.pstyle("shape-polygon-points").pfValue;if(h){t.translate(d.x,d.y);var ie=H(o,l,Y,ee);v=ie.path,x=ie.cacheHit}var oe=function(){if(!x){var A=d;h&&(A={x:0,y:0}),s.nodeShapes[s.getNodeShape(e)].draw(v||t,A.x,A.y,o,l,W,c)}h?t.fill(v):t.fill()},Re=function(){for(var A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:f,G=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,K=u.backgrounding,Q=0,re=0;re<E.length;re++){var me=e.cy().style().getIndexedStyle(e,"background-image-containment","value",re);if(G&&me==="over"||!G&&me==="inside"){Q++;continue}w[re]&&E[re].complete&&!E[re].error&&(Q++,s.drawInscribedImage(t,E[re],e,re,A))}u.backgrounding=Q!==S,K!==u.backgrounding&&e.updateStyle(!1)},ue=function(){var A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,G=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f;s.hasPie(e)&&(s.drawPie(t,e,G),A&&(h||s.nodeShapes[s.getNodeShape(e)].draw(t,d.x,d.y,o,l,W,c)))},Se=function(){var A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,G=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f;s.hasStripe(e)&&(t.save(),h?t.clip(c.pathCache):(s.nodeShapes[s.getNodeShape(e)].draw(t,d.x,d.y,o,l,W,c),t.clip()),s.drawStripe(t,e,G),t.restore(),A&&(h||s.nodeShapes[s.getNodeShape(e)].draw(t,d.x,d.y,o,l,W,c)))},be=function(){var A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:f,G=(N>0?N:-N)*A,K=N>0?0:255;N!==0&&(s.colorFillStyle(t,K,K,K,G),h?t.fill(v):t.fill())},de=function(){if(P>0){if(t.lineWidth=P,t.lineCap=L,t.lineJoin=D,t.setLineDash)switch(M){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash(F),t.lineDashOffset=O;break;case"solid":case"double":t.setLineDash([]);break}if(j!=="center"){if(t.save(),t.lineWidth*=2,j==="inside")h?t.clip(v):t.clip();else{var A=new Path2D;A.rect(-o/2-P,-l/2-P,o+2*P,l+2*P),A.addPath(v),t.clip(A,"evenodd")}h?t.stroke(v):t.stroke(),t.restore()}else h?t.stroke(v):t.stroke();if(M==="double"){t.lineWidth=P/3;var G=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",h?t.stroke(v):t.stroke(),t.globalCompositeOperation=G}t.setLineDash&&t.setLineDash([])}},xe=function(){if(V>0){if(t.lineWidth=V,t.lineCap="butt",t.setLineDash)switch(q){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"solid":case"double":t.setLineDash([]);break}var A=d;h&&(A={x:0,y:0});var G=s.getNodeShape(e),K=P;j==="inside"&&(K=0),j==="outside"&&(K*=2);var Q=(o+K+(V+z))/o,re=(l+K+(V+z))/l,me=o*Q,ae=l*re,ce=s.nodeShapes[G].points,ve;if(h){var ke=H(me,ae,G,ce);ve=ke.path}if(G==="ellipse")s.drawEllipsePath(ve||t,A.x,A.y,me,ae);else if(["round-diamond","round-heptagon","round-hexagon","round-octagon","round-pentagon","round-polygon","round-triangle","round-tag"].includes(G)){var _e=0,Pe=0,ye=0;G==="round-diamond"?_e=(K+z+V)*1.4:G==="round-heptagon"?(_e=(K+z+V)*1.075,ye=-(K/2+z+V)/35):G==="round-hexagon"?_e=(K+z+V)*1.12:G==="round-pentagon"?(_e=(K+z+V)*1.13,ye=-(K/2+z+V)/15):G==="round-tag"?(_e=(K+z+V)*1.12,Pe=(K/2+V+z)*.07):G==="round-triangle"&&(_e=(K+z+V)*(Math.PI/2),ye=-(K+z/2+V)/Math.PI),_e!==0&&(Q=(o+_e)/o,me=o*Q,["round-hexagon","round-tag"].includes(G)||(re=(l+_e)/l,ae=l*re)),W=W==="auto"?nA(me,ae):W;for(var Le=me/2,Fe=ae/2,Dt=W+(K+V+z)/2,yt=new Array(ce.length/2),Vr=new Array(ce.length/2),xt=0;xt<ce.length/2;xt++)yt[xt]={x:A.x+Pe+Le*ce[xt*2],y:A.y+ye+Fe*ce[xt*2+1]};var Et,Nt,zt,sn,ft=yt.length;for(Nt=yt[ft-1],Et=0;Et<ft;Et++)zt=yt[Et%ft],sn=yt[(Et+1)%ft],Vr[Et]=m1(Nt,zt,sn,Dt),Nt=zt,zt=sn;s.drawRoundPolygonPath(ve||t,A.x+Pe,A.y+ye,o*Q,l*re,ce,Vr)}else if(["roundrectangle","round-rectangle"].includes(G))W=W==="auto"?ba(me,ae):W,s.drawRoundRectanglePath(ve||t,A.x,A.y,me,ae,W+(K+V+z)/2);else if(["cutrectangle","cut-rectangle"].includes(G))W=W==="auto"?s1():W,s.drawCutRectanglePath(ve||t,A.x,A.y,me,ae,null,W+(K+V+z)/4);else if(["bottomroundrectangle","bottom-round-rectangle"].includes(G))W=W==="auto"?ba(me,ae):W,s.drawBottomRoundRectanglePath(ve||t,A.x,A.y,me,ae,W+(K+V+z)/2);else if(G==="barrel")s.drawBarrelPath(ve||t,A.x,A.y,me,ae);else if(G.startsWith("polygon")||["rhomboid","right-rhomboid","round-tag","tag","vee"].includes(G)){var Sn=(K+V+z)/o;ce=Qu(Ju(ce,Sn)),s.drawPolygonPath(ve||t,A.x,A.y,o,l,ce)}else{var Ur=(K+V+z)/o;ce=Qu(Ju(ce,-Ur)),s.drawPolygonPath(ve||t,A.x,A.y,o,l,ce)}if(h?t.stroke(ve):t.stroke(),q==="double"){t.lineWidth=K/3;var Vn=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",h?t.stroke(ve):t.stroke(),t.globalCompositeOperation=Vn}t.setLineDash&&t.setLineDash([])}},fe=function(){a&&s.drawNodeOverlay(t,e,d,o,l)},we=function(){a&&s.drawNodeUnderlay(t,e,d,o,l)},Ce=function(){s.drawElementText(t,e,null,n)},Ne=e.pstyle("ghost").value==="yes";if(Ne){var De=e.pstyle("ghost-offset-x").pfValue,$e=e.pstyle("ghost-offset-y").pfValue,je=e.pstyle("ghost-opacity").value,Oe=je*f;t.translate(De,$e),U(),xe(),ne(je*R),oe(),Re(Oe,!0),X(je*B),de(),ue(N!==0||P!==0),Se(N!==0||P!==0),Re(Oe,!1),be(Oe),t.translate(-De,-$e)}h&&t.translate(-d.x,-d.y),we(),h&&t.translate(d.x,d.y),U(),xe(),ne(),oe(),Re(f,!0),X(),de(),ue(N!==0||P!==0),Se(N!==0||P!==0),Re(f,!1),be(),h&&t.translate(-d.x,-d.y),Ce(),fe(),r&&t.translate(m.x1,m.y1)}};var cj=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(r,n,a,i,s){var o=this;if(n.visible()){var l=n.pstyle("".concat(e,"-padding")).pfValue,u=n.pstyle("".concat(e,"-opacity")).value,c=n.pstyle("".concat(e,"-color")).value,d=n.pstyle("".concat(e,"-shape")).value,f=n.pstyle("".concat(e,"-corner-radius")).value;if(u>0){if(a=a||n.position(),i==null||s==null){var h=n.padding();i=n.width()+2*h,s=n.height()+2*h}o.colorFillStyle(r,c[0],c[1],c[2],u),o.nodeShapes[d].draw(r,a.x,a.y,i+l*2,s+l*2,f),r.fill()}}}};Aa.drawNodeOverlay=cj("overlay");Aa.drawNodeUnderlay=cj("underlay");Aa.hasPie=function(t){return t=t[0],t._private.hasPie};Aa.hasStripe=function(t){return t=t[0],t._private.hasStripe};Aa.drawPie=function(t,e,r,n){e=e[0],n=n||e.position();var a=e.cy().style(),i=e.pstyle("pie-size"),s=e.pstyle("pie-hole"),o=e.pstyle("pie-start-angle").pfValue,l=n.x,u=n.y,c=e.width(),d=e.height(),f=Math.min(c,d)/2,h,v=0,x=this.usePaths();if(x&&(l=0,u=0),i.units==="%"?f=f*i.pfValue:i.pfValue!==void 0&&(f=i.pfValue/2),s.units==="%"?h=f*s.pfValue:s.pfValue!==void 0&&(h=s.pfValue/2),!(h>=f))for(var b=1;b<=a.pieBackgroundN;b++){var m=e.pstyle("pie-"+b+"-background-size").value,p=e.pstyle("pie-"+b+"-background-color").value,y=e.pstyle("pie-"+b+"-background-opacity").value*r,w=m/100;w+v>1&&(w=1-v);var E=1.5*Math.PI+2*Math.PI*v;E+=o;var S=2*Math.PI*w,C=E+S;m===0||v>=1||v+w>1||(h===0?(t.beginPath(),t.moveTo(l,u),t.arc(l,u,f,E,C),t.closePath()):(t.beginPath(),t.arc(l,u,f,E,C),t.arc(l,u,h,C,E,!0),t.closePath()),this.colorFillStyle(t,p[0],p[1],p[2],y),t.fill(),v+=w)}};Aa.drawStripe=function(t,e,r,n){e=e[0],n=n||e.position();var a=e.cy().style(),i=n.x,s=n.y,o=e.width(),l=e.height(),u=0,c=this.usePaths();t.save();var d=e.pstyle("stripe-direction").value,f=e.pstyle("stripe-size");switch(d){case"vertical":break;case"righward":t.rotate(-Math.PI/2);break}var h=o,v=l;f.units==="%"?(h=h*f.pfValue,v=v*f.pfValue):f.pfValue!==void 0&&(h=f.pfValue,v=f.pfValue),c&&(i=0,s=0),s-=h/2,i-=v/2;for(var x=1;x<=a.stripeBackgroundN;x++){var b=e.pstyle("stripe-"+x+"-background-size").value,m=e.pstyle("stripe-"+x+"-background-color").value,p=e.pstyle("stripe-"+x+"-background-opacity").value*r,y=b/100;y+u>1&&(y=1-u),!(b===0||u>=1||u+y>1)&&(t.beginPath(),t.rect(i,s+v*u,h,v*y),t.closePath(),this.colorFillStyle(t,m[0],m[1],m[2],p),t.fill(),u+=y)}t.restore()};var dr={},i3=100;dr.getPixelRatio=function(){var t=this.data.contexts[0];if(this.forcedPixelRatio!=null)return this.forcedPixelRatio;var e=this.cy.window(),r=t.backingStorePixelRatio||t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return(e.devicePixelRatio||1)/r};dr.paintCache=function(t){for(var e=this.paintCaches=this.paintCaches||[],r=!0,n,a=0;a<e.length;a++)if(n=e[a],n.context===t){r=!1;break}return r&&(n={context:t},e.push(n)),n};dr.createGradientStyleFor=function(t,e,r,n,a){var i,s=this.usePaths(),o=r.pstyle(e+"-gradient-stop-colors").value,l=r.pstyle(e+"-gradient-stop-positions").pfValue;if(n==="radial-gradient")if(r.isEdge()){var u=r.sourceEndpoint(),c=r.targetEndpoint(),d=r.midpoint(),f=ai(u,d),h=ai(c,d);i=t.createRadialGradient(d.x,d.y,0,d.x,d.y,Math.max(f,h))}else{var v=s?{x:0,y:0}:r.position(),x=r.paddedWidth(),b=r.paddedHeight();i=t.createRadialGradient(v.x,v.y,0,v.x,v.y,Math.max(x,b))}else if(r.isEdge()){var m=r.sourceEndpoint(),p=r.targetEndpoint();i=t.createLinearGradient(m.x,m.y,p.x,p.y)}else{var y=s?{x:0,y:0}:r.position(),w=r.paddedWidth(),E=r.paddedHeight(),S=w/2,C=E/2,k=r.pstyle("background-gradient-direction").value;switch(k){case"to-bottom":i=t.createLinearGradient(y.x,y.y-C,y.x,y.y+C);break;case"to-top":i=t.createLinearGradient(y.x,y.y+C,y.x,y.y-C);break;case"to-left":i=t.createLinearGradient(y.x+S,y.y,y.x-S,y.y);break;case"to-right":i=t.createLinearGradient(y.x-S,y.y,y.x+S,y.y);break;case"to-bottom-right":case"to-right-bottom":i=t.createLinearGradient(y.x-S,y.y-C,y.x+S,y.y+C);break;case"to-top-right":case"to-right-top":i=t.createLinearGradient(y.x-S,y.y+C,y.x+S,y.y-C);break;case"to-bottom-left":case"to-left-bottom":i=t.createLinearGradient(y.x+S,y.y-C,y.x-S,y.y+C);break;case"to-top-left":case"to-left-top":i=t.createLinearGradient(y.x+S,y.y+C,y.x-S,y.y-C);break}}if(!i)return null;for(var T=l.length===o.length,_=o.length,N=0;N<_;N++)i.addColorStop(T?l[N]:N/(_-1),"rgba("+o[N][0]+","+o[N][1]+","+o[N][2]+","+a+")");return i};dr.gradientFillStyle=function(t,e,r,n){var a=this.createGradientStyleFor(t,"background",e,r,n);if(!a)return null;t.fillStyle=a};dr.colorFillStyle=function(t,e,r,n,a){t.fillStyle="rgba("+e+","+r+","+n+","+a+")"};dr.eleFillStyle=function(t,e,r){var n=e.pstyle("background-fill").value;if(n==="linear-gradient"||n==="radial-gradient")this.gradientFillStyle(t,e,n,r);else{var a=e.pstyle("background-color").value;this.colorFillStyle(t,a[0],a[1],a[2],r)}};dr.gradientStrokeStyle=function(t,e,r,n){var a=this.createGradientStyleFor(t,"line",e,r,n);if(!a)return null;t.strokeStyle=a};dr.colorStrokeStyle=function(t,e,r,n,a){t.strokeStyle="rgba("+e+","+r+","+n+","+a+")"};dr.eleStrokeStyle=function(t,e,r){var n=e.pstyle("line-fill").value;if(n==="linear-gradient"||n==="radial-gradient")this.gradientStrokeStyle(t,e,n,r);else{var a=e.pstyle("line-color").value;this.colorStrokeStyle(t,a[0],a[1],a[2],r)}};dr.matchCanvasSize=function(t){var e=this,r=e.data,n=e.findContainerClientCoords(),a=n[2],i=n[3],s=e.getPixelRatio(),o=e.motionBlurPxRatio;(t===e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_NODE]||t===e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_DRAG])&&(s=o);var l=a*s,u=i*s,c;if(!(l===e.canvasWidth&&u===e.canvasHeight)){e.fontCaches=null;var d=r.canvasContainer;d.style.width=a+"px",d.style.height=i+"px";for(var f=0;f<e.CANVAS_LAYERS;f++)c=r.canvases[f],c.width=l,c.height=u,c.style.width=a+"px",c.style.height=i+"px";for(var f=0;f<e.BUFFER_COUNT;f++)c=r.bufferCanvases[f],c.width=l,c.height=u,c.style.width=a+"px",c.style.height=i+"px";e.textureMult=1,s<=1&&(c=r.bufferCanvases[e.TEXTURE_BUFFER],e.textureMult=2,c.width=l*e.textureMult,c.height=u*e.textureMult),e.canvasWidth=l,e.canvasHeight=u,e.pixelRatio=s}};dr.renderTo=function(t,e,r,n){this.render({forcedContext:t,forcedZoom:e,forcedPan:r,drawAllLayers:!0,forcedPxRatio:n})};dr.clearCanvas=function(){var t=this,e=t.data;function r(n){n.clearRect(0,0,t.canvasWidth,t.canvasHeight)}r(e.contexts[t.NODE]),r(e.contexts[t.DRAG])};dr.render=function(t){var e=this;t=t||ZP();var r=e.cy,n=t.forcedContext,a=t.drawAllLayers,i=t.drawOnlyNodeLayer,s=t.forcedZoom,o=t.forcedPan,l=t.forcedPxRatio===void 0?this.getPixelRatio():t.forcedPxRatio,u=e.data,c=u.canvasNeedsRedraw,d=e.textureOnViewport&&!n&&(e.pinching||e.hoverData.dragging||e.swipePanning||e.data.wheelZooming),f=t.motionBlur!==void 0?t.motionBlur:e.motionBlur,h=e.motionBlurPxRatio,v=r.hasCompoundNodes(),x=e.hoverData.draggingEles,b=!!(e.hoverData.selecting||e.touchData.selecting);f=f&&!n&&e.motionBlurEnabled&&!b;var m=f;n||(e.prevPxRatio!==l&&(e.invalidateContainerClientCoordsCache(),e.matchCanvasSize(e.container),e.redrawHint("eles",!0),e.redrawHint("drag",!0)),e.prevPxRatio=l),!n&&e.motionBlurTimeout&&clearTimeout(e.motionBlurTimeout),f&&(e.mbFrames==null&&(e.mbFrames=0),e.mbFrames++,e.mbFrames<3&&(m=!1),e.mbFrames>e.minMbLowQualFrames&&(e.motionBlurPxRatio=e.mbPxRBlurry)),e.clearingMotionBlur&&(e.motionBlurPxRatio=1),e.textureDrawLastFrame&&!d&&(c[e.NODE]=!0,c[e.SELECT_BOX]=!0);var p=r.style(),y=r.zoom(),w=s!==void 0?s:y,E=r.pan(),S={x:E.x,y:E.y},C={zoom:y,pan:{x:E.x,y:E.y}},k=e.prevViewport,T=k===void 0||C.zoom!==k.zoom||C.pan.x!==k.pan.x||C.pan.y!==k.pan.y;!T&&!(x&&!v)&&(e.motionBlurPxRatio=1),o&&(S=o),w*=l,S.x*=l,S.y*=l;var _=e.getCachedZSortedEles();function N(X,U,H,Y,ee){var ie=X.globalCompositeOperation;X.globalCompositeOperation="destination-out",e.colorFillStyle(X,255,255,255,e.motionBlurTransparency),X.fillRect(U,H,Y,ee),X.globalCompositeOperation=ie}function P(X,U){var H,Y,ee,ie;!e.clearingMotionBlur&&(X===u.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]||X===u.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG])?(H={x:E.x*h,y:E.y*h},Y=y*h,ee=e.canvasWidth*h,ie=e.canvasHeight*h):(H=S,Y=w,ee=e.canvasWidth,ie=e.canvasHeight),X.setTransform(1,0,0,1,0,0),U==="motionBlur"?N(X,0,0,ee,ie):!n&&(U===void 0||U)&&X.clearRect(0,0,ee,ie),a||(X.translate(H.x,H.y),X.scale(Y,Y)),o&&X.translate(o.x,o.y),s&&X.scale(s,s)}if(d||(e.textureDrawLastFrame=!1),d){if(e.textureDrawLastFrame=!0,!e.textureCache){e.textureCache={},e.textureCache.bb=r.mutableElements().boundingBox(),e.textureCache.texture=e.data.bufferCanvases[e.TEXTURE_BUFFER];var R=e.data.bufferContexts[e.TEXTURE_BUFFER];R.setTransform(1,0,0,1,0,0),R.clearRect(0,0,e.canvasWidth*e.textureMult,e.canvasHeight*e.textureMult),e.render({forcedContext:R,drawOnlyNodeLayer:!0,forcedPxRatio:l*e.textureMult});var C=e.textureCache.viewport={zoom:r.zoom(),pan:r.pan(),width:e.canvasWidth,height:e.canvasHeight};C.mpan={x:(0-C.pan.x)/C.zoom,y:(0-C.pan.y)/C.zoom}}c[e.DRAG]=!1,c[e.NODE]=!1;var I=u.contexts[e.NODE],M=e.textureCache.texture,C=e.textureCache.viewport;I.setTransform(1,0,0,1,0,0),f?N(I,0,0,C.width,C.height):I.clearRect(0,0,C.width,C.height);var D=p.core("outside-texture-bg-color").value,L=p.core("outside-texture-bg-opacity").value;e.colorFillStyle(I,D[0],D[1],D[2],L),I.fillRect(0,0,C.width,C.height);var y=r.zoom();P(I,!1),I.clearRect(C.mpan.x,C.mpan.y,C.width/C.zoom/l,C.height/C.zoom/l),I.drawImage(M,C.mpan.x,C.mpan.y,C.width/C.zoom/l,C.height/C.zoom/l)}else e.textureOnViewport&&!n&&(e.textureCache=null);var j=r.extent(),F=e.pinching||e.hoverData.dragging||e.swipePanning||e.data.wheelZooming||e.hoverData.draggingEles||e.cy.animated(),O=e.hideEdgesOnViewport&&F,B=[];if(B[e.NODE]=!c[e.NODE]&&f&&!e.clearedForMotionBlur[e.NODE]||e.clearingMotionBlur,B[e.NODE]&&(e.clearedForMotionBlur[e.NODE]=!0),B[e.DRAG]=!c[e.DRAG]&&f&&!e.clearedForMotionBlur[e.DRAG]||e.clearingMotionBlur,B[e.DRAG]&&(e.clearedForMotionBlur[e.DRAG]=!0),c[e.NODE]||a||i||B[e.NODE]){var V=f&&!B[e.NODE]&&h!==1,I=n||(V?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]:u.contexts[e.NODE]),J=f&&!V?"motionBlur":void 0;P(I,J),O?e.drawCachedNodes(I,_.nondrag,l,j):e.drawLayeredElements(I,_.nondrag,l,j),e.debug&&e.drawDebugPoints(I,_.nondrag),!a&&!f&&(c[e.NODE]=!1)}if(!i&&(c[e.DRAG]||a||B[e.DRAG])){var V=f&&!B[e.DRAG]&&h!==1,I=n||(V?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG]:u.contexts[e.DRAG]);P(I,f&&!V?"motionBlur":void 0),O?e.drawCachedNodes(I,_.drag,l,j):e.drawCachedElements(I,_.drag,l,j),e.debug&&e.drawDebugPoints(I,_.drag),!a&&!f&&(c[e.DRAG]=!1)}if(this.drawSelectionRectangle(t,P),f&&h!==1){var q=u.contexts[e.NODE],$=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_NODE],z=u.contexts[e.DRAG],W=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_DRAG],ne=function(U,H,Y){U.setTransform(1,0,0,1,0,0),Y||!m?U.clearRect(0,0,e.canvasWidth,e.canvasHeight):N(U,0,0,e.canvasWidth,e.canvasHeight);var ee=h;U.drawImage(H,0,0,e.canvasWidth*ee,e.canvasHeight*ee,0,0,e.canvasWidth,e.canvasHeight)};(c[e.NODE]||B[e.NODE])&&(ne(q,$,B[e.NODE]),c[e.NODE]=!1),(c[e.DRAG]||B[e.DRAG])&&(ne(z,W,B[e.DRAG]),c[e.DRAG]=!1)}e.prevViewport=C,e.clearingMotionBlur&&(e.clearingMotionBlur=!1,e.motionBlurCleared=!0,e.motionBlur=!0),f&&(e.motionBlurTimeout=setTimeout(function(){e.motionBlurTimeout=null,e.clearedForMotionBlur[e.NODE]=!1,e.clearedForMotionBlur[e.DRAG]=!1,e.motionBlur=!1,e.clearingMotionBlur=!d,e.mbFrames=0,c[e.NODE]=!0,c[e.DRAG]=!0,e.redraw()},i3)),n||r.emit("render")};var Vs;dr.drawSelectionRectangle=function(t,e){var r=this,n=r.cy,a=r.data,i=n.style(),s=t.drawOnlyNodeLayer,o=t.drawAllLayers,l=a.canvasNeedsRedraw,u=t.forcedContext;if(r.showFps||!s&&l[r.SELECT_BOX]&&!o){var c=u||a.contexts[r.SELECT_BOX];if(e(c),r.selection[4]==1&&(r.hoverData.selecting||r.touchData.selecting)){var d=r.cy.zoom(),f=i.core("selection-box-border-width").value/d;c.lineWidth=f,c.fillStyle="rgba("+i.core("selection-box-color").value[0]+","+i.core("selection-box-color").value[1]+","+i.core("selection-box-color").value[2]+","+i.core("selection-box-opacity").value+")",c.fillRect(r.selection[0],r.selection[1],r.selection[2]-r.selection[0],r.selection[3]-r.selection[1]),f>0&&(c.strokeStyle="rgba("+i.core("selection-box-border-color").value[0]+","+i.core("selection-box-border-color").value[1]+","+i.core("selection-box-border-color").value[2]+","+i.core("selection-box-opacity").value+")",c.strokeRect(r.selection[0],r.selection[1],r.selection[2]-r.selection[0],r.selection[3]-r.selection[1]))}if(a.bgActivePosistion&&!r.hoverData.selecting){var d=r.cy.zoom(),h=a.bgActivePosistion;c.fillStyle="rgba("+i.core("active-bg-color").value[0]+","+i.core("active-bg-color").value[1]+","+i.core("active-bg-color").value[2]+","+i.core("active-bg-opacity").value+")",c.beginPath(),c.arc(h.x,h.y,i.core("active-bg-size").pfValue/d,0,2*Math.PI),c.fill()}var v=r.lastRedrawTime;if(r.showFps&&v){v=Math.round(v);var x=Math.round(1e3/v),b="1 frame = "+v+" ms = "+x+" fps";if(c.setTransform(1,0,0,1,0,0),c.fillStyle="rgba(255, 0, 0, 0.75)",c.strokeStyle="rgba(255, 0, 0, 0.75)",c.font="30px Arial",!Vs){var m=c.measureText(b);Vs=m.actualBoundingBoxAscent}c.fillText(b,0,Vs);var p=60;c.strokeRect(0,Vs+10,250,20),c.fillRect(0,Vs+10,250*Math.min(x/p,1),20)}o||(l[r.SELECT_BOX]=!1)}};function kE(t,e,r){var n=t.createShader(e);if(t.shaderSource(n,r),t.compileShader(n),!t.getShaderParameter(n,t.COMPILE_STATUS))throw new Error(t.getShaderInfoLog(n));return n}function s3(t,e,r){var n=kE(t,t.VERTEX_SHADER,e),a=kE(t,t.FRAGMENT_SHADER,r),i=t.createProgram();if(t.attachShader(i,n),t.attachShader(i,a),t.linkProgram(i),!t.getProgramParameter(i,t.LINK_STATUS))throw new Error("Could not initialize shaders");return i}function o3(t,e,r){r===void 0&&(r=e);var n=t.makeOffscreenCanvas(e,r),a=n.context=n.getContext("2d");return n.clear=function(){return a.clearRect(0,0,n.width,n.height)},n.clear(),n}function b1(t){var e=t.pixelRatio,r=t.cy.zoom(),n=t.cy.pan();return{zoom:r*e,pan:{x:n.x*e,y:n.y*e}}}function l3(t){var e=t.pixelRatio,r=t.cy.zoom();return r*e}function u3(t,e,r,n,a){var i=n*r+e.x,s=a*r+e.y;return s=Math.round(t.canvasHeight-s),[i,s]}function c3(t,e){return e.picking?!0:t.pstyle("background-fill").value!=="solid"||t.pstyle("background-image").strValue!=="none"?!1:t.pstyle("border-width").value===0||t.pstyle("border-opacity").value===0?!0:t.pstyle("border-style").value==="solid"}function d3(t,e){if(t.length!==e.length)return!1;for(var r=0;r<t.length;r++)if(t[r]!==e[r])return!1;return!0}function La(t,e,r){var n=t[0]/255,a=t[1]/255,i=t[2]/255,s=e,o=r||new Array(4);return o[0]=n*s,o[1]=a*s,o[2]=i*s,o[3]=s,o}function Si(t,e){var r=e||new Array(4);return r[0]=(t>>0&255)/255,r[1]=(t>>8&255)/255,r[2]=(t>>16&255)/255,r[3]=(t>>24&255)/255,r}function f3(t){return t[0]+(t[1]<<8)+(t[2]<<16)+(t[3]<<24)}function v3(t,e){var r=t.createTexture();return r.buffer=function(n){t.bindTexture(t.TEXTURE_2D,r),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR_MIPMAP_NEAREST),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,n),t.generateMipmap(t.TEXTURE_2D),t.bindTexture(t.TEXTURE_2D,null)},r.deleteTexture=function(){t.deleteTexture(r)},r}function dj(t,e){switch(e){case"float":return[1,t.FLOAT,4];case"vec2":return[2,t.FLOAT,4];case"vec3":return[3,t.FLOAT,4];case"vec4":return[4,t.FLOAT,4];case"int":return[1,t.INT,4];case"ivec2":return[2,t.INT,4]}}function fj(t,e,r){switch(e){case t.FLOAT:return new Float32Array(r);case t.INT:return new Int32Array(r)}}function h3(t,e,r,n,a,i){switch(e){case t.FLOAT:return new Float32Array(r.buffer,i*n,a);case t.INT:return new Int32Array(r.buffer,i*n,a)}}function p3(t,e,r,n){var a=dj(t,e),i=kt(a,2),s=i[0],o=i[1],l=fj(t,o,n),u=t.createBuffer();return t.bindBuffer(t.ARRAY_BUFFER,u),t.bufferData(t.ARRAY_BUFFER,l,t.STATIC_DRAW),o===t.FLOAT?t.vertexAttribPointer(r,s,o,!1,0,0):o===t.INT&&t.vertexAttribIPointer(r,s,o,0,0),t.enableVertexAttribArray(r),t.bindBuffer(t.ARRAY_BUFFER,null),u}function un(t,e,r,n){var a=dj(t,r),i=kt(a,3),s=i[0],o=i[1],l=i[2],u=fj(t,o,e*s),c=s*l,d=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,d),t.bufferData(t.ARRAY_BUFFER,e*c,t.DYNAMIC_DRAW),t.enableVertexAttribArray(n),o===t.FLOAT?t.vertexAttribPointer(n,s,o,!1,c,0):o===t.INT&&t.vertexAttribIPointer(n,s,o,c,0),t.vertexAttribDivisor(n,1),t.bindBuffer(t.ARRAY_BUFFER,null);for(var f=new Array(e),h=0;h<e;h++)f[h]=h3(t,o,u,c,s,h);return d.dataArray=u,d.stride=c,d.size=s,d.getView=function(v){return f[v]},d.setPoint=function(v,x,b){var m=f[v];m[0]=x,m[1]=b},d.bufferSubData=function(v){t.bindBuffer(t.ARRAY_BUFFER,d),v?t.bufferSubData(t.ARRAY_BUFFER,0,u,0,v*s):t.bufferSubData(t.ARRAY_BUFFER,0,u)},d}function g3(t,e,r){for(var n=9,a=new Float32Array(e*n),i=new Array(e),s=0;s<e;s++){var o=s*n*4;i[s]=new Float32Array(a.buffer,o,n)}var l=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,l),t.bufferData(t.ARRAY_BUFFER,a.byteLength,t.DYNAMIC_DRAW);for(var u=0;u<3;u++){var c=r+u;t.enableVertexAttribArray(c),t.vertexAttribPointer(c,3,t.FLOAT,!1,3*12,u*12),t.vertexAttribDivisor(c,1)}return t.bindBuffer(t.ARRAY_BUFFER,null),l.getMatrixView=function(d){return i[d]},l.setData=function(d,f){i[f].set(d,0)},l.bufferSubData=function(){t.bindBuffer(t.ARRAY_BUFFER,l),t.bufferSubData(t.ARRAY_BUFFER,0,a)},l}function m3(t){var e=t.createFramebuffer();t.bindFramebuffer(t.FRAMEBUFFER,e);var r=t.createTexture();return t.bindTexture(t.TEXTURE_2D,r),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,r,0),t.bindFramebuffer(t.FRAMEBUFFER,null),e.setFramebufferAttachmentSizes=function(n,a){t.bindTexture(t.TEXTURE_2D,r),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,n,a,0,t.RGBA,t.UNSIGNED_BYTE,null)},e}var TE=typeof Float32Array<"u"?Float32Array:Array;Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});function cv(){var t=new TE(9);return TE!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function _E(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function y3(t,e,r){var n=e[0],a=e[1],i=e[2],s=e[3],o=e[4],l=e[5],u=e[6],c=e[7],d=e[8],f=r[0],h=r[1],v=r[2],x=r[3],b=r[4],m=r[5],p=r[6],y=r[7],w=r[8];return t[0]=f*n+h*s+v*u,t[1]=f*a+h*o+v*c,t[2]=f*i+h*l+v*d,t[3]=x*n+b*s+m*u,t[4]=x*a+b*o+m*c,t[5]=x*i+b*l+m*d,t[6]=p*n+y*s+w*u,t[7]=p*a+y*o+w*c,t[8]=p*i+y*l+w*d,t}function bu(t,e,r){var n=e[0],a=e[1],i=e[2],s=e[3],o=e[4],l=e[5],u=e[6],c=e[7],d=e[8],f=r[0],h=r[1];return t[0]=n,t[1]=a,t[2]=i,t[3]=s,t[4]=o,t[5]=l,t[6]=f*n+h*s+u,t[7]=f*a+h*o+c,t[8]=f*i+h*l+d,t}function NE(t,e,r){var n=e[0],a=e[1],i=e[2],s=e[3],o=e[4],l=e[5],u=e[6],c=e[7],d=e[8],f=Math.sin(r),h=Math.cos(r);return t[0]=h*n+f*s,t[1]=h*a+f*o,t[2]=h*i+f*l,t[3]=h*s-f*n,t[4]=h*o-f*a,t[5]=h*l-f*i,t[6]=u,t[7]=c,t[8]=d,t}function G0(t,e,r){var n=r[0],a=r[1];return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=a*e[3],t[4]=a*e[4],t[5]=a*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function x3(t,e,r){return t[0]=2/e,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/r,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t}var b3=function(){function t(e,r,n,a){Na(this,t),this.debugID=Math.floor(Math.random()*1e4),this.r=e,this.texSize=r,this.texRows=n,this.texHeight=Math.floor(r/n),this.enableWrapping=!0,this.locked=!1,this.texture=null,this.needsBuffer=!0,this.freePointer={x:0,row:0},this.keyToLocation=new Map,this.canvas=a(e,r,r),this.scratch=a(e,r,this.texHeight,"scratch")}return Ra(t,[{key:"lock",value:function(){this.locked=!0}},{key:"getKeys",value:function(){return new Set(this.keyToLocation.keys())}},{key:"getScale",value:function(r){var n=r.w,a=r.h,i=this.texHeight,s=this.texSize,o=i/a,l=n*o,u=a*o;return l>s&&(o=s/n,l=n*o,u=a*o),{scale:o,texW:l,texH:u}}},{key:"draw",value:function(r,n,a){var i=this;if(this.locked)throw new Error("can't draw, atlas is locked");var s=this.texSize,o=this.texRows,l=this.texHeight,u=this.getScale(n),c=u.scale,d=u.texW,f=u.texH,h=function(y,w){if(a&&w){var E=w.context,S=y.x,C=y.row,k=S,T=l*C;E.save(),E.translate(k,T),E.scale(c,c),a(E,n),E.restore()}},v=[null,null],x=function(){h(i.freePointer,i.canvas),v[0]={x:i.freePointer.x,y:i.freePointer.row*l,w:d,h:f},v[1]={x:i.freePointer.x+d,y:i.freePointer.row*l,w:0,h:f},i.freePointer.x+=d,i.freePointer.x==s&&(i.freePointer.x=0,i.freePointer.row++)},b=function(){var y=i.scratch,w=i.canvas;y.clear(),h({x:0,row:0},y);var E=s-i.freePointer.x,S=d-E,C=l;{var k=i.freePointer.x,T=i.freePointer.row*l,_=E;w.context.drawImage(y,0,0,_,C,k,T,_,C),v[0]={x:k,y:T,w:_,h:f}}{var N=E,P=(i.freePointer.row+1)*l,R=S;w&&w.context.drawImage(y,N,0,R,C,0,P,R,C),v[1]={x:0,y:P,w:R,h:f}}i.freePointer.x=S,i.freePointer.row++},m=function(){i.freePointer.x=0,i.freePointer.row++};if(this.freePointer.x+d<=s)x();else{if(this.freePointer.row>=o-1)return!1;this.freePointer.x===s?(m(),x()):this.enableWrapping?b():(m(),x())}return this.keyToLocation.set(r,v),this.needsBuffer=!0,v}},{key:"getOffsets",value:function(r){return this.keyToLocation.get(r)}},{key:"isEmpty",value:function(){return this.freePointer.x===0&&this.freePointer.row===0}},{key:"canFit",value:function(r){if(this.locked)return!1;var n=this.texSize,a=this.texRows,i=this.getScale(r),s=i.texW;return this.freePointer.x+s>n?this.freePointer.row<a-1:!0}},{key:"bufferIfNeeded",value:function(r){this.texture||(this.texture=v3(r,this.debugID)),this.needsBuffer&&(this.texture.buffer(this.canvas),this.needsBuffer=!1,this.locked&&(this.canvas=null,this.scratch=null))}},{key:"dispose",value:function(){this.texture&&(this.texture.deleteTexture(),this.texture=null),this.canvas=null,this.scratch=null,this.locked=!0}}])}(),w3=function(){function t(e,r,n,a){Na(this,t),this.r=e,this.texSize=r,this.texRows=n,this.createTextureCanvas=a,this.atlases=[],this.styleKeyToAtlas=new Map,this.markedKeys=new Set}return Ra(t,[{key:"getKeys",value:function(){return new Set(this.styleKeyToAtlas.keys())}},{key:"_createAtlas",value:function(){var r=this.r,n=this.texSize,a=this.texRows,i=this.createTextureCanvas;return new b3(r,n,a,i)}},{key:"_getScratchCanvas",value:function(){if(!this.scratch){var r=this.r,n=this.texSize,a=this.texRows,i=this.createTextureCanvas,s=Math.floor(n/a);this.scratch=i(r,n,s,"scratch")}return this.scratch}},{key:"draw",value:function(r,n,a){var i=this.styleKeyToAtlas.get(r);return i||(i=this.atlases[this.atlases.length-1],(!i||!i.canFit(n))&&(i&&i.lock(),i=this._createAtlas(),this.atlases.push(i)),i.draw(r,n,a),this.styleKeyToAtlas.set(r,i)),i}},{key:"getAtlas",value:function(r){return this.styleKeyToAtlas.get(r)}},{key:"hasAtlas",value:function(r){return this.styleKeyToAtlas.has(r)}},{key:"markKeyForGC",value:function(r){this.markedKeys.add(r)}},{key:"gc",value:function(){var r=this,n=this.markedKeys;if(n.size===0){console.log("nothing to garbage collect");return}var a=[],i=new Map,s=null,o=xr(this.atlases),l;try{var u=function(){var d=l.value,f=d.getKeys(),h=S3(n,f);if(h.size===0)return a.push(d),f.forEach(function(E){return i.set(E,d)}),1;s||(s=r._createAtlas(),a.push(s));var v=xr(f),x;try{for(v.s();!(x=v.n()).done;){var b=x.value;if(!h.has(b)){var m=d.getOffsets(b),p=kt(m,2),y=p[0],w=p[1];s.canFit({w:y.w+w.w,h:y.h})||(s.lock(),s=r._createAtlas(),a.push(s)),d.canvas&&(r._copyTextureToNewAtlas(b,d,s),i.set(b,s))}}}catch(E){v.e(E)}finally{v.f()}d.dispose()};for(o.s();!(l=o.n()).done;)u()}catch(c){o.e(c)}finally{o.f()}this.atlases=a,this.styleKeyToAtlas=i,this.markedKeys=new Set}},{key:"_copyTextureToNewAtlas",value:function(r,n,a){var i=n.getOffsets(r),s=kt(i,2),o=s[0],l=s[1];if(l.w===0)a.draw(r,o,function(f){f.drawImage(n.canvas,o.x,o.y,o.w,o.h,0,0,o.w,o.h)});else{var u=this._getScratchCanvas();u.clear(),u.context.drawImage(n.canvas,o.x,o.y,o.w,o.h,0,0,o.w,o.h),u.context.drawImage(n.canvas,l.x,l.y,l.w,l.h,o.w,0,l.w,l.h);var c=o.w+l.w,d=o.h;a.draw(r,{w:c,h:d},function(f){f.drawImage(u,0,0,c,d,0,0,c,d)})}}},{key:"getCounts",value:function(){return{keyCount:this.styleKeyToAtlas.size,atlasCount:new Set(this.styleKeyToAtlas.values()).size}}}])}();function S3(t,e){return t.intersection?t.intersection(e):new Set(Ku(t).filter(function(r){return e.has(r)}))}var E3=function(){function t(e,r){Na(this,t),this.r=e,this.globalOptions=r,this.atlasSize=r.webglTexSize,this.maxAtlasesPerBatch=r.webglTexPerBatch,this.renderTypes=new Map,this.collections=new Map,this.typeAndIdToKey=new Map}return Ra(t,[{key:"getAtlasSize",value:function(){return this.atlasSize}},{key:"addAtlasCollection",value:function(r,n){var a=this.globalOptions,i=a.webglTexSize,s=a.createTextureCanvas,o=n.texRows,l=this._cacheScratchCanvas(s),u=new w3(this.r,i,o,l);this.collections.set(r,u)}},{key:"addRenderType",value:function(r,n){var a=n.collection;if(!this.collections.has(a))throw new Error("invalid atlas collection name '".concat(a,"'"));var i=this.collections.get(a),s=Te({type:r,atlasCollection:i},n);this.renderTypes.set(r,s)}},{key:"getRenderTypeOpts",value:function(r){return this.renderTypes.get(r)}},{key:"getAtlasCollection",value:function(r){return this.collections.get(r)}},{key:"_cacheScratchCanvas",value:function(r){var n=-1,a=-1,i=null;return function(s,o,l,u){return u?((!i||o!=n||l!=a)&&(n=o,a=l,i=r(s,o,l)),i):r(s,o,l)}}},{key:"_key",value:function(r,n){return"".concat(r,"-").concat(n)}},{key:"invalidate",value:function(r){var n=this,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=a.forceRedraw,s=i===void 0?!1:i,o=a.filterEle,l=o===void 0?function(){return!0}:o,u=a.filterType,c=u===void 0?function(){return!0}:u,d=!1,f=!1,h=xr(r),v;try{for(h.s();!(v=h.n()).done;){var x=v.value;if(l(x)){var b=xr(this.renderTypes.values()),m;try{var p=function(){var w=m.value,E=w.type;if(c(E)){var S=n.collections.get(w.collection),C=w.getKey(x),k=Array.isArray(C)?C:[C];if(s)k.forEach(function(P){return S.markKeyForGC(P)}),f=!0;else{var T=w.getID?w.getID(x):x.id(),_=n._key(E,T),N=n.typeAndIdToKey.get(_);N!==void 0&&!d3(k,N)&&(d=!0,n.typeAndIdToKey.delete(_),N.forEach(function(P){return S.markKeyForGC(P)}))}}};for(b.s();!(m=b.n()).done;)p()}catch(y){b.e(y)}finally{b.f()}}}}catch(y){h.e(y)}finally{h.f()}return f&&(this.gc(),d=!1),d}},{key:"gc",value:function(){var r=xr(this.collections.values()),n;try{for(r.s();!(n=r.n()).done;){var a=n.value;a.gc()}}catch(i){r.e(i)}finally{r.f()}}},{key:"getOrCreateAtlas",value:function(r,n,a,i){var s=this.renderTypes.get(n),o=this.collections.get(s.collection),l=!1,u=o.draw(i,a,function(f){s.drawClipped?(f.save(),f.beginPath(),f.rect(0,0,a.w,a.h),f.clip(),s.drawElement(f,r,a,!0,!0),f.restore()):s.drawElement(f,r,a,!0,!0),l=!0});if(l){var c=s.getID?s.getID(r):r.id(),d=this._key(n,c);this.typeAndIdToKey.has(d)?this.typeAndIdToKey.get(d).push(i):this.typeAndIdToKey.set(d,[i])}return u}},{key:"getAtlasInfo",value:function(r,n){var a=this,i=this.renderTypes.get(n),s=i.getKey(r),o=Array.isArray(s)?s:[s];return o.map(function(l){var u=i.getBoundingBox(r,l),c=a.getOrCreateAtlas(r,n,u,l),d=c.getOffsets(l),f=kt(d,2),h=f[0],v=f[1];return{atlas:c,tex:h,tex1:h,tex2:v,bb:u}})}},{key:"getDebugInfo",value:function(){var r=[],n=xr(this.collections),a;try{for(n.s();!(a=n.n()).done;){var i=kt(a.value,2),s=i[0],o=i[1],l=o.getCounts(),u=l.keyCount,c=l.atlasCount;r.push({type:s,keyCount:u,atlasCount:c})}}catch(d){n.e(d)}finally{n.f()}return r}}])}(),C3=function(){function t(e){Na(this,t),this.globalOptions=e,this.atlasSize=e.webglTexSize,this.maxAtlasesPerBatch=e.webglTexPerBatch,this.batchAtlases=[]}return Ra(t,[{key:"getMaxAtlasesPerBatch",value:function(){return this.maxAtlasesPerBatch}},{key:"getAtlasSize",value:function(){return this.atlasSize}},{key:"getIndexArray",value:function(){return Array.from({length:this.maxAtlasesPerBatch},function(r,n){return n})}},{key:"startBatch",value:function(){this.batchAtlases=[]}},{key:"getAtlasCount",value:function(){return this.batchAtlases.length}},{key:"getAtlases",value:function(){return this.batchAtlases}},{key:"canAddToCurrentBatch",value:function(r){return this.batchAtlases.length===this.maxAtlasesPerBatch?this.batchAtlases.includes(r):!0}},{key:"getAtlasIndexForBatch",value:function(r){var n=this.batchAtlases.indexOf(r);if(n<0){if(this.batchAtlases.length===this.maxAtlasesPerBatch)throw new Error("cannot add more atlases to batch");this.batchAtlases.push(r),n=this.batchAtlases.length-1}return n}}])}(),k3=`
|
|
57
|
+
float circleSD(vec2 p, float r) {
|
|
58
|
+
return distance(vec2(0), p) - r; // signed distance
|
|
59
|
+
}
|
|
60
|
+
`,T3=`
|
|
61
|
+
float rectangleSD(vec2 p, vec2 b) {
|
|
62
|
+
vec2 d = abs(p)-b;
|
|
63
|
+
return distance(vec2(0),max(d,0.0)) + min(max(d.x,d.y),0.0);
|
|
64
|
+
}
|
|
65
|
+
`,_3=`
|
|
66
|
+
float roundRectangleSD(vec2 p, vec2 b, vec4 cr) {
|
|
67
|
+
cr.xy = (p.x > 0.0) ? cr.xy : cr.zw;
|
|
68
|
+
cr.x = (p.y > 0.0) ? cr.x : cr.y;
|
|
69
|
+
vec2 q = abs(p) - b + cr.x;
|
|
70
|
+
return min(max(q.x, q.y), 0.0) + distance(vec2(0), max(q, 0.0)) - cr.x;
|
|
71
|
+
}
|
|
72
|
+
`,N3=`
|
|
73
|
+
float ellipseSD(vec2 p, vec2 ab) {
|
|
74
|
+
p = abs( p ); // symmetry
|
|
75
|
+
|
|
76
|
+
// find root with Newton solver
|
|
77
|
+
vec2 q = ab*(p-ab);
|
|
78
|
+
float w = (q.x<q.y)? 1.570796327 : 0.0;
|
|
79
|
+
for( int i=0; i<5; i++ ) {
|
|
80
|
+
vec2 cs = vec2(cos(w),sin(w));
|
|
81
|
+
vec2 u = ab*vec2( cs.x,cs.y);
|
|
82
|
+
vec2 v = ab*vec2(-cs.y,cs.x);
|
|
83
|
+
w = w + dot(p-u,v)/(dot(p-u,u)+dot(v,v));
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// compute final point and distance
|
|
87
|
+
float d = length(p-ab*vec2(cos(w),sin(w)));
|
|
88
|
+
|
|
89
|
+
// return signed distance
|
|
90
|
+
return (dot(p/ab,p/ab)>1.0) ? d : -d;
|
|
91
|
+
}
|
|
92
|
+
`,go={SCREEN:{name:"screen",screen:!0},PICKING:{name:"picking",picking:!0}},sc={IGNORE:1,USE_BB:2},dv=0,RE=1,PE=2,fv=3,Ei=4,Yl=5,Us=6,Gs=7,R3=function(){function t(e,r,n){Na(this,t),this.r=e,this.gl=r,this.maxInstances=n.webglBatchSize,this.atlasSize=n.webglTexSize,this.bgColor=n.bgColor,this.debug=n.webglDebug,this.batchDebugInfo=[],n.enableWrapping=!0,n.createTextureCanvas=o3,this.atlasManager=new E3(e,n),this.batchManager=new C3(n),this.simpleShapeOptions=new Map,this.program=this._createShaderProgram(go.SCREEN),this.pickingProgram=this._createShaderProgram(go.PICKING),this.vao=this._createVAO()}return Ra(t,[{key:"addAtlasCollection",value:function(r,n){this.atlasManager.addAtlasCollection(r,n)}},{key:"addTextureAtlasRenderType",value:function(r,n){this.atlasManager.addRenderType(r,n)}},{key:"addSimpleShapeRenderType",value:function(r,n){this.simpleShapeOptions.set(r,n)}},{key:"invalidate",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=n.type,i=this.atlasManager;return a?i.invalidate(r,{filterType:function(o){return o===a},forceRedraw:!0}):i.invalidate(r)}},{key:"gc",value:function(){this.atlasManager.gc()}},{key:"_createShaderProgram",value:function(r){var n=this.gl,a=`#version 300 es
|
|
93
|
+
precision highp float;
|
|
94
|
+
|
|
95
|
+
uniform mat3 uPanZoomMatrix;
|
|
96
|
+
uniform int uAtlasSize;
|
|
97
|
+
|
|
98
|
+
// instanced
|
|
99
|
+
in vec2 aPosition; // a vertex from the unit square
|
|
100
|
+
|
|
101
|
+
in mat3 aTransform; // used to transform verticies, eg into a bounding box
|
|
102
|
+
in int aVertType; // the type of thing we are rendering
|
|
103
|
+
|
|
104
|
+
// the z-index that is output when using picking mode
|
|
105
|
+
in vec4 aIndex;
|
|
106
|
+
|
|
107
|
+
// For textures
|
|
108
|
+
in int aAtlasId; // which shader unit/atlas to use
|
|
109
|
+
in vec4 aTex; // x/y/w/h of texture in atlas
|
|
110
|
+
|
|
111
|
+
// for edges
|
|
112
|
+
in vec4 aPointAPointB;
|
|
113
|
+
in vec4 aPointCPointD;
|
|
114
|
+
in vec2 aLineWidth; // also used for node border width
|
|
115
|
+
|
|
116
|
+
// simple shapes
|
|
117
|
+
in vec4 aCornerRadius; // for round-rectangle [top-right, bottom-right, top-left, bottom-left]
|
|
118
|
+
in vec4 aColor; // also used for edges
|
|
119
|
+
in vec4 aBorderColor; // aLineWidth is used for border width
|
|
120
|
+
|
|
121
|
+
// output values passed to the fragment shader
|
|
122
|
+
out vec2 vTexCoord;
|
|
123
|
+
out vec4 vColor;
|
|
124
|
+
out vec2 vPosition;
|
|
125
|
+
// flat values are not interpolated
|
|
126
|
+
flat out int vAtlasId;
|
|
127
|
+
flat out int vVertType;
|
|
128
|
+
flat out vec2 vTopRight;
|
|
129
|
+
flat out vec2 vBotLeft;
|
|
130
|
+
flat out vec4 vCornerRadius;
|
|
131
|
+
flat out vec4 vBorderColor;
|
|
132
|
+
flat out vec2 vBorderWidth;
|
|
133
|
+
flat out vec4 vIndex;
|
|
134
|
+
|
|
135
|
+
void main(void) {
|
|
136
|
+
int vid = gl_VertexID;
|
|
137
|
+
vec2 position = aPosition; // TODO make this a vec3, simplifies some code below
|
|
138
|
+
|
|
139
|
+
if(aVertType == `.concat(dv,`) {
|
|
140
|
+
float texX = aTex.x; // texture coordinates
|
|
141
|
+
float texY = aTex.y;
|
|
142
|
+
float texW = aTex.z;
|
|
143
|
+
float texH = aTex.w;
|
|
144
|
+
|
|
145
|
+
if(vid == 1 || vid == 2 || vid == 4) {
|
|
146
|
+
texX += texW;
|
|
147
|
+
}
|
|
148
|
+
if(vid == 2 || vid == 4 || vid == 5) {
|
|
149
|
+
texY += texH;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
float d = float(uAtlasSize);
|
|
153
|
+
vTexCoord = vec2(texX / d, texY / d); // tex coords must be between 0 and 1
|
|
154
|
+
|
|
155
|
+
gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0);
|
|
156
|
+
}
|
|
157
|
+
else if(aVertType == `).concat(Ei," || aVertType == ").concat(Gs,`
|
|
158
|
+
|| aVertType == `).concat(Yl," || aVertType == ").concat(Us,`) { // simple shapes
|
|
159
|
+
|
|
160
|
+
// the bounding box is needed by the fragment shader
|
|
161
|
+
vBotLeft = (aTransform * vec3(0, 0, 1)).xy; // flat
|
|
162
|
+
vTopRight = (aTransform * vec3(1, 1, 1)).xy; // flat
|
|
163
|
+
vPosition = (aTransform * vec3(position, 1)).xy; // will be interpolated
|
|
164
|
+
|
|
165
|
+
// calculations are done in the fragment shader, just pass these along
|
|
166
|
+
vColor = aColor;
|
|
167
|
+
vCornerRadius = aCornerRadius;
|
|
168
|
+
vBorderColor = aBorderColor;
|
|
169
|
+
vBorderWidth = aLineWidth;
|
|
170
|
+
|
|
171
|
+
gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0);
|
|
172
|
+
}
|
|
173
|
+
else if(aVertType == `).concat(RE,`) {
|
|
174
|
+
vec2 source = aPointAPointB.xy;
|
|
175
|
+
vec2 target = aPointAPointB.zw;
|
|
176
|
+
|
|
177
|
+
// adjust the geometry so that the line is centered on the edge
|
|
178
|
+
position.y = position.y - 0.5;
|
|
179
|
+
|
|
180
|
+
// stretch the unit square into a long skinny rectangle
|
|
181
|
+
vec2 xBasis = target - source;
|
|
182
|
+
vec2 yBasis = normalize(vec2(-xBasis.y, xBasis.x));
|
|
183
|
+
vec2 point = source + xBasis * position.x + yBasis * aLineWidth[0] * position.y;
|
|
184
|
+
|
|
185
|
+
gl_Position = vec4(uPanZoomMatrix * vec3(point, 1.0), 1.0);
|
|
186
|
+
vColor = aColor;
|
|
187
|
+
}
|
|
188
|
+
else if(aVertType == `).concat(PE,`) {
|
|
189
|
+
vec2 pointA = aPointAPointB.xy;
|
|
190
|
+
vec2 pointB = aPointAPointB.zw;
|
|
191
|
+
vec2 pointC = aPointCPointD.xy;
|
|
192
|
+
vec2 pointD = aPointCPointD.zw;
|
|
193
|
+
|
|
194
|
+
// adjust the geometry so that the line is centered on the edge
|
|
195
|
+
position.y = position.y - 0.5;
|
|
196
|
+
|
|
197
|
+
vec2 p0, p1, p2, pos;
|
|
198
|
+
if(position.x == 0.0) { // The left side of the unit square
|
|
199
|
+
p0 = pointA;
|
|
200
|
+
p1 = pointB;
|
|
201
|
+
p2 = pointC;
|
|
202
|
+
pos = position;
|
|
203
|
+
} else { // The right side of the unit square, use same approach but flip the geometry upside down
|
|
204
|
+
p0 = pointD;
|
|
205
|
+
p1 = pointC;
|
|
206
|
+
p2 = pointB;
|
|
207
|
+
pos = vec2(0.0, -position.y);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
vec2 p01 = p1 - p0;
|
|
211
|
+
vec2 p12 = p2 - p1;
|
|
212
|
+
vec2 p21 = p1 - p2;
|
|
213
|
+
|
|
214
|
+
// Find the normal vector.
|
|
215
|
+
vec2 tangent = normalize(normalize(p12) + normalize(p01));
|
|
216
|
+
vec2 normal = vec2(-tangent.y, tangent.x);
|
|
217
|
+
|
|
218
|
+
// Find the vector perpendicular to p0 -> p1.
|
|
219
|
+
vec2 p01Norm = normalize(vec2(-p01.y, p01.x));
|
|
220
|
+
|
|
221
|
+
// Determine the bend direction.
|
|
222
|
+
float sigma = sign(dot(p01 + p21, normal));
|
|
223
|
+
float width = aLineWidth[0];
|
|
224
|
+
|
|
225
|
+
if(sign(pos.y) == -sigma) {
|
|
226
|
+
// This is an intersecting vertex. Adjust the position so that there's no overlap.
|
|
227
|
+
vec2 point = 0.5 * width * normal * -sigma / dot(normal, p01Norm);
|
|
228
|
+
gl_Position = vec4(uPanZoomMatrix * vec3(p1 + point, 1.0), 1.0);
|
|
229
|
+
} else {
|
|
230
|
+
// This is a non-intersecting vertex. Treat it like a mitre join.
|
|
231
|
+
vec2 point = 0.5 * width * normal * sigma * dot(normal, p01Norm);
|
|
232
|
+
gl_Position = vec4(uPanZoomMatrix * vec3(p1 + point, 1.0), 1.0);
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
vColor = aColor;
|
|
236
|
+
}
|
|
237
|
+
else if(aVertType == `).concat(fv,` && vid < 3) {
|
|
238
|
+
// massage the first triangle into an edge arrow
|
|
239
|
+
if(vid == 0)
|
|
240
|
+
position = vec2(-0.15, -0.3);
|
|
241
|
+
if(vid == 1)
|
|
242
|
+
position = vec2( 0.0, 0.0);
|
|
243
|
+
if(vid == 2)
|
|
244
|
+
position = vec2( 0.15, -0.3);
|
|
245
|
+
|
|
246
|
+
gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0);
|
|
247
|
+
vColor = aColor;
|
|
248
|
+
}
|
|
249
|
+
else {
|
|
250
|
+
gl_Position = vec4(2.0, 0.0, 0.0, 1.0); // discard vertex by putting it outside webgl clip space
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
vAtlasId = aAtlasId;
|
|
254
|
+
vVertType = aVertType;
|
|
255
|
+
vIndex = aIndex;
|
|
256
|
+
}
|
|
257
|
+
`),i=this.batchManager.getIndexArray(),s=`#version 300 es
|
|
258
|
+
precision highp float;
|
|
259
|
+
|
|
260
|
+
// declare texture unit for each texture atlas in the batch
|
|
261
|
+
`.concat(i.map(function(u){return"uniform sampler2D uTexture".concat(u,";")}).join(`
|
|
262
|
+
`),`
|
|
263
|
+
|
|
264
|
+
uniform vec4 uBGColor;
|
|
265
|
+
uniform float uZoom;
|
|
266
|
+
|
|
267
|
+
in vec2 vTexCoord;
|
|
268
|
+
in vec4 vColor;
|
|
269
|
+
in vec2 vPosition; // model coordinates
|
|
270
|
+
|
|
271
|
+
flat in int vAtlasId;
|
|
272
|
+
flat in vec4 vIndex;
|
|
273
|
+
flat in int vVertType;
|
|
274
|
+
flat in vec2 vTopRight;
|
|
275
|
+
flat in vec2 vBotLeft;
|
|
276
|
+
flat in vec4 vCornerRadius;
|
|
277
|
+
flat in vec4 vBorderColor;
|
|
278
|
+
flat in vec2 vBorderWidth;
|
|
279
|
+
|
|
280
|
+
out vec4 outColor;
|
|
281
|
+
|
|
282
|
+
`).concat(k3,`
|
|
283
|
+
`).concat(T3,`
|
|
284
|
+
`).concat(_3,`
|
|
285
|
+
`).concat(N3,`
|
|
286
|
+
|
|
287
|
+
vec4 blend(vec4 top, vec4 bot) { // blend colors with premultiplied alpha
|
|
288
|
+
return vec4(
|
|
289
|
+
top.rgb + (bot.rgb * (1.0 - top.a)),
|
|
290
|
+
top.a + (bot.a * (1.0 - top.a))
|
|
291
|
+
);
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
vec4 distInterp(vec4 cA, vec4 cB, float d) { // interpolate color using Signed Distance
|
|
295
|
+
// scale to the zoom level so that borders don't look blurry when zoomed in
|
|
296
|
+
// note 1.5 is an aribitrary value chosen because it looks good
|
|
297
|
+
return mix(cA, cB, 1.0 - smoothstep(0.0, 1.5 / uZoom, abs(d)));
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
void main(void) {
|
|
301
|
+
if(vVertType == `).concat(dv,`) {
|
|
302
|
+
// look up the texel from the texture unit
|
|
303
|
+
`).concat(i.map(function(u){return"if(vAtlasId == ".concat(u,") outColor = texture(uTexture").concat(u,", vTexCoord);")}).join(`
|
|
304
|
+
else `),`
|
|
305
|
+
}
|
|
306
|
+
else if(vVertType == `).concat(fv,`) {
|
|
307
|
+
// mimics how canvas renderer uses context.globalCompositeOperation = 'destination-out';
|
|
308
|
+
outColor = blend(vColor, uBGColor);
|
|
309
|
+
outColor.a = 1.0; // make opaque, masks out line under arrow
|
|
310
|
+
}
|
|
311
|
+
else if(vVertType == `).concat(Ei,` && vBorderWidth == vec2(0.0)) { // simple rectangle with no border
|
|
312
|
+
outColor = vColor; // unit square is already transformed to the rectangle, nothing else needs to be done
|
|
313
|
+
}
|
|
314
|
+
else if(vVertType == `).concat(Ei," || vVertType == ").concat(Gs,`
|
|
315
|
+
|| vVertType == `).concat(Yl," || vVertType == ").concat(Us,`) { // use SDF
|
|
316
|
+
|
|
317
|
+
float outerBorder = vBorderWidth[0];
|
|
318
|
+
float innerBorder = vBorderWidth[1];
|
|
319
|
+
float borderPadding = outerBorder * 2.0;
|
|
320
|
+
float w = vTopRight.x - vBotLeft.x - borderPadding;
|
|
321
|
+
float h = vTopRight.y - vBotLeft.y - borderPadding;
|
|
322
|
+
vec2 b = vec2(w/2.0, h/2.0); // half width, half height
|
|
323
|
+
vec2 p = vPosition - vec2(vTopRight.x - b[0] - outerBorder, vTopRight.y - b[1] - outerBorder); // translate to center
|
|
324
|
+
|
|
325
|
+
float d; // signed distance
|
|
326
|
+
if(vVertType == `).concat(Ei,`) {
|
|
327
|
+
d = rectangleSD(p, b);
|
|
328
|
+
} else if(vVertType == `).concat(Gs,` && w == h) {
|
|
329
|
+
d = circleSD(p, b.x); // faster than ellipse
|
|
330
|
+
} else if(vVertType == `).concat(Gs,`) {
|
|
331
|
+
d = ellipseSD(p, b);
|
|
332
|
+
} else {
|
|
333
|
+
d = roundRectangleSD(p, b, vCornerRadius.wzyx);
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
// use the distance to interpolate a color to smooth the edges of the shape, doesn't need multisampling
|
|
337
|
+
// we must smooth colors inwards, because we can't change pixels outside the shape's bounding box
|
|
338
|
+
if(d > 0.0) {
|
|
339
|
+
if(d > outerBorder) {
|
|
340
|
+
discard;
|
|
341
|
+
} else {
|
|
342
|
+
outColor = distInterp(vBorderColor, vec4(0), d - outerBorder);
|
|
343
|
+
}
|
|
344
|
+
} else {
|
|
345
|
+
if(d > innerBorder) {
|
|
346
|
+
vec4 outerColor = outerBorder == 0.0 ? vec4(0) : vBorderColor;
|
|
347
|
+
vec4 innerBorderColor = blend(vBorderColor, vColor);
|
|
348
|
+
outColor = distInterp(innerBorderColor, outerColor, d);
|
|
349
|
+
}
|
|
350
|
+
else {
|
|
351
|
+
vec4 outerColor;
|
|
352
|
+
if(innerBorder == 0.0 && outerBorder == 0.0) {
|
|
353
|
+
outerColor = vec4(0);
|
|
354
|
+
} else if(innerBorder == 0.0) {
|
|
355
|
+
outerColor = vBorderColor;
|
|
356
|
+
} else {
|
|
357
|
+
outerColor = blend(vBorderColor, vColor);
|
|
358
|
+
}
|
|
359
|
+
outColor = distInterp(vColor, outerColor, d - innerBorder);
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
else {
|
|
364
|
+
outColor = vColor;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
`).concat(r.picking?`if(outColor.a == 0.0) discard;
|
|
368
|
+
else outColor = vIndex;`:"",`
|
|
369
|
+
}
|
|
370
|
+
`),o=s3(n,a,s);o.aPosition=n.getAttribLocation(o,"aPosition"),o.aIndex=n.getAttribLocation(o,"aIndex"),o.aVertType=n.getAttribLocation(o,"aVertType"),o.aTransform=n.getAttribLocation(o,"aTransform"),o.aAtlasId=n.getAttribLocation(o,"aAtlasId"),o.aTex=n.getAttribLocation(o,"aTex"),o.aPointAPointB=n.getAttribLocation(o,"aPointAPointB"),o.aPointCPointD=n.getAttribLocation(o,"aPointCPointD"),o.aLineWidth=n.getAttribLocation(o,"aLineWidth"),o.aColor=n.getAttribLocation(o,"aColor"),o.aCornerRadius=n.getAttribLocation(o,"aCornerRadius"),o.aBorderColor=n.getAttribLocation(o,"aBorderColor"),o.uPanZoomMatrix=n.getUniformLocation(o,"uPanZoomMatrix"),o.uAtlasSize=n.getUniformLocation(o,"uAtlasSize"),o.uBGColor=n.getUniformLocation(o,"uBGColor"),o.uZoom=n.getUniformLocation(o,"uZoom"),o.uTextures=[];for(var l=0;l<this.batchManager.getMaxAtlasesPerBatch();l++)o.uTextures.push(n.getUniformLocation(o,"uTexture".concat(l)));return o}},{key:"_createVAO",value:function(){var r=[0,0,1,0,1,1,0,0,1,1,0,1];this.vertexCount=r.length/2;var n=this.maxInstances,a=this.gl,i=this.program,s=a.createVertexArray();return a.bindVertexArray(s),p3(a,"vec2",i.aPosition,r),this.transformBuffer=g3(a,n,i.aTransform),this.indexBuffer=un(a,n,"vec4",i.aIndex),this.vertTypeBuffer=un(a,n,"int",i.aVertType),this.atlasIdBuffer=un(a,n,"int",i.aAtlasId),this.texBuffer=un(a,n,"vec4",i.aTex),this.pointAPointBBuffer=un(a,n,"vec4",i.aPointAPointB),this.pointCPointDBuffer=un(a,n,"vec4",i.aPointCPointD),this.lineWidthBuffer=un(a,n,"vec2",i.aLineWidth),this.colorBuffer=un(a,n,"vec4",i.aColor),this.cornerRadiusBuffer=un(a,n,"vec4",i.aCornerRadius),this.borderColorBuffer=un(a,n,"vec4",i.aBorderColor),a.bindVertexArray(null),s}},{key:"buffers",get:function(){var r=this;return this._buffers||(this._buffers=Object.keys(this).filter(function(n){return na(n,"Buffer")}).map(function(n){return r[n]})),this._buffers}},{key:"startFrame",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:go.SCREEN;this.panZoomMatrix=r,this.renderTarget=n,this.batchDebugInfo=[],this.wrappedCount=0,this.simpleCount=0,this.startBatch()}},{key:"startBatch",value:function(){this.instanceCount=0,this.batchManager.startBatch()}},{key:"endFrame",value:function(){this.endBatch()}},{key:"_isVisible",value:function(r,n){return r.visible()?n&&n.isVisible?n.isVisible(r):!0:!1}},{key:"drawTexture",value:function(r,n,a){var i=this.atlasManager,s=this.batchManager,o=i.getRenderTypeOpts(a);if(this._isVisible(r,o)&&!(r.isEdge()&&!this._isValidEdge(r))){if(this.renderTarget.picking&&o.getTexPickingMode){var l=o.getTexPickingMode(r);if(l===sc.IGNORE)return;if(l==sc.USE_BB){this.drawPickingRectangle(r,n,a);return}}var u=i.getAtlasInfo(r,a),c=xr(u),d;try{for(c.s();!(d=c.n()).done;){var f=d.value,h=f.atlas,v=f.tex1,x=f.tex2;s.canAddToCurrentBatch(h)||this.endBatch();for(var b=s.getAtlasIndexForBatch(h),m=0,p=[[v,!0],[x,!1]];m<p.length;m++){var y=kt(p[m],2),w=y[0],E=y[1];if(w.w!=0){var S=this.instanceCount;this.vertTypeBuffer.getView(S)[0]=dv;var C=this.indexBuffer.getView(S);Si(n,C);var k=this.atlasIdBuffer.getView(S);k[0]=b;var T=this.texBuffer.getView(S);T[0]=w.x,T[1]=w.y,T[2]=w.w,T[3]=w.h;var _=this.transformBuffer.getMatrixView(S);this.setTransformMatrix(r,_,o,f,E),this.instanceCount++,E||this.wrappedCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}catch(N){c.e(N)}finally{c.f()}}}},{key:"setTransformMatrix",value:function(r,n,a,i){var s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,o=0;if(a.shapeProps&&a.shapeProps.padding&&(o=r.pstyle(a.shapeProps.padding).pfValue),i){var l=i.bb,u=i.tex1,c=i.tex2,d=u.w/(u.w+c.w);s||(d=1-d);var f=this._getAdjustedBB(l,o,s,d);this._applyTransformMatrix(n,f,a,r)}else{var h=a.getBoundingBox(r),v=this._getAdjustedBB(h,o,!0,1);this._applyTransformMatrix(n,v,a,r)}}},{key:"_applyTransformMatrix",value:function(r,n,a,i){var s,o;_E(r);var l=a.getRotation?a.getRotation(i):0;if(l!==0){var u=a.getRotationPoint(i),c=u.x,d=u.y;bu(r,r,[c,d]),NE(r,r,l);var f=a.getRotationOffset(i);s=f.x+(n.xOffset||0),o=f.y+(n.yOffset||0)}else s=n.x1,o=n.y1;bu(r,r,[s,o]),G0(r,r,[n.w,n.h])}},{key:"_getAdjustedBB",value:function(r,n,a,i){var s=r.x1,o=r.y1,l=r.w,u=r.h,c=r.yOffset;n&&(s-=n,o-=n,l+=2*n,u+=2*n);var d=0,f=l*i;return a&&i<1?l=f:!a&&i<1&&(d=l-f,s+=d,l=f),{x1:s,y1:o,w:l,h:u,xOffset:d,yOffset:c}}},{key:"drawPickingRectangle",value:function(r,n,a){var i=this.atlasManager.getRenderTypeOpts(a),s=this.instanceCount;this.vertTypeBuffer.getView(s)[0]=Ei;var o=this.indexBuffer.getView(s);Si(n,o);var l=this.colorBuffer.getView(s);La([0,0,0],1,l);var u=this.transformBuffer.getMatrixView(s);this.setTransformMatrix(r,u,i),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}},{key:"drawNode",value:function(r,n,a){var i=this.simpleShapeOptions.get(a);if(this._isVisible(r,i)){var s=i.shapeProps,o=this._getVertTypeForShape(r,s.shape);if(o===void 0||i.isSimple&&!i.isSimple(r,this.renderTarget)){this.drawTexture(r,n,a);return}var l=this.instanceCount;if(this.vertTypeBuffer.getView(l)[0]=o,o===Yl||o===Us){var u=i.getBoundingBox(r),c=this._getCornerRadius(r,s.radius,u),d=this.cornerRadiusBuffer.getView(l);d[0]=c,d[1]=c,d[2]=c,d[3]=c,o===Us&&(d[0]=0,d[2]=0)}var f=this.indexBuffer.getView(l);Si(n,f);var h=this.renderTarget.picking?1:a==="node-body"?r.effectiveOpacity():1,v=this.renderTarget.picking?1:r.pstyle(s.opacity).value*h,x=r.pstyle(s.color).value,b=this.colorBuffer.getView(l);La(x,v,b);var m=this.lineWidthBuffer.getView(l);if(m[0]=0,m[1]=0,s.border){var p=r.pstyle("border-width").value;if(p>0){var y=r.pstyle("border-color").value,w=h*r.pstyle("border-opacity").value,E=this.borderColorBuffer.getView(l);La(y,w,E);var S=r.pstyle("border-position").value;if(S==="inside")m[0]=0,m[1]=-p;else if(S==="outside")m[0]=p,m[1]=0;else{var C=p/2;m[0]=C,m[1]=-C}}}var k=this.transformBuffer.getMatrixView(l);this.setTransformMatrix(r,k,i),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}},{key:"_getVertTypeForShape",value:function(r,n){var a=r.pstyle(n).value;switch(a){case"rectangle":return Ei;case"ellipse":return Gs;case"roundrectangle":case"round-rectangle":return Yl;case"bottom-round-rectangle":return Us;default:return}}},{key:"_getCornerRadius",value:function(r,n,a){var i=a.w,s=a.h;if(r.pstyle(n).value==="auto")return ba(i,s);var o=r.pstyle(n).pfValue,l=i/2,u=s/2;return Math.min(o,u,l)}},{key:"drawEdgeArrow",value:function(r,n,a){if(r.visible()){var i=r._private.rscratch,s,o,l;if(a==="source"?(s=i.arrowStartX,o=i.arrowStartY,l=i.srcArrowAngle):(s=i.arrowEndX,o=i.arrowEndY,l=i.tgtArrowAngle),!(isNaN(s)||s==null||isNaN(o)||o==null||isNaN(l)||l==null)){var u=r.pstyle(a+"-arrow-shape").value;if(u!=="none"){var c=r.pstyle(a+"-arrow-color").value,d=r.pstyle("opacity").value,f=r.pstyle("line-opacity").value,h=d*f,v=r.pstyle("width").pfValue,x=r.pstyle("arrow-scale").value,b=this.r.getArrowWidth(v,x),m=this.instanceCount,p=this.transformBuffer.getMatrixView(m);_E(p),bu(p,p,[s,o]),G0(p,p,[b,b]),NE(p,p,l),this.vertTypeBuffer.getView(m)[0]=fv;var y=this.indexBuffer.getView(m);Si(n,y);var w=this.colorBuffer.getView(m);La(c,h,w),this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}},{key:"drawEdgeLine",value:function(r,n){if(r.visible()){var a=this._getEdgePoints(r);if(a){var i=r.pstyle("opacity").value,s=r.pstyle("line-opacity").value,o=r.pstyle("width").pfValue,l=r.pstyle("line-color").value,u=i*s;if(a.length/2+this.instanceCount>this.maxInstances&&this.endBatch(),a.length==4){var c=this.instanceCount;this.vertTypeBuffer.getView(c)[0]=RE;var d=this.indexBuffer.getView(c);Si(n,d);var f=this.colorBuffer.getView(c);La(l,u,f);var h=this.lineWidthBuffer.getView(c);h[0]=o;var v=this.pointAPointBBuffer.getView(c);v[0]=a[0],v[1]=a[1],v[2]=a[2],v[3]=a[3],this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}else for(var x=0;x<a.length-2;x+=2){var b=this.instanceCount;this.vertTypeBuffer.getView(b)[0]=PE;var m=this.indexBuffer.getView(b);Si(n,m);var p=this.colorBuffer.getView(b);La(l,u,p);var y=this.lineWidthBuffer.getView(b);y[0]=o;var w=a[x-2],E=a[x-1],S=a[x],C=a[x+1],k=a[x+2],T=a[x+3],_=a[x+4],N=a[x+5];x==0&&(w=2*S-k+.001,E=2*C-T+.001),x==a.length-4&&(_=2*k-S+.001,N=2*T-C+.001);var P=this.pointAPointBBuffer.getView(b);P[0]=w,P[1]=E,P[2]=S,P[3]=C;var R=this.pointCPointDBuffer.getView(b);R[0]=k,R[1]=T,R[2]=_,R[3]=N,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}},{key:"_isValidEdge",value:function(r){var n=r._private.rscratch;return!(n.badLine||n.allpts==null||isNaN(n.allpts[0]))}},{key:"_getEdgePoints",value:function(r){var n=r._private.rscratch;if(this._isValidEdge(r)){var a=n.allpts;if(a.length==4)return a;var i=this._getNumSegments(r);return this._getCurveSegmentPoints(a,i)}}},{key:"_getNumSegments",value:function(r){var n=15;return Math.min(Math.max(n,5),this.maxInstances)}},{key:"_getCurveSegmentPoints",value:function(r,n){if(r.length==4)return r;for(var a=Array((n+1)*2),i=0;i<=n;i++)if(i==0)a[0]=r[0],a[1]=r[1];else if(i==n)a[i*2]=r[r.length-2],a[i*2+1]=r[r.length-1];else{var s=i/n;this._setCurvePoint(r,s,a,i*2)}return a}},{key:"_setCurvePoint",value:function(r,n,a,i){if(r.length<=2)a[i]=r[0],a[i+1]=r[1];else{for(var s=Array(r.length-2),o=0;o<s.length;o+=2){var l=(1-n)*r[o]+n*r[o+2],u=(1-n)*r[o+1]+n*r[o+3];s[o]=l,s[o+1]=u}return this._setCurvePoint(s,n,a,i)}}},{key:"endBatch",value:function(){var r=this.gl,n=this.vao,a=this.vertexCount,i=this.instanceCount;if(i!==0){var s=this.renderTarget.picking?this.pickingProgram:this.program;r.useProgram(s),r.bindVertexArray(n);var o=xr(this.buffers),l;try{for(o.s();!(l=o.n()).done;){var u=l.value;u.bufferSubData(i)}}catch(v){o.e(v)}finally{o.f()}for(var c=this.batchManager.getAtlases(),d=0;d<c.length;d++)c[d].bufferIfNeeded(r);for(var f=0;f<c.length;f++)r.activeTexture(r.TEXTURE0+f),r.bindTexture(r.TEXTURE_2D,c[f].texture),r.uniform1i(s.uTextures[f],f);r.uniform1f(s.uZoom,l3(this.r)),r.uniformMatrix3fv(s.uPanZoomMatrix,!1,this.panZoomMatrix),r.uniform1i(s.uAtlasSize,this.batchManager.getAtlasSize());var h=La(this.bgColor,1);r.uniform4fv(s.uBGColor,h),r.drawArraysInstanced(r.TRIANGLES,0,a,i),r.bindVertexArray(null),r.bindTexture(r.TEXTURE_2D,null),this.debug&&this.batchDebugInfo.push({count:i,atlasCount:c.length}),this.startBatch()}}},{key:"getDebugInfo",value:function(){var r=this.atlasManager.getDebugInfo(),n=r.reduce(function(s,o){return s+o.atlasCount},0),a=this.batchDebugInfo,i=a.reduce(function(s,o){return s+o.count},0);return{atlasInfo:r,totalAtlases:n,wrappedCount:this.wrappedCount,simpleCount:this.simpleCount,batchCount:a.length,batchInfo:a,totalInstances:i}}}])}(),vj={};vj.initWebgl=function(t,e){var r=this,n=r.data.contexts[r.WEBGL];t.bgColor=P3(r),t.webglTexSize=Math.min(t.webglTexSize,n.getParameter(n.MAX_TEXTURE_SIZE)),t.webglTexRows=Math.min(t.webglTexRows,54),t.webglTexRowsNodes=Math.min(t.webglTexRowsNodes,54),t.webglBatchSize=Math.min(t.webglBatchSize,16384),t.webglTexPerBatch=Math.min(t.webglTexPerBatch,n.getParameter(n.MAX_TEXTURE_IMAGE_UNITS)),r.webglDebug=t.webglDebug,r.webglDebugShowAtlases=t.webglDebugShowAtlases,r.pickingFrameBuffer=m3(n),r.pickingFrameBuffer.needsDraw=!0,r.drawing=new R3(r,n,t);var a=function(d){return function(f){return r.getTextAngle(f,d)}},i=function(d){return function(f){var h=f.pstyle(d);return h&&h.value}},s=function(d){return function(f){return f.pstyle("".concat(d,"-opacity")).value>0}},o=function(d){var f=d.pstyle("text-events").strValue==="yes";return f?sc.USE_BB:sc.IGNORE},l=function(d){var f=d.position(),h=f.x,v=f.y,x=d.outerWidth(),b=d.outerHeight();return{w:x,h:b,x1:h-x/2,y1:v-b/2}};r.drawing.addAtlasCollection("node",{texRows:t.webglTexRowsNodes}),r.drawing.addAtlasCollection("label",{texRows:t.webglTexRows}),r.drawing.addTextureAtlasRenderType("node-body",{collection:"node",getKey:e.getStyleKey,getBoundingBox:e.getElementBox,drawElement:e.drawElement}),r.drawing.addSimpleShapeRenderType("node-body",{getBoundingBox:l,isSimple:c3,shapeProps:{shape:"shape",color:"background-color",opacity:"background-opacity",radius:"corner-radius",border:!0}}),r.drawing.addSimpleShapeRenderType("node-overlay",{getBoundingBox:l,isVisible:s("overlay"),shapeProps:{shape:"overlay-shape",color:"overlay-color",opacity:"overlay-opacity",padding:"overlay-padding",radius:"overlay-corner-radius"}}),r.drawing.addSimpleShapeRenderType("node-underlay",{getBoundingBox:l,isVisible:s("underlay"),shapeProps:{shape:"underlay-shape",color:"underlay-color",opacity:"underlay-opacity",padding:"underlay-padding",radius:"underlay-corner-radius"}}),r.drawing.addTextureAtlasRenderType("label",{collection:"label",getTexPickingMode:o,getKey:vv(e.getLabelKey,null),getBoundingBox:hv(e.getLabelBox,null),drawClipped:!0,drawElement:e.drawLabel,getRotation:a(null),getRotationPoint:e.getLabelRotationPoint,getRotationOffset:e.getLabelRotationOffset,isVisible:i("label")}),r.drawing.addTextureAtlasRenderType("edge-source-label",{collection:"label",getTexPickingMode:o,getKey:vv(e.getSourceLabelKey,"source"),getBoundingBox:hv(e.getSourceLabelBox,"source"),drawClipped:!0,drawElement:e.drawSourceLabel,getRotation:a("source"),getRotationPoint:e.getSourceLabelRotationPoint,getRotationOffset:e.getSourceLabelRotationOffset,isVisible:i("source-label")}),r.drawing.addTextureAtlasRenderType("edge-target-label",{collection:"label",getTexPickingMode:o,getKey:vv(e.getTargetLabelKey,"target"),getBoundingBox:hv(e.getTargetLabelBox,"target"),drawClipped:!0,drawElement:e.drawTargetLabel,getRotation:a("target"),getRotationPoint:e.getTargetLabelRotationPoint,getRotationOffset:e.getTargetLabelRotationOffset,isVisible:i("target-label")});var u=rl(function(){console.log("garbage collect flag set"),r.data.gc=!0},1e4);r.onUpdateEleCalcs(function(c,d){var f=!1;d&&d.length>0&&(f|=r.drawing.invalidate(d)),f&&u()}),A3(r)};function P3(t){var e=t.cy.container(),r=e&&e.style&&e.style.backgroundColor||"white";return FP(r)}function hj(t,e){var r=t._private.rscratch;return pr(r,"labelWrapCachedLines",e)||[]}var vv=function(e,r){return function(n){var a=e(n),i=hj(n,r);return i.length>1?i.map(function(s,o){return"".concat(a,"_").concat(o)}):a}},hv=function(e,r){return function(n,a){var i=e(n);if(typeof a=="string"){var s=a.indexOf("_");if(s>0){var o=Number(a.substring(s+1)),l=hj(n,r),u=i.h/l.length,c=u*o,d=i.y1+c;return{x1:i.x1,w:i.w,y1:d,h:u,yOffset:c}}}return i}};function A3(t){{var e=t.render;t.render=function(i){i=i||{};var s=t.cy;t.webgl&&(s.zoom()>sj?(j3(t),e.call(t,i)):(I3(t),gj(t,i,go.SCREEN)))}}{var r=t.matchCanvasSize;t.matchCanvasSize=function(i){r.call(t,i),t.pickingFrameBuffer.setFramebufferAttachmentSizes(t.canvasWidth,t.canvasHeight),t.pickingFrameBuffer.needsDraw=!0}}t.findNearestElements=function(i,s,o,l){return q3(t,i,s)};{var n=t.invalidateCachedZSortedEles;t.invalidateCachedZSortedEles=function(){n.call(t),t.pickingFrameBuffer.needsDraw=!0}}{var a=t.notify;t.notify=function(i,s){a.call(t,i,s),i==="viewport"||i==="bounds"?t.pickingFrameBuffer.needsDraw=!0:i==="background"&&t.drawing.invalidate(s,{type:"node-body"})}}}function j3(t){var e=t.data.contexts[t.WEBGL];e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT)}function I3(t){var e=function(n){n.save(),n.setTransform(1,0,0,1,0,0),n.clearRect(0,0,t.canvasWidth,t.canvasHeight),n.restore()};e(t.data.contexts[t.NODE]),e(t.data.contexts[t.DRAG])}function M3(t){var e=t.canvasWidth,r=t.canvasHeight,n=b1(t),a=n.pan,i=n.zoom,s=cv();bu(s,s,[a.x,a.y]),G0(s,s,[i,i]);var o=cv();x3(o,e,r);var l=cv();return y3(l,o,s),l}function pj(t,e){var r=t.canvasWidth,n=t.canvasHeight,a=b1(t),i=a.pan,s=a.zoom;e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,r,n),e.translate(i.x,i.y),e.scale(s,s)}function D3(t,e){t.drawSelectionRectangle(e,function(r){return pj(t,r)})}function L3(t){var e=t.data.contexts[t.NODE];e.save(),pj(t,e),e.strokeStyle="rgba(0, 0, 0, 0.3)",e.beginPath(),e.moveTo(-1e3,0),e.lineTo(1e3,0),e.stroke(),e.beginPath(),e.moveTo(0,-1e3),e.lineTo(0,1e3),e.stroke(),e.restore()}function B3(t){var e=function(a,i,s){for(var o=a.atlasManager.getAtlasCollection(i),l=t.data.contexts[t.NODE],u=o.atlases,c=0;c<u.length;c++){var d=u[c],f=d.canvas;if(f){var h=f.width,v=f.height,x=h*c,b=f.height*s,m=.4;l.save(),l.scale(m,m),l.drawImage(f,x,b),l.strokeStyle="black",l.rect(x,b,h,v),l.stroke(),l.restore()}}},r=0;e(t.drawing,"node",r++),e(t.drawing,"label",r++)}function O3(t,e,r,n,a){var i,s,o,l,u=b1(t),c=u.pan,d=u.zoom;{var f=u3(t,c,d,e,r),h=kt(f,2),v=h[0],x=h[1],b=6;i=v-b/2,s=x-b/2,o=b,l=b}if(o===0||l===0)return[];var m=t.data.contexts[t.WEBGL];m.bindFramebuffer(m.FRAMEBUFFER,t.pickingFrameBuffer),t.pickingFrameBuffer.needsDraw&&(m.viewport(0,0,m.canvas.width,m.canvas.height),gj(t,null,go.PICKING),t.pickingFrameBuffer.needsDraw=!1);var p=o*l,y=new Uint8Array(p*4);m.readPixels(i,s,o,l,m.RGBA,m.UNSIGNED_BYTE,y),m.bindFramebuffer(m.FRAMEBUFFER,null);for(var w=new Set,E=0;E<p;E++){var S=y.slice(E*4,E*4+4),C=f3(S)-1;C>=0&&w.add(C)}return w}function q3(t,e,r){var n=O3(t,e,r),a=t.getCachedZSortedEles(),i,s,o=xr(n),l;try{for(o.s();!(l=o.n()).done;){var u=l.value,c=a[u];if(!i&&c.isNode()&&(i=c),!s&&c.isEdge()&&(s=c),i&&s)break}}catch(d){o.e(d)}finally{o.f()}return[i,s].filter(Boolean)}function pv(t,e,r){var n=t.drawing;e+=1,r.isNode()?(n.drawNode(r,e,"node-underlay"),n.drawNode(r,e,"node-body"),n.drawTexture(r,e,"label"),n.drawNode(r,e,"node-overlay")):(n.drawEdgeLine(r,e),n.drawEdgeArrow(r,e,"source"),n.drawEdgeArrow(r,e,"target"),n.drawTexture(r,e,"label"),n.drawTexture(r,e,"edge-source-label"),n.drawTexture(r,e,"edge-target-label"))}function gj(t,e,r){var n;t.webglDebug&&(n=performance.now());var a=t.drawing,i=0;if(r.screen&&t.data.canvasNeedsRedraw[t.SELECT_BOX]&&D3(t,e),t.data.canvasNeedsRedraw[t.NODE]||r.picking){var s=t.data.contexts[t.WEBGL];r.screen?(s.clearColor(0,0,0,0),s.enable(s.BLEND),s.blendFunc(s.ONE,s.ONE_MINUS_SRC_ALPHA)):s.disable(s.BLEND),s.clear(s.COLOR_BUFFER_BIT|s.DEPTH_BUFFER_BIT),s.viewport(0,0,s.canvas.width,s.canvas.height);var o=M3(t),l=t.getCachedZSortedEles();if(i=l.length,a.startFrame(o,r),r.screen){for(var u=0;u<l.nondrag.length;u++)pv(t,u,l.nondrag[u]);for(var c=0;c<l.drag.length;c++)pv(t,c,l.drag[c])}else if(r.picking)for(var d=0;d<l.length;d++)pv(t,d,l[d]);a.endFrame(),r.screen&&t.webglDebugShowAtlases&&(L3(t),B3(t)),t.data.canvasNeedsRedraw[t.NODE]=!1,t.data.canvasNeedsRedraw[t.DRAG]=!1}if(t.webglDebug){var f=performance.now(),h=!1,v=Math.ceil(f-n),x=a.getDebugInfo(),b=["".concat(i," elements"),"".concat(x.totalInstances," instances"),"".concat(x.batchCount," batches"),"".concat(x.totalAtlases," atlases"),"".concat(x.wrappedCount," wrapped textures"),"".concat(x.simpleCount," simple shapes")].join(", ");if(h)console.log("WebGL (".concat(r.name,") - time ").concat(v,"ms, ").concat(b));else{console.log("WebGL (".concat(r.name,") - frame time ").concat(v,"ms")),console.log("Totals:"),console.log(" ".concat(b)),console.log("Texture Atlases Used:");var m=x.atlasInfo,p=xr(m),y;try{for(p.s();!(y=p.n()).done;){var w=y.value;console.log(" ".concat(w.type,": ").concat(w.keyCount," keys, ").concat(w.atlasCount," atlases"))}}catch(E){p.e(E)}finally{p.f()}console.log("")}}t.data.gc&&(console.log("Garbage Collect!"),t.data.gc=!1,a.gc())}var ja={};ja.drawPolygonPath=function(t,e,r,n,a,i){var s=n/2,o=a/2;t.beginPath&&t.beginPath(),t.moveTo(e+s*i[0],r+o*i[1]);for(var l=1;l<i.length/2;l++)t.lineTo(e+s*i[l*2],r+o*i[l*2+1]);t.closePath()};ja.drawRoundPolygonPath=function(t,e,r,n,a,i,s){s.forEach(function(o){return XA(t,o)}),t.closePath()};ja.drawRoundRectanglePath=function(t,e,r,n,a,i){var s=n/2,o=a/2,l=i==="auto"?ba(n,a):Math.min(i,o,s);t.beginPath&&t.beginPath(),t.moveTo(e,r-o),t.arcTo(e+s,r-o,e+s,r,l),t.arcTo(e+s,r+o,e,r+o,l),t.arcTo(e-s,r+o,e-s,r,l),t.arcTo(e-s,r-o,e,r-o,l),t.lineTo(e,r-o),t.closePath()};ja.drawBottomRoundRectanglePath=function(t,e,r,n,a,i){var s=n/2,o=a/2,l=i==="auto"?ba(n,a):i;t.beginPath&&t.beginPath(),t.moveTo(e,r-o),t.lineTo(e+s,r-o),t.lineTo(e+s,r),t.arcTo(e+s,r+o,e,r+o,l),t.arcTo(e-s,r+o,e-s,r,l),t.lineTo(e-s,r-o),t.lineTo(e,r-o),t.closePath()};ja.drawCutRectanglePath=function(t,e,r,n,a,i,s){var o=n/2,l=a/2,u=s==="auto"?s1():s;t.beginPath&&t.beginPath(),t.moveTo(e-o+u,r-l),t.lineTo(e+o-u,r-l),t.lineTo(e+o,r-l+u),t.lineTo(e+o,r+l-u),t.lineTo(e+o-u,r+l),t.lineTo(e-o+u,r+l),t.lineTo(e-o,r+l-u),t.lineTo(e-o,r-l+u),t.closePath()};ja.drawBarrelPath=function(t,e,r,n,a){var i=n/2,s=a/2,o=e-i,l=e+i,u=r-s,c=r+s,d=A0(n,a),f=d.widthOffset,h=d.heightOffset,v=d.ctrlPtOffsetPct*f;t.beginPath&&t.beginPath(),t.moveTo(o,u+h),t.lineTo(o,c-h),t.quadraticCurveTo(o+v,c,o+f,c),t.lineTo(l-f,c),t.quadraticCurveTo(l-v,c,l,c-h),t.lineTo(l,u+h),t.quadraticCurveTo(l-v,u,l-f,u),t.lineTo(o+f,u),t.quadraticCurveTo(o+v,u,o,u+h),t.closePath()};var AE=Math.sin(0),jE=Math.cos(0),H0={},W0={},mj=Math.PI/40;for(var Ci=0*Math.PI;Ci<2*Math.PI;Ci+=mj)H0[Ci]=Math.sin(Ci),W0[Ci]=Math.cos(Ci);ja.drawEllipsePath=function(t,e,r,n,a){if(t.beginPath&&t.beginPath(),t.ellipse)t.ellipse(e,r,n/2,a/2,0,0,2*Math.PI);else for(var i,s,o=n/2,l=a/2,u=0*Math.PI;u<2*Math.PI;u+=mj)i=e-o*H0[u]*AE+o*W0[u]*jE,s=r+l*W0[u]*AE+l*H0[u]*jE,u===0?t.moveTo(i,s):t.lineTo(i,s);t.closePath()};var ll={};ll.createBuffer=function(t,e){var r=document.createElement("canvas");return r.width=t,r.height=e,[r,r.getContext("2d")]};ll.bufferCanvasImage=function(t){var e=this.cy,r=e.mutableElements(),n=r.boundingBox(),a=this.findContainerClientCoords(),i=t.full?Math.ceil(n.w):a[2],s=t.full?Math.ceil(n.h):a[3],o=le(t.maxWidth)||le(t.maxHeight),l=this.getPixelRatio(),u=1;if(t.scale!==void 0)i*=t.scale,s*=t.scale,u=t.scale;else if(o){var c=1/0,d=1/0;le(t.maxWidth)&&(c=u*t.maxWidth/i),le(t.maxHeight)&&(d=u*t.maxHeight/s),u=Math.min(c,d),i*=u,s*=u}o||(i*=l,s*=l,u*=l);var f=document.createElement("canvas");f.width=i,f.height=s,f.style.width=i+"px",f.style.height=s+"px";var h=f.getContext("2d");if(i>0&&s>0){h.clearRect(0,0,i,s),h.globalCompositeOperation="source-over";var v=this.getCachedZSortedEles();if(t.full)h.translate(-n.x1*u,-n.y1*u),h.scale(u,u),this.drawElements(h,v),h.scale(1/u,1/u),h.translate(n.x1*u,n.y1*u);else{var x=e.pan(),b={x:x.x*u,y:x.y*u};u*=e.zoom(),h.translate(b.x,b.y),h.scale(u,u),this.drawElements(h,v),h.scale(1/u,1/u),h.translate(-b.x,-b.y)}t.bg&&(h.globalCompositeOperation="destination-over",h.fillStyle=t.bg,h.rect(0,0,i,s),h.fill())}return f};function F3(t,e){for(var r=atob(t),n=new ArrayBuffer(r.length),a=new Uint8Array(n),i=0;i<r.length;i++)a[i]=r.charCodeAt(i);return new Blob([n],{type:e})}function IE(t){var e=t.indexOf(",");return t.substr(e+1)}function yj(t,e,r){var n=function(){return e.toDataURL(r,t.quality)};switch(t.output){case"blob-promise":return new hs(function(a,i){try{e.toBlob(function(s){s!=null?a(s):i(new Error("`canvas.toBlob()` sent a null value in its callback"))},r,t.quality)}catch(s){i(s)}});case"blob":return F3(IE(n()),r);case"base64":return IE(n());case"base64uri":default:return n()}}ll.png=function(t){return yj(t,this.bufferCanvasImage(t),"image/png")};ll.jpg=function(t){return yj(t,this.bufferCanvasImage(t),"image/jpeg")};var xj={};xj.nodeShapeImpl=function(t,e,r,n,a,i,s,o){switch(t){case"ellipse":return this.drawEllipsePath(e,r,n,a,i);case"polygon":return this.drawPolygonPath(e,r,n,a,i,s);case"round-polygon":return this.drawRoundPolygonPath(e,r,n,a,i,s,o);case"roundrectangle":case"round-rectangle":return this.drawRoundRectanglePath(e,r,n,a,i,o);case"cutrectangle":case"cut-rectangle":return this.drawCutRectanglePath(e,r,n,a,i,s,o);case"bottomroundrectangle":case"bottom-round-rectangle":return this.drawBottomRoundRectanglePath(e,r,n,a,i,o);case"barrel":return this.drawBarrelPath(e,r,n,a,i)}};var $3=bj,Ie=bj.prototype;Ie.CANVAS_LAYERS=3;Ie.SELECT_BOX=0;Ie.DRAG=1;Ie.NODE=2;Ie.WEBGL=3;Ie.CANVAS_TYPES=["2d","2d","2d","webgl2"];Ie.BUFFER_COUNT=3;Ie.TEXTURE_BUFFER=0;Ie.MOTIONBLUR_BUFFER_NODE=1;Ie.MOTIONBLUR_BUFFER_DRAG=2;function bj(t){var e=this,r=e.cy.window(),n=r.document;t.webgl&&(Ie.CANVAS_LAYERS=e.CANVAS_LAYERS=4,console.log("webgl rendering enabled")),e.data={canvases:new Array(Ie.CANVAS_LAYERS),contexts:new Array(Ie.CANVAS_LAYERS),canvasNeedsRedraw:new Array(Ie.CANVAS_LAYERS),bufferCanvases:new Array(Ie.BUFFER_COUNT),bufferContexts:new Array(Ie.CANVAS_LAYERS)};var a="-webkit-tap-highlight-color",i="rgba(0,0,0,0)";e.data.canvasContainer=n.createElement("div");var s=e.data.canvasContainer.style;e.data.canvasContainer.style[a]=i,s.position="relative",s.zIndex="0",s.overflow="hidden";var o=t.cy.container();o.appendChild(e.data.canvasContainer),o.style[a]=i;var l={"-webkit-user-select":"none","-moz-user-select":"-moz-none","user-select":"none","-webkit-tap-highlight-color":"rgba(0,0,0,0)","outline-style":"none"};IB()&&(l["-ms-touch-action"]="none",l["touch-action"]="none");for(var u=0;u<Ie.CANVAS_LAYERS;u++){var c=e.data.canvases[u]=n.createElement("canvas"),d=Ie.CANVAS_TYPES[u];e.data.contexts[u]=c.getContext(d),e.data.contexts[u]||ct("Could not create canvas of type "+d),Object.keys(l).forEach(function(X){c.style[X]=l[X]}),c.style.position="absolute",c.setAttribute("data-id","layer"+u),c.style.zIndex=String(Ie.CANVAS_LAYERS-u),e.data.canvasContainer.appendChild(c),e.data.canvasNeedsRedraw[u]=!1}e.data.topCanvas=e.data.canvases[0],e.data.canvases[Ie.NODE].setAttribute("data-id","layer"+Ie.NODE+"-node"),e.data.canvases[Ie.SELECT_BOX].setAttribute("data-id","layer"+Ie.SELECT_BOX+"-selectbox"),e.data.canvases[Ie.DRAG].setAttribute("data-id","layer"+Ie.DRAG+"-drag"),e.data.canvases[Ie.WEBGL]&&e.data.canvases[Ie.WEBGL].setAttribute("data-id","layer"+Ie.WEBGL+"-webgl");for(var u=0;u<Ie.BUFFER_COUNT;u++)e.data.bufferCanvases[u]=n.createElement("canvas"),e.data.bufferContexts[u]=e.data.bufferCanvases[u].getContext("2d"),e.data.bufferCanvases[u].style.position="absolute",e.data.bufferCanvases[u].setAttribute("data-id","buffer"+u),e.data.bufferCanvases[u].style.zIndex=String(-u-1),e.data.bufferCanvases[u].style.visibility="hidden";e.pathsEnabled=!0;var f=lr(),h=function(U){return{x:(U.x1+U.x2)/2,y:(U.y1+U.y2)/2}},v=function(U){return{x:-U.w/2,y:-U.h/2}},x=function(U){var H=U[0]._private,Y=H.oldBackgroundTimestamp===H.backgroundTimestamp;return!Y},b=function(U){return U[0]._private.nodeKey},m=function(U){return U[0]._private.labelStyleKey},p=function(U){return U[0]._private.sourceLabelStyleKey},y=function(U){return U[0]._private.targetLabelStyleKey},w=function(U,H,Y,ee,ie){return e.drawElement(U,H,Y,!1,!1,ie)},E=function(U,H,Y,ee,ie){return e.drawElementText(U,H,Y,ee,"main",ie)},S=function(U,H,Y,ee,ie){return e.drawElementText(U,H,Y,ee,"source",ie)},C=function(U,H,Y,ee,ie){return e.drawElementText(U,H,Y,ee,"target",ie)},k=function(U){return U.boundingBox(),U[0]._private.bodyBounds},T=function(U){return U.boundingBox(),U[0]._private.labelBounds.main||f},_=function(U){return U.boundingBox(),U[0]._private.labelBounds.source||f},N=function(U){return U.boundingBox(),U[0]._private.labelBounds.target||f},P=function(U,H){return H},R=function(U){return h(k(U))},I=function(U,H,Y){var ee=U?U+"-":"";return{x:H.x+Y.pstyle(ee+"text-margin-x").pfValue,y:H.y+Y.pstyle(ee+"text-margin-y").pfValue}},M=function(U,H,Y){var ee=U[0]._private.rscratch;return{x:ee[H],y:ee[Y]}},D=function(U){return I("",M(U,"labelX","labelY"),U)},L=function(U){return I("source",M(U,"sourceLabelX","sourceLabelY"),U)},j=function(U){return I("target",M(U,"targetLabelX","targetLabelY"),U)},F=function(U){return v(k(U))},O=function(U){return v(_(U))},B=function(U){return v(N(U))},V=function(U){var H=T(U),Y=v(T(U));if(U.isNode()){switch(U.pstyle("text-halign").value){case"left":Y.x=-H.w-(H.leftPad||0);break;case"right":Y.x=-(H.rightPad||0);break}switch(U.pstyle("text-valign").value){case"top":Y.y=-H.h-(H.topPad||0);break;case"bottom":Y.y=-(H.botPad||0);break}}return Y},J=e.data.eleTxrCache=new Js(e,{getKey:b,doesEleInvalidateKey:x,drawElement:w,getBoundingBox:k,getRotationPoint:R,getRotationOffset:F,allowEdgeTxrCaching:!1,allowParentTxrCaching:!1}),q=e.data.lblTxrCache=new Js(e,{getKey:m,drawElement:E,getBoundingBox:T,getRotationPoint:D,getRotationOffset:V,isVisible:P}),$=e.data.slbTxrCache=new Js(e,{getKey:p,drawElement:S,getBoundingBox:_,getRotationPoint:L,getRotationOffset:O,isVisible:P}),z=e.data.tlbTxrCache=new Js(e,{getKey:y,drawElement:C,getBoundingBox:N,getRotationPoint:j,getRotationOffset:B,isVisible:P}),W=e.data.lyrTxrCache=new oj(e);e.onUpdateEleCalcs(function(U,H){J.invalidateElements(H),q.invalidateElements(H),$.invalidateElements(H),z.invalidateElements(H),W.invalidateElements(H);for(var Y=0;Y<H.length;Y++){var ee=H[Y]._private;ee.oldBackgroundTimestamp=ee.backgroundTimestamp}});var ne=function(U){for(var H=0;H<U.length;H++)W.enqueueElementRefinement(U[H].ele)};J.onDequeue(ne),q.onDequeue(ne),$.onDequeue(ne),z.onDequeue(ne),t.webgl&&e.initWebgl(t,{getStyleKey:b,getLabelKey:m,getSourceLabelKey:p,getTargetLabelKey:y,drawElement:w,drawLabel:E,drawSourceLabel:S,drawTargetLabel:C,getElementBox:k,getLabelBox:T,getSourceLabelBox:_,getTargetLabelBox:N,getElementRotationPoint:R,getElementRotationOffset:F,getLabelRotationPoint:D,getSourceLabelRotationPoint:L,getTargetLabelRotationPoint:j,getLabelRotationOffset:V,getSourceLabelRotationOffset:O,getTargetLabelRotationOffset:B})}Ie.redrawHint=function(t,e){var r=this;switch(t){case"eles":r.data.canvasNeedsRedraw[Ie.NODE]=e;break;case"drag":r.data.canvasNeedsRedraw[Ie.DRAG]=e;break;case"select":r.data.canvasNeedsRedraw[Ie.SELECT_BOX]=e;break;case"gc":r.data.gc=!0;break}};var z3=typeof Path2D<"u";Ie.path2dEnabled=function(t){if(t===void 0)return this.pathsEnabled;this.pathsEnabled=!!t};Ie.usePaths=function(){return z3&&this.pathsEnabled};Ie.setImgSmoothing=function(t,e){t.imageSmoothingEnabled!=null?t.imageSmoothingEnabled=e:(t.webkitImageSmoothingEnabled=e,t.mozImageSmoothingEnabled=e,t.msImageSmoothingEnabled=e)};Ie.getImgSmoothing=function(t){return t.imageSmoothingEnabled!=null?t.imageSmoothingEnabled:t.webkitImageSmoothingEnabled||t.mozImageSmoothingEnabled||t.msImageSmoothingEnabled};Ie.makeOffscreenCanvas=function(t,e){var r;if((typeof OffscreenCanvas>"u"?"undefined":It(OffscreenCanvas))!=="undefined")r=new OffscreenCanvas(t,e);else{var n=this.cy.window(),a=n.document;r=a.createElement("canvas"),r.width=t,r.height=e}return r};[lj,bn,Fn,x1,di,Aa,dr,vj,ja,ll,xj].forEach(function(t){Te(Ie,t)});var V3=[{name:"null",impl:WA},{name:"base",impl:aj},{name:"canvas",impl:$3}],U3=[{type:"layout",extensions:v$},{type:"renderer",extensions:V3}],wj={},Sj={};function Ej(t,e,r){var n=r,a=function(k){Ye("Can not register `"+e+"` for `"+t+"` since `"+k+"` already exists in the prototype and can not be overridden")};if(t==="core"){if(zo.prototype[e])return a(e);zo.prototype[e]=r}else if(t==="collection"){if(Ht.prototype[e])return a(e);Ht.prototype[e]=r}else if(t==="layout"){for(var i=function(k){this.options=k,r.call(this,k),Ue(this._private)||(this._private={}),this._private.cy=k.cy,this._private.listeners=[],this.createEmitter()},s=i.prototype=Object.create(r.prototype),o=[],l=0;l<o.length;l++){var u=o[l];s[u]=s[u]||function(){return this}}s.start&&!s.run?s.run=function(){return this.start(),this}:!s.start&&s.run&&(s.start=function(){return this.run(),this});var c=r.prototype.stop;s.stop=function(){var C=this.options;if(C&&C.animate){var k=this.animations;if(k)for(var T=0;T<k.length;T++)k[T].stop()}return c?c.call(this):this.emit("layoutstop"),this},s.destroy||(s.destroy=function(){return this}),s.cy=function(){return this._private.cy};var d=function(k){return k._private.cy},f={addEventFields:function(k,T){T.layout=k,T.cy=d(k),T.target=k},bubble:function(){return!0},parent:function(k){return d(k)}};Te(s,{createEmitter:function(){return this._private.emitter=new Bc(f,this),this},emitter:function(){return this._private.emitter},on:function(k,T){return this.emitter().on(k,T),this},one:function(k,T){return this.emitter().one(k,T),this},once:function(k,T){return this.emitter().one(k,T),this},removeListener:function(k,T){return this.emitter().removeListener(k,T),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},emit:function(k,T){return this.emitter().emit(k,T),this}}),Ke.eventAliasesOn(s),n=i}else if(t==="renderer"&&e!=="null"&&e!=="base"){var h=Cj("renderer","base"),v=h.prototype,x=r,b=r.prototype,m=function(){h.apply(this,arguments),x.apply(this,arguments)},p=m.prototype;for(var y in v){var w=v[y],E=b[y]!=null;if(E)return a(y);p[y]=w}for(var S in b)p[S]=b[S];v.clientFunctions.forEach(function(C){p[C]=p[C]||function(){ct("Renderer does not implement `renderer."+C+"()` on its prototype")}}),n=m}else if(t==="__proto__"||t==="constructor"||t==="prototype")return ct(t+" is an illegal type to be registered, possibly lead to prototype pollutions");return $P({map:wj,keys:[t,e],value:n})}function Cj(t,e){return zP({map:wj,keys:[t,e]})}function G3(t,e,r,n,a){return $P({map:Sj,keys:[t,e,r,n],value:a})}function H3(t,e,r,n){return zP({map:Sj,keys:[t,e,r,n]})}var K0=function(){if(arguments.length===2)return Cj.apply(null,arguments);if(arguments.length===3)return Ej.apply(null,arguments);if(arguments.length===4)return H3.apply(null,arguments);if(arguments.length===5)return G3.apply(null,arguments);ct("Invalid extension access syntax")};zo.prototype.extension=K0;U3.forEach(function(t){t.extensions.forEach(function(e){Ej(t.type,e.name,e.impl)})});var oc=function(){if(!(this instanceof oc))return new oc;this.length=0},oi=oc.prototype;oi.instanceString=function(){return"stylesheet"};oi.selector=function(t){var e=this.length++;return this[e]={selector:t,properties:[]},this};oi.css=function(t,e){var r=this.length-1;if(Ee(t))this[r].properties.push({name:t,value:e});else if(Ue(t))for(var n=t,a=Object.keys(n),i=0;i<a.length;i++){var s=a[i],o=n[s];if(o!=null){var l=Ft.properties[s]||Ft.properties[_c(s)];if(l!=null){var u=l.name,c=o;this[r].properties.push({name:u,value:c})}}}return this};oi.style=oi.css;oi.generateStyle=function(t){var e=new Ft(t);return this.appendToStyle(e)};oi.appendToStyle=function(t){for(var e=0;e<this.length;e++){var r=this[e],n=r.selector,a=r.properties;t.selector(n);for(var i=0;i<a.length;i++){var s=a[i];t.css(s.name,s.value)}}return t};var W3="3.33.3",Ca=function(e){if(e===void 0&&(e={}),Ue(e))return new zo(e);if(Ee(e))return K0.apply(K0,arguments)};Ca.use=function(t){var e=Array.prototype.slice.call(arguments,1);return e.unshift(Ca),t.apply(null,e),this};Ca.warnings=function(t){return YP(t)};Ca.version=W3;Ca.stylesheet=Ca.Stylesheet=oc;var kj={exports:{}};function w1(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var gv,ME;function K3(){if(ME)return gv;ME=1;function t(){this.__data__=[],this.size=0}return gv=t,gv}var mv,DE;function xs(){if(DE)return mv;DE=1;function t(e,r){return e===r||e!==e&&r!==r}return mv=t,mv}var yv,LE;function Gc(){if(LE)return yv;LE=1;var t=xs();function e(r,n){for(var a=r.length;a--;)if(t(r[a][0],n))return a;return-1}return yv=e,yv}var xv,BE;function Y3(){if(BE)return xv;BE=1;var t=Gc(),e=Array.prototype,r=e.splice;function n(a){var i=this.__data__,s=t(i,a);if(s<0)return!1;var o=i.length-1;return s==o?i.pop():r.call(i,s,1),--this.size,!0}return xv=n,xv}var bv,OE;function X3(){if(OE)return bv;OE=1;var t=Gc();function e(r){var n=this.__data__,a=t(n,r);return a<0?void 0:n[a][1]}return bv=e,bv}var wv,qE;function Z3(){if(qE)return wv;qE=1;var t=Gc();function e(r){return t(this.__data__,r)>-1}return wv=e,wv}var Sv,FE;function Q3(){if(FE)return Sv;FE=1;var t=Gc();function e(r,n){var a=this.__data__,i=t(a,r);return i<0?(++this.size,a.push([r,n])):a[i][1]=n,this}return Sv=e,Sv}var Ev,$E;function Hc(){if($E)return Ev;$E=1;var t=K3(),e=Y3(),r=X3(),n=Z3(),a=Q3();function i(s){var o=-1,l=s==null?0:s.length;for(this.clear();++o<l;){var u=s[o];this.set(u[0],u[1])}}return i.prototype.clear=t,i.prototype.delete=e,i.prototype.get=r,i.prototype.has=n,i.prototype.set=a,Ev=i,Ev}var Cv,zE;function J3(){if(zE)return Cv;zE=1;var t=Hc();function e(){this.__data__=new t,this.size=0}return Cv=e,Cv}var kv,VE;function ez(){if(VE)return kv;VE=1;function t(e){var r=this.__data__,n=r.delete(e);return this.size=r.size,n}return kv=t,kv}var Tv,UE;function tz(){if(UE)return Tv;UE=1;function t(e){return this.__data__.get(e)}return Tv=t,Tv}var _v,GE;function rz(){if(GE)return _v;GE=1;function t(e){return this.__data__.has(e)}return _v=t,_v}var Nv,HE;function Tj(){if(HE)return Nv;HE=1;var t=typeof Hs=="object"&&Hs&&Hs.Object===Object&&Hs;return Nv=t,Nv}var Rv,WE;function an(){if(WE)return Rv;WE=1;var t=Tj(),e=typeof self=="object"&&self&&self.Object===Object&&self,r=t||e||Function("return this")();return Rv=r,Rv}var Pv,KE;function bs(){if(KE)return Pv;KE=1;var t=an(),e=t.Symbol;return Pv=e,Pv}var Av,YE;function nz(){if(YE)return Av;YE=1;var t=bs(),e=Object.prototype,r=e.hasOwnProperty,n=e.toString,a=t?t.toStringTag:void 0;function i(s){var o=r.call(s,a),l=s[a];try{s[a]=void 0;var u=!0}catch{}var c=n.call(s);return u&&(o?s[a]=l:delete s[a]),c}return Av=i,Av}var jv,XE;function az(){if(XE)return jv;XE=1;var t=Object.prototype,e=t.toString;function r(n){return e.call(n)}return jv=r,jv}var Iv,ZE;function fi(){if(ZE)return Iv;ZE=1;var t=bs(),e=nz(),r=az(),n="[object Null]",a="[object Undefined]",i=t?t.toStringTag:void 0;function s(o){return o==null?o===void 0?a:n:i&&i in Object(o)?e(o):r(o)}return Iv=s,Iv}var Mv,QE;function $r(){if(QE)return Mv;QE=1;function t(e){var r=typeof e;return e!=null&&(r=="object"||r=="function")}return Mv=t,Mv}var Dv,JE;function ul(){if(JE)return Dv;JE=1;var t=fi(),e=$r(),r="[object AsyncFunction]",n="[object Function]",a="[object GeneratorFunction]",i="[object Proxy]";function s(o){if(!e(o))return!1;var l=t(o);return l==n||l==a||l==r||l==i}return Dv=s,Dv}var Lv,e2;function iz(){if(e2)return Lv;e2=1;var t=an(),e=t["__core-js_shared__"];return Lv=e,Lv}var Bv,t2;function sz(){if(t2)return Bv;t2=1;var t=iz(),e=function(){var n=/[^.]+$/.exec(t&&t.keys&&t.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}();function r(n){return!!e&&e in n}return Bv=r,Bv}var Ov,r2;function _j(){if(r2)return Ov;r2=1;var t=Function.prototype,e=t.toString;function r(n){if(n!=null){try{return e.call(n)}catch{}try{return n+""}catch{}}return""}return Ov=r,Ov}var qv,n2;function oz(){if(n2)return qv;n2=1;var t=ul(),e=sz(),r=$r(),n=_j(),a=/[\\^$.*+?()[\]{}|]/g,i=/^\[object .+?Constructor\]$/,s=Function.prototype,o=Object.prototype,l=s.toString,u=o.hasOwnProperty,c=RegExp("^"+l.call(u).replace(a,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function d(f){if(!r(f)||e(f))return!1;var h=t(f)?c:i;return h.test(n(f))}return qv=d,qv}var Fv,a2;function lz(){if(a2)return Fv;a2=1;function t(e,r){return e==null?void 0:e[r]}return Fv=t,Fv}var $v,i2;function vi(){if(i2)return $v;i2=1;var t=oz(),e=lz();function r(n,a){var i=e(n,a);return t(i)?i:void 0}return $v=r,$v}var zv,s2;function S1(){if(s2)return zv;s2=1;var t=vi(),e=an(),r=t(e,"Map");return zv=r,zv}var Vv,o2;function Wc(){if(o2)return Vv;o2=1;var t=vi(),e=t(Object,"create");return Vv=e,Vv}var Uv,l2;function uz(){if(l2)return Uv;l2=1;var t=Wc();function e(){this.__data__=t?t(null):{},this.size=0}return Uv=e,Uv}var Gv,u2;function cz(){if(u2)return Gv;u2=1;function t(e){var r=this.has(e)&&delete this.__data__[e];return this.size-=r?1:0,r}return Gv=t,Gv}var Hv,c2;function dz(){if(c2)return Hv;c2=1;var t=Wc(),e="__lodash_hash_undefined__",r=Object.prototype,n=r.hasOwnProperty;function a(i){var s=this.__data__;if(t){var o=s[i];return o===e?void 0:o}return n.call(s,i)?s[i]:void 0}return Hv=a,Hv}var Wv,d2;function fz(){if(d2)return Wv;d2=1;var t=Wc(),e=Object.prototype,r=e.hasOwnProperty;function n(a){var i=this.__data__;return t?i[a]!==void 0:r.call(i,a)}return Wv=n,Wv}var Kv,f2;function vz(){if(f2)return Kv;f2=1;var t=Wc(),e="__lodash_hash_undefined__";function r(n,a){var i=this.__data__;return this.size+=this.has(n)?0:1,i[n]=t&&a===void 0?e:a,this}return Kv=r,Kv}var Yv,v2;function hz(){if(v2)return Yv;v2=1;var t=uz(),e=cz(),r=dz(),n=fz(),a=vz();function i(s){var o=-1,l=s==null?0:s.length;for(this.clear();++o<l;){var u=s[o];this.set(u[0],u[1])}}return i.prototype.clear=t,i.prototype.delete=e,i.prototype.get=r,i.prototype.has=n,i.prototype.set=a,Yv=i,Yv}var Xv,h2;function pz(){if(h2)return Xv;h2=1;var t=hz(),e=Hc(),r=S1();function n(){this.size=0,this.__data__={hash:new t,map:new(r||e),string:new t}}return Xv=n,Xv}var Zv,p2;function gz(){if(p2)return Zv;p2=1;function t(e){var r=typeof e;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?e!=="__proto__":e===null}return Zv=t,Zv}var Qv,g2;function Kc(){if(g2)return Qv;g2=1;var t=gz();function e(r,n){var a=r.__data__;return t(n)?a[typeof n=="string"?"string":"hash"]:a.map}return Qv=e,Qv}var Jv,m2;function mz(){if(m2)return Jv;m2=1;var t=Kc();function e(r){var n=t(this,r).delete(r);return this.size-=n?1:0,n}return Jv=e,Jv}var eh,y2;function yz(){if(y2)return eh;y2=1;var t=Kc();function e(r){return t(this,r).get(r)}return eh=e,eh}var th,x2;function xz(){if(x2)return th;x2=1;var t=Kc();function e(r){return t(this,r).has(r)}return th=e,th}var rh,b2;function bz(){if(b2)return rh;b2=1;var t=Kc();function e(r,n){var a=t(this,r),i=a.size;return a.set(r,n),this.size+=a.size==i?0:1,this}return rh=e,rh}var nh,w2;function E1(){if(w2)return nh;w2=1;var t=pz(),e=mz(),r=yz(),n=xz(),a=bz();function i(s){var o=-1,l=s==null?0:s.length;for(this.clear();++o<l;){var u=s[o];this.set(u[0],u[1])}}return i.prototype.clear=t,i.prototype.delete=e,i.prototype.get=r,i.prototype.has=n,i.prototype.set=a,nh=i,nh}var ah,S2;function wz(){if(S2)return ah;S2=1;var t=Hc(),e=S1(),r=E1(),n=200;function a(i,s){var o=this.__data__;if(o instanceof t){var l=o.__data__;if(!e||l.length<n-1)return l.push([i,s]),this.size=++o.size,this;o=this.__data__=new r(l)}return o.set(i,s),this.size=o.size,this}return ah=a,ah}var ih,E2;function Yc(){if(E2)return ih;E2=1;var t=Hc(),e=J3(),r=ez(),n=tz(),a=rz(),i=wz();function s(o){var l=this.__data__=new t(o);this.size=l.size}return s.prototype.clear=e,s.prototype.delete=r,s.prototype.get=n,s.prototype.has=a,s.prototype.set=i,ih=s,ih}var sh,C2;function C1(){if(C2)return sh;C2=1;function t(e,r){for(var n=-1,a=e==null?0:e.length;++n<a&&r(e[n],n,e)!==!1;);return e}return sh=t,sh}var oh,k2;function Nj(){if(k2)return oh;k2=1;var t=vi(),e=function(){try{var r=t(Object,"defineProperty");return r({},"",{}),r}catch{}}();return oh=e,oh}var lh,T2;function Xc(){if(T2)return lh;T2=1;var t=Nj();function e(r,n,a){n=="__proto__"&&t?t(r,n,{configurable:!0,enumerable:!0,value:a,writable:!0}):r[n]=a}return lh=e,lh}var uh,_2;function Zc(){if(_2)return uh;_2=1;var t=Xc(),e=xs(),r=Object.prototype,n=r.hasOwnProperty;function a(i,s,o){var l=i[s];(!(n.call(i,s)&&e(l,o))||o===void 0&&!(s in i))&&t(i,s,o)}return uh=a,uh}var ch,N2;function cl(){if(N2)return ch;N2=1;var t=Zc(),e=Xc();function r(n,a,i,s){var o=!i;i||(i={});for(var l=-1,u=a.length;++l<u;){var c=a[l],d=s?s(i[c],n[c],c,i,n):void 0;d===void 0&&(d=n[c]),o?e(i,c,d):t(i,c,d)}return i}return ch=r,ch}var dh,R2;function Sz(){if(R2)return dh;R2=1;function t(e,r){for(var n=-1,a=Array(e);++n<e;)a[n]=r(n);return a}return dh=t,dh}var fh,P2;function wn(){if(P2)return fh;P2=1;function t(e){return e!=null&&typeof e=="object"}return fh=t,fh}var vh,A2;function Ez(){if(A2)return vh;A2=1;var t=fi(),e=wn(),r="[object Arguments]";function n(a){return e(a)&&t(a)==r}return vh=n,vh}var hh,j2;function dl(){if(j2)return hh;j2=1;var t=Ez(),e=wn(),r=Object.prototype,n=r.hasOwnProperty,a=r.propertyIsEnumerable,i=t(function(){return arguments}())?t:function(s){return e(s)&&n.call(s,"callee")&&!a.call(s,"callee")};return hh=i,hh}var ph,I2;function _t(){if(I2)return ph;I2=1;var t=Array.isArray;return ph=t,ph}var eo={exports:{}},gh,M2;function Cz(){if(M2)return gh;M2=1;function t(){return!1}return gh=t,gh}eo.exports;var D2;function ws(){return D2||(D2=1,function(t,e){var r=an(),n=Cz(),a=e&&!e.nodeType&&e,i=a&&!0&&t&&!t.nodeType&&t,s=i&&i.exports===a,o=s?r.Buffer:void 0,l=o?o.isBuffer:void 0,u=l||n;t.exports=u}(eo,eo.exports)),eo.exports}var mh,L2;function Qc(){if(L2)return mh;L2=1;var t=9007199254740991,e=/^(?:0|[1-9]\d*)$/;function r(n,a){var i=typeof n;return a=a??t,!!a&&(i=="number"||i!="symbol"&&e.test(n))&&n>-1&&n%1==0&&n<a}return mh=r,mh}var yh,B2;function k1(){if(B2)return yh;B2=1;var t=9007199254740991;function e(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=t}return yh=e,yh}var xh,O2;function kz(){if(O2)return xh;O2=1;var t=fi(),e=k1(),r=wn(),n="[object Arguments]",a="[object Array]",i="[object Boolean]",s="[object Date]",o="[object Error]",l="[object Function]",u="[object Map]",c="[object Number]",d="[object Object]",f="[object RegExp]",h="[object Set]",v="[object String]",x="[object WeakMap]",b="[object ArrayBuffer]",m="[object DataView]",p="[object Float32Array]",y="[object Float64Array]",w="[object Int8Array]",E="[object Int16Array]",S="[object Int32Array]",C="[object Uint8Array]",k="[object Uint8ClampedArray]",T="[object Uint16Array]",_="[object Uint32Array]",N={};N[p]=N[y]=N[w]=N[E]=N[S]=N[C]=N[k]=N[T]=N[_]=!0,N[n]=N[a]=N[b]=N[i]=N[m]=N[s]=N[o]=N[l]=N[u]=N[c]=N[d]=N[f]=N[h]=N[v]=N[x]=!1;function P(R){return r(R)&&e(R.length)&&!!N[t(R)]}return xh=P,xh}var bh,q2;function Jc(){if(q2)return bh;q2=1;function t(e){return function(r){return e(r)}}return bh=t,bh}var to={exports:{}};to.exports;var F2;function T1(){return F2||(F2=1,function(t,e){var r=Tj(),n=e&&!e.nodeType&&e,a=n&&!0&&t&&!t.nodeType&&t,i=a&&a.exports===n,s=i&&r.process,o=function(){try{var l=a&&a.require&&a.require("util").types;return l||s&&s.binding&&s.binding("util")}catch{}}();t.exports=o}(to,to.exports)),to.exports}var wh,$2;function fl(){if($2)return wh;$2=1;var t=kz(),e=Jc(),r=T1(),n=r&&r.isTypedArray,a=n?e(n):t;return wh=a,wh}var Sh,z2;function Rj(){if(z2)return Sh;z2=1;var t=Sz(),e=dl(),r=_t(),n=ws(),a=Qc(),i=fl(),s=Object.prototype,o=s.hasOwnProperty;function l(u,c){var d=r(u),f=!d&&e(u),h=!d&&!f&&n(u),v=!d&&!f&&!h&&i(u),x=d||f||h||v,b=x?t(u.length,String):[],m=b.length;for(var p in u)(c||o.call(u,p))&&!(x&&(p=="length"||h&&(p=="offset"||p=="parent")||v&&(p=="buffer"||p=="byteLength"||p=="byteOffset")||a(p,m)))&&b.push(p);return b}return Sh=l,Sh}var Eh,V2;function ed(){if(V2)return Eh;V2=1;var t=Object.prototype;function e(r){var n=r&&r.constructor,a=typeof n=="function"&&n.prototype||t;return r===a}return Eh=e,Eh}var Ch,U2;function Pj(){if(U2)return Ch;U2=1;function t(e,r){return function(n){return e(r(n))}}return Ch=t,Ch}var kh,G2;function Tz(){if(G2)return kh;G2=1;var t=Pj(),e=t(Object.keys,Object);return kh=e,kh}var Th,H2;function _1(){if(H2)return Th;H2=1;var t=ed(),e=Tz(),r=Object.prototype,n=r.hasOwnProperty;function a(i){if(!t(i))return e(i);var s=[];for(var o in Object(i))n.call(i,o)&&o!="constructor"&&s.push(o);return s}return Th=a,Th}var _h,W2;function $n(){if(W2)return _h;W2=1;var t=ul(),e=k1();function r(n){return n!=null&&e(n.length)&&!t(n)}return _h=r,_h}var Nh,K2;function Ia(){if(K2)return Nh;K2=1;var t=Rj(),e=_1(),r=$n();function n(a){return r(a)?t(a):e(a)}return Nh=n,Nh}var Rh,Y2;function _z(){if(Y2)return Rh;Y2=1;var t=cl(),e=Ia();function r(n,a){return n&&t(a,e(a),n)}return Rh=r,Rh}var Ph,X2;function Nz(){if(X2)return Ph;X2=1;function t(e){var r=[];if(e!=null)for(var n in Object(e))r.push(n);return r}return Ph=t,Ph}var Ah,Z2;function Rz(){if(Z2)return Ah;Z2=1;var t=$r(),e=ed(),r=Nz(),n=Object.prototype,a=n.hasOwnProperty;function i(s){if(!t(s))return r(s);var o=e(s),l=[];for(var u in s)u=="constructor"&&(o||!a.call(s,u))||l.push(u);return l}return Ah=i,Ah}var jh,Q2;function hi(){if(Q2)return jh;Q2=1;var t=Rj(),e=Rz(),r=$n();function n(a){return r(a)?t(a,!0):e(a)}return jh=n,jh}var Ih,J2;function Pz(){if(J2)return Ih;J2=1;var t=cl(),e=hi();function r(n,a){return n&&t(a,e(a),n)}return Ih=r,Ih}var ro={exports:{}};ro.exports;var eC;function Aj(){return eC||(eC=1,function(t,e){var r=an(),n=e&&!e.nodeType&&e,a=n&&!0&&t&&!t.nodeType&&t,i=a&&a.exports===n,s=i?r.Buffer:void 0,o=s?s.allocUnsafe:void 0;function l(u,c){if(c)return u.slice();var d=u.length,f=o?o(d):new u.constructor(d);return u.copy(f),f}t.exports=l}(ro,ro.exports)),ro.exports}var Mh,tC;function jj(){if(tC)return Mh;tC=1;function t(e,r){var n=-1,a=e.length;for(r||(r=Array(a));++n<a;)r[n]=e[n];return r}return Mh=t,Mh}var Dh,rC;function Ij(){if(rC)return Dh;rC=1;function t(e,r){for(var n=-1,a=e==null?0:e.length,i=0,s=[];++n<a;){var o=e[n];r(o,n,e)&&(s[i++]=o)}return s}return Dh=t,Dh}var Lh,nC;function Mj(){if(nC)return Lh;nC=1;function t(){return[]}return Lh=t,Lh}var Bh,aC;function N1(){if(aC)return Bh;aC=1;var t=Ij(),e=Mj(),r=Object.prototype,n=r.propertyIsEnumerable,a=Object.getOwnPropertySymbols,i=a?function(s){return s==null?[]:(s=Object(s),t(a(s),function(o){return n.call(s,o)}))}:e;return Bh=i,Bh}var Oh,iC;function Az(){if(iC)return Oh;iC=1;var t=cl(),e=N1();function r(n,a){return t(n,e(n),a)}return Oh=r,Oh}var qh,sC;function R1(){if(sC)return qh;sC=1;function t(e,r){for(var n=-1,a=r.length,i=e.length;++n<a;)e[i+n]=r[n];return e}return qh=t,qh}var Fh,oC;function td(){if(oC)return Fh;oC=1;var t=Pj(),e=t(Object.getPrototypeOf,Object);return Fh=e,Fh}var $h,lC;function Dj(){if(lC)return $h;lC=1;var t=R1(),e=td(),r=N1(),n=Mj(),a=Object.getOwnPropertySymbols,i=a?function(s){for(var o=[];s;)t(o,r(s)),s=e(s);return o}:n;return $h=i,$h}var zh,uC;function jz(){if(uC)return zh;uC=1;var t=cl(),e=Dj();function r(n,a){return t(n,e(n),a)}return zh=r,zh}var Vh,cC;function Lj(){if(cC)return Vh;cC=1;var t=R1(),e=_t();function r(n,a,i){var s=a(n);return e(n)?s:t(s,i(n))}return Vh=r,Vh}var Uh,dC;function Bj(){if(dC)return Uh;dC=1;var t=Lj(),e=N1(),r=Ia();function n(a){return t(a,r,e)}return Uh=n,Uh}var Gh,fC;function Iz(){if(fC)return Gh;fC=1;var t=Lj(),e=Dj(),r=hi();function n(a){return t(a,r,e)}return Gh=n,Gh}var Hh,vC;function Mz(){if(vC)return Hh;vC=1;var t=vi(),e=an(),r=t(e,"DataView");return Hh=r,Hh}var Wh,hC;function Dz(){if(hC)return Wh;hC=1;var t=vi(),e=an(),r=t(e,"Promise");return Wh=r,Wh}var Kh,pC;function Oj(){if(pC)return Kh;pC=1;var t=vi(),e=an(),r=t(e,"Set");return Kh=r,Kh}var Yh,gC;function Lz(){if(gC)return Yh;gC=1;var t=vi(),e=an(),r=t(e,"WeakMap");return Yh=r,Yh}var Xh,mC;function Ss(){if(mC)return Xh;mC=1;var t=Mz(),e=S1(),r=Dz(),n=Oj(),a=Lz(),i=fi(),s=_j(),o="[object Map]",l="[object Object]",u="[object Promise]",c="[object Set]",d="[object WeakMap]",f="[object DataView]",h=s(t),v=s(e),x=s(r),b=s(n),m=s(a),p=i;return(t&&p(new t(new ArrayBuffer(1)))!=f||e&&p(new e)!=o||r&&p(r.resolve())!=u||n&&p(new n)!=c||a&&p(new a)!=d)&&(p=function(y){var w=i(y),E=w==l?y.constructor:void 0,S=E?s(E):"";if(S)switch(S){case h:return f;case v:return o;case x:return u;case b:return c;case m:return d}return w}),Xh=p,Xh}var Zh,yC;function Bz(){if(yC)return Zh;yC=1;var t=Object.prototype,e=t.hasOwnProperty;function r(n){var a=n.length,i=new n.constructor(a);return a&&typeof n[0]=="string"&&e.call(n,"index")&&(i.index=n.index,i.input=n.input),i}return Zh=r,Zh}var Qh,xC;function qj(){if(xC)return Qh;xC=1;var t=an(),e=t.Uint8Array;return Qh=e,Qh}var Jh,bC;function P1(){if(bC)return Jh;bC=1;var t=qj();function e(r){var n=new r.constructor(r.byteLength);return new t(n).set(new t(r)),n}return Jh=e,Jh}var ep,wC;function Oz(){if(wC)return ep;wC=1;var t=P1();function e(r,n){var a=n?t(r.buffer):r.buffer;return new r.constructor(a,r.byteOffset,r.byteLength)}return ep=e,ep}var tp,SC;function qz(){if(SC)return tp;SC=1;var t=/\w*$/;function e(r){var n=new r.constructor(r.source,t.exec(r));return n.lastIndex=r.lastIndex,n}return tp=e,tp}var rp,EC;function Fz(){if(EC)return rp;EC=1;var t=bs(),e=t?t.prototype:void 0,r=e?e.valueOf:void 0;function n(a){return r?Object(r.call(a)):{}}return rp=n,rp}var np,CC;function Fj(){if(CC)return np;CC=1;var t=P1();function e(r,n){var a=n?t(r.buffer):r.buffer;return new r.constructor(a,r.byteOffset,r.length)}return np=e,np}var ap,kC;function $z(){if(kC)return ap;kC=1;var t=P1(),e=Oz(),r=qz(),n=Fz(),a=Fj(),i="[object Boolean]",s="[object Date]",o="[object Map]",l="[object Number]",u="[object RegExp]",c="[object Set]",d="[object String]",f="[object Symbol]",h="[object ArrayBuffer]",v="[object DataView]",x="[object Float32Array]",b="[object Float64Array]",m="[object Int8Array]",p="[object Int16Array]",y="[object Int32Array]",w="[object Uint8Array]",E="[object Uint8ClampedArray]",S="[object Uint16Array]",C="[object Uint32Array]";function k(T,_,N){var P=T.constructor;switch(_){case h:return t(T);case i:case s:return new P(+T);case v:return e(T,N);case x:case b:case m:case p:case y:case w:case E:case S:case C:return a(T,N);case o:return new P;case l:case d:return new P(T);case u:return r(T);case c:return new P;case f:return n(T)}}return ap=k,ap}var ip,TC;function $j(){if(TC)return ip;TC=1;var t=$r(),e=Object.create,r=function(){function n(){}return function(a){if(!t(a))return{};if(e)return e(a);n.prototype=a;var i=new n;return n.prototype=void 0,i}}();return ip=r,ip}var sp,_C;function zj(){if(_C)return sp;_C=1;var t=$j(),e=td(),r=ed();function n(a){return typeof a.constructor=="function"&&!r(a)?t(e(a)):{}}return sp=n,sp}var op,NC;function zz(){if(NC)return op;NC=1;var t=Ss(),e=wn(),r="[object Map]";function n(a){return e(a)&&t(a)==r}return op=n,op}var lp,RC;function Vz(){if(RC)return lp;RC=1;var t=zz(),e=Jc(),r=T1(),n=r&&r.isMap,a=n?e(n):t;return lp=a,lp}var up,PC;function Uz(){if(PC)return up;PC=1;var t=Ss(),e=wn(),r="[object Set]";function n(a){return e(a)&&t(a)==r}return up=n,up}var cp,AC;function Gz(){if(AC)return cp;AC=1;var t=Uz(),e=Jc(),r=T1(),n=r&&r.isSet,a=n?e(n):t;return cp=a,cp}var dp,jC;function Vj(){if(jC)return dp;jC=1;var t=Yc(),e=C1(),r=Zc(),n=_z(),a=Pz(),i=Aj(),s=jj(),o=Az(),l=jz(),u=Bj(),c=Iz(),d=Ss(),f=Bz(),h=$z(),v=zj(),x=_t(),b=ws(),m=Vz(),p=$r(),y=Gz(),w=Ia(),E=hi(),S=1,C=2,k=4,T="[object Arguments]",_="[object Array]",N="[object Boolean]",P="[object Date]",R="[object Error]",I="[object Function]",M="[object GeneratorFunction]",D="[object Map]",L="[object Number]",j="[object Object]",F="[object RegExp]",O="[object Set]",B="[object String]",V="[object Symbol]",J="[object WeakMap]",q="[object ArrayBuffer]",$="[object DataView]",z="[object Float32Array]",W="[object Float64Array]",ne="[object Int8Array]",X="[object Int16Array]",U="[object Int32Array]",H="[object Uint8Array]",Y="[object Uint8ClampedArray]",ee="[object Uint16Array]",ie="[object Uint32Array]",oe={};oe[T]=oe[_]=oe[q]=oe[$]=oe[N]=oe[P]=oe[z]=oe[W]=oe[ne]=oe[X]=oe[U]=oe[D]=oe[L]=oe[j]=oe[F]=oe[O]=oe[B]=oe[V]=oe[H]=oe[Y]=oe[ee]=oe[ie]=!0,oe[R]=oe[I]=oe[J]=!1;function Re(ue,Se,be,de,xe,fe){var we,Ce=Se&S,Ne=Se&C,De=Se&k;if(be&&(we=xe?be(ue,de,xe,fe):be(ue)),we!==void 0)return we;if(!p(ue))return ue;var $e=x(ue);if($e){if(we=f(ue),!Ce)return s(ue,we)}else{var je=d(ue),Oe=je==I||je==M;if(b(ue))return i(ue,Ce);if(je==j||je==T||Oe&&!xe){if(we=Ne||Oe?{}:v(ue),!Ce)return Ne?l(ue,a(we,ue)):o(ue,n(we,ue))}else{if(!oe[je])return xe?ue:{};we=h(ue,je,Ce)}}fe||(fe=new t);var te=fe.get(ue);if(te)return te;fe.set(ue,we),y(ue)?ue.forEach(function(K){we.add(Re(K,Se,be,K,ue,fe))}):m(ue)&&ue.forEach(function(K,Q){we.set(Q,Re(K,Se,be,Q,ue,fe))});var A=De?Ne?c:u:Ne?E:w,G=$e?void 0:A(ue);return e(G||ue,function(K,Q){G&&(Q=K,K=ue[Q]),r(we,Q,Re(K,Se,be,Q,ue,fe))}),we}return dp=Re,dp}var fp,IC;function Hz(){if(IC)return fp;IC=1;var t=Vj(),e=4;function r(n){return t(n,e)}return fp=r,fp}var vp,MC;function A1(){if(MC)return vp;MC=1;function t(e){return function(){return e}}return vp=t,vp}var hp,DC;function Wz(){if(DC)return hp;DC=1;function t(e){return function(r,n,a){for(var i=-1,s=Object(r),o=a(r),l=o.length;l--;){var u=o[e?l:++i];if(n(s[u],u,s)===!1)break}return r}}return hp=t,hp}var pp,LC;function j1(){if(LC)return pp;LC=1;var t=Wz(),e=t();return pp=e,pp}var gp,BC;function I1(){if(BC)return gp;BC=1;var t=j1(),e=Ia();function r(n,a){return n&&t(n,a,e)}return gp=r,gp}var mp,OC;function Kz(){if(OC)return mp;OC=1;var t=$n();function e(r,n){return function(a,i){if(a==null)return a;if(!t(a))return r(a,i);for(var s=a.length,o=n?s:-1,l=Object(a);(n?o--:++o<s)&&i(l[o],o,l)!==!1;);return a}}return mp=e,mp}var yp,qC;function rd(){if(qC)return yp;qC=1;var t=I1(),e=Kz(),r=e(t);return yp=r,yp}var xp,FC;function pi(){if(FC)return xp;FC=1;function t(e){return e}return xp=t,xp}var bp,$C;function Uj(){if($C)return bp;$C=1;var t=pi();function e(r){return typeof r=="function"?r:t}return bp=e,bp}var wp,zC;function Gj(){if(zC)return wp;zC=1;var t=C1(),e=rd(),r=Uj(),n=_t();function a(i,s){var o=n(i)?t:e;return o(i,r(s))}return wp=a,wp}var Sp,VC;function Hj(){return VC||(VC=1,Sp=Gj()),Sp}var Ep,UC;function Yz(){if(UC)return Ep;UC=1;var t=rd();function e(r,n){var a=[];return t(r,function(i,s,o){n(i,s,o)&&a.push(i)}),a}return Ep=e,Ep}var Cp,GC;function Xz(){if(GC)return Cp;GC=1;var t="__lodash_hash_undefined__";function e(r){return this.__data__.set(r,t),this}return Cp=e,Cp}var kp,HC;function Zz(){if(HC)return kp;HC=1;function t(e){return this.__data__.has(e)}return kp=t,kp}var Tp,WC;function Wj(){if(WC)return Tp;WC=1;var t=E1(),e=Xz(),r=Zz();function n(a){var i=-1,s=a==null?0:a.length;for(this.__data__=new t;++i<s;)this.add(a[i])}return n.prototype.add=n.prototype.push=e,n.prototype.has=r,Tp=n,Tp}var _p,KC;function Qz(){if(KC)return _p;KC=1;function t(e,r){for(var n=-1,a=e==null?0:e.length;++n<a;)if(r(e[n],n,e))return!0;return!1}return _p=t,_p}var Np,YC;function Kj(){if(YC)return Np;YC=1;function t(e,r){return e.has(r)}return Np=t,Np}var Rp,XC;function Yj(){if(XC)return Rp;XC=1;var t=Wj(),e=Qz(),r=Kj(),n=1,a=2;function i(s,o,l,u,c,d){var f=l&n,h=s.length,v=o.length;if(h!=v&&!(f&&v>h))return!1;var x=d.get(s),b=d.get(o);if(x&&b)return x==o&&b==s;var m=-1,p=!0,y=l&a?new t:void 0;for(d.set(s,o),d.set(o,s);++m<h;){var w=s[m],E=o[m];if(u)var S=f?u(E,w,m,o,s,d):u(w,E,m,s,o,d);if(S!==void 0){if(S)continue;p=!1;break}if(y){if(!e(o,function(C,k){if(!r(y,k)&&(w===C||c(w,C,l,u,d)))return y.push(k)})){p=!1;break}}else if(!(w===E||c(w,E,l,u,d))){p=!1;break}}return d.delete(s),d.delete(o),p}return Rp=i,Rp}var Pp,ZC;function Jz(){if(ZC)return Pp;ZC=1;function t(e){var r=-1,n=Array(e.size);return e.forEach(function(a,i){n[++r]=[i,a]}),n}return Pp=t,Pp}var Ap,QC;function M1(){if(QC)return Ap;QC=1;function t(e){var r=-1,n=Array(e.size);return e.forEach(function(a){n[++r]=a}),n}return Ap=t,Ap}var jp,JC;function e4(){if(JC)return jp;JC=1;var t=bs(),e=qj(),r=xs(),n=Yj(),a=Jz(),i=M1(),s=1,o=2,l="[object Boolean]",u="[object Date]",c="[object Error]",d="[object Map]",f="[object Number]",h="[object RegExp]",v="[object Set]",x="[object String]",b="[object Symbol]",m="[object ArrayBuffer]",p="[object DataView]",y=t?t.prototype:void 0,w=y?y.valueOf:void 0;function E(S,C,k,T,_,N,P){switch(k){case p:if(S.byteLength!=C.byteLength||S.byteOffset!=C.byteOffset)return!1;S=S.buffer,C=C.buffer;case m:return!(S.byteLength!=C.byteLength||!N(new e(S),new e(C)));case l:case u:case f:return r(+S,+C);case c:return S.name==C.name&&S.message==C.message;case h:case x:return S==C+"";case d:var R=a;case v:var I=T&s;if(R||(R=i),S.size!=C.size&&!I)return!1;var M=P.get(S);if(M)return M==C;T|=o,P.set(S,C);var D=n(R(S),R(C),T,_,N,P);return P.delete(S),D;case b:if(w)return w.call(S)==w.call(C)}return!1}return jp=E,jp}var Ip,ek;function t4(){if(ek)return Ip;ek=1;var t=Bj(),e=1,r=Object.prototype,n=r.hasOwnProperty;function a(i,s,o,l,u,c){var d=o&e,f=t(i),h=f.length,v=t(s),x=v.length;if(h!=x&&!d)return!1;for(var b=h;b--;){var m=f[b];if(!(d?m in s:n.call(s,m)))return!1}var p=c.get(i),y=c.get(s);if(p&&y)return p==s&&y==i;var w=!0;c.set(i,s),c.set(s,i);for(var E=d;++b<h;){m=f[b];var S=i[m],C=s[m];if(l)var k=d?l(C,S,m,s,i,c):l(S,C,m,i,s,c);if(!(k===void 0?S===C||u(S,C,o,l,c):k)){w=!1;break}E||(E=m=="constructor")}if(w&&!E){var T=i.constructor,_=s.constructor;T!=_&&"constructor"in i&&"constructor"in s&&!(typeof T=="function"&&T instanceof T&&typeof _=="function"&&_ instanceof _)&&(w=!1)}return c.delete(i),c.delete(s),w}return Ip=a,Ip}var Mp,tk;function r4(){if(tk)return Mp;tk=1;var t=Yc(),e=Yj(),r=e4(),n=t4(),a=Ss(),i=_t(),s=ws(),o=fl(),l=1,u="[object Arguments]",c="[object Array]",d="[object Object]",f=Object.prototype,h=f.hasOwnProperty;function v(x,b,m,p,y,w){var E=i(x),S=i(b),C=E?c:a(x),k=S?c:a(b);C=C==u?d:C,k=k==u?d:k;var T=C==d,_=k==d,N=C==k;if(N&&s(x)){if(!s(b))return!1;E=!0,T=!1}if(N&&!T)return w||(w=new t),E||o(x)?e(x,b,m,p,y,w):r(x,b,C,m,p,y,w);if(!(m&l)){var P=T&&h.call(x,"__wrapped__"),R=_&&h.call(b,"__wrapped__");if(P||R){var I=P?x.value():x,M=R?b.value():b;return w||(w=new t),y(I,M,m,p,w)}}return N?(w||(w=new t),n(x,b,m,p,y,w)):!1}return Mp=v,Mp}var Dp,rk;function Xj(){if(rk)return Dp;rk=1;var t=r4(),e=wn();function r(n,a,i,s,o){return n===a?!0:n==null||a==null||!e(n)&&!e(a)?n!==n&&a!==a:t(n,a,i,s,r,o)}return Dp=r,Dp}var Lp,nk;function n4(){if(nk)return Lp;nk=1;var t=Yc(),e=Xj(),r=1,n=2;function a(i,s,o,l){var u=o.length,c=u,d=!l;if(i==null)return!c;for(i=Object(i);u--;){var f=o[u];if(d&&f[2]?f[1]!==i[f[0]]:!(f[0]in i))return!1}for(;++u<c;){f=o[u];var h=f[0],v=i[h],x=f[1];if(d&&f[2]){if(v===void 0&&!(h in i))return!1}else{var b=new t;if(l)var m=l(v,x,h,i,s,b);if(!(m===void 0?e(x,v,r|n,l,b):m))return!1}}return!0}return Lp=a,Lp}var Bp,ak;function Zj(){if(ak)return Bp;ak=1;var t=$r();function e(r){return r===r&&!t(r)}return Bp=e,Bp}var Op,ik;function a4(){if(ik)return Op;ik=1;var t=Zj(),e=Ia();function r(n){for(var a=e(n),i=a.length;i--;){var s=a[i],o=n[s];a[i]=[s,o,t(o)]}return a}return Op=r,Op}var qp,sk;function Qj(){if(sk)return qp;sk=1;function t(e,r){return function(n){return n==null?!1:n[e]===r&&(r!==void 0||e in Object(n))}}return qp=t,qp}var Fp,ok;function i4(){if(ok)return Fp;ok=1;var t=n4(),e=a4(),r=Qj();function n(a){var i=e(a);return i.length==1&&i[0][2]?r(i[0][0],i[0][1]):function(s){return s===a||t(s,a,i)}}return Fp=n,Fp}var $p,lk;function Es(){if(lk)return $p;lk=1;var t=fi(),e=wn(),r="[object Symbol]";function n(a){return typeof a=="symbol"||e(a)&&t(a)==r}return $p=n,$p}var zp,uk;function D1(){if(uk)return zp;uk=1;var t=_t(),e=Es(),r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;function a(i,s){if(t(i))return!1;var o=typeof i;return o=="number"||o=="symbol"||o=="boolean"||i==null||e(i)?!0:n.test(i)||!r.test(i)||s!=null&&i in Object(s)}return zp=a,zp}var Vp,ck;function s4(){if(ck)return Vp;ck=1;var t=E1(),e="Expected a function";function r(n,a){if(typeof n!="function"||a!=null&&typeof a!="function")throw new TypeError(e);var i=function(){var s=arguments,o=a?a.apply(this,s):s[0],l=i.cache;if(l.has(o))return l.get(o);var u=n.apply(this,s);return i.cache=l.set(o,u)||l,u};return i.cache=new(r.Cache||t),i}return r.Cache=t,Vp=r,Vp}var Up,dk;function o4(){if(dk)return Up;dk=1;var t=s4(),e=500;function r(n){var a=t(n,function(s){return i.size===e&&i.clear(),s}),i=a.cache;return a}return Up=r,Up}var Gp,fk;function l4(){if(fk)return Gp;fk=1;var t=o4(),e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,r=/\\(\\)?/g,n=t(function(a){var i=[];return a.charCodeAt(0)===46&&i.push(""),a.replace(e,function(s,o,l,u){i.push(l?u.replace(r,"$1"):o||s)}),i});return Gp=n,Gp}var Hp,vk;function nd(){if(vk)return Hp;vk=1;function t(e,r){for(var n=-1,a=e==null?0:e.length,i=Array(a);++n<a;)i[n]=r(e[n],n,e);return i}return Hp=t,Hp}var Wp,hk;function u4(){if(hk)return Wp;hk=1;var t=bs(),e=nd(),r=_t(),n=Es(),a=t?t.prototype:void 0,i=a?a.toString:void 0;function s(o){if(typeof o=="string")return o;if(r(o))return e(o,s)+"";if(n(o))return i?i.call(o):"";var l=o+"";return l=="0"&&1/o==-1/0?"-0":l}return Wp=s,Wp}var Kp,pk;function Jj(){if(pk)return Kp;pk=1;var t=u4();function e(r){return r==null?"":t(r)}return Kp=e,Kp}var Yp,gk;function ad(){if(gk)return Yp;gk=1;var t=_t(),e=D1(),r=l4(),n=Jj();function a(i,s){return t(i)?i:e(i,s)?[i]:r(n(i))}return Yp=a,Yp}var Xp,mk;function vl(){if(mk)return Xp;mk=1;var t=Es();function e(r){if(typeof r=="string"||t(r))return r;var n=r+"";return n=="0"&&1/r==-1/0?"-0":n}return Xp=e,Xp}var Zp,yk;function id(){if(yk)return Zp;yk=1;var t=ad(),e=vl();function r(n,a){a=t(a,n);for(var i=0,s=a.length;n!=null&&i<s;)n=n[e(a[i++])];return i&&i==s?n:void 0}return Zp=r,Zp}var Qp,xk;function c4(){if(xk)return Qp;xk=1;var t=id();function e(r,n,a){var i=r==null?void 0:t(r,n);return i===void 0?a:i}return Qp=e,Qp}var Jp,bk;function d4(){if(bk)return Jp;bk=1;function t(e,r){return e!=null&&r in Object(e)}return Jp=t,Jp}var eg,wk;function eI(){if(wk)return eg;wk=1;var t=ad(),e=dl(),r=_t(),n=Qc(),a=k1(),i=vl();function s(o,l,u){l=t(l,o);for(var c=-1,d=l.length,f=!1;++c<d;){var h=i(l[c]);if(!(f=o!=null&&u(o,h)))break;o=o[h]}return f||++c!=d?f:(d=o==null?0:o.length,!!d&&a(d)&&n(h,d)&&(r(o)||e(o)))}return eg=s,eg}var tg,Sk;function tI(){if(Sk)return tg;Sk=1;var t=d4(),e=eI();function r(n,a){return n!=null&&e(n,a,t)}return tg=r,tg}var rg,Ek;function f4(){if(Ek)return rg;Ek=1;var t=Xj(),e=c4(),r=tI(),n=D1(),a=Zj(),i=Qj(),s=vl(),o=1,l=2;function u(c,d){return n(c)&&a(d)?i(s(c),d):function(f){var h=e(f,c);return h===void 0&&h===d?r(f,c):t(d,h,o|l)}}return rg=u,rg}var ng,Ck;function rI(){if(Ck)return ng;Ck=1;function t(e){return function(r){return r==null?void 0:r[e]}}return ng=t,ng}var ag,kk;function v4(){if(kk)return ag;kk=1;var t=id();function e(r){return function(n){return t(n,r)}}return ag=e,ag}var ig,Tk;function h4(){if(Tk)return ig;Tk=1;var t=rI(),e=v4(),r=D1(),n=vl();function a(i){return r(i)?t(n(i)):e(i)}return ig=a,ig}var sg,_k;function zn(){if(_k)return sg;_k=1;var t=i4(),e=f4(),r=pi(),n=_t(),a=h4();function i(s){return typeof s=="function"?s:s==null?r:typeof s=="object"?n(s)?e(s[0],s[1]):t(s):a(s)}return sg=i,sg}var og,Nk;function nI(){if(Nk)return og;Nk=1;var t=Ij(),e=Yz(),r=zn(),n=_t();function a(i,s){var o=n(i)?t:e;return o(i,r(s,3))}return og=a,og}var lg,Rk;function p4(){if(Rk)return lg;Rk=1;var t=Object.prototype,e=t.hasOwnProperty;function r(n,a){return n!=null&&e.call(n,a)}return lg=r,lg}var ug,Pk;function aI(){if(Pk)return ug;Pk=1;var t=p4(),e=eI();function r(n,a){return n!=null&&e(n,a,t)}return ug=r,ug}var cg,Ak;function g4(){if(Ak)return cg;Ak=1;var t=_1(),e=Ss(),r=dl(),n=_t(),a=$n(),i=ws(),s=ed(),o=fl(),l="[object Map]",u="[object Set]",c=Object.prototype,d=c.hasOwnProperty;function f(h){if(h==null)return!0;if(a(h)&&(n(h)||typeof h=="string"||typeof h.splice=="function"||i(h)||o(h)||r(h)))return!h.length;var v=e(h);if(v==l||v==u)return!h.size;if(s(h))return!t(h).length;for(var x in h)if(d.call(h,x))return!1;return!0}return cg=f,cg}var dg,jk;function iI(){if(jk)return dg;jk=1;function t(e){return e===void 0}return dg=t,dg}var fg,Ik;function sI(){if(Ik)return fg;Ik=1;var t=rd(),e=$n();function r(n,a){var i=-1,s=e(n)?Array(n.length):[];return t(n,function(o,l,u){s[++i]=a(o,l,u)}),s}return fg=r,fg}var vg,Mk;function oI(){if(Mk)return vg;Mk=1;var t=nd(),e=zn(),r=sI(),n=_t();function a(i,s){var o=n(i)?t:r;return o(i,e(s,3))}return vg=a,vg}var hg,Dk;function m4(){if(Dk)return hg;Dk=1;function t(e,r,n,a){var i=-1,s=e==null?0:e.length;for(a&&s&&(n=e[++i]);++i<s;)n=r(n,e[i],i,e);return n}return hg=t,hg}var pg,Lk;function y4(){if(Lk)return pg;Lk=1;function t(e,r,n,a,i){return i(e,function(s,o,l){n=a?(a=!1,s):r(n,s,o,l)}),n}return pg=t,pg}var gg,Bk;function lI(){if(Bk)return gg;Bk=1;var t=m4(),e=rd(),r=zn(),n=y4(),a=_t();function i(s,o,l){var u=a(s)?t:n,c=arguments.length<3;return u(s,r(o,4),l,c,e)}return gg=i,gg}var mg,Ok;function x4(){if(Ok)return mg;Ok=1;var t=fi(),e=_t(),r=wn(),n="[object String]";function a(i){return typeof i=="string"||!e(i)&&r(i)&&t(i)==n}return mg=a,mg}var yg,qk;function b4(){if(qk)return yg;qk=1;var t=rI(),e=t("length");return yg=e,yg}var xg,Fk;function w4(){if(Fk)return xg;Fk=1;var t="\\ud800-\\udfff",e="\\u0300-\\u036f",r="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",a=e+r+n,i="\\ufe0e\\ufe0f",s="\\u200d",o=RegExp("["+s+t+a+i+"]");function l(u){return o.test(u)}return xg=l,xg}var bg,$k;function S4(){if($k)return bg;$k=1;var t="\\ud800-\\udfff",e="\\u0300-\\u036f",r="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",a=e+r+n,i="\\ufe0e\\ufe0f",s="["+t+"]",o="["+a+"]",l="\\ud83c[\\udffb-\\udfff]",u="(?:"+o+"|"+l+")",c="[^"+t+"]",d="(?:\\ud83c[\\udde6-\\uddff]){2}",f="[\\ud800-\\udbff][\\udc00-\\udfff]",h="\\u200d",v=u+"?",x="["+i+"]?",b="(?:"+h+"(?:"+[c,d,f].join("|")+")"+x+v+")*",m=x+v+b,p="(?:"+[c+o+"?",o,d,f,s].join("|")+")",y=RegExp(l+"(?="+l+")|"+p+m,"g");function w(E){for(var S=y.lastIndex=0;y.test(E);)++S;return S}return bg=w,bg}var wg,zk;function E4(){if(zk)return wg;zk=1;var t=b4(),e=w4(),r=S4();function n(a){return e(a)?r(a):t(a)}return wg=n,wg}var Sg,Vk;function C4(){if(Vk)return Sg;Vk=1;var t=_1(),e=Ss(),r=$n(),n=x4(),a=E4(),i="[object Map]",s="[object Set]";function o(l){if(l==null)return 0;if(r(l))return n(l)?a(l):l.length;var u=e(l);return u==i||u==s?l.size:t(l).length}return Sg=o,Sg}var Eg,Uk;function k4(){if(Uk)return Eg;Uk=1;var t=C1(),e=$j(),r=I1(),n=zn(),a=td(),i=_t(),s=ws(),o=ul(),l=$r(),u=fl();function c(d,f,h){var v=i(d),x=v||s(d)||u(d);if(f=n(f,4),h==null){var b=d&&d.constructor;x?h=v?new b:[]:l(d)?h=o(b)?e(a(d)):{}:h={}}return(x?t:r)(d,function(m,p,y){return f(h,m,p,y)}),h}return Eg=c,Eg}var Cg,Gk;function T4(){if(Gk)return Cg;Gk=1;var t=bs(),e=dl(),r=_t(),n=t?t.isConcatSpreadable:void 0;function a(i){return r(i)||e(i)||!!(n&&i&&i[n])}return Cg=a,Cg}var kg,Hk;function L1(){if(Hk)return kg;Hk=1;var t=R1(),e=T4();function r(n,a,i,s,o){var l=-1,u=n.length;for(i||(i=e),o||(o=[]);++l<u;){var c=n[l];a>0&&i(c)?a>1?r(c,a-1,i,s,o):t(o,c):s||(o[o.length]=c)}return o}return kg=r,kg}var Tg,Wk;function _4(){if(Wk)return Tg;Wk=1;function t(e,r,n){switch(n.length){case 0:return e.call(r);case 1:return e.call(r,n[0]);case 2:return e.call(r,n[0],n[1]);case 3:return e.call(r,n[0],n[1],n[2])}return e.apply(r,n)}return Tg=t,Tg}var _g,Kk;function uI(){if(Kk)return _g;Kk=1;var t=_4(),e=Math.max;function r(n,a,i){return a=e(a===void 0?n.length-1:a,0),function(){for(var s=arguments,o=-1,l=e(s.length-a,0),u=Array(l);++o<l;)u[o]=s[a+o];o=-1;for(var c=Array(a+1);++o<a;)c[o]=s[o];return c[a]=i(u),t(n,this,c)}}return _g=r,_g}var Ng,Yk;function N4(){if(Yk)return Ng;Yk=1;var t=A1(),e=Nj(),r=pi(),n=e?function(a,i){return e(a,"toString",{configurable:!0,enumerable:!1,value:t(i),writable:!0})}:r;return Ng=n,Ng}var Rg,Xk;function R4(){if(Xk)return Rg;Xk=1;var t=800,e=16,r=Date.now;function n(a){var i=0,s=0;return function(){var o=r(),l=e-(o-s);if(s=o,l>0){if(++i>=t)return arguments[0]}else i=0;return a.apply(void 0,arguments)}}return Rg=n,Rg}var Pg,Zk;function cI(){if(Zk)return Pg;Zk=1;var t=N4(),e=R4(),r=e(t);return Pg=r,Pg}var Ag,Qk;function sd(){if(Qk)return Ag;Qk=1;var t=pi(),e=uI(),r=cI();function n(a,i){return r(e(a,i,t),a+"")}return Ag=n,Ag}var jg,Jk;function dI(){if(Jk)return jg;Jk=1;function t(e,r,n,a){for(var i=e.length,s=n+(a?1:-1);a?s--:++s<i;)if(r(e[s],s,e))return s;return-1}return jg=t,jg}var Ig,eT;function P4(){if(eT)return Ig;eT=1;function t(e){return e!==e}return Ig=t,Ig}var Mg,tT;function A4(){if(tT)return Mg;tT=1;function t(e,r,n){for(var a=n-1,i=e.length;++a<i;)if(e[a]===r)return a;return-1}return Mg=t,Mg}var Dg,rT;function j4(){if(rT)return Dg;rT=1;var t=dI(),e=P4(),r=A4();function n(a,i,s){return i===i?r(a,i,s):t(a,e,s)}return Dg=n,Dg}var Lg,nT;function I4(){if(nT)return Lg;nT=1;var t=j4();function e(r,n){var a=r==null?0:r.length;return!!a&&t(r,n,0)>-1}return Lg=e,Lg}var Bg,aT;function M4(){if(aT)return Bg;aT=1;function t(e,r,n){for(var a=-1,i=e==null?0:e.length;++a<i;)if(n(r,e[a]))return!0;return!1}return Bg=t,Bg}var Og,iT;function D4(){if(iT)return Og;iT=1;function t(){}return Og=t,Og}var qg,sT;function L4(){if(sT)return qg;sT=1;var t=Oj(),e=D4(),r=M1(),n=1/0,a=t&&1/r(new t([,-0]))[1]==n?function(i){return new t(i)}:e;return qg=a,qg}var Fg,oT;function B4(){if(oT)return Fg;oT=1;var t=Wj(),e=I4(),r=M4(),n=Kj(),a=L4(),i=M1(),s=200;function o(l,u,c){var d=-1,f=e,h=l.length,v=!0,x=[],b=x;if(c)v=!1,f=r;else if(h>=s){var m=u?null:a(l);if(m)return i(m);v=!1,f=n,b=new t}else b=u?[]:x;e:for(;++d<h;){var p=l[d],y=u?u(p):p;if(p=c||p!==0?p:0,v&&y===y){for(var w=b.length;w--;)if(b[w]===y)continue e;u&&b.push(y),x.push(p)}else f(b,y,c)||(b!==x&&b.push(y),x.push(p))}return x}return Fg=o,Fg}var $g,lT;function fI(){if(lT)return $g;lT=1;var t=$n(),e=wn();function r(n){return e(n)&&t(n)}return $g=r,$g}var zg,uT;function O4(){if(uT)return zg;uT=1;var t=L1(),e=sd(),r=B4(),n=fI(),a=e(function(i){return r(t(i,1,n,!0))});return zg=a,zg}var Vg,cT;function q4(){if(cT)return Vg;cT=1;var t=nd();function e(r,n){return t(n,function(a){return r[a]})}return Vg=e,Vg}var Ug,dT;function vI(){if(dT)return Ug;dT=1;var t=q4(),e=Ia();function r(n){return n==null?[]:t(n,e(n))}return Ug=r,Ug}var Gg,fT;function zr(){if(fT)return Gg;fT=1;var t;if(typeof w1=="function")try{t={clone:Hz(),constant:A1(),each:Hj(),filter:nI(),has:aI(),isArray:_t(),isEmpty:g4(),isFunction:ul(),isUndefined:iI(),keys:Ia(),map:oI(),reduce:lI(),size:C4(),transform:k4(),union:O4(),values:vI()}}catch{}return t||(t=window._),Gg=t,Gg}var Hg,vT;function B1(){if(vT)return Hg;vT=1;var t=zr();Hg=a;var e="\0",r="\0",n="";function a(c){this._isDirected=t.has(c,"directed")?c.directed:!0,this._isMultigraph=t.has(c,"multigraph")?c.multigraph:!1,this._isCompound=t.has(c,"compound")?c.compound:!1,this._label=void 0,this._defaultNodeLabelFn=t.constant(void 0),this._defaultEdgeLabelFn=t.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[r]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}a.prototype._nodeCount=0,a.prototype._edgeCount=0,a.prototype.isDirected=function(){return this._isDirected},a.prototype.isMultigraph=function(){return this._isMultigraph},a.prototype.isCompound=function(){return this._isCompound},a.prototype.setGraph=function(c){return this._label=c,this},a.prototype.graph=function(){return this._label},a.prototype.setDefaultNodeLabel=function(c){return t.isFunction(c)||(c=t.constant(c)),this._defaultNodeLabelFn=c,this},a.prototype.nodeCount=function(){return this._nodeCount},a.prototype.nodes=function(){return t.keys(this._nodes)},a.prototype.sources=function(){var c=this;return t.filter(this.nodes(),function(d){return t.isEmpty(c._in[d])})},a.prototype.sinks=function(){var c=this;return t.filter(this.nodes(),function(d){return t.isEmpty(c._out[d])})},a.prototype.setNodes=function(c,d){var f=arguments,h=this;return t.each(c,function(v){f.length>1?h.setNode(v,d):h.setNode(v)}),this},a.prototype.setNode=function(c,d){return t.has(this._nodes,c)?(arguments.length>1&&(this._nodes[c]=d),this):(this._nodes[c]=arguments.length>1?d:this._defaultNodeLabelFn(c),this._isCompound&&(this._parent[c]=r,this._children[c]={},this._children[r][c]=!0),this._in[c]={},this._preds[c]={},this._out[c]={},this._sucs[c]={},++this._nodeCount,this)},a.prototype.node=function(c){return this._nodes[c]},a.prototype.hasNode=function(c){return t.has(this._nodes,c)},a.prototype.removeNode=function(c){var d=this;if(t.has(this._nodes,c)){var f=function(h){d.removeEdge(d._edgeObjs[h])};delete this._nodes[c],this._isCompound&&(this._removeFromParentsChildList(c),delete this._parent[c],t.each(this.children(c),function(h){d.setParent(h)}),delete this._children[c]),t.each(t.keys(this._in[c]),f),delete this._in[c],delete this._preds[c],t.each(t.keys(this._out[c]),f),delete this._out[c],delete this._sucs[c],--this._nodeCount}return this},a.prototype.setParent=function(c,d){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(t.isUndefined(d))d=r;else{d+="";for(var f=d;!t.isUndefined(f);f=this.parent(f))if(f===c)throw new Error("Setting "+d+" as parent of "+c+" would create a cycle");this.setNode(d)}return this.setNode(c),this._removeFromParentsChildList(c),this._parent[c]=d,this._children[d][c]=!0,this},a.prototype._removeFromParentsChildList=function(c){delete this._children[this._parent[c]][c]},a.prototype.parent=function(c){if(this._isCompound){var d=this._parent[c];if(d!==r)return d}},a.prototype.children=function(c){if(t.isUndefined(c)&&(c=r),this._isCompound){var d=this._children[c];if(d)return t.keys(d)}else{if(c===r)return this.nodes();if(this.hasNode(c))return[]}},a.prototype.predecessors=function(c){var d=this._preds[c];if(d)return t.keys(d)},a.prototype.successors=function(c){var d=this._sucs[c];if(d)return t.keys(d)},a.prototype.neighbors=function(c){var d=this.predecessors(c);if(d)return t.union(d,this.successors(c))},a.prototype.isLeaf=function(c){var d;return this.isDirected()?d=this.successors(c):d=this.neighbors(c),d.length===0},a.prototype.filterNodes=function(c){var d=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});d.setGraph(this.graph());var f=this;t.each(this._nodes,function(x,b){c(b)&&d.setNode(b,x)}),t.each(this._edgeObjs,function(x){d.hasNode(x.v)&&d.hasNode(x.w)&&d.setEdge(x,f.edge(x))});var h={};function v(x){var b=f.parent(x);return b===void 0||d.hasNode(b)?(h[x]=b,b):b in h?h[b]:v(b)}return this._isCompound&&t.each(d.nodes(),function(x){d.setParent(x,v(x))}),d},a.prototype.setDefaultEdgeLabel=function(c){return t.isFunction(c)||(c=t.constant(c)),this._defaultEdgeLabelFn=c,this},a.prototype.edgeCount=function(){return this._edgeCount},a.prototype.edges=function(){return t.values(this._edgeObjs)},a.prototype.setPath=function(c,d){var f=this,h=arguments;return t.reduce(c,function(v,x){return h.length>1?f.setEdge(v,x,d):f.setEdge(v,x),x}),this},a.prototype.setEdge=function(){var c,d,f,h,v=!1,x=arguments[0];typeof x=="object"&&x!==null&&"v"in x?(c=x.v,d=x.w,f=x.name,arguments.length===2&&(h=arguments[1],v=!0)):(c=x,d=arguments[1],f=arguments[3],arguments.length>2&&(h=arguments[2],v=!0)),c=""+c,d=""+d,t.isUndefined(f)||(f=""+f);var b=o(this._isDirected,c,d,f);if(t.has(this._edgeLabels,b))return v&&(this._edgeLabels[b]=h),this;if(!t.isUndefined(f)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(c),this.setNode(d),this._edgeLabels[b]=v?h:this._defaultEdgeLabelFn(c,d,f);var m=l(this._isDirected,c,d,f);return c=m.v,d=m.w,Object.freeze(m),this._edgeObjs[b]=m,i(this._preds[d],c),i(this._sucs[c],d),this._in[d][b]=m,this._out[c][b]=m,this._edgeCount++,this},a.prototype.edge=function(c,d,f){var h=arguments.length===1?u(this._isDirected,arguments[0]):o(this._isDirected,c,d,f);return this._edgeLabels[h]},a.prototype.hasEdge=function(c,d,f){var h=arguments.length===1?u(this._isDirected,arguments[0]):o(this._isDirected,c,d,f);return t.has(this._edgeLabels,h)},a.prototype.removeEdge=function(c,d,f){var h=arguments.length===1?u(this._isDirected,arguments[0]):o(this._isDirected,c,d,f),v=this._edgeObjs[h];return v&&(c=v.v,d=v.w,delete this._edgeLabels[h],delete this._edgeObjs[h],s(this._preds[d],c),s(this._sucs[c],d),delete this._in[d][h],delete this._out[c][h],this._edgeCount--),this},a.prototype.inEdges=function(c,d){var f=this._in[c];if(f){var h=t.values(f);return d?t.filter(h,function(v){return v.v===d}):h}},a.prototype.outEdges=function(c,d){var f=this._out[c];if(f){var h=t.values(f);return d?t.filter(h,function(v){return v.w===d}):h}},a.prototype.nodeEdges=function(c,d){var f=this.inEdges(c,d);if(f)return f.concat(this.outEdges(c,d))};function i(c,d){c[d]?c[d]++:c[d]=1}function s(c,d){--c[d]||delete c[d]}function o(c,d,f,h){var v=""+d,x=""+f;if(!c&&v>x){var b=v;v=x,x=b}return v+n+x+n+(t.isUndefined(h)?e:h)}function l(c,d,f,h){var v=""+d,x=""+f;if(!c&&v>x){var b=v;v=x,x=b}var m={v,w:x};return h&&(m.name=h),m}function u(c,d){return o(c,d.v,d.w,d.name)}return Hg}var Wg,hT;function F4(){return hT||(hT=1,Wg="2.1.8"),Wg}var Kg,pT;function $4(){return pT||(pT=1,Kg={Graph:B1(),version:F4()}),Kg}var Yg,gT;function z4(){if(gT)return Yg;gT=1;var t=zr(),e=B1();Yg={write:r,read:i};function r(s){var o={options:{directed:s.isDirected(),multigraph:s.isMultigraph(),compound:s.isCompound()},nodes:n(s),edges:a(s)};return t.isUndefined(s.graph())||(o.value=t.clone(s.graph())),o}function n(s){return t.map(s.nodes(),function(o){var l=s.node(o),u=s.parent(o),c={v:o};return t.isUndefined(l)||(c.value=l),t.isUndefined(u)||(c.parent=u),c})}function a(s){return t.map(s.edges(),function(o){var l=s.edge(o),u={v:o.v,w:o.w};return t.isUndefined(o.name)||(u.name=o.name),t.isUndefined(l)||(u.value=l),u})}function i(s){var o=new e(s.options).setGraph(s.value);return t.each(s.nodes,function(l){o.setNode(l.v,l.value),l.parent&&o.setParent(l.v,l.parent)}),t.each(s.edges,function(l){o.setEdge({v:l.v,w:l.w,name:l.name},l.value)}),o}return Yg}var Xg,mT;function V4(){if(mT)return Xg;mT=1;var t=zr();Xg=e;function e(r){var n={},a=[],i;function s(o){t.has(n,o)||(n[o]=!0,i.push(o),t.each(r.successors(o),s),t.each(r.predecessors(o),s))}return t.each(r.nodes(),function(o){i=[],s(o),i.length&&a.push(i)}),a}return Xg}var Zg,yT;function hI(){if(yT)return Zg;yT=1;var t=zr();Zg=e;function e(){this._arr=[],this._keyIndices={}}return e.prototype.size=function(){return this._arr.length},e.prototype.keys=function(){return this._arr.map(function(r){return r.key})},e.prototype.has=function(r){return t.has(this._keyIndices,r)},e.prototype.priority=function(r){var n=this._keyIndices[r];if(n!==void 0)return this._arr[n].priority},e.prototype.min=function(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key},e.prototype.add=function(r,n){var a=this._keyIndices;if(r=String(r),!t.has(a,r)){var i=this._arr,s=i.length;return a[r]=s,i.push({key:r,priority:n}),this._decrease(s),!0}return!1},e.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var r=this._arr.pop();return delete this._keyIndices[r.key],this._heapify(0),r.key},e.prototype.decrease=function(r,n){var a=this._keyIndices[r];if(n>this._arr[a].priority)throw new Error("New priority is greater than current priority. Key: "+r+" Old: "+this._arr[a].priority+" New: "+n);this._arr[a].priority=n,this._decrease(a)},e.prototype._heapify=function(r){var n=this._arr,a=2*r,i=a+1,s=r;a<n.length&&(s=n[a].priority<n[s].priority?a:s,i<n.length&&(s=n[i].priority<n[s].priority?i:s),s!==r&&(this._swap(r,s),this._heapify(s)))},e.prototype._decrease=function(r){for(var n=this._arr,a=n[r].priority,i;r!==0&&(i=r>>1,!(n[i].priority<a));)this._swap(r,i),r=i},e.prototype._swap=function(r,n){var a=this._arr,i=this._keyIndices,s=a[r],o=a[n];a[r]=o,a[n]=s,i[o.key]=r,i[s.key]=n},Zg}var Qg,xT;function pI(){if(xT)return Qg;xT=1;var t=zr(),e=hI();Qg=n;var r=t.constant(1);function n(i,s,o,l){return a(i,String(s),o||r,l||function(u){return i.outEdges(u)})}function a(i,s,o,l){var u={},c=new e,d,f,h=function(v){var x=v.v!==d?v.v:v.w,b=u[x],m=o(v),p=f.distance+m;if(m<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+v+" Weight: "+m);p<b.distance&&(b.distance=p,b.predecessor=d,c.decrease(x,p))};for(i.nodes().forEach(function(v){var x=v===s?0:Number.POSITIVE_INFINITY;u[v]={distance:x},c.add(v,x)});c.size()>0&&(d=c.removeMin(),f=u[d],f.distance!==Number.POSITIVE_INFINITY);)l(d).forEach(h);return u}return Qg}var Jg,bT;function U4(){if(bT)return Jg;bT=1;var t=pI(),e=zr();Jg=r;function r(n,a,i){return e.transform(n.nodes(),function(s,o){s[o]=t(n,o,a,i)},{})}return Jg}var em,wT;function gI(){if(wT)return em;wT=1;var t=zr();em=e;function e(r){var n=0,a=[],i={},s=[];function o(l){var u=i[l]={onStack:!0,lowlink:n,index:n++};if(a.push(l),r.successors(l).forEach(function(f){t.has(i,f)?i[f].onStack&&(u.lowlink=Math.min(u.lowlink,i[f].index)):(o(f),u.lowlink=Math.min(u.lowlink,i[f].lowlink))}),u.lowlink===u.index){var c=[],d;do d=a.pop(),i[d].onStack=!1,c.push(d);while(l!==d);s.push(c)}}return r.nodes().forEach(function(l){t.has(i,l)||o(l)}),s}return em}var tm,ST;function G4(){if(ST)return tm;ST=1;var t=zr(),e=gI();tm=r;function r(n){return t.filter(e(n),function(a){return a.length>1||a.length===1&&n.hasEdge(a[0],a[0])})}return tm}var rm,ET;function H4(){if(ET)return rm;ET=1;var t=zr();rm=r;var e=t.constant(1);function r(a,i,s){return n(a,i||e,s||function(o){return a.outEdges(o)})}function n(a,i,s){var o={},l=a.nodes();return l.forEach(function(u){o[u]={},o[u][u]={distance:0},l.forEach(function(c){u!==c&&(o[u][c]={distance:Number.POSITIVE_INFINITY})}),s(u).forEach(function(c){var d=c.v===u?c.w:c.v,f=i(c);o[u][d]={distance:f,predecessor:u}})}),l.forEach(function(u){var c=o[u];l.forEach(function(d){var f=o[d];l.forEach(function(h){var v=f[u],x=c[h],b=f[h],m=v.distance+x.distance;m<b.distance&&(b.distance=m,b.predecessor=x.predecessor)})})}),o}return rm}var nm,CT;function mI(){if(CT)return nm;CT=1;var t=zr();nm=e,e.CycleException=r;function e(n){var a={},i={},s=[];function o(l){if(t.has(i,l))throw new r;t.has(a,l)||(i[l]=!0,a[l]=!0,t.each(n.predecessors(l),o),delete i[l],s.push(l))}if(t.each(n.sinks(),o),t.size(a)!==n.nodeCount())throw new r;return s}function r(){}return r.prototype=new Error,nm}var am,kT;function W4(){if(kT)return am;kT=1;var t=mI();am=e;function e(r){try{t(r)}catch(n){if(n instanceof t.CycleException)return!1;throw n}return!0}return am}var im,TT;function yI(){if(TT)return im;TT=1;var t=zr();im=e;function e(n,a,i){t.isArray(a)||(a=[a]);var s=(n.isDirected()?n.successors:n.neighbors).bind(n),o=[],l={};return t.each(a,function(u){if(!n.hasNode(u))throw new Error("Graph does not have node: "+u);r(n,u,i==="post",l,s,o)}),o}function r(n,a,i,s,o,l){t.has(s,a)||(s[a]=!0,i||l.push(a),t.each(o(a),function(u){r(n,u,i,s,o,l)}),i&&l.push(a))}return im}var sm,_T;function K4(){if(_T)return sm;_T=1;var t=yI();sm=e;function e(r,n){return t(r,n,"post")}return sm}var om,NT;function Y4(){if(NT)return om;NT=1;var t=yI();om=e;function e(r,n){return t(r,n,"pre")}return om}var lm,RT;function X4(){if(RT)return lm;RT=1;var t=zr(),e=B1(),r=hI();lm=n;function n(a,i){var s=new e,o={},l=new r,u;function c(f){var h=f.v===u?f.w:f.v,v=l.priority(h);if(v!==void 0){var x=i(f);x<v&&(o[h]=u,l.decrease(h,x))}}if(a.nodeCount()===0)return s;t.each(a.nodes(),function(f){l.add(f,Number.POSITIVE_INFINITY),s.setNode(f)}),l.decrease(a.nodes()[0],0);for(var d=!1;l.size()>0;){if(u=l.removeMin(),t.has(o,u))s.setEdge(u,o[u]);else{if(d)throw new Error("Input graph is not connected: "+a);d=!0}a.nodeEdges(u).forEach(c)}return s}return lm}var um,PT;function Z4(){return PT||(PT=1,um={components:V4(),dijkstra:pI(),dijkstraAll:U4(),findCycles:G4(),floydWarshall:H4(),isAcyclic:W4(),postorder:K4(),preorder:Y4(),prim:X4(),tarjan:gI(),topsort:mI()}),um}var cm,AT;function Q4(){if(AT)return cm;AT=1;var t=$4();return cm={Graph:t.Graph,json:z4(),alg:Z4(),version:t.version},cm}var dm,jT;function nn(){if(jT)return dm;jT=1;var t;if(typeof w1=="function")try{t=Q4()}catch{}return t||(t=window.graphlib),dm=t,dm}var fm,IT;function J4(){if(IT)return fm;IT=1;var t=Vj(),e=1,r=4;function n(a){return t(a,e|r)}return fm=n,fm}var vm,MT;function od(){if(MT)return vm;MT=1;var t=xs(),e=$n(),r=Qc(),n=$r();function a(i,s,o){if(!n(o))return!1;var l=typeof s;return(l=="number"?e(o)&&r(s,o.length):l=="string"&&s in o)?t(o[s],i):!1}return vm=a,vm}var hm,DT;function eV(){if(DT)return hm;DT=1;var t=sd(),e=xs(),r=od(),n=hi(),a=Object.prototype,i=a.hasOwnProperty,s=t(function(o,l){o=Object(o);var u=-1,c=l.length,d=c>2?l[2]:void 0;for(d&&r(l[0],l[1],d)&&(c=1);++u<c;)for(var f=l[u],h=n(f),v=-1,x=h.length;++v<x;){var b=h[v],m=o[b];(m===void 0||e(m,a[b])&&!i.call(o,b))&&(o[b]=f[b])}return o});return hm=s,hm}var pm,LT;function tV(){if(LT)return pm;LT=1;var t=zn(),e=$n(),r=Ia();function n(a){return function(i,s,o){var l=Object(i);if(!e(i)){var u=t(s,3);i=r(i),s=function(d){return u(l[d],d,l)}}var c=a(i,s,o);return c>-1?l[u?i[c]:c]:void 0}}return pm=n,pm}var gm,BT;function rV(){if(BT)return gm;BT=1;var t=/\s/;function e(r){for(var n=r.length;n--&&t.test(r.charAt(n)););return n}return gm=e,gm}var mm,OT;function nV(){if(OT)return mm;OT=1;var t=rV(),e=/^\s+/;function r(n){return n&&n.slice(0,t(n)+1).replace(e,"")}return mm=r,mm}var ym,qT;function aV(){if(qT)return ym;qT=1;var t=nV(),e=$r(),r=Es(),n=NaN,a=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,s=/^0o[0-7]+$/i,o=parseInt;function l(u){if(typeof u=="number")return u;if(r(u))return n;if(e(u)){var c=typeof u.valueOf=="function"?u.valueOf():u;u=e(c)?c+"":c}if(typeof u!="string")return u===0?u:+u;u=t(u);var d=i.test(u);return d||s.test(u)?o(u.slice(2),d?2:8):a.test(u)?n:+u}return ym=l,ym}var xm,FT;function xI(){if(FT)return xm;FT=1;var t=aV(),e=1/0,r=17976931348623157e292;function n(a){if(!a)return a===0?a:0;if(a=t(a),a===e||a===-e){var i=a<0?-1:1;return i*r}return a===a?a:0}return xm=n,xm}var bm,$T;function iV(){if($T)return bm;$T=1;var t=xI();function e(r){var n=t(r),a=n%1;return n===n?a?n-a:n:0}return bm=e,bm}var wm,zT;function sV(){if(zT)return wm;zT=1;var t=dI(),e=zn(),r=iV(),n=Math.max;function a(i,s,o){var l=i==null?0:i.length;if(!l)return-1;var u=o==null?0:r(o);return u<0&&(u=n(l+u,0)),t(i,e(s,3),u)}return wm=a,wm}var Sm,VT;function oV(){if(VT)return Sm;VT=1;var t=tV(),e=sV(),r=t(e);return Sm=r,Sm}var Em,UT;function bI(){if(UT)return Em;UT=1;var t=L1();function e(r){var n=r==null?0:r.length;return n?t(r,1):[]}return Em=e,Em}var Cm,GT;function lV(){if(GT)return Cm;GT=1;var t=j1(),e=Uj(),r=hi();function n(a,i){return a==null?a:t(a,e(i),r)}return Cm=n,Cm}var km,HT;function uV(){if(HT)return km;HT=1;function t(e){var r=e==null?0:e.length;return r?e[r-1]:void 0}return km=t,km}var Tm,WT;function cV(){if(WT)return Tm;WT=1;var t=Xc(),e=I1(),r=zn();function n(a,i){var s={};return i=r(i,3),e(a,function(o,l,u){t(s,l,i(o,l,u))}),s}return Tm=n,Tm}var _m,KT;function O1(){if(KT)return _m;KT=1;var t=Es();function e(r,n,a){for(var i=-1,s=r.length;++i<s;){var o=r[i],l=n(o);if(l!=null&&(u===void 0?l===l&&!t(l):a(l,u)))var u=l,c=o}return c}return _m=e,_m}var Nm,YT;function dV(){if(YT)return Nm;YT=1;function t(e,r){return e>r}return Nm=t,Nm}var Rm,XT;function fV(){if(XT)return Rm;XT=1;var t=O1(),e=dV(),r=pi();function n(a){return a&&a.length?t(a,r,e):void 0}return Rm=n,Rm}var Pm,ZT;function wI(){if(ZT)return Pm;ZT=1;var t=Xc(),e=xs();function r(n,a,i){(i!==void 0&&!e(n[a],i)||i===void 0&&!(a in n))&&t(n,a,i)}return Pm=r,Pm}var Am,QT;function vV(){if(QT)return Am;QT=1;var t=fi(),e=td(),r=wn(),n="[object Object]",a=Function.prototype,i=Object.prototype,s=a.toString,o=i.hasOwnProperty,l=s.call(Object);function u(c){if(!r(c)||t(c)!=n)return!1;var d=e(c);if(d===null)return!0;var f=o.call(d,"constructor")&&d.constructor;return typeof f=="function"&&f instanceof f&&s.call(f)==l}return Am=u,Am}var jm,JT;function SI(){if(JT)return jm;JT=1;function t(e,r){if(!(r==="constructor"&&typeof e[r]=="function")&&r!="__proto__")return e[r]}return jm=t,jm}var Im,e_;function hV(){if(e_)return Im;e_=1;var t=cl(),e=hi();function r(n){return t(n,e(n))}return Im=r,Im}var Mm,t_;function pV(){if(t_)return Mm;t_=1;var t=wI(),e=Aj(),r=Fj(),n=jj(),a=zj(),i=dl(),s=_t(),o=fI(),l=ws(),u=ul(),c=$r(),d=vV(),f=fl(),h=SI(),v=hV();function x(b,m,p,y,w,E,S){var C=h(b,p),k=h(m,p),T=S.get(k);if(T){t(b,p,T);return}var _=E?E(C,k,p+"",b,m,S):void 0,N=_===void 0;if(N){var P=s(k),R=!P&&l(k),I=!P&&!R&&f(k);_=k,P||R||I?s(C)?_=C:o(C)?_=n(C):R?(N=!1,_=e(k,!0)):I?(N=!1,_=r(k,!0)):_=[]:d(k)||i(k)?(_=C,i(C)?_=v(C):(!c(C)||u(C))&&(_=a(k))):N=!1}N&&(S.set(k,_),w(_,k,y,E,S),S.delete(k)),t(b,p,_)}return Mm=x,Mm}var Dm,r_;function gV(){if(r_)return Dm;r_=1;var t=Yc(),e=wI(),r=j1(),n=pV(),a=$r(),i=hi(),s=SI();function o(l,u,c,d,f){l!==u&&r(u,function(h,v){if(f||(f=new t),a(h))n(l,u,v,c,o,d,f);else{var x=d?d(s(l,v),h,v+"",l,u,f):void 0;x===void 0&&(x=h),e(l,v,x)}},i)}return Dm=o,Dm}var Lm,n_;function mV(){if(n_)return Lm;n_=1;var t=sd(),e=od();function r(n){return t(function(a,i){var s=-1,o=i.length,l=o>1?i[o-1]:void 0,u=o>2?i[2]:void 0;for(l=n.length>3&&typeof l=="function"?(o--,l):void 0,u&&e(i[0],i[1],u)&&(l=o<3?void 0:l,o=1),a=Object(a);++s<o;){var c=i[s];c&&n(a,c,s,l)}return a})}return Lm=r,Lm}var Bm,a_;function yV(){if(a_)return Bm;a_=1;var t=gV(),e=mV(),r=e(function(n,a,i){t(n,a,i)});return Bm=r,Bm}var Om,i_;function EI(){if(i_)return Om;i_=1;function t(e,r){return e<r}return Om=t,Om}var qm,s_;function xV(){if(s_)return qm;s_=1;var t=O1(),e=EI(),r=pi();function n(a){return a&&a.length?t(a,r,e):void 0}return qm=n,qm}var Fm,o_;function bV(){if(o_)return Fm;o_=1;var t=O1(),e=zn(),r=EI();function n(a,i){return a&&a.length?t(a,e(i,2),r):void 0}return Fm=n,Fm}var $m,l_;function wV(){if(l_)return $m;l_=1;var t=an(),e=function(){return t.Date.now()};return $m=e,$m}var zm,u_;function SV(){if(u_)return zm;u_=1;var t=Zc(),e=ad(),r=Qc(),n=$r(),a=vl();function i(s,o,l,u){if(!n(s))return s;o=e(o,s);for(var c=-1,d=o.length,f=d-1,h=s;h!=null&&++c<d;){var v=a(o[c]),x=l;if(v==="__proto__"||v==="constructor"||v==="prototype")return s;if(c!=f){var b=h[v];x=u?u(b,v,h):void 0,x===void 0&&(x=n(b)?b:r(o[c+1])?[]:{})}t(h,v,x),h=h[v]}return s}return zm=i,zm}var Vm,c_;function EV(){if(c_)return Vm;c_=1;var t=id(),e=SV(),r=ad();function n(a,i,s){for(var o=-1,l=i.length,u={};++o<l;){var c=i[o],d=t(a,c);s(d,c)&&e(u,r(c,a),d)}return u}return Vm=n,Vm}var Um,d_;function CV(){if(d_)return Um;d_=1;var t=EV(),e=tI();function r(n,a){return t(n,a,function(i,s){return e(n,s)})}return Um=r,Um}var Gm,f_;function kV(){if(f_)return Gm;f_=1;var t=bI(),e=uI(),r=cI();function n(a){return r(e(a,void 0,t),a+"")}return Gm=n,Gm}var Hm,v_;function TV(){if(v_)return Hm;v_=1;var t=CV(),e=kV(),r=e(function(n,a){return n==null?{}:t(n,a)});return Hm=r,Hm}var Wm,h_;function _V(){if(h_)return Wm;h_=1;var t=Math.ceil,e=Math.max;function r(n,a,i,s){for(var o=-1,l=e(t((a-n)/(i||1)),0),u=Array(l);l--;)u[s?l:++o]=n,n+=i;return u}return Wm=r,Wm}var Km,p_;function NV(){if(p_)return Km;p_=1;var t=_V(),e=od(),r=xI();function n(a){return function(i,s,o){return o&&typeof o!="number"&&e(i,s,o)&&(s=o=void 0),i=r(i),s===void 0?(s=i,i=0):s=r(s),o=o===void 0?i<s?1:-1:r(o),t(i,s,o,a)}}return Km=n,Km}var Ym,g_;function RV(){if(g_)return Ym;g_=1;var t=NV(),e=t();return Ym=e,Ym}var Xm,m_;function PV(){if(m_)return Xm;m_=1;function t(e,r){var n=e.length;for(e.sort(r);n--;)e[n]=e[n].value;return e}return Xm=t,Xm}var Zm,y_;function AV(){if(y_)return Zm;y_=1;var t=Es();function e(r,n){if(r!==n){var a=r!==void 0,i=r===null,s=r===r,o=t(r),l=n!==void 0,u=n===null,c=n===n,d=t(n);if(!u&&!d&&!o&&r>n||o&&l&&c&&!u&&!d||i&&l&&c||!a&&c||!s)return 1;if(!i&&!o&&!d&&r<n||d&&a&&s&&!i&&!o||u&&a&&s||!l&&s||!c)return-1}return 0}return Zm=e,Zm}var Qm,x_;function jV(){if(x_)return Qm;x_=1;var t=AV();function e(r,n,a){for(var i=-1,s=r.criteria,o=n.criteria,l=s.length,u=a.length;++i<l;){var c=t(s[i],o[i]);if(c){if(i>=u)return c;var d=a[i];return c*(d=="desc"?-1:1)}}return r.index-n.index}return Qm=e,Qm}var Jm,b_;function IV(){if(b_)return Jm;b_=1;var t=nd(),e=id(),r=zn(),n=sI(),a=PV(),i=Jc(),s=jV(),o=pi(),l=_t();function u(c,d,f){d.length?d=t(d,function(x){return l(x)?function(b){return e(b,x.length===1?x[0]:x)}:x}):d=[o];var h=-1;d=t(d,i(r));var v=n(c,function(x,b,m){var p=t(d,function(y){return y(x)});return{criteria:p,index:++h,value:x}});return a(v,function(x,b){return s(x,b,f)})}return Jm=u,Jm}var ey,w_;function MV(){if(w_)return ey;w_=1;var t=L1(),e=IV(),r=sd(),n=od(),a=r(function(i,s){if(i==null)return[];var o=s.length;return o>1&&n(i,s[0],s[1])?s=[]:o>2&&n(s[0],s[1],s[2])&&(s=[s[0]]),e(i,t(s,1),[])});return ey=a,ey}var ty,S_;function DV(){if(S_)return ty;S_=1;var t=Jj(),e=0;function r(n){var a=++e;return t(n)+a}return ty=r,ty}var ry,E_;function LV(){if(E_)return ry;E_=1;function t(e,r,n){for(var a=-1,i=e.length,s=r.length,o={};++a<i;){var l=a<s?r[a]:void 0;n(o,e[a],l)}return o}return ry=t,ry}var ny,C_;function BV(){if(C_)return ny;C_=1;var t=Zc(),e=LV();function r(n,a){return e(n||[],a||[],t)}return ny=r,ny}var ay,k_;function dt(){if(k_)return ay;k_=1;var t;if(typeof w1=="function")try{t={cloneDeep:J4(),constant:A1(),defaults:eV(),each:Hj(),filter:nI(),find:oV(),flatten:bI(),forEach:Gj(),forIn:lV(),has:aI(),isUndefined:iI(),last:uV(),map:oI(),mapValues:cV(),max:fV(),merge:yV(),min:xV(),minBy:bV(),now:wV(),pick:TV(),range:RV(),reduce:lI(),sortBy:MV(),uniqueId:DV(),values:vI(),zipObject:BV()}}catch{}return t||(t=window._),ay=t,ay}var iy,T_;function OV(){if(T_)return iy;T_=1,iy=t;function t(){var n={};n._next=n._prev=n,this._sentinel=n}t.prototype.dequeue=function(){var n=this._sentinel,a=n._prev;if(a!==n)return e(a),a},t.prototype.enqueue=function(n){var a=this._sentinel;n._prev&&n._next&&e(n),n._next=a._next,a._next._prev=n,a._next=n,n._prev=a},t.prototype.toString=function(){for(var n=[],a=this._sentinel,i=a._prev;i!==a;)n.push(JSON.stringify(i,r)),i=i._prev;return"["+n.join(", ")+"]"};function e(n){n._prev._next=n._next,n._next._prev=n._prev,delete n._next,delete n._prev}function r(n,a){if(n!=="_next"&&n!=="_prev")return a}return iy}var sy,__;function qV(){if(__)return sy;__=1;var t=dt(),e=nn().Graph,r=OV();sy=a;var n=t.constant(1);function a(u,c){if(u.nodeCount()<=1)return[];var d=o(u,c||n),f=i(d.graph,d.buckets,d.zeroIdx);return t.flatten(t.map(f,function(h){return u.outEdges(h.v,h.w)}),!0)}function i(u,c,d){for(var f=[],h=c[c.length-1],v=c[0],x;u.nodeCount();){for(;x=v.dequeue();)s(u,c,d,x);for(;x=h.dequeue();)s(u,c,d,x);if(u.nodeCount()){for(var b=c.length-2;b>0;--b)if(x=c[b].dequeue(),x){f=f.concat(s(u,c,d,x,!0));break}}}return f}function s(u,c,d,f,h){var v=h?[]:void 0;return t.forEach(u.inEdges(f.v),function(x){var b=u.edge(x),m=u.node(x.v);h&&v.push({v:x.v,w:x.w}),m.out-=b,l(c,d,m)}),t.forEach(u.outEdges(f.v),function(x){var b=u.edge(x),m=x.w,p=u.node(m);p.in-=b,l(c,d,p)}),u.removeNode(f.v),v}function o(u,c){var d=new e,f=0,h=0;t.forEach(u.nodes(),function(b){d.setNode(b,{v:b,in:0,out:0})}),t.forEach(u.edges(),function(b){var m=d.edge(b.v,b.w)||0,p=c(b),y=m+p;d.setEdge(b.v,b.w,y),h=Math.max(h,d.node(b.v).out+=p),f=Math.max(f,d.node(b.w).in+=p)});var v=t.range(h+f+3).map(function(){return new r}),x=f+1;return t.forEach(d.nodes(),function(b){l(v,x,d.node(b))}),{graph:d,buckets:v,zeroIdx:x}}function l(u,c,d){d.out?d.in?u[d.out-d.in+c].enqueue(d):u[u.length-1].enqueue(d):u[0].enqueue(d)}return sy}var oy,N_;function FV(){if(N_)return oy;N_=1;var t=dt(),e=qV();oy={run:r,undo:a};function r(i){var s=i.graph().acyclicer==="greedy"?e(i,o(i)):n(i);t.forEach(s,function(l){var u=i.edge(l);i.removeEdge(l),u.forwardName=l.name,u.reversed=!0,i.setEdge(l.w,l.v,u,t.uniqueId("rev"))});function o(l){return function(u){return l.edge(u).weight}}}function n(i){var s=[],o={},l={};function u(c){t.has(l,c)||(l[c]=!0,o[c]=!0,t.forEach(i.outEdges(c),function(d){t.has(o,d.w)?s.push(d):u(d.w)}),delete o[c])}return t.forEach(i.nodes(),u),s}function a(i){t.forEach(i.edges(),function(s){var o=i.edge(s);if(o.reversed){i.removeEdge(s);var l=o.forwardName;delete o.reversed,delete o.forwardName,i.setEdge(s.w,s.v,o,l)}})}return oy}var ly,R_;function Er(){if(R_)return ly;R_=1;var t=dt(),e=nn().Graph;ly={addDummyNode:r,simplify:n,asNonCompoundGraph:a,successorWeights:i,predecessorWeights:s,intersectRect:o,buildLayerMatrix:l,normalizeRanks:u,removeEmptyRanks:c,addBorderNode:d,maxRank:f,partition:h,time:v,notime:x};function r(b,m,p,y){var w;do w=t.uniqueId(y);while(b.hasNode(w));return p.dummy=m,b.setNode(w,p),w}function n(b){var m=new e().setGraph(b.graph());return t.forEach(b.nodes(),function(p){m.setNode(p,b.node(p))}),t.forEach(b.edges(),function(p){var y=m.edge(p.v,p.w)||{weight:0,minlen:1},w=b.edge(p);m.setEdge(p.v,p.w,{weight:y.weight+w.weight,minlen:Math.max(y.minlen,w.minlen)})}),m}function a(b){var m=new e({multigraph:b.isMultigraph()}).setGraph(b.graph());return t.forEach(b.nodes(),function(p){b.children(p).length||m.setNode(p,b.node(p))}),t.forEach(b.edges(),function(p){m.setEdge(p,b.edge(p))}),m}function i(b){var m=t.map(b.nodes(),function(p){var y={};return t.forEach(b.outEdges(p),function(w){y[w.w]=(y[w.w]||0)+b.edge(w).weight}),y});return t.zipObject(b.nodes(),m)}function s(b){var m=t.map(b.nodes(),function(p){var y={};return t.forEach(b.inEdges(p),function(w){y[w.v]=(y[w.v]||0)+b.edge(w).weight}),y});return t.zipObject(b.nodes(),m)}function o(b,m){var p=b.x,y=b.y,w=m.x-p,E=m.y-y,S=b.width/2,C=b.height/2;if(!w&&!E)throw new Error("Not possible to find intersection inside of the rectangle");var k,T;return Math.abs(E)*S>Math.abs(w)*C?(E<0&&(C=-C),k=C*w/E,T=C):(w<0&&(S=-S),k=S,T=S*E/w),{x:p+k,y:y+T}}function l(b){var m=t.map(t.range(f(b)+1),function(){return[]});return t.forEach(b.nodes(),function(p){var y=b.node(p),w=y.rank;t.isUndefined(w)||(m[w][y.order]=p)}),m}function u(b){var m=t.min(t.map(b.nodes(),function(p){return b.node(p).rank}));t.forEach(b.nodes(),function(p){var y=b.node(p);t.has(y,"rank")&&(y.rank-=m)})}function c(b){var m=t.min(t.map(b.nodes(),function(E){return b.node(E).rank})),p=[];t.forEach(b.nodes(),function(E){var S=b.node(E).rank-m;p[S]||(p[S]=[]),p[S].push(E)});var y=0,w=b.graph().nodeRankFactor;t.forEach(p,function(E,S){t.isUndefined(E)&&S%w!==0?--y:y&&t.forEach(E,function(C){b.node(C).rank+=y})})}function d(b,m,p,y){var w={width:0,height:0};return arguments.length>=4&&(w.rank=p,w.order=y),r(b,"border",w,m)}function f(b){return t.max(t.map(b.nodes(),function(m){var p=b.node(m).rank;if(!t.isUndefined(p))return p}))}function h(b,m){var p={lhs:[],rhs:[]};return t.forEach(b,function(y){m(y)?p.lhs.push(y):p.rhs.push(y)}),p}function v(b,m){var p=t.now();try{return m()}finally{console.log(b+" time: "+(t.now()-p)+"ms")}}function x(b,m){return m()}return ly}var uy,P_;function $V(){if(P_)return uy;P_=1;var t=dt(),e=Er();uy={run:r,undo:a};function r(i){i.graph().dummyChains=[],t.forEach(i.edges(),function(s){n(i,s)})}function n(i,s){var o=s.v,l=i.node(o).rank,u=s.w,c=i.node(u).rank,d=s.name,f=i.edge(s),h=f.labelRank;if(c!==l+1){i.removeEdge(s);var v,x,b;for(b=0,++l;l<c;++b,++l)f.points=[],x={width:0,height:0,edgeLabel:f,edgeObj:s,rank:l},v=e.addDummyNode(i,"edge",x,"_d"),l===h&&(x.width=f.width,x.height=f.height,x.dummy="edge-label",x.labelpos=f.labelpos),i.setEdge(o,v,{weight:f.weight},d),b===0&&i.graph().dummyChains.push(v),o=v;i.setEdge(o,u,{weight:f.weight},d)}}function a(i){t.forEach(i.graph().dummyChains,function(s){var o=i.node(s),l=o.edgeLabel,u;for(i.setEdge(o.edgeObj,l);o.dummy;)u=i.successors(s)[0],i.removeNode(s),l.points.push({x:o.x,y:o.y}),o.dummy==="edge-label"&&(l.x=o.x,l.y=o.y,l.width=o.width,l.height=o.height),s=u,o=i.node(s)})}return uy}var cy,A_;function lc(){if(A_)return cy;A_=1;var t=dt();cy={longestPath:e,slack:r};function e(n){var a={};function i(s){var o=n.node(s);if(t.has(a,s))return o.rank;a[s]=!0;var l=t.min(t.map(n.outEdges(s),function(u){return i(u.w)-n.edge(u).minlen}));return(l===Number.POSITIVE_INFINITY||l===void 0||l===null)&&(l=0),o.rank=l}t.forEach(n.sources(),i)}function r(n,a){return n.node(a.w).rank-n.node(a.v).rank-n.edge(a).minlen}return cy}var dy,j_;function CI(){if(j_)return dy;j_=1;var t=dt(),e=nn().Graph,r=lc().slack;dy=n;function n(o){var l=new e({directed:!1}),u=o.nodes()[0],c=o.nodeCount();l.setNode(u,{});for(var d,f;a(l,o)<c;)d=i(l,o),f=l.hasNode(d.v)?r(o,d):-r(o,d),s(l,o,f);return l}function a(o,l){function u(c){t.forEach(l.nodeEdges(c),function(d){var f=d.v,h=c===f?d.w:f;!o.hasNode(h)&&!r(l,d)&&(o.setNode(h,{}),o.setEdge(c,h,{}),u(h))})}return t.forEach(o.nodes(),u),o.nodeCount()}function i(o,l){return t.minBy(l.edges(),function(u){if(o.hasNode(u.v)!==o.hasNode(u.w))return r(l,u)})}function s(o,l,u){t.forEach(o.nodes(),function(c){l.node(c).rank+=u})}return dy}var fy,I_;function zV(){if(I_)return fy;I_=1;var t=dt(),e=CI(),r=lc().slack,n=lc().longestPath,a=nn().alg.preorder,i=nn().alg.postorder,s=Er().simplify;fy=o,o.initLowLimValues=d,o.initCutValues=l,o.calcCutValue=c,o.leaveEdge=h,o.enterEdge=v,o.exchangeEdges=x;function o(y){y=s(y),n(y);var w=e(y);d(w),l(w,y);for(var E,S;E=h(w);)S=v(w,y,E),x(w,y,E,S)}function l(y,w){var E=i(y,y.nodes());E=E.slice(0,E.length-1),t.forEach(E,function(S){u(y,w,S)})}function u(y,w,E){var S=y.node(E),C=S.parent;y.edge(E,C).cutvalue=c(y,w,E)}function c(y,w,E){var S=y.node(E),C=S.parent,k=!0,T=w.edge(E,C),_=0;return T||(k=!1,T=w.edge(C,E)),_=T.weight,t.forEach(w.nodeEdges(E),function(N){var P=N.v===E,R=P?N.w:N.v;if(R!==C){var I=P===k,M=w.edge(N).weight;if(_+=I?M:-M,m(y,E,R)){var D=y.edge(E,R).cutvalue;_+=I?-D:D}}}),_}function d(y,w){arguments.length<2&&(w=y.nodes()[0]),f(y,{},1,w)}function f(y,w,E,S,C){var k=E,T=y.node(S);return w[S]=!0,t.forEach(y.neighbors(S),function(_){t.has(w,_)||(E=f(y,w,E,_,S))}),T.low=k,T.lim=E++,C?T.parent=C:delete T.parent,E}function h(y){return t.find(y.edges(),function(w){return y.edge(w).cutvalue<0})}function v(y,w,E){var S=E.v,C=E.w;w.hasEdge(S,C)||(S=E.w,C=E.v);var k=y.node(S),T=y.node(C),_=k,N=!1;k.lim>T.lim&&(_=T,N=!0);var P=t.filter(w.edges(),function(R){return N===p(y,y.node(R.v),_)&&N!==p(y,y.node(R.w),_)});return t.minBy(P,function(R){return r(w,R)})}function x(y,w,E,S){var C=E.v,k=E.w;y.removeEdge(C,k),y.setEdge(S.v,S.w,{}),d(y),l(y,w),b(y,w)}function b(y,w){var E=t.find(y.nodes(),function(C){return!w.node(C).parent}),S=a(y,E);S=S.slice(1),t.forEach(S,function(C){var k=y.node(C).parent,T=w.edge(C,k),_=!1;T||(T=w.edge(k,C),_=!0),w.node(C).rank=w.node(k).rank+(_?T.minlen:-T.minlen)})}function m(y,w,E){return y.hasEdge(w,E)}function p(y,w,E){return E.low<=w.lim&&w.lim<=E.lim}return fy}var vy,M_;function VV(){if(M_)return vy;M_=1;var t=lc(),e=t.longestPath,r=CI(),n=zV();vy=a;function a(l){switch(l.graph().ranker){case"network-simplex":o(l);break;case"tight-tree":s(l);break;case"longest-path":i(l);break;default:o(l)}}var i=e;function s(l){e(l),r(l)}function o(l){n(l)}return vy}var hy,D_;function UV(){if(D_)return hy;D_=1;var t=dt();hy=e;function e(a){var i=n(a);t.forEach(a.graph().dummyChains,function(s){for(var o=a.node(s),l=o.edgeObj,u=r(a,i,l.v,l.w),c=u.path,d=u.lca,f=0,h=c[f],v=!0;s!==l.w;){if(o=a.node(s),v){for(;(h=c[f])!==d&&a.node(h).maxRank<o.rank;)f++;h===d&&(v=!1)}if(!v){for(;f<c.length-1&&a.node(h=c[f+1]).minRank<=o.rank;)f++;h=c[f]}a.setParent(s,h),s=a.successors(s)[0]}})}function r(a,i,s,o){var l=[],u=[],c=Math.min(i[s].low,i[o].low),d=Math.max(i[s].lim,i[o].lim),f,h;f=s;do f=a.parent(f),l.push(f);while(f&&(i[f].low>c||d>i[f].lim));for(h=f,f=o;(f=a.parent(f))!==h;)u.push(f);return{path:l.concat(u.reverse()),lca:h}}function n(a){var i={},s=0;function o(l){var u=s;t.forEach(a.children(l),o),i[l]={low:u,lim:s++}}return t.forEach(a.children(),o),i}return hy}var py,L_;function GV(){if(L_)return py;L_=1;var t=dt(),e=Er();py={run:r,cleanup:s};function r(o){var l=e.addDummyNode(o,"root",{},"_root"),u=a(o),c=t.max(t.values(u))-1,d=2*c+1;o.graph().nestingRoot=l,t.forEach(o.edges(),function(h){o.edge(h).minlen*=d});var f=i(o)+1;t.forEach(o.children(),function(h){n(o,l,d,f,c,u,h)}),o.graph().nodeRankFactor=d}function n(o,l,u,c,d,f,h){var v=o.children(h);if(!v.length){h!==l&&o.setEdge(l,h,{weight:0,minlen:u});return}var x=e.addBorderNode(o,"_bt"),b=e.addBorderNode(o,"_bb"),m=o.node(h);o.setParent(x,h),m.borderTop=x,o.setParent(b,h),m.borderBottom=b,t.forEach(v,function(p){n(o,l,u,c,d,f,p);var y=o.node(p),w=y.borderTop?y.borderTop:p,E=y.borderBottom?y.borderBottom:p,S=y.borderTop?c:2*c,C=w!==E?1:d-f[h]+1;o.setEdge(x,w,{weight:S,minlen:C,nestingEdge:!0}),o.setEdge(E,b,{weight:S,minlen:C,nestingEdge:!0})}),o.parent(h)||o.setEdge(l,x,{weight:0,minlen:d+f[h]})}function a(o){var l={};function u(c,d){var f=o.children(c);f&&f.length&&t.forEach(f,function(h){u(h,d+1)}),l[c]=d}return t.forEach(o.children(),function(c){u(c,1)}),l}function i(o){return t.reduce(o.edges(),function(l,u){return l+o.edge(u).weight},0)}function s(o){var l=o.graph();o.removeNode(l.nestingRoot),delete l.nestingRoot,t.forEach(o.edges(),function(u){var c=o.edge(u);c.nestingEdge&&o.removeEdge(u)})}return py}var gy,B_;function HV(){if(B_)return gy;B_=1;var t=dt(),e=Er();gy=r;function r(a){function i(s){var o=a.children(s),l=a.node(s);if(o.length&&t.forEach(o,i),t.has(l,"minRank")){l.borderLeft=[],l.borderRight=[];for(var u=l.minRank,c=l.maxRank+1;u<c;++u)n(a,"borderLeft","_bl",s,l,u),n(a,"borderRight","_br",s,l,u)}}t.forEach(a.children(),i)}function n(a,i,s,o,l,u){var c={width:0,height:0,rank:u,borderType:i},d=l[i][u-1],f=e.addDummyNode(a,"border",c,s);l[i][u]=f,a.setParent(f,o),d&&a.setEdge(d,f,{weight:1})}return gy}var my,O_;function WV(){if(O_)return my;O_=1;var t=dt();my={adjust:e,undo:r};function e(u){var c=u.graph().rankdir.toLowerCase();(c==="lr"||c==="rl")&&n(u)}function r(u){var c=u.graph().rankdir.toLowerCase();(c==="bt"||c==="rl")&&i(u),(c==="lr"||c==="rl")&&(o(u),n(u))}function n(u){t.forEach(u.nodes(),function(c){a(u.node(c))}),t.forEach(u.edges(),function(c){a(u.edge(c))})}function a(u){var c=u.width;u.width=u.height,u.height=c}function i(u){t.forEach(u.nodes(),function(c){s(u.node(c))}),t.forEach(u.edges(),function(c){var d=u.edge(c);t.forEach(d.points,s),t.has(d,"y")&&s(d)})}function s(u){u.y=-u.y}function o(u){t.forEach(u.nodes(),function(c){l(u.node(c))}),t.forEach(u.edges(),function(c){var d=u.edge(c);t.forEach(d.points,l),t.has(d,"x")&&l(d)})}function l(u){var c=u.x;u.x=u.y,u.y=c}return my}var yy,q_;function KV(){if(q_)return yy;q_=1;var t=dt();yy=e;function e(r){var n={},a=t.filter(r.nodes(),function(u){return!r.children(u).length}),i=t.max(t.map(a,function(u){return r.node(u).rank})),s=t.map(t.range(i+1),function(){return[]});function o(u){if(!t.has(n,u)){n[u]=!0;var c=r.node(u);s[c.rank].push(u),t.forEach(r.successors(u),o)}}var l=t.sortBy(a,function(u){return r.node(u).rank});return t.forEach(l,o),s}return yy}var xy,F_;function YV(){if(F_)return xy;F_=1;var t=dt();xy=e;function e(n,a){for(var i=0,s=1;s<a.length;++s)i+=r(n,a[s-1],a[s]);return i}function r(n,a,i){for(var s=t.zipObject(i,t.map(i,function(f,h){return h})),o=t.flatten(t.map(a,function(f){return t.sortBy(t.map(n.outEdges(f),function(h){return{pos:s[h.w],weight:n.edge(h).weight}}),"pos")}),!0),l=1;l<i.length;)l<<=1;var u=2*l-1;l-=1;var c=t.map(new Array(u),function(){return 0}),d=0;return t.forEach(o.forEach(function(f){var h=f.pos+l;c[h]+=f.weight;for(var v=0;h>0;)h%2&&(v+=c[h+1]),h=h-1>>1,c[h]+=f.weight;d+=f.weight*v})),d}return xy}var by,$_;function XV(){if($_)return by;$_=1;var t=dt();by=e;function e(r,n){return t.map(n,function(a){var i=r.inEdges(a);if(i.length){var s=t.reduce(i,function(o,l){var u=r.edge(l),c=r.node(l.v);return{sum:o.sum+u.weight*c.order,weight:o.weight+u.weight}},{sum:0,weight:0});return{v:a,barycenter:s.sum/s.weight,weight:s.weight}}else return{v:a}})}return by}var wy,z_;function ZV(){if(z_)return wy;z_=1;var t=dt();wy=e;function e(a,i){var s={};t.forEach(a,function(l,u){var c=s[l.v]={indegree:0,in:[],out:[],vs:[l.v],i:u};t.isUndefined(l.barycenter)||(c.barycenter=l.barycenter,c.weight=l.weight)}),t.forEach(i.edges(),function(l){var u=s[l.v],c=s[l.w];!t.isUndefined(u)&&!t.isUndefined(c)&&(c.indegree++,u.out.push(s[l.w]))});var o=t.filter(s,function(l){return!l.indegree});return r(o)}function r(a){var i=[];function s(u){return function(c){c.merged||(t.isUndefined(c.barycenter)||t.isUndefined(u.barycenter)||c.barycenter>=u.barycenter)&&n(u,c)}}function o(u){return function(c){c.in.push(u),--c.indegree===0&&a.push(c)}}for(;a.length;){var l=a.pop();i.push(l),t.forEach(l.in.reverse(),s(l)),t.forEach(l.out,o(l))}return t.map(t.filter(i,function(u){return!u.merged}),function(u){return t.pick(u,["vs","i","barycenter","weight"])})}function n(a,i){var s=0,o=0;a.weight&&(s+=a.barycenter*a.weight,o+=a.weight),i.weight&&(s+=i.barycenter*i.weight,o+=i.weight),a.vs=i.vs.concat(a.vs),a.barycenter=s/o,a.weight=o,a.i=Math.min(i.i,a.i),i.merged=!0}return wy}var Sy,V_;function QV(){if(V_)return Sy;V_=1;var t=dt(),e=Er();Sy=r;function r(i,s){var o=e.partition(i,function(x){return t.has(x,"barycenter")}),l=o.lhs,u=t.sortBy(o.rhs,function(x){return-x.i}),c=[],d=0,f=0,h=0;l.sort(a(!!s)),h=n(c,u,h),t.forEach(l,function(x){h+=x.vs.length,c.push(x.vs),d+=x.barycenter*x.weight,f+=x.weight,h=n(c,u,h)});var v={vs:t.flatten(c,!0)};return f&&(v.barycenter=d/f,v.weight=f),v}function n(i,s,o){for(var l;s.length&&(l=t.last(s)).i<=o;)s.pop(),i.push(l.vs),o++;return o}function a(i){return function(s,o){return s.barycenter<o.barycenter?-1:s.barycenter>o.barycenter?1:i?o.i-s.i:s.i-o.i}}return Sy}var Ey,U_;function JV(){if(U_)return Ey;U_=1;var t=dt(),e=XV(),r=ZV(),n=QV();Ey=a;function a(o,l,u,c){var d=o.children(l),f=o.node(l),h=f?f.borderLeft:void 0,v=f?f.borderRight:void 0,x={};h&&(d=t.filter(d,function(E){return E!==h&&E!==v}));var b=e(o,d);t.forEach(b,function(E){if(o.children(E.v).length){var S=a(o,E.v,u,c);x[E.v]=S,t.has(S,"barycenter")&&s(E,S)}});var m=r(b,u);i(m,x);var p=n(m,c);if(h&&(p.vs=t.flatten([h,p.vs,v],!0),o.predecessors(h).length)){var y=o.node(o.predecessors(h)[0]),w=o.node(o.predecessors(v)[0]);t.has(p,"barycenter")||(p.barycenter=0,p.weight=0),p.barycenter=(p.barycenter*p.weight+y.order+w.order)/(p.weight+2),p.weight+=2}return p}function i(o,l){t.forEach(o,function(u){u.vs=t.flatten(u.vs.map(function(c){return l[c]?l[c].vs:c}),!0)})}function s(o,l){t.isUndefined(o.barycenter)?(o.barycenter=l.barycenter,o.weight=l.weight):(o.barycenter=(o.barycenter*o.weight+l.barycenter*l.weight)/(o.weight+l.weight),o.weight+=l.weight)}return Ey}var Cy,G_;function eU(){if(G_)return Cy;G_=1;var t=dt(),e=nn().Graph;Cy=r;function r(a,i,s){var o=n(a),l=new e({compound:!0}).setGraph({root:o}).setDefaultNodeLabel(function(u){return a.node(u)});return t.forEach(a.nodes(),function(u){var c=a.node(u),d=a.parent(u);(c.rank===i||c.minRank<=i&&i<=c.maxRank)&&(l.setNode(u),l.setParent(u,d||o),t.forEach(a[s](u),function(f){var h=f.v===u?f.w:f.v,v=l.edge(h,u),x=t.isUndefined(v)?0:v.weight;l.setEdge(h,u,{weight:a.edge(f).weight+x})}),t.has(c,"minRank")&&l.setNode(u,{borderLeft:c.borderLeft[i],borderRight:c.borderRight[i]}))}),l}function n(a){for(var i;a.hasNode(i=t.uniqueId("_root")););return i}return Cy}var ky,H_;function tU(){if(H_)return ky;H_=1;var t=dt();ky=e;function e(r,n,a){var i={},s;t.forEach(a,function(o){for(var l=r.parent(o),u,c;l;){if(u=r.parent(l),u?(c=i[u],i[u]=l):(c=s,s=l),c&&c!==l){n.setEdge(c,l);return}l=u}})}return ky}var Ty,W_;function rU(){if(W_)return Ty;W_=1;var t=dt(),e=KV(),r=YV(),n=JV(),a=eU(),i=tU(),s=nn().Graph,o=Er();Ty=l;function l(f){var h=o.maxRank(f),v=u(f,t.range(1,h+1),"inEdges"),x=u(f,t.range(h-1,-1,-1),"outEdges"),b=e(f);d(f,b);for(var m=Number.POSITIVE_INFINITY,p,y=0,w=0;w<4;++y,++w){c(y%2?v:x,y%4>=2),b=o.buildLayerMatrix(f);var E=r(f,b);E<m&&(w=0,p=t.cloneDeep(b),m=E)}d(f,p)}function u(f,h,v){return t.map(h,function(x){return a(f,x,v)})}function c(f,h){var v=new s;t.forEach(f,function(x){var b=x.graph().root,m=n(x,b,v,h);t.forEach(m.vs,function(p,y){x.node(p).order=y}),i(x,v,m.vs)})}function d(f,h){t.forEach(h,function(v){t.forEach(v,function(x,b){f.node(x).order=b})})}return Ty}var _y,K_;function nU(){if(K_)return _y;K_=1;var t=dt(),e=nn().Graph,r=Er();_y={positionX:v,findType1Conflicts:n,findType2Conflicts:a,addConflict:s,hasConflict:o,verticalAlignment:l,horizontalCompaction:u,alignCoordinates:f,findSmallestWidthAlignment:d,balance:h};function n(m,p){var y={};function w(E,S){var C=0,k=0,T=E.length,_=t.last(S);return t.forEach(S,function(N,P){var R=i(m,N),I=R?m.node(R).order:T;(R||N===_)&&(t.forEach(S.slice(k,P+1),function(M){t.forEach(m.predecessors(M),function(D){var L=m.node(D),j=L.order;(j<C||I<j)&&!(L.dummy&&m.node(M).dummy)&&s(y,D,M)})}),k=P+1,C=I)}),S}return t.reduce(p,w),y}function a(m,p){var y={};function w(S,C,k,T,_){var N;t.forEach(t.range(C,k),function(P){N=S[P],m.node(N).dummy&&t.forEach(m.predecessors(N),function(R){var I=m.node(R);I.dummy&&(I.order<T||I.order>_)&&s(y,R,N)})})}function E(S,C){var k=-1,T,_=0;return t.forEach(C,function(N,P){if(m.node(N).dummy==="border"){var R=m.predecessors(N);R.length&&(T=m.node(R[0]).order,w(C,_,P,k,T),_=P,k=T)}w(C,_,C.length,T,S.length)}),C}return t.reduce(p,E),y}function i(m,p){if(m.node(p).dummy)return t.find(m.predecessors(p),function(y){return m.node(y).dummy})}function s(m,p,y){if(p>y){var w=p;p=y,y=w}var E=m[p];E||(m[p]=E={}),E[y]=!0}function o(m,p,y){if(p>y){var w=p;p=y,y=w}return t.has(m[p],y)}function l(m,p,y,w){var E={},S={},C={};return t.forEach(p,function(k){t.forEach(k,function(T,_){E[T]=T,S[T]=T,C[T]=_})}),t.forEach(p,function(k){var T=-1;t.forEach(k,function(_){var N=w(_);if(N.length){N=t.sortBy(N,function(D){return C[D]});for(var P=(N.length-1)/2,R=Math.floor(P),I=Math.ceil(P);R<=I;++R){var M=N[R];S[_]===_&&T<C[M]&&!o(y,_,M)&&(S[M]=_,S[_]=E[_]=E[M],T=C[M])}}})}),{root:E,align:S}}function u(m,p,y,w,E){var S={},C=c(m,p,y,E),k=E?"borderLeft":"borderRight";function T(P,R){for(var I=C.nodes(),M=I.pop(),D={};M;)D[M]?P(M):(D[M]=!0,I.push(M),I=I.concat(R(M))),M=I.pop()}function _(P){S[P]=C.inEdges(P).reduce(function(R,I){return Math.max(R,S[I.v]+C.edge(I))},0)}function N(P){var R=C.outEdges(P).reduce(function(M,D){return Math.min(M,S[D.w]-C.edge(D))},Number.POSITIVE_INFINITY),I=m.node(P);R!==Number.POSITIVE_INFINITY&&I.borderType!==k&&(S[P]=Math.max(S[P],R))}return T(_,C.predecessors.bind(C)),T(N,C.successors.bind(C)),t.forEach(w,function(P){S[P]=S[y[P]]}),S}function c(m,p,y,w){var E=new e,S=m.graph(),C=x(S.nodesep,S.edgesep,w);return t.forEach(p,function(k){var T;t.forEach(k,function(_){var N=y[_];if(E.setNode(N),T){var P=y[T],R=E.edge(P,N);E.setEdge(P,N,Math.max(C(m,_,T),R||0))}T=_})}),E}function d(m,p){return t.minBy(t.values(p),function(y){var w=Number.NEGATIVE_INFINITY,E=Number.POSITIVE_INFINITY;return t.forIn(y,function(S,C){var k=b(m,C)/2;w=Math.max(S+k,w),E=Math.min(S-k,E)}),w-E})}function f(m,p){var y=t.values(p),w=t.min(y),E=t.max(y);t.forEach(["u","d"],function(S){t.forEach(["l","r"],function(C){var k=S+C,T=m[k],_;if(T!==p){var N=t.values(T);_=C==="l"?w-t.min(N):E-t.max(N),_&&(m[k]=t.mapValues(T,function(P){return P+_}))}})})}function h(m,p){return t.mapValues(m.ul,function(y,w){if(p)return m[p.toLowerCase()][w];var E=t.sortBy(t.map(m,w));return(E[1]+E[2])/2})}function v(m){var p=r.buildLayerMatrix(m),y=t.merge(n(m,p),a(m,p)),w={},E;t.forEach(["u","d"],function(C){E=C==="u"?p:t.values(p).reverse(),t.forEach(["l","r"],function(k){k==="r"&&(E=t.map(E,function(P){return t.values(P).reverse()}));var T=(C==="u"?m.predecessors:m.successors).bind(m),_=l(m,E,y,T),N=u(m,E,_.root,_.align,k==="r");k==="r"&&(N=t.mapValues(N,function(P){return-P})),w[C+k]=N})});var S=d(m,w);return f(w,S),h(w,m.graph().align)}function x(m,p,y){return function(w,E,S){var C=w.node(E),k=w.node(S),T=0,_;if(T+=C.width/2,t.has(C,"labelpos"))switch(C.labelpos.toLowerCase()){case"l":_=-C.width/2;break;case"r":_=C.width/2;break}if(_&&(T+=y?_:-_),_=0,T+=(C.dummy?p:m)/2,T+=(k.dummy?p:m)/2,T+=k.width/2,t.has(k,"labelpos"))switch(k.labelpos.toLowerCase()){case"l":_=k.width/2;break;case"r":_=-k.width/2;break}return _&&(T+=y?_:-_),_=0,T}}function b(m,p){return m.node(p).width}return _y}var Ny,Y_;function aU(){if(Y_)return Ny;Y_=1;var t=dt(),e=Er(),r=nU().positionX;Ny=n;function n(i){i=e.asNonCompoundGraph(i),a(i),t.forEach(r(i),function(s,o){i.node(o).x=s})}function a(i){var s=e.buildLayerMatrix(i),o=i.graph().ranksep,l=0;t.forEach(s,function(u){var c=t.max(t.map(u,function(d){return i.node(d).height}));t.forEach(u,function(d){i.node(d).y=l+c/2}),l+=c+o})}return Ny}var Ry,X_;function iU(){if(X_)return Ry;X_=1;var t=dt(),e=FV(),r=$V(),n=VV(),a=Er().normalizeRanks,i=UV(),s=Er().removeEmptyRanks,o=GV(),l=HV(),u=WV(),c=rU(),d=aU(),f=Er(),h=nn().Graph;Ry=v;function v(q,$){var z=$&&$.debugTiming?f.time:f.notime;z("layout",function(){var W=z(" buildLayoutGraph",function(){return T(q)});z(" runLayout",function(){x(W,z)}),z(" updateInputGraph",function(){b(q,W)})})}function x(q,$){$(" makeSpaceForEdgeLabels",function(){_(q)}),$(" removeSelfEdges",function(){F(q)}),$(" acyclic",function(){e.run(q)}),$(" nestingGraph.run",function(){o.run(q)}),$(" rank",function(){n(f.asNonCompoundGraph(q))}),$(" injectEdgeLabelProxies",function(){N(q)}),$(" removeEmptyRanks",function(){s(q)}),$(" nestingGraph.cleanup",function(){o.cleanup(q)}),$(" normalizeRanks",function(){a(q)}),$(" assignRankMinMax",function(){P(q)}),$(" removeEdgeLabelProxies",function(){R(q)}),$(" normalize.run",function(){r.run(q)}),$(" parentDummyChains",function(){i(q)}),$(" addBorderSegments",function(){l(q)}),$(" order",function(){c(q)}),$(" insertSelfEdges",function(){O(q)}),$(" adjustCoordinateSystem",function(){u.adjust(q)}),$(" position",function(){d(q)}),$(" positionSelfEdges",function(){B(q)}),$(" removeBorderNodes",function(){j(q)}),$(" normalize.undo",function(){r.undo(q)}),$(" fixupEdgeLabelCoords",function(){D(q)}),$(" undoCoordinateSystem",function(){u.undo(q)}),$(" translateGraph",function(){I(q)}),$(" assignNodeIntersects",function(){M(q)}),$(" reversePoints",function(){L(q)}),$(" acyclic.undo",function(){e.undo(q)})}function b(q,$){t.forEach(q.nodes(),function(z){var W=q.node(z),ne=$.node(z);W&&(W.x=ne.x,W.y=ne.y,$.children(z).length&&(W.width=ne.width,W.height=ne.height))}),t.forEach(q.edges(),function(z){var W=q.edge(z),ne=$.edge(z);W.points=ne.points,t.has(ne,"x")&&(W.x=ne.x,W.y=ne.y)}),q.graph().width=$.graph().width,q.graph().height=$.graph().height}var m=["nodesep","edgesep","ranksep","marginx","marginy"],p={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},y=["acyclicer","ranker","rankdir","align"],w=["width","height"],E={width:0,height:0},S=["minlen","weight","width","height","labeloffset"],C={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},k=["labelpos"];function T(q){var $=new h({multigraph:!0,compound:!0}),z=J(q.graph());return $.setGraph(t.merge({},p,V(z,m),t.pick(z,y))),t.forEach(q.nodes(),function(W){var ne=J(q.node(W));$.setNode(W,t.defaults(V(ne,w),E)),$.setParent(W,q.parent(W))}),t.forEach(q.edges(),function(W){var ne=J(q.edge(W));$.setEdge(W,t.merge({},C,V(ne,S),t.pick(ne,k)))}),$}function _(q){var $=q.graph();$.ranksep/=2,t.forEach(q.edges(),function(z){var W=q.edge(z);W.minlen*=2,W.labelpos.toLowerCase()!=="c"&&($.rankdir==="TB"||$.rankdir==="BT"?W.width+=W.labeloffset:W.height+=W.labeloffset)})}function N(q){t.forEach(q.edges(),function($){var z=q.edge($);if(z.width&&z.height){var W=q.node($.v),ne=q.node($.w),X={rank:(ne.rank-W.rank)/2+W.rank,e:$};f.addDummyNode(q,"edge-proxy",X,"_ep")}})}function P(q){var $=0;t.forEach(q.nodes(),function(z){var W=q.node(z);W.borderTop&&(W.minRank=q.node(W.borderTop).rank,W.maxRank=q.node(W.borderBottom).rank,$=t.max($,W.maxRank))}),q.graph().maxRank=$}function R(q){t.forEach(q.nodes(),function($){var z=q.node($);z.dummy==="edge-proxy"&&(q.edge(z.e).labelRank=z.rank,q.removeNode($))})}function I(q){var $=Number.POSITIVE_INFINITY,z=0,W=Number.POSITIVE_INFINITY,ne=0,X=q.graph(),U=X.marginx||0,H=X.marginy||0;function Y(ee){var ie=ee.x,oe=ee.y,Re=ee.width,ue=ee.height;$=Math.min($,ie-Re/2),z=Math.max(z,ie+Re/2),W=Math.min(W,oe-ue/2),ne=Math.max(ne,oe+ue/2)}t.forEach(q.nodes(),function(ee){Y(q.node(ee))}),t.forEach(q.edges(),function(ee){var ie=q.edge(ee);t.has(ie,"x")&&Y(ie)}),$-=U,W-=H,t.forEach(q.nodes(),function(ee){var ie=q.node(ee);ie.x-=$,ie.y-=W}),t.forEach(q.edges(),function(ee){var ie=q.edge(ee);t.forEach(ie.points,function(oe){oe.x-=$,oe.y-=W}),t.has(ie,"x")&&(ie.x-=$),t.has(ie,"y")&&(ie.y-=W)}),X.width=z-$+U,X.height=ne-W+H}function M(q){t.forEach(q.edges(),function($){var z=q.edge($),W=q.node($.v),ne=q.node($.w),X,U;z.points?(X=z.points[0],U=z.points[z.points.length-1]):(z.points=[],X=ne,U=W),z.points.unshift(f.intersectRect(W,X)),z.points.push(f.intersectRect(ne,U))})}function D(q){t.forEach(q.edges(),function($){var z=q.edge($);if(t.has(z,"x"))switch((z.labelpos==="l"||z.labelpos==="r")&&(z.width-=z.labeloffset),z.labelpos){case"l":z.x-=z.width/2+z.labeloffset;break;case"r":z.x+=z.width/2+z.labeloffset;break}})}function L(q){t.forEach(q.edges(),function($){var z=q.edge($);z.reversed&&z.points.reverse()})}function j(q){t.forEach(q.nodes(),function($){if(q.children($).length){var z=q.node($),W=q.node(z.borderTop),ne=q.node(z.borderBottom),X=q.node(t.last(z.borderLeft)),U=q.node(t.last(z.borderRight));z.width=Math.abs(U.x-X.x),z.height=Math.abs(ne.y-W.y),z.x=X.x+z.width/2,z.y=W.y+z.height/2}}),t.forEach(q.nodes(),function($){q.node($).dummy==="border"&&q.removeNode($)})}function F(q){t.forEach(q.edges(),function($){if($.v===$.w){var z=q.node($.v);z.selfEdges||(z.selfEdges=[]),z.selfEdges.push({e:$,label:q.edge($)}),q.removeEdge($)}})}function O(q){var $=f.buildLayerMatrix(q);t.forEach($,function(z){var W=0;t.forEach(z,function(ne,X){var U=q.node(ne);U.order=X+W,t.forEach(U.selfEdges,function(H){f.addDummyNode(q,"selfedge",{width:H.label.width,height:H.label.height,rank:U.rank,order:X+ ++W,e:H.e,label:H.label},"_se")}),delete U.selfEdges})})}function B(q){t.forEach(q.nodes(),function($){var z=q.node($);if(z.dummy==="selfedge"){var W=q.node(z.e.v),ne=W.x+W.width/2,X=W.y,U=z.x-ne,H=W.height/2;q.setEdge(z.e,z.label),q.removeNode($),z.label.points=[{x:ne+2*U/3,y:X-H},{x:ne+5*U/6,y:X-H},{x:ne+U,y:X},{x:ne+5*U/6,y:X+H},{x:ne+2*U/3,y:X+H}],z.label.x=z.x,z.label.y=z.y}})}function V(q,$){return t.mapValues(t.pick(q,$),Number)}function J(q){var $={};return t.forEach(q,function(z,W){$[W.toLowerCase()]=z}),$}return Ry}var Py,Z_;function sU(){if(Z_)return Py;Z_=1;var t=dt(),e=Er(),r=nn().Graph;Py={debugOrdering:n};function n(a){var i=e.buildLayerMatrix(a),s=new r({compound:!0,multigraph:!0}).setGraph({});return t.forEach(a.nodes(),function(o){s.setNode(o,{label:o}),s.setParent(o,"layer"+a.node(o).rank)}),t.forEach(a.edges(),function(o){s.setEdge(o.v,o.w,{},o.name)}),t.forEach(i,function(o,l){var u="layer"+l;s.setNode(u,{rank:"same"}),t.reduce(o,function(c,d){return s.setEdge(c,d,{style:"invis"}),d})}),s}return Py}var Ay,Q_;function oU(){return Q_||(Q_=1,Ay="0.8.5"),Ay}var jy,J_;function lU(){return J_||(J_=1,jy={graphlib:nn(),layout:iU(),debug:sU(),util:{time:Er().time,notime:Er().notime},version:oU()}),jy}(function(t,e){(function(n,a){t.exports=a(lU())})(Hs,function(r){return function(n){var a={};function i(s){if(a[s])return a[s].exports;var o=a[s]={i:s,l:!1,exports:{}};return n[s].call(o.exports,o,o.exports,i),o.l=!0,o.exports}return i.m=n,i.c=a,i.d=function(s,o,l){i.o(s,o)||Object.defineProperty(s,o,{enumerable:!0,get:l})},i.r=function(s){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(s,"__esModule",{value:!0})},i.t=function(s,o){if(o&1&&(s=i(s)),o&8||o&4&&typeof s=="object"&&s&&s.__esModule)return s;var l=Object.create(null);if(i.r(l),Object.defineProperty(l,"default",{enumerable:!0,value:s}),o&2&&typeof s!="string")for(var u in s)i.d(l,u,(function(c){return s[c]}).bind(null,u));return l},i.n=function(s){var o=s&&s.__esModule?function(){return s.default}:function(){return s};return i.d(o,"a",o),o},i.o=function(s,o){return Object.prototype.hasOwnProperty.call(s,o)},i.p="",i(i.s=0)}([function(n,a,i){var s=i(1),o=function(u){u&&u("layout","dagre",s)};typeof cytoscape<"u"&&o(cytoscape),n.exports=o},function(n,a,i){function s(f){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?s=function(v){return typeof v}:s=function(v){return v&&typeof Symbol=="function"&&v.constructor===Symbol&&v!==Symbol.prototype?"symbol":typeof v},s(f)}var o=function(h){return typeof h=="function"},l=i(2),u=i(3),c=i(4);function d(f){this.options=u({},l,f)}d.prototype.run=function(){var f=this.options,h=this,v=f.cy,x=f.eles,b=function(B,V){return o(V)?V.apply(B,[B]):V},m=f.boundingBox||{x1:0,y1:0,w:v.width(),h:v.height()};m.x2===void 0&&(m.x2=m.x1+m.w),m.w===void 0&&(m.w=m.x2-m.x1),m.y2===void 0&&(m.y2=m.y1+m.h),m.h===void 0&&(m.h=m.y2-m.y1);var p=new c.graphlib.Graph({multigraph:!0,compound:!0}),y={},w=function(B,V){V!=null&&(y[B]=V)};w("nodesep",f.nodeSep),w("edgesep",f.edgeSep),w("ranksep",f.rankSep),w("rankdir",f.rankDir),w("align",f.align),w("ranker",f.ranker),w("acyclicer",f.acyclicer),p.setGraph(y),p.setDefaultEdgeLabel(function(){return{}}),p.setDefaultNodeLabel(function(){return{}});var E=x.nodes();o(f.sort)&&(E=E.sort(f.sort));for(var S=0;S<E.length;S++){var C=E[S],k=C.layoutDimensions(f);p.setNode(C.id(),{width:k.w,height:k.h,name:C.id()})}for(var T=0;T<E.length;T++){var _=E[T];_.isChild()&&p.setParent(_.id(),_.parent().id())}var N=x.edges().stdFilter(function(O){return!O.source().isParent()&&!O.target().isParent()});o(f.sort)&&(N=N.sort(f.sort));for(var P=0;P<N.length;P++){var R=N[P];p.setEdge(R.source().id(),R.target().id(),{minlen:b(R,f.minLen),weight:b(R,f.edgeWeight),name:R.id()},R.id())}c.layout(p);for(var I=p.nodes(),M=0;M<I.length;M++){var D=I[M],L=p.node(D);v.getElementById(D).scratch().dagre=L}var j;f.boundingBox?(j={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0},E.forEach(function(O){var B=O.scratch().dagre;j.x1=Math.min(j.x1,B.x),j.x2=Math.max(j.x2,B.x),j.y1=Math.min(j.y1,B.y),j.y2=Math.max(j.y2,B.y)}),j.w=j.x2-j.x1,j.h=j.y2-j.y1):j=m;var F=function(B){if(f.boundingBox){var V=j.w===0?0:(B.x-j.x1)/j.w,J=j.h===0?0:(B.y-j.y1)/j.h;return{x:m.x1+V*m.w,y:m.y1+J*m.h}}else return B};return E.layoutPositions(h,f,function(O){O=s(O)==="object"?O:this;var B=O.scratch().dagre;return F({x:B.x,y:B.y})}),this},n.exports=d},function(n,a){var i={nodeSep:void 0,edgeSep:void 0,rankSep:void 0,rankDir:void 0,align:void 0,acyclicer:void 0,ranker:void 0,minLen:function(o){return 1},edgeWeight:function(o){return 1},fit:!0,padding:30,spacingFactor:void 0,nodeDimensionsIncludeLabels:!1,animate:!1,animateFilter:function(o,l){return!0},animationDuration:500,animationEasing:void 0,boundingBox:void 0,transform:function(o,l){return l},ready:function(){},sort:void 0,stop:function(){}};n.exports=i},function(n,a){n.exports=Object.assign!=null?Object.assign.bind(Object):function(i){for(var s=arguments.length,o=new Array(s>1?s-1:0),l=1;l<s;l++)o[l-1]=arguments[l];return o.forEach(function(u){Object.keys(u).forEach(function(c){return i[c]=u[c]})}),i}},function(n,a){n.exports=r}])})})(kj);var uU=kj.exports;const cU=sN(uU);function dU(t){const e=new Set;if(!t||t.length===0)return e;e.add(`__start__→${t[0]}`);for(let r=1;r<t.length;r++)e.add(`${t[r-1]}→${t[r]}`);return e}function kI(t){var e,r,n;return!!(t.STAMP_REJECT||(e=t.GATE)!=null&&e.decision&&t.GATE.decision!=="approve"||((r=t.SUBMIT_CODE)==null?void 0:r.ok)===!1&&((n=t.SUBMIT_CODE)==null?void 0:n.error_type)==="blocked")}function fU(t){const e={total:0,succeeded:0,failed:0,awaiting:0,running:0,skipped:0};if(!t||typeof t!="object")return e;for(const r of Object.values(t)){if(!r)continue;if(e.total++,r.failedAt){e.failed++;continue}if(r.awaiting){e.awaiting++;continue}if(r.step!=="__end__"){e.running++;continue}const n=r.data??{};let a=!1;for(const i of Object.values(n))if(!(!i||typeof i!="object")){if(i._error){a=!0;break}if(i.ok===!1){a=!0;break}}if(a){e.failed++;continue}if(kI(n)){e.skipped++;continue}e.succeeded++}return e}function vU(t){return!t||t.total===0?"group-untouched":t.failed>0?"group-failed":t.awaiting>0?"group-engaged":t.running>0?"group-running":"group-primary-ok"}function hU(t,e){var n,a;if(!t)return"";const r=[];for(const i of e){const s=(n=t.data)==null?void 0:n[i];s?s._error?r.push(`${i}!`):i==="GATE"&&s.decision&&s.decision!=="approve"?r.push(`${i}✗`):i==="SUBMIT"&&s.ok===!1?r.push(`${i}!`):i==="SUBMIT_CODE"&&s.ok===!1&&s.error_type==="blocked"?r.push(`${i}⊘`):r.push(i):((a=t.awaiting)==null?void 0:a.subNodeId)===i&&r.push(`${i}⏳`)}return r.join("|")}function Y0(t){return t?t.failedAt?"failed":t.awaiting?"awaiting":t.step!=="__end__"?"running":kI(t.data??{})?"skipped":"done":"unknown"}function eN(t){switch(Y0(t)){case"failed":return 0;case"awaiting":return 1;case"running":return 2;case"skipped":return 3;case"done":return 4;default:return 5}}function tN(t){return t==="failed"?"failed":t==="awaiting"?"waiting":t==="running"?"running":t==="done"?"succeeded":"cancelled"}function pU(t,e){var a;const r=(a=t==null?void 0:t.flow)==null?void 0:a.edges;if(r&&r.length){const i=[],s=new Set;let o="__start__";for(let l=0;l<20;l++){const c=r.filter(d=>d.from===o).map(d=>d.to).find(d=>d!=="__end__"&&!s.has(d));if(!c)break;s.add(c),i.push(c),o=c}if(i.length)return i}const n=new Set;for(const i of e)i!=null&&i.step&&i.step!=="__end__"&&!n.has(i.step)&&n.add(i.step);return[...n]}Ca.use(cU);function gU(t,e){const r=["group-parent",`group-kind-${t.kind??"default"}`];if(!e)return r.join(" ");const a=(t.members??[]).some(i=>e.has(i));return r.push(a?"group-visited":"group-untouched"),r.join(" ")}function rN(t,e,r,n){const a=[];if(t.id==="__start__"?a.push("terminal","start"):t.id==="__end__"?a.push("terminal","end"):a.push(`kind-${n??t.kind}`),r&&a.push(r.has(t.id)?"visited":"unvisited"),e&&e.currentStep===t.id){a.push("current");const s={waiting:"blocked",blocked:"blocked",running:"running",succeeded:"succeeded",failed:"failed",cancelled:"cancelled"}[e.status];s&&a.push(s)}return a.join(" ")}function mU(){return[{selector:"node",style:{"background-color":"#1f262e","border-width":1.5,"border-color":"#2a3038",label:"data(label)",color:"#d8dde6","font-family":"ui-monospace, Menlo, monospace","font-size":11,"text-valign":"center","text-halign":"center",width:"label",height:28,padding:"10px",shape:"round-rectangle"}},{selector:"node.terminal",style:{"background-color":"#0e1116","border-color":"#6e7681",color:"#8b949e"}},{selector:"node.kind-code",style:{"border-color":"#58a6ff"}},{selector:"node.kind-agent",style:{"border-color":"#bc8cff"}},{selector:"node.kind-loop",style:{"border-color":"#f0883e"}},{selector:"node.kind-human-gate",style:{"border-color":"#d29922"}},{selector:"node.kind-gate",style:{"border-color":"#3fb950"}},{selector:"node.current",style:{"border-width":3,"background-color":"#1f6feb33"}},{selector:"node.running",style:{"border-color":"#3fb950"}},{selector:"node.blocked",style:{"border-color":"#d29922"}},{selector:"node.succeeded",style:{"border-color":"#79b8ff"}},{selector:"node.failed",style:{"border-color":"#f85149"}},{selector:"node.cancelled",style:{"border-color":"#6e7681"}},{selector:"edge",style:{width:1.2,"line-color":"#2a3038","target-arrow-color":"#2a3038","target-arrow-shape":"triangle","curve-style":"bezier"}},{selector:"edge.cond",style:{"line-style":"dashed","line-color":"#6e7681","target-arrow-color":"#6e7681"}},{selector:"node.unvisited",style:{opacity:.32}},{selector:"node.visited",style:{"border-color":"#79b8ff"}},{selector:"edge.untaken",style:{opacity:.18}},{selector:"edge.taken",style:{"line-color":"#58a6ff","target-arrow-color":"#58a6ff","line-style":"solid",width:2}},{selector:"node.group-parent",style:{"background-color":"transparent","background-opacity":0,"border-style":"dashed","border-color":"#39424d","border-width":1.2,label:"data(label)","text-valign":"top","text-halign":"center","text-margin-y":-6,"font-size":10,color:"#8b949e",padding:"16px",shape:"round-rectangle"}},{selector:"node.group-primary-ok",style:{"border-color":"#3fb950"}},{selector:"node.group-engaged",style:{"border-color":"#d29922","border-style":"solid","border-width":1.6}},{selector:"node.group-untouched",style:{"border-color":"#2a3038",opacity:.5}},{selector:"node.group-failed",style:{"border-color":"#f85149","border-style":"solid","border-width":1.6}},{selector:"node.group-running",style:{"border-color":"#58a6ff","border-style":"solid","border-width":1.6}},{selector:"node.selected",style:{"border-color":"#f0883e","border-width":3}}]}function TI({pipeline:t,run:e,tree:r,className:n,onNodeClick:a,selectedNodeId:i}){const s=Z.useRef(null),o=Z.useRef(null);return Z.useEffect(()=>{var y,w;if(!s.current)return;if(o.current){try{o.current.destroy()}catch{}o.current=null}const l=Array.isArray(r)?r.map(E=>E.nodeId):null,u=l?new Set(["__start__",...l]):null,c=l?dU(l):null,d=new Map;if(Array.isArray(r))for(const E of r)E.kind&&d.set(E.nodeId,E.kind);const f=new Map,h=new Map,v=[];if(t.groups&&typeof t.groups=="object")for(const[E,S]of Object.entries(t.groups)){const C=(S==null?void 0:S.members)??[];let k=null;for(const _ of C){f.set(_,E);const N=_.indexOf(".");N!==-1&&!k&&(k=_.slice(0,N))}h.set(E,k);const T={id:`__group:${E}`,label:S.label??E};k&&(T.parent=k),v.push({data:T,classes:gU(S,u)})}const x=new Map;for(const E of t.nodes){if(E.kind!=="subflow"||!E.flow)continue;const S=E.id,C=[];for(const T of E.flow.nodes??[]){const _=`${S}.${T.id}`,N=f.get(_);C.push({data:{id:_,label:T.id,parent:N?`__group:${N}`:S},classes:rN({id:T.id,kind:T.kind},null,null)})}const k=(E.flow.edges??[]).map((T,_)=>({data:{id:`sge:${S}:${_}`,source:`${S}.${T.from}`,target:`${S}.${T.to}`},classes:T.conditional?"cond":""})).filter(T=>!String(T.data.target).endsWith(".?"));x.set(S,{children:C,childEdges:k,concurrency:E.concurrency})}const b=[];b.push(...v);for(const E of t.nodes){const S=f.get(E.id);if(x.has(E.id)){const C=x.get(E.id),k=fU((w=(y=e==null?void 0:e.stateJson)==null?void 0:y.subflows)==null?void 0:w[E.id]),T=`${E.id} (loop${C.concurrency?` ×${C.concurrency}`:""})`,_=k.total>0?`${T} · ${k.succeeded}/${k.total} ok${k.skipped?` · ${k.skipped} ⊘`:""}${k.failed?` · ${k.failed} ✗`:""}${k.awaiting?` · ${k.awaiting} ⏳`:""}${k.running?` · ${k.running} →`:""}`:T,N=["group-parent","group-kind-subgraph"];k.total>0?N.push(vU(k)):u&&N.push(u.has(E.id)?"visited":"unvisited"),b.push({data:{id:E.id,label:_,...S?{parent:`__group:${S}`}:{}},classes:N.join(" ")})}else b.push({data:{id:E.id,label:E.id,...S?{parent:`__group:${S}`}:{}},classes:rN(E,e,u,d.get(E.id))})}for(const E of x.values())b.push(...E.children);const m=t.edges.map((E,S)=>{let C=E.from,k=E.to;x.has(C)&&(C=`${C}.__end__`),x.has(k)&&(k=`${k}.__start__`);const T=[];return E.conditional&&T.push("cond"),c&&T.push(c.has(`${E.from}→${E.to}`)?"taken":"untaken"),{data:{id:`e${S}`,source:C,target:k,via:E.via??""},classes:T.join(" ")}}).filter(E=>E.data.target&&E.data.target!=="?");for(const E of x.values())m.push(...E.childEdges);const p=Ca({container:s.current,elements:{nodes:b,edges:m},style:mU(),layout:{name:"dagre",rankDir:"LR",nodeSep:24,rankSep:70,edgeSep:10},wheelSensitivity:.2});if(p.on("tap","edge.cond",E=>{const S=E.target.data("via");S&&alert(S)}),a&&p.on("tap","node",E=>{const S=String(E.target.id());S.startsWith("__group:")||S==="__start__"||S==="__end__"||S.includes(".")||a(S)}),i){const E=p.getElementById(i);E&&E.length&&E.addClass("selected")}return o.current=p,()=>{try{p.destroy()}catch{}}},[t,e==null?void 0:e.flowId,e==null?void 0:e.revision,r,a,i]),g.jsx("div",{ref:s,className:`h-[320px] sm:h-[420px] md:h-[480px] bg-bg border border-border rounded ${n??""}`})}function nN(t){if(!t)return"";const e=Date.now()-t;return e<6e4?`${Math.floor(e/1e3)}s ago`:e<36e5?`${Math.floor(e/6e4)}m ago`:e<864e5?`${Math.floor(e/36e5)}h ago`:`${Math.floor(e/864e5)}d ago`}function yU({pipelineId:t,nodeId:e,onClose:r}){const[n,a]=Z.useState(null),[i,s]=Z.useState(null);return Z.useEffect(()=>{let o=!1;return a(null),s(null),st.pipelineNodeStats(t,e).then(l=>{o||a(l)}).catch(l=>{o||s((l==null?void 0:l.message)??String(l))}),()=>{o=!0}},[t,e]),g.jsxs(Me,{children:[g.jsx(Qe,{children:g.jsxs(tt,{children:[g.jsx("span",{className:"font-mono",children:e}),g.jsx("button",{className:"ml-3 text-xs text-fg-dim hover:text-fg",onClick:r,"aria-label":"close node context",children:"✕ close"})]})}),i&&g.jsx("p",{className:"text-status-red text-sm",children:i}),!i&&!n&&g.jsx("p",{className:"italic text-fg-dim text-sm",children:"loading…"}),n&&g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-2 mb-3",children:[g.jsx(Xl,{label:"visits",value:n.visits}),g.jsx(Xl,{label:"failed-here",value:n.failedHere,tone:n.failedHere?"red":null}),g.jsx(Xl,{label:"blocked-here",value:n.blockedHere,tone:n.blockedHere?"amber":null}),g.jsx(Xl,{label:"terminated-here",value:n.terminatedHere,tone:n.terminatedHere?"amber":null})]}),g.jsxs("div",{className:"text-xs text-fg-dim mb-1",children:["visited by ",n.visits," of ",n.totalRuns," run",n.totalRuns===1?"":"s"]}),n.recentRuns.length===0?g.jsx("p",{className:"italic text-fg-dim text-sm",children:"no runs have touched this node yet."}):g.jsxs(g.Fragment,{children:[g.jsx("div",{className:"sm:hidden flex flex-col gap-1.5",children:n.recentRuns.map(o=>g.jsxs("a",{href:`#/runs/${o.flowId}`,className:"block rounded border border-border bg-bg-elev2/30 hover:bg-bg-elev2 px-2.5 py-1.5",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(is,{status:o.status}),g.jsxs("span",{className:"font-mono text-xs truncate flex-1",children:[o.flowId.slice(0,12),"…"]}),g.jsx("span",{className:"text-[10px] text-fg-dim shrink-0",children:nN(o.updatedAt)})]}),o.currentStep&&g.jsx("div",{className:"mt-0.5 text-[11px] font-mono text-fg-dim",children:o.currentStep})]},o.flowId))}),g.jsx("div",{className:"hidden sm:block",children:g.jsxs(ei,{children:[g.jsx(ti,{children:g.jsxs(yr,{children:[g.jsx(We,{children:"flow"}),g.jsx(We,{children:"status"}),g.jsx(We,{children:"currentStep"}),g.jsx(We,{children:"updated"})]})}),g.jsx(ri,{children:n.recentRuns.map(o=>g.jsxs(yr,{children:[g.jsx(He,{className:"font-mono text-xs",children:g.jsxs("a",{href:`#/runs/${o.flowId}`,className:"hover:underline",children:[o.flowId.slice(0,12),"…"]})}),g.jsx(He,{children:g.jsx(is,{status:o.status})}),g.jsx(He,{className:"font-mono text-xs text-fg-dim",children:o.currentStep??""}),g.jsx(He,{className:"text-xs text-fg-dim",children:nN(o.updatedAt)})]},o.flowId))})]})})]})]})]})}function Xl({label:t,value:e,tone:r}){const n=r==="red"?"text-status-red":r==="amber"?"text-status-amber":"text-fg";return g.jsxs("div",{className:"border border-border rounded p-2",children:[g.jsx("div",{className:"text-xs text-fg-dim",children:t}),g.jsx("div",{className:`font-mono text-lg ${n}`,children:e})]})}function wu({value:t,label:e="copy",className:r}){const[n,a]=Z.useState("idle");async function i(s){var o;s.preventDefault(),s.stopPropagation();try{if((o=navigator.clipboard)!=null&&o.writeText)await navigator.clipboard.writeText(t);else{const l=document.createElement("textarea");l.value=t,l.style.position="fixed",l.style.opacity="0",document.body.appendChild(l),l.select(),document.execCommand("copy"),document.body.removeChild(l)}a("ok")}catch{a("err")}setTimeout(()=>a("idle"),1200)}return g.jsx("button",{type:"button",onClick:i,title:`${e}: ${t}`,"aria-label":e,className:qe("inline-flex items-center align-middle text-fg-dim hover:text-fg leading-none px-1 py-0.5 rounded border border-transparent hover:border-border text-xs",n==="ok"&&"text-status-green",n==="err"&&"text-status-red",r),children:n==="ok"?"✓":n==="err"?"✕":"⧉"})}function xU({stages:t}){const[e,r]=Z.useState(null);if(!t||t.length===0)return g.jsx("div",{className:"italic text-fg-dim py-4",children:"no funnel definition for this pipeline"});const n=Math.max(1,...t.map(i=>i.total)),a=t[t.length-1].conversionFromStart;return g.jsxs(g.Fragment,{children:[g.jsx("div",{className:"grid grid-cols-[auto_1fr_auto_auto_auto] items-center gap-x-3 gap-y-2 font-mono text-xs",children:t.map((i,s)=>{const o=i.conversionFromPrev,l=s===0?"":o==null?"—":`${(o*100).toFixed(0)}%`,u=o!=null&&o<.5,c=e===i.id,d=s>0?t[s-1].min:null,f=i.min===0&&(i.p50??0)>0&&(d==null||d>0);return g.jsxs(Z.Fragment,{children:[g.jsxs("button",{type:"button",onClick:()=>r(c?null:i.id),"aria-expanded":c,className:"contents text-left group",children:[g.jsxs("span",{className:"text-fg-dim group-hover:bg-bg-elev2/40 rounded-l-[2px] pl-0.5 whitespace-nowrap inline-flex items-center gap-1",children:[g.jsx("span",{children:i.label}),g.jsx("span",{className:"text-[10px] text-fg-dim/80",children:c?"▾":"▸"})]}),g.jsx("span",{className:"relative h-[18px] bg-bg-elev2 rounded-[3px] overflow-hidden",children:g.jsx("span",{className:"absolute top-0 left-0 bottom-0",style:{width:`${(i.total/n*100).toFixed(1)}%`,background:"linear-gradient(90deg, #1f6feb, #58a6ff)"}})}),g.jsx("span",{className:"text-right whitespace-nowrap tabular-nums group-hover:bg-bg-elev2/40",children:i.total}),g.jsxs("span",{className:`text-right whitespace-nowrap tabular-nums group-hover:bg-bg-elev2/40 ${f?"text-status-amber":"text-fg-dim"}`,children:["(p50 ",Bs(i.p50),f?" · min 0":"",")"]}),g.jsx("span",{className:`text-right whitespace-nowrap tabular-nums group-hover:bg-bg-elev2/40 rounded-r-[2px] pr-0.5 ${u?"text-status-amber":"text-fg-dim"}`,children:l})]}),c&&g.jsxs("div",{className:"col-span-5 pl-0.5 pr-1 pt-0.5 pb-1.5",children:[g.jsxs("div",{className:"text-[10px] text-fg-dim grid grid-cols-2 sm:grid-cols-4 gap-x-3 gap-y-0.5",children:[g.jsxs("span",{children:[g.jsx("span",{className:"text-fg-dim",children:"p50:"})," ",Bs(i.p50)]}),g.jsxs("span",{children:[g.jsx("span",{className:"text-fg-dim",children:"p95:"})," ",Bs(i.p95)]}),g.jsxs("span",{children:[g.jsx("span",{className:"text-fg-dim",children:"min:"})," ",Bs(i.min)]}),g.jsxs("span",{children:[g.jsx("span",{className:"text-fg-dim",children:"mean:"})," ",Bs(i.mean)]}),g.jsxs("span",{className:"col-span-2 sm:col-span-4",children:[g.jsx("span",{className:"text-fg-dim",children:"n:"})," ",i.n," runs"]})]}),i.subStages&&i.subStages.length>0&&g.jsx(bU,{stages:i.subStages})]})]},i.id)})}),a!=null&&g.jsxs("div",{className:"mt-2.5 font-mono text-fg-dim text-xs",children:["overall: ",(a*100).toFixed(1),"% (",t[0].label," → ",t[t.length-1].label,") across ",t[0].n," run(s)"]})]})}function bU({stages:t}){if(!t.length)return null;const e=Math.max(1,...t.map(r=>r.total));return g.jsxs("div",{className:"mt-2 ml-3 pl-2 border-l border-border/60",children:[g.jsx("div",{className:"text-[10px] text-fg-dim/80 mb-1 italic",children:"per-subflow sub-funnel"}),g.jsx("div",{className:"grid grid-cols-[auto_1fr_auto_auto] items-center gap-x-3 gap-y-1 font-mono text-[11px]",children:t.map((r,n)=>{const a=r.conversionFromPrev,i=n===0?"":a==null?"—":a===0?"0%":a<.01?"<1%":a<.1?`${(a*100).toFixed(1)}%`:`${(a*100).toFixed(0)}%`,s=a!=null&&a<.5;return g.jsxs(Z.Fragment,{children:[g.jsx("span",{className:"text-fg-dim whitespace-nowrap",children:r.label}),g.jsx("span",{className:"relative h-[12px] bg-bg-elev2 rounded-[2px] overflow-hidden",children:g.jsx("span",{className:"absolute top-0 left-0 bottom-0 bg-status-blue/70",style:{width:`${(r.total/e*100).toFixed(1)}%`}})}),g.jsx("span",{className:"text-right whitespace-nowrap tabular-nums text-fg-dim",children:r.total}),g.jsx("span",{className:`text-right whitespace-nowrap tabular-nums ${s?"text-status-amber":"text-fg-dim"}`,children:i})]},r.id)})})]})}function wU({pipelineId:t}){const[e,r]=Z.useState(null),[n,a]=Z.useState(null),[i,s]=Z.useState(null),[o,l]=Z.useState(null),[u,c]=Z.useState(null),[d,f]=Z.useState(null),h=()=>{st.pipeline(t).then(p=>{r(p),c(null)}).catch(p=>c((p==null?void 0:p.message)??String(p)))},v=()=>{st.pipelineStats(t).then(a).catch(()=>{})},x=()=>{st.pipelineCost(t,30).then(s).catch(()=>s(null))},b=()=>{st.pipelineViews(t,30).then(l).catch(()=>l(null))};Z.useEffect(()=>{h(),v(),x(),b()},[t]),Tc(p=>{p.kind==="pipeline.catalog.updated"?(h(),v()):(p.kind==="run.created"||p.kind==="run.updated"||p.kind==="run.ended")&&v()});const m=Z.useCallback(p=>{f(y=>y===p?null:p)},[]);return u?g.jsxs(g.Fragment,{children:[g.jsx("a",{href:"#/pipelines",className:"text-fg-dim",children:"← pipelines"}),g.jsx("h1",{className:"font-mono mt-2 text-lg font-semibold",children:t}),g.jsxs("p",{className:"text-status-red",children:[u," — the pipeline may have been removed."]})]}):e?g.jsxs(g.Fragment,{children:[g.jsx("a",{href:"#/pipelines",className:"text-fg-dim",children:"← pipelines"}),g.jsxs("h1",{className:"font-mono mt-2 text-lg font-semibold",children:[t,g.jsx(wu,{value:t,label:"copy pipelineId",className:"ml-2"})]}),e.goal&&g.jsx("p",{className:"text-sm text-fg-dim mt-1 mb-4",children:e.goal}),(()=>{if(n===null||i===null)return g.jsx(Wu,{className:"mb-4",loading:!0,runs:{total:0,ok:0,failed:0,active:0},newFailures:0,spent:{value:0}});const y=Date.now()-Yx;return g.jsx(Wu,{className:"mb-4",runs:n.recent24h,newFailures:(n.failureStops??[]).filter(w=>(w.lastFailedAt??0)>=y).length,spent:AP(i.perDay)})})(),n?g.jsx(_P,{stats:{total:n.total,succeeded:n.succeeded,failed:n.failed,cancelled:n.cancelled,terminated:n.terminated,successRate:n.successRate,duration:n.duration,revision:n.revision},searchScope:t}):g.jsx("div",{className:"grid gap-3 mb-4 grid-cols-[repeat(auto-fit,minmax(150px,1fr))]",children:[0,1,2,3,4].map(p=>g.jsxs("div",{className:"bg-bg-elev border border-border rounded-md px-[14px] py-3",children:[g.jsx(ge,{className:"h-3 w-16 mb-2"}),g.jsx(ge,{className:"h-7 w-20"}),g.jsx(ge,{className:"h-2 w-24 mt-2"})]},p))}),i===null&&g.jsxs(Me,{children:[g.jsx(Qe,{children:g.jsx(tt,{children:"cost (last 30d)"})}),g.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3",children:[0,1,2,3].map(p=>g.jsxs("div",{className:"border border-border rounded p-2",children:[g.jsx(ge,{className:"h-3 w-20 mb-1.5"}),g.jsx(ge,{className:"h-6 w-24"}),g.jsx(ge,{className:"h-2 w-32 mt-2"})]},p))}),g.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3 mt-4",children:[g.jsx("div",{className:"border border-border rounded p-2",children:[0,1,2,3,4].map(p=>g.jsxs("div",{className:"flex items-center gap-2 mb-1.5",children:[g.jsx(ge,{className:"h-3 w-32"}),g.jsx(ge,{className:"h-2 flex-1"}),g.jsx(ge,{className:"h-3 w-12"})]},p))}),g.jsx("div",{className:"flex flex-col gap-3",children:[0,1].map(p=>g.jsxs("div",{className:"border border-border rounded p-2 flex-1",children:[g.jsx(ge,{className:"h-3 w-24 mb-2"}),g.jsx("div",{className:"flex gap-[2px] h-12",children:[0,1,2,3,4,5].map(y=>g.jsx(ge,{className:"flex-1 rounded-[1px]"},y))})]},p))})]})]}),i&&i.runs>0&&g.jsxs(Me,{children:[g.jsx(Qe,{children:g.jsx(tt,{children:"cost (last 30d)"})}),g.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3 text-sm",children:[g.jsx(Zl,{label:"total spend",value:`$${i.total.toFixed(2)}`,sub:`${i.runs} run${i.runs===1?"":"s"}`}),g.jsx(Zl,{label:"mean / run",value:`$${i.mean.toFixed(2)}`,sub:i.p95!=null?`p95 $${i.p95.toFixed(2)}`:void 0}),g.jsx(Zl,{label:"cost / success",value:i.costPerSuccess!==null?`$${i.costPerSuccess.toFixed(2)}`:"—",sub:TU(i.costPerSuccess,i.costPerSuccessPrior,i.succeeded)}),g.jsx(Zl,{label:"models",value:Object.keys(i.byModel).join(", ")||"—"})]}),g.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3 mt-4",children:[g.jsx(_U,{byNode:i.byNode,total:i.total,stepOrder:SU(e),nodeKind:EU(e),nodeGroups:CU(e)}),g.jsxs("div",{className:"flex flex-col gap-3 h-full",children:[g.jsx(RP,{perDay:i.perDay}),g.jsx(PP,{perDay:i.perDay})]})]}),g.jsxs("p",{className:"text-xs text-fg-dim mt-3",children:[g.jsx("span",{className:"font-mono",children:"cost / success"})," is the ROI signal: total spend ÷ count of succeeded runs. If a successful run is worth more than this number on average, the pipeline is net-positive."]})]}),g.jsxs("div",{className:"flex flex-col lg:flex-row gap-3 lg:gap-5",children:[g.jsx("div",{className:"flex-1 min-w-0",children:g.jsxs(Me,{children:[g.jsx(Qe,{children:g.jsx(tt,{children:"funnel (succeeded + active runs)"})}),g.jsx(xU,{stages:(n==null?void 0:n.funnel)??null})]})}),g.jsx("div",{className:"flex-1 min-w-0",children:g.jsxs(Me,{children:[g.jsx(Qe,{children:g.jsx(tt,{children:"failure / cancel steps"})}),g.jsx(NP,{entries:(n==null?void 0:n.failureStops)??[],limit:10})]})})]}),o==null?void 0:o.views.map(p=>g.jsx(RU,{view:p},p.id)),g.jsxs(Me,{children:[g.jsx(Qe,{children:g.jsx(tt,{children:"graph"})}),g.jsx(TI,{pipeline:e,onNodeClick:m,selectedNodeId:d}),g.jsx("p",{className:"text-xs text-fg-dim mt-2",children:"tip: tap a node to inspect its visits and recent runs."})]}),d&&g.jsx(yU,{pipelineId:t,nodeId:d,onClose:()=>f(null)}),g.jsxs("div",{className:"flex flex-col lg:flex-row gap-3 lg:gap-5",children:[g.jsx("div",{className:"flex-1 min-w-0",children:g.jsxs(Me,{children:[g.jsx(Qe,{children:g.jsx(tt,{children:"nodes"})}),g.jsx("div",{className:"sm:hidden flex flex-col gap-1.5",children:e.nodes.filter(p=>p.id!=="__start__"&&p.id!=="__end__").map(p=>g.jsxs("div",{className:"rounded border border-border bg-bg-elev2/30 px-2.5 py-1.5",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("span",{className:"font-mono text-sm truncate flex-1",children:p.id}),g.jsx(mn,{variant:"kind",children:p.kind})]}),(p.agent||p.groupId)&&g.jsxs("div",{className:"mt-1 flex flex-wrap gap-x-3 text-[10px] font-mono text-fg-dim",children:[p.agent&&g.jsxs("span",{children:["agent: ",p.agent]}),p.groupId&&g.jsxs("span",{children:["group: ",p.groupId]})]})]},p.id))}),g.jsx("div",{className:"hidden sm:block",children:g.jsxs(ei,{children:[g.jsx(ti,{children:g.jsxs(yr,{children:[g.jsx(We,{children:"id"}),g.jsx(We,{children:"kind"}),g.jsx(We,{children:"agent"}),g.jsx(We,{children:"group"})]})}),g.jsx(ri,{children:e.nodes.filter(p=>p.id!=="__start__"&&p.id!=="__end__").map(p=>g.jsxs(yr,{children:[g.jsx(He,{className:"font-mono",children:p.id}),g.jsx(He,{children:g.jsx(mn,{variant:"kind",children:p.kind})}),g.jsx(He,{className:"text-fg-dim font-mono",children:p.agent??""}),g.jsx(He,{className:"text-fg-dim font-mono",children:p.groupId??""})]},p.id))})]})})]})}),g.jsx("div",{className:"flex-1 min-w-0",children:g.jsxs(Me,{children:[g.jsx(Qe,{children:g.jsx(tt,{children:"edges"})}),g.jsx("div",{className:"sm:hidden flex flex-col gap-1.5",children:e.edges.map((p,y)=>g.jsx("div",{className:"rounded border border-border bg-bg-elev2/30 px-2.5 py-1.5",children:g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsxs("span",{className:"font-mono text-xs flex-1 min-w-0 break-all",children:[g.jsx("span",{children:p.from}),g.jsx("span",{className:"text-fg-dim mx-1",children:"→"}),g.jsx("span",{children:p.to})]}),p.conditional&&g.jsx("span",{className:"text-[10px] font-mono text-fg-dim shrink-0",children:"conditional"})]})},y))}),g.jsx("div",{className:"hidden sm:block",children:g.jsxs(ei,{children:[g.jsx(ti,{children:g.jsxs(yr,{children:[g.jsx(We,{children:"from"}),g.jsx(We,{children:"to"}),g.jsx(We,{children:"kind"})]})}),g.jsx(ri,{children:e.edges.map((p,y)=>g.jsxs(yr,{children:[g.jsx(He,{className:"font-mono",children:p.from}),g.jsx(He,{className:"font-mono",children:p.to}),g.jsx(He,{className:"text-fg-dim",children:p.conditional?"conditional":"static"})]},y))})]})})]})})]})]}):g.jsxs(g.Fragment,{children:[g.jsx("a",{href:"#/pipelines",className:"text-fg-dim",children:"← pipelines"}),g.jsx(ge,{className:"h-6 w-72 mt-2 mb-1"}),g.jsx(ge,{className:"h-3 w-2/3 mb-4"}),g.jsx("div",{className:"grid gap-3 mb-4 grid-cols-[repeat(auto-fit,minmax(150px,1fr))]",children:[0,1,2,3].map(p=>g.jsxs("div",{className:"bg-bg-elev border border-border rounded-md px-[14px] py-3",children:[g.jsx(ge,{className:"h-3 w-16 mb-2"}),g.jsx(ge,{className:"h-7 w-20"}),g.jsx(ge,{className:"h-2 w-24 mt-2"})]},p))}),g.jsxs("div",{className:"flex flex-col lg:flex-row gap-3 lg:gap-5",children:[g.jsx("div",{className:"flex-1 min-w-0",children:g.jsxs(Me,{children:[g.jsx(ge,{className:"h-4 w-32 mb-3"}),[0,1,2,3].map(p=>g.jsx(ge,{className:"h-3 w-full mb-2"},p))]})}),g.jsx("div",{className:"flex-1 min-w-0",children:g.jsxs(Me,{children:[g.jsx(ge,{className:"h-4 w-40 mb-3"}),[0,1,2,3].map(p=>g.jsx(ge,{className:"h-3 w-full mb-2"},p))]})})]})]})}function SU(t){var n;const e=new Map;if(!t)return e;let r=0;for(const a of t.nodes)if(!(a.id==="__start__"||a.id==="__end__")&&(e.set(a.id.toLowerCase(),r++),(n=a.flow)!=null&&n.nodes))for(const i of a.flow.nodes)i.id==="__start__"||i.id==="__end__"||e.set(`${a.id}.${i.id}`.toLowerCase(),r++);return e}function EU(t){var r;const e=new Map;if(!t)return e;for(const n of t.nodes)if(e.set(n.id.toLowerCase(),n.kind),(r=n.flow)!=null&&r.nodes)for(const a of n.flow.nodes)e.set(`${n.id}.${a.id}`.toLowerCase(),a.kind);return e}function CU(t){if(!t)return[];const e=[],r=n=>{var i;if(n.kind!=="subflow"||!((i=n.flow)!=null&&i.nodes))return;const a=[{id:n.id.toLowerCase(),role:"direct"}];for(const s of n.flow.nodes)s.id==="__start__"||s.id==="__end__"||a.push({id:`${n.id}.${s.id}`.toLowerCase(),role:"subflow"});e.push({groupId:`__group:${n.id.toLowerCase()}`,label:n.id,members:a})};for(const n of t.nodes)r(n);return e}function kU(t){let e=0,r=0,n=0,a=0;for(const l of t)l&&(e+=l.cost,r+=l.calls,l.meanMs!=null&&l.calls>0&&(n+=l.meanMs*l.calls,a+=l.calls));const i=(l,u)=>{const c=b=>u==="ms"?b.p50Ms:b.p50Cost,d=b=>u==="ms"?b.p95Ms:b.p95Cost,f=t.filter(b=>!!b&&b.calls>0&&(c(b)!=null||d(b)!=null)).slice().sort((b,m)=>(c(b)??0)-(c(m)??0)),h=f.reduce((b,m)=>b+m.calls,0);if(h===0)return null;const v=h*l/100;let x=0;for(const b of f){const m=x+b.calls;if(v<=m){const p=(v-x)/b.calls*100,y=c(b)??0,w=d(b)??y;return p<=50?y:p>=95?w:y+(p-50)/45*(w-y)}x=m}return d(f[f.length-1])??null},s=new Map;for(const l of t)if(l!=null&&l.perDay)for(const u of l.perDay){const c=s.get(u.day)??{day:u.day,cost:0,calls:0,ms:0,p50CostNumer:0,p50CostDenom:0,p50MsNumer:0,p50MsDenom:0};c.cost+=u.cost??0,c.calls+=u.calls??0,c.ms+=u.ms??0,u.p50Cost!=null&&u.calls>0&&(c.p50CostNumer+=u.p50Cost*u.calls,c.p50CostDenom+=u.calls),u.p50Ms!=null&&u.calls>0&&(c.p50MsNumer+=u.p50Ms*u.calls,c.p50MsDenom+=u.calls),s.set(u.day,c)}const o=[...s.values()].map(l=>({day:l.day,cost:l.cost,calls:l.calls,ms:l.ms,p50Cost:l.p50CostDenom>0?l.p50CostNumer/l.p50CostDenom:null,p50Ms:l.p50MsDenom>0?l.p50MsNumer/l.p50MsDenom:null})).sort((l,u)=>l.day.localeCompare(u.day));return{cost:e,calls:r,p50Ms:i(50,"ms"),p95Ms:i(95,"ms"),meanMs:a>0?n/a:null,p50Cost:i(50,"cost"),p95Cost:i(95,"cost"),perDay:o}}function Iy({perDay:t,mode:e}){const[r,n]=Z.useState("total"),[a,i]=Z.useState(null),s=Z.useRef(null);if(Yo(s,()=>i(null)),!t||t.length===0)return g.jsx("span",{className:"col-span-2 sm:col-span-4 text-fg-dim italic",children:"no per-day samples yet"});const o=v=>e==="time"?v.p50Ms:r==="p50"?v.p50Cost:v.cost,l=Math.max(1e-4,...t.map(v=>o(v)??0)),u=a?t.find(v=>v.day===a):null,c=Xo(t,v=>o(v)??0),d=u?c.ratios.get(u.day):void 0,f=v=>e==="cost"?r==="p50"?`${v.day}: p50 $${(v.p50Cost??0).toFixed(4)} · ${v.calls} call${v.calls===1?"":"s"}`:`${v.day}: total $${v.cost.toFixed(4)} · ${v.calls} call${v.calls===1?"":"s"}`:`${v.day}: p50 ${no(v.p50Ms??0)} · ${v.calls} call${v.calls===1?"":"s"}`,h=e==="cost"?`daily ${r==="p50"?"p50 $/call":"$ total"}`:"daily p50 latency";return g.jsxs("div",{ref:s,className:"col-span-2 sm:col-span-4 mt-1",children:[g.jsxs("div",{className:"flex items-center justify-between mb-1",children:[g.jsx("span",{className:"text-[9px] text-fg-dim font-mono",children:h}),e==="cost"&&g.jsxs("div",{className:"inline-flex rounded border border-border overflow-hidden text-[9px] font-mono",onClick:v=>v.stopPropagation(),children:[g.jsx("button",{type:"button",onClick:()=>n("total"),className:r==="total"?"px-1.5 py-px bg-status-blue/20 text-fg":"px-1.5 py-px text-fg-dim hover:text-fg",children:"total"}),g.jsx("button",{type:"button",onClick:()=>n("p50"),className:r==="p50"?"px-1.5 py-px border-l border-border bg-status-blue/20 text-fg":"px-1.5 py-px border-l border-border text-fg-dim hover:text-fg",children:"p50"})]})]}),g.jsx("div",{className:"text-right text-[9px] text-fg font-mono mb-0.5 min-h-[12px]",children:u&&g.jsxs("span",{children:[f(u),d!=null&&g.jsxs("span",{className:"text-status-amber",children:[" · ",d.toFixed(1),"× mean"]})]})}),g.jsx("div",{className:"flex gap-[2px] h-10",children:t.map(v=>{const x=o(v)??0,b=x>0?Math.max(2,Math.round(x/l*100)):2,m=a===v.day,p=a!==null&&!m,y=c.flagged.has(v.day),w=c.ratios.get(v.day),E=x>0?y?"bg-status-amber":"bg-status-blue":"bg-bg-elev2",S=y&&w!=null?`${f(v)} · ${w.toFixed(1)}× mean`:f(v);return g.jsx("button",{type:"button",onClick:C=>{C.stopPropagation(),i(m?null:v.day)},className:"flex-1 min-w-[4px] relative h-full",title:S,children:g.jsx("span",{className:`absolute bottom-0 left-0 right-0 rounded-[1px] ${E} ${p?"opacity-65":""}`,style:{height:`${b}%`}})},v.day)})}),g.jsxs("div",{className:"flex justify-between mt-1 text-[9px] text-fg-dim font-mono",children:[g.jsx("span",{children:t[0].day}),g.jsxs("span",{children:[t.length,"d"]}),g.jsx("span",{children:t[t.length-1].day})]})]})}const Su={code:"#58a6ff",agent:"#bc8cff",subflow:"#f0883e","human-gate":"#3fb950"},X0="#6e7681";function Zl({label:t,value:e,sub:r,tone:n,title:a}){const i=n==="red"?"text-status-red":n==="amber"?"text-status-amber":n==="green"?"text-status-green":"text-fg";return g.jsxs("div",{className:"border border-border rounded p-2",title:a,children:[g.jsx("div",{className:"text-xs text-fg-dim",children:t}),g.jsx("div",{className:`font-mono text-lg ${i}`,children:e}),r&&g.jsx("div",{className:"text-xs text-fg-dim mt-0.5",children:r})]})}function TU(t,e,r){if(t===null)return r>0?`${r} succeeded`:"no successes yet";const n=`${r} succeeded`;if(e===null)return n;const a=t-e;if(Math.abs(a)<.005)return g.jsxs(g.Fragment,{children:[n," · ",g.jsx("span",{className:"text-fg-dim",children:"steady"})]});const i=a>0,s=i?"text-status-red":"text-status-green",o=i?"↑":"↓";return g.jsxs(g.Fragment,{children:[n," · ",g.jsxs("span",{className:s,children:[o," $",Math.abs(a).toFixed(2)]})," vs prior"]})}function _U({byNode:t,total:e,stepOrder:r,nodeKind:n,nodeGroups:a}){var m;const[i,s]=Z.useState("cost"),[o,l]=Z.useState(null),[u,c]=Z.useState(null),d=new Set,f=[];for(const p of a){const y=p.members,w=y.map(S=>t[S.id]);if(w.every(S=>!S))continue;for(const S of y)d.add(S.id);const E=kU(w);E.cost<=0&&(E.p50Ms??0)<=0||f.push({kind:"group",id:p.groupId,label:p.label,members:p.members,entry:E,orderIdx:r.get(((m=y[0])==null?void 0:m.id)??"")??Number.POSITIVE_INFINITY})}const h=Object.entries(t).filter(([p,y])=>!d.has(p)&&(y.cost>0||(y.p50Ms??0)>0)).map(([p,y])=>({kind:"single",id:p,entry:y,orderIdx:r.get(p)??Number.POSITIVE_INFINITY})),v=[...f,...h].sort((p,y)=>p.orderIdx!==y.orderIdx?p.orderIdx-y.orderIdx:y.entry.cost-p.entry.cost);if(v.length===0)return null;const x=Math.max(...i==="cost"?v.map(p=>p.entry.cost):v.map(p=>p.entry.p50Ms??0)),b=v.reduce((p,y)=>p+(y.entry.p50Ms??0)*y.entry.calls,0);return g.jsxs("div",{className:"border border-border rounded p-2",children:[g.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[g.jsxs("div",{className:"text-xs text-fg-dim",children:["by node — ",i==="cost"?"spend":"wall time"]}),g.jsxs("div",{className:"ml-auto inline-flex rounded border border-border overflow-hidden text-[10px] font-mono",children:[g.jsx("button",{onClick:()=>s("cost"),className:qe("px-2 py-0.5",i==="cost"?"bg-status-blue/20 text-fg":"text-fg-dim hover:text-fg"),children:"$"}),g.jsx("button",{onClick:()=>s("time"),className:qe("px-2 py-0.5 border-l border-border",i==="time"?"bg-status-blue/20 text-fg":"text-fg-dim hover:text-fg"),children:"time"})]})]}),g.jsx("div",{className:"grid grid-cols-[auto_1fr_auto_auto] items-center gap-x-2 gap-y-1",children:v.map(p=>{const y=p.entry,w=no(y.p50Ms),E=no(y.p95Ms),S=i==="cost"?y.cost:y.p50Ms??0,C=x>0?Math.round(S/x*100):0,k=i==="cost"?e>0?y.cost/e*100:0:b>0?(y.p50Ms??0)*y.calls/b*100:0,T=i==="cost"?`$${y.cost.toFixed(2)}`:w,_=o===p.id,N=p.kind==="group"?Su.subflow:Su[n.get(p.id)??""]??X0,P=p.kind==="group"?p.label:p.id,R=_?"▾":"▸",I=p.kind==="group"?`${p.label} · subflow group (${p.members.map(M=>M.id).join(" → ")}) · combined ${y.calls} call${y.calls===1?"":"s"} · $${y.cost.toFixed(4)} · p50 ${w} · p95 ${E}`:`${p.id} · ${n.get(p.id)??"unknown kind"} · ${y.calls} call${y.calls===1?"":"s"} · $${y.cost.toFixed(4)} · p50 ${w} · p95 ${E}`;return g.jsxs(Z.Fragment,{children:[g.jsxs("button",{type:"button",onClick:()=>l(_?null:p.id),"aria-expanded":_,title:I,className:"contents text-left group",children:[g.jsxs("span",{className:"flex items-center gap-1.5 min-w-0 text-xs group-hover:bg-bg-elev2/40 rounded-l-[2px] pl-0.5",children:[g.jsx("span",{"aria-hidden":!0,className:"inline-block w-2 h-2 rounded-[1px] shrink-0",style:{backgroundColor:N}}),g.jsx("span",{className:"font-mono truncate",children:P}),g.jsx("span",{className:"text-[10px] text-fg-dim leading-none shrink-0",children:R})]}),g.jsx("span",{className:"relative h-2 w-full bg-bg-elev2 rounded-[1px]",children:g.jsx("span",{className:"absolute left-0 top-0 bottom-0 bg-status-blue rounded-[1px]",style:{width:`${C}%`}})}),g.jsx("span",{className:"font-mono text-fg-dim tabular-nums text-right whitespace-nowrap text-xs group-hover:bg-bg-elev2/40",children:T}),g.jsxs("span",{className:"font-mono text-fg-dim tabular-nums text-right whitespace-nowrap text-[10px] group-hover:bg-bg-elev2/40 rounded-r-[2px] pr-0.5",children:["(",k.toFixed(0),"%)"]})]}),_&&p.kind==="group"&&g.jsxs("div",{className:"col-span-4 pl-5 pr-1 pt-0.5 pb-1 text-[10px] font-mono text-fg-dim grid grid-cols-2 sm:grid-cols-4 gap-x-3 gap-y-0.5",children:[g.jsxs("span",{children:[g.jsx("span",{className:"text-fg-dim",children:"kind:"})," subflow group"]}),g.jsxs("span",{children:[g.jsx("span",{className:"text-fg-dim",children:"calls:"})," ",y.calls]}),g.jsxs("span",{children:[g.jsx("span",{className:"text-fg-dim",children:"$ total:"})," $",y.cost.toFixed(4)]}),g.jsxs("span",{children:[g.jsx("span",{className:"text-fg-dim",children:"share:"})," ",k.toFixed(1),"%"]}),g.jsxs("span",{children:[g.jsx("span",{className:"text-fg-dim",children:"p50 time:"})," ",w]}),g.jsxs("span",{children:[g.jsx("span",{className:"text-fg-dim",children:"p95 time:"})," ",E]}),g.jsxs("span",{children:[g.jsx("span",{className:"text-fg-dim",children:"p50 $/call:"})," ",y.p50Cost!=null?`$${y.p50Cost.toFixed(4)}`:"—"]}),g.jsxs("span",{children:[g.jsx("span",{className:"text-fg-dim",children:"p95 $/call:"})," ",y.p95Cost!=null?`$${y.p95Cost.toFixed(4)}`:"—"]}),(i==="time"||y.cost>0)&&g.jsx(Iy,{perDay:y.perDay,mode:i})]}),_&&p.kind==="group"&&(()=>{const M={cost:0,calls:0,p50Ms:null,p95Ms:null,p50Cost:null,p95Cost:null,perDay:[]},D=(j,F)=>{const O=t[j.id]??M,B=no(O.p50Ms),V=no(O.p95Ms),J=n.get(j.id)??"",q=Su[J]??X0,$=i==="cost"?O.cost:O.p50Ms??0,z=x>0?Math.round($/x*100):0,W=F>0?O.calls/F*100:0,ne=i==="cost"?`$${O.cost.toFixed(2)}`:B,X=u===j.id;return g.jsxs(Z.Fragment,{children:[g.jsxs("button",{type:"button",onClick:()=>c(X?null:j.id),"aria-expanded":X,title:`${j.id} · ${J} · ${j.role} · ${O.calls} call${O.calls===1?"":"s"} · $${O.cost.toFixed(4)} · p50 ${B} · p95 ${V}`,className:"contents text-left group",children:[g.jsxs("span",{className:"flex items-center gap-1.5 min-w-0 text-xs pl-4 text-fg-dim group-hover:bg-bg-elev2/40",children:[g.jsx("span",{"aria-hidden":!0,className:"inline-block w-2 h-2 rounded-[1px] shrink-0",style:{backgroundColor:q}}),g.jsx("span",{className:"font-mono truncate",children:j.id}),g.jsx("span",{className:"text-[9px] font-mono text-fg-dim border border-border rounded px-1 py-px leading-none shrink-0",children:j.role}),g.jsx("span",{className:"text-[10px] text-fg-dim leading-none shrink-0",children:X?"▾":"▸"})]}),g.jsx("span",{className:"relative h-1.5 w-full bg-bg-elev2 rounded-[1px]",children:g.jsx("span",{className:"absolute left-0 top-0 bottom-0 bg-status-blue/60 rounded-[1px]",style:{width:`${z}%`}})}),g.jsx("span",{className:"font-mono text-fg-dim tabular-nums text-right whitespace-nowrap text-xs group-hover:bg-bg-elev2/40",children:ne}),g.jsxs("span",{className:"font-mono text-fg-dim tabular-nums text-right whitespace-nowrap text-[10px] pr-0.5 group-hover:bg-bg-elev2/40",title:`throughput share within this group: ${O.calls} of ${F} calls`,children:["(",W.toFixed(0),"%)"]})]}),X&&g.jsxs("div",{className:"col-span-4 pl-8 pr-1 pt-0.5 pb-1 text-[10px] font-mono text-fg-dim grid grid-cols-2 sm:grid-cols-4 gap-x-3 gap-y-0.5",children:[g.jsxs("span",{children:[g.jsx("span",{className:"text-fg-dim",children:"kind:"})," ",J||"—"]}),g.jsxs("span",{children:[g.jsx("span",{className:"text-fg-dim",children:"calls:"})," ",O.calls]}),g.jsxs("span",{children:[g.jsx("span",{className:"text-fg-dim",children:"$ total:"})," $",O.cost.toFixed(4)]}),g.jsxs("span",{children:[g.jsx("span",{className:"text-fg-dim",children:"group share:"})," ",W.toFixed(1),"%"]}),g.jsxs("span",{children:[g.jsx("span",{className:"text-fg-dim",children:"p50 time:"})," ",B]}),g.jsxs("span",{children:[g.jsx("span",{className:"text-fg-dim",children:"p95 time:"})," ",V]}),g.jsxs("span",{children:[g.jsx("span",{className:"text-fg-dim",children:"p50 $/call:"})," ",O.p50Cost!=null?`$${O.p50Cost.toFixed(4)}`:"—"]}),g.jsxs("span",{children:[g.jsx("span",{className:"text-fg-dim",children:"p95 $/call:"})," ",O.p95Cost!=null?`$${O.p95Cost.toFixed(4)}`:"—"]}),(i==="time"||O.cost>0)&&g.jsx(Iy,{perDay:O.perDay,mode:i})]})]},`${p.id}:${j.id}`)},L=p.members.reduce((j,F)=>{var O;return j+(((O=t[F.id])==null?void 0:O.calls)??0)},0);return p.members.map(j=>D(j,L))})(),_&&p.kind==="single"&&g.jsxs("div",{className:"col-span-4 pl-5 pr-1 pt-0.5 pb-1 text-[10px] font-mono text-fg-dim grid grid-cols-2 sm:grid-cols-4 gap-x-3 gap-y-0.5",children:[g.jsxs("span",{children:[g.jsx("span",{className:"text-fg-dim",children:"kind:"})," ",n.get(p.id)||"—"]}),g.jsxs("span",{children:[g.jsx("span",{className:"text-fg-dim",children:"calls:"})," ",y.calls]}),g.jsxs("span",{children:[g.jsx("span",{className:"text-fg-dim",children:"$ total:"})," $",y.cost.toFixed(4)]}),g.jsxs("span",{children:[g.jsx("span",{className:"text-fg-dim",children:"share:"})," ",k.toFixed(1),"%"]}),g.jsxs("span",{children:[g.jsx("span",{className:"text-fg-dim",children:"p50 time:"})," ",w]}),g.jsxs("span",{children:[g.jsx("span",{className:"text-fg-dim",children:"p95 time:"})," ",E]}),g.jsxs("span",{children:[g.jsx("span",{className:"text-fg-dim",children:"p50 $/call:"})," ",y.p50Cost!=null?`$${y.p50Cost.toFixed(4)}`:"—"]}),g.jsxs("span",{children:[g.jsx("span",{className:"text-fg-dim",children:"p95 $/call:"})," ",y.p95Cost!=null?`$${y.p95Cost.toFixed(4)}`:"—"]}),(i==="time"||y.cost>0)&&g.jsx(Iy,{perDay:y.perDay,mode:i})]})]},p.id)})}),g.jsx(NU,{kinds:new Set([...v.flatMap(p=>p.kind==="group"?p.members.map(y=>n.get(y.id)??""):[n.get(p.id)??""])])}),g.jsxs("p",{className:"text-[10px] text-fg-dim mt-1",children:["columns: ",g.jsxs("span",{className:"font-mono",children:["node · bar · ",i==="cost"?"$ (share of spend)":"p50 (share of typical wall time)"]})," — color swatch = node kind. tap a row for full detail."]})]})}function NU({kinds:t}){const e=Array.from(t).filter(Boolean).sort();return e.length===0?null:g.jsx("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 mt-3 pt-2 border-t border-border text-[10px] text-fg-dim",children:e.map(r=>g.jsxs("span",{className:"inline-flex items-center gap-1",children:[g.jsx("span",{className:"inline-block w-2.5 h-2.5 rounded-[1px]",style:{backgroundColor:Su[r]??X0}}),g.jsx("span",{className:"font-mono",children:r})]},r))})}function no(t){return t===null||!Number.isFinite(t)?"—":t<1e3?`${Math.round(t)}ms`:t<6e4?`${(t/1e3).toFixed(1)}s`:t<36e5?`${Math.floor(t/6e4)}m${Math.round(t%6e4/1e3)}s`:`${(t/36e5).toFixed(1)}h`}function RU({view:t}){return t.error?g.jsxs(Me,{children:[g.jsx(Qe,{children:g.jsx(tt,{children:t.label})}),g.jsx("p",{className:"text-status-red text-xs font-mono",children:t.error})]}):t.kind==="funnel"?g.jsx(PU,{view:t}):g.jsxs(Me,{children:[g.jsx(Qe,{children:g.jsx(tt,{children:t.label})}),g.jsxs("p",{className:"text-fg-dim italic text-xs font-mono",children:["unknown view kind: ",t.kind]})]})}function PU({view:t}){var o,l,u;if(t.total===0)return g.jsxs(Me,{children:[g.jsx(Qe,{children:g.jsx(tt,{children:t.label})}),g.jsx("p",{className:"text-fg-dim italic text-xs",children:"no records in window"})]});const e=Math.max(1,...t.funnel.map(c=>c.count)),r=(o=t.funnel[t.funnel.length-1])==null?void 0:o.conversionFromStart,n=((l=t.funnel[0])==null?void 0:l.label)??"",a=((u=t.funnel[t.funnel.length-1])==null?void 0:u.label)??"",i=["pending","viewed","replied","qualified","meeting-scheduled","won","lost"],s=t.byOutcome?Object.entries(t.byOutcome).sort(([c],[d])=>{const f=i.indexOf(c),h=i.indexOf(d);return(f===-1?99:f)-(h===-1?99:h)}):[];return g.jsxs(Me,{children:[g.jsxs(Qe,{children:[g.jsx(tt,{children:t.label}),g.jsxs("span",{className:"text-fg-dim font-mono text-xs",children:[t.total," record",t.total===1?"":"s"]})]}),g.jsx("div",{className:"grid grid-cols-[auto_1fr_auto_auto] items-center gap-x-3 gap-y-2 font-mono text-xs",children:t.funnel.map((c,d)=>{const f=c.conversionFromPrev,h=d===0?"":f==null?"—":f===0?"0%":f<.01?"<1%":f<.1?`${(f*100).toFixed(1)}%`:`${(f*100).toFixed(0)}%`,v=f!=null&&f<.5;return g.jsxs(Z.Fragment,{children:[g.jsx("span",{className:"text-fg-dim",children:c.label}),g.jsx("span",{className:"relative h-[18px] bg-bg-elev2 rounded-[3px] overflow-hidden",children:g.jsx("span",{className:"absolute top-0 left-0 bottom-0",style:{width:`${(c.count/e*100).toFixed(1)}%`,background:"linear-gradient(90deg, #1f6feb, #58a6ff)"}})}),g.jsx("span",{className:"text-right whitespace-nowrap tabular-nums",children:c.count}),g.jsx("span",{className:`text-right whitespace-nowrap tabular-nums ${v?"text-status-amber":"text-fg-dim"}`,children:h})]},c.id)})}),s.length>0&&g.jsxs("div",{className:"mt-3 text-[11px] text-fg-dim font-mono",children:["breakdown: ",s.map(([c,d],f)=>g.jsxs("span",{children:[f>0&&g.jsx("span",{className:"mx-1",children:"·"}),g.jsx("span",{className:"text-fg",children:d})," ",c]},c))]}),r!=null&&g.jsxs("div",{className:"mt-1 text-[11px] text-fg-dim font-mono",children:["overall: ",(r*100).toFixed(1),"% (",n," → ",a,")",r===0&&g.jsx("span",{className:"text-status-amber",children:" · no progression yet"})]})]})}function AU({history:t}){if(!t||t.length===0)return null;const e=["__start__",...t];return g.jsxs("div",{className:"flex flex-wrap gap-1 items-center mt-2.5 pt-2.5 border-t border-dashed border-border font-mono text-[11px]",children:[g.jsxs("span",{className:"text-fg-dim mr-1.5",children:["path · ",t.length," step",t.length===1?"":"s",":"]}),e.map((r,n)=>{const a=n>0&&e[n-1]===r;return g.jsxs("span",{className:"flex items-center gap-1",children:[g.jsx("span",{className:qe("px-1.5 py-0.5 rounded border text-[11px] font-mono",a?"bg-status-green/10 border-status-green/35 text-status-green":"bg-bg-elev2 text-fg border-border"),children:r}),n<e.length-1&&g.jsx("span",{className:"text-fg-dim text-[10px] mx-0.5",children:"❯"})]},n)})]})}function uc({subflow:t,subSteps:e}){var n,a;if(!t)return g.jsx("span",{className:"text-fg-dim",children:"—"});const r=[];for(const i of e){const s=(n=t.data)==null?void 0:n[i];if(s){let o="succeeded",l;s._error?o="failed":i==="GATE"&&s.decision&&s.decision!=="approve"?(o="cancelled",l=" ✗"):i==="SUBMIT"&&s.ok===!1&&(o="failed");let u="";try{u=JSON.stringify(s).slice(0,200)}catch{}r.push({label:i,variant:o,suffix:l,title:u})}else((a=t.awaiting)==null?void 0:a.subNodeId)===i&&r.push({label:i,variant:"waiting",suffix:" ⏳",title:`subflow awaiting decision at ${i}`})}return r.length===0?g.jsx("span",{className:"text-fg-dim",children:"—"}):g.jsx("div",{className:"flex flex-wrap items-center gap-0.5",children:r.map((i,s)=>g.jsxs("span",{className:"flex items-center gap-0.5",children:[g.jsxs(mn,{variant:i.variant,size:"sm",title:i.title,children:[i.label,i.suffix??""]}),s<r.length-1&&g.jsx("span",{className:"text-fg-dim text-[10px] mx-0.5",children:"❯"})]},s))})}function jU({entries:t,subSteps:e}){if(!t.length)return null;const r=new Map;for(const[,a]of t){const i=hU(a,e),s=r.get(i);s?s.count++:r.set(i,{count:1,sample:a})}const n=[...r.values()].sort((a,i)=>i.count-a.count);return n.length===1?g.jsxs("div",{className:"flex items-center gap-2 mb-3 text-[11px] font-mono",children:[g.jsxs("span",{className:"text-fg-dim",children:["all ",n[0].count," took:"]}),g.jsx(uc,{subflow:n[0].sample,subSteps:e})]}):g.jsxs("div",{className:"mb-3",children:[g.jsxs("div",{className:"text-fg-dim font-mono text-[11px] mb-1.5",children:[r.size," distinct paths:"]}),g.jsx("div",{className:"grid gap-1",children:n.map((a,i)=>g.jsxs("div",{className:"flex items-center gap-2 py-0.5",children:[g.jsxs("span",{className:"min-w-[30px] text-right text-fg-dim text-[11px] font-mono",children:[a.count,"×"]}),g.jsx(uc,{subflow:a.sample,subSteps:e})]},i))})]})}function _I({transcript:t,isOpen:e,onToggle:r,hideItemKey:n}){const{nodeId:a,itemKey:i,turns:s,startedAt:o}=t;return g.jsxs("div",{className:"border border-border rounded",children:[g.jsxs("button",{onClick:r,className:"w-full flex items-center gap-3 px-2 py-1.5 text-left hover:bg-bg-elev2 min-w-0",children:[g.jsx("span",{className:"text-fg-dim font-mono text-xs w-4 shrink-0",children:e?"▾":"▸"}),g.jsx("span",{className:"font-mono text-sm flex-1 min-w-0 truncate",children:a}),!n&&i&&g.jsxs("span",{className:"font-mono text-fg-dim text-xs truncate hidden sm:inline",children:["· ",i]}),g.jsxs("span",{className:"font-mono text-fg-dim text-xs whitespace-nowrap shrink-0",children:[s.length," turn",s.length===1?"":"s"]}),g.jsx("span",{className:"text-fg-dim text-xs whitespace-nowrap shrink-0 hidden md:inline",children:vn(o)})]}),e&&g.jsx("div",{className:"border-t border-border p-3 grid gap-3",children:s.length===0?g.jsx("div",{className:"text-fg-dim italic text-xs",children:"(empty session)"}):s.map((l,u)=>g.jsx(IU,{turn:l},u))})]})}function IU({turn:t}){const e=t.role==="user";return g.jsxs("div",{className:"grid grid-cols-[68px_1fr] gap-2 min-w-0",children:[g.jsx("span",{className:qe("font-mono text-[11px] uppercase tracking-[0.5px] pt-0.5",e?"text-accent":"text-status-green"),children:t.role}),g.jsxs("div",{className:"min-w-0",children:[t.thinking&&g.jsxs("details",{className:"mb-1",children:[g.jsxs("summary",{className:"text-fg-dim text-xs cursor-pointer hover:text-fg",children:["thinking (",t.thinking.length," chars)"]}),g.jsx("pre",{className:"text-xs text-fg-dim whitespace-pre-wrap break-words bg-bg-elev2/40 rounded p-2 mt-1 max-h-64 overflow-auto",children:t.thinking})]}),g.jsx("pre",{className:"text-sm whitespace-pre-wrap break-words font-sans",children:t.text}),t.truncated&&g.jsx("div",{className:"text-fg-dim italic text-xs mt-1",children:"…truncated at 8KB on the server"})]})]})}function NI({value:t,label:e,defaultOpen:r=!1}){return g.jsx(Z0,{value:t,label:e,defaultOpen:r})}function Z0({value:t,label:e,defaultOpen:r=!1}){const[n,a]=Z.useState(r);if(t==null)return g.jsxs("div",{className:"font-mono text-fg-dim text-xs",children:[g.jsxs("span",{children:[e,":"]})," null"]});if(Array.isArray(t))return g.jsxs("details",{open:n,"data-state-key":e,onToggle:o=>{o.target===o.currentTarget&&a(o.currentTarget.open)},className:"my-0.5",children:[g.jsxs("summary",{className:"cursor-pointer select-none text-fg-dim font-mono text-xs hover:text-fg",children:[g.jsx("span",{children:e})," ",g.jsxs("span",{className:"text-fg-dim",children:["[",t.length,"]"]})]}),n&&g.jsxs("div",{className:"ml-[14px] border-l border-border pl-2",children:[t.slice(0,50).map((o,l)=>g.jsx(Z0,{value:o,label:String(l)},l)),t.length>50&&g.jsxs("div",{className:"text-fg-dim font-mono",children:["… ",t.length-50," more"]})]})]});if(typeof t=="object"){const o=Object.keys(t);return g.jsxs("details",{open:n,"data-state-key":e,onToggle:l=>{l.target===l.currentTarget&&a(l.currentTarget.open)},className:"my-0.5",children:[g.jsxs("summary",{className:"cursor-pointer select-none text-fg-dim font-mono text-xs hover:text-fg",children:[g.jsx("span",{children:e})," ",g.jsx("span",{className:"text-fg-dim",children:`{${o.length}}`})]}),n&&g.jsx("div",{className:"ml-[14px] border-l border-border pl-2",children:o.map(l=>g.jsx(Z0,{value:t[l],label:l},l))})]})}const i=typeof t=="string"?`"${t}"`:String(t),s=i.length>200?i.slice(0,197)+"…":i;return g.jsxs("div",{className:"font-mono text-xs",title:i,children:[g.jsxs("span",{className:"text-fg-dim",children:[e,":"]})," ",g.jsx("span",{className:qe("text-fg"),children:s})]})}function MU({subflows:t,pipeline:e,transcripts:r}){const n=t;if(!n||typeof n!="object"||Object.keys(n).length===0)return null;let a=0;const i=Object.entries(n);for(const[,s]of i)a+=s?Object.keys(s).length:0;return g.jsxs(Me,{children:[g.jsxs(Qe,{children:[g.jsx("h3",{className:"text-sm font-semibold m-0",children:"subflows"}),g.jsxs("span",{className:"text-fg-dim font-mono text-xs",children:[a," total across ",i.length," group(s)"]})]}),i.map(([s,o])=>g.jsx(DU,{groupId:s,subflows:o??{},pipeline:e,transcripts:r},s))]})}function DU({groupId:t,subflows:e,pipeline:r,transcripts:n}){const[a,i]=Z.useState(null),[s,o]=Z.useState(null),l=Object.entries(e);if(l.length===0)return null;const u=l.map(([p,y])=>y),c=r==null?void 0:r.nodes.find(p=>p.id===t),d=pU(c,u),f=l.filter(([p,y])=>(y==null?void 0:y.step)==="__end__"&&!(y!=null&&y.failedAt)).length,h=l.filter(([p,y])=>y==null?void 0:y.failedAt).length,v=l.filter(([p,y])=>y==null?void 0:y.awaiting).length,x=l.length-f-h-v,b=d.map(p=>({key:p,label:p,count:l.filter(([y,w])=>LU(w,p,d)).length})),m=[...l].sort(([p,y],[w,E])=>eN(y)-eN(E));return g.jsxs("div",{className:"mb-[18px]",children:[g.jsxs(Qe,{className:"mb-2",children:[g.jsx("h3",{className:"text-[13px] font-semibold font-mono m-0",children:t}),g.jsxs("span",{className:"text-fg-dim font-mono text-xs",children:[l.length," subflow",l.length===1?"":"s"," · ",f," done · ",v," awaiting · ",h," failed · ",x," running"]})]}),g.jsx(jU,{entries:l,subSteps:d}),g.jsx("div",{className:"grid grid-cols-[200px_1fr_40px] gap-x-2.5 gap-y-1 font-mono text-xs mb-3",children:b.map(p=>{const y=`${(p.count/Math.max(1,l.length)*100).toFixed(1)}%`;return g.jsxs(Z.Fragment,{children:[g.jsx("span",{className:"text-fg-dim",children:p.label}),g.jsx("div",{className:"relative h-3 bg-bg-elev2 rounded-[2px] overflow-hidden",children:g.jsx("div",{className:"absolute top-0 left-0 bottom-0",style:{width:y,background:"linear-gradient(90deg, #1f6feb, #58a6ff)"}})}),g.jsx("span",{className:"text-right text-fg-dim",children:p.count})]},p.key)})}),g.jsx("div",{className:"sm:hidden flex flex-col gap-1.5 text-xs",children:m.map(([p,y])=>{var T,_,N;const w=Y0(y),E=(y==null?void 0:y.data)??{},S=y!=null&&y.failedAt?(((_=(T=y.errorEntries)==null?void 0:T[y.errorEntries.length-1])==null?void 0:_.message)??"").slice(0,80):(N=E.DRAFT)!=null&&N._error?`DRAFT: ${String(E.DRAFT._error).slice(0,80)}`:"",C=p.length>32?p.slice(0,29)+"…":p,k=a===p;return g.jsxs("div",{className:"rounded border border-border bg-bg-elev2/30",children:[g.jsxs("button",{type:"button",onClick:()=>{i(k?null:p),o(null)},className:"block w-full text-left px-2.5 py-2 hover:bg-bg-elev2","aria-expanded":k,children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(mn,{variant:tN(w),children:w}),g.jsx("span",{className:"font-mono truncate flex-1",title:p,children:C}),g.jsx("span",{className:"text-[10px] text-fg-dim shrink-0",children:vn((y==null?void 0:y.updatedAt)??null)}),g.jsx("span",{className:"text-[10px] text-fg-dim",children:k?"▾":"▸"})]}),g.jsx("div",{className:"mt-1.5",children:g.jsx(uc,{subflow:y,subSteps:d})}),S&&g.jsx("div",{className:"mt-1 text-fg-dim text-[11px] break-words",children:S})]}),k&&g.jsx(aN,{subflowId:p,subflow:y,groupId:t,transcripts:n,openTranscriptKey:s,onToggleTranscript:P=>o(s===P?null:P)})]},p)})}),g.jsx("div",{className:"hidden sm:block",children:g.jsxs(ei,{className:"text-xs",children:[g.jsx(ti,{children:g.jsxs(yr,{children:[g.jsx(We,{className:"w-4"}),g.jsx(We,{children:"subflow"}),g.jsx(We,{children:"path"}),g.jsx(We,{children:"status"}),g.jsx(We,{children:"updated"}),g.jsx(We,{children:"error"})]})}),g.jsx(ri,{children:m.map(([p,y])=>{var T,_,N;const w=Y0(y),E=(y==null?void 0:y.data)??{},S=y!=null&&y.failedAt?(((_=(T=y.errorEntries)==null?void 0:T[y.errorEntries.length-1])==null?void 0:_.message)??"").slice(0,60):(N=E.DRAFT)!=null&&N._error?`DRAFT: ${String(E.DRAFT._error).slice(0,60)}`:"",C=p.length>28?p.slice(0,25)+"…":p,k=a===p;return g.jsxs(Z.Fragment,{children:[g.jsxs(yr,{className:"cursor-pointer hover:bg-bg-elev2",onClick:()=>{i(k?null:p),o(null)},children:[g.jsx(He,{className:"text-fg-dim font-mono",children:k?"▾":"▸"}),g.jsx(He,{className:"font-mono text-xs",title:p,children:C}),g.jsx(He,{children:g.jsx(uc,{subflow:y,subSteps:d})}),g.jsx(He,{children:g.jsx(mn,{variant:tN(w),children:w})}),g.jsx(He,{className:"text-fg-dim font-mono",children:vn((y==null?void 0:y.updatedAt)??null)}),g.jsx(He,{className:"text-fg-dim text-xs",children:S})]}),k&&g.jsx(yr,{children:g.jsx(He,{colSpan:6,className:"!p-0",children:g.jsx(aN,{subflowId:p,subflow:y,groupId:t,transcripts:n,openTranscriptKey:s,onToggleTranscript:P=>o(s===P?null:P)})})})]},p)})})]})})]})}function aN({subflowId:t,subflow:e,groupId:r,transcripts:n,openTranscriptKey:a,onToggleTranscript:i}){const s=(e==null?void 0:e.data)??{},o=Object.entries(s),l=(e==null?void 0:e.errorEntries)??[],u=(n??[]).filter(c=>c.itemKey===t);return g.jsxs("div",{className:"border-t border-border bg-bg-elev2/20 px-3 py-3 grid gap-3",children:[g.jsxs("div",{children:[g.jsx("div",{className:"text-fg-dim text-[11px] uppercase tracking-[0.5px] mb-1.5",children:"sub-step outputs"}),o.length===0?g.jsx("div",{className:"text-fg-dim italic text-xs",children:"(no sub-step data yet)"}):g.jsx("div",{className:"grid gap-0.5",children:o.map(([c,d])=>g.jsx(NI,{value:d,label:c},c))})]}),l.length>0&&g.jsxs("div",{children:[g.jsx("div",{className:"text-fg-dim text-[11px] uppercase tracking-[0.5px] mb-1.5",children:"errors"}),g.jsx("div",{className:"grid gap-1",children:l.map((c,d)=>g.jsxs("pre",{className:"text-xs text-status-red whitespace-pre-wrap break-words bg-bg-elev2/40 rounded p-2",children:[c.nodeId,": ",c.message]},d))})]}),g.jsxs("div",{children:[g.jsxs("div",{className:"text-fg-dim text-[11px] uppercase tracking-[0.5px] mb-1.5",children:["transcripts ",u.length>0&&g.jsxs("span",{className:"text-fg-dim normal-case tracking-normal",children:["· ",u.length," session",u.length===1?"":"s"]})]}),n===null?g.jsx("div",{className:"text-fg-dim italic text-xs",children:"loading…"}):u.length===0?g.jsxs("div",{className:"text-fg-dim italic text-xs",children:["no subagent sessions matched (itemKey=",t,", group=",r,")"]}):g.jsx("div",{className:"grid gap-1.5",children:u.map(c=>g.jsx(_I,{transcript:c,isOpen:a===c.session,onToggle:()=>i(c.session),hideItemKey:!0},c.session))})]})]})}function LU(t,e,r){if(!t)return!1;if(t.data&&e in t.data)return!0;if(t.step==="__end__")return t.data?e in t.data:!1;const n=r.indexOf(t.step??""),a=r.indexOf(e);return n>=0&&a>=0&&n>=a}function BU({compare:t,run:e}){if(!t||t.peerCount===0)return null;const r=sr(t.durationMs),n=sr(t.durationMedianMs),a=t.durationRatio;let i="bg-bg-elev2 text-fg-dim",s="≈";return a!=null&&(a<.85?(i="bg-status-green/15 text-status-green",s=`${Math.round((1-a)*100)}% faster`):a>1.15?(i="bg-status-red/15 text-status-red",s=`${Math.round((a-1)*100)}% slower`):s="near median"),g.jsxs(Me,{children:[g.jsx(Qe,{children:g.jsxs(tt,{children:["this run vs ",t.peerCount," prior succeeded runs of ",e.pipelineId]})}),g.jsxs("div",{className:"grid gap-3 grid-cols-[repeat(auto-fit,minmax(150px,1fr))]",children:[g.jsx(iN,{label:"duration",value:r,children:g.jsxs("div",{className:"text-xs text-fg-dim font-mono",children:["median ",n," · ",g.jsx("span",{className:qe("inline-block px-2 py-px rounded-[10px] font-mono text-[11px]",i),children:s})]})}),g.jsx(iN,{label:"revisions",value:String(t.revision),children:g.jsxs("div",{className:"text-xs text-fg-dim font-mono",children:["median ",t.revisionMedian??"?"]})})]})]})}function iN({label:t,value:e,children:r}){return g.jsxs("div",{className:"bg-bg-elev border border-border rounded-md px-[14px] py-3",children:[g.jsx("div",{className:"text-fg-dim text-[11px] uppercase tracking-[0.5px]",children:t}),g.jsx("div",{className:"font-mono text-2xl font-semibold leading-tight mt-0.5",children:e}),r]})}function OU({flowId:t,transcripts:e}){const[r,n]=Z.useState(null),[a,i]=Z.useState(null),[s,o]=Z.useState(null),l=e!==void 0,u=l?e:r;Z.useEffect(()=>{if(l)return;let d=!1;return n(null),i(null),st.runTranscripts(t).then(f=>{d||n(f)}).catch(f=>{d||i((f==null?void 0:f.message)??String(f))}),()=>{d=!0}},[t,l]);const c=Z.useMemo(()=>{if(!u)return new Map;const d=new Map;for(const f of u){const h=d.get(f.agent)??[];h.push(f),d.set(f.agent,h)}return d},[u]);return g.jsxs(Me,{children:[g.jsxs(Qe,{children:[g.jsx(tt,{children:"transcripts"}),u&&g.jsx("span",{className:"font-mono text-xs text-fg-dim",children:u.length===0?"no subagent sessions for this flow":`${u.length} session${u.length===1?"":"s"} across ${c.size} agent${c.size===1?"":"s"}`})]}),a&&g.jsx("div",{className:"text-status-red text-sm",children:a}),!u&&!a&&g.jsx("div",{className:"text-fg-dim italic text-sm",children:"loading…"}),u&&u.length===0&&g.jsx("div",{className:"text-fg-dim italic text-sm",children:"This flow didn't spawn any subagent sessions, or the sessions don't match the manifold default pattern."}),u&&u.length>0&&g.jsx("div",{className:"grid gap-3",children:[...c.entries()].map(([d,f])=>g.jsxs("div",{className:"border border-border rounded p-2 bg-bg-elev2/30",children:[g.jsxs("div",{className:"flex items-center gap-2 mb-2 flex-wrap",children:[g.jsx(mn,{variant:"kind",children:d}),g.jsxs("span",{className:"text-fg-dim text-xs font-mono",children:[f.length," session",f.length===1?"":"s"]})]}),g.jsx("div",{className:"grid grid-cols-1 gap-1",children:f.map(h=>g.jsx(_I,{transcript:h,isOpen:s===h.session,onToggle:()=>o(s===h.session?null:h.session)},h.session))})]},d))})]})}function qU(t){return typeof t=="string"?t:t&&typeof t=="object"&&typeof t.id=="string"?t.id:null}function FU(t){if(t&&typeof t=="object"){const e=t;if(typeof e.reason=="string")return e.reason;if(typeof e.hint=="string")return e.hint}return null}function $U(t){if(!t||typeof t!="object")return{allowed:!1,initial:""};const e=t,r=typeof e.text=="string",n=e.editable===!0;return{allowed:r||n,initial:r?e.text:""}}function zU({flowId:t,pending:e}){const[r,n]=Z.useState(null),[a,i]=Z.useState({}),[s,o]=Z.useState(null),[l,u]=Z.useState(null);if(!e||e.length===0)return null;async function c(d,f,h){n(`${d}:${f}`),u(null);try{await st.approve(t,{itemId:d,decision:f,text:h})}catch(v){u(v instanceof Error?v.message:String(v))}finally{n(null)}}return g.jsxs("div",{className:"mt-3 border-t border-border pt-3",children:[g.jsx("div",{className:"text-fg-dim text-xs uppercase tracking-[0.5px] mb-2",children:"act on pending items"}),l&&g.jsx("div",{className:"text-status-red text-sm mb-2",children:l}),g.jsx("div",{className:"grid gap-2",children:e.map((d,f)=>{const h=qU(d);if(!h)return g.jsxs("div",{className:"text-fg-dim text-xs italic",children:["(skipped: pending entry without `id` — ",JSON.stringify(d).slice(0,80),")"]},f);const v=FU(d),x=s===h,b=$U(d),m=h in a?a[h]:b.initial;return g.jsxs("div",{className:"border border-border rounded p-2 bg-bg-elev2/30",children:[g.jsxs("div",{className:"flex items-center gap-3 flex-wrap min-w-0",children:[g.jsx("span",{className:"font-mono text-sm flex-1 min-w-0 truncate",children:h}),g.jsx(ra,{variant:"chip",onClick:()=>c(h,"approve"),disabled:r!==null,className:qe("text-status-green border-status-green/40 hover:bg-status-green/10",r===`${h}:approve`&&"opacity-60"),children:r===`${h}:approve`?"approving…":"approve"}),g.jsx(ra,{variant:"chip",onClick:()=>c(h,"reject"),disabled:r!==null,className:qe("text-status-red border-status-red/40 hover:bg-status-red/10",r===`${h}:reject`&&"opacity-60"),children:r===`${h}:reject`?"rejecting…":"reject"}),b.allowed&&g.jsx(ra,{variant:"chip",onClick:()=>o(x?null:h),disabled:r!==null,children:x?"cancel edit":"edit…"})]}),v&&g.jsx("div",{className:"text-fg-dim text-xs mt-1",children:v}),b.allowed&&x&&g.jsxs("div",{className:"mt-2 grid gap-2",children:[g.jsx("textarea",{value:m,onChange:p=>i({...a,[h]:p.target.value}),placeholder:"Edited text (replaces the agent's output for this item)",rows:Math.min(12,Math.max(4,m.split(`
|
|
371
|
+
`).length+1)),className:"bg-bg-elev border border-border rounded px-2 py-1 text-sm font-mono w-full min-w-0"}),g.jsx("div",{children:g.jsx(ra,{variant:"chip",onClick:()=>c(h,"edit",m),disabled:r!==null||!m.trim(),className:"text-accent border-accent/40 hover:bg-accent/10",children:r===`${h}:edit`?"submitting…":"submit edit"})})]})]},h)})})]})}const VU=4e3;function UU({flowId:t}){const[e,r]=Z.useState("idle"),[n,a]=Z.useState(null),i=Z.useRef(null);Z.useEffect(()=>()=>{i.current!=null&&window.clearTimeout(i.current)},[]);function s(){r("armed"),a(null),i.current!=null&&window.clearTimeout(i.current),i.current=window.setTimeout(()=>r("idle"),VU)}async function o(){i.current!=null&&window.clearTimeout(i.current),r("busy");try{await st.cancel(t)}catch(l){a(l instanceof Error?l.message:String(l)),r("idle")}}return g.jsxs("div",{className:"flex items-center gap-2",children:[n&&g.jsx("span",{className:"text-status-red text-xs",children:n}),g.jsx(ra,{variant:"chip",onClick:e==="armed"?o:s,disabled:e==="busy",className:qe("text-status-red border-status-red/40 hover:bg-status-red/10",e==="armed"&&"bg-status-red/15 border-status-red/60",e==="busy"&&"opacity-60"),children:e==="busy"?"cancelling…":e==="armed"?"click again to confirm":"cancel run"})]})}function GU({flowId:t}){const[e,r]=Z.useState(!1),[n,a]=Z.useState(null);async function i(){r(!0),a(null);try{const s=await st.rerun(t);window.location.hash=`#/runs/${s.flowId}`}catch(s){a(s instanceof Error?s.message:String(s)),r(!1)}}return g.jsxs("div",{className:"flex items-center gap-2",children:[n&&g.jsx("span",{className:"text-status-red text-xs",children:n}),g.jsx(ra,{variant:"chip",onClick:i,disabled:e,className:qe("text-accent border-accent/40 hover:bg-accent/10",e&&"opacity-60"),children:e?"starting…":"re-run"})]})}function HU({flowId:t}){const[e,r]=Z.useState(null),[n,a]=Z.useState(null),[i,s]=Z.useState([]),[o,l]=Z.useState([]),[u,c]=Z.useState(null),[d,f]=Z.useState(null),[h,v]=Z.useState(null),[x,b]=Z.useState(null),[m,p]=Z.useState(null),[y,w]=Z.useState(null),E=async()=>{try{const S=await st.run(t);r(S),w(null),S.pipelineId&&(!n||n.id!==S.pipelineId)&&st.pipeline(S.pipelineId).then(a).catch(()=>a(null)),st.runEvents(t).then(C=>s(C.slice().reverse())).catch(()=>s([])),st.runArtifacts(t).then(l).catch(()=>l([])),st.runTranscripts(t).then(c).catch(()=>c([])),st.runCompare(t).then(f).catch(()=>f(null)),st.runCost(t).then(v).catch(()=>v(null)),st.runSubflows(t).then(b).catch(()=>b(null)),st.runTree(t).then(C=>p(C.items)).catch(()=>p(null))}catch(S){w(S instanceof Error?S.message:String(S))}};return Z.useEffect(()=>{E()},[t]),Tc(S=>{!("flowId"in S)||S.flowId!==t||(s(C=>[S,...C]),S.kind!=="run.created"&&E())}),y?g.jsxs(g.Fragment,{children:[g.jsx("a",{href:"#/",className:"text-fg-dim",children:"← runs"}),g.jsx("p",{className:"text-status-red mt-2",children:y})]}):e?g.jsxs(g.Fragment,{children:[g.jsx("a",{href:"#/",className:"text-fg-dim",children:"← runs"}),g.jsxs("div",{className:"flex items-center justify-between gap-3 mt-2 mb-4 flex-wrap",children:[g.jsxs("h1",{className:"font-mono text-lg font-semibold break-all min-w-0",children:[t,g.jsx(wu,{value:t,label:"copy flowId",className:"ml-2"})]}),(e.status==="running"||e.status==="blocked")&&g.jsx(UU,{flowId:t}),(e.status==="succeeded"||e.status==="failed"||e.status==="cancelled")&&g.jsx(GU,{flowId:t})]}),g.jsx(Me,{children:g.jsxs("dl",{className:"grid grid-cols-[100px_1fr] sm:grid-cols-[140px_1fr] gap-y-1 gap-x-3 text-sm",children:[g.jsx("dt",{className:"text-fg-dim",children:"pipeline"}),g.jsxs("dd",{children:[g.jsx("a",{href:`#/pipelines/${encodeURIComponent(e.pipelineId??"")}`,className:"font-mono",children:e.pipelineId??"?"}),e.pipelineId&&g.jsx(wu,{value:e.pipelineId,label:"copy pipelineId",className:"ml-2"})]}),g.jsx("dt",{className:"text-fg-dim",children:"status"}),g.jsx("dd",{children:g.jsx(is,{status:e.status})}),g.jsx("dt",{className:"text-fg-dim",children:"current step"}),g.jsx("dd",{className:"font-mono",children:e.currentStep??"?"}),g.jsx("dt",{className:"text-fg-dim",children:"revision"}),g.jsx("dd",{className:"font-mono text-fg-dim",children:e.revision}),g.jsx("dt",{className:"text-fg-dim",children:"runId"}),g.jsxs("dd",{className:"font-mono text-fg-dim text-xs break-all",children:[e.runId??"?",e.runId&&g.jsx(wu,{value:e.runId,label:"copy runId",className:"ml-2"})]}),h&&h.total>0&&g.jsxs(g.Fragment,{children:[g.jsx("dt",{className:"text-fg-dim",children:"cost"}),g.jsxs("dd",{className:"font-mono",title:`models: ${Object.keys(h.byModel).join(", ")} · sessions: ${h.bySession.length}`,children:["$",h.total.toFixed(4),g.jsxs("span",{className:"text-fg-dim text-xs ml-2",children:[h.bySession.length," session",h.bySession.length===1?"":"s"," · ",(h.tokens.input+h.tokens.output+h.tokens.cacheRead).toLocaleString()," tokens"]})]})]}),g.jsx("dt",{className:"text-fg-dim",children:"created"}),g.jsx("dd",{className:"text-fg-dim",children:vn(e.createdAt)}),g.jsx("dt",{className:"text-fg-dim",children:"updated"}),g.jsx("dd",{className:"text-fg-dim",children:vn(e.updatedAt)}),e.endedAt&&g.jsxs(g.Fragment,{children:[g.jsx("dt",{className:"text-fg-dim",children:"ended"}),g.jsx("dd",{className:"text-fg-dim",children:vn(e.endedAt)})]})]})}),g.jsx(BU,{compare:d,run:e}),e.waitJson&&g.jsxs(Me,{children:[g.jsx(Qe,{children:g.jsxs(tt,{children:["waiting on ",e.waitJson.kind??"?"]})}),g.jsxs("dl",{className:"grid grid-cols-[100px_1fr] sm:grid-cols-[140px_1fr] gap-y-1 gap-x-3 text-sm",children:[g.jsx("dt",{className:"text-fg-dim",children:"node"}),g.jsx("dd",{className:"font-mono",children:e.waitJson.nodeId??"?"}),e.waitJson.reason&&g.jsxs(g.Fragment,{children:[g.jsx("dt",{className:"text-fg-dim",children:"reason"}),g.jsx("dd",{children:e.waitJson.reason})]}),Array.isArray(e.waitJson.needed)&&e.waitJson.needed.length>0&&g.jsxs(g.Fragment,{children:[g.jsx("dt",{className:"text-fg-dim",children:"needed"}),g.jsx("dd",{children:e.waitJson.needed.map(S=>g.jsx("kbd",{className:"font-mono bg-bg-elev2 border border-border px-1.5 rounded text-xs mr-1",children:S},S))})]}),e.waitJson.hint&&g.jsxs(g.Fragment,{children:[g.jsx("dt",{className:"text-fg-dim",children:"hint"}),g.jsx("dd",{children:e.waitJson.hint})]}),Array.isArray(e.waitJson.pending)&&e.waitJson.pending.length>0&&g.jsxs(g.Fragment,{children:[g.jsx("dt",{className:"text-fg-dim",children:"pending"}),g.jsx("dd",{children:e.waitJson.pending.map((S,C)=>{const k=typeof S=="string"?S:S==null?void 0:S.id,T=typeof k=="string"?k:`(unnamed-${C})`;return g.jsx("kbd",{className:"font-mono bg-bg-elev2 border border-border px-1.5 rounded text-xs mr-1",children:T},`${T}-${C}`)})})]})]}),Array.isArray(e.waitJson.pending)&&e.waitJson.pending.length>0&&g.jsx(zU,{flowId:t,pending:e.waitJson.pending})]}),g.jsxs(Me,{children:[g.jsxs(Qe,{children:[g.jsx(tt,{children:"graph"}),g.jsxs("span",{className:"text-fg-dim font-mono text-xs",children:["current: ",e.currentStep??"?"]})]}),n&&g.jsx(TI,{pipeline:n,run:e,tree:m}),g.jsx(AU,{history:m==null?void 0:m.map(S=>S.nodeId)})]}),g.jsx(MU,{subflows:x,pipeline:n,transcripts:u}),g.jsx(OU,{flowId:t,transcripts:u}),g.jsxs("div",{className:"flex flex-col lg:flex-row gap-3 lg:gap-5",children:[g.jsxs("div",{className:"flex-1 min-w-0",children:[g.jsxs(Me,{children:[g.jsx(Qe,{children:g.jsx(tt,{children:"state"})}),g.jsx(NI,{value:e.stateJson,label:"state",defaultOpen:!0})]}),g.jsxs(Me,{children:[g.jsx(Qe,{children:g.jsx(tt,{children:"errors"})}),(e.errorEntries??[]).length===0?g.jsx("div",{className:"text-fg-dim italic",children:"none"}):g.jsx("div",{children:(e.errorEntries??[]).slice(-30).map((S,C)=>g.jsxs("div",{className:"py-1 border-b border-dashed border-border last:border-b-0",children:[g.jsx("span",{className:"font-mono text-fg-dim",children:S.nodeId})," ",S.message]},C))})]})]}),g.jsxs("div",{className:"flex-1 min-w-0",children:[g.jsxs(Me,{children:[g.jsx(Qe,{children:g.jsx(tt,{children:"events"})}),i.length===0?g.jsx("div",{className:"text-fg-dim italic",children:"none yet — events accrue while the dashboard is running"}):g.jsx("div",{className:"font-mono text-xs max-h-96 overflow-auto",children:i.map((S,C)=>g.jsxs("div",{className:"grid grid-cols-[56px_90px_1fr] sm:grid-cols-[80px_110px_1fr] gap-2 py-1 border-b border-dashed border-border last:border-b-0",children:[g.jsx("span",{className:"text-fg-dim",children:vn(S.at).split(" ")[1]??""}),g.jsx("span",{className:S.kind==="run.ended"?"text-status-green":S.kind==="run.created"?"text-status-amber":"text-accent",children:S.kind}),g.jsx("span",{children:WU(S)})]},C))})]}),g.jsxs(Me,{children:[g.jsx(Qe,{children:g.jsx(tt,{children:"artifacts"})}),o.length===0?g.jsx("div",{className:"text-fg-dim italic",children:"none"}):o.map(S=>g.jsxs("div",{className:"flex justify-between py-1",children:[g.jsx("a",{href:cB(t,S.name),target:"_blank",rel:"noreferrer",className:"font-mono",children:S.name}),g.jsx("span",{className:"text-fg-dim",children:QL(S.size)})]},S.name))]})]})]})]}):g.jsxs(g.Fragment,{children:[g.jsx("a",{href:"#/",className:"text-fg-dim",children:"← runs"}),g.jsx(ge,{className:"h-6 w-80 mt-2 mb-4"}),g.jsx(Me,{children:g.jsx("div",{className:"grid grid-cols-[100px_1fr] sm:grid-cols-[140px_1fr] gap-y-2 gap-x-3",children:[0,1,2,3,4].map(S=>g.jsxs(Z.Fragment,{children:[g.jsx(ge,{className:"h-3 w-20"}),g.jsx(ge,{className:"h-3 w-3/4"})]},S))})}),g.jsxs(Me,{children:[g.jsx(ge,{className:"h-4 w-32 mb-3"}),[0,1,2,3].map(S=>g.jsx(ge,{className:"h-3 w-full mb-2"},S))]}),g.jsxs(Me,{children:[g.jsx(ge,{className:"h-4 w-40 mb-3"}),g.jsx(ge,{className:"h-40 w-full"})]})]})}function WU(t){var e,r;switch(t.kind){case"run.created":return`created at ${t.currentStep??"?"} (${t.status})`;case"run.ended":return`terminated (${t.status})`;case"run.updated":{const n=t.prevStep!==t.currStep?`step ${t.prevStep??"?"} → ${t.currStep??"?"}`:`rev ${t.revision}`,a=t.prevStatus!==t.currStatus?` · ${t.prevStatus} → ${t.currStatus}`:"",i=(e=t.stateKeysAdded)!=null&&e.length||(r=t.stateKeysRemoved)!=null&&r.length?` · keys ${(t.stateKeysAdded??[]).map(o=>`+${o}`).join(" ")} ${(t.stateKeysRemoved??[]).map(o=>`-${o}`).join(" ")}`:"",s=t.waitKind?` · ${t.waitKind}`:"";return`${n}${a}${i}${s}`}case"pipeline.catalog.updated":return`pipelines: ${t.ids.join(", ")}`}}function KU(t){if(!t)return"";const e=Date.now()-t;return e<6e4?`${Math.floor(e/1e3)}s ago`:e<36e5?`${Math.floor(e/6e4)}m ago`:e<864e5?`${Math.floor(e/36e5)}h ago`:`${Math.floor(e/864e5)}d ago`}function YU(){const t=window.location.hash||"",e=t.indexOf("?");if(e<0)return{q:"",status:""};const r=new URLSearchParams(t.slice(e+1));return{q:r.get("q")??"",status:r.get("status")??""}}function XU({q:t,status:e}){const r=new URLSearchParams;t&&r.set("q",t),e&&r.set("status",e);const n=r.toString()?`#/search?${r.toString()}`:"#/search";window.location.hash!==n&&window.history.replaceState(null,"",n)}function ZU(){const t=YU(),[e,r]=Z.useState(t.q),[n,a]=Z.useState(t.q),[i,s]=Z.useState(t.status),[o,l]=Z.useState(null),[u,c]=Z.useState(!1),[d,f]=Z.useState(null),h=Z.useRef(null);return Z.useEffect(()=>{const v=setTimeout(()=>a(e.trim()),200);return()=>clearTimeout(v)},[e]),Z.useEffect(()=>{if(XU({q:n,status:i}),!n&&!i){l(null),f(null);return}c(!0),f(null);let v=!1;return st.search(n,{limit:100,status:i}).then(x=>{v||l(x)}).catch(x=>{v||f((x==null?void 0:x.message)??String(x))}).finally(()=>{v||c(!1)}),()=>{v=!0}},[n,i]),Z.useEffect(()=>{var v;(v=h.current)==null||v.focus()},[]),g.jsxs(g.Fragment,{children:[g.jsx("h1",{className:"font-mono mt-2 text-lg font-semibold",children:"search"}),g.jsxs(Me,{children:[g.jsx("input",{ref:h,type:"search",value:e,onChange:v=>r(v.target.value),placeholder:"search errors, state, IDs… (e.g. 'shortlist budget' — all tokens must match)",className:"w-full bg-bg border border-border rounded px-3 py-2 text-sm font-mono outline-none focus:border-accent",autoComplete:"off"}),i&&g.jsxs("div",{className:"mt-2 flex items-center gap-2 text-xs font-mono",children:[g.jsx("span",{className:"text-fg-dim",children:"status:"}),g.jsxs("span",{className:"inline-flex items-center gap-1.5 bg-bg-elev2 text-fg border border-border rounded-[10px] px-2 py-0.5",children:[i,g.jsx("button",{type:"button",onClick:()=>s(""),className:"text-fg-dim hover:text-fg","aria-label":"clear status filter",title:"clear status filter",children:"×"})]})]}),g.jsx(QU,{})]}),d&&g.jsx("p",{className:"text-status-red text-sm",children:d}),!n&&!i&&!d&&g.jsx("p",{className:"italic text-fg-dim text-sm",children:"enter a query to begin."}),(n||i)&&u&&!o&&g.jsx("div",{className:"space-y-2 mt-2",children:[0,1,2,3].map(v=>g.jsxs(Me,{className:"mb-0",children:[g.jsx(ge,{className:"h-3 w-40 mb-2"}),g.jsx(ge,{className:"h-3 w-full mb-1"}),g.jsx(ge,{className:"h-3 w-2/3"})]},v))}),o&&g.jsx(JU,{result:o})]})}function QU(){return g.jsx("p",{className:"text-xs text-fg-dim mt-2",children:"Tokens must all appear (AND). Searched: flowId, pipelineId, status, currentStep, statusReason, goal, waitJson hint/reason, state.errors[*], and top-level state.* values. Not searched (yet): agent transcripts."})}function JU({result:t}){const e=Z.useMemo(()=>{if(t.totalHits===0)return"no matches.";const r=t.hits.length,n=t.totalHits;return t.truncated?`${r} of ${n} matches (showing most-recent ${r}). refine to narrow.`:`${n} match${n===1?"":"es"}.`},[t]);return g.jsxs(Me,{children:[g.jsx(Qe,{children:g.jsxs(tt,{children:["results — ",e]})}),t.hits.length===0?g.jsx("p",{className:"italic text-fg-dim text-sm",children:"try a shorter query, drop a token, or check for typos."}):g.jsx("ul",{className:"flex flex-col gap-3",children:t.hits.map(r=>g.jsxs("li",{className:"border border-border rounded p-2 cursor-pointer hover:bg-bg-elev2",onClick:()=>{window.location.hash=`#/runs/${r.flowId}`},children:[g.jsxs("div",{className:"flex flex-wrap items-baseline gap-x-3 gap-y-1 text-sm",children:[g.jsxs(jP,{value:r.flowId,label:"copy flowId",className:"font-mono text-fg",children:[r.flowId.slice(0,12),"…"]}),g.jsx(is,{status:r.status}),r.pipelineId&&g.jsx("a",{href:`#/pipelines/${encodeURIComponent(r.pipelineId)}`,onClick:n=>n.stopPropagation(),className:"font-mono text-xs text-fg-dim hover:text-fg hover:underline",children:r.pipelineId}),r.currentStep&&g.jsxs("span",{className:"font-mono text-xs text-fg-dim",children:["@ ",r.currentStep]}),g.jsx("span",{className:"text-xs text-fg-dim ml-auto",children:KU(r.updatedAt)})]}),g.jsxs("ul",{className:"mt-2 flex flex-col gap-1",children:[r.matches.slice(0,5).map((n,a)=>g.jsxs("li",{className:"font-mono text-xs leading-snug",children:[g.jsxs("span",{className:"text-fg-dim",children:[n.field,":"]})," ",g.jsx("span",{className:"text-fg",children:n.snippet})]},a)),r.matches.length>5&&g.jsxs("li",{className:"text-xs text-fg-dim italic",children:["… ",r.matches.length-5," more match",r.matches.length-5===1?"":"es"," in this run."]})]})]},r.flowId))})]})}function e6(){const[t,e]=Z.useState(()=>window.location.hash||"#/");return Z.useEffect(()=>{const r=()=>e(window.location.hash||"#/");return window.addEventListener("hashchange",r),()=>window.removeEventListener("hashchange",r)},[]),t}function t6(){const t=e6(),e=Z.useMemo(()=>{const r=t.match(/^#\/runs\/([0-9a-f-]+)$/i);if(r)return g.jsx(HU,{flowId:r[1]});const n=t.match(/^#\/pipelines\/(.+)$/);return n?g.jsx(wU,{pipelineId:decodeURIComponent(n[1])}):t.startsWith("#/pipelines")?g.jsx(pB,{}):t.startsWith("#/search")?g.jsx(ZU,{}):g.jsx(hB,{})},[t]);return g.jsx(vL,{children:g.jsx(WL,{children:e})})}My.createRoot(document.getElementById("root")).render(g.jsx(eM.StrictMode,{children:g.jsx(t6,{})}));
|