diff --git a/demo/draw-path/index.html b/demo/draw-path/index.html index b4f0eb13..24267296 100644 --- a/demo/draw-path/index.html +++ b/demo/draw-path/index.html @@ -26,7 +26,7 @@ - + diff --git a/demo/hacktoberfest-custom-themes/index.html b/demo/hacktoberfest-custom-themes/index.html index 9da77dbb..ba9fc91e 100644 --- a/demo/hacktoberfest-custom-themes/index.html +++ b/demo/hacktoberfest-custom-themes/index.html @@ -35,7 +35,7 @@ - + diff --git a/demo/hacktoberfest-custom-themes/js/use-case/hacktoberfest-use-case.js b/demo/hacktoberfest-custom-themes/js/use-case/hacktoberfest-use-case.js index 23d7b133..fdb82ee9 100644 --- a/demo/hacktoberfest-custom-themes/js/use-case/hacktoberfest-use-case.js +++ b/demo/hacktoberfest-custom-themes/js/use-case/hacktoberfest-use-case.js @@ -9,7 +9,9 @@ class HacktoberfestUseCase extends UseCase { } _initBpmnVisualization(options) { - bpmnvisu.IconPainterProvider.set(new bpmnvisu.IconPainter()); + options.renderer = { + iconPainter: new bpmnvisu.IconPainter() + }; return super._initBpmnVisualization(options); } @@ -26,4 +28,4 @@ class HacktoberfestUseCase extends UseCase { this._bpmnVisualization.graph.model.setValue(cell, value); } -} \ No newline at end of file +} diff --git a/demo/hacktoberfest-custom-themes/js/use-case/theme-use-case.js b/demo/hacktoberfest-custom-themes/js/use-case/theme-use-case.js index e5a4d924..e0576cbb 100644 --- a/demo/hacktoberfest-custom-themes/js/use-case/theme-use-case.js +++ b/demo/hacktoberfest-custom-themes/js/use-case/theme-use-case.js @@ -8,8 +8,9 @@ class ThemeUseCase extends HacktoberfestUseCase { } _initBpmnVisualization(options) { - const bpmnVisualization = new ThemeBpmnVisualization(options, this._theme); - bpmnvisu.IconPainterProvider.set(new ThemeIconPainter(this._theme)); - return bpmnVisualization; + options.renderer = { + iconPainter: new ThemeIconPainter(this._theme) + }; + return new ThemeBpmnVisualization(options, this._theme); } } diff --git a/demo/load-and-navigation/assets/elements-identification.js b/demo/load-and-navigation/assets/elements-identification.js index 75a5b8e2..bd3a4091 100644 --- a/demo/load-and-navigation/assets/elements-identification.js +++ b/demo/load-and-navigation/assets/elements-identification.js @@ -1,4 +1,4 @@ -import{d as E,s as q,u as I,F as L,r as p,c as S,l as c,e as w,i as P,j as A,k as C,n as g,o as O,p as u,S as i,q as x,t as T,v as F,x as v,w as D}from"./main.js";import"./mxgraph.js";let s=[],f=[],y=[];const a="detection";let d=!0,r=!0;function N(t){const e={font:{},fill:{},stroke:{}};if(F(t)){switch(t){case"messageFlow":case"sequenceFlow":case"association":{e.font.color="Chocolate",e.stroke.color="Chocolate",e.stroke.width=4;break}}return e}if(i.isTask(t))e.font.color="Indigo",e.fill.color="gold",e.font.size=14,e.fill.opacity=20;else if(i.isEvent(t))i.isBoundaryEvent(t)?(e.font.color="inherit",e.fill.color="inherit",e.stroke.color="inherit"):(e.font.color="MediumTurquoise",e.stroke.color="MediumTurquoise");else if(i.isGateway(t))e.font.color="CadetBlue",e.font.opacity=85,e.stroke.color="OrangeRed",e.stroke.width=4;else if(i.isPoolOrLane(t))e.font.color="white !important",e.fill.color="deeppink",e.stroke.opacity=80;else if(i.isCallActivity(t))e.font.color="white",e.font.family="Times New Roman",e.font.isItalic=!0,e.font.isStrikeThrough=!0,e.fill.color={startColor:"LightYellow",endColor:"LimeGreen",direction:"left-to-right"};else if(i.isSubProcess(t))e.font.color="white",e.font.size=14,e.font.family="Dialog",e.font.isBold=!0,e.font.isItalic=!0,e.font.isUnderline=!0,e.font.isStrikeThrough=!0,e.fill.color="MidnightBlue",e.opacity=60;else switch(t){case"group":case"textAnnotation":{e.font.color="Crimson",e.font.size=18,e.font.family="Verdana",e.font.isBold=!0,e.font.isUnderline=!0,e.stroke.color="Chartreuse",e.stroke.width=6;break}}return e}function B(t,e){const o=t.filter(n=>O(n)),l=t.filter(n=>!o.includes(n));o.length>0&&(y=C([v.POOL,v.LANE]).map(n=>n.id),u(y,{opacity:5,font:{color:"blue",opacity:5},fill:{color:"pink"},stroke:{color:"green"}})),u(o,{fill:{color:"swimlane"},stroke:{color:"swimlane"},font:{color:"swimlane"}}),i.isBoundaryEvent(e)&&(f=x(l),u(f,{opacity:5,font:{color:"green",opacity:5},fill:{color:"gold"},stroke:{color:"red"}}));const h=N(e);u(l,h)}function b(t){p(s,a),w(t,a)}function z(t,e){k(),B(t,e)}function k(){g(s),g(f),f=[],g(y),y=[]}function M(t,e){for(const o of s)S(o);if(d)for(const o of t)T(o,G(e));else c("Do not display overlays")}function m(t){c(`Searching for Bpmn elements of '${t}' kind`);const e=C(t);R(e,t);const o=e.map(l=>l.id);r?b(o):z(o,t),M(o,t),s=o}function R(t,e){const o=document.querySelector("#elements-result"),l=`Found ${t.length} ${e}(s)`;c(l);const h=t.map(n=>` - ${n.id}: '${n.name}'`).join(` +import{d as E,s as q,u as I,r as g,c as S,l as c,e as w,i as L,j as P,k as C,m,n as A,o as u,p as O,q as T,w as x}from"./main.js";import{F,S as i,i as D,a as v}from"./lib-bpmn-visualization.js";import"./lib-es-toolkit.js";import"./lib-fast-xml-parser.js";import"./lib-mxgraph.js";let s=[],f=[],y=[];const a="detection";let d=!0,n=!0;function N(t){const e={font:{},fill:{},stroke:{}};if(D(t)){switch(t){case"messageFlow":case"sequenceFlow":case"association":{e.font.color="Chocolate",e.stroke.color="Chocolate",e.stroke.width=4;break}}return e}if(i.isTask(t))e.font.color="Indigo",e.fill.color="gold",e.font.size=14,e.fill.opacity=20;else if(i.isEvent(t))i.isBoundaryEvent(t)?(e.font.color="inherit",e.fill.color="inherit",e.stroke.color="inherit"):(e.font.color="MediumTurquoise",e.stroke.color="MediumTurquoise");else if(i.isGateway(t))e.font.color="CadetBlue",e.font.opacity=85,e.stroke.color="OrangeRed",e.stroke.width=4;else if(i.isPoolOrLane(t))e.font.color="white !important",e.fill.color="deeppink",e.stroke.opacity=80;else if(i.isCallActivity(t))e.font.color="white",e.font.family="Times New Roman",e.font.isItalic=!0,e.font.isStrikeThrough=!0,e.fill.color={startColor:"LightYellow",endColor:"LimeGreen",direction:"left-to-right"};else if(i.isSubProcess(t))e.font.color="white",e.font.size=14,e.font.family="Dialog",e.font.isBold=!0,e.font.isItalic=!0,e.font.isUnderline=!0,e.font.isStrikeThrough=!0,e.fill.color="MidnightBlue",e.opacity=60;else switch(t){case"group":case"textAnnotation":{e.font.color="Crimson",e.font.size=18,e.font.family="Verdana",e.font.isBold=!0,e.font.isUnderline=!0,e.stroke.color="Chartreuse",e.stroke.width=6;break}}return e}function B(t,e){const o=t.filter(r=>A(r)),l=t.filter(r=>!o.includes(r));o.length>0&&(y=C([v.POOL,v.LANE]).map(r=>r.id),u(y,{opacity:5,font:{color:"blue",opacity:5},fill:{color:"pink"},stroke:{color:"green"}})),u(o,{fill:{color:"swimlane"},stroke:{color:"swimlane"},font:{color:"swimlane"}}),i.isBoundaryEvent(e)&&(f=O(l),u(f,{opacity:5,font:{color:"green",opacity:5},fill:{color:"gold"},stroke:{color:"red"}}));const h=N(e);u(l,h)}function b(t){g(s,a),w(t,a)}function z(t,e){k(),B(t,e)}function k(){m(s),m(f),f=[],m(y),y=[]}function M(t,e){for(const o of s)S(o);if(d)for(const o of t)T(o,G(e));else c("Do not display overlays")}function p(t){c(`Searching for Bpmn elements of '${t}' kind`);const e=C(t);R(e,t);const o=e.map(l=>l.id);n?b(o):z(o,t),M(o,t),s=o}function R(t,e){const o=document.querySelector("#elements-result"),l=`Found ${t.length} ${e}(s)`;c(l);const h=t.map(r=>` - ${r.id}: '${r.name}'`).join(` `);o.value+=[l,h].join(` `)+` -`,o.scrollTop=o.scrollHeight}function U(){const t=document.querySelector("#elements-result");t.value=""}function $(){const t=document.querySelector("#bpmn-kinds-select");t.addEventListener("change",l=>m(l.target.value)),document.addEventListener("diagramLoaded",()=>m(t.value),!1),document.querySelector("#clear-btn").addEventListener("click",function(){U(),r?p(s,a):k();for(const l of s)S(l);s=[]});const e=document.querySelector("#checkbox-display-overlays");e.addEventListener("change",function(){d=this.checked,c("Request overlays display:",d),m(t.value)}),e.checked=d;const o=document.querySelector("#checkbox-css-style");o.addEventListener("change",function(){r=this.checked,c("Request CSS style feature:",r),r?(k(),w(s,a)):(p(s,a),B(s,t.value))}),o.checked=r}function G(t){return i.isActivity(t)?{position:"top-right",label:"30",style:{font:{color:"Chartreuse",size:20},fill:{color:"DimGray"}}}:t.includes("Gateway")?{position:"top-left",label:"3",style:{stroke:{color:"HotPink",width:4}}}:t.includes("Event")?{position:"bottom-left",label:"15"}:t.includes("lane")||t.includes("pool")?{position:"bottom-right",label:"100"}:t.includes("Flow")?{position:"middle",label:"999",style:{fill:{color:"PaleTurquoise",opacity:25}}}:{position:"top-left",label:"40"}}function j(){document.querySelector("#btn-dl-svg").addEventListener("click",P,!1),document.querySelector("#btn-dl-png").addEventListener("click",A,!1)}E(()=>{q({globalOptions:{container:document.querySelector(".bpmn-container"),navigation:{enabled:!0}},statusKoNotifier:D}),I({type:L.Center,margin:20}),$(),j()}); +`,o.scrollTop=o.scrollHeight}function U(){const t=document.querySelector("#elements-result");t.value=""}function $(){const t=document.querySelector("#bpmn-kinds-select");t.addEventListener("change",l=>p(l.target.value)),document.addEventListener("diagramLoaded",()=>p(t.value),!1),document.querySelector("#clear-btn").addEventListener("click",function(){U(),n?g(s,a):k();for(const l of s)S(l);s=[]});const e=document.querySelector("#checkbox-display-overlays");e.addEventListener("change",function(){d=this.checked,c("Request overlays display:",d),p(t.value)}),e.checked=d;const o=document.querySelector("#checkbox-css-style");o.addEventListener("change",function(){n=this.checked,c("Request CSS style feature:",n),n?(k(),w(s,a)):(g(s,a),B(s,t.value))}),o.checked=n}function G(t){return i.isActivity(t)?{position:"top-right",label:"30",style:{font:{color:"Chartreuse",size:20},fill:{color:"DimGray"}}}:t.includes("Gateway")?{position:"top-left",label:"3",style:{stroke:{color:"HotPink",width:4}}}:t.includes("Event")?{position:"bottom-left",label:"15"}:t.includes("lane")||t.includes("pool")?{position:"bottom-right",label:"100"}:t.includes("Flow")?{position:"middle",label:"999",style:{fill:{color:"PaleTurquoise",opacity:25}}}:{position:"top-left",label:"40"}}function j(){document.querySelector("#btn-dl-svg").addEventListener("click",L,!1),document.querySelector("#btn-dl-png").addEventListener("click",P,!1)}E(()=>{q({globalOptions:{container:document.querySelector(".bpmn-container"),navigation:{enabled:!0}},statusKoNotifier:x}),I({type:F.Center,margin:20}),$(),j()}); diff --git a/demo/load-and-navigation/assets/index.css b/demo/load-and-navigation/assets/index.css index c6c2c190..3ab4bce8 100644 --- a/demo/load-and-navigation/assets/index.css +++ b/demo/load-and-navigation/assets/index.css @@ -1 +1 @@ -/*! tailwindcss v4.1.10 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,::backdrop,:after,:before{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial}}}@layer theme{:host,:root{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-red-100:oklch(93.6% .032 17.717);--color-red-200:oklch(88.5% .062 18.334);--color-red-500:oklch(63.7% .237 25.331);--color-red-600:oklch(57.7% .245 27.325);--color-red-900:oklch(39.6% .141 25.723);--color-yellow-500:oklch(79.5% .184 86.047);--color-blue-600:oklch(54.6% .245 262.881);--color-blue-900:oklch(37.9% .146 265.522);--color-purple-500:oklch(62.7% .265 303.9);--color-fuchsia-400:oklch(74% .238 322.16);--color-gray-100:oklch(96.7% .003 264.542);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-800:oklch(27.8% .033 256.848);--color-white:#fff;--spacing:.25rem;--text-2xl:1.5rem;--text-2xl--line-height:1.33333;--text-3xl:1.875rem;--text-3xl--line-height:1.2;--font-weight-bold:700;--tracking-normal:0em;--leading-normal:1.5;--radius-lg:.5rem;--radius-2xl:1rem;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,::backdrop,:after,:before{border:0 solid;box-sizing:border-box;margin:0;padding:0}::file-selector-button{border:0 solid;box-sizing:border-box;margin:0;padding:0}:host,html{-webkit-text-size-adjust:100%;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);line-height:1.5;-moz-tab-size:4;tab-size:4;-webkit-tap-highlight-color:transparent}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-size:1em;font-variation-settings:var(--default-mono-font-variation-settings,normal)}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}menu,ol,ul{list-style:none}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}button,input,optgroup,select,textarea{background-color:#0000;border-radius:0;color:inherit;font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;opacity:1}::file-selector-button{background-color:#0000;border-radius:0;color:inherit;font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;opacity:1}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit,::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-millisecond-field,::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}*,::backdrop,:after,:before{border-color:var(--color-gray-200,currentColor)}::file-selector-button{border-color:var(--color-gray-200,currentColor)}}@layer components;@layer utilities{.collapse{visibility:collapse}.invisible{visibility:hidden}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.inset-0{inset:calc(var(--spacing)*0)}.container{width:100%}@media (min-width:40rem){.container{max-width:40rem}}@media (min-width:48rem){.container{max-width:48rem}}@media (min-width:64rem){.container{max-width:64rem}}@media (min-width:80rem){.container{max-width:80rem}}@media (min-width:96rem){.container{max-width:96rem}}.mt-0{margin-top:calc(var(--spacing)*0)}.mt-2{margin-top:calc(var(--spacing)*2)}.mr-2{margin-right:calc(var(--spacing)*2)}.mr-3{margin-right:calc(var(--spacing)*3)}.mb-1{margin-bottom:calc(var(--spacing)*1)}.ml-2{margin-left:calc(var(--spacing)*2)}.ml-3{margin-left:calc(var(--spacing)*3)}.ml-4{margin-left:calc(var(--spacing)*4)}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.table{display:table}.h-11{height:calc(var(--spacing)*11)}.h-auto{height:auto}.h-screen{height:100vh}.w-1\/2{width:50%}.w-1\/3{width:33.3333%}.w-full{width:100%}.flex-1{flex:1}.shrink{flex-shrink:1}.flex-grow,.grow{flex-grow:1}.transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.cursor-pointer{cursor:pointer}.resize{resize:both}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-row{flex-direction:row}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-end{align-items:flex-end}.justify-around{justify-content:space-around}.justify-center{justify-content:center}.justify-evenly{justify-content:space-evenly}.overflow-hidden{overflow:hidden}.rounded{border-radius:.25rem}.rounded-lg{border-radius:var(--radius-lg)}.border{border-style:var(--tw-border-style);border-width:1px}.border-b-2{border-bottom-style:var(--tw-border-style);border-bottom-width:2px}.border-b-4{border-bottom-style:var(--tw-border-style);border-bottom-width:4px}.border-gray-800{border-color:var(--color-gray-800)}.border-red-600{border-color:var(--color-red-600)}.border-transparent{border-color:#0000}.bg-gray-100{background-color:var(--color-gray-100)}.bg-gray-800{background-color:var(--color-gray-800)}.bg-white{background-color:var(--color-white)}.bg-linear-to-b{--tw-gradient-position:to bottom}@supports (background-image:linear-gradient(in lab,red,red)){.bg-linear-to-b{--tw-gradient-position:to bottom in oklab}}.bg-linear-to-b{background-image:linear-gradient(var(--tw-gradient-stops))}.from-red-200{--tw-gradient-from:var(--color-red-200);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-red-100{--tw-gradient-to:var(--color-red-100);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.p-6{padding:calc(var(--spacing)*6)}.px-1{padding-inline:calc(var(--spacing)*1)}.py-0{padding-block:calc(var(--spacing)*0)}.py-1{padding-block:calc(var(--spacing)*1)}.py-3{padding-block:calc(var(--spacing)*3)}.pt-1{padding-top:calc(var(--spacing)*1)}.pt-2{padding-top:calc(var(--spacing)*2)}.pb-0\.5{padding-bottom:calc(var(--spacing)*.5)}.pb-1{padding-bottom:calc(var(--spacing)*1)}.pl-1{padding-left:calc(var(--spacing)*1)}.text-center{text-align:center}.font-sans{font-family:var(--font-sans)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.leading-normal{--tw-leading:var(--leading-normal);line-height:var(--leading-normal)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.tracking-normal{--tw-tracking:var(--tracking-normal);letter-spacing:var(--tracking-normal)}.text-blue-900{color:var(--color-blue-900)}.text-red-500{color:var(--color-red-500)}.text-red-900{color:var(--color-red-900)}.text-white{color:var(--color-white)}.italic{font-style:italic}.no-underline{text-decoration-line:none}.underline{text-decoration-line:underline}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a)}.shadow,.shadow-xl{box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a),0 8px 10px -6px var(--tw-shadow-color,#0000001a)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.invert{--tw-invert:invert(100%)}.filter,.invert{filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.transition{transition-duration:var(--tw-duration,var(--default-transition-duration));transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,visibility,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function))}.select-none{-webkit-user-select:none;user-select:none}@media (hover:hover){.hover\:border-red-900:hover{border-color:var(--color-red-900)}.hover\:text-red-900:hover{color:var(--color-red-900)}}@media (min-width:48rem){.md\:mt-0{margin-top:calc(var(--spacing)*0)}.md\:mt-2{margin-top:calc(var(--spacing)*2)}.md\:mt-3{margin-top:calc(var(--spacing)*3)}.md\:mr-3{margin-right:calc(var(--spacing)*3)}.md\:mb-2{margin-bottom:calc(var(--spacing)*2)}.md\:ml-0{margin-left:calc(var(--spacing)*0)}.md\:ml-4{margin-left:calc(var(--spacing)*4)}.md\:ml-auto{margin-left:auto}.md\:block{display:block}.md\:w-48{width:calc(var(--spacing)*48)}.md\:w-full{width:100%}.md\:flex-col{flex-direction:column}.md\:flex-row{flex-direction:row}.md\:justify-between{justify-content:space-between}.md\:justify-start{justify-content:flex-start}.md\:rounded-tl-2xl{border-top-left-radius:var(--radius-2xl)}.md\:rounded-bl-2xl{border-bottom-left-radius:var(--radius-2xl)}.md\:border-b-2{border-bottom-style:var(--tw-border-style);border-bottom-width:2px}.md\:border-blue-600{border-color:var(--color-blue-600)}.md\:border-purple-500{border-color:var(--color-purple-500)}.md\:border-red-500{border-color:var(--color-red-500)}.md\:border-yellow-500{border-color:var(--color-yellow-500)}.md\:border-b-fuchsia-400{border-bottom-color:var(--color-fuchsia-400)}.md\:px-2{padding-inline:calc(var(--spacing)*2)}.md\:py-3{padding-block:calc(var(--spacing)*3)}.md\:pt-0{padding-top:calc(var(--spacing)*0)}.md\:pt-1{padding-top:calc(var(--spacing)*1)}.md\:pb-3{padding-bottom:calc(var(--spacing)*3)}.md\:pb-5{padding-bottom:calc(var(--spacing)*5)}.md\:pl-0{padding-left:calc(var(--spacing)*0)}.md\:text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}}}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"";inherits:false;initial-value:0}@property --tw-gradient-via-position{syntax:"";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"";inherits:false;initial-value:100%}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false} +@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,::backdrop,:after,:before{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial}}}@layer theme{:host,:root{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-red-100:oklch(93.6% .032 17.717);--color-red-200:oklch(88.5% .062 18.334);--color-red-500:oklch(63.7% .237 25.331);--color-red-600:oklch(57.7% .245 27.325);--color-red-900:oklch(39.6% .141 25.723);--color-yellow-500:oklch(79.5% .184 86.047);--color-blue-600:oklch(54.6% .245 262.881);--color-blue-900:oklch(37.9% .146 265.522);--color-purple-500:oklch(62.7% .265 303.9);--color-fuchsia-400:oklch(74% .238 322.16);--color-gray-100:oklch(96.7% .003 264.542);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-800:oklch(27.8% .033 256.848);--color-white:#fff;--spacing:.25rem;--text-2xl:1.5rem;--text-2xl--line-height:1.33333;--text-3xl:1.875rem;--text-3xl--line-height:1.2;--font-weight-bold:700;--tracking-normal:0em;--leading-normal:1.5;--radius-lg:.5rem;--radius-2xl:1rem;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,::backdrop,:after,:before{border:0 solid;box-sizing:border-box;margin:0;padding:0}::file-selector-button{border:0 solid;box-sizing:border-box;margin:0;padding:0}:host,html{-webkit-text-size-adjust:100%;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);line-height:1.5;tab-size:4;-webkit-tap-highlight-color:transparent}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-size:1em;font-variation-settings:var(--default-mono-font-variation-settings,normal)}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}menu,ol,ul{list-style:none}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}button,input,optgroup,select,textarea{background-color:#0000;border-radius:0;color:inherit;font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;opacity:1}::file-selector-button{background-color:#0000;border-radius:0;color:inherit;font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;opacity:1}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit,::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-millisecond-field,::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}*,::backdrop,:after,:before{border-color:var(--color-gray-200,currentColor)}::file-selector-button{border-color:var(--color-gray-200,currentColor)}}@layer components;@layer utilities{.collapse{visibility:collapse}.invisible{visibility:hidden}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.inset-0{inset:calc(var(--spacing)*0)}.start{inset-inline-start:var(--spacing)}.end{inset-inline-end:var(--spacing)}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.mt-0{margin-top:calc(var(--spacing)*0)}.mt-2{margin-top:calc(var(--spacing)*2)}.mr-2{margin-right:calc(var(--spacing)*2)}.mr-3{margin-right:calc(var(--spacing)*3)}.mb-1{margin-bottom:calc(var(--spacing)*1)}.ml-2{margin-left:calc(var(--spacing)*2)}.ml-3{margin-left:calc(var(--spacing)*3)}.ml-4{margin-left:calc(var(--spacing)*4)}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.table{display:table}.h-11{height:calc(var(--spacing)*11)}.h-auto{height:auto}.h-screen{height:100vh}.w-1\/2{width:50%}.w-1\/3{width:33.3333%}.w-full{width:100%}.flex-1{flex:1}.shrink{flex-shrink:1}.flex-grow,.grow{flex-grow:1}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.cursor-pointer{cursor:pointer}.resize{resize:both}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-row{flex-direction:row}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-end{align-items:flex-end}.justify-around{justify-content:space-around}.justify-center{justify-content:center}.justify-evenly{justify-content:space-evenly}.overflow-hidden{overflow:hidden}.rounded{border-radius:.25rem}.rounded-lg{border-radius:var(--radius-lg)}.border{border-style:var(--tw-border-style);border-width:1px}.border-b-2{border-bottom-style:var(--tw-border-style);border-bottom-width:2px}.border-b-4{border-bottom-style:var(--tw-border-style);border-bottom-width:4px}.border-gray-800{border-color:var(--color-gray-800)}.border-red-600{border-color:var(--color-red-600)}.border-transparent{border-color:#0000}.bg-gray-100{background-color:var(--color-gray-100)}.bg-gray-800{background-color:var(--color-gray-800)}.bg-white{background-color:var(--color-white)}.bg-linear-to-b{--tw-gradient-position:to bottom}@supports (background-image:linear-gradient(in lab,red,red)){.bg-linear-to-b{--tw-gradient-position:to bottom in oklab}}.bg-linear-to-b{background-image:linear-gradient(var(--tw-gradient-stops))}.from-red-200{--tw-gradient-from:var(--color-red-200);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from) var(--tw-gradient-from-position),var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-red-100{--tw-gradient-to:var(--color-red-100);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from) var(--tw-gradient-from-position),var(--tw-gradient-to) var(--tw-gradient-to-position))}.p-6{padding:calc(var(--spacing)*6)}.px-1{padding-inline:calc(var(--spacing)*1)}.py-0{padding-block:calc(var(--spacing)*0)}.py-1{padding-block:calc(var(--spacing)*1)}.py-3{padding-block:calc(var(--spacing)*3)}.pt-1{padding-top:calc(var(--spacing)*1)}.pt-2{padding-top:calc(var(--spacing)*2)}.pb-0\.5{padding-bottom:calc(var(--spacing)*.5)}.pb-1{padding-bottom:calc(var(--spacing)*1)}.pl-1{padding-left:calc(var(--spacing)*1)}.text-center{text-align:center}.font-sans{font-family:var(--font-sans)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.leading-normal{--tw-leading:var(--leading-normal);line-height:var(--leading-normal)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.tracking-normal{--tw-tracking:var(--tracking-normal);letter-spacing:var(--tracking-normal)}.text-blue-900{color:var(--color-blue-900)}.text-red-500{color:var(--color-red-500)}.text-red-900{color:var(--color-red-900)}.text-white{color:var(--color-white)}.italic{font-style:italic}.no-underline{text-decoration-line:none}.underline{text-decoration-line:underline}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a)}.shadow,.shadow-xl{box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a),0 8px 10px -6px var(--tw-shadow-color,#0000001a)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.invert{--tw-invert:invert(100%)}.filter,.invert{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.transition{transition-duration:var(--tw-duration,var(--default-transition-duration));transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function))}.select-none{-webkit-user-select:none;user-select:none}@media(hover:hover){.hover\:border-red-900:hover{border-color:var(--color-red-900)}.hover\:text-red-900:hover{color:var(--color-red-900)}}@media(min-width:48rem){.md\:mt-0{margin-top:calc(var(--spacing)*0)}.md\:mt-2{margin-top:calc(var(--spacing)*2)}.md\:mt-3{margin-top:calc(var(--spacing)*3)}.md\:mr-3{margin-right:calc(var(--spacing)*3)}.md\:mb-2{margin-bottom:calc(var(--spacing)*2)}.md\:ml-0{margin-left:calc(var(--spacing)*0)}.md\:ml-2{margin-left:calc(var(--spacing)*2)}.md\:ml-auto{margin-left:auto}.md\:block{display:block}.md\:w-48{width:calc(var(--spacing)*48)}.md\:w-full{width:100%}.md\:flex-col{flex-direction:column}.md\:flex-row{flex-direction:row}.md\:justify-between{justify-content:space-between}.md\:justify-start{justify-content:flex-start}.md\:rounded-tl-2xl{border-top-left-radius:var(--radius-2xl)}.md\:rounded-bl-2xl{border-bottom-left-radius:var(--radius-2xl)}.md\:border-b-2{border-bottom-style:var(--tw-border-style);border-bottom-width:2px}.md\:border-blue-600{border-color:var(--color-blue-600)}.md\:border-purple-500{border-color:var(--color-purple-500)}.md\:border-red-500{border-color:var(--color-red-500)}.md\:border-yellow-500{border-color:var(--color-yellow-500)}.md\:border-b-fuchsia-400{border-bottom-color:var(--color-fuchsia-400)}.md\:px-2{padding-inline:calc(var(--spacing)*2)}.md\:py-3{padding-block:calc(var(--spacing)*3)}.md\:pt-0{padding-top:calc(var(--spacing)*0)}.md\:pt-1{padding-top:calc(var(--spacing)*1)}.md\:pb-3{padding-bottom:calc(var(--spacing)*3)}.md\:pb-5{padding-bottom:calc(var(--spacing)*5)}.md\:pl-0{padding-left:calc(var(--spacing)*0)}.md\:text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.md\:text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}}}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"";inherits:false;initial-value:100%}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false} diff --git a/demo/load-and-navigation/assets/index.js b/demo/load-and-navigation/assets/index.js index 493443df..d3692da1 100644 --- a/demo/load-and-navigation/assets/index.js +++ b/demo/load-and-navigation/assets/index.js @@ -1 +1 @@ -import{m,d as f,s as p,w as g,h as v,g as y,f as c,l as r,u as s,Z as h,z as S,a as b,b as E}from"./main.js";import"./mxgraph.js";const L="0.47.0",O=()=>({lib:L,dependencies:new Map([["mxGraph",m.VERSION]])});let o=!0,t={};function C(){const e=document.querySelector("#fitOnLoad");e.addEventListener("change",n=>{o=n.target.checked,r("Fit on load updated!",o),s(o?t:{})}),e.checked=o}function i(e){r("Updating fit config",e),t.margin=e.margin??t.margin,e.type&&(t.type=e.type),r("Fit config updated!",t),o&&s(t)}function T(){const e=document.querySelector("#fitType-selected");e.addEventListener("change",n=>{i({type:n.target.value}),c(t)}),t.type?e.value=t.type:i({type:e.value})}function q(){const e=document.querySelector("#fit-margin");e.addEventListener("change",n=>{i({margin:Number(n.target.value)}),c(t)}),t.margin?e.value=String(t.margin):i({margin:Number(e.value)})}function F(){for(const e of Object.values(h))document.querySelector(`#zoom-${e}`).addEventListener("click",()=>S(e));document.querySelector("#zoom-reset").addEventListener("click",()=>c(t))}function w(){const e=document.querySelector("#theme-selected");e.addEventListener("change",a=>{b(a.target.value)});const n=E();n&&(e.value=n)}function z(){const e=O(),n=`bpmn-visualization@${e.lib}`,a=[...e.dependencies].map(([d,l])=>`${d}@${l}`).join("/"),u=document.querySelector("#footer-content");u.textContent=`${n} with ${a}`}function $(){document.addEventListener("wheel",e=>{e.ctrlKey&&e.preventDefault()},{passive:!1,capture:!0})}function k(){$(),p({globalOptions:{container:"bpmn-container",navigation:{enabled:!0}},statusKoNotifier:g}),document.querySelector("#bpmn-file").addEventListener("change",v,!1),t=y().fit,T(),q(),C(),F(),w(),z()}f(k); +import{d as m,s as f,w as p,h as g,g as v,f as c,l as r,u as s,z as y,a as h,b as S}from"./main.js";import{Z as L,g as E}from"./lib-bpmn-visualization.js";import"./lib-es-toolkit.js";import"./lib-fast-xml-parser.js";import"./lib-mxgraph.js";let o=!0,t={};function b(){const e=document.querySelector("#fitOnLoad");e.addEventListener("change",n=>{o=n.target.checked,r("Fit on load updated!",o),s(o?t:{})}),e.checked=o}function i(e){r("Updating fit config",e),t.margin=e.margin??t.margin,e.type&&(t.type=e.type),r("Fit config updated!",t),o&&s(t)}function O(){const e=document.querySelector("#fitType-selected");e.addEventListener("change",n=>{i({type:n.target.value}),c(t)}),t.type?e.value=t.type:i({type:e.value})}function T(){const e=document.querySelector("#fit-margin");e.addEventListener("change",n=>{i({margin:Number(n.target.value)}),c(t)}),t.margin?e.value=String(t.margin):i({margin:Number(e.value)})}function q(){for(const e of Object.values(L))document.querySelector(`#zoom-${e}`).addEventListener("click",()=>y(e));document.querySelector("#zoom-reset").addEventListener("click",()=>c(t))}function C(){const e=document.querySelector("#theme-selected");e.addEventListener("change",a=>{h(a.target.value)});const n=S();n&&(e.value=n)}function F(){const e=E(),n=`bpmn-visualization@${e.lib}`,a=[...e.dependencies].map(([d,l])=>`${d}@${l}`).join("/"),u=document.querySelector("#footer-content");u.textContent=`${n} with ${a}`}function z(){document.addEventListener("wheel",e=>{e.ctrlKey&&e.preventDefault()},{passive:!1,capture:!0})}function w(){z(),f({globalOptions:{container:"bpmn-container",navigation:{enabled:!0}},statusKoNotifier:p}),document.querySelector("#bpmn-file").addEventListener("change",g,!1),t=v().fit,O(),T(),b(),q(),C(),F()}m(w); diff --git a/demo/load-and-navigation/assets/lib-bpmn-visualization.js b/demo/load-and-navigation/assets/lib-bpmn-visualization.js new file mode 100644 index 00000000..1597d09a --- /dev/null +++ b/demo/load-and-navigation/assets/lib-bpmn-visualization.js @@ -0,0 +1,2 @@ +import{d as Ze,t as je}from"./lib-es-toolkit.js";import{X as qe}from"./lib-fast-xml-parser.js";import{f as $e}from"./lib-mxgraph.js";var M=(s=>(s.None="None",s.HorizontalVertical="HorizontalVertical",s.Horizontal="Horizontal",s.Vertical="Vertical",s.Center="Center",s))(M||{}),Qe=(s=>(s.In="in",s.Out="out",s))(Qe||{});function Je(s){return s instanceof HTMLElement?s:document.querySelector(`#${s}`)}var c=(s=>(s.LANE="lane",s.POOL="pool",s.CALL_ACTIVITY="callActivity",s.SUB_PROCESS="subProcess",s.TASK="task",s.TASK_USER="userTask",s.TASK_SERVICE="serviceTask",s.TASK_RECEIVE="receiveTask",s.TASK_SEND="sendTask",s.TASK_MANUAL="manualTask",s.TASK_SCRIPT="scriptTask",s.TASK_BUSINESS_RULE="businessRuleTask",s.GLOBAL_TASK="globalTask",s.GLOBAL_TASK_USER="globalUserTask",s.GLOBAL_TASK_MANUAL="globalManualTask",s.GLOBAL_TASK_SCRIPT="globalScriptTask",s.GLOBAL_TASK_BUSINESS_RULE="globalBusinessRuleTask",s.GROUP="group",s.TEXT_ANNOTATION="textAnnotation",s.GATEWAY_PARALLEL="parallelGateway",s.GATEWAY_EXCLUSIVE="exclusiveGateway",s.GATEWAY_INCLUSIVE="inclusiveGateway",s.GATEWAY_EVENT_BASED="eventBasedGateway",s.GATEWAY_COMPLEX="complexGateway",s.EVENT_START="startEvent",s.EVENT_END="endEvent",s.EVENT_INTERMEDIATE_CATCH="intermediateCatchEvent",s.EVENT_INTERMEDIATE_THROW="intermediateThrowEvent",s.EVENT_BOUNDARY="boundaryEvent",s))(c||{}),k=(s=>(s.CALLING_PROCESS="process",s.CALLING_GLOBAL_TASK="global task",s))(k||{}),x=(s=>(s.Exclusive="Exclusive",s.None="None",s.Parallel="Parallel",s))(x||{}),I=(s=>(s.NONE="none",s.TERMINATE="terminate",s.CANCEL="cancel",s.COMPENSATION="compensate",s.CONDITIONAL="conditional",s.ERROR="error",s.ESCALATION="escalation",s.LINK="link",s.MESSAGE="message",s.SIGNAL="signal",s.TIMER="timer",s))(I||{}),S=(s=>(s.ADHOC="adhoc",s.COMPENSATION="compensation",s.EXPAND="expand",s.LOOP="loop",s.MULTI_INSTANCE_PARALLEL="multi-parallel",s.MULTI_INSTANCE_SEQUENTIAL="multi-sequential",s))(S||{}),m=(s=>(s.AD_HOC="adhoc",s.EMBEDDED="embedded",s.EVENT="event",s.TRANSACTION="transaction",s))(m||{});function et(s,t){return s===""?t?{}:void 0:s}function d(s,t=!1){return s==null?[]:(Array.isArray(s)?s:[s]).map(e=>et(e,t)).filter(Boolean)}function tt(s,t,e){const n=[];e?.startingWith?n.push(`^(${e.startingWith}).*`):e?.notStartingWith&&n.push(`^(?!(${e.notStartingWith})).*`),n.push(`${t}$`);const i=n.join("");return s.filter(o=>e?.ignoreCase?new RegExp(i,"i").test(o):new RegExp(i).test(o))}class u{static isEvent(t){return U(Ee,t)}static eventKinds(){return[...Ee]}static isBoundaryEvent(t){return c.EVENT_BOUNDARY===t}static isStartEvent(t){return c.EVENT_START===t}static isCatchEvent(t){return c.EVENT_INTERMEDIATE_CATCH===t||c.EVENT_BOUNDARY===t||c.EVENT_START===t}static isIntermediateCatchEvent(t){return c.EVENT_INTERMEDIATE_CATCH===t}static isIntermediateThrowEvent(t){return c.EVENT_INTERMEDIATE_THROW===t}static isCallActivity(t){return c.CALL_ACTIVITY===t}static isSubProcess(t){return c.SUB_PROCESS===t}static canHaveNoneEvent(t){return c.EVENT_INTERMEDIATE_THROW===t||c.EVENT_END===t||c.EVENT_START===t}static isActivity(t){return U(te,t)}static activityKinds(){return[...te]}static isWithDefaultSequenceFlow(t){return st.has(t)}static isTask(t){return U(ee,t)}static taskKinds(){return[...ee]}static gatewayKinds(){return[...fe]}static isGateway(t){return U(fe,t)}static flowNodeKinds(){return Object.values(c).filter(t=>!u.isPoolOrLane(t)&&!u.isArtifact(t))}static isFlowNode(t){return u.flowNodeKinds().includes(t)}static isPoolOrLane(t){return t==c.POOL||t==c.LANE}static artifactKinds(){return[...pe]}static isArtifact(t){return pe.includes(t)}}function ce(s,t){return tt(Object.values(c),s,t)}function U(s,t){return Object.values(s).map(e=>e).includes(t)}const Ee=ce("Event"),fe=ce("Gateway"),ee=ce("Task",{ignoreCase:!0,notStartingWith:"global"}),te=[...ee,c.CALL_ACTIVITY,c.SUB_PROCESS],st=new Set([...te,c.GATEWAY_EXCLUSIVE,c.GATEWAY_INCLUSIVE,c.GATEWAY_COMPLEX]),pe=[c.GROUP,c.TEXT_ANNOTATION],we=Object.values(I).filter(s=>s!=I.NONE);var P=(s=>(s.NONE="None",s.ONE="One",s.BOTH="Both",s))(P||{}),v=(s=>(s.SEQUENCE_FLOW="sequenceFlow",s.MESSAGE_FLOW="messageFlow",s.ASSOCIATION_FLOW="association",s))(v||{}),Y=(s=>(s.NONE="none",s.INITIATING="initiating",s.NON_INITIATING="non_initiating",s))(Y||{}),_=(s=>(s.NORMAL="normal",s.DEFAULT="default",s.CONDITIONAL_FROM_ACTIVITY="conditional_from_activity",s.CONDITIONAL_FROM_GATEWAY="conditional_from_gateway",s))(_||{});class Z{constructor(t,e,n,i,o){this.id=t,this.name=e,this.kind=n,this.sourceReferenceId=i,this.targetReferenceId=o}id;name;kind;sourceReferenceId;targetReferenceId}class Fe extends Z{constructor(t,e,n,i,o=_.NORMAL){super(t,e,v.SEQUENCE_FLOW,n,i),this.sequenceFlowKind=o}sequenceFlowKind}class Pe extends Z{constructor(t,e,n,i){super(t,e,v.MESSAGE_FLOW,n,i)}}class be extends Z{constructor(t,e,n,i,o=P.NONE){super(t,e,v.ASSOCIATION_FLOW,n,i),this.associationDirectionKind=o}associationDirectionKind}const De=gt(),{mxCellOverlay:nt,mxCellRenderer:Be,mxClient:it,mxConnector:ot,mxConstants:r,mxDictionary:rt,mxEllipse:at,mxEvent:N,mxGeometry:$n,mxGraphView:lt,mxImageShape:ct,mxMarker:ht,mxPerimeter:Se,mxPoint:A,mxRectangle:se,mxRectangleShape:he,mxRhombus:Tt,mxSvgCanvas2D:Me,mxText:ut,mxUtils:p}=De,dt=De.mxGraph;function gt(){return window.mxForceIncludes=!1,window.mxLoadResources=!1,window.mxLoadStylesheets=!1,window.mxResourceExtension=".txt",$e({})}class Et{constructor(t){this.graph=t}graph;computeRelativeCoordinates(t,e){const n=this.getTranslateForRoot(t),i=e.x+n.x,o=e.y+n.y;return new A(i,o)}getTranslateForRoot(t){const e=this.graph.getModel(),n=new A(0,0);for(;t!=null;){const i=e.getGeometry(t);i!=null&&(n.x-=i.x,n.y-=i.y),t=e.getParent(t)}return n}computeEdgeCenter(t){const e=t.geometry.points,n=e[0],i=e.at(-1),o=i.x-n.x,a=i.y-n.y;return new A(n.x+o/2,n.y+a/2)}}class K{constructor(t,e,n,i,o){this.id=t,this.bpmnElement=e,this.bounds=n,this.label=i,this.isHorizontal=o}id;bpmnElement;bounds;label;isHorizontal;extensions={}}class O{constructor(t,e,n,i,o=!1){this.id=t,this.name=e,this.kind=n,this.parentId=i,this.instantiate=o}id;name;kind;parentId;instantiate;incomingIds=[];outgoingIds=[]}class j extends O{constructor(t,e,n,i,o,a=[]){super(t,e,n,i,o),this.markers=a}markers}class w extends j{constructor(t,e,n,i,o,a){super(t,e,c.CALL_ACTIVITY,i,void 0,o),this.callActivityKind=n,this.globalTaskKind=a}callActivityKind;globalTaskKind}class G extends j{constructor(t,e,n,i,o){n==m.AD_HOC&&!o.includes(S.ADHOC)&&o.push(S.ADHOC),super(t,e,c.SUB_PROCESS,i,void 0,o),this.subProcessKind=n}subProcessKind}class y extends O{constructor(t,e,n,i,o){super(t,e,n,o),this.eventDefinitionKind=i}eventDefinitionKind}class ne extends y{sourceIds=[];constructor(t,e,n,i){super(t,e,c.EVENT_INTERMEDIATE_CATCH,n,i)}}class ie extends y{targetId;constructor(t,e,n,i){super(t,e,c.EVENT_INTERMEDIATE_THROW,n,i)}}class ke extends y{constructor(t,e,n,i,o){super(t,e,c.EVENT_START,n,i),this.isInterrupting=o}isInterrupting}class xe extends y{constructor(t,e,n,i,o=!0){super(t,e,c.EVENT_BOUNDARY,n,i),this.isInterrupting=o}isInterrupting}class Ye extends O{constructor(t,e,n,i,o=x.None){super(t,e,c.GATEWAY_EVENT_BASED,n,i),this.gatewayKind=o}gatewayKind}function Ie(s,t){const e=s?.extensions.color;e&&t.set(r.STYLE_FONTCOLOR,e)}const ft={enrichShapeStyle(s,t){const e=s.extensions,n=e.fillColor;n&&(t.set(r.STYLE_FILLCOLOR,n),u.isPoolOrLane(s.bpmnElement.kind)&&t.set(r.STYLE_SWIMLANE_FILLCOLOR,n)),e.strokeColor&&t.set(r.STYLE_STROKECOLOR,e.strokeColor),Ie(s.label,t)},enrichEdgeStyle(s,t){const e=s.extensions;e.strokeColor&&t.set(r.STYLE_STROKECOLOR,e.strokeColor),Ie(s.label,t)},enrichMessageFlowIconStyle(s,t){s.extensions.strokeColor&&t.set(r.STYLE_STROKECOLOR,s.extensions.strokeColor)}};function z(s,t,e,n){return Math.min(Math.max(s??n,t),e)}function pt(s){return Math.max(s??0,0)}function St(s){const t=s??{};return t.debounceDelay=z(t.debounceDelay,0,100,50),t.throttleDelay=z(t.throttleDelay,0,100,50),t}function q(s){return s=="default"?void 0:z(s,0,100,100)}function It(s){return s=="default"?void 0:z(s,1,50,1)}const g={EDGE:"bpmn.edge",EDGE_START_FILL_COLOR:"bpmn.edge.startFillColor",EDGE_END_FILL_COLOR:"bpmn.edge.endFillColor",EVENT_BASED_GATEWAY_KIND:"bpmn.gatewayKind",EVENT_DEFINITION_KIND:"bpmn.eventDefinitionKind",GLOBAL_TASK_KIND:"bpmn.globalTaskKind",SUB_PROCESS_KIND:"bpmn.subProcessKind",IS_INITIATING:"bpmn.isInitiating",IS_INSTANTIATING:"bpmn.isInstantiating",IS_INTERRUPTING:"bpmn.isInterrupting",EXTRA_CSS_CLASSES:"bpmn.extra.css.classes",MARKERS:"bpmn.markers",MESSAGE_FLOW_ICON:"bpmn.messageFlowIcon"},Ge={ARROW_DASH:"bpmn.dash"},T={STROKE_WIDTH_THIN:2,STROKE_WIDTH_THICK:5,SHAPE_ACTIVITY_BOTTOM_MARGIN:7,SHAPE_ACTIVITY_TOP_MARGIN:7,SHAPE_ACTIVITY_LEFT_MARGIN:7,SHAPE_ACTIVITY_MARKER_ICON_MARGIN:5,SHAPE_ACTIVITY_MARKER_ICON_SIZE:20,POOL_LABEL_SIZE:30,POOL_LABEL_FILL_COLOR:"none",LANE_LABEL_SIZE:30,LANE_LABEL_FILL_COLOR:"none",SUB_PROCESS_TRANSACTION_INNER_RECT_OFFSET:4,SUB_PROCESS_TRANSACTION_INNER_RECT_ARC_SIZE:6,TEXT_ANNOTATION_BORDER_LENGTH:10,TEXT_ANNOTATION_FILL_COLOR:"none",GROUP_FILL_COLOR:"none",DEFAULT_FILL_COLOR:"White",DEFAULT_STROKE_COLOR:"Black",DEFAULT_FONT_FAMILY:"Arial, Helvetica, sans-serif",DEFAULT_FONT_SIZE:11,DEFAULT_FONT_COLOR:"Black",DEFAULT_MARGIN:0,SHAPE_ARC_SIZE:20,DEFAULT_OVERLAY_FILL_COLOR:"White",DEFAULT_OVERLAY_FILL_OPACITY:100,DEFAULT_OVERLAY_STROKE_COLOR:"Black",DEFAULT_OVERLAY_STROKE_WIDTH:1,DEFAULT_OVERLAY_FONT_SIZE:11,DEFAULT_OVERLAY_FONT_COLOR:"Black",SEQUENCE_FLOW_CONDITIONAL_FROM_ACTIVITY_MARKER_FILL_COLOR:"White",MESSAGE_FLOW_MARKER_START_FILL_COLOR:"White",MESSAGE_FLOW_MARKER_END_FILL_COLOR:"White"},Ve=s=>p.getValue(s,g.IS_INSTANTIATING,"false")=="true",X=s=>s=="default"?void 0:s,Lt=(s,t)=>(t&&(s=L(s,r.STYLE_STROKECOLOR,t.color,X),s=L(s,r.STYLE_STROKE_OPACITY,t.opacity,q),s=L(s,r.STYLE_STROKEWIDTH,t.width,It)),s),L=(s,t,e,n=i=>i)=>e==null?s:p.setStyle(s,t,n(e)),H=(s,t,e,n)=>n==null?s:p.setStyleFlag(s,t,e,n),At=(s,t)=>(t&&(s=L(s,r.STYLE_FONTCOLOR,t.color,X),s=L(s,r.STYLE_FONTSIZE,t.size),s=L(s,r.STYLE_FONTFAMILY,t.family),s=H(s,r.STYLE_FONTSTYLE,r.FONT_BOLD,t.isBold),s=H(s,r.STYLE_FONTSTYLE,r.FONT_ITALIC,t.isItalic),s=H(s,r.STYLE_FONTSTYLE,r.FONT_UNDERLINE,t.isUnderline),s=H(s,r.STYLE_FONTSTYLE,r.FONT_STRIKETHROUGH,t.isStrikeThrough),s=L(s,r.STYLE_TEXT_OPACITY,t.opacity,q)),s),Ct=(s,t,e)=>s?.split(";").map(n=>n.split("=")).filter(([n])=>n===t).map(([,n])=>n)[0]??e,Ot=s=>{switch(s){case"right-to-left":return r.DIRECTION_WEST;case"bottom-to-top":return r.DIRECTION_NORTH;case"top-to-bottom":return r.DIRECTION_SOUTH;default:return r.DIRECTION_EAST}},_t=(s,t)=>{const e=t.color;if(e){const n=mt(e),i=n?e.startColor:e;s=L(s,r.STYLE_FILLCOLOR,i,X),n?(s=p.setStyle(s,r.STYLE_GRADIENTCOLOR,e.endColor),s=p.setStyle(s,r.STYLE_GRADIENT_DIRECTION,Ot(e.direction))):e==="default"&&(s=p.setStyle(s,r.STYLE_GRADIENTCOLOR,void 0),s=p.setStyle(s,r.STYLE_GRADIENT_DIRECTION,void 0)),(s.includes(c.POOL)||s.includes(c.LANE))&&(s=L(s,r.STYLE_SWIMLANE_FILLCOLOR,i,X))}return s=L(s,r.STYLE_FILL_OPACITY,t.opacity,q),s},vt=s=>s&&typeof s=="object"&&"fill"in s,mt=s=>s&&typeof s=="object";class Nt{ignoreLabelStyles;styleExtensions;constructor(t){this.ignoreLabelStyles=t?.ignoreLabelStyles??!1,this.styleExtensions=t?.ignoreBpmnColors??!0?[]:[ft]}computeStyle(t,e){const n=[t.bpmnElement.kind];let i;t instanceof K?i=this.computeShapeStyleValues(t):(n.push(...wt(t)),i=this.computeEdgeStyleValues(t));const o=this.computeFontStyleValues(t),a=Ft(t,e);return n.push(...Le([...i,...o,...a])),n.join(";")}computeShapeStyleValues(t){const e=new Map,n=t.bpmnElement;n instanceof y?yt(n,e):n instanceof j?Rt(n,e):u.isPoolOrLane(n.kind)?e.set(r.STYLE_HORIZONTAL,t.isHorizontal?"0":"1"):n instanceof Ye&&(e.set(g.IS_INSTANTIATING,String(n.instantiate)),e.set(g.EVENT_BASED_GATEWAY_KIND,String(n.gatewayKind)));for(const i of this.styleExtensions)i.enrichShapeStyle?.(t,e);return e}computeEdgeStyleValues(t){const e=new Map;for(const n of this.styleExtensions)n.enrichEdgeStyle?.(t,e);return e}computeFontStyleValues(t){const e=new Map,n=t.label?.font;return n&&!this.ignoreLabelStyles&&(e.set(r.STYLE_FONTFAMILY,n.name),e.set(r.STYLE_FONTSIZE,n.size),e.set(r.STYLE_FONTSTYLE,Pt(n))),e}computeMessageFlowIconStyle(t){const e=new Map;e.set("shape",g.MESSAGE_FLOW_ICON),e.set(g.IS_INITIATING,String(t.messageVisibleKind===Y.INITIATING));for(const n of this.styleExtensions)n.enrichMessageFlowIconStyle?.(t,e);return Le([...e]).join(";")}}function yt(s,t){t.set(g.EVENT_DEFINITION_KIND,s.eventDefinitionKind),(s instanceof xe||s instanceof ke&&s.isInterrupting!==void 0)&&t.set(g.IS_INTERRUPTING,String(s.isInterrupting))}function Rt(s,t){s instanceof G?t.set(g.SUB_PROCESS_KIND,s.subProcessKind):s.kind===c.TASK_RECEIVE?t.set(g.IS_INSTANTIATING,String(s.instantiate)):s instanceof w&&t.set(g.GLOBAL_TASK_KIND,s.globalTaskKind);const e=s.markers;e.length>0&&t.set(g.MARKERS,e.join(","))}function wt(s){const t=[],e=s.bpmnElement;return e instanceof Fe&&t.push(e.sequenceFlowKind),e instanceof be&&t.push(e.associationDirectionKind),t}function Ft(s,t){const e=new Map,n=s.bpmnElement;return t?(e.set(r.STYLE_VERTICAL_ALIGN,r.ALIGN_TOP),s.bpmnElement.kind!=c.TEXT_ANNOTATION&&e.set(r.STYLE_ALIGN,r.ALIGN_CENTER),s instanceof K&&(e.set(r.STYLE_LABEL_WIDTH,t.width+1),e.set(r.STYLE_LABEL_POSITION,"ignore"),e.set(r.STYLE_VERTICAL_LABEL_POSITION,r.ALIGN_MIDDLE))):s instanceof K&&(n instanceof G||n instanceof w&&n.callActivityKind===k.CALLING_PROCESS)&&!n.markers.includes(S.EXPAND)&&e.set(r.STYLE_VERTICAL_ALIGN,r.ALIGN_TOP),e}function Pt(s){let t=0;return s.isBold&&(t+=r.FONT_BOLD),s.isItalic&&(t+=r.FONT_ITALIC),s.isStrikeThrough&&(t+=r.FONT_STRIKETHROUGH),s.isUnderline&&(t+=r.FONT_UNDERLINE),t}function Le(s){return s.filter(([,t])=>t&&t!="undefined").map(([t,e])=>`${t}=${e}`)}class bt{constructor(t,e,n,i){this.graph=t,this.coordinatesTranslator=e,this.styleComputer=n,this.ignoreActivityLabelBounds=i?.ignoreActivityLabelBounds??!1,this.ignoreTaskLabelBounds=i?.ignoreTaskLabelBounds??!1}graph;coordinatesTranslator;styleComputer;ignoreActivityLabelBounds;ignoreTaskLabelBounds;render(t){this.insertShapesAndEdges(t)}insertShapesAndEdges({pools:t,lanes:e,subprocesses:n,otherFlowNodes:i,boundaryEvents:o,edges:a}){this.graph.batchUpdate(()=>{this.graph.getModel().clear(),this.insertShapes(t),this.insertShapes(e),this.insertShapes(n),this.insertShapes(i),this.insertShapes(o),this.insertEdges(a)})}insertShapes(t){for(const e of t)this.insertShape(e)}getParent(t){return this.getCell(t.parentId)??this.graph.getDefaultParent()}insertShape(t){const e=t.bpmnElement,n=this.getParent(e),i=t.bounds,o=Dt(t,this.ignoreActivityLabelBounds,this.ignoreTaskLabelBounds)?void 0:t.label?.bounds,a=this.styleComputer.computeStyle(t,o);this.insertVertex(n,e.id,e.name,i,o,a)}insertEdges(t){for(const e of t){const n=this.insertEdge(e);this.insertMessageFlowIconIfNeeded(e,n)}}insertMessageFlowIconIfNeeded(t,e){if(t.bpmnElement instanceof Pe&&t.messageVisibleKind!==Y.NONE){const n=this.graph.insertVertex(e,Te(e.id),void 0,0,0,20,14,this.styleComputer.computeMessageFlowIconStyle(t));n.geometry.relative=!0,n.geometry.offset=new A(-10,-7)}}insertWaypoints(t,e){t&&(e.geometry.points=t.map(n=>this.coordinatesTranslator.computeRelativeCoordinates(e.parent,new A(n.x,n.y))))}getCell(t){return this.graph.getModel().getCell(t)}insertEdge(t){const e=t.bpmnElement,n=this.graph.getDefaultParent(),i=this.getCell(e.sourceReferenceId),o=this.getCell(e.targetReferenceId),a=t.label?.bounds,l=this.styleComputer.computeStyle(t,a),h=this.graph.insertEdge(n,e.id,e.name,i,o,l);if(this.insertWaypoints(t.waypoints,h),a){h.geometry.width=a.width,h.geometry.height=a.height,h.geometry.relative=!1;const E=this.coordinatesTranslator.computeEdgeCenter(h),f=this.coordinatesTranslator.computeRelativeCoordinates(h.parent,new A(a.x,a.y)),B=f.x+a.width/2-E.x,F=f.y-E.y;h.geometry.offset=new A(B,F)}return h}insertVertex(t,e,n,i,o,a){const l=this.coordinatesTranslator.computeRelativeCoordinates(t,new A(i.x,i.y)),h=this.graph.insertVertex(t,e,n,l.x,l.y,i.width,i.height,a);if(o){const E=o.x-i.x,f=o.y-i.y;h.geometry.offset=new A(E,f)}return h}}function Dt(s,t,e){const n=s.bpmnElement.kind;return u.isPoolOrLane(n)||t&&u.isActivity(n)||e&&u.isTask(n)}function Bt(s,t){return new bt(s,new Et(s),new Nt(t),t)}function Te(s){return`messageFlowIcon_of_${s}`}class We extends nt{constructor(t,e){super(null,"",e.position.horizontalAlign,e.position.verticalAlign,null,"default"),this.label=t,this.style=e.style}label;style;getBounds(t){const e=t.view.graph.getModel().isEdge(t.cell),n=t.view.scale;let i;const o=0,a=0;return e?i=this.computeEdgeBounds(t):(i=new A,this.align==r.ALIGN_LEFT?i.x=t.x:this.align==r.ALIGN_CENTER?i.x=t.x+t.width/2:i.x=t.x+t.width,this.verticalAlign==r.ALIGN_TOP?i.y=t.y:this.verticalAlign==r.ALIGN_MIDDLE?i.y=t.y+t.height/2:i.y=t.y+t.height),new se(Math.round(i.x-(o*this.defaultOverlap-this.offset.x)*n),Math.round(i.y-(a*this.defaultOverlap-this.offset.y)*n),o*n,a*n)}computeEdgeBounds(t){const e=t.absolutePoints;if(this.align==r.ALIGN_LEFT)return e[0];if(this.align==r.ALIGN_CENTER){if(e.length%2==1)return e[Math.floor(e.length/2)];{const n=e.length/2,i=e[n-1],o=e[n];return new A(i.x+(o.x-i.x)/2,i.y+(o.y-i.y)/2)}}else return e.at(-1)}}class Ae extends ut{constructor(t,e,n){super(t,e,void 0,void 0,n.font.color,void 0,n.font.size,void 0,void 0,void 0,void 0,void 0,void 0,void 0,n.fill.color,n.stroke.color),this.fillOpacity=n.fill.opacity,this.strokewidth=n.stroke.width}}function Mt(s){return Object.values(v).map(t=>t).includes(s)}function kt(s,t){return xt(s.style,t)}function xt(s,t){const e=[],n=s.split(";"),o=n[0].replace(/shape=bpmn./g,""),a=new Map;a.set("bpmn-type-activity",u.isActivity(o)),a.set("bpmn-type-container",u.isPoolOrLane(o)),a.set("bpmn-type-event",u.isEvent(o)),a.set("bpmn-type-flow",Mt(o)),a.set("bpmn-type-gateway",u.isGateway(o)),a.set("bpmn-type-task",u.isTask(o));for(const[l]of[...a].filter(([,h])=>h))e.push(l);e.push(oe(o));for(const[l,h]of n.map(E=>{const f=E.split("=");return[f[0],f[1]]}))switch(l){case g.EVENT_DEFINITION_KIND:{e.push(`bpmn-event-def-${h}`);break}case g.EVENT_BASED_GATEWAY_KIND:{e.push(`bpmn-gateway-kind-${h.toLowerCase()}`);break}case g.IS_INITIATING:{e.push(h=="true"?"bpmn-icon-initiating":"bpmn-icon-non-initiating");break}case g.SUB_PROCESS_KIND:{e.push(`bpmn-sub-process-${h.toLowerCase()}`);break}case g.GLOBAL_TASK_KIND:{e.push(oe(h));break}}return t&&e.push("bpmn-label"),e}function oe(s){return s?"bpmn-"+s.replace(/([A-Z])/g,t=>"-"+t[0].toLowerCase()):""}const Ce=function(s){const t=s.createSvgCanvas;s.createSvgCanvas=function(){const e=t.bind(this)(),n=e.getTextCss;if(e.getTextCss=function(){const i=this.pointerEvents;this.pointerEvents=!1;const o=n.bind(this)();return this.pointerEvents=i,o},this.state?.cell){const i=this.state.cell,o=kt(i,this.dialect===r.DIALECT_STRICTHTML),a=this.state.style[g.EXTRA_CSS_CLASSES];typeof a=="string"&&o.push(...a.split(",")),this.node.setAttribute("class",o.join(" ")),this.node.dataset.bpmnId=this.state.cell.id}return e}};class Yt extends Be{constructor(t){super(),this.iconPainter=t}iconPainter;createCellOverlays(t){const n=t.view.graph.getCellOverlays(t.cell);let i=null;if(n!=null){i=new rt;for(const o of n){const a=t.overlays==null?null:t.overlays.remove(o);if(a!=null){i.put(o,a);continue}let l;o instanceof We?l=new Ae(o.label,new se(0,0,0,0),o.style):(l=new ct(new se(0,0,0,0),o.image.src),l.preserveImageAspect=!1),l.dialect=t.view.graph.dialect,l.overlay=o,this.initializeOverlay(t,l),this.installCellOverlayListeners(t,o,l),o.cursor!=null&&(l.node.style.cursor=o.cursor),l instanceof Ae&&(l.node.classList.add("overlay-badge"),l.node.dataset.bpmnId=t.cell.id),i.put(o,l)}}t.overlays!=null&&t.overlays.visit(function(o,a){a.destroy()}),t.overlays=i}createShape(t){const e=super.createShape(t);return"iconPainter"in e&&(e.iconPainter=this.iconPainter),Ce(e),e}createLabel(t,e){super.createLabel(t,e),Ce(t.text)}}let $;class Gt extends dt{constructor(t,e){$=e,super(t),this.container&&(this.container.style.cursor="default"),$=void 0}createGraphView(){return new Vt(this)}createCellRenderer(){return new Yt($)}batchUpdate(t){this.model.beginUpdate();try{t()}finally{this.model.endUpdate()}}}class Vt extends lt{getFloatingTerminalPoint(t,e,n,i){if(t.absolutePoints.filter(Boolean).length<2)return super.getFloatingTerminalPoint(t,e,n,i);const l=t.absolutePoints;return i?l[1]:l.at(-2)}}function Wt(s,t,e,n){let i,o;s.heightC.setIconOriginForIconCentered(),shapeConfig:{x:t,y:e,width:n,height:i,strokeWidth:E},iconStyleConfig:{isFilled:l,fillColor:f,strokeColor:B,strokeWidth:h,margin:F}}}class Ht{newBpmnCanvas(t,e){const{canvas:n,ratioFromParent:i,setIconOriginFunct:o,shapeConfig:a,iconStyleConfig:l}=t;return new Ut({canvas:n,shapeConfig:a,iconConfig:{originalSize:e,styleConfig:l,ratioFromParent:i,setIconOriginFunct:o}})}paintEnvelopeIcon(t){const e={width:485.41,height:321.76},n=this.newBpmnCanvas(t,e),i=e.width,o=e.height;n.rect(0,0,i,o),n.fillAndStroke();const{iconStyleConfig:a}=t;a.isFilled&&n.setStrokeColor(a.fillColor),n.begin(),n.moveTo(0,0),n.lineTo(i*.5,o*.6),n.lineTo(i,0),n.moveTo(0,o),n.lineTo(i/3,o*.45),n.moveTo(i,o),n.lineTo(i*2/3,o*.45),n.stroke()}paintCircleIcon(t){const e={width:t.shapeConfig.width,height:t.shapeConfig.height},n=this.newBpmnCanvas(t,e),i=e.width,o=e.height;i>0&&o>0&&n.ellipse(0,0,i,o),t.iconStyleConfig.isFilled?n.fillAndStroke():n.stroke()}paintClockIcon(t){const e=this.newBpmnCanvas(t,{height:152,width:152});e.begin(),e.moveTo(184,60),e.curveTo(188.4,60,192,56.4,192,52),e.lineTo(192,48),e.curveTo(192,40,188.4,40,184,40),e.curveTo(179.6,40,176,43.6,176,48),e.lineTo(176,52),e.curveTo(176,56.4,179.6,60,184,60),e.close(),e.moveTo(184,308),e.curveTo(179.6,308,176,311.6,176,316),e.lineTo(176,320),e.curveTo(176,324.4,179.6,328,184,328),e.curveTo(188.4,328,192,324.4,192,320),e.lineTo(192,316),e.curveTo(192,311.6,188.4,308,184,308),e.close(),e.moveTo(52,176),e.lineTo(48,176),e.curveTo(43.6,176,40,179.6,40,184),e.curveTo(40,188.4,43.6,192,48,192),e.lineTo(52,192),e.curveTo(56.4,192,69,188.4,60,184),e.curveTo(60,179.6,56.4,176,52,176),e.close(),e.moveTo(320,176),e.lineTo(316,176),e.curveTo(311.6,176,308,179.6,308,184),e.curveTo(308,188.4,311.6,192,316,192),e.lineTo(320,192),e.curveTo(324.4,192,328,188.4,328,184),e.curveTo(328,179.6,324.4,176,320,176),e.moveTo(93.6,82.4),e.curveTo(90.4,79.2,85.6,79.2,82.4,82.4),e.curveTo(79.2,85.6,79.2,90.4,82.4,93.6),e.lineTo(85.2,96.4),e.curveTo(86.8,98,88.8,98.8,90.8,98.8),e.curveTo(92.8,98.8,94.4,98,96.4,96.4),e.curveTo(99.6,93.2,99.6,88.4,96.4,85.2),e.lineTo(93.6,82.4),e.moveTo(85.2,271.6),e.lineTo(82.4,274.4),e.curveTo(79.2,277.6,79.2,282.4,82.4,285.6),e.curveTo(84,287.2,86,288,88,288),e.curveTo(90,288,92,287.2,93.6,285.6),e.lineTo(96.4,282.8),e.curveTo(99.6,279.6,99.6,274.8,96.4,271.6),e.curveTo(93.2,268.4,88.4,268.4,85.2,271.6),e.moveTo(274.4,82.4),e.lineTo(271.6,85.2),e.curveTo(268.4,88.4,268.4,93.2,271.6,96.4),e.curveTo(273.298,98,275.2,98.8,277.2,98.8),e.curveTo(279.2,98.8,281.2,98,282.8,96.4),e.lineTo(285.6,93.6),e.curveTo(288.8,90.4,288.8,85.6,285.6,82.4),e.curveTo(282.4,79.2,277.6,79.2,274.4,82.4),e.moveTo(192,180.8),e.lineTo(192,108),e.curveTo(192,103.6,188.4,100,184,100),e.curveTo(179.6,100,176,103.6,176,108),e.lineTo(176,184),e.curveTo(176,186,176.8,188,178.4,189.6),e.lineTo(266,277.2),e.curveTo(267.6,278.8,269.6,279.6,271.6,279.6),e.curveTo(273.6,279.6,275.6,278.8,277.2,277.2),e.curveTo(280.4,274,280.4,269.2,277.2,266),e.lineTo(192,180.8),e.moveTo(184,0),e.curveTo(82.4,0,0,82.4,0,184),e.curveTo(0,285.6,82.4,368,184,368),e.curveTo(285.6,368,368,285.6,368,184),e.curveTo(368,82.4,285.6,0,184,0),e.moveTo(184,352),e.curveTo(91.2,352,16,276.8,16,184),e.curveTo(16,91.2,91.2,16,184,16),e.curveTo(276.8,16,352,91.2,352,184),e.curveTo(352,276.8,276.8,352,184,352),e.fillAndStroke()}paintTriangleIcon(t){const e=this.newBpmnCanvas(t,{height:735,width:849});e.begin(),e.moveTo(497,55),e.lineTo(817,609),e.curveTo(849,665,808,735,744,735),e.lineTo(105,735),e.curveTo(40,735,0,665,32,609),e.lineTo(352,55),e.curveTo(384,0,465,0,497,55),e.close(),e.fillAndStroke()}paintUpArrowheadIcon(t){const e=this.newBpmnCanvas(t,{height:50,width:40});e.begin(),e.moveTo(0,49.5),e.lineTo(19.5,1),e.curveTo(19.75,.25,20,0,20.25,.25),e.lineTo(40,49.5),e.curveTo(40,49.5,39.75,50,39.6,49.75),e.lineTo(20,30),e.lineTo(.4,49.75),e.curveTo(.4,49.75,.25,50,0,49.5),e.close(),e.fillAndStroke()}paintDoubleLeftArrowheadsIcon(t){const e=this.newBpmnCanvas(t,{height:53.5,width:105});e.begin(),e.moveTo(91.4,0),e.curveTo(91.4,0,91.2,0,91,.2),e.lineTo(50,25),e.curveTo(47.9,25.8,46.7,26.6,46.4,27.3),e.lineTo(46.4,0),e.curveTo(46.4,0,46.2,0,46,.2),e.lineTo(4.9,25),e.curveTo(2,26.2,0,27.3,4.9,28.5),e.lineTo(45.8,53),e.curveTo(46,53.3,46.2,53.5,46.4,53.5),e.lineTo(46.4,27),e.curveTo(46.6,27.3,47.8,28.1,49.9,29.9),e.lineTo(90.8,53.3),e.curveTo(91,53.3,91.2,53.5,91.4,53.5),e.lineTo(91.4,0),e.close(),e.fillAndStroke()}drawCrossIcon(t){const e=this.newBpmnCanvas(t,{height:1,width:1});return e.begin(),e.moveTo(.38,0),e.lineTo(.62,0),e.lineTo(.62,.38),e.lineTo(1,.38),e.lineTo(1,.62),e.lineTo(.62,.62),e.lineTo(.62,1),e.lineTo(.38,1),e.lineTo(.38,.62),e.lineTo(0,.62),e.lineTo(0,.38),e.lineTo(.38,.38),e.close(),e}paintListIcon(t){const e=this.newBpmnCanvas(t,{height:60,width:60});e.begin(),e.moveTo(0,0),e.lineTo(60,0),e.lineTo(60,60),e.lineTo(0,60),e.lineTo(0,0),e.close(),e.moveTo(5,5),e.lineTo(55,5),e.close(),e.moveTo(5,21.6),e.lineTo(55,21.6),e.close(),e.moveTo(5,38.3),e.lineTo(55,38.3),e.close(),e.moveTo(5,55),e.lineTo(55,55),e.close(),e.fillAndStroke()}paintXCrossIcon(t){const e=this.drawCrossIcon(t);e.rotateOnIconCenter(45),e.fillAndStroke()}paintPlusCrossIcon(t){this.drawCrossIcon(t).fillAndStroke()}paintAsteriskIcon(t){const e=this.newBpmnCanvas(t,{height:1,width:1});Q(e),e.fillAndStroke(),Q(e),e.rotateOnIconCenter(60),e.fillAndStroke(),Q(e),e.rotateOnIconCenter(240),e.fillAndStroke()}paintPersonIcon(t){const e=this.newBpmnCanvas({...t,iconStyleConfig:{...t.iconStyleConfig,isFilled:!0}},{height:239.68,width:143.61});e.begin(),e.moveTo(124.31,150.29),e.lineTo(99.66,141.03),e.arcTo(6.43,6.43,0,0,1,95.51,135.03),e.lineTo(95.51,130.66),e.arcTo(47.75,47.75,0,0,0,119.51,89.25),e.lineTo(119.51,71.25),e.arcTo(47.62,47.62,0,0,0,101.18,33.64),e.arcTo(29.35,29.35,0,0,0,101.52,29.14),e.arcTo(29.68,29.68,0,0,0,42.17,29.14),e.arcTo(29.24,29.24,0,0,0,42.53,33.63),e.arcTo(47.65,47.65,0,0,0,24.14,71.23),e.lineTo(24.14,89.23),e.arcTo(47.7,47.7,0,0,0,48.19,130.63),e.lineTo(48.19,135.03),e.arcTo(6.43,6.43,0,0,1,44.03,141.03),e.lineTo(19.31,150.29),e.arcTo(29.81,29.81,0,0,0,.09,178.03),e.lineTo(.09,233.51),e.arcTo(5.63,5.63,0,1,0,11.34,233.51),e.lineTo(11.34,178.03),e.arcTo(18.19,18.19,0,0,1,11.57,175.17),e.lineTo(20.5,184.11),e.arcTo(12.32,12.32,0,0,1,24.14,192.89),e.lineTo(24.14,233.51),e.arcTo(5.63,5.63,0,1,0,35.39,233.51),e.lineTo(35.39,192.93),e.arcTo(23.5,23.5,0,0,0,28.46,176.2),e.lineTo(17.04,164.78),e.arcTo(18.34,18.34,0,0,1,23.29,160.78),e.lineTo(43.65,153.15),e.lineTo(66.22,175.72),e.lineTo(66.22,233.51),e.arcTo(5.63,5.63,0,1,0,77.47,233.51),e.lineTo(77.47,175.76),e.lineTo(100.04,153.19),e.lineTo(120.4,160.82),e.arcTo(18.39,18.39,0,0,1,126.65,164.82),e.lineTo(115.24,176.24),e.arcTo(23.5,23.5,0,0,0,108.31,192.93),e.lineTo(108.31,233.55),e.arcTo(5.63,5.63,0,1,0,119.56,233.55),e.lineTo(119.56,192.93),e.arcTo(12.35,12.35,0,0,1,123.19,184.15),e.lineTo(132.13,175.22),e.arcTo(18,18,0,0,1,132.36,178.08),e.lineTo(132.36,233.56),e.arcTo(5.63,5.63,0,0,0,143.61,233.56),e.lineTo(143.61,178.03),e.arcTo(29.81,29.81,0,0,0,124.31,150.29),e.close(),e.moveTo(71.85,10.72),e.arcTo(18.46,18.46,0,0,1,90.17,27.18),e.arcTo(47.68,47.68,0,0,0,53.53,27.18),e.arcTo(18.44,18.44,0,0,1,71.85,10.72),e.close(),e.moveTo(35.39,71.23),e.arcTo(36.46,36.46,0,0,1,108.31,71.23),e.lineTo(108.31,77.4),e.curveTo(82.12,75.4,56.97,60.55,56.71,60.4),e.arcTo(5.62,5.62,0,0,0,48.78,62.71),e.curveTo(46.24,67.79,40.45,71.89,35.39,74.62),e.close(),e.moveTo(35.39,89.23),e.lineTo(35.39,87.08),e.curveTo(40.55,84.85,49.73,80.08,55.67,72.66),e.curveTo(64.83,77.46,85.92,87.21,108.31,88.66),e.lineTo(108.31,89.24),e.arcTo(36.46,36.46,0,1,1,35.39,89.24),e.close(),e.moveTo(71.85,165.45),e.lineTo(54.06,147.69),e.arcTo(17.7,17.7,0,0,0,59.43,135.32),e.arcTo(47.57,47.57,0,0,0,84.27,135.32),e.arcTo(17.7,17.7,0,0,0,89.64,147.69),e.close(),e.fill()}paintGearIcon(t){const e=this.newBpmnCanvas(t,{height:100,width:100});Kt(e),e.translateIconOrigin(14,14),zt(e)}paintExpandIcon(t){const e={width:16,height:16},n=this.newBpmnCanvas(t,e),i=e.width,o=e.height;n.roundrect(0,0,i,o,2,2),n.stroke(),n.begin(),n.moveTo(i/2,o/4),n.lineTo(i/2,o*3/4),n.close(),n.moveTo(i/4,o/2),n.lineTo(i*3/4,o/2),n.close(),n.fillAndStroke()}paintLoopIcon(t){const{iconStyleConfig:e}=t;e.fillColor=e.strokeColor;const n=this.newBpmnCanvas(t,{width:22.49,height:21.62});n.begin(),n.moveTo(5.5,19.08),n.arcTo(8,8,0,1,1,10.5,21.08),n.stroke(),n.begin(),n.moveTo(7.5,14.08),n.lineTo(5.75,19.08),n.lineTo(0,17.08),n.close(),n.fillAndStroke()}paintSequentialMultiInstanceIcon(t){const e={width:16,height:16},n=this.newBpmnCanvas(t,e),{canvas:i,iconStyleConfig:o}=t;i.setFillColor(o.strokeColor);const a=e.width,l=e.height/5;n.rect(0,0,a,l),n.fill(),n.rect(0,2*l,a,l),n.fill(),n.rect(0,4*l,a,l),n.fill()}paintParallelMultiInstanceIcon(t){const e={width:16,height:16},n=this.newBpmnCanvas(t,e),{canvas:i,iconStyleConfig:o}=t;i.setFillColor(o.strokeColor);const a=e.width/5,l=e.height;n.begin(),n.rect(0,0,a,l),n.fill(),n.rect(2*a,0,a,l),n.fill(),n.rect(4*a,0,a,l),n.fill()}paintRightArrowIcon(t){const e=this.newBpmnCanvas(t,{width:512,height:415.23});e.setRoundLineJoin(),e.begin(),e.moveTo(512,207.61),e.lineTo(304.38,0),e.lineTo(304.38,135.39),e.lineTo(0,135.39),e.lineTo(0,279.84),e.lineTo(304.38,279.84),e.lineTo(304.38,415.23),e.lineTo(512,207.61),e.close(),e.fillAndStroke()}paintErrorIcon(t){const e=this.newBpmnCanvas(t,{width:72.44,height:71.82});e.begin(),e.moveTo(0,53.32),e.lineTo(19.48,0),e.lineTo(19.48,0),e.lineTo(50.85,40.07),e.lineTo(72.44,18.21),e.lineTo(53.12,71.82),e.lineTo(22.5,31.37),e.close(),e.fillAndStroke()}paintHandIcon(t){const e=this.newBpmnCanvas(t,{width:343.65,height:354.12});e.begin(),e.moveTo(231.66,336.39),e.curveTo(240.84,316.9,220.53,306.92,220.53,306.92),e.curveTo(215.2,303.67,188.58,287.43,140.67,258.19),e.lineTo(146.33,248.39),e.curveTo(223.98,269.38,267.12,281.04,275.75,283.38),e.curveTo(275.75,283.38,297.25,288,301.42,267.77),e.curveTo(306.34,245.29,288.32,238.63,288.32,238.63),e.curveTo(279.91,236.44,237.86,225.48,162.18,205.75),e.lineTo(165.2,194.8),e.curveTo(255.88,204.4,306.27,209.73,316.34,210.8),e.curveTo(316.34,210.8,339.89,212.16,341.76,189.55),e.curveTo(343.65,166.93,320.5,164.13,320.5,164.13),e.curveTo(310.43,163.1,260.04,157.99,169.35,148.77),e.lineTo(169.35,138.97),e.curveTo(253.41,132.12,300.11,128.32,309.45,127.56),e.curveTo(309.45,127.56,332.27,122.38,332.27,102.61),e.curveTo(332.27,82.85,305.48,81.87,305.48,81.87),e.curveTo(293.99,82.2,236.54,83.88,133.13,86.9),e.lineTo(127.61,81.87),e.curveTo(145.3,59.39,155.12,46.9,157.09,44.41),e.curveTo(157.09,44.41,171.12,26.8,156.78,12.72),e.curveTo(143.83,0,124.08,14.49,124.08,14.49),e.curveTo(116.45,19.41,78.35,44.06,9.77,88.43),e.lineTo(0,251.94),e.curveTo(122.84,308.79,191.09,340.37,204.74,346.69),e.curveTo(204.74,346.69,222.91,354.12,231.66,336.39),e.fillAndStroke()}paintScriptIcon(t){t.iconStyleConfig.fillColor=t.iconStyleConfig.strokeColor;const e=this.newBpmnCanvas(t,{width:458.75,height:461.64});e.begin(),e.moveTo(67.85,.57),e.curveTo(50.73,0,33.26,8.86,22.35,18.84),e.curveTo(8.11,32.15,0,50.77,0,70.26),e.curveTo(0,73.15,0,87.59,0,113.6),e.curveTo(55.4,113.6,86.18,113.6,92.33,113.6),e.curveTo(94.92,150.46,85.64,180.4,74.22,211.27),e.curveTo(40.16,298.07,30.77,339.83,55.56,410.87),e.curveTo(63.72,438.26,87.59,457.85,114.91,461.09),e.curveTo(216.96,460.85,294.9,461.64,388.41,461.2),e.curveTo(407.2,461.09,425.14,453.55,438.3,440.13),e.curveTo(451.46,426.71,458.75,403.06,458.46,384.26),e.curveTo(458.43,382.23,458.18,365.93,458.15,363.89),e.curveTo(432.12,364.24,406.09,364.04,380.06,364.04),e.curveTo(377.61,347.52,377.24,337.58,378.28,324.48),e.curveTo(380.5,296.47,389.08,273.36,398.59,247.1),e.curveTo(408.11,220.83,418.41,191.47,420.86,154.24),e.curveTo(422.11,135.34,421.4,110.24,417.77,86.75),e.curveTo(417.76,86.71,417.73,86.54,417.69,86.22),e.curveTo(417.64,85.95,417.61,85.79,417.6,85.76),e.curveTo(414.03,68.13,410.49,48.84,399.79,31.47),e.curveTo(389.09,14.11,366.95,.59,341.75,.59),e.curveTo(286.97,.59,122.63,.57,67.85,.57),e.close(),e.moveTo(85.04,72.68),e.curveTo(80.63,72.68,45.33,72.68,40.92,72.68),e.curveTo(40.46,58.4,47.15,51.87,50.27,48.75),e.curveTo(55.8,44.28,59.84,41,73.82,41),e.curveTo(78.45,52.13,82.23,62.71,85.04,72.68),e.close(),e.moveTo(364.94,52.9),e.curveTo(370,61.11,373.9,76.44,377.38,93.51),e.curveTo(380.35,113.1,381.01,136.42,380.02,151.57),e.curveTo(377.97,182.76,369.51,207.12,360.1,233.1),e.curveTo(350.69,259.09,340.27,286.77,337.53,321.27),e.curveTo(336.38,335.86,336.72,346.69,338.87,364.01),e.curveTo(326.35,364.01,263.75,364.01,151.06,364.01),e.curveTo(151.06,382.2,151.06,392.31,151.06,394.33),e.curveTo(147.77,404.8,138.9,418.2,127.43,419.94),e.curveTo(111.49,422.35,97.86,411.8,94.75,399.19),e.curveTo(65.14,321.99,94.93,275.54,112.57,225.47),e.curveTo(130.14,177.95,137.92,117.41,112.71,42.09),e.curveTo(192.88,41.9,274.33,42.21,342.89,41.98),e.curveTo(357.15,42.03,359.83,44.61,364.94,52.9),e.close(),e.moveTo(409.96,399.48),e.curveTo(409.96,408.42,398.54,425.67,392.02,425.67),e.curveTo(325.19,425.79,252.29,425.67,185.23,425.67),e.curveTo(189.88,424.43,194.66,405.64,194.66,399.48),e.curveTo(237.72,399.48,388.43,399.48,409.96,399.48),e.close(),e.fill(),e.begin(),e.moveTo(182.1,131.2),e.lineTo(182.1,151.68),e.lineTo(321.89,151.68),e.lineTo(321.89,131.2),e.lineTo(182.1,131.2),e.close(),e.moveTo(162.25,251.09),e.lineTo(162.25,271.49),e.lineTo(301.96,271.49),e.lineTo(301.96,251.09),e.lineTo(162.25,251.09),e.close(),e.fill()}paintTableIcon(t){const e=this.newBpmnCanvas(t,{width:640,height:640});e.begin(),e.moveTo(.19,.1),e.lineTo(298.78,.1),e.lineTo(298.78,198.88),e.lineTo(.19,198.88),e.lineTo(.19,.1),e.close(),e.fillAndStroke(),e.begin(),e.moveTo(0,0),e.lineTo(298.78,0),e.lineTo(298.78,48.88),e.lineTo(0,48.88),e.lineTo(0,0),e.close(),e.fillAndStroke(),e.begin(),e.moveTo(0,48.88),e.lineTo(98.78,48.88),e.lineTo(98.78,198.88),e.lineTo(0,198.88),e.lineTo(0,48.88),e.close(),e.fillAndStroke(),e.begin(),e.moveTo(1.09,122.69),e.lineTo(298.78,122.69),e.close(),e.fillAndStroke(),e.setFillColor(t.iconStyleConfig.strokeColor),e.begin(),e.moveTo(0,0),e.lineTo(298.78,0),e.lineTo(298.78,48.88),e.lineTo(0,48.88),e.lineTo(0,0),e.close(),e.fillAndStroke()}paintPentagon(t){const e=this.newBpmnCanvas(t,{width:16,height:16});e.begin(),e.moveTo(16,6.5),e.lineTo(8,0),e.lineTo(0,6.5),e.lineTo(3,16),e.lineTo(13,16),e.lineTo(16,6.5),e.lineTo(8,0),e.stroke()}}function Q(s){s.begin(),s.moveTo(.38,0),s.lineTo(.62,0),s.lineTo(.62,1),s.lineTo(.38,1),s.close()}function Kt(s){s.begin(),s.moveTo(2.06,24.62),s.lineTo(10.17,30.95),s.lineTo(9.29,37.73),s.lineTo(0,41.42),s.lineTo(2.95,54.24),s.lineTo(13.41,52.92),s.lineTo(17.39,58.52),s.lineTo(13.56,67.66),s.lineTo(24.47,74.44),s.lineTo(30.81,66.33),s.lineTo(37.88,67.21),s.lineTo(41.57,76.5),s.lineTo(54.24,73.55),s.lineTo(53.06,62.94),s.lineTo(58.52,58.52),s.lineTo(67.21,63.09),s.lineTo(74.58,51.88),s.lineTo(66.03,45.25),s.lineTo(66.92,38.62),s.lineTo(76.5,34.93),s.lineTo(73.7,22.26),s.lineTo(62.64,23.44),s.lineTo(58.81,18.42),s.lineTo(62.79,8.7),s.lineTo(51.74,2.21),s.lineTo(44.81,10.47),s.lineTo(38.03,9.43),s.lineTo(33.75,0),s.lineTo(21.52,3.24),s.lineTo(22.7,13.56),s.lineTo(18.13,17.54),s.lineTo(8.7,13.56),s.close(),re(s,24.8,39)}function zt(s){s.begin(),s.moveTo(16.46,41.42),s.lineTo(24.57,47.75),s.lineTo(23.69,54.53),s.lineTo(14.4,58.22),s.lineTo(17.35,71.04),s.lineTo(27.81,69.72),s.lineTo(31.79,75.32),s.lineTo(27.96,84.46),s.lineTo(38.87,91.24),s.lineTo(45.21,83.13),s.lineTo(52.28,84.01),s.lineTo(55.97,93.3),s.lineTo(68.64,90.35),s.lineTo(67.46,79.74),s.lineTo(72.92,75.32),s.lineTo(81.61,79.89),s.lineTo(88.98,68.68),s.lineTo(80.43,62.05),s.lineTo(81.32,55.42),s.lineTo(90.9,51.73),s.lineTo(88.1,39.06),s.lineTo(77.04,40.24),s.lineTo(73.21,35.22),s.lineTo(77.19,25.5),s.lineTo(66.14,19.01),s.lineTo(59.21,27.27),s.lineTo(52.43,26.23),s.lineTo(48.15,16.8),s.lineTo(35.92,20.04),s.lineTo(37.1,30.36),s.lineTo(32.53,34.34),s.lineTo(23.1,30.36),s.close();const t=39.2,e=55.8;re(s,t,e),s.begin(),re(s,t,e)}function re(s,t,e){s.moveTo(t,e),s.arcTo(13.5,13.5,0,1,1,t+2*13.5,e),s.arcTo(13.5,13.5,0,0,1,t,e),s.close(),s.fillAndStroke()}const Xt=[S.LOOP,S.MULTI_INSTANCE_PARALLEL,S.MULTI_INSTANCE_SEQUENTIAL,S.COMPENSATION,S.EXPAND,S.ADHOC];function Zt(s){const t=Xt.filter(e=>s.includes(e));for(const e of s.filter(n=>!t.includes(n)))t.push(e);return t}function jt(s,t){return s===1?e=>e.setIconOriginForIconBottomCentered():e=>{e.setIconOriginForIconBottomCentered();const n=Math.pow(-1,t)*(T.SHAPE_ACTIVITY_MARKER_ICON_SIZE+T.SHAPE_ACTIVITY_MARKER_ICON_MARGIN)/2;e.translateIconOrigin(n,0)}}class ue extends he{iconPainter=void 0;markerPainterFunctions=new Map([[S.EXPAND,t=>this.iconPainter.paintExpandIcon(t)],[S.LOOP,t=>this.iconPainter.paintLoopIcon(t)],[S.MULTI_INSTANCE_PARALLEL,t=>this.iconPainter.paintParallelMultiInstanceIcon(t)],[S.MULTI_INSTANCE_SEQUENTIAL,t=>this.iconPainter.paintSequentialMultiInstanceIcon(t)]]);constructor(){super(void 0,void 0,void 0)}paintForeground(t,e,n,i,o){super.paintForeground(t,e,n,i,o),this.paintMarkerIcons(b({canvas:t,x:e,y:n,width:i,height:o,shape:this,ratioFromParent:0,iconStrokeWidth:1.5}))}paintMarkerIcons(t){const e=p.getValue(this.style,g.MARKERS,void 0);if(e){const n=Zt(e.split(","));for(const[i,o]of n.entries())t={...t,setIconOriginFunct:jt(n.length,i+1)},t.canvas.save(),this.markerPainterFunctions.get(o)?.(t),t.canvas.restore()}}paintEnvelopeIcon(t,e){this.iconPainter.paintEnvelopeIcon({...t,setIconOriginFunct:n=>n.setIconOriginToShapeTopLeft(),ratioFromParent:.2,iconStyleConfig:{...t.iconStyleConfig,isFilled:e}})}}class R extends ue{paintForeground(t,e,n,i,o){super.paintForeground(t,e,n,i,o),this.paintTaskIcon(b({canvas:t,x:e,y:n,width:i,height:o,shape:this}))}}class qt extends R{paintTaskIcon(t){}}class $t extends R{paintTaskIcon(t){this.iconPainter.paintGearIcon({...t,setIconOriginFunct:e=>e.setIconOriginToShapeTopLeftProportionally(20)})}}class Qt extends R{paintTaskIcon(t){this.iconPainter.paintPersonIcon({...t,setIconOriginFunct:e=>e.setIconOriginToShapeTopLeftProportionally(20)})}}class Jt extends R{paintTaskIcon(t){if(!Ve(this.style)){this.paintEnvelopeIcon(t,!1);return}const e=4,n=4,i={...t.shapeConfig,width:20,height:20};this.iconPainter.paintCircleIcon({canvas:t.canvas,shapeConfig:i,iconStyleConfig:{...t.iconStyleConfig,isFilled:!1},ratioFromParent:void 0,setIconOriginFunct:o=>o.setIconOriginToShapeTopLeft(n,e)}),i.x+=e,i.y+=n,this.iconPainter.paintEnvelopeIcon({...t,shapeConfig:i,ratioFromParent:.65,setIconOriginFunct:o=>o.setIconOriginForIconCentered()})}}class es extends R{paintTaskIcon(t){this.paintEnvelopeIcon(t,!0)}}class ts extends R{paintTaskIcon(t){this.iconPainter.paintHandIcon({...t,ratioFromParent:.18,setIconOriginFunct:e=>e.setIconOriginToShapeTopLeftProportionally(20)})}}class ss extends R{paintTaskIcon(t){this.iconPainter.paintScriptIcon({...t,ratioFromParent:.22,setIconOriginFunct:e=>e.setIconOriginToShapeTopLeftProportionally(20)})}}class ns extends ue{paintForeground(t,e,n,i,o){super.paintForeground(t,e,n,i,o);const a=b({canvas:t,x:e,y:n,width:i,height:o,shape:this});switch(p.getValue(this.style,g.GLOBAL_TASK_KIND,void 0)){case c.GLOBAL_TASK_MANUAL:{this.iconPainter.paintHandIcon({...a,ratioFromParent:.18,setIconOriginFunct:l=>l.setIconOriginToShapeTopLeftProportionally(20)});break}case c.GLOBAL_TASK_SCRIPT:{this.iconPainter.paintScriptIcon({...a,ratioFromParent:.22,setIconOriginFunct:l=>l.setIconOriginToShapeTopLeftProportionally(20)});break}case c.GLOBAL_TASK_USER:{this.iconPainter.paintPersonIcon({...a,setIconOriginFunct:l=>l.setIconOriginToShapeTopLeftProportionally(20)});break}case c.GLOBAL_TASK_BUSINESS_RULE:{this.iconPainter.paintTableIcon({...a,ratioFromParent:.6,setIconOriginFunct:l=>l.setIconOriginToShapeTopLeftProportionally(15)});break}}}}class is extends ue{paintBackground(t,e,n,i,o){const a=p.getValue(this.style,g.SUB_PROCESS_KIND,void 0);if(t.save(),a===m.EVENT&&(t.setDashed(!0,!1),t.setDashPattern("1 2")),super.paintBackground(t,e,n,i,o),a===m.TRANSACTION){const l=T.SUB_PROCESS_TRANSACTION_INNER_RECT_OFFSET,h=T.SUB_PROCESS_TRANSACTION_INNER_RECT_ARC_SIZE;t.roundrect(e+l,n+l,i-2*l,o-2*l,h,h),t.stroke()}t.restore()}}class os extends R{paintTaskIcon(t){this.iconPainter.paintTableIcon({...t,ratioFromParent:.6,setIconOriginFunct:e=>e.setIconOriginToShapeTopLeftProportionally(15)})}}class rs extends ot{paintEdgeShape(t,e){const n=this.createMarker(t,e,!0),i=this.createMarker(t,e,!1);this.paintEdgeLine(t,e),t.setShadow(!1),t.setDashed(!1,!1),n!=null&&(t.setFillColor(p.getValue(this.style,g.EDGE_START_FILL_COLOR,this.stroke)),n()),i!=null&&(t.setFillColor(p.getValue(this.style,g.EDGE_END_FILL_COLOR,this.stroke)),i())}paintEdgeLine(t,e){const n=as(t);Oe(t,"stroke"),this.paintLine(t,e,this.isRounded),Oe(t,n)}}function as(s){return s instanceof Me?s.pointerEventsValue:null}function Oe(s,t){s instanceof Me&&(s.pointerEventsValue=t)}class de extends at{iconPainter=void 0;iconPainters=new Map([[I.MESSAGE,t=>this.iconPainter.paintEnvelopeIcon({...t,ratioFromParent:.5})],[I.TERMINATE,t=>this.iconPainter.paintCircleIcon({...t,ratioFromParent:.6})],[I.TIMER,t=>this.iconPainter.paintClockIcon({...t,setIconOriginFunct:e=>e.setIconOriginToShapeTopLeftProportionally(5)})],[I.SIGNAL,t=>this.iconPainter.paintTriangleIcon({...t,ratioFromParent:.55,iconStyleConfig:{...t.iconStyleConfig,strokeWidth:T.STROKE_WIDTH_THIN.valueOf()},setIconOriginFunct:e=>e.setIconOriginToShapeTopLeftProportionally(4)})],[I.LINK,t=>this.iconPainter.paintRightArrowIcon({...t,ratioFromParent:.55,iconStyleConfig:{...t.iconStyleConfig,strokeWidth:1.5}})],[I.ERROR,t=>this.iconPainter.paintErrorIcon({...t,ratioFromParent:.55,iconStyleConfig:{...t.iconStyleConfig,strokeWidth:1.5}})],[I.COMPENSATION,t=>this.iconPainter.paintDoubleLeftArrowheadsIcon({...t,ratioFromParent:.7,iconStyleConfig:{...t.iconStyleConfig,strokeWidth:1.5}})],[I.CANCEL,t=>this.iconPainter.paintXCrossIcon({...t,ratioFromParent:.78})],[I.ESCALATION,t=>this.iconPainter.paintUpArrowheadIcon({...t,ratioFromParent:.55,iconStyleConfig:{...t.iconStyleConfig,strokeWidth:T.STROKE_WIDTH_THIN.valueOf()}})],[I.CONDITIONAL,t=>this.iconPainter.paintListIcon({...t,ratioFromParent:.6,iconStyleConfig:{...t.iconStyleConfig,strokeWidth:1.5}})]]);withFilledIcon=!1;constructor(){super(void 0,void 0,void 0)}paintVertexShape(t,e,n,i,o){const a=b({canvas:t,x:e,y:n,width:i,height:o,shape:this,isFilled:this.withFilledIcon});ls(a,p.getValue(this.style,g.IS_INTERRUPTING,void 0)),this.paintOuterShape(a),cs(a),this.paintInnerShape(a)}paintOuterShape({canvas:t,shapeConfig:{x:e,y:n,width:i,height:o}}){super.paintVertexShape(t,e,n,i,o)}paintInnerShape(t){this.iconPainters.get(p.getValue(this.style,g.EVENT_DEFINITION_KIND,I.NONE))?.(t)}}function ls(s,t){s.canvas.save(),t==="false"&&(s.canvas.setDashed(!0,!1),s.canvas.setDashPattern("3 2"))}function cs(s){s.canvas.restore()}class hs extends de{constructor(){super(),this.withFilledIcon=!0}}class ae extends de{paintOuterShape({canvas:t,shapeConfig:{x:e,y:n,width:i,height:o,strokeWidth:a}}){t.ellipse(e,n,i,o),t.fillAndStroke();const l=a*1.5;t.ellipse(i*.02+l+e,o*.02+l+n,i*.96-2*l,o*.96-2*l),t.stroke()}}class Ts extends ae{constructor(){super(),this.withFilledIcon=!0}}class us extends he{iconPainter=void 0;paintVertexShape(t,e,n,i,o){const a=b({canvas:t,x:e,y:n,width:i,height:o,shape:this,ratioFromParent:1,isFilled:p.getValue(this.style,g.IS_INITIATING,"true")=="false"});this.iconPainter.paintEnvelopeIcon(a)}}class V extends Tt{iconPainter=void 0;paintVertexShape(t,e,n,i,o){const a=b({canvas:t,x:e,y:n,width:i,height:o,shape:this});this.paintOuterShape(a),this.paintInnerShape(a)}paintOuterShape({canvas:t,shapeConfig:{x:e,y:n,width:i,height:o}}){super.paintVertexShape(t,e,n,i,o)}}class ds extends V{paintInnerShape(t){this.iconPainter.paintXCrossIcon({...t,iconStyleConfig:{...t.iconStyleConfig,isFilled:!0},ratioFromParent:.5})}}class gs extends V{paintInnerShape(t){this.iconPainter.paintPlusCrossIcon({...t,iconStyleConfig:{...t.iconStyleConfig,isFilled:!0},ratioFromParent:.5})}}class Es extends V{paintInnerShape(t){this.iconPainter.paintCircleIcon({...t,ratioFromParent:.62,iconStyleConfig:{...t.iconStyleConfig,isFilled:!1,strokeWidth:T.STROKE_WIDTH_THICK.valueOf()}})}}class fs extends V{paintInnerShape(t){this.iconPainter.paintAsteriskIcon({...t,iconStyleConfig:{...t.iconStyleConfig,isFilled:!0},ratioFromParent:.5})}}class ps extends V{paintInnerShape(t){t={...t,iconStyleConfig:{...t.iconStyleConfig,strokeWidth:1}},this.iconPainter.paintCircleIcon({...t,ratioFromParent:.55}),Ve(this.style)||this.iconPainter.paintCircleIcon({...t,ratioFromParent:.45});const e={...t,ratioFromParent:.3};p.getValue(this.style,g.EVENT_BASED_GATEWAY_KIND,x.Exclusive)==x.Parallel?this.iconPainter.paintPlusCrossIcon(e):this.iconPainter.paintPentagon(e)}}class Ss extends he{paintForeground(t,e,n,i,o){t.begin(),t.moveTo(e+T.TEXT_ANNOTATION_BORDER_LENGTH,n),t.lineTo(e,n),t.lineTo(e,n+o),t.lineTo(e+T.TEXT_ANNOTATION_BORDER_LENGTH,n+o),t.stroke()}paintBackground(t,e,n,i,o){t.save(),t.setStrokeColor("none"),super.paintBackground(t,e,n,i,o),t.restore()}}const Is=()=>{const s=[[c.EVENT_END,hs],[c.EVENT_START,de],[c.EVENT_INTERMEDIATE_THROW,Ts],[c.EVENT_INTERMEDIATE_CATCH,ae],[c.EVENT_BOUNDARY,ae],[c.GATEWAY_COMPLEX,fs],[c.GATEWAY_EVENT_BASED,ps],[c.GATEWAY_EXCLUSIVE,ds],[c.GATEWAY_INCLUSIVE,Es],[c.GATEWAY_PARALLEL,gs],[c.SUB_PROCESS,is],[c.CALL_ACTIVITY,ns],[c.TASK,qt],[c.TASK_SERVICE,$t],[c.TASK_USER,Qt],[c.TASK_RECEIVE,Jt],[c.TASK_SEND,es],[c.TASK_MANUAL,ts],[c.TASK_SCRIPT,ss],[c.TASK_BUSINESS_RULE,os],[c.TEXT_ANNOTATION,Ss],[g.EDGE,rs],[g.MESSAGE_FLOW_ICON,us]];for(const[t,e]of s)Be.registerShape(t,e)},Ls=(s,t,e,n,i,o,a,l,h)=>{const E=i*(a+h+4),f=o*(a+h+4);return function(){s.begin(),s.moveTo(n.x-E/2-f/2,n.y-f/2+E/2),s.lineTo(n.x+f/2-3*E/2,n.y-3*f/2-E/2),s.stroke()}},As=()=>{ht.addMarker(Ge.ARROW_DASH,Ls)},Ue=12;class ge extends Map{get(t){return super.get(t)??(()=>{})}}const Cs=new ge([[v.SEQUENCE_FLOW,s=>{s[r.STYLE_ENDARROW]=r.ARROW_BLOCK_THIN}],[v.MESSAGE_FLOW,s=>{s[r.STYLE_DASHED]=!0,s[r.STYLE_DASH_PATTERN]="8 5",s[r.STYLE_STARTARROW]=r.ARROW_OVAL,s[r.STYLE_STARTSIZE]=8,s[r.STYLE_STARTFILL]=!0,s[g.EDGE_START_FILL_COLOR]=T.MESSAGE_FLOW_MARKER_START_FILL_COLOR,s[r.STYLE_ENDARROW]=r.ARROW_BLOCK_THIN,s[r.STYLE_ENDFILL]=!0,s[g.EDGE_END_FILL_COLOR]=T.MESSAGE_FLOW_MARKER_END_FILL_COLOR}],[v.ASSOCIATION_FLOW,s=>{s[r.STYLE_DASHED]=!0,s[r.STYLE_DASH_PATTERN]="1 2",s[r.STYLE_STARTSIZE]=Ue}]]),Os=new ge([[_.DEFAULT,s=>{s[r.STYLE_STARTARROW]=Ge.ARROW_DASH}],[_.CONDITIONAL_FROM_ACTIVITY,s=>{s[r.STYLE_STARTARROW]=r.ARROW_DIAMOND_THIN,s[r.STYLE_STARTSIZE]=18,s[r.STYLE_STARTFILL]=!0,s[g.EDGE_START_FILL_COLOR]=T.SEQUENCE_FLOW_CONDITIONAL_FROM_ACTIVITY_MARKER_FILL_COLOR}]]),_s=new ge([[P.NONE,s=>{}],[P.ONE,s=>{s[r.STYLE_ENDARROW]=r.ARROW_OPEN_THIN}],[P.BOTH,s=>{s[r.STYLE_STARTARROW]=r.ARROW_OPEN_THIN,s[r.STYLE_ENDARROW]=r.ARROW_OPEN_THIN}]]);class vs{constructor(t){this.graph=t}graph;configureStyles(){this.configureDefaultVertexStyle(),this.configurePoolStyle(),this.configureLaneStyle(),this.configureTextAnnotationStyle(),this.configureGroupStyle(),this.configureActivityStyles(),this.configureEventStyles(),this.configureGatewayStyles(),this.configureDefaultEdgeStyle(),this.configureFlowStyles()}getStylesheet(){return this.graph.getStylesheet()}putCellStyle(t,e){this.getStylesheet().putCellStyle(t,e)}configureDefaultVertexStyle(){const t=this.getStylesheet().getDefaultVertexStyle();_e(t),t[r.STYLE_ABSOLUTE_ARCSIZE]=!0,t[r.STYLE_ARCSIZE]=T.SHAPE_ARC_SIZE}configurePoolStyle(){const t={};t[r.STYLE_SHAPE]=r.SHAPE_SWIMLANE,t[r.STYLE_VERTICAL_ALIGN]=r.ALIGN_MIDDLE,t[r.STYLE_ALIGN]=r.ALIGN_CENTER,t[r.STYLE_STARTSIZE]=T.POOL_LABEL_SIZE,t[r.STYLE_FILLCOLOR]=T.POOL_LABEL_FILL_COLOR,this.graph.getStylesheet().putCellStyle(c.POOL,t)}configureLaneStyle(){const t={};t[r.STYLE_SHAPE]=r.SHAPE_SWIMLANE,t[r.STYLE_VERTICAL_ALIGN]=r.ALIGN_MIDDLE,t[r.STYLE_ALIGN]=r.ALIGN_CENTER,t[r.STYLE_SWIMLANE_LINE]=0,t[r.STYLE_STARTSIZE]=T.LANE_LABEL_SIZE,t[r.STYLE_FILLCOLOR]=T.LANE_LABEL_FILL_COLOR,this.graph.getStylesheet().putCellStyle(c.LANE,t)}configureEventStyles(){for(const t of u.eventKinds()){const e={};e[r.STYLE_SHAPE]=t,e[r.STYLE_PERIMETER]=Se.EllipsePerimeter,e[r.STYLE_STROKEWIDTH]=t==c.EVENT_END?T.STROKE_WIDTH_THICK:T.STROKE_WIDTH_THIN,e[r.STYLE_VERTICAL_LABEL_POSITION]=r.ALIGN_BOTTOM,this.putCellStyle(t,e)}}configureTextAnnotationStyle(){const t={};t[r.STYLE_SHAPE]=c.TEXT_ANNOTATION,t[r.STYLE_VERTICAL_ALIGN]=r.ALIGN_MIDDLE,t[r.STYLE_ALIGN]=r.ALIGN_LEFT,t[r.STYLE_SPACING_LEFT]=5,t[r.STYLE_FILLCOLOR]=T.TEXT_ANNOTATION_FILL_COLOR,t[r.STYLE_STROKEWIDTH]=T.STROKE_WIDTH_THIN,this.putCellStyle(c.TEXT_ANNOTATION,t)}configureGroupStyle(){const t={};t[r.STYLE_ROUNDED]=!0,t[r.STYLE_DASHED]=!0,t[r.STYLE_DASH_PATTERN]="7 4 1 4",t[r.STYLE_STROKEWIDTH]=T.STROKE_WIDTH_THIN,t[r.STYLE_FILLCOLOR]=T.GROUP_FILL_COLOR,t[r.STYLE_ALIGN]=r.ALIGN_CENTER,t[r.STYLE_VERTICAL_ALIGN]=r.ALIGN_TOP,this.putCellStyle(c.GROUP,t)}configureActivityStyles(){for(const t of u.activityKinds()){const e={};e[r.STYLE_SHAPE]=t,e[r.STYLE_ROUNDED]=!0,e[r.STYLE_VERTICAL_ALIGN]=r.ALIGN_MIDDLE,e[r.STYLE_STROKEWIDTH]=t==c.CALL_ACTIVITY?T.STROKE_WIDTH_THICK:T.STROKE_WIDTH_THIN,this.putCellStyle(t,e)}}configureGatewayStyles(){for(const t of u.gatewayKinds()){const e={};e[r.STYLE_SHAPE]=t,e[r.STYLE_PERIMETER]=Se.RhombusPerimeter,e[r.STYLE_STROKEWIDTH]=T.STROKE_WIDTH_THIN,e[r.STYLE_VERTICAL_ALIGN]=r.ALIGN_TOP,e[r.STYLE_LABEL_POSITION]=r.ALIGN_LEFT,e[r.STYLE_VERTICAL_LABEL_POSITION]=r.ALIGN_TOP,this.putCellStyle(t,e)}}configureDefaultEdgeStyle(){const t=this.getStylesheet().getDefaultEdgeStyle();_e(t),t[r.STYLE_SHAPE]=g.EDGE,t[r.STYLE_ENDSIZE]=Ue,t[r.STYLE_STROKEWIDTH]=1.5,t[r.STYLE_ROUNDED]=!0,t[r.STYLE_ARCSIZE]=5,t[r.STYLE_VERTICAL_ALIGN]=r.ALIGN_BOTTOM,delete t[r.STYLE_ENDARROW]}configureEdgeStyles(t,e){for(const n of t){const i={};e.get(n)(i),this.graph.getStylesheet().putCellStyle(n.toString(),i)}}configureFlowStyles(){this.configureEdgeStyles(Object.values(v),Cs),this.configureEdgeStyles(Object.values(_),Os),this.configureEdgeStyles(Object.values(P),_s)}}function _e(s){s[r.STYLE_FONTFAMILY]=T.DEFAULT_FONT_FAMILY,s[r.STYLE_FONTSIZE]=T.DEFAULT_FONT_SIZE,s[r.STYLE_FONTCOLOR]=T.DEFAULT_FONT_COLOR,s[r.STYLE_FILLCOLOR]=T.DEFAULT_FILL_COLOR,s[r.STYLE_STROKECOLOR]=T.DEFAULT_STROKE_COLOR,s[r.STYLE_LABEL_BACKGROUNDCOLOR]=r.NONE,s[r.STYLE_WHITE_SPACE]="wrap"}function ms(s,t){return new Ns(new Gt(s,t?.iconPainter??new Ht)).configure()}class Ns{constructor(t){this.graph=t}graph;configure(){return this.configureGraph(),new vs(this.graph).configureStyles(),Is(),As(),this.graph}configureGraph(){this.graph.setCellsLocked(!0),this.graph.setCellsSelectable(!1),this.graph.setEdgeLabelsMovable(!1),this.graph.setHtmlLabels(!0),this.graph.setConstrainChildren(!1),this.graph.setExtendParents(!1),this.graph.foldingEnabled=!1}}class ys{constructor(t,e){this.graph=t,this.zoomSupport=e}graph;zoomSupport;fit(t){this.zoomSupport.fit(t)}zoom(t){t=="in"?this.zoomSupport.zoomIn():this.zoomSupport.zoomOut()}dispose(){this.zoomSupport.dispose(),this.graph.panningHandler.destroy()}configure(t){const e=this.graph.panningHandler;t?.enabled?(e.addListener(N.PAN_START,ve(this.graph,"grab")),e.addListener(N.PAN_END,ve(this.graph,"default")),e.usePopupTrigger=!1,e.isForcePanningEvent=n=>N.isLeftMouseButton(n.getEvent())||N.isMultiTouchEvent(n.getEvent()),this.graph.setPanning(!0),this.zoomSupport.registerMouseWheelZoomListeners(t?.zoom)):(this.graph.setPanning(!1),e.setPinchEnabled(!1),e.isForcePanningEvent=n=>!1)}}function ve(s,t){return()=>{s.container.style.cursor=t}}function Rs(s,t){const e=new ys(s,new Fs(s));return e.configure(t),e}const le=1.25,ws=1/le;class Fs{constructor(t){this.graph=t,this.graph.zoomFactor=le}graph;currentZoomLevel=1;mouseWheelListeners=[];graphFit(t,e,n,i,o,a,l){const h=this.graph.fit(t,e,n,i,o,a,l);return this.setCurrentZoomLevel(h),h}setCurrentZoomLevel(t){this.currentZoomLevel=t??this.graph.view.scale}zoomActual(){this.graph.zoomActual(),this.setCurrentZoomLevel()}zoomIn(){this.graph.zoomIn(),this.setCurrentZoomLevel()}zoomOut(){this.graph.zoomOut(),this.setCurrentZoomLevel()}fit(t){this.zoomActual();const e=t?.type;if(e==null||e==M.None)return;const n=pt(t?.margin);if(e==M.Center){const o=this.graph.getGraphBounds(),a=this.graph.container.clientWidth-n,l=this.graph.container.clientHeight-n,h=o.width/this.graph.view.scale,E=o.height/this.graph.view.scale,f=Math.min(3,Math.min(a/h,l/E));this.setCurrentZoomLevel(f),this.graph.view.scaleAndTranslate(f,(n+a-h*f)/(2*f)-o.x/this.graph.view.scale,(n+l-E*f)/(2*f)-o.y/this.graph.view.scale)}else{let i=!1,o=!1;switch(e){case M.Horizontal:{o=!0;break}case M.Vertical:{i=!0;break}}this.graphFit(this.graph.border,!1,n,!0,i,o)}}registerMouseWheelZoomListeners(t){t=St(t),this.addMouseWheelListener(Ze(this.createMouseWheelZoomListener(!0),t.debounceDelay)),this.addMouseWheelListener(je(this.createMouseWheelZoomListener(!1),t.throttleDelay))}addMouseWheelListener(t){N.addMouseWheelListener(t,this.graph.container),this.mouseWheelListeners.push(t)}dispose(){if(this.graph.container)for(const t of this.mouseWheelListeners)N.removeListener(this.graph.container,"wheel",t);this.mouseWheelListeners=[]}createMouseWheelZoomListener(t){return(e,n)=>{if(N.isConsumed(e)||!(e instanceof MouseEvent))return;if(e.ctrlKey&&!e.altKey&&!e.shiftKey&&!e.metaKey)if(t){const[o,a]=this.getEventRelativeCoordinates(e),[l,h,E]=this.getScaleAndTranslationDeltas(o,a);this.graph.view.scaleAndTranslate(l,this.graph.view.translate.x+h,this.graph.view.translate.y+E),N.consume(e)}else this.currentZoomLevel*=n?le:ws}}getEventRelativeCoordinates(t){const e=this.graph.container.getBoundingClientRect(),n=t.clientX-e.left,i=t.clientY-e.top;return[n,i]}getScaleAndTranslationDeltas(t,e){const[n,i]=this.calculateFactorAndScale(),[o,a]=this.calculateTranslationDeltas(n,i,t*2,e*2);return[i,o,a]}calculateTranslationDeltas(t,e,n,i){if(t>1){const o=(t-1)/(e*2);n*=-o,i*=-o}else{const o=(1/t-1)/(this.graph.view.scale*2);n*=o,i*=o}return[n,i]}calculateFactorAndScale(){const t=Math.round(this.currentZoomLevel*100)/100;return[t/this.graph.view.scale,t]}}class Ps{constructor(t){this.convertedElements=t}convertedElements;deserialize(t){const e=d(t.category).flatMap(n=>d(n.categoryValue));for(const n of e)this.convertedElements.registerCategoryValue(n.id,n.value)}}class D{}class bs{constructor(t){this.options=t}options;warning(t){if(this.options?.disableConsoleLog)return;const e=t.getMessage();console.warn(`[bv-parser] ${e.template}`,...e.arguments)}}class Ds extends D{constructor(t,e){super(),this.groupBpmnElementId=t,this.categoryValueReference=e}groupBpmnElementId;categoryValueReference;getMessage(){return{arguments:[this.categoryValueReference,this.groupBpmnElementId],template:"Group json deserialization: unable to find category value ref %s for bpmn element %s"}}}class Bs extends D{constructor(t){super(),this.bpmnElementId=t}bpmnElementId;getMessage(){return{arguments:[this.bpmnElementId],template:"Shape json deserialization: unable to find bpmn element with id %s"}}}class Ms extends D{constructor(t){super(),this.bpmnElementId=t}bpmnElementId;getMessage(){return{arguments:[this.bpmnElementId],template:"Edge json deserialization: unable to find bpmn element with id %s"}}}class ks extends D{constructor(t,e){super(),this.shapeOrEdgeId=t,this.labelStyleId=e}shapeOrEdgeId;labelStyleId;getMessage(){return{arguments:[this.labelStyleId,this.shapeOrEdgeId],template:"Unable to assign font from style %s to shape/edge %s"}}}class xs extends D{constructor(t,e){super(),this.laneId=t,this.flowNodeReference=e}laneId;flowNodeReference;getMessage(){return{arguments:[this.flowNodeReference,this.laneId],template:"Unable to assign lane %s as parent: flow node %s is not found"}}}class Ys extends D{constructor(t,e,n){super(),this.bpmnElementId=t,this.attachedToReference=e,this.attachedToKind=n}bpmnElementId;attachedToReference;attachedToKind;getMessage(){return{arguments:[this.bpmnElementId,this.attachedToReference,this.attachedToKind],template:"The boundary event %s must be attached to an activity, and not to %s of kind %s"}}}class Gs{getFlows(){return[...this.messageFlows.values(),...this.sequenceFlows.values(),...this.associationFlows.values()]}poolsById=new Map;findPoolById(t){return this.poolsById.get(t)}poolsByProcessRef=new Map;findPoolByProcessRef(t){return this.poolsByProcessRef.get(t)}registerPool(t,e){this.poolsById.set(t.id,t),e&&this.poolsByProcessRef.set(e,t)}messageFlows=new Map;findMessageFlow(t){return this.messageFlows.get(t)}registerMessageFlow(t){this.messageFlows.set(t.id,t)}flowNodes=new Map;findFlowNode(t){return this.flowNodes.get(t)}registerFlowNode(t){this.flowNodes.set(t.id,t)}lanes=new Map;findLane(t){return this.lanes.get(t)}registerLane(t){this.lanes.set(t.id,t)}sequenceFlows=new Map;findSequenceFlow(t){return this.sequenceFlows.get(t)}registerSequenceFlow(t){this.sequenceFlows.set(t.id,t)}associationFlows=new Map;findAssociationFlow(t){return this.associationFlows.get(t)}registerAssociationFlow(t){this.associationFlows.set(t.id,t)}eventDefinitionsOfDefinitions=new Map;findEventDefinitionOfDefinition(t){return this.eventDefinitionsOfDefinitions.get(t)}registerEventDefinitionsOfDefinition(t,e){this.eventDefinitionsOfDefinitions.set(t,e)}globalTasks=new Map;findGlobalTask(t){return this.globalTasks.get(t)}registerGlobalTask(t,e){this.globalTasks.set(t,e)}categoryValues=new Map;findCategoryValue(t){return this.categoryValues.get(t)}registerCategoryValue(t,e){this.categoryValues.set(t,{value:e})}}const He=(s,t,e,n)=>{const i=s.findCategoryValue(e.categoryValueRef);if(i)return new O(e.id,i.value,c.GROUP,n);t.warning(new Ds(e.id,e.categoryValueRef))},Ke=(s,t)=>{for(const e of d(t)){const n=e.associationDirection;s.registerAssociationFlow(new be(e.id,void 0,e.sourceRef,e.targetRef,n))}};class Vs{constructor(t,e){this.convertedElements=t,this.parsingMessageCollector=e}convertedElements;parsingMessageCollector;deserialize(t){for(const e of d(t))this.parseCollaboration(e)}parseCollaboration(t){this.buildParticipant(t.participant),this.buildMessageFlows(t.messageFlow),Ke(this.convertedElements,t.association),this.buildGroups(t.group),this.buildTextAnnotation(t.textAnnotation)}buildParticipant(t){for(const e of d(t))this.convertedElements.registerPool(new O(e.id,e.name,c.POOL),e.processRef)}buildMessageFlows(t){for(const e of d(t))this.convertedElements.registerMessageFlow(new Pe(e.id,e.name,e.sourceRef,e.targetRef))}buildGroups(t){for(const e of d(t)){const n=He(this.convertedElements,this.parsingMessageCollector,e);n&&this.convertedElements.registerFlowNode(n)}}buildTextAnnotation(t){for(const e of d(t))this.convertedElements.registerFlowNode(new O(e.id,e.text,c.TEXT_ANNOTATION))}}class Ws{constructor(t,e,n,i){this.x=t,this.y=e,this.width=n,this.height=i}x;y;width;height}class Us{constructor(t,e,n,i,o=Y.NONE){this.id=t,this.bpmnElement=e,this.waypoints=n,this.label=i,this.messageVisibleKind=o}id;bpmnElement;waypoints;label;messageVisibleKind;extensions={}}class Hs{constructor(t,e){this.x=t,this.y=e}x;y}class Ks{constructor(t,e){this.font=t,this.bounds=e}font;bounds;extensions={}}class zs{constructor(t,e,n,i,o,a){this.name=t,this.size=e,this.isBold=n,this.isItalic=i,this.isUnderline=o,this.isStrikeThrough=a}name;size;isBold;isItalic;isUnderline;isStrikeThrough}function Xs(s,t){const e=t["background-color"]??t.fill;e&&(s.extensions.fillColor=e);const n=t["border-color"]??t.stroke;n&&(s.extensions.strokeColor=n)}function me(s,t){s&&t&&typeof t=="object"&&t.color&&(s.extensions.color=t.color)}function Zs(s,t){const e=t["border-color"]??t.stroke;e&&(s.extensions.strokeColor=e)}const js={onShapeDeserialized(s,t){Xs(s,t),me(s.label,t.BPMNLabel)},onEdgeDeserialized(s,t){Zs(s,t),me(s.label,t.BPMNLabel)},hasLabelExtensionData(s){return typeof s=="object"&&s!==null&&"color"in s}};class qs{constructor(t,e){this.convertedElements=t,this.parsingMessageCollector=e}convertedElements;parsingMessageCollector;parsingExtensions=[js];convertedFonts=new Map;deserialize(t){const e=[],n=[],i=[],o=[],a=d(t)[0];if(a){this.deserializeFonts(a.BPMNLabelStyle);const l=a.BPMNPlane,h=this.deserializeEdges(l.BPMNEdge),E=this.deserializeShapes(l.BPMNShape);e.push(...E.flowNodes),n.push(...E.lanes),i.push(...E.pools),o.push(...h)}return{flowNodes:e,lanes:n,pools:i,edges:o}}deserializeFonts(t){for(const e of d(t))for(const n of d(e.Font))this.convertedFonts.set(e.id,new zs(n.name,n.size,n.isBold,n.isItalic,n.isUnderline,n.isStrikeThrough))}deserializeShapes(t){const e={flowNodes:[],lanes:[],pools:[]};for(const n of d(t))this.deserializeShapeAndStoreIfFound(n,e.flowNodes,i=>this.convertedElements.findFlowNode(i))||this.deserializeShapeAndStoreIfFound(n,e.lanes,i=>this.convertedElements.findLane(i))||this.deserializeShapeAndStoreIfFound(n,e.pools,i=>this.convertedElements.findPoolById(i))||this.parsingMessageCollector.warning(new Bs(n.bpmnElement));return e}deserializeShapeAndStoreIfFound(t,e,n){const i=this.deserializeShape(t,n);return i?(e.push(i),!0):!1}deserializeShape(t,e){const n=e(t.bpmnElement);if(n){const i=Ne(t);(n instanceof G||n instanceof w&&n.callActivityKind===k.CALLING_PROCESS)&&!t.isExpanded&&n.markers.push(S.EXPAND);let o;u.isPoolOrLane(n.kind)&&(o=t.isHorizontal??!0);const a=t.BPMNLabel,l=this.deserializeLabel(a,t.id),h=new K(t.id,n,i,l,o);for(const E of this.parsingExtensions)E.onShapeDeserialized?.(h,t);return h}}deserializeEdges(t){return d(t).map(e=>{const n=this.convertedElements.findSequenceFlow(e.bpmnElement)||this.convertedElements.findMessageFlow(e.bpmnElement)||this.convertedElements.findAssociationFlow(e.bpmnElement);if(!n){this.parsingMessageCollector.warning(new Ms(e.bpmnElement));return}const i=this.deserializeWaypoints(e.waypoint),o=this.deserializeLabel(e.BPMNLabel,e.id),a=e.messageVisibleKind?e.messageVisibleKind:Y.NONE,l=new Us(e.id,n,i,o,a);for(const h of this.parsingExtensions)h.onEdgeDeserialized?.(l,e);return l}).filter(Boolean)}deserializeWaypoints(t){return d(t).map(e=>new Hs(e.x,e.y))}deserializeLabel(t,e){if(t&&typeof t=="object"){const n=this.findFont(t.labelStyle,e),i=Ne(t),o=this.parsingExtensions.some(a=>a.hasLabelExtensionData?.(t));if(n||i||o)return new Ks(n,i)}}findFont(t,e){let n;return t&&(n=this.convertedFonts.get(t),n||this.parsingMessageCollector.warning(new ks(e,t))),n}}function Ne(s){const t=s.Bounds;if(t)return new Ws(t.x,t.y,t.width,t.height)}const $s=s=>"source"in s||"target"in s;class Qs{constructor(t){this.convertedElements=t}convertedElements;deserialize(t){for(const e of we){const n=t[e+"EventDefinition"];for(const i of d(n,!0))this.convertedElements.registerEventDefinitionsOfDefinition(i.id,{id:i.id,kind:e,...$s(i)?{source:i.source,target:i.target}:{}})}}}class Js{constructor(t){this.convertedElements=t}convertedElements;deserialize(t){this.parseGlobalTasks(t.globalTask,c.GLOBAL_TASK),this.parseGlobalTasks(t.globalBusinessRuleTask,c.GLOBAL_TASK_BUSINESS_RULE),this.parseGlobalTasks(t.globalManualTask,c.GLOBAL_TASK_MANUAL),this.parseGlobalTasks(t.globalScriptTask,c.GLOBAL_TASK_SCRIPT),this.parseGlobalTasks(t.globalUserTask,c.GLOBAL_TASK_USER)}parseGlobalTasks(t,e){for(const n of d(t))this.convertedElements.registerGlobalTask(n.id,e)}}const en=(s,t)=>{switch(s){case"adHocSubProcess":return m.AD_HOC;case"transaction":return m.TRANSACTION;default:return t.triggeredByEvent?m.EVENT:m.EMBEDDED}},tn=["adHocSubProcess","transaction",...[...u.flowNodeKinds(),...u.artifactKinds()].filter(s=>s!==c.EVENT_BOUNDARY),c.EVENT_BOUNDARY];function sn(s){return["adHocSubProcess","transaction"].includes(s)?c.SUB_PROCESS:s}class nn{constructor(t,e){this.convertedElements=t,this.parsingMessageCollector=e}convertedElements;parsingMessageCollector;defaultSequenceFlowIds=[];elementsWithoutParentByProcessId=new Map;callActivitiesCallingProcess=new Map;eventsByLinkEventDefinition=new Map;deserialize(t){for(const e of d(t))this.parseProcess(e);for(const e of d(t))this.assignParentOfProcessElementsCalledByCallActivity(e.id);this.assignIncomingAndOutgoingIdsFromFlows(),this.assignSourceAndTargetIdsToLinkEvents()}assignParentOfProcessElementsCalledByCallActivity(t){const e=this.callActivitiesCallingProcess.get(t);if(e){const n=this.convertedElements.findPoolByProcessRef(t);n&&(n.parentId=e.id);for(const i of this.elementsWithoutParentByProcessId.get(t))i.parentId=e.id}}assignIncomingAndOutgoingIdsFromFlows(){const t=(e,n,i)=>{const o=this.convertedElements.findFlowNode(e)??this.convertedElements.findLane(e)??this.convertedElements.findPoolById(e);o&&!o[n].includes(i)&&o[n].push(i)};for(const e of this.convertedElements.getFlows())t(e.sourceReferenceId,"outgoingIds",e.id),t(e.targetReferenceId,"incomingIds",e.id)}assignSourceAndTargetIdsToLinkEvents(){const t=[...this.eventsByLinkEventDefinition.entries()].filter(([e])=>e.id);for(const[e,n]of this.eventsByLinkEventDefinition)if(n instanceof ie){const i=t.find(([o])=>e.target===o.id);n.targetId=i?.[1]?.id}else n instanceof ne&&(n.sourceIds=t.filter(([i])=>Array.isArray(e.source)?e.source.includes(i.id):e.source===i.id).map(([,i])=>i.id))}parseProcess(t){const e=t.id,n=this.convertedElements.findPoolByProcessRef(e);n&&!n.name&&this.convertedElements.registerPool(new O(n.id,t.name,c.POOL),e),this.buildProcessInnerElements(t,n?.id)}buildProcessInnerElements(t,e){this.elementsWithoutParentByProcessId.set(t.id,[]);for(const n of tn)this.buildFlowNodeBpmnElements(t[n],sn(n),e,t.id,n);this.buildLaneSetBpmnElements(t.laneSet,e,t.id),this.buildSequenceFlows(t.sequenceFlow),Ke(this.convertedElements,t.association)}buildFlowNodeBpmnElements(t,e,n,i,o){for(const a of d(t)){const l=this.buildFlowNodeBpmnElement(e,a,n,o);"default"in a&&u.isWithDefaultSequenceFlow(e)&&this.defaultSequenceFlowIds.push(a.default),l&&(this.convertedElements.registerFlowNode(l),n||this.elementsWithoutParentByProcessId.get(i).push(l))}}buildFlowNodeBpmnElement(t,e,n,i){if(u.isEvent(t))return this.buildShapeBpmnEvent(e,t,n);if(u.isActivity(t))return this.buildShapeBpmnActivity(e,t,n,i);if(t==c.GATEWAY_EVENT_BASED){const o=e;return new Ye(o.id,o.name,n,o.instantiate,x[o.eventGatewayType])}else{if(t==c.GROUP)return He(this.convertedElements,this.parsingMessageCollector,e,n);{const o=t===c.TEXT_ANNOTATION?e.text:e.name;return new O(e.id,o,t,n,e.instantiate)}}}buildShapeBpmnActivity(t,e,n,i){const o=on(t);return u.isSubProcess(e)?this.buildShapeBpmnSubProcess(t,n,en(i,t),o):u.isCallActivity(e)?this.buildShapeBpmnCallActivity(t,n,o):new j(t.id,t.name,e,n,t.instantiate,o)}buildShapeBpmnCallActivity(t,e,n){const i=this.convertedElements.findGlobalTask(t.calledElement);if(!i){const o=new w(t.id,t.name,k.CALLING_PROCESS,e,n);return this.callActivitiesCallingProcess.set(t.calledElement,o),o}return new w(t.id,t.name,k.CALLING_GLOBAL_TASK,e,n,i)}buildShapeBpmnEvent(t,e,n){const i=this.getEventDefinitions(t),o=[...i.entries()].map(([,a])=>a.length).reduce((a,l)=>a+l,0);if(o==0&&u.canHaveNoneEvent(e))return new y(t.id,t.name,e,I.NONE,n);if(o==1){const[a,l]=[...i.entries()][0],h=u.isCatchEvent(e)?this.buildShapeBpmnCatchEvent(t,e,a,n):this.buildShapeBpmnThrowEvent(t,e,a,n);return a===I.LINK&&(l[0].id||l[0].target||l[0].source)&&this.eventsByLinkEventDefinition.set(l[0],h),h}}buildShapeBpmnCatchEvent(t,e,n,i){return u.isBoundaryEvent(e)?this.buildShapeBpmnBoundaryEvent(t,n):u.isStartEvent(e)?new ke(t.id,t.name,n,i,t.isInterrupting):new ne(t.id,t.name,n,i)}buildShapeBpmnThrowEvent(t,e,n,i){return u.isIntermediateThrowEvent(e)?new ie(t.id,t.name,n,i):new y(t.id,t.name,e,n,i)}buildShapeBpmnBoundaryEvent(t,e){const n=this.convertedElements.findFlowNode(t.attachedToRef);if(u.isActivity(n?.kind))return new xe(t.id,t.name,e,t.attachedToRef,t.cancelActivity);this.parsingMessageCollector.warning(new Ys(t.id,t.attachedToRef,n?.kind))}getEventDefinitions(t){const e=new Map;for(const n of we){const i=t[`${n}EventDefinition`];e.set(n,d(i,!0))}for(const n of d(t.eventDefinitionRef)){const i=this.convertedElements.findEventDefinitionOfDefinition(n);i&&e.get(i.kind).push(i)}for(const[n]of[...e.entries()].filter(([,i])=>i.length===0))e.delete(n);return e}buildShapeBpmnSubProcess(t,e,n,i){const o=new G(t.id,t.name,n,e,i);return this.buildProcessInnerElements(t,t.id),o}buildLaneSetBpmnElements(t,e,n){for(const i of d(t))this.buildLaneBpmnElements(i.lane,e,n)}buildLaneBpmnElements(t,e,n){for(const i of d(t)){const o=new O(i.id,i.name,c.LANE,e);this.convertedElements.registerLane(o),e||this.elementsWithoutParentByProcessId.get(n).push(o),this.assignParentOfLaneFlowNodes(i),i.childLaneSet?.lane&&this.buildLaneBpmnElements(i.childLaneSet.lane,i.id,n)}}assignParentOfLaneFlowNodes(t){for(const e of d(t.flowNodeRef)){const n=this.convertedElements.findFlowNode(e),i=t.id;n?u.isBoundaryEvent(n.kind)||(n.parentId=i):this.parsingMessageCollector.warning(new xs(i,e))}}buildSequenceFlows(t){for(const e of d(t)){const n=this.getSequenceFlowKind(e);this.convertedElements.registerSequenceFlow(new Fe(e.id,e.name,e.sourceRef,e.targetRef,n))}}getSequenceFlowKind(t){if(this.defaultSequenceFlowIds.includes(t.id))return _.DEFAULT;{const e=this.convertedElements.findFlowNode(t.sourceRef);if(e&&u.isWithDefaultSequenceFlow(e.kind)&&t.conditionExpression)return u.isActivity(e.kind)?_.CONDITIONAL_FROM_ACTIVITY:_.CONDITIONAL_FROM_GATEWAY}return _.NORMAL}}const on=s=>{const t=[],e=s.standardLoopCharacteristics,n=d(s.multiInstanceLoopCharacteristics,!0)[0];return e!==void 0?t.push(S.LOOP):n&&t.push(n.isSequential?S.MULTI_INSTANCE_SEQUENTIAL:S.MULTI_INSTANCE_PARALLEL),t};class rn{constructor(t,e,n,i,o,a){this.categoryConverter=t,this.collaborationConverter=e,this.eventDefinitionConverter=n,this.globalTaskConverter=i,this.processConverter=o,this.diagramConverter=a}categoryConverter;collaborationConverter;eventDefinitionConverter;globalTaskConverter;processConverter;diagramConverter;parse(t){const e=t.definitions;return this.categoryConverter.deserialize(e),this.collaborationConverter.deserialize(e.collaboration),this.eventDefinitionConverter.deserialize(e),this.globalTaskConverter.deserialize(e),this.processConverter.deserialize(e.process),this.diagramConverter.deserialize(e.BPMNDiagram)}}function an(s){const t=new Gs;return new rn(new Ps(t),new Vs(t,s),new Qs(t),new Js(t),new nn(t,s),new qs(t,s))}const ln=[{regex:/&(amp|#38|#x26);/g,val:"&"},{regex:/&(apos|#39|#x27);/g,val:"'"},{regex:/&#(xa|xA|10);/g,val:` +`},{regex:/&(gt|#62|#x3e|#x3E);/g,val:">"},{regex:/&(lt|#60|#x3c|#x3C);/g,val:"<"},{regex:/&(quot|#34|#x22);/g,val:'"'}],cn=new Set(["BPMNShape.Bounds","BPMNShape.BPMNLabel.Bounds","BPMNEdge.BPMNLabel.Bounds","BPMNEdge.waypoint"].map(s=>`definitions.BPMNDiagram.BPMNPlane.${s}`)),hn=new Set(["x","y","width","height"]),Tn=(s,t)=>cn.has(t)&&hn.has(s);class un{constructor(t){this.options=t}options;x2jOptions={attributeNamePrefix:"",removeNSPrefix:!0,ignoreAttributes:!1,parseAttributeValue:!0,processEntities:!1,jPath:!1,attributeValueProcessor:(t,e,n)=>{const i=typeof n=="string"?n:n.toString(".",!1);return Tn(t,i)?Number(e):this.processAttribute(e)}};xmlParser=new qe(this.x2jOptions);parse(t){let e;try{e=this.xmlParser.parse(t)}catch{throw new Error("XML parsing failed. Invalid BPMN source.")}if(!e.definitions)throw new Error("XML parsing failed. Unable to retrieve 'definitions' from the BPMN source.");return e}processAttribute(t){for(const e of ln)t=t.replace(e.regex,e.val);return this.options?.additionalXmlAttributeProcessor&&(t=this.options.additionalXmlAttributeProcessor(t)),t}}class dn{constructor(t,e){this.jsonParser=t,this.xmlParser=e}jsonParser;xmlParser;parse(t){const e=this.xmlParser.parse(t);return this.jsonParser.parse(e)}}function gn(s){return new dn(an(new bs(s)),new un(s))}function En(s){return new fn(s)}class fn{constructor(t){this.graph=t}graph;updateAndRefreshCssClassesOfCell(t,e){this.updateAndRefreshCssClassesOfElement(t,e),this.updateAndRefreshCssClassesOfElement(Te(t),e)}updateAndRefreshCssClassesOfElement(t,e){const n=this.graph.getModel(),i=n.getCell(t);if(!i)return;let o=i.getStyle();o=L(o,g.EXTRA_CSS_CLASSES,e.join(",")),n.setStyle(i,o)}}function pn(s){return new Sn(En(s),new In)}class Sn{constructor(t,e){this.cssClassesUpdater=t,this.cssClassesCache=e}cssClassesUpdater;cssClassesCache;clearCache(){this.cssClassesCache.clear()}addCssClasses(t,e){this.updateCssClasses(t,e,this.cssClassesCache.addClassNames)}removeCssClasses(t,e){this.updateCssClasses(t,e,this.cssClassesCache.removeClassNames)}removeAllCssClasses(t){if(t||t=="")for(const e of d(t)){const n=this.cssClassesCache.removeAllClassNames(e);this.updateCellIfChanged(n,e)}else{const e=this.cssClassesCache.getBpmnIds();this.cssClassesCache.clear();for(const n of e)this.updateCellIfChanged(!0,n)}}toggleCssClasses(t,e){this.updateCssClasses(t,e,this.cssClassesCache.toggleClassNames)}updateCssClasses(t,e,n){const i=d(e);for(const o of d(t))this.updateCellIfChanged(n(o,i),o)}updateCellIfChanged(t,e){if(t){const n=this.cssClassesCache.getClassNames(e);this.cssClassesUpdater.updateAndRefreshCssClassesOfCell(e,n)}}}class In{classNamesByBpmnId=new Map;clear=()=>{this.classNamesByBpmnId.clear()};getClassNames(t){return this.classNamesByBpmnId.has(t)?[...this.classNamesByBpmnId.get(t)]:[]}getBpmnIds(){return[...this.classNamesByBpmnId.keys()]}addClassNames=(t,e)=>this.updateClassNames(t,e,(n,i)=>n.add(i));removeClassNames=(t,e)=>this.updateClassNames(t,e,(n,i)=>n.delete(i));removeAllClassNames(t){const e=this.getOrInitializeClassNames(t),n=e.size;return e.clear(),e.size(this.updateClassNames(t,e,(n,i)=>n.has(i)?n.delete(i):n.add(i)),e&&e.length>0);updateClassNames(t,e,n){const i=this.getOrInitializeClassNames(t),o=i.size;for(const a of d(e))n(i,a);return i.size!=o}getOrInitializeClassNames(t){let e=this.classNamesByBpmnId.get(t);return e==null&&(e=new Set,this.classNamesByBpmnId.set(t,e)),e}}const Ln=new Map([["start",{horizontalAlign:"left",verticalAlign:"top"}],["middle",{horizontalAlign:"center",verticalAlign:"top"}],["end",{horizontalAlign:"right",verticalAlign:"top"}],["top-left",{horizontalAlign:"left",verticalAlign:"top"}],["top-right",{horizontalAlign:"right",verticalAlign:"top"}],["top-center",{horizontalAlign:"center",verticalAlign:"top"}],["bottom-left",{horizontalAlign:"left",verticalAlign:"bottom"}],["bottom-right",{horizontalAlign:"right",verticalAlign:"bottom"}],["bottom-center",{horizontalAlign:"center",verticalAlign:"bottom"}],["middle-left",{horizontalAlign:"left",verticalAlign:"middle"}],["middle-right",{horizontalAlign:"right",verticalAlign:"middle"}]]),An=s=>Ln.get(s.position),Cn=(s,t)=>{t&&(s.fill.color=t.color??s.fill.color,s.fill.opacity=t.opacity??s.fill.opacity)},On=(s,t)=>{t&&(s.stroke.color=t.color??s.stroke.color,s.stroke.width=t.width??s.stroke.width)},_n=(s,t)=>{t&&(s.font.color=t.color??s.font.color,s.font.size=t.size??s.font.size)},vn=s=>{const t={fill:{color:T.DEFAULT_OVERLAY_FILL_COLOR.valueOf(),opacity:T.DEFAULT_OVERLAY_FILL_OPACITY.valueOf()},stroke:{color:T.DEFAULT_OVERLAY_STROKE_COLOR.valueOf(),width:T.DEFAULT_OVERLAY_STROKE_WIDTH.valueOf()},font:{color:T.DEFAULT_OVERLAY_FONT_COLOR.valueOf(),size:T.DEFAULT_OVERLAY_FONT_SIZE.valueOf()}},e=s.style,n={...t};return e&&(Cn(n,e.fill),On(n,e.stroke),_n(n,e.font)),n};class mn{convert(t){const e=An(t),n=vn(t);return{position:e,style:n}}}function Nn(s){return new yn(s,new mn)}class yn{constructor(t,e){this.graph=t,this.overlayConverter=e}graph;overlayConverter;addOverlays(t,e){const n=this.graph.getModel().getCell(t);if(n)for(const i of d(e)){const o=new We(i.label,this.overlayConverter.convert(i));this.graph.addCellOverlay(n,o)}}removeAllOverlays(t){const e=this.graph.getModel().getCell(t);e&&this.graph.removeCellOverlays(e)}}function Rn(s){return new wn(Nn(s))}class wn{constructor(t){this.overlaysUpdater=t}overlaysUpdater;addOverlays(t,e){this.overlaysUpdater.addOverlays(t,e)}removeAllOverlays(t){this.overlaysUpdater.removeAllOverlays(t)}}class Fn{element(t){return`svg > g > g > g[data-bpmn-id="${t}"]`}elementsOfKind(t){return`svg > g > g > g.${t}:not(.bpmn-label)`}}function Pn(s){return new bn(s,new Dn(s.getModel()))}const ye=s=>{const t=d(s);return t.push(...t.map(e=>Te(e))),t};class bn{constructor(t,e){this.graph=t,this.styleManager=e}graph;styleManager;clear(){this.styleManager.clear()}updateStyle(t,e){if(!e)return;const n=this.graph.getModel(),i=ye(t).map(o=>n.getCell(o)).filter(Boolean);i.length!==0&&this.graph.batchUpdate(()=>{for(const o of i){this.styleManager.ensureStyleIsStored(o);let a=o.getStyle();a=L(a,r.STYLE_OPACITY,e.opacity,q),a=Lt(a,e.stroke),a=At(a,e.font),vt(e)&&(a=_t(a,e.fill)),n.setStyle(o,a)}})}resetStyle(t){this.graph.batchUpdate(()=>{if(t||t=="")for(const e of ye(t))this.styleManager.resetStyleIfIsStored(e);else this.styleManager.resetAllStyles()})}}const Re=g.EXTRA_CSS_CLASSES;class Dn{constructor(t){this.model=t}model;stylesCache=new Map;clear(){this.stylesCache.clear()}resetAllStyles(){for(const t of this.stylesCache.keys())this.resetStyle(t,this.stylesCache.get(t))}resetStyleIfIsStored(t){const e=this.stylesCache.get(t);e&&this.resetStyle(t,e)}resetStyle(t,e){const n=this.model.getCell(t),i=Ct(n.getStyle(),Re,""),o=L(e,Re,i);this.model.setStyle(n,o),this.stylesCache.delete(t)}ensureStyleIsStored(t){const e=t.getId();this.stylesCache.has(e)||this.stylesCache.set(e,t.getStyle())}}function Bn(s){return new Mn(Pn(s))}class Mn{constructor(t){this.styleUpdater=t}styleUpdater;clearCache(){this.styleUpdater.clear()}updateStyle(t,e){this.styleUpdater.updateStyle(t,e)}resetStyle(t){this.styleUpdater.resetStyle(t)}}function kn(s,t){return new xn(s,new Yn(t.container,new Fn),pn(t),Rn(t),Bn(t))}class xn{constructor(t,e,n,i,o){this.bpmnModelRegistry=t,this.htmlElementRegistry=e,this.cssClassesRegistry=n,this.overlaysRegistry=i,this.styleRegistry=o,this.bpmnModelRegistry.registerOnLoadCallback(()=>{this.cssClassesRegistry.clearCache(),this.styleRegistry.clearCache()})}bpmnModelRegistry;htmlElementRegistry;cssClassesRegistry;overlaysRegistry;styleRegistry;getModelElementsByIds(t){return J(t).map(e=>this.bpmnModelRegistry.getBpmnSemantic(e)).filter(Boolean)}getElementsByIds(t){return this.getModelElementsByIds(t).map(e=>({bpmnSemantic:e,htmlElement:this.htmlElementRegistry.getBpmnHtmlElement(e.id)}))}getModelElementsByKinds(t){return J(t).flatMap(e=>this.htmlElementRegistry.getBpmnHtmlElements(e)).map(e=>this.getRelatedBpmnSemantic(e))}getElementsByKinds(t){return J(t).flatMap(e=>this.htmlElementRegistry.getBpmnHtmlElements(e)).map(e=>({htmlElement:e,bpmnSemantic:this.getRelatedBpmnSemantic(e)}))}getRelatedBpmnSemantic(t){return this.bpmnModelRegistry.getBpmnSemantic(t.dataset.bpmnId)}addCssClasses(t,e){this.cssClassesRegistry.addCssClasses(t,e)}removeCssClasses(t,e){this.cssClassesRegistry.removeCssClasses(t,e)}removeAllCssClasses(t){this.cssClassesRegistry.removeAllCssClasses(t)}toggleCssClasses(t,e){this.cssClassesRegistry.toggleCssClasses(t,e)}addOverlays(t,e){this.overlaysRegistry.addOverlays(t,e)}removeAllOverlays(t){this.overlaysRegistry.removeAllOverlays(t)}updateStyle(t,e){this.styleRegistry.updateStyle(t,e)}resetStyle(t){this.styleRegistry.resetStyle(t)}}class Yn{constructor(t,e){this.container=t,this.querySelectors=e}container;querySelectors;getBpmnHtmlElement(t){return this.container.querySelector(this.querySelectors.element(t))}getBpmnHtmlElements(t){const e=this.querySelectors.elementsOfKind(oe(t));return[...this.container.querySelectorAll(e)]}}const J=s=>[...new Set(d(s))];class Gn{filter(t,e){const n=[],i=[];for(const C of d(e?.pools).filter(W=>W&&Object.keys(W).length>0))C.id?n.push(C.id):C.name&&i.push(C.name);if(n.length===0&&i.length===0)return t;const{filteredPools:o,filteredPoolIds:a}=Vn(t,n,i),l=[...n,...a],{filteredLanes:h,filteredLaneIds:E,filteredFlowNodes:f,filteredFlowNodeIds:B}=ze(t.lanes,t.flowNodes,l),F=Un(t.edges,[...l,...E,...B]);if(o.length===0&&h.length===0&&f.length===0&&F.length===0){let C=n.length>0?` for ids [${n}]`:"";const W=C?" and":"";throw C+=i.length>0?`${W} for names [${i}]`:"",new Error("No matching pools"+C)}return{lanes:h,flowNodes:f,pools:o,edges:F}}}function Vn(s,t,e){const n=s.pools.filter(o=>t.includes(o.bpmnElement.id)||e.includes(o.bpmnElement.name)),i=n.map(o=>o.bpmnElement.id);return{filteredPools:n,filteredPoolIds:i}}function ze(s,t,e){const{filteredLanes:n,filteredLaneIds:i}=Xe(s,e),{filteredLanes:o,filteredLaneIds:a,filteredFlowNodes:l,filteredFlowNodeIds:h}=Wn(t,[...e,...i],s);return n.push(...o),i.push(...a),{filteredLanes:n,filteredLaneIds:i,filteredFlowNodes:l,filteredFlowNodeIds:h}}function Xe(s,t){const e=s.filter(i=>t.includes(i.bpmnElement.parentId)),n=e.map(i=>i.bpmnElement.id);if(e.length>0){const{filteredLanes:i,filteredLaneIds:o}=Xe(s,n);e.push(...i),n.push(...o)}return{filteredLanes:e,filteredLaneIds:n}}function Wn(s,t,e){const n=s.filter(E=>t.includes(E.bpmnElement.parentId));if(n.length===0)return{filteredLanes:[],filteredLaneIds:[],filteredFlowNodes:[],filteredFlowNodeIds:[]};const i=n.map(E=>E.bpmnElement.id),{filteredLanes:o,filteredLaneIds:a,filteredFlowNodes:l,filteredFlowNodeIds:h}=ze(e,s,i);return n.push(...l),i.push(...h),{filteredLanes:o,filteredLaneIds:a,filteredFlowNodes:n,filteredFlowNodeIds:i}}function Un(s,t){return s.filter(e=>t.includes(e.bpmnElement.sourceReferenceId)&&t.includes(e.bpmnElement.targetReferenceId))}class Hn{searchableModel;onLoadCallback;load(t,e){const n=new Gn().filter(t,e);return this.searchableModel=new zn(n),this.onLoadCallback?.(),Kn(n)}registerOnLoadCallback(t){this.onLoadCallback=t}getBpmnSemantic(t){const e=this.searchableModel?.elementById(t);if(!e)return;const n=e.bpmnElement,i=n instanceof O;return{id:t,isShape:i,kind:n.kind,name:n.name,...n instanceof Z?{sourceRefId:n.sourceReferenceId,targetRefId:n.targetReferenceId}:{callActivityGlobalTaskKind:n instanceof w?n.globalTaskKind:void 0,callActivityKind:n instanceof w?n.callActivityKind:void 0,eventDefinitionKind:n instanceof y?n.eventDefinitionKind:void 0,linkEventSourceIds:n instanceof ne&&n.eventDefinitionKind==I.LINK?n.sourceIds:void 0,linkEventTargetId:n instanceof ie?n.targetId:void 0,incomingIds:n.incomingIds,outgoingIds:n.outgoingIds,parentId:n.parentId,subProcessKind:n instanceof G?n.subProcessKind:void 0}}}}function Kn(s){const t=new Set(s.flowNodes.filter(o=>{const a=o.bpmnElement;return u.isSubProcess(a.kind)&&a.markers.includes(S.EXPAND)}).map(o=>o.bpmnElement.id)),e=[],n=[],i=[];for(const o of s.flowNodes){const a=o.bpmnElement.kind;u.isSubProcess(a)?e.push(o):u.isBoundaryEvent(a)?n.push(o):t.has(o.bpmnElement.parentId)||i.push(o)}return{boundaryEvents:n,edges:s.edges,lanes:s.lanes,otherFlowNodes:i,pools:s.pools,subprocesses:e}}class zn{elements=new Map;constructor(t){for(const e of[...t.pools,...t.lanes,...t.flowNodes,...t.edges])this.elements.set(e.bpmnElement.id,e)}elementById(t){return this.elements.get(t)}}class Qn{graph;navigation;bpmnElementsRegistry;bpmnModelRegistry;parserOptions;rendererOptions;disposed=!1;constructor(t){this.rendererOptions=t?.renderer,this.graph=ms(Je(t?.container),this.rendererOptions),this.navigation=Rs(this.graph,t?.navigation),this.bpmnModelRegistry=new Hn,this.bpmnElementsRegistry=kn(this.bpmnModelRegistry,this.graph),this.parserOptions=t?.parser}load(t,e){if(this.disposed)throw new Error("Cannot load BPMN diagram: the BpmnVisualization instance has been disposed");const n=gn(this.parserOptions).parse(t),i=this.bpmnModelRegistry.load(n,e?.modelFilter);Bt(this.graph,this.rendererOptions).render(i),this.navigation.fit(e?.fit)}dispose(){this.disposed||(this.navigation.dispose(),this.disposed=!0,this.graph.destroy())}}const Xn="0.48.0",Jn=()=>({lib:Xn,dependencies:new Map([["mxGraph",it.VERSION]])});export{Qn as B,M as F,Ht as I,u as S,Qe as Z,c as a,p as b,r as c,De as d,Me as e,vs as f,Jn as g,T as h,Mt as i,v as j,it as m}; diff --git a/demo/load-and-navigation/assets/lib-es-toolkit.js b/demo/load-and-navigation/assets/lib-es-toolkit.js new file mode 100644 index 00000000..ee1362d5 --- /dev/null +++ b/demo/load-and-navigation/assets/lib-es-toolkit.js @@ -0,0 +1 @@ +function g(c,o,{signal:s,edges:t}={}){let l,n=null;const u=t!=null&&t.includes("leading"),i=t==null||t.includes("trailing"),d=()=>{n!==null&&(c.apply(l,n),l=void 0,n=null)},h=()=>{i&&d(),r()};let e=null;const f=()=>{e!=null&&clearTimeout(e),e=setTimeout(()=>{e=null,h()},o)},p=()=>{e!==null&&(clearTimeout(e),e=null)},r=()=>{p(),l=void 0,n=null},m=()=>{d()},a=function(...T){if(s?.aborted)return;l=this,n=T;const b=e==null;f(),u&&b&&d()};return a.schedule=f,a.cancel=r,a.flush=m,s?.addEventListener("abort",r,{once:!0}),a}function w(c,o,{signal:s,edges:t=["leading","trailing"]}={}){let l=null;const n=g(function(...i){l=Date.now(),c.apply(this,i)},o,{signal:s,edges:t}),u=function(...i){if(l==null&&(l=Date.now()),Date.now()-l>=o){l=Date.now(),c.apply(this,i),n.cancel(),n.schedule();return}n.apply(this,i)};return u.cancel=n.cancel,u.flush=n.flush,u}export{g as d,w as t}; diff --git a/demo/load-and-navigation/assets/lib-fast-xml-parser.js b/demo/load-and-navigation/assets/lib-fast-xml-parser.js new file mode 100644 index 00000000..7e7c6c2b --- /dev/null +++ b/demo/load-and-navigation/assets/lib-fast-xml-parser.js @@ -0,0 +1,4 @@ +const J=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",ue=J+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040",he="["+J+"]["+ue+"]*",ce=new RegExp("^"+he+"$");function Q(n,e){const t=[];let r=e.exec(n);for(;r;){const s=[];s.startIndex=e.lastIndex-r[0].length;const i=r.length;for(let a=0;a"u")};function fe(n){return typeof n<"u"}const X=["hasOwnProperty","toString","valueOf","__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__"],D=["__proto__","constructor","prototype"],de={allowBooleanAttributes:!1,unpairedTags:[]};function pe(n,e){e=Object.assign({},de,e);const t=[];let r=!1,s=!1;n[0]==="\uFEFF"&&(n=n.substr(1));for(let i=0;i"&&n[i]!==" "&&n[i]!==" "&&n[i]!==` +`&&n[i]!=="\r";i++)l+=n[i];if(l=l.trim(),l[l.length-1]==="/"&&(l=l.substring(0,l.length-1),i--),!_e(l)){let c;return l.trim().length===0?c="Invalid space after '<'.":c="Tag '"+l+"' is an invalid name.",g("InvalidTag",c,N(n,i))}const h=me(n,i);if(h===!1)return g("InvalidAttr","Attributes for '"+l+"' have open quote.",N(n,i));let u=h.value;if(i=h.index,u[u.length-1]==="/"){const c=i-u.length;u=u.substring(0,u.length-1);const f=Z(u,e);if(f===!0)r=!0;else return g(f.err.code,f.err.msg,N(n,c+f.err.line))}else if(o)if(h.tagClosed){if(u.trim().length>0)return g("InvalidTag","Closing tag '"+l+"' can't have attributes or invalid starting.",N(n,a));if(t.length===0)return g("InvalidTag","Closing tag '"+l+"' has not been opened.",N(n,a));{const c=t.pop();if(l!==c.tagName){let f=N(n,c.tagStartPos);return g("InvalidTag","Expected closing tag '"+c.tagName+"' (opened in line "+f.line+", col "+f.col+") instead of closing tag '"+l+"'.",N(n,a))}t.length==0&&(s=!0)}}else return g("InvalidTag","Closing tag '"+l+"' doesn't have proper closing.",N(n,i));else{const c=Z(u,e);if(c!==!0)return g(c.err.code,c.err.msg,N(n,i-u.length+c.err.line));if(s===!0)return g("InvalidXml","Multiple possible root nodes found.",N(n,i));e.unpairedTags.indexOf(l)!==-1||t.push({tagName:l,tagStartPos:a}),r=!0}for(i++;i0)return g("InvalidXml","Invalid '"+JSON.stringify(t.map(i=>i.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1})}else return g("InvalidXml","Start tag expected.",1);return!0}function Y(n){return n===" "||n===" "||n===` +`||n==="\r"}function z(n,e){const t=e;for(;e5&&r==="xml")return g("InvalidXml","XML declaration allowed only at the start of the document.",N(n,e));if(n[e]=="?"&&n[e+1]==">"){e++;break}else continue}return e}function q(n,e){if(n.length>e+5&&n[e+1]==="-"&&n[e+2]==="-"){for(e+=3;e"){e+=2;break}}else if(n.length>e+8&&n[e+1]==="D"&&n[e+2]==="O"&&n[e+3]==="C"&&n[e+4]==="T"&&n[e+5]==="Y"&&n[e+6]==="P"&&n[e+7]==="E"){let t=1;for(e+=8;e"&&(t--,t===0))break}else if(n.length>e+9&&n[e+1]==="["&&n[e+2]==="C"&&n[e+3]==="D"&&n[e+4]==="A"&&n[e+5]==="T"&&n[e+6]==="A"&&n[e+7]==="["){for(e+=8;e"){e+=2;break}}return e}const ge='"',Ee="'";function me(n,e){let t="",r="",s=!1;for(;e"&&r===""){s=!0;break}t+=n[e]}return r!==""?!1:{value:t,index:e,tagClosed:s}}const Ne=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function Z(n,e){const t=Q(n,Ne),r={};for(let s=0;s",lt:"<",quot:'"'},Ce={nbsp:" ",copy:"©",reg:"®",trade:"™",mdash:"—",ndash:"–",hellip:"…",laquo:"«",raquo:"»",lsquo:"‘",rsquo:"’",ldquo:"“",rdquo:"”",bull:"•",para:"¶",sect:"§",deg:"°",frac12:"½",frac14:"¼",frac34:"¾"},Se=new Set("!?\\\\/[]$%{}^&*()<>|+");function G(n){if(n[0]==="#")throw new Error(`[EntityReplacer] Invalid character '#' in entity name: "${n}"`);for(const e of n)if(Se.has(e))throw new Error(`[EntityReplacer] Invalid character '${e}' in entity name: "${n}"`);return n}function V(...n){const e=Object.create(null);for(const t of n)if(t)for(const r of Object.keys(t)){const s=t[r];if(typeof s=="string")e[r]=s;else if(s&&typeof s=="object"&&s.val!==void 0){const i=s.val;typeof i=="string"&&(e[r]=i)}}return e}const I="external",M="base",j="all";function Ie(n){return!n||n===I?new Set([I]):n===j?new Set([j]):n===M?new Set([M]):Array.isArray(n)?new Set(n):new Set([I])}const y=Object.freeze({allow:0,leave:1,remove:2,throw:3}),Ae=new Set([9,10,13]);function ve(n){if(!n)return{xmlVersion:1,onLevel:y.allow,nullLevel:y.remove};const e=n.xmlVersion===1.1?1.1:1,t=y[n.onNCR]??y.allow,r=y[n.nullNCR]??y.remove,s=Math.max(r,y.remove);return{xmlVersion:e,onLevel:t,nullLevel:s}}class xe{constructor(e={}){this._limit=e.limit||{},this._maxTotalExpansions=this._limit.maxTotalExpansions||0,this._maxExpandedLength=this._limit.maxExpandedLength||0,this._postCheck=typeof e.postCheck=="function"?e.postCheck:r=>r,this._limitTiers=Ie(this._limit.applyLimitsTo??I),this._numericAllowed=e.numericAllowed??!0,this._baseMap=V(ee,e.namedEntities||null),this._externalMap=Object.create(null),this._inputMap=Object.create(null),this._totalExpansions=0,this._expandedLength=0,this._removeSet=new Set(e.remove&&Array.isArray(e.remove)?e.remove:[]),this._leaveSet=new Set(e.leave&&Array.isArray(e.leave)?e.leave:[]);const t=ve(e.ncr);this._ncrXmlVersion=t.xmlVersion,this._ncrOnLevel=t.onLevel,this._ncrNullLevel=t.nullLevel}setExternalEntities(e){if(e)for(const t of Object.keys(e))G(t);this._externalMap=V(e)}addExternalEntity(e,t){G(e),typeof t=="string"&&t.indexOf("&")===-1&&(this._externalMap[e]=t)}addInputEntities(e){this._totalExpansions=0,this._expandedLength=0,this._inputMap=V(e)}reset(){return this._inputMap=Object.create(null),this._totalExpansions=0,this._expandedLength=0,this}setXmlVersion(e){this._ncrXmlVersion=e===1.1?1.1:1}decode(e){if(typeof e!="string"||e.length===0)return e;const t=e,r=[],s=e.length;let i=0,a=0;const o=this._maxTotalExpansions>0,l=this._maxExpandedLength>0,h=o||l;for(;a=s||e.charCodeAt(c)!==59){a++;continue}const f=e.slice(a+1,c);if(f.length===0){a++;continue}let d,E;if(this._removeSet.has(f))d="",E===void 0&&(E=I);else if(this._leaveSet.has(f)){a++;continue}else if(f.charCodeAt(0)===35){const p=this._resolveNCR(f);if(p===void 0){a++;continue}d=p,E=M}else{const p=this._resolveName(f);d=p?.value,E=p?.tier}if(d===void 0){a++;continue}if(a>i&&r.push(e.slice(i,a)),r.push(d),i=c+1,a=i,h&&this._tierCounts(E)){if(o&&(this._totalExpansions++,this._totalExpansions>this._maxTotalExpansions))throw new Error(`[EntityReplacer] Entity expansion count limit exceeded: ${this._totalExpansions} > ${this._maxTotalExpansions}`);if(l){const p=d.length-(f.length+2);if(p>0&&(this._expandedLength+=p,this._expandedLength>this._maxExpandedLength))throw new Error(`[EntityReplacer] Expanded content length limit exceeded: ${this._expandedLength} > ${this._maxExpandedLength}`)}}}i=55296&&e<=57343||this._ncrXmlVersion===1&&e>=1&&e<=31&&!Ae.has(e)?y.remove:-1}_applyNCRAction(e,t,r){switch(e){case y.allow:return String.fromCodePoint(r);case y.remove:return"";case y.leave:return;case y.throw:throw new Error(`[EntityDecoder] Prohibited numeric character reference &${t}; (U+${r.toString(16).toUpperCase().padStart(4,"0")})`);default:return String.fromCodePoint(r)}}_resolveNCR(e){const t=e.charCodeAt(1);let r;if(t===120||t===88?r=parseInt(e.slice(2),16):r=parseInt(e.slice(1),10),Number.isNaN(r)||r<0||r>1114111)return;const s=this._classifyNCR(r);if(!this._numericAllowed&&sX.includes(n)?"__"+n:n,Pe={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(n,e){return e},attributeValueProcessor:function(n,e){return e},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,entityDecoder:null,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(n,e,t){return n},captureMetaData:!1,maxNestedTags:100,strictReservedNames:!0,jPath:!0,onDangerousProperty:te};function Me(n,e){if(typeof n!="string")return;const t=n.toLowerCase();if(X.some(r=>t===r.toLowerCase()))throw new Error(`[SECURITY] Invalid ${e}: "${n}" is a reserved JavaScript keyword that could cause prototype pollution`);if(D.some(r=>t===r.toLowerCase()))throw new Error(`[SECURITY] Invalid ${e}: "${n}" is a reserved JavaScript keyword that could cause prototype pollution`)}function ne(n,e){return typeof n=="boolean"?{enabled:n,maxEntitySize:1e4,maxExpansionDepth:1e4,maxTotalExpansions:1/0,maxExpandedLength:1e5,maxEntityCount:1e3,allowedTags:null,tagFilter:null,appliesTo:"all"}:typeof n=="object"&&n!==null?{enabled:n.enabled!==!1,maxEntitySize:Math.max(1,n.maxEntitySize??1e4),maxExpansionDepth:Math.max(1,n.maxExpansionDepth??1e4),maxTotalExpansions:Math.max(1,n.maxTotalExpansions??1/0),maxExpandedLength:Math.max(1,n.maxExpandedLength??1e5),maxEntityCount:Math.max(1,n.maxEntityCount??1e3),allowedTags:n.allowedTags??null,tagFilter:n.tagFilter??null,appliesTo:n.appliesTo??"all"}:ne(!0)}const Fe=function(n){const e=Object.assign({},Pe,n),t=[{value:e.attributeNamePrefix,name:"attributeNamePrefix"},{value:e.attributesGroupName,name:"attributesGroupName"},{value:e.textNodeName,name:"textNodeName"},{value:e.cdataPropName,name:"cdataPropName"},{value:e.commentPropName,name:"commentPropName"}];for(const{value:r,name:s}of t)r&&Me(r,s);return e.onDangerousProperty===null&&(e.onDangerousProperty=te),e.processEntities=ne(e.processEntities,e.htmlEntities),e.unpairedTagsSet=new Set(e.unpairedTags),e.stopNodes&&Array.isArray(e.stopNodes)&&(e.stopNodes=e.stopNodes.map(r=>typeof r=="string"&&r.startsWith("*.")?".."+r.substring(2):r)),e};let F;typeof Symbol!="function"?F="@@xmlMetadata":F=Symbol("XML Node Metadata");class C{constructor(e){this.tagname=e,this.child=[],this[":@"]=Object.create(null)}add(e,t){e==="__proto__"&&(e="#__proto__"),this.child.push({[e]:t})}addChild(e,t){e.tagname==="__proto__"&&(e.tagname="#__proto__"),e[":@"]&&Object.keys(e[":@"]).length>0?this.child.push({[e.tagname]:e.child,":@":e[":@"]}):this.child.push({[e.tagname]:e.child}),t!==void 0&&(this.child[this.child.length-1][F]={startIndex:t})}static getMetaDataSymbol(){return F}}const re=":A-Za-z_À-ÖØ-öø-˿Ͱ-ͽͿ-҆҈-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�",Oe=re+"\\-\\.\\d·̀-ͯ‿-⁀",se=":A-Za-z_À-˿Ͱ-ͽͿ-҆҈-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�𐀀-󯿿",$e=se+"\\-\\.\\d·̀-ͯ҇‿-⁀",ie=(n,e,t="")=>{const r=n.replace(":",""),s=e.replace(":",""),i=`[${r}][${s}]*`;return{name:new RegExp(`^[${n}][${e}]*$`,t),ncName:new RegExp(`^${i}$`,t),qName:new RegExp(`^${i}(?::${i})?$`,t),nmToken:new RegExp(`^[${e}]+$`,t),nmTokens:new RegExp(`^[${e}]+(?:\\s+[${e}]+)*$`,t)}},Ve=ie(re,Oe),Le=ie(se,$e,"u"),ke=(n="1.0")=>n==="1.1"?Le:Ve,oe=(n,{xmlVersion:e="1.0"}={})=>ke(e).qName.test(n);class Re{constructor(e,t){this.suppressValidationErr=!e,this.options=e,this.xmlVersion=t||1}setXmlVersion(e=1){this.xmlVersion=e}readDocType(e,t){const r=Object.create(null);let s=0;if(e[t+3]==="O"&&e[t+4]==="C"&&e[t+5]==="T"&&e[t+6]==="Y"&&e[t+7]==="P"&&e[t+8]==="E"){t=t+9;let i=1,a=!1,o=!1,l="";for(;t=this.options.maxEntityCount)throw new Error(`Entity count (${s+1}) exceeds maximum allowed (${this.options.maxEntityCount})`);r[h]=u,s++}}else if(a&&S(e,"!ELEMENT",t)){t+=8;const{index:h}=this.readElementExp(e,t+1);t=h}else if(a&&S(e,"!ATTLIST",t))t+=8;else if(a&&S(e,"!NOTATION",t)){t+=9;const{index:h}=this.readNotationExp(e,t+1,this.suppressValidationErr);t=h}else if(S(e,"!--",t))o=!0;else throw new Error("Invalid DOCTYPE");i++,l=""}else if(e[t]===">"){if(o?e[t-1]==="-"&&e[t-2]==="-"&&(o=!1,i--):i--,i===0)break}else e[t]==="["?a=!0:l+=e[t];if(i!==0)throw new Error("Unclosed DOCTYPE")}else throw new Error("Invalid Tag instead of DOCTYPE");return{entities:r,i:t}}readEntityExp(e,t){t=w(e,t);const r=t;for(;tthis.options.maxEntitySize)throw new Error(`Entity "${s}" size (${i.length}) exceeds maximum allowed size (${this.options.maxEntitySize})`);return t--,[s,i,t]}readNotationExp(e,t){t=w(e,t);const r=t;for(;t{for(;e1||i.length===1&&!o))return n;{const l=Number(t),h=String(l);if(l===0)return l;if(h.search(/[eE]/)!==-1)return e.eNotation?l:n;if(t.indexOf(".")!==-1)return h==="0"||h===a||h===`${s}${a}`?l:n;let u=i?a:t;return i?u===h||s+u===h?l:n:u===h||u===s+h?l:n}}else return n}}else return Ge(n,Number(t),e)}const ze=/^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/;function qe(n,e,t){if(!t.eNotation)return n;const r=e.match(ze);if(r){let s=r[1]||"";const i=r[3].indexOf("e")===-1?"E":"e",a=r[2],o=s?n[a.length+1]===i:n[a.length]===i;return a.length>1&&o?n:a.length===1&&(r[3].startsWith(`.${i}`)||r[3][0]===i)?Number(e):a.length>0?t.leadingZeros&&!o?(e=(r[1]||"")+r[3],Number(e)):n:Number(e)}else return n}function Ze(n){return n&&n.indexOf(".")!==-1&&(n=n.replace(/0+$/,""),n==="."?n="0":n[0]==="."?n="0"+n:n[n.length-1]==="."&&(n=n.substring(0,n.length-1))),n}function L(n,e){const t=n.trim();if((e===2||e===8)&&(n=t.substring(2)),parseInt)return parseInt(n,e);if(Number.parseInt)return Number.parseInt(n,e);if(window&&window.parseInt)return window.parseInt(n,e);throw new Error("parseInt, Number.parseInt, window.parseInt are not supported")}function Ge(n,e,t){const r=e===1/0;switch(t.infinity.toLowerCase()){case"null":return null;case"infinity":return e;case"string":return r?"Infinity":"-Infinity";default:return n}}function Ke(n){return typeof n=="function"?n:Array.isArray(n)?e=>{for(const t of n)if(typeof t=="string"&&e===t||t instanceof RegExp&&t.test(e))return!0}:()=>!1}class K{constructor(e,t={},r){this.pattern=e,this.separator=t.separator||".",this.segments=this._parse(e),this.data=r,this._hasDeepWildcard=this.segments.some(s=>s.type==="deep-wildcard"),this._hasAttributeCondition=this.segments.some(s=>s.attrName!==void 0),this._hasPositionSelector=this.segments.some(s=>s.position!==void 0)}_parse(e){const t=[];let r=0,s="";for(;r0?e[e.length-1].tag:void 0}getCurrentNamespace(){const e=this._matcher.path;return e.length>0?e[e.length-1].namespace:void 0}getAttrValue(e){const t=this._matcher.path;if(t.length!==0)return t[t.length-1].values?.[e]}hasAttr(e){const t=this._matcher.path;if(t.length===0)return!1;const r=t[t.length-1];return r.values!==void 0&&e in r.values}getPosition(){const e=this._matcher.path;return e.length===0?-1:e[e.length-1].position??0}getCounter(){const e=this._matcher.path;return e.length===0?-1:e[e.length-1].counter??0}getIndex(){return this.getPosition()}getDepth(){return this._matcher.path.length}toString(e,t=!0){return this._matcher.toString(e,t)}toArray(){return this._matcher.path.map(e=>e.tag)}matches(e){return this._matcher.matches(e)}matchesAny(e){return e.matchesAny(this._matcher)}}class He{constructor(e={}){this.separator=e.separator||".",this.path=[],this.siblingStacks=[],this._pathStringCache=null,this._view=new Qe(this)}push(e,t=null,r=null){this._pathStringCache=null,this.path.length>0&&(this.path[this.path.length-1].values=void 0);const s=this.path.length;this.siblingStacks[s]||(this.siblingStacks[s]=new Map);const i=this.siblingStacks[s],a=r?`${r}:${e}`:e,o=i.get(a)||0;let l=0;for(const u of i.values())l+=u;i.set(a,o+1);const h={tag:e,position:l,counter:o};r!=null&&(h.namespace=r),t!=null&&(h.values=t),this.path.push(h)}pop(){if(this.path.length===0)return;this._pathStringCache=null;const e=this.path.pop();return this.siblingStacks.length>this.path.length+1&&(this.siblingStacks.length=this.path.length+1),e}updateCurrent(e){if(this.path.length>0){const t=this.path[this.path.length-1];e!=null&&(t.values=e)}}getCurrentTag(){return this.path.length>0?this.path[this.path.length-1].tag:void 0}getCurrentNamespace(){return this.path.length>0?this.path[this.path.length-1].namespace:void 0}getAttrValue(e){if(this.path.length!==0)return this.path[this.path.length-1].values?.[e]}hasAttr(e){if(this.path.length===0)return!1;const t=this.path[this.path.length-1];return t.values!==void 0&&e in t.values}getPosition(){return this.path.length===0?-1:this.path[this.path.length-1].position??0}getCounter(){return this.path.length===0?-1:this.path[this.path.length-1].counter??0}getIndex(){return this.getPosition()}getDepth(){return this.path.length}toString(e,t=!0){const r=e||this.separator;if(r===this.separator&&t===!0){if(this._pathStringCache!==null)return this._pathStringCache;const i=this.path.map(a=>a.namespace?`${a.namespace}:${a.tag}`:a.tag).join(r);return this._pathStringCache=i,i}return this.path.map(i=>t&&i.namespace?`${i.namespace}:${i.tag}`:i.tag).join(r)}toArray(){return this.path.map(e=>e.tag)}reset(){this._pathStringCache=null,this.path=[],this.siblingStacks=[]}matches(e){const t=e.segments;return t.length===0?!1:e.hasDeepWildcard()?this._matchWithDeepWildcard(t):this._matchSimple(t)}_matchSimple(e){if(this.path.length!==e.length)return!1;for(let t=0;t=0&&t>=0;){const s=e[r];if(s.type==="deep-wildcard"){if(r--,r<0)return!0;const i=e[r];let a=!1;for(let o=t;o>=0;o--)if(this._matchSegment(i,this.path[o],o===this.path.length-1)){t=o-1,r--,a=!0;break}if(!a)return!1}else{if(!this._matchSegment(s,this.path[t],t===this.path.length-1))return!1;t--,r--}}return r<0}_matchSegment(e,t,r){if(e.tag!=="*"&&e.tag!==t.tag||e.namespace!==void 0&&e.namespace!=="*"&&e.namespace!==t.namespace||e.attrName!==void 0&&(!r||!t.values||!(e.attrName in t.values)||e.attrValue!==void 0&&String(t.values[e.attrName])!==String(e.attrValue)))return!1;if(e.position!==void 0){if(!r)return!1;const s=t.counter??0;if(e.position==="first"&&s!==0)return!1;if(e.position==="odd"&&s%2!==1)return!1;if(e.position==="even"&&s%2!==0)return!1;if(e.position==="nth"&&s!==e.positionValue)return!1}return!0}matchesAny(e){return e.matchesAny(this)}snapshot(){return{path:this.path.map(e=>({...e})),siblingStacks:this.siblingStacks.map(e=>new Map(e))}}restore(e){this._pathStringCache=null,this.path=e.path.map(t=>({...t})),this.siblingStacks=e.siblingStacks.map(t=>new Map(t))}readOnly(){return this._view}}function De(n,e){if(!n)return{};const t=e.attributesGroupName?n[e.attributesGroupName]:n;if(!t)return{};const r={};for(const s in t)if(s.startsWith(e.attributeNamePrefix)){const i=s.substring(e.attributeNamePrefix.length);r[i]=t[s]}else r[s]=t[s];return r}function et(n){if(!n||typeof n!="string")return;const e=n.indexOf(":");if(e!==-1&&e>0){const t=n.substring(0,e);if(t!=="xmlns")return t}}class tt{constructor(e,t){this.options=e,this.currentNode=null,this.tagsNodeStack=[],this.parseXml=ot,this.parseTextData=nt,this.resolveNameSpace=rt,this.buildAttributesMap=it,this.isItStopNode=ht,this.replaceEntitiesValue=lt,this.readStopNodeData=dt,this.saveTextToParentTag=ut,this.addChild=at,this.ignoreAttributesFn=Ke(this.options.ignoreAttributes),this.entityExpansionCount=0,this.currentExpandedLength=0;let r={...ee};this.options.entityDecoder?this.entityDecoder=this.options.entityDecoder:(typeof this.options.htmlEntities=="object"?r=this.options.htmlEntities:this.options.htmlEntities===!0&&(r={...Ce,...Te}),this.entityDecoder=new xe({namedEntities:{...r,...t},numericAllowed:this.options.htmlEntities,limit:{maxTotalExpansions:this.options.processEntities.maxTotalExpansions,maxExpandedLength:this.options.processEntities.maxExpandedLength,applyLimitsTo:this.options.processEntities.appliesTo}})),this.matcher=new He,this.readonlyMatcher=this.matcher.readOnly(),this.isCurrentNodeStopNode=!1,this.stopNodeExpressionsSet=new Je;const s=this.options.stopNodes;if(s&&s.length>0){for(let i=0;i0)){a||(n=this.replaceEntitiesValue(n,e,t));const l=o.jPath?t.toString():t,h=o.tagValueProcessor(e,n,l,s,i);return h==null?n:typeof h!=typeof n||h!==n?h:o.trimValues||n.trim()===n?U(n,o.parseTagValue,o.numberParseOptions):n}}function rt(n){if(this.options.removeNSPrefix){const e=n.split(":"),t=n.charAt(0)==="/"?"/":"";if(e[0]==="xmlns")return"";e.length===2&&(n=t+e[1])}return n}const st=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function it(n,e,t,r=!1){const s=this.options;if(r===!0||s.ignoreAttributes!==!0&&typeof n=="string"){const i=Q(n,st),a=i.length,o={},l=new Array(a);let h=!1;const u={};for(let d=0;d",o,"Closing Tag is not closed.");let c=n.substring(o+2,u).trim();if(s.removeNSPrefix){const d=c.indexOf(":");d!==-1&&(c=c.substr(d+1))}c=k(s.transformTagName,c,"",s).tagName,t&&(r=this.saveTextToParentTag(r,t,this.readonlyMatcher));const f=this.matcher.getCurrentTag();if(c&&s.unpairedTagsSet.has(c))throw new Error(`Unpaired tag can not be used as closing tag: `);f&&s.unpairedTagsSet.has(f)&&(this.matcher.pop(),this.tagsNodeStack.pop()),this.matcher.pop(),this.isCurrentNodeStopNode=!1,t=this.tagsNodeStack.pop(),r="",o=u}else if(h===63){let u=B(n,o,!1,"?>");if(!u)throw new Error("Pi Tag is not closed.");r=this.saveTextToParentTag(r,t,this.readonlyMatcher);const c=this.buildAttributesMap(u.tagExp,this.matcher,u.tagName,!0);if(c){const f=c[this.options.attributeNamePrefix+"version"];this.entityDecoder.setXmlVersion(Number(f)||1),i.setXmlVersion(Number(f)||1)}if(!(s.ignoreDeclaration&&u.tagName==="?xml"||s.ignorePiTags)){const f=new C(u.tagName);f.add(s.textNodeName,""),u.tagName!==u.tagExp&&u.attrExpPresent&&s.ignoreAttributes!==!0&&(f[":@"]=c),this.addChild(t,f,this.readonlyMatcher,o)}o=u.closeIndex+1}else if(h===33&&n.charCodeAt(o+2)===45&&n.charCodeAt(o+3)===45){const u=A(n,"-->",o+4,"Comment is not closed.");if(s.commentPropName){const c=n.substring(o+4,u-2);r=this.saveTextToParentTag(r,t,this.readonlyMatcher),t.add(s.commentPropName,[{[s.textNodeName]:c}])}o=u}else if(h===33&&n.charCodeAt(o+2)===68){const u=i.readDocType(n,o);this.entityDecoder.addInputEntities(u.entities),o=u.i}else if(h===33&&n.charCodeAt(o+2)===91){const u=A(n,"]]>",o,"CDATA is not closed.")-2,c=n.substring(o+9,u);r=this.saveTextToParentTag(r,t,this.readonlyMatcher);let f=this.parseTextData(c,t.tagname,this.readonlyMatcher,!0,!1,!0,!0);f==null&&(f=""),s.cdataPropName?t.add(s.cdataPropName,[{[s.textNodeName]:c}]):t.add(s.textNodeName,f),o=u+2}else{let u=B(n,o,s.removeNSPrefix);if(!u){const b=n.substring(Math.max(0,o-50),Math.min(a,o+50));throw new Error(`readTagExp returned undefined at position ${o}. Context: "${b}"`)}let c=u.tagName;const f=u.rawTagName;let d=u.tagExp,E=u.attrExpPresent,p=u.closeIndex;if({tagName:c,tagExp:d}=k(s.transformTagName,c,d,s),s.strictReservedNames&&(c===s.commentPropName||c===s.cdataPropName||c===s.textNodeName||c===s.attributesGroupName))throw new Error(`Invalid tag name: ${c}`);t&&r&&t.tagname!=="!xml"&&(r=this.saveTextToParentTag(r,t,this.readonlyMatcher,!1));const m=t;m&&s.unpairedTagsSet.has(m.tagname)&&(t=this.tagsNodeStack.pop(),this.matcher.pop());let T=!1;d.length>0&&d.lastIndexOf("/")===d.length-1&&(T=!0,c[c.length-1]==="/"?(c=c.substr(0,c.length-1),d=c):d=d.substr(0,d.length-1),E=c!==d);let _=null,W;W=et(f),c!==e.tagname&&this.matcher.push(c,{},W),c!==d&&E&&(_=this.buildAttributesMap(d,this.matcher,c),_&&De(_,s)),c!==e.tagname&&(this.isCurrentNodeStopNode=this.isItStopNode());const P=o;if(this.isCurrentNodeStopNode){let b="";if(T)o=u.closeIndex;else if(s.unpairedTagsSet.has(c))o=u.closeIndex;else{const $=this.readStopNodeData(n,f,p+1);if(!$)throw new Error(`Unexpected end of ${f}`);o=$.i,b=$.tagContent}const O=new C(c);_&&(O[":@"]=_),O.add(s.textNodeName,b),this.matcher.pop(),this.isCurrentNodeStopNode=!1,this.addChild(t,O,this.readonlyMatcher,P)}else{if(T){({tagName:c,tagExp:d}=k(s.transformTagName,c,d,s));const b=new C(c);_&&(b[":@"]=_),this.addChild(t,b,this.readonlyMatcher,P),this.matcher.pop(),this.isCurrentNodeStopNode=!1}else if(s.unpairedTagsSet.has(c)){const b=new C(c);_&&(b[":@"]=_),this.addChild(t,b,this.readonlyMatcher,P),this.matcher.pop(),this.isCurrentNodeStopNode=!1,o=u.closeIndex;continue}else{const b=new C(c);if(this.tagsNodeStack.length>s.maxNestedTags)throw new Error("Maximum nested tags exceeded");this.tagsNodeStack.push(t),_&&(b[":@"]=_),this.addChild(t,b,this.readonlyMatcher,P),t=b}r="",o=p}}}else r+=n[o];return e.child};function at(n,e,t,r){this.options.captureMetaData||(r=void 0);const s=this.options.jPath?t.toString():t,i=this.options.updateTag(e.tagname,s,e[":@"]);i===!1||(typeof i=="string"&&(e.tagname=i),n.addChild(e,r))}function lt(n,e,t){const r=this.options.processEntities;if(!r||!r.enabled)return n;if(r.allowedTags){const s=this.options.jPath?t.toString():t;if(!(Array.isArray(r.allowedTags)?r.allowedTags.includes(e):r.allowedTags(e,s)))return n}if(r.tagFilter){const s=this.options.jPath?t.toString():t;if(!r.tagFilter(e,s))return n}return this.entityDecoder.decode(n)}function ut(n,e,t,r){return n&&(r===void 0&&(r=e.child.length===0),n=this.parseTextData(n,e.tagname,t,!1,e[":@"]?Object.keys(e[":@"]).length!==0:!1,r),n!==void 0&&n!==""&&e.add(this.options.textNodeName,n),n=""),n}function ht(){return this.stopNodeExpressionsSet.size===0?!1:this.matcher.matchesAny(this.stopNodeExpressionsSet)}function ct(n,e,t=">"){let r=0;const s=n.length,i=t.charCodeAt(0),a=t.length>1?t.charCodeAt(1):-1;let o="",l=e;for(let h=e;h",t,`${e} is not closed`);if(n.substring(t+2,o).trim()===e&&(s--,s===0))return{tagContent:n.substring(r,t),i:o};t=o}else if(a===63)t=A(n,"?>",t+1,"StopNode is not closed.");else if(a===33&&n.charCodeAt(t+2)===45&&n.charCodeAt(t+3)===45)t=A(n,"-->",t+3,"StopNode is not closed.");else if(a===33&&n.charCodeAt(t+2)===91)t=A(n,"]]>",t,"StopNode is not closed.")-2;else{const o=B(n,t,!1);o&&((o&&o.tagName)===e&&o.tagExp[o.tagExp.length-1]!=="/"&&s++,t=o.closeIndex)}}}function U(n,e,t){if(e&&typeof n=="string"){const r=n.trim();return r==="true"?!0:r==="false"?!1:Ye(n,t)}else return fe(n)?n:""}function k(n,e,t,r){if(n){const s=n(e);t===e&&(t=s),e=s}return e=ae(e,r),{tagName:e,tagExp:t}}function ae(n,e){if(D.includes(n))throw new Error(`[SECURITY] Invalid name: "${n}" is a reserved JavaScript keyword that could cause prototype pollution`);return X.includes(n)?e.onDangerousProperty(n):n}const R=C.getMetaDataSymbol();function pt(n,e){if(!n||typeof n!="object")return{};if(!e)return n;const t={};for(const r in n)if(r.startsWith(e)){const s=r.substring(e.length);t[s]=n[r]}else t[r]=n[r];return t}function gt(n,e,t,r){return le(n,e,t,r)}function le(n,e,t,r){let s;const i={};for(let a=0;a0&&(i[e.textNodeName]=s):s!==void 0&&(i[e.textNodeName]=s),i}function Et(n){const e=Object.keys(n);for(let t=0;t=0,IS_IE6:navigator.userAgent!=null&&navigator.userAgent.indexOf("MSIE 6")>=0,IS_IE11:navigator.userAgent!=null&&!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:navigator.userAgent!=null&&!!navigator.userAgent.match(/Edge\//),IS_QUIRKS:navigator.userAgent!=null&&navigator.userAgent.indexOf("MSIE")>=0&&(document.documentMode==null||document.documentMode==5),IS_EM:"spellcheck"in document.createElement("textarea")&&document.documentMode==8,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:navigator.userAgent!=null&&navigator.userAgent.indexOf("Mozilla/")>=0&&navigator.userAgent.indexOf("MSIE")<0&&navigator.userAgent.indexOf("Edge/")<0,IS_OP:navigator.userAgent!=null&&(navigator.userAgent.indexOf("Opera/")>=0||navigator.userAgent.indexOf("OPR/")>=0),IS_OT:navigator.userAgent!=null&&navigator.userAgent.indexOf("Presto/")>=0&&navigator.userAgent.indexOf("Presto/2.4.")<0&&navigator.userAgent.indexOf("Presto/2.3.")<0&&navigator.userAgent.indexOf("Presto/2.2.")<0&&navigator.userAgent.indexOf("Presto/2.1.")<0&&navigator.userAgent.indexOf("Presto/2.0.")<0&&navigator.userAgent.indexOf("Presto/1.")<0,IS_SF:/Apple Computer, Inc/.test(navigator.vendor),IS_ANDROID:navigator.appVersion.indexOf("Android")>=0,IS_IOS:/iP(hone|od|ad)/.test(navigator.platform),IS_GC:/Google Inc/.test(navigator.vendor),IS_CHROMEAPP:window.chrome!=null&&chrome.app!=null&&chrome.app.runtime!=null,IS_FF:typeof InstallTrigger<"u",IS_MT:navigator.userAgent.indexOf("Firefox/")>=0&&navigator.userAgent.indexOf("Firefox/1.")<0&&navigator.userAgent.indexOf("Firefox/2.")<0||navigator.userAgent.indexOf("Iceweasel/")>=0&&navigator.userAgent.indexOf("Iceweasel/1.")<0&&navigator.userAgent.indexOf("Iceweasel/2.")<0||navigator.userAgent.indexOf("SeaMonkey/")>=0&&navigator.userAgent.indexOf("SeaMonkey/1.")<0||navigator.userAgent.indexOf("Iceape/")>=0&&navigator.userAgent.indexOf("Iceape/1.")<0,IS_VML:navigator.appName.toUpperCase()=="MICROSOFT INTERNET EXPLORER",IS_SVG:navigator.appName.toUpperCase()!="MICROSOFT INTERNET EXPLORER",NO_FO:!document.createElementNS||document.createElementNS("http://www.w3.org/2000/svg","foreignObject")!="[object SVGForeignObjectElement]"||navigator.userAgent.indexOf("Opera/")>=0,IS_WIN:navigator.appVersion.indexOf("Win")>0,IS_MAC:navigator.appVersion.indexOf("Mac")>0,IS_CHROMEOS:/\bCrOS\b/.test(navigator.appVersion),IS_TOUCH:"ontouchstart"in document.documentElement,IS_POINTER:window.PointerEvent!=null&&!(navigator.appVersion.indexOf("Mac")>0),IS_LOCAL:document.location.href.indexOf("http://")<0&&document.location.href.indexOf("https://")<0,defaultBundles:[],isBrowserSupported:function(){return mxClient.IS_VML||mxClient.IS_SVG},link:function(t,e,i,n){if(i=i||document,mxClient.IS_IE6)i.write('');else{var r=i.createElement("link");r.setAttribute("rel",t),r.setAttribute("href",e),r.setAttribute("charset","UTF-8"),r.setAttribute("type","text/css"),n&&r.setAttribute("id",n);var s=i.getElementsByTagName("head")[0];s.appendChild(r)}},loadResources:function(t,e){var i=mxClient.defaultBundles.length;function n(){--i==0&&t()}for(var r=0;r<\/script>')}};typeof mxLoadResources>"u"&&(mxLoadResources=!0),typeof mxForceIncludes>"u"&&(mxForceIncludes=!1),typeof mxResourceExtension>"u"&&(mxResourceExtension=".txt"),typeof mxLoadStylesheets>"u"&&(mxLoadStylesheets=!0),typeof mxBasePath<"u"&&mxBasePath.length>0?(mxBasePath.substring(mxBasePath.length-1)=="/"&&(mxBasePath=mxBasePath.substring(0,mxBasePath.length-1)),mxClient.basePath=mxBasePath):mxClient.basePath=".",typeof mxImageBasePath<"u"&&mxImageBasePath.length>0?(mxImageBasePath.substring(mxImageBasePath.length-1)=="/"&&(mxImageBasePath=mxImageBasePath.substring(0,mxImageBasePath.length-1)),mxClient.imageBasePath=mxImageBasePath):mxClient.imageBasePath=mxClient.basePath+"/images",typeof mxLanguage<"u"&&mxLanguage!=null?mxClient.language=mxLanguage:mxClient.language=mxClient.IS_IE?navigator.userLanguage:navigator.language,typeof mxDefaultLanguage<"u"&&mxDefaultLanguage!=null?mxClient.defaultLanguage=mxDefaultLanguage:mxClient.defaultLanguage="en",mxLoadStylesheets&&mxClient.link("stylesheet",mxClient.basePath+"/css/common.css"),typeof mxLanguages<"u"&&mxLanguages!=null&&(mxClient.languages=mxLanguages),mxClient.IS_VML&&(mxClient.IS_SVG?mxClient.IS_VML=!1:(document.namespaces!=null&&(document.documentMode==8?(document.namespaces.add(mxClient.VML_PREFIX,"urn:schemas-microsoft-com:vml","#default#VML"),document.namespaces.add(mxClient.OFFICE_PREFIX,"urn:schemas-microsoft-com:office:office","#default#VML")):(document.namespaces.add(mxClient.VML_PREFIX,"urn:schemas-microsoft-com:vml"),document.namespaces.add(mxClient.OFFICE_PREFIX,"urn:schemas-microsoft-com:office:office"))),mxClient.IS_QUIRKS&&document.styleSheets.length>=30?(function(){var t=document.createElement("style");t.type="text/css",t.styleSheet.cssText=mxClient.VML_PREFIX+"\\:*{behavior:url(#default#VML)}"+mxClient.OFFICE_PREFIX+"\\:*{behavior:url(#default#VML)}",document.getElementsByTagName("head")[0].appendChild(t)})():document.createStyleSheet().cssText=mxClient.VML_PREFIX+"\\:*{behavior:url(#default#VML)}"+mxClient.OFFICE_PREFIX+"\\:*{behavior:url(#default#VML)}",mxLoadStylesheets&&mxClient.link("stylesheet",mxClient.basePath+"/css/explorer.css"))),(mxForceIncludes||module.exports==null)&&(mxClient.include(mxClient.basePath+"/js/util/mxLog.js"),mxClient.include(mxClient.basePath+"/js/util/mxObjectIdentity.js"),mxClient.include(mxClient.basePath+"/js/util/mxDictionary.js"),mxClient.include(mxClient.basePath+"/js/util/mxResources.js"),mxClient.include(mxClient.basePath+"/js/util/mxPoint.js"),mxClient.include(mxClient.basePath+"/js/util/mxRectangle.js"),mxClient.include(mxClient.basePath+"/js/util/mxEffects.js"),mxClient.include(mxClient.basePath+"/js/util/mxUtils.js"),mxClient.include(mxClient.basePath+"/js/util/mxConstants.js"),mxClient.include(mxClient.basePath+"/js/util/mxEventObject.js"),mxClient.include(mxClient.basePath+"/js/util/mxMouseEvent.js"),mxClient.include(mxClient.basePath+"/js/util/mxEventSource.js"),mxClient.include(mxClient.basePath+"/js/util/mxEvent.js"),mxClient.include(mxClient.basePath+"/js/util/mxXmlRequest.js"),mxClient.include(mxClient.basePath+"/js/util/mxClipboard.js"),mxClient.include(mxClient.basePath+"/js/util/mxWindow.js"),mxClient.include(mxClient.basePath+"/js/util/mxForm.js"),mxClient.include(mxClient.basePath+"/js/util/mxImage.js"),mxClient.include(mxClient.basePath+"/js/util/mxDivResizer.js"),mxClient.include(mxClient.basePath+"/js/util/mxDragSource.js"),mxClient.include(mxClient.basePath+"/js/util/mxToolbar.js"),mxClient.include(mxClient.basePath+"/js/util/mxUndoableEdit.js"),mxClient.include(mxClient.basePath+"/js/util/mxUndoManager.js"),mxClient.include(mxClient.basePath+"/js/util/mxUrlConverter.js"),mxClient.include(mxClient.basePath+"/js/util/mxPanningManager.js"),mxClient.include(mxClient.basePath+"/js/util/mxPopupMenu.js"),mxClient.include(mxClient.basePath+"/js/util/mxAutoSaveManager.js"),mxClient.include(mxClient.basePath+"/js/util/mxAnimation.js"),mxClient.include(mxClient.basePath+"/js/util/mxMorphing.js"),mxClient.include(mxClient.basePath+"/js/util/mxImageBundle.js"),mxClient.include(mxClient.basePath+"/js/util/mxImageExport.js"),mxClient.include(mxClient.basePath+"/js/util/mxAbstractCanvas2D.js"),mxClient.include(mxClient.basePath+"/js/util/mxXmlCanvas2D.js"),mxClient.include(mxClient.basePath+"/js/util/mxSvgCanvas2D.js"),mxClient.include(mxClient.basePath+"/js/util/mxVmlCanvas2D.js"),mxClient.include(mxClient.basePath+"/js/util/mxGuide.js"),mxClient.include(mxClient.basePath+"/js/shape/mxShape.js"),mxClient.include(mxClient.basePath+"/js/shape/mxStencil.js"),mxClient.include(mxClient.basePath+"/js/shape/mxStencilRegistry.js"),mxClient.include(mxClient.basePath+"/js/shape/mxMarker.js"),mxClient.include(mxClient.basePath+"/js/shape/mxActor.js"),mxClient.include(mxClient.basePath+"/js/shape/mxCloud.js"),mxClient.include(mxClient.basePath+"/js/shape/mxRectangleShape.js"),mxClient.include(mxClient.basePath+"/js/shape/mxEllipse.js"),mxClient.include(mxClient.basePath+"/js/shape/mxDoubleEllipse.js"),mxClient.include(mxClient.basePath+"/js/shape/mxRhombus.js"),mxClient.include(mxClient.basePath+"/js/shape/mxPolyline.js"),mxClient.include(mxClient.basePath+"/js/shape/mxArrow.js"),mxClient.include(mxClient.basePath+"/js/shape/mxArrowConnector.js"),mxClient.include(mxClient.basePath+"/js/shape/mxText.js"),mxClient.include(mxClient.basePath+"/js/shape/mxTriangle.js"),mxClient.include(mxClient.basePath+"/js/shape/mxHexagon.js"),mxClient.include(mxClient.basePath+"/js/shape/mxLine.js"),mxClient.include(mxClient.basePath+"/js/shape/mxImageShape.js"),mxClient.include(mxClient.basePath+"/js/shape/mxLabel.js"),mxClient.include(mxClient.basePath+"/js/shape/mxCylinder.js"),mxClient.include(mxClient.basePath+"/js/shape/mxConnector.js"),mxClient.include(mxClient.basePath+"/js/shape/mxSwimlane.js"),mxClient.include(mxClient.basePath+"/js/layout/mxGraphLayout.js"),mxClient.include(mxClient.basePath+"/js/layout/mxStackLayout.js"),mxClient.include(mxClient.basePath+"/js/layout/mxPartitionLayout.js"),mxClient.include(mxClient.basePath+"/js/layout/mxCompactTreeLayout.js"),mxClient.include(mxClient.basePath+"/js/layout/mxRadialTreeLayout.js"),mxClient.include(mxClient.basePath+"/js/layout/mxFastOrganicLayout.js"),mxClient.include(mxClient.basePath+"/js/layout/mxCircleLayout.js"),mxClient.include(mxClient.basePath+"/js/layout/mxParallelEdgeLayout.js"),mxClient.include(mxClient.basePath+"/js/layout/mxCompositeLayout.js"),mxClient.include(mxClient.basePath+"/js/layout/mxEdgeLabelLayout.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/model/mxGraphAbstractHierarchyCell.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/model/mxGraphHierarchyNode.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/model/mxGraphHierarchyEdge.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/model/mxGraphHierarchyModel.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/model/mxSwimlaneModel.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/stage/mxHierarchicalLayoutStage.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/stage/mxMedianHybridCrossingReduction.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/stage/mxMinimumCycleRemover.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/stage/mxCoordinateAssignment.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/stage/mxSwimlaneOrdering.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/mxHierarchicalLayout.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/mxSwimlaneLayout.js"),mxClient.include(mxClient.basePath+"/js/model/mxGraphModel.js"),mxClient.include(mxClient.basePath+"/js/model/mxCell.js"),mxClient.include(mxClient.basePath+"/js/model/mxGeometry.js"),mxClient.include(mxClient.basePath+"/js/model/mxCellPath.js"),mxClient.include(mxClient.basePath+"/js/view/mxPerimeter.js"),mxClient.include(mxClient.basePath+"/js/view/mxPrintPreview.js"),mxClient.include(mxClient.basePath+"/js/view/mxStylesheet.js"),mxClient.include(mxClient.basePath+"/js/view/mxCellState.js"),mxClient.include(mxClient.basePath+"/js/view/mxGraphSelectionModel.js"),mxClient.include(mxClient.basePath+"/js/view/mxCellEditor.js"),mxClient.include(mxClient.basePath+"/js/view/mxCellRenderer.js"),mxClient.include(mxClient.basePath+"/js/view/mxEdgeStyle.js"),mxClient.include(mxClient.basePath+"/js/view/mxStyleRegistry.js"),mxClient.include(mxClient.basePath+"/js/view/mxGraphView.js"),mxClient.include(mxClient.basePath+"/js/view/mxGraph.js"),mxClient.include(mxClient.basePath+"/js/view/mxCellOverlay.js"),mxClient.include(mxClient.basePath+"/js/view/mxOutline.js"),mxClient.include(mxClient.basePath+"/js/view/mxMultiplicity.js"),mxClient.include(mxClient.basePath+"/js/view/mxLayoutManager.js"),mxClient.include(mxClient.basePath+"/js/view/mxSwimlaneManager.js"),mxClient.include(mxClient.basePath+"/js/view/mxTemporaryCellStates.js"),mxClient.include(mxClient.basePath+"/js/view/mxCellStatePreview.js"),mxClient.include(mxClient.basePath+"/js/view/mxConnectionConstraint.js"),mxClient.include(mxClient.basePath+"/js/handler/mxGraphHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxPanningHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxPopupMenuHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxCellMarker.js"),mxClient.include(mxClient.basePath+"/js/handler/mxSelectionCellsHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxConnectionHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxConstraintHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxRubberband.js"),mxClient.include(mxClient.basePath+"/js/handler/mxHandle.js"),mxClient.include(mxClient.basePath+"/js/handler/mxVertexHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxEdgeHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxElbowEdgeHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxEdgeSegmentHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxKeyHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxTooltipHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxCellTracker.js"),mxClient.include(mxClient.basePath+"/js/handler/mxCellHighlight.js"),mxClient.include(mxClient.basePath+"/js/editor/mxDefaultKeyHandler.js"),mxClient.include(mxClient.basePath+"/js/editor/mxDefaultPopupMenu.js"),mxClient.include(mxClient.basePath+"/js/editor/mxDefaultToolbar.js"),mxClient.include(mxClient.basePath+"/js/editor/mxEditor.js"),mxClient.include(mxClient.basePath+"/js/io/mxCodecRegistry.js"),mxClient.include(mxClient.basePath+"/js/io/mxCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxObjectCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxCellCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxModelCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxRootChangeCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxChildChangeCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxTerminalChangeCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxGenericChangeCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxGraphCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxGraphViewCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxStylesheetCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxDefaultKeyHandlerCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxDefaultToolbarCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxDefaultPopupMenuCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxEditorCodec.js")),__mxOutput.mxClient=typeof mxClient<"u"?mxClient:void 0;var mxLog={consoleName:"Console",TRACE:!1,DEBUG:!0,WARN:!0,buffer:"",init:function(){if(mxLog.window==null&&document.body!=null){var t=mxLog.consoleName+" - mxGraph "+mxClient.VERSION,e=document.createElement("table");e.setAttribute("width","100%"),e.setAttribute("height","100%");var i=document.createElement("tbody"),n=document.createElement("tr"),r=document.createElement("td");r.style.verticalAlign="top",mxLog.textarea=document.createElement("textarea"),mxLog.textarea.setAttribute("wrap","off"),mxLog.textarea.setAttribute("readOnly","true"),mxLog.textarea.style.height="100%",mxLog.textarea.style.resize="none",mxLog.textarea.value=mxLog.buffer,mxClient.IS_NS&&document.compatMode!="BackCompat"?mxLog.textarea.style.width="99%":mxLog.textarea.style.width="100%",r.appendChild(mxLog.textarea),n.appendChild(r),i.appendChild(n),n=document.createElement("tr"),mxLog.td=document.createElement("td"),mxLog.td.style.verticalAlign="top",mxLog.td.setAttribute("height","30px"),n.appendChild(mxLog.td),i.appendChild(n),e.appendChild(i),mxLog.addButton("Info",function(u){mxLog.info()}),mxLog.addButton("DOM",function(u){var p=mxUtils.getInnerHtml(document.body);mxLog.debug(p)}),mxLog.addButton("Trace",function(u){mxLog.TRACE=!mxLog.TRACE,mxLog.TRACE?mxLog.debug("Tracing enabled"):mxLog.debug("Tracing disabled")}),mxLog.addButton("Copy",function(u){try{mxUtils.copy(mxLog.textarea.value)}catch(p){mxUtils.alert(p)}}),mxLog.addButton("Show",function(u){try{mxUtils.popup(mxLog.textarea.value)}catch(p){mxUtils.alert(p)}}),mxLog.addButton("Clear",function(u){mxLog.textarea.value=""});var s=0,l=0;if(typeof window.innerWidth=="number"?(s=window.innerHeight,l=window.innerWidth):(s=document.documentElement.clientHeight||document.body.clientHeight,l=document.body.clientWidth),mxLog.window=new mxWindow(t,e,Math.max(0,l-320),Math.max(0,s-210),300,160),mxLog.window.setMaximizable(!0),mxLog.window.setScrollable(!1),mxLog.window.setResizable(!0),mxLog.window.setClosable(!0),mxLog.window.destroyOnClose=!1,(mxClient.IS_NS||mxClient.IS_IE)&&!mxClient.IS_GC&&!mxClient.IS_SF&&document.compatMode!="BackCompat"||document.documentMode==11){var a=mxLog.window.getElement(),o=function(u,p){mxLog.textarea.style.height=Math.max(0,a.offsetHeight-70)+"px"};mxLog.window.addListener(mxEvent.RESIZE_END,o),mxLog.window.addListener(mxEvent.MAXIMIZE,o),mxLog.window.addListener(mxEvent.NORMALIZE,o),mxLog.textarea.style.height="92px"}}},info:function(){mxLog.writeln(mxUtils.toString(navigator))},addButton:function(t,e){var i=document.createElement("button");mxUtils.write(i,t),mxEvent.addListener(i,"click",e),mxLog.td.appendChild(i)},isVisible:function(){return mxLog.window!=null?mxLog.window.isVisible():!1},show:function(){mxLog.setVisible(!0)},setVisible:function(t){mxLog.window==null&&mxLog.init(),mxLog.window!=null&&mxLog.window.setVisible(t)},enter:function(t){if(mxLog.TRACE)return mxLog.writeln("Entering "+t),new Date().getTime()},leave:function(t,e){if(mxLog.TRACE){var i=e!=0?" ("+(new Date().getTime()-e)+" ms)":"";mxLog.writeln("Leaving "+t+i)}},debug:function(){mxLog.DEBUG&&mxLog.writeln.apply(this,arguments)},warn:function(){mxLog.WARN&&mxLog.writeln.apply(this,arguments)},write:function(){for(var t="",e=0;e=0&&(mxLog.textarea.style.visibility="hidden",mxLog.textarea.style.visibility="visible"),mxLog.textarea.scrollTop=mxLog.textarea.scrollHeight):mxLog.buffer+=t},writeln:function(){for(var t="",e=0;e=0:!0},getDefaultBundle:function(t,e){return mxResources.loadDefaultBundle||!mxResources.isLanguageSupported(e)?t+mxResources.extension:null},getSpecialBundle:function(t,e){if(mxClient.languages==null||!this.isLanguageSupported(e)){var i=e.indexOf("-");i>0&&(e=e.substring(0,i))}return mxResources.loadSpecialBundle&&mxResources.isLanguageSupported(e)&&e!=mxClient.defaultLanguage?t+"_"+e+mxResources.extension:null},add:function(t,e,i){if(e=e??(mxClient.language!=null?mxClient.language.toLowerCase():mxConstants.NONE),e!=mxConstants.NONE){var n=mxResources.getDefaultBundle(t,e),r=mxResources.getSpecialBundle(t,e),s=function(){if(r!=null)if(i)mxUtils.get(r,function(o){mxResources.parse(o.getText()),i()},function(){i()});else try{var a=mxUtils.load(r);a.isReady()&&mxResources.parse(a.getText())}catch{}else i?.()};if(n!=null)if(i)mxUtils.get(n,function(a){mxResources.parse(a.getText()),s()},function(){s()});else try{var l=mxUtils.load(n);l.isReady()&&mxResources.parse(l.getText()),s()}catch{}else s()}},parse:function(t){if(t!=null){for(var e=t.split(` +`),i=0;i0){var r=e[i].substring(0,n),s=e[i].length;e[i].charCodeAt(s-1)==13&&s--;var l=e[i].substring(n+1,s);this.resourcesEncoded?(l=l.replace(/\\(?=u[a-fA-F\d]{4})/g,"%"),mxResources.resources[r]=unescape(l)):mxResources.resources[r]=l}}}},get:function(t,e,i){var n=mxResources.resources[t];return n==null&&(n=i),n!=null&&e!=null&&(n=mxResources.replacePlaceholders(n,e)),n},replacePlaceholders:function(t,e){for(var i=[],n=null,r=0;r=0&&n0?window.setTimeout(a,r):(t.style.visibility="hidden",i&&t.parentNode&&t.parentNode.removeChild(t))};window.setTimeout(a,r)}else t.style.visibility="hidden",i&&t.parentNode&&t.parentNode.removeChild(t)}};__mxOutput.mxEffects=typeof mxEffects<"u"?mxEffects:void 0;var mxUtils={errorResource:mxClient.language!="none"?"error":"",closeResource:mxClient.language!="none"?"close":"",errorImage:mxClient.imageBasePath+"/error.gif",removeCursors:function(t){t.style!=null&&(t.style.cursor="");var e=t.childNodes;if(e!=null)for(var i=e.length,n=0;n=9&&document.documentMode<10&&(t="ms"),function(e,i,n){e[i]=n,t!=null&&i.length>0&&(i=t+i.substring(0,1).toUpperCase()+i.substring(1),e[i]=n)}})(),hasScrollbars:function(t){var e=mxUtils.getCurrentStyle(t);return e!=null&&(e.overflow=="scroll"||e.overflow=="auto")},bind:function(t,e){return function(){return e.apply(t,arguments)}},eval:function(expr){var result=null;if(expr.indexOf("function")>=0)try{eval("var _mxJavaScriptExpression="+expr),result=_mxJavaScriptExpression,_mxJavaScriptExpression=null}catch(t){mxLog.warn(t.message+" while evaluating "+expr)}else try{result=eval(expr)}catch(t){mxLog.warn(t.message+" while evaluating "+expr)}return result},findNode:function(t,e,i){if(t.nodeType==mxConstants.NODETYPE_ELEMENT){var n=t.getAttribute(e);if(n!=null&&n==i)return t}for(t=t.firstChild;t!=null;){var r=mxUtils.findNode(t,e,i);if(r!=null)return r;t=t.nextSibling}return null},getFunctionName:function(t){var e=null;if(t!=null){if(t.name!=null)e=t.name;else if(e=mxUtils.trim(t.toString()),/^function\s/.test(e)){e=mxUtils.ltrim(e.substring(9));var i=e.indexOf("(");i>0&&(e=e.substring(0,i))}}return e},indexOf:function(t,e){if(t!=null&&e!=null){for(var i=0;i=0;)e.splice(n,1),i=t,n=mxUtils.indexOf(e,t);for(var r in e)e[r]==t&&(delete e[r],i=t);return i},isNode:function(t,e,i,n){return t!=null&&!isNaN(t.nodeType)&&(e==null||t.nodeName.toLowerCase()==e.toLowerCase())?i==null||t.getAttribute(i)==n:!1},isAncestorNode:function(t,e){for(var i=e;i!=null;){if(i==t)return!0;i=i.parentNode}return!1},getChildNodes:function(t,e){e=e||mxConstants.NODETYPE_ELEMENT;for(var i=[],n=t.firstChild;n!=null;)n.nodeType==e&&i.push(n),n=n.nextSibling;return i},importNode:function(t,e,i){return mxClient.IS_IE&&(document.documentMode==null||document.documentMode<10)?mxUtils.importNodeImplementation(t,e,i):t.importNode(e,i)},importNodeImplementation:function(t,e,i){switch(e.nodeType){case 1:{var n=t.createElement(e.nodeName);if(e.attributes&&e.attributes.length>0)for(var r=0;r0)for(var r=0;r/g,">"),(e==null||e)&&(t=t.replace(/\n/g," ")),t},isVml:function(t){return t!=null&&t.tagUrn=="urn:schemas-microsoft-com:vml"},getXml:function(t,e){var i="";if(mxClient.IS_IE||mxClient.IS_IE11)i=mxUtils.getPrettyXml(t,"","","");else if(window.XMLSerializer!=null){var n=new XMLSerializer;i=n.serializeToString(t)}else t.xml!=null&&(i=t.xml.replace(/\r\n\t[\t]*/g,"").replace(/>\r\n/g,">").replace(/\r\n/g,` +`));return e=e||" ",i=i.replace(/\n/g,e),i},getPrettyXml:function(t,e,i,n,r){var s=[];if(t!=null)if(e=e??" ",i=i??"",n=n??` +`,t.namespaceURI!=null&&t.namespaceURI!=r&&(r=t.namespaceURI,t.getAttribute("xmlns")==null&&t.setAttribute("xmlns",t.namespaceURI)),t.nodeType==mxConstants.NODETYPE_DOCUMENT)s.push(mxUtils.getPrettyXml(t.documentElement,e,i,n,r));else if(t.nodeType==mxConstants.NODETYPE_DOCUMENT_FRAGMENT){var l=t.firstChild;if(l!=null)for(;l!=null;)s.push(mxUtils.getPrettyXml(l,e,i,n,r)),l=l.nextSibling}else if(t.nodeType==mxConstants.NODETYPE_COMMENT){var a=mxUtils.getTextContent(t);a.length>0&&s.push(i+""+n)}else if(t.nodeType==mxConstants.NODETYPE_TEXT){var a=mxUtils.trim(mxUtils.getTextContent(t));a.length>0&&s.push(i+mxUtils.htmlEntities(a,!1)+n)}else if(t.nodeType==mxConstants.NODETYPE_CDATA){var a=mxUtils.getTextContent(t);a.length>0&&s.push(i+""+n);l!=null;)s.push(mxUtils.getPrettyXml(l,e,i+e,n,r)),l=l.nextSibling;s.push(i+""+n)}else s.push(" />"+n)}return s.join("")},extractTextWithWhitespace:function(t){var e=["BLOCKQUOTE","DIV","H1","H2","H3","H4","H5","H6","OL","P","PRE","TABLE","UL"],i=[];function n(r){if(!(r.length==1&&(r[0].nodeName=="BR"||r[0].innerHTML==` +`)))for(var s=0;s"?i.push(` +`):(l.nodeType===3||l.nodeType===4?l.nodeValue.length>0&&i.push(l.nodeValue):l.nodeType!==8&&l.childNodes.length>0&&n(l.childNodes),s=0&&i.push(` +`))}}return n(t),i.join("")},replaceTrailingNewlines:function(t,e){for(var i="";t.length>0&&t.charAt(t.length-1)==` +`;)t=t.substring(0,t.length-1),i+=e;return t+i},getTextContent:function(t){return mxClient.IS_IE&&t.innerText!==void 0?t.innerText:t!=null?t[t.textContent===void 0?"text":"textContent"]:""},setTextContent:function(t,e){t.innerText!==void 0?t.innerText=e:t[t.textContent===void 0?"text":"textContent"]=e},getInnerHtml:(function(){return mxClient.IS_IE?function(t){return t!=null?t.innerHTML:""}:function(t){if(t!=null){var e=new XMLSerializer;return e.serializeToString(t)}return""}})(),getOuterHtml:(function(){return mxClient.IS_IE?function(t){if(t!=null){if(t.outerHTML!=null)return t.outerHTML;var e=[];e.push("<"+t.nodeName);var i=t.attributes;if(i!=null)for(var n=0;n0&&(e.push(" "),e.push(i[n].nodeName),e.push('="'),e.push(r),e.push('"'))}return t.innerHTML.length==0?e.push("/>"):(e.push(">"),e.push(t.innerHTML),e.push("")),e.join("")}return""}:function(t){if(t!=null){var e=new XMLSerializer;return e.serializeToString(t)}return""}})(),write:function(t,e){var i=t.ownerDocument,n=i.createTextNode(e);return t?.appendChild(n),n},writeln:function(t,e){var i=t.ownerDocument,n=i.createTextNode(e);return t!=null&&(t.appendChild(n),t.appendChild(document.createElement("br"))),n},br:function(t,e){e=e||1;for(var i=null,n=0;na&&(t.style.left=Math.max(s,a-n)+"px");var o=parseInt(t.offsetTop),u=parseInt(t.offsetHeight),p=l+e.height;o+u>p&&(t.style.top=Math.max(l,p-u)+"px")},load:function(t){var e=new mxXmlRequest(t,null,"GET",!1);return e.send(),e},get:function(t,e,i,n,r,s,l){var a=new mxXmlRequest(t,null,"GET"),o=a.setRequestHeaders;return l&&(a.setRequestHeaders=function(u,p){o.apply(this,arguments);for(var m in l)u.setRequestHeader(m,l[m])}),n!=null&&a.setBinary(n),a.send(e,i,r,s),a},getAll:function(t,e,i){for(var n=t.length,r=[],s=0,l=function(){s==0&&i!=null&&i(),s++},a=0;a299?l():(r[u]=p,n--,n==0&&e(r))},l)})(t[a],a);n==0&&e(r)},post:function(t,e,i,n){return new mxXmlRequest(t,e).send(i,n)},submit:function(t,e,i,n){return new mxXmlRequest(t,e).simulate(i,n)},loadInto:function(t,e,i){mxClient.IS_IE?e.onreadystatechange=function(){e.readyState==4&&i()}:e.addEventListener("load",i,!1),e.load(t)},getValue:function(t,e,i){var n=t!=null?t[e]:null;return n==null&&(n=i),n},getNumber:function(t,e,i){var n=t!=null?t[e]:null;return n==null&&(n=i||0),Number(n)},getColor:function(t,e,i){var n=t!=null?t[e]:null;return n==null?n=i:n==mxConstants.NONE&&(n=null),n},clone:function(t,e,i){i=i??!1;var n=null;if(t!=null&&typeof t.constructor=="function"){n=new t.constructor;for(var r in t)r!=mxObjectIdentity.FIELD_NAME&&(e==null||mxUtils.indexOf(e,r)<0)&&(!i&&typeof t[r]=="object"?n[r]=mxUtils.clone(t[r]):n[r]=t[r])}return n},equalPoints:function(t,e){if(t==null&&e!=null||t!=null&&e==null||t!=null&&e!=null&&t.length!=e.length)return!1;if(t!=null&&e!=null){for(var i=0;i [Function] +`;else if(typeof t[i]=="object"){var n=mxUtils.getFunctionName(t[i].constructor);e+=i+" => ["+n+`] +`}else e+=i+" = "+t[i]+` +`}catch(r){e+=i+"="+r.message}return e},toRadians:function(t){return Math.PI*t/180},toDegree:function(t){return t*180/Math.PI},arcToCurves:function(t,e,i,n,r,s,l,a,o){if(a-=t,o-=e,i===0||n===0)return N;var u=l,p=r;i=Math.abs(i),n=Math.abs(n);var m=-a/2,d=-o/2,x=Math.cos(p*Math.PI/180),f=Math.sin(p*Math.PI/180),g=x*m+f*d,c=-1*f*m+x*d,v=g*g,y=c*c,T=i*i,C=n*n,S=v/T+y/C,E;if(S>1)i=Math.sqrt(S)*i,n=Math.sqrt(S)*n,E=0;else{var L=1;s===u&&(L=-1),E=L*Math.sqrt((T*C-T*y-C*v)/(T*y+C*v))}var A=E*i*c/n,M=-1*E*n*g/i,I=x*A-f*M+a/2,P=f*A+x*M+o/2,R=Math.atan2((c-M)/n,(g-A)/i)-Math.atan2(0,1),O=R>=0?R:2*Math.PI+R;R=Math.atan2((-c-M)/n,(-g-A)/i)-Math.atan2((c-M)/n,(g-A)/i);var _=R>=0?R:2*Math.PI+R;u==0&&_>0?_-=2*Math.PI:u!=0&&_<0&&(_+=2*Math.PI);for(var b=_*2/Math.PI,k=Math.ceil(b<0?-1*b:b),G=_/k,B=8/3*Math.sin(G/4)*Math.sin(G/4)/Math.sin(G/2),j=x*i,H=x*n,W=f*i,X=f*n,V=Math.cos(O),Y=Math.sin(O),et=-B*(j*Y+X*V),q=-B*(W*Y-H*V),K=0,Z=0,N=[],D=0;D45?(u=1,o>=135&&(u=2)):o<-45&&(u=3,o<=-135&&(u=2)),s.indexOf(mxConstants.DIRECTION_NORTH)>=0)switch(u){case 0:l|=mxConstants.DIRECTION_MASK_NORTH;break;case 1:l|=mxConstants.DIRECTION_MASK_EAST;break;case 2:l|=mxConstants.DIRECTION_MASK_SOUTH;break;case 3:l|=mxConstants.DIRECTION_MASK_WEST;break}if(s.indexOf(mxConstants.DIRECTION_WEST)>=0)switch(u){case 0:l|=mxConstants.DIRECTION_MASK_WEST;break;case 1:l|=mxConstants.DIRECTION_MASK_NORTH;break;case 2:l|=mxConstants.DIRECTION_MASK_EAST;break;case 3:l|=mxConstants.DIRECTION_MASK_SOUTH;break}if(s.indexOf(mxConstants.DIRECTION_SOUTH)>=0)switch(u){case 0:l|=mxConstants.DIRECTION_MASK_SOUTH;break;case 1:l|=mxConstants.DIRECTION_MASK_WEST;break;case 2:l|=mxConstants.DIRECTION_MASK_NORTH;break;case 3:l|=mxConstants.DIRECTION_MASK_EAST;break}if(s.indexOf(mxConstants.DIRECTION_EAST)>=0)switch(u){case 0:l|=mxConstants.DIRECTION_MASK_EAST;break;case 1:l|=mxConstants.DIRECTION_MASK_SOUTH;break;case 2:l|=mxConstants.DIRECTION_MASK_WEST;break;case 3:l|=mxConstants.DIRECTION_MASK_NORTH;break}return l},reversePortConstraints:function(t){var e=0;return e=(t&mxConstants.DIRECTION_MASK_WEST)<<3,e|=(t&mxConstants.DIRECTION_MASK_NORTH)<<1,e|=(t&mxConstants.DIRECTION_MASK_SOUTH)>>1,e|=(t&mxConstants.DIRECTION_MASK_EAST)>>3,e},findNearestSegment:function(t,e,i){var n=-1;if(t.absolutePoints.length>0)for(var r=t.absolutePoints[0],s=null,l=1;lo.distSq)&&(n=o)}}return n!=null?n.p:null},rectangleIntersectsSegment:function(t,e,i){var n=t.y,r=t.x,s=n+t.height,l=r+t.width,a=e.x,o=i.x;if(e.x>i.x&&(a=i.x,o=e.x),o>l&&(o=l),ao)return!1;var u=e.y,p=i.y,m=i.x-e.x;if(Math.abs(m)>1e-7){var d=(i.y-e.y)/m,x=e.y-d*e.x;u=d*a+x,p=d*o+x}if(u>p){var f=p;p=u,u=f}return p>s&&(p=s),up)},contains:function(t,e,i){return t.x<=e&&t.x+t.width>=e&&t.y<=i&&t.y+t.height>=i},intersects:function(t,e){var i=t.width,n=t.height,r=e.width,s=e.height;if(r<=0||s<=0||i<=0||n<=0)return!1;var l=t.x,a=t.y,o=e.x,u=e.y;return r+=o,s+=u,i+=l,n+=a,(rl)&&(sa)&&(io)&&(nu)},intersectsHotspot:function(t,e,i,n,r,s){if(n=n??1,r=r??0,s=s??0,n>0){var l=t.getCenterX(),a=t.getCenterY(),o=t.width,u=t.height,p=mxUtils.getValue(t.style,mxConstants.STYLE_STARTSIZE)*t.view.scale;p>0&&(mxUtils.getValue(t.style,mxConstants.STYLE_HORIZONTAL,!0)?(a=t.y+p/2,u=p):(l=t.x+p/2,o=p)),o=Math.max(r,o*n),u=Math.max(r,u*n),s>0&&(o=Math.min(o,s),u=Math.min(u,s));var m=new mxRectangle(l-o/2,a-u/2,o,u),d=mxUtils.toRadians(mxUtils.getValue(t.style,mxConstants.STYLE_ROTATION)||0);if(d!=0){var x=Math.cos(-d),f=Math.sin(-d),l=new mxPoint(t.getCenterX(),t.getCenterY()),g=mxUtils.getRotatedPoint(new mxPoint(e,i),x,f,l);e=g.x,i=g.y}return mxUtils.contains(m,e,i)}return!0},getOffset:function(t,e){for(var i=0,n=0,r=!1,s=t,l=document.body,a=document.documentElement;s!=null&&s!=l&&s!=a&&!r;){var o=mxUtils.getCurrentStyle(s);o!=null&&(r=r||o.position=="fixed"),s=s.parentNode}if(!e&&!r){var u=mxUtils.getDocumentScrollOrigin(t.ownerDocument);i+=u.x,n+=u.y}var p=t.getBoundingClientRect();return p!=null&&(i+=p.left,n+=p.top),new mxPoint(i,n)},getDocumentScrollOrigin:function(t){if(mxClient.IS_QUIRKS)return new mxPoint(t.body.scrollLeft,t.body.scrollTop);var e=t.defaultView||t.parentWindow,i=e!=null&&window.pageXOffset!==void 0?window.pageXOffset:(document.documentElement||document.body.parentNode||document.body).scrollLeft,n=e!=null&&window.pageYOffset!==void 0?window.pageYOffset:(document.documentElement||document.body.parentNode||document.body).scrollTop;return new mxPoint(i,n)},getScrollOrigin:function(t,e,i){e=e??!1,i=i??!0;for(var n=t!=null?t.ownerDocument:document,r=n.body,s=n.documentElement,l=new mxPoint,a=!1;t!=null&&t!=r&&t!=s;){!isNaN(t.scrollLeft)&&!isNaN(t.scrollTop)&&(l.x+=t.scrollLeft,l.y+=t.scrollTop);var o=mxUtils.getCurrentStyle(t);o!=null&&(a=a||o.position=="fixed"),t=e?t.parentNode:null}if(!a&&i){var u=mxUtils.getDocumentScrollOrigin(n);l.x+=u.x,l.y+=u.y}return l},convertPoint:function(t,e,i){var n=mxUtils.getScrollOrigin(t,!1),r=mxUtils.getOffset(t);return r.x-=n.x,r.y-=n.y,new mxPoint(e-r.x,i-r.y)},ltrim:function(t,e){return e=e||"\\s",t!=null?t.replace(new RegExp("^["+e+"]+","g"),""):null},rtrim:function(t,e){return e=e||"\\s",t!=null?t.replace(new RegExp("["+e+"]+$","g"),""):null},trim:function(t,e){return mxUtils.ltrim(mxUtils.rtrim(t,e),e)},isNumeric:function(t){return!isNaN(parseFloat(t))&&isFinite(t)&&(typeof t!="string"||t.toLowerCase().indexOf("0x")<0)},isInteger:function(t){return String(parseInt(t))===String(t)},mod:function(t,e){return(t%e+e)%e},intersection:function(t,e,i,n,r,s,l,a){var o=(a-s)*(i-t)-(l-r)*(n-e),u=(l-r)*(e-s)-(a-s)*(t-r),p=(i-t)*(e-s)-(n-e)*(t-r),m=u/o,d=p/o;if(m>=0&&m<=1&&d>=0&&d<=1){var x=t+m*(i-t),f=e+m*(n-e);return new mxPoint(x,f)}return null},ptSegDistSq:function(t,e,i,n,r,s){i-=t,n-=e,r-=t,s-=e;var l=r*i+s*n,a;l<=0?a=0:(r=i-r,s=n-s,l=r*i+s*n,l<=0?a=0:a=l*l/(i*i+n*n));var o=r*r+s*s-a;return o<0&&(o=0),o},ptLineDist:function(t,e,i,n,r,s){return Math.abs((n-e)*r-(i-t)*s+i*e-n*t)/Math.sqrt((n-e)*(n-e)+(i-t)*(i-t))},relativeCcw:function(t,e,i,n,r,s){i-=t,n-=e,r-=t,s-=e;var l=r*n-s*i;return l==0&&(l=r*i+s*n,l>0&&(r-=i,s-=n,l=r*i+s*n,l<0&&(l=0))),l<0?-1:l>0?1:0},animateChanges:function(t,e){mxEffects.animateChanges.apply(this,arguments)},cascadeOpacity:function(t,e,i){mxEffects.cascadeOpacity.apply(this,arguments)},fadeOut:function(t,e,i,n,r,s){mxEffects.fadeOut.apply(this,arguments)},setOpacity:function(t,e){mxUtils.isVml(t)?e>=100?t.style.filter="":t.style.filter="alpha(opacity="+e/5+")":mxClient.IS_IE&&(typeof document.documentMode>"u"||document.documentMode<9)?e>=100?t.style.filter="":t.style.filter="alpha(opacity="+e+")":t.style.opacity=e/100},createImage:function(t){var e=null;return mxClient.IS_IE6&&document.compatMode!="CSS1Compat"?(e=document.createElement(mxClient.VML_PREFIX+":image"),e.setAttribute("src",t),e.style.borderStyle="none"):(e=document.createElement("img"),e.setAttribute("src",t),e.setAttribute("border","0")),e},sortCells:function(t,e){e=e??!0;var i=new mxDictionary;return t.sort(function(n,r){var s=i.get(n);s==null&&(s=mxCellPath.create(n).split(mxCellPath.PATH_SEPARATOR),i.put(n,s));var l=i.get(r);l==null&&(l=mxCellPath.create(r).split(mxCellPath.PATH_SEPARATOR),i.put(r,l));var a=mxCellPath.compare(s,l);return a==0?0:a>0==e?1:-1}),t},getStylename:function(t){if(t!=null){var e=t.split(";"),i=e[0];if(i.indexOf("=")<0)return i}return""},getStylenames:function(t){var e=[];if(t!=null)for(var i=t.split(";"),n=0;n0&&t.charAt(t.length-1)!=";"&&(t+=";"),t+=e),t},removeStylename:function(t,e){var i=[];if(t!=null)for(var n=t.split(";"),r=0;r=0&&e.push(i[n]);return e.join(";")},setCellStyles:function(t,e,i,n){if(e!=null&&e.length>0){t.beginUpdate();try{for(var r=0;r"u"||i.length>0);if(t==null||t.length==0)n&&(t=e+"="+i+";");else if(t.substring(0,e.length+1)==e+"="){var r=t.indexOf(";");n?t=e+"="+i+(r<0?";":t.substring(r)):t=r<0||r==t.length-1?"":t.substring(r+1)}else{var s=t.indexOf(";"+e+"=");if(s<0){if(n){var l=t.charAt(t.length-1)==";"?"":";";t=t+l+e+"="+i+";"}}else{var r=t.indexOf(";",s+1);n?t=t.substring(0,s+1)+e+"="+i+(r<0?";":t.substring(r)):t=t.substring(0,s)+(r<0?";":t.substring(r))}}return t},setCellStyleFlags:function(t,e,i,n,r){if(e!=null&&e.length>0){t.beginUpdate();try{for(var s=0;s=0?t.substring(l):"")}}return t},getAlignmentAsPoint:function(t,e){var i=-.5,n=-.5;return t==mxConstants.ALIGN_LEFT?i=0:t==mxConstants.ALIGN_RIGHT&&(i=-1),e==mxConstants.ALIGN_TOP?n=0:e==mxConstants.ALIGN_BOTTOM&&(n=-1),new mxPoint(i,n)},getSizeForString:function(t,e,i,n,r){e=e??mxConstants.DEFAULT_FONTSIZE,i=i??mxConstants.DEFAULT_FONTFAMILY;var s=document.createElement("div");if(s.style.fontFamily=i,s.style.fontSize=Math.round(e)+"px",s.style.lineHeight=Math.round(e*mxConstants.LINE_HEIGHT)+"px",r!=null){(r&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(s.style.fontWeight="bold"),(r&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(s.style.fontStyle="italic");var l=[];(r&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&l.push("underline"),(r&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&l.push("line-through"),l.length>0&&(s.style.textDecoration=l.join(" "))}s.style.position="absolute",s.style.visibility="hidden",s.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",s.style.zoom="1",n!=null?(s.style.width=n+"px",s.style.whiteSpace="normal"):s.style.whiteSpace="nowrap",s.innerHTML=t,document.body.appendChild(s);var a=new mxRectangle(0,0,s.offsetWidth,s.offsetHeight);return document.body.removeChild(s),a},getViewXml:function(t,e,i,n,r){if(n=n??0,r=r??0,e=e??1,i==null){var s=t.getModel();i=[s.getRoot()]}var l=t.getView(),a=null,o=l.isEventsEnabled();l.setEventsEnabled(!1);var u=l.drawPane,p=l.overlayPane;t.dialect==mxConstants.DIALECT_SVG?(l.drawPane=document.createElementNS(mxConstants.NS_SVG,"g"),l.canvas.appendChild(l.drawPane),l.overlayPane=document.createElementNS(mxConstants.NS_SVG,"g"),l.canvas.appendChild(l.overlayPane)):(l.drawPane=l.drawPane.cloneNode(!1),l.canvas.appendChild(l.drawPane),l.overlayPane=l.overlayPane.cloneNode(!1),l.canvas.appendChild(l.overlayPane));var m=l.getTranslate();l.translate=new mxPoint(n,r);var d=new mxTemporaryCellStates(t.getView(),e,i);try{var x=new mxCodec;a=x.encode(t.getView())}finally{d.destroy(),l.translate=m,l.canvas.removeChild(l.drawPane),l.canvas.removeChild(l.overlayPane),l.drawPane=u,l.overlayPane=p,l.setEventsEnabled(o)}return a},getScaleForPageCount:function(t,e,i,n){if(t<1)return 1;i=i??mxConstants.PAGE_FORMAT_A4_PORTRAIT,n=n??0;var r=i.width-n*2,s=i.height-n*2,l=e.getGraphBounds().clone(),a=e.getView().getScale();l.width/=a,l.height/=a;var o=l.width,u=l.height,p=1,m=r/s,d=o/u,x=d/m,f=Math.sqrt(t),g=Math.sqrt(x),c=f*g,v=f/g;if(c<1&&v>t){var y=v/t;v=t,c/=y}if(v<1&&c>t){var y=c/t;c=t,v/=y}for(var T=Math.ceil(c)*Math.ceil(v),C=0;T>t;){var S=Math.floor(c)/c,E=Math.floor(v)/v;S==1&&(S=Math.floor(c-1)/c),E==1&&(E=Math.floor(v-1)/v);var y=1;if(S>E?y=S:y=E,c=c*y,v=v*y,T=Math.ceil(c)*Math.ceil(v),C++,C>10)break}var L=r*c;return p=L/o,p*.99999},show:function(t,e,i,n,r,s){if(i=i??0,n=n??0,e==null){var l=window.open();e=l.document}else e.open();document.documentMode==9&&e.writeln('');var a=t.getGraphBounds(),o=Math.ceil(i-a.x),u=Math.ceil(n-a.y);if(r==null&&(r=Math.ceil(a.width+i)+Math.ceil(Math.ceil(a.x)-a.x)),s==null&&(s=Math.ceil(a.height+n)+Math.ceil(Math.ceil(a.y)-a.y)),mxClient.IS_IE||document.documentMode==11){for(var p="",m=document.getElementsByTagName("base"),d=0;d";for(var d=0;d',p+='
',p+=t.container.innerHTML,p+="
",e.writeln(p),e.close()}else{e.writeln("");for(var m=document.getElementsByTagName("base"),d=0;d'),e.close();var g=e.createElement("div");g.position="absolute",g.overflow="hidden",g.style.width=r+"px",g.style.height=s+"px";var c=e.createElement("div");c.style.position="absolute",c.style.left=o+"px",c.style.top=u+"px";for(var v=t.container.firstChild,y=null;v!=null;){var T=v.cloneNode(!0);v==t.view.drawPane.ownerSVGElement?(g.appendChild(T),y=T):c.appendChild(T),v=v.nextSibling}e.body.appendChild(g),c.firstChild!=null&&e.body.appendChild(c),y!=null&&(y.style.minWidth="",y.style.minHeight="",y.firstChild.setAttribute("transform","translate("+o+","+u+")"))}return mxUtils.removeCursors(e.body),e},printScreen:function(t){var e=window.open();t.getGraphBounds(),mxUtils.show(t,e.document);var i=function(){e.focus(),e.print(),e.close()};mxClient.IS_GC?e.setTimeout(i,500):i()},popup:function(t,e){if(e){var i=document.createElement("div");i.style.overflow="scroll",i.style.width="636px",i.style.height="460px";var n=document.createElement("pre");n.innerHTML=mxUtils.htmlEntities(t,!1).replace(/\n/g,"
").replace(/ /g," "),i.appendChild(n);var r=document.body.clientWidth,s=Math.max(document.body.clientHeight||0,document.documentElement.clientHeight),l=new mxWindow("Popup Window",i,r/2-320,s/2-240,640,480,!1,!0);l.setClosable(!0),l.setVisible(!0)}else if(mxClient.IS_NS){var l=window.open();l.document.writeln("
"+mxUtils.htmlEntities(t)+"").replace(/ /g," "),l.document.body.appendChild(n)}},alert:function(t){alert(t)},prompt:function(t,e){return prompt(t,e??"")},confirm:function(t){return confirm(t)},error:function(t,e,i,n){var r=document.createElement("div");r.style.padding="20px";var s=document.createElement("img");s.setAttribute("src",n||mxUtils.errorImage),s.setAttribute("valign","bottom"),s.style.verticalAlign="middle",r.appendChild(s),r.appendChild(document.createTextNode(" ")),r.appendChild(document.createTextNode(" ")),r.appendChild(document.createTextNode(" ")),mxUtils.write(r,t);var l=document.body.clientWidth,a=document.body.clientHeight||document.documentElement.clientHeight,o=new mxWindow(mxResources.get(mxUtils.errorResource)||mxUtils.errorResource,r,(l-e)/2,a/4,e,null,!1,!0);if(i){mxUtils.br(r);var u=document.createElement("p"),p=document.createElement("button");mxClient.IS_IE?p.style.cssText="float:right":p.setAttribute("style","float:right"),mxEvent.addListener(p,"click",function(m){o.destroy()}),mxUtils.write(p,mxResources.get(mxUtils.closeResource)||mxUtils.closeResource),u.appendChild(p),r.appendChild(u),mxUtils.br(r),o.setClosable(!0)}return o.setVisible(!0),o},makeDraggable:function(t,e,i,n,r,s,l,a,o,u){var p=new mxDragSource(t,i);return p.dragOffset=new mxPoint(r??0,s??mxConstants.TOOLTIP_VERTICAL_OFFSET),p.autoscroll=l,p.setGuidesEnabled(!1),o!=null&&(p.highlightDropTargets=o),u!=null&&(p.getDropTarget=u),p.getGraphForEvent=function(m){return typeof e=="function"?e(m):e},n!=null&&(p.createDragElement=function(){return n.cloneNode(!0)},a&&(p.createPreviewElement=function(m){var d=n.cloneNode(!0),x=parseInt(d.style.width),f=parseInt(d.style.height);return d.style.width=Math.round(x*m.view.scale)+"px",d.style.height=Math.round(f*m.view.scale)+"px",d})),p}};__mxOutput.mxUtils=typeof mxUtils<"u"?mxUtils:void 0;var mxConstants={DEFAULT_HOTSPOT:.3,MIN_HOTSPOT_SIZE:8,MAX_HOTSPOT_SIZE:0,RENDERING_HINT_EXACT:"exact",RENDERING_HINT_FASTER:"faster",RENDERING_HINT_FASTEST:"fastest",DIALECT_SVG:"svg",DIALECT_VML:"vml",DIALECT_MIXEDHTML:"mixedHtml",DIALECT_PREFERHTML:"preferHtml",DIALECT_STRICTHTML:"strictHtml",NS_SVG:"http://www.w3.org/2000/svg",NS_XHTML:"http://www.w3.org/1999/xhtml",NS_XLINK:"http://www.w3.org/1999/xlink",SHADOWCOLOR:"gray",VML_SHADOWCOLOR:"gray",SHADOW_OFFSET_X:2,SHADOW_OFFSET_Y:3,SHADOW_OPACITY:1,NODETYPE_ELEMENT:1,NODETYPE_ATTRIBUTE:2,NODETYPE_TEXT:3,NODETYPE_CDATA:4,NODETYPE_ENTITY_REFERENCE:5,NODETYPE_ENTITY:6,NODETYPE_PROCESSING_INSTRUCTION:7,NODETYPE_COMMENT:8,NODETYPE_DOCUMENT:9,NODETYPE_DOCUMENTTYPE:10,NODETYPE_DOCUMENT_FRAGMENT:11,NODETYPE_NOTATION:12,TOOLTIP_VERTICAL_OFFSET:16,DEFAULT_VALID_COLOR:"#00FF00",DEFAULT_INVALID_COLOR:"#FF0000",OUTLINE_HIGHLIGHT_COLOR:"#00FF00",OUTLINE_HIGHLIGHT_STROKEWIDTH:5,HIGHLIGHT_STROKEWIDTH:3,HIGHLIGHT_SIZE:2,HIGHLIGHT_OPACITY:100,CURSOR_MOVABLE_VERTEX:"move",CURSOR_MOVABLE_EDGE:"move",CURSOR_LABEL_HANDLE:"default",CURSOR_TERMINAL_HANDLE:"pointer",CURSOR_BEND_HANDLE:"crosshair",CURSOR_VIRTUAL_BEND_HANDLE:"crosshair",CURSOR_CONNECT:"pointer",HIGHLIGHT_COLOR:"#00FF00",CONNECT_TARGET_COLOR:"#0000FF",INVALID_CONNECT_TARGET_COLOR:"#FF0000",DROP_TARGET_COLOR:"#0000FF",VALID_COLOR:"#00FF00",INVALID_COLOR:"#FF0000",EDGE_SELECTION_COLOR:"#00FF00",VERTEX_SELECTION_COLOR:"#00FF00",VERTEX_SELECTION_STROKEWIDTH:1,EDGE_SELECTION_STROKEWIDTH:1,VERTEX_SELECTION_DASHED:!0,EDGE_SELECTION_DASHED:!0,GUIDE_COLOR:"#FF0000",GUIDE_STROKEWIDTH:1,OUTLINE_COLOR:"#0099FF",OUTLINE_STROKEWIDTH:mxClient.IS_IE?2:3,HANDLE_SIZE:6,LABEL_HANDLE_SIZE:4,HANDLE_FILLCOLOR:"#00FF00",HANDLE_STROKECOLOR:"black",LABEL_HANDLE_FILLCOLOR:"yellow",CONNECT_HANDLE_FILLCOLOR:"#0000FF",LOCKED_HANDLE_FILLCOLOR:"#FF0000",OUTLINE_HANDLE_FILLCOLOR:"#00FFFF",OUTLINE_HANDLE_STROKECOLOR:"#0033FF",DEFAULT_FONTFAMILY:"Arial,Helvetica",DEFAULT_FONTSIZE:11,DEFAULT_TEXT_DIRECTION:"",LINE_HEIGHT:1.2,WORD_WRAP:"normal",ABSOLUTE_LINE_HEIGHT:!1,DEFAULT_FONTSTYLE:0,DEFAULT_STARTSIZE:40,DEFAULT_MARKERSIZE:6,DEFAULT_IMAGESIZE:24,ENTITY_SEGMENT:30,RECTANGLE_ROUNDING_FACTOR:.15,LINE_ARCSIZE:20,ARROW_SPACING:0,ARROW_WIDTH:30,ARROW_SIZE:30,PAGE_FORMAT_A4_PORTRAIT:new mxRectangle(0,0,827,1169),PAGE_FORMAT_A4_LANDSCAPE:new mxRectangle(0,0,1169,827),PAGE_FORMAT_LETTER_PORTRAIT:new mxRectangle(0,0,850,1100),PAGE_FORMAT_LETTER_LANDSCAPE:new mxRectangle(0,0,1100,850),NONE:"none",STYLE_PERIMETER:"perimeter",STYLE_SOURCE_PORT:"sourcePort",STYLE_TARGET_PORT:"targetPort",STYLE_PORT_CONSTRAINT:"portConstraint",STYLE_PORT_CONSTRAINT_ROTATION:"portConstraintRotation",STYLE_SOURCE_PORT_CONSTRAINT:"sourcePortConstraint",STYLE_TARGET_PORT_CONSTRAINT:"targetPortConstraint",STYLE_OPACITY:"opacity",STYLE_FILL_OPACITY:"fillOpacity",STYLE_STROKE_OPACITY:"strokeOpacity",STYLE_TEXT_OPACITY:"textOpacity",STYLE_TEXT_DIRECTION:"textDirection",STYLE_OVERFLOW:"overflow",STYLE_ORTHOGONAL:"orthogonal",STYLE_EXIT_X:"exitX",STYLE_EXIT_Y:"exitY",STYLE_EXIT_DX:"exitDx",STYLE_EXIT_DY:"exitDy",STYLE_EXIT_PERIMETER:"exitPerimeter",STYLE_ENTRY_X:"entryX",STYLE_ENTRY_Y:"entryY",STYLE_ENTRY_DX:"entryDx",STYLE_ENTRY_DY:"entryDy",STYLE_ENTRY_PERIMETER:"entryPerimeter",STYLE_WHITE_SPACE:"whiteSpace",STYLE_ROTATION:"rotation",STYLE_FILLCOLOR:"fillColor",STYLE_POINTER_EVENTS:"pointerEvents",STYLE_SWIMLANE_FILLCOLOR:"swimlaneFillColor",STYLE_MARGIN:"margin",STYLE_GRADIENTCOLOR:"gradientColor",STYLE_GRADIENT_DIRECTION:"gradientDirection",STYLE_STROKECOLOR:"strokeColor",STYLE_SEPARATORCOLOR:"separatorColor",STYLE_STROKEWIDTH:"strokeWidth",STYLE_ALIGN:"align",STYLE_VERTICAL_ALIGN:"verticalAlign",STYLE_LABEL_WIDTH:"labelWidth",STYLE_LABEL_POSITION:"labelPosition",STYLE_VERTICAL_LABEL_POSITION:"verticalLabelPosition",STYLE_IMAGE_ASPECT:"imageAspect",STYLE_IMAGE_ALIGN:"imageAlign",STYLE_IMAGE_VERTICAL_ALIGN:"imageVerticalAlign",STYLE_GLASS:"glass",STYLE_IMAGE:"image",STYLE_IMAGE_WIDTH:"imageWidth",STYLE_IMAGE_HEIGHT:"imageHeight",STYLE_IMAGE_BACKGROUND:"imageBackground",STYLE_IMAGE_BORDER:"imageBorder",STYLE_FLIPH:"flipH",STYLE_FLIPV:"flipV",STYLE_NOLABEL:"noLabel",STYLE_NOEDGESTYLE:"noEdgeStyle",STYLE_LABEL_BACKGROUNDCOLOR:"labelBackgroundColor",STYLE_LABEL_BORDERCOLOR:"labelBorderColor",STYLE_LABEL_PADDING:"labelPadding",STYLE_INDICATOR_SHAPE:"indicatorShape",STYLE_INDICATOR_IMAGE:"indicatorImage",STYLE_INDICATOR_COLOR:"indicatorColor",STYLE_INDICATOR_STROKECOLOR:"indicatorStrokeColor",STYLE_INDICATOR_GRADIENTCOLOR:"indicatorGradientColor",STYLE_INDICATOR_SPACING:"indicatorSpacing",STYLE_INDICATOR_WIDTH:"indicatorWidth",STYLE_INDICATOR_HEIGHT:"indicatorHeight",STYLE_INDICATOR_DIRECTION:"indicatorDirection",STYLE_SHADOW:"shadow",STYLE_SEGMENT:"segment",STYLE_ENDARROW:"endArrow",STYLE_STARTARROW:"startArrow",STYLE_ENDSIZE:"endSize",STYLE_STARTSIZE:"startSize",STYLE_SWIMLANE_LINE:"swimlaneLine",STYLE_ENDFILL:"endFill",STYLE_STARTFILL:"startFill",STYLE_DASHED:"dashed",STYLE_DASH_PATTERN:"dashPattern",STYLE_FIX_DASH:"fixDash",STYLE_ROUNDED:"rounded",STYLE_CURVED:"curved",STYLE_ARCSIZE:"arcSize",STYLE_ABSOLUTE_ARCSIZE:"absoluteArcSize",STYLE_SOURCE_PERIMETER_SPACING:"sourcePerimeterSpacing",STYLE_TARGET_PERIMETER_SPACING:"targetPerimeterSpacing",STYLE_PERIMETER_SPACING:"perimeterSpacing",STYLE_SPACING:"spacing",STYLE_SPACING_TOP:"spacingTop",STYLE_SPACING_LEFT:"spacingLeft",STYLE_SPACING_BOTTOM:"spacingBottom",STYLE_SPACING_RIGHT:"spacingRight",STYLE_HORIZONTAL:"horizontal",STYLE_DIRECTION:"direction",STYLE_ANCHOR_POINT_DIRECTION:"anchorPointDirection",STYLE_ELBOW:"elbow",STYLE_FONTCOLOR:"fontColor",STYLE_FONTFAMILY:"fontFamily",STYLE_FONTSIZE:"fontSize",STYLE_FONTSTYLE:"fontStyle",STYLE_ASPECT:"aspect",STYLE_AUTOSIZE:"autosize",STYLE_FOLDABLE:"foldable",STYLE_EDITABLE:"editable",STYLE_BACKGROUND_OUTLINE:"backgroundOutline",STYLE_BENDABLE:"bendable",STYLE_MOVABLE:"movable",STYLE_RESIZABLE:"resizable",STYLE_RESIZE_WIDTH:"resizeWidth",STYLE_RESIZE_HEIGHT:"resizeHeight",STYLE_ROTATABLE:"rotatable",STYLE_CLONEABLE:"cloneable",STYLE_DELETABLE:"deletable",STYLE_SHAPE:"shape",STYLE_EDGE:"edgeStyle",STYLE_JETTY_SIZE:"jettySize",STYLE_SOURCE_JETTY_SIZE:"sourceJettySize",STYLE_TARGET_JETTY_SIZE:"targetJettySize",STYLE_LOOP:"loopStyle",STYLE_ORTHOGONAL_LOOP:"orthogonalLoop",STYLE_ROUTING_CENTER_X:"routingCenterX",STYLE_ROUTING_CENTER_Y:"routingCenterY",FONT_BOLD:1,FONT_ITALIC:2,FONT_UNDERLINE:4,FONT_STRIKETHROUGH:8,SHAPE_RECTANGLE:"rectangle",SHAPE_ELLIPSE:"ellipse",SHAPE_DOUBLE_ELLIPSE:"doubleEllipse",SHAPE_RHOMBUS:"rhombus",SHAPE_LINE:"line",SHAPE_IMAGE:"image",SHAPE_ARROW:"arrow",SHAPE_ARROW_CONNECTOR:"arrowConnector",SHAPE_LABEL:"label",SHAPE_CYLINDER:"cylinder",SHAPE_SWIMLANE:"swimlane",SHAPE_CONNECTOR:"connector",SHAPE_ACTOR:"actor",SHAPE_CLOUD:"cloud",SHAPE_TRIANGLE:"triangle",SHAPE_HEXAGON:"hexagon",ARROW_CLASSIC:"classic",ARROW_CLASSIC_THIN:"classicThin",ARROW_BLOCK:"block",ARROW_BLOCK_THIN:"blockThin",ARROW_OPEN:"open",ARROW_OPEN_THIN:"openThin",ARROW_OVAL:"oval",ARROW_DIAMOND:"diamond",ARROW_DIAMOND_THIN:"diamondThin",ALIGN_LEFT:"left",ALIGN_CENTER:"center",ALIGN_RIGHT:"right",ALIGN_TOP:"top",ALIGN_MIDDLE:"middle",ALIGN_BOTTOM:"bottom",DIRECTION_NORTH:"north",DIRECTION_SOUTH:"south",DIRECTION_EAST:"east",DIRECTION_WEST:"west",TEXT_DIRECTION_DEFAULT:"",TEXT_DIRECTION_AUTO:"auto",TEXT_DIRECTION_LTR:"ltr",TEXT_DIRECTION_RTL:"rtl",DIRECTION_MASK_NONE:0,DIRECTION_MASK_WEST:1,DIRECTION_MASK_NORTH:2,DIRECTION_MASK_SOUTH:4,DIRECTION_MASK_EAST:8,DIRECTION_MASK_ALL:15,ELBOW_VERTICAL:"vertical",ELBOW_HORIZONTAL:"horizontal",EDGESTYLE_ELBOW:"elbowEdgeStyle",EDGESTYLE_ENTITY_RELATION:"entityRelationEdgeStyle",EDGESTYLE_LOOP:"loopEdgeStyle",EDGESTYLE_SIDETOSIDE:"sideToSideEdgeStyle",EDGESTYLE_TOPTOBOTTOM:"topToBottomEdgeStyle",EDGESTYLE_ORTHOGONAL:"orthogonalEdgeStyle",EDGESTYLE_SEGMENT:"segmentEdgeStyle",PERIMETER_ELLIPSE:"ellipsePerimeter",PERIMETER_RECTANGLE:"rectanglePerimeter",PERIMETER_RHOMBUS:"rhombusPerimeter",PERIMETER_HEXAGON:"hexagonPerimeter",PERIMETER_TRIANGLE:"trianglePerimeter"};__mxOutput.mxConstants=typeof mxConstants<"u"?mxConstants:void 0;function mxEventObject(t){this.name=t,this.properties=[];for(var e=1;e0;){var i=e[0];mxEvent.removeListener(t,i.name,i.f)}},addGestureListeners:function(t,e,i,n){e!=null&&mxEvent.addListener(t,mxClient.IS_POINTER?"pointerdown":"mousedown",e),i!=null&&mxEvent.addListener(t,mxClient.IS_POINTER?"pointermove":"mousemove",i),n!=null&&mxEvent.addListener(t,mxClient.IS_POINTER?"pointerup":"mouseup",n),!mxClient.IS_POINTER&&mxClient.IS_TOUCH&&(e!=null&&mxEvent.addListener(t,"touchstart",e),i!=null&&mxEvent.addListener(t,"touchmove",i),n!=null&&mxEvent.addListener(t,"touchend",n))},removeGestureListeners:function(t,e,i,n){e!=null&&mxEvent.removeListener(t,mxClient.IS_POINTER?"pointerdown":"mousedown",e),i!=null&&mxEvent.removeListener(t,mxClient.IS_POINTER?"pointermove":"mousemove",i),n!=null&&mxEvent.removeListener(t,mxClient.IS_POINTER?"pointerup":"mouseup",n),!mxClient.IS_POINTER&&mxClient.IS_TOUCH&&(e!=null&&mxEvent.removeListener(t,"touchstart",e),i!=null&&mxEvent.removeListener(t,"touchmove",i),n!=null&&mxEvent.removeListener(t,"touchend",n))},redirectMouseEvents:function(t,e,i,n,r,s,l){var a=function(o){return typeof i=="function"?i(o):i};mxEvent.addGestureListeners(t,function(o){n!=null?n(o):mxEvent.isConsumed(o)||e.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(o,a(o)))},function(o){r!=null?r(o):mxEvent.isConsumed(o)||e.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(o,a(o)))},function(o){s!=null?s(o):mxEvent.isConsumed(o)||e.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(o,a(o)))}),mxEvent.addListener(t,"dblclick",function(o){if(l!=null)l(o);else if(!mxEvent.isConsumed(o)){var u=a(o);e.dblClick(o,u!=null?u.cell:null)}})},release:function(t){try{if(t!=null){mxEvent.removeAllListeners(t);var e=t.childNodes;if(e!=null)for(var i=e.length,n=0;n.5||Math.abs(a.deltaY)>.5)&&t(a,a.deltaY==0?-a.deltaX>0:-a.deltaY>0)};if(e=e??window,mxClient.IS_SF&&!mxClient.IS_TOUCH){var n=1;mxEvent.addListener(e,"gesturestart",function(a){mxEvent.consume(a),n=1}),mxEvent.addListener(e,"gesturechange",function(a){mxEvent.consume(a);var o=n-a.scale;Math.abs(o)>.2&&(t(a,o<0,!0),n=a.scale)}),mxEvent.addListener(e,"gestureend",function(a){mxEvent.consume(a)})}else{var r=[],s=0,l=0;mxEvent.addGestureListeners(e,mxUtils.bind(this,function(a){!mxEvent.isMouseEvent(a)&&a.pointerId!=null&&r.push(a)}),mxUtils.bind(this,function(a){if(!mxEvent.isMouseEvent(a)&&r.length==2){for(var o=0;omxEvent.PINCH_THRESHOLD||d>mxEvent.PINCH_THRESHOLD){var x=r[0].clientX+(r[1].clientX-r[0].clientX)/2,f=r[0].clientY+(r[1].clientY-r[0].clientY)/2;t(r[0],m>d?u>s:p>l,!0,x,f),s=u,l=p}}}),mxUtils.bind(this,function(a){r=[],s=0,l=0}))}mxEvent.addListener(e,"wheel",i)}},disableContextMenu:function(t){mxEvent.addListener(t,"contextmenu",function(e){return e.preventDefault&&e.preventDefault(),!1})},getSource:function(t){return t.srcElement!=null?t.srcElement:t.target},isConsumed:function(t){return t.isConsumed!=null&&t.isConsumed},isTouchEvent:function(t){return t.pointerType!=null?t.pointerType=="touch"||t.pointerType===t.MSPOINTER_TYPE_TOUCH:t.mozInputSource!=null?t.mozInputSource==5:t.type.indexOf("touch")==0},isPenEvent:function(t){return t.pointerType!=null?t.pointerType=="pen"||t.pointerType===t.MSPOINTER_TYPE_PEN:t.mozInputSource!=null?t.mozInputSource==2:t.type.indexOf("pen")==0},isMultiTouchEvent:function(t){return t.type!=null&&t.type.indexOf("touch")==0&&t.touches!=null&&t.touches.length>1},isMouseEvent:function(t){return t.pointerType!=null?t.pointerType=="mouse"||t.pointerType===t.MSPOINTER_TYPE_MOUSE:t.mozInputSource!=null?t.mozInputSource==1:t.type.indexOf("mouse")==0},isLeftMouseButton:function(t){return"buttons"in t&&(t.type=="mousedown"||t.type=="mousemove")?t.buttons==1:"which"in t?t.which===1:t.button===1},isMiddleMouseButton:function(t){return"which"in t?t.which===2:t.button===4},isRightMouseButton:function(t){return"which"in t?t.which===3:t.button===2},isPopupTrigger:function(t){return mxEvent.isRightMouseButton(t)||mxClient.IS_MAC&&mxEvent.isControlDown(t)&&!mxEvent.isShiftDown(t)&&!mxEvent.isMetaDown(t)&&!mxEvent.isAltDown(t)},isShiftDown:function(t){return t!=null?t.shiftKey:!1},isAltDown:function(t){return t!=null?t.altKey:!1},isControlDown:function(t){return t!=null?t.ctrlKey:!1},isMetaDown:function(t){return t!=null?t.metaKey:!1},getMainEvent:function(t){return(t.type=="touchstart"||t.type=="touchmove")&&t.touches!=null&&t.touches[0]!=null?t=t.touches[0]:t.type=="touchend"&&t.changedTouches!=null&&t.changedTouches[0]!=null&&(t=t.changedTouches[0]),t},getClientX:function(t){return mxEvent.getMainEvent(t).clientX},getClientY:function(t){return mxEvent.getMainEvent(t).clientY},consume:function(t,e,i){e=e??!0,i=i??!0,e&&(t.preventDefault?(i&&t.stopPropagation(),t.preventDefault()):i&&(t.cancelBubble=!0)),t.isConsumed=!0,t.preventDefault||(t.returnValue=!1)},LABEL_HANDLE:-1,ROTATION_HANDLE:-2,CUSTOM_HANDLE:-100,VIRTUAL_HANDLE:-1e5,MOUSE_DOWN:"mouseDown",MOUSE_MOVE:"mouseMove",MOUSE_UP:"mouseUp",ACTIVATE:"activate",RESIZE_START:"resizeStart",RESIZE:"resize",RESIZE_END:"resizeEnd",MOVE_START:"moveStart",MOVE:"move",MOVE_END:"moveEnd",PAN_START:"panStart",PAN:"pan",PAN_END:"panEnd",MINIMIZE:"minimize",NORMALIZE:"normalize",MAXIMIZE:"maximize",HIDE:"hide",SHOW:"show",CLOSE:"close",DESTROY:"destroy",REFRESH:"refresh",SIZE:"size",SELECT:"select",FIRED:"fired",FIRE_MOUSE_EVENT:"fireMouseEvent",GESTURE:"gesture",TAP_AND_HOLD:"tapAndHold",GET:"get",RECEIVE:"receive",CONNECT:"connect",DISCONNECT:"disconnect",SUSPEND:"suspend",RESUME:"resume",MARK:"mark",ROOT:"root",POST:"post",OPEN:"open",SAVE:"save",BEFORE_ADD_VERTEX:"beforeAddVertex",ADD_VERTEX:"addVertex",AFTER_ADD_VERTEX:"afterAddVertex",DONE:"done",EXECUTE:"execute",EXECUTED:"executed",BEGIN_UPDATE:"beginUpdate",START_EDIT:"startEdit",END_UPDATE:"endUpdate",END_EDIT:"endEdit",BEFORE_UNDO:"beforeUndo",UNDO:"undo",REDO:"redo",CHANGE:"change",NOTIFY:"notify",LAYOUT_CELLS:"layoutCells",CLICK:"click",SCALE:"scale",TRANSLATE:"translate",SCALE_AND_TRANSLATE:"scaleAndTranslate",UP:"up",DOWN:"down",ADD:"add",REMOVE:"remove",CLEAR:"clear",ADD_CELLS:"addCells",CELLS_ADDED:"cellsAdded",MOVE_CELLS:"moveCells",CELLS_MOVED:"cellsMoved",RESIZE_CELLS:"resizeCells",CELLS_RESIZED:"cellsResized",TOGGLE_CELLS:"toggleCells",CELLS_TOGGLED:"cellsToggled",ORDER_CELLS:"orderCells",CELLS_ORDERED:"cellsOrdered",REMOVE_CELLS:"removeCells",CELLS_REMOVED:"cellsRemoved",GROUP_CELLS:"groupCells",UNGROUP_CELLS:"ungroupCells",REMOVE_CELLS_FROM_PARENT:"removeCellsFromParent",FOLD_CELLS:"foldCells",CELLS_FOLDED:"cellsFolded",ALIGN_CELLS:"alignCells",LABEL_CHANGED:"labelChanged",CONNECT_CELL:"connectCell",CELL_CONNECTED:"cellConnected",SPLIT_EDGE:"splitEdge",FLIP_EDGE:"flipEdge",START_EDITING:"startEditing",EDITING_STARTED:"editingStarted",EDITING_STOPPED:"editingStopped",ADD_OVERLAY:"addOverlay",REMOVE_OVERLAY:"removeOverlay",UPDATE_CELL_SIZE:"updateCellSize",ESCAPE:"escape",DOUBLE_CLICK:"doubleClick",START:"start",RESET:"reset",PINCH_THRESHOLD:10};__mxOutput.mxEvent=typeof mxEvent<"u"?mxEvent:void 0;function mxXmlRequest(t,e,i,n,r,s){this.url=t,this.params=e,this.method=i||"POST",this.async=n??!0,this.username=r,this.password=s}mxXmlRequest.prototype.url=null,mxXmlRequest.prototype.params=null,mxXmlRequest.prototype.method=null,mxXmlRequest.prototype.async=null,mxXmlRequest.prototype.binary=!1,mxXmlRequest.prototype.withCredentials=!1,mxXmlRequest.prototype.username=null,mxXmlRequest.prototype.password=null,mxXmlRequest.prototype.request=null,mxXmlRequest.prototype.decodeSimulateValues=!1,mxXmlRequest.prototype.isBinary=function(){return this.binary},mxXmlRequest.prototype.setBinary=function(t){this.binary=t},mxXmlRequest.prototype.getText=function(){return this.request.responseText},mxXmlRequest.prototype.isReady=function(){return this.request.readyState==4},mxXmlRequest.prototype.getDocumentElement=function(){var t=this.getXml();return t!=null?t.documentElement:null},mxXmlRequest.prototype.getXml=function(){var t=this.request.responseXML;return(document.documentMode>=9||t==null||t.documentElement==null)&&(t=mxUtils.parseXml(this.request.responseText)),t},mxXmlRequest.prototype.getStatus=function(){return this.request!=null?this.request.status:null},mxXmlRequest.prototype.create=(function(){if(window.XMLHttpRequest)return function(){var t=new XMLHttpRequest;return this.isBinary()&&t.overrideMimeType&&t.overrideMimeType("text/plain; charset=x-user-defined"),t};if(typeof ActiveXObject<"u")return function(){return new ActiveXObject("Microsoft.XMLHTTP")}})(),mxXmlRequest.prototype.send=function(t,e,i,n){this.request=this.create(),this.request!=null&&(t!=null&&(this.request.onreadystatechange=mxUtils.bind(this,function(){this.isReady()&&(t(this),this.request.onreadystatechange=null)})),this.request.open(this.method,this.url,this.async,this.username,this.password),this.setRequestHeaders(this.request,this.params),window.XMLHttpRequest&&this.withCredentials&&(this.request.withCredentials="true"),!mxClient.IS_QUIRKS&&(document.documentMode==null||document.documentMode>9)&&window.XMLHttpRequest&&i!=null&&n!=null&&(this.request.timeout=i,this.request.ontimeout=n),this.request.send(this.params))},mxXmlRequest.prototype.setRequestHeaders=function(t,e){e!=null&&t.setRequestHeader("Content-Type","application/x-www-form-urlencoded")},mxXmlRequest.prototype.simulate=function(t,e){t=t||document;var i=null;t==document&&(i=window.onbeforeunload,window.onbeforeunload=null);var n=t.createElement("form");n.setAttribute("method",this.method),n.setAttribute("action",this.url),e!=null&&n.setAttribute("target",e),n.style.display="none",n.style.visibility="hidden";for(var r=this.params.indexOf("&")>0?this.params.split("&"):this.params.split(),s=0;s0){var a=r[s].substring(0,l),o=r[s].substring(l+1);this.decodeSimulateValues&&(o=decodeURIComponent(o));var u=t.createElement("textarea");u.setAttribute("wrap","off"),u.setAttribute("name",a),mxUtils.write(u,o),n.appendChild(u)}}t.body.appendChild(n),n.submit(),n.parentNode!=null&&n.parentNode.removeChild(n),i!=null&&(window.onbeforeunload=i)},__mxOutput.mxXmlRequest=typeof mxXmlRequest<"u"?mxXmlRequest:void 0;var mxClipboard={STEPSIZE:10,insertCount:1,cells:null,setCells:function(t){mxClipboard.cells=t},getCells:function(){return mxClipboard.cells},isEmpty:function(){return mxClipboard.getCells()==null},cut:function(t,e){return e=mxClipboard.copy(t,e),mxClipboard.insertCount=0,mxClipboard.removeCells(t,e),e},removeCells:function(t,e){t.removeCells(e)},copy:function(t,e){e=e||t.getSelectionCells();var i=t.getExportableCells(t.model.getTopmostCells(e));return mxClipboard.insertCount=1,mxClipboard.setCells(t.cloneCells(i)),i},paste:function(t){var e=null;if(!mxClipboard.isEmpty()){e=t.getImportableCells(mxClipboard.getCells());var i=mxClipboard.insertCount*mxClipboard.STEPSIZE,n=t.getDefaultParent();e=t.importCells(e,i,i,n),mxClipboard.insertCount++,t.setSelectionCells(e)}return e}};__mxOutput.mxClipboard=typeof mxClipboard<"u"?mxClipboard:void 0;function mxWindow(t,e,i,n,r,s,l,a,o,u){e!=null&&(l=l??!0,this.content=e,this.init(i,n,r,s,u),this.installMaximizeHandler(),this.installMinimizeHandler(),this.installCloseHandler(),this.setMinimizable(l),this.setTitle(t),(a==null||a)&&this.installMoveHandler(),o!=null&&o.parentNode!=null?o.parentNode.replaceChild(this.div,o):document.body.appendChild(this.div))}mxWindow.prototype=new mxEventSource,mxWindow.prototype.constructor=mxWindow,mxWindow.prototype.closeImage=mxClient.imageBasePath+"/close.gif",mxWindow.prototype.minimizeImage=mxClient.imageBasePath+"/minimize.gif",mxWindow.prototype.normalizeImage=mxClient.imageBasePath+"/normalize.gif",mxWindow.prototype.maximizeImage=mxClient.imageBasePath+"/maximize.gif",mxWindow.prototype.resizeImage=mxClient.imageBasePath+"/resize.gif",mxWindow.prototype.visible=!1,mxWindow.prototype.minimumSize=new mxRectangle(0,0,50,40),mxWindow.prototype.destroyOnClose=!0,mxWindow.prototype.contentHeightCorrection=document.documentMode==8||document.documentMode==7?6:2,mxWindow.prototype.title=null,mxWindow.prototype.content=null,mxWindow.prototype.init=function(t,e,i,n,r){r=r??"mxWindow",this.div=document.createElement("div"),this.div.className=r,this.div.style.left=t+"px",this.div.style.top=e+"px",this.table=document.createElement("table"),this.table.className=r,mxClient.IS_POINTER&&(this.div.style.touchAction="none"),i!=null&&(mxClient.IS_QUIRKS||(this.div.style.width=i+"px"),this.table.style.width=i+"px"),n!=null&&(mxClient.IS_QUIRKS||(this.div.style.height=n+"px"),this.table.style.height=n+"px");var s=document.createElement("tbody"),l=document.createElement("tr");this.title=document.createElement("td"),this.title.className=r+"Title",this.buttons=document.createElement("div"),this.buttons.style.position="absolute",this.buttons.style.display="inline-block",this.buttons.style.right="4px",this.buttons.style.top="5px",this.title.appendChild(this.buttons),l.appendChild(this.title),s.appendChild(l),l=document.createElement("tr"),this.td=document.createElement("td"),this.td.className=r+"Pane",document.documentMode==7&&(this.td.style.height="100%"),this.contentWrapper=document.createElement("div"),this.contentWrapper.className=r+"Pane",this.contentWrapper.style.width="100%",this.contentWrapper.appendChild(this.content),(mxClient.IS_QUIRKS||this.content.nodeName.toUpperCase()!="DIV")&&(this.contentWrapper.style.height="100%"),this.td.appendChild(this.contentWrapper),l.appendChild(this.td),s.appendChild(l),this.table.appendChild(s),this.div.appendChild(this.table);var a=mxUtils.bind(this,function(o){this.activate()});mxEvent.addGestureListeners(this.title,a),mxEvent.addGestureListeners(this.table,a),this.hide()},mxWindow.prototype.setTitle=function(t){for(var e=this.title.firstChild;e!=null;){var i=e.nextSibling;e.nodeType==mxConstants.NODETYPE_TEXT&&e.parentNode.removeChild(e),e=i}mxUtils.write(this.title,t||""),this.title.appendChild(this.buttons)},mxWindow.prototype.setScrollable=function(t){(navigator.userAgent==null||navigator.userAgent.indexOf("Presto/2.5")<0)&&(t?this.contentWrapper.style.overflow="auto":this.contentWrapper.style.overflow="hidden")},mxWindow.prototype.activate=function(){if(mxWindow.activeWindow!=this){var t=mxUtils.getCurrentStyle(this.getElement()),e=t!=null?t.zIndex:3;if(mxWindow.activeWindow){var i=mxWindow.activeWindow.getElement();i!=null&&i.style!=null&&(i.style.zIndex=e)}var n=mxWindow.activeWindow;this.getElement().style.zIndex=parseInt(e)+1,mxWindow.activeWindow=this,this.fireEvent(new mxEventObject(mxEvent.ACTIVATE,"previousWindow",n))}},mxWindow.prototype.getElement=function(){return this.div},mxWindow.prototype.fit=function(){mxUtils.fit(this.div)},mxWindow.prototype.isResizable=function(){return this.resize!=null?this.resize.style.display!="none":!1},mxWindow.prototype.setResizable=function(t){if(t)if(this.resize==null){this.resize=document.createElement("img"),this.resize.style.position="absolute",this.resize.style.bottom="2px",this.resize.style.right="2px",this.resize.setAttribute("src",this.resizeImage),this.resize.style.cursor="nw-resize";var e=null,i=null,n=null,r=null,s=mxUtils.bind(this,function(o){this.activate(),e=mxEvent.getClientX(o),i=mxEvent.getClientY(o),n=this.div.offsetWidth,r=this.div.offsetHeight,mxEvent.addGestureListeners(document,null,l,a),this.fireEvent(new mxEventObject(mxEvent.RESIZE_START,"event",o)),mxEvent.consume(o)}),l=mxUtils.bind(this,function(o){if(e!=null&&i!=null){var u=mxEvent.getClientX(o)-e,p=mxEvent.getClientY(o)-i;this.setSize(n+u,r+p),this.fireEvent(new mxEventObject(mxEvent.RESIZE,"event",o)),mxEvent.consume(o)}}),a=mxUtils.bind(this,function(o){e!=null&&i!=null&&(e=null,i=null,mxEvent.removeGestureListeners(document,null,l,a),this.fireEvent(new mxEventObject(mxEvent.RESIZE_END,"event",o)),mxEvent.consume(o))});mxEvent.addGestureListeners(this.resize,s,l,a),this.div.appendChild(this.resize)}else this.resize.style.display="inline";else this.resize!=null&&(this.resize.style.display="none")},mxWindow.prototype.setSize=function(t,e){t=Math.max(this.minimumSize.width,t),e=Math.max(this.minimumSize.height,e),mxClient.IS_QUIRKS||(this.div.style.width=t+"px",this.div.style.height=e+"px"),this.table.style.width=t+"px",this.table.style.height=e+"px",mxClient.IS_QUIRKS||(this.contentWrapper.style.height=this.div.offsetHeight-this.title.offsetHeight-this.contentHeightCorrection+"px")},mxWindow.prototype.setMinimizable=function(t){this.minimize.style.display=t?"":"none"},mxWindow.prototype.getMinimumSize=function(){return new mxRectangle(0,0,0,this.title.offsetHeight)},mxWindow.prototype.installMinimizeHandler=function(){this.minimize=document.createElement("img"),this.minimize.setAttribute("src",this.minimizeImage),this.minimize.setAttribute("title","Minimize"),this.minimize.style.cursor="pointer",this.minimize.style.marginLeft="2px",this.minimize.style.display="none",this.buttons.appendChild(this.minimize);var t=!1,e=null,i=null,n=mxUtils.bind(this,function(r){if(this.activate(),t)t=!1,this.minimize.setAttribute("src",this.minimizeImage),this.minimize.setAttribute("title","Minimize"),this.contentWrapper.style.display="",this.maximize.style.display=e,mxClient.IS_QUIRKS||(this.div.style.height=i),this.table.style.height=i,this.resize!=null&&(this.resize.style.visibility=""),this.fireEvent(new mxEventObject(mxEvent.NORMALIZE,"event",r));else{t=!0,this.minimize.setAttribute("src",this.normalizeImage),this.minimize.setAttribute("title","Normalize"),this.contentWrapper.style.display="none",e=this.maximize.style.display,this.maximize.style.display="none",i=this.table.style.height;var s=this.getMinimumSize();s.height>0&&(mxClient.IS_QUIRKS||(this.div.style.height=s.height+"px"),this.table.style.height=s.height+"px"),s.width>0&&(mxClient.IS_QUIRKS||(this.div.style.width=s.width+"px"),this.table.style.width=s.width+"px"),this.resize!=null&&(this.resize.style.visibility="hidden"),this.fireEvent(new mxEventObject(mxEvent.MINIMIZE,"event",r))}mxEvent.consume(r)});mxEvent.addGestureListeners(this.minimize,n)},mxWindow.prototype.setMaximizable=function(t){this.maximize.style.display=t?"":"none"},mxWindow.prototype.installMaximizeHandler=function(){this.maximize=document.createElement("img"),this.maximize.setAttribute("src",this.maximizeImage),this.maximize.setAttribute("title","Maximize"),this.maximize.style.cursor="default",this.maximize.style.marginLeft="2px",this.maximize.style.cursor="pointer",this.maximize.style.display="none",this.buttons.appendChild(this.maximize);var t=!1,e=null,i=null,n=null,r=null,s=null,l=mxUtils.bind(this,function(a){if(this.activate(),this.maximize.style.display!="none"){if(t){if(t=!1,this.maximize.setAttribute("src",this.maximizeImage),this.maximize.setAttribute("title","Maximize"),this.contentWrapper.style.display="",this.minimize.style.display=s,this.div.style.left=e+"px",this.div.style.top=i+"px",!mxClient.IS_QUIRKS){this.div.style.height=n,this.div.style.width=r;var u=mxUtils.getCurrentStyle(this.contentWrapper);(u.overflow=="auto"||this.resize!=null)&&(this.contentWrapper.style.height=this.div.offsetHeight-this.title.offsetHeight-this.contentHeightCorrection+"px")}this.table.style.height=n,this.table.style.width=r,this.resize!=null&&(this.resize.style.visibility=""),this.fireEvent(new mxEventObject(mxEvent.NORMALIZE,"event",a))}else{t=!0,this.maximize.setAttribute("src",this.normalizeImage),this.maximize.setAttribute("title","Normalize"),this.contentWrapper.style.display="",s=this.minimize.style.display,this.minimize.style.display="none",e=parseInt(this.div.style.left),i=parseInt(this.div.style.top),n=this.table.style.height,r=this.table.style.width,this.div.style.left="0px",this.div.style.top="0px";var o=Math.max(document.body.clientHeight||0,document.documentElement.clientHeight||0);if(mxClient.IS_QUIRKS||(this.div.style.width=document.body.clientWidth-2+"px",this.div.style.height=o-2+"px"),this.table.style.width=document.body.clientWidth-2+"px",this.table.style.height=o-2+"px",this.resize!=null&&(this.resize.style.visibility="hidden"),!mxClient.IS_QUIRKS){var u=mxUtils.getCurrentStyle(this.contentWrapper);(u.overflow=="auto"||this.resize!=null)&&(this.contentWrapper.style.height=this.div.offsetHeight-this.title.offsetHeight-this.contentHeightCorrection+"px")}this.fireEvent(new mxEventObject(mxEvent.MAXIMIZE,"event",a))}mxEvent.consume(a)}});mxEvent.addGestureListeners(this.maximize,l),mxEvent.addListener(this.title,"dblclick",l)},mxWindow.prototype.installMoveHandler=function(){this.title.style.cursor="move",mxEvent.addGestureListeners(this.title,mxUtils.bind(this,function(t){var e=mxEvent.getClientX(t),i=mxEvent.getClientY(t),n=this.getX(),r=this.getY(),s=mxUtils.bind(this,function(a){var o=mxEvent.getClientX(a)-e,u=mxEvent.getClientY(a)-i;this.setLocation(n+o,r+u),this.fireEvent(new mxEventObject(mxEvent.MOVE,"event",a)),mxEvent.consume(a)}),l=mxUtils.bind(this,function(a){mxEvent.removeGestureListeners(document,null,s,l),this.fireEvent(new mxEventObject(mxEvent.MOVE_END,"event",a)),mxEvent.consume(a)});mxEvent.addGestureListeners(document,null,s,l),this.fireEvent(new mxEventObject(mxEvent.MOVE_START,"event",t)),mxEvent.consume(t)})),mxClient.IS_POINTER&&(this.title.style.touchAction="none")},mxWindow.prototype.setLocation=function(t,e){this.div.style.left=t+"px",this.div.style.top=e+"px"},mxWindow.prototype.getX=function(){return parseInt(this.div.style.left)},mxWindow.prototype.getY=function(){return parseInt(this.div.style.top)},mxWindow.prototype.installCloseHandler=function(){this.closeImg=document.createElement("img"),this.closeImg.setAttribute("src",this.closeImage),this.closeImg.setAttribute("title","Close"),this.closeImg.style.marginLeft="2px",this.closeImg.style.cursor="pointer",this.closeImg.style.display="none",this.buttons.appendChild(this.closeImg),mxEvent.addGestureListeners(this.closeImg,mxUtils.bind(this,function(t){this.fireEvent(new mxEventObject(mxEvent.CLOSE,"event",t)),this.destroyOnClose?this.destroy():this.setVisible(!1),mxEvent.consume(t)}))},mxWindow.prototype.setImage=function(t){this.image=document.createElement("img"),this.image.setAttribute("src",t),this.image.setAttribute("align","left"),this.image.style.marginRight="4px",this.image.style.marginLeft="0px",this.image.style.marginTop="-2px",this.title.insertBefore(this.image,this.title.firstChild)},mxWindow.prototype.setClosable=function(t){this.closeImg.style.display=t?"":"none"},mxWindow.prototype.isVisible=function(){return this.div!=null?this.div.style.display!="none":!1},mxWindow.prototype.setVisible=function(t){this.div!=null&&this.isVisible()!=t&&(t?this.show():this.hide())},mxWindow.prototype.show=function(){this.div.style.display="",this.activate();var t=mxUtils.getCurrentStyle(this.contentWrapper);!mxClient.IS_QUIRKS&&(t.overflow=="auto"||this.resize!=null)&&this.contentWrapper.style.display!="none"&&(this.contentWrapper.style.height=this.div.offsetHeight-this.title.offsetHeight-this.contentHeightCorrection+"px"),this.fireEvent(new mxEventObject(mxEvent.SHOW))},mxWindow.prototype.hide=function(){this.div.style.display="none",this.fireEvent(new mxEventObject(mxEvent.HIDE))},mxWindow.prototype.destroy=function(){this.fireEvent(new mxEventObject(mxEvent.DESTROY)),this.div!=null&&(mxEvent.release(this.div),this.div.parentNode.removeChild(this.div),this.div=null),this.title=null,this.content=null,this.contentWrapper=null},__mxOutput.mxWindow=typeof mxWindow<"u"?mxWindow:void 0;function mxForm(t){this.table=document.createElement("table"),this.table.className=t,this.body=document.createElement("tbody"),this.table.appendChild(this.body)}mxForm.prototype.table=null,mxForm.prototype.body=!1,mxForm.prototype.getTable=function(){return this.table},mxForm.prototype.addButtons=function(t,e){var i=document.createElement("tr"),n=document.createElement("td");i.appendChild(n),n=document.createElement("td");var r=document.createElement("button");mxUtils.write(r,mxResources.get("ok")||"OK"),n.appendChild(r),mxEvent.addListener(r,"click",function(){t()}),r=document.createElement("button"),mxUtils.write(r,mxResources.get("cancel")||"Cancel"),n.appendChild(r),mxEvent.addListener(r,"click",function(){e()}),i.appendChild(n),this.body.appendChild(i)},mxForm.prototype.addText=function(t,e,i){var n=document.createElement("input");return n.setAttribute("type",i||"text"),n.value=e,this.addField(t,n)},mxForm.prototype.addCheckbox=function(t,e){var i=document.createElement("input");return i.setAttribute("type","checkbox"),this.addField(t,i),e&&(i.checked=!0),i},mxForm.prototype.addTextarea=function(t,e,i){var n=document.createElement("textarea");return mxClient.IS_NS&&i--,n.setAttribute("rows",i||2),n.value=e,this.addField(t,n)},mxForm.prototype.addCombo=function(t,e,i){var n=document.createElement("select");return i!=null&&n.setAttribute("size",i),e&&n.setAttribute("multiple","true"),this.addField(t,n)},mxForm.prototype.addOption=function(t,e,i,n){var r=document.createElement("option");mxUtils.writeln(r,e),r.setAttribute("value",i),n&&r.setAttribute("selected",n),t.appendChild(r)},mxForm.prototype.addField=function(t,e){var i=document.createElement("tr"),n=document.createElement("td");return mxUtils.write(n,t),i.appendChild(n),n=document.createElement("td"),n.appendChild(e),i.appendChild(n),this.body.appendChild(i),e},__mxOutput.mxForm=typeof mxForm<"u"?mxForm:void 0;function mxImage(t,e,i){this.src=t,this.width=e,this.height=i}mxImage.prototype.src=null,mxImage.prototype.width=null,mxImage.prototype.height=null,__mxOutput.mxImage=typeof mxImage<"u"?mxImage:void 0;function mxDivResizer(t,e){if(t.nodeName.toLowerCase()=="div"){e==null&&(e=window),this.div=t;var i=mxUtils.getCurrentStyle(t);i!=null&&(this.resizeWidth=i.width=="auto",this.resizeHeight=i.height=="auto"),mxEvent.addListener(e,"resize",mxUtils.bind(this,function(n){this.handlingResize||(this.handlingResize=!0,this.resize(),this.handlingResize=!1)})),this.resize()}}mxDivResizer.prototype.resizeWidth=!0,mxDivResizer.prototype.resizeHeight=!0,mxDivResizer.prototype.handlingResize=!1,mxDivResizer.prototype.resize=function(){var t=this.getDocumentWidth(),e=this.getDocumentHeight(),i=parseInt(this.div.style.left),n=parseInt(this.div.style.right),r=parseInt(this.div.style.top),s=parseInt(this.div.style.bottom);this.resizeWidth&&!isNaN(i)&&!isNaN(n)&&i>=0&&n>=0&&t-n-i>0&&(this.div.style.width=t-n-i+"px"),this.resizeHeight&&!isNaN(r)&&!isNaN(s)&&r>=0&&s>=0&&e-r-s>0&&(this.div.style.height=e-r-s+"px")},mxDivResizer.prototype.getDocumentWidth=function(){return document.body.clientWidth},mxDivResizer.prototype.getDocumentHeight=function(){return document.body.clientHeight},__mxOutput.mxDivResizer=typeof mxDivResizer<"u"?mxDivResizer:void 0;function mxDragSource(t,e){this.element=t,this.dropHandler=e,mxEvent.addGestureListeners(t,mxUtils.bind(this,function(i){this.mouseDown(i)})),mxEvent.addListener(t,"dragstart",function(i){mxEvent.consume(i)}),this.eventConsumer=function(i,n){var r=n.getProperty("eventName"),s=n.getProperty("event");r!=mxEvent.MOUSE_DOWN&&s.consume()}}mxDragSource.prototype.element=null,mxDragSource.prototype.dropHandler=null,mxDragSource.prototype.dragOffset=null,mxDragSource.prototype.dragElement=null,mxDragSource.prototype.previewElement=null,mxDragSource.prototype.previewOffset=null,mxDragSource.prototype.enabled=!0,mxDragSource.prototype.currentGraph=null,mxDragSource.prototype.currentDropTarget=null,mxDragSource.prototype.currentPoint=null,mxDragSource.prototype.currentGuide=null,mxDragSource.prototype.currentHighlight=null,mxDragSource.prototype.autoscroll=!0,mxDragSource.prototype.guidesEnabled=!0,mxDragSource.prototype.gridEnabled=!0,mxDragSource.prototype.highlightDropTargets=!0,mxDragSource.prototype.dragElementZIndex=100,mxDragSource.prototype.dragElementOpacity=70,mxDragSource.prototype.checkEventSource=!0,mxDragSource.prototype.isEnabled=function(){return this.enabled},mxDragSource.prototype.setEnabled=function(t){this.enabled=t},mxDragSource.prototype.isGuidesEnabled=function(){return this.guidesEnabled},mxDragSource.prototype.setGuidesEnabled=function(t){this.guidesEnabled=t},mxDragSource.prototype.isGridEnabled=function(){return this.gridEnabled},mxDragSource.prototype.setGridEnabled=function(t){this.gridEnabled=t},mxDragSource.prototype.getGraphForEvent=function(t){return null},mxDragSource.prototype.getDropTarget=function(t,e,i,n){return t.getCellAt(e,i)},mxDragSource.prototype.createDragElement=function(t){return this.element.cloneNode(!0)},mxDragSource.prototype.createPreviewElement=function(t){return null},mxDragSource.prototype.isActive=function(){return this.mouseMoveHandler!=null},mxDragSource.prototype.reset=function(){this.currentGraph!=null&&(this.dragExit(this.currentGraph),this.currentGraph=null),this.removeDragElement(),this.removeListeners(),this.stopDrag()},mxDragSource.prototype.mouseDown=function(t){this.enabled&&!mxEvent.isConsumed(t)&&this.mouseMoveHandler==null&&(this.startDrag(t),this.mouseMoveHandler=mxUtils.bind(this,this.mouseMove),this.mouseUpHandler=mxUtils.bind(this,this.mouseUp),mxEvent.addGestureListeners(document,null,this.mouseMoveHandler,this.mouseUpHandler),mxClient.IS_TOUCH&&!mxEvent.isMouseEvent(t)&&(this.eventSource=mxEvent.getSource(t),mxEvent.addGestureListeners(this.eventSource,null,this.mouseMoveHandler,this.mouseUpHandler)))},mxDragSource.prototype.startDrag=function(t){this.dragElement=this.createDragElement(t),this.dragElement.style.position="absolute",this.dragElement.style.zIndex=this.dragElementZIndex,mxUtils.setOpacity(this.dragElement,this.dragElementOpacity),this.checkEventSource&&mxClient.IS_SVG&&(this.dragElement.style.pointerEvents="none")},mxDragSource.prototype.stopDrag=function(){this.removeDragElement()},mxDragSource.prototype.removeDragElement=function(){this.dragElement!=null&&(this.dragElement.parentNode!=null&&this.dragElement.parentNode.removeChild(this.dragElement),this.dragElement=null)},mxDragSource.prototype.getElementForEvent=function(t){return mxEvent.isTouchEvent(t)||mxEvent.isPenEvent(t)?document.elementFromPoint(mxEvent.getClientX(t),mxEvent.getClientY(t)):mxEvent.getSource(t)},mxDragSource.prototype.graphContainsEvent=function(t,e){var i=mxEvent.getClientX(e),n=mxEvent.getClientY(e),r=mxUtils.getOffset(t.container),s=mxUtils.getScrollOrigin(),l=this.getElementForEvent(e);if(this.checkEventSource)for(;l!=null&&l!=t.container;)l=l.parentNode;return l!=null&&i>=r.x-s.x&&n>=r.y-s.y&&i<=r.x-s.x+t.container.offsetWidth&&n<=r.y-s.y+t.container.offsetHeight},mxDragSource.prototype.mouseMove=function(t){var e=this.getGraphForEvent(t);if(e!=null&&!this.graphContainsEvent(e,t)&&(e=null),e!=this.currentGraph&&(this.currentGraph!=null&&this.dragExit(this.currentGraph,t),this.currentGraph=e,this.currentGraph!=null&&this.dragEnter(this.currentGraph,t)),this.currentGraph!=null&&this.dragOver(this.currentGraph,t),this.dragElement!=null&&(this.previewElement==null||this.previewElement.style.visibility!="visible")){var i=mxEvent.getClientX(t),n=mxEvent.getClientY(t);this.dragElement.parentNode==null&&document.body.appendChild(this.dragElement),this.dragElement.style.visibility="visible",this.dragOffset!=null&&(i+=this.dragOffset.x,n+=this.dragOffset.y);var r=mxUtils.getDocumentScrollOrigin(document);this.dragElement.style.left=i+r.x+"px",this.dragElement.style.top=n+r.y+"px"}else this.dragElement!=null&&(this.dragElement.style.visibility="hidden");mxEvent.consume(t)},mxDragSource.prototype.mouseUp=function(t){if(this.currentGraph!=null){if(this.currentPoint!=null&&(this.previewElement==null||this.previewElement.style.visibility!="hidden")){var e=this.currentGraph.view.scale,i=this.currentGraph.view.translate,n=this.currentPoint.x/e-i.x,r=this.currentPoint.y/e-i.y;this.drop(this.currentGraph,t,this.currentDropTarget,n,r)}this.dragExit(this.currentGraph),this.currentGraph=null}this.stopDrag(),this.removeListeners(),mxEvent.consume(t)},mxDragSource.prototype.removeListeners=function(){this.eventSource!=null&&(mxEvent.removeGestureListeners(this.eventSource,null,this.mouseMoveHandler,this.mouseUpHandler),this.eventSource=null),mxEvent.removeGestureListeners(document,null,this.mouseMoveHandler,this.mouseUpHandler),this.mouseMoveHandler=null,this.mouseUpHandler=null},mxDragSource.prototype.dragEnter=function(t,e){t.isMouseDown=!0,t.isMouseTrigger=mxEvent.isMouseEvent(e),this.previewElement=this.createPreviewElement(t),this.previewElement!=null&&this.checkEventSource&&mxClient.IS_SVG&&(this.previewElement.style.pointerEvents="none"),this.isGuidesEnabled()&&this.previewElement!=null&&(this.currentGuide=new mxGuide(t,t.graphHandler.getGuideStates())),this.highlightDropTargets&&(this.currentHighlight=new mxCellHighlight(t,mxConstants.DROP_TARGET_COLOR)),t.addListener(mxEvent.FIRE_MOUSE_EVENT,this.eventConsumer)},mxDragSource.prototype.dragExit=function(t,e){this.currentDropTarget=null,this.currentPoint=null,t.isMouseDown=!1,t.removeListener(this.eventConsumer),this.previewElement!=null&&(this.previewElement.parentNode!=null&&this.previewElement.parentNode.removeChild(this.previewElement),this.previewElement=null),this.currentGuide!=null&&(this.currentGuide.destroy(),this.currentGuide=null),this.currentHighlight!=null&&(this.currentHighlight.destroy(),this.currentHighlight=null)},mxDragSource.prototype.dragOver=function(t,e){var i=mxUtils.getOffset(t.container),n=mxUtils.getScrollOrigin(t.container),r=mxEvent.getClientX(e)-i.x+n.x-t.panDx,s=mxEvent.getClientY(e)-i.y+n.y-t.panDy;if(t.autoScroll&&(this.autoscroll==null||this.autoscroll)&&t.scrollPointToVisible(r,s,t.autoExtend),this.currentHighlight!=null&&t.isDropEnabled()){this.currentDropTarget=this.getDropTarget(t,r,s,e);var l=t.getView().getState(this.currentDropTarget);this.currentHighlight.highlight(l)}if(this.previewElement!=null){this.previewElement.parentNode==null&&(t.container.appendChild(this.previewElement),this.previewElement.style.zIndex="3",this.previewElement.style.position="absolute");var a=this.isGridEnabled()&&t.isGridEnabledEvent(e),o=!0;if(this.currentGuide!=null&&this.currentGuide.isEnabledForEvent(e)){var u=parseInt(this.previewElement.style.width),p=parseInt(this.previewElement.style.height),m=new mxRectangle(0,0,u,p),d=new mxPoint(r,s);d=this.currentGuide.move(m,d,a,!0),o=!1,r=d.x,s=d.y}else if(a){var x=t.view.scale,f=t.view.translate,g=t.gridSize/2;r=(t.snap(r/x-f.x-g)+f.x)*x,s=(t.snap(s/x-f.y-g)+f.y)*x}this.currentGuide!=null&&o&&this.currentGuide.hide(),this.previewOffset!=null&&(r+=this.previewOffset.x,s+=this.previewOffset.y),this.previewElement.style.left=Math.round(r)+"px",this.previewElement.style.top=Math.round(s)+"px",this.previewElement.style.visibility="visible"}this.currentPoint=new mxPoint(r,s)},mxDragSource.prototype.drop=function(t,e,i,n,r){this.dropHandler.apply(this,arguments),t.container.style.visibility!="hidden"&&t.container.focus()},__mxOutput.mxDragSource=typeof mxDragSource<"u"?mxDragSource:void 0;function mxToolbar(t){this.container=t}mxToolbar.prototype=new mxEventSource,mxToolbar.prototype.constructor=mxToolbar,mxToolbar.prototype.container=null,mxToolbar.prototype.enabled=!0,mxToolbar.prototype.noReset=!1,mxToolbar.prototype.updateDefaultMode=!0,mxToolbar.prototype.addItem=function(t,e,i,n,r,s){var l=document.createElement(e!=null?"img":"button"),a=r||(s!=null?"mxToolbarMode":"mxToolbarItem");l.className=a,l.setAttribute("src",e),t!=null&&(e!=null?l.setAttribute("title",t):mxUtils.write(l,t)),this.container.appendChild(l),i!=null&&(mxEvent.addListener(l,"click",i),mxClient.IS_TOUCH&&mxEvent.addListener(l,"touchend",i));var o=mxUtils.bind(this,function(u){n!=null?l.setAttribute("src",e):l.style.backgroundColor=""});return mxEvent.addGestureListeners(l,mxUtils.bind(this,function(u){if(n!=null?l.setAttribute("src",n):l.style.backgroundColor="gray",s!=null){this.menu==null&&(this.menu=new mxPopupMenu,this.menu.init());var p=this.currentImg;if(this.menu.isMenuShowing()&&this.menu.hideMenu(),p!=l){this.currentImg=l,this.menu.factoryMethod=s;var m=new mxPoint(l.offsetLeft,l.offsetTop+l.offsetHeight);this.menu.popup(m.x,m.y,null,u),this.menu.isMenuShowing()&&(l.className=a+"Selected",this.menu.hideMenu=function(){mxPopupMenu.prototype.hideMenu.apply(this),l.className=a,this.currentImg=null})}}}),null,o),mxEvent.addListener(l,"mouseout",o),l},mxToolbar.prototype.addCombo=function(t){var e=document.createElement("div");e.style.display="inline",e.className="mxToolbarComboContainer";var i=document.createElement("select");return i.className=t||"mxToolbarCombo",e.appendChild(i),this.container.appendChild(e),i},mxToolbar.prototype.addActionCombo=function(t,e){var i=document.createElement("select");return i.className=e||"mxToolbarCombo",this.addOption(i,t,null),mxEvent.addListener(i,"change",function(n){var r=i.options[i.selectedIndex];i.selectedIndex=0,r.funct!=null&&r.funct(n)}),this.container.appendChild(i),i},mxToolbar.prototype.addOption=function(t,e,i){var n=document.createElement("option");return mxUtils.writeln(n,e),typeof i=="function"?n.funct=i:n.setAttribute("value",i),t.appendChild(n),n},mxToolbar.prototype.addSwitchMode=function(t,e,i,n,r){var s=document.createElement("img");return s.initialClassName=r||"mxToolbarMode",s.className=s.initialClassName,s.setAttribute("src",e),s.altIcon=n,t!=null&&s.setAttribute("title",t),mxEvent.addListener(s,"click",mxUtils.bind(this,function(l){var a=this.selectedMode.altIcon;a!=null?(this.selectedMode.altIcon=this.selectedMode.getAttribute("src"),this.selectedMode.setAttribute("src",a)):this.selectedMode.className=this.selectedMode.initialClassName,this.updateDefaultMode&&(this.defaultMode=s),this.selectedMode=s;var a=s.altIcon;a!=null?(s.altIcon=s.getAttribute("src"),s.setAttribute("src",a)):s.className=s.initialClassName+"Selected",this.fireEvent(new mxEventObject(mxEvent.SELECT)),i()})),this.container.appendChild(s),this.defaultMode==null&&(this.defaultMode=s,this.selectMode(s),i()),s},mxToolbar.prototype.addMode=function(t,e,i,n,r,s){s=s??!0;var l=document.createElement(e!=null?"img":"button");return l.initialClassName=r||"mxToolbarMode",l.className=l.initialClassName,l.setAttribute("src",e),l.altIcon=n,t!=null&&l.setAttribute("title",t),this.enabled&&s&&(mxEvent.addListener(l,"click",mxUtils.bind(this,function(a){this.selectMode(l,i),this.noReset=!1})),mxEvent.addListener(l,"dblclick",mxUtils.bind(this,function(a){this.selectMode(l,i),this.noReset=!0})),this.defaultMode==null&&(this.defaultMode=l,this.defaultFunction=i,this.selectMode(l,i))),this.container.appendChild(l),l},mxToolbar.prototype.selectMode=function(t,e){if(this.selectedMode!=t){if(this.selectedMode!=null){var i=this.selectedMode.altIcon;i!=null?(this.selectedMode.altIcon=this.selectedMode.getAttribute("src"),this.selectedMode.setAttribute("src",i)):this.selectedMode.className=this.selectedMode.initialClassName}this.selectedMode=t;var i=this.selectedMode.altIcon;i!=null?(this.selectedMode.altIcon=this.selectedMode.getAttribute("src"),this.selectedMode.setAttribute("src",i)):this.selectedMode.className=this.selectedMode.initialClassName+"Selected",this.fireEvent(new mxEventObject(mxEvent.SELECT,"function",e))}},mxToolbar.prototype.resetMode=function(t){(t||!this.noReset)&&this.selectedMode!=this.defaultMode&&this.selectMode(this.defaultMode,this.defaultFunction)},mxToolbar.prototype.addSeparator=function(t){return this.addItem(null,t,null)},mxToolbar.prototype.addBreak=function(){mxUtils.br(this.container)},mxToolbar.prototype.addLine=function(){var t=document.createElement("hr");t.style.marginRight="6px",t.setAttribute("size","1"),this.container.appendChild(t)},mxToolbar.prototype.destroy=function(){mxEvent.release(this.container),this.container=null,this.defaultMode=null,this.defaultFunction=null,this.selectedMode=null,this.menu!=null&&this.menu.destroy()},__mxOutput.mxToolbar=typeof mxToolbar<"u"?mxToolbar:void 0;function mxUndoableEdit(t,e){this.source=t,this.changes=[],this.significant=e??!0}mxUndoableEdit.prototype.source=null,mxUndoableEdit.prototype.changes=null,mxUndoableEdit.prototype.significant=null,mxUndoableEdit.prototype.undone=!1,mxUndoableEdit.prototype.redone=!1,mxUndoableEdit.prototype.isEmpty=function(){return this.changes.length==0},mxUndoableEdit.prototype.isSignificant=function(){return this.significant},mxUndoableEdit.prototype.add=function(t){this.changes.push(t)},mxUndoableEdit.prototype.notify=function(){},mxUndoableEdit.prototype.die=function(){},mxUndoableEdit.prototype.undo=function(){if(!this.undone){this.source.fireEvent(new mxEventObject(mxEvent.START_EDIT));for(var t=this.changes.length,e=t-1;e>=0;e--){var i=this.changes[e];i.execute!=null?i.execute():i.undo!=null&&i.undo(),this.source.fireEvent(new mxEventObject(mxEvent.EXECUTED,"change",i))}this.undone=!0,this.redone=!1,this.source.fireEvent(new mxEventObject(mxEvent.END_EDIT))}this.notify()},mxUndoableEdit.prototype.redo=function(){if(!this.redone){this.source.fireEvent(new mxEventObject(mxEvent.START_EDIT));for(var t=this.changes.length,e=0;e0},mxUndoManager.prototype.undo=function(){for(;this.indexOfNextAdd>0;){var t=this.history[--this.indexOfNextAdd];if(t.undo(),t.isSignificant()){this.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",t));break}}},mxUndoManager.prototype.canRedo=function(){return this.indexOfNextAdd0&&this.size==this.history.length&&this.history.shift(),this.history.push(t),this.indexOfNextAdd=this.history.length,this.fireEvent(new mxEventObject(mxEvent.ADD,"edit",t))},mxUndoManager.prototype.trim=function(){if(this.history.length>this.indexOfNextAdd)for(var t=this.history.splice(this.indexOfNextAdd,this.history.length-this.indexOfNextAdd),e=0;e0&&(this.baseUrl=this.baseUrl.substring(0,t+1))},mxUrlConverter.prototype.isEnabled=function(){return this.enabled},mxUrlConverter.prototype.setEnabled=function(t){this.enabled=t},mxUrlConverter.prototype.getBaseUrl=function(){return this.baseUrl},mxUrlConverter.prototype.setBaseUrl=function(t){this.baseUrl=t},mxUrlConverter.prototype.getBaseDomain=function(){return this.baseDomain},mxUrlConverter.prototype.setBaseDomain=function(t){this.baseDomain=t},mxUrlConverter.prototype.isRelativeUrl=function(t){return t!=null&&t.substring(0,2)!="//"&&t.substring(0,7)!="http://"&&t.substring(0,8)!="https://"&&t.substring(0,10)!="data:image"&&t.substring(0,7)!="file://"},mxUrlConverter.prototype.convert=function(t){return this.isEnabled()&&this.isRelativeUrl(t)&&(this.getBaseUrl()==null&&this.updateBaseUrl(),t.charAt(0)=="/"?t=this.getBaseDomain()+t:t=this.getBaseUrl()+t),t},__mxOutput.mxUrlConverter=typeof mxUrlConverter<"u"?mxUrlConverter:void 0;function mxPanningManager(t){this.thread=null,this.active=!1,this.tdx=0,this.tdy=0,this.t0x=0,this.t0y=0,this.dx=0,this.dy=0,this.scrollbars=!1,this.scrollLeft=0,this.scrollTop=0,this.mouseListener={mouseDown:function(i,n){},mouseMove:function(i,n){},mouseUp:mxUtils.bind(this,function(i,n){this.active&&this.stop()})},t.addMouseListener(this.mouseListener),this.mouseUpListener=mxUtils.bind(this,function(){this.active&&this.stop()}),mxEvent.addListener(document,"mouseup",this.mouseUpListener);var e=mxUtils.bind(this,function(){return this.scrollbars=mxUtils.hasScrollbars(t.container),this.scrollLeft=t.container.scrollLeft,this.scrollTop=t.container.scrollTop,window.setInterval(mxUtils.bind(this,function(){if(this.tdx-=this.dx,this.tdy-=this.dy,this.scrollbars){var i=-t.container.scrollLeft-Math.ceil(this.dx),n=-t.container.scrollTop-Math.ceil(this.dy);t.panGraph(i,n),t.panDx=this.scrollLeft-t.container.scrollLeft,t.panDy=this.scrollTop-t.container.scrollTop,t.fireEvent(new mxEventObject(mxEvent.PAN))}else t.panGraph(this.getDx(),this.getDy())}),this.delay)});this.isActive=function(){return active},this.getDx=function(){return Math.round(this.tdx)},this.getDy=function(){return Math.round(this.tdy)},this.start=function(){this.t0x=t.view.translate.x,this.t0y=t.view.translate.y,this.active=!0},this.panTo=function(i,n,r,s){this.active||this.start(),this.scrollLeft=t.container.scrollLeft,this.scrollTop=t.container.scrollTop,r=r??0,s=s??0;var l=t.container;this.dx=i+r-l.scrollLeft-l.clientWidth,this.dx<0&&Math.abs(this.dx)0&&this.dx0&&this.dya&&(e.div.style.left=Math.max(0,t.div.offsetLeft-n+(mxClient.IS_IE?6:-6))+"px"),mxUtils.fit(e.div)}},mxPopupMenu.prototype.addSeparator=function(t,e){if(t=t||this,this.smartSeparators&&!e)t.willAddSeparator=!0;else if(t.tbody!=null){t.willAddSeparator=!1;var i=document.createElement("tr"),n=document.createElement("td");n.className="mxPopupMenuIcon",n.style.padding="0 0 0 0px",i.appendChild(n);var r=document.createElement("td");r.style.padding="0 0 0 0px",r.setAttribute("colSpan","2");var s=document.createElement("hr");s.setAttribute("size","1"),r.appendChild(s),i.appendChild(r),t.tbody.appendChild(i)}},mxPopupMenu.prototype.popup=function(t,e,i,n){if(this.div!=null&&this.tbody!=null&&this.factoryMethod!=null){for(this.div.style.left=t+"px",this.div.style.top=e+"px";this.tbody.firstChild!=null;)mxEvent.release(this.tbody.firstChild),this.tbody.removeChild(this.tbody.firstChild);this.itemCount=0,this.factoryMethod(this,i,n),this.itemCount>0&&(this.showMenu(),this.fireEvent(new mxEventObject(mxEvent.SHOW)))}},mxPopupMenu.prototype.isMenuShowing=function(){return this.div!=null&&this.div.parentNode==document.body},mxPopupMenu.prototype.showMenu=function(){document.documentMode>=9&&(this.div.style.filter="none"),document.body.appendChild(this.div),mxUtils.fit(this.div)},mxPopupMenu.prototype.hideMenu=function(){this.div!=null&&(this.div.parentNode!=null&&this.div.parentNode.removeChild(this.div),this.hideSubmenu(this),this.containsItems=!1,this.fireEvent(new mxEventObject(mxEvent.HIDE)))},mxPopupMenu.prototype.hideSubmenu=function(t){t.activeRow!=null&&(this.hideSubmenu(t.activeRow),t.activeRow.div.parentNode!=null&&t.activeRow.div.parentNode.removeChild(t.activeRow.div),t.activeRow=null)},mxPopupMenu.prototype.destroy=function(){this.div!=null&&(mxEvent.release(this.div),this.div.parentNode!=null&&this.div.parentNode.removeChild(this.div),this.div=null)},__mxOutput.mxPopupMenu=typeof mxPopupMenu<"u"?mxPopupMenu:void 0;function mxAutoSaveManager(t){this.changeHandler=mxUtils.bind(this,function(e,i){this.isEnabled()&&this.graphModelChanged(i.getProperty("edit").changes)}),this.setGraph(t)}mxAutoSaveManager.prototype=new mxEventSource,mxAutoSaveManager.prototype.constructor=mxAutoSaveManager,mxAutoSaveManager.prototype.graph=null,mxAutoSaveManager.prototype.autoSaveDelay=10,mxAutoSaveManager.prototype.autoSaveThrottle=2,mxAutoSaveManager.prototype.autoSaveThreshold=5,mxAutoSaveManager.prototype.ignoredChanges=0,mxAutoSaveManager.prototype.lastSnapshot=0,mxAutoSaveManager.prototype.enabled=!0,mxAutoSaveManager.prototype.changeHandler=null,mxAutoSaveManager.prototype.isEnabled=function(){return this.enabled},mxAutoSaveManager.prototype.setEnabled=function(t){this.enabled=t},mxAutoSaveManager.prototype.setGraph=function(t){this.graph!=null&&this.graph.getModel().removeListener(this.changeHandler),this.graph=t,this.graph!=null&&this.graph.getModel().addListener(mxEvent.CHANGE,this.changeHandler)},mxAutoSaveManager.prototype.save=function(){},mxAutoSaveManager.prototype.graphModelChanged=function(t){var e=new Date().getTime(),i=(e-this.lastSnapshot)/1e3;i>this.autoSaveDelay||this.ignoredChanges>=this.autoSaveThreshold&&i>this.autoSaveThrottle?(this.save(),this.reset()):this.ignoredChanges++},mxAutoSaveManager.prototype.reset=function(){this.lastSnapshot=new Date().getTime(),this.ignoredChanges=0},mxAutoSaveManager.prototype.destroy=function(){this.setGraph(null)},__mxOutput.mxAutoSaveManager=typeof mxAutoSaveManager<"u"?mxAutoSaveManager:void 0;function mxAnimation(t){this.delay=t??20}mxAnimation.prototype=new mxEventSource,mxAnimation.prototype.constructor=mxAnimation,mxAnimation.prototype.delay=null,mxAnimation.prototype.thread=null,mxAnimation.prototype.isRunning=function(){return this.thread!=null},mxAnimation.prototype.startAnimation=function(){this.thread==null&&(this.thread=window.setInterval(mxUtils.bind(this,this.updateAnimation),this.delay))},mxAnimation.prototype.updateAnimation=function(){this.fireEvent(new mxEventObject(mxEvent.EXECUTE))},mxAnimation.prototype.stopAnimation=function(){this.thread!=null&&(window.clearInterval(this.thread),this.thread=null,this.fireEvent(new mxEventObject(mxEvent.DONE)))},__mxOutput.mxAnimation=typeof mxAnimation<"u"?mxAnimation:void 0;function mxMorphing(t,e,i,n){mxAnimation.call(this,n),this.graph=t,this.steps=e??6,this.ease=i??1.5}mxMorphing.prototype=new mxAnimation,mxMorphing.prototype.constructor=mxMorphing,mxMorphing.prototype.graph=null,mxMorphing.prototype.steps=null,mxMorphing.prototype.step=0,mxMorphing.prototype.ease=null,mxMorphing.prototype.cells=null,mxMorphing.prototype.updateAnimation=function(){mxAnimation.prototype.updateAnimation.apply(this,arguments);var t=new mxCellStatePreview(this.graph);if(this.cells!=null)for(var e=0;e=this.steps)&&this.stopAnimation()},mxMorphing.prototype.show=function(t){t.show()},mxMorphing.prototype.animateCell=function(t,e,i){var n=this.graph.getView().getState(t),r=null;if(n!=null&&(r=this.getDelta(n),this.graph.getModel().isVertex(t)&&(r.x!=0||r.y!=0))){var s=this.graph.view.getTranslate(),l=this.graph.view.getScale();r.x+=s.x*l,r.y+=s.y*l,e.moveState(n,-r.x/this.ease,-r.y/this.ease)}if(i&&!this.stopRecursion(n,r))for(var a=this.graph.getModel().getChildCount(t),o=0;o2))for(var t=this.state,e=2;e0&&(this.state=this.states.pop())},mxAbstractCanvas2D.prototype.setLink=function(t){},mxAbstractCanvas2D.prototype.scale=function(t){this.state.scale*=t,this.state.strokeWidth*=t},mxAbstractCanvas2D.prototype.translate=function(t,e){this.state.dx+=t,this.state.dy+=e},mxAbstractCanvas2D.prototype.rotate=function(t,e,i,n,r){},mxAbstractCanvas2D.prototype.setAlpha=function(t){this.state.alpha=t},mxAbstractCanvas2D.prototype.setFillAlpha=function(t){this.state.fillAlpha=t},mxAbstractCanvas2D.prototype.setStrokeAlpha=function(t){this.state.strokeAlpha=t},mxAbstractCanvas2D.prototype.setFillColor=function(t){t==mxConstants.NONE&&(t=null),this.state.fillColor=t,this.state.gradientColor=null},mxAbstractCanvas2D.prototype.setGradient=function(t,e,i,n,r,s,l,a,o){var u=this.state;u.fillColor=t,u.gradientFillAlpha=a??1,u.gradientColor=e,u.gradientAlpha=o??1,u.gradientDirection=l},mxAbstractCanvas2D.prototype.setStrokeColor=function(t){t==mxConstants.NONE&&(t=null),this.state.strokeColor=t},mxAbstractCanvas2D.prototype.setStrokeWidth=function(t){this.state.strokeWidth=t},mxAbstractCanvas2D.prototype.setDashed=function(t,e){this.state.dashed=t,this.state.fixDash=e},mxAbstractCanvas2D.prototype.setDashPattern=function(t){this.state.dashPattern=t},mxAbstractCanvas2D.prototype.setLineCap=function(t){this.state.lineCap=t},mxAbstractCanvas2D.prototype.setLineJoin=function(t){this.state.lineJoin=t},mxAbstractCanvas2D.prototype.setMiterLimit=function(t){this.state.miterLimit=t},mxAbstractCanvas2D.prototype.setFontColor=function(t){t==mxConstants.NONE&&(t=null),this.state.fontColor=t},mxAbstractCanvas2D.prototype.setFontBackgroundColor=function(t){t==mxConstants.NONE&&(t=null),this.state.fontBackgroundColor=t},mxAbstractCanvas2D.prototype.setFontBorderColor=function(t){t==mxConstants.NONE&&(t=null),this.state.fontBorderColor=t},mxAbstractCanvas2D.prototype.setFontSize=function(t){this.state.fontSize=parseFloat(t)},mxAbstractCanvas2D.prototype.setFontFamily=function(t){this.state.fontFamily=t},mxAbstractCanvas2D.prototype.setFontStyle=function(t){t==null&&(t=0),this.state.fontStyle=t},mxAbstractCanvas2D.prototype.setShadow=function(t){this.state.shadow=t},mxAbstractCanvas2D.prototype.setShadowColor=function(t){t==mxConstants.NONE&&(t=null),this.state.shadowColor=t},mxAbstractCanvas2D.prototype.setShadowAlpha=function(t){this.state.shadowAlpha=t},mxAbstractCanvas2D.prototype.setShadowOffset=function(t,e){this.state.shadowDx=t,this.state.shadowDy=e},mxAbstractCanvas2D.prototype.begin=function(){this.lastX=0,this.lastY=0,this.path=[]},mxAbstractCanvas2D.prototype.moveTo=function(t,e){this.addOp(this.moveOp,t,e)},mxAbstractCanvas2D.prototype.lineTo=function(t,e){this.addOp(this.lineOp,t,e)},mxAbstractCanvas2D.prototype.quadTo=function(t,e,i,n){this.addOp(this.quadOp,t,e,i,n)},mxAbstractCanvas2D.prototype.curveTo=function(t,e,i,n,r,s){this.addOp(this.curveOp,t,e,i,n,r,s)},mxAbstractCanvas2D.prototype.arcTo=function(t,e,i,n,r,s,l){var a=mxUtils.arcToCurves(this.lastX,this.lastY,t,e,i,n,r,s,l);if(a!=null)for(var o=0;o0&&(this.defs=i.getElementsByTagName("defs")[0]),this.defs==null&&(this.defs=this.createElement("defs"),i.firstChild!=null?i.insertBefore(this.defs,i.firstChild):i.appendChild(this.defs)),this.styleEnabled&&this.defs.appendChild(this.createStyle())}}mxUtils.extend(mxSvgCanvas2D,mxAbstractCanvas2D),(function(){if(mxSvgCanvas2D.prototype.useDomParser=!mxClient.IS_IE&&typeof DOMParser=="function"&&typeof XMLSerializer=="function",mxSvgCanvas2D.prototype.useDomParser)try{var t=new DOMParser().parseFromString("test text","text/html");mxSvgCanvas2D.prototype.useDomParser=t!=null}catch{mxSvgCanvas2D.prototype.useDomParser=!1}mxSvgCanvas2D.prototype.useAbsoluteIds=!mxClient.IS_CHROMEAPP&&!mxClient.IS_IE&&!mxClient.IS_IE11&&!mxClient.IS_EDGE&&document.getElementsByTagName("base").length>0})(),mxSvgCanvas2D.prototype.node=null,mxSvgCanvas2D.prototype.matchHtmlAlignment=!0,mxSvgCanvas2D.prototype.textEnabled=!0,mxSvgCanvas2D.prototype.foEnabled=!0,mxSvgCanvas2D.prototype.foAltText="[Object]",mxSvgCanvas2D.prototype.foOffset=0,mxSvgCanvas2D.prototype.textOffset=0,mxSvgCanvas2D.prototype.imageOffset=0,mxSvgCanvas2D.prototype.strokeTolerance=0,mxSvgCanvas2D.prototype.minStrokeWidth=1,mxSvgCanvas2D.prototype.refCount=0,mxSvgCanvas2D.prototype.lineHeightCorrection=1,mxSvgCanvas2D.prototype.pointerEventsValue="all",mxSvgCanvas2D.prototype.fontMetricsPadding=10,mxSvgCanvas2D.prototype.cacheOffsetSize=!0,mxSvgCanvas2D.prototype.format=function(t){return parseFloat(parseFloat(t).toFixed(2))},mxSvgCanvas2D.prototype.getBaseUrl=function(){var t=window.location.href,e=t.lastIndexOf("#");return e>0&&(t=t.substring(0,e)),t},mxSvgCanvas2D.prototype.reset=function(){mxAbstractCanvas2D.prototype.reset.apply(this,arguments),this.gradients=[]},mxSvgCanvas2D.prototype.createStyle=function(t){var e=this.createElement("style");return e.setAttribute("type","text/css"),mxUtils.write(e,"svg{font-family:"+mxConstants.DEFAULT_FONTFAMILY+";font-size:"+mxConstants.DEFAULT_FONTSIZE+";fill:none;stroke-miterlimit:10}"),e},mxSvgCanvas2D.prototype.createElement=function(t,e){if(this.root.ownerDocument.createElementNS!=null)return this.root.ownerDocument.createElementNS(e||mxConstants.NS_SVG,t);var i=this.root.ownerDocument.createElement(t);return e!=null&&i.setAttribute("xmlns",e),i},mxSvgCanvas2D.prototype.getAlternateText=function(t,e,i,n,r,s,l,a,o,u,p,m,d){return s!=null?this.foAltText:null},mxSvgCanvas2D.prototype.createAlternateContent=function(t,e,i,n,r,s,l,a,o,u,p,m,d){var x=this.getAlternateText(t,e,i,n,r,s,l,a,o,u,p,m,d),f=this.state;if(x!=null&&f.fontSize>0){var g=a==mxConstants.ALIGN_TOP?1:a==mxConstants.ALIGN_BOTTOM?0:.3,c=l==mxConstants.ALIGN_RIGHT?"end":l==mxConstants.ALIGN_LEFT?"start":"middle",v=this.createElement("text");v.setAttribute("x",Math.round(e+f.dx)),v.setAttribute("y",Math.round(i+f.dy+g*f.fontSize)),v.setAttribute("fill",f.fontColor||"black"),v.setAttribute("font-family",f.fontFamily),v.setAttribute("font-size",Math.round(f.fontSize)+"px"),c!="start"&&v.setAttribute("text-anchor",c),(f.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&v.setAttribute("font-weight","bold"),(f.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&v.setAttribute("font-style","italic");var y=[];return(f.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&y.push("underline"),(f.fontStyle&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&y.push("line-through"),y.length>0&&v.setAttribute("text-decoration",y.join(" ")),mxUtils.write(v,x),v}else return null},mxSvgCanvas2D.prototype.createGradientId=function(t,e,i,n,r){t.charAt(0)=="#"&&(t=t.substring(1)),e.charAt(0)=="#"&&(e=e.substring(1)),t=t.toLowerCase()+"-"+i,e=e.toLowerCase()+"-"+n;var s=null;if(r==null||r==mxConstants.DIRECTION_SOUTH)s="s";else if(r==mxConstants.DIRECTION_EAST)s="e";else{var l=t;t=e,e=l,r==mxConstants.DIRECTION_NORTH?s="s":r==mxConstants.DIRECTION_WEST&&(s="e")}return"mx-gradient-"+t+"-"+e+"-"+s},mxSvgCanvas2D.prototype.getSvgGradient=function(t,e,i,n,r){var s=this.createGradientId(t,e,i,n,r),l=this.gradients[s];if(l==null){var a=this.root.ownerSVGElement,o=0,u=s+"-"+o;if(a!=null)for(l=a.ownerDocument.getElementById(u);l!=null&&l.ownerSVGElement!=a;)u=s+"-"+o++,l=a.ownerDocument.getElementById(u);else u="id"+ ++this.refCount;l==null&&(l=this.createSvgGradient(t,e,i,n,r),l.setAttribute("id",u),this.defs!=null?this.defs.appendChild(l):a.appendChild(l)),this.gradients[s]=l}return l.getAttribute("id")},mxSvgCanvas2D.prototype.createSvgGradient=function(t,e,i,n,r){var s=this.createElement("linearGradient");s.setAttribute("x1","0%"),s.setAttribute("y1","0%"),s.setAttribute("x2","0%"),s.setAttribute("y2","0%"),r==null||r==mxConstants.DIRECTION_SOUTH?s.setAttribute("y2","100%"):r==mxConstants.DIRECTION_EAST?s.setAttribute("x2","100%"):r==mxConstants.DIRECTION_NORTH?s.setAttribute("y1","100%"):r==mxConstants.DIRECTION_WEST&&s.setAttribute("x1","100%");var l=i<1?";stop-opacity:"+i:"",a=this.createElement("stop");return a.setAttribute("offset","0%"),a.setAttribute("style","stop-color:"+t+l),s.appendChild(a),l=n<1?";stop-opacity:"+n:"",a=this.createElement("stop"),a.setAttribute("offset","100%"),a.setAttribute("style","stop-color:"+e+l),s.appendChild(a),s},mxSvgCanvas2D.prototype.addNode=function(t,e){var i=this.node,n=this.state;if(i!=null){if(i.nodeName=="path")if(this.path!=null&&this.path.length>0)i.setAttribute("d",this.path.join(" "));else return;t&&n.fillColor!=null?this.updateFill():this.styleEnabled||(i.nodeName=="ellipse"&&mxClient.IS_FF?i.setAttribute("fill","transparent"):i.setAttribute("fill","none"),t=!1),e&&n.strokeColor!=null?this.updateStroke():this.styleEnabled||i.setAttribute("stroke","none"),n.transform!=null&&n.transform.length>0&&i.setAttribute("transform",n.transform),n.shadow&&this.root.appendChild(this.createShadow(i)),this.strokeTolerance>0&&!t&&this.root.appendChild(this.createTolerance(i)),this.pointerEvents?i.setAttribute("pointer-events",this.pointerEventsValue):!this.pointerEvents&&this.originalRoot==null&&i.setAttribute("pointer-events","none"),(i.nodeName!="rect"&&i.nodeName!="path"&&i.nodeName!="ellipse"||i.getAttribute("fill")!="none"&&i.getAttribute("fill")!="transparent"||i.getAttribute("stroke")!="none"||i.getAttribute("pointer-events")!="none")&&this.root.appendChild(i),this.node=null}},mxSvgCanvas2D.prototype.updateFill=function(){var t=this.state;if((t.alpha<1||t.fillAlpha<1)&&this.node.setAttribute("fill-opacity",t.alpha*t.fillAlpha),t.fillColor!=null)if(t.gradientColor!=null){var e=this.getSvgGradient(String(t.fillColor),String(t.gradientColor),t.gradientFillAlpha,t.gradientAlpha,t.gradientDirection);if(this.root.ownerDocument==document&&this.useAbsoluteIds){var i=this.getBaseUrl().replace(/([\(\)])/g,"\\$1");this.node.setAttribute("fill","url("+i+"#"+e+")")}else this.node.setAttribute("fill","url(#"+e+")")}else this.node.setAttribute("fill",String(t.fillColor).toLowerCase())},mxSvgCanvas2D.prototype.getCurrentStrokeWidth=function(){return Math.max(this.minStrokeWidth,Math.max(.01,this.format(this.state.strokeWidth*this.state.scale)))},mxSvgCanvas2D.prototype.updateStroke=function(){var t=this.state;this.node.setAttribute("stroke",String(t.strokeColor).toLowerCase()),(t.alpha<1||t.strokeAlpha<1)&&this.node.setAttribute("stroke-opacity",t.alpha*t.strokeAlpha);var e=this.getCurrentStrokeWidth();e!=1&&this.node.setAttribute("stroke-width",e),this.node.nodeName=="path"&&this.updateStrokeAttributes(),t.dashed&&this.node.setAttribute("stroke-dasharray",this.createDashPattern((t.fixDash?1:t.strokeWidth)*t.scale))},mxSvgCanvas2D.prototype.updateStrokeAttributes=function(){var t=this.state;if(t.lineJoin!=null&&t.lineJoin!="miter"&&this.node.setAttribute("stroke-linejoin",t.lineJoin),t.lineCap!=null){var e=t.lineCap;e=="flat"&&(e="butt"),e!="butt"&&this.node.setAttribute("stroke-linecap",e)}t.miterLimit!=null&&(!this.styleEnabled||t.miterLimit!=10)&&this.node.setAttribute("stroke-miterlimit",t.miterLimit)},mxSvgCanvas2D.prototype.createDashPattern=function(t){var e=[];if(typeof this.state.dashPattern=="string"){var i=this.state.dashPattern.split(" ");if(i.length>0)for(var n=0;n0&&this.node.setAttribute("rx",this.format(r*this.state.scale)),s>0&&this.node.setAttribute("ry",this.format(s*this.state.scale))},mxSvgCanvas2D.prototype.ellipse=function(t,e,i,n){var r=this.state,s=this.createElement("ellipse");s.setAttribute("cx",this.format((t+i/2+r.dx)*r.scale)),s.setAttribute("cy",this.format((e+n/2+r.dy)*r.scale)),s.setAttribute("rx",i/2*r.scale),s.setAttribute("ry",n/2*r.scale),this.node=s},mxSvgCanvas2D.prototype.image=function(t,e,i,n,r,s,l,a){r=this.converter.convert(r),s=s??!0,l=l??!1,a=a??!1;var o=this.state;t+=o.dx,e+=o.dy;var u=this.createElement("image");u.setAttribute("x",this.format(t*o.scale)+this.imageOffset),u.setAttribute("y",this.format(e*o.scale)+this.imageOffset),u.setAttribute("width",this.format(i*o.scale)),u.setAttribute("height",this.format(n*o.scale)),u.setAttributeNS==null?u.setAttribute("xlink:href",r):u.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",r),s||u.setAttribute("preserveAspectRatio","none"),(o.alpha<1||o.fillAlpha<1)&&u.setAttribute("opacity",o.alpha*o.fillAlpha);var p=this.state.transform||"";if(l||a){var m=1,d=1,x=0,f=0;l&&(m=-1,x=-i-2*t),a&&(d=-1,f=-n-2*e),p+="scale("+m+","+d+")translate("+x*o.scale+","+f*o.scale+")"}p.length>0&&u.setAttribute("transform",p),this.pointerEvents||u.setAttribute("pointer-events","none"),this.root.appendChild(u)},mxSvgCanvas2D.prototype.convertHtml=function(t){if(this.useDomParser){var e=new DOMParser().parseFromString(t,"text/html");e!=null&&(t=new XMLSerializer().serializeToString(e.body),t.substring(0,5)=="",5)+1)),t.substring(t.length-7,t.length)==""&&(t=t.substring(0,t.length-7)))}else if(document.implementation!=null&&document.implementation.createDocument!=null){var i=document.implementation.createDocument("http://www.w3.org/1999/xhtml","html",null),n=i.createElement("body");i.documentElement.appendChild(n);var r=document.createElement("div");r.innerHTML=t;for(var s=r.firstChild;s!=null;){var l=s.nextSibling;n.appendChild(i.adoptNode(s)),s=l}return n.innerHTML}else{var a=document.createElement("textarea");a.innerHTML=t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(//g,">"),t=a.value.replace(/&/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&").replace(/
/g,"
").replace(/
/g,"
").replace(/(]+)>/gm,"$1 />")}return t},mxSvgCanvas2D.prototype.createDiv=function(t){var e=t;if(mxUtils.isNode(e)||(e="
"+this.convertHtml(e)+"
"),!mxClient.IS_IE&&!mxClient.IS_IE11&&document.createElementNS){var i=document.createElementNS("http://www.w3.org/1999/xhtml","div");if(mxUtils.isNode(e)){var n=document.createElement("div"),r=n.cloneNode(!1);this.root.ownerDocument!=document?n.appendChild(e.cloneNode(!0)):n.appendChild(e),r.appendChild(n),i.appendChild(r)}else i.innerHTML=e;return i}else return mxUtils.isNode(e)&&(e="
"+mxUtils.getXml(e)+"
"),e='
'+e+"
",mxUtils.parseXml(e).documentElement},mxSvgCanvas2D.prototype.updateText=function(t,e,i,n,r,s,l,a,o,u,p){p!=null&&p.firstChild!=null&&p.firstChild.firstChild!=null&&this.updateTextNodes(t,e,i,n,r,s,l,a,o,u,p.firstChild)},mxSvgCanvas2D.prototype.addForeignObject=function(t,e,i,n,r,s,l,a,o,u,p,m,d,x,f){var g=this.createElement("g"),c=this.createElement("foreignObject");if(c.setAttribute("style","overflow: visible; text-align: left;"),c.setAttribute("pointer-events","none"),x.ownerDocument!=document&&(x=mxUtils.importNodeImplementation(c.ownerDocument,x,!0)),c.appendChild(x),g.appendChild(c),this.updateTextNodes(t,e,i,n,s,l,a,u,p,m,g),this.root.ownerDocument!=document){var v=this.createAlternateContent(c,t,e,i,n,r,s,l,a,o,u,p,m);if(v!=null){c.setAttribute("requiredFeatures","http://www.w3.org/TR/SVG11/feature#Extensibility");var y=this.createElement("switch");y.appendChild(c),y.appendChild(v),g.appendChild(y)}}f.appendChild(g)},mxSvgCanvas2D.prototype.updateTextNodes=function(t,e,i,n,r,s,l,a,o,u,p){var m=this.state.scale;mxSvgCanvas2D.createCss(i+2,n,r,s,l,a,o,this.state.fontBackgroundColor!=null?this.state.fontBackgroundColor:null,this.state.fontBorderColor!=null?this.state.fontBorderColor:null,"display: flex; align-items: unsafe "+(s==mxConstants.ALIGN_TOP?"flex-start":s==mxConstants.ALIGN_BOTTOM?"flex-end":"center")+"; justify-content: unsafe "+(r==mxConstants.ALIGN_LEFT?"flex-start":r==mxConstants.ALIGN_RIGHT?"flex-end":"center")+"; ",this.getTextCss(),m,mxUtils.bind(this,function(d,x,f,g,c){t+=this.state.dx,e+=this.state.dy;var v=p.firstChild,y=v.firstChild,T=y.firstChild,C=T.firstChild,S=(this.rotateHtml?this.state.rotation:0)+(u??0),E=(this.foOffset!=0?"translate("+this.foOffset+" "+this.foOffset+")":"")+(m!=1?"scale("+m+")":"");C.setAttribute("style",c),T.setAttribute("style",g),v.setAttribute("width",Math.ceil(1/Math.min(1,m)*100)+"%"),v.setAttribute("height",Math.ceil(1/Math.min(1,m)*100)+"%");var L=Math.round(e+x);L<0?v.setAttribute("y",L):(v.removeAttribute("y"),f+="padding-top: "+L+"px; "),y.setAttribute("style",f+"margin-left: "+Math.round(t+d)+"px;"),E+=S!=0?"rotate("+S+" "+t+" "+e+")":"",E!=""?p.setAttribute("transform",E):p.removeAttribute("transform"),this.state.alpha!=1?p.setAttribute("opacity",this.state.alpha):p.removeAttribute("opacity")}))},mxSvgCanvas2D.createCss=function(t,e,i,n,r,s,l,a,o,u,p,m,d){var x="box-sizing: border-box; font-size: 0; text-align: "+(i==mxConstants.ALIGN_LEFT?"left":i==mxConstants.ALIGN_RIGHT?"right":"center")+"; ",f=mxUtils.getAlignmentAsPoint(i,n),g="overflow: hidden; ",c="width: 1px; ",v="height: 1px; ",y=f.x*t,T=f.y*e;l?(c="width: "+Math.round(t)+"px; ",x+="max-height: "+Math.round(e)+"px; ",T=0):s=="fill"?(c="width: "+Math.round(t)+"px; ",v="height: "+Math.round(e)+"px; ",p+="width: 100%; height: 100%; ",x+=c+v):s=="width"?(c="width: "+Math.round(t)+"px; ",p+="width: 100%; ",x+=c,T=0,e>0&&(x+="max-height: "+Math.round(e)+"px; ")):(g="",T=0);var C="";a!=null&&(C+="background-color: "+a+"; "),o!=null&&(C+="border: 1px solid "+o+"; "),g==""||l?p+=C:x+=C,r&&t>0?(p+="white-space: normal; word-wrap: "+mxConstants.WORD_WRAP+"; ",c="width: "+Math.round(t)+"px; ",g!=""&&s!="fill"&&(T=0)):(p+="white-space: nowrap; ",g==""&&(y=0)),d(y,T,u+c+v,x+g,p,g)},mxSvgCanvas2D.prototype.getTextCss=function(){var t=this.state,e=mxConstants.ABSOLUTE_LINE_HEIGHT?t.fontSize*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT*this.lineHeightCorrection,i="display: inline-block; font-size: "+t.fontSize+"px; font-family: "+t.fontFamily+"; color: "+t.fontColor+"; line-height: "+e+"; pointer-events: "+(this.pointerEvents?this.pointerEventsValue:"none")+"; ";(t.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(i+="font-weight: bold; "),(t.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(i+="font-style: italic; ");var n=[];return(t.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&n.push("underline"),(t.fontStyle&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&n.push("line-through"),n.length>0&&(i+="text-decoration: "+n.join(" ")+"; "),i},mxSvgCanvas2D.prototype.text=function(t,e,i,n,r,s,l,a,o,u,p,m,d){if(this.textEnabled&&r!=null)if(m=m??0,this.foEnabled&&o=="html"){var x=this.createDiv(r);x!=null&&(d!=null&&x.setAttribute("dir",d),this.addForeignObject(t,e,i,n,r,s,l,a,o,u,p,m,d,x,this.root))}else this.plainText(t+this.state.dx,e+this.state.dy,i,n,r,s,l,a,u,p,m,d)},mxSvgCanvas2D.prototype.createClip=function(t,e,i,n){t=Math.round(t),e=Math.round(e),i=Math.round(i),n=Math.round(n);for(var r="mx-clip-"+t+"-"+e+"-"+i+"-"+n,s=0,l=r+"-"+s;document.getElementById(l)!=null;)l=r+"-"+ ++s;clip=this.createElement("clipPath"),clip.setAttribute("id",l);var a=this.createElement("rect");return a.setAttribute("x",t),a.setAttribute("y",e),a.setAttribute("width",i),a.setAttribute("height",n),clip.appendChild(a),clip},mxSvgCanvas2D.prototype.plainText=function(t,e,i,n,r,s,l,a,o,u,p,m){p=p??0;var d=this.state,x=d.fontSize,f=this.createElement("g"),g=d.transform||"";if(this.updateFont(f),!this.pointerEvents&&this.originalRoot==null&&f.setAttribute("pointer-events","none"),p!=0&&(g+="rotate("+p+","+this.format(t*d.scale)+","+this.format(e*d.scale)+")"),m!=null&&f.setAttribute("direction",m),u&&i>0&&n>0){var c=t,L=e;s==mxConstants.ALIGN_CENTER?c-=i/2:s==mxConstants.ALIGN_RIGHT&&(c-=i),o!="fill"&&(l==mxConstants.ALIGN_MIDDLE?L-=n/2:l==mxConstants.ALIGN_BOTTOM&&(L-=n));var v=this.createClip(c*d.scale-2,L*d.scale-2,i*d.scale+4,n*d.scale+4);if(this.defs!=null?this.defs.appendChild(v):this.root.appendChild(v),!mxClient.IS_CHROMEAPP&&!mxClient.IS_IE&&!mxClient.IS_IE11&&!mxClient.IS_EDGE&&this.root.ownerDocument==document){var y=this.getBaseUrl().replace(/([\(\)])/g,"\\$1");f.setAttribute("clip-path","url("+y+"#"+v.getAttribute("id")+")")}else f.setAttribute("clip-path","url(#"+v.getAttribute("id")+")")}var T=s==mxConstants.ALIGN_RIGHT?"end":s==mxConstants.ALIGN_CENTER?"middle":"start";T!="start"&&f.setAttribute("text-anchor",T),(!this.styleEnabled||x!=mxConstants.DEFAULT_FONTSIZE)&&f.setAttribute("font-size",x*d.scale+"px"),g.length>0&&f.setAttribute("transform",g),d.alpha<1&&f.setAttribute("opacity",d.alpha);var C=r.split(` +`),S=Math.round(x*mxConstants.LINE_HEIGHT),E=x+(C.length-1)*S,L=e+x-1;if(l==mxConstants.ALIGN_MIDDLE)if(o=="fill")L-=n/2;else{var A=(this.matchHtmlAlignment&&u&&n>0?Math.min(E,n):E)/2;L-=A}else if(l==mxConstants.ALIGN_BOTTOM)if(o=="fill")L-=n;else{var A=this.matchHtmlAlignment&&u&&n>0?Math.min(E,n):E;L-=A+1}for(var M=0;M0&&mxUtils.trim(C[M]).length>0){var I=this.createElement("text");I.setAttribute("x",this.format(t*d.scale)+this.textOffset),I.setAttribute("y",this.format(L*d.scale)+this.textOffset),mxUtils.write(I,C[M]),f.appendChild(I)}L+=S}this.root.appendChild(f),this.addTextBackground(f,r,t,e,i,o=="fill"?n:E,s,l,o)},mxSvgCanvas2D.prototype.updateFont=function(t){var e=this.state;t.setAttribute("fill",e.fontColor),(!this.styleEnabled||e.fontFamily!=mxConstants.DEFAULT_FONTFAMILY)&&t.setAttribute("font-family",e.fontFamily),(e.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&t.setAttribute("font-weight","bold"),(e.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&t.setAttribute("font-style","italic");var i=[];(e.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&i.push("underline"),(e.fontStyle&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&i.push("line-through"),i.length>0&&t.setAttribute("text-decoration",i.join(" "))},mxSvgCanvas2D.prototype.addTextBackground=function(t,e,i,n,r,s,l,a,o){var u=this.state;if(u.fontBackgroundColor!=null||u.fontBorderColor!=null){var p=null;if(o=="fill"||o=="width")l==mxConstants.ALIGN_CENTER?i-=r/2:l==mxConstants.ALIGN_RIGHT&&(i-=r),a==mxConstants.ALIGN_MIDDLE?n-=s/2:a==mxConstants.ALIGN_BOTTOM&&(n-=s),p=new mxRectangle((i+1)*u.scale,n*u.scale,(r-2)*u.scale,(s+2)*u.scale);else if(t.getBBox!=null&&this.root.ownerDocument==document)try{p=t.getBBox();var m=mxClient.IS_IE&&mxClient.IS_SVG;p=new mxRectangle(p.x,p.y+(m?0:1),p.width,p.height+(m?1:0))}catch{}if(p==null||p.width==0||p.height==0){var d=document.createElement("div");d.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?u.fontSize*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT,d.style.fontSize=u.fontSize+"px",d.style.fontFamily=u.fontFamily,d.style.whiteSpace="nowrap",d.style.position="absolute",d.style.visibility="hidden",d.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",d.style.zoom="1",(u.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(d.style.fontWeight="bold"),(u.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(d.style.fontStyle="italic"),e=mxUtils.htmlEntities(e,!1),d.innerHTML=e.replace(/\n/g,"
"),document.body.appendChild(d);var r=d.offsetWidth,s=d.offsetHeight;d.parentNode.removeChild(d),l==mxConstants.ALIGN_CENTER?i-=r/2:l==mxConstants.ALIGN_RIGHT&&(i-=r),a==mxConstants.ALIGN_MIDDLE?n-=s/2:a==mxConstants.ALIGN_BOTTOM&&(n-=s),p=new mxRectangle((i+1)*u.scale,(n+2)*u.scale,r*u.scale,(s+1)*u.scale)}if(p!=null){var x=this.createElement("rect");x.setAttribute("fill",u.fontBackgroundColor||"none"),x.setAttribute("stroke",u.fontBorderColor||"none"),x.setAttribute("x",Math.floor(p.x-1)),x.setAttribute("y",Math.floor(p.y-1)),x.setAttribute("width",Math.ceil(p.width+2)),x.setAttribute("height",Math.ceil(p.height));var f=u.fontBorderColor!=null?Math.max(1,this.format(u.scale)):0;x.setAttribute("stroke-width",f),this.root.ownerDocument==document&&mxUtils.mod(f,2)==1&&x.setAttribute("transform","translate(0.5, 0.5)"),t.insertBefore(x,t.firstChild)}}},mxSvgCanvas2D.prototype.stroke=function(){this.addNode(!1,!0)},mxSvgCanvas2D.prototype.fill=function(){this.addNode(!0,!1)},mxSvgCanvas2D.prototype.fillAndStroke=function(){this.addNode(!0,!0)},__mxOutput.mxSvgCanvas2D=typeof mxSvgCanvas2D<"u"?mxSvgCanvas2D:void 0;var mxVmlCanvas2D=function(t){mxAbstractCanvas2D.call(this),this.root=t};mxUtils.extend(mxVmlCanvas2D,mxAbstractCanvas2D),mxVmlCanvas2D.prototype.node=null,mxVmlCanvas2D.prototype.textEnabled=!0,mxVmlCanvas2D.prototype.moveOp="m",mxVmlCanvas2D.prototype.lineOp="l",mxVmlCanvas2D.prototype.curveOp="c",mxVmlCanvas2D.prototype.closeOp="x",mxVmlCanvas2D.prototype.rotatedHtmlBackground="",mxVmlCanvas2D.prototype.vmlScale=1,mxVmlCanvas2D.prototype.createElement=function(t){return document.createElement(t)},mxVmlCanvas2D.prototype.createVmlElement=function(t){return this.createElement(mxClient.VML_PREFIX+":"+t)},mxVmlCanvas2D.prototype.addNode=function(t,e){var i=this.node,n=this.state;if(i!=null){if(i.nodeName=="shape")if(this.path!=null&&this.path.length>0)i.path=this.path.join(" ")+" e",i.style.width=this.root.style.width,i.style.height=this.root.style.height,i.coordsize=parseInt(i.style.width)+" "+parseInt(i.style.height);else return;i.strokeweight=this.format(Math.max(1,n.strokeWidth*n.scale/this.vmlScale))+"px",n.shadow&&this.root.appendChild(this.createShadow(i,t&&n.fillColor!=null,e&&n.strokeColor!=null)),e&&n.strokeColor!=null?(i.stroked="true",i.strokecolor=n.strokeColor):i.stroked="false",i.appendChild(this.createStroke()),t&&n.fillColor!=null?i.appendChild(this.createFill()):this.pointerEvents&&(i.nodeName!="shape"||this.path[this.path.length-1]==this.closeOp)?i.appendChild(this.createTransparentFill()):i.filled="false",this.root.appendChild(i)}},mxVmlCanvas2D.prototype.createTransparentFill=function(){var t=this.createVmlElement("fill");return t.src=mxClient.imageBasePath+"/transparent.gif",t.type="tile",t},mxVmlCanvas2D.prototype.createFill=function(){var t=this.state,e=this.createVmlElement("fill");if(e.color=t.fillColor,t.gradientColor!=null){e.type="gradient",e.method="none",e.color2=t.gradientColor;var i=180-t.rotation;t.gradientDirection==mxConstants.DIRECTION_WEST?i-=90+(this.root.style.flip=="x"?180:0):t.gradientDirection==mxConstants.DIRECTION_EAST?i+=90+(this.root.style.flip=="x"?180:0):t.gradientDirection==mxConstants.DIRECTION_NORTH?i-=180+(this.root.style.flip=="y"?-180:0):i+=this.root.style.flip=="y"?-180:0,(this.root.style.flip=="x"||this.root.style.flip=="y")&&(i*=-1),e.angle=mxUtils.mod(i,360),e.opacity=t.alpha*t.gradientFillAlpha*100+"%",e.setAttribute(mxClient.OFFICE_PREFIX+":opacity2",t.alpha*t.gradientAlpha*100+"%")}else(t.alpha<1||t.fillAlpha<1)&&(e.opacity=t.alpha*t.fillAlpha*100+"%");return e},mxVmlCanvas2D.prototype.createStroke=function(){var t=this.state,e=this.createVmlElement("stroke");return e.endcap=t.lineCap||"flat",e.joinstyle=t.lineJoin||"miter",e.miterlimit=t.miterLimit||"10",(t.alpha<1||t.strokeAlpha<1)&&(e.opacity=t.alpha*t.strokeAlpha*100+"%"),t.dashed&&(e.dashstyle=this.getVmlDashStyle()),e},mxVmlCanvas2D.prototype.getVmlDashStyle=function(){var t="dash";if(typeof this.state.dashPattern=="string"){var e=this.state.dashPattern.split(" ");e.length>0&&e[0]==1&&(t="0 2")}return t},mxVmlCanvas2D.prototype.createShadow=function(t,e,i){var n=this.state,r=-n.rotation*(Math.PI/180),s=Math.cos(r),l=Math.sin(r),a=n.shadowDx*n.scale,o=n.shadowDy*n.scale;this.root.style.flip=="x"?a*=-1:this.root.style.flip=="y"&&(o*=-1);var u=t.cloneNode(!0);return u.style.marginLeft=Math.round(a*s-o*l)+"px",u.style.marginTop=Math.round(a*l+o*s)+"px",document.documentMode==8&&(u.strokeweight=t.strokeweight,t.nodeName=="shape"&&(u.path=this.path.join(" ")+" e",u.style.width=this.root.style.width,u.style.height=this.root.style.height,u.coordsize=parseInt(t.style.width)+" "+parseInt(t.style.height))),i?(u.strokecolor=n.shadowColor,u.appendChild(this.createShadowStroke())):u.stroked="false",e?u.appendChild(this.createShadowFill()):u.filled="false",u},mxVmlCanvas2D.prototype.createShadowFill=function(){var t=this.createVmlElement("fill");return t.color=this.state.shadowColor,t.opacity=this.state.alpha*this.state.shadowAlpha*100+"%",t},mxVmlCanvas2D.prototype.createShadowStroke=function(){var t=this.createStroke();return t.opacity=this.state.alpha*this.state.shadowAlpha*100+"%",t},mxVmlCanvas2D.prototype.rotate=function(t,e,i,n,r){e&&i?t+=180:e?this.root.style.flip="x":i&&(this.root.style.flip="y"),(e?!i:i)&&(t*=-1),this.root.style.rotation=t,this.state.rotation=this.state.rotation+t,this.state.rotationCx=n,this.state.rotationCy=r},mxVmlCanvas2D.prototype.begin=function(){mxAbstractCanvas2D.prototype.begin.apply(this,arguments),this.node=this.createVmlElement("shape"),this.node.style.position="absolute"},mxVmlCanvas2D.prototype.quadTo=function(t,e,i,n){var r=this.state,s=(this.lastX+r.dx)*r.scale,l=(this.lastY+r.dy)*r.scale,a=(t+r.dx)*r.scale,o=(e+r.dy)*r.scale,u=(i+r.dx)*r.scale,p=(n+r.dy)*r.scale,m=s+2/3*(a-s),d=l+2/3*(o-l),x=u+2/3*(a-u),f=p+2/3*(o-p);this.path.push("c "+this.format(m)+" "+this.format(d)+" "+this.format(x)+" "+this.format(f)+" "+this.format(u)+" "+this.format(p)),this.lastX=u/r.scale-r.dx,this.lastY=p/r.scale-r.dy},mxVmlCanvas2D.prototype.createRect=function(t,e,i,n,r){var s=this.state,l=this.createVmlElement(t);return l.style.position="absolute",l.style.left=this.format((e+s.dx)*s.scale)+"px",l.style.top=this.format((i+s.dy)*s.scale)+"px",l.style.width=this.format(n*s.scale)+"px",l.style.height=this.format(r*s.scale)+"px",l},mxVmlCanvas2D.prototype.rect=function(t,e,i,n){this.node=this.createRect("rect",t,e,i,n)},mxVmlCanvas2D.prototype.roundrect=function(t,e,i,n,r,s){this.node=this.createRect("roundrect",t,e,i,n),this.node.setAttribute("arcsize",Math.max(r*100/i,s*100/n)+"%")},mxVmlCanvas2D.prototype.ellipse=function(t,e,i,n){this.node=this.createRect("oval",t,e,i,n)},mxVmlCanvas2D.prototype.image=function(t,e,i,n,r,s,l,a){var o=null;if(!s)o=this.createRect("image",t,e,i,n),o.src=r;else{o=this.createRect("rect",t,e,i,n),o.stroked="false";var u=this.createVmlElement("fill");u.aspect=s?"atmost":"ignore",u.rotate="true",u.type="frame",u.src=r,o.appendChild(u)}l&&a?o.style.rotation="180":l?o.style.flip="x":a&&(o.style.flip="y"),(this.state.alpha<1||this.state.fillAlpha<1)&&(o.style.filter+="alpha(opacity="+this.state.alpha*this.state.fillAlpha*100+")"),this.root.appendChild(o)},mxVmlCanvas2D.prototype.createDiv=function(t,e,i,n){var r=this.createElement("div"),s=this.state,l="";if(s.fontBackgroundColor!=null&&(l+="background-color:"+mxUtils.htmlEntities(s.fontBackgroundColor)+";"),s.fontBorderColor!=null&&(l+="border:1px solid "+mxUtils.htmlEntities(s.fontBorderColor)+";"),mxUtils.isNode(t))r.appendChild(t);else if(n!="fill"&&n!="width"){var a=this.createElement("div");a.style.cssText=l,a.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",a.style.zoom="1",a.style.textDecoration="inherit",a.innerHTML=t,r.appendChild(a)}else r.style.cssText=l,r.innerHTML=t;var o=r.style;return o.fontSize=s.fontSize/this.vmlScale+"px",o.fontFamily=s.fontFamily,o.color=s.fontColor,o.verticalAlign="top",o.textAlign=e||"left",o.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?s.fontSize*mxConstants.LINE_HEIGHT/this.vmlScale+"px":mxConstants.LINE_HEIGHT,(s.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(o.fontWeight="bold"),(s.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(o.fontStyle="italic"),(s.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&(o.textDecoration="underline"),r},mxVmlCanvas2D.prototype.text=function(t,e,i,n,r,s,l,a,o,u,p,m,d){if(this.textEnabled&&r!=null){var x=this.state;if(o=="html"){if(x.rotation!=null){var f=this.rotatePoint(t,e,x.rotation,x.rotationCx,x.rotationCy);t=f.x,e=f.y}document.documentMode==8&&!mxClient.IS_EM?(t+=x.dx,e+=x.dy,u!="fill"&&l==mxConstants.ALIGN_TOP&&(e-=1)):(t*=x.scale,e*=x.scale);var g=document.documentMode==8&&!mxClient.IS_EM?this.createVmlElement("group"):this.createElement("div");g.style.position="absolute",g.style.display="inline",g.style.left=this.format(t)+"px",g.style.top=this.format(e)+"px",g.style.zoom=x.scale;var c=this.createElement("div");c.style.position="relative",c.style.display="inline";var v=mxUtils.getAlignmentAsPoint(s,l),y=v.x,T=v.y,C=this.createDiv(r,s,l,u),S=this.createElement("div");if(d!=null&&C.setAttribute("dir",d),a&&i>0){if(p||(C.style.width=Math.round(i)+"px"),C.style.wordWrap=mxConstants.WORD_WRAP,C.style.whiteSpace="normal",C.style.wordWrap=="break-word"){var E=C;E.firstChild!=null&&E.firstChild.nodeName=="DIV"&&(E.firstChild.style.width="100%")}}else C.style.whiteSpace="nowrap";var L=x.rotation+(m||0);if(this.rotateHtml&&L!=0?(S.style.display="inline",S.style.zoom="1",S.appendChild(C),document.documentMode==8&&!mxClient.IS_EM&&this.root.nodeName!="DIV"?(c.appendChild(S),g.appendChild(c)):g.appendChild(S)):document.documentMode==8&&!mxClient.IS_EM?(c.appendChild(C),g.appendChild(c)):(C.style.display="inline",g.appendChild(C)),this.root.nodeName!="DIV"){var A=this.createVmlElement("rect");A.stroked="false",A.filled="false",A.appendChild(g),this.root.appendChild(A)}else this.root.appendChild(g);if(p?(C.style.overflow="hidden",C.style.width=Math.round(i)+"px",mxClient.IS_QUIRKS||(C.style.maxHeight=Math.round(n)+"px")):u=="fill"?(C.style.overflow="hidden",C.style.width=Math.max(0,i)+1+"px",C.style.height=Math.max(0,n)+1+"px"):u=="width"&&(C.style.overflow="hidden",C.style.width=Math.max(0,i)+1+"px",C.style.maxHeight=Math.max(0,n)+1+"px"),this.rotateHtml&&L!=0){var M=L*(Math.PI/180),I=parseFloat(parseFloat(Math.cos(M)).toFixed(8)),P=parseFloat(parseFloat(Math.sin(-M)).toFixed(8));M%=2*Math.PI,M<0&&(M+=2*Math.PI),M%=Math.PI,M>Math.PI/2&&(M=Math.PI-M);var R=Math.cos(M),O=Math.sin(M);document.documentMode==8&&!mxClient.IS_EM&&(C.style.display="inline-block",S.style.display="inline-block",c.style.display="inline-block"),C.style.visibility="hidden",C.style.position="absolute",document.body.appendChild(C);var _=C;_.firstChild!=null&&_.firstChild.nodeName=="DIV"&&(_=_.firstChild);var E=_.offsetWidth+3,b=_.offsetHeight;p?(i=Math.min(i,E),b=Math.min(b,n)):i=E,a&&(C.style.width=i+"px"),mxClient.IS_QUIRKS&&(p||u=="width")&&b>n&&(b=n,C.style.height=b+"px"),n=b;var k=(n-n*R+i*-O)/2-P*i*(y+.5)+I*n*(T+.5),G=(i-i*R+n*-O)/2+I*i*(y+.5)+P*n*(T+.5);if(g.nodeName=="group"&&this.root.nodeName=="DIV"){var B=this.createElement("div");B.style.display="inline-block",B.style.position="absolute",B.style.left=this.format(t+(G-i/2)*x.scale)+"px",B.style.top=this.format(e+(k-n/2)*x.scale)+"px",g.parentNode.appendChild(B),B.appendChild(g)}else{var j=document.documentMode==8&&!mxClient.IS_EM?1:x.scale;g.style.left=this.format(t+(G-i/2)*j)+"px",g.style.top=this.format(e+(k-n/2)*j)+"px"}S.style.filter="progid:DXImageTransform.Microsoft.Matrix(M11="+I+", M12="+P+", M21="+-P+", M22="+I+", sizingMethod='auto expand')",S.style.backgroundColor=this.rotatedHtmlBackground,this.state.alpha<1&&(S.style.filter+="alpha(opacity="+this.state.alpha*100+")"),S.appendChild(C),C.style.position="",C.style.visibility=""}else if(document.documentMode!=8||mxClient.IS_EM){C.style.verticalAlign="top",this.state.alpha<1&&(g.style.filter="alpha(opacity="+this.state.alpha*100+")");var H=C.parentNode;C.style.visibility="hidden",document.body.appendChild(C),i=C.offsetWidth;var b=C.offsetHeight;mxClient.IS_QUIRKS&&p&&b>n&&(b=n,C.style.height=b+"px"),n=b,C.style.visibility="",H.appendChild(C),g.style.left=this.format(t+i*y*this.state.scale)+"px",g.style.top=this.format(e+n*T*this.state.scale)+"px"}else this.state.alpha<1&&(C.style.filter="alpha(opacity="+this.state.alpha*100+")"),c.style.left=y*100+"%",c.style.top=T*100+"%"}else this.plainText(t,e,i,n,mxUtils.htmlEntities(r,!1),s,l,a,o,u,p,m,d)}},mxVmlCanvas2D.prototype.plainText=function(t,e,i,n,r,s,l,a,o,u,p,m,d){var x=this.state;t=(t+x.dx)*x.scale,e=(e+x.dy)*x.scale;var f=this.createVmlElement("shape");f.style.width="1px",f.style.height="1px",f.stroked="false";var g=this.createVmlElement("fill");g.color=x.fontColor,g.opacity=x.alpha*100+"%",f.appendChild(g);var c=this.createVmlElement("path");c.textpathok="true",c.v="m "+this.format(0)+" "+this.format(0)+" l "+this.format(1)+" "+this.format(0),f.appendChild(c);var v=this.createVmlElement("textpath");v.style.cssText="v-text-align:"+s,v.style.align=s,v.style.fontFamily=x.fontFamily,v.string=r,v.on="true";var y=x.fontSize*x.scale/this.vmlScale;v.style.fontSize=y+"px",(x.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(v.style.fontWeight="bold"),(x.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(v.style.fontStyle="italic"),(x.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&(v.style.textDecoration="underline");var T=r.split(` +`),C=y+(T.length-1)*y*mxConstants.LINE_HEIGHT,S=0,E=0;if(l==mxConstants.ALIGN_BOTTOM?E=-C/2:l!=mxConstants.ALIGN_MIDDLE&&(E=C/2),m!=null){f.style.rotation=m;var L=m*(Math.PI/180);S=Math.sin(L)*E,E=Math.cos(L)*E}f.appendChild(v),f.style.left=this.format(t-S)+"px",f.style.top=this.format(e+E)+"px",this.root.appendChild(f)},mxVmlCanvas2D.prototype.stroke=function(){this.addNode(!1,!0)},mxVmlCanvas2D.prototype.fill=function(){this.addNode(!0,!1)},mxVmlCanvas2D.prototype.fillAndStroke=function(){this.addNode(!0,!0)},__mxOutput.mxVmlCanvas2D=typeof mxVmlCanvas2D<"u"?mxVmlCanvas2D:void 0;function mxGuide(t,e){this.graph=t,this.setStates(e)}mxGuide.prototype.graph=null,mxGuide.prototype.states=null,mxGuide.prototype.horizontal=!0,mxGuide.prototype.vertical=!0,mxGuide.prototype.guideX=null,mxGuide.prototype.guideY=null,mxGuide.prototype.rounded=!1,mxGuide.prototype.tolerance=2,mxGuide.prototype.setStates=function(t){this.states=t},mxGuide.prototype.isEnabledForEvent=function(t){return!0},mxGuide.prototype.getGuideTolerance=function(t){return t&&this.graph.gridEnabled?this.graph.gridSize/2:this.tolerance},mxGuide.prototype.createGuideShape=function(t){var e=new mxPolyline([],mxConstants.GUIDE_COLOR,mxConstants.GUIDE_STROKEWIDTH);return e.isDashed=!0,e},mxGuide.prototype.isStateIgnored=function(t){return!1},mxGuide.prototype.move=function(t,e,i,n){if(this.states!=null&&(this.horizontal||this.vertical)&&t!=null&&e!=null){let R=function(_,b,k){var G=!1;k&&Math.abs(_-v)0&&t[0]!=null){this.bounds=new mxRectangle(Number(t[0].x),Number(t[0].y),1,1);for(var e=1;e0&&this.bounds!=null&&!isNaN(this.bounds.x)&&!isNaN(this.bounds.y)&&!isNaN(this.bounds.width)&&!isNaN(this.bounds.height)&&this.bounds.width>0&&this.bounds.height>0},mxShape.prototype.createVmlGroup=function(){var t=document.createElement(mxClient.VML_PREFIX+":group");return t.style.position="absolute",t.style.width=this.node.style.width,t.style.height=this.node.style.height,t},mxShape.prototype.redrawShape=function(){var t=this.createCanvas();t!=null&&(t.pointerEvents=this.pointerEvents,this.beforePaint(t),this.paint(t),this.afterPaint(t),this.node!=t.root&&this.node.insertAdjacentHTML("beforeend",t.root.outerHTML),this.node.nodeName=="DIV"&&document.documentMode==8&&(this.node.style.filter="",mxUtils.addTransparentBackgroundFilter(this.node)),this.destroyCanvas(t))},mxShape.prototype.createCanvas=function(){var t=null;return this.node.ownerSVGElement!=null?t=this.createSvgCanvas():mxClient.IS_VML&&(this.updateVmlContainer(),t=this.createVmlCanvas()),t!=null&&this.outline&&(t.setStrokeWidth(this.strokewidth),t.setStrokeColor(this.stroke),this.isDashed!=null&&t.setDashed(this.isDashed),t.setStrokeWidth=function(){},t.setStrokeColor=function(){},t.setFillColor=function(){},t.setGradient=function(){},t.setDashed=function(){},t.text=function(){}),t},mxShape.prototype.createSvgCanvas=function(){var t=new mxSvgCanvas2D(this.node,!1);t.strokeTolerance=this.pointerEvents?this.svgStrokeTolerance:0,t.pointerEventsValue=this.svgPointerEvents;var e=this.getSvgScreenOffset();return e!=0?this.node.setAttribute("transform","translate("+e+","+e+")"):this.node.removeAttribute("transform"),t.minStrokeWidth=this.minSvgStrokeWidth,this.antiAlias||(t.format=function(i){return Math.round(parseFloat(i))}),t},mxShape.prototype.createVmlCanvas=function(){var t=document.documentMode==8&&this.isParseVml()?this.createVmlGroup():this.node,e=new mxVmlCanvas2D(t);if(t.tagUrn!=""){var i=Math.max(1,Math.round(this.bounds.width)),n=Math.max(1,Math.round(this.bounds.height));t.coordsize=i*this.vmlScale+","+n*this.vmlScale,e.scale(this.vmlScale),e.vmlScale=this.vmlScale}var r=this.scale;return e.translate(-Math.round(this.bounds.x/r),-Math.round(this.bounds.y/r)),e},mxShape.prototype.updateVmlContainer=function(){this.node.style.left=Math.round(this.bounds.x)+"px",this.node.style.top=Math.round(this.bounds.y)+"px";var t=Math.max(1,Math.round(this.bounds.width)),e=Math.max(1,Math.round(this.bounds.height));this.node.style.width=t+"px",this.node.style.height=e+"px",this.node.style.overflow="visible"},mxShape.prototype.redrawHtmlShape=function(){this.updateHtmlBounds(this.node),this.updateHtmlFilters(this.node),this.updateHtmlColors(this.node)},mxShape.prototype.updateHtmlFilters=function(t){var e="";if(this.opacity<100&&(e+="alpha(opacity="+this.opacity+")"),this.isShadow&&(e+="progid:DXImageTransform.Microsoft.dropShadow (OffX='"+Math.round(mxConstants.SHADOW_OFFSET_X*this.scale)+"', OffY='"+Math.round(mxConstants.SHADOW_OFFSET_Y*this.scale)+"', Color='"+mxConstants.VML_SHADOWCOLOR+"')"),this.fill!=null&&this.fill!=mxConstants.NONE&&this.gradient&&this.gradient!=mxConstants.NONE){var i=this.fill,n=this.gradient,r="0",s={east:0,south:1,west:2,north:3},l=this.direction!=null?s[this.direction]:0;if(this.gradientDirection!=null&&(l=mxUtils.mod(l+s[this.gradientDirection]-1,4)),l==1){r="1";var a=i;i=n,n=a}else if(l==2){var a=i;i=n,n=a}else l==3&&(r="1");e+="progid:DXImageTransform.Microsoft.gradient(startColorStr='"+i+"', endColorStr='"+n+"', gradientType='"+r+"')"}t.style.filter=e},mxShape.prototype.updateHtmlColors=function(t){var e=this.stroke;e!=null&&e!=mxConstants.NONE?(t.style.borderColor=e,this.isDashed?t.style.borderStyle="dashed":this.strokewidth>0&&(t.style.borderStyle="solid"),t.style.borderWidth=Math.max(1,Math.ceil(this.strokewidth*this.scale))+"px"):t.style.borderWidth="0px",e=this.outline?null:this.fill,e!=null&&e!=mxConstants.NONE?(t.style.backgroundColor=e,t.style.backgroundImage="none"):this.pointerEvents?t.style.backgroundColor="transparent":document.documentMode==8?mxUtils.addTransparentBackgroundFilter(t):this.setTransparentBackgroundImage(t)},mxShape.prototype.updateHtmlBounds=function(t){var e=document.documentMode>=9?0:Math.ceil(this.strokewidth*this.scale);t.style.borderWidth=Math.max(1,e)+"px",t.style.overflow="hidden",t.style.left=Math.round(this.bounds.x-e/2)+"px",t.style.top=Math.round(this.bounds.y-e/2)+"px",document.compatMode=="CSS1Compat"&&(e=-e),t.style.width=Math.round(Math.max(0,this.bounds.width+e))+"px",t.style.height=Math.round(Math.max(0,this.bounds.height+e))+"px"},mxShape.prototype.destroyCanvas=function(t){if(t instanceof mxSvgCanvas2D){for(var e in t.gradients){var i=t.gradients[e];i!=null&&(i.mxRefCount=(i.mxRefCount||0)+1)}this.releaseSvgGradients(this.oldGradients),this.oldGradients=t.gradients}},mxShape.prototype.beforePaint=function(t){},mxShape.prototype.afterPaint=function(t){},mxShape.prototype.paint=function(t){var e=!1;if(t!=null&&this.outline){var i=t.stroke;t.stroke=function(){e=!0,i.apply(this,arguments)};var n=t.fillAndStroke;t.fillAndStroke=function(){e=!0,n.apply(this,arguments)}}var r=this.scale,s=this.bounds.x/r,l=this.bounds.y/r,a=this.bounds.width/r,o=this.bounds.height/r;if(this.isPaintBoundsInverted()){var u=(a-o)/2;s+=u,l-=u;var p=a;a=o,o=p}this.updateTransform(t,s,l,a,o),this.configureCanvas(t,s,l,a,o);var m=null;if(this.stencil==null&&this.points==null&&this.shapePointerEvents||this.stencil!=null&&this.stencilPointerEvents){var d=this.createBoundingBox();if(this.dialect==mxConstants.DIALECT_SVG)m=this.createTransparentSvgRectangle(d.x,d.y,d.width,d.height),this.node.appendChild(m);else{var x=t.createRect("rect",d.x/r,d.y/r,d.width/r,d.height/r);x.appendChild(t.createTransparentFill()),x.stroked="false",t.root.appendChild(x)}}if(this.stencil!=null)this.stencil.drawShape(t,this,s,l,a,o);else if(t.setStrokeWidth(this.strokewidth),this.points!=null){for(var f=[],g=0;g0){l=l??!0;var a=e[e.length-1];if(r&&i){e=e.slice();var o=e[0],u=new mxPoint(a.x+(o.x-a.x)/2,a.y+(o.y-a.y)/2);e.splice(0,0,u)}var p=e[0],m=1;for(l?t.moveTo(p.x,p.y):t.lineTo(p.x,p.y);m<(r?e.length:e.length-1);){var d=e[mxUtils.mod(m,e.length)],x=p.x-d.x,f=p.y-d.y;if(i&&(x!=0||f!=0)&&(s==null||mxUtils.indexOf(s,m-1)<0)){var g=Math.sqrt(x*x+f*f),c=x*Math.min(n,g/2)/g,v=f*Math.min(n,g/2)/g,y=d.x+c,T=d.y+v;t.lineTo(y,T);for(var C=e[mxUtils.mod(m+1,e.length)];m0&&t.height>0){this.boundingBox=new mxRectangle(t.x,t.y,t.width,t.height),this.boundingBox.grow(this.strokewidth*this.scale/2);return}}catch{}if(this.bounds!=null){var e=this.createBoundingBox();if(e!=null){this.augmentBoundingBox(e);var i=this.getShapeRotation();i!=0&&(e=mxUtils.getBoundingBox(e,i))}this.boundingBox=e}},mxShape.prototype.createBoundingBox=function(){var t=this.bounds.clone();return(this.stencil!=null&&(this.direction==mxConstants.DIRECTION_NORTH||this.direction==mxConstants.DIRECTION_SOUTH)||this.isPaintBoundsInverted())&&t.rotate90(),t},mxShape.prototype.augmentBoundingBox=function(t){this.isShadow&&(t.width+=Math.ceil(mxConstants.SHADOW_OFFSET_X*this.scale),t.height+=Math.ceil(mxConstants.SHADOW_OFFSET_Y*this.scale)),t.grow(this.strokewidth*this.scale/2)},mxShape.prototype.isPaintBoundsInverted=function(){return this.stencil==null&&(this.direction==mxConstants.DIRECTION_NORTH||this.direction==mxConstants.DIRECTION_SOUTH)},mxShape.prototype.getRotation=function(){return this.rotation!=null?this.rotation:0},mxShape.prototype.getTextRotation=function(){var t=this.getRotation();return mxUtils.getValue(this.style,mxConstants.STYLE_HORIZONTAL,1)!=1&&(t+=mxText.prototype.verticalTextRotation),t},mxShape.prototype.getShapeRotation=function(){var t=this.getRotation();return this.direction!=null&&(this.direction==mxConstants.DIRECTION_NORTH?t+=270:this.direction==mxConstants.DIRECTION_WEST?t+=180:this.direction==mxConstants.DIRECTION_SOUTH&&(t+=90)),t},mxShape.prototype.createTransparentSvgRectangle=function(t,e,i,n){var r=document.createElementNS(mxConstants.NS_SVG,"rect");return r.setAttribute("x",t),r.setAttribute("y",e),r.setAttribute("width",i),r.setAttribute("height",n),r.setAttribute("fill","none"),r.setAttribute("stroke","none"),r.setAttribute("pointer-events","all"),r},mxShape.prototype.setTransparentBackgroundImage=function(t){t.style.backgroundImage="url('"+mxClient.imageBasePath+"/transparent.gif')"},mxShape.prototype.releaseSvgGradients=function(t){if(t!=null)for(var e in t){var i=t[e];i!=null&&(i.mxRefCount=(i.mxRefCount||0)-1,i.mxRefCount==0&&i.parentNode!=null&&i.parentNode.removeChild(i))}},mxShape.prototype.destroy=function(){this.node!=null&&(mxEvent.release(this.node),this.node.parentNode!=null&&this.node.parentNode.removeChild(this.node),this.node=null),this.releaseSvgGradients(this.oldGradients),this.oldGradients=null},__mxOutput.mxShape=typeof mxShape<"u"?mxShape:void 0;function mxStencil(t){this.desc=t,this.parseDescription(),this.parseConstraints()}mxUtils.extend(mxStencil,mxShape),mxStencil.defaultLocalized=!1,mxStencil.allowEval=!1,mxStencil.prototype.desc=null,mxStencil.prototype.constraints=null,mxStencil.prototype.aspect=null,mxStencil.prototype.w0=null,mxStencil.prototype.h0=null,mxStencil.prototype.bgNode=null,mxStencil.prototype.fgNode=null,mxStencil.prototype.strokewidth=null,mxStencil.prototype.parseDescription=function(){this.fgNode=this.desc.getElementsByTagName("foreground")[0],this.bgNode=this.desc.getElementsByTagName("background")[0],this.w0=Number(this.desc.getAttribute("w")||100),this.h0=Number(this.desc.getAttribute("h")||100);var t=this.desc.getAttribute("aspect");this.aspect=t??"variable";var e=this.desc.getAttribute("strokewidth");this.strokewidth=e??"1"},mxStencil.prototype.parseConstraints=function(){var t=this.desc.getElementsByTagName("connections")[0];if(t!=null){var e=mxUtils.getChildNodes(t);if(e!=null&&e.length>0){this.constraints=[];for(var i=0;i0&&s>0)for(var p=l.firstChild;p!=null;)p.nodeType==mxConstants.NODETYPE_ELEMENT&&this.drawNode(t,e,p,a,o,u),p=p.nextSibling},mxStencil.prototype.computeAspect=function(t,e,i,n,r,s){var l=e,a=i,o=n/this.w0,u=r/this.h0,p=s==mxConstants.DIRECTION_NORTH||s==mxConstants.DIRECTION_SOUTH;if(p){u=n/this.h0,o=r/this.w0;var m=(n-r)/2;l+=m,a-=m}return this.aspect=="fixed"&&(u=Math.min(o,u),o=u,p?(l+=(r-this.w0*o)/2,a+=(n-this.h0*u)/2):(l+=(n-this.w0*o)/2,a+=(r-this.h0*u)/2)),new mxRectangle(l,a,o,u)},mxStencil.prototype.drawNode=function(t,e,i,n,r,s){var l=i.nodeName,a=n.x,o=n.y,u=n.width,p=n.height,m=Math.min(u,p);if(l=="save")t.save();else if(l=="restore")t.restore();else if(s){if(l=="path"){t.begin();var d=!0;if(i.getAttribute("rounded")=="1"){d=!1;for(var x=Number(i.getAttribute("arcSize")),f=0,g=[],c=i.firstChild;c!=null;){if(c.nodeType==mxConstants.NODETYPE_ELEMENT){var v=c.nodeName;if(v=="move"||v=="line")(v=="move"||g.length==0)&&g.push([]),g[g.length-1].push(new mxPoint(a+Number(c.getAttribute("x"))*u,o+Number(c.getAttribute("y"))*p)),f++;else{d=!0;break}}c=c.nextSibling}if(!d&&f>0)for(var y=0;y0&&V.push(Number(X[y])*m);W=V.join(" "),t.setDashPattern(W)}}else l=="strokecolor"?t.setStrokeColor(i.getAttribute("color")):l=="linecap"?t.setLineCap(i.getAttribute("cap")):l=="linejoin"?t.setLineJoin(i.getAttribute("join")):l=="miterlimit"?t.setMiterLimit(Number(i.getAttribute("limit"))):l=="fillcolor"?t.setFillColor(i.getAttribute("color")):l=="alpha"||l=="fillalpha"||l=="strokealpha"?t.setAlpha(i.getAttribute("alpha")):l=="fontcolor"?t.setFontColor(i.getAttribute("color")):l=="fontstyle"?t.setFontStyle(i.getAttribute("style")):l=="fontfamily"?t.setFontFamily(i.getAttribute("family")):l=="fontsize"&&t.setFontSize(Number(i.getAttribute("size"))*m);r&&(l=="fillstroke"||l=="fill"||l=="stroke")&&(r=!1,t.setShadow(!1))}},__mxOutput.mxStencil=typeof mxStencil<"u"?mxStencil:void 0;var mxStencilRegistry={stencils:{},addStencil:function(t,e){mxStencilRegistry.stencils[t]=e},getStencil:function(t){return mxStencilRegistry.stencils[t]}};__mxOutput.mxStencilRegistry=typeof mxStencilRegistry<"u"?mxStencilRegistry:void 0;var mxMarker={markers:[],addMarker:function(t,e){mxMarker.markers[t]=e},createMarker:function(t,e,i,n,r,s,l,a,o,u){var p=mxMarker.markers[i];return p!=null?p(t,e,i,n,r,s,l,a,o,u):null}};(function(){function t(n){return n=n??2,function(r,s,l,a,o,u,p,m,d,x){var f=o*d*1.118,g=u*d*1.118;o=o*(p+d),u=u*(p+d);var c=a.clone();c.x-=f,c.y-=g;var v=l!=mxConstants.ARROW_CLASSIC&&l!=mxConstants.ARROW_CLASSIC_THIN?1:3/4;return a.x+=-o*v-f,a.y+=-u*v-g,function(){r.begin(),r.moveTo(c.x,c.y),r.lineTo(c.x-o-u/n,c.y-u+o/n),(l==mxConstants.ARROW_CLASSIC||l==mxConstants.ARROW_CLASSIC_THIN)&&r.lineTo(c.x-o*3/4,c.y-u*3/4),r.lineTo(c.x+u/n-o,c.y-u-o/n),r.close(),x?r.fillAndStroke():r.stroke()}}}mxMarker.addMarker("classic",t(2)),mxMarker.addMarker("classicThin",t(3)),mxMarker.addMarker("block",t(2)),mxMarker.addMarker("blockThin",t(3));function e(n){return n=n??2,function(r,s,l,a,o,u,p,m,d,x){var f=o*d*1.118,g=u*d*1.118;o=o*(p+d),u=u*(p+d);var c=a.clone();return c.x-=f,c.y-=g,a.x+=-f*2,a.y+=-g*2,function(){r.begin(),r.moveTo(c.x-o-u/n,c.y-u+o/n),r.lineTo(c.x,c.y),r.lineTo(c.x+u/n-o,c.y-u-o/n),r.stroke()}}}mxMarker.addMarker("open",e(2)),mxMarker.addMarker("openThin",e(3)),mxMarker.addMarker("oval",function(n,r,s,l,a,o,u,p,m,d){var x=u/2,f=l.clone();return l.x-=a*x,l.y-=o*x,function(){n.ellipse(f.x-x,f.y-x,u,u),d?n.fillAndStroke():n.stroke()}});function i(n,r,s,l,a,o,u,p,m,d){var x=s==mxConstants.ARROW_DIAMOND?.7071:.9862,f=a*m*x,g=o*m*x;a=a*(u+m),o=o*(u+m);var c=l.clone();c.x-=f,c.y-=g,l.x+=-a-f,l.y+=-o-g;var v=s==mxConstants.ARROW_DIAMOND?2:3.4;return function(){n.begin(),n.moveTo(c.x,c.y),n.lineTo(c.x-a/2-o/v,c.y+a/v-o/2),n.lineTo(c.x-a,c.y-o),n.lineTo(c.x-a/2+o/v,c.y-o/2-a/v),n.close(),d?n.fillAndStroke():n.stroke()}}mxMarker.addMarker("diamond",i),mxMarker.addMarker("diamondThin",i)})(),__mxOutput.mxMarker=typeof mxMarker<"u"?mxMarker:void 0;function mxActor(t,e,i,n){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=i,this.strokewidth=n??1}mxUtils.extend(mxActor,mxShape),mxActor.prototype.paintVertexShape=function(t,e,i,n,r){t.translate(e,i),t.begin(),this.redrawPath(t,e,i,n,r),t.fillAndStroke()},mxActor.prototype.redrawPath=function(t,e,i,n,r){var s=n/3;t.moveTo(0,r),t.curveTo(0,3*r/5,0,2*r/5,n/2,2*r/5),t.curveTo(n/2-s,2*r/5,n/2-s,0,n/2,0),t.curveTo(n/2+s,0,n/2+s,2*r/5,n/2,2*r/5),t.curveTo(n,2*r/5,n,3*r/5,n,r),t.close()},__mxOutput.mxActor=typeof mxActor<"u"?mxActor:void 0;function mxCloud(t,e,i,n){mxActor.call(this),this.bounds=t,this.fill=e,this.stroke=i,this.strokewidth=n??1}mxUtils.extend(mxCloud,mxActor),mxCloud.prototype.redrawPath=function(t,e,i,n,r){t.moveTo(.25*n,.25*r),t.curveTo(.05*n,.25*r,0,.5*r,.16*n,.55*r),t.curveTo(0,.66*r,.18*n,.9*r,.31*n,.8*r),t.curveTo(.4*n,r,.7*n,r,.8*n,.8*r),t.curveTo(n,.8*r,n,.6*r,.875*n,.5*r),t.curveTo(n,.3*r,.8*n,.1*r,.625*n,.2*r),t.curveTo(.5*n,.05*r,.3*n,.05*r,.25*n,.25*r),t.close()},__mxOutput.mxCloud=typeof mxCloud<"u"?mxCloud:void 0;function mxRectangleShape(t,e,i,n){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=i,this.strokewidth=n??1}mxUtils.extend(mxRectangleShape,mxShape),mxRectangleShape.prototype.isHtmlAllowed=function(){var t=!0;return this.style!=null&&(t=mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1")=="1"),!this.isRounded&&!this.glass&&this.rotation==0&&(t||this.fill!=null&&this.fill!=mxConstants.NONE)},mxRectangleShape.prototype.paintBackground=function(t,e,i,n,r){var s=!0;if(this.style!=null&&(s=mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1")=="1"),s||this.fill!=null&&this.fill!=mxConstants.NONE||this.stroke!=null&&this.stroke!=mxConstants.NONE){if(!s&&(this.fill==null||this.fill==mxConstants.NONE)&&(t.pointerEvents=!1),this.isRounded){var l=0;if(mxUtils.getValue(this.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0)=="1")l=Math.min(n/2,Math.min(r/2,mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2));else{var a=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.RECTANGLE_ROUNDING_FACTOR*100)/100;l=Math.min(n*a,r*a)}t.roundrect(e,i,n,r,l,l)}else t.rect(e,i,n,r);t.fillAndStroke()}},mxRectangleShape.prototype.isRoundable=function(t,e,i,n,r){return!0},mxRectangleShape.prototype.paintForeground=function(t,e,i,n,r){this.glass&&!this.outline&&this.fill!=null&&this.fill!=mxConstants.NONE&&this.paintGlassEffect(t,e,i,n,r,this.getArcSize(n+this.strokewidth,r+this.strokewidth))},__mxOutput.mxRectangleShape=typeof mxRectangleShape<"u"?mxRectangleShape:void 0;function mxEllipse(t,e,i,n){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=i,this.strokewidth=n??1}mxUtils.extend(mxEllipse,mxShape),mxEllipse.prototype.paintVertexShape=function(t,e,i,n,r){t.ellipse(e,i,n,r),t.fillAndStroke()},__mxOutput.mxEllipse=typeof mxEllipse<"u"?mxEllipse:void 0;function mxDoubleEllipse(t,e,i,n){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=i,this.strokewidth=n??1}mxUtils.extend(mxDoubleEllipse,mxShape),mxDoubleEllipse.prototype.vmlScale=10,mxDoubleEllipse.prototype.paintBackground=function(t,e,i,n,r){t.ellipse(e,i,n,r),t.fillAndStroke()},mxDoubleEllipse.prototype.paintForeground=function(t,e,i,n,r){if(!this.outline){var s=mxUtils.getValue(this.style,mxConstants.STYLE_MARGIN,Math.min(3+this.strokewidth,Math.min(n/5,r/5)));e+=s,i+=s,n-=2*s,r-=2*s,n>0&&r>0&&t.ellipse(e,i,n,r),t.stroke()}},mxDoubleEllipse.prototype.getLabelBounds=function(t){var e=mxUtils.getValue(this.style,mxConstants.STYLE_MARGIN,Math.min(3+this.strokewidth,Math.min(t.width/5/this.scale,t.height/5/this.scale)))*this.scale;return new mxRectangle(t.x+e,t.y+e,t.width-2*e,t.height-2*e)},__mxOutput.mxDoubleEllipse=typeof mxDoubleEllipse<"u"?mxDoubleEllipse:void 0;function mxRhombus(t,e,i,n){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=i,this.strokewidth=n??1}mxUtils.extend(mxRhombus,mxShape),mxRhombus.prototype.isRoundable=function(){return!0},mxRhombus.prototype.paintVertexShape=function(t,e,i,n,r){var s=n/2,l=r/2,a=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;t.begin(),this.addPoints(t,[new mxPoint(e+s,i),new mxPoint(e+n,i+l),new mxPoint(e+s,i+r),new mxPoint(e,i+l)],this.isRounded,a,!0),t.fillAndStroke()},__mxOutput.mxRhombus=typeof mxRhombus<"u"?mxRhombus:void 0;function mxPolyline(t,e,i){mxShape.call(this),this.points=t,this.stroke=e,this.strokewidth=i??1}mxUtils.extend(mxPolyline,mxShape),mxPolyline.prototype.getRotation=function(){return 0},mxPolyline.prototype.getShapeRotation=function(){return 0},mxPolyline.prototype.isPaintBoundsInverted=function(){return!1},mxPolyline.prototype.paintEdgeShape=function(t,e){var i=t.pointerEventsValue;t.pointerEventsValue="stroke",this.style==null||this.style[mxConstants.STYLE_CURVED]!=1?this.paintLine(t,e,this.isRounded):this.paintCurvedLine(t,e),t.pointerEventsValue=i},mxPolyline.prototype.paintLine=function(t,e,i){var n=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;t.begin(),this.addPoints(t,e,i,n,!1),t.stroke()},mxPolyline.prototype.paintCurvedLine=function(t,e){t.begin();var i=e[0],n=e.length;t.moveTo(i.x,i.y);for(var r=1;r2&&t.setMiterLimit(1.42),t.begin();var P=y,R=S;if(a&&!l)this.paintMarker(t,e[0].x,e[0].y,y,S,p,n,s,u,!0);else{var O=e[0].x+A/2+u*y,_=e[0].y+M/2+u*S,b=e[0].x-A/2+u*y,k=e[0].y-M/2+u*S;l?(t.moveTo(O,_),I.push(function(){t.lineTo(b,k)})):(t.moveTo(b,k),t.lineTo(O,_))}for(var G=0,B=0,j=0,H=0;H=0;H--)I[H]();l?(t.end(),t.stroke()):(t.close(),t.fillAndStroke()),t.setShadow(!1),t.setMiterLimit(4),d&&t.setLineJoin("flat"),e.length>2&&(t.setMiterLimit(4),a&&!l&&(t.begin(),this.paintMarker(t,e[0].x,e[0].y,P,R,p,n,s,u,!0),t.stroke(),t.end()),o&&!l&&(t.begin(),this.paintMarker(t,x.x,x.y,-y,-S,m,r,s,u,!0),t.stroke(),t.end()))}},mxArrowConnector.prototype.paintMarker=function(t,e,i,n,r,s,l,a,o,u){var p=a/l,m=a*r/2,d=-a*n/2,x=(o+s)*n,f=(o+s)*r;u?t.moveTo(e-m+x,i-d+f):t.lineTo(e-m+x,i-d+f),t.lineTo(e-m/p+x,i-d/p+f),t.lineTo(e+o*n,i+o*r),t.lineTo(e+m/p+x,i+d/p+f),t.lineTo(e+m+x,i+d+f)},mxArrowConnector.prototype.isArrowRounded=function(){return this.isRounded},mxArrowConnector.prototype.getStartArrowWidth=function(){return mxConstants.ARROW_WIDTH},mxArrowConnector.prototype.getEndArrowWidth=function(){return mxConstants.ARROW_WIDTH},mxArrowConnector.prototype.getEdgeWidth=function(){return mxConstants.ARROW_WIDTH/3},mxArrowConnector.prototype.isOpenEnded=function(){return!1},mxArrowConnector.prototype.isMarkerStart=function(){return mxUtils.getValue(this.style,mxConstants.STYLE_STARTARROW,mxConstants.NONE)!=mxConstants.NONE},mxArrowConnector.prototype.isMarkerEnd=function(){return mxUtils.getValue(this.style,mxConstants.STYLE_ENDARROW,mxConstants.NONE)!=mxConstants.NONE},__mxOutput.mxArrowConnector=typeof mxArrowConnector<"u"?mxArrowConnector:void 0;function mxText(t,e,i,n,r,s,l,a,o,u,p,m,d,x,f,g,c,v,y,T,C){mxShape.call(this),this.value=t,this.bounds=e,this.color=r??"black",this.align=i??mxConstants.ALIGN_CENTER,this.valign=n??mxConstants.ALIGN_MIDDLE,this.family=s??mxConstants.DEFAULT_FONTFAMILY,this.size=l??mxConstants.DEFAULT_FONTSIZE,this.fontStyle=a??mxConstants.DEFAULT_FONTSTYLE,this.spacing=parseInt(o||2),this.spacingTop=this.spacing+parseInt(u||0),this.spacingRight=this.spacing+parseInt(p||0),this.spacingBottom=this.spacing+parseInt(m||0),this.spacingLeft=this.spacing+parseInt(d||0),this.horizontal=x??!0,this.background=f,this.border=g,this.wrap=c??!1,this.clipped=v??!1,this.overflow=y??"visible",this.labelPadding=T??0,this.textDirection=C,this.rotation=0,this.updateMargin()}mxUtils.extend(mxText,mxShape),mxText.prototype.baseSpacingTop=0,mxText.prototype.baseSpacingBottom=0,mxText.prototype.baseSpacingLeft=0,mxText.prototype.baseSpacingRight=0,mxText.prototype.replaceLinefeeds=!0,mxText.prototype.verticalTextRotation=-90,mxText.prototype.ignoreClippedStringSize=!0,mxText.prototype.ignoreStringSize=!1,mxText.prototype.textWidthPadding=document.documentMode==8&&!mxClient.IS_EM?4:3,mxText.prototype.lastValue=null,mxText.prototype.cacheEnabled=!0,mxText.prototype.isParseVml=function(){return!1},mxText.prototype.isHtmlAllowed=function(){return document.documentMode!=8||mxClient.IS_EM},mxText.prototype.getSvgScreenOffset=function(){return 0},mxText.prototype.checkBounds=function(){return!isNaN(this.scale)&&isFinite(this.scale)&&this.scale>0&&this.bounds!=null&&!isNaN(this.bounds.x)&&!isNaN(this.bounds.y)&&!isNaN(this.bounds.width)&&!isNaN(this.bounds.height)},mxText.prototype.paint=function(t,e){var i=this.scale,n=this.bounds.x/i,r=this.bounds.y/i,s=this.bounds.width/i,l=this.bounds.height/i;if(this.updateTransform(t,n,r,s,l),this.configureCanvas(t,n,r,s,l),e)t.updateText(n,r,s,l,this.align,this.valign,this.wrap,this.overflow,this.clipped,this.getTextRotation(),this.node);else{var a=mxUtils.isNode(this.value)||this.dialect==mxConstants.DIALECT_STRICTHTML,o=a||t instanceof mxVmlCanvas2D?"html":"",u=this.value;!a&&o=="html"&&(u=mxUtils.htmlEntities(u,!1)),o=="html"&&!mxUtils.isNode(this.value)&&(u=mxUtils.replaceTrailingNewlines(u,"

")),u=!mxUtils.isNode(this.value)&&this.replaceLinefeeds&&o=="html"?u.replace(/\n/g,"
"):u;var p=this.textDirection;p==mxConstants.TEXT_DIRECTION_AUTO&&!a&&(p=this.getAutoDirection()),p!=mxConstants.TEXT_DIRECTION_LTR&&p!=mxConstants.TEXT_DIRECTION_RTL&&(p=null),t.text(n,r,s,l,u,this.align,this.valign,this.wrap,o,this.overflow,this.clipped,this.getTextRotation(),p)}},mxText.prototype.redraw=function(){if(this.visible&&this.checkBounds()&&this.cacheEnabled&&this.lastValue==this.value&&(mxUtils.isNode(this.value)||this.dialect==mxConstants.DIALECT_STRICTHTML))if(this.node.nodeName=="DIV"&&(this.isHtmlAllowed()||!mxClient.IS_VML))mxClient.IS_SVG?this.redrawHtmlShapeWithCss3():(this.updateSize(this.node,this.state==null||this.state.view.textDiv==null),mxClient.IS_IE&&(document.documentMode==null||document.documentMode<=8)?this.updateHtmlFilter():this.updateHtmlTransform()),this.updateBoundingBox();else{var t=this.createCanvas();t!=null&&t.updateText!=null?(t.pointerEvents=this.pointerEvents,this.paint(t,!0),this.destroyCanvas(t),this.updateBoundingBox()):mxShape.prototype.redraw.apply(this,arguments)}else mxShape.prototype.redraw.apply(this,arguments),mxUtils.isNode(this.value)||this.dialect==mxConstants.DIALECT_STRICTHTML?this.lastValue=this.value:this.lastValue=null},mxText.prototype.resetStyles=function(){mxShape.prototype.resetStyles.apply(this,arguments),this.color="black",this.align=mxConstants.ALIGN_CENTER,this.valign=mxConstants.ALIGN_MIDDLE,this.family=mxConstants.DEFAULT_FONTFAMILY,this.size=mxConstants.DEFAULT_FONTSIZE,this.fontStyle=mxConstants.DEFAULT_FONTSTYLE,this.spacing=2,this.spacingTop=2,this.spacingRight=2,this.spacingBottom=2,this.spacingLeft=2,this.horizontal=!0,delete this.background,delete this.border,this.textDirection=mxConstants.DEFAULT_TEXT_DIRECTION,delete this.margin},mxText.prototype.apply=function(t){var e=this.spacing;mxShape.prototype.apply.apply(this,arguments),this.style!=null&&(this.fontStyle=mxUtils.getValue(this.style,mxConstants.STYLE_FONTSTYLE,this.fontStyle),this.family=mxUtils.getValue(this.style,mxConstants.STYLE_FONTFAMILY,this.family),this.size=mxUtils.getValue(this.style,mxConstants.STYLE_FONTSIZE,this.size),this.color=mxUtils.getValue(this.style,mxConstants.STYLE_FONTCOLOR,this.color),this.align=mxUtils.getValue(this.style,mxConstants.STYLE_ALIGN,this.align),this.valign=mxUtils.getValue(this.style,mxConstants.STYLE_VERTICAL_ALIGN,this.valign),this.spacing=parseInt(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING,this.spacing)),this.spacingTop=parseInt(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING_TOP,this.spacingTop-e))+this.spacing,this.spacingRight=parseInt(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING_RIGHT,this.spacingRight-e))+this.spacing,this.spacingBottom=parseInt(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING_BOTTOM,this.spacingBottom-e))+this.spacing,this.spacingLeft=parseInt(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING_LEFT,this.spacingLeft-e))+this.spacing,this.horizontal=mxUtils.getValue(this.style,mxConstants.STYLE_HORIZONTAL,this.horizontal),this.background=mxUtils.getValue(this.style,mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,this.background),this.border=mxUtils.getValue(this.style,mxConstants.STYLE_LABEL_BORDERCOLOR,this.border),this.textDirection=mxUtils.getValue(this.style,mxConstants.STYLE_TEXT_DIRECTION,mxConstants.DEFAULT_TEXT_DIRECTION),this.opacity=mxUtils.getValue(this.style,mxConstants.STYLE_TEXT_OPACITY,100),this.updateMargin()),this.flipV=null,this.flipH=null},mxText.prototype.getAutoDirection=function(){var t=/[A-Za-z\u05d0-\u065f\u066a-\u06ef\u06fa-\u07ff\ufb1d-\ufdff\ufe70-\ufefc]/.exec(this.value);return t!=null&&t.length>0&&t[0]>"z"?mxConstants.TEXT_DIRECTION_RTL:mxConstants.TEXT_DIRECTION_LTR},mxText.prototype.getContentNode=function(){var t=this.node;return t!=null&&(t.ownerSVGElement==null?t=this.node.firstChild.firstChild:t=t.firstChild.firstChild.firstChild.firstChild.firstChild),t},mxText.prototype.updateBoundingBox=function(){var t=this.node;this.boundingBox=this.bounds.clone();var e=this.getTextRotation(),i=this.style!=null?mxUtils.getValue(this.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER):null,n=this.style!=null?mxUtils.getValue(this.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE):null;if(!this.ignoreStringSize&&t!=null&&this.overflow!="fill"&&(!this.clipped||!this.ignoreClippedStringSize||i!=mxConstants.ALIGN_CENTER||n!=mxConstants.ALIGN_MIDDLE)){var r=null,s=null;if(t.ownerSVGElement!=null)if(t.firstChild!=null&&t.firstChild.firstChild!=null&&t.firstChild.firstChild.nodeName=="foreignObject")t=t.firstChild.firstChild.firstChild.firstChild,s=t.offsetHeight*this.scale,this.overflow=="width"?r=this.boundingBox.width:r=t.offsetWidth*this.scale;else try{var l=t.getBBox();typeof this.value=="string"&&mxUtils.trim(this.value)==0?this.boundingBox=null:l.width==0&&l.height==0?this.boundingBox=null:this.boundingBox=new mxRectangle(l.x,l.y,l.width,l.height);return}catch{}else{var a=this.state!=null?this.state.view.textDiv:null;if(this.offsetWidth!=null&&this.offsetHeight!=null)r=this.offsetWidth*this.scale,s=this.offsetHeight*this.scale;else{a!=null&&(this.updateFont(a),this.updateSize(a,!1),this.updateInnerHtml(a),t=a);var o=t;if(document.documentMode==8&&!mxClient.IS_EM){var u=Math.round(this.bounds.width/this.scale);if(this.wrap&&u>0){if(t.style.wordWrap=mxConstants.WORD_WRAP,t.style.whiteSpace="normal",t.style.wordWrap!="break-word"){var p=o.getElementsByTagName("div");p.length>0&&(o=p[p.length-1]),r=o.offsetWidth+2,p=this.node.getElementsByTagName("div"),this.clipped&&(r=Math.min(u,r)),p.length>1&&(p[p.length-2].style.width=r+"px")}}else t.style.whiteSpace="nowrap"}else o.firstChild!=null&&o.firstChild.nodeName=="DIV"&&(o=o.firstChild);this.offsetWidth=o.offsetWidth+this.textWidthPadding,this.offsetHeight=o.offsetHeight,r=this.offsetWidth*this.scale,s=this.offsetHeight*this.scale}}r!=null&&s!=null&&(this.boundingBox=new mxRectangle(this.bounds.x,this.bounds.y,r,s))}if(this.boundingBox!=null)if(e!=0){var m=mxUtils.getBoundingBox(new mxRectangle(this.margin.x*this.boundingBox.width,this.margin.y*this.boundingBox.height,this.boundingBox.width,this.boundingBox.height),e,new mxPoint(0,0));this.unrotatedBoundingBox=mxRectangle.fromRectangle(this.boundingBox),this.unrotatedBoundingBox.x+=this.margin.x*this.unrotatedBoundingBox.width,this.unrotatedBoundingBox.y+=this.margin.y*this.unrotatedBoundingBox.height,this.boundingBox.x+=m.x,this.boundingBox.y+=m.y,this.boundingBox.width=m.width,this.boundingBox.height=m.height}else this.boundingBox.x+=this.margin.x*this.boundingBox.width,this.boundingBox.y+=this.margin.y*this.boundingBox.height,this.unrotatedBoundingBox=null},mxText.prototype.getShapeRotation=function(){return 0},mxText.prototype.getTextRotation=function(){return this.state!=null&&this.state.shape!=null?this.state.shape.getTextRotation():0},mxText.prototype.isPaintBoundsInverted=function(){return!this.horizontal&&this.state!=null&&this.state.view.graph.model.isVertex(this.state.cell)},mxText.prototype.configureCanvas=function(t,e,i,n,r){mxShape.prototype.configureCanvas.apply(this,arguments),t.setFontColor(this.color),t.setFontBackgroundColor(this.background),t.setFontBorderColor(this.border),t.setFontFamily(this.family),t.setFontSize(this.size),t.setFontStyle(this.fontStyle)},mxText.prototype.updateVmlContainer=function(){this.node.style.left=Math.round(this.bounds.x)+"px",this.node.style.top=Math.round(this.bounds.y)+"px",this.node.style.width="1px",this.node.style.height="1px",this.node.style.overflow="visible"},mxText.prototype.getHtmlValue=function(){var t=this.value;return this.dialect!=mxConstants.DIALECT_STRICTHTML&&(t=mxUtils.htmlEntities(t,!1)),t=mxUtils.replaceTrailingNewlines(t,"

"),t=this.replaceLinefeeds?t.replace(/\n/g,"
"):t,t},mxText.prototype.getTextCss=function(){var t=mxConstants.ABSOLUTE_LINE_HEIGHT?this.size*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT,e="display: inline-block; font-size: "+this.size+"px; font-family: "+this.family+"; color: "+this.color+"; line-height: "+t+"; pointer-events: "+(this.pointerEvents?"all":"none")+"; ";(this.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(e+="font-weight: bold; "),(this.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(e+="font-style: italic; ");var i=[];return(this.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&i.push("underline"),(this.fontStyle&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&i.push("line-through"),i.length>0&&(e+="text-decoration: "+i.join(" ")+"; "),e},mxText.prototype.redrawHtmlShape=function(){if(mxClient.IS_SVG)this.redrawHtmlShapeWithCss3();else{var t=this.node.style;t.whiteSpace="normal",t.overflow="",t.width="",t.height="",this.updateValue(),this.updateFont(this.node),this.updateSize(this.node,this.state==null||this.state.view.textDiv==null),this.offsetWidth=null,this.offsetHeight=null,mxClient.IS_IE&&(document.documentMode==null||document.documentMode<=8)?this.updateHtmlFilter():this.updateHtmlTransform()}},mxText.prototype.redrawHtmlShapeWithCss3=function(){var t=Math.max(0,Math.round(this.bounds.width/this.scale)),e=Math.max(0,Math.round(this.bounds.height/this.scale)),i="position: absolute; left: "+Math.round(this.bounds.x)+"px; top: "+Math.round(this.bounds.y)+"px; pointer-events: none; ",n=this.getTextCss();mxSvgCanvas2D.createCss(t+2,e,this.align,this.valign,this.wrap,this.overflow,this.clipped,this.background!=null?mxUtils.htmlEntities(this.background):null,this.border!=null?mxUtils.htmlEntities(this.border):null,i,n,this.scale,mxUtils.bind(this,function(r,s,l,a,o,u){var p=this.getTextRotation(),m=(this.scale!=1?"scale("+this.scale+") ":"")+(p!=0?"rotate("+p+"deg) ":"")+(this.margin.x!=0||this.margin.y!=0?"translate("+this.margin.x*100+"%,"+this.margin.y*100+"%)":"");m!=""&&(m="transform-origin: 0 0; transform: "+m+"; "),u==""?(l+=a,a="display:inline-block; min-width: 100%; "+m):(a+=m,mxClient.IS_SF&&(a+="-webkit-clip-path: content-box;")),this.opacity<100&&(o+="opacity: "+this.opacity/100+"; "),this.node.setAttribute("style",l);var d=mxUtils.isNode(this.value)?this.value.outerHTML:this.getHtmlValue();this.node.firstChild==null&&(this.node.innerHTML="
"+d+"
"),this.node.firstChild.firstChild.setAttribute("style",o),this.node.firstChild.setAttribute("style",a)}))},mxText.prototype.updateHtmlTransform=function(){var t=this.getTextRotation(),e=this.node.style,i=this.margin.x,n=this.margin.y;t!=0?(mxUtils.setPrefixedStyle(e,"transformOrigin",-i*100+"% "+-n*100+"%"),mxUtils.setPrefixedStyle(e,"transform","translate("+i*100+"%,"+n*100+"%) scale("+this.scale+") rotate("+t+"deg)")):(mxUtils.setPrefixedStyle(e,"transformOrigin","0% 0%"),mxUtils.setPrefixedStyle(e,"transform","scale("+this.scale+") translate("+i*100+"%,"+n*100+"%)")),e.left=Math.round(this.bounds.x-Math.ceil(i*(this.overflow!="fill"&&this.overflow!="width"?3:1)))+"px",e.top=Math.round(this.bounds.y-n*(this.overflow!="fill"?3:1))+"px",this.opacity<100?e.opacity=this.opacity/100:e.opacity=""},mxText.prototype.updateInnerHtml=function(t){if(mxUtils.isNode(this.value))t.innerHTML=this.value.outerHTML;else{var e=this.value;this.dialect!=mxConstants.DIALECT_STRICTHTML&&(e=mxUtils.htmlEntities(e,!1)),e=mxUtils.replaceTrailingNewlines(e,"
 
"),e=this.replaceLinefeeds?e.replace(/\n/g,"
"):e,e='
'+e+"
",t.innerHTML=e}},mxText.prototype.updateHtmlFilter=function(){var t=this.node.style,e=this.margin.x,T=this.margin.y,i=this.scale;mxUtils.setOpacity(this.node,this.opacity);var n=0,r=0,s=this.state!=null?this.state.view.textDiv:null,l=this.node;if(s!=null){s.style.overflow="",s.style.height="",s.style.width="",this.updateFont(s),this.updateSize(s,!1),this.updateInnerHtml(s);var a=Math.round(this.bounds.width/this.scale);this.wrap&&a>0?(s.style.whiteSpace="normal",s.style.wordWrap=mxConstants.WORD_WRAP,n=a,this.clipped&&(n=Math.min(n,this.bounds.width)),s.style.width=n+"px"):s.style.whiteSpace="nowrap",l=s,l.firstChild!=null&&l.firstChild.nodeName=="DIV"&&(l=l.firstChild,this.wrap&&s.style.wordWrap=="break-word"&&(l.style.width="100%")),!this.clipped&&this.wrap&&a>0&&(n=l.offsetWidth+this.textWidthPadding,s.style.width=n+"px"),r=l.offsetHeight+2,mxClient.IS_QUIRKS&&this.border!=null&&this.border!=mxConstants.NONE&&(r+=3)}else l.firstChild!=null&&l.firstChild.nodeName=="DIV"&&(l=l.firstChild,r=l.offsetHeight);n=l.offsetWidth+this.textWidthPadding,this.clipped&&(r=Math.min(r,this.bounds.height));var a=this.bounds.width/i,o=this.bounds.height/i;this.overflow=="fill"?(r=o,n=a):this.overflow=="width"&&(r=l.scrollHeight,n=a),this.offsetWidth=n,this.offsetHeight=r,mxClient.IS_QUIRKS&&(this.clipped||this.overflow=="width"&&o>0)?(o=Math.min(o,r),t.height=Math.round(o)+"px"):o=r,this.overflow!="fill"&&this.overflow!="width"&&(this.clipped&&(n=Math.min(a,n)),a=n,(mxClient.IS_QUIRKS&&this.clipped||this.wrap)&&(t.width=Math.round(a)+"px")),o*=i,a*=i;var u=this.getTextRotation()*(Math.PI/180),p=parseFloat(parseFloat(Math.cos(u)).toFixed(8)),m=parseFloat(parseFloat(Math.sin(-u)).toFixed(8));u%=2*Math.PI,u<0&&(u+=2*Math.PI),u%=Math.PI,u>Math.PI/2&&(u=Math.PI-u);var d=Math.cos(u),x=Math.sin(-u),f=a*-(e+.5),g=o*-(T+.5),c=(o-o*d+a*x)/2+m*f-p*g,v=(a-a*d+o*x)/2-p*f-m*g;if(u!=0){var y="progid:DXImageTransform.Microsoft.Matrix(M11="+p+", M12="+m+", M21="+-m+", M22="+p+", sizingMethod='auto expand')";t.filter!=null&&t.filter.length>0?t.filter+=" "+y:t.filter=y}var T=0;this.overflow!="fill"&&mxClient.IS_QUIRKS&&(this.valign==mxConstants.ALIGN_TOP?T-=1:this.valign==mxConstants.ALIGN_BOTTOM?T+=2:T+=1),t.zoom=i,t.left=Math.round(this.bounds.x+v-a/2)+"px",t.top=Math.round(this.bounds.y+c-o/2+T)+"px"},mxText.prototype.updateValue=function(){if(mxUtils.isNode(this.value))this.node.innerHTML="",this.node.appendChild(this.value);else{var t=this.value;this.dialect!=mxConstants.DIALECT_STRICTHTML&&(t=mxUtils.htmlEntities(t,!1)),t=mxUtils.replaceTrailingNewlines(t,"

"),t=this.replaceLinefeeds?t.replace(/\n/g,"
"):t;var e=this.background!=null&&this.background!=mxConstants.NONE?this.background:null,i=this.border!=null&&this.border!=mxConstants.NONE?this.border:null;if(this.overflow=="fill"||this.overflow=="width")e!=null&&(this.node.style.backgroundColor=e),i!=null&&(this.node.style.border="1px solid "+i);else{var n="";e!=null&&(n+="background-color:"+mxUtils.htmlEntities(e)+";"),i!=null&&(n+="border:1px solid "+mxUtils.htmlEntities(i)+";");var r=mxConstants.ABSOLUTE_LINE_HEIGHT?this.size*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT;t='
'+t+"
"}this.node.innerHTML=t;var s=this.node.getElementsByTagName("div");if(s.length>0){var l=this.textDirection;l==mxConstants.TEXT_DIRECTION_AUTO&&this.dialect!=mxConstants.DIALECT_STRICTHTML&&(l=this.getAutoDirection()),l==mxConstants.TEXT_DIRECTION_LTR||l==mxConstants.TEXT_DIRECTION_RTL?s[s.length-1].setAttribute("dir",l):s[s.length-1].removeAttribute("dir")}}},mxText.prototype.updateFont=function(t){var e=t.style;e.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?this.size*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT,e.fontSize=this.size+"px",e.fontFamily=this.family,e.verticalAlign="top",e.color=this.color,(this.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD?e.fontWeight="bold":e.fontWeight="",(this.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC?e.fontStyle="italic":e.fontStyle="";var i=[];(this.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&i.push("underline"),(this.fontStyle&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&i.push("line-through"),e.textDecoration=i.join(" "),this.align==mxConstants.ALIGN_CENTER?e.textAlign="center":this.align==mxConstants.ALIGN_RIGHT?e.textAlign="right":e.textAlign="left"},mxText.prototype.updateSize=function(t,e){var i=Math.max(0,Math.round(this.bounds.width/this.scale)),n=Math.max(0,Math.round(this.bounds.height/this.scale)),r=t.style;if(this.clipped?(r.overflow="hidden",mxClient.IS_QUIRKS?r.width=i+"px":(r.maxHeight=n+"px",r.maxWidth=i+"px")):this.overflow=="fill"?(r.width=i+1+"px",r.height=n+1+"px",r.overflow="hidden"):this.overflow=="width"&&(r.width=i+1+"px",r.maxHeight=n+1+"px",r.overflow="hidden"),this.wrap&&i>0){if(r.wordWrap=mxConstants.WORD_WRAP,r.whiteSpace="normal",r.width=i+"px",e&&this.overflow!="fill"&&this.overflow!="width"){var s=t;s.firstChild!=null&&s.firstChild.nodeName=="DIV"&&(s=s.firstChild,t.style.wordWrap=="break-word"&&(s.style.width="100%"));var l=s.offsetWidth;if(l==0){var a=t.parentNode;t.style.visibility="hidden",document.body.appendChild(t),l=s.offsetWidth,t.style.visibility="",a.appendChild(t)}l+=3,this.clipped&&(l=Math.min(l,i)),r.width=l+"px"}}else r.whiteSpace="nowrap"},mxText.prototype.updateMargin=function(){this.margin=mxUtils.getAlignmentAsPoint(this.align,this.valign)},mxText.prototype.getSpacing=function(){var t=0,e=0;return this.align==mxConstants.ALIGN_CENTER?t=(this.spacingLeft-this.spacingRight)/2:this.align==mxConstants.ALIGN_RIGHT?t=-this.spacingRight-this.baseSpacingRight:t=this.spacingLeft+this.baseSpacingLeft,this.valign==mxConstants.ALIGN_MIDDLE?e=(this.spacingTop-this.spacingBottom)/2:this.valign==mxConstants.ALIGN_BOTTOM?e=-this.spacingBottom-this.baseSpacingBottom:e=this.spacingTop+this.baseSpacingTop,new mxPoint(t,e)},__mxOutput.mxText=typeof mxText<"u"?mxText:void 0;function mxTriangle(){mxActor.call(this)}mxUtils.extend(mxTriangle,mxActor),mxTriangle.prototype.isRoundable=function(){return!0},mxTriangle.prototype.redrawPath=function(t,e,i,n,r){var s=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(t,[new mxPoint(0,0),new mxPoint(n,.5*r),new mxPoint(0,r)],this.isRounded,s,!0)},__mxOutput.mxTriangle=typeof mxTriangle<"u"?mxTriangle:void 0;function mxHexagon(){mxActor.call(this)}mxUtils.extend(mxHexagon,mxActor),mxHexagon.prototype.redrawPath=function(t,e,i,n,r){var s=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(t,[new mxPoint(.25*n,0),new mxPoint(.75*n,0),new mxPoint(n,.5*r),new mxPoint(.75*n,r),new mxPoint(.25*n,r),new mxPoint(0,.5*r)],this.isRounded,s,!0)},__mxOutput.mxHexagon=typeof mxHexagon<"u"?mxHexagon:void 0;function mxLine(t,e,i,n){mxShape.call(this),this.bounds=t,this.stroke=e,this.strokewidth=i??1,this.vertical=n??this.vertical}mxUtils.extend(mxLine,mxShape),mxLine.prototype.vertical=!1,mxLine.prototype.paintVertexShape=function(t,e,i,n,r){if(t.begin(),this.vertical){var s=e+n/2;t.moveTo(s,i),t.lineTo(s,i+r)}else{var s=i+r/2;t.moveTo(e,s),t.lineTo(e+n,s)}t.stroke()},__mxOutput.mxLine=typeof mxLine<"u"?mxLine:void 0;function mxImageShape(t,e,i,n,r){mxShape.call(this),this.bounds=t,this.image=e,this.fill=i,this.stroke=n,this.strokewidth=r??1,this.shadow=!1}mxUtils.extend(mxImageShape,mxRectangleShape),mxImageShape.prototype.preserveImageAspect=!0,mxImageShape.prototype.getSvgScreenOffset=function(){return 0},mxImageShape.prototype.apply=function(t){mxShape.prototype.apply.apply(this,arguments),this.fill=null,this.stroke=null,this.gradient=null,this.style!=null&&(this.preserveImageAspect=mxUtils.getNumber(this.style,mxConstants.STYLE_IMAGE_ASPECT,1)==1,this.flipH=this.flipH||mxUtils.getValue(this.style,"imageFlipH",0)==1,this.flipV=this.flipV||mxUtils.getValue(this.style,"imageFlipV",0)==1)},mxImageShape.prototype.isHtmlAllowed=function(){return!this.preserveImageAspect},mxImageShape.prototype.createHtml=function(){var t=document.createElement("div");return t.style.position="absolute",t},mxImageShape.prototype.isRoundable=function(t,e,i,n,r){return!1},mxImageShape.prototype.paintVertexShape=function(t,e,i,n,r){if(this.image!=null){var s=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BACKGROUND,null),l=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BORDER,null);s!=null&&(t.setFillColor(s),t.setStrokeColor(l),t.rect(e,i,n,r),t.fillAndStroke()),t.image(e,i,n,r,this.image,this.preserveImageAspect,!1,!1);var l=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BORDER,null);l!=null&&(t.setShadow(!1),t.setStrokeColor(l),t.rect(e,i,n,r),t.stroke())}else mxRectangleShape.prototype.paintBackground.apply(this,arguments)},mxImageShape.prototype.redrawHtmlShape=function(){if(this.node.style.left=Math.round(this.bounds.x)+"px",this.node.style.top=Math.round(this.bounds.y)+"px",this.node.style.width=Math.max(0,Math.round(this.bounds.width))+"px",this.node.style.height=Math.max(0,Math.round(this.bounds.height))+"px",this.node.innerHTML="",this.image!=null){var t=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BACKGROUND,""),e=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BORDER,"");this.node.style.backgroundColor=t,this.node.style.borderColor=e;var i=mxClient.IS_IE6||(document.documentMode==null||document.documentMode<=8)&&this.rotation!=0,n=document.createElement(i?mxClient.VML_PREFIX+":image":"img");n.setAttribute("border","0"),n.style.position="absolute",n.src=this.image;var r=this.opacity<100?"alpha(opacity="+this.opacity+")":"";this.node.style.filter=r,this.flipH&&this.flipV?r+="progid:DXImageTransform.Microsoft.BasicImage(rotation=2)":this.flipH?r+="progid:DXImageTransform.Microsoft.BasicImage(mirror=1)":this.flipV&&(r+="progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)"),n.style.filter!=r&&(n.style.filter=r),n.nodeName=="image"?n.style.rotation=this.rotation:this.rotation!=0?mxUtils.setPrefixedStyle(n.style,"transform","rotate("+this.rotation+"deg)"):mxUtils.setPrefixedStyle(n.style,"transform",""),n.style.width=this.node.style.width,n.style.height=this.node.style.height,this.node.style.backgroundImage="",this.node.appendChild(n)}else this.setTransparentBackgroundImage(this.node)},__mxOutput.mxImageShape=typeof mxImageShape<"u"?mxImageShape:void 0;function mxLabel(t,e,i,n){mxRectangleShape.call(this,t,e,i,n)}mxUtils.extend(mxLabel,mxRectangleShape),mxLabel.prototype.imageSize=mxConstants.DEFAULT_IMAGESIZE,mxLabel.prototype.spacing=2,mxLabel.prototype.indicatorSize=10,mxLabel.prototype.indicatorSpacing=2,mxLabel.prototype.init=function(t){mxShape.prototype.init.apply(this,arguments),this.indicatorShape!=null&&(this.indicator=new this.indicatorShape,this.indicator.dialect=this.dialect,this.indicator.init(this.node))},mxLabel.prototype.redraw=function(){this.indicator!=null&&(this.indicator.fill=this.indicatorColor,this.indicator.stroke=this.indicatorStrokeColor,this.indicator.gradient=this.indicatorGradientColor,this.indicator.direction=this.indicatorDirection,this.indicator.redraw()),mxShape.prototype.redraw.apply(this,arguments)},mxLabel.prototype.isHtmlAllowed=function(){return mxRectangleShape.prototype.isHtmlAllowed.apply(this,arguments)&&this.indicatorColor==null&&this.indicatorShape==null},mxLabel.prototype.paintForeground=function(t,e,i,n,r){this.paintImage(t,e,i,n,r),this.paintIndicator(t,e,i,n,r),mxRectangleShape.prototype.paintForeground.apply(this,arguments)},mxLabel.prototype.paintImage=function(t,e,i,n,r){if(this.image!=null){var s=this.getImageBounds(e,i,n,r);t.image(s.x,s.y,s.width,s.height,this.image,!1,!1,!1)}},mxLabel.prototype.getImageBounds=function(t,e,i,n){var r=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_ALIGN,mxConstants.ALIGN_LEFT),s=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE),l=mxUtils.getNumber(this.style,mxConstants.STYLE_IMAGE_WIDTH,mxConstants.DEFAULT_IMAGESIZE),a=mxUtils.getNumber(this.style,mxConstants.STYLE_IMAGE_HEIGHT,mxConstants.DEFAULT_IMAGESIZE),o=mxUtils.getNumber(this.style,mxConstants.STYLE_SPACING,this.spacing)+5;return r==mxConstants.ALIGN_CENTER?t+=(i-l)/2:r==mxConstants.ALIGN_RIGHT?t+=i-l-o:t+=o,s==mxConstants.ALIGN_TOP?e+=o:s==mxConstants.ALIGN_BOTTOM?e+=n-a-o:e+=(n-a)/2,new mxRectangle(t,e,l,a)},mxLabel.prototype.paintIndicator=function(t,e,i,n,r){if(this.indicator!=null)this.indicator.bounds=this.getIndicatorBounds(e,i,n,r),this.indicator.paint(t);else if(this.indicatorImage!=null){var s=this.getIndicatorBounds(e,i,n,r);t.image(s.x,s.y,s.width,s.height,this.indicatorImage,!1,!1,!1)}},mxLabel.prototype.getIndicatorBounds=function(t,e,i,n){var r=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_ALIGN,mxConstants.ALIGN_LEFT),s=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE),l=mxUtils.getNumber(this.style,mxConstants.STYLE_INDICATOR_WIDTH,this.indicatorSize),a=mxUtils.getNumber(this.style,mxConstants.STYLE_INDICATOR_HEIGHT,this.indicatorSize),o=this.spacing+5;return r==mxConstants.ALIGN_RIGHT?t+=i-l-o:r==mxConstants.ALIGN_CENTER?t+=(i-l)/2:t+=o,s==mxConstants.ALIGN_BOTTOM?e+=n-a-o:s==mxConstants.ALIGN_TOP?e+=o:e+=(n-a)/2,new mxRectangle(t,e,l,a)},mxLabel.prototype.redrawHtmlShape=function(){for(mxRectangleShape.prototype.redrawHtmlShape.apply(this,arguments);this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);if(this.image!=null){var t=document.createElement("img");t.style.position="relative",t.setAttribute("border","0");var e=this.getImageBounds(this.bounds.x,this.bounds.y,this.bounds.width,this.bounds.height);e.x-=this.bounds.x,e.y-=this.bounds.y,t.style.left=Math.round(e.x)+"px",t.style.top=Math.round(e.y)+"px",t.style.width=Math.round(e.width)+"px",t.style.height=Math.round(e.height)+"px",t.src=this.image,this.node.appendChild(t)}},__mxOutput.mxLabel=typeof mxLabel<"u"?mxLabel:void 0;function mxCylinder(t,e,i,n){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=i,this.strokewidth=n??1}mxUtils.extend(mxCylinder,mxShape),mxCylinder.prototype.maxHeight=40,mxCylinder.prototype.svgStrokeTolerance=0,mxCylinder.prototype.paintVertexShape=function(t,e,i,n,r){t.translate(e,i),t.begin(),this.redrawPath(t,e,i,n,r,!1),t.fillAndStroke(),(!this.outline||this.style==null||mxUtils.getValue(this.style,mxConstants.STYLE_BACKGROUND_OUTLINE,0)==0)&&(t.setShadow(!1),t.begin(),this.redrawPath(t,e,i,n,r,!0),t.stroke())},mxCylinder.prototype.getCylinderSize=function(t,e,i,n){return Math.min(this.maxHeight,Math.round(n/5))},mxCylinder.prototype.redrawPath=function(t,e,i,n,r,s){var l=this.getCylinderSize(e,i,n,r);(s&&this.fill!=null||!s&&this.fill==null)&&(t.moveTo(0,l),t.curveTo(0,2*l,n,2*l,n,l),s||(t.stroke(),t.begin())),s||(t.moveTo(0,l),t.curveTo(0,-l/3,n,-l/3,n,l),t.lineTo(n,r-l),t.curveTo(n,r+l/3,0,r+l/3,0,r-l),t.close())},__mxOutput.mxCylinder=typeof mxCylinder<"u"?mxCylinder:void 0;function mxConnector(t,e,i){mxPolyline.call(this,t,e,i)}mxUtils.extend(mxConnector,mxPolyline),mxConnector.prototype.updateBoundingBox=function(){this.useSvgBoundingBox=this.style!=null&&this.style[mxConstants.STYLE_CURVED]==1,mxShape.prototype.updateBoundingBox.apply(this,arguments)},mxConnector.prototype.paintEdgeShape=function(t,e){var i=this.createMarker(t,e,!0),n=this.createMarker(t,e,!1);mxPolyline.prototype.paintEdgeShape.apply(this,arguments),t.setFillColor(this.stroke),t.setShadow(!1),t.setDashed(!1),i?.(),n?.()},mxConnector.prototype.createMarker=function(t,e,i){var n=null,r=e.length,s=mxUtils.getValue(this.style,i?mxConstants.STYLE_STARTARROW:mxConstants.STYLE_ENDARROW),l=i?e[1]:e[r-2],a=i?e[0]:e[r-1];if(s!=null&&l!=null&&a!=null){for(var o=1;o0)for(var a=0;at.weightedValue?-1:e.weightedValueu)break;a=x}}}var f=r.getIndex(t);f=Math.max(0,l-(l>f?1:0)),n.add(r,t,f)}},mxStackLayout.prototype.getParentSize=function(t){var e=this.graph.getModel(),i=e.getGeometry(t);if(this.graph.container!=null&&(i==null&&e.isLayer(t)||t==this.graph.getView().currentRoot)){var n=this.graph.container.offsetWidth-1,r=this.graph.container.offsetHeight-1;i=new mxRectangle(0,0,n,r)}return i},mxStackLayout.prototype.getLayoutCells=function(t){for(var e=this.graph.getModel(),i=e.getChildCount(t),n=[],r=0;ru.x>0?1:-1:o.y==u.y?0:o.y>u.y>0?1:-1})),n},mxStackLayout.prototype.snap=function(t){if(this.gridSize!=null&&this.gridSize>0&&(t=Math.max(t,this.gridSize),t/this.gridSize>1)){var e=t%this.gridSize;t+=e>this.gridSize/2?this.gridSize-e:-e}return t},mxStackLayout.prototype.execute=function(t){if(t!=null){var e=this.getParentSize(t),i=this.isHorizontal(),n=this.graph.getModel(),r=null;e!=null&&(r=i?e.height-this.marginTop-this.marginBottom:e.width-this.marginLeft-this.marginRight),r-=2*this.border;var s=this.x0+this.border+this.marginLeft,l=this.y0+this.border+this.marginTop;if(this.graph.isSwimlane(t)){var a=this.graph.getCellStyle(t),o=mxUtils.getNumber(a,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE),u=mxUtils.getValue(a,mxConstants.STYLE_HORIZONTAL,!0)==1;e!=null&&(u?o=Math.min(o,e.height):o=Math.min(o,e.width)),i==u&&(r-=o),u?l+=o:s+=o}n.beginUpdate();try{for(var p=0,m=null,d=0,x=null,f=this.getLayoutCells(t),g=0;gthis.wrap||!i&&m.y+m.height+v.height+2*this.spacing>this.wrap)&&(m=null,i?l+=p+this.spacing:s+=p+this.spacing,p=0),p=Math.max(p,i?v.height:v.width);var y=0;if(!this.borderCollapse){var T=this.graph.getCellStyle(c);y=mxUtils.getNumber(T,mxConstants.STYLE_STROKEWIDTH,1)}if(m!=null){var C=d+this.spacing+Math.floor(y/2);i?v.x=this.snap((this.allowGaps?Math.max(C,v.x):C)-this.marginLeft)+this.marginLeft:v.y=this.snap((this.allowGaps?Math.max(C,v.y):C)-this.marginTop)+this.marginTop}else this.keepFirstLocation||(i?v.x=this.allowGaps&&v.x>s?Math.max(this.snap(v.x-this.marginLeft)+this.marginLeft,s):s:v.y=this.allowGaps&&v.y>l?Math.max(this.snap(v.y-this.marginTop)+this.marginTop,l):l);i?v.y=l:v.x=s,this.fill&&r!=null&&(i?v.height=r:v.width=r),i?v.width=this.snap(v.width):v.height=this.snap(v.height),this.setChildGeometry(c,v),x=c,m=v,i?d=m.x+m.width+Math.floor(y/2):d=m.y+m.height+Math.floor(y/2)}}this.resizeParent&&e!=null&&m!=null&&!this.graph.isCellCollapsed(t)?this.updateParentGeometry(t,e,m):this.resizeLast&&e!=null&&m!=null&&x!=null&&(i?m.width=e.width-m.x-this.spacing-this.marginRight-this.marginLeft:m.height=e.height-m.y-this.spacing-this.marginBottom,this.setChildGeometry(x,m))}finally{n.endUpdate()}}},mxStackLayout.prototype.setChildGeometry=function(t,e){var i=this.graph.getCellGeometry(t);(i==null||e.x!=i.x||e.y!=i.y||e.width!=i.width||e.height!=i.height)&&this.graph.getModel().setGeometry(t,e)},mxStackLayout.prototype.updateParentGeometry=function(t,e,i){var n=this.isHorizontal(),r=this.graph.getModel(),s=e.clone();if(n){var l=i.x+i.width+this.marginRight+this.border;this.resizeParentMax?s.width=Math.max(s.width,l):s.width=l}else{var l=i.y+i.height+this.marginBottom+this.border;this.resizeParentMax?s.height=Math.max(s.height,l):s.height=l}(e.x!=s.x||e.y!=s.y||e.width!=s.width||e.height!=s.height)&&r.setGeometry(t,s)},__mxOutput.mxStackLayout=typeof mxStackLayout<"u"?mxStackLayout:void 0;function mxPartitionLayout(t,e,i,n){mxGraphLayout.call(this,t),this.horizontal=e??!0,this.spacing=i||0,this.border=n||0}mxPartitionLayout.prototype=new mxGraphLayout,mxPartitionLayout.prototype.constructor=mxPartitionLayout,mxPartitionLayout.prototype.horizontal=null,mxPartitionLayout.prototype.spacing=null,mxPartitionLayout.prototype.border=null,mxPartitionLayout.prototype.resizeVertices=!0,mxPartitionLayout.prototype.isHorizontal=function(){return this.horizontal},mxPartitionLayout.prototype.moveCell=function(t,e,i){var n=this.graph.getModel(),r=n.getParent(t);if(t!=null&&r!=null){var s=0,l=0,a=n.getChildCount(r);for(s=0;se)break;l=p}}var m=r.getIndex(t);m=Math.max(0,s-(s>m?1:0)),n.add(r,t,m)}},mxPartitionLayout.prototype.execute=function(t){var e=this.isHorizontal(),i=this.graph.getModel(),n=i.getGeometry(t);if(this.graph.container!=null&&(n==null&&i.isLayer(t)||t==this.graph.getView().currentRoot)){var r=this.graph.container.offsetWidth-1,s=this.graph.container.offsetHeight-1;n=new mxRectangle(0,0,r,s)}if(n!=null){for(var l=[],a=i.getChildCount(t),o=0;o0){var m=this.border,d=this.border,x=e?n.height:n.width;x-=2*this.border;var f=this.graph.isSwimlane(t)?this.graph.getStartSize(t):new mxRectangle;x-=e?f.height:f.width,m=m+f.width,d=d+f.height;var g=this.border+(p-1)*this.spacing,c=e?(n.width-m-g)/p:(n.height-d-g)/p;if(c>0){i.beginUpdate();try{for(var o=0;o0)this.root=t;else{var n=this.graph.findTreeRoots(t,!0,this.invert);if(n.length>0){for(var r=0;r0){this.root=n[r];break}}}else this.root=e;if(this.root!=null){if(this.resizeParent?this.parentsChanged=new Object:this.parentsChanged=null,this.parentX=null,this.parentY=null,t!=this.root&&i.isVertex(t)!=null&&this.maintainParentLocation){var s=this.graph.getCellGeometry(t);s!=null&&(this.parentX=s.x,this.parentY=s.y)}i.beginUpdate();try{if(this.visited=new Object,this.node=this.dfs(this.root,t),this.alignRanks&&(this.maxRankHeight=[],this.findRankHeights(this.node,0),this.setCellHeights(this.node,0)),this.node!=null){this.layout(this.node);var l=this.graph.gridSize,a=l;if(!this.moveTree){var o=this.getVertexBounds(this.root);o!=null&&(l=o.x,a=o.y)}var u=null;if(this.isHorizontal()?u=this.horizontalLayout(this.node,l,a):u=this.verticalLayout(this.node,null,l,a),u!=null){var p=0,m=0;u.x<0&&(p=Math.abs(l-u.x)),u.y<0&&(m=Math.abs(a-u.y)),(p!=0||m!=0)&&this.moveNode(this.node,p,m),this.resizeParent&&this.adjustParents(),this.edgeRouting&&this.localEdgeProcessing(this.node)}if(this.parentX!=null&&this.parentY!=null){var s=this.graph.getCellGeometry(t);s!=null&&(s=s.clone(),s.x=this.parentX,s.y=this.parentY,i.setGeometry(t,s))}}}finally{i.endUpdate()}}},mxCompactTreeLayout.prototype.moveNode=function(t,e,i){t.x+=e,t.y+=i,this.apply(t);for(var n=t.child;n!=null;)this.moveNode(n,e,i),n=n.next},mxCompactTreeLayout.prototype.sortOutgoingEdges=function(t,e){var i=new mxDictionary;e.sort(function(n,r){var s=n.getTerminal(n.getTerminal(!1)==t),l=i.get(s);l==null&&(l=mxCellPath.create(s).split(mxCellPath.PATH_SEPARATOR),i.put(s,l));var a=r.getTerminal(r.getTerminal(!1)==t),o=i.get(a);return o==null&&(o=mxCellPath.create(a).split(mxCellPath.PATH_SEPARATOR),i.put(a,o)),mxCellPath.compare(l,o)})},mxCompactTreeLayout.prototype.findRankHeights=function(t,e){(this.maxRankHeight[e]==null||this.maxRankHeight[e]t.height&&(t.height=this.maxRankHeight[e]);for(var i=t.child;i!=null;)this.setCellHeights(i,e+1),i=i.next},mxCompactTreeLayout.prototype.dfs=function(t,e){var i=mxCellPath.create(t),n=null;if(t!=null&&this.visited[i]==null&&!this.isVertexIgnored(t)){this.visited[i]=t,n=this.createNode(t);var r=this.graph.getModel(),s=null,l=this.graph.getEdges(t,e,this.invert,!this.invert,!1,!0),a=this.graph.getView();this.sortEdges&&this.sortOutgoingEdges(t,l);for(var o=0;o0)if(t<0){var o=t*n;l=o/i-e}else if(t>0){var o=t*s;l=o/r-e}else l=-e;else if(rt+i){var o=(i+t)*s;l=o/r-(e+n)}else l=s-(e+n);return l>0?l:0},mxCompactTreeLayout.prototype.bridge=function(t,e,i,n,r,s){var l=r+n.dx-e,a=0,o=0;n.dx==0?a=n.dy:(o=l*n.dy,a=o/n.dx);var u=this.createLine(l,a,n.next);return t.next=this.createLine(0,s+n.dy-a-i,u),u},mxCompactTreeLayout.prototype.createNode=function(t){var e=new Object;e.cell=t,e.x=0,e.y=0,e.width=0,e.height=0;var i=this.getVertexBounds(t);return i!=null&&(this.isHorizontal()?(e.width=i.height,e.height=i.width):(e.width=i.width,e.height=i.height)),e.offsetX=0,e.offsetY=0,e.contour=new Object,e},mxCompactTreeLayout.prototype.apply=function(t,e){var i=this.graph.getModel(),n=t.cell,r=i.getGeometry(n);if(n!=null&&r!=null){if(this.isVertexMovable(n)&&(r=this.setVertexLocation(n,t.x,t.y),this.resizeParent)){var s=i.getParent(n),l=mxCellPath.create(s);this.parentsChanged[l]==null&&(this.parentsChanged[l]=s)}e==null?e=new mxRectangle(r.x,r.y,r.width,r.height):e=new mxRectangle(Math.min(e.x,r.x),Math.min(e.y,r.y),Math.max(e.x+e.width,r.x+r.width),Math.max(e.y+e.height,r.y+r.height))}return e},mxCompactTreeLayout.prototype.createLine=function(t,e,i){var n=new Object;return n.dx=t,n.dy=e,n.next=i,n},mxCompactTreeLayout.prototype.adjustParents=function(){var t=[];for(var e in this.parentsChanged)t.push(this.parentsChanged[e]);this.arrangeGroups(mxUtils.sortCells(t,!0),this.groupPadding,this.groupPaddingTop,this.groupPaddingRight,this.groupPaddingBottom,this.groupPaddingLeft)},mxCompactTreeLayout.prototype.localEdgeProcessing=function(t){this.processNodeOutgoing(t);for(var e=t.child;e!=null;)this.localEdgeProcessing(e),e=e.next},mxCompactTreeLayout.prototype.processNodeOutgoing=function(t){for(var e=t.child,i=t.cell,n=0,r=[];e!=null;){n++;var s=e.x;this.horizontal&&(s=e.y),r.push(new WeightedCellSorter(e,s)),e=e.next}r.sort(WeightedCellSorter.prototype.compare);var l=t.width,a=(n+1)*this.prefHozEdgeSep;l>a+2*this.prefHozEdgeSep&&(l-=2*this.prefHozEdgeSep);var o=l/n,u=o/2;l>a+2*this.prefHozEdgeSep&&(u+=this.prefHozEdgeSep);var p=this.minEdgeJetty-this.prefVertEdgeOff,m=this.getVertexBounds(i);e=t.child;for(var d=0;dn/2&&(p-=this.prefVertEdgeOff),u+=o}},__mxOutput.mxCompactTreeLayout=typeof mxCompactTreeLayout<"u"?mxCompactTreeLayout:void 0;function mxRadialTreeLayout(t){mxCompactTreeLayout.call(this,t,!1)}mxUtils.extend(mxRadialTreeLayout,mxCompactTreeLayout),mxRadialTreeLayout.prototype.angleOffset=.5,mxRadialTreeLayout.prototype.rootx=0,mxRadialTreeLayout.prototype.rooty=0,mxRadialTreeLayout.prototype.levelDistance=120,mxRadialTreeLayout.prototype.nodeDistance=10,mxRadialTreeLayout.prototype.autoRadius=!1,mxRadialTreeLayout.prototype.sortEdges=!1,mxRadialTreeLayout.prototype.rowMinX=[],mxRadialTreeLayout.prototype.rowMaxX=[],mxRadialTreeLayout.prototype.rowMinCenX=[],mxRadialTreeLayout.prototype.rowMaxCenX=[],mxRadialTreeLayout.prototype.rowRadi=[],mxRadialTreeLayout.prototype.row=[],mxRadialTreeLayout.prototype.isVertexIgnored=function(t){return mxGraphLayout.prototype.isVertexIgnored.apply(this,arguments)||this.graph.getConnections(t).length==0},mxRadialTreeLayout.prototype.execute=function(t,e){this.parent=t,this.useBoundingBox=!1,this.edgeRouting=!1,mxCompactTreeLayout.prototype.execute.apply(this,arguments);var i=null,n=this.getVertexBounds(this.root);this.centerX=n.x+n.width/2,this.centerY=n.y+n.height/2;for(var r in this.visited){var s=this.getVertexBounds(this.visited[r]);i=i??s.clone(),i.add(s)}this.calcRowDims([this.node],0);for(var l=0,a=0,o=0;o=0;o--)for(var g=this.row[o],f=0;f0){var E=S/C;if(E>c.theta&&f0){var A=g[f-1].theta;c.theta=Math.max(E,A+Math.PI/10)}}}for(var o=0;othis.maxDistanceLimit)continue;l1&&this.layout(r)}}finally{this.graph.model.endUpdate()}},mxParallelEdgeLayout.prototype.findParallels=function(t,e){var i=[],n=mxUtils.bind(this,function(a){if(!this.isEdgeIgnored(a)){var o=this.getEdgeId(a);o!=null&&(i[o]==null&&(i[o]=[]),i[o].push(a))}});if(e!=null)for(var r=0;rn?n+"-"+i:i+"-"+n)+r}return null},mxParallelEdgeLayout.prototype.layout=function(t){var e=t[0],i=this.graph.getView(),n=this.graph.getModel(),r=n.getGeometry(i.getVisibleTerminal(e,!0)),s=n.getGeometry(i.getVisibleTerminal(e,!1));if(r==s)for(var l=r.x+r.width+this.spacing,a=r.y+r.height/2,o=0;o0){var l=u+x/2,a=p+f/2,c=f*this.spacing/g,v=x*this.spacing/g;l+=c*(t.length-1)/2,a-=v*(t.length-1)/2;for(var o=0;o0?this.edges[0]:null},__mxOutput.mxGraphHierarchyEdge=typeof mxGraphHierarchyEdge<"u"?mxGraphHierarchyEdge:void 0;function mxGraphHierarchyModel(t,e,i,n,r){t.getGraph(),this.tightenToSource=r,this.roots=i,this.parent=n,this.vertexMapper=new mxDictionary,this.edgeMapper=new mxDictionary,this.maxRank=0;var s=[];e==null&&(e=this.graph.getChildVertices(n)),this.maxRank=this.SOURCESCANSTARTRANK,this.createInternalCells(t,e,s);for(var l=0;l0){var m=p[0],d=t.getVisibleTerminal(m,!1),x=this.vertexMapper.get(d);s[l]==x&&(d=t.getVisibleTerminal(m,!0),x=this.vertexMapper.get(d)),x!=null&&s[l]!=x&&(u.target=x,x.connectsAsTarget.length==0&&(x.connectsAsTarget=[]),mxUtils.indexOf(x.connectsAsTarget,u)<0&&x.connectsAsTarget.push(u))}}s[l].temp[0]=1}}mxGraphHierarchyModel.prototype.maxRank=null,mxGraphHierarchyModel.prototype.vertexMapper=null,mxGraphHierarchyModel.prototype.edgeMapper=null,mxGraphHierarchyModel.prototype.ranks=null,mxGraphHierarchyModel.prototype.roots=null,mxGraphHierarchyModel.prototype.parent=null,mxGraphHierarchyModel.prototype.dfsCount=0,mxGraphHierarchyModel.prototype.SOURCESCANSTARTRANK=1e8,mxGraphHierarchyModel.prototype.tightenToSource=!1,mxGraphHierarchyModel.prototype.createInternalCells=function(t,e,i){for(var n=t.getGraph(),r=0;r0&&this.edgeMapper.get(o[0])==null&&u.length*2>=o.length){for(var p=new mxGraphHierarchyEdge(o),m=0;m0;){var i=t[0],s,l;s=i.connectsAsTarget,l=i.connectsAsSource;for(var a=!0,o=this.SOURCESCANSTARTRANK,e=0;e1){o.maxRank=l.maxRank,o.minRank=a.maxRank,o.temp=[],o.x=[],o.y=[];for(var d=o.minRank+1;d0){var m=p[0],d=t.getVisibleTerminal(m,!1),x=this.vertexMapper.get(d);s[l]==x&&(d=t.getVisibleTerminal(m,!0),x=this.vertexMapper.get(d)),x!=null&&s[l]!=x&&(u.target=x,x.connectsAsTarget.length==0&&(x.connectsAsTarget=[]),mxUtils.indexOf(x.connectsAsTarget,u)<0&&x.connectsAsTarget.push(u))}}s[l].temp[0]=1}}mxSwimlaneModel.prototype.maxRank=null,mxSwimlaneModel.prototype.vertexMapper=null,mxSwimlaneModel.prototype.edgeMapper=null,mxSwimlaneModel.prototype.ranks=null,mxSwimlaneModel.prototype.roots=null,mxSwimlaneModel.prototype.parent=null,mxSwimlaneModel.prototype.dfsCount=0,mxSwimlaneModel.prototype.SOURCESCANSTARTRANK=1e8,mxSwimlaneModel.prototype.tightenToSource=!1,mxSwimlaneModel.prototype.ranksPerGroup=null,mxSwimlaneModel.prototype.createInternalCells=function(t,e,i){for(var n=t.getGraph(),r=t.swimlanes,s=0;s0&&this.edgeMapper.get(p[0])==null&&m.length*2>=p.length){for(var d=new mxGraphHierarchyEdge(p),x=0;x=0;i--)i==this.ranksPerGroup.length-1?r[i]=0:r[i]=s[i+1]+1,s[i]=r[i]+this.ranksPerGroup[i];this.maxRank=s[0];for(var l=this.vertexMapper.getValues(),i=0;i0;){var n=t[0],a,o;a=n.connectsAsTarget,o=n.connectsAsSource;for(var u=!0,p=s[0],i=0;is[n.swimlaneIndex]&&(p=s[n.swimlaneIndex]),n.temp[0]=p,o!=null)for(var i=0;i1){o.maxRank=l.maxRank,o.minRank=a.maxRank,o.temp=[],o.x=[],o.y=[];for(var d=o.minRank+1;d0;)T%2&&(i+=v[T+1]),T=T-1>>1,++v[T]}return i},mxMedianHybridCrossingReduction.prototype.transpose=function(t,e){for(var i=!0,n=0,r=10;i&&n++y[M]&&L++,c[E]T[M]&&L++,v[E]=0;n--)this.medianRank(n,i);else for(var n=1;nt.medianValue?-1:e.medianValue0&&u<=o;){var m=e.shift(),d=m.cell,x=m.weightedValue,f=parseInt(m.rankIndex),g=d.getNextLayerConnectedCells(x),c=d.getPreviousLayerConnectedCells(x),v=g.length,y=c.length,T=this.medianXValue(g,x+1),C=this.medianXValue(c,x-1),S=v+y,E=d.getGeneralPurposeVariable(x),L=E;S>0&&(L=(T*v+C*y)/S);var A=!1;if(LE+p){var P=n[x].length;if(f==P-1)d.setGeneralPurposeVariable(x,L),A=!0;else{var R=n[x][f+1],O=R.getGeneralPurposeVariable(x);O=O-R.width/2-this.intraCellSpacing-d.width/2,O>L?(d.setGeneralPurposeVariable(x,L),A=!0):O>d.getGeneralPurposeVariable(x)+p&&(d.setGeneralPurposeVariable(x,O),A=!0)}}if(A){for(var r=0;r0;n--)this.rankMedianPosition(n-1,e,n);else for(var n=0;n0?m=this.medianXValue(o,i):m=p.getGeneralPurposeVariable(t));for(var d=0,x=-1e8,f=r[l].rankIndex-1;f>=0;){var g=s[n[f].id];if(g!=null){var c=g.cell;g.visited?(x=c.getGeneralPurposeVariable(t)+c.width/2+this.intraCellSpacing+d+p.width/2,f=-1):(d+=c.width+this.intraCellSpacing,f--)}}for(var v=0,y=1e8,f=r[l].rankIndex+1;f=x&&m<=y?p.setGeneralPurposeVariable(t,m):my&&(p.setGeneralPurposeVariable(t,y),this.currentXDelta+=m-y),r[l].visited=!0}},mxCoordinateAssignment.prototype.calculatedWeightedValue=function(t,e){for(var i=0,n=0;n=0;i--)i0&&this.rankCoordinates(i,t,e)},mxCoordinateAssignment.prototype.rankCoordinates=function(t,e,i){for(var n=i.ranks[t],r=0,s=this.initialX+(this.widestRankValue-this.rankWidths[t])/2,l=!1,a=0;a=0;r--){for(var s=0,l=e.ranks[r],a=this.initialX,o=!1,u=0;uthis.widestRankValue&&(this.widestRankValue=a,this.widestRank=r),this.rankWidths[r]=a}o==!0&&mxLog.warn("At least one cell has no bounds"),this.rankY[r]=i;var x=s/2+n/2+this.interRankCellSpacing;n=s,this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_WEST?i+=x:i-=x;for(var u=0;ur.minRank+1;o--){var g=r.getX(o-1);f==g||this.repositionValid(e,r,o-1,f)?(x[o-r.minRank-2]=f,m++):(x[o-r.minRank-2]=r.getX(o-1),f=g)}if(m>a||p>a){if(m>=p)for(var o=r.maxRank-2;o>r.minRank;o--)r.setX(o,x[o-r.minRank-1]);else if(p>m)for(var o=r.minRank+2;oa){if(s==r.length-1)return!0;var p=r[s+1],m=p.getGeneralPurposeVariable(i);return m=m-p.width/2-this.intraCellSpacing-e.width/2,m>=n}return!0},mxCoordinateAssignment.prototype.setCellLocations=function(t,e){this.rankTopY=[],this.rankBottomY=[];for(var i=0;i-1&&l0){for(var o=[],u=0;uy+2*this.prefHozEdgeSep&&(m+=this.prefHozEdgeSep,d-=this.prefHozEdgeSep);for(var T=d-m,C=T/x,S=m+C/2,E=this.minEdgeJetty-this.prefVertEdgeOff,u=0;ux/2&&(E-=this.prefVertEdgeOff);for(var M=0;M0?e=-e:e=-e+this.parallelEdgeSpacing,r++}t.temp[0]=101207}},mxCoordinateAssignment.prototype.setVertexLocation=function(t){var e=t.cell,i=t.x[0]-t.width/2,n=t.y[0]-t.height/2;this.rankTopY[t.minRank]=Math.min(this.rankTopY[t.minRank],n),this.rankBottomY[t.minRank]=Math.max(this.rankBottomY[t.minRank],n+t.height),this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?this.layout.setVertexLocation(e,i,n):this.layout.setVertexLocation(e,n,i),this.limitX=Math.max(this.limitX,i+t.width)},mxCoordinateAssignment.prototype.processReversedEdge=function(t,e){},__mxOutput.mxCoordinateAssignment=typeof mxCoordinateAssignment<"u"?mxCoordinateAssignment:void 0;function mxSwimlaneOrdering(t){this.layout=t}mxSwimlaneOrdering.prototype=new mxHierarchicalLayoutStage,mxSwimlaneOrdering.prototype.constructor=mxSwimlaneOrdering,mxSwimlaneOrdering.prototype.layout=null,mxSwimlaneOrdering.prototype.execute=function(t){var e=this.layout.getModel(),i=new Object,n=mxUtils.clone(e.vertexMapper,null,!0),r=null;if(e.roots!=null){var s=e.roots;r=[];for(var l=0;l0&&i.push(a);var x=u-p;x>s&&(s=x,r=a)}}i.length==0&&r!=null&&i.push(r)}return i},mxHierarchicalLayout.prototype.getEdges=function(t){var e=this.edgesCache.get(t);if(e!=null)return e;for(var i=this.graph.model,n=[],r=this.graph.isCellCollapsed(t),s=i.getChildCount(t),l=0;l=0&&(r=this.traverse(m,e,o[p],n,r,s,l))}}else if(r[a]==null)for(var p=0;p0&&i.push(a);var f=u-p;f>s&&(s=f,r=a)}}i.length==0&&r!=null&&i.push(r)}return i},mxSwimlaneLayout.prototype.getEdges=function(t){var e=this.edgesCache.get(t);if(e!=null)return e;for(var i=this.graph.model,n=[],r=this.graph.isCellCollapsed(t),s=i.getChildCount(t),l=0;l0&&t!=null){for(var n=Object(),r=0;r=this.swimlanes.length||(f>a||(!e||x)&&f==a)&&(r=this.traverse(d,e,u[m],n,r,s,l,f))}}else if(r[o]==null)for(var m=0;m0){var n=t,r=mxCellPath.create(n);if(i.length=0;i--)this.cellRemoved(this.getChildAt(t,i));this.cells!=null&&t.getId()!=null&&delete this.cells[t.getId()]}},mxGraphModel.prototype.parentForCellChanged=function(t,e,i){var n=this.getParent(t);if(e!=null)(e!=n||n.getIndex(t)!=i)&&e.insert(t,i);else if(n!=null){var r=n.getIndex(t);n.remove(r)}var s=this.contains(e),l=this.contains(n);return s&&!l?this.cellAdded(t):l&&!s&&this.cellRemoved(t),n},mxGraphModel.prototype.getChildCount=function(t){return t!=null?t.getChildCount():0},mxGraphModel.prototype.getChildAt=function(t,e){return t!=null?t.getChildAt(e):null},mxGraphModel.prototype.getChildren=function(t){return t!=null?t.children:null},mxGraphModel.prototype.getChildVertices=function(t){return this.getChildCells(t,!0,!1)},mxGraphModel.prototype.getChildEdges=function(t){return this.getChildCells(t,!1,!0)},mxGraphModel.prototype.getChildCells=function(t,e,i){e=e??!1,i=i??!1;for(var n=this.getChildCount(t),r=[],s=0;s=0&&(e=this.getChildAt(t),e!=null&&(this.children.splice(t,1),e.setParent(null))),e},mxCell.prototype.removeFromParent=function(){if(this.parent!=null){var t=this.parent.getIndex(this);this.parent.remove(t)}},mxCell.prototype.getEdgeCount=function(){return this.edges==null?0:this.edges.length},mxCell.prototype.getEdgeIndex=function(t){return mxUtils.indexOf(this.edges,t)},mxCell.prototype.getEdgeAt=function(t){return this.edges==null?null:this.edges[t]},mxCell.prototype.insertEdge=function(t,e){return t!=null&&(t.removeFromTerminal(e),t.setTerminal(this,e),(this.edges==null||t.getTerminal(!e)!=this||mxUtils.indexOf(this.edges,t)<0)&&(this.edges==null&&(this.edges=[]),this.edges.push(t))),t},mxCell.prototype.removeEdge=function(t,e){if(t!=null){if(t.getTerminal(!e)!=this&&this.edges!=null){var i=this.getEdgeIndex(t);i>=0&&this.edges.splice(i,1)}t.setTerminal(null,e)}return t},mxCell.prototype.removeFromTerminal=function(t){var e=this.getTerminal(t);e?.removeEdge(this,t)},mxCell.prototype.hasAttribute=function(t){var e=this.getValue();return e!=null&&e.nodeType==mxConstants.NODETYPE_ELEMENT&&e.hasAttribute?e.hasAttribute(t):e.getAttribute(t)!=null},mxCell.prototype.getAttribute=function(t,e){var i=this.getValue(),n=i!=null&&i.nodeType==mxConstants.NODETYPE_ELEMENT?i.getAttribute(t):null;return n??e},mxCell.prototype.setAttribute=function(t,e){var i=this.getValue();i!=null&&i.nodeType==mxConstants.NODETYPE_ELEMENT&&i.setAttribute(t,e)},mxCell.prototype.clone=function(){var t=mxUtils.clone(this,this.mxTransient);return t.setValue(this.cloneValue()),t},mxCell.prototype.cloneValue=function(){var t=this.getValue();return t!=null&&(typeof t.clone=="function"?t=t.clone():isNaN(t.nodeType)||(t=t.cloneNode(!0))),t},__mxOutput.mxCell=typeof mxCell<"u"?mxCell:void 0;function mxGeometry(t,e,i,n){mxRectangle.call(this,t,e,i,n)}mxGeometry.prototype=new mxRectangle,mxGeometry.prototype.constructor=mxGeometry,mxGeometry.prototype.TRANSLATE_CONTROL_POINTS=!0,mxGeometry.prototype.alternateBounds=null,mxGeometry.prototype.sourcePoint=null,mxGeometry.prototype.targetPoint=null,mxGeometry.prototype.points=null,mxGeometry.prototype.offset=null,mxGeometry.prototype.relative=!1,mxGeometry.prototype.swap=function(){if(this.alternateBounds!=null){var t=new mxRectangle(this.x,this.y,this.width,this.height);this.x=this.alternateBounds.x,this.y=this.alternateBounds.y,this.width=this.alternateBounds.width,this.height=this.alternateBounds.height,this.alternateBounds=t}},mxGeometry.prototype.getTerminalPoint=function(t){return t?this.sourcePoint:this.targetPoint},mxGeometry.prototype.setTerminalPoint=function(t,e){return e?this.sourcePoint=t:this.targetPoint=t,t},mxGeometry.prototype.rotate=function(t,e){var i=mxUtils.toRadians(t),n=Math.cos(i),r=Math.sin(i);if(!this.relative){var s=new mxPoint(this.getCenterX(),this.getCenterY()),l=mxUtils.getRotatedPoint(s,n,r,e);this.x=Math.round(l.x-this.width/2),this.y=Math.round(l.y-this.height/2)}if(this.sourcePoint!=null){var l=mxUtils.getRotatedPoint(this.sourcePoint,n,r,e);this.sourcePoint.x=Math.round(l.x),this.sourcePoint.y=Math.round(l.y)}if(this.targetPoint!=null){var l=mxUtils.getRotatedPoint(this.targetPoint,n,r,e);this.targetPoint.x=Math.round(l.x),this.targetPoint.y=Math.round(l.y)}if(this.points!=null){for(var a=0;a1&&(e=e.substring(0,r-1)),e},getParentPath:function(t){if(t!=null){var e=t.lastIndexOf(mxCellPath.PATH_SEPARATOR);if(e>=0)return t.substring(0,e);if(t.length>0)return""}return null},resolve:function(t,e){var i=t;if(e!=null)for(var n=e.split(mxCellPath.PATH_SEPARATOR),r=0;re[r]?1:-1;else{var s=parseInt(t[r]),l=parseInt(e[r]);n=s==l?0:s>l?1:-1}break}if(n==0){var s=t.length,l=e.length;s!=l&&(n=s>l?1:-1)}return n}};__mxOutput.mxCellPath=typeof mxCellPath<"u"?mxCellPath:void 0;var mxPerimeter={RectanglePerimeter:function(t,e,i,n){var r=t.getCenterX(),s=t.getCenterY(),l=i.x-r,a=i.y-s,o=Math.atan2(a,l),u=new mxPoint(0,0),p=Math.PI,m=Math.PI/2,d=m-o,x=Math.atan2(t.height,t.width);return o<-p+x||o>p-x?(u.x=t.x,u.y=s-t.width*Math.tan(o)/2):o<-x?(u.y=t.y,u.x=r-t.height*Math.tan(d)/2):o=t.x&&i.x<=t.x+t.width?u.x=i.x:i.y>=t.y&&i.y<=t.y+t.height&&(u.y=i.y),i.xt.x+t.width&&(u.x=t.x+t.width),i.yt.y+t.height&&(u.y=t.y+t.height)),u},EllipsePerimeter:function(t,e,i,n){var r=t.x,s=t.y,l=t.width/2,a=t.height/2,o=r+l,u=s+a,p=i.x,m=i.y,d=parseInt(p-o),x=parseInt(m-u);if(d==0&&x!=0)return new mxPoint(o,u+a*x/Math.abs(x));if(d==0&&x==0)return new mxPoint(p,m);if(n){if(m>=s&&m<=s+t.height){var f=m-u,g=Math.sqrt(l*l*(1-f*f/(a*a)))||0;return p<=r&&(g=-g),new mxPoint(o+g,m)}if(p>=r&&p<=r+t.width){var g=p-o,f=Math.sqrt(a*a*(1-g*g/(l*l)))||0;return m<=s&&(f=-f),new mxPoint(p,u+f)}}var c=x/d,v=u-c*o,y=l*l*c*c+a*a,T=-2*o*y,C=l*l*c*c*o*o+a*a*o*o-l*l*a*a,S=Math.sqrt(T*T-4*y*C),E=(-T+S)/(2*y),L=(-T-S)/(2*y),A=c*E+v,M=c*L+v,I=Math.sqrt(Math.pow(E-p,2)+Math.pow(A-m,2)),P=Math.sqrt(Math.pow(L-p,2)+Math.pow(M-m,2)),R=0,O=0;return Im?new mxPoint(o,s):new mxPoint(o,s+a);if(u==m)return o>p?new mxPoint(r,u):new mxPoint(r+l,u);var d=o,x=u;return n&&(p>=r&&p<=r+l?d=p:m>=s&&m<=s+a&&(x=m)),p-y&&vMath.PI-y;var C=null;if(T)n&&(s&&i.x>=d.x&&i.x<=f.x||!s&&i.y>=d.y&&i.y<=f.y)?s?C=new mxPoint(i.x,d.y):C=new mxPoint(d.x,i.y):r==mxConstants.DIRECTION_NORTH?C=new mxPoint(l+o/2+u*Math.tan(v)/2,a+u):r==mxConstants.DIRECTION_SOUTH?C=new mxPoint(l+o/2-u*Math.tan(v)/2,a):r==mxConstants.DIRECTION_WEST?C=new mxPoint(l+o,a+u/2+o*Math.tan(v)/2):C=new mxPoint(l,a+u/2-o*Math.tan(v)/2);else{if(n){var S=new mxPoint(p,m);i.y>=a&&i.y<=a+u?(S.x=s?p:r==mxConstants.DIRECTION_WEST?l+o:l,S.y=i.y):i.x>=l&&i.x<=l+o&&(S.x=i.x,S.y=s?r==mxConstants.DIRECTION_NORTH?a+u:a:m),g=i.x-S.x,c=i.y-S.y,p=S.x,m=S.y}s&&i.x<=l+o/2||!s&&i.y<=a+u/2?C=mxUtils.intersection(i.x,i.y,p,m,d.x,d.y,x.x,x.y):C=mxUtils.intersection(i.x,i.y,p,m,x.x,x.y,f.x,f.y)}return C==null&&(C=new mxPoint(p,m)),C},HexagonPerimeter:function(t,e,i,n){var r=t.x,s=t.y,l=t.width,a=t.height,o=t.getCenterX(),u=t.getCenterY(),p=i.x,m=i.y,d=p-o,x=m-u,f=-Math.atan2(x,d),g=Math.PI,c=Math.PI/2,v=new mxPoint(o,u),y=e!=null?mxUtils.getValue(e.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST,T=y==mxConstants.DIRECTION_NORTH||y==mxConstants.DIRECTION_SOUTH,C=new mxPoint,S=new mxPoint;if((ps+a||p>r+l&&mr+l&&m>s+a)&&(n=!1),n){if(T){if(p==o){if(m<=s)return new mxPoint(o,s);if(m>=s+a)return new mxPoint(o,s+a)}else if(pr+l){if(m==s+a/4)return new mxPoint(r+l,s+a/4);if(m==s+3*a/4)return new mxPoint(r+l,s+3*a/4)}else if(p==r){if(mu)return new mxPoint(r,s+3*a/4)}else if(p==r+l){if(mu)return new mxPoint(r+l,s+3*a/4)}if(m==s)return new mxPoint(o,s);if(m==s+a)return new mxPoint(o,s+a);ps+a/4&&ms+3*a/4&&(C=new mxPoint(r-Math.floor(.5*l),s+Math.floor(.5*a)),S=new mxPoint(r+l,s+Math.floor(1.25*a))):p>o&&(m>s+a/4&&ms+3*a/4&&(C=new mxPoint(r+Math.floor(1.5*l),s+Math.floor(.5*a)),S=new mxPoint(r,s+Math.floor(1.25*a))))}else{if(m==u){if(p<=r)return new mxPoint(r,s+a/2);if(p>=r+l)return new mxPoint(r+l,s+a/2)}else if(ms+a){if(p==r+l/4)return new mxPoint(r+l/4,s+a);if(p==r+3*l/4)return new mxPoint(r+3*l/4,s+a)}else if(m==s){if(po)return new mxPoint(r+3*l/4,s)}else if(m==s+a){if(pu)return new mxPoint(r+3*l/4,s+a)}if(p==r)return new mxPoint(r,u);if(p==r+l)return new mxPoint(r+l,u);mr+l/4&&pr+3*l/4&&(C=new mxPoint(r+Math.floor(.5*l),s-Math.floor(.5*a)),S=new mxPoint(r+Math.floor(1.25*l),s+a)):m>u&&(p>r+l/4&&pr+3*l/4&&(C=new mxPoint(r+Math.floor(.5*l),s+Math.floor(1.5*a)),S=new mxPoint(r+Math.floor(1.25*l),s)))}var E=o,L=u;p>=r&&p<=r+l?(E=p,m=s&&m<=s+a&&(L=m,p-A?(C=new mxPoint(r+l,s),S=new mxPoint(r+l,s+a)):f>A&&fc&&fg-A&&f<=g||f<-g+A&&f>=-g?(C=new mxPoint(r,s),S=new mxPoint(r,s+a)):f<-A&&f>-c?(C=new mxPoint(r+Math.floor(1.5*l),s+Math.floor(.5*a)),S=new mxPoint(r,s+Math.floor(1.25*a))):f<-c&&f>-g+A&&(C=new mxPoint(r-Math.floor(.5*l),s+Math.floor(.5*a)),S=new mxPoint(r+l,s+Math.floor(1.25*a)))}else{var A=Math.atan2(a/2,l/4);if(f==A)return new mxPoint(r+Math.floor(.75*l),s);if(f==g-A)return new mxPoint(r+Math.floor(.25*l),s);if(f==g||f==-g)return new mxPoint(r,s+Math.floor(.5*a));if(f==0)return new mxPoint(r+l,s+Math.floor(.5*a));if(f==-A)return new mxPoint(r+Math.floor(.75*l),s+a);if(f==-g+A)return new mxPoint(r+Math.floor(.25*l),s+a);f>0&&fA&&fg-A&&f-A?(C=new mxPoint(r+Math.floor(.5*l),s+Math.floor(1.5*a)),S=new mxPoint(r+Math.floor(1.25*l),s)):f<-A&&f>-g+A?(C=new mxPoint(r,s+a),S=new mxPoint(r+l,s+a)):f<-g+A&&f>-g&&(C=new mxPoint(r-Math.floor(.25*l),s),S=new mxPoint(r+Math.floor(.5*l),s+Math.floor(1.5*a)))}v=mxUtils.intersection(o,u,i.x,i.y,C.x,C.y,S.x,S.y)}return v??new mxPoint(o,u)}};__mxOutput.mxPerimeter=typeof mxPerimeter<"u"?mxPerimeter:void 0;function mxPrintPreview(t,e,i,n,r,s,l,a,o){this.graph=t,this.scale=e??1/t.pageScale,this.border=n??0,this.pageFormat=mxRectangle.fromRectangle(i??t.pageFormat),this.title=a??"Printer-friendly version",this.x0=r??0,this.y0=s??0,this.borderColor=l,this.pageSelector=o??!0}mxPrintPreview.prototype.graph=null,mxPrintPreview.prototype.pageFormat=null,mxPrintPreview.prototype.scale=null,mxPrintPreview.prototype.border=0,mxPrintPreview.prototype.marginTop=0,mxPrintPreview.prototype.marginBottom=0,mxPrintPreview.prototype.x0=0,mxPrintPreview.prototype.y0=0,mxPrintPreview.prototype.autoOrigin=!0,mxPrintPreview.prototype.printOverlays=!1,mxPrintPreview.prototype.printControls=!1,mxPrintPreview.prototype.printBackgroundImage=!1,mxPrintPreview.prototype.backgroundColor="#ffffff",mxPrintPreview.prototype.borderColor=null,mxPrintPreview.prototype.title=null,mxPrintPreview.prototype.pageSelector=null,mxPrintPreview.prototype.wnd=null,mxPrintPreview.prototype.targetWindow=null,mxPrintPreview.prototype.pageCount=0,mxPrintPreview.prototype.clipping=!0,mxPrintPreview.prototype.getWindow=function(){return this.wnd},mxPrintPreview.prototype.getDoctype=function(){var t="";return document.documentMode==5?t='':document.documentMode==8?t='':document.documentMode>8&&(t=''),t},mxPrintPreview.prototype.appendGraph=function(t,e,i,n,r,s){this.graph=t,this.scale=e??1/t.pageScale,this.x0=i,this.y0=n,this.open(null,null,r,s)},mxPrintPreview.prototype.open=function(t,e,i,n){var r=this.graph.cellRenderer.initializeOverlay,s=null;try{this.printOverlays&&(this.graph.cellRenderer.initializeOverlay=function(P,R){R.init(P.view.getDrawPane())}),this.printControls&&(this.graph.cellRenderer.initControl=function(P,R,O,_){R.dialect=P.view.graph.dialect,R.init(P.view.getDrawPane())}),this.wnd=e??this.wnd;var l=!1;this.wnd==null&&(l=!0,this.wnd=window.open());var a=this.wnd.document;if(l){var o=this.getDoctype();o!=null&&o.length>0&&a.writeln(o),mxClient.IS_VML?a.writeln(''):(document.compatMode==="CSS1Compat"&&a.writeln(""),a.writeln("")),a.writeln(""),this.writeHead(a,t),a.writeln(""),a.writeln('')}var u=this.graph.getGraphBounds().clone(),p=this.graph.getView().getScale(),m=p/this.scale,d=this.graph.getView().getTranslate();this.autoOrigin||(this.x0-=d.x*this.scale,this.y0-=d.y*this.scale,u.width+=u.x,u.height+=u.y,u.x=0,u.y=0,this.border=0);var x=this.pageFormat.width-this.border*2,f=this.pageFormat.height-this.border*2;this.pageFormat.height+=this.marginTop+this.marginBottom,u.width/=m,u.height/=m;var g=Math.max(1,Math.ceil((u.width+this.x0)/x)),c=Math.max(1,Math.ceil((u.height+this.y0)/f));this.pageCount=g*c;var v=mxUtils.bind(this,function(){if(this.pageSelector&&(c>1||g>1)){var P=this.createPageSelector(c,g);if(a.body.appendChild(P),mxClient.IS_IE&&a.documentMode==null||a.documentMode==5||a.documentMode==8||a.documentMode==7){P.style.position="absolute";var R=function(){P.style.top=(a.body.scrollTop||a.documentElement.scrollTop)+10+"px"};mxEvent.addListener(this.wnd,"scroll",function(O){R()}),mxEvent.addListener(this.wnd,"resize",function(O){R()})}}}),y=mxUtils.bind(this,function(P,R){if(this.borderColor!=null&&(P.style.borderColor=this.borderColor,P.style.borderStyle="solid",P.style.borderWidth="1px"),P.style.background=this.backgroundColor,(i||R)&&(P.style.pageBreakAfter="always"),l&&(mxClient.IS_IE||document.documentMode>=11||mxClient.IS_EDGE))a.writeln(P.outerHTML),P.parentNode.removeChild(P);else if(mxClient.IS_IE||document.documentMode>=11||mxClient.IS_EDGE){var O=a.createElement("div");O.innerHTML=P.outerHTML,O=O.getElementsByTagName("div")[0],a.body.appendChild(O),P.parentNode.removeChild(P)}else P.parentNode.removeChild(P),a.body.appendChild(P);(i||R)&&this.addPageBreak(a)}),T=this.getCoverPages(this.pageFormat.width,this.pageFormat.height);if(T!=null)for(var C=0;C"),t.writeln(""),t.close(),mxEvent.release(t.body)}}catch{}},mxPrintPreview.prototype.writeHead=function(t,e){this.title!=null&&t.writeln(""+this.title+""),mxClient.IS_VML&&t.writeln(''),mxClient.link("stylesheet",mxClient.basePath+"/css/common.css",t),t.writeln('")},mxPrintPreview.prototype.writePostfix=function(t){},mxPrintPreview.prototype.createPageSelector=function(t,e){var i=this.wnd.document,n=i.createElement("table");n.className="mxPageSelector",n.setAttribute("border","0");for(var r=i.createElement("tbody"),s=0;s0&&b.height>0&&!mxUtils.intersects(C,b))return}}v.apply(this,arguments)}}var S=null;try{var E=[this.getRoot()];S=new mxTemporaryCellStates(l,i,E,null,mxUtils.bind(this,function(P){return this.getLinkForCellState(P)}))}finally{if(mxClient.IS_IE)l.overlayPane.innerHTML="",l.canvas.style.overflow="hidden",l.canvas.style.position="relative",l.canvas.style.top=this.marginTop+"px",l.canvas.style.width=s.width+"px",l.canvas.style.height=s.height+"px";else for(var L=r.firstChild;L!=null;){var A=L.nextSibling,M=L.nodeName.toLowerCase();M=="svg"?(L.style.overflow="hidden",L.style.position="relative",L.style.top=this.marginTop+"px",L.setAttribute("width",s.width),L.setAttribute("height",s.height),L.style.width="",L.style.height=""):L.style.cursor!="default"&&M!="div"&&L.parentNode.removeChild(L),L=A}if(this.printBackgroundImage){var I=r.getElementsByTagName("svg");I.length>0&&(I[0].style.position="absolute")}l.overlayPane.parentNode.removeChild(l.overlayPane),this.graph.setEnabled(g),this.graph.container=a,this.graph.cellRenderer.redraw=v,l.canvas=o,l.backgroundPane=u,l.drawPane=p,l.overlayPane=m,l.translate=c,S.destroy(),l.setEventsEnabled(f)}},mxPrintPreview.prototype.getLinkForCellState=function(t){return this.graph.getLinkForCell(t.cell)},mxPrintPreview.prototype.insertBackgroundImage=function(t,e,i){var n=this.graph.backgroundImage;if(n!=null){var r=document.createElement("img");r.style.position="absolute",r.style.marginLeft=Math.round(e*this.scale)+"px",r.style.marginTop=Math.round(i*this.scale)+"px",r.setAttribute("width",Math.round(this.scale*n.width)),r.setAttribute("height",Math.round(this.scale*n.height)),r.src=n.src,t.insertBefore(r,t.firstChild)}},mxPrintPreview.prototype.getCoverPages=function(){return null},mxPrintPreview.prototype.getAppendices=function(){return null},mxPrintPreview.prototype.print=function(t){var e=this.open(t);e?.print()},mxPrintPreview.prototype.close=function(){this.wnd!=null&&(this.wnd.close(),this.wnd=null)},__mxOutput.mxPrintPreview=typeof mxPrintPreview<"u"?mxPrintPreview:void 0;function mxStylesheet(){this.styles=new Object,this.putDefaultVertexStyle(this.createDefaultVertexStyle()),this.putDefaultEdgeStyle(this.createDefaultEdgeStyle())}mxStylesheet.prototype.styles,mxStylesheet.prototype.createDefaultVertexStyle=function(){var t=new Object;return t[mxConstants.STYLE_SHAPE]=mxConstants.SHAPE_RECTANGLE,t[mxConstants.STYLE_PERIMETER]=mxPerimeter.RectanglePerimeter,t[mxConstants.STYLE_VERTICAL_ALIGN]=mxConstants.ALIGN_MIDDLE,t[mxConstants.STYLE_ALIGN]=mxConstants.ALIGN_CENTER,t[mxConstants.STYLE_FILLCOLOR]="#C3D9FF",t[mxConstants.STYLE_STROKECOLOR]="#6482B9",t[mxConstants.STYLE_FONTCOLOR]="#774400",t},mxStylesheet.prototype.createDefaultEdgeStyle=function(){var t=new Object;return t[mxConstants.STYLE_SHAPE]=mxConstants.SHAPE_CONNECTOR,t[mxConstants.STYLE_ENDARROW]=mxConstants.ARROW_CLASSIC,t[mxConstants.STYLE_VERTICAL_ALIGN]=mxConstants.ALIGN_MIDDLE,t[mxConstants.STYLE_ALIGN]=mxConstants.ALIGN_CENTER,t[mxConstants.STYLE_STROKECOLOR]="#6482B9",t[mxConstants.STYLE_FONTCOLOR]="#446299",t},mxStylesheet.prototype.putDefaultVertexStyle=function(t){this.putCellStyle("defaultVertex",t)},mxStylesheet.prototype.putDefaultEdgeStyle=function(t){this.putCellStyle("defaultEdge",t)},mxStylesheet.prototype.getDefaultVertexStyle=function(){return this.styles.defaultVertex},mxStylesheet.prototype.getDefaultEdgeStyle=function(){return this.styles.defaultEdge},mxStylesheet.prototype.putCellStyle=function(t,e){this.styles[t]=e},mxStylesheet.prototype.getCellStyle=function(t,e){var i=e;if(t!=null&&t.length>0){var n=t.split(";");i!=null&&t.charAt(0)!=";"?i=mxUtils.clone(i):i=new Object;for(var r=0;r=0){var a=s.substring(0,l),o=s.substring(l+1);o==mxConstants.NONE?delete i[a]:mxUtils.isNumeric(o)?i[a]=parseFloat(o):i[a]=o}else{var u=this.styles[s];if(u!=null)for(var a in u)i[a]=u[a]}}}return i},__mxOutput.mxStylesheet=typeof mxStylesheet<"u"?mxStylesheet:void 0;function mxCellState(t,e,i){this.view=t,this.cell=e,this.style=i??{},this.origin=new mxPoint,this.absoluteOffset=new mxPoint}mxCellState.prototype=new mxRectangle,mxCellState.prototype.constructor=mxCellState,mxCellState.prototype.view=null,mxCellState.prototype.cell=null,mxCellState.prototype.style=null,mxCellState.prototype.invalidStyle=!1,mxCellState.prototype.invalid=!0,mxCellState.prototype.origin=null,mxCellState.prototype.absolutePoints=null,mxCellState.prototype.absoluteOffset=null,mxCellState.prototype.visibleSourceState=null,mxCellState.prototype.visibleTargetState=null,mxCellState.prototype.terminalDistance=0,mxCellState.prototype.length=0,mxCellState.prototype.segments=null,mxCellState.prototype.shape=null,mxCellState.prototype.text=null,mxCellState.prototype.unscaledWidth=null,mxCellState.prototype.unscaledHeight=null,mxCellState.prototype.getPerimeterBounds=function(t,e){if(t=t||0,e=e??new mxRectangle(this.x,this.y,this.width,this.height),this.shape!=null&&this.shape.stencil!=null&&this.shape.stencil.aspect=="fixed"){var i=this.shape.stencil.computeAspect(this.style,e.x,e.y,e.width,e.height);e.x=i.x,e.y=i.y,e.width=this.shape.stencil.w0*i.width,e.height=this.shape.stencil.h0*i.height}return t!=0&&e.grow(t),e},mxCellState.prototype.setAbsoluteTerminalPoint=function(t,e){e?(this.absolutePoints==null&&(this.absolutePoints=[]),this.absolutePoints.length==0?this.absolutePoints.push(t):this.absolutePoints[0]=t):this.absolutePoints==null?(this.absolutePoints=[],this.absolutePoints.push(null),this.absolutePoints.push(t)):this.absolutePoints.length==1?this.absolutePoints.push(t):this.absolutePoints[this.absolutePoints.length-1]=t},mxCellState.prototype.setCursor=function(t){this.shape!=null&&this.shape.setCursor(t),this.text!=null&&this.text.setCursor(t)},mxCellState.prototype.getVisibleTerminal=function(t){var e=this.getVisibleTerminalState(t);return e!=null?e.cell:null},mxCellState.prototype.getVisibleTerminalState=function(t){return t?this.visibleSourceState:this.visibleTargetState},mxCellState.prototype.setVisibleTerminalState=function(t,e){e?this.visibleSourceState=t:this.visibleTargetState=t},mxCellState.prototype.getCellBounds=function(){return this.cellBounds},mxCellState.prototype.getPaintBounds=function(){return this.paintBounds},mxCellState.prototype.updateCachedBounds=function(){var t=this.view.translate,e=this.view.scale;this.cellBounds=new mxRectangle(this.x/e-t.x,this.y/e-t.y,this.width/e,this.height/e),this.paintBounds=mxRectangle.fromRectangle(this.cellBounds),this.shape!=null&&this.shape.isPaintBoundsInverted()&&this.paintBounds.rotate90()},mxCellState.prototype.setState=function(t){this.view=t.view,this.cell=t.cell,this.style=t.style,this.absolutePoints=t.absolutePoints,this.origin=t.origin,this.absoluteOffset=t.absoluteOffset,this.boundingBox=t.boundingBox,this.terminalDistance=t.terminalDistance,this.segments=t.segments,this.length=t.length,this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this.unscaledWidth=t.unscaledWidth,this.unscaledHeight=t.unscaledHeight},mxCellState.prototype.clone=function(){var t=new mxCellState(this.view,this.cell,this.style);if(this.absolutePoints!=null){t.absolutePoints=[];for(var e=0;e=0:!1},mxGraphSelectionModel.prototype.isEmpty=function(){return this.cells.length==0},mxGraphSelectionModel.prototype.clear=function(){this.changeSelection(null,this.cells)},mxGraphSelectionModel.prototype.setCell=function(t){t!=null&&this.setCells([t])},mxGraphSelectionModel.prototype.setCells=function(t){if(t!=null){this.singleSelection&&(t=[this.getFirstSelectableCell(t)]);for(var e=[],i=0;i0&&t[0]!=null||e!=null&&e.length>0&&e[0]!=null){var i=new mxSelectionChange(this,t,e);i.execute();var n=new mxUndoableEdit(this,!1);n.add(i),this.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",n))}},mxGraphSelectionModel.prototype.cellAdded=function(t){t!=null&&!this.isSelected(t)&&this.cells.push(t)},mxGraphSelectionModel.prototype.cellRemoved=function(t){if(t!=null){var e=mxUtils.indexOf(this.cells,t);e>=0&&this.cells.splice(e,1)}};function mxSelectionChange(t,e,i){this.selectionModel=t,this.added=e!=null?e.slice():null,this.removed=i!=null?i.slice():null}mxSelectionChange.prototype.execute=function(){var t=mxLog.enter("mxSelectionChange.execute");if(window.status=mxResources.get(this.selectionModel.updatingSelectionResource)||this.selectionModel.updatingSelectionResource,this.removed!=null)for(var e=0;e":"",mxCellEditor.prototype.escapeCancelsEditing=!0,mxCellEditor.prototype.textNode="",mxCellEditor.prototype.zIndex=5,mxCellEditor.prototype.minResize=new mxRectangle(0,20),mxCellEditor.prototype.wordWrapPadding=mxClient.IS_QUIRKS?2:mxClient.IS_IE11?0:1,mxCellEditor.prototype.blurEnabled=!1,mxCellEditor.prototype.initialValue=null,mxCellEditor.prototype.align=null,mxCellEditor.prototype.init=function(){this.textarea=document.createElement("div"),this.textarea.className="mxCellEditor mxPlainTextEditor",this.textarea.contentEditable=!0,mxClient.IS_GC&&(this.textarea.style.minHeight="1em"),this.textarea.style.position=this.isLegacyEditor()?"absolute":"relative",this.installListeners(this.textarea)},mxCellEditor.prototype.applyValue=function(t,e){this.graph.labelChanged(t.cell,e,this.trigger)},mxCellEditor.prototype.setAlign=function(t){this.textarea!=null&&(this.textarea.style.textAlign=t),this.align=t,this.resize()},mxCellEditor.prototype.getInitialValue=function(t,e){var i=mxUtils.htmlEntities(this.graph.getEditingValue(t.cell,e),!1);return!mxClient.IS_QUIRKS&&document.documentMode!=8&&document.documentMode!=9&&document.documentMode!=10&&(i=mxUtils.replaceTrailingNewlines(i,"

")),i.replace(/\n/g,"
")},mxCellEditor.prototype.getCurrentValue=function(t){return mxUtils.extractTextWithWhitespace(this.textarea.childNodes)},mxCellEditor.prototype.isCancelEditingKeyEvent=function(t){return this.escapeCancelsEditing||mxEvent.isShiftDown(t)||mxEvent.isControlDown(t)||mxEvent.isMetaDown(t)},mxCellEditor.prototype.installListeners=function(t){mxEvent.addListener(t,"dragstart",mxUtils.bind(this,function(s){this.graph.stopEditing(!1),mxEvent.consume(s)})),mxEvent.addListener(t,"blur",mxUtils.bind(this,function(s){this.blurEnabled&&this.focusLost(s)})),mxEvent.addListener(t,"keydown",mxUtils.bind(this,function(s){mxEvent.isConsumed(s)||(this.isStopEditingEvent(s)?(this.graph.stopEditing(!1),mxEvent.consume(s)):s.keyCode==27&&(this.graph.stopEditing(this.isCancelEditingKeyEvent(s)),mxEvent.consume(s)))}));var e=mxUtils.bind(this,function(s){this.editingCell!=null&&this.clearOnChange&&t.innerHTML==this.getEmptyLabelText()&&(!mxClient.IS_FF||s.keyCode!=8&&s.keyCode!=46)&&(this.clearOnChange=!1,t.innerHTML="")});mxEvent.addListener(t,"keypress",e),mxEvent.addListener(t,"paste",e);var i=mxUtils.bind(this,function(s){this.editingCell!=null&&(this.textarea.innerHTML.length==0||this.textarea.innerHTML=="
"?(this.textarea.innerHTML=this.getEmptyLabelText(),this.clearOnChange=this.textarea.innerHTML.length>0):this.clearOnChange=!1)});mxEvent.addListener(t,!mxClient.IS_IE11&&!mxClient.IS_IE?"input":"keyup",i),mxEvent.addListener(t,"cut",i),mxEvent.addListener(t,"paste",i);var n=!mxClient.IS_IE11&&!mxClient.IS_IE?"input":"keydown",r=mxUtils.bind(this,function(s){this.editingCell!=null&&this.autoSize&&!mxEvent.isConsumed(s)&&(this.resizeThread!=null&&window.clearTimeout(this.resizeThread),this.resizeThread=window.setTimeout(mxUtils.bind(this,function(){this.resizeThread=null,this.resize()}),0))});mxEvent.addListener(t,n,r),mxEvent.addListener(window,"resize",r),document.documentMode>=9?(mxEvent.addListener(t,"DOMNodeRemoved",r),mxEvent.addListener(t,"DOMNodeInserted",r)):(mxEvent.addListener(t,"cut",r),mxEvent.addListener(t,"paste",r))},mxCellEditor.prototype.isStopEditingEvent=function(t){return t.keyCode==113||this.graph.isEnterStopsCellEditing()&&t.keyCode==13&&!mxEvent.isControlDown(t)&&!mxEvent.isShiftDown(t)},mxCellEditor.prototype.isEventSource=function(t){return mxEvent.getSource(t)==this.textarea},mxCellEditor.prototype.resize=function(){var t=this.graph.getView().getState(this.editingCell);if(t==null)this.stopEditing(!0);else if(this.textarea!=null){var e=this.graph.getModel().isEdge(t.cell),i=this.graph.getView().scale,n=null;if(!this.autoSize||t.style[mxConstants.STYLE_OVERFLOW]=="fill")this.bounds=this.getEditorBounds(t),this.textarea.style.width=Math.round(this.bounds.width/i)+"px",this.textarea.style.height=Math.round(this.bounds.height/i)+"px",document.documentMode==8||mxClient.IS_QUIRKS?(this.textarea.style.left=Math.round(this.bounds.x)+"px",this.textarea.style.top=Math.round(this.bounds.y)+"px"):(this.textarea.style.left=Math.max(0,Math.round(this.bounds.x+1))+"px",this.textarea.style.top=Math.max(0,Math.round(this.bounds.y+1))+"px"),this.graph.isWrapping(t.cell)&&(this.bounds.width>=2||this.bounds.height>=2)&&this.textarea.innerHTML!=this.getEmptyLabelText()?(this.textarea.style.wordWrap=mxConstants.WORD_WRAP,this.textarea.style.whiteSpace="normal",t.style[mxConstants.STYLE_OVERFLOW]!="fill"&&(this.textarea.style.width=Math.round(this.bounds.width/i)+this.wordWrapPadding+"px")):(this.textarea.style.whiteSpace="nowrap",t.style[mxConstants.STYLE_OVERFLOW]!="fill"&&(this.textarea.style.width=""));else{var r=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_WIDTH,null);if(n=t.text!=null&&this.align==null?t.text.margin:null,n==null&&(n=mxUtils.getAlignmentAsPoint(this.align||mxUtils.getValue(t.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_CENTER),mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE))),e){if(this.bounds=new mxRectangle(t.absoluteOffset.x,t.absoluteOffset.y,0,0),r!=null){var s=(parseFloat(r)+2)*i;this.bounds.width=s,this.bounds.x+=n.x*s}}else{var l=mxRectangle.fromRectangle(t),a=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER),o=mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE);if(l=t.shape!=null&&a==mxConstants.ALIGN_CENTER&&o==mxConstants.ALIGN_MIDDLE?t.shape.getLabelBounds(l):l,r!=null&&(l.width=parseFloat(r)*i),!t.view.graph.cellRenderer.legacySpacing||t.style[mxConstants.STYLE_OVERFLOW]!="width"){var u=parseInt(t.style[mxConstants.STYLE_SPACING]||2)*i,p=(parseInt(t.style[mxConstants.STYLE_SPACING_TOP]||0)+mxText.prototype.baseSpacingTop)*i+u,m=(parseInt(t.style[mxConstants.STYLE_SPACING_RIGHT]||0)+mxText.prototype.baseSpacingRight)*i+u,d=(parseInt(t.style[mxConstants.STYLE_SPACING_BOTTOM]||0)+mxText.prototype.baseSpacingBottom)*i+u,x=(parseInt(t.style[mxConstants.STYLE_SPACING_LEFT]||0)+mxText.prototype.baseSpacingLeft)*i+u,a=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER),o=mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE);l=new mxRectangle(l.x+x,l.y+p,l.width-(a==mxConstants.ALIGN_CENTER&&r==null?x+m:0),l.height-(o==mxConstants.ALIGN_MIDDLE?p+d:0))}this.bounds=new mxRectangle(l.x+t.absoluteOffset.x,l.y+t.absoluteOffset.y,l.width,l.height)}if(this.graph.isWrapping(t.cell)&&(this.bounds.width>=2||this.bounds.height>=2)&&this.textarea.innerHTML!=this.getEmptyLabelText()){this.textarea.style.wordWrap=mxConstants.WORD_WRAP,this.textarea.style.whiteSpace="normal";var s=Math.round(this.bounds.width/(document.documentMode==8,i))+this.wordWrapPadding;this.textarea.style.position!="relative"?(this.textarea.style.width=s+"px",this.textarea.scrollWidth>s&&(this.textarea.style.width=this.textarea.scrollWidth+"px")):this.textarea.style.maxWidth=s+"px"}else this.textarea.style.whiteSpace="nowrap",this.textarea.style.width="";document.documentMode==8&&(this.textarea.style.zoom="1",this.textarea.style.height="auto");var f=this.textarea.scrollWidth,g=this.textarea.scrollHeight;document.documentMode==8?(this.textarea.style.left=Math.max(0,Math.ceil((this.bounds.x-n.x*(this.bounds.width-(f+1)*i)+f*(i-1)*0+(n.x+.5)*2)/i))+"px",this.textarea.style.top=Math.max(0,Math.ceil((this.bounds.y-n.y*(this.bounds.height-(g+.5)*i)+g*(i-1)*0+Math.abs(n.y+.5)*1)/i))+"px",this.textarea.style.width=Math.round(f*i)+"px",this.textarea.style.height=Math.round(g*i)+"px"):mxClient.IS_QUIRKS?(this.textarea.style.left=Math.max(0,Math.ceil(this.bounds.x-n.x*(this.bounds.width-(f+1)*i)+f*(i-1)*0+(n.x+.5)*2))+"px",this.textarea.style.top=Math.max(0,Math.ceil(this.bounds.y-n.y*(this.bounds.height-(g+.5)*i)+g*(i-1)*0+Math.abs(n.y+.5)*1))+"px"):(this.textarea.style.left=Math.max(0,Math.round(this.bounds.x-n.x*(this.bounds.width-2))+1)+"px",this.textarea.style.top=Math.max(0,Math.round(this.bounds.y-n.y*(this.bounds.height-4)+(n.y==-1?3:0))+1)+"px")}mxClient.IS_VML?this.textarea.style.zoom=i:(mxUtils.setPrefixedStyle(this.textarea.style,"transformOrigin","0px 0px"),mxUtils.setPrefixedStyle(this.textarea.style,"transform","scale("+i+","+i+")"+(n==null?"":" translate("+n.x*100+"%,"+n.y*100+"%)")))}},mxCellEditor.prototype.focusLost=function(){this.stopEditing(!this.graph.isInvokesStopCellEditing())},mxCellEditor.prototype.getBackgroundColor=function(t){return null},mxCellEditor.prototype.isLegacyEditor=function(){if(mxClient.IS_VML)return!0;var t=!1;if(mxClient.IS_SVG){var e=this.graph.view.getDrawPane().ownerSVGElement;if(e!=null){var i=mxUtils.getCurrentStyle(e);i!=null&&(t=i.position=="absolute")}}return!t},mxCellEditor.prototype.startEditing=function(t,e){this.stopEditing(!0),this.align=null,this.textarea==null&&this.init(),this.graph.tooltipHandler!=null&&this.graph.tooltipHandler.hideTooltip();var i=this.graph.getView().getState(t);if(i!=null){this.graph.getView().scale;var n=mxUtils.getValue(i.style,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE),r=mxUtils.getValue(i.style,mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY),s=mxUtils.getValue(i.style,mxConstants.STYLE_FONTCOLOR,"black"),l=mxUtils.getValue(i.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_LEFT),a=(mxUtils.getValue(i.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD,o=(mxUtils.getValue(i.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC,u=[];(mxUtils.getValue(i.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&u.push("underline"),(mxUtils.getValue(i.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&u.push("line-through"),this.textarea.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?Math.round(n*mxConstants.LINE_HEIGHT)+"px":mxConstants.LINE_HEIGHT,this.textarea.style.backgroundColor=this.getBackgroundColor(i),this.textarea.style.textDecoration=u.join(" "),this.textarea.style.fontWeight=a?"bold":"normal",this.textarea.style.fontStyle=o?"italic":"",this.textarea.style.fontSize=Math.round(n)+"px",this.textarea.style.zIndex=this.zIndex,this.textarea.style.fontFamily=r,this.textarea.style.textAlign=l,this.textarea.style.outline="none",this.textarea.style.color=s;var p=this.textDirection=mxUtils.getValue(i.style,mxConstants.STYLE_TEXT_DIRECTION,mxConstants.DEFAULT_TEXT_DIRECTION);p==mxConstants.TEXT_DIRECTION_AUTO&&i!=null&&i.text!=null&&i.text.dialect!=mxConstants.DIALECT_STRICTHTML&&!mxUtils.isNode(i.text.value)&&(p=i.text.getAutoDirection()),p==mxConstants.TEXT_DIRECTION_LTR||p==mxConstants.TEXT_DIRECTION_RTL?this.textarea.setAttribute("dir",p):this.textarea.removeAttribute("dir"),this.textarea.innerHTML=this.getInitialValue(i,e)||"",this.initialValue=this.textarea.innerHTML,this.textarea.innerHTML.length==0||this.textarea.innerHTML=="
"?(this.textarea.innerHTML=this.getEmptyLabelText(),this.clearOnChange=!0):this.clearOnChange=this.textarea.innerHTML==this.getEmptyLabelText(),this.graph.container.appendChild(this.textarea),this.editingCell=t,this.trigger=e,this.textNode=null,i.text!=null&&this.isHideLabel(i)&&(this.textNode=i.text.node,this.textNode.style.visibility="hidden"),this.autoSize&&(this.graph.model.isEdge(i.cell)||i.style[mxConstants.STYLE_OVERFLOW]!="fill")&&window.setTimeout(mxUtils.bind(this,function(){this.resize()}),0),this.resize();try{this.textarea.focus(),this.isSelectText()&&this.textarea.innerHTML.length>0&&(this.textarea.innerHTML!=this.getEmptyLabelText()||!this.clearOnChange)&&document.execCommand("selectAll",!1,null)}catch{}}},mxCellEditor.prototype.isSelectText=function(){return this.selectText},mxCellEditor.prototype.clearSelection=function(){var t=null;window.getSelection?t=window.getSelection():document.selection&&(t=document.selection),t!=null&&(t.empty?t.empty():t.removeAllRanges&&t.removeAllRanges())},mxCellEditor.prototype.stopEditing=function(t){if(t=t||!1,this.editingCell!=null){this.textNode!=null&&(this.textNode.style.visibility="visible",this.textNode=null);var e=t?null:this.graph.view.getState(this.editingCell),i=this.initialValue;if(this.initialValue=null,this.editingCell=null,this.trigger=null,this.bounds=null,this.textarea.blur(),this.clearSelection(),this.textarea.parentNode!=null&&this.textarea.parentNode.removeChild(this.textarea),this.clearOnChange&&this.textarea.innerHTML==this.getEmptyLabelText()&&(this.textarea.innerHTML="",this.clearOnChange=!1),e!=null&&(this.textarea.innerHTML!=i||this.align!=null)){this.prepareTextarea();var n=this.getCurrentValue(e);this.graph.getModel().beginUpdate();try{n!=null&&this.applyValue(e,n),this.align!=null&&this.graph.setCellStyles(mxConstants.STYLE_ALIGN,this.align,[e.cell])}finally{this.graph.getModel().endUpdate()}}mxEvent.release(this.textarea),this.textarea=null,this.align=null}},mxCellEditor.prototype.prepareTextarea=function(){this.textarea.lastChild!=null&&this.textarea.lastChild.nodeName=="BR"&&this.textarea.removeChild(this.textarea.lastChild)},mxCellEditor.prototype.isHideLabel=function(t){return!0},mxCellEditor.prototype.getMinimumSize=function(t){var e=this.graph.getView().scale;return new mxRectangle(0,0,t.text==null?30:t.text.size*e+20,this.textarea.style.textAlign=="left"?120:40)},mxCellEditor.prototype.getEditorBounds=function(t){var e=this.graph.getModel().isEdge(t.cell),i=this.graph.getView().scale,n=this.getMinimumSize(t),r=n.width,s=n.height,l=null;if(!e&&t.view.graph.cellRenderer.legacySpacing&&t.style[mxConstants.STYLE_OVERFLOW]=="fill")l=t.shape.getLabelBounds(mxRectangle.fromRectangle(t));else{var a=parseInt(t.style[mxConstants.STYLE_SPACING]||0)*i,o=(parseInt(t.style[mxConstants.STYLE_SPACING_TOP]||0)+mxText.prototype.baseSpacingTop)*i+a,u=(parseInt(t.style[mxConstants.STYLE_SPACING_RIGHT]||0)+mxText.prototype.baseSpacingRight)*i+a,p=(parseInt(t.style[mxConstants.STYLE_SPACING_BOTTOM]||0)+mxText.prototype.baseSpacingBottom)*i+a,m=(parseInt(t.style[mxConstants.STYLE_SPACING_LEFT]||0)+mxText.prototype.baseSpacingLeft)*i+a;l=new mxRectangle(t.x,t.y,Math.max(r,t.width-m-u),Math.max(s,t.height-o-p));var d=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER),x=mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE);if(l=t.shape!=null&&d==mxConstants.ALIGN_CENTER&&x==mxConstants.ALIGN_MIDDLE?t.shape.getLabelBounds(l):l,e?(l.x=t.absoluteOffset.x,l.y=t.absoluteOffset.y,t.text!=null&&t.text.boundingBox!=null&&(t.text.boundingBox.x>0&&(l.x=t.text.boundingBox.x),t.text.boundingBox.y>0&&(l.y=t.text.boundingBox.y))):t.text!=null&&t.text.boundingBox!=null&&(l.x=Math.min(l.x,t.text.boundingBox.x),l.y=Math.min(l.y,t.text.boundingBox.y)),l.x+=m,l.y+=o,t.text!=null&&t.text.boundingBox!=null&&(e?(l.width=Math.max(r,t.text.boundingBox.width),l.height=Math.max(s,t.text.boundingBox.height)):(l.width=Math.max(l.width,t.text.boundingBox.width),l.height=Math.max(l.height,t.text.boundingBox.height))),this.graph.getModel().isVertex(t.cell)){var f=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER);f==mxConstants.ALIGN_LEFT?l.x-=t.width:f==mxConstants.ALIGN_RIGHT&&(l.x+=t.width);var g=mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE);g==mxConstants.ALIGN_TOP?l.y-=t.height:g==mxConstants.ALIGN_BOTTOM&&(l.y+=t.height)}}return new mxRectangle(Math.round(l.x),Math.round(l.y),Math.round(l.width),Math.round(l.height))},mxCellEditor.prototype.getEmptyLabelText=function(t){return this.emptyLabelText},mxCellEditor.prototype.getEditingCell=function(){return this.editingCell},mxCellEditor.prototype.destroy=function(){this.textarea!=null&&(mxEvent.release(this.textarea),this.textarea.parentNode!=null&&this.textarea.parentNode.removeChild(this.textarea),this.textarea=null),this.changeHandler!=null&&(this.graph.getModel().removeListener(this.changeHandler),this.changeHandler=null),this.zoomHandler&&(this.graph.view.removeListener(this.zoomHandler),this.zoomHandler=null)},__mxOutput.mxCellEditor=typeof mxCellEditor<"u"?mxCellEditor:void 0;function mxCellRenderer(){}mxCellRenderer.defaultShapes=new Object,mxCellRenderer.prototype.defaultEdgeShape=mxConnector,mxCellRenderer.prototype.defaultVertexShape=mxRectangleShape,mxCellRenderer.prototype.defaultTextShape=mxText,mxCellRenderer.prototype.legacyControlPosition=!0,mxCellRenderer.prototype.legacySpacing=!0,mxCellRenderer.prototype.antiAlias=!0,mxCellRenderer.prototype.minSvgStrokeWidth=1,mxCellRenderer.prototype.forceControlClickHandler=!1,mxCellRenderer.registerShape=function(t,e){mxCellRenderer.defaultShapes[t]=e},mxCellRenderer.registerShape(mxConstants.SHAPE_RECTANGLE,mxRectangleShape),mxCellRenderer.registerShape(mxConstants.SHAPE_ELLIPSE,mxEllipse),mxCellRenderer.registerShape(mxConstants.SHAPE_RHOMBUS,mxRhombus),mxCellRenderer.registerShape(mxConstants.SHAPE_CYLINDER,mxCylinder),mxCellRenderer.registerShape(mxConstants.SHAPE_CONNECTOR,mxConnector),mxCellRenderer.registerShape(mxConstants.SHAPE_ACTOR,mxActor),mxCellRenderer.registerShape(mxConstants.SHAPE_TRIANGLE,mxTriangle),mxCellRenderer.registerShape(mxConstants.SHAPE_HEXAGON,mxHexagon),mxCellRenderer.registerShape(mxConstants.SHAPE_CLOUD,mxCloud),mxCellRenderer.registerShape(mxConstants.SHAPE_LINE,mxLine),mxCellRenderer.registerShape(mxConstants.SHAPE_ARROW,mxArrow),mxCellRenderer.registerShape(mxConstants.SHAPE_ARROW_CONNECTOR,mxArrowConnector),mxCellRenderer.registerShape(mxConstants.SHAPE_DOUBLE_ELLIPSE,mxDoubleEllipse),mxCellRenderer.registerShape(mxConstants.SHAPE_SWIMLANE,mxSwimlane),mxCellRenderer.registerShape(mxConstants.SHAPE_IMAGE,mxImageShape),mxCellRenderer.registerShape(mxConstants.SHAPE_LABEL,mxLabel),mxCellRenderer.prototype.initializeShape=function(t){t.shape.dialect=t.view.graph.dialect,this.configureShape(t),t.shape.init(t.view.getDrawPane())},mxCellRenderer.prototype.createShape=function(t){var e=null;if(t.style!=null){var i=mxStencilRegistry.getStencil(t.style[mxConstants.STYLE_SHAPE]);if(i!=null)e=new mxShape(i);else{var n=this.getShapeConstructor(t);e=new n}}return e},mxCellRenderer.prototype.createIndicatorShape=function(t){t.shape.indicatorShape=this.getShape(t.view.graph.getIndicatorShape(t))},mxCellRenderer.prototype.getShape=function(t){return t!=null?mxCellRenderer.defaultShapes[t]:null},mxCellRenderer.prototype.getShapeConstructor=function(t){var e=this.getShape(t.style[mxConstants.STYLE_SHAPE]);return e==null&&(e=t.view.graph.getModel().isEdge(t.cell)?this.defaultEdgeShape:this.defaultVertexShape),e},mxCellRenderer.prototype.configureShape=function(t){t.shape.apply(t),t.shape.image=t.view.graph.getImage(t),t.shape.indicatorColor=t.view.graph.getIndicatorColor(t),t.shape.indicatorStrokeColor=t.style[mxConstants.STYLE_INDICATOR_STROKECOLOR],t.shape.indicatorGradientColor=t.view.graph.getIndicatorGradientColor(t),t.shape.indicatorDirection=t.style[mxConstants.STYLE_INDICATOR_DIRECTION],t.shape.indicatorImage=t.view.graph.getIndicatorImage(t),this.postConfigureShape(t)},mxCellRenderer.prototype.postConfigureShape=function(t){t.shape!=null&&(this.resolveColor(t,"indicatorGradientColor",mxConstants.STYLE_GRADIENTCOLOR),this.resolveColor(t,"indicatorColor",mxConstants.STYLE_FILLCOLOR),this.resolveColor(t,"gradient",mxConstants.STYLE_GRADIENTCOLOR),this.resolveColor(t,"stroke",mxConstants.STYLE_STROKECOLOR),this.resolveColor(t,"fill",mxConstants.STYLE_FILLCOLOR))},mxCellRenderer.prototype.checkPlaceholderStyles=function(t){if(t.style!=null){for(var e=["inherit","swimlane","indicated"],i=[mxConstants.STYLE_FILLCOLOR,mxConstants.STYLE_STROKECOLOR,mxConstants.STYLE_GRADIENTCOLOR,mxConstants.STYLE_FONTCOLOR],n=0;n=0)return!0}return!1},mxCellRenderer.prototype.resolveColor=function(t,e,i){var n=i==mxConstants.STYLE_FONTCOLOR?t.text:t.shape;if(n!=null){var r=t.view.graph,s=n[e],l=null;if(s=="inherit"?l=r.model.getParent(t.cell):s=="swimlane"?(n[e]=i==mxConstants.STYLE_STROKECOLOR||i==mxConstants.STYLE_FONTCOLOR?"#000000":"#ffffff",r.model.getTerminal(t.cell,!1)!=null?l=r.model.getTerminal(t.cell,!1):l=t.cell,l=r.getSwimlane(l),i=r.swimlaneIndicatorColorAttribute):s=="indicated"&&t.shape!=null?n[e]=t.shape.indicatorColor:i!=mxConstants.STYLE_FILLCOLOR&&s==mxConstants.STYLE_FILLCOLOR&&t.shape!=null?n[e]=t.style[mxConstants.STYLE_FILLCOLOR]:i!=mxConstants.STYLE_STROKECOLOR&&s==mxConstants.STYLE_STROKECOLOR&&t.shape!=null&&(n[e]=t.style[mxConstants.STYLE_STROKECOLOR]),l!=null){var a=r.getView().getState(l);if(n[e]=null,a!=null){var o=i==mxConstants.STYLE_FONTCOLOR?a.text:a.shape;o!=null&&e!="indicatorColor"?n[e]=o[e]:n[e]=a.style[i]}}}},mxCellRenderer.prototype.getLabelValue=function(t){return t.view.graph.getLabel(t.cell)},mxCellRenderer.prototype.createLabel=function(t,e){var i=t.view.graph;if(i.getModel().isEdge(t.cell),t.style[mxConstants.STYLE_FONTSIZE]>0||t.style[mxConstants.STYLE_FONTSIZE]==null){var n=i.isHtmlLabel(t.cell)||e!=null&&mxUtils.isNode(e);t.text=new this.defaultTextShape(e,new mxRectangle,t.style[mxConstants.STYLE_ALIGN]||mxConstants.ALIGN_CENTER,i.getVerticalAlign(t),t.style[mxConstants.STYLE_FONTCOLOR],t.style[mxConstants.STYLE_FONTFAMILY],t.style[mxConstants.STYLE_FONTSIZE],t.style[mxConstants.STYLE_FONTSTYLE],t.style[mxConstants.STYLE_SPACING],t.style[mxConstants.STYLE_SPACING_TOP],t.style[mxConstants.STYLE_SPACING_RIGHT],t.style[mxConstants.STYLE_SPACING_BOTTOM],t.style[mxConstants.STYLE_SPACING_LEFT],t.style[mxConstants.STYLE_HORIZONTAL],t.style[mxConstants.STYLE_LABEL_BACKGROUNDCOLOR],t.style[mxConstants.STYLE_LABEL_BORDERCOLOR],i.isWrapping(t.cell)&&i.isHtmlLabel(t.cell),i.isLabelClipped(t.cell),t.style[mxConstants.STYLE_OVERFLOW],t.style[mxConstants.STYLE_LABEL_PADDING],mxUtils.getValue(t.style,mxConstants.STYLE_TEXT_DIRECTION,mxConstants.DEFAULT_TEXT_DIRECTION)),t.text.opacity=mxUtils.getValue(t.style,mxConstants.STYLE_TEXT_OPACITY,100),t.text.dialect=n?mxConstants.DIALECT_STRICTHTML:t.view.graph.dialect,t.text.style=t.style,t.text.state=t,this.initializeLabel(t,t.text);var r=!1,s=function(l){var a=t;if(mxClient.IS_TOUCH||r){var o=mxEvent.getClientX(l),u=mxEvent.getClientY(l),p=mxUtils.convertPoint(i.container,o,u);a=i.view.getState(i.getCellAt(p.x,p.y))}return a};mxEvent.addGestureListeners(t.text.node,mxUtils.bind(this,function(l){this.isLabelEvent(t,l)&&(i.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(l,t)),r=i.dialect!=mxConstants.DIALECT_SVG&&mxEvent.getSource(l).nodeName=="IMG")}),mxUtils.bind(this,function(l){this.isLabelEvent(t,l)&&i.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(l,s(l)))}),mxUtils.bind(this,function(l){this.isLabelEvent(t,l)&&(i.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(l,s(l))),r=!1)})),i.nativeDblClickEnabled&&mxEvent.addListener(t.text.node,"dblclick",mxUtils.bind(this,function(l){this.isLabelEvent(t,l)&&(i.dblClick(l,t.cell),mxEvent.consume(l))}))}},mxCellRenderer.prototype.initializeLabel=function(t,e){mxClient.IS_SVG&&mxClient.NO_FO&&e.dialect!=mxConstants.DIALECT_SVG?e.init(t.view.graph.container):e.init(t.view.getDrawPane())},mxCellRenderer.prototype.createCellOverlays=function(t){var e=t.view.graph,i=e.getCellOverlays(t.cell),n=null;if(i!=null){n=new mxDictionary;for(var r=0;r0)?this.createLabel(t,n):t.text!=null&&(n==null||n.length==0)&&(t.text.destroy(),t.text=null),t.text!=null){e&&(t.text.lastValue!=null&&this.isTextShapeInvalid(t,t.text)&&(t.text.lastValue=null),t.text.resetStyles(),t.text.apply(t),t.text.valign=i.getVerticalAlign(t));var u=this.getLabelBounds(t),p=this.getTextScale(t);if(this.resolveColor(t,"color",mxConstants.STYLE_FONTCOLOR),e||t.text.value!=n||t.text.isWrapping!=r||t.text.overflow!=o||t.text.isClipping!=s||t.text.scale!=p||t.text.dialect!=a||t.text.bounds==null||!t.text.bounds.equals(u)){t.text.dialect=a,t.text.value=n,t.text.bounds=u,t.text.scale=p,t.text.wrap=r,t.text.clipped=s,t.text.overflow=o;var m=t.text.node.style.visibility;this.redrawLabelShape(t.text),t.text.node.style.visibility=m}}},mxCellRenderer.prototype.isTextShapeInvalid=function(t,e){function i(n,r,s){var l=!1;return r=="spacingTop"||r=="spacingRight"||r=="spacingBottom"||r=="spacingLeft"?l=parseFloat(e[n])-parseFloat(e.spacing)!=(t.style[r]||s):l=e[n]!=(t.style[r]||s),l}return i("fontStyle",mxConstants.STYLE_FONTSTYLE,mxConstants.DEFAULT_FONTSTYLE)||i("family",mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY)||i("size",mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE)||i("color",mxConstants.STYLE_FONTCOLOR,"black")||i("align",mxConstants.STYLE_ALIGN,"")||i("valign",mxConstants.STYLE_VERTICAL_ALIGN,"")||i("spacing",mxConstants.STYLE_SPACING,2)||i("spacingTop",mxConstants.STYLE_SPACING_TOP,0)||i("spacingRight",mxConstants.STYLE_SPACING_RIGHT,0)||i("spacingBottom",mxConstants.STYLE_SPACING_BOTTOM,0)||i("spacingLeft",mxConstants.STYLE_SPACING_LEFT,0)||i("horizontal",mxConstants.STYLE_HORIZONTAL,!0)||i("background",mxConstants.STYLE_LABEL_BACKGROUNDCOLOR)||i("border",mxConstants.STYLE_LABEL_BORDERCOLOR)||i("opacity",mxConstants.STYLE_TEXT_OPACITY,100)||i("textDirection",mxConstants.STYLE_TEXT_DIRECTION,mxConstants.DEFAULT_TEXT_DIRECTION)},mxCellRenderer.prototype.redrawLabelShape=function(t){t.redraw()},mxCellRenderer.prototype.getTextScale=function(t){return t.view.scale},mxCellRenderer.prototype.getLabelBounds=function(t){var e=t.view.graph,i=t.view.scale,n=e.getModel().isEdge(t.cell),r=new mxRectangle(t.absoluteOffset.x,t.absoluteOffset.y);if(n){var s=t.text.getSpacing();r.x+=s.x*i,r.y+=s.y*i;var l=e.getCellGeometry(t.cell);l!=null&&(r.width=Math.max(0,l.width*i),r.height=Math.max(0,l.height*i))}else{if(t.text.isPaintBoundsInverted()){var a=r.x;r.x=r.y,r.y=a}r.x+=t.x,r.y+=t.y,r.width=Math.max(1,t.width),r.height=Math.max(1,t.height)}if(t.text.isPaintBoundsInverted()){var o=(t.width-t.height)/2;r.x+=o,r.y-=o;var a=r.width;r.width=r.height,r.height=a}if(t.shape!=null){var u=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER),p=mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE);u==mxConstants.ALIGN_CENTER&&p==mxConstants.ALIGN_MIDDLE&&(r=t.shape.getLabelBounds(r))}var m=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_WIDTH,null);return m!=null&&(r.width=parseFloat(m)*i),n||this.rotateLabelBounds(t,r),r},mxCellRenderer.prototype.rotateLabelBounds=function(t,e){if(e.y-=t.text.margin.y*e.height,e.x-=t.text.margin.x*e.width,!this.legacySpacing||t.style[mxConstants.STYLE_OVERFLOW]!="fill"&&t.style[mxConstants.STYLE_OVERFLOW]!="width"){var i=t.view.scale,n=t.text.getSpacing();e.x+=n.x*i,e.y+=n.y*i;var r=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER),s=mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE),l=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_WIDTH,null);e.width=Math.max(0,e.width-(r==mxConstants.ALIGN_CENTER&&l==null?t.text.spacingLeft*i+t.text.spacingRight*i:0)),e.height=Math.max(0,e.height-(s==mxConstants.ALIGN_MIDDLE?t.text.spacingTop*i+t.text.spacingBottom*i:0))}var a=t.text.getTextRotation();if(a!=0&&t!=null&&t.view.graph.model.isVertex(t.cell)){var o=t.getCenterX(),u=t.getCenterY();if(e.x!=o||e.y!=u){var p=a*(Math.PI/180),m=mxUtils.getRotatedPoint(new mxPoint(e.x,e.y),Math.cos(p),Math.sin(p),new mxPoint(o,u));e.x=m.x,e.y=m.y}}},mxCellRenderer.prototype.redrawCellOverlays=function(t,e){if(this.createCellOverlays(t),t.overlays!=null){var i=mxUtils.mod(mxUtils.getValue(t.style,mxConstants.STYLE_ROTATION,0),90),n=mxUtils.toRadians(i),r=Math.cos(n),s=Math.sin(n);t.overlays.visit(function(l,a){var o=a.overlay.getBounds(t);if(!t.view.graph.getModel().isEdge(t.cell)&&t.shape!=null&&i!=0){var u=o.getCenterX(),p=o.getCenterY(),m=mxUtils.getRotatedPoint(new mxPoint(u,p),r,s,new mxPoint(t.getCenterX(),t.getCenterY()));u=m.x,p=m.y,o.x=Math.round(u-o.width/2),o.y=Math.round(p-o.height/2)}(e||a.bounds==null||a.scale!=t.view.scale||!a.bounds.equals(o))&&(a.bounds=o,a.scale=t.view.scale,a.redraw())})}},mxCellRenderer.prototype.redrawControl=function(t,e){var i=t.view.graph.getFoldingImage(t);if(t.control!=null&&i!=null){var n=this.getControlBounds(t,i.width,i.height),r=this.legacyControlPosition?mxUtils.getValue(t.style,mxConstants.STYLE_ROTATION,0):t.shape.getTextRotation(),s=t.view.scale;(e||t.control.scale!=s||!t.control.bounds.equals(n)||t.control.rotation!=r)&&(t.control.rotation=r,t.control.bounds=n,t.control.scale=s,t.control.redraw())}},mxCellRenderer.prototype.getControlBounds=function(t,e,i){if(t.control!=null){var n=t.view.scale,r=t.getCenterX(),s=t.getCenterY();if(!t.view.graph.getModel().isEdge(t.cell)&&(r=t.x+e*n,s=t.y+i*n,t.shape!=null)){var l=t.shape.getShapeRotation();if(this.legacyControlPosition)l=mxUtils.getValue(t.style,mxConstants.STYLE_ROTATION,0);else if(t.shape.isPaintBoundsInverted()){var a=(t.width-t.height)/2;r+=a,s-=a}if(l!=0){var o=mxUtils.toRadians(l),u=Math.cos(o),p=Math.sin(o),m=mxUtils.getRotatedPoint(new mxPoint(r,s),u,p,new mxPoint(t.getCenterX(),t.getCenterY()));r=m.x,s=m.y}}return t.view.graph.getModel().isEdge(t.cell)?new mxRectangle(Math.round(r-e/2*n),Math.round(s-i/2*n),Math.round(e*n),Math.round(i*n)):new mxRectangle(Math.round(r-e/2*n),Math.round(s-i/2*n),Math.round(e*n),Math.round(i*n))}return null},mxCellRenderer.prototype.insertStateAfter=function(t,e,i){for(var n=this.getShapesForState(t),r=0;r0)for(var o=0;o0?n[0]:null;u!=null&&(u=p.transformControlPoint(t,u),mxUtils.contains(e,u.x,u.y)&&(u=null));var d=0,x=0,f=0,g=0,c=mxUtils.getValue(t.style,mxConstants.STYLE_SEGMENT,m.gridSize)*p.scale,v=mxUtils.getValue(t.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_WEST);v==mxConstants.DIRECTION_NORTH||v==mxConstants.DIRECTION_SOUTH?(d=p.getRoutingCenterX(e),x=c):(f=p.getRoutingCenterY(e),g=c),u==null||u.xe.x+e.width?u!=null?(d=u.x,g=Math.max(Math.abs(f-u.y),g)):v==mxConstants.DIRECTION_NORTH?f=e.y-2*x:v==mxConstants.DIRECTION_SOUTH?f=e.y+e.height+2*x:v==mxConstants.DIRECTION_EAST?d=e.x-2*g:d=e.x+e.width+2*g:u!=null&&(d=p.getRoutingCenterX(e),x=Math.max(Math.abs(d-u.x),g),f=u.y,g=0),r.push(new mxPoint(d-x,f-g)),r.push(new mxPoint(d+x,f+g))}},ElbowConnector:function(t,e,i,n,r){var s=n!=null&&n.length>0?n[0]:null,l=!1,a=!1;if(e!=null&&i!=null)if(s!=null){var o=Math.min(e.x,i.x),u=Math.max(e.x+e.width,i.x+i.width),p=Math.min(e.y,i.y),m=Math.max(e.y+e.height,i.y+i.height);s=t.view.transformControlPoint(t,s),l=s.ym,a=s.xu}else{var o=Math.max(e.x,i.x),u=Math.min(e.x+e.width,i.x+i.width);if(l=o==u,!l){var p=Math.max(e.y,i.y),m=Math.min(e.y+e.height,i.y+i.height);a=p==m}}!a&&(l||t.style[mxConstants.STYLE_ELBOW]==mxConstants.ELBOW_VERTICAL)?mxEdgeStyle.TopToBottom(t,e,i,n,r):mxEdgeStyle.SideToSide(t,e,i,n,r)},SideToSide:function(t,e,i,n,r){var s=t.view,l=n!=null&&n.length>0?n[0]:null,a=t.absolutePoints,o=a[0],u=a[a.length-1];if(l!=null&&(l=s.transformControlPoint(t,l)),o!=null&&(e=new mxCellState,e.x=o.x,e.y=o.y),u!=null&&(i=new mxCellState,i.x=u.x,i.y=u.y),e!=null&&i!=null){var p=Math.max(e.x,i.x),m=Math.min(e.x+e.width,i.x+i.width),d=l!=null?l.x:Math.round(m+(p-m)/2),x=s.getRoutingCenterY(e),f=s.getRoutingCenterY(i);if(l!=null&&(l.y>=e.y&&l.y<=e.y+e.height&&(x=l.y),l.y>=i.y&&l.y<=i.y+i.height&&(f=l.y)),!mxUtils.contains(i,d,x)&&!mxUtils.contains(e,d,x)&&r.push(new mxPoint(d,x)),!mxUtils.contains(i,d,f)&&!mxUtils.contains(e,d,f)&&r.push(new mxPoint(d,f)),r.length==1)if(l!=null)!mxUtils.contains(i,d,l.y)&&!mxUtils.contains(e,d,l.y)&&r.push(new mxPoint(d,l.y));else{var g=Math.max(e.y,i.y),c=Math.min(e.y+e.height,i.y+i.height);r.push(new mxPoint(d,g+(c-g)/2))}}},TopToBottom:function(t,e,i,n,r){var s=t.view,l=n!=null&&n.length>0?n[0]:null,a=t.absolutePoints,o=a[0],u=a[a.length-1];if(l!=null&&(l=s.transformControlPoint(t,l)),o!=null&&(e=new mxCellState,e.x=o.x,e.y=o.y),u!=null&&(i=new mxCellState,i.x=u.x,i.y=u.y),e!=null&&i!=null){var p=Math.max(e.y,i.y),m=Math.min(e.y+e.height,i.y+i.height),d=s.getRoutingCenterX(e);l!=null&&l.x>=e.x&&l.x<=e.x+e.width&&(d=l.x);var x=l!=null?l.y:Math.round(m+(p-m)/2);if(!mxUtils.contains(i,d,x)&&!mxUtils.contains(e,d,x)&&r.push(new mxPoint(d,x)),l!=null&&l.x>=i.x&&l.x<=i.x+i.width?d=l.x:d=s.getRoutingCenterX(i),!mxUtils.contains(i,d,x)&&!mxUtils.contains(e,d,x)&&r.push(new mxPoint(d,x)),r.length==1)if(l!=null&&r.length==1)!mxUtils.contains(i,l.x,x)&&!mxUtils.contains(e,l.x,x)&&r.push(new mxPoint(l.x,x));else{var f=Math.max(e.x,i.x),g=Math.min(e.x+e.width,i.x+i.width);r.push(new mxPoint(f+(g-f)/2,x))}}},SegmentConnector:function(t,e,i,n,r){var s=mxEdgeStyle.scalePointArray(t.absolutePoints,t.view.scale),l=mxEdgeStyle.scaleCellState(e,t.view.scale),a=mxEdgeStyle.scaleCellState(i,t.view.scale),o=1,u=r.length>0?r[0]:null,p=!0,m=null;function d(R){return R.x=Math.round(R.x*t.view.scale*10)/10,R.y=Math.round(R.y*t.view.scale*10)/10,(u==null||Math.abs(u.x-R.x)>=o||Math.abs(u.y-R.y)>=Math.max(1,t.view.scale))&&(r.push(R),u=R),u}var x=s[0];x==null&&l!=null?x=new mxPoint(t.view.getRoutingCenterX(l),t.view.getRoutingCenterY(l)):x!=null&&(x=x.clone());var f=s.length-1;if(n!=null&&n.length>0){for(var g=[],c=0;c=T.y&&L.y<=T.y+T.height,P=T!=null&&L.x>=T.x&&L.x<=T.x+T.width;if(S=M||C==null&&I,E=A||C==null&&P,!(c==0&&(S&&E||A&&M))){if(C!=null&&!M&&!A&&(I||P)){p=!I;break}if(E||S){p=S,c==1&&(p=g.length%2==0?S:E);break}}T=a,C=s[f],C!=null&&(T=null),L=g[g.length-1],A&&M&&(g=g.slice(1))}p&&(s[0]!=null&&s[0].y!=m.y||s[0]==null&&l!=null&&(m.yl.y+l.height))?d(new mxPoint(x.x,m.y)):!p&&(s[0]!=null&&s[0].x!=m.x||s[0]==null&&l!=null&&(m.xl.x+l.width))&&d(new mxPoint(m.x,x.y)),p?x.y=m.y:x.x=m.x;for(var c=0;ca.y+a.height))?d(new mxPoint(x.x,m.y)):!p&&(s[f]!=null&&s[f].x!=m.x||s[f]==null&&a!=null&&(m.xa.x+a.width))&&d(new mxPoint(m.x,x.y))),s[0]==null&&l!=null)for(;r.length>1&&r[1]!=null&&mxUtils.contains(l,r[1].x,r[1].y);)r.splice(1,1);if(s[f]==null&&a!=null)for(;r.length>1&&r[r.length-1]!=null&&mxUtils.contains(a,r[r.length-1].x,r[r.length-1].y);)r.splice(r.length-1,1);y!=null&&r[r.length-1]!=null&&Math.abs(y.x-r[r.length-1].x)<=o&&Math.abs(y.y-r[r.length-1].y)<=o&&(r.splice(r.length-1,1),r[r.length-1]!=null&&(Math.abs(r[r.length-1].x-y.x)0||l||a){mxEdgeStyle.SegmentConnector(t,e,i,n,r);return}var M=[mxConstants.DIRECTION_MASK_ALL,mxConstants.DIRECTION_MASK_ALL],I=0;if(u!=null&&(M[0]=mxUtils.getPortConstraints(u,t,!0,mxConstants.DIRECTION_MASK_ALL),I=mxUtils.getValue(u.style,mxConstants.STYLE_ROTATION,0),I!=0)){var P=mxUtils.getBoundingBox(new mxRectangle(x,f,g,c),I);x=P.x,f=P.y,g=P.width,c=P.height}if(p!=null&&(M[1]=mxUtils.getPortConstraints(p,t,!1,mxConstants.DIRECTION_MASK_ALL),I=mxUtils.getValue(p.style,mxConstants.STYLE_ROTATION,0),I!=0)){var P=mxUtils.getBoundingBox(new mxRectangle(v,y,T,C),I);v=P.x,y=P.y,T=P.width,C=P.height}for(var R=[0,0],O=[[x,f,g,c],[v,y,T,C]],_=[S,E],b=0;b<2;b++)mxEdgeStyle.limits[b][1]=O[b][0]-_[b],mxEdgeStyle.limits[b][2]=O[b][1]-_[b],mxEdgeStyle.limits[b][4]=O[b][0]+O[b][2]+_[b],mxEdgeStyle.limits[b][8]=O[b][1]+O[b][3]+_[b];var k=O[0][0]+O[0][2]/2,G=O[0][1]+O[0][3]/2,B=O[1][0]+O[1][2]/2,j=O[1][1]+O[1][3]/2,H=k-B,W=G-j,X=0;H<0?W<0?X=2:X=1:W<=0&&(X=3,H==0&&(X=2));var V=null;u!=null&&(V=m);for(var Y=[[.5,.5],[.5,.5]],b=0;b<2;b++)V!=null&&(Y[b][0]=(V.x-O[b][0])/O[b][2],Math.abs(V.x-O[b][0])<=1?R[b]=mxConstants.DIRECTION_MASK_WEST:Math.abs(V.x-O[b][0]-O[b][2])<=1&&(R[b]=mxConstants.DIRECTION_MASK_EAST),Y[b][1]=(V.y-O[b][1])/O[b][3],Math.abs(V.y-O[b][1])<=1?R[b]=mxConstants.DIRECTION_MASK_NORTH:Math.abs(V.y-O[b][1]-O[b][3])<=1&&(R[b]=mxConstants.DIRECTION_MASK_SOUTH)),V=null,p!=null&&(V=d);var et=O[0][1]-(O[1][1]+O[1][3]),q=O[0][0]-(O[1][0]+O[1][2]),K=O[1][1]-(O[0][1]+O[0][3]),Z=O[1][0]-(O[0][0]+O[0][2]);mxEdgeStyle.vertexSeperations[1]=Math.max(q-L,0),mxEdgeStyle.vertexSeperations[2]=Math.max(et-L,0),mxEdgeStyle.vertexSeperations[4]=Math.max(K-L,0),mxEdgeStyle.vertexSeperations[3]=Math.max(Z-L,0);var N=[],D=[],F=[];D[0]=q>=Z?mxConstants.DIRECTION_MASK_WEST:mxConstants.DIRECTION_MASK_EAST,F[0]=et>=K?mxConstants.DIRECTION_MASK_NORTH:mxConstants.DIRECTION_MASK_SOUTH,D[1]=mxUtils.reversePortConstraints(D[0]),F[1]=mxUtils.reversePortConstraints(F[0]);for(var st=q>=Z?q:Z,J=et>=K?et:K,U=[[0,0],[0,0]],$=!1,b=0;b<2;b++)R[b]==0&&((D[b]&M[b])==0&&(D[b]=mxUtils.reversePortConstraints(D[b])),(F[b]&M[b])==0&&(F[b]=mxUtils.reversePortConstraints(F[b])),U[b][0]=F[b],U[b][1]=D[b]);J>0&&st>0&&((D[0]&M[0])>0&&(F[1]&M[1])>0?(U[0][0]=D[0],U[0][1]=F[0],U[1][0]=F[1],U[1][1]=D[1],$=!0):(F[0]&M[0])>0&&(D[1]&M[1])>0&&(U[0][0]=F[0],U[0][1]=D[0],U[1][0]=D[1],U[1][1]=F[1],$=!0)),J>0&&!$&&(U[0][0]=F[0],U[0][1]=D[0],U[1][0]=F[1],U[1][1]=D[1],$=!0),st>0&&!$&&(U[0][0]=D[0],U[0][1]=F[0],U[1][0]=D[1],U[1][1]=F[1],$=!0);for(var b=0;b<2;b++)R[b]==0&&((U[b][0]&M[b])==0&&(U[b][0]=U[b][1]),N[b]=U[b][0]&M[b],N[b]|=(U[b][1]&M[b])<<8,N[b]|=(U[1-b][b]&M[b])<<16,N[b]|=(U[1-b][1-b]&M[b])<<24,(N[b]&15)==0&&(N[b]=N[b]<<8),(N[b]&3840)==0&&(N[b]=N[b]&15|N[b]>>8),(N[b]&983040)==0&&(N[b]=N[b]&65535|(N[b]&251658240)>>8),R[b]=N[b]&15,(M[b]==mxConstants.DIRECTION_MASK_WEST||M[b]==mxConstants.DIRECTION_MASK_NORTH||M[b]==mxConstants.DIRECTION_MASK_EAST||M[b]==mxConstants.DIRECTION_MASK_SOUTH)&&(R[b]=M[b]));var rt=R[0]==mxConstants.DIRECTION_MASK_EAST?3:R[0],tt=R[1]==mxConstants.DIRECTION_MASK_EAST?3:R[1];rt-=X,tt-=X,rt<1&&(rt+=4),tt<1&&(tt+=4);var Q=mxEdgeStyle.routePatterns[rt-1][tt-1];switch(mxEdgeStyle.wayPoints1[0][0]=O[0][0],mxEdgeStyle.wayPoints1[0][1]=O[0][1],R[0]){case mxConstants.DIRECTION_MASK_WEST:mxEdgeStyle.wayPoints1[0][0]-=S,mxEdgeStyle.wayPoints1[0][1]+=Y[0][1]*O[0][3];break;case mxConstants.DIRECTION_MASK_SOUTH:mxEdgeStyle.wayPoints1[0][0]+=Y[0][0]*O[0][2],mxEdgeStyle.wayPoints1[0][1]+=O[0][3]+S;break;case mxConstants.DIRECTION_MASK_EAST:mxEdgeStyle.wayPoints1[0][0]+=O[0][2]+S,mxEdgeStyle.wayPoints1[0][1]+=Y[0][1]*O[0][3];break;case mxConstants.DIRECTION_MASK_NORTH:mxEdgeStyle.wayPoints1[0][0]+=Y[0][0]*O[0][2],mxEdgeStyle.wayPoints1[0][1]-=S;break}for(var z=0,ut=(R[0]&(mxConstants.DIRECTION_MASK_EAST|mxConstants.DIRECTION_MASK_WEST))>0?0:1,mt=ut,it=0,b=0;b4&&(lt-=4);var ht=mxEdgeStyle.dirVectors[lt-1];it=lt%2>0?0:1,it!=ut&&(z++,mxEdgeStyle.wayPoints1[z][0]=mxEdgeStyle.wayPoints1[z-1][0],mxEdgeStyle.wayPoints1[z][1]=mxEdgeStyle.wayPoints1[z-1][1]);var vt=(Q[b]&mxEdgeStyle.TARGET_MASK)>0,ft=(Q[b]&mxEdgeStyle.SOURCE_MASK)>0,at=(Q[b]&mxEdgeStyle.SIDE_MASK)>>5;at=at<15&&(at=at>>4);var dt=(Q[b]&mxEdgeStyle.CENTER_MASK)>0;if((ft||vt)&&at<9){var pt=0,ot=ft?0:1;if(dt&&it==0?pt=O[ot][0]+Y[ot][0]*O[ot][2]:dt?pt=O[ot][1]+Y[ot][1]*O[ot][3]:pt=mxEdgeStyle.limits[ot][at],it==0){var yt=mxEdgeStyle.wayPoints1[z][0],gt=(pt-yt)*ht[0];gt>0&&(mxEdgeStyle.wayPoints1[z][0]+=ht[0]*gt)}else{var Ct=mxEdgeStyle.wayPoints1[z][1],ct=(pt-Ct)*ht[1];ct>0&&(mxEdgeStyle.wayPoints1[z][1]+=ht[1]*ct)}}else dt&&(mxEdgeStyle.wayPoints1[z][0]+=ht[0]*Math.abs(mxEdgeStyle.vertexSeperations[lt]/2),mxEdgeStyle.wayPoints1[z][1]+=ht[1]*Math.abs(mxEdgeStyle.vertexSeperations[lt]/2));z>0&&mxEdgeStyle.wayPoints1[z][it]==mxEdgeStyle.wayPoints1[z-1][it]?z--:ut=it}for(var b=0;b<=z;b++){if(b==z){var Et=(R[1]&(mxConstants.DIRECTION_MASK_EAST|mxConstants.DIRECTION_MASK_WEST))>0?0:1,St=Et==mt?0:1;if(St!=(z+1)%2)break}r.push(new mxPoint(Math.round(mxEdgeStyle.wayPoints1[b][0]*t.view.scale*10)/10,Math.round(mxEdgeStyle.wayPoints1[b][1]*t.view.scale*10)/10))}for(var nt=1;nt0){for(var i=this.graph.getModel(),n=0;n0||l.height>0){r=new mxPoint(e.x,e.y);var a=!1,o=!1;this.graph.model.isVertex(t.cell)&&(a=mxUtils.getValue(t.style,mxConstants.STYLE_FLIPH,0)==1,o=mxUtils.getValue(t.style,mxConstants.STYLE_FLIPV,0)==1,t.shape!=null&&t.shape.stencil!=null&&(a=mxUtils.getValue(t.style,"stencilFlipH",0)==1||a,o=mxUtils.getValue(t.style,"stencilFlipV",0)==1||o),a&&(r.x=2*l.getCenterX()-r.x),o&&(r.y=2*l.getCenterY()-r.y)),r=s(l,t,r,i),r!=null&&(a&&(r.x=2*l.getCenterX()-r.x),o&&(r.y=2*l.getCenterY()-r.y))}}r==null&&(r=this.getPoint(t))}return r},mxGraphView.prototype.getRoutingCenterX=function(t){var e=t.style!=null&&parseFloat(t.style[mxConstants.STYLE_ROUTING_CENTER_X])||0;return t.getCenterX()+e*t.width},mxGraphView.prototype.getRoutingCenterY=function(t){var e=t.style!=null&&parseFloat(t.style[mxConstants.STYLE_ROUTING_CENTER_Y])||0;return t.getCenterY()+e*t.height},mxGraphView.prototype.getPerimeterBounds=function(t,e){return e=e??0,t!=null&&(e+=parseFloat(t.style[mxConstants.STYLE_PERIMETER_SPACING]||0)),t.getPerimeterBounds(e*this.scale)},mxGraphView.prototype.getPerimeterFunction=function(t){var e=t.style[mxConstants.STYLE_PERIMETER];if(typeof e=="string"){var i=mxStyleRegistry.getValue(e);i==null&&this.isAllowEval()&&(i=mxUtils.eval(e)),e=i}return typeof e=="function"?e:null},mxGraphView.prototype.getNextPoint=function(t,e,i){var n=t.absolutePoints,r=null;if(n!=null&&n.length>=2){var s=n.length;r=n[i?Math.min(1,s-1):Math.max(0,s-2)]}return r==null&&e!=null&&(r=new mxPoint(e.getCenterX(),e.getCenterY())),r},mxGraphView.prototype.getVisibleTerminal=function(t,e){for(var i=this.graph.getModel(),n=i.getTerminal(t,e),r=n;n!=null&&n!=this.currentRoot;)(!this.graph.isCellVisible(r)||this.isCellCollapsed(n))&&(r=n),n=i.getParent(n);return r!=null&&(!i.contains(r)||i.getParent(r)==i.getRoot()||r==this.currentRoot)&&(r=null),r},mxGraphView.prototype.updateEdgeBounds=function(t){var e=t.absolutePoints,i=e[0],n=e[e.length-1];if(i.x!=n.x||i.y!=n.y){var r=n.x-i.x,s=n.y-i.y;t.terminalDistance=Math.sqrt(r*r+s*s)}else t.terminalDistance=0;var l=0,a=[],o=i;if(o!=null){for(var u=o.x,p=o.y,m=u,d=p,x=1;x=Math.round(o+a)&&u1){for(var l=t.length,a=t.segments,o=t.absolutePoints[0],u=t.absolutePoints[1],p=mxUtils.ptSegDistSq(o.x,o.y,u.x,u.y,e,i),m=0,d=0,x=0,f=2;fc&&(P=c);var R=Math.sqrt(mxUtils.ptSegDistSq(o.x,o.y,u.x,u.y,e,i)),O=mxUtils.relativeCcw(o.x,o.y,u.x,u.y,e,i);return O==-1&&(R=-R),new mxPoint((l/2-x-P)/l*-2,R/this.scale)}}return new mxPoint},mxGraphView.prototype.updateEdgeLabelOffset=function(t){var e=t.absolutePoints;if(t.absoluteOffset.x=t.getCenterX(),t.absoluteOffset.y=t.getCenterY(),e!=null&&e.length>0&&t.segments!=null){var i=this.graph.getCellGeometry(t.cell);if(i.relative){var n=this.getPoint(t,i);n!=null&&(t.absoluteOffset=n)}else{var r=e[0],s=e[e.length-1];if(r!=null&&s!=null){var l=s.x-r.x,a=s.y-r.y,o=0,u=0,p=i.offset;p!=null&&(o=p.x,u=p.y);var m=r.x+l/2+o*this.scale,d=r.y+a/2+u*this.scale;t.absoluteOffset.x=m,t.absoluteOffset.y=d}}}},mxGraphView.prototype.getState=function(t,e){e=e||!1;var i=null;return t!=null&&(i=this.states.get(t),e&&(i==null||this.updateStyle)&&this.graph.isCellVisible(t)&&(i==null?(i=this.createState(t),this.states.put(t,i)):i.style=this.graph.getCellStyle(t))),i},mxGraphView.prototype.isRendering=function(){return this.rendering},mxGraphView.prototype.setRendering=function(t){this.rendering=t},mxGraphView.prototype.isAllowEval=function(){return this.allowEval},mxGraphView.prototype.setAllowEval=function(t){this.allowEval=t},mxGraphView.prototype.getStates=function(){return this.states},mxGraphView.prototype.setStates=function(t){this.states=t},mxGraphView.prototype.getCellStates=function(t){if(t==null)return this.states;for(var e=[],i=0;ir&&i.x>r+2&&i.x<=n)return!0;var s=this.graph.container.offsetHeight,l=this.graph.container.clientHeight;return s>l&&i.y>l+2&&i.y<=s},mxGraphView.prototype.init=function(){this.installListeners();var t=this.graph;t.dialect==mxConstants.DIALECT_SVG?this.createSvg():t.dialect==mxConstants.DIALECT_VML?this.createVml():this.createHtml()},mxGraphView.prototype.installListeners=function(){var t=this.graph,e=t.container;if(e!=null){mxClient.IS_TOUCH&&(mxEvent.addListener(e,"gesturestart",mxUtils.bind(this,function(r){t.fireGestureEvent(r),mxEvent.consume(r)})),mxEvent.addListener(e,"gesturechange",mxUtils.bind(this,function(r){t.fireGestureEvent(r),mxEvent.consume(r)})),mxEvent.addListener(e,"gestureend",mxUtils.bind(this,function(r){t.fireGestureEvent(r),mxEvent.consume(r)})));var i=null;mxEvent.addGestureListeners(e,mxUtils.bind(this,function(r){this.isContainerEvent(r)&&(!mxClient.IS_IE&&!mxClient.IS_IE11&&!mxClient.IS_GC&&!mxClient.IS_OP&&!mxClient.IS_SF||!this.isScrollEvent(r))&&(t.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(r)),i=r.pointerId)}),mxUtils.bind(this,function(r){this.isContainerEvent(r)&&(i==null||r.pointerId==i)&&t.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(r))}),mxUtils.bind(this,function(r){this.isContainerEvent(r)&&t.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(r)),i=null})),mxEvent.addListener(e,"dblclick",mxUtils.bind(this,function(r){this.isContainerEvent(r)&&t.dblClick(r)}));var n=function(r){var s=null;if(mxClient.IS_TOUCH){var l=mxEvent.getClientX(r),a=mxEvent.getClientY(r),o=mxUtils.convertPoint(e,l,a);s=t.view.getState(t.getCellAt(o.x,o.y))}return s};t.addMouseListener({mouseDown:function(r,s){t.popupMenuHandler.hideMenu()},mouseMove:function(){},mouseUp:function(){}}),this.moveHandler=mxUtils.bind(this,function(r){t.tooltipHandler!=null&&t.tooltipHandler.isHideOnHover()&&t.tooltipHandler.hide(),this.captureDocumentGesture&&t.isMouseDown&&t.container!=null&&!this.isContainerEvent(r)&&t.container.style.display!="none"&&t.container.style.visibility!="hidden"&&!mxEvent.isConsumed(r)&&t.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(r,n(r)))}),this.endHandler=mxUtils.bind(this,function(r){this.captureDocumentGesture&&t.isMouseDown&&t.container!=null&&!this.isContainerEvent(r)&&t.container.style.display!="none"&&t.container.style.visibility!="hidden"&&t.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(r))}),mxEvent.addGestureListeners(document,null,this.moveHandler,this.endHandler)}},mxGraphView.prototype.createHtml=function(){var t=this.graph.container;if(t!=null&&(this.canvas=this.createHtmlPane("100%","100%"),this.canvas.style.overflow="hidden",this.backgroundPane=this.createHtmlPane("1px","1px"),this.drawPane=this.createHtmlPane("1px","1px"),this.overlayPane=this.createHtmlPane("1px","1px"),this.decoratorPane=this.createHtmlPane("1px","1px"),this.canvas.appendChild(this.backgroundPane),this.canvas.appendChild(this.drawPane),this.canvas.appendChild(this.overlayPane),this.canvas.appendChild(this.decoratorPane),t.appendChild(this.canvas),this.updateContainerStyle(t),mxClient.IS_QUIRKS)){var e=mxUtils.bind(this,function(i){var n=this.getGraphBounds(),r=n.x+n.width+this.graph.border,s=n.y+n.height+this.graph.border;this.updateHtmlCanvasSize(r,s)});mxEvent.addListener(window,"resize",e)}},mxGraphView.prototype.updateHtmlCanvasSize=function(t,e){if(this.graph.container!=null){var i=this.graph.container.offsetWidth,n=this.graph.container.offsetHeight;i")},mxGraph.prototype.createHandlers=function(){this.tooltipHandler=this.createTooltipHandler(),this.tooltipHandler.setEnabled(!1),this.selectionCellsHandler=this.createSelectionCellsHandler(),this.connectionHandler=this.createConnectionHandler(),this.connectionHandler.setEnabled(!1),this.graphHandler=this.createGraphHandler(),this.panningHandler=this.createPanningHandler(),this.panningHandler.panningEnabled=!1,this.popupMenuHandler=this.createPopupMenuHandler()},mxGraph.prototype.createTooltipHandler=function(){return new mxTooltipHandler(this)},mxGraph.prototype.createSelectionCellsHandler=function(){return new mxSelectionCellsHandler(this)},mxGraph.prototype.createConnectionHandler=function(){return new mxConnectionHandler(this)},mxGraph.prototype.createGraphHandler=function(){return new mxGraphHandler(this)},mxGraph.prototype.createPanningHandler=function(){return new mxPanningHandler(this)},mxGraph.prototype.createPopupMenuHandler=function(){return new mxPopupMenuHandler(this)},mxGraph.prototype.createSelectionModel=function(){return new mxGraphSelectionModel(this)},mxGraph.prototype.createStylesheet=function(){return new mxStylesheet},mxGraph.prototype.createGraphView=function(){return new mxGraphView(this)},mxGraph.prototype.createCellRenderer=function(){return new mxCellRenderer},mxGraph.prototype.createCellEditor=function(){return new mxCellEditor(this)},mxGraph.prototype.getModel=function(){return this.model},mxGraph.prototype.getView=function(){return this.view},mxGraph.prototype.getStylesheet=function(){return this.stylesheet},mxGraph.prototype.setStylesheet=function(t){this.stylesheet=t},mxGraph.prototype.getSelectionModel=function(){return this.selectionModel},mxGraph.prototype.setSelectionModel=function(t){this.selectionModel=t},mxGraph.prototype.getSelectionCellsForChanges=function(t,e){for(var i=new mxDictionary,n=[],r=mxUtils.bind(this,function(o){if(!i.get(o)&&this.model.contains(o))if(this.model.isEdge(o)||this.model.isVertex(o))i.put(o,!0),n.push(o);else for(var u=this.model.getChildCount(o),p=0;p=0){t.overlays.splice(i,1),t.overlays.length==0&&(t.overlays=null);var n=this.view.getState(t);n!=null&&this.cellRenderer.redraw(n),this.fireEvent(new mxEventObject(mxEvent.REMOVE_OVERLAY,"cell",t,"overlay",e))}else e=null}return e},mxGraph.prototype.removeCellOverlays=function(t){var e=t.overlays;if(e!=null){t.overlays=null;var i=this.view.getState(t);i!=null&&this.cellRenderer.redraw(i);for(var n=0;n0){i=i??this.warningImage;var r=new mxCellOverlay(i,""+e+"");return n&&r.addListener(mxEvent.CLICK,mxUtils.bind(this,function(s,l){this.isEnabled()&&this.setSelectionCell(t)})),this.addCellOverlay(t,r)}else this.removeCellOverlays(t);return null},mxGraph.prototype.startEditing=function(t){this.startEditingAtCell(null,t)},mxGraph.prototype.startEditingAtCell=function(t,e){(e==null||!mxEvent.isMultiTouchEvent(e))&&(t==null&&(t=this.getSelectionCell(),t!=null&&!this.isCellEditable(t)&&(t=null)),t!=null&&(this.fireEvent(new mxEventObject(mxEvent.START_EDITING,"cell",t,"event",e)),this.cellEditor.startEditing(t,e),this.fireEvent(new mxEventObject(mxEvent.EDITING_STARTED,"cell",t,"event",e))))},mxGraph.prototype.getEditingValue=function(t,e){return this.convertValueToString(t)},mxGraph.prototype.stopEditing=function(t){this.cellEditor.stopEditing(t),this.fireEvent(new mxEventObject(mxEvent.EDITING_STOPPED,"cancel",t))},mxGraph.prototype.labelChanged=function(t,e,i){this.model.beginUpdate();try{var n=t.value;this.cellLabelChanged(t,e,this.isAutoSizeCell(t)),this.fireEvent(new mxEventObject(mxEvent.LABEL_CHANGED,"cell",t,"value",e,"old",n,"event",i))}finally{this.model.endUpdate()}return t},mxGraph.prototype.cellLabelChanged=function(t,e,i){this.model.beginUpdate();try{this.model.setValue(t,e),i&&this.cellSizeUpdated(t,!1)}finally{this.model.endUpdate()}},mxGraph.prototype.escape=function(t){this.fireEvent(new mxEventObject(mxEvent.ESCAPE,"event",t))},mxGraph.prototype.click=function(t){var e=t.getEvent(),i=t.getCell(),n=new mxEventObject(mxEvent.CLICK,"event",e,"cell",i);if(t.isConsumed()&&n.consume(),this.fireEvent(n),this.isEnabled()&&!mxEvent.isConsumed(e)&&!n.isConsumed()){if(i!=null){if(this.isTransparentClickEvent(e)){var r=!1,s=this.getCellAt(t.graphX,t.graphY,null,null,null,mxUtils.bind(this,function(p){var m=this.isCellSelected(p.cell);return r=r||m,!r||m||p.cell!=i&&this.model.isAncestor(p.cell,i)}));s!=null&&(i=s)}}else if(this.isSwimlaneSelectionEnabled()&&(i=this.getSwimlaneAt(t.getGraphX(),t.getGraphY()),i!=null&&(!this.isToggleEvent(e)||!mxEvent.isAltDown(e)))){for(var l=i,a=[];l!=null;){l=this.model.getParent(l);var o=this.view.getState(l);this.isSwimlane(l)&&o!=null&&a.push(l)}if(a.length>0){a=a.reverse(),a.splice(0,0,i),a.push(i);for(var u=0;u=r.scrollLeft&&e>=r.scrollTop&&t<=r.scrollLeft+r.clientWidth&&e<=r.scrollTop+r.clientHeight){var s=r.scrollLeft+r.clientWidth-t;if(s0&&p.height>0){e&&p.x!=null&&p.y!=null&&(p=p.clone(),p.width+=p.x,p.height+=p.y,p.x=0,p.y=0);var m=this.view.scale,d=p.width/m,x=p.height/m;this.backgroundImage!=null&&(d=Math.max(d,this.backgroundImage.width-p.x/m),x=Math.max(x,this.backgroundImage.height-p.y/m));var f=(e?t:2*t)+i+1;o-=f,u-=f;var g=r?u/x:s?o/d:Math.min(o/d,u/x);if(this.minFitScale!=null&&(g=Math.max(g,this.minFitScale)),this.maxFitScale!=null&&(g=Math.min(g,this.maxFitScale)),n)if(e)this.view.scale!=g&&this.view.setScale(g);else if(mxUtils.hasScrollbars(this.container)){this.view.setScale(g);var y=this.getGraphBounds();y.x!=null&&(this.container.scrollLeft=y.x),y.y!=null&&(this.container.scrollTop=y.y)}else{var c=p.x!=null?Math.floor(this.view.translate.x-p.x/m+t/g+i/2):t,v=p.y!=null?Math.floor(this.view.translate.y-p.y/m+t/g+i/2):t;this.view.scaleAndTranslate(g,c,v)}else return g}}return this.view.scale},mxGraph.prototype.sizeDidChange=function(){var t=this.getGraphBounds();if(this.container!=null){var e=this.getBorder(),i=Math.max(0,t.x)+t.width+2*e,n=Math.max(0,t.y)+t.height+2*e;if(this.minimumContainerSize!=null&&(i=Math.max(i,this.minimumContainerSize.width),n=Math.max(n,this.minimumContainerSize.height)),this.resizeContainer&&this.doResizeContainer(i,n),this.preferPageSize||!mxClient.IS_IE&&this.pageVisible){var r=this.getPreferredPageSize(t,Math.max(1,i),Math.max(1,n));r!=null&&(i=r.width*this.view.scale,n=r.height*this.view.scale)}if(this.minimumGraphSize!=null&&(i=Math.max(i,this.minimumGraphSize.width*this.view.scale),n=Math.max(n,this.minimumGraphSize.height*this.view.scale)),i=Math.ceil(i),n=Math.ceil(n),this.dialect==mxConstants.DIALECT_SVG){var s=this.view.getDrawPane().ownerSVGElement;s!=null&&(s.style.minWidth=Math.max(1,i)+"px",s.style.minHeight=Math.max(1,n)+"px",s.style.width="100%",s.style.height="100%")}else mxClient.IS_QUIRKS?this.view.updateHtmlCanvasSize(Math.max(1,i),Math.max(1,n)):(this.view.canvas.style.minWidth=Math.max(1,i)+"px",this.view.canvas.style.minHeight=Math.max(1,n)+"px");this.updatePageBreaks(this.pageBreaksVisible,i,n)}this.fireEvent(new mxEventObject(mxEvent.SIZE,"bounds",t))},mxGraph.prototype.doResizeContainer=function(t,e){this.maximumContainerSize!=null&&(t=Math.min(this.maximumContainerSize.width,t),e=Math.min(this.maximumContainerSize.height,e)),this.container.style.width=Math.ceil(t)+"px",this.container.style.height=Math.ceil(e)+"px"},mxGraph.prototype.updatePageBreaks=function(t,e,i){var n=this.view.scale,r=this.view.translate,s=this.pageFormat,l=n*this.pageScale,a=new mxRectangle(0,0,s.width*l,s.height*l),o=mxRectangle.fromRectangle(this.getGraphBounds());o.width=Math.max(1,o.width),o.height=Math.max(1,o.height),a.x=Math.floor((o.x-r.x*n)/a.width)*a.width+r.x*n,a.y=Math.floor((o.y-r.y*n)/a.height)*a.height+r.y*n,o.width=Math.ceil((o.width+(o.x-a.x))/a.width)*a.width,o.height=Math.ceil((o.height+(o.y-a.y))/a.height)*a.height,t=t&&Math.min(a.width,a.height)>this.minPageBreakDist;var u=t?Math.ceil(o.height/a.height)+1:0,p=t?Math.ceil(o.width/a.width)+1:0,m=(p-1)*a.width,d=(u-1)*a.height;this.horizontalPageBreaks==null&&u>0&&(this.horizontalPageBreaks=[]),this.verticalPageBreaks==null&&p>0&&(this.verticalPageBreaks=[]);var x=mxUtils.bind(this,function(f){if(f!=null){for(var g=f==this.horizontalPageBreaks?u:p,c=0;c<=g;c++){var v=f==this.horizontalPageBreaks?[new mxPoint(Math.round(a.x),Math.round(a.y+c*a.height)),new mxPoint(Math.round(a.x+m),Math.round(a.y+c*a.height))]:[new mxPoint(Math.round(a.x+c*a.width),Math.round(a.y)),new mxPoint(Math.round(a.x+c*a.width),Math.round(a.y+d))];if(f[c]!=null)f[c].points=v,f[c].redraw();else{var y=new mxPolyline(v,this.pageBreakColor);y.dialect=this.dialect,y.pointerEvents=!1,y.isDashed=this.pageBreakDashed,y.init(this.view.backgroundPane),y.redraw(),f[c]=y}}for(var c=g;c0&&i.substring(n-7,n+1)!=";base64,"&&(i=i.substring(0,n)+";base64,"+i.substring(n+1))}t[mxConstants.STYLE_IMAGE]=i}}return t},mxGraph.prototype.setCellStyle=function(t,e){if(e=e||this.getSelectionCells(),e!=null){this.model.beginUpdate();try{for(var i=0;i0){var r=this.getCurrentCellStyle(i[0]);n=mxUtils.getValue(r,t,e)?0:1,this.setCellStyles(t,n,i)}return n},mxGraph.prototype.setCellStyles=function(t,e,i){i=i||this.getSelectionCells(),mxUtils.setCellStyles(this.model,i,t,e)},mxGraph.prototype.toggleCellStyleFlags=function(t,e,i){this.setCellStyleFlags(t,e,null,i)},mxGraph.prototype.setCellStyleFlags=function(t,e,i,n){if(n=n||this.getSelectionCells(),n!=null&&n.length>0){if(i==null){var r=this.getCurrentCellStyle(n[0]),s=parseInt(r[t]||0);i=(s&e)!=e}mxUtils.setCellStyleFlags(this.model,n,t,e,i)}},mxGraph.prototype.alignCells=function(t,e,i){if(e==null&&(e=this.getSelectionCells()),e!=null&&e.length>1){if(i==null)for(var n=0;n1&&n!=null){var r=this.model.getParent(t);r==null&&(r=this.model.getParent(i[0])),this.model.beginUpdate();try{this.getCellGeometry(t)==null&&this.model.setGeometry(t,new mxGeometry);var s=this.model.getChildCount(r);this.cellsAdded([t],r,s,null,null,!1,!1,!1),s=this.model.getChildCount(t),this.cellsAdded(i,t,s,null,null,!1,!1,!1),this.cellsMoved(i,-n.x,-n.y,!1,!1,!1),this.cellsResized([t],[n],!1),this.fireEvent(new mxEventObject(mxEvent.GROUP_CELLS,"group",t,"border",e,"cells",i))}finally{this.model.endUpdate()}}return t},mxGraph.prototype.getCellsForGroup=function(t){var e=[];if(t!=null&&t.length>0){var i=this.model.getParent(t[0]);e.push(t[0]);for(var n=1;n0){this.model.beginUpdate();try{for(var i=0;i0){n=n.slice();var r=this.model.getParent(t[i]),s=this.model.getChildCount(r);this.cellsAdded(n,r,s,null,null,!0),e=e.concat(n);for(var l=0;l0&&e.push(t[i]);return e},mxGraph.prototype.removeCellsAfterUngroup=function(t){this.cellsRemoved(this.addAllEdges(t))},mxGraph.prototype.removeCellsFromParent=function(t){t==null&&(t=this.getSelectionCells()),this.model.beginUpdate();try{var e=this.getDefaultParent(),i=this.model.getChildCount(e);this.cellsAdded(t,e,i,null,null,!0),this.fireEvent(new mxEventObject(mxEvent.REMOVE_CELLS_FROM_PARENT,"cells",t))}finally{this.model.endUpdate()}return t},mxGraph.prototype.updateGroupBounds=function(t,e,i,n,r,s,l){t==null&&(t=this.getSelectionCells()),e=e??0,i=i??!1,n=n??0,r=r??0,s=s??0,l=l??0,this.model.beginUpdate();try{for(var a=t.length-1;a>=0;a--){var o=this.getCellGeometry(t[a]);if(o!=null){var u=this.getChildCells(t[a]);if(u!=null&&u.length>0){var p=this.getBoundingBoxFromGeometry(u,!0);if(p!=null&&p.width>0&&p.height>0){var m=this.isSwimlane(t[a])?this.getActualStartSize(t[a],!0):new mxRectangle;o=o.clone(),i&&(o.x=Math.round(o.x+p.x-e-m.x-l),o.y=Math.round(o.y+p.y-e-m.y-n)),o.width=Math.round(p.width+2*e+m.x+l+r+m.width),o.height=Math.round(p.height+2*e+m.y+n+s+m.height),this.model.setGeometry(t[a],o),this.moveCells(u,e+m.x-p.x+l,e+m.y-p.y+n)}}}}}finally{this.model.endUpdate()}return t},mxGraph.prototype.getBoundingBox=function(t){var e=null;if(t!=null&&t.length>0){for(var i=0;i0){var o=this.view.scale,u=this.view.translate;r=this.model.cloneCells(t,!0,i);for(var a=0;athis.model.getChildCount(e)&&i--,this.model.add(e,t[m],i+m),this.autoSizeCellsOnAdd&&this.autoSizeCell(t[m],!0),(a==null||a)&&this.isExtendParentsOnAdd(t[m])&&this.isExtendParent(t[m])&&this.extendParent(t[m]),(l==null||l)&&this.constrainChild(t[m]),n!=null&&this.cellConnected(t[m],n,!0),r!=null&&this.cellConnected(t[m],r,!1)}this.fireEvent(new mxEventObject(mxEvent.CELLS_ADDED,"cells",t,"parent",e,"index",i,"source",n,"target",r,"absolute",s))}finally{this.model.endUpdate()}}},mxGraph.prototype.autoSizeCell=function(t,e){if(e=e??!0,e)for(var i=this.model.getChildCount(t),n=0;n0){var e=this.view.scale,i=this.view.translate;this.model.beginUpdate();try{for(var n=new mxDictionary,r=0;r0){this.model.beginUpdate();try{for(var i=0;i0){this.model.beginUpdate();try{for(var r=0;r0&&(r.height=Math.max(r.height,l))}}e.alternateBounds=new mxRectangle(0,0,r.width,r.height)}if(e.alternateBounds!=null){e.alternateBounds.x=e.x,e.alternateBounds.y=e.y;var a=mxUtils.toRadians(n[mxConstants.STYLE_ROTATION]||0);if(a!=0){var o=e.alternateBounds.getCenterX()-e.getCenterX(),u=e.alternateBounds.getCenterY()-e.getCenterY(),p=Math.cos(a),m=Math.sin(a),d=p*o-m*u,x=m*o+p*u;e.alternateBounds.x+=d-o,e.alternateBounds.y+=x-u}}}},mxGraph.prototype.addAllEdges=function(t){var e=t.slice();return mxUtils.removeDuplicates(e.concat(this.getAllEdges(t)))},mxGraph.prototype.getAllEdges=function(t){var e=[];if(t!=null)for(var i=0;i0){this.isHtmlLabel(n.cell)||(u=mxUtils.htmlEntities(u,!1)),u=u.replace(/\n/g,"
");var p=mxUtils.getSizeForString(u,s,r[mxConstants.STYLE_FONTFAMILY],e,r[mxConstants.STYLE_FONTSTYLE]),m=p.width+l,d=p.height+a;if(!mxUtils.getValue(r,mxConstants.STYLE_HORIZONTAL,!0)){var x=d;d=m,m=x}this.gridEnabled&&(m=this.snap(m+this.gridSize/2),d=this.snap(d+this.gridSize/2)),i=new mxRectangle(0,0,m,d)}else{var f=4*this.gridSize;i=new mxRectangle(0,0,f,f)}}}return i},mxGraph.prototype.resizeCell=function(t,e,i){return this.resizeCells([t],[e],i)[0]},mxGraph.prototype.resizeCells=function(t,e,i){i=i??this.isRecursiveResize(),this.model.beginUpdate();try{var n=this.cellsResized(t,e,i);this.fireEvent(new mxEventObject(mxEvent.RESIZE_CELLS,"cells",t,"bounds",e,"previous",n))}finally{this.model.endUpdate()}return t},mxGraph.prototype.cellsResized=function(t,e,i){i=i??!1;var n=[];if(t!=null&&e!=null&&t.length==e.length){this.model.beginUpdate();try{for(var r=0;r0&&(l=mxRectangle.fromRectangle(l),l.x-=l.width*a,l.y-=l.height*a,l.width+=2*l.width*a,l.height+=2*l.height*a),r==null?r=l:(r=mxRectangle.fromRectangle(r),r.intersect(l))}}if(r!=null){var o=[t];if(!this.isCellCollapsed(t))for(var u=this.model.getDescendants(t),p=0;pr.width&&(d=i.width-r.width,i.width-=d),m.x+m.width>r.x+r.width&&(d-=m.x+m.width-r.x-r.width-d);var x=0;i.height>r.height&&(x=i.height-r.height,i.height-=x),m.y+m.height>r.y+r.height&&(x-=m.y+m.height-r.y-r.height-x),m.x0&&(e=e.clone(),e.points=[],this.model.setGeometry(t,e)),t},mxGraph.prototype.getOutlineConstraint=function(t,e,i){if(e.shape!=null){var n=this.view.getPerimeterBounds(e),r=e.style[mxConstants.STYLE_DIRECTION];if(r==mxConstants.DIRECTION_NORTH||r==mxConstants.DIRECTION_SOUTH){n.x+=n.width/2-n.height/2,n.y+=n.height/2-n.width/2;var s=n.width;n.width=n.height,n.height=s}var l=mxUtils.toRadians(e.shape.getShapeRotation());if(l!=0){var a=Math.cos(-l),o=Math.sin(-l),u=new mxPoint(n.getCenterX(),n.getCenterY());t=mxUtils.getRotatedPoint(t,a,o,u)}var p=1,m=1,d=0,x=0;if(this.getModel().isVertex(e.cell)){var f=e.style[mxConstants.STYLE_FLIPH],g=e.style[mxConstants.STYLE_FLIPV];if(e.shape!=null&&e.shape.stencil!=null&&(f=mxUtils.getValue(e.style,"stencilFlipH",0)==1||f,g=mxUtils.getValue(e.style,"stencilFlipV",0)==1||g),r==mxConstants.DIRECTION_NORTH||r==mxConstants.DIRECTION_SOUTH){var s=f;f=g,g=s}f&&(p=-1,d=-n.width),g&&(m=-1,x=-n.height)}t=new mxPoint((t.x-n.x)*p-d+n.x,(t.y-n.y)*m-x+n.y);var c=n.width==0?0:Math.round((t.x-n.x)*1e3/n.width)/1e3,v=n.height==0?0:Math.round((t.y-n.y)*1e3/n.height)/1e3;return new mxConnectionConstraint(new mxPoint(c,v),!1)}return null},mxGraph.prototype.getAllConnectionConstraints=function(t,e){return t!=null&&t.shape!=null&&t.shape.stencil!=null?t.shape.stencil.constraints:null},mxGraph.prototype.getConnectionConstraint=function(t,e,i){var n=null,r=t.style[i?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X];if(r!=null){var s=t.style[i?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y];s!=null&&(n=new mxPoint(parseFloat(r),parseFloat(s)))}var l=!1,a=0,o=0;return n!=null&&(l=mxUtils.getValue(t.style,i?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,!0),a=parseFloat(t.style[i?mxConstants.STYLE_EXIT_DX:mxConstants.STYLE_ENTRY_DX]),o=parseFloat(t.style[i?mxConstants.STYLE_EXIT_DY:mxConstants.STYLE_ENTRY_DY]),a=isFinite(a)?a:0,o=isFinite(o)?o:0),new mxConnectionConstraint(n,l,null,a,o)},mxGraph.prototype.setConnectionConstraint=function(t,e,i,n){if(n!=null){this.model.beginUpdate();try{n==null||n.point==null?(this.setCellStyles(i?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X,null,[t]),this.setCellStyles(i?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y,null,[t]),this.setCellStyles(i?mxConstants.STYLE_EXIT_DX:mxConstants.STYLE_ENTRY_DX,null,[t]),this.setCellStyles(i?mxConstants.STYLE_EXIT_DY:mxConstants.STYLE_ENTRY_DY,null,[t]),this.setCellStyles(i?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,null,[t])):n.point!=null&&(this.setCellStyles(i?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X,n.point.x,[t]),this.setCellStyles(i?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y,n.point.y,[t]),this.setCellStyles(i?mxConstants.STYLE_EXIT_DX:mxConstants.STYLE_ENTRY_DX,n.dx,[t]),this.setCellStyles(i?mxConstants.STYLE_EXIT_DY:mxConstants.STYLE_ENTRY_DY,n.dy,[t]),n.perimeter?this.setCellStyles(i?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,null,[t]):this.setCellStyles(i?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,"0",[t]))}finally{this.model.endUpdate()}}},mxGraph.prototype.getConnectionPoint=function(t,e,i){i=i??!0;var n=null;if(t!=null&&e.point!=null){var r=this.view.getPerimeterBounds(t),s=new mxPoint(r.getCenterX(),r.getCenterY()),l=t.style[mxConstants.STYLE_DIRECTION],a=0;l!=null&&mxUtils.getValue(t.style,mxConstants.STYLE_ANCHOR_POINT_DIRECTION,1)==1&&(l==mxConstants.DIRECTION_NORTH?a+=270:l==mxConstants.DIRECTION_WEST?a+=180:l==mxConstants.DIRECTION_SOUTH&&(a+=90),(l==mxConstants.DIRECTION_NORTH||l==mxConstants.DIRECTION_SOUTH)&&r.rotate90());var o=this.view.scale;n=new mxPoint(r.x+e.point.x*r.width+e.dx*o,r.y+e.point.y*r.height+e.dy*o);var u=t.style[mxConstants.STYLE_ROTATION]||0;if(e.perimeter){if(a!=0){var p=0,m=0;a==90?m=1:a==180?p=-1:a==270&&(m=-1),n=mxUtils.getRotatedPoint(n,p,m,s)}n=this.view.getPerimeterPoint(t,n,!1)}else if(u+=a,this.getModel().isVertex(t.cell)){var d=t.style[mxConstants.STYLE_FLIPH]==1,x=t.style[mxConstants.STYLE_FLIPV]==1;if(t.shape!=null&&t.shape.stencil!=null&&(d=mxUtils.getValue(t.style,"stencilFlipH",0)==1||d,x=mxUtils.getValue(t.style,"stencilFlipV",0)==1||x),l==mxConstants.DIRECTION_NORTH||l==mxConstants.DIRECTION_SOUTH){var f=d;d=x,x=f}d&&(n.x=2*r.getCenterX()-n.x),x&&(n.y=2*r.getCenterY()-n.y)}if(u!=0&&n!=null){var g=mxUtils.toRadians(u),p=Math.cos(g),m=Math.sin(g);n=mxUtils.getRotatedPoint(n,p,m,s)}}return i&&n!=null&&(n.x=Math.round(n.x),n.y=Math.round(n.y)),n},mxGraph.prototype.connectCell=function(t,e,i,n){this.model.beginUpdate();try{var r=this.model.getTerminal(t,i);this.cellConnected(t,e,i,n),this.fireEvent(new mxEventObject(mxEvent.CONNECT_CELL,"edge",t,"terminal",e,"source",i,"previous",r))}finally{this.model.endUpdate()}return t},mxGraph.prototype.cellConnected=function(t,e,i,n){if(t!=null){this.model.beginUpdate();try{var r=this.model.getTerminal(t,i);if(this.setConnectionConstraint(t,e,i,n),this.isPortsEnabled()){var s=null;this.isPort(e)&&(s=e.getId(),e=this.getTerminalForPort(e,i));var l=i?mxConstants.STYLE_SOURCE_PORT:mxConstants.STYLE_TARGET_PORT;this.setCellStyles(l,s,[t])}this.model.setTerminal(t,e,i),this.resetEdgesOnConnect&&this.resetEdge(t),this.fireEvent(new mxEventObject(mxEvent.CELL_CONNECTED,"edge",t,"terminal",e,"source",i,"previous",r))}finally{this.model.endUpdate()}}},mxGraph.prototype.disconnectGraph=function(t){if(t!=null){this.model.beginUpdate();try{for(var e=this.view.scale,i=this.view.translate,n=new mxDictionary,r=0;r0)for(var o=new mxRectangle(a[0].x,a[0].y,0,0),u=1;u=0&&(s.x+=o.x,s.y+=o.y))}}else if(s=mxRectangle.fromRectangle(r),this.model.isVertex(p)&&mxUtils.indexOf(t,p)>=0){var o=this.getBoundingBoxFromGeometry([p],!1);o!=null&&(s.x+=o.x,s.y+=o.y)}s!=null&&r.offset!=null&&(s.x+=r.offset.x,s.y+=r.offset.y);var m=this.getCurrentCellStyle(t[n]);if(s!=null){var d=mxUtils.getValue(m,mxConstants.STYLE_ROTATION,0);d!=0&&(s=mxUtils.getBoundingBox(s,d))}}s!=null&&(i==null?i=mxRectangle.fromRectangle(s):i.add(s))}}}return i},mxGraph.prototype.refresh=function(t){this.view.clear(t,t==null),this.view.validate(),this.sizeDidChange(),this.fireEvent(new mxEventObject(mxEvent.REFRESH))},mxGraph.prototype.snap=function(t){return this.gridEnabled&&(t=Math.round(t/this.gridSize)*this.gridSize),t},mxGraph.prototype.snapDelta=function(t,e,i,n,r){var s=this.view.translate,l=this.view.scale;if(!i&&this.gridEnabled){var a=this.gridSize*l*.5;if(!n){var o=e.x-(this.snap(e.x/l-s.x)+s.x)*l;Math.abs(t.x-o)l&&(m=0),f>a&&(d=0),this.view.setTranslate(Math.floor(m/2-o.x),Math.floor(d/2-o.y)),this.container.scrollLeft=(x-l)/2,this.container.scrollTop=(f-a)/2}},mxGraph.prototype.zoom=function(t,e){e=e??this.centerZoom;var i=Math.round(this.view.scale*t*100)/100,n=this.view.getState(this.getSelectionCell());if(t=i/this.view.scale,this.keepSelectionVisibleOnZoom&&n!=null){var r=new mxRectangle(n.x*t,n.y*t,n.width*t,n.height*t);this.view.scale=i,this.scrollRectToVisible(r)||(this.view.revalidate(),this.view.setScale(i))}else{var s=mxUtils.hasScrollbars(this.container);if(e&&!s){var l=this.container.offsetWidth,a=this.container.offsetHeight;if(t>1){var o=(t-1)/(i*2);l*=-o,a*=-o}else{var o=(1/t-1)/(this.view.scale*2);l*=o,a*=o}this.view.scaleAndTranslate(i,this.view.translate.x+l,this.view.translate.y+a)}else{var u=this.view.translate.x,p=this.view.translate.y,m=this.container.scrollLeft,d=this.container.scrollTop;if(this.view.setScale(i),s){var l=0,a=0;e&&(l=this.container.offsetWidth*(t-1)/2,a=this.container.offsetHeight*(t-1)/2),this.container.scrollLeft=(this.view.translate.x-u)*this.view.scale+Math.round(m*t+l),this.container.scrollTop=(this.view.translate.y-p)*this.view.scale+Math.round(d*t+a)}}}},mxGraph.prototype.zoomToRect=function(t){var e=this.container.clientWidth/t.width,i=this.container.clientHeight/t.height,n=e/i;t.x=Math.max(0,t.x),t.y=Math.max(0,t.y);var r=Math.min(this.container.scrollWidth,t.x+t.width),s=Math.min(this.container.scrollHeight,t.y+t.height);if(t.width=r-t.x,t.height=s-t.y,n<1){var l=t.height/n,a=(l-t.height)/2;t.height=l;var o=Math.min(t.y,a);t.y=t.y-o,s=Math.min(this.container.scrollHeight,t.y+t.height),t.height=s-t.y}else{var u=t.width*n,p=(u-t.width)/2;t.width=u;var m=Math.min(t.x,p);t.x=t.x-m,r=Math.min(this.container.scrollWidth,t.x+t.width),t.width=r-t.x}var d=this.container.clientWidth/t.width,x=this.view.scale*d;mxUtils.hasScrollbars(this.container)?(this.view.setScale(x),this.container.scrollLeft=Math.round(t.x*d),this.container.scrollTop=Math.round(t.y*d)):this.view.scaleAndTranslate(x,this.view.translate.x-t.x/this.view.scale,this.view.translate.y-t.y/this.view.scale)},mxGraph.prototype.scrollCellToVisible=function(t,e){var i=-this.view.translate.x,n=-this.view.translate.y,r=this.view.getState(t);if(r!=null){var s=new mxRectangle(i+r.x,n+r.y,r.width,r.height);if(e&&this.container!=null){var l=this.container.clientWidth,a=this.container.clientHeight;s.x=s.getCenterX()-l/2,s.width=l,s.y=s.getCenterY()-a/2,s.height=a}var o=new mxPoint(this.view.translate.x,this.view.translate.y);if(this.scrollRectToVisible(s)){var u=new mxPoint(this.view.translate.x,this.view.translate.y);this.view.translate.x=o.x,this.view.translate.y=o.y,this.view.setTranslate(u.x,u.y)}}},mxGraph.prototype.scrollRectToVisible=function(t){var e=!1;if(t!=null){var i=this.container.offsetWidth,n=this.container.offsetHeight,r=Math.min(i,t.width),s=Math.min(n,t.height);if(mxUtils.hasScrollbars(this.container)){var l=this.container;t.x+=this.view.translate.x,t.y+=this.view.translate.y;var a=l.scrollLeft-t.x,o=Math.max(a-l.scrollLeft,0);a>0?l.scrollLeft-=a+2:(a=t.x+r-l.scrollLeft-l.clientWidth,a>0&&(l.scrollLeft+=a+2));var u=l.scrollTop-t.y,p=Math.max(0,u-l.scrollTop);u>0?l.scrollTop-=u+2:(u=t.y+s-l.scrollTop-l.clientHeight,u>0&&(l.scrollTop+=u+2)),!this.useScrollbarsForPanning&&(o!=0||p!=0)&&this.view.setTranslate(o,p)}else{var m=-this.view.translate.x,d=-this.view.translate.y,x=this.view.scale;t.x+r>m+i&&(this.view.translate.x-=(t.x+r-i-m)/x,e=!0),t.y+s>d+n&&(this.view.translate.y-=(t.y+s-n-d)/x,e=!0),t.x1||r.length==1&&r[0]!=t)&&(n+=(mxResources.get(this.alreadyConnectedResource)||this.alreadyConnectedResource)+` +`)}var s=this.model.getDirectedEdgeCount(e,!0,t),l=this.model.getDirectedEdgeCount(i,!1,t);if(this.multiplicities!=null)for(var a=0;a0?n:null}return this.allowDanglingEdges?null:""},mxGraph.prototype.validateEdge=function(t,e,i){return null},mxGraph.prototype.validateGraph=function(t,e){t=t??this.model.getRoot(),e=e??new Object;for(var i=!0,n=this.model.getChildCount(t),r=0;r")):this.setCellWarning(s,null),i=i&&a==null}var o="";this.isCellCollapsed(t)&&!i&&(o+=(mxResources.get(this.containsValidationErrorsResource)||this.containsValidationErrorsResource)+` +`),this.model.isEdge(t)?o+=this.getEdgeValidationError(t,this.model.getTerminal(t,!0),this.model.getTerminal(t,!1))||"":o+=this.getCellValidationError(t)||"";var u=this.validateCell(t,e);return u!=null&&(o+=u),this.model.getParent(t)==null&&this.view.validate(),o.length>0||!i?o:null},mxGraph.prototype.getCellValidationError=function(t){var e=this.model.getDirectedEdgeCount(t,!0),i=this.model.getDirectedEdgeCount(t,!1),n=this.model.getValue(t),r="";if(this.multiplicities!=null)for(var s=0;sl.max||el.max||i0?r:null},mxGraph.prototype.validateCell=function(t,e){return null},mxGraph.prototype.getBackgroundImage=function(){return this.backgroundImage},mxGraph.prototype.setBackgroundImage=function(t){this.backgroundImage=t},mxGraph.prototype.getFoldingImage=function(t){if(t!=null&&this.foldingEnabled&&!this.getModel().isEdge(t.cell)){var e=this.isCellCollapsed(t.cell);if(this.isCellFoldable(t.cell,!e))return e?this.collapsedImage:this.expandedImage}return null},mxGraph.prototype.convertValueToString=function(t){var e=this.model.getValue(t);if(e!=null){if(mxUtils.isNode(e))return e.nodeName;if(typeof e.toString=="function")return e.toString()}return""},mxGraph.prototype.getLabel=function(t){var e="";if(this.labelsVisible&&t!=null){var i=this.getCurrentCellStyle(t);mxUtils.getValue(i,mxConstants.STYLE_NOLABEL,!1)||(e=this.convertValueToString(t))}return e},mxGraph.prototype.isHtmlLabel=function(t){return this.isHtmlLabels()},mxGraph.prototype.isHtmlLabels=function(){return this.htmlLabels},mxGraph.prototype.setHtmlLabels=function(t){this.htmlLabels=t},mxGraph.prototype.isWrapping=function(t){return this.getCurrentCellStyle(t)[mxConstants.STYLE_WHITE_SPACE]=="wrap"},mxGraph.prototype.isLabelClipped=function(t){return this.getCurrentCellStyle(t)[mxConstants.STYLE_OVERFLOW]=="hidden"},mxGraph.prototype.getTooltip=function(t,e,i,n){var r=null;if(t!=null){if(t.control!=null&&(e==t.control.node||e.parentNode==t.control.node)&&(r=this.collapseExpandResource,r=mxUtils.htmlEntities(mxResources.get(r)||r).replace(/\\n/g,"
")),r==null&&t.overlays!=null&&t.overlays.visit(function(l,a){r==null&&(e==a.node||e.parentNode==a.node)&&(r=a.overlay.toString())}),r==null){var s=this.selectionCellsHandler.getHandler(t.cell);s!=null&&typeof s.getTooltipForNode=="function"&&(r=s.getTooltipForNode(e))}r==null&&(r=this.getTooltipForCell(t.cell))}return r},mxGraph.prototype.getTooltipForCell=function(t){var e=null;return t!=null&&t.getTooltip!=null?e=t.getTooltip():e=this.convertValueToString(t),e},mxGraph.prototype.getLinkForCell=function(t){return null},mxGraph.prototype.getCursorForMouseEvent=function(t){return this.getCursorForCell(t.getCell())},mxGraph.prototype.getCursorForCell=function(t){return null},mxGraph.prototype.getStartSize=function(t,e){var i=new mxRectangle,n=this.getCurrentCellStyle(t,e),r=parseInt(mxUtils.getValue(n,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE));return mxUtils.getValue(n,mxConstants.STYLE_HORIZONTAL,!0)?i.height=r:i.width=r,i},mxGraph.prototype.getSwimlaneDirection=function(t){var e=mxUtils.getValue(t,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST),i=mxUtils.getValue(t,mxConstants.STYLE_FLIPH,0)==1,n=mxUtils.getValue(t,mxConstants.STYLE_FLIPV,0)==1,r=mxUtils.getValue(t,mxConstants.STYLE_HORIZONTAL,!0),s=r?0:3;e==mxConstants.DIRECTION_NORTH?s--:e==mxConstants.DIRECTION_WEST?s+=2:e==mxConstants.DIRECTION_SOUTH&&(s+=1);var l=mxUtils.mod(s,2);return i&&l==1&&(s+=2),n&&l==0&&(s+=2),[mxConstants.DIRECTION_NORTH,mxConstants.DIRECTION_EAST,mxConstants.DIRECTION_SOUTH,mxConstants.DIRECTION_WEST][mxUtils.mod(s,4)]},mxGraph.prototype.getActualStartSize=function(t,e){var i=new mxRectangle;if(this.isSwimlane(t,e)){var n=this.getCurrentCellStyle(t,e),r=parseInt(mxUtils.getValue(n,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE)),s=this.getSwimlaneDirection(n);s==mxConstants.DIRECTION_NORTH?i.y=r:s==mxConstants.DIRECTION_WEST?i.x=r:s==mxConstants.DIRECTION_SOUTH?i.height=r:i.width=r}return i},mxGraph.prototype.getImage=function(t){return t!=null&&t.style!=null?t.style[mxConstants.STYLE_IMAGE]:null},mxGraph.prototype.isTransparentState=function(t){var e=!1;if(t!=null){var i=mxUtils.getValue(t.style,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE),n=mxUtils.getValue(t.style,mxConstants.STYLE_FILLCOLOR,mxConstants.NONE);e=i==mxConstants.NONE&&n==mxConstants.NONE&&this.getImage(t)==null}return e},mxGraph.prototype.getVerticalAlign=function(t){return t!=null&&t.style!=null?t.style[mxConstants.STYLE_VERTICAL_ALIGN]||mxConstants.ALIGN_MIDDLE:null},mxGraph.prototype.getIndicatorColor=function(t){return t!=null&&t.style!=null?t.style[mxConstants.STYLE_INDICATOR_COLOR]:null},mxGraph.prototype.getIndicatorGradientColor=function(t){return t!=null&&t.style!=null?t.style[mxConstants.STYLE_INDICATOR_GRADIENTCOLOR]:null},mxGraph.prototype.getIndicatorShape=function(t){return t!=null&&t.style!=null?t.style[mxConstants.STYLE_INDICATOR_SHAPE]:null},mxGraph.prototype.getIndicatorImage=function(t){return t!=null&&t.style!=null?t.style[mxConstants.STYLE_INDICATOR_IMAGE]:null},mxGraph.prototype.getBorder=function(){return this.border},mxGraph.prototype.setBorder=function(t){this.border=t},mxGraph.prototype.isSwimlane=function(t,e){return t!=null&&this.model.getParent(t)!=this.model.getRoot()&&!this.model.isEdge(t)?this.getCurrentCellStyle(t,e)[mxConstants.STYLE_SHAPE]==mxConstants.SHAPE_SWIMLANE:!1},mxGraph.prototype.isResizeContainer=function(){return this.resizeContainer},mxGraph.prototype.setResizeContainer=function(t){this.resizeContainer=t},mxGraph.prototype.isEnabled=function(){return this.enabled},mxGraph.prototype.setEnabled=function(t){this.enabled=t},mxGraph.prototype.isEscapeEnabled=function(){return this.escapeEnabled},mxGraph.prototype.setEscapeEnabled=function(t){this.escapeEnabled=t},mxGraph.prototype.isInvokesStopCellEditing=function(){return this.invokesStopCellEditing},mxGraph.prototype.setInvokesStopCellEditing=function(t){this.invokesStopCellEditing=t},mxGraph.prototype.isEnterStopsCellEditing=function(){return this.enterStopsCellEditing},mxGraph.prototype.setEnterStopsCellEditing=function(t){this.enterStopsCellEditing=t},mxGraph.prototype.isCellLocked=function(t){var e=this.model.getGeometry(t);return this.isCellsLocked()||e!=null&&this.model.isVertex(t)&&e.relative},mxGraph.prototype.isCellsLocked=function(){return this.cellsLocked},mxGraph.prototype.setCellsLocked=function(t){this.cellsLocked=t},mxGraph.prototype.getCloneableCells=function(t){return this.model.filterCells(t,mxUtils.bind(this,function(e){return this.isCellCloneable(e)}))},mxGraph.prototype.isCellCloneable=function(t){var e=this.getCurrentCellStyle(t);return this.isCellsCloneable()&&e[mxConstants.STYLE_CLONEABLE]!=0},mxGraph.prototype.isCellsCloneable=function(){return this.cellsCloneable},mxGraph.prototype.setCellsCloneable=function(t){this.cellsCloneable=t},mxGraph.prototype.getExportableCells=function(t){return this.model.filterCells(t,mxUtils.bind(this,function(e){return this.canExportCell(e)}))},mxGraph.prototype.canExportCell=function(t){return this.exportEnabled},mxGraph.prototype.getImportableCells=function(t){return this.model.filterCells(t,mxUtils.bind(this,function(e){return this.canImportCell(e)}))},mxGraph.prototype.canImportCell=function(t){return this.importEnabled},mxGraph.prototype.isCellSelectable=function(t){return this.isCellsSelectable()},mxGraph.prototype.isCellsSelectable=function(){return this.cellsSelectable},mxGraph.prototype.setCellsSelectable=function(t){this.cellsSelectable=t},mxGraph.prototype.getDeletableCells=function(t){return this.model.filterCells(t,mxUtils.bind(this,function(e){return this.isCellDeletable(e)}))},mxGraph.prototype.isCellDeletable=function(t){var e=this.getCurrentCellStyle(t);return this.isCellsDeletable()&&e[mxConstants.STYLE_DELETABLE]!=0},mxGraph.prototype.isCellsDeletable=function(){return this.cellsDeletable},mxGraph.prototype.setCellsDeletable=function(t){this.cellsDeletable=t},mxGraph.prototype.isLabelMovable=function(t){return!this.isCellLocked(t)&&(this.model.isEdge(t)&&this.edgeLabelsMovable||this.model.isVertex(t)&&this.vertexLabelsMovable)},mxGraph.prototype.isCellRotatable=function(t){var e=this.getCurrentCellStyle(t);return e[mxConstants.STYLE_ROTATABLE]!=0},mxGraph.prototype.getMovableCells=function(t){return this.model.filterCells(t,mxUtils.bind(this,function(e){return this.isCellMovable(e)}))},mxGraph.prototype.isCellMovable=function(t){var e=this.getCurrentCellStyle(t);return this.isCellsMovable()&&!this.isCellLocked(t)&&e[mxConstants.STYLE_MOVABLE]!=0},mxGraph.prototype.isCellsMovable=function(){return this.cellsMovable},mxGraph.prototype.setCellsMovable=function(t){this.cellsMovable=t},mxGraph.prototype.isGridEnabled=function(){return this.gridEnabled},mxGraph.prototype.setGridEnabled=function(t){this.gridEnabled=t},mxGraph.prototype.isPortsEnabled=function(){return this.portsEnabled},mxGraph.prototype.setPortsEnabled=function(t){this.portsEnabled=t},mxGraph.prototype.getGridSize=function(){return this.gridSize},mxGraph.prototype.setGridSize=function(t){this.gridSize=t},mxGraph.prototype.getTolerance=function(){return this.tolerance},mxGraph.prototype.setTolerance=function(t){this.tolerance=t},mxGraph.prototype.isVertexLabelsMovable=function(){return this.vertexLabelsMovable},mxGraph.prototype.setVertexLabelsMovable=function(t){this.vertexLabelsMovable=t},mxGraph.prototype.isEdgeLabelsMovable=function(){return this.edgeLabelsMovable},mxGraph.prototype.setEdgeLabelsMovable=function(t){this.edgeLabelsMovable=t},mxGraph.prototype.isSwimlaneNesting=function(){return this.swimlaneNesting},mxGraph.prototype.setSwimlaneNesting=function(t){this.swimlaneNesting=t},mxGraph.prototype.isSwimlaneSelectionEnabled=function(){return this.swimlaneSelectionEnabled},mxGraph.prototype.setSwimlaneSelectionEnabled=function(t){this.swimlaneSelectionEnabled=t},mxGraph.prototype.isMultigraph=function(){return this.multigraph},mxGraph.prototype.setMultigraph=function(t){this.multigraph=t},mxGraph.prototype.isAllowLoops=function(){return this.allowLoops},mxGraph.prototype.setAllowDanglingEdges=function(t){this.allowDanglingEdges=t},mxGraph.prototype.isAllowDanglingEdges=function(){return this.allowDanglingEdges},mxGraph.prototype.setConnectableEdges=function(t){this.connectableEdges=t},mxGraph.prototype.isConnectableEdges=function(){return this.connectableEdges},mxGraph.prototype.setCloneInvalidEdges=function(t){this.cloneInvalidEdges=t},mxGraph.prototype.isCloneInvalidEdges=function(){return this.cloneInvalidEdges},mxGraph.prototype.setAllowLoops=function(t){this.allowLoops=t},mxGraph.prototype.isDisconnectOnMove=function(){return this.disconnectOnMove},mxGraph.prototype.setDisconnectOnMove=function(t){this.disconnectOnMove=t},mxGraph.prototype.isDropEnabled=function(){return this.dropEnabled},mxGraph.prototype.setDropEnabled=function(t){this.dropEnabled=t},mxGraph.prototype.isSplitEnabled=function(){return this.splitEnabled},mxGraph.prototype.setSplitEnabled=function(t){this.splitEnabled=t},mxGraph.prototype.isCellResizable=function(t){var e=this.getCurrentCellStyle(t);return this.isCellsResizable()&&!this.isCellLocked(t)&&mxUtils.getValue(e,mxConstants.STYLE_RESIZABLE,"1")!="0"},mxGraph.prototype.isCellsResizable=function(){return this.cellsResizable},mxGraph.prototype.setCellsResizable=function(t){this.cellsResizable=t},mxGraph.prototype.isTerminalPointMovable=function(t,e){return!0},mxGraph.prototype.isCellBendable=function(t){var e=this.getCurrentCellStyle(t);return this.isCellsBendable()&&!this.isCellLocked(t)&&e[mxConstants.STYLE_BENDABLE]!=0},mxGraph.prototype.isCellsBendable=function(){return this.cellsBendable},mxGraph.prototype.setCellsBendable=function(t){this.cellsBendable=t},mxGraph.prototype.isCellEditable=function(t){var e=this.getCurrentCellStyle(t);return this.isCellsEditable()&&!this.isCellLocked(t)&&e[mxConstants.STYLE_EDITABLE]!=0},mxGraph.prototype.isCellsEditable=function(){return this.cellsEditable},mxGraph.prototype.setCellsEditable=function(t){this.cellsEditable=t},mxGraph.prototype.isCellDisconnectable=function(t,e,i){return this.isCellsDisconnectable()&&!this.isCellLocked(t)},mxGraph.prototype.isCellsDisconnectable=function(){return this.cellsDisconnectable},mxGraph.prototype.setCellsDisconnectable=function(t){this.cellsDisconnectable=t},mxGraph.prototype.isValidSource=function(t){return t==null&&this.allowDanglingEdges||t!=null&&(!this.model.isEdge(t)||this.connectableEdges)&&this.isCellConnectable(t)},mxGraph.prototype.isValidTarget=function(t){return this.isValidSource(t)},mxGraph.prototype.isValidConnection=function(t,e){return this.isValidSource(t)&&this.isValidTarget(e)},mxGraph.prototype.setConnectable=function(t){this.connectionHandler.setEnabled(t)},mxGraph.prototype.isConnectable=function(){return this.connectionHandler.isEnabled()},mxGraph.prototype.setTooltips=function(t){this.tooltipHandler.setEnabled(t)},mxGraph.prototype.setPanning=function(t){this.panningHandler.panningEnabled=t},mxGraph.prototype.isEditing=function(t){if(this.cellEditor!=null){var e=this.cellEditor.getEditingCell();return t==null?e!=null:t==e}return!1},mxGraph.prototype.isAutoSizeCell=function(t){var e=this.getCurrentCellStyle(t);return this.isAutoSizeCells()||e[mxConstants.STYLE_AUTOSIZE]==1},mxGraph.prototype.isAutoSizeCells=function(){return this.autoSizeCells},mxGraph.prototype.setAutoSizeCells=function(t){this.autoSizeCells=t},mxGraph.prototype.isExtendParent=function(t){return!this.getModel().isEdge(t)&&this.isExtendParents()},mxGraph.prototype.isExtendParents=function(){return this.extendParents},mxGraph.prototype.setExtendParents=function(t){this.extendParents=t},mxGraph.prototype.isExtendParentsOnAdd=function(t){return this.extendParentsOnAdd},mxGraph.prototype.setExtendParentsOnAdd=function(t){this.extendParentsOnAdd=t},mxGraph.prototype.isExtendParentsOnMove=function(){return this.extendParentsOnMove},mxGraph.prototype.setExtendParentsOnMove=function(t){this.extendParentsOnMove=t},mxGraph.prototype.isRecursiveResize=function(t){return this.recursiveResize},mxGraph.prototype.setRecursiveResize=function(t){this.recursiveResize=t},mxGraph.prototype.isConstrainChild=function(t){return this.isConstrainChildren()&&!this.getModel().isEdge(this.getModel().getParent(t))},mxGraph.prototype.isConstrainChildren=function(){return this.constrainChildren},mxGraph.prototype.setConstrainChildren=function(t){this.constrainChildren=t},mxGraph.prototype.isConstrainRelativeChildren=function(){return this.constrainRelativeChildren},mxGraph.prototype.setConstrainRelativeChildren=function(t){this.constrainRelativeChildren=t},mxGraph.prototype.isAllowNegativeCoordinates=function(){return this.allowNegativeCoordinates},mxGraph.prototype.setAllowNegativeCoordinates=function(t){this.allowNegativeCoordinates=t},mxGraph.prototype.getOverlap=function(t){return this.isAllowOverlapParent(t)?this.defaultOverlap:0},mxGraph.prototype.isAllowOverlapParent=function(t){return!1},mxGraph.prototype.getFoldableCells=function(t,e){return this.model.filterCells(t,mxUtils.bind(this,function(i){return this.isCellFoldable(i,e)}))},mxGraph.prototype.isCellFoldable=function(t,e){var i=this.getCurrentCellStyle(t);return this.model.getChildCount(t)>0&&i[mxConstants.STYLE_FOLDABLE]!=0},mxGraph.prototype.isValidDropTarget=function(t,e,i){return t!=null&&(this.isSplitEnabled()&&this.isSplitTarget(t,e,i)||!this.model.isEdge(t)&&(this.isSwimlane(t)||this.model.getChildCount(t)>0&&!this.isCellCollapsed(t)))},mxGraph.prototype.isSplitTarget=function(t,e,i){if(this.model.isEdge(t)&&e!=null&&e.length==1&&this.isCellConnectable(e[0])&&this.getEdgeValidationError(t,this.model.getTerminal(t,!0),e[0])==null){var n=this.model.getTerminal(t,!0),r=this.model.getTerminal(t,!1);return!this.model.isAncestor(e[0],n)&&!this.model.isAncestor(e[0],r)}return!1},mxGraph.prototype.getDropTarget=function(t,e,i,n){if(!this.isSwimlaneNesting()){for(var r=0;r=0;a--){var o=this.model.getChildAt(i,a),u=this.getCellAt(t,e,o,n,r,s);if(u!=null)return u;if(this.isCellVisible(o)&&(r&&this.model.isEdge(o)||n&&this.model.isVertex(o))){var p=this.view.getState(o);if(p!=null&&(s==null||!s(p,t,e))&&this.intersects(p,t,e))return o}}return null},mxGraph.prototype.intersects=function(t,e,i){if(t!=null){var n=t.absolutePoints;if(n!=null)for(var r=this.tolerance*this.tolerance,s=n[0],l=1;l0&&e>0&&e>r.width*s)return!0;if(r.height>0&&i>0&&i>r.height*s)return!0}return!1},mxGraph.prototype.getChildVertices=function(t){return this.getChildCells(t,!0,!1)},mxGraph.prototype.getChildEdges=function(t){return this.getChildCells(t,!1,!0)},mxGraph.prototype.getChildCells=function(t,e,i){t=t??this.getDefaultParent(),e=e??!1,i=i??!1;for(var n=this.model.getChildCells(t,e,i),r=[],s=0;s0||n>0||l!=null){var u=this.getModel(),p=t+i,m=e+n;if(r==null&&(r=this.getCurrentRoot(),r==null&&(r=u.getRoot())),r!=null)for(var d=u.getChildCount(r),x=0;x=t&&v.y+v.height<=m&&v.y>=e&&v.x+v.width<=p;y&&s.push(f),(!y||o)&&this.getCells(t,e,i,n,f,s,l,a,o)}}}return s},mxGraph.prototype.getCellsBeyond=function(t,e,i,n,r){var s=[];if((n||r)&&(i==null&&(i=this.getDefaultParent()),i!=null))for(var l=this.model.getChildCount(i),a=0;a=t)&&(!r||u.y>=e)&&s.push(o)}return s},mxGraph.prototype.findTreeRoots=function(t,e,i){e=e??!1,i=i??!1;var n=[];if(t!=null){for(var r=this.getModel(),s=r.getChildCount(t),l=null,a=0,o=0;o0||!i&&d==0&&m>0)&&n.push(u);var g=i?d-m:m-d;g>a&&(a=g,l=u)}}n.length==0&&l!=null&&n.push(l)}return n},mxGraph.prototype.traverse=function(t,e,i,n,r,s){if(i!=null&&t!=null&&(e=e??!0,s=s??!1,r=r||new mxDictionary,!r.get(t))){r.put(t,!0);var l=i(t,n);if(l==null||l){var a=this.model.getEdgeCount(t);if(a>0)for(var o=0;o0?n.cells[0]:null;n.cells.length>1&&n.clear();var s=r!=null?this.model.getParent(r):this.getDefaultParent(),l=this.model.getChildCount(s);if(r==null&&l>0){var a=this.model.getChildAt(s,0);this.setSelectionCell(a)}else if((r==null||e)&&this.view.getState(s)!=null&&this.model.getGeometry(s)!=null)this.getCurrentRoot()!=s&&this.setSelectionCell(s);else if(r!=null&&i){var o=this.model.getChildCount(r);if(o>0){var a=this.model.getChildAt(r,0);this.setSelectionCell(a)}}else if(l>0){var u=s.getIndex(r);if(t){u++;var a=this.model.getChildAt(s,u%l);this.setSelectionCell(a)}else{u--;var p=u<0?l-1:u,a=this.model.getChildAt(s,p);this.setSelectionCell(a)}}},mxGraph.prototype.selectAll=function(t,e){t=t||this.getDefaultParent();var i=e?this.model.filterDescendants(mxUtils.bind(this,function(n){return n!=t&&this.view.getState(n)!=null}),t):this.model.getChildren(t);i!=null&&this.setSelectionCells(i)},mxGraph.prototype.selectVertices=function(t,e){this.selectCells(!0,!1,t,e)},mxGraph.prototype.selectEdges=function(t){this.selectCells(!1,!0,t)},mxGraph.prototype.selectCells=function(t,e,i,n){i=i||this.getDefaultParent();var r=mxUtils.bind(this,function(l){return this.view.getState(l)!=null&&((n||this.model.getChildCount(l)==0)&&this.model.isVertex(l)&&t&&!this.model.isEdge(this.model.getParent(l))||this.model.isEdge(l)&&e)}),s=this.model.filterDescendants(r,i);s!=null&&this.setSelectionCells(s)},mxGraph.prototype.selectCellForEvent=function(t,e){var i=this.isCellSelected(t);this.isToggleEvent(e)?i?this.removeSelectionCell(t):this.addSelectionCell(t):(!i||this.getSelectionCount()!=1)&&this.setSelectionCell(t)},mxGraph.prototype.selectCellsForEvent=function(t,e){this.isToggleEvent(e)?this.addSelectionCells(t):this.setSelectionCells(t)},mxGraph.prototype.createHandler=function(t){var e=null;if(t!=null)if(this.model.isEdge(t.cell)){var i=t.getVisibleTerminalState(!0),n=t.getVisibleTerminalState(!1),r=this.getCellGeometry(t.cell),s=this.view.getEdgeStyle(t,r!=null?r.points:null,i,n);e=this.createEdgeHandler(t,s)}else e=this.createVertexHandler(t);return e},mxGraph.prototype.createVertexHandler=function(t){return new mxVertexHandler(t)},mxGraph.prototype.createEdgeHandler=function(t,e){var i=null;return e==mxEdgeStyle.Loop||e==mxEdgeStyle.ElbowConnector||e==mxEdgeStyle.SideToSide||e==mxEdgeStyle.TopToBottom?i=this.createElbowEdgeHandler(t):e==mxEdgeStyle.SegmentConnector||e==mxEdgeStyle.OrthConnector?i=this.createEdgeSegmentHandler(t):i=new mxEdgeHandler(t),i},mxGraph.prototype.createEdgeSegmentHandler=function(t){return new mxEdgeSegmentHandler(t)},mxGraph.prototype.createElbowEdgeHandler=function(t){return new mxElbowEdgeHandler(t)},mxGraph.prototype.addMouseListener=function(t){this.mouseListeners==null&&(this.mouseListeners=[]),this.mouseListeners.push(t)},mxGraph.prototype.removeMouseListener=function(t){if(this.mouseListeners!=null){for(var e=0;e0){this.outline.getView().scale!=d&&(this.outline.getView().scale=d,t=!0);var x=this.outline.getView();x.currentRoot!=this.source.getView().currentRoot&&x.setCurrentRoot(this.source.getView().currentRoot);var f=this.source.view.translate,g=f.x+this.source.panDx,c=f.y+this.source.panDy,v=this.getOutlineOffset(d);v!=null&&(g+=v.x,c+=v.y),n.x<0&&(g=g-n.x),n.y<0&&(c=c-n.y),(x.translate.x!=g||x.translate.y!=c)&&(x.translate.x=g,x.translate.y=c,t=!0);var y=x.translate;d=this.source.getView().scale;var T=d/x.scale,C=1/x.scale,S=this.source.container;this.bounds=new mxRectangle((y.x-f.x-this.source.panDx)/C,(y.y-f.y-this.source.panDy)/C,S.clientWidth/T,S.clientHeight/T),this.bounds.x+=this.source.container.scrollLeft*x.scale/d,this.bounds.y+=this.source.container.scrollTop*x.scale/d;var E=this.selectionBorder.bounds;(E.x!=this.bounds.x||E.y!=this.bounds.y||E.width!=this.bounds.width||E.height!=this.bounds.height)&&(this.selectionBorder.bounds=this.bounds,this.selectionBorder.redraw());var E=this.sizer.bounds,L=new mxRectangle(this.bounds.x+this.bounds.width-E.width/2,this.bounds.y+this.bounds.height-E.height/2,E.width,E.height);(E.x!=L.x||E.y!=L.y||E.width!=L.width||E.height!=L.height)&&(this.sizer.bounds=L,this.sizer.node.style.visibility!="hidden"&&this.sizer.redraw()),t&&this.outline.view.revalidate()}}},mxOutline.prototype.mouseDown=function(t,e){if(this.enabled&&this.showViewport){var i=mxEvent.isMouseEvent(e.getEvent())?0:this.source.tolerance,n=this.source.allowHandleBoundsCheck&&(mxClient.IS_IE||i>0)?new mxRectangle(e.getGraphX()-i,e.getGraphY()-i,2*i,2*i):null;this.zoom=e.isSource(this.sizer)||n!=null&&mxUtils.intersects(shape.bounds,n),this.startX=e.getX(),this.startY=e.getY(),this.active=!0,this.source.useScrollbarsForPanning&&mxUtils.hasScrollbars(this.source.container)?(this.dx0=this.source.container.scrollLeft,this.dy0=this.source.container.scrollTop):(this.dx0=0,this.dy0=0)}e.consume()},mxOutline.prototype.mouseMove=function(t,e){if(this.active){this.selectionBorder.node.style.display=this.showViewport?"":"none",this.sizer.node.style.display=this.selectionBorder.node.style.display;var i=this.getTranslateForEvent(e),n=i.x,r=i.y,s=null;if(this.zoom){var a=this.source.container,o=a.clientWidth/a.clientHeight;r=n/o,s=new mxRectangle(this.bounds.x,this.bounds.y,Math.max(1,this.bounds.width+n),Math.max(1,this.bounds.height+r)),this.selectionBorder.bounds=s,this.selectionBorder.redraw()}else{var l=this.outline.getView().scale;s=new mxRectangle(this.bounds.x+n,this.bounds.y+r,this.bounds.width,this.bounds.height),this.selectionBorder.bounds=s,this.selectionBorder.redraw(),n/=l,n*=this.source.getView().scale,r/=l,r*=this.source.getView().scale,this.source.panGraph(-n-this.dx0,-r-this.dy0)}var u=this.sizer.bounds;this.sizer.bounds=new mxRectangle(s.x+s.width-u.width/2,s.y+s.height-u.height/2,u.width,u.height),this.sizer.node.style.visibility!="hidden"&&this.sizer.redraw(),e.consume()}},mxOutline.prototype.getTranslateForEvent=function(t){return new mxPoint(t.getX()-this.startX,t.getY()-this.startY)},mxOutline.prototype.mouseUp=function(t,e){if(this.active){var i=this.getTranslateForEvent(e),n=i.x,r=i.y;if(Math.abs(n)>0||Math.abs(r)>0){if(this.zoom){var l=this.selectionBorder.bounds.width,a=this.source.getView().scale;this.source.zoomTo(Math.max(this.minScale,a-n*a/l),!1)}else if(!this.source.useScrollbarsForPanning||!mxUtils.hasScrollbars(this.source.container)){this.source.panGraph(0,0),n/=this.outline.getView().scale,r/=this.outline.getView().scale;var s=this.source.getView().translate;this.source.getView().setTranslate(s.x-n,s.y-r)}this.update(),e.consume()}this.index=null,this.active=!1}},mxOutline.prototype.destroy=function(){this.source!=null&&(this.source.removeListener(this.panHandler),this.source.removeListener(this.refreshHandler),this.source.getModel().removeListener(this.updateHandler),this.source.getView().removeListener(this.updateHandler),mxEvent.removeListener(this.source.container,"scroll",this.updateHandler),this.source=null),this.outline!=null&&(this.outline.removeMouseListener(this),this.outline.destroy(),this.outline=null),this.selectionBorder!=null&&(this.selectionBorder.destroy(),this.selectionBorder=null),this.sizer!=null&&(this.sizer.destroy(),this.sizer=null)},__mxOutput.mxOutline=typeof mxOutline<"u"?mxOutline:void 0;function mxMultiplicity(t,e,i,n,r,s,l,a,o,u){this.source=t,this.type=e,this.attr=i,this.value=n,this.min=r??0,this.max=s??"n",this.validNeighbors=l,this.countError=mxResources.get(a)||a,this.typeError=mxResources.get(o)||o,this.validNeighborsAllowed=u??!0}mxMultiplicity.prototype.type=null,mxMultiplicity.prototype.attr=null,mxMultiplicity.prototype.value=null,mxMultiplicity.prototype.source=null,mxMultiplicity.prototype.min=null,mxMultiplicity.prototype.max=null,mxMultiplicity.prototype.validNeighbors=null,mxMultiplicity.prototype.validNeighborsAllowed=!0,mxMultiplicity.prototype.countError=null,mxMultiplicity.prototype.typeError=null,mxMultiplicity.prototype.check=function(t,e,i,n,r,s){var l="";if((this.source&&this.checkTerminal(t,i,e)||!this.source&&this.checkTerminal(t,n,e))&&(this.countError!=null&&(this.source&&(this.max==0||r>=this.max)||!this.source&&(this.max==0||s>=this.max))&&(l+=this.countError+` +`),this.validNeighbors!=null&&this.typeError!=null&&this.validNeighbors.length>0)){var a=this.checkNeighbors(t,e,i,n);a||(l+=this.typeError+` +`)}return l.length>0?l:null},mxMultiplicity.prototype.checkNeighbors=function(t,e,i,n){for(var r=t.model.getValue(i),s=t.model.getValue(n),l=!this.validNeighborsAllowed,a=this.validNeighbors,o=0;o0){var i=this.getGraph().getModel();i.beginUpdate();try{for(var n=null,r=0;r1||r.points!=null&&r.points.length>0||n.getTerminal(i,!0)==null||n.getTerminal(i,!1)==null||this.graph.allowDanglingEdges||this.graph.isCloneEvent(e.getEvent())&&this.graph.isCellsCloneable())?this.start(i,e.getX(),e.getY()):this.delayedSelection&&(this.cell=i),this.cellWasClicked=!0,this.consumeMouseEvent(mxEvent.MOUSE_DOWN,e)}}},mxGraphHandler.prototype.getGuideStates=function(){var t=this.graph.getDefaultParent(),e=this.graph.getModel(),i=mxUtils.bind(this,function(n){return this.graph.view.getState(n)!=null&&e.isVertex(n)&&e.getGeometry(n)!=null&&!e.getGeometry(n).relative});return this.graph.view.getCellStates(e.filterDescendants(i,t))},mxGraphHandler.prototype.getCells=function(t){return!this.delayedSelection&&this.graph.isCellMovable(t)?[t]:this.graph.getMovableCells(this.graph.getSelectionCells())},mxGraphHandler.prototype.getPreviewBounds=function(t){var e=this.getBoundingBox(t);if(e!=null){if(e.width=Math.max(0,e.width-1),e.height=Math.max(0,e.height-1),e.width0){for(var i=this.graph.getModel(),n=0;n=2)&&m!=(this.target||s))})}},mxGraphHandler.prototype.addStates=function(t,e){var i=this.graph.view.getState(t),n=0;if(i!=null&&e.get(t)==null){e.put(t,i),n++;for(var r=this.graph.model.getChildCount(t),s=0;s=this.cellCount&&!this.livePreviewActive&&this.allowLivePreview?(!this.cloning||!this.livePreviewActive)&&(this.livePreviewActive=!0,this.livePreviewUsed=!0):!this.livePreviewUsed&&this.shape==null&&(this.shape=this.createPreviewShape(this.bounds))},mxGraphHandler.prototype.mouseMove=function(t,e){var i=this.graph;if(!e.isConsumed()&&i.isMouseDown&&this.cell!=null&&this.first!=null&&this.bounds!=null&&!this.suspended){if(mxEvent.isMultiTouchEvent(e.getEvent())){this.reset();return}var n=this.getDelta(e),r=i.tolerance;if(this.shape!=null||this.livePreviewActive||Math.abs(n.x)>r||Math.abs(n.y)>r){this.highlight==null&&(this.highlight=new mxCellHighlight(this.graph,mxConstants.DROP_TARGET_COLOR,3));var s=i.isCloneEvent(e.getEvent())&&i.isCellsCloneable()&&this.isCloneEnabled(),l=i.isGridEnabledEvent(e.getEvent()),a=e.getCell(),o=!0,u=null;this.cloning=s,i.isDropEnabled()&&this.highlightEnabled&&(u=i.getDropTarget(this.cells,e.getEvent(),a,s));var p=i.getView().getState(u),m=!1;if(p!=null&&(s||this.isValidDropTarget(u,e)))this.target!=u&&(this.target=u,this.setHighlightColor(mxConstants.DROP_TARGET_COLOR)),m=!0;else if(this.target=null,this.connectOnDrop&&a!=null&&this.cells.length==1&&i.getModel().isVertex(a)&&i.isCellConnectable(a)&&(p=i.getView().getState(a),p!=null)){var d=i.getEdgeValidationError(null,this.cell,a),x=d==null?mxConstants.VALID_COLOR:mxConstants.INVALID_CONNECT_TARGET_COLOR;this.setHighlightColor(x),m=!0}p!=null&&m?this.highlight.highlight(p):this.highlight.hide(),this.guide!=null&&this.useGuidesForEvent(e)?(n=this.guide.move(this.bounds,n,l,s),o=!1):n=this.graph.snapDelta(n,this.bounds,!l,!1,!1),this.guide!=null&&o&&this.guide.hide(),i.isConstrainedEvent(e.getEvent())&&(Math.abs(n.x)>Math.abs(n.y)?n.y=0:n.x=0),this.checkPreview(),(this.currentDx!=n.x||this.currentDy!=n.y)&&(this.currentDx=n.x,this.currentDy=n.y,this.updatePreview())}this.updateHint(e),this.consumeMouseEvent(mxEvent.MOUSE_MOVE,e),mxEvent.consume(e.getEvent())}else if((this.isMoveEnabled()||this.isCloneEnabled())&&this.updateCursor&&!e.isConsumed()&&(e.getState()!=null||e.sourceState!=null)&&!i.isMouseDown){var f=i.getCursorForMouseEvent(e);f==null&&i.isEnabled()&&i.isCellMovable(e.getCell())&&(i.getModel().isEdge(e.getCell())?f=mxConstants.CURSOR_MOVABLE_EDGE:f=mxConstants.CURSOR_MOVABLE_VERTEX),f!=null&&e.sourceState!=null&&e.sourceState.setCursor(f)}},mxGraphHandler.prototype.updatePreview=function(t){this.livePreviewUsed&&!t?this.cells!=null&&(this.setHandlesVisibleForCells(this.graph.selectionCellsHandler.getHandledSelectionCells(),!1),this.updateLivePreview(this.currentDx,this.currentDy)):this.updatePreviewShape()},mxGraphHandler.prototype.updatePreviewShape=function(){this.shape!=null&&this.pBounds!=null&&(this.shape.bounds=new mxRectangle(Math.round(this.pBounds.x+this.currentDx),Math.round(this.pBounds.y+this.currentDy),this.pBounds.width,this.pBounds.height),this.shape.redraw())},mxGraphHandler.prototype.updateLivePreview=function(t,e){if(!this.suspended){var i=[];if(this.allCells!=null&&this.allCells.visit(mxUtils.bind(this,function(f,g){var c=this.graph.view.getState(g.cell);if(c!=g&&(g.destroy(),c!=null?this.allCells.put(g.cell,c):this.allCells.remove(g.cell),g=c),g!=null){var v=g.clone();i.push([g,v]),g.shape!=null&&(g.shape.originalPointerEvents==null&&(g.shape.originalPointerEvents=g.shape.pointerEvents),g.shape.pointerEvents=!1,g.text!=null&&(g.text.originalPointerEvents==null&&(g.text.originalPointerEvents=g.text.pointerEvents),g.text.pointerEvents=!1)),this.graph.model.isVertex(g.cell)&&(g.x+=t,g.y+=e,this.cloning?g.text!=null&&(g.text.updateBoundingBox(),g.text.boundingBox!=null&&(g.text.boundingBox.x+=t,g.text.boundingBox.y+=e),g.text.unrotatedBoundingBox!=null&&(g.text.unrotatedBoundingBox.x+=t,g.text.unrotatedBoundingBox.y+=e)):(g.view.graph.cellRenderer.redraw(g,!0),g.view.invalidate(g.cell),g.invalid=!1,g.control!=null&&g.control.node!=null&&(g.control.node.style.visibility="hidden")))}})),i.length==0)this.reset();else{for(var n=this.graph.view.scale,r=0;rthis.graph.tolerance||Math.abs(this.dy)>this.graph.tolerance,!i&&this.active&&this.fireEvent(new mxEventObject(mxEvent.PAN_START,"event",e))}(this.active||this.panningTrigger)&&e.consume()},mxPanningHandler.prototype.mouseUp=function(t,e){if(this.active){if(this.dx!=null&&this.dy!=null){if(!this.graph.useScrollbarsForPanning||!mxUtils.hasScrollbars(this.graph.container)){var i=this.graph.getView().scale,n=this.graph.getView().translate;this.graph.panGraph(0,0),this.panGraph(n.x+this.dx/i,n.y+this.dy/i)}e.consume()}this.fireEvent(new mxEventObject(mxEvent.PAN_END,"event",e))}this.reset()},mxPanningHandler.prototype.zoomGraph=function(t){var e=Math.round(this.initialScale*t.scale*100)/100;this.minScale!=null&&(e=Math.max(this.minScale,e)),this.maxScale!=null&&(e=Math.min(this.maxScale,e)),this.graph.view.scale!=e&&(this.graph.zoomTo(e),mxEvent.consume(t))},mxPanningHandler.prototype.reset=function(){this.panningTrigger=!1,this.mouseDownEvent=null,this.active=!1,this.dx=null,this.dy=null},mxPanningHandler.prototype.panGraph=function(t,e){this.graph.getView().setTranslate(t,e)},mxPanningHandler.prototype.destroy=function(){this.graph.removeMouseListener(this),this.graph.removeListener(this.forcePanningHandler),this.graph.removeListener(this.gestureHandler),mxEvent.removeListener(document,"mouseup",this.mouseUpListener)},__mxOutput.mxPanningHandler=typeof mxPanningHandler<"u"?mxPanningHandler:void 0;function mxPopupMenuHandler(t,e){t!=null&&(this.graph=t,this.factoryMethod=e,this.graph.addMouseListener(this),this.gestureHandler=mxUtils.bind(this,function(i,n){this.inTolerance=!1}),this.graph.addListener(mxEvent.GESTURE,this.gestureHandler),this.init())}mxPopupMenuHandler.prototype=new mxPopupMenu,mxPopupMenuHandler.prototype.constructor=mxPopupMenuHandler,mxPopupMenuHandler.prototype.graph=null,mxPopupMenuHandler.prototype.selectOnPopup=!0,mxPopupMenuHandler.prototype.clearSelectionOnBackground=!0,mxPopupMenuHandler.prototype.triggerX=null,mxPopupMenuHandler.prototype.triggerY=null,mxPopupMenuHandler.prototype.screenX=null,mxPopupMenuHandler.prototype.screenY=null,mxPopupMenuHandler.prototype.init=function(){mxPopupMenu.prototype.init.apply(this),mxEvent.addGestureListeners(this.div,mxUtils.bind(this,function(t){this.graph.tooltipHandler.hide()}))},mxPopupMenuHandler.prototype.isSelectOnPopup=function(t){return this.selectOnPopup},mxPopupMenuHandler.prototype.mouseDown=function(t,e){this.isEnabled()&&!mxEvent.isMultiTouchEvent(e.getEvent())&&(this.hideMenu(),this.triggerX=e.getGraphX(),this.triggerY=e.getGraphY(),this.screenX=mxEvent.getMainEvent(e.getEvent()).screenX,this.screenY=mxEvent.getMainEvent(e.getEvent()).screenY,this.popupTrigger=this.isPopupTrigger(e),this.inTolerance=!0)},mxPopupMenuHandler.prototype.mouseMove=function(t,e){this.inTolerance&&this.screenX!=null&&this.screenY!=null&&(Math.abs(mxEvent.getMainEvent(e.getEvent()).screenX-this.screenX)>this.graph.tolerance||Math.abs(mxEvent.getMainEvent(e.getEvent()).screenY-this.screenY)>this.graph.tolerance)&&(this.inTolerance=!1)},mxPopupMenuHandler.prototype.mouseUp=function(t,e){if(this.popupTrigger&&this.inTolerance&&this.triggerX!=null&&this.triggerY!=null){var i=this.getCellForPopupEvent(e);this.graph.isEnabled()&&this.isSelectOnPopup(e)&&i!=null&&!this.graph.isCellSelected(i)?this.graph.setSelectionCell(i):this.clearSelectionOnBackground&&i==null&&this.graph.clearSelection(),this.graph.tooltipHandler.hide();var n=mxUtils.getScrollOrigin();this.popup(e.getX()+n.x+1,e.getY()+n.y+1,i,e.getEvent()),e.consume()}this.popupTrigger=!1,this.inTolerance=!1},mxPopupMenuHandler.prototype.getCellForPopupEvent=function(t){return t.getCell()},mxPopupMenuHandler.prototype.destroy=function(){this.graph.removeMouseListener(this),this.graph.removeListener(this.gestureHandler),mxPopupMenu.prototype.destroy.apply(this)},__mxOutput.mxPopupMenuHandler=typeof mxPopupMenuHandler<"u"?mxPopupMenuHandler:void 0;function mxCellMarker(t,e,i,n){mxEventSource.call(this),t!=null&&(this.graph=t,this.validColor=e??mxConstants.DEFAULT_VALID_COLOR,this.invalidColor=i??mxConstants.DEFAULT_INVALID_COLOR,this.hotspot=n??mxConstants.DEFAULT_HOTSPOT,this.highlight=new mxCellHighlight(t))}mxUtils.extend(mxCellMarker,mxEventSource),mxCellMarker.prototype.graph=null,mxCellMarker.prototype.enabled=!0,mxCellMarker.prototype.hotspot=mxConstants.DEFAULT_HOTSPOT,mxCellMarker.prototype.hotspotEnabled=!1,mxCellMarker.prototype.validColor=null,mxCellMarker.prototype.invalidColor=null,mxCellMarker.prototype.currentColor=null,mxCellMarker.prototype.validState=null,mxCellMarker.prototype.markedState=null,mxCellMarker.prototype.setEnabled=function(t){this.enabled=t},mxCellMarker.prototype.isEnabled=function(){return this.enabled},mxCellMarker.prototype.setHotspot=function(t){this.hotspot=t},mxCellMarker.prototype.getHotspot=function(){return this.hotspot},mxCellMarker.prototype.setHotspotEnabled=function(t){this.hotspotEnabled=t},mxCellMarker.prototype.isHotspotEnabled=function(){return this.hotspotEnabled},mxCellMarker.prototype.hasValidState=function(){return this.validState!=null},mxCellMarker.prototype.getValidState=function(){return this.validState},mxCellMarker.prototype.getMarkedState=function(){return this.markedState},mxCellMarker.prototype.reset=function(){this.validState=null,this.markedState!=null&&(this.markedState=null,this.unmark())},mxCellMarker.prototype.process=function(t){var e=null;return this.isEnabled()&&(e=this.getState(t),this.setCurrentState(e,t)),e},mxCellMarker.prototype.setCurrentState=function(t,e,i){var n=t!=null?this.isValidState(t):!1;i=i??this.getMarkerColor(e.getEvent(),t,n),n?this.validState=t:this.validState=null,(t!=this.markedState||i!=this.currentColor)&&(this.currentColor=i,t!=null&&this.currentColor!=null?(this.markedState=t,this.mark()):this.markedState!=null&&(this.markedState=null,this.unmark()))},mxCellMarker.prototype.markCell=function(t,e){var i=this.graph.getView().getState(t);i!=null&&(this.currentColor=e??this.validColor,this.markedState=i,this.mark())},mxCellMarker.prototype.mark=function(){this.highlight.setHighlightColor(this.currentColor),this.highlight.highlight(this.markedState),this.fireEvent(new mxEventObject(mxEvent.MARK,"state",this.markedState))},mxCellMarker.prototype.unmark=function(){this.mark()},mxCellMarker.prototype.isValidState=function(t){return!0},mxCellMarker.prototype.getMarkerColor=function(t,e,i){return i?this.validColor:this.invalidColor},mxCellMarker.prototype.getState=function(t){var e=this.graph.getView(),i=this.getCell(t),n=this.getStateToMark(e.getState(i));return n!=null&&this.intersects(n,t)?n:null},mxCellMarker.prototype.getCell=function(t){return t.getCell()},mxCellMarker.prototype.getStateToMark=function(t){return t},mxCellMarker.prototype.intersects=function(t,e){return this.hotspotEnabled?mxUtils.intersectsHotspot(t,e.getGraphX(),e.getGraphY(),this.hotspot,mxConstants.MIN_HOTSPOT_SIZE,mxConstants.MAX_HOTSPOT_SIZE):!0},mxCellMarker.prototype.destroy=function(){this.graph.getView().removeListener(this.resetHandler),this.graph.getModel().removeListener(this.resetHandler),this.highlight.destroy()},__mxOutput.mxCellMarker=typeof mxCellMarker<"u"?mxCellMarker:void 0;function mxSelectionCellsHandler(t){mxEventSource.call(this),this.graph=t,this.handlers=new mxDictionary,this.graph.addMouseListener(this),this.refreshHandler=mxUtils.bind(this,function(e,i){this.isEnabled()&&this.refresh()}),this.graph.getSelectionModel().addListener(mxEvent.CHANGE,this.refreshHandler),this.graph.getModel().addListener(mxEvent.CHANGE,this.refreshHandler),this.graph.getView().addListener(mxEvent.SCALE,this.refreshHandler),this.graph.getView().addListener(mxEvent.TRANSLATE,this.refreshHandler),this.graph.getView().addListener(mxEvent.SCALE_AND_TRANSLATE,this.refreshHandler),this.graph.getView().addListener(mxEvent.DOWN,this.refreshHandler),this.graph.getView().addListener(mxEvent.UP,this.refreshHandler)}mxUtils.extend(mxSelectionCellsHandler,mxEventSource),mxSelectionCellsHandler.prototype.graph=null,mxSelectionCellsHandler.prototype.enabled=!0,mxSelectionCellsHandler.prototype.refreshHandler=null,mxSelectionCellsHandler.prototype.maxHandlers=100,mxSelectionCellsHandler.prototype.handlers=null,mxSelectionCellsHandler.prototype.isEnabled=function(){return this.enabled},mxSelectionCellsHandler.prototype.setEnabled=function(t){this.enabled=t},mxSelectionCellsHandler.prototype.getHandler=function(t){return this.handlers.get(t)},mxSelectionCellsHandler.prototype.isHandled=function(t){return this.getHandler(t)!=null},mxSelectionCellsHandler.prototype.reset=function(){this.handlers.visit(function(t,e){e.reset.apply(e)})},mxSelectionCellsHandler.prototype.getHandledSelectionCells=function(){return this.graph.getSelectionCells()},mxSelectionCellsHandler.prototype.refresh=function(){var t=this.handlers;this.handlers=new mxDictionary;for(var e=mxUtils.sortCells(this.getHandledSelectionCells(),!1),i=0;ithis.graph.tolerance||Math.abs(e.getGraphY()-this.first.y)>this.graph.tolerance)&&this.updateCurrentState(e,s),this.first!=null){var l=null,a=s;this.constraintHandler.currentConstraint!=null&&this.constraintHandler.currentFocus!=null&&this.constraintHandler.currentPoint!=null?(l=this.constraintHandler.currentConstraint,a=this.constraintHandler.currentPoint.clone()):this.previous!=null&&!this.graph.isIgnoreTerminalEvent(e.getEvent())&&mxEvent.isShiftDown(e.getEvent())&&(Math.abs(this.previous.getCenterX()-s.x)0?this.waypoints[0]:a,x=this.getSourcePerimeterPoint(this.previous,f,e);x!=null&&(o=x)}}if(this.currentState==null&&this.movePreviewAway){var x=o;if(this.edgeState!=null&&this.edgeState.absolutePoints.length>=2){var g=this.edgeState.absolutePoints[this.edgeState.absolutePoints.length-2];g!=null&&(x=g)}var c=a.x-x.x,v=a.y-x.y,y=Math.sqrt(c*c+v*v);if(y==0)return;this.originalPoint=a.clone(),a.x-=c*4/y,a.y-=v*4/y}else this.originalPoint=null;if(this.shape==null){var c=Math.abs(e.getGraphX()-this.first.x),v=Math.abs(e.getGraphY()-this.first.y);(c>this.graph.tolerance||v>this.graph.tolerance)&&(this.shape=this.createShape(),this.edgeState!=null&&this.shape.apply(this.edgeState),this.updateCurrentState(e,s))}if(this.shape!=null){if(this.edgeState!=null)this.shape.points=this.edgeState.absolutePoints;else{var T=[o];this.waypoints!=null&&(T=T.concat(this.waypoints)),T.push(a),this.shape.points=T}this.drawPreview()}this.cursor!=null&&(this.graph.container.style.cursor=this.cursor),mxEvent.consume(e.getEvent()),e.consume()}else!this.isEnabled()||!this.graph.isEnabled()?this.constraintHandler.reset():this.previous!=this.currentState&&this.edgeState==null?(this.destroyIcons(),this.currentState!=null&&this.error==null&&this.constraintHandler.currentConstraint==null&&(this.icons=this.createIcons(this.currentState),this.icons==null&&(this.currentState.setCursor(mxConstants.CURSOR_CONNECT),e.consume())),this.previous=this.currentState):this.previous==this.currentState&&this.currentState!=null&&this.icons==null&&!this.graph.isMouseDown&&e.consume();if(!this.graph.isMouseDown&&this.currentState!=null&&this.icons!=null){for(var C=!1,S=e.getSource(),E=0;E0?this.waypoints[this.waypoints.length-1]:new mxPoint(this.previous.getCenterX(),this.previous.getCenterY()),l=r(n.getPerimeterBounds(t),this.edgeState,s,!1);l!=null&&(i=l)}else i=new mxPoint(t.getCenterX(),t.getCenterY());return i},mxConnectionHandler.prototype.getSourcePerimeterPoint=function(t,e,i){var n=null,r=t.view,s=r.getPerimeterFunction(t),l=new mxPoint(t.getCenterX(),t.getCenterY());if(s!=null){var a=mxUtils.getValue(t.style,mxConstants.STYLE_ROTATION,0),o=-a*(Math.PI/180);a!=0&&(e=mxUtils.getRotatedPoint(new mxPoint(e.x,e.y),Math.cos(o),Math.sin(o),l));var u=s(r.getPerimeterBounds(t),t,e,!1);u!=null&&(a!=0&&(u=mxUtils.getRotatedPoint(new mxPoint(u.x,u.y),Math.cos(-o),Math.sin(-o),l)),n=u)}else n=l;return n},mxConnectionHandler.prototype.updateIcons=function(t,e,i){},mxConnectionHandler.prototype.isStopEvent=function(t){return t.getState()!=null},mxConnectionHandler.prototype.addWaypointForEvent=function(t){var e=mxUtils.convertPoint(this.graph.container,t.getX(),t.getY()),i=Math.abs(e.x-this.first.x),n=Math.abs(e.y-this.first.y),r=this.waypoints!=null||this.mouseDownCounter>1&&(i>this.graph.tolerance||n>this.graph.tolerance);if(r){this.waypoints==null&&(this.waypoints=[]);var s=this.graph.view.scale,e=new mxPoint(this.graph.snap(t.getGraphX()/s)*s,this.graph.snap(t.getGraphY()/s)*s);this.waypoints.push(e)}},mxConnectionHandler.prototype.checkConstraints=function(t,e){return t==null||e==null||t.point==null||e.point==null||!t.point.equals(e.point)||t.dx!=e.dx||t.dy!=e.dy||t.perimeter!=e.perimeter},mxConnectionHandler.prototype.mouseUp=function(t,e){if(!e.isConsumed()&&this.isConnecting()){if(this.waypointsEnabled&&!this.isStopEvent(e)){this.addWaypointForEvent(e),e.consume();return}var i=this.sourceConstraint,n=this.constraintHandler.currentConstraint,r=this.previous!=null?this.previous.cell:null,s=null;this.constraintHandler.currentConstraint!=null&&this.constraintHandler.currentFocus!=null&&(s=this.constraintHandler.currentFocus.cell),s==null&&this.currentState!=null&&(s=this.currentState.cell),this.error==null&&(r==null||s==null||r!=s||this.checkConstraints(i,n))?this.connect(r,s,e.getEvent(),e.getCell()):(this.previous!=null&&this.marker.validState!=null&&this.previous.cell==this.marker.validState.cell&&this.graph.selectCellForEvent(this.marker.source,e.getEvent()),this.error!=null&&this.error.length>0&&this.graph.validationAlert(this.error)),this.destroyIcons(),e.consume()}this.first!=null&&this.reset()},mxConnectionHandler.prototype.reset=function(){this.shape!=null&&(this.shape.destroy(),this.shape=null),this.cursor!=null&&this.graph.container!=null&&(this.graph.container.style.cursor=""),this.destroyIcons(),this.marker.reset(),this.constraintHandler.reset(),this.originalPoint=null,this.currentPoint=null,this.edgeState=null,this.previous=null,this.error=null,this.sourceConstraint=null,this.mouseDownCounter=0,this.first=null,this.fireEvent(new mxEventObject(mxEvent.RESET))},mxConnectionHandler.prototype.drawPreview=function(){this.updatePreview(this.error==null),this.shape.redraw()},mxConnectionHandler.prototype.updatePreview=function(t){this.shape.strokewidth=this.getEdgeWidth(t),this.shape.stroke=this.getEdgeColor(t)},mxConnectionHandler.prototype.getEdgeColor=function(t){return t?mxConstants.VALID_COLOR:mxConstants.INVALID_COLOR},mxConnectionHandler.prototype.getEdgeWidth=function(t){return t?3:1},mxConnectionHandler.prototype.connect=function(t,e,i,n){if(e!=null||this.isCreateTarget(i)||this.graph.allowDanglingEdges){var r=this.graph.getModel(),s=!1,l=null;r.beginUpdate();try{if(t!=null&&e==null&&!this.graph.isIgnoreTerminalEvent(i)&&this.isCreateTarget(i)&&(e=this.createTargetVertex(i,t),e!=null)){if(n=this.graph.getDropTarget([e],i,n),s=!0,n==null||!this.graph.getModel().isEdge(n)){var a=this.graph.getView().getState(n);if(a!=null){var o=r.getGeometry(e);o.x-=a.origin.x,o.y-=a.origin.y}}else n=this.graph.getDefaultParent();this.graph.addCell(e,n)}var u=this.graph.getDefaultParent();t!=null&&e!=null&&r.getParent(t)==r.getParent(e)&&r.getParent(r.getParent(t))!=r.getRoot()&&(u=r.getParent(t),t.geometry!=null&&t.geometry.relative&&e.geometry!=null&&e.geometry.relative&&(u=r.getParent(u)));var p=null,m=null;if(this.edgeState!=null&&(p=this.edgeState.cell.value,m=this.edgeState.cell.style),l=this.insertEdge(u,null,p,t,e,m),l!=null){this.graph.setConnectionConstraint(l,t,!0,this.sourceConstraint),this.graph.setConnectionConstraint(l,e,!1,this.constraintHandler.currentConstraint),this.edgeState!=null&&r.setGeometry(l,this.edgeState.cell.geometry);var u=r.getParent(t);if(this.isInsertBefore(l,t,e,i,n)){for(var d=null,o=t;o.parent!=null&&o.geometry!=null&&o.geometry.relative&&o.parent!=l.parent;)o=this.graph.model.getParent(o);o!=null&&o.parent!=null&&o.parent==l.parent&&r.add(u,l,o.parent.getIndex(o))}var x=r.getGeometry(l);if(x==null&&(x=new mxGeometry,x.relative=!0,r.setGeometry(l,x)),this.waypoints!=null&&this.waypoints.length>0){var f=this.graph.view.scale,g=this.graph.view.translate;x.points=[];for(var c=0;c0){var o=this.graph.view.getState(e);if(o!=null){var u=o.x/s-r.x,p=o.y/s-r.y;Math.abs(u-n.x)<=a&&(n.x=Math.round(u)),Math.abs(p-n.y)<=a&&(n.y=Math.round(p))}}}return i},mxConnectionHandler.prototype.getAlignmentTolerance=function(t){return this.graph.isGridEnabled()?this.graph.gridSize/2:this.graph.tolerance},mxConnectionHandler.prototype.createEdge=function(t,e,i,n){var r=null;if(this.factoryMethod!=null&&(r=this.factoryMethod(e,i,n)),r==null){r=new mxCell(t||""),r.setEdge(!0),r.setStyle(n);var s=new mxGeometry;s.relative=!0,r.setGeometry(s)}return r},mxConnectionHandler.prototype.destroy=function(){this.graph.removeMouseListener(this),this.shape!=null&&(this.shape.destroy(),this.shape=null),this.marker!=null&&(this.marker.destroy(),this.marker=null),this.constraintHandler!=null&&(this.constraintHandler.destroy(),this.constraintHandler=null),this.changeHandler!=null&&(this.graph.getModel().removeListener(this.changeHandler),this.graph.getView().removeListener(this.changeHandler),this.changeHandler=null),this.drillHandler!=null&&(this.graph.removeListener(this.drillHandler),this.graph.getView().removeListener(this.drillHandler),this.drillHandler=null),this.escapeHandler!=null&&(this.graph.removeListener(this.escapeHandler),this.escapeHandler=null)},__mxOutput.mxConnectionHandler=typeof mxConnectionHandler<"u"?mxConnectionHandler:void 0;function mxConstraintHandler(t){this.graph=t,this.resetHandler=mxUtils.bind(this,function(e,i){this.currentFocus!=null&&this.graph.view.getState(this.currentFocus.cell)==null?this.reset():this.redraw()}),this.graph.model.addListener(mxEvent.CHANGE,this.resetHandler),this.graph.view.addListener(mxEvent.SCALE_AND_TRANSLATE,this.resetHandler),this.graph.view.addListener(mxEvent.TRANSLATE,this.resetHandler),this.graph.view.addListener(mxEvent.SCALE,this.resetHandler),this.graph.addListener(mxEvent.ROOT,this.resetHandler)}mxConstraintHandler.prototype.pointImage=new mxImage(mxClient.imageBasePath+"/point.gif",5,5),mxConstraintHandler.prototype.graph=null,mxConstraintHandler.prototype.enabled=!0,mxConstraintHandler.prototype.highlightColor=mxConstants.DEFAULT_VALID_COLOR,mxConstraintHandler.prototype.isEnabled=function(){return this.enabled},mxConstraintHandler.prototype.setEnabled=function(t){this.enabled=t},mxConstraintHandler.prototype.reset=function(){if(this.focusIcons!=null){for(var t=0;to||Math.abs(a)>o)&&(this.div==null&&(this.div=this.createShape()),mxUtils.clearSelection(),this.update(r,s),e.consume())}},mxRubberband.prototype.createShape=function(){this.sharedDiv==null&&(this.sharedDiv=document.createElement("div"),this.sharedDiv.className="mxRubberband",mxUtils.setOpacity(this.sharedDiv,this.defaultOpacity)),this.graph.container.appendChild(this.sharedDiv);var t=this.sharedDiv;return mxClient.IS_SVG&&(!mxClient.IS_IE||document.documentMode>=10)&&this.fadeOut&&(this.sharedDiv=null),t},mxRubberband.prototype.isActive=function(t,e){return this.div!=null&&this.div.style.display!="none"},mxRubberband.prototype.mouseUp=function(t,e){var i=this.isActive();this.reset(),i&&(this.execute(e.getEvent()),e.consume())},mxRubberband.prototype.execute=function(t){var e=new mxRectangle(this.x,this.y,this.width,this.height);this.graph.selectRegion(e,t)},mxRubberband.prototype.reset=function(){if(this.div!=null)if(mxClient.IS_SVG&&(!mxClient.IS_IE||document.documentMode>=10)&&this.fadeOut){var t=this.div;mxUtils.setPrefixedStyle(t.style,"transition","all 0.2s linear"),t.style.pointerEvents="none",t.style.opacity=0,window.setTimeout(function(){t.parentNode.removeChild(t)},200)}else this.div.parentNode.removeChild(this.div);mxEvent.removeGestureListeners(document,null,this.dragHandler,this.dropHandler),this.dragHandler=null,this.dropHandler=null,this.currentX=0,this.currentY=0,this.first=null,this.div=null},mxRubberband.prototype.update=function(t,e){this.currentX=t,this.currentY=e,this.repaint()},mxRubberband.prototype.repaint=function(){if(this.div!=null){var t=this.currentX-this.graph.panDx,e=this.currentY-this.graph.panDy;this.x=Math.min(this.first.x,t),this.y=Math.min(this.first.y,e),this.width=Math.max(this.first.x,t)-this.x,this.height=Math.max(this.first.y,e)-this.y;var i=mxClient.IS_VML?this.graph.panDx:0,n=mxClient.IS_VML?this.graph.panDy:0;this.div.style.left=this.x+i+"px",this.div.style.top=this.y+n+"px",this.div.style.width=Math.max(1,this.width)+"px",this.div.style.height=Math.max(1,this.height)+"px"}},mxRubberband.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,this.graph.removeMouseListener(this),this.graph.removeListener(this.forceRubberbandHandler),this.graph.removeListener(this.panHandler),this.reset(),this.sharedDiv!=null&&(this.sharedDiv=null))},__mxOutput.mxRubberband=typeof mxRubberband<"u"?mxRubberband:void 0;function mxHandle(t,e,i,n){this.graph=t.view.graph,this.state=t,this.cursor=e??this.cursor,this.image=i??this.image,this.shape=n??null,this.init()}mxHandle.prototype.cursor="default",mxHandle.prototype.image=null,mxHandle.prototype.ignoreGrid=!1,mxHandle.prototype.getPosition=function(t){},mxHandle.prototype.setPosition=function(t,e,i){},mxHandle.prototype.execute=function(t){},mxHandle.prototype.copyStyle=function(t){this.graph.setCellStyles(t,this.state.style[t],[this.state.cell])},mxHandle.prototype.processEvent=function(t){var e=this.graph.view.scale,i=this.graph.view.translate,n=new mxPoint(t.getGraphX()/e-i.x,t.getGraphY()/e-i.y);this.shape!=null&&this.shape.bounds!=null&&(n.x-=this.shape.bounds.width/e/4,n.y-=this.shape.bounds.height/e/4);var r=-mxUtils.toRadians(this.getRotation()),s=-mxUtils.toRadians(this.getTotalRotation())-r;n=this.flipPoint(this.rotatePoint(this.snapPoint(this.rotatePoint(n,r),this.ignoreGrid||!this.graph.isGridEnabledEvent(t.getEvent())),s)),this.setPosition(this.state.getPaintBounds(),n,t),this.redraw()},mxHandle.prototype.positionChanged=function(){this.state.text!=null&&this.state.text.apply(this.state),this.state.shape!=null&&this.state.shape.apply(this.state),this.graph.cellRenderer.redraw(this.state,!0)},mxHandle.prototype.getRotation=function(){return this.state.shape!=null?this.state.shape.getRotation():0},mxHandle.prototype.getTotalRotation=function(){return this.state.shape!=null?this.state.shape.getShapeRotation():0},mxHandle.prototype.init=function(){var t=this.isHtmlRequired();this.image!=null?(this.shape=new mxImageShape(new mxRectangle(0,0,this.image.width,this.image.height),this.image.src),this.shape.preserveImageAspect=!1):this.shape==null&&(this.shape=this.createShape(t)),this.initShape(t)},mxHandle.prototype.createShape=function(t){var e=new mxRectangle(0,0,mxConstants.HANDLE_SIZE,mxConstants.HANDLE_SIZE);return new mxRectangleShape(e,mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR)},mxHandle.prototype.initShape=function(t){t&&this.shape.isHtmlAllowed()?(this.shape.dialect=mxConstants.DIALECT_STRICTHTML,this.shape.init(this.graph.container)):(this.shape.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG,this.cursor!=null&&this.shape.init(this.graph.getView().getOverlayPane())),mxEvent.redirectMouseEvents(this.shape.node,this.graph,this.state),this.shape.node.style.cursor=this.cursor},mxHandle.prototype.redraw=function(){if(this.shape!=null&&this.state.shape!=null){var t=this.getPosition(this.state.getPaintBounds());if(t!=null){var e=mxUtils.toRadians(this.getTotalRotation());t=this.rotatePoint(this.flipPoint(t),e);var i=this.graph.view.scale,n=this.graph.view.translate;this.shape.bounds.x=Math.floor((t.x+n.x)*i-this.shape.bounds.width/2),this.shape.bounds.y=Math.floor((t.y+n.y)*i-this.shape.bounds.height/2),this.shape.redraw()}}},mxHandle.prototype.isHtmlRequired=function(){return this.state.text!=null&&this.state.text.node.parentNode==this.graph.container},mxHandle.prototype.rotatePoint=function(t,e){var i=this.state.getCellBounds(),n=new mxPoint(i.getCenterX(),i.getCenterY()),r=Math.cos(e),s=Math.sin(e);return mxUtils.getRotatedPoint(t,r,s,n)},mxHandle.prototype.flipPoint=function(t){if(this.state.shape!=null){var e=this.state.getCellBounds();this.state.shape.flipH&&(t.x=2*e.x+e.width-t.x),this.state.shape.flipV&&(t.y=2*e.y+e.height-t.y)}return t},mxHandle.prototype.snapPoint=function(t,e){return e||(t.x=this.graph.snap(t.x),t.y=this.graph.snap(t.y)),t},mxHandle.prototype.setVisible=function(t){this.shape!=null&&this.shape.node!=null&&(this.shape.node.style.display=t?"":"none")},mxHandle.prototype.reset=function(){this.setVisible(!0),this.state.style=this.graph.getCellStyle(this.state.cell),this.positionChanged()},mxHandle.prototype.destroy=function(){this.shape!=null&&(this.shape.destroy(),this.shape=null)},__mxOutput.mxHandle=typeof mxHandle<"u"?mxHandle:void 0;function mxVertexHandler(t){t!=null&&(this.state=t,this.init(),this.escapeHandler=mxUtils.bind(this,function(e,i){this.livePreview&&this.index!=null&&(this.state.view.graph.cellRenderer.redraw(this.state,!0),this.state.view.invalidate(this.state.cell),this.state.invalid=!1,this.state.view.validate()),this.reset()}),this.state.view.graph.addListener(mxEvent.ESCAPE,this.escapeHandler))}mxVertexHandler.prototype.graph=null,mxVertexHandler.prototype.state=null,mxVertexHandler.prototype.singleSizer=!1,mxVertexHandler.prototype.index=null,mxVertexHandler.prototype.allowHandleBoundsCheck=!0,mxVertexHandler.prototype.handleImage=null,mxVertexHandler.prototype.handlesVisible=!0,mxVertexHandler.prototype.tolerance=0,mxVertexHandler.prototype.rotationEnabled=!1,mxVertexHandler.prototype.parentHighlightEnabled=!1,mxVertexHandler.prototype.rotationRaster=!0,mxVertexHandler.prototype.rotationCursor="crosshair",mxVertexHandler.prototype.livePreview=!1,mxVertexHandler.prototype.movePreviewToFront=!1,mxVertexHandler.prototype.manageSizers=!1,mxVertexHandler.prototype.constrainGroupByChildren=!1,mxVertexHandler.prototype.rotationHandleVSpacing=-16,mxVertexHandler.prototype.horizontalOffset=0,mxVertexHandler.prototype.verticalOffset=0,mxVertexHandler.prototype.init=function(){if(this.graph=this.state.view.graph,this.selectionBounds=this.getSelectionBounds(this.state),this.bounds=new mxRectangle(this.selectionBounds.x,this.selectionBounds.y,this.selectionBounds.width,this.selectionBounds.height),this.selectionBorder=this.createSelectionShape(this.bounds),this.selectionBorder.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,this.selectionBorder.pointerEvents=!1,this.selectionBorder.rotation=Number(this.state.style[mxConstants.STYLE_ROTATION]||"0"),this.selectionBorder.init(this.graph.getView().getOverlayPane()),mxEvent.redirectMouseEvents(this.selectionBorder.node,this.graph,this.state),this.graph.isCellMovable(this.state.cell)&&this.selectionBorder.setCursor(mxConstants.CURSOR_MOVABLE_VERTEX),mxGraphHandler.prototype.maxCells<=0||this.graph.getSelectionCount()=2&&this.state.height>=2){var e=0;t&&(this.singleSizer||(this.sizers.push(this.createSizer("nw-resize",e++)),this.sizers.push(this.createSizer("n-resize",e++)),this.sizers.push(this.createSizer("ne-resize",e++)),this.sizers.push(this.createSizer("w-resize",e++)),this.sizers.push(this.createSizer("e-resize",e++)),this.sizers.push(this.createSizer("sw-resize",e++)),this.sizers.push(this.createSizer("s-resize",e++))),this.sizers.push(this.createSizer("se-resize",e++)));var i=this.graph.model.getGeometry(this.state.cell);i!=null&&!i.relative&&!this.graph.isSwimlane(this.state.cell)&&this.graph.isLabelMovable(this.state.cell)&&(this.labelShape=this.createSizer(mxConstants.CURSOR_LABEL_HANDLE,mxEvent.LABEL_HANDLE,mxConstants.LABEL_HANDLE_SIZE,mxConstants.LABEL_HANDLE_FILLCOLOR),this.sizers.push(this.labelShape))}else this.graph.isCellMovable(this.state.cell)&&!this.graph.isCellResizable(this.state.cell)&&this.state.width<2&&this.state.height<2&&(this.labelShape=this.createSizer(mxConstants.CURSOR_MOVABLE_VERTEX,mxEvent.LABEL_HANDLE,null,mxConstants.LABEL_HANDLE_FILLCOLOR),this.sizers.push(this.labelShape))}this.isRotationHandleVisible()&&(this.rotationShape=this.createSizer(this.rotationCursor,mxEvent.ROTATION_HANDLE,mxConstants.HANDLE_SIZE+3,mxConstants.HANDLE_FILLCOLOR),this.sizers.push(this.rotationShape)),this.customHandles=this.createCustomHandles(),this.redraw(),this.constrainGroupByChildren&&this.updateMinBounds()},mxVertexHandler.prototype.isRotationHandleVisible=function(){return this.graph.isEnabled()&&this.rotationEnabled&&this.graph.isCellRotatable(this.state.cell)&&(mxGraphHandler.prototype.maxCells<=0||this.graph.getSelectionCount()0&&(this.minBounds=this.graph.view.getBounds(t),this.minBounds!=null)){var e=this.state.view.scale,i=this.state.view.translate;this.minBounds.x-=this.state.x,this.minBounds.y-=this.state.y,this.minBounds.x/=e,this.minBounds.y/=e,this.minBounds.width/=e,this.minBounds.height/=e,this.x0=this.state.x/e-i.x,this.y0=this.state.y/e-i.y}},mxVertexHandler.prototype.getSelectionBounds=function(t){return new mxRectangle(Math.round(t.x),Math.round(t.y),Math.round(t.width),Math.round(t.height))},mxVertexHandler.prototype.createParentHighlightShape=function(t){return this.createSelectionShape(t)},mxVertexHandler.prototype.createSelectionShape=function(t){var e=new mxRectangleShape(mxRectangle.fromRectangle(t),null,this.getSelectionColor());return e.strokewidth=this.getSelectionStrokeWidth(),e.isDashed=this.isSelectionDashed(),e},mxVertexHandler.prototype.getSelectionColor=function(){return mxConstants.VERTEX_SELECTION_COLOR},mxVertexHandler.prototype.getSelectionStrokeWidth=function(){return mxConstants.VERTEX_SELECTION_STROKEWIDTH},mxVertexHandler.prototype.isSelectionDashed=function(){return mxConstants.VERTEX_SELECTION_DASHED},mxVertexHandler.prototype.createSizer=function(t,e,i,n){i=i||mxConstants.HANDLE_SIZE;var r=new mxRectangle(0,0,i,i),s=this.createSizerShape(r,e,n);return s.isHtmlAllowed()&&this.state.text!=null&&this.state.text.node.parentNode==this.graph.container?(s.bounds.height-=1,s.bounds.width-=1,s.dialect=mxConstants.DIALECT_STRICTHTML,s.init(this.graph.container)):(s.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG,s.init(this.graph.getView().getOverlayPane())),mxEvent.redirectMouseEvents(s.node,this.graph,this.state),this.graph.isEnabled()&&s.setCursor(t),this.isSizerVisible(e)||(s.visible=!1),s},mxVertexHandler.prototype.isSizerVisible=function(t){return!0},mxVertexHandler.prototype.createSizerShape=function(t,e,i){if(this.handleImage!=null){t=new mxRectangle(t.x,t.y,this.handleImage.width,this.handleImage.height);var n=new mxImageShape(t,this.handleImage.src);return n.preserveImageAspect=!1,n}else return e==mxEvent.ROTATION_HANDLE?new mxEllipse(t,i||mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR):new mxRectangleShape(t,i||mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR)},mxVertexHandler.prototype.moveSizerTo=function(t,e,i){t!=null&&(t.bounds.x=Math.floor(e-t.bounds.width/2),t.bounds.y=Math.floor(i-t.bounds.height/2),t.node!=null&&t.node.style.display!="none"&&t.redraw())},mxVertexHandler.prototype.getHandleForEvent=function(t){var e=mxEvent.isMouseEvent(t.getEvent())?1:this.tolerance,i=this.allowHandleBoundsCheck&&(mxClient.IS_IE||e>0)?new mxRectangle(t.getGraphX()-e,t.getGraphY()-e,2*e,2*e):null,n=mxUtils.bind(this,function(s){var l=s!=null&&s.constructor!=mxImageShape&&this.allowHandleBoundsCheck?s.strokewidth+s.svgStrokeTolerance:null,a=l!=null?new mxRectangle(t.getGraphX()-Math.floor(l/2),t.getGraphY()-Math.floor(l/2),l,l):i;return s!=null&&(t.isSource(s)||a!=null&&mxUtils.intersects(s.bounds,a)&&s.node.style.display!="none"&&s.node.style.visibility!="hidden")});if(n(this.rotationShape))return mxEvent.ROTATION_HANDLE;if(n(this.labelShape))return mxEvent.LABEL_HANDLE;if(this.sizers!=null){for(var r=0;r=0;r--)if(n(this.customHandles[r].shape))return mxEvent.CUSTOM_HANDLE-r}return null},mxVertexHandler.prototype.isCustomHandleEvent=function(t){return!0},mxVertexHandler.prototype.mouseDown=function(t,e){if(!e.isConsumed()&&this.graph.isEnabled()){var i=this.getHandleForEvent(e);i!=null&&(this.start(e.getGraphX(),e.getGraphY(),i),e.consume())}},mxVertexHandler.prototype.isLivePreviewBorder=function(){return this.state.shape!=null&&this.state.shape.fill==null&&this.state.shape.stroke==null},mxVertexHandler.prototype.start=function(t,e,i){if(this.selectionBorder!=null)if(this.livePreviewActive=this.livePreview&&this.graph.model.getChildCount(this.state.cell)==0,this.inTolerance=!0,this.childOffsetX=0,this.childOffsetY=0,this.index=i,this.startX=t,this.startY=e,this.index<=mxEvent.CUSTOM_HANDLE&&this.isGhostPreview())this.ghostPreview=this.createGhostPreview();else{var n=this.state.view.graph.model,r=n.getParent(this.state.cell);if(this.state.view.currentRoot!=r&&(n.isVertex(r)||n.isEdge(r))&&(this.parentState=this.state.view.graph.view.getState(r)),this.selectionBorder.node.style.display=i==mxEvent.ROTATION_HANDLE?"inline":"none",(!this.livePreviewActive||this.isLivePreviewBorder())&&(this.preview=this.createSelectionShape(this.bounds),!(mxClient.IS_SVG&&Number(this.state.style[mxConstants.STYLE_ROTATION]||"0")!=0)&&this.state.text!=null&&this.state.text.node.parentNode==this.graph.container?(this.preview.dialect=mxConstants.DIALECT_STRICTHTML,this.preview.init(this.graph.container)):(this.preview.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,this.preview.init(this.graph.view.getOverlayPane()))),i==mxEvent.ROTATION_HANDLE){var s=this.getRotationHandlePosition(),l=s.x-this.state.getCenterX(),a=s.y-this.state.getCenterY();this.startAngle=l!=0?Math.atan(a/l)*180/Math.PI+90:0,this.startDist=Math.sqrt(l*l+a*a)}if(this.livePreviewActive){this.hideSizers(),i==mxEvent.ROTATION_HANDLE?this.rotationShape.node.style.display="":i==mxEvent.LABEL_HANDLE?this.labelShape.node.style.display="":this.sizers!=null&&this.sizers[i]!=null?this.sizers[i].node.style.display="":i<=mxEvent.CUSTOM_HANDLE&&this.customHandles!=null&&this.customHandles[mxEvent.CUSTOM_HANDLE-i].setVisible(!0);var o=this.graph.getEdges(this.state.cell);this.edgeHandlers=[];for(var u=0;uthis.graph.tolerance||Math.abs(t.getGraphY()-this.startY)>this.graph.tolerance)&&(this.inTolerance=!1)},mxVertexHandler.prototype.updateHint=function(t){},mxVertexHandler.prototype.removeHint=function(){},mxVertexHandler.prototype.roundAngle=function(t){return Math.round(t*10)/10},mxVertexHandler.prototype.roundLength=function(t){return Math.round(t*100)/100},mxVertexHandler.prototype.mouseMove=function(t,e){!e.isConsumed()&&this.index!=null?(this.checkTolerance(e),this.inTolerance||(this.index<=mxEvent.CUSTOM_HANDLE?this.customHandles!=null&&(this.customHandles[mxEvent.CUSTOM_HANDLE-this.index].processEvent(e),this.customHandles[mxEvent.CUSTOM_HANDLE-this.index].active=!0,this.ghostPreview!=null?(this.ghostPreview.apply(this.state),this.ghostPreview.strokewidth=this.getSelectionStrokeWidth()/this.ghostPreview.scale/this.ghostPreview.scale,this.ghostPreview.isDashed=this.isSelectionDashed(),this.ghostPreview.stroke=this.getSelectionColor(),this.ghostPreview.redraw(),this.selectionBounds!=null&&(this.selectionBorder.node.style.display="none")):(this.movePreviewToFront&&this.moveToFront(),this.customHandles[mxEvent.CUSTOM_HANDLE-this.index].positionChanged())):this.index==mxEvent.LABEL_HANDLE?this.moveLabel(e):(this.index==mxEvent.ROTATION_HANDLE?this.rotateVertex(e):this.resizeVertex(e),this.updateHint(e))),e.consume()):!this.graph.isMouseDown&&this.getHandleForEvent(e)!=null&&e.consume(!1)},mxVertexHandler.prototype.isGhostPreview=function(){return this.state.view.graph.model.getChildCount(this.state.cell)>0},mxVertexHandler.prototype.moveLabel=function(t){var e=new mxPoint(t.getGraphX(),t.getGraphY()),i=this.graph.view.translate,n=this.graph.view.scale;this.graph.isGridEnabledEvent(t.getEvent())&&(e.x=(this.graph.snap(e.x/n-i.x)+i.x)*n,e.y=(this.graph.snap(e.y/n-i.y)+i.y)*n);var r=this.rotationShape!=null?this.sizers.length-2:this.sizers.length-1;this.moveSizerTo(this.sizers[r],e.x,e.y)},mxVertexHandler.prototype.rotateVertex=function(t){var e=new mxPoint(t.getGraphX(),t.getGraphY()),i=this.state.x+this.state.width/2-e.x,n=this.state.y+this.state.height/2-e.y;if(this.currentAlpha=i!=0?Math.atan(n/i)*180/Math.PI+90:n<0?180:0,i>0&&(this.currentAlpha-=180),this.currentAlpha-=this.startAngle,this.rotationRaster&&this.graph.isGridEnabledEvent(t.getEvent())){var i=e.x-this.state.getCenterX(),n=e.y-this.state.getCenterY(),r=Math.sqrt(i*i+n*n);r-this.startDist<2?raster=15:r-this.startDist<25?raster=5:raster=1,this.currentAlpha=Math.round(this.currentAlpha/raster)*raster}else this.currentAlpha=this.roundAngle(this.currentAlpha);this.selectionBorder.rotation=this.currentAlpha,this.selectionBorder.redraw(),this.livePreviewActive&&this.redrawHandles()},mxVertexHandler.prototype.resizeVertex=function(t){var e=new mxPoint(this.state.getCenterX(),this.state.getCenterY()),i=mxUtils.toRadians(this.state.style[mxConstants.STYLE_ROTATION]||"0"),n=new mxPoint(t.getGraphX(),t.getGraphY()),r=this.graph.view.translate,s=this.graph.view.scale,l=Math.cos(-i),a=Math.sin(-i),c=n.x-this.startX,v=n.y-this.startY,o=l*c-a*v,u=a*c+l*v;c=o,v=u;var p=this.graph.getCellGeometry(this.state.cell);if(this.unscaledBounds=this.union(p,c/s,v/s,this.index,this.graph.isGridEnabledEvent(t.getEvent()),1,new mxPoint(0,0),this.isConstrainedEvent(t),this.isCenteredEvent(this.state,t)),!p.relative){var m=this.graph.getMaximumGraphBounds();if(m!=null&&this.parentState!=null&&(m=mxRectangle.fromRectangle(m),m.x-=(this.parentState.x-r.x*s)/s,m.y-=(this.parentState.y-r.y*s)/s),this.graph.isConstrainChild(this.state.cell)){var d=this.graph.getCellContainmentArea(this.state.cell);if(d!=null){var x=this.graph.getOverlap(this.state.cell);x>0&&(d=mxRectangle.fromRectangle(d),d.x-=d.width*x,d.y-=d.height*x,d.width+=2*d.width*x,d.height+=2*d.height*x),m==null?m=d:(m=mxRectangle.fromRectangle(m),m.intersect(d))}}m!=null&&(this.unscaledBounds.xm.x+m.width&&(this.unscaledBounds.width-=this.unscaledBounds.x+this.unscaledBounds.width-m.x-m.width),this.unscaledBounds.y+this.unscaledBounds.height>m.y+m.height&&(this.unscaledBounds.height-=this.unscaledBounds.y+this.unscaledBounds.height-m.y-m.height))}var f=this.bounds;this.bounds=new mxRectangle((this.parentState!=null?this.parentState.x:r.x*s)+this.unscaledBounds.x*s,(this.parentState!=null?this.parentState.y:r.y*s)+this.unscaledBounds.y*s,this.unscaledBounds.width*s,this.unscaledBounds.height*s),p.relative&&this.parentState!=null&&(this.bounds.x+=this.state.x-this.parentState.x,this.bounds.y+=this.state.y-this.parentState.y),l=Math.cos(i),a=Math.sin(i);var g=new mxPoint(this.bounds.getCenterX(),this.bounds.getCenterY()),c=g.x-e.x,v=g.y-e.y,y=l*c-a*v,T=a*c+l*v,C=y-c,S=T-v,E=this.bounds.x-this.state.x,L=this.bounds.y-this.state.y,A=l*E-a*L,M=a*E+l*L;this.bounds.x+=C,this.bounds.y+=S,this.unscaledBounds.x=this.roundLength(this.unscaledBounds.x+C/s),this.unscaledBounds.y=this.roundLength(this.unscaledBounds.y+S/s),this.unscaledBounds.width=this.roundLength(this.unscaledBounds.width),this.unscaledBounds.height=this.roundLength(this.unscaledBounds.height),!this.graph.isCellCollapsed(this.state.cell)&&(C!=0||S!=0)?(this.childOffsetX=this.state.x-this.bounds.x+A,this.childOffsetY=this.state.y-this.bounds.y+M):(this.childOffsetX=0,this.childOffsetY=0),f.equals(this.bounds)||(this.livePreviewActive&&this.updateLivePreview(t),this.preview!=null?this.drawPreview():this.updateParentHighlight())},mxVertexHandler.prototype.updateLivePreview=function(t){var e=this.graph.view.scale,i=this.graph.view.translate,n=this.state.clone();this.state.x=this.bounds.x,this.state.y=this.bounds.y,this.state.origin=new mxPoint(this.state.x/e-i.x,this.state.y/e-i.y),this.state.width=this.bounds.width,this.state.height=this.bounds.height;var r=this.state.absoluteOffset;r=new mxPoint(r.x,r.y),this.state.absoluteOffset.x=0,this.state.absoluteOffset.y=0;var s=this.graph.getCellGeometry(this.state.cell);if(s!=null){var l=s.offset||this.EMPTY_POINT;l!=null&&!s.relative&&(this.state.absoluteOffset.x=this.state.view.scale*l.x,this.state.absoluteOffset.y=this.state.view.scale*l.y),this.state.view.updateVertexLabelOffset(this.state)}this.state.view.graph.cellRenderer.redraw(this.state,!0),this.state.view.invalidate(this.state.cell),this.state.invalid=!1,this.state.view.validate(),this.redrawHandles(),this.movePreviewToFront&&this.moveToFront(),this.state.control!=null&&this.state.control.node!=null&&(this.state.control.node.style.visibility="hidden"),this.state.setState(n)},mxVertexHandler.prototype.moveToFront=function(){(this.state.text!=null&&this.state.text.node!=null&&this.state.text.node.nextSibling!=null||this.state.shape!=null&&this.state.shape.node!=null&&this.state.shape.node.nextSibling!=null&&(this.state.text==null||this.state.shape.node.nextSibling!=this.state.text.node))&&(this.state.shape!=null&&this.state.shape.node!=null&&this.state.shape.node.parentNode.appendChild(this.state.shape.node),this.state.text!=null&&this.state.text.node!=null&&this.state.text.node.parentNode.appendChild(this.state.text.node))},mxVertexHandler.prototype.mouseUp=function(t,e){if(this.index!=null&&this.state!=null){var i=new mxPoint(e.getGraphX(),e.getGraphY()),n=this.index;this.index=null,this.ghostPreview==null&&(this.state.view.invalidate(this.state.cell,!1,!1),this.state.view.validate()),this.graph.getModel().beginUpdate();try{if(n<=mxEvent.CUSTOM_HANDLE){if(this.customHandles!=null){var r=this.state.view.graph.getCellStyle(this.state.cell);this.customHandles[mxEvent.CUSTOM_HANDLE-n].active=!1,this.customHandles[mxEvent.CUSTOM_HANDLE-n].execute(e),this.customHandles!=null&&this.customHandles[mxEvent.CUSTOM_HANDLE-n]!=null&&(this.state.style=r,this.customHandles[mxEvent.CUSTOM_HANDLE-n].positionChanged())}}else if(n==mxEvent.ROTATION_HANDLE)if(this.currentAlpha!=null){var s=this.currentAlpha-(this.state.style[mxConstants.STYLE_ROTATION]||0);s!=0&&this.rotateCell(this.state.cell,s)}else this.rotateClick();else{var l=this.graph.isGridEnabledEvent(e.getEvent()),a=mxUtils.toRadians(this.state.style[mxConstants.STYLE_ROTATION]||"0"),o=Math.cos(-a),u=Math.sin(-a),p=i.x-this.startX,m=i.y-this.startY,d=o*p-u*m,x=u*p+o*m;p=d,m=x;var f=this.graph.view.scale,g=this.isRecursiveResize(this.state,e);this.resizeCell(this.state.cell,this.roundLength(p/f),this.roundLength(m/f),n,l,this.isConstrainedEvent(e),g)}}finally{this.graph.getModel().endUpdate()}e.consume(),this.reset(),this.redrawHandles()}},mxVertexHandler.prototype.isRecursiveResize=function(t,e){return this.graph.isRecursiveResize(this.state)},mxVertexHandler.prototype.rotateClick=function(){},mxVertexHandler.prototype.rotateCell=function(t,e,i){if(e!=0){var n=this.graph.getModel();if(n.isVertex(t)||n.isEdge(t)){if(!n.isEdge(t)){var r=this.graph.getCurrentCellStyle(t),s=(r[mxConstants.STYLE_ROTATION]||0)+e;this.graph.setCellStyles(mxConstants.STYLE_ROTATION,s,[t])}var l=this.graph.getCellGeometry(t);if(l!=null){var a=this.graph.getCellGeometry(i);if(a!=null&&!n.isEdge(i)&&(l=l.clone(),l.rotate(e,new mxPoint(a.width/2,a.height/2)),n.setGeometry(t,l)),n.isVertex(t)&&!l.relative||n.isEdge(t))for(var o=n.getChildCount(t),u=0;u4?(v=v+i,r?v=this.graph.snap(v/s)*s:v=Math.round(v/s)*s):n<3&&(c=c+i,r?c=this.graph.snap(c/s)*s:c=Math.round(c/s)*s),n==0||n==3||n==5?(f+=e,r?f=this.graph.snap(f/s)*s:f=Math.round(f/s)*s):(n==2||n==4||n==7)&&(g+=e,r?g=this.graph.snap(g/s)*s:g=Math.round(g/s)*s);var C=g-f,S=v-c;if(a){var E=this.graph.getCellGeometry(this.state.cell);if(E!=null){var L=E.width/E.height;n==1||n==2||n==7||n==6?C=S*L:S=C/L,n==0&&(f=g-C,c=v-S)}}if(o){C+=C-d,S+=S-x;var A=y-(f+C/2),M=T-(c+S/2);f+=A,c+=M,g+=A,v+=M}C<0&&(f+=C,C=Math.abs(C)),S<0&&(c+=S,S=Math.abs(S));var I=new mxRectangle(f+l.x*s,c+l.y*s,C,S);return this.minBounds!=null&&(I.width=Math.max(I.width,this.minBounds.x*s+this.minBounds.width*s+Math.max(0,this.x0*s-I.x)),I.height=Math.max(I.height,this.minBounds.y*s+this.minBounds.height*s+Math.max(0,this.y0*s-I.y))),I}},mxVertexHandler.prototype.redraw=function(t){this.selectionBounds=this.getSelectionBounds(this.state),this.bounds=new mxRectangle(this.selectionBounds.x,this.selectionBounds.y,this.selectionBounds.width,this.selectionBounds.height),this.drawPreview(),t||this.redrawHandles()},mxVertexHandler.prototype.getHandlePadding=function(){var t=new mxPoint(0,0),e=this.tolerance;return this.sizers!=null&&this.sizers.length>0&&this.sizers[0]!=null&&(this.bounds.width<2*this.sizers[0].bounds.width+2*e||this.bounds.height<2*this.sizers[0].bounds.height+2*e)&&(e/=2,t.x=this.sizers[0].bounds.width+e,t.y=this.sizers[0].bounds.height+e),t},mxVertexHandler.prototype.getSizerBounds=function(){return this.bounds},mxVertexHandler.prototype.redrawHandles=function(){var t=this.getSizerBounds(),e=this.tolerance;if(this.horizontalOffset=0,this.verticalOffset=0,this.customHandles!=null)for(var i=0;i0&&this.sizers[0]!=null){if(this.index==null&&this.manageSizers&&this.sizers.length>=8){var r=this.getHandlePadding();this.horizontalOffset=r.x,this.verticalOffset=r.y,(this.horizontalOffset!=0||this.verticalOffset!=0)&&(t=new mxRectangle(t.x,t.y,t.width,t.height),t.x-=this.horizontalOffset/2,t.width+=this.horizontalOffset,t.y-=this.verticalOffset/2,t.height+=this.verticalOffset),this.sizers.length>=8&&(t.width<2*this.sizers[0].bounds.width+2*e||t.height<2*this.sizers[0].bounds.height+2*e?(this.sizers[0].node.style.display="none",this.sizers[2].node.style.display="none",this.sizers[5].node.style.display="none",this.sizers[7].node.style.display="none"):this.handlesVisible&&(this.sizers[0].node.style.display="",this.sizers[2].node.style.display="",this.sizers[5].node.style.display="",this.sizers[7].node.style.display=""))}var s=t.x+t.width,l=t.y+t.height;if(this.singleSizer)this.moveSizerTo(this.sizers[0],s,l);else{var a=t.x+t.width/2,o=t.y+t.height/2;if(this.sizers.length>=8){var u=["nw-resize","n-resize","ne-resize","e-resize","se-resize","s-resize","sw-resize","w-resize"],p=mxUtils.toRadians(this.state.style[mxConstants.STYLE_ROTATION]||"0"),m=Math.cos(p),d=Math.sin(p),x=Math.round(p*4/Math.PI),f=new mxPoint(t.getCenterX(),t.getCenterY()),g=mxUtils.getRotatedPoint(new mxPoint(t.x,t.y),m,d,f);this.moveSizerTo(this.sizers[0],g.x,g.y),this.sizers[0].setCursor(u[mxUtils.mod(0+x,u.length)]),g.x=a,g.y=t.y,g=mxUtils.getRotatedPoint(g,m,d,f),this.moveSizerTo(this.sizers[1],g.x,g.y),this.sizers[1].setCursor(u[mxUtils.mod(1+x,u.length)]),g.x=s,g.y=t.y,g=mxUtils.getRotatedPoint(g,m,d,f),this.moveSizerTo(this.sizers[2],g.x,g.y),this.sizers[2].setCursor(u[mxUtils.mod(2+x,u.length)]),g.x=t.x,g.y=o,g=mxUtils.getRotatedPoint(g,m,d,f),this.moveSizerTo(this.sizers[3],g.x,g.y),this.sizers[3].setCursor(u[mxUtils.mod(7+x,u.length)]),g.x=s,g.y=o,g=mxUtils.getRotatedPoint(g,m,d,f),this.moveSizerTo(this.sizers[4],g.x,g.y),this.sizers[4].setCursor(u[mxUtils.mod(3+x,u.length)]),g.x=t.x,g.y=l,g=mxUtils.getRotatedPoint(g,m,d,f),this.moveSizerTo(this.sizers[5],g.x,g.y),this.sizers[5].setCursor(u[mxUtils.mod(6+x,u.length)]),g.x=a,g.y=l,g=mxUtils.getRotatedPoint(g,m,d,f),this.moveSizerTo(this.sizers[6],g.x,g.y),this.sizers[6].setCursor(u[mxUtils.mod(5+x,u.length)]),g.x=s,g.y=l,g=mxUtils.getRotatedPoint(g,m,d,f),this.moveSizerTo(this.sizers[7],g.x,g.y),this.sizers[7].setCursor(u[mxUtils.mod(4+x,u.length)]),g.x=a+this.state.absoluteOffset.x,g.y=o+this.state.absoluteOffset.y,g=mxUtils.getRotatedPoint(g,m,d,f),this.moveSizerTo(this.sizers[8],g.x,g.y)}else this.state.width>=2&&this.state.height>=2?this.moveSizerTo(this.sizers[0],a+this.state.absoluteOffset.x,o+this.state.absoluteOffset.y):this.moveSizerTo(this.sizers[0],this.state.x,this.state.y)}}if(this.rotationShape!=null){var p=mxUtils.toRadians(this.currentAlpha!=null?this.currentAlpha:this.state.style[mxConstants.STYLE_ROTATION]||"0"),m=Math.cos(p),d=Math.sin(p),f=new mxPoint(this.state.getCenterX(),this.state.getCenterY()),g=mxUtils.getRotatedPoint(this.getRotationHandlePosition(),m,d,f);this.rotationShape.node!=null&&(this.moveSizerTo(this.rotationShape,g.x,g.y),this.rotationShape.node.style.visibility=this.state.view.graph.isEditing()||!this.handlesVisible?"hidden":"")}if(this.selectionBorder!=null&&(this.selectionBorder.rotation=Number(this.state.style[mxConstants.STYLE_ROTATION]||"0")),this.edgeHandlers!=null)for(var i=0;i0)?new mxRectangle(t.getGraphX()-i,t.getGraphY()-i,2*i,2*i):null,r=null;if(this.customHandles!=null&&this.isCustomHandleEvent(t)){for(var s=this.customHandles.length-1;s>=0;s--)if(l(this.customHandles[s].shape))return mxEvent.CUSTOM_HANDLE-s}if((t.isSource(this.state.text)||l(this.labelShape))&&(e=mxEvent.LABEL_HANDLE),this.bends!=null)for(var s=0;smxEvent.VIRTUAL_HANDLE&&this.customHandles!=null)for(var s=0;s0&&this.isSnapToTerminalsEvent(t)){let u=function(m){if(m!=null){var d=m.x;Math.abs(n.x-d)0&&fmxEvent.VIRTUAL_HANDLE&&(n[this.index-1]=r)}else this.graph.resetEdgesOnConnect&&(n=null);return s??n},mxEdgeHandler.prototype.isOutlineConnectEvent=function(t){var e=mxUtils.getOffset(this.graph.container),i=t.getEvent(),n=mxEvent.getClientX(i),r=mxEvent.getClientY(i),s=document.documentElement,l=(window.pageXOffset||s.scrollLeft)-(s.clientLeft||0),a=(window.pageYOffset||s.scrollTop)-(s.clientTop||0),o=this.currentPoint.x-this.graph.container.scrollLeft+e.x-l,u=this.currentPoint.y-this.graph.container.scrollTop+e.y-a;return this.outlineConnect&&!mxEvent.isShiftDown(t.getEvent())&&(t.isSource(this.marker.highlight.shape)||mxEvent.isAltDown(t.getEvent())&&t.getState()!=null||this.marker.highlight.isHighlightAt(n,r)||(o!=n||u!=r)&&t.getState()==null&&this.marker.highlight.isHighlightAt(o,u))},mxEdgeHandler.prototype.updatePreviewState=function(t,e,i,n,r){var s=this.isSource?i:this.state.getVisibleTerminalState(!0),l=this.isTarget?i:this.state.getVisibleTerminalState(!1),a=this.graph.getConnectionConstraint(t,s,!0),o=this.graph.getConnectionConstraint(t,l,!1),u=this.constraintHandler.currentConstraint;if(u==null&&r&&(i!=null?(n.isSource(this.marker.highlight.shape)&&(e=new mxPoint(n.getGraphX(),n.getGraphY())),u=this.graph.getOutlineConstraint(e,i,n),this.constraintHandler.setFocus(n,i,this.isSource),this.constraintHandler.currentConstraint=u,this.constraintHandler.currentPoint=e):u=new mxConnectionConstraint),this.outlineConnect&&this.marker.highlight!=null&&this.marker.highlight.shape!=null){var p=this.graph.view.scale;this.constraintHandler.currentConstraint!=null&&this.constraintHandler.currentFocus!=null?(this.marker.highlight.shape.stroke=r?mxConstants.OUTLINE_HIGHLIGHT_COLOR:"transparent",this.marker.highlight.shape.strokewidth=mxConstants.OUTLINE_HIGHLIGHT_STROKEWIDTH/p/p,this.marker.highlight.repaint()):this.marker.hasValidState()&&(this.marker.highlight.shape.stroke=this.graph.isCellConnectable(n.getCell())&&this.marker.getValidState()!=n.getState()?"transparent":mxConstants.DEFAULT_VALID_COLOR,this.marker.highlight.shape.strokewidth=mxConstants.HIGHLIGHT_STROKEWIDTH/p/p,this.marker.highlight.repaint())}this.isSource?a=u:this.isTarget&&(o=u),(this.isSource||this.isTarget)&&(u!=null&&u.point!=null?(t.style[this.isSource?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X]=u.point.x,t.style[this.isSource?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y]=u.point.y):(delete t.style[this.isSource?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X],delete t.style[this.isSource?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y])),t.setVisibleTerminalState(s,!0),t.setVisibleTerminalState(l,!1),(!this.isSource||s!=null)&&t.view.updateFixedTerminalPoint(t,s,!0,a),(!this.isTarget||l!=null)&&t.view.updateFixedTerminalPoint(t,l,!1,o),(this.isSource||this.isTarget)&&i==null&&(t.setAbsoluteTerminalPoint(e,this.isSource),this.marker.getMarkedState()==null&&(this.error=this.graph.allowDanglingEdges?null:"")),t.view.updatePoints(t,this.points,s,l),t.view.updateFloatingTerminalPoints(t,s,l)},mxEdgeHandler.prototype.mouseMove=function(t,e){if(this.index!=null&&this.marker!=null){if(this.currentPoint=this.getPointForEvent(e),this.error=null,!this.graph.isIgnoreTerminalEvent(e.getEvent())&&mxEvent.isShiftDown(e.getEvent())&&this.snapPoint!=null&&(Math.abs(this.snapPoint.x-this.currentPoint.x)mxEvent.VIRTUAL_HANDLE)this.customHandles!=null&&(this.customHandles[mxEvent.CUSTOM_HANDLE-this.index].processEvent(e),this.customHandles[mxEvent.CUSTOM_HANDLE-this.index].positionChanged(),this.shape!=null&&this.shape.node!=null&&(this.shape.node.style.display="none"));else if(this.isLabel)this.label.x=this.currentPoint.x,this.label.y=this.currentPoint.y;else{this.points=this.getPreviewPoints(this.currentPoint,e);var i=this.isSource||this.isTarget?this.getPreviewTerminalState(e):null;if(this.constraintHandler.currentConstraint!=null&&this.constraintHandler.currentFocus!=null&&this.constraintHandler.currentPoint!=null)this.currentPoint=this.constraintHandler.currentPoint.clone();else if(this.outlineConnect){var n=this.isSource||this.isTarget?this.isOutlineConnectEvent(e):!1;n?i=this.marker.highlight.state:i!=null&&i!=e.getState()&&this.graph.isCellConnectable(e.getCell())&&this.marker.highlight.shape!=null&&(this.marker.highlight.shape.stroke="transparent",this.marker.highlight.repaint(),i=null)}i!=null&&!this.isCellEnabled(i.cell)&&(i=null,this.marker.reset());var r=this.clonePreviewState(this.currentPoint,i!=null?i.cell:null);this.updatePreviewState(r,this.currentPoint,i,e,n);var s=this.error==null?this.marker.validColor:this.marker.invalidColor;this.setPreviewColor(s),this.abspoints=r.absolutePoints,this.active=!0,this.updateHint(e,this.currentPoint)}this.drawPreview(),mxEvent.consume(e.getEvent()),e.consume()}else mxClient.IS_IE&&this.getHandleForEvent(e)!=null&&e.consume(!1)},mxEdgeHandler.prototype.mouseUp=function(t,e){if(this.index!=null&&this.marker!=null){this.shape!=null&&this.shape.node!=null&&(this.shape.node.style.display="");var i=this.state.cell,n=this.index;if(this.index=null,e.getX()!=this.startX||e.getY()!=this.startY){var r=!this.graph.isIgnoreTerminalEvent(e.getEvent())&&this.graph.isCloneEvent(e.getEvent())&&this.cloneEnabled&&this.graph.isCellsCloneable();if(this.error!=null)this.error.length>0&&this.graph.validationAlert(this.error);else if(n<=mxEvent.CUSTOM_HANDLE&&n>mxEvent.VIRTUAL_HANDLE){if(this.customHandles!=null){var s=this.graph.getModel();s.beginUpdate();try{this.customHandles[mxEvent.CUSTOM_HANDLE-n].execute(e),this.shape!=null&&this.shape.node!=null&&(this.shape.apply(this.state),this.shape.redraw())}finally{s.endUpdate()}}}else if(this.isLabel)this.moveLabel(this.state,this.label.x,this.label.y);else if(this.isSource||this.isTarget){var l=null;if(this.constraintHandler.currentConstraint!=null&&this.constraintHandler.currentFocus!=null&&(l=this.constraintHandler.currentFocus.cell),l==null&&this.marker.hasValidState()&&this.marker.highlight!=null&&this.marker.highlight.shape!=null&&this.marker.highlight.shape.stroke!="transparent"&&this.marker.highlight.shape.stroke!="white"&&(l=this.marker.validState.cell),l!=null){var s=this.graph.getModel(),a=s.getParent(i);s.beginUpdate();try{if(r){var o=s.getGeometry(i),r=this.graph.cloneCell(i);s.add(a,r,s.getChildCount(a)),o!=null&&(o=o.clone(),s.setGeometry(r,o));var u=s.getTerminal(i,!this.isSource);this.graph.connectCell(r,u,!this.isSource),i=r}i=this.connect(i,l,this.isSource,r,e)}finally{s.endUpdate()}}else if(this.graph.isAllowDanglingEdges()){var p=this.abspoints[this.isSource?0:this.abspoints.length-1];p.x=this.roundLength(p.x/this.graph.view.scale-this.graph.view.translate.x),p.y=this.roundLength(p.y/this.graph.view.scale-this.graph.view.translate.y);var m=this.graph.getView().getState(this.graph.getModel().getParent(i));m!=null&&(p.x-=m.origin.x,p.y-=m.origin.y),p.x-=this.graph.panDx/this.graph.view.scale,p.y-=this.graph.panDy/this.graph.view.scale,i=this.changeTerminalPoint(i,p,this.isSource,r)}}else this.active?i=this.changePoints(i,this.points,r):(this.graph.getView().invalidate(this.state.cell),this.graph.getView().validate(this.state.cell))}else this.graph.isToggleEvent(e.getEvent())&&this.graph.selectCellForEvent(this.state.cell,e.getEvent());this.marker!=null&&(this.reset(),i!=this.state.cell&&this.graph.setSelectionCell(i)),e.consume()}},mxEdgeHandler.prototype.reset=function(){if(this.active&&this.refresh(),this.error=null,this.index=null,this.label=null,this.points=null,this.snapPoint=null,this.isLabel=!1,this.isSource=!1,this.isTarget=!1,this.active=!1,this.livePreview&&this.sizers!=null)for(var t=0;t0&&e0&&i!=null){this.points==null&&(this.points=[]);for(var n=1;n0&&this.graph.isLabelMovable(t),this.bends!=null&&this.bends.length>0){var n=this.abspoints.length-1,r=this.abspoints[0],s=r.x,l=r.y;e=this.bends[0].bounds,this.bends[0].bounds=new mxRectangle(Math.floor(s-e.width/2),Math.floor(l-e.height/2),e.width,e.height),this.bends[0].fill=this.getHandleFillColor(0),this.bends[0].redraw(),this.manageLabelHandle&&this.checkLabelHandle(this.bends[0].bounds);var a=this.abspoints[n],o=a.x,u=a.y,p=this.bends.length-1;e=this.bends[p].bounds,this.bends[p].bounds=new mxRectangle(Math.floor(o-e.width/2),Math.floor(u-e.height/2),e.width,e.height),this.bends[p].fill=this.getHandleFillColor(p),this.bends[p].redraw(),this.manageLabelHandle&&this.checkLabelHandle(this.bends[p].bounds),this.redrawInnerBends(r,a)}if(this.abspoints!=null&&this.virtualBends!=null&&this.virtualBends.length>0){for(var m=this.abspoints[0],d=0;d1?(t=n[1],e=n[n.length-2]):i.points!=null&&i.points.length>0&&(r=n[0]),r==null?r=new mxPoint(t.x+(e.x-t.x)/2,t.y+(e.y-t.y)/2):r=new mxPoint(this.graph.getView().scale*(r.x+this.graph.getView().translate.x+this.state.origin.x),this.graph.getView().scale*(r.y+this.graph.getView().translate.y+this.state.origin.y));var s=this.bends[1].bounds,l=s.width,a=s.height,o=new mxRectangle(Math.round(r.x-l/2),Math.round(r.y-a/2),l,a);this.manageLabelHandle?this.checkLabelHandle(o):this.handleImage==null&&this.labelShape.visible&&mxUtils.intersects(o,this.labelShape.bounds)&&(l=mxConstants.HANDLE_SIZE+3,a=mxConstants.HANDLE_SIZE+3,o=new mxRectangle(Math.floor(r.x-l/2),Math.floor(r.y-a/2),l,a)),this.bends[1].bounds=o,this.bends[1].redraw(),this.manageLabelHandle&&this.checkLabelHandle(this.bends[1].bounds)},__mxOutput.mxElbowEdgeHandler=typeof mxElbowEdgeHandler<"u"?mxElbowEdgeHandler:void 0;function mxEdgeSegmentHandler(t){mxEdgeHandler.call(this,t)}mxUtils.extend(mxEdgeSegmentHandler,mxElbowEdgeHandler),mxEdgeSegmentHandler.prototype.getCurrentPoints=function(){var t=this.state.absolutePoints;if(t!=null){var e=Math.max(1,this.graph.view.scale);if(t.length==2||t.length==3&&(Math.abs(t[0].x-t[1].x)0){var o=this.abspoints,u=o[0],p=o[1];a=[];for(var m=2;m1){var n=!1;if(i.length==4&&Math.round(i[1].x-i[2].x)==0&&Math.round(i[1].y-i[2].y)==0)if(n=!0,Math.round(i[0].y-i[i.length-1].y)==0){var r=i[0].x+(i[i.length-1].x-i[0].x)/2;i[1]=new mxPoint(r,i[1].y),i[2]=new mxPoint(r,i[2].y)}else{var s=i[0].y+(i[i.length-1].y-i[0].y)/2;i[1]=new mxPoint(i[1].x,s),i[2]=new mxPoint(i[2].x,s)}for(var l=0;l0){this.div==null&&this.init();var n=mxUtils.getScrollOrigin();this.div.style.zIndex=this.zIndex,this.div.style.left=e+n.x+"px",this.div.style.top=i+mxConstants.TOOLTIP_VERTICAL_OFFSET+n.y+"px",mxUtils.isNode(t)?(this.div.innerHTML="",this.div.appendChild(t)):this.div.innerHTML=t.replace(/\n/g,"
"),this.div.style.visibility="",mxUtils.fit(this.div)}},mxTooltipHandler.prototype.destroy=function(){this.destroyed||(this.graph.removeMouseListener(this),mxEvent.release(this.div),this.div!=null&&this.div.parentNode!=null&&this.div.parentNode.removeChild(this.div),this.destroyed=!0,this.div=null)},__mxOutput.mxTooltipHandler=typeof mxTooltipHandler<"u"?mxTooltipHandler:void 0;function mxCellTracker(t,e,i){mxCellMarker.call(this,t,e),this.graph.addMouseListener(this),i!=null&&(this.getCell=i),mxClient.IS_IE&&mxEvent.addListener(window,"unload",mxUtils.bind(this,function(){this.destroy()}))}mxUtils.extend(mxCellTracker,mxCellMarker),mxCellTracker.prototype.mouseDown=function(t,e){},mxCellTracker.prototype.mouseMove=function(t,e){this.isEnabled()&&this.process(e)},mxCellTracker.prototype.mouseUp=function(t,e){},mxCellTracker.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,this.graph.removeMouseListener(this),mxCellMarker.prototype.destroy.apply(this))},__mxOutput.mxCellTracker=typeof mxCellTracker<"u"?mxCellTracker:void 0;function mxCellHighlight(t,e,i,n){t!=null&&(this.graph=t,this.highlightColor=e??mxConstants.DEFAULT_VALID_COLOR,this.strokeWidth=i??mxConstants.HIGHLIGHT_STROKEWIDTH,this.dashed=n??!1,this.opacity=mxConstants.HIGHLIGHT_OPACITY,this.repaintHandler=mxUtils.bind(this,function(){if(this.state!=null){var r=this.graph.view.getState(this.state.cell);r==null?this.hide():(this.state=r,this.repaint())}}),this.graph.getView().addListener(mxEvent.SCALE,this.repaintHandler),this.graph.getView().addListener(mxEvent.TRANSLATE,this.repaintHandler),this.graph.getView().addListener(mxEvent.SCALE_AND_TRANSLATE,this.repaintHandler),this.graph.getModel().addListener(mxEvent.CHANGE,this.repaintHandler),this.resetHandler=mxUtils.bind(this,function(){this.hide()}),this.graph.getView().addListener(mxEvent.DOWN,this.resetHandler),this.graph.getView().addListener(mxEvent.UP,this.resetHandler))}mxCellHighlight.prototype.keepOnTop=!1,mxCellHighlight.prototype.graph=null,mxCellHighlight.prototype.state=null,mxCellHighlight.prototype.spacing=2,mxCellHighlight.prototype.resetHandler=null,mxCellHighlight.prototype.setHighlightColor=function(t){this.highlightColor=t,this.shape!=null&&(this.shape.stroke=t)},mxCellHighlight.prototype.drawHighlight=function(){this.shape=this.createShape(),this.repaint(),!this.keepOnTop&&this.shape.node.parentNode.firstChild!=this.shape.node&&this.shape.node.parentNode.insertBefore(this.shape.node,this.shape.node.parentNode.firstChild)},mxCellHighlight.prototype.createShape=function(){var t=this.graph.cellRenderer.createShape(this.state);return t.svgStrokeTolerance=this.graph.tolerance,t.points=this.state.absolutePoints,t.apply(this.state),t.stroke=this.highlightColor,t.opacity=this.opacity,t.isDashed=this.dashed,t.isShadow=!1,t.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,t.init(this.graph.getView().getOverlayPane()),mxEvent.redirectMouseEvents(t.node,this.graph,this.state),this.graph.dialect!=mxConstants.DIALECT_SVG?t.pointerEvents=!1:t.svgPointerEvents="stroke",t},mxCellHighlight.prototype.getStrokeWidth=function(t){return this.strokeWidth},mxCellHighlight.prototype.repaint=function(){this.state!=null&&this.shape!=null&&(this.shape.scale=this.state.view.scale,this.graph.model.isEdge(this.state.cell)?(this.shape.strokewidth=this.getStrokeWidth(),this.shape.points=this.state.absolutePoints,this.shape.outline=!1):(this.shape.bounds=new mxRectangle(this.state.x-this.spacing,this.state.y-this.spacing,this.state.width+2*this.spacing,this.state.height+2*this.spacing),this.shape.rotation=Number(this.state.style[mxConstants.STYLE_ROTATION]||"0"),this.shape.strokewidth=this.getStrokeWidth()/this.state.view.scale,this.shape.outline=!0),this.state.shape!=null&&this.shape.setCursor(this.state.shape.getCursor()),(mxClient.IS_QUIRKS||document.documentMode==8)&&(this.shape.stroke=="transparent"?(this.shape.stroke="white",this.shape.opacity=1):this.shape.opacity=this.opacity),this.shape.redraw())},mxCellHighlight.prototype.hide=function(){this.highlight(null)},mxCellHighlight.prototype.highlight=function(t){this.state!=t&&(this.shape!=null&&(this.shape.destroy(),this.shape=null),this.state=t,this.state!=null&&this.drawHighlight())},mxCellHighlight.prototype.isHighlightAt=function(t,e){var i=!1;if(this.shape!=null&&document.elementFromPoint!=null&&!mxClient.IS_QUIRKS)for(var n=document.elementFromPoint(t,e);n!=null;){if(n==this.shape.node){i=!0;break}n=n.parentNode}return i},mxCellHighlight.prototype.destroy=function(){this.graph.getView().removeListener(this.resetHandler),this.graph.getView().removeListener(this.repaintHandler),this.graph.getModel().removeListener(this.repaintHandler),this.shape!=null&&(this.shape.destroy(),this.shape=null)},__mxOutput.mxCellHighlight=typeof mxCellHighlight<"u"?mxCellHighlight:void 0;function mxDefaultKeyHandler(t){if(t!=null){this.editor=t,this.handler=new mxKeyHandler(t.graph);var e=this.handler.escape;this.handler.escape=function(i){e.apply(this,arguments),t.hideProperties(),t.fireEvent(new mxEventObject(mxEvent.ESCAPE,"event",i))}}}mxDefaultKeyHandler.prototype.editor=null,mxDefaultKeyHandler.prototype.handler=null,mxDefaultKeyHandler.prototype.bindAction=function(t,e,i){var n=mxUtils.bind(this,function(){this.editor.execute(e)});i?this.handler.bindControlKey(t,n):this.handler.bindKey(t,n)},mxDefaultKeyHandler.prototype.destroy=function(){this.handler.destroy(),this.handler=null},__mxOutput.mxDefaultKeyHandler=typeof mxDefaultKeyHandler<"u"?mxDefaultKeyHandler:void 0;function mxDefaultPopupMenu(t){this.config=t}mxDefaultPopupMenu.prototype.imageBasePath=null,mxDefaultPopupMenu.prototype.config=null,mxDefaultPopupMenu.prototype.createMenu=function(t,e,i,n){if(this.config!=null){var r=this.createConditions(t,i,n),s=this.config.firstChild;this.addItems(t,e,i,n,r,s,null)}},mxDefaultPopupMenu.prototype.addItems=function(t,e,i,n,r,s,l){for(var a=!1;s!=null;){if(s.nodeName=="add"){var o=s.getAttribute("if");if(o==null||r[o]){var u=s.getAttribute("as");u=mxResources.get(u)||u;var p=mxUtils.eval(mxUtils.getTextContent(s)),m=s.getAttribute("action"),d=s.getAttribute("icon"),x=s.getAttribute("iconCls"),f=s.getAttribute("enabled-if"),g=f==null||r[f];a&&(e.addSeparator(l),a=!1),d!=null&&this.imageBasePath&&(d=this.imageBasePath+d);var c=this.addAction(e,t,u,d,p,m,i,l,x,g);this.addItems(t,e,i,n,r,s.firstChild,c)}}else s.nodeName=="separator"&&(a=!0);s=s.nextSibling}},mxDefaultPopupMenu.prototype.addAction=function(t,e,i,n,r,s,l,a,o,u){var p=function(m){typeof r=="function"&&r.call(e,e,l,m),s!=null&&e.execute(s,l,m)};return t.addItem(i,n,p,a,o,u)},mxDefaultPopupMenu.prototype.createConditions=function(t,e,i){var n=t.graph.getModel(),r=n.getChildCount(e),s=[];s.nocell=e==null,s.ncells=t.graph.getSelectionCount()>1,s.notRoot=n.getRoot()!=n.getParent(t.graph.getDefaultParent()),s.cell=e!=null;var l=e!=null&&t.graph.getSelectionCount()==1;s.nonEmpty=l&&r>0,s.expandable=l&&t.graph.isCellFoldable(e,!1),s.collapsable=l&&t.graph.isCellFoldable(e,!0),s.validRoot=l&&t.graph.isValidRoot(e),s.emptyValidRoot=s.validRoot&&r==0,s.swimlane=l&&t.graph.isSwimlane(e);for(var a=this.config.getElementsByTagName("condition"),o=0;o0&&this.editor.execute(i)});return this.toolbar.addItem(t,e,r,n)},mxDefaultToolbar.prototype.addSeparator=function(t){t=t||mxClient.imageBasePath+"/separator.gif",this.toolbar.addSeparator(t)},mxDefaultToolbar.prototype.addCombo=function(){return this.toolbar.addCombo()},mxDefaultToolbar.prototype.addActionCombo=function(t){return this.toolbar.addActionCombo(t)},mxDefaultToolbar.prototype.addActionOption=function(t,e,i){var n=mxUtils.bind(this,function(){this.editor.execute(i)});this.addOption(t,e,n)},mxDefaultToolbar.prototype.addOption=function(t,e,i){return this.toolbar.addOption(t,e,i)},mxDefaultToolbar.prototype.addMode=function(t,e,i,n,r){var s=mxUtils.bind(this,function(){this.editor.setMode(i),r?.(this.editor)});return this.toolbar.addSwitchMode(t,e,s,n)},mxDefaultToolbar.prototype.addPrototype=function(t,e,i,n,r,s){var l=mxUtils.bind(this,function(){return typeof i=="function"?i():i!=null?this.editor.graph.cloneCell(i):null}),a=mxUtils.bind(this,function(p,m){typeof r=="function"?r(this.editor,l(),p,m):this.drop(l(),p,m),this.toolbar.resetMode(),mxEvent.consume(p)}),o=this.toolbar.addMode(t,e,a,n,null,s),u=function(p,m,d){a(m,d)};return this.installDropHandler(o,u),o},mxDefaultToolbar.prototype.drop=function(t,e,i){var n=this.editor.graph,r=n.getModel();if(i==null||r.isEdge(i)||!this.connectOnDrop||!n.isCellConnectable(i)){for(;i!=null&&!n.isValidDropTarget(i,[t],e);)i=r.getParent(i);this.insert(t,e,i)}else this.connect(t,e,i)},mxDefaultToolbar.prototype.insert=function(t,e,i){var n=this.editor.graph;if(n.canImportCell(t)){var r=mxEvent.getClientX(e),s=mxEvent.getClientY(e),l=mxUtils.convertPoint(n.container,r,s);return n.isSplitEnabled()&&n.isSplitTarget(i,[t],e)?n.splitEdge(i,[t],null,l.x,l.y):this.editor.addVertex(i,t,l.x,l.y)}return null},mxDefaultToolbar.prototype.connect=function(t,e,i){var n=this.editor.graph,r=n.getModel();if(i!=null&&n.isCellConnectable(t)&&n.isEdgeValid(null,i,t)){var s=null;r.beginUpdate();try{var l=r.getGeometry(i),a=r.getGeometry(t).clone();a.x=l.x+(l.width-a.width)/2,a.y=l.y+(l.height-a.height)/2;var o=this.spacing*n.gridSize,u=r.getDirectedEdgeCount(i,!0)*20;this.editor.horizontalFlow?a.x+=(a.width+l.width)/2+o+u:a.y+=(a.height+l.height)/2+o+u,t.setGeometry(a);var p=r.getParent(i);if(n.addCell(t,p),n.constrainChild(t),s=this.editor.createEdge(i,t),r.getGeometry(s)==null){var m=new mxGeometry;m.relative=!0,r.setGeometry(s,m)}n.addEdge(s,p,i,t)}finally{r.endUpdate()}n.setSelectionCells([t,s]),n.scrollCellToVisible(t)}},mxDefaultToolbar.prototype.installDropHandler=function(t,e){var i=document.createElement("img");i.setAttribute("src",t.getAttribute("src"));var n=mxUtils.bind(this,function(r){i.style.width=2*t.offsetWidth+"px",i.style.height=2*t.offsetHeight+"px",mxUtils.makeDraggable(t,this.editor.graph,e,i),mxEvent.removeListener(i,"load",n)});mxClient.IS_IE?n():mxEvent.addListener(i,"load",n)},mxDefaultToolbar.prototype.destroy=function(){this.resetHandler!=null&&(this.editor.graph.removeListener("dblclick",this.resetHandler),this.editor.removeListener("escape",this.resetHandler),this.resetHandler=null),this.toolbar!=null&&(this.toolbar.destroy(),this.toolbar=null)},__mxOutput.mxDefaultToolbar=typeof mxDefaultToolbar<"u"?mxDefaultToolbar:void 0;function mxEditor(t){this.actions=[],this.addActions(),document.body!=null&&(this.cycleAttributeValues=[],this.popupHandler=new mxDefaultPopupMenu,this.undoManager=new mxUndoManager,this.graph=this.createGraph(),this.toolbar=this.createToolbar(),this.keyHandler=new mxDefaultKeyHandler(this),this.configure(t),this.graph.swimlaneIndicatorColorAttribute=this.cycleAttributeName,this.onInit!=null&&this.onInit(),mxClient.IS_IE&&mxEvent.addListener(window,"unload",mxUtils.bind(this,function(){this.destroy()})))}mxLoadResources?mxResources.add(mxClient.basePath+"/resources/editor"):mxClient.defaultBundles.push(mxClient.basePath+"/resources/editor"),mxEditor.prototype=new mxEventSource,mxEditor.prototype.constructor=mxEditor,mxEditor.prototype.askZoomResource=mxClient.language!="none"?"askZoom":"",mxEditor.prototype.lastSavedResource=mxClient.language!="none"?"lastSaved":"",mxEditor.prototype.currentFileResource=mxClient.language!="none"?"currentFile":"",mxEditor.prototype.propertiesResource=mxClient.language!="none"?"properties":"",mxEditor.prototype.tasksResource=mxClient.language!="none"?"tasks":"",mxEditor.prototype.helpResource=mxClient.language!="none"?"help":"",mxEditor.prototype.outlineResource=mxClient.language!="none"?"outline":"",mxEditor.prototype.outline=null,mxEditor.prototype.graph=null,mxEditor.prototype.graphRenderHint=null,mxEditor.prototype.toolbar=null,mxEditor.prototype.status=null,mxEditor.prototype.popupHandler=null,mxEditor.prototype.undoManager=null,mxEditor.prototype.keyHandler=null,mxEditor.prototype.actions=null,mxEditor.prototype.dblClickAction="edit",mxEditor.prototype.swimlaneRequired=!1,mxEditor.prototype.disableContextMenu=!0,mxEditor.prototype.insertFunction=null,mxEditor.prototype.forcedInserting=!1,mxEditor.prototype.templates=null,mxEditor.prototype.defaultEdge=null,mxEditor.prototype.defaultEdgeStyle=null,mxEditor.prototype.defaultGroup=null,mxEditor.prototype.groupBorderSize=null,mxEditor.prototype.filename=null,mxEditor.prototype.linefeed=" ",mxEditor.prototype.postParameterName="xml",mxEditor.prototype.escapePostData=!0,mxEditor.prototype.urlPost=null,mxEditor.prototype.urlImage=null,mxEditor.prototype.horizontalFlow=!1,mxEditor.prototype.layoutDiagram=!1,mxEditor.prototype.swimlaneSpacing=0,mxEditor.prototype.maintainSwimlanes=!1,mxEditor.prototype.layoutSwimlanes=!1,mxEditor.prototype.cycleAttributeValues=null,mxEditor.prototype.cycleAttributeIndex=0,mxEditor.prototype.cycleAttributeName="fillColor",mxEditor.prototype.tasks=null,mxEditor.prototype.tasksWindowImage=null,mxEditor.prototype.tasksTop=20,mxEditor.prototype.help=null,mxEditor.prototype.helpWindowImage=null,mxEditor.prototype.urlHelp=null,mxEditor.prototype.helpWidth=300,mxEditor.prototype.helpHeight=260,mxEditor.prototype.propertiesWidth=240,mxEditor.prototype.propertiesHeight=null,mxEditor.prototype.movePropertiesDialog=!1,mxEditor.prototype.validating=!1,mxEditor.prototype.modified=!1,mxEditor.prototype.isModified=function(){return this.modified},mxEditor.prototype.setModified=function(t){this.modified=t},mxEditor.prototype.addActions=function(){this.addAction("save",function(t){t.save()}),this.addAction("print",function(t){var e=new mxPrintPreview(t.graph,1);e.open()}),this.addAction("show",function(t){mxUtils.show(t.graph,null,10,10)}),this.addAction("exportImage",function(t){var e=t.getUrlImage();if(e==null||mxClient.IS_LOCAL)t.execute("show");else{var i=mxUtils.getViewXml(t.graph,1),n=mxUtils.getXml(i,` +`);mxUtils.submit(e,t.postParameterName+"="+encodeURIComponent(n),document,"_blank")}}),this.addAction("refresh",function(t){t.graph.refresh()}),this.addAction("cut",function(t){t.graph.isEnabled()&&mxClipboard.cut(t.graph)}),this.addAction("copy",function(t){t.graph.isEnabled()&&mxClipboard.copy(t.graph)}),this.addAction("paste",function(t){t.graph.isEnabled()&&mxClipboard.paste(t.graph)}),this.addAction("delete",function(t){t.graph.isEnabled()&&t.graph.removeCells()}),this.addAction("group",function(t){t.graph.isEnabled()&&t.graph.setSelectionCell(t.groupCells())}),this.addAction("ungroup",function(t){t.graph.isEnabled()&&t.graph.setSelectionCells(t.graph.ungroupCells())}),this.addAction("removeFromParent",function(t){t.graph.isEnabled()&&t.graph.removeCellsFromParent()}),this.addAction("undo",function(t){t.graph.isEnabled()&&t.undo()}),this.addAction("redo",function(t){t.graph.isEnabled()&&t.redo()}),this.addAction("zoomIn",function(t){t.graph.zoomIn()}),this.addAction("zoomOut",function(t){t.graph.zoomOut()}),this.addAction("actualSize",function(t){t.graph.zoomActual()}),this.addAction("fit",function(t){t.graph.fit()}),this.addAction("showProperties",function(t,e){t.showProperties(e)}),this.addAction("selectAll",function(t){t.graph.isEnabled()&&t.graph.selectAll()}),this.addAction("selectNone",function(t){t.graph.isEnabled()&&t.graph.clearSelection()}),this.addAction("selectVertices",function(t){t.graph.isEnabled()&&t.graph.selectVertices()}),this.addAction("selectEdges",function(t){t.graph.isEnabled()&&t.graph.selectEdges()}),this.addAction("edit",function(t,e){t.graph.isEnabled()&&t.graph.isCellEditable(e)&&t.graph.startEditingAtCell(e)}),this.addAction("toBack",function(t,e){t.graph.isEnabled()&&t.graph.orderCells(!0)}),this.addAction("toFront",function(t,e){t.graph.isEnabled()&&t.graph.orderCells(!1)}),this.addAction("enterGroup",function(t,e){t.graph.enterGroup(e)}),this.addAction("exitGroup",function(t){t.graph.exitGroup()}),this.addAction("home",function(t){t.graph.home()}),this.addAction("selectPrevious",function(t){t.graph.isEnabled()&&t.graph.selectPreviousCell()}),this.addAction("selectNext",function(t){t.graph.isEnabled()&&t.graph.selectNextCell()}),this.addAction("selectParent",function(t){t.graph.isEnabled()&&t.graph.selectParentCell()}),this.addAction("selectChild",function(t){t.graph.isEnabled()&&t.graph.selectChildCell()}),this.addAction("collapse",function(t){t.graph.isEnabled()&&t.graph.foldCells(!0)}),this.addAction("collapseAll",function(t){if(t.graph.isEnabled()){var e=t.graph.getChildVertices();t.graph.foldCells(!0,!1,e)}}),this.addAction("expand",function(t){t.graph.isEnabled()&&t.graph.foldCells(!1)}),this.addAction("expandAll",function(t){if(t.graph.isEnabled()){var e=t.graph.getChildVertices();t.graph.foldCells(!1,!1,e)}}),this.addAction("bold",function(t){t.graph.isEnabled()&&t.graph.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,mxConstants.FONT_BOLD)}),this.addAction("italic",function(t){t.graph.isEnabled()&&t.graph.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,mxConstants.FONT_ITALIC)}),this.addAction("underline",function(t){t.graph.isEnabled()&&t.graph.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,mxConstants.FONT_UNDERLINE)}),this.addAction("alignCellsLeft",function(t){t.graph.isEnabled()&&t.graph.alignCells(mxConstants.ALIGN_LEFT)}),this.addAction("alignCellsCenter",function(t){t.graph.isEnabled()&&t.graph.alignCells(mxConstants.ALIGN_CENTER)}),this.addAction("alignCellsRight",function(t){t.graph.isEnabled()&&t.graph.alignCells(mxConstants.ALIGN_RIGHT)}),this.addAction("alignCellsTop",function(t){t.graph.isEnabled()&&t.graph.alignCells(mxConstants.ALIGN_TOP)}),this.addAction("alignCellsMiddle",function(t){t.graph.isEnabled()&&t.graph.alignCells(mxConstants.ALIGN_MIDDLE)}),this.addAction("alignCellsBottom",function(t){t.graph.isEnabled()&&t.graph.alignCells(mxConstants.ALIGN_BOTTOM)}),this.addAction("alignFontLeft",function(t){t.graph.setCellStyles(mxConstants.STYLE_ALIGN,mxConstants.ALIGN_LEFT)}),this.addAction("alignFontCenter",function(t){t.graph.isEnabled()&&t.graph.setCellStyles(mxConstants.STYLE_ALIGN,mxConstants.ALIGN_CENTER)}),this.addAction("alignFontRight",function(t){t.graph.isEnabled()&&t.graph.setCellStyles(mxConstants.STYLE_ALIGN,mxConstants.ALIGN_RIGHT)}),this.addAction("alignFontTop",function(t){t.graph.isEnabled()&&t.graph.setCellStyles(mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_TOP)}),this.addAction("alignFontMiddle",function(t){t.graph.isEnabled()&&t.graph.setCellStyles(mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE)}),this.addAction("alignFontBottom",function(t){t.graph.isEnabled()&&t.graph.setCellStyles(mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_BOTTOM)}),this.addAction("zoom",function(t){var e=t.graph.getView().scale*100,i=parseFloat(mxUtils.prompt(mxResources.get(t.askZoomResource)||t.askZoomResource,e))/100;isNaN(i)||t.graph.getView().setScale(i)}),this.addAction("toggleTasks",function(t){t.tasks!=null?t.tasks.setVisible(!t.tasks.isVisible()):t.showTasks()}),this.addAction("toggleHelp",function(t){t.help!=null?t.help.setVisible(!t.help.isVisible()):t.showHelp()}),this.addAction("toggleOutline",function(t){t.outline==null?t.showOutline():t.outline.setVisible(!t.outline.isVisible())}),this.addAction("toggleConsole",function(t){mxLog.setVisible(!mxLog.isVisible())})},mxEditor.prototype.configure=function(t){if(t!=null){var e=new mxCodec(t.ownerDocument);e.decode(t,this),this.resetHistory()}},mxEditor.prototype.resetFirstTime=function(){document.cookie="mxgraph=seen; expires=Fri, 27 Jul 2001 02:47:11 UTC; path=/"},mxEditor.prototype.resetHistory=function(){this.lastSnapshot=new Date().getTime(),this.undoManager.clear(),this.ignoredChanges=0,this.setModified(!1)},mxEditor.prototype.addAction=function(t,e){this.actions[t]=e},mxEditor.prototype.execute=function(t,e,i){var n=this.actions[t];if(n!=null)try{var r=arguments;r[0]=this,n.apply(this,r)}catch(s){throw mxUtils.error("Cannot execute "+t+": "+s.message,280,!0),s}else mxUtils.error("Cannot find action "+t,280,!0)},mxEditor.prototype.addTemplate=function(t,e){this.templates[t]=e},mxEditor.prototype.getTemplate=function(t){return this.templates[t]},mxEditor.prototype.createGraph=function(){var t=new mxGraph(null,null,this.graphRenderHint);return t.setTooltips(!0),t.setPanning(!0),this.installDblClickHandler(t),this.installUndoHandler(t),this.installDrillHandler(t),this.installChangeHandler(t),this.installInsertHandler(t),t.popupMenuHandler.factoryMethod=mxUtils.bind(this,function(e,i,n){return this.createPopupMenu(e,i,n)}),t.connectionHandler.factoryMethod=mxUtils.bind(this,function(e,i){return this.createEdge(e,i)}),this.createSwimlaneManager(t),this.createLayoutManager(t),t},mxEditor.prototype.createSwimlaneManager=function(t){var e=new mxSwimlaneManager(t,!1);return e.isHorizontal=mxUtils.bind(this,function(){return this.horizontalFlow}),e.isEnabled=mxUtils.bind(this,function(){return this.maintainSwimlanes}),e},mxEditor.prototype.createLayoutManager=function(t){var e=new mxLayoutManager(t),i=this;return e.getLayout=function(n){var r=null,s=i.graph.getModel();return s.getParent(n)!=null&&(i.layoutSwimlanes&&t.isSwimlane(n)?(i.swimlaneLayout==null&&(i.swimlaneLayout=i.createSwimlaneLayout()),r=i.swimlaneLayout):i.layoutDiagram&&(t.isValidRoot(n)||s.getParent(s.getParent(n))==null)&&(i.diagramLayout==null&&(i.diagramLayout=i.createDiagramLayout()),r=i.diagramLayout)),r},e},mxEditor.prototype.setGraphContainer=function(t){this.graph.container==null&&(this.graph.init(t),this.rubberband=new mxRubberband(this.graph),this.disableContextMenu&&mxEvent.disableContextMenu(t),mxClient.IS_QUIRKS&&new mxDivResizer(t))},mxEditor.prototype.installDblClickHandler=function(t){t.addListener(mxEvent.DOUBLE_CLICK,mxUtils.bind(this,function(e,i){var n=i.getProperty("cell");n!=null&&t.isEnabled()&&this.dblClickAction!=null&&(this.execute(this.dblClickAction,n),i.consume())}))},mxEditor.prototype.installUndoHandler=function(t){var e=mxUtils.bind(this,function(n,r){var s=r.getProperty("edit");this.undoManager.undoableEditHappened(s)});t.getModel().addListener(mxEvent.UNDO,e),t.getView().addListener(mxEvent.UNDO,e);var i=function(n,r){var s=r.getProperty("edit").changes;t.setSelectionCells(t.getSelectionCellsForChanges(s))};this.undoManager.addListener(mxEvent.UNDO,i),this.undoManager.addListener(mxEvent.REDO,i)},mxEditor.prototype.installDrillHandler=function(t){var e=mxUtils.bind(this,function(i){this.fireEvent(new mxEventObject(mxEvent.ROOT))});t.getView().addListener(mxEvent.DOWN,e),t.getView().addListener(mxEvent.UP,e)},mxEditor.prototype.installChangeHandler=function(t){var e=mxUtils.bind(this,function(i,n){this.setModified(!0),this.validating==!0&&t.validateGraph();for(var r=n.getProperty("edit").changes,s=0;s "+e.convertValueToString(i)+t),i=e.getModel().getParent(i);var n=this.getRootTitle();return n+t},mxEditor.prototype.getRootTitle=function(){var t=this.graph.getModel().getRoot();return this.graph.convertValueToString(t)},mxEditor.prototype.undo=function(){this.undoManager.undo()},mxEditor.prototype.redo=function(){this.undoManager.redo()},mxEditor.prototype.groupCells=function(){var t=this.groupBorderSize!=null?this.groupBorderSize:this.graph.gridSize;return this.graph.groupCells(this.createGroup(),t)},mxEditor.prototype.createGroup=function(){var t=this.graph.getModel();return t.cloneCell(this.defaultGroup)},mxEditor.prototype.open=function(t){if(t!=null){var e=mxUtils.load(t).getXml();this.readGraphModel(e.documentElement),this.filename=t,this.fireEvent(new mxEventObject(mxEvent.OPEN,"filename",t))}},mxEditor.prototype.readGraphModel=function(t){var e=new mxCodec(t.ownerDocument);e.decode(t,this.graph.getModel()),this.resetHistory()},mxEditor.prototype.save=function(t,e){if(t=t||this.getUrlPost(),t!=null&&t.length>0){var i=this.writeGraphModel(e);this.postDiagram(t,i),this.setModified(!1)}this.fireEvent(new mxEventObject(mxEvent.SAVE,"url",t))},mxEditor.prototype.postDiagram=function(t,e){this.escapePostData&&(e=encodeURIComponent(e)),mxUtils.post(t,this.postParameterName+"="+e,mxUtils.bind(this,function(i){this.fireEvent(new mxEventObject(mxEvent.POST,"request",i,"url",t,"data",e))}))},mxEditor.prototype.writeGraphModel=function(t){t=t??this.linefeed;var e=new mxCodec,i=e.encode(this.graph.getModel());return mxUtils.getXml(i,t)},mxEditor.prototype.getUrlPost=function(){return this.urlPost},mxEditor.prototype.getUrlImage=function(){return this.urlImage},mxEditor.prototype.swapStyles=function(t,e){var i=this.graph.getStylesheet().styles[e];this.graph.getView().getStylesheet().putCellStyle(e,this.graph.getStylesheet().styles[t]),this.graph.getStylesheet().putCellStyle(t,i),this.graph.refresh()},mxEditor.prototype.showProperties=function(t){if(t=t||this.graph.getSelectionCell(),t==null&&(t=this.graph.getCurrentRoot(),t==null&&(t=this.graph.getModel().getRoot())),t!=null){this.graph.stopEditing(!0);var e=mxUtils.getOffset(this.graph.container),i=e.x+10,n=e.y;if(this.properties!=null&&!this.movePropertiesDialog)i=this.properties.getX(),n=this.properties.getY();else{var r=this.graph.getCellBounds(t);r!=null&&(i+=r.x+Math.min(200,r.width),n+=r.y)}this.hideProperties();var s=this.createProperties(t);s!=null&&(this.properties=new mxWindow(mxResources.get(this.propertiesResource)||this.propertiesResource,s,i,n,this.propertiesWidth,this.propertiesHeight,!1),this.properties.setVisible(!0))}},mxEditor.prototype.isPropertiesVisible=function(){return this.properties!=null},mxEditor.prototype.createProperties=function(t){var e=this.graph.getModel(),i=e.getValue(t);if(mxUtils.isNode(i)){var n=new mxForm("properties"),r=n.addText("ID",t.getId());r.setAttribute("readonly","true");var s=null,l=null,a=null,o=null,u=null;e.isVertex(t)&&(s=e.getGeometry(t),s!=null&&(l=n.addText("top",s.y),a=n.addText("left",s.x),o=n.addText("width",s.width),u=n.addText("height",s.height)));for(var p=e.getStyle(t),m=n.addText("Style",p||""),d=i.attributes,x=[],f=0;f0?e.setStyle(t,m.value):e.setStyle(t,null);for(var y=0;y0&&this.graph.isSwimlane(t)?this.cycleAttributeValues[this.cycleAttributeIndex++%this.cycleAttributeValues.length]:null},mxEditor.prototype.cycleAttribute=function(t){if(this.cycleAttributeName!=null){var e=this.consumeCycleAttribute(t);e!=null&&t.setStyle(t.getStyle()+";"+this.cycleAttributeName+"="+e)}},mxEditor.prototype.addVertex=function(t,e,i,n){for(var r=this.graph.getModel();t!=null&&!this.graph.isValidDropTarget(t);)t=r.getParent(t);t=t??this.graph.getSwimlaneAt(i,n);var s=this.graph.getView().scale,l=r.getGeometry(e),a=r.getGeometry(t);if(this.graph.isSwimlane(e)&&!this.graph.swimlaneNesting)t=null;else{if(t==null&&this.swimlaneRequired)return null;if(t!=null&&a!=null){var o=this.graph.getView().getState(t);if(o!=null){if(i-=o.origin.x*s,n-=o.origin.y*s,this.graph.isConstrainedMoving){var u=l.width,p=l.height,m=o.x+o.width;i+u>m&&(i-=i+u-m),m=o.y+o.height,n+p>m&&(n-=n+p-m)}}else a!=null&&(i-=a.x*s,n-=a.y*s)}}l=l.clone(),l.x=this.graph.snap(i/s-this.graph.getView().translate.x-this.graph.gridSize/2),l.y=this.graph.snap(n/s-this.graph.getView().translate.y-this.graph.gridSize/2),e.setGeometry(l),t==null&&(t=this.graph.getDefaultParent()),this.cycleAttribute(e),this.fireEvent(new mxEventObject(mxEvent.BEFORE_ADD_VERTEX,"vertex",e,"parent",t)),r.beginUpdate();try{e=this.graph.addCell(e,t),e!=null&&(this.graph.constrainChild(e),this.fireEvent(new mxEventObject(mxEvent.ADD_VERTEX,"vertex",e)))}finally{r.endUpdate()}return e!=null&&(this.graph.setSelectionCell(e),this.graph.scrollCellToVisible(e),this.fireEvent(new mxEventObject(mxEvent.AFTER_ADD_VERTEX,"vertex",e))),e},mxEditor.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,this.tasks!=null&&this.tasks.destroy(),this.outline!=null&&this.outline.destroy(),this.properties!=null&&this.properties.destroy(),this.keyHandler!=null&&this.keyHandler.destroy(),this.rubberband!=null&&this.rubberband.destroy(),this.toolbar!=null&&this.toolbar.destroy(),this.graph!=null&&this.graph.destroy(),this.status=null,this.templates=null)},__mxOutput.mxEditor=typeof mxEditor<"u"?mxEditor:void 0;var mxCodecRegistry={codecs:[],aliases:[],register:function(t){if(t!=null){var e=t.getName();mxCodecRegistry.codecs[e]=t;var i=mxUtils.getFunctionName(t.template.constructor);i!=e&&mxCodecRegistry.addAlias(i,e)}return t},addAlias:function(t,e){mxCodecRegistry.aliases[t]=e},getCodec:function(t){var e=null;if(t!=null){var i=mxUtils.getFunctionName(t),n=mxCodecRegistry.aliases[i];if(n!=null&&(i=n),e=mxCodecRegistry.codecs[i],e==null)try{e=new mxObjectCodec(new t),mxCodecRegistry.register(e)}catch{}}return e}};__mxOutput.mxCodecRegistry=typeof mxCodecRegistry<"u"?mxCodecRegistry:void 0;function mxCodec(t){this.document=t||mxUtils.createXmlDocument(),this.objects=[]}mxCodec.prototype.document=null,mxCodec.prototype.objects=null,mxCodec.prototype.elements=null,mxCodec.prototype.encodeDefaults=!1,mxCodec.prototype.putObject=function(t,e){return this.objects[t]=e,e},mxCodec.prototype.getObject=function(t){var e=null;if(t!=null&&(e=this.objects[t],e==null&&(e=this.lookup(t),e==null))){var i=this.getElementById(t);i!=null&&(e=this.decode(i))}return e},mxCodec.prototype.lookup=function(t){return null},mxCodec.prototype.getElementById=function(t){return this.updateElements(),this.elements[t]},mxCodec.prototype.updateElements=function(){this.elements==null&&(this.elements=new Object,this.document.documentElement!=null&&this.addElement(this.document.documentElement))},mxCodec.prototype.addElement=function(t){if(t.nodeType==mxConstants.NODETYPE_ELEMENT){var e=t.getAttribute("id");if(e!=null){if(this.elements[e]==null)this.elements[e]=t;else if(this.elements[e]!=t)throw new Error(e+": Duplicate ID")}}for(t=t.firstChild;t!=null;)this.addElement(t),t=t.nextSibling},mxCodec.prototype.getId=function(t){var e=null;return t!=null&&(e=this.reference(t),e==null&&t instanceof mxCell&&(e=t.getId(),e==null&&(e=mxCellPath.create(t),e.length==0&&(e="root")))),e},mxCodec.prototype.reference=function(t){return null},mxCodec.prototype.encode=function(t){var e=null;if(t!=null&&t.constructor!=null){var i=mxCodecRegistry.getCodec(t.constructor);i!=null?e=i.encode(this,t):mxUtils.isNode(t)?e=mxUtils.importNode(this.document,t,!0):mxLog.warn("mxCodec.encode: No codec for "+mxUtils.getFunctionName(t.constructor))}return e},mxCodec.prototype.decode=function(t,e){this.updateElements();var i=null;if(t!=null&&t.nodeType==mxConstants.NODETYPE_ELEMENT){var n=null;try{n=window[t.nodeName]}catch{}var r=mxCodecRegistry.getCodec(n);r!=null?i=r.decode(this,t,e):(i=t.cloneNode(!0),i.removeAttribute("as"))}return i},mxCodec.prototype.encodeCell=function(t,e,i){if(e.appendChild(this.encode(t)),i==null||i)for(var n=t.getChildCount(),r=0;r=0},mxObjectCodec.prototype.isReference=function(t,e,i,n){return mxUtils.indexOf(this.idrefs,e)>=0},mxObjectCodec.prototype.encode=function(t,e){var i=t.document.createElement(this.getName());return e=this.beforeEncode(t,e,i),this.encodeObject(t,e,i),this.afterEncode(t,e,i)},mxObjectCodec.prototype.encodeObject=function(t,e,i){t.setAttribute(i,"id",t.getId(e));for(var n in e){var r=n,s=e[r];s!=null&&!this.isExcluded(e,r,s,!0)&&(mxUtils.isInteger(r)&&(r=null),this.encodeValue(t,e,r,s,i))}},mxObjectCodec.prototype.encodeValue=function(t,e,i,n,r){if(n!=null){if(this.isReference(e,i,n,!0)){var s=t.getId(n);if(s==null){mxLog.warn("mxObjectCodec.encode: No ID for "+this.getName()+"."+i+"="+n);return}n=s}var l=this.template[i];(i==null||t.encodeDefaults||l!=n)&&(i=this.getAttributeName(i),this.writeAttribute(t,e,i,n,r))}},mxObjectCodec.prototype.writeAttribute=function(t,e,i,n,r){typeof n!="object"?this.writePrimitiveAttribute(t,e,i,n,r):this.writeComplexAttribute(t,e,i,n,r)},mxObjectCodec.prototype.writePrimitiveAttribute=function(t,e,i,n,r){if(n=this.convertAttributeToXml(t,e,i,n,r),i==null){var s=t.document.createElement("add");typeof n=="function"?s.appendChild(t.document.createTextNode(n)):t.setAttribute(s,"value",n),r.appendChild(s)}else typeof n!="function"&&t.setAttribute(r,i,n)},mxObjectCodec.prototype.writeComplexAttribute=function(t,e,i,n,r){var s=t.encode(n);s!=null?(i!=null&&s.setAttribute("as",i),r.appendChild(s)):mxLog.warn("mxObjectCodec.encode: No node for "+this.getName()+"."+i+": "+n)},mxObjectCodec.prototype.convertAttributeToXml=function(t,e,i,n){return this.isBooleanAttribute(t,e,i,n)&&(n=n==!0?"1":"0"),n},mxObjectCodec.prototype.isBooleanAttribute=function(t,e,i,n){return typeof n.length>"u"&&(n==!0||n==!1)},mxObjectCodec.prototype.convertAttributeFromXml=function(t,e,i){var n=e.value;return this.isNumericAttribute(t,e,i)&&(n=parseFloat(n),(isNaN(n)||!isFinite(n))&&(n=0)),n},mxObjectCodec.prototype.isNumericAttribute=function(t,e,i){var n=i.constructor==mxGeometry&&(e.name=="x"||e.name=="y"||e.name=="width"||e.name=="height")||i.constructor==mxPoint&&(e.name=="x"||e.name=="y")||mxUtils.isNumeric(e.value);return n},mxObjectCodec.prototype.beforeEncode=function(t,e,i){return e},mxObjectCodec.prototype.afterEncode=function(t,e,i){return i},mxObjectCodec.prototype.decode=function(t,e,i){var n=e.getAttribute("id"),r=t.objects[n];return r==null&&(r=i||this.cloneTemplate(),n!=null&&t.putObject(n,r)),e=this.beforeDecode(t,e,r),this.decodeNode(t,e,r),this.afterDecode(t,e,r)},mxObjectCodec.prototype.decodeNode=function(t,e,i){e!=null&&(this.decodeAttributes(t,e,i),this.decodeChildren(t,e,i))},mxObjectCodec.prototype.decodeAttributes=function(t,e,i){var n=e.attributes;if(n!=null)for(var r=0;r0&&(n=null),n},mxObjectCodec.prototype.addObjectValue=function(t,e,i,n){i!=null&&i!=n&&(e!=null&&e.length>0?t[e]=i:t.push(i))},mxObjectCodec.prototype.processInclude=function(t,e,i){if(e.nodeName=="include"){var n=e.getAttribute("name");if(n!=null)try{var r=mxUtils.load(n).getDocumentElement();r!=null&&t.decode(r,i)}catch{}return!0}return!1},mxObjectCodec.prototype.beforeDecode=function(t,e,i){return e},mxObjectCodec.prototype.afterDecode=function(t,e,i){return i},__mxOutput.mxObjectCodec=typeof mxObjectCodec<"u"?mxObjectCodec:void 0,mxCodecRegistry.register((function(){var t=new mxObjectCodec(new mxCell,["children","edges","overlays","mxTransient"],["parent","source","target"]);return t.isCellCodec=function(){return!0},t.isNumericAttribute=function(e,i,n){return i.nodeName!=="value"&&mxObjectCodec.prototype.isNumericAttribute.apply(this,arguments)},t.isExcluded=function(e,i,n,r){return mxObjectCodec.prototype.isExcluded.apply(this,arguments)||r&&i=="value"&&n.nodeType==mxConstants.NODETYPE_ELEMENT},t.afterEncode=function(e,i,n){if(i.value!=null&&i.value.nodeType==mxConstants.NODETYPE_ELEMENT){var r=n;n=mxUtils.importNode(e.document,i.value,!0),n.appendChild(r);var s=r.getAttribute("id");n.setAttribute("id",s),r.removeAttribute("id")}return n},t.beforeDecode=function(e,i,n){var r=i.cloneNode(!0),s=this.getName();if(i.nodeName!=s){var l=i.getElementsByTagName(s)[0];l!=null&&l.parentNode==i?(mxUtils.removeWhitespace(l,!0),mxUtils.removeWhitespace(l,!1),l.parentNode.removeChild(l),r=l):r=null,n.value=i.cloneNode(!0);var a=n.value.getAttribute("id");a!=null&&(n.setId(a),n.value.removeAttribute("id"))}else n.setId(i.getAttribute("id"));if(r!=null)for(var o=0;o=0},t.isExcluded=function(e,i,n,r){return mxObjectCodec.prototype.isExcluded.apply(this,arguments)||r&&n!=null&&(i=="previous"||i=="parent")&&!e.model.contains(n)},t.afterEncode=function(e,i,n){return this.isReference(i,"child",i.child,!0)?n.setAttribute("child",e.getId(i.child)):e.encodeCell(i.child,n),n},t.beforeDecode=function(e,i,n){if(i.firstChild!=null&&i.firstChild.nodeType==mxConstants.NODETYPE_ELEMENT){i=i.cloneNode(!0);var r=i.firstChild;n.child=e.decodeCell(r,!1);var s=r.nextSibling;for(r.parentNode.removeChild(r),r=s;r!=null;){if(s=r.nextSibling,r.nodeType==mxConstants.NODETYPE_ELEMENT){var l=r.getAttribute("id");e.lookup(l)==null&&e.decodeCell(r)}r.parentNode.removeChild(r),r=s}}else{var a=i.getAttribute("child");n.child=e.getObject(a)}return i},t.afterDecode=function(e,i,n){return n.child!=null&&(n.child.parent!=null&&n.previous!=null&&n.child.parent!=n.previous&&(n.previous=n.child.parent),n.child.parent=n.previous,n.previous=n.parent,n.previousIndex=n.index),n},t})()),__mxOutput.mxChildChangeCodec=typeof mxChildChangeCodec<"u"?mxChildChangeCodec:void 0,mxCodecRegistry.register((function(){var t=new mxObjectCodec(new mxTerminalChange,["model","previous"],["cell","terminal"]);return t.afterDecode=function(e,i,n){return n.previous=n.terminal,n},t})()),__mxOutput.mxTerminalChangeCodec=typeof mxTerminalChangeCodec<"u"?mxTerminalChangeCodec:void 0;var mxGenericChangeCodec=function(t,e){var i=new mxObjectCodec(t,["model","previous"],["cell"]);return i.afterDecode=function(n,r,s){return mxUtils.isNode(s.cell)&&(s.cell=n.decodeCell(s.cell,!1)),s.previous=s[e],s},i};mxCodecRegistry.register(mxGenericChangeCodec(new mxValueChange,"value")),mxCodecRegistry.register(mxGenericChangeCodec(new mxStyleChange,"style")),mxCodecRegistry.register(mxGenericChangeCodec(new mxGeometryChange,"geometry")),mxCodecRegistry.register(mxGenericChangeCodec(new mxCollapseChange,"collapsed")),mxCodecRegistry.register(mxGenericChangeCodec(new mxVisibleChange,"visible")),mxCodecRegistry.register(mxGenericChangeCodec(new mxCellAttributeChange,"value")),__mxOutput.mxGenericChangeCodec=typeof mxGenericChangeCodec<"u"?mxGenericChangeCodec:void 0,mxCodecRegistry.register((function(){return new mxObjectCodec(new mxGraph,["graphListeners","eventListeners","view","container","cellRenderer","editor","selection"])})()),__mxOutput.mxGraphCodec=typeof mxGraphCodec<"u"?mxGraphCodec:void 0,mxCodecRegistry.register((function(){var t=new mxObjectCodec(new mxGraphView);return t.encode=function(e,i){return this.encodeCell(e,i,i.graph.getModel().getRoot())},t.encodeCell=function(e,i,n){var r=i.graph.getModel(),s=i.getState(n),l=r.getParent(n);if(l==null||s!=null){var a=r.getChildCount(n),o=i.graph.getCellGeometry(n),u=null;if(l==r.getRoot()?u="layer":l==null?u="graph":r.isEdge(n)?u="edge":a>0&&o!=null?u="group":r.isVertex(n)&&(u="vertex"),u!=null){var p=e.document.createElement(u),m=i.graph.getLabel(n);if(m!=null&&(p.setAttribute("label",i.graph.getLabel(n)),i.graph.isHtmlLabel(n)&&p.setAttribute("html",!0)),l==null){var d=i.getGraphBounds();d!=null&&(p.setAttribute("x",Math.round(d.x)),p.setAttribute("y",Math.round(d.y)),p.setAttribute("width",Math.round(d.width)),p.setAttribute("height",Math.round(d.height))),p.setAttribute("scale",i.scale)}else if(s!=null&&o!=null){for(var x in s.style){var f=s.style[x];typeof f=="function"&&typeof f=="object"&&(f=mxStyleRegistry.getName(f)),f!=null&&typeof f!="function"&&typeof f!="object"&&p.setAttribute(x,f)}var g=s.absolutePoints;if(g!=null&&g.length>0){for(var c=Math.round(g[0].x)+","+Math.round(g[0].y),x=1;x0&&n.appendChild(l)}}return n},t.getStringValue=function(e,i){var n=typeof i;return n=="function"?i=mxStyleRegistry.getName(i):n=="object"&&(i=null),i},t.decode=function(e,i,n){var r=n||new this.template.constructor,s=i.getAttribute("id");for(s!=null&&(e.objects[s]=r),i=i.firstChild;i!=null;){if(!this.processInclude(e,i,r)&&i.nodeName=="add"){var l=i.getAttribute("as");if(l!=null){var a=i.getAttribute("extend"),o=a!=null?mxUtils.clone(r.styles[a]):null;o==null&&(a!=null&&mxLog.warn("mxStylesheetCodec.decode: stylesheet "+a+" not found to extend"),o=new Object);for(var u=i.firstChild;u!=null;){if(u.nodeType==mxConstants.NODETYPE_ELEMENT){var p=u.getAttribute("as");if(u.nodeName=="add"){var m=mxUtils.getTextContent(u),d=null;m!=null&&m.length>0&&mxStylesheetCodec.allowEval?d=mxUtils.eval(m):(d=u.getAttribute("value"),mxUtils.isNumeric(d)&&(d=parseFloat(d))),d!=null&&(o[p]=d)}else u.nodeName=="remove"&&delete o[p]}u=u.nextSibling}r.putCellStyle(l,o)}}i=i.nextSibling}return r},t})());mxStylesheetCodec.allowEval=!0,__mxOutput.mxStylesheetCodec=typeof mxStylesheetCodec<"u"?mxStylesheetCodec:void 0,mxCodecRegistry.register((function(){var t=new mxObjectCodec(new mxDefaultKeyHandler);return t.encode=function(e,i){return null},t.decode=function(e,i,n){if(n!=null)for(n.editor,i=i.firstChild;i!=null;){if(!this.processInclude(e,i,n)&&i.nodeName=="add"){var r=i.getAttribute("as"),s=i.getAttribute("action"),l=i.getAttribute("control");n.bindAction(r,s,l)}i=i.nextSibling}return n},t})()),__mxOutput.mxDefaultKeyHandlerCodec=typeof mxDefaultKeyHandlerCodec<"u"?mxDefaultKeyHandlerCodec:void 0;var mxDefaultToolbarCodec=mxCodecRegistry.register((function(){var t=new mxObjectCodec(new mxDefaultToolbar);return t.encode=function(e,i){return null},t.decode=function(e,i,n){if(n!=null){var r=n.editor;for(i=i.firstChild;i!=null;){if(i.nodeType==mxConstants.NODETYPE_ELEMENT&&!this.processInclude(e,i,n)){if(i.nodeName=="separator")n.addSeparator();else if(i.nodeName=="br")n.toolbar.addBreak();else if(i.nodeName=="hr")n.toolbar.addLine();else if(i.nodeName=="add"){var s=i.getAttribute("as");s=mxResources.get(s)||s;var l=i.getAttribute("icon"),a=i.getAttribute("pressedIcon"),o=i.getAttribute("action"),u=i.getAttribute("mode"),p=i.getAttribute("template"),m=i.getAttribute("toggle")!="0",d=mxUtils.getTextContent(i),x=null;if(o!=null)x=n.addItem(s,l,o,a);else if(u!=null){var f=mxDefaultToolbarCodec.allowEval?mxUtils.eval(d):null;x=n.addMode(s,l,u,a,f)}else if(p!=null||d!=null&&d.length>0){var g=r.templates[p],c=i.getAttribute("style");g!=null&&c!=null&&(g=r.graph.cloneCell(g),g.setStyle(c));var v=null;d!=null&&d.length>0&&mxDefaultToolbarCodec.allowEval&&(v=mxUtils.eval(d)),x=n.addPrototype(s,l,g,a,v,m)}else{var y=mxUtils.getChildNodes(i);if(y.length>0)if(l==null)for(var T=n.addActionCombo(s),C=0;C0&&x.setAttribute("id",O)}}}i=i.nextSibling}}return n},t})());return mxDefaultToolbarCodec.allowEval=!0,__mxOutput.mxDefaultToolbarCodec=typeof mxDefaultToolbarCodec<"u"?mxDefaultToolbarCodec:void 0,mxCodecRegistry.register((function(){var t=new mxObjectCodec(new mxDefaultPopupMenu);return t.encode=function(e,i){return null},t.decode=function(e,i,n){var r=i.getElementsByTagName("include")[0];return r!=null?this.processInclude(e,r,n):n!=null&&(n.config=i),n},t})()),__mxOutput.mxDefaultPopupMenuCodec=typeof mxDefaultPopupMenuCodec<"u"?mxDefaultPopupMenuCodec:void 0,mxCodecRegistry.register((function(){var t=new mxObjectCodec(new mxEditor,["modified","lastSnapshot","ignoredChanges","undoManager","graphContainer","toolbarContainer"]);return t.afterDecode=function(e,i,n){var r=i.getAttribute("defaultEdge");r!=null&&(i.removeAttribute("defaultEdge"),n.defaultEdge=n.templates[r]);var s=i.getAttribute("defaultGroup");return s!=null&&(i.removeAttribute("defaultGroup"),n.defaultGroup=n.templates[s]),n},t.decodeChild=function(e,i,n){if(i.nodeName=="Array"){var r=i.getAttribute("as");if(r=="templates"){this.decodeTemplates(e,i,n);return}}else if(i.nodeName=="ui"){this.decodeUi(e,i,n);return}mxObjectCodec.prototype.decodeChild.apply(this,arguments)},t.decodeUi=function(e,i,n){for(var r=i.firstChild;r!=null;){if(r.nodeName=="add"){var s=r.getAttribute("as"),l=r.getAttribute("element"),a=r.getAttribute("style"),o=null;if(l!=null)o=document.getElementById(l),o!=null&&a!=null&&(o.style.cssText+=";"+a);else{var u=parseInt(r.getAttribute("x")),p=parseInt(r.getAttribute("y")),m=r.getAttribute("width"),d=r.getAttribute("height");o=document.createElement("div"),o.style.cssText=a;var x=new mxWindow(mxResources.get(s)||s,o,u,p,m,d,!1,!0);x.setVisible(!0)}s=="graph"?n.setGraphContainer(o):s=="toolbar"?n.setToolbarContainer(o):s=="title"?n.setTitleContainer(o):s=="status"?n.setStatusContainer(o):s=="map"&&n.setMapContainer(o)}else r.nodeName=="resource"?mxResources.add(r.getAttribute("basename")):r.nodeName=="stylesheet"&&mxClient.link("stylesheet",r.getAttribute("name"));r=r.nextSibling}},t.decodeTemplates=function(e,i,n){n.templates==null&&(n.templates=[]);for(var r=mxUtils.getChildNodes(i),s=0;se in n?kt(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var f=(n,e,t)=>Mt(n,typeof e!="symbol"?e+"":e,t);import{g as Bt,r as xt}from"./mxgraph.js";(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))s(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const r of i.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&s(r)}).observe(document,{childList:!0,subtree:!0});function t(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function s(o){if(o.ep)return;o.ep=!0;const i=t(o);fetch(o.href,i)}})();var te=(n=>(n.None="None",n.HorizontalVertical="HorizontalVertical",n.Horizontal="Horizontal",n.Vertical="Vertical",n.Center="Center",n))(te||{}),Yt=(n=>(n.In="in",n.Out="out",n))(Yt||{});function Vt(n){return n instanceof HTMLElement?n:document.querySelector(`#${n}`)}var h=(n=>(n.LANE="lane",n.POOL="pool",n.CALL_ACTIVITY="callActivity",n.SUB_PROCESS="subProcess",n.TASK="task",n.TASK_USER="userTask",n.TASK_SERVICE="serviceTask",n.TASK_RECEIVE="receiveTask",n.TASK_SEND="sendTask",n.TASK_MANUAL="manualTask",n.TASK_SCRIPT="scriptTask",n.TASK_BUSINESS_RULE="businessRuleTask",n.GLOBAL_TASK="globalTask",n.GLOBAL_TASK_USER="globalUserTask",n.GLOBAL_TASK_MANUAL="globalManualTask",n.GLOBAL_TASK_SCRIPT="globalScriptTask",n.GLOBAL_TASK_BUSINESS_RULE="globalBusinessRuleTask",n.GROUP="group",n.TEXT_ANNOTATION="textAnnotation",n.GATEWAY_PARALLEL="parallelGateway",n.GATEWAY_EXCLUSIVE="exclusiveGateway",n.GATEWAY_INCLUSIVE="inclusiveGateway",n.GATEWAY_EVENT_BASED="eventBasedGateway",n.GATEWAY_COMPLEX="complexGateway",n.EVENT_START="startEvent",n.EVENT_END="endEvent",n.EVENT_INTERMEDIATE_CATCH="intermediateCatchEvent",n.EVENT_INTERMEDIATE_THROW="intermediateThrowEvent",n.EVENT_BOUNDARY="boundaryEvent",n))(h||{}),ne=(n=>(n.CALLING_PROCESS="process",n.CALLING_GLOBAL_TASK="global task",n))(ne||{}),se=(n=>(n.Exclusive="Exclusive",n.None="None",n.Parallel="Parallel",n))(se||{}),w=(n=>(n.NONE="none",n.TERMINATE="terminate",n.CANCEL="cancel",n.COMPENSATION="compensate",n.CONDITIONAL="conditional",n.ERROR="error",n.ESCALATION="escalation",n.LINK="link",n.MESSAGE="message",n.SIGNAL="signal",n.TIMER="timer",n))(w||{}),y=(n=>(n.ADHOC="adhoc",n.COMPENSATION="compensation",n.EXPAND="expand",n.LOOP="loop",n.MULTI_INSTANCE_PARALLEL="multi-parallel",n.MULTI_INSTANCE_SEQUENTIAL="multi-sequential",n))(y||{}),Y=(n=>(n.AD_HOC="adhoc",n.EMBEDDED="embedded",n.EVENT="event",n.TRANSACTION="transaction",n))(Y||{});function Gt(n,e){return n===""?e?{}:void 0:n}function E(n,e=!1){return n==null?[]:(Array.isArray(n)?n:[n]).map(t=>Gt(t,e)).filter(Boolean)}function Dt(n,e,t){const s=[];t!=null&&t.startingWith?s.push(`^(${t.startingWith}).*`):t!=null&&t.notStartingWith&&s.push(`^(?!(${t.notStartingWith})).*`),s.push(`${e}$`);const o=s.join("");return n.filter(i=>t!=null&&t.ignoreCase?new RegExp(o,"i").test(i):new RegExp(o).test(i))}class p{static isEvent(e){return le(He,e)}static eventKinds(){return[...He]}static isBoundaryEvent(e){return h.EVENT_BOUNDARY===e}static isStartEvent(e){return h.EVENT_START===e}static isCatchEvent(e){return h.EVENT_INTERMEDIATE_CATCH===e||h.EVENT_BOUNDARY===e||h.EVENT_START===e}static isIntermediateCatchEvent(e){return h.EVENT_INTERMEDIATE_CATCH===e}static isIntermediateThrowEvent(e){return h.EVENT_INTERMEDIATE_THROW===e}static isCallActivity(e){return h.CALL_ACTIVITY===e}static isSubProcess(e){return h.SUB_PROCESS===e}static canHaveNoneEvent(e){return h.EVENT_INTERMEDIATE_THROW===e||h.EVENT_END===e||h.EVENT_START===e}static isActivity(e){return le(Ae,e)}static activityKinds(){return[...Ae]}static isWithDefaultSequenceFlow(e){return Ut.has(e)}static isTask(e){return le(me,e)}static taskKinds(){return[...me]}static gatewayKinds(){return[...Ke]}static isGateway(e){return le(Ke,e)}static flowNodeKinds(){return Object.values(h).filter(e=>!p.isPoolOrLane(e))}static isPoolOrLane(e){return e==h.POOL||e==h.LANE}}function Fe(n,e){return Dt(Object.values(h),n,e)}function le(n,e){return Object.values(n).map(t=>t).includes(e)}const He=Fe("Event"),Ke=Fe("Gateway"),me=Fe("Task",{ignoreCase:!0,notStartingWith:"global"}),Ae=[...me,h.CALL_ACTIVITY,h.SUB_PROCESS],Ut=new Set([...Ae,h.GATEWAY_EXCLUSIVE,h.GATEWAY_INCLUSIVE,h.GATEWAY_COMPLEX]),rt=Object.values(w).filter(n=>n!=w.NONE);var $=(n=>(n.NONE="None",n.ONE="One",n.BOTH="Both",n))($||{}),k=(n=>(n.SEQUENCE_FLOW="sequenceFlow",n.MESSAGE_FLOW="messageFlow",n.ASSOCIATION_FLOW="association",n))(k||{}),oe=(n=>(n.NONE="none",n.INITIATING="initiating",n.NON_INITIATING="non_initiating",n))(oe||{}),x=(n=>(n.NORMAL="normal",n.DEFAULT="default",n.CONDITIONAL_FROM_ACTIVITY="conditional_from_activity",n.CONDITIONAL_FROM_GATEWAY="conditional_from_gateway",n))(x||{});class Te{constructor(e,t,s,o,i){this.id=e,this.name=t,this.kind=s,this.sourceReferenceId=o,this.targetReferenceId=i}}class lt extends Te{constructor(e,t,s,o,i=x.NORMAL){super(e,t,k.SEQUENCE_FLOW,s,o),this.sequenceFlowKind=i}}class at extends Te{constructor(e,t,s,o){super(e,t,k.MESSAGE_FLOW,s,o)}}class ct extends Te{constructor(e,t,s,o,i=$.NONE){super(e,t,k.ASSOCIATION_FLOW,s,o),this.associationDirectionKind=i}}var Wt=xt();const Ht=Bt(Wt),O=Xt(),Kt=O.mxCellRenderer,zt=O.mxClient,c=O.mxConstants,V=O.mxEvent,ze=O.mxPerimeter,P=O.mxPoint,ve=O.mxRectangle,Pe=O.mxRectangleShape,ke=O.mxSvgCanvas2D,A=O.mxUtils;function Xt(){return window.mxForceIncludes=!1,window.mxLoadResources=!1,window.mxLoadStylesheets=!1,window.mxResourceExtension=".txt",Ht({})}class $t{constructor(e){this.graph=e}computeRelativeCoordinates(e,t){const s=this.getTranslateForRoot(e),o=t.x+s.x,i=t.y+s.y;return new P(o,i)}getTranslateForRoot(e){const t=this.graph.getModel(),s=new P(0,0);for(;e!=null;){const o=t.getGeometry(e);o!=null&&(s.x-=o.x,s.y-=o.y),e=t.getParent(e)}return s}computeEdgeCenter(e){const t=e.geometry.points,s=t[0],o=t.at(-1),i=o.x-s.x,r=o.y-s.y;return new P(s.x+i/2,s.y+r/2)}}class ue{constructor(e,t,s,o,i){f(this,"extensions",{});this.id=e,this.bpmnElement=t,this.bounds=s,this.label=o,this.isHorizontal=i}}class B{constructor(e,t,s,o,i=!1){f(this,"incomingIds",[]);f(this,"outgoingIds",[]);this.id=e,this.name=t,this.kind=s,this.parentId=o,this.instantiate=i}}class pe extends B{constructor(e,t,s,o,i,r=[]){super(e,t,s,o,i),this.markers=r}}class X extends pe{constructor(e,t,s,o,i,r){super(e,t,h.CALL_ACTIVITY,o,void 0,i),this.callActivityKind=s,this.globalTaskKind=r}}class ie extends pe{constructor(e,t,s,o,i){s==Y.AD_HOC&&!i.includes(y.ADHOC)&&i.push(y.ADHOC),super(e,t,h.SUB_PROCESS,o,void 0,i),this.subProcessKind=s}}class U extends B{constructor(e,t,s,o,i){super(e,t,s,i),this.eventDefinitionKind=o}}class Oe extends U{constructor(t,s,o,i){super(t,s,h.EVENT_INTERMEDIATE_CATCH,o,i);f(this,"sourceIds",[])}}class Le extends U{constructor(t,s,o,i){super(t,s,h.EVENT_INTERMEDIATE_THROW,o,i);f(this,"targetId")}}class ut extends U{constructor(e,t,s,o,i){super(e,t,h.EVENT_START,s,o),this.isInterrupting=i}}class dt extends U{constructor(e,t,s,o,i=!0){super(e,t,h.EVENT_BOUNDARY,s,o),this.isInterrupting=i}}class ht extends B{constructor(e,t,s,o,i=se.None){super(e,t,h.GATEWAY_EVENT_BASED,s,o),this.gatewayKind=i}}function de(n,e,t,s){return Math.min(Math.max(n??s,e),t)}function Zt(n){return Math.max(n??0,0)}function jt(n){const e=n??{};return e.debounceDelay=de(e.debounceDelay,0,100,50),e.throttleDelay=de(e.throttleDelay,0,100,50),e}function Ee(n){return n=="default"?void 0:de(n,0,100,100)}function qt(n){return n=="default"?void 0:de(n,1,50,1)}const S={EDGE:"bpmn.edge",EDGE_START_FILL_COLOR:"bpmn.edge.startFillColor",EDGE_END_FILL_COLOR:"bpmn.edge.endFillColor",EVENT_BASED_GATEWAY_KIND:"bpmn.gatewayKind",EVENT_DEFINITION_KIND:"bpmn.eventDefinitionKind",GLOBAL_TASK_KIND:"bpmn.globalTaskKind",SUB_PROCESS_KIND:"bpmn.subProcessKind",IS_INITIATING:"bpmn.isInitiating",IS_INSTANTIATING:"bpmn.isInstantiating",IS_INTERRUPTING:"bpmn.isInterrupting",EXTRA_CSS_CLASSES:"bpmn.extra.css.classes",MARKERS:"bpmn.markers",MESSAGE_FLOW_ICON:"bpmn.messageFlowIcon"},ft={ARROW_DASH:"bpmn.dash"},T={STROKE_WIDTH_THIN:2,STROKE_WIDTH_THICK:5,SHAPE_ACTIVITY_BOTTOM_MARGIN:7,SHAPE_ACTIVITY_TOP_MARGIN:7,SHAPE_ACTIVITY_LEFT_MARGIN:7,SHAPE_ACTIVITY_MARKER_ICON_MARGIN:5,SHAPE_ACTIVITY_MARKER_ICON_SIZE:20,POOL_LABEL_SIZE:30,POOL_LABEL_FILL_COLOR:"none",LANE_LABEL_SIZE:30,LANE_LABEL_FILL_COLOR:"none",SUB_PROCESS_TRANSACTION_INNER_RECT_OFFSET:4,SUB_PROCESS_TRANSACTION_INNER_RECT_ARC_SIZE:6,TEXT_ANNOTATION_BORDER_LENGTH:10,TEXT_ANNOTATION_FILL_COLOR:"none",GROUP_FILL_COLOR:"none",DEFAULT_FILL_COLOR:"White",DEFAULT_STROKE_COLOR:"Black",DEFAULT_FONT_FAMILY:"Arial, Helvetica, sans-serif",DEFAULT_FONT_SIZE:11,DEFAULT_FONT_COLOR:"Black",DEFAULT_MARGIN:0,SHAPE_ARC_SIZE:20,DEFAULT_OVERLAY_FILL_COLOR:"White",DEFAULT_OVERLAY_FILL_OPACITY:100,DEFAULT_OVERLAY_STROKE_COLOR:"Black",DEFAULT_OVERLAY_STROKE_WIDTH:1,DEFAULT_OVERLAY_FONT_SIZE:11,DEFAULT_OVERLAY_FONT_COLOR:"Black",SEQUENCE_FLOW_CONDITIONAL_FROM_ACTIVITY_MARKER_FILL_COLOR:"White",MESSAGE_FLOW_MARKER_START_FILL_COLOR:"White",MESSAGE_FLOW_MARKER_END_FILL_COLOR:"White"},gt=n=>A.getValue(n,S.IS_INSTANTIATING,"false")=="true",he=n=>n=="default"?void 0:n,Qt=(n,e)=>(e&&(n=b(n,c.STYLE_STROKECOLOR,e.color,he),n=b(n,c.STYLE_STROKE_OPACITY,e.opacity,Ee),n=b(n,c.STYLE_STROKEWIDTH,e.width,qt)),n),b=(n,e,t,s=o=>o)=>t==null?n:A.setStyle(n,e,s(t)),ae=(n,e,t,s)=>s==null?n:A.setStyleFlag(n,e,t,s),Jt=(n,e)=>(e&&(n=b(n,c.STYLE_FONTCOLOR,e.color,he),n=b(n,c.STYLE_FONTSIZE,e.size),n=b(n,c.STYLE_FONTFAMILY,e.family),n=ae(n,c.STYLE_FONTSTYLE,c.FONT_BOLD,e.isBold),n=ae(n,c.STYLE_FONTSTYLE,c.FONT_ITALIC,e.isItalic),n=ae(n,c.STYLE_FONTSTYLE,c.FONT_UNDERLINE,e.isUnderline),n=ae(n,c.STYLE_FONTSTYLE,c.FONT_STRIKETHROUGH,e.isStrikeThrough),n=b(n,c.STYLE_TEXT_OPACITY,e.opacity,Ee)),n),en=(n,e,t)=>(n==null?void 0:n.split(";").map(s=>s.split("=")).filter(([s])=>s===e).map(([,s])=>s)[0])??t,tn=n=>{switch(n){case"right-to-left":return c.DIRECTION_WEST;case"bottom-to-top":return c.DIRECTION_NORTH;case"top-to-bottom":return c.DIRECTION_SOUTH;default:return c.DIRECTION_EAST}},nn=(n,e)=>{const t=e.color;if(t){const s=on(t),o=s?t.startColor:t;n=b(n,c.STYLE_FILLCOLOR,o,he),s?(n=A.setStyle(n,c.STYLE_GRADIENTCOLOR,t.endColor),n=A.setStyle(n,c.STYLE_GRADIENT_DIRECTION,tn(t.direction))):t==="default"&&(n=A.setStyle(n,c.STYLE_GRADIENTCOLOR,void 0),n=A.setStyle(n,c.STYLE_GRADIENT_DIRECTION,void 0)),(n.includes(h.POOL)||n.includes(h.LANE))&&(n=b(n,c.STYLE_SWIMLANE_FILLCOLOR,o,he))}return n=b(n,c.STYLE_FILL_OPACITY,e.opacity,Ee),n},sn=n=>n&&typeof n=="object"&&"fill"in n,on=n=>n&&typeof n=="object";class rn{constructor(e){f(this,"ignoreBpmnColors");this.ignoreBpmnColors=(e==null?void 0:e.ignoreBpmnColors)??!0}computeStyle(e,t){const s=[e.bpmnElement.kind];let o;e instanceof ue?o=this.computeShapeStyleValues(e):(s.push(...cn(e)),o=this.computeEdgeStyleValues(e));const i=this.computeFontStyleValues(e),r=un(e,t);return s.push(...Xe([...o,...i,...r])),s.join(";")}computeShapeStyleValues(e){const t=new Map,s=e.bpmnElement;if(s instanceof U?ln(s,t):s instanceof pe?an(s,t):p.isPoolOrLane(s.kind)?t.set(c.STYLE_HORIZONTAL,e.isHorizontal?"0":"1"):s instanceof ht&&(t.set(S.IS_INSTANTIATING,String(s.instantiate)),t.set(S.EVENT_BASED_GATEWAY_KIND,String(s.gatewayKind))),!this.ignoreBpmnColors){const o=e.extensions,i=o.fillColor;i&&(t.set(c.STYLE_FILLCOLOR,i),p.isPoolOrLane(s.kind)&&t.set(c.STYLE_SWIMLANE_FILLCOLOR,i)),o.strokeColor&&t.set(c.STYLE_STROKECOLOR,o.strokeColor)}return t}computeEdgeStyleValues(e){const t=new Map;if(!this.ignoreBpmnColors){const s=e.extensions;s.strokeColor&&t.set(c.STYLE_STROKECOLOR,s.strokeColor)}return t}computeFontStyleValues(e){var o,i;const t=new Map,s=(o=e.label)==null?void 0:o.font;if(s&&(t.set(c.STYLE_FONTFAMILY,s.name),t.set(c.STYLE_FONTSIZE,s.size),t.set(c.STYLE_FONTSTYLE,dn(s))),!this.ignoreBpmnColors){const r=(i=e.label)==null?void 0:i.extensions;r!=null&&r.color&&t.set(c.STYLE_FONTCOLOR,r.color)}return t}computeMessageFlowIconStyle(e){const t=[];return t.push(["shape",S.MESSAGE_FLOW_ICON],[S.IS_INITIATING,String(e.messageVisibleKind===oe.INITIATING)]),this.ignoreBpmnColors||e.extensions.strokeColor&&t.push([c.STYLE_STROKECOLOR,e.extensions.strokeColor]),Xe(t).join(";")}}function ln(n,e){e.set(S.EVENT_DEFINITION_KIND,n.eventDefinitionKind),(n instanceof dt||n instanceof ut&&n.isInterrupting!==void 0)&&e.set(S.IS_INTERRUPTING,String(n.isInterrupting))}function an(n,e){n instanceof ie?e.set(S.SUB_PROCESS_KIND,n.subProcessKind):n.kind===h.TASK_RECEIVE?e.set(S.IS_INSTANTIATING,String(n.instantiate)):n instanceof X&&e.set(S.GLOBAL_TASK_KIND,n.globalTaskKind);const t=n.markers;t.length>0&&e.set(S.MARKERS,t.join(","))}function cn(n){const e=[],t=n.bpmnElement;return t instanceof lt&&e.push(t.sequenceFlowKind),t instanceof ct&&e.push(t.associationDirectionKind),e}function un(n,e){const t=new Map,s=n.bpmnElement;return e?(t.set(c.STYLE_VERTICAL_ALIGN,c.ALIGN_TOP),n.bpmnElement.kind!=h.TEXT_ANNOTATION&&t.set(c.STYLE_ALIGN,c.ALIGN_CENTER),n instanceof ue&&(t.set(c.STYLE_LABEL_WIDTH,e.width+1),t.set(c.STYLE_LABEL_POSITION,"ignore"),t.set(c.STYLE_VERTICAL_LABEL_POSITION,c.ALIGN_MIDDLE))):n instanceof ue&&(s instanceof ie||s instanceof X&&s.callActivityKind===ne.CALLING_PROCESS)&&!s.markers.includes(y.EXPAND)&&t.set(c.STYLE_VERTICAL_ALIGN,c.ALIGN_TOP),t}function dn(n){let e=0;return n.isBold&&(e+=c.FONT_BOLD),n.isItalic&&(e+=c.FONT_ITALIC),n.isStrikeThrough&&(e+=c.FONT_STRIKETHROUGH),n.isUnderline&&(e+=c.FONT_UNDERLINE),e}function Xe(n){return n.filter(([,e])=>e&&e!="undefined").map(([e,t])=>`${e}=${t}`)}class hn{constructor(e,t,s){this.graph=e,this.coordinatesTranslator=t,this.styleComputer=s}render(e){this.insertShapesAndEdges(e)}insertShapesAndEdges({pools:e,lanes:t,subprocesses:s,otherFlowNodes:o,boundaryEvents:i,edges:r}){this.graph.batchUpdate(()=>{this.graph.getModel().clear(),this.insertShapes(e),this.insertShapes(t),this.insertShapes(s),this.insertShapes(o),this.insertShapes(i),this.insertEdges(r)})}insertShapes(e){for(const t of e)this.insertShape(t)}getParent(e){return this.getCell(e.parentId)??this.graph.getDefaultParent()}insertShape(e){var l;const t=e.bpmnElement,s=this.getParent(t),o=e.bounds;let i=(l=e.label)==null?void 0:l.bounds;i=p.isPoolOrLane(t.kind)?void 0:i;const r=this.styleComputer.computeStyle(e,i);this.insertVertex(s,t.id,t.name,o,i,r)}insertEdges(e){var t;for(const s of e){const o=s.bpmnElement,i=this.graph.getDefaultParent(),r=this.getCell(o.sourceReferenceId),l=this.getCell(o.targetReferenceId),a=(t=s.label)==null?void 0:t.bounds,d=this.styleComputer.computeStyle(s,a),u=this.graph.insertEdge(i,o.id,o.name,r,l,d);if(this.insertWaypoints(s.waypoints,u),a){u.geometry.width=a.width,u.geometry.height=a.height;const g=this.coordinatesTranslator.computeEdgeCenter(u);u.geometry.relative=!1;const I=this.coordinatesTranslator.computeRelativeCoordinates(u.parent,new P(a.x,a.y)),C=I.x+a.width/2-g.x,L=I.y-g.y;u.geometry.offset=new P(C,L)}this.insertMessageFlowIconIfNeeded(s,u)}}insertMessageFlowIconIfNeeded(e,t){if(e.bpmnElement instanceof at&&e.messageVisibleKind!==oe.NONE){const s=this.graph.insertVertex(t,Me(t.id),void 0,0,0,20,14,this.styleComputer.computeMessageFlowIconStyle(e));s.geometry.relative=!0,s.geometry.offset=new P(-10,-7)}}insertWaypoints(e,t){e&&(t.geometry.points=e.map(s=>this.coordinatesTranslator.computeRelativeCoordinates(t.parent,new P(s.x,s.y))))}getCell(e){return this.graph.getModel().getCell(e)}insertVertex(e,t,s,o,i,r){const l=this.coordinatesTranslator.computeRelativeCoordinates(e,new P(o.x,o.y)),a=this.graph.insertVertex(e,t,s,l.x,l.y,o.width,o.height,r);if(i){const d=i.x-o.x,u=i.y-o.y;a.geometry.offset=new P(d,u)}return a}}function fn(n,e){return new hn(n,new $t(n),new rn(e))}function Me(n){return`messageFlowIcon_of_${n}`}class Tt extends O.mxCellOverlay{constructor(t,s){super(null,"",s.position.horizontalAlign,s.position.verticalAlign,null,"default");f(this,"style");this.label=t,this.style=s.style}getBounds(t){const s=t.view.graph.getModel().isEdge(t.cell),o=t.view.scale;let i;const r=0,l=0;return s?i=this.computeEdgeBounds(t):(i=new P,this.align==c.ALIGN_LEFT?i.x=t.x:this.align==c.ALIGN_CENTER?i.x=t.x+t.width/2:i.x=t.x+t.width,this.verticalAlign==c.ALIGN_TOP?i.y=t.y:this.verticalAlign==c.ALIGN_MIDDLE?i.y=t.y+t.height/2:i.y=t.y+t.height),new ve(Math.round(i.x-(r*this.defaultOverlap-this.offset.x)*o),Math.round(i.y-(l*this.defaultOverlap-this.offset.y)*o),r*o,l*o)}computeEdgeBounds(t){const s=t.absolutePoints;if(this.align==c.ALIGN_LEFT)return s[0];if(this.align==c.ALIGN_CENTER){if(s.length%2==1)return s[Math.floor(s.length/2)];{const o=s.length/2,i=s[o-1],r=s[o];return new P(i.x+(r.x-i.x)/2,i.y+(r.y-i.y)/2)}}else return s.at(-1)}}class $e extends O.mxText{constructor(e,t,s){super(e,t,void 0,void 0,s.font.color,void 0,s.font.size,void 0,void 0,void 0,void 0,void 0,void 0,void 0,s.fill.color,s.stroke.color),this.fillOpacity=s.fill.opacity,this.strokewidth=s.stroke.width}}function gn(n){return Object.values(k).map(e=>e).includes(n)}function Tn(n,e){return pn(n.style,e)}function pn(n,e){const t=[],s=n.split(";"),i=s[0].replace(/shape=bpmn./g,""),r=new Map;r.set("bpmn-type-activity",p.isActivity(i)),r.set("bpmn-type-container",p.isPoolOrLane(i)),r.set("bpmn-type-event",p.isEvent(i)),r.set("bpmn-type-flow",gn(i)),r.set("bpmn-type-gateway",p.isGateway(i)),r.set("bpmn-type-task",p.isTask(i));for(const[l]of[...r].filter(([,a])=>a))t.push(l);t.push(Ne(i));for(const[l,a]of s.map(d=>{const u=d.split("=");return[u[0],u[1]]}))switch(l){case S.EVENT_DEFINITION_KIND:{t.push(`bpmn-event-def-${a}`);break}case S.EVENT_BASED_GATEWAY_KIND:{t.push(`bpmn-gateway-kind-${a.toLowerCase()}`);break}case S.IS_INITIATING:{t.push(a=="true"?"bpmn-icon-initiating":"bpmn-icon-non-initiating");break}case S.SUB_PROCESS_KIND:{t.push(`bpmn-sub-process-${a.toLowerCase()}`);break}case S.GLOBAL_TASK_KIND:{t.push(Ne(a));break}}return e&&t.push("bpmn-label"),t}function Ne(n){return n?"bpmn-"+n.replace(/([A-Z])/g,e=>"-"+e[0].toLowerCase()):""}const Ze=function(n){const e=n.createSvgCanvas;n.createSvgCanvas=function(){var o;const t=e.bind(this)(),s=t.getTextCss;if(t.getTextCss=function(){const i=this.pointerEvents;this.pointerEvents=!1;const r=s.bind(this)();return this.pointerEvents=i,r},(o=this.state)!=null&&o.cell){const i=this.state.cell,r=Tn(i,this.dialect===c.DIALECT_STRICTHTML),l=this.state.style[S.EXTRA_CSS_CLASSES];typeof l=="string"&&r.push(...l.split(",")),this.node.setAttribute("class",r.join(" ")),this.node.dataset.bpmnId=this.state.cell.id}return t}};class En extends O.mxCellRenderer{constructor(e){super(),this.iconPainter=e}createCellOverlays(e){const s=e.view.graph.getCellOverlays(e.cell);let o=null;if(s!=null){o=new O.mxDictionary;for(const i of s){const r=e.overlays==null?null:e.overlays.remove(i);if(r!=null){o.put(i,r);continue}let l;i instanceof Tt?l=new $e(i.label,new ve(0,0,0,0),i.style):(l=new O.mxImageShape(new ve(0,0,0,0),i.image.src),l.preserveImageAspect=!1),l.dialect=e.view.graph.dialect,l.overlay=i,this.initializeOverlay(e,l),this.installCellOverlayListeners(e,i,l),i.cursor!=null&&(l.node.style.cursor=i.cursor),l instanceof $e&&(l.node.classList.add("overlay-badge"),l.node.dataset.bpmnId=e.cell.id),o.put(i,l)}}e.overlays!=null&&e.overlays.visit(function(i,r){r.destroy()}),e.overlays=o}createShape(e){const t=super.createShape(e);return"iconPainter"in t&&(t.iconPainter=this.iconPainter),Ze(t),t}createLabel(e,t){super.createLabel(e,t),Ze(e.text)}}function Sn(n,e,t,s){let o,i;n.heightC.setIconOriginForIconCentered(),shapeConfig:{x:e,y:t,width:s,height:o,strokeWidth:d},iconStyleConfig:{isFilled:l,fillColor:u,strokeColor:g,strokeWidth:a,margin:I}}}class Cn{newBpmnCanvas({canvas:e,ratioFromParent:t,setIconOriginFunct:s,shapeConfig:o,iconStyleConfig:i},r){return new In({canvas:e,shapeConfig:o,iconConfig:{originalSize:r,styleConfig:i,ratioFromParent:t,setIconOriginFunct:s}})}paintEnvelopeIcon(e){const t={width:485.41,height:321.76},s=this.newBpmnCanvas(e,t),o=t.width,i=t.height;s.rect(0,0,o,i),s.fillAndStroke();const{iconStyleConfig:r}=e;r.isFilled&&s.setStrokeColor(r.fillColor),s.begin(),s.moveTo(0,0),s.lineTo(o*.5,i*.6),s.lineTo(o,0),s.moveTo(0,i),s.lineTo(o/3,i*.45),s.moveTo(o,i),s.lineTo(o*2/3,i*.45),s.stroke()}paintCircleIcon(e){const t={width:e.shapeConfig.width,height:e.shapeConfig.height},s=this.newBpmnCanvas(e,t),o=t.width,i=t.height;o>0&&i>0&&s.ellipse(0,0,o,i),e.iconStyleConfig.isFilled?s.fillAndStroke():s.stroke()}paintClockIcon(e){const t=this.newBpmnCanvas(e,{height:152,width:152});t.begin(),t.moveTo(184,60),t.curveTo(188.4,60,192,56.4,192,52),t.lineTo(192,48),t.curveTo(192,40,188.4,40,184,40),t.curveTo(179.6,40,176,43.6,176,48),t.lineTo(176,52),t.curveTo(176,56.4,179.6,60,184,60),t.close(),t.moveTo(184,308),t.curveTo(179.6,308,176,311.6,176,316),t.lineTo(176,320),t.curveTo(176,324.4,179.6,328,184,328),t.curveTo(188.4,328,192,324.4,192,320),t.lineTo(192,316),t.curveTo(192,311.6,188.4,308,184,308),t.close(),t.moveTo(52,176),t.lineTo(48,176),t.curveTo(43.6,176,40,179.6,40,184),t.curveTo(40,188.4,43.6,192,48,192),t.lineTo(52,192),t.curveTo(56.4,192,69,188.4,60,184),t.curveTo(60,179.6,56.4,176,52,176),t.close(),t.moveTo(320,176),t.lineTo(316,176),t.curveTo(311.6,176,308,179.6,308,184),t.curveTo(308,188.4,311.6,192,316,192),t.lineTo(320,192),t.curveTo(324.4,192,328,188.4,328,184),t.curveTo(328,179.6,324.4,176,320,176),t.moveTo(93.6,82.4),t.curveTo(90.4,79.2,85.6,79.2,82.4,82.4),t.curveTo(79.2,85.6,79.2,90.4,82.4,93.6),t.lineTo(85.2,96.4),t.curveTo(86.8,98,88.8,98.8,90.8,98.8),t.curveTo(92.8,98.8,94.4,98,96.4,96.4),t.curveTo(99.6,93.2,99.6,88.4,96.4,85.2),t.lineTo(93.6,82.4),t.moveTo(85.2,271.6),t.lineTo(82.4,274.4),t.curveTo(79.2,277.6,79.2,282.4,82.4,285.6),t.curveTo(84,287.2,86,288,88,288),t.curveTo(90,288,92,287.2,93.6,285.6),t.lineTo(96.4,282.8),t.curveTo(99.6,279.6,99.6,274.8,96.4,271.6),t.curveTo(93.2,268.4,88.4,268.4,85.2,271.6),t.moveTo(274.4,82.4),t.lineTo(271.6,85.2),t.curveTo(268.4,88.4,268.4,93.2,271.6,96.4),t.curveTo(273.298,98,275.2,98.8,277.2,98.8),t.curveTo(279.2,98.8,281.2,98,282.8,96.4),t.lineTo(285.6,93.6),t.curveTo(288.8,90.4,288.8,85.6,285.6,82.4),t.curveTo(282.4,79.2,277.6,79.2,274.4,82.4),t.moveTo(192,180.8),t.lineTo(192,108),t.curveTo(192,103.6,188.4,100,184,100),t.curveTo(179.6,100,176,103.6,176,108),t.lineTo(176,184),t.curveTo(176,186,176.8,188,178.4,189.6),t.lineTo(266,277.2),t.curveTo(267.6,278.8,269.6,279.6,271.6,279.6),t.curveTo(273.6,279.6,275.6,278.8,277.2,277.2),t.curveTo(280.4,274,280.4,269.2,277.2,266),t.lineTo(192,180.8),t.moveTo(184,0),t.curveTo(82.4,0,0,82.4,0,184),t.curveTo(0,285.6,82.4,368,184,368),t.curveTo(285.6,368,368,285.6,368,184),t.curveTo(368,82.4,285.6,0,184,0),t.moveTo(184,352),t.curveTo(91.2,352,16,276.8,16,184),t.curveTo(16,91.2,91.2,16,184,16),t.curveTo(276.8,16,352,91.2,352,184),t.curveTo(352,276.8,276.8,352,184,352),t.fillAndStroke()}paintTriangleIcon(e){const t=this.newBpmnCanvas(e,{height:735,width:849});t.begin(),t.moveTo(497,55),t.lineTo(817,609),t.curveTo(849,665,808,735,744,735),t.lineTo(105,735),t.curveTo(40,735,0,665,32,609),t.lineTo(352,55),t.curveTo(384,0,465,0,497,55),t.close(),t.fillAndStroke()}paintUpArrowheadIcon(e){const t=this.newBpmnCanvas(e,{height:50,width:40});t.begin(),t.moveTo(0,49.5),t.lineTo(19.5,1),t.curveTo(19.75,.25,20,0,20.25,.25),t.lineTo(40,49.5),t.curveTo(40,49.5,39.75,50,39.6,49.75),t.lineTo(20,30),t.lineTo(.4,49.75),t.curveTo(.4,49.75,.25,50,0,49.5),t.close(),t.fillAndStroke()}paintDoubleLeftArrowheadsIcon(e){const t=this.newBpmnCanvas(e,{height:53.5,width:105});t.begin(),t.moveTo(91.4,0),t.curveTo(91.4,0,91.2,0,91,.2),t.lineTo(50,25),t.curveTo(47.9,25.8,46.7,26.6,46.4,27.3),t.lineTo(46.4,0),t.curveTo(46.4,0,46.2,0,46,.2),t.lineTo(4.9,25),t.curveTo(2,26.2,0,27.3,4.9,28.5),t.lineTo(45.8,53),t.curveTo(46,53.3,46.2,53.5,46.4,53.5),t.lineTo(46.4,27),t.curveTo(46.6,27.3,47.8,28.1,49.9,29.9),t.lineTo(90.8,53.3),t.curveTo(91,53.3,91.2,53.5,91.4,53.5),t.lineTo(91.4,0),t.close(),t.fillAndStroke()}drawCrossIcon(e){const t=this.newBpmnCanvas(e,{height:1,width:1});return t.begin(),t.moveTo(.38,0),t.lineTo(.62,0),t.lineTo(.62,.38),t.lineTo(1,.38),t.lineTo(1,.62),t.lineTo(.62,.62),t.lineTo(.62,1),t.lineTo(.38,1),t.lineTo(.38,.62),t.lineTo(0,.62),t.lineTo(0,.38),t.lineTo(.38,.38),t.close(),t}paintListIcon(e){const t=this.newBpmnCanvas(e,{height:60,width:60});t.begin(),t.moveTo(0,0),t.lineTo(60,0),t.lineTo(60,60),t.lineTo(0,60),t.lineTo(0,0),t.close(),t.moveTo(5,5),t.lineTo(55,5),t.close(),t.moveTo(5,21.6),t.lineTo(55,21.6),t.close(),t.moveTo(5,38.3),t.lineTo(55,38.3),t.close(),t.moveTo(5,55),t.lineTo(55,55),t.close(),t.fillAndStroke()}paintXCrossIcon(e){const t=this.drawCrossIcon(e);t.rotateOnIconCenter(45),t.fillAndStroke()}paintPlusCrossIcon(e){this.drawCrossIcon(e).fillAndStroke()}paintAsteriskIcon(e){const t=this.newBpmnCanvas(e,{height:1,width:1});Se(t),t.fillAndStroke(),Se(t),t.rotateOnIconCenter(60),t.fillAndStroke(),Se(t),t.rotateOnIconCenter(240),t.fillAndStroke()}paintPersonIcon(e){const t=this.newBpmnCanvas({...e,iconStyleConfig:{...e.iconStyleConfig,isFilled:!0}},{height:239.68,width:143.61});t.begin(),t.moveTo(124.31,150.29),t.lineTo(99.66,141.03),t.arcTo(6.43,6.43,0,0,1,95.51,135.03),t.lineTo(95.51,130.66),t.arcTo(47.75,47.75,0,0,0,119.51,89.25),t.lineTo(119.51,71.25),t.arcTo(47.62,47.62,0,0,0,101.18,33.64),t.arcTo(29.35,29.35,0,0,0,101.52,29.14),t.arcTo(29.68,29.68,0,0,0,42.17,29.14),t.arcTo(29.24,29.24,0,0,0,42.53,33.63),t.arcTo(47.65,47.65,0,0,0,24.14,71.23),t.lineTo(24.14,89.23),t.arcTo(47.7,47.7,0,0,0,48.19,130.63),t.lineTo(48.19,135.03),t.arcTo(6.43,6.43,0,0,1,44.03,141.03),t.lineTo(19.31,150.29),t.arcTo(29.81,29.81,0,0,0,.09,178.03),t.lineTo(.09,233.51),t.arcTo(5.63,5.63,0,1,0,11.34,233.51),t.lineTo(11.34,178.03),t.arcTo(18.19,18.19,0,0,1,11.57,175.17),t.lineTo(20.5,184.11),t.arcTo(12.32,12.32,0,0,1,24.14,192.89),t.lineTo(24.14,233.51),t.arcTo(5.63,5.63,0,1,0,35.39,233.51),t.lineTo(35.39,192.93),t.arcTo(23.5,23.5,0,0,0,28.46,176.2),t.lineTo(17.04,164.78),t.arcTo(18.34,18.34,0,0,1,23.29,160.78),t.lineTo(43.65,153.15),t.lineTo(66.22,175.72),t.lineTo(66.22,233.51),t.arcTo(5.63,5.63,0,1,0,77.47,233.51),t.lineTo(77.47,175.76),t.lineTo(100.04,153.19),t.lineTo(120.4,160.82),t.arcTo(18.39,18.39,0,0,1,126.65,164.82),t.lineTo(115.24,176.24),t.arcTo(23.5,23.5,0,0,0,108.31,192.93),t.lineTo(108.31,233.55),t.arcTo(5.63,5.63,0,1,0,119.56,233.55),t.lineTo(119.56,192.93),t.arcTo(12.35,12.35,0,0,1,123.19,184.15),t.lineTo(132.13,175.22),t.arcTo(18,18,0,0,1,132.36,178.08),t.lineTo(132.36,233.56),t.arcTo(5.63,5.63,0,0,0,143.61,233.56),t.lineTo(143.61,178.03),t.arcTo(29.81,29.81,0,0,0,124.31,150.29),t.close(),t.moveTo(71.85,10.72),t.arcTo(18.46,18.46,0,0,1,90.17,27.18),t.arcTo(47.68,47.68,0,0,0,53.53,27.18),t.arcTo(18.44,18.44,0,0,1,71.85,10.72),t.close(),t.moveTo(35.39,71.23),t.arcTo(36.46,36.46,0,0,1,108.31,71.23),t.lineTo(108.31,77.4),t.curveTo(82.12,75.4,56.97,60.55,56.71,60.4),t.arcTo(5.62,5.62,0,0,0,48.78,62.71),t.curveTo(46.24,67.79,40.45,71.89,35.39,74.62),t.close(),t.moveTo(35.39,89.23),t.lineTo(35.39,87.08),t.curveTo(40.55,84.85,49.73,80.08,55.67,72.66),t.curveTo(64.83,77.46,85.92,87.21,108.31,88.66),t.lineTo(108.31,89.24),t.arcTo(36.46,36.46,0,1,1,35.39,89.24),t.close(),t.moveTo(71.85,165.45),t.lineTo(54.06,147.69),t.arcTo(17.7,17.7,0,0,0,59.43,135.32),t.arcTo(47.57,47.57,0,0,0,84.27,135.32),t.arcTo(17.7,17.7,0,0,0,89.64,147.69),t.close(),t.fill()}paintGearIcon(e){const t=this.newBpmnCanvas(e,{height:100,width:100});mn(t),t.translateIconOrigin(14,14),An(t)}paintExpandIcon(e){const t={width:16,height:16},s=this.newBpmnCanvas(e,t),o=t.width,i=t.height;s.roundrect(0,0,o,i,2,2),s.stroke(),s.begin(),s.moveTo(o/2,i/4),s.lineTo(o/2,i*3/4),s.close(),s.moveTo(o/4,i/2),s.lineTo(o*3/4,i/2),s.close(),s.fillAndStroke()}paintLoopIcon(e){const{iconStyleConfig:t}=e;t.fillColor=t.strokeColor;const s=this.newBpmnCanvas(e,{width:22.49,height:21.62});s.begin(),s.moveTo(5.5,19.08),s.arcTo(8,8,0,1,1,10.5,21.08),s.stroke(),s.begin(),s.moveTo(7.5,14.08),s.lineTo(5.75,19.08),s.lineTo(0,17.08),s.close(),s.fillAndStroke()}paintSequentialMultiInstanceIcon(e){const t={width:16,height:16},s=this.newBpmnCanvas(e,t),{canvas:o,iconStyleConfig:i}=e;o.setFillColor(i.strokeColor);const r=t.width,l=t.height/5;s.rect(0,0,r,l),s.fill(),s.rect(0,2*l,r,l),s.fill(),s.rect(0,4*l,r,l),s.fill()}paintParallelMultiInstanceIcon(e){const t={width:16,height:16},s=this.newBpmnCanvas(e,t),{canvas:o,iconStyleConfig:i}=e;o.setFillColor(i.strokeColor);const r=t.width/5,l=t.height;s.begin(),s.rect(0,0,r,l),s.fill(),s.rect(2*r,0,r,l),s.fill(),s.rect(4*r,0,r,l),s.fill()}paintRightArrowIcon(e){const t=this.newBpmnCanvas(e,{width:512,height:415.23});t.setRoundLineJoin(),t.begin(),t.moveTo(512,207.61),t.lineTo(304.38,0),t.lineTo(304.38,135.39),t.lineTo(0,135.39),t.lineTo(0,279.84),t.lineTo(304.38,279.84),t.lineTo(304.38,415.23),t.lineTo(512,207.61),t.close(),t.fillAndStroke()}paintErrorIcon(e){const t=this.newBpmnCanvas(e,{width:72.44,height:71.82});t.begin(),t.moveTo(0,53.32),t.lineTo(19.48,0),t.lineTo(19.48,0),t.lineTo(50.85,40.07),t.lineTo(72.44,18.21),t.lineTo(53.12,71.82),t.lineTo(22.5,31.37),t.close(),t.fillAndStroke()}paintHandIcon(e){const t=this.newBpmnCanvas(e,{width:343.65,height:354.12});t.begin(),t.moveTo(231.66,336.39),t.curveTo(240.84,316.9,220.53,306.92,220.53,306.92),t.curveTo(215.2,303.67,188.58,287.43,140.67,258.19),t.lineTo(146.33,248.39),t.curveTo(223.98,269.38,267.12,281.04,275.75,283.38),t.curveTo(275.75,283.38,297.25,288,301.42,267.77),t.curveTo(306.34,245.29,288.32,238.63,288.32,238.63),t.curveTo(279.91,236.44,237.86,225.48,162.18,205.75),t.lineTo(165.2,194.8),t.curveTo(255.88,204.4,306.27,209.73,316.34,210.8),t.curveTo(316.34,210.8,339.89,212.16,341.76,189.55),t.curveTo(343.65,166.93,320.5,164.13,320.5,164.13),t.curveTo(310.43,163.1,260.04,157.99,169.35,148.77),t.lineTo(169.35,138.97),t.curveTo(253.41,132.12,300.11,128.32,309.45,127.56),t.curveTo(309.45,127.56,332.27,122.38,332.27,102.61),t.curveTo(332.27,82.85,305.48,81.87,305.48,81.87),t.curveTo(293.99,82.2,236.54,83.88,133.13,86.9),t.lineTo(127.61,81.87),t.curveTo(145.3,59.39,155.12,46.9,157.09,44.41),t.curveTo(157.09,44.41,171.12,26.8,156.78,12.72),t.curveTo(143.83,0,124.08,14.49,124.08,14.49),t.curveTo(116.45,19.41,78.35,44.06,9.77,88.43),t.lineTo(0,251.94),t.curveTo(122.84,308.79,191.09,340.37,204.74,346.69),t.curveTo(204.74,346.69,222.91,354.12,231.66,336.39),t.fillAndStroke()}paintScriptIcon(e){e.iconStyleConfig.fillColor=e.iconStyleConfig.strokeColor;const t=this.newBpmnCanvas(e,{width:458.75,height:461.64});t.begin(),t.moveTo(67.85,.57),t.curveTo(50.73,0,33.26,8.86,22.35,18.84),t.curveTo(8.11,32.15,0,50.77,0,70.26),t.curveTo(0,73.15,0,87.59,0,113.6),t.curveTo(55.4,113.6,86.18,113.6,92.33,113.6),t.curveTo(94.92,150.46,85.64,180.4,74.22,211.27),t.curveTo(40.16,298.07,30.77,339.83,55.56,410.87),t.curveTo(63.72,438.26,87.59,457.85,114.91,461.09),t.curveTo(216.96,460.85,294.9,461.64,388.41,461.2),t.curveTo(407.2,461.09,425.14,453.55,438.3,440.13),t.curveTo(451.46,426.71,458.75,403.06,458.46,384.26),t.curveTo(458.43,382.23,458.18,365.93,458.15,363.89),t.curveTo(432.12,364.24,406.09,364.04,380.06,364.04),t.curveTo(377.61,347.52,377.24,337.58,378.28,324.48),t.curveTo(380.5,296.47,389.08,273.36,398.59,247.1),t.curveTo(408.11,220.83,418.41,191.47,420.86,154.24),t.curveTo(422.11,135.34,421.4,110.24,417.77,86.75),t.curveTo(417.76,86.71,417.73,86.54,417.69,86.22),t.curveTo(417.64,85.95,417.61,85.79,417.6,85.76),t.curveTo(414.03,68.13,410.49,48.84,399.79,31.47),t.curveTo(389.09,14.11,366.95,.59,341.75,.59),t.curveTo(286.97,.59,122.63,.57,67.85,.57),t.close(),t.moveTo(85.04,72.68),t.curveTo(80.63,72.68,45.33,72.68,40.92,72.68),t.curveTo(40.46,58.4,47.15,51.87,50.27,48.75),t.curveTo(55.8,44.28,59.84,41,73.82,41),t.curveTo(78.45,52.13,82.23,62.71,85.04,72.68),t.close(),t.moveTo(364.94,52.9),t.curveTo(370,61.11,373.9,76.44,377.38,93.51),t.curveTo(380.35,113.1,381.01,136.42,380.02,151.57),t.curveTo(377.97,182.76,369.51,207.12,360.1,233.1),t.curveTo(350.69,259.09,340.27,286.77,337.53,321.27),t.curveTo(336.38,335.86,336.72,346.69,338.87,364.01),t.curveTo(326.35,364.01,263.75,364.01,151.06,364.01),t.curveTo(151.06,382.2,151.06,392.31,151.06,394.33),t.curveTo(147.77,404.8,138.9,418.2,127.43,419.94),t.curveTo(111.49,422.35,97.86,411.8,94.75,399.19),t.curveTo(65.14,321.99,94.93,275.54,112.57,225.47),t.curveTo(130.14,177.95,137.92,117.41,112.71,42.09),t.curveTo(192.88,41.9,274.33,42.21,342.89,41.98),t.curveTo(357.15,42.03,359.83,44.61,364.94,52.9),t.close(),t.moveTo(409.96,399.48),t.curveTo(409.96,408.42,398.54,425.67,392.02,425.67),t.curveTo(325.19,425.79,252.29,425.67,185.23,425.67),t.curveTo(189.88,424.43,194.66,405.64,194.66,399.48),t.curveTo(237.72,399.48,388.43,399.48,409.96,399.48),t.close(),t.fill(),t.begin(),t.moveTo(182.1,131.2),t.lineTo(182.1,151.68),t.lineTo(321.89,151.68),t.lineTo(321.89,131.2),t.lineTo(182.1,131.2),t.close(),t.moveTo(162.25,251.09),t.lineTo(162.25,271.49),t.lineTo(301.96,271.49),t.lineTo(301.96,251.09),t.lineTo(162.25,251.09),t.close(),t.fill()}paintTableIcon(e){const t=this.newBpmnCanvas(e,{width:640,height:640});t.begin(),t.moveTo(.19,.1),t.lineTo(298.78,.1),t.lineTo(298.78,198.88),t.lineTo(.19,198.88),t.lineTo(.19,.1),t.close(),t.fillAndStroke(),t.begin(),t.moveTo(0,0),t.lineTo(298.78,0),t.lineTo(298.78,48.88),t.lineTo(0,48.88),t.lineTo(0,0),t.close(),t.fillAndStroke(),t.begin(),t.moveTo(0,48.88),t.lineTo(98.78,48.88),t.lineTo(98.78,198.88),t.lineTo(0,198.88),t.lineTo(0,48.88),t.close(),t.fillAndStroke(),t.begin(),t.moveTo(1.09,122.69),t.lineTo(298.78,122.69),t.close(),t.fillAndStroke(),t.setFillColor(e.iconStyleConfig.strokeColor),t.begin(),t.moveTo(0,0),t.lineTo(298.78,0),t.lineTo(298.78,48.88),t.lineTo(0,48.88),t.lineTo(0,0),t.close(),t.fillAndStroke()}paintPentagon(e){const t=this.newBpmnCanvas(e,{width:16,height:16});t.begin(),t.moveTo(16,6.5),t.lineTo(8,0),t.lineTo(0,6.5),t.lineTo(3,16),t.lineTo(13,16),t.lineTo(16,6.5),t.lineTo(8,0),t.stroke()}}function Se(n){n.begin(),n.moveTo(.38,0),n.lineTo(.62,0),n.lineTo(.62,1),n.lineTo(.38,1),n.close()}function mn(n){n.begin(),n.moveTo(2.06,24.62),n.lineTo(10.17,30.95),n.lineTo(9.29,37.73),n.lineTo(0,41.42),n.lineTo(2.95,54.24),n.lineTo(13.41,52.92),n.lineTo(17.39,58.52),n.lineTo(13.56,67.66),n.lineTo(24.47,74.44),n.lineTo(30.81,66.33),n.lineTo(37.88,67.21),n.lineTo(41.57,76.5),n.lineTo(54.24,73.55),n.lineTo(53.06,62.94),n.lineTo(58.52,58.52),n.lineTo(67.21,63.09),n.lineTo(74.58,51.88),n.lineTo(66.03,45.25),n.lineTo(66.92,38.62),n.lineTo(76.5,34.93),n.lineTo(73.7,22.26),n.lineTo(62.64,23.44),n.lineTo(58.81,18.42),n.lineTo(62.79,8.7),n.lineTo(51.74,2.21),n.lineTo(44.81,10.47),n.lineTo(38.03,9.43),n.lineTo(33.75,0),n.lineTo(21.52,3.24),n.lineTo(22.7,13.56),n.lineTo(18.13,17.54),n.lineTo(8.7,13.56),n.close(),_e(n,24.8,39)}function An(n){n.begin(),n.moveTo(16.46,41.42),n.lineTo(24.57,47.75),n.lineTo(23.69,54.53),n.lineTo(14.4,58.22),n.lineTo(17.35,71.04),n.lineTo(27.81,69.72),n.lineTo(31.79,75.32),n.lineTo(27.96,84.46),n.lineTo(38.87,91.24),n.lineTo(45.21,83.13),n.lineTo(52.28,84.01),n.lineTo(55.97,93.3),n.lineTo(68.64,90.35),n.lineTo(67.46,79.74),n.lineTo(72.92,75.32),n.lineTo(81.61,79.89),n.lineTo(88.98,68.68),n.lineTo(80.43,62.05),n.lineTo(81.32,55.42),n.lineTo(90.9,51.73),n.lineTo(88.1,39.06),n.lineTo(77.04,40.24),n.lineTo(73.21,35.22),n.lineTo(77.19,25.5),n.lineTo(66.14,19.01),n.lineTo(59.21,27.27),n.lineTo(52.43,26.23),n.lineTo(48.15,16.8),n.lineTo(35.92,20.04),n.lineTo(37.1,30.36),n.lineTo(32.53,34.34),n.lineTo(23.1,30.36),n.close();const e=39.2,t=55.8;_e(n,e,t),n.begin(),_e(n,e,t)}function _e(n,e,t){n.moveTo(e,t),n.arcTo(13.5,13.5,0,1,1,e+2*13.5,t),n.arcTo(13.5,13.5,0,0,1,e,t),n.close(),n.fillAndStroke()}class pt{static get(){return this.instance}static set(e){this.instance=e}}f(pt,"instance",new Cn);class vn extends O.mxGraph{constructor(e){super(e),this.container&&(this.container.style.cursor="default")}createGraphView(){return new On(this)}createCellRenderer(){return new En(pt.get())}batchUpdate(e){this.model.beginUpdate();try{e()}finally{this.model.endUpdate()}}}class On extends O.mxGraphView{getFloatingTerminalPoint(e,t,s,o){if(e.absolutePoints.filter(Boolean).length<2)return super.getFloatingTerminalPoint(e,t,s,o);const l=e.absolutePoints;return o?l[1]:l.at(-2)}}const Ln=[y.LOOP,y.MULTI_INSTANCE_PARALLEL,y.MULTI_INSTANCE_SEQUENTIAL,y.COMPENSATION,y.EXPAND,y.ADHOC];function Nn(n){const e=Ln.filter(t=>n.includes(t));for(const t of n.filter(s=>!e.includes(s)))e.push(t);return e}function _n(n,e){return n===1?t=>t.setIconOriginForIconBottomCentered():t=>{t.setIconOriginForIconBottomCentered();const s=Math.pow(-1,e)*(T.SHAPE_ACTIVITY_MARKER_ICON_SIZE+T.SHAPE_ACTIVITY_MARKER_ICON_MARGIN)/2;t.translateIconOrigin(s,0)}}class Be extends Pe{constructor(){super(void 0,void 0,void 0);f(this,"iconPainter");f(this,"markerPainterFunctions",new Map([[y.EXPAND,t=>this.iconPainter.paintExpandIcon(t)],[y.LOOP,t=>this.iconPainter.paintLoopIcon(t)],[y.MULTI_INSTANCE_PARALLEL,t=>this.iconPainter.paintParallelMultiInstanceIcon(t)],[y.MULTI_INSTANCE_SEQUENTIAL,t=>this.iconPainter.paintSequentialMultiInstanceIcon(t)]]))}paintForeground(t,s,o,i,r){super.paintForeground(t,s,o,i,r),this.paintMarkerIcons(j({canvas:t,x:s,y:o,width:i,height:r,shape:this,ratioFromParent:0,iconStrokeWidth:1.5}))}paintMarkerIcons(t){var o;const s=A.getValue(this.style,S.MARKERS,void 0);if(s){const i=Nn(s.split(","));for(const[r,l]of i.entries())t={...t,setIconOriginFunct:_n(i.length,r+1)},t.canvas.save(),(o=this.markerPainterFunctions.get(l))==null||o(t),t.canvas.restore()}}paintEnvelopeIcon(t,s){this.iconPainter.paintEnvelopeIcon({...t,setIconOriginFunct:o=>o.setIconOriginToShapeTopLeft(),ratioFromParent:.2,iconStyleConfig:{...t.iconStyleConfig,isFilled:s}})}}class W extends Be{paintForeground(e,t,s,o,i){super.paintForeground(e,t,s,o,i),this.paintTaskIcon(j({canvas:e,x:t,y:s,width:o,height:i,shape:this}))}}class yn extends W{paintTaskIcon(e){}}class wn extends W{paintTaskIcon(e){this.iconPainter.paintGearIcon({...e,setIconOriginFunct:t=>t.setIconOriginToShapeTopLeftProportionally(20)})}}class Rn extends W{paintTaskIcon(e){this.iconPainter.paintPersonIcon({...e,setIconOriginFunct:t=>t.setIconOriginToShapeTopLeftProportionally(20)})}}class bn extends W{paintTaskIcon(e){if(!gt(this.style)){this.paintEnvelopeIcon(e,!1);return}const t=4,s=4,o={...e.shapeConfig,width:20,height:20};this.iconPainter.paintCircleIcon({canvas:e.canvas,shapeConfig:o,iconStyleConfig:{...e.iconStyleConfig,isFilled:!1},ratioFromParent:void 0,setIconOriginFunct:i=>i.setIconOriginToShapeTopLeft(s,t)}),o.x+=t,o.y+=s,this.iconPainter.paintEnvelopeIcon({...e,shapeConfig:o,ratioFromParent:.65,setIconOriginFunct:i=>i.setIconOriginForIconCentered()})}}class Fn extends W{paintTaskIcon(e){this.paintEnvelopeIcon(e,!0)}}class Pn extends W{paintTaskIcon(e){this.iconPainter.paintHandIcon({...e,ratioFromParent:.18,setIconOriginFunct:t=>t.setIconOriginToShapeTopLeftProportionally(20)})}}class kn extends W{paintTaskIcon(e){this.iconPainter.paintScriptIcon({...e,ratioFromParent:.22,setIconOriginFunct:t=>t.setIconOriginToShapeTopLeftProportionally(20)})}}class Mn extends Be{paintForeground(e,t,s,o,i){super.paintForeground(e,t,s,o,i);const r=j({canvas:e,x:t,y:s,width:o,height:i,shape:this});switch(A.getValue(this.style,S.GLOBAL_TASK_KIND,void 0)){case h.GLOBAL_TASK_MANUAL:{this.iconPainter.paintHandIcon({...r,ratioFromParent:.18,setIconOriginFunct:l=>l.setIconOriginToShapeTopLeftProportionally(20)});break}case h.GLOBAL_TASK_SCRIPT:{this.iconPainter.paintScriptIcon({...r,ratioFromParent:.22,setIconOriginFunct:l=>l.setIconOriginToShapeTopLeftProportionally(20)});break}case h.GLOBAL_TASK_USER:{this.iconPainter.paintPersonIcon({...r,setIconOriginFunct:l=>l.setIconOriginToShapeTopLeftProportionally(20)});break}case h.GLOBAL_TASK_BUSINESS_RULE:{this.iconPainter.paintTableIcon({...r,ratioFromParent:.6,setIconOriginFunct:l=>l.setIconOriginToShapeTopLeftProportionally(15)});break}}}}class Bn extends Be{paintBackground(e,t,s,o,i){const r=A.getValue(this.style,S.SUB_PROCESS_KIND,void 0);if(e.save(),r===Y.EVENT&&(e.setDashed(!0,!1),e.setDashPattern("1 2")),super.paintBackground(e,t,s,o,i),r===Y.TRANSACTION){const l=T.SUB_PROCESS_TRANSACTION_INNER_RECT_OFFSET,a=T.SUB_PROCESS_TRANSACTION_INNER_RECT_ARC_SIZE;e.roundrect(t+l,s+l,o-2*l,i-2*l,a,a),e.stroke()}e.restore()}}class xn extends W{paintTaskIcon(e){this.iconPainter.paintTableIcon({...e,ratioFromParent:.6,setIconOriginFunct:t=>t.setIconOriginToShapeTopLeftProportionally(15)})}}class Yn extends O.mxConnector{paintEdgeShape(e,t){const s=this.createMarker(e,t,!0),o=this.createMarker(e,t,!1);this.paintEdgeLine(e,t),e.setShadow(!1),e.setDashed(!1,!1),s!=null&&(e.setFillColor(A.getValue(this.style,S.EDGE_START_FILL_COLOR,this.stroke)),s()),o!=null&&(e.setFillColor(A.getValue(this.style,S.EDGE_END_FILL_COLOR,this.stroke)),o())}paintEdgeLine(e,t){const s=Vn(e);je(e,"stroke"),this.paintLine(e,t,this.isRounded),je(e,s)}}function Vn(n){return n instanceof ke?n.pointerEventsValue:null}function je(n,e){n instanceof ke&&(n.pointerEventsValue=e)}class xe extends O.mxEllipse{constructor(){super(void 0,void 0,void 0);f(this,"iconPainter");f(this,"iconPainters",new Map([[w.MESSAGE,t=>this.iconPainter.paintEnvelopeIcon({...t,ratioFromParent:.5})],[w.TERMINATE,t=>this.iconPainter.paintCircleIcon({...t,ratioFromParent:.6})],[w.TIMER,t=>this.iconPainter.paintClockIcon({...t,setIconOriginFunct:s=>s.setIconOriginToShapeTopLeftProportionally(5)})],[w.SIGNAL,t=>this.iconPainter.paintTriangleIcon({...t,ratioFromParent:.55,iconStyleConfig:{...t.iconStyleConfig,strokeWidth:T.STROKE_WIDTH_THIN.valueOf()},setIconOriginFunct:s=>s.setIconOriginToShapeTopLeftProportionally(4)})],[w.LINK,t=>this.iconPainter.paintRightArrowIcon({...t,ratioFromParent:.55,iconStyleConfig:{...t.iconStyleConfig,strokeWidth:1.5}})],[w.ERROR,t=>this.iconPainter.paintErrorIcon({...t,ratioFromParent:.55,iconStyleConfig:{...t.iconStyleConfig,strokeWidth:1.5}})],[w.COMPENSATION,t=>this.iconPainter.paintDoubleLeftArrowheadsIcon({...t,ratioFromParent:.7,iconStyleConfig:{...t.iconStyleConfig,strokeWidth:1.5}})],[w.CANCEL,t=>this.iconPainter.paintXCrossIcon({...t,ratioFromParent:.78})],[w.ESCALATION,t=>this.iconPainter.paintUpArrowheadIcon({...t,ratioFromParent:.55,iconStyleConfig:{...t.iconStyleConfig,strokeWidth:T.STROKE_WIDTH_THIN.valueOf()}})],[w.CONDITIONAL,t=>this.iconPainter.paintListIcon({...t,ratioFromParent:.6,iconStyleConfig:{...t.iconStyleConfig,strokeWidth:1.5}})]]));f(this,"withFilledIcon",!1)}paintVertexShape(t,s,o,i,r){const l=j({canvas:t,x:s,y:o,width:i,height:r,shape:this,isFilled:this.withFilledIcon});Gn(l,A.getValue(this.style,S.IS_INTERRUPTING,void 0)),this.paintOuterShape(l),Dn(l),this.paintInnerShape(l)}paintOuterShape({canvas:t,shapeConfig:{x:s,y:o,width:i,height:r}}){super.paintVertexShape(t,s,o,i,r)}paintInnerShape(t){const s=this.iconPainters.get(A.getValue(this.style,S.EVENT_DEFINITION_KIND,w.NONE));s==null||s(t)}}function Gn(n,e){n.canvas.save(),e==="false"&&(n.canvas.setDashed(!0,!1),n.canvas.setDashPattern("3 2"))}function Dn(n){n.canvas.restore()}class Un extends xe{constructor(){super(),this.withFilledIcon=!0}}class ye extends xe{paintOuterShape({canvas:e,shapeConfig:{x:t,y:s,width:o,height:i,strokeWidth:r}}){e.ellipse(t,s,o,i),e.fillAndStroke();const l=r*1.5;e.ellipse(o*.02+l+t,i*.02+l+s,o*.96-2*l,i*.96-2*l),e.stroke()}}class Wn extends ye{constructor(){super(),this.withFilledIcon=!0}}class Hn extends Pe{constructor(){super(...arguments);f(this,"iconPainter")}paintVertexShape(t,s,o,i,r){const l=j({canvas:t,x:s,y:o,width:i,height:r,shape:this,ratioFromParent:1,isFilled:A.getValue(this.style,S.IS_INITIATING,"true")=="false"});this.iconPainter.paintEnvelopeIcon(l)}}class re extends O.mxRhombus{constructor(){super(...arguments);f(this,"iconPainter")}paintVertexShape(t,s,o,i,r){const l=j({canvas:t,x:s,y:o,width:i,height:r,shape:this});this.paintOuterShape(l),this.paintInnerShape(l)}paintOuterShape({canvas:t,shapeConfig:{x:s,y:o,width:i,height:r}}){super.paintVertexShape(t,s,o,i,r)}}class Kn extends re{paintInnerShape(e){this.iconPainter.paintXCrossIcon({...e,iconStyleConfig:{...e.iconStyleConfig,isFilled:!0},ratioFromParent:.5})}}class zn extends re{paintInnerShape(e){this.iconPainter.paintPlusCrossIcon({...e,iconStyleConfig:{...e.iconStyleConfig,isFilled:!0},ratioFromParent:.5})}}class Xn extends re{paintInnerShape(e){this.iconPainter.paintCircleIcon({...e,ratioFromParent:.62,iconStyleConfig:{...e.iconStyleConfig,isFilled:!1,strokeWidth:T.STROKE_WIDTH_THICK.valueOf()}})}}class $n extends re{paintInnerShape(e){this.iconPainter.paintAsteriskIcon({...e,iconStyleConfig:{...e.iconStyleConfig,isFilled:!0},ratioFromParent:.5})}}class Zn extends re{paintInnerShape(e){e={...e,iconStyleConfig:{...e.iconStyleConfig,strokeWidth:1}},this.iconPainter.paintCircleIcon({...e,ratioFromParent:.55}),gt(this.style)||this.iconPainter.paintCircleIcon({...e,ratioFromParent:.45});const t={...e,ratioFromParent:.3};A.getValue(this.style,S.EVENT_BASED_GATEWAY_KIND,se.Exclusive)==se.Parallel?this.iconPainter.paintPlusCrossIcon(t):this.iconPainter.paintPentagon(t)}}class jn extends Pe{paintForeground(e,t,s,o,i){e.begin(),e.moveTo(t+T.TEXT_ANNOTATION_BORDER_LENGTH,s),e.lineTo(t,s),e.lineTo(t,s+i),e.lineTo(t+T.TEXT_ANNOTATION_BORDER_LENGTH,s+i),e.stroke()}paintBackground(e,t,s,o,i){e.save(),e.setStrokeColor("none"),super.paintBackground(e,t,s,o,i),e.restore()}}const qn=()=>{const n=[[h.EVENT_END,Un],[h.EVENT_START,xe],[h.EVENT_INTERMEDIATE_THROW,Wn],[h.EVENT_INTERMEDIATE_CATCH,ye],[h.EVENT_BOUNDARY,ye],[h.GATEWAY_COMPLEX,$n],[h.GATEWAY_EVENT_BASED,Zn],[h.GATEWAY_EXCLUSIVE,Kn],[h.GATEWAY_INCLUSIVE,Xn],[h.GATEWAY_PARALLEL,zn],[h.SUB_PROCESS,Bn],[h.CALL_ACTIVITY,Mn],[h.TASK,yn],[h.TASK_SERVICE,wn],[h.TASK_USER,Rn],[h.TASK_RECEIVE,bn],[h.TASK_SEND,Fn],[h.TASK_MANUAL,Pn],[h.TASK_SCRIPT,kn],[h.TASK_BUSINESS_RULE,xn],[h.TEXT_ANNOTATION,jn],[S.EDGE,Yn],[S.MESSAGE_FLOW_ICON,Hn]];for(const[e,t]of n)Kt.registerShape(e,t)},Qn=(n,e,t,s,o,i,r,l,a)=>{const d=o*(r+a+4),u=i*(r+a+4);return function(){n.begin(),n.moveTo(s.x-d/2-u/2,s.y-u/2+d/2),n.lineTo(s.x+u/2-3*d/2,s.y-3*u/2-d/2),n.stroke()}},Jn=()=>{O.mxMarker.addMarker(ft.ARROW_DASH,Qn)},Et=12;class Ye extends Map{get(e){return super.get(e)??(()=>{})}}const es=new Ye([[k.SEQUENCE_FLOW,n=>{n[c.STYLE_ENDARROW]=c.ARROW_BLOCK_THIN}],[k.MESSAGE_FLOW,n=>{n[c.STYLE_DASHED]=!0,n[c.STYLE_DASH_PATTERN]="8 5",n[c.STYLE_STARTARROW]=c.ARROW_OVAL,n[c.STYLE_STARTSIZE]=8,n[c.STYLE_STARTFILL]=!0,n[S.EDGE_START_FILL_COLOR]=T.MESSAGE_FLOW_MARKER_START_FILL_COLOR,n[c.STYLE_ENDARROW]=c.ARROW_BLOCK_THIN,n[c.STYLE_ENDFILL]=!0,n[S.EDGE_END_FILL_COLOR]=T.MESSAGE_FLOW_MARKER_END_FILL_COLOR}],[k.ASSOCIATION_FLOW,n=>{n[c.STYLE_DASHED]=!0,n[c.STYLE_DASH_PATTERN]="1 2",n[c.STYLE_STARTSIZE]=Et}]]),ts=new Ye([[x.DEFAULT,n=>{n[c.STYLE_STARTARROW]=ft.ARROW_DASH}],[x.CONDITIONAL_FROM_ACTIVITY,n=>{n[c.STYLE_STARTARROW]=c.ARROW_DIAMOND_THIN,n[c.STYLE_STARTSIZE]=18,n[c.STYLE_STARTFILL]=!0,n[S.EDGE_START_FILL_COLOR]=T.SEQUENCE_FLOW_CONDITIONAL_FROM_ACTIVITY_MARKER_FILL_COLOR}]]),ns=new Ye([[$.NONE,n=>{}],[$.ONE,n=>{n[c.STYLE_ENDARROW]=c.ARROW_OPEN_THIN}],[$.BOTH,n=>{n[c.STYLE_STARTARROW]=c.ARROW_OPEN_THIN,n[c.STYLE_ENDARROW]=c.ARROW_OPEN_THIN}]]);class St{constructor(e){this.graph=e}configureStyles(){this.configureDefaultVertexStyle(),this.configurePoolStyle(),this.configureLaneStyle(),this.configureTextAnnotationStyle(),this.configureGroupStyle(),this.configureActivityStyles(),this.configureEventStyles(),this.configureGatewayStyles(),this.configureDefaultEdgeStyle(),this.configureFlowStyles()}getStylesheet(){return this.graph.getStylesheet()}putCellStyle(e,t){this.getStylesheet().putCellStyle(e,t)}configureDefaultVertexStyle(){const e=this.getStylesheet().getDefaultVertexStyle();qe(e),e[c.STYLE_ABSOLUTE_ARCSIZE]=!0,e[c.STYLE_ARCSIZE]=T.SHAPE_ARC_SIZE}configurePoolStyle(){const e={};e[c.STYLE_SHAPE]=c.SHAPE_SWIMLANE,e[c.STYLE_VERTICAL_ALIGN]=c.ALIGN_MIDDLE,e[c.STYLE_ALIGN]=c.ALIGN_CENTER,e[c.STYLE_STARTSIZE]=T.POOL_LABEL_SIZE,e[c.STYLE_FILLCOLOR]=T.POOL_LABEL_FILL_COLOR,this.graph.getStylesheet().putCellStyle(h.POOL,e)}configureLaneStyle(){const e={};e[c.STYLE_SHAPE]=c.SHAPE_SWIMLANE,e[c.STYLE_VERTICAL_ALIGN]=c.ALIGN_MIDDLE,e[c.STYLE_ALIGN]=c.ALIGN_CENTER,e[c.STYLE_SWIMLANE_LINE]=0,e[c.STYLE_STARTSIZE]=T.LANE_LABEL_SIZE,e[c.STYLE_FILLCOLOR]=T.LANE_LABEL_FILL_COLOR,this.graph.getStylesheet().putCellStyle(h.LANE,e)}configureEventStyles(){for(const e of p.eventKinds()){const t={};t[c.STYLE_SHAPE]=e,t[c.STYLE_PERIMETER]=ze.EllipsePerimeter,t[c.STYLE_STROKEWIDTH]=e==h.EVENT_END?T.STROKE_WIDTH_THICK:T.STROKE_WIDTH_THIN,t[c.STYLE_VERTICAL_LABEL_POSITION]=c.ALIGN_BOTTOM,this.putCellStyle(e,t)}}configureTextAnnotationStyle(){const e={};e[c.STYLE_SHAPE]=h.TEXT_ANNOTATION,e[c.STYLE_VERTICAL_ALIGN]=c.ALIGN_MIDDLE,e[c.STYLE_ALIGN]=c.ALIGN_LEFT,e[c.STYLE_SPACING_LEFT]=5,e[c.STYLE_FILLCOLOR]=T.TEXT_ANNOTATION_FILL_COLOR,e[c.STYLE_STROKEWIDTH]=T.STROKE_WIDTH_THIN,this.putCellStyle(h.TEXT_ANNOTATION,e)}configureGroupStyle(){const e={};e[c.STYLE_ROUNDED]=!0,e[c.STYLE_DASHED]=!0,e[c.STYLE_DASH_PATTERN]="7 4 1 4",e[c.STYLE_STROKEWIDTH]=T.STROKE_WIDTH_THIN,e[c.STYLE_FILLCOLOR]=T.GROUP_FILL_COLOR,e[c.STYLE_ALIGN]=c.ALIGN_CENTER,e[c.STYLE_VERTICAL_ALIGN]=c.ALIGN_TOP,this.putCellStyle(h.GROUP,e)}configureActivityStyles(){for(const e of p.activityKinds()){const t={};t[c.STYLE_SHAPE]=e,t[c.STYLE_ROUNDED]=!0,t[c.STYLE_VERTICAL_ALIGN]=c.ALIGN_MIDDLE,t[c.STYLE_STROKEWIDTH]=e==h.CALL_ACTIVITY?T.STROKE_WIDTH_THICK:T.STROKE_WIDTH_THIN,this.putCellStyle(e,t)}}configureGatewayStyles(){for(const e of p.gatewayKinds()){const t={};t[c.STYLE_SHAPE]=e,t[c.STYLE_PERIMETER]=ze.RhombusPerimeter,t[c.STYLE_STROKEWIDTH]=T.STROKE_WIDTH_THIN,t[c.STYLE_VERTICAL_ALIGN]=c.ALIGN_TOP,t[c.STYLE_LABEL_POSITION]=c.ALIGN_LEFT,t[c.STYLE_VERTICAL_LABEL_POSITION]=c.ALIGN_TOP,this.putCellStyle(e,t)}}configureDefaultEdgeStyle(){const e=this.getStylesheet().getDefaultEdgeStyle();qe(e),e[c.STYLE_SHAPE]=S.EDGE,e[c.STYLE_ENDSIZE]=Et,e[c.STYLE_STROKEWIDTH]=1.5,e[c.STYLE_ROUNDED]=!0,e[c.STYLE_ARCSIZE]=5,e[c.STYLE_VERTICAL_ALIGN]=c.ALIGN_BOTTOM,delete e[c.STYLE_ENDARROW]}configureEdgeStyles(e,t){for(const s of e){const o={};t.get(s)(o),this.graph.getStylesheet().putCellStyle(s.toString(),o)}}configureFlowStyles(){this.configureEdgeStyles(Object.values(k),es),this.configureEdgeStyles(Object.values(x),ts),this.configureEdgeStyles(Object.values($),ns)}}function qe(n){n[c.STYLE_FONTFAMILY]=T.DEFAULT_FONT_FAMILY,n[c.STYLE_FONTSIZE]=T.DEFAULT_FONT_SIZE,n[c.STYLE_FONTCOLOR]=T.DEFAULT_FONT_COLOR,n[c.STYLE_FILLCOLOR]=T.DEFAULT_FILL_COLOR,n[c.STYLE_STROKECOLOR]=T.DEFAULT_STROKE_COLOR,n[c.STYLE_LABEL_BACKGROUNDCOLOR]=c.NONE,n[c.STYLE_WHITE_SPACE]="wrap"}class ss{constructor(e){f(this,"graph");this.graph=new vn(e)}configure(){return this.configureGraph(),new St(this.graph).configureStyles(),qn(),Jn(),this.graph}configureGraph(){this.graph.setCellsLocked(!0),this.graph.setCellsSelectable(!1),this.graph.setEdgeLabelsMovable(!1),this.graph.setHtmlLabels(!0),this.graph.setConstrainChildren(!1),this.graph.setExtendParents(!1),this.graph.foldingEnabled=!1}}function It(n,e,{signal:t,edges:s}={}){let o,i=null;const r=s!=null&&s.includes("leading"),l=s==null||s.includes("trailing"),a=()=>{i!==null&&(n.apply(o,i),o=void 0,i=null)},d=()=>{l&&a(),C()};let u=null;const g=()=>{u!=null&&clearTimeout(u),u=setTimeout(()=>{u=null,d()},e)},I=()=>{u!==null&&(clearTimeout(u),u=null)},C=()=>{I(),o=void 0,i=null},L=()=>{I(),a()},_=function(...Q){if(t!=null&&t.aborted)return;o=this,i=Q;const J=u==null;g(),r&&J&&a()};return _.schedule=g,_.cancel=C,_.flush=L,t==null||t.addEventListener("abort",C,{once:!0}),_}function os(n,e,{signal:t,edges:s=["leading","trailing"]}={}){let o=null;const i=It(n,e,{signal:t,edges:s}),r=function(...l){o==null?o=Date.now():Date.now()-o>=e&&(o=Date.now(),i.cancel()),i(...l)};return r.cancel=i.cancel,r.flush=i.flush,r}class is{constructor(e,t){this.graph=e,this.zoomSupport=t}fit(e){this.zoomSupport.fit(e)}zoom(e){e=="in"?this.zoomSupport.zoomIn():this.zoomSupport.zoomOut()}configure(e){const t=this.graph.panningHandler;e!=null&&e.enabled?(t.addListener(V.PAN_START,Qe(this.graph,"grab")),t.addListener(V.PAN_END,Qe(this.graph,"default")),t.usePopupTrigger=!1,t.isForcePanningEvent=s=>V.isLeftMouseButton(s.getEvent())||V.isMultiTouchEvent(s.getEvent()),this.graph.setPanning(!0),this.zoomSupport.registerMouseWheelZoomListeners(e==null?void 0:e.zoom)):(this.graph.setPanning(!1),t.setPinchEnabled(!1),t.isForcePanningEvent=s=>!1)}}function Qe(n,e){return()=>{n.container.style.cursor=e}}function rs(n,e){const t=new is(n,new as(n));return t.configure(e),t}const we=1.25,ls=1/we;class as{constructor(e){f(this,"currentZoomLevel",1);this.graph=e,this.graph.zoomFactor=we}graphFit(e,t,s,o,i,r,l){const a=this.graph.fit(e,t,s,o,i,r,l);return this.setCurrentZoomLevel(a),a}setCurrentZoomLevel(e){this.currentZoomLevel=e??this.graph.view.scale}zoomActual(){this.graph.zoomActual(),this.setCurrentZoomLevel()}zoomIn(){this.graph.zoomIn(),this.setCurrentZoomLevel()}zoomOut(){this.graph.zoomOut(),this.setCurrentZoomLevel()}fit(e){this.zoomActual();const t=e==null?void 0:e.type;if(t==null||t==te.None)return;const s=Zt(e==null?void 0:e.margin);if(t==te.Center){const i=this.graph.getGraphBounds(),r=this.graph.container.clientWidth-s,l=this.graph.container.clientHeight-s,a=i.width/this.graph.view.scale,d=i.height/this.graph.view.scale,u=Math.min(3,Math.min(r/a,l/d));this.setCurrentZoomLevel(u),this.graph.view.scaleAndTranslate(u,(s+r-a*u)/(2*u)-i.x/this.graph.view.scale,(s+l-d*u)/(2*u)-i.y/this.graph.view.scale)}else{let o=!1,i=!1;switch(t){case te.Horizontal:{i=!0;break}case te.Vertical:{o=!0;break}}this.graphFit(this.graph.border,!1,s,!0,o,i)}}registerMouseWheelZoomListeners(e){e=jt(e),V.addMouseWheelListener(It(this.createMouseWheelZoomListener(!0),e.debounceDelay),this.graph.container),V.addMouseWheelListener(os(this.createMouseWheelZoomListener(!1),e.throttleDelay),this.graph.container)}createMouseWheelZoomListener(e){return(t,s)=>{if(V.isConsumed(t)||!(t instanceof MouseEvent))return;if(t.ctrlKey&&!t.altKey&&!t.shiftKey&&!t.metaKey)if(e){const[i,r]=this.getEventRelativeCoordinates(t),[l,a,d]=this.getScaleAndTranslationDeltas(i,r);this.graph.view.scaleAndTranslate(l,this.graph.view.translate.x+a,this.graph.view.translate.y+d),V.consume(t)}else this.currentZoomLevel*=s?we:ls}}getEventRelativeCoordinates(e){const t=this.graph.container.getBoundingClientRect(),s=e.clientX-t.left,o=e.clientY-t.top;return[s,o]}getScaleAndTranslationDeltas(e,t){const[s,o]=this.calculateFactorAndScale(),[i,r]=this.calculateTranslationDeltas(s,o,e*2,t*2);return[o,i,r]}calculateTranslationDeltas(e,t,s,o){if(e>1){const i=(e-1)/(t*2);s*=-i,o*=-i}else{const i=(1/e-1)/(this.graph.view.scale*2);s*=i,o*=i}return[s,o]}calculateFactorAndScale(){const e=Math.round(this.currentZoomLevel*100)/100;return[e/this.graph.view.scale,e]}}class cs{constructor(e){this.convertedElements=e}deserialize(e){const t=E(e.category).flatMap(s=>E(s.categoryValue));for(const s of t)this.convertedElements.registerCategoryValue(s.id,s.value)}}class q{}class us{constructor(e){this.options=e}warning(e){var s;if((s=this.options)!=null&&s.disableConsoleLog)return;const t=e.getMessage();console.warn(`[bv-parser] ${t.template}`,...t.arguments)}}class ds extends q{constructor(e,t){super(),this.groupBpmnElementId=e,this.categoryValueReference=t}getMessage(){return{arguments:[this.categoryValueReference,this.groupBpmnElementId],template:"Group json deserialization: unable to find category value ref %s for bpmn element %s"}}}class hs extends q{constructor(e){super(),this.bpmnElementId=e}getMessage(){return{arguments:[this.bpmnElementId],template:"Shape json deserialization: unable to find bpmn element with id %s"}}}class fs extends q{constructor(e){super(),this.bpmnElementId=e}getMessage(){return{arguments:[this.bpmnElementId],template:"Edge json deserialization: unable to find bpmn element with id %s"}}}class gs extends q{constructor(e,t){super(),this.shapeOrEdgeId=e,this.labelStyleId=t}getMessage(){return{arguments:[this.labelStyleId,this.shapeOrEdgeId],template:"Unable to assign font from style %s to shape/edge %s"}}}class Ts extends q{constructor(e,t){super(),this.laneId=e,this.flowNodeReference=t}getMessage(){return{arguments:[this.flowNodeReference,this.laneId],template:"Unable to assign lane %s as parent: flow node %s is not found"}}}class ps extends q{constructor(e,t,s){super(),this.bpmnElementId=e,this.attachedToReference=t,this.attachedToKind=s}getMessage(){return{arguments:[this.bpmnElementId,this.attachedToReference,this.attachedToKind],template:"The boundary event %s must be attached to an activity, and not to %s of kind %s"}}}class Es{constructor(){f(this,"poolsById",new Map);f(this,"poolsByProcessRef",new Map);f(this,"messageFlows",new Map);f(this,"flowNodes",new Map);f(this,"lanes",new Map);f(this,"sequenceFlows",new Map);f(this,"associationFlows",new Map);f(this,"eventDefinitionsOfDefinitions",new Map);f(this,"globalTasks",new Map);f(this,"categoryValues",new Map)}getFlows(){return[...this.messageFlows.values(),...this.sequenceFlows.values(),...this.associationFlows.values()]}findPoolById(e){return this.poolsById.get(e)}findPoolByProcessRef(e){return this.poolsByProcessRef.get(e)}registerPool(e,t){this.poolsById.set(e.id,e),t&&this.poolsByProcessRef.set(t,e)}findMessageFlow(e){return this.messageFlows.get(e)}registerMessageFlow(e){this.messageFlows.set(e.id,e)}findFlowNode(e){return this.flowNodes.get(e)}registerFlowNode(e){this.flowNodes.set(e.id,e)}findLane(e){return this.lanes.get(e)}registerLane(e){this.lanes.set(e.id,e)}findSequenceFlow(e){return this.sequenceFlows.get(e)}registerSequenceFlow(e){this.sequenceFlows.set(e.id,e)}findAssociationFlow(e){return this.associationFlows.get(e)}registerAssociationFlow(e){this.associationFlows.set(e.id,e)}findEventDefinitionOfDefinition(e){return this.eventDefinitionsOfDefinitions.get(e)}registerEventDefinitionsOfDefinition(e,t){this.eventDefinitionsOfDefinitions.set(e,t)}findGlobalTask(e){return this.globalTasks.get(e)}registerGlobalTask(e,t){this.globalTasks.set(e,t)}findCategoryValue(e){return this.categoryValues.get(e)}registerCategoryValue(e,t){this.categoryValues.set(e,{value:t})}}const Ct=(n,e,t,s)=>{const o=n.findCategoryValue(t.categoryValueRef);if(o)return new B(t.id,o.value,h.GROUP,s);e.warning(new ds(t.id,t.categoryValueRef))},mt=(n,e)=>{for(const t of E(e)){const s=t.associationDirection;n.registerAssociationFlow(new ct(t.id,void 0,t.sourceRef,t.targetRef,s))}};class Ss{constructor(e,t){this.convertedElements=e,this.parsingMessageCollector=t}deserialize(e){for(const t of E(e))this.parseCollaboration(t)}parseCollaboration(e){this.buildParticipant(e.participant),this.buildMessageFlows(e.messageFlow),mt(this.convertedElements,e.association),this.buildGroups(e.group),this.buildTextAnnotation(e.textAnnotation)}buildParticipant(e){for(const t of E(e))this.convertedElements.registerPool(new B(t.id,t.name,h.POOL),t.processRef)}buildMessageFlows(e){for(const t of E(e))this.convertedElements.registerMessageFlow(new at(t.id,t.name,t.sourceRef,t.targetRef))}buildGroups(e){for(const t of E(e)){const s=Ct(this.convertedElements,this.parsingMessageCollector,t);s&&this.convertedElements.registerFlowNode(s)}}buildTextAnnotation(e){for(const t of E(e))this.convertedElements.registerFlowNode(new B(t.id,t.text,h.TEXT_ANNOTATION))}}class Is{constructor(e,t,s,o){this.x=e,this.y=t,this.width=s,this.height=o}}class Cs{constructor(e,t,s,o,i=oe.NONE){f(this,"extensions",{});this.id=e,this.bpmnElement=t,this.waypoints=s,this.label=o,this.messageVisibleKind=i}}class ms{constructor(e,t){this.x=e,this.y=t}}class As{constructor(e,t){f(this,"extensions",{});this.font=e,this.bounds=t}}class vs{constructor(e,t,s,o,i,r){this.name=e,this.size=t,this.isBold=s,this.isItalic=o,this.isUnderline=i,this.isStrikeThrough=r}}class Os{constructor(e,t){f(this,"convertedFonts",new Map);this.convertedElements=e,this.parsingMessageCollector=t}deserialize(e){const t=[],s=[],o=[],i=[],r=E(e)[0];if(r){this.deserializeFonts(r.BPMNLabelStyle);const l=r.BPMNPlane,a=this.deserializeEdges(l.BPMNEdge),d=this.deserializeShapes(l.BPMNShape);t.push(...d.flowNodes),s.push(...d.lanes),o.push(...d.pools),i.push(...a)}return{flowNodes:t,lanes:s,pools:o,edges:i}}deserializeFonts(e){for(const t of E(e))for(const s of E(t.Font))this.convertedFonts.set(t.id,new vs(s.name,s.size,s.isBold,s.isItalic,s.isUnderline,s.isStrikeThrough))}deserializeShapes(e){const t={flowNodes:[],lanes:[],pools:[]};for(const s of E(e))this.deserializeShapeAndStoreIfFound(s,t.flowNodes,o=>this.convertedElements.findFlowNode(o))||this.deserializeShapeAndStoreIfFound(s,t.lanes,o=>this.convertedElements.findLane(o))||this.deserializeShapeAndStoreIfFound(s,t.pools,o=>this.convertedElements.findPoolById(o))||this.parsingMessageCollector.warning(new hs(s.bpmnElement));return t}deserializeShapeAndStoreIfFound(e,t,s){const o=this.deserializeShape(e,s);return o?(t.push(o),!0):!1}deserializeShape(e,t){const s=t(e.bpmnElement);if(s){const o=Je(e);(s instanceof ie||s instanceof X&&s.callActivityKind===ne.CALLING_PROCESS)&&!e.isExpanded&&s.markers.push(y.EXPAND);let i;p.isPoolOrLane(s.kind)&&(i=e.isHorizontal??!0);const r=e.BPMNLabel,l=this.deserializeLabel(r,e.id),a=new ue(e.id,s,o,l,i);return Ls(a,e),a}}deserializeEdges(e){return E(e).map(t=>{const s=this.convertedElements.findSequenceFlow(t.bpmnElement)||this.convertedElements.findMessageFlow(t.bpmnElement)||this.convertedElements.findAssociationFlow(t.bpmnElement);if(!s){this.parsingMessageCollector.warning(new fs(t.bpmnElement));return}const o=this.deserializeWaypoints(t.waypoint),i=this.deserializeLabel(t.BPMNLabel,t.id),r=t.messageVisibleKind?t.messageVisibleKind:oe.NONE,l=new Cs(t.id,s,o,i,r);return Ns(l,t),l}).filter(Boolean)}deserializeWaypoints(e){return E(e).map(t=>new ms(t.x,t.y))}deserializeLabel(e,t){if(e&&typeof e=="object"){const s=this.findFont(e.labelStyle,t),o=Je(e),i=new As(s,o);if("color"in e)return i.extensions.color=e.color,i;if(s||o)return i}}findFont(e,t){let s;return e&&(s=this.convertedFonts.get(e),s||this.parsingMessageCollector.warning(new gs(t,e))),s}}function Ls(n,e){"background-color"in e?n.extensions.fillColor=e["background-color"]:"fill"in e&&(n.extensions.fillColor=e.fill),"border-color"in e?n.extensions.strokeColor=e["border-color"]:"stroke"in e&&(n.extensions.strokeColor=e.stroke)}function Je(n){const e=n.Bounds;if(e)return new Is(e.x,e.y,e.width,e.height)}function Ns(n,e){"border-color"in e?n.extensions.strokeColor=e["border-color"]:"stroke"in e&&(n.extensions.strokeColor=e.stroke)}const _s=n=>"source"in n||"target"in n;class ys{constructor(e){this.convertedElements=e}deserialize(e){for(const t of rt){const s=e[t+"EventDefinition"];for(const o of E(s,!0))this.convertedElements.registerEventDefinitionsOfDefinition(o.id,{id:o.id,kind:t,..._s(o)?{source:o.source,target:o.target}:{}})}}}class ws{constructor(e){this.convertedElements=e}deserialize(e){this.parseGlobalTasks(e.globalTask,h.GLOBAL_TASK),this.parseGlobalTasks(e.globalBusinessRuleTask,h.GLOBAL_TASK_BUSINESS_RULE),this.parseGlobalTasks(e.globalManualTask,h.GLOBAL_TASK_MANUAL),this.parseGlobalTasks(e.globalScriptTask,h.GLOBAL_TASK_SCRIPT),this.parseGlobalTasks(e.globalUserTask,h.GLOBAL_TASK_USER)}parseGlobalTasks(e,t){for(const s of E(e))this.convertedElements.registerGlobalTask(s.id,t)}}const Rs=(n,e)=>{switch(n){case"adHocSubProcess":return Y.AD_HOC;case"transaction":return Y.TRANSACTION;default:return e.triggeredByEvent?Y.EVENT:Y.EMBEDDED}},bs=["adHocSubProcess","transaction",...p.flowNodeKinds().filter(n=>n!==h.EVENT_BOUNDARY),h.EVENT_BOUNDARY];function Fs(n){return["adHocSubProcess","transaction"].includes(n)?h.SUB_PROCESS:n}class Ps{constructor(e,t){f(this,"defaultSequenceFlowIds",[]);f(this,"elementsWithoutParentByProcessId",new Map);f(this,"callActivitiesCallingProcess",new Map);f(this,"eventsByLinkEventDefinition",new Map);this.convertedElements=e,this.parsingMessageCollector=t}deserialize(e){for(const t of E(e))this.parseProcess(t);for(const t of E(e))this.assignParentOfProcessElementsCalledByCallActivity(t.id);this.assignIncomingAndOutgoingIdsFromFlows(),this.assignSourceAndTargetIdsToLinkEvents()}assignParentOfProcessElementsCalledByCallActivity(e){const t=this.callActivitiesCallingProcess.get(e);if(t){const s=this.convertedElements.findPoolByProcessRef(e);s&&(s.parentId=t.id);for(const o of this.elementsWithoutParentByProcessId.get(e))o.parentId=t.id}}assignIncomingAndOutgoingIdsFromFlows(){const e=(t,s,o)=>{const i=this.convertedElements.findFlowNode(t)??this.convertedElements.findLane(t)??this.convertedElements.findPoolById(t);i&&!i[s].includes(o)&&i[s].push(o)};for(const t of this.convertedElements.getFlows())e(t.sourceReferenceId,"outgoingIds",t.id),e(t.targetReferenceId,"incomingIds",t.id)}assignSourceAndTargetIdsToLinkEvents(){var t;const e=[...this.eventsByLinkEventDefinition.entries()].filter(([s])=>s.id);for(const[s,o]of this.eventsByLinkEventDefinition)if(o instanceof Le){const i=e.find(([r])=>s.target===r.id);o.targetId=(t=i==null?void 0:i[1])==null?void 0:t.id}else o instanceof Oe&&(o.sourceIds=e.filter(([i])=>Array.isArray(s.source)?s.source.includes(i.id):s.source===i.id).map(([,i])=>i.id))}parseProcess(e){const t=e.id,s=this.convertedElements.findPoolByProcessRef(t);s&&!s.name&&this.convertedElements.registerPool(new B(s.id,e.name,h.POOL),t),this.buildProcessInnerElements(e,s==null?void 0:s.id)}buildProcessInnerElements(e,t){this.elementsWithoutParentByProcessId.set(e.id,[]);for(const s of bs)this.buildFlowNodeBpmnElements(e[s],Fs(s),t,e.id,s);this.buildLaneSetBpmnElements(e.laneSet,t,e.id),this.buildSequenceFlows(e.sequenceFlow),mt(this.convertedElements,e.association)}buildFlowNodeBpmnElements(e,t,s,o,i){for(const r of E(e)){const l=this.buildFlowNodeBpmnElement(t,r,s,i);"default"in r&&p.isWithDefaultSequenceFlow(t)&&this.defaultSequenceFlowIds.push(r.default),l&&(this.convertedElements.registerFlowNode(l),s||this.elementsWithoutParentByProcessId.get(o).push(l))}}buildFlowNodeBpmnElement(e,t,s,o){if(p.isEvent(e))return this.buildShapeBpmnEvent(t,e,s);if(p.isActivity(e))return this.buildShapeBpmnActivity(t,e,s,o);if(e==h.GATEWAY_EVENT_BASED){const i=t;return new ht(i.id,i.name,s,i.instantiate,se[i.eventGatewayType])}else{if(e==h.GROUP)return Ct(this.convertedElements,this.parsingMessageCollector,t,s);{const i=e===h.TEXT_ANNOTATION?t.text:t.name;return new B(t.id,i,e,s,t.instantiate)}}}buildShapeBpmnActivity(e,t,s,o){const i=ks(e);return p.isSubProcess(t)?this.buildShapeBpmnSubProcess(e,s,Rs(o,e),i):p.isCallActivity(t)?this.buildShapeBpmnCallActivity(e,s,i):new pe(e.id,e.name,t,s,e.instantiate,i)}buildShapeBpmnCallActivity(e,t,s){const o=this.convertedElements.findGlobalTask(e.calledElement);if(!o){const i=new X(e.id,e.name,ne.CALLING_PROCESS,t,s);return this.callActivitiesCallingProcess.set(e.calledElement,i),i}return new X(e.id,e.name,ne.CALLING_GLOBAL_TASK,t,s,o)}buildShapeBpmnEvent(e,t,s){const o=this.getEventDefinitions(e),i=[...o.entries()].map(([,r])=>r.length).reduce((r,l)=>r+l,0);if(i==0&&p.canHaveNoneEvent(t))return new U(e.id,e.name,t,w.NONE,s);if(i==1){const[r,l]=[...o.entries()][0],a=p.isCatchEvent(t)?this.buildShapeBpmnCatchEvent(e,t,r,s):this.buildShapeBpmnThrowEvent(e,t,r,s);return r===w.LINK&&(l[0].id||l[0].target||l[0].source)&&this.eventsByLinkEventDefinition.set(l[0],a),a}}buildShapeBpmnCatchEvent(e,t,s,o){return p.isBoundaryEvent(t)?this.buildShapeBpmnBoundaryEvent(e,s):p.isStartEvent(t)?new ut(e.id,e.name,s,o,e.isInterrupting):new Oe(e.id,e.name,s,o)}buildShapeBpmnThrowEvent(e,t,s,o){return p.isIntermediateThrowEvent(t)?new Le(e.id,e.name,s,o):new U(e.id,e.name,t,s,o)}buildShapeBpmnBoundaryEvent(e,t){const s=this.convertedElements.findFlowNode(e.attachedToRef);if(p.isActivity(s==null?void 0:s.kind))return new dt(e.id,e.name,t,e.attachedToRef,e.cancelActivity);this.parsingMessageCollector.warning(new ps(e.id,e.attachedToRef,s==null?void 0:s.kind))}getEventDefinitions(e){const t=new Map;for(const s of rt){const o=e[`${s}EventDefinition`];t.set(s,E(o,!0))}for(const s of E(e.eventDefinitionRef)){const o=this.convertedElements.findEventDefinitionOfDefinition(s);o&&t.get(o.kind).push(o)}for(const[s]of[...t.entries()].filter(([,o])=>o.length===0))t.delete(s);return t}buildShapeBpmnSubProcess(e,t,s,o){const i=new ie(e.id,e.name,s,t,o);return this.buildProcessInnerElements(e,e.id),i}buildLaneSetBpmnElements(e,t,s){for(const o of E(e))this.buildLaneBpmnElements(o.lane,t,s)}buildLaneBpmnElements(e,t,s){var o;for(const i of E(e)){const r=new B(i.id,i.name,h.LANE,t);this.convertedElements.registerLane(r),t||this.elementsWithoutParentByProcessId.get(s).push(r),this.assignParentOfLaneFlowNodes(i),(o=i.childLaneSet)!=null&&o.lane&&this.buildLaneBpmnElements(i.childLaneSet.lane,i.id,s)}}assignParentOfLaneFlowNodes(e){for(const t of E(e.flowNodeRef)){const s=this.convertedElements.findFlowNode(t),o=e.id;s?p.isBoundaryEvent(s.kind)||(s.parentId=o):this.parsingMessageCollector.warning(new Ts(o,t))}}buildSequenceFlows(e){for(const t of E(e)){const s=this.getSequenceFlowKind(t);this.convertedElements.registerSequenceFlow(new lt(t.id,t.name,t.sourceRef,t.targetRef,s))}}getSequenceFlowKind(e){if(this.defaultSequenceFlowIds.includes(e.id))return x.DEFAULT;{const t=this.convertedElements.findFlowNode(e.sourceRef);if(t&&p.isWithDefaultSequenceFlow(t.kind)&&e.conditionExpression)return p.isActivity(t.kind)?x.CONDITIONAL_FROM_ACTIVITY:x.CONDITIONAL_FROM_GATEWAY}return x.NORMAL}}const ks=n=>{const e=[],t=n.standardLoopCharacteristics,s=E(n.multiInstanceLoopCharacteristics,!0)[0];return t!==void 0?e.push(y.LOOP):s&&e.push(s.isSequential?y.MULTI_INSTANCE_SEQUENTIAL:y.MULTI_INSTANCE_PARALLEL),e};class Ms{constructor(e,t,s,o,i,r){this.categoryConverter=e,this.collaborationConverter=t,this.eventDefinitionConverter=s,this.globalTaskConverter=o,this.processConverter=i,this.diagramConverter=r}parse(e){const t=e.definitions;return this.categoryConverter.deserialize(t),this.collaborationConverter.deserialize(t.collaboration),this.eventDefinitionConverter.deserialize(t),this.globalTaskConverter.deserialize(t),this.processConverter.deserialize(t.process),this.diagramConverter.deserialize(t.BPMNDiagram)}}function Bs(n){const e=new Es;return new Ms(new cs(e),new Ss(e,n),new ys(e),new ws(e),new Ps(e,n),new Os(e,n))}const At=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",xs=At+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040",Ys="["+At+"]["+xs+"]*",Vs=new RegExp("^"+Ys+"$");function vt(n,e){const t=[];let s=e.exec(n);for(;s;){const o=[];o.startIndex=e.lastIndex-s[0].length;const i=s.length;for(let r=0;r"u")};function Gs(n){return typeof n<"u"}const Ds={allowBooleanAttributes:!1,unpairedTags:[]};function Us(n,e){e=Object.assign({},Ds,e);const t=[];let s=!1,o=!1;n[0]==="\uFEFF"&&(n=n.substr(1));for(let i=0;i"&&n[i]!==" "&&n[i]!==" "&&n[i]!==` -`&&n[i]!=="\r";i++)a+=n[i];if(a=a.trim(),a[a.length-1]==="/"&&(a=a.substring(0,a.length-1),i--),!js(a)){let g;return a.trim().length===0?g="Invalid space after '<'.":g="Tag '"+a+"' is an invalid name.",N("InvalidTag",g,R(n,i))}const d=Ks(n,i);if(d===!1)return N("InvalidAttr","Attributes for '"+a+"' have open quote.",R(n,i));let u=d.value;if(i=d.index,u[u.length-1]==="/"){const g=i-u.length;u=u.substring(0,u.length-1);const I=st(u,e);if(I===!0)s=!0;else return N(I.err.code,I.err.msg,R(n,g+I.err.line))}else if(l)if(d.tagClosed){if(u.trim().length>0)return N("InvalidTag","Closing tag '"+a+"' can't have attributes or invalid starting.",R(n,r));if(t.length===0)return N("InvalidTag","Closing tag '"+a+"' has not been opened.",R(n,r));{const g=t.pop();if(a!==g.tagName){let I=R(n,g.tagStartPos);return N("InvalidTag","Expected closing tag '"+g.tagName+"' (opened in line "+I.line+", col "+I.col+") instead of closing tag '"+a+"'.",R(n,r))}t.length==0&&(o=!0)}}else return N("InvalidTag","Closing tag '"+a+"' doesn't have proper closing.",R(n,i));else{const g=st(u,e);if(g!==!0)return N(g.err.code,g.err.msg,R(n,i-u.length+g.err.line));if(o===!0)return N("InvalidXml","Multiple possible root nodes found.",R(n,i));e.unpairedTags.indexOf(a)!==-1||t.push({tagName:a,tagStartPos:r}),s=!0}for(i++;i0)return N("InvalidXml","Invalid '"+JSON.stringify(t.map(i=>i.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1})}else return N("InvalidXml","Start tag expected.",1);return!0}function et(n){return n===" "||n===" "||n===` -`||n==="\r"}function tt(n,e){const t=e;for(;e5&&s==="xml")return N("InvalidXml","XML declaration allowed only at the start of the document.",R(n,e));if(n[e]=="?"&&n[e+1]==">"){e++;break}else continue}return e}function nt(n,e){if(n.length>e+5&&n[e+1]==="-"&&n[e+2]==="-"){for(e+=3;e"){e+=2;break}}else if(n.length>e+8&&n[e+1]==="D"&&n[e+2]==="O"&&n[e+3]==="C"&&n[e+4]==="T"&&n[e+5]==="Y"&&n[e+6]==="P"&&n[e+7]==="E"){let t=1;for(e+=8;e"&&(t--,t===0))break}else if(n.length>e+9&&n[e+1]==="["&&n[e+2]==="C"&&n[e+3]==="D"&&n[e+4]==="A"&&n[e+5]==="T"&&n[e+6]==="A"&&n[e+7]==="["){for(e+=8;e"){e+=2;break}}return e}const Ws='"',Hs="'";function Ks(n,e){let t="",s="",o=!1;for(;e"&&s===""){o=!0;break}t+=n[e]}return s!==""?!1:{value:t,index:e,tagClosed:o}}const zs=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function st(n,e){const t=vt(n,zs),s={};for(let o=0;o!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(n,e,t){return n},captureMetaData:!1},Qs=function(n){return Object.assign({},qs,n)};let fe;typeof Symbol!="function"?fe="@@xmlMetadata":fe=Symbol("XML Node Metadata");class H{constructor(e){this.tagname=e,this.child=[],this[":@"]={}}add(e,t){e==="__proto__"&&(e="#__proto__"),this.child.push({[e]:t})}addChild(e,t){e.tagname==="__proto__"&&(e.tagname="#__proto__"),e[":@"]&&Object.keys(e[":@"]).length>0?this.child.push({[e.tagname]:e.child,":@":e[":@"]}):this.child.push({[e.tagname]:e.child}),t!==void 0&&(this.child[this.child.length-1][fe]={startIndex:t})}static getMetaDataSymbol(){return fe}}function Js(n,e){const t={};if(n[e+3]==="O"&&n[e+4]==="C"&&n[e+5]==="T"&&n[e+6]==="Y"&&n[e+7]==="P"&&n[e+8]==="E"){e=e+9;let s=1,o=!1,i=!1,r="";for(;e"){if(i?n[e-1]==="-"&&n[e-2]==="-"&&(i=!1,s--):s--,s===0)break}else n[e]==="["?o=!0:r+=n[e];if(s!==0)throw new Error("Unclosed DOCTYPE")}else throw new Error("Invalid Tag instead of DOCTYPE");return{entities:t,i:e}}const G=(n,e)=>{for(;e1||i.length===1&&!l))return n;{const a=Number(t),d=String(a);if(a===0)return a;if(d.search(/[eE]/)!==-1)return e.eNotation?a:n;if(t.indexOf(".")!==-1)return d==="0"||d===r||d===`${o}${r}`?a:n;let u=i?r:t;return i?u===d||o+u===d?a:n:u===d||u===o+d?a:n}}else return n}}const lo=/^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/;function ao(n,e,t){if(!t.eNotation)return n;const s=e.match(lo);if(s){let o=s[1]||"";const i=s[3].indexOf("e")===-1?"E":"e",r=s[2],l=o?n[r.length+1]===i:n[r.length]===i;return r.length>1&&l?n:r.length===1&&(s[3].startsWith(`.${i}`)||s[3][0]===i)?Number(e):t.leadingZeros&&!l?(e=(s[1]||"")+s[3],Number(e)):n}else return n}function co(n){return n&&n.indexOf(".")!==-1&&(n=n.replace(/0+$/,""),n==="."?n="0":n[0]==="."?n="0"+n:n[n.length-1]==="."&&(n=n.substring(0,n.length-1))),n}function uo(n,e){if(parseInt)return parseInt(n,e);if(Number.parseInt)return Number.parseInt(n,e);if(window&&window.parseInt)return window.parseInt(n,e);throw new Error("parseInt, Number.parseInt, window.parseInt are not supported")}function ho(n){return typeof n=="function"?n:Array.isArray(n)?e=>{for(const t of n)if(typeof t=="string"&&e===t||t instanceof RegExp&&t.test(e))return!0}:()=>!1}class fo{constructor(e){this.options=e,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"¢"},pound:{regex:/&(pound|#163);/g,val:"£"},yen:{regex:/&(yen|#165);/g,val:"¥"},euro:{regex:/&(euro|#8364);/g,val:"€"},copyright:{regex:/&(copy|#169);/g,val:"©"},reg:{regex:/&(reg|#174);/g,val:"®"},inr:{regex:/&(inr|#8377);/g,val:"₹"},num_dec:{regex:/&#([0-9]{1,7});/g,val:(t,s)=>String.fromCodePoint(Number.parseInt(s,10))},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(t,s)=>String.fromCodePoint(Number.parseInt(s,16))}},this.addExternalEntities=go,this.parseXml=Io,this.parseTextData=To,this.resolveNameSpace=po,this.buildAttributesMap=So,this.isItStopNode=vo,this.replaceEntitiesValue=mo,this.readStopNodeData=Lo,this.saveTextToParentTag=Ao,this.addChild=Co,this.ignoreAttributesFn=ho(this.options.ignoreAttributes)}}function go(n){const e=Object.keys(n);for(let t=0;t0)){r||(n=this.replaceEntitiesValue(n));const l=this.options.tagValueProcessor(e,n,t,o,i);return l==null?n:typeof l!=typeof n||l!==n?l:this.options.trimValues?be(n,this.options.parseTagValue,this.options.numberParseOptions):n.trim()===n?be(n,this.options.parseTagValue,this.options.numberParseOptions):n}}function po(n){if(this.options.removeNSPrefix){const e=n.split(":"),t=n.charAt(0)==="/"?"/":"";if(e[0]==="xmlns")return"";e.length===2&&(n=t+e[1])}return n}const Eo=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function So(n,e,t){if(this.options.ignoreAttributes!==!0&&typeof n=="string"){const s=vt(n,Eo),o=s.length,i={};for(let r=0;r",i,"Closing Tag is not closed.");let a=n.substring(i+2,l).trim();if(this.options.removeNSPrefix){const g=a.indexOf(":");g!==-1&&(a=a.substr(g+1))}this.options.transformTagName&&(a=this.options.transformTagName(a)),t&&(s=this.saveTextToParentTag(s,t,o));const d=o.substring(o.lastIndexOf(".")+1);if(a&&this.options.unpairedTags.indexOf(a)!==-1)throw new Error(`Unpaired tag can not be used as closing tag: `);let u=0;d&&this.options.unpairedTags.indexOf(d)!==-1?(u=o.lastIndexOf(".",o.lastIndexOf(".")-1),this.tagsNodeStack.pop()):u=o.lastIndexOf("."),o=o.substring(0,u),t=this.tagsNodeStack.pop(),s="",i=l}else if(n[i+1]==="?"){let l=Re(n,i,!1,"?>");if(!l)throw new Error("Pi Tag is not closed.");if(s=this.saveTextToParentTag(s,t,o),!(this.options.ignoreDeclaration&&l.tagName==="?xml"||this.options.ignorePiTags)){const a=new H(l.tagName);a.add(this.options.textNodeName,""),l.tagName!==l.tagExp&&l.attrExpPresent&&(a[":@"]=this.buildAttributesMap(l.tagExp,o,l.tagName)),this.addChild(t,a,o,i)}i=l.closeIndex+1}else if(n.substr(i+1,3)==="!--"){const l=z(n,"-->",i+4,"Comment is not closed.");if(this.options.commentPropName){const a=n.substring(i+4,l-2);s=this.saveTextToParentTag(s,t,o),t.add(this.options.commentPropName,[{[this.options.textNodeName]:a}])}i=l}else if(n.substr(i+1,2)==="!D"){const l=Js(n,i);this.docTypeEntities=l.entities,i=l.i}else if(n.substr(i+1,2)==="!["){const l=z(n,"]]>",i,"CDATA is not closed.")-2,a=n.substring(i+9,l);s=this.saveTextToParentTag(s,t,o);let d=this.parseTextData(a,t.tagname,o,!0,!1,!0,!0);d==null&&(d=""),this.options.cdataPropName?t.add(this.options.cdataPropName,[{[this.options.textNodeName]:a}]):t.add(this.options.textNodeName,d),i=l+2}else{let l=Re(n,i,this.options.removeNSPrefix),a=l.tagName;const d=l.rawTagName;let u=l.tagExp,g=l.attrExpPresent,I=l.closeIndex;this.options.transformTagName&&(a=this.options.transformTagName(a)),t&&s&&t.tagname!=="!xml"&&(s=this.saveTextToParentTag(s,t,o,!1));const C=t;C&&this.options.unpairedTags.indexOf(C.tagname)!==-1&&(t=this.tagsNodeStack.pop(),o=o.substring(0,o.lastIndexOf("."))),a!==e.tagname&&(o+=o?"."+a:a);const L=i;if(this.isItStopNode(this.options.stopNodes,o,a)){let _="";if(u.length>0&&u.lastIndexOf("/")===u.length-1)a[a.length-1]==="/"?(a=a.substr(0,a.length-1),o=o.substr(0,o.length-1),u=a):u=u.substr(0,u.length-1),i=l.closeIndex;else if(this.options.unpairedTags.indexOf(a)!==-1)i=l.closeIndex;else{const J=this.readStopNodeData(n,d,I+1);if(!J)throw new Error(`Unexpected end of ${d}`);i=J.i,_=J.tagContent}const Q=new H(a);a!==u&&g&&(Q[":@"]=this.buildAttributesMap(u,o,a)),_&&(_=this.parseTextData(_,a,o,!0,g,!0,!0)),o=o.substr(0,o.lastIndexOf(".")),Q.add(this.options.textNodeName,_),this.addChild(t,Q,o,L)}else{if(u.length>0&&u.lastIndexOf("/")===u.length-1){a[a.length-1]==="/"?(a=a.substr(0,a.length-1),o=o.substr(0,o.length-1),u=a):u=u.substr(0,u.length-1),this.options.transformTagName&&(a=this.options.transformTagName(a));const _=new H(a);a!==u&&g&&(_[":@"]=this.buildAttributesMap(u,o,a)),this.addChild(t,_,o,L),o=o.substr(0,o.lastIndexOf("."))}else{const _=new H(a);this.tagsNodeStack.push(t),a!==u&&g&&(_[":@"]=this.buildAttributesMap(u,o,a)),this.addChild(t,_,o,L),t=_}s="",i=I}}else s+=n[i];return e.child};function Co(n,e,t,s){this.options.captureMetaData||(s=void 0);const o=this.options.updateTag(e.tagname,t,e[":@"]);o===!1||(typeof o=="string"&&(e.tagname=o),n.addChild(e,s))}const mo=function(n){if(this.options.processEntities){for(let e in this.docTypeEntities){const t=this.docTypeEntities[e];n=n.replace(t.regx,t.val)}for(let e in this.lastEntities){const t=this.lastEntities[e];n=n.replace(t.regex,t.val)}if(this.options.htmlEntities)for(let e in this.htmlEntities){const t=this.htmlEntities[e];n=n.replace(t.regex,t.val)}n=n.replace(this.ampEntity.regex,this.ampEntity.val)}return n};function Ao(n,e,t,s){return n&&(s===void 0&&(s=e.child.length===0),n=this.parseTextData(n,e.tagname,t,!1,e[":@"]?Object.keys(e[":@"]).length!==0:!1,s),n!==void 0&&n!==""&&e.add(this.options.textNodeName,n),n=""),n}function vo(n,e,t){const s="*."+t;for(const o in n){const i=n[o];if(s===i||e===i)return!0}return!1}function Oo(n,e,t=">"){let s,o="";for(let i=e;i",t,`${e} is not closed`);if(n.substring(t+2,i).trim()===e&&(o--,o===0))return{tagContent:n.substring(s,t),i};t=i}else if(n[t+1]==="?")t=z(n,"?>",t+1,"StopNode is not closed.");else if(n.substr(t+1,3)==="!--")t=z(n,"-->",t+3,"StopNode is not closed.");else if(n.substr(t+1,2)==="![")t=z(n,"]]>",t,"StopNode is not closed.")-2;else{const i=Re(n,t,">");i&&((i&&i.tagName)===e&&i.tagExp[i.tagExp.length-1]!=="/"&&o++,t=i.closeIndex)}}function be(n,e,t){if(e&&typeof n=="string"){const s=n.trim();return s==="true"?!0:s==="false"?!1:ro(n,t)}else return Gs(n)?n:""}const Ie=H.getMetaDataSymbol();function No(n,e){return Ot(n,e)}function Ot(n,e,t){let s;const o={};for(let i=0;i0&&(o[e.textNodeName]=s):s!==void 0&&(o[e.textNodeName]=s),o}function _o(n){const e=Object.keys(n);for(let t=0;t"},{regex:/&(lt|#60|#x3c|#x3C);/g,val:"<"},{regex:/&(quot|#34|#x22);/g,val:'"'}],Fo=new Set(["BPMNShape.Bounds","BPMNShape.BPMNLabel.Bounds","BPMNEdge.BPMNLabel.Bounds","BPMNEdge.waypoint"].map(n=>`definitions.BPMNDiagram.BPMNPlane.${n}`)),Po=new Set(["x","y","width","height"]),ko=(n,e)=>Fo.has(e)&&Po.has(n);class Mo{constructor(e){f(this,"x2jOptions",{attributeNamePrefix:"",removeNSPrefix:!0,ignoreAttributes:!1,parseAttributeValue:!0,processEntities:!1,attributeValueProcessor:(e,t,s)=>ko(e,s)?Number(t):this.processAttribute(t)});f(this,"xmlParser",new Ro(this.x2jOptions));this.options=e}parse(e){let t;try{t=this.xmlParser.parse(e)}catch{throw new Error("XML parsing failed. Invalid BPMN source.")}if(!t.definitions)throw new Error("XML parsing failed. Unable to retrieve 'definitions' from the BPMN source.");return t}processAttribute(e){var t;for(const s of bo)e=e.replace(s.regex,s.val);return(t=this.options)!=null&&t.additionalXmlAttributeProcessor&&(e=this.options.additionalXmlAttributeProcessor(e)),e}}class Bo{constructor(e,t){this.jsonParser=e,this.xmlParser=t}parse(e){const t=this.xmlParser.parse(e);return this.jsonParser.parse(t)}}function xo(n){return new Bo(Bs(new us(n)),new Mo(n))}function Yo(n){return new Vo(n)}class Vo{constructor(e){this.graph=e}updateAndRefreshCssClassesOfCell(e,t){this.updateAndRefreshCssClassesOfElement(e,t),this.updateAndRefreshCssClassesOfElement(Me(e),t)}updateAndRefreshCssClassesOfElement(e,t){const s=this.graph.getModel(),o=s.getCell(e);if(!o)return;let i=o.getStyle();i=b(i,S.EXTRA_CSS_CLASSES,t.join(",")),s.setStyle(o,i)}}function Go(n){return new Do(Yo(n),new Uo)}class Do{constructor(e,t){this.cssClassesUpdater=e,this.cssClassesCache=t}clearCache(){this.cssClassesCache.clear()}addCssClasses(e,t){this.updateCssClasses(e,t,this.cssClassesCache.addClassNames)}removeCssClasses(e,t){this.updateCssClasses(e,t,this.cssClassesCache.removeClassNames)}removeAllCssClasses(e){if(e||e=="")for(const t of E(e)){const s=this.cssClassesCache.removeAllClassNames(t);this.updateCellIfChanged(s,t)}else{const t=this.cssClassesCache.getBpmnIds();this.cssClassesCache.clear();for(const s of t)this.updateCellIfChanged(!0,s)}}toggleCssClasses(e,t){this.updateCssClasses(e,t,this.cssClassesCache.toggleClassNames)}updateCssClasses(e,t,s){const o=E(t);for(const i of E(e))this.updateCellIfChanged(s(i,o),i)}updateCellIfChanged(e,t){if(e){const s=this.cssClassesCache.getClassNames(t);this.cssClassesUpdater.updateAndRefreshCssClassesOfCell(t,s)}}}class Uo{constructor(){f(this,"classNamesByBpmnId",new Map);f(this,"clear",()=>{this.classNamesByBpmnId.clear()});f(this,"addClassNames",(e,t)=>this.updateClassNames(e,t,(s,o)=>s.add(o)));f(this,"removeClassNames",(e,t)=>this.updateClassNames(e,t,(s,o)=>s.delete(o)));f(this,"toggleClassNames",(e,t)=>(this.updateClassNames(e,t,(s,o)=>s.has(o)?s.delete(o):s.add(o)),t&&t.length>0))}getClassNames(e){return this.classNamesByBpmnId.has(e)?[...this.classNamesByBpmnId.get(e)]:[]}getBpmnIds(){return[...this.classNamesByBpmnId.keys()]}removeAllClassNames(e){const t=this.getOrInitializeClassNames(e),s=t.size;return t.clear(),t.sizeWo.get(n.position),Ko=(n,e)=>{e&&(n.fill.color=e.color??n.fill.color,n.fill.opacity=e.opacity??n.fill.opacity)},zo=(n,e)=>{e&&(n.stroke.color=e.color??n.stroke.color,n.stroke.width=e.width??n.stroke.width)},Xo=(n,e)=>{e&&(n.font.color=e.color??n.font.color,n.font.size=e.size??n.font.size)},$o=n=>{const e={fill:{color:T.DEFAULT_OVERLAY_FILL_COLOR.valueOf(),opacity:T.DEFAULT_OVERLAY_FILL_OPACITY.valueOf()},stroke:{color:T.DEFAULT_OVERLAY_STROKE_COLOR.valueOf(),width:T.DEFAULT_OVERLAY_STROKE_WIDTH.valueOf()},font:{color:T.DEFAULT_OVERLAY_FONT_COLOR.valueOf(),size:T.DEFAULT_OVERLAY_FONT_SIZE.valueOf()}},t=n.style,s={...e};return t&&(Ko(s,t.fill),zo(s,t.stroke),Xo(s,t.font)),s};class Zo{convert(e){const t=Ho(e),s=$o(e);return{position:t,style:s}}}function jo(n){return new qo(n,new Zo)}class qo{constructor(e,t){this.graph=e,this.overlayConverter=t}addOverlays(e,t){const s=this.graph.getModel().getCell(e);if(s)for(const o of E(t)){const i=new Tt(o.label,this.overlayConverter.convert(o));this.graph.addCellOverlay(s,i)}}removeAllOverlays(e){const t=this.graph.getModel().getCell(e);t&&this.graph.removeCellOverlays(t)}}function Qo(n){return new Jo(jo(n))}class Jo{constructor(e){this.overlaysUpdater=e}addOverlays(e,t){this.overlaysUpdater.addOverlays(e,t)}removeAllOverlays(e){this.overlaysUpdater.removeAllOverlays(e)}}class ei{element(e){return`svg > g > g > g[data-bpmn-id="${e}"]`}elementsOfKind(e){return`svg > g > g > g.${e}:not(.bpmn-label)`}}function ti(n){return new ni(n,new si(n.getModel()))}const ot=n=>{const e=E(n);return e.push(...e.map(t=>Me(t))),e};class ni{constructor(e,t){this.graph=e,this.styleManager=t}clear(){this.styleManager.clear()}updateStyle(e,t){if(!t)return;const s=this.graph.getModel(),o=ot(e).map(i=>s.getCell(i)).filter(Boolean);o.length!==0&&this.graph.batchUpdate(()=>{for(const i of o){this.styleManager.ensureStyleIsStored(i);let r=i.getStyle();r=b(r,c.STYLE_OPACITY,t.opacity,Ee),r=Qt(r,t.stroke),r=Jt(r,t.font),sn(t)&&(r=nn(r,t.fill)),s.setStyle(i,r)}})}resetStyle(e){this.graph.batchUpdate(()=>{if(e||e=="")for(const t of ot(e))this.styleManager.resetStyleIfIsStored(t);else this.styleManager.resetAllStyles()})}}const it=S.EXTRA_CSS_CLASSES;class si{constructor(e){f(this,"stylesCache",new Map);this.model=e}clear(){this.stylesCache.clear()}resetAllStyles(){for(const e of this.stylesCache.keys())this.resetStyle(e,this.stylesCache.get(e))}resetStyleIfIsStored(e){const t=this.stylesCache.get(e);t&&this.resetStyle(e,t)}resetStyle(e,t){const s=this.model.getCell(e),o=en(s.getStyle(),it,""),i=b(t,it,o);this.model.setStyle(s,i),this.stylesCache.delete(e)}ensureStyleIsStored(e){const t=e.getId();this.stylesCache.has(t)||this.stylesCache.set(t,e.getStyle())}}function oi(n){return new ii(ti(n))}class ii{constructor(e){this.styleUpdater=e}clearCache(){this.styleUpdater.clear()}updateStyle(e,t){this.styleUpdater.updateStyle(e,t)}resetStyle(e){this.styleUpdater.resetStyle(e)}}function ri(n,e){return new li(n,new ai(e.container,new ei),Go(e),Qo(e),oi(e))}class li{constructor(e,t,s,o,i){this.bpmnModelRegistry=e,this.htmlElementRegistry=t,this.cssClassesRegistry=s,this.overlaysRegistry=o,this.styleRegistry=i,this.bpmnModelRegistry.registerOnLoadCallback(()=>{this.cssClassesRegistry.clearCache(),this.styleRegistry.clearCache()})}getModelElementsByIds(e){return Ce(e).map(t=>this.bpmnModelRegistry.getBpmnSemantic(t)).filter(Boolean)}getElementsByIds(e){return this.getModelElementsByIds(e).map(t=>({bpmnSemantic:t,htmlElement:this.htmlElementRegistry.getBpmnHtmlElement(t.id)}))}getModelElementsByKinds(e){return Ce(e).flatMap(t=>this.htmlElementRegistry.getBpmnHtmlElements(t)).map(t=>this.getRelatedBpmnSemantic(t))}getElementsByKinds(e){return Ce(e).flatMap(t=>this.htmlElementRegistry.getBpmnHtmlElements(t)).map(t=>({htmlElement:t,bpmnSemantic:this.getRelatedBpmnSemantic(t)}))}getRelatedBpmnSemantic(e){return this.bpmnModelRegistry.getBpmnSemantic(e.dataset.bpmnId)}addCssClasses(e,t){this.cssClassesRegistry.addCssClasses(e,t)}removeCssClasses(e,t){this.cssClassesRegistry.removeCssClasses(e,t)}removeAllCssClasses(e){this.cssClassesRegistry.removeAllCssClasses(e)}toggleCssClasses(e,t){this.cssClassesRegistry.toggleCssClasses(e,t)}addOverlays(e,t){this.overlaysRegistry.addOverlays(e,t)}removeAllOverlays(e){this.overlaysRegistry.removeAllOverlays(e)}updateStyle(e,t){this.styleRegistry.updateStyle(e,t)}resetStyle(e){this.styleRegistry.resetStyle(e)}}class ai{constructor(e,t){this.container=e,this.querySelectors=t}getBpmnHtmlElement(e){return this.container.querySelector(this.querySelectors.element(e))}getBpmnHtmlElements(e){const t=this.querySelectors.elementsOfKind(Ne(e));return[...this.container.querySelectorAll(t)]}}const Ce=n=>[...new Set(E(n))];class ci{filter(e,t){const s=[],o=[];for(const C of E(t==null?void 0:t.pools).filter(L=>L&&Object.keys(L).length>0))C.id?s.push(C.id):C.name&&o.push(C.name);if(s.length===0&&o.length===0)return e;const{filteredPools:i,filteredPoolIds:r}=ui(e,s,o),l=[...s,...r],{filteredLanes:a,filteredLaneIds:d,filteredFlowNodes:u,filteredFlowNodeIds:g}=Lt(e.lanes,e.flowNodes,l),I=hi(e.edges,[...l,...d,...g]);if(i.length===0&&a.length===0&&u.length===0&&I.length===0){let C=s.length>0?` for ids [${s}]`:"";const L=C?" and":"";throw C+=o.length>0?`${L} for names [${o}]`:"",new Error("No matching pools"+C)}return{lanes:a,flowNodes:u,pools:i,edges:I}}}function ui(n,e,t){const s=n.pools.filter(i=>e.includes(i.bpmnElement.id)||t.includes(i.bpmnElement.name)),o=s.map(i=>i.bpmnElement.id);return{filteredPools:s,filteredPoolIds:o}}function Lt(n,e,t){const{filteredLanes:s,filteredLaneIds:o}=Nt(n,t),{filteredLanes:i,filteredLaneIds:r,filteredFlowNodes:l,filteredFlowNodeIds:a}=di(e,[...t,...o],n);return s.push(...i),o.push(...r),{filteredLanes:s,filteredLaneIds:o,filteredFlowNodes:l,filteredFlowNodeIds:a}}function Nt(n,e){const t=n.filter(o=>e.includes(o.bpmnElement.parentId)),s=t.map(o=>o.bpmnElement.id);if(t.length>0){const{filteredLanes:o,filteredLaneIds:i}=Nt(n,s);t.push(...o),s.push(...i)}return{filteredLanes:t,filteredLaneIds:s}}function di(n,e,t){const s=n.filter(d=>e.includes(d.bpmnElement.parentId));if(s.length===0)return{filteredLanes:[],filteredLaneIds:[],filteredFlowNodes:[],filteredFlowNodeIds:[]};const o=s.map(d=>d.bpmnElement.id),{filteredLanes:i,filteredLaneIds:r,filteredFlowNodes:l,filteredFlowNodeIds:a}=Lt(t,n,o);return s.push(...l),o.push(...a),{filteredLanes:i,filteredLaneIds:r,filteredFlowNodes:s,filteredFlowNodeIds:o}}function hi(n,e){return n.filter(t=>e.includes(t.bpmnElement.sourceReferenceId)&&e.includes(t.bpmnElement.targetReferenceId))}class fi{constructor(){f(this,"searchableModel");f(this,"onLoadCallback")}load(e,t){var o;const s=new ci().filter(e,t);return this.searchableModel=new Ti(s),(o=this.onLoadCallback)==null||o.call(this),gi(s)}registerOnLoadCallback(e){this.onLoadCallback=e}getBpmnSemantic(e){var i;const t=(i=this.searchableModel)==null?void 0:i.elementById(e);if(!t)return;const s=t.bpmnElement,o=s instanceof B;return{id:e,isShape:o,kind:s.kind,name:s.name,...s instanceof Te?{sourceRefId:s.sourceReferenceId,targetRefId:s.targetReferenceId}:{callActivityGlobalTaskKind:s instanceof X?s.globalTaskKind:void 0,callActivityKind:s instanceof X?s.callActivityKind:void 0,eventDefinitionKind:s instanceof U?s.eventDefinitionKind:void 0,linkEventSourceIds:s instanceof Oe&&s.eventDefinitionKind==w.LINK?s.sourceIds:void 0,linkEventTargetId:s instanceof Le?s.targetId:void 0,incomingIds:s.incomingIds,outgoingIds:s.outgoingIds,parentId:s.parentId,subProcessKind:s instanceof ie?s.subProcessKind:void 0}}}}function gi(n){const e=new Set(n.flowNodes.filter(i=>{const r=i.bpmnElement;return p.isSubProcess(r.kind)&&r.markers.includes(y.EXPAND)}).map(i=>i.bpmnElement.id)),t=[],s=[],o=[];for(const i of n.flowNodes){const r=i.bpmnElement.kind;p.isSubProcess(r)?t.push(i):p.isBoundaryEvent(r)?s.push(i):e.has(i.bpmnElement.parentId)||o.push(i)}return{boundaryEvents:s,edges:n.edges,lanes:n.lanes,otherFlowNodes:o,pools:n.pools,subprocesses:t}}class Ti{constructor(e){f(this,"elements",new Map);for(const t of[...e.pools,...e.lanes,...e.flowNodes,...e.edges])this.elements.set(t.bpmnElement.id,t)}elementById(e){return this.elements.get(e)}}class pi{constructor(e){f(this,"graph");f(this,"navigation");f(this,"bpmnElementsRegistry");f(this,"bpmnModelRegistry");f(this,"parserOptions");f(this,"rendererOptions");this.rendererOptions=e==null?void 0:e.renderer;const t=new ss(Vt(e==null?void 0:e.container));this.graph=t.configure(),this.navigation=rs(this.graph,e==null?void 0:e.navigation),this.bpmnModelRegistry=new fi,this.bpmnElementsRegistry=ri(this.bpmnModelRegistry,this.graph),this.parserOptions=e==null?void 0:e.parser}load(e,t){const s=xo(this.parserOptions).parse(e),o=this.bpmnModelRegistry.load(s,t==null?void 0:t.modelFilter);fn(this.graph,this.rendererOptions).render(o),this.navigation.fit(t==null?void 0:t.fit)}}function xi(n){document.readyState==="complete"||document.readyState==="interactive"?setTimeout(n,1):document.addEventListener("DOMContentLoaded",n)}function m(n,...e){De("[DEMO]",n,...e)}function De(n,e,...t){console.info(`${n} ${e}`,...t)}function F(n,...e){De("[DEMO STARTUP]",n,...e)}function _t(n,e){yt(n),window.alert(n)}function yt(n){console.error("[DEMO]",n)}function Z(n,...e){De("[DEMO DOWNLOAD]",n,...e)}async function Ei(n){m(`Fetching BPMN content from url ${n}`);const e=await fetch(n);if(!e.ok)throw new Error(`HTTP status ${e.status}`);return await e.text()}function wt(n,e,t){const s=document.createElement("a");e.startsWith("data:image/svg+xml")&&(t=encodeURIComponent(t),e+=","),s.setAttribute("href",e+t),s.setAttribute("download",n),s.style.display="none",document.body.append(s),s.click(),s.remove()}function Si(n){Z("Start SVG download"),wt("diagram.svg","data:image/svg+xml",n),Z("Download completed")}function Ii(n){Z("Start PNG download");const e=new Blob([n],{type:"image/svg+xml;charset=utf-8"}),t=URL.createObjectURL(e),s=document.createElement("img");s.setAttribute("style","position: absolute; top: -9999px"),s.crossOrigin="anonymous",document.body.append(s);const o=document.createElement("canvas"),i=o.getContext("2d");s.addEventListener("load",function(){const r=new Image;o.width=s.naturalWidth,o.height=s.naturalHeight,r.crossOrigin="Anonymous",r.addEventListener("load",function(){i.drawImage(r,0,0),URL.revokeObjectURL(t);const l=o.toDataURL("image/png");s.remove(),wt("diagram.png","",l),Z("Download completed")}),r.src=s.src}),s.src=t}class Ci{constructor(e,t,s,o){f(this,"document");f(this,"head");this.window=e,this.outerContainerId=t,this.containerToFade=s,this.dropCallback=o,this.document=e.document,this.head=document.head,this.initializeDragAndDrop()}initializeDragAndDrop(){this.containerToFade.classList.add("faded-container"),this.addDomElements(this.containerToFade),this.addStyle();const e=document.querySelector(`#${this.outerContainerId}`);this.preventDefaultsOnEvents(["dragover","drop"],this.window),this.preventDefaultsOnEvents(["dragover","dragleave","drop"],e),this.addEventsOnDropContainer(e,this.containerToFade),this.addEventsOnDocument(this.outerContainerId,this.containerToFade)}preventDefaults(e){e.preventDefault(),e.stopPropagation()}preventDefaultsOnEvents(e,t){for(const s of e)t.addEventListener(s,this.preventDefaults.bind(this),!1)}addDomElements(e){const t=this.document.createElement("p");t.textContent="open BPMN diagram";const s=this.document.createElement("div");s.classList.add("drop-here-text"),s.append(t);const o=this.document.createElement("div");o.id=this.outerContainerId,o.append(s),e.parentNode.prepend(o)}addStyle(){const e=` +import{I as U,m as _,b as E,c as w,d as $,e as q,B as V,f as K,S as L,a as S,h as z,j as A}from"./lib-bpmn-visualization.js";(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))n(r);new MutationObserver(r=>{for(const l of r)if(l.type==="childList")for(const i of l.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&n(i)}).observe(document,{childList:!0,subtree:!0});function t(r){const l={};return r.integrity&&(l.integrity=r.integrity),r.referrerPolicy&&(l.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?l.credentials="include":r.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function n(r){if(r.ep)return;r.ep=!0;const l=t(r);fetch(r.href,l)}})();class G extends U{paintPersonIcon(e){const t=this.newBpmnCanvas(e,{height:13,width:12});t.setFillColor(e.iconStyleConfig.strokeColor),t.begin(),t.moveTo(12,13),t.arcTo(1,1,0,0,1,11,14),t.lineTo(1,14),t.arcTo(1,1,0,0,1,0,13),t.lineTo(0,12),t.curveTo(0,9.37,4,8,4,8),t.curveTo(4,8,4.23,8,4,8),t.curveTo(3.16,6.38,3.06,5.41,3,3),t.curveTo(3.17,.59,4.87,0,6,0),t.curveTo(7.13,0,8.83,.59,9,3),t.curveTo(8.94,5.41,8.84,6.38,8,8),t.curveTo(8,8,12,9.37,12,12),t.lineTo(12,13),t.close(),t.fill()}}function fe(o){document.readyState==="complete"||document.readyState==="interactive"?setTimeout(o,1):document.addEventListener("DOMContentLoaded",o)}function s(o,...e){k("[DEMO]",o,...e)}function k(o,e,...t){console.info(`${o} ${e}`,...t)}function f(o,...e){k("[DEMO STARTUP]",o,...e)}function P(o,e){D(o),window.alert(o)}function D(o){console.error("[DEMO]",o)}function b(o,...e){k("[DEMO DOWNLOAD]",o,...e)}async function j(o){s(`Fetching BPMN content from url ${o}`);const e=await fetch(o);if(!e.ok)throw new Error(`HTTP status ${e.status}`);return await e.text()}function N(o,e,t){const n=document.createElement("a");e.startsWith("data:image/svg+xml")&&(t=encodeURIComponent(t),e+=","),n.setAttribute("href",e+t),n.setAttribute("download",o),n.style.display="none",document.body.append(n),n.click(),n.remove()}function W(o){b("Start SVG download"),N("diagram.svg","data:image/svg+xml",o),b("Download completed")}function X(o){b("Start PNG download");const e=new Blob([o],{type:"image/svg+xml;charset=utf-8"}),t=URL.createObjectURL(e),n=document.createElement("img");n.setAttribute("style","position: absolute; top: -9999px"),n.crossOrigin="anonymous",document.body.append(n);const r=document.createElement("canvas"),l=r.getContext("2d");n.addEventListener("load",function(){const i=new Image;r.width=n.naturalWidth,r.height=n.naturalHeight,i.crossOrigin="Anonymous",i.addEventListener("load",function(){l.drawImage(i,0,0),URL.revokeObjectURL(t);const d=r.toDataURL("image/png");n.remove(),N("diagram.png","",d),b("Download completed")}),i.src=n.src}),n.src=t}class Y{constructor(e,t,n,r){this.window=e,this.outerContainerId=t,this.containerToFade=n,this.dropCallback=r,this.document=e.document,this.head=document.head,this.initializeDragAndDrop()}window;outerContainerId;containerToFade;dropCallback;document;head;initializeDragAndDrop(){this.containerToFade.classList.add("faded-container"),this.addDomElements(this.containerToFade),this.addStyle();const e=document.querySelector(`#${this.outerContainerId}`);this.preventDefaultsOnEvents(["dragover","drop"],this.window),this.preventDefaultsOnEvents(["dragover","dragleave","drop"],e),this.addEventsOnDropContainer(e,this.containerToFade),this.addEventsOnDocument(this.outerContainerId,this.containerToFade)}preventDefaults(e){e.preventDefault(),e.stopPropagation()}preventDefaultsOnEvents(e,t){for(const n of e)t.addEventListener(n,this.preventDefaults.bind(this),!1)}addDomElements(e){const t=this.document.createElement("p");t.textContent="open BPMN diagram";const n=this.document.createElement("div");n.classList.add("drop-here-text"),n.append(t);const r=this.document.createElement("div");r.id=this.outerContainerId,r.append(n),e.parentNode.prepend(r)}addStyle(){const e=` .faded-container { opacity: 1; } @@ -44,7 +40,7 @@ var kt=Object.defineProperty;var Mt=(n,e,t)=>e in n?kt(n,e,{enumerable:!0,config align-items: center; border: 2px dashed rgba(0,0,0,.2); border-radius: 7px; -}`,t=document.createElement("style");t.append(document.createTextNode(e)),this.head.append(t)}addEventsOnDropContainer(e,t){e.addEventListener("dragover",this.getAddClassCallback(t,!1),!1),e.addEventListener("mousedown",this.getRemoveClassCallback(t,!1),!1),e.addEventListener("drop",this.getDropCallbackForElement(t,!1,this.dropCallback),!1)}addEventsOnDocument(e,t){this.document.addEventListener("dragover",this.getAddClassCallback(t,!0,e),!1),this.document.addEventListener("dragleave",this.getRemoveClassCallback(t,!0,e),!1),this.document.addEventListener("drop",this.getDropCallbackForElement(t,!0,this.dropCallback,e),!1)}getAddClassCallback(e,t,s){return function(){t?this.querySelector("#"+s).classList.add("dragging"):this.classList.add("dragging"),e.classList.add("faded")}}getRemoveClassCallback(e,t,s){return function(){t?this.querySelector("#"+s).classList.remove("dragging"):this.classList.remove("dragging"),e.classList.remove("faded")}}getDropCallbackForElement(e,t,s,o){return function(i){try{const l=i.dataTransfer.files;s(l[0])}catch(r){const l=r instanceof Error?r.message:String(r);_t(l)}finally{t?this.querySelector("#"+o).classList.remove("dragging"):this.classList.remove("dragging"),e.classList.remove("faded")}}}}class Rt{constructor(e){this.graph=e}exportSvg(){return this.doSvgExport(!0)}exportSvgForPng(){const e=zt.IS_FF;return this.doSvgExport(e)}doSvgExport(e){const t=this.computeSvg({scale:1,border:25,enableForeignObjectForLabel:e});return` +}`,t=document.createElement("style");t.append(document.createTextNode(e)),this.head.append(t)}addEventsOnDropContainer(e,t){e.addEventListener("dragover",this.getAddClassCallback(t,!1),!1),e.addEventListener("mousedown",this.getRemoveClassCallback(t,!1),!1),e.addEventListener("drop",this.getDropCallbackForElement(t,!1,this.dropCallback),!1)}addEventsOnDocument(e,t){this.document.addEventListener("dragover",this.getAddClassCallback(t,!0,e),!1),this.document.addEventListener("dragleave",this.getRemoveClassCallback(t,!0,e),!1),this.document.addEventListener("drop",this.getDropCallbackForElement(t,!0,this.dropCallback,e),!1)}getAddClassCallback(e,t,n){return function(){t?this.querySelector("#"+n).classList.add("dragging"):this.classList.add("dragging"),e.classList.add("faded")}}getRemoveClassCallback(e,t,n){return function(){t?this.querySelector("#"+n).classList.remove("dragging"):this.classList.remove("dragging"),e.classList.remove("faded")}}getDropCallbackForElement(e,t,n,r){return function(l){try{const d=l.dataTransfer.files;n(d[0])}catch(i){const d=i instanceof Error?i.message:String(i);P(d)}finally{t?this.querySelector("#"+r).classList.remove("dragging"):this.classList.remove("dragging"),e.classList.remove("faded")}}}}class I{constructor(e){this.graph=e}graph;exportSvg(){return this.doSvgExport(!0)}exportSvgForPng(){const e=_.IS_FF;return this.doSvgExport(e)}doSvgExport(e){const t=this.computeSvg({scale:1,border:25,enableForeignObjectForLabel:e});return` -${A.getXml(t)} -`}computeSvg(e){const t=e.scale??1,s=e.border??0,o=e.crisp??!0,i=e.enableForeignObjectForLabel??!0,r=this.graph.getGraphBounds(),l=this.graph.view.scale,a=A.createXmlDocument(),d=a.createElementNS(c.NS_SVG,"svg"),u=t/l,g=Math.max(1,Math.ceil(r.width*u)+2*s),I=Math.max(1,Math.ceil(r.height*u)+2*s);d.setAttribute("version","1.1"),d.setAttribute("width",g+"px"),d.setAttribute("height",I+"px"),d.setAttribute("viewBox",(o?"-0.5 -0.5":"0 0")+" "+g+" "+I),a.append(d);const C=a.createElementNS(c.NS_SVG,"g");d.append(C);const L=this.createSvgCanvas(C);L.foEnabled=i,L.foOffset=o?-.5:0,L.textOffset=o?-.5:0,L.imageOffset=o?-.5:0,L.translate(Math.floor((s/t-r.x)/l),Math.floor((s/t-r.y)/l)),L.scale(u);const _=new O.mxImageExport;return _.includeOverlays=!0,_.drawState(this.graph.getView().getState(this.graph.model.root),L),a}createSvgCanvas(e){const t=new mi(e);return t.pointerEvents=!0,t}}class mi extends ke{constructor(t){super(t);f(this,"htmlConverter",document.createElement("div"))}getAlternateText(t,s,o,i,r,l,a,d,u,g,I,C,L){return this.computeTruncatedText(l,i)}plainText(t,s,o,i,r,l,a,d,u,g,I,C){r=this.computeTruncatedText(r,o),super.plainText(t,s,o,i,r,l,a,d,u,g,I,C)}computeTruncatedText(t,s){if(t==null||this.state.fontSize<=0)return"";try{this.htmlConverter.innerHTML=t,t=A.extractTextWithWhitespace(this.htmlConverter.childNodes);const o=Math.ceil(2*s/this.state.fontSize),i=[];let r=0,l=0;for(;(o==0||r0)break}else i.push(t.charAt(l)),a<255&&r++;l++}i.length1&&(t=A.trim(i.join(""))+"...")}catch(o){console.warn("Error while computing txt label",o)}return t}}const Ai=new Map([["dark",{defaultFillColor:"#334352",defaultFontColor:"white",defaultStrokeColor:"#c0ddeb",endEventFillColor:"pink",endEventStrokeColor:"FireBrick",startEventFillColor:"DarkSeaGreen",startEventStrokeColor:"DarkGreen",taskAndCallActivityFillColor:"#5c8599",laneFillColor:"#2b3742",poolFillColor:"#232b33"}],["brown",{defaultFillColor:"#ede7e1",defaultFontColor:"#414666",defaultStrokeColor:"#414666",flowColor:"#666666",catchAndThrowEventStrokeColor:"#377f87",endEventFillColor:"pink",endEventStrokeColor:"FireBrick",startEventFillColor:"DarkSeaGreen",startEventStrokeColor:"DarkGreen",taskAndCallActivityFillColor:"#dadce8",laneFillColor:"#d4c3b2",poolFillColor:"#d1b9a1"}],["light-blue",{defaultFillColor:"#ffffff",defaultFontColor:"#002395",defaultStrokeColor:"#002395",endEventFillColor:"#f9dadc",endEventStrokeColor:"#e20613",startEventFillColor:"#ffffff",startEventStrokeColor:"#05d99e",taskAndCallActivityFillColor:"rgba(132,158,253,0.1)",textAnnotationFillColor:"rgba(237,237,245,0.5)",laneFillColor:"#edeef5",poolFillColor:"#dbefff"}]]);class vi extends pi{configureTheme(e){if(e=="default")return new St(this.graph).configureStyles(),!0;const t=Ai.get(e);if(!t)return!1;const s=this.graph.getStylesheet();for(const u of p.eventKinds()){let g,I;switch(u){case"endEvent":{g=t.endEventFillColor,I=t.endEventStrokeColor;break}case"startEvent":{g=t.startEventFillColor,I=t.startEventStrokeColor;break}case"intermediateCatchEvent":case"intermediateThrowEvent":case"boundaryEvent":{g=t.defaultFillColor,I=t.catchAndThrowEventStrokeColor??t.defaultStrokeColor;break}default:{g=t.defaultFillColor,I=t.defaultStrokeColor;break}}const C=s.styles[u];C.fillColor=g,C.strokeColor=I}for(const u of p.taskKinds()){const g=s.styles[u];g.fillColor=t.taskAndCallActivityFillColor}const o=s.styles[h.CALL_ACTIVITY];o.fillColor=t.taskAndCallActivityFillColor;const i=s.styles[h.TEXT_ANNOTATION];i.fillColor=t.textAnnotationFillColor??T.TEXT_ANNOTATION_FILL_COLOR;const r=s.styles[h.POOL];r.fillColor=t.poolFillColor,r.swimlaneFillColor=t.defaultFillColor;const l=s.styles[h.LANE];l.fillColor=t.laneFillColor;const a=s.getDefaultVertexStyle();a.fontColor=t.defaultFontColor,a.fillColor=t.defaultFillColor,a.strokeColor=t.defaultStrokeColor;const d=s.getDefaultEdgeStyle();return d.fontColor=t.defaultFontColor,d.fillColor=t.defaultFillColor,d.strokeColor=t.flowColor??t.defaultStrokeColor,!0}configureSequenceFlowColor(e){F(`Use dedicated ${e} color for sequence flows`);const s=this.graph.getStylesheet().styles[k.SEQUENCE_FLOW];s[c.STYLE_STROKECOLOR]=e,s[c.STYLE_FILLCOLOR]=e,F("Sequence flows style updated")}}let v,D={},Ue,We,ge,M;function Yi(n){m("Updating load options"),D.fit=n,m("Load options updated",D)}function Vi(){return{...D}}function Gi(){return ge}function Di(n){m("Switching theme from %s to %s",ge,n),v.configureTheme(n)?(v.graph.refresh(),m("Theme switch done"),ge=n):m("Unknown theme, do nothing")}function bt(n,e=!0){m("Loading bpmn...");try{v.load(n,D),m("BPMN loaded with configuration",D),Li(We),document.dispatchEvent(new CustomEvent("diagramLoaded"))}catch(t){if(e)Ue(`Cannot load the BPMN diagram: ${t instanceof Error?t.message:String(t)}`);else throw t}}function Ui(n){m("Fitting..."),v.navigation.fit(n),m("Fit done with configuration",n)}function Wi(n){m(`Zooming '${n}'...`),v.navigation.zoom(n),m("Zoom done")}function Hi(n){return v.bpmnElementsRegistry.getModelElementsByKinds(n)}function Oi(n){return v.bpmnElementsRegistry.getModelElementsByIds(n)}function Ft(n){const e=v.graph.model,t=e.getCell(n);return e.getParent(t)}function Ki(n){return n.map(e=>Ft(e).getId()).filter((e,t,s)=>s.indexOf(e)===t)}function zi(n){var s;const e=Ft(n),t=Oi(e.getId());return t&&((s=t[0])==null?void 0:s.kind)===h.SUB_PROCESS}function Xi(n,e){return v.bpmnElementsRegistry.addCssClasses(n,e)}function $i(n,e){return v.bpmnElementsRegistry.removeCssClasses(n,e)}function Zi(n,e){return v.bpmnElementsRegistry.addOverlays(n,[e])}function ji(n){return v.bpmnElementsRegistry.removeAllOverlays(n)}function Li(n){if(!We)return;m("Updating model, bpmnElement to collapse:",n);const e=v.graph.getModel(),t=e.getCell(n);if(t){e.beginUpdate();try{e.setCollapsed(t,!0)}finally{e.endUpdate()}m("Model updated")}else m("Element not found in the model, do nothing")}function Pt(n){n.text().then(e=>{bt(e)}).catch(e=>{throw e})}function qi(n){const e=n.target.files;if(e&&e.length>0){const t=e[0];Pt(t)}}function Ni(n){Ei(n).catch(e=>{throw new Error(`Unable to fetch ${n}. ${e}`)}).then(e=>(m("BPMN content fetched"),e)).then(e=>{bt(e,!1),m(`BPMN content loaded from url ${n}`)}).then(()=>{Pi()}).catch(e=>{Ue(e.message)})}function Qi(n){_t(n)}function _i(n){yt(n)}function yi(n,e){var i;const t=((i=n.loadOptions)==null?void 0:i.fit)??{},s=e.get("fitTypeOnLoad");s&&(t.type=s);const o=e.get("fitMargin");return o&&(t.margin=Number(o)),t}function wi(n){if(n.get("style.container.alternative.background.color")=="true"){const i="yellow";F("Use alternative color for the bpmn container background, color",i);const r=v.graph.container;r.style.backgroundColor=i,F("Bpmn container style updated")}const t=n.get("style.theme");F(`Configuring the '${t}' BPMN theme`),v.configureTheme(t)?(ge=t,F(`'${t}' BPMN theme configured`)):F(`Unknown '${t}' BPMN theme, skipping configuration`),n.get("style.seqFlow.light.colors")=="true"&&v.configureSequenceFlowColor("#E9E9E9"),F('Configuring the "Update Style" API from query parameters'),[...n.keys()].some(i=>i.startsWith("style.api."))?(M={stroke:{},font:{},fill:{}},n.get("style.api.stroke.color")&&(M.stroke.color=n.get("style.api.stroke.color")),n.get("style.api.font.color")&&(M.font.color=n.get("style.api.font.color")),n.get("style.api.font.opacity")&&(M.font.opacity=Number(n.get("style.api.font.opacity"))),n.get("style.api.fill.color")?M.fill.color=n.get("style.api.fill.color"):n.get("style.api.fill.color.startColor")&&n.get("style.api.fill.color.endColor")&&n.get("style.api.fill.color.direction")&&(M.fill.color={startColor:n.get("style.api.fill.color.startColor"),endColor:n.get("style.api.fill.color.endColor"),direction:n.get("style.api.fill.color.direction")}),n.get("style.api.fill.opacity")&&(M.fill.opacity=Number(n.get("style.api.fill.opacity"))),F('Prepared "Update Style" API object',M)):F('No query parameters, do not set the "Update Style" API object')}function Ri(n){We=n.get("bpmn.element.id.collapsed")}function bi(n){const e=n.get("bpmn.filter.pool.ids");if(!e)return;const t=e.split(",");return m("Configuring load options to only include pool id: ",t),{pools:t.map(s=>({id:s}))}}function Ji(n){const e=F;e("Initializing BpmnVisualization with container:",n.globalOptions.container);const t=new URLSearchParams(window.location.search),s=t.get("renderer.ignore.bpmn.colors");if(s){const i=s==="true";e('Ignore support for "BPMN in Color"?',i),!n.globalOptions.renderer&&(n.globalOptions.renderer={}),n.globalOptions.renderer.ignoreBpmnColors=i}v=new vi(n.globalOptions),e("Initialization completed"),new Ci(window,"drop-container",v.graph.container,Pt),e("Drag&Drop support initialized"),Ue=n.statusKoNotifier??_i,e("Configuring Load Options"),D=n.loadOptions??{},D.fit=yi(n,t),D.modelFilter=bi(t),wi(t),Ri(t),e("Checking if an 'url to fetch BPMN content' is provided as query parameter");const o=t.get("url");if(o){const i=decodeURIComponent(o);Ni(i);return}e("No 'url to fetch BPMN content' provided")}function er(){Z("Trigger SVG Download"),Si(new Rt(v.graph).exportSvg())}function tr(){Z("Trigger PNG Download"),Ii(new Rt(v.graph).exportSvgForPng())}function Fi(n,e){m("Applying style using the style API: %O",e),v.bpmnElementsRegistry.updateStyle(n,e),m("New style applied on: %O",n)}function nr(n){m("Resetting styles using the style API!"),v.bpmnElementsRegistry.resetStyle(n),m("Styles reset")}function Pi(){if(M){const n=ki();m("Number of elements whose style is to be updated",n.length),Fi(n,M)}}function ki(){m("Retrieving ids of all BPMN elements");const n=[...Object.values(h),...Object.values(k)],e=v.bpmnElementsRegistry.getModelElementsByKinds(n).map(t=>t.id);return m("All BPMN elements ids retrieved:",e.length),e}export{te as F,p as S,Yt as Z,Di as a,Gi as b,ji as c,xi as d,Xi as e,Ui as f,Vi as g,qi as h,er as i,tr as j,Hi as k,m as l,zt as m,nr as n,zi as o,Fi as p,Ki as q,$i as r,Ji as s,Zi as t,Yi as u,gn as v,Qi as w,h as x,Wi as z}; +${E.getXml(t)} +`}computeSvg(e){const t=e.scale??1,n=e.border??0,r=e.crisp??!0,l=e.enableForeignObjectForLabel??!0,i=this.graph.getGraphBounds(),d=this.graph.view.scale,g=E.createXmlDocument(),c=g.createElementNS(w.NS_SVG,"svg"),p=t/d,u=Math.max(1,Math.ceil(i.width*p)+2*n),m=Math.max(1,Math.ceil(i.height*p)+2*n);c.setAttribute("version","1.1"),c.setAttribute("width",u+"px"),c.setAttribute("height",m+"px"),c.setAttribute("viewBox",(r?"-0.5 -0.5":"0 0")+" "+u+" "+m),g.append(c);const y=g.createElementNS(w.NS_SVG,"g");c.append(y);const v=this.createSvgCanvas(y);v.foEnabled=l,v.foOffset=r?-.5:0,v.textOffset=r?-.5:0,v.imageOffset=r?-.5:0,v.translate(Math.floor((n/t-i.x)/d),Math.floor((n/t-i.y)/d)),v.scale(p);const x=new $.mxImageExport;return x.includeOverlays=!0,x.drawState(this.graph.getView().getState(this.graph.model.root),v),g}createSvgCanvas(e){const t=new H(e);return t.pointerEvents=!0,t}}class H extends q{htmlConverter=document.createElement("div");constructor(e){super(e)}getAlternateText(e,t,n,r,l,i,d,g,c,p,u,m,y){return this.computeTruncatedText(i,r)}plainText(e,t,n,r,l,i,d,g,c,p,u,m){l=this.computeTruncatedText(l,n),super.plainText(e,t,n,r,l,i,d,g,c,p,u,m)}computeTruncatedText(e,t){if(e==null||this.state.fontSize<=0)return"";try{this.htmlConverter.innerHTML=e,e=E.extractTextWithWhitespace(this.htmlConverter.childNodes);const n=Math.ceil(2*t/this.state.fontSize),r=[];let l=0,i=0;for(;(n==0||l0)break}else r.push(e.charAt(i)),d<255&&l++;i++}r.length1&&(e=E.trim(r.join(""))+"...")}catch(n){console.warn("Error while computing txt label",n)}return e}}const Z=new Map([["dark",{defaultFillColor:"#334352",defaultFontColor:"white",defaultStrokeColor:"#c0ddeb",endEventFillColor:"pink",endEventStrokeColor:"FireBrick",startEventFillColor:"DarkSeaGreen",startEventStrokeColor:"DarkGreen",taskAndCallActivityFillColor:"#5c8599",laneFillColor:"#2b3742",poolFillColor:"#232b33"}],["brown",{defaultFillColor:"#ede7e1",defaultFontColor:"#414666",defaultStrokeColor:"#414666",flowColor:"#666666",catchAndThrowEventStrokeColor:"#377f87",endEventFillColor:"pink",endEventStrokeColor:"FireBrick",startEventFillColor:"DarkSeaGreen",startEventStrokeColor:"DarkGreen",taskAndCallActivityFillColor:"#dadce8",laneFillColor:"#d4c3b2",poolFillColor:"#d1b9a1"}],["light-blue",{defaultFillColor:"#ffffff",defaultFontColor:"#002395",defaultStrokeColor:"#002395",endEventFillColor:"#f9dadc",endEventStrokeColor:"#e20613",startEventFillColor:"#ffffff",startEventStrokeColor:"#05d99e",taskAndCallActivityFillColor:"rgba(132,158,253,0.1)",textAnnotationFillColor:"rgba(237,237,245,0.5)",laneFillColor:"#edeef5",poolFillColor:"#dbefff"}]]);class Q extends V{configureTheme(e){if(e=="default")return new K(this.graph).configureStyles(),!0;const t=Z.get(e);if(!t)return!1;const n=this.graph.getStylesheet();for(const p of L.eventKinds()){let u,m;switch(p){case"endEvent":{u=t.endEventFillColor,m=t.endEventStrokeColor;break}case"startEvent":{u=t.startEventFillColor,m=t.startEventStrokeColor;break}case"intermediateCatchEvent":case"intermediateThrowEvent":case"boundaryEvent":{u=t.defaultFillColor,m=t.catchAndThrowEventStrokeColor??t.defaultStrokeColor;break}default:{u=t.defaultFillColor,m=t.defaultStrokeColor;break}}const y=n.styles[p];y.fillColor=u,y.strokeColor=m}for(const p of L.taskKinds()){const u=n.styles[p];u.fillColor=t.taskAndCallActivityFillColor}const r=n.styles[S.CALL_ACTIVITY];r.fillColor=t.taskAndCallActivityFillColor;const l=n.styles[S.TEXT_ANNOTATION];l.fillColor=t.textAnnotationFillColor??z.TEXT_ANNOTATION_FILL_COLOR;const i=n.styles[S.POOL];i.fillColor=t.poolFillColor,i.swimlaneFillColor=t.defaultFillColor;const d=n.styles[S.LANE];d.fillColor=t.laneFillColor;const g=n.getDefaultVertexStyle();g.fontColor=t.defaultFontColor,g.fillColor=t.defaultFillColor,g.strokeColor=t.defaultStrokeColor;const c=n.getDefaultEdgeStyle();return c.fontColor=t.defaultFontColor,c.fillColor=t.defaultFillColor,c.strokeColor=t.flowColor??t.defaultStrokeColor,!0}configureSequenceFlowColor(e){f(`Use dedicated ${e} color for sequence flows`);const n=this.graph.getStylesheet().styles[A.SEQUENCE_FLOW];n[w.STYLE_STROKECOLOR]=e,n[w.STYLE_FILLCOLOR]=e,f("Sequence flows style updated")}}let a,C={},O,T,F,h;function ge(o){s("Updating load options"),C.fit=o,s("Load options updated",C)}function pe(){return{...C}}function me(){return F}function he(o){s("Switching theme from %s to %s",F,o),a.configureTheme(o)?(a.graph.refresh(),s("Theme switch done"),F=o):s("Unknown theme, do nothing")}function B(o,e=!0){s("Loading bpmn...");try{a.load(o,C),s("BPMN loaded with configuration",C),ee(T),document.dispatchEvent(new CustomEvent("diagramLoaded"))}catch(t){if(e)O(`Cannot load the BPMN diagram: ${t instanceof Error?t.message:String(t)}`);else throw t}}function Ce(o){s("Fitting..."),a.navigation.fit(o),s("Fit done with configuration",o)}function ve(o){s(`Zooming '${o}'...`),a.navigation.zoom(o),s("Zoom done")}function ye(o){return a.bpmnElementsRegistry.getModelElementsByKinds(o)}function J(o){return a.bpmnElementsRegistry.getModelElementsByIds(o)}function M(o){const e=a.graph.model,t=e.getCell(o);return e.getParent(t)}function Se(o){return o.map(e=>M(e).getId()).filter((e,t,n)=>n.indexOf(e)===t)}function be(o){const e=M(o),t=J(e.getId());return t&&t[0]?.kind===S.SUB_PROCESS}function Ee(o,e){return a.bpmnElementsRegistry.addCssClasses(o,e)}function we(o,e){return a.bpmnElementsRegistry.removeCssClasses(o,e)}function Fe(o,e){return a.bpmnElementsRegistry.addOverlays(o,[e])}function ke(o){return a.bpmnElementsRegistry.removeAllOverlays(o)}function ee(o){if(!T)return;s("Updating model, bpmnElement to collapse:",o);const e=a.graph.getModel(),t=e.getCell(o);if(t){e.beginUpdate();try{e.setCollapsed(t,!0)}finally{e.endUpdate()}s("Model updated")}else s("Element not found in the model, do nothing")}function R(o){o.text().then(e=>{B(e)}).catch(e=>{throw e})}function Oe(o){const e=o.target.files;if(e&&e.length>0){const t=e[0];R(t)}}function te(o){j(o).catch(e=>{throw new Error(`Unable to fetch ${o}. ${e}`)}).then(e=>(s("BPMN content fetched"),e)).then(e=>{B(e,!1),s(`BPMN content loaded from url ${o}`)}).then(()=>{de()}).catch(e=>{O(e.message)})}function Te(o){P(o)}function oe(o){D(o)}function ne(o,e){const t=o.loadOptions?.fit??{},n=e.get("fitTypeOnLoad");n&&(t.type=n);const r=e.get("fitMargin");return r&&(t.margin=Number(r)),t}function re(o,e){const t=o.globalOptions.renderer??{},n={"renderer.ignore.bpmn.colors":"ignoreBpmnColors","renderer.ignore.label.style":"ignoreLabelStyles","renderer.ignore.activity.label.bounds":"ignoreActivityLabelBounds","renderer.ignore.task.label.bounds":"ignoreTaskLabelBounds"};for(const[r,l]of Object.entries(n)){const i=e.get(r);if(i){const d=i==="true";f(`Setting renderer option '${l}':`,d),t[l]=d}}return e.get("renderer.iconPainter.use.custom")==="true"&&(t.iconPainter=new G,f("Setting renderer option 'iconPainter' with a CustomIconPainter instance")),t}function le(o){if(o.get("style.container.alternative.background.color")=="true"){const l="yellow";f("Use alternative color for the bpmn container background, color",l);const i=a.graph.container;i.style.backgroundColor=l,f("Bpmn container style updated")}const t=o.get("style.theme");f(`Configuring the '${t}' BPMN theme`),a.configureTheme(t)?(F=t,f(`'${t}' BPMN theme configured`)):f(`Unknown '${t}' BPMN theme, skipping configuration`),o.get("style.seqFlow.light.colors")=="true"&&a.configureSequenceFlowColor("#E9E9E9"),f('Configuring the "Update Style" API from query parameters'),[...o.keys()].some(l=>l.startsWith("style.api."))?(h={stroke:{},font:{},fill:{}},o.get("style.api.stroke.color")&&(h.stroke.color=o.get("style.api.stroke.color")),o.get("style.api.font.color")&&(h.font.color=o.get("style.api.font.color")),o.get("style.api.font.opacity")&&(h.font.opacity=Number(o.get("style.api.font.opacity"))),o.get("style.api.fill.color")?h.fill.color=o.get("style.api.fill.color"):o.get("style.api.fill.color.startColor")&&o.get("style.api.fill.color.endColor")&&o.get("style.api.fill.color.direction")&&(h.fill.color={startColor:o.get("style.api.fill.color.startColor"),endColor:o.get("style.api.fill.color.endColor"),direction:o.get("style.api.fill.color.direction")}),o.get("style.api.fill.opacity")&&(h.fill.opacity=Number(o.get("style.api.fill.opacity"))),f('Prepared "Update Style" API object',h)):f('No query parameters, do not set the "Update Style" API object')}function ie(o){T=o.get("bpmn.element.id.collapsed")}function se(o){const e=o.get("bpmn.filter.pool.ids");if(!e)return;const t=e.split(",");return s("Configuring load options to only include pool id: ",t),{pools:t.map(n=>({id:n}))}}function xe(o){const e=f;e("Initializing BpmnVisualization with container:",o.globalOptions.container);const t=new URLSearchParams(window.location.search);o.globalOptions.renderer=re(o,t),a=new Q(o.globalOptions),e("Initialization completed"),new Y(window,"drop-container",a.graph.container,R),e("Drag&Drop support initialized"),O=o.statusKoNotifier??oe,e("Configuring Load Options"),C=o.loadOptions??{},C.fit=ne(o,t),C.modelFilter=se(t),le(t),ie(t),e("Checking if an 'url to fetch BPMN content' is provided as query parameter");const n=t.get("url");if(n){const r=decodeURIComponent(n);te(r);return}e("No 'url to fetch BPMN content' provided")}function Le(){b("Trigger SVG Download"),W(new I(a.graph).exportSvg())}function Ae(){b("Trigger PNG Download"),X(new I(a.graph).exportSvgForPng())}function ae(o,e){s("Applying style using the style API: %O",e),a.bpmnElementsRegistry.updateStyle(o,e),s("New style applied on: %O",o)}function Pe(o){s("Resetting styles using the style API!"),a.bpmnElementsRegistry.resetStyle(o),s("Styles reset")}function de(){if(h){const o=ce();s("Number of elements whose style is to be updated",o.length),ae(o,h)}}function ce(){s("Retrieving ids of all BPMN elements");const o=[...Object.values(S),...Object.values(A)],e=a.bpmnElementsRegistry.getModelElementsByKinds(o).map(t=>t.id);return s("All BPMN elements ids retrieved:",e.length),e}export{he as a,me as b,ke as c,fe as d,Ee as e,Ce as f,pe as g,Oe as h,Le as i,Ae as j,ye as k,s as l,Pe as m,be as n,ae as o,Se as p,Fe as q,we as r,xe as s,ge as u,Te as w,ve as z}; diff --git a/demo/load-and-navigation/assets/mxgraph.js b/demo/load-and-navigation/assets/mxgraph.js deleted file mode 100644 index 49713aac..00000000 --- a/demo/load-and-navigation/assets/mxgraph.js +++ /dev/null @@ -1,22 +0,0 @@ -function getDefaultExportFromCjs(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var build$1={exports:{}},build=build$1.exports,hasRequiredBuild;function requireBuild(){return hasRequiredBuild||(hasRequiredBuild=1,function(module){(function(t,e){module.exports?module.exports=e():t.mxgraph=e()})(build,function(){return function(opts){for(var name in opts)this[name]=opts[name];var __mxOutput={},mxClient={VERSION:"4.2.2",IS_IE:navigator.userAgent!=null&&navigator.userAgent.indexOf("MSIE")>=0,IS_IE6:navigator.userAgent!=null&&navigator.userAgent.indexOf("MSIE 6")>=0,IS_IE11:navigator.userAgent!=null&&!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:navigator.userAgent!=null&&!!navigator.userAgent.match(/Edge\//),IS_QUIRKS:navigator.userAgent!=null&&navigator.userAgent.indexOf("MSIE")>=0&&(document.documentMode==null||document.documentMode==5),IS_EM:"spellcheck"in document.createElement("textarea")&&document.documentMode==8,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:navigator.userAgent!=null&&navigator.userAgent.indexOf("Mozilla/")>=0&&navigator.userAgent.indexOf("MSIE")<0&&navigator.userAgent.indexOf("Edge/")<0,IS_OP:navigator.userAgent!=null&&(navigator.userAgent.indexOf("Opera/")>=0||navigator.userAgent.indexOf("OPR/")>=0),IS_OT:navigator.userAgent!=null&&navigator.userAgent.indexOf("Presto/")>=0&&navigator.userAgent.indexOf("Presto/2.4.")<0&&navigator.userAgent.indexOf("Presto/2.3.")<0&&navigator.userAgent.indexOf("Presto/2.2.")<0&&navigator.userAgent.indexOf("Presto/2.1.")<0&&navigator.userAgent.indexOf("Presto/2.0.")<0&&navigator.userAgent.indexOf("Presto/1.")<0,IS_SF:/Apple Computer, Inc/.test(navigator.vendor),IS_ANDROID:navigator.appVersion.indexOf("Android")>=0,IS_IOS:/iP(hone|od|ad)/.test(navigator.platform),IS_GC:/Google Inc/.test(navigator.vendor),IS_CHROMEAPP:window.chrome!=null&&chrome.app!=null&&chrome.app.runtime!=null,IS_FF:typeof InstallTrigger<"u",IS_MT:navigator.userAgent.indexOf("Firefox/")>=0&&navigator.userAgent.indexOf("Firefox/1.")<0&&navigator.userAgent.indexOf("Firefox/2.")<0||navigator.userAgent.indexOf("Iceweasel/")>=0&&navigator.userAgent.indexOf("Iceweasel/1.")<0&&navigator.userAgent.indexOf("Iceweasel/2.")<0||navigator.userAgent.indexOf("SeaMonkey/")>=0&&navigator.userAgent.indexOf("SeaMonkey/1.")<0||navigator.userAgent.indexOf("Iceape/")>=0&&navigator.userAgent.indexOf("Iceape/1.")<0,IS_VML:navigator.appName.toUpperCase()=="MICROSOFT INTERNET EXPLORER",IS_SVG:navigator.appName.toUpperCase()!="MICROSOFT INTERNET EXPLORER",NO_FO:!document.createElementNS||document.createElementNS("http://www.w3.org/2000/svg","foreignObject")!="[object SVGForeignObjectElement]"||navigator.userAgent.indexOf("Opera/")>=0,IS_WIN:navigator.appVersion.indexOf("Win")>0,IS_MAC:navigator.appVersion.indexOf("Mac")>0,IS_CHROMEOS:/\bCrOS\b/.test(navigator.appVersion),IS_TOUCH:"ontouchstart"in document.documentElement,IS_POINTER:window.PointerEvent!=null&&!(navigator.appVersion.indexOf("Mac")>0),IS_LOCAL:document.location.href.indexOf("http://")<0&&document.location.href.indexOf("https://")<0,defaultBundles:[],isBrowserSupported:function(){return mxClient.IS_VML||mxClient.IS_SVG},link:function(t,e,i,n){if(i=i||document,mxClient.IS_IE6)i.write('');else{var r=i.createElement("link");r.setAttribute("rel",t),r.setAttribute("href",e),r.setAttribute("charset","UTF-8"),r.setAttribute("type","text/css"),n&&r.setAttribute("id",n);var s=i.getElementsByTagName("head")[0];s.appendChild(r)}},loadResources:function(t,e){var i=mxClient.defaultBundles.length;function n(){--i==0&&t()}for(var r=0;r<\/script>')}};typeof mxLoadResources>"u"&&(mxLoadResources=!0),typeof mxForceIncludes>"u"&&(mxForceIncludes=!1),typeof mxResourceExtension>"u"&&(mxResourceExtension=".txt"),typeof mxLoadStylesheets>"u"&&(mxLoadStylesheets=!0),typeof mxBasePath<"u"&&mxBasePath.length>0?(mxBasePath.substring(mxBasePath.length-1)=="/"&&(mxBasePath=mxBasePath.substring(0,mxBasePath.length-1)),mxClient.basePath=mxBasePath):mxClient.basePath=".",typeof mxImageBasePath<"u"&&mxImageBasePath.length>0?(mxImageBasePath.substring(mxImageBasePath.length-1)=="/"&&(mxImageBasePath=mxImageBasePath.substring(0,mxImageBasePath.length-1)),mxClient.imageBasePath=mxImageBasePath):mxClient.imageBasePath=mxClient.basePath+"/images",typeof mxLanguage<"u"&&mxLanguage!=null?mxClient.language=mxLanguage:mxClient.language=mxClient.IS_IE?navigator.userLanguage:navigator.language,typeof mxDefaultLanguage<"u"&&mxDefaultLanguage!=null?mxClient.defaultLanguage=mxDefaultLanguage:mxClient.defaultLanguage="en",mxLoadStylesheets&&mxClient.link("stylesheet",mxClient.basePath+"/css/common.css"),typeof mxLanguages<"u"&&mxLanguages!=null&&(mxClient.languages=mxLanguages),mxClient.IS_VML&&(mxClient.IS_SVG?mxClient.IS_VML=!1:(document.namespaces!=null&&(document.documentMode==8?(document.namespaces.add(mxClient.VML_PREFIX,"urn:schemas-microsoft-com:vml","#default#VML"),document.namespaces.add(mxClient.OFFICE_PREFIX,"urn:schemas-microsoft-com:office:office","#default#VML")):(document.namespaces.add(mxClient.VML_PREFIX,"urn:schemas-microsoft-com:vml"),document.namespaces.add(mxClient.OFFICE_PREFIX,"urn:schemas-microsoft-com:office:office"))),mxClient.IS_QUIRKS&&document.styleSheets.length>=30?function(){var t=document.createElement("style");t.type="text/css",t.styleSheet.cssText=mxClient.VML_PREFIX+"\\:*{behavior:url(#default#VML)}"+mxClient.OFFICE_PREFIX+"\\:*{behavior:url(#default#VML)}",document.getElementsByTagName("head")[0].appendChild(t)}():document.createStyleSheet().cssText=mxClient.VML_PREFIX+"\\:*{behavior:url(#default#VML)}"+mxClient.OFFICE_PREFIX+"\\:*{behavior:url(#default#VML)}",mxLoadStylesheets&&mxClient.link("stylesheet",mxClient.basePath+"/css/explorer.css"))),(mxForceIncludes||module.exports==null)&&(mxClient.include(mxClient.basePath+"/js/util/mxLog.js"),mxClient.include(mxClient.basePath+"/js/util/mxObjectIdentity.js"),mxClient.include(mxClient.basePath+"/js/util/mxDictionary.js"),mxClient.include(mxClient.basePath+"/js/util/mxResources.js"),mxClient.include(mxClient.basePath+"/js/util/mxPoint.js"),mxClient.include(mxClient.basePath+"/js/util/mxRectangle.js"),mxClient.include(mxClient.basePath+"/js/util/mxEffects.js"),mxClient.include(mxClient.basePath+"/js/util/mxUtils.js"),mxClient.include(mxClient.basePath+"/js/util/mxConstants.js"),mxClient.include(mxClient.basePath+"/js/util/mxEventObject.js"),mxClient.include(mxClient.basePath+"/js/util/mxMouseEvent.js"),mxClient.include(mxClient.basePath+"/js/util/mxEventSource.js"),mxClient.include(mxClient.basePath+"/js/util/mxEvent.js"),mxClient.include(mxClient.basePath+"/js/util/mxXmlRequest.js"),mxClient.include(mxClient.basePath+"/js/util/mxClipboard.js"),mxClient.include(mxClient.basePath+"/js/util/mxWindow.js"),mxClient.include(mxClient.basePath+"/js/util/mxForm.js"),mxClient.include(mxClient.basePath+"/js/util/mxImage.js"),mxClient.include(mxClient.basePath+"/js/util/mxDivResizer.js"),mxClient.include(mxClient.basePath+"/js/util/mxDragSource.js"),mxClient.include(mxClient.basePath+"/js/util/mxToolbar.js"),mxClient.include(mxClient.basePath+"/js/util/mxUndoableEdit.js"),mxClient.include(mxClient.basePath+"/js/util/mxUndoManager.js"),mxClient.include(mxClient.basePath+"/js/util/mxUrlConverter.js"),mxClient.include(mxClient.basePath+"/js/util/mxPanningManager.js"),mxClient.include(mxClient.basePath+"/js/util/mxPopupMenu.js"),mxClient.include(mxClient.basePath+"/js/util/mxAutoSaveManager.js"),mxClient.include(mxClient.basePath+"/js/util/mxAnimation.js"),mxClient.include(mxClient.basePath+"/js/util/mxMorphing.js"),mxClient.include(mxClient.basePath+"/js/util/mxImageBundle.js"),mxClient.include(mxClient.basePath+"/js/util/mxImageExport.js"),mxClient.include(mxClient.basePath+"/js/util/mxAbstractCanvas2D.js"),mxClient.include(mxClient.basePath+"/js/util/mxXmlCanvas2D.js"),mxClient.include(mxClient.basePath+"/js/util/mxSvgCanvas2D.js"),mxClient.include(mxClient.basePath+"/js/util/mxVmlCanvas2D.js"),mxClient.include(mxClient.basePath+"/js/util/mxGuide.js"),mxClient.include(mxClient.basePath+"/js/shape/mxShape.js"),mxClient.include(mxClient.basePath+"/js/shape/mxStencil.js"),mxClient.include(mxClient.basePath+"/js/shape/mxStencilRegistry.js"),mxClient.include(mxClient.basePath+"/js/shape/mxMarker.js"),mxClient.include(mxClient.basePath+"/js/shape/mxActor.js"),mxClient.include(mxClient.basePath+"/js/shape/mxCloud.js"),mxClient.include(mxClient.basePath+"/js/shape/mxRectangleShape.js"),mxClient.include(mxClient.basePath+"/js/shape/mxEllipse.js"),mxClient.include(mxClient.basePath+"/js/shape/mxDoubleEllipse.js"),mxClient.include(mxClient.basePath+"/js/shape/mxRhombus.js"),mxClient.include(mxClient.basePath+"/js/shape/mxPolyline.js"),mxClient.include(mxClient.basePath+"/js/shape/mxArrow.js"),mxClient.include(mxClient.basePath+"/js/shape/mxArrowConnector.js"),mxClient.include(mxClient.basePath+"/js/shape/mxText.js"),mxClient.include(mxClient.basePath+"/js/shape/mxTriangle.js"),mxClient.include(mxClient.basePath+"/js/shape/mxHexagon.js"),mxClient.include(mxClient.basePath+"/js/shape/mxLine.js"),mxClient.include(mxClient.basePath+"/js/shape/mxImageShape.js"),mxClient.include(mxClient.basePath+"/js/shape/mxLabel.js"),mxClient.include(mxClient.basePath+"/js/shape/mxCylinder.js"),mxClient.include(mxClient.basePath+"/js/shape/mxConnector.js"),mxClient.include(mxClient.basePath+"/js/shape/mxSwimlane.js"),mxClient.include(mxClient.basePath+"/js/layout/mxGraphLayout.js"),mxClient.include(mxClient.basePath+"/js/layout/mxStackLayout.js"),mxClient.include(mxClient.basePath+"/js/layout/mxPartitionLayout.js"),mxClient.include(mxClient.basePath+"/js/layout/mxCompactTreeLayout.js"),mxClient.include(mxClient.basePath+"/js/layout/mxRadialTreeLayout.js"),mxClient.include(mxClient.basePath+"/js/layout/mxFastOrganicLayout.js"),mxClient.include(mxClient.basePath+"/js/layout/mxCircleLayout.js"),mxClient.include(mxClient.basePath+"/js/layout/mxParallelEdgeLayout.js"),mxClient.include(mxClient.basePath+"/js/layout/mxCompositeLayout.js"),mxClient.include(mxClient.basePath+"/js/layout/mxEdgeLabelLayout.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/model/mxGraphAbstractHierarchyCell.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/model/mxGraphHierarchyNode.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/model/mxGraphHierarchyEdge.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/model/mxGraphHierarchyModel.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/model/mxSwimlaneModel.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/stage/mxHierarchicalLayoutStage.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/stage/mxMedianHybridCrossingReduction.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/stage/mxMinimumCycleRemover.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/stage/mxCoordinateAssignment.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/stage/mxSwimlaneOrdering.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/mxHierarchicalLayout.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/mxSwimlaneLayout.js"),mxClient.include(mxClient.basePath+"/js/model/mxGraphModel.js"),mxClient.include(mxClient.basePath+"/js/model/mxCell.js"),mxClient.include(mxClient.basePath+"/js/model/mxGeometry.js"),mxClient.include(mxClient.basePath+"/js/model/mxCellPath.js"),mxClient.include(mxClient.basePath+"/js/view/mxPerimeter.js"),mxClient.include(mxClient.basePath+"/js/view/mxPrintPreview.js"),mxClient.include(mxClient.basePath+"/js/view/mxStylesheet.js"),mxClient.include(mxClient.basePath+"/js/view/mxCellState.js"),mxClient.include(mxClient.basePath+"/js/view/mxGraphSelectionModel.js"),mxClient.include(mxClient.basePath+"/js/view/mxCellEditor.js"),mxClient.include(mxClient.basePath+"/js/view/mxCellRenderer.js"),mxClient.include(mxClient.basePath+"/js/view/mxEdgeStyle.js"),mxClient.include(mxClient.basePath+"/js/view/mxStyleRegistry.js"),mxClient.include(mxClient.basePath+"/js/view/mxGraphView.js"),mxClient.include(mxClient.basePath+"/js/view/mxGraph.js"),mxClient.include(mxClient.basePath+"/js/view/mxCellOverlay.js"),mxClient.include(mxClient.basePath+"/js/view/mxOutline.js"),mxClient.include(mxClient.basePath+"/js/view/mxMultiplicity.js"),mxClient.include(mxClient.basePath+"/js/view/mxLayoutManager.js"),mxClient.include(mxClient.basePath+"/js/view/mxSwimlaneManager.js"),mxClient.include(mxClient.basePath+"/js/view/mxTemporaryCellStates.js"),mxClient.include(mxClient.basePath+"/js/view/mxCellStatePreview.js"),mxClient.include(mxClient.basePath+"/js/view/mxConnectionConstraint.js"),mxClient.include(mxClient.basePath+"/js/handler/mxGraphHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxPanningHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxPopupMenuHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxCellMarker.js"),mxClient.include(mxClient.basePath+"/js/handler/mxSelectionCellsHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxConnectionHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxConstraintHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxRubberband.js"),mxClient.include(mxClient.basePath+"/js/handler/mxHandle.js"),mxClient.include(mxClient.basePath+"/js/handler/mxVertexHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxEdgeHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxElbowEdgeHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxEdgeSegmentHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxKeyHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxTooltipHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxCellTracker.js"),mxClient.include(mxClient.basePath+"/js/handler/mxCellHighlight.js"),mxClient.include(mxClient.basePath+"/js/editor/mxDefaultKeyHandler.js"),mxClient.include(mxClient.basePath+"/js/editor/mxDefaultPopupMenu.js"),mxClient.include(mxClient.basePath+"/js/editor/mxDefaultToolbar.js"),mxClient.include(mxClient.basePath+"/js/editor/mxEditor.js"),mxClient.include(mxClient.basePath+"/js/io/mxCodecRegistry.js"),mxClient.include(mxClient.basePath+"/js/io/mxCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxObjectCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxCellCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxModelCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxRootChangeCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxChildChangeCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxTerminalChangeCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxGenericChangeCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxGraphCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxGraphViewCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxStylesheetCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxDefaultKeyHandlerCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxDefaultToolbarCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxDefaultPopupMenuCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxEditorCodec.js")),__mxOutput.mxClient=typeof mxClient<"u"?mxClient:void 0;var mxLog={consoleName:"Console",TRACE:!1,DEBUG:!0,WARN:!0,buffer:"",init:function(){if(mxLog.window==null&&document.body!=null){var t=mxLog.consoleName+" - mxGraph "+mxClient.VERSION,e=document.createElement("table");e.setAttribute("width","100%"),e.setAttribute("height","100%");var i=document.createElement("tbody"),n=document.createElement("tr"),r=document.createElement("td");r.style.verticalAlign="top",mxLog.textarea=document.createElement("textarea"),mxLog.textarea.setAttribute("wrap","off"),mxLog.textarea.setAttribute("readOnly","true"),mxLog.textarea.style.height="100%",mxLog.textarea.style.resize="none",mxLog.textarea.value=mxLog.buffer,mxClient.IS_NS&&document.compatMode!="BackCompat"?mxLog.textarea.style.width="99%":mxLog.textarea.style.width="100%",r.appendChild(mxLog.textarea),n.appendChild(r),i.appendChild(n),n=document.createElement("tr"),mxLog.td=document.createElement("td"),mxLog.td.style.verticalAlign="top",mxLog.td.setAttribute("height","30px"),n.appendChild(mxLog.td),i.appendChild(n),e.appendChild(i),mxLog.addButton("Info",function(u){mxLog.info()}),mxLog.addButton("DOM",function(u){var p=mxUtils.getInnerHtml(document.body);mxLog.debug(p)}),mxLog.addButton("Trace",function(u){mxLog.TRACE=!mxLog.TRACE,mxLog.TRACE?mxLog.debug("Tracing enabled"):mxLog.debug("Tracing disabled")}),mxLog.addButton("Copy",function(u){try{mxUtils.copy(mxLog.textarea.value)}catch(p){mxUtils.alert(p)}}),mxLog.addButton("Show",function(u){try{mxUtils.popup(mxLog.textarea.value)}catch(p){mxUtils.alert(p)}}),mxLog.addButton("Clear",function(u){mxLog.textarea.value=""});var s=0,l=0;if(typeof window.innerWidth=="number"?(s=window.innerHeight,l=window.innerWidth):(s=document.documentElement.clientHeight||document.body.clientHeight,l=document.body.clientWidth),mxLog.window=new mxWindow(t,e,Math.max(0,l-320),Math.max(0,s-210),300,160),mxLog.window.setMaximizable(!0),mxLog.window.setScrollable(!1),mxLog.window.setResizable(!0),mxLog.window.setClosable(!0),mxLog.window.destroyOnClose=!1,(mxClient.IS_NS||mxClient.IS_IE)&&!mxClient.IS_GC&&!mxClient.IS_SF&&document.compatMode!="BackCompat"||document.documentMode==11){var a=mxLog.window.getElement(),o=function(u,p){mxLog.textarea.style.height=Math.max(0,a.offsetHeight-70)+"px"};mxLog.window.addListener(mxEvent.RESIZE_END,o),mxLog.window.addListener(mxEvent.MAXIMIZE,o),mxLog.window.addListener(mxEvent.NORMALIZE,o),mxLog.textarea.style.height="92px"}}},info:function(){mxLog.writeln(mxUtils.toString(navigator))},addButton:function(t,e){var i=document.createElement("button");mxUtils.write(i,t),mxEvent.addListener(i,"click",e),mxLog.td.appendChild(i)},isVisible:function(){return mxLog.window!=null?mxLog.window.isVisible():!1},show:function(){mxLog.setVisible(!0)},setVisible:function(t){mxLog.window==null&&mxLog.init(),mxLog.window!=null&&mxLog.window.setVisible(t)},enter:function(t){if(mxLog.TRACE)return mxLog.writeln("Entering "+t),new Date().getTime()},leave:function(t,e){if(mxLog.TRACE){var i=e!=0?" ("+(new Date().getTime()-e)+" ms)":"";mxLog.writeln("Leaving "+t+i)}},debug:function(){mxLog.DEBUG&&mxLog.writeln.apply(this,arguments)},warn:function(){mxLog.WARN&&mxLog.writeln.apply(this,arguments)},write:function(){for(var t="",e=0;e=0&&(mxLog.textarea.style.visibility="hidden",mxLog.textarea.style.visibility="visible"),mxLog.textarea.scrollTop=mxLog.textarea.scrollHeight):mxLog.buffer+=t},writeln:function(){for(var t="",e=0;e=0:!0},getDefaultBundle:function(t,e){return mxResources.loadDefaultBundle||!mxResources.isLanguageSupported(e)?t+mxResources.extension:null},getSpecialBundle:function(t,e){if(mxClient.languages==null||!this.isLanguageSupported(e)){var i=e.indexOf("-");i>0&&(e=e.substring(0,i))}return mxResources.loadSpecialBundle&&mxResources.isLanguageSupported(e)&&e!=mxClient.defaultLanguage?t+"_"+e+mxResources.extension:null},add:function(t,e,i){if(e=e??(mxClient.language!=null?mxClient.language.toLowerCase():mxConstants.NONE),e!=mxConstants.NONE){var n=mxResources.getDefaultBundle(t,e),r=mxResources.getSpecialBundle(t,e),s=function(){if(r!=null)if(i)mxUtils.get(r,function(o){mxResources.parse(o.getText()),i()},function(){i()});else try{var a=mxUtils.load(r);a.isReady()&&mxResources.parse(a.getText())}catch{}else i!=null&&i()};if(n!=null)if(i)mxUtils.get(n,function(a){mxResources.parse(a.getText()),s()},function(){s()});else try{var l=mxUtils.load(n);l.isReady()&&mxResources.parse(l.getText()),s()}catch{}else s()}},parse:function(t){if(t!=null){for(var e=t.split(` -`),i=0;i0){var r=e[i].substring(0,n),s=e[i].length;e[i].charCodeAt(s-1)==13&&s--;var l=e[i].substring(n+1,s);this.resourcesEncoded?(l=l.replace(/\\(?=u[a-fA-F\d]{4})/g,"%"),mxResources.resources[r]=unescape(l)):mxResources.resources[r]=l}}}},get:function(t,e,i){var n=mxResources.resources[t];return n==null&&(n=i),n!=null&&e!=null&&(n=mxResources.replacePlaceholders(n,e)),n},replacePlaceholders:function(t,e){for(var i=[],n=null,r=0;r=0&&n0?window.setTimeout(a,r):(t.style.visibility="hidden",i&&t.parentNode&&t.parentNode.removeChild(t))};window.setTimeout(a,r)}else t.style.visibility="hidden",i&&t.parentNode&&t.parentNode.removeChild(t)}};__mxOutput.mxEffects=typeof mxEffects<"u"?mxEffects:void 0;var mxUtils={errorResource:mxClient.language!="none"?"error":"",closeResource:mxClient.language!="none"?"close":"",errorImage:mxClient.imageBasePath+"/error.gif",removeCursors:function(t){t.style!=null&&(t.style.cursor="");var e=t.childNodes;if(e!=null)for(var i=e.length,n=0;n=9&&document.documentMode<10&&(t="ms"),function(e,i,n){e[i]=n,t!=null&&i.length>0&&(i=t+i.substring(0,1).toUpperCase()+i.substring(1),e[i]=n)}}(),hasScrollbars:function(t){var e=mxUtils.getCurrentStyle(t);return e!=null&&(e.overflow=="scroll"||e.overflow=="auto")},bind:function(t,e){return function(){return e.apply(t,arguments)}},eval:function(expr){var result=null;if(expr.indexOf("function")>=0)try{eval("var _mxJavaScriptExpression="+expr),result=_mxJavaScriptExpression,_mxJavaScriptExpression=null}catch(t){mxLog.warn(t.message+" while evaluating "+expr)}else try{result=eval(expr)}catch(t){mxLog.warn(t.message+" while evaluating "+expr)}return result},findNode:function(t,e,i){if(t.nodeType==mxConstants.NODETYPE_ELEMENT){var n=t.getAttribute(e);if(n!=null&&n==i)return t}for(t=t.firstChild;t!=null;){var r=mxUtils.findNode(t,e,i);if(r!=null)return r;t=t.nextSibling}return null},getFunctionName:function(t){var e=null;if(t!=null){if(t.name!=null)e=t.name;else if(e=mxUtils.trim(t.toString()),/^function\s/.test(e)){e=mxUtils.ltrim(e.substring(9));var i=e.indexOf("(");i>0&&(e=e.substring(0,i))}}return e},indexOf:function(t,e){if(t!=null&&e!=null){for(var i=0;i=0;)e.splice(n,1),i=t,n=mxUtils.indexOf(e,t);for(var r in e)e[r]==t&&(delete e[r],i=t);return i},isNode:function(t,e,i,n){return t!=null&&!isNaN(t.nodeType)&&(e==null||t.nodeName.toLowerCase()==e.toLowerCase())?i==null||t.getAttribute(i)==n:!1},isAncestorNode:function(t,e){for(var i=e;i!=null;){if(i==t)return!0;i=i.parentNode}return!1},getChildNodes:function(t,e){e=e||mxConstants.NODETYPE_ELEMENT;for(var i=[],n=t.firstChild;n!=null;)n.nodeType==e&&i.push(n),n=n.nextSibling;return i},importNode:function(t,e,i){return mxClient.IS_IE&&(document.documentMode==null||document.documentMode<10)?mxUtils.importNodeImplementation(t,e,i):t.importNode(e,i)},importNodeImplementation:function(t,e,i){switch(e.nodeType){case 1:{var n=t.createElement(e.nodeName);if(e.attributes&&e.attributes.length>0)for(var r=0;r0)for(var r=0;r/g,">"),(e==null||e)&&(t=t.replace(/\n/g," ")),t},isVml:function(t){return t!=null&&t.tagUrn=="urn:schemas-microsoft-com:vml"},getXml:function(t,e){var i="";if(mxClient.IS_IE||mxClient.IS_IE11)i=mxUtils.getPrettyXml(t,"","","");else if(window.XMLSerializer!=null){var n=new XMLSerializer;i=n.serializeToString(t)}else t.xml!=null&&(i=t.xml.replace(/\r\n\t[\t]*/g,"").replace(/>\r\n/g,">").replace(/\r\n/g,` -`));return e=e||" ",i=i.replace(/\n/g,e),i},getPrettyXml:function(t,e,i,n,r){var s=[];if(t!=null)if(e=e??" ",i=i??"",n=n??` -`,t.namespaceURI!=null&&t.namespaceURI!=r&&(r=t.namespaceURI,t.getAttribute("xmlns")==null&&t.setAttribute("xmlns",t.namespaceURI)),t.nodeType==mxConstants.NODETYPE_DOCUMENT)s.push(mxUtils.getPrettyXml(t.documentElement,e,i,n,r));else if(t.nodeType==mxConstants.NODETYPE_DOCUMENT_FRAGMENT){var l=t.firstChild;if(l!=null)for(;l!=null;)s.push(mxUtils.getPrettyXml(l,e,i,n,r)),l=l.nextSibling}else if(t.nodeType==mxConstants.NODETYPE_COMMENT){var a=mxUtils.getTextContent(t);a.length>0&&s.push(i+""+n)}else if(t.nodeType==mxConstants.NODETYPE_TEXT){var a=mxUtils.trim(mxUtils.getTextContent(t));a.length>0&&s.push(i+mxUtils.htmlEntities(a,!1)+n)}else if(t.nodeType==mxConstants.NODETYPE_CDATA){var a=mxUtils.getTextContent(t);a.length>0&&s.push(i+""+n);l!=null;)s.push(mxUtils.getPrettyXml(l,e,i+e,n,r)),l=l.nextSibling;s.push(i+""+n)}else s.push(" />"+n)}return s.join("")},extractTextWithWhitespace:function(t){var e=["BLOCKQUOTE","DIV","H1","H2","H3","H4","H5","H6","OL","P","PRE","TABLE","UL"],i=[];function n(r){if(!(r.length==1&&(r[0].nodeName=="BR"||r[0].innerHTML==` -`)))for(var s=0;s"?i.push(` -`):(l.nodeType===3||l.nodeType===4?l.nodeValue.length>0&&i.push(l.nodeValue):l.nodeType!==8&&l.childNodes.length>0&&n(l.childNodes),s=0&&i.push(` -`))}}return n(t),i.join("")},replaceTrailingNewlines:function(t,e){for(var i="";t.length>0&&t.charAt(t.length-1)==` -`;)t=t.substring(0,t.length-1),i+=e;return t+i},getTextContent:function(t){return mxClient.IS_IE&&t.innerText!==void 0?t.innerText:t!=null?t[t.textContent===void 0?"text":"textContent"]:""},setTextContent:function(t,e){t.innerText!==void 0?t.innerText=e:t[t.textContent===void 0?"text":"textContent"]=e},getInnerHtml:function(){return mxClient.IS_IE?function(t){return t!=null?t.innerHTML:""}:function(t){if(t!=null){var e=new XMLSerializer;return e.serializeToString(t)}return""}}(),getOuterHtml:function(){return mxClient.IS_IE?function(t){if(t!=null){if(t.outerHTML!=null)return t.outerHTML;var e=[];e.push("<"+t.nodeName);var i=t.attributes;if(i!=null)for(var n=0;n0&&(e.push(" "),e.push(i[n].nodeName),e.push('="'),e.push(r),e.push('"'))}return t.innerHTML.length==0?e.push("/>"):(e.push(">"),e.push(t.innerHTML),e.push("")),e.join("")}return""}:function(t){if(t!=null){var e=new XMLSerializer;return e.serializeToString(t)}return""}}(),write:function(t,e){var i=t.ownerDocument,n=i.createTextNode(e);return t!=null&&t.appendChild(n),n},writeln:function(t,e){var i=t.ownerDocument,n=i.createTextNode(e);return t!=null&&(t.appendChild(n),t.appendChild(document.createElement("br"))),n},br:function(t,e){e=e||1;for(var i=null,n=0;na&&(t.style.left=Math.max(s,a-n)+"px");var o=parseInt(t.offsetTop),u=parseInt(t.offsetHeight),p=l+e.height;o+u>p&&(t.style.top=Math.max(l,p-u)+"px")},load:function(t){var e=new mxXmlRequest(t,null,"GET",!1);return e.send(),e},get:function(t,e,i,n,r,s,l){var a=new mxXmlRequest(t,null,"GET"),o=a.setRequestHeaders;return l&&(a.setRequestHeaders=function(u,p){o.apply(this,arguments);for(var m in l)u.setRequestHeader(m,l[m])}),n!=null&&a.setBinary(n),a.send(e,i,r,s),a},getAll:function(t,e,i){for(var n=t.length,r=[],s=0,l=function(){s==0&&i!=null&&i(),s++},a=0;a299?l():(r[u]=p,n--,n==0&&e(r))},l)})(t[a],a);n==0&&e(r)},post:function(t,e,i,n){return new mxXmlRequest(t,e).send(i,n)},submit:function(t,e,i,n){return new mxXmlRequest(t,e).simulate(i,n)},loadInto:function(t,e,i){mxClient.IS_IE?e.onreadystatechange=function(){e.readyState==4&&i()}:e.addEventListener("load",i,!1),e.load(t)},getValue:function(t,e,i){var n=t!=null?t[e]:null;return n==null&&(n=i),n},getNumber:function(t,e,i){var n=t!=null?t[e]:null;return n==null&&(n=i||0),Number(n)},getColor:function(t,e,i){var n=t!=null?t[e]:null;return n==null?n=i:n==mxConstants.NONE&&(n=null),n},clone:function(t,e,i){i=i??!1;var n=null;if(t!=null&&typeof t.constructor=="function"){n=new t.constructor;for(var r in t)r!=mxObjectIdentity.FIELD_NAME&&(e==null||mxUtils.indexOf(e,r)<0)&&(!i&&typeof t[r]=="object"?n[r]=mxUtils.clone(t[r]):n[r]=t[r])}return n},equalPoints:function(t,e){if(t==null&&e!=null||t!=null&&e==null||t!=null&&e!=null&&t.length!=e.length)return!1;if(t!=null&&e!=null){for(var i=0;i [Function] -`;else if(typeof t[i]=="object"){var n=mxUtils.getFunctionName(t[i].constructor);e+=i+" => ["+n+`] -`}else e+=i+" = "+t[i]+` -`}catch(r){e+=i+"="+r.message}return e},toRadians:function(t){return Math.PI*t/180},toDegree:function(t){return t*180/Math.PI},arcToCurves:function(t,e,i,n,r,s,l,a,o){if(a-=t,o-=e,i===0||n===0)return N;var u=l,p=r;i=Math.abs(i),n=Math.abs(n);var m=-a/2,d=-o/2,x=Math.cos(p*Math.PI/180),f=Math.sin(p*Math.PI/180),g=x*m+f*d,c=-1*f*m+x*d,v=g*g,y=c*c,T=i*i,C=n*n,S=v/T+y/C,E;if(S>1)i=Math.sqrt(S)*i,n=Math.sqrt(S)*n,E=0;else{var L=1;s===u&&(L=-1),E=L*Math.sqrt((T*C-T*y-C*v)/(T*y+C*v))}var A=E*i*c/n,M=-1*E*n*g/i,I=x*A-f*M+a/2,P=f*A+x*M+o/2,R=Math.atan2((c-M)/n,(g-A)/i)-Math.atan2(0,1),O=R>=0?R:2*Math.PI+R;R=Math.atan2((-c-M)/n,(-g-A)/i)-Math.atan2((c-M)/n,(g-A)/i);var _=R>=0?R:2*Math.PI+R;u==0&&_>0?_-=2*Math.PI:u!=0&&_<0&&(_+=2*Math.PI);for(var b=_*2/Math.PI,k=Math.ceil(b<0?-1*b:b),G=_/k,B=8/3*Math.sin(G/4)*Math.sin(G/4)/Math.sin(G/2),j=x*i,H=x*n,W=f*i,X=f*n,V=Math.cos(O),Y=Math.sin(O),et=-B*(j*Y+X*V),q=-B*(W*Y-H*V),K=0,Z=0,N=[],D=0;D45?(u=1,o>=135&&(u=2)):o<-45&&(u=3,o<=-135&&(u=2)),s.indexOf(mxConstants.DIRECTION_NORTH)>=0)switch(u){case 0:l|=mxConstants.DIRECTION_MASK_NORTH;break;case 1:l|=mxConstants.DIRECTION_MASK_EAST;break;case 2:l|=mxConstants.DIRECTION_MASK_SOUTH;break;case 3:l|=mxConstants.DIRECTION_MASK_WEST;break}if(s.indexOf(mxConstants.DIRECTION_WEST)>=0)switch(u){case 0:l|=mxConstants.DIRECTION_MASK_WEST;break;case 1:l|=mxConstants.DIRECTION_MASK_NORTH;break;case 2:l|=mxConstants.DIRECTION_MASK_EAST;break;case 3:l|=mxConstants.DIRECTION_MASK_SOUTH;break}if(s.indexOf(mxConstants.DIRECTION_SOUTH)>=0)switch(u){case 0:l|=mxConstants.DIRECTION_MASK_SOUTH;break;case 1:l|=mxConstants.DIRECTION_MASK_WEST;break;case 2:l|=mxConstants.DIRECTION_MASK_NORTH;break;case 3:l|=mxConstants.DIRECTION_MASK_EAST;break}if(s.indexOf(mxConstants.DIRECTION_EAST)>=0)switch(u){case 0:l|=mxConstants.DIRECTION_MASK_EAST;break;case 1:l|=mxConstants.DIRECTION_MASK_SOUTH;break;case 2:l|=mxConstants.DIRECTION_MASK_WEST;break;case 3:l|=mxConstants.DIRECTION_MASK_NORTH;break}return l},reversePortConstraints:function(t){var e=0;return e=(t&mxConstants.DIRECTION_MASK_WEST)<<3,e|=(t&mxConstants.DIRECTION_MASK_NORTH)<<1,e|=(t&mxConstants.DIRECTION_MASK_SOUTH)>>1,e|=(t&mxConstants.DIRECTION_MASK_EAST)>>3,e},findNearestSegment:function(t,e,i){var n=-1;if(t.absolutePoints.length>0)for(var r=t.absolutePoints[0],s=null,l=1;lo.distSq)&&(n=o)}}return n!=null?n.p:null},rectangleIntersectsSegment:function(t,e,i){var n=t.y,r=t.x,s=n+t.height,l=r+t.width,a=e.x,o=i.x;if(e.x>i.x&&(a=i.x,o=e.x),o>l&&(o=l),ao)return!1;var u=e.y,p=i.y,m=i.x-e.x;if(Math.abs(m)>1e-7){var d=(i.y-e.y)/m,x=e.y-d*e.x;u=d*a+x,p=d*o+x}if(u>p){var f=p;p=u,u=f}return p>s&&(p=s),up)},contains:function(t,e,i){return t.x<=e&&t.x+t.width>=e&&t.y<=i&&t.y+t.height>=i},intersects:function(t,e){var i=t.width,n=t.height,r=e.width,s=e.height;if(r<=0||s<=0||i<=0||n<=0)return!1;var l=t.x,a=t.y,o=e.x,u=e.y;return r+=o,s+=u,i+=l,n+=a,(rl)&&(sa)&&(io)&&(nu)},intersectsHotspot:function(t,e,i,n,r,s){if(n=n??1,r=r??0,s=s??0,n>0){var l=t.getCenterX(),a=t.getCenterY(),o=t.width,u=t.height,p=mxUtils.getValue(t.style,mxConstants.STYLE_STARTSIZE)*t.view.scale;p>0&&(mxUtils.getValue(t.style,mxConstants.STYLE_HORIZONTAL,!0)?(a=t.y+p/2,u=p):(l=t.x+p/2,o=p)),o=Math.max(r,o*n),u=Math.max(r,u*n),s>0&&(o=Math.min(o,s),u=Math.min(u,s));var m=new mxRectangle(l-o/2,a-u/2,o,u),d=mxUtils.toRadians(mxUtils.getValue(t.style,mxConstants.STYLE_ROTATION)||0);if(d!=0){var x=Math.cos(-d),f=Math.sin(-d),l=new mxPoint(t.getCenterX(),t.getCenterY()),g=mxUtils.getRotatedPoint(new mxPoint(e,i),x,f,l);e=g.x,i=g.y}return mxUtils.contains(m,e,i)}return!0},getOffset:function(t,e){for(var i=0,n=0,r=!1,s=t,l=document.body,a=document.documentElement;s!=null&&s!=l&&s!=a&&!r;){var o=mxUtils.getCurrentStyle(s);o!=null&&(r=r||o.position=="fixed"),s=s.parentNode}if(!e&&!r){var u=mxUtils.getDocumentScrollOrigin(t.ownerDocument);i+=u.x,n+=u.y}var p=t.getBoundingClientRect();return p!=null&&(i+=p.left,n+=p.top),new mxPoint(i,n)},getDocumentScrollOrigin:function(t){if(mxClient.IS_QUIRKS)return new mxPoint(t.body.scrollLeft,t.body.scrollTop);var e=t.defaultView||t.parentWindow,i=e!=null&&window.pageXOffset!==void 0?window.pageXOffset:(document.documentElement||document.body.parentNode||document.body).scrollLeft,n=e!=null&&window.pageYOffset!==void 0?window.pageYOffset:(document.documentElement||document.body.parentNode||document.body).scrollTop;return new mxPoint(i,n)},getScrollOrigin:function(t,e,i){e=e??!1,i=i??!0;for(var n=t!=null?t.ownerDocument:document,r=n.body,s=n.documentElement,l=new mxPoint,a=!1;t!=null&&t!=r&&t!=s;){!isNaN(t.scrollLeft)&&!isNaN(t.scrollTop)&&(l.x+=t.scrollLeft,l.y+=t.scrollTop);var o=mxUtils.getCurrentStyle(t);o!=null&&(a=a||o.position=="fixed"),t=e?t.parentNode:null}if(!a&&i){var u=mxUtils.getDocumentScrollOrigin(n);l.x+=u.x,l.y+=u.y}return l},convertPoint:function(t,e,i){var n=mxUtils.getScrollOrigin(t,!1),r=mxUtils.getOffset(t);return r.x-=n.x,r.y-=n.y,new mxPoint(e-r.x,i-r.y)},ltrim:function(t,e){return e=e||"\\s",t!=null?t.replace(new RegExp("^["+e+"]+","g"),""):null},rtrim:function(t,e){return e=e||"\\s",t!=null?t.replace(new RegExp("["+e+"]+$","g"),""):null},trim:function(t,e){return mxUtils.ltrim(mxUtils.rtrim(t,e),e)},isNumeric:function(t){return!isNaN(parseFloat(t))&&isFinite(t)&&(typeof t!="string"||t.toLowerCase().indexOf("0x")<0)},isInteger:function(t){return String(parseInt(t))===String(t)},mod:function(t,e){return(t%e+e)%e},intersection:function(t,e,i,n,r,s,l,a){var o=(a-s)*(i-t)-(l-r)*(n-e),u=(l-r)*(e-s)-(a-s)*(t-r),p=(i-t)*(e-s)-(n-e)*(t-r),m=u/o,d=p/o;if(m>=0&&m<=1&&d>=0&&d<=1){var x=t+m*(i-t),f=e+m*(n-e);return new mxPoint(x,f)}return null},ptSegDistSq:function(t,e,i,n,r,s){i-=t,n-=e,r-=t,s-=e;var l=r*i+s*n,a;l<=0?a=0:(r=i-r,s=n-s,l=r*i+s*n,l<=0?a=0:a=l*l/(i*i+n*n));var o=r*r+s*s-a;return o<0&&(o=0),o},ptLineDist:function(t,e,i,n,r,s){return Math.abs((n-e)*r-(i-t)*s+i*e-n*t)/Math.sqrt((n-e)*(n-e)+(i-t)*(i-t))},relativeCcw:function(t,e,i,n,r,s){i-=t,n-=e,r-=t,s-=e;var l=r*n-s*i;return l==0&&(l=r*i+s*n,l>0&&(r-=i,s-=n,l=r*i+s*n,l<0&&(l=0))),l<0?-1:l>0?1:0},animateChanges:function(t,e){mxEffects.animateChanges.apply(this,arguments)},cascadeOpacity:function(t,e,i){mxEffects.cascadeOpacity.apply(this,arguments)},fadeOut:function(t,e,i,n,r,s){mxEffects.fadeOut.apply(this,arguments)},setOpacity:function(t,e){mxUtils.isVml(t)?e>=100?t.style.filter="":t.style.filter="alpha(opacity="+e/5+")":mxClient.IS_IE&&(typeof document.documentMode>"u"||document.documentMode<9)?e>=100?t.style.filter="":t.style.filter="alpha(opacity="+e+")":t.style.opacity=e/100},createImage:function(t){var e=null;return mxClient.IS_IE6&&document.compatMode!="CSS1Compat"?(e=document.createElement(mxClient.VML_PREFIX+":image"),e.setAttribute("src",t),e.style.borderStyle="none"):(e=document.createElement("img"),e.setAttribute("src",t),e.setAttribute("border","0")),e},sortCells:function(t,e){e=e??!0;var i=new mxDictionary;return t.sort(function(n,r){var s=i.get(n);s==null&&(s=mxCellPath.create(n).split(mxCellPath.PATH_SEPARATOR),i.put(n,s));var l=i.get(r);l==null&&(l=mxCellPath.create(r).split(mxCellPath.PATH_SEPARATOR),i.put(r,l));var a=mxCellPath.compare(s,l);return a==0?0:a>0==e?1:-1}),t},getStylename:function(t){if(t!=null){var e=t.split(";"),i=e[0];if(i.indexOf("=")<0)return i}return""},getStylenames:function(t){var e=[];if(t!=null)for(var i=t.split(";"),n=0;n0&&t.charAt(t.length-1)!=";"&&(t+=";"),t+=e),t},removeStylename:function(t,e){var i=[];if(t!=null)for(var n=t.split(";"),r=0;r=0&&e.push(i[n]);return e.join(";")},setCellStyles:function(t,e,i,n){if(e!=null&&e.length>0){t.beginUpdate();try{for(var r=0;r"u"||i.length>0);if(t==null||t.length==0)n&&(t=e+"="+i+";");else if(t.substring(0,e.length+1)==e+"="){var r=t.indexOf(";");n?t=e+"="+i+(r<0?";":t.substring(r)):t=r<0||r==t.length-1?"":t.substring(r+1)}else{var s=t.indexOf(";"+e+"=");if(s<0){if(n){var l=t.charAt(t.length-1)==";"?"":";";t=t+l+e+"="+i+";"}}else{var r=t.indexOf(";",s+1);n?t=t.substring(0,s+1)+e+"="+i+(r<0?";":t.substring(r)):t=t.substring(0,s)+(r<0?";":t.substring(r))}}return t},setCellStyleFlags:function(t,e,i,n,r){if(e!=null&&e.length>0){t.beginUpdate();try{for(var s=0;s=0?t.substring(l):"")}}return t},getAlignmentAsPoint:function(t,e){var i=-.5,n=-.5;return t==mxConstants.ALIGN_LEFT?i=0:t==mxConstants.ALIGN_RIGHT&&(i=-1),e==mxConstants.ALIGN_TOP?n=0:e==mxConstants.ALIGN_BOTTOM&&(n=-1),new mxPoint(i,n)},getSizeForString:function(t,e,i,n,r){e=e??mxConstants.DEFAULT_FONTSIZE,i=i??mxConstants.DEFAULT_FONTFAMILY;var s=document.createElement("div");if(s.style.fontFamily=i,s.style.fontSize=Math.round(e)+"px",s.style.lineHeight=Math.round(e*mxConstants.LINE_HEIGHT)+"px",r!=null){(r&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(s.style.fontWeight="bold"),(r&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(s.style.fontStyle="italic");var l=[];(r&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&l.push("underline"),(r&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&l.push("line-through"),l.length>0&&(s.style.textDecoration=l.join(" "))}s.style.position="absolute",s.style.visibility="hidden",s.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",s.style.zoom="1",n!=null?(s.style.width=n+"px",s.style.whiteSpace="normal"):s.style.whiteSpace="nowrap",s.innerHTML=t,document.body.appendChild(s);var a=new mxRectangle(0,0,s.offsetWidth,s.offsetHeight);return document.body.removeChild(s),a},getViewXml:function(t,e,i,n,r){if(n=n??0,r=r??0,e=e??1,i==null){var s=t.getModel();i=[s.getRoot()]}var l=t.getView(),a=null,o=l.isEventsEnabled();l.setEventsEnabled(!1);var u=l.drawPane,p=l.overlayPane;t.dialect==mxConstants.DIALECT_SVG?(l.drawPane=document.createElementNS(mxConstants.NS_SVG,"g"),l.canvas.appendChild(l.drawPane),l.overlayPane=document.createElementNS(mxConstants.NS_SVG,"g"),l.canvas.appendChild(l.overlayPane)):(l.drawPane=l.drawPane.cloneNode(!1),l.canvas.appendChild(l.drawPane),l.overlayPane=l.overlayPane.cloneNode(!1),l.canvas.appendChild(l.overlayPane));var m=l.getTranslate();l.translate=new mxPoint(n,r);var d=new mxTemporaryCellStates(t.getView(),e,i);try{var x=new mxCodec;a=x.encode(t.getView())}finally{d.destroy(),l.translate=m,l.canvas.removeChild(l.drawPane),l.canvas.removeChild(l.overlayPane),l.drawPane=u,l.overlayPane=p,l.setEventsEnabled(o)}return a},getScaleForPageCount:function(t,e,i,n){if(t<1)return 1;i=i??mxConstants.PAGE_FORMAT_A4_PORTRAIT,n=n??0;var r=i.width-n*2,s=i.height-n*2,l=e.getGraphBounds().clone(),a=e.getView().getScale();l.width/=a,l.height/=a;var o=l.width,u=l.height,p=1,m=r/s,d=o/u,x=d/m,f=Math.sqrt(t),g=Math.sqrt(x),c=f*g,v=f/g;if(c<1&&v>t){var y=v/t;v=t,c/=y}if(v<1&&c>t){var y=c/t;c=t,v/=y}for(var T=Math.ceil(c)*Math.ceil(v),C=0;T>t;){var S=Math.floor(c)/c,E=Math.floor(v)/v;S==1&&(S=Math.floor(c-1)/c),E==1&&(E=Math.floor(v-1)/v);var y=1;if(S>E?y=S:y=E,c=c*y,v=v*y,T=Math.ceil(c)*Math.ceil(v),C++,C>10)break}var L=r*c;return p=L/o,p*.99999},show:function(t,e,i,n,r,s){if(i=i??0,n=n??0,e==null){var l=window.open();e=l.document}else e.open();document.documentMode==9&&e.writeln('');var a=t.getGraphBounds(),o=Math.ceil(i-a.x),u=Math.ceil(n-a.y);if(r==null&&(r=Math.ceil(a.width+i)+Math.ceil(Math.ceil(a.x)-a.x)),s==null&&(s=Math.ceil(a.height+n)+Math.ceil(Math.ceil(a.y)-a.y)),mxClient.IS_IE||document.documentMode==11){for(var p="",m=document.getElementsByTagName("base"),d=0;d";for(var d=0;d',p+='
',p+=t.container.innerHTML,p+="
",e.writeln(p),e.close()}else{e.writeln("");for(var m=document.getElementsByTagName("base"),d=0;d'),e.close();var g=e.createElement("div");g.position="absolute",g.overflow="hidden",g.style.width=r+"px",g.style.height=s+"px";var c=e.createElement("div");c.style.position="absolute",c.style.left=o+"px",c.style.top=u+"px";for(var v=t.container.firstChild,y=null;v!=null;){var T=v.cloneNode(!0);v==t.view.drawPane.ownerSVGElement?(g.appendChild(T),y=T):c.appendChild(T),v=v.nextSibling}e.body.appendChild(g),c.firstChild!=null&&e.body.appendChild(c),y!=null&&(y.style.minWidth="",y.style.minHeight="",y.firstChild.setAttribute("transform","translate("+o+","+u+")"))}return mxUtils.removeCursors(e.body),e},printScreen:function(t){var e=window.open();t.getGraphBounds(),mxUtils.show(t,e.document);var i=function(){e.focus(),e.print(),e.close()};mxClient.IS_GC?e.setTimeout(i,500):i()},popup:function(t,e){if(e){var i=document.createElement("div");i.style.overflow="scroll",i.style.width="636px",i.style.height="460px";var n=document.createElement("pre");n.innerHTML=mxUtils.htmlEntities(t,!1).replace(/\n/g,"
").replace(/ /g," "),i.appendChild(n);var r=document.body.clientWidth,s=Math.max(document.body.clientHeight||0,document.documentElement.clientHeight),l=new mxWindow("Popup Window",i,r/2-320,s/2-240,640,480,!1,!0);l.setClosable(!0),l.setVisible(!0)}else if(mxClient.IS_NS){var l=window.open();l.document.writeln("
"+mxUtils.htmlEntities(t)+"").replace(/ /g," "),l.document.body.appendChild(n)}},alert:function(t){alert(t)},prompt:function(t,e){return prompt(t,e??"")},confirm:function(t){return confirm(t)},error:function(t,e,i,n){var r=document.createElement("div");r.style.padding="20px";var s=document.createElement("img");s.setAttribute("src",n||mxUtils.errorImage),s.setAttribute("valign","bottom"),s.style.verticalAlign="middle",r.appendChild(s),r.appendChild(document.createTextNode(" ")),r.appendChild(document.createTextNode(" ")),r.appendChild(document.createTextNode(" ")),mxUtils.write(r,t);var l=document.body.clientWidth,a=document.body.clientHeight||document.documentElement.clientHeight,o=new mxWindow(mxResources.get(mxUtils.errorResource)||mxUtils.errorResource,r,(l-e)/2,a/4,e,null,!1,!0);if(i){mxUtils.br(r);var u=document.createElement("p"),p=document.createElement("button");mxClient.IS_IE?p.style.cssText="float:right":p.setAttribute("style","float:right"),mxEvent.addListener(p,"click",function(m){o.destroy()}),mxUtils.write(p,mxResources.get(mxUtils.closeResource)||mxUtils.closeResource),u.appendChild(p),r.appendChild(u),mxUtils.br(r),o.setClosable(!0)}return o.setVisible(!0),o},makeDraggable:function(t,e,i,n,r,s,l,a,o,u){var p=new mxDragSource(t,i);return p.dragOffset=new mxPoint(r??0,s??mxConstants.TOOLTIP_VERTICAL_OFFSET),p.autoscroll=l,p.setGuidesEnabled(!1),o!=null&&(p.highlightDropTargets=o),u!=null&&(p.getDropTarget=u),p.getGraphForEvent=function(m){return typeof e=="function"?e(m):e},n!=null&&(p.createDragElement=function(){return n.cloneNode(!0)},a&&(p.createPreviewElement=function(m){var d=n.cloneNode(!0),x=parseInt(d.style.width),f=parseInt(d.style.height);return d.style.width=Math.round(x*m.view.scale)+"px",d.style.height=Math.round(f*m.view.scale)+"px",d})),p}};__mxOutput.mxUtils=typeof mxUtils<"u"?mxUtils:void 0;var mxConstants={DEFAULT_HOTSPOT:.3,MIN_HOTSPOT_SIZE:8,MAX_HOTSPOT_SIZE:0,RENDERING_HINT_EXACT:"exact",RENDERING_HINT_FASTER:"faster",RENDERING_HINT_FASTEST:"fastest",DIALECT_SVG:"svg",DIALECT_VML:"vml",DIALECT_MIXEDHTML:"mixedHtml",DIALECT_PREFERHTML:"preferHtml",DIALECT_STRICTHTML:"strictHtml",NS_SVG:"http://www.w3.org/2000/svg",NS_XHTML:"http://www.w3.org/1999/xhtml",NS_XLINK:"http://www.w3.org/1999/xlink",SHADOWCOLOR:"gray",VML_SHADOWCOLOR:"gray",SHADOW_OFFSET_X:2,SHADOW_OFFSET_Y:3,SHADOW_OPACITY:1,NODETYPE_ELEMENT:1,NODETYPE_ATTRIBUTE:2,NODETYPE_TEXT:3,NODETYPE_CDATA:4,NODETYPE_ENTITY_REFERENCE:5,NODETYPE_ENTITY:6,NODETYPE_PROCESSING_INSTRUCTION:7,NODETYPE_COMMENT:8,NODETYPE_DOCUMENT:9,NODETYPE_DOCUMENTTYPE:10,NODETYPE_DOCUMENT_FRAGMENT:11,NODETYPE_NOTATION:12,TOOLTIP_VERTICAL_OFFSET:16,DEFAULT_VALID_COLOR:"#00FF00",DEFAULT_INVALID_COLOR:"#FF0000",OUTLINE_HIGHLIGHT_COLOR:"#00FF00",OUTLINE_HIGHLIGHT_STROKEWIDTH:5,HIGHLIGHT_STROKEWIDTH:3,HIGHLIGHT_SIZE:2,HIGHLIGHT_OPACITY:100,CURSOR_MOVABLE_VERTEX:"move",CURSOR_MOVABLE_EDGE:"move",CURSOR_LABEL_HANDLE:"default",CURSOR_TERMINAL_HANDLE:"pointer",CURSOR_BEND_HANDLE:"crosshair",CURSOR_VIRTUAL_BEND_HANDLE:"crosshair",CURSOR_CONNECT:"pointer",HIGHLIGHT_COLOR:"#00FF00",CONNECT_TARGET_COLOR:"#0000FF",INVALID_CONNECT_TARGET_COLOR:"#FF0000",DROP_TARGET_COLOR:"#0000FF",VALID_COLOR:"#00FF00",INVALID_COLOR:"#FF0000",EDGE_SELECTION_COLOR:"#00FF00",VERTEX_SELECTION_COLOR:"#00FF00",VERTEX_SELECTION_STROKEWIDTH:1,EDGE_SELECTION_STROKEWIDTH:1,VERTEX_SELECTION_DASHED:!0,EDGE_SELECTION_DASHED:!0,GUIDE_COLOR:"#FF0000",GUIDE_STROKEWIDTH:1,OUTLINE_COLOR:"#0099FF",OUTLINE_STROKEWIDTH:mxClient.IS_IE?2:3,HANDLE_SIZE:6,LABEL_HANDLE_SIZE:4,HANDLE_FILLCOLOR:"#00FF00",HANDLE_STROKECOLOR:"black",LABEL_HANDLE_FILLCOLOR:"yellow",CONNECT_HANDLE_FILLCOLOR:"#0000FF",LOCKED_HANDLE_FILLCOLOR:"#FF0000",OUTLINE_HANDLE_FILLCOLOR:"#00FFFF",OUTLINE_HANDLE_STROKECOLOR:"#0033FF",DEFAULT_FONTFAMILY:"Arial,Helvetica",DEFAULT_FONTSIZE:11,DEFAULT_TEXT_DIRECTION:"",LINE_HEIGHT:1.2,WORD_WRAP:"normal",ABSOLUTE_LINE_HEIGHT:!1,DEFAULT_FONTSTYLE:0,DEFAULT_STARTSIZE:40,DEFAULT_MARKERSIZE:6,DEFAULT_IMAGESIZE:24,ENTITY_SEGMENT:30,RECTANGLE_ROUNDING_FACTOR:.15,LINE_ARCSIZE:20,ARROW_SPACING:0,ARROW_WIDTH:30,ARROW_SIZE:30,PAGE_FORMAT_A4_PORTRAIT:new mxRectangle(0,0,827,1169),PAGE_FORMAT_A4_LANDSCAPE:new mxRectangle(0,0,1169,827),PAGE_FORMAT_LETTER_PORTRAIT:new mxRectangle(0,0,850,1100),PAGE_FORMAT_LETTER_LANDSCAPE:new mxRectangle(0,0,1100,850),NONE:"none",STYLE_PERIMETER:"perimeter",STYLE_SOURCE_PORT:"sourcePort",STYLE_TARGET_PORT:"targetPort",STYLE_PORT_CONSTRAINT:"portConstraint",STYLE_PORT_CONSTRAINT_ROTATION:"portConstraintRotation",STYLE_SOURCE_PORT_CONSTRAINT:"sourcePortConstraint",STYLE_TARGET_PORT_CONSTRAINT:"targetPortConstraint",STYLE_OPACITY:"opacity",STYLE_FILL_OPACITY:"fillOpacity",STYLE_STROKE_OPACITY:"strokeOpacity",STYLE_TEXT_OPACITY:"textOpacity",STYLE_TEXT_DIRECTION:"textDirection",STYLE_OVERFLOW:"overflow",STYLE_ORTHOGONAL:"orthogonal",STYLE_EXIT_X:"exitX",STYLE_EXIT_Y:"exitY",STYLE_EXIT_DX:"exitDx",STYLE_EXIT_DY:"exitDy",STYLE_EXIT_PERIMETER:"exitPerimeter",STYLE_ENTRY_X:"entryX",STYLE_ENTRY_Y:"entryY",STYLE_ENTRY_DX:"entryDx",STYLE_ENTRY_DY:"entryDy",STYLE_ENTRY_PERIMETER:"entryPerimeter",STYLE_WHITE_SPACE:"whiteSpace",STYLE_ROTATION:"rotation",STYLE_FILLCOLOR:"fillColor",STYLE_POINTER_EVENTS:"pointerEvents",STYLE_SWIMLANE_FILLCOLOR:"swimlaneFillColor",STYLE_MARGIN:"margin",STYLE_GRADIENTCOLOR:"gradientColor",STYLE_GRADIENT_DIRECTION:"gradientDirection",STYLE_STROKECOLOR:"strokeColor",STYLE_SEPARATORCOLOR:"separatorColor",STYLE_STROKEWIDTH:"strokeWidth",STYLE_ALIGN:"align",STYLE_VERTICAL_ALIGN:"verticalAlign",STYLE_LABEL_WIDTH:"labelWidth",STYLE_LABEL_POSITION:"labelPosition",STYLE_VERTICAL_LABEL_POSITION:"verticalLabelPosition",STYLE_IMAGE_ASPECT:"imageAspect",STYLE_IMAGE_ALIGN:"imageAlign",STYLE_IMAGE_VERTICAL_ALIGN:"imageVerticalAlign",STYLE_GLASS:"glass",STYLE_IMAGE:"image",STYLE_IMAGE_WIDTH:"imageWidth",STYLE_IMAGE_HEIGHT:"imageHeight",STYLE_IMAGE_BACKGROUND:"imageBackground",STYLE_IMAGE_BORDER:"imageBorder",STYLE_FLIPH:"flipH",STYLE_FLIPV:"flipV",STYLE_NOLABEL:"noLabel",STYLE_NOEDGESTYLE:"noEdgeStyle",STYLE_LABEL_BACKGROUNDCOLOR:"labelBackgroundColor",STYLE_LABEL_BORDERCOLOR:"labelBorderColor",STYLE_LABEL_PADDING:"labelPadding",STYLE_INDICATOR_SHAPE:"indicatorShape",STYLE_INDICATOR_IMAGE:"indicatorImage",STYLE_INDICATOR_COLOR:"indicatorColor",STYLE_INDICATOR_STROKECOLOR:"indicatorStrokeColor",STYLE_INDICATOR_GRADIENTCOLOR:"indicatorGradientColor",STYLE_INDICATOR_SPACING:"indicatorSpacing",STYLE_INDICATOR_WIDTH:"indicatorWidth",STYLE_INDICATOR_HEIGHT:"indicatorHeight",STYLE_INDICATOR_DIRECTION:"indicatorDirection",STYLE_SHADOW:"shadow",STYLE_SEGMENT:"segment",STYLE_ENDARROW:"endArrow",STYLE_STARTARROW:"startArrow",STYLE_ENDSIZE:"endSize",STYLE_STARTSIZE:"startSize",STYLE_SWIMLANE_LINE:"swimlaneLine",STYLE_ENDFILL:"endFill",STYLE_STARTFILL:"startFill",STYLE_DASHED:"dashed",STYLE_DASH_PATTERN:"dashPattern",STYLE_FIX_DASH:"fixDash",STYLE_ROUNDED:"rounded",STYLE_CURVED:"curved",STYLE_ARCSIZE:"arcSize",STYLE_ABSOLUTE_ARCSIZE:"absoluteArcSize",STYLE_SOURCE_PERIMETER_SPACING:"sourcePerimeterSpacing",STYLE_TARGET_PERIMETER_SPACING:"targetPerimeterSpacing",STYLE_PERIMETER_SPACING:"perimeterSpacing",STYLE_SPACING:"spacing",STYLE_SPACING_TOP:"spacingTop",STYLE_SPACING_LEFT:"spacingLeft",STYLE_SPACING_BOTTOM:"spacingBottom",STYLE_SPACING_RIGHT:"spacingRight",STYLE_HORIZONTAL:"horizontal",STYLE_DIRECTION:"direction",STYLE_ANCHOR_POINT_DIRECTION:"anchorPointDirection",STYLE_ELBOW:"elbow",STYLE_FONTCOLOR:"fontColor",STYLE_FONTFAMILY:"fontFamily",STYLE_FONTSIZE:"fontSize",STYLE_FONTSTYLE:"fontStyle",STYLE_ASPECT:"aspect",STYLE_AUTOSIZE:"autosize",STYLE_FOLDABLE:"foldable",STYLE_EDITABLE:"editable",STYLE_BACKGROUND_OUTLINE:"backgroundOutline",STYLE_BENDABLE:"bendable",STYLE_MOVABLE:"movable",STYLE_RESIZABLE:"resizable",STYLE_RESIZE_WIDTH:"resizeWidth",STYLE_RESIZE_HEIGHT:"resizeHeight",STYLE_ROTATABLE:"rotatable",STYLE_CLONEABLE:"cloneable",STYLE_DELETABLE:"deletable",STYLE_SHAPE:"shape",STYLE_EDGE:"edgeStyle",STYLE_JETTY_SIZE:"jettySize",STYLE_SOURCE_JETTY_SIZE:"sourceJettySize",STYLE_TARGET_JETTY_SIZE:"targetJettySize",STYLE_LOOP:"loopStyle",STYLE_ORTHOGONAL_LOOP:"orthogonalLoop",STYLE_ROUTING_CENTER_X:"routingCenterX",STYLE_ROUTING_CENTER_Y:"routingCenterY",FONT_BOLD:1,FONT_ITALIC:2,FONT_UNDERLINE:4,FONT_STRIKETHROUGH:8,SHAPE_RECTANGLE:"rectangle",SHAPE_ELLIPSE:"ellipse",SHAPE_DOUBLE_ELLIPSE:"doubleEllipse",SHAPE_RHOMBUS:"rhombus",SHAPE_LINE:"line",SHAPE_IMAGE:"image",SHAPE_ARROW:"arrow",SHAPE_ARROW_CONNECTOR:"arrowConnector",SHAPE_LABEL:"label",SHAPE_CYLINDER:"cylinder",SHAPE_SWIMLANE:"swimlane",SHAPE_CONNECTOR:"connector",SHAPE_ACTOR:"actor",SHAPE_CLOUD:"cloud",SHAPE_TRIANGLE:"triangle",SHAPE_HEXAGON:"hexagon",ARROW_CLASSIC:"classic",ARROW_CLASSIC_THIN:"classicThin",ARROW_BLOCK:"block",ARROW_BLOCK_THIN:"blockThin",ARROW_OPEN:"open",ARROW_OPEN_THIN:"openThin",ARROW_OVAL:"oval",ARROW_DIAMOND:"diamond",ARROW_DIAMOND_THIN:"diamondThin",ALIGN_LEFT:"left",ALIGN_CENTER:"center",ALIGN_RIGHT:"right",ALIGN_TOP:"top",ALIGN_MIDDLE:"middle",ALIGN_BOTTOM:"bottom",DIRECTION_NORTH:"north",DIRECTION_SOUTH:"south",DIRECTION_EAST:"east",DIRECTION_WEST:"west",TEXT_DIRECTION_DEFAULT:"",TEXT_DIRECTION_AUTO:"auto",TEXT_DIRECTION_LTR:"ltr",TEXT_DIRECTION_RTL:"rtl",DIRECTION_MASK_NONE:0,DIRECTION_MASK_WEST:1,DIRECTION_MASK_NORTH:2,DIRECTION_MASK_SOUTH:4,DIRECTION_MASK_EAST:8,DIRECTION_MASK_ALL:15,ELBOW_VERTICAL:"vertical",ELBOW_HORIZONTAL:"horizontal",EDGESTYLE_ELBOW:"elbowEdgeStyle",EDGESTYLE_ENTITY_RELATION:"entityRelationEdgeStyle",EDGESTYLE_LOOP:"loopEdgeStyle",EDGESTYLE_SIDETOSIDE:"sideToSideEdgeStyle",EDGESTYLE_TOPTOBOTTOM:"topToBottomEdgeStyle",EDGESTYLE_ORTHOGONAL:"orthogonalEdgeStyle",EDGESTYLE_SEGMENT:"segmentEdgeStyle",PERIMETER_ELLIPSE:"ellipsePerimeter",PERIMETER_RECTANGLE:"rectanglePerimeter",PERIMETER_RHOMBUS:"rhombusPerimeter",PERIMETER_HEXAGON:"hexagonPerimeter",PERIMETER_TRIANGLE:"trianglePerimeter"};__mxOutput.mxConstants=typeof mxConstants<"u"?mxConstants:void 0;function mxEventObject(t){this.name=t,this.properties=[];for(var e=1;e0;){var i=e[0];mxEvent.removeListener(t,i.name,i.f)}},addGestureListeners:function(t,e,i,n){e!=null&&mxEvent.addListener(t,mxClient.IS_POINTER?"pointerdown":"mousedown",e),i!=null&&mxEvent.addListener(t,mxClient.IS_POINTER?"pointermove":"mousemove",i),n!=null&&mxEvent.addListener(t,mxClient.IS_POINTER?"pointerup":"mouseup",n),!mxClient.IS_POINTER&&mxClient.IS_TOUCH&&(e!=null&&mxEvent.addListener(t,"touchstart",e),i!=null&&mxEvent.addListener(t,"touchmove",i),n!=null&&mxEvent.addListener(t,"touchend",n))},removeGestureListeners:function(t,e,i,n){e!=null&&mxEvent.removeListener(t,mxClient.IS_POINTER?"pointerdown":"mousedown",e),i!=null&&mxEvent.removeListener(t,mxClient.IS_POINTER?"pointermove":"mousemove",i),n!=null&&mxEvent.removeListener(t,mxClient.IS_POINTER?"pointerup":"mouseup",n),!mxClient.IS_POINTER&&mxClient.IS_TOUCH&&(e!=null&&mxEvent.removeListener(t,"touchstart",e),i!=null&&mxEvent.removeListener(t,"touchmove",i),n!=null&&mxEvent.removeListener(t,"touchend",n))},redirectMouseEvents:function(t,e,i,n,r,s,l){var a=function(o){return typeof i=="function"?i(o):i};mxEvent.addGestureListeners(t,function(o){n!=null?n(o):mxEvent.isConsumed(o)||e.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(o,a(o)))},function(o){r!=null?r(o):mxEvent.isConsumed(o)||e.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(o,a(o)))},function(o){s!=null?s(o):mxEvent.isConsumed(o)||e.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(o,a(o)))}),mxEvent.addListener(t,"dblclick",function(o){if(l!=null)l(o);else if(!mxEvent.isConsumed(o)){var u=a(o);e.dblClick(o,u!=null?u.cell:null)}})},release:function(t){try{if(t!=null){mxEvent.removeAllListeners(t);var e=t.childNodes;if(e!=null)for(var i=e.length,n=0;n.5||Math.abs(a.deltaY)>.5)&&t(a,a.deltaY==0?-a.deltaX>0:-a.deltaY>0)};if(e=e??window,mxClient.IS_SF&&!mxClient.IS_TOUCH){var n=1;mxEvent.addListener(e,"gesturestart",function(a){mxEvent.consume(a),n=1}),mxEvent.addListener(e,"gesturechange",function(a){mxEvent.consume(a);var o=n-a.scale;Math.abs(o)>.2&&(t(a,o<0,!0),n=a.scale)}),mxEvent.addListener(e,"gestureend",function(a){mxEvent.consume(a)})}else{var r=[],s=0,l=0;mxEvent.addGestureListeners(e,mxUtils.bind(this,function(a){!mxEvent.isMouseEvent(a)&&a.pointerId!=null&&r.push(a)}),mxUtils.bind(this,function(a){if(!mxEvent.isMouseEvent(a)&&r.length==2){for(var o=0;omxEvent.PINCH_THRESHOLD||d>mxEvent.PINCH_THRESHOLD){var x=r[0].clientX+(r[1].clientX-r[0].clientX)/2,f=r[0].clientY+(r[1].clientY-r[0].clientY)/2;t(r[0],m>d?u>s:p>l,!0,x,f),s=u,l=p}}}),mxUtils.bind(this,function(a){r=[],s=0,l=0}))}mxEvent.addListener(e,"wheel",i)}},disableContextMenu:function(t){mxEvent.addListener(t,"contextmenu",function(e){return e.preventDefault&&e.preventDefault(),!1})},getSource:function(t){return t.srcElement!=null?t.srcElement:t.target},isConsumed:function(t){return t.isConsumed!=null&&t.isConsumed},isTouchEvent:function(t){return t.pointerType!=null?t.pointerType=="touch"||t.pointerType===t.MSPOINTER_TYPE_TOUCH:t.mozInputSource!=null?t.mozInputSource==5:t.type.indexOf("touch")==0},isPenEvent:function(t){return t.pointerType!=null?t.pointerType=="pen"||t.pointerType===t.MSPOINTER_TYPE_PEN:t.mozInputSource!=null?t.mozInputSource==2:t.type.indexOf("pen")==0},isMultiTouchEvent:function(t){return t.type!=null&&t.type.indexOf("touch")==0&&t.touches!=null&&t.touches.length>1},isMouseEvent:function(t){return t.pointerType!=null?t.pointerType=="mouse"||t.pointerType===t.MSPOINTER_TYPE_MOUSE:t.mozInputSource!=null?t.mozInputSource==1:t.type.indexOf("mouse")==0},isLeftMouseButton:function(t){return"buttons"in t&&(t.type=="mousedown"||t.type=="mousemove")?t.buttons==1:"which"in t?t.which===1:t.button===1},isMiddleMouseButton:function(t){return"which"in t?t.which===2:t.button===4},isRightMouseButton:function(t){return"which"in t?t.which===3:t.button===2},isPopupTrigger:function(t){return mxEvent.isRightMouseButton(t)||mxClient.IS_MAC&&mxEvent.isControlDown(t)&&!mxEvent.isShiftDown(t)&&!mxEvent.isMetaDown(t)&&!mxEvent.isAltDown(t)},isShiftDown:function(t){return t!=null?t.shiftKey:!1},isAltDown:function(t){return t!=null?t.altKey:!1},isControlDown:function(t){return t!=null?t.ctrlKey:!1},isMetaDown:function(t){return t!=null?t.metaKey:!1},getMainEvent:function(t){return(t.type=="touchstart"||t.type=="touchmove")&&t.touches!=null&&t.touches[0]!=null?t=t.touches[0]:t.type=="touchend"&&t.changedTouches!=null&&t.changedTouches[0]!=null&&(t=t.changedTouches[0]),t},getClientX:function(t){return mxEvent.getMainEvent(t).clientX},getClientY:function(t){return mxEvent.getMainEvent(t).clientY},consume:function(t,e,i){e=e??!0,i=i??!0,e&&(t.preventDefault?(i&&t.stopPropagation(),t.preventDefault()):i&&(t.cancelBubble=!0)),t.isConsumed=!0,t.preventDefault||(t.returnValue=!1)},LABEL_HANDLE:-1,ROTATION_HANDLE:-2,CUSTOM_HANDLE:-100,VIRTUAL_HANDLE:-1e5,MOUSE_DOWN:"mouseDown",MOUSE_MOVE:"mouseMove",MOUSE_UP:"mouseUp",ACTIVATE:"activate",RESIZE_START:"resizeStart",RESIZE:"resize",RESIZE_END:"resizeEnd",MOVE_START:"moveStart",MOVE:"move",MOVE_END:"moveEnd",PAN_START:"panStart",PAN:"pan",PAN_END:"panEnd",MINIMIZE:"minimize",NORMALIZE:"normalize",MAXIMIZE:"maximize",HIDE:"hide",SHOW:"show",CLOSE:"close",DESTROY:"destroy",REFRESH:"refresh",SIZE:"size",SELECT:"select",FIRED:"fired",FIRE_MOUSE_EVENT:"fireMouseEvent",GESTURE:"gesture",TAP_AND_HOLD:"tapAndHold",GET:"get",RECEIVE:"receive",CONNECT:"connect",DISCONNECT:"disconnect",SUSPEND:"suspend",RESUME:"resume",MARK:"mark",ROOT:"root",POST:"post",OPEN:"open",SAVE:"save",BEFORE_ADD_VERTEX:"beforeAddVertex",ADD_VERTEX:"addVertex",AFTER_ADD_VERTEX:"afterAddVertex",DONE:"done",EXECUTE:"execute",EXECUTED:"executed",BEGIN_UPDATE:"beginUpdate",START_EDIT:"startEdit",END_UPDATE:"endUpdate",END_EDIT:"endEdit",BEFORE_UNDO:"beforeUndo",UNDO:"undo",REDO:"redo",CHANGE:"change",NOTIFY:"notify",LAYOUT_CELLS:"layoutCells",CLICK:"click",SCALE:"scale",TRANSLATE:"translate",SCALE_AND_TRANSLATE:"scaleAndTranslate",UP:"up",DOWN:"down",ADD:"add",REMOVE:"remove",CLEAR:"clear",ADD_CELLS:"addCells",CELLS_ADDED:"cellsAdded",MOVE_CELLS:"moveCells",CELLS_MOVED:"cellsMoved",RESIZE_CELLS:"resizeCells",CELLS_RESIZED:"cellsResized",TOGGLE_CELLS:"toggleCells",CELLS_TOGGLED:"cellsToggled",ORDER_CELLS:"orderCells",CELLS_ORDERED:"cellsOrdered",REMOVE_CELLS:"removeCells",CELLS_REMOVED:"cellsRemoved",GROUP_CELLS:"groupCells",UNGROUP_CELLS:"ungroupCells",REMOVE_CELLS_FROM_PARENT:"removeCellsFromParent",FOLD_CELLS:"foldCells",CELLS_FOLDED:"cellsFolded",ALIGN_CELLS:"alignCells",LABEL_CHANGED:"labelChanged",CONNECT_CELL:"connectCell",CELL_CONNECTED:"cellConnected",SPLIT_EDGE:"splitEdge",FLIP_EDGE:"flipEdge",START_EDITING:"startEditing",EDITING_STARTED:"editingStarted",EDITING_STOPPED:"editingStopped",ADD_OVERLAY:"addOverlay",REMOVE_OVERLAY:"removeOverlay",UPDATE_CELL_SIZE:"updateCellSize",ESCAPE:"escape",DOUBLE_CLICK:"doubleClick",START:"start",RESET:"reset",PINCH_THRESHOLD:10};__mxOutput.mxEvent=typeof mxEvent<"u"?mxEvent:void 0;function mxXmlRequest(t,e,i,n,r,s){this.url=t,this.params=e,this.method=i||"POST",this.async=n??!0,this.username=r,this.password=s}mxXmlRequest.prototype.url=null,mxXmlRequest.prototype.params=null,mxXmlRequest.prototype.method=null,mxXmlRequest.prototype.async=null,mxXmlRequest.prototype.binary=!1,mxXmlRequest.prototype.withCredentials=!1,mxXmlRequest.prototype.username=null,mxXmlRequest.prototype.password=null,mxXmlRequest.prototype.request=null,mxXmlRequest.prototype.decodeSimulateValues=!1,mxXmlRequest.prototype.isBinary=function(){return this.binary},mxXmlRequest.prototype.setBinary=function(t){this.binary=t},mxXmlRequest.prototype.getText=function(){return this.request.responseText},mxXmlRequest.prototype.isReady=function(){return this.request.readyState==4},mxXmlRequest.prototype.getDocumentElement=function(){var t=this.getXml();return t!=null?t.documentElement:null},mxXmlRequest.prototype.getXml=function(){var t=this.request.responseXML;return(document.documentMode>=9||t==null||t.documentElement==null)&&(t=mxUtils.parseXml(this.request.responseText)),t},mxXmlRequest.prototype.getStatus=function(){return this.request!=null?this.request.status:null},mxXmlRequest.prototype.create=function(){if(window.XMLHttpRequest)return function(){var t=new XMLHttpRequest;return this.isBinary()&&t.overrideMimeType&&t.overrideMimeType("text/plain; charset=x-user-defined"),t};if(typeof ActiveXObject<"u")return function(){return new ActiveXObject("Microsoft.XMLHTTP")}}(),mxXmlRequest.prototype.send=function(t,e,i,n){this.request=this.create(),this.request!=null&&(t!=null&&(this.request.onreadystatechange=mxUtils.bind(this,function(){this.isReady()&&(t(this),this.request.onreadystatechange=null)})),this.request.open(this.method,this.url,this.async,this.username,this.password),this.setRequestHeaders(this.request,this.params),window.XMLHttpRequest&&this.withCredentials&&(this.request.withCredentials="true"),!mxClient.IS_QUIRKS&&(document.documentMode==null||document.documentMode>9)&&window.XMLHttpRequest&&i!=null&&n!=null&&(this.request.timeout=i,this.request.ontimeout=n),this.request.send(this.params))},mxXmlRequest.prototype.setRequestHeaders=function(t,e){e!=null&&t.setRequestHeader("Content-Type","application/x-www-form-urlencoded")},mxXmlRequest.prototype.simulate=function(t,e){t=t||document;var i=null;t==document&&(i=window.onbeforeunload,window.onbeforeunload=null);var n=t.createElement("form");n.setAttribute("method",this.method),n.setAttribute("action",this.url),e!=null&&n.setAttribute("target",e),n.style.display="none",n.style.visibility="hidden";for(var r=this.params.indexOf("&")>0?this.params.split("&"):this.params.split(),s=0;s0){var a=r[s].substring(0,l),o=r[s].substring(l+1);this.decodeSimulateValues&&(o=decodeURIComponent(o));var u=t.createElement("textarea");u.setAttribute("wrap","off"),u.setAttribute("name",a),mxUtils.write(u,o),n.appendChild(u)}}t.body.appendChild(n),n.submit(),n.parentNode!=null&&n.parentNode.removeChild(n),i!=null&&(window.onbeforeunload=i)},__mxOutput.mxXmlRequest=typeof mxXmlRequest<"u"?mxXmlRequest:void 0;var mxClipboard={STEPSIZE:10,insertCount:1,cells:null,setCells:function(t){mxClipboard.cells=t},getCells:function(){return mxClipboard.cells},isEmpty:function(){return mxClipboard.getCells()==null},cut:function(t,e){return e=mxClipboard.copy(t,e),mxClipboard.insertCount=0,mxClipboard.removeCells(t,e),e},removeCells:function(t,e){t.removeCells(e)},copy:function(t,e){e=e||t.getSelectionCells();var i=t.getExportableCells(t.model.getTopmostCells(e));return mxClipboard.insertCount=1,mxClipboard.setCells(t.cloneCells(i)),i},paste:function(t){var e=null;if(!mxClipboard.isEmpty()){e=t.getImportableCells(mxClipboard.getCells());var i=mxClipboard.insertCount*mxClipboard.STEPSIZE,n=t.getDefaultParent();e=t.importCells(e,i,i,n),mxClipboard.insertCount++,t.setSelectionCells(e)}return e}};__mxOutput.mxClipboard=typeof mxClipboard<"u"?mxClipboard:void 0;function mxWindow(t,e,i,n,r,s,l,a,o,u){e!=null&&(l=l??!0,this.content=e,this.init(i,n,r,s,u),this.installMaximizeHandler(),this.installMinimizeHandler(),this.installCloseHandler(),this.setMinimizable(l),this.setTitle(t),(a==null||a)&&this.installMoveHandler(),o!=null&&o.parentNode!=null?o.parentNode.replaceChild(this.div,o):document.body.appendChild(this.div))}mxWindow.prototype=new mxEventSource,mxWindow.prototype.constructor=mxWindow,mxWindow.prototype.closeImage=mxClient.imageBasePath+"/close.gif",mxWindow.prototype.minimizeImage=mxClient.imageBasePath+"/minimize.gif",mxWindow.prototype.normalizeImage=mxClient.imageBasePath+"/normalize.gif",mxWindow.prototype.maximizeImage=mxClient.imageBasePath+"/maximize.gif",mxWindow.prototype.resizeImage=mxClient.imageBasePath+"/resize.gif",mxWindow.prototype.visible=!1,mxWindow.prototype.minimumSize=new mxRectangle(0,0,50,40),mxWindow.prototype.destroyOnClose=!0,mxWindow.prototype.contentHeightCorrection=document.documentMode==8||document.documentMode==7?6:2,mxWindow.prototype.title=null,mxWindow.prototype.content=null,mxWindow.prototype.init=function(t,e,i,n,r){r=r??"mxWindow",this.div=document.createElement("div"),this.div.className=r,this.div.style.left=t+"px",this.div.style.top=e+"px",this.table=document.createElement("table"),this.table.className=r,mxClient.IS_POINTER&&(this.div.style.touchAction="none"),i!=null&&(mxClient.IS_QUIRKS||(this.div.style.width=i+"px"),this.table.style.width=i+"px"),n!=null&&(mxClient.IS_QUIRKS||(this.div.style.height=n+"px"),this.table.style.height=n+"px");var s=document.createElement("tbody"),l=document.createElement("tr");this.title=document.createElement("td"),this.title.className=r+"Title",this.buttons=document.createElement("div"),this.buttons.style.position="absolute",this.buttons.style.display="inline-block",this.buttons.style.right="4px",this.buttons.style.top="5px",this.title.appendChild(this.buttons),l.appendChild(this.title),s.appendChild(l),l=document.createElement("tr"),this.td=document.createElement("td"),this.td.className=r+"Pane",document.documentMode==7&&(this.td.style.height="100%"),this.contentWrapper=document.createElement("div"),this.contentWrapper.className=r+"Pane",this.contentWrapper.style.width="100%",this.contentWrapper.appendChild(this.content),(mxClient.IS_QUIRKS||this.content.nodeName.toUpperCase()!="DIV")&&(this.contentWrapper.style.height="100%"),this.td.appendChild(this.contentWrapper),l.appendChild(this.td),s.appendChild(l),this.table.appendChild(s),this.div.appendChild(this.table);var a=mxUtils.bind(this,function(o){this.activate()});mxEvent.addGestureListeners(this.title,a),mxEvent.addGestureListeners(this.table,a),this.hide()},mxWindow.prototype.setTitle=function(t){for(var e=this.title.firstChild;e!=null;){var i=e.nextSibling;e.nodeType==mxConstants.NODETYPE_TEXT&&e.parentNode.removeChild(e),e=i}mxUtils.write(this.title,t||""),this.title.appendChild(this.buttons)},mxWindow.prototype.setScrollable=function(t){(navigator.userAgent==null||navigator.userAgent.indexOf("Presto/2.5")<0)&&(t?this.contentWrapper.style.overflow="auto":this.contentWrapper.style.overflow="hidden")},mxWindow.prototype.activate=function(){if(mxWindow.activeWindow!=this){var t=mxUtils.getCurrentStyle(this.getElement()),e=t!=null?t.zIndex:3;if(mxWindow.activeWindow){var i=mxWindow.activeWindow.getElement();i!=null&&i.style!=null&&(i.style.zIndex=e)}var n=mxWindow.activeWindow;this.getElement().style.zIndex=parseInt(e)+1,mxWindow.activeWindow=this,this.fireEvent(new mxEventObject(mxEvent.ACTIVATE,"previousWindow",n))}},mxWindow.prototype.getElement=function(){return this.div},mxWindow.prototype.fit=function(){mxUtils.fit(this.div)},mxWindow.prototype.isResizable=function(){return this.resize!=null?this.resize.style.display!="none":!1},mxWindow.prototype.setResizable=function(t){if(t)if(this.resize==null){this.resize=document.createElement("img"),this.resize.style.position="absolute",this.resize.style.bottom="2px",this.resize.style.right="2px",this.resize.setAttribute("src",this.resizeImage),this.resize.style.cursor="nw-resize";var e=null,i=null,n=null,r=null,s=mxUtils.bind(this,function(o){this.activate(),e=mxEvent.getClientX(o),i=mxEvent.getClientY(o),n=this.div.offsetWidth,r=this.div.offsetHeight,mxEvent.addGestureListeners(document,null,l,a),this.fireEvent(new mxEventObject(mxEvent.RESIZE_START,"event",o)),mxEvent.consume(o)}),l=mxUtils.bind(this,function(o){if(e!=null&&i!=null){var u=mxEvent.getClientX(o)-e,p=mxEvent.getClientY(o)-i;this.setSize(n+u,r+p),this.fireEvent(new mxEventObject(mxEvent.RESIZE,"event",o)),mxEvent.consume(o)}}),a=mxUtils.bind(this,function(o){e!=null&&i!=null&&(e=null,i=null,mxEvent.removeGestureListeners(document,null,l,a),this.fireEvent(new mxEventObject(mxEvent.RESIZE_END,"event",o)),mxEvent.consume(o))});mxEvent.addGestureListeners(this.resize,s,l,a),this.div.appendChild(this.resize)}else this.resize.style.display="inline";else this.resize!=null&&(this.resize.style.display="none")},mxWindow.prototype.setSize=function(t,e){t=Math.max(this.minimumSize.width,t),e=Math.max(this.minimumSize.height,e),mxClient.IS_QUIRKS||(this.div.style.width=t+"px",this.div.style.height=e+"px"),this.table.style.width=t+"px",this.table.style.height=e+"px",mxClient.IS_QUIRKS||(this.contentWrapper.style.height=this.div.offsetHeight-this.title.offsetHeight-this.contentHeightCorrection+"px")},mxWindow.prototype.setMinimizable=function(t){this.minimize.style.display=t?"":"none"},mxWindow.prototype.getMinimumSize=function(){return new mxRectangle(0,0,0,this.title.offsetHeight)},mxWindow.prototype.installMinimizeHandler=function(){this.minimize=document.createElement("img"),this.minimize.setAttribute("src",this.minimizeImage),this.minimize.setAttribute("title","Minimize"),this.minimize.style.cursor="pointer",this.minimize.style.marginLeft="2px",this.minimize.style.display="none",this.buttons.appendChild(this.minimize);var t=!1,e=null,i=null,n=mxUtils.bind(this,function(r){if(this.activate(),t)t=!1,this.minimize.setAttribute("src",this.minimizeImage),this.minimize.setAttribute("title","Minimize"),this.contentWrapper.style.display="",this.maximize.style.display=e,mxClient.IS_QUIRKS||(this.div.style.height=i),this.table.style.height=i,this.resize!=null&&(this.resize.style.visibility=""),this.fireEvent(new mxEventObject(mxEvent.NORMALIZE,"event",r));else{t=!0,this.minimize.setAttribute("src",this.normalizeImage),this.minimize.setAttribute("title","Normalize"),this.contentWrapper.style.display="none",e=this.maximize.style.display,this.maximize.style.display="none",i=this.table.style.height;var s=this.getMinimumSize();s.height>0&&(mxClient.IS_QUIRKS||(this.div.style.height=s.height+"px"),this.table.style.height=s.height+"px"),s.width>0&&(mxClient.IS_QUIRKS||(this.div.style.width=s.width+"px"),this.table.style.width=s.width+"px"),this.resize!=null&&(this.resize.style.visibility="hidden"),this.fireEvent(new mxEventObject(mxEvent.MINIMIZE,"event",r))}mxEvent.consume(r)});mxEvent.addGestureListeners(this.minimize,n)},mxWindow.prototype.setMaximizable=function(t){this.maximize.style.display=t?"":"none"},mxWindow.prototype.installMaximizeHandler=function(){this.maximize=document.createElement("img"),this.maximize.setAttribute("src",this.maximizeImage),this.maximize.setAttribute("title","Maximize"),this.maximize.style.cursor="default",this.maximize.style.marginLeft="2px",this.maximize.style.cursor="pointer",this.maximize.style.display="none",this.buttons.appendChild(this.maximize);var t=!1,e=null,i=null,n=null,r=null,s=null,l=mxUtils.bind(this,function(a){if(this.activate(),this.maximize.style.display!="none"){if(t){if(t=!1,this.maximize.setAttribute("src",this.maximizeImage),this.maximize.setAttribute("title","Maximize"),this.contentWrapper.style.display="",this.minimize.style.display=s,this.div.style.left=e+"px",this.div.style.top=i+"px",!mxClient.IS_QUIRKS){this.div.style.height=n,this.div.style.width=r;var u=mxUtils.getCurrentStyle(this.contentWrapper);(u.overflow=="auto"||this.resize!=null)&&(this.contentWrapper.style.height=this.div.offsetHeight-this.title.offsetHeight-this.contentHeightCorrection+"px")}this.table.style.height=n,this.table.style.width=r,this.resize!=null&&(this.resize.style.visibility=""),this.fireEvent(new mxEventObject(mxEvent.NORMALIZE,"event",a))}else{t=!0,this.maximize.setAttribute("src",this.normalizeImage),this.maximize.setAttribute("title","Normalize"),this.contentWrapper.style.display="",s=this.minimize.style.display,this.minimize.style.display="none",e=parseInt(this.div.style.left),i=parseInt(this.div.style.top),n=this.table.style.height,r=this.table.style.width,this.div.style.left="0px",this.div.style.top="0px";var o=Math.max(document.body.clientHeight||0,document.documentElement.clientHeight||0);if(mxClient.IS_QUIRKS||(this.div.style.width=document.body.clientWidth-2+"px",this.div.style.height=o-2+"px"),this.table.style.width=document.body.clientWidth-2+"px",this.table.style.height=o-2+"px",this.resize!=null&&(this.resize.style.visibility="hidden"),!mxClient.IS_QUIRKS){var u=mxUtils.getCurrentStyle(this.contentWrapper);(u.overflow=="auto"||this.resize!=null)&&(this.contentWrapper.style.height=this.div.offsetHeight-this.title.offsetHeight-this.contentHeightCorrection+"px")}this.fireEvent(new mxEventObject(mxEvent.MAXIMIZE,"event",a))}mxEvent.consume(a)}});mxEvent.addGestureListeners(this.maximize,l),mxEvent.addListener(this.title,"dblclick",l)},mxWindow.prototype.installMoveHandler=function(){this.title.style.cursor="move",mxEvent.addGestureListeners(this.title,mxUtils.bind(this,function(t){var e=mxEvent.getClientX(t),i=mxEvent.getClientY(t),n=this.getX(),r=this.getY(),s=mxUtils.bind(this,function(a){var o=mxEvent.getClientX(a)-e,u=mxEvent.getClientY(a)-i;this.setLocation(n+o,r+u),this.fireEvent(new mxEventObject(mxEvent.MOVE,"event",a)),mxEvent.consume(a)}),l=mxUtils.bind(this,function(a){mxEvent.removeGestureListeners(document,null,s,l),this.fireEvent(new mxEventObject(mxEvent.MOVE_END,"event",a)),mxEvent.consume(a)});mxEvent.addGestureListeners(document,null,s,l),this.fireEvent(new mxEventObject(mxEvent.MOVE_START,"event",t)),mxEvent.consume(t)})),mxClient.IS_POINTER&&(this.title.style.touchAction="none")},mxWindow.prototype.setLocation=function(t,e){this.div.style.left=t+"px",this.div.style.top=e+"px"},mxWindow.prototype.getX=function(){return parseInt(this.div.style.left)},mxWindow.prototype.getY=function(){return parseInt(this.div.style.top)},mxWindow.prototype.installCloseHandler=function(){this.closeImg=document.createElement("img"),this.closeImg.setAttribute("src",this.closeImage),this.closeImg.setAttribute("title","Close"),this.closeImg.style.marginLeft="2px",this.closeImg.style.cursor="pointer",this.closeImg.style.display="none",this.buttons.appendChild(this.closeImg),mxEvent.addGestureListeners(this.closeImg,mxUtils.bind(this,function(t){this.fireEvent(new mxEventObject(mxEvent.CLOSE,"event",t)),this.destroyOnClose?this.destroy():this.setVisible(!1),mxEvent.consume(t)}))},mxWindow.prototype.setImage=function(t){this.image=document.createElement("img"),this.image.setAttribute("src",t),this.image.setAttribute("align","left"),this.image.style.marginRight="4px",this.image.style.marginLeft="0px",this.image.style.marginTop="-2px",this.title.insertBefore(this.image,this.title.firstChild)},mxWindow.prototype.setClosable=function(t){this.closeImg.style.display=t?"":"none"},mxWindow.prototype.isVisible=function(){return this.div!=null?this.div.style.display!="none":!1},mxWindow.prototype.setVisible=function(t){this.div!=null&&this.isVisible()!=t&&(t?this.show():this.hide())},mxWindow.prototype.show=function(){this.div.style.display="",this.activate();var t=mxUtils.getCurrentStyle(this.contentWrapper);!mxClient.IS_QUIRKS&&(t.overflow=="auto"||this.resize!=null)&&this.contentWrapper.style.display!="none"&&(this.contentWrapper.style.height=this.div.offsetHeight-this.title.offsetHeight-this.contentHeightCorrection+"px"),this.fireEvent(new mxEventObject(mxEvent.SHOW))},mxWindow.prototype.hide=function(){this.div.style.display="none",this.fireEvent(new mxEventObject(mxEvent.HIDE))},mxWindow.prototype.destroy=function(){this.fireEvent(new mxEventObject(mxEvent.DESTROY)),this.div!=null&&(mxEvent.release(this.div),this.div.parentNode.removeChild(this.div),this.div=null),this.title=null,this.content=null,this.contentWrapper=null},__mxOutput.mxWindow=typeof mxWindow<"u"?mxWindow:void 0;function mxForm(t){this.table=document.createElement("table"),this.table.className=t,this.body=document.createElement("tbody"),this.table.appendChild(this.body)}mxForm.prototype.table=null,mxForm.prototype.body=!1,mxForm.prototype.getTable=function(){return this.table},mxForm.prototype.addButtons=function(t,e){var i=document.createElement("tr"),n=document.createElement("td");i.appendChild(n),n=document.createElement("td");var r=document.createElement("button");mxUtils.write(r,mxResources.get("ok")||"OK"),n.appendChild(r),mxEvent.addListener(r,"click",function(){t()}),r=document.createElement("button"),mxUtils.write(r,mxResources.get("cancel")||"Cancel"),n.appendChild(r),mxEvent.addListener(r,"click",function(){e()}),i.appendChild(n),this.body.appendChild(i)},mxForm.prototype.addText=function(t,e,i){var n=document.createElement("input");return n.setAttribute("type",i||"text"),n.value=e,this.addField(t,n)},mxForm.prototype.addCheckbox=function(t,e){var i=document.createElement("input");return i.setAttribute("type","checkbox"),this.addField(t,i),e&&(i.checked=!0),i},mxForm.prototype.addTextarea=function(t,e,i){var n=document.createElement("textarea");return mxClient.IS_NS&&i--,n.setAttribute("rows",i||2),n.value=e,this.addField(t,n)},mxForm.prototype.addCombo=function(t,e,i){var n=document.createElement("select");return i!=null&&n.setAttribute("size",i),e&&n.setAttribute("multiple","true"),this.addField(t,n)},mxForm.prototype.addOption=function(t,e,i,n){var r=document.createElement("option");mxUtils.writeln(r,e),r.setAttribute("value",i),n&&r.setAttribute("selected",n),t.appendChild(r)},mxForm.prototype.addField=function(t,e){var i=document.createElement("tr"),n=document.createElement("td");return mxUtils.write(n,t),i.appendChild(n),n=document.createElement("td"),n.appendChild(e),i.appendChild(n),this.body.appendChild(i),e},__mxOutput.mxForm=typeof mxForm<"u"?mxForm:void 0;function mxImage(t,e,i){this.src=t,this.width=e,this.height=i}mxImage.prototype.src=null,mxImage.prototype.width=null,mxImage.prototype.height=null,__mxOutput.mxImage=typeof mxImage<"u"?mxImage:void 0;function mxDivResizer(t,e){if(t.nodeName.toLowerCase()=="div"){e==null&&(e=window),this.div=t;var i=mxUtils.getCurrentStyle(t);i!=null&&(this.resizeWidth=i.width=="auto",this.resizeHeight=i.height=="auto"),mxEvent.addListener(e,"resize",mxUtils.bind(this,function(n){this.handlingResize||(this.handlingResize=!0,this.resize(),this.handlingResize=!1)})),this.resize()}}mxDivResizer.prototype.resizeWidth=!0,mxDivResizer.prototype.resizeHeight=!0,mxDivResizer.prototype.handlingResize=!1,mxDivResizer.prototype.resize=function(){var t=this.getDocumentWidth(),e=this.getDocumentHeight(),i=parseInt(this.div.style.left),n=parseInt(this.div.style.right),r=parseInt(this.div.style.top),s=parseInt(this.div.style.bottom);this.resizeWidth&&!isNaN(i)&&!isNaN(n)&&i>=0&&n>=0&&t-n-i>0&&(this.div.style.width=t-n-i+"px"),this.resizeHeight&&!isNaN(r)&&!isNaN(s)&&r>=0&&s>=0&&e-r-s>0&&(this.div.style.height=e-r-s+"px")},mxDivResizer.prototype.getDocumentWidth=function(){return document.body.clientWidth},mxDivResizer.prototype.getDocumentHeight=function(){return document.body.clientHeight},__mxOutput.mxDivResizer=typeof mxDivResizer<"u"?mxDivResizer:void 0;function mxDragSource(t,e){this.element=t,this.dropHandler=e,mxEvent.addGestureListeners(t,mxUtils.bind(this,function(i){this.mouseDown(i)})),mxEvent.addListener(t,"dragstart",function(i){mxEvent.consume(i)}),this.eventConsumer=function(i,n){var r=n.getProperty("eventName"),s=n.getProperty("event");r!=mxEvent.MOUSE_DOWN&&s.consume()}}mxDragSource.prototype.element=null,mxDragSource.prototype.dropHandler=null,mxDragSource.prototype.dragOffset=null,mxDragSource.prototype.dragElement=null,mxDragSource.prototype.previewElement=null,mxDragSource.prototype.previewOffset=null,mxDragSource.prototype.enabled=!0,mxDragSource.prototype.currentGraph=null,mxDragSource.prototype.currentDropTarget=null,mxDragSource.prototype.currentPoint=null,mxDragSource.prototype.currentGuide=null,mxDragSource.prototype.currentHighlight=null,mxDragSource.prototype.autoscroll=!0,mxDragSource.prototype.guidesEnabled=!0,mxDragSource.prototype.gridEnabled=!0,mxDragSource.prototype.highlightDropTargets=!0,mxDragSource.prototype.dragElementZIndex=100,mxDragSource.prototype.dragElementOpacity=70,mxDragSource.prototype.checkEventSource=!0,mxDragSource.prototype.isEnabled=function(){return this.enabled},mxDragSource.prototype.setEnabled=function(t){this.enabled=t},mxDragSource.prototype.isGuidesEnabled=function(){return this.guidesEnabled},mxDragSource.prototype.setGuidesEnabled=function(t){this.guidesEnabled=t},mxDragSource.prototype.isGridEnabled=function(){return this.gridEnabled},mxDragSource.prototype.setGridEnabled=function(t){this.gridEnabled=t},mxDragSource.prototype.getGraphForEvent=function(t){return null},mxDragSource.prototype.getDropTarget=function(t,e,i,n){return t.getCellAt(e,i)},mxDragSource.prototype.createDragElement=function(t){return this.element.cloneNode(!0)},mxDragSource.prototype.createPreviewElement=function(t){return null},mxDragSource.prototype.isActive=function(){return this.mouseMoveHandler!=null},mxDragSource.prototype.reset=function(){this.currentGraph!=null&&(this.dragExit(this.currentGraph),this.currentGraph=null),this.removeDragElement(),this.removeListeners(),this.stopDrag()},mxDragSource.prototype.mouseDown=function(t){this.enabled&&!mxEvent.isConsumed(t)&&this.mouseMoveHandler==null&&(this.startDrag(t),this.mouseMoveHandler=mxUtils.bind(this,this.mouseMove),this.mouseUpHandler=mxUtils.bind(this,this.mouseUp),mxEvent.addGestureListeners(document,null,this.mouseMoveHandler,this.mouseUpHandler),mxClient.IS_TOUCH&&!mxEvent.isMouseEvent(t)&&(this.eventSource=mxEvent.getSource(t),mxEvent.addGestureListeners(this.eventSource,null,this.mouseMoveHandler,this.mouseUpHandler)))},mxDragSource.prototype.startDrag=function(t){this.dragElement=this.createDragElement(t),this.dragElement.style.position="absolute",this.dragElement.style.zIndex=this.dragElementZIndex,mxUtils.setOpacity(this.dragElement,this.dragElementOpacity),this.checkEventSource&&mxClient.IS_SVG&&(this.dragElement.style.pointerEvents="none")},mxDragSource.prototype.stopDrag=function(){this.removeDragElement()},mxDragSource.prototype.removeDragElement=function(){this.dragElement!=null&&(this.dragElement.parentNode!=null&&this.dragElement.parentNode.removeChild(this.dragElement),this.dragElement=null)},mxDragSource.prototype.getElementForEvent=function(t){return mxEvent.isTouchEvent(t)||mxEvent.isPenEvent(t)?document.elementFromPoint(mxEvent.getClientX(t),mxEvent.getClientY(t)):mxEvent.getSource(t)},mxDragSource.prototype.graphContainsEvent=function(t,e){var i=mxEvent.getClientX(e),n=mxEvent.getClientY(e),r=mxUtils.getOffset(t.container),s=mxUtils.getScrollOrigin(),l=this.getElementForEvent(e);if(this.checkEventSource)for(;l!=null&&l!=t.container;)l=l.parentNode;return l!=null&&i>=r.x-s.x&&n>=r.y-s.y&&i<=r.x-s.x+t.container.offsetWidth&&n<=r.y-s.y+t.container.offsetHeight},mxDragSource.prototype.mouseMove=function(t){var e=this.getGraphForEvent(t);if(e!=null&&!this.graphContainsEvent(e,t)&&(e=null),e!=this.currentGraph&&(this.currentGraph!=null&&this.dragExit(this.currentGraph,t),this.currentGraph=e,this.currentGraph!=null&&this.dragEnter(this.currentGraph,t)),this.currentGraph!=null&&this.dragOver(this.currentGraph,t),this.dragElement!=null&&(this.previewElement==null||this.previewElement.style.visibility!="visible")){var i=mxEvent.getClientX(t),n=mxEvent.getClientY(t);this.dragElement.parentNode==null&&document.body.appendChild(this.dragElement),this.dragElement.style.visibility="visible",this.dragOffset!=null&&(i+=this.dragOffset.x,n+=this.dragOffset.y);var r=mxUtils.getDocumentScrollOrigin(document);this.dragElement.style.left=i+r.x+"px",this.dragElement.style.top=n+r.y+"px"}else this.dragElement!=null&&(this.dragElement.style.visibility="hidden");mxEvent.consume(t)},mxDragSource.prototype.mouseUp=function(t){if(this.currentGraph!=null){if(this.currentPoint!=null&&(this.previewElement==null||this.previewElement.style.visibility!="hidden")){var e=this.currentGraph.view.scale,i=this.currentGraph.view.translate,n=this.currentPoint.x/e-i.x,r=this.currentPoint.y/e-i.y;this.drop(this.currentGraph,t,this.currentDropTarget,n,r)}this.dragExit(this.currentGraph),this.currentGraph=null}this.stopDrag(),this.removeListeners(),mxEvent.consume(t)},mxDragSource.prototype.removeListeners=function(){this.eventSource!=null&&(mxEvent.removeGestureListeners(this.eventSource,null,this.mouseMoveHandler,this.mouseUpHandler),this.eventSource=null),mxEvent.removeGestureListeners(document,null,this.mouseMoveHandler,this.mouseUpHandler),this.mouseMoveHandler=null,this.mouseUpHandler=null},mxDragSource.prototype.dragEnter=function(t,e){t.isMouseDown=!0,t.isMouseTrigger=mxEvent.isMouseEvent(e),this.previewElement=this.createPreviewElement(t),this.previewElement!=null&&this.checkEventSource&&mxClient.IS_SVG&&(this.previewElement.style.pointerEvents="none"),this.isGuidesEnabled()&&this.previewElement!=null&&(this.currentGuide=new mxGuide(t,t.graphHandler.getGuideStates())),this.highlightDropTargets&&(this.currentHighlight=new mxCellHighlight(t,mxConstants.DROP_TARGET_COLOR)),t.addListener(mxEvent.FIRE_MOUSE_EVENT,this.eventConsumer)},mxDragSource.prototype.dragExit=function(t,e){this.currentDropTarget=null,this.currentPoint=null,t.isMouseDown=!1,t.removeListener(this.eventConsumer),this.previewElement!=null&&(this.previewElement.parentNode!=null&&this.previewElement.parentNode.removeChild(this.previewElement),this.previewElement=null),this.currentGuide!=null&&(this.currentGuide.destroy(),this.currentGuide=null),this.currentHighlight!=null&&(this.currentHighlight.destroy(),this.currentHighlight=null)},mxDragSource.prototype.dragOver=function(t,e){var i=mxUtils.getOffset(t.container),n=mxUtils.getScrollOrigin(t.container),r=mxEvent.getClientX(e)-i.x+n.x-t.panDx,s=mxEvent.getClientY(e)-i.y+n.y-t.panDy;if(t.autoScroll&&(this.autoscroll==null||this.autoscroll)&&t.scrollPointToVisible(r,s,t.autoExtend),this.currentHighlight!=null&&t.isDropEnabled()){this.currentDropTarget=this.getDropTarget(t,r,s,e);var l=t.getView().getState(this.currentDropTarget);this.currentHighlight.highlight(l)}if(this.previewElement!=null){this.previewElement.parentNode==null&&(t.container.appendChild(this.previewElement),this.previewElement.style.zIndex="3",this.previewElement.style.position="absolute");var a=this.isGridEnabled()&&t.isGridEnabledEvent(e),o=!0;if(this.currentGuide!=null&&this.currentGuide.isEnabledForEvent(e)){var u=parseInt(this.previewElement.style.width),p=parseInt(this.previewElement.style.height),m=new mxRectangle(0,0,u,p),d=new mxPoint(r,s);d=this.currentGuide.move(m,d,a,!0),o=!1,r=d.x,s=d.y}else if(a){var x=t.view.scale,f=t.view.translate,g=t.gridSize/2;r=(t.snap(r/x-f.x-g)+f.x)*x,s=(t.snap(s/x-f.y-g)+f.y)*x}this.currentGuide!=null&&o&&this.currentGuide.hide(),this.previewOffset!=null&&(r+=this.previewOffset.x,s+=this.previewOffset.y),this.previewElement.style.left=Math.round(r)+"px",this.previewElement.style.top=Math.round(s)+"px",this.previewElement.style.visibility="visible"}this.currentPoint=new mxPoint(r,s)},mxDragSource.prototype.drop=function(t,e,i,n,r){this.dropHandler.apply(this,arguments),t.container.style.visibility!="hidden"&&t.container.focus()},__mxOutput.mxDragSource=typeof mxDragSource<"u"?mxDragSource:void 0;function mxToolbar(t){this.container=t}mxToolbar.prototype=new mxEventSource,mxToolbar.prototype.constructor=mxToolbar,mxToolbar.prototype.container=null,mxToolbar.prototype.enabled=!0,mxToolbar.prototype.noReset=!1,mxToolbar.prototype.updateDefaultMode=!0,mxToolbar.prototype.addItem=function(t,e,i,n,r,s){var l=document.createElement(e!=null?"img":"button"),a=r||(s!=null?"mxToolbarMode":"mxToolbarItem");l.className=a,l.setAttribute("src",e),t!=null&&(e!=null?l.setAttribute("title",t):mxUtils.write(l,t)),this.container.appendChild(l),i!=null&&(mxEvent.addListener(l,"click",i),mxClient.IS_TOUCH&&mxEvent.addListener(l,"touchend",i));var o=mxUtils.bind(this,function(u){n!=null?l.setAttribute("src",e):l.style.backgroundColor=""});return mxEvent.addGestureListeners(l,mxUtils.bind(this,function(u){if(n!=null?l.setAttribute("src",n):l.style.backgroundColor="gray",s!=null){this.menu==null&&(this.menu=new mxPopupMenu,this.menu.init());var p=this.currentImg;if(this.menu.isMenuShowing()&&this.menu.hideMenu(),p!=l){this.currentImg=l,this.menu.factoryMethod=s;var m=new mxPoint(l.offsetLeft,l.offsetTop+l.offsetHeight);this.menu.popup(m.x,m.y,null,u),this.menu.isMenuShowing()&&(l.className=a+"Selected",this.menu.hideMenu=function(){mxPopupMenu.prototype.hideMenu.apply(this),l.className=a,this.currentImg=null})}}}),null,o),mxEvent.addListener(l,"mouseout",o),l},mxToolbar.prototype.addCombo=function(t){var e=document.createElement("div");e.style.display="inline",e.className="mxToolbarComboContainer";var i=document.createElement("select");return i.className=t||"mxToolbarCombo",e.appendChild(i),this.container.appendChild(e),i},mxToolbar.prototype.addActionCombo=function(t,e){var i=document.createElement("select");return i.className=e||"mxToolbarCombo",this.addOption(i,t,null),mxEvent.addListener(i,"change",function(n){var r=i.options[i.selectedIndex];i.selectedIndex=0,r.funct!=null&&r.funct(n)}),this.container.appendChild(i),i},mxToolbar.prototype.addOption=function(t,e,i){var n=document.createElement("option");return mxUtils.writeln(n,e),typeof i=="function"?n.funct=i:n.setAttribute("value",i),t.appendChild(n),n},mxToolbar.prototype.addSwitchMode=function(t,e,i,n,r){var s=document.createElement("img");return s.initialClassName=r||"mxToolbarMode",s.className=s.initialClassName,s.setAttribute("src",e),s.altIcon=n,t!=null&&s.setAttribute("title",t),mxEvent.addListener(s,"click",mxUtils.bind(this,function(l){var a=this.selectedMode.altIcon;a!=null?(this.selectedMode.altIcon=this.selectedMode.getAttribute("src"),this.selectedMode.setAttribute("src",a)):this.selectedMode.className=this.selectedMode.initialClassName,this.updateDefaultMode&&(this.defaultMode=s),this.selectedMode=s;var a=s.altIcon;a!=null?(s.altIcon=s.getAttribute("src"),s.setAttribute("src",a)):s.className=s.initialClassName+"Selected",this.fireEvent(new mxEventObject(mxEvent.SELECT)),i()})),this.container.appendChild(s),this.defaultMode==null&&(this.defaultMode=s,this.selectMode(s),i()),s},mxToolbar.prototype.addMode=function(t,e,i,n,r,s){s=s??!0;var l=document.createElement(e!=null?"img":"button");return l.initialClassName=r||"mxToolbarMode",l.className=l.initialClassName,l.setAttribute("src",e),l.altIcon=n,t!=null&&l.setAttribute("title",t),this.enabled&&s&&(mxEvent.addListener(l,"click",mxUtils.bind(this,function(a){this.selectMode(l,i),this.noReset=!1})),mxEvent.addListener(l,"dblclick",mxUtils.bind(this,function(a){this.selectMode(l,i),this.noReset=!0})),this.defaultMode==null&&(this.defaultMode=l,this.defaultFunction=i,this.selectMode(l,i))),this.container.appendChild(l),l},mxToolbar.prototype.selectMode=function(t,e){if(this.selectedMode!=t){if(this.selectedMode!=null){var i=this.selectedMode.altIcon;i!=null?(this.selectedMode.altIcon=this.selectedMode.getAttribute("src"),this.selectedMode.setAttribute("src",i)):this.selectedMode.className=this.selectedMode.initialClassName}this.selectedMode=t;var i=this.selectedMode.altIcon;i!=null?(this.selectedMode.altIcon=this.selectedMode.getAttribute("src"),this.selectedMode.setAttribute("src",i)):this.selectedMode.className=this.selectedMode.initialClassName+"Selected",this.fireEvent(new mxEventObject(mxEvent.SELECT,"function",e))}},mxToolbar.prototype.resetMode=function(t){(t||!this.noReset)&&this.selectedMode!=this.defaultMode&&this.selectMode(this.defaultMode,this.defaultFunction)},mxToolbar.prototype.addSeparator=function(t){return this.addItem(null,t,null)},mxToolbar.prototype.addBreak=function(){mxUtils.br(this.container)},mxToolbar.prototype.addLine=function(){var t=document.createElement("hr");t.style.marginRight="6px",t.setAttribute("size","1"),this.container.appendChild(t)},mxToolbar.prototype.destroy=function(){mxEvent.release(this.container),this.container=null,this.defaultMode=null,this.defaultFunction=null,this.selectedMode=null,this.menu!=null&&this.menu.destroy()},__mxOutput.mxToolbar=typeof mxToolbar<"u"?mxToolbar:void 0;function mxUndoableEdit(t,e){this.source=t,this.changes=[],this.significant=e??!0}mxUndoableEdit.prototype.source=null,mxUndoableEdit.prototype.changes=null,mxUndoableEdit.prototype.significant=null,mxUndoableEdit.prototype.undone=!1,mxUndoableEdit.prototype.redone=!1,mxUndoableEdit.prototype.isEmpty=function(){return this.changes.length==0},mxUndoableEdit.prototype.isSignificant=function(){return this.significant},mxUndoableEdit.prototype.add=function(t){this.changes.push(t)},mxUndoableEdit.prototype.notify=function(){},mxUndoableEdit.prototype.die=function(){},mxUndoableEdit.prototype.undo=function(){if(!this.undone){this.source.fireEvent(new mxEventObject(mxEvent.START_EDIT));for(var t=this.changes.length,e=t-1;e>=0;e--){var i=this.changes[e];i.execute!=null?i.execute():i.undo!=null&&i.undo(),this.source.fireEvent(new mxEventObject(mxEvent.EXECUTED,"change",i))}this.undone=!0,this.redone=!1,this.source.fireEvent(new mxEventObject(mxEvent.END_EDIT))}this.notify()},mxUndoableEdit.prototype.redo=function(){if(!this.redone){this.source.fireEvent(new mxEventObject(mxEvent.START_EDIT));for(var t=this.changes.length,e=0;e0},mxUndoManager.prototype.undo=function(){for(;this.indexOfNextAdd>0;){var t=this.history[--this.indexOfNextAdd];if(t.undo(),t.isSignificant()){this.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",t));break}}},mxUndoManager.prototype.canRedo=function(){return this.indexOfNextAdd0&&this.size==this.history.length&&this.history.shift(),this.history.push(t),this.indexOfNextAdd=this.history.length,this.fireEvent(new mxEventObject(mxEvent.ADD,"edit",t))},mxUndoManager.prototype.trim=function(){if(this.history.length>this.indexOfNextAdd)for(var t=this.history.splice(this.indexOfNextAdd,this.history.length-this.indexOfNextAdd),e=0;e0&&(this.baseUrl=this.baseUrl.substring(0,t+1))},mxUrlConverter.prototype.isEnabled=function(){return this.enabled},mxUrlConverter.prototype.setEnabled=function(t){this.enabled=t},mxUrlConverter.prototype.getBaseUrl=function(){return this.baseUrl},mxUrlConverter.prototype.setBaseUrl=function(t){this.baseUrl=t},mxUrlConverter.prototype.getBaseDomain=function(){return this.baseDomain},mxUrlConverter.prototype.setBaseDomain=function(t){this.baseDomain=t},mxUrlConverter.prototype.isRelativeUrl=function(t){return t!=null&&t.substring(0,2)!="//"&&t.substring(0,7)!="http://"&&t.substring(0,8)!="https://"&&t.substring(0,10)!="data:image"&&t.substring(0,7)!="file://"},mxUrlConverter.prototype.convert=function(t){return this.isEnabled()&&this.isRelativeUrl(t)&&(this.getBaseUrl()==null&&this.updateBaseUrl(),t.charAt(0)=="/"?t=this.getBaseDomain()+t:t=this.getBaseUrl()+t),t},__mxOutput.mxUrlConverter=typeof mxUrlConverter<"u"?mxUrlConverter:void 0;function mxPanningManager(t){this.thread=null,this.active=!1,this.tdx=0,this.tdy=0,this.t0x=0,this.t0y=0,this.dx=0,this.dy=0,this.scrollbars=!1,this.scrollLeft=0,this.scrollTop=0,this.mouseListener={mouseDown:function(i,n){},mouseMove:function(i,n){},mouseUp:mxUtils.bind(this,function(i,n){this.active&&this.stop()})},t.addMouseListener(this.mouseListener),this.mouseUpListener=mxUtils.bind(this,function(){this.active&&this.stop()}),mxEvent.addListener(document,"mouseup",this.mouseUpListener);var e=mxUtils.bind(this,function(){return this.scrollbars=mxUtils.hasScrollbars(t.container),this.scrollLeft=t.container.scrollLeft,this.scrollTop=t.container.scrollTop,window.setInterval(mxUtils.bind(this,function(){if(this.tdx-=this.dx,this.tdy-=this.dy,this.scrollbars){var i=-t.container.scrollLeft-Math.ceil(this.dx),n=-t.container.scrollTop-Math.ceil(this.dy);t.panGraph(i,n),t.panDx=this.scrollLeft-t.container.scrollLeft,t.panDy=this.scrollTop-t.container.scrollTop,t.fireEvent(new mxEventObject(mxEvent.PAN))}else t.panGraph(this.getDx(),this.getDy())}),this.delay)});this.isActive=function(){return active},this.getDx=function(){return Math.round(this.tdx)},this.getDy=function(){return Math.round(this.tdy)},this.start=function(){this.t0x=t.view.translate.x,this.t0y=t.view.translate.y,this.active=!0},this.panTo=function(i,n,r,s){this.active||this.start(),this.scrollLeft=t.container.scrollLeft,this.scrollTop=t.container.scrollTop,r=r??0,s=s??0;var l=t.container;this.dx=i+r-l.scrollLeft-l.clientWidth,this.dx<0&&Math.abs(this.dx)0&&this.dx0&&this.dya&&(e.div.style.left=Math.max(0,t.div.offsetLeft-n+(mxClient.IS_IE?6:-6))+"px"),mxUtils.fit(e.div)}},mxPopupMenu.prototype.addSeparator=function(t,e){if(t=t||this,this.smartSeparators&&!e)t.willAddSeparator=!0;else if(t.tbody!=null){t.willAddSeparator=!1;var i=document.createElement("tr"),n=document.createElement("td");n.className="mxPopupMenuIcon",n.style.padding="0 0 0 0px",i.appendChild(n);var r=document.createElement("td");r.style.padding="0 0 0 0px",r.setAttribute("colSpan","2");var s=document.createElement("hr");s.setAttribute("size","1"),r.appendChild(s),i.appendChild(r),t.tbody.appendChild(i)}},mxPopupMenu.prototype.popup=function(t,e,i,n){if(this.div!=null&&this.tbody!=null&&this.factoryMethod!=null){for(this.div.style.left=t+"px",this.div.style.top=e+"px";this.tbody.firstChild!=null;)mxEvent.release(this.tbody.firstChild),this.tbody.removeChild(this.tbody.firstChild);this.itemCount=0,this.factoryMethod(this,i,n),this.itemCount>0&&(this.showMenu(),this.fireEvent(new mxEventObject(mxEvent.SHOW)))}},mxPopupMenu.prototype.isMenuShowing=function(){return this.div!=null&&this.div.parentNode==document.body},mxPopupMenu.prototype.showMenu=function(){document.documentMode>=9&&(this.div.style.filter="none"),document.body.appendChild(this.div),mxUtils.fit(this.div)},mxPopupMenu.prototype.hideMenu=function(){this.div!=null&&(this.div.parentNode!=null&&this.div.parentNode.removeChild(this.div),this.hideSubmenu(this),this.containsItems=!1,this.fireEvent(new mxEventObject(mxEvent.HIDE)))},mxPopupMenu.prototype.hideSubmenu=function(t){t.activeRow!=null&&(this.hideSubmenu(t.activeRow),t.activeRow.div.parentNode!=null&&t.activeRow.div.parentNode.removeChild(t.activeRow.div),t.activeRow=null)},mxPopupMenu.prototype.destroy=function(){this.div!=null&&(mxEvent.release(this.div),this.div.parentNode!=null&&this.div.parentNode.removeChild(this.div),this.div=null)},__mxOutput.mxPopupMenu=typeof mxPopupMenu<"u"?mxPopupMenu:void 0;function mxAutoSaveManager(t){this.changeHandler=mxUtils.bind(this,function(e,i){this.isEnabled()&&this.graphModelChanged(i.getProperty("edit").changes)}),this.setGraph(t)}mxAutoSaveManager.prototype=new mxEventSource,mxAutoSaveManager.prototype.constructor=mxAutoSaveManager,mxAutoSaveManager.prototype.graph=null,mxAutoSaveManager.prototype.autoSaveDelay=10,mxAutoSaveManager.prototype.autoSaveThrottle=2,mxAutoSaveManager.prototype.autoSaveThreshold=5,mxAutoSaveManager.prototype.ignoredChanges=0,mxAutoSaveManager.prototype.lastSnapshot=0,mxAutoSaveManager.prototype.enabled=!0,mxAutoSaveManager.prototype.changeHandler=null,mxAutoSaveManager.prototype.isEnabled=function(){return this.enabled},mxAutoSaveManager.prototype.setEnabled=function(t){this.enabled=t},mxAutoSaveManager.prototype.setGraph=function(t){this.graph!=null&&this.graph.getModel().removeListener(this.changeHandler),this.graph=t,this.graph!=null&&this.graph.getModel().addListener(mxEvent.CHANGE,this.changeHandler)},mxAutoSaveManager.prototype.save=function(){},mxAutoSaveManager.prototype.graphModelChanged=function(t){var e=new Date().getTime(),i=(e-this.lastSnapshot)/1e3;i>this.autoSaveDelay||this.ignoredChanges>=this.autoSaveThreshold&&i>this.autoSaveThrottle?(this.save(),this.reset()):this.ignoredChanges++},mxAutoSaveManager.prototype.reset=function(){this.lastSnapshot=new Date().getTime(),this.ignoredChanges=0},mxAutoSaveManager.prototype.destroy=function(){this.setGraph(null)},__mxOutput.mxAutoSaveManager=typeof mxAutoSaveManager<"u"?mxAutoSaveManager:void 0;function mxAnimation(t){this.delay=t??20}mxAnimation.prototype=new mxEventSource,mxAnimation.prototype.constructor=mxAnimation,mxAnimation.prototype.delay=null,mxAnimation.prototype.thread=null,mxAnimation.prototype.isRunning=function(){return this.thread!=null},mxAnimation.prototype.startAnimation=function(){this.thread==null&&(this.thread=window.setInterval(mxUtils.bind(this,this.updateAnimation),this.delay))},mxAnimation.prototype.updateAnimation=function(){this.fireEvent(new mxEventObject(mxEvent.EXECUTE))},mxAnimation.prototype.stopAnimation=function(){this.thread!=null&&(window.clearInterval(this.thread),this.thread=null,this.fireEvent(new mxEventObject(mxEvent.DONE)))},__mxOutput.mxAnimation=typeof mxAnimation<"u"?mxAnimation:void 0;function mxMorphing(t,e,i,n){mxAnimation.call(this,n),this.graph=t,this.steps=e??6,this.ease=i??1.5}mxMorphing.prototype=new mxAnimation,mxMorphing.prototype.constructor=mxMorphing,mxMorphing.prototype.graph=null,mxMorphing.prototype.steps=null,mxMorphing.prototype.step=0,mxMorphing.prototype.ease=null,mxMorphing.prototype.cells=null,mxMorphing.prototype.updateAnimation=function(){mxAnimation.prototype.updateAnimation.apply(this,arguments);var t=new mxCellStatePreview(this.graph);if(this.cells!=null)for(var e=0;e=this.steps)&&this.stopAnimation()},mxMorphing.prototype.show=function(t){t.show()},mxMorphing.prototype.animateCell=function(t,e,i){var n=this.graph.getView().getState(t),r=null;if(n!=null&&(r=this.getDelta(n),this.graph.getModel().isVertex(t)&&(r.x!=0||r.y!=0))){var s=this.graph.view.getTranslate(),l=this.graph.view.getScale();r.x+=s.x*l,r.y+=s.y*l,e.moveState(n,-r.x/this.ease,-r.y/this.ease)}if(i&&!this.stopRecursion(n,r))for(var a=this.graph.getModel().getChildCount(t),o=0;o2))for(var t=this.state,e=2;e0&&(this.state=this.states.pop())},mxAbstractCanvas2D.prototype.setLink=function(t){},mxAbstractCanvas2D.prototype.scale=function(t){this.state.scale*=t,this.state.strokeWidth*=t},mxAbstractCanvas2D.prototype.translate=function(t,e){this.state.dx+=t,this.state.dy+=e},mxAbstractCanvas2D.prototype.rotate=function(t,e,i,n,r){},mxAbstractCanvas2D.prototype.setAlpha=function(t){this.state.alpha=t},mxAbstractCanvas2D.prototype.setFillAlpha=function(t){this.state.fillAlpha=t},mxAbstractCanvas2D.prototype.setStrokeAlpha=function(t){this.state.strokeAlpha=t},mxAbstractCanvas2D.prototype.setFillColor=function(t){t==mxConstants.NONE&&(t=null),this.state.fillColor=t,this.state.gradientColor=null},mxAbstractCanvas2D.prototype.setGradient=function(t,e,i,n,r,s,l,a,o){var u=this.state;u.fillColor=t,u.gradientFillAlpha=a??1,u.gradientColor=e,u.gradientAlpha=o??1,u.gradientDirection=l},mxAbstractCanvas2D.prototype.setStrokeColor=function(t){t==mxConstants.NONE&&(t=null),this.state.strokeColor=t},mxAbstractCanvas2D.prototype.setStrokeWidth=function(t){this.state.strokeWidth=t},mxAbstractCanvas2D.prototype.setDashed=function(t,e){this.state.dashed=t,this.state.fixDash=e},mxAbstractCanvas2D.prototype.setDashPattern=function(t){this.state.dashPattern=t},mxAbstractCanvas2D.prototype.setLineCap=function(t){this.state.lineCap=t},mxAbstractCanvas2D.prototype.setLineJoin=function(t){this.state.lineJoin=t},mxAbstractCanvas2D.prototype.setMiterLimit=function(t){this.state.miterLimit=t},mxAbstractCanvas2D.prototype.setFontColor=function(t){t==mxConstants.NONE&&(t=null),this.state.fontColor=t},mxAbstractCanvas2D.prototype.setFontBackgroundColor=function(t){t==mxConstants.NONE&&(t=null),this.state.fontBackgroundColor=t},mxAbstractCanvas2D.prototype.setFontBorderColor=function(t){t==mxConstants.NONE&&(t=null),this.state.fontBorderColor=t},mxAbstractCanvas2D.prototype.setFontSize=function(t){this.state.fontSize=parseFloat(t)},mxAbstractCanvas2D.prototype.setFontFamily=function(t){this.state.fontFamily=t},mxAbstractCanvas2D.prototype.setFontStyle=function(t){t==null&&(t=0),this.state.fontStyle=t},mxAbstractCanvas2D.prototype.setShadow=function(t){this.state.shadow=t},mxAbstractCanvas2D.prototype.setShadowColor=function(t){t==mxConstants.NONE&&(t=null),this.state.shadowColor=t},mxAbstractCanvas2D.prototype.setShadowAlpha=function(t){this.state.shadowAlpha=t},mxAbstractCanvas2D.prototype.setShadowOffset=function(t,e){this.state.shadowDx=t,this.state.shadowDy=e},mxAbstractCanvas2D.prototype.begin=function(){this.lastX=0,this.lastY=0,this.path=[]},mxAbstractCanvas2D.prototype.moveTo=function(t,e){this.addOp(this.moveOp,t,e)},mxAbstractCanvas2D.prototype.lineTo=function(t,e){this.addOp(this.lineOp,t,e)},mxAbstractCanvas2D.prototype.quadTo=function(t,e,i,n){this.addOp(this.quadOp,t,e,i,n)},mxAbstractCanvas2D.prototype.curveTo=function(t,e,i,n,r,s){this.addOp(this.curveOp,t,e,i,n,r,s)},mxAbstractCanvas2D.prototype.arcTo=function(t,e,i,n,r,s,l){var a=mxUtils.arcToCurves(this.lastX,this.lastY,t,e,i,n,r,s,l);if(a!=null)for(var o=0;o0&&(this.defs=i.getElementsByTagName("defs")[0]),this.defs==null&&(this.defs=this.createElement("defs"),i.firstChild!=null?i.insertBefore(this.defs,i.firstChild):i.appendChild(this.defs)),this.styleEnabled&&this.defs.appendChild(this.createStyle())}}mxUtils.extend(mxSvgCanvas2D,mxAbstractCanvas2D),function(){if(mxSvgCanvas2D.prototype.useDomParser=!mxClient.IS_IE&&typeof DOMParser=="function"&&typeof XMLSerializer=="function",mxSvgCanvas2D.prototype.useDomParser)try{var t=new DOMParser().parseFromString("test text","text/html");mxSvgCanvas2D.prototype.useDomParser=t!=null}catch{mxSvgCanvas2D.prototype.useDomParser=!1}mxSvgCanvas2D.prototype.useAbsoluteIds=!mxClient.IS_CHROMEAPP&&!mxClient.IS_IE&&!mxClient.IS_IE11&&!mxClient.IS_EDGE&&document.getElementsByTagName("base").length>0}(),mxSvgCanvas2D.prototype.node=null,mxSvgCanvas2D.prototype.matchHtmlAlignment=!0,mxSvgCanvas2D.prototype.textEnabled=!0,mxSvgCanvas2D.prototype.foEnabled=!0,mxSvgCanvas2D.prototype.foAltText="[Object]",mxSvgCanvas2D.prototype.foOffset=0,mxSvgCanvas2D.prototype.textOffset=0,mxSvgCanvas2D.prototype.imageOffset=0,mxSvgCanvas2D.prototype.strokeTolerance=0,mxSvgCanvas2D.prototype.minStrokeWidth=1,mxSvgCanvas2D.prototype.refCount=0,mxSvgCanvas2D.prototype.lineHeightCorrection=1,mxSvgCanvas2D.prototype.pointerEventsValue="all",mxSvgCanvas2D.prototype.fontMetricsPadding=10,mxSvgCanvas2D.prototype.cacheOffsetSize=!0,mxSvgCanvas2D.prototype.format=function(t){return parseFloat(parseFloat(t).toFixed(2))},mxSvgCanvas2D.prototype.getBaseUrl=function(){var t=window.location.href,e=t.lastIndexOf("#");return e>0&&(t=t.substring(0,e)),t},mxSvgCanvas2D.prototype.reset=function(){mxAbstractCanvas2D.prototype.reset.apply(this,arguments),this.gradients=[]},mxSvgCanvas2D.prototype.createStyle=function(t){var e=this.createElement("style");return e.setAttribute("type","text/css"),mxUtils.write(e,"svg{font-family:"+mxConstants.DEFAULT_FONTFAMILY+";font-size:"+mxConstants.DEFAULT_FONTSIZE+";fill:none;stroke-miterlimit:10}"),e},mxSvgCanvas2D.prototype.createElement=function(t,e){if(this.root.ownerDocument.createElementNS!=null)return this.root.ownerDocument.createElementNS(e||mxConstants.NS_SVG,t);var i=this.root.ownerDocument.createElement(t);return e!=null&&i.setAttribute("xmlns",e),i},mxSvgCanvas2D.prototype.getAlternateText=function(t,e,i,n,r,s,l,a,o,u,p,m,d){return s!=null?this.foAltText:null},mxSvgCanvas2D.prototype.createAlternateContent=function(t,e,i,n,r,s,l,a,o,u,p,m,d){var x=this.getAlternateText(t,e,i,n,r,s,l,a,o,u,p,m,d),f=this.state;if(x!=null&&f.fontSize>0){var g=a==mxConstants.ALIGN_TOP?1:a==mxConstants.ALIGN_BOTTOM?0:.3,c=l==mxConstants.ALIGN_RIGHT?"end":l==mxConstants.ALIGN_LEFT?"start":"middle",v=this.createElement("text");v.setAttribute("x",Math.round(e+f.dx)),v.setAttribute("y",Math.round(i+f.dy+g*f.fontSize)),v.setAttribute("fill",f.fontColor||"black"),v.setAttribute("font-family",f.fontFamily),v.setAttribute("font-size",Math.round(f.fontSize)+"px"),c!="start"&&v.setAttribute("text-anchor",c),(f.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&v.setAttribute("font-weight","bold"),(f.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&v.setAttribute("font-style","italic");var y=[];return(f.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&y.push("underline"),(f.fontStyle&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&y.push("line-through"),y.length>0&&v.setAttribute("text-decoration",y.join(" ")),mxUtils.write(v,x),v}else return null},mxSvgCanvas2D.prototype.createGradientId=function(t,e,i,n,r){t.charAt(0)=="#"&&(t=t.substring(1)),e.charAt(0)=="#"&&(e=e.substring(1)),t=t.toLowerCase()+"-"+i,e=e.toLowerCase()+"-"+n;var s=null;if(r==null||r==mxConstants.DIRECTION_SOUTH)s="s";else if(r==mxConstants.DIRECTION_EAST)s="e";else{var l=t;t=e,e=l,r==mxConstants.DIRECTION_NORTH?s="s":r==mxConstants.DIRECTION_WEST&&(s="e")}return"mx-gradient-"+t+"-"+e+"-"+s},mxSvgCanvas2D.prototype.getSvgGradient=function(t,e,i,n,r){var s=this.createGradientId(t,e,i,n,r),l=this.gradients[s];if(l==null){var a=this.root.ownerSVGElement,o=0,u=s+"-"+o;if(a!=null)for(l=a.ownerDocument.getElementById(u);l!=null&&l.ownerSVGElement!=a;)u=s+"-"+o++,l=a.ownerDocument.getElementById(u);else u="id"+ ++this.refCount;l==null&&(l=this.createSvgGradient(t,e,i,n,r),l.setAttribute("id",u),this.defs!=null?this.defs.appendChild(l):a.appendChild(l)),this.gradients[s]=l}return l.getAttribute("id")},mxSvgCanvas2D.prototype.createSvgGradient=function(t,e,i,n,r){var s=this.createElement("linearGradient");s.setAttribute("x1","0%"),s.setAttribute("y1","0%"),s.setAttribute("x2","0%"),s.setAttribute("y2","0%"),r==null||r==mxConstants.DIRECTION_SOUTH?s.setAttribute("y2","100%"):r==mxConstants.DIRECTION_EAST?s.setAttribute("x2","100%"):r==mxConstants.DIRECTION_NORTH?s.setAttribute("y1","100%"):r==mxConstants.DIRECTION_WEST&&s.setAttribute("x1","100%");var l=i<1?";stop-opacity:"+i:"",a=this.createElement("stop");return a.setAttribute("offset","0%"),a.setAttribute("style","stop-color:"+t+l),s.appendChild(a),l=n<1?";stop-opacity:"+n:"",a=this.createElement("stop"),a.setAttribute("offset","100%"),a.setAttribute("style","stop-color:"+e+l),s.appendChild(a),s},mxSvgCanvas2D.prototype.addNode=function(t,e){var i=this.node,n=this.state;if(i!=null){if(i.nodeName=="path")if(this.path!=null&&this.path.length>0)i.setAttribute("d",this.path.join(" "));else return;t&&n.fillColor!=null?this.updateFill():this.styleEnabled||(i.nodeName=="ellipse"&&mxClient.IS_FF?i.setAttribute("fill","transparent"):i.setAttribute("fill","none"),t=!1),e&&n.strokeColor!=null?this.updateStroke():this.styleEnabled||i.setAttribute("stroke","none"),n.transform!=null&&n.transform.length>0&&i.setAttribute("transform",n.transform),n.shadow&&this.root.appendChild(this.createShadow(i)),this.strokeTolerance>0&&!t&&this.root.appendChild(this.createTolerance(i)),this.pointerEvents?i.setAttribute("pointer-events",this.pointerEventsValue):!this.pointerEvents&&this.originalRoot==null&&i.setAttribute("pointer-events","none"),(i.nodeName!="rect"&&i.nodeName!="path"&&i.nodeName!="ellipse"||i.getAttribute("fill")!="none"&&i.getAttribute("fill")!="transparent"||i.getAttribute("stroke")!="none"||i.getAttribute("pointer-events")!="none")&&this.root.appendChild(i),this.node=null}},mxSvgCanvas2D.prototype.updateFill=function(){var t=this.state;if((t.alpha<1||t.fillAlpha<1)&&this.node.setAttribute("fill-opacity",t.alpha*t.fillAlpha),t.fillColor!=null)if(t.gradientColor!=null){var e=this.getSvgGradient(String(t.fillColor),String(t.gradientColor),t.gradientFillAlpha,t.gradientAlpha,t.gradientDirection);if(this.root.ownerDocument==document&&this.useAbsoluteIds){var i=this.getBaseUrl().replace(/([\(\)])/g,"\\$1");this.node.setAttribute("fill","url("+i+"#"+e+")")}else this.node.setAttribute("fill","url(#"+e+")")}else this.node.setAttribute("fill",String(t.fillColor).toLowerCase())},mxSvgCanvas2D.prototype.getCurrentStrokeWidth=function(){return Math.max(this.minStrokeWidth,Math.max(.01,this.format(this.state.strokeWidth*this.state.scale)))},mxSvgCanvas2D.prototype.updateStroke=function(){var t=this.state;this.node.setAttribute("stroke",String(t.strokeColor).toLowerCase()),(t.alpha<1||t.strokeAlpha<1)&&this.node.setAttribute("stroke-opacity",t.alpha*t.strokeAlpha);var e=this.getCurrentStrokeWidth();e!=1&&this.node.setAttribute("stroke-width",e),this.node.nodeName=="path"&&this.updateStrokeAttributes(),t.dashed&&this.node.setAttribute("stroke-dasharray",this.createDashPattern((t.fixDash?1:t.strokeWidth)*t.scale))},mxSvgCanvas2D.prototype.updateStrokeAttributes=function(){var t=this.state;if(t.lineJoin!=null&&t.lineJoin!="miter"&&this.node.setAttribute("stroke-linejoin",t.lineJoin),t.lineCap!=null){var e=t.lineCap;e=="flat"&&(e="butt"),e!="butt"&&this.node.setAttribute("stroke-linecap",e)}t.miterLimit!=null&&(!this.styleEnabled||t.miterLimit!=10)&&this.node.setAttribute("stroke-miterlimit",t.miterLimit)},mxSvgCanvas2D.prototype.createDashPattern=function(t){var e=[];if(typeof this.state.dashPattern=="string"){var i=this.state.dashPattern.split(" ");if(i.length>0)for(var n=0;n0&&this.node.setAttribute("rx",this.format(r*this.state.scale)),s>0&&this.node.setAttribute("ry",this.format(s*this.state.scale))},mxSvgCanvas2D.prototype.ellipse=function(t,e,i,n){var r=this.state,s=this.createElement("ellipse");s.setAttribute("cx",this.format((t+i/2+r.dx)*r.scale)),s.setAttribute("cy",this.format((e+n/2+r.dy)*r.scale)),s.setAttribute("rx",i/2*r.scale),s.setAttribute("ry",n/2*r.scale),this.node=s},mxSvgCanvas2D.prototype.image=function(t,e,i,n,r,s,l,a){r=this.converter.convert(r),s=s??!0,l=l??!1,a=a??!1;var o=this.state;t+=o.dx,e+=o.dy;var u=this.createElement("image");u.setAttribute("x",this.format(t*o.scale)+this.imageOffset),u.setAttribute("y",this.format(e*o.scale)+this.imageOffset),u.setAttribute("width",this.format(i*o.scale)),u.setAttribute("height",this.format(n*o.scale)),u.setAttributeNS==null?u.setAttribute("xlink:href",r):u.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",r),s||u.setAttribute("preserveAspectRatio","none"),(o.alpha<1||o.fillAlpha<1)&&u.setAttribute("opacity",o.alpha*o.fillAlpha);var p=this.state.transform||"";if(l||a){var m=1,d=1,x=0,f=0;l&&(m=-1,x=-i-2*t),a&&(d=-1,f=-n-2*e),p+="scale("+m+","+d+")translate("+x*o.scale+","+f*o.scale+")"}p.length>0&&u.setAttribute("transform",p),this.pointerEvents||u.setAttribute("pointer-events","none"),this.root.appendChild(u)},mxSvgCanvas2D.prototype.convertHtml=function(t){if(this.useDomParser){var e=new DOMParser().parseFromString(t,"text/html");e!=null&&(t=new XMLSerializer().serializeToString(e.body),t.substring(0,5)=="",5)+1)),t.substring(t.length-7,t.length)==""&&(t=t.substring(0,t.length-7)))}else if(document.implementation!=null&&document.implementation.createDocument!=null){var i=document.implementation.createDocument("http://www.w3.org/1999/xhtml","html",null),n=i.createElement("body");i.documentElement.appendChild(n);var r=document.createElement("div");r.innerHTML=t;for(var s=r.firstChild;s!=null;){var l=s.nextSibling;n.appendChild(i.adoptNode(s)),s=l}return n.innerHTML}else{var a=document.createElement("textarea");a.innerHTML=t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(//g,">"),t=a.value.replace(/&/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&").replace(/
/g,"
").replace(/
/g,"
").replace(/(]+)>/gm,"$1 />")}return t},mxSvgCanvas2D.prototype.createDiv=function(t){var e=t;if(mxUtils.isNode(e)||(e="
"+this.convertHtml(e)+"
"),!mxClient.IS_IE&&!mxClient.IS_IE11&&document.createElementNS){var i=document.createElementNS("http://www.w3.org/1999/xhtml","div");if(mxUtils.isNode(e)){var n=document.createElement("div"),r=n.cloneNode(!1);this.root.ownerDocument!=document?n.appendChild(e.cloneNode(!0)):n.appendChild(e),r.appendChild(n),i.appendChild(r)}else i.innerHTML=e;return i}else return mxUtils.isNode(e)&&(e="
"+mxUtils.getXml(e)+"
"),e='
'+e+"
",mxUtils.parseXml(e).documentElement},mxSvgCanvas2D.prototype.updateText=function(t,e,i,n,r,s,l,a,o,u,p){p!=null&&p.firstChild!=null&&p.firstChild.firstChild!=null&&this.updateTextNodes(t,e,i,n,r,s,l,a,o,u,p.firstChild)},mxSvgCanvas2D.prototype.addForeignObject=function(t,e,i,n,r,s,l,a,o,u,p,m,d,x,f){var g=this.createElement("g"),c=this.createElement("foreignObject");if(c.setAttribute("style","overflow: visible; text-align: left;"),c.setAttribute("pointer-events","none"),x.ownerDocument!=document&&(x=mxUtils.importNodeImplementation(c.ownerDocument,x,!0)),c.appendChild(x),g.appendChild(c),this.updateTextNodes(t,e,i,n,s,l,a,u,p,m,g),this.root.ownerDocument!=document){var v=this.createAlternateContent(c,t,e,i,n,r,s,l,a,o,u,p,m);if(v!=null){c.setAttribute("requiredFeatures","http://www.w3.org/TR/SVG11/feature#Extensibility");var y=this.createElement("switch");y.appendChild(c),y.appendChild(v),g.appendChild(y)}}f.appendChild(g)},mxSvgCanvas2D.prototype.updateTextNodes=function(t,e,i,n,r,s,l,a,o,u,p){var m=this.state.scale;mxSvgCanvas2D.createCss(i+2,n,r,s,l,a,o,this.state.fontBackgroundColor!=null?this.state.fontBackgroundColor:null,this.state.fontBorderColor!=null?this.state.fontBorderColor:null,"display: flex; align-items: unsafe "+(s==mxConstants.ALIGN_TOP?"flex-start":s==mxConstants.ALIGN_BOTTOM?"flex-end":"center")+"; justify-content: unsafe "+(r==mxConstants.ALIGN_LEFT?"flex-start":r==mxConstants.ALIGN_RIGHT?"flex-end":"center")+"; ",this.getTextCss(),m,mxUtils.bind(this,function(d,x,f,g,c){t+=this.state.dx,e+=this.state.dy;var v=p.firstChild,y=v.firstChild,T=y.firstChild,C=T.firstChild,S=(this.rotateHtml?this.state.rotation:0)+(u??0),E=(this.foOffset!=0?"translate("+this.foOffset+" "+this.foOffset+")":"")+(m!=1?"scale("+m+")":"");C.setAttribute("style",c),T.setAttribute("style",g),v.setAttribute("width",Math.ceil(1/Math.min(1,m)*100)+"%"),v.setAttribute("height",Math.ceil(1/Math.min(1,m)*100)+"%");var L=Math.round(e+x);L<0?v.setAttribute("y",L):(v.removeAttribute("y"),f+="padding-top: "+L+"px; "),y.setAttribute("style",f+"margin-left: "+Math.round(t+d)+"px;"),E+=S!=0?"rotate("+S+" "+t+" "+e+")":"",E!=""?p.setAttribute("transform",E):p.removeAttribute("transform"),this.state.alpha!=1?p.setAttribute("opacity",this.state.alpha):p.removeAttribute("opacity")}))},mxSvgCanvas2D.createCss=function(t,e,i,n,r,s,l,a,o,u,p,m,d){var x="box-sizing: border-box; font-size: 0; text-align: "+(i==mxConstants.ALIGN_LEFT?"left":i==mxConstants.ALIGN_RIGHT?"right":"center")+"; ",f=mxUtils.getAlignmentAsPoint(i,n),g="overflow: hidden; ",c="width: 1px; ",v="height: 1px; ",y=f.x*t,T=f.y*e;l?(c="width: "+Math.round(t)+"px; ",x+="max-height: "+Math.round(e)+"px; ",T=0):s=="fill"?(c="width: "+Math.round(t)+"px; ",v="height: "+Math.round(e)+"px; ",p+="width: 100%; height: 100%; ",x+=c+v):s=="width"?(c="width: "+Math.round(t)+"px; ",p+="width: 100%; ",x+=c,T=0,e>0&&(x+="max-height: "+Math.round(e)+"px; ")):(g="",T=0);var C="";a!=null&&(C+="background-color: "+a+"; "),o!=null&&(C+="border: 1px solid "+o+"; "),g==""||l?p+=C:x+=C,r&&t>0?(p+="white-space: normal; word-wrap: "+mxConstants.WORD_WRAP+"; ",c="width: "+Math.round(t)+"px; ",g!=""&&s!="fill"&&(T=0)):(p+="white-space: nowrap; ",g==""&&(y=0)),d(y,T,u+c+v,x+g,p,g)},mxSvgCanvas2D.prototype.getTextCss=function(){var t=this.state,e=mxConstants.ABSOLUTE_LINE_HEIGHT?t.fontSize*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT*this.lineHeightCorrection,i="display: inline-block; font-size: "+t.fontSize+"px; font-family: "+t.fontFamily+"; color: "+t.fontColor+"; line-height: "+e+"; pointer-events: "+(this.pointerEvents?this.pointerEventsValue:"none")+"; ";(t.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(i+="font-weight: bold; "),(t.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(i+="font-style: italic; ");var n=[];return(t.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&n.push("underline"),(t.fontStyle&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&n.push("line-through"),n.length>0&&(i+="text-decoration: "+n.join(" ")+"; "),i},mxSvgCanvas2D.prototype.text=function(t,e,i,n,r,s,l,a,o,u,p,m,d){if(this.textEnabled&&r!=null)if(m=m??0,this.foEnabled&&o=="html"){var x=this.createDiv(r);x!=null&&(d!=null&&x.setAttribute("dir",d),this.addForeignObject(t,e,i,n,r,s,l,a,o,u,p,m,d,x,this.root))}else this.plainText(t+this.state.dx,e+this.state.dy,i,n,r,s,l,a,u,p,m,d)},mxSvgCanvas2D.prototype.createClip=function(t,e,i,n){t=Math.round(t),e=Math.round(e),i=Math.round(i),n=Math.round(n);for(var r="mx-clip-"+t+"-"+e+"-"+i+"-"+n,s=0,l=r+"-"+s;document.getElementById(l)!=null;)l=r+"-"+ ++s;clip=this.createElement("clipPath"),clip.setAttribute("id",l);var a=this.createElement("rect");return a.setAttribute("x",t),a.setAttribute("y",e),a.setAttribute("width",i),a.setAttribute("height",n),clip.appendChild(a),clip},mxSvgCanvas2D.prototype.plainText=function(t,e,i,n,r,s,l,a,o,u,p,m){p=p??0;var d=this.state,x=d.fontSize,f=this.createElement("g"),g=d.transform||"";if(this.updateFont(f),!this.pointerEvents&&this.originalRoot==null&&f.setAttribute("pointer-events","none"),p!=0&&(g+="rotate("+p+","+this.format(t*d.scale)+","+this.format(e*d.scale)+")"),m!=null&&f.setAttribute("direction",m),u&&i>0&&n>0){var c=t,L=e;s==mxConstants.ALIGN_CENTER?c-=i/2:s==mxConstants.ALIGN_RIGHT&&(c-=i),o!="fill"&&(l==mxConstants.ALIGN_MIDDLE?L-=n/2:l==mxConstants.ALIGN_BOTTOM&&(L-=n));var v=this.createClip(c*d.scale-2,L*d.scale-2,i*d.scale+4,n*d.scale+4);if(this.defs!=null?this.defs.appendChild(v):this.root.appendChild(v),!mxClient.IS_CHROMEAPP&&!mxClient.IS_IE&&!mxClient.IS_IE11&&!mxClient.IS_EDGE&&this.root.ownerDocument==document){var y=this.getBaseUrl().replace(/([\(\)])/g,"\\$1");f.setAttribute("clip-path","url("+y+"#"+v.getAttribute("id")+")")}else f.setAttribute("clip-path","url(#"+v.getAttribute("id")+")")}var T=s==mxConstants.ALIGN_RIGHT?"end":s==mxConstants.ALIGN_CENTER?"middle":"start";T!="start"&&f.setAttribute("text-anchor",T),(!this.styleEnabled||x!=mxConstants.DEFAULT_FONTSIZE)&&f.setAttribute("font-size",x*d.scale+"px"),g.length>0&&f.setAttribute("transform",g),d.alpha<1&&f.setAttribute("opacity",d.alpha);var C=r.split(` -`),S=Math.round(x*mxConstants.LINE_HEIGHT),E=x+(C.length-1)*S,L=e+x-1;if(l==mxConstants.ALIGN_MIDDLE)if(o=="fill")L-=n/2;else{var A=(this.matchHtmlAlignment&&u&&n>0?Math.min(E,n):E)/2;L-=A}else if(l==mxConstants.ALIGN_BOTTOM)if(o=="fill")L-=n;else{var A=this.matchHtmlAlignment&&u&&n>0?Math.min(E,n):E;L-=A+1}for(var M=0;M0&&mxUtils.trim(C[M]).length>0){var I=this.createElement("text");I.setAttribute("x",this.format(t*d.scale)+this.textOffset),I.setAttribute("y",this.format(L*d.scale)+this.textOffset),mxUtils.write(I,C[M]),f.appendChild(I)}L+=S}this.root.appendChild(f),this.addTextBackground(f,r,t,e,i,o=="fill"?n:E,s,l,o)},mxSvgCanvas2D.prototype.updateFont=function(t){var e=this.state;t.setAttribute("fill",e.fontColor),(!this.styleEnabled||e.fontFamily!=mxConstants.DEFAULT_FONTFAMILY)&&t.setAttribute("font-family",e.fontFamily),(e.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&t.setAttribute("font-weight","bold"),(e.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&t.setAttribute("font-style","italic");var i=[];(e.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&i.push("underline"),(e.fontStyle&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&i.push("line-through"),i.length>0&&t.setAttribute("text-decoration",i.join(" "))},mxSvgCanvas2D.prototype.addTextBackground=function(t,e,i,n,r,s,l,a,o){var u=this.state;if(u.fontBackgroundColor!=null||u.fontBorderColor!=null){var p=null;if(o=="fill"||o=="width")l==mxConstants.ALIGN_CENTER?i-=r/2:l==mxConstants.ALIGN_RIGHT&&(i-=r),a==mxConstants.ALIGN_MIDDLE?n-=s/2:a==mxConstants.ALIGN_BOTTOM&&(n-=s),p=new mxRectangle((i+1)*u.scale,n*u.scale,(r-2)*u.scale,(s+2)*u.scale);else if(t.getBBox!=null&&this.root.ownerDocument==document)try{p=t.getBBox();var m=mxClient.IS_IE&&mxClient.IS_SVG;p=new mxRectangle(p.x,p.y+(m?0:1),p.width,p.height+(m?1:0))}catch{}if(p==null||p.width==0||p.height==0){var d=document.createElement("div");d.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?u.fontSize*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT,d.style.fontSize=u.fontSize+"px",d.style.fontFamily=u.fontFamily,d.style.whiteSpace="nowrap",d.style.position="absolute",d.style.visibility="hidden",d.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",d.style.zoom="1",(u.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(d.style.fontWeight="bold"),(u.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(d.style.fontStyle="italic"),e=mxUtils.htmlEntities(e,!1),d.innerHTML=e.replace(/\n/g,"
"),document.body.appendChild(d);var r=d.offsetWidth,s=d.offsetHeight;d.parentNode.removeChild(d),l==mxConstants.ALIGN_CENTER?i-=r/2:l==mxConstants.ALIGN_RIGHT&&(i-=r),a==mxConstants.ALIGN_MIDDLE?n-=s/2:a==mxConstants.ALIGN_BOTTOM&&(n-=s),p=new mxRectangle((i+1)*u.scale,(n+2)*u.scale,r*u.scale,(s+1)*u.scale)}if(p!=null){var x=this.createElement("rect");x.setAttribute("fill",u.fontBackgroundColor||"none"),x.setAttribute("stroke",u.fontBorderColor||"none"),x.setAttribute("x",Math.floor(p.x-1)),x.setAttribute("y",Math.floor(p.y-1)),x.setAttribute("width",Math.ceil(p.width+2)),x.setAttribute("height",Math.ceil(p.height));var f=u.fontBorderColor!=null?Math.max(1,this.format(u.scale)):0;x.setAttribute("stroke-width",f),this.root.ownerDocument==document&&mxUtils.mod(f,2)==1&&x.setAttribute("transform","translate(0.5, 0.5)"),t.insertBefore(x,t.firstChild)}}},mxSvgCanvas2D.prototype.stroke=function(){this.addNode(!1,!0)},mxSvgCanvas2D.prototype.fill=function(){this.addNode(!0,!1)},mxSvgCanvas2D.prototype.fillAndStroke=function(){this.addNode(!0,!0)},__mxOutput.mxSvgCanvas2D=typeof mxSvgCanvas2D<"u"?mxSvgCanvas2D:void 0;var mxVmlCanvas2D=function(t){mxAbstractCanvas2D.call(this),this.root=t};mxUtils.extend(mxVmlCanvas2D,mxAbstractCanvas2D),mxVmlCanvas2D.prototype.node=null,mxVmlCanvas2D.prototype.textEnabled=!0,mxVmlCanvas2D.prototype.moveOp="m",mxVmlCanvas2D.prototype.lineOp="l",mxVmlCanvas2D.prototype.curveOp="c",mxVmlCanvas2D.prototype.closeOp="x",mxVmlCanvas2D.prototype.rotatedHtmlBackground="",mxVmlCanvas2D.prototype.vmlScale=1,mxVmlCanvas2D.prototype.createElement=function(t){return document.createElement(t)},mxVmlCanvas2D.prototype.createVmlElement=function(t){return this.createElement(mxClient.VML_PREFIX+":"+t)},mxVmlCanvas2D.prototype.addNode=function(t,e){var i=this.node,n=this.state;if(i!=null){if(i.nodeName=="shape")if(this.path!=null&&this.path.length>0)i.path=this.path.join(" ")+" e",i.style.width=this.root.style.width,i.style.height=this.root.style.height,i.coordsize=parseInt(i.style.width)+" "+parseInt(i.style.height);else return;i.strokeweight=this.format(Math.max(1,n.strokeWidth*n.scale/this.vmlScale))+"px",n.shadow&&this.root.appendChild(this.createShadow(i,t&&n.fillColor!=null,e&&n.strokeColor!=null)),e&&n.strokeColor!=null?(i.stroked="true",i.strokecolor=n.strokeColor):i.stroked="false",i.appendChild(this.createStroke()),t&&n.fillColor!=null?i.appendChild(this.createFill()):this.pointerEvents&&(i.nodeName!="shape"||this.path[this.path.length-1]==this.closeOp)?i.appendChild(this.createTransparentFill()):i.filled="false",this.root.appendChild(i)}},mxVmlCanvas2D.prototype.createTransparentFill=function(){var t=this.createVmlElement("fill");return t.src=mxClient.imageBasePath+"/transparent.gif",t.type="tile",t},mxVmlCanvas2D.prototype.createFill=function(){var t=this.state,e=this.createVmlElement("fill");if(e.color=t.fillColor,t.gradientColor!=null){e.type="gradient",e.method="none",e.color2=t.gradientColor;var i=180-t.rotation;t.gradientDirection==mxConstants.DIRECTION_WEST?i-=90+(this.root.style.flip=="x"?180:0):t.gradientDirection==mxConstants.DIRECTION_EAST?i+=90+(this.root.style.flip=="x"?180:0):t.gradientDirection==mxConstants.DIRECTION_NORTH?i-=180+(this.root.style.flip=="y"?-180:0):i+=this.root.style.flip=="y"?-180:0,(this.root.style.flip=="x"||this.root.style.flip=="y")&&(i*=-1),e.angle=mxUtils.mod(i,360),e.opacity=t.alpha*t.gradientFillAlpha*100+"%",e.setAttribute(mxClient.OFFICE_PREFIX+":opacity2",t.alpha*t.gradientAlpha*100+"%")}else(t.alpha<1||t.fillAlpha<1)&&(e.opacity=t.alpha*t.fillAlpha*100+"%");return e},mxVmlCanvas2D.prototype.createStroke=function(){var t=this.state,e=this.createVmlElement("stroke");return e.endcap=t.lineCap||"flat",e.joinstyle=t.lineJoin||"miter",e.miterlimit=t.miterLimit||"10",(t.alpha<1||t.strokeAlpha<1)&&(e.opacity=t.alpha*t.strokeAlpha*100+"%"),t.dashed&&(e.dashstyle=this.getVmlDashStyle()),e},mxVmlCanvas2D.prototype.getVmlDashStyle=function(){var t="dash";if(typeof this.state.dashPattern=="string"){var e=this.state.dashPattern.split(" ");e.length>0&&e[0]==1&&(t="0 2")}return t},mxVmlCanvas2D.prototype.createShadow=function(t,e,i){var n=this.state,r=-n.rotation*(Math.PI/180),s=Math.cos(r),l=Math.sin(r),a=n.shadowDx*n.scale,o=n.shadowDy*n.scale;this.root.style.flip=="x"?a*=-1:this.root.style.flip=="y"&&(o*=-1);var u=t.cloneNode(!0);return u.style.marginLeft=Math.round(a*s-o*l)+"px",u.style.marginTop=Math.round(a*l+o*s)+"px",document.documentMode==8&&(u.strokeweight=t.strokeweight,t.nodeName=="shape"&&(u.path=this.path.join(" ")+" e",u.style.width=this.root.style.width,u.style.height=this.root.style.height,u.coordsize=parseInt(t.style.width)+" "+parseInt(t.style.height))),i?(u.strokecolor=n.shadowColor,u.appendChild(this.createShadowStroke())):u.stroked="false",e?u.appendChild(this.createShadowFill()):u.filled="false",u},mxVmlCanvas2D.prototype.createShadowFill=function(){var t=this.createVmlElement("fill");return t.color=this.state.shadowColor,t.opacity=this.state.alpha*this.state.shadowAlpha*100+"%",t},mxVmlCanvas2D.prototype.createShadowStroke=function(){var t=this.createStroke();return t.opacity=this.state.alpha*this.state.shadowAlpha*100+"%",t},mxVmlCanvas2D.prototype.rotate=function(t,e,i,n,r){e&&i?t+=180:e?this.root.style.flip="x":i&&(this.root.style.flip="y"),(e?!i:i)&&(t*=-1),this.root.style.rotation=t,this.state.rotation=this.state.rotation+t,this.state.rotationCx=n,this.state.rotationCy=r},mxVmlCanvas2D.prototype.begin=function(){mxAbstractCanvas2D.prototype.begin.apply(this,arguments),this.node=this.createVmlElement("shape"),this.node.style.position="absolute"},mxVmlCanvas2D.prototype.quadTo=function(t,e,i,n){var r=this.state,s=(this.lastX+r.dx)*r.scale,l=(this.lastY+r.dy)*r.scale,a=(t+r.dx)*r.scale,o=(e+r.dy)*r.scale,u=(i+r.dx)*r.scale,p=(n+r.dy)*r.scale,m=s+2/3*(a-s),d=l+2/3*(o-l),x=u+2/3*(a-u),f=p+2/3*(o-p);this.path.push("c "+this.format(m)+" "+this.format(d)+" "+this.format(x)+" "+this.format(f)+" "+this.format(u)+" "+this.format(p)),this.lastX=u/r.scale-r.dx,this.lastY=p/r.scale-r.dy},mxVmlCanvas2D.prototype.createRect=function(t,e,i,n,r){var s=this.state,l=this.createVmlElement(t);return l.style.position="absolute",l.style.left=this.format((e+s.dx)*s.scale)+"px",l.style.top=this.format((i+s.dy)*s.scale)+"px",l.style.width=this.format(n*s.scale)+"px",l.style.height=this.format(r*s.scale)+"px",l},mxVmlCanvas2D.prototype.rect=function(t,e,i,n){this.node=this.createRect("rect",t,e,i,n)},mxVmlCanvas2D.prototype.roundrect=function(t,e,i,n,r,s){this.node=this.createRect("roundrect",t,e,i,n),this.node.setAttribute("arcsize",Math.max(r*100/i,s*100/n)+"%")},mxVmlCanvas2D.prototype.ellipse=function(t,e,i,n){this.node=this.createRect("oval",t,e,i,n)},mxVmlCanvas2D.prototype.image=function(t,e,i,n,r,s,l,a){var o=null;if(!s)o=this.createRect("image",t,e,i,n),o.src=r;else{o=this.createRect("rect",t,e,i,n),o.stroked="false";var u=this.createVmlElement("fill");u.aspect=s?"atmost":"ignore",u.rotate="true",u.type="frame",u.src=r,o.appendChild(u)}l&&a?o.style.rotation="180":l?o.style.flip="x":a&&(o.style.flip="y"),(this.state.alpha<1||this.state.fillAlpha<1)&&(o.style.filter+="alpha(opacity="+this.state.alpha*this.state.fillAlpha*100+")"),this.root.appendChild(o)},mxVmlCanvas2D.prototype.createDiv=function(t,e,i,n){var r=this.createElement("div"),s=this.state,l="";if(s.fontBackgroundColor!=null&&(l+="background-color:"+mxUtils.htmlEntities(s.fontBackgroundColor)+";"),s.fontBorderColor!=null&&(l+="border:1px solid "+mxUtils.htmlEntities(s.fontBorderColor)+";"),mxUtils.isNode(t))r.appendChild(t);else if(n!="fill"&&n!="width"){var a=this.createElement("div");a.style.cssText=l,a.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",a.style.zoom="1",a.style.textDecoration="inherit",a.innerHTML=t,r.appendChild(a)}else r.style.cssText=l,r.innerHTML=t;var o=r.style;return o.fontSize=s.fontSize/this.vmlScale+"px",o.fontFamily=s.fontFamily,o.color=s.fontColor,o.verticalAlign="top",o.textAlign=e||"left",o.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?s.fontSize*mxConstants.LINE_HEIGHT/this.vmlScale+"px":mxConstants.LINE_HEIGHT,(s.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(o.fontWeight="bold"),(s.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(o.fontStyle="italic"),(s.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&(o.textDecoration="underline"),r},mxVmlCanvas2D.prototype.text=function(t,e,i,n,r,s,l,a,o,u,p,m,d){if(this.textEnabled&&r!=null){var x=this.state;if(o=="html"){if(x.rotation!=null){var f=this.rotatePoint(t,e,x.rotation,x.rotationCx,x.rotationCy);t=f.x,e=f.y}document.documentMode==8&&!mxClient.IS_EM?(t+=x.dx,e+=x.dy,u!="fill"&&l==mxConstants.ALIGN_TOP&&(e-=1)):(t*=x.scale,e*=x.scale);var g=document.documentMode==8&&!mxClient.IS_EM?this.createVmlElement("group"):this.createElement("div");g.style.position="absolute",g.style.display="inline",g.style.left=this.format(t)+"px",g.style.top=this.format(e)+"px",g.style.zoom=x.scale;var c=this.createElement("div");c.style.position="relative",c.style.display="inline";var v=mxUtils.getAlignmentAsPoint(s,l),y=v.x,T=v.y,C=this.createDiv(r,s,l,u),S=this.createElement("div");if(d!=null&&C.setAttribute("dir",d),a&&i>0){if(p||(C.style.width=Math.round(i)+"px"),C.style.wordWrap=mxConstants.WORD_WRAP,C.style.whiteSpace="normal",C.style.wordWrap=="break-word"){var E=C;E.firstChild!=null&&E.firstChild.nodeName=="DIV"&&(E.firstChild.style.width="100%")}}else C.style.whiteSpace="nowrap";var L=x.rotation+(m||0);if(this.rotateHtml&&L!=0?(S.style.display="inline",S.style.zoom="1",S.appendChild(C),document.documentMode==8&&!mxClient.IS_EM&&this.root.nodeName!="DIV"?(c.appendChild(S),g.appendChild(c)):g.appendChild(S)):document.documentMode==8&&!mxClient.IS_EM?(c.appendChild(C),g.appendChild(c)):(C.style.display="inline",g.appendChild(C)),this.root.nodeName!="DIV"){var A=this.createVmlElement("rect");A.stroked="false",A.filled="false",A.appendChild(g),this.root.appendChild(A)}else this.root.appendChild(g);if(p?(C.style.overflow="hidden",C.style.width=Math.round(i)+"px",mxClient.IS_QUIRKS||(C.style.maxHeight=Math.round(n)+"px")):u=="fill"?(C.style.overflow="hidden",C.style.width=Math.max(0,i)+1+"px",C.style.height=Math.max(0,n)+1+"px"):u=="width"&&(C.style.overflow="hidden",C.style.width=Math.max(0,i)+1+"px",C.style.maxHeight=Math.max(0,n)+1+"px"),this.rotateHtml&&L!=0){var M=L*(Math.PI/180),I=parseFloat(parseFloat(Math.cos(M)).toFixed(8)),P=parseFloat(parseFloat(Math.sin(-M)).toFixed(8));M%=2*Math.PI,M<0&&(M+=2*Math.PI),M%=Math.PI,M>Math.PI/2&&(M=Math.PI-M);var R=Math.cos(M),O=Math.sin(M);document.documentMode==8&&!mxClient.IS_EM&&(C.style.display="inline-block",S.style.display="inline-block",c.style.display="inline-block"),C.style.visibility="hidden",C.style.position="absolute",document.body.appendChild(C);var _=C;_.firstChild!=null&&_.firstChild.nodeName=="DIV"&&(_=_.firstChild);var E=_.offsetWidth+3,b=_.offsetHeight;p?(i=Math.min(i,E),b=Math.min(b,n)):i=E,a&&(C.style.width=i+"px"),mxClient.IS_QUIRKS&&(p||u=="width")&&b>n&&(b=n,C.style.height=b+"px"),n=b;var k=(n-n*R+i*-O)/2-P*i*(y+.5)+I*n*(T+.5),G=(i-i*R+n*-O)/2+I*i*(y+.5)+P*n*(T+.5);if(g.nodeName=="group"&&this.root.nodeName=="DIV"){var B=this.createElement("div");B.style.display="inline-block",B.style.position="absolute",B.style.left=this.format(t+(G-i/2)*x.scale)+"px",B.style.top=this.format(e+(k-n/2)*x.scale)+"px",g.parentNode.appendChild(B),B.appendChild(g)}else{var j=document.documentMode==8&&!mxClient.IS_EM?1:x.scale;g.style.left=this.format(t+(G-i/2)*j)+"px",g.style.top=this.format(e+(k-n/2)*j)+"px"}S.style.filter="progid:DXImageTransform.Microsoft.Matrix(M11="+I+", M12="+P+", M21="+-P+", M22="+I+", sizingMethod='auto expand')",S.style.backgroundColor=this.rotatedHtmlBackground,this.state.alpha<1&&(S.style.filter+="alpha(opacity="+this.state.alpha*100+")"),S.appendChild(C),C.style.position="",C.style.visibility=""}else if(document.documentMode!=8||mxClient.IS_EM){C.style.verticalAlign="top",this.state.alpha<1&&(g.style.filter="alpha(opacity="+this.state.alpha*100+")");var H=C.parentNode;C.style.visibility="hidden",document.body.appendChild(C),i=C.offsetWidth;var b=C.offsetHeight;mxClient.IS_QUIRKS&&p&&b>n&&(b=n,C.style.height=b+"px"),n=b,C.style.visibility="",H.appendChild(C),g.style.left=this.format(t+i*y*this.state.scale)+"px",g.style.top=this.format(e+n*T*this.state.scale)+"px"}else this.state.alpha<1&&(C.style.filter="alpha(opacity="+this.state.alpha*100+")"),c.style.left=y*100+"%",c.style.top=T*100+"%"}else this.plainText(t,e,i,n,mxUtils.htmlEntities(r,!1),s,l,a,o,u,p,m,d)}},mxVmlCanvas2D.prototype.plainText=function(t,e,i,n,r,s,l,a,o,u,p,m,d){var x=this.state;t=(t+x.dx)*x.scale,e=(e+x.dy)*x.scale;var f=this.createVmlElement("shape");f.style.width="1px",f.style.height="1px",f.stroked="false";var g=this.createVmlElement("fill");g.color=x.fontColor,g.opacity=x.alpha*100+"%",f.appendChild(g);var c=this.createVmlElement("path");c.textpathok="true",c.v="m "+this.format(0)+" "+this.format(0)+" l "+this.format(1)+" "+this.format(0),f.appendChild(c);var v=this.createVmlElement("textpath");v.style.cssText="v-text-align:"+s,v.style.align=s,v.style.fontFamily=x.fontFamily,v.string=r,v.on="true";var y=x.fontSize*x.scale/this.vmlScale;v.style.fontSize=y+"px",(x.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(v.style.fontWeight="bold"),(x.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(v.style.fontStyle="italic"),(x.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&(v.style.textDecoration="underline");var T=r.split(` -`),C=y+(T.length-1)*y*mxConstants.LINE_HEIGHT,S=0,E=0;if(l==mxConstants.ALIGN_BOTTOM?E=-C/2:l!=mxConstants.ALIGN_MIDDLE&&(E=C/2),m!=null){f.style.rotation=m;var L=m*(Math.PI/180);S=Math.sin(L)*E,E=Math.cos(L)*E}f.appendChild(v),f.style.left=this.format(t-S)+"px",f.style.top=this.format(e+E)+"px",this.root.appendChild(f)},mxVmlCanvas2D.prototype.stroke=function(){this.addNode(!1,!0)},mxVmlCanvas2D.prototype.fill=function(){this.addNode(!0,!1)},mxVmlCanvas2D.prototype.fillAndStroke=function(){this.addNode(!0,!0)},__mxOutput.mxVmlCanvas2D=typeof mxVmlCanvas2D<"u"?mxVmlCanvas2D:void 0;function mxGuide(t,e){this.graph=t,this.setStates(e)}mxGuide.prototype.graph=null,mxGuide.prototype.states=null,mxGuide.prototype.horizontal=!0,mxGuide.prototype.vertical=!0,mxGuide.prototype.guideX=null,mxGuide.prototype.guideY=null,mxGuide.prototype.rounded=!1,mxGuide.prototype.tolerance=2,mxGuide.prototype.setStates=function(t){this.states=t},mxGuide.prototype.isEnabledForEvent=function(t){return!0},mxGuide.prototype.getGuideTolerance=function(t){return t&&this.graph.gridEnabled?this.graph.gridSize/2:this.tolerance},mxGuide.prototype.createGuideShape=function(t){var e=new mxPolyline([],mxConstants.GUIDE_COLOR,mxConstants.GUIDE_STROKEWIDTH);return e.isDashed=!0,e},mxGuide.prototype.isStateIgnored=function(t){return!1},mxGuide.prototype.move=function(t,e,i,n){if(this.states!=null&&(this.horizontal||this.vertical)&&t!=null&&e!=null){let R=function(_,b,k){var G=!1;k&&Math.abs(_-v)0&&t[0]!=null){this.bounds=new mxRectangle(Number(t[0].x),Number(t[0].y),1,1);for(var e=1;e0&&this.bounds!=null&&!isNaN(this.bounds.x)&&!isNaN(this.bounds.y)&&!isNaN(this.bounds.width)&&!isNaN(this.bounds.height)&&this.bounds.width>0&&this.bounds.height>0},mxShape.prototype.createVmlGroup=function(){var t=document.createElement(mxClient.VML_PREFIX+":group");return t.style.position="absolute",t.style.width=this.node.style.width,t.style.height=this.node.style.height,t},mxShape.prototype.redrawShape=function(){var t=this.createCanvas();t!=null&&(t.pointerEvents=this.pointerEvents,this.beforePaint(t),this.paint(t),this.afterPaint(t),this.node!=t.root&&this.node.insertAdjacentHTML("beforeend",t.root.outerHTML),this.node.nodeName=="DIV"&&document.documentMode==8&&(this.node.style.filter="",mxUtils.addTransparentBackgroundFilter(this.node)),this.destroyCanvas(t))},mxShape.prototype.createCanvas=function(){var t=null;return this.node.ownerSVGElement!=null?t=this.createSvgCanvas():mxClient.IS_VML&&(this.updateVmlContainer(),t=this.createVmlCanvas()),t!=null&&this.outline&&(t.setStrokeWidth(this.strokewidth),t.setStrokeColor(this.stroke),this.isDashed!=null&&t.setDashed(this.isDashed),t.setStrokeWidth=function(){},t.setStrokeColor=function(){},t.setFillColor=function(){},t.setGradient=function(){},t.setDashed=function(){},t.text=function(){}),t},mxShape.prototype.createSvgCanvas=function(){var t=new mxSvgCanvas2D(this.node,!1);t.strokeTolerance=this.pointerEvents?this.svgStrokeTolerance:0,t.pointerEventsValue=this.svgPointerEvents;var e=this.getSvgScreenOffset();return e!=0?this.node.setAttribute("transform","translate("+e+","+e+")"):this.node.removeAttribute("transform"),t.minStrokeWidth=this.minSvgStrokeWidth,this.antiAlias||(t.format=function(i){return Math.round(parseFloat(i))}),t},mxShape.prototype.createVmlCanvas=function(){var t=document.documentMode==8&&this.isParseVml()?this.createVmlGroup():this.node,e=new mxVmlCanvas2D(t);if(t.tagUrn!=""){var i=Math.max(1,Math.round(this.bounds.width)),n=Math.max(1,Math.round(this.bounds.height));t.coordsize=i*this.vmlScale+","+n*this.vmlScale,e.scale(this.vmlScale),e.vmlScale=this.vmlScale}var r=this.scale;return e.translate(-Math.round(this.bounds.x/r),-Math.round(this.bounds.y/r)),e},mxShape.prototype.updateVmlContainer=function(){this.node.style.left=Math.round(this.bounds.x)+"px",this.node.style.top=Math.round(this.bounds.y)+"px";var t=Math.max(1,Math.round(this.bounds.width)),e=Math.max(1,Math.round(this.bounds.height));this.node.style.width=t+"px",this.node.style.height=e+"px",this.node.style.overflow="visible"},mxShape.prototype.redrawHtmlShape=function(){this.updateHtmlBounds(this.node),this.updateHtmlFilters(this.node),this.updateHtmlColors(this.node)},mxShape.prototype.updateHtmlFilters=function(t){var e="";if(this.opacity<100&&(e+="alpha(opacity="+this.opacity+")"),this.isShadow&&(e+="progid:DXImageTransform.Microsoft.dropShadow (OffX='"+Math.round(mxConstants.SHADOW_OFFSET_X*this.scale)+"', OffY='"+Math.round(mxConstants.SHADOW_OFFSET_Y*this.scale)+"', Color='"+mxConstants.VML_SHADOWCOLOR+"')"),this.fill!=null&&this.fill!=mxConstants.NONE&&this.gradient&&this.gradient!=mxConstants.NONE){var i=this.fill,n=this.gradient,r="0",s={east:0,south:1,west:2,north:3},l=this.direction!=null?s[this.direction]:0;if(this.gradientDirection!=null&&(l=mxUtils.mod(l+s[this.gradientDirection]-1,4)),l==1){r="1";var a=i;i=n,n=a}else if(l==2){var a=i;i=n,n=a}else l==3&&(r="1");e+="progid:DXImageTransform.Microsoft.gradient(startColorStr='"+i+"', endColorStr='"+n+"', gradientType='"+r+"')"}t.style.filter=e},mxShape.prototype.updateHtmlColors=function(t){var e=this.stroke;e!=null&&e!=mxConstants.NONE?(t.style.borderColor=e,this.isDashed?t.style.borderStyle="dashed":this.strokewidth>0&&(t.style.borderStyle="solid"),t.style.borderWidth=Math.max(1,Math.ceil(this.strokewidth*this.scale))+"px"):t.style.borderWidth="0px",e=this.outline?null:this.fill,e!=null&&e!=mxConstants.NONE?(t.style.backgroundColor=e,t.style.backgroundImage="none"):this.pointerEvents?t.style.backgroundColor="transparent":document.documentMode==8?mxUtils.addTransparentBackgroundFilter(t):this.setTransparentBackgroundImage(t)},mxShape.prototype.updateHtmlBounds=function(t){var e=document.documentMode>=9?0:Math.ceil(this.strokewidth*this.scale);t.style.borderWidth=Math.max(1,e)+"px",t.style.overflow="hidden",t.style.left=Math.round(this.bounds.x-e/2)+"px",t.style.top=Math.round(this.bounds.y-e/2)+"px",document.compatMode=="CSS1Compat"&&(e=-e),t.style.width=Math.round(Math.max(0,this.bounds.width+e))+"px",t.style.height=Math.round(Math.max(0,this.bounds.height+e))+"px"},mxShape.prototype.destroyCanvas=function(t){if(t instanceof mxSvgCanvas2D){for(var e in t.gradients){var i=t.gradients[e];i!=null&&(i.mxRefCount=(i.mxRefCount||0)+1)}this.releaseSvgGradients(this.oldGradients),this.oldGradients=t.gradients}},mxShape.prototype.beforePaint=function(t){},mxShape.prototype.afterPaint=function(t){},mxShape.prototype.paint=function(t){var e=!1;if(t!=null&&this.outline){var i=t.stroke;t.stroke=function(){e=!0,i.apply(this,arguments)};var n=t.fillAndStroke;t.fillAndStroke=function(){e=!0,n.apply(this,arguments)}}var r=this.scale,s=this.bounds.x/r,l=this.bounds.y/r,a=this.bounds.width/r,o=this.bounds.height/r;if(this.isPaintBoundsInverted()){var u=(a-o)/2;s+=u,l-=u;var p=a;a=o,o=p}this.updateTransform(t,s,l,a,o),this.configureCanvas(t,s,l,a,o);var m=null;if(this.stencil==null&&this.points==null&&this.shapePointerEvents||this.stencil!=null&&this.stencilPointerEvents){var d=this.createBoundingBox();if(this.dialect==mxConstants.DIALECT_SVG)m=this.createTransparentSvgRectangle(d.x,d.y,d.width,d.height),this.node.appendChild(m);else{var x=t.createRect("rect",d.x/r,d.y/r,d.width/r,d.height/r);x.appendChild(t.createTransparentFill()),x.stroked="false",t.root.appendChild(x)}}if(this.stencil!=null)this.stencil.drawShape(t,this,s,l,a,o);else if(t.setStrokeWidth(this.strokewidth),this.points!=null){for(var f=[],g=0;g0){l=l??!0;var a=e[e.length-1];if(r&&i){e=e.slice();var o=e[0],u=new mxPoint(a.x+(o.x-a.x)/2,a.y+(o.y-a.y)/2);e.splice(0,0,u)}var p=e[0],m=1;for(l?t.moveTo(p.x,p.y):t.lineTo(p.x,p.y);m<(r?e.length:e.length-1);){var d=e[mxUtils.mod(m,e.length)],x=p.x-d.x,f=p.y-d.y;if(i&&(x!=0||f!=0)&&(s==null||mxUtils.indexOf(s,m-1)<0)){var g=Math.sqrt(x*x+f*f),c=x*Math.min(n,g/2)/g,v=f*Math.min(n,g/2)/g,y=d.x+c,T=d.y+v;t.lineTo(y,T);for(var C=e[mxUtils.mod(m+1,e.length)];m0&&t.height>0){this.boundingBox=new mxRectangle(t.x,t.y,t.width,t.height),this.boundingBox.grow(this.strokewidth*this.scale/2);return}}catch{}if(this.bounds!=null){var e=this.createBoundingBox();if(e!=null){this.augmentBoundingBox(e);var i=this.getShapeRotation();i!=0&&(e=mxUtils.getBoundingBox(e,i))}this.boundingBox=e}},mxShape.prototype.createBoundingBox=function(){var t=this.bounds.clone();return(this.stencil!=null&&(this.direction==mxConstants.DIRECTION_NORTH||this.direction==mxConstants.DIRECTION_SOUTH)||this.isPaintBoundsInverted())&&t.rotate90(),t},mxShape.prototype.augmentBoundingBox=function(t){this.isShadow&&(t.width+=Math.ceil(mxConstants.SHADOW_OFFSET_X*this.scale),t.height+=Math.ceil(mxConstants.SHADOW_OFFSET_Y*this.scale)),t.grow(this.strokewidth*this.scale/2)},mxShape.prototype.isPaintBoundsInverted=function(){return this.stencil==null&&(this.direction==mxConstants.DIRECTION_NORTH||this.direction==mxConstants.DIRECTION_SOUTH)},mxShape.prototype.getRotation=function(){return this.rotation!=null?this.rotation:0},mxShape.prototype.getTextRotation=function(){var t=this.getRotation();return mxUtils.getValue(this.style,mxConstants.STYLE_HORIZONTAL,1)!=1&&(t+=mxText.prototype.verticalTextRotation),t},mxShape.prototype.getShapeRotation=function(){var t=this.getRotation();return this.direction!=null&&(this.direction==mxConstants.DIRECTION_NORTH?t+=270:this.direction==mxConstants.DIRECTION_WEST?t+=180:this.direction==mxConstants.DIRECTION_SOUTH&&(t+=90)),t},mxShape.prototype.createTransparentSvgRectangle=function(t,e,i,n){var r=document.createElementNS(mxConstants.NS_SVG,"rect");return r.setAttribute("x",t),r.setAttribute("y",e),r.setAttribute("width",i),r.setAttribute("height",n),r.setAttribute("fill","none"),r.setAttribute("stroke","none"),r.setAttribute("pointer-events","all"),r},mxShape.prototype.setTransparentBackgroundImage=function(t){t.style.backgroundImage="url('"+mxClient.imageBasePath+"/transparent.gif')"},mxShape.prototype.releaseSvgGradients=function(t){if(t!=null)for(var e in t){var i=t[e];i!=null&&(i.mxRefCount=(i.mxRefCount||0)-1,i.mxRefCount==0&&i.parentNode!=null&&i.parentNode.removeChild(i))}},mxShape.prototype.destroy=function(){this.node!=null&&(mxEvent.release(this.node),this.node.parentNode!=null&&this.node.parentNode.removeChild(this.node),this.node=null),this.releaseSvgGradients(this.oldGradients),this.oldGradients=null},__mxOutput.mxShape=typeof mxShape<"u"?mxShape:void 0;function mxStencil(t){this.desc=t,this.parseDescription(),this.parseConstraints()}mxUtils.extend(mxStencil,mxShape),mxStencil.defaultLocalized=!1,mxStencil.allowEval=!1,mxStencil.prototype.desc=null,mxStencil.prototype.constraints=null,mxStencil.prototype.aspect=null,mxStencil.prototype.w0=null,mxStencil.prototype.h0=null,mxStencil.prototype.bgNode=null,mxStencil.prototype.fgNode=null,mxStencil.prototype.strokewidth=null,mxStencil.prototype.parseDescription=function(){this.fgNode=this.desc.getElementsByTagName("foreground")[0],this.bgNode=this.desc.getElementsByTagName("background")[0],this.w0=Number(this.desc.getAttribute("w")||100),this.h0=Number(this.desc.getAttribute("h")||100);var t=this.desc.getAttribute("aspect");this.aspect=t??"variable";var e=this.desc.getAttribute("strokewidth");this.strokewidth=e??"1"},mxStencil.prototype.parseConstraints=function(){var t=this.desc.getElementsByTagName("connections")[0];if(t!=null){var e=mxUtils.getChildNodes(t);if(e!=null&&e.length>0){this.constraints=[];for(var i=0;i0&&s>0)for(var p=l.firstChild;p!=null;)p.nodeType==mxConstants.NODETYPE_ELEMENT&&this.drawNode(t,e,p,a,o,u),p=p.nextSibling},mxStencil.prototype.computeAspect=function(t,e,i,n,r,s){var l=e,a=i,o=n/this.w0,u=r/this.h0,p=s==mxConstants.DIRECTION_NORTH||s==mxConstants.DIRECTION_SOUTH;if(p){u=n/this.h0,o=r/this.w0;var m=(n-r)/2;l+=m,a-=m}return this.aspect=="fixed"&&(u=Math.min(o,u),o=u,p?(l+=(r-this.w0*o)/2,a+=(n-this.h0*u)/2):(l+=(n-this.w0*o)/2,a+=(r-this.h0*u)/2)),new mxRectangle(l,a,o,u)},mxStencil.prototype.drawNode=function(t,e,i,n,r,s){var l=i.nodeName,a=n.x,o=n.y,u=n.width,p=n.height,m=Math.min(u,p);if(l=="save")t.save();else if(l=="restore")t.restore();else if(s){if(l=="path"){t.begin();var d=!0;if(i.getAttribute("rounded")=="1"){d=!1;for(var x=Number(i.getAttribute("arcSize")),f=0,g=[],c=i.firstChild;c!=null;){if(c.nodeType==mxConstants.NODETYPE_ELEMENT){var v=c.nodeName;if(v=="move"||v=="line")(v=="move"||g.length==0)&&g.push([]),g[g.length-1].push(new mxPoint(a+Number(c.getAttribute("x"))*u,o+Number(c.getAttribute("y"))*p)),f++;else{d=!0;break}}c=c.nextSibling}if(!d&&f>0)for(var y=0;y0&&V.push(Number(X[y])*m);W=V.join(" "),t.setDashPattern(W)}}else l=="strokecolor"?t.setStrokeColor(i.getAttribute("color")):l=="linecap"?t.setLineCap(i.getAttribute("cap")):l=="linejoin"?t.setLineJoin(i.getAttribute("join")):l=="miterlimit"?t.setMiterLimit(Number(i.getAttribute("limit"))):l=="fillcolor"?t.setFillColor(i.getAttribute("color")):l=="alpha"||l=="fillalpha"||l=="strokealpha"?t.setAlpha(i.getAttribute("alpha")):l=="fontcolor"?t.setFontColor(i.getAttribute("color")):l=="fontstyle"?t.setFontStyle(i.getAttribute("style")):l=="fontfamily"?t.setFontFamily(i.getAttribute("family")):l=="fontsize"&&t.setFontSize(Number(i.getAttribute("size"))*m);r&&(l=="fillstroke"||l=="fill"||l=="stroke")&&(r=!1,t.setShadow(!1))}},__mxOutput.mxStencil=typeof mxStencil<"u"?mxStencil:void 0;var mxStencilRegistry={stencils:{},addStencil:function(t,e){mxStencilRegistry.stencils[t]=e},getStencil:function(t){return mxStencilRegistry.stencils[t]}};__mxOutput.mxStencilRegistry=typeof mxStencilRegistry<"u"?mxStencilRegistry:void 0;var mxMarker={markers:[],addMarker:function(t,e){mxMarker.markers[t]=e},createMarker:function(t,e,i,n,r,s,l,a,o,u){var p=mxMarker.markers[i];return p!=null?p(t,e,i,n,r,s,l,a,o,u):null}};(function(){function t(n){return n=n??2,function(r,s,l,a,o,u,p,m,d,x){var f=o*d*1.118,g=u*d*1.118;o=o*(p+d),u=u*(p+d);var c=a.clone();c.x-=f,c.y-=g;var v=l!=mxConstants.ARROW_CLASSIC&&l!=mxConstants.ARROW_CLASSIC_THIN?1:3/4;return a.x+=-o*v-f,a.y+=-u*v-g,function(){r.begin(),r.moveTo(c.x,c.y),r.lineTo(c.x-o-u/n,c.y-u+o/n),(l==mxConstants.ARROW_CLASSIC||l==mxConstants.ARROW_CLASSIC_THIN)&&r.lineTo(c.x-o*3/4,c.y-u*3/4),r.lineTo(c.x+u/n-o,c.y-u-o/n),r.close(),x?r.fillAndStroke():r.stroke()}}}mxMarker.addMarker("classic",t(2)),mxMarker.addMarker("classicThin",t(3)),mxMarker.addMarker("block",t(2)),mxMarker.addMarker("blockThin",t(3));function e(n){return n=n??2,function(r,s,l,a,o,u,p,m,d,x){var f=o*d*1.118,g=u*d*1.118;o=o*(p+d),u=u*(p+d);var c=a.clone();return c.x-=f,c.y-=g,a.x+=-f*2,a.y+=-g*2,function(){r.begin(),r.moveTo(c.x-o-u/n,c.y-u+o/n),r.lineTo(c.x,c.y),r.lineTo(c.x+u/n-o,c.y-u-o/n),r.stroke()}}}mxMarker.addMarker("open",e(2)),mxMarker.addMarker("openThin",e(3)),mxMarker.addMarker("oval",function(n,r,s,l,a,o,u,p,m,d){var x=u/2,f=l.clone();return l.x-=a*x,l.y-=o*x,function(){n.ellipse(f.x-x,f.y-x,u,u),d?n.fillAndStroke():n.stroke()}});function i(n,r,s,l,a,o,u,p,m,d){var x=s==mxConstants.ARROW_DIAMOND?.7071:.9862,f=a*m*x,g=o*m*x;a=a*(u+m),o=o*(u+m);var c=l.clone();c.x-=f,c.y-=g,l.x+=-a-f,l.y+=-o-g;var v=s==mxConstants.ARROW_DIAMOND?2:3.4;return function(){n.begin(),n.moveTo(c.x,c.y),n.lineTo(c.x-a/2-o/v,c.y+a/v-o/2),n.lineTo(c.x-a,c.y-o),n.lineTo(c.x-a/2+o/v,c.y-o/2-a/v),n.close(),d?n.fillAndStroke():n.stroke()}}mxMarker.addMarker("diamond",i),mxMarker.addMarker("diamondThin",i)})(),__mxOutput.mxMarker=typeof mxMarker<"u"?mxMarker:void 0;function mxActor(t,e,i,n){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=i,this.strokewidth=n??1}mxUtils.extend(mxActor,mxShape),mxActor.prototype.paintVertexShape=function(t,e,i,n,r){t.translate(e,i),t.begin(),this.redrawPath(t,e,i,n,r),t.fillAndStroke()},mxActor.prototype.redrawPath=function(t,e,i,n,r){var s=n/3;t.moveTo(0,r),t.curveTo(0,3*r/5,0,2*r/5,n/2,2*r/5),t.curveTo(n/2-s,2*r/5,n/2-s,0,n/2,0),t.curveTo(n/2+s,0,n/2+s,2*r/5,n/2,2*r/5),t.curveTo(n,2*r/5,n,3*r/5,n,r),t.close()},__mxOutput.mxActor=typeof mxActor<"u"?mxActor:void 0;function mxCloud(t,e,i,n){mxActor.call(this),this.bounds=t,this.fill=e,this.stroke=i,this.strokewidth=n??1}mxUtils.extend(mxCloud,mxActor),mxCloud.prototype.redrawPath=function(t,e,i,n,r){t.moveTo(.25*n,.25*r),t.curveTo(.05*n,.25*r,0,.5*r,.16*n,.55*r),t.curveTo(0,.66*r,.18*n,.9*r,.31*n,.8*r),t.curveTo(.4*n,r,.7*n,r,.8*n,.8*r),t.curveTo(n,.8*r,n,.6*r,.875*n,.5*r),t.curveTo(n,.3*r,.8*n,.1*r,.625*n,.2*r),t.curveTo(.5*n,.05*r,.3*n,.05*r,.25*n,.25*r),t.close()},__mxOutput.mxCloud=typeof mxCloud<"u"?mxCloud:void 0;function mxRectangleShape(t,e,i,n){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=i,this.strokewidth=n??1}mxUtils.extend(mxRectangleShape,mxShape),mxRectangleShape.prototype.isHtmlAllowed=function(){var t=!0;return this.style!=null&&(t=mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1")=="1"),!this.isRounded&&!this.glass&&this.rotation==0&&(t||this.fill!=null&&this.fill!=mxConstants.NONE)},mxRectangleShape.prototype.paintBackground=function(t,e,i,n,r){var s=!0;if(this.style!=null&&(s=mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1")=="1"),s||this.fill!=null&&this.fill!=mxConstants.NONE||this.stroke!=null&&this.stroke!=mxConstants.NONE){if(!s&&(this.fill==null||this.fill==mxConstants.NONE)&&(t.pointerEvents=!1),this.isRounded){var l=0;if(mxUtils.getValue(this.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0)=="1")l=Math.min(n/2,Math.min(r/2,mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2));else{var a=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.RECTANGLE_ROUNDING_FACTOR*100)/100;l=Math.min(n*a,r*a)}t.roundrect(e,i,n,r,l,l)}else t.rect(e,i,n,r);t.fillAndStroke()}},mxRectangleShape.prototype.isRoundable=function(t,e,i,n,r){return!0},mxRectangleShape.prototype.paintForeground=function(t,e,i,n,r){this.glass&&!this.outline&&this.fill!=null&&this.fill!=mxConstants.NONE&&this.paintGlassEffect(t,e,i,n,r,this.getArcSize(n+this.strokewidth,r+this.strokewidth))},__mxOutput.mxRectangleShape=typeof mxRectangleShape<"u"?mxRectangleShape:void 0;function mxEllipse(t,e,i,n){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=i,this.strokewidth=n??1}mxUtils.extend(mxEllipse,mxShape),mxEllipse.prototype.paintVertexShape=function(t,e,i,n,r){t.ellipse(e,i,n,r),t.fillAndStroke()},__mxOutput.mxEllipse=typeof mxEllipse<"u"?mxEllipse:void 0;function mxDoubleEllipse(t,e,i,n){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=i,this.strokewidth=n??1}mxUtils.extend(mxDoubleEllipse,mxShape),mxDoubleEllipse.prototype.vmlScale=10,mxDoubleEllipse.prototype.paintBackground=function(t,e,i,n,r){t.ellipse(e,i,n,r),t.fillAndStroke()},mxDoubleEllipse.prototype.paintForeground=function(t,e,i,n,r){if(!this.outline){var s=mxUtils.getValue(this.style,mxConstants.STYLE_MARGIN,Math.min(3+this.strokewidth,Math.min(n/5,r/5)));e+=s,i+=s,n-=2*s,r-=2*s,n>0&&r>0&&t.ellipse(e,i,n,r),t.stroke()}},mxDoubleEllipse.prototype.getLabelBounds=function(t){var e=mxUtils.getValue(this.style,mxConstants.STYLE_MARGIN,Math.min(3+this.strokewidth,Math.min(t.width/5/this.scale,t.height/5/this.scale)))*this.scale;return new mxRectangle(t.x+e,t.y+e,t.width-2*e,t.height-2*e)},__mxOutput.mxDoubleEllipse=typeof mxDoubleEllipse<"u"?mxDoubleEllipse:void 0;function mxRhombus(t,e,i,n){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=i,this.strokewidth=n??1}mxUtils.extend(mxRhombus,mxShape),mxRhombus.prototype.isRoundable=function(){return!0},mxRhombus.prototype.paintVertexShape=function(t,e,i,n,r){var s=n/2,l=r/2,a=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;t.begin(),this.addPoints(t,[new mxPoint(e+s,i),new mxPoint(e+n,i+l),new mxPoint(e+s,i+r),new mxPoint(e,i+l)],this.isRounded,a,!0),t.fillAndStroke()},__mxOutput.mxRhombus=typeof mxRhombus<"u"?mxRhombus:void 0;function mxPolyline(t,e,i){mxShape.call(this),this.points=t,this.stroke=e,this.strokewidth=i??1}mxUtils.extend(mxPolyline,mxShape),mxPolyline.prototype.getRotation=function(){return 0},mxPolyline.prototype.getShapeRotation=function(){return 0},mxPolyline.prototype.isPaintBoundsInverted=function(){return!1},mxPolyline.prototype.paintEdgeShape=function(t,e){var i=t.pointerEventsValue;t.pointerEventsValue="stroke",this.style==null||this.style[mxConstants.STYLE_CURVED]!=1?this.paintLine(t,e,this.isRounded):this.paintCurvedLine(t,e),t.pointerEventsValue=i},mxPolyline.prototype.paintLine=function(t,e,i){var n=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;t.begin(),this.addPoints(t,e,i,n,!1),t.stroke()},mxPolyline.prototype.paintCurvedLine=function(t,e){t.begin();var i=e[0],n=e.length;t.moveTo(i.x,i.y);for(var r=1;r2&&t.setMiterLimit(1.42),t.begin();var P=y,R=S;if(a&&!l)this.paintMarker(t,e[0].x,e[0].y,y,S,p,n,s,u,!0);else{var O=e[0].x+A/2+u*y,_=e[0].y+M/2+u*S,b=e[0].x-A/2+u*y,k=e[0].y-M/2+u*S;l?(t.moveTo(O,_),I.push(function(){t.lineTo(b,k)})):(t.moveTo(b,k),t.lineTo(O,_))}for(var G=0,B=0,j=0,H=0;H=0;H--)I[H]();l?(t.end(),t.stroke()):(t.close(),t.fillAndStroke()),t.setShadow(!1),t.setMiterLimit(4),d&&t.setLineJoin("flat"),e.length>2&&(t.setMiterLimit(4),a&&!l&&(t.begin(),this.paintMarker(t,e[0].x,e[0].y,P,R,p,n,s,u,!0),t.stroke(),t.end()),o&&!l&&(t.begin(),this.paintMarker(t,x.x,x.y,-y,-S,m,r,s,u,!0),t.stroke(),t.end()))}},mxArrowConnector.prototype.paintMarker=function(t,e,i,n,r,s,l,a,o,u){var p=a/l,m=a*r/2,d=-a*n/2,x=(o+s)*n,f=(o+s)*r;u?t.moveTo(e-m+x,i-d+f):t.lineTo(e-m+x,i-d+f),t.lineTo(e-m/p+x,i-d/p+f),t.lineTo(e+o*n,i+o*r),t.lineTo(e+m/p+x,i+d/p+f),t.lineTo(e+m+x,i+d+f)},mxArrowConnector.prototype.isArrowRounded=function(){return this.isRounded},mxArrowConnector.prototype.getStartArrowWidth=function(){return mxConstants.ARROW_WIDTH},mxArrowConnector.prototype.getEndArrowWidth=function(){return mxConstants.ARROW_WIDTH},mxArrowConnector.prototype.getEdgeWidth=function(){return mxConstants.ARROW_WIDTH/3},mxArrowConnector.prototype.isOpenEnded=function(){return!1},mxArrowConnector.prototype.isMarkerStart=function(){return mxUtils.getValue(this.style,mxConstants.STYLE_STARTARROW,mxConstants.NONE)!=mxConstants.NONE},mxArrowConnector.prototype.isMarkerEnd=function(){return mxUtils.getValue(this.style,mxConstants.STYLE_ENDARROW,mxConstants.NONE)!=mxConstants.NONE},__mxOutput.mxArrowConnector=typeof mxArrowConnector<"u"?mxArrowConnector:void 0;function mxText(t,e,i,n,r,s,l,a,o,u,p,m,d,x,f,g,c,v,y,T,C){mxShape.call(this),this.value=t,this.bounds=e,this.color=r??"black",this.align=i??mxConstants.ALIGN_CENTER,this.valign=n??mxConstants.ALIGN_MIDDLE,this.family=s??mxConstants.DEFAULT_FONTFAMILY,this.size=l??mxConstants.DEFAULT_FONTSIZE,this.fontStyle=a??mxConstants.DEFAULT_FONTSTYLE,this.spacing=parseInt(o||2),this.spacingTop=this.spacing+parseInt(u||0),this.spacingRight=this.spacing+parseInt(p||0),this.spacingBottom=this.spacing+parseInt(m||0),this.spacingLeft=this.spacing+parseInt(d||0),this.horizontal=x??!0,this.background=f,this.border=g,this.wrap=c??!1,this.clipped=v??!1,this.overflow=y??"visible",this.labelPadding=T??0,this.textDirection=C,this.rotation=0,this.updateMargin()}mxUtils.extend(mxText,mxShape),mxText.prototype.baseSpacingTop=0,mxText.prototype.baseSpacingBottom=0,mxText.prototype.baseSpacingLeft=0,mxText.prototype.baseSpacingRight=0,mxText.prototype.replaceLinefeeds=!0,mxText.prototype.verticalTextRotation=-90,mxText.prototype.ignoreClippedStringSize=!0,mxText.prototype.ignoreStringSize=!1,mxText.prototype.textWidthPadding=document.documentMode==8&&!mxClient.IS_EM?4:3,mxText.prototype.lastValue=null,mxText.prototype.cacheEnabled=!0,mxText.prototype.isParseVml=function(){return!1},mxText.prototype.isHtmlAllowed=function(){return document.documentMode!=8||mxClient.IS_EM},mxText.prototype.getSvgScreenOffset=function(){return 0},mxText.prototype.checkBounds=function(){return!isNaN(this.scale)&&isFinite(this.scale)&&this.scale>0&&this.bounds!=null&&!isNaN(this.bounds.x)&&!isNaN(this.bounds.y)&&!isNaN(this.bounds.width)&&!isNaN(this.bounds.height)},mxText.prototype.paint=function(t,e){var i=this.scale,n=this.bounds.x/i,r=this.bounds.y/i,s=this.bounds.width/i,l=this.bounds.height/i;if(this.updateTransform(t,n,r,s,l),this.configureCanvas(t,n,r,s,l),e)t.updateText(n,r,s,l,this.align,this.valign,this.wrap,this.overflow,this.clipped,this.getTextRotation(),this.node);else{var a=mxUtils.isNode(this.value)||this.dialect==mxConstants.DIALECT_STRICTHTML,o=a||t instanceof mxVmlCanvas2D?"html":"",u=this.value;!a&&o=="html"&&(u=mxUtils.htmlEntities(u,!1)),o=="html"&&!mxUtils.isNode(this.value)&&(u=mxUtils.replaceTrailingNewlines(u,"

")),u=!mxUtils.isNode(this.value)&&this.replaceLinefeeds&&o=="html"?u.replace(/\n/g,"
"):u;var p=this.textDirection;p==mxConstants.TEXT_DIRECTION_AUTO&&!a&&(p=this.getAutoDirection()),p!=mxConstants.TEXT_DIRECTION_LTR&&p!=mxConstants.TEXT_DIRECTION_RTL&&(p=null),t.text(n,r,s,l,u,this.align,this.valign,this.wrap,o,this.overflow,this.clipped,this.getTextRotation(),p)}},mxText.prototype.redraw=function(){if(this.visible&&this.checkBounds()&&this.cacheEnabled&&this.lastValue==this.value&&(mxUtils.isNode(this.value)||this.dialect==mxConstants.DIALECT_STRICTHTML))if(this.node.nodeName=="DIV"&&(this.isHtmlAllowed()||!mxClient.IS_VML))mxClient.IS_SVG?this.redrawHtmlShapeWithCss3():(this.updateSize(this.node,this.state==null||this.state.view.textDiv==null),mxClient.IS_IE&&(document.documentMode==null||document.documentMode<=8)?this.updateHtmlFilter():this.updateHtmlTransform()),this.updateBoundingBox();else{var t=this.createCanvas();t!=null&&t.updateText!=null?(t.pointerEvents=this.pointerEvents,this.paint(t,!0),this.destroyCanvas(t),this.updateBoundingBox()):mxShape.prototype.redraw.apply(this,arguments)}else mxShape.prototype.redraw.apply(this,arguments),mxUtils.isNode(this.value)||this.dialect==mxConstants.DIALECT_STRICTHTML?this.lastValue=this.value:this.lastValue=null},mxText.prototype.resetStyles=function(){mxShape.prototype.resetStyles.apply(this,arguments),this.color="black",this.align=mxConstants.ALIGN_CENTER,this.valign=mxConstants.ALIGN_MIDDLE,this.family=mxConstants.DEFAULT_FONTFAMILY,this.size=mxConstants.DEFAULT_FONTSIZE,this.fontStyle=mxConstants.DEFAULT_FONTSTYLE,this.spacing=2,this.spacingTop=2,this.spacingRight=2,this.spacingBottom=2,this.spacingLeft=2,this.horizontal=!0,delete this.background,delete this.border,this.textDirection=mxConstants.DEFAULT_TEXT_DIRECTION,delete this.margin},mxText.prototype.apply=function(t){var e=this.spacing;mxShape.prototype.apply.apply(this,arguments),this.style!=null&&(this.fontStyle=mxUtils.getValue(this.style,mxConstants.STYLE_FONTSTYLE,this.fontStyle),this.family=mxUtils.getValue(this.style,mxConstants.STYLE_FONTFAMILY,this.family),this.size=mxUtils.getValue(this.style,mxConstants.STYLE_FONTSIZE,this.size),this.color=mxUtils.getValue(this.style,mxConstants.STYLE_FONTCOLOR,this.color),this.align=mxUtils.getValue(this.style,mxConstants.STYLE_ALIGN,this.align),this.valign=mxUtils.getValue(this.style,mxConstants.STYLE_VERTICAL_ALIGN,this.valign),this.spacing=parseInt(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING,this.spacing)),this.spacingTop=parseInt(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING_TOP,this.spacingTop-e))+this.spacing,this.spacingRight=parseInt(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING_RIGHT,this.spacingRight-e))+this.spacing,this.spacingBottom=parseInt(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING_BOTTOM,this.spacingBottom-e))+this.spacing,this.spacingLeft=parseInt(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING_LEFT,this.spacingLeft-e))+this.spacing,this.horizontal=mxUtils.getValue(this.style,mxConstants.STYLE_HORIZONTAL,this.horizontal),this.background=mxUtils.getValue(this.style,mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,this.background),this.border=mxUtils.getValue(this.style,mxConstants.STYLE_LABEL_BORDERCOLOR,this.border),this.textDirection=mxUtils.getValue(this.style,mxConstants.STYLE_TEXT_DIRECTION,mxConstants.DEFAULT_TEXT_DIRECTION),this.opacity=mxUtils.getValue(this.style,mxConstants.STYLE_TEXT_OPACITY,100),this.updateMargin()),this.flipV=null,this.flipH=null},mxText.prototype.getAutoDirection=function(){var t=/[A-Za-z\u05d0-\u065f\u066a-\u06ef\u06fa-\u07ff\ufb1d-\ufdff\ufe70-\ufefc]/.exec(this.value);return t!=null&&t.length>0&&t[0]>"z"?mxConstants.TEXT_DIRECTION_RTL:mxConstants.TEXT_DIRECTION_LTR},mxText.prototype.getContentNode=function(){var t=this.node;return t!=null&&(t.ownerSVGElement==null?t=this.node.firstChild.firstChild:t=t.firstChild.firstChild.firstChild.firstChild.firstChild),t},mxText.prototype.updateBoundingBox=function(){var t=this.node;this.boundingBox=this.bounds.clone();var e=this.getTextRotation(),i=this.style!=null?mxUtils.getValue(this.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER):null,n=this.style!=null?mxUtils.getValue(this.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE):null;if(!this.ignoreStringSize&&t!=null&&this.overflow!="fill"&&(!this.clipped||!this.ignoreClippedStringSize||i!=mxConstants.ALIGN_CENTER||n!=mxConstants.ALIGN_MIDDLE)){var r=null,s=null;if(t.ownerSVGElement!=null)if(t.firstChild!=null&&t.firstChild.firstChild!=null&&t.firstChild.firstChild.nodeName=="foreignObject")t=t.firstChild.firstChild.firstChild.firstChild,s=t.offsetHeight*this.scale,this.overflow=="width"?r=this.boundingBox.width:r=t.offsetWidth*this.scale;else try{var l=t.getBBox();typeof this.value=="string"&&mxUtils.trim(this.value)==0?this.boundingBox=null:l.width==0&&l.height==0?this.boundingBox=null:this.boundingBox=new mxRectangle(l.x,l.y,l.width,l.height);return}catch{}else{var a=this.state!=null?this.state.view.textDiv:null;if(this.offsetWidth!=null&&this.offsetHeight!=null)r=this.offsetWidth*this.scale,s=this.offsetHeight*this.scale;else{a!=null&&(this.updateFont(a),this.updateSize(a,!1),this.updateInnerHtml(a),t=a);var o=t;if(document.documentMode==8&&!mxClient.IS_EM){var u=Math.round(this.bounds.width/this.scale);if(this.wrap&&u>0){if(t.style.wordWrap=mxConstants.WORD_WRAP,t.style.whiteSpace="normal",t.style.wordWrap!="break-word"){var p=o.getElementsByTagName("div");p.length>0&&(o=p[p.length-1]),r=o.offsetWidth+2,p=this.node.getElementsByTagName("div"),this.clipped&&(r=Math.min(u,r)),p.length>1&&(p[p.length-2].style.width=r+"px")}}else t.style.whiteSpace="nowrap"}else o.firstChild!=null&&o.firstChild.nodeName=="DIV"&&(o=o.firstChild);this.offsetWidth=o.offsetWidth+this.textWidthPadding,this.offsetHeight=o.offsetHeight,r=this.offsetWidth*this.scale,s=this.offsetHeight*this.scale}}r!=null&&s!=null&&(this.boundingBox=new mxRectangle(this.bounds.x,this.bounds.y,r,s))}if(this.boundingBox!=null)if(e!=0){var m=mxUtils.getBoundingBox(new mxRectangle(this.margin.x*this.boundingBox.width,this.margin.y*this.boundingBox.height,this.boundingBox.width,this.boundingBox.height),e,new mxPoint(0,0));this.unrotatedBoundingBox=mxRectangle.fromRectangle(this.boundingBox),this.unrotatedBoundingBox.x+=this.margin.x*this.unrotatedBoundingBox.width,this.unrotatedBoundingBox.y+=this.margin.y*this.unrotatedBoundingBox.height,this.boundingBox.x+=m.x,this.boundingBox.y+=m.y,this.boundingBox.width=m.width,this.boundingBox.height=m.height}else this.boundingBox.x+=this.margin.x*this.boundingBox.width,this.boundingBox.y+=this.margin.y*this.boundingBox.height,this.unrotatedBoundingBox=null},mxText.prototype.getShapeRotation=function(){return 0},mxText.prototype.getTextRotation=function(){return this.state!=null&&this.state.shape!=null?this.state.shape.getTextRotation():0},mxText.prototype.isPaintBoundsInverted=function(){return!this.horizontal&&this.state!=null&&this.state.view.graph.model.isVertex(this.state.cell)},mxText.prototype.configureCanvas=function(t,e,i,n,r){mxShape.prototype.configureCanvas.apply(this,arguments),t.setFontColor(this.color),t.setFontBackgroundColor(this.background),t.setFontBorderColor(this.border),t.setFontFamily(this.family),t.setFontSize(this.size),t.setFontStyle(this.fontStyle)},mxText.prototype.updateVmlContainer=function(){this.node.style.left=Math.round(this.bounds.x)+"px",this.node.style.top=Math.round(this.bounds.y)+"px",this.node.style.width="1px",this.node.style.height="1px",this.node.style.overflow="visible"},mxText.prototype.getHtmlValue=function(){var t=this.value;return this.dialect!=mxConstants.DIALECT_STRICTHTML&&(t=mxUtils.htmlEntities(t,!1)),t=mxUtils.replaceTrailingNewlines(t,"

"),t=this.replaceLinefeeds?t.replace(/\n/g,"
"):t,t},mxText.prototype.getTextCss=function(){var t=mxConstants.ABSOLUTE_LINE_HEIGHT?this.size*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT,e="display: inline-block; font-size: "+this.size+"px; font-family: "+this.family+"; color: "+this.color+"; line-height: "+t+"; pointer-events: "+(this.pointerEvents?"all":"none")+"; ";(this.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(e+="font-weight: bold; "),(this.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(e+="font-style: italic; ");var i=[];return(this.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&i.push("underline"),(this.fontStyle&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&i.push("line-through"),i.length>0&&(e+="text-decoration: "+i.join(" ")+"; "),e},mxText.prototype.redrawHtmlShape=function(){if(mxClient.IS_SVG)this.redrawHtmlShapeWithCss3();else{var t=this.node.style;t.whiteSpace="normal",t.overflow="",t.width="",t.height="",this.updateValue(),this.updateFont(this.node),this.updateSize(this.node,this.state==null||this.state.view.textDiv==null),this.offsetWidth=null,this.offsetHeight=null,mxClient.IS_IE&&(document.documentMode==null||document.documentMode<=8)?this.updateHtmlFilter():this.updateHtmlTransform()}},mxText.prototype.redrawHtmlShapeWithCss3=function(){var t=Math.max(0,Math.round(this.bounds.width/this.scale)),e=Math.max(0,Math.round(this.bounds.height/this.scale)),i="position: absolute; left: "+Math.round(this.bounds.x)+"px; top: "+Math.round(this.bounds.y)+"px; pointer-events: none; ",n=this.getTextCss();mxSvgCanvas2D.createCss(t+2,e,this.align,this.valign,this.wrap,this.overflow,this.clipped,this.background!=null?mxUtils.htmlEntities(this.background):null,this.border!=null?mxUtils.htmlEntities(this.border):null,i,n,this.scale,mxUtils.bind(this,function(r,s,l,a,o,u){var p=this.getTextRotation(),m=(this.scale!=1?"scale("+this.scale+") ":"")+(p!=0?"rotate("+p+"deg) ":"")+(this.margin.x!=0||this.margin.y!=0?"translate("+this.margin.x*100+"%,"+this.margin.y*100+"%)":"");m!=""&&(m="transform-origin: 0 0; transform: "+m+"; "),u==""?(l+=a,a="display:inline-block; min-width: 100%; "+m):(a+=m,mxClient.IS_SF&&(a+="-webkit-clip-path: content-box;")),this.opacity<100&&(o+="opacity: "+this.opacity/100+"; "),this.node.setAttribute("style",l);var d=mxUtils.isNode(this.value)?this.value.outerHTML:this.getHtmlValue();this.node.firstChild==null&&(this.node.innerHTML="
"+d+"
"),this.node.firstChild.firstChild.setAttribute("style",o),this.node.firstChild.setAttribute("style",a)}))},mxText.prototype.updateHtmlTransform=function(){var t=this.getTextRotation(),e=this.node.style,i=this.margin.x,n=this.margin.y;t!=0?(mxUtils.setPrefixedStyle(e,"transformOrigin",-i*100+"% "+-n*100+"%"),mxUtils.setPrefixedStyle(e,"transform","translate("+i*100+"%,"+n*100+"%) scale("+this.scale+") rotate("+t+"deg)")):(mxUtils.setPrefixedStyle(e,"transformOrigin","0% 0%"),mxUtils.setPrefixedStyle(e,"transform","scale("+this.scale+") translate("+i*100+"%,"+n*100+"%)")),e.left=Math.round(this.bounds.x-Math.ceil(i*(this.overflow!="fill"&&this.overflow!="width"?3:1)))+"px",e.top=Math.round(this.bounds.y-n*(this.overflow!="fill"?3:1))+"px",this.opacity<100?e.opacity=this.opacity/100:e.opacity=""},mxText.prototype.updateInnerHtml=function(t){if(mxUtils.isNode(this.value))t.innerHTML=this.value.outerHTML;else{var e=this.value;this.dialect!=mxConstants.DIALECT_STRICTHTML&&(e=mxUtils.htmlEntities(e,!1)),e=mxUtils.replaceTrailingNewlines(e,"
 
"),e=this.replaceLinefeeds?e.replace(/\n/g,"
"):e,e='
'+e+"
",t.innerHTML=e}},mxText.prototype.updateHtmlFilter=function(){var t=this.node.style,e=this.margin.x,T=this.margin.y,i=this.scale;mxUtils.setOpacity(this.node,this.opacity);var n=0,r=0,s=this.state!=null?this.state.view.textDiv:null,l=this.node;if(s!=null){s.style.overflow="",s.style.height="",s.style.width="",this.updateFont(s),this.updateSize(s,!1),this.updateInnerHtml(s);var a=Math.round(this.bounds.width/this.scale);this.wrap&&a>0?(s.style.whiteSpace="normal",s.style.wordWrap=mxConstants.WORD_WRAP,n=a,this.clipped&&(n=Math.min(n,this.bounds.width)),s.style.width=n+"px"):s.style.whiteSpace="nowrap",l=s,l.firstChild!=null&&l.firstChild.nodeName=="DIV"&&(l=l.firstChild,this.wrap&&s.style.wordWrap=="break-word"&&(l.style.width="100%")),!this.clipped&&this.wrap&&a>0&&(n=l.offsetWidth+this.textWidthPadding,s.style.width=n+"px"),r=l.offsetHeight+2,mxClient.IS_QUIRKS&&this.border!=null&&this.border!=mxConstants.NONE&&(r+=3)}else l.firstChild!=null&&l.firstChild.nodeName=="DIV"&&(l=l.firstChild,r=l.offsetHeight);n=l.offsetWidth+this.textWidthPadding,this.clipped&&(r=Math.min(r,this.bounds.height));var a=this.bounds.width/i,o=this.bounds.height/i;this.overflow=="fill"?(r=o,n=a):this.overflow=="width"&&(r=l.scrollHeight,n=a),this.offsetWidth=n,this.offsetHeight=r,mxClient.IS_QUIRKS&&(this.clipped||this.overflow=="width"&&o>0)?(o=Math.min(o,r),t.height=Math.round(o)+"px"):o=r,this.overflow!="fill"&&this.overflow!="width"&&(this.clipped&&(n=Math.min(a,n)),a=n,(mxClient.IS_QUIRKS&&this.clipped||this.wrap)&&(t.width=Math.round(a)+"px")),o*=i,a*=i;var u=this.getTextRotation()*(Math.PI/180),p=parseFloat(parseFloat(Math.cos(u)).toFixed(8)),m=parseFloat(parseFloat(Math.sin(-u)).toFixed(8));u%=2*Math.PI,u<0&&(u+=2*Math.PI),u%=Math.PI,u>Math.PI/2&&(u=Math.PI-u);var d=Math.cos(u),x=Math.sin(-u),f=a*-(e+.5),g=o*-(T+.5),c=(o-o*d+a*x)/2+m*f-p*g,v=(a-a*d+o*x)/2-p*f-m*g;if(u!=0){var y="progid:DXImageTransform.Microsoft.Matrix(M11="+p+", M12="+m+", M21="+-m+", M22="+p+", sizingMethod='auto expand')";t.filter!=null&&t.filter.length>0?t.filter+=" "+y:t.filter=y}var T=0;this.overflow!="fill"&&mxClient.IS_QUIRKS&&(this.valign==mxConstants.ALIGN_TOP?T-=1:this.valign==mxConstants.ALIGN_BOTTOM?T+=2:T+=1),t.zoom=i,t.left=Math.round(this.bounds.x+v-a/2)+"px",t.top=Math.round(this.bounds.y+c-o/2+T)+"px"},mxText.prototype.updateValue=function(){if(mxUtils.isNode(this.value))this.node.innerHTML="",this.node.appendChild(this.value);else{var t=this.value;this.dialect!=mxConstants.DIALECT_STRICTHTML&&(t=mxUtils.htmlEntities(t,!1)),t=mxUtils.replaceTrailingNewlines(t,"

"),t=this.replaceLinefeeds?t.replace(/\n/g,"
"):t;var e=this.background!=null&&this.background!=mxConstants.NONE?this.background:null,i=this.border!=null&&this.border!=mxConstants.NONE?this.border:null;if(this.overflow=="fill"||this.overflow=="width")e!=null&&(this.node.style.backgroundColor=e),i!=null&&(this.node.style.border="1px solid "+i);else{var n="";e!=null&&(n+="background-color:"+mxUtils.htmlEntities(e)+";"),i!=null&&(n+="border:1px solid "+mxUtils.htmlEntities(i)+";");var r=mxConstants.ABSOLUTE_LINE_HEIGHT?this.size*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT;t='
'+t+"
"}this.node.innerHTML=t;var s=this.node.getElementsByTagName("div");if(s.length>0){var l=this.textDirection;l==mxConstants.TEXT_DIRECTION_AUTO&&this.dialect!=mxConstants.DIALECT_STRICTHTML&&(l=this.getAutoDirection()),l==mxConstants.TEXT_DIRECTION_LTR||l==mxConstants.TEXT_DIRECTION_RTL?s[s.length-1].setAttribute("dir",l):s[s.length-1].removeAttribute("dir")}}},mxText.prototype.updateFont=function(t){var e=t.style;e.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?this.size*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT,e.fontSize=this.size+"px",e.fontFamily=this.family,e.verticalAlign="top",e.color=this.color,(this.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD?e.fontWeight="bold":e.fontWeight="",(this.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC?e.fontStyle="italic":e.fontStyle="";var i=[];(this.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&i.push("underline"),(this.fontStyle&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&i.push("line-through"),e.textDecoration=i.join(" "),this.align==mxConstants.ALIGN_CENTER?e.textAlign="center":this.align==mxConstants.ALIGN_RIGHT?e.textAlign="right":e.textAlign="left"},mxText.prototype.updateSize=function(t,e){var i=Math.max(0,Math.round(this.bounds.width/this.scale)),n=Math.max(0,Math.round(this.bounds.height/this.scale)),r=t.style;if(this.clipped?(r.overflow="hidden",mxClient.IS_QUIRKS?r.width=i+"px":(r.maxHeight=n+"px",r.maxWidth=i+"px")):this.overflow=="fill"?(r.width=i+1+"px",r.height=n+1+"px",r.overflow="hidden"):this.overflow=="width"&&(r.width=i+1+"px",r.maxHeight=n+1+"px",r.overflow="hidden"),this.wrap&&i>0){if(r.wordWrap=mxConstants.WORD_WRAP,r.whiteSpace="normal",r.width=i+"px",e&&this.overflow!="fill"&&this.overflow!="width"){var s=t;s.firstChild!=null&&s.firstChild.nodeName=="DIV"&&(s=s.firstChild,t.style.wordWrap=="break-word"&&(s.style.width="100%"));var l=s.offsetWidth;if(l==0){var a=t.parentNode;t.style.visibility="hidden",document.body.appendChild(t),l=s.offsetWidth,t.style.visibility="",a.appendChild(t)}l+=3,this.clipped&&(l=Math.min(l,i)),r.width=l+"px"}}else r.whiteSpace="nowrap"},mxText.prototype.updateMargin=function(){this.margin=mxUtils.getAlignmentAsPoint(this.align,this.valign)},mxText.prototype.getSpacing=function(){var t=0,e=0;return this.align==mxConstants.ALIGN_CENTER?t=(this.spacingLeft-this.spacingRight)/2:this.align==mxConstants.ALIGN_RIGHT?t=-this.spacingRight-this.baseSpacingRight:t=this.spacingLeft+this.baseSpacingLeft,this.valign==mxConstants.ALIGN_MIDDLE?e=(this.spacingTop-this.spacingBottom)/2:this.valign==mxConstants.ALIGN_BOTTOM?e=-this.spacingBottom-this.baseSpacingBottom:e=this.spacingTop+this.baseSpacingTop,new mxPoint(t,e)},__mxOutput.mxText=typeof mxText<"u"?mxText:void 0;function mxTriangle(){mxActor.call(this)}mxUtils.extend(mxTriangle,mxActor),mxTriangle.prototype.isRoundable=function(){return!0},mxTriangle.prototype.redrawPath=function(t,e,i,n,r){var s=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(t,[new mxPoint(0,0),new mxPoint(n,.5*r),new mxPoint(0,r)],this.isRounded,s,!0)},__mxOutput.mxTriangle=typeof mxTriangle<"u"?mxTriangle:void 0;function mxHexagon(){mxActor.call(this)}mxUtils.extend(mxHexagon,mxActor),mxHexagon.prototype.redrawPath=function(t,e,i,n,r){var s=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(t,[new mxPoint(.25*n,0),new mxPoint(.75*n,0),new mxPoint(n,.5*r),new mxPoint(.75*n,r),new mxPoint(.25*n,r),new mxPoint(0,.5*r)],this.isRounded,s,!0)},__mxOutput.mxHexagon=typeof mxHexagon<"u"?mxHexagon:void 0;function mxLine(t,e,i,n){mxShape.call(this),this.bounds=t,this.stroke=e,this.strokewidth=i??1,this.vertical=n??this.vertical}mxUtils.extend(mxLine,mxShape),mxLine.prototype.vertical=!1,mxLine.prototype.paintVertexShape=function(t,e,i,n,r){if(t.begin(),this.vertical){var s=e+n/2;t.moveTo(s,i),t.lineTo(s,i+r)}else{var s=i+r/2;t.moveTo(e,s),t.lineTo(e+n,s)}t.stroke()},__mxOutput.mxLine=typeof mxLine<"u"?mxLine:void 0;function mxImageShape(t,e,i,n,r){mxShape.call(this),this.bounds=t,this.image=e,this.fill=i,this.stroke=n,this.strokewidth=r??1,this.shadow=!1}mxUtils.extend(mxImageShape,mxRectangleShape),mxImageShape.prototype.preserveImageAspect=!0,mxImageShape.prototype.getSvgScreenOffset=function(){return 0},mxImageShape.prototype.apply=function(t){mxShape.prototype.apply.apply(this,arguments),this.fill=null,this.stroke=null,this.gradient=null,this.style!=null&&(this.preserveImageAspect=mxUtils.getNumber(this.style,mxConstants.STYLE_IMAGE_ASPECT,1)==1,this.flipH=this.flipH||mxUtils.getValue(this.style,"imageFlipH",0)==1,this.flipV=this.flipV||mxUtils.getValue(this.style,"imageFlipV",0)==1)},mxImageShape.prototype.isHtmlAllowed=function(){return!this.preserveImageAspect},mxImageShape.prototype.createHtml=function(){var t=document.createElement("div");return t.style.position="absolute",t},mxImageShape.prototype.isRoundable=function(t,e,i,n,r){return!1},mxImageShape.prototype.paintVertexShape=function(t,e,i,n,r){if(this.image!=null){var s=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BACKGROUND,null),l=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BORDER,null);s!=null&&(t.setFillColor(s),t.setStrokeColor(l),t.rect(e,i,n,r),t.fillAndStroke()),t.image(e,i,n,r,this.image,this.preserveImageAspect,!1,!1);var l=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BORDER,null);l!=null&&(t.setShadow(!1),t.setStrokeColor(l),t.rect(e,i,n,r),t.stroke())}else mxRectangleShape.prototype.paintBackground.apply(this,arguments)},mxImageShape.prototype.redrawHtmlShape=function(){if(this.node.style.left=Math.round(this.bounds.x)+"px",this.node.style.top=Math.round(this.bounds.y)+"px",this.node.style.width=Math.max(0,Math.round(this.bounds.width))+"px",this.node.style.height=Math.max(0,Math.round(this.bounds.height))+"px",this.node.innerHTML="",this.image!=null){var t=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BACKGROUND,""),e=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BORDER,"");this.node.style.backgroundColor=t,this.node.style.borderColor=e;var i=mxClient.IS_IE6||(document.documentMode==null||document.documentMode<=8)&&this.rotation!=0,n=document.createElement(i?mxClient.VML_PREFIX+":image":"img");n.setAttribute("border","0"),n.style.position="absolute",n.src=this.image;var r=this.opacity<100?"alpha(opacity="+this.opacity+")":"";this.node.style.filter=r,this.flipH&&this.flipV?r+="progid:DXImageTransform.Microsoft.BasicImage(rotation=2)":this.flipH?r+="progid:DXImageTransform.Microsoft.BasicImage(mirror=1)":this.flipV&&(r+="progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)"),n.style.filter!=r&&(n.style.filter=r),n.nodeName=="image"?n.style.rotation=this.rotation:this.rotation!=0?mxUtils.setPrefixedStyle(n.style,"transform","rotate("+this.rotation+"deg)"):mxUtils.setPrefixedStyle(n.style,"transform",""),n.style.width=this.node.style.width,n.style.height=this.node.style.height,this.node.style.backgroundImage="",this.node.appendChild(n)}else this.setTransparentBackgroundImage(this.node)},__mxOutput.mxImageShape=typeof mxImageShape<"u"?mxImageShape:void 0;function mxLabel(t,e,i,n){mxRectangleShape.call(this,t,e,i,n)}mxUtils.extend(mxLabel,mxRectangleShape),mxLabel.prototype.imageSize=mxConstants.DEFAULT_IMAGESIZE,mxLabel.prototype.spacing=2,mxLabel.prototype.indicatorSize=10,mxLabel.prototype.indicatorSpacing=2,mxLabel.prototype.init=function(t){mxShape.prototype.init.apply(this,arguments),this.indicatorShape!=null&&(this.indicator=new this.indicatorShape,this.indicator.dialect=this.dialect,this.indicator.init(this.node))},mxLabel.prototype.redraw=function(){this.indicator!=null&&(this.indicator.fill=this.indicatorColor,this.indicator.stroke=this.indicatorStrokeColor,this.indicator.gradient=this.indicatorGradientColor,this.indicator.direction=this.indicatorDirection,this.indicator.redraw()),mxShape.prototype.redraw.apply(this,arguments)},mxLabel.prototype.isHtmlAllowed=function(){return mxRectangleShape.prototype.isHtmlAllowed.apply(this,arguments)&&this.indicatorColor==null&&this.indicatorShape==null},mxLabel.prototype.paintForeground=function(t,e,i,n,r){this.paintImage(t,e,i,n,r),this.paintIndicator(t,e,i,n,r),mxRectangleShape.prototype.paintForeground.apply(this,arguments)},mxLabel.prototype.paintImage=function(t,e,i,n,r){if(this.image!=null){var s=this.getImageBounds(e,i,n,r);t.image(s.x,s.y,s.width,s.height,this.image,!1,!1,!1)}},mxLabel.prototype.getImageBounds=function(t,e,i,n){var r=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_ALIGN,mxConstants.ALIGN_LEFT),s=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE),l=mxUtils.getNumber(this.style,mxConstants.STYLE_IMAGE_WIDTH,mxConstants.DEFAULT_IMAGESIZE),a=mxUtils.getNumber(this.style,mxConstants.STYLE_IMAGE_HEIGHT,mxConstants.DEFAULT_IMAGESIZE),o=mxUtils.getNumber(this.style,mxConstants.STYLE_SPACING,this.spacing)+5;return r==mxConstants.ALIGN_CENTER?t+=(i-l)/2:r==mxConstants.ALIGN_RIGHT?t+=i-l-o:t+=o,s==mxConstants.ALIGN_TOP?e+=o:s==mxConstants.ALIGN_BOTTOM?e+=n-a-o:e+=(n-a)/2,new mxRectangle(t,e,l,a)},mxLabel.prototype.paintIndicator=function(t,e,i,n,r){if(this.indicator!=null)this.indicator.bounds=this.getIndicatorBounds(e,i,n,r),this.indicator.paint(t);else if(this.indicatorImage!=null){var s=this.getIndicatorBounds(e,i,n,r);t.image(s.x,s.y,s.width,s.height,this.indicatorImage,!1,!1,!1)}},mxLabel.prototype.getIndicatorBounds=function(t,e,i,n){var r=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_ALIGN,mxConstants.ALIGN_LEFT),s=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE),l=mxUtils.getNumber(this.style,mxConstants.STYLE_INDICATOR_WIDTH,this.indicatorSize),a=mxUtils.getNumber(this.style,mxConstants.STYLE_INDICATOR_HEIGHT,this.indicatorSize),o=this.spacing+5;return r==mxConstants.ALIGN_RIGHT?t+=i-l-o:r==mxConstants.ALIGN_CENTER?t+=(i-l)/2:t+=o,s==mxConstants.ALIGN_BOTTOM?e+=n-a-o:s==mxConstants.ALIGN_TOP?e+=o:e+=(n-a)/2,new mxRectangle(t,e,l,a)},mxLabel.prototype.redrawHtmlShape=function(){for(mxRectangleShape.prototype.redrawHtmlShape.apply(this,arguments);this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);if(this.image!=null){var t=document.createElement("img");t.style.position="relative",t.setAttribute("border","0");var e=this.getImageBounds(this.bounds.x,this.bounds.y,this.bounds.width,this.bounds.height);e.x-=this.bounds.x,e.y-=this.bounds.y,t.style.left=Math.round(e.x)+"px",t.style.top=Math.round(e.y)+"px",t.style.width=Math.round(e.width)+"px",t.style.height=Math.round(e.height)+"px",t.src=this.image,this.node.appendChild(t)}},__mxOutput.mxLabel=typeof mxLabel<"u"?mxLabel:void 0;function mxCylinder(t,e,i,n){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=i,this.strokewidth=n??1}mxUtils.extend(mxCylinder,mxShape),mxCylinder.prototype.maxHeight=40,mxCylinder.prototype.svgStrokeTolerance=0,mxCylinder.prototype.paintVertexShape=function(t,e,i,n,r){t.translate(e,i),t.begin(),this.redrawPath(t,e,i,n,r,!1),t.fillAndStroke(),(!this.outline||this.style==null||mxUtils.getValue(this.style,mxConstants.STYLE_BACKGROUND_OUTLINE,0)==0)&&(t.setShadow(!1),t.begin(),this.redrawPath(t,e,i,n,r,!0),t.stroke())},mxCylinder.prototype.getCylinderSize=function(t,e,i,n){return Math.min(this.maxHeight,Math.round(n/5))},mxCylinder.prototype.redrawPath=function(t,e,i,n,r,s){var l=this.getCylinderSize(e,i,n,r);(s&&this.fill!=null||!s&&this.fill==null)&&(t.moveTo(0,l),t.curveTo(0,2*l,n,2*l,n,l),s||(t.stroke(),t.begin())),s||(t.moveTo(0,l),t.curveTo(0,-l/3,n,-l/3,n,l),t.lineTo(n,r-l),t.curveTo(n,r+l/3,0,r+l/3,0,r-l),t.close())},__mxOutput.mxCylinder=typeof mxCylinder<"u"?mxCylinder:void 0;function mxConnector(t,e,i){mxPolyline.call(this,t,e,i)}mxUtils.extend(mxConnector,mxPolyline),mxConnector.prototype.updateBoundingBox=function(){this.useSvgBoundingBox=this.style!=null&&this.style[mxConstants.STYLE_CURVED]==1,mxShape.prototype.updateBoundingBox.apply(this,arguments)},mxConnector.prototype.paintEdgeShape=function(t,e){var i=this.createMarker(t,e,!0),n=this.createMarker(t,e,!1);mxPolyline.prototype.paintEdgeShape.apply(this,arguments),t.setFillColor(this.stroke),t.setShadow(!1),t.setDashed(!1),i!=null&&i(),n!=null&&n()},mxConnector.prototype.createMarker=function(t,e,i){var n=null,r=e.length,s=mxUtils.getValue(this.style,i?mxConstants.STYLE_STARTARROW:mxConstants.STYLE_ENDARROW),l=i?e[1]:e[r-2],a=i?e[0]:e[r-1];if(s!=null&&l!=null&&a!=null){for(var o=1;o0)for(var a=0;at.weightedValue?-1:e.weightedValueu)break;a=x}}}var f=r.getIndex(t);f=Math.max(0,l-(l>f?1:0)),n.add(r,t,f)}},mxStackLayout.prototype.getParentSize=function(t){var e=this.graph.getModel(),i=e.getGeometry(t);if(this.graph.container!=null&&(i==null&&e.isLayer(t)||t==this.graph.getView().currentRoot)){var n=this.graph.container.offsetWidth-1,r=this.graph.container.offsetHeight-1;i=new mxRectangle(0,0,n,r)}return i},mxStackLayout.prototype.getLayoutCells=function(t){for(var e=this.graph.getModel(),i=e.getChildCount(t),n=[],r=0;ru.x>0?1:-1:o.y==u.y?0:o.y>u.y>0?1:-1})),n},mxStackLayout.prototype.snap=function(t){if(this.gridSize!=null&&this.gridSize>0&&(t=Math.max(t,this.gridSize),t/this.gridSize>1)){var e=t%this.gridSize;t+=e>this.gridSize/2?this.gridSize-e:-e}return t},mxStackLayout.prototype.execute=function(t){if(t!=null){var e=this.getParentSize(t),i=this.isHorizontal(),n=this.graph.getModel(),r=null;e!=null&&(r=i?e.height-this.marginTop-this.marginBottom:e.width-this.marginLeft-this.marginRight),r-=2*this.border;var s=this.x0+this.border+this.marginLeft,l=this.y0+this.border+this.marginTop;if(this.graph.isSwimlane(t)){var a=this.graph.getCellStyle(t),o=mxUtils.getNumber(a,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE),u=mxUtils.getValue(a,mxConstants.STYLE_HORIZONTAL,!0)==1;e!=null&&(u?o=Math.min(o,e.height):o=Math.min(o,e.width)),i==u&&(r-=o),u?l+=o:s+=o}n.beginUpdate();try{for(var p=0,m=null,d=0,x=null,f=this.getLayoutCells(t),g=0;gthis.wrap||!i&&m.y+m.height+v.height+2*this.spacing>this.wrap)&&(m=null,i?l+=p+this.spacing:s+=p+this.spacing,p=0),p=Math.max(p,i?v.height:v.width);var y=0;if(!this.borderCollapse){var T=this.graph.getCellStyle(c);y=mxUtils.getNumber(T,mxConstants.STYLE_STROKEWIDTH,1)}if(m!=null){var C=d+this.spacing+Math.floor(y/2);i?v.x=this.snap((this.allowGaps?Math.max(C,v.x):C)-this.marginLeft)+this.marginLeft:v.y=this.snap((this.allowGaps?Math.max(C,v.y):C)-this.marginTop)+this.marginTop}else this.keepFirstLocation||(i?v.x=this.allowGaps&&v.x>s?Math.max(this.snap(v.x-this.marginLeft)+this.marginLeft,s):s:v.y=this.allowGaps&&v.y>l?Math.max(this.snap(v.y-this.marginTop)+this.marginTop,l):l);i?v.y=l:v.x=s,this.fill&&r!=null&&(i?v.height=r:v.width=r),i?v.width=this.snap(v.width):v.height=this.snap(v.height),this.setChildGeometry(c,v),x=c,m=v,i?d=m.x+m.width+Math.floor(y/2):d=m.y+m.height+Math.floor(y/2)}}this.resizeParent&&e!=null&&m!=null&&!this.graph.isCellCollapsed(t)?this.updateParentGeometry(t,e,m):this.resizeLast&&e!=null&&m!=null&&x!=null&&(i?m.width=e.width-m.x-this.spacing-this.marginRight-this.marginLeft:m.height=e.height-m.y-this.spacing-this.marginBottom,this.setChildGeometry(x,m))}finally{n.endUpdate()}}},mxStackLayout.prototype.setChildGeometry=function(t,e){var i=this.graph.getCellGeometry(t);(i==null||e.x!=i.x||e.y!=i.y||e.width!=i.width||e.height!=i.height)&&this.graph.getModel().setGeometry(t,e)},mxStackLayout.prototype.updateParentGeometry=function(t,e,i){var n=this.isHorizontal(),r=this.graph.getModel(),s=e.clone();if(n){var l=i.x+i.width+this.marginRight+this.border;this.resizeParentMax?s.width=Math.max(s.width,l):s.width=l}else{var l=i.y+i.height+this.marginBottom+this.border;this.resizeParentMax?s.height=Math.max(s.height,l):s.height=l}(e.x!=s.x||e.y!=s.y||e.width!=s.width||e.height!=s.height)&&r.setGeometry(t,s)},__mxOutput.mxStackLayout=typeof mxStackLayout<"u"?mxStackLayout:void 0;function mxPartitionLayout(t,e,i,n){mxGraphLayout.call(this,t),this.horizontal=e??!0,this.spacing=i||0,this.border=n||0}mxPartitionLayout.prototype=new mxGraphLayout,mxPartitionLayout.prototype.constructor=mxPartitionLayout,mxPartitionLayout.prototype.horizontal=null,mxPartitionLayout.prototype.spacing=null,mxPartitionLayout.prototype.border=null,mxPartitionLayout.prototype.resizeVertices=!0,mxPartitionLayout.prototype.isHorizontal=function(){return this.horizontal},mxPartitionLayout.prototype.moveCell=function(t,e,i){var n=this.graph.getModel(),r=n.getParent(t);if(t!=null&&r!=null){var s=0,l=0,a=n.getChildCount(r);for(s=0;se)break;l=p}}var m=r.getIndex(t);m=Math.max(0,s-(s>m?1:0)),n.add(r,t,m)}},mxPartitionLayout.prototype.execute=function(t){var e=this.isHorizontal(),i=this.graph.getModel(),n=i.getGeometry(t);if(this.graph.container!=null&&(n==null&&i.isLayer(t)||t==this.graph.getView().currentRoot)){var r=this.graph.container.offsetWidth-1,s=this.graph.container.offsetHeight-1;n=new mxRectangle(0,0,r,s)}if(n!=null){for(var l=[],a=i.getChildCount(t),o=0;o0){var m=this.border,d=this.border,x=e?n.height:n.width;x-=2*this.border;var f=this.graph.isSwimlane(t)?this.graph.getStartSize(t):new mxRectangle;x-=e?f.height:f.width,m=m+f.width,d=d+f.height;var g=this.border+(p-1)*this.spacing,c=e?(n.width-m-g)/p:(n.height-d-g)/p;if(c>0){i.beginUpdate();try{for(var o=0;o0)this.root=t;else{var n=this.graph.findTreeRoots(t,!0,this.invert);if(n.length>0){for(var r=0;r0){this.root=n[r];break}}}else this.root=e;if(this.root!=null){if(this.resizeParent?this.parentsChanged=new Object:this.parentsChanged=null,this.parentX=null,this.parentY=null,t!=this.root&&i.isVertex(t)!=null&&this.maintainParentLocation){var s=this.graph.getCellGeometry(t);s!=null&&(this.parentX=s.x,this.parentY=s.y)}i.beginUpdate();try{if(this.visited=new Object,this.node=this.dfs(this.root,t),this.alignRanks&&(this.maxRankHeight=[],this.findRankHeights(this.node,0),this.setCellHeights(this.node,0)),this.node!=null){this.layout(this.node);var l=this.graph.gridSize,a=l;if(!this.moveTree){var o=this.getVertexBounds(this.root);o!=null&&(l=o.x,a=o.y)}var u=null;if(this.isHorizontal()?u=this.horizontalLayout(this.node,l,a):u=this.verticalLayout(this.node,null,l,a),u!=null){var p=0,m=0;u.x<0&&(p=Math.abs(l-u.x)),u.y<0&&(m=Math.abs(a-u.y)),(p!=0||m!=0)&&this.moveNode(this.node,p,m),this.resizeParent&&this.adjustParents(),this.edgeRouting&&this.localEdgeProcessing(this.node)}if(this.parentX!=null&&this.parentY!=null){var s=this.graph.getCellGeometry(t);s!=null&&(s=s.clone(),s.x=this.parentX,s.y=this.parentY,i.setGeometry(t,s))}}}finally{i.endUpdate()}}},mxCompactTreeLayout.prototype.moveNode=function(t,e,i){t.x+=e,t.y+=i,this.apply(t);for(var n=t.child;n!=null;)this.moveNode(n,e,i),n=n.next},mxCompactTreeLayout.prototype.sortOutgoingEdges=function(t,e){var i=new mxDictionary;e.sort(function(n,r){var s=n.getTerminal(n.getTerminal(!1)==t),l=i.get(s);l==null&&(l=mxCellPath.create(s).split(mxCellPath.PATH_SEPARATOR),i.put(s,l));var a=r.getTerminal(r.getTerminal(!1)==t),o=i.get(a);return o==null&&(o=mxCellPath.create(a).split(mxCellPath.PATH_SEPARATOR),i.put(a,o)),mxCellPath.compare(l,o)})},mxCompactTreeLayout.prototype.findRankHeights=function(t,e){(this.maxRankHeight[e]==null||this.maxRankHeight[e]t.height&&(t.height=this.maxRankHeight[e]);for(var i=t.child;i!=null;)this.setCellHeights(i,e+1),i=i.next},mxCompactTreeLayout.prototype.dfs=function(t,e){var i=mxCellPath.create(t),n=null;if(t!=null&&this.visited[i]==null&&!this.isVertexIgnored(t)){this.visited[i]=t,n=this.createNode(t);var r=this.graph.getModel(),s=null,l=this.graph.getEdges(t,e,this.invert,!this.invert,!1,!0),a=this.graph.getView();this.sortEdges&&this.sortOutgoingEdges(t,l);for(var o=0;o0)if(t<0){var o=t*n;l=o/i-e}else if(t>0){var o=t*s;l=o/r-e}else l=-e;else if(rt+i){var o=(i+t)*s;l=o/r-(e+n)}else l=s-(e+n);return l>0?l:0},mxCompactTreeLayout.prototype.bridge=function(t,e,i,n,r,s){var l=r+n.dx-e,a=0,o=0;n.dx==0?a=n.dy:(o=l*n.dy,a=o/n.dx);var u=this.createLine(l,a,n.next);return t.next=this.createLine(0,s+n.dy-a-i,u),u},mxCompactTreeLayout.prototype.createNode=function(t){var e=new Object;e.cell=t,e.x=0,e.y=0,e.width=0,e.height=0;var i=this.getVertexBounds(t);return i!=null&&(this.isHorizontal()?(e.width=i.height,e.height=i.width):(e.width=i.width,e.height=i.height)),e.offsetX=0,e.offsetY=0,e.contour=new Object,e},mxCompactTreeLayout.prototype.apply=function(t,e){var i=this.graph.getModel(),n=t.cell,r=i.getGeometry(n);if(n!=null&&r!=null){if(this.isVertexMovable(n)&&(r=this.setVertexLocation(n,t.x,t.y),this.resizeParent)){var s=i.getParent(n),l=mxCellPath.create(s);this.parentsChanged[l]==null&&(this.parentsChanged[l]=s)}e==null?e=new mxRectangle(r.x,r.y,r.width,r.height):e=new mxRectangle(Math.min(e.x,r.x),Math.min(e.y,r.y),Math.max(e.x+e.width,r.x+r.width),Math.max(e.y+e.height,r.y+r.height))}return e},mxCompactTreeLayout.prototype.createLine=function(t,e,i){var n=new Object;return n.dx=t,n.dy=e,n.next=i,n},mxCompactTreeLayout.prototype.adjustParents=function(){var t=[];for(var e in this.parentsChanged)t.push(this.parentsChanged[e]);this.arrangeGroups(mxUtils.sortCells(t,!0),this.groupPadding,this.groupPaddingTop,this.groupPaddingRight,this.groupPaddingBottom,this.groupPaddingLeft)},mxCompactTreeLayout.prototype.localEdgeProcessing=function(t){this.processNodeOutgoing(t);for(var e=t.child;e!=null;)this.localEdgeProcessing(e),e=e.next},mxCompactTreeLayout.prototype.processNodeOutgoing=function(t){for(var e=t.child,i=t.cell,n=0,r=[];e!=null;){n++;var s=e.x;this.horizontal&&(s=e.y),r.push(new WeightedCellSorter(e,s)),e=e.next}r.sort(WeightedCellSorter.prototype.compare);var l=t.width,a=(n+1)*this.prefHozEdgeSep;l>a+2*this.prefHozEdgeSep&&(l-=2*this.prefHozEdgeSep);var o=l/n,u=o/2;l>a+2*this.prefHozEdgeSep&&(u+=this.prefHozEdgeSep);var p=this.minEdgeJetty-this.prefVertEdgeOff,m=this.getVertexBounds(i);e=t.child;for(var d=0;dn/2&&(p-=this.prefVertEdgeOff),u+=o}},__mxOutput.mxCompactTreeLayout=typeof mxCompactTreeLayout<"u"?mxCompactTreeLayout:void 0;function mxRadialTreeLayout(t){mxCompactTreeLayout.call(this,t,!1)}mxUtils.extend(mxRadialTreeLayout,mxCompactTreeLayout),mxRadialTreeLayout.prototype.angleOffset=.5,mxRadialTreeLayout.prototype.rootx=0,mxRadialTreeLayout.prototype.rooty=0,mxRadialTreeLayout.prototype.levelDistance=120,mxRadialTreeLayout.prototype.nodeDistance=10,mxRadialTreeLayout.prototype.autoRadius=!1,mxRadialTreeLayout.prototype.sortEdges=!1,mxRadialTreeLayout.prototype.rowMinX=[],mxRadialTreeLayout.prototype.rowMaxX=[],mxRadialTreeLayout.prototype.rowMinCenX=[],mxRadialTreeLayout.prototype.rowMaxCenX=[],mxRadialTreeLayout.prototype.rowRadi=[],mxRadialTreeLayout.prototype.row=[],mxRadialTreeLayout.prototype.isVertexIgnored=function(t){return mxGraphLayout.prototype.isVertexIgnored.apply(this,arguments)||this.graph.getConnections(t).length==0},mxRadialTreeLayout.prototype.execute=function(t,e){this.parent=t,this.useBoundingBox=!1,this.edgeRouting=!1,mxCompactTreeLayout.prototype.execute.apply(this,arguments);var i=null,n=this.getVertexBounds(this.root);this.centerX=n.x+n.width/2,this.centerY=n.y+n.height/2;for(var r in this.visited){var s=this.getVertexBounds(this.visited[r]);i=i??s.clone(),i.add(s)}this.calcRowDims([this.node],0);for(var l=0,a=0,o=0;o=0;o--)for(var g=this.row[o],f=0;f0){var E=S/C;if(E>c.theta&&f0){var A=g[f-1].theta;c.theta=Math.max(E,A+Math.PI/10)}}}for(var o=0;othis.maxDistanceLimit)continue;l1&&this.layout(r)}}finally{this.graph.model.endUpdate()}},mxParallelEdgeLayout.prototype.findParallels=function(t,e){var i=[],n=mxUtils.bind(this,function(a){if(!this.isEdgeIgnored(a)){var o=this.getEdgeId(a);o!=null&&(i[o]==null&&(i[o]=[]),i[o].push(a))}});if(e!=null)for(var r=0;rn?n+"-"+i:i+"-"+n)+r}return null},mxParallelEdgeLayout.prototype.layout=function(t){var e=t[0],i=this.graph.getView(),n=this.graph.getModel(),r=n.getGeometry(i.getVisibleTerminal(e,!0)),s=n.getGeometry(i.getVisibleTerminal(e,!1));if(r==s)for(var l=r.x+r.width+this.spacing,a=r.y+r.height/2,o=0;o0){var l=u+x/2,a=p+f/2,c=f*this.spacing/g,v=x*this.spacing/g;l+=c*(t.length-1)/2,a-=v*(t.length-1)/2;for(var o=0;o0?this.edges[0]:null},__mxOutput.mxGraphHierarchyEdge=typeof mxGraphHierarchyEdge<"u"?mxGraphHierarchyEdge:void 0;function mxGraphHierarchyModel(t,e,i,n,r){t.getGraph(),this.tightenToSource=r,this.roots=i,this.parent=n,this.vertexMapper=new mxDictionary,this.edgeMapper=new mxDictionary,this.maxRank=0;var s=[];e==null&&(e=this.graph.getChildVertices(n)),this.maxRank=this.SOURCESCANSTARTRANK,this.createInternalCells(t,e,s);for(var l=0;l0){var m=p[0],d=t.getVisibleTerminal(m,!1),x=this.vertexMapper.get(d);s[l]==x&&(d=t.getVisibleTerminal(m,!0),x=this.vertexMapper.get(d)),x!=null&&s[l]!=x&&(u.target=x,x.connectsAsTarget.length==0&&(x.connectsAsTarget=[]),mxUtils.indexOf(x.connectsAsTarget,u)<0&&x.connectsAsTarget.push(u))}}s[l].temp[0]=1}}mxGraphHierarchyModel.prototype.maxRank=null,mxGraphHierarchyModel.prototype.vertexMapper=null,mxGraphHierarchyModel.prototype.edgeMapper=null,mxGraphHierarchyModel.prototype.ranks=null,mxGraphHierarchyModel.prototype.roots=null,mxGraphHierarchyModel.prototype.parent=null,mxGraphHierarchyModel.prototype.dfsCount=0,mxGraphHierarchyModel.prototype.SOURCESCANSTARTRANK=1e8,mxGraphHierarchyModel.prototype.tightenToSource=!1,mxGraphHierarchyModel.prototype.createInternalCells=function(t,e,i){for(var n=t.getGraph(),r=0;r0&&this.edgeMapper.get(o[0])==null&&u.length*2>=o.length){for(var p=new mxGraphHierarchyEdge(o),m=0;m0;){var i=t[0],s,l;s=i.connectsAsTarget,l=i.connectsAsSource;for(var a=!0,o=this.SOURCESCANSTARTRANK,e=0;e1){o.maxRank=l.maxRank,o.minRank=a.maxRank,o.temp=[],o.x=[],o.y=[];for(var d=o.minRank+1;d0){var m=p[0],d=t.getVisibleTerminal(m,!1),x=this.vertexMapper.get(d);s[l]==x&&(d=t.getVisibleTerminal(m,!0),x=this.vertexMapper.get(d)),x!=null&&s[l]!=x&&(u.target=x,x.connectsAsTarget.length==0&&(x.connectsAsTarget=[]),mxUtils.indexOf(x.connectsAsTarget,u)<0&&x.connectsAsTarget.push(u))}}s[l].temp[0]=1}}mxSwimlaneModel.prototype.maxRank=null,mxSwimlaneModel.prototype.vertexMapper=null,mxSwimlaneModel.prototype.edgeMapper=null,mxSwimlaneModel.prototype.ranks=null,mxSwimlaneModel.prototype.roots=null,mxSwimlaneModel.prototype.parent=null,mxSwimlaneModel.prototype.dfsCount=0,mxSwimlaneModel.prototype.SOURCESCANSTARTRANK=1e8,mxSwimlaneModel.prototype.tightenToSource=!1,mxSwimlaneModel.prototype.ranksPerGroup=null,mxSwimlaneModel.prototype.createInternalCells=function(t,e,i){for(var n=t.getGraph(),r=t.swimlanes,s=0;s0&&this.edgeMapper.get(p[0])==null&&m.length*2>=p.length){for(var d=new mxGraphHierarchyEdge(p),x=0;x=0;i--)i==this.ranksPerGroup.length-1?r[i]=0:r[i]=s[i+1]+1,s[i]=r[i]+this.ranksPerGroup[i];this.maxRank=s[0];for(var l=this.vertexMapper.getValues(),i=0;i0;){var n=t[0],a,o;a=n.connectsAsTarget,o=n.connectsAsSource;for(var u=!0,p=s[0],i=0;is[n.swimlaneIndex]&&(p=s[n.swimlaneIndex]),n.temp[0]=p,o!=null)for(var i=0;i1){o.maxRank=l.maxRank,o.minRank=a.maxRank,o.temp=[],o.x=[],o.y=[];for(var d=o.minRank+1;d0;)T%2&&(i+=v[T+1]),T=T-1>>1,++v[T]}return i},mxMedianHybridCrossingReduction.prototype.transpose=function(t,e){for(var i=!0,n=0,r=10;i&&n++y[M]&&L++,c[E]T[M]&&L++,v[E]=0;n--)this.medianRank(n,i);else for(var n=1;nt.medianValue?-1:e.medianValue0&&u<=o;){var m=e.shift(),d=m.cell,x=m.weightedValue,f=parseInt(m.rankIndex),g=d.getNextLayerConnectedCells(x),c=d.getPreviousLayerConnectedCells(x),v=g.length,y=c.length,T=this.medianXValue(g,x+1),C=this.medianXValue(c,x-1),S=v+y,E=d.getGeneralPurposeVariable(x),L=E;S>0&&(L=(T*v+C*y)/S);var A=!1;if(LE+p){var P=n[x].length;if(f==P-1)d.setGeneralPurposeVariable(x,L),A=!0;else{var R=n[x][f+1],O=R.getGeneralPurposeVariable(x);O=O-R.width/2-this.intraCellSpacing-d.width/2,O>L?(d.setGeneralPurposeVariable(x,L),A=!0):O>d.getGeneralPurposeVariable(x)+p&&(d.setGeneralPurposeVariable(x,O),A=!0)}}if(A){for(var r=0;r0;n--)this.rankMedianPosition(n-1,e,n);else for(var n=0;n0?m=this.medianXValue(o,i):m=p.getGeneralPurposeVariable(t));for(var d=0,x=-1e8,f=r[l].rankIndex-1;f>=0;){var g=s[n[f].id];if(g!=null){var c=g.cell;g.visited?(x=c.getGeneralPurposeVariable(t)+c.width/2+this.intraCellSpacing+d+p.width/2,f=-1):(d+=c.width+this.intraCellSpacing,f--)}}for(var v=0,y=1e8,f=r[l].rankIndex+1;f=x&&m<=y?p.setGeneralPurposeVariable(t,m):my&&(p.setGeneralPurposeVariable(t,y),this.currentXDelta+=m-y),r[l].visited=!0}},mxCoordinateAssignment.prototype.calculatedWeightedValue=function(t,e){for(var i=0,n=0;n=0;i--)i0&&this.rankCoordinates(i,t,e)},mxCoordinateAssignment.prototype.rankCoordinates=function(t,e,i){for(var n=i.ranks[t],r=0,s=this.initialX+(this.widestRankValue-this.rankWidths[t])/2,l=!1,a=0;a=0;r--){for(var s=0,l=e.ranks[r],a=this.initialX,o=!1,u=0;uthis.widestRankValue&&(this.widestRankValue=a,this.widestRank=r),this.rankWidths[r]=a}o==!0&&mxLog.warn("At least one cell has no bounds"),this.rankY[r]=i;var x=s/2+n/2+this.interRankCellSpacing;n=s,this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_WEST?i+=x:i-=x;for(var u=0;ur.minRank+1;o--){var g=r.getX(o-1);f==g||this.repositionValid(e,r,o-1,f)?(x[o-r.minRank-2]=f,m++):(x[o-r.minRank-2]=r.getX(o-1),f=g)}if(m>a||p>a){if(m>=p)for(var o=r.maxRank-2;o>r.minRank;o--)r.setX(o,x[o-r.minRank-1]);else if(p>m)for(var o=r.minRank+2;oa){if(s==r.length-1)return!0;var p=r[s+1],m=p.getGeneralPurposeVariable(i);return m=m-p.width/2-this.intraCellSpacing-e.width/2,m>=n}return!0},mxCoordinateAssignment.prototype.setCellLocations=function(t,e){this.rankTopY=[],this.rankBottomY=[];for(var i=0;i-1&&l0){for(var o=[],u=0;uy+2*this.prefHozEdgeSep&&(m+=this.prefHozEdgeSep,d-=this.prefHozEdgeSep);for(var T=d-m,C=T/x,S=m+C/2,E=this.minEdgeJetty-this.prefVertEdgeOff,u=0;ux/2&&(E-=this.prefVertEdgeOff);for(var M=0;M0?e=-e:e=-e+this.parallelEdgeSpacing,r++}t.temp[0]=101207}},mxCoordinateAssignment.prototype.setVertexLocation=function(t){var e=t.cell,i=t.x[0]-t.width/2,n=t.y[0]-t.height/2;this.rankTopY[t.minRank]=Math.min(this.rankTopY[t.minRank],n),this.rankBottomY[t.minRank]=Math.max(this.rankBottomY[t.minRank],n+t.height),this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?this.layout.setVertexLocation(e,i,n):this.layout.setVertexLocation(e,n,i),this.limitX=Math.max(this.limitX,i+t.width)},mxCoordinateAssignment.prototype.processReversedEdge=function(t,e){},__mxOutput.mxCoordinateAssignment=typeof mxCoordinateAssignment<"u"?mxCoordinateAssignment:void 0;function mxSwimlaneOrdering(t){this.layout=t}mxSwimlaneOrdering.prototype=new mxHierarchicalLayoutStage,mxSwimlaneOrdering.prototype.constructor=mxSwimlaneOrdering,mxSwimlaneOrdering.prototype.layout=null,mxSwimlaneOrdering.prototype.execute=function(t){var e=this.layout.getModel(),i=new Object,n=mxUtils.clone(e.vertexMapper,null,!0),r=null;if(e.roots!=null){var s=e.roots;r=[];for(var l=0;l0&&i.push(a);var x=u-p;x>s&&(s=x,r=a)}}i.length==0&&r!=null&&i.push(r)}return i},mxHierarchicalLayout.prototype.getEdges=function(t){var e=this.edgesCache.get(t);if(e!=null)return e;for(var i=this.graph.model,n=[],r=this.graph.isCellCollapsed(t),s=i.getChildCount(t),l=0;l=0&&(r=this.traverse(m,e,o[p],n,r,s,l))}}else if(r[a]==null)for(var p=0;p0&&i.push(a);var f=u-p;f>s&&(s=f,r=a)}}i.length==0&&r!=null&&i.push(r)}return i},mxSwimlaneLayout.prototype.getEdges=function(t){var e=this.edgesCache.get(t);if(e!=null)return e;for(var i=this.graph.model,n=[],r=this.graph.isCellCollapsed(t),s=i.getChildCount(t),l=0;l0&&t!=null){for(var n=Object(),r=0;r=this.swimlanes.length||(f>a||(!e||x)&&f==a)&&(r=this.traverse(d,e,u[m],n,r,s,l,f))}}else if(r[o]==null)for(var m=0;m0){var n=t,r=mxCellPath.create(n);if(i.length=0;i--)this.cellRemoved(this.getChildAt(t,i));this.cells!=null&&t.getId()!=null&&delete this.cells[t.getId()]}},mxGraphModel.prototype.parentForCellChanged=function(t,e,i){var n=this.getParent(t);if(e!=null)(e!=n||n.getIndex(t)!=i)&&e.insert(t,i);else if(n!=null){var r=n.getIndex(t);n.remove(r)}var s=this.contains(e),l=this.contains(n);return s&&!l?this.cellAdded(t):l&&!s&&this.cellRemoved(t),n},mxGraphModel.prototype.getChildCount=function(t){return t!=null?t.getChildCount():0},mxGraphModel.prototype.getChildAt=function(t,e){return t!=null?t.getChildAt(e):null},mxGraphModel.prototype.getChildren=function(t){return t!=null?t.children:null},mxGraphModel.prototype.getChildVertices=function(t){return this.getChildCells(t,!0,!1)},mxGraphModel.prototype.getChildEdges=function(t){return this.getChildCells(t,!1,!0)},mxGraphModel.prototype.getChildCells=function(t,e,i){e=e??!1,i=i??!1;for(var n=this.getChildCount(t),r=[],s=0;s=0&&(e=this.getChildAt(t),e!=null&&(this.children.splice(t,1),e.setParent(null))),e},mxCell.prototype.removeFromParent=function(){if(this.parent!=null){var t=this.parent.getIndex(this);this.parent.remove(t)}},mxCell.prototype.getEdgeCount=function(){return this.edges==null?0:this.edges.length},mxCell.prototype.getEdgeIndex=function(t){return mxUtils.indexOf(this.edges,t)},mxCell.prototype.getEdgeAt=function(t){return this.edges==null?null:this.edges[t]},mxCell.prototype.insertEdge=function(t,e){return t!=null&&(t.removeFromTerminal(e),t.setTerminal(this,e),(this.edges==null||t.getTerminal(!e)!=this||mxUtils.indexOf(this.edges,t)<0)&&(this.edges==null&&(this.edges=[]),this.edges.push(t))),t},mxCell.prototype.removeEdge=function(t,e){if(t!=null){if(t.getTerminal(!e)!=this&&this.edges!=null){var i=this.getEdgeIndex(t);i>=0&&this.edges.splice(i,1)}t.setTerminal(null,e)}return t},mxCell.prototype.removeFromTerminal=function(t){var e=this.getTerminal(t);e!=null&&e.removeEdge(this,t)},mxCell.prototype.hasAttribute=function(t){var e=this.getValue();return e!=null&&e.nodeType==mxConstants.NODETYPE_ELEMENT&&e.hasAttribute?e.hasAttribute(t):e.getAttribute(t)!=null},mxCell.prototype.getAttribute=function(t,e){var i=this.getValue(),n=i!=null&&i.nodeType==mxConstants.NODETYPE_ELEMENT?i.getAttribute(t):null;return n??e},mxCell.prototype.setAttribute=function(t,e){var i=this.getValue();i!=null&&i.nodeType==mxConstants.NODETYPE_ELEMENT&&i.setAttribute(t,e)},mxCell.prototype.clone=function(){var t=mxUtils.clone(this,this.mxTransient);return t.setValue(this.cloneValue()),t},mxCell.prototype.cloneValue=function(){var t=this.getValue();return t!=null&&(typeof t.clone=="function"?t=t.clone():isNaN(t.nodeType)||(t=t.cloneNode(!0))),t},__mxOutput.mxCell=typeof mxCell<"u"?mxCell:void 0;function mxGeometry(t,e,i,n){mxRectangle.call(this,t,e,i,n)}mxGeometry.prototype=new mxRectangle,mxGeometry.prototype.constructor=mxGeometry,mxGeometry.prototype.TRANSLATE_CONTROL_POINTS=!0,mxGeometry.prototype.alternateBounds=null,mxGeometry.prototype.sourcePoint=null,mxGeometry.prototype.targetPoint=null,mxGeometry.prototype.points=null,mxGeometry.prototype.offset=null,mxGeometry.prototype.relative=!1,mxGeometry.prototype.swap=function(){if(this.alternateBounds!=null){var t=new mxRectangle(this.x,this.y,this.width,this.height);this.x=this.alternateBounds.x,this.y=this.alternateBounds.y,this.width=this.alternateBounds.width,this.height=this.alternateBounds.height,this.alternateBounds=t}},mxGeometry.prototype.getTerminalPoint=function(t){return t?this.sourcePoint:this.targetPoint},mxGeometry.prototype.setTerminalPoint=function(t,e){return e?this.sourcePoint=t:this.targetPoint=t,t},mxGeometry.prototype.rotate=function(t,e){var i=mxUtils.toRadians(t),n=Math.cos(i),r=Math.sin(i);if(!this.relative){var s=new mxPoint(this.getCenterX(),this.getCenterY()),l=mxUtils.getRotatedPoint(s,n,r,e);this.x=Math.round(l.x-this.width/2),this.y=Math.round(l.y-this.height/2)}if(this.sourcePoint!=null){var l=mxUtils.getRotatedPoint(this.sourcePoint,n,r,e);this.sourcePoint.x=Math.round(l.x),this.sourcePoint.y=Math.round(l.y)}if(this.targetPoint!=null){var l=mxUtils.getRotatedPoint(this.targetPoint,n,r,e);this.targetPoint.x=Math.round(l.x),this.targetPoint.y=Math.round(l.y)}if(this.points!=null){for(var a=0;a1&&(e=e.substring(0,r-1)),e},getParentPath:function(t){if(t!=null){var e=t.lastIndexOf(mxCellPath.PATH_SEPARATOR);if(e>=0)return t.substring(0,e);if(t.length>0)return""}return null},resolve:function(t,e){var i=t;if(e!=null)for(var n=e.split(mxCellPath.PATH_SEPARATOR),r=0;re[r]?1:-1;else{var s=parseInt(t[r]),l=parseInt(e[r]);n=s==l?0:s>l?1:-1}break}if(n==0){var s=t.length,l=e.length;s!=l&&(n=s>l?1:-1)}return n}};__mxOutput.mxCellPath=typeof mxCellPath<"u"?mxCellPath:void 0;var mxPerimeter={RectanglePerimeter:function(t,e,i,n){var r=t.getCenterX(),s=t.getCenterY(),l=i.x-r,a=i.y-s,o=Math.atan2(a,l),u=new mxPoint(0,0),p=Math.PI,m=Math.PI/2,d=m-o,x=Math.atan2(t.height,t.width);return o<-p+x||o>p-x?(u.x=t.x,u.y=s-t.width*Math.tan(o)/2):o<-x?(u.y=t.y,u.x=r-t.height*Math.tan(d)/2):o=t.x&&i.x<=t.x+t.width?u.x=i.x:i.y>=t.y&&i.y<=t.y+t.height&&(u.y=i.y),i.xt.x+t.width&&(u.x=t.x+t.width),i.yt.y+t.height&&(u.y=t.y+t.height)),u},EllipsePerimeter:function(t,e,i,n){var r=t.x,s=t.y,l=t.width/2,a=t.height/2,o=r+l,u=s+a,p=i.x,m=i.y,d=parseInt(p-o),x=parseInt(m-u);if(d==0&&x!=0)return new mxPoint(o,u+a*x/Math.abs(x));if(d==0&&x==0)return new mxPoint(p,m);if(n){if(m>=s&&m<=s+t.height){var f=m-u,g=Math.sqrt(l*l*(1-f*f/(a*a)))||0;return p<=r&&(g=-g),new mxPoint(o+g,m)}if(p>=r&&p<=r+t.width){var g=p-o,f=Math.sqrt(a*a*(1-g*g/(l*l)))||0;return m<=s&&(f=-f),new mxPoint(p,u+f)}}var c=x/d,v=u-c*o,y=l*l*c*c+a*a,T=-2*o*y,C=l*l*c*c*o*o+a*a*o*o-l*l*a*a,S=Math.sqrt(T*T-4*y*C),E=(-T+S)/(2*y),L=(-T-S)/(2*y),A=c*E+v,M=c*L+v,I=Math.sqrt(Math.pow(E-p,2)+Math.pow(A-m,2)),P=Math.sqrt(Math.pow(L-p,2)+Math.pow(M-m,2)),R=0,O=0;return Im?new mxPoint(o,s):new mxPoint(o,s+a);if(u==m)return o>p?new mxPoint(r,u):new mxPoint(r+l,u);var d=o,x=u;return n&&(p>=r&&p<=r+l?d=p:m>=s&&m<=s+a&&(x=m)),p-y&&vMath.PI-y;var C=null;if(T)n&&(s&&i.x>=d.x&&i.x<=f.x||!s&&i.y>=d.y&&i.y<=f.y)?s?C=new mxPoint(i.x,d.y):C=new mxPoint(d.x,i.y):r==mxConstants.DIRECTION_NORTH?C=new mxPoint(l+o/2+u*Math.tan(v)/2,a+u):r==mxConstants.DIRECTION_SOUTH?C=new mxPoint(l+o/2-u*Math.tan(v)/2,a):r==mxConstants.DIRECTION_WEST?C=new mxPoint(l+o,a+u/2+o*Math.tan(v)/2):C=new mxPoint(l,a+u/2-o*Math.tan(v)/2);else{if(n){var S=new mxPoint(p,m);i.y>=a&&i.y<=a+u?(S.x=s?p:r==mxConstants.DIRECTION_WEST?l+o:l,S.y=i.y):i.x>=l&&i.x<=l+o&&(S.x=i.x,S.y=s?r==mxConstants.DIRECTION_NORTH?a+u:a:m),g=i.x-S.x,c=i.y-S.y,p=S.x,m=S.y}s&&i.x<=l+o/2||!s&&i.y<=a+u/2?C=mxUtils.intersection(i.x,i.y,p,m,d.x,d.y,x.x,x.y):C=mxUtils.intersection(i.x,i.y,p,m,x.x,x.y,f.x,f.y)}return C==null&&(C=new mxPoint(p,m)),C},HexagonPerimeter:function(t,e,i,n){var r=t.x,s=t.y,l=t.width,a=t.height,o=t.getCenterX(),u=t.getCenterY(),p=i.x,m=i.y,d=p-o,x=m-u,f=-Math.atan2(x,d),g=Math.PI,c=Math.PI/2,v=new mxPoint(o,u),y=e!=null?mxUtils.getValue(e.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST,T=y==mxConstants.DIRECTION_NORTH||y==mxConstants.DIRECTION_SOUTH,C=new mxPoint,S=new mxPoint;if((ps+a||p>r+l&&mr+l&&m>s+a)&&(n=!1),n){if(T){if(p==o){if(m<=s)return new mxPoint(o,s);if(m>=s+a)return new mxPoint(o,s+a)}else if(pr+l){if(m==s+a/4)return new mxPoint(r+l,s+a/4);if(m==s+3*a/4)return new mxPoint(r+l,s+3*a/4)}else if(p==r){if(mu)return new mxPoint(r,s+3*a/4)}else if(p==r+l){if(mu)return new mxPoint(r+l,s+3*a/4)}if(m==s)return new mxPoint(o,s);if(m==s+a)return new mxPoint(o,s+a);ps+a/4&&ms+3*a/4&&(C=new mxPoint(r-Math.floor(.5*l),s+Math.floor(.5*a)),S=new mxPoint(r+l,s+Math.floor(1.25*a))):p>o&&(m>s+a/4&&ms+3*a/4&&(C=new mxPoint(r+Math.floor(1.5*l),s+Math.floor(.5*a)),S=new mxPoint(r,s+Math.floor(1.25*a))))}else{if(m==u){if(p<=r)return new mxPoint(r,s+a/2);if(p>=r+l)return new mxPoint(r+l,s+a/2)}else if(ms+a){if(p==r+l/4)return new mxPoint(r+l/4,s+a);if(p==r+3*l/4)return new mxPoint(r+3*l/4,s+a)}else if(m==s){if(po)return new mxPoint(r+3*l/4,s)}else if(m==s+a){if(pu)return new mxPoint(r+3*l/4,s+a)}if(p==r)return new mxPoint(r,u);if(p==r+l)return new mxPoint(r+l,u);mr+l/4&&pr+3*l/4&&(C=new mxPoint(r+Math.floor(.5*l),s-Math.floor(.5*a)),S=new mxPoint(r+Math.floor(1.25*l),s+a)):m>u&&(p>r+l/4&&pr+3*l/4&&(C=new mxPoint(r+Math.floor(.5*l),s+Math.floor(1.5*a)),S=new mxPoint(r+Math.floor(1.25*l),s)))}var E=o,L=u;p>=r&&p<=r+l?(E=p,m=s&&m<=s+a&&(L=m,p-A?(C=new mxPoint(r+l,s),S=new mxPoint(r+l,s+a)):f>A&&fc&&fg-A&&f<=g||f<-g+A&&f>=-g?(C=new mxPoint(r,s),S=new mxPoint(r,s+a)):f<-A&&f>-c?(C=new mxPoint(r+Math.floor(1.5*l),s+Math.floor(.5*a)),S=new mxPoint(r,s+Math.floor(1.25*a))):f<-c&&f>-g+A&&(C=new mxPoint(r-Math.floor(.5*l),s+Math.floor(.5*a)),S=new mxPoint(r+l,s+Math.floor(1.25*a)))}else{var A=Math.atan2(a/2,l/4);if(f==A)return new mxPoint(r+Math.floor(.75*l),s);if(f==g-A)return new mxPoint(r+Math.floor(.25*l),s);if(f==g||f==-g)return new mxPoint(r,s+Math.floor(.5*a));if(f==0)return new mxPoint(r+l,s+Math.floor(.5*a));if(f==-A)return new mxPoint(r+Math.floor(.75*l),s+a);if(f==-g+A)return new mxPoint(r+Math.floor(.25*l),s+a);f>0&&fA&&fg-A&&f-A?(C=new mxPoint(r+Math.floor(.5*l),s+Math.floor(1.5*a)),S=new mxPoint(r+Math.floor(1.25*l),s)):f<-A&&f>-g+A?(C=new mxPoint(r,s+a),S=new mxPoint(r+l,s+a)):f<-g+A&&f>-g&&(C=new mxPoint(r-Math.floor(.25*l),s),S=new mxPoint(r+Math.floor(.5*l),s+Math.floor(1.5*a)))}v=mxUtils.intersection(o,u,i.x,i.y,C.x,C.y,S.x,S.y)}return v??new mxPoint(o,u)}};__mxOutput.mxPerimeter=typeof mxPerimeter<"u"?mxPerimeter:void 0;function mxPrintPreview(t,e,i,n,r,s,l,a,o){this.graph=t,this.scale=e??1/t.pageScale,this.border=n??0,this.pageFormat=mxRectangle.fromRectangle(i??t.pageFormat),this.title=a??"Printer-friendly version",this.x0=r??0,this.y0=s??0,this.borderColor=l,this.pageSelector=o??!0}mxPrintPreview.prototype.graph=null,mxPrintPreview.prototype.pageFormat=null,mxPrintPreview.prototype.scale=null,mxPrintPreview.prototype.border=0,mxPrintPreview.prototype.marginTop=0,mxPrintPreview.prototype.marginBottom=0,mxPrintPreview.prototype.x0=0,mxPrintPreview.prototype.y0=0,mxPrintPreview.prototype.autoOrigin=!0,mxPrintPreview.prototype.printOverlays=!1,mxPrintPreview.prototype.printControls=!1,mxPrintPreview.prototype.printBackgroundImage=!1,mxPrintPreview.prototype.backgroundColor="#ffffff",mxPrintPreview.prototype.borderColor=null,mxPrintPreview.prototype.title=null,mxPrintPreview.prototype.pageSelector=null,mxPrintPreview.prototype.wnd=null,mxPrintPreview.prototype.targetWindow=null,mxPrintPreview.prototype.pageCount=0,mxPrintPreview.prototype.clipping=!0,mxPrintPreview.prototype.getWindow=function(){return this.wnd},mxPrintPreview.prototype.getDoctype=function(){var t="";return document.documentMode==5?t='':document.documentMode==8?t='':document.documentMode>8&&(t=''),t},mxPrintPreview.prototype.appendGraph=function(t,e,i,n,r,s){this.graph=t,this.scale=e??1/t.pageScale,this.x0=i,this.y0=n,this.open(null,null,r,s)},mxPrintPreview.prototype.open=function(t,e,i,n){var r=this.graph.cellRenderer.initializeOverlay,s=null;try{this.printOverlays&&(this.graph.cellRenderer.initializeOverlay=function(P,R){R.init(P.view.getDrawPane())}),this.printControls&&(this.graph.cellRenderer.initControl=function(P,R,O,_){R.dialect=P.view.graph.dialect,R.init(P.view.getDrawPane())}),this.wnd=e??this.wnd;var l=!1;this.wnd==null&&(l=!0,this.wnd=window.open());var a=this.wnd.document;if(l){var o=this.getDoctype();o!=null&&o.length>0&&a.writeln(o),mxClient.IS_VML?a.writeln(''):(document.compatMode==="CSS1Compat"&&a.writeln(""),a.writeln("")),a.writeln(""),this.writeHead(a,t),a.writeln(""),a.writeln('')}var u=this.graph.getGraphBounds().clone(),p=this.graph.getView().getScale(),m=p/this.scale,d=this.graph.getView().getTranslate();this.autoOrigin||(this.x0-=d.x*this.scale,this.y0-=d.y*this.scale,u.width+=u.x,u.height+=u.y,u.x=0,u.y=0,this.border=0);var x=this.pageFormat.width-this.border*2,f=this.pageFormat.height-this.border*2;this.pageFormat.height+=this.marginTop+this.marginBottom,u.width/=m,u.height/=m;var g=Math.max(1,Math.ceil((u.width+this.x0)/x)),c=Math.max(1,Math.ceil((u.height+this.y0)/f));this.pageCount=g*c;var v=mxUtils.bind(this,function(){if(this.pageSelector&&(c>1||g>1)){var P=this.createPageSelector(c,g);if(a.body.appendChild(P),mxClient.IS_IE&&a.documentMode==null||a.documentMode==5||a.documentMode==8||a.documentMode==7){P.style.position="absolute";var R=function(){P.style.top=(a.body.scrollTop||a.documentElement.scrollTop)+10+"px"};mxEvent.addListener(this.wnd,"scroll",function(O){R()}),mxEvent.addListener(this.wnd,"resize",function(O){R()})}}}),y=mxUtils.bind(this,function(P,R){if(this.borderColor!=null&&(P.style.borderColor=this.borderColor,P.style.borderStyle="solid",P.style.borderWidth="1px"),P.style.background=this.backgroundColor,(i||R)&&(P.style.pageBreakAfter="always"),l&&(mxClient.IS_IE||document.documentMode>=11||mxClient.IS_EDGE))a.writeln(P.outerHTML),P.parentNode.removeChild(P);else if(mxClient.IS_IE||document.documentMode>=11||mxClient.IS_EDGE){var O=a.createElement("div");O.innerHTML=P.outerHTML,O=O.getElementsByTagName("div")[0],a.body.appendChild(O),P.parentNode.removeChild(P)}else P.parentNode.removeChild(P),a.body.appendChild(P);(i||R)&&this.addPageBreak(a)}),T=this.getCoverPages(this.pageFormat.width,this.pageFormat.height);if(T!=null)for(var C=0;C"),t.writeln(""),t.close(),mxEvent.release(t.body)}}catch{}},mxPrintPreview.prototype.writeHead=function(t,e){this.title!=null&&t.writeln(""+this.title+""),mxClient.IS_VML&&t.writeln(''),mxClient.link("stylesheet",mxClient.basePath+"/css/common.css",t),t.writeln('")},mxPrintPreview.prototype.writePostfix=function(t){},mxPrintPreview.prototype.createPageSelector=function(t,e){var i=this.wnd.document,n=i.createElement("table");n.className="mxPageSelector",n.setAttribute("border","0");for(var r=i.createElement("tbody"),s=0;s0&&b.height>0&&!mxUtils.intersects(C,b))return}}v.apply(this,arguments)}}var S=null;try{var E=[this.getRoot()];S=new mxTemporaryCellStates(l,i,E,null,mxUtils.bind(this,function(P){return this.getLinkForCellState(P)}))}finally{if(mxClient.IS_IE)l.overlayPane.innerHTML="",l.canvas.style.overflow="hidden",l.canvas.style.position="relative",l.canvas.style.top=this.marginTop+"px",l.canvas.style.width=s.width+"px",l.canvas.style.height=s.height+"px";else for(var L=r.firstChild;L!=null;){var A=L.nextSibling,M=L.nodeName.toLowerCase();M=="svg"?(L.style.overflow="hidden",L.style.position="relative",L.style.top=this.marginTop+"px",L.setAttribute("width",s.width),L.setAttribute("height",s.height),L.style.width="",L.style.height=""):L.style.cursor!="default"&&M!="div"&&L.parentNode.removeChild(L),L=A}if(this.printBackgroundImage){var I=r.getElementsByTagName("svg");I.length>0&&(I[0].style.position="absolute")}l.overlayPane.parentNode.removeChild(l.overlayPane),this.graph.setEnabled(g),this.graph.container=a,this.graph.cellRenderer.redraw=v,l.canvas=o,l.backgroundPane=u,l.drawPane=p,l.overlayPane=m,l.translate=c,S.destroy(),l.setEventsEnabled(f)}},mxPrintPreview.prototype.getLinkForCellState=function(t){return this.graph.getLinkForCell(t.cell)},mxPrintPreview.prototype.insertBackgroundImage=function(t,e,i){var n=this.graph.backgroundImage;if(n!=null){var r=document.createElement("img");r.style.position="absolute",r.style.marginLeft=Math.round(e*this.scale)+"px",r.style.marginTop=Math.round(i*this.scale)+"px",r.setAttribute("width",Math.round(this.scale*n.width)),r.setAttribute("height",Math.round(this.scale*n.height)),r.src=n.src,t.insertBefore(r,t.firstChild)}},mxPrintPreview.prototype.getCoverPages=function(){return null},mxPrintPreview.prototype.getAppendices=function(){return null},mxPrintPreview.prototype.print=function(t){var e=this.open(t);e!=null&&e.print()},mxPrintPreview.prototype.close=function(){this.wnd!=null&&(this.wnd.close(),this.wnd=null)},__mxOutput.mxPrintPreview=typeof mxPrintPreview<"u"?mxPrintPreview:void 0;function mxStylesheet(){this.styles=new Object,this.putDefaultVertexStyle(this.createDefaultVertexStyle()),this.putDefaultEdgeStyle(this.createDefaultEdgeStyle())}mxStylesheet.prototype.styles,mxStylesheet.prototype.createDefaultVertexStyle=function(){var t=new Object;return t[mxConstants.STYLE_SHAPE]=mxConstants.SHAPE_RECTANGLE,t[mxConstants.STYLE_PERIMETER]=mxPerimeter.RectanglePerimeter,t[mxConstants.STYLE_VERTICAL_ALIGN]=mxConstants.ALIGN_MIDDLE,t[mxConstants.STYLE_ALIGN]=mxConstants.ALIGN_CENTER,t[mxConstants.STYLE_FILLCOLOR]="#C3D9FF",t[mxConstants.STYLE_STROKECOLOR]="#6482B9",t[mxConstants.STYLE_FONTCOLOR]="#774400",t},mxStylesheet.prototype.createDefaultEdgeStyle=function(){var t=new Object;return t[mxConstants.STYLE_SHAPE]=mxConstants.SHAPE_CONNECTOR,t[mxConstants.STYLE_ENDARROW]=mxConstants.ARROW_CLASSIC,t[mxConstants.STYLE_VERTICAL_ALIGN]=mxConstants.ALIGN_MIDDLE,t[mxConstants.STYLE_ALIGN]=mxConstants.ALIGN_CENTER,t[mxConstants.STYLE_STROKECOLOR]="#6482B9",t[mxConstants.STYLE_FONTCOLOR]="#446299",t},mxStylesheet.prototype.putDefaultVertexStyle=function(t){this.putCellStyle("defaultVertex",t)},mxStylesheet.prototype.putDefaultEdgeStyle=function(t){this.putCellStyle("defaultEdge",t)},mxStylesheet.prototype.getDefaultVertexStyle=function(){return this.styles.defaultVertex},mxStylesheet.prototype.getDefaultEdgeStyle=function(){return this.styles.defaultEdge},mxStylesheet.prototype.putCellStyle=function(t,e){this.styles[t]=e},mxStylesheet.prototype.getCellStyle=function(t,e){var i=e;if(t!=null&&t.length>0){var n=t.split(";");i!=null&&t.charAt(0)!=";"?i=mxUtils.clone(i):i=new Object;for(var r=0;r=0){var a=s.substring(0,l),o=s.substring(l+1);o==mxConstants.NONE?delete i[a]:mxUtils.isNumeric(o)?i[a]=parseFloat(o):i[a]=o}else{var u=this.styles[s];if(u!=null)for(var a in u)i[a]=u[a]}}}return i},__mxOutput.mxStylesheet=typeof mxStylesheet<"u"?mxStylesheet:void 0;function mxCellState(t,e,i){this.view=t,this.cell=e,this.style=i??{},this.origin=new mxPoint,this.absoluteOffset=new mxPoint}mxCellState.prototype=new mxRectangle,mxCellState.prototype.constructor=mxCellState,mxCellState.prototype.view=null,mxCellState.prototype.cell=null,mxCellState.prototype.style=null,mxCellState.prototype.invalidStyle=!1,mxCellState.prototype.invalid=!0,mxCellState.prototype.origin=null,mxCellState.prototype.absolutePoints=null,mxCellState.prototype.absoluteOffset=null,mxCellState.prototype.visibleSourceState=null,mxCellState.prototype.visibleTargetState=null,mxCellState.prototype.terminalDistance=0,mxCellState.prototype.length=0,mxCellState.prototype.segments=null,mxCellState.prototype.shape=null,mxCellState.prototype.text=null,mxCellState.prototype.unscaledWidth=null,mxCellState.prototype.unscaledHeight=null,mxCellState.prototype.getPerimeterBounds=function(t,e){if(t=t||0,e=e??new mxRectangle(this.x,this.y,this.width,this.height),this.shape!=null&&this.shape.stencil!=null&&this.shape.stencil.aspect=="fixed"){var i=this.shape.stencil.computeAspect(this.style,e.x,e.y,e.width,e.height);e.x=i.x,e.y=i.y,e.width=this.shape.stencil.w0*i.width,e.height=this.shape.stencil.h0*i.height}return t!=0&&e.grow(t),e},mxCellState.prototype.setAbsoluteTerminalPoint=function(t,e){e?(this.absolutePoints==null&&(this.absolutePoints=[]),this.absolutePoints.length==0?this.absolutePoints.push(t):this.absolutePoints[0]=t):this.absolutePoints==null?(this.absolutePoints=[],this.absolutePoints.push(null),this.absolutePoints.push(t)):this.absolutePoints.length==1?this.absolutePoints.push(t):this.absolutePoints[this.absolutePoints.length-1]=t},mxCellState.prototype.setCursor=function(t){this.shape!=null&&this.shape.setCursor(t),this.text!=null&&this.text.setCursor(t)},mxCellState.prototype.getVisibleTerminal=function(t){var e=this.getVisibleTerminalState(t);return e!=null?e.cell:null},mxCellState.prototype.getVisibleTerminalState=function(t){return t?this.visibleSourceState:this.visibleTargetState},mxCellState.prototype.setVisibleTerminalState=function(t,e){e?this.visibleSourceState=t:this.visibleTargetState=t},mxCellState.prototype.getCellBounds=function(){return this.cellBounds},mxCellState.prototype.getPaintBounds=function(){return this.paintBounds},mxCellState.prototype.updateCachedBounds=function(){var t=this.view.translate,e=this.view.scale;this.cellBounds=new mxRectangle(this.x/e-t.x,this.y/e-t.y,this.width/e,this.height/e),this.paintBounds=mxRectangle.fromRectangle(this.cellBounds),this.shape!=null&&this.shape.isPaintBoundsInverted()&&this.paintBounds.rotate90()},mxCellState.prototype.setState=function(t){this.view=t.view,this.cell=t.cell,this.style=t.style,this.absolutePoints=t.absolutePoints,this.origin=t.origin,this.absoluteOffset=t.absoluteOffset,this.boundingBox=t.boundingBox,this.terminalDistance=t.terminalDistance,this.segments=t.segments,this.length=t.length,this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this.unscaledWidth=t.unscaledWidth,this.unscaledHeight=t.unscaledHeight},mxCellState.prototype.clone=function(){var t=new mxCellState(this.view,this.cell,this.style);if(this.absolutePoints!=null){t.absolutePoints=[];for(var e=0;e=0:!1},mxGraphSelectionModel.prototype.isEmpty=function(){return this.cells.length==0},mxGraphSelectionModel.prototype.clear=function(){this.changeSelection(null,this.cells)},mxGraphSelectionModel.prototype.setCell=function(t){t!=null&&this.setCells([t])},mxGraphSelectionModel.prototype.setCells=function(t){if(t!=null){this.singleSelection&&(t=[this.getFirstSelectableCell(t)]);for(var e=[],i=0;i0&&t[0]!=null||e!=null&&e.length>0&&e[0]!=null){var i=new mxSelectionChange(this,t,e);i.execute();var n=new mxUndoableEdit(this,!1);n.add(i),this.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",n))}},mxGraphSelectionModel.prototype.cellAdded=function(t){t!=null&&!this.isSelected(t)&&this.cells.push(t)},mxGraphSelectionModel.prototype.cellRemoved=function(t){if(t!=null){var e=mxUtils.indexOf(this.cells,t);e>=0&&this.cells.splice(e,1)}};function mxSelectionChange(t,e,i){this.selectionModel=t,this.added=e!=null?e.slice():null,this.removed=i!=null?i.slice():null}mxSelectionChange.prototype.execute=function(){var t=mxLog.enter("mxSelectionChange.execute");if(window.status=mxResources.get(this.selectionModel.updatingSelectionResource)||this.selectionModel.updatingSelectionResource,this.removed!=null)for(var e=0;e":"",mxCellEditor.prototype.escapeCancelsEditing=!0,mxCellEditor.prototype.textNode="",mxCellEditor.prototype.zIndex=5,mxCellEditor.prototype.minResize=new mxRectangle(0,20),mxCellEditor.prototype.wordWrapPadding=mxClient.IS_QUIRKS?2:mxClient.IS_IE11?0:1,mxCellEditor.prototype.blurEnabled=!1,mxCellEditor.prototype.initialValue=null,mxCellEditor.prototype.align=null,mxCellEditor.prototype.init=function(){this.textarea=document.createElement("div"),this.textarea.className="mxCellEditor mxPlainTextEditor",this.textarea.contentEditable=!0,mxClient.IS_GC&&(this.textarea.style.minHeight="1em"),this.textarea.style.position=this.isLegacyEditor()?"absolute":"relative",this.installListeners(this.textarea)},mxCellEditor.prototype.applyValue=function(t,e){this.graph.labelChanged(t.cell,e,this.trigger)},mxCellEditor.prototype.setAlign=function(t){this.textarea!=null&&(this.textarea.style.textAlign=t),this.align=t,this.resize()},mxCellEditor.prototype.getInitialValue=function(t,e){var i=mxUtils.htmlEntities(this.graph.getEditingValue(t.cell,e),!1);return!mxClient.IS_QUIRKS&&document.documentMode!=8&&document.documentMode!=9&&document.documentMode!=10&&(i=mxUtils.replaceTrailingNewlines(i,"

")),i.replace(/\n/g,"
")},mxCellEditor.prototype.getCurrentValue=function(t){return mxUtils.extractTextWithWhitespace(this.textarea.childNodes)},mxCellEditor.prototype.isCancelEditingKeyEvent=function(t){return this.escapeCancelsEditing||mxEvent.isShiftDown(t)||mxEvent.isControlDown(t)||mxEvent.isMetaDown(t)},mxCellEditor.prototype.installListeners=function(t){mxEvent.addListener(t,"dragstart",mxUtils.bind(this,function(s){this.graph.stopEditing(!1),mxEvent.consume(s)})),mxEvent.addListener(t,"blur",mxUtils.bind(this,function(s){this.blurEnabled&&this.focusLost(s)})),mxEvent.addListener(t,"keydown",mxUtils.bind(this,function(s){mxEvent.isConsumed(s)||(this.isStopEditingEvent(s)?(this.graph.stopEditing(!1),mxEvent.consume(s)):s.keyCode==27&&(this.graph.stopEditing(this.isCancelEditingKeyEvent(s)),mxEvent.consume(s)))}));var e=mxUtils.bind(this,function(s){this.editingCell!=null&&this.clearOnChange&&t.innerHTML==this.getEmptyLabelText()&&(!mxClient.IS_FF||s.keyCode!=8&&s.keyCode!=46)&&(this.clearOnChange=!1,t.innerHTML="")});mxEvent.addListener(t,"keypress",e),mxEvent.addListener(t,"paste",e);var i=mxUtils.bind(this,function(s){this.editingCell!=null&&(this.textarea.innerHTML.length==0||this.textarea.innerHTML=="
"?(this.textarea.innerHTML=this.getEmptyLabelText(),this.clearOnChange=this.textarea.innerHTML.length>0):this.clearOnChange=!1)});mxEvent.addListener(t,!mxClient.IS_IE11&&!mxClient.IS_IE?"input":"keyup",i),mxEvent.addListener(t,"cut",i),mxEvent.addListener(t,"paste",i);var n=!mxClient.IS_IE11&&!mxClient.IS_IE?"input":"keydown",r=mxUtils.bind(this,function(s){this.editingCell!=null&&this.autoSize&&!mxEvent.isConsumed(s)&&(this.resizeThread!=null&&window.clearTimeout(this.resizeThread),this.resizeThread=window.setTimeout(mxUtils.bind(this,function(){this.resizeThread=null,this.resize()}),0))});mxEvent.addListener(t,n,r),mxEvent.addListener(window,"resize",r),document.documentMode>=9?(mxEvent.addListener(t,"DOMNodeRemoved",r),mxEvent.addListener(t,"DOMNodeInserted",r)):(mxEvent.addListener(t,"cut",r),mxEvent.addListener(t,"paste",r))},mxCellEditor.prototype.isStopEditingEvent=function(t){return t.keyCode==113||this.graph.isEnterStopsCellEditing()&&t.keyCode==13&&!mxEvent.isControlDown(t)&&!mxEvent.isShiftDown(t)},mxCellEditor.prototype.isEventSource=function(t){return mxEvent.getSource(t)==this.textarea},mxCellEditor.prototype.resize=function(){var t=this.graph.getView().getState(this.editingCell);if(t==null)this.stopEditing(!0);else if(this.textarea!=null){var e=this.graph.getModel().isEdge(t.cell),i=this.graph.getView().scale,n=null;if(!this.autoSize||t.style[mxConstants.STYLE_OVERFLOW]=="fill")this.bounds=this.getEditorBounds(t),this.textarea.style.width=Math.round(this.bounds.width/i)+"px",this.textarea.style.height=Math.round(this.bounds.height/i)+"px",document.documentMode==8||mxClient.IS_QUIRKS?(this.textarea.style.left=Math.round(this.bounds.x)+"px",this.textarea.style.top=Math.round(this.bounds.y)+"px"):(this.textarea.style.left=Math.max(0,Math.round(this.bounds.x+1))+"px",this.textarea.style.top=Math.max(0,Math.round(this.bounds.y+1))+"px"),this.graph.isWrapping(t.cell)&&(this.bounds.width>=2||this.bounds.height>=2)&&this.textarea.innerHTML!=this.getEmptyLabelText()?(this.textarea.style.wordWrap=mxConstants.WORD_WRAP,this.textarea.style.whiteSpace="normal",t.style[mxConstants.STYLE_OVERFLOW]!="fill"&&(this.textarea.style.width=Math.round(this.bounds.width/i)+this.wordWrapPadding+"px")):(this.textarea.style.whiteSpace="nowrap",t.style[mxConstants.STYLE_OVERFLOW]!="fill"&&(this.textarea.style.width=""));else{var r=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_WIDTH,null);if(n=t.text!=null&&this.align==null?t.text.margin:null,n==null&&(n=mxUtils.getAlignmentAsPoint(this.align||mxUtils.getValue(t.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_CENTER),mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE))),e){if(this.bounds=new mxRectangle(t.absoluteOffset.x,t.absoluteOffset.y,0,0),r!=null){var s=(parseFloat(r)+2)*i;this.bounds.width=s,this.bounds.x+=n.x*s}}else{var l=mxRectangle.fromRectangle(t),a=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER),o=mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE);if(l=t.shape!=null&&a==mxConstants.ALIGN_CENTER&&o==mxConstants.ALIGN_MIDDLE?t.shape.getLabelBounds(l):l,r!=null&&(l.width=parseFloat(r)*i),!t.view.graph.cellRenderer.legacySpacing||t.style[mxConstants.STYLE_OVERFLOW]!="width"){var u=parseInt(t.style[mxConstants.STYLE_SPACING]||2)*i,p=(parseInt(t.style[mxConstants.STYLE_SPACING_TOP]||0)+mxText.prototype.baseSpacingTop)*i+u,m=(parseInt(t.style[mxConstants.STYLE_SPACING_RIGHT]||0)+mxText.prototype.baseSpacingRight)*i+u,d=(parseInt(t.style[mxConstants.STYLE_SPACING_BOTTOM]||0)+mxText.prototype.baseSpacingBottom)*i+u,x=(parseInt(t.style[mxConstants.STYLE_SPACING_LEFT]||0)+mxText.prototype.baseSpacingLeft)*i+u,a=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER),o=mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE);l=new mxRectangle(l.x+x,l.y+p,l.width-(a==mxConstants.ALIGN_CENTER&&r==null?x+m:0),l.height-(o==mxConstants.ALIGN_MIDDLE?p+d:0))}this.bounds=new mxRectangle(l.x+t.absoluteOffset.x,l.y+t.absoluteOffset.y,l.width,l.height)}if(this.graph.isWrapping(t.cell)&&(this.bounds.width>=2||this.bounds.height>=2)&&this.textarea.innerHTML!=this.getEmptyLabelText()){this.textarea.style.wordWrap=mxConstants.WORD_WRAP,this.textarea.style.whiteSpace="normal";var s=Math.round(this.bounds.width/(document.documentMode==8,i))+this.wordWrapPadding;this.textarea.style.position!="relative"?(this.textarea.style.width=s+"px",this.textarea.scrollWidth>s&&(this.textarea.style.width=this.textarea.scrollWidth+"px")):this.textarea.style.maxWidth=s+"px"}else this.textarea.style.whiteSpace="nowrap",this.textarea.style.width="";document.documentMode==8&&(this.textarea.style.zoom="1",this.textarea.style.height="auto");var f=this.textarea.scrollWidth,g=this.textarea.scrollHeight;document.documentMode==8?(this.textarea.style.left=Math.max(0,Math.ceil((this.bounds.x-n.x*(this.bounds.width-(f+1)*i)+f*(i-1)*0+(n.x+.5)*2)/i))+"px",this.textarea.style.top=Math.max(0,Math.ceil((this.bounds.y-n.y*(this.bounds.height-(g+.5)*i)+g*(i-1)*0+Math.abs(n.y+.5)*1)/i))+"px",this.textarea.style.width=Math.round(f*i)+"px",this.textarea.style.height=Math.round(g*i)+"px"):mxClient.IS_QUIRKS?(this.textarea.style.left=Math.max(0,Math.ceil(this.bounds.x-n.x*(this.bounds.width-(f+1)*i)+f*(i-1)*0+(n.x+.5)*2))+"px",this.textarea.style.top=Math.max(0,Math.ceil(this.bounds.y-n.y*(this.bounds.height-(g+.5)*i)+g*(i-1)*0+Math.abs(n.y+.5)*1))+"px"):(this.textarea.style.left=Math.max(0,Math.round(this.bounds.x-n.x*(this.bounds.width-2))+1)+"px",this.textarea.style.top=Math.max(0,Math.round(this.bounds.y-n.y*(this.bounds.height-4)+(n.y==-1?3:0))+1)+"px")}mxClient.IS_VML?this.textarea.style.zoom=i:(mxUtils.setPrefixedStyle(this.textarea.style,"transformOrigin","0px 0px"),mxUtils.setPrefixedStyle(this.textarea.style,"transform","scale("+i+","+i+")"+(n==null?"":" translate("+n.x*100+"%,"+n.y*100+"%)")))}},mxCellEditor.prototype.focusLost=function(){this.stopEditing(!this.graph.isInvokesStopCellEditing())},mxCellEditor.prototype.getBackgroundColor=function(t){return null},mxCellEditor.prototype.isLegacyEditor=function(){if(mxClient.IS_VML)return!0;var t=!1;if(mxClient.IS_SVG){var e=this.graph.view.getDrawPane().ownerSVGElement;if(e!=null){var i=mxUtils.getCurrentStyle(e);i!=null&&(t=i.position=="absolute")}}return!t},mxCellEditor.prototype.startEditing=function(t,e){this.stopEditing(!0),this.align=null,this.textarea==null&&this.init(),this.graph.tooltipHandler!=null&&this.graph.tooltipHandler.hideTooltip();var i=this.graph.getView().getState(t);if(i!=null){this.graph.getView().scale;var n=mxUtils.getValue(i.style,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE),r=mxUtils.getValue(i.style,mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY),s=mxUtils.getValue(i.style,mxConstants.STYLE_FONTCOLOR,"black"),l=mxUtils.getValue(i.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_LEFT),a=(mxUtils.getValue(i.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD,o=(mxUtils.getValue(i.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC,u=[];(mxUtils.getValue(i.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&u.push("underline"),(mxUtils.getValue(i.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&u.push("line-through"),this.textarea.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?Math.round(n*mxConstants.LINE_HEIGHT)+"px":mxConstants.LINE_HEIGHT,this.textarea.style.backgroundColor=this.getBackgroundColor(i),this.textarea.style.textDecoration=u.join(" "),this.textarea.style.fontWeight=a?"bold":"normal",this.textarea.style.fontStyle=o?"italic":"",this.textarea.style.fontSize=Math.round(n)+"px",this.textarea.style.zIndex=this.zIndex,this.textarea.style.fontFamily=r,this.textarea.style.textAlign=l,this.textarea.style.outline="none",this.textarea.style.color=s;var p=this.textDirection=mxUtils.getValue(i.style,mxConstants.STYLE_TEXT_DIRECTION,mxConstants.DEFAULT_TEXT_DIRECTION);p==mxConstants.TEXT_DIRECTION_AUTO&&i!=null&&i.text!=null&&i.text.dialect!=mxConstants.DIALECT_STRICTHTML&&!mxUtils.isNode(i.text.value)&&(p=i.text.getAutoDirection()),p==mxConstants.TEXT_DIRECTION_LTR||p==mxConstants.TEXT_DIRECTION_RTL?this.textarea.setAttribute("dir",p):this.textarea.removeAttribute("dir"),this.textarea.innerHTML=this.getInitialValue(i,e)||"",this.initialValue=this.textarea.innerHTML,this.textarea.innerHTML.length==0||this.textarea.innerHTML=="
"?(this.textarea.innerHTML=this.getEmptyLabelText(),this.clearOnChange=!0):this.clearOnChange=this.textarea.innerHTML==this.getEmptyLabelText(),this.graph.container.appendChild(this.textarea),this.editingCell=t,this.trigger=e,this.textNode=null,i.text!=null&&this.isHideLabel(i)&&(this.textNode=i.text.node,this.textNode.style.visibility="hidden"),this.autoSize&&(this.graph.model.isEdge(i.cell)||i.style[mxConstants.STYLE_OVERFLOW]!="fill")&&window.setTimeout(mxUtils.bind(this,function(){this.resize()}),0),this.resize();try{this.textarea.focus(),this.isSelectText()&&this.textarea.innerHTML.length>0&&(this.textarea.innerHTML!=this.getEmptyLabelText()||!this.clearOnChange)&&document.execCommand("selectAll",!1,null)}catch{}}},mxCellEditor.prototype.isSelectText=function(){return this.selectText},mxCellEditor.prototype.clearSelection=function(){var t=null;window.getSelection?t=window.getSelection():document.selection&&(t=document.selection),t!=null&&(t.empty?t.empty():t.removeAllRanges&&t.removeAllRanges())},mxCellEditor.prototype.stopEditing=function(t){if(t=t||!1,this.editingCell!=null){this.textNode!=null&&(this.textNode.style.visibility="visible",this.textNode=null);var e=t?null:this.graph.view.getState(this.editingCell),i=this.initialValue;if(this.initialValue=null,this.editingCell=null,this.trigger=null,this.bounds=null,this.textarea.blur(),this.clearSelection(),this.textarea.parentNode!=null&&this.textarea.parentNode.removeChild(this.textarea),this.clearOnChange&&this.textarea.innerHTML==this.getEmptyLabelText()&&(this.textarea.innerHTML="",this.clearOnChange=!1),e!=null&&(this.textarea.innerHTML!=i||this.align!=null)){this.prepareTextarea();var n=this.getCurrentValue(e);this.graph.getModel().beginUpdate();try{n!=null&&this.applyValue(e,n),this.align!=null&&this.graph.setCellStyles(mxConstants.STYLE_ALIGN,this.align,[e.cell])}finally{this.graph.getModel().endUpdate()}}mxEvent.release(this.textarea),this.textarea=null,this.align=null}},mxCellEditor.prototype.prepareTextarea=function(){this.textarea.lastChild!=null&&this.textarea.lastChild.nodeName=="BR"&&this.textarea.removeChild(this.textarea.lastChild)},mxCellEditor.prototype.isHideLabel=function(t){return!0},mxCellEditor.prototype.getMinimumSize=function(t){var e=this.graph.getView().scale;return new mxRectangle(0,0,t.text==null?30:t.text.size*e+20,this.textarea.style.textAlign=="left"?120:40)},mxCellEditor.prototype.getEditorBounds=function(t){var e=this.graph.getModel().isEdge(t.cell),i=this.graph.getView().scale,n=this.getMinimumSize(t),r=n.width,s=n.height,l=null;if(!e&&t.view.graph.cellRenderer.legacySpacing&&t.style[mxConstants.STYLE_OVERFLOW]=="fill")l=t.shape.getLabelBounds(mxRectangle.fromRectangle(t));else{var a=parseInt(t.style[mxConstants.STYLE_SPACING]||0)*i,o=(parseInt(t.style[mxConstants.STYLE_SPACING_TOP]||0)+mxText.prototype.baseSpacingTop)*i+a,u=(parseInt(t.style[mxConstants.STYLE_SPACING_RIGHT]||0)+mxText.prototype.baseSpacingRight)*i+a,p=(parseInt(t.style[mxConstants.STYLE_SPACING_BOTTOM]||0)+mxText.prototype.baseSpacingBottom)*i+a,m=(parseInt(t.style[mxConstants.STYLE_SPACING_LEFT]||0)+mxText.prototype.baseSpacingLeft)*i+a;l=new mxRectangle(t.x,t.y,Math.max(r,t.width-m-u),Math.max(s,t.height-o-p));var d=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER),x=mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE);if(l=t.shape!=null&&d==mxConstants.ALIGN_CENTER&&x==mxConstants.ALIGN_MIDDLE?t.shape.getLabelBounds(l):l,e?(l.x=t.absoluteOffset.x,l.y=t.absoluteOffset.y,t.text!=null&&t.text.boundingBox!=null&&(t.text.boundingBox.x>0&&(l.x=t.text.boundingBox.x),t.text.boundingBox.y>0&&(l.y=t.text.boundingBox.y))):t.text!=null&&t.text.boundingBox!=null&&(l.x=Math.min(l.x,t.text.boundingBox.x),l.y=Math.min(l.y,t.text.boundingBox.y)),l.x+=m,l.y+=o,t.text!=null&&t.text.boundingBox!=null&&(e?(l.width=Math.max(r,t.text.boundingBox.width),l.height=Math.max(s,t.text.boundingBox.height)):(l.width=Math.max(l.width,t.text.boundingBox.width),l.height=Math.max(l.height,t.text.boundingBox.height))),this.graph.getModel().isVertex(t.cell)){var f=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER);f==mxConstants.ALIGN_LEFT?l.x-=t.width:f==mxConstants.ALIGN_RIGHT&&(l.x+=t.width);var g=mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE);g==mxConstants.ALIGN_TOP?l.y-=t.height:g==mxConstants.ALIGN_BOTTOM&&(l.y+=t.height)}}return new mxRectangle(Math.round(l.x),Math.round(l.y),Math.round(l.width),Math.round(l.height))},mxCellEditor.prototype.getEmptyLabelText=function(t){return this.emptyLabelText},mxCellEditor.prototype.getEditingCell=function(){return this.editingCell},mxCellEditor.prototype.destroy=function(){this.textarea!=null&&(mxEvent.release(this.textarea),this.textarea.parentNode!=null&&this.textarea.parentNode.removeChild(this.textarea),this.textarea=null),this.changeHandler!=null&&(this.graph.getModel().removeListener(this.changeHandler),this.changeHandler=null),this.zoomHandler&&(this.graph.view.removeListener(this.zoomHandler),this.zoomHandler=null)},__mxOutput.mxCellEditor=typeof mxCellEditor<"u"?mxCellEditor:void 0;function mxCellRenderer(){}mxCellRenderer.defaultShapes=new Object,mxCellRenderer.prototype.defaultEdgeShape=mxConnector,mxCellRenderer.prototype.defaultVertexShape=mxRectangleShape,mxCellRenderer.prototype.defaultTextShape=mxText,mxCellRenderer.prototype.legacyControlPosition=!0,mxCellRenderer.prototype.legacySpacing=!0,mxCellRenderer.prototype.antiAlias=!0,mxCellRenderer.prototype.minSvgStrokeWidth=1,mxCellRenderer.prototype.forceControlClickHandler=!1,mxCellRenderer.registerShape=function(t,e){mxCellRenderer.defaultShapes[t]=e},mxCellRenderer.registerShape(mxConstants.SHAPE_RECTANGLE,mxRectangleShape),mxCellRenderer.registerShape(mxConstants.SHAPE_ELLIPSE,mxEllipse),mxCellRenderer.registerShape(mxConstants.SHAPE_RHOMBUS,mxRhombus),mxCellRenderer.registerShape(mxConstants.SHAPE_CYLINDER,mxCylinder),mxCellRenderer.registerShape(mxConstants.SHAPE_CONNECTOR,mxConnector),mxCellRenderer.registerShape(mxConstants.SHAPE_ACTOR,mxActor),mxCellRenderer.registerShape(mxConstants.SHAPE_TRIANGLE,mxTriangle),mxCellRenderer.registerShape(mxConstants.SHAPE_HEXAGON,mxHexagon),mxCellRenderer.registerShape(mxConstants.SHAPE_CLOUD,mxCloud),mxCellRenderer.registerShape(mxConstants.SHAPE_LINE,mxLine),mxCellRenderer.registerShape(mxConstants.SHAPE_ARROW,mxArrow),mxCellRenderer.registerShape(mxConstants.SHAPE_ARROW_CONNECTOR,mxArrowConnector),mxCellRenderer.registerShape(mxConstants.SHAPE_DOUBLE_ELLIPSE,mxDoubleEllipse),mxCellRenderer.registerShape(mxConstants.SHAPE_SWIMLANE,mxSwimlane),mxCellRenderer.registerShape(mxConstants.SHAPE_IMAGE,mxImageShape),mxCellRenderer.registerShape(mxConstants.SHAPE_LABEL,mxLabel),mxCellRenderer.prototype.initializeShape=function(t){t.shape.dialect=t.view.graph.dialect,this.configureShape(t),t.shape.init(t.view.getDrawPane())},mxCellRenderer.prototype.createShape=function(t){var e=null;if(t.style!=null){var i=mxStencilRegistry.getStencil(t.style[mxConstants.STYLE_SHAPE]);if(i!=null)e=new mxShape(i);else{var n=this.getShapeConstructor(t);e=new n}}return e},mxCellRenderer.prototype.createIndicatorShape=function(t){t.shape.indicatorShape=this.getShape(t.view.graph.getIndicatorShape(t))},mxCellRenderer.prototype.getShape=function(t){return t!=null?mxCellRenderer.defaultShapes[t]:null},mxCellRenderer.prototype.getShapeConstructor=function(t){var e=this.getShape(t.style[mxConstants.STYLE_SHAPE]);return e==null&&(e=t.view.graph.getModel().isEdge(t.cell)?this.defaultEdgeShape:this.defaultVertexShape),e},mxCellRenderer.prototype.configureShape=function(t){t.shape.apply(t),t.shape.image=t.view.graph.getImage(t),t.shape.indicatorColor=t.view.graph.getIndicatorColor(t),t.shape.indicatorStrokeColor=t.style[mxConstants.STYLE_INDICATOR_STROKECOLOR],t.shape.indicatorGradientColor=t.view.graph.getIndicatorGradientColor(t),t.shape.indicatorDirection=t.style[mxConstants.STYLE_INDICATOR_DIRECTION],t.shape.indicatorImage=t.view.graph.getIndicatorImage(t),this.postConfigureShape(t)},mxCellRenderer.prototype.postConfigureShape=function(t){t.shape!=null&&(this.resolveColor(t,"indicatorGradientColor",mxConstants.STYLE_GRADIENTCOLOR),this.resolveColor(t,"indicatorColor",mxConstants.STYLE_FILLCOLOR),this.resolveColor(t,"gradient",mxConstants.STYLE_GRADIENTCOLOR),this.resolveColor(t,"stroke",mxConstants.STYLE_STROKECOLOR),this.resolveColor(t,"fill",mxConstants.STYLE_FILLCOLOR))},mxCellRenderer.prototype.checkPlaceholderStyles=function(t){if(t.style!=null){for(var e=["inherit","swimlane","indicated"],i=[mxConstants.STYLE_FILLCOLOR,mxConstants.STYLE_STROKECOLOR,mxConstants.STYLE_GRADIENTCOLOR,mxConstants.STYLE_FONTCOLOR],n=0;n=0)return!0}return!1},mxCellRenderer.prototype.resolveColor=function(t,e,i){var n=i==mxConstants.STYLE_FONTCOLOR?t.text:t.shape;if(n!=null){var r=t.view.graph,s=n[e],l=null;if(s=="inherit"?l=r.model.getParent(t.cell):s=="swimlane"?(n[e]=i==mxConstants.STYLE_STROKECOLOR||i==mxConstants.STYLE_FONTCOLOR?"#000000":"#ffffff",r.model.getTerminal(t.cell,!1)!=null?l=r.model.getTerminal(t.cell,!1):l=t.cell,l=r.getSwimlane(l),i=r.swimlaneIndicatorColorAttribute):s=="indicated"&&t.shape!=null?n[e]=t.shape.indicatorColor:i!=mxConstants.STYLE_FILLCOLOR&&s==mxConstants.STYLE_FILLCOLOR&&t.shape!=null?n[e]=t.style[mxConstants.STYLE_FILLCOLOR]:i!=mxConstants.STYLE_STROKECOLOR&&s==mxConstants.STYLE_STROKECOLOR&&t.shape!=null&&(n[e]=t.style[mxConstants.STYLE_STROKECOLOR]),l!=null){var a=r.getView().getState(l);if(n[e]=null,a!=null){var o=i==mxConstants.STYLE_FONTCOLOR?a.text:a.shape;o!=null&&e!="indicatorColor"?n[e]=o[e]:n[e]=a.style[i]}}}},mxCellRenderer.prototype.getLabelValue=function(t){return t.view.graph.getLabel(t.cell)},mxCellRenderer.prototype.createLabel=function(t,e){var i=t.view.graph;if(i.getModel().isEdge(t.cell),t.style[mxConstants.STYLE_FONTSIZE]>0||t.style[mxConstants.STYLE_FONTSIZE]==null){var n=i.isHtmlLabel(t.cell)||e!=null&&mxUtils.isNode(e);t.text=new this.defaultTextShape(e,new mxRectangle,t.style[mxConstants.STYLE_ALIGN]||mxConstants.ALIGN_CENTER,i.getVerticalAlign(t),t.style[mxConstants.STYLE_FONTCOLOR],t.style[mxConstants.STYLE_FONTFAMILY],t.style[mxConstants.STYLE_FONTSIZE],t.style[mxConstants.STYLE_FONTSTYLE],t.style[mxConstants.STYLE_SPACING],t.style[mxConstants.STYLE_SPACING_TOP],t.style[mxConstants.STYLE_SPACING_RIGHT],t.style[mxConstants.STYLE_SPACING_BOTTOM],t.style[mxConstants.STYLE_SPACING_LEFT],t.style[mxConstants.STYLE_HORIZONTAL],t.style[mxConstants.STYLE_LABEL_BACKGROUNDCOLOR],t.style[mxConstants.STYLE_LABEL_BORDERCOLOR],i.isWrapping(t.cell)&&i.isHtmlLabel(t.cell),i.isLabelClipped(t.cell),t.style[mxConstants.STYLE_OVERFLOW],t.style[mxConstants.STYLE_LABEL_PADDING],mxUtils.getValue(t.style,mxConstants.STYLE_TEXT_DIRECTION,mxConstants.DEFAULT_TEXT_DIRECTION)),t.text.opacity=mxUtils.getValue(t.style,mxConstants.STYLE_TEXT_OPACITY,100),t.text.dialect=n?mxConstants.DIALECT_STRICTHTML:t.view.graph.dialect,t.text.style=t.style,t.text.state=t,this.initializeLabel(t,t.text);var r=!1,s=function(l){var a=t;if(mxClient.IS_TOUCH||r){var o=mxEvent.getClientX(l),u=mxEvent.getClientY(l),p=mxUtils.convertPoint(i.container,o,u);a=i.view.getState(i.getCellAt(p.x,p.y))}return a};mxEvent.addGestureListeners(t.text.node,mxUtils.bind(this,function(l){this.isLabelEvent(t,l)&&(i.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(l,t)),r=i.dialect!=mxConstants.DIALECT_SVG&&mxEvent.getSource(l).nodeName=="IMG")}),mxUtils.bind(this,function(l){this.isLabelEvent(t,l)&&i.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(l,s(l)))}),mxUtils.bind(this,function(l){this.isLabelEvent(t,l)&&(i.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(l,s(l))),r=!1)})),i.nativeDblClickEnabled&&mxEvent.addListener(t.text.node,"dblclick",mxUtils.bind(this,function(l){this.isLabelEvent(t,l)&&(i.dblClick(l,t.cell),mxEvent.consume(l))}))}},mxCellRenderer.prototype.initializeLabel=function(t,e){mxClient.IS_SVG&&mxClient.NO_FO&&e.dialect!=mxConstants.DIALECT_SVG?e.init(t.view.graph.container):e.init(t.view.getDrawPane())},mxCellRenderer.prototype.createCellOverlays=function(t){var e=t.view.graph,i=e.getCellOverlays(t.cell),n=null;if(i!=null){n=new mxDictionary;for(var r=0;r0)?this.createLabel(t,n):t.text!=null&&(n==null||n.length==0)&&(t.text.destroy(),t.text=null),t.text!=null){e&&(t.text.lastValue!=null&&this.isTextShapeInvalid(t,t.text)&&(t.text.lastValue=null),t.text.resetStyles(),t.text.apply(t),t.text.valign=i.getVerticalAlign(t));var u=this.getLabelBounds(t),p=this.getTextScale(t);if(this.resolveColor(t,"color",mxConstants.STYLE_FONTCOLOR),e||t.text.value!=n||t.text.isWrapping!=r||t.text.overflow!=o||t.text.isClipping!=s||t.text.scale!=p||t.text.dialect!=a||t.text.bounds==null||!t.text.bounds.equals(u)){t.text.dialect=a,t.text.value=n,t.text.bounds=u,t.text.scale=p,t.text.wrap=r,t.text.clipped=s,t.text.overflow=o;var m=t.text.node.style.visibility;this.redrawLabelShape(t.text),t.text.node.style.visibility=m}}},mxCellRenderer.prototype.isTextShapeInvalid=function(t,e){function i(n,r,s){var l=!1;return r=="spacingTop"||r=="spacingRight"||r=="spacingBottom"||r=="spacingLeft"?l=parseFloat(e[n])-parseFloat(e.spacing)!=(t.style[r]||s):l=e[n]!=(t.style[r]||s),l}return i("fontStyle",mxConstants.STYLE_FONTSTYLE,mxConstants.DEFAULT_FONTSTYLE)||i("family",mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY)||i("size",mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE)||i("color",mxConstants.STYLE_FONTCOLOR,"black")||i("align",mxConstants.STYLE_ALIGN,"")||i("valign",mxConstants.STYLE_VERTICAL_ALIGN,"")||i("spacing",mxConstants.STYLE_SPACING,2)||i("spacingTop",mxConstants.STYLE_SPACING_TOP,0)||i("spacingRight",mxConstants.STYLE_SPACING_RIGHT,0)||i("spacingBottom",mxConstants.STYLE_SPACING_BOTTOM,0)||i("spacingLeft",mxConstants.STYLE_SPACING_LEFT,0)||i("horizontal",mxConstants.STYLE_HORIZONTAL,!0)||i("background",mxConstants.STYLE_LABEL_BACKGROUNDCOLOR)||i("border",mxConstants.STYLE_LABEL_BORDERCOLOR)||i("opacity",mxConstants.STYLE_TEXT_OPACITY,100)||i("textDirection",mxConstants.STYLE_TEXT_DIRECTION,mxConstants.DEFAULT_TEXT_DIRECTION)},mxCellRenderer.prototype.redrawLabelShape=function(t){t.redraw()},mxCellRenderer.prototype.getTextScale=function(t){return t.view.scale},mxCellRenderer.prototype.getLabelBounds=function(t){var e=t.view.graph,i=t.view.scale,n=e.getModel().isEdge(t.cell),r=new mxRectangle(t.absoluteOffset.x,t.absoluteOffset.y);if(n){var s=t.text.getSpacing();r.x+=s.x*i,r.y+=s.y*i;var l=e.getCellGeometry(t.cell);l!=null&&(r.width=Math.max(0,l.width*i),r.height=Math.max(0,l.height*i))}else{if(t.text.isPaintBoundsInverted()){var a=r.x;r.x=r.y,r.y=a}r.x+=t.x,r.y+=t.y,r.width=Math.max(1,t.width),r.height=Math.max(1,t.height)}if(t.text.isPaintBoundsInverted()){var o=(t.width-t.height)/2;r.x+=o,r.y-=o;var a=r.width;r.width=r.height,r.height=a}if(t.shape!=null){var u=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER),p=mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE);u==mxConstants.ALIGN_CENTER&&p==mxConstants.ALIGN_MIDDLE&&(r=t.shape.getLabelBounds(r))}var m=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_WIDTH,null);return m!=null&&(r.width=parseFloat(m)*i),n||this.rotateLabelBounds(t,r),r},mxCellRenderer.prototype.rotateLabelBounds=function(t,e){if(e.y-=t.text.margin.y*e.height,e.x-=t.text.margin.x*e.width,!this.legacySpacing||t.style[mxConstants.STYLE_OVERFLOW]!="fill"&&t.style[mxConstants.STYLE_OVERFLOW]!="width"){var i=t.view.scale,n=t.text.getSpacing();e.x+=n.x*i,e.y+=n.y*i;var r=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER),s=mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE),l=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_WIDTH,null);e.width=Math.max(0,e.width-(r==mxConstants.ALIGN_CENTER&&l==null?t.text.spacingLeft*i+t.text.spacingRight*i:0)),e.height=Math.max(0,e.height-(s==mxConstants.ALIGN_MIDDLE?t.text.spacingTop*i+t.text.spacingBottom*i:0))}var a=t.text.getTextRotation();if(a!=0&&t!=null&&t.view.graph.model.isVertex(t.cell)){var o=t.getCenterX(),u=t.getCenterY();if(e.x!=o||e.y!=u){var p=a*(Math.PI/180),m=mxUtils.getRotatedPoint(new mxPoint(e.x,e.y),Math.cos(p),Math.sin(p),new mxPoint(o,u));e.x=m.x,e.y=m.y}}},mxCellRenderer.prototype.redrawCellOverlays=function(t,e){if(this.createCellOverlays(t),t.overlays!=null){var i=mxUtils.mod(mxUtils.getValue(t.style,mxConstants.STYLE_ROTATION,0),90),n=mxUtils.toRadians(i),r=Math.cos(n),s=Math.sin(n);t.overlays.visit(function(l,a){var o=a.overlay.getBounds(t);if(!t.view.graph.getModel().isEdge(t.cell)&&t.shape!=null&&i!=0){var u=o.getCenterX(),p=o.getCenterY(),m=mxUtils.getRotatedPoint(new mxPoint(u,p),r,s,new mxPoint(t.getCenterX(),t.getCenterY()));u=m.x,p=m.y,o.x=Math.round(u-o.width/2),o.y=Math.round(p-o.height/2)}(e||a.bounds==null||a.scale!=t.view.scale||!a.bounds.equals(o))&&(a.bounds=o,a.scale=t.view.scale,a.redraw())})}},mxCellRenderer.prototype.redrawControl=function(t,e){var i=t.view.graph.getFoldingImage(t);if(t.control!=null&&i!=null){var n=this.getControlBounds(t,i.width,i.height),r=this.legacyControlPosition?mxUtils.getValue(t.style,mxConstants.STYLE_ROTATION,0):t.shape.getTextRotation(),s=t.view.scale;(e||t.control.scale!=s||!t.control.bounds.equals(n)||t.control.rotation!=r)&&(t.control.rotation=r,t.control.bounds=n,t.control.scale=s,t.control.redraw())}},mxCellRenderer.prototype.getControlBounds=function(t,e,i){if(t.control!=null){var n=t.view.scale,r=t.getCenterX(),s=t.getCenterY();if(!t.view.graph.getModel().isEdge(t.cell)&&(r=t.x+e*n,s=t.y+i*n,t.shape!=null)){var l=t.shape.getShapeRotation();if(this.legacyControlPosition)l=mxUtils.getValue(t.style,mxConstants.STYLE_ROTATION,0);else if(t.shape.isPaintBoundsInverted()){var a=(t.width-t.height)/2;r+=a,s-=a}if(l!=0){var o=mxUtils.toRadians(l),u=Math.cos(o),p=Math.sin(o),m=mxUtils.getRotatedPoint(new mxPoint(r,s),u,p,new mxPoint(t.getCenterX(),t.getCenterY()));r=m.x,s=m.y}}return t.view.graph.getModel().isEdge(t.cell)?new mxRectangle(Math.round(r-e/2*n),Math.round(s-i/2*n),Math.round(e*n),Math.round(i*n)):new mxRectangle(Math.round(r-e/2*n),Math.round(s-i/2*n),Math.round(e*n),Math.round(i*n))}return null},mxCellRenderer.prototype.insertStateAfter=function(t,e,i){for(var n=this.getShapesForState(t),r=0;r0)for(var o=0;o0?n[0]:null;u!=null&&(u=p.transformControlPoint(t,u),mxUtils.contains(e,u.x,u.y)&&(u=null));var d=0,x=0,f=0,g=0,c=mxUtils.getValue(t.style,mxConstants.STYLE_SEGMENT,m.gridSize)*p.scale,v=mxUtils.getValue(t.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_WEST);v==mxConstants.DIRECTION_NORTH||v==mxConstants.DIRECTION_SOUTH?(d=p.getRoutingCenterX(e),x=c):(f=p.getRoutingCenterY(e),g=c),u==null||u.xe.x+e.width?u!=null?(d=u.x,g=Math.max(Math.abs(f-u.y),g)):v==mxConstants.DIRECTION_NORTH?f=e.y-2*x:v==mxConstants.DIRECTION_SOUTH?f=e.y+e.height+2*x:v==mxConstants.DIRECTION_EAST?d=e.x-2*g:d=e.x+e.width+2*g:u!=null&&(d=p.getRoutingCenterX(e),x=Math.max(Math.abs(d-u.x),g),f=u.y,g=0),r.push(new mxPoint(d-x,f-g)),r.push(new mxPoint(d+x,f+g))}},ElbowConnector:function(t,e,i,n,r){var s=n!=null&&n.length>0?n[0]:null,l=!1,a=!1;if(e!=null&&i!=null)if(s!=null){var o=Math.min(e.x,i.x),u=Math.max(e.x+e.width,i.x+i.width),p=Math.min(e.y,i.y),m=Math.max(e.y+e.height,i.y+i.height);s=t.view.transformControlPoint(t,s),l=s.ym,a=s.xu}else{var o=Math.max(e.x,i.x),u=Math.min(e.x+e.width,i.x+i.width);if(l=o==u,!l){var p=Math.max(e.y,i.y),m=Math.min(e.y+e.height,i.y+i.height);a=p==m}}!a&&(l||t.style[mxConstants.STYLE_ELBOW]==mxConstants.ELBOW_VERTICAL)?mxEdgeStyle.TopToBottom(t,e,i,n,r):mxEdgeStyle.SideToSide(t,e,i,n,r)},SideToSide:function(t,e,i,n,r){var s=t.view,l=n!=null&&n.length>0?n[0]:null,a=t.absolutePoints,o=a[0],u=a[a.length-1];if(l!=null&&(l=s.transformControlPoint(t,l)),o!=null&&(e=new mxCellState,e.x=o.x,e.y=o.y),u!=null&&(i=new mxCellState,i.x=u.x,i.y=u.y),e!=null&&i!=null){var p=Math.max(e.x,i.x),m=Math.min(e.x+e.width,i.x+i.width),d=l!=null?l.x:Math.round(m+(p-m)/2),x=s.getRoutingCenterY(e),f=s.getRoutingCenterY(i);if(l!=null&&(l.y>=e.y&&l.y<=e.y+e.height&&(x=l.y),l.y>=i.y&&l.y<=i.y+i.height&&(f=l.y)),!mxUtils.contains(i,d,x)&&!mxUtils.contains(e,d,x)&&r.push(new mxPoint(d,x)),!mxUtils.contains(i,d,f)&&!mxUtils.contains(e,d,f)&&r.push(new mxPoint(d,f)),r.length==1)if(l!=null)!mxUtils.contains(i,d,l.y)&&!mxUtils.contains(e,d,l.y)&&r.push(new mxPoint(d,l.y));else{var g=Math.max(e.y,i.y),c=Math.min(e.y+e.height,i.y+i.height);r.push(new mxPoint(d,g+(c-g)/2))}}},TopToBottom:function(t,e,i,n,r){var s=t.view,l=n!=null&&n.length>0?n[0]:null,a=t.absolutePoints,o=a[0],u=a[a.length-1];if(l!=null&&(l=s.transformControlPoint(t,l)),o!=null&&(e=new mxCellState,e.x=o.x,e.y=o.y),u!=null&&(i=new mxCellState,i.x=u.x,i.y=u.y),e!=null&&i!=null){var p=Math.max(e.y,i.y),m=Math.min(e.y+e.height,i.y+i.height),d=s.getRoutingCenterX(e);l!=null&&l.x>=e.x&&l.x<=e.x+e.width&&(d=l.x);var x=l!=null?l.y:Math.round(m+(p-m)/2);if(!mxUtils.contains(i,d,x)&&!mxUtils.contains(e,d,x)&&r.push(new mxPoint(d,x)),l!=null&&l.x>=i.x&&l.x<=i.x+i.width?d=l.x:d=s.getRoutingCenterX(i),!mxUtils.contains(i,d,x)&&!mxUtils.contains(e,d,x)&&r.push(new mxPoint(d,x)),r.length==1)if(l!=null&&r.length==1)!mxUtils.contains(i,l.x,x)&&!mxUtils.contains(e,l.x,x)&&r.push(new mxPoint(l.x,x));else{var f=Math.max(e.x,i.x),g=Math.min(e.x+e.width,i.x+i.width);r.push(new mxPoint(f+(g-f)/2,x))}}},SegmentConnector:function(t,e,i,n,r){var s=mxEdgeStyle.scalePointArray(t.absolutePoints,t.view.scale),l=mxEdgeStyle.scaleCellState(e,t.view.scale),a=mxEdgeStyle.scaleCellState(i,t.view.scale),o=1,u=r.length>0?r[0]:null,p=!0,m=null;function d(R){return R.x=Math.round(R.x*t.view.scale*10)/10,R.y=Math.round(R.y*t.view.scale*10)/10,(u==null||Math.abs(u.x-R.x)>=o||Math.abs(u.y-R.y)>=Math.max(1,t.view.scale))&&(r.push(R),u=R),u}var x=s[0];x==null&&l!=null?x=new mxPoint(t.view.getRoutingCenterX(l),t.view.getRoutingCenterY(l)):x!=null&&(x=x.clone());var f=s.length-1;if(n!=null&&n.length>0){for(var g=[],c=0;c=T.y&&L.y<=T.y+T.height,P=T!=null&&L.x>=T.x&&L.x<=T.x+T.width;if(S=M||C==null&&I,E=A||C==null&&P,!(c==0&&(S&&E||A&&M))){if(C!=null&&!M&&!A&&(I||P)){p=!I;break}if(E||S){p=S,c==1&&(p=g.length%2==0?S:E);break}}T=a,C=s[f],C!=null&&(T=null),L=g[g.length-1],A&&M&&(g=g.slice(1))}p&&(s[0]!=null&&s[0].y!=m.y||s[0]==null&&l!=null&&(m.yl.y+l.height))?d(new mxPoint(x.x,m.y)):!p&&(s[0]!=null&&s[0].x!=m.x||s[0]==null&&l!=null&&(m.xl.x+l.width))&&d(new mxPoint(m.x,x.y)),p?x.y=m.y:x.x=m.x;for(var c=0;ca.y+a.height))?d(new mxPoint(x.x,m.y)):!p&&(s[f]!=null&&s[f].x!=m.x||s[f]==null&&a!=null&&(m.xa.x+a.width))&&d(new mxPoint(m.x,x.y))),s[0]==null&&l!=null)for(;r.length>1&&r[1]!=null&&mxUtils.contains(l,r[1].x,r[1].y);)r.splice(1,1);if(s[f]==null&&a!=null)for(;r.length>1&&r[r.length-1]!=null&&mxUtils.contains(a,r[r.length-1].x,r[r.length-1].y);)r.splice(r.length-1,1);y!=null&&r[r.length-1]!=null&&Math.abs(y.x-r[r.length-1].x)<=o&&Math.abs(y.y-r[r.length-1].y)<=o&&(r.splice(r.length-1,1),r[r.length-1]!=null&&(Math.abs(r[r.length-1].x-y.x)0||l||a){mxEdgeStyle.SegmentConnector(t,e,i,n,r);return}var M=[mxConstants.DIRECTION_MASK_ALL,mxConstants.DIRECTION_MASK_ALL],I=0;if(u!=null&&(M[0]=mxUtils.getPortConstraints(u,t,!0,mxConstants.DIRECTION_MASK_ALL),I=mxUtils.getValue(u.style,mxConstants.STYLE_ROTATION,0),I!=0)){var P=mxUtils.getBoundingBox(new mxRectangle(x,f,g,c),I);x=P.x,f=P.y,g=P.width,c=P.height}if(p!=null&&(M[1]=mxUtils.getPortConstraints(p,t,!1,mxConstants.DIRECTION_MASK_ALL),I=mxUtils.getValue(p.style,mxConstants.STYLE_ROTATION,0),I!=0)){var P=mxUtils.getBoundingBox(new mxRectangle(v,y,T,C),I);v=P.x,y=P.y,T=P.width,C=P.height}for(var R=[0,0],O=[[x,f,g,c],[v,y,T,C]],_=[S,E],b=0;b<2;b++)mxEdgeStyle.limits[b][1]=O[b][0]-_[b],mxEdgeStyle.limits[b][2]=O[b][1]-_[b],mxEdgeStyle.limits[b][4]=O[b][0]+O[b][2]+_[b],mxEdgeStyle.limits[b][8]=O[b][1]+O[b][3]+_[b];var k=O[0][0]+O[0][2]/2,G=O[0][1]+O[0][3]/2,B=O[1][0]+O[1][2]/2,j=O[1][1]+O[1][3]/2,H=k-B,W=G-j,X=0;H<0?W<0?X=2:X=1:W<=0&&(X=3,H==0&&(X=2));var V=null;u!=null&&(V=m);for(var Y=[[.5,.5],[.5,.5]],b=0;b<2;b++)V!=null&&(Y[b][0]=(V.x-O[b][0])/O[b][2],Math.abs(V.x-O[b][0])<=1?R[b]=mxConstants.DIRECTION_MASK_WEST:Math.abs(V.x-O[b][0]-O[b][2])<=1&&(R[b]=mxConstants.DIRECTION_MASK_EAST),Y[b][1]=(V.y-O[b][1])/O[b][3],Math.abs(V.y-O[b][1])<=1?R[b]=mxConstants.DIRECTION_MASK_NORTH:Math.abs(V.y-O[b][1]-O[b][3])<=1&&(R[b]=mxConstants.DIRECTION_MASK_SOUTH)),V=null,p!=null&&(V=d);var et=O[0][1]-(O[1][1]+O[1][3]),q=O[0][0]-(O[1][0]+O[1][2]),K=O[1][1]-(O[0][1]+O[0][3]),Z=O[1][0]-(O[0][0]+O[0][2]);mxEdgeStyle.vertexSeperations[1]=Math.max(q-L,0),mxEdgeStyle.vertexSeperations[2]=Math.max(et-L,0),mxEdgeStyle.vertexSeperations[4]=Math.max(K-L,0),mxEdgeStyle.vertexSeperations[3]=Math.max(Z-L,0);var N=[],D=[],F=[];D[0]=q>=Z?mxConstants.DIRECTION_MASK_WEST:mxConstants.DIRECTION_MASK_EAST,F[0]=et>=K?mxConstants.DIRECTION_MASK_NORTH:mxConstants.DIRECTION_MASK_SOUTH,D[1]=mxUtils.reversePortConstraints(D[0]),F[1]=mxUtils.reversePortConstraints(F[0]);for(var st=q>=Z?q:Z,J=et>=K?et:K,U=[[0,0],[0,0]],$=!1,b=0;b<2;b++)R[b]==0&&((D[b]&M[b])==0&&(D[b]=mxUtils.reversePortConstraints(D[b])),(F[b]&M[b])==0&&(F[b]=mxUtils.reversePortConstraints(F[b])),U[b][0]=F[b],U[b][1]=D[b]);J>0&&st>0&&((D[0]&M[0])>0&&(F[1]&M[1])>0?(U[0][0]=D[0],U[0][1]=F[0],U[1][0]=F[1],U[1][1]=D[1],$=!0):(F[0]&M[0])>0&&(D[1]&M[1])>0&&(U[0][0]=F[0],U[0][1]=D[0],U[1][0]=D[1],U[1][1]=F[1],$=!0)),J>0&&!$&&(U[0][0]=F[0],U[0][1]=D[0],U[1][0]=F[1],U[1][1]=D[1],$=!0),st>0&&!$&&(U[0][0]=D[0],U[0][1]=F[0],U[1][0]=D[1],U[1][1]=F[1],$=!0);for(var b=0;b<2;b++)R[b]==0&&((U[b][0]&M[b])==0&&(U[b][0]=U[b][1]),N[b]=U[b][0]&M[b],N[b]|=(U[b][1]&M[b])<<8,N[b]|=(U[1-b][b]&M[b])<<16,N[b]|=(U[1-b][1-b]&M[b])<<24,(N[b]&15)==0&&(N[b]=N[b]<<8),(N[b]&3840)==0&&(N[b]=N[b]&15|N[b]>>8),(N[b]&983040)==0&&(N[b]=N[b]&65535|(N[b]&251658240)>>8),R[b]=N[b]&15,(M[b]==mxConstants.DIRECTION_MASK_WEST||M[b]==mxConstants.DIRECTION_MASK_NORTH||M[b]==mxConstants.DIRECTION_MASK_EAST||M[b]==mxConstants.DIRECTION_MASK_SOUTH)&&(R[b]=M[b]));var rt=R[0]==mxConstants.DIRECTION_MASK_EAST?3:R[0],tt=R[1]==mxConstants.DIRECTION_MASK_EAST?3:R[1];rt-=X,tt-=X,rt<1&&(rt+=4),tt<1&&(tt+=4);var Q=mxEdgeStyle.routePatterns[rt-1][tt-1];switch(mxEdgeStyle.wayPoints1[0][0]=O[0][0],mxEdgeStyle.wayPoints1[0][1]=O[0][1],R[0]){case mxConstants.DIRECTION_MASK_WEST:mxEdgeStyle.wayPoints1[0][0]-=S,mxEdgeStyle.wayPoints1[0][1]+=Y[0][1]*O[0][3];break;case mxConstants.DIRECTION_MASK_SOUTH:mxEdgeStyle.wayPoints1[0][0]+=Y[0][0]*O[0][2],mxEdgeStyle.wayPoints1[0][1]+=O[0][3]+S;break;case mxConstants.DIRECTION_MASK_EAST:mxEdgeStyle.wayPoints1[0][0]+=O[0][2]+S,mxEdgeStyle.wayPoints1[0][1]+=Y[0][1]*O[0][3];break;case mxConstants.DIRECTION_MASK_NORTH:mxEdgeStyle.wayPoints1[0][0]+=Y[0][0]*O[0][2],mxEdgeStyle.wayPoints1[0][1]-=S;break}for(var z=0,ut=(R[0]&(mxConstants.DIRECTION_MASK_EAST|mxConstants.DIRECTION_MASK_WEST))>0?0:1,mt=ut,it=0,b=0;b4&&(lt-=4);var ht=mxEdgeStyle.dirVectors[lt-1];it=lt%2>0?0:1,it!=ut&&(z++,mxEdgeStyle.wayPoints1[z][0]=mxEdgeStyle.wayPoints1[z-1][0],mxEdgeStyle.wayPoints1[z][1]=mxEdgeStyle.wayPoints1[z-1][1]);var vt=(Q[b]&mxEdgeStyle.TARGET_MASK)>0,ft=(Q[b]&mxEdgeStyle.SOURCE_MASK)>0,at=(Q[b]&mxEdgeStyle.SIDE_MASK)>>5;at=at<15&&(at=at>>4);var dt=(Q[b]&mxEdgeStyle.CENTER_MASK)>0;if((ft||vt)&&at<9){var pt=0,ot=ft?0:1;if(dt&&it==0?pt=O[ot][0]+Y[ot][0]*O[ot][2]:dt?pt=O[ot][1]+Y[ot][1]*O[ot][3]:pt=mxEdgeStyle.limits[ot][at],it==0){var yt=mxEdgeStyle.wayPoints1[z][0],gt=(pt-yt)*ht[0];gt>0&&(mxEdgeStyle.wayPoints1[z][0]+=ht[0]*gt)}else{var Ct=mxEdgeStyle.wayPoints1[z][1],ct=(pt-Ct)*ht[1];ct>0&&(mxEdgeStyle.wayPoints1[z][1]+=ht[1]*ct)}}else dt&&(mxEdgeStyle.wayPoints1[z][0]+=ht[0]*Math.abs(mxEdgeStyle.vertexSeperations[lt]/2),mxEdgeStyle.wayPoints1[z][1]+=ht[1]*Math.abs(mxEdgeStyle.vertexSeperations[lt]/2));z>0&&mxEdgeStyle.wayPoints1[z][it]==mxEdgeStyle.wayPoints1[z-1][it]?z--:ut=it}for(var b=0;b<=z;b++){if(b==z){var Et=(R[1]&(mxConstants.DIRECTION_MASK_EAST|mxConstants.DIRECTION_MASK_WEST))>0?0:1,St=Et==mt?0:1;if(St!=(z+1)%2)break}r.push(new mxPoint(Math.round(mxEdgeStyle.wayPoints1[b][0]*t.view.scale*10)/10,Math.round(mxEdgeStyle.wayPoints1[b][1]*t.view.scale*10)/10))}for(var nt=1;nt0){for(var i=this.graph.getModel(),n=0;n0||l.height>0){r=new mxPoint(e.x,e.y);var a=!1,o=!1;this.graph.model.isVertex(t.cell)&&(a=mxUtils.getValue(t.style,mxConstants.STYLE_FLIPH,0)==1,o=mxUtils.getValue(t.style,mxConstants.STYLE_FLIPV,0)==1,t.shape!=null&&t.shape.stencil!=null&&(a=mxUtils.getValue(t.style,"stencilFlipH",0)==1||a,o=mxUtils.getValue(t.style,"stencilFlipV",0)==1||o),a&&(r.x=2*l.getCenterX()-r.x),o&&(r.y=2*l.getCenterY()-r.y)),r=s(l,t,r,i),r!=null&&(a&&(r.x=2*l.getCenterX()-r.x),o&&(r.y=2*l.getCenterY()-r.y))}}r==null&&(r=this.getPoint(t))}return r},mxGraphView.prototype.getRoutingCenterX=function(t){var e=t.style!=null&&parseFloat(t.style[mxConstants.STYLE_ROUTING_CENTER_X])||0;return t.getCenterX()+e*t.width},mxGraphView.prototype.getRoutingCenterY=function(t){var e=t.style!=null&&parseFloat(t.style[mxConstants.STYLE_ROUTING_CENTER_Y])||0;return t.getCenterY()+e*t.height},mxGraphView.prototype.getPerimeterBounds=function(t,e){return e=e??0,t!=null&&(e+=parseFloat(t.style[mxConstants.STYLE_PERIMETER_SPACING]||0)),t.getPerimeterBounds(e*this.scale)},mxGraphView.prototype.getPerimeterFunction=function(t){var e=t.style[mxConstants.STYLE_PERIMETER];if(typeof e=="string"){var i=mxStyleRegistry.getValue(e);i==null&&this.isAllowEval()&&(i=mxUtils.eval(e)),e=i}return typeof e=="function"?e:null},mxGraphView.prototype.getNextPoint=function(t,e,i){var n=t.absolutePoints,r=null;if(n!=null&&n.length>=2){var s=n.length;r=n[i?Math.min(1,s-1):Math.max(0,s-2)]}return r==null&&e!=null&&(r=new mxPoint(e.getCenterX(),e.getCenterY())),r},mxGraphView.prototype.getVisibleTerminal=function(t,e){for(var i=this.graph.getModel(),n=i.getTerminal(t,e),r=n;n!=null&&n!=this.currentRoot;)(!this.graph.isCellVisible(r)||this.isCellCollapsed(n))&&(r=n),n=i.getParent(n);return r!=null&&(!i.contains(r)||i.getParent(r)==i.getRoot()||r==this.currentRoot)&&(r=null),r},mxGraphView.prototype.updateEdgeBounds=function(t){var e=t.absolutePoints,i=e[0],n=e[e.length-1];if(i.x!=n.x||i.y!=n.y){var r=n.x-i.x,s=n.y-i.y;t.terminalDistance=Math.sqrt(r*r+s*s)}else t.terminalDistance=0;var l=0,a=[],o=i;if(o!=null){for(var u=o.x,p=o.y,m=u,d=p,x=1;x=Math.round(o+a)&&u1){for(var l=t.length,a=t.segments,o=t.absolutePoints[0],u=t.absolutePoints[1],p=mxUtils.ptSegDistSq(o.x,o.y,u.x,u.y,e,i),m=0,d=0,x=0,f=2;fc&&(P=c);var R=Math.sqrt(mxUtils.ptSegDistSq(o.x,o.y,u.x,u.y,e,i)),O=mxUtils.relativeCcw(o.x,o.y,u.x,u.y,e,i);return O==-1&&(R=-R),new mxPoint((l/2-x-P)/l*-2,R/this.scale)}}return new mxPoint},mxGraphView.prototype.updateEdgeLabelOffset=function(t){var e=t.absolutePoints;if(t.absoluteOffset.x=t.getCenterX(),t.absoluteOffset.y=t.getCenterY(),e!=null&&e.length>0&&t.segments!=null){var i=this.graph.getCellGeometry(t.cell);if(i.relative){var n=this.getPoint(t,i);n!=null&&(t.absoluteOffset=n)}else{var r=e[0],s=e[e.length-1];if(r!=null&&s!=null){var l=s.x-r.x,a=s.y-r.y,o=0,u=0,p=i.offset;p!=null&&(o=p.x,u=p.y);var m=r.x+l/2+o*this.scale,d=r.y+a/2+u*this.scale;t.absoluteOffset.x=m,t.absoluteOffset.y=d}}}},mxGraphView.prototype.getState=function(t,e){e=e||!1;var i=null;return t!=null&&(i=this.states.get(t),e&&(i==null||this.updateStyle)&&this.graph.isCellVisible(t)&&(i==null?(i=this.createState(t),this.states.put(t,i)):i.style=this.graph.getCellStyle(t))),i},mxGraphView.prototype.isRendering=function(){return this.rendering},mxGraphView.prototype.setRendering=function(t){this.rendering=t},mxGraphView.prototype.isAllowEval=function(){return this.allowEval},mxGraphView.prototype.setAllowEval=function(t){this.allowEval=t},mxGraphView.prototype.getStates=function(){return this.states},mxGraphView.prototype.setStates=function(t){this.states=t},mxGraphView.prototype.getCellStates=function(t){if(t==null)return this.states;for(var e=[],i=0;ir&&i.x>r+2&&i.x<=n)return!0;var s=this.graph.container.offsetHeight,l=this.graph.container.clientHeight;return s>l&&i.y>l+2&&i.y<=s},mxGraphView.prototype.init=function(){this.installListeners();var t=this.graph;t.dialect==mxConstants.DIALECT_SVG?this.createSvg():t.dialect==mxConstants.DIALECT_VML?this.createVml():this.createHtml()},mxGraphView.prototype.installListeners=function(){var t=this.graph,e=t.container;if(e!=null){mxClient.IS_TOUCH&&(mxEvent.addListener(e,"gesturestart",mxUtils.bind(this,function(r){t.fireGestureEvent(r),mxEvent.consume(r)})),mxEvent.addListener(e,"gesturechange",mxUtils.bind(this,function(r){t.fireGestureEvent(r),mxEvent.consume(r)})),mxEvent.addListener(e,"gestureend",mxUtils.bind(this,function(r){t.fireGestureEvent(r),mxEvent.consume(r)})));var i=null;mxEvent.addGestureListeners(e,mxUtils.bind(this,function(r){this.isContainerEvent(r)&&(!mxClient.IS_IE&&!mxClient.IS_IE11&&!mxClient.IS_GC&&!mxClient.IS_OP&&!mxClient.IS_SF||!this.isScrollEvent(r))&&(t.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(r)),i=r.pointerId)}),mxUtils.bind(this,function(r){this.isContainerEvent(r)&&(i==null||r.pointerId==i)&&t.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(r))}),mxUtils.bind(this,function(r){this.isContainerEvent(r)&&t.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(r)),i=null})),mxEvent.addListener(e,"dblclick",mxUtils.bind(this,function(r){this.isContainerEvent(r)&&t.dblClick(r)}));var n=function(r){var s=null;if(mxClient.IS_TOUCH){var l=mxEvent.getClientX(r),a=mxEvent.getClientY(r),o=mxUtils.convertPoint(e,l,a);s=t.view.getState(t.getCellAt(o.x,o.y))}return s};t.addMouseListener({mouseDown:function(r,s){t.popupMenuHandler.hideMenu()},mouseMove:function(){},mouseUp:function(){}}),this.moveHandler=mxUtils.bind(this,function(r){t.tooltipHandler!=null&&t.tooltipHandler.isHideOnHover()&&t.tooltipHandler.hide(),this.captureDocumentGesture&&t.isMouseDown&&t.container!=null&&!this.isContainerEvent(r)&&t.container.style.display!="none"&&t.container.style.visibility!="hidden"&&!mxEvent.isConsumed(r)&&t.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(r,n(r)))}),this.endHandler=mxUtils.bind(this,function(r){this.captureDocumentGesture&&t.isMouseDown&&t.container!=null&&!this.isContainerEvent(r)&&t.container.style.display!="none"&&t.container.style.visibility!="hidden"&&t.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(r))}),mxEvent.addGestureListeners(document,null,this.moveHandler,this.endHandler)}},mxGraphView.prototype.createHtml=function(){var t=this.graph.container;if(t!=null&&(this.canvas=this.createHtmlPane("100%","100%"),this.canvas.style.overflow="hidden",this.backgroundPane=this.createHtmlPane("1px","1px"),this.drawPane=this.createHtmlPane("1px","1px"),this.overlayPane=this.createHtmlPane("1px","1px"),this.decoratorPane=this.createHtmlPane("1px","1px"),this.canvas.appendChild(this.backgroundPane),this.canvas.appendChild(this.drawPane),this.canvas.appendChild(this.overlayPane),this.canvas.appendChild(this.decoratorPane),t.appendChild(this.canvas),this.updateContainerStyle(t),mxClient.IS_QUIRKS)){var e=mxUtils.bind(this,function(i){var n=this.getGraphBounds(),r=n.x+n.width+this.graph.border,s=n.y+n.height+this.graph.border;this.updateHtmlCanvasSize(r,s)});mxEvent.addListener(window,"resize",e)}},mxGraphView.prototype.updateHtmlCanvasSize=function(t,e){if(this.graph.container!=null){var i=this.graph.container.offsetWidth,n=this.graph.container.offsetHeight;i")},mxGraph.prototype.createHandlers=function(){this.tooltipHandler=this.createTooltipHandler(),this.tooltipHandler.setEnabled(!1),this.selectionCellsHandler=this.createSelectionCellsHandler(),this.connectionHandler=this.createConnectionHandler(),this.connectionHandler.setEnabled(!1),this.graphHandler=this.createGraphHandler(),this.panningHandler=this.createPanningHandler(),this.panningHandler.panningEnabled=!1,this.popupMenuHandler=this.createPopupMenuHandler()},mxGraph.prototype.createTooltipHandler=function(){return new mxTooltipHandler(this)},mxGraph.prototype.createSelectionCellsHandler=function(){return new mxSelectionCellsHandler(this)},mxGraph.prototype.createConnectionHandler=function(){return new mxConnectionHandler(this)},mxGraph.prototype.createGraphHandler=function(){return new mxGraphHandler(this)},mxGraph.prototype.createPanningHandler=function(){return new mxPanningHandler(this)},mxGraph.prototype.createPopupMenuHandler=function(){return new mxPopupMenuHandler(this)},mxGraph.prototype.createSelectionModel=function(){return new mxGraphSelectionModel(this)},mxGraph.prototype.createStylesheet=function(){return new mxStylesheet},mxGraph.prototype.createGraphView=function(){return new mxGraphView(this)},mxGraph.prototype.createCellRenderer=function(){return new mxCellRenderer},mxGraph.prototype.createCellEditor=function(){return new mxCellEditor(this)},mxGraph.prototype.getModel=function(){return this.model},mxGraph.prototype.getView=function(){return this.view},mxGraph.prototype.getStylesheet=function(){return this.stylesheet},mxGraph.prototype.setStylesheet=function(t){this.stylesheet=t},mxGraph.prototype.getSelectionModel=function(){return this.selectionModel},mxGraph.prototype.setSelectionModel=function(t){this.selectionModel=t},mxGraph.prototype.getSelectionCellsForChanges=function(t,e){for(var i=new mxDictionary,n=[],r=mxUtils.bind(this,function(o){if(!i.get(o)&&this.model.contains(o))if(this.model.isEdge(o)||this.model.isVertex(o))i.put(o,!0),n.push(o);else for(var u=this.model.getChildCount(o),p=0;p=0){t.overlays.splice(i,1),t.overlays.length==0&&(t.overlays=null);var n=this.view.getState(t);n!=null&&this.cellRenderer.redraw(n),this.fireEvent(new mxEventObject(mxEvent.REMOVE_OVERLAY,"cell",t,"overlay",e))}else e=null}return e},mxGraph.prototype.removeCellOverlays=function(t){var e=t.overlays;if(e!=null){t.overlays=null;var i=this.view.getState(t);i!=null&&this.cellRenderer.redraw(i);for(var n=0;n0){i=i??this.warningImage;var r=new mxCellOverlay(i,""+e+"");return n&&r.addListener(mxEvent.CLICK,mxUtils.bind(this,function(s,l){this.isEnabled()&&this.setSelectionCell(t)})),this.addCellOverlay(t,r)}else this.removeCellOverlays(t);return null},mxGraph.prototype.startEditing=function(t){this.startEditingAtCell(null,t)},mxGraph.prototype.startEditingAtCell=function(t,e){(e==null||!mxEvent.isMultiTouchEvent(e))&&(t==null&&(t=this.getSelectionCell(),t!=null&&!this.isCellEditable(t)&&(t=null)),t!=null&&(this.fireEvent(new mxEventObject(mxEvent.START_EDITING,"cell",t,"event",e)),this.cellEditor.startEditing(t,e),this.fireEvent(new mxEventObject(mxEvent.EDITING_STARTED,"cell",t,"event",e))))},mxGraph.prototype.getEditingValue=function(t,e){return this.convertValueToString(t)},mxGraph.prototype.stopEditing=function(t){this.cellEditor.stopEditing(t),this.fireEvent(new mxEventObject(mxEvent.EDITING_STOPPED,"cancel",t))},mxGraph.prototype.labelChanged=function(t,e,i){this.model.beginUpdate();try{var n=t.value;this.cellLabelChanged(t,e,this.isAutoSizeCell(t)),this.fireEvent(new mxEventObject(mxEvent.LABEL_CHANGED,"cell",t,"value",e,"old",n,"event",i))}finally{this.model.endUpdate()}return t},mxGraph.prototype.cellLabelChanged=function(t,e,i){this.model.beginUpdate();try{this.model.setValue(t,e),i&&this.cellSizeUpdated(t,!1)}finally{this.model.endUpdate()}},mxGraph.prototype.escape=function(t){this.fireEvent(new mxEventObject(mxEvent.ESCAPE,"event",t))},mxGraph.prototype.click=function(t){var e=t.getEvent(),i=t.getCell(),n=new mxEventObject(mxEvent.CLICK,"event",e,"cell",i);if(t.isConsumed()&&n.consume(),this.fireEvent(n),this.isEnabled()&&!mxEvent.isConsumed(e)&&!n.isConsumed()){if(i!=null){if(this.isTransparentClickEvent(e)){var r=!1,s=this.getCellAt(t.graphX,t.graphY,null,null,null,mxUtils.bind(this,function(p){var m=this.isCellSelected(p.cell);return r=r||m,!r||m||p.cell!=i&&this.model.isAncestor(p.cell,i)}));s!=null&&(i=s)}}else if(this.isSwimlaneSelectionEnabled()&&(i=this.getSwimlaneAt(t.getGraphX(),t.getGraphY()),i!=null&&(!this.isToggleEvent(e)||!mxEvent.isAltDown(e)))){for(var l=i,a=[];l!=null;){l=this.model.getParent(l);var o=this.view.getState(l);this.isSwimlane(l)&&o!=null&&a.push(l)}if(a.length>0){a=a.reverse(),a.splice(0,0,i),a.push(i);for(var u=0;u=r.scrollLeft&&e>=r.scrollTop&&t<=r.scrollLeft+r.clientWidth&&e<=r.scrollTop+r.clientHeight){var s=r.scrollLeft+r.clientWidth-t;if(s0&&p.height>0){e&&p.x!=null&&p.y!=null&&(p=p.clone(),p.width+=p.x,p.height+=p.y,p.x=0,p.y=0);var m=this.view.scale,d=p.width/m,x=p.height/m;this.backgroundImage!=null&&(d=Math.max(d,this.backgroundImage.width-p.x/m),x=Math.max(x,this.backgroundImage.height-p.y/m));var f=(e?t:2*t)+i+1;o-=f,u-=f;var g=r?u/x:s?o/d:Math.min(o/d,u/x);if(this.minFitScale!=null&&(g=Math.max(g,this.minFitScale)),this.maxFitScale!=null&&(g=Math.min(g,this.maxFitScale)),n)if(e)this.view.scale!=g&&this.view.setScale(g);else if(mxUtils.hasScrollbars(this.container)){this.view.setScale(g);var y=this.getGraphBounds();y.x!=null&&(this.container.scrollLeft=y.x),y.y!=null&&(this.container.scrollTop=y.y)}else{var c=p.x!=null?Math.floor(this.view.translate.x-p.x/m+t/g+i/2):t,v=p.y!=null?Math.floor(this.view.translate.y-p.y/m+t/g+i/2):t;this.view.scaleAndTranslate(g,c,v)}else return g}}return this.view.scale},mxGraph.prototype.sizeDidChange=function(){var t=this.getGraphBounds();if(this.container!=null){var e=this.getBorder(),i=Math.max(0,t.x)+t.width+2*e,n=Math.max(0,t.y)+t.height+2*e;if(this.minimumContainerSize!=null&&(i=Math.max(i,this.minimumContainerSize.width),n=Math.max(n,this.minimumContainerSize.height)),this.resizeContainer&&this.doResizeContainer(i,n),this.preferPageSize||!mxClient.IS_IE&&this.pageVisible){var r=this.getPreferredPageSize(t,Math.max(1,i),Math.max(1,n));r!=null&&(i=r.width*this.view.scale,n=r.height*this.view.scale)}if(this.minimumGraphSize!=null&&(i=Math.max(i,this.minimumGraphSize.width*this.view.scale),n=Math.max(n,this.minimumGraphSize.height*this.view.scale)),i=Math.ceil(i),n=Math.ceil(n),this.dialect==mxConstants.DIALECT_SVG){var s=this.view.getDrawPane().ownerSVGElement;s!=null&&(s.style.minWidth=Math.max(1,i)+"px",s.style.minHeight=Math.max(1,n)+"px",s.style.width="100%",s.style.height="100%")}else mxClient.IS_QUIRKS?this.view.updateHtmlCanvasSize(Math.max(1,i),Math.max(1,n)):(this.view.canvas.style.minWidth=Math.max(1,i)+"px",this.view.canvas.style.minHeight=Math.max(1,n)+"px");this.updatePageBreaks(this.pageBreaksVisible,i,n)}this.fireEvent(new mxEventObject(mxEvent.SIZE,"bounds",t))},mxGraph.prototype.doResizeContainer=function(t,e){this.maximumContainerSize!=null&&(t=Math.min(this.maximumContainerSize.width,t),e=Math.min(this.maximumContainerSize.height,e)),this.container.style.width=Math.ceil(t)+"px",this.container.style.height=Math.ceil(e)+"px"},mxGraph.prototype.updatePageBreaks=function(t,e,i){var n=this.view.scale,r=this.view.translate,s=this.pageFormat,l=n*this.pageScale,a=new mxRectangle(0,0,s.width*l,s.height*l),o=mxRectangle.fromRectangle(this.getGraphBounds());o.width=Math.max(1,o.width),o.height=Math.max(1,o.height),a.x=Math.floor((o.x-r.x*n)/a.width)*a.width+r.x*n,a.y=Math.floor((o.y-r.y*n)/a.height)*a.height+r.y*n,o.width=Math.ceil((o.width+(o.x-a.x))/a.width)*a.width,o.height=Math.ceil((o.height+(o.y-a.y))/a.height)*a.height,t=t&&Math.min(a.width,a.height)>this.minPageBreakDist;var u=t?Math.ceil(o.height/a.height)+1:0,p=t?Math.ceil(o.width/a.width)+1:0,m=(p-1)*a.width,d=(u-1)*a.height;this.horizontalPageBreaks==null&&u>0&&(this.horizontalPageBreaks=[]),this.verticalPageBreaks==null&&p>0&&(this.verticalPageBreaks=[]);var x=mxUtils.bind(this,function(f){if(f!=null){for(var g=f==this.horizontalPageBreaks?u:p,c=0;c<=g;c++){var v=f==this.horizontalPageBreaks?[new mxPoint(Math.round(a.x),Math.round(a.y+c*a.height)),new mxPoint(Math.round(a.x+m),Math.round(a.y+c*a.height))]:[new mxPoint(Math.round(a.x+c*a.width),Math.round(a.y)),new mxPoint(Math.round(a.x+c*a.width),Math.round(a.y+d))];if(f[c]!=null)f[c].points=v,f[c].redraw();else{var y=new mxPolyline(v,this.pageBreakColor);y.dialect=this.dialect,y.pointerEvents=!1,y.isDashed=this.pageBreakDashed,y.init(this.view.backgroundPane),y.redraw(),f[c]=y}}for(var c=g;c0&&i.substring(n-7,n+1)!=";base64,"&&(i=i.substring(0,n)+";base64,"+i.substring(n+1))}t[mxConstants.STYLE_IMAGE]=i}}return t},mxGraph.prototype.setCellStyle=function(t,e){if(e=e||this.getSelectionCells(),e!=null){this.model.beginUpdate();try{for(var i=0;i0){var r=this.getCurrentCellStyle(i[0]);n=mxUtils.getValue(r,t,e)?0:1,this.setCellStyles(t,n,i)}return n},mxGraph.prototype.setCellStyles=function(t,e,i){i=i||this.getSelectionCells(),mxUtils.setCellStyles(this.model,i,t,e)},mxGraph.prototype.toggleCellStyleFlags=function(t,e,i){this.setCellStyleFlags(t,e,null,i)},mxGraph.prototype.setCellStyleFlags=function(t,e,i,n){if(n=n||this.getSelectionCells(),n!=null&&n.length>0){if(i==null){var r=this.getCurrentCellStyle(n[0]),s=parseInt(r[t]||0);i=(s&e)!=e}mxUtils.setCellStyleFlags(this.model,n,t,e,i)}},mxGraph.prototype.alignCells=function(t,e,i){if(e==null&&(e=this.getSelectionCells()),e!=null&&e.length>1){if(i==null)for(var n=0;n1&&n!=null){var r=this.model.getParent(t);r==null&&(r=this.model.getParent(i[0])),this.model.beginUpdate();try{this.getCellGeometry(t)==null&&this.model.setGeometry(t,new mxGeometry);var s=this.model.getChildCount(r);this.cellsAdded([t],r,s,null,null,!1,!1,!1),s=this.model.getChildCount(t),this.cellsAdded(i,t,s,null,null,!1,!1,!1),this.cellsMoved(i,-n.x,-n.y,!1,!1,!1),this.cellsResized([t],[n],!1),this.fireEvent(new mxEventObject(mxEvent.GROUP_CELLS,"group",t,"border",e,"cells",i))}finally{this.model.endUpdate()}}return t},mxGraph.prototype.getCellsForGroup=function(t){var e=[];if(t!=null&&t.length>0){var i=this.model.getParent(t[0]);e.push(t[0]);for(var n=1;n0){this.model.beginUpdate();try{for(var i=0;i0){n=n.slice();var r=this.model.getParent(t[i]),s=this.model.getChildCount(r);this.cellsAdded(n,r,s,null,null,!0),e=e.concat(n);for(var l=0;l0&&e.push(t[i]);return e},mxGraph.prototype.removeCellsAfterUngroup=function(t){this.cellsRemoved(this.addAllEdges(t))},mxGraph.prototype.removeCellsFromParent=function(t){t==null&&(t=this.getSelectionCells()),this.model.beginUpdate();try{var e=this.getDefaultParent(),i=this.model.getChildCount(e);this.cellsAdded(t,e,i,null,null,!0),this.fireEvent(new mxEventObject(mxEvent.REMOVE_CELLS_FROM_PARENT,"cells",t))}finally{this.model.endUpdate()}return t},mxGraph.prototype.updateGroupBounds=function(t,e,i,n,r,s,l){t==null&&(t=this.getSelectionCells()),e=e??0,i=i??!1,n=n??0,r=r??0,s=s??0,l=l??0,this.model.beginUpdate();try{for(var a=t.length-1;a>=0;a--){var o=this.getCellGeometry(t[a]);if(o!=null){var u=this.getChildCells(t[a]);if(u!=null&&u.length>0){var p=this.getBoundingBoxFromGeometry(u,!0);if(p!=null&&p.width>0&&p.height>0){var m=this.isSwimlane(t[a])?this.getActualStartSize(t[a],!0):new mxRectangle;o=o.clone(),i&&(o.x=Math.round(o.x+p.x-e-m.x-l),o.y=Math.round(o.y+p.y-e-m.y-n)),o.width=Math.round(p.width+2*e+m.x+l+r+m.width),o.height=Math.round(p.height+2*e+m.y+n+s+m.height),this.model.setGeometry(t[a],o),this.moveCells(u,e+m.x-p.x+l,e+m.y-p.y+n)}}}}}finally{this.model.endUpdate()}return t},mxGraph.prototype.getBoundingBox=function(t){var e=null;if(t!=null&&t.length>0){for(var i=0;i0){var o=this.view.scale,u=this.view.translate;r=this.model.cloneCells(t,!0,i);for(var a=0;athis.model.getChildCount(e)&&i--,this.model.add(e,t[m],i+m),this.autoSizeCellsOnAdd&&this.autoSizeCell(t[m],!0),(a==null||a)&&this.isExtendParentsOnAdd(t[m])&&this.isExtendParent(t[m])&&this.extendParent(t[m]),(l==null||l)&&this.constrainChild(t[m]),n!=null&&this.cellConnected(t[m],n,!0),r!=null&&this.cellConnected(t[m],r,!1)}this.fireEvent(new mxEventObject(mxEvent.CELLS_ADDED,"cells",t,"parent",e,"index",i,"source",n,"target",r,"absolute",s))}finally{this.model.endUpdate()}}},mxGraph.prototype.autoSizeCell=function(t,e){if(e=e??!0,e)for(var i=this.model.getChildCount(t),n=0;n0){var e=this.view.scale,i=this.view.translate;this.model.beginUpdate();try{for(var n=new mxDictionary,r=0;r0){this.model.beginUpdate();try{for(var i=0;i0){this.model.beginUpdate();try{for(var r=0;r0&&(r.height=Math.max(r.height,l))}}e.alternateBounds=new mxRectangle(0,0,r.width,r.height)}if(e.alternateBounds!=null){e.alternateBounds.x=e.x,e.alternateBounds.y=e.y;var a=mxUtils.toRadians(n[mxConstants.STYLE_ROTATION]||0);if(a!=0){var o=e.alternateBounds.getCenterX()-e.getCenterX(),u=e.alternateBounds.getCenterY()-e.getCenterY(),p=Math.cos(a),m=Math.sin(a),d=p*o-m*u,x=m*o+p*u;e.alternateBounds.x+=d-o,e.alternateBounds.y+=x-u}}}},mxGraph.prototype.addAllEdges=function(t){var e=t.slice();return mxUtils.removeDuplicates(e.concat(this.getAllEdges(t)))},mxGraph.prototype.getAllEdges=function(t){var e=[];if(t!=null)for(var i=0;i0){this.isHtmlLabel(n.cell)||(u=mxUtils.htmlEntities(u,!1)),u=u.replace(/\n/g,"
");var p=mxUtils.getSizeForString(u,s,r[mxConstants.STYLE_FONTFAMILY],e,r[mxConstants.STYLE_FONTSTYLE]),m=p.width+l,d=p.height+a;if(!mxUtils.getValue(r,mxConstants.STYLE_HORIZONTAL,!0)){var x=d;d=m,m=x}this.gridEnabled&&(m=this.snap(m+this.gridSize/2),d=this.snap(d+this.gridSize/2)),i=new mxRectangle(0,0,m,d)}else{var f=4*this.gridSize;i=new mxRectangle(0,0,f,f)}}}return i},mxGraph.prototype.resizeCell=function(t,e,i){return this.resizeCells([t],[e],i)[0]},mxGraph.prototype.resizeCells=function(t,e,i){i=i??this.isRecursiveResize(),this.model.beginUpdate();try{var n=this.cellsResized(t,e,i);this.fireEvent(new mxEventObject(mxEvent.RESIZE_CELLS,"cells",t,"bounds",e,"previous",n))}finally{this.model.endUpdate()}return t},mxGraph.prototype.cellsResized=function(t,e,i){i=i??!1;var n=[];if(t!=null&&e!=null&&t.length==e.length){this.model.beginUpdate();try{for(var r=0;r0&&(l=mxRectangle.fromRectangle(l),l.x-=l.width*a,l.y-=l.height*a,l.width+=2*l.width*a,l.height+=2*l.height*a),r==null?r=l:(r=mxRectangle.fromRectangle(r),r.intersect(l))}}if(r!=null){var o=[t];if(!this.isCellCollapsed(t))for(var u=this.model.getDescendants(t),p=0;pr.width&&(d=i.width-r.width,i.width-=d),m.x+m.width>r.x+r.width&&(d-=m.x+m.width-r.x-r.width-d);var x=0;i.height>r.height&&(x=i.height-r.height,i.height-=x),m.y+m.height>r.y+r.height&&(x-=m.y+m.height-r.y-r.height-x),m.x0&&(e=e.clone(),e.points=[],this.model.setGeometry(t,e)),t},mxGraph.prototype.getOutlineConstraint=function(t,e,i){if(e.shape!=null){var n=this.view.getPerimeterBounds(e),r=e.style[mxConstants.STYLE_DIRECTION];if(r==mxConstants.DIRECTION_NORTH||r==mxConstants.DIRECTION_SOUTH){n.x+=n.width/2-n.height/2,n.y+=n.height/2-n.width/2;var s=n.width;n.width=n.height,n.height=s}var l=mxUtils.toRadians(e.shape.getShapeRotation());if(l!=0){var a=Math.cos(-l),o=Math.sin(-l),u=new mxPoint(n.getCenterX(),n.getCenterY());t=mxUtils.getRotatedPoint(t,a,o,u)}var p=1,m=1,d=0,x=0;if(this.getModel().isVertex(e.cell)){var f=e.style[mxConstants.STYLE_FLIPH],g=e.style[mxConstants.STYLE_FLIPV];if(e.shape!=null&&e.shape.stencil!=null&&(f=mxUtils.getValue(e.style,"stencilFlipH",0)==1||f,g=mxUtils.getValue(e.style,"stencilFlipV",0)==1||g),r==mxConstants.DIRECTION_NORTH||r==mxConstants.DIRECTION_SOUTH){var s=f;f=g,g=s}f&&(p=-1,d=-n.width),g&&(m=-1,x=-n.height)}t=new mxPoint((t.x-n.x)*p-d+n.x,(t.y-n.y)*m-x+n.y);var c=n.width==0?0:Math.round((t.x-n.x)*1e3/n.width)/1e3,v=n.height==0?0:Math.round((t.y-n.y)*1e3/n.height)/1e3;return new mxConnectionConstraint(new mxPoint(c,v),!1)}return null},mxGraph.prototype.getAllConnectionConstraints=function(t,e){return t!=null&&t.shape!=null&&t.shape.stencil!=null?t.shape.stencil.constraints:null},mxGraph.prototype.getConnectionConstraint=function(t,e,i){var n=null,r=t.style[i?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X];if(r!=null){var s=t.style[i?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y];s!=null&&(n=new mxPoint(parseFloat(r),parseFloat(s)))}var l=!1,a=0,o=0;return n!=null&&(l=mxUtils.getValue(t.style,i?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,!0),a=parseFloat(t.style[i?mxConstants.STYLE_EXIT_DX:mxConstants.STYLE_ENTRY_DX]),o=parseFloat(t.style[i?mxConstants.STYLE_EXIT_DY:mxConstants.STYLE_ENTRY_DY]),a=isFinite(a)?a:0,o=isFinite(o)?o:0),new mxConnectionConstraint(n,l,null,a,o)},mxGraph.prototype.setConnectionConstraint=function(t,e,i,n){if(n!=null){this.model.beginUpdate();try{n==null||n.point==null?(this.setCellStyles(i?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X,null,[t]),this.setCellStyles(i?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y,null,[t]),this.setCellStyles(i?mxConstants.STYLE_EXIT_DX:mxConstants.STYLE_ENTRY_DX,null,[t]),this.setCellStyles(i?mxConstants.STYLE_EXIT_DY:mxConstants.STYLE_ENTRY_DY,null,[t]),this.setCellStyles(i?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,null,[t])):n.point!=null&&(this.setCellStyles(i?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X,n.point.x,[t]),this.setCellStyles(i?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y,n.point.y,[t]),this.setCellStyles(i?mxConstants.STYLE_EXIT_DX:mxConstants.STYLE_ENTRY_DX,n.dx,[t]),this.setCellStyles(i?mxConstants.STYLE_EXIT_DY:mxConstants.STYLE_ENTRY_DY,n.dy,[t]),n.perimeter?this.setCellStyles(i?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,null,[t]):this.setCellStyles(i?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,"0",[t]))}finally{this.model.endUpdate()}}},mxGraph.prototype.getConnectionPoint=function(t,e,i){i=i??!0;var n=null;if(t!=null&&e.point!=null){var r=this.view.getPerimeterBounds(t),s=new mxPoint(r.getCenterX(),r.getCenterY()),l=t.style[mxConstants.STYLE_DIRECTION],a=0;l!=null&&mxUtils.getValue(t.style,mxConstants.STYLE_ANCHOR_POINT_DIRECTION,1)==1&&(l==mxConstants.DIRECTION_NORTH?a+=270:l==mxConstants.DIRECTION_WEST?a+=180:l==mxConstants.DIRECTION_SOUTH&&(a+=90),(l==mxConstants.DIRECTION_NORTH||l==mxConstants.DIRECTION_SOUTH)&&r.rotate90());var o=this.view.scale;n=new mxPoint(r.x+e.point.x*r.width+e.dx*o,r.y+e.point.y*r.height+e.dy*o);var u=t.style[mxConstants.STYLE_ROTATION]||0;if(e.perimeter){if(a!=0){var p=0,m=0;a==90?m=1:a==180?p=-1:a==270&&(m=-1),n=mxUtils.getRotatedPoint(n,p,m,s)}n=this.view.getPerimeterPoint(t,n,!1)}else if(u+=a,this.getModel().isVertex(t.cell)){var d=t.style[mxConstants.STYLE_FLIPH]==1,x=t.style[mxConstants.STYLE_FLIPV]==1;if(t.shape!=null&&t.shape.stencil!=null&&(d=mxUtils.getValue(t.style,"stencilFlipH",0)==1||d,x=mxUtils.getValue(t.style,"stencilFlipV",0)==1||x),l==mxConstants.DIRECTION_NORTH||l==mxConstants.DIRECTION_SOUTH){var f=d;d=x,x=f}d&&(n.x=2*r.getCenterX()-n.x),x&&(n.y=2*r.getCenterY()-n.y)}if(u!=0&&n!=null){var g=mxUtils.toRadians(u),p=Math.cos(g),m=Math.sin(g);n=mxUtils.getRotatedPoint(n,p,m,s)}}return i&&n!=null&&(n.x=Math.round(n.x),n.y=Math.round(n.y)),n},mxGraph.prototype.connectCell=function(t,e,i,n){this.model.beginUpdate();try{var r=this.model.getTerminal(t,i);this.cellConnected(t,e,i,n),this.fireEvent(new mxEventObject(mxEvent.CONNECT_CELL,"edge",t,"terminal",e,"source",i,"previous",r))}finally{this.model.endUpdate()}return t},mxGraph.prototype.cellConnected=function(t,e,i,n){if(t!=null){this.model.beginUpdate();try{var r=this.model.getTerminal(t,i);if(this.setConnectionConstraint(t,e,i,n),this.isPortsEnabled()){var s=null;this.isPort(e)&&(s=e.getId(),e=this.getTerminalForPort(e,i));var l=i?mxConstants.STYLE_SOURCE_PORT:mxConstants.STYLE_TARGET_PORT;this.setCellStyles(l,s,[t])}this.model.setTerminal(t,e,i),this.resetEdgesOnConnect&&this.resetEdge(t),this.fireEvent(new mxEventObject(mxEvent.CELL_CONNECTED,"edge",t,"terminal",e,"source",i,"previous",r))}finally{this.model.endUpdate()}}},mxGraph.prototype.disconnectGraph=function(t){if(t!=null){this.model.beginUpdate();try{for(var e=this.view.scale,i=this.view.translate,n=new mxDictionary,r=0;r0)for(var o=new mxRectangle(a[0].x,a[0].y,0,0),u=1;u=0&&(s.x+=o.x,s.y+=o.y))}}else if(s=mxRectangle.fromRectangle(r),this.model.isVertex(p)&&mxUtils.indexOf(t,p)>=0){var o=this.getBoundingBoxFromGeometry([p],!1);o!=null&&(s.x+=o.x,s.y+=o.y)}s!=null&&r.offset!=null&&(s.x+=r.offset.x,s.y+=r.offset.y);var m=this.getCurrentCellStyle(t[n]);if(s!=null){var d=mxUtils.getValue(m,mxConstants.STYLE_ROTATION,0);d!=0&&(s=mxUtils.getBoundingBox(s,d))}}s!=null&&(i==null?i=mxRectangle.fromRectangle(s):i.add(s))}}}return i},mxGraph.prototype.refresh=function(t){this.view.clear(t,t==null),this.view.validate(),this.sizeDidChange(),this.fireEvent(new mxEventObject(mxEvent.REFRESH))},mxGraph.prototype.snap=function(t){return this.gridEnabled&&(t=Math.round(t/this.gridSize)*this.gridSize),t},mxGraph.prototype.snapDelta=function(t,e,i,n,r){var s=this.view.translate,l=this.view.scale;if(!i&&this.gridEnabled){var a=this.gridSize*l*.5;if(!n){var o=e.x-(this.snap(e.x/l-s.x)+s.x)*l;Math.abs(t.x-o)l&&(m=0),f>a&&(d=0),this.view.setTranslate(Math.floor(m/2-o.x),Math.floor(d/2-o.y)),this.container.scrollLeft=(x-l)/2,this.container.scrollTop=(f-a)/2}},mxGraph.prototype.zoom=function(t,e){e=e??this.centerZoom;var i=Math.round(this.view.scale*t*100)/100,n=this.view.getState(this.getSelectionCell());if(t=i/this.view.scale,this.keepSelectionVisibleOnZoom&&n!=null){var r=new mxRectangle(n.x*t,n.y*t,n.width*t,n.height*t);this.view.scale=i,this.scrollRectToVisible(r)||(this.view.revalidate(),this.view.setScale(i))}else{var s=mxUtils.hasScrollbars(this.container);if(e&&!s){var l=this.container.offsetWidth,a=this.container.offsetHeight;if(t>1){var o=(t-1)/(i*2);l*=-o,a*=-o}else{var o=(1/t-1)/(this.view.scale*2);l*=o,a*=o}this.view.scaleAndTranslate(i,this.view.translate.x+l,this.view.translate.y+a)}else{var u=this.view.translate.x,p=this.view.translate.y,m=this.container.scrollLeft,d=this.container.scrollTop;if(this.view.setScale(i),s){var l=0,a=0;e&&(l=this.container.offsetWidth*(t-1)/2,a=this.container.offsetHeight*(t-1)/2),this.container.scrollLeft=(this.view.translate.x-u)*this.view.scale+Math.round(m*t+l),this.container.scrollTop=(this.view.translate.y-p)*this.view.scale+Math.round(d*t+a)}}}},mxGraph.prototype.zoomToRect=function(t){var e=this.container.clientWidth/t.width,i=this.container.clientHeight/t.height,n=e/i;t.x=Math.max(0,t.x),t.y=Math.max(0,t.y);var r=Math.min(this.container.scrollWidth,t.x+t.width),s=Math.min(this.container.scrollHeight,t.y+t.height);if(t.width=r-t.x,t.height=s-t.y,n<1){var l=t.height/n,a=(l-t.height)/2;t.height=l;var o=Math.min(t.y,a);t.y=t.y-o,s=Math.min(this.container.scrollHeight,t.y+t.height),t.height=s-t.y}else{var u=t.width*n,p=(u-t.width)/2;t.width=u;var m=Math.min(t.x,p);t.x=t.x-m,r=Math.min(this.container.scrollWidth,t.x+t.width),t.width=r-t.x}var d=this.container.clientWidth/t.width,x=this.view.scale*d;mxUtils.hasScrollbars(this.container)?(this.view.setScale(x),this.container.scrollLeft=Math.round(t.x*d),this.container.scrollTop=Math.round(t.y*d)):this.view.scaleAndTranslate(x,this.view.translate.x-t.x/this.view.scale,this.view.translate.y-t.y/this.view.scale)},mxGraph.prototype.scrollCellToVisible=function(t,e){var i=-this.view.translate.x,n=-this.view.translate.y,r=this.view.getState(t);if(r!=null){var s=new mxRectangle(i+r.x,n+r.y,r.width,r.height);if(e&&this.container!=null){var l=this.container.clientWidth,a=this.container.clientHeight;s.x=s.getCenterX()-l/2,s.width=l,s.y=s.getCenterY()-a/2,s.height=a}var o=new mxPoint(this.view.translate.x,this.view.translate.y);if(this.scrollRectToVisible(s)){var u=new mxPoint(this.view.translate.x,this.view.translate.y);this.view.translate.x=o.x,this.view.translate.y=o.y,this.view.setTranslate(u.x,u.y)}}},mxGraph.prototype.scrollRectToVisible=function(t){var e=!1;if(t!=null){var i=this.container.offsetWidth,n=this.container.offsetHeight,r=Math.min(i,t.width),s=Math.min(n,t.height);if(mxUtils.hasScrollbars(this.container)){var l=this.container;t.x+=this.view.translate.x,t.y+=this.view.translate.y;var a=l.scrollLeft-t.x,o=Math.max(a-l.scrollLeft,0);a>0?l.scrollLeft-=a+2:(a=t.x+r-l.scrollLeft-l.clientWidth,a>0&&(l.scrollLeft+=a+2));var u=l.scrollTop-t.y,p=Math.max(0,u-l.scrollTop);u>0?l.scrollTop-=u+2:(u=t.y+s-l.scrollTop-l.clientHeight,u>0&&(l.scrollTop+=u+2)),!this.useScrollbarsForPanning&&(o!=0||p!=0)&&this.view.setTranslate(o,p)}else{var m=-this.view.translate.x,d=-this.view.translate.y,x=this.view.scale;t.x+r>m+i&&(this.view.translate.x-=(t.x+r-i-m)/x,e=!0),t.y+s>d+n&&(this.view.translate.y-=(t.y+s-n-d)/x,e=!0),t.x1||r.length==1&&r[0]!=t)&&(n+=(mxResources.get(this.alreadyConnectedResource)||this.alreadyConnectedResource)+` -`)}var s=this.model.getDirectedEdgeCount(e,!0,t),l=this.model.getDirectedEdgeCount(i,!1,t);if(this.multiplicities!=null)for(var a=0;a0?n:null}return this.allowDanglingEdges?null:""},mxGraph.prototype.validateEdge=function(t,e,i){return null},mxGraph.prototype.validateGraph=function(t,e){t=t??this.model.getRoot(),e=e??new Object;for(var i=!0,n=this.model.getChildCount(t),r=0;r")):this.setCellWarning(s,null),i=i&&a==null}var o="";this.isCellCollapsed(t)&&!i&&(o+=(mxResources.get(this.containsValidationErrorsResource)||this.containsValidationErrorsResource)+` -`),this.model.isEdge(t)?o+=this.getEdgeValidationError(t,this.model.getTerminal(t,!0),this.model.getTerminal(t,!1))||"":o+=this.getCellValidationError(t)||"";var u=this.validateCell(t,e);return u!=null&&(o+=u),this.model.getParent(t)==null&&this.view.validate(),o.length>0||!i?o:null},mxGraph.prototype.getCellValidationError=function(t){var e=this.model.getDirectedEdgeCount(t,!0),i=this.model.getDirectedEdgeCount(t,!1),n=this.model.getValue(t),r="";if(this.multiplicities!=null)for(var s=0;sl.max||el.max||i0?r:null},mxGraph.prototype.validateCell=function(t,e){return null},mxGraph.prototype.getBackgroundImage=function(){return this.backgroundImage},mxGraph.prototype.setBackgroundImage=function(t){this.backgroundImage=t},mxGraph.prototype.getFoldingImage=function(t){if(t!=null&&this.foldingEnabled&&!this.getModel().isEdge(t.cell)){var e=this.isCellCollapsed(t.cell);if(this.isCellFoldable(t.cell,!e))return e?this.collapsedImage:this.expandedImage}return null},mxGraph.prototype.convertValueToString=function(t){var e=this.model.getValue(t);if(e!=null){if(mxUtils.isNode(e))return e.nodeName;if(typeof e.toString=="function")return e.toString()}return""},mxGraph.prototype.getLabel=function(t){var e="";if(this.labelsVisible&&t!=null){var i=this.getCurrentCellStyle(t);mxUtils.getValue(i,mxConstants.STYLE_NOLABEL,!1)||(e=this.convertValueToString(t))}return e},mxGraph.prototype.isHtmlLabel=function(t){return this.isHtmlLabels()},mxGraph.prototype.isHtmlLabels=function(){return this.htmlLabels},mxGraph.prototype.setHtmlLabels=function(t){this.htmlLabels=t},mxGraph.prototype.isWrapping=function(t){return this.getCurrentCellStyle(t)[mxConstants.STYLE_WHITE_SPACE]=="wrap"},mxGraph.prototype.isLabelClipped=function(t){return this.getCurrentCellStyle(t)[mxConstants.STYLE_OVERFLOW]=="hidden"},mxGraph.prototype.getTooltip=function(t,e,i,n){var r=null;if(t!=null){if(t.control!=null&&(e==t.control.node||e.parentNode==t.control.node)&&(r=this.collapseExpandResource,r=mxUtils.htmlEntities(mxResources.get(r)||r).replace(/\\n/g,"
")),r==null&&t.overlays!=null&&t.overlays.visit(function(l,a){r==null&&(e==a.node||e.parentNode==a.node)&&(r=a.overlay.toString())}),r==null){var s=this.selectionCellsHandler.getHandler(t.cell);s!=null&&typeof s.getTooltipForNode=="function"&&(r=s.getTooltipForNode(e))}r==null&&(r=this.getTooltipForCell(t.cell))}return r},mxGraph.prototype.getTooltipForCell=function(t){var e=null;return t!=null&&t.getTooltip!=null?e=t.getTooltip():e=this.convertValueToString(t),e},mxGraph.prototype.getLinkForCell=function(t){return null},mxGraph.prototype.getCursorForMouseEvent=function(t){return this.getCursorForCell(t.getCell())},mxGraph.prototype.getCursorForCell=function(t){return null},mxGraph.prototype.getStartSize=function(t,e){var i=new mxRectangle,n=this.getCurrentCellStyle(t,e),r=parseInt(mxUtils.getValue(n,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE));return mxUtils.getValue(n,mxConstants.STYLE_HORIZONTAL,!0)?i.height=r:i.width=r,i},mxGraph.prototype.getSwimlaneDirection=function(t){var e=mxUtils.getValue(t,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST),i=mxUtils.getValue(t,mxConstants.STYLE_FLIPH,0)==1,n=mxUtils.getValue(t,mxConstants.STYLE_FLIPV,0)==1,r=mxUtils.getValue(t,mxConstants.STYLE_HORIZONTAL,!0),s=r?0:3;e==mxConstants.DIRECTION_NORTH?s--:e==mxConstants.DIRECTION_WEST?s+=2:e==mxConstants.DIRECTION_SOUTH&&(s+=1);var l=mxUtils.mod(s,2);return i&&l==1&&(s+=2),n&&l==0&&(s+=2),[mxConstants.DIRECTION_NORTH,mxConstants.DIRECTION_EAST,mxConstants.DIRECTION_SOUTH,mxConstants.DIRECTION_WEST][mxUtils.mod(s,4)]},mxGraph.prototype.getActualStartSize=function(t,e){var i=new mxRectangle;if(this.isSwimlane(t,e)){var n=this.getCurrentCellStyle(t,e),r=parseInt(mxUtils.getValue(n,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE)),s=this.getSwimlaneDirection(n);s==mxConstants.DIRECTION_NORTH?i.y=r:s==mxConstants.DIRECTION_WEST?i.x=r:s==mxConstants.DIRECTION_SOUTH?i.height=r:i.width=r}return i},mxGraph.prototype.getImage=function(t){return t!=null&&t.style!=null?t.style[mxConstants.STYLE_IMAGE]:null},mxGraph.prototype.isTransparentState=function(t){var e=!1;if(t!=null){var i=mxUtils.getValue(t.style,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE),n=mxUtils.getValue(t.style,mxConstants.STYLE_FILLCOLOR,mxConstants.NONE);e=i==mxConstants.NONE&&n==mxConstants.NONE&&this.getImage(t)==null}return e},mxGraph.prototype.getVerticalAlign=function(t){return t!=null&&t.style!=null?t.style[mxConstants.STYLE_VERTICAL_ALIGN]||mxConstants.ALIGN_MIDDLE:null},mxGraph.prototype.getIndicatorColor=function(t){return t!=null&&t.style!=null?t.style[mxConstants.STYLE_INDICATOR_COLOR]:null},mxGraph.prototype.getIndicatorGradientColor=function(t){return t!=null&&t.style!=null?t.style[mxConstants.STYLE_INDICATOR_GRADIENTCOLOR]:null},mxGraph.prototype.getIndicatorShape=function(t){return t!=null&&t.style!=null?t.style[mxConstants.STYLE_INDICATOR_SHAPE]:null},mxGraph.prototype.getIndicatorImage=function(t){return t!=null&&t.style!=null?t.style[mxConstants.STYLE_INDICATOR_IMAGE]:null},mxGraph.prototype.getBorder=function(){return this.border},mxGraph.prototype.setBorder=function(t){this.border=t},mxGraph.prototype.isSwimlane=function(t,e){return t!=null&&this.model.getParent(t)!=this.model.getRoot()&&!this.model.isEdge(t)?this.getCurrentCellStyle(t,e)[mxConstants.STYLE_SHAPE]==mxConstants.SHAPE_SWIMLANE:!1},mxGraph.prototype.isResizeContainer=function(){return this.resizeContainer},mxGraph.prototype.setResizeContainer=function(t){this.resizeContainer=t},mxGraph.prototype.isEnabled=function(){return this.enabled},mxGraph.prototype.setEnabled=function(t){this.enabled=t},mxGraph.prototype.isEscapeEnabled=function(){return this.escapeEnabled},mxGraph.prototype.setEscapeEnabled=function(t){this.escapeEnabled=t},mxGraph.prototype.isInvokesStopCellEditing=function(){return this.invokesStopCellEditing},mxGraph.prototype.setInvokesStopCellEditing=function(t){this.invokesStopCellEditing=t},mxGraph.prototype.isEnterStopsCellEditing=function(){return this.enterStopsCellEditing},mxGraph.prototype.setEnterStopsCellEditing=function(t){this.enterStopsCellEditing=t},mxGraph.prototype.isCellLocked=function(t){var e=this.model.getGeometry(t);return this.isCellsLocked()||e!=null&&this.model.isVertex(t)&&e.relative},mxGraph.prototype.isCellsLocked=function(){return this.cellsLocked},mxGraph.prototype.setCellsLocked=function(t){this.cellsLocked=t},mxGraph.prototype.getCloneableCells=function(t){return this.model.filterCells(t,mxUtils.bind(this,function(e){return this.isCellCloneable(e)}))},mxGraph.prototype.isCellCloneable=function(t){var e=this.getCurrentCellStyle(t);return this.isCellsCloneable()&&e[mxConstants.STYLE_CLONEABLE]!=0},mxGraph.prototype.isCellsCloneable=function(){return this.cellsCloneable},mxGraph.prototype.setCellsCloneable=function(t){this.cellsCloneable=t},mxGraph.prototype.getExportableCells=function(t){return this.model.filterCells(t,mxUtils.bind(this,function(e){return this.canExportCell(e)}))},mxGraph.prototype.canExportCell=function(t){return this.exportEnabled},mxGraph.prototype.getImportableCells=function(t){return this.model.filterCells(t,mxUtils.bind(this,function(e){return this.canImportCell(e)}))},mxGraph.prototype.canImportCell=function(t){return this.importEnabled},mxGraph.prototype.isCellSelectable=function(t){return this.isCellsSelectable()},mxGraph.prototype.isCellsSelectable=function(){return this.cellsSelectable},mxGraph.prototype.setCellsSelectable=function(t){this.cellsSelectable=t},mxGraph.prototype.getDeletableCells=function(t){return this.model.filterCells(t,mxUtils.bind(this,function(e){return this.isCellDeletable(e)}))},mxGraph.prototype.isCellDeletable=function(t){var e=this.getCurrentCellStyle(t);return this.isCellsDeletable()&&e[mxConstants.STYLE_DELETABLE]!=0},mxGraph.prototype.isCellsDeletable=function(){return this.cellsDeletable},mxGraph.prototype.setCellsDeletable=function(t){this.cellsDeletable=t},mxGraph.prototype.isLabelMovable=function(t){return!this.isCellLocked(t)&&(this.model.isEdge(t)&&this.edgeLabelsMovable||this.model.isVertex(t)&&this.vertexLabelsMovable)},mxGraph.prototype.isCellRotatable=function(t){var e=this.getCurrentCellStyle(t);return e[mxConstants.STYLE_ROTATABLE]!=0},mxGraph.prototype.getMovableCells=function(t){return this.model.filterCells(t,mxUtils.bind(this,function(e){return this.isCellMovable(e)}))},mxGraph.prototype.isCellMovable=function(t){var e=this.getCurrentCellStyle(t);return this.isCellsMovable()&&!this.isCellLocked(t)&&e[mxConstants.STYLE_MOVABLE]!=0},mxGraph.prototype.isCellsMovable=function(){return this.cellsMovable},mxGraph.prototype.setCellsMovable=function(t){this.cellsMovable=t},mxGraph.prototype.isGridEnabled=function(){return this.gridEnabled},mxGraph.prototype.setGridEnabled=function(t){this.gridEnabled=t},mxGraph.prototype.isPortsEnabled=function(){return this.portsEnabled},mxGraph.prototype.setPortsEnabled=function(t){this.portsEnabled=t},mxGraph.prototype.getGridSize=function(){return this.gridSize},mxGraph.prototype.setGridSize=function(t){this.gridSize=t},mxGraph.prototype.getTolerance=function(){return this.tolerance},mxGraph.prototype.setTolerance=function(t){this.tolerance=t},mxGraph.prototype.isVertexLabelsMovable=function(){return this.vertexLabelsMovable},mxGraph.prototype.setVertexLabelsMovable=function(t){this.vertexLabelsMovable=t},mxGraph.prototype.isEdgeLabelsMovable=function(){return this.edgeLabelsMovable},mxGraph.prototype.setEdgeLabelsMovable=function(t){this.edgeLabelsMovable=t},mxGraph.prototype.isSwimlaneNesting=function(){return this.swimlaneNesting},mxGraph.prototype.setSwimlaneNesting=function(t){this.swimlaneNesting=t},mxGraph.prototype.isSwimlaneSelectionEnabled=function(){return this.swimlaneSelectionEnabled},mxGraph.prototype.setSwimlaneSelectionEnabled=function(t){this.swimlaneSelectionEnabled=t},mxGraph.prototype.isMultigraph=function(){return this.multigraph},mxGraph.prototype.setMultigraph=function(t){this.multigraph=t},mxGraph.prototype.isAllowLoops=function(){return this.allowLoops},mxGraph.prototype.setAllowDanglingEdges=function(t){this.allowDanglingEdges=t},mxGraph.prototype.isAllowDanglingEdges=function(){return this.allowDanglingEdges},mxGraph.prototype.setConnectableEdges=function(t){this.connectableEdges=t},mxGraph.prototype.isConnectableEdges=function(){return this.connectableEdges},mxGraph.prototype.setCloneInvalidEdges=function(t){this.cloneInvalidEdges=t},mxGraph.prototype.isCloneInvalidEdges=function(){return this.cloneInvalidEdges},mxGraph.prototype.setAllowLoops=function(t){this.allowLoops=t},mxGraph.prototype.isDisconnectOnMove=function(){return this.disconnectOnMove},mxGraph.prototype.setDisconnectOnMove=function(t){this.disconnectOnMove=t},mxGraph.prototype.isDropEnabled=function(){return this.dropEnabled},mxGraph.prototype.setDropEnabled=function(t){this.dropEnabled=t},mxGraph.prototype.isSplitEnabled=function(){return this.splitEnabled},mxGraph.prototype.setSplitEnabled=function(t){this.splitEnabled=t},mxGraph.prototype.isCellResizable=function(t){var e=this.getCurrentCellStyle(t);return this.isCellsResizable()&&!this.isCellLocked(t)&&mxUtils.getValue(e,mxConstants.STYLE_RESIZABLE,"1")!="0"},mxGraph.prototype.isCellsResizable=function(){return this.cellsResizable},mxGraph.prototype.setCellsResizable=function(t){this.cellsResizable=t},mxGraph.prototype.isTerminalPointMovable=function(t,e){return!0},mxGraph.prototype.isCellBendable=function(t){var e=this.getCurrentCellStyle(t);return this.isCellsBendable()&&!this.isCellLocked(t)&&e[mxConstants.STYLE_BENDABLE]!=0},mxGraph.prototype.isCellsBendable=function(){return this.cellsBendable},mxGraph.prototype.setCellsBendable=function(t){this.cellsBendable=t},mxGraph.prototype.isCellEditable=function(t){var e=this.getCurrentCellStyle(t);return this.isCellsEditable()&&!this.isCellLocked(t)&&e[mxConstants.STYLE_EDITABLE]!=0},mxGraph.prototype.isCellsEditable=function(){return this.cellsEditable},mxGraph.prototype.setCellsEditable=function(t){this.cellsEditable=t},mxGraph.prototype.isCellDisconnectable=function(t,e,i){return this.isCellsDisconnectable()&&!this.isCellLocked(t)},mxGraph.prototype.isCellsDisconnectable=function(){return this.cellsDisconnectable},mxGraph.prototype.setCellsDisconnectable=function(t){this.cellsDisconnectable=t},mxGraph.prototype.isValidSource=function(t){return t==null&&this.allowDanglingEdges||t!=null&&(!this.model.isEdge(t)||this.connectableEdges)&&this.isCellConnectable(t)},mxGraph.prototype.isValidTarget=function(t){return this.isValidSource(t)},mxGraph.prototype.isValidConnection=function(t,e){return this.isValidSource(t)&&this.isValidTarget(e)},mxGraph.prototype.setConnectable=function(t){this.connectionHandler.setEnabled(t)},mxGraph.prototype.isConnectable=function(){return this.connectionHandler.isEnabled()},mxGraph.prototype.setTooltips=function(t){this.tooltipHandler.setEnabled(t)},mxGraph.prototype.setPanning=function(t){this.panningHandler.panningEnabled=t},mxGraph.prototype.isEditing=function(t){if(this.cellEditor!=null){var e=this.cellEditor.getEditingCell();return t==null?e!=null:t==e}return!1},mxGraph.prototype.isAutoSizeCell=function(t){var e=this.getCurrentCellStyle(t);return this.isAutoSizeCells()||e[mxConstants.STYLE_AUTOSIZE]==1},mxGraph.prototype.isAutoSizeCells=function(){return this.autoSizeCells},mxGraph.prototype.setAutoSizeCells=function(t){this.autoSizeCells=t},mxGraph.prototype.isExtendParent=function(t){return!this.getModel().isEdge(t)&&this.isExtendParents()},mxGraph.prototype.isExtendParents=function(){return this.extendParents},mxGraph.prototype.setExtendParents=function(t){this.extendParents=t},mxGraph.prototype.isExtendParentsOnAdd=function(t){return this.extendParentsOnAdd},mxGraph.prototype.setExtendParentsOnAdd=function(t){this.extendParentsOnAdd=t},mxGraph.prototype.isExtendParentsOnMove=function(){return this.extendParentsOnMove},mxGraph.prototype.setExtendParentsOnMove=function(t){this.extendParentsOnMove=t},mxGraph.prototype.isRecursiveResize=function(t){return this.recursiveResize},mxGraph.prototype.setRecursiveResize=function(t){this.recursiveResize=t},mxGraph.prototype.isConstrainChild=function(t){return this.isConstrainChildren()&&!this.getModel().isEdge(this.getModel().getParent(t))},mxGraph.prototype.isConstrainChildren=function(){return this.constrainChildren},mxGraph.prototype.setConstrainChildren=function(t){this.constrainChildren=t},mxGraph.prototype.isConstrainRelativeChildren=function(){return this.constrainRelativeChildren},mxGraph.prototype.setConstrainRelativeChildren=function(t){this.constrainRelativeChildren=t},mxGraph.prototype.isAllowNegativeCoordinates=function(){return this.allowNegativeCoordinates},mxGraph.prototype.setAllowNegativeCoordinates=function(t){this.allowNegativeCoordinates=t},mxGraph.prototype.getOverlap=function(t){return this.isAllowOverlapParent(t)?this.defaultOverlap:0},mxGraph.prototype.isAllowOverlapParent=function(t){return!1},mxGraph.prototype.getFoldableCells=function(t,e){return this.model.filterCells(t,mxUtils.bind(this,function(i){return this.isCellFoldable(i,e)}))},mxGraph.prototype.isCellFoldable=function(t,e){var i=this.getCurrentCellStyle(t);return this.model.getChildCount(t)>0&&i[mxConstants.STYLE_FOLDABLE]!=0},mxGraph.prototype.isValidDropTarget=function(t,e,i){return t!=null&&(this.isSplitEnabled()&&this.isSplitTarget(t,e,i)||!this.model.isEdge(t)&&(this.isSwimlane(t)||this.model.getChildCount(t)>0&&!this.isCellCollapsed(t)))},mxGraph.prototype.isSplitTarget=function(t,e,i){if(this.model.isEdge(t)&&e!=null&&e.length==1&&this.isCellConnectable(e[0])&&this.getEdgeValidationError(t,this.model.getTerminal(t,!0),e[0])==null){var n=this.model.getTerminal(t,!0),r=this.model.getTerminal(t,!1);return!this.model.isAncestor(e[0],n)&&!this.model.isAncestor(e[0],r)}return!1},mxGraph.prototype.getDropTarget=function(t,e,i,n){if(!this.isSwimlaneNesting()){for(var r=0;r=0;a--){var o=this.model.getChildAt(i,a),u=this.getCellAt(t,e,o,n,r,s);if(u!=null)return u;if(this.isCellVisible(o)&&(r&&this.model.isEdge(o)||n&&this.model.isVertex(o))){var p=this.view.getState(o);if(p!=null&&(s==null||!s(p,t,e))&&this.intersects(p,t,e))return o}}return null},mxGraph.prototype.intersects=function(t,e,i){if(t!=null){var n=t.absolutePoints;if(n!=null)for(var r=this.tolerance*this.tolerance,s=n[0],l=1;l0&&e>0&&e>r.width*s)return!0;if(r.height>0&&i>0&&i>r.height*s)return!0}return!1},mxGraph.prototype.getChildVertices=function(t){return this.getChildCells(t,!0,!1)},mxGraph.prototype.getChildEdges=function(t){return this.getChildCells(t,!1,!0)},mxGraph.prototype.getChildCells=function(t,e,i){t=t??this.getDefaultParent(),e=e??!1,i=i??!1;for(var n=this.model.getChildCells(t,e,i),r=[],s=0;s0||n>0||l!=null){var u=this.getModel(),p=t+i,m=e+n;if(r==null&&(r=this.getCurrentRoot(),r==null&&(r=u.getRoot())),r!=null)for(var d=u.getChildCount(r),x=0;x=t&&v.y+v.height<=m&&v.y>=e&&v.x+v.width<=p;y&&s.push(f),(!y||o)&&this.getCells(t,e,i,n,f,s,l,a,o)}}}return s},mxGraph.prototype.getCellsBeyond=function(t,e,i,n,r){var s=[];if((n||r)&&(i==null&&(i=this.getDefaultParent()),i!=null))for(var l=this.model.getChildCount(i),a=0;a=t)&&(!r||u.y>=e)&&s.push(o)}return s},mxGraph.prototype.findTreeRoots=function(t,e,i){e=e??!1,i=i??!1;var n=[];if(t!=null){for(var r=this.getModel(),s=r.getChildCount(t),l=null,a=0,o=0;o0||!i&&d==0&&m>0)&&n.push(u);var g=i?d-m:m-d;g>a&&(a=g,l=u)}}n.length==0&&l!=null&&n.push(l)}return n},mxGraph.prototype.traverse=function(t,e,i,n,r,s){if(i!=null&&t!=null&&(e=e??!0,s=s??!1,r=r||new mxDictionary,!r.get(t))){r.put(t,!0);var l=i(t,n);if(l==null||l){var a=this.model.getEdgeCount(t);if(a>0)for(var o=0;o0?n.cells[0]:null;n.cells.length>1&&n.clear();var s=r!=null?this.model.getParent(r):this.getDefaultParent(),l=this.model.getChildCount(s);if(r==null&&l>0){var a=this.model.getChildAt(s,0);this.setSelectionCell(a)}else if((r==null||e)&&this.view.getState(s)!=null&&this.model.getGeometry(s)!=null)this.getCurrentRoot()!=s&&this.setSelectionCell(s);else if(r!=null&&i){var o=this.model.getChildCount(r);if(o>0){var a=this.model.getChildAt(r,0);this.setSelectionCell(a)}}else if(l>0){var u=s.getIndex(r);if(t){u++;var a=this.model.getChildAt(s,u%l);this.setSelectionCell(a)}else{u--;var p=u<0?l-1:u,a=this.model.getChildAt(s,p);this.setSelectionCell(a)}}},mxGraph.prototype.selectAll=function(t,e){t=t||this.getDefaultParent();var i=e?this.model.filterDescendants(mxUtils.bind(this,function(n){return n!=t&&this.view.getState(n)!=null}),t):this.model.getChildren(t);i!=null&&this.setSelectionCells(i)},mxGraph.prototype.selectVertices=function(t,e){this.selectCells(!0,!1,t,e)},mxGraph.prototype.selectEdges=function(t){this.selectCells(!1,!0,t)},mxGraph.prototype.selectCells=function(t,e,i,n){i=i||this.getDefaultParent();var r=mxUtils.bind(this,function(l){return this.view.getState(l)!=null&&((n||this.model.getChildCount(l)==0)&&this.model.isVertex(l)&&t&&!this.model.isEdge(this.model.getParent(l))||this.model.isEdge(l)&&e)}),s=this.model.filterDescendants(r,i);s!=null&&this.setSelectionCells(s)},mxGraph.prototype.selectCellForEvent=function(t,e){var i=this.isCellSelected(t);this.isToggleEvent(e)?i?this.removeSelectionCell(t):this.addSelectionCell(t):(!i||this.getSelectionCount()!=1)&&this.setSelectionCell(t)},mxGraph.prototype.selectCellsForEvent=function(t,e){this.isToggleEvent(e)?this.addSelectionCells(t):this.setSelectionCells(t)},mxGraph.prototype.createHandler=function(t){var e=null;if(t!=null)if(this.model.isEdge(t.cell)){var i=t.getVisibleTerminalState(!0),n=t.getVisibleTerminalState(!1),r=this.getCellGeometry(t.cell),s=this.view.getEdgeStyle(t,r!=null?r.points:null,i,n);e=this.createEdgeHandler(t,s)}else e=this.createVertexHandler(t);return e},mxGraph.prototype.createVertexHandler=function(t){return new mxVertexHandler(t)},mxGraph.prototype.createEdgeHandler=function(t,e){var i=null;return e==mxEdgeStyle.Loop||e==mxEdgeStyle.ElbowConnector||e==mxEdgeStyle.SideToSide||e==mxEdgeStyle.TopToBottom?i=this.createElbowEdgeHandler(t):e==mxEdgeStyle.SegmentConnector||e==mxEdgeStyle.OrthConnector?i=this.createEdgeSegmentHandler(t):i=new mxEdgeHandler(t),i},mxGraph.prototype.createEdgeSegmentHandler=function(t){return new mxEdgeSegmentHandler(t)},mxGraph.prototype.createElbowEdgeHandler=function(t){return new mxElbowEdgeHandler(t)},mxGraph.prototype.addMouseListener=function(t){this.mouseListeners==null&&(this.mouseListeners=[]),this.mouseListeners.push(t)},mxGraph.prototype.removeMouseListener=function(t){if(this.mouseListeners!=null){for(var e=0;e0){this.outline.getView().scale!=d&&(this.outline.getView().scale=d,t=!0);var x=this.outline.getView();x.currentRoot!=this.source.getView().currentRoot&&x.setCurrentRoot(this.source.getView().currentRoot);var f=this.source.view.translate,g=f.x+this.source.panDx,c=f.y+this.source.panDy,v=this.getOutlineOffset(d);v!=null&&(g+=v.x,c+=v.y),n.x<0&&(g=g-n.x),n.y<0&&(c=c-n.y),(x.translate.x!=g||x.translate.y!=c)&&(x.translate.x=g,x.translate.y=c,t=!0);var y=x.translate;d=this.source.getView().scale;var T=d/x.scale,C=1/x.scale,S=this.source.container;this.bounds=new mxRectangle((y.x-f.x-this.source.panDx)/C,(y.y-f.y-this.source.panDy)/C,S.clientWidth/T,S.clientHeight/T),this.bounds.x+=this.source.container.scrollLeft*x.scale/d,this.bounds.y+=this.source.container.scrollTop*x.scale/d;var E=this.selectionBorder.bounds;(E.x!=this.bounds.x||E.y!=this.bounds.y||E.width!=this.bounds.width||E.height!=this.bounds.height)&&(this.selectionBorder.bounds=this.bounds,this.selectionBorder.redraw());var E=this.sizer.bounds,L=new mxRectangle(this.bounds.x+this.bounds.width-E.width/2,this.bounds.y+this.bounds.height-E.height/2,E.width,E.height);(E.x!=L.x||E.y!=L.y||E.width!=L.width||E.height!=L.height)&&(this.sizer.bounds=L,this.sizer.node.style.visibility!="hidden"&&this.sizer.redraw()),t&&this.outline.view.revalidate()}}},mxOutline.prototype.mouseDown=function(t,e){if(this.enabled&&this.showViewport){var i=mxEvent.isMouseEvent(e.getEvent())?0:this.source.tolerance,n=this.source.allowHandleBoundsCheck&&(mxClient.IS_IE||i>0)?new mxRectangle(e.getGraphX()-i,e.getGraphY()-i,2*i,2*i):null;this.zoom=e.isSource(this.sizer)||n!=null&&mxUtils.intersects(shape.bounds,n),this.startX=e.getX(),this.startY=e.getY(),this.active=!0,this.source.useScrollbarsForPanning&&mxUtils.hasScrollbars(this.source.container)?(this.dx0=this.source.container.scrollLeft,this.dy0=this.source.container.scrollTop):(this.dx0=0,this.dy0=0)}e.consume()},mxOutline.prototype.mouseMove=function(t,e){if(this.active){this.selectionBorder.node.style.display=this.showViewport?"":"none",this.sizer.node.style.display=this.selectionBorder.node.style.display;var i=this.getTranslateForEvent(e),n=i.x,r=i.y,s=null;if(this.zoom){var a=this.source.container,o=a.clientWidth/a.clientHeight;r=n/o,s=new mxRectangle(this.bounds.x,this.bounds.y,Math.max(1,this.bounds.width+n),Math.max(1,this.bounds.height+r)),this.selectionBorder.bounds=s,this.selectionBorder.redraw()}else{var l=this.outline.getView().scale;s=new mxRectangle(this.bounds.x+n,this.bounds.y+r,this.bounds.width,this.bounds.height),this.selectionBorder.bounds=s,this.selectionBorder.redraw(),n/=l,n*=this.source.getView().scale,r/=l,r*=this.source.getView().scale,this.source.panGraph(-n-this.dx0,-r-this.dy0)}var u=this.sizer.bounds;this.sizer.bounds=new mxRectangle(s.x+s.width-u.width/2,s.y+s.height-u.height/2,u.width,u.height),this.sizer.node.style.visibility!="hidden"&&this.sizer.redraw(),e.consume()}},mxOutline.prototype.getTranslateForEvent=function(t){return new mxPoint(t.getX()-this.startX,t.getY()-this.startY)},mxOutline.prototype.mouseUp=function(t,e){if(this.active){var i=this.getTranslateForEvent(e),n=i.x,r=i.y;if(Math.abs(n)>0||Math.abs(r)>0){if(this.zoom){var l=this.selectionBorder.bounds.width,a=this.source.getView().scale;this.source.zoomTo(Math.max(this.minScale,a-n*a/l),!1)}else if(!this.source.useScrollbarsForPanning||!mxUtils.hasScrollbars(this.source.container)){this.source.panGraph(0,0),n/=this.outline.getView().scale,r/=this.outline.getView().scale;var s=this.source.getView().translate;this.source.getView().setTranslate(s.x-n,s.y-r)}this.update(),e.consume()}this.index=null,this.active=!1}},mxOutline.prototype.destroy=function(){this.source!=null&&(this.source.removeListener(this.panHandler),this.source.removeListener(this.refreshHandler),this.source.getModel().removeListener(this.updateHandler),this.source.getView().removeListener(this.updateHandler),mxEvent.removeListener(this.source.container,"scroll",this.updateHandler),this.source=null),this.outline!=null&&(this.outline.removeMouseListener(this),this.outline.destroy(),this.outline=null),this.selectionBorder!=null&&(this.selectionBorder.destroy(),this.selectionBorder=null),this.sizer!=null&&(this.sizer.destroy(),this.sizer=null)},__mxOutput.mxOutline=typeof mxOutline<"u"?mxOutline:void 0;function mxMultiplicity(t,e,i,n,r,s,l,a,o,u){this.source=t,this.type=e,this.attr=i,this.value=n,this.min=r??0,this.max=s??"n",this.validNeighbors=l,this.countError=mxResources.get(a)||a,this.typeError=mxResources.get(o)||o,this.validNeighborsAllowed=u??!0}mxMultiplicity.prototype.type=null,mxMultiplicity.prototype.attr=null,mxMultiplicity.prototype.value=null,mxMultiplicity.prototype.source=null,mxMultiplicity.prototype.min=null,mxMultiplicity.prototype.max=null,mxMultiplicity.prototype.validNeighbors=null,mxMultiplicity.prototype.validNeighborsAllowed=!0,mxMultiplicity.prototype.countError=null,mxMultiplicity.prototype.typeError=null,mxMultiplicity.prototype.check=function(t,e,i,n,r,s){var l="";if((this.source&&this.checkTerminal(t,i,e)||!this.source&&this.checkTerminal(t,n,e))&&(this.countError!=null&&(this.source&&(this.max==0||r>=this.max)||!this.source&&(this.max==0||s>=this.max))&&(l+=this.countError+` -`),this.validNeighbors!=null&&this.typeError!=null&&this.validNeighbors.length>0)){var a=this.checkNeighbors(t,e,i,n);a||(l+=this.typeError+` -`)}return l.length>0?l:null},mxMultiplicity.prototype.checkNeighbors=function(t,e,i,n){for(var r=t.model.getValue(i),s=t.model.getValue(n),l=!this.validNeighborsAllowed,a=this.validNeighbors,o=0;o0){var i=this.getGraph().getModel();i.beginUpdate();try{for(var n=null,r=0;r1||r.points!=null&&r.points.length>0||n.getTerminal(i,!0)==null||n.getTerminal(i,!1)==null||this.graph.allowDanglingEdges||this.graph.isCloneEvent(e.getEvent())&&this.graph.isCellsCloneable())?this.start(i,e.getX(),e.getY()):this.delayedSelection&&(this.cell=i),this.cellWasClicked=!0,this.consumeMouseEvent(mxEvent.MOUSE_DOWN,e)}}},mxGraphHandler.prototype.getGuideStates=function(){var t=this.graph.getDefaultParent(),e=this.graph.getModel(),i=mxUtils.bind(this,function(n){return this.graph.view.getState(n)!=null&&e.isVertex(n)&&e.getGeometry(n)!=null&&!e.getGeometry(n).relative});return this.graph.view.getCellStates(e.filterDescendants(i,t))},mxGraphHandler.prototype.getCells=function(t){return!this.delayedSelection&&this.graph.isCellMovable(t)?[t]:this.graph.getMovableCells(this.graph.getSelectionCells())},mxGraphHandler.prototype.getPreviewBounds=function(t){var e=this.getBoundingBox(t);if(e!=null){if(e.width=Math.max(0,e.width-1),e.height=Math.max(0,e.height-1),e.width0){for(var i=this.graph.getModel(),n=0;n=2)&&m!=(this.target||s))})}},mxGraphHandler.prototype.addStates=function(t,e){var i=this.graph.view.getState(t),n=0;if(i!=null&&e.get(t)==null){e.put(t,i),n++;for(var r=this.graph.model.getChildCount(t),s=0;s=this.cellCount&&!this.livePreviewActive&&this.allowLivePreview?(!this.cloning||!this.livePreviewActive)&&(this.livePreviewActive=!0,this.livePreviewUsed=!0):!this.livePreviewUsed&&this.shape==null&&(this.shape=this.createPreviewShape(this.bounds))},mxGraphHandler.prototype.mouseMove=function(t,e){var i=this.graph;if(!e.isConsumed()&&i.isMouseDown&&this.cell!=null&&this.first!=null&&this.bounds!=null&&!this.suspended){if(mxEvent.isMultiTouchEvent(e.getEvent())){this.reset();return}var n=this.getDelta(e),r=i.tolerance;if(this.shape!=null||this.livePreviewActive||Math.abs(n.x)>r||Math.abs(n.y)>r){this.highlight==null&&(this.highlight=new mxCellHighlight(this.graph,mxConstants.DROP_TARGET_COLOR,3));var s=i.isCloneEvent(e.getEvent())&&i.isCellsCloneable()&&this.isCloneEnabled(),l=i.isGridEnabledEvent(e.getEvent()),a=e.getCell(),o=!0,u=null;this.cloning=s,i.isDropEnabled()&&this.highlightEnabled&&(u=i.getDropTarget(this.cells,e.getEvent(),a,s));var p=i.getView().getState(u),m=!1;if(p!=null&&(s||this.isValidDropTarget(u,e)))this.target!=u&&(this.target=u,this.setHighlightColor(mxConstants.DROP_TARGET_COLOR)),m=!0;else if(this.target=null,this.connectOnDrop&&a!=null&&this.cells.length==1&&i.getModel().isVertex(a)&&i.isCellConnectable(a)&&(p=i.getView().getState(a),p!=null)){var d=i.getEdgeValidationError(null,this.cell,a),x=d==null?mxConstants.VALID_COLOR:mxConstants.INVALID_CONNECT_TARGET_COLOR;this.setHighlightColor(x),m=!0}p!=null&&m?this.highlight.highlight(p):this.highlight.hide(),this.guide!=null&&this.useGuidesForEvent(e)?(n=this.guide.move(this.bounds,n,l,s),o=!1):n=this.graph.snapDelta(n,this.bounds,!l,!1,!1),this.guide!=null&&o&&this.guide.hide(),i.isConstrainedEvent(e.getEvent())&&(Math.abs(n.x)>Math.abs(n.y)?n.y=0:n.x=0),this.checkPreview(),(this.currentDx!=n.x||this.currentDy!=n.y)&&(this.currentDx=n.x,this.currentDy=n.y,this.updatePreview())}this.updateHint(e),this.consumeMouseEvent(mxEvent.MOUSE_MOVE,e),mxEvent.consume(e.getEvent())}else if((this.isMoveEnabled()||this.isCloneEnabled())&&this.updateCursor&&!e.isConsumed()&&(e.getState()!=null||e.sourceState!=null)&&!i.isMouseDown){var f=i.getCursorForMouseEvent(e);f==null&&i.isEnabled()&&i.isCellMovable(e.getCell())&&(i.getModel().isEdge(e.getCell())?f=mxConstants.CURSOR_MOVABLE_EDGE:f=mxConstants.CURSOR_MOVABLE_VERTEX),f!=null&&e.sourceState!=null&&e.sourceState.setCursor(f)}},mxGraphHandler.prototype.updatePreview=function(t){this.livePreviewUsed&&!t?this.cells!=null&&(this.setHandlesVisibleForCells(this.graph.selectionCellsHandler.getHandledSelectionCells(),!1),this.updateLivePreview(this.currentDx,this.currentDy)):this.updatePreviewShape()},mxGraphHandler.prototype.updatePreviewShape=function(){this.shape!=null&&this.pBounds!=null&&(this.shape.bounds=new mxRectangle(Math.round(this.pBounds.x+this.currentDx),Math.round(this.pBounds.y+this.currentDy),this.pBounds.width,this.pBounds.height),this.shape.redraw())},mxGraphHandler.prototype.updateLivePreview=function(t,e){if(!this.suspended){var i=[];if(this.allCells!=null&&this.allCells.visit(mxUtils.bind(this,function(f,g){var c=this.graph.view.getState(g.cell);if(c!=g&&(g.destroy(),c!=null?this.allCells.put(g.cell,c):this.allCells.remove(g.cell),g=c),g!=null){var v=g.clone();i.push([g,v]),g.shape!=null&&(g.shape.originalPointerEvents==null&&(g.shape.originalPointerEvents=g.shape.pointerEvents),g.shape.pointerEvents=!1,g.text!=null&&(g.text.originalPointerEvents==null&&(g.text.originalPointerEvents=g.text.pointerEvents),g.text.pointerEvents=!1)),this.graph.model.isVertex(g.cell)&&(g.x+=t,g.y+=e,this.cloning?g.text!=null&&(g.text.updateBoundingBox(),g.text.boundingBox!=null&&(g.text.boundingBox.x+=t,g.text.boundingBox.y+=e),g.text.unrotatedBoundingBox!=null&&(g.text.unrotatedBoundingBox.x+=t,g.text.unrotatedBoundingBox.y+=e)):(g.view.graph.cellRenderer.redraw(g,!0),g.view.invalidate(g.cell),g.invalid=!1,g.control!=null&&g.control.node!=null&&(g.control.node.style.visibility="hidden")))}})),i.length==0)this.reset();else{for(var n=this.graph.view.scale,r=0;rthis.graph.tolerance||Math.abs(this.dy)>this.graph.tolerance,!i&&this.active&&this.fireEvent(new mxEventObject(mxEvent.PAN_START,"event",e))}(this.active||this.panningTrigger)&&e.consume()},mxPanningHandler.prototype.mouseUp=function(t,e){if(this.active){if(this.dx!=null&&this.dy!=null){if(!this.graph.useScrollbarsForPanning||!mxUtils.hasScrollbars(this.graph.container)){var i=this.graph.getView().scale,n=this.graph.getView().translate;this.graph.panGraph(0,0),this.panGraph(n.x+this.dx/i,n.y+this.dy/i)}e.consume()}this.fireEvent(new mxEventObject(mxEvent.PAN_END,"event",e))}this.reset()},mxPanningHandler.prototype.zoomGraph=function(t){var e=Math.round(this.initialScale*t.scale*100)/100;this.minScale!=null&&(e=Math.max(this.minScale,e)),this.maxScale!=null&&(e=Math.min(this.maxScale,e)),this.graph.view.scale!=e&&(this.graph.zoomTo(e),mxEvent.consume(t))},mxPanningHandler.prototype.reset=function(){this.panningTrigger=!1,this.mouseDownEvent=null,this.active=!1,this.dx=null,this.dy=null},mxPanningHandler.prototype.panGraph=function(t,e){this.graph.getView().setTranslate(t,e)},mxPanningHandler.prototype.destroy=function(){this.graph.removeMouseListener(this),this.graph.removeListener(this.forcePanningHandler),this.graph.removeListener(this.gestureHandler),mxEvent.removeListener(document,"mouseup",this.mouseUpListener)},__mxOutput.mxPanningHandler=typeof mxPanningHandler<"u"?mxPanningHandler:void 0;function mxPopupMenuHandler(t,e){t!=null&&(this.graph=t,this.factoryMethod=e,this.graph.addMouseListener(this),this.gestureHandler=mxUtils.bind(this,function(i,n){this.inTolerance=!1}),this.graph.addListener(mxEvent.GESTURE,this.gestureHandler),this.init())}mxPopupMenuHandler.prototype=new mxPopupMenu,mxPopupMenuHandler.prototype.constructor=mxPopupMenuHandler,mxPopupMenuHandler.prototype.graph=null,mxPopupMenuHandler.prototype.selectOnPopup=!0,mxPopupMenuHandler.prototype.clearSelectionOnBackground=!0,mxPopupMenuHandler.prototype.triggerX=null,mxPopupMenuHandler.prototype.triggerY=null,mxPopupMenuHandler.prototype.screenX=null,mxPopupMenuHandler.prototype.screenY=null,mxPopupMenuHandler.prototype.init=function(){mxPopupMenu.prototype.init.apply(this),mxEvent.addGestureListeners(this.div,mxUtils.bind(this,function(t){this.graph.tooltipHandler.hide()}))},mxPopupMenuHandler.prototype.isSelectOnPopup=function(t){return this.selectOnPopup},mxPopupMenuHandler.prototype.mouseDown=function(t,e){this.isEnabled()&&!mxEvent.isMultiTouchEvent(e.getEvent())&&(this.hideMenu(),this.triggerX=e.getGraphX(),this.triggerY=e.getGraphY(),this.screenX=mxEvent.getMainEvent(e.getEvent()).screenX,this.screenY=mxEvent.getMainEvent(e.getEvent()).screenY,this.popupTrigger=this.isPopupTrigger(e),this.inTolerance=!0)},mxPopupMenuHandler.prototype.mouseMove=function(t,e){this.inTolerance&&this.screenX!=null&&this.screenY!=null&&(Math.abs(mxEvent.getMainEvent(e.getEvent()).screenX-this.screenX)>this.graph.tolerance||Math.abs(mxEvent.getMainEvent(e.getEvent()).screenY-this.screenY)>this.graph.tolerance)&&(this.inTolerance=!1)},mxPopupMenuHandler.prototype.mouseUp=function(t,e){if(this.popupTrigger&&this.inTolerance&&this.triggerX!=null&&this.triggerY!=null){var i=this.getCellForPopupEvent(e);this.graph.isEnabled()&&this.isSelectOnPopup(e)&&i!=null&&!this.graph.isCellSelected(i)?this.graph.setSelectionCell(i):this.clearSelectionOnBackground&&i==null&&this.graph.clearSelection(),this.graph.tooltipHandler.hide();var n=mxUtils.getScrollOrigin();this.popup(e.getX()+n.x+1,e.getY()+n.y+1,i,e.getEvent()),e.consume()}this.popupTrigger=!1,this.inTolerance=!1},mxPopupMenuHandler.prototype.getCellForPopupEvent=function(t){return t.getCell()},mxPopupMenuHandler.prototype.destroy=function(){this.graph.removeMouseListener(this),this.graph.removeListener(this.gestureHandler),mxPopupMenu.prototype.destroy.apply(this)},__mxOutput.mxPopupMenuHandler=typeof mxPopupMenuHandler<"u"?mxPopupMenuHandler:void 0;function mxCellMarker(t,e,i,n){mxEventSource.call(this),t!=null&&(this.graph=t,this.validColor=e??mxConstants.DEFAULT_VALID_COLOR,this.invalidColor=i??mxConstants.DEFAULT_INVALID_COLOR,this.hotspot=n??mxConstants.DEFAULT_HOTSPOT,this.highlight=new mxCellHighlight(t))}mxUtils.extend(mxCellMarker,mxEventSource),mxCellMarker.prototype.graph=null,mxCellMarker.prototype.enabled=!0,mxCellMarker.prototype.hotspot=mxConstants.DEFAULT_HOTSPOT,mxCellMarker.prototype.hotspotEnabled=!1,mxCellMarker.prototype.validColor=null,mxCellMarker.prototype.invalidColor=null,mxCellMarker.prototype.currentColor=null,mxCellMarker.prototype.validState=null,mxCellMarker.prototype.markedState=null,mxCellMarker.prototype.setEnabled=function(t){this.enabled=t},mxCellMarker.prototype.isEnabled=function(){return this.enabled},mxCellMarker.prototype.setHotspot=function(t){this.hotspot=t},mxCellMarker.prototype.getHotspot=function(){return this.hotspot},mxCellMarker.prototype.setHotspotEnabled=function(t){this.hotspotEnabled=t},mxCellMarker.prototype.isHotspotEnabled=function(){return this.hotspotEnabled},mxCellMarker.prototype.hasValidState=function(){return this.validState!=null},mxCellMarker.prototype.getValidState=function(){return this.validState},mxCellMarker.prototype.getMarkedState=function(){return this.markedState},mxCellMarker.prototype.reset=function(){this.validState=null,this.markedState!=null&&(this.markedState=null,this.unmark())},mxCellMarker.prototype.process=function(t){var e=null;return this.isEnabled()&&(e=this.getState(t),this.setCurrentState(e,t)),e},mxCellMarker.prototype.setCurrentState=function(t,e,i){var n=t!=null?this.isValidState(t):!1;i=i??this.getMarkerColor(e.getEvent(),t,n),n?this.validState=t:this.validState=null,(t!=this.markedState||i!=this.currentColor)&&(this.currentColor=i,t!=null&&this.currentColor!=null?(this.markedState=t,this.mark()):this.markedState!=null&&(this.markedState=null,this.unmark()))},mxCellMarker.prototype.markCell=function(t,e){var i=this.graph.getView().getState(t);i!=null&&(this.currentColor=e??this.validColor,this.markedState=i,this.mark())},mxCellMarker.prototype.mark=function(){this.highlight.setHighlightColor(this.currentColor),this.highlight.highlight(this.markedState),this.fireEvent(new mxEventObject(mxEvent.MARK,"state",this.markedState))},mxCellMarker.prototype.unmark=function(){this.mark()},mxCellMarker.prototype.isValidState=function(t){return!0},mxCellMarker.prototype.getMarkerColor=function(t,e,i){return i?this.validColor:this.invalidColor},mxCellMarker.prototype.getState=function(t){var e=this.graph.getView(),i=this.getCell(t),n=this.getStateToMark(e.getState(i));return n!=null&&this.intersects(n,t)?n:null},mxCellMarker.prototype.getCell=function(t){return t.getCell()},mxCellMarker.prototype.getStateToMark=function(t){return t},mxCellMarker.prototype.intersects=function(t,e){return this.hotspotEnabled?mxUtils.intersectsHotspot(t,e.getGraphX(),e.getGraphY(),this.hotspot,mxConstants.MIN_HOTSPOT_SIZE,mxConstants.MAX_HOTSPOT_SIZE):!0},mxCellMarker.prototype.destroy=function(){this.graph.getView().removeListener(this.resetHandler),this.graph.getModel().removeListener(this.resetHandler),this.highlight.destroy()},__mxOutput.mxCellMarker=typeof mxCellMarker<"u"?mxCellMarker:void 0;function mxSelectionCellsHandler(t){mxEventSource.call(this),this.graph=t,this.handlers=new mxDictionary,this.graph.addMouseListener(this),this.refreshHandler=mxUtils.bind(this,function(e,i){this.isEnabled()&&this.refresh()}),this.graph.getSelectionModel().addListener(mxEvent.CHANGE,this.refreshHandler),this.graph.getModel().addListener(mxEvent.CHANGE,this.refreshHandler),this.graph.getView().addListener(mxEvent.SCALE,this.refreshHandler),this.graph.getView().addListener(mxEvent.TRANSLATE,this.refreshHandler),this.graph.getView().addListener(mxEvent.SCALE_AND_TRANSLATE,this.refreshHandler),this.graph.getView().addListener(mxEvent.DOWN,this.refreshHandler),this.graph.getView().addListener(mxEvent.UP,this.refreshHandler)}mxUtils.extend(mxSelectionCellsHandler,mxEventSource),mxSelectionCellsHandler.prototype.graph=null,mxSelectionCellsHandler.prototype.enabled=!0,mxSelectionCellsHandler.prototype.refreshHandler=null,mxSelectionCellsHandler.prototype.maxHandlers=100,mxSelectionCellsHandler.prototype.handlers=null,mxSelectionCellsHandler.prototype.isEnabled=function(){return this.enabled},mxSelectionCellsHandler.prototype.setEnabled=function(t){this.enabled=t},mxSelectionCellsHandler.prototype.getHandler=function(t){return this.handlers.get(t)},mxSelectionCellsHandler.prototype.isHandled=function(t){return this.getHandler(t)!=null},mxSelectionCellsHandler.prototype.reset=function(){this.handlers.visit(function(t,e){e.reset.apply(e)})},mxSelectionCellsHandler.prototype.getHandledSelectionCells=function(){return this.graph.getSelectionCells()},mxSelectionCellsHandler.prototype.refresh=function(){var t=this.handlers;this.handlers=new mxDictionary;for(var e=mxUtils.sortCells(this.getHandledSelectionCells(),!1),i=0;ithis.graph.tolerance||Math.abs(e.getGraphY()-this.first.y)>this.graph.tolerance)&&this.updateCurrentState(e,s),this.first!=null){var l=null,a=s;this.constraintHandler.currentConstraint!=null&&this.constraintHandler.currentFocus!=null&&this.constraintHandler.currentPoint!=null?(l=this.constraintHandler.currentConstraint,a=this.constraintHandler.currentPoint.clone()):this.previous!=null&&!this.graph.isIgnoreTerminalEvent(e.getEvent())&&mxEvent.isShiftDown(e.getEvent())&&(Math.abs(this.previous.getCenterX()-s.x)0?this.waypoints[0]:a,x=this.getSourcePerimeterPoint(this.previous,f,e);x!=null&&(o=x)}}if(this.currentState==null&&this.movePreviewAway){var x=o;if(this.edgeState!=null&&this.edgeState.absolutePoints.length>=2){var g=this.edgeState.absolutePoints[this.edgeState.absolutePoints.length-2];g!=null&&(x=g)}var c=a.x-x.x,v=a.y-x.y,y=Math.sqrt(c*c+v*v);if(y==0)return;this.originalPoint=a.clone(),a.x-=c*4/y,a.y-=v*4/y}else this.originalPoint=null;if(this.shape==null){var c=Math.abs(e.getGraphX()-this.first.x),v=Math.abs(e.getGraphY()-this.first.y);(c>this.graph.tolerance||v>this.graph.tolerance)&&(this.shape=this.createShape(),this.edgeState!=null&&this.shape.apply(this.edgeState),this.updateCurrentState(e,s))}if(this.shape!=null){if(this.edgeState!=null)this.shape.points=this.edgeState.absolutePoints;else{var T=[o];this.waypoints!=null&&(T=T.concat(this.waypoints)),T.push(a),this.shape.points=T}this.drawPreview()}this.cursor!=null&&(this.graph.container.style.cursor=this.cursor),mxEvent.consume(e.getEvent()),e.consume()}else!this.isEnabled()||!this.graph.isEnabled()?this.constraintHandler.reset():this.previous!=this.currentState&&this.edgeState==null?(this.destroyIcons(),this.currentState!=null&&this.error==null&&this.constraintHandler.currentConstraint==null&&(this.icons=this.createIcons(this.currentState),this.icons==null&&(this.currentState.setCursor(mxConstants.CURSOR_CONNECT),e.consume())),this.previous=this.currentState):this.previous==this.currentState&&this.currentState!=null&&this.icons==null&&!this.graph.isMouseDown&&e.consume();if(!this.graph.isMouseDown&&this.currentState!=null&&this.icons!=null){for(var C=!1,S=e.getSource(),E=0;E0?this.waypoints[this.waypoints.length-1]:new mxPoint(this.previous.getCenterX(),this.previous.getCenterY()),l=r(n.getPerimeterBounds(t),this.edgeState,s,!1);l!=null&&(i=l)}else i=new mxPoint(t.getCenterX(),t.getCenterY());return i},mxConnectionHandler.prototype.getSourcePerimeterPoint=function(t,e,i){var n=null,r=t.view,s=r.getPerimeterFunction(t),l=new mxPoint(t.getCenterX(),t.getCenterY());if(s!=null){var a=mxUtils.getValue(t.style,mxConstants.STYLE_ROTATION,0),o=-a*(Math.PI/180);a!=0&&(e=mxUtils.getRotatedPoint(new mxPoint(e.x,e.y),Math.cos(o),Math.sin(o),l));var u=s(r.getPerimeterBounds(t),t,e,!1);u!=null&&(a!=0&&(u=mxUtils.getRotatedPoint(new mxPoint(u.x,u.y),Math.cos(-o),Math.sin(-o),l)),n=u)}else n=l;return n},mxConnectionHandler.prototype.updateIcons=function(t,e,i){},mxConnectionHandler.prototype.isStopEvent=function(t){return t.getState()!=null},mxConnectionHandler.prototype.addWaypointForEvent=function(t){var e=mxUtils.convertPoint(this.graph.container,t.getX(),t.getY()),i=Math.abs(e.x-this.first.x),n=Math.abs(e.y-this.first.y),r=this.waypoints!=null||this.mouseDownCounter>1&&(i>this.graph.tolerance||n>this.graph.tolerance);if(r){this.waypoints==null&&(this.waypoints=[]);var s=this.graph.view.scale,e=new mxPoint(this.graph.snap(t.getGraphX()/s)*s,this.graph.snap(t.getGraphY()/s)*s);this.waypoints.push(e)}},mxConnectionHandler.prototype.checkConstraints=function(t,e){return t==null||e==null||t.point==null||e.point==null||!t.point.equals(e.point)||t.dx!=e.dx||t.dy!=e.dy||t.perimeter!=e.perimeter},mxConnectionHandler.prototype.mouseUp=function(t,e){if(!e.isConsumed()&&this.isConnecting()){if(this.waypointsEnabled&&!this.isStopEvent(e)){this.addWaypointForEvent(e),e.consume();return}var i=this.sourceConstraint,n=this.constraintHandler.currentConstraint,r=this.previous!=null?this.previous.cell:null,s=null;this.constraintHandler.currentConstraint!=null&&this.constraintHandler.currentFocus!=null&&(s=this.constraintHandler.currentFocus.cell),s==null&&this.currentState!=null&&(s=this.currentState.cell),this.error==null&&(r==null||s==null||r!=s||this.checkConstraints(i,n))?this.connect(r,s,e.getEvent(),e.getCell()):(this.previous!=null&&this.marker.validState!=null&&this.previous.cell==this.marker.validState.cell&&this.graph.selectCellForEvent(this.marker.source,e.getEvent()),this.error!=null&&this.error.length>0&&this.graph.validationAlert(this.error)),this.destroyIcons(),e.consume()}this.first!=null&&this.reset()},mxConnectionHandler.prototype.reset=function(){this.shape!=null&&(this.shape.destroy(),this.shape=null),this.cursor!=null&&this.graph.container!=null&&(this.graph.container.style.cursor=""),this.destroyIcons(),this.marker.reset(),this.constraintHandler.reset(),this.originalPoint=null,this.currentPoint=null,this.edgeState=null,this.previous=null,this.error=null,this.sourceConstraint=null,this.mouseDownCounter=0,this.first=null,this.fireEvent(new mxEventObject(mxEvent.RESET))},mxConnectionHandler.prototype.drawPreview=function(){this.updatePreview(this.error==null),this.shape.redraw()},mxConnectionHandler.prototype.updatePreview=function(t){this.shape.strokewidth=this.getEdgeWidth(t),this.shape.stroke=this.getEdgeColor(t)},mxConnectionHandler.prototype.getEdgeColor=function(t){return t?mxConstants.VALID_COLOR:mxConstants.INVALID_COLOR},mxConnectionHandler.prototype.getEdgeWidth=function(t){return t?3:1},mxConnectionHandler.prototype.connect=function(t,e,i,n){if(e!=null||this.isCreateTarget(i)||this.graph.allowDanglingEdges){var r=this.graph.getModel(),s=!1,l=null;r.beginUpdate();try{if(t!=null&&e==null&&!this.graph.isIgnoreTerminalEvent(i)&&this.isCreateTarget(i)&&(e=this.createTargetVertex(i,t),e!=null)){if(n=this.graph.getDropTarget([e],i,n),s=!0,n==null||!this.graph.getModel().isEdge(n)){var a=this.graph.getView().getState(n);if(a!=null){var o=r.getGeometry(e);o.x-=a.origin.x,o.y-=a.origin.y}}else n=this.graph.getDefaultParent();this.graph.addCell(e,n)}var u=this.graph.getDefaultParent();t!=null&&e!=null&&r.getParent(t)==r.getParent(e)&&r.getParent(r.getParent(t))!=r.getRoot()&&(u=r.getParent(t),t.geometry!=null&&t.geometry.relative&&e.geometry!=null&&e.geometry.relative&&(u=r.getParent(u)));var p=null,m=null;if(this.edgeState!=null&&(p=this.edgeState.cell.value,m=this.edgeState.cell.style),l=this.insertEdge(u,null,p,t,e,m),l!=null){this.graph.setConnectionConstraint(l,t,!0,this.sourceConstraint),this.graph.setConnectionConstraint(l,e,!1,this.constraintHandler.currentConstraint),this.edgeState!=null&&r.setGeometry(l,this.edgeState.cell.geometry);var u=r.getParent(t);if(this.isInsertBefore(l,t,e,i,n)){for(var d=null,o=t;o.parent!=null&&o.geometry!=null&&o.geometry.relative&&o.parent!=l.parent;)o=this.graph.model.getParent(o);o!=null&&o.parent!=null&&o.parent==l.parent&&r.add(u,l,o.parent.getIndex(o))}var x=r.getGeometry(l);if(x==null&&(x=new mxGeometry,x.relative=!0,r.setGeometry(l,x)),this.waypoints!=null&&this.waypoints.length>0){var f=this.graph.view.scale,g=this.graph.view.translate;x.points=[];for(var c=0;c0){var o=this.graph.view.getState(e);if(o!=null){var u=o.x/s-r.x,p=o.y/s-r.y;Math.abs(u-n.x)<=a&&(n.x=Math.round(u)),Math.abs(p-n.y)<=a&&(n.y=Math.round(p))}}}return i},mxConnectionHandler.prototype.getAlignmentTolerance=function(t){return this.graph.isGridEnabled()?this.graph.gridSize/2:this.graph.tolerance},mxConnectionHandler.prototype.createEdge=function(t,e,i,n){var r=null;if(this.factoryMethod!=null&&(r=this.factoryMethod(e,i,n)),r==null){r=new mxCell(t||""),r.setEdge(!0),r.setStyle(n);var s=new mxGeometry;s.relative=!0,r.setGeometry(s)}return r},mxConnectionHandler.prototype.destroy=function(){this.graph.removeMouseListener(this),this.shape!=null&&(this.shape.destroy(),this.shape=null),this.marker!=null&&(this.marker.destroy(),this.marker=null),this.constraintHandler!=null&&(this.constraintHandler.destroy(),this.constraintHandler=null),this.changeHandler!=null&&(this.graph.getModel().removeListener(this.changeHandler),this.graph.getView().removeListener(this.changeHandler),this.changeHandler=null),this.drillHandler!=null&&(this.graph.removeListener(this.drillHandler),this.graph.getView().removeListener(this.drillHandler),this.drillHandler=null),this.escapeHandler!=null&&(this.graph.removeListener(this.escapeHandler),this.escapeHandler=null)},__mxOutput.mxConnectionHandler=typeof mxConnectionHandler<"u"?mxConnectionHandler:void 0;function mxConstraintHandler(t){this.graph=t,this.resetHandler=mxUtils.bind(this,function(e,i){this.currentFocus!=null&&this.graph.view.getState(this.currentFocus.cell)==null?this.reset():this.redraw()}),this.graph.model.addListener(mxEvent.CHANGE,this.resetHandler),this.graph.view.addListener(mxEvent.SCALE_AND_TRANSLATE,this.resetHandler),this.graph.view.addListener(mxEvent.TRANSLATE,this.resetHandler),this.graph.view.addListener(mxEvent.SCALE,this.resetHandler),this.graph.addListener(mxEvent.ROOT,this.resetHandler)}mxConstraintHandler.prototype.pointImage=new mxImage(mxClient.imageBasePath+"/point.gif",5,5),mxConstraintHandler.prototype.graph=null,mxConstraintHandler.prototype.enabled=!0,mxConstraintHandler.prototype.highlightColor=mxConstants.DEFAULT_VALID_COLOR,mxConstraintHandler.prototype.isEnabled=function(){return this.enabled},mxConstraintHandler.prototype.setEnabled=function(t){this.enabled=t},mxConstraintHandler.prototype.reset=function(){if(this.focusIcons!=null){for(var t=0;to||Math.abs(a)>o)&&(this.div==null&&(this.div=this.createShape()),mxUtils.clearSelection(),this.update(r,s),e.consume())}},mxRubberband.prototype.createShape=function(){this.sharedDiv==null&&(this.sharedDiv=document.createElement("div"),this.sharedDiv.className="mxRubberband",mxUtils.setOpacity(this.sharedDiv,this.defaultOpacity)),this.graph.container.appendChild(this.sharedDiv);var t=this.sharedDiv;return mxClient.IS_SVG&&(!mxClient.IS_IE||document.documentMode>=10)&&this.fadeOut&&(this.sharedDiv=null),t},mxRubberband.prototype.isActive=function(t,e){return this.div!=null&&this.div.style.display!="none"},mxRubberband.prototype.mouseUp=function(t,e){var i=this.isActive();this.reset(),i&&(this.execute(e.getEvent()),e.consume())},mxRubberband.prototype.execute=function(t){var e=new mxRectangle(this.x,this.y,this.width,this.height);this.graph.selectRegion(e,t)},mxRubberband.prototype.reset=function(){if(this.div!=null)if(mxClient.IS_SVG&&(!mxClient.IS_IE||document.documentMode>=10)&&this.fadeOut){var t=this.div;mxUtils.setPrefixedStyle(t.style,"transition","all 0.2s linear"),t.style.pointerEvents="none",t.style.opacity=0,window.setTimeout(function(){t.parentNode.removeChild(t)},200)}else this.div.parentNode.removeChild(this.div);mxEvent.removeGestureListeners(document,null,this.dragHandler,this.dropHandler),this.dragHandler=null,this.dropHandler=null,this.currentX=0,this.currentY=0,this.first=null,this.div=null},mxRubberband.prototype.update=function(t,e){this.currentX=t,this.currentY=e,this.repaint()},mxRubberband.prototype.repaint=function(){if(this.div!=null){var t=this.currentX-this.graph.panDx,e=this.currentY-this.graph.panDy;this.x=Math.min(this.first.x,t),this.y=Math.min(this.first.y,e),this.width=Math.max(this.first.x,t)-this.x,this.height=Math.max(this.first.y,e)-this.y;var i=mxClient.IS_VML?this.graph.panDx:0,n=mxClient.IS_VML?this.graph.panDy:0;this.div.style.left=this.x+i+"px",this.div.style.top=this.y+n+"px",this.div.style.width=Math.max(1,this.width)+"px",this.div.style.height=Math.max(1,this.height)+"px"}},mxRubberband.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,this.graph.removeMouseListener(this),this.graph.removeListener(this.forceRubberbandHandler),this.graph.removeListener(this.panHandler),this.reset(),this.sharedDiv!=null&&(this.sharedDiv=null))},__mxOutput.mxRubberband=typeof mxRubberband<"u"?mxRubberband:void 0;function mxHandle(t,e,i,n){this.graph=t.view.graph,this.state=t,this.cursor=e??this.cursor,this.image=i??this.image,this.shape=n??null,this.init()}mxHandle.prototype.cursor="default",mxHandle.prototype.image=null,mxHandle.prototype.ignoreGrid=!1,mxHandle.prototype.getPosition=function(t){},mxHandle.prototype.setPosition=function(t,e,i){},mxHandle.prototype.execute=function(t){},mxHandle.prototype.copyStyle=function(t){this.graph.setCellStyles(t,this.state.style[t],[this.state.cell])},mxHandle.prototype.processEvent=function(t){var e=this.graph.view.scale,i=this.graph.view.translate,n=new mxPoint(t.getGraphX()/e-i.x,t.getGraphY()/e-i.y);this.shape!=null&&this.shape.bounds!=null&&(n.x-=this.shape.bounds.width/e/4,n.y-=this.shape.bounds.height/e/4);var r=-mxUtils.toRadians(this.getRotation()),s=-mxUtils.toRadians(this.getTotalRotation())-r;n=this.flipPoint(this.rotatePoint(this.snapPoint(this.rotatePoint(n,r),this.ignoreGrid||!this.graph.isGridEnabledEvent(t.getEvent())),s)),this.setPosition(this.state.getPaintBounds(),n,t),this.redraw()},mxHandle.prototype.positionChanged=function(){this.state.text!=null&&this.state.text.apply(this.state),this.state.shape!=null&&this.state.shape.apply(this.state),this.graph.cellRenderer.redraw(this.state,!0)},mxHandle.prototype.getRotation=function(){return this.state.shape!=null?this.state.shape.getRotation():0},mxHandle.prototype.getTotalRotation=function(){return this.state.shape!=null?this.state.shape.getShapeRotation():0},mxHandle.prototype.init=function(){var t=this.isHtmlRequired();this.image!=null?(this.shape=new mxImageShape(new mxRectangle(0,0,this.image.width,this.image.height),this.image.src),this.shape.preserveImageAspect=!1):this.shape==null&&(this.shape=this.createShape(t)),this.initShape(t)},mxHandle.prototype.createShape=function(t){var e=new mxRectangle(0,0,mxConstants.HANDLE_SIZE,mxConstants.HANDLE_SIZE);return new mxRectangleShape(e,mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR)},mxHandle.prototype.initShape=function(t){t&&this.shape.isHtmlAllowed()?(this.shape.dialect=mxConstants.DIALECT_STRICTHTML,this.shape.init(this.graph.container)):(this.shape.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG,this.cursor!=null&&this.shape.init(this.graph.getView().getOverlayPane())),mxEvent.redirectMouseEvents(this.shape.node,this.graph,this.state),this.shape.node.style.cursor=this.cursor},mxHandle.prototype.redraw=function(){if(this.shape!=null&&this.state.shape!=null){var t=this.getPosition(this.state.getPaintBounds());if(t!=null){var e=mxUtils.toRadians(this.getTotalRotation());t=this.rotatePoint(this.flipPoint(t),e);var i=this.graph.view.scale,n=this.graph.view.translate;this.shape.bounds.x=Math.floor((t.x+n.x)*i-this.shape.bounds.width/2),this.shape.bounds.y=Math.floor((t.y+n.y)*i-this.shape.bounds.height/2),this.shape.redraw()}}},mxHandle.prototype.isHtmlRequired=function(){return this.state.text!=null&&this.state.text.node.parentNode==this.graph.container},mxHandle.prototype.rotatePoint=function(t,e){var i=this.state.getCellBounds(),n=new mxPoint(i.getCenterX(),i.getCenterY()),r=Math.cos(e),s=Math.sin(e);return mxUtils.getRotatedPoint(t,r,s,n)},mxHandle.prototype.flipPoint=function(t){if(this.state.shape!=null){var e=this.state.getCellBounds();this.state.shape.flipH&&(t.x=2*e.x+e.width-t.x),this.state.shape.flipV&&(t.y=2*e.y+e.height-t.y)}return t},mxHandle.prototype.snapPoint=function(t,e){return e||(t.x=this.graph.snap(t.x),t.y=this.graph.snap(t.y)),t},mxHandle.prototype.setVisible=function(t){this.shape!=null&&this.shape.node!=null&&(this.shape.node.style.display=t?"":"none")},mxHandle.prototype.reset=function(){this.setVisible(!0),this.state.style=this.graph.getCellStyle(this.state.cell),this.positionChanged()},mxHandle.prototype.destroy=function(){this.shape!=null&&(this.shape.destroy(),this.shape=null)},__mxOutput.mxHandle=typeof mxHandle<"u"?mxHandle:void 0;function mxVertexHandler(t){t!=null&&(this.state=t,this.init(),this.escapeHandler=mxUtils.bind(this,function(e,i){this.livePreview&&this.index!=null&&(this.state.view.graph.cellRenderer.redraw(this.state,!0),this.state.view.invalidate(this.state.cell),this.state.invalid=!1,this.state.view.validate()),this.reset()}),this.state.view.graph.addListener(mxEvent.ESCAPE,this.escapeHandler))}mxVertexHandler.prototype.graph=null,mxVertexHandler.prototype.state=null,mxVertexHandler.prototype.singleSizer=!1,mxVertexHandler.prototype.index=null,mxVertexHandler.prototype.allowHandleBoundsCheck=!0,mxVertexHandler.prototype.handleImage=null,mxVertexHandler.prototype.handlesVisible=!0,mxVertexHandler.prototype.tolerance=0,mxVertexHandler.prototype.rotationEnabled=!1,mxVertexHandler.prototype.parentHighlightEnabled=!1,mxVertexHandler.prototype.rotationRaster=!0,mxVertexHandler.prototype.rotationCursor="crosshair",mxVertexHandler.prototype.livePreview=!1,mxVertexHandler.prototype.movePreviewToFront=!1,mxVertexHandler.prototype.manageSizers=!1,mxVertexHandler.prototype.constrainGroupByChildren=!1,mxVertexHandler.prototype.rotationHandleVSpacing=-16,mxVertexHandler.prototype.horizontalOffset=0,mxVertexHandler.prototype.verticalOffset=0,mxVertexHandler.prototype.init=function(){if(this.graph=this.state.view.graph,this.selectionBounds=this.getSelectionBounds(this.state),this.bounds=new mxRectangle(this.selectionBounds.x,this.selectionBounds.y,this.selectionBounds.width,this.selectionBounds.height),this.selectionBorder=this.createSelectionShape(this.bounds),this.selectionBorder.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,this.selectionBorder.pointerEvents=!1,this.selectionBorder.rotation=Number(this.state.style[mxConstants.STYLE_ROTATION]||"0"),this.selectionBorder.init(this.graph.getView().getOverlayPane()),mxEvent.redirectMouseEvents(this.selectionBorder.node,this.graph,this.state),this.graph.isCellMovable(this.state.cell)&&this.selectionBorder.setCursor(mxConstants.CURSOR_MOVABLE_VERTEX),mxGraphHandler.prototype.maxCells<=0||this.graph.getSelectionCount()=2&&this.state.height>=2){var e=0;t&&(this.singleSizer||(this.sizers.push(this.createSizer("nw-resize",e++)),this.sizers.push(this.createSizer("n-resize",e++)),this.sizers.push(this.createSizer("ne-resize",e++)),this.sizers.push(this.createSizer("w-resize",e++)),this.sizers.push(this.createSizer("e-resize",e++)),this.sizers.push(this.createSizer("sw-resize",e++)),this.sizers.push(this.createSizer("s-resize",e++))),this.sizers.push(this.createSizer("se-resize",e++)));var i=this.graph.model.getGeometry(this.state.cell);i!=null&&!i.relative&&!this.graph.isSwimlane(this.state.cell)&&this.graph.isLabelMovable(this.state.cell)&&(this.labelShape=this.createSizer(mxConstants.CURSOR_LABEL_HANDLE,mxEvent.LABEL_HANDLE,mxConstants.LABEL_HANDLE_SIZE,mxConstants.LABEL_HANDLE_FILLCOLOR),this.sizers.push(this.labelShape))}else this.graph.isCellMovable(this.state.cell)&&!this.graph.isCellResizable(this.state.cell)&&this.state.width<2&&this.state.height<2&&(this.labelShape=this.createSizer(mxConstants.CURSOR_MOVABLE_VERTEX,mxEvent.LABEL_HANDLE,null,mxConstants.LABEL_HANDLE_FILLCOLOR),this.sizers.push(this.labelShape))}this.isRotationHandleVisible()&&(this.rotationShape=this.createSizer(this.rotationCursor,mxEvent.ROTATION_HANDLE,mxConstants.HANDLE_SIZE+3,mxConstants.HANDLE_FILLCOLOR),this.sizers.push(this.rotationShape)),this.customHandles=this.createCustomHandles(),this.redraw(),this.constrainGroupByChildren&&this.updateMinBounds()},mxVertexHandler.prototype.isRotationHandleVisible=function(){return this.graph.isEnabled()&&this.rotationEnabled&&this.graph.isCellRotatable(this.state.cell)&&(mxGraphHandler.prototype.maxCells<=0||this.graph.getSelectionCount()0&&(this.minBounds=this.graph.view.getBounds(t),this.minBounds!=null)){var e=this.state.view.scale,i=this.state.view.translate;this.minBounds.x-=this.state.x,this.minBounds.y-=this.state.y,this.minBounds.x/=e,this.minBounds.y/=e,this.minBounds.width/=e,this.minBounds.height/=e,this.x0=this.state.x/e-i.x,this.y0=this.state.y/e-i.y}},mxVertexHandler.prototype.getSelectionBounds=function(t){return new mxRectangle(Math.round(t.x),Math.round(t.y),Math.round(t.width),Math.round(t.height))},mxVertexHandler.prototype.createParentHighlightShape=function(t){return this.createSelectionShape(t)},mxVertexHandler.prototype.createSelectionShape=function(t){var e=new mxRectangleShape(mxRectangle.fromRectangle(t),null,this.getSelectionColor());return e.strokewidth=this.getSelectionStrokeWidth(),e.isDashed=this.isSelectionDashed(),e},mxVertexHandler.prototype.getSelectionColor=function(){return mxConstants.VERTEX_SELECTION_COLOR},mxVertexHandler.prototype.getSelectionStrokeWidth=function(){return mxConstants.VERTEX_SELECTION_STROKEWIDTH},mxVertexHandler.prototype.isSelectionDashed=function(){return mxConstants.VERTEX_SELECTION_DASHED},mxVertexHandler.prototype.createSizer=function(t,e,i,n){i=i||mxConstants.HANDLE_SIZE;var r=new mxRectangle(0,0,i,i),s=this.createSizerShape(r,e,n);return s.isHtmlAllowed()&&this.state.text!=null&&this.state.text.node.parentNode==this.graph.container?(s.bounds.height-=1,s.bounds.width-=1,s.dialect=mxConstants.DIALECT_STRICTHTML,s.init(this.graph.container)):(s.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG,s.init(this.graph.getView().getOverlayPane())),mxEvent.redirectMouseEvents(s.node,this.graph,this.state),this.graph.isEnabled()&&s.setCursor(t),this.isSizerVisible(e)||(s.visible=!1),s},mxVertexHandler.prototype.isSizerVisible=function(t){return!0},mxVertexHandler.prototype.createSizerShape=function(t,e,i){if(this.handleImage!=null){t=new mxRectangle(t.x,t.y,this.handleImage.width,this.handleImage.height);var n=new mxImageShape(t,this.handleImage.src);return n.preserveImageAspect=!1,n}else return e==mxEvent.ROTATION_HANDLE?new mxEllipse(t,i||mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR):new mxRectangleShape(t,i||mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR)},mxVertexHandler.prototype.moveSizerTo=function(t,e,i){t!=null&&(t.bounds.x=Math.floor(e-t.bounds.width/2),t.bounds.y=Math.floor(i-t.bounds.height/2),t.node!=null&&t.node.style.display!="none"&&t.redraw())},mxVertexHandler.prototype.getHandleForEvent=function(t){var e=mxEvent.isMouseEvent(t.getEvent())?1:this.tolerance,i=this.allowHandleBoundsCheck&&(mxClient.IS_IE||e>0)?new mxRectangle(t.getGraphX()-e,t.getGraphY()-e,2*e,2*e):null,n=mxUtils.bind(this,function(s){var l=s!=null&&s.constructor!=mxImageShape&&this.allowHandleBoundsCheck?s.strokewidth+s.svgStrokeTolerance:null,a=l!=null?new mxRectangle(t.getGraphX()-Math.floor(l/2),t.getGraphY()-Math.floor(l/2),l,l):i;return s!=null&&(t.isSource(s)||a!=null&&mxUtils.intersects(s.bounds,a)&&s.node.style.display!="none"&&s.node.style.visibility!="hidden")});if(n(this.rotationShape))return mxEvent.ROTATION_HANDLE;if(n(this.labelShape))return mxEvent.LABEL_HANDLE;if(this.sizers!=null){for(var r=0;r=0;r--)if(n(this.customHandles[r].shape))return mxEvent.CUSTOM_HANDLE-r}return null},mxVertexHandler.prototype.isCustomHandleEvent=function(t){return!0},mxVertexHandler.prototype.mouseDown=function(t,e){if(!e.isConsumed()&&this.graph.isEnabled()){var i=this.getHandleForEvent(e);i!=null&&(this.start(e.getGraphX(),e.getGraphY(),i),e.consume())}},mxVertexHandler.prototype.isLivePreviewBorder=function(){return this.state.shape!=null&&this.state.shape.fill==null&&this.state.shape.stroke==null},mxVertexHandler.prototype.start=function(t,e,i){if(this.selectionBorder!=null)if(this.livePreviewActive=this.livePreview&&this.graph.model.getChildCount(this.state.cell)==0,this.inTolerance=!0,this.childOffsetX=0,this.childOffsetY=0,this.index=i,this.startX=t,this.startY=e,this.index<=mxEvent.CUSTOM_HANDLE&&this.isGhostPreview())this.ghostPreview=this.createGhostPreview();else{var n=this.state.view.graph.model,r=n.getParent(this.state.cell);if(this.state.view.currentRoot!=r&&(n.isVertex(r)||n.isEdge(r))&&(this.parentState=this.state.view.graph.view.getState(r)),this.selectionBorder.node.style.display=i==mxEvent.ROTATION_HANDLE?"inline":"none",(!this.livePreviewActive||this.isLivePreviewBorder())&&(this.preview=this.createSelectionShape(this.bounds),!(mxClient.IS_SVG&&Number(this.state.style[mxConstants.STYLE_ROTATION]||"0")!=0)&&this.state.text!=null&&this.state.text.node.parentNode==this.graph.container?(this.preview.dialect=mxConstants.DIALECT_STRICTHTML,this.preview.init(this.graph.container)):(this.preview.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,this.preview.init(this.graph.view.getOverlayPane()))),i==mxEvent.ROTATION_HANDLE){var s=this.getRotationHandlePosition(),l=s.x-this.state.getCenterX(),a=s.y-this.state.getCenterY();this.startAngle=l!=0?Math.atan(a/l)*180/Math.PI+90:0,this.startDist=Math.sqrt(l*l+a*a)}if(this.livePreviewActive){this.hideSizers(),i==mxEvent.ROTATION_HANDLE?this.rotationShape.node.style.display="":i==mxEvent.LABEL_HANDLE?this.labelShape.node.style.display="":this.sizers!=null&&this.sizers[i]!=null?this.sizers[i].node.style.display="":i<=mxEvent.CUSTOM_HANDLE&&this.customHandles!=null&&this.customHandles[mxEvent.CUSTOM_HANDLE-i].setVisible(!0);var o=this.graph.getEdges(this.state.cell);this.edgeHandlers=[];for(var u=0;uthis.graph.tolerance||Math.abs(t.getGraphY()-this.startY)>this.graph.tolerance)&&(this.inTolerance=!1)},mxVertexHandler.prototype.updateHint=function(t){},mxVertexHandler.prototype.removeHint=function(){},mxVertexHandler.prototype.roundAngle=function(t){return Math.round(t*10)/10},mxVertexHandler.prototype.roundLength=function(t){return Math.round(t*100)/100},mxVertexHandler.prototype.mouseMove=function(t,e){!e.isConsumed()&&this.index!=null?(this.checkTolerance(e),this.inTolerance||(this.index<=mxEvent.CUSTOM_HANDLE?this.customHandles!=null&&(this.customHandles[mxEvent.CUSTOM_HANDLE-this.index].processEvent(e),this.customHandles[mxEvent.CUSTOM_HANDLE-this.index].active=!0,this.ghostPreview!=null?(this.ghostPreview.apply(this.state),this.ghostPreview.strokewidth=this.getSelectionStrokeWidth()/this.ghostPreview.scale/this.ghostPreview.scale,this.ghostPreview.isDashed=this.isSelectionDashed(),this.ghostPreview.stroke=this.getSelectionColor(),this.ghostPreview.redraw(),this.selectionBounds!=null&&(this.selectionBorder.node.style.display="none")):(this.movePreviewToFront&&this.moveToFront(),this.customHandles[mxEvent.CUSTOM_HANDLE-this.index].positionChanged())):this.index==mxEvent.LABEL_HANDLE?this.moveLabel(e):(this.index==mxEvent.ROTATION_HANDLE?this.rotateVertex(e):this.resizeVertex(e),this.updateHint(e))),e.consume()):!this.graph.isMouseDown&&this.getHandleForEvent(e)!=null&&e.consume(!1)},mxVertexHandler.prototype.isGhostPreview=function(){return this.state.view.graph.model.getChildCount(this.state.cell)>0},mxVertexHandler.prototype.moveLabel=function(t){var e=new mxPoint(t.getGraphX(),t.getGraphY()),i=this.graph.view.translate,n=this.graph.view.scale;this.graph.isGridEnabledEvent(t.getEvent())&&(e.x=(this.graph.snap(e.x/n-i.x)+i.x)*n,e.y=(this.graph.snap(e.y/n-i.y)+i.y)*n);var r=this.rotationShape!=null?this.sizers.length-2:this.sizers.length-1;this.moveSizerTo(this.sizers[r],e.x,e.y)},mxVertexHandler.prototype.rotateVertex=function(t){var e=new mxPoint(t.getGraphX(),t.getGraphY()),i=this.state.x+this.state.width/2-e.x,n=this.state.y+this.state.height/2-e.y;if(this.currentAlpha=i!=0?Math.atan(n/i)*180/Math.PI+90:n<0?180:0,i>0&&(this.currentAlpha-=180),this.currentAlpha-=this.startAngle,this.rotationRaster&&this.graph.isGridEnabledEvent(t.getEvent())){var i=e.x-this.state.getCenterX(),n=e.y-this.state.getCenterY(),r=Math.sqrt(i*i+n*n);r-this.startDist<2?raster=15:r-this.startDist<25?raster=5:raster=1,this.currentAlpha=Math.round(this.currentAlpha/raster)*raster}else this.currentAlpha=this.roundAngle(this.currentAlpha);this.selectionBorder.rotation=this.currentAlpha,this.selectionBorder.redraw(),this.livePreviewActive&&this.redrawHandles()},mxVertexHandler.prototype.resizeVertex=function(t){var e=new mxPoint(this.state.getCenterX(),this.state.getCenterY()),i=mxUtils.toRadians(this.state.style[mxConstants.STYLE_ROTATION]||"0"),n=new mxPoint(t.getGraphX(),t.getGraphY()),r=this.graph.view.translate,s=this.graph.view.scale,l=Math.cos(-i),a=Math.sin(-i),c=n.x-this.startX,v=n.y-this.startY,o=l*c-a*v,u=a*c+l*v;c=o,v=u;var p=this.graph.getCellGeometry(this.state.cell);if(this.unscaledBounds=this.union(p,c/s,v/s,this.index,this.graph.isGridEnabledEvent(t.getEvent()),1,new mxPoint(0,0),this.isConstrainedEvent(t),this.isCenteredEvent(this.state,t)),!p.relative){var m=this.graph.getMaximumGraphBounds();if(m!=null&&this.parentState!=null&&(m=mxRectangle.fromRectangle(m),m.x-=(this.parentState.x-r.x*s)/s,m.y-=(this.parentState.y-r.y*s)/s),this.graph.isConstrainChild(this.state.cell)){var d=this.graph.getCellContainmentArea(this.state.cell);if(d!=null){var x=this.graph.getOverlap(this.state.cell);x>0&&(d=mxRectangle.fromRectangle(d),d.x-=d.width*x,d.y-=d.height*x,d.width+=2*d.width*x,d.height+=2*d.height*x),m==null?m=d:(m=mxRectangle.fromRectangle(m),m.intersect(d))}}m!=null&&(this.unscaledBounds.xm.x+m.width&&(this.unscaledBounds.width-=this.unscaledBounds.x+this.unscaledBounds.width-m.x-m.width),this.unscaledBounds.y+this.unscaledBounds.height>m.y+m.height&&(this.unscaledBounds.height-=this.unscaledBounds.y+this.unscaledBounds.height-m.y-m.height))}var f=this.bounds;this.bounds=new mxRectangle((this.parentState!=null?this.parentState.x:r.x*s)+this.unscaledBounds.x*s,(this.parentState!=null?this.parentState.y:r.y*s)+this.unscaledBounds.y*s,this.unscaledBounds.width*s,this.unscaledBounds.height*s),p.relative&&this.parentState!=null&&(this.bounds.x+=this.state.x-this.parentState.x,this.bounds.y+=this.state.y-this.parentState.y),l=Math.cos(i),a=Math.sin(i);var g=new mxPoint(this.bounds.getCenterX(),this.bounds.getCenterY()),c=g.x-e.x,v=g.y-e.y,y=l*c-a*v,T=a*c+l*v,C=y-c,S=T-v,E=this.bounds.x-this.state.x,L=this.bounds.y-this.state.y,A=l*E-a*L,M=a*E+l*L;this.bounds.x+=C,this.bounds.y+=S,this.unscaledBounds.x=this.roundLength(this.unscaledBounds.x+C/s),this.unscaledBounds.y=this.roundLength(this.unscaledBounds.y+S/s),this.unscaledBounds.width=this.roundLength(this.unscaledBounds.width),this.unscaledBounds.height=this.roundLength(this.unscaledBounds.height),!this.graph.isCellCollapsed(this.state.cell)&&(C!=0||S!=0)?(this.childOffsetX=this.state.x-this.bounds.x+A,this.childOffsetY=this.state.y-this.bounds.y+M):(this.childOffsetX=0,this.childOffsetY=0),f.equals(this.bounds)||(this.livePreviewActive&&this.updateLivePreview(t),this.preview!=null?this.drawPreview():this.updateParentHighlight())},mxVertexHandler.prototype.updateLivePreview=function(t){var e=this.graph.view.scale,i=this.graph.view.translate,n=this.state.clone();this.state.x=this.bounds.x,this.state.y=this.bounds.y,this.state.origin=new mxPoint(this.state.x/e-i.x,this.state.y/e-i.y),this.state.width=this.bounds.width,this.state.height=this.bounds.height;var r=this.state.absoluteOffset;r=new mxPoint(r.x,r.y),this.state.absoluteOffset.x=0,this.state.absoluteOffset.y=0;var s=this.graph.getCellGeometry(this.state.cell);if(s!=null){var l=s.offset||this.EMPTY_POINT;l!=null&&!s.relative&&(this.state.absoluteOffset.x=this.state.view.scale*l.x,this.state.absoluteOffset.y=this.state.view.scale*l.y),this.state.view.updateVertexLabelOffset(this.state)}this.state.view.graph.cellRenderer.redraw(this.state,!0),this.state.view.invalidate(this.state.cell),this.state.invalid=!1,this.state.view.validate(),this.redrawHandles(),this.movePreviewToFront&&this.moveToFront(),this.state.control!=null&&this.state.control.node!=null&&(this.state.control.node.style.visibility="hidden"),this.state.setState(n)},mxVertexHandler.prototype.moveToFront=function(){(this.state.text!=null&&this.state.text.node!=null&&this.state.text.node.nextSibling!=null||this.state.shape!=null&&this.state.shape.node!=null&&this.state.shape.node.nextSibling!=null&&(this.state.text==null||this.state.shape.node.nextSibling!=this.state.text.node))&&(this.state.shape!=null&&this.state.shape.node!=null&&this.state.shape.node.parentNode.appendChild(this.state.shape.node),this.state.text!=null&&this.state.text.node!=null&&this.state.text.node.parentNode.appendChild(this.state.text.node))},mxVertexHandler.prototype.mouseUp=function(t,e){if(this.index!=null&&this.state!=null){var i=new mxPoint(e.getGraphX(),e.getGraphY()),n=this.index;this.index=null,this.ghostPreview==null&&(this.state.view.invalidate(this.state.cell,!1,!1),this.state.view.validate()),this.graph.getModel().beginUpdate();try{if(n<=mxEvent.CUSTOM_HANDLE){if(this.customHandles!=null){var r=this.state.view.graph.getCellStyle(this.state.cell);this.customHandles[mxEvent.CUSTOM_HANDLE-n].active=!1,this.customHandles[mxEvent.CUSTOM_HANDLE-n].execute(e),this.customHandles!=null&&this.customHandles[mxEvent.CUSTOM_HANDLE-n]!=null&&(this.state.style=r,this.customHandles[mxEvent.CUSTOM_HANDLE-n].positionChanged())}}else if(n==mxEvent.ROTATION_HANDLE)if(this.currentAlpha!=null){var s=this.currentAlpha-(this.state.style[mxConstants.STYLE_ROTATION]||0);s!=0&&this.rotateCell(this.state.cell,s)}else this.rotateClick();else{var l=this.graph.isGridEnabledEvent(e.getEvent()),a=mxUtils.toRadians(this.state.style[mxConstants.STYLE_ROTATION]||"0"),o=Math.cos(-a),u=Math.sin(-a),p=i.x-this.startX,m=i.y-this.startY,d=o*p-u*m,x=u*p+o*m;p=d,m=x;var f=this.graph.view.scale,g=this.isRecursiveResize(this.state,e);this.resizeCell(this.state.cell,this.roundLength(p/f),this.roundLength(m/f),n,l,this.isConstrainedEvent(e),g)}}finally{this.graph.getModel().endUpdate()}e.consume(),this.reset(),this.redrawHandles()}},mxVertexHandler.prototype.isRecursiveResize=function(t,e){return this.graph.isRecursiveResize(this.state)},mxVertexHandler.prototype.rotateClick=function(){},mxVertexHandler.prototype.rotateCell=function(t,e,i){if(e!=0){var n=this.graph.getModel();if(n.isVertex(t)||n.isEdge(t)){if(!n.isEdge(t)){var r=this.graph.getCurrentCellStyle(t),s=(r[mxConstants.STYLE_ROTATION]||0)+e;this.graph.setCellStyles(mxConstants.STYLE_ROTATION,s,[t])}var l=this.graph.getCellGeometry(t);if(l!=null){var a=this.graph.getCellGeometry(i);if(a!=null&&!n.isEdge(i)&&(l=l.clone(),l.rotate(e,new mxPoint(a.width/2,a.height/2)),n.setGeometry(t,l)),n.isVertex(t)&&!l.relative||n.isEdge(t))for(var o=n.getChildCount(t),u=0;u4?(v=v+i,r?v=this.graph.snap(v/s)*s:v=Math.round(v/s)*s):n<3&&(c=c+i,r?c=this.graph.snap(c/s)*s:c=Math.round(c/s)*s),n==0||n==3||n==5?(f+=e,r?f=this.graph.snap(f/s)*s:f=Math.round(f/s)*s):(n==2||n==4||n==7)&&(g+=e,r?g=this.graph.snap(g/s)*s:g=Math.round(g/s)*s);var C=g-f,S=v-c;if(a){var E=this.graph.getCellGeometry(this.state.cell);if(E!=null){var L=E.width/E.height;n==1||n==2||n==7||n==6?C=S*L:S=C/L,n==0&&(f=g-C,c=v-S)}}if(o){C+=C-d,S+=S-x;var A=y-(f+C/2),M=T-(c+S/2);f+=A,c+=M,g+=A,v+=M}C<0&&(f+=C,C=Math.abs(C)),S<0&&(c+=S,S=Math.abs(S));var I=new mxRectangle(f+l.x*s,c+l.y*s,C,S);return this.minBounds!=null&&(I.width=Math.max(I.width,this.minBounds.x*s+this.minBounds.width*s+Math.max(0,this.x0*s-I.x)),I.height=Math.max(I.height,this.minBounds.y*s+this.minBounds.height*s+Math.max(0,this.y0*s-I.y))),I}},mxVertexHandler.prototype.redraw=function(t){this.selectionBounds=this.getSelectionBounds(this.state),this.bounds=new mxRectangle(this.selectionBounds.x,this.selectionBounds.y,this.selectionBounds.width,this.selectionBounds.height),this.drawPreview(),t||this.redrawHandles()},mxVertexHandler.prototype.getHandlePadding=function(){var t=new mxPoint(0,0),e=this.tolerance;return this.sizers!=null&&this.sizers.length>0&&this.sizers[0]!=null&&(this.bounds.width<2*this.sizers[0].bounds.width+2*e||this.bounds.height<2*this.sizers[0].bounds.height+2*e)&&(e/=2,t.x=this.sizers[0].bounds.width+e,t.y=this.sizers[0].bounds.height+e),t},mxVertexHandler.prototype.getSizerBounds=function(){return this.bounds},mxVertexHandler.prototype.redrawHandles=function(){var t=this.getSizerBounds(),e=this.tolerance;if(this.horizontalOffset=0,this.verticalOffset=0,this.customHandles!=null)for(var i=0;i0&&this.sizers[0]!=null){if(this.index==null&&this.manageSizers&&this.sizers.length>=8){var r=this.getHandlePadding();this.horizontalOffset=r.x,this.verticalOffset=r.y,(this.horizontalOffset!=0||this.verticalOffset!=0)&&(t=new mxRectangle(t.x,t.y,t.width,t.height),t.x-=this.horizontalOffset/2,t.width+=this.horizontalOffset,t.y-=this.verticalOffset/2,t.height+=this.verticalOffset),this.sizers.length>=8&&(t.width<2*this.sizers[0].bounds.width+2*e||t.height<2*this.sizers[0].bounds.height+2*e?(this.sizers[0].node.style.display="none",this.sizers[2].node.style.display="none",this.sizers[5].node.style.display="none",this.sizers[7].node.style.display="none"):this.handlesVisible&&(this.sizers[0].node.style.display="",this.sizers[2].node.style.display="",this.sizers[5].node.style.display="",this.sizers[7].node.style.display=""))}var s=t.x+t.width,l=t.y+t.height;if(this.singleSizer)this.moveSizerTo(this.sizers[0],s,l);else{var a=t.x+t.width/2,o=t.y+t.height/2;if(this.sizers.length>=8){var u=["nw-resize","n-resize","ne-resize","e-resize","se-resize","s-resize","sw-resize","w-resize"],p=mxUtils.toRadians(this.state.style[mxConstants.STYLE_ROTATION]||"0"),m=Math.cos(p),d=Math.sin(p),x=Math.round(p*4/Math.PI),f=new mxPoint(t.getCenterX(),t.getCenterY()),g=mxUtils.getRotatedPoint(new mxPoint(t.x,t.y),m,d,f);this.moveSizerTo(this.sizers[0],g.x,g.y),this.sizers[0].setCursor(u[mxUtils.mod(0+x,u.length)]),g.x=a,g.y=t.y,g=mxUtils.getRotatedPoint(g,m,d,f),this.moveSizerTo(this.sizers[1],g.x,g.y),this.sizers[1].setCursor(u[mxUtils.mod(1+x,u.length)]),g.x=s,g.y=t.y,g=mxUtils.getRotatedPoint(g,m,d,f),this.moveSizerTo(this.sizers[2],g.x,g.y),this.sizers[2].setCursor(u[mxUtils.mod(2+x,u.length)]),g.x=t.x,g.y=o,g=mxUtils.getRotatedPoint(g,m,d,f),this.moveSizerTo(this.sizers[3],g.x,g.y),this.sizers[3].setCursor(u[mxUtils.mod(7+x,u.length)]),g.x=s,g.y=o,g=mxUtils.getRotatedPoint(g,m,d,f),this.moveSizerTo(this.sizers[4],g.x,g.y),this.sizers[4].setCursor(u[mxUtils.mod(3+x,u.length)]),g.x=t.x,g.y=l,g=mxUtils.getRotatedPoint(g,m,d,f),this.moveSizerTo(this.sizers[5],g.x,g.y),this.sizers[5].setCursor(u[mxUtils.mod(6+x,u.length)]),g.x=a,g.y=l,g=mxUtils.getRotatedPoint(g,m,d,f),this.moveSizerTo(this.sizers[6],g.x,g.y),this.sizers[6].setCursor(u[mxUtils.mod(5+x,u.length)]),g.x=s,g.y=l,g=mxUtils.getRotatedPoint(g,m,d,f),this.moveSizerTo(this.sizers[7],g.x,g.y),this.sizers[7].setCursor(u[mxUtils.mod(4+x,u.length)]),g.x=a+this.state.absoluteOffset.x,g.y=o+this.state.absoluteOffset.y,g=mxUtils.getRotatedPoint(g,m,d,f),this.moveSizerTo(this.sizers[8],g.x,g.y)}else this.state.width>=2&&this.state.height>=2?this.moveSizerTo(this.sizers[0],a+this.state.absoluteOffset.x,o+this.state.absoluteOffset.y):this.moveSizerTo(this.sizers[0],this.state.x,this.state.y)}}if(this.rotationShape!=null){var p=mxUtils.toRadians(this.currentAlpha!=null?this.currentAlpha:this.state.style[mxConstants.STYLE_ROTATION]||"0"),m=Math.cos(p),d=Math.sin(p),f=new mxPoint(this.state.getCenterX(),this.state.getCenterY()),g=mxUtils.getRotatedPoint(this.getRotationHandlePosition(),m,d,f);this.rotationShape.node!=null&&(this.moveSizerTo(this.rotationShape,g.x,g.y),this.rotationShape.node.style.visibility=this.state.view.graph.isEditing()||!this.handlesVisible?"hidden":"")}if(this.selectionBorder!=null&&(this.selectionBorder.rotation=Number(this.state.style[mxConstants.STYLE_ROTATION]||"0")),this.edgeHandlers!=null)for(var i=0;i0)?new mxRectangle(t.getGraphX()-i,t.getGraphY()-i,2*i,2*i):null,r=null;if(this.customHandles!=null&&this.isCustomHandleEvent(t)){for(var s=this.customHandles.length-1;s>=0;s--)if(l(this.customHandles[s].shape))return mxEvent.CUSTOM_HANDLE-s}if((t.isSource(this.state.text)||l(this.labelShape))&&(e=mxEvent.LABEL_HANDLE),this.bends!=null)for(var s=0;smxEvent.VIRTUAL_HANDLE&&this.customHandles!=null)for(var s=0;s0&&this.isSnapToTerminalsEvent(t)){let u=function(m){if(m!=null){var d=m.x;Math.abs(n.x-d)0&&fmxEvent.VIRTUAL_HANDLE&&(n[this.index-1]=r)}else this.graph.resetEdgesOnConnect&&(n=null);return s??n},mxEdgeHandler.prototype.isOutlineConnectEvent=function(t){var e=mxUtils.getOffset(this.graph.container),i=t.getEvent(),n=mxEvent.getClientX(i),r=mxEvent.getClientY(i),s=document.documentElement,l=(window.pageXOffset||s.scrollLeft)-(s.clientLeft||0),a=(window.pageYOffset||s.scrollTop)-(s.clientTop||0),o=this.currentPoint.x-this.graph.container.scrollLeft+e.x-l,u=this.currentPoint.y-this.graph.container.scrollTop+e.y-a;return this.outlineConnect&&!mxEvent.isShiftDown(t.getEvent())&&(t.isSource(this.marker.highlight.shape)||mxEvent.isAltDown(t.getEvent())&&t.getState()!=null||this.marker.highlight.isHighlightAt(n,r)||(o!=n||u!=r)&&t.getState()==null&&this.marker.highlight.isHighlightAt(o,u))},mxEdgeHandler.prototype.updatePreviewState=function(t,e,i,n,r){var s=this.isSource?i:this.state.getVisibleTerminalState(!0),l=this.isTarget?i:this.state.getVisibleTerminalState(!1),a=this.graph.getConnectionConstraint(t,s,!0),o=this.graph.getConnectionConstraint(t,l,!1),u=this.constraintHandler.currentConstraint;if(u==null&&r&&(i!=null?(n.isSource(this.marker.highlight.shape)&&(e=new mxPoint(n.getGraphX(),n.getGraphY())),u=this.graph.getOutlineConstraint(e,i,n),this.constraintHandler.setFocus(n,i,this.isSource),this.constraintHandler.currentConstraint=u,this.constraintHandler.currentPoint=e):u=new mxConnectionConstraint),this.outlineConnect&&this.marker.highlight!=null&&this.marker.highlight.shape!=null){var p=this.graph.view.scale;this.constraintHandler.currentConstraint!=null&&this.constraintHandler.currentFocus!=null?(this.marker.highlight.shape.stroke=r?mxConstants.OUTLINE_HIGHLIGHT_COLOR:"transparent",this.marker.highlight.shape.strokewidth=mxConstants.OUTLINE_HIGHLIGHT_STROKEWIDTH/p/p,this.marker.highlight.repaint()):this.marker.hasValidState()&&(this.marker.highlight.shape.stroke=this.graph.isCellConnectable(n.getCell())&&this.marker.getValidState()!=n.getState()?"transparent":mxConstants.DEFAULT_VALID_COLOR,this.marker.highlight.shape.strokewidth=mxConstants.HIGHLIGHT_STROKEWIDTH/p/p,this.marker.highlight.repaint())}this.isSource?a=u:this.isTarget&&(o=u),(this.isSource||this.isTarget)&&(u!=null&&u.point!=null?(t.style[this.isSource?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X]=u.point.x,t.style[this.isSource?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y]=u.point.y):(delete t.style[this.isSource?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X],delete t.style[this.isSource?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y])),t.setVisibleTerminalState(s,!0),t.setVisibleTerminalState(l,!1),(!this.isSource||s!=null)&&t.view.updateFixedTerminalPoint(t,s,!0,a),(!this.isTarget||l!=null)&&t.view.updateFixedTerminalPoint(t,l,!1,o),(this.isSource||this.isTarget)&&i==null&&(t.setAbsoluteTerminalPoint(e,this.isSource),this.marker.getMarkedState()==null&&(this.error=this.graph.allowDanglingEdges?null:"")),t.view.updatePoints(t,this.points,s,l),t.view.updateFloatingTerminalPoints(t,s,l)},mxEdgeHandler.prototype.mouseMove=function(t,e){if(this.index!=null&&this.marker!=null){if(this.currentPoint=this.getPointForEvent(e),this.error=null,!this.graph.isIgnoreTerminalEvent(e.getEvent())&&mxEvent.isShiftDown(e.getEvent())&&this.snapPoint!=null&&(Math.abs(this.snapPoint.x-this.currentPoint.x)mxEvent.VIRTUAL_HANDLE)this.customHandles!=null&&(this.customHandles[mxEvent.CUSTOM_HANDLE-this.index].processEvent(e),this.customHandles[mxEvent.CUSTOM_HANDLE-this.index].positionChanged(),this.shape!=null&&this.shape.node!=null&&(this.shape.node.style.display="none"));else if(this.isLabel)this.label.x=this.currentPoint.x,this.label.y=this.currentPoint.y;else{this.points=this.getPreviewPoints(this.currentPoint,e);var i=this.isSource||this.isTarget?this.getPreviewTerminalState(e):null;if(this.constraintHandler.currentConstraint!=null&&this.constraintHandler.currentFocus!=null&&this.constraintHandler.currentPoint!=null)this.currentPoint=this.constraintHandler.currentPoint.clone();else if(this.outlineConnect){var n=this.isSource||this.isTarget?this.isOutlineConnectEvent(e):!1;n?i=this.marker.highlight.state:i!=null&&i!=e.getState()&&this.graph.isCellConnectable(e.getCell())&&this.marker.highlight.shape!=null&&(this.marker.highlight.shape.stroke="transparent",this.marker.highlight.repaint(),i=null)}i!=null&&!this.isCellEnabled(i.cell)&&(i=null,this.marker.reset());var r=this.clonePreviewState(this.currentPoint,i!=null?i.cell:null);this.updatePreviewState(r,this.currentPoint,i,e,n);var s=this.error==null?this.marker.validColor:this.marker.invalidColor;this.setPreviewColor(s),this.abspoints=r.absolutePoints,this.active=!0,this.updateHint(e,this.currentPoint)}this.drawPreview(),mxEvent.consume(e.getEvent()),e.consume()}else mxClient.IS_IE&&this.getHandleForEvent(e)!=null&&e.consume(!1)},mxEdgeHandler.prototype.mouseUp=function(t,e){if(this.index!=null&&this.marker!=null){this.shape!=null&&this.shape.node!=null&&(this.shape.node.style.display="");var i=this.state.cell,n=this.index;if(this.index=null,e.getX()!=this.startX||e.getY()!=this.startY){var r=!this.graph.isIgnoreTerminalEvent(e.getEvent())&&this.graph.isCloneEvent(e.getEvent())&&this.cloneEnabled&&this.graph.isCellsCloneable();if(this.error!=null)this.error.length>0&&this.graph.validationAlert(this.error);else if(n<=mxEvent.CUSTOM_HANDLE&&n>mxEvent.VIRTUAL_HANDLE){if(this.customHandles!=null){var s=this.graph.getModel();s.beginUpdate();try{this.customHandles[mxEvent.CUSTOM_HANDLE-n].execute(e),this.shape!=null&&this.shape.node!=null&&(this.shape.apply(this.state),this.shape.redraw())}finally{s.endUpdate()}}}else if(this.isLabel)this.moveLabel(this.state,this.label.x,this.label.y);else if(this.isSource||this.isTarget){var l=null;if(this.constraintHandler.currentConstraint!=null&&this.constraintHandler.currentFocus!=null&&(l=this.constraintHandler.currentFocus.cell),l==null&&this.marker.hasValidState()&&this.marker.highlight!=null&&this.marker.highlight.shape!=null&&this.marker.highlight.shape.stroke!="transparent"&&this.marker.highlight.shape.stroke!="white"&&(l=this.marker.validState.cell),l!=null){var s=this.graph.getModel(),a=s.getParent(i);s.beginUpdate();try{if(r){var o=s.getGeometry(i),r=this.graph.cloneCell(i);s.add(a,r,s.getChildCount(a)),o!=null&&(o=o.clone(),s.setGeometry(r,o));var u=s.getTerminal(i,!this.isSource);this.graph.connectCell(r,u,!this.isSource),i=r}i=this.connect(i,l,this.isSource,r,e)}finally{s.endUpdate()}}else if(this.graph.isAllowDanglingEdges()){var p=this.abspoints[this.isSource?0:this.abspoints.length-1];p.x=this.roundLength(p.x/this.graph.view.scale-this.graph.view.translate.x),p.y=this.roundLength(p.y/this.graph.view.scale-this.graph.view.translate.y);var m=this.graph.getView().getState(this.graph.getModel().getParent(i));m!=null&&(p.x-=m.origin.x,p.y-=m.origin.y),p.x-=this.graph.panDx/this.graph.view.scale,p.y-=this.graph.panDy/this.graph.view.scale,i=this.changeTerminalPoint(i,p,this.isSource,r)}}else this.active?i=this.changePoints(i,this.points,r):(this.graph.getView().invalidate(this.state.cell),this.graph.getView().validate(this.state.cell))}else this.graph.isToggleEvent(e.getEvent())&&this.graph.selectCellForEvent(this.state.cell,e.getEvent());this.marker!=null&&(this.reset(),i!=this.state.cell&&this.graph.setSelectionCell(i)),e.consume()}},mxEdgeHandler.prototype.reset=function(){if(this.active&&this.refresh(),this.error=null,this.index=null,this.label=null,this.points=null,this.snapPoint=null,this.isLabel=!1,this.isSource=!1,this.isTarget=!1,this.active=!1,this.livePreview&&this.sizers!=null)for(var t=0;t0&&e0&&i!=null){this.points==null&&(this.points=[]);for(var n=1;n0&&this.graph.isLabelMovable(t),this.bends!=null&&this.bends.length>0){var n=this.abspoints.length-1,r=this.abspoints[0],s=r.x,l=r.y;e=this.bends[0].bounds,this.bends[0].bounds=new mxRectangle(Math.floor(s-e.width/2),Math.floor(l-e.height/2),e.width,e.height),this.bends[0].fill=this.getHandleFillColor(0),this.bends[0].redraw(),this.manageLabelHandle&&this.checkLabelHandle(this.bends[0].bounds);var a=this.abspoints[n],o=a.x,u=a.y,p=this.bends.length-1;e=this.bends[p].bounds,this.bends[p].bounds=new mxRectangle(Math.floor(o-e.width/2),Math.floor(u-e.height/2),e.width,e.height),this.bends[p].fill=this.getHandleFillColor(p),this.bends[p].redraw(),this.manageLabelHandle&&this.checkLabelHandle(this.bends[p].bounds),this.redrawInnerBends(r,a)}if(this.abspoints!=null&&this.virtualBends!=null&&this.virtualBends.length>0){for(var m=this.abspoints[0],d=0;d1?(t=n[1],e=n[n.length-2]):i.points!=null&&i.points.length>0&&(r=n[0]),r==null?r=new mxPoint(t.x+(e.x-t.x)/2,t.y+(e.y-t.y)/2):r=new mxPoint(this.graph.getView().scale*(r.x+this.graph.getView().translate.x+this.state.origin.x),this.graph.getView().scale*(r.y+this.graph.getView().translate.y+this.state.origin.y));var s=this.bends[1].bounds,l=s.width,a=s.height,o=new mxRectangle(Math.round(r.x-l/2),Math.round(r.y-a/2),l,a);this.manageLabelHandle?this.checkLabelHandle(o):this.handleImage==null&&this.labelShape.visible&&mxUtils.intersects(o,this.labelShape.bounds)&&(l=mxConstants.HANDLE_SIZE+3,a=mxConstants.HANDLE_SIZE+3,o=new mxRectangle(Math.floor(r.x-l/2),Math.floor(r.y-a/2),l,a)),this.bends[1].bounds=o,this.bends[1].redraw(),this.manageLabelHandle&&this.checkLabelHandle(this.bends[1].bounds)},__mxOutput.mxElbowEdgeHandler=typeof mxElbowEdgeHandler<"u"?mxElbowEdgeHandler:void 0;function mxEdgeSegmentHandler(t){mxEdgeHandler.call(this,t)}mxUtils.extend(mxEdgeSegmentHandler,mxElbowEdgeHandler),mxEdgeSegmentHandler.prototype.getCurrentPoints=function(){var t=this.state.absolutePoints;if(t!=null){var e=Math.max(1,this.graph.view.scale);if(t.length==2||t.length==3&&(Math.abs(t[0].x-t[1].x)0){var o=this.abspoints,u=o[0],p=o[1];a=[];for(var m=2;m1){var n=!1;if(i.length==4&&Math.round(i[1].x-i[2].x)==0&&Math.round(i[1].y-i[2].y)==0)if(n=!0,Math.round(i[0].y-i[i.length-1].y)==0){var r=i[0].x+(i[i.length-1].x-i[0].x)/2;i[1]=new mxPoint(r,i[1].y),i[2]=new mxPoint(r,i[2].y)}else{var s=i[0].y+(i[i.length-1].y-i[0].y)/2;i[1]=new mxPoint(i[1].x,s),i[2]=new mxPoint(i[2].x,s)}for(var l=0;l0){this.div==null&&this.init();var n=mxUtils.getScrollOrigin();this.div.style.zIndex=this.zIndex,this.div.style.left=e+n.x+"px",this.div.style.top=i+mxConstants.TOOLTIP_VERTICAL_OFFSET+n.y+"px",mxUtils.isNode(t)?(this.div.innerHTML="",this.div.appendChild(t)):this.div.innerHTML=t.replace(/\n/g,"
"),this.div.style.visibility="",mxUtils.fit(this.div)}},mxTooltipHandler.prototype.destroy=function(){this.destroyed||(this.graph.removeMouseListener(this),mxEvent.release(this.div),this.div!=null&&this.div.parentNode!=null&&this.div.parentNode.removeChild(this.div),this.destroyed=!0,this.div=null)},__mxOutput.mxTooltipHandler=typeof mxTooltipHandler<"u"?mxTooltipHandler:void 0;function mxCellTracker(t,e,i){mxCellMarker.call(this,t,e),this.graph.addMouseListener(this),i!=null&&(this.getCell=i),mxClient.IS_IE&&mxEvent.addListener(window,"unload",mxUtils.bind(this,function(){this.destroy()}))}mxUtils.extend(mxCellTracker,mxCellMarker),mxCellTracker.prototype.mouseDown=function(t,e){},mxCellTracker.prototype.mouseMove=function(t,e){this.isEnabled()&&this.process(e)},mxCellTracker.prototype.mouseUp=function(t,e){},mxCellTracker.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,this.graph.removeMouseListener(this),mxCellMarker.prototype.destroy.apply(this))},__mxOutput.mxCellTracker=typeof mxCellTracker<"u"?mxCellTracker:void 0;function mxCellHighlight(t,e,i,n){t!=null&&(this.graph=t,this.highlightColor=e??mxConstants.DEFAULT_VALID_COLOR,this.strokeWidth=i??mxConstants.HIGHLIGHT_STROKEWIDTH,this.dashed=n??!1,this.opacity=mxConstants.HIGHLIGHT_OPACITY,this.repaintHandler=mxUtils.bind(this,function(){if(this.state!=null){var r=this.graph.view.getState(this.state.cell);r==null?this.hide():(this.state=r,this.repaint())}}),this.graph.getView().addListener(mxEvent.SCALE,this.repaintHandler),this.graph.getView().addListener(mxEvent.TRANSLATE,this.repaintHandler),this.graph.getView().addListener(mxEvent.SCALE_AND_TRANSLATE,this.repaintHandler),this.graph.getModel().addListener(mxEvent.CHANGE,this.repaintHandler),this.resetHandler=mxUtils.bind(this,function(){this.hide()}),this.graph.getView().addListener(mxEvent.DOWN,this.resetHandler),this.graph.getView().addListener(mxEvent.UP,this.resetHandler))}mxCellHighlight.prototype.keepOnTop=!1,mxCellHighlight.prototype.graph=null,mxCellHighlight.prototype.state=null,mxCellHighlight.prototype.spacing=2,mxCellHighlight.prototype.resetHandler=null,mxCellHighlight.prototype.setHighlightColor=function(t){this.highlightColor=t,this.shape!=null&&(this.shape.stroke=t)},mxCellHighlight.prototype.drawHighlight=function(){this.shape=this.createShape(),this.repaint(),!this.keepOnTop&&this.shape.node.parentNode.firstChild!=this.shape.node&&this.shape.node.parentNode.insertBefore(this.shape.node,this.shape.node.parentNode.firstChild)},mxCellHighlight.prototype.createShape=function(){var t=this.graph.cellRenderer.createShape(this.state);return t.svgStrokeTolerance=this.graph.tolerance,t.points=this.state.absolutePoints,t.apply(this.state),t.stroke=this.highlightColor,t.opacity=this.opacity,t.isDashed=this.dashed,t.isShadow=!1,t.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,t.init(this.graph.getView().getOverlayPane()),mxEvent.redirectMouseEvents(t.node,this.graph,this.state),this.graph.dialect!=mxConstants.DIALECT_SVG?t.pointerEvents=!1:t.svgPointerEvents="stroke",t},mxCellHighlight.prototype.getStrokeWidth=function(t){return this.strokeWidth},mxCellHighlight.prototype.repaint=function(){this.state!=null&&this.shape!=null&&(this.shape.scale=this.state.view.scale,this.graph.model.isEdge(this.state.cell)?(this.shape.strokewidth=this.getStrokeWidth(),this.shape.points=this.state.absolutePoints,this.shape.outline=!1):(this.shape.bounds=new mxRectangle(this.state.x-this.spacing,this.state.y-this.spacing,this.state.width+2*this.spacing,this.state.height+2*this.spacing),this.shape.rotation=Number(this.state.style[mxConstants.STYLE_ROTATION]||"0"),this.shape.strokewidth=this.getStrokeWidth()/this.state.view.scale,this.shape.outline=!0),this.state.shape!=null&&this.shape.setCursor(this.state.shape.getCursor()),(mxClient.IS_QUIRKS||document.documentMode==8)&&(this.shape.stroke=="transparent"?(this.shape.stroke="white",this.shape.opacity=1):this.shape.opacity=this.opacity),this.shape.redraw())},mxCellHighlight.prototype.hide=function(){this.highlight(null)},mxCellHighlight.prototype.highlight=function(t){this.state!=t&&(this.shape!=null&&(this.shape.destroy(),this.shape=null),this.state=t,this.state!=null&&this.drawHighlight())},mxCellHighlight.prototype.isHighlightAt=function(t,e){var i=!1;if(this.shape!=null&&document.elementFromPoint!=null&&!mxClient.IS_QUIRKS)for(var n=document.elementFromPoint(t,e);n!=null;){if(n==this.shape.node){i=!0;break}n=n.parentNode}return i},mxCellHighlight.prototype.destroy=function(){this.graph.getView().removeListener(this.resetHandler),this.graph.getView().removeListener(this.repaintHandler),this.graph.getModel().removeListener(this.repaintHandler),this.shape!=null&&(this.shape.destroy(),this.shape=null)},__mxOutput.mxCellHighlight=typeof mxCellHighlight<"u"?mxCellHighlight:void 0;function mxDefaultKeyHandler(t){if(t!=null){this.editor=t,this.handler=new mxKeyHandler(t.graph);var e=this.handler.escape;this.handler.escape=function(i){e.apply(this,arguments),t.hideProperties(),t.fireEvent(new mxEventObject(mxEvent.ESCAPE,"event",i))}}}mxDefaultKeyHandler.prototype.editor=null,mxDefaultKeyHandler.prototype.handler=null,mxDefaultKeyHandler.prototype.bindAction=function(t,e,i){var n=mxUtils.bind(this,function(){this.editor.execute(e)});i?this.handler.bindControlKey(t,n):this.handler.bindKey(t,n)},mxDefaultKeyHandler.prototype.destroy=function(){this.handler.destroy(),this.handler=null},__mxOutput.mxDefaultKeyHandler=typeof mxDefaultKeyHandler<"u"?mxDefaultKeyHandler:void 0;function mxDefaultPopupMenu(t){this.config=t}mxDefaultPopupMenu.prototype.imageBasePath=null,mxDefaultPopupMenu.prototype.config=null,mxDefaultPopupMenu.prototype.createMenu=function(t,e,i,n){if(this.config!=null){var r=this.createConditions(t,i,n),s=this.config.firstChild;this.addItems(t,e,i,n,r,s,null)}},mxDefaultPopupMenu.prototype.addItems=function(t,e,i,n,r,s,l){for(var a=!1;s!=null;){if(s.nodeName=="add"){var o=s.getAttribute("if");if(o==null||r[o]){var u=s.getAttribute("as");u=mxResources.get(u)||u;var p=mxUtils.eval(mxUtils.getTextContent(s)),m=s.getAttribute("action"),d=s.getAttribute("icon"),x=s.getAttribute("iconCls"),f=s.getAttribute("enabled-if"),g=f==null||r[f];a&&(e.addSeparator(l),a=!1),d!=null&&this.imageBasePath&&(d=this.imageBasePath+d);var c=this.addAction(e,t,u,d,p,m,i,l,x,g);this.addItems(t,e,i,n,r,s.firstChild,c)}}else s.nodeName=="separator"&&(a=!0);s=s.nextSibling}},mxDefaultPopupMenu.prototype.addAction=function(t,e,i,n,r,s,l,a,o,u){var p=function(m){typeof r=="function"&&r.call(e,e,l,m),s!=null&&e.execute(s,l,m)};return t.addItem(i,n,p,a,o,u)},mxDefaultPopupMenu.prototype.createConditions=function(t,e,i){var n=t.graph.getModel(),r=n.getChildCount(e),s=[];s.nocell=e==null,s.ncells=t.graph.getSelectionCount()>1,s.notRoot=n.getRoot()!=n.getParent(t.graph.getDefaultParent()),s.cell=e!=null;var l=e!=null&&t.graph.getSelectionCount()==1;s.nonEmpty=l&&r>0,s.expandable=l&&t.graph.isCellFoldable(e,!1),s.collapsable=l&&t.graph.isCellFoldable(e,!0),s.validRoot=l&&t.graph.isValidRoot(e),s.emptyValidRoot=s.validRoot&&r==0,s.swimlane=l&&t.graph.isSwimlane(e);for(var a=this.config.getElementsByTagName("condition"),o=0;o0&&this.editor.execute(i)});return this.toolbar.addItem(t,e,r,n)},mxDefaultToolbar.prototype.addSeparator=function(t){t=t||mxClient.imageBasePath+"/separator.gif",this.toolbar.addSeparator(t)},mxDefaultToolbar.prototype.addCombo=function(){return this.toolbar.addCombo()},mxDefaultToolbar.prototype.addActionCombo=function(t){return this.toolbar.addActionCombo(t)},mxDefaultToolbar.prototype.addActionOption=function(t,e,i){var n=mxUtils.bind(this,function(){this.editor.execute(i)});this.addOption(t,e,n)},mxDefaultToolbar.prototype.addOption=function(t,e,i){return this.toolbar.addOption(t,e,i)},mxDefaultToolbar.prototype.addMode=function(t,e,i,n,r){var s=mxUtils.bind(this,function(){this.editor.setMode(i),r!=null&&r(this.editor)});return this.toolbar.addSwitchMode(t,e,s,n)},mxDefaultToolbar.prototype.addPrototype=function(t,e,i,n,r,s){var l=mxUtils.bind(this,function(){return typeof i=="function"?i():i!=null?this.editor.graph.cloneCell(i):null}),a=mxUtils.bind(this,function(p,m){typeof r=="function"?r(this.editor,l(),p,m):this.drop(l(),p,m),this.toolbar.resetMode(),mxEvent.consume(p)}),o=this.toolbar.addMode(t,e,a,n,null,s),u=function(p,m,d){a(m,d)};return this.installDropHandler(o,u),o},mxDefaultToolbar.prototype.drop=function(t,e,i){var n=this.editor.graph,r=n.getModel();if(i==null||r.isEdge(i)||!this.connectOnDrop||!n.isCellConnectable(i)){for(;i!=null&&!n.isValidDropTarget(i,[t],e);)i=r.getParent(i);this.insert(t,e,i)}else this.connect(t,e,i)},mxDefaultToolbar.prototype.insert=function(t,e,i){var n=this.editor.graph;if(n.canImportCell(t)){var r=mxEvent.getClientX(e),s=mxEvent.getClientY(e),l=mxUtils.convertPoint(n.container,r,s);return n.isSplitEnabled()&&n.isSplitTarget(i,[t],e)?n.splitEdge(i,[t],null,l.x,l.y):this.editor.addVertex(i,t,l.x,l.y)}return null},mxDefaultToolbar.prototype.connect=function(t,e,i){var n=this.editor.graph,r=n.getModel();if(i!=null&&n.isCellConnectable(t)&&n.isEdgeValid(null,i,t)){var s=null;r.beginUpdate();try{var l=r.getGeometry(i),a=r.getGeometry(t).clone();a.x=l.x+(l.width-a.width)/2,a.y=l.y+(l.height-a.height)/2;var o=this.spacing*n.gridSize,u=r.getDirectedEdgeCount(i,!0)*20;this.editor.horizontalFlow?a.x+=(a.width+l.width)/2+o+u:a.y+=(a.height+l.height)/2+o+u,t.setGeometry(a);var p=r.getParent(i);if(n.addCell(t,p),n.constrainChild(t),s=this.editor.createEdge(i,t),r.getGeometry(s)==null){var m=new mxGeometry;m.relative=!0,r.setGeometry(s,m)}n.addEdge(s,p,i,t)}finally{r.endUpdate()}n.setSelectionCells([t,s]),n.scrollCellToVisible(t)}},mxDefaultToolbar.prototype.installDropHandler=function(t,e){var i=document.createElement("img");i.setAttribute("src",t.getAttribute("src"));var n=mxUtils.bind(this,function(r){i.style.width=2*t.offsetWidth+"px",i.style.height=2*t.offsetHeight+"px",mxUtils.makeDraggable(t,this.editor.graph,e,i),mxEvent.removeListener(i,"load",n)});mxClient.IS_IE?n():mxEvent.addListener(i,"load",n)},mxDefaultToolbar.prototype.destroy=function(){this.resetHandler!=null&&(this.editor.graph.removeListener("dblclick",this.resetHandler),this.editor.removeListener("escape",this.resetHandler),this.resetHandler=null),this.toolbar!=null&&(this.toolbar.destroy(),this.toolbar=null)},__mxOutput.mxDefaultToolbar=typeof mxDefaultToolbar<"u"?mxDefaultToolbar:void 0;function mxEditor(t){this.actions=[],this.addActions(),document.body!=null&&(this.cycleAttributeValues=[],this.popupHandler=new mxDefaultPopupMenu,this.undoManager=new mxUndoManager,this.graph=this.createGraph(),this.toolbar=this.createToolbar(),this.keyHandler=new mxDefaultKeyHandler(this),this.configure(t),this.graph.swimlaneIndicatorColorAttribute=this.cycleAttributeName,this.onInit!=null&&this.onInit(),mxClient.IS_IE&&mxEvent.addListener(window,"unload",mxUtils.bind(this,function(){this.destroy()})))}mxLoadResources?mxResources.add(mxClient.basePath+"/resources/editor"):mxClient.defaultBundles.push(mxClient.basePath+"/resources/editor"),mxEditor.prototype=new mxEventSource,mxEditor.prototype.constructor=mxEditor,mxEditor.prototype.askZoomResource=mxClient.language!="none"?"askZoom":"",mxEditor.prototype.lastSavedResource=mxClient.language!="none"?"lastSaved":"",mxEditor.prototype.currentFileResource=mxClient.language!="none"?"currentFile":"",mxEditor.prototype.propertiesResource=mxClient.language!="none"?"properties":"",mxEditor.prototype.tasksResource=mxClient.language!="none"?"tasks":"",mxEditor.prototype.helpResource=mxClient.language!="none"?"help":"",mxEditor.prototype.outlineResource=mxClient.language!="none"?"outline":"",mxEditor.prototype.outline=null,mxEditor.prototype.graph=null,mxEditor.prototype.graphRenderHint=null,mxEditor.prototype.toolbar=null,mxEditor.prototype.status=null,mxEditor.prototype.popupHandler=null,mxEditor.prototype.undoManager=null,mxEditor.prototype.keyHandler=null,mxEditor.prototype.actions=null,mxEditor.prototype.dblClickAction="edit",mxEditor.prototype.swimlaneRequired=!1,mxEditor.prototype.disableContextMenu=!0,mxEditor.prototype.insertFunction=null,mxEditor.prototype.forcedInserting=!1,mxEditor.prototype.templates=null,mxEditor.prototype.defaultEdge=null,mxEditor.prototype.defaultEdgeStyle=null,mxEditor.prototype.defaultGroup=null,mxEditor.prototype.groupBorderSize=null,mxEditor.prototype.filename=null,mxEditor.prototype.linefeed=" ",mxEditor.prototype.postParameterName="xml",mxEditor.prototype.escapePostData=!0,mxEditor.prototype.urlPost=null,mxEditor.prototype.urlImage=null,mxEditor.prototype.horizontalFlow=!1,mxEditor.prototype.layoutDiagram=!1,mxEditor.prototype.swimlaneSpacing=0,mxEditor.prototype.maintainSwimlanes=!1,mxEditor.prototype.layoutSwimlanes=!1,mxEditor.prototype.cycleAttributeValues=null,mxEditor.prototype.cycleAttributeIndex=0,mxEditor.prototype.cycleAttributeName="fillColor",mxEditor.prototype.tasks=null,mxEditor.prototype.tasksWindowImage=null,mxEditor.prototype.tasksTop=20,mxEditor.prototype.help=null,mxEditor.prototype.helpWindowImage=null,mxEditor.prototype.urlHelp=null,mxEditor.prototype.helpWidth=300,mxEditor.prototype.helpHeight=260,mxEditor.prototype.propertiesWidth=240,mxEditor.prototype.propertiesHeight=null,mxEditor.prototype.movePropertiesDialog=!1,mxEditor.prototype.validating=!1,mxEditor.prototype.modified=!1,mxEditor.prototype.isModified=function(){return this.modified},mxEditor.prototype.setModified=function(t){this.modified=t},mxEditor.prototype.addActions=function(){this.addAction("save",function(t){t.save()}),this.addAction("print",function(t){var e=new mxPrintPreview(t.graph,1);e.open()}),this.addAction("show",function(t){mxUtils.show(t.graph,null,10,10)}),this.addAction("exportImage",function(t){var e=t.getUrlImage();if(e==null||mxClient.IS_LOCAL)t.execute("show");else{var i=mxUtils.getViewXml(t.graph,1),n=mxUtils.getXml(i,` -`);mxUtils.submit(e,t.postParameterName+"="+encodeURIComponent(n),document,"_blank")}}),this.addAction("refresh",function(t){t.graph.refresh()}),this.addAction("cut",function(t){t.graph.isEnabled()&&mxClipboard.cut(t.graph)}),this.addAction("copy",function(t){t.graph.isEnabled()&&mxClipboard.copy(t.graph)}),this.addAction("paste",function(t){t.graph.isEnabled()&&mxClipboard.paste(t.graph)}),this.addAction("delete",function(t){t.graph.isEnabled()&&t.graph.removeCells()}),this.addAction("group",function(t){t.graph.isEnabled()&&t.graph.setSelectionCell(t.groupCells())}),this.addAction("ungroup",function(t){t.graph.isEnabled()&&t.graph.setSelectionCells(t.graph.ungroupCells())}),this.addAction("removeFromParent",function(t){t.graph.isEnabled()&&t.graph.removeCellsFromParent()}),this.addAction("undo",function(t){t.graph.isEnabled()&&t.undo()}),this.addAction("redo",function(t){t.graph.isEnabled()&&t.redo()}),this.addAction("zoomIn",function(t){t.graph.zoomIn()}),this.addAction("zoomOut",function(t){t.graph.zoomOut()}),this.addAction("actualSize",function(t){t.graph.zoomActual()}),this.addAction("fit",function(t){t.graph.fit()}),this.addAction("showProperties",function(t,e){t.showProperties(e)}),this.addAction("selectAll",function(t){t.graph.isEnabled()&&t.graph.selectAll()}),this.addAction("selectNone",function(t){t.graph.isEnabled()&&t.graph.clearSelection()}),this.addAction("selectVertices",function(t){t.graph.isEnabled()&&t.graph.selectVertices()}),this.addAction("selectEdges",function(t){t.graph.isEnabled()&&t.graph.selectEdges()}),this.addAction("edit",function(t,e){t.graph.isEnabled()&&t.graph.isCellEditable(e)&&t.graph.startEditingAtCell(e)}),this.addAction("toBack",function(t,e){t.graph.isEnabled()&&t.graph.orderCells(!0)}),this.addAction("toFront",function(t,e){t.graph.isEnabled()&&t.graph.orderCells(!1)}),this.addAction("enterGroup",function(t,e){t.graph.enterGroup(e)}),this.addAction("exitGroup",function(t){t.graph.exitGroup()}),this.addAction("home",function(t){t.graph.home()}),this.addAction("selectPrevious",function(t){t.graph.isEnabled()&&t.graph.selectPreviousCell()}),this.addAction("selectNext",function(t){t.graph.isEnabled()&&t.graph.selectNextCell()}),this.addAction("selectParent",function(t){t.graph.isEnabled()&&t.graph.selectParentCell()}),this.addAction("selectChild",function(t){t.graph.isEnabled()&&t.graph.selectChildCell()}),this.addAction("collapse",function(t){t.graph.isEnabled()&&t.graph.foldCells(!0)}),this.addAction("collapseAll",function(t){if(t.graph.isEnabled()){var e=t.graph.getChildVertices();t.graph.foldCells(!0,!1,e)}}),this.addAction("expand",function(t){t.graph.isEnabled()&&t.graph.foldCells(!1)}),this.addAction("expandAll",function(t){if(t.graph.isEnabled()){var e=t.graph.getChildVertices();t.graph.foldCells(!1,!1,e)}}),this.addAction("bold",function(t){t.graph.isEnabled()&&t.graph.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,mxConstants.FONT_BOLD)}),this.addAction("italic",function(t){t.graph.isEnabled()&&t.graph.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,mxConstants.FONT_ITALIC)}),this.addAction("underline",function(t){t.graph.isEnabled()&&t.graph.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,mxConstants.FONT_UNDERLINE)}),this.addAction("alignCellsLeft",function(t){t.graph.isEnabled()&&t.graph.alignCells(mxConstants.ALIGN_LEFT)}),this.addAction("alignCellsCenter",function(t){t.graph.isEnabled()&&t.graph.alignCells(mxConstants.ALIGN_CENTER)}),this.addAction("alignCellsRight",function(t){t.graph.isEnabled()&&t.graph.alignCells(mxConstants.ALIGN_RIGHT)}),this.addAction("alignCellsTop",function(t){t.graph.isEnabled()&&t.graph.alignCells(mxConstants.ALIGN_TOP)}),this.addAction("alignCellsMiddle",function(t){t.graph.isEnabled()&&t.graph.alignCells(mxConstants.ALIGN_MIDDLE)}),this.addAction("alignCellsBottom",function(t){t.graph.isEnabled()&&t.graph.alignCells(mxConstants.ALIGN_BOTTOM)}),this.addAction("alignFontLeft",function(t){t.graph.setCellStyles(mxConstants.STYLE_ALIGN,mxConstants.ALIGN_LEFT)}),this.addAction("alignFontCenter",function(t){t.graph.isEnabled()&&t.graph.setCellStyles(mxConstants.STYLE_ALIGN,mxConstants.ALIGN_CENTER)}),this.addAction("alignFontRight",function(t){t.graph.isEnabled()&&t.graph.setCellStyles(mxConstants.STYLE_ALIGN,mxConstants.ALIGN_RIGHT)}),this.addAction("alignFontTop",function(t){t.graph.isEnabled()&&t.graph.setCellStyles(mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_TOP)}),this.addAction("alignFontMiddle",function(t){t.graph.isEnabled()&&t.graph.setCellStyles(mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE)}),this.addAction("alignFontBottom",function(t){t.graph.isEnabled()&&t.graph.setCellStyles(mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_BOTTOM)}),this.addAction("zoom",function(t){var e=t.graph.getView().scale*100,i=parseFloat(mxUtils.prompt(mxResources.get(t.askZoomResource)||t.askZoomResource,e))/100;isNaN(i)||t.graph.getView().setScale(i)}),this.addAction("toggleTasks",function(t){t.tasks!=null?t.tasks.setVisible(!t.tasks.isVisible()):t.showTasks()}),this.addAction("toggleHelp",function(t){t.help!=null?t.help.setVisible(!t.help.isVisible()):t.showHelp()}),this.addAction("toggleOutline",function(t){t.outline==null?t.showOutline():t.outline.setVisible(!t.outline.isVisible())}),this.addAction("toggleConsole",function(t){mxLog.setVisible(!mxLog.isVisible())})},mxEditor.prototype.configure=function(t){if(t!=null){var e=new mxCodec(t.ownerDocument);e.decode(t,this),this.resetHistory()}},mxEditor.prototype.resetFirstTime=function(){document.cookie="mxgraph=seen; expires=Fri, 27 Jul 2001 02:47:11 UTC; path=/"},mxEditor.prototype.resetHistory=function(){this.lastSnapshot=new Date().getTime(),this.undoManager.clear(),this.ignoredChanges=0,this.setModified(!1)},mxEditor.prototype.addAction=function(t,e){this.actions[t]=e},mxEditor.prototype.execute=function(t,e,i){var n=this.actions[t];if(n!=null)try{var r=arguments;r[0]=this,n.apply(this,r)}catch(s){throw mxUtils.error("Cannot execute "+t+": "+s.message,280,!0),s}else mxUtils.error("Cannot find action "+t,280,!0)},mxEditor.prototype.addTemplate=function(t,e){this.templates[t]=e},mxEditor.prototype.getTemplate=function(t){return this.templates[t]},mxEditor.prototype.createGraph=function(){var t=new mxGraph(null,null,this.graphRenderHint);return t.setTooltips(!0),t.setPanning(!0),this.installDblClickHandler(t),this.installUndoHandler(t),this.installDrillHandler(t),this.installChangeHandler(t),this.installInsertHandler(t),t.popupMenuHandler.factoryMethod=mxUtils.bind(this,function(e,i,n){return this.createPopupMenu(e,i,n)}),t.connectionHandler.factoryMethod=mxUtils.bind(this,function(e,i){return this.createEdge(e,i)}),this.createSwimlaneManager(t),this.createLayoutManager(t),t},mxEditor.prototype.createSwimlaneManager=function(t){var e=new mxSwimlaneManager(t,!1);return e.isHorizontal=mxUtils.bind(this,function(){return this.horizontalFlow}),e.isEnabled=mxUtils.bind(this,function(){return this.maintainSwimlanes}),e},mxEditor.prototype.createLayoutManager=function(t){var e=new mxLayoutManager(t),i=this;return e.getLayout=function(n){var r=null,s=i.graph.getModel();return s.getParent(n)!=null&&(i.layoutSwimlanes&&t.isSwimlane(n)?(i.swimlaneLayout==null&&(i.swimlaneLayout=i.createSwimlaneLayout()),r=i.swimlaneLayout):i.layoutDiagram&&(t.isValidRoot(n)||s.getParent(s.getParent(n))==null)&&(i.diagramLayout==null&&(i.diagramLayout=i.createDiagramLayout()),r=i.diagramLayout)),r},e},mxEditor.prototype.setGraphContainer=function(t){this.graph.container==null&&(this.graph.init(t),this.rubberband=new mxRubberband(this.graph),this.disableContextMenu&&mxEvent.disableContextMenu(t),mxClient.IS_QUIRKS&&new mxDivResizer(t))},mxEditor.prototype.installDblClickHandler=function(t){t.addListener(mxEvent.DOUBLE_CLICK,mxUtils.bind(this,function(e,i){var n=i.getProperty("cell");n!=null&&t.isEnabled()&&this.dblClickAction!=null&&(this.execute(this.dblClickAction,n),i.consume())}))},mxEditor.prototype.installUndoHandler=function(t){var e=mxUtils.bind(this,function(n,r){var s=r.getProperty("edit");this.undoManager.undoableEditHappened(s)});t.getModel().addListener(mxEvent.UNDO,e),t.getView().addListener(mxEvent.UNDO,e);var i=function(n,r){var s=r.getProperty("edit").changes;t.setSelectionCells(t.getSelectionCellsForChanges(s))};this.undoManager.addListener(mxEvent.UNDO,i),this.undoManager.addListener(mxEvent.REDO,i)},mxEditor.prototype.installDrillHandler=function(t){var e=mxUtils.bind(this,function(i){this.fireEvent(new mxEventObject(mxEvent.ROOT))});t.getView().addListener(mxEvent.DOWN,e),t.getView().addListener(mxEvent.UP,e)},mxEditor.prototype.installChangeHandler=function(t){var e=mxUtils.bind(this,function(i,n){this.setModified(!0),this.validating==!0&&t.validateGraph();for(var r=n.getProperty("edit").changes,s=0;s "+e.convertValueToString(i)+t),i=e.getModel().getParent(i);var n=this.getRootTitle();return n+t},mxEditor.prototype.getRootTitle=function(){var t=this.graph.getModel().getRoot();return this.graph.convertValueToString(t)},mxEditor.prototype.undo=function(){this.undoManager.undo()},mxEditor.prototype.redo=function(){this.undoManager.redo()},mxEditor.prototype.groupCells=function(){var t=this.groupBorderSize!=null?this.groupBorderSize:this.graph.gridSize;return this.graph.groupCells(this.createGroup(),t)},mxEditor.prototype.createGroup=function(){var t=this.graph.getModel();return t.cloneCell(this.defaultGroup)},mxEditor.prototype.open=function(t){if(t!=null){var e=mxUtils.load(t).getXml();this.readGraphModel(e.documentElement),this.filename=t,this.fireEvent(new mxEventObject(mxEvent.OPEN,"filename",t))}},mxEditor.prototype.readGraphModel=function(t){var e=new mxCodec(t.ownerDocument);e.decode(t,this.graph.getModel()),this.resetHistory()},mxEditor.prototype.save=function(t,e){if(t=t||this.getUrlPost(),t!=null&&t.length>0){var i=this.writeGraphModel(e);this.postDiagram(t,i),this.setModified(!1)}this.fireEvent(new mxEventObject(mxEvent.SAVE,"url",t))},mxEditor.prototype.postDiagram=function(t,e){this.escapePostData&&(e=encodeURIComponent(e)),mxUtils.post(t,this.postParameterName+"="+e,mxUtils.bind(this,function(i){this.fireEvent(new mxEventObject(mxEvent.POST,"request",i,"url",t,"data",e))}))},mxEditor.prototype.writeGraphModel=function(t){t=t??this.linefeed;var e=new mxCodec,i=e.encode(this.graph.getModel());return mxUtils.getXml(i,t)},mxEditor.prototype.getUrlPost=function(){return this.urlPost},mxEditor.prototype.getUrlImage=function(){return this.urlImage},mxEditor.prototype.swapStyles=function(t,e){var i=this.graph.getStylesheet().styles[e];this.graph.getView().getStylesheet().putCellStyle(e,this.graph.getStylesheet().styles[t]),this.graph.getStylesheet().putCellStyle(t,i),this.graph.refresh()},mxEditor.prototype.showProperties=function(t){if(t=t||this.graph.getSelectionCell(),t==null&&(t=this.graph.getCurrentRoot(),t==null&&(t=this.graph.getModel().getRoot())),t!=null){this.graph.stopEditing(!0);var e=mxUtils.getOffset(this.graph.container),i=e.x+10,n=e.y;if(this.properties!=null&&!this.movePropertiesDialog)i=this.properties.getX(),n=this.properties.getY();else{var r=this.graph.getCellBounds(t);r!=null&&(i+=r.x+Math.min(200,r.width),n+=r.y)}this.hideProperties();var s=this.createProperties(t);s!=null&&(this.properties=new mxWindow(mxResources.get(this.propertiesResource)||this.propertiesResource,s,i,n,this.propertiesWidth,this.propertiesHeight,!1),this.properties.setVisible(!0))}},mxEditor.prototype.isPropertiesVisible=function(){return this.properties!=null},mxEditor.prototype.createProperties=function(t){var e=this.graph.getModel(),i=e.getValue(t);if(mxUtils.isNode(i)){var n=new mxForm("properties"),r=n.addText("ID",t.getId());r.setAttribute("readonly","true");var s=null,l=null,a=null,o=null,u=null;e.isVertex(t)&&(s=e.getGeometry(t),s!=null&&(l=n.addText("top",s.y),a=n.addText("left",s.x),o=n.addText("width",s.width),u=n.addText("height",s.height)));for(var p=e.getStyle(t),m=n.addText("Style",p||""),d=i.attributes,x=[],f=0;f0?e.setStyle(t,m.value):e.setStyle(t,null);for(var y=0;y0&&this.graph.isSwimlane(t)?this.cycleAttributeValues[this.cycleAttributeIndex++%this.cycleAttributeValues.length]:null},mxEditor.prototype.cycleAttribute=function(t){if(this.cycleAttributeName!=null){var e=this.consumeCycleAttribute(t);e!=null&&t.setStyle(t.getStyle()+";"+this.cycleAttributeName+"="+e)}},mxEditor.prototype.addVertex=function(t,e,i,n){for(var r=this.graph.getModel();t!=null&&!this.graph.isValidDropTarget(t);)t=r.getParent(t);t=t??this.graph.getSwimlaneAt(i,n);var s=this.graph.getView().scale,l=r.getGeometry(e),a=r.getGeometry(t);if(this.graph.isSwimlane(e)&&!this.graph.swimlaneNesting)t=null;else{if(t==null&&this.swimlaneRequired)return null;if(t!=null&&a!=null){var o=this.graph.getView().getState(t);if(o!=null){if(i-=o.origin.x*s,n-=o.origin.y*s,this.graph.isConstrainedMoving){var u=l.width,p=l.height,m=o.x+o.width;i+u>m&&(i-=i+u-m),m=o.y+o.height,n+p>m&&(n-=n+p-m)}}else a!=null&&(i-=a.x*s,n-=a.y*s)}}l=l.clone(),l.x=this.graph.snap(i/s-this.graph.getView().translate.x-this.graph.gridSize/2),l.y=this.graph.snap(n/s-this.graph.getView().translate.y-this.graph.gridSize/2),e.setGeometry(l),t==null&&(t=this.graph.getDefaultParent()),this.cycleAttribute(e),this.fireEvent(new mxEventObject(mxEvent.BEFORE_ADD_VERTEX,"vertex",e,"parent",t)),r.beginUpdate();try{e=this.graph.addCell(e,t),e!=null&&(this.graph.constrainChild(e),this.fireEvent(new mxEventObject(mxEvent.ADD_VERTEX,"vertex",e)))}finally{r.endUpdate()}return e!=null&&(this.graph.setSelectionCell(e),this.graph.scrollCellToVisible(e),this.fireEvent(new mxEventObject(mxEvent.AFTER_ADD_VERTEX,"vertex",e))),e},mxEditor.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,this.tasks!=null&&this.tasks.destroy(),this.outline!=null&&this.outline.destroy(),this.properties!=null&&this.properties.destroy(),this.keyHandler!=null&&this.keyHandler.destroy(),this.rubberband!=null&&this.rubberband.destroy(),this.toolbar!=null&&this.toolbar.destroy(),this.graph!=null&&this.graph.destroy(),this.status=null,this.templates=null)},__mxOutput.mxEditor=typeof mxEditor<"u"?mxEditor:void 0;var mxCodecRegistry={codecs:[],aliases:[],register:function(t){if(t!=null){var e=t.getName();mxCodecRegistry.codecs[e]=t;var i=mxUtils.getFunctionName(t.template.constructor);i!=e&&mxCodecRegistry.addAlias(i,e)}return t},addAlias:function(t,e){mxCodecRegistry.aliases[t]=e},getCodec:function(t){var e=null;if(t!=null){var i=mxUtils.getFunctionName(t),n=mxCodecRegistry.aliases[i];if(n!=null&&(i=n),e=mxCodecRegistry.codecs[i],e==null)try{e=new mxObjectCodec(new t),mxCodecRegistry.register(e)}catch{}}return e}};__mxOutput.mxCodecRegistry=typeof mxCodecRegistry<"u"?mxCodecRegistry:void 0;function mxCodec(t){this.document=t||mxUtils.createXmlDocument(),this.objects=[]}mxCodec.prototype.document=null,mxCodec.prototype.objects=null,mxCodec.prototype.elements=null,mxCodec.prototype.encodeDefaults=!1,mxCodec.prototype.putObject=function(t,e){return this.objects[t]=e,e},mxCodec.prototype.getObject=function(t){var e=null;if(t!=null&&(e=this.objects[t],e==null&&(e=this.lookup(t),e==null))){var i=this.getElementById(t);i!=null&&(e=this.decode(i))}return e},mxCodec.prototype.lookup=function(t){return null},mxCodec.prototype.getElementById=function(t){return this.updateElements(),this.elements[t]},mxCodec.prototype.updateElements=function(){this.elements==null&&(this.elements=new Object,this.document.documentElement!=null&&this.addElement(this.document.documentElement))},mxCodec.prototype.addElement=function(t){if(t.nodeType==mxConstants.NODETYPE_ELEMENT){var e=t.getAttribute("id");if(e!=null){if(this.elements[e]==null)this.elements[e]=t;else if(this.elements[e]!=t)throw new Error(e+": Duplicate ID")}}for(t=t.firstChild;t!=null;)this.addElement(t),t=t.nextSibling},mxCodec.prototype.getId=function(t){var e=null;return t!=null&&(e=this.reference(t),e==null&&t instanceof mxCell&&(e=t.getId(),e==null&&(e=mxCellPath.create(t),e.length==0&&(e="root")))),e},mxCodec.prototype.reference=function(t){return null},mxCodec.prototype.encode=function(t){var e=null;if(t!=null&&t.constructor!=null){var i=mxCodecRegistry.getCodec(t.constructor);i!=null?e=i.encode(this,t):mxUtils.isNode(t)?e=mxUtils.importNode(this.document,t,!0):mxLog.warn("mxCodec.encode: No codec for "+mxUtils.getFunctionName(t.constructor))}return e},mxCodec.prototype.decode=function(t,e){this.updateElements();var i=null;if(t!=null&&t.nodeType==mxConstants.NODETYPE_ELEMENT){var n=null;try{n=window[t.nodeName]}catch{}var r=mxCodecRegistry.getCodec(n);r!=null?i=r.decode(this,t,e):(i=t.cloneNode(!0),i.removeAttribute("as"))}return i},mxCodec.prototype.encodeCell=function(t,e,i){if(e.appendChild(this.encode(t)),i==null||i)for(var n=t.getChildCount(),r=0;r=0},mxObjectCodec.prototype.isReference=function(t,e,i,n){return mxUtils.indexOf(this.idrefs,e)>=0},mxObjectCodec.prototype.encode=function(t,e){var i=t.document.createElement(this.getName());return e=this.beforeEncode(t,e,i),this.encodeObject(t,e,i),this.afterEncode(t,e,i)},mxObjectCodec.prototype.encodeObject=function(t,e,i){t.setAttribute(i,"id",t.getId(e));for(var n in e){var r=n,s=e[r];s!=null&&!this.isExcluded(e,r,s,!0)&&(mxUtils.isInteger(r)&&(r=null),this.encodeValue(t,e,r,s,i))}},mxObjectCodec.prototype.encodeValue=function(t,e,i,n,r){if(n!=null){if(this.isReference(e,i,n,!0)){var s=t.getId(n);if(s==null){mxLog.warn("mxObjectCodec.encode: No ID for "+this.getName()+"."+i+"="+n);return}n=s}var l=this.template[i];(i==null||t.encodeDefaults||l!=n)&&(i=this.getAttributeName(i),this.writeAttribute(t,e,i,n,r))}},mxObjectCodec.prototype.writeAttribute=function(t,e,i,n,r){typeof n!="object"?this.writePrimitiveAttribute(t,e,i,n,r):this.writeComplexAttribute(t,e,i,n,r)},mxObjectCodec.prototype.writePrimitiveAttribute=function(t,e,i,n,r){if(n=this.convertAttributeToXml(t,e,i,n,r),i==null){var s=t.document.createElement("add");typeof n=="function"?s.appendChild(t.document.createTextNode(n)):t.setAttribute(s,"value",n),r.appendChild(s)}else typeof n!="function"&&t.setAttribute(r,i,n)},mxObjectCodec.prototype.writeComplexAttribute=function(t,e,i,n,r){var s=t.encode(n);s!=null?(i!=null&&s.setAttribute("as",i),r.appendChild(s)):mxLog.warn("mxObjectCodec.encode: No node for "+this.getName()+"."+i+": "+n)},mxObjectCodec.prototype.convertAttributeToXml=function(t,e,i,n){return this.isBooleanAttribute(t,e,i,n)&&(n=n==!0?"1":"0"),n},mxObjectCodec.prototype.isBooleanAttribute=function(t,e,i,n){return typeof n.length>"u"&&(n==!0||n==!1)},mxObjectCodec.prototype.convertAttributeFromXml=function(t,e,i){var n=e.value;return this.isNumericAttribute(t,e,i)&&(n=parseFloat(n),(isNaN(n)||!isFinite(n))&&(n=0)),n},mxObjectCodec.prototype.isNumericAttribute=function(t,e,i){var n=i.constructor==mxGeometry&&(e.name=="x"||e.name=="y"||e.name=="width"||e.name=="height")||i.constructor==mxPoint&&(e.name=="x"||e.name=="y")||mxUtils.isNumeric(e.value);return n},mxObjectCodec.prototype.beforeEncode=function(t,e,i){return e},mxObjectCodec.prototype.afterEncode=function(t,e,i){return i},mxObjectCodec.prototype.decode=function(t,e,i){var n=e.getAttribute("id"),r=t.objects[n];return r==null&&(r=i||this.cloneTemplate(),n!=null&&t.putObject(n,r)),e=this.beforeDecode(t,e,r),this.decodeNode(t,e,r),this.afterDecode(t,e,r)},mxObjectCodec.prototype.decodeNode=function(t,e,i){e!=null&&(this.decodeAttributes(t,e,i),this.decodeChildren(t,e,i))},mxObjectCodec.prototype.decodeAttributes=function(t,e,i){var n=e.attributes;if(n!=null)for(var r=0;r0&&(n=null),n},mxObjectCodec.prototype.addObjectValue=function(t,e,i,n){i!=null&&i!=n&&(e!=null&&e.length>0?t[e]=i:t.push(i))},mxObjectCodec.prototype.processInclude=function(t,e,i){if(e.nodeName=="include"){var n=e.getAttribute("name");if(n!=null)try{var r=mxUtils.load(n).getDocumentElement();r!=null&&t.decode(r,i)}catch{}return!0}return!1},mxObjectCodec.prototype.beforeDecode=function(t,e,i){return e},mxObjectCodec.prototype.afterDecode=function(t,e,i){return i},__mxOutput.mxObjectCodec=typeof mxObjectCodec<"u"?mxObjectCodec:void 0,mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxCell,["children","edges","overlays","mxTransient"],["parent","source","target"]);return t.isCellCodec=function(){return!0},t.isNumericAttribute=function(e,i,n){return i.nodeName!=="value"&&mxObjectCodec.prototype.isNumericAttribute.apply(this,arguments)},t.isExcluded=function(e,i,n,r){return mxObjectCodec.prototype.isExcluded.apply(this,arguments)||r&&i=="value"&&n.nodeType==mxConstants.NODETYPE_ELEMENT},t.afterEncode=function(e,i,n){if(i.value!=null&&i.value.nodeType==mxConstants.NODETYPE_ELEMENT){var r=n;n=mxUtils.importNode(e.document,i.value,!0),n.appendChild(r);var s=r.getAttribute("id");n.setAttribute("id",s),r.removeAttribute("id")}return n},t.beforeDecode=function(e,i,n){var r=i.cloneNode(!0),s=this.getName();if(i.nodeName!=s){var l=i.getElementsByTagName(s)[0];l!=null&&l.parentNode==i?(mxUtils.removeWhitespace(l,!0),mxUtils.removeWhitespace(l,!1),l.parentNode.removeChild(l),r=l):r=null,n.value=i.cloneNode(!0);var a=n.value.getAttribute("id");a!=null&&(n.setId(a),n.value.removeAttribute("id"))}else n.setId(i.getAttribute("id"));if(r!=null)for(var o=0;o=0},t.isExcluded=function(e,i,n,r){return mxObjectCodec.prototype.isExcluded.apply(this,arguments)||r&&n!=null&&(i=="previous"||i=="parent")&&!e.model.contains(n)},t.afterEncode=function(e,i,n){return this.isReference(i,"child",i.child,!0)?n.setAttribute("child",e.getId(i.child)):e.encodeCell(i.child,n),n},t.beforeDecode=function(e,i,n){if(i.firstChild!=null&&i.firstChild.nodeType==mxConstants.NODETYPE_ELEMENT){i=i.cloneNode(!0);var r=i.firstChild;n.child=e.decodeCell(r,!1);var s=r.nextSibling;for(r.parentNode.removeChild(r),r=s;r!=null;){if(s=r.nextSibling,r.nodeType==mxConstants.NODETYPE_ELEMENT){var l=r.getAttribute("id");e.lookup(l)==null&&e.decodeCell(r)}r.parentNode.removeChild(r),r=s}}else{var a=i.getAttribute("child");n.child=e.getObject(a)}return i},t.afterDecode=function(e,i,n){return n.child!=null&&(n.child.parent!=null&&n.previous!=null&&n.child.parent!=n.previous&&(n.previous=n.child.parent),n.child.parent=n.previous,n.previous=n.parent,n.previousIndex=n.index),n},t}()),__mxOutput.mxChildChangeCodec=typeof mxChildChangeCodec<"u"?mxChildChangeCodec:void 0,mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxTerminalChange,["model","previous"],["cell","terminal"]);return t.afterDecode=function(e,i,n){return n.previous=n.terminal,n},t}()),__mxOutput.mxTerminalChangeCodec=typeof mxTerminalChangeCodec<"u"?mxTerminalChangeCodec:void 0;var mxGenericChangeCodec=function(t,e){var i=new mxObjectCodec(t,["model","previous"],["cell"]);return i.afterDecode=function(n,r,s){return mxUtils.isNode(s.cell)&&(s.cell=n.decodeCell(s.cell,!1)),s.previous=s[e],s},i};mxCodecRegistry.register(mxGenericChangeCodec(new mxValueChange,"value")),mxCodecRegistry.register(mxGenericChangeCodec(new mxStyleChange,"style")),mxCodecRegistry.register(mxGenericChangeCodec(new mxGeometryChange,"geometry")),mxCodecRegistry.register(mxGenericChangeCodec(new mxCollapseChange,"collapsed")),mxCodecRegistry.register(mxGenericChangeCodec(new mxVisibleChange,"visible")),mxCodecRegistry.register(mxGenericChangeCodec(new mxCellAttributeChange,"value")),__mxOutput.mxGenericChangeCodec=typeof mxGenericChangeCodec<"u"?mxGenericChangeCodec:void 0,mxCodecRegistry.register(function(){return new mxObjectCodec(new mxGraph,["graphListeners","eventListeners","view","container","cellRenderer","editor","selection"])}()),__mxOutput.mxGraphCodec=typeof mxGraphCodec<"u"?mxGraphCodec:void 0,mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxGraphView);return t.encode=function(e,i){return this.encodeCell(e,i,i.graph.getModel().getRoot())},t.encodeCell=function(e,i,n){var r=i.graph.getModel(),s=i.getState(n),l=r.getParent(n);if(l==null||s!=null){var a=r.getChildCount(n),o=i.graph.getCellGeometry(n),u=null;if(l==r.getRoot()?u="layer":l==null?u="graph":r.isEdge(n)?u="edge":a>0&&o!=null?u="group":r.isVertex(n)&&(u="vertex"),u!=null){var p=e.document.createElement(u),m=i.graph.getLabel(n);if(m!=null&&(p.setAttribute("label",i.graph.getLabel(n)),i.graph.isHtmlLabel(n)&&p.setAttribute("html",!0)),l==null){var d=i.getGraphBounds();d!=null&&(p.setAttribute("x",Math.round(d.x)),p.setAttribute("y",Math.round(d.y)),p.setAttribute("width",Math.round(d.width)),p.setAttribute("height",Math.round(d.height))),p.setAttribute("scale",i.scale)}else if(s!=null&&o!=null){for(var x in s.style){var f=s.style[x];typeof f=="function"&&typeof f=="object"&&(f=mxStyleRegistry.getName(f)),f!=null&&typeof f!="function"&&typeof f!="object"&&p.setAttribute(x,f)}var g=s.absolutePoints;if(g!=null&&g.length>0){for(var c=Math.round(g[0].x)+","+Math.round(g[0].y),x=1;x0&&n.appendChild(l)}}return n},t.getStringValue=function(e,i){var n=typeof i;return n=="function"?i=mxStyleRegistry.getName(i):n=="object"&&(i=null),i},t.decode=function(e,i,n){var r=n||new this.template.constructor,s=i.getAttribute("id");for(s!=null&&(e.objects[s]=r),i=i.firstChild;i!=null;){if(!this.processInclude(e,i,r)&&i.nodeName=="add"){var l=i.getAttribute("as");if(l!=null){var a=i.getAttribute("extend"),o=a!=null?mxUtils.clone(r.styles[a]):null;o==null&&(a!=null&&mxLog.warn("mxStylesheetCodec.decode: stylesheet "+a+" not found to extend"),o=new Object);for(var u=i.firstChild;u!=null;){if(u.nodeType==mxConstants.NODETYPE_ELEMENT){var p=u.getAttribute("as");if(u.nodeName=="add"){var m=mxUtils.getTextContent(u),d=null;m!=null&&m.length>0&&mxStylesheetCodec.allowEval?d=mxUtils.eval(m):(d=u.getAttribute("value"),mxUtils.isNumeric(d)&&(d=parseFloat(d))),d!=null&&(o[p]=d)}else u.nodeName=="remove"&&delete o[p]}u=u.nextSibling}r.putCellStyle(l,o)}}i=i.nextSibling}return r},t}());mxStylesheetCodec.allowEval=!0,__mxOutput.mxStylesheetCodec=typeof mxStylesheetCodec<"u"?mxStylesheetCodec:void 0,mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxDefaultKeyHandler);return t.encode=function(e,i){return null},t.decode=function(e,i,n){if(n!=null)for(n.editor,i=i.firstChild;i!=null;){if(!this.processInclude(e,i,n)&&i.nodeName=="add"){var r=i.getAttribute("as"),s=i.getAttribute("action"),l=i.getAttribute("control");n.bindAction(r,s,l)}i=i.nextSibling}return n},t}()),__mxOutput.mxDefaultKeyHandlerCodec=typeof mxDefaultKeyHandlerCodec<"u"?mxDefaultKeyHandlerCodec:void 0;var mxDefaultToolbarCodec=mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxDefaultToolbar);return t.encode=function(e,i){return null},t.decode=function(e,i,n){if(n!=null){var r=n.editor;for(i=i.firstChild;i!=null;){if(i.nodeType==mxConstants.NODETYPE_ELEMENT&&!this.processInclude(e,i,n)){if(i.nodeName=="separator")n.addSeparator();else if(i.nodeName=="br")n.toolbar.addBreak();else if(i.nodeName=="hr")n.toolbar.addLine();else if(i.nodeName=="add"){var s=i.getAttribute("as");s=mxResources.get(s)||s;var l=i.getAttribute("icon"),a=i.getAttribute("pressedIcon"),o=i.getAttribute("action"),u=i.getAttribute("mode"),p=i.getAttribute("template"),m=i.getAttribute("toggle")!="0",d=mxUtils.getTextContent(i),x=null;if(o!=null)x=n.addItem(s,l,o,a);else if(u!=null){var f=mxDefaultToolbarCodec.allowEval?mxUtils.eval(d):null;x=n.addMode(s,l,u,a,f)}else if(p!=null||d!=null&&d.length>0){var g=r.templates[p],c=i.getAttribute("style");g!=null&&c!=null&&(g=r.graph.cloneCell(g),g.setStyle(c));var v=null;d!=null&&d.length>0&&mxDefaultToolbarCodec.allowEval&&(v=mxUtils.eval(d)),x=n.addPrototype(s,l,g,a,v,m)}else{var y=mxUtils.getChildNodes(i);if(y.length>0)if(l==null)for(var T=n.addActionCombo(s),C=0;C0&&x.setAttribute("id",O)}}}i=i.nextSibling}}return n},t}());return mxDefaultToolbarCodec.allowEval=!0,__mxOutput.mxDefaultToolbarCodec=typeof mxDefaultToolbarCodec<"u"?mxDefaultToolbarCodec:void 0,mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxDefaultPopupMenu);return t.encode=function(e,i){return null},t.decode=function(e,i,n){var r=i.getElementsByTagName("include")[0];return r!=null?this.processInclude(e,r,n):n!=null&&(n.config=i),n},t}()),__mxOutput.mxDefaultPopupMenuCodec=typeof mxDefaultPopupMenuCodec<"u"?mxDefaultPopupMenuCodec:void 0,mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxEditor,["modified","lastSnapshot","ignoredChanges","undoManager","graphContainer","toolbarContainer"]);return t.afterDecode=function(e,i,n){var r=i.getAttribute("defaultEdge");r!=null&&(i.removeAttribute("defaultEdge"),n.defaultEdge=n.templates[r]);var s=i.getAttribute("defaultGroup");return s!=null&&(i.removeAttribute("defaultGroup"),n.defaultGroup=n.templates[s]),n},t.decodeChild=function(e,i,n){if(i.nodeName=="Array"){var r=i.getAttribute("as");if(r=="templates"){this.decodeTemplates(e,i,n);return}}else if(i.nodeName=="ui"){this.decodeUi(e,i,n);return}mxObjectCodec.prototype.decodeChild.apply(this,arguments)},t.decodeUi=function(e,i,n){for(var r=i.firstChild;r!=null;){if(r.nodeName=="add"){var s=r.getAttribute("as"),l=r.getAttribute("element"),a=r.getAttribute("style"),o=null;if(l!=null)o=document.getElementById(l),o!=null&&a!=null&&(o.style.cssText+=";"+a);else{var u=parseInt(r.getAttribute("x")),p=parseInt(r.getAttribute("y")),m=r.getAttribute("width"),d=r.getAttribute("height");o=document.createElement("div"),o.style.cssText=a;var x=new mxWindow(mxResources.get(s)||s,o,u,p,m,d,!1,!0);x.setVisible(!0)}s=="graph"?n.setGraphContainer(o):s=="toolbar"?n.setToolbarContainer(o):s=="title"?n.setTitleContainer(o):s=="status"?n.setStatusContainer(o):s=="map"&&n.setMapContainer(o)}else r.nodeName=="resource"?mxResources.add(r.getAttribute("basename")):r.nodeName=="stylesheet"&&mxClient.link("stylesheet",r.getAttribute("name"));r=r.nextSibling}},t.decodeTemplates=function(e,i,n){n.templates==null&&(n.templates=[]);for(var r=mxUtils.getChildNodes(i),s=0;s