Closes #701: Option to always show cable/interface labels on edges (#707)

* Added draw termination labels
This commit is contained in:
Mario authored and GitHub committed 2026-03-10 09:34:45 +01:00
1 parent e20f250425
commit 9d4ef31bdd
10 files changed
+127 -17

No files matched your search

+1 -1
View File
@@ -50,4 +50,4 @@ class PowerFeedCoordinateSerializer(NetBoxModelSerializer):
class IndividualOptionsSerializer(NetBoxModelSerializer):
class Meta:
model = IndividualOptions
fields = ("ignore_cable_type", "save_coords", "show_unconnected", "show_cables", "show_logical_connections", "show_single_cable_logical_conns", "show_neighbors", "show_circuit", "show_power", "show_wireless", "group_sites", "group_locations", "group_racks", "group_virtualchassis", "draw_default_layout", "straight_cables", "grid_size", "node_label_items")
fields = ("ignore_cable_type", "save_coords", "show_unconnected", "show_cables", "show_logical_connections", "show_single_cable_logical_conns", "show_neighbors", "show_circuit", "show_power", "show_wireless", "group_sites", "group_locations", "group_racks", "group_virtualchassis", "draw_default_layout", "straight_cables", "draw_termination_labels", "grid_size", "node_label_items")
+4 -2
View File
@@ -114,7 +114,7 @@ class ExportTopoToXML(BaseViewSet, ViewSet):
if request.GET:
filter_id, ignore_cable_type, save_coords, show_unconnected, show_power, show_circuit, show_logical_connections, show_single_cable_logical_conns, show_cables, show_wireless, group_sites, group_locations, group_racks, group_virtualchassis, group, show_neighbors, straight_cables, grid_size, node_label_items = get_query_settings(request)
filter_id, ignore_cable_type, save_coords, show_unconnected, show_power, show_circuit, show_logical_connections, show_single_cable_logical_conns, show_cables, show_wireless, group_sites, group_locations, group_racks, group_virtualchassis, group, show_neighbors, straight_cables, draw_termination_labels, grid_size, node_label_items = get_query_settings(request)
# Read options from saved filters as NetBox does not handle custom plugin filters
if "filter_id" in request.GET and request.GET["filter_id"] != '':
@@ -136,7 +136,8 @@ class ExportTopoToXML(BaseViewSet, ViewSet):
if group_racks == False and 'group_racks' in saved_filter_params: group_racks = saved_filter_params['group_racks']
if group_virtualchassis == False and 'group_virtualchassis' in saved_filter_params: group_virtualchassis = saved_filter_params['group_virtualchassis']
if show_neighbors == False and 'show_neighbors' in saved_filter_params: show_neighbors = saved_filter_params['show_neighbors']
if straight_cables == False and 'straight_cables' in saved_filter_params: show_neighbors = saved_filter_params['straight_cables']
if straight_cables == False and 'straight_cables' in saved_filter_params: straight_cables = saved_filter_params['straight_cables']
if draw_termination_labels == False and 'draw_termination_labels' in saved_filter_params: draw_termination_labels = saved_filter_params['draw_termination_labels']
if grid_size == 0 and 'grid_size' in saved_filter_params: grid_size = saved_filter_params['grid_size']
if node_label_items == () and 'node_label_items' in saved_filter_params: node_label_items = saved_filter_params['node_label_items']
except SavedFilter.DoesNotExist: # filter_id not found
@@ -170,6 +171,7 @@ class ExportTopoToXML(BaseViewSet, ViewSet):
group_virtualchassis=group_virtualchassis,
group_id=group_id,
straight_cables=straight_cables,
draw_termination_labels=draw_termination_labels,
grid_size=grid_size,
node_label_items=node_label_items,
)
+16 -2
View File
@@ -37,7 +37,7 @@ class DeviceFilterForm(
FieldSet(
'group', 'ignore_cable_type', 'save_coords', 'show_unconnected', 'show_cables', 'show_wireless',
'show_logical_connections', 'show_single_cable_logical_conns', 'show_neighbors',
'group_sites', 'group_locations', 'group_racks', 'group_virtualchassis', 'straight_cables', 'grid_size', 'node_label_items', name=_("Options")
'group_sites', 'group_locations', 'group_racks', 'group_virtualchassis', 'straight_cables', 'draw_termination_labels', 'grid_size', 'node_label_items', name=_("Options")
),
FieldSet(
'show_circuit', 'show_power', name=_("Additional filter-independent types (non-devices)")
@@ -318,6 +318,12 @@ class DeviceFilterForm(
choices=BOOLEAN_WITH_BLANK_CHOICES
)
)
draw_termination_labels = forms.BooleanField(
label=_('Termination Labels'), required=False, initial=False,
widget=forms.Select(
choices=BOOLEAN_WITH_BLANK_CHOICES
)
)
grid_size = forms.IntegerField(
label=_('Grid Size'),
required=False,
@@ -538,6 +544,7 @@ class IndividualOptionsForm(NetBoxModelForm):
'group_virtualchassis',
'draw_default_layout',
'straight_cables',
'draw_termination_labels',
'grid_size',
'node_label_items',
),
@@ -672,6 +679,13 @@ class IndividualOptionsForm(NetBoxModelForm):
help_text=_('Enable this option if you want to draw cables as straight lines '
'instead of curves.')
)
draw_termination_labels = forms.BooleanField(
label=('Termination Labels'),
required=False,
initial=False,
help_text=_('Enable this option if you want to draw a label on each '
'cable end.')
)
grid_size = forms.IntegerField(
label=_('Grid Size'),
required=True,
@@ -713,6 +727,6 @@ class IndividualOptionsForm(NetBoxModelForm):
'save_coords', 'show_unconnected', 'show_cables', 'show_wireless',
'show_logical_connections', 'show_single_cable_logical_conns', 'show_neighbors',
'group_sites', 'group_locations', 'group_racks', 'group_virtualchassis',
'draw_default_layout', 'straight_cables', 'grid_size', 'node_label_items',
'draw_default_layout', 'straight_cables', 'draw_termination_labels', 'grid_size', 'node_label_items',
'show_circuit', 'show_power'
]
@@ -0,0 +1,18 @@
# Generated by Django 5.2.9 on 2026-02-19 18:50
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('netbox_topology_views', '0011_individualoptions_node_label_items'),
]
operations = [
migrations.AddField(
model_name='individualoptions',
name='draw_termination_labels',
field=models.BooleanField(default=False),
),
]
+3
View File
@@ -405,6 +405,9 @@ class IndividualOptions(NetBoxModel):
straight_cables = models.BooleanField(
default=False
)
draw_termination_labels = models.BooleanField(
default=False
)
grid_size = models.PositiveSmallIntegerField(
default=0
)
@@ -1,8 +1,8 @@
(()=>{var Tn=Object.create;var ci=Object.defineProperty,Cn=Object.defineProperties,kn=Object.getOwnPropertyDescriptor,On=Object.getOwnPropertyDescriptors,Sn=Object.getOwnPropertyNames,Vs=Object.getOwnPropertySymbols,In=Object.getPrototypeOf,qs=Object.prototype.hasOwnProperty,Pn=Object.prototype.propertyIsEnumerable;var li=(r,e,t)=>e in r?ci(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,be=(r,e)=>{for(var t in e||(e={}))qs.call(e,t)&&li(r,t,e[t]);if(Vs)for(var t of Vs(e))Pn.call(e,t)&&li(r,t,e[t]);return r},je=(r,e)=>Cn(r,On(e));var Mn=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports);var Dn=(r,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Sn(e))!qs.call(r,o)&&o!==t&&ci(r,o,{get:()=>e[o],enumerable:!(s=kn(e,o))||s.enumerable});return r};var Ys=(r,e,t)=>(t=r!=null?Tn(In(r)):{},Dn(e||!r||!r.__esModule?ci(t,"default",{value:r,enumerable:!0}):t,r));var se=(r,e,t)=>li(r,typeof e!="symbol"?e+"":e,t);var Us=(r,e,t)=>new Promise((s,o)=>{var n=h=>{try{d(t.next(h))}catch(l){o(l)}},a=h=>{try{d(t.throw(h))}catch(l){o(l)}},d=h=>h.done?s(h.value):Promise.resolve(h.value).then(n,a);d((t=t.apply(r,e)).next())});var fi=Mn((ja,ui)=>{typeof ui!="undefined"&&(ui.exports=ce);function ce(r){if(r)return Nn(r)}function Nn(r){for(var e in ce.prototype)r[e]=ce.prototype[e];return r}ce.prototype.on=ce.prototype.addEventListener=function(r,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+r]=this._callbacks["$"+r]||[]).push(e),this};ce.prototype.once=function(r,e){function t(){this.off(r,t),e.apply(this,arguments)}return t.fn=e,this.on(r,t),this};ce.prototype.off=ce.prototype.removeListener=ce.prototype.removeAllListeners=ce.prototype.removeEventListener=function(r,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var t=this._callbacks["$"+r];if(!t)return this;if(arguments.length==1)return delete this._callbacks["$"+r],this;for(var s,o=0;o<t.length;o++)if(s=t[o],s===e||s.fn===e){t.splice(o,1);break}return t.length===0&&delete this._callbacks["$"+r],this};ce.prototype.emit=function(r){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),t=this._callbacks["$"+r],s=1;s<arguments.length;s++)e[s-1]=arguments[s];if(t){t=t.slice(0);for(var s=0,o=t.length;s<o;++s)t[s].apply(this,e)}return this};ce.prototype.listeners=function(r){return this._callbacks=this._callbacks||{},this._callbacks["$"+r]||[]};ce.prototype.hasListeners=function(r){return!!this.listeners(r).length}});var Do=Ys(fi());function ve(){return ve=Object.assign||function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(r[s]=t[s])}return r},ve.apply(this,arguments)}function me(r,e){r.prototype=Object.create(e.prototype),r.prototype.constructor=r,r.__proto__=e}function Pt(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}var pi;typeof Object.assign!="function"?pi=function(e){if(e==null)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),s=1;s<arguments.length;s++){var o=arguments[s];if(o!=null)for(var n in o)o.hasOwnProperty(n)&&(t[n]=o[n])}return t}:pi=Object.assign;var Ye=pi,Xs=["","webkit","Moz","MS","ms","o"],Fn=typeof document=="undefined"?{style:{}}:document.createElement("div"),Bn="function",Je=Math.round,Ue=Math.abs,bi=Date.now;function zt(r,e){for(var t,s,o=e[0].toUpperCase()+e.slice(1),n=0;n<Xs.length;){if(t=Xs[n],s=t?t+o:e,s in r)return s;n++}}var ke;typeof window=="undefined"?ke={}:ke=window;var oo=zt(Fn.style,"touchAction"),no=oo!==void 0;function An(){if(!no)return!1;var r={},e=ke.CSS&&ke.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(t){return r[t]=e?ke.CSS.supports("touch-action",t):!0}),r}var ro="compute",ao="auto",gi="manipulation",Ve="none",ct="pan-x",ut="pan-y",Mt=An(),zn=/mobile|tablet|ip(ad|hone|od)|android/i,ho="ontouchstart"in ke,Rn=zt(ke,"PointerEvent")!==void 0,Ln=ho&&zn.test(navigator.userAgent),mt="touch",Hn="pen",vi="mouse",jn="kinect",Wn=25,oe=1,Ge=2,Q=4,de=8,Ft=1,yt=2,bt=4,vt=8,tt=16,Ee=yt|bt,qe=vt|tt,lo=Ee|qe,co=["x","y"],Bt=["clientX","clientY"];function Oe(r,e,t){var s;if(r)if(r.forEach)r.forEach(e,t);else if(r.length!==void 0)for(s=0;s<r.length;)e.call(t,r[s],s,r),s++;else for(s in r)r.hasOwnProperty(s)&&e.call(t,r[s],s,r)}function Rt(r,e){return typeof r===Bn?r.apply(e&&e[0]||void 0,e):r}function We(r,e){return r.indexOf(e)>-1}function Vn(r){if(We(r,Ve))return Ve;var e=We(r,ct),t=We(r,ut);return e&&t?Ve:e||t?e?ct:ut:We(r,gi)?gi:ao}var uo=function(){function r(t,s){this.manager=t,this.set(s)}var e=r.prototype;return e.set=function(s){s===ro&&(s=this.compute()),no&&this.manager.element.style&&Mt[s]&&(this.manager.element.style[oo]=s),this.actions=s.toLowerCase().trim()},e.update=function(){this.set(this.manager.options.touchAction)},e.compute=function(){var s=[];return Oe(this.manager.recognizers,function(o){RtLine truncated
(()=>{var Cn=Object.create;var ci=Object.defineProperty,kn=Object.defineProperties,On=Object.getOwnPropertyDescriptor,Sn=Object.getOwnPropertyDescriptors,In=Object.getOwnPropertyNames,Vs=Object.getOwnPropertySymbols,Pn=Object.getPrototypeOf,qs=Object.prototype.hasOwnProperty,Mn=Object.prototype.propertyIsEnumerable;var li=(r,e,t)=>e in r?ci(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,ge=(r,e)=>{for(var t in e||(e={}))qs.call(e,t)&&li(r,t,e[t]);if(Vs)for(var t of Vs(e))Mn.call(e,t)&&li(r,t,e[t]);return r},je=(r,e)=>kn(r,Sn(e));var Dn=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports);var Nn=(r,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of In(e))!qs.call(r,o)&&o!==t&&ci(r,o,{get:()=>e[o],enumerable:!(s=On(e,o))||s.enumerable});return r};var Ys=(r,e,t)=>(t=r!=null?Cn(Pn(r)):{},Nn(e||!r||!r.__esModule?ci(t,"default",{value:r,enumerable:!0}):t,r));var se=(r,e,t)=>li(r,typeof e!="symbol"?e+"":e,t);var Xs=(r,e,t)=>new Promise((s,o)=>{var n=h=>{try{d(t.next(h))}catch(l){o(l)}},a=h=>{try{d(t.throw(h))}catch(l){o(l)}},d=h=>h.done?s(h.value):Promise.resolve(h.value).then(n,a);d((t=t.apply(r,e)).next())});var fi=Dn((Wa,ui)=>{typeof ui!="undefined"&&(ui.exports=ce);function ce(r){if(r)return Fn(r)}function Fn(r){for(var e in ce.prototype)r[e]=ce.prototype[e];return r}ce.prototype.on=ce.prototype.addEventListener=function(r,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+r]=this._callbacks["$"+r]||[]).push(e),this};ce.prototype.once=function(r,e){function t(){this.off(r,t),e.apply(this,arguments)}return t.fn=e,this.on(r,t),this};ce.prototype.off=ce.prototype.removeListener=ce.prototype.removeAllListeners=ce.prototype.removeEventListener=function(r,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var t=this._callbacks["$"+r];if(!t)return this;if(arguments.length==1)return delete this._callbacks["$"+r],this;for(var s,o=0;o<t.length;o++)if(s=t[o],s===e||s.fn===e){t.splice(o,1);break}return t.length===0&&delete this._callbacks["$"+r],this};ce.prototype.emit=function(r){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),t=this._callbacks["$"+r],s=1;s<arguments.length;s++)e[s-1]=arguments[s];if(t){t=t.slice(0);for(var s=0,o=t.length;s<o;++s)t[s].apply(this,e)}return this};ce.prototype.listeners=function(r){return this._callbacks=this._callbacks||{},this._callbacks["$"+r]||[]};ce.prototype.hasListeners=function(r){return!!this.listeners(r).length}});var Do=Ys(fi());function ve(){return ve=Object.assign||function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(r[s]=t[s])}return r},ve.apply(this,arguments)}function ye(r,e){r.prototype=Object.create(e.prototype),r.prototype.constructor=r,r.__proto__=e}function Pt(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}var pi;typeof Object.assign!="function"?pi=function(e){if(e==null)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),s=1;s<arguments.length;s++){var o=arguments[s];if(o!=null)for(var n in o)o.hasOwnProperty(n)&&(t[n]=o[n])}return t}:pi=Object.assign;var Ye=pi,Us=["","webkit","Moz","MS","ms","o"],Bn=typeof document=="undefined"?{style:{}}:document.createElement("div"),An="function",Je=Math.round,Xe=Math.abs,bi=Date.now;function zt(r,e){for(var t,s,o=e[0].toUpperCase()+e.slice(1),n=0;n<Us.length;){if(t=Us[n],s=t?t+o:e,s in r)return s;n++}}var ke;typeof window=="undefined"?ke={}:ke=window;var oo=zt(Bn.style,"touchAction"),no=oo!==void 0;function zn(){if(!no)return!1;var r={},e=ke.CSS&&ke.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(t){return r[t]=e?ke.CSS.supports("touch-action",t):!0}),r}var ro="compute",ao="auto",gi="manipulation",Ve="none",ct="pan-x",ut="pan-y",Mt=zn(),Rn=/mobile|tablet|ip(ad|hone|od)|android/i,ho="ontouchstart"in ke,Ln=zt(ke,"PointerEvent")!==void 0,Hn=ho&&Rn.test(navigator.userAgent),mt="touch",jn="pen",vi="mouse",Wn="kinect",Vn=25,oe=1,Ge=2,Q=4,de=8,Ft=1,yt=2,bt=4,vt=8,tt=16,Ee=yt|bt,qe=vt|tt,lo=Ee|qe,co=["x","y"],Bt=["clientX","clientY"];function Oe(r,e,t){var s;if(r)if(r.forEach)r.forEach(e,t);else if(r.length!==void 0)for(s=0;s<r.length;)e.call(t,r[s],s,r),s++;else for(s in r)r.hasOwnProperty(s)&&e.call(t,r[s],s,r)}function Rt(r,e){return typeof r===An?r.apply(e&&e[0]||void 0,e):r}function We(r,e){return r.indexOf(e)>-1}function qn(r){if(We(r,Ve))return Ve;var e=We(r,ct),t=We(r,ut);return e&&t?Ve:e||t?e?ct:ut:We(r,gi)?gi:ao}var uo=function(){function r(t,s){this.manager=t,this.set(s)}var e=r.prototype;return e.set=function(s){s===ro&&(s=this.compute()),no&&this.manager.element.style&&Mt[s]&&(this.manager.element.style[oo]=s),this.actions=s.toLowerCase().trim()},e.update=function(){this.set(this.manager.options.touchAction)},e.compute=function(){var s=[];return Oe(this.manager.recognizers,function(o){RtLine truncated
`+t+` AT
`;return function(){var o=new Error("get-stack-trace"),n=o&&o.stack?o.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",a=window.console&&(window.console.warn||window.console.log);return a&&a.call(window.console,s,n),r.apply(this,arguments)}}var Oo=ko(function(r,e,t){for(var s=Object.keys(e),o=0;o<s.length;)(!t||t&&r[s[o]]===void 0)&&(r[s[o]]=e[s[o]]),o++;return r},"extend","Use `assign`."),yr=ko(function(r,e){return Oo(r,e,!0)},"merge","Use `assign`.");function br(r,e,t){var s=e.prototype,o;o=r.prototype=Object.create(s),o.constructor=r,o._super=s,t&&Ye(o,t)}function so(r,e){return function(){return r.apply(e,arguments)}}var So=function(){var r=function(t,s){return s===void 0&&(s={}),new io(t,ve({recognizers:Js.concat()},s))};return r.VERSION="2.0.17-rc",r.DIRECTION_ALL=lo,r.DIRECTION_DOWN=tt,r.DIRECTION_LEFT=yt,r.DIRECTION_RIGHT=bt,r.DIRECTION_UP=vt,r.DIRECTION_HORIZONTAL=Ee,r.DIRECTION_VERTICAL=qe,r.DIRECTION_NONE=Ft,r.DIRECTION_DOWN=tt,r.INPUT_START=oe,r.INPUT_MOVE=Ge,r.INPUT_END=Q,r.INPUT_CANCEL=de,r.STATE_POSSIBLE=Nt,r.STATE_BEGAN=ge,r.STATE_CHANGED=it,r.STATE_ENDED=Be,r.STATE_RECOGNIZED=Se,r.STATE_CANCELLED=gt,r.STATE_FAILED=_e,r.Manager=io,r.Input=ot,r.TouchAction=uo,r.TouchInput=Ei,r.MouseInput=xi,r.PointerEventInput=bo,r.TouchMouseInput=vo,r.SingleTouchInput=gr,r.Recognizer=wt,r.AttrRecognizer=st,r.Tap=yi,r.Pan=Ti,r.Swipe=_o,r.Pinch=Eo,r.Rotate=xo,r.Press=To,r.on=ht,r.off=lt,r.each=Oe,r.merge=yr,r.extend=Oo,r.bindFn=so,r.assign=Ye,r.inherit=br,r.bindFn=so,r.prefixed=zt,r.toArray=pt,r.inArray=Xe,r.uniqueArray=_i,r.splitStr=ft,r.boolOrFn=Rt,r.hasParent=wi,r.addEventListeners=ht,r.removeEventListeners=lt,r.defaults=Ye({},Co,{preset:Js}),r}(),Wa=So.defaults,Io=So;var Oi=Symbol("DELETE");function No(r,...e){return Fo({},r,...e)}function Fo(...r){let e=Ht(...r);return Ao(e),e}function Ht(...r){if(r.length<2)return r[0];if(r.length>2)return Ht(Fo(r[0],r[1]),...r.slice(2));let e=r[0],t=r[1];if(e instanceof Date&&t instanceof Date)return e.setTime(t.getTime()),e;for(let s of Reflect.ownKeys(t))Object.prototype.propertyIsEnumerable.call(t,s)&&(t[s]===Oi?delete e[s]:e[s]!==null&&t[s]!==null&&typeof e[s]=="object"&&typeof t[s]=="object"&&!Array.isArray(e[s])&&!Array.isArray(t[s])?e[s]=Ht(e[s],t[s]):e[s]=Bo(t[s]));return e}function Bo(r){return Array.isArray(r)?r.map(e=>Bo(e)):typeof r=="object"&&r!==null?r instanceof Date?new Date(r.getTime()):Ht({},r):r}function Ao(r){for(let e of Object.keys(r))r[e]===Oi?delete r[e]:typeof r[e]=="object"&&r[e]!==null&&Ao(r[e])}function xt(...r){return vr(r.length?r:[Date.now()])}function vr(r){let[e,t,s]=wr(r),o=1,n=()=>{let a=2091639*e+o*23283064365386963e-26;return e=t,t=s,s=a-(o=a|0)};return n.uint32=()=>n()*4294967296,n.fract53=()=>n()+(n()*2097152|0)*11102230246251565e-32,n.algorithm="Alea",n.seed=r,n.version="0.9",n}function wr(...r){let e=_r(),t=e(" "),s=e(" "),o=e(" ");for(let n=0;n<r.length;n++)t-=e(r[n]),t<0&&(t+=1),s-=e(r[n]),s<0&&(s+=1),o-=e(r[n]),o<0&&(o+=1);return[t,s,o]}function _r(){let r=4022871197;return function(e){let t=e.toString();for(let s=0;s<t.length;s++){r+=t.charCodeAt(s);let o=.02519603282416938*r;r=o>>>0,o-=r,o*=r,r=o>>>0,o-=r,r+=o*4294967296}return(r>>>0)*23283064365386963e-26}}function Er(){let r=()=>{};return{on:r,off:r,destroy:r,emit:r,get(){return{set:r}}}}var Si=typeof window!="undefined"?window.Hammer||Io:function(){return Er()};function xe(r){this._cleanupQueue=[],this.active=!1,this._dom={container:r,overlay:document.createElement("div")},this._dom.overlay.classList.add("vis-overlay"),this._dom.container.appendChild(this._dom.overlay),this._cleanupQueue.push(()=>{this._dom.overlay.parentNode.removeChild(this._dom.overlay)});let e=Si(this._dom.overlay);e.on("tap",this._onTapOverlay.bind(this)),this._cleanupQueue.push(()=>{e.destroy()}),["tap","doubletap","press","pinch","pan","panstart","panmove","panend"].forEach(s=>{e.on(s,o=>{o.srcEvent.stopPropagation()})}),document&&document.body&&(this._onClick=s=>{xr(s.target,r)||this.deactivate()},document.body.addEventListener("click",this._onClick),this._cleanupQueue.push(()=>{document.body.removeEventListener("click",this._onClick)})),this._escListener=s=>{("key"in s?s.key==="Escape":s.keyCode===27)&&this.deactivate()}}(0,Do.default)(xe.prototype);xe.current=null;xe.prototype.destroy=function(){this.deactivate();for(let r of this._cleanupQueue.splice(0).reverse())r()};xe.prototype.activate=function(){xe.current&&xe.current.deactivate(),xe.current=this,this.active=!0,this._dom.overlay.style.display="none",this._dom.container.classList.add("vis-active"),this.emit("change"),this.emit("activate"),document.body.addEventListener("keydown",this._escListener)};xe.prototype.deactivate=function(){this.active=!1,this._dom.overlay.style.display="block",this._dom.container.classList.remove("vis-active"),document.body.removeEventListener("keydown",this._escListener),this.emit("change"),this.emit("deactivate")};xe.proto Line truncated
`;return function(){var o=new Error("get-stack-trace"),n=o&&o.stack?o.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",a=window.console&&(window.console.warn||window.console.log);return a&&a.call(window.console,s,n),r.apply(this,arguments)}}var Oo=ko(function(r,e,t){for(var s=Object.keys(e),o=0;o<s.length;)(!t||t&&r[s[o]]===void 0)&&(r[s[o]]=e[s[o]]),o++;return r},"extend","Use `assign`."),br=ko(function(r,e){return Oo(r,e,!0)},"merge","Use `assign`.");function vr(r,e,t){var s=e.prototype,o;o=r.prototype=Object.create(s),o.constructor=r,o._super=s,t&&Ye(o,t)}function so(r,e){return function(){return r.apply(e,arguments)}}var So=function(){var r=function(t,s){return s===void 0&&(s={}),new io(t,ve({recognizers:Js.concat()},s))};return r.VERSION="2.0.17-rc",r.DIRECTION_ALL=lo,r.DIRECTION_DOWN=tt,r.DIRECTION_LEFT=yt,r.DIRECTION_RIGHT=bt,r.DIRECTION_UP=vt,r.DIRECTION_HORIZONTAL=Ee,r.DIRECTION_VERTICAL=qe,r.DIRECTION_NONE=Ft,r.DIRECTION_DOWN=tt,r.INPUT_START=oe,r.INPUT_MOVE=Ge,r.INPUT_END=Q,r.INPUT_CANCEL=de,r.STATE_POSSIBLE=Nt,r.STATE_BEGAN=me,r.STATE_CHANGED=it,r.STATE_ENDED=Be,r.STATE_RECOGNIZED=Se,r.STATE_CANCELLED=gt,r.STATE_FAILED=_e,r.Manager=io,r.Input=ot,r.TouchAction=uo,r.TouchInput=Ei,r.MouseInput=xi,r.PointerEventInput=bo,r.TouchMouseInput=vo,r.SingleTouchInput=mr,r.Recognizer=wt,r.AttrRecognizer=st,r.Tap=yi,r.Pan=Ti,r.Swipe=_o,r.Pinch=Eo,r.Rotate=xo,r.Press=To,r.on=ht,r.off=lt,r.each=Oe,r.merge=br,r.extend=Oo,r.bindFn=so,r.assign=Ye,r.inherit=vr,r.bindFn=so,r.prefixed=zt,r.toArray=pt,r.inArray=Ue,r.uniqueArray=_i,r.splitStr=ft,r.boolOrFn=Rt,r.hasParent=wi,r.addEventListeners=ht,r.removeEventListeners=lt,r.defaults=Ye({},Co,{preset:Js}),r}(),Va=So.defaults,Io=So;var Oi=Symbol("DELETE");function No(r,...e){return Fo({},r,...e)}function Fo(...r){let e=Ht(...r);return Ao(e),e}function Ht(...r){if(r.length<2)return r[0];if(r.length>2)return Ht(Fo(r[0],r[1]),...r.slice(2));let e=r[0],t=r[1];if(e instanceof Date&&t instanceof Date)return e.setTime(t.getTime()),e;for(let s of Reflect.ownKeys(t))Object.prototype.propertyIsEnumerable.call(t,s)&&(t[s]===Oi?delete e[s]:e[s]!==null&&t[s]!==null&&typeof e[s]=="object"&&typeof t[s]=="object"&&!Array.isArray(e[s])&&!Array.isArray(t[s])?e[s]=Ht(e[s],t[s]):e[s]=Bo(t[s]));return e}function Bo(r){return Array.isArray(r)?r.map(e=>Bo(e)):typeof r=="object"&&r!==null?r instanceof Date?new Date(r.getTime()):Ht({},r):r}function Ao(r){for(let e of Object.keys(r))r[e]===Oi?delete r[e]:typeof r[e]=="object"&&r[e]!==null&&Ao(r[e])}function xt(...r){return wr(r.length?r:[Date.now()])}function wr(r){let[e,t,s]=_r(r),o=1,n=()=>{let a=2091639*e+o*23283064365386963e-26;return e=t,t=s,s=a-(o=a|0)};return n.uint32=()=>n()*4294967296,n.fract53=()=>n()+(n()*2097152|0)*11102230246251565e-32,n.algorithm="Alea",n.seed=r,n.version="0.9",n}function _r(...r){let e=Er(),t=e(" "),s=e(" "),o=e(" ");for(let n=0;n<r.length;n++)t-=e(r[n]),t<0&&(t+=1),s-=e(r[n]),s<0&&(s+=1),o-=e(r[n]),o<0&&(o+=1);return[t,s,o]}function Er(){let r=4022871197;return function(e){let t=e.toString();for(let s=0;s<t.length;s++){r+=t.charCodeAt(s);let o=.02519603282416938*r;r=o>>>0,o-=r,o*=r,r=o>>>0,o-=r,r+=o*4294967296}return(r>>>0)*23283064365386963e-26}}function xr(){let r=()=>{};return{on:r,off:r,destroy:r,emit:r,get(){return{set:r}}}}var Si=typeof window!="undefined"?window.Hammer||Io:function(){return xr()};function xe(r){this._cleanupQueue=[],this.active=!1,this._dom={container:r,overlay:document.createElement("div")},this._dom.overlay.classList.add("vis-overlay"),this._dom.container.appendChild(this._dom.overlay),this._cleanupQueue.push(()=>{this._dom.overlay.parentNode.removeChild(this._dom.overlay)});let e=Si(this._dom.overlay);e.on("tap",this._onTapOverlay.bind(this)),this._cleanupQueue.push(()=>{e.destroy()}),["tap","doubletap","press","pinch","pan","panstart","panmove","panend"].forEach(s=>{e.on(s,o=>{o.srcEvent.stopPropagation()})}),document&&document.body&&(this._onClick=s=>{Tr(s.target,r)||this.deactivate()},document.body.addEventListener("click",this._onClick),this._cleanupQueue.push(()=>{document.body.removeEventListener("click",this._onClick)})),this._escListener=s=>{("key"in s?s.key==="Escape":s.keyCode===27)&&this.deactivate()}}(0,Do.default)(xe.prototype);xe.current=null;xe.prototype.destroy=function(){this.deactivate();for(let r of this._cleanupQueue.splice(0).reverse())r()};xe.prototype.activate=function(){xe.current&&xe.current.deactivate(),xe.current=this,this.active=!0,this._dom.overlay.style.display="none",this._dom.container.classList.add("vis-active"),this.emit("change"),this.emit("activate"),document.body.addEventListener("keydown",this._escListener)};xe.prototype.deactivate=function(){this.active=!1,this._dom.overlay.style.display="block",this._dom.container.classList.remove("vis-active"),document.body.removeEventListener("keydown",this._escListener),this.emit("change"),this.emit("deactivate")};xe.proto Line truncated
`:n.distance<=d&&o.distance>n.distance?h=" in "+G.printLocation(o.path,e,"")+"Perhaps it was misplaced? Matching option found at: "+G.printLocation(n.path,n.closestMatch,""):o.distance<=a?h='. Did you mean "'+o.closestMatch+'"?'+G.printLocation(o.path,e):h=". Did you mean one of these: "+G.print(Object.keys(t))+G.printLocation(s,e),console.error('%cUnknown option detected: "'+e+'"'+h,ki),_t=!0}static findInOptions(e,t,s,o=!1){let n=1e9,a="",d=[],h=e.toLowerCase(),l;for(let c in t){let u;if(t[c].__type__!==void 0&&o===!0){let f=G.findInOptions(e,t[c],jt(s,c));n>f.distance&&(a=f.closestMatch,d=f.path,n=f.distance,l=f.indexMatch)}else c.toLowerCase().indexOf(h)!==-1&&(l=c),u=G.levenshteinDistance(e,c),n>u&&(a=c,d=Sr(s),n=u)}return{closestMatch:a,path:d,distance:n,indexMatch:l}}static printLocation(e,t,s=`Problem value found at:
`:n.distance<=d&&o.distance>n.distance?h=" in "+G.printLocation(o.path,e,"")+"Perhaps it was misplaced? Matching option found at: "+G.printLocation(n.path,n.closestMatch,""):o.distance<=a?h='. Did you mean "'+o.closestMatch+'"?'+G.printLocation(o.path,e):h=". Did you mean one of these: "+G.print(Object.keys(t))+G.printLocation(s,e),console.error('%cUnknown option detected: "'+e+'"'+h,ki),_t=!0}static findInOptions(e,t,s,o=!1){let n=1e9,a="",d=[],h=e.toLowerCase(),l;for(let c in t){let u;if(t[c].__type__!==void 0&&o===!0){let f=G.findInOptions(e,t[c],jt(s,c));n>f.distance&&(a=f.closestMatch,d=f.path,n=f.distance,l=f.indexMatch)}else c.toLowerCase().indexOf(h)!==-1&&(l=c),u=G.levenshteinDistance(e,c),n>u&&(a=c,d=Ir(s),n=u)}return{closestMatch:a,path:d,distance:n,indexMatch:l}}static printLocation(e,t,s=`Problem value found at:
`){let o=`
`+s+`options = {
@@ -11,16 +11,16 @@
`;for(let n=0;n<e.length+1;n++){for(let a=0;a<e.length-n;a++)o+=" ";o+=`}
`}return o+`
`}static print(e){return JSON.stringify(e).replace(/(")|(\[)|(\])|(,"__type__")/g,"").replace(/(,)/g,", ")}static levenshteinDistance(e,t){if(e.length===0)return t.length;if(t.length===0)return e.length;let s=[],o;for(o=0;o<=t.length;o++)s[o]=[o];let n;for(n=0;n<=e.length;n++)s[0][n]=n;for(o=1;o<=t.length;o++)for(n=1;n<=e.length;n++)t.charAt(o-1)==e.charAt(n-1)?s[o][n]=s[o-1][n-1]:s[o][n]=Math.min(s[o-1][n-1]+1,Math.min(s[o][n-1]+1,s[o-1][n]+1));return s[t.length][e.length]}},Vo=xe;var qo=Nr,Ze=Si,Yo=Fr,Mi=ki,Uo=Br;var qt,Ar=new Uint8Array(16);function Di(){if(!qt&&(qt=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!qt))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return qt(Ar)}var Xo=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function zr(r){return typeof r=="string"&&Xo.test(r)}var Go=zr;var ee=[];for(Yt=0;Yt<256;++Yt)ee.push((Yt+256).toString(16).substr(1));var Yt;function Rr(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,t=(ee[r[e+0]]+ee[r[e+1]]+ee[r[e+2]]+ee[r[e+3]]+"-"+ee[r[e+4]]+ee[r[e+5]]+"-"+ee[r[e+6]]+ee[r[e+7]]+"-"+ee[r[e+8]]+ee[r[e+9]]+"-"+ee[r[e+10]]+ee[r[e+11]]+ee[r[e+12]]+ee[r[e+13]]+ee[r[e+14]]+ee[r[e+15]]).toLowerCase();if(!Go(t))throw TypeError("Stringified UUID is invalid");return t}var Ko=Rr;function Lr(r,e,t){r=r||{};var s=r.random||(r.rng||Di)();if(s[6]=s[6]&15|64,s[8]=s[8]&63|128,e){t=t||0;for(var o=0;o<16;++o)e[t+o]=s[o];return e}return Ko(s)}var Ne=Lr;function $o(r){return typeof r=="string"||typeof r=="number"}var Ni=class r{constructor(e){se(this,"delay");se(this,"max");se(this,"_queue",[]);se(this,"_timeout",null);se(this,"_extended",null);this.delay=null,this.max=1/0,this.setOptions(e)}setOptions(e){e&&typeof e.delay!="undefined"&&(this.delay=e.delay),e&&typeof e.max!="undefined"&&(this.max=e.max),this._flushIfNeeded()}static extend(e,t){let s=new r(t);if(e.flush!==void 0)throw new Error("Target object already has a property flush");e.flush=()=>{s.flush()};let o=[{name:"flush",original:void 0}];if(t&&t.replace)for(let n=0;n<t.replace.length;n++){let a=t.replace[n];o.push({name:a,original:e[a]}),s.replace(e,a)}return s._extended={object:e,methods:o},s}destroy(){if(this.flush(),this._extended){let e=this._extended.object,t=this._extended.methods;for(let s=0;s<t.length;s++){let o=t[s];o.original?e[o.name]=o.original:delete e[o.name]}this._extended=null}}replace(e,t){let s=this,o=e[t];if(!o)throw new Error("Method "+t+" undefined");e[t]=function(...n){s.queue({args:n,fn:o,context:this})}}queue(e){typeof e=="function"?this._queue.push({fn:e}):this._queue.push(e),this._flushIfNeeded()}_flushIfNeeded(){this._queue.length>this.max&&this.flush(),this._timeout!=null&&(clearTimeout(this._timeout),this._timeout=null),this.queue.length>0&&typeof this.delay=="number"&&(this._timeout=setTimeout(()=>{this.flush()},this.delay))}flush(){this._queue.splice(0).forEach(e=>{e.fn.apply(e.context||e.fn,e.args||[])})}},Fi=class r{constructor(){se(this,"_subscribers",{"*":[],add:[],remove:[],update:[]});se(this,"subscribe",r.prototype.on);se(this,"unsubscribe",r.prototype.off)}_trigger(e,t,s){if(e==="*")throw new Error("Cannot trigger event *");[...this._subscribers[e],...this._subscribers["*"]].forEach(o=>{o(e,t,s!=null?s:null)})}on(e,t){typeof t=="function"&&this._subscribers[e].push(t)}off(e,t){this._subscribers[e]=this._subscribers[e].filter(s=>s!==t)}},Ut=class r{constructor(e){se(this,"_pairs");this._pairs=e}*[Symbol.iterator](){for(let[e,t]of this._pairs)yield[e,t]}*entries(){for(let[e,t]of this._pairs)yield[e,t]}*keys(){for(let[e]of this._pairs)yield e}*values(){for(let[,e]of this._pairs)yield e}toIdArray(){return[...this._pairs].map(e=>e[0])}toItemArray(){return[...this._pairs].map(e=>e[1])}toEntryArray(){return[...this._pairs]}toObjectMap(){let e=Object.create(null);for(let[t,s]of this._pairs)e[t]=s;return e}toMap(){return new Map(this._pairs)}toIdSet(){return new Set(this.toIdArray())}toItemSet(){return new Set(this.toItemArray())}cache(){return new r([...this._pairs])}distinct(e){let t=new Set;for(let[s,o]of this._pairs)t.add(e(o,s));return t}filter(e){let t=this._pairs;return new r({*[Symbol.iterator](){for(let[s,o]of t)e(o,s)&&(yield[s,o])}})}forEach(e){for(let[t,s]of this._pairs)e(s,t)}map(e){let t=this._pairs;return new r({*[Symbol.iterator](){for(let[s,o]of t)yield[s,e(o,s)]}})}max(e){let t=this._pairs[Symbol.iterator](),s=t.next();if(s.done)return null;let o=s.value[1],n=e(s.value[1],s.value[0]);for(;!(s=t.next()).done;){let[a,d]=s.value,h=e(d,a);h>n&&(n=h,o=d)}return o}min(e){let t=this._pairs[Symbol.iterator](),s=t.next();if(s.done)return null;let o=s.value[1],n=e(s.value[1],s.value[0]);for(;!(s=t.next()).done;){let[a,d]=s.value,h=e(d,a);h<n&&(n=h,o=d)}return o Line truncated
`}static print(e){return JSON.stringify(e).replace(/(")|(\[)|(\])|(,"__type__")/g,"").replace(/(,)/g,", ")}static levenshteinDistance(e,t){if(e.length===0)return t.length;if(t.length===0)return e.length;let s=[],o;for(o=0;o<=t.length;o++)s[o]=[o];let n;for(n=0;n<=e.length;n++)s[0][n]=n;for(o=1;o<=t.length;o++)for(n=1;n<=e.length;n++)t.charAt(o-1)==e.charAt(n-1)?s[o][n]=s[o-1][n-1]:s[o][n]=Math.min(s[o-1][n-1]+1,Math.min(s[o][n-1]+1,s[o-1][n]+1));return s[t.length][e.length]}},Vo=xe;var qo=Fr,Ze=Si,Yo=Br,Mi=ki,Xo=Ar;var qt,zr=new Uint8Array(16);function Di(){if(!qt&&(qt=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!qt))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return qt(zr)}var Uo=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function Rr(r){return typeof r=="string"&&Uo.test(r)}var Go=Rr;var ee=[];for(Yt=0;Yt<256;++Yt)ee.push((Yt+256).toString(16).substr(1));var Yt;function Lr(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,t=(ee[r[e+0]]+ee[r[e+1]]+ee[r[e+2]]+ee[r[e+3]]+"-"+ee[r[e+4]]+ee[r[e+5]]+"-"+ee[r[e+6]]+ee[r[e+7]]+"-"+ee[r[e+8]]+ee[r[e+9]]+"-"+ee[r[e+10]]+ee[r[e+11]]+ee[r[e+12]]+ee[r[e+13]]+ee[r[e+14]]+ee[r[e+15]]).toLowerCase();if(!Go(t))throw TypeError("Stringified UUID is invalid");return t}var Ko=Lr;function Hr(r,e,t){r=r||{};var s=r.random||(r.rng||Di)();if(s[6]=s[6]&15|64,s[8]=s[8]&63|128,e){t=t||0;for(var o=0;o<16;++o)e[t+o]=s[o];return e}return Ko(s)}var Ne=Hr;function $o(r){return typeof r=="string"||typeof r=="number"}var Ni=class r{constructor(e){se(this,"delay");se(this,"max");se(this,"_queue",[]);se(this,"_timeout",null);se(this,"_extended",null);this.delay=null,this.max=1/0,this.setOptions(e)}setOptions(e){e&&typeof e.delay!="undefined"&&(this.delay=e.delay),e&&typeof e.max!="undefined"&&(this.max=e.max),this._flushIfNeeded()}static extend(e,t){let s=new r(t);if(e.flush!==void 0)throw new Error("Target object already has a property flush");e.flush=()=>{s.flush()};let o=[{name:"flush",original:void 0}];if(t&&t.replace)for(let n=0;n<t.replace.length;n++){let a=t.replace[n];o.push({name:a,original:e[a]}),s.replace(e,a)}return s._extended={object:e,methods:o},s}destroy(){if(this.flush(),this._extended){let e=this._extended.object,t=this._extended.methods;for(let s=0;s<t.length;s++){let o=t[s];o.original?e[o.name]=o.original:delete e[o.name]}this._extended=null}}replace(e,t){let s=this,o=e[t];if(!o)throw new Error("Method "+t+" undefined");e[t]=function(...n){s.queue({args:n,fn:o,context:this})}}queue(e){typeof e=="function"?this._queue.push({fn:e}):this._queue.push(e),this._flushIfNeeded()}_flushIfNeeded(){this._queue.length>this.max&&this.flush(),this._timeout!=null&&(clearTimeout(this._timeout),this._timeout=null),this.queue.length>0&&typeof this.delay=="number"&&(this._timeout=setTimeout(()=>{this.flush()},this.delay))}flush(){this._queue.splice(0).forEach(e=>{e.fn.apply(e.context||e.fn,e.args||[])})}},Fi=class r{constructor(){se(this,"_subscribers",{"*":[],add:[],remove:[],update:[]});se(this,"subscribe",r.prototype.on);se(this,"unsubscribe",r.prototype.off)}_trigger(e,t,s){if(e==="*")throw new Error("Cannot trigger event *");[...this._subscribers[e],...this._subscribers["*"]].forEach(o=>{o(e,t,s!=null?s:null)})}on(e,t){typeof t=="function"&&this._subscribers[e].push(t)}off(e,t){this._subscribers[e]=this._subscribers[e].filter(s=>s!==t)}},Xt=class r{constructor(e){se(this,"_pairs");this._pairs=e}*[Symbol.iterator](){for(let[e,t]of this._pairs)yield[e,t]}*entries(){for(let[e,t]of this._pairs)yield[e,t]}*keys(){for(let[e]of this._pairs)yield e}*values(){for(let[,e]of this._pairs)yield e}toIdArray(){return[...this._pairs].map(e=>e[0])}toItemArray(){return[...this._pairs].map(e=>e[1])}toEntryArray(){return[...this._pairs]}toObjectMap(){let e=Object.create(null);for(let[t,s]of this._pairs)e[t]=s;return e}toMap(){return new Map(this._pairs)}toIdSet(){return new Set(this.toIdArray())}toItemSet(){return new Set(this.toItemArray())}cache(){return new r([...this._pairs])}distinct(e){let t=new Set;for(let[s,o]of this._pairs)t.add(e(o,s));return t}filter(e){let t=this._pairs;return new r({*[Symbol.iterator](){for(let[s,o]of t)e(o,s)&&(yield[s,o])}})}forEach(e){for(let[t,s]of this._pairs)e(s,t)}map(e){let t=this._pairs;return new r({*[Symbol.iterator](){for(let[s,o]of t)yield[s,e(o,s)]}})}max(e){let t=this._pairs[Symbol.iterator](),s=t.next();if(s.done)return null;let o=s.value[1],n=e(s.value[1],s.value[0]);for(;!(s=t.next()).done;){let[a,d]=s.value,h=e(d,a);h>n&&(n=h,o=d)}return o}min(e){let t=this._pairs[Symbol.iterator](),s=t.next();if(s.done)return null;let o=s.value[1],n=e(s.value[1],s.value[0]);for(;!(s=t.next()).done;){let[a,d]=s.value,h=e(d,a);h<n&&(n=h,o=d)}return o Line truncated
`||B==="\r";)J();do{var r=!1;if(B==="#"){for(var e=at-1;Re.charAt(e)===" "||Re.charAt(e)===" ";)e--;if(Re.charAt(e)===`
`||Re.charAt(e)===""){for(;B!=""&&B!=`
`;)J();r=!0}}if(B==="/"&&nt()==="/"){for(;B!=""&&B!=`
`;)J();r=!0}if(B==="/"&&nt()==="*"){for(;B!="";)if(B==="*"&&nt()==="/"){J(),J();break}else J();r=!0}for(;B===" "||B===" "||B===`
`||B==="\r";)J()}while(r);if(B===""){he=re.DELIMITER;return}var t=B+nt();if(Qo[t]){he=re.DELIMITER,M=t,J(),J();return}if(Qo[B]){he=re.DELIMITER,M=B,J();return}if(Jo(B)||B==="-"){for(M+=B,J();Jo(B);)M+=B,J();M==="false"?M=!1:M==="true"?M=!0:isNaN(Number(M))||(M=Number(M)),he=re.IDENTIFIER;return}if(B==='"'){for(J();B!=""&&(B!='"'||B==='"'&&nt()==='"');)B==='"'?(M+=B,J()):B==="\\"&&nt()==="n"?(M+=`
`,J()):M+=B,J();if(B!='"')throw ae('End of string " expected');J(),he=re.IDENTIFIER;return}for(he=re.UNKNOWN;B!="";)M+=B,J();throw new SyntaxError('Syntax error in part "'+fn(M,30)+'"')}function Jr(){var r={};if($r(),Y(),M==="strict"&&(r.strict=!0,Y()),(M==="graph"||M==="digraph")&&(r.type=M,Y()),he===re.IDENTIFIER&&(r.id=M,Y()),M!="{")throw ae("Angle bracket { expected");if(Y(),ln(r),M!="}")throw ae("Angle bracket } expected");if(Y(),M!=="")throw ae("End of file expected");return Y(),delete r.node,delete r.edge,delete r.graph,r}function ln(r){for(;M!==""&&M!="}";)ea(r),M===";"&&Y()}function ea(r){var e=cn(r);if(e){un(r,e);return}var t=ta(r);if(!t){if(he!=re.IDENTIFIER)throw ae("Identifier expected");var s=M;if(Y(),M==="="){if(Y(),he!=re.IDENTIFIER)throw ae("Identifier expected");r[s]=M,Y()}else ia(r,s)}}function cn(r){var e=null;if(M==="subgraph"&&(e={},e.type="subgraph",Y(),he===re.IDENTIFIER&&(e.id=M,Y())),M==="{"){if(Y(),e||(e={}),e.parent=r,e.node=r.node,e.edge=r.edge,e.graph=r.graph,ln(e),M!="}")throw ae("Angle bracket } expected");Y(),delete e.node,delete e.edge,delete e.graph,delete e.parent,r.subgraphs||(r.subgraphs=[]),r.subgraphs.push(e)}return e}function ta(r){return M==="node"?(Y(),r.node=kt(),"node"):M==="edge"?(Y(),r.edge=kt(),"edge"):M==="graph"?(Y(),r.graph=kt(),"graph"):null}function ia(r,e){var t={id:e},s=kt();s&&(t.attr=s),dn(r,t),un(r,e)}function un(r,e){for(;M==="->"||M==="--";){var t,s=M;Y();var o=cn(r);if(o)t=o;else{if(he!=re.IDENTIFIER)throw ae("Identifier or subgraph expected");t=M,dn(r,{id:t}),Y()}var n=kt(),a=hn(r,e,t,s,n);Qr(r,a),e=t}}function kt(){for(var r,e=null,t={dashed:!0,solid:!1,dotted:[1,5]},s={dot:"circle",box:"box",crow:"crow",curve:"curve",icurve:"inv_curve",normal:"triangle",inv:"inv_triangle",diamond:"diamond",tee:"bar",vee:"vee"},o=new Array,n=new Array;M==="[";){for(Y(),e={};M!==""&&M!="]";){if(he!=re.IDENTIFIER)throw ae("Attribute name expected");var a=M;if(Y(),M!="=")throw ae("Equal sign = expected");if(Y(),he!=re.IDENTIFIER)throw ae("Attribute value expected");var d=M;a==="style"&&(d=t[d]);var h;a==="arrowhead"&&(h=s[d],a="arrows",d={to:{enabled:!0,type:h}}),a==="arrowtail"&&(h=s[d],a="arrows",d={from:{enabled:!0,type:h}}),o.push({attr:e,name:a,value:d}),n.push(a),Y(),M==","&&Y()}if(M!="]")throw ae("Bracket ] expected");Y()}if(n.includes("dir")){var l={};for(l.arrows={},r=0;r<o.length;r++)if(o[r].name==="arrows")if(o[r].value.to!=null)l.arrows.to=r;else if(o[r].value.from!=null)l.arrows.from=r;else throw ae("Invalid value of arrows");else o[r].name==="dir"&&(l.dir=r);var c=o[l.dir].value;if(!n.includes("arrows"))if(c==="both")o.push({attr:o[l.dir].attr,name:"arrows",value:{to:{enabled:!0}}}),l.arrows.to=o.length-1,o.push({attr:o[l.dir].attr,name:"arrows",value:{from:{enabled:!0}}}),l.arrows.from=o.length-1;else if(c==="forward")o.push({attr:o[l.dir].attr,name:"arrows",value:{to:{enabled:!0}}}),l.arrows.to=o.length-1;else if(c==="back")o.push({attr:o[l.dir].attr,name:"arrows",value:{from:{enabled:!0}}}),l.arrows.from=o.length-1;else if(c==="none")o.push({attr:o[l.dir].attr,name:"arrows",value:""}),l.arrows.to=o.length-1;else throw ae('Invalid dir type "'+c+'"');var u,f;if(c==="both")l.arrows.to&&l.arrows.from?(f=o[l.arrows.to].value.to.type,u=o[l.arrows.from].value.from.type,o[l.arrows.to]={attr:o[l.arrows.to].attr,name:o[l.arrows.to].name,value:{to:{enabled:!0,type:f},from:{enabled:!0,type:u}}},o.splice(l.arrows.from,1)):l.arrows.to?(f=o[l.arrows.to].value.to.type,u="arrow",o[l.arrows.to]={attr:o[l.arrows.to].attr,name:o[l.arrows.to].name,value:{to:{enabled:!0,type:f},from:{enabled:!0,type:u}}}):l.arrows.from&&(f="arrow",u=o[l.arrows.from].value.from.type,o[l.arrows.from]={attr:o[l.arrows.from].attr,name:o[l.arrows.from].name,value:{to:{enabled:!0,type:f},from:{enabled:!0,type:u}}});else if(c==="back")l.arrows.to&&l.arrows.from?(f="",u=o[l.arrows.from].value.from.type,o[l.arrows.from]={attr:o[l.arrows.from].attr,name:o[l.arrows.from].name,value:{to:{enabled:!0,type:f},from:{enabled:!0,type:u}}}):l.arrows.to?(f="",u="arrow",l.arrows.from=l.arrows.to,o[l.arrows.from]={attr:o[l.arrows.from].attr,name:o[l.arrows.from].name,value:{to:{enabled:!0,type:f},from:{enabled:!0,type:u}}}):l.arrows.from&&(f="",u=o[l.arrows.from].value.from.type,o[l.arrows.to]={attr:o[l.arrows.from].attr,name:o[l.arrows.from].name,value:{to:{enabled:!0,type:f},from:{enabled:!0,type:u}}}),o[l.arrows.from]={attr:o[l.arrows.from].attr,name:o[l.arrows.from].name,value:{from:{enabled:!0,type:o[l.arrows.from].value.from.type}}};else if(c==="none"){var p;l.arrows.to?p=l.arrows.to:p=l.arrows.from,o[p]={attr:o[p].attr,name:o[p].name,value:""}}else if(c==="forward")l.arrows.to&&l.arrows.from?(f=o[l.arrows.to].value.to.type,u="",o[l.arrows.to]={attr:o[l.arrows.to].attr,name:o[l.arrows.to].name,value:{to:{enabled:!0,type:f},from:{enabled:!0,type:u}}}):l.arrows.to?(f=o[l.arrows.to].value.to.type,u="",o[l.arrows.to]={attr:o[l.arrows.to].attr,name:o[l.arrows.to].name,value:{to:{enabled:!0,type:f},from:{en Line truncated
`,J()):M+=B,J();if(B!='"')throw ae('End of string " expected');J(),he=re.IDENTIFIER;return}for(he=re.UNKNOWN;B!="";)M+=B,J();throw new SyntaxError('Syntax error in part "'+fn(M,30)+'"')}function ea(){var r={};if(Zr(),Y(),M==="strict"&&(r.strict=!0,Y()),(M==="graph"||M==="digraph")&&(r.type=M,Y()),he===re.IDENTIFIER&&(r.id=M,Y()),M!="{")throw ae("Angle bracket { expected");if(Y(),ln(r),M!="}")throw ae("Angle bracket } expected");if(Y(),M!=="")throw ae("End of file expected");return Y(),delete r.node,delete r.edge,delete r.graph,r}function ln(r){for(;M!==""&&M!="}";)ta(r),M===";"&&Y()}function ta(r){var e=cn(r);if(e){un(r,e);return}var t=ia(r);if(!t){if(he!=re.IDENTIFIER)throw ae("Identifier expected");var s=M;if(Y(),M==="="){if(Y(),he!=re.IDENTIFIER)throw ae("Identifier expected");r[s]=M,Y()}else sa(r,s)}}function cn(r){var e=null;if(M==="subgraph"&&(e={},e.type="subgraph",Y(),he===re.IDENTIFIER&&(e.id=M,Y())),M==="{"){if(Y(),e||(e={}),e.parent=r,e.node=r.node,e.edge=r.edge,e.graph=r.graph,ln(e),M!="}")throw ae("Angle bracket } expected");Y(),delete e.node,delete e.edge,delete e.graph,delete e.parent,r.subgraphs||(r.subgraphs=[]),r.subgraphs.push(e)}return e}function ia(r){return M==="node"?(Y(),r.node=kt(),"node"):M==="edge"?(Y(),r.edge=kt(),"edge"):M==="graph"?(Y(),r.graph=kt(),"graph"):null}function sa(r,e){var t={id:e},s=kt();s&&(t.attr=s),dn(r,t),un(r,e)}function un(r,e){for(;M==="->"||M==="--";){var t,s=M;Y();var o=cn(r);if(o)t=o;else{if(he!=re.IDENTIFIER)throw ae("Identifier or subgraph expected");t=M,dn(r,{id:t}),Y()}var n=kt(),a=hn(r,e,t,s,n);Jr(r,a),e=t}}function kt(){for(var r,e=null,t={dashed:!0,solid:!1,dotted:[1,5]},s={dot:"circle",box:"box",crow:"crow",curve:"curve",icurve:"inv_curve",normal:"triangle",inv:"inv_triangle",diamond:"diamond",tee:"bar",vee:"vee"},o=new Array,n=new Array;M==="[";){for(Y(),e={};M!==""&&M!="]";){if(he!=re.IDENTIFIER)throw ae("Attribute name expected");var a=M;if(Y(),M!="=")throw ae("Equal sign = expected");if(Y(),he!=re.IDENTIFIER)throw ae("Attribute value expected");var d=M;a==="style"&&(d=t[d]);var h;a==="arrowhead"&&(h=s[d],a="arrows",d={to:{enabled:!0,type:h}}),a==="arrowtail"&&(h=s[d],a="arrows",d={from:{enabled:!0,type:h}}),o.push({attr:e,name:a,value:d}),n.push(a),Y(),M==","&&Y()}if(M!="]")throw ae("Bracket ] expected");Y()}if(n.includes("dir")){var l={};for(l.arrows={},r=0;r<o.length;r++)if(o[r].name==="arrows")if(o[r].value.to!=null)l.arrows.to=r;else if(o[r].value.from!=null)l.arrows.from=r;else throw ae("Invalid value of arrows");else o[r].name==="dir"&&(l.dir=r);var c=o[l.dir].value;if(!n.includes("arrows"))if(c==="both")o.push({attr:o[l.dir].attr,name:"arrows",value:{to:{enabled:!0}}}),l.arrows.to=o.length-1,o.push({attr:o[l.dir].attr,name:"arrows",value:{from:{enabled:!0}}}),l.arrows.from=o.length-1;else if(c==="forward")o.push({attr:o[l.dir].attr,name:"arrows",value:{to:{enabled:!0}}}),l.arrows.to=o.length-1;else if(c==="back")o.push({attr:o[l.dir].attr,name:"arrows",value:{from:{enabled:!0}}}),l.arrows.from=o.length-1;else if(c==="none")o.push({attr:o[l.dir].attr,name:"arrows",value:""}),l.arrows.to=o.length-1;else throw ae('Invalid dir type "'+c+'"');var u,f;if(c==="both")l.arrows.to&&l.arrows.from?(f=o[l.arrows.to].value.to.type,u=o[l.arrows.from].value.from.type,o[l.arrows.to]={attr:o[l.arrows.to].attr,name:o[l.arrows.to].name,value:{to:{enabled:!0,type:f},from:{enabled:!0,type:u}}},o.splice(l.arrows.from,1)):l.arrows.to?(f=o[l.arrows.to].value.to.type,u="arrow",o[l.arrows.to]={attr:o[l.arrows.to].attr,name:o[l.arrows.to].name,value:{to:{enabled:!0,type:f},from:{enabled:!0,type:u}}}):l.arrows.from&&(f="arrow",u=o[l.arrows.from].value.from.type,o[l.arrows.from]={attr:o[l.arrows.from].attr,name:o[l.arrows.from].name,value:{to:{enabled:!0,type:f},from:{enabled:!0,type:u}}});else if(c==="back")l.arrows.to&&l.arrows.from?(f="",u=o[l.arrows.from].value.from.type,o[l.arrows.from]={attr:o[l.arrows.from].attr,name:o[l.arrows.from].name,value:{to:{enabled:!0,type:f},from:{enabled:!0,type:u}}}):l.arrows.to?(f="",u="arrow",l.arrows.from=l.arrows.to,o[l.arrows.from]={attr:o[l.arrows.from].attr,name:o[l.arrows.from].name,value:{to:{enabled:!0,type:f},from:{enabled:!0,type:u}}}):l.arrows.from&&(f="",u=o[l.arrows.from].value.from.type,o[l.arrows.to]={attr:o[l.arrows.from].attr,name:o[l.arrows.from].name,value:{to:{enabled:!0,type:f},from:{enabled:!0,type:u}}}),o[l.arrows.from]={attr:o[l.arrows.from].attr,name:o[l.arrows.from].name,value:{from:{enabled:!0,type:o[l.arrows.from].value.from.type}}};else if(c==="none"){var p;l.arrows.to?p=l.arrows.to:p=l.arrows.from,o[p]={attr:o[p].attr,name:o[p].name,value:""}}else if(c==="forward")l.arrows.to&&l.arrows.from?(f=o[l.arrows.to].value.to.type,u="",o[l.arrows.to]={attr:o[l.arrows.to].attr,name:o[l.arrows.to].name,value:{to:{enabled:!0,type:f},from:{enabled:!0,type:u}}}):l.arrows.to?(f=o[l.arrows.to].value.to.type,u="",o[l.arrows.to]={attr:o[l.arrows.to].attr,name:o[l.arrows.to].name,value:{to:{enabled:!0,type:f},from:{en Line truncated
`),e=e.replace(/\r/g,`
`);let s=String(e).split(`
`),o=s.length;if(t.multi)for(let n=0;n<o;n++){let a=this.splitBlocks(s[n],t.multi);if(a!==void 0){if(a.length===0){this.lines.newLine("");continue}if(t.maxWdt>0)for(let d=0;d<a.length;d++){let h=a[d].mod,l=a[d].text;this.splitStringIntoLines(l,h,!0)}else for(let d=0;d<a.length;d++){let h=a[d].mod,l=a[d].text;this.lines.append(l,h)}this.lines.newLine()}}else if(t.maxWdt>0)for(let n=0;n<o;n++)this.splitStringIntoLines(s[n]);else for(let n=0;n<o;n++)this.lines.newLine(s[n]);return this.lines.finalize()}decodeMarkupSystem(e){let t="none";return e==="markdown"||e==="md"?t="markdown":(e===!0||e==="html")&&(t="html"),t}splitHtmlBlocks(e){let t=new Zt(e),s=o=>/&/.test(o)?(t.replace(t.text,"&lt;","<")||t.replace(t.text,"&amp;","&")||t.add("&"),!0):!1;for(;t.position<t.text.length;){let o=t.text.charAt(t.position);t.parseWS(o)||/</.test(o)&&(t.parseStartTag("bold","<b>")||t.parseStartTag("ital","<i>")||t.parseStartTag("mono","<code>")||t.parseEndTag("bold","</b>")||t.parseEndTag("ital","</i>")||t.parseEndTag("mono","</code>"))||s(o)||t.add(o),t.position++}return t.emitBlock(),t.blocks}splitMarkdownBlocks(e){let t=new Zt(e),s=!0,o=n=>/\\/.test(n)?(t.position<this.text.length+1&&(t.position++,n=this.text.charAt(t.position),/ \t/.test(n)?t.spacing=!0:(t.add(n),s=!1)),!0):!1;for(;t.position<t.text.length;){let n=t.text.charAt(t.position);t.parseWS(n)||o(n)||(s||t.spacing)&&(t.parseStartTag("bold","*")||t.parseStartTag("ital","_")||t.parseStartTag("mono","`"))||t.parseEndTag("bold","*","afterBold")||t.parseEndTag("ital","_","afterItal")||t.parseEndTag("mono","`","afterMono")||(t.add(n),s=!1),t.position++}return t.emitBlock(),t.blocks}splitBlocks(e,t){let s=this.decodeMarkupSystem(t);if(s==="none")return[{text:e,mod:"normal"}];if(s==="markdown")return this.splitMarkdownBlocks(e);if(s==="html")return this.splitHtmlBlocks(e)}overMaxWidth(e){let t=this.ctx.measureText(e).width;return this.lines.curWidth()+t>this.parent.fontOptions.maxWdt}getLongestFit(e){let t="",s=0;for(;s<e.length;){let n=t+(t===""?"":" ")+e[s];if(this.overMaxWidth(n))break;t=n,s++}return s}getLongestFitWord(e){let t=0;for(;t<e.length&&!this.overMaxWidth(e.slice(0,t));)t++;return t}splitStringIntoLines(e,t="normal",s=!1){this.parent.getFormattingValues(this.ctx,this.selected,this.hover,t),e=e.replace(/^( +)/g,"$1\r"),e=e.replace(/([^\r][^ ]*)( +)/g,"$1\r$2\r");let o=e.split("\r");for(;o.length>0;){let n=this.getLongestFit(o);if(n===0){let a=o[0],d=this.getLongestFitWord(a);this.lines.newLine(a.slice(0,d),t),o[0]=a.slice(d)}else{let a=n;o[n-1]===" "?n--:o[a]===" "&&a++;let d=o.slice(0,n).join("");n==o.length&&s?this.lines.append(d,t):this.lines.newLine(d,t),o=o.slice(a)}}}},Gt=["bold","ital","boldital","mono"],Qt=class r{constructor(e,t,s=!1){this.body=e,this.pointToSelf=!1,this.baseSize=void 0,this.fontOptions={},this.setOptions(t),this.size={top:0,left:0,width:0,height:0,yLine:0},this.isEdgeLabel=s}setOptions(e){if(this.elementOptions=e,this.initFontOptions(e.font),$t(e.label)?this.labelDirty=!0:e.label=void 0,e.font!==void 0&&e.font!==null){if(typeof e.font=="string")this.baseSize=this.fontOptions.size;else if(typeof e.font=="object"){let t=e.font.size;t!==void 0&&(this.baseSize=t)}}}initFontOptions(e){if(F(Gt,t=>{this.fontOptions[t]={}}),r.parseFontString(this.fontOptions,e)){this.fontOptions.vadjust=0;return}F(e,(t,s)=>{t!=null&&typeof t!="object"&&(this.fontOptions[s]=t)})}static parseFontString(e,t){if(!t||typeof t!="string")return!1;let s=t.split(" ");return e.size=+s[0].replace("px",""),e.face=s[1],e.color=s[2],!0}constrain(e){let t={constrainWidth:!1,maxWdt:-1,minWdt:-1,constrainHeight:!1,minHgt:-1,valign:"middle"},s=De(e,"widthConstraint");if(typeof s=="number")t.maxWdt=Number(s),t.minWdt=Number(s);else if(typeof s=="object"){let n=De(e,["widthConstraint","maximum"]);typeof n=="number"&&(t.maxWdt=Number(n));let a=De(e,["widthConstraint","minimum"]);typeof a=="number"&&(t.minWdt=Number(a))}let o=De(e,"heightConstraint");if(typeof o=="number")t.minHgt=Number(o);else if(typeof o=="object"){let n=De(e,["heightConstraint","minimum"]);typeof n=="number"&&(t.minHgt=Number(n));let a=De(e,["heightConstraint","valign"]);typeof a=="string"&&(a==="top"||a==="bottom")&&(t.valign=a)}return t}update(e,t){this.setOptions(e,!0),this.propagateFonts(t),V(this.fontOptions,this.constrain(t)),this.fontOptions.chooser=js("label",t)}adjustSizes(e){let t=e?e.right+e.left:0;this.fontOptions.constrainWidth&&(this.fontOptions.maxWdt-=t,this.fontOptions.minWdt-=t);let s=e?e.top+e.bottom:0;this.fontOptions.constrainHeight&&(this.fontOptions.minHgt-=s)}addFontOptionsToPile(e,t){for(let s=0;s<t.length;++s)this.addFontToPile(e,t[s])}addFontToPile(e,t){if(t===void 0||t.font===void 0||t.font===null)return;let s=t.font;e.push(s)}getBasicOptions(e){let t={};for(let s=0;s<e.length;++s){let o=e[s],n={};r.parseFontString(n,o)&&(o=n),F(o,(a,d)=>{a!==void 0&&(Object.prototype.hasOwnProperty.call(t,d)||(Gt.indexOf(d)!==-1?t[d]={}:t[d]=a))})}return t}getFontOption(e,t,s){let o;for(let n=0; Line truncated
`),o=s.length;if(t.multi)for(let n=0;n<o;n++){let a=this.splitBlocks(s[n],t.multi);if(a!==void 0){if(a.length===0){this.lines.newLine("");continue}if(t.maxWdt>0)for(let d=0;d<a.length;d++){let h=a[d].mod,l=a[d].text;this.splitStringIntoLines(l,h,!0)}else for(let d=0;d<a.length;d++){let h=a[d].mod,l=a[d].text;this.lines.append(l,h)}this.lines.newLine()}}else if(t.maxWdt>0)for(let n=0;n<o;n++)this.splitStringIntoLines(s[n]);else for(let n=0;n<o;n++)this.lines.newLine(s[n]);return this.lines.finalize()}decodeMarkupSystem(e){let t="none";return e==="markdown"||e==="md"?t="markdown":(e===!0||e==="html")&&(t="html"),t}splitHtmlBlocks(e){let t=new Zt(e),s=o=>/&/.test(o)?(t.replace(t.text,"&lt;","<")||t.replace(t.text,"&amp;","&")||t.add("&"),!0):!1;for(;t.position<t.text.length;){let o=t.text.charAt(t.position);t.parseWS(o)||/</.test(o)&&(t.parseStartTag("bold","<b>")||t.parseStartTag("ital","<i>")||t.parseStartTag("mono","<code>")||t.parseEndTag("bold","</b>")||t.parseEndTag("ital","</i>")||t.parseEndTag("mono","</code>"))||s(o)||t.add(o),t.position++}return t.emitBlock(),t.blocks}splitMarkdownBlocks(e){let t=new Zt(e),s=!0,o=n=>/\\/.test(n)?(t.position<this.text.length+1&&(t.position++,n=this.text.charAt(t.position),/ \t/.test(n)?t.spacing=!0:(t.add(n),s=!1)),!0):!1;for(;t.position<t.text.length;){let n=t.text.charAt(t.position);t.parseWS(n)||o(n)||(s||t.spacing)&&(t.parseStartTag("bold","*")||t.parseStartTag("ital","_")||t.parseStartTag("mono","`"))||t.parseEndTag("bold","*","afterBold")||t.parseEndTag("ital","_","afterItal")||t.parseEndTag("mono","`","afterMono")||(t.add(n),s=!1),t.position++}return t.emitBlock(),t.blocks}splitBlocks(e,t){let s=this.decodeMarkupSystem(t);if(s==="none")return[{text:e,mod:"normal"}];if(s==="markdown")return this.splitMarkdownBlocks(e);if(s==="html")return this.splitHtmlBlocks(e)}overMaxWidth(e){let t=this.ctx.measureText(e).width;return this.lines.curWidth()+t>this.parent.fontOptions.maxWdt}getLongestFit(e){let t="",s=0;for(;s<e.length;){let n=t+(t===""?"":" ")+e[s];if(this.overMaxWidth(n))break;t=n,s++}return s}getLongestFitWord(e){let t=0;for(;t<e.length&&!this.overMaxWidth(e.slice(0,t));)t++;return t}splitStringIntoLines(e,t="normal",s=!1){this.parent.getFormattingValues(this.ctx,this.selected,this.hover,t),e=e.replace(/^( +)/g,"$1\r"),e=e.replace(/([^\r][^ ]*)( +)/g,"$1\r$2\r");let o=e.split("\r");for(;o.length>0;){let n=this.getLongestFit(o);if(n===0){let a=o[0],d=this.getLongestFitWord(a);this.lines.newLine(a.slice(0,d),t),o[0]=a.slice(d)}else{let a=n;o[n-1]===" "?n--:o[a]===" "&&a++;let d=o.slice(0,n).join("");n==o.length&&s?this.lines.append(d,t):this.lines.newLine(d,t),o=o.slice(a)}}}},Gt=["bold","ital","boldital","mono"],Qt=class r{constructor(e,t,s=!1){this.body=e,this.pointToSelf=!1,this.baseSize=void 0,this.fontOptions={},this.setOptions(t),this.size={top:0,left:0,width:0,height:0,yLine:0},this.isEdgeLabel=s}setOptions(e){if(this.elementOptions=e,this.initFontOptions(e.font),$t(e.label)?this.labelDirty=!0:e.label=void 0,e.font!==void 0&&e.font!==null){if(typeof e.font=="string")this.baseSize=this.fontOptions.size;else if(typeof e.font=="object"){let t=e.font.size;t!==void 0&&(this.baseSize=t)}}}initFontOptions(e){if(F(Gt,t=>{this.fontOptions[t]={}}),r.parseFontString(this.fontOptions,e)){this.fontOptions.vadjust=0;return}F(e,(t,s)=>{t!=null&&typeof t!="object"&&(this.fontOptions[s]=t)})}static parseFontString(e,t){if(!t||typeof t!="string")return!1;let s=t.split(" ");return e.size=+s[0].replace("px",""),e.face=s[1],e.color=s[2],!0}constrain(e){let t={constrainWidth:!1,maxWdt:-1,minWdt:-1,constrainHeight:!1,minHgt:-1,valign:"middle"},s=De(e,"widthConstraint");if(typeof s=="number")t.maxWdt=Number(s),t.minWdt=Number(s);else if(typeof s=="object"){let n=De(e,["widthConstraint","maximum"]);typeof n=="number"&&(t.maxWdt=Number(n));let a=De(e,["widthConstraint","minimum"]);typeof a=="number"&&(t.minWdt=Number(a))}let o=De(e,"heightConstraint");if(typeof o=="number")t.minHgt=Number(o);else if(typeof o=="object"){let n=De(e,["heightConstraint","minimum"]);typeof n=="number"&&(t.minHgt=Number(n));let a=De(e,["heightConstraint","valign"]);typeof a=="string"&&(a==="top"||a==="bottom")&&(t.valign=a)}return t}update(e,t){this.setOptions(e,!0),this.propagateFonts(t),V(this.fontOptions,this.constrain(t)),this.fontOptions.chooser=js("label",t)}adjustSizes(e){let t=e?e.right+e.left:0;this.fontOptions.constrainWidth&&(this.fontOptions.maxWdt-=t,this.fontOptions.minWdt-=t);let s=e?e.top+e.bottom:0;this.fontOptions.constrainHeight&&(this.fontOptions.minHgt-=s)}addFontOptionsToPile(e,t){for(let s=0;s<t.length;++s)this.addFontToPile(e,t[s])}addFontToPile(e,t){if(t===void 0||t.font===void 0||t.font===null)return;let s=t.font;e.push(s)}getBasicOptions(e){let t={};for(let s=0;s<e.length;++s){let o=e[s],n={};r.parseFontString(n,o)&&(o=n),F(o,(a,d)=>{a!==void 0&&(Object.prototype.hasOwnProperty.call(t,d)||(Gt.indexOf(d)!==-1?t[d]={}:t[d]=a))})}return t}getFontOption(e,t,s){let o;for(let n=0; Line truncated
/*! Bundled license information:
@egjs/hammerjs/dist/hammer.esm.js:
+53 -1
View File
@@ -1,6 +1,44 @@
import { DataSet } from 'vis-data/esnext'
import { Network } from 'vis-network/esnext'
function generatePortSVG(text) {
// pre-calculate text width
const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
const textEl = document.createElementNS('http://www.w3.org/2000/svg', 'text');
const fontFamily = 'helvetica';
const fontSize = 14;
textEl.textContent = text;
textEl.setAttribute('font-family', fontFamily);
textEl.setAttribute('font-size', fontSize + 'px');
svg.appendChild(textEl);
document.body.appendChild(svg);
const textWidth = textEl.getComputedTextLength();
textEl.remove();
svg.remove();
const rectPadding = 2;
const rectBorderWidth = 2;
const rectX = rectBorderWidth / 2;
const rectY = rectBorderWidth / 2;
const rectWidth = textWidth + rectBorderWidth + rectPadding * 2;
const rectHeight = fontSize + rectBorderWidth + rectPadding * 2;
const svgHeight = rectHeight + rectY + rectBorderWidth / 2;
const svgWidth = rectWidth + rectX + rectBorderWidth / 2;
const textX = svgWidth / 2 ;
const textY = svgHeight / 2;
// generate SVG
return 'data:image/svg+xml;charset=utf-8,' +
encodeURIComponent(
'<svg xmlns="http://www.w3.org/2000/svg" width="' + (svgWidth) + '" height="' + (svgHeight) + '">' +
'<rect x="' + rectX + '" y="' + rectY + '" rx="4" ry="4" width="' + (rectWidth) + '" height="' + (rectHeight) + '" fill="#ffdf3f" stroke="#ffc93f" stroke-width="' + (rectBorderWidth) + '" style="opacity:0.5"/>' +
'<text x="' + textX + '" y="' + textY + '" font-family="' + fontFamily + '" font-size="' + (fontSize) + '" fill="black" text-anchor="middle" dominant-baseline="middle">' + text + '</text>' +
'</svg>'
)
}
const options = {
interaction: {
hover: true,
@@ -62,7 +100,21 @@ const coordSaveCheckbox = document.querySelector('#id_save_coords')
const edges = new DataSet(
topologyData.edges.map((node) => ({
...node,
title: htmlTitle(node.title)
title: htmlTitle(node.title),
...(node.drawTerminationLabel && {
arrows: {
from: {
enabled: true,
type: "image",
src: generatePortSVG(node.cable_a_name)
},
to: {
enabled: true,
type: "image",
src: generatePortSVG(node.cable_b_name)
}
}
})
}))
)
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "netbox_topology_views",
"version": "4.3.0",
"version": "4.5.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "netbox_topology_views",
"version": "4.3.0",
"version": "4.5.0",
"dependencies": {
"vis-data": "^7.1.9",
"vis-network": "^9.1.9",
+6 -1
View File
@@ -196,6 +196,11 @@ def get_query_settings(request):
if request.GET["straight_cables"] == "True":
straight_cables = True
draw_termination_labels = False
if "draw_termination_labels" in request.GET:
if request.GET["draw_termination_labels"] == "True":
draw_termination_labels = True
grid_size = 0
if "grid_size" in request.GET:
grid_size = request.GET.getlist('grid_size')
@@ -204,7 +209,7 @@ def get_query_settings(request):
if "node_label_items" in request.GET:
node_label_items = request.GET.getlist('node_label_items')
return filter_id, ignore_cable_type, save_coords, show_unconnected, show_power, show_circuit, show_logical_connections, show_single_cable_logical_conns, show_cables, show_wireless, group_sites, group_locations, group_racks, group_virtualchassis, group, show_neighbors, straight_cables, grid_size, node_label_items
return filter_id, ignore_cable_type, save_coords, show_unconnected, show_power, show_circuit, show_logical_connections, show_single_cable_logical_conns, show_cables, show_wireless, group_sites, group_locations, group_racks, group_virtualchassis, group, show_neighbors, straight_cables, draw_termination_labels, grid_size, node_label_items
class LinePattern():
wireless = [2, 10, 2, 10]
+18 -2
View File
@@ -269,6 +269,7 @@ def create_edge(
termination_a: Dict,
termination_b: Dict,
straight_cables: bool,
draw_termination_labels: bool,
circuit: Optional[Dict] = None,
cable: Optional[Cable] = None,
wireless: Optional[Dict] = None,
@@ -339,6 +340,12 @@ def create_edge(
# if straight_cables == True: edge["smooth"] = False
edge["smooth"] = not straight_cables
if draw_termination_labels is True:
edge["drawTerminationLabel"] = True
edge["cable_a_name"] = cable_a_name
edge["cable_b_name"] = cable_b_name
return edge
@@ -381,6 +388,7 @@ def get_topology_data(
group_virtualchassis: bool,
group_id,
straight_cables: bool,
draw_termination_labels: bool,
grid_size: list,
node_label_items: list,
):
@@ -479,6 +487,7 @@ def get_topology_data(
termination_a=termination_a,
termination_b=termination_b,
straight_cables=straight_cables,
draw_termination_labels=draw_termination_labels,
)
)
@@ -549,6 +558,7 @@ def get_topology_data(
termination_b=termination_b,
power=True,
straight_cables=straight_cables,
draw_termination_labels=draw_termination_labels,
)
)
@@ -587,7 +597,7 @@ def get_topology_data(
edge_ids += 1
termination_a = { "termination_name": interface.name, "termination_device_name": interface.device.name, "device_id": interface.device.id }
termination_b = { "termination_name": destination.name, "termination_device_name": destination.device.name, "device_id": destination.device.id }
edges.append(create_edge(edge_id=edge_ids, termination_a=termination_a, termination_b=termination_b, interface=interface, straight_cables=straight_cables))
edges.append(create_edge(edge_id=edge_ids, termination_a=termination_a, termination_b=termination_b, interface=interface, straight_cables=straight_cables, draw_termination_labels=draw_termination_labels))
nodes_devices[interface.device.id] = interface.device
nodes_devices[destination.device.id] = destination.device
@@ -668,6 +678,7 @@ def get_topology_data(
termination_a=termination_a,
termination_b=termination_b,
straight_cables=straight_cables,
draw_termination_labels=draw_termination_labels,
)
)
@@ -708,6 +719,7 @@ def get_topology_data(
termination_b=termination_b,
wireless=wireless,
straight_cables=straight_cables,
draw_termination_labels=draw_termination_labels,
)
)
@@ -762,7 +774,7 @@ class TopologyHomeView(PermissionRequiredMixin, View):
if request.GET:
filter_id, ignore_cable_type, save_coords, show_unconnected, show_power, show_circuit, show_logical_connections, show_single_cable_logical_conns, show_cables, show_wireless, group_sites, group_locations, group_racks, group_virtualchassis, group, show_neighbors, straight_cables, grid_size, node_label_items = get_query_settings(request)
filter_id, ignore_cable_type, save_coords, show_unconnected, show_power, show_circuit, show_logical_connections, show_single_cable_logical_conns, show_cables, show_wireless, group_sites, group_locations, group_racks, group_virtualchassis, group, show_neighbors, straight_cables, draw_termination_labels, grid_size, node_label_items = get_query_settings(request)
filter_required = True
empty_result = False
@@ -788,6 +800,7 @@ class TopologyHomeView(PermissionRequiredMixin, View):
if group_virtualchassis == False and 'group_virtualchassis' in saved_filter_params: group_virtualchassis = saved_filter_params['group_virtualchassis']
if show_neighbors == False and 'show_neighbors' in saved_filter_params: show_neighbors = saved_filter_params['show_neighbors']
if straight_cables == False and 'straight_cables' in saved_filter_params: straight_cables = saved_filter_params['straight_cables']
if draw_termination_labels == False and 'draw_termination_labels' in saved_filter_params: draw_termination_labels = saved_filter_params['draw_termination_labels']
if grid_size == 0 and 'grid_size' in saved_filter_params: grid_size = saved_filter_params['grid_size']
if node_label_items == () and 'node_label_items' in saved_filter_params: node_label_items = saved_filter_params['node_label_items']
except SavedFilter.DoesNotExist: # filter_id not found
@@ -825,6 +838,7 @@ class TopologyHomeView(PermissionRequiredMixin, View):
group_virtualchassis=group_virtualchassis,
group_id=group_id,
straight_cables=straight_cables,
draw_termination_labels=draw_termination_labels,
grid_size=grid_size,
node_label_items=node_label_items,
)
@@ -858,6 +872,7 @@ class TopologyHomeView(PermissionRequiredMixin, View):
if individualOptions.group_racks: q['group_racks'] = "True"
if individualOptions.group_virtualchassis: q['group_virtualchassis'] = "True"
if individualOptions.straight_cables: q['straight_cables'] = "True"
if individualOptions.draw_termination_labels: q['draw_termination_labels'] = "True"
if individualOptions.grid_size: q['grid_size'] = individualOptions.grid_size
node_label_items = IndividualOptions.objects.get(id=individualOptions.id).node_label_items.translate({ord(i): None for i in '[]\''}).split(', ')
if node_label_items == ['']: node_label_items = []
@@ -1211,6 +1226,7 @@ class TopologyIndividualOptionsView(PermissionRequiredMixin, View):
'group_virtualchassis': queryset.group_virtualchassis,
'draw_default_layout': queryset.draw_default_layout,
'straight_cables': queryset.straight_cables,
'draw_termination_labels': queryset.draw_termination_labels,
'grid_size': queryset.grid_size,
'node_label_items': tuple(queryset.node_label_items.translate({ord(i): None for i in '[]\''}).split(', ')),
},