-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathMainView-D-8DMXyg.js
More file actions
1 lines (1 loc) · 1.92 KB
/
MainView-D-8DMXyg.js
File metadata and controls
1 lines (1 loc) · 1.92 KB
1
import{g as f,L as g,c as i,u as E,_ as x}from"./GraphProduct.vue_vue_type_script_setup_true_lang-Be2tnCUz.js";import{T as v,U as C,d as p,V as w,C as d,I as N,c as S,o as n,a as T,t as L,W as h,z as r,u as t,y as c,w as l,b as u,X as A,Y as F,A as R,B as b,e as k}from"./index-8aSAdiyM.js";import"./index-izglcM0V.js";import"./Button.vue_vue_type_script_setup_true_lang-Dszf8U0K.js";import"./Icon.vue_vue_type_script_setup_true_lang-wQn8swOT.js";const y=g.filter(a=>a!==v&&a!==C),B=a=>f(a.nodes,y),I={persistentStorageKey:"network-flow",userAddedEdgeLabel:"5",userAddedEdgeRuleNoSelfLoops:!0,userAddedEdgeRuleOneEdgePerPath:!0,edgeInputToLabel:a=>{const o=Number(a);return!isNaN(o)&&o>=0&&o<100?a:void 0}},G={class:"flex gap-3 text-white"},V={class:"font-bold text-xl"},W=p({__name:"FordFulkersonOutput",setup(a){const{output:o}=w(d.value),s=N(()=>o.maxFlow.value);return(_,e)=>(n(),S("div",G,[T("span",V,"Max Flow "+L(s.value??"Unknown"),1)]))}}),$={class:"flex gap-3"},O=p({__name:"SourceSinkControls",setup(a){const{sourceNode:o,sinkNode:s}=h;return(_,e)=>(n(),S("div",$,[t(o).isSetting.value?(n(),r(i,{key:0,onClick:t(o).cancelSet,color:t(c).RED_500,"text-color":t(c).WHITE},{default:l(()=>e[2]||(e[2]=[u(" Cancel ")])),_:1,__:[2]},8,["onClick","color","text-color"])):(n(),r(i,{key:1,onClick:e[0]||(e[0]=m=>t(o).set(t(d)))},{default:l(()=>e[3]||(e[3]=[u(" Switch Source ")])),_:1,__:[3]})),t(s).isSetting.value?(n(),r(i,{key:2,onClick:t(s).cancelSet,color:t(c).RED_500,"text-color":t(c).WHITE},{default:l(()=>e[4]||(e[4]=[u(" Cancel ")])),_:1,__:[4]},8,["onClick","color","text-color"])):(n(),r(i,{key:3,onClick:e[1]||(e[1]=m=>t(s).set(t(d)))},{default:l(()=>e[5]||(e[5]=[u(" Switch Sink ")])),_:1,__:[5]}))]))}}),M=p({__name:"MainView",setup(a){const o=E(I),{graph:s}=o;s.settings.value.newNodeLabelGetter=B(s);const{activate:_}=A(s),{stylize:e}=F(s);return _(),e(),(m,P)=>(n(),r(x,R(b(t(o))),{"top-center":l(()=>[k(W),k(O)]),_:1},16))}});export{M as default};