@visuallyjs/browser-ui-vue 1.2.7 → 1.2.8

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/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"@visuallyjs/browser-ui-vue","version":"1.2.7","description":"VisuallyJS Vue integration","module":"visuallyjs.browser-ui-vue.es.js","main":"visuallyjs.browser-ui-vue.cjs.js","types":"index.d.ts","files":["visuallyjs.browser-ui-vue.es.js","visuallyjs.browser-ui-vue.cjs.js","**/*.d.ts"],"author":"VisuallyJs <hello@visuallyjs.com> (https://visuallyjs.com)","license":"Commercial","dependencies":{"@visuallyjs/browser-ui":"1.2.7"},"homepage":"https://visuallyjs.com/vue","bugs":"https://github.com/visuallyjs/visuallyjs/issues"}
1
+ {"name":"@visuallyjs/browser-ui-vue","version":"1.2.8","description":"VisuallyJS Vue integration","module":"visuallyjs.browser-ui-vue.es.js","main":"visuallyjs.browser-ui-vue.cjs.js","types":"index.d.ts","files":["visuallyjs.browser-ui-vue.es.js","visuallyjs.browser-ui-vue.cjs.js","**/*.d.ts"],"author":"VisuallyJs <hello@visuallyjs.com> (https://visuallyjs.com)","license":"Commercial","dependencies":{"@visuallyjs/browser-ui":"1.2.8"},"homepage":"https://visuallyjs.com/vue","bugs":"https://github.com/visuallyjs/visuallyjs/issues"}
@@ -1,4 +1,4 @@
1
- import { Inspector } from "@visuallyjs/browser-ui";
1
+ import { Vertex, Inspector } from "@visuallyjs/browser-ui";
2
2
  import { InspectorProviderState } from "./inspector-component";
3
3
  /**
4
4
  * Inspector for the properties of a shape.
@@ -20,9 +20,13 @@ declare const ShapePropertiesInspectorComponent: {
20
20
  };
21
21
  data(): {
22
22
  inspector: Inspector | null;
23
+ inspectorRevision: number;
24
+ inspectorChangeListener: (() => void) | null;
23
25
  };
24
26
  mounted(): void;
27
+ beforeUnmount(): void;
25
28
  methods: {
29
+ getPropertyDisplayValue(prop: any, vertex: Vertex): string;
26
30
  resolveShapeDef(): import("@visuallyjs/browser-ui").RealisedShapeType;
27
31
  };
28
32
  render(): any;
@@ -1 +1 @@
1
- var et=Object.defineProperty,gr=Object.defineProperties,yr=Object.getOwnPropertyDescriptor,Cr=Object.getOwnPropertyDescriptors,Tr=Object.getOwnPropertyNames,Yo=Object.getOwnPropertySymbols;var Zo=Object.prototype.hasOwnProperty,_r=Object.prototype.propertyIsEnumerable;var Xo=(e,t,r)=>t in e?et(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Z=(e,t)=>{for(var r in t||(t={}))Zo.call(t,r)&&Xo(e,r,t[r]);if(Yo)for(var r of Yo(t))_r.call(t,r)&&Xo(e,r,t[r]);return e},ye=(e,t)=>gr(e,Cr(t));var Sr=(e,t)=>{for(var r in t)et(e,r,{get:t[r],enumerable:!0})},vr=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Tr(t))!Zo.call(e,s)&&s!==r&&et(e,s,{get:()=>t[s],enumerable:!(o=yr(t,s))||o.enumerable});return e};var Rr=e=>vr(et({},"__esModule",{value:!0}),e);var Wr={};Sr(Wr,{$initialiseVueOverlays:()=>Qe,AreaChartComponent:()=>Ot,BackgroundComponent:()=>Wo,BarChartComponent:()=>mt,BaseOverlayComponent:()=>Io,BrowserUIVueModel:()=>D,BubbleChartComponent:()=>gt,CLASS_VUE_GROUP:()=>yo,CLASS_VUE_NODE:()=>go,CLASS_VUE_OVERLAY:()=>Co,COMPONENT_AREA_CHART:()=>$e,COMPONENT_BACKGROUND:()=>Ae,COMPONENT_BAR_CHART:()=>ke,COMPONENT_BUBBLE_CHART:()=>Ke,COMPONENT_COLUMN_CHART:()=>je,COMPONENT_CONTROLS:()=>Be,COMPONENT_DIAGRAM:()=>Ue,COMPONENT_DIAGRAM_PALETTE:()=>Ge,COMPONENT_DIAGRAM_PROVIDER:()=>So,COMPONENT_EDGE_PROPERTY_MAPPINGS_INSPECTOR:()=>Ze,COMPONENT_EXPORT_CONTROLS:()=>Le,COMPONENT_GAUGE_CHART:()=>Je,COMPONENT_GRID_BACKGROUND:()=>xe,COMPONENT_IMAGE_BACKGROUND:()=>De,COMPONENT_INSPECTOR:()=>Xe,COMPONENT_LINE_CHART:()=>He,COMPONENT_MINIVIEW:()=>be,COMPONENT_PALETTE:()=>Ve,COMPONENT_PAPER:()=>we,COMPONENT_PAPER_PROVIDER:()=>_o,COMPONENT_PIE_CHART:()=>We,COMPONENT_SANKEY_CHART:()=>Ye,COMPONENT_SCATTER_CHART:()=>ze,COMPONENT_SHAPE_PROPERTIES_INSPECTOR:()=>qe,COMPONENT_SURFACE:()=>Me,COMPONENT_SURFACE_POPUP:()=>vo,COMPONENT_SURFACE_PROVIDER:()=>To,COMPONENT_TILED_IMAGE_BACKGROUND:()=>Ie,COMPONENT_XY_CHART:()=>Fe,ColorPickerComponent:()=>$o,ColumnChartComponent:()=>dt,ControlsComponent:()=>Go,DEFAULT_SHAPE_HEIGHT:()=>Oo,DEFAULT_SHAPE_WIDTH:()=>Po,DEFAULT_VUE_PAPER_ID:()=>jt,DEFAULT_VUE_SURFACE_ID:()=>Gt,DecoratorComponent:()=>xt,DiagramComponent:()=>Fo,DiagramPaletteComponent:()=>It,DiagramProvider:()=>Dt,EVENT_VERTEX_UPDATED:()=>er,EVENT_VERTICES_RENDERED:()=>pt,EdgePropertyMappingsInspectorComponent:()=>Mt,EdgeTypePickerComponent:()=>he,ExportControlsComponent:()=>jo,GaugeChartComponent:()=>yt,GridBackgroundComponent:()=>zo,ImageBackgroundComponent:()=>Ko,InspectorComponent:()=>Nt,InspectorGetterSymbol:()=>F,InspectorSetterSymbol:()=>lr,LineChartComponent:()=>Pt,MiniviewComponent:()=>ko,PROP_ACTIVE_TRACKING:()=>$t,PROP_ALLOW_CLICK_TO_ADD:()=>po,PROP_ALLOW_DROP_ON_CANVAS:()=>oo,PROP_ALLOW_DROP_ON_EDGE:()=>to,PROP_ALLOW_DROP_ON_GROUP:()=>ro,PROP_ALLOW_DROP_ON_NODE:()=>no,PROP_ALLOW_ROTATION:()=>co,PROP_AUTO_EDGE_CONNECT:()=>mo,PROP_CANVAS_DROP_FILTER:()=>fo,PROP_CLASS_NAME:()=>q,PROP_CLICK_TO_ADD_ONLY:()=>lo,PROP_CLICK_TO_CENTER:()=>Ft,PROP_CSV_DATA:()=>rt,PROP_DATA:()=>I,PROP_DATA_GENERATOR:()=>qt,PROP_DATA_SOURCE_FILTER:()=>ot,PROP_DATA_TYPE:()=>Se,PROP_DRAG_SIZE:()=>ho,PROP_GROUP_IDENTIFIER:()=>eo,PROP_ID:()=>Ar,PROP_IGNORE_DROP_ON_NODE:()=>io,PROP_INTERACTIVE:()=>Jt,PROP_JSON_DATA:()=>nt,PROP_MODE:()=>Kt,PROP_MODEL:()=>Te,PROP_MODEL_OPTIONS:()=>Q,PROP_ON_VERTEX_ADDED:()=>so,PROP_OPTIONS:()=>K,PROP_PAPER_ID:()=>zt,PROP_PIVOT:()=>Yt,PROP_RENDER_OPTIONS:()=>Ce,PROP_ROTATION_SPEED:()=>uo,PROP_SELECTOR:()=>Zt,PROP_SELECT_AFTER_ADD:()=>ao,PROP_SHOW_LASSO:()=>Ht,PROP_SURFACE_ID:()=>H,PROP_TRACK_SELECTION:()=>Wt,PROP_TYPE_FUNCTION:()=>kt,PROP_TYPE_GENERATOR:()=>Qt,PROP_URL:()=>R,PROP_USE_MODEL:()=>Xt,PROP_VIEW_OPTIONS:()=>_e,PaletteComponent:()=>Ho,PaperComponent:()=>Vo,PaperProvider:()=>_t,PieChartComponent:()=>ft,SankeyChartComponent:()=>Ct,ScatterChartComponent:()=>Et,ShapeComponent:()=>St,ShapePaletteComponent:()=>Rt,ShapePropertiesInspectorComponent:()=>Bt,SurfaceComponent:()=>wo,SurfacePopup:()=>bt,SurfaceProvider:()=>Tt,TAG_COLOR_PICKER:()=>Eo,TAG_DECORATOR:()=>Ro,TAG_EDGE_TYPE_PICKER:()=>Ne,TAG_SHAPE:()=>ve,TAG_SHAPE_PALETTE:()=>Re,TiledImageBackgroundComponent:()=>Jo,VisuallyJsPlugin:()=>Gr,VisuallyJsService:()=>w,VisuallyJsServiceKey:()=>p,XYChartComponent:()=>ht,addPaper:()=>Mo,addSurface:()=>bo,bindToDevLifecycle:()=>xr,doProvideInspector:()=>pr,newInstance:()=>Nr,useDiagram:()=>Hr,usePaper:()=>$r,useSurface:()=>Fr,useVisuallyJsUpdate:()=>kr,useZoom:()=>jr,vertexHasRendered:()=>No,vertexHasUpdated:()=>Ao,vertexWillRender:()=>tr});module.exports=Rr(Wr);var tt=require("@visuallyjs/browser-ui"),D=class extends tt.BrowserUIModel{render(t,r){return(0,tt.log)("render called directly on BrowserUiVue class: should not happen. Surface component should use internal render."),null}};function Nr(e){return e=e||{},new D(e)}var Gt="surfaceId",jt="paperId",kt="typeFunction",Ft="clickToCenter",Ht="showLasso",$t="activeTracking",Wt="trackSelection",H="surfaceId",zt="paperId",q="className",I="data",Kt="mode",K="options",Ce="renderOptions",Q="modelOptions",Te="model",_e="viewOptions",R="url",Se="dataType",Jt="interactive",Yt="pivot",ot="dataSourceFilter",rt="csvData",nt="jsonData",Xt="useModel",Ar="id",Zt="selector",qt="dataGenerator",Qt="typeGenerator",eo="groupIdentifier",to="allowDropOnEdge",oo="allowDropOnCanvas",ro="allowDropOnGroup",no="allowDropOnNode",io="ignoreDropOnNode",so="onVertexAdded",ao="selectAfterAdd",lo="clickToAddOnly",po="allowClickToAdd",co="allowRotation",uo="rotationSpeed",mo="autoEdgeConnect",ho="dragSize",fo="canvasDropFilter",ve="Shape",Re="ShapePalette",Po=120,Oo=90,Ne="EdgeTypePickerComponent",Eo="ColorPickerComponent",go="vjs-vue-node",yo="vjs-vue-group",Co="vjs-vue-overlay",Ae="BackgroundComponent",xe="GridBackgroundComponent",De="ImageBackgroundComponent",Ie="TiledImageBackgroundComponent",be="MiniviewComponent",Me="SurfaceComponent",To="SurfaceProvider",we="PaperComponent",_o="PaperProvider",So="DiagramProvider",Ve="PaletteComponent",Be="ControlsComponent",Le="ExportControlsComponent",Ue="DiagramComponent",Ge="DiagramPaletteComponent",je="ColumnChartComponent",ke="BarChartComponent",Fe="XYChartComponent",He="LineChartComponent",$e="AreaChartComponent",We="PieChartComponent",ze="ScatterChartComponent",Ke="BubbleChartComponent",Je="GaugeChartComponent",Ye="SankeyChartComponent",Xe="InspectorComponent",Ze="EdgePropertyMappingsInspector",vo="SurfacePopup",Ro="Decorator",qe="ShapePropertiesInspectorComponent";var $=require("@visuallyjs/browser-ui"),it={props:{data:Object,model:D,obj:$.Vertex,vertex:$.Vertex,ui:$.BrowserUI,el:Element,def:Object,eventInfo:Object},mounted(){let e=this,t=(0,$.isGroup)(e.vertex)?yo:go;e.el.firstElementChild&&(0,$.addClass)(e.el.firstElementChild,t),e.ui.$vertexRendered(e.vertex,e.el,e.def,e.eventInfo),No(e.ui.id,e.vertex)},methods:{getModel:function(){return this.model},removeVertex:function(){this.model.remove(this.vertex)}},updated(){this.ui.$revalidateElement(this.el),Ao(this.ui.id,this.vertex)}};var qo={mixins:[it],methods:{getNode:function(){return this.obj},removeNode:function(){this.model.removeNode(this.getNode())},updateNode:function(e){this.model.updateNode(this.obj,e);let t=this.ui.getRenderedElement(this.obj.getFullId());this.ui.$revalidateElement(t)}}};var Qo={methods:{getGroup:function(){return this.obj},removeGroup:function(e){this.model.removeGroup(this.obj,e)},updateGroup:function(e){this.model.updateGroup(this.obj,e);let t=this.ui.getRenderedElement(this.obj.getFullId());this.ui.$revalidateElement(t)}},mixins:[it]};var b=require("vue"),d=require("@visuallyjs/browser-ui"),xo=class{constructor(){this.unrenderedVertices=new Map;this.eventManager=new d.OptimisticEventGenerator;this.hasRendered=!1}vertexWillRender(t){this.unrenderedVertices.set(t.id,t),this.hasRendered=!1}vertexHasRendered(t){this.unrenderedVertices.delete(t.id),this.unrenderedVertices.size===0&&(this.hasRendered=!0,this.eventManager.fire(pt))}vertexHasUpdated(t){this.eventManager.fire(er,t)}},pt="vertices:rendered",er="vertex:updated",Do=new Map;function st(e){return Do.has(e)||Do.set(e,new xo),Do.get(e)}function No(e,t){st(e).vertexHasRendered(t)}function Ao(e,t){st(e).vertexHasUpdated(t)}function tr(e,t){st(e).vertexWillRender(t)}function xr(e,t,r){let o=st(e);o&&(o.eventManager.bind(t,r),t===pt&&o.hasRendered&&o.eventManager.fire(pt))}var at=(e,t)=>{t.parentNode&&t.parentNode.removeChild(t)},Io={props:{data:Object,model:D,obj:d.Edge,edge:d.Edge,overlay:d.Overlay,ui:d.BrowserUI,el:Element,def:Object,eventInfo:Object},mounted(){let e=this;e.el.firstElementChild&&(0,d.addClass)(e.el.firstElementChild,Co)},updated(){this.ui.$revalidateElement(this.el)}},lt=(e,t,r,o,s,c,n,l,a)=>{let f=n.component!=null,h=(0,d.isGroup)(l),T=[];f||T.push(h?d.CLASS_DEFAULT_GROUP:d.CLASS_DEFAULT_NODE);let y=f?n.component:{render(v){return v.data.label||""}};if(y){let v=document.createElement(d.ELEMENT_DIV);(0,d.updateClasses)(v,T),y.mixins==null&&(y.mixins=[]);let x=h?Qo:qo;y.mixins.find(k=>k===x)||y.mixins.push(x),tr(c.id,l);let ie={data:r,model:(0,b.markRaw)(o),ui:(0,b.markRaw)(c),obj:(0,b.markRaw)(l),vertex:(0,b.markRaw)(l),el:v,def:(0,b.markRaw)(n),eventInfo:a==null?null:(0,b.markRaw)(a)};if(n.inject)for(let k in n.inject){let X=n.inject[k],Er=typeof X=="function"?X(l,o):X;ie[k]=Er}e.push({component:(0,b.markRaw)(y),el:v,t:l.getFullId(),props:ie,vertex:l})}};function bo(e,t,r,o,s,c){let n={reactive:!0,asynchronous:!0,usesWrapperElement:!1,update:(a,f,h,T)=>{},render:(a,f,h,T,y,v,x,z)=>lt(o,a,f,h,T,y,v,x,z),cleanupVertex:at,cleanupPort:at,rerender:(a,f,h,T,y,v,x,z,ie)=>{let k=o.findIndex(X=>X.vertex===x);k!=null&&o.splice(k,1)[0].el,y.$__unmanage(ie,!0,!0),requestAnimationFrame(()=>{lt(o,a,f,h,T,y,v,x,z)})}},l=(0,d.extend)(s||{},{view:c||{},id:t});return(0,d.renderSurface)(e,r,n,l)}function Mo(e,t,r,o,s,c){let n={reactive:!0,asynchronous:!0,usesWrapperElement:!1,update:(a,f,h,T)=>{},render:(a,f,h,T,y,v,x,z)=>lt(o,a,f,h,T,y,v,x,z),cleanupVertex:at,cleanupPort:at,rerender:(a,f,h,T,y,v,x,z,ie)=>{let k=o.findIndex(X=>X.vertex===x);k!=null&&o.splice(k,1)[0].el,y.$__unmanage(ie,!0,!0),requestAnimationFrame(()=>{lt(o,a,f,h,T,y,v,x,z)})}},l=(0,d.extend)(s||{},{view:c||{},id:t});return(0,d.renderPaper)(e,r,n,l)}function Qe(e,t,r,o){if(e.edges)for(let s in e.edges){let c=e.edges[s];c.overlays&&(c.overlays=c.overlays.map(n=>{let l={};return n.component!=null?{type:d.OVERLAY_TYPE_CUSTOM,options:{create:f=>{let h=document.createElement(d.ELEMENT_DIV),T=(0,d.uuid)();n.component.mixins==null&&(n.component.mixins=[]),n.component.mixins.indexOf(Io)===-1&&n.component.mixins.push(Io);let y=Z({data:f.edge.data,model:(0,b.markRaw)(r()),ui:(0,b.markRaw)(t()),obj:f.edge,edge:f.edge,el:h,def:(0,b.markRaw)(n),eventInfo:null,overlay:n},l);return o.push({component:(0,b.markRaw)(n.component),el:h,t:T,props:y}),h}}}:n}))}}var ee=require("@visuallyjs/browser-ui"),se=require("vue"),p=Symbol.for("visuallyjs-service"),w=class{constructor(t){this.context=t;this.a=[];this.l=[];this.p=[];this.c=[];this.surface=(0,se.shallowRef)(null);this.model=(0,se.shallowRef)(null);this.paper=(0,se.shallowRef)(null);this.diagram=(0,se.shallowRef)(null);this.ui=(0,se.shallowRef)(null)}getSurface(t){this.r(this.l,t,this.u)}getDiagram(t){this.r(this.p,t,this.m)}getPaper(t){this.r(this.c,t,this.h)}getModel(t){this.r(this.a,t,this.i)}getModelDirect(){return this.i}r(t,r,o){if(o!=null)try{r(o)}catch(s){(0,ee.log)(`WARN: could not dispatch ${s}`)}else t.push(r)}setSurface(t){this.surface.value=t,this.model.value=t.model,this.ui.value=t,this.u=t,this.s(t.model),this.n(this.l,t)}setDiagram(t){this.diagram.value=t,this.model.value=t.model,this.ui.value=t.$ui,this.m=t,this.s(t.model),t.$ui instanceof ee.Surface?this.setSurface(t.$ui):t.$ui instanceof ee.Paper&&this.setPaper(t.$ui),this.n(this.p,t)}setPaper(t){this.paper.value=t,this.model.value=t.model,this.ui.value=t,this.h=t,this.s(t.model),this.n(this.c,t)}s(t){this.i=t,this.n(this.a,t)}n(t,r){t.forEach(o=>{try{o(r)}catch(s){(0,ee.log)(`WARN: could not flush all queue entries ${s}`)}})}};var V=require("vue"),O=require("@visuallyjs/browser-ui"),wo={setup(e){return{service:(0,V.inject)(p),surfaceId:e.surfaceId||Gt}},name:Me,props:{[I]:{type:Object},[Ce]:{type:Object},[Q]:{type:Object},[_e]:{type:Object},[Te]:{type:Object},[R]:{type:String},[Se]:{type:String},[H]:{type:String}},data:function(){return{vertices:[],overlays:[]}},mounted(){let e=this,t=this.model||new D(this.modelOptions||{}),r=this.$refs.root;e.e=!1;let o=(0,O.clone)(this.viewOptions||{});Qe(o,()=>this.surface,()=>t,this.overlays),this.surface=bo(t,this.surfaceId,r,this.vertices,(0,O.clone)(this.renderOptions||{}),o),this.service.setSurface(this.surface);let s=(n,l)=>{let a=()=>{let h={};return l.originalData||l.updates?h=Object.assign(l.originalData,l.updates):l.newData&&Object.assign(h,l.newData),h},f=this.vertices.find(h=>h.t===n);f!=null&&(f.props.data=a())},c=n=>{let l=this.vertices.findIndex(a=>a.t===n);l!==-1&&this.vertices.splice(l,1)};t.bind(O.EVENT_NODE_UPDATED,n=>{s(n.vertex.getFullId(),n)}),t.bind(O.EVENT_GROUP_UPDATED,n=>{s(n.vertex.getFullId(),n)}),t.bind(O.EVENT_NODE_REMOVED,n=>{c(n.node.id)}),t.bind(O.EVENT_GROUP_REMOVED,n=>{c(n.group.id)}),t.bind(O.EVENT_EDGE_UPDATED,n=>{let l=n.edge.id;this.overlays.forEach(a=>{a.props.edge&&a.props.edge.id===l&&(a.props.data=n.edge.data)})}),t.bind(O.EVENT_EDGE_REMOVED,n=>{let l=n.edge.id,a=this.overlays.length-1;for(;a>=0;)this.overlays[a].props.edge&&this.overlays[a].props.edge.id===l&&this.overlays.splice(a,1),a--}),t.bind(O.EVENT_GRAPH_CLEARED,()=>{this.vertices.length=0,this.overlays.length=0}),this.surface.bind(O.EVENT_RENDER_END,()=>setTimeout(()=>this.surface.$redrawEveryConnection())),e.url?t.load({url:e.url,dataType:e.dataType,onload:()=>e.e=!0}):e.data?t.load({data:e.data,dataType:e.dataType,onload:()=>e.e=!0}):e.e=!0},watch:{[I]:{handler(e){this.e!==!1&&this.surface&&this.surface.model&&(this.surface.model.clear(),requestAnimationFrame(()=>{this.surface.model.load({data:e,dataType:this.dataType})}))}},[R]:{handler(e){this.e!==!1&&this.surface&&this.surface.model&&(this.surface.model.clear(),requestAnimationFrame(()=>{this.surface.model.load({url:e,dataType:this.dataType})}))}}},render:function(){let e=this.vertices.map(t=>(0,V.h)(V.Teleport,{to:t.el,key:t.t},[(0,V.h)(t.component,t.props)]));return this.overlays.forEach(t=>{e.push((0,V.h)(V.Teleport,{to:t.el,key:t.t},[(0,V.h)(t.component,t.props)]))}),(0,V.h)(O.ELEMENT_DIV,{ref:"root",class:"vjs-vue-surface",style:{width:"100%",height:"100%"}},e.concat(this.$slots.hasOwnProperty("default")?this.$slots.default():[]))}};var B=require("vue"),E=require("@visuallyjs/browser-ui"),Vo={setup(e){return{service:(0,B.inject)(p),paperId:e.paperId||jt}},name:we,props:{[I]:{type:Object},[Ce]:{type:Object},[Q]:{type:Object},[_e]:{type:Object},[Te]:{type:Object},[R]:{type:String},[Se]:{type:String},[zt]:{type:String}},data:function(){return{vertices:[],overlays:[]}},mounted(){let e=this,t=this.model||new D(this.modelOptions||{}),r=this.$refs.root;e.e=!1;let o=(0,E.clone)(this.viewOptions||{});Qe(o,()=>this.paper,()=>t,this.overlays),this.paper=Mo(t,this.paperId,r,this.vertices,(0,E.clone)(this.renderOptions||{}),o),this.service.setPaper(this.paper);let s=(n,l)=>{let a=()=>{let h={};return l.originalData||l.updates?h=Object.assign(l.originalData,l.updates):l.newData&&Object.assign(h,l.newData),h},f=this.vertices.find(h=>h.t===n);f!=null&&(f.props.data=a())},c=n=>{let l=this.vertices.findIndex(a=>a.t===n);l!==-1&&this.vertices.splice(l,1)};t.bind(E.EVENT_NODE_UPDATED,n=>{s(n.vertex.getFullId(),n)}),t.bind(E.EVENT_GROUP_UPDATED,n=>{s(n.vertex.getFullId(),n)}),t.bind(E.EVENT_NODE_REMOVED,n=>{c(n.node.id)}),t.bind(E.EVENT_GROUP_REMOVED,n=>{c(n.group.id)}),t.bind(E.EVENT_EDGE_UPDATED,n=>{let l=n.edge.id;this.overlays.forEach(a=>{a.props.edge&&a.props.edge.id===l&&(a.props.data=n.edge.data)})}),t.bind(E.EVENT_EDGE_REMOVED,n=>{let l=n.edge.id,a=this.overlays.length-1;for(;a>=0;)this.overlays[a].props.edge&&this.overlays[a].props.edge.id===l&&this.overlays.splice(a,1),a--}),t.bind(E.EVENT_GRAPH_CLEARED,()=>{this.vertices.length=0,this.overlays.length=0}),this.paper.bind(E.EVENT_RENDER_END,()=>setTimeout(()=>this.paper.$redrawEveryConnection())),e.url?t.load({url:e.url,dataType:e.dataType,onload:()=>e.e=!0}):e.data?t.load({data:e.data,dataType:e.dataType,onload:()=>e.e=!0}):e.e=!0},watch:{[I]:{handler(e){this.e!==!1&&this.paper&&this.paper.model&&(this.paper.model.clear(),requestAnimationFrame(()=>{this.paper.model.load({data:e,dataType:this.dataType})}))}},[R]:{handler(e){this.e!==!1&&this.paper&&this.paper.model&&(this.paper.model.clear(),requestAnimationFrame(()=>{this.paper.model.load({url:e,dataType:this.dataType})}))}}},render:function(){let e=this.vertices.map(t=>(0,B.h)(B.Teleport,{to:t.el,key:t.t},[(0,B.h)(t.component,t.props)]));return this.overlays.forEach(t=>{e.push((0,B.h)(B.Teleport,{to:t.el,key:t.t},[(0,B.h)(t.component,t.props)]))}),(0,B.h)(E.ELEMENT_DIV,{ref:"root",class:"vjs-vue-paper",style:{width:"100%",height:"100%"}},e.concat(this.$slots.hasOwnProperty("default")?this.$slots.default():[]))}};var u=require("vue"),i=require("@visuallyjs/browser-ui"),Dr="Clear dataset?",Bo="vjs-selected-mode",Lo="can-undo",Uo="can-redo",Ir="data-undo",br="data-redo",or="data-mode",Mr="data-reset",wr="data-clear",Vr="data-zoom-in",Br="data-zoom-out",rr="vjs-controls-has-selection",Go={setup(e){return{service:(0,u.inject)(p)}},name:Be,props:{clear:{type:Boolean,default:!0},[H]:{type:String},undoRedo:{type:Boolean,default:!0},orientation:{type:String,default:"row"},zoomToExtents:{type:Boolean,default:!0},zoomButtons:{type:Boolean,default:!1},clearMessage:{type:String,default:Dr},onMaybeClear:{type:Function},className:{type:String,default:""}},methods:{panMode:function(){var e;(e=this.service.surface.value)==null||e.setMode(i.SURFACE_MODE_PAN)},selectMode:function(){var e;(e=this.service.surface.value)==null||e.setMode(i.SURFACE_MODE_SELECT)},zoomToFit:function(){var e;(e=this.service.surface.value)==null||e.zoomToFit()},doClear:function(){let e=this.service.surface.value;e&&(this.onMaybeClear!=null?this.onMaybeClear(()=>e.model.clear()):window.confirm(this.clearMessage)&&e.model.clear())},undo:function(){var e;(e=this.service.model.value)==null||e.undo()},redo:function(){var e;(e=this.service.model.value)==null||e.redo()},zoomIn:function(){var e;(e=this.service.surface.value)==null||e.zoomIn()},zoomOut:function(){var e;(e=this.service.surface.value)==null||e.zoomOut()},resetSelection(){let e=this.service.surface.value;e&&(e.model.clearSelection(),(0,i.supportsPathEditing)(e)&&e.stopEditingPath())},updateSelectionState:function(){let e=this.service.surface.value;e&&(e.model.getSelection().isEmpty()?this.$refs.root.removeAttribute(rr):this.$refs.root.setAttribute(rr,"true"))}},data:function(){return{ready:!1,hasLasso:!1}},render(){if(this.ready){let e=[];return this.showPan&&(e.push((0,u.h)("i",{class:`vjs-pan-mode ${Bo}`,[or]:i.SURFACE_MODE_PAN,onClick:()=>this.panMode(),title:"Pan mode"},[(0,u.h)("svg",{viewBox:i.PAN_VIEW_BOX,stroke:"currentColor",fill:"none"},[(0,u.h)("path",{d:i.PAN_PATH})])])),e.push((0,u.h)("i",{class:"vjs-select-mode",[or]:i.SURFACE_MODE_SELECT,onClick:()=>this.selectMode(),title:"Select mode"},[(0,u.h)("svg",{viewBox:i.LASSO_VIEW_BOX,stroke:"currentColor",fill:"currentColor"},[(0,u.h)("path",{d:i.LASSO_PATH})])]))),this.undoRedo&&(e.push((0,u.h)("i",{class:"vjs-undo",[Ir]:!0,title:"Undo last action",onClick:()=>this.undo()},[(0,u.h)("svg",{viewBox:i.UNDO_VIEW_BOX,stroke:"currentColor",fill:"none"},[(0,u.h)("path",{d:i.UNDO_PATH,"stroke-width":2})])])),e.push((0,u.h)("i",{class:"vjs-redo",[br]:!0,title:"Redo last action",onClick:()=>this.redo()},[(0,u.h)("svg",{viewBox:i.REDO_VIEW_BOX,stroke:"currentColor",fill:"none"},[(0,u.h)("path",{d:i.REDO_PATH,"stroke-width":2})])]))),this.zoomToExtents&&e.push((0,u.h)("i",{class:"vjs-zoom-to-fit",[Mr]:"true",onClick:()=>this.zoomToFit(),title:"Zoom to Fit"},[(0,u.h)("svg",{viewBox:i.ZOOM_TO_FIT_VIEW_BOX,stroke:"currentColor",fill:"currentColor"},[(0,u.h)("path",{d:i.ZOOM_TO_FIT_PATH})])])),this.zoomButtons&&(e.push((0,u.h)("i",{class:"vjs-zoom-in",[Vr]:"true",onClick:()=>this.zoomIn(),title:"Zoom In"},[(0,u.h)("svg",{viewBox:i.ZOOM_IN_OUT_VIEW_BOX,stroke:"currentColor",fill:"currentColor"},[(0,u.h)("path",{d:i.ZOOM_IN_PATH})])])),e.push((0,u.h)("i",{class:"vjs-zoom-out",[Br]:"true",onClick:()=>this.zoomOut(),title:"Zoom Out"},[(0,u.h)("svg",{viewBox:i.ZOOM_IN_OUT_VIEW_BOX,stroke:"currentColor",fill:"currentColor"},[(0,u.h)("path",{d:i.ZOOM_OUT_PATH})])]))),e.push((0,u.h)("i",{class:i.CLASS_CONTROLS_RESET_SELECTION,[i.ATTRIBUTE_RESET_SELECTION]:"true",onClick:()=>{this.resetSelection()}},[(0,u.h)("svg",{viewBox:i.RESET_SELECTION_VIEW_BOX,stroke:"currentColor",fill:"currentColor"},[(0,u.h)("path",{d:i.RESET_SELECTION_PATH})])])),this.clear&&e.push((0,u.h)("i",{class:"vjs-clear-dataset",[wr]:"true",onClick:()=>{this.doClear()}},[(0,u.h)("svg",{viewBox:i.CLEAR_VIEW_BOX,stroke:"currentColor",fill:"currentColor"},[(0,u.h)("path",{d:i.CLEAR_PATH})])])),(0,u.h)(i.ELEMENT_DIV,{class:`vjs-controls ${this.className}`,ref:"root",[Lo]:!1,[Uo]:!1,[i.ATTRIBUTE_CONTROLS_ORIENTATION]:this.orientation},e)}else return(0,u.h)(i.ELEMENT_DIV,{ref:"root"})},mounted(){let e=t=>{let r=t.getPlugin(i.LassoPlugin.type);this.showPan=r!=null,t.bind(i.EVENT_SURFACE_MODE_CHANGED,o=>{t.removeClass(t.$getSelector(this.$refs.root,"[data-mode]"),Bo),t.addClass(t.$getSelector(this.$refs.root,"[data-mode='"+o+"']"),Bo)}),t.model.bind(i.EVENT_UNDOREDO_UPDATE,o=>{this.$refs.root.setAttribute(Lo,o.undoCount>0?i.TRUE:i.FALSE),this.$refs.root.setAttribute(Uo,o.redoCount>0?i.TRUE:i.FALSE)}),t.model.bind(i.EVENT_SELECT,()=>this.updateSelectionState()),t.model.bind(i.EVENT_DESELECT,()=>this.updateSelectionState()),t.model.bind(i.EVENT_SELECTION_CLEARED,()=>this.updateSelectionState()),this.$refs.root.setAttribute(Lo,i.FALSE),this.$refs.root.setAttribute(Uo,i.FALSE),this.ready=!0};this.service.surface.value==null?(0,u.watch)(this.service.surface,e):e(this.service.surface.value)}};var L=require("vue"),C=require("@visuallyjs/browser-ui"),jo={name:Le,setup(e){return{service:(0,L.inject)(p)}},props:{surfaceId:{type:String},showLabel:{type:Boolean,default:!0},label:{type:String,default:"Export :"},margins:{type:Object},svgOptions:{type:Object},imageOptions:{type:Object},allowSvgExport:{type:Boolean,default:!0},allowPngExport:{type:Boolean,default:!0},allowJpgExport:{type:Boolean,default:!0}},methods:{loadSurface:function(e){let t=this.service.surface.value;t&&e(t)},exportSVG:function(){this.loadSurface(e=>{let t=this.svgOptions||{};this.margins!=null&&t.margins==null&&Object.assign(t,this.margins),new C.SvgExportUI(e).export(t)})},exportJPG:function(){this.loadSurface(e=>{let t=this.imageOptions||{};this.margins!=null&&t.margins==null&&Object.assign(t,this.margins),t.type="image/jpeg",new C.ImageExportUI(e).export(t)})},exportPNG:function(){this.loadSurface(e=>{let t=this.imageOptions||{};this.margins!=null&&t.margins==null&&Object.assign(t,this.margins),new C.ImageExportUI(e).export(t)})}},render(){let e=this.showLabel!==!1,t=this.allowSvgExport!==!1,r=this.allowPngExport!==!1,o=this.allowJpgExport!==!1,s=[];return t&&s.push((0,L.h)("i",{},[(0,L.h)("a",{href:"#","data-type":C.TYPE_SVG,onClick:()=>this.exportSVG()},"SVG")])),r&&s.push((0,L.h)("i",{},[(0,L.h)("a",{href:"#","data-type":C.TYPE_PNG,onClick:()=>this.exportPNG()},"PNG")])),o&&s.push((0,L.h)("i",{},[(0,L.h)("a",{href:"#","data-type":C.TYPE_JPG,onClick:()=>this.exportJPG()},"JPG")])),e&&s.unshift((0,L.h)("span",{},[this.label])),(0,L.h)(C.ELEMENT_DIV,{class:`${C.CLASS_CONTROLS} ${C.CLASS_EXPORT_CONTROLS}`},s)}};var te=require("vue"),ct=require("@visuallyjs/browser-ui"),ko={setup(e){return{service:(0,te.inject)(p)}},name:be,props:{[H]:{type:String},[q]:{type:String,default:""},[$t]:{type:Boolean,default:!0},[Ft]:{type:Boolean,default:!0},[Ht]:{type:Boolean,default:!0},[Wt]:{type:Boolean,default:!0},[kt]:{type:Function}},mounted:function(){let e=t=>{t.addPlugin({type:ct.MiniviewPlugin.type,options:{container:this.$el,activeTracking:this.activeTracking,clickToCenter:this.clickToCenter,showLasso:this.showLasso,trackSelection:this.trackSelection,typeFunction:this.typeFunction}})};this.service.surface.value!=null&&e(this.service.surface.value),this.service.paper.value!=null?e(this.service.paper.value):((0,te.watch)(this.service.surface,e),(0,te.watch)(this.service.paper,e))},render:function(e){return(0,te.h)(ct.ELEMENT_DIV,{ref:"root",class:e.className})}};var ae=require("vue"),ut=require("@visuallyjs/browser-ui"),Fo={setup(e){return{service:(0,ae.inject)(p)}},name:Ue,props:{[I]:{type:Object},[R]:{type:String},[Q]:{type:Object},[K]:{type:Object}},mounted(){let e=this.$refs.root;this.diagram=(0,ae.markRaw)((0,ut.createDiagram)(e,this.options,this.modelOptions)),this.service.setDiagram(this.diagram),this.data?this.diagram.load({data:this.data}):this.url&&this.diagram.load({url:this.url})},render:function(){return(0,ae.h)(ut.ELEMENT_DIV,{ref:"root",class:"vjs-vue-surface",style:{width:"100%",height:"100%"}},this.$slots.hasOwnProperty("default")?this.$slots.default():[])}};var oe=require("vue"),P=require("@visuallyjs/browser-ui"),nr={[q]:{type:String},[I]:{type:Object},[R]:{type:String},[Xt]:{type:Boolean,default:!1}},ir={setup(){return{service:(0,oe.inject)(p)}},render:function(){return(0,oe.h)(P.ELEMENT_DIV,{class:`${this.className}`,ref:"root"})}};function W(e,t,r=!0){let o=ye(Z({},nr),{[K]:{type:Object}}),s={[I]:function(n){this.chart&&this.chart.load({data:n})},[R]:function(n){this.chart&&this.chart.load({url:n})},[K]:{handler:function(){this.o()},deep:!0}};r&&(o[ot]={type:Function},s[ot]=function(n){this.chart.setDataSourceFilter(n)});let c={o:function(){this.chart&&this.chart.destroy();let n=this.$refs.root,l=r?Object.assign({dataSourceFilter:this.dataSourceFilter},this.options):this.options;this.data&&(l.data=this.data),this.url&&(l.url=this.url);let a=()=>{this.chart=new t(n,l)};if(this.useModel)if(this.service.model.value!=null)l.dataSource=this.service.model.value,a();else{let f=(0,oe.watch)(this.service.model,h=>{h!=null&&(l.dataSource=h,a(),f())})}else a()}};return ye(Z({},ir),{name:e,props:o,watch:s,data:()=>({hasMounted:!1}),methods:c,mounted(){this.o()}})}var dt=W(je,P.ColumnChart),mt=W(ke,P.BarChart),ht=W(Fe,P.CategoryValueChart,!1),ft=W(We,P.PieChart),Pt=W(He,P.LineChart),Ot=W($e,P.AreaChart),Et=W(ze,P.ScatterChart),gt=W(Ke,P.BubbleChart),yt=W(Je,P.GaugeChart,!1),Ct=ye(Z({},ir),{name:Ye,props:ye(Z({},nr),{[rt]:{type:String},[nt]:{type:Object},[Jt]:{type:Boolean},[Yt]:{type:String},[K]:{type:Object}}),data:()=>({chart:null}),methods:{o:function(){this.chart&&this.chart.destroy();let e=this.$refs.root,t=Object.assign({},this.options);this.interactive!=null&&(t.interactive=this.interactive),this.pivot!=null&&(t.pivot=this.pivot),this.csvData&&(t.csvData=this.csvData),this.jsonData&&(t.jsonData=this.jsonData),this.url&&(t.url=this.url);let r=()=>{this.chart=new P.SankeyChart(e,t)};if(this.useModel)if(this.service.model.value==null){let o=(0,oe.watch)(this.service.model,s=>{s!=null&&(t.dataSource=s,r(),o())})}else t.dataSource=this.service.model.value,r();else r()}},mounted(){this.o()},watch:{pivot(e){this.chart&&this.chart.pivot(e)},[rt](e){this.chart&&this.chart.load({csvData:e})},[nt](e){this.chart&&this.chart.load({jsonData:e})},[R](e){this.chart&&this.chart.load({url:e})},[K]:{handler:function(){this.o()},deep:!0}}});var le=require("vue"),pe=require("@visuallyjs/browser-ui"),Ho={setup(e){return{service:(0,le.inject)(p)}},name:Ve,props:{[H]:{type:String},[Zt]:{type:String},[qt]:{type:Function},[Qt]:{type:Function},[eo]:{type:Function},[to]:{type:[Boolean,Function],default:!1},[oo]:{type:Boolean,default:!0},[ro]:{type:Boolean,default:!0},[no]:{type:Boolean,default:!1},[io]:{type:Boolean,default:!1},[ho]:Object,[so]:Function,[fo]:Function,[q]:String,[Kt]:String,[ao]:{type:Boolean,default:!1},[po]:{type:Boolean,default:!1},[lo]:{type:Boolean,default:!1},[co]:{type:Boolean,default:!0},[uo]:{type:Number,default:2e3},[mo]:{type:[Boolean,Object],default:!1}},mounted:function(){let e=t=>{let r={source:this.$refs.root,selector:this.selector,dataGenerator:o=>this.dataGenerator?this.dataGenerator(o):(0,pe.defaultDataGenerator)(o),allowDropOnEdge:this.allowDropOnEdge===!0,allowDropOnGroup:this.allowDropOnGroup!==!1,allowDropOnCanvas:this.allowDropOnCanvas!==!1,allowDropOnNode:this.allowDropOnNode===!0,ignoreDropOnNode:this.ignoreDropOnNode===!0,canvasDropFilter:this.canvasDropFilter,onVertexAdded:this.onVertexAdded,dragSize:this.dragSize,mode:this.mode,allowRotation:this.allowRotation!==!1,rotationSpeed:this.rotationSpeed||2e3,autoEdgeConnect:this.autoEdgeConnect};this.groupIdentifier!=null&&(r.groupIdentifier=this.groupIdentifier),this.typeGenerator!=null&&(r.typeGenerator=this.typeGenerator),this.palette=new pe.Palette(t,r)};this.service.surface.value==null?(0,le.watch)(this.service.surface,e):e(this.service.surface.value)},render:function(){return(0,le.h)(pe.ELEMENT_DIV,{ref:"root",class:this.className||""},this.$slots.hasOwnProperty("default")?this.$slots.default():[])}};var sr=require("vue"),Tt={setup(){(0,sr.provide)(p,new w("SurfaceProvider"))},render(){return this.$slots.hasOwnProperty("default")?this.$slots.default():[]}};var ar=require("vue"),_t={setup(){(0,ar.provide)(p,new w("PaperProvider"))},render(){return this.$slots.hasOwnProperty("default")?this.$slots.default():[]}};var ce=require("vue"),U=require("@visuallyjs/browser-ui"),St={name:ve,props:{data:{type:Object},showLabels:{type:Boolean,default:!1},labelProperty:{type:String,default:"label"},labelStrokeWidth:{type:Number},labelPosition:{type:Object,default:"center"},multilineLabels:{type:Boolean,default:!0},labelFillRatio:{type:Number,default:U.DEFAULT_LABEL_FILL_RATIO},labelColor:{type:String,default:"#000000"},font:{type:Object}},setup(){return{service:(0,ce.inject)(p)}},mounted(){let e=t=>{let r=t.getShapeLibrary(),o=r.renderCompiledShape(Object.assign({sw:this.getOutlineWidth()},this.data));if(this.$refs.container.appendChild(o),this.showLabels){let s=r.renderShapeLabel(this.data,this.labelProperty,this.labelStrokeWidth,null,this.labelColor,this.labelColor,this.font);this.$refs.container.appendChild(s),this.multilineLabels!=!1&&(0,U.convertToMultilineText)(s,this.data[this.labelProperty]||"",this.getWidth()*(this.labelFillRatio||U.DEFAULT_LABEL_FILL_RATIO),this.labelPosition)}};this.service.ui.value==null?(0,ce.watch)(this.service.ui,e):e(this.service.ui.value)},updated(){let e=this.service.surface.value;if(e){let t=e.getShapeLibrary(),r=t.renderCompiledShape(Object.assign({sw:this.getOutlineWidth()},this.data));if(this.$refs.container.replaceChildren(r),this.showLabels){let o=t.renderShapeLabel(this.data,this.labelProperty,this.labelStrokeWidth,null,this.labelColor,this.labelColor,this.font);this.$refs.container.appendChild(o),this.multilineLabels!=!1&&(0,U.convertToMultilineText)(o,this.data[this.labelProperty]||"",this.getWidth()*(this.labelFillRatio||U.DEFAULT_LABEL_FILL_RATIO),this.labelPosition)}}},render:function(){return(0,ce.h)(U.ELEMENT_SVG,{ref:"container",preserveAspectRatio:"none",fill:this.getFill(),stroke:this.getOutline(),"stroke-width":this.getOutlineWidth(),viewBox:"0 0 "+this.getWidth()+" "+this.getHeight(),class:U.CLASS_SHAPE})},methods:{getWidth:function(){return this.data.width||Po},getHeight:function(){return this.data.height||Oo},getFill:function(){return this.data.fill||"#FFFFFF"},getOutline:function(){return this.data.outline||"#000000"},getOutlineWidth(){return this.data.outlineWidth||2}}};var ue=require("vue"),vt=require("@visuallyjs/browser-ui"),Rt={name:Re,props:{surfaceId:{type:String},dragSize:Object,iconSize:Object,fill:String,outline:String,showAllMessage:String,selectAfterDrop:Boolean,paletteStrokeWidth:Number,dataGenerator:Function,initialSet:String,mode:String,allowClickToAdd:Boolean,onVertexAdded:Function,showLabels:Boolean,inspector:{type:Boolean,default:!0},updateTypeOnPaletteTap:Boolean,preparedShapes:Array,allowDropOnEdge:[Boolean,Function],autoEdgeConnect:[Boolean,Object],showGroups:{type:Boolean,default:!0}},setup(e){return{service:(0,ue.inject)(p)}},data:()=>({hasMounted:!1}),mounted(){let e=t=>{this.hasMounted||(this.hasMounted=!0,new vt.ShapePalette(t,{container:this.$refs.container,shapeLibrary:t.getShapeLibrary(),dragSize:this.dragSize,iconSize:this.iconSize,fill:this.fill,outline:this.outline,showAllMessage:this.showAllMessage,selectAfterDrop:this.selectAfterDrop,paletteStrokeWidth:this.paletteStrokeWidth,dataGenerator:this.dataGenerator,initialSet:this.initialSet,mode:this.mode,allowClickToAdd:this.allowClickToAdd,onVertexAdded:this.onVertexAdded,showLabels:this.showLabels,inspector:this.inspector,updateTypeOnPaletteTap:this.updateTypeOnPaletteTap,preparedShapes:this.preparedShapes,allowDropOnEdge:this.allowDropOnEdge,autoEdgeConnect:this.autoEdgeConnect,showGroups:this.showGroups}))};this.service.surface.value==null?(0,ue.watch)(this.service.surface,e):e(this.service.surface.value)},render:function(){return(0,ue.h)(vt.ELEMENT_DIV,{ref:"container"})}};var G=require("vue"),de=require("@visuallyjs/browser-ui"),F=Symbol.for("VueInspectorGetter"),lr=Symbol.for("VueInspectorSetter");function pr(){let e=[],t=null;function r(c){try{c(t)}catch(n){(0,de.log)("WARN: inspector listener threw an exception",n)}}let o={listen:c=>{t!=null?r(c):e.push(c)}},s={inspector:c=>{t=c,e.forEach(r)}};return(0,G.provide)(lr,s),(0,G.provide)(F,(0,G.readonly)(o)),s}var Nt={name:Xe,props:{autoCommit:{type:Boolean,default:!0},multipleSelections:{type:Boolean,default:!0},filter:Function,renderEmptyContainer:Function,refresh:Function,className:String,showCloseButton:Boolean,afterUpdate:Function,modelValue:Object},emits:["update:modelValue"],setup(e,t){let r=pr();return{service:(0,G.inject)(p),inspectorProvider:r,inspector:null,emit:t.emit}},mounted(){let e=t=>{if(this.inspector==null){let r=new de.Inspector({container:this.$refs.root,ui:t,renderEmptyContainer:()=>(this.emit("update:modelValue",null),this.renderEmptyContainer?this.renderEmptyContainer():""),refresh:(o,s)=>{this.emit("update:modelValue",o),this.refresh&&this.refresh(o),setTimeout(s)},autoCommit:this.autoCommit,multipleSelections:this.multipleSelections,filter:this.filter,showCloseButton:this.showCloseButton,afterUpdate:()=>this.afterUpdate?this.afterUpdate(t):null});this.inspectorProvider.inspector(r)}};this.service.surface.value==null?(0,G.watch)(this.service.surface,e):e(this.service.surface.value)},render(){return(0,G.h)(de.ELEMENT_DIV,{ref:"root"},this.$slots.hasOwnProperty("default")?this.$slots.default():[])}};var At=require("vue"),me=require("@visuallyjs/browser-ui"),he={name:Ne,props:{propertyName:String},setup(){return{inspectorProvider:(0,At.inject)(F)}},mounted(){this.inspectorProvider?this.inspectorProvider.listen(e=>{let t=new me.EdgeTypePicker(e.$ui,this.$refs.container,e.$ui.$getEdgePropertyMappings(),e.getValue(this.propertyName),(r,o)=>{e.setValue(this.propertyName,o,null)});t.render(this.propertyName,e.f),e.onChange(()=>{t.reset(),t.select(this.propertyName,e.getValue(this.propertyName))})}):(0,me.log)("WARN: EdgeTypePicker not instantiated inside an InspectorComponent. Cannot mount.")},render:function(){return(0,At.h)(me.ELEMENT_DIV,{ref:"container"})}};var re=require("vue"),g=require("@visuallyjs/browser-ui"),$o={render(){let e=this.swatches.map(t=>(0,re.h)(g.ELEMENT_DIV,{title:t,class:g.CLASS_COLOR_PICKER_SWATCH,style:`background-color:${t}`,"data-color":t,onClick:()=>this.selectSwatch(t)}));return(0,re.h)(g.ELEMENT_DIV,{class:`${g.CLASS_COLOR_PICKER}`},[(0,re.h)("input",{type:"color","vjs-att":this.propertyName,ref:"colorInput"}),(0,re.h)(g.ELEMENT_DIV,{class:g.CLASS_COLOR_PICKER_SWATCHES},e)])},props:{propertyName:String,maxColors:{type:Number,default:10}},data:()=>({CLASS_COLOR_PICKER:g.CLASS_COLOR_PICKER,CLASS_COLOR_PICKER_SWATCHES:g.CLASS_COLOR_PICKER_SWATCHES,CLASS_COLOR_PICKER_SWATCH:g.CLASS_COLOR_PICKER_SWATCH,colorInput:null,swatches:[]}),mounted(){let e=(0,re.inject)(F);e&&e.listen(t=>{this.inspector=t,this.swatches=t.ensureContext(g.INSPECTOR_CONTEXT_RECENT_COLORS,()=>[]),this.colorInput=this.$refs.colorInput,this.colorInput.addEventListener("change",this.colorPicked),t.bind(g.EVENT_CONTEXT_UPDATE,r=>{r.key===g.INSPECTOR_CONTEXT_RECENT_COLORS&&(this.swatches=r.value.slice())}),t.bind("change",this.setCurrentColor),this.setCurrentColor()})},methods:{addColor:function(e){let t=this.inspector.ensureContext(g.INSPECTOR_CONTEXT_RECENT_COLORS,()=>[]);if(e=e.toUpperCase(),!(t.find(o=>o.toUpperCase()===e)!=null)){let o=this.maxColors||10,s=t.slice();s.unshift(e),s.length>o&&(s.length=o),this.inspector.updateContext(g.INSPECTOR_CONTEXT_RECENT_COLORS,s)}},colorPicked:function(){let e=this.colorInput.value;this.inspector.setValue(this.propertyName,e,null),this.addColor(e)},selectSwatch:function(e){this.inspector.setValue(this.propertyName,e,null),this.colorInput.value=e},setCurrentColor:function(){let e=this.inspector.getValue(this.propertyName);e!=null&&(this.colorInput.value=e,this.addColor(e))}}};var N=require("vue"),fe=require("@visuallyjs/browser-ui"),xt={props:{placement:{type:String,default:"floating"},position:{type:Object},constraints:{type:Object}},data:()=>({hasMounted:!1,surface:null}),setup(e){return{service:(0,N.inject)(p)}},mounted(){let e=t=>{if(!this.hasMounted){this.surface=t,this.hasMounted=!0;let r=this.position||{x:0,y:0};(0,N.nextTick)().then(()=>{this.placement==="floating"?t.floatElement(this.$refs.root,r):t.fixElement(this.$refs.fixedEl,r,this.constraints)})}};this.service.surface.value==null?(0,N.watch)(this.service.surface,e):e(this.service.surface.value)},render(){return(0,N.h)(fe.ELEMENT_DIV,{ref:"root"},this.hasMounted?this.placement==="floating"?(0,N.h)(fe.ELEMENT_DIV,{},this.$slots.hasOwnProperty("default")?this.$slots.default():[]):(0,N.h)(N.Teleport,{to:this.surface.vertexLayer,key:(0,fe.uuid)()},(0,N.h)(fe.ELEMENT_DIV,{ref:"fixedEl"},this.$slots.hasOwnProperty("default")?this.$slots.default():[])):[])}};var cr=require("vue"),Dt={setup(){(0,cr.provide)(p,new w("DiagramProvider"))},render(){return this.$slots.hasOwnProperty("default")?this.$slots.default():[]}};var Pe=require("vue"),Oe=require("@visuallyjs/browser-ui"),It={name:Ge,props:{fill:String,outline:String,dragSize:Object,inspector:{type:Boolean,default:!0},updateTypeOnPaletteTap:Boolean,iconSize:Object,showLabels:Boolean,paletteStrokeWidth:Number,showAllMessage:String,onCellAdded:Function,mode:String,allowClickToAdd:Boolean,autoExitDrawMode:Boolean,selectAfterAdd:{type:Boolean,default:!0},className:String,diagram:{type:Object},onVertexAdded:Function,preparedShapes:Array,allowDropOnEdge:[Boolean,Function],autoEdgeConnect:[Boolean,Object],showGroups:{type:Boolean,default:!0}},setup(e){return{service:(0,Pe.inject)(p)}},data:()=>({hasMounted:!1}),mounted(){if(this.service==null&&this.diagram==null)(0,Oe.log)("Cannot mount DiagramPalette - no service found and Diagram not passed in as a prop");else{let e=t=>{this.hasMounted||(this.hasMounted=!0,new Oe.DiagramPalette(this.$refs.container,t,{fill:this.fill,outline:this.outline,dragSize:this.dragSize,inspector:this.inspector,iconSize:this.iconSize,showLabels:this.showLabels,paletteStrokeWidth:this.paletteStrokeWidth,showAllMessage:this.showAllMessage,onCellAdded:this.onCellAdded,mode:this.mode,allowClickToAdd:this.allowClickToAdd,autoExitDrawMode:this.autoExitDrawMode,selectAfterAdd:this.selectAfterAdd,onVertexAdded:this.onVertexAdded,updateTypeOnPaletteTap:this.updateTypeOnPaletteTap,preparedShapes:this.preparedShapes,allowDropOnEdge:this.allowDropOnEdge,autoEdgeConnect:this.autoEdgeConnect,showGroups:this.showGroups}))};this.diagram?e(this.diagram):this.service.diagram.value!=null?e(this.service.diagram.value):(0,Pe.watch)(this.service.diagram,e)}},render:function(){return(0,Pe.h)(Oe.ELEMENT_DIV,{ref:"container"})}};var M=require("@visuallyjs/browser-ui"),A=require("vue"),bt={name:"SurfacePopup",props:{selector:String,anchor:{type:String,default:"bottom"}},setup(e){let t=(0,A.inject)(p),r=(0,A.ref)(null),o=(0,A.ref)("block"),s=(0,A.ref)(null),c=(0,A.ref)(null),n=l=>{c.value=new M.PopupHandler(e.selector,s.value,l,a=>{r.value=a,a==null?o.value=M.NONE:(o.value=M.BLOCK,requestAnimationFrame(()=>c.value.$positionPopup()))},e.anchor)};return(0,A.onMounted)(()=>{t.surface.value==null?(0,A.watch)(t.surface,n):n(t.surface.value)}),{service:t,current:r,display:o,rootRef:s,handler:c}},render(){var e;return(0,A.h)(M.ELEMENT_DIV,{ref:"rootRef",display:this.display,position:M.ABSOLUTE,class:M.CLASS_SURFACE_POPUP},this.$slots.hasOwnProperty("default")?this.$slots.default({vertex:this.current,model:(e=this.service.surface.value)==null?void 0:e.model,ui:this.service.surface.value,hide:()=>{var t;return(t=this.handler)==null?void 0:t.$hide()}}):[])}};var _=require("vue"),j=require("@visuallyjs/browser-ui"),Wo={setup(){return{service:(0,_.inject)(p)}},name:Ae,props:{options:{type:Object}},mounted:function(){let e=t=>{t.addPlugin({type:j.BackgroundPlugin.type,options:this.options})};this.service.surface.value!=null&&e(this.service.surface.value),this.service.paper.value!=null?e(this.service.paper.value):((0,_.watch)(this.service.surface,e),(0,_.watch)(this.service.paper,e))},render:function(e){return[]}},zo={setup(){return{service:(0,_.inject)(p)}},name:xe,props:{grid:{type:Object},showBorder:{type:Boolean},minWidth:{type:Number},minHeight:{type:Number},showTickMarks:{type:Boolean},tickMarksPerCell:{type:Number},maxWidth:{type:Number},maxHeight:{type:Number},autoShrink:{type:Boolean},gridType:{type:String},dotRadius:{type:Number},tickDotRadius:{type:Number},visible:{type:Boolean}},mounted:function(){let e=t=>{t.addPlugin({type:j.BackgroundPlugin.type,options:{type:j.GeneratedGridBackground.type,grid:this.grid,showBorder:this.showBorder,minWidth:this.minWidth,minHeight:this.minHeight,showTickMarks:this.showTickMarks,tickMarksPerCell:this.tickMarksPerCell,maxWidth:this.maxWidth,maxHeight:this.maxHeight,autoShrink:this.autoShrink,gridType:this.gridType,dotRadius:this.dotRadius,tickDotRadius:this.tickDotRadius,visible:this.visible}})};this.service.surface.value!=null&&e(this.service.surface.value),this.service.paper.value!=null?e(this.service.paper.value):((0,_.watch)(this.service.surface,e),(0,_.watch)(this.service.paper,e))},render:function(e){return[]}},Ko={setup(){return{service:(0,_.inject)(p)}},name:De,props:{url:{type:String}},mounted:function(){let e=t=>{t.addPlugin({type:j.BackgroundPlugin.type,options:{type:j.SimpleBackground.type,url:this.url}})};this.service.surface.value!=null&&e(this.service.surface.value),this.service.paper.value!=null?e(this.service.paper.value):((0,_.watch)(this.service.surface,e),(0,_.watch)(this.service.paper,e))},render:function(e){return[]}},Jo={setup(){return{service:(0,_.inject)(p)}},name:Ie,props:{url:{type:String},urlGenerator:{type:Function},tileSize:{type:Object},width:{type:Number},height:{type:Number},maxZoom:{type:Number},tiling:{type:String},panDebounceTimeout:{type:Number},zoomDebounceTimeout:{type:Number}},mounted:function(){let e=t=>{t.addPlugin({type:j.BackgroundPlugin.type,options:{type:j.TiledBackground.type,url:this.url,urlGenerator:this.urlGenerator,tileSize:this.tileSize,width:this.width,height:this.height,tiling:this.tiling,panDebounceTimeout:this.panDebounceTimeout,zoomDebounceTimeout:this.zoomDebounceTimeout}})};this.service.surface.value!=null&&e(this.service.surface.value),this.service.paper.value!=null?e(this.service.paper.value):((0,_.watch)(this.service.surface,e),(0,_.watch)(this.service.paper,e))},render:function(e){return[]}};var ne=require("vue"),J=require("@visuallyjs/browser-ui"),Mt={name:Ze,props:{getPropertyName:Function,showName:{type:Boolean,default:!0},cssClass:String,mappings:Array},setup(){return{inspectorProvider:(0,ne.inject)(F)}},data(){return{inspector:null}},mounted(){this.inspectorProvider?this.inspectorProvider.listen(e=>{this.inspector=e}):(0,J.log)("WARN: EdgePropertyMappingsInspector not instantiated inside an InspectorComponent.")},methods:{resolveMappings(){return this.mappings?this.mappings:this.inspector?this.inspector.getFromContext(J.INSPECTOR_CONTEXT_EDGE_PROPERTY_MAPPINGS)||this.inspector.$ui.$getEdgePropertyMappings():[]},toList(e){let t=e.property;return Array.isArray(t)?t:[t]},getPropertyKey(e){return this.toList(e).join(" ")},getName(e){return this.getPropertyName?this.getPropertyName(e):e.name||this.getPropertyKey(e)}},render(){let e=this.resolveMappings(),t=this.cssClass||"vjs-inspector-section";return(0,ne.h)(J.ELEMENT_DIV,{},e.map(r=>{let o=this.getPropertyKey(r),s=this.getName(r),c=[];return this.showName!==!1&&c.push((0,ne.h)(J.ELEMENT_DIV,{},s)),c.push((0,ne.h)(he,{propertyName:o})),(0,ne.h)(J.ELEMENT_DIV,{class:t,key:o},c)}))}};var m=require("vue"),S=require("@visuallyjs/browser-ui"),Lr=7,Ur=["True","False"];function wt(e,t){return(e.booleanLabels||Ur)[t?0:1]}function Y(e){return(0,S.isString)(e)?e:e.label}function Vt(e){return(0,S.isString)(e)?e:e.value}var Bt={name:qe,props:{vertex:Object,maxRadios:Number},setup(){return{inspectorProvider:(0,m.inject)(F)}},data(){return{inspector:null}},mounted(){this.inspectorProvider?this.inspectorProvider.listen(e=>{this.inspector=e}):(0,S.log)("WARN: ShapePropertiesInspector not instantiated inside an InspectorComponent.")},methods:{resolveShapeDef(){if(this.inspector==null||this.vertex==null||!(0,S.isNode)(this.vertex))return null;let{type:e,category:t}=this.vertex.data;if(!e||!t)return null;let o=this.inspector.$ui.getShapeLibrary().getShapeSet(t);return o?o.shapes.find(s=>s.type===e):null}},render(){let e=this.vertex;if(!e||!(0,S.isNode)(e))return null;let t=this.resolveShapeDef();if(!t||!t.properties)return null;let r=this.maxRadios==null?Lr:this.maxRadios;return t.properties.map(o=>{let s=o.type==="boolean",c=o.values&&o.values.length>0,n=c&&o.editor!=="select"&&o.values.length<=r,l=[];return(!s||o.editor==="select"||o.editor==="radio")&&l.push((0,m.h)("label",{class:"vjs-inspector-property-label"},o.label||o.id)),o.type==="string"?c?n?l.push((0,m.h)(S.ELEMENT_DIV,{class:"vjs-radio-group"},o.values.map(a=>(0,m.h)("label",{key:Y(a)},[(0,m.h)("input",{type:"radio",name:o.id,"vjs-att":o.id,value:Vt(a)})," "+Y(a)])))):l.push((0,m.h)("select",{"vjs-att":o.id},o.values.map(a=>(0,m.h)("option",{key:Y(a),value:Vt(a)},Y(a))))):l.push((0,m.h)("input",{type:"text","vjs-att":o.id,placeholder:o.description})):o.type==="number"?c?n?l.push((0,m.h)(S.ELEMENT_DIV,{class:"vjs-radio-group"},o.values.map(a=>(0,m.h)("label",{key:Y(a)},[(0,m.h)("input",{type:"radio","vjs-att":o.id,value:Vt(a)})," "+Y(a)])))):l.push((0,m.h)("select",{"vjs-att":o.id},o.values.map(a=>(0,m.h)("option",{key:Y(a),value:Vt(a)},Y(a))))):l.push((0,m.h)("input",{type:"number","vjs-att":o.id,placeholder:o.description,min:o.min,max:o.max})):s?o.editor==="select"?l.push((0,m.h)("select",{"vjs-att":o.id,"vjs-datatype":"boolean"},[(0,m.h)("option",{value:""}),(0,m.h)("option",{value:"true"},wt(o,!0)),(0,m.h)("option",{value:"false"},wt(o,!1))])):o.editor==="radio"?l.push((0,m.h)(S.ELEMENT_DIV,{class:"vjs-radio-group"},[(0,m.h)("label",[(0,m.h)("input",{type:"radio",name:o.id,"vjs-att":o.id,"vjs-datatype":"boolean",value:"true"}),(0,m.h)("span",wt(o,!0))]),(0,m.h)("label",[(0,m.h)("input",{type:"radio",name:o.id,"vjs-att":o.id,"vjs-datatype":"boolean",value:"false"}),(0,m.h)("span",wt(o,!1))])])):l.push((0,m.h)("label",[(0,m.h)("input",{type:"checkbox","vjs-datatype":"boolean","vjs-att":o.id})," "+(o.label||o.id)])):l.push((0,m.h)("input",{type:"text","vjs-att":o.id,placeholder:o.description})),o.description&&l.push((0,m.h)(S.ELEMENT_DIV,{class:"vjs-field-desc"},o.description)),(0,m.h)(S.ELEMENT_DIV,{key:o.id,class:"vjs-inspector-field"},l)})}};var Gr={install:function(e,t){e.component(To,Tt),e.component(_o,_t),e.component(So,Dt),e.component(Me,wo),e.component(we,Vo),e.component(Ue,Fo),e.component(be,ko),e.component(Be,Go),e.component(Le,jo),e.component(Ae,Wo),e.component(xe,zo),e.component(De,Ko),e.component(Ie,Jo),e.component(Ve,Ho),e.component(Ge,It),e.component(ke,mt),e.component(je,dt),e.component(Fe,ht),e.component(He,Pt),e.component($e,Ot),e.component(We,ft),e.component(Ye,Ct),e.component(Je,yt),e.component(Ke,gt),e.component(ze,Et),e.component(ve,St),e.component(Re,Rt),e.component(Ne,he),e.component(Eo,$o),e.component(Xe,Nt),e.component(Ze,Mt),e.component(qe,Bt),e.component(Ro,xt),e.component(vo,bt),e.provide(p,new w("root"))}};var Ee=require("vue"),Lt=require("@visuallyjs/browser-ui"),ur=require("vue");function jr(){let e=(0,ur.inject)(p),t=(0,Ee.shallowRef)(null),r=(0,Ee.shallowRef)(null),o=(0,Ee.shallowRef)(null),s=(0,Ee.ref)(1);return e==null||e.getSurface(c=>{r.value=c,r.value.bind(Lt.EVENT_ZOOM,n=>{s.value=n.zoom})}),e==null||e.getDiagram(c=>{t.value=c,t.value.$ui.bind(Lt.EVENT_ZOOM,n=>{s.value=n.zoom})}),e==null||e.getPaper(c=>{o.value=c,o.value.bind(Lt.EVENT_ZOOM,n=>{s.value=n.zoom})}),s}var Ut=require("vue"),ge=require("@visuallyjs/browser-ui");function kr(e){let t=(0,Ut.inject)(p);if(t){let r=null,o=()=>{r&&e(r)},s=()=>{r&&(r.unbind(ge.EVENT_DATA_UPDATED,o),r.unbind(ge.EVENT_GRAPH_CLEARED,o))},c=n=>{s(),r=n,r&&(r.bind(ge.EVENT_DATA_UPDATED,o),r.bind(ge.EVENT_GRAPH_CLEARED,o),o())};t.getModel(n=>{c(n)}),(0,Ut.onUnmounted)(()=>{s()})}}var dr=require("vue"),mr=require("vue");function Fr(){let e=(0,mr.inject)(p),t=(0,dr.shallowRef)(null);return e==null||e.getSurface(r=>{t.value=r}),t}var hr=require("vue"),fr=require("vue");function Hr(){let e=(0,fr.inject)(p),t=(0,hr.shallowRef)(null);return e==null||e.getDiagram(r=>{t.value=r}),t}var Pr=require("vue"),Or=require("vue");function $r(){let e=(0,Or.inject)(p),t=(0,Pr.shallowRef)(null);return e==null||e.getPaper(r=>{t.value=r}),t}
1
+ var tt=Object.defineProperty,yr=Object.defineProperties,gr=Object.getOwnPropertyDescriptor,Cr=Object.getOwnPropertyDescriptors,Tr=Object.getOwnPropertyNames,Yo=Object.getOwnPropertySymbols;var Zo=Object.prototype.hasOwnProperty,_r=Object.prototype.propertyIsEnumerable;var Xo=(e,t,r)=>t in e?tt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Z=(e,t)=>{for(var r in t||(t={}))Zo.call(t,r)&&Xo(e,r,t[r]);if(Yo)for(var r of Yo(t))_r.call(t,r)&&Xo(e,r,t[r]);return e},ge=(e,t)=>yr(e,Cr(t));var Sr=(e,t)=>{for(var r in t)tt(e,r,{get:t[r],enumerable:!0})},vr=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Tr(t))!Zo.call(e,s)&&s!==r&&tt(e,s,{get:()=>t[s],enumerable:!(o=gr(t,s))||o.enumerable});return e};var Rr=e=>vr(tt({},"__esModule",{value:!0}),e);var zr={};Sr(zr,{$initialiseVueOverlays:()=>Qe,AreaChartComponent:()=>Et,BackgroundComponent:()=>Wo,BarChartComponent:()=>ht,BaseOverlayComponent:()=>bo,BrowserUIVueModel:()=>D,BubbleChartComponent:()=>gt,CLASS_VUE_GROUP:()=>Co,CLASS_VUE_NODE:()=>go,CLASS_VUE_OVERLAY:()=>To,COMPONENT_AREA_CHART:()=>$e,COMPONENT_BACKGROUND:()=>Ae,COMPONENT_BAR_CHART:()=>ke,COMPONENT_BUBBLE_CHART:()=>Ke,COMPONENT_COLUMN_CHART:()=>je,COMPONENT_CONTROLS:()=>Le,COMPONENT_DIAGRAM:()=>Ue,COMPONENT_DIAGRAM_PALETTE:()=>Ge,COMPONENT_DIAGRAM_PROVIDER:()=>vo,COMPONENT_EDGE_PROPERTY_MAPPINGS_INSPECTOR:()=>Ze,COMPONENT_EXPORT_CONTROLS:()=>Be,COMPONENT_GAUGE_CHART:()=>Je,COMPONENT_GRID_BACKGROUND:()=>xe,COMPONENT_IMAGE_BACKGROUND:()=>De,COMPONENT_INSPECTOR:()=>Xe,COMPONENT_LINE_CHART:()=>He,COMPONENT_MINIVIEW:()=>be,COMPONENT_PALETTE:()=>Ve,COMPONENT_PAPER:()=>we,COMPONENT_PAPER_PROVIDER:()=>So,COMPONENT_PIE_CHART:()=>We,COMPONENT_SANKEY_CHART:()=>Ye,COMPONENT_SCATTER_CHART:()=>ze,COMPONENT_SHAPE_PROPERTIES_INSPECTOR:()=>qe,COMPONENT_SURFACE:()=>Me,COMPONENT_SURFACE_POPUP:()=>Ro,COMPONENT_SURFACE_PROVIDER:()=>_o,COMPONENT_TILED_IMAGE_BACKGROUND:()=>Ie,COMPONENT_XY_CHART:()=>Fe,ColorPickerComponent:()=>et,ColumnChartComponent:()=>mt,ControlsComponent:()=>jo,DEFAULT_SHAPE_HEIGHT:()=>Eo,DEFAULT_SHAPE_WIDTH:()=>Oo,DEFAULT_VUE_PAPER_ID:()=>kt,DEFAULT_VUE_SURFACE_ID:()=>jt,DecoratorComponent:()=>Dt,DiagramComponent:()=>Ho,DiagramPaletteComponent:()=>bt,DiagramProvider:()=>It,EVENT_VERTEX_UPDATED:()=>er,EVENT_VERTICES_RENDERED:()=>ct,EdgePropertyMappingsInspectorComponent:()=>wt,EdgeTypePickerComponent:()=>he,ExportControlsComponent:()=>ko,GaugeChartComponent:()=>Ct,GridBackgroundComponent:()=>zo,ImageBackgroundComponent:()=>Ko,InspectorComponent:()=>At,InspectorGetterSymbol:()=>F,InspectorSetterSymbol:()=>lr,LineChartComponent:()=>Ot,MiniviewComponent:()=>Fo,PROP_ACTIVE_TRACKING:()=>Wt,PROP_ALLOW_CLICK_TO_ADD:()=>co,PROP_ALLOW_DROP_ON_CANVAS:()=>ro,PROP_ALLOW_DROP_ON_EDGE:()=>oo,PROP_ALLOW_DROP_ON_GROUP:()=>no,PROP_ALLOW_DROP_ON_NODE:()=>io,PROP_ALLOW_ROTATION:()=>uo,PROP_AUTO_EDGE_CONNECT:()=>ho,PROP_CANVAS_DROP_FILTER:()=>Po,PROP_CLASS_NAME:()=>q,PROP_CLICK_TO_ADD_ONLY:()=>po,PROP_CLICK_TO_CENTER:()=>Ht,PROP_CSV_DATA:()=>nt,PROP_DATA:()=>I,PROP_DATA_GENERATOR:()=>Qt,PROP_DATA_SOURCE_FILTER:()=>rt,PROP_DATA_TYPE:()=>Se,PROP_DRAG_SIZE:()=>fo,PROP_GROUP_IDENTIFIER:()=>to,PROP_ID:()=>Ar,PROP_IGNORE_DROP_ON_NODE:()=>so,PROP_INTERACTIVE:()=>Yt,PROP_JSON_DATA:()=>it,PROP_MODE:()=>Jt,PROP_MODEL:()=>Te,PROP_MODEL_OPTIONS:()=>Q,PROP_ON_VERTEX_ADDED:()=>ao,PROP_OPTIONS:()=>K,PROP_PAPER_ID:()=>Kt,PROP_PIVOT:()=>Xt,PROP_RENDER_OPTIONS:()=>Ce,PROP_ROTATION_SPEED:()=>mo,PROP_SELECTOR:()=>qt,PROP_SELECT_AFTER_ADD:()=>lo,PROP_SHOW_LASSO:()=>$t,PROP_SURFACE_ID:()=>H,PROP_TRACK_SELECTION:()=>zt,PROP_TYPE_FUNCTION:()=>Ft,PROP_TYPE_GENERATOR:()=>eo,PROP_URL:()=>R,PROP_USE_MODEL:()=>Zt,PROP_VIEW_OPTIONS:()=>_e,PaletteComponent:()=>$o,PaperComponent:()=>Lo,PaperProvider:()=>St,PieChartComponent:()=>Pt,SankeyChartComponent:()=>Tt,ScatterChartComponent:()=>yt,ShapeComponent:()=>vt,ShapePaletteComponent:()=>Nt,ShapePropertiesInspectorComponent:()=>Bt,SurfaceComponent:()=>Vo,SurfacePopup:()=>Mt,SurfaceProvider:()=>_t,TAG_COLOR_PICKER:()=>yo,TAG_DECORATOR:()=>No,TAG_EDGE_TYPE_PICKER:()=>Ne,TAG_SHAPE:()=>ve,TAG_SHAPE_PALETTE:()=>Re,TiledImageBackgroundComponent:()=>Jo,VisuallyJsPlugin:()=>jr,VisuallyJsService:()=>w,VisuallyJsServiceKey:()=>p,XYChartComponent:()=>ft,addPaper:()=>wo,addSurface:()=>Mo,bindToDevLifecycle:()=>xr,doProvideInspector:()=>pr,newInstance:()=>Nr,useDiagram:()=>$r,usePaper:()=>Wr,useSurface:()=>Hr,useVisuallyJsUpdate:()=>Fr,useZoom:()=>kr,vertexHasRendered:()=>Ao,vertexHasUpdated:()=>xo,vertexWillRender:()=>tr});module.exports=Rr(zr);var ot=require("@visuallyjs/browser-ui"),D=class extends ot.BrowserUIModel{render(t,r){return(0,ot.log)("render called directly on BrowserUiVue class: should not happen. Surface component should use internal render."),null}};function Nr(e){return e=e||{},new D(e)}var jt="surfaceId",kt="paperId",Ft="typeFunction",Ht="clickToCenter",$t="showLasso",Wt="activeTracking",zt="trackSelection",H="surfaceId",Kt="paperId",q="className",I="data",Jt="mode",K="options",Ce="renderOptions",Q="modelOptions",Te="model",_e="viewOptions",R="url",Se="dataType",Yt="interactive",Xt="pivot",rt="dataSourceFilter",nt="csvData",it="jsonData",Zt="useModel",Ar="id",qt="selector",Qt="dataGenerator",eo="typeGenerator",to="groupIdentifier",oo="allowDropOnEdge",ro="allowDropOnCanvas",no="allowDropOnGroup",io="allowDropOnNode",so="ignoreDropOnNode",ao="onVertexAdded",lo="selectAfterAdd",po="clickToAddOnly",co="allowClickToAdd",uo="allowRotation",mo="rotationSpeed",ho="autoEdgeConnect",fo="dragSize",Po="canvasDropFilter",ve="Shape",Re="ShapePalette",Oo=120,Eo=90,Ne="EdgeTypePickerComponent",yo="ColorPickerComponent",go="vjs-vue-node",Co="vjs-vue-group",To="vjs-vue-overlay",Ae="BackgroundComponent",xe="GridBackgroundComponent",De="ImageBackgroundComponent",Ie="TiledImageBackgroundComponent",be="MiniviewComponent",Me="SurfaceComponent",_o="SurfaceProvider",we="PaperComponent",So="PaperProvider",vo="DiagramProvider",Ve="PaletteComponent",Le="ControlsComponent",Be="ExportControlsComponent",Ue="DiagramComponent",Ge="DiagramPaletteComponent",je="ColumnChartComponent",ke="BarChartComponent",Fe="XYChartComponent",He="LineChartComponent",$e="AreaChartComponent",We="PieChartComponent",ze="ScatterChartComponent",Ke="BubbleChartComponent",Je="GaugeChartComponent",Ye="SankeyChartComponent",Xe="InspectorComponent",Ze="EdgePropertyMappingsInspector",Ro="SurfacePopup",No="Decorator",qe="ShapePropertiesInspectorComponent";var $=require("@visuallyjs/browser-ui"),st={props:{data:Object,model:D,obj:$.Vertex,vertex:$.Vertex,ui:$.BrowserUI,el:Element,def:Object,eventInfo:Object},mounted(){let e=this,t=(0,$.isGroup)(e.vertex)?Co:go;e.el.firstElementChild&&(0,$.addClass)(e.el.firstElementChild,t),e.ui.$vertexRendered(e.vertex,e.el,e.def,e.eventInfo),Ao(e.ui.id,e.vertex)},methods:{getModel:function(){return this.model},removeVertex:function(){this.model.remove(this.vertex)}},updated(){this.ui.$revalidateElement(this.el),xo(this.ui.id,this.vertex)}};var qo={mixins:[st],methods:{getNode:function(){return this.obj},removeNode:function(){this.model.removeNode(this.getNode())},updateNode:function(e){this.model.updateNode(this.obj,e);let t=this.ui.getRenderedElement(this.obj.getFullId());this.ui.$revalidateElement(t)}}};var Qo={methods:{getGroup:function(){return this.obj},removeGroup:function(e){this.model.removeGroup(this.obj,e)},updateGroup:function(e){this.model.updateGroup(this.obj,e);let t=this.ui.getRenderedElement(this.obj.getFullId());this.ui.$revalidateElement(t)}},mixins:[st]};var b=require("vue"),m=require("@visuallyjs/browser-ui"),Do=class{constructor(){this.unrenderedVertices=new Map;this.eventManager=new m.OptimisticEventGenerator;this.hasRendered=!1}vertexWillRender(t){this.unrenderedVertices.set(t.id,t),this.hasRendered=!1}vertexHasRendered(t){this.unrenderedVertices.delete(t.id),this.unrenderedVertices.size===0&&(this.hasRendered=!0,this.eventManager.fire(ct))}vertexHasUpdated(t){this.eventManager.fire(er,t)}},ct="vertices:rendered",er="vertex:updated",Io=new Map;function at(e){return Io.has(e)||Io.set(e,new Do),Io.get(e)}function Ao(e,t){at(e).vertexHasRendered(t)}function xo(e,t){at(e).vertexHasUpdated(t)}function tr(e,t){at(e).vertexWillRender(t)}function xr(e,t,r){let o=at(e);o&&(o.eventManager.bind(t,r),t===ct&&o.hasRendered&&o.eventManager.fire(ct))}var lt=(e,t)=>{t.parentNode&&t.parentNode.removeChild(t)},bo={props:{data:Object,model:D,obj:m.Edge,edge:m.Edge,overlay:m.Overlay,ui:m.BrowserUI,el:Element,def:Object,eventInfo:Object},mounted(){let e=this;e.el.firstElementChild&&(0,m.addClass)(e.el.firstElementChild,To)},updated(){this.ui.$revalidateElement(this.el)}},pt=(e,t,r,o,s,c,n,a,l)=>{let f=n.component!=null,h=(0,m.isGroup)(a),_=[];f||_.push(h?m.CLASS_DEFAULT_GROUP:m.CLASS_DEFAULT_NODE);let g=f?n.component:{render(v){return v.data.label||""}};if(g){let v=document.createElement(m.ELEMENT_DIV);(0,m.updateClasses)(v,_),g.mixins==null&&(g.mixins=[]);let x=h?Qo:qo;g.mixins.find(k=>k===x)||g.mixins.push(x),tr(c.id,a);let ie={data:r,model:(0,b.markRaw)(o),ui:(0,b.markRaw)(c),obj:(0,b.markRaw)(a),vertex:(0,b.markRaw)(a),el:v,def:(0,b.markRaw)(n),eventInfo:l==null?null:(0,b.markRaw)(l)};if(n.inject)for(let k in n.inject){let X=n.inject[k],Er=typeof X=="function"?X(a,o):X;ie[k]=Er}e.push({component:(0,b.markRaw)(g),el:v,t:a.getFullId(),props:ie,vertex:a})}};function Mo(e,t,r,o,s,c){let n={reactive:!0,asynchronous:!0,usesWrapperElement:!1,update:(l,f,h,_)=>{},render:(l,f,h,_,g,v,x,z)=>pt(o,l,f,h,_,g,v,x,z),cleanupVertex:lt,cleanupPort:lt,rerender:(l,f,h,_,g,v,x,z,ie)=>{let k=o.findIndex(X=>X.vertex===x);k!=null&&o.splice(k,1)[0].el,g.$__unmanage(ie,!0,!0),requestAnimationFrame(()=>{pt(o,l,f,h,_,g,v,x,z)})}},a=(0,m.extend)(s||{},{view:c||{},id:t});return(0,m.renderSurface)(e,r,n,a)}function wo(e,t,r,o,s,c){let n={reactive:!0,asynchronous:!0,usesWrapperElement:!1,update:(l,f,h,_)=>{},render:(l,f,h,_,g,v,x,z)=>pt(o,l,f,h,_,g,v,x,z),cleanupVertex:lt,cleanupPort:lt,rerender:(l,f,h,_,g,v,x,z,ie)=>{let k=o.findIndex(X=>X.vertex===x);k!=null&&o.splice(k,1)[0].el,g.$__unmanage(ie,!0,!0),requestAnimationFrame(()=>{pt(o,l,f,h,_,g,v,x,z)})}},a=(0,m.extend)(s||{},{view:c||{},id:t});return(0,m.renderPaper)(e,r,n,a)}function Qe(e,t,r,o){if(e.edges)for(let s in e.edges){let c=e.edges[s];c.overlays&&(c.overlays=c.overlays.map(n=>{let a={};return n.component!=null?{type:m.OVERLAY_TYPE_CUSTOM,options:{create:f=>{let h=document.createElement(m.ELEMENT_DIV),_=(0,m.uuid)();n.component.mixins==null&&(n.component.mixins=[]),n.component.mixins.indexOf(bo)===-1&&n.component.mixins.push(bo);let g=Z({data:f.edge.data,model:(0,b.markRaw)(r()),ui:(0,b.markRaw)(t()),obj:f.edge,edge:f.edge,el:h,def:(0,b.markRaw)(n),eventInfo:null,overlay:n},a);return o.push({component:(0,b.markRaw)(n.component),el:h,t:_,props:g}),h}}}:n}))}}var ee=require("@visuallyjs/browser-ui"),se=require("vue"),p=Symbol.for("visuallyjs-service"),w=class{constructor(t){this.context=t;this.a=[];this.l=[];this.p=[];this.c=[];this.surface=(0,se.shallowRef)(null);this.model=(0,se.shallowRef)(null);this.paper=(0,se.shallowRef)(null);this.diagram=(0,se.shallowRef)(null);this.ui=(0,se.shallowRef)(null)}getSurface(t){this.r(this.l,t,this.u)}getDiagram(t){this.r(this.p,t,this.m)}getPaper(t){this.r(this.c,t,this.h)}getModel(t){this.r(this.a,t,this.i)}getModelDirect(){return this.i}r(t,r,o){if(o!=null)try{r(o)}catch(s){(0,ee.log)(`WARN: could not dispatch ${s}`)}else t.push(r)}setSurface(t){this.surface.value=t,this.model.value=t.model,this.ui.value=t,this.u=t,this.s(t.model),this.n(this.l,t)}setDiagram(t){this.diagram.value=t,this.model.value=t.model,this.ui.value=t.$ui,this.m=t,this.s(t.model),t.$ui instanceof ee.Surface?this.setSurface(t.$ui):t.$ui instanceof ee.Paper&&this.setPaper(t.$ui),this.n(this.p,t)}setPaper(t){this.paper.value=t,this.model.value=t.model,this.ui.value=t,this.h=t,this.s(t.model),this.n(this.c,t)}s(t){this.i=t,this.n(this.a,t)}n(t,r){t.forEach(o=>{try{o(r)}catch(s){(0,ee.log)(`WARN: could not flush all queue entries ${s}`)}})}};var V=require("vue"),O=require("@visuallyjs/browser-ui"),Vo={setup(e){return{service:(0,V.inject)(p),surfaceId:e.surfaceId||jt}},name:Me,props:{[I]:{type:Object},[Ce]:{type:Object},[Q]:{type:Object},[_e]:{type:Object},[Te]:{type:Object},[R]:{type:String},[Se]:{type:String},[H]:{type:String}},data:function(){return{vertices:[],overlays:[]}},mounted(){let e=this,t=this.model||new D(this.modelOptions||{}),r=this.$refs.root;e.e=!1;let o=(0,O.clone)(this.viewOptions||{});Qe(o,()=>this.surface,()=>t,this.overlays),this.surface=Mo(t,this.surfaceId,r,this.vertices,(0,O.clone)(this.renderOptions||{}),o),this.service.setSurface(this.surface);let s=(n,a)=>{let l=()=>{let h={};return a.originalData||a.updates?h=Object.assign(a.originalData,a.updates):a.newData&&Object.assign(h,a.newData),h},f=this.vertices.find(h=>h.t===n);f!=null&&(f.props.data=l())},c=n=>{let a=this.vertices.findIndex(l=>l.t===n);a!==-1&&this.vertices.splice(a,1)};t.bind(O.EVENT_NODE_UPDATED,n=>{s(n.vertex.getFullId(),n)}),t.bind(O.EVENT_GROUP_UPDATED,n=>{s(n.vertex.getFullId(),n)}),t.bind(O.EVENT_NODE_REMOVED,n=>{c(n.node.id)}),t.bind(O.EVENT_GROUP_REMOVED,n=>{c(n.group.id)}),t.bind(O.EVENT_EDGE_UPDATED,n=>{let a=n.edge.id;this.overlays.forEach(l=>{l.props.edge&&l.props.edge.id===a&&(l.props.data=n.edge.data)})}),t.bind(O.EVENT_EDGE_REMOVED,n=>{let a=n.edge.id,l=this.overlays.length-1;for(;l>=0;)this.overlays[l].props.edge&&this.overlays[l].props.edge.id===a&&this.overlays.splice(l,1),l--}),t.bind(O.EVENT_GRAPH_CLEARED,()=>{this.vertices.length=0,this.overlays.length=0}),this.surface.bind(O.EVENT_RENDER_END,()=>setTimeout(()=>this.surface.$redrawEveryConnection())),e.url?t.load({url:e.url,dataType:e.dataType,onload:()=>e.e=!0}):e.data?t.load({data:e.data,dataType:e.dataType,onload:()=>e.e=!0}):e.e=!0},watch:{[I]:{handler(e){this.e!==!1&&this.surface&&this.surface.model&&(this.surface.model.clear(),requestAnimationFrame(()=>{this.surface.model.load({data:e,dataType:this.dataType})}))}},[R]:{handler(e){this.e!==!1&&this.surface&&this.surface.model&&(this.surface.model.clear(),requestAnimationFrame(()=>{this.surface.model.load({url:e,dataType:this.dataType})}))}}},render:function(){let e=this.vertices.map(t=>(0,V.h)(V.Teleport,{to:t.el,key:t.t},[(0,V.h)(t.component,t.props)]));return this.overlays.forEach(t=>{e.push((0,V.h)(V.Teleport,{to:t.el,key:t.t},[(0,V.h)(t.component,t.props)]))}),(0,V.h)(O.ELEMENT_DIV,{ref:"root",class:"vjs-vue-surface",style:{width:"100%",height:"100%"}},e.concat(this.$slots.hasOwnProperty("default")?this.$slots.default():[]))}};var L=require("vue"),E=require("@visuallyjs/browser-ui"),Lo={setup(e){return{service:(0,L.inject)(p),paperId:e.paperId||kt}},name:we,props:{[I]:{type:Object},[Ce]:{type:Object},[Q]:{type:Object},[_e]:{type:Object},[Te]:{type:Object},[R]:{type:String},[Se]:{type:String},[Kt]:{type:String}},data:function(){return{vertices:[],overlays:[]}},mounted(){let e=this,t=this.model||new D(this.modelOptions||{}),r=this.$refs.root;e.e=!1;let o=(0,E.clone)(this.viewOptions||{});Qe(o,()=>this.paper,()=>t,this.overlays),this.paper=wo(t,this.paperId,r,this.vertices,(0,E.clone)(this.renderOptions||{}),o),this.service.setPaper(this.paper);let s=(n,a)=>{let l=()=>{let h={};return a.originalData||a.updates?h=Object.assign(a.originalData,a.updates):a.newData&&Object.assign(h,a.newData),h},f=this.vertices.find(h=>h.t===n);f!=null&&(f.props.data=l())},c=n=>{let a=this.vertices.findIndex(l=>l.t===n);a!==-1&&this.vertices.splice(a,1)};t.bind(E.EVENT_NODE_UPDATED,n=>{s(n.vertex.getFullId(),n)}),t.bind(E.EVENT_GROUP_UPDATED,n=>{s(n.vertex.getFullId(),n)}),t.bind(E.EVENT_NODE_REMOVED,n=>{c(n.node.id)}),t.bind(E.EVENT_GROUP_REMOVED,n=>{c(n.group.id)}),t.bind(E.EVENT_EDGE_UPDATED,n=>{let a=n.edge.id;this.overlays.forEach(l=>{l.props.edge&&l.props.edge.id===a&&(l.props.data=n.edge.data)})}),t.bind(E.EVENT_EDGE_REMOVED,n=>{let a=n.edge.id,l=this.overlays.length-1;for(;l>=0;)this.overlays[l].props.edge&&this.overlays[l].props.edge.id===a&&this.overlays.splice(l,1),l--}),t.bind(E.EVENT_GRAPH_CLEARED,()=>{this.vertices.length=0,this.overlays.length=0}),this.paper.bind(E.EVENT_RENDER_END,()=>setTimeout(()=>this.paper.$redrawEveryConnection())),e.url?t.load({url:e.url,dataType:e.dataType,onload:()=>e.e=!0}):e.data?t.load({data:e.data,dataType:e.dataType,onload:()=>e.e=!0}):e.e=!0},watch:{[I]:{handler(e){this.e!==!1&&this.paper&&this.paper.model&&(this.paper.model.clear(),requestAnimationFrame(()=>{this.paper.model.load({data:e,dataType:this.dataType})}))}},[R]:{handler(e){this.e!==!1&&this.paper&&this.paper.model&&(this.paper.model.clear(),requestAnimationFrame(()=>{this.paper.model.load({url:e,dataType:this.dataType})}))}}},render:function(){let e=this.vertices.map(t=>(0,L.h)(L.Teleport,{to:t.el,key:t.t},[(0,L.h)(t.component,t.props)]));return this.overlays.forEach(t=>{e.push((0,L.h)(L.Teleport,{to:t.el,key:t.t},[(0,L.h)(t.component,t.props)]))}),(0,L.h)(E.ELEMENT_DIV,{ref:"root",class:"vjs-vue-paper",style:{width:"100%",height:"100%"}},e.concat(this.$slots.hasOwnProperty("default")?this.$slots.default():[]))}};var d=require("vue"),i=require("@visuallyjs/browser-ui"),Dr="Clear dataset?",Bo="vjs-selected-mode",Uo="can-undo",Go="can-redo",Ir="data-undo",br="data-redo",or="data-mode",Mr="data-reset",wr="data-clear",Vr="data-zoom-in",Lr="data-zoom-out",rr="vjs-controls-has-selection",jo={setup(e){return{service:(0,d.inject)(p)}},name:Le,props:{clear:{type:Boolean,default:!0},[H]:{type:String},undoRedo:{type:Boolean,default:!0},orientation:{type:String,default:"row"},zoomToExtents:{type:Boolean,default:!0},zoomButtons:{type:Boolean,default:!1},clearMessage:{type:String,default:Dr},onMaybeClear:{type:Function},className:{type:String,default:""}},methods:{panMode:function(){var e;(e=this.service.surface.value)==null||e.setMode(i.SURFACE_MODE_PAN)},selectMode:function(){var e;(e=this.service.surface.value)==null||e.setMode(i.SURFACE_MODE_SELECT)},zoomToFit:function(){var e;(e=this.service.surface.value)==null||e.zoomToFit()},doClear:function(){let e=this.service.surface.value;e&&(this.onMaybeClear!=null?this.onMaybeClear(()=>e.model.clear()):window.confirm(this.clearMessage)&&e.model.clear())},undo:function(){var e;(e=this.service.model.value)==null||e.undo()},redo:function(){var e;(e=this.service.model.value)==null||e.redo()},zoomIn:function(){var e;(e=this.service.surface.value)==null||e.zoomIn()},zoomOut:function(){var e;(e=this.service.surface.value)==null||e.zoomOut()},resetSelection(){let e=this.service.surface.value;e&&(e.model.clearSelection(),(0,i.supportsPathEditing)(e)&&e.stopEditingPath())},updateSelectionState:function(){let e=this.service.surface.value;e&&(e.model.getSelection().isEmpty()?this.$refs.root.removeAttribute(rr):this.$refs.root.setAttribute(rr,"true"))}},data:function(){return{ready:!1,hasLasso:!1}},render(){if(this.ready){let e=[];return this.showPan&&(e.push((0,d.h)("i",{class:`vjs-pan-mode ${Bo}`,[or]:i.SURFACE_MODE_PAN,onClick:()=>this.panMode(),title:"Pan mode"},[(0,d.h)("svg",{viewBox:i.PAN_VIEW_BOX,stroke:"currentColor",fill:"none"},[(0,d.h)("path",{d:i.PAN_PATH})])])),e.push((0,d.h)("i",{class:"vjs-select-mode",[or]:i.SURFACE_MODE_SELECT,onClick:()=>this.selectMode(),title:"Select mode"},[(0,d.h)("svg",{viewBox:i.LASSO_VIEW_BOX,stroke:"currentColor",fill:"currentColor"},[(0,d.h)("path",{d:i.LASSO_PATH})])]))),this.undoRedo&&(e.push((0,d.h)("i",{class:"vjs-undo",[Ir]:!0,title:"Undo last action",onClick:()=>this.undo()},[(0,d.h)("svg",{viewBox:i.UNDO_VIEW_BOX,stroke:"currentColor",fill:"none"},[(0,d.h)("path",{d:i.UNDO_PATH,"stroke-width":2})])])),e.push((0,d.h)("i",{class:"vjs-redo",[br]:!0,title:"Redo last action",onClick:()=>this.redo()},[(0,d.h)("svg",{viewBox:i.REDO_VIEW_BOX,stroke:"currentColor",fill:"none"},[(0,d.h)("path",{d:i.REDO_PATH,"stroke-width":2})])]))),this.zoomToExtents&&e.push((0,d.h)("i",{class:"vjs-zoom-to-fit",[Mr]:"true",onClick:()=>this.zoomToFit(),title:"Zoom to Fit"},[(0,d.h)("svg",{viewBox:i.ZOOM_TO_FIT_VIEW_BOX,stroke:"currentColor",fill:"currentColor"},[(0,d.h)("path",{d:i.ZOOM_TO_FIT_PATH})])])),this.zoomButtons&&(e.push((0,d.h)("i",{class:"vjs-zoom-in",[Vr]:"true",onClick:()=>this.zoomIn(),title:"Zoom In"},[(0,d.h)("svg",{viewBox:i.ZOOM_IN_OUT_VIEW_BOX,stroke:"currentColor",fill:"currentColor"},[(0,d.h)("path",{d:i.ZOOM_IN_PATH})])])),e.push((0,d.h)("i",{class:"vjs-zoom-out",[Lr]:"true",onClick:()=>this.zoomOut(),title:"Zoom Out"},[(0,d.h)("svg",{viewBox:i.ZOOM_IN_OUT_VIEW_BOX,stroke:"currentColor",fill:"currentColor"},[(0,d.h)("path",{d:i.ZOOM_OUT_PATH})])]))),e.push((0,d.h)("i",{class:i.CLASS_CONTROLS_RESET_SELECTION,[i.ATTRIBUTE_RESET_SELECTION]:"true",onClick:()=>{this.resetSelection()}},[(0,d.h)("svg",{viewBox:i.RESET_SELECTION_VIEW_BOX,stroke:"currentColor",fill:"currentColor"},[(0,d.h)("path",{d:i.RESET_SELECTION_PATH})])])),this.clear&&e.push((0,d.h)("i",{class:"vjs-clear-dataset",[wr]:"true",onClick:()=>{this.doClear()}},[(0,d.h)("svg",{viewBox:i.CLEAR_VIEW_BOX,stroke:"currentColor",fill:"currentColor"},[(0,d.h)("path",{d:i.CLEAR_PATH})])])),(0,d.h)(i.ELEMENT_DIV,{class:`vjs-controls ${this.className}`,ref:"root",[Uo]:!1,[Go]:!1,[i.ATTRIBUTE_CONTROLS_ORIENTATION]:this.orientation},e)}else return(0,d.h)(i.ELEMENT_DIV,{ref:"root"})},mounted(){let e=t=>{let r=t.getPlugin(i.LassoPlugin.type);this.showPan=r!=null,t.bind(i.EVENT_SURFACE_MODE_CHANGED,o=>{t.removeClass(t.$getSelector(this.$refs.root,"[data-mode]"),Bo),t.addClass(t.$getSelector(this.$refs.root,"[data-mode='"+o+"']"),Bo)}),t.model.bind(i.EVENT_UNDOREDO_UPDATE,o=>{this.$refs.root.setAttribute(Uo,o.undoCount>0?i.TRUE:i.FALSE),this.$refs.root.setAttribute(Go,o.redoCount>0?i.TRUE:i.FALSE)}),t.model.bind(i.EVENT_SELECT,()=>this.updateSelectionState()),t.model.bind(i.EVENT_DESELECT,()=>this.updateSelectionState()),t.model.bind(i.EVENT_SELECTION_CLEARED,()=>this.updateSelectionState()),this.$refs.root.setAttribute(Uo,i.FALSE),this.$refs.root.setAttribute(Go,i.FALSE),this.ready=!0};this.service.surface.value==null?(0,d.watch)(this.service.surface,e):e(this.service.surface.value)}};var B=require("vue"),T=require("@visuallyjs/browser-ui"),ko={name:Be,setup(e){return{service:(0,B.inject)(p)}},props:{surfaceId:{type:String},showLabel:{type:Boolean,default:!0},label:{type:String,default:"Export :"},margins:{type:Object},svgOptions:{type:Object},imageOptions:{type:Object},allowSvgExport:{type:Boolean,default:!0},allowPngExport:{type:Boolean,default:!0},allowJpgExport:{type:Boolean,default:!0}},methods:{loadSurface:function(e){let t=this.service.surface.value;t&&e(t)},exportSVG:function(){this.loadSurface(e=>{let t=this.svgOptions||{};this.margins!=null&&t.margins==null&&Object.assign(t,this.margins),new T.SvgExportUI(e).export(t)})},exportJPG:function(){this.loadSurface(e=>{let t=this.imageOptions||{};this.margins!=null&&t.margins==null&&Object.assign(t,this.margins),t.type="image/jpeg",new T.ImageExportUI(e).export(t)})},exportPNG:function(){this.loadSurface(e=>{let t=this.imageOptions||{};this.margins!=null&&t.margins==null&&Object.assign(t,this.margins),new T.ImageExportUI(e).export(t)})}},render(){let e=this.showLabel!==!1,t=this.allowSvgExport!==!1,r=this.allowPngExport!==!1,o=this.allowJpgExport!==!1,s=[];return t&&s.push((0,B.h)("i",{},[(0,B.h)("a",{href:"#","data-type":T.TYPE_SVG,onClick:()=>this.exportSVG()},"SVG")])),r&&s.push((0,B.h)("i",{},[(0,B.h)("a",{href:"#","data-type":T.TYPE_PNG,onClick:()=>this.exportPNG()},"PNG")])),o&&s.push((0,B.h)("i",{},[(0,B.h)("a",{href:"#","data-type":T.TYPE_JPG,onClick:()=>this.exportJPG()},"JPG")])),e&&s.unshift((0,B.h)("span",{},[this.label])),(0,B.h)(T.ELEMENT_DIV,{class:`${T.CLASS_CONTROLS} ${T.CLASS_EXPORT_CONTROLS}`},s)}};var te=require("vue"),ut=require("@visuallyjs/browser-ui"),Fo={setup(e){return{service:(0,te.inject)(p)}},name:be,props:{[H]:{type:String},[q]:{type:String,default:""},[Wt]:{type:Boolean,default:!0},[Ht]:{type:Boolean,default:!0},[$t]:{type:Boolean,default:!0},[zt]:{type:Boolean,default:!0},[Ft]:{type:Function}},mounted:function(){let e=t=>{t.addPlugin({type:ut.MiniviewPlugin.type,options:{container:this.$el,activeTracking:this.activeTracking,clickToCenter:this.clickToCenter,showLasso:this.showLasso,trackSelection:this.trackSelection,typeFunction:this.typeFunction}})};this.service.surface.value!=null&&e(this.service.surface.value),this.service.paper.value!=null?e(this.service.paper.value):((0,te.watch)(this.service.surface,e),(0,te.watch)(this.service.paper,e))},render:function(e){return(0,te.h)(ut.ELEMENT_DIV,{ref:"root",class:e.className})}};var ae=require("vue"),dt=require("@visuallyjs/browser-ui"),Ho={setup(e){return{service:(0,ae.inject)(p)}},name:Ue,props:{[I]:{type:Object},[R]:{type:String},[Q]:{type:Object},[K]:{type:Object}},mounted(){let e=this.$refs.root;this.diagram=(0,ae.markRaw)((0,dt.createDiagram)(e,this.options,this.modelOptions)),this.service.setDiagram(this.diagram),this.data?this.diagram.load({data:this.data}):this.url&&this.diagram.load({url:this.url})},render:function(){return(0,ae.h)(dt.ELEMENT_DIV,{ref:"root",class:"vjs-vue-surface",style:{width:"100%",height:"100%"}},this.$slots.hasOwnProperty("default")?this.$slots.default():[])}};var oe=require("vue"),P=require("@visuallyjs/browser-ui"),nr={[q]:{type:String},[I]:{type:Object},[R]:{type:String},[Zt]:{type:Boolean,default:!1}},ir={setup(){return{service:(0,oe.inject)(p)}},render:function(){return(0,oe.h)(P.ELEMENT_DIV,{class:`${this.className}`,ref:"root"})}};function W(e,t,r=!0){let o=ge(Z({},nr),{[K]:{type:Object}}),s={[I]:function(n){this.chart&&this.chart.load({data:n})},[R]:function(n){this.chart&&this.chart.load({url:n})},[K]:{handler:function(){this.o()},deep:!0}};r&&(o[rt]={type:Function},s[rt]=function(n){this.chart.setDataSourceFilter(n)});let c={o:function(){this.chart&&this.chart.destroy();let n=this.$refs.root,a=r?Object.assign({dataSourceFilter:this.dataSourceFilter},this.options):this.options;this.data&&(a.data=this.data),this.url&&(a.url=this.url);let l=()=>{this.chart=new t(n,a)};if(this.useModel)if(this.service.model.value!=null)a.dataSource=this.service.model.value,l();else{let f=(0,oe.watch)(this.service.model,h=>{h!=null&&(a.dataSource=h,l(),f())})}else l()}};return ge(Z({},ir),{name:e,props:o,watch:s,data:()=>({hasMounted:!1}),methods:c,mounted(){this.o()}})}var mt=W(je,P.ColumnChart),ht=W(ke,P.BarChart),ft=W(Fe,P.CategoryValueChart,!1),Pt=W(We,P.PieChart),Ot=W(He,P.LineChart),Et=W($e,P.AreaChart),yt=W(ze,P.ScatterChart),gt=W(Ke,P.BubbleChart),Ct=W(Je,P.GaugeChart,!1),Tt=ge(Z({},ir),{name:Ye,props:ge(Z({},nr),{[nt]:{type:String},[it]:{type:Object},[Yt]:{type:Boolean},[Xt]:{type:String},[K]:{type:Object}}),data:()=>({chart:null}),methods:{o:function(){this.chart&&this.chart.destroy();let e=this.$refs.root,t=Object.assign({},this.options);this.interactive!=null&&(t.interactive=this.interactive),this.pivot!=null&&(t.pivot=this.pivot),this.csvData&&(t.csvData=this.csvData),this.jsonData&&(t.jsonData=this.jsonData),this.url&&(t.url=this.url);let r=()=>{this.chart=new P.SankeyChart(e,t)};if(this.useModel)if(this.service.model.value==null){let o=(0,oe.watch)(this.service.model,s=>{s!=null&&(t.dataSource=s,r(),o())})}else t.dataSource=this.service.model.value,r();else r()}},mounted(){this.o()},watch:{pivot(e){this.chart&&this.chart.pivot(e)},[nt](e){this.chart&&this.chart.load({csvData:e})},[it](e){this.chart&&this.chart.load({jsonData:e})},[R](e){this.chart&&this.chart.load({url:e})},[K]:{handler:function(){this.o()},deep:!0}}});var le=require("vue"),pe=require("@visuallyjs/browser-ui"),$o={setup(e){return{service:(0,le.inject)(p)}},name:Ve,props:{[H]:{type:String},[qt]:{type:String},[Qt]:{type:Function},[eo]:{type:Function},[to]:{type:Function},[oo]:{type:[Boolean,Function],default:!1},[ro]:{type:Boolean,default:!0},[no]:{type:Boolean,default:!0},[io]:{type:Boolean,default:!1},[so]:{type:Boolean,default:!1},[fo]:Object,[ao]:Function,[Po]:Function,[q]:String,[Jt]:String,[lo]:{type:Boolean,default:!1},[co]:{type:Boolean,default:!1},[po]:{type:Boolean,default:!1},[uo]:{type:Boolean,default:!0},[mo]:{type:Number,default:2e3},[ho]:{type:[Boolean,Object],default:!1}},mounted:function(){let e=t=>{let r={source:this.$refs.root,selector:this.selector,dataGenerator:o=>this.dataGenerator?this.dataGenerator(o):(0,pe.defaultDataGenerator)(o),allowDropOnEdge:this.allowDropOnEdge===!0,allowDropOnGroup:this.allowDropOnGroup!==!1,allowDropOnCanvas:this.allowDropOnCanvas!==!1,allowDropOnNode:this.allowDropOnNode===!0,ignoreDropOnNode:this.ignoreDropOnNode===!0,canvasDropFilter:this.canvasDropFilter,onVertexAdded:this.onVertexAdded,dragSize:this.dragSize,mode:this.mode,allowRotation:this.allowRotation!==!1,rotationSpeed:this.rotationSpeed||2e3,autoEdgeConnect:this.autoEdgeConnect};this.groupIdentifier!=null&&(r.groupIdentifier=this.groupIdentifier),this.typeGenerator!=null&&(r.typeGenerator=this.typeGenerator),this.palette=new pe.Palette(t,r)};this.service.surface.value==null?(0,le.watch)(this.service.surface,e):e(this.service.surface.value)},render:function(){return(0,le.h)(pe.ELEMENT_DIV,{ref:"root",class:this.className||""},this.$slots.hasOwnProperty("default")?this.$slots.default():[])}};var sr=require("vue"),_t={setup(){(0,sr.provide)(p,new w("SurfaceProvider"))},render(){return this.$slots.hasOwnProperty("default")?this.$slots.default():[]}};var ar=require("vue"),St={setup(){(0,ar.provide)(p,new w("PaperProvider"))},render(){return this.$slots.hasOwnProperty("default")?this.$slots.default():[]}};var ce=require("vue"),U=require("@visuallyjs/browser-ui"),vt={name:ve,props:{data:{type:Object},showLabels:{type:Boolean,default:!1},labelProperty:{type:String,default:"label"},labelStrokeWidth:{type:Number},labelPosition:{type:Object,default:"center"},multilineLabels:{type:Boolean,default:!0},labelFillRatio:{type:Number,default:U.DEFAULT_LABEL_FILL_RATIO},labelColor:{type:String,default:"#000000"},font:{type:Object}},setup(){return{service:(0,ce.inject)(p)}},mounted(){let e=t=>{let r=t.getShapeLibrary(),o=r.renderCompiledShape(Object.assign({sw:this.getOutlineWidth()},this.data));if(this.$refs.container.appendChild(o),this.showLabels){let s=r.renderShapeLabel(this.data,this.labelProperty,this.labelStrokeWidth,null,this.labelColor,this.labelColor,this.font);this.$refs.container.appendChild(s),this.multilineLabels!=!1&&(0,U.convertToMultilineText)(s,this.data[this.labelProperty]||"",this.getWidth()*(this.labelFillRatio||U.DEFAULT_LABEL_FILL_RATIO),this.labelPosition)}};this.service.ui.value==null?(0,ce.watch)(this.service.ui,e):e(this.service.ui.value)},updated(){let e=this.service.surface.value;if(e){let t=e.getShapeLibrary(),r=t.renderCompiledShape(Object.assign({sw:this.getOutlineWidth()},this.data));if(this.$refs.container.replaceChildren(r),this.showLabels){let o=t.renderShapeLabel(this.data,this.labelProperty,this.labelStrokeWidth,null,this.labelColor,this.labelColor,this.font);this.$refs.container.appendChild(o),this.multilineLabels!=!1&&(0,U.convertToMultilineText)(o,this.data[this.labelProperty]||"",this.getWidth()*(this.labelFillRatio||U.DEFAULT_LABEL_FILL_RATIO),this.labelPosition)}}},render:function(){return(0,ce.h)(U.ELEMENT_SVG,{ref:"container",preserveAspectRatio:"none",fill:this.getFill(),stroke:this.getOutline(),"stroke-width":this.getOutlineWidth(),viewBox:"0 0 "+this.getWidth()+" "+this.getHeight(),class:U.CLASS_SHAPE})},methods:{getWidth:function(){return this.data.width||Oo},getHeight:function(){return this.data.height||Eo},getFill:function(){return this.data.fill||"#FFFFFF"},getOutline:function(){return this.data.outline||"#000000"},getOutlineWidth(){return this.data.outlineWidth||2}}};var ue=require("vue"),Rt=require("@visuallyjs/browser-ui"),Nt={name:Re,props:{surfaceId:{type:String},dragSize:Object,iconSize:Object,fill:String,outline:String,showAllMessage:String,selectAfterDrop:Boolean,paletteStrokeWidth:Number,dataGenerator:Function,initialSet:String,mode:String,allowClickToAdd:Boolean,onVertexAdded:Function,showLabels:Boolean,inspector:{type:Boolean,default:!0},updateTypeOnPaletteTap:Boolean,preparedShapes:Array,allowDropOnEdge:[Boolean,Function],autoEdgeConnect:[Boolean,Object],showGroups:{type:Boolean,default:!0}},setup(e){return{service:(0,ue.inject)(p)}},data:()=>({hasMounted:!1}),mounted(){let e=t=>{this.hasMounted||(this.hasMounted=!0,new Rt.ShapePalette(t,{container:this.$refs.container,shapeLibrary:t.getShapeLibrary(),dragSize:this.dragSize,iconSize:this.iconSize,fill:this.fill,outline:this.outline,showAllMessage:this.showAllMessage,selectAfterDrop:this.selectAfterDrop,paletteStrokeWidth:this.paletteStrokeWidth,dataGenerator:this.dataGenerator,initialSet:this.initialSet,mode:this.mode,allowClickToAdd:this.allowClickToAdd,onVertexAdded:this.onVertexAdded,showLabels:this.showLabels,inspector:this.inspector,updateTypeOnPaletteTap:this.updateTypeOnPaletteTap,preparedShapes:this.preparedShapes,allowDropOnEdge:this.allowDropOnEdge,autoEdgeConnect:this.autoEdgeConnect,showGroups:this.showGroups}))};this.service.surface.value==null?(0,ue.watch)(this.service.surface,e):e(this.service.surface.value)},render:function(){return(0,ue.h)(Rt.ELEMENT_DIV,{ref:"container"})}};var G=require("vue"),de=require("@visuallyjs/browser-ui"),F=Symbol.for("VueInspectorGetter"),lr=Symbol.for("VueInspectorSetter");function pr(){let e=[],t=null;function r(c){try{c(t)}catch(n){(0,de.log)("WARN: inspector listener threw an exception",n)}}let o={listen:c=>{t!=null?r(c):e.push(c)}},s={inspector:c=>{t=c,e.forEach(r)}};return(0,G.provide)(lr,s),(0,G.provide)(F,(0,G.readonly)(o)),s}var At={name:Xe,props:{autoCommit:{type:Boolean,default:!0},multipleSelections:{type:Boolean,default:!0},filter:Function,renderEmptyContainer:Function,refresh:Function,className:String,showCloseButton:Boolean,afterUpdate:Function,modelValue:Object},emits:["update:modelValue"],setup(e,t){let r=pr();return{service:(0,G.inject)(p),inspectorProvider:r,inspector:null,emit:t.emit}},mounted(){let e=t=>{if(this.inspector==null){let r=new de.Inspector({container:this.$refs.root,ui:t,renderEmptyContainer:()=>(this.emit("update:modelValue",null),this.renderEmptyContainer?this.renderEmptyContainer():""),refresh:(o,s)=>{this.emit("update:modelValue",o),this.refresh&&this.refresh(o),setTimeout(s)},autoCommit:this.autoCommit,multipleSelections:this.multipleSelections,filter:this.filter,showCloseButton:this.showCloseButton,afterUpdate:()=>this.afterUpdate?this.afterUpdate(t):null});this.inspectorProvider.inspector(r)}};this.service.surface.value==null?(0,G.watch)(this.service.surface,e):e(this.service.surface.value)},render(){return(0,G.h)(de.ELEMENT_DIV,{ref:"root"},this.$slots.hasOwnProperty("default")?this.$slots.default():[])}};var xt=require("vue"),me=require("@visuallyjs/browser-ui"),he={name:Ne,props:{propertyName:String},setup(){return{inspectorProvider:(0,xt.inject)(F)}},mounted(){this.inspectorProvider?this.inspectorProvider.listen(e=>{let t=new me.EdgeTypePicker(e.$ui,this.$refs.container,e.$ui.$getEdgePropertyMappings(),e.getValue(this.propertyName),(r,o)=>{e.setValue(this.propertyName,o,null)});t.render(this.propertyName,e.f),e.onChange(()=>{t.reset(),t.select(this.propertyName,e.getValue(this.propertyName))})}):(0,me.log)("WARN: EdgeTypePicker not instantiated inside an InspectorComponent. Cannot mount.")},render:function(){return(0,xt.h)(me.ELEMENT_DIV,{ref:"container"})}};var re=require("vue"),y=require("@visuallyjs/browser-ui"),et={render(){let e=this.swatches.map(t=>(0,re.h)(y.ELEMENT_DIV,{title:t,class:y.CLASS_COLOR_PICKER_SWATCH,style:`background-color:${t}`,"data-color":t,onClick:()=>this.selectSwatch(t)}));return(0,re.h)(y.ELEMENT_DIV,{class:`${y.CLASS_COLOR_PICKER}`},[(0,re.h)("input",{type:"color","vjs-att":this.propertyName,ref:"colorInput"}),(0,re.h)(y.ELEMENT_DIV,{class:y.CLASS_COLOR_PICKER_SWATCHES},e)])},props:{propertyName:String,maxColors:{type:Number,default:10}},data:()=>({CLASS_COLOR_PICKER:y.CLASS_COLOR_PICKER,CLASS_COLOR_PICKER_SWATCHES:y.CLASS_COLOR_PICKER_SWATCHES,CLASS_COLOR_PICKER_SWATCH:y.CLASS_COLOR_PICKER_SWATCH,colorInput:null,swatches:[]}),mounted(){let e=(0,re.inject)(F);e&&e.listen(t=>{this.inspector=t,this.swatches=t.ensureContext(y.INSPECTOR_CONTEXT_RECENT_COLORS,()=>[]),this.colorInput=this.$refs.colorInput,this.colorInput.addEventListener("change",this.colorPicked),t.bind(y.EVENT_CONTEXT_UPDATE,r=>{r.key===y.INSPECTOR_CONTEXT_RECENT_COLORS&&(this.swatches=r.value.slice())}),t.bind("change",this.setCurrentColor),this.setCurrentColor()})},methods:{addColor:function(e){let t=this.inspector.ensureContext(y.INSPECTOR_CONTEXT_RECENT_COLORS,()=>[]);if(e=e.toUpperCase(),!(t.find(o=>o.toUpperCase()===e)!=null)){let o=this.maxColors||10,s=t.slice();s.unshift(e),s.length>o&&(s.length=o),this.inspector.updateContext(y.INSPECTOR_CONTEXT_RECENT_COLORS,s)}},colorPicked:function(){let e=this.colorInput.value;this.inspector.setValue(this.propertyName,e,null),this.addColor(e)},selectSwatch:function(e){this.inspector.setValue(this.propertyName,e,null),this.colorInput.value=e},setCurrentColor:function(){let e=this.inspector.getValue(this.propertyName);e!=null&&(this.colorInput.value=e,this.addColor(e))}}};var N=require("vue"),fe=require("@visuallyjs/browser-ui"),Dt={props:{placement:{type:String,default:"floating"},position:{type:Object},constraints:{type:Object}},data:()=>({hasMounted:!1,surface:null}),setup(e){return{service:(0,N.inject)(p)}},mounted(){let e=t=>{if(!this.hasMounted){this.surface=t,this.hasMounted=!0;let r=this.position||{x:0,y:0};(0,N.nextTick)().then(()=>{this.placement==="floating"?t.floatElement(this.$refs.root,r):t.fixElement(this.$refs.fixedEl,r,this.constraints)})}};this.service.surface.value==null?(0,N.watch)(this.service.surface,e):e(this.service.surface.value)},render(){return(0,N.h)(fe.ELEMENT_DIV,{ref:"root"},this.hasMounted?this.placement==="floating"?(0,N.h)(fe.ELEMENT_DIV,{},this.$slots.hasOwnProperty("default")?this.$slots.default():[]):(0,N.h)(N.Teleport,{to:this.surface.vertexLayer,key:(0,fe.uuid)()},(0,N.h)(fe.ELEMENT_DIV,{ref:"fixedEl"},this.$slots.hasOwnProperty("default")?this.$slots.default():[])):[])}};var cr=require("vue"),It={setup(){(0,cr.provide)(p,new w("DiagramProvider"))},render(){return this.$slots.hasOwnProperty("default")?this.$slots.default():[]}};var Pe=require("vue"),Oe=require("@visuallyjs/browser-ui"),bt={name:Ge,props:{fill:String,outline:String,dragSize:Object,inspector:{type:Boolean,default:!0},updateTypeOnPaletteTap:Boolean,iconSize:Object,showLabels:Boolean,paletteStrokeWidth:Number,showAllMessage:String,onCellAdded:Function,mode:String,allowClickToAdd:Boolean,autoExitDrawMode:Boolean,selectAfterAdd:{type:Boolean,default:!0},className:String,diagram:{type:Object},onVertexAdded:Function,preparedShapes:Array,allowDropOnEdge:[Boolean,Function],autoEdgeConnect:[Boolean,Object],showGroups:{type:Boolean,default:!0}},setup(e){return{service:(0,Pe.inject)(p)}},data:()=>({hasMounted:!1}),mounted(){if(this.service==null&&this.diagram==null)(0,Oe.log)("Cannot mount DiagramPalette - no service found and Diagram not passed in as a prop");else{let e=t=>{this.hasMounted||(this.hasMounted=!0,new Oe.DiagramPalette(this.$refs.container,t,{fill:this.fill,outline:this.outline,dragSize:this.dragSize,inspector:this.inspector,iconSize:this.iconSize,showLabels:this.showLabels,paletteStrokeWidth:this.paletteStrokeWidth,showAllMessage:this.showAllMessage,onCellAdded:this.onCellAdded,mode:this.mode,allowClickToAdd:this.allowClickToAdd,autoExitDrawMode:this.autoExitDrawMode,selectAfterAdd:this.selectAfterAdd,onVertexAdded:this.onVertexAdded,updateTypeOnPaletteTap:this.updateTypeOnPaletteTap,preparedShapes:this.preparedShapes,allowDropOnEdge:this.allowDropOnEdge,autoEdgeConnect:this.autoEdgeConnect,showGroups:this.showGroups}))};this.diagram?e(this.diagram):this.service.diagram.value!=null?e(this.service.diagram.value):(0,Pe.watch)(this.service.diagram,e)}},render:function(){return(0,Pe.h)(Oe.ELEMENT_DIV,{ref:"container"})}};var M=require("@visuallyjs/browser-ui"),A=require("vue"),Mt={name:"SurfacePopup",props:{selector:String,anchor:{type:String,default:"bottom"}},setup(e){let t=(0,A.inject)(p),r=(0,A.ref)(null),o=(0,A.ref)("block"),s=(0,A.ref)(null),c=(0,A.ref)(null),n=a=>{c.value=new M.PopupHandler(e.selector,s.value,a,l=>{r.value=l,l==null?o.value=M.NONE:(o.value=M.BLOCK,requestAnimationFrame(()=>c.value.$positionPopup()))},e.anchor)};return(0,A.onMounted)(()=>{t.surface.value==null?(0,A.watch)(t.surface,n):n(t.surface.value)}),{service:t,current:r,display:o,rootRef:s,handler:c}},render(){var e;return(0,A.h)(M.ELEMENT_DIV,{ref:"rootRef",display:this.display,position:M.ABSOLUTE,class:M.CLASS_SURFACE_POPUP},this.$slots.hasOwnProperty("default")?this.$slots.default({vertex:this.current,model:(e=this.service.surface.value)==null?void 0:e.model,ui:this.service.surface.value,hide:()=>{var t;return(t=this.handler)==null?void 0:t.$hide()}}):[])}};var S=require("vue"),j=require("@visuallyjs/browser-ui"),Wo={setup(){return{service:(0,S.inject)(p)}},name:Ae,props:{options:{type:Object}},mounted:function(){let e=t=>{t.addPlugin({type:j.BackgroundPlugin.type,options:this.options})};this.service.surface.value!=null&&e(this.service.surface.value),this.service.paper.value!=null?e(this.service.paper.value):((0,S.watch)(this.service.surface,e),(0,S.watch)(this.service.paper,e))},render:function(e){return[]}},zo={setup(){return{service:(0,S.inject)(p)}},name:xe,props:{grid:{type:Object},showBorder:{type:Boolean},minWidth:{type:Number},minHeight:{type:Number},showTickMarks:{type:Boolean},tickMarksPerCell:{type:Number},maxWidth:{type:Number},maxHeight:{type:Number},autoShrink:{type:Boolean},gridType:{type:String},dotRadius:{type:Number},tickDotRadius:{type:Number},visible:{type:Boolean}},mounted:function(){let e=t=>{t.addPlugin({type:j.BackgroundPlugin.type,options:{type:j.GeneratedGridBackground.type,grid:this.grid,showBorder:this.showBorder,minWidth:this.minWidth,minHeight:this.minHeight,showTickMarks:this.showTickMarks,tickMarksPerCell:this.tickMarksPerCell,maxWidth:this.maxWidth,maxHeight:this.maxHeight,autoShrink:this.autoShrink,gridType:this.gridType,dotRadius:this.dotRadius,tickDotRadius:this.tickDotRadius,visible:this.visible}})};this.service.surface.value!=null&&e(this.service.surface.value),this.service.paper.value!=null?e(this.service.paper.value):((0,S.watch)(this.service.surface,e),(0,S.watch)(this.service.paper,e))},render:function(e){return[]}},Ko={setup(){return{service:(0,S.inject)(p)}},name:De,props:{url:{type:String}},mounted:function(){let e=t=>{t.addPlugin({type:j.BackgroundPlugin.type,options:{type:j.SimpleBackground.type,url:this.url}})};this.service.surface.value!=null&&e(this.service.surface.value),this.service.paper.value!=null?e(this.service.paper.value):((0,S.watch)(this.service.surface,e),(0,S.watch)(this.service.paper,e))},render:function(e){return[]}},Jo={setup(){return{service:(0,S.inject)(p)}},name:Ie,props:{url:{type:String},urlGenerator:{type:Function},tileSize:{type:Object},width:{type:Number},height:{type:Number},maxZoom:{type:Number},tiling:{type:String},panDebounceTimeout:{type:Number},zoomDebounceTimeout:{type:Number}},mounted:function(){let e=t=>{t.addPlugin({type:j.BackgroundPlugin.type,options:{type:j.TiledBackground.type,url:this.url,urlGenerator:this.urlGenerator,tileSize:this.tileSize,width:this.width,height:this.height,tiling:this.tiling,panDebounceTimeout:this.panDebounceTimeout,zoomDebounceTimeout:this.zoomDebounceTimeout}})};this.service.surface.value!=null&&e(this.service.surface.value),this.service.paper.value!=null?e(this.service.paper.value):((0,S.watch)(this.service.surface,e),(0,S.watch)(this.service.paper,e))},render:function(e){return[]}};var ne=require("vue"),J=require("@visuallyjs/browser-ui"),wt={name:Ze,props:{getPropertyName:Function,showName:{type:Boolean,default:!0},cssClass:String,mappings:Array},setup(){return{inspectorProvider:(0,ne.inject)(F)}},data(){return{inspector:null}},mounted(){this.inspectorProvider?this.inspectorProvider.listen(e=>{this.inspector=e}):(0,J.log)("WARN: EdgePropertyMappingsInspector not instantiated inside an InspectorComponent.")},methods:{resolveMappings(){return this.mappings?this.mappings:this.inspector?this.inspector.getFromContext(J.INSPECTOR_CONTEXT_EDGE_PROPERTY_MAPPINGS)||this.inspector.$ui.$getEdgePropertyMappings():[]},toList(e){let t=e.property;return Array.isArray(t)?t:[t]},getPropertyKey(e){return this.toList(e).join(" ")},getName(e){return this.getPropertyName?this.getPropertyName(e):e.name||this.getPropertyKey(e)}},render(){let e=this.resolveMappings(),t=this.cssClass||"vjs-inspector-section";return(0,ne.h)(J.ELEMENT_DIV,{},e.map(r=>{let o=this.getPropertyKey(r),s=this.getName(r),c=[];return this.showName!==!1&&c.push((0,ne.h)(J.ELEMENT_DIV,{},s)),c.push((0,ne.h)(he,{propertyName:o})),(0,ne.h)(J.ELEMENT_DIV,{class:t,key:o},c)}))}};var u=require("vue"),C=require("@visuallyjs/browser-ui"),Br=7,Ur=["True","False"];function Vt(e,t){return(e.booleanLabels||Ur)[t?0:1]}function Y(e){return(0,C.isString)(e)?e:e.label}function Lt(e){return(0,C.isString)(e)?e:e.value}function Gr(e,t,r){let o=r==null?void 0:r.getValue(e.id);return o==null&&(o=e.id.split(".").reduce((s,c)=>s==null?s:s[c],t.data)),o==null&&(o=e.defaultValue),o==null?"":typeof o=="object"?JSON.stringify(o)||"":String(o)}var Bt={name:qe,props:{vertex:Object,maxRadios:Number},setup(){return{inspectorProvider:(0,u.inject)(F)}},data(){return{inspector:null,inspectorRevision:0,inspectorChangeListener:null}},mounted(){this.inspectorProvider?this.inspectorProvider.listen(e=>{this.inspector&&this.inspectorChangeListener&&this.inspector.unbind(C.EVENT_CHANGE,this.inspectorChangeListener),this.inspector=e,this.inspectorChangeListener=()=>this.inspectorRevision++,this.inspector.bind(C.EVENT_CHANGE,this.inspectorChangeListener)}):(0,C.log)("WARN: ShapePropertiesInspector not instantiated inside an InspectorComponent.")},beforeUnmount(){this.inspector&&this.inspectorChangeListener&&this.inspector.unbind(C.EVENT_CHANGE,this.inspectorChangeListener)},methods:{getPropertyDisplayValue(e,t){return this.inspectorRevision,Gr(e,t,this.inspector)},resolveShapeDef(){if(this.inspector==null||this.vertex==null||!(0,C.isNode)(this.vertex))return null;let{type:e,category:t}=this.vertex.data;if(!e||!t)return null;let o=this.inspector.$ui.getShapeLibrary().getShapeSet(t);return o?o.shapes.find(s=>s.type===e):null}},render(){let e=this.vertex;if(!e||!(0,C.isNode)(e))return null;let t=this.resolveShapeDef();if(!t||!t.properties)return null;let r=this.maxRadios==null?Br:this.maxRadios;return t.properties.map(o=>{let s=o.type==="boolean",c=o.values&&o.values.length>0,n=c&&o.editor!=="select"&&o.values.length<=r,a=[];return(o.readOnly||!s||o.editor==="select"||o.editor==="radio")&&a.push((0,u.h)("label",{class:"vjs-inspector-property-label"},o.label||o.id)),o.readOnly?a.push((0,u.h)("output",{class:"vjs-inspector-property-value"},this.getPropertyDisplayValue(o,e))):o.type==="string"?c?n?a.push((0,u.h)(C.ELEMENT_DIV,{class:"vjs-radio-group"},o.values.map(l=>(0,u.h)("label",{key:Y(l)},[(0,u.h)("input",{type:"radio",name:o.id,"vjs-att":o.id,value:Lt(l)})," "+Y(l)])))):a.push((0,u.h)("select",{"vjs-att":o.id},o.values.map(l=>(0,u.h)("option",{key:Y(l),value:Lt(l)},Y(l))))):a.push((0,u.h)("input",{type:"text","vjs-att":o.id,placeholder:o.description})):o.type==="text"?a.push((0,u.h)("textarea",{rows:5,"vjs-att":o.id,placeholder:o.description})):o.type==="color"?a.push((0,u.h)(et,{propertyName:o.id})):o.type==="number"?c?n?a.push((0,u.h)(C.ELEMENT_DIV,{class:"vjs-radio-group"},o.values.map(l=>(0,u.h)("label",{key:Y(l)},[(0,u.h)("input",{type:"radio",name:o.id,"vjs-att":o.id,value:Lt(l)})," "+Y(l)])))):a.push((0,u.h)("select",{"vjs-att":o.id},o.values.map(l=>(0,u.h)("option",{key:Y(l),value:Lt(l)},Y(l))))):a.push((0,u.h)("input",{type:"number","vjs-att":o.id,placeholder:o.description,min:o.min,max:o.max})):s?o.editor==="select"?a.push((0,u.h)("select",{"vjs-att":o.id,"vjs-datatype":"boolean"},[(0,u.h)("option",{value:""}),(0,u.h)("option",{value:"true"},Vt(o,!0)),(0,u.h)("option",{value:"false"},Vt(o,!1))])):o.editor==="radio"?a.push((0,u.h)(C.ELEMENT_DIV,{class:"vjs-radio-group"},[(0,u.h)("label",[(0,u.h)("input",{type:"radio",name:o.id,"vjs-att":o.id,"vjs-datatype":"boolean",value:"true"}),(0,u.h)("span",Vt(o,!0))]),(0,u.h)("label",[(0,u.h)("input",{type:"radio",name:o.id,"vjs-att":o.id,"vjs-datatype":"boolean",value:"false"}),(0,u.h)("span",Vt(o,!1))])])):a.push((0,u.h)("label",[(0,u.h)("input",{type:"checkbox","vjs-datatype":"boolean","vjs-att":o.id})," "+(o.label||o.id)])):a.push((0,u.h)("input",{type:"text","vjs-att":o.id,placeholder:o.description})),o.description&&a.push((0,u.h)(C.ELEMENT_DIV,{class:"vjs-field-desc"},o.description)),(0,u.h)(C.ELEMENT_DIV,{key:o.id,class:"vjs-inspector-field"},a)})}};var jr={install:function(e,t){e.component(_o,_t),e.component(So,St),e.component(vo,It),e.component(Me,Vo),e.component(we,Lo),e.component(Ue,Ho),e.component(be,Fo),e.component(Le,jo),e.component(Be,ko),e.component(Ae,Wo),e.component(xe,zo),e.component(De,Ko),e.component(Ie,Jo),e.component(Ve,$o),e.component(Ge,bt),e.component(ke,ht),e.component(je,mt),e.component(Fe,ft),e.component(He,Ot),e.component($e,Et),e.component(We,Pt),e.component(Ye,Tt),e.component(Je,Ct),e.component(Ke,gt),e.component(ze,yt),e.component(ve,vt),e.component(Re,Nt),e.component(Ne,he),e.component(yo,et),e.component(Xe,At),e.component(Ze,wt),e.component(qe,Bt),e.component(No,Dt),e.component(Ro,Mt),e.provide(p,new w("root"))}};var Ee=require("vue"),Ut=require("@visuallyjs/browser-ui"),ur=require("vue");function kr(){let e=(0,ur.inject)(p),t=(0,Ee.shallowRef)(null),r=(0,Ee.shallowRef)(null),o=(0,Ee.shallowRef)(null),s=(0,Ee.ref)(1);return e==null||e.getSurface(c=>{r.value=c,r.value.bind(Ut.EVENT_ZOOM,n=>{s.value=n.zoom})}),e==null||e.getDiagram(c=>{t.value=c,t.value.$ui.bind(Ut.EVENT_ZOOM,n=>{s.value=n.zoom})}),e==null||e.getPaper(c=>{o.value=c,o.value.bind(Ut.EVENT_ZOOM,n=>{s.value=n.zoom})}),s}var Gt=require("vue"),ye=require("@visuallyjs/browser-ui");function Fr(e){let t=(0,Gt.inject)(p);if(t){let r=null,o=()=>{r&&e(r)},s=()=>{r&&(r.unbind(ye.EVENT_DATA_UPDATED,o),r.unbind(ye.EVENT_GRAPH_CLEARED,o))},c=n=>{s(),r=n,r&&(r.bind(ye.EVENT_DATA_UPDATED,o),r.bind(ye.EVENT_GRAPH_CLEARED,o),o())};t.getModel(n=>{c(n)}),(0,Gt.onUnmounted)(()=>{s()})}}var dr=require("vue"),mr=require("vue");function Hr(){let e=(0,mr.inject)(p),t=(0,dr.shallowRef)(null);return e==null||e.getSurface(r=>{t.value=r}),t}var hr=require("vue"),fr=require("vue");function $r(){let e=(0,fr.inject)(p),t=(0,hr.shallowRef)(null);return e==null||e.getDiagram(r=>{t.value=r}),t}var Pr=require("vue"),Or=require("vue");function Wr(){let e=(0,Or.inject)(p),t=(0,Pr.shallowRef)(null);return e==null||e.getPaper(r=>{t.value=r}),t}
@@ -1 +1 @@
1
- var nr=Object.defineProperty,ir=Object.defineProperties;var sr=Object.getOwnPropertyDescriptors;var Et=Object.getOwnPropertySymbols;var ar=Object.prototype.hasOwnProperty,lr=Object.prototype.propertyIsEnumerable;var gt=(e,t,r)=>t in e?nr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,b=(e,t)=>{for(var r in t||(t={}))ar.call(t,r)&&gt(e,r,t[r]);if(Et)for(var r of Et(t))lr.call(t,r)&&gt(e,r,t[r]);return e},L=(e,t)=>ir(e,sr(t));import{log as pr,BrowserUIModel as cr}from"@visuallyjs/browser-ui";var g=class extends cr{render(t,r){return pr("render called directly on BrowserUiVue class: should not happen. Surface component should use internal render."),null}};function Vs(e){return e=e||{},new g(e)}var yt="surfaceId",Ct="paperId",Tt="typeFunction",_t="clickToCenter",St="showLasso",vt="activeTracking",Rt="trackSelection",N="surfaceId",Nt="paperId",V="className",y="data",At="mode",M="options",H="renderOptions",B="modelOptions",$="model",W="viewOptions",E="url",z="dataType",xt="interactive",Dt="pivot",Be="dataSourceFilter",Le="csvData",Ue="jsonData",It="useModel",ma="id",bt="selector",Mt="dataGenerator",wt="typeGenerator",Vt="groupIdentifier",Bt="allowDropOnEdge",Lt="allowDropOnCanvas",Ut="allowDropOnGroup",Gt="allowDropOnNode",jt="ignoreDropOnNode",kt="onVertexAdded",Ft="selectAfterAdd",Ht="clickToAddOnly",$t="allowClickToAdd",Wt="allowRotation",zt="rotationSpeed",Kt="autoEdgeConnect",Jt="dragSize",Yt="canvasDropFilter",K="Shape",J="ShapePalette",Xt=120,Zt=90,Y="EdgeTypePickerComponent",qt="ColorPickerComponent",Qt="vjs-vue-node",eo="vjs-vue-group",to="vjs-vue-overlay",X="BackgroundComponent",Z="GridBackgroundComponent",q="ImageBackgroundComponent",Q="TiledImageBackgroundComponent",ee="MiniviewComponent",te="SurfaceComponent",oo="SurfaceProvider",oe="PaperComponent",ro="PaperProvider",no="DiagramProvider",re="PaletteComponent",ne="ControlsComponent",ie="ExportControlsComponent",se="DiagramComponent",ae="DiagramPaletteComponent",le="ColumnChartComponent",pe="BarChartComponent",ce="XYChartComponent",ue="LineChartComponent",de="AreaChartComponent",me="PieChartComponent",he="ScatterChartComponent",fe="BubbleChartComponent",Pe="GaugeChartComponent",Oe="SankeyChartComponent",Ee="InspectorComponent",ge="EdgePropertyMappingsInspector",io="SurfacePopup",so="Decorator",ye="ShapePropertiesInspectorComponent";import{addClass as ur,BrowserUI as dr,isGroup as mr,Vertex as ao}from"@visuallyjs/browser-ui";var Ce={props:{data:Object,model:g,obj:ao,vertex:ao,ui:dr,el:Element,def:Object,eventInfo:Object},mounted(){let e=this,t=mr(e.vertex)?eo:Qt;e.el.firstElementChild&&ur(e.el.firstElementChild,t),e.ui.$vertexRendered(e.vertex,e.el,e.def,e.eventInfo),lo(e.ui.id,e.vertex)},methods:{getModel:function(){return this.model},removeVertex:function(){this.model.remove(this.vertex)}},updated(){this.ui.$revalidateElement(this.el),po(this.ui.id,this.vertex)}};var co={mixins:[Ce],methods:{getNode:function(){return this.obj},removeNode:function(){this.model.removeNode(this.getNode())},updateNode:function(e){this.model.updateNode(this.obj,e);let t=this.ui.getRenderedElement(this.obj.getFullId());this.ui.$revalidateElement(t)}}};var uo={methods:{getGroup:function(){return this.obj},removeGroup:function(e){this.model.removeGroup(this.obj,e)},updateGroup:function(e){this.model.updateGroup(this.obj,e);let t=this.ui.getRenderedElement(this.obj.getFullId());this.ui.$revalidateElement(t)}},mixins:[Ce]};import{markRaw as C}from"vue";import{addClass as hr,BrowserUI as fr,CLASS_DEFAULT_GROUP as Pr,CLASS_DEFAULT_NODE as Or,ELEMENT_DIV as mo,extend as ho,isGroup as Er,OptimisticEventGenerator as gr,renderSurface as yr,updateClasses as Cr,Overlay as Tr,Edge as fo,OVERLAY_TYPE_CUSTOM as _r,uuid as Sr,renderPaper as vr}from"@visuallyjs/browser-ui";var Ge=class{constructor(){this.unrenderedVertices=new Map;this.eventManager=new gr;this.hasRendered=!1}vertexWillRender(t){this.unrenderedVertices.set(t.id,t),this.hasRendered=!1}vertexHasRendered(t){this.unrenderedVertices.delete(t.id),this.unrenderedVertices.size===0&&(this.hasRendered=!0,this.eventManager.fire(je))}vertexHasUpdated(t){this.eventManager.fire(Rr,t)}},je="vertices:rendered",Rr="vertex:updated",ke=new Map;function Te(e){return ke.has(e)||ke.set(e,new Ge),ke.get(e)}function lo(e,t){Te(e).vertexHasRendered(t)}function po(e,t){Te(e).vertexHasUpdated(t)}function Nr(e,t){Te(e).vertexWillRender(t)}function Xa(e,t,r){let o=Te(e);o&&(o.eventManager.bind(t,r),t===je&&o.hasRendered&&o.eventManager.fire(je))}var _e=(e,t)=>{t.parentNode&&t.parentNode.removeChild(t)},Po={props:{data:Object,model:g,obj:fo,edge:fo,overlay:Tr,ui:fr,el:Element,def:Object,eventInfo:Object},mounted(){let e=this;e.el.firstElementChild&&hr(e.el.firstElementChild,to)},updated(){this.ui.$revalidateElement(this.el)}},Se=(e,t,r,o,a,p,n,s,i)=>{let m=n.component!=null,c=Er(s),f=[];m||f.push(c?Pr:Or);let h=m?n.component:{render(P){return P.data.label||""}};if(h){let P=document.createElement(mo);Cr(P,f),h.mixins==null&&(h.mixins=[]);let O=c?uo:co;h.mixins.find(T=>T===O)||h.mixins.push(O),Nr(p.id,s);let w={data:r,model:C(o),ui:C(p),obj:C(s),vertex:C(s),el:P,def:C(n),eventInfo:i==null?null:C(i)};if(n.inject)for(let T in n.inject){let I=n.inject[T],rr=typeof I=="function"?I(s,o):I;w[T]=rr}e.push({component:C(h),el:P,t:s.getFullId(),props:w,vertex:s})}};function Oo(e,t,r,o,a,p){let n={reactive:!0,asynchronous:!0,usesWrapperElement:!1,update:(i,m,c,f)=>{},render:(i,m,c,f,h,P,O,R)=>Se(o,i,m,c,f,h,P,O,R),cleanupVertex:_e,cleanupPort:_e,rerender:(i,m,c,f,h,P,O,R,w)=>{let T=o.findIndex(I=>I.vertex===O);T!=null&&o.splice(T,1)[0].el,h.$__unmanage(w,!0,!0),requestAnimationFrame(()=>{Se(o,i,m,c,f,h,P,O,R)})}},s=ho(a||{},{view:p||{},id:t});return yr(e,r,n,s)}function Eo(e,t,r,o,a,p){let n={reactive:!0,asynchronous:!0,usesWrapperElement:!1,update:(i,m,c,f)=>{},render:(i,m,c,f,h,P,O,R)=>Se(o,i,m,c,f,h,P,O,R),cleanupVertex:_e,cleanupPort:_e,rerender:(i,m,c,f,h,P,O,R,w)=>{let T=o.findIndex(I=>I.vertex===O);T!=null&&o.splice(T,1)[0].el,h.$__unmanage(w,!0,!0),requestAnimationFrame(()=>{Se(o,i,m,c,f,h,P,O,R)})}},s=ho(a||{},{view:p||{},id:t});return vr(e,r,n,s)}function ve(e,t,r,o){if(e.edges)for(let a in e.edges){let p=e.edges[a];p.overlays&&(p.overlays=p.overlays.map(n=>{let s={};return n.component!=null?{type:_r,options:{create:m=>{let c=document.createElement(mo),f=Sr();n.component.mixins==null&&(n.component.mixins=[]),n.component.mixins.indexOf(Po)===-1&&n.component.mixins.push(Po);let h=b({data:m.edge.data,model:C(r()),ui:C(t()),obj:m.edge,edge:m.edge,el:c,def:C(n),eventInfo:null,overlay:n},s);return o.push({component:C(n.component),el:c,t:f,props:h}),c}}}:n}))}}import{log as go,Paper as Ar,Surface as xr}from"@visuallyjs/browser-ui";import{shallowRef as U}from"vue";var l=Symbol.for("visuallyjs-service"),_=class{constructor(t){this.context=t;this.a=[];this.l=[];this.p=[];this.c=[];this.surface=U(null);this.model=U(null);this.paper=U(null);this.diagram=U(null);this.ui=U(null)}getSurface(t){this.r(this.l,t,this.u)}getDiagram(t){this.r(this.p,t,this.m)}getPaper(t){this.r(this.c,t,this.h)}getModel(t){this.r(this.a,t,this.i)}getModelDirect(){return this.i}r(t,r,o){if(o!=null)try{r(o)}catch(a){go(`WARN: could not dispatch ${a}`)}else t.push(r)}setSurface(t){this.surface.value=t,this.model.value=t.model,this.ui.value=t,this.u=t,this.s(t.model),this.n(this.l,t)}setDiagram(t){this.diagram.value=t,this.model.value=t.model,this.ui.value=t.$ui,this.m=t,this.s(t.model),t.$ui instanceof xr?this.setSurface(t.$ui):t.$ui instanceof Ar&&this.setPaper(t.$ui),this.n(this.p,t)}setPaper(t){this.paper.value=t,this.model.value=t.model,this.ui.value=t,this.h=t,this.s(t.model),this.n(this.c,t)}s(t){this.i=t,this.n(this.a,t)}n(t,r){t.forEach(o=>{try{o(r)}catch(a){go(`WARN: could not flush all queue entries ${a}`)}})}};import{h as G,inject as Dr,Teleport as yo}from"vue";import{ELEMENT_DIV as Ir,EVENT_GROUP_REMOVED as br,EVENT_GROUP_UPDATED as Mr,EVENT_NODE_REMOVED as wr,EVENT_NODE_UPDATED as Vr,EVENT_RENDER_END as Br,clone as Co,EVENT_EDGE_UPDATED as Lr,EVENT_EDGE_REMOVED as Ur,EVENT_GRAPH_CLEARED as Gr}from"@visuallyjs/browser-ui";var To={setup(e){return{service:Dr(l),surfaceId:e.surfaceId||yt}},name:te,props:{[y]:{type:Object},[H]:{type:Object},[B]:{type:Object},[W]:{type:Object},[$]:{type:Object},[E]:{type:String},[z]:{type:String},[N]:{type:String}},data:function(){return{vertices:[],overlays:[]}},mounted(){let e=this,t=this.model||new g(this.modelOptions||{}),r=this.$refs.root;e.e=!1;let o=Co(this.viewOptions||{});ve(o,()=>this.surface,()=>t,this.overlays),this.surface=Oo(t,this.surfaceId,r,this.vertices,Co(this.renderOptions||{}),o),this.service.setSurface(this.surface);let a=(n,s)=>{let i=()=>{let c={};return s.originalData||s.updates?c=Object.assign(s.originalData,s.updates):s.newData&&Object.assign(c,s.newData),c},m=this.vertices.find(c=>c.t===n);m!=null&&(m.props.data=i())},p=n=>{let s=this.vertices.findIndex(i=>i.t===n);s!==-1&&this.vertices.splice(s,1)};t.bind(Vr,n=>{a(n.vertex.getFullId(),n)}),t.bind(Mr,n=>{a(n.vertex.getFullId(),n)}),t.bind(wr,n=>{p(n.node.id)}),t.bind(br,n=>{p(n.group.id)}),t.bind(Lr,n=>{let s=n.edge.id;this.overlays.forEach(i=>{i.props.edge&&i.props.edge.id===s&&(i.props.data=n.edge.data)})}),t.bind(Ur,n=>{let s=n.edge.id,i=this.overlays.length-1;for(;i>=0;)this.overlays[i].props.edge&&this.overlays[i].props.edge.id===s&&this.overlays.splice(i,1),i--}),t.bind(Gr,()=>{this.vertices.length=0,this.overlays.length=0}),this.surface.bind(Br,()=>setTimeout(()=>this.surface.$redrawEveryConnection())),e.url?t.load({url:e.url,dataType:e.dataType,onload:()=>e.e=!0}):e.data?t.load({data:e.data,dataType:e.dataType,onload:()=>e.e=!0}):e.e=!0},watch:{[y]:{handler(e){this.e!==!1&&this.surface&&this.surface.model&&(this.surface.model.clear(),requestAnimationFrame(()=>{this.surface.model.load({data:e,dataType:this.dataType})}))}},[E]:{handler(e){this.e!==!1&&this.surface&&this.surface.model&&(this.surface.model.clear(),requestAnimationFrame(()=>{this.surface.model.load({url:e,dataType:this.dataType})}))}}},render:function(){let e=this.vertices.map(t=>G(yo,{to:t.el,key:t.t},[G(t.component,t.props)]));return this.overlays.forEach(t=>{e.push(G(yo,{to:t.el,key:t.t},[G(t.component,t.props)]))}),G(Ir,{ref:"root",class:"vjs-vue-surface",style:{width:"100%",height:"100%"}},e.concat(this.$slots.hasOwnProperty("default")?this.$slots.default():[]))}};import{h as j,inject as jr,Teleport as _o}from"vue";import{ELEMENT_DIV as kr,EVENT_GROUP_REMOVED as Fr,EVENT_GROUP_UPDATED as Hr,EVENT_NODE_REMOVED as $r,EVENT_NODE_UPDATED as Wr,EVENT_RENDER_END as zr,clone as So,EVENT_EDGE_UPDATED as Kr,EVENT_EDGE_REMOVED as Jr,EVENT_GRAPH_CLEARED as Yr}from"@visuallyjs/browser-ui";var vo={setup(e){return{service:jr(l),paperId:e.paperId||Ct}},name:oe,props:{[y]:{type:Object},[H]:{type:Object},[B]:{type:Object},[W]:{type:Object},[$]:{type:Object},[E]:{type:String},[z]:{type:String},[Nt]:{type:String}},data:function(){return{vertices:[],overlays:[]}},mounted(){let e=this,t=this.model||new g(this.modelOptions||{}),r=this.$refs.root;e.e=!1;let o=So(this.viewOptions||{});ve(o,()=>this.paper,()=>t,this.overlays),this.paper=Eo(t,this.paperId,r,this.vertices,So(this.renderOptions||{}),o),this.service.setPaper(this.paper);let a=(n,s)=>{let i=()=>{let c={};return s.originalData||s.updates?c=Object.assign(s.originalData,s.updates):s.newData&&Object.assign(c,s.newData),c},m=this.vertices.find(c=>c.t===n);m!=null&&(m.props.data=i())},p=n=>{let s=this.vertices.findIndex(i=>i.t===n);s!==-1&&this.vertices.splice(s,1)};t.bind(Wr,n=>{a(n.vertex.getFullId(),n)}),t.bind(Hr,n=>{a(n.vertex.getFullId(),n)}),t.bind($r,n=>{p(n.node.id)}),t.bind(Fr,n=>{p(n.group.id)}),t.bind(Kr,n=>{let s=n.edge.id;this.overlays.forEach(i=>{i.props.edge&&i.props.edge.id===s&&(i.props.data=n.edge.data)})}),t.bind(Jr,n=>{let s=n.edge.id,i=this.overlays.length-1;for(;i>=0;)this.overlays[i].props.edge&&this.overlays[i].props.edge.id===s&&this.overlays.splice(i,1),i--}),t.bind(Yr,()=>{this.vertices.length=0,this.overlays.length=0}),this.paper.bind(zr,()=>setTimeout(()=>this.paper.$redrawEveryConnection())),e.url?t.load({url:e.url,dataType:e.dataType,onload:()=>e.e=!0}):e.data?t.load({data:e.data,dataType:e.dataType,onload:()=>e.e=!0}):e.e=!0},watch:{[y]:{handler(e){this.e!==!1&&this.paper&&this.paper.model&&(this.paper.model.clear(),requestAnimationFrame(()=>{this.paper.model.load({data:e,dataType:this.dataType})}))}},[E]:{handler(e){this.e!==!1&&this.paper&&this.paper.model&&(this.paper.model.clear(),requestAnimationFrame(()=>{this.paper.model.load({url:e,dataType:this.dataType})}))}}},render:function(){let e=this.vertices.map(t=>j(_o,{to:t.el,key:t.t},[j(t.component,t.props)]));return this.overlays.forEach(t=>{e.push(j(_o,{to:t.el,key:t.t},[j(t.component,t.props)]))}),j(kr,{ref:"root",class:"vjs-vue-paper",style:{width:"100%",height:"100%"}},e.concat(this.$slots.hasOwnProperty("default")?this.$slots.default():[]))}};import{h as u,inject as Xr,watch as Zr}from"vue";import{LassoPlugin as qr,SURFACE_MODE_SELECT as Ro,SURFACE_MODE_PAN as No,PAN_PATH as Qr,PAN_VIEW_BOX as en,LASSO_PATH as tn,LASSO_VIEW_BOX as on,UNDO_PATH as rn,UNDO_VIEW_BOX as nn,REDO_PATH as sn,REDO_VIEW_BOX as an,ZOOM_TO_FIT_PATH as ln,ZOOM_TO_FIT_VIEW_BOX as pn,EVENT_UNDOREDO_UPDATE as cn,TRUE as Ao,FALSE as Re,EVENT_SURFACE_MODE_CHANGED as un,ELEMENT_DIV as xo,ATTRIBUTE_CONTROLS_ORIENTATION as dn,ZOOM_IN_OUT_VIEW_BOX as Do,ZOOM_IN_PATH as mn,ZOOM_OUT_PATH as hn,RESET_SELECTION_PATH as fn,RESET_SELECTION_VIEW_BOX as Pn,CLEAR_PATH as On,CLEAR_VIEW_BOX as En,ATTRIBUTE_RESET_SELECTION as gn,CLASS_CONTROLS_RESET_SELECTION as yn,EVENT_SELECT as Cn,EVENT_DESELECT as Tn,EVENT_SELECTION_CLEARED as _n,supportsPathEditing as Sn}from"@visuallyjs/browser-ui";var vn="Clear dataset?",Fe="vjs-selected-mode",He="can-undo",$e="can-redo",Rn="data-undo",Nn="data-redo",Io="data-mode",An="data-reset",xn="data-clear",Dn="data-zoom-in",In="data-zoom-out",bo="vjs-controls-has-selection",Mo={setup(e){return{service:Xr(l)}},name:ne,props:{clear:{type:Boolean,default:!0},[N]:{type:String},undoRedo:{type:Boolean,default:!0},orientation:{type:String,default:"row"},zoomToExtents:{type:Boolean,default:!0},zoomButtons:{type:Boolean,default:!1},clearMessage:{type:String,default:vn},onMaybeClear:{type:Function},className:{type:String,default:""}},methods:{panMode:function(){var e;(e=this.service.surface.value)==null||e.setMode(No)},selectMode:function(){var e;(e=this.service.surface.value)==null||e.setMode(Ro)},zoomToFit:function(){var e;(e=this.service.surface.value)==null||e.zoomToFit()},doClear:function(){let e=this.service.surface.value;e&&(this.onMaybeClear!=null?this.onMaybeClear(()=>e.model.clear()):window.confirm(this.clearMessage)&&e.model.clear())},undo:function(){var e;(e=this.service.model.value)==null||e.undo()},redo:function(){var e;(e=this.service.model.value)==null||e.redo()},zoomIn:function(){var e;(e=this.service.surface.value)==null||e.zoomIn()},zoomOut:function(){var e;(e=this.service.surface.value)==null||e.zoomOut()},resetSelection(){let e=this.service.surface.value;e&&(e.model.clearSelection(),Sn(e)&&e.stopEditingPath())},updateSelectionState:function(){let e=this.service.surface.value;e&&(e.model.getSelection().isEmpty()?this.$refs.root.removeAttribute(bo):this.$refs.root.setAttribute(bo,"true"))}},data:function(){return{ready:!1,hasLasso:!1}},render(){if(this.ready){let e=[];return this.showPan&&(e.push(u("i",{class:`vjs-pan-mode ${Fe}`,[Io]:No,onClick:()=>this.panMode(),title:"Pan mode"},[u("svg",{viewBox:en,stroke:"currentColor",fill:"none"},[u("path",{d:Qr})])])),e.push(u("i",{class:"vjs-select-mode",[Io]:Ro,onClick:()=>this.selectMode(),title:"Select mode"},[u("svg",{viewBox:on,stroke:"currentColor",fill:"currentColor"},[u("path",{d:tn})])]))),this.undoRedo&&(e.push(u("i",{class:"vjs-undo",[Rn]:!0,title:"Undo last action",onClick:()=>this.undo()},[u("svg",{viewBox:nn,stroke:"currentColor",fill:"none"},[u("path",{d:rn,"stroke-width":2})])])),e.push(u("i",{class:"vjs-redo",[Nn]:!0,title:"Redo last action",onClick:()=>this.redo()},[u("svg",{viewBox:an,stroke:"currentColor",fill:"none"},[u("path",{d:sn,"stroke-width":2})])]))),this.zoomToExtents&&e.push(u("i",{class:"vjs-zoom-to-fit",[An]:"true",onClick:()=>this.zoomToFit(),title:"Zoom to Fit"},[u("svg",{viewBox:pn,stroke:"currentColor",fill:"currentColor"},[u("path",{d:ln})])])),this.zoomButtons&&(e.push(u("i",{class:"vjs-zoom-in",[Dn]:"true",onClick:()=>this.zoomIn(),title:"Zoom In"},[u("svg",{viewBox:Do,stroke:"currentColor",fill:"currentColor"},[u("path",{d:mn})])])),e.push(u("i",{class:"vjs-zoom-out",[In]:"true",onClick:()=>this.zoomOut(),title:"Zoom Out"},[u("svg",{viewBox:Do,stroke:"currentColor",fill:"currentColor"},[u("path",{d:hn})])]))),e.push(u("i",{class:yn,[gn]:"true",onClick:()=>{this.resetSelection()}},[u("svg",{viewBox:Pn,stroke:"currentColor",fill:"currentColor"},[u("path",{d:fn})])])),this.clear&&e.push(u("i",{class:"vjs-clear-dataset",[xn]:"true",onClick:()=>{this.doClear()}},[u("svg",{viewBox:En,stroke:"currentColor",fill:"currentColor"},[u("path",{d:On})])])),u(xo,{class:`vjs-controls ${this.className}`,ref:"root",[He]:!1,[$e]:!1,[dn]:this.orientation},e)}else return u(xo,{ref:"root"})},mounted(){let e=t=>{let r=t.getPlugin(qr.type);this.showPan=r!=null,t.bind(un,o=>{t.removeClass(t.$getSelector(this.$refs.root,"[data-mode]"),Fe),t.addClass(t.$getSelector(this.$refs.root,"[data-mode='"+o+"']"),Fe)}),t.model.bind(cn,o=>{this.$refs.root.setAttribute(He,o.undoCount>0?Ao:Re),this.$refs.root.setAttribute($e,o.redoCount>0?Ao:Re)}),t.model.bind(Cn,()=>this.updateSelectionState()),t.model.bind(Tn,()=>this.updateSelectionState()),t.model.bind(_n,()=>this.updateSelectionState()),this.$refs.root.setAttribute(He,Re),this.$refs.root.setAttribute($e,Re),this.ready=!0};this.service.surface.value==null?Zr(this.service.surface,e):e(this.service.surface.value)}};import{h as A,inject as bn}from"vue";import{CLASS_CONTROLS as Mn,CLASS_EXPORT_CONTROLS as wn,ELEMENT_DIV as Vn,ImageExportUI as wo,SvgExportUI as Bn,TYPE_JPG as Ln,TYPE_PNG as Un,TYPE_SVG as Gn}from"@visuallyjs/browser-ui";var Vo={name:ie,setup(e){return{service:bn(l)}},props:{surfaceId:{type:String},showLabel:{type:Boolean,default:!0},label:{type:String,default:"Export :"},margins:{type:Object},svgOptions:{type:Object},imageOptions:{type:Object},allowSvgExport:{type:Boolean,default:!0},allowPngExport:{type:Boolean,default:!0},allowJpgExport:{type:Boolean,default:!0}},methods:{loadSurface:function(e){let t=this.service.surface.value;t&&e(t)},exportSVG:function(){this.loadSurface(e=>{let t=this.svgOptions||{};this.margins!=null&&t.margins==null&&Object.assign(t,this.margins),new Bn(e).export(t)})},exportJPG:function(){this.loadSurface(e=>{let t=this.imageOptions||{};this.margins!=null&&t.margins==null&&Object.assign(t,this.margins),t.type="image/jpeg",new wo(e).export(t)})},exportPNG:function(){this.loadSurface(e=>{let t=this.imageOptions||{};this.margins!=null&&t.margins==null&&Object.assign(t,this.margins),new wo(e).export(t)})}},render(){let e=this.showLabel!==!1,t=this.allowSvgExport!==!1,r=this.allowPngExport!==!1,o=this.allowJpgExport!==!1,a=[];return t&&a.push(A("i",{},[A("a",{href:"#","data-type":Gn,onClick:()=>this.exportSVG()},"SVG")])),r&&a.push(A("i",{},[A("a",{href:"#","data-type":Un,onClick:()=>this.exportPNG()},"PNG")])),o&&a.push(A("i",{},[A("a",{href:"#","data-type":Ln,onClick:()=>this.exportJPG()},"JPG")])),e&&a.unshift(A("span",{},[this.label])),A(Vn,{class:`${Mn} ${wn}`},a)}};import{h as jn,inject as kn,watch as Bo}from"vue";import{ELEMENT_DIV as Fn,MiniviewPlugin as Hn}from"@visuallyjs/browser-ui";var Lo={setup(e){return{service:kn(l)}},name:ee,props:{[N]:{type:String},[V]:{type:String,default:""},[vt]:{type:Boolean,default:!0},[_t]:{type:Boolean,default:!0},[St]:{type:Boolean,default:!0},[Rt]:{type:Boolean,default:!0},[Tt]:{type:Function}},mounted:function(){let e=t=>{t.addPlugin({type:Hn.type,options:{container:this.$el,activeTracking:this.activeTracking,clickToCenter:this.clickToCenter,showLasso:this.showLasso,trackSelection:this.trackSelection,typeFunction:this.typeFunction}})};this.service.surface.value!=null&&e(this.service.surface.value),this.service.paper.value!=null?e(this.service.paper.value):(Bo(this.service.surface,e),Bo(this.service.paper,e))},render:function(e){return jn(Fn,{ref:"root",class:e.className})}};import{h as $n,inject as Wn,markRaw as zn}from"vue";import{createDiagram as Kn,ELEMENT_DIV as Jn}from"@visuallyjs/browser-ui";var Uo={setup(e){return{service:Wn(l)}},name:se,props:{[y]:{type:Object},[E]:{type:String},[B]:{type:Object},[M]:{type:Object}},mounted(){let e=this.$refs.root;this.diagram=zn(Kn(e,this.options,this.modelOptions)),this.service.setDiagram(this.diagram),this.data?this.diagram.load({data:this.data}):this.url&&this.diagram.load({url:this.url})},render:function(){return $n(Jn,{ref:"root",class:"vjs-vue-surface",style:{width:"100%",height:"100%"}},this.$slots.hasOwnProperty("default")?this.$slots.default():[])}};import{h as Yn,inject as Xn,watch as Go}from"vue";import{ColumnChart as Zn,BarChart as qn,CategoryValueChart as Qn,ELEMENT_DIV as ei,LineChart as ti,AreaChart as oi,PieChart as ri,ScatterChart as ni,BubbleChart as ii,GaugeChart as si,SankeyChart as ai}from"@visuallyjs/browser-ui";var jo={[V]:{type:String},[y]:{type:Object},[E]:{type:String},[It]:{type:Boolean,default:!1}},ko={setup(){return{service:Xn(l)}},render:function(){return Yn(ei,{class:`${this.className}`,ref:"root"})}};function S(e,t,r=!0){let o=L(b({},jo),{[M]:{type:Object}}),a={[y]:function(n){this.chart&&this.chart.load({data:n})},[E]:function(n){this.chart&&this.chart.load({url:n})},[M]:{handler:function(){this.o()},deep:!0}};r&&(o[Be]={type:Function},a[Be]=function(n){this.chart.setDataSourceFilter(n)});let p={o:function(){this.chart&&this.chart.destroy();let n=this.$refs.root,s=r?Object.assign({dataSourceFilter:this.dataSourceFilter},this.options):this.options;this.data&&(s.data=this.data),this.url&&(s.url=this.url);let i=()=>{this.chart=new t(n,s)};if(this.useModel)if(this.service.model.value!=null)s.dataSource=this.service.model.value,i();else{let m=Go(this.service.model,c=>{c!=null&&(s.dataSource=c,i(),m())})}else i()}};return L(b({},ko),{name:e,props:o,watch:a,data:()=>({hasMounted:!1}),methods:p,mounted(){this.o()}})}var We=S(le,Zn),ze=S(pe,qn),Ke=S(ce,Qn,!1),Je=S(me,ri),Ye=S(ue,ti),Xe=S(de,oi),Ze=S(he,ni),qe=S(fe,ii),Qe=S(Pe,si,!1),et=L(b({},ko),{name:Oe,props:L(b({},jo),{[Le]:{type:String},[Ue]:{type:Object},[xt]:{type:Boolean},[Dt]:{type:String},[M]:{type:Object}}),data:()=>({chart:null}),methods:{o:function(){this.chart&&this.chart.destroy();let e=this.$refs.root,t=Object.assign({},this.options);this.interactive!=null&&(t.interactive=this.interactive),this.pivot!=null&&(t.pivot=this.pivot),this.csvData&&(t.csvData=this.csvData),this.jsonData&&(t.jsonData=this.jsonData),this.url&&(t.url=this.url);let r=()=>{this.chart=new ai(e,t)};if(this.useModel)if(this.service.model.value==null){let o=Go(this.service.model,a=>{a!=null&&(t.dataSource=a,r(),o())})}else t.dataSource=this.service.model.value,r();else r()}},mounted(){this.o()},watch:{pivot(e){this.chart&&this.chart.pivot(e)},[Le](e){this.chart&&this.chart.load({csvData:e})},[Ue](e){this.chart&&this.chart.load({jsonData:e})},[E](e){this.chart&&this.chart.load({url:e})},[M]:{handler:function(){this.o()},deep:!0}}});import{h as li,inject as pi,watch as ci}from"vue";import{defaultDataGenerator as ui,ELEMENT_DIV as di,Palette as mi}from"@visuallyjs/browser-ui";var Fo={setup(e){return{service:pi(l)}},name:re,props:{[N]:{type:String},[bt]:{type:String},[Mt]:{type:Function},[wt]:{type:Function},[Vt]:{type:Function},[Bt]:{type:[Boolean,Function],default:!1},[Lt]:{type:Boolean,default:!0},[Ut]:{type:Boolean,default:!0},[Gt]:{type:Boolean,default:!1},[jt]:{type:Boolean,default:!1},[Jt]:Object,[kt]:Function,[Yt]:Function,[V]:String,[At]:String,[Ft]:{type:Boolean,default:!1},[$t]:{type:Boolean,default:!1},[Ht]:{type:Boolean,default:!1},[Wt]:{type:Boolean,default:!0},[zt]:{type:Number,default:2e3},[Kt]:{type:[Boolean,Object],default:!1}},mounted:function(){let e=t=>{let r={source:this.$refs.root,selector:this.selector,dataGenerator:o=>this.dataGenerator?this.dataGenerator(o):ui(o),allowDropOnEdge:this.allowDropOnEdge===!0,allowDropOnGroup:this.allowDropOnGroup!==!1,allowDropOnCanvas:this.allowDropOnCanvas!==!1,allowDropOnNode:this.allowDropOnNode===!0,ignoreDropOnNode:this.ignoreDropOnNode===!0,canvasDropFilter:this.canvasDropFilter,onVertexAdded:this.onVertexAdded,dragSize:this.dragSize,mode:this.mode,allowRotation:this.allowRotation!==!1,rotationSpeed:this.rotationSpeed||2e3,autoEdgeConnect:this.autoEdgeConnect};this.groupIdentifier!=null&&(r.groupIdentifier=this.groupIdentifier),this.typeGenerator!=null&&(r.typeGenerator=this.typeGenerator),this.palette=new mi(t,r)};this.service.surface.value==null?ci(this.service.surface,e):e(this.service.surface.value)},render:function(){return li(di,{ref:"root",class:this.className||""},this.$slots.hasOwnProperty("default")?this.$slots.default():[])}};import{provide as hi}from"vue";var tt={setup(){hi(l,new _("SurfaceProvider"))},render(){return this.$slots.hasOwnProperty("default")?this.$slots.default():[]}};import{provide as fi}from"vue";var ot={setup(){fi(l,new _("PaperProvider"))},render(){return this.$slots.hasOwnProperty("default")?this.$slots.default():[]}};import{h as Pi,inject as Oi,watch as Ei}from"vue";import{CLASS_SHAPE as gi,convertToMultilineText as Ho,DEFAULT_LABEL_FILL_RATIO as rt,ELEMENT_SVG as yi}from"@visuallyjs/browser-ui";var nt={name:K,props:{data:{type:Object},showLabels:{type:Boolean,default:!1},labelProperty:{type:String,default:"label"},labelStrokeWidth:{type:Number},labelPosition:{type:Object,default:"center"},multilineLabels:{type:Boolean,default:!0},labelFillRatio:{type:Number,default:rt},labelColor:{type:String,default:"#000000"},font:{type:Object}},setup(){return{service:Oi(l)}},mounted(){let e=t=>{let r=t.getShapeLibrary(),o=r.renderCompiledShape(Object.assign({sw:this.getOutlineWidth()},this.data));if(this.$refs.container.appendChild(o),this.showLabels){let a=r.renderShapeLabel(this.data,this.labelProperty,this.labelStrokeWidth,null,this.labelColor,this.labelColor,this.font);this.$refs.container.appendChild(a),this.multilineLabels!=!1&&Ho(a,this.data[this.labelProperty]||"",this.getWidth()*(this.labelFillRatio||rt),this.labelPosition)}};this.service.ui.value==null?Ei(this.service.ui,e):e(this.service.ui.value)},updated(){let e=this.service.surface.value;if(e){let t=e.getShapeLibrary(),r=t.renderCompiledShape(Object.assign({sw:this.getOutlineWidth()},this.data));if(this.$refs.container.replaceChildren(r),this.showLabels){let o=t.renderShapeLabel(this.data,this.labelProperty,this.labelStrokeWidth,null,this.labelColor,this.labelColor,this.font);this.$refs.container.appendChild(o),this.multilineLabels!=!1&&Ho(o,this.data[this.labelProperty]||"",this.getWidth()*(this.labelFillRatio||rt),this.labelPosition)}}},render:function(){return Pi(yi,{ref:"container",preserveAspectRatio:"none",fill:this.getFill(),stroke:this.getOutline(),"stroke-width":this.getOutlineWidth(),viewBox:"0 0 "+this.getWidth()+" "+this.getHeight(),class:gi})},methods:{getWidth:function(){return this.data.width||Xt},getHeight:function(){return this.data.height||Zt},getFill:function(){return this.data.fill||"#FFFFFF"},getOutline:function(){return this.data.outline||"#000000"},getOutlineWidth(){return this.data.outlineWidth||2}}};import{h as Ci,inject as Ti,watch as _i}from"vue";import{ELEMENT_DIV as Si,ShapePalette as vi}from"@visuallyjs/browser-ui";var it={name:J,props:{surfaceId:{type:String},dragSize:Object,iconSize:Object,fill:String,outline:String,showAllMessage:String,selectAfterDrop:Boolean,paletteStrokeWidth:Number,dataGenerator:Function,initialSet:String,mode:String,allowClickToAdd:Boolean,onVertexAdded:Function,showLabels:Boolean,inspector:{type:Boolean,default:!0},updateTypeOnPaletteTap:Boolean,preparedShapes:Array,allowDropOnEdge:[Boolean,Function],autoEdgeConnect:[Boolean,Object],showGroups:{type:Boolean,default:!0}},setup(e){return{service:Ti(l)}},data:()=>({hasMounted:!1}),mounted(){let e=t=>{this.hasMounted||(this.hasMounted=!0,new vi(t,{container:this.$refs.container,shapeLibrary:t.getShapeLibrary(),dragSize:this.dragSize,iconSize:this.iconSize,fill:this.fill,outline:this.outline,showAllMessage:this.showAllMessage,selectAfterDrop:this.selectAfterDrop,paletteStrokeWidth:this.paletteStrokeWidth,dataGenerator:this.dataGenerator,initialSet:this.initialSet,mode:this.mode,allowClickToAdd:this.allowClickToAdd,onVertexAdded:this.onVertexAdded,showLabels:this.showLabels,inspector:this.inspector,updateTypeOnPaletteTap:this.updateTypeOnPaletteTap,preparedShapes:this.preparedShapes,allowDropOnEdge:this.allowDropOnEdge,autoEdgeConnect:this.autoEdgeConnect,showGroups:this.showGroups}))};this.service.surface.value==null?_i(this.service.surface,e):e(this.service.surface.value)},render:function(){return Ci(Si,{ref:"container"})}};import{provide as $o,readonly as Ri,inject as Ni,h as Ai,watch as xi}from"vue";import{ELEMENT_DIV as Di,Inspector as Ii,log as bi}from"@visuallyjs/browser-ui";var v=Symbol.for("VueInspectorGetter"),Mi=Symbol.for("VueInspectorSetter");function wi(){let e=[],t=null;function r(p){try{p(t)}catch(n){bi("WARN: inspector listener threw an exception",n)}}let o={listen:p=>{t!=null?r(p):e.push(p)}},a={inspector:p=>{t=p,e.forEach(r)}};return $o(Mi,a),$o(v,Ri(o)),a}var st={name:Ee,props:{autoCommit:{type:Boolean,default:!0},multipleSelections:{type:Boolean,default:!0},filter:Function,renderEmptyContainer:Function,refresh:Function,className:String,showCloseButton:Boolean,afterUpdate:Function,modelValue:Object},emits:["update:modelValue"],setup(e,t){let r=wi();return{service:Ni(l),inspectorProvider:r,inspector:null,emit:t.emit}},mounted(){let e=t=>{if(this.inspector==null){let r=new Ii({container:this.$refs.root,ui:t,renderEmptyContainer:()=>(this.emit("update:modelValue",null),this.renderEmptyContainer?this.renderEmptyContainer():""),refresh:(o,a)=>{this.emit("update:modelValue",o),this.refresh&&this.refresh(o),setTimeout(a)},autoCommit:this.autoCommit,multipleSelections:this.multipleSelections,filter:this.filter,showCloseButton:this.showCloseButton,afterUpdate:()=>this.afterUpdate?this.afterUpdate(t):null});this.inspectorProvider.inspector(r)}};this.service.surface.value==null?xi(this.service.surface,e):e(this.service.surface.value)},render(){return Ai(Di,{ref:"root"},this.$slots.hasOwnProperty("default")?this.$slots.default():[])}};import{h as Vi,inject as Bi}from"vue";import{EdgeTypePicker as Li,ELEMENT_DIV as Ui,log as Gi}from"@visuallyjs/browser-ui";var k={name:Y,props:{propertyName:String},setup(){return{inspectorProvider:Bi(v)}},mounted(){this.inspectorProvider?this.inspectorProvider.listen(e=>{let t=new Li(e.$ui,this.$refs.container,e.$ui.$getEdgePropertyMappings(),e.getValue(this.propertyName),(r,o)=>{e.setValue(this.propertyName,o,null)});t.render(this.propertyName,e.f),e.onChange(()=>{t.reset(),t.select(this.propertyName,e.getValue(this.propertyName))})}):Gi("WARN: EdgeTypePicker not instantiated inside an InspectorComponent. Cannot mount.")},render:function(){return Vi(Ui,{ref:"container"})}};import{h as Ne,inject as ji}from"vue";import{CLASS_COLOR_PICKER as Wo,CLASS_COLOR_PICKER_SWATCH as zo,CLASS_COLOR_PICKER_SWATCHES as Ko,EVENT_CONTEXT_UPDATE as ki,ELEMENT_DIV as at,INSPECTOR_CONTEXT_RECENT_COLORS as Ae}from"@visuallyjs/browser-ui";var Jo={render(){let e=this.swatches.map(t=>Ne(at,{title:t,class:zo,style:`background-color:${t}`,"data-color":t,onClick:()=>this.selectSwatch(t)}));return Ne(at,{class:`${Wo}`},[Ne("input",{type:"color","vjs-att":this.propertyName,ref:"colorInput"}),Ne(at,{class:Ko},e)])},props:{propertyName:String,maxColors:{type:Number,default:10}},data:()=>({CLASS_COLOR_PICKER:Wo,CLASS_COLOR_PICKER_SWATCHES:Ko,CLASS_COLOR_PICKER_SWATCH:zo,colorInput:null,swatches:[]}),mounted(){let e=ji(v);e&&e.listen(t=>{this.inspector=t,this.swatches=t.ensureContext(Ae,()=>[]),this.colorInput=this.$refs.colorInput,this.colorInput.addEventListener("change",this.colorPicked),t.bind(ki,r=>{r.key===Ae&&(this.swatches=r.value.slice())}),t.bind("change",this.setCurrentColor),this.setCurrentColor()})},methods:{addColor:function(e){let t=this.inspector.ensureContext(Ae,()=>[]);if(e=e.toUpperCase(),!(t.find(o=>o.toUpperCase()===e)!=null)){let o=this.maxColors||10,a=t.slice();a.unshift(e),a.length>o&&(a.length=o),this.inspector.updateContext(Ae,a)}},colorPicked:function(){let e=this.colorInput.value;this.inspector.setValue(this.propertyName,e,null),this.addColor(e)},selectSwatch:function(e){this.inspector.setValue(this.propertyName,e,null),this.colorInput.value=e},setCurrentColor:function(){let e=this.inspector.getValue(this.propertyName);e!=null&&(this.colorInput.value=e,this.addColor(e))}}};import{h as xe,inject as Fi,nextTick as Hi,Teleport as $i,watch as Wi}from"vue";import{ELEMENT_DIV as lt,uuid as zi}from"@visuallyjs/browser-ui";var pt={props:{placement:{type:String,default:"floating"},position:{type:Object},constraints:{type:Object}},data:()=>({hasMounted:!1,surface:null}),setup(e){return{service:Fi(l)}},mounted(){let e=t=>{if(!this.hasMounted){this.surface=t,this.hasMounted=!0;let r=this.position||{x:0,y:0};Hi().then(()=>{this.placement==="floating"?t.floatElement(this.$refs.root,r):t.fixElement(this.$refs.fixedEl,r,this.constraints)})}};this.service.surface.value==null?Wi(this.service.surface,e):e(this.service.surface.value)},render(){return xe(lt,{ref:"root"},this.hasMounted?this.placement==="floating"?xe(lt,{},this.$slots.hasOwnProperty("default")?this.$slots.default():[]):xe($i,{to:this.surface.vertexLayer,key:zi()},xe(lt,{ref:"fixedEl"},this.$slots.hasOwnProperty("default")?this.$slots.default():[])):[])}};import{provide as Ki}from"vue";var ct={setup(){Ki(l,new _("DiagramProvider"))},render(){return this.$slots.hasOwnProperty("default")?this.$slots.default():[]}};import{h as Ji,inject as Yi,watch as Xi}from"vue";import{DiagramPalette as Zi,ELEMENT_DIV as qi,log as Qi}from"@visuallyjs/browser-ui";var ut={name:ae,props:{fill:String,outline:String,dragSize:Object,inspector:{type:Boolean,default:!0},updateTypeOnPaletteTap:Boolean,iconSize:Object,showLabels:Boolean,paletteStrokeWidth:Number,showAllMessage:String,onCellAdded:Function,mode:String,allowClickToAdd:Boolean,autoExitDrawMode:Boolean,selectAfterAdd:{type:Boolean,default:!0},className:String,diagram:{type:Object},onVertexAdded:Function,preparedShapes:Array,allowDropOnEdge:[Boolean,Function],autoEdgeConnect:[Boolean,Object],showGroups:{type:Boolean,default:!0}},setup(e){return{service:Yi(l)}},data:()=>({hasMounted:!1}),mounted(){if(this.service==null&&this.diagram==null)Qi("Cannot mount DiagramPalette - no service found and Diagram not passed in as a prop");else{let e=t=>{this.hasMounted||(this.hasMounted=!0,new Zi(this.$refs.container,t,{fill:this.fill,outline:this.outline,dragSize:this.dragSize,inspector:this.inspector,iconSize:this.iconSize,showLabels:this.showLabels,paletteStrokeWidth:this.paletteStrokeWidth,showAllMessage:this.showAllMessage,onCellAdded:this.onCellAdded,mode:this.mode,allowClickToAdd:this.allowClickToAdd,autoExitDrawMode:this.autoExitDrawMode,selectAfterAdd:this.selectAfterAdd,onVertexAdded:this.onVertexAdded,updateTypeOnPaletteTap:this.updateTypeOnPaletteTap,preparedShapes:this.preparedShapes,allowDropOnEdge:this.allowDropOnEdge,autoEdgeConnect:this.autoEdgeConnect,showGroups:this.showGroups}))};this.diagram?e(this.diagram):this.service.diagram.value!=null?e(this.service.diagram.value):Xi(this.service.diagram,e)}},render:function(){return Ji(qi,{ref:"container"})}};import{BLOCK as es,ELEMENT_DIV as ts,NONE as os,PopupHandler as rs,CLASS_SURFACE_POPUP as ns,ABSOLUTE as is}from"@visuallyjs/browser-ui";import{h as ss,inject as as,onMounted as ls,ref as De,watch as ps}from"vue";var dt={name:"SurfacePopup",props:{selector:String,anchor:{type:String,default:"bottom"}},setup(e){let t=as(l),r=De(null),o=De("block"),a=De(null),p=De(null),n=s=>{p.value=new rs(e.selector,a.value,s,i=>{r.value=i,i==null?o.value=os:(o.value=es,requestAnimationFrame(()=>p.value.$positionPopup()))},e.anchor)};return ls(()=>{t.surface.value==null?ps(t.surface,n):n(t.surface.value)}),{service:t,current:r,display:o,rootRef:a,handler:p}},render(){var e;return ss(ts,{ref:"rootRef",display:this.display,position:is,class:ns},this.$slots.hasOwnProperty("default")?this.$slots.default({vertex:this.current,model:(e=this.service.surface.value)==null?void 0:e.model,ui:this.service.surface.value,hide:()=>{var t;return(t=this.handler)==null?void 0:t.$hide()}}):[])}};import{inject as Ie,watch as x}from"vue";import{BackgroundPlugin as be,GeneratedGridBackground as cs,SimpleBackground as us,TiledBackground as ds}from"@visuallyjs/browser-ui";var Yo={setup(){return{service:Ie(l)}},name:X,props:{options:{type:Object}},mounted:function(){let e=t=>{t.addPlugin({type:be.type,options:this.options})};this.service.surface.value!=null&&e(this.service.surface.value),this.service.paper.value!=null?e(this.service.paper.value):(x(this.service.surface,e),x(this.service.paper,e))},render:function(e){return[]}},Xo={setup(){return{service:Ie(l)}},name:Z,props:{grid:{type:Object},showBorder:{type:Boolean},minWidth:{type:Number},minHeight:{type:Number},showTickMarks:{type:Boolean},tickMarksPerCell:{type:Number},maxWidth:{type:Number},maxHeight:{type:Number},autoShrink:{type:Boolean},gridType:{type:String},dotRadius:{type:Number},tickDotRadius:{type:Number},visible:{type:Boolean}},mounted:function(){let e=t=>{t.addPlugin({type:be.type,options:{type:cs.type,grid:this.grid,showBorder:this.showBorder,minWidth:this.minWidth,minHeight:this.minHeight,showTickMarks:this.showTickMarks,tickMarksPerCell:this.tickMarksPerCell,maxWidth:this.maxWidth,maxHeight:this.maxHeight,autoShrink:this.autoShrink,gridType:this.gridType,dotRadius:this.dotRadius,tickDotRadius:this.tickDotRadius,visible:this.visible}})};this.service.surface.value!=null&&e(this.service.surface.value),this.service.paper.value!=null?e(this.service.paper.value):(x(this.service.surface,e),x(this.service.paper,e))},render:function(e){return[]}},Zo={setup(){return{service:Ie(l)}},name:q,props:{url:{type:String}},mounted:function(){let e=t=>{t.addPlugin({type:be.type,options:{type:us.type,url:this.url}})};this.service.surface.value!=null&&e(this.service.surface.value),this.service.paper.value!=null?e(this.service.paper.value):(x(this.service.surface,e),x(this.service.paper,e))},render:function(e){return[]}},qo={setup(){return{service:Ie(l)}},name:Q,props:{url:{type:String},urlGenerator:{type:Function},tileSize:{type:Object},width:{type:Number},height:{type:Number},maxZoom:{type:Number},tiling:{type:String},panDebounceTimeout:{type:Number},zoomDebounceTimeout:{type:Number}},mounted:function(){let e=t=>{t.addPlugin({type:be.type,options:{type:ds.type,url:this.url,urlGenerator:this.urlGenerator,tileSize:this.tileSize,width:this.width,height:this.height,tiling:this.tiling,panDebounceTimeout:this.panDebounceTimeout,zoomDebounceTimeout:this.zoomDebounceTimeout}})};this.service.surface.value!=null&&e(this.service.surface.value),this.service.paper.value!=null?e(this.service.paper.value):(x(this.service.surface,e),x(this.service.paper,e))},render:function(e){return[]}};import{h as Me,inject as ms}from"vue";import{ELEMENT_DIV as mt,INSPECTOR_CONTEXT_EDGE_PROPERTY_MAPPINGS as hs,log as fs}from"@visuallyjs/browser-ui";var ht={name:ge,props:{getPropertyName:Function,showName:{type:Boolean,default:!0},cssClass:String,mappings:Array},setup(){return{inspectorProvider:ms(v)}},data(){return{inspector:null}},mounted(){this.inspectorProvider?this.inspectorProvider.listen(e=>{this.inspector=e}):fs("WARN: EdgePropertyMappingsInspector not instantiated inside an InspectorComponent.")},methods:{resolveMappings(){return this.mappings?this.mappings:this.inspector?this.inspector.getFromContext(hs)||this.inspector.$ui.$getEdgePropertyMappings():[]},toList(e){let t=e.property;return Array.isArray(t)?t:[t]},getPropertyKey(e){return this.toList(e).join(" ")},getName(e){return this.getPropertyName?this.getPropertyName(e):e.name||this.getPropertyKey(e)}},render(){let e=this.resolveMappings(),t=this.cssClass||"vjs-inspector-section";return Me(mt,{},e.map(r=>{let o=this.getPropertyKey(r),a=this.getName(r),p=[];return this.showName!==!1&&p.push(Me(mt,{},a)),p.push(Me(k,{propertyName:o})),Me(mt,{class:t,key:o},p)}))}};import{h as d,inject as Ps}from"vue";import{isNode as Qo,isString as er,ELEMENT_DIV as F,log as Os}from"@visuallyjs/browser-ui";var Es=7,gs=["True","False"];function we(e,t){return(e.booleanLabels||gs)[t?0:1]}function D(e){return er(e)?e:e.label}function Ve(e){return er(e)?e:e.value}var ft={name:ye,props:{vertex:Object,maxRadios:Number},setup(){return{inspectorProvider:Ps(v)}},data(){return{inspector:null}},mounted(){this.inspectorProvider?this.inspectorProvider.listen(e=>{this.inspector=e}):Os("WARN: ShapePropertiesInspector not instantiated inside an InspectorComponent.")},methods:{resolveShapeDef(){if(this.inspector==null||this.vertex==null||!Qo(this.vertex))return null;let{type:e,category:t}=this.vertex.data;if(!e||!t)return null;let o=this.inspector.$ui.getShapeLibrary().getShapeSet(t);return o?o.shapes.find(a=>a.type===e):null}},render(){let e=this.vertex;if(!e||!Qo(e))return null;let t=this.resolveShapeDef();if(!t||!t.properties)return null;let r=this.maxRadios==null?Es:this.maxRadios;return t.properties.map(o=>{let a=o.type==="boolean",p=o.values&&o.values.length>0,n=p&&o.editor!=="select"&&o.values.length<=r,s=[];return(!a||o.editor==="select"||o.editor==="radio")&&s.push(d("label",{class:"vjs-inspector-property-label"},o.label||o.id)),o.type==="string"?p?n?s.push(d(F,{class:"vjs-radio-group"},o.values.map(i=>d("label",{key:D(i)},[d("input",{type:"radio",name:o.id,"vjs-att":o.id,value:Ve(i)})," "+D(i)])))):s.push(d("select",{"vjs-att":o.id},o.values.map(i=>d("option",{key:D(i),value:Ve(i)},D(i))))):s.push(d("input",{type:"text","vjs-att":o.id,placeholder:o.description})):o.type==="number"?p?n?s.push(d(F,{class:"vjs-radio-group"},o.values.map(i=>d("label",{key:D(i)},[d("input",{type:"radio","vjs-att":o.id,value:Ve(i)})," "+D(i)])))):s.push(d("select",{"vjs-att":o.id},o.values.map(i=>d("option",{key:D(i),value:Ve(i)},D(i))))):s.push(d("input",{type:"number","vjs-att":o.id,placeholder:o.description,min:o.min,max:o.max})):a?o.editor==="select"?s.push(d("select",{"vjs-att":o.id,"vjs-datatype":"boolean"},[d("option",{value:""}),d("option",{value:"true"},we(o,!0)),d("option",{value:"false"},we(o,!1))])):o.editor==="radio"?s.push(d(F,{class:"vjs-radio-group"},[d("label",[d("input",{type:"radio",name:o.id,"vjs-att":o.id,"vjs-datatype":"boolean",value:"true"}),d("span",we(o,!0))]),d("label",[d("input",{type:"radio",name:o.id,"vjs-att":o.id,"vjs-datatype":"boolean",value:"false"}),d("span",we(o,!1))])])):s.push(d("label",[d("input",{type:"checkbox","vjs-datatype":"boolean","vjs-att":o.id})," "+(o.label||o.id)])):s.push(d("input",{type:"text","vjs-att":o.id,placeholder:o.description})),o.description&&s.push(d(F,{class:"vjs-field-desc"},o.description)),d(F,{key:o.id,class:"vjs-inspector-field"},s)})}};var mm={install:function(e,t){e.component(oo,tt),e.component(ro,ot),e.component(no,ct),e.component(te,To),e.component(oe,vo),e.component(se,Uo),e.component(ee,Lo),e.component(ne,Mo),e.component(ie,Vo),e.component(X,Yo),e.component(Z,Xo),e.component(q,Zo),e.component(Q,qo),e.component(re,Fo),e.component(ae,ut),e.component(pe,ze),e.component(le,We),e.component(ce,Ke),e.component(ue,Ye),e.component(de,Xe),e.component(me,Je),e.component(Oe,et),e.component(Pe,Qe),e.component(fe,qe),e.component(he,Ze),e.component(K,nt),e.component(J,it),e.component(Y,k),e.component(qt,Jo),e.component(Ee,st),e.component(ge,ht),e.component(ye,ft),e.component(so,pt),e.component(io,dt),e.provide(l,new _("root"))}};import{shallowRef as Pt,ref as ys}from"vue";import{EVENT_ZOOM as Ot}from"@visuallyjs/browser-ui";import{inject as Cs}from"vue";function Cm(){let e=Cs(l),t=Pt(null),r=Pt(null),o=Pt(null),a=ys(1);return e==null||e.getSurface(p=>{r.value=p,r.value.bind(Ot,n=>{a.value=n.zoom})}),e==null||e.getDiagram(p=>{t.value=p,t.value.$ui.bind(Ot,n=>{a.value=n.zoom})}),e==null||e.getPaper(p=>{o.value=p,o.value.bind(Ot,n=>{a.value=n.zoom})}),a}import{inject as Ts,onUnmounted as _s}from"vue";import{EVENT_DATA_UPDATED as tr,EVENT_GRAPH_CLEARED as or}from"@visuallyjs/browser-ui";function Im(e){let t=Ts(l);if(t){let r=null,o=()=>{r&&e(r)},a=()=>{r&&(r.unbind(tr,o),r.unbind(or,o))},p=n=>{a(),r=n,r&&(r.bind(tr,o),r.bind(or,o),o())};t.getModel(n=>{p(n)}),_s(()=>{a()})}}import{shallowRef as Ss}from"vue";import{inject as vs}from"vue";function Lm(){let e=vs(l),t=Ss(null);return e==null||e.getSurface(r=>{t.value=r}),t}import{shallowRef as Rs}from"vue";import{inject as Ns}from"vue";function Hm(){let e=Ns(l),t=Rs(null);return e==null||e.getDiagram(r=>{t.value=r}),t}import{shallowRef as As}from"vue";import{inject as xs}from"vue";function Ym(){let e=xs(l),t=As(null);return e==null||e.getPaper(r=>{t.value=r}),t}export{ve as $initialiseVueOverlays,Xe as AreaChartComponent,Yo as BackgroundComponent,ze as BarChartComponent,Po as BaseOverlayComponent,g as BrowserUIVueModel,qe as BubbleChartComponent,eo as CLASS_VUE_GROUP,Qt as CLASS_VUE_NODE,to as CLASS_VUE_OVERLAY,de as COMPONENT_AREA_CHART,X as COMPONENT_BACKGROUND,pe as COMPONENT_BAR_CHART,fe as COMPONENT_BUBBLE_CHART,le as COMPONENT_COLUMN_CHART,ne as COMPONENT_CONTROLS,se as COMPONENT_DIAGRAM,ae as COMPONENT_DIAGRAM_PALETTE,no as COMPONENT_DIAGRAM_PROVIDER,ge as COMPONENT_EDGE_PROPERTY_MAPPINGS_INSPECTOR,ie as COMPONENT_EXPORT_CONTROLS,Pe as COMPONENT_GAUGE_CHART,Z as COMPONENT_GRID_BACKGROUND,q as COMPONENT_IMAGE_BACKGROUND,Ee as COMPONENT_INSPECTOR,ue as COMPONENT_LINE_CHART,ee as COMPONENT_MINIVIEW,re as COMPONENT_PALETTE,oe as COMPONENT_PAPER,ro as COMPONENT_PAPER_PROVIDER,me as COMPONENT_PIE_CHART,Oe as COMPONENT_SANKEY_CHART,he as COMPONENT_SCATTER_CHART,ye as COMPONENT_SHAPE_PROPERTIES_INSPECTOR,te as COMPONENT_SURFACE,io as COMPONENT_SURFACE_POPUP,oo as COMPONENT_SURFACE_PROVIDER,Q as COMPONENT_TILED_IMAGE_BACKGROUND,ce as COMPONENT_XY_CHART,Jo as ColorPickerComponent,We as ColumnChartComponent,Mo as ControlsComponent,Zt as DEFAULT_SHAPE_HEIGHT,Xt as DEFAULT_SHAPE_WIDTH,Ct as DEFAULT_VUE_PAPER_ID,yt as DEFAULT_VUE_SURFACE_ID,pt as DecoratorComponent,Uo as DiagramComponent,ut as DiagramPaletteComponent,ct as DiagramProvider,Rr as EVENT_VERTEX_UPDATED,je as EVENT_VERTICES_RENDERED,ht as EdgePropertyMappingsInspectorComponent,k as EdgeTypePickerComponent,Vo as ExportControlsComponent,Qe as GaugeChartComponent,Xo as GridBackgroundComponent,Zo as ImageBackgroundComponent,st as InspectorComponent,v as InspectorGetterSymbol,Mi as InspectorSetterSymbol,Ye as LineChartComponent,Lo as MiniviewComponent,vt as PROP_ACTIVE_TRACKING,$t as PROP_ALLOW_CLICK_TO_ADD,Lt as PROP_ALLOW_DROP_ON_CANVAS,Bt as PROP_ALLOW_DROP_ON_EDGE,Ut as PROP_ALLOW_DROP_ON_GROUP,Gt as PROP_ALLOW_DROP_ON_NODE,Wt as PROP_ALLOW_ROTATION,Kt as PROP_AUTO_EDGE_CONNECT,Yt as PROP_CANVAS_DROP_FILTER,V as PROP_CLASS_NAME,Ht as PROP_CLICK_TO_ADD_ONLY,_t as PROP_CLICK_TO_CENTER,Le as PROP_CSV_DATA,y as PROP_DATA,Mt as PROP_DATA_GENERATOR,Be as PROP_DATA_SOURCE_FILTER,z as PROP_DATA_TYPE,Jt as PROP_DRAG_SIZE,Vt as PROP_GROUP_IDENTIFIER,ma as PROP_ID,jt as PROP_IGNORE_DROP_ON_NODE,xt as PROP_INTERACTIVE,Ue as PROP_JSON_DATA,At as PROP_MODE,$ as PROP_MODEL,B as PROP_MODEL_OPTIONS,kt as PROP_ON_VERTEX_ADDED,M as PROP_OPTIONS,Nt as PROP_PAPER_ID,Dt as PROP_PIVOT,H as PROP_RENDER_OPTIONS,zt as PROP_ROTATION_SPEED,bt as PROP_SELECTOR,Ft as PROP_SELECT_AFTER_ADD,St as PROP_SHOW_LASSO,N as PROP_SURFACE_ID,Rt as PROP_TRACK_SELECTION,Tt as PROP_TYPE_FUNCTION,wt as PROP_TYPE_GENERATOR,E as PROP_URL,It as PROP_USE_MODEL,W as PROP_VIEW_OPTIONS,Fo as PaletteComponent,vo as PaperComponent,ot as PaperProvider,Je as PieChartComponent,et as SankeyChartComponent,Ze as ScatterChartComponent,nt as ShapeComponent,it as ShapePaletteComponent,ft as ShapePropertiesInspectorComponent,To as SurfaceComponent,dt as SurfacePopup,tt as SurfaceProvider,qt as TAG_COLOR_PICKER,so as TAG_DECORATOR,Y as TAG_EDGE_TYPE_PICKER,K as TAG_SHAPE,J as TAG_SHAPE_PALETTE,qo as TiledImageBackgroundComponent,mm as VisuallyJsPlugin,_ as VisuallyJsService,l as VisuallyJsServiceKey,Ke as XYChartComponent,Eo as addPaper,Oo as addSurface,Xa as bindToDevLifecycle,wi as doProvideInspector,Vs as newInstance,Hm as useDiagram,Ym as usePaper,Lm as useSurface,Im as useVisuallyJsUpdate,Cm as useZoom,lo as vertexHasRendered,po as vertexHasUpdated,Nr as vertexWillRender};
1
+ var ir=Object.defineProperty,sr=Object.defineProperties;var ar=Object.getOwnPropertyDescriptors;var gt=Object.getOwnPropertySymbols;var lr=Object.prototype.hasOwnProperty,pr=Object.prototype.propertyIsEnumerable;var Ct=(e,t,r)=>t in e?ir(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,b=(e,t)=>{for(var r in t||(t={}))lr.call(t,r)&&Ct(e,r,t[r]);if(gt)for(var r of gt(t))pr.call(t,r)&&Ct(e,r,t[r]);return e},B=(e,t)=>sr(e,ar(t));import{log as cr,BrowserUIModel as ur}from"@visuallyjs/browser-ui";var y=class extends ur{render(t,r){return cr("render called directly on BrowserUiVue class: should not happen. Surface component should use internal render."),null}};function Bs(e){return e=e||{},new y(e)}var Tt="surfaceId",_t="paperId",St="typeFunction",vt="clickToCenter",Rt="showLasso",Nt="activeTracking",At="trackSelection",N="surfaceId",xt="paperId",V="className",g="data",Dt="mode",M="options",H="renderOptions",L="modelOptions",$="model",W="viewOptions",E="url",z="dataType",It="interactive",bt="pivot",Be="dataSourceFilter",Ue="csvData",Ge="jsonData",Mt="useModel",fa="id",wt="selector",Vt="dataGenerator",Lt="typeGenerator",Bt="groupIdentifier",Ut="allowDropOnEdge",Gt="allowDropOnCanvas",jt="allowDropOnGroup",kt="allowDropOnNode",Ft="ignoreDropOnNode",Ht="onVertexAdded",$t="selectAfterAdd",Wt="clickToAddOnly",zt="allowClickToAdd",Kt="allowRotation",Jt="rotationSpeed",Yt="autoEdgeConnect",Xt="dragSize",Zt="canvasDropFilter",K="Shape",J="ShapePalette",qt=120,Qt=90,Y="EdgeTypePickerComponent",eo="ColorPickerComponent",to="vjs-vue-node",oo="vjs-vue-group",ro="vjs-vue-overlay",X="BackgroundComponent",Z="GridBackgroundComponent",q="ImageBackgroundComponent",Q="TiledImageBackgroundComponent",ee="MiniviewComponent",te="SurfaceComponent",no="SurfaceProvider",oe="PaperComponent",io="PaperProvider",so="DiagramProvider",re="PaletteComponent",ne="ControlsComponent",ie="ExportControlsComponent",se="DiagramComponent",ae="DiagramPaletteComponent",le="ColumnChartComponent",pe="BarChartComponent",ce="XYChartComponent",ue="LineChartComponent",de="AreaChartComponent",me="PieChartComponent",he="ScatterChartComponent",fe="BubbleChartComponent",Pe="GaugeChartComponent",Oe="SankeyChartComponent",Ee="InspectorComponent",ye="EdgePropertyMappingsInspector",ao="SurfacePopup",lo="Decorator",ge="ShapePropertiesInspectorComponent";import{addClass as dr,BrowserUI as mr,isGroup as hr,Vertex as po}from"@visuallyjs/browser-ui";var Ce={props:{data:Object,model:y,obj:po,vertex:po,ui:mr,el:Element,def:Object,eventInfo:Object},mounted(){let e=this,t=hr(e.vertex)?oo:to;e.el.firstElementChild&&dr(e.el.firstElementChild,t),e.ui.$vertexRendered(e.vertex,e.el,e.def,e.eventInfo),co(e.ui.id,e.vertex)},methods:{getModel:function(){return this.model},removeVertex:function(){this.model.remove(this.vertex)}},updated(){this.ui.$revalidateElement(this.el),uo(this.ui.id,this.vertex)}};var mo={mixins:[Ce],methods:{getNode:function(){return this.obj},removeNode:function(){this.model.removeNode(this.getNode())},updateNode:function(e){this.model.updateNode(this.obj,e);let t=this.ui.getRenderedElement(this.obj.getFullId());this.ui.$revalidateElement(t)}}};var ho={methods:{getGroup:function(){return this.obj},removeGroup:function(e){this.model.removeGroup(this.obj,e)},updateGroup:function(e){this.model.updateGroup(this.obj,e);let t=this.ui.getRenderedElement(this.obj.getFullId());this.ui.$revalidateElement(t)}},mixins:[Ce]};import{markRaw as C}from"vue";import{addClass as fr,BrowserUI as Pr,CLASS_DEFAULT_GROUP as Or,CLASS_DEFAULT_NODE as Er,ELEMENT_DIV as fo,extend as Po,isGroup as yr,OptimisticEventGenerator as gr,renderSurface as Cr,updateClasses as Tr,Overlay as _r,Edge as Oo,OVERLAY_TYPE_CUSTOM as Sr,uuid as vr,renderPaper as Rr}from"@visuallyjs/browser-ui";var je=class{constructor(){this.unrenderedVertices=new Map;this.eventManager=new gr;this.hasRendered=!1}vertexWillRender(t){this.unrenderedVertices.set(t.id,t),this.hasRendered=!1}vertexHasRendered(t){this.unrenderedVertices.delete(t.id),this.unrenderedVertices.size===0&&(this.hasRendered=!0,this.eventManager.fire(ke))}vertexHasUpdated(t){this.eventManager.fire(Nr,t)}},ke="vertices:rendered",Nr="vertex:updated",Fe=new Map;function Te(e){return Fe.has(e)||Fe.set(e,new je),Fe.get(e)}function co(e,t){Te(e).vertexHasRendered(t)}function uo(e,t){Te(e).vertexHasUpdated(t)}function Ar(e,t){Te(e).vertexWillRender(t)}function qa(e,t,r){let o=Te(e);o&&(o.eventManager.bind(t,r),t===ke&&o.hasRendered&&o.eventManager.fire(ke))}var _e=(e,t)=>{t.parentNode&&t.parentNode.removeChild(t)},Eo={props:{data:Object,model:y,obj:Oo,edge:Oo,overlay:_r,ui:Pr,el:Element,def:Object,eventInfo:Object},mounted(){let e=this;e.el.firstElementChild&&fr(e.el.firstElementChild,ro)},updated(){this.ui.$revalidateElement(this.el)}},Se=(e,t,r,o,a,p,n,i,s)=>{let m=n.component!=null,u=yr(i),f=[];m||f.push(u?Or:Er);let h=m?n.component:{render(P){return P.data.label||""}};if(h){let P=document.createElement(fo);Tr(P,f),h.mixins==null&&(h.mixins=[]);let O=u?ho:mo;h.mixins.find(T=>T===O)||h.mixins.push(O),Ar(p.id,i);let w={data:r,model:C(o),ui:C(p),obj:C(i),vertex:C(i),el:P,def:C(n),eventInfo:s==null?null:C(s)};if(n.inject)for(let T in n.inject){let I=n.inject[T],nr=typeof I=="function"?I(i,o):I;w[T]=nr}e.push({component:C(h),el:P,t:i.getFullId(),props:w,vertex:i})}};function yo(e,t,r,o,a,p){let n={reactive:!0,asynchronous:!0,usesWrapperElement:!1,update:(s,m,u,f)=>{},render:(s,m,u,f,h,P,O,R)=>Se(o,s,m,u,f,h,P,O,R),cleanupVertex:_e,cleanupPort:_e,rerender:(s,m,u,f,h,P,O,R,w)=>{let T=o.findIndex(I=>I.vertex===O);T!=null&&o.splice(T,1)[0].el,h.$__unmanage(w,!0,!0),requestAnimationFrame(()=>{Se(o,s,m,u,f,h,P,O,R)})}},i=Po(a||{},{view:p||{},id:t});return Cr(e,r,n,i)}function go(e,t,r,o,a,p){let n={reactive:!0,asynchronous:!0,usesWrapperElement:!1,update:(s,m,u,f)=>{},render:(s,m,u,f,h,P,O,R)=>Se(o,s,m,u,f,h,P,O,R),cleanupVertex:_e,cleanupPort:_e,rerender:(s,m,u,f,h,P,O,R,w)=>{let T=o.findIndex(I=>I.vertex===O);T!=null&&o.splice(T,1)[0].el,h.$__unmanage(w,!0,!0),requestAnimationFrame(()=>{Se(o,s,m,u,f,h,P,O,R)})}},i=Po(a||{},{view:p||{},id:t});return Rr(e,r,n,i)}function ve(e,t,r,o){if(e.edges)for(let a in e.edges){let p=e.edges[a];p.overlays&&(p.overlays=p.overlays.map(n=>{let i={};return n.component!=null?{type:Sr,options:{create:m=>{let u=document.createElement(fo),f=vr();n.component.mixins==null&&(n.component.mixins=[]),n.component.mixins.indexOf(Eo)===-1&&n.component.mixins.push(Eo);let h=b({data:m.edge.data,model:C(r()),ui:C(t()),obj:m.edge,edge:m.edge,el:u,def:C(n),eventInfo:null,overlay:n},i);return o.push({component:C(n.component),el:u,t:f,props:h}),u}}}:n}))}}import{log as Co,Paper as xr,Surface as Dr}from"@visuallyjs/browser-ui";import{shallowRef as U}from"vue";var l=Symbol.for("visuallyjs-service"),_=class{constructor(t){this.context=t;this.a=[];this.l=[];this.p=[];this.c=[];this.surface=U(null);this.model=U(null);this.paper=U(null);this.diagram=U(null);this.ui=U(null)}getSurface(t){this.r(this.l,t,this.u)}getDiagram(t){this.r(this.p,t,this.m)}getPaper(t){this.r(this.c,t,this.h)}getModel(t){this.r(this.a,t,this.i)}getModelDirect(){return this.i}r(t,r,o){if(o!=null)try{r(o)}catch(a){Co(`WARN: could not dispatch ${a}`)}else t.push(r)}setSurface(t){this.surface.value=t,this.model.value=t.model,this.ui.value=t,this.u=t,this.s(t.model),this.n(this.l,t)}setDiagram(t){this.diagram.value=t,this.model.value=t.model,this.ui.value=t.$ui,this.m=t,this.s(t.model),t.$ui instanceof Dr?this.setSurface(t.$ui):t.$ui instanceof xr&&this.setPaper(t.$ui),this.n(this.p,t)}setPaper(t){this.paper.value=t,this.model.value=t.model,this.ui.value=t,this.h=t,this.s(t.model),this.n(this.c,t)}s(t){this.i=t,this.n(this.a,t)}n(t,r){t.forEach(o=>{try{o(r)}catch(a){Co(`WARN: could not flush all queue entries ${a}`)}})}};import{h as G,inject as Ir,Teleport as To}from"vue";import{ELEMENT_DIV as br,EVENT_GROUP_REMOVED as Mr,EVENT_GROUP_UPDATED as wr,EVENT_NODE_REMOVED as Vr,EVENT_NODE_UPDATED as Lr,EVENT_RENDER_END as Br,clone as _o,EVENT_EDGE_UPDATED as Ur,EVENT_EDGE_REMOVED as Gr,EVENT_GRAPH_CLEARED as jr}from"@visuallyjs/browser-ui";var So={setup(e){return{service:Ir(l),surfaceId:e.surfaceId||Tt}},name:te,props:{[g]:{type:Object},[H]:{type:Object},[L]:{type:Object},[W]:{type:Object},[$]:{type:Object},[E]:{type:String},[z]:{type:String},[N]:{type:String}},data:function(){return{vertices:[],overlays:[]}},mounted(){let e=this,t=this.model||new y(this.modelOptions||{}),r=this.$refs.root;e.e=!1;let o=_o(this.viewOptions||{});ve(o,()=>this.surface,()=>t,this.overlays),this.surface=yo(t,this.surfaceId,r,this.vertices,_o(this.renderOptions||{}),o),this.service.setSurface(this.surface);let a=(n,i)=>{let s=()=>{let u={};return i.originalData||i.updates?u=Object.assign(i.originalData,i.updates):i.newData&&Object.assign(u,i.newData),u},m=this.vertices.find(u=>u.t===n);m!=null&&(m.props.data=s())},p=n=>{let i=this.vertices.findIndex(s=>s.t===n);i!==-1&&this.vertices.splice(i,1)};t.bind(Lr,n=>{a(n.vertex.getFullId(),n)}),t.bind(wr,n=>{a(n.vertex.getFullId(),n)}),t.bind(Vr,n=>{p(n.node.id)}),t.bind(Mr,n=>{p(n.group.id)}),t.bind(Ur,n=>{let i=n.edge.id;this.overlays.forEach(s=>{s.props.edge&&s.props.edge.id===i&&(s.props.data=n.edge.data)})}),t.bind(Gr,n=>{let i=n.edge.id,s=this.overlays.length-1;for(;s>=0;)this.overlays[s].props.edge&&this.overlays[s].props.edge.id===i&&this.overlays.splice(s,1),s--}),t.bind(jr,()=>{this.vertices.length=0,this.overlays.length=0}),this.surface.bind(Br,()=>setTimeout(()=>this.surface.$redrawEveryConnection())),e.url?t.load({url:e.url,dataType:e.dataType,onload:()=>e.e=!0}):e.data?t.load({data:e.data,dataType:e.dataType,onload:()=>e.e=!0}):e.e=!0},watch:{[g]:{handler(e){this.e!==!1&&this.surface&&this.surface.model&&(this.surface.model.clear(),requestAnimationFrame(()=>{this.surface.model.load({data:e,dataType:this.dataType})}))}},[E]:{handler(e){this.e!==!1&&this.surface&&this.surface.model&&(this.surface.model.clear(),requestAnimationFrame(()=>{this.surface.model.load({url:e,dataType:this.dataType})}))}}},render:function(){let e=this.vertices.map(t=>G(To,{to:t.el,key:t.t},[G(t.component,t.props)]));return this.overlays.forEach(t=>{e.push(G(To,{to:t.el,key:t.t},[G(t.component,t.props)]))}),G(br,{ref:"root",class:"vjs-vue-surface",style:{width:"100%",height:"100%"}},e.concat(this.$slots.hasOwnProperty("default")?this.$slots.default():[]))}};import{h as j,inject as kr,Teleport as vo}from"vue";import{ELEMENT_DIV as Fr,EVENT_GROUP_REMOVED as Hr,EVENT_GROUP_UPDATED as $r,EVENT_NODE_REMOVED as Wr,EVENT_NODE_UPDATED as zr,EVENT_RENDER_END as Kr,clone as Ro,EVENT_EDGE_UPDATED as Jr,EVENT_EDGE_REMOVED as Yr,EVENT_GRAPH_CLEARED as Xr}from"@visuallyjs/browser-ui";var No={setup(e){return{service:kr(l),paperId:e.paperId||_t}},name:oe,props:{[g]:{type:Object},[H]:{type:Object},[L]:{type:Object},[W]:{type:Object},[$]:{type:Object},[E]:{type:String},[z]:{type:String},[xt]:{type:String}},data:function(){return{vertices:[],overlays:[]}},mounted(){let e=this,t=this.model||new y(this.modelOptions||{}),r=this.$refs.root;e.e=!1;let o=Ro(this.viewOptions||{});ve(o,()=>this.paper,()=>t,this.overlays),this.paper=go(t,this.paperId,r,this.vertices,Ro(this.renderOptions||{}),o),this.service.setPaper(this.paper);let a=(n,i)=>{let s=()=>{let u={};return i.originalData||i.updates?u=Object.assign(i.originalData,i.updates):i.newData&&Object.assign(u,i.newData),u},m=this.vertices.find(u=>u.t===n);m!=null&&(m.props.data=s())},p=n=>{let i=this.vertices.findIndex(s=>s.t===n);i!==-1&&this.vertices.splice(i,1)};t.bind(zr,n=>{a(n.vertex.getFullId(),n)}),t.bind($r,n=>{a(n.vertex.getFullId(),n)}),t.bind(Wr,n=>{p(n.node.id)}),t.bind(Hr,n=>{p(n.group.id)}),t.bind(Jr,n=>{let i=n.edge.id;this.overlays.forEach(s=>{s.props.edge&&s.props.edge.id===i&&(s.props.data=n.edge.data)})}),t.bind(Yr,n=>{let i=n.edge.id,s=this.overlays.length-1;for(;s>=0;)this.overlays[s].props.edge&&this.overlays[s].props.edge.id===i&&this.overlays.splice(s,1),s--}),t.bind(Xr,()=>{this.vertices.length=0,this.overlays.length=0}),this.paper.bind(Kr,()=>setTimeout(()=>this.paper.$redrawEveryConnection())),e.url?t.load({url:e.url,dataType:e.dataType,onload:()=>e.e=!0}):e.data?t.load({data:e.data,dataType:e.dataType,onload:()=>e.e=!0}):e.e=!0},watch:{[g]:{handler(e){this.e!==!1&&this.paper&&this.paper.model&&(this.paper.model.clear(),requestAnimationFrame(()=>{this.paper.model.load({data:e,dataType:this.dataType})}))}},[E]:{handler(e){this.e!==!1&&this.paper&&this.paper.model&&(this.paper.model.clear(),requestAnimationFrame(()=>{this.paper.model.load({url:e,dataType:this.dataType})}))}}},render:function(){let e=this.vertices.map(t=>j(vo,{to:t.el,key:t.t},[j(t.component,t.props)]));return this.overlays.forEach(t=>{e.push(j(vo,{to:t.el,key:t.t},[j(t.component,t.props)]))}),j(Fr,{ref:"root",class:"vjs-vue-paper",style:{width:"100%",height:"100%"}},e.concat(this.$slots.hasOwnProperty("default")?this.$slots.default():[]))}};import{h as d,inject as Zr,watch as qr}from"vue";import{LassoPlugin as Qr,SURFACE_MODE_SELECT as Ao,SURFACE_MODE_PAN as xo,PAN_PATH as en,PAN_VIEW_BOX as tn,LASSO_PATH as on,LASSO_VIEW_BOX as rn,UNDO_PATH as nn,UNDO_VIEW_BOX as sn,REDO_PATH as an,REDO_VIEW_BOX as ln,ZOOM_TO_FIT_PATH as pn,ZOOM_TO_FIT_VIEW_BOX as cn,EVENT_UNDOREDO_UPDATE as un,TRUE as Do,FALSE as Re,EVENT_SURFACE_MODE_CHANGED as dn,ELEMENT_DIV as Io,ATTRIBUTE_CONTROLS_ORIENTATION as mn,ZOOM_IN_OUT_VIEW_BOX as bo,ZOOM_IN_PATH as hn,ZOOM_OUT_PATH as fn,RESET_SELECTION_PATH as Pn,RESET_SELECTION_VIEW_BOX as On,CLEAR_PATH as En,CLEAR_VIEW_BOX as yn,ATTRIBUTE_RESET_SELECTION as gn,CLASS_CONTROLS_RESET_SELECTION as Cn,EVENT_SELECT as Tn,EVENT_DESELECT as _n,EVENT_SELECTION_CLEARED as Sn,supportsPathEditing as vn}from"@visuallyjs/browser-ui";var Rn="Clear dataset?",He="vjs-selected-mode",$e="can-undo",We="can-redo",Nn="data-undo",An="data-redo",Mo="data-mode",xn="data-reset",Dn="data-clear",In="data-zoom-in",bn="data-zoom-out",wo="vjs-controls-has-selection",Vo={setup(e){return{service:Zr(l)}},name:ne,props:{clear:{type:Boolean,default:!0},[N]:{type:String},undoRedo:{type:Boolean,default:!0},orientation:{type:String,default:"row"},zoomToExtents:{type:Boolean,default:!0},zoomButtons:{type:Boolean,default:!1},clearMessage:{type:String,default:Rn},onMaybeClear:{type:Function},className:{type:String,default:""}},methods:{panMode:function(){var e;(e=this.service.surface.value)==null||e.setMode(xo)},selectMode:function(){var e;(e=this.service.surface.value)==null||e.setMode(Ao)},zoomToFit:function(){var e;(e=this.service.surface.value)==null||e.zoomToFit()},doClear:function(){let e=this.service.surface.value;e&&(this.onMaybeClear!=null?this.onMaybeClear(()=>e.model.clear()):window.confirm(this.clearMessage)&&e.model.clear())},undo:function(){var e;(e=this.service.model.value)==null||e.undo()},redo:function(){var e;(e=this.service.model.value)==null||e.redo()},zoomIn:function(){var e;(e=this.service.surface.value)==null||e.zoomIn()},zoomOut:function(){var e;(e=this.service.surface.value)==null||e.zoomOut()},resetSelection(){let e=this.service.surface.value;e&&(e.model.clearSelection(),vn(e)&&e.stopEditingPath())},updateSelectionState:function(){let e=this.service.surface.value;e&&(e.model.getSelection().isEmpty()?this.$refs.root.removeAttribute(wo):this.$refs.root.setAttribute(wo,"true"))}},data:function(){return{ready:!1,hasLasso:!1}},render(){if(this.ready){let e=[];return this.showPan&&(e.push(d("i",{class:`vjs-pan-mode ${He}`,[Mo]:xo,onClick:()=>this.panMode(),title:"Pan mode"},[d("svg",{viewBox:tn,stroke:"currentColor",fill:"none"},[d("path",{d:en})])])),e.push(d("i",{class:"vjs-select-mode",[Mo]:Ao,onClick:()=>this.selectMode(),title:"Select mode"},[d("svg",{viewBox:rn,stroke:"currentColor",fill:"currentColor"},[d("path",{d:on})])]))),this.undoRedo&&(e.push(d("i",{class:"vjs-undo",[Nn]:!0,title:"Undo last action",onClick:()=>this.undo()},[d("svg",{viewBox:sn,stroke:"currentColor",fill:"none"},[d("path",{d:nn,"stroke-width":2})])])),e.push(d("i",{class:"vjs-redo",[An]:!0,title:"Redo last action",onClick:()=>this.redo()},[d("svg",{viewBox:ln,stroke:"currentColor",fill:"none"},[d("path",{d:an,"stroke-width":2})])]))),this.zoomToExtents&&e.push(d("i",{class:"vjs-zoom-to-fit",[xn]:"true",onClick:()=>this.zoomToFit(),title:"Zoom to Fit"},[d("svg",{viewBox:cn,stroke:"currentColor",fill:"currentColor"},[d("path",{d:pn})])])),this.zoomButtons&&(e.push(d("i",{class:"vjs-zoom-in",[In]:"true",onClick:()=>this.zoomIn(),title:"Zoom In"},[d("svg",{viewBox:bo,stroke:"currentColor",fill:"currentColor"},[d("path",{d:hn})])])),e.push(d("i",{class:"vjs-zoom-out",[bn]:"true",onClick:()=>this.zoomOut(),title:"Zoom Out"},[d("svg",{viewBox:bo,stroke:"currentColor",fill:"currentColor"},[d("path",{d:fn})])]))),e.push(d("i",{class:Cn,[gn]:"true",onClick:()=>{this.resetSelection()}},[d("svg",{viewBox:On,stroke:"currentColor",fill:"currentColor"},[d("path",{d:Pn})])])),this.clear&&e.push(d("i",{class:"vjs-clear-dataset",[Dn]:"true",onClick:()=>{this.doClear()}},[d("svg",{viewBox:yn,stroke:"currentColor",fill:"currentColor"},[d("path",{d:En})])])),d(Io,{class:`vjs-controls ${this.className}`,ref:"root",[$e]:!1,[We]:!1,[mn]:this.orientation},e)}else return d(Io,{ref:"root"})},mounted(){let e=t=>{let r=t.getPlugin(Qr.type);this.showPan=r!=null,t.bind(dn,o=>{t.removeClass(t.$getSelector(this.$refs.root,"[data-mode]"),He),t.addClass(t.$getSelector(this.$refs.root,"[data-mode='"+o+"']"),He)}),t.model.bind(un,o=>{this.$refs.root.setAttribute($e,o.undoCount>0?Do:Re),this.$refs.root.setAttribute(We,o.redoCount>0?Do:Re)}),t.model.bind(Tn,()=>this.updateSelectionState()),t.model.bind(_n,()=>this.updateSelectionState()),t.model.bind(Sn,()=>this.updateSelectionState()),this.$refs.root.setAttribute($e,Re),this.$refs.root.setAttribute(We,Re),this.ready=!0};this.service.surface.value==null?qr(this.service.surface,e):e(this.service.surface.value)}};import{h as A,inject as Mn}from"vue";import{CLASS_CONTROLS as wn,CLASS_EXPORT_CONTROLS as Vn,ELEMENT_DIV as Ln,ImageExportUI as Lo,SvgExportUI as Bn,TYPE_JPG as Un,TYPE_PNG as Gn,TYPE_SVG as jn}from"@visuallyjs/browser-ui";var Bo={name:ie,setup(e){return{service:Mn(l)}},props:{surfaceId:{type:String},showLabel:{type:Boolean,default:!0},label:{type:String,default:"Export :"},margins:{type:Object},svgOptions:{type:Object},imageOptions:{type:Object},allowSvgExport:{type:Boolean,default:!0},allowPngExport:{type:Boolean,default:!0},allowJpgExport:{type:Boolean,default:!0}},methods:{loadSurface:function(e){let t=this.service.surface.value;t&&e(t)},exportSVG:function(){this.loadSurface(e=>{let t=this.svgOptions||{};this.margins!=null&&t.margins==null&&Object.assign(t,this.margins),new Bn(e).export(t)})},exportJPG:function(){this.loadSurface(e=>{let t=this.imageOptions||{};this.margins!=null&&t.margins==null&&Object.assign(t,this.margins),t.type="image/jpeg",new Lo(e).export(t)})},exportPNG:function(){this.loadSurface(e=>{let t=this.imageOptions||{};this.margins!=null&&t.margins==null&&Object.assign(t,this.margins),new Lo(e).export(t)})}},render(){let e=this.showLabel!==!1,t=this.allowSvgExport!==!1,r=this.allowPngExport!==!1,o=this.allowJpgExport!==!1,a=[];return t&&a.push(A("i",{},[A("a",{href:"#","data-type":jn,onClick:()=>this.exportSVG()},"SVG")])),r&&a.push(A("i",{},[A("a",{href:"#","data-type":Gn,onClick:()=>this.exportPNG()},"PNG")])),o&&a.push(A("i",{},[A("a",{href:"#","data-type":Un,onClick:()=>this.exportJPG()},"JPG")])),e&&a.unshift(A("span",{},[this.label])),A(Ln,{class:`${wn} ${Vn}`},a)}};import{h as kn,inject as Fn,watch as Uo}from"vue";import{ELEMENT_DIV as Hn,MiniviewPlugin as $n}from"@visuallyjs/browser-ui";var Go={setup(e){return{service:Fn(l)}},name:ee,props:{[N]:{type:String},[V]:{type:String,default:""},[Nt]:{type:Boolean,default:!0},[vt]:{type:Boolean,default:!0},[Rt]:{type:Boolean,default:!0},[At]:{type:Boolean,default:!0},[St]:{type:Function}},mounted:function(){let e=t=>{t.addPlugin({type:$n.type,options:{container:this.$el,activeTracking:this.activeTracking,clickToCenter:this.clickToCenter,showLasso:this.showLasso,trackSelection:this.trackSelection,typeFunction:this.typeFunction}})};this.service.surface.value!=null&&e(this.service.surface.value),this.service.paper.value!=null?e(this.service.paper.value):(Uo(this.service.surface,e),Uo(this.service.paper,e))},render:function(e){return kn(Hn,{ref:"root",class:e.className})}};import{h as Wn,inject as zn,markRaw as Kn}from"vue";import{createDiagram as Jn,ELEMENT_DIV as Yn}from"@visuallyjs/browser-ui";var jo={setup(e){return{service:zn(l)}},name:se,props:{[g]:{type:Object},[E]:{type:String},[L]:{type:Object},[M]:{type:Object}},mounted(){let e=this.$refs.root;this.diagram=Kn(Jn(e,this.options,this.modelOptions)),this.service.setDiagram(this.diagram),this.data?this.diagram.load({data:this.data}):this.url&&this.diagram.load({url:this.url})},render:function(){return Wn(Yn,{ref:"root",class:"vjs-vue-surface",style:{width:"100%",height:"100%"}},this.$slots.hasOwnProperty("default")?this.$slots.default():[])}};import{h as Xn,inject as Zn,watch as ko}from"vue";import{ColumnChart as qn,BarChart as Qn,CategoryValueChart as ei,ELEMENT_DIV as ti,LineChart as oi,AreaChart as ri,PieChart as ni,ScatterChart as ii,BubbleChart as si,GaugeChart as ai,SankeyChart as li}from"@visuallyjs/browser-ui";var Fo={[V]:{type:String},[g]:{type:Object},[E]:{type:String},[Mt]:{type:Boolean,default:!1}},Ho={setup(){return{service:Zn(l)}},render:function(){return Xn(ti,{class:`${this.className}`,ref:"root"})}};function S(e,t,r=!0){let o=B(b({},Fo),{[M]:{type:Object}}),a={[g]:function(n){this.chart&&this.chart.load({data:n})},[E]:function(n){this.chart&&this.chart.load({url:n})},[M]:{handler:function(){this.o()},deep:!0}};r&&(o[Be]={type:Function},a[Be]=function(n){this.chart.setDataSourceFilter(n)});let p={o:function(){this.chart&&this.chart.destroy();let n=this.$refs.root,i=r?Object.assign({dataSourceFilter:this.dataSourceFilter},this.options):this.options;this.data&&(i.data=this.data),this.url&&(i.url=this.url);let s=()=>{this.chart=new t(n,i)};if(this.useModel)if(this.service.model.value!=null)i.dataSource=this.service.model.value,s();else{let m=ko(this.service.model,u=>{u!=null&&(i.dataSource=u,s(),m())})}else s()}};return B(b({},Ho),{name:e,props:o,watch:a,data:()=>({hasMounted:!1}),methods:p,mounted(){this.o()}})}var ze=S(le,qn),Ke=S(pe,Qn),Je=S(ce,ei,!1),Ye=S(me,ni),Xe=S(ue,oi),Ze=S(de,ri),qe=S(he,ii),Qe=S(fe,si),et=S(Pe,ai,!1),tt=B(b({},Ho),{name:Oe,props:B(b({},Fo),{[Ue]:{type:String},[Ge]:{type:Object},[It]:{type:Boolean},[bt]:{type:String},[M]:{type:Object}}),data:()=>({chart:null}),methods:{o:function(){this.chart&&this.chart.destroy();let e=this.$refs.root,t=Object.assign({},this.options);this.interactive!=null&&(t.interactive=this.interactive),this.pivot!=null&&(t.pivot=this.pivot),this.csvData&&(t.csvData=this.csvData),this.jsonData&&(t.jsonData=this.jsonData),this.url&&(t.url=this.url);let r=()=>{this.chart=new li(e,t)};if(this.useModel)if(this.service.model.value==null){let o=ko(this.service.model,a=>{a!=null&&(t.dataSource=a,r(),o())})}else t.dataSource=this.service.model.value,r();else r()}},mounted(){this.o()},watch:{pivot(e){this.chart&&this.chart.pivot(e)},[Ue](e){this.chart&&this.chart.load({csvData:e})},[Ge](e){this.chart&&this.chart.load({jsonData:e})},[E](e){this.chart&&this.chart.load({url:e})},[M]:{handler:function(){this.o()},deep:!0}}});import{h as pi,inject as ci,watch as ui}from"vue";import{defaultDataGenerator as di,ELEMENT_DIV as mi,Palette as hi}from"@visuallyjs/browser-ui";var $o={setup(e){return{service:ci(l)}},name:re,props:{[N]:{type:String},[wt]:{type:String},[Vt]:{type:Function},[Lt]:{type:Function},[Bt]:{type:Function},[Ut]:{type:[Boolean,Function],default:!1},[Gt]:{type:Boolean,default:!0},[jt]:{type:Boolean,default:!0},[kt]:{type:Boolean,default:!1},[Ft]:{type:Boolean,default:!1},[Xt]:Object,[Ht]:Function,[Zt]:Function,[V]:String,[Dt]:String,[$t]:{type:Boolean,default:!1},[zt]:{type:Boolean,default:!1},[Wt]:{type:Boolean,default:!1},[Kt]:{type:Boolean,default:!0},[Jt]:{type:Number,default:2e3},[Yt]:{type:[Boolean,Object],default:!1}},mounted:function(){let e=t=>{let r={source:this.$refs.root,selector:this.selector,dataGenerator:o=>this.dataGenerator?this.dataGenerator(o):di(o),allowDropOnEdge:this.allowDropOnEdge===!0,allowDropOnGroup:this.allowDropOnGroup!==!1,allowDropOnCanvas:this.allowDropOnCanvas!==!1,allowDropOnNode:this.allowDropOnNode===!0,ignoreDropOnNode:this.ignoreDropOnNode===!0,canvasDropFilter:this.canvasDropFilter,onVertexAdded:this.onVertexAdded,dragSize:this.dragSize,mode:this.mode,allowRotation:this.allowRotation!==!1,rotationSpeed:this.rotationSpeed||2e3,autoEdgeConnect:this.autoEdgeConnect};this.groupIdentifier!=null&&(r.groupIdentifier=this.groupIdentifier),this.typeGenerator!=null&&(r.typeGenerator=this.typeGenerator),this.palette=new hi(t,r)};this.service.surface.value==null?ui(this.service.surface,e):e(this.service.surface.value)},render:function(){return pi(mi,{ref:"root",class:this.className||""},this.$slots.hasOwnProperty("default")?this.$slots.default():[])}};import{provide as fi}from"vue";var ot={setup(){fi(l,new _("SurfaceProvider"))},render(){return this.$slots.hasOwnProperty("default")?this.$slots.default():[]}};import{provide as Pi}from"vue";var rt={setup(){Pi(l,new _("PaperProvider"))},render(){return this.$slots.hasOwnProperty("default")?this.$slots.default():[]}};import{h as Oi,inject as Ei,watch as yi}from"vue";import{CLASS_SHAPE as gi,convertToMultilineText as Wo,DEFAULT_LABEL_FILL_RATIO as nt,ELEMENT_SVG as Ci}from"@visuallyjs/browser-ui";var it={name:K,props:{data:{type:Object},showLabels:{type:Boolean,default:!1},labelProperty:{type:String,default:"label"},labelStrokeWidth:{type:Number},labelPosition:{type:Object,default:"center"},multilineLabels:{type:Boolean,default:!0},labelFillRatio:{type:Number,default:nt},labelColor:{type:String,default:"#000000"},font:{type:Object}},setup(){return{service:Ei(l)}},mounted(){let e=t=>{let r=t.getShapeLibrary(),o=r.renderCompiledShape(Object.assign({sw:this.getOutlineWidth()},this.data));if(this.$refs.container.appendChild(o),this.showLabels){let a=r.renderShapeLabel(this.data,this.labelProperty,this.labelStrokeWidth,null,this.labelColor,this.labelColor,this.font);this.$refs.container.appendChild(a),this.multilineLabels!=!1&&Wo(a,this.data[this.labelProperty]||"",this.getWidth()*(this.labelFillRatio||nt),this.labelPosition)}};this.service.ui.value==null?yi(this.service.ui,e):e(this.service.ui.value)},updated(){let e=this.service.surface.value;if(e){let t=e.getShapeLibrary(),r=t.renderCompiledShape(Object.assign({sw:this.getOutlineWidth()},this.data));if(this.$refs.container.replaceChildren(r),this.showLabels){let o=t.renderShapeLabel(this.data,this.labelProperty,this.labelStrokeWidth,null,this.labelColor,this.labelColor,this.font);this.$refs.container.appendChild(o),this.multilineLabels!=!1&&Wo(o,this.data[this.labelProperty]||"",this.getWidth()*(this.labelFillRatio||nt),this.labelPosition)}}},render:function(){return Oi(Ci,{ref:"container",preserveAspectRatio:"none",fill:this.getFill(),stroke:this.getOutline(),"stroke-width":this.getOutlineWidth(),viewBox:"0 0 "+this.getWidth()+" "+this.getHeight(),class:gi})},methods:{getWidth:function(){return this.data.width||qt},getHeight:function(){return this.data.height||Qt},getFill:function(){return this.data.fill||"#FFFFFF"},getOutline:function(){return this.data.outline||"#000000"},getOutlineWidth(){return this.data.outlineWidth||2}}};import{h as Ti,inject as _i,watch as Si}from"vue";import{ELEMENT_DIV as vi,ShapePalette as Ri}from"@visuallyjs/browser-ui";var st={name:J,props:{surfaceId:{type:String},dragSize:Object,iconSize:Object,fill:String,outline:String,showAllMessage:String,selectAfterDrop:Boolean,paletteStrokeWidth:Number,dataGenerator:Function,initialSet:String,mode:String,allowClickToAdd:Boolean,onVertexAdded:Function,showLabels:Boolean,inspector:{type:Boolean,default:!0},updateTypeOnPaletteTap:Boolean,preparedShapes:Array,allowDropOnEdge:[Boolean,Function],autoEdgeConnect:[Boolean,Object],showGroups:{type:Boolean,default:!0}},setup(e){return{service:_i(l)}},data:()=>({hasMounted:!1}),mounted(){let e=t=>{this.hasMounted||(this.hasMounted=!0,new Ri(t,{container:this.$refs.container,shapeLibrary:t.getShapeLibrary(),dragSize:this.dragSize,iconSize:this.iconSize,fill:this.fill,outline:this.outline,showAllMessage:this.showAllMessage,selectAfterDrop:this.selectAfterDrop,paletteStrokeWidth:this.paletteStrokeWidth,dataGenerator:this.dataGenerator,initialSet:this.initialSet,mode:this.mode,allowClickToAdd:this.allowClickToAdd,onVertexAdded:this.onVertexAdded,showLabels:this.showLabels,inspector:this.inspector,updateTypeOnPaletteTap:this.updateTypeOnPaletteTap,preparedShapes:this.preparedShapes,allowDropOnEdge:this.allowDropOnEdge,autoEdgeConnect:this.autoEdgeConnect,showGroups:this.showGroups}))};this.service.surface.value==null?Si(this.service.surface,e):e(this.service.surface.value)},render:function(){return Ti(vi,{ref:"container"})}};import{provide as zo,readonly as Ni,inject as Ai,h as xi,watch as Di}from"vue";import{ELEMENT_DIV as Ii,Inspector as bi,log as Mi}from"@visuallyjs/browser-ui";var v=Symbol.for("VueInspectorGetter"),wi=Symbol.for("VueInspectorSetter");function Vi(){let e=[],t=null;function r(p){try{p(t)}catch(n){Mi("WARN: inspector listener threw an exception",n)}}let o={listen:p=>{t!=null?r(p):e.push(p)}},a={inspector:p=>{t=p,e.forEach(r)}};return zo(wi,a),zo(v,Ni(o)),a}var at={name:Ee,props:{autoCommit:{type:Boolean,default:!0},multipleSelections:{type:Boolean,default:!0},filter:Function,renderEmptyContainer:Function,refresh:Function,className:String,showCloseButton:Boolean,afterUpdate:Function,modelValue:Object},emits:["update:modelValue"],setup(e,t){let r=Vi();return{service:Ai(l),inspectorProvider:r,inspector:null,emit:t.emit}},mounted(){let e=t=>{if(this.inspector==null){let r=new bi({container:this.$refs.root,ui:t,renderEmptyContainer:()=>(this.emit("update:modelValue",null),this.renderEmptyContainer?this.renderEmptyContainer():""),refresh:(o,a)=>{this.emit("update:modelValue",o),this.refresh&&this.refresh(o),setTimeout(a)},autoCommit:this.autoCommit,multipleSelections:this.multipleSelections,filter:this.filter,showCloseButton:this.showCloseButton,afterUpdate:()=>this.afterUpdate?this.afterUpdate(t):null});this.inspectorProvider.inspector(r)}};this.service.surface.value==null?Di(this.service.surface,e):e(this.service.surface.value)},render(){return xi(Ii,{ref:"root"},this.$slots.hasOwnProperty("default")?this.$slots.default():[])}};import{h as Li,inject as Bi}from"vue";import{EdgeTypePicker as Ui,ELEMENT_DIV as Gi,log as ji}from"@visuallyjs/browser-ui";var k={name:Y,props:{propertyName:String},setup(){return{inspectorProvider:Bi(v)}},mounted(){this.inspectorProvider?this.inspectorProvider.listen(e=>{let t=new Ui(e.$ui,this.$refs.container,e.$ui.$getEdgePropertyMappings(),e.getValue(this.propertyName),(r,o)=>{e.setValue(this.propertyName,o,null)});t.render(this.propertyName,e.f),e.onChange(()=>{t.reset(),t.select(this.propertyName,e.getValue(this.propertyName))})}):ji("WARN: EdgeTypePicker not instantiated inside an InspectorComponent. Cannot mount.")},render:function(){return Li(Gi,{ref:"container"})}};import{h as Ne,inject as ki}from"vue";import{CLASS_COLOR_PICKER as Ko,CLASS_COLOR_PICKER_SWATCH as Jo,CLASS_COLOR_PICKER_SWATCHES as Yo,EVENT_CONTEXT_UPDATE as Fi,ELEMENT_DIV as lt,INSPECTOR_CONTEXT_RECENT_COLORS as Ae}from"@visuallyjs/browser-ui";var xe={render(){let e=this.swatches.map(t=>Ne(lt,{title:t,class:Jo,style:`background-color:${t}`,"data-color":t,onClick:()=>this.selectSwatch(t)}));return Ne(lt,{class:`${Ko}`},[Ne("input",{type:"color","vjs-att":this.propertyName,ref:"colorInput"}),Ne(lt,{class:Yo},e)])},props:{propertyName:String,maxColors:{type:Number,default:10}},data:()=>({CLASS_COLOR_PICKER:Ko,CLASS_COLOR_PICKER_SWATCHES:Yo,CLASS_COLOR_PICKER_SWATCH:Jo,colorInput:null,swatches:[]}),mounted(){let e=ki(v);e&&e.listen(t=>{this.inspector=t,this.swatches=t.ensureContext(Ae,()=>[]),this.colorInput=this.$refs.colorInput,this.colorInput.addEventListener("change",this.colorPicked),t.bind(Fi,r=>{r.key===Ae&&(this.swatches=r.value.slice())}),t.bind("change",this.setCurrentColor),this.setCurrentColor()})},methods:{addColor:function(e){let t=this.inspector.ensureContext(Ae,()=>[]);if(e=e.toUpperCase(),!(t.find(o=>o.toUpperCase()===e)!=null)){let o=this.maxColors||10,a=t.slice();a.unshift(e),a.length>o&&(a.length=o),this.inspector.updateContext(Ae,a)}},colorPicked:function(){let e=this.colorInput.value;this.inspector.setValue(this.propertyName,e,null),this.addColor(e)},selectSwatch:function(e){this.inspector.setValue(this.propertyName,e,null),this.colorInput.value=e},setCurrentColor:function(){let e=this.inspector.getValue(this.propertyName);e!=null&&(this.colorInput.value=e,this.addColor(e))}}};import{h as De,inject as Hi,nextTick as $i,Teleport as Wi,watch as zi}from"vue";import{ELEMENT_DIV as pt,uuid as Ki}from"@visuallyjs/browser-ui";var ct={props:{placement:{type:String,default:"floating"},position:{type:Object},constraints:{type:Object}},data:()=>({hasMounted:!1,surface:null}),setup(e){return{service:Hi(l)}},mounted(){let e=t=>{if(!this.hasMounted){this.surface=t,this.hasMounted=!0;let r=this.position||{x:0,y:0};$i().then(()=>{this.placement==="floating"?t.floatElement(this.$refs.root,r):t.fixElement(this.$refs.fixedEl,r,this.constraints)})}};this.service.surface.value==null?zi(this.service.surface,e):e(this.service.surface.value)},render(){return De(pt,{ref:"root"},this.hasMounted?this.placement==="floating"?De(pt,{},this.$slots.hasOwnProperty("default")?this.$slots.default():[]):De(Wi,{to:this.surface.vertexLayer,key:Ki()},De(pt,{ref:"fixedEl"},this.$slots.hasOwnProperty("default")?this.$slots.default():[])):[])}};import{provide as Ji}from"vue";var ut={setup(){Ji(l,new _("DiagramProvider"))},render(){return this.$slots.hasOwnProperty("default")?this.$slots.default():[]}};import{h as Yi,inject as Xi,watch as Zi}from"vue";import{DiagramPalette as qi,ELEMENT_DIV as Qi,log as es}from"@visuallyjs/browser-ui";var dt={name:ae,props:{fill:String,outline:String,dragSize:Object,inspector:{type:Boolean,default:!0},updateTypeOnPaletteTap:Boolean,iconSize:Object,showLabels:Boolean,paletteStrokeWidth:Number,showAllMessage:String,onCellAdded:Function,mode:String,allowClickToAdd:Boolean,autoExitDrawMode:Boolean,selectAfterAdd:{type:Boolean,default:!0},className:String,diagram:{type:Object},onVertexAdded:Function,preparedShapes:Array,allowDropOnEdge:[Boolean,Function],autoEdgeConnect:[Boolean,Object],showGroups:{type:Boolean,default:!0}},setup(e){return{service:Xi(l)}},data:()=>({hasMounted:!1}),mounted(){if(this.service==null&&this.diagram==null)es("Cannot mount DiagramPalette - no service found and Diagram not passed in as a prop");else{let e=t=>{this.hasMounted||(this.hasMounted=!0,new qi(this.$refs.container,t,{fill:this.fill,outline:this.outline,dragSize:this.dragSize,inspector:this.inspector,iconSize:this.iconSize,showLabels:this.showLabels,paletteStrokeWidth:this.paletteStrokeWidth,showAllMessage:this.showAllMessage,onCellAdded:this.onCellAdded,mode:this.mode,allowClickToAdd:this.allowClickToAdd,autoExitDrawMode:this.autoExitDrawMode,selectAfterAdd:this.selectAfterAdd,onVertexAdded:this.onVertexAdded,updateTypeOnPaletteTap:this.updateTypeOnPaletteTap,preparedShapes:this.preparedShapes,allowDropOnEdge:this.allowDropOnEdge,autoEdgeConnect:this.autoEdgeConnect,showGroups:this.showGroups}))};this.diagram?e(this.diagram):this.service.diagram.value!=null?e(this.service.diagram.value):Zi(this.service.diagram,e)}},render:function(){return Yi(Qi,{ref:"container"})}};import{BLOCK as ts,ELEMENT_DIV as os,NONE as rs,PopupHandler as ns,CLASS_SURFACE_POPUP as is,ABSOLUTE as ss}from"@visuallyjs/browser-ui";import{h as as,inject as ls,onMounted as ps,ref as Ie,watch as cs}from"vue";var mt={name:"SurfacePopup",props:{selector:String,anchor:{type:String,default:"bottom"}},setup(e){let t=ls(l),r=Ie(null),o=Ie("block"),a=Ie(null),p=Ie(null),n=i=>{p.value=new ns(e.selector,a.value,i,s=>{r.value=s,s==null?o.value=rs:(o.value=ts,requestAnimationFrame(()=>p.value.$positionPopup()))},e.anchor)};return ps(()=>{t.surface.value==null?cs(t.surface,n):n(t.surface.value)}),{service:t,current:r,display:o,rootRef:a,handler:p}},render(){var e;return as(os,{ref:"rootRef",display:this.display,position:ss,class:is},this.$slots.hasOwnProperty("default")?this.$slots.default({vertex:this.current,model:(e=this.service.surface.value)==null?void 0:e.model,ui:this.service.surface.value,hide:()=>{var t;return(t=this.handler)==null?void 0:t.$hide()}}):[])}};import{inject as be,watch as x}from"vue";import{BackgroundPlugin as Me,GeneratedGridBackground as us,SimpleBackground as ds,TiledBackground as ms}from"@visuallyjs/browser-ui";var Xo={setup(){return{service:be(l)}},name:X,props:{options:{type:Object}},mounted:function(){let e=t=>{t.addPlugin({type:Me.type,options:this.options})};this.service.surface.value!=null&&e(this.service.surface.value),this.service.paper.value!=null?e(this.service.paper.value):(x(this.service.surface,e),x(this.service.paper,e))},render:function(e){return[]}},Zo={setup(){return{service:be(l)}},name:Z,props:{grid:{type:Object},showBorder:{type:Boolean},minWidth:{type:Number},minHeight:{type:Number},showTickMarks:{type:Boolean},tickMarksPerCell:{type:Number},maxWidth:{type:Number},maxHeight:{type:Number},autoShrink:{type:Boolean},gridType:{type:String},dotRadius:{type:Number},tickDotRadius:{type:Number},visible:{type:Boolean}},mounted:function(){let e=t=>{t.addPlugin({type:Me.type,options:{type:us.type,grid:this.grid,showBorder:this.showBorder,minWidth:this.minWidth,minHeight:this.minHeight,showTickMarks:this.showTickMarks,tickMarksPerCell:this.tickMarksPerCell,maxWidth:this.maxWidth,maxHeight:this.maxHeight,autoShrink:this.autoShrink,gridType:this.gridType,dotRadius:this.dotRadius,tickDotRadius:this.tickDotRadius,visible:this.visible}})};this.service.surface.value!=null&&e(this.service.surface.value),this.service.paper.value!=null?e(this.service.paper.value):(x(this.service.surface,e),x(this.service.paper,e))},render:function(e){return[]}},qo={setup(){return{service:be(l)}},name:q,props:{url:{type:String}},mounted:function(){let e=t=>{t.addPlugin({type:Me.type,options:{type:ds.type,url:this.url}})};this.service.surface.value!=null&&e(this.service.surface.value),this.service.paper.value!=null?e(this.service.paper.value):(x(this.service.surface,e),x(this.service.paper,e))},render:function(e){return[]}},Qo={setup(){return{service:be(l)}},name:Q,props:{url:{type:String},urlGenerator:{type:Function},tileSize:{type:Object},width:{type:Number},height:{type:Number},maxZoom:{type:Number},tiling:{type:String},panDebounceTimeout:{type:Number},zoomDebounceTimeout:{type:Number}},mounted:function(){let e=t=>{t.addPlugin({type:Me.type,options:{type:ms.type,url:this.url,urlGenerator:this.urlGenerator,tileSize:this.tileSize,width:this.width,height:this.height,tiling:this.tiling,panDebounceTimeout:this.panDebounceTimeout,zoomDebounceTimeout:this.zoomDebounceTimeout}})};this.service.surface.value!=null&&e(this.service.surface.value),this.service.paper.value!=null?e(this.service.paper.value):(x(this.service.surface,e),x(this.service.paper,e))},render:function(e){return[]}};import{h as we,inject as hs}from"vue";import{ELEMENT_DIV as ht,INSPECTOR_CONTEXT_EDGE_PROPERTY_MAPPINGS as fs,log as Ps}from"@visuallyjs/browser-ui";var ft={name:ye,props:{getPropertyName:Function,showName:{type:Boolean,default:!0},cssClass:String,mappings:Array},setup(){return{inspectorProvider:hs(v)}},data(){return{inspector:null}},mounted(){this.inspectorProvider?this.inspectorProvider.listen(e=>{this.inspector=e}):Ps("WARN: EdgePropertyMappingsInspector not instantiated inside an InspectorComponent.")},methods:{resolveMappings(){return this.mappings?this.mappings:this.inspector?this.inspector.getFromContext(fs)||this.inspector.$ui.$getEdgePropertyMappings():[]},toList(e){let t=e.property;return Array.isArray(t)?t:[t]},getPropertyKey(e){return this.toList(e).join(" ")},getName(e){return this.getPropertyName?this.getPropertyName(e):e.name||this.getPropertyKey(e)}},render(){let e=this.resolveMappings(),t=this.cssClass||"vjs-inspector-section";return we(ht,{},e.map(r=>{let o=this.getPropertyKey(r),a=this.getName(r),p=[];return this.showName!==!1&&p.push(we(ht,{},a)),p.push(we(k,{propertyName:o})),we(ht,{class:t,key:o},p)}))}};import{h as c,inject as Os}from"vue";import{isNode as er,isString as tr,EVENT_CHANGE as Pt,ELEMENT_DIV as F,log as Es}from"@visuallyjs/browser-ui";var ys=7,gs=["True","False"];function Ve(e,t){return(e.booleanLabels||gs)[t?0:1]}function D(e){return tr(e)?e:e.label}function Le(e){return tr(e)?e:e.value}function Cs(e,t,r){let o=r==null?void 0:r.getValue(e.id);return o==null&&(o=e.id.split(".").reduce((a,p)=>a==null?a:a[p],t.data)),o==null&&(o=e.defaultValue),o==null?"":typeof o=="object"?JSON.stringify(o)||"":String(o)}var Ot={name:ge,props:{vertex:Object,maxRadios:Number},setup(){return{inspectorProvider:Os(v)}},data(){return{inspector:null,inspectorRevision:0,inspectorChangeListener:null}},mounted(){this.inspectorProvider?this.inspectorProvider.listen(e=>{this.inspector&&this.inspectorChangeListener&&this.inspector.unbind(Pt,this.inspectorChangeListener),this.inspector=e,this.inspectorChangeListener=()=>this.inspectorRevision++,this.inspector.bind(Pt,this.inspectorChangeListener)}):Es("WARN: ShapePropertiesInspector not instantiated inside an InspectorComponent.")},beforeUnmount(){this.inspector&&this.inspectorChangeListener&&this.inspector.unbind(Pt,this.inspectorChangeListener)},methods:{getPropertyDisplayValue(e,t){return this.inspectorRevision,Cs(e,t,this.inspector)},resolveShapeDef(){if(this.inspector==null||this.vertex==null||!er(this.vertex))return null;let{type:e,category:t}=this.vertex.data;if(!e||!t)return null;let o=this.inspector.$ui.getShapeLibrary().getShapeSet(t);return o?o.shapes.find(a=>a.type===e):null}},render(){let e=this.vertex;if(!e||!er(e))return null;let t=this.resolveShapeDef();if(!t||!t.properties)return null;let r=this.maxRadios==null?ys:this.maxRadios;return t.properties.map(o=>{let a=o.type==="boolean",p=o.values&&o.values.length>0,n=p&&o.editor!=="select"&&o.values.length<=r,i=[];return(o.readOnly||!a||o.editor==="select"||o.editor==="radio")&&i.push(c("label",{class:"vjs-inspector-property-label"},o.label||o.id)),o.readOnly?i.push(c("output",{class:"vjs-inspector-property-value"},this.getPropertyDisplayValue(o,e))):o.type==="string"?p?n?i.push(c(F,{class:"vjs-radio-group"},o.values.map(s=>c("label",{key:D(s)},[c("input",{type:"radio",name:o.id,"vjs-att":o.id,value:Le(s)})," "+D(s)])))):i.push(c("select",{"vjs-att":o.id},o.values.map(s=>c("option",{key:D(s),value:Le(s)},D(s))))):i.push(c("input",{type:"text","vjs-att":o.id,placeholder:o.description})):o.type==="text"?i.push(c("textarea",{rows:5,"vjs-att":o.id,placeholder:o.description})):o.type==="color"?i.push(c(xe,{propertyName:o.id})):o.type==="number"?p?n?i.push(c(F,{class:"vjs-radio-group"},o.values.map(s=>c("label",{key:D(s)},[c("input",{type:"radio",name:o.id,"vjs-att":o.id,value:Le(s)})," "+D(s)])))):i.push(c("select",{"vjs-att":o.id},o.values.map(s=>c("option",{key:D(s),value:Le(s)},D(s))))):i.push(c("input",{type:"number","vjs-att":o.id,placeholder:o.description,min:o.min,max:o.max})):a?o.editor==="select"?i.push(c("select",{"vjs-att":o.id,"vjs-datatype":"boolean"},[c("option",{value:""}),c("option",{value:"true"},Ve(o,!0)),c("option",{value:"false"},Ve(o,!1))])):o.editor==="radio"?i.push(c(F,{class:"vjs-radio-group"},[c("label",[c("input",{type:"radio",name:o.id,"vjs-att":o.id,"vjs-datatype":"boolean",value:"true"}),c("span",Ve(o,!0))]),c("label",[c("input",{type:"radio",name:o.id,"vjs-att":o.id,"vjs-datatype":"boolean",value:"false"}),c("span",Ve(o,!1))])])):i.push(c("label",[c("input",{type:"checkbox","vjs-datatype":"boolean","vjs-att":o.id})," "+(o.label||o.id)])):i.push(c("input",{type:"text","vjs-att":o.id,placeholder:o.description})),o.description&&i.push(c(F,{class:"vjs-field-desc"},o.description)),c(F,{key:o.id,class:"vjs-inspector-field"},i)})}};var Pm={install:function(e,t){e.component(no,ot),e.component(io,rt),e.component(so,ut),e.component(te,So),e.component(oe,No),e.component(se,jo),e.component(ee,Go),e.component(ne,Vo),e.component(ie,Bo),e.component(X,Xo),e.component(Z,Zo),e.component(q,qo),e.component(Q,Qo),e.component(re,$o),e.component(ae,dt),e.component(pe,Ke),e.component(le,ze),e.component(ce,Je),e.component(ue,Xe),e.component(de,Ze),e.component(me,Ye),e.component(Oe,tt),e.component(Pe,et),e.component(fe,Qe),e.component(he,qe),e.component(K,it),e.component(J,st),e.component(Y,k),e.component(eo,xe),e.component(Ee,at),e.component(ye,ft),e.component(ge,Ot),e.component(lo,ct),e.component(ao,mt),e.provide(l,new _("root"))}};import{shallowRef as Et,ref as Ts}from"vue";import{EVENT_ZOOM as yt}from"@visuallyjs/browser-ui";import{inject as _s}from"vue";function Sm(){let e=_s(l),t=Et(null),r=Et(null),o=Et(null),a=Ts(1);return e==null||e.getSurface(p=>{r.value=p,r.value.bind(yt,n=>{a.value=n.zoom})}),e==null||e.getDiagram(p=>{t.value=p,t.value.$ui.bind(yt,n=>{a.value=n.zoom})}),e==null||e.getPaper(p=>{o.value=p,o.value.bind(yt,n=>{a.value=n.zoom})}),a}import{inject as Ss,onUnmounted as vs}from"vue";import{EVENT_DATA_UPDATED as or,EVENT_GRAPH_CLEARED as rr}from"@visuallyjs/browser-ui";function wm(e){let t=Ss(l);if(t){let r=null,o=()=>{r&&e(r)},a=()=>{r&&(r.unbind(or,o),r.unbind(rr,o))},p=n=>{a(),r=n,r&&(r.bind(or,o),r.bind(rr,o),o())};t.getModel(n=>{p(n)}),vs(()=>{a()})}}import{shallowRef as Rs}from"vue";import{inject as Ns}from"vue";function jm(){let e=Ns(l),t=Rs(null);return e==null||e.getSurface(r=>{t.value=r}),t}import{shallowRef as As}from"vue";import{inject as xs}from"vue";function zm(){let e=xs(l),t=As(null);return e==null||e.getDiagram(r=>{t.value=r}),t}import{shallowRef as Ds}from"vue";import{inject as Is}from"vue";function qm(){let e=Is(l),t=Ds(null);return e==null||e.getPaper(r=>{t.value=r}),t}export{ve as $initialiseVueOverlays,Ze as AreaChartComponent,Xo as BackgroundComponent,Ke as BarChartComponent,Eo as BaseOverlayComponent,y as BrowserUIVueModel,Qe as BubbleChartComponent,oo as CLASS_VUE_GROUP,to as CLASS_VUE_NODE,ro as CLASS_VUE_OVERLAY,de as COMPONENT_AREA_CHART,X as COMPONENT_BACKGROUND,pe as COMPONENT_BAR_CHART,fe as COMPONENT_BUBBLE_CHART,le as COMPONENT_COLUMN_CHART,ne as COMPONENT_CONTROLS,se as COMPONENT_DIAGRAM,ae as COMPONENT_DIAGRAM_PALETTE,so as COMPONENT_DIAGRAM_PROVIDER,ye as COMPONENT_EDGE_PROPERTY_MAPPINGS_INSPECTOR,ie as COMPONENT_EXPORT_CONTROLS,Pe as COMPONENT_GAUGE_CHART,Z as COMPONENT_GRID_BACKGROUND,q as COMPONENT_IMAGE_BACKGROUND,Ee as COMPONENT_INSPECTOR,ue as COMPONENT_LINE_CHART,ee as COMPONENT_MINIVIEW,re as COMPONENT_PALETTE,oe as COMPONENT_PAPER,io as COMPONENT_PAPER_PROVIDER,me as COMPONENT_PIE_CHART,Oe as COMPONENT_SANKEY_CHART,he as COMPONENT_SCATTER_CHART,ge as COMPONENT_SHAPE_PROPERTIES_INSPECTOR,te as COMPONENT_SURFACE,ao as COMPONENT_SURFACE_POPUP,no as COMPONENT_SURFACE_PROVIDER,Q as COMPONENT_TILED_IMAGE_BACKGROUND,ce as COMPONENT_XY_CHART,xe as ColorPickerComponent,ze as ColumnChartComponent,Vo as ControlsComponent,Qt as DEFAULT_SHAPE_HEIGHT,qt as DEFAULT_SHAPE_WIDTH,_t as DEFAULT_VUE_PAPER_ID,Tt as DEFAULT_VUE_SURFACE_ID,ct as DecoratorComponent,jo as DiagramComponent,dt as DiagramPaletteComponent,ut as DiagramProvider,Nr as EVENT_VERTEX_UPDATED,ke as EVENT_VERTICES_RENDERED,ft as EdgePropertyMappingsInspectorComponent,k as EdgeTypePickerComponent,Bo as ExportControlsComponent,et as GaugeChartComponent,Zo as GridBackgroundComponent,qo as ImageBackgroundComponent,at as InspectorComponent,v as InspectorGetterSymbol,wi as InspectorSetterSymbol,Xe as LineChartComponent,Go as MiniviewComponent,Nt as PROP_ACTIVE_TRACKING,zt as PROP_ALLOW_CLICK_TO_ADD,Gt as PROP_ALLOW_DROP_ON_CANVAS,Ut as PROP_ALLOW_DROP_ON_EDGE,jt as PROP_ALLOW_DROP_ON_GROUP,kt as PROP_ALLOW_DROP_ON_NODE,Kt as PROP_ALLOW_ROTATION,Yt as PROP_AUTO_EDGE_CONNECT,Zt as PROP_CANVAS_DROP_FILTER,V as PROP_CLASS_NAME,Wt as PROP_CLICK_TO_ADD_ONLY,vt as PROP_CLICK_TO_CENTER,Ue as PROP_CSV_DATA,g as PROP_DATA,Vt as PROP_DATA_GENERATOR,Be as PROP_DATA_SOURCE_FILTER,z as PROP_DATA_TYPE,Xt as PROP_DRAG_SIZE,Bt as PROP_GROUP_IDENTIFIER,fa as PROP_ID,Ft as PROP_IGNORE_DROP_ON_NODE,It as PROP_INTERACTIVE,Ge as PROP_JSON_DATA,Dt as PROP_MODE,$ as PROP_MODEL,L as PROP_MODEL_OPTIONS,Ht as PROP_ON_VERTEX_ADDED,M as PROP_OPTIONS,xt as PROP_PAPER_ID,bt as PROP_PIVOT,H as PROP_RENDER_OPTIONS,Jt as PROP_ROTATION_SPEED,wt as PROP_SELECTOR,$t as PROP_SELECT_AFTER_ADD,Rt as PROP_SHOW_LASSO,N as PROP_SURFACE_ID,At as PROP_TRACK_SELECTION,St as PROP_TYPE_FUNCTION,Lt as PROP_TYPE_GENERATOR,E as PROP_URL,Mt as PROP_USE_MODEL,W as PROP_VIEW_OPTIONS,$o as PaletteComponent,No as PaperComponent,rt as PaperProvider,Ye as PieChartComponent,tt as SankeyChartComponent,qe as ScatterChartComponent,it as ShapeComponent,st as ShapePaletteComponent,Ot as ShapePropertiesInspectorComponent,So as SurfaceComponent,mt as SurfacePopup,ot as SurfaceProvider,eo as TAG_COLOR_PICKER,lo as TAG_DECORATOR,Y as TAG_EDGE_TYPE_PICKER,K as TAG_SHAPE,J as TAG_SHAPE_PALETTE,Qo as TiledImageBackgroundComponent,Pm as VisuallyJsPlugin,_ as VisuallyJsService,l as VisuallyJsServiceKey,Je as XYChartComponent,go as addPaper,yo as addSurface,qa as bindToDevLifecycle,Vi as doProvideInspector,Bs as newInstance,zm as useDiagram,qm as usePaper,jm as useSurface,wm as useVisuallyJsUpdate,Sm as useZoom,co as vertexHasRendered,uo as vertexHasUpdated,Ar as vertexWillRender};