"u")};n.isExist=function(a){return typeof a<"u"},n.isEmptyObject=function(a){return Object.keys(a).length===0},n.merge=function(a,c,u){if(c){const f=Object.keys(c),d=f.length;for(let p=0;p",o,"Closing Tag is not closed.");let c=n.substring(o+2,a).trim();if(this.options.removeNSPrefix){const u=c.indexOf(":");u!==-1&&(c=c.substr(u+1))}this.options.transformTagName&&(c=this.options.transformTagName(c)),e&&(s=this.saveTextToParentTag(s,e,i)),i=i.substr(0,i.lastIndexOf(".")),e=this.tagsNodeStack.pop(),s="",o=a}else if(n[o+1]==="?"){let a=Re(n,o,!1,"?>");if(!a)throw new Error("Pi Tag is not closed.");if(s=this.saveTextToParentTag(s,e,i),!(this.options.ignoreDeclaration&&a.tagName==="?xml"||this.options.ignorePiTags)){const c=new oe(a.tagName);c.add(this.options.textNodeName,""),a.tagName!==a.tagExp&&a.attrExpPresent&&(c[":@"]=this.buildAttributesMap(a.tagExp,i)),e.addChild(c)}o=a.closeIndex+1}else if(n.substr(o+1,3)==="!--"){const a=$(n,"-->",o+4,"Comment is not closed.");if(this.options.commentPropName){const c=n.substring(o+4,a-2);s=this.saveTextToParentTag(s,e,i),e.add(this.options.commentPropName,[{[this.options.textNodeName]:c}])}o=a}else if(n.substr(o+1,2)==="!D"){const a=ks(n,o);this.docTypeEntities=a.entities,o=a.i}else if(n.substr(o+1,2)==="!["){const a=$(n,"]]>",o,"CDATA is not closed.")-2,c=n.substring(o+9,a);if(s=this.saveTextToParentTag(s,e,i),this.options.cdataPropName)e.add(this.options.cdataPropName,[{[this.options.textNodeName]:c}]);else{let u=this.parseTextData(c,e.tagname,i,!0,!1,!0);u==null&&(u=""),e.add(this.options.textNodeName,u)}o=a+2}else{let a=Re(n,o,this.options.removeNSPrefix),c=a.tagName,u=a.tagExp,f=a.attrExpPresent,d=a.closeIndex;this.options.transformTagName&&(c=this.options.transformTagName(c)),e&&s&&e.tagname!=="!xml"&&(s=this.saveTextToParentTag(s,e,i,!1)),c!==t.tagname&&(i+=i?"."+c:c);const p=e;if(p&&this.options.unpairedTags.indexOf(p.tagname)!==-1&&(e=this.tagsNodeStack.pop()),this.isItStopNode(this.options.stopNodes,i,c)){let g="";if(u.length>0&&u.lastIndexOf("/")===u.length-1)o=a.closeIndex;else if(this.options.unpairedTags.indexOf(c)!==-1)o=a.closeIndex;else{const N=this.readStopNodeData(n,c,d+1);if(!N)throw new Error(`Unexpected end of ${c}`);o=N.i,g=N.tagContent}const A=new oe(c);c!==u&&f&&(A[":@"]=this.buildAttributesMap(u,i)),g&&(g=this.parseTextData(g,c,i,!0,f,!0,!0)),i=i.substr(0,i.lastIndexOf(".")),A.add(this.options.textNodeName,g),e.addChild(A)}else{if(u.length>0&&u.lastIndexOf("/")===u.length-1){c[c.length-1]==="/"?(c=c.substr(0,c.length-1),u=c):u=u.substr(0,u.length-1),this.options.transformTagName&&(c=this.options.transformTagName(c));const g=new oe(c);c!==u&&f&&(g[":@"]=this.buildAttributesMap(u,i)),i=i.substr(0,i.lastIndexOf(".")),e.addChild(g)}else{const g=new oe(c);this.tagsNodeStack.push(e),c!==u&&f&&(g[":@"]=this.buildAttributesMap(u,i)),e.addChild(g),e=g}s="",o=d}}else s+=n[o];return t.child},Ds=function(n){if(this.options.processEntities){for(let t in this.docTypeEntities){const e=this.docTypeEntities[t];n=n.replace(e.regx,e.val)}for(let t in this.lastEntities){const e=this.lastEntities[t];n=n.replace(e.regex,e.val)}if(this.options.htmlEntities)for(let t in this.htmlEntities){const e=this.htmlEntities[t];n=n.replace(e.regex,e.val)}}return n};function zs(n,t,e,s){return n&&(s===void 0&&(s=Object.keys(t.child).length===0),n=this.parseTextData(n,t.tagname,e,!1,t[":@"]?Object.keys(t[":@"]).length!==0:!1,s),n!==void 0&&n!==""&&t.add(this.options.textNodeName,n),n=""),n}function $s(n,t,e){const s="*."+e;for(const i in n){const o=n[i];if(s===o||t===o)return!0}return!1}function Xs(n,t,e=">"){let s,i="";for(let o=t;os)r=c-1;else return n[c+i]}return-1}const Fi=Ri(Oi);function Pi(n){return Fi(n,!0)}class Mi{constructor(){T(this,"x2jOptions",{attributeNamePrefix:"",removeNSPrefix:!0,ignoreAttributes:!1,parseAttributeValue:!0,processEntities:!1,attributeValueProcessor:(t,e)=>Pi(e)});T(this,"xmlParser",new vi.XMLParser(this.x2jOptions))}parse(t){let e;try{e=this.xmlParser.parse(t)}catch{throw new Error("XML parsing failed. Invalid BPMN source.")}if(!e.definitions)throw new Error("XML parsing failed. Unable to retrieve 'definitions' from the BPMN source.");return e}}class ne{}class ki{warning(t){const e=t.getMessage();console.warn(e.template,...e.arguments)}}class Bi extends ne{constructor(t,e){super(),this.groupBpmnElementId=t,this.categoryValueRef=e}getMessage(){return{arguments:[this.categoryValueRef,this.groupBpmnElementId],template:"Group json deserialization: unable to find category value ref %s for bpmn element %s"}}}class Gi extends ne{constructor(t){super(),this.bpmnElementId=t}getMessage(){return{arguments:[this.bpmnElementId],template:"Shape json deserialization: unable to find bpmn element with id %s"}}}class Vi extends ne{constructor(t){super(),this.bpmnElementId=t}getMessage(){return{arguments:[this.bpmnElementId],template:"Edge json deserialization: unable to find bpmn element with id %s"}}}class Yi extends ne{constructor(t,e){super(),this.shapeOrEdgeId=t,this.labelStyleId=e}getMessage(){return{arguments:[this.labelStyleId,this.shapeOrEdgeId],template:"Unable to assign font from style %s to shape/edge %s"}}}class Ui extends ne{constructor(t,e){super(),this.laneId=t,this.flowNodeRef=e}getMessage(){return{arguments:[this.flowNodeRef,this.laneId],template:"Unable to assign lane %s as parent: flow node %s is not found"}}}class Wi extends ne{constructor(t,e,s){super(),this.bpmnElementId=t,this.attachedToRef=e,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 Hi{constructor(){T(this,"poolsById",new Map);T(this,"poolsByProcessRef",new Map);T(this,"messageFlows",new Map);T(this,"flowNodes",new Map);T(this,"lanes",new Map);T(this,"sequenceFlows",new Map);T(this,"associationFlows",new Map);T(this,"eventDefinitionsOfDefinitions",new Map);T(this,"globalTasks",new Map);T(this,"categoryValues",new Map)}findPoolById(t){return this.poolsById.get(t)}findPoolByProcessRef(t){return this.poolsByProcessRef.get(t)}registerPool(t,e){this.poolsById.set(t.id,t),e&&this.poolsByProcessRef.set(e,t)}findMessageFlow(t){return this.messageFlows.get(t)}registerMessageFlow(t){this.messageFlows.set(t.id,t)}findFlowNode(t){return this.flowNodes.get(t)}registerFlowNode(t){this.flowNodes.set(t.id,t)}findLane(t){return this.lanes.get(t)}registerLane(t){this.lanes.set(t.id,t)}findSequenceFlow(t){return this.sequenceFlows.get(t)}registerSequenceFlow(t){this.sequenceFlows.set(t.id,t)}findAssociationFlow(t){return this.associationFlows.get(t)}registerAssociationFlow(t){this.associationFlows.set(t.id,t)}findEventDefinitionOfDefinition(t){return this.eventDefinitionsOfDefinitions.get(t)}registerEventDefinitionsOfDefinition(t,e){this.eventDefinitionsOfDefinitions.set(t,e)}findGlobalTask(t){return this.globalTasks.get(t)}registerGlobalTask(t,e){this.globalTasks.set(t,e)}findCategoryValue(t){return this.categoryValues.get(t)}registerCategoryValue(t,e){this.categoryValues.set(t,{value:e})}}const bt=(n,t,e,s)=>{const i=n.findCategoryValue(e.categoryValueRef);if(i)return new G(e.id,i.value,h.GROUP,s);t.warning(new Bi(e.id,e.categoryValueRef))};class Ki{constructor(t,e){this.convertedElements=t,this.parsingMessageCollector=e}deserialize(t){I(t).forEach(e=>this.parseCollaboration(e))}parseCollaboration(t){this.buildParticipant(t.participant),this.buildMessageFlows(t.messageFlow),this.buildGroups(t.group)}buildParticipant(t){I(t).forEach(e=>this.convertedElements.registerPool(new G(e.id,e.name,h.POOL),e.processRef))}buildMessageFlows(t){I(t).forEach(e=>this.convertedElements.registerMessageFlow(new mt(e.id,e.name,e.sourceRef,e.targetRef)))}buildGroups(t){I(t).forEach(e=>{const s=bt(this.convertedElements,this.parsingMessageCollector,e);s&&this.convertedElements.registerFlowNode(s)})}}class Di{constructor(t,e){T(this,"defaultSequenceFlowIds",[]);this.convertedElements=t,this.parsingMessageCollector=e}deserialize(t){I(t).forEach(e=>this.parseProcess(e))}parseProcess(t){const e=t.id,s=this.convertedElements.findPoolByProcessRef(e);s&&!s.name&&this.convertedElements.registerPool(new G(s.id,t.name,h.POOL),e),this.buildProcessInnerElements(t,s==null?void 0:s.id)}buildProcessInnerElements(t,e){S.flowNodeKinds().filter(s=>s!=h.EVENT_BOUNDARY).forEach(s=>this.buildFlowNodeBpmnElements(t[s],s,e)),this.buildFlowNodeBpmnElements(t.boundaryEvent,h.EVENT_BOUNDARY,e),this.buildLaneBpmnElements(t[h.LANE],e),this.buildLaneSetBpmnElements(t.laneSet,e),this.buildSequenceFlows(t[P.SEQUENCE_FLOW]),this.buildAssociationFlows(t[P.ASSOCIATION_FLOW])}buildFlowNodeBpmnElements(t,e,s){I(t).forEach(i=>{let o;if(S.isEvent(e))o=this.buildShapeBpmnEvent(i,e,s);else if(S.isActivity(e))o=this.buildShapeBpmnActivity(i,e,s);else if(e==h.GATEWAY_EVENT_BASED){const r=i;o=new At(i.id,r.name,s,r.instantiate,le[r.eventGatewayType])}else if(e==h.GROUP)o=bt(this.convertedElements,this.parsingMessageCollector,i,s);else{const r=e===h.TEXT_ANNOTATION?i.text:i.name;o=new G(i.id,r,e,s,i.instantiate)}const a=i.default;S.isWithDefaultSequenceFlow(e)&&a&&this.defaultSequenceFlowIds.push(a),o&&this.convertedElements.registerFlowNode(o)})}buildShapeBpmnActivity(t,e,s){const i=zi(t);return S.isSubProcess(e)?this.buildShapeBpmnSubProcess(t,s,i):S.isCallActivity(e)?this.buildShapeBpmnCallActivity(t,s,i):new Ce(t.id,t.name,e,s,t.instantiate,i)}buildShapeBpmnCallActivity(t,e,s){const i=this.convertedElements.findGlobalTask(t.calledElement);return i?new ue(t.id,t.name,ae.CALLING_GLOBAL_TASK,e,s,i):new ue(t.id,t.name,ae.CALLING_PROCESS,e,s)}buildShapeBpmnEvent(t,e,s){const i=this.getEventDefinitions(t),o=i.map(a=>a.counter).reduce((a,r)=>a+r,0);if(o==0&&S.canHaveNoneEvent(e))return new de(t.id,t.name,e,b.NONE,s);if(o==1){const a=i[0].kind;return S.isBoundaryEvent(e)?this.buildShapeBpmnBoundaryEvent(t,a):S.isStartEvent(e)?new St(t.id,t.name,a,s,t.isInterrupting):new de(t.id,t.name,e,a,s)}}buildShapeBpmnBoundaryEvent(t,e){const s=this.convertedElements.findFlowNode(t.attachedToRef);if(S.isActivity(s==null?void 0:s.kind))return new It(t.id,t.name,e,t.attachedToRef,t.cancelActivity);this.parsingMessageCollector.warning(new Wi(t.id,t.attachedToRef,s==null?void 0:s.kind))}getEventDefinitions(t){const e=new Map;return ft.forEach(s=>{const i=t[s+"EventDefinition"],o=I(i,!0).length;e.set(s,o)}),I(t.eventDefinitionRef).forEach(s=>{const i=this.convertedElements.findEventDefinitionOfDefinition(s);e.set(i,e.get(i)+1)}),Array.from(e.keys()).map(s=>({kind:s,counter:e.get(s)})).filter(s=>s.counter>0)}buildShapeBpmnSubProcess(t,e,s){const i=t.triggeredByEvent?ge.EVENT:ge.EMBEDDED,o=new pe(t.id,t.name,i,e,s);return this.buildProcessInnerElements(t,t.id),o}buildLaneSetBpmnElements(t,e){I(t).forEach(s=>this.buildLaneBpmnElements(s.lane,e))}buildLaneBpmnElements(t,e){I(t).forEach(s=>{var i;this.convertedElements.registerLane(new G(s.id,s.name,h.LANE,e)),this.assignParentOfLaneFlowNodes(s),(i=s.childLaneSet)!=null&&i.lane&&this.buildLaneBpmnElements(s.childLaneSet.lane,s.id)})}assignParentOfLaneFlowNodes(t){I(t.flowNodeRef).forEach(e=>{const s=this.convertedElements.findFlowNode(e),i=t.id;s?S.isBoundaryEvent(s.kind)||(s.parentId=i):this.parsingMessageCollector.warning(new Ui(i,e))})}buildSequenceFlows(t){I(t).forEach(e=>{const s=this.getSequenceFlowKind(e);this.convertedElements.registerSequenceFlow(new Et(e.id,e.name,e.sourceRef,e.targetRef,s))})}buildAssociationFlows(t){I(t).forEach(e=>{const s=e.associationDirection;this.convertedElements.registerAssociationFlow(new Ct(e.id,void 0,e.sourceRef,e.targetRef,s))})}getSequenceFlowKind(t){if(this.defaultSequenceFlowIds.includes(t.id))return B.DEFAULT;{const e=this.convertedElements.findFlowNode(t.sourceRef);if(e&&S.isWithDefaultSequenceFlow(e.kind)&&t.conditionExpression)return S.isActivity(e.kind)?B.CONDITIONAL_FROM_ACTIVITY:B.CONDITIONAL_FROM_GATEWAY}return B.NORMAL}}const zi=n=>{const t=[],e=n.standardLoopCharacteristics,s=I(n.multiInstanceLoopCharacteristics,!0)[0];return e||e===""?t.push(y.LOOP):s&&s.isSequential?t.push(y.MULTI_INSTANCE_SEQUENTIAL):(s&&!s.isSequential||s==="")&&t.push(y.MULTI_INSTANCE_PARALLEL),t};class $i{constructor(t,e,s,i){this.x=t,this.y=e,this.width=s,this.height=i}}class Xi{constructor(t,e,s,i,o=Q.NONE){this.id=t,this.bpmnElement=e,this.waypoints=s,this.label=i,this.messageVisibleKind=o}}class Zi{constructor(t,e){this.x=t,this.y=e}}class ji{constructor(t,e){this.font=t,this.bounds=e}}class qi{constructor(t,e,s,i,o,a){this.name=t,this.size=e,this.isBold=s,this.isItalic=i,this.isUnderline=o,this.isStrikeThrough=a}}class Ee{constructor(t,e){T(this,"convertedFonts",new Map);this.convertedElements=t,this.parsingMessageCollector=e}deserialize(t){const e=[],s=[],i=[],o=[],a=I(t)[0];if(a){this.deserializeFonts(a.BPMNLabelStyle);const r=a.BPMNPlane,c=this.deserializeEdges(r.BPMNEdge),u=this.deserializeShapes(r.BPMNShape);e.push(...u.flowNodes),s.push(...u.lanes),i.push(...u.pools),o.push(...c)}return{flowNodes:e,lanes:s,pools:i,edges:o}}deserializeFonts(t){this.convertedFonts=new Map,I(t).forEach(e=>I(e.Font).forEach(s=>this.convertedFonts.set(e.id,new qi(s.name,s.size,s.isBold,s.isItalic,s.isUnderline,s.isStrikeThrough))))}deserializeShapes(t){const e={flowNodes:[],lanes:[],pools:[]};return I(t).forEach(s=>{this.deserializeShapeAndStoreIfFound(s,e.flowNodes,i=>this.convertedElements.findFlowNode(i))||this.deserializeShapeAndStoreIfFound(s,e.lanes,i=>this.convertedElements.findLane(i))||this.deserializeShapeAndStoreIfFound(s,e.pools,i=>this.convertedElements.findPoolById(i))||this.parsingMessageCollector.warning(new Gi(s.bpmnElement))}),e}deserializeShapeAndStoreIfFound(t,e,s){const i=this.deserializeShape(t,s);return i?(e.push(i),!0):!1}deserializeShape(t,e){const s=e(t.bpmnElement);if(s){const i=Ee.deserializeBounds(t);(s instanceof pe||s instanceof ue&&s.callActivityKind===ae.CALLING_PROCESS)&&!t.isExpanded&&s.markers.push(y.EXPAND);let o;S.isPoolOrLane(s.kind)&&(o=t.isHorizontal!==void 0?t.isHorizontal:!0);const a=this.deserializeLabel(t.BPMNLabel,t.id);return new fe(t.id,s,i,a,o)}}static deserializeBounds(t){const e=t.Bounds;if(e)return new $i(e.x,e.y,e.width,e.height)}deserializeEdges(t){return I(t).map(e=>{const s=this.convertedElements.findSequenceFlow(e.bpmnElement)||this.convertedElements.findMessageFlow(e.bpmnElement)||this.convertedElements.findAssociationFlow(e.bpmnElement);if(!s){this.parsingMessageCollector.warning(new Vi(e.bpmnElement));return}const i=this.deserializeWaypoints(e.waypoint),o=this.deserializeLabel(e.BPMNLabel,e.id),a=e.messageVisibleKind?e.messageVisibleKind:Q.NONE;return new Xi(e.id,s,i,o,a)}).filter(Boolean)}deserializeWaypoints(t){return I(t).map(e=>new Zi(e.x,e.y))}deserializeLabel(t,e){if(t&&typeof t=="object"){const s=this.findFont(t.labelStyle,e),i=Ee.deserializeBounds(t);if(s||i)return new ji(s,i)}}findFont(t,e){let s;return t&&(s=this.convertedFonts.get(t),s||this.parsingMessageCollector.warning(new Yi(e,t))),s}}class Ji{constructor(t){this.convertedElements=t}deserialize(t){ft.forEach(e=>{const s=t[e+"EventDefinition"];I(s,!0).forEach(i=>this.convertedElements.registerEventDefinitionsOfDefinition(i.id,e))})}}class Qi{constructor(t){this.convertedElements=t}deserialize(t){this.parseGlobalTasks(t.globalTask,h.GLOBAL_TASK),this.parseGlobalTasks(t.globalBusinessRuleTask,h.GLOBAL_TASK_BUSINESS_RULE),this.parseGlobalTasks(t.globalManualTask,h.GLOBAL_TASK_MANUAL),this.parseGlobalTasks(t.globalScriptTask,h.GLOBAL_TASK_SCRIPT),this.parseGlobalTasks(t.globalUserTask,h.GLOBAL_TASK_USER)}parseGlobalTasks(t,e){I(t).forEach(s=>this.convertedElements.registerGlobalTask(s.id,e))}}class eo{constructor(t){this.convertedElements=t}deserialize(t){I(t.category).forEach(e=>I(e.categoryValue).forEach(s=>this.convertedElements.registerCategoryValue(s.id,s.value)))}}class to{constructor(t,e,s,i,o,a){this.categoryConverter=t,this.collaborationConverter=e,this.eventDefinitionConverter=s,this.globalTaskConverter=i,this.processConverter=o,this.diagramConverter=a}parse(t){const e=t.definitions;return this.categoryConverter.deserialize(e),this.collaborationConverter.deserialize(e.collaboration),this.eventDefinitionConverter.deserialize(e),this.globalTaskConverter.deserialize(e),this.processConverter.deserialize(e.process),this.diagramConverter.deserialize(e.BPMNDiagram)}}function no(n){const t=new Hi;return new to(new eo(t),new Ki(t,n),new Ji(t),new Qi(t),new Di(t,n),new Ee(t,n))}class so{constructor(t,e){this.jsonParser=t,this.xmlParser=e}parse(t){const e=this.xmlParser.parse(t);return this.jsonParser.parse(e)}}function io(){return new so(no(new ki),new Mi)}class oo{constructor(){T(this,"classNamesByBPMNId",new Map)}clear(){this.classNamesByBPMNId.clear()}getClassNames(t){var e;return Array.from((e=this.classNamesByBPMNId.get(t))!=null?e:[])}addClassNames(t,e){return this.updateClassNames(t,e,(s,i)=>s.add(i))}removeClassNames(t,e){return this.updateClassNames(t,e,(s,i)=>s.delete(i))}toggleClassNames(t,e){return this.updateClassNames(t,e,(s,i)=>s.has(i)?s.delete(i):s.add(i)),e&&e.length>0}updateClassNames(t,e,s){const i=this.getOrInitializeClassNames(t),o=i.size;return I(e).forEach(a=>s(i,a)),i.size!=o}getOrInitializeClassNames(t){let e=this.classNamesByBPMNId.get(t);return e==null&&(e=new Set,this.classNamesByBPMNId.set(t,e)),e}}class ze{constructor(){T(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(t){const e=this.convertPosition(t),s=ze.convertStyle(t);return{position:e,style:s}}convertPosition(t){return this.overlayPositions.get(t.position)}static convertStyle(t){const e={fill:{color:m.DEFAULT_OVERLAY_FILL_COLOR.valueOf(),opacity:m.DEFAULT_OVERLAY_FILL_OPACITY.valueOf()},stroke:{color:m.DEFAULT_OVERLAY_STROKE_COLOR.valueOf(),width:m.DEFAULT_OVERLAY_STROKE_WIDTH.valueOf()},font:{color:m.DEFAULT_OVERLAY_FONT_COLOR.valueOf(),size:m.DEFAULT_OVERLAY_FONT_SIZE.valueOf()}},s=t.style,i={...e};return s&&(this.convertFill(i,s.fill),this.convertStroke(i,s.stroke),this.convertFont(i,s.font)),i}static convertFill(t,e){var s,i;e&&(t.fill.color=(s=e.color)!=null?s:t.fill.color,t.fill.opacity=(i=e.opacity)!=null?i:t.fill.opacity)}static convertStroke(t,e){var s,i;e&&(t.stroke.color=(s=e.color)!=null?s:t.stroke.color,t.stroke.width=(i=e.width)!=null?i:t.stroke.width)}static convertFont(t,e){var s,i;e&&(t.font.color=(s=e.color)!=null?s:t.font.color,t.font.size=(i=e.size)!=null?i:t.font.size)}}function ro(n){return new ao(n,new ze)}class ao{constructor(t,e){this.graph=t,this.overlayConverter=e}updateAndRefreshCssClassesOfCell(t,e){this.updateAndRefreshCssClassesOfElement(t,e),this.updateAndRefreshCssClassesOfElement(Nt(t),e)}updateAndRefreshCssClassesOfElement(t,e){var a;const s=this.graph.getModel().getCell(t);if(!s)return;const o=this.graph.getView().getState(s);o.style[E.EXTRA_CSS_CLASSES]=e,o.shape.redraw(),(a=o.text)==null||a.redraw()}addOverlays(t,e){const s=this.graph.getModel().getCell(t);!s||I(e).forEach(i=>{const o=new Tt(i.label,this.overlayConverter.convert(i));this.graph.addCellOverlay(s,o)})}removeAllOverlays(t){const e=this.graph.getModel().getCell(t);!e||this.graph.removeCellOverlays(e)}}class lo{constructor(t){this.containerId=t}element(t){return`#${this.containerId} > svg > g > g > g[data-bpmn-id="${t}"]`}elementsOfKind(t){return`#${this.containerId} > svg > g > g > g.${t}:not(.bpmn-label)`}}function co(n,t){var e;return new uo(n,new ho(new lo((e=t.container)==null?void 0:e.id)),new oo,ro(t))}class uo{constructor(t,e,s,i){this.bpmnModelRegistry=t,this.htmlElementRegistry=e,this.cssRegistry=s,this.graphCellUpdater=i,this.bpmnModelRegistry.registerOnLoadCallback(this.cssRegistry.clear.bind(this.cssRegistry))}getElementsByIds(t){return I(t).map(e=>this.bpmnModelRegistry.getBpmnSemantic(e)).filter(Boolean).map(e=>({bpmnSemantic:e,htmlElement:this.htmlElementRegistry.getBpmnHtmlElement(e.id)}))}getElementsByKinds(t){return I(t).map(e=>this.htmlElementRegistry.getBpmnHtmlElements(e).map(s=>({htmlElement:s,bpmnSemantic:this.bpmnModelRegistry.getBpmnSemantic(s.getAttribute("data-bpmn-id"))}))).reduce((e,s)=>(e.push(...s),e),[])}addCssClasses(t,e){this.updateCssClasses(t,e,this.cssRegistry.addClassNames.bind(this.cssRegistry))}removeCssClasses(t,e){this.updateCssClasses(t,e,this.cssRegistry.removeClassNames.bind(this.cssRegistry))}toggleCssClasses(t,e){this.updateCssClasses(t,e,this.cssRegistry.toggleClassNames.bind(this.cssRegistry))}updateCssClasses(t,e,s){const i=I(e);I(t).forEach(o=>this.updateCellIfChanged(s(o,i),o))}updateCellIfChanged(t,e){if(t){const s=this.cssRegistry.getClassNames(e);this.graphCellUpdater.updateAndRefreshCssClassesOfCell(e,s)}}addOverlays(t,e){this.graphCellUpdater.addOverlays(t,e)}removeAllOverlays(t){this.graphCellUpdater.removeAllOverlays(t)}}class ho{constructor(t){this.querySelectors=t}getBpmnHtmlElement(t){return document.querySelector(this.querySelectors.element(t))}getBpmnHtmlElements(t){const e=this.querySelectors.elementsOfKind(ye(t));return[...document.querySelectorAll(e)]}}class fo{filter(t,e){const s=[],i=[];if(I(e==null?void 0:e.pools).filter(g=>g&&Object.keys(g).length).forEach(g=>g.id?s.push(g.id):g.name&&i.push(g.name)),s.length==0&&i.length==0)return t;if(t.pools.length==0)throw new Error("It is not possible to filter pools of the BPMN model because it does not contain any pool");const{filteredPools:o,filteredPoolsIds:a}=go(t,s,i),{filteredLanes:r,filteredLaneIds:c,filteredFlowNodes:u,filteredFlowNodeIds:f}=wt(t.lanes,t.flowNodes,a),d=po(t.edges,[...a,...c,...f]);return{lanes:r,flowNodes:u,pools:o,edges:d}}}function go(n,t,e){const s=n.pools.filter(o=>t.includes(o.bpmnElement.id)||e.includes(o.bpmnElement.name));if(s.length==0){let o=t.length>0?` for ids [${t}]`:"";const a=o?" and":"";throw o+=e.length>0?`${a} for names [${e}]`:"",new Error("No matching pools"+o)}const i=s.map(o=>o.bpmnElement.id);return{filteredPools:s,filteredPoolsIds:i}}function wt(n,t,e){const{filteredLanes:s,filteredLaneIds:i}=Rt(n,e),{filteredLanes:o,filteredLaneIds:a,filteredFlowNodes:r,filteredFlowNodeIds:c}=To(t,[...e,...i],n);return s.push(...o),i.push(...a),{filteredLanes:s,filteredLaneIds:i,filteredFlowNodes:r,filteredFlowNodeIds:c}}function Rt(n,t){const e=n.filter(i=>t.includes(i.bpmnElement.parentId)),s=e.map(i=>i.bpmnElement.id);if(e.length>0){const{filteredLanes:i,filteredLaneIds:o}=Rt(n,s);e.push(...i),s.push(...o)}return{filteredLanes:e,filteredLaneIds:s}}function To(n,t,e){const s=n.filter(u=>t.includes(u.bpmnElement.parentId));if(s.length===0)return{filteredLanes:[],filteredLaneIds:[],filteredFlowNodes:[],filteredFlowNodeIds:[]};const i=s.map(u=>u.bpmnElement.id),{filteredLanes:o,filteredLaneIds:a,filteredFlowNodes:r,filteredFlowNodeIds:c}=wt(e,n,i);return s.push(...r),i.push(...c),{filteredLanes:o,filteredLaneIds:a,filteredFlowNodes:s,filteredFlowNodeIds:i}}function po(n,t){return n.filter(e=>t.includes(e.bpmnElement.sourceRefId)&&t.includes(e.bpmnElement.targetRefId))}class Eo{constructor(){T(this,"searchableModel");T(this,"onLoadCallback")}load(t,e){var i;const s=new fo().filter(t,e);return this.searchableModel=new Co(s),(i=this.onLoadCallback)==null||i.call(this),mo(s)}registerOnLoadCallback(t){this.onLoadCallback=t}getBpmnSemantic(t){const e=this.searchableModel.elementById(t);if(!e)return;const s=e.bpmnElement,i=s instanceof G;return{id:t,name:s.name,isShape:i,kind:s.kind}}}function mo(n){const t=n.flowNodes.filter(o=>{const a=o.bpmnElement;return S.isSubProcess(a.kind)&&a.markers.includes(y.EXPAND)}).map(o=>o.bpmnElement.id),e=[],s=[],i=[];return n.flowNodes.forEach(o=>{const a=o.bpmnElement.kind;S.isSubProcess(a)?e.push(o):S.isBoundaryEvent(a)?s.push(o):t.includes(o.bpmnElement.parentId)||i.push(o)}),{boundaryEvents:s,edges:n.edges,lanes:n.lanes,otherFlowNodes:i,pools:n.pools,subprocesses:e}}class Co{constructor(t){T(this,"elements",new Map);[].concat(t.pools,t.lanes,t.flowNodes,t.edges).forEach(e=>this.elements.set(e.bpmnElement.id,e))}elementById(t){return this.elements.get(t)}}function So(n){return n instanceof HTMLElement?n:document.getElementById(n)}class Io{constructor(t){this.graph=t}fit(t){this.graph.customFit(t)}zoom(t){t=="in"?this.graph.zoomIn():this.graph.zoomOut()}}const Ao="0.26.0",No=()=>({lib:Ao,dependencies:new Map([["mxGraph",l.mxClient.VERSION]])});class Lo{constructor(t){T(this,"graph");T(this,"navigation");T(this,"bpmnElementsRegistry");T(this,"bpmnModelRegistry");const e=new us(So(t==null?void 0:t.container));this.graph=e.configure(t),this.navigation=new Io(this.graph),this.bpmnModelRegistry=new Eo,this.bpmnElementsRegistry=co(this.bpmnModelRegistry,this.graph)}load(t,e){const s=io().parse(t),i=this.bpmnModelRegistry.load(s,e==null?void 0:e.modelFilter);fs(this.graph).render(i,e==null?void 0:e.fit)}fit(t){this.navigation.fit(t)}getVersion(){return No()}}const vo=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 Oo extends Lo{configureTheme(t){var f,d;if(t=="default")return new ce(this.graph).configureStyles(),!0;const e=vo.get(t);if(!e)return!1;const s=this.graph.getStylesheet();S.eventKinds().forEach(g=>{var M;let p,A;switch(g){case"endEvent":p=e.endEventFillColor,A=e.endEventStrokeColor;break;case"startEvent":p=e.startEventFillColor,A=e.startEventStrokeColor;break;case"intermediateCatchEvent":case"intermediateThrowEvent":case"boundaryEvent":p=e.defaultFillColor,A=(M=e.catchAndThrowEventStrokeColor)!=null?M:e.defaultStrokeColor;break;default:p=e.defaultFillColor,A=e.defaultStrokeColor;break}const N=s.styles[g];N.fillColor=p,N.strokeColor=A}),S.taskKinds().forEach(g=>{const p=s.styles[g];p.fillColor=e.taskAndCallActivityFillColor});const i=s.styles[h.CALL_ACTIVITY];i.fillColor=e.taskAndCallActivityFillColor;const o=s.styles[h.TEXT_ANNOTATION];o.fillColor=(f=e.textAnnotationFillColor)!=null?f:m.TEXT_ANNOTATION_FILL_COLOR;const a=s.styles[h.POOL];a.fillColor=e.poolFillColor,a.swimlaneFillColor=e.defaultFillColor;const r=s.styles[h.LANE];r.fillColor=e.laneFillColor;const c=s.getDefaultVertexStyle();c.fontColor=e.defaultFontColor,c.fillColor=e.defaultFillColor,c.strokeColor=e.defaultStrokeColor;const u=s.getDefaultEdgeStyle();return u.fontColor=e.defaultFontColor,u.fillColor=e.defaultFillColor,u.strokeColor=(d=e.flowColor)!=null?d:e.defaultStrokeColor,!0}configureSequenceFlowColor(t){Y(`Use dedicated ${t} color for sequence flows`);const s=this.graph.getStylesheet().styles[P.SEQUENCE_FLOW];s[l.mxConstants.STYLE_STROKECOLOR]=t,s[l.mxConstants.STYLE_FILLCOLOR]=t,Y("Sequence flows style updated")}}let O,W={},$e,Xe;function Bo(n){v("Updating load options",n),W.fit=n,v("Load options updated!",Fe(W))}function Go(){return{...W}}function Vo(){return Xe}function Yo(n){v("Switching theme from %s to %s",Xe,n),O.configureTheme(n)&&(O.graph.refresh(),v("Theme switch done"))}function xt(n){v("Loading bpmn...");try{O.load(n,W),v("BPMN loaded with configuration",Fe(W)),_o($e),document.dispatchEvent(new CustomEvent("diagramLoaded"))}catch(t){Me(t,`Cannot load the BPMN diagram: ${t.message}`)}}function Uo(n){v("Fitting..."),O.navigation.fit(n),v("Fit done with configuration",Fe(n))}function Wo(n){v(`Zooming '${n}'...`),O.navigation.zoom(n),v("Zoom done")}function Ho(n){return O.bpmnElementsRegistry.getElementsByKinds(n)}function Ko(n,t){return O.bpmnElementsRegistry.addCssClasses(n,t)}function Do(n,t){return O.bpmnElementsRegistry.removeCssClasses(n,t)}function zo(n,t){return O.bpmnElementsRegistry.addOverlays(n,[t])}function $o(n){return O.bpmnElementsRegistry.removeAllOverlays(n)}function _o(n){if(!$e)return;v("Updating model, bpmnElement to collapse:",n);const t=O.graph.getModel(),e=t.getCell(n);if(!e)v("Element not found in the model, do nothing");else{t.beginUpdate();try{t.setCollapsed(e,!0)}finally{t.endUpdate()}v("Model updated")}}function Ft(n){const t=new FileReader;t.onload=()=>{xt(t.result)},t.readAsText(n)}function Xo(n){const t=n.target.files[0];Ft(t)}function yo(n,t){Bt(n).catch(e=>{const s=`Unable to fetch ${n}. ${e}`;throw t(s),new Error(s)}).then(e=>(v("BPMN content fetched"),e)).then(e=>{xt(e),v(`Bpmn loaded from url ${n}`)}).catch(()=>{})}function bo(n){Me(n)}function wo(n,t){var o;const e=((o=n.loadOptions)==null?void 0:o.fit)||{},s=t.get("fitTypeOnLoad");s&&(e.type=s);const i=t.get("fitMargin");return i&&(e.margin=Number(i)),e}function Ro(n){if(n.get("style.container.alternative.background.color")=="true"){const o="yellow";Y("Use alternative color for the bpmn container background, color",o);const a=O.graph.container;a.style.backgroundColor=o,Y("Bpmn container style updated")}const e=n.get("style.theme");Y(`Configuring the '${e}' BPMN theme`),O.configureTheme(e)?(Xe=e,Y(`'${e}' BPMN theme configured`)):Y(`Unknown '${e}' BPMN theme, skipping configuration`),n.get("style.seqFlow.light.colors")=="true"&&O.configureSequenceFlowColor("#E9E9E9")}function xo(n){$e=n.get("bpmn.element.id.collapsed")}function Fo(n){const t=n.get("bpmn.filter.pool.ids");if(!t)return;const e=t.split(",");return v("Configuring load options to only include pool id: ",e),{pools:e.map(s=>({id:s}))}}function Zo(n){const t=Y,e=n.globalOptions.container;t(`Initializing BpmnVisualization with container '${e}'...`),O=new Oo(n.globalOptions),t("Initialization completed"),new Gt(window,"drop-container",e,Ft),t("Drag&Drop support initialized");const s=new URLSearchParams(window.location.search);t("Configuring Load Options"),W=n.loadOptions||{},W.fit=wo(n,s),W.modelFilter=Fo(s),Ro(s),xo(s),t("Checking if an 'url to fetch BPMN content' is provided as query parameter");const i=s.get("url");if(i){const o=decodeURIComponent(i),a=n.statusFetchKoNotifier||bo;yo(o,a);return}t("No 'url to fetch BPMN content' provided")}function jo(){q("Trigger SVG Download"),Ut(new dt(O.graph).exportSvg())}function qo(){q("Trigger PNG Download"),Wt(new dt(O.graph).exportSvgForPng())}function Jo(){const n=O.getVersion();return v("Version:",n),n}export{re as F,S,Ht as Z,Yo as a,Jo as b,Vo as c,ko as d,$o as e,Uo as f,Go as g,Xo as h,jo as i,qo as j,Ho as k,v as l,Ko as m,zo as n,Do as r,Zo as s,Bo as u,Wo as z};
+`):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine=""),this.options.suppressEmptyNode?(this.buildTextNode=mi,this.buildObjNode=pi):(this.buildTextNode=ut,this.buildObjNode=ct),this.buildTextValNode=ut,this.buildObjectNode=ct,this.replaceEntitiesValue=Ei,this.buildAttrPairStr=gi}De.prototype.build=function(n){return this.options.preserveOrder?hi(n,this.options):(Array.isArray(n)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(n={[this.options.arrayNodeName]:n}),this.j2x(n,0).val)};De.prototype.j2x=function(n,t){let e="",s="";for(let i in n)if(!(typeof n[i]>"u"))if(n[i]===null)i[0]==="?"?s+=this.indentate(t)+"<"+i+"?"+this.tagEndChar:s+=this.indentate(t)+"<"+i+"/"+this.tagEndChar;else if(n[i]instanceof Date)s+=this.buildTextNode(n[i],i,"",t);else if(typeof n[i]!="object"){const o=this.isAttribute(i);if(o)e+=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.buildTextNode(n[i],i,"",t)}else if(Array.isArray(n[i])){const o=n[i].length;for(let r=0;rs)a=c-1;else return n[c+i]}return-1}const Fi=Ri(Oi);function Pi(n){return Fi(n,!0)}class Mi{constructor(){T(this,"x2jOptions",{attributeNamePrefix:"",removeNSPrefix:!0,ignoreAttributes:!1,parseAttributeValue:!0,processEntities:!1,attributeValueProcessor:(t,e)=>Pi(e)});T(this,"xmlParser",new Li.XMLParser(this.x2jOptions))}parse(t){let e;try{e=this.xmlParser.parse(t)}catch{throw new Error("XML parsing failed. Invalid BPMN source.")}if(!e.definitions)throw new Error("XML parsing failed. Unable to retrieve 'definitions' from the BPMN source.");return e}}class ne{}class ki{warning(t){const e=t.getMessage();console.warn(e.template,...e.arguments)}}class Bi extends ne{constructor(t,e){super(),this.groupBpmnElementId=t,this.categoryValueRef=e}getMessage(){return{arguments:[this.categoryValueRef,this.groupBpmnElementId],template:"Group json deserialization: unable to find category value ref %s for bpmn element %s"}}}class Gi extends ne{constructor(t){super(),this.bpmnElementId=t}getMessage(){return{arguments:[this.bpmnElementId],template:"Shape json deserialization: unable to find bpmn element with id %s"}}}class Vi extends ne{constructor(t){super(),this.bpmnElementId=t}getMessage(){return{arguments:[this.bpmnElementId],template:"Edge json deserialization: unable to find bpmn element with id %s"}}}class Yi extends ne{constructor(t,e){super(),this.shapeOrEdgeId=t,this.labelStyleId=e}getMessage(){return{arguments:[this.labelStyleId,this.shapeOrEdgeId],template:"Unable to assign font from style %s to shape/edge %s"}}}class Ui extends ne{constructor(t,e){super(),this.laneId=t,this.flowNodeRef=e}getMessage(){return{arguments:[this.flowNodeRef,this.laneId],template:"Unable to assign lane %s as parent: flow node %s is not found"}}}class Wi extends ne{constructor(t,e,s){super(),this.bpmnElementId=t,this.attachedToRef=e,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 Hi{constructor(){T(this,"poolsById",new Map);T(this,"poolsByProcessRef",new Map);T(this,"messageFlows",new Map);T(this,"flowNodes",new Map);T(this,"lanes",new Map);T(this,"sequenceFlows",new Map);T(this,"associationFlows",new Map);T(this,"eventDefinitionsOfDefinitions",new Map);T(this,"globalTasks",new Map);T(this,"categoryValues",new Map)}findPoolById(t){return this.poolsById.get(t)}findPoolByProcessRef(t){return this.poolsByProcessRef.get(t)}registerPool(t,e){this.poolsById.set(t.id,t),e&&this.poolsByProcessRef.set(e,t)}findMessageFlow(t){return this.messageFlows.get(t)}registerMessageFlow(t){this.messageFlows.set(t.id,t)}findFlowNode(t){return this.flowNodes.get(t)}registerFlowNode(t){this.flowNodes.set(t.id,t)}findLane(t){return this.lanes.get(t)}registerLane(t){this.lanes.set(t.id,t)}findSequenceFlow(t){return this.sequenceFlows.get(t)}registerSequenceFlow(t){this.sequenceFlows.set(t.id,t)}findAssociationFlow(t){return this.associationFlows.get(t)}registerAssociationFlow(t){this.associationFlows.set(t.id,t)}findEventDefinitionOfDefinition(t){return this.eventDefinitionsOfDefinitions.get(t)}registerEventDefinitionsOfDefinition(t,e){this.eventDefinitionsOfDefinitions.set(t,e)}findGlobalTask(t){return this.globalTasks.get(t)}registerGlobalTask(t,e){this.globalTasks.set(t,e)}findCategoryValue(t){return this.categoryValues.get(t)}registerCategoryValue(t,e){this.categoryValues.set(t,{value:e})}}const bt=(n,t,e,s)=>{const i=n.findCategoryValue(e.categoryValueRef);if(i)return new G(e.id,i.value,h.GROUP,s);t.warning(new Bi(e.id,e.categoryValueRef))};class Ki{constructor(t,e){this.convertedElements=t,this.parsingMessageCollector=e}deserialize(t){S(t).forEach(e=>this.parseCollaboration(e))}parseCollaboration(t){this.buildParticipant(t.participant),this.buildMessageFlows(t.messageFlow),this.buildGroups(t.group)}buildParticipant(t){S(t).forEach(e=>this.convertedElements.registerPool(new G(e.id,e.name,h.POOL),e.processRef))}buildMessageFlows(t){S(t).forEach(e=>this.convertedElements.registerMessageFlow(new mt(e.id,e.name,e.sourceRef,e.targetRef)))}buildGroups(t){S(t).forEach(e=>{const s=bt(this.convertedElements,this.parsingMessageCollector,e);s&&this.convertedElements.registerFlowNode(s)})}}class Di{constructor(t,e){T(this,"defaultSequenceFlowIds",[]);T(this,"elementsWithoutParentByProcessId",new Map);T(this,"callActivitiesCallingProcess",new Map);this.convertedElements=t,this.parsingMessageCollector=e}deserialize(t){S(t).forEach(e=>this.parseProcess(e)),S(t).forEach(e=>this.assignParentOfProcessElementsCalledByCallActivity(e.id))}assignParentOfProcessElementsCalledByCallActivity(t){const e=this.callActivitiesCallingProcess.get(t);if(e){const s=this.convertedElements.findPoolByProcessRef(t);s&&(s.parentId=e.id),this.elementsWithoutParentByProcessId.get(t).forEach(i=>{i.parentId=e.id})}}parseProcess(t){const e=t.id,s=this.convertedElements.findPoolByProcessRef(e);s&&!s.name&&this.convertedElements.registerPool(new G(s.id,t.name,h.POOL),e),this.buildProcessInnerElements(t,s==null?void 0:s.id)}buildProcessInnerElements(t,e){this.elementsWithoutParentByProcessId.set(t.id,[]),I.flowNodeKinds().filter(s=>s!=h.EVENT_BOUNDARY).forEach(s=>this.buildFlowNodeBpmnElements(t[s],s,e,t.id)),this.buildFlowNodeBpmnElements(t.boundaryEvent,h.EVENT_BOUNDARY,e,t.id),this.buildLaneBpmnElements(t[h.LANE],e,t.id),this.buildLaneSetBpmnElements(t.laneSet,e,t.id),this.buildSequenceFlows(t.sequenceFlow),this.buildAssociationFlows(t.association)}buildFlowNodeBpmnElements(t,e,s,i){S(t).forEach(o=>{let r;if(I.isEvent(e))r=this.buildShapeBpmnEvent(o,e,s);else if(I.isActivity(e))r=this.buildShapeBpmnActivity(o,e,s);else if(e==h.GATEWAY_EVENT_BASED){const c=o;r=new At(o.id,c.name,s,c.instantiate,le[c.eventGatewayType])}else if(e==h.GROUP)r=bt(this.convertedElements,this.parsingMessageCollector,o,s);else{const c=e===h.TEXT_ANNOTATION?o.text:o.name;r=new G(o.id,c,e,s,o.instantiate)}const a=o.default;I.isWithDefaultSequenceFlow(e)&&a&&this.defaultSequenceFlowIds.push(a),r&&(this.convertedElements.registerFlowNode(r),s||this.elementsWithoutParentByProcessId.get(i).push(r))})}buildShapeBpmnActivity(t,e,s){const i=zi(t);return I.isSubProcess(e)?this.buildShapeBpmnSubProcess(t,s,i):I.isCallActivity(e)?this.buildShapeBpmnCallActivity(t,s,i):new Ce(t.id,t.name,e,s,t.instantiate,i)}buildShapeBpmnCallActivity(t,e,s){const i=this.convertedElements.findGlobalTask(t.calledElement);if(!i){const o=new ue(t.id,t.name,ae.CALLING_PROCESS,e,s);return this.callActivitiesCallingProcess.set(t.calledElement,o),o}return new ue(t.id,t.name,ae.CALLING_GLOBAL_TASK,e,s,i)}buildShapeBpmnEvent(t,e,s){const i=this.getEventDefinitions(t),o=i.map(r=>r.counter).reduce((r,a)=>r+a,0);if(o==0&&I.canHaveNoneEvent(e))return new de(t.id,t.name,e,b.NONE,s);if(o==1){const r=i[0].kind;return I.isBoundaryEvent(e)?this.buildShapeBpmnBoundaryEvent(t,r):I.isStartEvent(e)?new St(t.id,t.name,r,s,t.isInterrupting):new de(t.id,t.name,e,r,s)}}buildShapeBpmnBoundaryEvent(t,e){const s=this.convertedElements.findFlowNode(t.attachedToRef);if(I.isActivity(s==null?void 0:s.kind))return new It(t.id,t.name,e,t.attachedToRef,t.cancelActivity);this.parsingMessageCollector.warning(new Wi(t.id,t.attachedToRef,s==null?void 0:s.kind))}getEventDefinitions(t){const e=new Map;return ft.forEach(s=>{const i=t[s+"EventDefinition"],o=S(i,!0).length;e.set(s,o)}),S(t.eventDefinitionRef).forEach(s=>{const i=this.convertedElements.findEventDefinitionOfDefinition(s);e.set(i,e.get(i)+1)}),Array.from(e.keys()).map(s=>({kind:s,counter:e.get(s)})).filter(s=>s.counter>0)}buildShapeBpmnSubProcess(t,e,s){const i=t.triggeredByEvent?ge.EVENT:ge.EMBEDDED,o=new pe(t.id,t.name,i,e,s);return this.buildProcessInnerElements(t,t.id),o}buildLaneSetBpmnElements(t,e,s){S(t).forEach(i=>this.buildLaneBpmnElements(i.lane,e,s))}buildLaneBpmnElements(t,e,s){S(t).forEach(i=>{var r;const o=new G(i.id,i.name,h.LANE,e);this.convertedElements.registerLane(o),e||this.elementsWithoutParentByProcessId.get(s).push(o),this.assignParentOfLaneFlowNodes(i),(r=i.childLaneSet)!=null&&r.lane&&this.buildLaneBpmnElements(i.childLaneSet.lane,i.id,s)})}assignParentOfLaneFlowNodes(t){S(t.flowNodeRef).forEach(e=>{const s=this.convertedElements.findFlowNode(e),i=t.id;s?I.isBoundaryEvent(s.kind)||(s.parentId=i):this.parsingMessageCollector.warning(new Ui(i,e))})}buildSequenceFlows(t){S(t).forEach(e=>{const s=this.getSequenceFlowKind(e);this.convertedElements.registerSequenceFlow(new Et(e.id,e.name,e.sourceRef,e.targetRef,s))})}buildAssociationFlows(t){S(t).forEach(e=>{const s=e.associationDirection;this.convertedElements.registerAssociationFlow(new Ct(e.id,void 0,e.sourceRef,e.targetRef,s))})}getSequenceFlowKind(t){if(this.defaultSequenceFlowIds.includes(t.id))return B.DEFAULT;{const e=this.convertedElements.findFlowNode(t.sourceRef);if(e&&I.isWithDefaultSequenceFlow(e.kind)&&t.conditionExpression)return I.isActivity(e.kind)?B.CONDITIONAL_FROM_ACTIVITY:B.CONDITIONAL_FROM_GATEWAY}return B.NORMAL}}const zi=n=>{const t=[],e=n.standardLoopCharacteristics,s=S(n.multiInstanceLoopCharacteristics,!0)[0];return e||e===""?t.push(y.LOOP):s&&s.isSequential?t.push(y.MULTI_INSTANCE_SEQUENTIAL):(s&&!s.isSequential||s==="")&&t.push(y.MULTI_INSTANCE_PARALLEL),t};class $i{constructor(t,e,s,i){this.x=t,this.y=e,this.width=s,this.height=i}}class Xi{constructor(t,e,s,i,o=Q.NONE){this.id=t,this.bpmnElement=e,this.waypoints=s,this.label=i,this.messageVisibleKind=o}}class Zi{constructor(t,e){this.x=t,this.y=e}}class ji{constructor(t,e){this.font=t,this.bounds=e}}class qi{constructor(t,e,s,i,o,r){this.name=t,this.size=e,this.isBold=s,this.isItalic=i,this.isUnderline=o,this.isStrikeThrough=r}}class Ee{constructor(t,e){T(this,"convertedFonts",new Map);this.convertedElements=t,this.parsingMessageCollector=e}deserialize(t){const e=[],s=[],i=[],o=[],r=S(t)[0];if(r){this.deserializeFonts(r.BPMNLabelStyle);const a=r.BPMNPlane,c=this.deserializeEdges(a.BPMNEdge),u=this.deserializeShapes(a.BPMNShape);e.push(...u.flowNodes),s.push(...u.lanes),i.push(...u.pools),o.push(...c)}return{flowNodes:e,lanes:s,pools:i,edges:o}}deserializeFonts(t){this.convertedFonts=new Map,S(t).forEach(e=>S(e.Font).forEach(s=>this.convertedFonts.set(e.id,new qi(s.name,s.size,s.isBold,s.isItalic,s.isUnderline,s.isStrikeThrough))))}deserializeShapes(t){const e={flowNodes:[],lanes:[],pools:[]};return S(t).forEach(s=>{this.deserializeShapeAndStoreIfFound(s,e.flowNodes,i=>this.convertedElements.findFlowNode(i))||this.deserializeShapeAndStoreIfFound(s,e.lanes,i=>this.convertedElements.findLane(i))||this.deserializeShapeAndStoreIfFound(s,e.pools,i=>this.convertedElements.findPoolById(i))||this.parsingMessageCollector.warning(new Gi(s.bpmnElement))}),e}deserializeShapeAndStoreIfFound(t,e,s){const i=this.deserializeShape(t,s);return i?(e.push(i),!0):!1}deserializeShape(t,e){const s=e(t.bpmnElement);if(s){const i=Ee.deserializeBounds(t);(s instanceof pe||s instanceof ue&&s.callActivityKind===ae.CALLING_PROCESS)&&!t.isExpanded&&s.markers.push(y.EXPAND);let o;I.isPoolOrLane(s.kind)&&(o=t.isHorizontal!==void 0?t.isHorizontal:!0);const r=this.deserializeLabel(t.BPMNLabel,t.id);return new fe(t.id,s,i,r,o)}}static deserializeBounds(t){const e=t.Bounds;if(e)return new $i(e.x,e.y,e.width,e.height)}deserializeEdges(t){return S(t).map(e=>{const s=this.convertedElements.findSequenceFlow(e.bpmnElement)||this.convertedElements.findMessageFlow(e.bpmnElement)||this.convertedElements.findAssociationFlow(e.bpmnElement);if(!s){this.parsingMessageCollector.warning(new Vi(e.bpmnElement));return}const i=this.deserializeWaypoints(e.waypoint),o=this.deserializeLabel(e.BPMNLabel,e.id),r=e.messageVisibleKind?e.messageVisibleKind:Q.NONE;return new Xi(e.id,s,i,o,r)}).filter(Boolean)}deserializeWaypoints(t){return S(t).map(e=>new Zi(e.x,e.y))}deserializeLabel(t,e){if(t&&typeof t=="object"){const s=this.findFont(t.labelStyle,e),i=Ee.deserializeBounds(t);if(s||i)return new ji(s,i)}}findFont(t,e){let s;return t&&(s=this.convertedFonts.get(t),s||this.parsingMessageCollector.warning(new Yi(e,t))),s}}class Ji{constructor(t){this.convertedElements=t}deserialize(t){ft.forEach(e=>{const s=t[e+"EventDefinition"];S(s,!0).forEach(i=>this.convertedElements.registerEventDefinitionsOfDefinition(i.id,e))})}}class Qi{constructor(t){this.convertedElements=t}deserialize(t){this.parseGlobalTasks(t.globalTask,h.GLOBAL_TASK),this.parseGlobalTasks(t.globalBusinessRuleTask,h.GLOBAL_TASK_BUSINESS_RULE),this.parseGlobalTasks(t.globalManualTask,h.GLOBAL_TASK_MANUAL),this.parseGlobalTasks(t.globalScriptTask,h.GLOBAL_TASK_SCRIPT),this.parseGlobalTasks(t.globalUserTask,h.GLOBAL_TASK_USER)}parseGlobalTasks(t,e){S(t).forEach(s=>this.convertedElements.registerGlobalTask(s.id,e))}}class eo{constructor(t){this.convertedElements=t}deserialize(t){S(t.category).forEach(e=>S(e.categoryValue).forEach(s=>this.convertedElements.registerCategoryValue(s.id,s.value)))}}class to{constructor(t,e,s,i,o,r){this.categoryConverter=t,this.collaborationConverter=e,this.eventDefinitionConverter=s,this.globalTaskConverter=i,this.processConverter=o,this.diagramConverter=r}parse(t){const e=t.definitions;return this.categoryConverter.deserialize(e),this.collaborationConverter.deserialize(e.collaboration),this.eventDefinitionConverter.deserialize(e),this.globalTaskConverter.deserialize(e),this.processConverter.deserialize(e.process),this.diagramConverter.deserialize(e.BPMNDiagram)}}function no(n){const t=new Hi;return new to(new eo(t),new Ki(t,n),new Ji(t),new Qi(t),new Di(t,n),new Ee(t,n))}class so{constructor(t,e){this.jsonParser=t,this.xmlParser=e}parse(t){const e=this.xmlParser.parse(t);return this.jsonParser.parse(e)}}function io(){return new so(no(new ki),new Mi)}class oo{constructor(){T(this,"classNamesByBPMNId",new Map)}clear(){this.classNamesByBPMNId.clear()}getClassNames(t){var e;return Array.from((e=this.classNamesByBPMNId.get(t))!=null?e:[])}addClassNames(t,e){return this.updateClassNames(t,e,(s,i)=>s.add(i))}removeClassNames(t,e){return this.updateClassNames(t,e,(s,i)=>s.delete(i))}toggleClassNames(t,e){return this.updateClassNames(t,e,(s,i)=>s.has(i)?s.delete(i):s.add(i)),e&&e.length>0}updateClassNames(t,e,s){const i=this.getOrInitializeClassNames(t),o=i.size;return S(e).forEach(r=>s(i,r)),i.size!=o}getOrInitializeClassNames(t){let e=this.classNamesByBPMNId.get(t);return e==null&&(e=new Set,this.classNamesByBPMNId.set(t,e)),e}}class ze{constructor(){T(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(t){const e=this.convertPosition(t),s=ze.convertStyle(t);return{position:e,style:s}}convertPosition(t){return this.overlayPositions.get(t.position)}static convertStyle(t){const e={fill:{color:m.DEFAULT_OVERLAY_FILL_COLOR.valueOf(),opacity:m.DEFAULT_OVERLAY_FILL_OPACITY.valueOf()},stroke:{color:m.DEFAULT_OVERLAY_STROKE_COLOR.valueOf(),width:m.DEFAULT_OVERLAY_STROKE_WIDTH.valueOf()},font:{color:m.DEFAULT_OVERLAY_FONT_COLOR.valueOf(),size:m.DEFAULT_OVERLAY_FONT_SIZE.valueOf()}},s=t.style,i={...e};return s&&(this.convertFill(i,s.fill),this.convertStroke(i,s.stroke),this.convertFont(i,s.font)),i}static convertFill(t,e){var s,i;e&&(t.fill.color=(s=e.color)!=null?s:t.fill.color,t.fill.opacity=(i=e.opacity)!=null?i:t.fill.opacity)}static convertStroke(t,e){var s,i;e&&(t.stroke.color=(s=e.color)!=null?s:t.stroke.color,t.stroke.width=(i=e.width)!=null?i:t.stroke.width)}static convertFont(t,e){var s,i;e&&(t.font.color=(s=e.color)!=null?s:t.font.color,t.font.size=(i=e.size)!=null?i:t.font.size)}}function ro(n){return new ao(n,new ze)}class ao{constructor(t,e){this.graph=t,this.overlayConverter=e}updateAndRefreshCssClassesOfCell(t,e){this.updateAndRefreshCssClassesOfElement(t,e),this.updateAndRefreshCssClassesOfElement(Nt(t),e)}updateAndRefreshCssClassesOfElement(t,e){var r;const s=this.graph.getModel().getCell(t);if(!s)return;const o=this.graph.getView().getState(s);o.style[E.EXTRA_CSS_CLASSES]=e,o.shape.redraw(),(r=o.text)==null||r.redraw()}addOverlays(t,e){const s=this.graph.getModel().getCell(t);!s||S(e).forEach(i=>{const o=new Tt(i.label,this.overlayConverter.convert(i));this.graph.addCellOverlay(s,o)})}removeAllOverlays(t){const e=this.graph.getModel().getCell(t);!e||this.graph.removeCellOverlays(e)}}class lo{constructor(t){this.containerId=t}element(t){return`#${this.containerId} > svg > g > g > g[data-bpmn-id="${t}"]`}elementsOfKind(t){return`#${this.containerId} > svg > g > g > g.${t}:not(.bpmn-label)`}}function co(n,t){var e;return new uo(n,new ho(new lo((e=t.container)==null?void 0:e.id)),new oo,ro(t))}class uo{constructor(t,e,s,i){this.bpmnModelRegistry=t,this.htmlElementRegistry=e,this.cssRegistry=s,this.graphCellUpdater=i,this.bpmnModelRegistry.registerOnLoadCallback(this.cssRegistry.clear.bind(this.cssRegistry))}getElementsByIds(t){return S(t).map(e=>this.bpmnModelRegistry.getBpmnSemantic(e)).filter(Boolean).map(e=>({bpmnSemantic:e,htmlElement:this.htmlElementRegistry.getBpmnHtmlElement(e.id)}))}getElementsByKinds(t){return S(t).map(e=>this.htmlElementRegistry.getBpmnHtmlElements(e).map(s=>({htmlElement:s,bpmnSemantic:this.bpmnModelRegistry.getBpmnSemantic(s.getAttribute("data-bpmn-id"))}))).reduce((e,s)=>(e.push(...s),e),[])}addCssClasses(t,e){this.updateCssClasses(t,e,this.cssRegistry.addClassNames.bind(this.cssRegistry))}removeCssClasses(t,e){this.updateCssClasses(t,e,this.cssRegistry.removeClassNames.bind(this.cssRegistry))}toggleCssClasses(t,e){this.updateCssClasses(t,e,this.cssRegistry.toggleClassNames.bind(this.cssRegistry))}updateCssClasses(t,e,s){const i=S(e);S(t).forEach(o=>this.updateCellIfChanged(s(o,i),o))}updateCellIfChanged(t,e){if(t){const s=this.cssRegistry.getClassNames(e);this.graphCellUpdater.updateAndRefreshCssClassesOfCell(e,s)}}addOverlays(t,e){this.graphCellUpdater.addOverlays(t,e)}removeAllOverlays(t){this.graphCellUpdater.removeAllOverlays(t)}}class ho{constructor(t){this.querySelectors=t}getBpmnHtmlElement(t){return document.querySelector(this.querySelectors.element(t))}getBpmnHtmlElements(t){const e=this.querySelectors.elementsOfKind(ye(t));return[...document.querySelectorAll(e)]}}class fo{filter(t,e){const s=[],i=[];if(S(e==null?void 0:e.pools).filter(g=>g&&Object.keys(g).length).forEach(g=>g.id?s.push(g.id):g.name&&i.push(g.name)),s.length==0&&i.length==0)return t;const{filteredPools:o,filteredPoolIds:r}=go(t,s,i),a=[...s,...r],{filteredLanes:c,filteredLaneIds:u,filteredFlowNodes:f,filteredFlowNodeIds:d}=wt(t.lanes,t.flowNodes,a),p=po(t.edges,[...a,...u,...d]);if(o.length==0&&c.length==0&&f.length==0&&p.length==0){let g=s.length>0?` for ids [${s}]`:"";const A=g?" and":"";throw g+=i.length>0?`${A} for names [${i}]`:"",new Error("No matching pools"+g)}return{lanes:c,flowNodes:f,pools:o,edges:p}}}function go(n,t,e){const s=n.pools.filter(o=>t.includes(o.bpmnElement.id)||e.includes(o.bpmnElement.name)),i=s.map(o=>o.bpmnElement.id);return{filteredPools:s,filteredPoolIds:i}}function wt(n,t,e){const{filteredLanes:s,filteredLaneIds:i}=Rt(n,e),{filteredLanes:o,filteredLaneIds:r,filteredFlowNodes:a,filteredFlowNodeIds:c}=To(t,[...e,...i],n);return s.push(...o),i.push(...r),{filteredLanes:s,filteredLaneIds:i,filteredFlowNodes:a,filteredFlowNodeIds:c}}function Rt(n,t){const e=n.filter(i=>t.includes(i.bpmnElement.parentId)),s=e.map(i=>i.bpmnElement.id);if(e.length>0){const{filteredLanes:i,filteredLaneIds:o}=Rt(n,s);e.push(...i),s.push(...o)}return{filteredLanes:e,filteredLaneIds:s}}function To(n,t,e){const s=n.filter(u=>t.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:a,filteredFlowNodeIds:c}=wt(e,n,i);return s.push(...a),i.push(...c),{filteredLanes:o,filteredLaneIds:r,filteredFlowNodes:s,filteredFlowNodeIds:i}}function po(n,t){return n.filter(e=>t.includes(e.bpmnElement.sourceRefId)&&t.includes(e.bpmnElement.targetRefId))}class Eo{constructor(){T(this,"searchableModel");T(this,"onLoadCallback")}load(t,e){var i;const s=new fo().filter(t,e);return this.searchableModel=new Co(s),(i=this.onLoadCallback)==null||i.call(this),mo(s)}registerOnLoadCallback(t){this.onLoadCallback=t}getBpmnSemantic(t){const e=this.searchableModel.elementById(t);if(!e)return;const s=e.bpmnElement,i=s instanceof G;return{id:t,name:s.name,isShape:i,kind:s.kind}}}function mo(n){const t=n.flowNodes.filter(o=>{const r=o.bpmnElement;return I.isSubProcess(r.kind)&&r.markers.includes(y.EXPAND)}).map(o=>o.bpmnElement.id),e=[],s=[],i=[];return n.flowNodes.forEach(o=>{const r=o.bpmnElement.kind;I.isSubProcess(r)?e.push(o):I.isBoundaryEvent(r)?s.push(o):t.includes(o.bpmnElement.parentId)||i.push(o)}),{boundaryEvents:s,edges:n.edges,lanes:n.lanes,otherFlowNodes:i,pools:n.pools,subprocesses:e}}class Co{constructor(t){T(this,"elements",new Map);[].concat(t.pools,t.lanes,t.flowNodes,t.edges).forEach(e=>this.elements.set(e.bpmnElement.id,e))}elementById(t){return this.elements.get(t)}}function So(n){return n instanceof HTMLElement?n:document.getElementById(n)}class Io{constructor(t){this.graph=t}fit(t){this.graph.customFit(t)}zoom(t){t=="in"?this.graph.zoomIn():this.graph.zoomOut()}}const Ao="0.26.1",No=()=>({lib:Ao,dependencies:new Map([["mxGraph",l.mxClient.VERSION]])});class vo{constructor(t){T(this,"graph");T(this,"navigation");T(this,"bpmnElementsRegistry");T(this,"bpmnModelRegistry");const e=new us(So(t==null?void 0:t.container));this.graph=e.configure(t),this.navigation=new Io(this.graph),this.bpmnModelRegistry=new Eo,this.bpmnElementsRegistry=co(this.bpmnModelRegistry,this.graph)}load(t,e){const s=io().parse(t),i=this.bpmnModelRegistry.load(s,e==null?void 0:e.modelFilter);fs(this.graph).render(i,e==null?void 0:e.fit)}fit(t){this.navigation.fit(t)}getVersion(){return No()}}const Lo=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 Oo extends vo{configureTheme(t){var f,d;if(t=="default")return new ce(this.graph).configureStyles(),!0;const e=Lo.get(t);if(!e)return!1;const s=this.graph.getStylesheet();I.eventKinds().forEach(p=>{var P;let g,A;switch(p){case"endEvent":g=e.endEventFillColor,A=e.endEventStrokeColor;break;case"startEvent":g=e.startEventFillColor,A=e.startEventStrokeColor;break;case"intermediateCatchEvent":case"intermediateThrowEvent":case"boundaryEvent":g=e.defaultFillColor,A=(P=e.catchAndThrowEventStrokeColor)!=null?P:e.defaultStrokeColor;break;default:g=e.defaultFillColor,A=e.defaultStrokeColor;break}const N=s.styles[p];N.fillColor=g,N.strokeColor=A}),I.taskKinds().forEach(p=>{const g=s.styles[p];g.fillColor=e.taskAndCallActivityFillColor});const i=s.styles[h.CALL_ACTIVITY];i.fillColor=e.taskAndCallActivityFillColor;const o=s.styles[h.TEXT_ANNOTATION];o.fillColor=(f=e.textAnnotationFillColor)!=null?f:m.TEXT_ANNOTATION_FILL_COLOR;const r=s.styles[h.POOL];r.fillColor=e.poolFillColor,r.swimlaneFillColor=e.defaultFillColor;const a=s.styles[h.LANE];a.fillColor=e.laneFillColor;const c=s.getDefaultVertexStyle();c.fontColor=e.defaultFontColor,c.fillColor=e.defaultFillColor,c.strokeColor=e.defaultStrokeColor;const u=s.getDefaultEdgeStyle();return u.fontColor=e.defaultFontColor,u.fillColor=e.defaultFillColor,u.strokeColor=(d=e.flowColor)!=null?d:e.defaultStrokeColor,!0}configureSequenceFlowColor(t){Y(`Use dedicated ${t} color for sequence flows`);const s=this.graph.getStylesheet().styles[k.SEQUENCE_FLOW];s[l.mxConstants.STYLE_STROKECOLOR]=t,s[l.mxConstants.STYLE_FILLCOLOR]=t,Y("Sequence flows style updated")}}let O,W={},$e,Xe;function Bo(n){L("Updating load options",n),W.fit=n,L("Load options updated!",Fe(W))}function Go(){return{...W}}function Vo(){return Xe}function Yo(n){L("Switching theme from %s to %s",Xe,n),O.configureTheme(n)&&(O.graph.refresh(),L("Theme switch done"))}function xt(n){L("Loading bpmn...");try{O.load(n,W),L("BPMN loaded with configuration",Fe(W)),_o($e),document.dispatchEvent(new CustomEvent("diagramLoaded"))}catch(t){Me(t,`Cannot load the BPMN diagram: ${t.message}`)}}function Uo(n){L("Fitting..."),O.navigation.fit(n),L("Fit done with configuration",Fe(n))}function Wo(n){L(`Zooming '${n}'...`),O.navigation.zoom(n),L("Zoom done")}function Ho(n){return O.bpmnElementsRegistry.getElementsByKinds(n)}function Ko(n,t){return O.bpmnElementsRegistry.addCssClasses(n,t)}function Do(n,t){return O.bpmnElementsRegistry.removeCssClasses(n,t)}function zo(n,t){return O.bpmnElementsRegistry.addOverlays(n,[t])}function $o(n){return O.bpmnElementsRegistry.removeAllOverlays(n)}function _o(n){if(!$e)return;L("Updating model, bpmnElement to collapse:",n);const t=O.graph.getModel(),e=t.getCell(n);if(!e)L("Element not found in the model, do nothing");else{t.beginUpdate();try{t.setCollapsed(e,!0)}finally{t.endUpdate()}L("Model updated")}}function Ft(n){const t=new FileReader;t.onload=()=>{xt(t.result)},t.readAsText(n)}function Xo(n){const t=n.target.files[0];Ft(t)}function yo(n,t){Bt(n).catch(e=>{const s=`Unable to fetch ${n}. ${e}`;throw t(s),new Error(s)}).then(e=>(L("BPMN content fetched"),e)).then(e=>{xt(e),L(`Bpmn loaded from url ${n}`)}).catch(()=>{})}function bo(n){Me(n)}function wo(n,t){var o;const e=((o=n.loadOptions)==null?void 0:o.fit)||{},s=t.get("fitTypeOnLoad");s&&(e.type=s);const i=t.get("fitMargin");return i&&(e.margin=Number(i)),e}function Ro(n){if(n.get("style.container.alternative.background.color")=="true"){const o="yellow";Y("Use alternative color for the bpmn container background, color",o);const r=O.graph.container;r.style.backgroundColor=o,Y("Bpmn container style updated")}const e=n.get("style.theme");Y(`Configuring the '${e}' BPMN theme`),O.configureTheme(e)?(Xe=e,Y(`'${e}' BPMN theme configured`)):Y(`Unknown '${e}' BPMN theme, skipping configuration`),n.get("style.seqFlow.light.colors")=="true"&&O.configureSequenceFlowColor("#E9E9E9")}function xo(n){$e=n.get("bpmn.element.id.collapsed")}function Fo(n){const t=n.get("bpmn.filter.pool.ids");if(!t)return;const e=t.split(",");return L("Configuring load options to only include pool id: ",e),{pools:e.map(s=>({id:s}))}}function Zo(n){const t=Y,e=n.globalOptions.container;t(`Initializing BpmnVisualization with container '${e}'...`),O=new Oo(n.globalOptions),t("Initialization completed"),new Gt(window,"drop-container",e,Ft),t("Drag&Drop support initialized");const s=new URLSearchParams(window.location.search);t("Configuring Load Options"),W=n.loadOptions||{},W.fit=wo(n,s),W.modelFilter=Fo(s),Ro(s),xo(s),t("Checking if an 'url to fetch BPMN content' is provided as query parameter");const i=s.get("url");if(i){const o=decodeURIComponent(i),r=n.statusFetchKoNotifier||bo;yo(o,r);return}t("No 'url to fetch BPMN content' provided")}function jo(){q("Trigger SVG Download"),Ut(new dt(O.graph).exportSvg())}function qo(){q("Trigger PNG Download"),Wt(new dt(O.graph).exportSvgForPng())}function Jo(){const n=O.getVersion();return L("Version:",n),n}export{re as F,I as S,Ht as Z,Yo as a,Jo as b,Vo as c,ko as d,$o as e,Uo as f,Go as g,Xo as h,jo as i,qo as j,Ho as k,L as l,Ko as m,zo as n,Do as r,Zo as s,Bo as u,Wo as z};
diff --git a/demo/monitoring-all-process-instances/index.html b/demo/monitoring-all-process-instances/index.html
index fc87854b..dd871218 100644
--- a/demo/monitoring-all-process-instances/index.html
+++ b/demo/monitoring-all-process-instances/index.html
@@ -25,7 +25,7 @@
-
+
diff --git a/demo/predictions/index.html b/demo/predictions/index.html
index 61da41ed..c66238a6 100644
--- a/demo/predictions/index.html
+++ b/demo/predictions/index.html
@@ -24,7 +24,7 @@
-
+
diff --git a/examples/custom-behavior/apply-css-classes/index.html b/examples/custom-behavior/apply-css-classes/index.html
index dab0371f..b22070a7 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 25e6691e..ef930ae6 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 b9f2dfb0..48fa6a8e 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 54992e3d..f99716ac 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 cb392b9d..2e124b3d 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 d2c40d09..f5f1d7ba 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 e329e459..cb558b2d 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 233bf235..996c8d35 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 9fedfef2..a6da073f 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 d185e97d..4301800b 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 6972ecfd..62b4a08a 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 861a27bb..aa2615a9 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 7fedc168..cc004d1f 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 fe7f88b2..714f2017 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 28d34387..f4c6e363 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/01-getting-started/README.md b/examples/display-bpmn-diagram/01-getting-started/README.md
index 7c52ffd6..5d454fe0 100644
--- a/examples/display-bpmn-diagram/01-getting-started/README.md
+++ b/examples/display-bpmn-diagram/01-getting-started/README.md
@@ -10,12 +10,12 @@ Javascript example to demonstrate how to integrate `bpmn-visualization` in an ht
Load the browser bundle from [jsdelivr](https://www.jsdelivr.com/package/npm/bpmn-visualization), [unpkg](https://unpkg.com/browse/bpmn-visualization)
or any other location:
```html
-
+
```
💡 During the development step, you can use the non-minified version:
```html
-
+
```
### Use the library
diff --git a/examples/display-bpmn-diagram/01-getting-started/index.html b/examples/display-bpmn-diagram/01-getting-started/index.html
index b33db549..08965ccf 100644
--- a/examples/display-bpmn-diagram/01-getting-started/index.html
+++ b/examples/display-bpmn-diagram/01-getting-started/index.html
@@ -22,9 +22,9 @@
-
+
-
+
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 4a81656c..45769d36 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 c68b52ba..a1ecf37f 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 9d43e079..7409fc7c 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 ff25cbaf..8cbdcab6 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 6d4b17c2..b22c04af 100644
--- a/examples/misc/compare-with-kie-editors-standalone/index.html
+++ b/examples/misc/compare-with-kie-editors-standalone/index.html
@@ -60,7 +60,7 @@
-
+
diff --git a/examples/overlays/add-remove/index.html b/examples/overlays/add-remove/index.html
index 2664f8b8..db978966 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 a4abae2a..4df5e358 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 27c292aa..a9d70a5b 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 60da28d9..4c7dc5e4 100644
--- a/projects/javascript-vanilla-with-webpack/package.json
+++ b/projects/javascript-vanilla-with-webpack/package.json
@@ -11,7 +11,7 @@
"serve": "webpack serve"
},
"dependencies": {
- "bpmn-visualization": "0.26.0"
+ "bpmn-visualization": "0.26.1"
},
"devDependencies": {
"html-webpack-plugin": "~5.5.0",
diff --git a/projects/typescript-vanilla-with-parcel/package.json b/projects/typescript-vanilla-with-parcel/package.json
index 0ebcd876..f74b660e 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 index.html"
},
"dependencies": {
- "bpmn-visualization": "0.26.0"
+ "bpmn-visualization": "0.26.1"
},
"devDependencies": {
"@parcel/transformer-inline-string": "~2.7.0",
diff --git a/projects/typescript-vanilla-with-rollup/package.json b/projects/typescript-vanilla-with-rollup/package.json
index 4252d928..f46f6071 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.26.0"
+ "bpmn-visualization": "0.26.1"
},
"devDependencies": {
"@rollup/plugin-commonjs": "~22.0.2",
diff --git a/projects/typescript-vanilla-with-vitejs/package.json b/projects/typescript-vanilla-with-vitejs/package.json
index 8f1f2bdb..4d3514ef 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.26.0"
+ "bpmn-visualization": "0.26.1"
},
"devDependencies": {
"typescript": "~4.7.4",