From 1c321ceb9870590a3fd92d31dd1f0efbc8661c43 Mon Sep 17 00:00:00 2001 From: Process Analytics Bot <62586190+process-analytics-bot@users.noreply.github.com> Date: Mon, 18 Sep 2023 15:05:01 +0200 Subject: [PATCH] chore(deps): bump bpmn-visualization to 0.40.0 (#551) --- demo/draw-path/index.html | 2 +- demo/hacktoberfest-custom-themes/index.html | 2 +- demo/load-and-navigation/assets/main.js | 18 +++++++++--------- .../index.html | 2 +- demo/prediction/index.html | 2 +- .../apply-css-classes/index.html | 2 +- .../index.html | 2 +- .../index.html | 2 +- .../index.html | 2 +- .../growing-sequence-flow/index.html | 2 +- .../javascript-tooltip-and-popover/index.html | 2 +- .../running-dashed-message-flow/index.html | 2 +- .../select-elements-by-bpmn-kind/index.html | 2 +- .../custom-bpmn-theme/custom-colors/index.html | 2 +- .../custom-edge-marker-colors/index.html | 2 +- .../custom-bpmn-theme/custom-fonts/index.html | 2 +- .../custom-user-task-icon/index.html | 2 +- .../diagram-fit-after-load/index.html | 2 +- .../diagram-fit-on-load/index.html | 2 +- .../diagram-navigation/index.html | 2 +- .../load-local-bpmn-diagrams/index.html | 2 +- .../load-remote-bpmn-diagrams/index.html | 2 +- .../pools-filter-on-load/index.html | 2 +- examples/misc/compare-with-bpmn-js/index.html | 2 +- .../index.html | 2 +- examples/overlays/add-remove/index.html | 2 +- examples/overlays/add-stylized/index.html | 2 +- .../custom-overlay-default-style/index.html | 2 +- .../package.json | 2 +- projects/typescript-angular/package.json | 2 +- projects/typescript-lit-element/package.json | 2 +- .../package.json | 2 +- .../package.json | 2 +- .../package.json | 2 +- projects/typescript-vue/package.json | 2 +- 35 files changed, 43 insertions(+), 43 deletions(-) diff --git a/demo/draw-path/index.html b/demo/draw-path/index.html index 112236c1..0e64ac46 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 ebf9a2ca..6c33f2b2 100644 --- a/demo/hacktoberfest-custom-themes/index.html +++ b/demo/hacktoberfest-custom-themes/index.html @@ -35,7 +35,7 @@ - + diff --git a/demo/load-and-navigation/assets/main.js b/demo/load-and-navigation/assets/main.js index 5e88e238..8eb835f6 100644 --- a/demo/load-and-navigation/assets/main.js +++ b/demo/load-and-navigation/assets/main.js @@ -1,11 +1,11 @@ -var Qt=Object.defineProperty;var Jt=(n,e,t)=>e in n?Qt(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var g=(n,e,t)=>(Jt(n,typeof e!="symbol"?e+"":e,t),t);import{f as en}from"./mxgraph.js";(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))s(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const r of o.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&s(r)}).observe(document,{childList:!0,subtree:!0});function t(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function s(i){if(i.ep)return;i.ep=!0;const o=t(i);fetch(i.href,o)}})();var le=(n=>(n.None="None",n.HorizontalVertical="HorizontalVertical",n.Horizontal="Horizontal",n.Vertical="Vertical",n.Center="Center",n))(le||{}),tn=(n=>(n.In="in",n.Out="out",n))(tn||{}),d=(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))(d||{}),ae=(n=>(n.CALLING_PROCESS="process",n.CALLING_GLOBAL_TASK="global task",n))(ae||{}),ce=(n=>(n.Exclusive="Exclusive",n.None="None",n.Parallel="Parallel",n))(ce||{}),R=(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))(R||{}),w=(n=>(n.ADHOC="adhoc",n.COMPENSATION="compensation",n.EXPAND="expand",n.LOOP="loop",n.MULTI_INSTANCE_PARALLEL="parallel multi instance",n.MULTI_INSTANCE_SEQUENTIAL="sequential multi instance",n))(w||{}),U=(n=>(n.AD_HOC="ad_hoc",n.EMBEDDED="embedded",n.EVENT="event",n.TRANSACTION="transaction",n))(U||{});function nn(n,e){return n===""?e?{}:void 0:n}function S(n,e=!1){return n==null?[]:(Array.isArray(n)?n:[n]).map(t=>nn(t,e)).filter(Boolean)}function sn(n,e,t){let s="";return t!=null&&t.startingWith?s=s.concat(`^(${t.startingWith}).*`):t!=null&&t.notStartingWith&&(s=s.concat(`^(?!(${t.notStartingWith})).*`)),s=s.concat(`${e}$`),n.filter(i=>t!=null&&t.ignoreCase?new RegExp(s,"i").test(i):new RegExp(s).test(i))}class C{static isEvent(e){return pe(tt,e)}static eventKinds(){return[...tt]}static isBoundaryEvent(e){return d.EVENT_BOUNDARY===e}static isStartEvent(e){return d.EVENT_START===e}static isCallActivity(e){return d.CALL_ACTIVITY===e}static isSubProcess(e){return d.SUB_PROCESS===e}static canHaveNoneEvent(e){return d.EVENT_INTERMEDIATE_THROW===e||d.EVENT_END===e||d.EVENT_START===e}static isActivity(e){return pe(xe,e)}static activityKinds(){return[...xe]}static isWithDefaultSequenceFlow(e){return on.includes(e)}static isTask(e){return pe(Pe,e)}static taskKinds(){return[...Pe]}static gatewayKinds(){return[...nt]}static isGateway(e){return pe(nt,e)}static flowNodeKinds(){return Object.values(d).filter(e=>!C.isPoolOrLane(e))}static isPoolOrLane(e){return e==d.POOL||e==d.LANE}}function Ue(n,e){return sn(Object.values(d),n,e)}function pe(n,e){return Object.values(n).map(t=>t).includes(e)}const tt=Ue("Event"),nt=Ue("Gateway"),Pe=Ue("Task",{ignoreCase:!0,notStartingWith:"global"}),xe=[...Pe,d.CALL_ACTIVITY,d.SUB_PROCESS],on=[...xe,d.GATEWAY_EXCLUSIVE,d.GATEWAY_INCLUSIVE,d.GATEWAY_COMPLEX],It=Object.values(R).filter(n=>n!=R.NONE);var j=(n=>(n.NONE="None",n.ONE="One",n.BOTH="Both",n))(j||{}),k=(n=>(n.SEQUENCE_FLOW="sequenceFlow",n.MESSAGE_FLOW="messageFlow",n.ASSOCIATION_FLOW="association",n))(k||{}),fe=(n=>(n.NONE="none",n.INITIATING="initiating",n.NON_INITIATING="non_initiating",n))(fe||{}),G=(n=>(n.NORMAL="normal",n.DEFAULT="default",n.CONDITIONAL_FROM_ACTIVITY="conditional_from_activity",n.CONDITIONAL_FROM_GATEWAY="conditional_from_gateway",n))(G||{});function Ie(n,e,t,s){return Math.min(Math.max(n??s,e),t)}function rn(n){return Math.max(n??0,0)}function ln(n){const e=n??{};return e.debounceDelay=Ie(e.debounceDelay,0,100,50),e.throttleDelay=Ie(e.throttleDelay,0,100,50),e}function ve(n){return n=="default"?void 0:Ie(n,0,100,100)}function an(n){return n=="default"?void 0:Ie(n,1,50,1)}const L=cn(),v=L.mxCellRenderer,Ct=L.mxClient,c=L.mxConstants,W=L.mxEvent,st=L.mxPerimeter,x=L.mxPoint,ke=L.mxRectangle,We=L.mxRectangleShape,ue=L.mxSvgCanvas2D,O=L.mxUtils;function cn(){return window.mxForceIncludes=!1,window.mxLoadResources=!1,window.mxLoadStylesheets=!1,window.mxResourceExtension=".txt",en({})}const I={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"},mt={ARROW_DASH:"bpmn.dash"},E={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_FROM_CENTER_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"},At=n=>O.getValue(n,I.IS_INSTANTIATING,"false")=="true",Ce=n=>n=="default"?void 0:n,un=(n,e)=>(e&&(n=F(n,c.STYLE_STROKECOLOR,e.color,Ce),n=F(n,c.STYLE_STROKE_OPACITY,e.opacity,ve),n=F(n,c.STYLE_STROKEWIDTH,e.width,an)),n),F=(n,e,t,s=i=>i)=>t==null?n:O.setStyle(n,e,s(t)),Ee=(n,e,t,s)=>s==null?n:O.setStyleFlag(n,e,t,s),dn=(n,e)=>(e&&(n=F(n,c.STYLE_FONTCOLOR,e.color,Ce),n=F(n,c.STYLE_FONTSIZE,e.size),n=F(n,c.STYLE_FONTFAMILY,e.family),n=Ee(n,c.STYLE_FONTSTYLE,c.FONT_BOLD,e.isBold),n=Ee(n,c.STYLE_FONTSTYLE,c.FONT_ITALIC,e.isItalic),n=Ee(n,c.STYLE_FONTSTYLE,c.FONT_UNDERLINE,e.isUnderline),n=Ee(n,c.STYLE_FONTSTYLE,c.FONT_STRIKETHROUGH,e.isStrikeThrough),n=F(n,c.STYLE_TEXT_OPACITY,e.opacity,ve)),n),hn=(n,e,t)=>(n==null?void 0:n.split(";").map(s=>s.split("=")).filter(([s])=>s===e).map(([,s])=>s)[0])??t,fn=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}},gn=(n,e)=>{const t=e.color;if(t){const s=pn(t),i=s?t.startColor:t;n=F(n,c.STYLE_FILLCOLOR,i,Ce),s?(n=O.setStyle(n,c.STYLE_GRADIENTCOLOR,t.endColor),n=O.setStyle(n,c.STYLE_GRADIENT_DIRECTION,fn(t.direction))):t==="default"&&(n=O.setStyle(n,c.STYLE_GRADIENTCOLOR,void 0),n=O.setStyle(n,c.STYLE_GRADIENT_DIRECTION,void 0)),(n.includes(d.POOL)||n.includes(d.LANE))&&(n=F(n,c.STYLE_SWIMLANE_FILLCOLOR,i,Ce))}return n=F(n,c.STYLE_FILL_OPACITY,e.opacity,ve),n},Tn=n=>n&&typeof n=="object"&&"fill"in n,pn=n=>n&&typeof n=="object",it=12;class Ot{constructor(e){g(this,"specificFlowStyles",new Re([[k.SEQUENCE_FLOW,e=>{e[c.STYLE_ENDARROW]=c.ARROW_BLOCK_THIN}],[k.MESSAGE_FLOW,e=>{e[c.STYLE_DASHED]=!0,e[c.STYLE_DASH_PATTERN]="8 5",e[c.STYLE_STARTARROW]=c.ARROW_OVAL,e[c.STYLE_STARTSIZE]=8,e[c.STYLE_STARTFILL]=!0,e[I.EDGE_START_FILL_COLOR]=E.MESSAGE_FLOW_MARKER_START_FILL_COLOR,e[c.STYLE_ENDARROW]=c.ARROW_BLOCK_THIN,e[c.STYLE_ENDFILL]=!0,e[I.EDGE_END_FILL_COLOR]=E.MESSAGE_FLOW_MARKER_END_FILL_COLOR}],[k.ASSOCIATION_FLOW,e=>{e[c.STYLE_DASHED]=!0,e[c.STYLE_DASH_PATTERN]="1 2",e[c.STYLE_STARTSIZE]=it}]]));g(this,"specificSequenceFlowStyles",new Re([[G.DEFAULT,e=>{e[c.STYLE_STARTARROW]=mt.ARROW_DASH}],[G.CONDITIONAL_FROM_ACTIVITY,e=>{e[c.STYLE_STARTARROW]=c.ARROW_DIAMOND_THIN,e[c.STYLE_STARTSIZE]=18,e[c.STYLE_STARTFILL]=!0,e[I.EDGE_START_FILL_COLOR]=E.SEQUENCE_FLOW_CONDITIONAL_FROM_ACTIVITY_MARKER_FILL_COLOR}]]));g(this,"specificAssociationFlowStyles",new Re([[j.NONE,e=>{}],[j.ONE,e=>{e[c.STYLE_ENDARROW]=c.ARROW_OPEN_THIN}],[j.BOTH,e=>{e[c.STYLE_STARTARROW]=c.ARROW_OPEN_THIN,e[c.STYLE_ENDARROW]=c.ARROW_OPEN_THIN}]]));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();ot(e),e[c.STYLE_ABSOLUTE_ARCSIZE]=!0,e[c.STYLE_ARCSIZE]=E.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]=E.POOL_LABEL_SIZE,e[c.STYLE_FILLCOLOR]=E.POOL_LABEL_FILL_COLOR,this.graph.getStylesheet().putCellStyle(d.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]=E.LANE_LABEL_SIZE,e[c.STYLE_FILLCOLOR]=E.LANE_LABEL_FILL_COLOR,this.graph.getStylesheet().putCellStyle(d.LANE,e)}configureEventStyles(){C.eventKinds().forEach(e=>{const t={};t[c.STYLE_SHAPE]=e,t[c.STYLE_PERIMETER]=st.EllipsePerimeter,t[c.STYLE_STROKEWIDTH]=e==d.EVENT_END?E.STROKE_WIDTH_THICK:E.STROKE_WIDTH_THIN,t[c.STYLE_VERTICAL_LABEL_POSITION]=c.ALIGN_BOTTOM,this.putCellStyle(e,t)})}configureTextAnnotationStyle(){const e={};e[c.STYLE_SHAPE]=d.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]=E.TEXT_ANNOTATION_FILL_COLOR,e[c.STYLE_STROKEWIDTH]=E.STROKE_WIDTH_THIN,this.putCellStyle(d.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]=E.STROKE_WIDTH_THIN,e[c.STYLE_FILLCOLOR]=E.GROUP_FILL_COLOR,e[c.STYLE_ALIGN]=c.ALIGN_CENTER,e[c.STYLE_VERTICAL_ALIGN]=c.ALIGN_TOP,this.putCellStyle(d.GROUP,e)}configureActivityStyles(){C.activityKinds().forEach(e=>{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==d.CALL_ACTIVITY?E.STROKE_WIDTH_THICK:E.STROKE_WIDTH_THIN,this.putCellStyle(e,t)})}configureGatewayStyles(){C.gatewayKinds().forEach(e=>{const t={};t[c.STYLE_SHAPE]=e,t[c.STYLE_PERIMETER]=st.RhombusPerimeter,t[c.STYLE_STROKEWIDTH]=E.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();ot(e),e[c.STYLE_SHAPE]=I.EDGE,e[c.STYLE_ENDSIZE]=it,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){e.forEach(s=>{const i={};t.get(s)(i),this.graph.getStylesheet().putCellStyle(s.toString(),i)})}configureFlowStyles(){this.configureEdgeStyles(Object.values(k),this.specificFlowStyles),this.configureEdgeStyles(Object.values(G),this.specificSequenceFlowStyles),this.configureEdgeStyles(Object.values(j),this.specificAssociationFlowStyles)}}function ot(n){n[c.STYLE_FONTFAMILY]=E.DEFAULT_FONT_FAMILY,n[c.STYLE_FONTSIZE]=E.DEFAULT_FONT_SIZE,n[c.STYLE_FONTCOLOR]=E.DEFAULT_FONT_COLOR,n[c.STYLE_FILLCOLOR]=E.DEFAULT_FILL_COLOR,n[c.STYLE_STROKECOLOR]=E.DEFAULT_STROKE_COLOR,n[c.STYLE_LABEL_BACKGROUNDCOLOR]=c.NONE,n[c.STYLE_WHITE_SPACE]="wrap"}class Re extends Map{get(e){return super.get(e)??(()=>{})}}function En(n,e,t,s){let i,o;n.heightT.setIconOriginForIconCentered(),shapeConfig:{x:e,y:t,width:s,height:i,strokeWidth:u},iconStyleConfig:{isFilled:l,fillColor:h,strokeColor:f,strokeWidth:a,margin:p}}}class X{paintEmptyIcon(){}newBpmnCanvas({canvas:e,ratioFromParent:t,setIconOriginFunct:s,shapeConfig:i,iconStyleConfig:o},r){return new Sn({canvas:e,shapeConfig:i,iconConfig:{originalSize:r,styleConfig:o,ratioFromParent:t,setIconOriginFunct:s}})}paintEnvelopeIcon(e){const t={width:485.41,height:321.76},s=this.newBpmnCanvas(e,t),i=t.width,o=t.height;s.rect(0,0,i,o),s.fillAndStroke();const{iconStyleConfig:r}=e;r.isFilled&&s.setStrokeColor(r.fillColor),s.begin(),s.moveTo(0,0),s.lineTo(i*.5,o*.6),s.lineTo(i,0),s.moveTo(0,o),s.lineTo(i/3,o*.45),s.moveTo(i,o),s.lineTo(i*2/3,o*.45),s.stroke()}paintCircleIcon(e){const t={width:e.shapeConfig.width,height:e.shapeConfig.height},s=this.newBpmnCanvas(e,t),i=t.width,o=t.height;i>0&&o>0&&s.ellipse(0,0,i,o),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});be(e,t),t.fillAndStroke(),be(e,t),t.rotateOnIconCenter(60),t.fillAndStroke(),be(e,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});X.paintGearIconBackground(t),t.translateIconOrigin(14,14),X.paintGearIconForeground(t)}static paintGearIconBackground(e){e.begin(),e.moveTo(2.06,24.62),e.lineTo(10.17,30.95),e.lineTo(9.29,37.73),e.lineTo(0,41.42),e.lineTo(2.95,54.24),e.lineTo(13.41,52.92),e.lineTo(17.39,58.52),e.lineTo(13.56,67.66),e.lineTo(24.47,74.44),e.lineTo(30.81,66.33),e.lineTo(37.88,67.21),e.lineTo(41.57,76.5),e.lineTo(54.24,73.55),e.lineTo(53.06,62.94),e.lineTo(58.52,58.52),e.lineTo(67.21,63.09),e.lineTo(74.58,51.88),e.lineTo(66.03,45.25),e.lineTo(66.92,38.62),e.lineTo(76.5,34.93),e.lineTo(73.7,22.26),e.lineTo(62.64,23.44),e.lineTo(58.81,18.42),e.lineTo(62.79,8.7),e.lineTo(51.74,2.21),e.lineTo(44.81,10.47),e.lineTo(38.03,9.43),e.lineTo(33.75,0),e.lineTo(21.52,3.24),e.lineTo(22.7,13.56),e.lineTo(18.13,17.54),e.lineTo(8.7,13.56),e.close();const t=24.8,s=39;X.paintGearInnerCircle(e,t,s)}static paintGearIconForeground(e){e.begin(),e.moveTo(16.46,41.42),e.lineTo(24.57,47.75),e.lineTo(23.69,54.53),e.lineTo(14.4,58.22),e.lineTo(17.35,71.04),e.lineTo(27.81,69.72),e.lineTo(31.79,75.32),e.lineTo(27.96,84.46),e.lineTo(38.87,91.24),e.lineTo(45.21,83.13),e.lineTo(52.28,84.01),e.lineTo(55.97,93.3),e.lineTo(68.64,90.35),e.lineTo(67.46,79.74),e.lineTo(72.92,75.32),e.lineTo(81.61,79.89),e.lineTo(88.98,68.68),e.lineTo(80.43,62.05),e.lineTo(81.32,55.42),e.lineTo(90.9,51.73),e.lineTo(88.1,39.06),e.lineTo(77.04,40.24),e.lineTo(73.21,35.22),e.lineTo(77.19,25.5),e.lineTo(66.14,19.01),e.lineTo(59.21,27.27),e.lineTo(52.43,26.23),e.lineTo(48.15,16.8),e.lineTo(35.92,20.04),e.lineTo(37.1,30.36),e.lineTo(32.53,34.34),e.lineTo(23.1,30.36),e.close();const t=39.2,s=55.8;X.paintGearInnerCircle(e,t,s),e.begin(),X.paintGearInnerCircle(e,t,s)}static paintGearInnerCircle(e,t,s){e.moveTo(t,s),e.arcTo(13.5,13.5,0,1,1,t+2*13.5,s),e.arcTo(13.5,13.5,0,0,1,t,s),e.close(),e.fillAndStroke()}paintExpandIcon(e){const t={width:16,height:16},s=this.newBpmnCanvas(e,t),i=t.width,o=t.height;s.roundrect(0,0,i,o,2,2),s.stroke(),s.begin(),s.moveTo(i/2,o/4),s.lineTo(i/2,o*3/4),s.close(),s.moveTo(i/4,o/2),s.lineTo(i*3/4,o/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:i,iconStyleConfig:o}=e;i.setFillColor(o.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:i,iconStyleConfig:o}=e;i.setFillColor(o.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 be(n,e){e.begin(),e.moveTo(.38,0),e.lineTo(.62,0),e.lineTo(.62,1),e.lineTo(.38,1),e.close()}class te{static get(){return this.instance}static set(e){this.instance=e}}g(te,"instance",new X);class Q extends L.mxEllipse{constructor(){super(void 0,void 0,void 0);g(this,"iconPainter",te.get());g(this,"iconPainters",new Map([[R.MESSAGE,t=>this.iconPainter.paintEnvelopeIcon({...t,ratioFromParent:.5})],[R.TERMINATE,t=>this.iconPainter.paintCircleIcon({...t,ratioFromParent:.6})],[R.TIMER,t=>this.iconPainter.paintClockIcon({...t,setIconOriginFunct:s=>s.setIconOriginToShapeTopLeftProportionally(5)})],[R.SIGNAL,t=>this.iconPainter.paintTriangleIcon({...t,ratioFromParent:.55,iconStyleConfig:{...t.iconStyleConfig,strokeWidth:E.STROKE_WIDTH_THIN.valueOf()},setIconOriginFunct:s=>s.setIconOriginToShapeTopLeftProportionally(4)})],[R.LINK,t=>this.iconPainter.paintRightArrowIcon({...t,ratioFromParent:.55,iconStyleConfig:{...t.iconStyleConfig,strokeWidth:1.5}})],[R.ERROR,t=>this.iconPainter.paintErrorIcon({...t,ratioFromParent:.55,iconStyleConfig:{...t.iconStyleConfig,strokeWidth:1.5}})],[R.COMPENSATION,t=>this.iconPainter.paintDoubleLeftArrowheadsIcon({...t,ratioFromParent:.7,iconStyleConfig:{...t.iconStyleConfig,strokeWidth:1.5}})],[R.CANCEL,t=>this.iconPainter.paintXCrossIcon({...t,ratioFromParent:.78})],[R.ESCALATION,t=>this.iconPainter.paintUpArrowheadIcon({...t,ratioFromParent:.55,iconStyleConfig:{...t.iconStyleConfig,strokeWidth:E.STROKE_WIDTH_THIN.valueOf()}})],[R.CONDITIONAL,t=>this.iconPainter.paintListIcon({...t,ratioFromParent:.6,iconStyleConfig:{...t.iconStyleConfig,strokeWidth:1.5}})]]));g(this,"withFilledIcon",!1)}paintVertexShape(t,s,i,o,r){const l=ee({canvas:t,x:s,y:i,width:o,height:r,shape:this,isFilled:this.withFilledIcon});Q.setDashedOuterShapePattern(l,O.getValue(this.style,I.IS_INTERRUPTING,void 0)),this.paintOuterShape(l),Q.restoreOriginalOuterShapePattern(l),this.paintInnerShape(l)}paintOuterShape({canvas:t,shapeConfig:{x:s,y:i,width:o,height:r}}){super.paintVertexShape(t,s,i,o,r)}paintInnerShape(t){(this.iconPainters.get(O.getValue(this.style,I.EVENT_DEFINITION_KIND,R.NONE))??(()=>this.iconPainter.paintEmptyIcon()))(t)}static setDashedOuterShapePattern(t,s){t.canvas.save(),s==="false"&&(t.canvas.setDashed(!0,!1),t.canvas.setDashPattern("3 2"))}static restoreOriginalOuterShapePattern(t){t.canvas.restore()}}class In extends Q{constructor(){super(),this.withFilledIcon=!0}}class Me extends Q{paintOuterShape({canvas:e,shapeConfig:{x:t,y:s,width:i,height:o,strokeWidth:r}}){e.ellipse(t,s,i,o),e.fillAndStroke();const l=r*1.5;e.ellipse(i*.02+l+t,o*.02+l+s,i*.96-2*l,o*.96-2*l),e.stroke()}}class Cn extends Me{constructor(){super(),this.withFilledIcon=!0}}class ge extends L.mxRhombus{constructor(){super(...arguments);g(this,"iconPainter",te.get())}paintVertexShape(t,s,i,o,r){const l=ee({canvas:t,x:s,y:i,width:o,height:r,shape:this});this.paintOuterShape(l),this.paintInnerShape(l)}paintOuterShape({canvas:t,shapeConfig:{x:s,y:i,width:o,height:r}}){super.paintVertexShape(t,s,i,o,r)}}class mn extends ge{paintInnerShape(e){this.iconPainter.paintXCrossIcon({...e,iconStyleConfig:{...e.iconStyleConfig,isFilled:!0},ratioFromParent:.5})}}class An extends ge{paintInnerShape(e){this.iconPainter.paintPlusCrossIcon({...e,iconStyleConfig:{...e.iconStyleConfig,isFilled:!0},ratioFromParent:.5})}}class On extends ge{paintInnerShape(e){this.iconPainter.paintCircleIcon({...e,ratioFromParent:.62,iconStyleConfig:{...e.iconStyleConfig,isFilled:!1,strokeWidth:E.STROKE_WIDTH_THICK.valueOf()}})}}class Nn extends ge{paintInnerShape(e){this.iconPainter.paintAsteriskIcon({...e,iconStyleConfig:{...e.iconStyleConfig,isFilled:!0},ratioFromParent:.5})}}class vn extends ge{paintInnerShape(e){e={...e,iconStyleConfig:{...e.iconStyleConfig,strokeWidth:1}},this.iconPainter.paintCircleIcon({...e,ratioFromParent:.55}),At(this.style)||this.iconPainter.paintCircleIcon({...e,ratioFromParent:.45});const t={...e,ratioFromParent:.3};O.getValue(this.style,I.EVENT_BASED_GATEWAY_KIND,ce.Exclusive)==ce.Parallel?this.iconPainter.paintPlusCrossIcon(t):this.iconPainter.paintPentagon(t)}}const Ln=[w.LOOP,w.MULTI_INSTANCE_PARALLEL,w.MULTI_INSTANCE_SEQUENTIAL,w.COMPENSATION,w.EXPAND,w.ADHOC];function yn(n){const e=Ln.filter(t=>n.includes(t));return n.filter(t=>!e.includes(t)).forEach(t=>e.push(t)),e}function Nt(n,e){te.get().paintEnvelopeIcon({...n,setIconOriginFunct:t=>t.setIconOriginToShapeTopLeft(),ratioFromParent:.2,iconStyleConfig:{...n.iconStyleConfig,isFilled:e}})}class De extends We{constructor(){super(void 0,void 0,void 0);g(this,"iconPainter",te.get())}paintForeground(t,s,i,o,r){super.paintForeground(t,s,i,o,r),this.paintMarkerIcons(ee({canvas:t,x:s,y:i,width:o,height:r,shape:this,ratioFromParent:0,iconStrokeWidth:1.5}))}paintMarkerIcons(t){const s=O.getValue(this.style,I.MARKERS,void 0);s&&yn(s.split(",")).forEach((i,o,r)=>{switch(t={...t,setIconOriginFunct:this.getMarkerIconOriginFunction(r.length,o+1)},t.canvas.save(),i){case w.LOOP:this.iconPainter.paintLoopIcon(t);break;case w.MULTI_INSTANCE_SEQUENTIAL:this.iconPainter.paintSequentialMultiInstanceIcon(t);break;case w.MULTI_INSTANCE_PARALLEL:this.iconPainter.paintParallelMultiInstanceIcon(t);break;case w.EXPAND:this.iconPainter.paintExpandIcon(t);break}t.canvas.restore()})}getMarkerIconOriginFunction(t,s){let i;return t===1?i=o=>o.setIconOriginForIconBottomCentered():i=o=>{o.setIconOriginForIconBottomCentered();const r=Math.pow(-1,s)*(E.SHAPE_ACTIVITY_MARKER_ICON_SIZE/2+E.SHAPE_ACTIVITY_MARKER_ICON_MARGIN);o.translateIconOrigin(r,0)},i}}class H extends De{paintForeground(e,t,s,i,o){super.paintForeground(e,t,s,i,o),this.paintTaskIcon(ee({canvas:e,x:t,y:s,width:i,height:o,shape:this}))}}class _n extends H{paintTaskIcon(e){this.iconPainter.paintEmptyIcon()}}class wn extends H{paintTaskIcon(e){this.iconPainter.paintGearIcon({...e,setIconOriginFunct:t=>t.setIconOriginToShapeTopLeftProportionally(20)})}}class Rn extends H{paintTaskIcon(e){this.iconPainter.paintPersonIcon({...e,setIconOriginFunct:t=>t.setIconOriginToShapeTopLeftProportionally(20)})}}class bn extends H{paintTaskIcon(e){if(!At(this.style)){Nt(e,!1);return}const t=4,s=4,i={...e.shapeConfig,width:20,height:20};this.iconPainter.paintCircleIcon({canvas:e.canvas,shapeConfig:i,iconStyleConfig:{...e.iconStyleConfig,isFilled:!1},ratioFromParent:void 0,setIconOriginFunct:o=>o.setIconOriginToShapeTopLeft(s,t)}),i.x+=t,i.y+=s,this.iconPainter.paintEnvelopeIcon({...e,shapeConfig:i,ratioFromParent:.65,setIconOriginFunct:o=>o.setIconOriginForIconCentered()})}}class Fn extends H{paintTaskIcon(e){Nt(e,!0)}}class Pn extends H{paintTaskIcon(e){this.iconPainter.paintHandIcon({...e,ratioFromParent:.18,setIconOriginFunct:t=>t.setIconOriginToShapeTopLeftProportionally(20)})}}class xn extends H{paintTaskIcon(e){this.iconPainter.paintScriptIcon({...e,ratioFromParent:.22,setIconOriginFunct:t=>t.setIconOriginToShapeTopLeftProportionally(20)})}}class kn extends De{paintForeground(e,t,s,i,o){super.paintForeground(e,t,s,i,o);const r=ee({canvas:e,x:t,y:s,width:i,height:o,shape:this});switch(O.getValue(this.style,I.GLOBAL_TASK_KIND,void 0)){case d.GLOBAL_TASK_MANUAL:this.iconPainter.paintHandIcon({...r,ratioFromParent:.18,setIconOriginFunct:l=>l.setIconOriginToShapeTopLeftProportionally(20)});break;case d.GLOBAL_TASK_SCRIPT:this.iconPainter.paintScriptIcon({...r,ratioFromParent:.22,setIconOriginFunct:l=>l.setIconOriginToShapeTopLeftProportionally(20)});break;case d.GLOBAL_TASK_USER:this.iconPainter.paintPersonIcon({...r,setIconOriginFunct:l=>l.setIconOriginToShapeTopLeftProportionally(20)});break;case d.GLOBAL_TASK_BUSINESS_RULE:this.iconPainter.paintTableIcon({...r,ratioFromParent:.6,setIconOriginFunct:l=>l.setIconOriginToShapeTopLeftProportionally(15)});break;case d.GLOBAL_TASK:default:this.iconPainter.paintEmptyIcon()}}}class Mn extends De{paintBackground(e,t,s,i,o){const r=O.getValue(this.style,I.SUB_PROCESS_KIND,void 0);if(e.save(),r===U.EVENT&&(e.setDashed(!0,!1),e.setDashPattern("1 2")),super.paintBackground(e,t,s,i,o),r===U.TRANSACTION){const l=E.SUB_PROCESS_TRANSACTION_INNER_RECT_OFFSET,a=E.SUB_PROCESS_TRANSACTION_INNER_RECT_ARC_SIZE;e.roundrect(t+l,s+l,i-2*l,o-2*l,a,a),e.stroke()}e.restore()}}class Bn extends H{paintTaskIcon(e){this.iconPainter.paintTableIcon({...e,ratioFromParent:.6,setIconOriginFunct:t=>t.setIconOriginToShapeTopLeftProportionally(15)})}}class Gn extends We{paintForeground(e,t,s,i,o){e.begin(),e.moveTo(t+E.TEXT_ANNOTATION_BORDER_LENGTH,s),e.lineTo(t,s),e.lineTo(t,s+o),e.lineTo(t+E.TEXT_ANNOTATION_BORDER_LENGTH,s+o),e.stroke()}paintBackground(e,t,s,i,o){e.save(),e.setStrokeColor("none"),super.paintBackground(e,t,s,i,o),e.restore()}}class Yn extends We{constructor(){super(...arguments);g(this,"iconPainter",te.get())}paintVertexShape(t,s,i,o,r){const l=ee({canvas:t,x:s,y:i,width:o,height:r,shape:this,ratioFromParent:1,isFilled:O.getValue(this.style,I.IS_INITIATING,"true")=="false"});this.iconPainter.paintEnvelopeIcon(l)}}function Vn(n){return Object.values(k).map(e=>e).includes(n)}function Un(n,e){return Wn(n.style,e)}function Wn(n,e){const t=[],s=n.split(";"),o=s[0].replace(/shape=bpmn./g,""),r=new Map;return r.set("bpmn-type-activity",C.isActivity(o)),r.set("bpmn-type-container",C.isPoolOrLane(o)),r.set("bpmn-type-event",C.isEvent(o)),r.set("bpmn-type-flow",Vn(o)),r.set("bpmn-type-gateway",C.isGateway(o)),r.set("bpmn-type-task",C.isTask(o)),[...r].filter(([,l])=>l).forEach(([l])=>t.push(l)),t.push(Be(o)),s.map(l=>{const a=l.split("=");return[a[0],a[1]]}).forEach(([l,a])=>{switch(l){case I.EVENT_DEFINITION_KIND:t.push(`bpmn-event-def-${a}`);break;case I.EVENT_BASED_GATEWAY_KIND:t.push(`bpmn-gateway-kind-${a.toLowerCase()}`);break;case I.IS_INITIATING:t.push(a=="true"?"bpmn-icon-initiating":"bpmn-icon-non-initiating");break;case I.SUB_PROCESS_KIND:t.push(`bpmn-sub-process-${a.toLowerCase()}`);break;case I.GLOBAL_TASK_KIND:t.push(Be(a));break}}),e&&t.push("bpmn-label"),t}function Be(n){return n?"bpmn-"+n.replace(/([A-Z])/g,e=>"-"+e[0].toLowerCase()):""}class Dn extends L.mxConnector{paintEdgeShape(e,t){const s=this.createMarker(e,t,!0),i=this.createMarker(e,t,!1);this.paintEdgeLine(e,t),e.setShadow(!1),e.setDashed(!1,!1),s!=null&&(e.setFillColor(O.getValue(this.style,I.EDGE_START_FILL_COLOR,this.stroke)),s()),i!=null&&(e.setFillColor(O.getValue(this.style,I.EDGE_END_FILL_COLOR,this.stroke)),i())}paintEdgeLine(e,t){const s=Hn(e);rt(e,"stroke"),this.paintLine(e,t,this.isRounded),rt(e,s)}}function Hn(n){return n instanceof ue?n.pointerEventsValue:null}function rt(n,e){n instanceof ue&&(n.pointerEventsValue=e)}class Kn{configureShapes(){this.initMxSvgCanvasPrototype(),this.initMxShapePrototype(),this.registerShapes()}registerShapes(){v.registerShape(d.EVENT_END,In),v.registerShape(d.EVENT_START,Q),v.registerShape(d.EVENT_INTERMEDIATE_THROW,Cn),v.registerShape(d.EVENT_INTERMEDIATE_CATCH,Me),v.registerShape(d.EVENT_BOUNDARY,Me),v.registerShape(d.GATEWAY_COMPLEX,Nn),v.registerShape(d.GATEWAY_EVENT_BASED,vn),v.registerShape(d.GATEWAY_EXCLUSIVE,mn),v.registerShape(d.GATEWAY_INCLUSIVE,On),v.registerShape(d.GATEWAY_PARALLEL,An),v.registerShape(d.SUB_PROCESS,Mn),v.registerShape(d.CALL_ACTIVITY,kn),v.registerShape(d.TASK,_n),v.registerShape(d.TASK_SERVICE,wn),v.registerShape(d.TASK_USER,Rn),v.registerShape(d.TASK_RECEIVE,bn),v.registerShape(d.TASK_SEND,Fn),v.registerShape(d.TASK_MANUAL,Pn),v.registerShape(d.TASK_SCRIPT,xn),v.registerShape(d.TASK_BUSINESS_RULE,Bn),v.registerShape(d.TEXT_ANNOTATION,Gn),v.registerShape(I.EDGE,Dn),v.registerShape(I.MESSAGE_FLOW_ICON,Yn)}initMxSvgCanvasPrototype(){ue.prototype.getTextCss=function(){const e=this.state,t=c.ABSOLUTE_LINE_HEIGHT?e.fontSize*c.LINE_HEIGHT+"px":c.LINE_HEIGHT*this.lineHeightCorrection;let s="display: inline-block; font-size: "+e.fontSize+"px; font-family: "+e.fontFamily+"; color: "+e.fontColor+"; line-height: "+t+"; pointer-events: none; ";(e.fontStyle&c.FONT_BOLD)==c.FONT_BOLD&&(s+="font-weight: bold; "),(e.fontStyle&c.FONT_ITALIC)==c.FONT_ITALIC&&(s+="font-style: italic; ");const i=[];return(e.fontStyle&c.FONT_UNDERLINE)==c.FONT_UNDERLINE&&i.push("underline"),(e.fontStyle&c.FONT_STRIKETHROUGH)==c.FONT_STRIKETHROUGH&&i.push("line-through"),i.length>0&&(s+="text-decoration: "+i.join(" ")+"; "),s}}initMxShapePrototype(){L.mxShape.prototype.createSvgCanvas=function(){var s;const e=new ue(this.node,!1);e.strokeTolerance=this.pointerEvents?this.svgStrokeTolerance:0,e.pointerEventsValue=this.svgPointerEvents;const t=this.getSvgScreenOffset();if(t!=0?this.node.setAttribute("transform","translate("+t+","+t+")"):this.node.removeAttribute("transform"),(s=this.state)!=null&&s.cell){const i=this.state.cell;let o=Un(i,this.dialect===c.DIALECT_STRICTHTML);const r=this.state.style[I.EXTRA_CSS_CLASSES];typeof r=="string"&&(o=o.concat(r.split(","))),this.node.setAttribute("class",o.join(" ")),this.node.setAttribute("data-bpmn-id",this.state.cell.id)}return e.minStrokeWidth=this.minSvgStrokeWidth,this.antiAlias||(e.format=function(i){return Math.round(parseFloat(i))}),e}}}class zn{configureMarkers(){this.registerArrowDashMarker()}registerArrowDashMarker(){const e=(t,s,i,o,r,l,a,u,h)=>{const f=r*(a+h+4),p=l*(a+h+4);return function(){t.begin(),t.moveTo(o.x-f/2-p/2,o.y-p/2+f/2),t.lineTo(o.x+p/2-3*f/2,o.y-3*p/2-f/2),t.stroke()}};L.mxMarker.addMarker(mt.ARROW_DASH,e)}}var Xn=typeof global=="object"&&global&&global.Object===Object&&global;const $n=Xn;var jn=typeof self=="object"&&self&&self.Object===Object&&self,Zn=$n||jn||Function("return this")();const vt=Zn;var qn=vt.Symbol;const me=qn;var Lt=Object.prototype,Qn=Lt.hasOwnProperty,Jn=Lt.toString,ie=me?me.toStringTag:void 0;function es(n){var e=Qn.call(n,ie),t=n[ie];try{n[ie]=void 0;var s=!0}catch{}var i=Jn.call(n);return s&&(e?n[ie]=t:delete n[ie]),i}var ts=Object.prototype,ns=ts.toString;function ss(n){return ns.call(n)}var is="[object Null]",os="[object Undefined]",lt=me?me.toStringTag:void 0;function rs(n){return n==null?n===void 0?os:is:lt&< in Object(n)?es(n):ss(n)}function ls(n){return n!=null&&typeof n=="object"}var as="[object Symbol]";function cs(n){return typeof n=="symbol"||ls(n)&&rs(n)==as}var us=/\s/;function ds(n){for(var e=n.length;e--&&us.test(n.charAt(e)););return e}var hs=/^\s+/;function fs(n){return n&&n.slice(0,ds(n)+1).replace(hs,"")}function Ae(n){var e=typeof n;return n!=null&&(e=="object"||e=="function")}var at=0/0,gs=/^[-+]0x[0-9a-f]+$/i,Ts=/^0b[01]+$/i,ps=/^0o[0-7]+$/i,Es=parseInt;function ct(n){if(typeof n=="number")return n;if(cs(n))return at;if(Ae(n)){var e=typeof n.valueOf=="function"?n.valueOf():n;n=Ae(e)?e+"":e}if(typeof n!="string")return n===0?n:+n;n=fs(n);var t=Ts.test(n);return t||ps.test(n)?Es(n.slice(2),t?2:8):gs.test(n)?at:+n}var Ss=function(){return vt.Date.now()};const Fe=Ss;var Is="Expected a function",Cs=Math.max,ms=Math.min;function yt(n,e,t){var s,i,o,r,l,a,u=0,h=!1,f=!1,p=!0;if(typeof n!="function")throw new TypeError(Is);e=ct(e)||0,Ae(t)&&(h=!!t.leading,f="maxWait"in t,o=f?Cs(ct(t.maxWait)||0,e):o,p="trailing"in t?!!t.trailing:p);function T(_){var V=s,se=i;return s=i=void 0,u=_,r=n.apply(se,V),r}function m(_){return u=_,l=setTimeout(Te,e),h?T(_):r}function M(_){var V=_-a,se=_-u,et=e-V;return f?ms(et,o-se):et}function z(_){var V=_-a,se=_-u;return a===void 0||V>=e||V<0||f&&se>=o}function Te(){var _=Fe();if(z(_))return Je(_);l=setTimeout(Te,M(_))}function Je(_){return l=void 0,p&&s?T(_):(s=i=void 0,r)}function Zt(){l!==void 0&&clearTimeout(l),u=0,s=a=i=l=void 0}function qt(){return l===void 0?r:Je(Fe())}function we(){var _=Fe(),V=z(_);if(s=arguments,i=this,a=_,V){if(l===void 0)return m(a);if(f)return clearTimeout(l),l=setTimeout(Te,e),T(a)}return l===void 0&&(l=setTimeout(Te,e)),r}return we.cancel=Zt,we.flush=qt,we}var As="Expected a function";function Os(n,e,t){var s=!0,i=!0;if(typeof n!="function")throw new TypeError(As);return Ae(t)&&(s="leading"in t?!!t.leading:s,i="trailing"in t?!!t.trailing:i),yt(n,e,{leading:s,maxWait:e,trailing:i})}class _t extends L.mxCellOverlay{constructor(t,s){super(null,"",s.position.horizontalAlign,s.position.verticalAlign,null,"default");g(this,"style");this.label=t,this.style=s.style}getBounds(t){const s=t.view.graph.getModel().isEdge(t.cell),i=t.view.scale;let o;const r=0,l=0;return s?o=this.computeEdgeBounds(t):(o=new x,this.align==c.ALIGN_LEFT?o.x=t.x:this.align==c.ALIGN_CENTER?o.x=t.x+t.width/2:o.x=t.x+t.width,this.verticalAlign==c.ALIGN_TOP?o.y=t.y:this.verticalAlign==c.ALIGN_MIDDLE?o.y=t.y+t.height/2:o.y=t.y+t.height),new ke(Math.round(o.x-(r*this.defaultOverlap-this.offset.x)*i),Math.round(o.y-(l*this.defaultOverlap-this.offset.y)*i),r*i,l*i)}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 i=s.length/2,o=s[i-1],r=s[i];return new x(o.x+(r.x-o.x)/2,o.y+(r.y-o.y)/2)}}else return s[s.length-1]}}class ut extends L.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}}class Ns extends L.mxCellRenderer{createCellOverlays(e){const s=e.view.graph.getCellOverlays(e.cell);let i=null;if(s!=null){i=new L.mxDictionary;for(const o of s){const r=e.overlays!=null?e.overlays.remove(o):null;if(r!=null){i.put(o,r);continue}let l;o instanceof _t?l=new ut(o.label,new ke(0,0,0,0),o.style):(l=new L.mxImageShape(new ke(0,0,0,0),o.image.src),l.preserveImageAspect=!1),l.dialect=e.view.graph.dialect,l.overlay=o,this.initializeOverlay(e,l),this.installCellOverlayListeners(e,o,l),o.cursor!=null&&(l.node.style.cursor=o.cursor),l instanceof ut&&(l.node.classList.add("overlay-badge"),l.node.setAttribute("data-bpmn-id",e.cell.id)),i.put(o,l)}}e.overlays!=null&&e.overlays.visit(function(o,r){r.destroy()}),e.overlays=i}}const Ge=1.25,vs=1/Ge;class Ls extends L.mxGraph{constructor(t){super(t);g(this,"currentZoomLevel",1);this.zoomFactor=Ge,this.container&&(this.container.style.cursor="default")}createGraphView(){return new ys(this)}createCellRenderer(){return new Ns}batchUpdate(t){this.model.beginUpdate();try{t()}finally{this.model.endUpdate()}}fit(t,s,i,o,r,l,a){const u=super.fit(t,s,i,o,r,l,a);return this.setCurrentZoomLevel(u),u}setCurrentZoomLevel(t){this.currentZoomLevel=t??this.view.scale}zoomActual(){super.zoomActual(),this.setCurrentZoomLevel()}zoomIn(){super.zoomIn(),this.setCurrentZoomLevel()}zoomOut(){super.zoomOut(),this.setCurrentZoomLevel()}customFit(t){this.zoomActual();const s=t==null?void 0:t.type;if(s==null||s==le.None)return;const i=rn(t==null?void 0:t.margin);if(s!=le.Center){let o=!1,r=!1;switch(s){case le.Horizontal:r=!0;break;case le.Vertical:o=!0;break}this.fit(this.border,!1,i,!0,o,r)}else{const r=this.getGraphBounds(),l=this.container.clientWidth-i,a=this.container.clientHeight-i,u=r.width/this.view.scale,h=r.height/this.view.scale,f=Math.min(3,Math.min(l/u,a/h));this.setCurrentZoomLevel(f),this.view.scaleAndTranslate(f,(i+l-u*f)/(2*f)-r.x/this.view.scale,(i+a-h*f)/(2*f)-r.y/this.view.scale)}}registerMouseWheelZoomListeners(t){t=ln(t),W.addMouseWheelListener(yt(this.createMouseWheelZoomListener(!0),t.debounceDelay),this.container),W.addMouseWheelListener(Os(this.createMouseWheelZoomListener(!1),t.throttleDelay),this.container)}manageMouseWheelZoomEvent(t,s,i){if(!i)this.currentZoomLevel*=t?Ge:vs;else{const[o,r]=this.getEventRelativeCoordinates(s),[l,a,u]=this.getScaleAndTranslationDeltas(o,r);this.view.scaleAndTranslate(l,this.view.translate.x+a,this.view.translate.y+u),W.consume(s)}}createMouseWheelZoomListener(t){return(s,i)=>{if(W.isConsumed(s))return;const o=s;o.ctrlKey&&!o.altKey&&!o.shiftKey&&!o.metaKey&&this.manageMouseWheelZoomEvent(i,o,t)}}getEventRelativeCoordinates(t){const s=this.container.getBoundingClientRect(),i=t.clientX-s.left,o=t.clientY-s.top;return[i,o]}getScaleAndTranslationDeltas(t,s){const[i,o]=this.calculateFactorAndScale(),[r,l]=this.calculateTranslationDeltas(i,o,t*2,s*2);return[o,r,l]}calculateTranslationDeltas(t,s,i,o){if(t>1){const r=(t-1)/(s*2);i*=-r,o*=-r}else{const r=(1/t-1)/(this.view.scale*2);i*=r,o*=r}return[i,o]}calculateFactorAndScale(){const t=Math.round(this.currentZoomLevel*100)/100;return[t/this.view.scale,t]}}class ys extends L.mxGraphView{getFloatingTerminalPoint(e,t,s,i){if(e.absolutePoints.filter(Boolean).length<2)return super.getFloatingTerminalPoint(e,t,s,i);const l=e.absolutePoints;return i?l[1]:l[l.length-2]}}class _s{constructor(e){g(this,"graph");this.container=e,this.graph=new Ls(e)}configure(e){return this.configureGraph(),this.configureNavigationSupport(e),new Ot(this.graph).configureStyles(),new Kn().configureShapes(),new zn().configureMarkers(),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}configureNavigationSupport(e){var s;const t=this.graph.panningHandler;(s=e==null?void 0:e.navigation)!=null&&s.enabled?(t.addListener(W.PAN_START,this.getPanningHandler("grab")),t.addListener(W.PAN_END,this.getPanningHandler("default")),t.usePopupTrigger=!1,t.isForcePanningEvent=i=>W.isLeftMouseButton(i.getEvent())||W.isMultiTouchEvent(i.getEvent()),this.graph.setPanning(!0),this.graph.registerMouseWheelZoomListeners(e.navigation.zoom)):(this.graph.setPanning(!1),t.setPinchEnabled(!1),t.isForcePanningEvent=i=>!1)}getPanningHandler(e){return()=>{this.graph.isEnabled()&&(this.container.style.cursor=e)}}}class Le{constructor(e,t,s,i,o){this.id=e,this.name=t,this.kind=s,this.sourceRefId=i,this.targetRefId=o}}class wt extends Le{constructor(e,t,s,i,o=G.NORMAL){super(e,t,k.SEQUENCE_FLOW,s,i),this.sequenceFlowKind=o}}class Rt extends Le{constructor(e,t,s,i){super(e,t,k.MESSAGE_FLOW,s,i)}}class bt extends Le{constructor(e,t,s,i,o=j.NONE){super(e,t,k.ASSOCIATION_FLOW,s,i),this.associationDirectionKind=o}}class ws{constructor(e){this.graph=e}computeRelativeCoordinates(e,t){const s=this.getTranslateForRoot(e),i=t.x+s.x,o=t.y+s.y;return new x(i,o)}getTranslateForRoot(e){const t=this.graph.getModel(),s=new x(0,0);for(;e!=null;){const i=t.getGeometry(e);i!=null&&(s.x-=i.x,s.y-=i.y),e=t.getParent(e)}return s}computeEdgeCenter(e){const t=e.geometry.points,s=t[0],i=t[t.length-1];if(s!=null&&i!=null){const o=i.x-s.x,r=i.y-s.y;return new x(s.x+o/2,s.y+r/2)}}}class Se{constructor(e,t,s,i,o){g(this,"extensions",{});this.id=e,this.bpmnElement=t,this.bounds=s,this.label=i,this.isHorizontal=o}}class Y{constructor(e,t,s,i,o=!1){g(this,"incomingIds",[]);g(this,"outgoingIds",[]);this.id=e,this.name=t,this.kind=s,this.parentId=i,this.instantiate=o}}class ye extends Y{constructor(e,t,s,i,o,r=[]){super(e,t,s,i,o),this.markers=r}}class de extends ye{constructor(e,t,s,i,o,r){super(e,t,d.CALL_ACTIVITY,i,void 0,o),this.callActivityKind=s,this.globalTaskKind=r}}class Oe extends ye{constructor(e,t,s,i,o){s==U.AD_HOC&&!o.includes(w.ADHOC)&&o.push(w.ADHOC),super(e,t,d.SUB_PROCESS,i,void 0,o),this.subProcessKind=s}}class he extends Y{constructor(e,t,s,i,o){super(e,t,s,o),this.eventDefinitionKind=i}}class Ft extends he{constructor(e,t,s,i,o){super(e,t,d.EVENT_START,s,i),this.isInterrupting=o}}class Pt extends he{constructor(e,t,s,i,o=!0){super(e,t,d.EVENT_BOUNDARY,s,i),this.isInterrupting=o}}class xt extends Y{constructor(e,t,s,i,o=ce.None){super(e,t,d.GATEWAY_EVENT_BASED,s,i),this.gatewayKind=o}}class Z{constructor(e){g(this,"ignoreBpmnColors");this.ignoreBpmnColors=(e==null?void 0:e.ignoreBpmnColors)??!0}computeStyle(e,t){const s=[e.bpmnElement.kind];let i;e instanceof Se?i=this.computeShapeStyleValues(e):(s.push(...Z.computeEdgeBaseStyles(e)),i=this.computeEdgeStyleValues(e));const o=this.computeFontStyleValues(e),r=Z.computeLabelStyleValues(e,t);return s.concat(dt([...i,...o,...r])).join(";")}computeShapeStyleValues(e){const t=new Map,s=e.bpmnElement;if(s instanceof he?Z.computeEventShapeStyle(s,t):s instanceof ye?Z.computeActivityShapeStyle(s,t):C.isPoolOrLane(s.kind)?t.set(c.STYLE_HORIZONTAL,e.isHorizontal?"0":"1"):s instanceof xt&&(t.set(I.IS_INSTANTIATING,String(s.instantiate)),t.set(I.EVENT_BASED_GATEWAY_KIND,String(s.gatewayKind))),!this.ignoreBpmnColors){const i=e.extensions,o=i.fillColor;o&&(t.set(c.STYLE_FILLCOLOR,o),C.isPoolOrLane(s.kind)&&t.set(c.STYLE_SWIMLANE_FILLCOLOR,o)),i.strokeColor&&t.set(c.STYLE_STROKECOLOR,i.strokeColor)}return t}static computeEventShapeStyle(e,t){t.set(I.EVENT_DEFINITION_KIND,e.eventDefinitionKind),(e instanceof Pt||e instanceof Ft&&e.isInterrupting!==void 0)&&t.set(I.IS_INTERRUPTING,String(e.isInterrupting))}static computeActivityShapeStyle(e,t){e instanceof Oe?t.set(I.SUB_PROCESS_KIND,e.subProcessKind):e.kind===d.TASK_RECEIVE?t.set(I.IS_INSTANTIATING,String(e.instantiate)):e instanceof de&&t.set(I.GLOBAL_TASK_KIND,e.globalTaskKind);const s=e.markers;s.length>0&&t.set(I.MARKERS,s.join(","))}static computeEdgeBaseStyles(e){const t=[],s=e.bpmnElement;return s instanceof wt&&t.push(s.sequenceFlowKind),s instanceof bt&&t.push(s.associationDirectionKind),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 i,o;const t=new Map,s=(i=e.label)==null?void 0:i.font;if(s&&(t.set(c.STYLE_FONTFAMILY,s.name),t.set(c.STYLE_FONTSIZE,s.size),t.set(c.STYLE_FONTSTYLE,Rs(s))),!this.ignoreBpmnColors){const r=(o=e.label)==null?void 0:o.extensions;r!=null&&r.color&&t.set(c.STYLE_FONTCOLOR,r.color)}return t}static computeLabelStyleValues(e,t){const s=new Map,i=e.bpmnElement;return t?(s.set(c.STYLE_VERTICAL_ALIGN,c.ALIGN_TOP),e.bpmnElement.kind!=d.TEXT_ANNOTATION&&s.set(c.STYLE_ALIGN,c.ALIGN_CENTER),e instanceof Se&&(s.set(c.STYLE_LABEL_WIDTH,t.width+1),s.set(c.STYLE_LABEL_POSITION,"ignore"),s.set(c.STYLE_VERTICAL_LABEL_POSITION,c.ALIGN_MIDDLE))):e instanceof Se&&(i instanceof Oe||i instanceof de&&i.callActivityKind===ae.CALLING_PROCESS)&&!i.markers.includes(w.EXPAND)&&s.set(c.STYLE_VERTICAL_ALIGN,c.ALIGN_TOP),s}computeMessageFlowIconStyle(e){const t=[];return t.push(["shape",I.MESSAGE_FLOW_ICON]),t.push([I.IS_INITIATING,String(e.messageVisibleKind===fe.INITIATING)]),this.ignoreBpmnColors||e.extensions.strokeColor&&t.push([c.STYLE_STROKECOLOR,e.extensions.strokeColor]),dt(t).join(";")}}function Rs(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 dt(n){return n.filter(([,e])=>e&&e!="undefined").map(([e,t])=>`${e}=${t}`)}class bs{constructor(e,t,s){this.graph=e,this.coordinatesTranslator=t,this.styleComputer=s}render(e,t){this.insertShapesAndEdges(e),this.graph.customFit(t)}insertShapesAndEdges({pools:e,lanes:t,subprocesses:s,otherFlowNodes:i,boundaryEvents:o,edges:r}){this.graph.batchUpdate(()=>{this.graph.getModel().clear(),this.insertShapes(e),this.insertShapes(t),this.insertShapes(s),this.insertShapes(i),this.insertShapes(o),this.insertEdges(r)})}insertShapes(e){e.forEach(t=>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),i=e.bounds;let o=(l=e.label)==null?void 0:l.bounds;o=C.isPoolOrLane(t.kind)?void 0:o;const r=this.styleComputer.computeStyle(e,o);this.insertVertex(s,t.id,t.name,i,o,r)}insertEdges(e){e.forEach(t=>{var h;const s=t.bpmnElement,i=this.graph.getDefaultParent(),o=this.getCell(s.sourceRefId),r=this.getCell(s.targetRefId),l=(h=t.label)==null?void 0:h.bounds,a=this.styleComputer.computeStyle(t,l),u=this.graph.insertEdge(i,s.id,s.name,o,r,a);if(this.insertWaypoints(t.waypoints,u),l){u.geometry.width=l.width,u.geometry.height=l.height;const f=this.coordinatesTranslator.computeEdgeCenter(u);if(f){u.geometry.relative=!1;const p=this.coordinatesTranslator.computeRelativeCoordinates(u.parent,new x(l.x,l.y)),T=p.x+l.width/2-f.x,m=p.y-f.y;u.geometry.offset=new x(T,m)}}this.insertMessageFlowIconIfNeeded(t,u)})}insertMessageFlowIconIfNeeded(e,t){if(e.bpmnElement instanceof Rt&&e.messageVisibleKind!==fe.NONE){const s=this.graph.insertVertex(t,He(t.id),void 0,0,0,20,14,this.styleComputer.computeMessageFlowIconStyle(e));s.geometry.relative=!0,s.geometry.offset=new x(-10,-7)}}insertWaypoints(e,t){e&&(t.geometry.points=e.map(s=>this.coordinatesTranslator.computeRelativeCoordinates(t.parent,new x(s.x,s.y))))}getCell(e){return this.graph.getModel().getCell(e)}insertVertex(e,t,s,i,o,r){const l=this.coordinatesTranslator.computeRelativeCoordinates(e,new x(i.x,i.y)),a=this.graph.insertVertex(e,t,s,l.x,l.y,i.width,i.height,r);if(o){const u=o.x-i.x,h=o.y-i.y;a.geometry.offset=new x(u,h)}return a}}function Fs(n,e){return new bs(n,new ws(n),new Z(e))}function He(n){return`messageFlowIcon_of_${n}`}var Ke={},_e={};(function(n){const e=":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",t=e+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040",s="["+e+"]["+t+"]*",i=new RegExp("^"+s+"$"),o=function(l,a){const u=[];let h=a.exec(l);for(;h;){const f=[];f.startIndex=a.lastIndex-h[0].length;const p=h.length;for(let T=0;T"u")};n.isExist=function(l){return typeof l<"u"},n.isEmptyObject=function(l){return Object.keys(l).length===0},n.merge=function(l,a,u){if(a){const h=Object.keys(a),f=h.length;for(let p=0;p"&&n[o]!==" "&&n[o]!==" "&&n[o]!==` -`&&n[o]!=="\r";o++)a+=n[o];if(a=a.trim(),a[a.length-1]==="/"&&(a=a.substring(0,a.length-1),o--),!Us(a)){let f;return a.trim().length===0?f="Invalid space after '<'.":f="Tag '"+a+"' is an invalid name.",y("InvalidTag",f,b(n,o))}const u=Ms(n,o);if(u===!1)return y("InvalidAttr","Attributes for '"+a+"' have open quote.",b(n,o));let h=u.value;if(o=u.index,h[h.length-1]==="/"){const f=o-h.length;h=h.substring(0,h.length-1);const p=Tt(h,e);if(p===!0)s=!0;else return y(p.err.code,p.err.msg,b(n,f+p.err.line))}else if(l)if(u.tagClosed){if(h.trim().length>0)return y("InvalidTag","Closing tag '"+a+"' can't have attributes or invalid starting.",b(n,r));{const f=t.pop();if(a!==f.tagName){let p=b(n,f.tagStartPos);return y("InvalidTag","Expected closing tag '"+f.tagName+"' (opened in line "+p.line+", col "+p.col+") instead of closing tag '"+a+"'.",b(n,r))}t.length==0&&(i=!0)}}else return y("InvalidTag","Closing tag '"+a+"' doesn't have proper closing.",b(n,o));else{const f=Tt(h,e);if(f!==!0)return y(f.err.code,f.err.msg,b(n,o-h.length+f.err.line));if(i===!0)return y("InvalidXml","Multiple possible root nodes found.",b(n,o));e.unpairedTags.indexOf(a)!==-1||t.push({tagName:a,tagStartPos:r}),s=!0}for(o++;o0)return y("InvalidXml","Invalid '"+JSON.stringify(t.map(o=>o.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1})}else return y("InvalidXml","Start tag expected.",1);return!0};function ht(n){return n===" "||n===" "||n===` -`||n==="\r"}function ft(n,e){const t=e;for(;e5&&s==="xml")return y("InvalidXml","XML declaration allowed only at the start of the document.",b(n,e));if(n[e]=="?"&&n[e+1]==">"){e++;break}else continue}return e}function gt(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 xs='"',ks="'";function Ms(n,e){let t="",s="",i=!1;for(;e"&&s===""){i=!0;break}t+=n[e]}return s!==""?!1:{value:t,index:e,tagClosed:i}}const Bs=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function Tt(n,e){const t=ze.getAllMatches(n,Bs),s={};for(let i=0;i!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(n,e,t){return n}},Ws=function(n){return Object.assign({},kt,n)};Xe.buildOptions=Ws;Xe.defaultOptions=kt;class Ds{constructor(e){this.tagname=e,this.child=[],this[":@"]={}}add(e,t){e==="__proto__"&&(e="#__proto__"),this.child.push({[e]:t})}addChild(e){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})}}var Hs=Ds;const Ks=_e;function zs(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,i=!1,o=!1,r="";for(;e"){if(o?n[e-1]==="-"&&n[e-2]==="-"&&(o=!1,s--):s--,s===0)break}else n[e]==="["?i=!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}}function Xs(n,e){let t="";for(;e0&&i&&t[2]!==".")return n;if(!e.leadingZeros&&o.length>0&&!i&&t[1]!==".")return n;{const a=Number(t),u=""+a;return u.search(/[eE]/)!==-1||l?e.eNotation?a:n:t.indexOf(".")!==-1?u==="0"&&r===""||u===r||i&&u==="-"+r?a:n:o?r===u||i+r===u?a:n:t===u||t===i+u?a:n}}else return n}}function oi(n){return n&&n.indexOf(".")!==-1&&(n=n.replace(/0+$/,""),n==="."?n="0":n[0]==="."?n="0"+n:n[n.length-1]==="."&&(n=n.substr(0,n.length-1))),n}var ri=ii;const $e=_e,re=Hs,li=ei,ai=ri;"<((!\\[CDATA\\[([\\s\\S]*?)(]]>))|((NAME:)?(NAME))([^>]*)>|((\\/)(NAME)\\s*>))([^<]*)".replace(/NAME/g,$e.nameRegexp);let ci=class{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:"₹"}},this.addExternalEntities=ui,this.parseXml=Ti,this.parseTextData=di,this.resolveNameSpace=hi,this.buildAttributesMap=gi,this.isItStopNode=Ii,this.replaceEntitiesValue=Ei,this.readStopNodeData=mi,this.saveTextToParentTag=Si,this.addChild=pi}};function ui(n){const e=Object.keys(n);for(let t=0;t0)){r||(n=this.replaceEntitiesValue(n));const l=this.options.tagValueProcessor(e,n,t,i,o);return l==null?n:typeof l!=typeof n||l!==n?l:this.options.trimValues?Ve(n,this.options.parseTagValue,this.options.numberParseOptions):n.trim()===n?Ve(n,this.options.parseTagValue,this.options.numberParseOptions):n}}function hi(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 fi=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function gi(n,e,t){if(!this.options.ignoreAttributes&&typeof n=="string"){const s=$e.getAllMatches(n,fi),i=s.length,o={};for(let r=0;r",o,"Closing Tag is not closed.");let a=n.substring(o+2,l).trim();if(this.options.removeNSPrefix){const f=a.indexOf(":");f!==-1&&(a=a.substr(f+1))}this.options.transformTagName&&(a=this.options.transformTagName(a)),t&&(s=this.saveTextToParentTag(s,t,i));const u=i.substring(i.lastIndexOf(".")+1);if(a&&this.options.unpairedTags.indexOf(a)!==-1)throw new Error(`Unpaired tag can not be used as closing tag: `);let h=0;u&&this.options.unpairedTags.indexOf(u)!==-1?(h=i.lastIndexOf(".",i.lastIndexOf(".")-1),this.tagsNodeStack.pop()):h=i.lastIndexOf("."),i=i.substring(0,h),t=this.tagsNodeStack.pop(),s="",o=l}else if(n[o+1]==="?"){let l=Ye(n,o,!1,"?>");if(!l)throw new Error("Pi Tag is not closed.");if(s=this.saveTextToParentTag(s,t,i),!(this.options.ignoreDeclaration&&l.tagName==="?xml"||this.options.ignorePiTags)){const a=new re(l.tagName);a.add(this.options.textNodeName,""),l.tagName!==l.tagExp&&l.attrExpPresent&&(a[":@"]=this.buildAttributesMap(l.tagExp,i,l.tagName)),this.addChild(t,a,i)}o=l.closeIndex+1}else if(n.substr(o+1,3)==="!--"){const l=$(n,"-->",o+4,"Comment is not closed.");if(this.options.commentPropName){const a=n.substring(o+4,l-2);s=this.saveTextToParentTag(s,t,i),t.add(this.options.commentPropName,[{[this.options.textNodeName]:a}])}o=l}else if(n.substr(o+1,2)==="!D"){const l=li(n,o);this.docTypeEntities=l.entities,o=l.i}else if(n.substr(o+1,2)==="!["){const l=$(n,"]]>",o,"CDATA is not closed.")-2,a=n.substring(o+9,l);if(s=this.saveTextToParentTag(s,t,i),this.options.cdataPropName)t.add(this.options.cdataPropName,[{[this.options.textNodeName]:a}]);else{let u=this.parseTextData(a,t.tagname,i,!0,!1,!0);u==null&&(u=""),t.add(this.options.textNodeName,u)}o=l+2}else{let l=Ye(n,o,this.options.removeNSPrefix),a=l.tagName,u=l.tagExp,h=l.attrExpPresent,f=l.closeIndex;this.options.transformTagName&&(a=this.options.transformTagName(a)),t&&s&&t.tagname!=="!xml"&&(s=this.saveTextToParentTag(s,t,i,!1));const p=t;if(p&&this.options.unpairedTags.indexOf(p.tagname)!==-1&&(t=this.tagsNodeStack.pop(),i=i.substring(0,i.lastIndexOf("."))),a!==e.tagname&&(i+=i?"."+a:a),this.isItStopNode(this.options.stopNodes,i,a)){let T="";if(u.length>0&&u.lastIndexOf("/")===u.length-1)o=l.closeIndex;else if(this.options.unpairedTags.indexOf(a)!==-1)o=l.closeIndex;else{const M=this.readStopNodeData(n,a,f+1);if(!M)throw new Error(`Unexpected end of ${a}`);o=M.i,T=M.tagContent}const m=new re(a);a!==u&&h&&(m[":@"]=this.buildAttributesMap(u,i,a)),T&&(T=this.parseTextData(T,a,i,!0,h,!0,!0)),i=i.substr(0,i.lastIndexOf(".")),m.add(this.options.textNodeName,T),this.addChild(t,m,i)}else{if(u.length>0&&u.lastIndexOf("/")===u.length-1){a[a.length-1]==="/"?(a=a.substr(0,a.length-1),i=i.substr(0,i.length-1),u=a):u=u.substr(0,u.length-1),this.options.transformTagName&&(a=this.options.transformTagName(a));const T=new re(a);a!==u&&h&&(T[":@"]=this.buildAttributesMap(u,i,a)),this.addChild(t,T,i),i=i.substr(0,i.lastIndexOf("."))}else{const T=new re(a);this.tagsNodeStack.push(t),a!==u&&h&&(T[":@"]=this.buildAttributesMap(u,i,a)),this.addChild(t,T,i),t=T}s="",o=f}}else s+=n[o];return e.child};function pi(n,e,t){const s=this.options.updateTag(e.tagname,t,e[":@"]);s===!1||(typeof s=="string"&&(e.tagname=s),n.addChild(e))}const Ei=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 Si(n,e,t,s){return n&&(s===void 0&&(s=Object.keys(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 Ii(n,e,t){const s="*."+t;for(const i in n){const o=n[i];if(s===o||e===o)return!0}return!1}function Ci(n,e,t=">"){let s,i="";for(let o=e;o",t,`${e} is not closed`);if(n.substring(t+2,o).trim()===e&&(i--,i===0))return{tagContent:n.substring(s,t),i:o};t=o}else if(n[t+1]==="?")t=$(n,"?>",t+1,"StopNode is not closed.");else if(n.substr(t+1,3)==="!--")t=$(n,"-->",t+3,"StopNode is not closed.");else if(n.substr(t+1,2)==="![")t=$(n,"]]>",t,"StopNode is not closed.")-2;else{const o=Ye(n,t,">");o&&((o&&o.tagName)===e&&o.tagExp[o.tagExp.length-1]!=="/"&&i++,t=o.closeIndex)}}function Ve(n,e,t){if(e&&typeof n=="string"){const s=n.trim();return s==="true"?!0:s==="false"?!1:ai(n,t)}else return $e.isExist(n)?n:""}var Ai=ci,Mt={};function Oi(n,e){return Bt(n,e)}function Bt(n,e,t){let s;const i={};for(let o=0;o0&&(i[e.textNodeName]=s):s!==void 0&&(i[e.textNodeName]=s),i}function Ni(n){const e=Object.keys(n);for(let t=0;t0&&(t=Pi),Gt(n,e,"",t)}function Gt(n,e,t,s){let i="",o=!1;for(let r=0;r`,o=!1;continue}else if(a===e.commentPropName){i+=s+``,o=!0;continue}else if(a[0]==="?"){const m=pt(l[":@"],e),M=a==="?xml"?"":s;let z=l[a][0][e.textNodeName];z=z.length!==0?" "+z:"",i+=M+`<${a}${z}${m}?>`,o=!0;continue}let h=s;h!==""&&(h+=e.indentBy);const f=pt(l[":@"],e),p=s+`<${a}${f}`,T=Gt(l[a],e,u,h);e.unpairedTags.indexOf(a)!==-1?e.suppressUnpairedNode?i+=p+">":i+=p+"/>":(!T||T.length===0)&&e.suppressEmptyNode?i+=p+"/>":T&&T.endsWith(">")?i+=p+`>${T}${s}`:(i+=p+">",T&&s!==""&&(T.includes("/>")||T.includes("`),o=!0}return i}function ki(n){const e=Object.keys(n);for(let t=0;t0&&e.processEntities)for(let t=0;t","g"),val:">"},{regex:new RegExp("<","g"),val:"<"},{regex:new RegExp("'","g"),val:"'"},{regex:new RegExp('"',"g"),val:"""}],processEntities:!0,stopNodes:[],oneListGroup:!1};function K(n){this.options=Object.assign({},Yi,n),this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=Wi),this.processTextOrObjNode=Vi,this.options.format?(this.indentate=Ui,this.tagEndChar=`> +var Qt=Object.defineProperty;var Jt=(n,e,t)=>e in n?Qt(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var g=(n,e,t)=>(Jt(n,typeof e!="symbol"?e+"":e,t),t);import{f as en}from"./mxgraph.js";(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))s(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const r of o.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&s(r)}).observe(document,{childList:!0,subtree:!0});function t(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function s(i){if(i.ep)return;i.ep=!0;const o=t(i);fetch(i.href,o)}})();var le=(n=>(n.None="None",n.HorizontalVertical="HorizontalVertical",n.Horizontal="Horizontal",n.Vertical="Vertical",n.Center="Center",n))(le||{}),tn=(n=>(n.In="in",n.Out="out",n))(tn||{});function nn(n){return n instanceof HTMLElement?n:document.getElementById(n)}var d=(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))(d||{}),ae=(n=>(n.CALLING_PROCESS="process",n.CALLING_GLOBAL_TASK="global task",n))(ae||{}),ce=(n=>(n.Exclusive="Exclusive",n.None="None",n.Parallel="Parallel",n))(ce||{}),R=(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))(R||{}),w=(n=>(n.ADHOC="adhoc",n.COMPENSATION="compensation",n.EXPAND="expand",n.LOOP="loop",n.MULTI_INSTANCE_PARALLEL="parallel multi instance",n.MULTI_INSTANCE_SEQUENTIAL="sequential multi instance",n))(w||{}),U=(n=>(n.AD_HOC="ad_hoc",n.EMBEDDED="embedded",n.EVENT="event",n.TRANSACTION="transaction",n))(U||{});function sn(n,e){return n===""?e?{}:void 0:n}function S(n,e=!1){return n==null?[]:(Array.isArray(n)?n:[n]).map(t=>sn(t,e)).filter(Boolean)}function on(n,e,t){let s="";return t!=null&&t.startingWith?s=s.concat(`^(${t.startingWith}).*`):t!=null&&t.notStartingWith&&(s=s.concat(`^(?!(${t.notStartingWith})).*`)),s=s.concat(`${e}$`),n.filter(i=>t!=null&&t.ignoreCase?new RegExp(s,"i").test(i):new RegExp(s).test(i))}class C{static isEvent(e){return pe(tt,e)}static eventKinds(){return[...tt]}static isBoundaryEvent(e){return d.EVENT_BOUNDARY===e}static isStartEvent(e){return d.EVENT_START===e}static isCallActivity(e){return d.CALL_ACTIVITY===e}static isSubProcess(e){return d.SUB_PROCESS===e}static canHaveNoneEvent(e){return d.EVENT_INTERMEDIATE_THROW===e||d.EVENT_END===e||d.EVENT_START===e}static isActivity(e){return pe(xe,e)}static activityKinds(){return[...xe]}static isWithDefaultSequenceFlow(e){return rn.includes(e)}static isTask(e){return pe(Pe,e)}static taskKinds(){return[...Pe]}static gatewayKinds(){return[...nt]}static isGateway(e){return pe(nt,e)}static flowNodeKinds(){return Object.values(d).filter(e=>!C.isPoolOrLane(e))}static isPoolOrLane(e){return e==d.POOL||e==d.LANE}}function Ue(n,e){return on(Object.values(d),n,e)}function pe(n,e){return Object.values(n).map(t=>t).includes(e)}const tt=Ue("Event"),nt=Ue("Gateway"),Pe=Ue("Task",{ignoreCase:!0,notStartingWith:"global"}),xe=[...Pe,d.CALL_ACTIVITY,d.SUB_PROCESS],rn=[...xe,d.GATEWAY_EXCLUSIVE,d.GATEWAY_INCLUSIVE,d.GATEWAY_COMPLEX],It=Object.values(R).filter(n=>n!=R.NONE);var j=(n=>(n.NONE="None",n.ONE="One",n.BOTH="Both",n))(j||{}),k=(n=>(n.SEQUENCE_FLOW="sequenceFlow",n.MESSAGE_FLOW="messageFlow",n.ASSOCIATION_FLOW="association",n))(k||{}),fe=(n=>(n.NONE="none",n.INITIATING="initiating",n.NON_INITIATING="non_initiating",n))(fe||{}),G=(n=>(n.NORMAL="normal",n.DEFAULT="default",n.CONDITIONAL_FROM_ACTIVITY="conditional_from_activity",n.CONDITIONAL_FROM_GATEWAY="conditional_from_gateway",n))(G||{});class ve{constructor(e,t,s,i,o){this.id=e,this.name=t,this.kind=s,this.sourceRefId=i,this.targetRefId=o}}class Ct extends ve{constructor(e,t,s,i,o=G.NORMAL){super(e,t,k.SEQUENCE_FLOW,s,i),this.sequenceFlowKind=o}}class mt extends ve{constructor(e,t,s,i){super(e,t,k.MESSAGE_FLOW,s,i)}}class At extends ve{constructor(e,t,s,i,o=j.NONE){super(e,t,k.ASSOCIATION_FLOW,s,i),this.associationDirectionKind=o}}const L=ln(),v=L.mxCellRenderer,Ot=L.mxClient,c=L.mxConstants,W=L.mxEvent,st=L.mxPerimeter,x=L.mxPoint,ke=L.mxRectangle,We=L.mxRectangleShape,ue=L.mxSvgCanvas2D,O=L.mxUtils;function ln(){return window.mxForceIncludes=!1,window.mxLoadResources=!1,window.mxLoadStylesheets=!1,window.mxResourceExtension=".txt",en({})}class an{constructor(e){this.graph=e}computeRelativeCoordinates(e,t){const s=this.getTranslateForRoot(e),i=t.x+s.x,o=t.y+s.y;return new x(i,o)}getTranslateForRoot(e){const t=this.graph.getModel(),s=new x(0,0);for(;e!=null;){const i=t.getGeometry(e);i!=null&&(s.x-=i.x,s.y-=i.y),e=t.getParent(e)}return s}computeEdgeCenter(e){const t=e.geometry.points,s=t[0],i=t[t.length-1];if(s!=null&&i!=null){const o=i.x-s.x,r=i.y-s.y;return new x(s.x+o/2,s.y+r/2)}}}class Se{constructor(e,t,s,i,o){g(this,"extensions",{});this.id=e,this.bpmnElement=t,this.bounds=s,this.label=i,this.isHorizontal=o}}class Y{constructor(e,t,s,i,o=!1){g(this,"incomingIds",[]);g(this,"outgoingIds",[]);this.id=e,this.name=t,this.kind=s,this.parentId=i,this.instantiate=o}}class Le extends Y{constructor(e,t,s,i,o,r=[]){super(e,t,s,i,o),this.markers=r}}class de extends Le{constructor(e,t,s,i,o,r){super(e,t,d.CALL_ACTIVITY,i,void 0,o),this.callActivityKind=s,this.globalTaskKind=r}}class Ie extends Le{constructor(e,t,s,i,o){s==U.AD_HOC&&!o.includes(w.ADHOC)&&o.push(w.ADHOC),super(e,t,d.SUB_PROCESS,i,void 0,o),this.subProcessKind=s}}class he extends Y{constructor(e,t,s,i,o){super(e,t,s,o),this.eventDefinitionKind=i}}class Nt extends he{constructor(e,t,s,i,o){super(e,t,d.EVENT_START,s,i),this.isInterrupting=o}}class vt extends he{constructor(e,t,s,i,o=!0){super(e,t,d.EVENT_BOUNDARY,s,i),this.isInterrupting=o}}class Lt extends Y{constructor(e,t,s,i,o=ce.None){super(e,t,d.GATEWAY_EVENT_BASED,s,i),this.gatewayKind=o}}function Ce(n,e,t,s){return Math.min(Math.max(n??s,e),t)}function cn(n){return Math.max(n??0,0)}function un(n){const e=n??{};return e.debounceDelay=Ce(e.debounceDelay,0,100,50),e.throttleDelay=Ce(e.throttleDelay,0,100,50),e}function ye(n){return n=="default"?void 0:Ce(n,0,100,100)}function dn(n){return n=="default"?void 0:Ce(n,1,50,1)}const I={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"},yt={ARROW_DASH:"bpmn.dash"},E={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_FROM_CENTER_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"},_t=n=>O.getValue(n,I.IS_INSTANTIATING,"false")=="true",me=n=>n=="default"?void 0:n,hn=(n,e)=>(e&&(n=F(n,c.STYLE_STROKECOLOR,e.color,me),n=F(n,c.STYLE_STROKE_OPACITY,e.opacity,ye),n=F(n,c.STYLE_STROKEWIDTH,e.width,dn)),n),F=(n,e,t,s=i=>i)=>t==null?n:O.setStyle(n,e,s(t)),Ee=(n,e,t,s)=>s==null?n:O.setStyleFlag(n,e,t,s),fn=(n,e)=>(e&&(n=F(n,c.STYLE_FONTCOLOR,e.color,me),n=F(n,c.STYLE_FONTSIZE,e.size),n=F(n,c.STYLE_FONTFAMILY,e.family),n=Ee(n,c.STYLE_FONTSTYLE,c.FONT_BOLD,e.isBold),n=Ee(n,c.STYLE_FONTSTYLE,c.FONT_ITALIC,e.isItalic),n=Ee(n,c.STYLE_FONTSTYLE,c.FONT_UNDERLINE,e.isUnderline),n=Ee(n,c.STYLE_FONTSTYLE,c.FONT_STRIKETHROUGH,e.isStrikeThrough),n=F(n,c.STYLE_TEXT_OPACITY,e.opacity,ye)),n),gn=(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}},pn=(n,e)=>{const t=e.color;if(t){const s=Sn(t),i=s?t.startColor:t;n=F(n,c.STYLE_FILLCOLOR,i,me),s?(n=O.setStyle(n,c.STYLE_GRADIENTCOLOR,t.endColor),n=O.setStyle(n,c.STYLE_GRADIENT_DIRECTION,Tn(t.direction))):t==="default"&&(n=O.setStyle(n,c.STYLE_GRADIENTCOLOR,void 0),n=O.setStyle(n,c.STYLE_GRADIENT_DIRECTION,void 0)),(n.includes(d.POOL)||n.includes(d.LANE))&&(n=F(n,c.STYLE_SWIMLANE_FILLCOLOR,i,me))}return n=F(n,c.STYLE_FILL_OPACITY,e.opacity,ye),n},En=n=>n&&typeof n=="object"&&"fill"in n,Sn=n=>n&&typeof n=="object";class Z{constructor(e){g(this,"ignoreBpmnColors");this.ignoreBpmnColors=(e==null?void 0:e.ignoreBpmnColors)??!0}computeStyle(e,t){const s=[e.bpmnElement.kind];let i;e instanceof Se?i=this.computeShapeStyleValues(e):(s.push(...Z.computeEdgeBaseStyles(e)),i=this.computeEdgeStyleValues(e));const o=this.computeFontStyleValues(e),r=Z.computeLabelStyleValues(e,t);return s.concat(it([...i,...o,...r])).join(";")}computeShapeStyleValues(e){const t=new Map,s=e.bpmnElement;if(s instanceof he?Z.computeEventShapeStyle(s,t):s instanceof Le?Z.computeActivityShapeStyle(s,t):C.isPoolOrLane(s.kind)?t.set(c.STYLE_HORIZONTAL,e.isHorizontal?"0":"1"):s instanceof Lt&&(t.set(I.IS_INSTANTIATING,String(s.instantiate)),t.set(I.EVENT_BASED_GATEWAY_KIND,String(s.gatewayKind))),!this.ignoreBpmnColors){const i=e.extensions,o=i.fillColor;o&&(t.set(c.STYLE_FILLCOLOR,o),C.isPoolOrLane(s.kind)&&t.set(c.STYLE_SWIMLANE_FILLCOLOR,o)),i.strokeColor&&t.set(c.STYLE_STROKECOLOR,i.strokeColor)}return t}static computeEventShapeStyle(e,t){t.set(I.EVENT_DEFINITION_KIND,e.eventDefinitionKind),(e instanceof vt||e instanceof Nt&&e.isInterrupting!==void 0)&&t.set(I.IS_INTERRUPTING,String(e.isInterrupting))}static computeActivityShapeStyle(e,t){e instanceof Ie?t.set(I.SUB_PROCESS_KIND,e.subProcessKind):e.kind===d.TASK_RECEIVE?t.set(I.IS_INSTANTIATING,String(e.instantiate)):e instanceof de&&t.set(I.GLOBAL_TASK_KIND,e.globalTaskKind);const s=e.markers;s.length>0&&t.set(I.MARKERS,s.join(","))}static computeEdgeBaseStyles(e){const t=[],s=e.bpmnElement;return s instanceof Ct&&t.push(s.sequenceFlowKind),s instanceof At&&t.push(s.associationDirectionKind),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 i,o;const t=new Map,s=(i=e.label)==null?void 0:i.font;if(s&&(t.set(c.STYLE_FONTFAMILY,s.name),t.set(c.STYLE_FONTSIZE,s.size),t.set(c.STYLE_FONTSTYLE,In(s))),!this.ignoreBpmnColors){const r=(o=e.label)==null?void 0:o.extensions;r!=null&&r.color&&t.set(c.STYLE_FONTCOLOR,r.color)}return t}static computeLabelStyleValues(e,t){const s=new Map,i=e.bpmnElement;return t?(s.set(c.STYLE_VERTICAL_ALIGN,c.ALIGN_TOP),e.bpmnElement.kind!=d.TEXT_ANNOTATION&&s.set(c.STYLE_ALIGN,c.ALIGN_CENTER),e instanceof Se&&(s.set(c.STYLE_LABEL_WIDTH,t.width+1),s.set(c.STYLE_LABEL_POSITION,"ignore"),s.set(c.STYLE_VERTICAL_LABEL_POSITION,c.ALIGN_MIDDLE))):e instanceof Se&&(i instanceof Ie||i instanceof de&&i.callActivityKind===ae.CALLING_PROCESS)&&!i.markers.includes(w.EXPAND)&&s.set(c.STYLE_VERTICAL_ALIGN,c.ALIGN_TOP),s}computeMessageFlowIconStyle(e){const t=[];return t.push(["shape",I.MESSAGE_FLOW_ICON]),t.push([I.IS_INITIATING,String(e.messageVisibleKind===fe.INITIATING)]),this.ignoreBpmnColors||e.extensions.strokeColor&&t.push([c.STYLE_STROKECOLOR,e.extensions.strokeColor]),it(t).join(";")}}function In(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 it(n){return n.filter(([,e])=>e&&e!="undefined").map(([e,t])=>`${e}=${t}`)}class Cn{constructor(e,t,s){this.graph=e,this.coordinatesTranslator=t,this.styleComputer=s}render(e,t){this.insertShapesAndEdges(e),this.graph.customFit(t)}insertShapesAndEdges({pools:e,lanes:t,subprocesses:s,otherFlowNodes:i,boundaryEvents:o,edges:r}){this.graph.batchUpdate(()=>{this.graph.getModel().clear(),this.insertShapes(e),this.insertShapes(t),this.insertShapes(s),this.insertShapes(i),this.insertShapes(o),this.insertEdges(r)})}insertShapes(e){e.forEach(t=>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),i=e.bounds;let o=(l=e.label)==null?void 0:l.bounds;o=C.isPoolOrLane(t.kind)?void 0:o;const r=this.styleComputer.computeStyle(e,o);this.insertVertex(s,t.id,t.name,i,o,r)}insertEdges(e){e.forEach(t=>{var h;const s=t.bpmnElement,i=this.graph.getDefaultParent(),o=this.getCell(s.sourceRefId),r=this.getCell(s.targetRefId),l=(h=t.label)==null?void 0:h.bounds,a=this.styleComputer.computeStyle(t,l),u=this.graph.insertEdge(i,s.id,s.name,o,r,a);if(this.insertWaypoints(t.waypoints,u),l){u.geometry.width=l.width,u.geometry.height=l.height;const f=this.coordinatesTranslator.computeEdgeCenter(u);if(f){u.geometry.relative=!1;const p=this.coordinatesTranslator.computeRelativeCoordinates(u.parent,new x(l.x,l.y)),T=p.x+l.width/2-f.x,m=p.y-f.y;u.geometry.offset=new x(T,m)}}this.insertMessageFlowIconIfNeeded(t,u)})}insertMessageFlowIconIfNeeded(e,t){if(e.bpmnElement instanceof mt&&e.messageVisibleKind!==fe.NONE){const s=this.graph.insertVertex(t,De(t.id),void 0,0,0,20,14,this.styleComputer.computeMessageFlowIconStyle(e));s.geometry.relative=!0,s.geometry.offset=new x(-10,-7)}}insertWaypoints(e,t){e&&(t.geometry.points=e.map(s=>this.coordinatesTranslator.computeRelativeCoordinates(t.parent,new x(s.x,s.y))))}getCell(e){return this.graph.getModel().getCell(e)}insertVertex(e,t,s,i,o,r){const l=this.coordinatesTranslator.computeRelativeCoordinates(e,new x(i.x,i.y)),a=this.graph.insertVertex(e,t,s,l.x,l.y,i.width,i.height,r);if(o){const u=o.x-i.x,h=o.y-i.y;a.geometry.offset=new x(u,h)}return a}}function mn(n,e){return new Cn(n,new an(n),new Z(e))}function De(n){return`messageFlowIcon_of_${n}`}var An=typeof global=="object"&&global&&global.Object===Object&&global;const On=An;var Nn=typeof self=="object"&&self&&self.Object===Object&&self,vn=On||Nn||Function("return this")();const wt=vn;var Ln=wt.Symbol;const Ae=Ln;var Rt=Object.prototype,yn=Rt.hasOwnProperty,_n=Rt.toString,ie=Ae?Ae.toStringTag:void 0;function wn(n){var e=yn.call(n,ie),t=n[ie];try{n[ie]=void 0;var s=!0}catch{}var i=_n.call(n);return s&&(e?n[ie]=t:delete n[ie]),i}var Rn=Object.prototype,bn=Rn.toString;function Fn(n){return bn.call(n)}var Pn="[object Null]",xn="[object Undefined]",ot=Ae?Ae.toStringTag:void 0;function kn(n){return n==null?n===void 0?xn:Pn:ot&&ot in Object(n)?wn(n):Fn(n)}function Mn(n){return n!=null&&typeof n=="object"}var Bn="[object Symbol]";function Gn(n){return typeof n=="symbol"||Mn(n)&&kn(n)==Bn}var Yn=/\s/;function Vn(n){for(var e=n.length;e--&&Yn.test(n.charAt(e)););return e}var Un=/^\s+/;function Wn(n){return n&&n.slice(0,Vn(n)+1).replace(Un,"")}function Oe(n){var e=typeof n;return n!=null&&(e=="object"||e=="function")}var rt=0/0,Dn=/^[-+]0x[0-9a-f]+$/i,Hn=/^0b[01]+$/i,Kn=/^0o[0-7]+$/i,zn=parseInt;function lt(n){if(typeof n=="number")return n;if(Gn(n))return rt;if(Oe(n)){var e=typeof n.valueOf=="function"?n.valueOf():n;n=Oe(e)?e+"":e}if(typeof n!="string")return n===0?n:+n;n=Wn(n);var t=Hn.test(n);return t||Kn.test(n)?zn(n.slice(2),t?2:8):Dn.test(n)?rt:+n}var Xn=function(){return wt.Date.now()};const Re=Xn;var $n="Expected a function",jn=Math.max,Zn=Math.min;function bt(n,e,t){var s,i,o,r,l,a,u=0,h=!1,f=!1,p=!0;if(typeof n!="function")throw new TypeError($n);e=lt(e)||0,Oe(t)&&(h=!!t.leading,f="maxWait"in t,o=f?jn(lt(t.maxWait)||0,e):o,p="trailing"in t?!!t.trailing:p);function T(_){var V=s,se=i;return s=i=void 0,u=_,r=n.apply(se,V),r}function m(_){return u=_,l=setTimeout(Te,e),h?T(_):r}function M(_){var V=_-a,se=_-u,et=e-V;return f?Zn(et,o-se):et}function z(_){var V=_-a,se=_-u;return a===void 0||V>=e||V<0||f&&se>=o}function Te(){var _=Re();if(z(_))return Je(_);l=setTimeout(Te,M(_))}function Je(_){return l=void 0,p&&s?T(_):(s=i=void 0,r)}function Zt(){l!==void 0&&clearTimeout(l),u=0,s=a=i=l=void 0}function qt(){return l===void 0?r:Je(Re())}function we(){var _=Re(),V=z(_);if(s=arguments,i=this,a=_,V){if(l===void 0)return m(a);if(f)return clearTimeout(l),l=setTimeout(Te,e),T(a)}return l===void 0&&(l=setTimeout(Te,e)),r}return we.cancel=Zt,we.flush=qt,we}var qn="Expected a function";function Qn(n,e,t){var s=!0,i=!0;if(typeof n!="function")throw new TypeError(qn);return Oe(t)&&(s="leading"in t?!!t.leading:s,i="trailing"in t?!!t.trailing:i),bt(n,e,{leading:s,maxWait:e,trailing:i})}class Ft extends L.mxCellOverlay{constructor(t,s){super(null,"",s.position.horizontalAlign,s.position.verticalAlign,null,"default");g(this,"style");this.label=t,this.style=s.style}getBounds(t){const s=t.view.graph.getModel().isEdge(t.cell),i=t.view.scale;let o;const r=0,l=0;return s?o=this.computeEdgeBounds(t):(o=new x,this.align==c.ALIGN_LEFT?o.x=t.x:this.align==c.ALIGN_CENTER?o.x=t.x+t.width/2:o.x=t.x+t.width,this.verticalAlign==c.ALIGN_TOP?o.y=t.y:this.verticalAlign==c.ALIGN_MIDDLE?o.y=t.y+t.height/2:o.y=t.y+t.height),new ke(Math.round(o.x-(r*this.defaultOverlap-this.offset.x)*i),Math.round(o.y-(l*this.defaultOverlap-this.offset.y)*i),r*i,l*i)}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 i=s.length/2,o=s[i-1],r=s[i];return new x(o.x+(r.x-o.x)/2,o.y+(r.y-o.y)/2)}}else return s[s.length-1]}}class at extends L.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}}class Jn extends L.mxCellRenderer{createCellOverlays(e){const s=e.view.graph.getCellOverlays(e.cell);let i=null;if(s!=null){i=new L.mxDictionary;for(const o of s){const r=e.overlays!=null?e.overlays.remove(o):null;if(r!=null){i.put(o,r);continue}let l;o instanceof Ft?l=new at(o.label,new ke(0,0,0,0),o.style):(l=new L.mxImageShape(new ke(0,0,0,0),o.image.src),l.preserveImageAspect=!1),l.dialect=e.view.graph.dialect,l.overlay=o,this.initializeOverlay(e,l),this.installCellOverlayListeners(e,o,l),o.cursor!=null&&(l.node.style.cursor=o.cursor),l instanceof at&&(l.node.classList.add("overlay-badge"),l.node.setAttribute("data-bpmn-id",e.cell.id)),i.put(o,l)}}e.overlays!=null&&e.overlays.visit(function(o,r){r.destroy()}),e.overlays=i}}const Me=1.25,es=1/Me;class ts extends L.mxGraph{constructor(t){super(t);g(this,"currentZoomLevel",1);this.zoomFactor=Me,this.container&&(this.container.style.cursor="default")}createGraphView(){return new ns(this)}createCellRenderer(){return new Jn}batchUpdate(t){this.model.beginUpdate();try{t()}finally{this.model.endUpdate()}}fit(t,s,i,o,r,l,a){const u=super.fit(t,s,i,o,r,l,a);return this.setCurrentZoomLevel(u),u}setCurrentZoomLevel(t){this.currentZoomLevel=t??this.view.scale}zoomActual(){super.zoomActual(),this.setCurrentZoomLevel()}zoomIn(){super.zoomIn(),this.setCurrentZoomLevel()}zoomOut(){super.zoomOut(),this.setCurrentZoomLevel()}customFit(t){this.zoomActual();const s=t==null?void 0:t.type;if(s==null||s==le.None)return;const i=cn(t==null?void 0:t.margin);if(s!=le.Center){let o=!1,r=!1;switch(s){case le.Horizontal:r=!0;break;case le.Vertical:o=!0;break}this.fit(this.border,!1,i,!0,o,r)}else{const r=this.getGraphBounds(),l=this.container.clientWidth-i,a=this.container.clientHeight-i,u=r.width/this.view.scale,h=r.height/this.view.scale,f=Math.min(3,Math.min(l/u,a/h));this.setCurrentZoomLevel(f),this.view.scaleAndTranslate(f,(i+l-u*f)/(2*f)-r.x/this.view.scale,(i+a-h*f)/(2*f)-r.y/this.view.scale)}}registerMouseWheelZoomListeners(t){t=un(t),W.addMouseWheelListener(bt(this.createMouseWheelZoomListener(!0),t.debounceDelay),this.container),W.addMouseWheelListener(Qn(this.createMouseWheelZoomListener(!1),t.throttleDelay),this.container)}manageMouseWheelZoomEvent(t,s,i){if(!i)this.currentZoomLevel*=t?Me:es;else{const[o,r]=this.getEventRelativeCoordinates(s),[l,a,u]=this.getScaleAndTranslationDeltas(o,r);this.view.scaleAndTranslate(l,this.view.translate.x+a,this.view.translate.y+u),W.consume(s)}}createMouseWheelZoomListener(t){return(s,i)=>{if(W.isConsumed(s))return;const o=s;o.ctrlKey&&!o.altKey&&!o.shiftKey&&!o.metaKey&&this.manageMouseWheelZoomEvent(i,o,t)}}getEventRelativeCoordinates(t){const s=this.container.getBoundingClientRect(),i=t.clientX-s.left,o=t.clientY-s.top;return[i,o]}getScaleAndTranslationDeltas(t,s){const[i,o]=this.calculateFactorAndScale(),[r,l]=this.calculateTranslationDeltas(i,o,t*2,s*2);return[o,r,l]}calculateTranslationDeltas(t,s,i,o){if(t>1){const r=(t-1)/(s*2);i*=-r,o*=-r}else{const r=(1/t-1)/(this.view.scale*2);i*=r,o*=r}return[i,o]}calculateFactorAndScale(){const t=Math.round(this.currentZoomLevel*100)/100;return[t/this.view.scale,t]}}class ns extends L.mxGraphView{getFloatingTerminalPoint(e,t,s,i){if(e.absolutePoints.filter(Boolean).length<2)return super.getFloatingTerminalPoint(e,t,s,i);const l=e.absolutePoints;return i?l[1]:l[l.length-2]}}class ss{configureMarkers(){this.registerArrowDashMarker()}registerArrowDashMarker(){const e=(t,s,i,o,r,l,a,u,h)=>{const f=r*(a+h+4),p=l*(a+h+4);return function(){t.begin(),t.moveTo(o.x-f/2-p/2,o.y-p/2+f/2),t.lineTo(o.x+p/2-3*f/2,o.y-3*p/2-f/2),t.stroke()}};L.mxMarker.addMarker(yt.ARROW_DASH,e)}}function is(n){return Object.values(k).map(e=>e).includes(n)}function os(n,e){return rs(n.style,e)}function rs(n,e){const t=[],s=n.split(";"),o=s[0].replace(/shape=bpmn./g,""),r=new Map;return r.set("bpmn-type-activity",C.isActivity(o)),r.set("bpmn-type-container",C.isPoolOrLane(o)),r.set("bpmn-type-event",C.isEvent(o)),r.set("bpmn-type-flow",is(o)),r.set("bpmn-type-gateway",C.isGateway(o)),r.set("bpmn-type-task",C.isTask(o)),[...r].filter(([,l])=>l).forEach(([l])=>t.push(l)),t.push(Be(o)),s.map(l=>{const a=l.split("=");return[a[0],a[1]]}).forEach(([l,a])=>{switch(l){case I.EVENT_DEFINITION_KIND:t.push(`bpmn-event-def-${a}`);break;case I.EVENT_BASED_GATEWAY_KIND:t.push(`bpmn-gateway-kind-${a.toLowerCase()}`);break;case I.IS_INITIATING:t.push(a=="true"?"bpmn-icon-initiating":"bpmn-icon-non-initiating");break;case I.SUB_PROCESS_KIND:t.push(`bpmn-sub-process-${a.toLowerCase()}`);break;case I.GLOBAL_TASK_KIND:t.push(Be(a));break}}),e&&t.push("bpmn-label"),t}function Be(n){return n?"bpmn-"+n.replace(/([A-Z])/g,e=>"-"+e[0].toLowerCase()):""}function ls(n,e,t,s){let i,o;n.heightT.setIconOriginForIconCentered(),shapeConfig:{x:e,y:t,width:s,height:i,strokeWidth:u},iconStyleConfig:{isFilled:l,fillColor:h,strokeColor:f,strokeWidth:a,margin:p}}}class X{paintEmptyIcon(){}newBpmnCanvas({canvas:e,ratioFromParent:t,setIconOriginFunct:s,shapeConfig:i,iconStyleConfig:o},r){return new as({canvas:e,shapeConfig:i,iconConfig:{originalSize:r,styleConfig:o,ratioFromParent:t,setIconOriginFunct:s}})}paintEnvelopeIcon(e){const t={width:485.41,height:321.76},s=this.newBpmnCanvas(e,t),i=t.width,o=t.height;s.rect(0,0,i,o),s.fillAndStroke();const{iconStyleConfig:r}=e;r.isFilled&&s.setStrokeColor(r.fillColor),s.begin(),s.moveTo(0,0),s.lineTo(i*.5,o*.6),s.lineTo(i,0),s.moveTo(0,o),s.lineTo(i/3,o*.45),s.moveTo(i,o),s.lineTo(i*2/3,o*.45),s.stroke()}paintCircleIcon(e){const t={width:e.shapeConfig.width,height:e.shapeConfig.height},s=this.newBpmnCanvas(e,t),i=t.width,o=t.height;i>0&&o>0&&s.ellipse(0,0,i,o),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});be(e,t),t.fillAndStroke(),be(e,t),t.rotateOnIconCenter(60),t.fillAndStroke(),be(e,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});X.paintGearIconBackground(t),t.translateIconOrigin(14,14),X.paintGearIconForeground(t)}static paintGearIconBackground(e){e.begin(),e.moveTo(2.06,24.62),e.lineTo(10.17,30.95),e.lineTo(9.29,37.73),e.lineTo(0,41.42),e.lineTo(2.95,54.24),e.lineTo(13.41,52.92),e.lineTo(17.39,58.52),e.lineTo(13.56,67.66),e.lineTo(24.47,74.44),e.lineTo(30.81,66.33),e.lineTo(37.88,67.21),e.lineTo(41.57,76.5),e.lineTo(54.24,73.55),e.lineTo(53.06,62.94),e.lineTo(58.52,58.52),e.lineTo(67.21,63.09),e.lineTo(74.58,51.88),e.lineTo(66.03,45.25),e.lineTo(66.92,38.62),e.lineTo(76.5,34.93),e.lineTo(73.7,22.26),e.lineTo(62.64,23.44),e.lineTo(58.81,18.42),e.lineTo(62.79,8.7),e.lineTo(51.74,2.21),e.lineTo(44.81,10.47),e.lineTo(38.03,9.43),e.lineTo(33.75,0),e.lineTo(21.52,3.24),e.lineTo(22.7,13.56),e.lineTo(18.13,17.54),e.lineTo(8.7,13.56),e.close();const t=24.8,s=39;X.paintGearInnerCircle(e,t,s)}static paintGearIconForeground(e){e.begin(),e.moveTo(16.46,41.42),e.lineTo(24.57,47.75),e.lineTo(23.69,54.53),e.lineTo(14.4,58.22),e.lineTo(17.35,71.04),e.lineTo(27.81,69.72),e.lineTo(31.79,75.32),e.lineTo(27.96,84.46),e.lineTo(38.87,91.24),e.lineTo(45.21,83.13),e.lineTo(52.28,84.01),e.lineTo(55.97,93.3),e.lineTo(68.64,90.35),e.lineTo(67.46,79.74),e.lineTo(72.92,75.32),e.lineTo(81.61,79.89),e.lineTo(88.98,68.68),e.lineTo(80.43,62.05),e.lineTo(81.32,55.42),e.lineTo(90.9,51.73),e.lineTo(88.1,39.06),e.lineTo(77.04,40.24),e.lineTo(73.21,35.22),e.lineTo(77.19,25.5),e.lineTo(66.14,19.01),e.lineTo(59.21,27.27),e.lineTo(52.43,26.23),e.lineTo(48.15,16.8),e.lineTo(35.92,20.04),e.lineTo(37.1,30.36),e.lineTo(32.53,34.34),e.lineTo(23.1,30.36),e.close();const t=39.2,s=55.8;X.paintGearInnerCircle(e,t,s),e.begin(),X.paintGearInnerCircle(e,t,s)}static paintGearInnerCircle(e,t,s){e.moveTo(t,s),e.arcTo(13.5,13.5,0,1,1,t+2*13.5,s),e.arcTo(13.5,13.5,0,0,1,t,s),e.close(),e.fillAndStroke()}paintExpandIcon(e){const t={width:16,height:16},s=this.newBpmnCanvas(e,t),i=t.width,o=t.height;s.roundrect(0,0,i,o,2,2),s.stroke(),s.begin(),s.moveTo(i/2,o/4),s.lineTo(i/2,o*3/4),s.close(),s.moveTo(i/4,o/2),s.lineTo(i*3/4,o/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:i,iconStyleConfig:o}=e;i.setFillColor(o.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:i,iconStyleConfig:o}=e;i.setFillColor(o.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 be(n,e){e.begin(),e.moveTo(.38,0),e.lineTo(.62,0),e.lineTo(.62,1),e.lineTo(.38,1),e.close()}class te{static get(){return this.instance}static set(e){this.instance=e}}g(te,"instance",new X);const cs=[w.LOOP,w.MULTI_INSTANCE_PARALLEL,w.MULTI_INSTANCE_SEQUENTIAL,w.COMPENSATION,w.EXPAND,w.ADHOC];function us(n){const e=cs.filter(t=>n.includes(t));return n.filter(t=>!e.includes(t)).forEach(t=>e.push(t)),e}function Pt(n,e){te.get().paintEnvelopeIcon({...n,setIconOriginFunct:t=>t.setIconOriginToShapeTopLeft(),ratioFromParent:.2,iconStyleConfig:{...n.iconStyleConfig,isFilled:e}})}class He extends We{constructor(){super(void 0,void 0,void 0);g(this,"iconPainter",te.get())}paintForeground(t,s,i,o,r){super.paintForeground(t,s,i,o,r),this.paintMarkerIcons(ee({canvas:t,x:s,y:i,width:o,height:r,shape:this,ratioFromParent:0,iconStrokeWidth:1.5}))}paintMarkerIcons(t){const s=O.getValue(this.style,I.MARKERS,void 0);s&&us(s.split(",")).forEach((i,o,r)=>{switch(t={...t,setIconOriginFunct:this.getMarkerIconOriginFunction(r.length,o+1)},t.canvas.save(),i){case w.LOOP:this.iconPainter.paintLoopIcon(t);break;case w.MULTI_INSTANCE_SEQUENTIAL:this.iconPainter.paintSequentialMultiInstanceIcon(t);break;case w.MULTI_INSTANCE_PARALLEL:this.iconPainter.paintParallelMultiInstanceIcon(t);break;case w.EXPAND:this.iconPainter.paintExpandIcon(t);break}t.canvas.restore()})}getMarkerIconOriginFunction(t,s){let i;return t===1?i=o=>o.setIconOriginForIconBottomCentered():i=o=>{o.setIconOriginForIconBottomCentered();const r=Math.pow(-1,s)*(E.SHAPE_ACTIVITY_MARKER_ICON_SIZE/2+E.SHAPE_ACTIVITY_MARKER_ICON_MARGIN);o.translateIconOrigin(r,0)},i}}class H extends He{paintForeground(e,t,s,i,o){super.paintForeground(e,t,s,i,o),this.paintTaskIcon(ee({canvas:e,x:t,y:s,width:i,height:o,shape:this}))}}class ds extends H{paintTaskIcon(e){this.iconPainter.paintEmptyIcon()}}class hs extends H{paintTaskIcon(e){this.iconPainter.paintGearIcon({...e,setIconOriginFunct:t=>t.setIconOriginToShapeTopLeftProportionally(20)})}}class fs extends H{paintTaskIcon(e){this.iconPainter.paintPersonIcon({...e,setIconOriginFunct:t=>t.setIconOriginToShapeTopLeftProportionally(20)})}}class gs extends H{paintTaskIcon(e){if(!_t(this.style)){Pt(e,!1);return}const t=4,s=4,i={...e.shapeConfig,width:20,height:20};this.iconPainter.paintCircleIcon({canvas:e.canvas,shapeConfig:i,iconStyleConfig:{...e.iconStyleConfig,isFilled:!1},ratioFromParent:void 0,setIconOriginFunct:o=>o.setIconOriginToShapeTopLeft(s,t)}),i.x+=t,i.y+=s,this.iconPainter.paintEnvelopeIcon({...e,shapeConfig:i,ratioFromParent:.65,setIconOriginFunct:o=>o.setIconOriginForIconCentered()})}}class Ts extends H{paintTaskIcon(e){Pt(e,!0)}}class ps extends H{paintTaskIcon(e){this.iconPainter.paintHandIcon({...e,ratioFromParent:.18,setIconOriginFunct:t=>t.setIconOriginToShapeTopLeftProportionally(20)})}}class Es extends H{paintTaskIcon(e){this.iconPainter.paintScriptIcon({...e,ratioFromParent:.22,setIconOriginFunct:t=>t.setIconOriginToShapeTopLeftProportionally(20)})}}class Ss extends He{paintForeground(e,t,s,i,o){super.paintForeground(e,t,s,i,o);const r=ee({canvas:e,x:t,y:s,width:i,height:o,shape:this});switch(O.getValue(this.style,I.GLOBAL_TASK_KIND,void 0)){case d.GLOBAL_TASK_MANUAL:this.iconPainter.paintHandIcon({...r,ratioFromParent:.18,setIconOriginFunct:l=>l.setIconOriginToShapeTopLeftProportionally(20)});break;case d.GLOBAL_TASK_SCRIPT:this.iconPainter.paintScriptIcon({...r,ratioFromParent:.22,setIconOriginFunct:l=>l.setIconOriginToShapeTopLeftProportionally(20)});break;case d.GLOBAL_TASK_USER:this.iconPainter.paintPersonIcon({...r,setIconOriginFunct:l=>l.setIconOriginToShapeTopLeftProportionally(20)});break;case d.GLOBAL_TASK_BUSINESS_RULE:this.iconPainter.paintTableIcon({...r,ratioFromParent:.6,setIconOriginFunct:l=>l.setIconOriginToShapeTopLeftProportionally(15)});break;case d.GLOBAL_TASK:default:this.iconPainter.paintEmptyIcon()}}}class Is extends He{paintBackground(e,t,s,i,o){const r=O.getValue(this.style,I.SUB_PROCESS_KIND,void 0);if(e.save(),r===U.EVENT&&(e.setDashed(!0,!1),e.setDashPattern("1 2")),super.paintBackground(e,t,s,i,o),r===U.TRANSACTION){const l=E.SUB_PROCESS_TRANSACTION_INNER_RECT_OFFSET,a=E.SUB_PROCESS_TRANSACTION_INNER_RECT_ARC_SIZE;e.roundrect(t+l,s+l,i-2*l,o-2*l,a,a),e.stroke()}e.restore()}}class Cs extends H{paintTaskIcon(e){this.iconPainter.paintTableIcon({...e,ratioFromParent:.6,setIconOriginFunct:t=>t.setIconOriginToShapeTopLeftProportionally(15)})}}class ms extends L.mxConnector{paintEdgeShape(e,t){const s=this.createMarker(e,t,!0),i=this.createMarker(e,t,!1);this.paintEdgeLine(e,t),e.setShadow(!1),e.setDashed(!1,!1),s!=null&&(e.setFillColor(O.getValue(this.style,I.EDGE_START_FILL_COLOR,this.stroke)),s()),i!=null&&(e.setFillColor(O.getValue(this.style,I.EDGE_END_FILL_COLOR,this.stroke)),i())}paintEdgeLine(e,t){const s=As(e);ct(e,"stroke"),this.paintLine(e,t,this.isRounded),ct(e,s)}}function As(n){return n instanceof ue?n.pointerEventsValue:null}function ct(n,e){n instanceof ue&&(n.pointerEventsValue=e)}class Q extends L.mxEllipse{constructor(){super(void 0,void 0,void 0);g(this,"iconPainter",te.get());g(this,"iconPainters",new Map([[R.MESSAGE,t=>this.iconPainter.paintEnvelopeIcon({...t,ratioFromParent:.5})],[R.TERMINATE,t=>this.iconPainter.paintCircleIcon({...t,ratioFromParent:.6})],[R.TIMER,t=>this.iconPainter.paintClockIcon({...t,setIconOriginFunct:s=>s.setIconOriginToShapeTopLeftProportionally(5)})],[R.SIGNAL,t=>this.iconPainter.paintTriangleIcon({...t,ratioFromParent:.55,iconStyleConfig:{...t.iconStyleConfig,strokeWidth:E.STROKE_WIDTH_THIN.valueOf()},setIconOriginFunct:s=>s.setIconOriginToShapeTopLeftProportionally(4)})],[R.LINK,t=>this.iconPainter.paintRightArrowIcon({...t,ratioFromParent:.55,iconStyleConfig:{...t.iconStyleConfig,strokeWidth:1.5}})],[R.ERROR,t=>this.iconPainter.paintErrorIcon({...t,ratioFromParent:.55,iconStyleConfig:{...t.iconStyleConfig,strokeWidth:1.5}})],[R.COMPENSATION,t=>this.iconPainter.paintDoubleLeftArrowheadsIcon({...t,ratioFromParent:.7,iconStyleConfig:{...t.iconStyleConfig,strokeWidth:1.5}})],[R.CANCEL,t=>this.iconPainter.paintXCrossIcon({...t,ratioFromParent:.78})],[R.ESCALATION,t=>this.iconPainter.paintUpArrowheadIcon({...t,ratioFromParent:.55,iconStyleConfig:{...t.iconStyleConfig,strokeWidth:E.STROKE_WIDTH_THIN.valueOf()}})],[R.CONDITIONAL,t=>this.iconPainter.paintListIcon({...t,ratioFromParent:.6,iconStyleConfig:{...t.iconStyleConfig,strokeWidth:1.5}})]]));g(this,"withFilledIcon",!1)}paintVertexShape(t,s,i,o,r){const l=ee({canvas:t,x:s,y:i,width:o,height:r,shape:this,isFilled:this.withFilledIcon});Q.setDashedOuterShapePattern(l,O.getValue(this.style,I.IS_INTERRUPTING,void 0)),this.paintOuterShape(l),Q.restoreOriginalOuterShapePattern(l),this.paintInnerShape(l)}paintOuterShape({canvas:t,shapeConfig:{x:s,y:i,width:o,height:r}}){super.paintVertexShape(t,s,i,o,r)}paintInnerShape(t){(this.iconPainters.get(O.getValue(this.style,I.EVENT_DEFINITION_KIND,R.NONE))??(()=>this.iconPainter.paintEmptyIcon()))(t)}static setDashedOuterShapePattern(t,s){t.canvas.save(),s==="false"&&(t.canvas.setDashed(!0,!1),t.canvas.setDashPattern("3 2"))}static restoreOriginalOuterShapePattern(t){t.canvas.restore()}}class Os extends Q{constructor(){super(),this.withFilledIcon=!0}}class Ge extends Q{paintOuterShape({canvas:e,shapeConfig:{x:t,y:s,width:i,height:o,strokeWidth:r}}){e.ellipse(t,s,i,o),e.fillAndStroke();const l=r*1.5;e.ellipse(i*.02+l+t,o*.02+l+s,i*.96-2*l,o*.96-2*l),e.stroke()}}class Ns extends Ge{constructor(){super(),this.withFilledIcon=!0}}class vs extends We{constructor(){super(...arguments);g(this,"iconPainter",te.get())}paintVertexShape(t,s,i,o,r){const l=ee({canvas:t,x:s,y:i,width:o,height:r,shape:this,ratioFromParent:1,isFilled:O.getValue(this.style,I.IS_INITIATING,"true")=="false"});this.iconPainter.paintEnvelopeIcon(l)}}class ge extends L.mxRhombus{constructor(){super(...arguments);g(this,"iconPainter",te.get())}paintVertexShape(t,s,i,o,r){const l=ee({canvas:t,x:s,y:i,width:o,height:r,shape:this});this.paintOuterShape(l),this.paintInnerShape(l)}paintOuterShape({canvas:t,shapeConfig:{x:s,y:i,width:o,height:r}}){super.paintVertexShape(t,s,i,o,r)}}class Ls extends ge{paintInnerShape(e){this.iconPainter.paintXCrossIcon({...e,iconStyleConfig:{...e.iconStyleConfig,isFilled:!0},ratioFromParent:.5})}}class ys extends ge{paintInnerShape(e){this.iconPainter.paintPlusCrossIcon({...e,iconStyleConfig:{...e.iconStyleConfig,isFilled:!0},ratioFromParent:.5})}}class _s extends ge{paintInnerShape(e){this.iconPainter.paintCircleIcon({...e,ratioFromParent:.62,iconStyleConfig:{...e.iconStyleConfig,isFilled:!1,strokeWidth:E.STROKE_WIDTH_THICK.valueOf()}})}}class ws extends ge{paintInnerShape(e){this.iconPainter.paintAsteriskIcon({...e,iconStyleConfig:{...e.iconStyleConfig,isFilled:!0},ratioFromParent:.5})}}class Rs extends ge{paintInnerShape(e){e={...e,iconStyleConfig:{...e.iconStyleConfig,strokeWidth:1}},this.iconPainter.paintCircleIcon({...e,ratioFromParent:.55}),_t(this.style)||this.iconPainter.paintCircleIcon({...e,ratioFromParent:.45});const t={...e,ratioFromParent:.3};O.getValue(this.style,I.EVENT_BASED_GATEWAY_KIND,ce.Exclusive)==ce.Parallel?this.iconPainter.paintPlusCrossIcon(t):this.iconPainter.paintPentagon(t)}}class bs extends We{paintForeground(e,t,s,i,o){e.begin(),e.moveTo(t+E.TEXT_ANNOTATION_BORDER_LENGTH,s),e.lineTo(t,s),e.lineTo(t,s+o),e.lineTo(t+E.TEXT_ANNOTATION_BORDER_LENGTH,s+o),e.stroke()}paintBackground(e,t,s,i,o){e.save(),e.setStrokeColor("none"),super.paintBackground(e,t,s,i,o),e.restore()}}class Fs{configureShapes(){this.initMxSvgCanvasPrototype(),this.initMxShapePrototype(),this.registerShapes()}registerShapes(){v.registerShape(d.EVENT_END,Os),v.registerShape(d.EVENT_START,Q),v.registerShape(d.EVENT_INTERMEDIATE_THROW,Ns),v.registerShape(d.EVENT_INTERMEDIATE_CATCH,Ge),v.registerShape(d.EVENT_BOUNDARY,Ge),v.registerShape(d.GATEWAY_COMPLEX,ws),v.registerShape(d.GATEWAY_EVENT_BASED,Rs),v.registerShape(d.GATEWAY_EXCLUSIVE,Ls),v.registerShape(d.GATEWAY_INCLUSIVE,_s),v.registerShape(d.GATEWAY_PARALLEL,ys),v.registerShape(d.SUB_PROCESS,Is),v.registerShape(d.CALL_ACTIVITY,Ss),v.registerShape(d.TASK,ds),v.registerShape(d.TASK_SERVICE,hs),v.registerShape(d.TASK_USER,fs),v.registerShape(d.TASK_RECEIVE,gs),v.registerShape(d.TASK_SEND,Ts),v.registerShape(d.TASK_MANUAL,ps),v.registerShape(d.TASK_SCRIPT,Es),v.registerShape(d.TASK_BUSINESS_RULE,Cs),v.registerShape(d.TEXT_ANNOTATION,bs),v.registerShape(I.EDGE,ms),v.registerShape(I.MESSAGE_FLOW_ICON,vs)}initMxSvgCanvasPrototype(){ue.prototype.getTextCss=function(){const e=this.state,t=c.ABSOLUTE_LINE_HEIGHT?e.fontSize*c.LINE_HEIGHT+"px":c.LINE_HEIGHT*this.lineHeightCorrection;let s="display: inline-block; font-size: "+e.fontSize+"px; font-family: "+e.fontFamily+"; color: "+e.fontColor+"; line-height: "+t+"; pointer-events: none; ";(e.fontStyle&c.FONT_BOLD)==c.FONT_BOLD&&(s+="font-weight: bold; "),(e.fontStyle&c.FONT_ITALIC)==c.FONT_ITALIC&&(s+="font-style: italic; ");const i=[];return(e.fontStyle&c.FONT_UNDERLINE)==c.FONT_UNDERLINE&&i.push("underline"),(e.fontStyle&c.FONT_STRIKETHROUGH)==c.FONT_STRIKETHROUGH&&i.push("line-through"),i.length>0&&(s+="text-decoration: "+i.join(" ")+"; "),s}}initMxShapePrototype(){L.mxShape.prototype.createSvgCanvas=function(){var s;const e=new ue(this.node,!1);e.strokeTolerance=this.pointerEvents?this.svgStrokeTolerance:0,e.pointerEventsValue=this.svgPointerEvents;const t=this.getSvgScreenOffset();if(t!=0?this.node.setAttribute("transform","translate("+t+","+t+")"):this.node.removeAttribute("transform"),(s=this.state)!=null&&s.cell){const i=this.state.cell;let o=os(i,this.dialect===c.DIALECT_STRICTHTML);const r=this.state.style[I.EXTRA_CSS_CLASSES];typeof r=="string"&&(o=o.concat(r.split(","))),this.node.setAttribute("class",o.join(" ")),this.node.setAttribute("data-bpmn-id",this.state.cell.id)}return e.minStrokeWidth=this.minSvgStrokeWidth,this.antiAlias||(e.format=function(i){return Math.round(parseFloat(i))}),e}}}const ut=12;class xt{constructor(e){g(this,"specificFlowStyles",new Fe([[k.SEQUENCE_FLOW,e=>{e[c.STYLE_ENDARROW]=c.ARROW_BLOCK_THIN}],[k.MESSAGE_FLOW,e=>{e[c.STYLE_DASHED]=!0,e[c.STYLE_DASH_PATTERN]="8 5",e[c.STYLE_STARTARROW]=c.ARROW_OVAL,e[c.STYLE_STARTSIZE]=8,e[c.STYLE_STARTFILL]=!0,e[I.EDGE_START_FILL_COLOR]=E.MESSAGE_FLOW_MARKER_START_FILL_COLOR,e[c.STYLE_ENDARROW]=c.ARROW_BLOCK_THIN,e[c.STYLE_ENDFILL]=!0,e[I.EDGE_END_FILL_COLOR]=E.MESSAGE_FLOW_MARKER_END_FILL_COLOR}],[k.ASSOCIATION_FLOW,e=>{e[c.STYLE_DASHED]=!0,e[c.STYLE_DASH_PATTERN]="1 2",e[c.STYLE_STARTSIZE]=ut}]]));g(this,"specificSequenceFlowStyles",new Fe([[G.DEFAULT,e=>{e[c.STYLE_STARTARROW]=yt.ARROW_DASH}],[G.CONDITIONAL_FROM_ACTIVITY,e=>{e[c.STYLE_STARTARROW]=c.ARROW_DIAMOND_THIN,e[c.STYLE_STARTSIZE]=18,e[c.STYLE_STARTFILL]=!0,e[I.EDGE_START_FILL_COLOR]=E.SEQUENCE_FLOW_CONDITIONAL_FROM_ACTIVITY_MARKER_FILL_COLOR}]]));g(this,"specificAssociationFlowStyles",new Fe([[j.NONE,e=>{}],[j.ONE,e=>{e[c.STYLE_ENDARROW]=c.ARROW_OPEN_THIN}],[j.BOTH,e=>{e[c.STYLE_STARTARROW]=c.ARROW_OPEN_THIN,e[c.STYLE_ENDARROW]=c.ARROW_OPEN_THIN}]]));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();dt(e),e[c.STYLE_ABSOLUTE_ARCSIZE]=!0,e[c.STYLE_ARCSIZE]=E.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]=E.POOL_LABEL_SIZE,e[c.STYLE_FILLCOLOR]=E.POOL_LABEL_FILL_COLOR,this.graph.getStylesheet().putCellStyle(d.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]=E.LANE_LABEL_SIZE,e[c.STYLE_FILLCOLOR]=E.LANE_LABEL_FILL_COLOR,this.graph.getStylesheet().putCellStyle(d.LANE,e)}configureEventStyles(){C.eventKinds().forEach(e=>{const t={};t[c.STYLE_SHAPE]=e,t[c.STYLE_PERIMETER]=st.EllipsePerimeter,t[c.STYLE_STROKEWIDTH]=e==d.EVENT_END?E.STROKE_WIDTH_THICK:E.STROKE_WIDTH_THIN,t[c.STYLE_VERTICAL_LABEL_POSITION]=c.ALIGN_BOTTOM,this.putCellStyle(e,t)})}configureTextAnnotationStyle(){const e={};e[c.STYLE_SHAPE]=d.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]=E.TEXT_ANNOTATION_FILL_COLOR,e[c.STYLE_STROKEWIDTH]=E.STROKE_WIDTH_THIN,this.putCellStyle(d.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]=E.STROKE_WIDTH_THIN,e[c.STYLE_FILLCOLOR]=E.GROUP_FILL_COLOR,e[c.STYLE_ALIGN]=c.ALIGN_CENTER,e[c.STYLE_VERTICAL_ALIGN]=c.ALIGN_TOP,this.putCellStyle(d.GROUP,e)}configureActivityStyles(){C.activityKinds().forEach(e=>{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==d.CALL_ACTIVITY?E.STROKE_WIDTH_THICK:E.STROKE_WIDTH_THIN,this.putCellStyle(e,t)})}configureGatewayStyles(){C.gatewayKinds().forEach(e=>{const t={};t[c.STYLE_SHAPE]=e,t[c.STYLE_PERIMETER]=st.RhombusPerimeter,t[c.STYLE_STROKEWIDTH]=E.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();dt(e),e[c.STYLE_SHAPE]=I.EDGE,e[c.STYLE_ENDSIZE]=ut,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){e.forEach(s=>{const i={};t.get(s)(i),this.graph.getStylesheet().putCellStyle(s.toString(),i)})}configureFlowStyles(){this.configureEdgeStyles(Object.values(k),this.specificFlowStyles),this.configureEdgeStyles(Object.values(G),this.specificSequenceFlowStyles),this.configureEdgeStyles(Object.values(j),this.specificAssociationFlowStyles)}}function dt(n){n[c.STYLE_FONTFAMILY]=E.DEFAULT_FONT_FAMILY,n[c.STYLE_FONTSIZE]=E.DEFAULT_FONT_SIZE,n[c.STYLE_FONTCOLOR]=E.DEFAULT_FONT_COLOR,n[c.STYLE_FILLCOLOR]=E.DEFAULT_FILL_COLOR,n[c.STYLE_STROKECOLOR]=E.DEFAULT_STROKE_COLOR,n[c.STYLE_LABEL_BACKGROUNDCOLOR]=c.NONE,n[c.STYLE_WHITE_SPACE]="wrap"}class Fe extends Map{get(e){return super.get(e)??(()=>{})}}class Ps{constructor(e){g(this,"graph");this.container=e,this.graph=new ts(e)}configure(e){return this.configureGraph(),this.configureNavigationSupport(e),new xt(this.graph).configureStyles(),new Fs().configureShapes(),new ss().configureMarkers(),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}configureNavigationSupport(e){var s;const t=this.graph.panningHandler;(s=e==null?void 0:e.navigation)!=null&&s.enabled?(t.addListener(W.PAN_START,this.getPanningHandler("grab")),t.addListener(W.PAN_END,this.getPanningHandler("default")),t.usePopupTrigger=!1,t.isForcePanningEvent=i=>W.isLeftMouseButton(i.getEvent())||W.isMultiTouchEvent(i.getEvent()),this.graph.setPanning(!0),this.graph.registerMouseWheelZoomListeners(e.navigation.zoom)):(this.graph.setPanning(!1),t.setPinchEnabled(!1),t.isForcePanningEvent=i=>!1)}getPanningHandler(e){return()=>{this.graph.isEnabled()&&(this.container.style.cursor=e)}}}class xs{constructor(e){this.graph=e}fit(e){this.graph.customFit(e)}zoom(e){e=="in"?this.graph.zoomIn():this.graph.zoomOut()}}class ks{constructor(e){this.convertedElements=e}deserialize(e){S(e.category).forEach(t=>S(t.categoryValue).forEach(s=>this.convertedElements.registerCategoryValue(s.id,s.value)))}}class ne{}class Ms{warning(e){const t=e.getMessage();console.warn(`[bv-parser] ${t.template}`,...t.arguments)}}class Bs extends ne{constructor(e,t){super(),this.groupBpmnElementId=e,this.categoryValueRef=t}getMessage(){return{arguments:[this.categoryValueRef,this.groupBpmnElementId],template:"Group json deserialization: unable to find category value ref %s for bpmn element %s"}}}class Gs extends ne{constructor(e){super(),this.bpmnElementId=e}getMessage(){return{arguments:[this.bpmnElementId],template:"Shape json deserialization: unable to find bpmn element with id %s"}}}class Ys extends ne{constructor(e){super(),this.bpmnElementId=e}getMessage(){return{arguments:[this.bpmnElementId],template:"Edge json deserialization: unable to find bpmn element with id %s"}}}class Vs extends ne{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 Us extends ne{constructor(e,t){super(),this.laneId=e,this.flowNodeRef=t}getMessage(){return{arguments:[this.flowNodeRef,this.laneId],template:"Unable to assign lane %s as parent: flow node %s is not found"}}}class Ws extends ne{constructor(e,t,s){super(),this.bpmnElementId=e,this.attachedToRef=t,this.attachedToKind=s}getMessage(){return{arguments:[this.bpmnElementId,this.attachedToRef,this.attachedToKind],template:"The boundary event %s must be attached to an activity, and not to %s of kind %s"}}}class Ds{constructor(){g(this,"poolsById",new Map);g(this,"poolsByProcessRef",new Map);g(this,"messageFlows",new Map);g(this,"flowNodes",new Map);g(this,"lanes",new Map);g(this,"sequenceFlows",new Map);g(this,"associationFlows",new Map);g(this,"eventDefinitionsOfDefinitions",new Map);g(this,"globalTasks",new Map);g(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 kt=(n,e,t,s)=>{const i=n.findCategoryValue(t.categoryValueRef);if(i)return new Y(t.id,i.value,d.GROUP,s);e.warning(new Bs(t.id,t.categoryValueRef))};class Hs{constructor(e,t){this.convertedElements=e,this.parsingMessageCollector=t}deserialize(e){S(e).forEach(t=>this.parseCollaboration(t))}parseCollaboration(e){this.buildParticipant(e.participant),this.buildMessageFlows(e.messageFlow),this.buildGroups(e.group)}buildParticipant(e){S(e).forEach(t=>this.convertedElements.registerPool(new Y(t.id,t.name,d.POOL),t.processRef))}buildMessageFlows(e){S(e).forEach(t=>this.convertedElements.registerMessageFlow(new mt(t.id,t.name,t.sourceRef,t.targetRef)))}buildGroups(e){S(e).forEach(t=>{const s=kt(this.convertedElements,this.parsingMessageCollector,t);s&&this.convertedElements.registerFlowNode(s)})}}class Ks{constructor(e,t,s,i){this.x=e,this.y=t,this.width=s,this.height=i}}class zs{constructor(e,t,s,i,o=fe.NONE){g(this,"extensions",{});this.id=e,this.bpmnElement=t,this.waypoints=s,this.label=i,this.messageVisibleKind=o}}class Xs{constructor(e,t){this.x=e,this.y=t}}class $s{constructor(e,t){g(this,"extensions",{});this.font=e,this.bounds=t}}class js{constructor(e,t,s,i,o,r){this.name=e,this.size=t,this.isBold=s,this.isItalic=i,this.isUnderline=o,this.isStrikeThrough=r}}class q{constructor(e,t){g(this,"convertedFonts",new Map);this.convertedElements=e,this.parsingMessageCollector=t}deserialize(e){const t=[],s=[],i=[],o=[],r=S(e)[0];if(r){this.deserializeFonts(r.BPMNLabelStyle);const l=r.BPMNPlane,a=this.deserializeEdges(l.BPMNEdge),u=this.deserializeShapes(l.BPMNShape);t.push(...u.flowNodes),s.push(...u.lanes),i.push(...u.pools),o.push(...a)}return{flowNodes:t,lanes:s,pools:i,edges:o}}deserializeFonts(e){this.convertedFonts=new Map,S(e).forEach(t=>S(t.Font).forEach(s=>this.convertedFonts.set(t.id,new js(s.name,s.size,s.isBold,s.isItalic,s.isUnderline,s.isStrikeThrough))))}deserializeShapes(e){const t={flowNodes:[],lanes:[],pools:[]};return S(e).forEach(s=>{this.deserializeShapeAndStoreIfFound(s,t.flowNodes,i=>this.convertedElements.findFlowNode(i))||this.deserializeShapeAndStoreIfFound(s,t.lanes,i=>this.convertedElements.findLane(i))||this.deserializeShapeAndStoreIfFound(s,t.pools,i=>this.convertedElements.findPoolById(i))||this.parsingMessageCollector.warning(new Gs(s.bpmnElement))}),t}deserializeShapeAndStoreIfFound(e,t,s){const i=this.deserializeShape(e,s);return i?(t.push(i),!0):!1}deserializeShape(e,t){const s=t(e.bpmnElement);if(s){const i=q.deserializeBounds(e);(s instanceof Ie||s instanceof de&&s.callActivityKind===ae.CALLING_PROCESS)&&!e.isExpanded&&s.markers.push(w.EXPAND);let o;C.isPoolOrLane(s.kind)&&(o=e.isHorizontal??!0);const r=e.BPMNLabel,l=this.deserializeLabel(r,e.id),a=new Se(e.id,s,i,l,o);return q.setColorExtensionsOnShape(a,e),a}}static setColorExtensionsOnShape(e,t){"background-color"in t?e.extensions.fillColor=t["background-color"]:"fill"in t&&(e.extensions.fillColor=t.fill),"border-color"in t?e.extensions.strokeColor=t["border-color"]:"stroke"in t&&(e.extensions.strokeColor=t.stroke)}static deserializeBounds(e){const t=e.Bounds;if(t)return new Ks(t.x,t.y,t.width,t.height)}deserializeEdges(e){return S(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 Ys(t.bpmnElement));return}const i=this.deserializeWaypoints(t.waypoint),o=this.deserializeLabel(t.BPMNLabel,t.id),r=t.messageVisibleKind?t.messageVisibleKind:fe.NONE,l=new zs(t.id,s,i,o,r);return q.setColorExtensionsOnEdge(l,t),l}).filter(Boolean)}static setColorExtensionsOnEdge(e,t){"border-color"in t?e.extensions.strokeColor=t["border-color"]:"stroke"in t&&(e.extensions.strokeColor=t.stroke)}deserializeWaypoints(e){return S(e).map(t=>new Xs(t.x,t.y))}deserializeLabel(e,t){if(e&&typeof e=="object"){const s=this.findFont(e.labelStyle,t),i=q.deserializeBounds(e),o=new $s(s,i);if("color"in e)return o.extensions.color=e.color,o;if(s||i)return o}}findFont(e,t){let s;return e&&(s=this.convertedFonts.get(e),s||this.parsingMessageCollector.warning(new Vs(t,e))),s}}class Zs{constructor(e){this.convertedElements=e}deserialize(e){It.forEach(t=>{const s=e[t+"EventDefinition"];S(s,!0).forEach(i=>this.convertedElements.registerEventDefinitionsOfDefinition(i.id,t))})}}class qs{constructor(e){this.convertedElements=e}deserialize(e){this.parseGlobalTasks(e.globalTask,d.GLOBAL_TASK),this.parseGlobalTasks(e.globalBusinessRuleTask,d.GLOBAL_TASK_BUSINESS_RULE),this.parseGlobalTasks(e.globalManualTask,d.GLOBAL_TASK_MANUAL),this.parseGlobalTasks(e.globalScriptTask,d.GLOBAL_TASK_SCRIPT),this.parseGlobalTasks(e.globalUserTask,d.GLOBAL_TASK_USER)}parseGlobalTasks(e,t){S(e).forEach(s=>this.convertedElements.registerGlobalTask(s.id,t))}}const Qs=(n,e)=>{switch(n){case"adHocSubProcess":return U.AD_HOC;case"transaction":return U.TRANSACTION;default:return e.triggeredByEvent?U.EVENT:U.EMBEDDED}},Js=["adHocSubProcess","transaction"].concat(C.flowNodeKinds().filter(n=>n!=d.EVENT_BOUNDARY)).concat([d.EVENT_BOUNDARY]);function ei(n){return["adHocSubProcess","transaction"].includes(n)?d.SUB_PROCESS:n}class ti{constructor(e,t){g(this,"defaultSequenceFlowIds",[]);g(this,"elementsWithoutParentByProcessId",new Map);g(this,"callActivitiesCallingProcess",new Map);this.convertedElements=e,this.parsingMessageCollector=t}deserialize(e){S(e).forEach(t=>this.parseProcess(t)),S(e).forEach(t=>this.assignParentOfProcessElementsCalledByCallActivity(t.id)),this.assignIncomingAndOutgoingIdsFromFlows()}assignParentOfProcessElementsCalledByCallActivity(e){const t=this.callActivitiesCallingProcess.get(e);if(t){const s=this.convertedElements.findPoolByProcessRef(e);s&&(s.parentId=t.id),this.elementsWithoutParentByProcessId.get(e).forEach(i=>{i.parentId=t.id})}}assignIncomingAndOutgoingIdsFromFlows(){const e=(t,s,i)=>{const o=this.convertedElements.findFlowNode(t)??this.convertedElements.findLane(t)??this.convertedElements.findPoolById(t);o&&!o[s].includes(i)&&o[s].push(i)};this.convertedElements.getFlows().forEach(t=>{e(t.sourceRefId,"outgoingIds",t.id),e(t.targetRefId,"incomingIds",t.id)})}parseProcess(e){const t=e.id,s=this.convertedElements.findPoolByProcessRef(t);s&&!s.name&&this.convertedElements.registerPool(new Y(s.id,e.name,d.POOL),t),this.buildProcessInnerElements(e,s==null?void 0:s.id)}buildProcessInnerElements(e,t){this.elementsWithoutParentByProcessId.set(e.id,[]),Js.forEach(s=>this.buildFlowNodeBpmnElements(e[s],ei(s),t,e.id,s)),this.buildLaneSetBpmnElements(e.laneSet,t,e.id),this.buildSequenceFlows(e.sequenceFlow),this.buildAssociationFlows(e.association)}buildFlowNodeBpmnElements(e,t,s,i,o){S(e).forEach(r=>{let l;if(C.isEvent(t))l=this.buildShapeBpmnEvent(r,t,s);else if(C.isActivity(t))l=this.buildShapeBpmnActivity(r,t,s,o);else if(t==d.GATEWAY_EVENT_BASED){const a=r;l=new Lt(r.id,a.name,s,a.instantiate,ce[a.eventGatewayType])}else if(t==d.GROUP)l=kt(this.convertedElements,this.parsingMessageCollector,r,s);else{const a=t===d.TEXT_ANNOTATION?r.text:r.name;l=new Y(r.id,a,t,s,r.instantiate)}"default"in r&&C.isWithDefaultSequenceFlow(t)&&this.defaultSequenceFlowIds.push(r.default),l&&(this.convertedElements.registerFlowNode(l),s||this.elementsWithoutParentByProcessId.get(i).push(l))})}buildShapeBpmnActivity(e,t,s,i){const o=ni(e);return C.isSubProcess(t)?this.buildShapeBpmnSubProcess(e,s,Qs(i,e),o):C.isCallActivity(t)?this.buildShapeBpmnCallActivity(e,s,o):new Le(e.id,e.name,t,s,e.instantiate,o)}buildShapeBpmnCallActivity(e,t,s){const i=this.convertedElements.findGlobalTask(e.calledElement);if(!i){const o=new de(e.id,e.name,ae.CALLING_PROCESS,t,s);return this.callActivitiesCallingProcess.set(e.calledElement,o),o}return new de(e.id,e.name,ae.CALLING_GLOBAL_TASK,t,s,i)}buildShapeBpmnEvent(e,t,s){const i=this.getEventDefinitions(e),o=i.map(r=>r.counter).reduce((r,l)=>r+l,0);if(o==0&&C.canHaveNoneEvent(t))return new he(e.id,e.name,t,R.NONE,s);if(o==1){const r=i[0].kind;return C.isBoundaryEvent(t)?this.buildShapeBpmnBoundaryEvent(e,r):C.isStartEvent(t)?new Nt(e.id,e.name,r,s,e.isInterrupting):new he(e.id,e.name,t,r,s)}}buildShapeBpmnBoundaryEvent(e,t){const s=this.convertedElements.findFlowNode(e.attachedToRef);if(C.isActivity(s==null?void 0:s.kind))return new vt(e.id,e.name,t,e.attachedToRef,e.cancelActivity);this.parsingMessageCollector.warning(new Ws(e.id,e.attachedToRef,s==null?void 0:s.kind))}getEventDefinitions(e){const t=new Map;return It.forEach(s=>{const i=e[s+"EventDefinition"],o=S(i,!0).length;t.set(s,o)}),S(e.eventDefinitionRef).forEach(s=>{const i=this.convertedElements.findEventDefinitionOfDefinition(s);t.set(i,t.get(i)+1)}),Array.from(t.keys()).map(s=>({kind:s,counter:t.get(s)})).filter(s=>s.counter>0)}buildShapeBpmnSubProcess(e,t,s,i){const o=new Ie(e.id,e.name,s,t,i);return this.buildProcessInnerElements(e,e.id),o}buildLaneSetBpmnElements(e,t,s){S(e).forEach(i=>this.buildLaneBpmnElements(i.lane,t,s))}buildLaneBpmnElements(e,t,s){S(e).forEach(i=>{var r;const o=new Y(i.id,i.name,d.LANE,t);this.convertedElements.registerLane(o),t||this.elementsWithoutParentByProcessId.get(s).push(o),this.assignParentOfLaneFlowNodes(i),(r=i.childLaneSet)!=null&&r.lane&&this.buildLaneBpmnElements(i.childLaneSet.lane,i.id,s)})}assignParentOfLaneFlowNodes(e){S(e.flowNodeRef).forEach(t=>{const s=this.convertedElements.findFlowNode(t),i=e.id;s?C.isBoundaryEvent(s.kind)||(s.parentId=i):this.parsingMessageCollector.warning(new Us(i,t))})}buildSequenceFlows(e){S(e).forEach(t=>{const s=this.getSequenceFlowKind(t);this.convertedElements.registerSequenceFlow(new Ct(t.id,t.name,t.sourceRef,t.targetRef,s))})}buildAssociationFlows(e){S(e).forEach(t=>{const s=t.associationDirection;this.convertedElements.registerAssociationFlow(new At(t.id,void 0,t.sourceRef,t.targetRef,s))})}getSequenceFlowKind(e){if(this.defaultSequenceFlowIds.includes(e.id))return G.DEFAULT;{const t=this.convertedElements.findFlowNode(e.sourceRef);if(t&&C.isWithDefaultSequenceFlow(t.kind)&&e.conditionExpression)return C.isActivity(t.kind)?G.CONDITIONAL_FROM_ACTIVITY:G.CONDITIONAL_FROM_GATEWAY}return G.NORMAL}}const ni=n=>{const e=[],t=n.standardLoopCharacteristics,s=S(n.multiInstanceLoopCharacteristics,!0)[0];return t!==void 0?e.push(w.LOOP):s&&e.push(s.isSequential?w.MULTI_INSTANCE_SEQUENTIAL:w.MULTI_INSTANCE_PARALLEL),e};class si{constructor(e,t,s,i,o,r){this.categoryConverter=e,this.collaborationConverter=t,this.eventDefinitionConverter=s,this.globalTaskConverter=i,this.processConverter=o,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 ii(n){const e=new Ds;return new si(new ks(e),new Hs(e,n),new Zs(e),new qs(e),new ti(e,n),new q(e,n))}var Ke={},_e={};(function(n){const e=":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",t=e+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040",s="["+e+"]["+t+"]*",i=new RegExp("^"+s+"$"),o=function(l,a){const u=[];let h=a.exec(l);for(;h;){const f=[];f.startIndex=a.lastIndex-h[0].length;const p=h.length;for(let T=0;T"u")};n.isExist=function(l){return typeof l<"u"},n.isEmptyObject=function(l){return Object.keys(l).length===0},n.merge=function(l,a,u){if(a){const h=Object.keys(a),f=h.length;for(let p=0;p"&&n[o]!==" "&&n[o]!==" "&&n[o]!==` +`&&n[o]!=="\r";o++)a+=n[o];if(a=a.trim(),a[a.length-1]==="/"&&(a=a.substring(0,a.length-1),o--),!fi(a)){let f;return a.trim().length===0?f="Invalid space after '<'.":f="Tag '"+a+"' is an invalid name.",y("InvalidTag",f,b(n,o))}const u=ai(n,o);if(u===!1)return y("InvalidAttr","Attributes for '"+a+"' have open quote.",b(n,o));let h=u.value;if(o=u.index,h[h.length-1]==="/"){const f=o-h.length;h=h.substring(0,h.length-1);const p=Tt(h,e);if(p===!0)s=!0;else return y(p.err.code,p.err.msg,b(n,f+p.err.line))}else if(l)if(u.tagClosed){if(h.trim().length>0)return y("InvalidTag","Closing tag '"+a+"' can't have attributes or invalid starting.",b(n,r));{const f=t.pop();if(a!==f.tagName){let p=b(n,f.tagStartPos);return y("InvalidTag","Expected closing tag '"+f.tagName+"' (opened in line "+p.line+", col "+p.col+") instead of closing tag '"+a+"'.",b(n,r))}t.length==0&&(i=!0)}}else return y("InvalidTag","Closing tag '"+a+"' doesn't have proper closing.",b(n,o));else{const f=Tt(h,e);if(f!==!0)return y(f.err.code,f.err.msg,b(n,o-h.length+f.err.line));if(i===!0)return y("InvalidXml","Multiple possible root nodes found.",b(n,o));e.unpairedTags.indexOf(a)!==-1||t.push({tagName:a,tagStartPos:r}),s=!0}for(o++;o0)return y("InvalidXml","Invalid '"+JSON.stringify(t.map(o=>o.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1})}else return y("InvalidXml","Start tag expected.",1);return!0};function ht(n){return n===" "||n===" "||n===` +`||n==="\r"}function ft(n,e){const t=e;for(;e5&&s==="xml")return y("InvalidXml","XML declaration allowed only at the start of the document.",b(n,e));if(n[e]=="?"&&n[e+1]==">"){e++;break}else continue}return e}function gt(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 ri='"',li="'";function ai(n,e){let t="",s="",i=!1;for(;e"&&s===""){i=!0;break}t+=n[e]}return s!==""?!1:{value:t,index:e,tagClosed:i}}const ci=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function Tt(n,e){const t=ze.getAllMatches(n,ci),s={};for(let i=0;i!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(n,e,t){return n}},gi=function(n){return Object.assign({},Mt,n)};Xe.buildOptions=gi;Xe.defaultOptions=Mt;class Ti{constructor(e){this.tagname=e,this.child=[],this[":@"]={}}add(e,t){e==="__proto__"&&(e="#__proto__"),this.child.push({[e]:t})}addChild(e){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})}}var pi=Ti;const Ei=_e;function Si(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,i=!1,o=!1,r="";for(;e"){if(o?n[e-1]==="-"&&n[e-2]==="-"&&(o=!1,s--):s--,s===0)break}else n[e]==="["?i=!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}}function Ii(n,e){let t="";for(;e0&&i&&t[2]!==".")return n;if(!e.leadingZeros&&o.length>0&&!i&&t[1]!==".")return n;{const a=Number(t),u=""+a;return u.search(/[eE]/)!==-1||l?e.eNotation?a:n:t.indexOf(".")!==-1?u==="0"&&r===""||u===r||i&&u==="-"+r?a:n:o?r===u||i+r===u?a:n:t===u||t===i+u?a:n}}else return n}}function bi(n){return n&&n.indexOf(".")!==-1&&(n=n.replace(/0+$/,""),n==="."?n="0":n[0]==="."?n="0"+n:n[n.length-1]==="."&&(n=n.substr(0,n.length-1))),n}var Fi=Ri;const $e=_e,re=pi,Pi=Li,xi=Fi;"<((!\\[CDATA\\[([\\s\\S]*?)(]]>))|((NAME:)?(NAME))([^>]*)>|((\\/)(NAME)\\s*>))([^<]*)".replace(/NAME/g,$e.nameRegexp);let ki=class{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:"₹"}},this.addExternalEntities=Mi,this.parseXml=Ui,this.parseTextData=Bi,this.resolveNameSpace=Gi,this.buildAttributesMap=Vi,this.isItStopNode=Ki,this.replaceEntitiesValue=Di,this.readStopNodeData=Xi,this.saveTextToParentTag=Hi,this.addChild=Wi}};function Mi(n){const e=Object.keys(n);for(let t=0;t0)){r||(n=this.replaceEntitiesValue(n));const l=this.options.tagValueProcessor(e,n,t,i,o);return l==null?n:typeof l!=typeof n||l!==n?l:this.options.trimValues?Ve(n,this.options.parseTagValue,this.options.numberParseOptions):n.trim()===n?Ve(n,this.options.parseTagValue,this.options.numberParseOptions):n}}function Gi(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 Yi=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function Vi(n,e,t){if(!this.options.ignoreAttributes&&typeof n=="string"){const s=$e.getAllMatches(n,Yi),i=s.length,o={};for(let r=0;r",o,"Closing Tag is not closed.");let a=n.substring(o+2,l).trim();if(this.options.removeNSPrefix){const f=a.indexOf(":");f!==-1&&(a=a.substr(f+1))}this.options.transformTagName&&(a=this.options.transformTagName(a)),t&&(s=this.saveTextToParentTag(s,t,i));const u=i.substring(i.lastIndexOf(".")+1);if(a&&this.options.unpairedTags.indexOf(a)!==-1)throw new Error(`Unpaired tag can not be used as closing tag: `);let h=0;u&&this.options.unpairedTags.indexOf(u)!==-1?(h=i.lastIndexOf(".",i.lastIndexOf(".")-1),this.tagsNodeStack.pop()):h=i.lastIndexOf("."),i=i.substring(0,h),t=this.tagsNodeStack.pop(),s="",o=l}else if(n[o+1]==="?"){let l=Ye(n,o,!1,"?>");if(!l)throw new Error("Pi Tag is not closed.");if(s=this.saveTextToParentTag(s,t,i),!(this.options.ignoreDeclaration&&l.tagName==="?xml"||this.options.ignorePiTags)){const a=new re(l.tagName);a.add(this.options.textNodeName,""),l.tagName!==l.tagExp&&l.attrExpPresent&&(a[":@"]=this.buildAttributesMap(l.tagExp,i,l.tagName)),this.addChild(t,a,i)}o=l.closeIndex+1}else if(n.substr(o+1,3)==="!--"){const l=$(n,"-->",o+4,"Comment is not closed.");if(this.options.commentPropName){const a=n.substring(o+4,l-2);s=this.saveTextToParentTag(s,t,i),t.add(this.options.commentPropName,[{[this.options.textNodeName]:a}])}o=l}else if(n.substr(o+1,2)==="!D"){const l=Pi(n,o);this.docTypeEntities=l.entities,o=l.i}else if(n.substr(o+1,2)==="!["){const l=$(n,"]]>",o,"CDATA is not closed.")-2,a=n.substring(o+9,l);if(s=this.saveTextToParentTag(s,t,i),this.options.cdataPropName)t.add(this.options.cdataPropName,[{[this.options.textNodeName]:a}]);else{let u=this.parseTextData(a,t.tagname,i,!0,!1,!0);u==null&&(u=""),t.add(this.options.textNodeName,u)}o=l+2}else{let l=Ye(n,o,this.options.removeNSPrefix),a=l.tagName,u=l.tagExp,h=l.attrExpPresent,f=l.closeIndex;this.options.transformTagName&&(a=this.options.transformTagName(a)),t&&s&&t.tagname!=="!xml"&&(s=this.saveTextToParentTag(s,t,i,!1));const p=t;if(p&&this.options.unpairedTags.indexOf(p.tagname)!==-1&&(t=this.tagsNodeStack.pop(),i=i.substring(0,i.lastIndexOf("."))),a!==e.tagname&&(i+=i?"."+a:a),this.isItStopNode(this.options.stopNodes,i,a)){let T="";if(u.length>0&&u.lastIndexOf("/")===u.length-1)o=l.closeIndex;else if(this.options.unpairedTags.indexOf(a)!==-1)o=l.closeIndex;else{const M=this.readStopNodeData(n,a,f+1);if(!M)throw new Error(`Unexpected end of ${a}`);o=M.i,T=M.tagContent}const m=new re(a);a!==u&&h&&(m[":@"]=this.buildAttributesMap(u,i,a)),T&&(T=this.parseTextData(T,a,i,!0,h,!0,!0)),i=i.substr(0,i.lastIndexOf(".")),m.add(this.options.textNodeName,T),this.addChild(t,m,i)}else{if(u.length>0&&u.lastIndexOf("/")===u.length-1){a[a.length-1]==="/"?(a=a.substr(0,a.length-1),i=i.substr(0,i.length-1),u=a):u=u.substr(0,u.length-1),this.options.transformTagName&&(a=this.options.transformTagName(a));const T=new re(a);a!==u&&h&&(T[":@"]=this.buildAttributesMap(u,i,a)),this.addChild(t,T,i),i=i.substr(0,i.lastIndexOf("."))}else{const T=new re(a);this.tagsNodeStack.push(t),a!==u&&h&&(T[":@"]=this.buildAttributesMap(u,i,a)),this.addChild(t,T,i),t=T}s="",o=f}}else s+=n[o];return e.child};function Wi(n,e,t){const s=this.options.updateTag(e.tagname,t,e[":@"]);s===!1||(typeof s=="string"&&(e.tagname=s),n.addChild(e))}const Di=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 Hi(n,e,t,s){return n&&(s===void 0&&(s=Object.keys(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 Ki(n,e,t){const s="*."+t;for(const i in n){const o=n[i];if(s===o||e===o)return!0}return!1}function zi(n,e,t=">"){let s,i="";for(let o=e;o",t,`${e} is not closed`);if(n.substring(t+2,o).trim()===e&&(i--,i===0))return{tagContent:n.substring(s,t),i:o};t=o}else if(n[t+1]==="?")t=$(n,"?>",t+1,"StopNode is not closed.");else if(n.substr(t+1,3)==="!--")t=$(n,"-->",t+3,"StopNode is not closed.");else if(n.substr(t+1,2)==="![")t=$(n,"]]>",t,"StopNode is not closed.")-2;else{const o=Ye(n,t,">");o&&((o&&o.tagName)===e&&o.tagExp[o.tagExp.length-1]!=="/"&&i++,t=o.closeIndex)}}function Ve(n,e,t){if(e&&typeof n=="string"){const s=n.trim();return s==="true"?!0:s==="false"?!1:xi(n,t)}else return $e.isExist(n)?n:""}var $i=ki,Bt={};function ji(n,e){return Gt(n,e)}function Gt(n,e,t){let s;const i={};for(let o=0;o0&&(i[e.textNodeName]=s):s!==void 0&&(i[e.textNodeName]=s),i}function Zi(n){const e=Object.keys(n);for(let t=0;t0&&(t=oo),Yt(n,e,"",t)}function Yt(n,e,t,s){let i="",o=!1;for(let r=0;r`,o=!1;continue}else if(a===e.commentPropName){i+=s+``,o=!0;continue}else if(a[0]==="?"){const m=pt(l[":@"],e),M=a==="?xml"?"":s;let z=l[a][0][e.textNodeName];z=z.length!==0?" "+z:"",i+=M+`<${a}${z}${m}?>`,o=!0;continue}let h=s;h!==""&&(h+=e.indentBy);const f=pt(l[":@"],e),p=s+`<${a}${f}`,T=Yt(l[a],e,u,h);e.unpairedTags.indexOf(a)!==-1?e.suppressUnpairedNode?i+=p+">":i+=p+"/>":(!T||T.length===0)&&e.suppressEmptyNode?i+=p+"/>":T&&T.endsWith(">")?i+=p+`>${T}${s}`:(i+=p+">",T&&s!==""&&(T.includes("/>")||T.includes("`),o=!0}return i}function lo(n){const e=Object.keys(n);for(let t=0;t0&&e.processEntities)for(let t=0;t","g"),val:">"},{regex:new RegExp("<","g"),val:"<"},{regex:new RegExp("'","g"),val:"'"},{regex:new RegExp('"',"g"),val:"""}],processEntities:!0,stopNodes:[],oneListGroup:!1};function K(n){this.options=Object.assign({},ho,n),this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=To),this.processTextOrObjNode=fo,this.options.format?(this.indentate=go,this.tagEndChar=`> `,this.newLine=` -`):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}K.prototype.build=function(n){return this.options.preserveOrder?Gi(n,this.options):(Array.isArray(n)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(n={[this.options.arrayNodeName]:n}),this.j2x(n,0).val)};K.prototype.j2x=function(n,e){let t="",s="";for(let i in n)if(typeof n[i]>"u")this.isAttribute(i)&&(s+="");else if(n[i]===null)this.isAttribute(i)?s+="":i[0]==="?"?s+=this.indentate(e)+"<"+i+"?"+this.tagEndChar:s+=this.indentate(e)+"<"+i+"/"+this.tagEndChar;else if(n[i]instanceof Date)s+=this.buildTextValNode(n[i],i,"",e);else if(typeof n[i]!="object"){const o=this.isAttribute(i);if(o)t+=this.buildAttrPairStr(o,""+n[i]);else if(i===this.options.textNodeName){let r=this.options.tagValueProcessor(i,""+n[i]);s+=this.replaceEntitiesValue(r)}else s+=this.buildTextValNode(n[i],i,"",e)}else if(Array.isArray(n[i])){const o=n[i].length;let r="";for(let l=0;l"u"||(a===null?i[0]==="?"?s+=this.indentate(e)+"<"+i+"?"+this.tagEndChar:s+=this.indentate(e)+"<"+i+"/"+this.tagEndChar:typeof a=="object"?this.options.oneListGroup?r+=this.j2x(a,e+1).val:r+=this.processTextOrObjNode(a,i,e):r+=this.buildTextValNode(a,i,"",e))}this.options.oneListGroup&&(r=this.buildObjectNode(r,i,"",e)),s+=r}else if(this.options.attributesGroupName&&i===this.options.attributesGroupName){const o=Object.keys(n[i]),r=o.length;for(let l=0;l"+n+i:this.options.commentPropName!==!1&&e===this.options.commentPropName&&o.length===0?this.indentate(s)+``+this.newLine:this.indentate(s)+"<"+e+t+o+this.tagEndChar+n+this.indentate(s)+i}};K.prototype.closeTag=function(n){let e="";return this.options.unpairedTags.indexOf(n)!==-1?this.options.suppressUnpairedNode||(e="/"):this.options.suppressEmptyNode?e="/":e=`>`+this.newLine;if(this.options.commentPropName!==!1&&e===this.options.commentPropName)return this.indentate(s)+``+this.newLine;if(e[0]==="?")return this.indentate(s)+"<"+e+t+"?"+this.tagEndChar;{let i=this.options.tagValueProcessor(e,n);return i=this.replaceEntitiesValue(i),i===""?this.indentate(s)+"<"+e+t+this.closeTag(e)+this.tagEndChar:this.indentate(s)+"<"+e+t+">"+i+"0&&this.options.processEntities)for(let e=0;e"},{regex:/&(lt|#60|#x3c|#x3C);/g,val:"<"},{regex:/&(quot|#34|#x22);/g,val:'"'}];class ji{constructor(e){g(this,"x2jOptions",{attributeNamePrefix:"",removeNSPrefix:!0,ignoreAttributes:!1,parseAttributeValue:!0,processEntities:!1,attributeValueProcessor:(e,t)=>this.processAttribute(t)});g(this,"xmlParser",new Xi.XMLParser(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 $i)e=e.replace(s.regex,s.val);return(t=this.options)!=null&&t.additionalXmlAttributeProcessor&&(e=this.options.additionalXmlAttributeProcessor(e)),e}}class ne{}class Zi{warning(e){const t=e.getMessage();console.warn(`[bv-parser] ${t.template}`,...t.arguments)}}class qi extends ne{constructor(e,t){super(),this.groupBpmnElementId=e,this.categoryValueRef=t}getMessage(){return{arguments:[this.categoryValueRef,this.groupBpmnElementId],template:"Group json deserialization: unable to find category value ref %s for bpmn element %s"}}}class Qi extends ne{constructor(e){super(),this.bpmnElementId=e}getMessage(){return{arguments:[this.bpmnElementId],template:"Shape json deserialization: unable to find bpmn element with id %s"}}}class Ji extends ne{constructor(e){super(),this.bpmnElementId=e}getMessage(){return{arguments:[this.bpmnElementId],template:"Edge json deserialization: unable to find bpmn element with id %s"}}}class eo extends ne{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 to extends ne{constructor(e,t){super(),this.laneId=e,this.flowNodeRef=t}getMessage(){return{arguments:[this.flowNodeRef,this.laneId],template:"Unable to assign lane %s as parent: flow node %s is not found"}}}class no extends ne{constructor(e,t,s){super(),this.bpmnElementId=e,this.attachedToRef=t,this.attachedToKind=s}getMessage(){return{arguments:[this.bpmnElementId,this.attachedToRef,this.attachedToKind],template:"The boundary event %s must be attached to an activity, and not to %s of kind %s"}}}class so{constructor(){g(this,"poolsById",new Map);g(this,"poolsByProcessRef",new Map);g(this,"messageFlows",new Map);g(this,"flowNodes",new Map);g(this,"lanes",new Map);g(this,"sequenceFlows",new Map);g(this,"associationFlows",new Map);g(this,"eventDefinitionsOfDefinitions",new Map);g(this,"globalTasks",new Map);g(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 Vt=(n,e,t,s)=>{const i=n.findCategoryValue(t.categoryValueRef);if(i)return new Y(t.id,i.value,d.GROUP,s);e.warning(new qi(t.id,t.categoryValueRef))};class io{constructor(e,t){this.convertedElements=e,this.parsingMessageCollector=t}deserialize(e){S(e).forEach(t=>this.parseCollaboration(t))}parseCollaboration(e){this.buildParticipant(e.participant),this.buildMessageFlows(e.messageFlow),this.buildGroups(e.group)}buildParticipant(e){S(e).forEach(t=>this.convertedElements.registerPool(new Y(t.id,t.name,d.POOL),t.processRef))}buildMessageFlows(e){S(e).forEach(t=>this.convertedElements.registerMessageFlow(new Rt(t.id,t.name,t.sourceRef,t.targetRef)))}buildGroups(e){S(e).forEach(t=>{const s=Vt(this.convertedElements,this.parsingMessageCollector,t);s&&this.convertedElements.registerFlowNode(s)})}}const oo=(n,e)=>{switch(n){case"adHocSubProcess":return U.AD_HOC;case"transaction":return U.TRANSACTION;default:return e.triggeredByEvent?U.EVENT:U.EMBEDDED}},ro=["adHocSubProcess","transaction"].concat(C.flowNodeKinds().filter(n=>n!=d.EVENT_BOUNDARY)).concat([d.EVENT_BOUNDARY]);function lo(n){return["adHocSubProcess","transaction"].includes(n)?d.SUB_PROCESS:n}class ao{constructor(e,t){g(this,"defaultSequenceFlowIds",[]);g(this,"elementsWithoutParentByProcessId",new Map);g(this,"callActivitiesCallingProcess",new Map);this.convertedElements=e,this.parsingMessageCollector=t}deserialize(e){S(e).forEach(t=>this.parseProcess(t)),S(e).forEach(t=>this.assignParentOfProcessElementsCalledByCallActivity(t.id)),this.assignIncomingAndOutgoingIdsFromFlows()}assignParentOfProcessElementsCalledByCallActivity(e){const t=this.callActivitiesCallingProcess.get(e);if(t){const s=this.convertedElements.findPoolByProcessRef(e);s&&(s.parentId=t.id),this.elementsWithoutParentByProcessId.get(e).forEach(i=>{i.parentId=t.id})}}assignIncomingAndOutgoingIdsFromFlows(){const e=(t,s,i)=>{const o=this.convertedElements.findFlowNode(t)??this.convertedElements.findLane(t)??this.convertedElements.findPoolById(t);o&&!o[s].includes(i)&&o[s].push(i)};this.convertedElements.getFlows().forEach(t=>{e(t.sourceRefId,"outgoingIds",t.id),e(t.targetRefId,"incomingIds",t.id)})}parseProcess(e){const t=e.id,s=this.convertedElements.findPoolByProcessRef(t);s&&!s.name&&this.convertedElements.registerPool(new Y(s.id,e.name,d.POOL),t),this.buildProcessInnerElements(e,s==null?void 0:s.id)}buildProcessInnerElements(e,t){this.elementsWithoutParentByProcessId.set(e.id,[]),ro.forEach(s=>this.buildFlowNodeBpmnElements(e[s],lo(s),t,e.id,s)),this.buildLaneSetBpmnElements(e.laneSet,t,e.id),this.buildSequenceFlows(e.sequenceFlow),this.buildAssociationFlows(e.association)}buildFlowNodeBpmnElements(e,t,s,i,o){S(e).forEach(r=>{let l;if(C.isEvent(t))l=this.buildShapeBpmnEvent(r,t,s);else if(C.isActivity(t))l=this.buildShapeBpmnActivity(r,t,s,o);else if(t==d.GATEWAY_EVENT_BASED){const a=r;l=new xt(r.id,a.name,s,a.instantiate,ce[a.eventGatewayType])}else if(t==d.GROUP)l=Vt(this.convertedElements,this.parsingMessageCollector,r,s);else{const a=t===d.TEXT_ANNOTATION?r.text:r.name;l=new Y(r.id,a,t,s,r.instantiate)}"default"in r&&C.isWithDefaultSequenceFlow(t)&&this.defaultSequenceFlowIds.push(r.default),l&&(this.convertedElements.registerFlowNode(l),s||this.elementsWithoutParentByProcessId.get(i).push(l),l.incomingIds=S(r.incoming),l.outgoingIds=S(r.outgoing))})}buildShapeBpmnActivity(e,t,s,i){const o=co(e);return C.isSubProcess(t)?this.buildShapeBpmnSubProcess(e,s,oo(i,e),o):C.isCallActivity(t)?this.buildShapeBpmnCallActivity(e,s,o):new ye(e.id,e.name,t,s,e.instantiate,o)}buildShapeBpmnCallActivity(e,t,s){const i=this.convertedElements.findGlobalTask(e.calledElement);if(!i){const o=new de(e.id,e.name,ae.CALLING_PROCESS,t,s);return this.callActivitiesCallingProcess.set(e.calledElement,o),o}return new de(e.id,e.name,ae.CALLING_GLOBAL_TASK,t,s,i)}buildShapeBpmnEvent(e,t,s){const i=this.getEventDefinitions(e),o=i.map(r=>r.counter).reduce((r,l)=>r+l,0);if(o==0&&C.canHaveNoneEvent(t))return new he(e.id,e.name,t,R.NONE,s);if(o==1){const r=i[0].kind;return C.isBoundaryEvent(t)?this.buildShapeBpmnBoundaryEvent(e,r):C.isStartEvent(t)?new Ft(e.id,e.name,r,s,e.isInterrupting):new he(e.id,e.name,t,r,s)}}buildShapeBpmnBoundaryEvent(e,t){const s=this.convertedElements.findFlowNode(e.attachedToRef);if(C.isActivity(s==null?void 0:s.kind))return new Pt(e.id,e.name,t,e.attachedToRef,e.cancelActivity);this.parsingMessageCollector.warning(new no(e.id,e.attachedToRef,s==null?void 0:s.kind))}getEventDefinitions(e){const t=new Map;return It.forEach(s=>{const i=e[s+"EventDefinition"],o=S(i,!0).length;t.set(s,o)}),S(e.eventDefinitionRef).forEach(s=>{const i=this.convertedElements.findEventDefinitionOfDefinition(s);t.set(i,t.get(i)+1)}),Array.from(t.keys()).map(s=>({kind:s,counter:t.get(s)})).filter(s=>s.counter>0)}buildShapeBpmnSubProcess(e,t,s,i){const o=new Oe(e.id,e.name,s,t,i);return this.buildProcessInnerElements(e,e.id),o}buildLaneSetBpmnElements(e,t,s){S(e).forEach(i=>this.buildLaneBpmnElements(i.lane,t,s))}buildLaneBpmnElements(e,t,s){S(e).forEach(i=>{var r;const o=new Y(i.id,i.name,d.LANE,t);this.convertedElements.registerLane(o),t||this.elementsWithoutParentByProcessId.get(s).push(o),this.assignParentOfLaneFlowNodes(i),(r=i.childLaneSet)!=null&&r.lane&&this.buildLaneBpmnElements(i.childLaneSet.lane,i.id,s)})}assignParentOfLaneFlowNodes(e){S(e.flowNodeRef).forEach(t=>{const s=this.convertedElements.findFlowNode(t),i=e.id;s?C.isBoundaryEvent(s.kind)||(s.parentId=i):this.parsingMessageCollector.warning(new to(i,t))})}buildSequenceFlows(e){S(e).forEach(t=>{const s=this.getSequenceFlowKind(t);this.convertedElements.registerSequenceFlow(new wt(t.id,t.name,t.sourceRef,t.targetRef,s))})}buildAssociationFlows(e){S(e).forEach(t=>{const s=t.associationDirection;this.convertedElements.registerAssociationFlow(new bt(t.id,void 0,t.sourceRef,t.targetRef,s))})}getSequenceFlowKind(e){if(this.defaultSequenceFlowIds.includes(e.id))return G.DEFAULT;{const t=this.convertedElements.findFlowNode(e.sourceRef);if(t&&C.isWithDefaultSequenceFlow(t.kind)&&e.conditionExpression)return C.isActivity(t.kind)?G.CONDITIONAL_FROM_ACTIVITY:G.CONDITIONAL_FROM_GATEWAY}return G.NORMAL}}const co=n=>{const e=[],t=n.standardLoopCharacteristics,s=S(n.multiInstanceLoopCharacteristics,!0)[0];return t!==void 0?e.push(w.LOOP):s&&e.push(s.isSequential?w.MULTI_INSTANCE_SEQUENTIAL:w.MULTI_INSTANCE_PARALLEL),e};class uo{constructor(e,t,s,i){this.x=e,this.y=t,this.width=s,this.height=i}}class ho{constructor(e,t,s,i,o=fe.NONE){g(this,"extensions",{});this.id=e,this.bpmnElement=t,this.waypoints=s,this.label=i,this.messageVisibleKind=o}}class fo{constructor(e,t){this.x=e,this.y=t}}class go{constructor(e,t){g(this,"extensions",{});this.font=e,this.bounds=t}}class To{constructor(e,t,s,i,o,r){this.name=e,this.size=t,this.isBold=s,this.isItalic=i,this.isUnderline=o,this.isStrikeThrough=r}}class q{constructor(e,t){g(this,"convertedFonts",new Map);this.convertedElements=e,this.parsingMessageCollector=t}deserialize(e){const t=[],s=[],i=[],o=[],r=S(e)[0];if(r){this.deserializeFonts(r.BPMNLabelStyle);const l=r.BPMNPlane,a=this.deserializeEdges(l.BPMNEdge),u=this.deserializeShapes(l.BPMNShape);t.push(...u.flowNodes),s.push(...u.lanes),i.push(...u.pools),o.push(...a)}return{flowNodes:t,lanes:s,pools:i,edges:o}}deserializeFonts(e){this.convertedFonts=new Map,S(e).forEach(t=>S(t.Font).forEach(s=>this.convertedFonts.set(t.id,new To(s.name,s.size,s.isBold,s.isItalic,s.isUnderline,s.isStrikeThrough))))}deserializeShapes(e){const t={flowNodes:[],lanes:[],pools:[]};return S(e).forEach(s=>{this.deserializeShapeAndStoreIfFound(s,t.flowNodes,i=>this.convertedElements.findFlowNode(i))||this.deserializeShapeAndStoreIfFound(s,t.lanes,i=>this.convertedElements.findLane(i))||this.deserializeShapeAndStoreIfFound(s,t.pools,i=>this.convertedElements.findPoolById(i))||this.parsingMessageCollector.warning(new Qi(s.bpmnElement))}),t}deserializeShapeAndStoreIfFound(e,t,s){const i=this.deserializeShape(e,s);return i?(t.push(i),!0):!1}deserializeShape(e,t){const s=t(e.bpmnElement);if(s){const i=q.deserializeBounds(e);(s instanceof Oe||s instanceof de&&s.callActivityKind===ae.CALLING_PROCESS)&&!e.isExpanded&&s.markers.push(w.EXPAND);let o;C.isPoolOrLane(s.kind)&&(o=e.isHorizontal??!0);const r=e.BPMNLabel,l=this.deserializeLabel(r,e.id),a=new Se(e.id,s,i,l,o);return q.setColorExtensionsOnShape(a,e),a}}static setColorExtensionsOnShape(e,t){"background-color"in t?e.extensions.fillColor=t["background-color"]:"fill"in t&&(e.extensions.fillColor=t.fill),"border-color"in t?e.extensions.strokeColor=t["border-color"]:"stroke"in t&&(e.extensions.strokeColor=t.stroke)}static deserializeBounds(e){const t=e.Bounds;if(t)return new uo(t.x,t.y,t.width,t.height)}deserializeEdges(e){return S(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 Ji(t.bpmnElement));return}const i=this.deserializeWaypoints(t.waypoint),o=this.deserializeLabel(t.BPMNLabel,t.id),r=t.messageVisibleKind?t.messageVisibleKind:fe.NONE,l=new ho(t.id,s,i,o,r);return q.setColorExtensionsOnEdge(l,t),l}).filter(Boolean)}static setColorExtensionsOnEdge(e,t){"border-color"in t?e.extensions.strokeColor=t["border-color"]:"stroke"in t&&(e.extensions.strokeColor=t.stroke)}deserializeWaypoints(e){return S(e).map(t=>new fo(t.x,t.y))}deserializeLabel(e,t){if(e&&typeof e=="object"){const s=this.findFont(e.labelStyle,t),i=q.deserializeBounds(e),o=new go(s,i);if("color"in e)return o.extensions.color=e.color,o;if(s||i)return o}}findFont(e,t){let s;return e&&(s=this.convertedFonts.get(e),s||this.parsingMessageCollector.warning(new eo(t,e))),s}}class po{constructor(e){this.convertedElements=e}deserialize(e){It.forEach(t=>{const s=e[t+"EventDefinition"];S(s,!0).forEach(i=>this.convertedElements.registerEventDefinitionsOfDefinition(i.id,t))})}}class Eo{constructor(e){this.convertedElements=e}deserialize(e){this.parseGlobalTasks(e.globalTask,d.GLOBAL_TASK),this.parseGlobalTasks(e.globalBusinessRuleTask,d.GLOBAL_TASK_BUSINESS_RULE),this.parseGlobalTasks(e.globalManualTask,d.GLOBAL_TASK_MANUAL),this.parseGlobalTasks(e.globalScriptTask,d.GLOBAL_TASK_SCRIPT),this.parseGlobalTasks(e.globalUserTask,d.GLOBAL_TASK_USER)}parseGlobalTasks(e,t){S(e).forEach(s=>this.convertedElements.registerGlobalTask(s.id,t))}}class So{constructor(e){this.convertedElements=e}deserialize(e){S(e.category).forEach(t=>S(t.categoryValue).forEach(s=>this.convertedElements.registerCategoryValue(s.id,s.value)))}}class Io{constructor(e,t,s,i,o,r){this.categoryConverter=e,this.collaborationConverter=t,this.eventDefinitionConverter=s,this.globalTaskConverter=i,this.processConverter=o,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 Co(n){const e=new so;return new Io(new So(e),new io(e,n),new po(e),new Eo(e),new ao(e,n),new q(e,n))}class mo{constructor(e,t){this.jsonParser=e,this.xmlParser=t}parse(e){const t=this.xmlParser.parse(e);return this.jsonParser.parse(t)}}function Ao(n){return new mo(Co(new Zi),new ji(n))}function Oo(n){return new No(n)}class No{constructor(e){this.graph=e}updateAndRefreshCssClassesOfCell(e,t){this.updateAndRefreshCssClassesOfElement(e,t),this.updateAndRefreshCssClassesOfElement(He(e),t)}updateAndRefreshCssClassesOfElement(e,t){const s=this.graph.getModel(),i=s.getCell(e);if(!i)return;let o=i.getStyle();o=F(o,I.EXTRA_CSS_CLASSES,t.join(",")),s.setStyle(i,o)}}function vo(n){return new Lo(Oo(n),new yo)}class Lo{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)S(e).forEach(t=>{const s=this.cssClassesCache.removeAllClassNames(t);this.updateCellIfChanged(s,t)});else{const t=this.cssClassesCache.getBpmnIds();this.cssClassesCache.clear(),t.forEach(s=>this.updateCellIfChanged(!0,s))}}toggleCssClasses(e,t){this.updateCssClasses(e,t,this.cssClassesCache.toggleClassNames)}updateCssClasses(e,t,s){const i=S(t);S(e).forEach(o=>this.updateCellIfChanged(s(o,i),o))}updateCellIfChanged(e,t){if(e){const s=this.cssClassesCache.getClassNames(t);this.cssClassesUpdater.updateAndRefreshCssClassesOfCell(t,s)}}}class yo{constructor(){g(this,"classNamesByBpmnId",new Map);g(this,"clear",()=>{this.classNamesByBpmnId.clear()});g(this,"addClassNames",(e,t)=>this.updateClassNames(e,t,(s,i)=>s.add(i)));g(this,"removeClassNames",(e,t)=>this.updateClassNames(e,t,(s,i)=>s.delete(i)));g(this,"toggleClassNames",(e,t)=>(this.updateClassNames(e,t,(s,i)=>s.has(i)?s.delete(i):s.add(i)),t&&t.length>0))}getClassNames(e){return Array.from(this.classNamesByBpmnId.get(e)??[])}getBpmnIds(){return Array.from(this.classNamesByBpmnId.keys())}removeAllClassNames(e){const t=this.getOrInitializeClassNames(e),s=t.size;return t.clear(),t.sizes(i,r)),i.size!=o}getOrInitializeClassNames(e){let t=this.classNamesByBpmnId.get(e);return t==null&&(t=new Set,this.classNamesByBpmnId.set(e,t)),t}}class je{constructor(){g(this,"overlayPositions",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"}]]))}convert(e){const t=this.convertPosition(e),s=je.convertStyle(e);return{position:t,style:s}}convertPosition(e){return this.overlayPositions.get(e.position)}static convertStyle(e){const t={fill:{color:E.DEFAULT_OVERLAY_FILL_COLOR.valueOf(),opacity:E.DEFAULT_OVERLAY_FILL_OPACITY.valueOf()},stroke:{color:E.DEFAULT_OVERLAY_STROKE_COLOR.valueOf(),width:E.DEFAULT_OVERLAY_STROKE_WIDTH.valueOf()},font:{color:E.DEFAULT_OVERLAY_FONT_COLOR.valueOf(),size:E.DEFAULT_OVERLAY_FONT_SIZE.valueOf()}},s=e.style,i={...t};return s&&(this.convertFill(i,s.fill),this.convertStroke(i,s.stroke),this.convertFont(i,s.font)),i}static convertFill(e,t){t&&(e.fill.color=t.color??e.fill.color,e.fill.opacity=t.opacity??e.fill.opacity)}static convertStroke(e,t){t&&(e.stroke.color=t.color??e.stroke.color,e.stroke.width=t.width??e.stroke.width)}static convertFont(e,t){t&&(e.font.color=t.color??e.font.color,e.font.size=t.size??e.font.size)}}function _o(n){return new wo(n,new je)}class wo{constructor(e,t){this.graph=e,this.overlayConverter=t}addOverlays(e,t){const s=this.graph.getModel().getCell(e);s&&S(t).forEach(i=>{const o=new _t(i.label,this.overlayConverter.convert(i));this.graph.addCellOverlay(s,o)})}removeAllOverlays(e){const t=this.graph.getModel().getCell(e);t&&this.graph.removeCellOverlays(t)}}function Ro(n){return new bo(_o(n))}class bo{constructor(e){this.overlaysUpdater=e}addOverlays(e,t){this.overlaysUpdater.addOverlays(e,t)}removeAllOverlays(e){this.overlaysUpdater.removeAllOverlays(e)}}class Fo{element(e){return`svg > g > g > g[data-bpmn-id="${e}"]`}elementsOfKind(e){return`svg > g > g > g.${e}:not(.bpmn-label)`}}function Po(n){return new xo(n,new ko(n.getModel()))}const Et=n=>{const e=S(n);return e.concat(e.map(t=>He(t)))};class xo{constructor(e,t){this.graph=e,this.styleManager=t}clear(){this.styleManager.clear()}updateStyle(e,t){if(!t)return;const s=this.graph.getModel(),i=Et(e).map(o=>s.getCell(o)).filter(Boolean);i.length!=0&&this.graph.batchUpdate(()=>{for(const o of i){this.styleManager.ensureStyleIsStored(o);let r=o.getStyle();r=F(r,c.STYLE_OPACITY,t.opacity,ve),r=un(r,t.stroke),r=dn(r,t.font),Tn(t)&&(r=gn(r,t.fill)),s.setStyle(o,r)}})}resetStyle(e){this.graph.batchUpdate(()=>{if(!e)this.styleManager.resetAllStyles();else for(const t of Et(e))this.styleManager.resetStyleIfIsStored(t)})}}const St=I.EXTRA_CSS_CLASSES;class ko{constructor(e){g(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),i=hn(s.getStyle(),St,""),o=F(t,St,i);this.model.setStyle(s,o),this.stylesCache.delete(e)}ensureStyleIsStored(e){const t=e.getId();this.stylesCache.has(t)||this.stylesCache.set(t,e.getStyle())}}function Mo(n){return new Bo(Po(n))}class Bo{constructor(e){this.styleUpdater=e}clearCache(){this.styleUpdater.clear()}updateStyle(e,t){this.styleUpdater.updateStyle(e,t)}resetStyle(e){this.styleUpdater.resetStyle(e)}}function Go(n,e){return new Yo(n,new Vo(e.container,new Fo),vo(e),Ro(e),Mo(e))}class Yo{constructor(e,t,s,i,o){this.bpmnModelRegistry=e,this.htmlElementRegistry=t,this.cssClassesRegistry=s,this.overlaysRegistry=i,this.styleRegistry=o,this.bpmnModelRegistry.registerOnLoadCallback(()=>{this.cssClassesRegistry.clearCache(),this.styleRegistry.clearCache()})}getModelElementsByIds(e){return S(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 S(e).map(t=>this.htmlElementRegistry.getBpmnHtmlElements(t)).flat().map(t=>this.getRelatedBpmnSemantic(t))}getElementsByKinds(e){return S(e).map(t=>this.htmlElementRegistry.getBpmnHtmlElements(t)).flat().map(t=>({htmlElement:t,bpmnSemantic:this.getRelatedBpmnSemantic(t)}))}getRelatedBpmnSemantic(e){return this.bpmnModelRegistry.getBpmnSemantic(e.getAttribute("data-bpmn-id"))}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 Vo{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(Be(e));return[...this.container.querySelectorAll(t)]}}class Uo{filter(e,t){const s=[],i=[];if(S(t==null?void 0:t.pools).filter(T=>T&&Object.keys(T).length).forEach(T=>T.id?s.push(T.id):T.name&&i.push(T.name)),s.length==0&&i.length==0)return e;const{filteredPools:o,filteredPoolIds:r}=Wo(e,s,i),l=[...s,...r],{filteredLanes:a,filteredLaneIds:u,filteredFlowNodes:h,filteredFlowNodeIds:f}=Ut(e.lanes,e.flowNodes,l),p=Ho(e.edges,[...l,...u,...f]);if(o.length==0&&a.length==0&&h.length==0&&p.length==0){let T=s.length>0?` for ids [${s}]`:"";const m=T?" and":"";throw T+=i.length>0?`${m} for names [${i}]`:"",new Error("No matching pools"+T)}return{lanes:a,flowNodes:h,pools:o,edges:p}}}function Wo(n,e,t){const s=n.pools.filter(o=>e.includes(o.bpmnElement.id)||t.includes(o.bpmnElement.name)),i=s.map(o=>o.bpmnElement.id);return{filteredPools:s,filteredPoolIds:i}}function Ut(n,e,t){const{filteredLanes:s,filteredLaneIds:i}=Wt(n,t),{filteredLanes:o,filteredLaneIds:r,filteredFlowNodes:l,filteredFlowNodeIds:a}=Do(e,[...t,...i],n);return s.push(...o),i.push(...r),{filteredLanes:s,filteredLaneIds:i,filteredFlowNodes:l,filteredFlowNodeIds:a}}function Wt(n,e){const t=n.filter(i=>e.includes(i.bpmnElement.parentId)),s=t.map(i=>i.bpmnElement.id);if(t.length>0){const{filteredLanes:i,filteredLaneIds:o}=Wt(n,s);t.push(...i),s.push(...o)}return{filteredLanes:t,filteredLaneIds:s}}function Do(n,e,t){const s=n.filter(u=>e.includes(u.bpmnElement.parentId));if(s.length===0)return{filteredLanes:[],filteredLaneIds:[],filteredFlowNodes:[],filteredFlowNodeIds:[]};const i=s.map(u=>u.bpmnElement.id),{filteredLanes:o,filteredLaneIds:r,filteredFlowNodes:l,filteredFlowNodeIds:a}=Ut(t,n,i);return s.push(...l),i.push(...a),{filteredLanes:o,filteredLaneIds:r,filteredFlowNodes:s,filteredFlowNodeIds:i}}function Ho(n,e){return n.filter(t=>e.includes(t.bpmnElement.sourceRefId)&&e.includes(t.bpmnElement.targetRefId))}class Ko{constructor(){g(this,"searchableModel");g(this,"onLoadCallback")}load(e,t){var i;const s=new Uo().filter(e,t);return this.searchableModel=new Xo(s),(i=this.onLoadCallback)==null||i.call(this),zo(s)}registerOnLoadCallback(e){this.onLoadCallback=e}getBpmnSemantic(e){var r;const t=(r=this.searchableModel)==null?void 0:r.elementById(e);if(!t)return;const s=t.bpmnElement,i=s instanceof Y,o={id:e,name:s.name,isShape:i,kind:s.kind};return s instanceof Le?(o.sourceRefId=s.sourceRefId,o.targetRefId=s.targetRefId):(o.incomingIds=s.incomingIds,o.outgoingIds=s.outgoingIds),o}}function zo(n){const e=n.flowNodes.filter(o=>{const r=o.bpmnElement;return C.isSubProcess(r.kind)&&r.markers.includes(w.EXPAND)}).map(o=>o.bpmnElement.id),t=[],s=[],i=[];return n.flowNodes.forEach(o=>{const r=o.bpmnElement.kind;C.isSubProcess(r)?t.push(o):C.isBoundaryEvent(r)?s.push(o):e.includes(o.bpmnElement.parentId)||i.push(o)}),{boundaryEvents:s,edges:n.edges,lanes:n.lanes,otherFlowNodes:i,pools:n.pools,subprocesses:t}}class Xo{constructor(e){g(this,"elements",new Map);[].concat(e.pools,e.lanes,e.flowNodes,e.edges).forEach(t=>this.elements.set(t.bpmnElement.id,t))}elementById(e){return this.elements.get(e)}}function $o(n){return n instanceof HTMLElement?n:document.getElementById(n)}class jo{constructor(e){this.graph=e}fit(e){this.graph.customFit(e)}zoom(e){e=="in"?this.graph.zoomIn():this.graph.zoomOut()}}const Zo="0.39.0",qo=()=>({lib:Zo,dependencies:new Map([["mxGraph",Ct.VERSION]])});class Qo{constructor(e){g(this,"graph");g(this,"navigation");g(this,"bpmnElementsRegistry");g(this,"bpmnModelRegistry");g(this,"parserOptions");g(this,"rendererOptions");this.rendererOptions=e==null?void 0:e.renderer;const t=new _s($o(e==null?void 0:e.container));this.graph=t.configure(e),this.navigation=new jo(this.graph),this.bpmnModelRegistry=new Ko,this.bpmnElementsRegistry=Go(this.bpmnModelRegistry,this.graph),this.parserOptions=e==null?void 0:e.parser}load(e,t){const s=Ao(this.parserOptions).parse(e),i=this.bpmnModelRegistry.load(s,t==null?void 0:t.modelFilter);Fs(this.graph,this.rendererOptions).render(i,t==null?void 0:t.fit)}getVersion(){return qo()}}function mr(n){document.readyState==="complete"||document.readyState==="interactive"?setTimeout(n,1):document.addEventListener("DOMContentLoaded",n)}function A(n,...e){Ze("[DEMO]",n,...e)}function Ze(n,e,...t){console.info(n+" "+e,...t)}function P(n,...e){Ze("[DEMO STARTUP]",n,...e)}function Dt(n,e){Ht(n),window.alert(e??n)}function Ht(n){console.error("[DEMO]",n)}function J(n,...e){Ze("[DEMO DOWNLOAD]",n,...e)}function Jo(n){return A(`Fetching BPMN content from url ${n}`),fetch(n).then(e=>{if(!e.ok)throw Error(`HTTP status ${e.status}`);return e.text()})}class er{constructor(e,t,s,i){g(this,"document");g(this,"head");g(this,"body");this.window=e,this.outerContainerId=t,this.containerToFade=s,this.dropCallback=i,this.document=e.document,this.head=document.head,this.body=document.body,this.initializeDragAndDrop()}initializeDragAndDrop(){this.containerToFade.classList.add("faded-container"),this.addDomElements(this.containerToFade),this.addStyle();const e=document.getElementById(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){e.forEach(s=>t.addEventListener(s,this.preventDefaults,!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.appendChild(t);const i=this.document.createElement("div");i.id=this.outerContainerId,i.appendChild(s),e.parentNode.prepend(i)}addStyle(){const e=` +`):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}K.prototype.build=function(n){return this.options.preserveOrder?uo(n,this.options):(Array.isArray(n)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(n={[this.options.arrayNodeName]:n}),this.j2x(n,0).val)};K.prototype.j2x=function(n,e){let t="",s="";for(let i in n)if(typeof n[i]>"u")this.isAttribute(i)&&(s+="");else if(n[i]===null)this.isAttribute(i)?s+="":i[0]==="?"?s+=this.indentate(e)+"<"+i+"?"+this.tagEndChar:s+=this.indentate(e)+"<"+i+"/"+this.tagEndChar;else if(n[i]instanceof Date)s+=this.buildTextValNode(n[i],i,"",e);else if(typeof n[i]!="object"){const o=this.isAttribute(i);if(o)t+=this.buildAttrPairStr(o,""+n[i]);else if(i===this.options.textNodeName){let r=this.options.tagValueProcessor(i,""+n[i]);s+=this.replaceEntitiesValue(r)}else s+=this.buildTextValNode(n[i],i,"",e)}else if(Array.isArray(n[i])){const o=n[i].length;let r="";for(let l=0;l"u"||(a===null?i[0]==="?"?s+=this.indentate(e)+"<"+i+"?"+this.tagEndChar:s+=this.indentate(e)+"<"+i+"/"+this.tagEndChar:typeof a=="object"?this.options.oneListGroup?r+=this.j2x(a,e+1).val:r+=this.processTextOrObjNode(a,i,e):r+=this.buildTextValNode(a,i,"",e))}this.options.oneListGroup&&(r=this.buildObjectNode(r,i,"",e)),s+=r}else if(this.options.attributesGroupName&&i===this.options.attributesGroupName){const o=Object.keys(n[i]),r=o.length;for(let l=0;l"+n+i:this.options.commentPropName!==!1&&e===this.options.commentPropName&&o.length===0?this.indentate(s)+``+this.newLine:this.indentate(s)+"<"+e+t+o+this.tagEndChar+n+this.indentate(s)+i}};K.prototype.closeTag=function(n){let e="";return this.options.unpairedTags.indexOf(n)!==-1?this.options.suppressUnpairedNode||(e="/"):this.options.suppressEmptyNode?e="/":e=`>`+this.newLine;if(this.options.commentPropName!==!1&&e===this.options.commentPropName)return this.indentate(s)+``+this.newLine;if(e[0]==="?")return this.indentate(s)+"<"+e+t+"?"+this.tagEndChar;{let i=this.options.tagValueProcessor(e,n);return i=this.replaceEntitiesValue(i),i===""?this.indentate(s)+"<"+e+t+this.closeTag(e)+this.tagEndChar:this.indentate(s)+"<"+e+t+">"+i+"0&&this.options.processEntities)for(let e=0;e"},{regex:/&(lt|#60|#x3c|#x3C);/g,val:"<"},{regex:/&(quot|#34|#x22);/g,val:'"'}];class Ao{constructor(e){g(this,"x2jOptions",{attributeNamePrefix:"",removeNSPrefix:!0,ignoreAttributes:!1,parseAttributeValue:!0,processEntities:!1,attributeValueProcessor:(e,t)=>this.processAttribute(t)});g(this,"xmlParser",new Co.XMLParser(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 mo)e=e.replace(s.regex,s.val);return(t=this.options)!=null&&t.additionalXmlAttributeProcessor&&(e=this.options.additionalXmlAttributeProcessor(e)),e}}class Oo{constructor(e,t){this.jsonParser=e,this.xmlParser=t}parse(e){const t=this.xmlParser.parse(e);return this.jsonParser.parse(t)}}function No(n){return new Oo(ii(new Ms),new Ao(n))}function vo(n){return new Lo(n)}class Lo{constructor(e){this.graph=e}updateAndRefreshCssClassesOfCell(e,t){this.updateAndRefreshCssClassesOfElement(e,t),this.updateAndRefreshCssClassesOfElement(De(e),t)}updateAndRefreshCssClassesOfElement(e,t){const s=this.graph.getModel(),i=s.getCell(e);if(!i)return;let o=i.getStyle();o=F(o,I.EXTRA_CSS_CLASSES,t.join(",")),s.setStyle(i,o)}}function yo(n){return new _o(vo(n),new wo)}class _o{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)S(e).forEach(t=>{const s=this.cssClassesCache.removeAllClassNames(t);this.updateCellIfChanged(s,t)});else{const t=this.cssClassesCache.getBpmnIds();this.cssClassesCache.clear(),t.forEach(s=>this.updateCellIfChanged(!0,s))}}toggleCssClasses(e,t){this.updateCssClasses(e,t,this.cssClassesCache.toggleClassNames)}updateCssClasses(e,t,s){const i=S(t);S(e).forEach(o=>this.updateCellIfChanged(s(o,i),o))}updateCellIfChanged(e,t){if(e){const s=this.cssClassesCache.getClassNames(t);this.cssClassesUpdater.updateAndRefreshCssClassesOfCell(t,s)}}}class wo{constructor(){g(this,"classNamesByBpmnId",new Map);g(this,"clear",()=>{this.classNamesByBpmnId.clear()});g(this,"addClassNames",(e,t)=>this.updateClassNames(e,t,(s,i)=>s.add(i)));g(this,"removeClassNames",(e,t)=>this.updateClassNames(e,t,(s,i)=>s.delete(i)));g(this,"toggleClassNames",(e,t)=>(this.updateClassNames(e,t,(s,i)=>s.has(i)?s.delete(i):s.add(i)),t&&t.length>0))}getClassNames(e){return Array.from(this.classNamesByBpmnId.get(e)??[])}getBpmnIds(){return Array.from(this.classNamesByBpmnId.keys())}removeAllClassNames(e){const t=this.getOrInitializeClassNames(e),s=t.size;return t.clear(),t.sizes(i,r)),i.size!=o}getOrInitializeClassNames(e){let t=this.classNamesByBpmnId.get(e);return t==null&&(t=new Set,this.classNamesByBpmnId.set(e,t)),t}}class je{constructor(){g(this,"overlayPositions",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"}]]))}convert(e){const t=this.convertPosition(e),s=je.convertStyle(e);return{position:t,style:s}}convertPosition(e){return this.overlayPositions.get(e.position)}static convertStyle(e){const t={fill:{color:E.DEFAULT_OVERLAY_FILL_COLOR.valueOf(),opacity:E.DEFAULT_OVERLAY_FILL_OPACITY.valueOf()},stroke:{color:E.DEFAULT_OVERLAY_STROKE_COLOR.valueOf(),width:E.DEFAULT_OVERLAY_STROKE_WIDTH.valueOf()},font:{color:E.DEFAULT_OVERLAY_FONT_COLOR.valueOf(),size:E.DEFAULT_OVERLAY_FONT_SIZE.valueOf()}},s=e.style,i={...t};return s&&(this.convertFill(i,s.fill),this.convertStroke(i,s.stroke),this.convertFont(i,s.font)),i}static convertFill(e,t){t&&(e.fill.color=t.color??e.fill.color,e.fill.opacity=t.opacity??e.fill.opacity)}static convertStroke(e,t){t&&(e.stroke.color=t.color??e.stroke.color,e.stroke.width=t.width??e.stroke.width)}static convertFont(e,t){t&&(e.font.color=t.color??e.font.color,e.font.size=t.size??e.font.size)}}function Ro(n){return new bo(n,new je)}class bo{constructor(e,t){this.graph=e,this.overlayConverter=t}addOverlays(e,t){const s=this.graph.getModel().getCell(e);s&&S(t).forEach(i=>{const o=new Ft(i.label,this.overlayConverter.convert(i));this.graph.addCellOverlay(s,o)})}removeAllOverlays(e){const t=this.graph.getModel().getCell(e);t&&this.graph.removeCellOverlays(t)}}function Fo(n){return new Po(Ro(n))}class Po{constructor(e){this.overlaysUpdater=e}addOverlays(e,t){this.overlaysUpdater.addOverlays(e,t)}removeAllOverlays(e){this.overlaysUpdater.removeAllOverlays(e)}}class xo{element(e){return`svg > g > g > g[data-bpmn-id="${e}"]`}elementsOfKind(e){return`svg > g > g > g.${e}:not(.bpmn-label)`}}function ko(n){return new Mo(n,new Bo(n.getModel()))}const Et=n=>{const e=S(n);return e.concat(e.map(t=>De(t)))};class Mo{constructor(e,t){this.graph=e,this.styleManager=t}clear(){this.styleManager.clear()}updateStyle(e,t){if(!t)return;const s=this.graph.getModel(),i=Et(e).map(o=>s.getCell(o)).filter(Boolean);i.length!=0&&this.graph.batchUpdate(()=>{for(const o of i){this.styleManager.ensureStyleIsStored(o);let r=o.getStyle();r=F(r,c.STYLE_OPACITY,t.opacity,ye),r=hn(r,t.stroke),r=fn(r,t.font),En(t)&&(r=pn(r,t.fill)),s.setStyle(o,r)}})}resetStyle(e){this.graph.batchUpdate(()=>{if(!e)this.styleManager.resetAllStyles();else for(const t of Et(e))this.styleManager.resetStyleIfIsStored(t)})}}const St=I.EXTRA_CSS_CLASSES;class Bo{constructor(e){g(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),i=gn(s.getStyle(),St,""),o=F(t,St,i);this.model.setStyle(s,o),this.stylesCache.delete(e)}ensureStyleIsStored(e){const t=e.getId();this.stylesCache.has(t)||this.stylesCache.set(t,e.getStyle())}}function Go(n){return new Yo(ko(n))}class Yo{constructor(e){this.styleUpdater=e}clearCache(){this.styleUpdater.clear()}updateStyle(e,t){this.styleUpdater.updateStyle(e,t)}resetStyle(e){this.styleUpdater.resetStyle(e)}}function Vo(n,e){return new Uo(n,new Wo(e.container,new xo),yo(e),Fo(e),Go(e))}class Uo{constructor(e,t,s,i,o){this.bpmnModelRegistry=e,this.htmlElementRegistry=t,this.cssClassesRegistry=s,this.overlaysRegistry=i,this.styleRegistry=o,this.bpmnModelRegistry.registerOnLoadCallback(()=>{this.cssClassesRegistry.clearCache(),this.styleRegistry.clearCache()})}getModelElementsByIds(e){return S(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 S(e).map(t=>this.htmlElementRegistry.getBpmnHtmlElements(t)).flat().map(t=>this.getRelatedBpmnSemantic(t))}getElementsByKinds(e){return S(e).map(t=>this.htmlElementRegistry.getBpmnHtmlElements(t)).flat().map(t=>({htmlElement:t,bpmnSemantic:this.getRelatedBpmnSemantic(t)}))}getRelatedBpmnSemantic(e){return this.bpmnModelRegistry.getBpmnSemantic(e.getAttribute("data-bpmn-id"))}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 Wo{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(Be(e));return[...this.container.querySelectorAll(t)]}}class Do{filter(e,t){const s=[],i=[];if(S(t==null?void 0:t.pools).filter(T=>T&&Object.keys(T).length).forEach(T=>T.id?s.push(T.id):T.name&&i.push(T.name)),s.length==0&&i.length==0)return e;const{filteredPools:o,filteredPoolIds:r}=Ho(e,s,i),l=[...s,...r],{filteredLanes:a,filteredLaneIds:u,filteredFlowNodes:h,filteredFlowNodeIds:f}=Ut(e.lanes,e.flowNodes,l),p=zo(e.edges,[...l,...u,...f]);if(o.length==0&&a.length==0&&h.length==0&&p.length==0){let T=s.length>0?` for ids [${s}]`:"";const m=T?" and":"";throw T+=i.length>0?`${m} for names [${i}]`:"",new Error("No matching pools"+T)}return{lanes:a,flowNodes:h,pools:o,edges:p}}}function Ho(n,e,t){const s=n.pools.filter(o=>e.includes(o.bpmnElement.id)||t.includes(o.bpmnElement.name)),i=s.map(o=>o.bpmnElement.id);return{filteredPools:s,filteredPoolIds:i}}function Ut(n,e,t){const{filteredLanes:s,filteredLaneIds:i}=Wt(n,t),{filteredLanes:o,filteredLaneIds:r,filteredFlowNodes:l,filteredFlowNodeIds:a}=Ko(e,[...t,...i],n);return s.push(...o),i.push(...r),{filteredLanes:s,filteredLaneIds:i,filteredFlowNodes:l,filteredFlowNodeIds:a}}function Wt(n,e){const t=n.filter(i=>e.includes(i.bpmnElement.parentId)),s=t.map(i=>i.bpmnElement.id);if(t.length>0){const{filteredLanes:i,filteredLaneIds:o}=Wt(n,s);t.push(...i),s.push(...o)}return{filteredLanes:t,filteredLaneIds:s}}function Ko(n,e,t){const s=n.filter(u=>e.includes(u.bpmnElement.parentId));if(s.length===0)return{filteredLanes:[],filteredLaneIds:[],filteredFlowNodes:[],filteredFlowNodeIds:[]};const i=s.map(u=>u.bpmnElement.id),{filteredLanes:o,filteredLaneIds:r,filteredFlowNodes:l,filteredFlowNodeIds:a}=Ut(t,n,i);return s.push(...l),i.push(...a),{filteredLanes:o,filteredLaneIds:r,filteredFlowNodes:s,filteredFlowNodeIds:i}}function zo(n,e){return n.filter(t=>e.includes(t.bpmnElement.sourceRefId)&&e.includes(t.bpmnElement.targetRefId))}class Xo{constructor(){g(this,"searchableModel");g(this,"onLoadCallback")}load(e,t){var i;const s=new Do().filter(e,t);return this.searchableModel=new jo(s),(i=this.onLoadCallback)==null||i.call(this),$o(s)}registerOnLoadCallback(e){this.onLoadCallback=e}getBpmnSemantic(e){var r;const t=(r=this.searchableModel)==null?void 0:r.elementById(e);if(!t)return;const s=t.bpmnElement,i=s instanceof Y,o={id:e,name:s.name,isShape:i,kind:s.kind};return s instanceof ve?(o.sourceRefId=s.sourceRefId,o.targetRefId=s.targetRefId):(o.incomingIds=s.incomingIds,o.outgoingIds=s.outgoingIds),o}}function $o(n){const e=n.flowNodes.filter(o=>{const r=o.bpmnElement;return C.isSubProcess(r.kind)&&r.markers.includes(w.EXPAND)}).map(o=>o.bpmnElement.id),t=[],s=[],i=[];return n.flowNodes.forEach(o=>{const r=o.bpmnElement.kind;C.isSubProcess(r)?t.push(o):C.isBoundaryEvent(r)?s.push(o):e.includes(o.bpmnElement.parentId)||i.push(o)}),{boundaryEvents:s,edges:n.edges,lanes:n.lanes,otherFlowNodes:i,pools:n.pools,subprocesses:t}}class jo{constructor(e){g(this,"elements",new Map);[].concat(e.pools,e.lanes,e.flowNodes,e.edges).forEach(t=>this.elements.set(t.bpmnElement.id,t))}elementById(e){return this.elements.get(e)}}const Zo="0.40.0",qo=()=>({lib:Zo,dependencies:new Map([["mxGraph",Ot.VERSION]])});class Qo{constructor(e){g(this,"graph");g(this,"navigation");g(this,"bpmnElementsRegistry");g(this,"bpmnModelRegistry");g(this,"parserOptions");g(this,"rendererOptions");this.rendererOptions=e==null?void 0:e.renderer;const t=new Ps(nn(e==null?void 0:e.container));this.graph=t.configure(e),this.navigation=new xs(this.graph),this.bpmnModelRegistry=new Xo,this.bpmnElementsRegistry=Vo(this.bpmnModelRegistry,this.graph),this.parserOptions=e==null?void 0:e.parser}load(e,t){const s=No(this.parserOptions).parse(e),i=this.bpmnModelRegistry.load(s,t==null?void 0:t.modelFilter);mn(this.graph,this.rendererOptions).render(i,t==null?void 0:t.fit)}getVersion(){return qo()}}function mr(n){document.readyState==="complete"||document.readyState==="interactive"?setTimeout(n,1):document.addEventListener("DOMContentLoaded",n)}function A(n,...e){Ze("[DEMO]",n,...e)}function Ze(n,e,...t){console.info(`${n} ${e}`,...t)}function P(n,...e){Ze("[DEMO STARTUP]",n,...e)}function Dt(n,e){Ht(n),window.alert(e??n)}function Ht(n){console.error("[DEMO]",n)}function J(n,...e){Ze("[DEMO DOWNLOAD]",n,...e)}async function Jo(n){A(`Fetching BPMN content from url ${n}`);const e=await fetch(n);if(!e.ok)throw Error(`HTTP status ${e.status}`);return await e.text()}function Kt(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.appendChild(s),s.click(),document.body.removeChild(s)}function er(n){J("Start SVG download"),Kt("diagram.svg","data:image/svg+xml",n),J("Download completed")}function tr(n){J("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.appendChild(s);const i=document.createElement("canvas"),o=i.getContext("2d");s.onload=function(){const r=new Image;i.width=s.naturalWidth,i.height=s.naturalHeight,r.crossOrigin="Anonymous",r.onload=function(){o.drawImage(r,0,0),URL.revokeObjectURL(t);const l=i.toDataURL("image/png");document.body.removeChild(s),Kt("diagram.png","",l),J("Download completed")},r.src=s.src},s.src=t}class nr{constructor(e,t,s,i){g(this,"document");g(this,"head");g(this,"body");this.window=e,this.outerContainerId=t,this.containerToFade=s,this.dropCallback=i,this.document=e.document,this.head=document.head,this.body=document.body,this.initializeDragAndDrop()}initializeDragAndDrop(){this.containerToFade.classList.add("faded-container"),this.addDomElements(this.containerToFade),this.addStyle();const e=document.getElementById(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){e.forEach(s=>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.appendChild(t);const i=this.document.createElement("div");i.id=this.outerContainerId,i.appendChild(s),e.parentNode.prepend(i)}addStyle(){const e=` .faded-container { opacity: 1; } @@ -47,7 +47,7 @@ var Qt=Object.defineProperty;var Jt=(n,e,t)=>e in n?Qt(n,e,{enumerable:!0,config align-items: center; border: 2px dashed rgba(0,0,0,.2); border-radius: 7px; -}`,t=document.createElement("style");t.appendChild(document.createTextNode(e)),this.head.appendChild(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,i){return function(o){try{const l=o.dataTransfer.files;s(l[0])}catch(r){Dt(r)}finally{t?this.querySelector("#"+i).classList.remove("dragging"):this.classList.remove("dragging"),e.classList.remove("faded")}}}}class Kt{constructor(e){this.graph=e}exportSvg(){return this.doSvgExport(!0)}exportSvgForPng(){const e=Ct.IS_FF;return this.doSvgExport(e)}doSvgExport(e){const t=this.computeSvg({scale:1,border:25,enableForeignObjectForLabel:e});return` +}`,t=document.createElement("style");t.appendChild(document.createTextNode(e)),this.head.appendChild(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,i){return function(o){try{const l=o.dataTransfer.files;s(l[0])}catch(r){const l=r instanceof Error?r.message:String(r);Dt(l)}finally{t?this.querySelector("#"+i).classList.remove("dragging"):this.classList.remove("dragging"),e.classList.remove("faded")}}}}class zt{constructor(e){this.graph=e}exportSvg(){return this.doSvgExport(!0)}exportSvgForPng(){const e=Ot.IS_FF;return this.doSvgExport(e)}doSvgExport(e){const t=this.computeSvg({scale:1,border:25,enableForeignObjectForLabel:e});return` ${O.getXml(t)} -`}computeSvg(e){const t=e.scale??1,s=e.border??0,i=e.crisp??!0,o=e.enableForeignObjectForLabel??!0,r=this.graph.getGraphBounds(),l=this.graph.view.scale,a=O.createXmlDocument(),u=a.createElementNS(c.NS_SVG,"svg"),h=t/l,f=Math.max(1,Math.ceil(r.width*h)+2*s),p=Math.max(1,Math.ceil(r.height*h)+2*s);u.setAttribute("version","1.1"),u.setAttribute("width",f+"px"),u.setAttribute("height",p+"px"),u.setAttribute("viewBox",(i?"-0.5 -0.5":"0 0")+" "+f+" "+p),a.appendChild(u);const T=a.createElementNS(c.NS_SVG,"g");u.appendChild(T);const m=this.createSvgCanvas(T);m.foEnabled=o,m.foOffset=i?-.5:0,m.textOffset=i?-.5:0,m.imageOffset=i?-.5:0,m.translate(Math.floor((s/t-r.x)/l),Math.floor((s/t-r.y)/l)),m.scale(h);const M=new L.mxImageExport;return M.includeOverlays=!0,M.drawState(this.graph.getView().getState(this.graph.model.root),m),a}createSvgCanvas(e){const t=new tr(e);return t.pointerEvents=!0,t}}class tr extends ue{constructor(t){super(t);g(this,"htmlConverter",document.createElement("div"))}getAlternateText(t,s,i,o,r,l,a,u,h,f,p,T,m){return this.computeTruncatedText(l,o)}plainText(t,s,i,o,r,l,a,u,h,f,p,T){r=this.computeTruncatedText(r,i),super.plainText(t,s,i,o,r,l,a,u,h,f,p,T)}computeTruncatedText(t,s){if(t==null||this.state.fontSize<=0)return"";try{this.htmlConverter.innerHTML=t,t=O.extractTextWithWhitespace(this.htmlConverter.childNodes);const i=Math.ceil(2*s/this.state.fontSize),o=[];let r=0,l=0;for(;(i==0||r0)break}else o.push(t.charAt(l)),a<255&&r++;l++}o.length1&&(t=O.trim(o.join(""))+"...")}catch(i){console.warn("Error while computing txt label",i)}return t}}function zt(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.appendChild(s),s.click(),document.body.removeChild(s)}function nr(n){J("Start SVG download"),zt("diagram.svg","data:image/svg+xml",n),J("Download completed")}function sr(n){J("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.appendChild(s);const i=document.createElement("canvas"),o=i.getContext("2d");s.onload=function(){const r=new Image;i.width=s.naturalWidth,i.height=s.naturalHeight,r.crossOrigin="Anonymous",r.onload=function(){o.drawImage(r,0,0),URL.revokeObjectURL(t);const l=i.toDataURL("image/png");document.body.removeChild(s),zt("diagram.png","",l),J("Download completed")},r.src=s.src},s.src=t}const ir=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 or extends Qo{configureTheme(e){if(e=="default")return new Ot(this.graph).configureStyles(),!0;const t=ir.get(e);if(!t)return!1;const s=this.graph.getStylesheet();C.eventKinds().forEach(h=>{let f,p;switch(h){case"endEvent":f=t.endEventFillColor,p=t.endEventStrokeColor;break;case"startEvent":f=t.startEventFillColor,p=t.startEventStrokeColor;break;case"intermediateCatchEvent":case"intermediateThrowEvent":case"boundaryEvent":f=t.defaultFillColor,p=t.catchAndThrowEventStrokeColor??t.defaultStrokeColor;break;default:f=t.defaultFillColor,p=t.defaultStrokeColor;break}const T=s.styles[h];T.fillColor=f,T.strokeColor=p}),C.taskKinds().forEach(h=>{const f=s.styles[h];f.fillColor=t.taskAndCallActivityFillColor});const i=s.styles[d.CALL_ACTIVITY];i.fillColor=t.taskAndCallActivityFillColor;const o=s.styles[d.TEXT_ANNOTATION];o.fillColor=t.textAnnotationFillColor??E.TEXT_ANNOTATION_FILL_COLOR;const r=s.styles[d.POOL];r.fillColor=t.poolFillColor,r.swimlaneFillColor=t.defaultFillColor;const l=s.styles[d.LANE];l.fillColor=t.laneFillColor;const a=s.getDefaultVertexStyle();a.fontColor=t.defaultFontColor,a.fillColor=t.defaultFillColor,a.strokeColor=t.defaultStrokeColor;const u=s.getDefaultEdgeStyle();return u.fontColor=t.defaultFontColor,u.fillColor=t.defaultFillColor,u.strokeColor=t.flowColor??t.defaultStrokeColor,!0}configureSequenceFlowColor(e){P(`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,P("Sequence flows style updated")}}let N,D={},qe,Qe,Ne,B;function Ar(n){A("Updating load options"),D.fit=n,A("Load options updated",D)}function Or(){return{...D}}function Nr(){return Ne}function vr(n){A("Switching theme from %s to %s",Ne,n),N.configureTheme(n)?(N.graph.refresh(),A("Theme switch done"),Ne=n):A("Unknown theme, do nothing")}function Xt(n,e=!0){A("Loading bpmn...");try{N.load(n,D),A("BPMN loaded with configuration",D),lr(Qe),document.dispatchEvent(new CustomEvent("diagramLoaded"))}catch(t){if(e)qe(`Cannot load the BPMN diagram: ${t.message}`);else throw t}}function Lr(n){A("Fitting..."),N.navigation.fit(n),A("Fit done with configuration",n)}function yr(n){A(`Zooming '${n}'...`),N.navigation.zoom(n),A("Zoom done")}function _r(n){return N.bpmnElementsRegistry.getModelElementsByKinds(n)}function rr(n){return N.bpmnElementsRegistry.getModelElementsByIds(n)}function $t(n){const e=N.graph.model,t=e.getCell(n);return e.getParent(t)}function wr(n){return n.map(e=>$t(e).getId()).filter((e,t,s)=>s.indexOf(e)===t)}function Rr(n){var s;const e=$t(n),t=rr(e.getId());return t&&((s=t[0])==null?void 0:s.kind)===d.SUB_PROCESS}function br(n,e){return N.bpmnElementsRegistry.addCssClasses(n,e)}function Fr(n,e){return N.bpmnElementsRegistry.removeCssClasses(n,e)}function Pr(n,e){return N.bpmnElementsRegistry.addOverlays(n,[e])}function xr(n){return N.bpmnElementsRegistry.removeAllOverlays(n)}function lr(n){if(!Qe)return;A("Updating model, bpmnElement to collapse:",n);const e=N.graph.getModel(),t=e.getCell(n);if(!t)A("Element not found in the model, do nothing");else{e.beginUpdate();try{e.setCollapsed(t,!0)}finally{e.endUpdate()}A("Model updated")}}function jt(n){const e=new FileReader;e.onload=()=>{Xt(e.result)},e.readAsText(n)}function kr(n){const e=n.target.files[0];jt(e)}function ar(n){Jo(n).catch(e=>{throw new Error(`Unable to fetch ${n}. ${e}`)}).then(e=>(A("BPMN content fetched"),e)).then(e=>{Xt(e,!1),A(`BPMN content loaded from url ${n}`)}).then(()=>{Tr()}).catch(e=>{qe(e.message)})}function Mr(n){Dt(n)}function cr(n){Ht(n)}function ur(n,e){var o;const t=((o=n.loadOptions)==null?void 0:o.fit)??{},s=e.get("fitTypeOnLoad");s&&(t.type=s);const i=e.get("fitMargin");return i&&(t.margin=Number(i)),t}function dr(n){if(n.get("style.container.alternative.background.color")=="true"){const o="yellow";P("Use alternative color for the bpmn container background, color",o);const r=N.graph.container;r.style.backgroundColor=o,P("Bpmn container style updated")}const t=n.get("style.theme");P(`Configuring the '${t}' BPMN theme`),N.configureTheme(t)?(Ne=t,P(`'${t}' BPMN theme configured`)):P(`Unknown '${t}' BPMN theme, skipping configuration`),n.get("style.seqFlow.light.colors")=="true"&&N.configureSequenceFlowColor("#E9E9E9"),P('Configuring the "Update Style" API from query parameters'),Array.from(n.keys()).filter(o=>o.startsWith("style.api.")).length>0?(B={stroke:{},font:{},fill:{}},n.get("style.api.stroke.color")&&(B.stroke.color=n.get("style.api.stroke.color")),n.get("style.api.font.color")&&(B.font.color=n.get("style.api.font.color")),n.get("style.api.font.opacity")&&(B.font.opacity=Number(n.get("style.api.font.opacity"))),n.get("style.api.fill.color")?B.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")&&(B.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")&&(B.fill.opacity=Number(n.get("style.api.fill.opacity"))),P('Prepared "Update Style" API object',B)):P('No query parameters, do not set the "Update Style" API object')}function hr(n){Qe=n.get("bpmn.element.id.collapsed")}function fr(n){const e=n.get("bpmn.filter.pool.ids");if(!e)return;const t=e.split(",");return A("Configuring load options to only include pool id: ",t),{pools:t.map(s=>({id:s}))}}function Br(n){const e=P;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 o=s==="true";e('Ignore support for "BPMN in Color"?',o),!n.globalOptions.renderer&&(n.globalOptions.renderer={}),n.globalOptions.renderer.ignoreBpmnColors=o}N=new or(n.globalOptions),e("Initialization completed"),new er(window,"drop-container",N.graph.container,jt),e("Drag&Drop support initialized"),qe=n.statusKoNotifier??cr,e("Configuring Load Options"),D=n.loadOptions??{},D.fit=ur(n,t),D.modelFilter=fr(t),dr(t),hr(t),e("Checking if an 'url to fetch BPMN content' is provided as query parameter");const i=t.get("url");if(i){const o=decodeURIComponent(i);ar(o);return}e("No 'url to fetch BPMN content' provided")}function Gr(){J("Trigger SVG Download"),nr(new Kt(N.graph).exportSvg())}function Yr(){J("Trigger PNG Download"),sr(new Kt(N.graph).exportSvgForPng())}function Vr(){const n=N.getVersion();return A("Version:",n),n}function gr(n,e){A("Applying style using the style API: %O",e),N.bpmnElementsRegistry.updateStyle(n,e),A("New style applied on: %O",n)}function Ur(n){A("Resetting styles using the style API!"),N.bpmnElementsRegistry.resetStyle(n),A("Styles reset")}function Tr(){if(B){const n=pr();A("Number of elements whose style is to be updated",n.length),gr(n,B)}}function pr(){A("Retrieving ids of all BPMN elements");const n=[...Object.values(d),...Object.values(k)],e=N.bpmnElementsRegistry.getModelElementsByKinds(n).map(t=>t.id);return A("All BPMN elements ids retrieved:",e.length),e}export{le as F,d as S,tn as Z,vr as a,Vr as b,Nr as c,mr as d,xr as e,Lr as f,Or as g,kr as h,br as i,Gr as j,Yr as k,A as l,Rr as m,_r as n,gr as o,C as p,wr as q,Fr as r,Br as s,Ur as t,Ar as u,Vn as v,Mr as w,Pr as x,yr as z}; +`}computeSvg(e){const t=e.scale??1,s=e.border??0,i=e.crisp??!0,o=e.enableForeignObjectForLabel??!0,r=this.graph.getGraphBounds(),l=this.graph.view.scale,a=O.createXmlDocument(),u=a.createElementNS(c.NS_SVG,"svg"),h=t/l,f=Math.max(1,Math.ceil(r.width*h)+2*s),p=Math.max(1,Math.ceil(r.height*h)+2*s);u.setAttribute("version","1.1"),u.setAttribute("width",f+"px"),u.setAttribute("height",p+"px"),u.setAttribute("viewBox",(i?"-0.5 -0.5":"0 0")+" "+f+" "+p),a.appendChild(u);const T=a.createElementNS(c.NS_SVG,"g");u.appendChild(T);const m=this.createSvgCanvas(T);m.foEnabled=o,m.foOffset=i?-.5:0,m.textOffset=i?-.5:0,m.imageOffset=i?-.5:0,m.translate(Math.floor((s/t-r.x)/l),Math.floor((s/t-r.y)/l)),m.scale(h);const M=new L.mxImageExport;return M.includeOverlays=!0,M.drawState(this.graph.getView().getState(this.graph.model.root),m),a}createSvgCanvas(e){const t=new sr(e);return t.pointerEvents=!0,t}}class sr extends ue{constructor(t){super(t);g(this,"htmlConverter",document.createElement("div"))}getAlternateText(t,s,i,o,r,l,a,u,h,f,p,T,m){return this.computeTruncatedText(l,o)}plainText(t,s,i,o,r,l,a,u,h,f,p,T){r=this.computeTruncatedText(r,i),super.plainText(t,s,i,o,r,l,a,u,h,f,p,T)}computeTruncatedText(t,s){if(t==null||this.state.fontSize<=0)return"";try{this.htmlConverter.innerHTML=t,t=O.extractTextWithWhitespace(this.htmlConverter.childNodes);const i=Math.ceil(2*s/this.state.fontSize),o=[];let r=0,l=0;for(;(i==0||r0)break}else o.push(t.charAt(l)),a<255&&r++;l++}o.length1&&(t=O.trim(o.join(""))+"...")}catch(i){console.warn("Error while computing txt label",i)}return t}}const ir=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 or extends Qo{configureTheme(e){if(e=="default")return new xt(this.graph).configureStyles(),!0;const t=ir.get(e);if(!t)return!1;const s=this.graph.getStylesheet();C.eventKinds().forEach(h=>{let f,p;switch(h){case"endEvent":f=t.endEventFillColor,p=t.endEventStrokeColor;break;case"startEvent":f=t.startEventFillColor,p=t.startEventStrokeColor;break;case"intermediateCatchEvent":case"intermediateThrowEvent":case"boundaryEvent":f=t.defaultFillColor,p=t.catchAndThrowEventStrokeColor??t.defaultStrokeColor;break;default:f=t.defaultFillColor,p=t.defaultStrokeColor;break}const T=s.styles[h];T.fillColor=f,T.strokeColor=p}),C.taskKinds().forEach(h=>{const f=s.styles[h];f.fillColor=t.taskAndCallActivityFillColor});const i=s.styles[d.CALL_ACTIVITY];i.fillColor=t.taskAndCallActivityFillColor;const o=s.styles[d.TEXT_ANNOTATION];o.fillColor=t.textAnnotationFillColor??E.TEXT_ANNOTATION_FILL_COLOR;const r=s.styles[d.POOL];r.fillColor=t.poolFillColor,r.swimlaneFillColor=t.defaultFillColor;const l=s.styles[d.LANE];l.fillColor=t.laneFillColor;const a=s.getDefaultVertexStyle();a.fontColor=t.defaultFontColor,a.fillColor=t.defaultFillColor,a.strokeColor=t.defaultStrokeColor;const u=s.getDefaultEdgeStyle();return u.fontColor=t.defaultFontColor,u.fillColor=t.defaultFillColor,u.strokeColor=t.flowColor??t.defaultStrokeColor,!0}configureSequenceFlowColor(e){P(`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,P("Sequence flows style updated")}}let N,D={},qe,Qe,Ne,B;function Ar(n){A("Updating load options"),D.fit=n,A("Load options updated",D)}function Or(){return{...D}}function Nr(){return Ne}function vr(n){A("Switching theme from %s to %s",Ne,n),N.configureTheme(n)?(N.graph.refresh(),A("Theme switch done"),Ne=n):A("Unknown theme, do nothing")}function Xt(n,e=!0){A("Loading bpmn...");try{N.load(n,D),A("BPMN loaded with configuration",D),lr(Qe),document.dispatchEvent(new CustomEvent("diagramLoaded"))}catch(t){if(e)qe(`Cannot load the BPMN diagram: ${t instanceof Error?t.message:String(t)}`);else throw t}}function Lr(n){A("Fitting..."),N.navigation.fit(n),A("Fit done with configuration",n)}function yr(n){A(`Zooming '${n}'...`),N.navigation.zoom(n),A("Zoom done")}function _r(n){return N.bpmnElementsRegistry.getModelElementsByKinds(n)}function rr(n){return N.bpmnElementsRegistry.getModelElementsByIds(n)}function $t(n){const e=N.graph.model,t=e.getCell(n);return e.getParent(t)}function wr(n){return n.map(e=>$t(e).getId()).filter((e,t,s)=>s.indexOf(e)===t)}function Rr(n){var s;const e=$t(n),t=rr(e.getId());return t&&((s=t[0])==null?void 0:s.kind)===d.SUB_PROCESS}function br(n,e){return N.bpmnElementsRegistry.addCssClasses(n,e)}function Fr(n,e){return N.bpmnElementsRegistry.removeCssClasses(n,e)}function Pr(n,e){return N.bpmnElementsRegistry.addOverlays(n,[e])}function xr(n){return N.bpmnElementsRegistry.removeAllOverlays(n)}function lr(n){if(!Qe)return;A("Updating model, bpmnElement to collapse:",n);const e=N.graph.getModel(),t=e.getCell(n);if(!t)A("Element not found in the model, do nothing");else{e.beginUpdate();try{e.setCollapsed(t,!0)}finally{e.endUpdate()}A("Model updated")}}function jt(n){const e=new FileReader;e.onload=()=>{Xt(e.result)},e.readAsText(n)}function kr(n){const e=n.target.files;if(e&&e.length>0){const t=e[0];jt(t)}}function ar(n){Jo(n).catch(e=>{throw new Error(`Unable to fetch ${n}. ${e}`)}).then(e=>(A("BPMN content fetched"),e)).then(e=>{Xt(e,!1),A(`BPMN content loaded from url ${n}`)}).then(()=>{Tr()}).catch(e=>{qe(e.message)})}function Mr(n){Dt(n)}function cr(n){Ht(n)}function ur(n,e){var o;const t=((o=n.loadOptions)==null?void 0:o.fit)??{},s=e.get("fitTypeOnLoad");s&&(t.type=s);const i=e.get("fitMargin");return i&&(t.margin=Number(i)),t}function dr(n){if(n.get("style.container.alternative.background.color")=="true"){const o="yellow";P("Use alternative color for the bpmn container background, color",o);const r=N.graph.container;r.style.backgroundColor=o,P("Bpmn container style updated")}const t=n.get("style.theme");P(`Configuring the '${t}' BPMN theme`),N.configureTheme(t)?(Ne=t,P(`'${t}' BPMN theme configured`)):P(`Unknown '${t}' BPMN theme, skipping configuration`),n.get("style.seqFlow.light.colors")=="true"&&N.configureSequenceFlowColor("#E9E9E9"),P('Configuring the "Update Style" API from query parameters'),Array.from(n.keys()).filter(o=>o.startsWith("style.api.")).length>0?(B={stroke:{},font:{},fill:{}},n.get("style.api.stroke.color")&&(B.stroke.color=n.get("style.api.stroke.color")),n.get("style.api.font.color")&&(B.font.color=n.get("style.api.font.color")),n.get("style.api.font.opacity")&&(B.font.opacity=Number(n.get("style.api.font.opacity"))),n.get("style.api.fill.color")?B.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")&&(B.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")&&(B.fill.opacity=Number(n.get("style.api.fill.opacity"))),P('Prepared "Update Style" API object',B)):P('No query parameters, do not set the "Update Style" API object')}function hr(n){Qe=n.get("bpmn.element.id.collapsed")}function fr(n){const e=n.get("bpmn.filter.pool.ids");if(!e)return;const t=e.split(",");return A("Configuring load options to only include pool id: ",t),{pools:t.map(s=>({id:s}))}}function Br(n){const e=P;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 o=s==="true";e('Ignore support for "BPMN in Color"?',o),!n.globalOptions.renderer&&(n.globalOptions.renderer={}),n.globalOptions.renderer.ignoreBpmnColors=o}N=new or(n.globalOptions),e("Initialization completed"),new nr(window,"drop-container",N.graph.container,jt),e("Drag&Drop support initialized"),qe=n.statusKoNotifier??cr,e("Configuring Load Options"),D=n.loadOptions??{},D.fit=ur(n,t),D.modelFilter=fr(t),dr(t),hr(t),e("Checking if an 'url to fetch BPMN content' is provided as query parameter");const i=t.get("url");if(i){const o=decodeURIComponent(i);ar(o);return}e("No 'url to fetch BPMN content' provided")}function Gr(){J("Trigger SVG Download"),er(new zt(N.graph).exportSvg())}function Yr(){J("Trigger PNG Download"),tr(new zt(N.graph).exportSvgForPng())}function Vr(){const n=N.getVersion();return A("Version:",n),n}function gr(n,e){A("Applying style using the style API: %O",e),N.bpmnElementsRegistry.updateStyle(n,e),A("New style applied on: %O",n)}function Ur(n){A("Resetting styles using the style API!"),N.bpmnElementsRegistry.resetStyle(n),A("Styles reset")}function Tr(){if(B){const n=pr();A("Number of elements whose style is to be updated",n.length),gr(n,B)}}function pr(){A("Retrieving ids of all BPMN elements");const n=[...Object.values(d),...Object.values(k)],e=N.bpmnElementsRegistry.getModelElementsByKinds(n).map(t=>t.id);return A("All BPMN elements ids retrieved:",e.length),e}export{le as F,d as S,tn as Z,vr as a,Vr as b,Nr as c,mr as d,xr as e,Lr as f,Or as g,kr as h,br as i,Gr as j,Yr as k,A as l,Rr as m,_r as n,gr as o,C as p,wr as q,Fr as r,Br as s,Ur as t,Ar as u,is as v,Mr as w,Pr as x,yr as z}; diff --git a/demo/monitoring-all-process-instances/index.html b/demo/monitoring-all-process-instances/index.html index c93a4d00..b1d34d79 100644 --- a/demo/monitoring-all-process-instances/index.html +++ b/demo/monitoring-all-process-instances/index.html @@ -24,7 +24,7 @@ - + diff --git a/demo/prediction/index.html b/demo/prediction/index.html index 2ddc9037..97cc97c3 100644 --- a/demo/prediction/index.html +++ b/demo/prediction/index.html @@ -30,7 +30,7 @@ - + diff --git a/examples/custom-behavior/apply-css-classes/index.html b/examples/custom-behavior/apply-css-classes/index.html index a141aa64..41785082 100644 --- a/examples/custom-behavior/apply-css-classes/index.html +++ b/examples/custom-behavior/apply-css-classes/index.html @@ -86,7 +86,7 @@ } - + diff --git a/examples/custom-behavior/call-activity-with-modal-on-mouse-over/index.html b/examples/custom-behavior/call-activity-with-modal-on-mouse-over/index.html index 795e5ee2..8a699894 100644 --- a/examples/custom-behavior/call-activity-with-modal-on-mouse-over/index.html +++ b/examples/custom-behavior/call-activity-with-modal-on-mouse-over/index.html @@ -34,7 +34,7 @@ - + diff --git a/examples/custom-behavior/call-activity-with-reload-on-dblclick/index.html b/examples/custom-behavior/call-activity-with-reload-on-dblclick/index.html index eafdcfe4..7321e81a 100644 --- a/examples/custom-behavior/call-activity-with-reload-on-dblclick/index.html +++ b/examples/custom-behavior/call-activity-with-reload-on-dblclick/index.html @@ -36,7 +36,7 @@ - + diff --git a/examples/custom-behavior/call-activity-with-tabs-on-click/index.html b/examples/custom-behavior/call-activity-with-tabs-on-click/index.html index 080216e8..d04cff3b 100644 --- a/examples/custom-behavior/call-activity-with-tabs-on-click/index.html +++ b/examples/custom-behavior/call-activity-with-tabs-on-click/index.html @@ -36,7 +36,7 @@ - + diff --git a/examples/custom-behavior/growing-sequence-flow/index.html b/examples/custom-behavior/growing-sequence-flow/index.html index 8e100b46..e713d6bc 100644 --- a/examples/custom-behavior/growing-sequence-flow/index.html +++ b/examples/custom-behavior/growing-sequence-flow/index.html @@ -57,7 +57,7 @@ - + diff --git a/examples/custom-behavior/javascript-tooltip-and-popover/index.html b/examples/custom-behavior/javascript-tooltip-and-popover/index.html index b0c4142a..acb5a7c3 100644 --- a/examples/custom-behavior/javascript-tooltip-and-popover/index.html +++ b/examples/custom-behavior/javascript-tooltip-and-popover/index.html @@ -50,7 +50,7 @@ - + diff --git a/examples/custom-behavior/running-dashed-message-flow/index.html b/examples/custom-behavior/running-dashed-message-flow/index.html index 93e7b4e9..e280e881 100644 --- a/examples/custom-behavior/running-dashed-message-flow/index.html +++ b/examples/custom-behavior/running-dashed-message-flow/index.html @@ -57,7 +57,7 @@ - + diff --git a/examples/custom-behavior/select-elements-by-bpmn-kind/index.html b/examples/custom-behavior/select-elements-by-bpmn-kind/index.html index 23c9246e..0e618cad 100644 --- a/examples/custom-behavior/select-elements-by-bpmn-kind/index.html +++ b/examples/custom-behavior/select-elements-by-bpmn-kind/index.html @@ -55,7 +55,7 @@ } - + diff --git a/examples/custom-bpmn-theme/custom-colors/index.html b/examples/custom-bpmn-theme/custom-colors/index.html index c6cfdb8a..7b578809 100644 --- a/examples/custom-bpmn-theme/custom-colors/index.html +++ b/examples/custom-bpmn-theme/custom-colors/index.html @@ -22,7 +22,7 @@ - + diff --git a/examples/custom-bpmn-theme/custom-edge-marker-colors/index.html b/examples/custom-bpmn-theme/custom-edge-marker-colors/index.html index 7ca1dfa4..5ddc0547 100644 --- a/examples/custom-bpmn-theme/custom-edge-marker-colors/index.html +++ b/examples/custom-bpmn-theme/custom-edge-marker-colors/index.html @@ -36,7 +36,7 @@ - + diff --git a/examples/custom-bpmn-theme/custom-fonts/index.html b/examples/custom-bpmn-theme/custom-fonts/index.html index f3e28d24..516b7133 100644 --- a/examples/custom-bpmn-theme/custom-fonts/index.html +++ b/examples/custom-bpmn-theme/custom-fonts/index.html @@ -22,7 +22,7 @@ - + diff --git a/examples/custom-bpmn-theme/custom-user-task-icon/index.html b/examples/custom-bpmn-theme/custom-user-task-icon/index.html index 458fb134..2121262a 100644 --- a/examples/custom-bpmn-theme/custom-user-task-icon/index.html +++ b/examples/custom-bpmn-theme/custom-user-task-icon/index.html @@ -22,7 +22,7 @@ - + diff --git a/examples/diagram-navigation/diagram-fit-after-load/index.html b/examples/diagram-navigation/diagram-fit-after-load/index.html index d6ecf9da..14a8a7f4 100644 --- a/examples/diagram-navigation/diagram-fit-after-load/index.html +++ b/examples/diagram-navigation/diagram-fit-after-load/index.html @@ -53,7 +53,7 @@ - + diff --git a/examples/diagram-navigation/diagram-fit-on-load/index.html b/examples/diagram-navigation/diagram-fit-on-load/index.html index 1a648945..e60f8387 100644 --- a/examples/diagram-navigation/diagram-fit-on-load/index.html +++ b/examples/diagram-navigation/diagram-fit-on-load/index.html @@ -40,7 +40,7 @@ - + diff --git a/examples/diagram-navigation/diagram-navigation/index.html b/examples/diagram-navigation/diagram-navigation/index.html index f5ddfbf0..9ab39a81 100644 --- a/examples/diagram-navigation/diagram-navigation/index.html +++ b/examples/diagram-navigation/diagram-navigation/index.html @@ -34,7 +34,7 @@ } - + diff --git a/examples/display-bpmn-diagram/load-local-bpmn-diagrams/index.html b/examples/display-bpmn-diagram/load-local-bpmn-diagrams/index.html index ebbe7836..844694b5 100644 --- a/examples/display-bpmn-diagram/load-local-bpmn-diagrams/index.html +++ b/examples/display-bpmn-diagram/load-local-bpmn-diagrams/index.html @@ -50,7 +50,7 @@ - + diff --git a/examples/display-bpmn-diagram/load-remote-bpmn-diagrams/index.html b/examples/display-bpmn-diagram/load-remote-bpmn-diagrams/index.html index a8490d27..1ed12c49 100644 --- a/examples/display-bpmn-diagram/load-remote-bpmn-diagrams/index.html +++ b/examples/display-bpmn-diagram/load-remote-bpmn-diagrams/index.html @@ -60,7 +60,7 @@ - + diff --git a/examples/display-bpmn-diagram/pools-filter-on-load/index.html b/examples/display-bpmn-diagram/pools-filter-on-load/index.html index 216963ea..c21b62fc 100644 --- a/examples/display-bpmn-diagram/pools-filter-on-load/index.html +++ b/examples/display-bpmn-diagram/pools-filter-on-load/index.html @@ -34,7 +34,7 @@ - + diff --git a/examples/misc/compare-with-bpmn-js/index.html b/examples/misc/compare-with-bpmn-js/index.html index 8b06eaec..e2e0124e 100644 --- a/examples/misc/compare-with-bpmn-js/index.html +++ b/examples/misc/compare-with-bpmn-js/index.html @@ -59,7 +59,7 @@ - + diff --git a/examples/misc/compare-with-kie-editors-standalone/index.html b/examples/misc/compare-with-kie-editors-standalone/index.html index 1e5eefff..ec6cc232 100644 --- a/examples/misc/compare-with-kie-editors-standalone/index.html +++ b/examples/misc/compare-with-kie-editors-standalone/index.html @@ -59,7 +59,7 @@ - + diff --git a/examples/overlays/add-remove/index.html b/examples/overlays/add-remove/index.html index 5123950f..97a6b825 100644 --- a/examples/overlays/add-remove/index.html +++ b/examples/overlays/add-remove/index.html @@ -48,7 +48,7 @@ - + diff --git a/examples/overlays/add-stylized/index.html b/examples/overlays/add-stylized/index.html index 3944b469..7c8ac4e2 100644 --- a/examples/overlays/add-stylized/index.html +++ b/examples/overlays/add-stylized/index.html @@ -43,7 +43,7 @@ - + diff --git a/examples/overlays/custom-overlay-default-style/index.html b/examples/overlays/custom-overlay-default-style/index.html index 508db9c8..7051d858 100644 --- a/examples/overlays/custom-overlay-default-style/index.html +++ b/examples/overlays/custom-overlay-default-style/index.html @@ -29,7 +29,7 @@ - + diff --git a/projects/javascript-vanilla-with-webpack/package.json b/projects/javascript-vanilla-with-webpack/package.json index 2b361261..dffd5df7 100644 --- a/projects/javascript-vanilla-with-webpack/package.json +++ b/projects/javascript-vanilla-with-webpack/package.json @@ -9,7 +9,7 @@ "serve": "webpack serve" }, "dependencies": { - "bpmn-visualization": "0.39.0" + "bpmn-visualization": "0.40.0" }, "devDependencies": { "html-webpack-plugin": "~5.5.1", diff --git a/projects/typescript-angular/package.json b/projects/typescript-angular/package.json index f28b35ae..5d59bcbb 100644 --- a/projects/typescript-angular/package.json +++ b/projects/typescript-angular/package.json @@ -19,7 +19,7 @@ "@angular/platform-browser": "~15.2.0", "@angular/platform-browser-dynamic": "~15.2.0", "@angular/router": "~15.2.0", - "bpmn-visualization": "0.39.0", + "bpmn-visualization": "0.40.0", "rxjs": "~7.8.0", "tslib": "~2.5.0", "zone.js": "~0.12.0" diff --git a/projects/typescript-lit-element/package.json b/projects/typescript-lit-element/package.json index e4453c49..b330cf37 100644 --- a/projects/typescript-lit-element/package.json +++ b/projects/typescript-lit-element/package.json @@ -11,7 +11,7 @@ }, "dependencies": { "lit": "~2.7.5", - "bpmn-visualization": "0.39.0" + "bpmn-visualization": "0.40.0" }, "devDependencies": { "patch-package": "~7.0.0", diff --git a/projects/typescript-vanilla-with-parcel/package.json b/projects/typescript-vanilla-with-parcel/package.json index 6b5813c6..6470cfed 100644 --- a/projects/typescript-vanilla-with-parcel/package.json +++ b/projects/typescript-vanilla-with-parcel/package.json @@ -8,7 +8,7 @@ "build": "tsc && parcel build --public-url ./ index.html" }, "dependencies": { - "bpmn-visualization": "0.39.0" + "bpmn-visualization": "0.40.0" }, "devDependencies": { "@parcel/core": "~2.9.3", diff --git a/projects/typescript-vanilla-with-rollup/package.json b/projects/typescript-vanilla-with-rollup/package.json index f93a4fd6..0f4d011b 100644 --- a/projects/typescript-vanilla-with-rollup/package.json +++ b/projects/typescript-vanilla-with-rollup/package.json @@ -10,7 +10,7 @@ "start": "rollup -cw --environment devMode:true" }, "dependencies": { - "bpmn-visualization": "0.39.0" + "bpmn-visualization": "0.40.0" }, "devDependencies": { "@rollup/plugin-commonjs": "~24.1.0", diff --git a/projects/typescript-vanilla-with-vitejs/package.json b/projects/typescript-vanilla-with-vitejs/package.json index 864eacb9..aca20c81 100644 --- a/projects/typescript-vanilla-with-vitejs/package.json +++ b/projects/typescript-vanilla-with-vitejs/package.json @@ -9,7 +9,7 @@ "preview": "vite preview" }, "dependencies": { - "bpmn-visualization": "0.39.0" + "bpmn-visualization": "0.40.0" }, "devDependencies": { "typescript": "~4.5.5", diff --git a/projects/typescript-vue/package.json b/projects/typescript-vue/package.json index 29e58167..125cda6e 100644 --- a/projects/typescript-vue/package.json +++ b/projects/typescript-vue/package.json @@ -9,7 +9,7 @@ }, "dependencies": { "@process-analytics/bv-experimental-add-ons": "0.2.0", - "bpmn-visualization": "0.39.0", + "bpmn-visualization": "0.40.0", "spectre.css": "^0.5.9", "vue": "^3.3.4" },