@sentropic/design-system-elements 0.2.0 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. package/LICENSE.THIRD-PARTY.md +44 -1
  2. package/README.md +81 -13
  3. package/catalog.json +401 -7
  4. package/dist/browser/chunks/{Modeler-BfAmwsmK.js → Modeler-D87tL_OJ.js} +4 -4
  5. package/dist/browser/chunks/Viewer-D9zjRrp2.js +4 -0
  6. package/dist/browser/chunks/bpmn-canvas-BevbP_6a.js +1 -0
  7. package/dist/browser/chunks/bpmn-mount-BhO_zb0S.js +2202 -0
  8. package/dist/browser/chunks/dist-DRauAwm2.js +6 -0
  9. package/dist/browser/chunks/{entropic-CM5BHERN.js → entropic-MwNVEq6w.js} +639 -0
  10. package/dist/browser/chunks/focus-renderer-BWm7DlQD.js +55 -0
  11. package/dist/browser/chunks/{forge-B8hrW4lA.js → forge-CzwO8Hbe.js} +639 -0
  12. package/dist/browser/chunks/layout-T3X333Za.js +1 -0
  13. package/dist/browser/elements.js +671 -6
  14. package/dist/browser/sri.json +52 -45
  15. package/dist/contracts/bar-chart.js +2 -2
  16. package/dist/contracts/decision-dossier.d.ts +4 -8
  17. package/dist/contracts/decision-dossier.js +8 -12
  18. package/dist/contracts/index.d.ts +1 -0
  19. package/dist/contracts/index.js +2 -0
  20. package/dist/contracts/time-series-chart.d.ts +49 -0
  21. package/dist/contracts/time-series-chart.js +37 -0
  22. package/dist/dossier/dossier-mount.js +845 -0
  23. package/dist/dossier/renderer/dossier.css +2 -0
  24. package/dist/element/bpmn-mount.d.ts +11 -0
  25. package/dist/element/bpmn-mount.js +56 -0
  26. package/dist/element/bpmn-types.d.ts +27 -0
  27. package/dist/element/bpmn-types.js +12 -0
  28. package/dist/element/bpmn.d.ts +10 -0
  29. package/dist/element/bpmn.js +39 -0
  30. package/dist/element/dom/dossier-mount.d.ts +25 -0
  31. package/dist/element/dom/dossier-review-mount.d.ts +25 -0
  32. package/dist/element/dom/dossier-review-state.svelte.d.ts +13 -0
  33. package/dist/element/dom/engines/bpmn-canvas.d.ts +11 -0
  34. package/dist/element/dom/engines/bpmn-canvas.js +11 -0
  35. package/dist/element/dom/engines/dossier-diagrams.d.ts +5 -0
  36. package/dist/element/dom/engines/dossier-evidence.d.ts +9 -0
  37. package/dist/element/dom/engines/dossier-styles.d.ts +21 -0
  38. package/dist/element/dom/engines/focus-renderer.d.ts +60 -0
  39. package/dist/element/dom/engines/focus-snapshot.d.ts +3 -0
  40. package/dist/element/dom/intents.d.ts +20 -0
  41. package/dist/element/markdown/minimal-markdown.d.ts +1 -2
  42. package/dist/element/markdown/minimal-markdown.js +19 -1
  43. package/dist/element/validator.d.ts +26 -0
  44. package/dist/element/validator.js +54 -0
  45. package/dist/focus-diagrams/diagram-layout.d.ts +140 -0
  46. package/dist/focus-diagrams/diagram-layout.js +190 -0
  47. package/dist/focus-diagrams/diagram-source.d.ts +11 -0
  48. package/dist/focus-diagrams/diagram-source.js +147 -0
  49. package/dist/focus-diagrams/dossier-views.d.ts +21 -0
  50. package/dist/focus-diagrams/dossier-views.js +57 -0
  51. package/dist/focus-diagrams/ecosystem.json +853 -0
  52. package/dist/focus-kit/index.html +13 -0
  53. package/dist/focus-kit/renderer/dossier.css +2 -0
  54. package/dist/focus-kit/renderer/dossier.js +845 -0
  55. package/dist/focus-kit-manifest.json +1 -0
  56. package/dist/focus-kit.d.ts +9 -0
  57. package/dist/focus-kit.js +30 -0
  58. package/dist/format-time-series-markdown.d.ts +5 -0
  59. package/dist/format-time-series-markdown.js +24 -0
  60. package/dist/generator/parity.js +6 -1
  61. package/dist/index.d.ts +2 -0
  62. package/dist/index.js +1 -0
  63. package/dist/ports/dossier-views.d.ts +3 -0
  64. package/dist/ports/dossier-views.js +3 -0
  65. package/dist/ports/focus.d.ts +0 -1
  66. package/dist/ports/types.d.ts +0 -1
  67. package/dist/shells/BarChart.html +8494 -0
  68. package/dist/shells/BarChart.js +8482 -0
  69. package/dist/shells/DecisionDossier.html +8502 -0
  70. package/dist/shells/DecisionDossier.js +8490 -0
  71. package/dist/shells/TimeSeriesChart.html +8475 -0
  72. package/dist/shells/TimeSeriesChart.js +8463 -0
  73. package/dist/shells/manifest.json +108 -0
  74. package/dist/structure/interpreter.d.ts +1 -1
  75. package/dist/structure/interpreter.js +14 -4
  76. package/dist/time-series.d.ts +13 -0
  77. package/dist/time-series.js +15 -0
  78. package/dist/validate/envelope.js +5 -1
  79. package/dist/validate/time-series.d.ts +5 -0
  80. package/dist/validate/time-series.js +28 -0
  81. package/fixtures/time-series-multi.json +46 -0
  82. package/fixtures/time-series-single.json +28 -0
  83. package/fixtures/time-series-thresholds.json +52 -0
  84. package/package.json +40 -6
  85. package/schemas/BarChart.v1.json +2 -2
  86. package/schemas/DecisionDossier.v1.json +155 -5
  87. package/schemas/TimeSeriesChart.v1.json +287 -0
  88. package/skill/SKILL.md +27 -0
  89. package/dist/browser/chunks/Viewer-eYLzc3fD.js +0 -4
  90. package/dist/browser/chunks/bpmn-canvas-DeAWdJFy.js +0 -2207
  91. package/dist/browser/chunks/dist-O6_2ByYB.js +0 -1
  92. package/dist/browser/chunks/focus-renderer-0elVToA2.js +0 -10
  93. package/dist/browser/chunks/layout-q0TR9-aY.js +0 -1
@@ -0,0 +1,4 @@
1
+ import{t as e}from"./dist-DRauAwm2.js";import{C as t,S as n,T as r,_ as i,a,f as o,g as s,i as c,l,m as u,n as d,o as f,p,r as m,t as h,u as g,v as _,x as v,y}from"./dist-Co2MgHWm.js";import{i as ee,n as te,r as b,t as x}from"./ModelUtil-CMh7LuN4.js";import{i as ne,n as re,s as ie,t as S,u as C}from"./LabelUtil-7QpE43Ed.js";import{a as ae,n as oe,t as w}from"./LayoutUtil-hAMJmJFU.js";import{c as T,l as se,m as ce,n as E,o as D,p as le,r as O,s as ue,t as k,u as A}from"./dist-kvAYI1vo.js";import{D as de,N as fe,O as pe,P as j,_ as me,a as M,c as he,d as N,f as ge,g as _e,h as ve,i as ye,j as be,k as xe,l as Se,m as P,n as Ce,o as F,p as we,r as Te,s as Ee,t as De,u as I,v as Oe,y as ke}from"./BpmnRenderUtil-WMCgqGDs.js";function Ae(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}var je={exports:{}},Me;function Ne(){if(Me)return je.exports;Me=1;var e=je.exports=function(t,n){if(n||=16,t===void 0&&(t=128),t<=0)return`0`;for(var r=Math.log(2**t)/Math.log(n),i=2;r===1/0;i*=2)r=Math.log(2**(t/i))/Math.log(n)*i;for(var a=r-Math.floor(r),o=``,i=0;i<Math.floor(r);i++){var s=Math.floor(Math.random()*n).toString(n);o=s+o}if(a){var c=n**+a,s=Math.floor(Math.random()*c).toString(n);o=s+o}var l=parseInt(o,n);return l!==1/0&&l>=2**t?e(t,n):o};return e.rack=function(t,n,r){var i=function(i){var o=0;do{if(o++>10){if(r)t+=r;else throw Error(`too many ID collisions, use more bits`)}var s=e(t,n)}while(Object.hasOwnProperty.call(a,s));return a[s]=i,s},a=i.hats={};return i.get=function(e){return i.hats[e]},i.set=function(e,t){return i.hats[e]=t,i},i.bits=t||128,i.base=n||16,i},je.exports}var Pe=Ae(Ne());function L(e){if(!(this instanceof L))return new L(e);e||=[128,36,1],this._seed=e.length?Pe.rack(e[0],e[1],e[2]):e}L.prototype.next=function(e){return this._seed(e||!0)},L.prototype.nextPrefixed=function(e,t){var n;do n=e+this.next(!0);while(this.assigned(n));return this.claim(n,t),n},L.prototype.claim=function(e,t){this._seed.set(e,t||!0)},L.prototype.assigned=function(e){return this._seed.get(e)||!1},L.prototype.unclaim=function(e){delete this._seed.hats[e]},L.prototype.clear=function(){var e=this._seed.hats,t;for(t in e)this.unclaim(t)};var R={legend:[1,`<fieldset>`,`</fieldset>`],tr:[2,`<table><tbody>`,`</tbody></table>`],col:[2,`<table><tbody></tbody><colgroup>`,`</colgroup></table>`],_default:[0,``,``]};R.td=R.th=[3,`<table><tbody><tr>`,`</tr></tbody></table>`],R.option=R.optgroup=[1,`<select multiple="multiple">`,`</select>`],R.thead=R.tbody=R.colgroup=R.caption=R.tfoot=[1,`<table>`,`</table>`],R.polyline=R.ellipse=R.polygon=R.circle=R.text=R.line=R.path=R.rect=R.g=[1,`<svg xmlns="http://www.w3.org/2000/svg" version="1.1">`,`</svg>`];function z(e,t=globalThis.document){if(typeof e!=`string`)throw TypeError(`String expected`);let n=/^<!--(.*?)-->$/s.exec(e);if(n)return t.createComment(n[1]);let r=/<([\w:]+)/.exec(e)?.[1];if(!r)return t.createTextNode(e);if(e=e.trim(),r===`body`){let n=t.createElement(`html`);n.innerHTML=e;let{lastChild:r}=n;return r.remove(),r}let[i,a,o]=Object.hasOwn(R,r)?R[r]:R._default,s=t.createElement(`div`);for(s.innerHTML=a+e+o;i--;)s=s.lastChild;if(s.firstChild===s.lastChild){let{firstChild:e}=s;return e.remove(),e}let c=t.createDocumentFragment();return c.append(...s.childNodes),c}function Fe(e,t){return t.forEach(function(t){t&&typeof t!=`string`&&!Array.isArray(t)&&Object.keys(t).forEach(function(n){if(n!=="default"&&!(n in e)){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}})}),Object.freeze(e)}function B(e,...t){let n=e.style;return l(t,function(e){e&&l(e,function(e,t){n[t]=e})}),e}function Ie(e,t,n){return arguments.length==2?e.getAttribute(t):n===null?e.removeAttribute(t):(e.setAttribute(t,n),e)}var Le=Object.prototype.toString;function Re(e){return new ze(e)}function ze(e){if(!e||!e.nodeType)throw Error(`A DOM element reference is required`);this.el=e,this.list=e.classList}ze.prototype.add=function(e){return this.list.add(e),this},ze.prototype.remove=function(e){return Le.call(e)==`[object RegExp]`?this.removeMatching(e):(this.list.remove(e),this)},ze.prototype.removeMatching=function(e){let t=this.array();for(let n=0;n<t.length;n++)e.test(t[n])&&this.remove(t[n]);return this},ze.prototype.toggle=function(e,t){return(t===void 0||t!==this.list.toggle(e,t))&&this.list.toggle(e),this},ze.prototype.array=function(){return Array.from(this.list)},ze.prototype.has=ze.prototype.contains=function(e){return this.list.contains(e)};function Be(e){for(var t;t=e.firstChild;)e.removeChild(t);return e}function Ve(e,t,n){var r=n?e:e.parentNode;return r&&typeof r.closest==`function`&&r.closest(t)||null}function He(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}var Ue={},We;function Ge(){if(We)return Ue;We=1;var e,t,n;function r(){e=window.addEventListener?`addEventListener`:`attachEvent`,t=window.removeEventListener?`removeEventListener`:`detachEvent`,n=e===`addEventListener`?``:`on`}return Ue.bind=function(t,i,a,o){return e||r(),t[e](n+i,a,o||!1),a},Ue.unbind=function(e,i,a,o){return t||r(),e[t](n+i,a,o||!1),a},Ue}var Ke=Ge(),qe=Fe({__proto__:null,default:He(Ke)},[Ke]),Je=[`focus`,`blur`];function Ye(e,t,n,r,i){return Je.indexOf(n)!==-1&&(i=!0),qe.bind(e,n,function(n){n.delegateTarget=Ve(n.target||n.srcElement,t,!0),n.delegateTarget&&r.call(e,n)},i)}function Xe(e,t,n,r){return Je.indexOf(t)!==-1&&(r=!0),qe.unbind(e,t,n,r)}var Ze={bind:Ye,unbind:Xe};function Qe(e,t){return e&&typeof e.matches==`function`&&e.matches(t)||!1}function V(e,t){return t||=document,t.querySelector(e)}function $e(e,t){return t||=document,t.querySelectorAll(e)}function et(e){e.parentNode&&e.parentNode.removeChild(e)}var tt=/^class[ {]/;function nt(e){return tt.test(e.toString())}function rt(e){return Array.isArray(e)}function it(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function at(...e){e.length===1&&rt(e[0])&&(e=e[0]),e=[...e];let t=e.pop();return t.$inject=e,t}var ot=/constructor\s*[^(]*\(\s*([^)]*)\)/m,st=/^(?:async\s+)?(?:function\s*[^(]*)?(?:\(\s*([^)]*)\)|(\w+))/m,ct=/\/\*([^*]*)\*\//m;function lt(e){if(typeof e!=`function`)throw Error(`Cannot annotate "${e}". Expected a function!`);let t=e.toString().match(nt(e)?ot:st);if(!t)return[];let n=t[1]||t[2];return n&&n.split(`,`).map(e=>{let t=e.match(ct);return(t&&t[1]||e).trim()})||[]}function ut(e,t){let n=t||{get:function(e,t){if(t===!1)return null;throw r.push(e),s(`No provider for "${e}"!`)}},r=[],i=this._providers=Object.create(n._providers||null),a=this._instances=Object.create(null),o=a.injector=this,s=function(e){let t=r.join(` -> `);return r.length=0,Error(t?`${e} (Resolving: ${t})`:e)};function c(e,t){if(!i[e]&&e.includes(`.`)){let t=e.split(`.`),n=c(t.shift());for(;t.length;)n=n[t.shift()];return n}if(it(a,e))return a[e];if(it(i,e)){if(r.indexOf(e)!==-1)throw r.push(e),s(`Cannot resolve circular dependency!`);return r.push(e),a[e]=i[e][0](i[e][1]),r.pop(),a[e]}return n.get(e,t)}function l(e,t){if(t===void 0&&(t={}),typeof e!=`function`){if(rt(e))e=at(e.slice());else throw s(`Cannot invoke "${e}". Expected a function!`)}let n=(e.$inject||lt(e)).map(e=>it(t,e)?t[e]:c(e));return{fn:e,dependencies:n}}function u(e){let{fn:t,dependencies:n}=l(e);return new(Function.prototype.bind.call(t,null,...n))}function d(e,t,n){let{fn:r,dependencies:i}=l(e,n);return r.apply(t,i)}function f(e){return at(t=>e.get(t))}function p(e,t){if(t&&t.length){let n=Object.create(null),r=Object.create(null),a=[],o=[],s=[],c,l,u,d;for(let e in i)c=i[e],t.indexOf(e)!==-1&&(c[2]===`private`?(l=a.indexOf(c[3]),l===-1?(u=c[3].createChild([],t),d=f(u),a.push(c[3]),o.push(u),s.push(d),n[e]=[d,e,`private`,u]):n[e]=[s[l],e,`private`,o[l]]):n[e]=[c[2],c[1]],r[e]=!0),(c[2]===`factory`||c[2]===`type`)&&c[1].$scope&&t.forEach(t=>{c[1].$scope.indexOf(t)!==-1&&(n[e]=[c[2],c[1]],r[t]=!0)});t.forEach(e=>{if(!r[e])throw Error(`No provider for "`+e+`". Cannot use provider from the parent!`)}),e.unshift(n)}return new ut(e,o)}let m={factory:d,type:u,value:function(e){return e}};function h(e,t){let n=e.__init__||[];return function(){n.forEach(e=>{typeof e==`string`?t.get(e):t.invoke(e)})}}function g(e){let t=e.__exports__;if(t){let n=e.__modules__,r=Object.keys(e).reduce((t,n)=>(n!==`__exports__`&&n!==`__modules__`&&n!==`__init__`&&n!==`__depends__`&&(t[n]=e[n]),t),Object.create(null)),a=p((n||[]).concat(r)),o=at(function(e){return a.get(e)});t.forEach(function(e){i[e]=[o,e,`private`,a]});let s=(e.__init__||[]).slice();return s.unshift(function(){a.init()}),e=Object.assign({},e,{__init__:s}),h(e,a)}return Object.keys(e).forEach(function(t){if(t===`__init__`||t===`__depends__`)return;let n=e[t];if(n[2]===`private`){i[t]=n;return}let r=n[0],a=n[1];i[t]=[m[r],dt(r,a),r]}),h(e,o)}function _(e,t){return e.indexOf(t)!==-1||(e=(t.__depends__||[]).reduce(_,e),e.indexOf(t)!==-1)?e:e.concat(t)}function v(e){let t=e.reduce(_,[]).map(g),n=!1;return function(){n||(n=!0,t.forEach(e=>e()))}}this.get=c,this.invoke=d,this.instantiate=u,this.createChild=p,this.init=v(e)}function dt(e,t){return e!==`value`&&rt(t)&&(t=at(t.slice())),t}function ft(e){var t=new Set(e);return a(e,function(e){for(var n=e.parent;n;){if(t.has(n))return!1;n=n.parent}return!0})}function pt(e,t,n){n||=0,o(e)||(e=[e]),l(e,function(e,r){var i=t(e,r,n);o(i)&&i.length&&pt(i,t,n+1)})}function mt(e,t,n){var r=new Set,i=new Set;return pt(e,function(e,t,a){r.add(e);var o=e.children;if((n===-1||a<n)&&o&&!i.has(o))return i.add(o),o}),Array.from(r)}function ht(e,t){return mt(e,!0,-1)}function gt(e,t,n){y(t)&&(t=!0),i(t)&&(n=t,t=!0),n||={};var r=xt(n.allShapes),a=xt(n.allConnections),o=xt(n.enclosedElements),s=xt(n.enclosedConnections),c=xt(n.topLevel,t&&g(e,function(e){return e.id}));function u(e){c[e.source.id]&&c[e.target.id]&&(c[e.id]=[e]),r[e.source.id]&&r[e.target.id]&&(s[e.id]=o[e.id]=e),a[e.id]=e}function d(e){if(o[e.id]=e,e.waypoints)s[e.id]=a[e.id]=e;else return r[e.id]=e,l(e.incoming,u),l(e.outgoing,u),e.children}return pt(e,d),{allShapes:r,allConnections:a,topLevel:c,enclosedConnections:s,enclosedElements:o}}function _t(e,t){t=!!t,o(e)||(e=[e]);var n,r,i,a;return l(e,function(e){var o=e;e.waypoints&&!t&&(o=_t(e.waypoints,!0));var s=o.x,c=o.y,l=o.height||0,u=o.width||0;(s<n||n===void 0)&&(n=s),(c<r||r===void 0)&&(r=c),(s+u>i||i===void 0)&&(i=s+u),(c+l>a||a===void 0)&&(a=c+l)}),{x:n,y:r,height:a-r,width:i-n}}function vt(e,t){var n={};return l(e,function(e){var r=e;r.waypoints&&(r=_t(r)),!s(t.y)&&r.x>t.x&&(n[e.id]=e),!s(t.x)&&r.y>t.y&&(n[e.id]=e),r.x>t.x&&r.y>t.y&&(s(t.width)&&s(t.height)&&r.width+r.x<t.width+t.x&&r.height+r.y<t.height+t.y||!s(t.width)||!s(t.height))&&(n[e.id]=e)}),n}function yt(e){return`waypoints`in e?`connection`:`x`in e?`shape`:`root`}function bt(e){return!!(e&&e.isFrame)}function xt(e,t){return h({},e||{},t||{})}var St=1;function Ct(e,t){ce.call(this,e,St),this.CONNECTION_STYLE=t.style([`no-fill`],{strokeWidth:5,stroke:`fuchsia`}),this.SHAPE_STYLE=t.style({fill:`white`,stroke:`fuchsia`,strokeWidth:2}),this.FRAME_STYLE=t.style([`no-fill`],{stroke:`fuchsia`,strokeDasharray:4,strokeWidth:2})}j(Ct,ce),Ct.prototype.canRender=function(){return!0},Ct.prototype.drawShape=function(e,t,n){var r=D(`rect`);return E(r,{x:0,y:0,width:t.width||0,height:t.height||0}),bt(t)?E(r,h({},this.FRAME_STYLE,n||{})):E(r,h({},this.SHAPE_STYLE,n||{})),k(e,r),r},Ct.prototype.drawConnection=function(e,t,n){var r=_e(t.waypoints,h({},this.CONNECTION_STYLE,n||{}));return k(e,r),r},Ct.prototype.getShapePath=function(e){var t=e.x,n=e.y,r=e.width,i=e.height,a=[[`M`,t,n],[`l`,r,0],[`l`,0,i],[`l`,-r,0],[`z`]];return ve(a)},Ct.prototype.getConnectionPath=function(e){var t=e.waypoints,n,r,i=[];for(n=0;r=t[n];n++)r=r.original||r,i.push([n===0?`M`:`L`,r.x,r.y]);return ve(i)},Ct.$inject=[`eventBus`,`styles`];function wt(){var e={"no-fill":{fill:`none`},"no-border":{strokeOpacity:0},"no-events":{pointerEvents:`none`}},t=this;this.cls=function(e,t,n){var r=this.style(t,n);return h(r,{class:e})},this.style=function(t,n){!o(t)&&!n&&(n=t,t=[]);var i=r(t,function(t,n){return h(t,e[n]||{})},{});return n?h(i,n):i},this.computeStyle=function(e,n,r){return o(n)||(r=n,n=[]),t.style(n||[],h({},r,e||{}))}}var Tt={__init__:[`defaultRenderer`],defaultRenderer:[`type`,Ct],styles:[`type`,wt]};function Et(e,t){return Math.round(e*t)/t}function Dt(e){return s(e)?e+`px`:e}function Ot(e){for(;e.parent;)e=e.parent;return e}function kt(e){e=h({},{width:`100%`,height:`100%`},e);let t=e.container||document.body,n=document.createElement(`div`);return n.setAttribute(`class`,`djs-container djs-parent bio-theme-parent`),B(n,{position:`relative`,overflow:`hidden`,width:Dt(e.width),height:Dt(e.height)}),t.appendChild(n),n}function At(e,t,n){let r=D(`g`);O(r).add(t);let i=n===void 0?e.childNodes.length-1:n;return e.insertBefore(r,e.childNodes[i]||null),r}var jt=`base`,Mt=0,Nt=1,Pt={shape:[`x`,`y`,`width`,`height`],connection:[`waypoints`]};function H(e,t,n,r){this._eventBus=t,this._elementRegistry=r,this._graphicsFactory=n,this._rootsIdx=0,this._layers={},this._planes=[],this._rootElement=null,this._focused=!1,this._init(e||{})}H.$inject=[`config.canvas`,`eventBus`,`graphicsFactory`,`elementRegistry`],H.prototype._init=function(e){let t=this._eventBus,n=this._container=kt(e),r=this._svg=D(`svg`);E(r,{width:`100%`,height:`100%`}),Ie(r,`tabindex`,0),e.autoFocus&&t.on(`element.hover`,()=>{this.restoreFocus()}),t.on(`element.mousedown`,500,e=>{this.focus()}),r.addEventListener(`focusin`,()=>{this._setFocused(!0)}),r.addEventListener(`focusout`,()=>{this._setFocused(!1)}),r.addEventListener(`mouseover`,()=>{this._eventBus.fire(`canvas.mouseover`)}),r.addEventListener(`mouseout`,()=>{this._eventBus.fire(`canvas.mouseout`)}),k(n,r);let i=this._viewport=At(r,`viewport`);e.deferUpdate&&(this._viewboxChanged=m(this._viewboxChanged,300)),this._restoreFocus=m(this._restoreFocus,0),t.on(`diagram.init`,()=>{t.fire(`canvas.init`,{svg:r,viewport:i})}),t.on([`shape.added`,`connection.added`,`shape.removed`,`connection.removed`,`elements.changed`,`root.set`],()=>{delete this._cachedViewbox}),t.on(`diagram.destroy`,500,this._destroy,this),t.on(`diagram.clear`,500,this._clear,this)},H.prototype._destroy=function(){this._restoreFocus.cancel(),this._eventBus.fire(`canvas.destroy`,{svg:this._svg,viewport:this._viewport});let e=this._container.parentNode;e&&e.removeChild(this._container),delete this._svg,delete this._container,delete this._layers,delete this._planes,delete this._rootElement,delete this._viewport},H.prototype._setFocused=function(e){e!=this._focused&&(this._focused=e,this._eventBus.fire(`canvas.focus.changed`,{focused:e}))},H.prototype._clear=function(){this._elementRegistry.getAll().forEach(e=>{let t=yt(e);t===`root`?this.removeRootElement(e):this._removeElement(e,t)}),this._planes=[],this._rootElement=null,delete this._cachedViewbox},H.prototype.focus=function(){this._svg.focus({preventScroll:!0}),this._setFocused(!0)},H.prototype.restoreFocus=function(){this._restoreFocus()},H.prototype._restoreFocus=function(){document.activeElement===document.body&&this.focus()},H.prototype.isFocused=function(){return this._focused},H.prototype.getDefaultLayer=function(){return this.getLayer(jt,Mt)},H.prototype.getLayer=function(e,t){if(!e)throw Error(`must specify a name`);let n=this._layers[e];if(n||=this._layers[e]=this._createLayer(e,t),t!==void 0&&n.index!==t)throw Error(`layer <`+e+`> already created at index <`+t+`>`);return n.group},H.prototype._getChildIndex=function(e){return r(this._layers,function(t,n){return n.visible&&e>=n.index&&t++,t},0)},H.prototype._createLayer=function(e,t){t===void 0&&(t=Nt);let n=this._getChildIndex(t);return{group:At(this._viewport,`layer-`+e,n),index:t,visible:!0}},H.prototype.showLayer=function(e){if(!e)throw Error(`must specify a name`);let t=this._layers[e];if(!t)throw Error(`layer <`+e+`> does not exist`);let n=this._viewport,r=t.group,i=t.index;if(t.visible)return r;let a=this._getChildIndex(i);return n.insertBefore(r,n.childNodes[a]||null),t.visible=!0,r},H.prototype.hideLayer=function(e){if(!e)throw Error(`must specify a name`);let t=this._layers[e];if(!t)throw Error(`layer <`+e+`> does not exist`);let n=t.group;return t.visible&&=(A(n),!1),n},H.prototype._removeLayer=function(e){let t=this._layers[e];t&&(delete this._layers[e],A(t.group))},H.prototype.getActiveLayer=function(){let e=this._findPlaneForRoot(this.getRootElement());return e?e.layer:null},H.prototype.findRoot=function(e){let t=this._resolveElements(e),n;for(let e of t){let t=this._findPlaneForRoot(Ot(e));if(!t||n&&t.rootElement!==n)return;n=t.rootElement}return n},H.prototype.getRootElements=function(){return this._planes.map(function(e){return e.rootElement})},H.prototype._findPlaneForRoot=function(e){return f(this._planes,function(t){return t.rootElement===e})},H.prototype._resolveElement=function(e){return typeof e==`string`?this._elementRegistry.get(e):e},H.prototype._resolveElements=function(e){return o(e)||(e=[e]),e.map(e=>this._resolveElement(e)).filter(Boolean)},H.prototype.getContainer=function(){return this._container},H.prototype._updateMarker=function(e,t,n){let r;e=this._resolveElement(e),e.markers=e.markers||new Set,r=this._elementRegistry._elements[e.id],r&&(l([r.gfx,r.secondaryGfx],function(r){r&&(n?(e.markers.add(t),O(r).add(t)):(e.markers.delete(t),O(r).remove(t)))}),this._eventBus.fire(`element.marker.update`,{element:e,gfx:r.gfx,marker:t,add:!!n}))},H.prototype.addMarker=function(e,t){this._updateMarker(e,t,!0)},H.prototype.removeMarker=function(e,t){this._updateMarker(e,t,!1)},H.prototype.hasMarker=function(e,t){return e=this._resolveElement(e),e.markers?e.markers.has(t):!1},H.prototype.toggleMarker=function(e,t){this.hasMarker(e,t)?this.removeMarker(e,t):this.addMarker(e,t)},H.prototype.getRootElement=function(){let e=this._rootElement;return e||this._planes.length?e:this.setRootElement(this.addRootElement(null))},H.prototype.addRootElement=function(e){let t=this._rootsIdx++;e||={id:`__implicitroot_`+t,children:[],isImplicit:!0};let n=e.layer=`root-`+t;this._ensureValid(`root`,e);let r=this.getLayer(n,Mt);return this.hideLayer(n),this._addRoot(e,r),this._planes.push({rootElement:e,layer:r}),e},H.prototype.removeRootElement=function(e){if(e=this._resolveElement(e),this._findPlaneForRoot(e))return this._removeRoot(e),this._removeLayer(e.layer),this._planes=this._planes.filter(function(t){return t.rootElement!==e}),this._rootElement===e&&(this._rootElement=null),e},H.prototype.setRootElement=function(e){if(e===this._rootElement)return e;let t;if(!e)throw Error(`rootElement required`);return t=this._findPlaneForRoot(e),t||(e=this.addRootElement(e)),this._setRoot(e),e},H.prototype._removeRoot=function(e){let t=this._elementRegistry,n=this._eventBus;n.fire(`root.remove`,{element:e}),n.fire(`root.removed`,{element:e}),t.remove(e)},H.prototype._addRoot=function(e,t){let n=this._elementRegistry,r=this._eventBus;r.fire(`root.add`,{element:e}),n.add(e,t),r.fire(`root.added`,{element:e,gfx:t})},H.prototype._setRoot=function(e,t){let n=this._rootElement;n&&(this._elementRegistry.updateGraphics(n,null,!0),this.hideLayer(n.layer)),e&&(t||=this._findPlaneForRoot(e).layer,this._elementRegistry.updateGraphics(e,this._svg,!0),this.showLayer(e.layer)),this._rootElement=e,this._eventBus.fire(`root.set`,{element:e})},H.prototype._ensureValid=function(e,t){if(!t.id)throw Error(`element must have an id`);if(this._elementRegistry.get(t.id))throw Error(`element <`+t.id+`> already exists`);let n=Pt[e];if(!c(n,function(e){return t[e]!==void 0}))throw Error(`must supply { `+n.join(`, `)+` } with `+e)},H.prototype._setParent=function(e,t,n){be(t.children,e,n),e.parent=t},H.prototype._addElement=function(e,t,n,r){n||=this.getRootElement();let i=this._eventBus,a=this._graphicsFactory;this._ensureValid(e,t),i.fire(e+`.add`,{element:t,parent:n}),this._setParent(t,n,r);let o=a.create(e,t,r);return this._elementRegistry.add(t,o),a.update(e,t,o),i.fire(e+`.added`,{element:t,gfx:o}),t},H.prototype.addShape=function(e,t,n){return this._addElement(`shape`,e,t,n)},H.prototype.addConnection=function(e,t,n){return this._addElement(`connection`,e,t,n)},H.prototype._removeElement=function(e,t){let n=this._elementRegistry,r=this._graphicsFactory,i=this._eventBus;if(e=n.get(e.id||e),e)return i.fire(t+`.remove`,{element:e}),r.remove(e),fe(e.parent&&e.parent.children,e),e.parent=null,i.fire(t+`.removed`,{element:e}),n.remove(e),e},H.prototype.removeShape=function(e){return this._removeElement(e,`shape`)},H.prototype.removeConnection=function(e){return this._removeElement(e,`connection`)},H.prototype.getGraphics=function(e,t){return this._elementRegistry.getGraphics(e,t)},H.prototype._changeViewbox=function(e){this._eventBus.fire(`canvas.viewbox.changing`),e.apply(this),this._cachedViewbox=null,this._viewboxChanged()},H.prototype._viewboxChanged=function(){this._eventBus.fire(`canvas.viewbox.changed`,{viewbox:this.viewbox()})},H.prototype.viewbox=function(e){if(e===void 0&&this._cachedViewbox)return structuredClone(this._cachedViewbox);let t=this._viewport,n=this.getSize(),r,i,a,o,s,c,l;if(e)this._changeViewbox(function(){s=Math.min(n.width/e.width,n.height/e.height);let r=this._svg.createSVGMatrix().scale(s).translate(-e.x,-e.y);le(t,r)});else return a=this._rootElement?this.getActiveLayer():null,r=a&&a.getBBox()||{},o=le(t),i=o?o.matrix:ue(),s=Et(i.a,1e3),c=Et(-i.e||0,1e3),l=Et(-i.f||0,1e3),e=this._cachedViewbox={x:c?c/s:0,y:l?l/s:0,width:n.width/s,height:n.height/s,scale:s,inner:{width:r.width||0,height:r.height||0,x:r.x||0,y:r.y||0},outer:n},e;return e},H.prototype.scroll=function(e){let t=this._viewport,n=t.getCTM();return e&&this._changeViewbox(function(){e=h({dx:0,dy:0},e||{}),n=this._svg.createSVGMatrix().translate(e.dx,e.dy).multiply(n),Ft(t,n)}),{x:n.e,y:n.f}},H.prototype.scrollToElement=function(e,t){let n=100,r=this._resolveElements(e);if(!r.length)return;let i=this.findRoot(r);if(!i)return;i!==this.getRootElement()&&this.setRootElement(i);let a=r.filter(e=>e!=i);if(!a.length)return;t||={},typeof t==`number`&&(n=t),t={top:t.top||n,right:t.right||n,bottom:t.bottom||n,left:t.left||n};let o=_t(a),s=oe(o),c=this.viewbox(),l=this.zoom(),u,d;c.y+=t.top/l,c.x+=t.left/l,c.width-=(t.right+t.left)/l,c.height-=(t.bottom+t.top)/l;let f=oe(c);if(!(o.width<c.width&&o.height<c.height))u=o.x-c.x,d=o.y-c.y;else{let e=Math.max(0,s.right-f.right),t=Math.min(0,s.left-f.left),n=Math.max(0,s.bottom-f.bottom),r=Math.min(0,s.top-f.top);u=e||t,d=n||r}this.scroll({dx:-u*l,dy:-d*l})},H.prototype.zoom=function(e,t){if(!e)return this.viewbox(e).scale;if(e===`fit-viewport`)return this._fitViewport(t);let n,r;return this._changeViewbox(function(){typeof t!=`object`&&(n=this.viewbox().outer,t={x:n.width/2,y:n.height/2}),r=this._setZoom(e,t)}),Et(r.a,1e3)};function Ft(e,t){let n=`matrix(`+t.a+`,`+t.b+`,`+t.c+`,`+t.d+`,`+t.e+`,`+t.f+`)`;e.setAttribute(`transform`,n)}H.prototype._fitViewport=function(e){let t=this.viewbox(),n=t.outer,r=t.inner,i,a;return r.x>=0&&r.y>=0&&r.x+r.width<=n.width&&r.y+r.height<=n.height&&!e?a={x:0,y:0,width:Math.max(r.width+r.x,n.width),height:Math.max(r.height+r.y,n.height)}:(i=Math.min(1,n.width/r.width,n.height/r.height),a={x:r.x+(e?r.width/2-n.width/i/2:0),y:r.y+(e?r.height/2-n.height/i/2:0),width:n.width/i,height:n.height/i}),this.viewbox(a),this.viewbox(!1).scale},H.prototype._setZoom=function(e,t){let n=this._svg,r=this._viewport,i=n.createSVGMatrix(),a=n.createSVGPoint(),o,s,c,l,u;c=r.getCTM();let d=c.a;return t?(o=h(a,t),s=o.matrixTransform(c.inverse()),l=i.translate(s.x,s.y).scale(1/d*e).translate(-s.x,-s.y),u=c.multiply(l)):u=i.scale(e),Ft(this._viewport,u),u},H.prototype.getSize=function(){return{width:this._container.clientWidth,height:this._container.clientHeight}},H.prototype.getAbsoluteBBox=function(e){let t=this.viewbox(),n;return n=e.waypoints?this.getGraphics(e).getBBox():e,{x:n.x*t.scale-t.x*t.scale,y:n.y*t.scale-t.y*t.scale,width:n.width*t.scale,height:n.height*t.scale}},H.prototype.resized=function(){delete this._cachedViewbox,this._eventBus.fire(`canvas.resized`)};var It=`data-element-id`;function U(e){this._elements={},this._eventBus=e}U.$inject=[`eventBus`],U.prototype.add=function(e,t,n){var r=e.id;this._validateId(r),E(t,It,r),n&&E(n,It,r),this._elements[r]={element:e,gfx:t,secondaryGfx:n}},U.prototype.remove=function(e){var t=this._elements,n=e.id||e,r=n&&t[n];r&&(E(r.gfx,It,``),r.secondaryGfx&&E(r.secondaryGfx,It,``),delete t[n])},U.prototype.updateId=function(e,t){this._validateId(t),typeof e==`string`&&(e=this.get(e)),this._eventBus.fire(`element.updateId`,{element:e,newId:t});var n=this.getGraphics(e),r=this.getGraphics(e,!0);this.remove(e),e.id=t,this.add(e,n,r)},U.prototype.updateGraphics=function(e,t,n){var r=e.id||e,i=this._elements[r];return n?i.secondaryGfx=t:i.gfx=t,t&&E(t,It,r),t},U.prototype.get=function(e){var t=typeof e==`string`?e:e&&E(e,It),n=this._elements[t];return n&&n.element},U.prototype.filter=function(e){var t=[];return this.forEach(function(n,r){e(n,r)&&t.push(n)}),t},U.prototype.find=function(e){for(var t=this._elements,n=Object.keys(t),r=0;r<n.length;r++){var i=t[n[r]],a=i.element,o=i.gfx;if(e(a,o))return a}},U.prototype.getAll=function(){return this.filter(function(e){return e})},U.prototype.forEach=function(e){var t=this._elements;Object.keys(t).forEach(function(n){var r=t[n],i=r.element,a=r.gfx;return e(i,a)})},U.prototype.getGraphics=function(e,t){var n=e.id||e,r=this._elements[n];return r&&(t?r.secondaryGfx:r.gfx)},U.prototype._validateId=function(e){if(!e)throw Error(`element must have an id`);if(this._elements[e])throw Error(`element with id `+e+` already added`)};function Lt(e,t,n,r){var i=n.inverse;return Object.defineProperty(e,"remove",{value:function(e){var n=this.indexOf(e);return n!==-1&&(this.splice(n,1),t.unset(e,i,r)),e}}),Object.defineProperty(e,"contains",{value:function(e){return this.indexOf(e)!==-1}}),Object.defineProperty(e,"add",{value:function(e,n){var a=this.indexOf(e);if(n===void 0){if(a!==-1)return;n=this.length}a!==-1&&this.splice(a,1),this.splice(n,0,e),a===-1&&t.set(e,i,r)}}),Object.defineProperty(e,"__refs_collection",{value:!0}),e}function Rt(e){return e.__refs_collection===!0}function zt(e,t){return Object.prototype.hasOwnProperty.call(e,t.name||t)}function Bt(e,t,n){var r=Lt(n[t.name]||[],e,t,n);Object.defineProperty(n,t.name,{enumerable:t.enumerable,value:r}),r.length&&r.forEach(function(r){e.set(r,t.inverse,n)})}function Vt(e,t,n){var r=t.inverse,i=n[t.name];Object.defineProperty(n,t.name,{configurable:t.configurable,enumerable:t.enumerable,get:function(){return i},set:function(t){if(t!==i){var a=i;i=null,a&&e.unset(a,r,n),i=t,e.set(i,r,n)}}})}function W(e,t){if(!(this instanceof W))return new W(e,t);e.inverse=t,t.inverse=e,this.props={},this.props[e.name]=e,this.props[t.name]=t}W.prototype.bind=function(e,t){if(typeof t==`string`){if(!this.props[t])throw Error(`no property <`+t+`> in ref`);t=this.props[t]}t.collection?Bt(this,t,e):Vt(this,t,e)},W.prototype.ensureRefsCollection=function(e,t){var n=e[t.name];return Rt(n)||Bt(this,t,e),n},W.prototype.ensureBound=function(e,t){zt(e,t)||this.bind(e,t)},W.prototype.unset=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).remove(n):e[t.name]=void 0)},W.prototype.set=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).add(n):e[t.name]=n)};var Ht=new W({name:`children`,enumerable:!0,collection:!0},{name:`parent`}),Ut=new W({name:`labels`,enumerable:!0,collection:!0},{name:`labelTarget`}),Wt=new W({name:`attachers`,collection:!0},{name:`host`}),Gt=new W({name:`outgoing`,collection:!0},{name:`source`}),Kt=new W({name:`incoming`,collection:!0},{name:`target`});function qt(){Object.defineProperty(this,"businessObject",{writable:!0}),Object.defineProperty(this,"label",{get:function(){return this.labels[0]},set:function(e){var t=this.label,n=this.labels;!e&&t?n.remove(t):n.add(e,0)}}),Ht.bind(this,`parent`),Ut.bind(this,`labels`),Gt.bind(this,`outgoing`),Kt.bind(this,`incoming`)}function Jt(){qt.call(this),Ht.bind(this,`children`),Wt.bind(this,`host`),Wt.bind(this,`attachers`)}j(Jt,qt);function Yt(){qt.call(this),Ht.bind(this,`children`)}j(Yt,Jt);function Xt(){Jt.call(this),Ut.bind(this,`labelTarget`)}j(Xt,Jt);function Zt(){qt.call(this),Gt.bind(this,`source`),Kt.bind(this,`target`)}j(Zt,qt);var Qt={connection:Zt,shape:Jt,label:Xt,root:Yt};function $t(e,t){var n=Qt[e];if(!n)throw Error(`unknown type: <`+e+`>`);return h(new n,t)}function en(e){return e instanceof qt}function tn(){this._uid=12}tn.prototype.createRoot=function(e){return this.create(`root`,e)},tn.prototype.createLabel=function(e){return this.create(`label`,e)},tn.prototype.createShape=function(e){return this.create(`shape`,e)},tn.prototype.createConnection=function(e){return this.create(`connection`,e)},tn.prototype.create=function(e,t){return t=h({},t||{}),t.id||(t.id=e+`_`+this._uid++),$t(e,t)};var nn=`__fn`,rn=1e3,an=Array.prototype.slice;function G(){this._listeners={},this.on(`diagram.destroy`,1,this._destroy,this)}G.prototype.on=function(e,t,n,r){if(e=o(e)?e:[e],u(t)&&(r=n,n=t,t=rn),!s(t))throw Error(`priority must be a number`);var i=n;r&&(i=d(n,r),i[nn]=n[nn]||n);var a=this;e.forEach(function(e){a._addListener(e,{priority:t,callback:i,next:null})})},G.prototype.once=function(e,t,n,r){var i=this;if(u(t)&&(r=n,n=t,t=rn),!s(t))throw Error(`priority must be a number`);function a(){a.__isTomb=!0;var t=n.apply(r,arguments);return i.off(e,a),t}a[nn]=n,this.on(e,t,a)},G.prototype.off=function(e,t){e=o(e)?e:[e];var n=this;e.forEach(function(e){n._removeListener(e,t)})},G.prototype.createEvent=function(e){var t=new on;return t.init(e),t},G.prototype.fire=function(e,t){var n,r,i,a=an.call(arguments);if(typeof e==`object`&&(t=e,e=t.type),!e)throw Error(`no event type specified`);if(r=this._listeners[e],r){n=t instanceof on?t:this.createEvent(t),a[0]=n;var o=n.type;e!==o&&(n.type=e);try{i=this._invokeListeners(n,a,r)}finally{e!==o&&(n.type=o)}return i===void 0&&n.defaultPrevented&&(i=!1),i}},G.prototype.handleError=function(e){return this.fire(`error`,{error:e})===!1},G.prototype._destroy=function(){this._listeners={}},G.prototype._invokeListeners=function(e,t,n){for(var r;n&&!e.cancelBubble;)r=this._invokeListener(e,t,n),n=n.next;return r},G.prototype._invokeListener=function(e,t,n){var r;if(n.callback.__isTomb)return r;try{r=sn(n.callback,t),r!==void 0&&(e.returnValue=r,e.stopPropagation()),r===!1&&e.preventDefault()}catch(e){if(!this.handleError(e))throw console.error(`unhandled error in event listener`,e),e}return r},G.prototype._addListener=function(e,t){var n=this._getListeners(e),r;if(!n)this._setListeners(e,t);else{for(;n;){if(n.priority<t.priority){t.next=n,r?r.next=t:this._setListeners(e,t);return}r=n,n=n.next}r.next=t}},G.prototype._getListeners=function(e){return this._listeners[e]},G.prototype._setListeners=function(e,t){this._listeners[e]=t},G.prototype._removeListener=function(e,t){var n=this._getListeners(e),r,i,a;if(!t)this._setListeners(e,null);else for(;n;)r=n.next,a=n.callback,(a===t||a[nn]===t)&&(i?i.next=r:this._setListeners(e,r)),i=n,n=r};function on(){}on.prototype.stopPropagation=function(){this.cancelBubble=!0},on.prototype.preventDefault=function(){this.defaultPrevented=!0},on.prototype.init=function(e){h(this,e||{})};function sn(e,t){return e.apply(null,t)}function cn(e){return e.childNodes[0]}function ln(e){return e.parentNode.childNodes[1]}function un(e,t,n,r,i){var a=T();a.setTranslate(t,n);var o=T();o.setRotate(r||0,0,0);var s=T();s.setScale(i||1,i||1),le(e,[a,o,s])}function dn(e,t,n){var r=T();r.setTranslate(t,n),le(e,r)}function fn(e,t){var n=T();n.setRotate(t,0,0),le(e,n)}function K(e,t){this._eventBus=e,this._elementRegistry=t}K.$inject=[`eventBus`,`elementRegistry`],K.prototype._getChildrenContainer=function(e){var t=this._elementRegistry.getGraphics(e),n;return e.parent?(n=ln(t),n||(n=D(`g`),O(n).add(`djs-children`),k(t.parentNode,n))):n=t,n},K.prototype._clear=function(e){var t=cn(e);return Be(t),t},K.prototype._createContainer=function(e,t,n,r){var i=D(`g`);O(i).add(`djs-group`),n===void 0?k(t,i):pn(i,t,t.childNodes[n]);var a=D(`g`);O(a).add(`djs-element`),O(a).add(`djs-`+e),r&&O(a).add(`djs-frame`),k(i,a);var o=D(`g`);return O(o).add(`djs-visual`),k(a,o),a},K.prototype.create=function(e,t,n){var r=this._getChildrenContainer(t.parent);return this._createContainer(e,r,n,bt(t))},K.prototype.updateContainments=function(e){var t=this,n=this._elementRegistry,i=r(e,function(e,t){return t.parent&&(e[t.parent.id]=t.parent),e},{});l(i,function(e){var r=e.children;if(r){var i=t._getChildrenContainer(e),a=i.firstChild;l(r,function(e){var t=n.getGraphics(e).parentNode;t===a?a=a.nextSibling:i.insertBefore(t,a)})}})},K.prototype.drawShape=function(e,t,n={}){return this._eventBus.fire(`render.shape`,{gfx:e,element:t,attrs:n})},K.prototype.getShapePath=function(e){return this._eventBus.fire(`render.getShapePath`,e)},K.prototype.drawConnection=function(e,t,n={}){return this._eventBus.fire(`render.connection`,{gfx:e,element:t,attrs:n})},K.prototype.getConnectionPath=function(e){return this._eventBus.fire(`render.getConnectionPath`,e)},K.prototype.update=function(e,t,n){if(t.parent){var r=this._clear(n);if(e===`shape`)this.drawShape(r,t),dn(n,t.x,t.y);else if(e===`connection`)this.drawConnection(r,t);else throw Error(`unknown type: `+e);t.hidden?E(n,`display`,`none`):E(n,`display`,`block`)}},K.prototype.remove=function(e){var t=this._elementRegistry.getGraphics(e);A(t.parentNode)};function pn(e,t,n){var r=n||t.firstChild;e!==r&&t.insertBefore(e,r)}var mn={__depends__:[Tt],__init__:[`canvas`],canvas:[`type`,H],elementRegistry:[`type`,U],elementFactory:[`type`,tn],eventBus:[`type`,G],graphicsFactory:[`type`,K]};function hn(e){var t=new ut(e);return t.init(),t}function gn(e){return e||={},hn([{config:[`value`,e]},mn].concat(e.modules||[]))}function _n(e,t){this._injector=t||gn(e),this.get(`eventBus`).fire(`diagram.init`)}_n.prototype.get=function(e,t){return this._injector.get(e,t)},_n.prototype.invoke=function(e,t,n){return this._injector.invoke(e,t,n)},_n.prototype.destroy=function(){this.get(`eventBus`).fire(`diagram.destroy`)},_n.prototype.clear=function(){this.get(`eventBus`).fire(`diagram.clear`)};function q(e){return e?`<`+e.$type+(e.id?` id="`+e.id:``)+`" />`:`<null>`}function J(e,t){return e.$instanceOf(t)}function vn(e){return f(e.rootElements,function(e){return J(e,`bpmn:Process`)||J(e,`bpmn:Collaboration`)})}function yn(e){var t={},n=[],r={};function i(e,t){return function(n){e(n,t)}}function o(e){t[e.id]=e}function s(e){return t[e.id]}function c(t,n){if(t.gfx)throw Error(`already rendered ${q(t)}`);return e.element(t,r[t.id],n)}function u(t,n){return e.root(t,r[t.id],n)}function d(e,t){try{var n=r[e.id]&&c(e,t);return o(e),n}catch(t){f(t.message,{element:e,error:t}),console.error(`failed to import ${q(e)}`,t)}}function f(t,n){e.error(t,n)}var p=this.registerDi=function(e){var t=e.bpmnElement;t?r[t.id]?f(`multiple DI elements defined for ${q(t)}`,{element:t}):r[t.id]=e:f(`no bpmnElement referenced in ${q(e)}`,{element:e})};function m(e){h(e.plane)}function h(e){p(e),l(e.planeElement,g)}function g(e){p(e)}this.handleDefinitions=function(e,t){var i=e.diagrams;if(t&&i.indexOf(t)===-1)throw Error(`diagram not part of <bpmn:Definitions />`);if(!t&&i&&i.length&&(t=i[0]),!t)throw Error(`no diagram to display`);r={},m(t);var a=t.plane;if(!a)throw Error(`no plane for ${q(t)}`);var o=a.bpmnElement;if(!o){if(o=vn(e),o)f(`correcting missing bpmnElement on ${q(a)} to ${q(o)}`),a.bpmnElement=o,p(a);else throw Error(`no process or collaboration to display`)}var s=u(o,a);if(J(o,`bpmn:Process`)||J(o,`bpmn:SubProcess`))v(o,s);else if(J(o,`bpmn:Collaboration`))O(o,s),y(e.rootElements,s);else throw Error(`unsupported bpmnElement for ${q(a)}: ${q(o)}`);_(n)};var _=this.handleDeferred=function(){for(var e;n.length;)e=n.shift(),e()};function v(e,t){E(e,t),S(e.ioSpecification,t),ie(e.artifacts,t),o(e)}function y(e,t){a(e,function(e){return!s(e)&&J(e,`bpmn:Process`)&&e.laneSets}).forEach(i(v,t))}function ee(e,t){d(e,t)}function te(e,t){l(e,i(ee,t))}function b(e,t){d(e,t)}function x(e,t){d(e,t)}function ne(e,t){d(e,t)}function re(e,t){d(e,t)}function ie(e,t){l(e,function(e){J(e,`bpmn:Association`)?n.push(function(){re(e,t)}):re(e,t)})}function S(e,t){e&&(l(e.dataInputs,i(x,t)),l(e.dataOutputs,i(ne,t)))}var C=this.handleSubProcess=function(e,t){E(e,t),ie(e.artifacts,t)};function ae(e,t){var r=d(e,t);J(e,`bpmn:SubProcess`)&&C(e,r||t),J(e,`bpmn:Activity`)&&S(e.ioSpecification,t),n.push(function(){l(e.dataInputAssociations,i(b,t)),l(e.dataOutputAssociations,i(b,t))})}function oe(e,t){d(e,t)}function w(e,t){d(e,t)}function T(e,t){n.push(function(){var n=d(e,t);e.childLaneSet&&se(e.childLaneSet,n||t),ue(e)})}function se(e,t){l(e.lanes,i(T,t))}function ce(e,t){l(e,i(se,t))}function E(e,t){D(e.flowElements,t),e.laneSets&&ce(e.laneSets,t)}function D(e,t){l(e,function(e){J(e,`bpmn:SequenceFlow`)?n.push(function(){oe(e,t)}):J(e,`bpmn:BoundaryEvent`)?n.unshift(function(){ae(e,t)}):J(e,`bpmn:FlowNode`)?ae(e,t):J(e,`bpmn:DataObject`)||(J(e,`bpmn:DataStoreReference`)||J(e,`bpmn:DataObjectReference`)?w(e,t):f(`unrecognized flowElement ${q(e)} in context ${q(t&&t.businessObject)}`,{element:e,context:t}))})}function le(e,t){var n=d(e,t),r=e.processRef;r&&v(r,n||t)}function O(e,t){l(e.participants,i(le,t)),n.push(function(){te(e.messageFlows,t)}),ie(e.artifacts,t)}function ue(e){l(e.flowNodeRef,function(t){var n=t.get(`lanes`);n&&n.push(e)})}}function bn(e,t,n){var r,i,a,o,s=[];function c(e,t){var n=new yn({root:function(e,t){return r.add(e,t)},element:function(e,t,n){return r.add(e,t,n)},error:function(e,t){s.push({message:e,context:t})}});t||=e.diagrams&&e.diagrams[0];var i=xn(e,t);if(!i)throw Error(`no diagram to display`);l(i,function(t){n.handleDefinitions(e,t)});var o=t.plane.bpmnElement.id;a.setRootElement(a.findRoot(o+`_plane`)||a.findRoot(o))}return new Promise(function(l,u){try{return r=e.get(`bpmnImporter`),i=e.get(`eventBus`),a=e.get(`canvas`),i.fire(`import.render.start`,{definitions:t}),c(t,n),i.fire(`import.render.complete`,{error:o,warnings:s}),l({warnings:s})}catch(e){return e.warnings=s,u(e)}})}function xn(e,t){if(t&&t.plane){var n=t.plane.bpmnElement,r=n;!b(n,`bpmn:Process`)&&!b(n,`bpmn:Collaboration`)&&(r=Cn(n));var i=b(r,`bpmn:Collaboration`)?r:f(e.rootElements,function(e){if(b(e,`bpmn:Collaboration`))return f(e.participants,function(e){return e.processRef===r})}),a=[r];i&&(a=v(i.participants,function(e){return e.processRef}),a.push(i));var o=Sn(a),s=[t],c=[n];return l(e.diagrams,function(e){if(e.plane){var t=e.plane.bpmnElement;o.indexOf(t)!==-1&&c.indexOf(t)===-1&&(s.push(e),c.push(t))}}),s}}function Sn(e){var t=[];return l(e,function(e){e&&(t.push(e),t=t.concat(Sn(e.flowElements)))}),t}function Cn(e){for(var t=e;t;){if(b(t,`bpmn:Process`))return t;t=t.$parent}}var wn=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14.02 5.57" width="53" height="21"><path fill="currentColor" d="M1.88.92v.14c0 .41-.13.68-.4.8.33.14.46.44.46.86v.33c0 .61-.33.95-.95.95H0V0h.95c.65 0 .93.3.93.92zM.63.57v1.06h.24c.24 0 .38-.1.38-.43V.98c0-.28-.1-.4-.32-.4zm0 1.63v1.22h.36c.2 0 .32-.1.32-.39v-.35c0-.37-.12-.48-.4-.48H.63zM4.18.99v.52c0 .64-.31.98-.94.98h-.3V4h-.62V0h.92c.63 0 .94.35.94.99zM2.94.57v1.35h.3c.2 0 .3-.09.3-.37v-.6c0-.29-.1-.38-.3-.38h-.3zm2.89 2.27L6.25 0h.88v4h-.6V1.12L6.1 3.99h-.6l-.46-2.82v2.82h-.55V0h.87zM8.14 1.1V4h-.56V0h.79L9 2.4V0h.56v4h-.64zm2.49 2.29v.6h-.6v-.6zM12.12 1c0-.63.33-1 .95-1 .61 0 .95.37.95 1v2.04c0 .64-.34 1-.95 1-.62 0-.95-.37-.95-1zm.62 2.08c0 .28.13.39.33.39s.32-.1.32-.4V.98c0-.29-.12-.4-.32-.4s-.33.11-.33.4z"/><path fill="currentColor" d="M0 4.53h14.02v1.04H0zM11.08 0h.63v.62h-.63zm.63 4V1h-.63v2.98z"/></svg>`,Tn={verticalAlign:`middle`},En={color:`#404040`},Dn={zIndex:`1001`,position:`fixed`,top:`0`,left:`0`,right:`0`,bottom:`0`},On={width:`100%`,height:`100%`,background:`rgba(40,40,40,0.2)`},kn={position:`absolute`,left:`50%`,top:`40%`,transform:`translate(-50%)`,width:`260px`,padding:`10px`,background:`white`,boxShadow:`0 1px 4px rgba(0,0,0,0.3)`,fontFamily:`Helvetica, Arial, sans-serif`,fontSize:`14px`,display:`flex`,lineHeight:`1.3`},An=`<div class="bjs-powered-by-lightbox"><div class="backdrop"></div><div class="notice"><a href="https://bpmn.io" target="_blank" rel="noopener" class="link">`+wn+`</a><span>Web-based tooling for BPMN, DMN and forms powered by <a href="https://bpmn.io" target="_blank" rel="noopener">bpmn.io</a>.</span></div></div>`,Y;function jn(){Y=z(An),B(Y,Dn),B(V(`svg`,Y),Tn),B(V(`.backdrop`,Y),On),B(V(`.notice`,Y),kn),B(V(`.link`,Y),En,{margin:`15px 20px 15px 10px`,alignSelf:`center`})}function Mn(){Y||(jn(),Ze.bind(Y,`.backdrop`,`click`,function(e){document.body.removeChild(Y)})),document.body.appendChild(Y)}var Nn=5,Pn=`djs-outline-hidden`;function X(e){e=h({},Ln,e),this._moddle=this._createModdle(e),this._container=this._createContainer(e),this._init(this._container,this._moddle,e),Bn(this._container)}j(X,_n),X.prototype.importXML=async function(e,t){let n=this;function r(e){return n.get(`eventBus`).createEvent(e)}let i=[];try{e=this._emit(`import.parse.start`,{xml:e})||e;let n;try{n=await this._moddle.fromXML(e,`bpmn:Definitions`)}catch(e){throw this._emit(`import.parse.complete`,{error:e}),e}let a=n.rootElement,o=n.references,s=n.warnings,c=n.elementsById;i=i.concat(s),a=this._emit(`import.parse.complete`,r({error:null,definitions:a,elementsById:c,references:o,warnings:i}))||a;let l=await this.importDefinitions(a,t);return i=i.concat(l.warnings),this._emit(`import.done`,{error:null,warnings:i}),{warnings:i}}catch(e){let t=e;throw i=i.concat(t.warnings||[]),Fn(t,i),t=In(t),this._emit(`import.done`,{error:t,warnings:t.warnings}),t}},X.prototype.importDefinitions=async function(e,t){return this._setDefinitions(e),{warnings:(await this.open(t)).warnings}},X.prototype.open=async function(e){let t=this._definitions,n=e;if(!t){let e=Error(`no XML imported`);throw Fn(e,[]),e}if(typeof e==`string`&&(n=zn(t,e),!n)){let t=Error(`BPMNDiagram <`+e+`> not found`);throw Fn(t,[]),t}try{this.clear()}catch(e){throw Fn(e,[]),e}let{warnings:r}=await bn(this,t,n);return{warnings:r}},X.prototype.saveXML=async function(e){e||={};let t=this._definitions,n,r;try{if(!t)throw Error(`no definitions loaded`);t=this._emit(`saveXML.start`,{definitions:t})||t,r=(await this._moddle.toXML(t,e)).xml,r=this._emit(`saveXML.serialized`,{xml:r})||r}catch(e){n=e}let i=n?{error:n}:{xml:r};if(this._emit(`saveXML.done`,i),n)throw n;return i},X.prototype.saveSVG=async function(){this._emit(`saveSVG.start`);let e,t;try{let t=this.get(`canvas`),n=t.getActiveLayer(),r=V(`:scope > defs`,t._svg),i=se(n),a=r?`<defs>`+se(r)+`</defs>`:``,o=t.getContainer();Re(o).add(Pn);let s;try{s=n.getBBox()}finally{Re(o).remove(Pn)}let c=s.x-Nn,l=s.y-Nn,u=s.width+Nn*2,d=s.height+Nn*2;e=`<?xml version="1.0" encoding="utf-8"?>
2
+ <!-- created with bpmn-js / http://bpmn.io -->
3
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
4
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="`+u+`" height="`+d+`" viewBox="`+c+` `+l+` `+u+` `+d+`" version="1.1">`+a+i+`</svg>`}catch(e){t=e}if(this._emit(`saveSVG.done`,{error:t,svg:e}),t)throw t;return{svg:e}},X.prototype._setDefinitions=function(e){this._definitions=e},X.prototype.getModules=function(){return this._modules},X.prototype.clear=function(){this.getDefinitions()&&_n.prototype.clear.call(this)},X.prototype.destroy=function(){_n.prototype.destroy.call(this),et(this._container)},X.prototype.on=function(e,t,n,r){return this.get(`eventBus`).on(e,t,n,r)},X.prototype.off=function(e,t){this.get(`eventBus`).off(e,t)},X.prototype.attachTo=function(e){if(!e)throw Error(`parentNode required`);this.detach(),e.get&&e.constructor.prototype.jquery&&(e=e.get(0)),typeof e==`string`&&(e=V(e)),e.appendChild(this._container),this._emit(`attach`,{}),this.get(`canvas`).resized()},X.prototype.getDefinitions=function(){return this._definitions},X.prototype.detach=function(){let e=this._container,t=e.parentNode;t&&(this._emit(`detach`,{}),t.removeChild(e))},X.prototype._init=function(e,n,r){let i=r.modules||this.getModules(r),a=r.additionalModules||[],o=[{bpmnjs:[`value`,this],moddle:[`value`,n]}],s=[].concat(o,i,a),c=h(t(r,[`additionalModules`]),{canvas:h({},r.canvas,{container:e}),modules:s});_n.call(this,c),r&&r.container&&this.attachTo(r.container)},X.prototype._emit=function(e,t){return this.get(`eventBus`).fire(e,t)},X.prototype._createContainer=function(e){let t=z(`<div class="bjs-container bio-theme-parent"></div>`);return B(t,{width:Rn(e.width),height:Rn(e.height),position:e.position}),t},X.prototype._createModdle=function(t){let n=h({},this._moddleExtensions,t.moddleExtensions);return new e(n)},X.prototype._modules=[];function Fn(e,t){return e.warnings=t,e}function In(e){let t=/unparsable content <([^>]+)> detected([\s\S]*)$/.exec(e.message);return t&&(e.message=`unparsable content <`+t[1]+`> detected; this may indicate an invalid BPMN 2.0 diagram file`+t[2]),e}var Ln={width:`100%`,height:`100%`,position:`relative`};function Rn(e){return e+(s(e)?`px`:``)}function zn(e,t){return t&&f(e.diagrams,function(e){return e.id===t})||null}function Bn(e){let t=z(`<a href="http://bpmn.io" target="_blank" class="bjs-powered-by" title="Powered by bpmn.io" >`+wn+`</a>`);B(V(`svg`,t),Tn),B(t,En,{position:`absolute`,bottom:`15px`,right:`15px`,zIndex:`100`}),e.appendChild(t),qe.bind(t,`click`,function(e){Mn(),e.preventDefault()})}function Vn(e){let t=[];return l(e.incoming,e=>{b(e,`bpmn:Association`)&&b(e.source,`bpmn:TextAnnotation`)&&t.push({annotation:e.source,association:e})}),l(e.outgoing,e=>{b(e,`bpmn:Association`)&&b(e.target,`bpmn:TextAnnotation`)&&t.push({annotation:e.target,association:e})}),t}function Hn(e){let t=new Map;return l(mt(e,!0,-1),e=>{l(Vn(e),e=>{t.has(e.annotation)||t.set(e.annotation,{annotation:e.annotation,associations:[]}),t.get(e.annotation).associations.push(e.association)})}),[...t.values()]}var Un=new L,Wn=10,Gn=3,Kn=1.5,qn=10,Jn=4,Yn=.95,Xn=1,Zn=.25;function Qn(e,t,n,r,a,o,s){ce.call(this,t,s);var c=e&&e.defaultFillColor,u=e&&e.defaultStrokeColor,d=e&&e.defaultLabelColor;function f(e){return n.computeStyle(e,{strokeLinecap:`round`,strokeLinejoin:`round`,stroke:De,strokeWidth:2,fill:`white`})}function p(e){return n.computeStyle(e,[`no-fill`],{strokeLinecap:`round`,strokeLinejoin:`round`,stroke:De,strokeWidth:2})}function m(e,t){var{ref:n={x:0,y:0},scale:r=1,element:i,parentGfx:o=a._svg}=t,s=D(`marker`,{id:e,viewBox:`0 0 20 20`,refX:n.x,refY:n.y,markerWidth:20*r,markerHeight:20*r,orient:`auto`});k(s,i);var c=V(`:scope > defs`,o);c||(c=D(`defs`),k(o,c)),k(c,s)}function g(e,t,n,r){var i=Un.nextPrefixed(`marker-`);return _(e,i,t,n,r),`url(#`+i+`)`}function _(e,t,n,r,i){n===`sequenceflow-end`&&m(t,{element:D(`path`,{d:`M 1 5 L 11 10 L 1 15 Z`,...f({fill:i,stroke:i,strokeWidth:1})}),ref:{x:11,y:10},scale:.5,parentGfx:e}),n===`messageflow-start`&&m(t,{element:D(`circle`,{cx:6,cy:6,r:3.5,...f({fill:r,stroke:i,strokeWidth:1,strokeDasharray:[1e4,1]})}),ref:{x:6,y:6},parentGfx:e}),n===`messageflow-end`&&m(t,{element:D(`path`,{d:`m 1 5 l 0 -3 l 7 3 l -7 3 z`,...f({fill:r,stroke:i,strokeWidth:1,strokeDasharray:[1e4,1]})}),ref:{x:8.5,y:5},parentGfx:e}),n===`association-start`&&m(t,{element:D(`path`,{d:`M 11 5 L 1 10 L 11 15`,...p({fill:`none`,stroke:i,strokeWidth:1.5,strokeDasharray:[1e4,1]})}),ref:{x:1,y:10},scale:.5,parentGfx:e}),n===`association-end`&&m(t,{element:D(`path`,{d:`M 1 5 L 11 10 L 1 15`,...p({fill:`none`,stroke:i,strokeWidth:1.5,strokeDasharray:[1e4,1]})}),ref:{x:11,y:10},scale:.5,parentGfx:e}),n===`conditional-flow-marker`&&m(t,{element:D(`path`,{d:`M 0 10 L 8 6 L 16 10 L 8 14 Z`,...f({fill:r,stroke:i})}),ref:{x:-1,y:10},scale:.5,parentGfx:e}),n===`conditional-default-flow-marker`&&m(t,{element:D(`path`,{d:`M 6 4 L 10 16`,...f({stroke:i,fill:`none`})}),ref:{x:0,y:10},scale:.5,parentGfx:e})}function v(e,t,n,r,a={}){i(r)&&(a=r,r=0),r||=0,a=f(a);var o=t/2,s=n/2,c=D(`circle`,{cx:o,cy:s,r:Math.round((t+n)/4-r),...a});return k(e,c),c}function y(e,t,n,r,a,o){i(a)&&(o=a,a=0),a||=0,o=f(o);var s=D(`rect`,{x:a,y:a,width:t-a*2,height:n-a*2,rx:r,ry:r,...o});return k(e,s),s}function ee(e,t,n,r){var i=t/2,a=n/2,o=[{x:i,y:0},{x:t,y:a},{x:i,y:n},{x:0,y:a}].map(function(e){return e.x+`,`+e.y}).join(` `);r=f(r);var s=D(`polygon`,{...r,points:o});return k(e,s),s}function re(e,t,n,r){n=p(n);var i=_e(t,n,r);return k(e,i),i}function ie(e,t,n){return re(e,t,n,5)}function S(e,t,n){n=p(n);var r=D(`path`,{...n,d:t});return k(e,r),r}function C(e,t,n,r){return S(t,n,h({"data-marker":e},r))}function ae(e){return je[e]}function oe(e){return function(t,n,r){return ae(e)(t,n,r)}}var w={"bpmn:MessageEventDefinition":function(e,t,n={},i){return S(e,r.getScaledPath(`EVENT_MESSAGE`,{xScaleFactor:.9,yScaleFactor:.9,containerWidth:n.width||t.width,containerHeight:n.height||t.height,position:{mx:.235,my:.315}}),{fill:i?I(t,u,n.stroke):M(t,c,n.fill),stroke:i?M(t,c,n.fill):I(t,u,n.stroke),strokeWidth:1})},"bpmn:TimerEventDefinition":function(e,t,n={}){var i=n.width||t.width,a=n.height||t.height,o=n.width?1:2,s=v(e,i,a,.2*a,{fill:M(t,c,n.fill),stroke:I(t,u,n.stroke),strokeWidth:o});S(e,r.getScaledPath(`EVENT_TIMER_WH`,{xScaleFactor:.75,yScaleFactor:.75,containerWidth:i,containerHeight:a,position:{mx:.5,my:.5}}),{stroke:I(t,u,n.stroke),strokeWidth:o});for(var l=0;l<12;l++){var d=r.getScaledPath(`EVENT_TIMER_LINE`,{xScaleFactor:.75,yScaleFactor:.75,containerWidth:i,containerHeight:a,position:{mx:.5,my:.5}}),f=i/2,p=a/2;S(e,d,{strokeWidth:1,stroke:I(t,u,n.stroke),transform:`rotate(`+l*30+`,`+p+`,`+f+`)`})}return s},"bpmn:EscalationEventDefinition":function(e,t,n={},i){return S(e,r.getScaledPath(`EVENT_ESCALATION`,{xScaleFactor:1,yScaleFactor:1,containerWidth:n.width||t.width,containerHeight:n.height||t.height,position:{mx:.5,my:.2}}),{fill:i?I(t,u,n.stroke):M(t,c,n.fill),stroke:I(t,u,n.stroke),strokeWidth:1})},"bpmn:ConditionalEventDefinition":function(e,t,n={}){return S(e,r.getScaledPath(`EVENT_CONDITIONAL`,{xScaleFactor:1,yScaleFactor:1,containerWidth:n.width||t.width,containerHeight:n.height||t.height,position:{mx:.5,my:.222}}),{fill:M(t,c,n.fill),stroke:I(t,u,n.stroke),strokeWidth:1})},"bpmn:LinkEventDefinition":function(e,t,n={},i){return S(e,r.getScaledPath(`EVENT_LINK`,{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.57,my:.263}}),{fill:i?I(t,u,n.stroke):M(t,c,n.fill),stroke:I(t,u,n.stroke),strokeWidth:1})},"bpmn:ErrorEventDefinition":function(e,t,n={},i){return S(e,r.getScaledPath(`EVENT_ERROR`,{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:n.width||t.width,containerHeight:n.height||t.height,position:{mx:.2,my:.722}}),{fill:i?I(t,u,n.stroke):M(t,c,n.fill),stroke:I(t,u,n.stroke),strokeWidth:1})},"bpmn:CancelEventDefinition":function(e,t,n={},i){var a=S(e,r.getScaledPath(`EVENT_CANCEL_45`,{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.638,my:-.055}}),{fill:i?I(t,u,n.stroke):`none`,stroke:I(t,u,n.stroke),strokeWidth:1});return fn(a,45),a},"bpmn:CompensateEventDefinition":function(e,t,n={},i){return S(e,r.getScaledPath(`EVENT_COMPENSATION`,{xScaleFactor:1,yScaleFactor:1,containerWidth:n.width||t.width,containerHeight:n.height||t.height,position:{mx:.22,my:.5}}),{fill:i?I(t,u,n.stroke):M(t,c,n.fill),stroke:I(t,u,n.stroke),strokeWidth:1})},"bpmn:SignalEventDefinition":function(e,t,n={},i){return S(e,r.getScaledPath(`EVENT_SIGNAL`,{xScaleFactor:.9,yScaleFactor:.9,containerWidth:n.width||t.width,containerHeight:n.height||t.height,position:{mx:.5,my:.2}}),{strokeWidth:1,fill:i?I(t,u,n.stroke):M(t,c,n.fill),stroke:I(t,u,n.stroke)})},"bpmn:MultipleEventDefinition":function(e,t,n={},i){return S(e,r.getScaledPath(`EVENT_MULTIPLE`,{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:n.width||t.width,containerHeight:n.height||t.height,position:{mx:.211,my:.36}}),{fill:i?I(t,u,n.stroke):M(t,c,n.fill),stroke:I(t,u,n.stroke),strokeWidth:1})},"bpmn:ParallelMultipleEventDefinition":function(e,t,n={}){return S(e,r.getScaledPath(`EVENT_PARALLEL_MULTIPLE`,{xScaleFactor:1.2,yScaleFactor:1.2,containerWidth:n.width||t.width,containerHeight:n.height||t.height,position:{mx:.458,my:.194}}),{fill:M(t,c,n.fill),stroke:I(t,u,n.stroke),strokeWidth:1})},"bpmn:TerminateEventDefinition":function(e,t,n={}){return v(e,t.width,t.height,8,{fill:I(t,u,n.stroke),stroke:I(t,u,n.stroke),strokeWidth:4})}};function T(e,t,n={},r){var i=x(e),a=we(i),o=r||e;return i.get(`eventDefinitions`)&&i.get(`eventDefinitions`).length>1?i.get(`parallelMultiple`)?w[`bpmn:ParallelMultipleEventDefinition`](t,o,n,a):w[`bpmn:MultipleEventDefinition`](t,o,n,a):P(i,`bpmn:MessageEventDefinition`)?w[`bpmn:MessageEventDefinition`](t,o,n,a):P(i,`bpmn:TimerEventDefinition`)?w[`bpmn:TimerEventDefinition`](t,o,n,a):P(i,`bpmn:ConditionalEventDefinition`)?w[`bpmn:ConditionalEventDefinition`](t,o,n,a):P(i,`bpmn:SignalEventDefinition`)?w[`bpmn:SignalEventDefinition`](t,o,n,a):P(i,`bpmn:EscalationEventDefinition`)?w[`bpmn:EscalationEventDefinition`](t,o,n,a):P(i,`bpmn:LinkEventDefinition`)?w[`bpmn:LinkEventDefinition`](t,o,n,a):P(i,`bpmn:ErrorEventDefinition`)?w[`bpmn:ErrorEventDefinition`](t,o,n,a):P(i,`bpmn:CancelEventDefinition`)?w[`bpmn:CancelEventDefinition`](t,o,n,a):P(i,`bpmn:CompensateEventDefinition`)?w[`bpmn:CompensateEventDefinition`](t,o,n,a):P(i,`bpmn:TerminateEventDefinition`)?w[`bpmn:TerminateEventDefinition`](t,o,n,a):null}var se={ParticipantMultiplicityMarker:function(e,t,n={}){var i=N(t,n),a=F(t,n);C(`participant-multiplicity`,e,r.getScaledPath(`MARKER_PARALLEL`,{xScaleFactor:1,yScaleFactor:1,containerWidth:i,containerHeight:a,position:{mx:(i/2-6)/i,my:(a-15)/a}}),{strokeWidth:2,fill:M(t,c,n.fill),stroke:I(t,u,n.stroke)})},SubProcessMarker:function(e,t,n={}){dn(y(e,14,14,0,{strokeWidth:1,fill:M(t,c,n.fill),stroke:I(t,u,n.stroke)}),t.width/2-7.5,t.height-20),C(`sub-process`,e,r.getScaledPath(`MARKER_SUB_PROCESS`,{xScaleFactor:1.5,yScaleFactor:1.5,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2-7.5)/t.width,my:(t.height-20)/t.height}}),{fill:M(t,c,n.fill),stroke:I(t,u,n.stroke)})},ParallelMarker:function(e,t,n){var i=N(t,n),a=F(t,n);C(`parallel`,e,r.getScaledPath(`MARKER_PARALLEL`,{xScaleFactor:1,yScaleFactor:1,containerWidth:i,containerHeight:a,position:{mx:(i/2+n.parallel)/i,my:(a-20)/a}}),{fill:M(t,c,n.fill),stroke:I(t,u,n.stroke)})},SequentialMarker:function(e,t,n){C(`sequential`,e,r.getScaledPath(`MARKER_SEQUENTIAL`,{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2+n.seq)/t.width,my:(t.height-19)/t.height}}),{fill:M(t,c,n.fill),stroke:I(t,u,n.stroke)})},CompensationMarker:function(e,t,n){C(`compensation`,e,r.getScaledPath(`MARKER_COMPENSATION`,{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2+n.compensation)/t.width,my:(t.height-13)/t.height}}),{strokeWidth:1,fill:M(t,c,n.fill),stroke:I(t,u,n.stroke)})},LoopMarker:function(e,t,n){var i=N(t,n),a=F(t,n);C(`loop`,e,r.getScaledPath(`MARKER_LOOP`,{xScaleFactor:1,yScaleFactor:1,containerWidth:i,containerHeight:a,position:{mx:(i/2+n.loop)/i,my:(a-7)/a}}),{strokeWidth:1.5,fill:`none`,stroke:I(t,u,n.stroke),strokeMiterlimit:.5})},AdhocMarker:function(e,t,n){var i=N(t,n),a=F(t,n);C(`adhoc`,e,r.getScaledPath(`MARKER_ADHOC`,{xScaleFactor:1,yScaleFactor:1,containerWidth:i,containerHeight:a,position:{mx:(i/2+n.adhoc)/i,my:(a-15)/a}}),{strokeWidth:1,fill:I(t,u,n.stroke),stroke:I(t,u,n.stroke)})}};function le(e,t,n,r){se[e](t,n,r)}function ue(e,t,n=[],r={}){r={fill:r.fill,stroke:r.stroke,width:N(t,r),height:F(t,r)};var i=x(t),a=n.includes(`SubProcessMarker`);r=a?{...r,seq:-21,parallel:-22,compensation:-25,loop:-18,adhoc:10}:{...r,seq:-5,parallel:-6,compensation:-7,loop:0,adhoc:-8},i.get(`isForCompensation`)&&n.push(`CompensationMarker`),b(i,`bpmn:AdHocSubProcess`)&&(n.push(`AdhocMarker`),a||h(r,{compensation:r.compensation-18}));var o=i.get(`loopCharacteristics`),s=o&&o.get(`isSequential`);o&&(h(r,{compensation:r.compensation-18}),n.includes(`AdhocMarker`)&&h(r,{seq:-23,loop:-18,parallel:-24}),s===void 0&&n.push(`LoopMarker`),s===!1&&n.push(`ParallelMarker`),s===!0&&n.push(`SequentialMarker`)),n.includes(`CompensationMarker`)&&n.length===1&&h(r,{compensation:-8}),l(n,function(n){le(n,e,t,r)})}function A(e,t,n={}){n=h({size:{width:100}},n);var r=o.createText(t||``,n);return O(r).add(`djs-label`),k(e,r),r}function fe(e,t,n,r={}){var i=x(t),a=Ce({x:t.x,y:t.y,width:t.width,height:t.height},r);return A(e,i.name,{align:n,box:a,padding:7,style:{fill:Ee(t,d,u,r.stroke)}})}function j(e,t,n={}){var r={width:t.width,height:t.height,x:t.width/2+t.x,y:t.height/2+t.y};return A(e,ne(t),{box:r,style:h({},o.getExternalStyle(),{fill:Ee(t,d,u,n.stroke)})})}function me(e,t,n,r={}){var i=xe(n),a=A(e,t,{box:{height:30,width:i?F(n,r):N(n,r)},align:`center-middle`,style:{fill:Ee(n,d,u,r.stroke)}});i&&un(a,0,-(-1*F(n,r)),270)}function he(e,t,n={}){var{width:r,height:i}=Ce(t,n);return y(e,r,i,qn,{...n,fill:M(t,c,n.fill),fillOpacity:Yn,stroke:I(t,u,n.stroke)})}function ve(e,t,n={}){var r=x(t),i=M(t,c,n.fill),a=I(t,u,n.stroke);return(r.get(`associationDirection`)===`One`||r.get(`associationDirection`)===`Both`)&&(n.markerEnd=g(e,`association-end`,i,a)),r.get(`associationDirection`)===`Both`&&(n.markerStart=g(e,`association-start`,i,a)),n=Z(n,[`markerStart`,`markerEnd`]),ie(e,t.waypoints,{...n,stroke:a,strokeDasharray:`0, 5`})}function ye(e,t,n={}){var i=M(t,c,n.fill),a=I(t,u,n.stroke),o=S(e,r.getScaledPath(`DATA_OBJECT_PATH`,{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.474,my:.296}}),{fill:i,fillOpacity:Yn,stroke:a}),s=x(t);return ge(s)&&S(e,r.getScaledPath(`DATA_OBJECT_COLLECTION_PATH`,{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.33,my:(t.height-18)/t.height}}),{strokeWidth:2,fill:i,stroke:a}),o}function be(e,t,n={}){return v(e,t.width,t.height,{fillOpacity:Yn,...n,fill:M(t,c,n.fill),stroke:I(t,u,n.stroke)})}function Se(e,t,n={}){return ee(e,t.width,t.height,{fill:M(t,c,n.fill),fillOpacity:Yn,stroke:I(t,u,n.stroke)})}function Te(e,t,n={}){var r=y(e,N(t,n),F(t,n),0,{fill:M(t,c,n.fill),fillOpacity:n.fillOpacity||Yn,stroke:I(t,u,n.stroke),strokeWidth:1.5}),i=x(t);return b(i,`bpmn:Lane`)&&me(e,i.get(`name`),t,n),r}function Oe(e,t,n={}){var r=he(e,t,n),i=pe(t);if(de(t)&&(E(r,{strokeDasharray:`0, 5.5`,strokeWidth:2.5}),!i)){var a=(x(t).flowElements||[]).filter(e=>b(e,`bpmn:StartEvent`));a.length===1&&ke(a[0],e,n,t)}return fe(e,t,i?`center-top`:`center-middle`,n),i?ue(e,t,void 0,n):ue(e,t,[`SubProcessMarker`],n),r}function ke(e,t,n,r){var i=22,a={fill:M(r,c,n.fill),stroke:I(r,u,n.stroke),width:i,height:i},o=x(e).isInterrupting,s=o?0:3,l=o?1:1.2,d=20,f=(i-d)/2,p=`translate(`+f+`,`+f+`)`;v(t,d,d,{fill:a.fill,stroke:a.stroke,strokeWidth:l,strokeDasharray:s,transform:p}),T(e,t,a,r)}function Ae(e,t,n={}){var r=he(e,t,n);return fe(e,t,`center-middle`,n),ue(e,t,void 0,n),r}var je=this.handlers={"bpmn:AdHocSubProcess":function(e,t,n={}){return n=pe(t)?Z(n,[`fill`,`stroke`,`width`,`height`]):Z(n,[`fill`,`stroke`]),Oe(e,t,n)},"bpmn:Association":function(e,t,n={}){return n=Z(n,[`fill`,`stroke`]),ve(e,t,n)},"bpmn:BoundaryEvent":function(e,t,n={}){var{renderIcon:r=!0}=n;n=Z(n,[`fill`,`stroke`]);var i=x(t).get(`cancelActivity`);n={strokeWidth:1.5,fill:M(t,c,n.fill),fillOpacity:Xn,stroke:I(t,u,n.stroke)},i||(n.strokeDasharray=`6`);var a=be(e,t,n);return v(e,t.width,t.height,Gn,{...n,fill:`none`}),r&&T(t,e,n),a},"bpmn:BusinessRuleTask":function(e,t,n={}){n=Z(n,[`fill`,`stroke`]);var i=Ae(e,t,n),a=S(e,r.getScaledPath(`TASK_TYPE_BUSINESS_RULE_MAIN`,{abspos:{x:8,y:8}}));E(a,{fill:M(t,c,n.fill),stroke:I(t,u,n.stroke),strokeWidth:1});var o=S(e,r.getScaledPath(`TASK_TYPE_BUSINESS_RULE_HEADER`,{abspos:{x:8,y:8}}));return E(o,{fill:I(t,u,n.stroke),stroke:I(t,u,n.stroke),strokeWidth:1}),i},"bpmn:CallActivity":function(e,t,n={}){return n=Z(n,[`fill`,`stroke`]),Oe(e,t,{strokeWidth:5,...n})},"bpmn:ComplexGateway":function(e,t,n={}){n=Z(n,[`fill`,`stroke`]);var i=Se(e,t,n);return S(e,r.getScaledPath(`GATEWAY_COMPLEX`,{xScaleFactor:.5,yScaleFactor:.5,containerWidth:t.width,containerHeight:t.height,position:{mx:.46,my:.26}}),{fill:I(t,u,n.stroke),stroke:I(t,u,n.stroke),strokeWidth:1}),i},"bpmn:DataInput":function(e,t,n={}){n=Z(n,[`fill`,`stroke`]);var i=r.getRawPath(`DATA_ARROW`),a=ye(e,t,n);return S(e,i,{fill:`none`,stroke:I(t,u,n.stroke),strokeWidth:1}),a},"bpmn:DataInputAssociation":function(e,t,n={}){return n=Z(n,[`fill`,`stroke`]),ve(e,t,{...n,markerEnd:g(e,`association-end`,M(t,c,n.fill),I(t,u,n.stroke))})},"bpmn:DataObject":function(e,t,n={}){return n=Z(n,[`fill`,`stroke`]),ye(e,t,n)},"bpmn:DataObjectReference":oe(`bpmn:DataObject`),"bpmn:DataOutput":function(e,t,n={}){n=Z(n,[`fill`,`stroke`]);var i=r.getRawPath(`DATA_ARROW`),a=ye(e,t,n);return S(e,i,{strokeWidth:1,fill:I(t,u,n.stroke),stroke:I(t,u,n.stroke)}),a},"bpmn:DataOutputAssociation":function(e,t,n={}){return n=Z(n,[`fill`,`stroke`]),ve(e,t,{...n,markerEnd:g(e,`association-end`,M(t,c,n.fill),I(t,u,n.stroke))})},"bpmn:DataStoreReference":function(e,t,n={}){return n=Z(n,[`fill`,`stroke`]),S(e,r.getScaledPath(`DATA_STORE`,{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:0,my:.133}}),{fill:M(t,c,n.fill),fillOpacity:Yn,stroke:I(t,u,n.stroke),strokeWidth:2})},"bpmn:EndEvent":function(e,t,n={}){var{renderIcon:r=!0}=n;n=Z(n,[`fill`,`stroke`]);var i=be(e,t,{...n,strokeWidth:4});return r&&T(t,e,n),i},"bpmn:EventBasedGateway":function(e,t,n={}){n=Z(n,[`fill`,`stroke`]);var i=x(t),a=Se(e,t,n);v(e,t.width,t.height,t.height*.2,{fill:M(t,`none`,n.fill),stroke:I(t,u,n.stroke),strokeWidth:1});var o=i.get(`eventGatewayType`),s=!!i.get(`instantiate`);function c(){S(e,r.getScaledPath(`GATEWAY_EVENT_BASED`,{xScaleFactor:.18,yScaleFactor:.18,containerWidth:t.width,containerHeight:t.height,position:{mx:.36,my:.44}}),{fill:`none`,stroke:I(t,u,n.stroke),strokeWidth:2})}return o===`Parallel`?S(e,r.getScaledPath(`GATEWAY_PARALLEL`,{xScaleFactor:.4,yScaleFactor:.4,containerWidth:t.width,containerHeight:t.height,position:{mx:.474,my:.296}}),{fill:`none`,stroke:I(t,u,n.stroke),strokeWidth:1}):o===`Exclusive`&&(s||v(e,t.width,t.height,t.height*.26,{fill:`none`,stroke:I(t,u,n.stroke),strokeWidth:1}),c()),a},"bpmn:ExclusiveGateway":function(e,t,n={}){n=Z(n,[`fill`,`stroke`]);var i=Se(e,t,n),a=r.getScaledPath(`GATEWAY_EXCLUSIVE`,{xScaleFactor:.4,yScaleFactor:.4,containerWidth:t.width,containerHeight:t.height,position:{mx:.32,my:.3}});return te(t).get(`isMarkerVisible`)&&S(e,a,{fill:I(t,u,n.stroke),stroke:I(t,u,n.stroke),strokeWidth:1}),i},"bpmn:Gateway":function(e,t,n={}){return n=Z(n,[`fill`,`stroke`]),Se(e,t,n)},"bpmn:Group":function(e,t,n={}){return n=Z(n,[`fill`,`stroke`,`width`,`height`]),y(e,t.width,t.height,qn,{stroke:I(t,u,n.stroke),strokeWidth:1.5,strokeDasharray:`10, 6, 0, 6`,fill:`none`,pointerEvents:`none`,width:N(t,n),height:F(t,n)})},"bpmn:InclusiveGateway":function(e,t,n={}){n=Z(n,[`fill`,`stroke`]);var r=Se(e,t,n);return v(e,t.width,t.height,t.height*.24,{fill:M(t,c,n.fill),stroke:I(t,u,n.stroke),strokeWidth:2.5}),r},"bpmn:IntermediateEvent":function(e,t,n={}){var{renderIcon:r=!0}=n;n=Z(n,[`fill`,`stroke`]);var i=be(e,t,{...n,strokeWidth:1.5});return v(e,t.width,t.height,Gn,{fill:`none`,stroke:I(t,u,n.stroke),strokeWidth:1.5}),r&&T(t,e,n),i},"bpmn:IntermediateCatchEvent":oe(`bpmn:IntermediateEvent`),"bpmn:IntermediateThrowEvent":oe(`bpmn:IntermediateEvent`),"bpmn:Lane":function(e,t,n={}){return n=Z(n,[`fill`,`stroke`,`width`,`height`]),Te(e,t,{...n,fillOpacity:Zn})},"bpmn:ManualTask":function(e,t,n={}){n=Z(n,[`fill`,`stroke`]);var i=Ae(e,t,n);return S(e,r.getScaledPath(`TASK_TYPE_MANUAL`,{abspos:{x:17,y:15}}),{fill:M(t,c,n.fill),stroke:I(t,u,n.stroke),strokeWidth:.5}),i},"bpmn:MessageFlow":function(e,t,n={}){n=Z(n,[`fill`,`stroke`]);var i=x(t),a=te(t),o=M(t,c,n.fill),s=I(t,u,n.stroke),l=ie(e,t.waypoints,{markerEnd:g(e,`messageflow-end`,o,s),markerStart:g(e,`messageflow-start`,o,s),stroke:s,strokeDasharray:`10, 11`,strokeWidth:1.5});if(i.get(`messageRef`)){var d=l.getPointAtLength(l.getTotalLength()/2),f=r.getScaledPath(`MESSAGE_FLOW_MARKER`,{abspos:{x:d.x,y:d.y}}),p={strokeWidth:1};a.get(`messageVisibleKind`)===`initiating`?(p.fill=o,p.stroke=s):(p.fill=s,p.stroke=o);var m=S(e,f,p),h=A(e,i.get(`messageRef`).get(`name`),{align:`center-top`,fitBox:!0,style:{fill:s}}),_=m.getBBox(),v=h.getBBox();un(h,d.x-v.width/2,d.y+_.height/2+Wn,0)}return l},"bpmn:ParallelGateway":function(e,t,n={}){n=Z(n,[`fill`,`stroke`]);var i=Se(e,t,n);return S(e,r.getScaledPath(`GATEWAY_PARALLEL`,{xScaleFactor:.6,yScaleFactor:.6,containerWidth:t.width,containerHeight:t.height,position:{mx:.46,my:.2}}),{fill:I(t,u,n.stroke),stroke:I(t,u,n.stroke),strokeWidth:1}),i},"bpmn:Participant":function(e,t,n={}){n=Z(n,[`fill`,`stroke`,`width`,`height`]);var r=Te(e,t,n),i=pe(t),a=xe(t),o=x(t),s=o.get(`name`);if(i)re(e,a?[{x:30,y:0},{x:30,y:F(t,n)}]:[{x:0,y:30},{x:N(t,n),y:30}],{stroke:I(t,u,n.stroke),strokeWidth:Kn}),me(e,s,t,n);else{var c=Ce(t,n);a||(c.height=N(t,n),c.width=F(t,n));var l=A(e,s,{box:c,align:`center-middle`,style:{fill:Ee(t,d,u,n.stroke)}});a||un(l,0,-(-1*F(t,n)),270)}return o.get(`participantMultiplicity`)&&le(`ParticipantMultiplicityMarker`,e,t,n),r},"bpmn:ReceiveTask":function(e,t,n={}){n=Z(n,[`fill`,`stroke`]);var i=x(t),a=Ae(e,t,n),o;return i.get(`instantiate`)?(v(e,28,28,4.4,{fill:M(t,c,n.fill),stroke:I(t,u,n.stroke),strokeWidth:1}),o=r.getScaledPath(`TASK_TYPE_INSTANTIATING_SEND`,{abspos:{x:7.77,y:9.52}})):o=r.getScaledPath(`TASK_TYPE_SEND`,{xScaleFactor:.9,yScaleFactor:.9,containerWidth:21,containerHeight:14,position:{mx:.3,my:.4}}),S(e,o,{fill:M(t,c,n.fill),stroke:I(t,u,n.stroke),strokeWidth:1}),a},"bpmn:ScriptTask":function(e,t,n={}){n=Z(n,[`fill`,`stroke`]);var i=Ae(e,t,n);return S(e,r.getScaledPath(`TASK_TYPE_SCRIPT`,{abspos:{x:15,y:20}}),{fill:M(t,c,n.fill),stroke:I(t,u,n.stroke),strokeWidth:1}),i},"bpmn:SendTask":function(e,t,n={}){n=Z(n,[`fill`,`stroke`]);var i=Ae(e,t,n);return S(e,r.getScaledPath(`TASK_TYPE_SEND`,{xScaleFactor:1,yScaleFactor:1,containerWidth:21,containerHeight:14,position:{mx:.285,my:.357}}),{fill:I(t,u,n.stroke),stroke:M(t,c,n.fill),strokeWidth:1}),i},"bpmn:SequenceFlow":function(e,t,n={}){n=Z(n,[`fill`,`stroke`]);var r=M(t,c,n.fill),i=I(t,u,n.stroke),a=ie(e,t.waypoints,{markerEnd:g(e,`sequenceflow-end`,r,i),stroke:i}),o=x(t),{source:s}=t;if(s){var l=x(s);o.get(`conditionExpression`)&&b(l,`bpmn:Activity`)&&E(a,{markerStart:g(e,`conditional-flow-marker`,r,i)}),l.get(`default`)&&(b(l,`bpmn:Gateway`)||b(l,`bpmn:Activity`))&&l.get(`default`)===o&&E(a,{markerStart:g(e,`conditional-default-flow-marker`,r,i)})}return a},"bpmn:ServiceTask":function(e,t,n={}){n=Z(n,[`fill`,`stroke`]);var i=Ae(e,t,n);return v(e,10,10,{fill:M(t,c,n.fill),stroke:`none`,transform:`translate(6, 6)`}),S(e,r.getScaledPath(`TASK_TYPE_SERVICE`,{abspos:{x:12,y:18}}),{fill:M(t,c,n.fill),stroke:I(t,u,n.stroke),strokeWidth:1}),v(e,10,10,{fill:M(t,c,n.fill),stroke:`none`,transform:`translate(11, 10)`}),S(e,r.getScaledPath(`TASK_TYPE_SERVICE`,{abspos:{x:17,y:22}}),{fill:M(t,c,n.fill),stroke:I(t,u,n.stroke),strokeWidth:1}),i},"bpmn:StartEvent":function(e,t,n={}){var{renderIcon:r=!0}=n;n=Z(n,[`fill`,`stroke`]),x(t).get(`isInterrupting`)||(n={...n,strokeDasharray:`6`});var i=be(e,t,n);return r&&T(t,e,n),i},"bpmn:SubProcess":function(e,t,n={}){return n=pe(t)?Z(n,[`fill`,`stroke`,`width`,`height`]):Z(n,[`fill`,`stroke`]),Oe(e,t,n)},"bpmn:Task":function(e,t,n={}){return n=Z(n,[`fill`,`stroke`]),Ae(e,t,n)},"bpmn:TextAnnotation":function(e,t,n={}){n=Z(n,[`fill`,`stroke`]);var{width:i,height:a}=Ce(t,n),o=y(e,i,a,0,0,{fill:`none`,stroke:`none`});return S(e,r.getScaledPath(`TEXT_ANNOTATION`,{xScaleFactor:1,yScaleFactor:1,containerWidth:i,containerHeight:a,position:{mx:0,my:0}}),{stroke:I(t,u,n.stroke)}),A(e,x(t).get(`text`)||``,{align:`left-top`,box:Ce(t,n),padding:7,style:{fill:Ee(t,d,u,n.stroke)}}),o},"bpmn:Transaction":function(e,t,r={}){r=pe(t)?Z(r,[`fill`,`stroke`,`width`,`height`]):Z(r,[`fill`,`stroke`]);var i=Oe(e,t,{strokeWidth:1.5,...r}),a=n.style([`no-fill`,`no-events`],{stroke:I(t,u,r.stroke),strokeWidth:1.5});return pe(t)||(r={}),y(e,N(t,r),F(t,r),qn-Gn,Gn,a),i},"bpmn:UserTask":function(e,t,n={}){n=Z(n,[`fill`,`stroke`]);var i=Ae(e,t,n),a=15,o=12;return S(e,r.getScaledPath(`TASK_TYPE_USER_1`,{abspos:{x:a,y:o}}),{fill:M(t,c,n.fill),stroke:I(t,u,n.stroke),strokeWidth:.5}),S(e,r.getScaledPath(`TASK_TYPE_USER_2`,{abspos:{x:a,y:o}}),{fill:M(t,c,n.fill),stroke:I(t,u,n.stroke),strokeWidth:.5}),S(e,r.getScaledPath(`TASK_TYPE_USER_3`,{abspos:{x:a,y:o}}),{fill:I(t,u,n.stroke),stroke:I(t,u,n.stroke),strokeWidth:.5}),i},label:function(e,t,n={}){return j(e,t,n)}};this._drawPath=S,this._renderer=ae}j(Qn,ce),Qn.$inject=[`config.bpmnRenderer`,`eventBus`,`styles`,`pathMap`,`canvas`,`textRenderer`],Qn.prototype.canRender=function(e){return b(e,`bpmn:BaseElement`)},Qn.prototype.drawShape=function(e,t,n={}){var{type:r}=t;return this._renderer(r)(e,t,n)},Qn.prototype.drawConnection=function(e,t,n={}){var{type:r}=t;return this._renderer(r)(e,t,n)},Qn.prototype.getShapePath=function(e){return C(e)?Se(e,Jn):b(e,`bpmn:Event`)?Te(e):b(e,`bpmn:Activity`)?Se(e,qn):b(e,`bpmn:Gateway`)?ye(e):he(e)};function Z(e,t=[]){return t.reduce((t,n)=>(e[n]&&(t[n]=e[n]),t),{})}var $n=0,er={width:150,height:50};function tr(e){var t=e.split(`-`);return{horizontal:t[0]||`center`,vertical:t[1]||`top`}}function nr(e){return i(e)?h({top:0,left:0,right:0,bottom:0},e):{top:e,left:e,right:e,bottom:e}}var rr=null;function ir(){return rr||=document.createElement(`canvas`).getContext(`2d`),rr}function ar(e){var t=[];return e.fontStyle&&t.push(e.fontStyle),e.fontVariant&&t.push(e.fontVariant),e.fontWeight&&t.push(e.fontWeight),e.fontStretch&&t.push(e.fontStretch),t.push(or(e.fontSize)||`12px`),t.push(e.fontFamily||`sans-serif`),t.join(` `)}function or(e){if(e!=null)return typeof e==`number`||/^-?\d+(\.\d+)?$/.test(e)?e+`px`:e}function sr(e,t){var n=ir();if(!n)return{width:0,height:0};n.font=ar(t),`letterSpacing`in n&&(n.letterSpacing=or(t.letterSpacing)||`0px`);var r=e===``,i=r?`dummy`:e.replace(/\s+$/,``),a=n.measureText(i);return{width:r?0:a.width,height:`fontBoundingBoxAscent`in a?a.fontBoundingBoxAscent+a.fontBoundingBoxDescent:a.actualBoundingBoxAscent+a.actualBoundingBoxDescent}}function cr(e,t,n){for(var r=e.shift(),i=r,a;;){if(a=sr(i,n),a.width=i?a.width:0,i===` `||i===``||a.width<=t||i.length<2)return lr(e,i,r,a);i=fr(i,a.width,t)}}function lr(e,t,n,r){if(t.length<n.length){var i=n.slice(t.length).trim();e.unshift(i)}return{width:r.width,height:r.height,text:t}}var ur=`­`;function dr(e,t){var n=e.split(/(\s|-|\u00AD)/g),r,i=[],a=0;if(n.length>1)for(;r=n.shift();)if(r.length+a<t)i.push(r),a+=r.length;else{(r===`-`||r===ur)&&i.pop();break}var o=i[i.length-1];return o&&o===ur&&(i[i.length-1]=`-`),i.join(``)}function fr(e,t,n){var r=Math.max(e.length*(n/t),1),i=dr(e,r);return i||=e.slice(0,Math.max(Math.round(r-1),1)),i}function pr(e){this._config=h({},{size:er,padding:$n,style:{},align:`center-top`},e||{})}pr.prototype.createText=function(e,t){return this.layoutText(e,t).element},pr.prototype.getDimensions=function(e,t){return this.layoutText(e,t).dimensions},pr.prototype.layoutText=function(e,t){for(var n=h({},this._config.size,t.box),i=h({},this._config.style,t.style),a=tr(t.align||this._config.align),o=nr(t.padding===void 0?this._config.padding:t.padding),s=t.fitBox||!1,c=mr(i),u=e.split(/\u00AD?\r?\n/),d=[],f=n.width-o.left-o.right;u.length;)d.push(cr(u,f,i));a.vertical===`middle`&&(o.top=o.bottom=0);var p=r(d,function(e,t,n){return e+(c||t.height)},0)+o.top+o.bottom,m=r(d,function(e,t,n){return t.width>e?t.width:e},0),g=o.top;a.vertical===`middle`&&(g+=(n.height-p)/2),g-=(c||d[0].height)/4;var _=D(`text`);return E(_,i),l(d,function(e){var t;switch(g+=c||e.height,a.horizontal){case`left`:t=o.left;break;case`right`:t=(s?m:f)-o.right-e.width;break;default:t=Math.max(((s?m:f)-e.width)/2+o.left,0)}var n=D(`tspan`);E(n,{x:t,y:g}),n.textContent=e.text,k(_,n)}),{dimensions:{width:m,height:p},element:_}};function mr(e){if(`fontSize`in e&&`lineHeight`in e)return e.lineHeight*parseInt(e.fontSize,10)}var hr=12,gr=1.2,_r=40;function vr(e){var t=h({fontFamily:`Arial, sans-serif`,fontSize:hr,fontWeight:`normal`,lineHeight:gr},e&&e.defaultStyle||{}),n=parseInt(t.fontSize,10)-1,r=h({},t,{fontSize:n},e&&e.externalStyle||{}),i=new pr({style:t});this.getExternalLabelBounds=function(e,t){var n=a(t,{width:Math.max(e.width,S.width),height:30},{style:r});return{x:Math.round(e.x+e.width/2-n.width/2),y:e.y,width:Math.ceil(n.width),height:Math.ceil(n.height)}},this.getTextAnnotationBounds=function(e,n){var r=a(n,e,{style:t,align:`left-top`,padding:7});return{x:e.x,y:e.y,width:e.width,height:Math.max(_r,Math.round(r.height))}},this.getDimensions=function(e,t){return i.getDimensions(e,t||{})};function a(e,t,n){return i.getDimensions(e,h({box:t},n))}this.createText=function(e,t){return i.createText(e,t||{})},this.getDefaultStyle=function(){return t},this.getExternalStyle=function(){return r}}vr.$inject=[`config.textRenderer`];function yr(){this.pathMap={EVENT_MESSAGE:{d:`m {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}`,height:36,width:36,heightElements:[6,14],widthElements:[10.5,21]},EVENT_SIGNAL:{d:`M {mx},{my} l {e.x0},{e.y0} l -{e.x1},0 Z`,height:36,width:36,heightElements:[18],widthElements:[10,20]},EVENT_ESCALATION:{d:`M {mx},{my} l {e.x0},{e.y0} l -{e.x0},-{e.y1} l -{e.x0},{e.y1} Z`,height:36,width:36,heightElements:[20,7],widthElements:[8]},EVENT_CONDITIONAL:{d:`M {e.x0},{e.y0} l {e.x1},0 l 0,{e.y2} l -{e.x1},0 Z M {e.x2},{e.y3} l {e.x0},0 M {e.x2},{e.y4} l {e.x0},0 M {e.x2},{e.y5} l {e.x0},0 M {e.x2},{e.y6} l {e.x0},0 M {e.x2},{e.y7} l {e.x0},0 M {e.x2},{e.y8} l {e.x0},0 `,height:36,width:36,heightElements:[8.5,14.5,18,11.5,14.5,17.5,20.5,23.5,26.5],widthElements:[10.5,14.5,12.5]},EVENT_LINK:{d:`m {mx},{my} 0,{e.y0} -{e.x1},0 0,{e.y1} {e.x1},0 0,{e.y0} {e.x0},-{e.y2} -{e.x0},-{e.y2} z`,height:36,width:36,heightElements:[4.4375,6.75,7.8125],widthElements:[9.84375,13.5]},EVENT_ERROR:{d:`m {mx},{my} {e.x0},-{e.y0} {e.x1},-{e.y1} {e.x2},{e.y2} {e.x3},-{e.y3} -{e.x4},{e.y4} -{e.x5},-{e.y5} z`,height:36,width:36,heightElements:[.023,8.737,8.151,16.564,10.591,8.714],widthElements:[.085,6.672,6.97,4.273,5.337,6.636]},EVENT_CANCEL_45:{d:`m {mx},{my} -{e.x1},0 0,{e.x0} {e.x1},0 0,{e.y1} {e.x0},0 0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z`,height:36,width:36,heightElements:[4.75,8.5],widthElements:[4.75,8.5]},EVENT_COMPENSATION:{d:`m {mx},{my} {e.x0},-{e.y0} 0,{e.y1} z m {e.x1},-{e.y2} {e.x2},-{e.y3} 0,{e.y1} -{e.x2},-{e.y3} z`,height:36,width:36,heightElements:[6.5,13,.4,6.1],widthElements:[9,9.3,8.7]},EVENT_TIMER_WH:{d:`M {mx},{my} l {e.x0},-{e.y0} m -{e.x0},{e.y0} l {e.x1},{e.y1} `,height:36,width:36,heightElements:[10,2],widthElements:[3,7]},EVENT_TIMER_LINE:{d:`M {mx},{my} m {e.x0},{e.y0} l -{e.x1},{e.y1} `,height:36,width:36,heightElements:[10,3],widthElements:[0,0]},EVENT_MULTIPLE:{d:`m {mx},{my} {e.x1},-{e.y0} {e.x1},{e.y0} -{e.x0},{e.y1} -{e.x2},0 z`,height:36,width:36,heightElements:[6.28099,12.56199],widthElements:[3.1405,9.42149,12.56198]},EVENT_PARALLEL_MULTIPLE:{d:`m {mx},{my} {e.x0},0 0,{e.y1} {e.x1},0 0,{e.y0} -{e.x1},0 0,{e.y1} -{e.x0},0 0,-{e.y1} -{e.x1},0 0,-{e.y0} {e.x1},0 z`,height:36,width:36,heightElements:[2.56228,7.68683],widthElements:[2.56228,7.68683]},GATEWAY_EXCLUSIVE:{d:`m {mx},{my} {e.x0},{e.y0} {e.x1},{e.y0} {e.x2},0 {e.x4},{e.y2} {e.x4},{e.y1} {e.x2},0 {e.x1},{e.y3} {e.x0},{e.y3} {e.x3},0 {e.x5},{e.y1} {e.x5},{e.y2} {e.x3},0 z`,height:17.5,width:17.5,heightElements:[8.5,6.5312,-6.5312,-8.5],widthElements:[6.5,-6.5,3,-3,5,-5]},GATEWAY_PARALLEL:{d:`m {mx},{my} 0,{e.y1} -{e.x1},0 0,{e.y0} {e.x1},0 0,{e.y1} {e.x0},0 0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z`,height:30,width:30,heightElements:[5,12.5],widthElements:[5,12.5]},GATEWAY_EVENT_BASED:{d:`m {mx},{my} {e.x0},{e.y0} {e.x0},{e.y1} {e.x1},{e.y2} {e.x2},0 z`,height:11,width:11,heightElements:[-6,6,12,-12],widthElements:[9,-3,-12]},GATEWAY_COMPLEX:{d:`m {mx},{my} 0,{e.y0} -{e.x0},-{e.y1} -{e.x1},{e.y2} {e.x0},{e.y1} -{e.x2},0 0,{e.y3} {e.x2},0 -{e.x0},{e.y1} l {e.x1},{e.y2} {e.x0},-{e.y1} 0,{e.y0} {e.x3},0 0,-{e.y0} {e.x0},{e.y1} {e.x1},-{e.y2} -{e.x0},-{e.y1} {e.x2},0 0,-{e.y3} -{e.x2},0 {e.x0},-{e.y1} -{e.x1},-{e.y2} -{e.x0},{e.y1} 0,-{e.y0} -{e.x3},0 z`,height:17.125,width:17.125,heightElements:[4.875,3.4375,2.125,3],widthElements:[3.4375,2.125,4.875,3]},DATA_OBJECT_PATH:{d:`m 0,0 {e.x1},0 {e.x0},{e.y0} 0,{e.y1} -{e.x2},0 0,-{e.y2} {e.x1},0 0,{e.y0} {e.x0},0`,height:61,width:51,heightElements:[10,50,60],widthElements:[10,40,50,60]},DATA_OBJECT_COLLECTION_PATH:{d:`m{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10`,height:10,width:10,heightElements:[],widthElements:[]},DATA_ARROW:{d:`m 5,9 9,0 0,-3 5,5 -5,5 0,-3 -9,0 z`,height:61,width:51,heightElements:[],widthElements:[]},DATA_STORE:{d:`m {mx},{my} l 0,{e.y2} c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 l 0,-{e.y2} c -{e.x0},-{e.y1} -{e.x1},-{e.y1} -{e.x2},0c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 m -{e.x2},{e.y0}c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0m -{e.x2},{e.y0}c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0`,height:61,width:61,heightElements:[7,10,45],widthElements:[2,58,60]},TEXT_ANNOTATION:{d:`m {mx}, {my} m 10,0 l -10,0 l 0,{e.y0} l 10,0`,height:30,width:10,heightElements:[30],widthElements:[10]},MARKER_SUB_PROCESS:{d:`m{mx},{my} m 7,2 l 0,10 m -5,-5 l 10,0`,height:10,width:10,heightElements:[],widthElements:[]},MARKER_PARALLEL:{d:`m{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10`,height:10,width:10,heightElements:[],widthElements:[]},MARKER_SEQUENTIAL:{d:`m{mx},{my} m 0,3 l 10,0 m -10,3 l 10,0 m -10,3 l 10,0`,height:10,width:10,heightElements:[],widthElements:[]},MARKER_COMPENSATION:{d:`m {mx},{my} 7,-5 0,10 z m 7.1,-0.3 6.9,-4.7 0,10 -6.9,-4.7 z`,height:10,width:21,heightElements:[],widthElements:[]},MARKER_LOOP:{d:`m {mx},{my} c 3.526979,0 6.386161,-2.829858 6.386161,-6.320661 0,-3.490806 -2.859182,-6.320661 -6.386161,-6.320661 -3.526978,0 -6.38616,2.829855 -6.38616,6.320661 0,1.745402 0.714797,3.325567 1.870463,4.469381 0.577834,0.571908 1.265885,1.034728 2.029916,1.35457 l -0.718163,-3.909793 m 0.718163,3.909793 -3.885211,0.802902`,height:13.9,width:13.7,heightElements:[],widthElements:[]},MARKER_ADHOC:{d:`m {mx},{my} m 0.84461,2.64411 c 1.05533,-1.23780996 2.64337,-2.07882 4.29653,-1.97997996 2.05163,0.0805 3.85579,1.15803 5.76082,1.79107 1.06385,0.34139996 2.24454,0.1438 3.18759,-0.43767 0.61743,-0.33642 1.2775,-0.64078 1.7542,-1.17511 0,0.56023 0,1.12046 0,1.6807 -0.98706,0.96237996 -2.29792,1.62393996 -3.6918,1.66181996 -1.24459,0.0927 -2.46671,-0.2491 -3.59505,-0.74812 -1.35789,-0.55965 -2.75133,-1.33436996 -4.27027,-1.18121996 -1.37741,0.14601 -2.41842,1.13685996 -3.44288,1.96782996 z`,height:4,width:15,heightElements:[],widthElements:[]},TASK_TYPE_SEND:{d:`m {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}`,height:14,width:21,heightElements:[6,14],widthElements:[10.5,21]},TASK_TYPE_SCRIPT:{d:`m {mx},{my} c 9.966553,-6.27276 -8.000926,-7.91932 2.968968,-14.938 l -8.802728,0 c -10.969894,7.01868 6.997585,8.66524 -2.968967,14.938 z m -7,-12 l 5,0 m -4.5,3 l 4.5,0 m -3,3 l 5,0m -4,3 l 5,0`,height:15,width:12.6,heightElements:[6,14],widthElements:[10.5,21]},TASK_TYPE_USER_1:{d:`m {mx},{my} c 0.909,-0.845 1.594,-2.049 1.594,-3.385 0,-2.554 -1.805,-4.62199999 -4.357,-4.62199999 -2.55199998,0 -4.28799998,2.06799999 -4.28799998,4.62199999 0,1.348 0.974,2.562 1.89599998,3.405 -0.52899998,0.187 -5.669,2.097 -5.794,4.7560005 v 6.718 h 17 v -6.718 c 0,-2.2980005 -5.5279996,-4.5950005 -6.0509996,-4.7760005 zm -8,6 l 0,5.5 m 11,0 l 0,-5`},TASK_TYPE_USER_2:{d:`m {mx},{my} m 2.162,1.009 c 0,2.4470005 -2.158,4.4310005 -4.821,4.4310005 -2.66499998,0 -4.822,-1.981 -4.822,-4.4310005 `},TASK_TYPE_USER_3:{d:`m {mx},{my} m -6.9,-3.80 c 0,0 2.25099998,-2.358 4.27399998,-1.177 2.024,1.181 4.221,1.537 4.124,0.965 -0.098,-0.57 -0.117,-3.79099999 -4.191,-4.13599999 -3.57499998,0.001 -4.20799998,3.36699999 -4.20699998,4.34799999 z`},TASK_TYPE_MANUAL:{d:`m {mx},{my} c 0.234,-0.01 5.604,0.008 8.029,0.004 0.808,0 1.271,-0.172 1.417,-0.752 0.227,-0.898 -0.334,-1.314 -1.338,-1.316 -2.467,-0.01 -7.886,-0.004 -8.108,-0.004 -0.014,-0.079 0.016,-0.533 0,-0.61 0.195,-0.042 8.507,0.006 9.616,0.002 0.877,-0.007 1.35,-0.438 1.353,-1.208 0.003,-0.768 -0.479,-1.09 -1.35,-1.091 -2.968,-0.002 -9.619,-0.013 -9.619,-0.013 v -0.591 c 0,0 5.052,-0.016 7.225,-0.016 0.888,-0.002 1.354,-0.416 1.351,-1.193 -0.006,-0.761 -0.492,-1.196 -1.361,-1.196 -3.473,-0.005 -10.86,-0.003 -11.0829995,-0.003 -0.022,-0.047 -0.045,-0.094 -0.069,-0.139 0.3939995,-0.319 2.0409995,-1.626 2.4149995,-2.017 0.469,-0.4870005 0.519,-1.1650005 0.162,-1.6040005 -0.414,-0.511 -0.973,-0.5 -1.48,-0.236 -1.4609995,0.764 -6.5999995,3.6430005 -7.7329995,4.2710005 -0.9,0.499 -1.516,1.253 -1.882,2.19 -0.37000002,0.95 -0.17,2.01 -0.166,2.979 0.004,0.718 -0.27300002,1.345 -0.055,2.063 0.629,2.087 2.425,3.312 4.859,3.318 4.6179995,0.014 9.2379995,-0.139 13.8569995,-0.158 0.755,-0.004 1.171,-0.301 1.182,-1.033 0.012,-0.754 -0.423,-0.969 -1.183,-0.973 -1.778,-0.01 -5.824,-0.004 -6.04,-0.004 10e-4,-0.084 0.003,-0.586 10e-4,-0.67 z`},TASK_TYPE_INSTANTIATING_SEND:{d:`m {mx},{my} l 0,8.4 l 12.6,0 l 0,-8.4 z l 6.3,3.6 l 6.3,-3.6`},TASK_TYPE_SERVICE:{d:`m {mx},{my} v -1.71335 c 0.352326,-0.0705 0.703932,-0.17838 1.047628,-0.32133 0.344416,-0.14465 0.665822,-0.32133 0.966377,-0.52145 l 1.19431,1.18005 1.567487,-1.57688 -1.195028,-1.18014 c 0.403376,-0.61394 0.683079,-1.29908 0.825447,-2.01824 l 1.622133,-0.01 v -2.2196 l -1.636514,0.01 c -0.07333,-0.35153 -0.178319,-0.70024 -0.323564,-1.04372 -0.145244,-0.34406 -0.321407,-0.6644 -0.522735,-0.96217 l 1.131035,-1.13631 -1.583305,-1.56293 -1.129598,1.13589 c -0.614052,-0.40108 -1.302883,-0.68093 -2.022633,-0.82247 l 0.0093,-1.61852 h -2.241173 l 0.0042,1.63124 c -0.353763,0.0736 -0.705369,0.17977 -1.049785,0.32371 -0.344415,0.14437 -0.665102,0.32092 -0.9635006,0.52046 l -1.1698628,-1.15823 -1.5667691,1.5792 1.1684265,1.15669 c -0.4026573,0.61283 -0.68308,1.29797 -0.8247287,2.01713 l -1.6588041,0.003 v 2.22174 l 1.6724648,-0.006 c 0.073327,0.35077 0.1797598,0.70243 0.3242851,1.04472 0.1452428,0.34448 0.3214064,0.6644 0.5227339,0.96066 l -1.1993431,1.19723 1.5840256,1.56011 1.1964668,-1.19348 c 0.6140517,0.40346 1.3028827,0.68232 2.0233517,0.82331 l 7.19e-4,1.69892 h 2.226848 z m 0.221462,-3.9957 c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z`},TASK_TYPE_SERVICE_FILL:{d:`m {mx},{my} c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z`},TASK_TYPE_BUSINESS_RULE_HEADER:{d:`m {mx},{my} 0,4 20,0 0,-4 z`},TASK_TYPE_BUSINESS_RULE_MAIN:{d:`m {mx},{my} 0,12 20,0 0,-12 zm 0,8 l 20,0 m -13,-4 l 0,8`},MESSAGE_FLOW_MARKER:{d:`m {mx},{my} m -10.5 ,-7 l 0,14 l 21,0 l 0,-14 z l 10.5,6 l 10.5,-6`}},this.getRawPath=function(e){return this.pathMap[e].d},this.getScaledPath=function(e,t){var n=this.pathMap[e],r,i;t.abspos?(r=t.abspos.x,i=t.abspos.y):(r=t.containerWidth*t.position.mx,i=t.containerHeight*t.position.my);var a={};if(t.position){for(var o=t.containerHeight/n.height*t.yScaleFactor,s=t.containerWidth/n.width*t.xScaleFactor,c=0;c<n.heightElements.length;c++)a[`y`+c]=n.heightElements[c]*o;for(var l=0;l<n.widthElements.length;l++)a[`x`+l]=n.widthElements[l]*s}return Cr(n.d,{mx:r,my:i,e:a})}}var br=/\{([^{}]+)\}/g,xr=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g;function Sr(e,t,n){var r=n;return t.replace(xr,function(e,t,n,i,a){t||=i,r&&(t in r&&(r=r[t]),typeof r==`function`&&a&&(r=r()))}),r=(r==null||r==n?e:r)+``,r}function Cr(e,t){return String(e).replace(br,function(e,n){return Sr(e,n,t)})}var wr={__init__:[`bpmnRenderer`],bpmnRenderer:[`type`,Qn],textRenderer:[`type`,vr],pathMap:[`type`,yr]};function Tr(e,t){return t||={},e.replace(/{([^}]+)}/g,function(e,n){return t[n]||`{`+n+`}`})}var Er={translate:[`value`,Tr]};function Dr(e,t,n){return h({id:e.id,type:e.$type,businessObject:e,di:t},n)}function Or(e,t,n){var r=e.waypoint;return!r||r.length<2?[ae(t),ae(n)]:r.map(function(e){return{x:e.x,y:e.y}})}function kr(e,t,n){return Error(`element ${q(t)} referenced by ${q(e)}#${n} not yet drawn`)}function Q(e,t,n,r,i){this._eventBus=e,this._canvas=t,this._elementFactory=n,this._elementRegistry=r,this._textRenderer=i}Q.$inject=[`eventBus`,`canvas`,`elementFactory`,`elementRegistry`,`textRenderer`],Q.prototype.add=function(e,t,n){var r,i,a;if(b(t,`bpmndi:BPMNPlane`)){var o=b(e,`bpmn:SubProcess`)?{id:e.id+`_plane`}:{};r=this._elementFactory.createRoot(Dr(e,t,o)),this._canvas.addRootElement(r)}else if(b(t,`bpmndi:BPMNShape`)){var s=!pe(e,t),c=jr(e);i=n&&(n.hidden||n.collapsed);var l=t.bounds;r=this._elementFactory.createShape(Dr(e,t,{collapsed:s,hidden:i,x:Math.round(l.x),y:Math.round(l.y),width:Math.round(l.width),height:Math.round(l.height),isFrame:c})),b(e,`bpmn:BoundaryEvent`)&&this._attachBoundary(e,r),b(e,`bpmn:Lane`)&&(a=0),b(e,`bpmn:DataStoreReference`)&&(Ar(n,ae(l))||(n=this._canvas.findRoot(n))),this._canvas.addShape(r,n,a)}else if(b(t,`bpmndi:BPMNEdge`)){var u=this._getSource(e),d=this._getTarget(e);i=n&&(n.hidden||n.collapsed),r=this._elementFactory.createConnection(Dr(e,t,{hidden:i,source:u,target:d,waypoints:Or(t,u,d)})),b(e,`bpmn:DataAssociation`)&&(n=this._canvas.findRoot(n)),this._canvas.addConnection(r,n,a)}else throw Error(`unknown di ${q(t)} for element ${q(e)}`);return ie(e)&&ne(r)&&this.addLabel(e,t,r),this._eventBus.fire(`bpmnElement.added`,{element:r}),r},Q.prototype._attachBoundary=function(e,t){var n=e.attachedToRef;if(!n)throw Error(`missing ${q(e)}#attachedToRef`);var r=this._elementRegistry.get(n.id),i=r&&r.attachers;if(!r)throw kr(e,n,`attachedToRef`);t.host=r,i||(r.attachers=i=[]),i.indexOf(t)===-1&&i.push(t)},Q.prototype.addLabel=function(e,t,n){var r=re(t,n),i=ne(n),a;return i&&(r=this._textRenderer.getExternalLabelBounds(r,i)),a=this._elementFactory.createLabel(Dr(e,t,{id:e.id+`_label`,labelTarget:n,type:`label`,hidden:n.hidden||!ne(n),x:Math.round(r.x),y:Math.round(r.y),width:Math.round(r.width),height:Math.round(r.height)})),this._canvas.addShape(a,n.parent)},Q.prototype._getConnectedElement=function(e,t){var n,r,i=e.$type;if(r=e[t+`Ref`],t===`source`&&i===`bpmn:DataInputAssociation`&&(r&&=r[0]),(t===`source`&&i===`bpmn:DataOutputAssociation`||t===`target`&&i===`bpmn:DataInputAssociation`)&&(r=e.$parent),n=r&&this._getElement(r),n)return n;throw r?kr(e,r,t+`Ref`):Error(`${q(e)}#${t} Ref not specified`)},Q.prototype._getSource=function(e){return this._getConnectedElement(e,`source`)},Q.prototype._getTarget=function(e){return this._getConnectedElement(e,`target`)},Q.prototype._getElement=function(e){return this._elementRegistry.get(e.id)};function Ar(e,t){var n=t.x,r=t.y;return n>=e.x&&n<=e.x+e.width&&r>=e.y&&r<=e.y+e.height}function jr(e){return b(e,`bpmn:Group`)}var Mr={__depends__:[wr,{__depends__:[Er],bpmnImporter:[`type`,Q]}]};function Nr(e){this._counter=0,this._prefix=(e?e+`-`:``)+Math.floor(Math.random()*1e9)+`-`}Nr.prototype.next=function(){return this._prefix+ ++this._counter};var Pr=new Nr(`ov`),Fr=500;function $(e,t,n,r){this._eventBus=t,this._canvas=n,this._elementRegistry=r,this._ids=Pr,this._overlayDefaults=h({show:null,scale:!0},e&&e.defaults),this._overlays={},this._overlayContainers=[],this._overlayRoot=Ir(n.getContainer()),this._init()}$.$inject=[`config.overlays`,`eventBus`,`canvas`,`elementRegistry`],$.prototype.get=function(e){if(_(e)&&(e={id:e}),_(e.element)&&(e.element=this._elementRegistry.get(e.element)),e.element){var t=this._getOverlayContainer(e.element,!0);return t?e.type?a(t.overlays,n({type:e.type})):t.overlays.slice():[]}return e.type?a(this._overlays,n({type:e.type})):e.id?this._overlays[e.id]:null},$.prototype.add=function(e,t,n){if(i(t)&&(n=t,t=null),e.id||(e=this._elementRegistry.get(e)),!n.position)throw Error(`must specifiy overlay position`);if(!n.html)throw Error(`must specifiy overlay html`);if(!e)throw Error(`invalid element specified`);var r=this._ids.next();return n=h({},this._overlayDefaults,n,{id:r,type:t,element:e,html:n.html}),this._addOverlay(n),r},$.prototype.remove=function(e){var t=this.get(e)||[];o(t)||(t=[t]);var n=this;l(t,function(e){var t=n._getOverlayContainer(e.element,!0);if(e&&(et(e.html),et(e.htmlContainer),delete e.htmlContainer,delete e.element,delete n._overlays[e.id]),t){var r=t.overlays.indexOf(e);r!==-1&&t.overlays.splice(r,1)}})},$.prototype.isShown=function(){return this._overlayRoot.style.display!==`none`},$.prototype.show=function(){Rr(this._overlayRoot)},$.prototype.hide=function(){Rr(this._overlayRoot,!1)},$.prototype.clear=function(){this._overlays={},this._overlayContainers=[],Be(this._overlayRoot)},$.prototype._updateOverlayContainer=function(e){var t=e.element,n=e.html,r=t.x,i=t.y;if(t.waypoints){var a=_t(t);r=a.x,i=a.y}Lr(n,r,i),Ie(e.html,`data-container-id`,t.id)},$.prototype._updateOverlay=function(e){var t=e.position,n=e.htmlContainer,r=e.element,i=t.left,a=t.top;if(t.right!==void 0){var o=r.waypoints?_t(r).width:r.width;i=t.right*-1+o}if(t.bottom!==void 0){var s=r.waypoints?_t(r).height:r.height;a=t.bottom*-1+s}Lr(n,i||0,a||0),this._updateOverlayVisibilty(e,this._canvas.viewbox())},$.prototype._createOverlayContainer=function(e){var t=z(`<div class="djs-overlays" />`);B(t,{position:`absolute`}),this._overlayRoot.appendChild(t);var n={html:t,element:e,overlays:[]};return this._updateOverlayContainer(n),this._overlayContainers.push(n),n},$.prototype._updateRoot=function(e){var t=e.scale||1,n=`matrix(`+[t,0,0,t,-1*e.x*t,-1*e.y*t].join(`,`)+`)`;zr(this._overlayRoot,n)},$.prototype._getOverlayContainer=function(e,t){var n=f(this._overlayContainers,function(t){return t.element===e});return!n&&!t?this._createOverlayContainer(e):n},$.prototype._addOverlay=function(e){var t=e.id,n=e.element,r=e.html,i,a;r.get&&r.constructor.prototype.jquery&&(r=r.get(0)),_(r)&&(r=z(r)),a=this._getOverlayContainer(n),i=z(`<div class="djs-overlay" data-overlay-id="`+t+`">`),B(i,{position:`absolute`}),i.appendChild(r),e.type&&Re(i).add(`djs-overlay-`+e.type);var o=this._canvas.findRoot(n),s=this._canvas.getRootElement();Rr(i,o===s),e.htmlContainer=i,a.overlays.push(e),a.html.appendChild(i),this._overlays[t]=e,this._updateOverlay(e),this._updateOverlayVisibilty(e,this._canvas.viewbox())},$.prototype._updateOverlayVisibilty=function(e,t){var n=e.show,r=this._canvas.findRoot(e.element),i=n&&n.minZoom,a=n&&n.maxZoom,o=e.htmlContainer,s=this._canvas.getRootElement(),c=!0;r===s?n&&(p(i)&&i>t.scale||p(a)&&a<t.scale)&&(c=!1):c=!1,Rr(o,c),this._updateOverlayScale(e,t)},$.prototype._updateOverlayScale=function(e,t){var n=e.scale,r,i,a=e.htmlContainer,o,s=``;n!==!0&&(n===!1?(r=1,i=1):(r=n.min,i=n.max),p(r)&&t.scale<r&&(o=(1/t.scale||1)*r),p(i)&&t.scale>i&&(o=(1/t.scale||1)*i)),p(o)&&(s=`scale(`+o+`,`+o+`)`),zr(a,s)},$.prototype._updateOverlaysVisibilty=function(e){var t=this;l(this._overlays,function(n){t._updateOverlayVisibilty(n,e)})},$.prototype._init=function(){var e=this._eventBus,t=this;function n(e){t._updateRoot(e),t._updateOverlaysVisibilty(e),t.show()}e.on(`canvas.viewbox.changing`,function(e){t.hide()}),e.on(`canvas.viewbox.changed`,function(e){n(e.viewbox)}),e.on([`shape.remove`,`connection.remove`],function(e){var n=e.element,r=t.get({element:n});l(r,function(e){t.remove(e.id)});var i=t._getOverlayContainer(n);if(i){et(i.html);var a=t._overlayContainers.indexOf(i);a!==-1&&t._overlayContainers.splice(a,1)}}),e.on(`element.changed`,Fr,function(e){var n=e.element,r=t._getOverlayContainer(n,!0);r&&(l(r.overlays,function(e){t._updateOverlay(e)}),t._updateOverlayContainer(r))}),e.on(`element.marker.update`,function(e){var n=t._getOverlayContainer(e.element,!0);n&&Re(n.html)[e.add?`add`:`remove`](e.marker)}),e.on(`root.set`,function(){t._updateOverlaysVisibilty(t._canvas.viewbox())}),e.on(`diagram.clear`,this.clear,this)};function Ir(e){var t=z(`<div class="djs-overlay-container" />`);return B(t,{position:`absolute`,width:0,height:0}),e.insertBefore(t,e.firstChild),t}function Lr(e,t,n){B(e,{left:t+`px`,top:n+`px`})}function Rr(e,t){e.style.display=t===!1?`none`:``}function zr(e,t){e.style[`transform-origin`]=`top left`,[``,`-ms-`,`-webkit-`].forEach(function(n){e.style[n+`transform`]=t})}var Br={__init__:[`overlays`],overlays:[`type`,$]};function Vr(e,t,n,r){e.on(`element.changed`,function(r){var i=r.element;(i.parent||i===t.getRootElement())&&(r.gfx=n.getGraphics(i)),r.gfx&&e.fire(yt(i)+`.changed`,r)}),e.on(`elements.changed`,function(t){var n=t.elements;n.forEach(function(t){e.fire(`element.changed`,{element:t})}),r.updateContainments(n)}),e.on(`shape.changed`,function(e){r.update(`shape`,e.element,e.gfx)}),e.on(`connection.changed`,function(e){r.update(`connection`,e.element,e.gfx)})}Vr.$inject=[`eventBus`,`canvas`,`elementRegistry`,`graphicsFactory`];var Hr={__init__:[`changeSupport`],changeSupport:[`type`,Vr]};function Ur(e,t){t.invoke(Oe,this),this.executed(function(t){var n=t.context;n.rootElement?e.setRootElement(n.rootElement):n.rootElement=e.getRootElement()}),this.revert(function(t){var n=t.context;n.rootElement&&e.setRootElement(n.rootElement)})}j(Ur,Oe),Ur.$inject=[`canvas`,`injector`];var Wr={__init__:[`rootElementsBehavior`],rootElementsBehavior:[`type`,Ur]};function Gr(e){return CSS.escape(e)}var Kr={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`};function qr(e){return e=``+e,e&&e.replace(/[&<>"']/g,function(e){return Kr[e]})}var Jr=`bjs-breadcrumbs-shown`;function Yr(e,t,n){var r=z(`<ul class="bjs-breadcrumbs"></ul>`),i=n.getContainer(),a=Re(i);i.appendChild(r);var o=[];e.on(`element.changed`,function(e){var t=e.element,n=x(t);f(o,function(e){return e===n})&&s()});function s(e){e&&(o=Xr(e));var i=o.flatMap(function(e){var r=n.findRoot(ke(e))||n.findRoot(e.id);if(!r&&b(e,`bpmn:Process`)){var i=t.find(function(t){var n=x(t);return n&&n.get(`processRef`)===e});r=i&&n.findRoot(i.id)}return r?[{parent:e,parentPlane:r}]:[]});r.innerHTML=``;var s=i.length>1;a.toggle(Jr,s),i.forEach(function(e,t){var a=e.parent,o=e.parentPlane,s=qr(a.name||a.id),c=t===i.length-1,l;c?l=z(`<li><span class="bjs-crumb" title="`+s+`">`+s+`</span></li>`):(l=z(`<li><a class="bjs-crumb" href="`+(`#`+qr(a.id))+`" title="`+s+`">`+s+`</a></li>`),l.addEventListener(`click`,function(e){e.preventDefault(),n.setRootElement(o)})),r.appendChild(l)})}e.on(`root.set`,function(e){s(e.element)})}Yr.$inject=[`eventBus`,`elementRegistry`,`canvas`];function Xr(e){for(var t=x(e),n=[],r=t;r;r=r.$parent)(b(r,`bpmn:SubProcess`)||b(r,`bpmn:Process`))&&n.push(r);return n.reverse()}function Zr(e,t){var n=null,r=new Qr;e.on(`root.set`,function(e){var i=e.element,a=t.viewbox(),o=r.get(i);if(r.set(n,{x:a.x,y:a.y,zoom:a.scale}),n=i,b(i,`bpmn:SubProcess`)||o){o||={x:0,y:0,zoom:1};var s=(a.x-o.x)*a.scale,c=(a.y-o.y)*a.scale;(s!==0||c!==0)&&t.scroll({dx:s,dy:c}),o.zoom!==a.scale&&t.zoom(o.zoom,{x:0,y:0})}}),e.on(`diagram.clear`,function(){r.clear(),n=null})}Zr.$inject=[`eventBus`,`canvas`];function Qr(){this._entries=[],this.set=function(e,t){var n=!1;for(var r in this._entries)if(this._entries[r][0]===e){this._entries[r][1]=t,n=!0;break}n||this._entries.push([e,t])},this.get=function(e){for(var t in this._entries)if(this._entries[t][0]===e)return this._entries[t][1];return null},this.clear=function(){this._entries.length=0},this.remove=function(e){var t=-1;for(var n in this._entries)if(this._entries[n][0]===e){t=n;break}t!==-1&&this._entries.splice(t,1)}}var $r={x:180,y:160};function ei(e,t){this._eventBus=e,this._moddle=t;var n=this;e.on(`import.render.start`,1500,function(e,t){n._handleImport(t.definitions)})}ei.prototype._handleImport=function(e){if(e.diagrams){var t=this;this._definitions=e,this._processToDiagramMap={},e.diagrams.forEach(function(e){e.plane&&e.plane.bpmnElement&&(t._processToDiagramMap[e.plane.bpmnElement.id]=e)}),e.diagrams.filter(e=>e.plane).flatMap(e=>t._createNewDiagrams(e.plane)).forEach(function(e){t._movePlaneElementsToOrigin(e.plane)})}},ei.prototype._createNewDiagrams=function(e){var t=this,n=[],r=[];e.get(`planeElement`).forEach(function(t){var i=t.bpmnElement;if(i){var a=i.$parent;b(i,`bpmn:SubProcess`)&&!t.isExpanded&&n.push(i),ri(i,e)&&r.push({diElement:t,parent:a})}});var i=[];return n.forEach(function(e){if(!t._processToDiagramMap[e.id]){var n=t._createDiagram(e);t._processToDiagramMap[e.id]=n,i.push(n)}}),r.forEach(function(e){for(var r=e.diElement,i=e.parent;i&&n.indexOf(i)===-1;)i=i.$parent;if(i){var a=t._processToDiagramMap[i.id];t._moveToDiPlane(r,a.plane)}}),i},ei.prototype._movePlaneElementsToOrigin=function(e){var t=e.get(`planeElement`),n=ni(e),r={x:n.x-$r.x,y:n.y-$r.y};t.forEach(function(e){e.waypoint?e.waypoint.forEach(function(e){e.x-=r.x,e.y-=r.y}):e.bounds&&(e.bounds.x=e.bounds.x-r.x,e.bounds.y=e.bounds.y-r.y)})},ei.prototype._moveToDiPlane=function(e,t){var n=ti(e).plane.get(`planeElement`);n.splice(n.indexOf(e),1),t.get(`planeElement`).push(e)},ei.prototype._createDiagram=function(e){var t=this._moddle.create(`bpmndi:BPMNPlane`,{bpmnElement:e}),n=this._moddle.create(`bpmndi:BPMNDiagram`,{plane:t});return t.$parent=n,t.bpmnElement=e,n.$parent=this._definitions,this._definitions.diagrams.push(n),n},ei.$inject=[`eventBus`,`moddle`];function ti(e){return b(e,`bpmndi:BPMNDiagram`)?e:ti(e.$parent)}function ni(e){var t={top:1/0,right:-1/0,bottom:-1/0,left:1/0};return e.planeElement.forEach(function(e){if(e.bounds){var n=oe(e.bounds);t.top=Math.min(n.top,t.top),t.left=Math.min(n.left,t.left)}}),w(t)}function ri(e,t){var n=e.$parent;return!(!b(n,`bpmn:SubProcess`)||n===t.bpmnElement||ee(e,[`bpmn:DataInputAssociation`,`bpmn:DataOutputAssociation`]))}var ii=250,ai=`<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M4.81801948,3.50735931 L10.4996894,9.1896894 L10.5,4 L12,4 L12,12 L4,12 L4,10.5 L9.6896894,10.4996894 L3.75735931,4.56801948 C3.46446609,4.27512627 3.46446609,3.80025253 3.75735931,3.50735931 C4.05025253,3.21446609 4.52512627,3.21446609 4.81801948,3.50735931 Z"/></svg>`,oi=`bjs-drilldown-empty`;function si(e,t,n,r,i){Oe.call(this,t),this._canvas=e,this._eventBus=t,this._elementRegistry=n,this._overlays=r,this._translate=i;var a=this;this.executed(`shape.toggleCollapse`,ii,function(e){var t=e.shape;a._canDrillDown(t)?a._addOverlay(t):a._removeOverlay(t)},!0),this.reverted(`shape.toggleCollapse`,ii,function(e){var t=e.shape;a._canDrillDown(t)?a._addOverlay(t):a._removeOverlay(t)},!0),this.executed([`shape.create`,`shape.move`,`shape.delete`],ii,function(e){var t=e.oldParent,n=e.newParent||e.parent,r=e.shape;a._canDrillDown(r)&&a._addOverlay(r),a._updateDrilldownOverlay(t),a._updateDrilldownOverlay(n),a._updateDrilldownOverlay(r)},!0),this.reverted([`shape.create`,`shape.move`,`shape.delete`],ii,function(e){var t=e.oldParent,n=e.newParent||e.parent,r=e.shape;a._canDrillDown(r)&&a._addOverlay(r),a._updateDrilldownOverlay(t),a._updateDrilldownOverlay(n),a._updateDrilldownOverlay(r)},!0),t.on(`import.render.complete`,function(){n.filter(function(e){return a._canDrillDown(e)}).map(function(e){a._addOverlay(e)})})}j(si,Oe),si.prototype._updateDrilldownOverlay=function(e){var t=this._canvas;if(e){var n=t.findRoot(e);n&&this._updateOverlayVisibility(n)}},si.prototype._canDrillDown=function(e){var t=this._canvas;return b(e,`bpmn:SubProcess`)&&t.findRoot(ke(e))},si.prototype._updateOverlayVisibility=function(e){var t=this._overlays,n=x(e),r=t.get({element:n.id,type:`drilldown`})[0];if(r){var i=n&&n.get(`flowElements`)&&n.get(`flowElements`).length;Re(r.html).toggle(oi,!i)}},si.prototype._addOverlay=function(e){var t=this._canvas,n=this._overlays,r=x(e);n.get({element:e,type:`drilldown`}).length&&this._removeOverlay(e);var i=z(`<button type="button" class="bjs-drilldown">`+ai+`</button>`),a=r.get(`name`)||r.get(`id`),o=this._translate(`Open {element}`,{element:a});i.setAttribute(`title`,o),i.addEventListener(`click`,function(){t.setRootElement(t.findRoot(ke(e)))}),n.add(e,`drilldown`,{position:{bottom:-7,right:-8},html:i}),this._updateOverlayVisibility(e)},si.prototype._removeOverlay=function(e){this._overlays.remove({element:e,type:`drilldown`})},si.$inject=[`canvas`,`eventBus`,`elementRegistry`,`overlays`,`translate`];var ci={__depends__:[Br,Hr,Wr],__init__:[`drilldownBreadcrumbs`,`drilldownOverlayBehavior`,`drilldownCentering`,`subprocessCompatibility`],drilldownBreadcrumbs:[`type`,Yr],drilldownCentering:[`type`,Zr],drilldownOverlayBehavior:[`type`,si],subprocessCompatibility:[`type`,ei]};function li(e){e&&typeof e.stopPropagation==`function`&&e.stopPropagation()}function ui(e){return e.originalEvent||e.srcEvent}function di(e){li(e),li(ui(e))}function fi(e){return e.pointers&&e.pointers.length&&(e=e.pointers[0]),e.touches&&e.touches.length&&(e=e.touches[0]),e?{x:e.clientX,y:e.clientY}:null}function pi(){return/mac/i.test(navigator.platform)}function mi(e,t){return(ui(e)||e).button===t}function hi(e){return mi(e,0)}function gi(e){return mi(e,1)}function _i(e){var t=ui(e)||e;return hi(e)?pi()?t.metaKey:t.ctrlKey:!1}function vi(e){var t=ui(e)||e;return hi(e)&&t.shiftKey}function yi(e){return!0}function bi(e){return hi(e)||gi(e)}var xi=500;function Si(e,t,n){var r=this;function i(n,r,i){if(!s(n,r)){var a,o,c;i?o=t.getGraphics(i):(a=r.delegateTarget||r.target,a&&(o=a,i=t.get(o))),o&&i&&(c=e.fire(n,{element:i,gfx:o,originalEvent:r}),c===!1&&(r.stopPropagation(),r.preventDefault()))}}var a={};function o(e){return a[e]}function s(e,t){return!(u[e]||hi)(t)}var c={click:`element.click`,contextmenu:`element.contextmenu`,dblclick:`element.dblclick`,mousedown:`element.mousedown`,mousemove:`element.mousemove`,mouseover:`element.hover`,mouseout:`element.out`,mouseup:`element.mouseup`},u={"element.contextmenu":yi,"element.mousedown":bi,"element.mouseup":bi,"element.click":bi,"element.dblclick":bi};function d(e,t,n){var r=c[e];if(!r)throw Error(`unmapped DOM event name <`+e+`>`);return i(r,t,n)}var f=`svg, .djs-element`;function p(e,t,n,r){var o=a[n]=function(e){i(n,e)};r&&(u[n]=r),o.$delegate=Ze.bind(e,f,t,o)}function m(e,t,n){var r=o(n);r&&Ze.unbind(e,t,r.$delegate)}function g(e){l(c,function(t,n){p(e,n,t)})}function _(e){l(c,function(t,n){m(e,n,t)})}e.on(`canvas.destroy`,function(e){_(e.svg)}),e.on(`canvas.init`,function(e){g(e.svg)}),e.on([`shape.added`,`connection.added`],function(t){var n=t.element,r=t.gfx;e.fire(`interactionEvents.createHit`,{element:n,gfx:r})}),e.on([`shape.changed`,`connection.changed`],xi,function(t){var n=t.element,r=t.gfx;e.fire(`interactionEvents.updateHit`,{element:n,gfx:r})}),e.on(`interactionEvents.createHit`,xi,function(e){var t=e.element,n=e.gfx;r.createDefaultHit(t,n)}),e.on(`interactionEvents.updateHit`,function(e){var t=e.element,n=e.gfx;r.updateDefaultHit(t,n)});var v=te(`djs-hit djs-hit-stroke`),y=te(`djs-hit djs-hit-click-stroke`),ee={all:te(`djs-hit djs-hit-all`),"click-stroke":y,stroke:v,"no-move":te(`djs-hit djs-hit-no-move`)};function te(e,t){return t=h({stroke:`white`,strokeWidth:15},t||{}),n.cls(e,[`no-fill`,`no-border`],t)}function b(e,t){var n=ee[t];if(!n)throw Error(`invalid hit type <`+t+`>`);return E(e,n),e}function x(e,t){k(e,t)}this.removeHits=function(e){var t=$e(`.djs-hit`,e);l(t,A)},this.createDefaultHit=function(e,t){var n=e.waypoints,r=e.isFrame,i;return n?this.createWaypointsHit(t,n):(i=r?`stroke`:`all`,this.createBoxHit(t,i,{width:e.width,height:e.height}))},this.createWaypointsHit=function(e,t){var n=_e(t);return b(n,`stroke`),x(e,n),n},this.createBoxHit=function(e,t,n){n=h({x:0,y:0},n);var r=D(`rect`);return b(r,t),E(r,n),x(e,r),r},this.updateDefaultHit=function(e,t){var n=V(`.djs-hit`,t);if(n)return e.waypoints?me(n,e.waypoints):E(n,{width:e.width,height:e.height}),n},this.fire=i,this.triggerMouseEvent=d,this.mouseHandler=o,this.registerEvent=p,this.unregisterEvent=m}Si.$inject=[`eventBus`,`elementRegistry`,`styles`];var Ci={__init__:[`interactionEvents`],interactionEvents:[`type`,Si]};function wi(e,t){this._eventBus=e,this._canvas=t,this._selectedElements=new Set;var n=this;e.on([`shape.remove`,`connection.remove`],function(e){var t=e.element;n.deselect(t)}),e.on([`diagram.clear`,`root.set`],function(e){n.select(null)})}wi.$inject=[`eventBus`,`canvas`],wi.prototype.deselect=function(e){if(this._selectedElements.has(e)){var t=this.get();this._selectedElements.delete(e),this._eventBus.fire(`selection.changed`,{oldSelection:t,newSelection:this.get()})}},wi.prototype.get=function(){return Array.from(this._selectedElements)},wi.prototype.isSelected=function(e){return this._selectedElements.has(e)},wi.prototype.select=function(e,t){var n=this.get();o(e)||(e=e?[e]:[]);var r=this._canvas,i=r.getRootElement();e=e.filter(function(e){return i===r.findRoot(e)}),t?l(e,e=>{this._selectedElements.add(e)}):this._selectedElements=new Set(e),this._eventBus.fire(`selection.changed`,{oldSelection:n,newSelection:this.get()})};var Ti=`hover`,Ei=`selected`;function Di(e,t){this._canvas=e;function n(t,n){e.addMarker(t,n)}function r(t,n){e.removeMarker(t,n)}t.on(`element.hover`,function(e){n(e.element,Ti)}),t.on(`element.out`,function(e){r(e.element,Ti)}),t.on(`selection.changed`,function(e){function t(e){r(e,Ei)}function i(e){n(e,Ei)}var a=new Set(e.oldSelection),o=new Set(e.newSelection);for(let e of a)o.has(e)||t(e);for(let e of o)a.has(e)||i(e)})}Di.$inject=[`canvas`,`eventBus`];function Oi(e,t,n,r){e.on(`create.end`,500,function(e){var n=e.context,r=n.canExecute,i=n.elements,a=(n.hints||{}).autoSelect;if(r){if(a===!1)return;o(a)?t.select(a):t.select(i.filter(ki))}}),e.on(`connect.end`,500,function(e){var n=e.context.connection;n&&t.select(n)}),e.on(`shape.move.end`,500,function(e){var n=e.previousSelection||[],i=r.get(e.context.shape.id);f(n,function(e){return i.id===e.id})||t.select(i)}),e.on(`element.click`,function(e){if(hi(e)){var r=e.element;r===n.getRootElement()&&(r=null);var i=t.isSelected(r),a=t.get().length>1,o=vi(e);if(i&&a)return o?t.deselect(r):t.select(r);i?t.deselect(r):t.select(r,o)}})}Oi.$inject=[`eventBus`,`selection`,`canvas`,`elementRegistry`];function ki(e){return!e.hidden}var Ai={__init__:[`selectionVisuals`,`selectionBehavior`],__depends__:[Ci],selection:[`type`,wi],selectionVisuals:[`type`,Di],selectionBehavior:[`type`,Oi]};function ji(e){X.call(this,e)}j(ji,X),ji.prototype._modules=[Mr,ci,Br,Ai,Er],ji.prototype._moddleExtensions={};export{ht as A,Qe as B,tn as C,gt as D,_t as E,Re as F,et as H,Be as I,Ve as L,$e as M,B as N,vt as O,Ie as P,Ze as R,cn as S,pt as T,z as U,V,L as W,Vn as _,hi as a,un as b,di as c,qr as d,ji as default,Hr as f,Hn as g,Er as h,vi as i,mt as j,ft as k,fi as l,Nr as m,Ci as n,pi as o,Br as p,_i as r,ui as s,Ai as t,Gr as u,X as v,en as w,dn as x,fn as y,qe as z};
@@ -0,0 +1 @@
1
+ import{t as e}from"./dist-DRauAwm2.js";function t(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function n(e){return t(e)&&e.ok===!1}function r(e,t,n){return n===void 0?{ok:!1,code:e,message:t}:{ok:!1,code:e,message:t,pointer:n}}function i(e,t){return`${e}/${String(t).replace(/~/g,`~0`).replace(/\//g,`~1`)}`}function a(e,t){if(typeof e==`function`)return r(`unsupported-extension`,`the F1 tree carries a non-data value (§4.1)`,t)}function o(e,n,s,c){let l=a(n,s);if(l!==void 0)return{refused:l};if(!t(n))return{refused:r(`missing-$type`,`the F1 tree node at ${s||`/`} is not an object`,s)};let u=n.$type;if(typeof u!=`string`||u.length===0)return{refused:r(`missing-$type`,`the F1 tree node at ${s||`/`} has no $type`,i(s,`$type`))};let d={};for(let[r,l]of Object.entries(n)){if(r===`$type`)continue;let n=i(s,r),u=a(l,n);if(u!==void 0)return{refused:u};if(Array.isArray(l)){let s=[];for(let r=0;r<l.length;r+=1){let u=i(n,r);if(t(l[r])){let t=o(e,l[r],u,c);if(`refused`in t)return t;s.push(t.root)}else{let e=a(l[r],u);if(e!==void 0)return{refused:e};s.push(l[r])}}d[r]=s}else if(t(l)){let t=o(e,l,n,c);if(`refused`in t)return t;d[r]=t.root}else d[r]=l}let f;try{f=e.create(u,d)}catch(e){return{refused:r(`unknown-type`,e instanceof Error?e.message:String(e),i(s,`$type`))}}return typeof n.id==`string`&&c.set(n.id,f),{root:f}}function s(e,a,o,c){for(let e of a.$descriptor.properties){if(!e.isReference)continue;let t=i(c,e.name),s=a[e.name],l=(e,t)=>{if(typeof e!=`string`)return e;let n=o.get(e);return n===void 0?r(`unresolved-reference`,`the reference "${e}" names no element of the document`,t):n};if(e.isMany){if(Array.isArray(s)){let r=[];for(let e=0;e<s.length;e+=1){let a=l(s[e],i(t,e));if(n(a))return a;r.push(a)}a[e.name]=r}}else if(s!==void 0){let r=l(s,t);if(n(r))return r;a[e.name]=r}}for(let[n,r]of Object.entries(e)){if(n===`$type`)continue;let e=a[n],l=r,u=i(c,n);if(Array.isArray(l)&&Array.isArray(e)){for(let n=0;n<l.length;n+=1)if(t(l[n])&&l[n].$type!==void 0){let t=s(l[n],e[n],o,i(u,n));if(t!==void 0)return t}}else if(t(l)&&l.$type!==void 0){let t=s(l,e,o,u);if(t!==void 0)return t}}}function c(n){if(!t(n))return r(`missing-$type`,`the F1 document is not a JSON object`);let i=new e,a=new Map,c=o(i,n,``,a);if(`refused`in c)return c.refused;let l=s(n,c.root,a,``);return l===void 0?{ok:!0,xml:``,warnings:[]}:l}async function l(n){if(!t(n))return r(`missing-$type`,`the F1 document is not a JSON object`);let i=new e,a=new Map,c=o(i,n,``,a);if(`refused`in c)return c.refused;let l=s(n,c.root,a,``);if(l!==void 0)return l;try{let{xml:e}=await i.toXML(c.root,{format:!0});return{ok:!0,xml:e,warnings:[]}}catch(e){return r(`unsupported-extension`,`the F1 tree cannot be serialized: ${e instanceof Error?e.message:String(e)}`)}}function u(e){return{source:`bpmn-canvas`,validate(t){let n=e(t);return n.ok?(n.warnings??[]).map(e=>({code:e.code,message:e.message,...e.pointer===void 0?{}:{pointer:e.pointer},severity:`warning`})):[{code:n.code,message:n.message,...n.pointer===void 0?{}:{pointer:n.pointer},severity:`error`}]}}}var d=u(e=>c(e)),f=l;export{d as port,f as toXml};