camunda-bpmn-js 0.11.5 → 0.12.0
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.
- package/CHANGELOG.md +7 -0
- package/dist/assets/properties-panel.css +780 -0
- package/dist/camunda-cloud-modeler.development.js +546 -505
- package/dist/camunda-cloud-modeler.production.min.js +3 -3
- package/dist/camunda-platform-modeler.development.js +178 -270
- package/dist/camunda-platform-modeler.production.min.js +1 -1
- package/lib/camunda-cloud/features/modeling/behavior/CleanUpBusinessRuleTaskBehavior.js +112 -0
- package/lib/camunda-cloud/features/modeling/behavior/CreateZeebeBoundaryEventBehavior.js +51 -55
- package/lib/camunda-cloud/features/modeling/behavior/CreateZeebeCallActivityBehavior.js +56 -59
- package/lib/camunda-cloud/features/modeling/behavior/FormDefinitionBehavior.js +69 -127
- package/lib/camunda-cloud/features/modeling/behavior/UpdatePropagateAllChildVariablesBehavior.js +76 -128
- package/lib/camunda-cloud/features/modeling/behavior/index.js +3 -0
- package/lib/camunda-cloud/features/properties-provider/parts/implementation/InputOutput.js +21 -7
- package/lib/camunda-cloud/features/rules/BpmnRules.js +1 -1
- package/lib/camunda-cloud/helper/CalledElementHelper.js +43 -41
- package/lib/camunda-cloud/helper/FormsHelper.js +38 -50
- package/lib/camunda-cloud/helper/InputOutputHelper.js +92 -106
- package/lib/camunda-platform/features/modeling/behavior/DeleteErrorEventDefinitionBehavior.js +24 -47
- package/lib/camunda-platform/features/modeling/behavior/DeleteRetryTimeCycleBehavior.js +39 -81
- package/lib/camunda-platform/features/modeling/behavior/UpdateCamundaExclusiveBehavior.js +31 -65
- package/lib/camunda-platform/features/modeling/behavior/UpdateInputOutputBehavior.js +42 -76
- package/lib/camunda-platform/features/modeling/behavior/UpdateResultVariableBehavior.js +21 -26
- package/lib/camunda-platform/features/modeling/behavior/UserTaskFormsBehavior.js +16 -10
- package/lib/camunda-platform/helper/InputOutputHelper.js +29 -0
- package/package.json +2 -2
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Copyright (c) 2016 Jorik Tangelder;
|
|
6
6
|
* Licensed under the MIT license */
|
|
7
7
|
var ka=n((function(e){!function(t,n,i,r){var o,a=["","webkit","Moz","MS","ms","o"],s=n.createElement("div"),c=Math.round,p=Math.abs,u=Date.now;function l(e,t,n){return setTimeout(g(e,n),t)}function d(e,t,n){return!!Array.isArray(e)&&(h(e,n[t],n),!0)}function h(e,t,n){var i;if(e)if(e.forEach)e.forEach(t,n);else if(e.length!==r)for(i=0;i<e.length;)t.call(n,e[i],i,e),i++;else for(i in e)e.hasOwnProperty(i)&&t.call(n,e[i],i,e)}function m(e,n,i){var r="DEPRECATED METHOD: "+n+"\n"+i+" AT \n";return function(){var n=new Error("get-stack-trace"),i=n&&n.stack?n.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",o=t.console&&(t.console.warn||t.console.log);return o&&o.call(t.console,r,i),e.apply(this,arguments)}}o="function"!=typeof Object.assign?function(e){if(e===r||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;n<arguments.length;n++){var i=arguments[n];if(i!==r&&null!==i)for(var o in i)i.hasOwnProperty(o)&&(t[o]=i[o])}return t}:Object.assign;var f=m((function(e,t,n){for(var i=Object.keys(t),o=0;o<i.length;)(!n||n&&e[i[o]]===r)&&(e[i[o]]=t[i[o]]),o++;return e}),"extend","Use `assign`."),v=m((function(e,t){return f(e,t,!0)}),"merge","Use `assign`.");function y(e,t,n){var i,r=t.prototype;(i=e.prototype=Object.create(r)).constructor=e,i._super=r,n&&o(i,n)}function g(e,t){return function(){return e.apply(t,arguments)}}function b(e,t){return"function"==typeof e?e.apply(t&&t[0]||r,t):e}function x(e,t){return e===r?t:e}function E(e,t,n){h(S(t),(function(t){e.addEventListener(t,n,!1)}))}function w(e,t,n){h(S(t),(function(t){e.removeEventListener(t,n,!1)}))}function _(e,t){for(;e;){if(e==t)return!0;e=e.parentNode}return!1}function P(e,t){return e.indexOf(t)>-1}function S(e){return e.trim().split(/\s+/g)}function O(e,t,n){if(e.indexOf&&!n)return e.indexOf(t);for(var i=0;i<e.length;){if(n&&e[i][n]==t||!n&&e[i]===t)return i;i++}return-1}function C(e){return Array.prototype.slice.call(e,0)}function T(e,t,n){for(var i=[],r=[],o=0;o<e.length;){var a=t?e[o][t]:e[o];O(r,a)<0&&i.push(e[o]),r[o]=a,o++}return n&&(i=t?i.sort((function(e,n){return e[t]>n[t]})):i.sort()),i}function A(e,t){for(var n,i,o=t[0].toUpperCase()+t.slice(1),s=0;s<a.length;){if((i=(n=a[s])?n+o:t)in e)return i;s++}return r}var R=1;function k(e){var n=e.ownerDocument||e;return n.defaultView||n.parentWindow||t}var j="ontouchstart"in t,M=A(t,"PointerEvent")!==r,D=j&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),B="touch",I="mouse",N=24,L=["x","y"],F=["clientX","clientY"];function V(e,t){var n=this;this.manager=e,this.callback=t,this.element=e.element,this.target=e.options.inputTarget,this.domHandler=function(t){b(e.options.enable,[e])&&n.handler(t)},this.init()}function $(e,t,n){var i=n.pointers.length,o=n.changedPointers.length,a=1&t&&i-o==0,s=12&t&&i-o==0;n.isFirst=!!a,n.isFinal=!!s,a&&(e.session={}),n.eventType=t,function(e,t){var n=e.session,i=t.pointers,o=i.length;n.firstInput||(n.firstInput=z(t));o>1&&!n.firstMultiple?n.firstMultiple=z(t):1===o&&(n.firstMultiple=!1);var a=n.firstInput,s=n.firstMultiple,c=s?s.center:a.center,l=t.center=q(i);t.timeStamp=u(),t.deltaTime=t.timeStamp-a.timeStamp,t.angle=W(c,l),t.distance=H(c,l),function(e,t){var n=t.center,i=e.offsetDelta||{},r=e.prevDelta||{},o=e.prevInput||{};1!==t.eventType&&4!==o.eventType||(r=e.prevDelta={x:o.deltaX||0,y:o.deltaY||0},i=e.offsetDelta={x:n.x,y:n.y});t.deltaX=r.x+(n.x-i.x),t.deltaY=r.y+(n.y-i.y)}(n,t),t.offsetDirection=G(t.deltaX,t.deltaY);var d=U(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=d.x,t.overallVelocityY=d.y,t.overallVelocity=p(d.x)>p(d.y)?d.x:d.y,t.scale=s?(h=s.pointers,m=i,H(m[0],m[1],F)/H(h[0],h[1],F)):1,t.rotation=s?function(e,t){return W(t[1],t[0],F)+W(e[1],e[0],F)}(s.pointers,i):0,t.maxPointers=n.prevInput?t.pointers.length>n.prevInput.maxPointers?t.pointers.length:n.prevInput.maxPointers:t.pointers.length,function(e,t){var n,i,o,a,s=e.lastInterval||t,c=t.timeStamp-s.timeStamp;if(8!=t.eventType&&(c>25||s.velocity===r)){var u=t.deltaX-s.deltaX,l=t.deltaY-s.deltaY,d=U(c,u,l);i=d.x,o=d.y,n=p(d.x)>p(d.y)?d.x:d.y,a=G(u,l),e.lastInterval=t}else n=s.velocity,i=s.velocityX,o=s.velocityY,a=s.direction;t.velocity=n,t.velocityX=i,t.velocityY=o,t.direction=a}(n,t);var h,m;var f=e.element;_(t.srcEvent.target,f)&&(f=t.srcEvent.target);t.target=f}(e,n),e.emit("hammer.input",n),e.recognize(n),e.session.prevInput=n}function z(e){for(var t=[],n=0;n<e.pointers.length;)t[n]={clientX:c(e.pointers[n].clientX),clientY:c(e.pointers[n].clientY)},n++;return{timeStamp:u(),pointers:t,center:q(t),deltaX:e.deltaX,deltaY:e.deltaY}}function q(e){var t=e.length;if(1===t)return{x:c(e[0].clientX),y:c(e[0].clientY)};for(var n=0,i=0,r=0;r<t;)n+=e[r].clientX,i+=e[r].clientY,r++;return{x:c(n/t),y:c(i/t)}}function U(e,t,n){return{x:t/e||0,y:n/e||0}}function G(e,t){return e===t?1:p(e)>=p(t)?e<0?2:4:t<0?8:16}function H(e,t,n){n||(n=L);var i=t[n[0]]-e[n[0]],r=t[n[1]]-e[n[1]];return Math.sqrt(i*i+r*r)}function W(e,t,n){n||(n=L);var i=t[n[0]]-e[n[0]],r=t[n[1]]-e[n[1]];return 180*Math.atan2(r,i)/Math.PI}V.prototype={handler:function(){},init:function(){this.evEl&&E(this.element,this.evEl,this.domHandler),this.evTarget&&E(this.target,this.evTarget,this.domHandler),this.evWin&&E(k(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&w(this.element,this.evEl,this.domHandler),this.evTarget&&w(this.target,this.evTarget,this.domHandler),this.evWin&&w(k(this.element),this.evWin,this.domHandler)}};var K={mousedown:1,mousemove:2,mouseup:4},X="mousedown",Y="mousemove mouseup";function J(){this.evEl=X,this.evWin=Y,this.pressed=!1,V.apply(this,arguments)}y(J,V,{handler:function(e){var t=K[e.type];1&t&&0===e.button&&(this.pressed=!0),2&t&&1!==e.which&&(t=4),this.pressed&&(4&t&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:I,srcEvent:e}))}});var Z={pointerdown:1,pointermove:2,pointerup:4,pointercancel:8,pointerout:8},Q={2:B,3:"pen",4:I,5:"kinect"},ee="pointerdown",te="pointermove pointerup pointercancel";function ne(){this.evEl=ee,this.evWin=te,V.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}t.MSPointerEvent&&!t.PointerEvent&&(ee="MSPointerDown",te="MSPointerMove MSPointerUp MSPointerCancel"),y(ne,V,{handler:function(e){var t=this.store,n=!1,i=e.type.toLowerCase().replace("ms",""),r=Z[i],o=Q[e.pointerType]||e.pointerType,a=o==B,s=O(t,e.pointerId,"pointerId");1&r&&(0===e.button||a)?s<0&&(t.push(e),s=t.length-1):12&r&&(n=!0),s<0||(t[s]=e,this.callback(this.manager,r,{pointers:t,changedPointers:[e],pointerType:o,srcEvent:e}),n&&t.splice(s,1))}});var ie={touchstart:1,touchmove:2,touchend:4,touchcancel:8},re="touchstart",oe="touchstart touchmove touchend touchcancel";function ae(){this.evTarget=re,this.evWin=oe,this.started=!1,V.apply(this,arguments)}function se(e,t){var n=C(e.touches),i=C(e.changedTouches);return 12&t&&(n=T(n.concat(i),"identifier",!0)),[n,i]}y(ae,V,{handler:function(e){var t=ie[e.type];if(1===t&&(this.started=!0),this.started){var n=se.call(this,e,t);12&t&&n[0].length-n[1].length==0&&(this.started=!1),this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:B,srcEvent:e})}}});var ce={touchstart:1,touchmove:2,touchend:4,touchcancel:8},pe="touchstart touchmove touchend touchcancel";function ue(){this.evTarget=pe,this.targetIds={},V.apply(this,arguments)}function le(e,t){var n=C(e.touches),i=this.targetIds;if(3&t&&1===n.length)return i[n[0].identifier]=!0,[n,n];var r,o,a=C(e.changedTouches),s=[],c=this.target;if(o=n.filter((function(e){return _(e.target,c)})),1===t)for(r=0;r<o.length;)i[o[r].identifier]=!0,r++;for(r=0;r<a.length;)i[a[r].identifier]&&s.push(a[r]),12&t&&delete i[a[r].identifier],r++;return s.length?[T(o.concat(s),"identifier",!0),s]:void 0}y(ue,V,{handler:function(e){var t=ce[e.type],n=le.call(this,e,t);n&&this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:B,srcEvent:e})}});function de(){V.apply(this,arguments);var e=g(this.handler,this);this.touch=new ue(this.manager,e),this.mouse=new J(this.manager,e),this.primaryTouch=null,this.lastTouches=[]}function he(e,t){1&e?(this.primaryTouch=t.changedPointers[0].identifier,me.call(this,t)):12&e&&me.call(this,t)}function me(e){var t=e.changedPointers[0];if(t.identifier===this.primaryTouch){var n={x:t.clientX,y:t.clientY};this.lastTouches.push(n);var i=this.lastTouches;setTimeout((function(){var e=i.indexOf(n);e>-1&&i.splice(e,1)}),2500)}}function fe(e){for(var t=e.srcEvent.clientX,n=e.srcEvent.clientY,i=0;i<this.lastTouches.length;i++){var r=this.lastTouches[i],o=Math.abs(t-r.x),a=Math.abs(n-r.y);if(o<=25&&a<=25)return!0}return!1}y(de,V,{handler:function(e,t,n){var i=n.pointerType==B,r=n.pointerType==I;if(!(r&&n.sourceCapabilities&&n.sourceCapabilities.firesTouchEvents)){if(i)he.call(this,t,n);else if(r&&fe.call(this,n))return;this.callback(e,t,n)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var ve=A(s.style,"touchAction"),ye=ve!==r,ge="compute",be="auto",xe="manipulation",Ee="none",we="pan-x",_e="pan-y",Pe=function(){if(!ye)return!1;var e={},n=t.CSS&&t.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach((function(i){e[i]=!n||t.CSS.supports("touch-action",i)})),e}();function Se(e,t){this.manager=e,this.set(t)}Se.prototype={set:function(e){e==ge&&(e=this.compute()),ye&&this.manager.element.style&&Pe[e]&&(this.manager.element.style[ve]=e),this.actions=e.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var e=[];return h(this.manager.recognizers,(function(t){b(t.options.enable,[t])&&(e=e.concat(t.getTouchAction()))})),function(e){if(P(e,Ee))return Ee;var t=P(e,we),n=P(e,_e);if(t&&n)return Ee;if(t||n)return t?we:_e;if(P(e,xe))return xe;return be}(e.join(" "))},preventDefaults:function(e){var t=e.srcEvent,n=e.offsetDirection;if(this.manager.session.prevented)t.preventDefault();else{var i=this.actions,r=P(i,Ee)&&!Pe.none,o=P(i,_e)&&!Pe["pan-y"],a=P(i,we)&&!Pe["pan-x"];if(r){var s=1===e.pointers.length,c=e.distance<2,p=e.deltaTime<250;if(s&&c&&p)return}if(!a||!o)return r||o&&6&n||a&&n&N?this.preventSrc(t):void 0}},preventSrc:function(e){this.manager.session.prevented=!0,e.preventDefault()}};var Oe=32;function Ce(e){this.options=o({},this.defaults,e||{}),this.id=R++,this.manager=null,this.options.enable=x(this.options.enable,!0),this.state=1,this.simultaneous={},this.requireFail=[]}function Te(e){return 16&e?"cancel":8&e?"end":4&e?"move":2&e?"start":""}function Ae(e){return 16==e?"down":8==e?"up":2==e?"left":4==e?"right":""}function Re(e,t){var n=t.manager;return n?n.get(e):e}function ke(){Ce.apply(this,arguments)}function je(){ke.apply(this,arguments),this.pX=null,this.pY=null}function Me(){ke.apply(this,arguments)}function De(){Ce.apply(this,arguments),this._timer=null,this._input=null}function Be(){ke.apply(this,arguments)}function Ie(){ke.apply(this,arguments)}function Ne(){Ce.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function Le(e,t){return(t=t||{}).recognizers=x(t.recognizers,Le.defaults.preset),new Fe(e,t)}Ce.prototype={defaults:{},set:function(e){return o(this.options,e),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(e){if(d(e,"recognizeWith",this))return this;var t=this.simultaneous;return t[(e=Re(e,this)).id]||(t[e.id]=e,e.recognizeWith(this)),this},dropRecognizeWith:function(e){return d(e,"dropRecognizeWith",this)||(e=Re(e,this),delete this.simultaneous[e.id]),this},requireFailure:function(e){if(d(e,"requireFailure",this))return this;var t=this.requireFail;return-1===O(t,e=Re(e,this))&&(t.push(e),e.requireFailure(this)),this},dropRequireFailure:function(e){if(d(e,"dropRequireFailure",this))return this;e=Re(e,this);var t=O(this.requireFail,e);return t>-1&&this.requireFail.splice(t,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(e){return!!this.simultaneous[e.id]},emit:function(e){var t=this,n=this.state;function i(n){t.manager.emit(n,e)}n<8&&i(t.options.event+Te(n)),i(t.options.event),e.additionalEvent&&i(e.additionalEvent),n>=8&&i(t.options.event+Te(n))},tryEmit:function(e){if(this.canEmit())return this.emit(e);this.state=Oe},canEmit:function(){for(var e=0;e<this.requireFail.length;){if(!(33&this.requireFail[e].state))return!1;e++}return!0},recognize:function(e){var t=o({},e);if(!b(this.options.enable,[this,t]))return this.reset(),void(this.state=Oe);56&this.state&&(this.state=1),this.state=this.process(t),30&this.state&&this.tryEmit(t)},process:function(e){},getTouchAction:function(){},reset:function(){}},y(ke,Ce,{defaults:{pointers:1},attrTest:function(e){var t=this.options.pointers;return 0===t||e.pointers.length===t},process:function(e){var t=this.state,n=e.eventType,i=6&t,r=this.attrTest(e);return i&&(8&n||!r)?16|t:i||r?4&n?8|t:2&t?4|t:2:Oe}}),y(je,ke,{defaults:{event:"pan",threshold:10,pointers:1,direction:30},getTouchAction:function(){var e=this.options.direction,t=[];return 6&e&&t.push(_e),e&N&&t.push(we),t},directionTest:function(e){var t=this.options,n=!0,i=e.distance,r=e.direction,o=e.deltaX,a=e.deltaY;return r&t.direction||(6&t.direction?(r=0===o?1:o<0?2:4,n=o!=this.pX,i=Math.abs(e.deltaX)):(r=0===a?1:a<0?8:16,n=a!=this.pY,i=Math.abs(e.deltaY))),e.direction=r,n&&i>t.threshold&&r&t.direction},attrTest:function(e){return ke.prototype.attrTest.call(this,e)&&(2&this.state||!(2&this.state)&&this.directionTest(e))},emit:function(e){this.pX=e.deltaX,this.pY=e.deltaY;var t=Ae(e.direction);t&&(e.additionalEvent=this.options.event+t),this._super.emit.call(this,e)}}),y(Me,ke,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Ee]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.scale-1)>this.options.threshold||2&this.state)},emit:function(e){if(1!==e.scale){var t=e.scale<1?"in":"out";e.additionalEvent=this.options.event+t}this._super.emit.call(this,e)}}),y(De,Ce,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[be]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,i=e.distance<t.threshold,r=e.deltaTime>t.time;if(this._input=e,!i||!n||12&e.eventType&&!r)this.reset();else if(1&e.eventType)this.reset(),this._timer=l((function(){this.state=8,this.tryEmit()}),t.time,this);else if(4&e.eventType)return 8;return Oe},reset:function(){clearTimeout(this._timer)},emit:function(e){8===this.state&&(e&&4&e.eventType?this.manager.emit(this.options.event+"up",e):(this._input.timeStamp=u(),this.manager.emit(this.options.event,this._input)))}}),y(Be,ke,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Ee]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||2&this.state)}}),y(Ie,ke,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:30,pointers:1},getTouchAction:function(){return je.prototype.getTouchAction.call(this)},attrTest:function(e){var t,n=this.options.direction;return 30&n?t=e.overallVelocity:6&n?t=e.overallVelocityX:n&N&&(t=e.overallVelocityY),this._super.attrTest.call(this,e)&&n&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers==this.options.pointers&&p(t)>this.options.velocity&&4&e.eventType},emit:function(e){var t=Ae(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)}}),y(Ne,Ce,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[xe]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,i=e.distance<t.threshold,r=e.deltaTime<t.time;if(this.reset(),1&e.eventType&&0===this.count)return this.failTimeout();if(i&&r&&n){if(4!=e.eventType)return this.failTimeout();var o=!this.pTime||e.timeStamp-this.pTime<t.interval,a=!this.pCenter||H(this.pCenter,e.center)<t.posThreshold;if(this.pTime=e.timeStamp,this.pCenter=e.center,a&&o?this.count+=1:this.count=1,this._input=e,0===this.count%t.taps)return this.hasRequireFailures()?(this._timer=l((function(){this.state=8,this.tryEmit()}),t.interval,this),2):8}return Oe},failTimeout:function(){return this._timer=l((function(){this.state=Oe}),this.options.interval,this),Oe},reset:function(){clearTimeout(this._timer)},emit:function(){8==this.state&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),Le.VERSION="2.0.7",Le.defaults={domEvents:!1,touchAction:ge,enable:!0,inputTarget:null,inputClass:null,preset:[[Be,{enable:!1}],[Me,{enable:!1},["rotate"]],[Ie,{direction:6}],[je,{direction:6},["swipe"]],[Ne],[Ne,{event:"doubletap",taps:2},["tap"]],[De]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};function Fe(e,t){var n;this.options=o({},Le.defaults,t||{}),this.options.inputTarget=this.options.inputTarget||e,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=e,this.input=new((n=this).options.inputClass||(M?ne:D?ue:j?de:J))(n,$),this.touchAction=new Se(this,this.options.touchAction),Ve(this,!0),h(this.options.recognizers,(function(e){var t=this.add(new e[0](e[1]));e[2]&&t.recognizeWith(e[2]),e[3]&&t.requireFailure(e[3])}),this)}function Ve(e,t){var n,i=e.element;i.style&&(h(e.options.cssProps,(function(r,o){n=A(i.style,o),t?(e.oldCssProps[n]=i.style[n],i.style[n]=r):i.style[n]=e.oldCssProps[n]||""})),t||(e.oldCssProps={}))}Fe.prototype={set:function(e){return o(this.options,e),e.touchAction&&this.touchAction.update(),e.inputTarget&&(this.input.destroy(),this.input.target=e.inputTarget,this.input.init()),this},stop:function(e){this.session.stopped=e?2:1},recognize:function(e){var t=this.session;if(!t.stopped){var n;this.touchAction.preventDefaults(e);var i=this.recognizers,r=t.curRecognizer;(!r||r&&8&r.state)&&(r=t.curRecognizer=null);for(var o=0;o<i.length;)n=i[o],2===t.stopped||r&&n!=r&&!n.canRecognizeWith(r)?n.reset():n.recognize(e),!r&&14&n.state&&(r=t.curRecognizer=n),o++}},get:function(e){if(e instanceof Ce)return e;for(var t=this.recognizers,n=0;n<t.length;n++)if(t[n].options.event==e)return t[n];return null},add:function(e){if(d(e,"add",this))return this;var t=this.get(e.options.event);return t&&this.remove(t),this.recognizers.push(e),e.manager=this,this.touchAction.update(),e},remove:function(e){if(d(e,"remove",this))return this;if(e=this.get(e)){var t=this.recognizers,n=O(t,e);-1!==n&&(t.splice(n,1),this.touchAction.update())}return this},on:function(e,t){if(e!==r&&t!==r){var n=this.handlers;return h(S(e),(function(e){n[e]=n[e]||[],n[e].push(t)})),this}},off:function(e,t){if(e!==r){var n=this.handlers;return h(S(e),(function(e){t?n[e]&&n[e].splice(O(n[e],t),1):delete n[e]})),this}},emit:function(e,t){this.options.domEvents&&function(e,t){var i=n.createEvent("Event");i.initEvent(e,!0,!0),i.gesture=t,t.target.dispatchEvent(i)}(e,t);var i=this.handlers[e]&&this.handlers[e].slice();if(i&&i.length){t.type=e,t.preventDefault=function(){t.srcEvent.preventDefault()};for(var r=0;r<i.length;)i[r](t),r++}},destroy:function(){this.element&&Ve(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},o(Le,{INPUT_START:1,INPUT_MOVE:2,INPUT_END:4,INPUT_CANCEL:8,STATE_POSSIBLE:1,STATE_BEGAN:2,STATE_CHANGED:4,STATE_ENDED:8,STATE_RECOGNIZED:8,STATE_CANCELLED:16,STATE_FAILED:Oe,DIRECTION_NONE:1,DIRECTION_LEFT:2,DIRECTION_RIGHT:4,DIRECTION_UP:8,DIRECTION_DOWN:16,DIRECTION_HORIZONTAL:6,DIRECTION_VERTICAL:N,DIRECTION_ALL:30,Manager:Fe,Input:V,TouchAction:Se,TouchInput:ue,MouseInput:J,PointerEventInput:ne,TouchMouseInput:de,SingleTouchInput:ae,Recognizer:Ce,AttrRecognizer:ke,Tap:Ne,Pan:je,Swipe:Ie,Pinch:Me,Rotate:Be,Press:De,on:E,off:w,each:h,merge:v,extend:f,assign:o,inherit:y,bindFn:g,prefixed:A}),(void 0!==t?t:"undefined"!=typeof self?self:{}).Hammer=Le,e.exports?e.exports=Le:t.Hammer=Le}(window,document)})),ja=["mousedown","mouseup","mouseover","mouseout","click","dblclick"];function Ma(e,t){return t.get(e,!1)}function Da(e){e.preventDefault(),"function"==typeof e.stopPropagation?e.stopPropagation():e.srcEvent&&"function"==typeof e.srcEvent.stopPropagation&&e.srcEvent.stopPropagation(),"function"==typeof e.stopImmediatePropagation&&e.stopImmediatePropagation()}function Ba(e){function t(t){setTimeout((function(){_(ja,(function(t){pe.unbind(e,t,Da,!0)}))}),500)}pe.bind(e,"touchstart",(function(t){_(ja,(function(t){pe.bind(e,t,Da,!0)}))}),!0),pe.bind(e,"touchend",t,!0),pe.bind(e,"touchcancel",t,!0);var n=new ka.Manager(e,{inputClass:ka.TouchInput,recognizers:[],domEvents:!0}),i=new ka.Tap,r=new ka.Pan({threshold:10}),o=new ka.Press,a=new ka.Pinch,s=new ka.Tap({event:"doubletap",taps:2});return a.requireFailure(r),a.requireFailure(o),n.add([r,o,a,s,i]),n.reset=function(e){var t=this.recognizers,i=this.session;i.stopped||(n.stop(e),setTimeout((function(){var e,n;for(e=0;n=t[e];e++)n.reset(),n.state=8;i.curRecognizer=null}),0))},n.on("hammer.input",(function(e){e.srcEvent.defaultPrevented&&n.reset(!0)})),n}function Ia(e,t,n,i,r){var o,a=Ma("dragging",e),s=Ma("move",e),c=Ma("contextPad",e),p=Ma("palette",e);function u(e){return function(t){r.fire(e,t)}}function l(e){return oe(e,"svg, .djs-element",!0)}function d(e){function n(e){var n=l(e.target),r=n&&i.get(n);if(s&&t.getRootElement()!==r)return s.start(e,r,!0);!function(e){var n=0,i=0;function r(e){var r=e.deltaX-n,o=e.deltaY-i;t.scroll({dx:r,dy:o}),n=e.deltaX,i=e.deltaY}function a(e){o.off("panmove",r),o.off("panend",a),o.off("pancancel",a)}o.on("panmove",r),o.on("panend",a),o.on("pancancel",a)}()}(o=Ba(e)).on("doubletap",u("element.dblclick")),o.on("tap",u("element.click")),o.on("panstart",n),o.on("press",n),o.on("pinchstart",(function(e){var n=t.zoom(),i=e.center;function r(e){var r=1-(1-e.scale)/1.5,o=Math.max(.2,Math.min(4,r*n));t.zoom(o,i),Da(e)}function a(e){o.off("pinchmove",r),o.off("pinchend",a),o.off("pinchcancel",a),o.reset(!0)}o.on("pinchmove",r),o.on("pinchend",a),o.on("pinchcancel",a)}))}a&&n.on("drag.move",(function(e){var t=e.originalEvent;if(t&&!(t instanceof MouseEvent)){var n=Ao(t),r=l(document.elementFromPoint(n.x,n.y)),o=r&&i.get(r);o!==e.hover&&(e.hover&&a.out(e),o&&(a.hover({element:o,gfx:r}),e.hover=o,e.hoverGfx=r))}})),c&&n.on("contextPad.create",(function(e){var t=Ba(e.pad.html);t.on("panstart",(function(e){c.trigger("dragstart",e,!0)})),t.on("press",(function(e){c.trigger("dragstart",e,!0)})),t.on("tap",(function(e){c.trigger("click",e)}))})),p&&n.on("palette.create",(function(e){var t=Ba(e.container);t.on("panstart",(function(e){p.trigger("dragstart",e,!0)})),t.on("press",(function(e){p.trigger("dragstart",e,!0)})),t.on("tap",(function(e){p.trigger("click",e)}))})),n.on("canvas.init",(function(e){d(e.svg)}))}function Na(e,t){var n=this;t.on("canvas.init",(function(e){n.addBBoxMarker(e.svg)}))}Ia.$inject=["injector","canvas","eventBus","elementRegistry","interactionEvents","touchFix"],Na.$inject=["canvas","eventBus"],Na.prototype.addBBoxMarker=function(e){var t={fill:"none",class:"outer-bound-marker"},n=Ne("rect");Pe(n,{x:-1e4,y:1e4,width:10,height:10}),Pe(n,t),Ee(e,n);var i=Ne("rect");Pe(i,{x:1e4,y:1e4,width:10,height:10}),Pe(i,t),Ee(e,i)};var La={__depends__:[{__depends__:[No],__init__:["touchInteractionEvents"],touchInteractionEvents:["type",Ia],touchFix:["type",Na]}]};function Fa(e){return e&&e[e.length-1]}function Va(e){return e.y}function $a(e){return e.x}var za={left:$a,center:$a,right:function(e){return e.x+e.width},top:Va,middle:Va,bottom:function(e){return e.y+e.height}};function qa(e){this._modeling=e}qa.$inject=["modeling"],qa.prototype._getOrientationDetails=function(e){var t="x",n="width";return-1!==["top","bottom","middle"].indexOf(e)&&(t="y",n="height"),{axis:t,dimension:n}},qa.prototype._isType=function(e,t){return-1!==t.indexOf(e)},qa.prototype._alignmentPosition=function(e,t){var n,i,r,o=this._getOrientationDetails(e),a=o.axis,s=o.dimension,c={},p={},u=!1;if(this._isType(e,["left","top"]))c[e]=t[0][a];else if(this._isType(e,["right","bottom"]))r=Fa(t),c[e]=r[a]+r[s];else if(this._isType(e,["center","middle"])){if(_(t,(function(e){var t=e[a]+Math.round(e[s]/2);p[t]?p[t].elements.push(e):p[t]={elements:[e],center:t}})),n=B(p,(function(e){return e.elements.length>1&&(u=!0),e.elements.length})),u)return c[e]=Fa(n).center,c;i=t[0],r=Fa(t=B(t,(function(e){return e[a]+e[s]}))),c[e]=function(e,t){return Math.round((e[a]+t[a]+t[s])/2)}(i,r)}return c},qa.prototype.trigger=function(e,t){var n=this._modeling,i=w(e,(function(e){return!(e.waypoints||e.host||e.labelTarget)}));if(!(i.length<2)){var r=B(i,za[t]),o=this._alignmentPosition(t,r);n.alignElements(r,o)}};var Ua={__init__:["alignElements"],alignElements:["type",qa]};function Ga(e,t,n,i){for(var r;r=Wa(e,n,t);)n=i(t,n,r);return n}function Ha(e){return function(t,n,i){var r={x:n.x,y:n.y};return["x","y"].forEach((function(o){var a=e[o];if(a){var s="x"===o?"width":"height",c=a.margin,p=a.minDistance;r[o]=c<0?Math.min(i[o]+c-t[s]/2,n[o]-p+c):Math.max(i[o]+i[s]+c+t[s]/2,n[o]+p+c)}})),r}}function Wa(e,t,n){var i={x:t.x-n.width/2,y:t.y-n.height/2,width:n.width,height:n.height};return x(function(e){var t=Ka(e);e.host&&(t=t.concat(Ka(e.host)));e.attachers&&(t=t.concat(e.attachers.reduce((function(e,t){return e.concat(Ka(t))}),[])));return t}(e),(function(e){return e!==n&&"intersect"===vn(e,i,10)}))}function Ka(e){return(t=e,t.outgoing.map((function(e){return e.target}))).concat(function(e){return e.incoming.map((function(e){return e.source}))}(e));var t}function Xa(){return!0}function Ya(e,t,n){e.on("autoPlace",100,(function(e){var t=e.shape;return function(e,t,n){n||(n={});var i=n.defaultDistance||50,r=fn(e);return{x:hn(e).right+i+t.width/2,y:r.y}}(e.source,t)})),e.on("autoPlace.end",(function(e){n.scrollToElement(e.shape)})),this.append=function(n,i,r){e.fire("autoPlace.start",{source:n,shape:i});var o=e.fire("autoPlace",{source:n,shape:i}),a=t.appendShape(n,i,o,n.parent,r);return e.fire("autoPlace.end",{source:n,shape:a}),a}}function Ja(e,t){e.on("autoPlace.end",500,(function(e){t.select(e.shape)}))}Ya.$inject=["eventBus","modeling","canvas"],Ja.$inject=["eventBus","selection"];var Za={__init__:["autoPlaceSelectionBehavior"],autoPlace:["type",Ya],autoPlaceSelectionBehavior:["type",Ja]};function Qa(e,t){return C(t,(function(t){return Dr(e,t)}))}function es(e,t){for("string"==typeof t&&(t=[t]);e=e.parent;)if(Qa(e,t))return e;return null}var ts=Object.freeze({__proto__:null,isAny:Qa,getParent:es});function ns(e,t){return Dr(t,"bpmn:TextAnnotation")?function(e,t){var n=hn(e),i={x:n.right+t.width/2,y:n.top-50-t.height/2};return Ga(e,t,i,Ha({y:{margin:-30,minDistance:20}}))}(e,t):Qa(t,["bpmn:DataObjectReference","bpmn:DataStoreReference"])?function(e,t){var n=hn(e),i={x:n.right-10+t.width/2,y:n.bottom+40+t.width/2};return Ga(e,t,i,Ha({x:{margin:30,minDistance:30}}))}(e,t):Dr(t,"bpmn:FlowNode")?function(e,t){var n=hn(e),i=fn(e),r=function(e,t){t||(t={});var n=t.defaultDistance||50,i=t.direction||"e",r=t.filter,o=t.getWeight||function(t){return t.source===e?1:-1},a=t.maxDistance||250,s=t.reference||"start";function c(e,t){return"n"===i?"start"===s?hn(e).top-hn(t).bottom:"center"===s?hn(e).top-fn(t).y:hn(e).top-hn(t).top:"w"===i?"start"===s?hn(e).left-hn(t).right:"center"===s?hn(e).left-fn(t).x:hn(e).left-hn(t).left:"s"===i?"start"===s?hn(t).top-hn(e).bottom:"center"===s?fn(t).y-hn(e).bottom:hn(t).bottom-hn(e).bottom:"start"===s?hn(t).left-hn(e).right:"center"===s?fn(t).x-hn(e).right:hn(t).right-hn(e).right}r||(r=Xa);var p=e.incoming.filter(r).map((function(t){var n=o(t),i=n<0?c(t.source,e):c(e,t.source);return{id:t.source.id,distance:i,weight:n}})),u=e.outgoing.filter(r).map((function(t){var n=o(t),i=n>0?c(e,t.target):c(t.target,e);return{id:t.target.id,distance:i,weight:n}}));return S(p.concat(u).reduce((function(e,t){return e[t.id+"__weight_"+t.weight]=t,e}),{}),(function(e,t){var n=t.distance,i=t.weight;return n<0||n>a||(e[String(n)]||(e[String(n)]=0),e[String(n)]+=1*i,(!e.distance||e[e.distance]<e[String(n)])&&(e.distance=n)),e}),{}).distance||n}(e,{filter:function(e){return Dr(e,"bpmn:SequenceFlow")}}),o=30,a=80,s="left";Dr(e,"bpmn:BoundaryEvent")&&-1!==(s=vn(e,e.host,-25)).indexOf("top")&&(o*=-1);var c={x:n.right+r+t.width/2,y:i.y+is(s,a)};return Ga(e,t,c,Ha({y:{margin:o,minDistance:a}}))}(e,t):void 0}function is(e,t){return-1!=e.indexOf("top")?-1*t:-1!=e.indexOf("bottom")?t:0}function rs(e){e.on("autoPlace",(function(e){var t=e.shape;return ns(e.source,t)}))}rs.$inject=["eventBus"];var os={__depends__:[Za],__init__:["bpmnAutoPlace"],bpmnAutoPlace:["type",rs]};function as(e){this._eventBus=e}as.$inject=["eventBus"],as.prototype.on=function(e,t,n,i,r,o){if((v(t)||f(t))&&(o=r,r=i,i=n,n=t,t=null),v(n)&&(o=r,r=i,i=n,n=1e3),m(r)&&(o=r,r=!1),!v(i))throw new Error("handlerFn must be a function");h(e)||(e=[e]);var a=this._eventBus;_(e,(function(e){var s=["commandStack",e,t].filter((function(e){return e})).join(".");a.on(s,n,r?function(e,t){return function(n){return e.call(t||null,n.context,n.command,n)}}(i,o):i,o)}))};_(["canExecute","preExecute","preExecuted","execute","executed","postExecute","postExecuted","revert","reverted"],(function(e){as.prototype[e]=function(t,n,i,r,o){(v(t)||f(t))&&(o=r,r=i,i=n,n=t,t=null),this.on(t,e,n,i,r,o)}}));var ss=Object.freeze({__proto__:null,default:as});function cs(e,t,n,i){as.call(this,e),this._elementRegistry=t,this._modeling=n,this._rules=i;var r=this;this.postExecuted(["shape.create"],(function(e){var t=e.context,n=t.hints||{},i=t.shape,o=t.parent||t.newParent;!1!==n.autoResize&&r._expand([i],o)})),this.postExecuted(["elements.move"],(function(e){var t=e.context,n=s(k(t.closure.topLevel)),i=t.hints,o=!i||i.autoResize;!1!==o&&_(j(n,(function(e){return e.parent.id})),(function(e,t){h(o)&&(e=e.filter((function(e){return x(o,I({id:e.id}))}))),r._expand(e,t)}))})),this.postExecuted(["shape.toggleCollapse"],(function(e){var t=e.context,n=t.hints,i=t.shape;n&&!1===n.autoResize||i.collapsed||r._expand(i.children||[],i)})),this.postExecuted(["shape.resize"],(function(e){var t=e.context,n=t.hints,i=t.shape,o=i.parent;n&&!1===n.autoResize||o&&r._expand([i],o)}))}function ps(e){e.invoke(cs,this)}function us(e){as.call(this,e),this.init()}function ls(e){us.call(this,e);var t=this;this.addRule("element.autoResize",(function(e){return t.canResize(e.elements,e.target)}))}function ds(e,t){ls.call(this,e),this._modeling=t}cs.$inject=["eventBus","elementRegistry","modeling","rules"],i(cs,as),cs.prototype._getOptimalBounds=function(e,t){var n=this.getOffset(t),i=this.getPadding(t),r=hn(ft(e)),o=hn(t),a={};return r.top-o.top<i.top&&(a.top=r.top-n.top),r.left-o.left<i.left&&(a.left=r.left-n.left),o.right-r.right<i.right&&(a.right=r.right+n.right),o.bottom-r.bottom<i.bottom&&(a.bottom=r.bottom+n.bottom),mn(U({},o,a))},cs.prototype._expand=function(e,t){if("string"==typeof t&&(t=this._elementRegistry.get(t)),this._rules.allowed("element.autoResize",{elements:e,target:t})){var n=this._getOptimalBounds(e,t);if(function(e,t){return e.x!==t.x||e.y!==t.y||e.width!==t.width||e.height!==t.height}(n,t)){var i=function(e,t){var n="";e=hn(e),t=hn(t),e.top>t.top&&(n=n.concat("n"));e.right<t.right&&(n=n.concat("w"));e.bottom<t.bottom&&(n=n.concat("s"));e.left>t.left&&(n=n.concat("e"));return n}(G(t,["x","y","width","height"]),n);this.resize(t,n,{autoResize:i});var r=t.parent;r&&this._expand([t],r)}}},cs.prototype.getOffset=function(e){return{top:60,bottom:60,left:100,right:100}},cs.prototype.getPadding=function(e){return{top:2,bottom:2,left:15,right:15}},cs.prototype.resize=function(e,t,n){this._modeling.resizeShape(e,t,null,n)},ps.$inject=["injector"],i(ps,cs),ps.prototype.resize=function(e,t,n){Dr(e,"bpmn:Participant")?this._modeling.resizeLane(e,t,null,n):this._modeling.resizeShape(e,t,null,n)},us.$inject=["eventBus"],i(us,as),us.prototype.addRule=function(e,t,n){var i=this;"string"==typeof e&&(e=[e]),e.forEach((function(e){i.canExecute(e,t,(function(e,t,i){return n(e)}),!0)}))},us.prototype.init=function(){},ls.$inject=["eventBus"],i(ls,us),ls.prototype.canResize=function(e,t){return!1},i(ds,ls),ds.$inject=["eventBus","modeling"],ds.prototype.canResize=function(e,t){if(!Dr(t,"bpmn:Participant")&&!Dr(t,"bpmn:Lane")&&!Dr(t,"bpmn:SubProcess"))return!1;var n=!0;return _(e,(function(e){(Dr(e,"bpmn:Lane")||e.labelTarget)&&(n=!1)})),n};var hs={__init__:["bpmnAutoResize","bpmnAutoResizeProvider"],bpmnAutoResize:["type",ps],bpmnAutoResizeProvider:["type",ds]};function ms(e,t,n){var i,r,o=this,a=n.get("dragging",!1);a&&t.on("drag.start",(function(n){t.once("drag.move",1500,(function(t){!function(t){if(!t.hover){var n=t.originalEvent,i=o._findTargetGfx(n),r=i&&e.get(i);i&&r&&(t.stopPropagation(),a.hover({element:r,gfx:i}),a.move(n))}}(t)}))})),t.on("element.hover",(function(e){i=e.gfx,r=e.element})),t.on("element.hover",1500,(function(e){r&&t.fire("element.out",{element:r,gfx:i})})),t.on("element.out",(function(){i=null,r=null})),this._findTargetGfx=function(e){var t;if(e instanceof MouseEvent)return t=Ao(e),function(e){return oe(e,"svg, .djs-element",!0)}(document.elementFromPoint(t.x,t.y))}}ms.$inject=["elementRegistry","eventBus","injector"];var fs={__init__:["hoverFix"],hoverFix:["type",ms]},vs=Math.round,ys="djs-drag-active";function gs(e){e.preventDefault()}function bs(e,t,n,i){var r,o={threshold:5,trapClick:!0};function a(e){var n=t.viewbox(),i=t._container.getBoundingClientRect();return{x:n.x+(e.x-i.left)/n.scale,y:n.y+(e.y-i.top)/n.scale}}function s(t,n){n=n||r;var i=e.createEvent(U({},n.payload,n.data,{isTouch:n.isTouch}));return!1!==e.fire("drag."+t,i)&&e.fire(n.prefix+"."+t,i)}function c(e,i){var o,c=r.payload,p=r.displacement,u=r.globalStart,l=Ao(e),d=Ea(l,u),h=r.localStart,m=a(l),v=Ea(m,h);if(!r.active&&(i||(o=d,Math.sqrt(Math.pow(o.x,2)+Math.pow(o.y,2))>r.threshold))){if(U(c,{x:vs(h.x+p.x),y:vs(h.y+p.y),dx:0,dy:0},{originalEvent:e}),!1===s("start"))return f();r.active=!0,r.keepSelection||(c.previousSelection=n.get(),n.select(null)),r.cursor&&ya(r.cursor),t.addMarker(t.getRootElement(),ys)}To(e),r.active&&(U(c,{x:vs(m.x+p.x),y:vs(m.y+p.y),dx:vs(v.x),dy:vs(v.y)},{originalEvent:e}),s("move"))}function p(e){var t=!0;r.active&&(e&&(r.payload.originalEvent=e,To(e)),t=s("end")),!1===t&&s("rejected"),s("ended",v(!0!==t))}function u(e){27===e.which&&(gs(e),f())}function l(t){var n;r.active&&(n=ba(e),setTimeout(n,400),gs(t)),p(t)}function d(e){c(e)}function h(e){var t=r.payload;t.hoverGfx=e.gfx,t.hover=e.element,s("hover")}function m(e){s("out");var t=r.payload;t.hoverGfx=null,t.hover=null}function f(e){var t;if(r){var n=r.active;n&&s("cancel"),t=v(e),n&&s("canceled",t)}}function v(o){var a,v;s("cleanup"),ga(),v=r.trapClick?l:p,pe.unbind(document,"mousemove",c),pe.unbind(document,"dragstart",gs),pe.unbind(document,"selectstart",gs),pe.unbind(document,"mousedown",v,!0),pe.unbind(document,"mouseup",v,!0),pe.unbind(document,"keyup",u),pe.unbind(document,"touchstart",d,!0),pe.unbind(document,"touchcancel",f,!0),pe.unbind(document,"touchmove",c,!0),pe.unbind(document,"touchend",p,!0),e.off("element.hover",h),e.off("element.out",m),t.removeMarker(t.getRootElement(),ys);var y=r.payload.previousSelection;return!1!==o&&y&&!n.get().length&&function(e){var t=e.filter((function(e){return i.get(e.id)}));t.length&&n.select(t)}(y),a=r,r=null,a}e.on("diagram.destroy",f),this.init=function(t,n,i,v){r&&f(!1),"string"==typeof n&&(v=i,i=n,n=null);var y,g,b,x,E,w=(v=U({},o,v||{})).data||{};x=v.trapClick?l:p,t?(y=Co(t)||t,g=Ao(t),To(t),"dragstart"===y.type&&gs(y)):(y=null,g={x:0,y:0}),b=a(g),n||(n=b),E=function(e){return"undefined"!=typeof TouchEvent&&e instanceof TouchEvent}(y),r=U({prefix:i,data:w,payload:{},globalStart:g,displacement:Ea(n,b),localStart:b,isTouch:E},v),v.manual||(E?(pe.bind(document,"touchstart",d,!0),pe.bind(document,"touchcancel",f,!0),pe.bind(document,"touchmove",c,!0),pe.bind(document,"touchend",p,!0)):(pe.bind(document,"mousemove",c),pe.bind(document,"dragstart",gs),pe.bind(document,"selectstart",gs),pe.bind(document,"mousedown",x,!0),pe.bind(document,"mouseup",x,!0)),pe.bind(document,"keyup",u),e.on("element.hover",h),e.on("element.out",m)),s("init"),v.autoActivate&&c(t,!0)},this.move=c,this.hover=h,this.out=m,this.end=p,this.cancel=f,this.context=function(){return r},this.setOptions=function(e){U(o,e)}}bs.$inject=["eventBus","canvas","selection","elementRegistry"];var xs={__depends__:[fs,Ho],dragging:["type",bs]};function Es(e,t,n){this._canvas=n,this._opts=U({scrollThresholdIn:[20,20,20,20],scrollThresholdOut:[0,0,0,0],scrollRepeatTimeout:15,scrollStep:10},e);var i=this;t.on("drag.move",(function(e){var t=i._toBorderPoint(e);i.startScroll(t)})),t.on(["drag.cleanup"],(function(){i.stopScroll()}))}function ws(e,t,n){return t<e&&e<n}Es.$inject=["config.autoScroll","eventBus","canvas"],Es.prototype.startScroll=function(e){var t=this._canvas,n=this._opts,i=this,r=t.getContainer().getBoundingClientRect(),o=[e.x,e.y,r.width-e.x,r.height-e.y];this.stopScroll();for(var a=0,s=0,c=0;c<4;c++)ws(o[c],n.scrollThresholdOut[c],n.scrollThresholdIn[c])&&(0===c?a=n.scrollStep:1==c?s=n.scrollStep:2==c?a=-n.scrollStep:3==c&&(s=-n.scrollStep));0===a&&0===s||(t.scroll({dx:a,dy:s}),this._scrolling=setTimeout((function(){i.startScroll(e)}),n.scrollRepeatTimeout))},Es.prototype.stopScroll=function(){clearTimeout(this._scrolling)},Es.prototype.setOptions=function(e){this._opts=U({},this._opts,e)},Es.prototype._toBorderPoint=function(e){var t=this._canvas._container.getBoundingClientRect(),n=Ao(e.originalEvent);return{x:n.x-t.left,y:n.y-t.top}};var _s={__depends__:[xs],__init__:["autoScroll"],autoScroll:["type",Es]};function Ps(e){this._commandStack=e.get("commandStack",!1)}Ps.$inject=["injector"],Ps.prototype.allowed=function(e,t){var n=!0,i=this._commandStack;return i&&(n=i.canExecute(e,t)),void 0===n||n};var Ss={__init__:["rules"],rules:["type",Ps]},Os=Math.round,Cs=Math.max;function Ts(e,t){return function(e,t){var n,i;for(n=0;i=e[n];n++)if(St(i,t)<=10)return{point:e[n],bendpoint:!0,index:n};return null}(e,t)||function(e,t){var n,i,r=un(function(e,t){return[["M",e.x,e.y],["m",0,-t],["a",t,t,0,1,1,0,2*t],["a",t,t,0,1,1,0,-2*t],["z"]]}(t,10),(n=[],e.forEach((function(e,t){n.push([0===t?"M":"L",e.x,e.y])})),n)),o=r[0],a=r[r.length-1];return o?o!==a?o.segment2!==a.segment2?{point:e[i=Cs(o.segment2,a.segment2)-1],bendpoint:!0,index:i}:{point:{x:Os(o.x+a.x)/2,y:Os(o.y+a.y)/2},index:o.segment2}:{point:{x:Os(o.x),y:Os(o.y)},index:o.segment2}:null}(e,t)}var As="djs-bendpoint",Rs="djs-segment-dragger";function ks(e,t,n){return Ts(t,function(e,t){var n,i=Ao(t),r=e._container.getBoundingClientRect();n={x:r.left,y:r.top};var o=e.viewbox();return{x:o.x+(i.x-n.x)/o.scale,y:o.y+(i.y-n.y)/o.scale}}(e,n))}function js(e,t){var n=Ne("g");Ae(n).add(As),Ee(e,n);var i=Ne("circle");Pe(i,{cx:0,cy:0,r:4}),Ae(i).add("djs-visual"),Ee(n,i);var r=Ne("circle");return Pe(r,{cx:0,cy:0,r:10}),Ae(r).add("djs-hit"),Ee(n,r),t&&Ae(n).add(t),n}function Ms(e,t,n,i){var r=Ne("g");Ee(e,r);var o=function(e,t,n){var i=t.x-e.x,r=t.y-e.y;return Bs("h"===n?i:r)}
|
|
8
|
-
/*! https://mths.be/cssescape v1.5.1 by @mathias | MIT license */(t,n,i),a=Ne("rect");Pe(a,{x:-7,y:-1.5,width:14,height:3}),Ae(a).add("djs-visual"),Ee(r,a);var s=Ne("rect");return Pe(s,{x:-o/2,y:-7,width:o,height:14}),Ae(s).add("djs-hit"),Ee(r,s),Jn(r,"v"===i?90:0),r}function Ds(e,t,n){var i=Ne("g"),r=At(t,n),o=Ct(t,n);return Ee(e,i),Ms(i,t,n,o),Ae(i).add(Rs),Ae(i).add("h"===o?"horizontal":"vertical"),Yn(i,r.x,r.y),i}function Bs(e){return Math.abs(Math.round(2*e/3))}var Is=n((function(t,n){!function(e,n){t.exports=function(e){if(e.CSS&&e.CSS.escape)return e.CSS.escape;var t=function(e){if(0==arguments.length)throw new TypeError("`CSS.escape` requires an argument.");for(var t,n=String(e),i=n.length,r=-1,o="",a=n.charCodeAt(0);++r<i;)0!=(t=n.charCodeAt(r))?o+=t>=1&&t<=31||127==t||0==r&&t>=48&&t<=57||1==r&&t>=48&&t<=57&&45==a?"\\"+t.toString(16)+" ":(0!=r||1!=i||45!=t)&&(t>=128||45==t||95==t||t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122)?n.charAt(r):"\\"+n.charAt(r):o+="�";return o};e.CSS||(e.CSS={});return e.CSS.escape=t,t}(e)}(e)})),Ns={"&":"&","<":"<",">":">",'"':""","'":"'"};function Ls(e){return(e=""+e)&&e.replace(/[&<>"']/g,(function(e){return Ns[e]}))}function Fs(e,t,n,i,r){function o(e,n){var o=n.waypoints,a=ks(t,o,e);if(a)return!function(e,t,n){var i,r,o,a,s,c,p=e.index,u=e.point;return!(p<=0||e.bendpoint)&&(o=At(i=t[p-1],r=t[p]),a=Ct(i,r),s=Math.abs(u.x-o.x),c=Math.abs(u.y-o.y),a&&s<=n&&c<=n)}(a,o,function(e,t){var n,i,r=e.waypoints;return t.index<=0||t.bendpoint?null:(i=Ct((n={start:r[t.index-1],end:r[t.index]}).start,n.end))?Bs("h"===i?n.end.x-n.start.x:n.end.y-n.start.y)/2:null}(n,a))?i.start(e,n,a.index,!a.bendpoint):r.start(e,n,a.index),!0}function a(e,t,i){pe.bind(e,t,(function(e){n.triggerMouseEvent(t,e,i),e.stopPropagation()}))}function s(e,n){var i=t.getLayer("overlays"),r=ve('.djs-bendpoints[data-element-id="'+Is(e.id)+'"]',i);return!r&&n&&(Pe(r=Ne("g"),{"data-element-id":e.id}),Ae(r).add("djs-bendpoints"),Ee(i,r),a(r,"mousedown",e),a(r,"click",e),a(r,"dblclick",e)),r}function c(e,t){return ve('.djs-segment-dragger[data-segment-idx="'+e+'"]',t)}function p(e,t){t.waypoints.forEach((function(t,n){var i=js(e);Ee(e,i),Yn(i,t.x,t.y)})),js(e,"floating")}function u(e,t){for(var n,i,r,o=t.waypoints,s=1;s<o.length;s++)Ct(n=o[s-1],i=o[s])&&(Pe(r=Ds(e,n,i),{"data-segment-idx":s}),a(r,"mousemove",t))}function l(e){var t=s(e);return t||(p(t=s(e,!0),e),u(t,e)),t}function d(e){var t=s(e);t&&(!function(e){_(ye(".djs-segment-dragger",e),(function(e){ke(e)}))}(t),function(e){_(ye(".djs-bendpoint",e),(function(e){ke(e)}))}(t),u(t,e),p(t,e))}function h(e,t,n){var i,r,o=c(t.index,e),a=n[t.index-1],s=n[t.index],p=t.point,u=At(a,s),l=Ct(a,s);o&&(i=function(e){return ve(".djs-visual",e)}(o),r={x:p.x-u.x,y:p.y-u.y},"v"===l&&(r={x:r.y,y:r.x}),Yn(i,r.x,r.y))}e.on("connection.changed",(function(e){d(e.element)})),e.on("connection.remove",(function(e){var t=s(e.element);t&&ke(t)})),e.on("element.marker.update",(function(e){var t,n=e.element;n.waypoints&&(t=l(n),e.add?Ae(t).add(e.marker):Ae(t).remove(e.marker))})),e.on("element.mousemove",(function(e){var n,i,r=e.element,o=r.waypoints;if(o){if(n=s(r,!0),!(i=ks(t,o,e.originalEvent)))return;!function(e,t){var n=ve(".floating",e),i=t.point;n&&Yn(n,i.x,i.y)}(n,i),i.bendpoint||h(n,i,o)}})),e.on("element.mousedown",(function(e){if(ko(e)){var t=e.originalEvent,n=e.element;if(n.waypoints)return o(t,n)}})),e.on("selection.changed",(function(e){var t=e.newSelection[0];t&&t.waypoints&&l(t)})),e.on("element.hover",(function(e){var t=e.element;t.waypoints&&(l(t),n.registerEvent(e.gfx,"mousemove","element.mousemove"))})),e.on("element.out",(function(e){n.unregisterEvent(e.gfx,"mousemove","element.mousemove")})),e.on("element.updateId",(function(e){var t=e.element,n=e.newId;if(t.waypoints){var i=s(t);i&&Pe(i,{"data-element-id":n})}})),this.addHandles=l,this.updateHandles=d,this.getBendpointsContainer=s,this.getSegmentDragger=c}Fs.$inject=["eventBus","canvas","interactionEvents","bendpointMove","connectionSegmentMove"];var Vs=Math.round,$s="reconnectStart",zs="reconnectEnd",qs="updateWaypoints";function Us(e,t,n,i,r,o){this._injector=e,this.start=function(e,t,o,a){var s,c=n.getGraphics(t),p=t.source,u=t.target,l=t.waypoints,d=(s=a||0!==o?a||o!==l.length-1?qs:zs:$s)===qs?"connection.updateWaypoints":"connection.reconnect",h=r.allowed(d,{connection:t,source:p,target:u});!1===h&&(h=r.allowed(d,{connection:t,source:u,target:p})),!1!==h&&i.init(e,"bendpoint.move",{data:{connection:t,connectionGfx:c,context:{allowed:h,bendpointIndex:o,connection:t,source:p,target:u,insert:a,type:s}}})},t.on("bendpoint.move.hover",(function(e){var t,n=e.context,i=n.connection,o=i.source,a=i.target,s=e.hover,c=n.type;if(n.hover=s,s){var p=c===qs?"connection.updateWaypoints":"connection.reconnect";if(t=n.allowed=r.allowed(p,{connection:i,source:c===$s?s:o,target:c===zs?s:a}))return n.source=c===$s?s:o,void(n.target=c===zs?s:a);!1===t&&(t=n.allowed=r.allowed(p,{connection:i,source:c===zs?s:a,target:c===$s?s:o})),t&&(n.source=c===zs?s:a,n.target=c===$s?s:o)}})),t.on(["bendpoint.move.out","bendpoint.move.cleanup"],(function(e){var t=e.context,n=t.type;t.hover=null,t.source=null,t.target=null,n!==qs&&(t.allowed=!1)})),t.on("bendpoint.move.end",(function(e){var t=e.context,n=t.allowed,i=t.bendpointIndex,r=t.connection,a=t.insert,s=r.waypoints.slice(),c=t.source,p=t.target,u=t.type,l=t.hints||{},d={x:Vs(e.x),y:Vs(e.y)};if(!n)return!1;u===qs?(a?s.splice(i,0,d):s[i]=d,l.bendpointMove={insert:a,bendpointIndex:i},s=this.cropWaypoints(r,s),o.updateWaypoints(r,function(e){e=e.slice();for(var t,n,i,r=0;e[r];)t=e[r],n=e[r-1],0===St(t,i=e[r+1])||Ot(n,i,t)?e.splice(r,1):r++;return e}(s),l)):(u===$s?(l.docking="source",Gs(t)&&(l.docking="target",l.newWaypoints=s.reverse())):u===zs&&(l.docking="target",Gs(t)&&(l.docking="source",l.newWaypoints=s.reverse())),o.reconnect(r,c,p,d,l))}),this)}function Gs(e){var t=e.hover,n=e.source,i=e.target,r=e.type;return r===$s?t&&i&&t===i&&n!==i:r===zs?t&&n&&t===n&&n!==i:void 0}Us.$inject=["injector","eventBus","canvas","dragging","rules","modeling"],Us.prototype.cropWaypoints=function(e,t){var n=this._injector.get("connectionDocking",!1);if(!n)return t;var i=e.waypoints;return e.waypoints=t,e.waypoints=n.getCroppedWaypoints(e),t=e.waypoints,e.waypoints=i,t};var Hs="updateWaypoints",Ws="connect-ok",Ks="connect-not-ok",Xs="connect-hover",Ys="djs-updating",Js="djs-element-hidden";function Zs(e,t,n,i){this._injector=t;var r=t.get("connectionPreview",!1);n.on("bendpoint.move.start",(function(e){var t=e.context,n=t.bendpointIndex,r=t.connection,o=t.insert,a=r.waypoints,s=a.slice();t.waypoints=a,o&&s.splice(n,0,{x:e.x,y:e.y}),r.waypoints=s,Ae(t.draggerGfx=js(i.getLayer("overlays"))).add("djs-dragging"),i.addMarker(r,Js),i.addMarker(r,Ys)})),n.on("bendpoint.move.hover",(function(e){var t=e.context,n=t.allowed,r=t.hover,o=t.type;if(r){if(i.addMarker(r,Xs),o===Hs)return;n?(i.removeMarker(r,Ks),i.addMarker(r,Ws)):!1===n&&(i.removeMarker(r,Ws),i.addMarker(r,Ks))}})),n.on(["bendpoint.move.out","bendpoint.move.cleanup"],1100,(function(e){var t=e.context,n=t.hover,r=t.target;n&&(i.removeMarker(n,Xs),i.removeMarker(n,r?Ws:Ks))})),n.on("bendpoint.move.move",(function(t){var n=t.context,i=n.allowed,o=n.bendpointIndex,a=n.draggerGfx,s=n.hover,c=n.type,p=n.connection,u=p.source,l=p.target,d=p.waypoints.slice(),h={x:t.x,y:t.y},m=n.hints||{},f={};r&&(m.connectionStart&&(f.connectionStart=m.connectionStart),m.connectionEnd&&(f.connectionEnd=m.connectionEnd),"reconnectStart"===c?Gs(n)?(f.connectionEnd=f.connectionEnd||h,f.source=l,f.target=s||u,d=d.reverse()):(f.connectionStart=f.connectionStart||h,f.source=s||u,f.target=l):"reconnectEnd"===c?Gs(n)?(f.connectionStart=f.connectionStart||h,f.source=s||l,f.target=u,d=d.reverse()):(f.connectionEnd=f.connectionEnd||h,f.source=u,f.target=s||l):(f.noCropping=!0,f.noLayout=!0,d[o]=h),c===Hs&&(d=e.cropWaypoints(p,d)),f.waypoints=d,r.drawPreview(n,i,f)),Yn(a,t.x,t.y)}),this),n.on(["bendpoint.move.end","bendpoint.move.cancel"],1100,(function(e){var t=e.context,n=t.connection,o=t.draggerGfx,a=t.hover,s=t.target,c=t.waypoints;n.waypoints=c,ke(o),i.removeMarker(n,Ys),i.removeMarker(n,Js),a&&(i.removeMarker(a,Ws),i.removeMarker(a,s?Ws:Ks)),r&&r.cleanUp(t)}))}Zs.$inject=["bendpointMove","injector","eventBus","canvas"];var Qs="connect-hover",ec="djs-updating";function tc(e,t,n){return nc(e,t,e[t]+n)}function nc(e,t,n){return{x:"x"===t?n:e.x,y:"y"===t?n:e.y}}function ic(e){return"x"===e?"y":"x"}function rc(e,t,n){var i,r;return e.original?e.original:(i=fn(t),nc(e,r=ic(n),i[r]))}function oc(e,t,n,i,r,o){var a=e.get("connectionDocking",!1);function s(e,t){if(!a)return t;var n,i=e.waypoints;return e.waypoints=t,n=a.getCroppedWaypoints(e),e.waypoints=i,n}function c(e){r.update("connection",e.connection,e.connectionGfx)}function p(e,t,n){var i=e.newWaypoints,r=function(e,t,n,i){var r=Math.max(t[i],n[i]),o=Math.min(t[i],n[i]);return nc(t,i,Math.min(Math.max(o+20,e[i]),r-20))}(n,i[e.segmentStartIndex+t],i[e.segmentEndIndex+t],ic(e.axis));Yn(e.draggerGfx,r.x,r.y)}this.start=function(e,t,r){var o,a,s,c,p=n.getGraphics(t),u=r-1,l=r,d=t.waypoints,h=d[u],m=d[l],f=ks(n,d,e);(a=Ct(h,m))&&(s="v"===a?"x":"y",0===u&&(h=rc(h,t.source,s)),l===d.length-1&&(m=rc(m,t.target,s)),o={connection:t,segmentStartIndex:u,segmentEndIndex:l,segmentStart:h,segmentEnd:m,axis:s,dragPosition:c=f?f.point:{x:(h.x+m.x)/2,y:(h.y+m.y)/2}},i.init(e,c,"connectionSegment.move",{cursor:"x"===s?"resize-ew":"resize-ns",data:{connection:t,connectionGfx:p,context:o}}))},t.on("connectionSegment.move.start",(function(e){var t=e.context,i=e.connection,r=n.getLayer("overlays");t.originalWaypoints=i.waypoints.slice(),t.draggerGfx=Ds(r,t.segmentStart,t.segmentEnd),Ae(t.draggerGfx).add("djs-dragging"),n.addMarker(i,ec)})),t.on("connectionSegment.move.move",(function(e){var t,n,i=e.context,r=i.connection,o=i.segmentStartIndex,a=i.segmentEndIndex,u=i.segmentStart,l=i.segmentEnd,d=i.axis,h=i.originalWaypoints.slice(),m=tc(u,d,e["d"+d]),f=tc(l,d,e["d"+d]),v=h.length,y=0;h[o]=m,h[a]=f,o<2&&(t=vn(r.source,m),1===o?"intersect"===t&&(h.shift(),h[0]=m,y--):"intersect"!==t&&(h.unshift(u),y++)),a>v-3&&(n=vn(r.target,f),a===v-2?"intersect"===n&&(h.pop(),h[h.length-1]=f):"intersect"!==n&&h.push(l)),i.newWaypoints=r.waypoints=s(r,h),p(i,y,e),i.newSegmentStartIndex=o+y,c(e)})),t.on("connectionSegment.move.hover",(function(e){e.context.hover=e.hover,n.addMarker(e.hover,Qs)})),t.on(["connectionSegment.move.out","connectionSegment.move.cleanup"],(function(e){var t=e.context.hover;t&&n.removeMarker(t,Qs)})),t.on("connectionSegment.move.cleanup",(function(e){var t=e.context,i=t.connection;t.draggerGfx&&ke(t.draggerGfx),n.removeMarker(i,ec)})),t.on(["connectionSegment.move.cancel","connectionSegment.move.end"],(function(e){var t=e.context;t.connection.waypoints=t.originalWaypoints,c(e)})),t.on("connectionSegment.move.end",(function(e){var t=e.context,n=t.connection,i=t.newWaypoints,r=t.newSegmentStartIndex,a=function(e,t){var n=0;return{waypoints:e.filter((function(i,r){return!Ot(e[r-1],e[r+1],i)||(n=r<=t?n-1:n,!1)})),segmentOffset:n}}(i=i.map((function(e){return{original:e.original,x:Math.round(e.x),y:Math.round(e.y)}})),r),c=s(n,a.waypoints),p=a.segmentOffset,u={segmentMove:{segmentStartIndex:t.segmentStartIndex,newSegmentStartIndex:r+p}};o.updateWaypoints(n,c,u)}))}oc.$inject=["injector","eventBus","canvas","dragging","graphicsFactory","modeling"];var ac=Math.abs,sc=Math.round;function cc(e){return{x:e.x,y:e.y}}function pc(e){return{x:e.x+e.width,y:e.y+e.height}}function uc(e,t){return!e||isNaN(e.x)||isNaN(e.y)?t:{x:sc(e.x+e.width/2),y:sc(e.y+e.height/2)}}function lc(e,t){var n=e.snapped;return!!n&&("string"==typeof t?n[t]:n.x&&n.y)}function dc(e,t,n){if("string"!=typeof t)throw new Error("axis must be in [x, y]");if("number"!=typeof n&&!1!==n)throw new Error("value must be Number or false");var i,r=e[t],o=e.snapped=e.snapped||{};return!1===n?o[t]=!1:(o[t]=!0,i=n-r,e[t]+=i,e["d"+t]+=i),r}function hc(e){return e.children||[]}var mc=Math.abs,fc=Math.round;function vc(e){function t(e,t){if(h(e)){for(var n=e.length;n--;)if(mc(e[n]-t)<=10)return e[n]}else{var i=t%(e=+e);if(i<10)return t-i;if(i>e-10)return t-i+e}return t}function n(e){if(e.width)return{x:fc(e.width/2+e.x),y:fc(e.height/2+e.y)}}e.on("connectionSegment.move.move",1500,(function(e){var i,r,o=function(e){var t=e.snapPoints,i=e.connection,r=i.waypoints,o=e.segmentStart,a=e.segmentStartIndex,s=e.segmentEnd,c=e.segmentEndIndex,p=e.axis;if(t)return t;var u=[r[a-1],o,s,r[c+1]];return a<2&&u.unshift(n(i.source)),c>r.length-3&&u.unshift(n(i.target)),e.snapPoints=t={horizontal:[],vertical:[]},_(u,(function(e){e&&(e=e.original||e,"y"===p&&t.horizontal.push(e.y),"x"===p&&t.vertical.push(e.x))})),t}(e.context),a=e.x,s=e.y;if(o){var c=a-(i=t(o.vertical,a)),p=s-(r=t(o.horizontal,s));U(e,{dx:e.dx-c,dy:e.dy-p,x:i,y:r}),(c||-1!==o.vertical.indexOf(a))&&dc(e,"x",i),(p||-1!==o.horizontal.indexOf(s))&&dc(e,"y",r)}})),e.on(["bendpoint.move.move","bendpoint.move.end"],1500,(function(e){var i,r,o=e.context,a=function(e){var t=e.snapPoints,n=e.connection.waypoints,i=e.bendpointIndex;if(t)return t;var r=[n[i-1],n[i+1]];return e.snapPoints=t={horizontal:[],vertical:[]},_(r,(function(e){e&&(e=e.original||e,t.horizontal.push(e.y),t.vertical.push(e.x))})),t}(o),s=o.hover,c=s&&n(s),p=e.x,u=e.y;if(a){var l=p-(i=t(c?a.vertical.concat([c.x]):a.vertical,p)),d=u-(r=t(c?a.horizontal.concat([c.y]):a.horizontal,u));U(e,{dx:e.dx-l,dy:e.dy-d,x:e.x-l,y:e.y-d}),(l||-1!==a.vertical.indexOf(p))&&dc(e,"x",i),(d||-1!==a.horizontal.indexOf(u))&&dc(e,"y",r)}}))}vc.$inject=["eventBus"];var yc={__depends__:[xs,Ss],__init__:["bendpoints","bendpointSnapping","bendpointMovePreview"],bendpoints:["type",Fs],bendpointMove:["type",Us],bendpointMovePreview:["type",Zs],connectionSegmentMove:["type",oc],bendpointSnapping:["type",vc]};function gc(e,t,n,i){function r(e,t){return i.allowed("connection.create",{source:e,target:t})}e.on("connect.hover",(function(e){var t,n=e.context,i=n.start,o=e.hover;if(n.hover=o,!d(t=n.canExecute=r(i,o))){if(!1!==t)return n.source=i,void(n.target=o);d(t=n.canExecute=r(o,i))||!1!==t&&(n.source=o,n.target=i)}})),e.on(["connect.out","connect.cleanup"],(function(e){var t=e.context;t.hover=null,t.source=null,t.target=null,t.canExecute=!1})),e.on("connect.end",(function(e){var t=e.context,i=t.canExecute,r=t.connectionStart,o={x:e.x,y:e.y},a=t.source,s=t.target;if(!i)return!1;var c=null,p={connectionStart:bc(t)?o:r,connectionEnd:bc(t)?r:o};m(i)&&(c=i),n.connect(a,s,c,p)})),this.start=function(e,n,i,r){m(i)||(r=i,i=fn(n)),t.init(e,"connect",{autoActivate:r,data:{shape:n,context:{start:n,connectionStart:i}}})}}function bc(e){var t=e.hover,n=e.source,i=e.target;return t&&n&&t===n&&n!==i}gc.$inject=["eventBus","dragging","modeling","rules"];var xc="connect-ok",Ec="connect-not-ok";function wc(e,t,n){var i=e.get("connectionPreview",!1);i&&t.on("connect.move",(function(e){var t=e.context,n=t.canExecute,r=t.hover,o=t.source,a=t.start,s=t.startPosition,c=t.target,p=t.connectionStart||s,u=t.connectionEnd||{x:e.x,y:e.y},l=p,d=u;bc(t)&&(l=u,d=p),i.drawPreview(t,n,{source:o||a,target:c||r,connectionStart:l,connectionEnd:d})})),t.on("connect.hover",900,(function(e){var t=e.context,i=e.hover,r=t.canExecute;null!==r&&n.addMarker(i,r?xc:Ec)})),t.on(["connect.out","connect.cleanup"],1100,(function(e){var t=e.hover;t&&(n.removeMarker(t,xc),n.removeMarker(t,Ec))})),i&&t.on("connect.cleanup",(function(e){i.cleanUp(e.context)}))}wc.$inject=["injector","eventBus","canvas"];var _c={__depends__:[Ho,Ss,xs],__init__:["connectPreview"],connect:["type",gc],connectPreview:["type",wc]};function Pc(e,t,n,i){this._canvas=t,this._graphicsFactory=n,this._elementFactory=i,this._connectionDocking=e.get("connectionDocking",!1),this._layouter=e.get("layouter",!1)}Pc.$inject=["injector","canvas","graphicsFactory","elementFactory"],Pc.prototype.drawPreview=function(e,t,n){n=n||{};var i,r,o,a=e.connectionPreviewGfx,s=e.getConnection,c=n.source,p=n.target,u=n.waypoints,l=n.connectionStart,d=n.connectionEnd,h=n.noLayout,m=n.noCropping,f=n.noNoop,v=this;a||(a=e.connectionPreviewGfx=this.createConnectionPreviewGfx()),je(a),s||(s=e.getConnection=(r=function(e,t,n){return v.getConnection(e,t,n)},o={},function(e){var t=JSON.stringify(e),n=o[t];return n||(n=o[t]=r.apply(null,arguments)),n})),t&&(i=s(t,c,p)),i?(i.waypoints=u||[],this._layouter&&!h&&(i.waypoints=this._layouter.layoutConnection(i,{source:c,target:p,connectionStart:l,connectionEnd:d,waypoints:n.waypoints||i.waypoints})),i.waypoints&&i.waypoints.length||(i.waypoints=[c?fn(c):l,p?fn(p):d]),this._connectionDocking&&(c||p)&&!m&&(i.waypoints=this._connectionDocking.getCroppedWaypoints(i,c,p)),this._graphicsFactory.drawConnection(a,i)):!f&&this.drawNoopPreview(a,n)},Pc.prototype.drawNoopPreview=function(e,t){var n=t.source,i=t.target,r=t.connectionStart||fn(n),o=t.connectionEnd||fn(i),a=this.cropWaypoints(r,o,n,i);Ee(e,this.createNoopConnection(a[0],a[1]))},Pc.prototype.cropWaypoints=function(e,t,n,i){var r=this._graphicsFactory,o=n&&r.getShapePath(n),a=i&&r.getShapePath(i),s=r.getConnectionPath({waypoints:[e,t]});return[e=n&&yn(o,s,!0)||e,t=i&&yn(a,s,!1)||t]},Pc.prototype.cleanUp=function(e){e&&e.connectionPreviewGfx&&ke(e.connectionPreviewGfx)},Pc.prototype.getConnection=function(e){var t=function(e){return m(e)?e:{}}(e);return this._elementFactory.createConnection(t)},Pc.prototype.createConnectionPreviewGfx=function(){var e=Ne("g");return Pe(e,{pointerEvents:"none"}),Ae(e).add("djs-connection-preview"),Ee(this._canvas.getActiveLayer(),e),e},Pc.prototype.createNoopConnection=function(e,t){var n=Ne("polyline");return Pe(n,{stroke:"#333",strokeDasharray:[1],strokeWidth:2,"pointer-events":"none"}),Pe(n,{points:[e.x,e.y,t.x,t.y]}),n};var Sc={__init__:["connectionPreview"],connectionPreview:["type",Pc]},Oc=Math.min,Cc=Math.max;function Tc(e){e.preventDefault()}function Ac(e){e.stopPropagation()}function Rc(e){this.container=e.container,this.parent=he('<div class="djs-direct-editing-parent"><div class="djs-direct-editing-content" contenteditable="true"></div></div>'),this.content=ve("[contenteditable]",this.parent),this.keyHandler=e.keyHandler||function(){},this.resizeHandler=e.resizeHandler||function(){},this.autoResize=z(this.autoResize,this),this.handlePaste=z(this.handlePaste,this)}function kc(e,t){this._eventBus=e,this._providers=[],this._textbox=new Rc({container:t.getContainer(),keyHandler:z(this._handleKey,this),resizeHandler:z(this._handleResize,this)})}Rc.prototype.create=function(e,t,n,i){var r=this.parent,o=this.content,a=this.container;i=this.options=i||{};var s=G(t=this.style=t||{},["width","height","maxWidth","maxHeight","minWidth","minHeight","left","top","backgroundColor","position","overflow","border","wordWrap","textAlign","outline","transform"]);U(r.style,{width:e.width+"px",height:e.height+"px",maxWidth:e.maxWidth+"px",maxHeight:e.maxHeight+"px",minWidth:e.minWidth+"px",minHeight:e.minHeight+"px",left:e.x+"px",top:e.y+"px",backgroundColor:"#ffffff",position:"absolute",overflow:"visible",border:"1px solid #ccc",boxSizing:"border-box",wordWrap:"normal",textAlign:"center",outline:"none"},s);var c=G(t,["fontFamily","fontSize","fontWeight","lineHeight","padding","paddingTop","paddingRight","paddingBottom","paddingLeft"]);return U(o.style,{boxSizing:"border-box",width:"100%",outline:"none",wordWrap:"break-word"},c),i.centerVertically&&U(o.style,{position:"absolute",top:"50%",transform:"translate(0, -50%)"},c),o.innerText=n,pe.bind(o,"keydown",this.keyHandler),pe.bind(o,"mousedown",Ac),pe.bind(o,"paste",this.handlePaste),i.autoResize&&pe.bind(o,"input",this.autoResize),i.resizable&&this.resizable(t),a.appendChild(r),this.setSelection(o.lastChild,o.lastChild&&o.lastChild.length),r},Rc.prototype.handlePaste=function(e){var t,n=this.options,i=this.style;if(e.preventDefault(),t=e.clipboardData?e.clipboardData.getData("text/plain"):window.clipboardData.getData("Text"),this.insertText(t),n.autoResize){var r=this.autoResize(i);r&&this.resizeHandler(r)}},Rc.prototype.insertText=function(e){e=e.replace(/\r\n|\r|\n/g,"\n"),document.execCommand("insertText",!1,e)||this._insertTextIE(e)},Rc.prototype._insertTextIE=function(e){var t,n,i,r=this.getSelection(),o=r.startContainer,a=r.endContainer,s=r.startOffset,c=r.endOffset,p=r.commonAncestorContainer,u=(t=p.childNodes,[].slice.call(t));if(function(e){return e.nodeType===Node.TEXT_NODE}(p)){var l=o.textContent;o.textContent=l.substring(0,s)+e+l.substring(c),n=o,i=s+e.length}else if(o===this.content&&a===this.content){var d=document.createTextNode(e);this.content.insertBefore(d,u[s]),n=d,i=d.textContent.length}else{var h=u.indexOf(o),m=u.indexOf(a);u.forEach((function(t,n){n===h?t.textContent=o.textContent.substring(0,s)+e+a.textContent.substring(c):n>h&&n<=m&&ge(t)})),n=o,i=s+e.length}n&&void 0!==i&&setTimeout((function(){self.setSelection(n,i)}))},Rc.prototype.autoResize=function(){var e=this.parent,t=this.content,n=parseInt(this.style.fontSize)||12;if(t.scrollHeight>e.offsetHeight||t.scrollHeight<e.offsetHeight-n){var i=e.getBoundingClientRect(),r=t.scrollHeight;e.style.height=r+"px",this.resizeHandler({width:i.width,height:i.height,dx:0,dy:r-i.height})}},Rc.prototype.resizable=function(){var e=this,t=this.parent,n=this.resizeHandle,i=parseInt(this.style.minWidth)||0,r=parseInt(this.style.minHeight)||0,o=parseInt(this.style.maxWidth)||1/0,a=parseInt(this.style.maxHeight)||1/0;if(!n){var s,c,p,u;n=this.resizeHandle=he('<div class="djs-direct-editing-resize-handle"></div>');var l=function(n){Tc(n),Ac(n);var l=Oc(Cc(p+n.clientX-s,i),o),d=Oc(Cc(u+n.clientY-c,r),a);t.style.width=l+"px",t.style.height=d+"px",e.resizeHandler({width:p,height:u,dx:n.clientX-s,dy:n.clientY-c})},d=function(e){Tc(e),Ac(e),pe.unbind(document,"mousemove",l,!1),pe.unbind(document,"mouseup",d,!1)};pe.bind(n,"mousedown",(function(e){Tc(e),Ac(e),s=e.clientX,c=e.clientY;var n=t.getBoundingClientRect();p=n.width,u=n.height,pe.bind(document,"mousemove",l),pe.bind(document,"mouseup",d)}))}U(n.style,{position:"absolute",bottom:"0px",right:"0px",cursor:"nwse-resize",width:"0",height:"0",borderTop:(parseInt(this.style.fontSize)/4||3)+"px solid transparent",borderRight:(parseInt(this.style.fontSize)/4||3)+"px solid #ccc",borderBottom:(parseInt(this.style.fontSize)/4||3)+"px solid #ccc",borderLeft:(parseInt(this.style.fontSize)/4||3)+"px solid transparent"}),t.appendChild(n)},Rc.prototype.destroy=function(){var e=this.parent,t=this.content,n=this.resizeHandle;t.innerText="",e.removeAttribute("style"),t.removeAttribute("style"),pe.unbind(t,"keydown",this.keyHandler),pe.unbind(t,"mousedown",Ac),pe.unbind(t,"input",this.autoResize),pe.unbind(t,"paste",this.handlePaste),n&&(n.removeAttribute("style"),ge(n)),ge(e)},Rc.prototype.getValue=function(){return this.content.innerText.trim()},Rc.prototype.getSelection=function(){return window.getSelection().getRangeAt(0)},Rc.prototype.setSelection=function(e,t){var n=document.createRange();null===e?n.selectNodeContents(this.content):(n.setStart(e,t),n.setEnd(e,t));var i=window.getSelection();i.removeAllRanges(),i.addRange(n)},kc.$inject=["eventBus","canvas"],kc.prototype.registerProvider=function(e){this._providers.push(e)},kc.prototype.isActive=function(){return!!this._active},kc.prototype.cancel=function(){this._active&&(this._fire("cancel"),this.close())},kc.prototype._fire=function(e,t){this._eventBus.fire("directEditing."+e,t||{active:this._active})},kc.prototype.close=function(){this._textbox.destroy(),this._fire("deactivate"),this._active=null,this.resizable=void 0},kc.prototype.complete=function(){var e=this._active;if(e){var t,n=e.context.bounds,i=this.$textbox.getBoundingClientRect(),r=this.getValue();r===e.context.text&&i.height===n.height&&i.width===n.width||(t=this._textbox.container.getBoundingClientRect(),e.provider.update(e.element,r,e.context.text,{x:i.left-t.left,y:i.top-t.top,width:i.width,height:i.height})),this._fire("complete"),this.close()}},kc.prototype.getValue=function(){return this._textbox.getValue()},kc.prototype._handleKey=function(e){e.stopPropagation();var t=e.keyCode||e.charCode;return 27===t?(e.preventDefault(),this.cancel()):13!==t||e.shiftKey?void 0:(e.preventDefault(),this.complete())},kc.prototype._handleResize=function(e){this._fire("resize",e)},kc.prototype.activate=function(e){var t;this.isActive()&&this.cancel();var n=x(this._providers,(function(n){return(t=n.activate(e))?n:null}));return t&&(this.$textbox=this._textbox.create(t.bounds,t.style,t.text,t.options),this._active={element:e,context:t,provider:n},t.options&&t.options.resizable&&(this.resizable=!0),this._fire("activate")),!!t};var jc={__depends__:[No],__init__:["directEditing"],directEditing:["type",kc]},Mc=".entry";function Dc(e,t,n){this._eventBus=t,this._overlays=n;var i=l(e&&e.scale)?e.scale:{min:1,max:1.5};this._overlaysConfig={position:{right:-9,top:-6},scale:i},this._current=null,this._init()}Dc.$inject=["config.contextPad","eventBus","overlays"],Dc.prototype._init=function(){var e=this._eventBus,t=this;e.on("selection.changed",(function(e){var n=e.newSelection;1===n.length?t.open(n[0]):t.close()})),e.on("elements.delete",(function(e){_(e.elements,(function(e){t.isOpen(e)&&t.close()}))})),e.on("element.changed",(function(e){var n=e.element,i=t._current;i&&i.element===n&&t.open(n,!0)}))},Dc.prototype.registerProvider=function(e,t){t||(t=e,e=1e3),this._eventBus.on("contextPad.getProviders",e,(function(e){e.providers.push(t)}))},Dc.prototype.getEntries=function(e){var t=this._getProviders(),n={};return _(t,(function(t){var i=t.getContextPadEntries(e);v(i)?n=i(n):_(i,(function(e,t){n[t]=e}))})),n},Dc.prototype.trigger=function(e,t,n){var i,r,o=this._current.element,a=this._current.entries,s=t.delegateTarget||t.target;if(!s)return t.preventDefault();if(i=a[K(s,"data-action")].action,r=t.originalEvent||t,v(i)){if("click"===e)return i(r,o,n)}else if(i[e])return i[e](r,o,n);t.preventDefault()},Dc.prototype.open=function(e,t){!t&&this.isOpen(e)||(this.close(),this._updateAndOpen(e))},Dc.prototype._getProviders=function(){var e=this._eventBus.createEvent({type:"contextPad.getProviders",providers:[]});return this._eventBus.fire(e),e.providers},Dc.prototype._updateAndOpen=function(e){var t=this.getEntries(e),n=this.getPad(e),i=n.html;_(t,(function(e,t){var n,r=e.group||"default",o=he(e.html||'<div class="entry" draggable="true"></div>');K(o,"data-action",t),(n=ve("[data-group="+r+"]",i))||(n=he('<div class="group" data-group="'+r+'"></div>'),i.appendChild(n)),n.appendChild(o),e.className&&function(e,t){var n=Q(e);(h(t)?t:t.split(/\s+/g)).forEach((function(e){n.add(e)}))}(o,e.className),e.title&&K(o,"title",e.title),e.imageUrl&&o.appendChild(he('<img src="'+e.imageUrl+'">'))})),Q(i).add("open"),this._current={element:e,pad:n,entries:t},this._eventBus.fire("contextPad.open",{current:this._current})},Dc.prototype.getPad=function(e){if(this.isOpen())return this._current.pad;var t=this,n=this._overlays,i=he('<div class="djs-context-pad"></div>'),r=U({html:i},this._overlaysConfig);de.bind(i,Mc,"click",(function(e){t.trigger("click",e)})),de.bind(i,Mc,"dragstart",(function(e){t.trigger("dragstart",e)})),pe.bind(i,"mousedown",(function(e){e.stopPropagation()})),this._overlayId=n.add(e,"context-pad",r);var o=n.get(this._overlayId);return this._eventBus.fire("contextPad.create",{element:e,pad:o}),o},Dc.prototype.close=function(){this.isOpen()&&(this._overlays.remove(this._overlayId),this._overlayId=null,this._eventBus.fire("contextPad.close",{current:this._current}),this._current=null)},Dc.prototype.isOpen=function(e){return!(!this._current||e&&this._current.element!==e)};var Bc={__depends__:[No,Qo],contextPad:["type",Dc]},Ic=["marker-start","marker-mid","marker-end"],Nc=["circle","ellipse","line","path","polygon","polyline","rect"];function Lc(e,t,n,i){this._elementRegistry=e,this._canvas=n,this._styles=i,this._clonedMarkers={};var r=this;t.on("drag.cleanup",(function(){_(r._clonedMarkers,(function(e){ke(e)})),r._clonedMarkers={}}))}Lc.$inject=["elementRegistry","eventBus","canvas","styles"],Lc.prototype.getGfx=function(e){return this._elementRegistry.getGraphics(e)},Lc.prototype.addDragger=function(e,t,n){var i=Me(n=n||this.getGfx(e)),r=n.getBoundingClientRect();return this._cloneMarkers(Kn(i)),Pe(i,this._styles.cls("djs-dragger",[],{x:r.top,y:r.left})),Ee(t,i),i},Lc.prototype.addFrame=function(e,t){var n=Ne("rect",{class:"djs-resize-overlay",width:e.width,height:e.height,x:e.x,y:e.y});return Ee(t,n),n},Lc.prototype._cloneMarkers=function(e){var t=this;if(e.childNodes)for(var n=0;n<e.childNodes.length;n++)t._cloneMarkers(e.childNodes[n]);(function(e){return-1!==Nc.indexOf(e.nodeName)})(e)&&Ic.forEach((function(n){if(Pe(e,n)){var i=function(e,t,n){return ve("marker#"+(i=Pe(e,t),i.match(/url\(['"]?#([^'"]*)['"]?\)/)[1]),n||document);var i}(e,n,t._canvas.getContainer());t._cloneMarker(e,i,n)}}))},Lc.prototype._cloneMarker=function(e,t,n){var i=t.id,r=this._clonedMarkers[i];if(!r){var o=i+"-clone";(r=Me(t)).id=o,Ae(r).add("djs-dragger").add("djs-dragger-marker"),this._clonedMarkers[i]=r;var a=ve("defs",this._canvas._svg);a||(a=Ne("defs"),Ee(this._canvas._svg,a)),Ee(a,r)}Pe(e,n,"url(#"+this._clonedMarkers[i].id+")")};var Fc={__init__:["previewSupport"],previewSupport:["type",Lc]},Vc="drop-ok",$c="drop-not-ok",zc="attach-ok",qc="new-parent",Uc="create";function Gc(e,t,n,i,r){function o(t,n){[zc,Vc,$c,qc].forEach((function(i){i===n?e.addMarker(t,i):e.removeMarker(t,i)}))}function a(){var e=t.context();e&&e.prefix===Uc&&t.cancel()}n.on(["create.move","create.hover"],(function(e){var t=e.context,n=t.elements,i=e.hover,a=t.source,s=t.hints||{};if(!i)return t.canExecute=!1,void(t.target=null);Hc(e);var c={x:e.x,y:e.y},p=t.canExecute=i&&function(e,t,n,i,o){if(!t)return!1;var a=x(e=w(e,(function(t){var n=t.labelTarget;return!(t.parent||function(e){return!!e.labelTarget}(t)&&-1!==e.indexOf(n))})),(function(e){return!Wc(e)})),s=!1,c=!1,p=!1;Kc(e)&&(s=r.allowed("shape.attach",{position:n,shape:a,target:t})),s||(p=Kc(e)?r.allowed("shape.create",{position:n,shape:a,source:i,target:t}):r.allowed("elements.create",{elements:e,position:n,target:t}));var u=o.connectionTarget;return p||s?(a&&i&&(c=r.allowed("connection.create",{source:u===i?a:i,target:u===i?i:a,hints:{targetParent:t,targetAttach:s}})),{attach:s,connect:c}):(null===p||null===s)&&null}(n,i,c,a,s);i&&null!==p&&(t.target=i,p&&p.attach?o(i,zc):o(i,p?qc:$c))})),n.on(["create.end","create.out","create.cleanup"],(function(e){var t=e.hover;t&&o(t,null)})),n.on("create.end",(function(e){var t=e.context,n=t.source,r=t.shape,o=t.elements,a=t.target,s=t.canExecute,c=s&&s.attach,p=s&&s.connect,u=t.hints||{};if(!1===s||!a)return!1;Hc(e);var l={x:e.x,y:e.y};r=p?i.appendShape(n,r,l,a,{attach:c,connection:!0===p?{}:p,connectionTarget:u.connectionTarget}):x(o=i.createElements(o,l,a,U({},u,{attach:c})),(function(e){return!Wc(e)})),U(t,{elements:o,shape:r}),U(e,{elements:o,shape:r})})),n.on("create.init",(function(){n.on("elements.changed",a),n.once(["create.cancel","create.end"],2e3,(function(){n.off("elements.changed",a)}))})),this.start=function(e,n,i){h(n)||(n=[n]);var r=x(n,(function(e){return!Wc(e)}));if(r){i=U({elements:n,hints:{},shape:r},i||{}),_(n,(function(e){f(e.x)||(e.x=0),f(e.y)||(e.y=0)}));var o=ft(n);_(n,(function(e){Wc(e)&&(e.waypoints=T(e.waypoints,(function(e){return{x:e.x-o.x-o.width/2,y:e.y-o.y-o.height/2}}))),U(e,{x:e.x-o.x-o.width/2,y:e.y-o.y-o.height/2})})),t.init(e,Uc,{cursor:"grabbing",autoActivate:!0,data:{shape:r,elements:n,context:i}})}}}function Hc(e){var t=e.context.createConstraints;t&&(t.left&&(e.x=Math.max(e.x,t.left)),t.right&&(e.x=Math.min(e.x,t.right)),t.top&&(e.y=Math.max(e.y,t.top)),t.bottom&&(e.y=Math.min(e.y,t.bottom)))}function Wc(e){return!!e.waypoints}function Kc(e){return e&&1===e.length&&!Wc(e[0])}Gc.$inject=["canvas","dragging","eventBus","modeling","rules"];function Xc(e,t,n,i,r){t.on("create.move",750,(function(t){var o=t.hover,a=t.context,s=a.elements,c=a.dragGroup;c||(c=a.dragGroup=function(e){var t=Ne("g");Pe(t,r.cls("djs-drag-group",["no-events"]));var o=Ne("g");return e.forEach((function(e){var r;e.hidden||(e.waypoints?(r=n._createContainer("connection",o),n.drawConnection(Kn(r),e)):(r=n._createContainer("shape",o),n.drawShape(Kn(r),e),Yn(r,e.x,e.y)),i.addDragger(e,t,r))})),t}(s)),o?(c.parentNode||Ee(e.getActiveLayer(),c),Yn(c,t.x,t.y)):ke(c)})),t.on("create.cleanup",(function(e){var t=e.context.dragGroup;t&&ke(t)}))}Xc.$inject=["canvas","eventBus","graphicsFactory","previewSupport","styles"];var Yc={__depends__:[xs,Fc,Ss,Ho],__init__:["create","createPreview"],create:["type",Gc],createPreview:["type",Xc]},Jc="data-id",Zc=["contextPad.close","canvas.viewbox.changing","commandStack.changed"];function Qc(e,t,n){var i=l(e&&e.scale)?e.scale:{min:1,max:1.5};this._config={scale:i},this._eventBus=t,this._canvas=n,this._providers={},this._current={}}Qc.$inject=["config.popupMenu","eventBus","canvas"],Qc.prototype.registerProvider=function(e,t,n){n||(n=t,t=1e3),this._eventBus.on("popupMenu.getProviders."+e,t,(function(e){e.providers.push(n)}))},Qc.prototype.isEmpty=function(e,t){if(!e)throw new Error("element parameter is missing");if(!t)throw new Error("providerId parameter is missing");var n=this._getProviders(t);if(!n)return!0;var i=this._getEntries(e,n),r=this._getHeaderEntries(e,n),o=R(i)>0,a=r&&R(r)>0;return!o&&!a},Qc.prototype.open=function(e,t,n){var i=this._getProviders(t);if(!e)throw new Error("Element is missing");if(!i||!i.length)throw new Error("No registered providers for: "+t);if(!n)throw new Error("the position argument is missing");this.isOpen()&&this.close(),this._emit("open");var r=this._current={className:t,element:e,position:n},o=this._getEntries(e,i),a=this._getHeaderEntries(e,i);r.entries=U({},o,a),r.container=this._createContainer(),R(a)&&r.container.appendChild(this._createEntries(a,"djs-popup-header")),R(o)&&r.container.appendChild(this._createEntries(o,"djs-popup-body"));var s=this._canvas.getContainer();this._attachContainer(r.container,s,n.cursor),this._bindAutoClose()},Qc.prototype.close=function(){this.isOpen()&&(this._emit("close"),this._unbindAutoClose(),ge(this._current.container),this._current.container=null)},Qc.prototype.isOpen=function(){return!!this._current.container},Qc.prototype.trigger=function(e){e.preventDefault();var t=K(e.delegateTarget||e.target,Jc),n=this._getEntry(t);if(n.action)return n.action.call(null,e,n)},Qc.prototype._getProviders=function(e){var t=this._eventBus.createEvent({type:"popupMenu.getProviders."+e,providers:[]});return this._eventBus.fire(t),t.providers},Qc.prototype._getEntries=function(e,t){var n={};return _(t,(function(t){if(t.getPopupMenuEntries){var i=t.getPopupMenuEntries(e);v(i)?n=i(n):_(i,(function(e,t){n[t]=e}))}else _(t.getEntries(e),(function(e){var t=e.id;if(!t)throw new Error("every entry must have the id property set");n[t]=H(e,["id"])}))})),n},Qc.prototype._getHeaderEntries=function(e,t){var n={};return _(t,(function(t){if(t.getPopupMenuHeaderEntries){var i=t.getPopupMenuHeaderEntries(e);v(i)?n=i(n):_(i,(function(e,t){n[t]=e}))}else{if(!t.getHeaderEntries)return;_(t.getHeaderEntries(e),(function(e){var t=e.id;if(!t)throw new Error("every entry must have the id property set");n[t]=H(e,["id"])}))}})),n},Qc.prototype._getEntry=function(e){var t=this._current.entries[e];if(!t)throw new Error("entry not found");return t},Qc.prototype._emit=function(e){this._eventBus.fire("popupMenu."+e)},Qc.prototype._createContainer=function(){var e=he('<div class="djs-popup">'),t=this._current.position,n=this._current.className;return U(e.style,{position:"absolute",left:t.x+"px",top:t.y+"px",visibility:"hidden"}),Q(e).add(n),e},Qc.prototype._attachContainer=function(e,t,n){var i=this;de.bind(e,".entry","click",(function(e){i.trigger(e)})),this._updateScale(e),t.appendChild(e),n&&this._assureIsInbounds(e,n)},Qc.prototype._updateScale=function(e){var t,n,i=this._canvas.zoom(),r=this._config.scale,o=i;!0!==r&&(!1===r?(t=1,n=1):(t=r.min,n=r.max),l(t)&&i<t&&(o=t),l(n)&&i>n&&(o=n)),function(e,t){e.style["transform-origin"]="top left",["","-ms-","-webkit-"].forEach((function(n){e.style[n+"transform"]=t}))}(e,"scale("+o+")")},Qc.prototype._assureIsInbounds=function(e,t){var n,i,r=this._canvas._container.getBoundingClientRect(),o=e.offsetLeft,a=e.offsetTop,s=e.scrollWidth,c=e.scrollHeight,p={},u=t.x-r.left,l=t.y-r.top;o+s>r.width&&(p.x=!0),a+c>r.height&&(p.y=!0),p.x&&p.y?(n=u-s+"px",i=l-c+"px"):p.x?(n=u-s+"px",i=l+"px"):p.y&&l<c?(n=u+"px",i="10px"):p.y&&(n=u+"px",i=l-c+"px"),U(e.style,{left:n,top:i},{visibility:"visible","z-index":1e3})},Qc.prototype._createEntries=function(e,t){var n=he("<div>"),i=this;return Q(n).add(t),_(e,(function(e,t){var r=i._createEntry(e,t);n.appendChild(r)})),n},Qc.prototype._createEntry=function(e,t){var n=he("<div>"),i=Q(n);if(i.add("entry"),e.className&&e.className.split(" ").forEach((function(e){i.add(e)})),K(n,Jc,t),e.label){var r=he("<span>");r.textContent=e.label,n.appendChild(r)}return e.imageUrl&&n.appendChild(he('<img src="'+e.imageUrl+'" />')),!0===e.active&&i.add("active"),!0===e.disabled&&i.add("disabled"),e.title&&(n.title=e.title),n},Qc.prototype._bindAutoClose=function(){this._eventBus.once(Zc,this.close,this)},Qc.prototype._unbindAutoClose=function(){this._eventBus.off(Zc,this.close,this)};var ep={__init__:["popupMenu"],popupMenu:["type",Qc]};function tp(){}tp.prototype.get=function(){return this._data},tp.prototype.set=function(e){this._data=e},tp.prototype.clear=function(){var e=this._data;return delete this._data,e},tp.prototype.isEmpty=function(){return!this._data};var np={clipboard:["type",tp]};function ip(e){var t=this;function n(e){t._lastMoveEvent=e}this._lastMoveEvent=null,e.on("canvas.init",(function(e){(t._svg=e.svg).addEventListener("mousemove",n)})),e.on("canvas.destroy",(function(){t._lastMouseEvent=null,t._svg.removeEventListener("mousemove",n)}))}ip.$inject=["eventBus"],ip.prototype.getLastMoveEvent=function(){return this._lastMoveEvent||function(e,t){var n=document.createEvent("MouseEvent"),i=e,r=t,o=e,a=t;n.initMouseEvent&&n.initMouseEvent("mousemove",!0,!0,window,0,i,r,o,a,!1,!1,!1,!1,0,null);return n}(0,0)};var rp={__init__:["mouse"],mouse:["type",ip]};function op(e,t,n,i,r,o,a,s){this._canvas=e,this._create=t,this._clipboard=n,this._elementFactory=i,this._eventBus=r,this._modeling=o,this._mouse=a,this._rules=s,r.on("copyPaste.copyElement",(function(e){var t=e.descriptor,n=e.element,i=e.elements;t.priority=1,t.id=n.id,x(i,(function(e){return e===n.parent}))&&(t.parent=n.parent.id),function(e){return!!e.host}(n)&&(t.priority=2,t.host=n.host.id),ap(n)&&(t.priority=3,t.source=n.source.id,t.target=n.target.id,t.waypoints=function(e){return T(e.waypoints,(function(e){return(e=cp(e)).original&&(e.original=cp(e.original)),e}))}(n)),sp(n)&&(t.priority=4,t.labelTarget=n.labelTarget.id),_(["x","y","width","height"],(function(e){f(n[e])&&(t[e]=n[e])})),t.hidden=n.hidden,t.collapsed=n.collapsed})),r.on("copyPaste.pasteElements",(function(e){U(e.hints,{createElementsBehavior:!1})}))}function ap(e){return!!e.waypoints}function sp(e){return!!e.labelTarget}function cp(e){return U({},e)}function pp(e,t){var n=t.indexOf(e);return-1===n?t:t.splice(n,1)}op.$inject=["canvas","create","clipboard","elementFactory","eventBus","modeling","mouse","rules"],op.prototype.copy=function(e){var t,n;return h(e)||(e=e?[e]:[]),n=!1===(t=this._eventBus.fire("copyPaste.canCopyElements",{elements:e}))?{}:this.createTree(h(t)?t:e),this._clipboard.set(n),this._eventBus.fire("copyPaste.elementsCopied",{elements:e,tree:n}),n},op.prototype.paste=function(e){var t=this._clipboard.get();if(!this._clipboard.isEmpty()){var n=e&&e.hints||{};this._eventBus.fire("copyPaste.pasteElements",{hints:n});var i=this._createElements(t);if(e&&e.element&&e.point)return this._paste(i,e.element,e.point,n);this._create.start(this._mouse.getLastMoveEvent(),i,{hints:n||{}})}},op.prototype._paste=function(e,t,n,i){_(e,(function(e){f(e.x)||(e.x=0),f(e.y)||(e.y=0)}));var r=ft(e);return _(e,(function(e){ap(e)&&(e.waypoints=T(e.waypoints,(function(e){return{x:e.x-r.x-r.width/2,y:e.y-r.y-r.height/2}}))),U(e,{x:e.x-r.x-r.width/2,y:e.y-r.y-r.height/2})})),this._modeling.createElements(e,n,t,U({},i))},op.prototype._createElements=function(e){var t=this,n=this._eventBus,i={},r=[];return _(e,(function(e,o){_(e=B(e,"priority"),(function(e){var o,a=U({},H(e,["priority"]));return i[e.parent]?a.parent=i[e.parent]:delete a.parent,n.fire("copyPaste.pasteElement",{cache:i,descriptor:a}),ap(a)?(a.source=i[e.source],a.target=i[e.target],o=i[e.id]=t.createConnection(a),void r.push(o)):sp(a)?(a.labelTarget=i[a.labelTarget],o=i[e.id]=t.createLabel(a),void r.push(o)):(a.host&&(a.host=i[a.host]),o=i[e.id]=t.createShape(a),void r.push(o))}))})),r},op.prototype.createConnection=function(e){return this._elementFactory.createConnection(H(e,["id"]))},op.prototype.createLabel=function(e){return this._elementFactory.createLabel(H(e,["id"]))},op.prototype.createShape=function(e){return this._elementFactory.createShape(H(e,["id"]))},op.prototype.hasRelations=function(e,t){var n,i;return!(ap(e)&&(n=x(t,I({id:e.source.id})),i=x(t,I({id:e.target.id})),!n||!i))&&!(sp(e)&&!x(t,I({id:e.labelTarget.id})))},op.prototype.createTree=function(e){var t=this._rules,n=this,i={},r=[];function o(e,t){var n=x(r,(function(t){return e===t.element}));n?n.depth<t&&(r=function(e,t){var n=t.indexOf(e);-1!==n&&t.splice(n,1);return t}(n,r)).push({element:n.element,depth:t}):r.push({element:e,depth:t})}return ht(ut(e),(function(e,t,n){if(!sp(e))return _(e.labels,(function(e){o(e,n)})),_([e.attachers,e.incoming,e.outgoing],(function(e){e&&e.length&&_(e,(function(e){_(e.labels,(function(e){o(e,n)})),o(e,n)}))})),o(e,n),e.children})),e=T(r,(function(e){return e.element})),r=B(r=T(r,(function(t){return t.descriptor={},n._eventBus.fire("copyPaste.copyElement",{descriptor:t.descriptor,element:t.element,elements:e}),t})),(function(e){return e.descriptor.priority})),e=T(r,(function(e){return e.element})),_(r,(function(r){var o=r.depth;n.hasRelations(r.element,e)?!function(e,n){return t.allowed("element.copy",{element:e,elements:n})}(r.element,e)?pp(r.element,e):(i[o]||(i[o]=[]),i[o].push(r.descriptor)):pp(r.element,e)})),i};var up={__depends__:[np,Yc,rp,Ss],__init__:["copyPaste"],copyPaste:["type",op]};function lp(e,t,n){h(n)||(n=[n]),_(n,(function(n){u(e[n])||(t[n]=e[n])}))}function dp(e,t,n){var i;t.on("copyPaste.copyElement",750,(function(e){var t=e.descriptor,n=e.element,i=t.oldBusinessObject=Br(n);if(t.type=n.type,lp(i,t,"name"),t.di={},lp(i.di,t.di,["fill","stroke","background-color","border-color","color"]),lp(i.di,t,"isExpanded"),hp(t))return t;i.default&&(t.default=i.default.id)})),t.on("moddleCopy.canCopyProperty",(function(t){var i,r=t.parent,o=t.property;if("processRef"===t.propertyName&&Dr(r,"bpmn:Participant")&&Dr(o,"bpmn:Process"))return i=e.create("bpmn:Process"),n.copyElement(o,i)})),t.on("copyPaste.pasteElements",(function(){i={}})),t.on("copyPaste.pasteElement",(function(t){var r,o=t.cache,a=t.descriptor,s=a.oldBusinessObject;hp(a)?a.businessObject=Br(o[a.labelTarget]):(r=e.create(s.$type),a.businessObject=n.copyElement(s,r),function(e,t){var n=Br(e);e.default&&(i[e.default]={element:n,property:"default"}),e.host&&(Br(e).attachedToRef=Br(t[e.host])),i=H(i,S(i,(function(t,i,r){var o=i.element,a=i.property;return r===e.id&&(o[a]=n,t.push(e.id)),t}),[]))}(a,o),lp(a,r,["isExpanded","name"]),function(e,t){h(t)||(t=[t]),_(t,(function(t){e[t]&&delete e[t]}))}(a,"oldBusinessObject"))}))}function hp(e){return!!e.labelTarget}dp.$inject=["bpmnFactory","eventBus","moddleCopy"];var mp=["artifacts","dataInputAssociations","dataOutputAssociations","default","flowElements","lanes","incoming","outgoing"];function fp(e,t,n){this._bpmnFactory=t,this._eventBus=e,this._moddle=n,e.on("moddleCopy.canCopyProperties",(function(e){var t=e.propertyNames;if(t&&t.length)return B(t,(function(e){return"extensionElements"===e}))})),e.on("moddleCopy.canCopyProperty",(function(e){var t=e.parent,n=m(t)&&t.$descriptor,i=e.propertyName;return(!i||-1===mp.indexOf(i))&&(!(i&&n&&!x(n.properties,I({name:i})))&&void 0)})),e.on("moddleCopy.canSetCopiedProperty",(function(e){var t,n,i=e.property;if(n="bpmn:ExtensionElements",(t=i)&&"function"==typeof t.$instanceOf&&t.$instanceOf(n)&&(!i.values||!i.values.length))return!1}))}function vp(e,t){return S(e.properties,(function(e,n){return t&&n.default?e:e.concat(n.name)}),[])}fp.$inject=["eventBus","bpmnFactory","moddle"],fp.prototype.copyElement=function(e,t,n){var i=this;n&&!h(n)&&(n=[n]),n=n||vp(e.$descriptor);var r=this._eventBus.fire("moddleCopy.canCopyProperties",{propertyNames:n,sourceElement:e,targetElement:t});return!1===r||(h(r)&&(n=r),_(n,(function(n){var r;b(e,n)&&(r=e.get(n));var o=i.copyProperty(r,t,n);!1!==i._eventBus.fire("moddleCopy.canSetCopiedProperty",{parent:t,property:o,propertyName:n})&&l(o)&&t.set(n,o)}))),t},fp.prototype.copyProperty=function(e,t,n){var i=this,r=this._eventBus.fire("moddleCopy.canCopyProperty",{parent:t,property:e,propertyName:n});if(!1!==r){if(r)return m(r)&&r.$type&&!r.$parent&&(r.$parent=t),r;var o=this._moddle.getPropertyDescriptor(t,n);if(!o.isReference){if(o.isId)return this._copyId(e,t);if(h(e))return S(e,(function(e,o){return(r=i.copyProperty(o,t,n))?(r.$parent=t,e.concat(r)):e}),[]);if(m(e)&&e.$type){if(this._moddle.getElementDescriptor(e).isGeneric)return;return(r=i._bpmnFactory.create(e.$type)).$parent=t,r=i.copyElement(e,r)}return e}}},fp.prototype._copyId=function(e,t){return this._moddle.ids.assigned(e)?void 0:(this._moddle.ids.claim(e,t),e)};var yp={__depends__:[up],__init__:["bpmnCopyPaste","moddleCopy"],bpmnCopyPaste:["type",dp],moddleCopy:["type",fp]},gp=Math.round;function bp(e){this._modeling=e}bp.$inject=["modeling"],bp.prototype.replaceElement=function(e,t,n){if(e.waypoints)return null;var i=this._modeling,r=t.width||e.width,o=t.height||e.height,a=t.x||e.x,s=t.y||e.y,c=gp(a+r/2),p=gp(s+o/2);return i.replaceShape(e,U({},t,{x:c,y:p,width:r,height:o}),n)};var xp={__init__:["replace"],replace:["type",bp]};var Ep=["cancelActivity","instantiate","eventGatewayType","triggeredByEvent","isInterrupting"];function wp(e,t,n,i,r,o,a){this.replaceElement=function(s,c,p){p=p||{};var l=c.type,d=s.businessObject;if(_p(d)&&"bpmn:SubProcess"===l&&function(e,t){var n=e&&b(e,"collapsed")?e.collapsed:!Nr(e);return n!==(t&&(b(t,"collapsed")||b(t,"isExpanded"))?b(t,"collapsed")?t.collapsed:!t.isExpanded:n)&&(e.collapsed=n,!0)}(s,c))return i.toggleCollapse(s),s;var m,f=e.create(l),v={type:l,businessObject:f},y=vp(d.$descriptor),g=vp(f.$descriptor,!0),x=(m=g,y.filter((function(e){return-1!==m.indexOf(e)})));U(f,G(c,Ep));var E=w(x,(function(e){return"eventDefinitions"===e?Pp(s,c.eventDefinitionType):"loopCharacteristics"===e?!Fr(f):!b(f,e)&&(("processRef"!==e||!1!==c.isExpanded)&&"triggeredByEvent"!==e)}));return f=n.copyElement(d,f,E),c.eventDefinitionType&&(Pp(f,c.eventDefinitionType)||(v.eventDefinitionType=c.eventDefinitionType,v.eventDefinitionAttrs=c.eventDefinitionAttrs)),Dr(d,"bpmn:Activity")&&(_p(d)?v.isExpanded=Nr(d):c&&b(c,"isExpanded")&&(v.isExpanded=c.isExpanded),Nr(d)&&!Dr(d,"bpmn:Task")&&v.isExpanded&&(v.width=s.width,v.height=s.height)),_p(d)&&!_p(f)&&(p.moveChildren=!1),Dr(d,"bpmn:Participant")&&(!0===c.isExpanded?f.processRef=e.create("bpmn:Process"):p.moveChildren=!1,v.width=s.width,v.height=t._getDefaultSize(f).height),o.allowed("shape.resize",{shape:f})||(v.height=t._getDefaultSize(f).height,v.width=t._getDefaultSize(f).width),f.name=d.name,Qa(d,["bpmn:ExclusiveGateway","bpmn:InclusiveGateway","bpmn:Activity"])&&Qa(f,["bpmn:ExclusiveGateway","bpmn:InclusiveGateway","bpmn:Activity"])&&(f.default=d.default),c.host&&!Dr(d,"bpmn:BoundaryEvent")&&Dr(f,"bpmn:BoundaryEvent")&&(v.host=c.host),"bpmn:DataStoreReference"!==v.type&&"bpmn:DataObjectReference"!==v.type||(v.x=s.x+(s.width-v.width)/2),v.di={},function(e,t,n){h(n)||(n=[n]),_(n,(function(n){u(e[n])||(t[n]=e[n])}))}(d.di,v.di,["fill","stroke","background-color","border-color","color"]),v=r.replaceElement(s,v,p),!1!==p.select&&a.select(v),v}}function _p(e){return Dr(e,"bpmn:SubProcess")}function Pp(e,t){var n=Br(e);return t&&n.get("eventDefinitions").some((function(e){return Dr(e,t)}))}wp.$inject=["bpmnFactory","elementFactory","moddleCopy","modeling","replace","rules","selection"];var Sp={__depends__:[yp,xp,Ho],bpmnReplace:["type",wp]};function Op(e){return function(t){var n=t.target,i=Br(e),r=i.eventDefinitions&&i.eventDefinitions[0],o=i.$type===n.type,a=(r&&r.$type)===n.eventDefinitionType,s=i.triggeredByEvent===n.triggeredByEvent,c=void 0===n.isExpanded||n.isExpanded===Nr(i);return!(o&&a&&s&&c)}}var Cp=[{label:"Start Event",actionName:"replace-with-none-start",className:"bpmn-icon-start-event-none",target:{type:"bpmn:StartEvent"}},{label:"Intermediate Throw Event",actionName:"replace-with-none-intermediate-throwing",className:"bpmn-icon-intermediate-event-none",target:{type:"bpmn:IntermediateThrowEvent"}},{label:"End Event",actionName:"replace-with-none-end",className:"bpmn-icon-end-event-none",target:{type:"bpmn:EndEvent"}},{label:"Message Start Event",actionName:"replace-with-message-start",className:"bpmn-icon-start-event-message",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},{label:"Timer Start Event",actionName:"replace-with-timer-start",className:"bpmn-icon-start-event-timer",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:TimerEventDefinition"}},{label:"Conditional Start Event",actionName:"replace-with-conditional-start",className:"bpmn-icon-start-event-condition",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition"}},{label:"Signal Start Event",actionName:"replace-with-signal-start",className:"bpmn-icon-start-event-signal",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}}],Tp=[{label:"Start Event",actionName:"replace-with-none-start",className:"bpmn-icon-start-event-none",target:{type:"bpmn:StartEvent"}},{label:"Intermediate Throw Event",actionName:"replace-with-none-intermediate-throwing",className:"bpmn-icon-intermediate-event-none",target:{type:"bpmn:IntermediateThrowEvent"}},{label:"End Event",actionName:"replace-with-none-end",className:"bpmn-icon-end-event-none",target:{type:"bpmn:EndEvent"}}],Ap=[{label:"Start Event",actionName:"replace-with-none-start",className:"bpmn-icon-start-event-none",target:{type:"bpmn:StartEvent"}},{label:"Intermediate Throw Event",actionName:"replace-with-none-intermediate-throw",className:"bpmn-icon-intermediate-event-none",target:{type:"bpmn:IntermediateThrowEvent"}},{label:"End Event",actionName:"replace-with-none-end",className:"bpmn-icon-end-event-none",target:{type:"bpmn:EndEvent"}},{label:"Message Intermediate Catch Event",actionName:"replace-with-message-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-message",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},{label:"Message Intermediate Throw Event",actionName:"replace-with-message-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-message",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},{label:"Timer Intermediate Catch Event",actionName:"replace-with-timer-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-timer",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:TimerEventDefinition"}},{label:"Escalation Intermediate Throw Event",actionName:"replace-with-escalation-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-escalation",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:EscalationEventDefinition"}},{label:"Conditional Intermediate Catch Event",actionName:"replace-with-conditional-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-condition",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition"}},{label:"Link Intermediate Catch Event",actionName:"replace-with-link-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-link",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:LinkEventDefinition",eventDefinitionAttrs:{name:""}}},{label:"Link Intermediate Throw Event",actionName:"replace-with-link-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-link",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:LinkEventDefinition",eventDefinitionAttrs:{name:""}}},{label:"Compensation Intermediate Throw Event",actionName:"replace-with-compensation-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-compensation",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:CompensateEventDefinition"}},{label:"Signal Intermediate Catch Event",actionName:"replace-with-signal-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-signal",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}},{label:"Signal Intermediate Throw Event",actionName:"replace-with-signal-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-signal",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}}],Rp=[{label:"Start Event",actionName:"replace-with-none-start",className:"bpmn-icon-start-event-none",target:{type:"bpmn:StartEvent"}},{label:"Intermediate Throw Event",actionName:"replace-with-none-intermediate-throw",className:"bpmn-icon-intermediate-event-none",target:{type:"bpmn:IntermediateThrowEvent"}},{label:"End Event",actionName:"replace-with-none-end",className:"bpmn-icon-end-event-none",target:{type:"bpmn:EndEvent"}},{label:"Message End Event",actionName:"replace-with-message-end",className:"bpmn-icon-end-event-message",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},{label:"Escalation End Event",actionName:"replace-with-escalation-end",className:"bpmn-icon-end-event-escalation",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:EscalationEventDefinition"}},{label:"Error End Event",actionName:"replace-with-error-end",className:"bpmn-icon-end-event-error",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:ErrorEventDefinition"}},{label:"Cancel End Event",actionName:"replace-with-cancel-end",className:"bpmn-icon-end-event-cancel",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:CancelEventDefinition"}},{label:"Compensation End Event",actionName:"replace-with-compensation-end",className:"bpmn-icon-end-event-compensation",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:CompensateEventDefinition"}},{label:"Signal End Event",actionName:"replace-with-signal-end",className:"bpmn-icon-end-event-signal",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}},{label:"Terminate End Event",actionName:"replace-with-terminate-end",className:"bpmn-icon-end-event-terminate",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:TerminateEventDefinition"}}],kp=[{label:"Exclusive Gateway",actionName:"replace-with-exclusive-gateway",className:"bpmn-icon-gateway-xor",target:{type:"bpmn:ExclusiveGateway"}},{label:"Parallel Gateway",actionName:"replace-with-parallel-gateway",className:"bpmn-icon-gateway-parallel",target:{type:"bpmn:ParallelGateway"}},{label:"Inclusive Gateway",actionName:"replace-with-inclusive-gateway",className:"bpmn-icon-gateway-or",target:{type:"bpmn:InclusiveGateway"}},{label:"Complex Gateway",actionName:"replace-with-complex-gateway",className:"bpmn-icon-gateway-complex",target:{type:"bpmn:ComplexGateway"}},{label:"Event based Gateway",actionName:"replace-with-event-based-gateway",className:"bpmn-icon-gateway-eventbased",target:{type:"bpmn:EventBasedGateway",instantiate:!1,eventGatewayType:"Exclusive"}}],jp=[{label:"Transaction",actionName:"replace-with-transaction",className:"bpmn-icon-transaction",target:{type:"bpmn:Transaction",isExpanded:!0}},{label:"Event Sub Process",actionName:"replace-with-event-subprocess",className:"bpmn-icon-event-subprocess-expanded",target:{type:"bpmn:SubProcess",triggeredByEvent:!0,isExpanded:!0}},{label:"Sub Process (collapsed)",actionName:"replace-with-collapsed-subprocess",className:"bpmn-icon-subprocess-collapsed",target:{type:"bpmn:SubProcess",isExpanded:!1}}],Mp=[{label:"Sub Process",actionName:"replace-with-subprocess",className:"bpmn-icon-subprocess-expanded",target:{type:"bpmn:SubProcess",isExpanded:!0}},{label:"Event Sub Process",actionName:"replace-with-event-subprocess",className:"bpmn-icon-event-subprocess-expanded",target:{type:"bpmn:SubProcess",triggeredByEvent:!0,isExpanded:!0}}],Dp=[{label:"Sub Process",actionName:"replace-with-subprocess",className:"bpmn-icon-subprocess-expanded",target:{type:"bpmn:SubProcess",isExpanded:!0}},{label:"Transaction",actionName:"replace-with-transaction",className:"bpmn-icon-transaction",target:{type:"bpmn:Transaction",isExpanded:!0}}],Bp=[{label:"Task",actionName:"replace-with-task",className:"bpmn-icon-task",target:{type:"bpmn:Task"}},{label:"Send Task",actionName:"replace-with-send-task",className:"bpmn-icon-send",target:{type:"bpmn:SendTask"}},{label:"Receive Task",actionName:"replace-with-receive-task",className:"bpmn-icon-receive",target:{type:"bpmn:ReceiveTask"}},{label:"User Task",actionName:"replace-with-user-task",className:"bpmn-icon-user",target:{type:"bpmn:UserTask"}},{label:"Manual Task",actionName:"replace-with-manual-task",className:"bpmn-icon-manual",target:{type:"bpmn:ManualTask"}},{label:"Business Rule Task",actionName:"replace-with-rule-task",className:"bpmn-icon-business-rule",target:{type:"bpmn:BusinessRuleTask"}},{label:"Service Task",actionName:"replace-with-service-task",className:"bpmn-icon-service",target:{type:"bpmn:ServiceTask"}},{label:"Script Task",actionName:"replace-with-script-task",className:"bpmn-icon-script",target:{type:"bpmn:ScriptTask"}},{label:"Call Activity",actionName:"replace-with-call-activity",className:"bpmn-icon-call-activity",target:{type:"bpmn:CallActivity"}},{label:"Sub Process (collapsed)",actionName:"replace-with-collapsed-subprocess",className:"bpmn-icon-subprocess-collapsed",target:{type:"bpmn:SubProcess",isExpanded:!1}},{label:"Sub Process (expanded)",actionName:"replace-with-expanded-subprocess",className:"bpmn-icon-subprocess-expanded",target:{type:"bpmn:SubProcess",isExpanded:!0}}],Ip=[{label:"Data Store Reference",actionName:"replace-with-data-store-reference",className:"bpmn-icon-data-store",target:{type:"bpmn:DataStoreReference"}}],Np=[{label:"Data Object Reference",actionName:"replace-with-data-object-reference",className:"bpmn-icon-data-object",target:{type:"bpmn:DataObjectReference"}}],Lp=[{label:"Message Boundary Event",actionName:"replace-with-message-boundary",className:"bpmn-icon-intermediate-event-catch-message",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},{label:"Timer Boundary Event",actionName:"replace-with-timer-boundary",className:"bpmn-icon-intermediate-event-catch-timer",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:TimerEventDefinition"}},{label:"Escalation Boundary Event",actionName:"replace-with-escalation-boundary",className:"bpmn-icon-intermediate-event-catch-escalation",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:EscalationEventDefinition"}},{label:"Conditional Boundary Event",actionName:"replace-with-conditional-boundary",className:"bpmn-icon-intermediate-event-catch-condition",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition"}},{label:"Error Boundary Event",actionName:"replace-with-error-boundary",className:"bpmn-icon-intermediate-event-catch-error",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:ErrorEventDefinition"}},{label:"Cancel Boundary Event",actionName:"replace-with-cancel-boundary",className:"bpmn-icon-intermediate-event-catch-cancel",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:CancelEventDefinition"}},{label:"Signal Boundary Event",actionName:"replace-with-signal-boundary",className:"bpmn-icon-intermediate-event-catch-signal",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}},{label:"Compensation Boundary Event",actionName:"replace-with-compensation-boundary",className:"bpmn-icon-intermediate-event-catch-compensation",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:CompensateEventDefinition"}},{label:"Message Boundary Event (non-interrupting)",actionName:"replace-with-non-interrupting-message-boundary",className:"bpmn-icon-intermediate-event-catch-non-interrupting-message",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:MessageEventDefinition",cancelActivity:!1}},{label:"Timer Boundary Event (non-interrupting)",actionName:"replace-with-non-interrupting-timer-boundary",className:"bpmn-icon-intermediate-event-catch-non-interrupting-timer",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:TimerEventDefinition",cancelActivity:!1}},{label:"Escalation Boundary Event (non-interrupting)",actionName:"replace-with-non-interrupting-escalation-boundary",className:"bpmn-icon-intermediate-event-catch-non-interrupting-escalation",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:EscalationEventDefinition",cancelActivity:!1}},{label:"Conditional Boundary Event (non-interrupting)",actionName:"replace-with-non-interrupting-conditional-boundary",className:"bpmn-icon-intermediate-event-catch-non-interrupting-condition",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition",cancelActivity:!1}},{label:"Signal Boundary Event (non-interrupting)",actionName:"replace-with-non-interrupting-signal-boundary",className:"bpmn-icon-intermediate-event-catch-non-interrupting-signal",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:SignalEventDefinition",cancelActivity:!1}}],Fp=[{label:"Message Start Event",actionName:"replace-with-message-start",className:"bpmn-icon-start-event-message",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},{label:"Timer Start Event",actionName:"replace-with-timer-start",className:"bpmn-icon-start-event-timer",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:TimerEventDefinition"}},{label:"Conditional Start Event",actionName:"replace-with-conditional-start",className:"bpmn-icon-start-event-condition",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition"}},{label:"Signal Start Event",actionName:"replace-with-signal-start",className:"bpmn-icon-start-event-signal",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}},{label:"Error Start Event",actionName:"replace-with-error-start",className:"bpmn-icon-start-event-error",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:ErrorEventDefinition"}},{label:"Escalation Start Event",actionName:"replace-with-escalation-start",className:"bpmn-icon-start-event-escalation",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:EscalationEventDefinition"}},{label:"Compensation Start Event",actionName:"replace-with-compensation-start",className:"bpmn-icon-start-event-compensation",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:CompensateEventDefinition"}},{label:"Message Start Event (non-interrupting)",actionName:"replace-with-non-interrupting-message-start",className:"bpmn-icon-start-event-non-interrupting-message",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:MessageEventDefinition",isInterrupting:!1}},{label:"Timer Start Event (non-interrupting)",actionName:"replace-with-non-interrupting-timer-start",className:"bpmn-icon-start-event-non-interrupting-timer",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:TimerEventDefinition",isInterrupting:!1}},{label:"Conditional Start Event (non-interrupting)",actionName:"replace-with-non-interrupting-conditional-start",className:"bpmn-icon-start-event-non-interrupting-condition",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition",isInterrupting:!1}},{label:"Signal Start Event (non-interrupting)",actionName:"replace-with-non-interrupting-signal-start",className:"bpmn-icon-start-event-non-interrupting-signal",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:SignalEventDefinition",isInterrupting:!1}},{label:"Escalation Start Event (non-interrupting)",actionName:"replace-with-non-interrupting-escalation-start",className:"bpmn-icon-start-event-non-interrupting-escalation",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:EscalationEventDefinition",isInterrupting:!1}}],Vp=[{label:"Sequence Flow",actionName:"replace-with-sequence-flow",className:"bpmn-icon-connection"},{label:"Default Flow",actionName:"replace-with-default-flow",className:"bpmn-icon-default-flow"},{label:"Conditional Flow",actionName:"replace-with-conditional-flow",className:"bpmn-icon-conditional-flow"}],$p=[{label:"Expanded Pool",actionName:"replace-with-expanded-pool",className:"bpmn-icon-participant",target:{type:"bpmn:Participant",isExpanded:!0}},{label:function(e){var t="Empty Pool";return e.children&&e.children.length&&(t+=" (removes content)"),t},actionName:"replace-with-collapsed-pool",className:"bpmn-icon-lane",target:{type:"bpmn:Participant",isExpanded:!1}}];function zp(e,t,n,i,r,o,a){this._bpmnFactory=e,this._popupMenu=t,this._modeling=n,this._moddle=i,this._bpmnReplace=r,this._rules=o,this._translate=a,this.register()}zp.$inject=["bpmnFactory","popupMenu","modeling","moddle","bpmnReplace","rules","translate"],zp.prototype.register=function(){this._popupMenu.registerProvider("bpmn-replace",this)},zp.prototype.getEntries=function(e){var t,n=e.businessObject;if(!this._rules.allowed("shape.replace",{element:e}))return[];var i=Op(e);return Dr(n,"bpmn:DataObjectReference")?this._createEntries(e,Ip):Dr(n,"bpmn:DataStoreReference")?this._createEntries(e,Np):Dr(n,"bpmn:StartEvent")&&!Dr(n.$parent,"bpmn:SubProcess")?(t=w(Cp,i),this._createEntries(e,t)):Dr(n,"bpmn:Participant")?(t=w($p,(function(e){return Nr(n)!==e.target.isExpanded})),this._createEntries(e,t)):Dr(n,"bpmn:StartEvent")&&Fr(n.$parent)?(t=w(Fp,(function(t){var n=!1!==t.target.isInterrupting,r=Br(e).isInterrupting===n;return i(t)||!i(t)&&!r})),this._createEntries(e,t)):Dr(n,"bpmn:StartEvent")&&!Fr(n.$parent)&&Dr(n.$parent,"bpmn:SubProcess")?(t=w(Tp,i),this._createEntries(e,t)):Dr(n,"bpmn:EndEvent")?(t=w(Rp,(function(e){return!("bpmn:CancelEventDefinition"==e.target.eventDefinitionType&&!Dr(n.$parent,"bpmn:Transaction"))&&i(e)})),this._createEntries(e,t)):Dr(n,"bpmn:BoundaryEvent")?(t=w(Lp,(function(e){var t=e.target;if("bpmn:CancelEventDefinition"==t.eventDefinitionType&&!Dr(n.attachedToRef,"bpmn:Transaction"))return!1;var r=!1!==t.cancelActivity,o=n.cancelActivity==r;return i(e)||!i(e)&&!o})),this._createEntries(e,t)):Dr(n,"bpmn:IntermediateCatchEvent")||Dr(n,"bpmn:IntermediateThrowEvent")?(t=w(Ap,i),this._createEntries(e,t)):Dr(n,"bpmn:Gateway")?(t=w(kp,i),this._createEntries(e,t)):Dr(n,"bpmn:Transaction")?(t=w(Mp,i),this._createEntries(e,t)):Fr(n)&&Nr(n)?(t=w(Dp,i),this._createEntries(e,t)):Dr(n,"bpmn:SubProcess")&&Nr(n)?(t=w(jp,i),this._createEntries(e,t)):Dr(n,"bpmn:AdHocSubProcess")&&!Nr(n)?(t=w(Bp,(function(t){var n=t.target,i="bpmn:SubProcess"===n.type,r=!0===n.isExpanded;return Op(e)&&(!i||r)})),this._createEntries(e,t)):Dr(n,"bpmn:SequenceFlow")?this._createSequenceFlowEntries(e,Vp):Dr(n,"bpmn:FlowNode")?(t=w(Bp,i),Dr(n,"bpmn:SubProcess")&&!Nr(n)&&(t=w(t,(function(e){return"Sub Process (collapsed)"!==e.label}))),this._createEntries(e,t)):[]},zp.prototype.getHeaderEntries=function(e){var t=[];return Dr(e,"bpmn:Activity")&&!Fr(e)&&(t=t.concat(this._getLoopEntries(e))),Dr(e,"bpmn:DataObjectReference")&&(t=t.concat(this._getDataObjectIsCollection(e))),Dr(e,"bpmn:Participant")&&(t=t.concat(this._getParticipantMultiplicity(e))),!Dr(e,"bpmn:SubProcess")||Dr(e,"bpmn:Transaction")||Fr(e)||t.push(this._getAdHocEntry(e)),t},zp.prototype._createEntries=function(e,t){var n=[],i=this;return _(t,(function(t){var r=i._createMenuEntry(t,e);n.push(r)})),n},zp.prototype._createSequenceFlowEntries=function(e,t){var n=Br(e),i=[],r=this._modeling,o=this._moddle,a=this;return _(t,(function(t){switch(t.actionName){case"replace-with-default-flow":n.sourceRef.default!==n&&(Dr(n.sourceRef,"bpmn:ExclusiveGateway")||Dr(n.sourceRef,"bpmn:InclusiveGateway")||Dr(n.sourceRef,"bpmn:ComplexGateway")||Dr(n.sourceRef,"bpmn:Activity"))&&i.push(a._createMenuEntry(t,e,(function(){r.updateProperties(e.source,{default:n})})));break;case"replace-with-conditional-flow":!n.conditionExpression&&Dr(n.sourceRef,"bpmn:Activity")&&i.push(a._createMenuEntry(t,e,(function(){var t=o.create("bpmn:FormalExpression",{body:""});r.updateProperties(e,{conditionExpression:t})})));break;default:if(Dr(n.sourceRef,"bpmn:Activity")&&n.conditionExpression)return i.push(a._createMenuEntry(t,e,(function(){r.updateProperties(e,{conditionExpression:void 0})})));if((Dr(n.sourceRef,"bpmn:ExclusiveGateway")||Dr(n.sourceRef,"bpmn:InclusiveGateway")||Dr(n.sourceRef,"bpmn:ComplexGateway")||Dr(n.sourceRef,"bpmn:Activity"))&&n.sourceRef.default===n)return i.push(a._createMenuEntry(t,e,(function(){r.updateProperties(e.source,{default:void 0})})))}})),i},zp.prototype._createMenuEntry=function(e,t,n){var i=this._translate,r=this._bpmnReplace.replaceElement,o=e.label;return o&&"function"==typeof o&&(o=o(t)),n=n||function(){return r(t,e.target)},{label:i(o),className:e.className,id:e.actionName,action:n}},zp.prototype._getLoopEntries=function(e){var t=this,n=this._translate;function i(n,i){var r;i.active?r=void 0:(r=t._moddle.create(i.options.loopCharacteristics),i.options.isSequential&&(r.isSequential=i.options.isSequential)),t._modeling.updateProperties(e,{loopCharacteristics:r})}var r,o,a,s=Br(e).loopCharacteristics;return s&&(r=s.isSequential,o=void 0===s.isSequential,a=void 0!==s.isSequential&&!s.isSequential),[{id:"toggle-parallel-mi",className:"bpmn-icon-parallel-mi-marker",title:n("Parallel Multi Instance"),active:a,action:i,options:{loopCharacteristics:"bpmn:MultiInstanceLoopCharacteristics",isSequential:!1}},{id:"toggle-sequential-mi",className:"bpmn-icon-sequential-mi-marker",title:n("Sequential Multi Instance"),active:r,action:i,options:{loopCharacteristics:"bpmn:MultiInstanceLoopCharacteristics",isSequential:!0}},{id:"toggle-loop",className:"bpmn-icon-loop-marker",title:n("Loop"),active:o,action:i,options:{loopCharacteristics:"bpmn:StandardLoopCharacteristics"}}]},zp.prototype._getDataObjectIsCollection=function(e){var t=this,n=this._translate;var i=e.businessObject.dataObjectRef,r=i.isCollection;return[{id:"toggle-is-collection",className:"bpmn-icon-parallel-mi-marker",title:n("Collection"),active:r,action:function(n,r){t._modeling.updateModdleProperties(e,i,{isCollection:!r.active})}}]},zp.prototype._getParticipantMultiplicity=function(e){var t=this,n=this._bpmnFactory,i=this._translate;var r=e.businessObject.participantMultiplicity;return[{id:"toggle-participant-multiplicity",className:"bpmn-icon-parallel-mi-marker",title:i("Participant Multiplicity"),active:!!r,action:function(i,r){var o;r.active||(o=n.create("bpmn:ParticipantMultiplicity")),t._modeling.updateProperties(e,{participantMultiplicity:o})}}]},zp.prototype._getAdHocEntry=function(e){var t=this._translate,n=Dr(Br(e),"bpmn:AdHocSubProcess"),i=this._bpmnReplace.replaceElement;return{id:"toggle-adhoc",className:"bpmn-icon-ad-hoc-marker",title:t("Ad-hoc"),active:n,action:function(t,r){return i(e,n?{type:"bpmn:SubProcess"}:{type:"bpmn:AdHocSubProcess"},{autoResize:!1,layoutConnection:!1})}}};var qp={__depends__:[ep,Sp],__init__:["replaceMenuProvider"],replaceMenuProvider:["type",zp]},Up=Math.max,Gp=Math.min;function Hp(e,t){return{top:e.top-t.top,right:e.right-t.right,bottom:e.bottom-t.bottom,left:e.left-t.left}}function Wp(e,t,n){var i=t[e],r=n.min&&n.min[e],o=n.max&&n.max[e];return f(r)&&(i=(/top|left/.test(e)?Gp:Up)(i,r)),f(o)&&(i=(/top|left/.test(e)?Up:Gp)(i,o)),i}function Kp(e,t){return void 0!==e?e:20}function Xp(e){return!e.waypoints&&"label"!==e.type}function Yp(e,t){var n;if((n=void 0===e.length?w(e.children,Xp):e).length)return function(e,t){var n,i,r,o;return"object"==typeof t?(n=Kp(t.left),i=Kp(t.right),r=Kp(t.top),o=Kp(t.bottom)):n=i=r=o=Kp(t),{x:e.x-n,y:e.y-r,width:e.width+n+i,height:e.height+r+o}}(ft(n),t)}var Jp=Math.abs;var Zp=["bpmn:Participant","bpmn:Process","bpmn:SubProcess"],Qp=30;function eu(e,t){return t=t||[],e.children.filter((function(e){Dr(e,"bpmn:Lane")&&(eu(e,t),t.push(e))})),t}function tu(e){return e.children.filter((function(e){return Dr(e,"bpmn:Lane")}))}function nu(e){return es(e,Zp)||e}function iu(e,t){var n=nu(e),i=eu(n,Dr(n,"bpmn:Process")?[]:[n]),r=hn(e),o=hn(t),a=function(e,t){return Hp(hn(t),hn(e))}(e,t),s=[];return i.forEach((function(t){if(t!==e){var n,i,c=0,p=a.right,u=0,l=a.left,d=hn(t);a.top&&(Jp(d.bottom-r.top)<10&&(u=o.top-d.bottom),Jp(d.top-r.top)<5&&(c=o.top-d.top)),a.bottom&&(Jp(d.top-r.bottom)<10&&(c=o.bottom-d.top),Jp(d.bottom-r.bottom)<5&&(u=o.bottom-d.bottom)),(c||p||u||l)&&s.push({shape:t,newBounds:(n=t,i={top:c,right:p,bottom:u,left:l},{x:n.x+(i.left||0),y:n.y+(i.top||0),width:n.width-(i.left||0)+(i.right||0),height:n.height-(i.top||0)+(i.bottom||0)})})}})),s}function ru(e,t,n,i,r,o,a,s,c,p,u,l){e=e||{},i.registerProvider(this),this._contextPad=i,this._modeling=r,this._elementFactory=o,this._connect=a,this._create=s,this._popupMenu=c,this._canvas=p,this._rules=u,this._translate=l,!1!==e.autoPlace&&(this._autoPlace=t.get("autoPlace",!1)),n.on("create.end",250,(function(e){var t=e.context.shape;if(jo(e)&&i.isOpen(t)){var n=i.getEntries(t);n.replace&&n.replace.action.click(e,t)}}))}function ou(e,t,n){var i=e.$instanceOf(t),r=!1;return _(e.eventDefinitions||[],(function(e){e.$type===n&&(r=!0)})),i&&r}ru.$inject=["config.contextPad","injector","eventBus","contextPad","modeling","elementFactory","connect","create","popupMenu","canvas","rules","translate"],ru.prototype.getContextPadEntries=function(e){var t=this._contextPad,n=this._modeling,i=this._elementFactory,r=this._connect,o=this._create,a=this._popupMenu,s=this._canvas,c=this._rules,p=this._autoPlace,u=this._translate,l={};if("label"===e.type)return l;var d=e.businessObject;function m(e,t){r.start(e,t)}function f(e,t,n,r){function a(t,n){var a=i.createShape(U({type:e},r));o.start(t,a,{source:n})}return"string"!=typeof n&&(r=n,n=u("Append {type}",{type:e.replace(/^bpmn:/,"")})),{group:"model",className:t,title:n,action:{dragstart:a,click:p?function(t,n){var o=i.createShape(U({type:e},r));p.append(n,o)}:a}}}function v(e){return function(i,r){n.splitLane(r,e),t.open(r,!0)}}if(Qa(d,["bpmn:Lane","bpmn:Participant"])&&Nr(d)){var y=tu(e);U(l,{"lane-insert-above":{group:"lane-insert-above",className:"bpmn-icon-lane-insert-above",title:u("Add Lane above"),action:{click:function(e,t){n.addLane(t,"top")}}}}),y.length<2&&(e.height>=120&&U(l,{"lane-divide-two":{group:"lane-divide",className:"bpmn-icon-lane-divide-two",title:u("Divide into two Lanes"),action:{click:v(2)}}}),e.height>=180&&U(l,{"lane-divide-three":{group:"lane-divide",className:"bpmn-icon-lane-divide-three",title:u("Divide into three Lanes"),action:{click:v(3)}}})),U(l,{"lane-insert-below":{group:"lane-insert-below",className:"bpmn-icon-lane-insert-below",title:u("Add Lane below"),action:{click:function(e,t){n.addLane(t,"bottom")}}}})}Dr(d,"bpmn:FlowNode")&&(Dr(d,"bpmn:EventBasedGateway")?U(l,{"append.receive-task":f("bpmn:ReceiveTask","bpmn-icon-receive-task",u("Append ReceiveTask")),"append.message-intermediate-event":f("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-message",u("Append MessageIntermediateCatchEvent"),{eventDefinitionType:"bpmn:MessageEventDefinition"}),"append.timer-intermediate-event":f("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-timer",u("Append TimerIntermediateCatchEvent"),{eventDefinitionType:"bpmn:TimerEventDefinition"}),"append.condition-intermediate-event":f("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-condition",u("Append ConditionIntermediateCatchEvent"),{eventDefinitionType:"bpmn:ConditionalEventDefinition"}),"append.signal-intermediate-event":f("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-signal",u("Append SignalIntermediateCatchEvent"),{eventDefinitionType:"bpmn:SignalEventDefinition"})}):ou(d,"bpmn:BoundaryEvent","bpmn:CompensateEventDefinition")?U(l,{"append.compensation-activity":f("bpmn:Task","bpmn-icon-task",u("Append compensation activity"),{isForCompensation:!0})}):Dr(d,"bpmn:EndEvent")||d.isForCompensation||ou(d,"bpmn:IntermediateThrowEvent","bpmn:LinkEventDefinition")||Fr(d)||U(l,{"append.end-event":f("bpmn:EndEvent","bpmn-icon-end-event-none",u("Append EndEvent")),"append.gateway":f("bpmn:ExclusiveGateway","bpmn-icon-gateway-none",u("Append Gateway")),"append.append-task":f("bpmn:Task","bpmn-icon-task",u("Append Task")),"append.intermediate-event":f("bpmn:IntermediateThrowEvent","bpmn-icon-intermediate-event-none",u("Append Intermediate/Boundary Event"))})),a.isEmpty(e,"bpmn-replace")||U(l,{replace:{group:"edit",className:"bpmn-icon-screw-wrench",title:u("Change type"),action:{click:function(e,n){var i=U(function(e){var n=s.getContainer(),i=t.getPad(e).html,r=n.getBoundingClientRect(),o=i.getBoundingClientRect(),a=o.top-r.top;return{x:o.left-r.left,y:a+o.height+5}}(n),{cursor:{x:e.x,y:e.y}});a.open(n,"bpmn-replace",i)}}}}),Qa(d,["bpmn:FlowNode","bpmn:InteractionNode","bpmn:DataObjectReference","bpmn:DataStoreReference"])&&U(l,{"append.text-annotation":f("bpmn:TextAnnotation","bpmn-icon-text-annotation"),connect:{group:"connect",className:"bpmn-icon-connection-multi",title:u("Connect using "+(d.isForCompensation?"":"Sequence/MessageFlow or ")+"Association"),action:{click:m,dragstart:m}}}),Dr(d,"bpmn:TextAnnotation")&&U(l,{connect:{group:"connect",className:"bpmn-icon-connection-multi",title:u("Connect using Association"),action:{click:m,dragstart:m}}}),Qa(d,["bpmn:DataObjectReference","bpmn:DataStoreReference"])&&U(l,{connect:{group:"connect",className:"bpmn-icon-connection-multi",title:u("Connect using DataInputAssociation"),action:{click:m,dragstart:m}}}),Dr(d,"bpmn:Group")&&U(l,{"append.text-annotation":f("bpmn:TextAnnotation","bpmn-icon-text-annotation")});var g=c.allowed("elements.delete",{elements:[e]});return h(g)&&(g=g[0]===e),g&&U(l,{delete:{group:"edit",className:"bpmn-icon-trash",title:u("Remove"),action:{click:function(t){n.removeElements([e])}}}}),l};var au={__depends__:[jc,Bc,Ho,_c,Yc,qp],__init__:["contextPadProvider"],contextPadProvider:["type",ru]},su={horizontal:["x","width"],vertical:["y","height"]};function cu(e){this._modeling=e,this._filters=[],this.registerFilter((function(e,t,n){var i,r=0,o=0;return _(e,(function(e){e.waypoints||e.labelTarget||(r+=e[n],o+=1)})),i=Math.round(r/o),w(e,(function(e){return e[n]<i+50}))}))}cu.$inject=["modeling"],cu.prototype.registerFilter=function(e){if("function"!=typeof e)throw new Error("the filter has to be a function");this._filters.push(e)},cu.prototype.trigger=function(e,t){var n,i,r=this._modeling;if(!(e.length<3||(this._setOrientation(t),i=this._filterElements(e),(n=this._createGroups(i)).length<=2)))return r.distributeElements(n,this._axis,this._dimension),n},cu.prototype._filterElements=function(e){var t=this._filters,n=this._axis,i=this._dimension,r=[].concat(e);return t.length?(_(t,(function(e){r=e(r,n,i)})),r):e},cu.prototype._createGroups=function(e){var t=[],n=this,i=this._axis,r=this._dimension;if(!i)throw new Error('must have a defined "axis" and "dimension"');return _(B(e,i),(function(e,o){var a,s=n._findRange(e,i,r),c=t[t.length-1];c&&n._hasIntersection(c.range,s)?t[t.length-1].elements.push(e):(a={range:s,elements:[e]},t.push(a))})),t},cu.prototype._setOrientation=function(e){var t=su[e];this._axis=t[0],this._dimension=t[1]},cu.prototype._hasIntersection=function(e,t){return Math.max(e.min,e.max)>=Math.min(t.min,t.max)&&Math.min(e.min,e.max)<=Math.max(t.min,t.max)},cu.prototype._findRange=function(e){var t=e[this._axis];return{min:t+5,max:t+e[this._dimension]-5}};var pu={__init__:["distributeElements"],distributeElements:["type",cu]};function uu(e){e.registerFilter((function(e){return w(e,(function(e){var t=Qa(e,["bpmn:Association","bpmn:BoundaryEvent","bpmn:DataInputAssociation","bpmn:DataOutputAssociation","bpmn:Lane","bpmn:MessageFlow","bpmn:Participant","bpmn:SequenceFlow","bpmn:TextAnnotation"]);return!(e.labelTarget||t)}))}))}uu.$inject=["distributeElements"];var lu={__depends__:[pu],__init__:["bpmnDistributeElements"],bpmnDistributeElements:["type",uu]},du="is not a registered action";function hu(e,t){this._actions={};var n=this;e.on("diagram.init",(function(){n._registerDefaultActions(t),e.fire("editorActions.init",{editorActions:n})}))}function mu(e,t){return new Error(e+" "+t)}hu.$inject=["eventBus","injector"],hu.prototype._registerDefaultActions=function(e){var t=e.get("commandStack",!1),n=e.get("modeling",!1),i=e.get("selection",!1),r=e.get("zoomScroll",!1),o=e.get("copyPaste",!1),a=e.get("canvas",!1),s=e.get("rules",!1),c=e.get("keyboardMove",!1),p=e.get("keyboardMoveSelection",!1);t&&(this.register("undo",(function(){t.undo()})),this.register("redo",(function(){t.redo()}))),o&&i&&this.register("copy",(function(){var e=i.get();o.copy(e)})),o&&this.register("paste",(function(){o.paste()})),r&&this.register("stepZoom",(function(e){r.stepZoom(e.value)})),a&&this.register("zoom",(function(e){a.zoom(e.value)})),n&&i&&s&&this.register("removeSelection",(function(){var e=i.get();if(e.length){var t,r=s.allowed("elements.delete",{elements:e});!1!==r&&(t=h(r)?r:e).length&&n.removeElements(t.slice())}})),c&&this.register("moveCanvas",(function(e){c.moveCanvas(e)})),p&&this.register("moveSelection",(function(e){p.moveSelection(e.direction,e.accelerated)}))},hu.prototype.trigger=function(e,t){if(!this._actions[e])throw mu(e,du);return this._actions[e](t)},hu.prototype.register=function(e,t){var n=this;if("string"==typeof e)return this._registerAction(e,t);_(e,(function(e,t){n._registerAction(t,e)}))},hu.prototype._registerAction=function(e,t){if(this.isRegistered(e))throw mu(e,"is already registered");this._actions[e]=t},hu.prototype.unregister=function(e){if(!this.isRegistered(e))throw mu(e,du);this._actions[e]=void 0},hu.prototype.getActions=function(){return Object.keys(this._actions)},hu.prototype.isRegistered=function(e){return!!this._actions[e]};var fu={__init__:["editorActions"],editorActions:["type",hu]};function vu(e){e.invoke(hu,this)}i(vu,hu),vu.$inject=["injector"],vu.prototype._registerDefaultActions=function(e){hu.prototype._registerDefaultActions.call(this,e);var t=e.get("canvas",!1),n=e.get("elementRegistry",!1),i=e.get("selection",!1),r=e.get("spaceTool",!1),o=e.get("lassoTool",!1),a=e.get("handTool",!1),s=e.get("globalConnect",!1),c=e.get("distributeElements",!1),p=e.get("alignElements",!1),u=e.get("directEditing",!1),l=e.get("searchPad",!1),d=e.get("modeling",!1);t&&n&&i&&this._registerAction("selectElements",(function(){var e=t.getRootElement(),r=n.filter((function(t){return t!==e}));return i.select(r),r})),r&&this._registerAction("spaceTool",(function(){r.toggle()})),o&&this._registerAction("lassoTool",(function(){o.toggle()})),a&&this._registerAction("handTool",(function(){a.toggle()})),s&&this._registerAction("globalConnectTool",(function(){s.toggle()})),i&&c&&this._registerAction("distributeElements",(function(e){var t=i.get(),n=e.type;t.length&&c.trigger(t,n)})),i&&p&&this._registerAction("alignElements",(function(e){var t=i.get(),n=[],r=e.type;t.length&&(n=w(t,(function(e){return!Dr(e,"bpmn:Lane")})),p.trigger(n,r))})),i&&d&&this._registerAction("setColor",(function(e){var t=i.get();t.length&&d.setColor(t,e)})),i&&u&&this._registerAction("directEditing",(function(){var e=i.get();e.length&&u.activate(e[0])})),l&&this._registerAction("find",(function(){l.toggle()})),t&&d&&this._registerAction("moveToOrigin",(function(){var e,i,r=t.getRootElement();e=ft(i=Dr(r,"bpmn:Collaboration")?n.filter((function(e){return Dr(e.parent,"bpmn:Collaboration")})):n.filter((function(e){return e!==r&&!Dr(e.parent,"bpmn:SubProcess")}))),d.moveElements(i,{x:-e.x,y:-e.y},r)}))};var yu={__depends__:[fu],editorActions:["type",vu]};function gu(e){e.on(["create.init","shape.move.init"],(function(e){var t=e.context;Qa(e.shape,["bpmn:Participant","bpmn:SubProcess","bpmn:TextAnnotation"])&&(t.gridSnappingContext||(t.gridSnappingContext={}),t.gridSnappingContext.snapLocation="top-left")}))}gu.$inject=["eventBus"];function bu(e,t,n){return n||(n="round"),Math[n](e/t)*t}function xu(e,t,n){var i=!n||!1!==n.active;this._eventBus=t;var r=this;t.on("diagram.init",800,(function(){r.setActive(i)})),t.on(["create.move","create.end","bendpoint.move.move","bendpoint.move.end","connect.move","connect.end","connectionSegment.move.move","connectionSegment.move.end","resize.move","resize.end","shape.move.move","shape.move.end"],1200,(function(t){var n=t.originalEvent;if(!(!r.active||n&&ta(n))){var i=t.context,o=i.gridSnappingContext;o||(o=i.gridSnappingContext={}),["x","y"].forEach((function(n){var i={},o=function(e,t,n){var i=e.context,r=e.shape,o=i.gridSnappingContext,a=o.snapLocation,s=o.snapOffset;if(s&&f(s[t]))return s[t];s||(s=o.snapOffset={});f(s[t])||(s[t]=0);if(!r)return s[t];n.get(r.id)||(Eu(t)?s[t]+=r[t]+r.width/2:s[t]+=r[t]+r.height/2);if(!a)return s[t];"x"===t?/left/.test(a)?s[t]-=r.width/2:/right/.test(a)&&(s[t]+=r.width/2):/top/.test(a)?s[t]-=r.height/2:/bottom/.test(a)&&(s[t]+=r.height/2);return s[t]}(t,n,e);o&&(i.offset=o);var a=function(e,t){var n=e.context,i=n.createConstraints,r=n.resizeConstraints||{},o=n.gridSnappingContext,a=o.snapConstraints;if(a&&a[t])return a[t];a||(a=o.snapConstraints={});a[t]||(a[t]={});var s=n.direction;i&&(Eu(t)?(a.x.min=i.left,a.x.max=i.right):(a.y.min=i.top,a.y.max=i.bottom));var c=r.min,p=r.max;c&&(Eu(t)?_u(s)?a.x.max=c.left:a.x.min=c.right:wu(s)?a.y.max=c.top:a.y.min=c.bottom);p&&(Eu(t)?_u(s)?a.x.min=p.left:a.x.max=p.right:wu(s)?a.y.min=p.top:a.y.max=p.bottom);return a[t]}(t,n);a&&U(i,a),lc(t,n)||r.snapEvent(t,n,i)}))}}))}function Eu(e){return"x"===e}function wu(e){return-1!==e.indexOf("n")}function _u(e){return-1!==e.indexOf("w")}function Pu(e,t){as.call(this,e),this._gridSnapping=t;var n=this;this.preExecute("shape.resize",(function(e){var t=e.context,i=(t.hints||{}).autoResize;if(i){var r=t.shape,o=t.newBounds;y(i)?t.newBounds=n.snapComplex(o,i):t.newBounds=n.snapSimple(r,o)}}))}xu.prototype.snapEvent=function(e,t,n){dc(e,t,this.snapValue(e[t],n))},xu.prototype.getGridSpacing=function(){return 10},xu.prototype.snapValue=function(e,t){var n,i,r=0;return t&&t.offset&&(r=t.offset),e=bu(e+=r,10),t&&t.min&&f(n=t.min)&&(n=bu(n+r,10,"ceil"),e=Math.max(e,n)),t&&t.max&&f(i=t.max)&&(i=bu(i+r,10,"floor"),e=Math.min(e,i)),e-=r},xu.prototype.isActive=function(){return this.active},xu.prototype.setActive=function(e){this.active=e,this._eventBus.fire("gridSnapping.toggle",{active:e})},xu.prototype.toggleActive=function(){this.setActive(!this.active)},xu.$inject=["elementRegistry","eventBus","config.gridSnapping"],Pu.$inject=["eventBus","gridSnapping","modeling"],i(Pu,as),Pu.prototype.snapSimple=function(e,t){var n=this._gridSnapping;return t.width=n.snapValue(t.width,{min:t.width}),t.height=n.snapValue(t.height,{min:t.height}),t.x=e.x+e.width/2-t.width/2,t.y=e.y+e.height/2-t.height/2,t},Pu.prototype.snapComplex=function(e,t){return/w|e/.test(t)&&(e=this.snapHorizontally(e,t)),/n|s/.test(t)&&(e=this.snapVertically(e,t)),e},Pu.prototype.snapHorizontally=function(e,t){var n=this._gridSnapping,i=/w/.test(t),r=/e/.test(t),o={};return o.width=n.snapValue(e.width,{min:e.width}),r&&(i?(o.x=n.snapValue(e.x,{max:e.x}),o.width+=n.snapValue(e.x-o.x,{min:e.x-o.x})):e.x=e.x+e.width-o.width),U(e,o),e},Pu.prototype.snapVertically=function(e,t){var n=this._gridSnapping,i=/n/.test(t),r=/s/.test(t),o={};return o.height=n.snapValue(e.height,{min:e.height}),i&&(r?(o.y=n.snapValue(e.y,{max:e.y}),o.height+=n.snapValue(e.y-o.y,{min:e.y-o.y})):e.y=e.y+e.height-o.height),U(e,o),e};function Su(e,t){e.on(["spaceTool.move","spaceTool.end"],2e3,(function(e){var n,i=e.context;i.initialized&&("x"===i.axis?(n=t.snapValue(e.dx),e.x=e.x+n-e.dx,e.dx=n):(n=t.snapValue(e.dy),e.y=e.y+n-e.dy,e.dy=n))}))}Su.$inject=["eventBus","gridSnapping"];var Ou={__depends__:[{__init__:["gridSnappingResizeBehavior","gridSnappingSpaceToolBehavior"],gridSnappingResizeBehavior:["type",Pu],gridSnappingSpaceToolBehavior:["type",Su]}],__init__:["gridSnapping"],gridSnapping:["type",xu]};function Cu(e,t){e.on("autoPlace",2e3,(function(e){var n=e.source,i=fn(n),r=e.shape,o=ns(n,r);return["x","y"].forEach((function(e){var n={};o[e]!==i[e]&&(o[e]>i[e]?n.min=o[e]:n.max=o[e],Dr(r,"bpmn:TextAnnotation")&&(!function(e){return"x"===e}(e)?n.offset=-r.height/2:n.offset=-r.width/2),o[e]=t.snapValue(o[e],n))})),o}))}Cu.$inject=["eventBus","gridSnapping"];function Tu(e,t,n){t.on(["create.start","shape.move.start"],1750,(function(t){var i=t.context,r=i.shape,o=e.getRootElement();Dr(r,"bpmn:Participant")&&Dr(o,"bpmn:Process")&&o.children.length&&(i.createConstraints&&(r.width=n.snapValue(r.width,{min:r.width}),r.height=n.snapValue(r.height,{min:r.height})))}))}Tu.$inject=["canvas","eventBus","gridSnapping"];function Au(e,t,n){as.call(this,e),this._gridSnapping=t;var i=this;this.postExecuted(["connection.create","connection.layout"],3e3,(function(e){var t=e.context,r=t.connection,o=t.hints||{},a=r.waypoints;o.connectionStart||o.connectionEnd||!1===o.createElementsBehavior||function(e){return e.length>3}(a)&&n.updateWaypoints(r,i.snapMiddleSegments(a))}))}function Ru(e,t,n){var i=Ct(t,n),r={};return function(e){return"h"===e}(i)&&(r.y=e.snapValue(t.y)),function(e){return"v"===e}(i)&&(r.x=e.snapValue(t.x)),("x"in r||"y"in r)&&(t=U({},t,r),n=U({},n,r)),[t,n]}Au.$inject=["eventBus","gridSnapping","modeling"],i(Au,as),Au.prototype.snapMiddleSegments=function(e){var t,n=this._gridSnapping;e=e.slice();for(var i=1;i<e.length-2;i++)t=Ru(n,e[i],e[i+1]),e[i]=t[0],e[i+1]=t[1];return e};var ku={__depends__:[Ou,{__init__:["gridSnappingAutoPlaceBehavior","gridSnappingCreateParticipantBehavior","gridSnappingLayoutConnectionBehavior"],gridSnappingAutoPlaceBehavior:["type",Cu],gridSnappingCreateParticipantBehavior:["type",Tu],gridSnappingLayoutConnectionBehavior:["type",Au]}],__init__:["bpmnGridSnapping"],bpmnGridSnapping:["type",gu]};function ju(e,t){this._interactionEvents=t;var n=this;e.on(["interactionEvents.createHit","interactionEvents.updateHit"],(function(e){var t=e.element,i=e.gfx;return Dr(t,"bpmn:Lane")?n.createParticipantHit(t,i):Dr(t,"bpmn:Participant")?Nr(t)?n.createParticipantHit(t,i):n.createDefaultHit(t,i):Dr(t,"bpmn:SubProcess")?Nr(t)?n.createSubProcessHit(t,i):n.createDefaultHit(t,i):void 0}))}ju.$inject=["eventBus","interactionEvents"],ju.prototype.createDefaultHit=function(e,t){return this._interactionEvents.removeHits(t),this._interactionEvents.createDefaultHit(e,t),!0},ju.prototype.createParticipantHit=function(e,t){return this._interactionEvents.removeHits(t),this._interactionEvents.createBoxHit(t,"click-stroke",{width:e.width,height:e.height}),this._interactionEvents.createBoxHit(t,"all",{width:30,height:e.height}),!0},ju.prototype.createSubProcessHit=function(e,t){return this._interactionEvents.removeHits(t),this._interactionEvents.createBoxHit(t,"click-stroke",{width:e.width,height:e.height}),this._interactionEvents.createBoxHit(t,"all",{width:e.width,height:30}),!0};var Mu={__init__:["bpmnInteractionEvents"],bpmnInteractionEvents:["type",ju]};function Du(e){e.invoke(la,this)}i(Du,la),Du.$inject=["injector"],Du.prototype.registerBindings=function(e,t){function n(n,i){t.isRegistered(n)&&e.addListener(i)}la.prototype.registerBindings.call(this,e,t),n("selectElements",(function(n){var i=n.keyEvent;if(e.isKey(["a","A"],i)&&e.isCmd(i))return t.trigger("selectElements"),!0})),n("find",(function(n){var i=n.keyEvent;if(e.isKey(["f","F"],i)&&e.isCmd(i))return t.trigger("find"),!0})),n("spaceTool",(function(n){var i=n.keyEvent;if(!e.hasModifier(i))return e.isKey(["s","S"],i)?(t.trigger("spaceTool"),!0):void 0})),n("lassoTool",(function(n){var i=n.keyEvent;if(!e.hasModifier(i))return e.isKey(["l","L"],i)?(t.trigger("lassoTool"),!0):void 0})),n("handTool",(function(n){var i=n.keyEvent;if(!e.hasModifier(i))return e.isKey(["h","H"],i)?(t.trigger("handTool"),!0):void 0})),n("globalConnectTool",(function(n){var i=n.keyEvent;if(!e.hasModifier(i))return e.isKey(["c","C"],i)?(t.trigger("globalConnectTool"),!0):void 0})),n("directEditing",(function(n){var i=n.keyEvent;if(!e.hasModifier(i))return e.isKey(["e","E"],i)?(t.trigger("directEditing"),!0):void 0}))};var Bu={__depends__:[da],__init__:["keyboardBindings"],keyboardBindings:["type",Du]},Iu={moveSpeed:1,moveSpeedAccelerated:10},Nu="left",Lu="right",Fu="down",Vu={ArrowLeft:Nu,Left:Nu,ArrowUp:"up",Up:"up",ArrowRight:Lu,Right:Lu,ArrowDown:Fu,Down:Fu},$u={left:function(e){return{x:-e,y:0}},up:function(e){return{x:0,y:-e}},right:function(e){return{x:e,y:0}},down:function(e){return{x:0,y:e}}};function zu(e,t,n,i,r){var o=this;this._config=U({},Iu,e||{}),t.addListener(1500,(function(e){var n=e.keyEvent,i=Vu[n.key];if(i&&!t.isCmd(n)){var r=t.isShift(n);return o.moveSelection(i,r),!0}})),this.moveSelection=function(e,t){var o=r.get();if(o.length){var a=this._config[t?"moveSpeedAccelerated":"moveSpeed"],s=$u[e](a);i.allowed("elements.move",{shapes:o})&&n.moveElements(o,s)}}}zu.$inject=["config.keyboardMoveSelection","keyboard","modeling","rules","selection"];var qu={__depends__:[da,Ho],__init__:["keyboardMoveSelection"],keyboardMoveSelection:["type",zu]};function Uu(e,t,n,i){e.on("element.changed",(function(i){var r=i.element;(r.parent||r===t.getRootElement())&&(i.gfx=n.getGraphics(r)),i.gfx&&e.fire(vt(r)+".changed",i)})),e.on("elements.changed",(function(t){var n=t.elements;n.forEach((function(t){e.fire("element.changed",{element:t})})),i.updateContainments(n)})),e.on("shape.changed",(function(e){i.update("shape",e.element,e.gfx)})),e.on("connection.changed",(function(e){i.update("connection",e.element,e.gfx)}))}Uu.$inject=["eventBus","canvas","elementRegistry","graphicsFactory"];var Gu={__init__:["changeSupport"],changeSupport:["type",Uu]};function Hu(e,t,n,i){this._dragging=i,this._rules=t;var r=this;function o(e,t){var n,i=e.shape,o=e.direction,a=e.resizeConstraints;e.delta=t,n=function(e,t,n){var i=n.x,r=n.y,o={x:e.x,y:e.y,width:e.width,height:e.height};return-1!==t.indexOf("n")?(o.y=e.y+r,o.height=e.height-r):-1!==t.indexOf("s")&&(o.height=e.height+r),-1!==t.indexOf("e")?o.width=e.width+i:-1!==t.indexOf("w")&&(o.x=e.x+i,o.width=e.width-i),o}(i,o,t),e.newBounds=function(e,t){if(!t)return e;var n=hn(e);return mn({top:Wp("top",n,t),right:Wp("right",n,t),bottom:Wp("bottom",n,t),left:Wp("left",n,t)})}(n,a),e.canExecute=r.canResize(e)}e.on("resize.start",(function(e){var t,n,i;t=e.context,n=t.resizeConstraints,i=t.minBounds,void 0===n&&(void 0===i&&(i=r.computeMinResizeBox(t)),t.resizeConstraints={min:hn(i)})})),e.on("resize.move",(function(e){var t={x:e.dx,y:e.dy};o(e.context,t)})),e.on("resize.end",(function(e){!function(e){var t=e.shape,i=e.canExecute,r=e.newBounds;if(i){if(!function(e,t){return e.x!==t.x||e.y!==t.y||e.width!==t.width||e.height!==t.height}(t,r=ln(r)))return;n.resizeShape(t,r)}}(e.context)}))}function Wu(e,t){var n=fn(e),i=hn(e),r={x:n.x,y:n.y};return-1!==t.indexOf("n")?r.y=i.top:-1!==t.indexOf("s")&&(r.y=i.bottom),-1!==t.indexOf("e")?r.x=i.right:-1!==t.indexOf("w")&&(r.x=i.left),r}function Ku(e){return"n"===e||"s"===e?"resize-ns":"e"===e||"w"===e?"resize-ew":"nw"===e||"se"===e?"resize-nwse":"resize-nesw"}Hu.prototype.canResize=function(e){var t=this._rules,n=G(e,["newBounds","shape","delta","direction"]);return t.allowed("shape.resize",n)},Hu.prototype.activate=function(e,t,n){var i,r,o=this._dragging;if("string"==typeof n&&(n={direction:n}),!(r=(i=U({shape:t},n)).direction))throw new Error("must provide a direction (n|w|s|e|nw|se|ne|sw)");o.init(e,Wu(t,r),"resize",{autoActivate:!0,cursor:Ku(r),data:{shape:t,context:i}})},Hu.prototype.computeMinResizeBox=function(e){var t=e.shape;return function(e,t,n,i){var r=hn(t),o={top:/n/.test(e)?r.bottom-n.height:r.top,left:/w/.test(e)?r.right-n.width:r.left,bottom:/s/.test(e)?r.top+n.height:r.bottom,right:/e/.test(e)?r.left+n.width:r.right},a=i?hn(i):o;return mn({top:Gp(o.top,a.top),left:Gp(o.left,a.left),bottom:Up(o.bottom,a.bottom),right:Up(o.right,a.right)})}(e.direction,t,e.minDimensions||{width:10,height:10},Yp(t,e.childrenBoxPadding))},Hu.$inject=["eventBus","rules","modeling","dragging"];var Xu="djs-resizing",Yu="resize-not-ok";function Ju(e,t,n){e.on("resize.move",500,(function(e){var i,r,o,a;i=e.context,r=i.shape,o=i.newBounds,(a=i.frame)||(a=i.frame=n.addFrame(r,t.getActiveLayer()),t.addMarker(r,Xu)),o.width>5&&Pe(a,{x:o.x,width:o.width}),o.height>5&&Pe(a,{y:o.y,height:o.height}),i.canExecute?Ae(a).remove(Yu):Ae(a).add(Yu)})),e.on("resize.cleanup",(function(e){var n,i;n=e.context,i=n.shape,n.frame&&ke(n.frame),t.removeMarker(i,Xu)}))}Ju.$inject=["eventBus","canvas","previewSupport"];var Zu=-6,Qu="djs-resizer",el=["n","w","s","e","nw","ne","se","sw"];function tl(e,t,n,i){this._resize=i,this._canvas=t;var r=this;e.on("selection.changed",(function(e){var t=e.newSelection;r.removeResizers(),1===t.length&&_(t,z(r.addResizer,r))})),e.on("shape.changed",(function(e){var t=e.element;n.isSelected(t)&&(r.removeResizers(),r.addResizer(t))}))}tl.prototype.makeDraggable=function(e,t,n){var i=this._resize;function r(t){ko(t)&&i.activate(t,e,n)}pe.bind(t,"mousedown",r),pe.bind(t,"touchstart",r)},tl.prototype._createResizer=function(e,t,n,i){var r=this._getResizersParent(),o=function(e){var t={x:0,y:0};-1!==e.indexOf("e")?t.x=6:-1!==e.indexOf("w")&&(t.x=Zu);-1!==e.indexOf("s")?t.y=6:-1!==e.indexOf("n")&&(t.y=Zu);return t}(i),a=Ne("g");Ae(a).add(Qu),Ae(a).add("djs-resizer-"+e.id),Ae(a).add("djs-resizer-"+i),Ee(r,a);var s=Ne("rect");Pe(s,{x:-2+o.x,y:-2+o.y,width:4,height:4}),Ae(s).add("djs-resizer-visual"),Ee(a,s);var c=Ne("rect");return Pe(c,{x:-10+o.x,y:-10+o.y,width:20,height:20}),Ae(c).add("djs-resizer-hit"),Ee(a,c),Xn(a,t,n),a},tl.prototype.createResizer=function(e,t){var n=Wu(e,t),i=this._createResizer(e,n.x,n.y,t);this.makeDraggable(e,i,t)},tl.prototype.addResizer=function(e){var t=this;this._resize.canResize({shape:e})&&_(el,(function(n){t.createResizer(e,n)}))},tl.prototype.removeResizers=function(){je(this._getResizersParent())},tl.prototype._getResizersParent=function(){return this._canvas.getLayer("resizers")},tl.$inject=["eventBus","canvas","selection","resize"];var nl={__depends__:[Ss,xs,Fc],__init__:["resize","resizePreview","resizeHandles"],resize:["type",Hu],resizePreview:["type",Ju],resizeHandles:["type",tl]};function il(e,t){var n=t.create("bpmn:CategoryValue"),i=t.create("bpmn:Category",{categoryValue:[n]});return wt(e.get("rootElements"),i),Br(i).$parent=e,Br(n).$parent=i,n}function rl(e,t,n,i,r,o,a){function s(e,t){(t||Qa(e,["bpmn:Task","bpmn:TextAnnotation","bpmn:Group"])||ol(e))&&i.activate(e)}this._bpmnFactory=t,this._canvas=n,this._modeling=r,this._textRenderer=a,i.registerProvider(this),e.on("element.dblclick",(function(e){s(e.element,!0)})),e.on(["autoPlace.start","canvas.viewbox.changing","drag.init","element.mousedown","popupMenu.open"],(function(e){i.isActive()&&i.complete()})),e.on(["commandStack.changed"],(function(e){i.isActive()&&i.cancel()})),e.on("directEditing.activate",(function(e){o.removeResizers()})),e.on("create.end",500,(function(e){var t=e.context,n=t.shape,i=e.context.canExecute;e.isTouch||i&&(t.hints&&!1===t.hints.createElementsBehavior||s(n))})),e.on("autoPlace.end",500,(function(e){s(e.shape)}))}function ol(e){return Dr(e,"bpmn:SubProcess")&&!Nr(e)}rl.$inject=["eventBus","bpmnFactory","canvas","directEditing","modeling","resizeHandles","textRenderer"],rl.prototype.activate=function(e){var t=Hr(e);if(void 0!==t){var n={text:t};U(n,this.getEditingBBox(e));var i={};return(Qa(e,["bpmn:Task","bpmn:Participant","bpmn:Lane","bpmn:CallActivity"])||ol(e))&&U(i,{centerVertically:!0}),vo(e)&&U(i,{autoResize:!0}),Dr(e,"bpmn:TextAnnotation")&&U(i,{resizable:!0,autoResize:!0}),U(n,{options:i}),n}},rl.prototype.getEditingBBox=function(e){var t=this._canvas,n=e.label||e,i=t.getAbsoluteBBox(n),r=i.x+i.width/2,o=i.y+i.height/2,a={x:i.x,y:i.y},s=t.zoom(),c=this._textRenderer.getDefaultStyle(),p=this._textRenderer.getExternalStyle(),u=p.fontSize*s,l=p.lineHeight,d=c.fontSize*s,h=c.lineHeight,m={fontFamily:this._textRenderer.getDefaultStyle().fontFamily,fontWeight:this._textRenderer.getDefaultStyle().fontWeight};(Dr(e,"bpmn:Lane")||function(e){return Dr(e,"bpmn:Participant")&&Nr(e)}(e))&&(U(a,{width:i.height,height:30*s,x:i.x-i.height/2+15*s,y:o-30*s/2}),U(m,{fontSize:d+"px",lineHeight:h,paddingTop:7*s+"px",paddingBottom:7*s+"px",paddingLeft:5*s+"px",paddingRight:5*s+"px",transform:"rotate(-90deg)"})),(Qa(e,["bpmn:Task","bpmn:CallActivity"])||function(e){return Dr(e,"bpmn:Participant")&&!Nr(e)}(e)||ol(e))&&(U(a,{width:i.width,height:i.height}),U(m,{fontSize:d+"px",lineHeight:h,paddingTop:7*s+"px",paddingBottom:7*s+"px",paddingLeft:5*s+"px",paddingRight:5*s+"px"})),function(e){return Dr(e,"bpmn:SubProcess")&&Nr(e)}(e)&&(U(a,{width:i.width,x:i.x}),U(m,{fontSize:d+"px",lineHeight:h,paddingTop:7*s+"px",paddingBottom:7*s+"px",paddingLeft:5*s+"px",paddingRight:5*s+"px"}));var f=90*s,v=7*s,y=4*s;if(n.labelTarget&&(U(a,{width:f,height:i.height+v+y,x:r-f/2,y:i.y-v}),U(m,{fontSize:u+"px",lineHeight:l,paddingTop:v+"px",paddingBottom:y+"px"})),vo(n)&&!yo(n)&&!xo(n)){var g=bo(e),b=t.getAbsoluteBBox({x:g.x,y:g.y,width:0,height:0}),x=u+v+y;U(a,{width:f,height:x,x:b.x-f/2,y:b.y-x/2}),U(m,{fontSize:u+"px",lineHeight:l,paddingTop:v+"px",paddingBottom:y+"px"})}return Dr(e,"bpmn:TextAnnotation")&&(U(a,{width:i.width,height:i.height,minWidth:30*s,minHeight:10*s}),U(m,{textAlign:"left",paddingTop:5*s+"px",paddingBottom:7*s+"px",paddingLeft:7*s+"px",paddingRight:5*s+"px",fontSize:d+"px",lineHeight:h})),{bounds:a,style:m}},rl.prototype.update=function(e,t,n,i){var r,o;if((Dr(e,"bpmn:TextAnnotation")&&(o=this._canvas.getAbsoluteBBox(e),r={x:e.x,y:e.y,width:e.width/o.width*i.width,height:e.height/o.height*i.height}),Dr(e,"bpmn:Group"))&&!Br(e).categoryValueRef){var a=il(Br(this._canvas.getRootElement()).$parent,this._bpmnFactory);Br(e).categoryValueRef=a}(function(e){return!e||!e.trim()})(t)&&(t=null),this._modeling.updateLabel(e,t,r)};var al="djs-element-hidden",sl="djs-label-hidden";function cl(e,t,n,i){var r,o,a,s=this,c=t.getDefaultLayer();e.on("directEditing.activate",(function(e){var n=e.active;if(Dr(r=n.element.label||n.element,"bpmn:TextAnnotation")){o=t.getAbsoluteBBox(r),a=Ne("g");var p=i.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:r.width,containerHeight:r.height,position:{mx:0,my:0}}),u=s.path=Ne("path");Pe(u,{d:p,strokeWidth:2,stroke:pl(r)}),Ee(a,u),Ee(c,a),Yn(a,r.x,r.y)}Dr(r,"bpmn:TextAnnotation")||r.labelTarget?t.addMarker(r,al):(Dr(r,"bpmn:Task")||Dr(r,"bpmn:CallActivity")||Dr(r,"bpmn:SubProcess")||Dr(r,"bpmn:Participant"))&&t.addMarker(r,sl)})),e.on("directEditing.resize",(function(e){if(Dr(r,"bpmn:TextAnnotation")){var t=e.height,n=e.dy,a=Math.max(r.height/o.height*(t+n),0),c=i.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:r.width,containerHeight:a,position:{mx:0,my:0}});Pe(s.path,{d:c})}})),e.on(["directEditing.complete","directEditing.cancel"],(function(e){var n=e.active;n&&(t.removeMarker(n.element.label||n.element,al),t.removeMarker(r,sl)),r=void 0,o=void 0,a&&(ke(a),a=void 0)}))}function pl(e,t){return Br(e).di.get("stroke")||t||"black"}cl.$inject=["eventBus","canvas","elementRegistry","pathMap"];var ul={__depends__:[Gu,nl,jc],__init__:["labelEditingProvider","labelEditingPreview"],labelEditingProvider:["type",rl],labelEditingPreview:["type",cl]},ll=["top","bottom","left","right"],dl=10;function hl(e,t){function n(e){if(yo(e)){var n=function(e){var t=fn(e.label),n=ml(fn(e),t);if(i=n,-1===ll.indexOf(i))return;var i;var r=function(e){var t=fn(e);return[].concat(e.incoming.map((function(e){return e.waypoints[e.waypoints.length-2]})),e.outgoing.map((function(e){return e.waypoints[1]}))).map((function(e){return ml(t,e)}))}(e);if(e.host){var o=function(e){var t,n=e.host,i=vn(fn(e),n);t=i.indexOf("-")>=0?i.split("-"):[i];return ll.filter((function(e){return-1===t.indexOf(e)}))}(e);r=r.concat(o)}var a=ll.filter((function(e){return-1===r.indexOf(e)}));if(-1!==a.indexOf(n))return;return a[0]}(e);n&&function(e,n){var i=fn(e),r=e.label,o=fn(r);if(!r.parent)return;var a,s=hn(e);switch(n){case"top":a={x:i.x,y:s.top-dl-r.height/2};break;case"left":a={x:s.left-dl-r.width/2,y:i.y};break;case"bottom":a={x:i.x,y:s.bottom+dl+r.height/2};break;case"right":a={x:s.right+dl+r.width/2,y:i.y}}var c=Ea(a,o);t.moveShape(r,c)}(e,n)}}as.call(this,e),this.postExecuted(["connection.create","connection.layout","connection.updateWaypoints"],(function(e){var t=e.context,i=t.connection,r=i.source,o=i.target;!1!==(t.hints||{}).createElementsBehavior&&(n(r),n(o))})),this.postExecuted(["label.create"],(function(e){var t=e.context,i=t.shape;!1!==(t.hints||{}).createElementsBehavior&&n(i.labelTarget)})),this.postExecuted(["elements.create"],(function(e){var t=e.context,i=t.elements;!1!==(t.hints||{}).createElementsBehavior&&i.forEach((function(e){n(e)}))}))}function ml(e,t){return vn(t,e,5)}function fl(e,t,n){as.call(this,e),this.preExecute("shape.append",(function(e){var t=e.source,n=e.shape;e.position||(Dr(n,"bpmn:TextAnnotation")?e.position={x:t.x+t.width/2+75,y:t.y-50-n.height/2}:e.position={x:t.x+t.width+80+n.width/2,y:t.y+t.height/2})}),!0)}function vl(e,t){e.invoke(as,this),this.postExecute("shape.move",(function(e){var n=e.newParent,i=e.shape;_(w(i.incoming.concat(i.outgoing),(function(e){return Dr(e,"bpmn:Association")})),(function(e){t.moveConnection(e,{x:0,y:0},n)}))}),!0)}i(hl,as),hl.$inject=["eventBus","modeling"],i(fl,as),fl.$inject=["eventBus","elementFactory","bpmnRules"],i(vl,as),vl.$inject=["injector","modeling"];function yl(e,t){t.invoke(as,this),this._bpmnReplace=e;var n=this;this.postExecuted("elements.create",500,(function(e){var t=e.elements;1===(t=t.filter((function(e){return gl(e,e.host)}))).length&&t.map((function(e){return t.indexOf(e)})).forEach((function(i){var r=t[i];e.elements[i]=n.replaceShape(t[i],r)}))}),!0),this.preExecute("elements.move",500,(function(e){var t=e.shapes,i=e.newHost;if(1===t.length){var r=t[0];gl(r,i)&&(e.shapes=[n.replaceShape(r,i)])}}),!0)}function gl(e,t){return!xo(e)&&Qa(e,["bpmn:IntermediateThrowEvent","bpmn:IntermediateCatchEvent"])&&!!t}yl.$inject=["bpmnReplace","injector"],i(yl,as),yl.prototype.replaceShape=function(e,t){var n,i=(n=Br(e).eventDefinitions)&&n[0],r={type:"bpmn:BoundaryEvent",host:t};return i&&(r.eventDefinitionType=i.$type),this._bpmnReplace.replaceElement(e,r,{layoutConnection:!1})};function bl(e,t,n){function i(e){return w(e.attachers,(function(e){return Dr(e,"bpmn:BoundaryEvent")}))}as.call(this,e),this.postExecute("connection.create",(function(e){var t=e.context.source,r=e.context.target,o=i(r);Dr(t,"bpmn:EventBasedGateway")&&Dr(r,"bpmn:ReceiveTask")&&o.length>0&&n.removeElements(o)})),this.postExecute("connection.reconnect",(function(e){var t=e.context.oldSource,r=e.context.newSource;Dr(t,"bpmn:Gateway")&&Dr(r,"bpmn:EventBasedGateway")&&_(r.outgoing,(function(e){var t=e.target,r=i(t);Dr(t,"bpmn:ReceiveTask")&&r.length>0&&n.removeElements(r)}))})),e.on("moddleCopy.canCopyProperty",2e3,(function(e){var n=e.parent,i=e.property,r=e.propertyName,o=t.getPropertyDescriptor(n,r);o&&o.isReference&&Dr(i,"bpmn:RootElement")&&n.set(r,i)}))}bl.$inject=["eventBus","moddle","modeling"],i(bl,as);function xl(e,t,n,i,r){function o(e){return Qa(e,["bpmn:ReceiveTask","bpmn:SendTask"])||function(e,t){h(t)||(t=[t]);return C(t,(function(t){return Vr(e,t)}))}(e,["bpmn:ErrorEventDefinition","bpmn:EscalationEventDefinition","bpmn:MessageEventDefinition","bpmn:SignalEventDefinition"])}function a(t){return!!x(e.getDefinitions().get("rootElements"),I({id:t.id}))}function s(e){return Dr(e,"bpmn:ErrorEventDefinition")?"errorRef":Dr(e,"bpmn:EscalationEventDefinition")?"escalationRef":Dr(e,"bpmn:MessageEventDefinition")?"messageRef":Dr(e,"bpmn:SignalEventDefinition")?"signalRef":void 0}function c(e){if(Qa(e,["bpmn:ReceiveTask","bpmn:SendTask"]))return e.get("messageRef");var t=e.get("eventDefinitions")[0];return t.get(s(t))}n.invoke(as,this),this.executed("shape.create",(function(t){var n=t.shape;if(o(n)){var i=c(Br(n));i&&!a(i)&&(wt(e.getDefinitions().get("rootElements"),i),t.addedRootElement=i)}}),!0),this.reverted("shape.create",(function(t){var n=t.addedRootElement;n&&Et(e.getDefinitions().get("rootElements"),n)}),!0),t.on("copyPaste.copyElement",(function(e){var t=e.descriptor,n=e.element;if(o(n)){var i=c(Br(n));i&&(t.referencedRootElement=i)}})),t.on("copyPaste.pasteElement",500,(function(e){var t=e.descriptor,n=t.businessObject;if(o(n)){var c=t.referencedRootElement;c&&(a(c)||(c=i.copyElement(c,r.create(c.$type))),function(e,t){if(Qa(e,["bpmn:ReceiveTask","bpmn:SendTask"]))return e.set("messageRef",t);var n=e.get("eventDefinitions")[0];n.set(s(n),t)}(n,c))}}))}function El(e){e.invoke(as,this),this.preExecute("shape.create",1500,(function(e){var t=e.context,n=t.parent,i=t.shape;Dr(n,"bpmn:Lane")&&!Dr(i,"bpmn:Lane")&&(t.parent=es(n,"bpmn:Participant"))}))}xl.$inject=["bpmnjs","eventBus","injector","moddleCopy","bpmnFactory"],i(xl,as),El.$inject=["injector"],i(El,as);var wl=1500;function _l(e,t,n){t.on(["create.hover","create.move","create.out","create.end","shape.move.hover","shape.move.move","shape.move.out","shape.move.end"],wl,(function(t){var i=t.context.shape||t.shape,r=t.hover;Dr(r,"bpmn:Lane")&&!Qa(i,["bpmn:Lane","bpmn:Participant"])&&(t.hover=nu(r),t.hoverGfx=e.getGraphics(t.hover));var o=n.getRootElement();r!==o&&(i.labelTarget||Dr(i,"bpmn:Group"))&&(t.hover=o,t.hoverGfx=e.getGraphics(t.hover))})),t.on(["connect.hover","connect.out","connect.end","connect.cleanup","global-connect.hover","global-connect.out","global-connect.end","global-connect.cleanup"],wl,(function(t){var n=t.hover;Dr(n,"bpmn:Lane")&&(t.hover=nu(n)||n,t.hoverGfx=e.getGraphics(t.hover))})),t.on(["bendpoint.move.hover"],wl,(function(t){var n=t.context,i=t.hover,r=n.type;Dr(i,"bpmn:Lane")&&/reconnect/.test(r)&&(t.hover=nu(i)||i,t.hoverGfx=e.getGraphics(t.hover))})),t.on(["connect.start"],wl,(function(e){var t=e.context,n=t.start;Dr(n,"bpmn:Lane")&&(t.start=nu(n)||n)})),t.on("shape.move.start",2e3,(function(e){var t=e.shape;Dr(t,"bpmn:Lane")&&(e.shape=nu(t)||t)}))}function Pl(e,t,n){as.call(this,e),this.preExecute("shape.create",(function(e){var n=e.context.shape;if(Dr(n,"bpmn:DataObjectReference")&&"label"!==n.type){var i=t.create("bpmn:DataObject");n.businessObject.dataObjectRef=i}}))}_l.$inject=["elementRegistry","eventBus","canvas"],Pl.$inject=["eventBus","bpmnFactory","moddle"],i(Pl,as);var Sl=20,Ol=20,Cl=2e3;function Tl(e,t,n){function i(t){var i,r=t.parent,o=e.getRootElement();Dr(o,"bpmn:Collaboration")?i=o:(i=n.makeCollaboration(),t.process=r),t.parent=i}as.call(this,t),t.on(["create.start","shape.move.start"],Cl,(function(t){var n=t.context,i=n.shape,r=e.getRootElement();if(Dr(i,"bpmn:Participant")&&Dr(r,"bpmn:Process")&&r.children.length){var o=r.children.filter((function(e){return!Dr(e,"bpmn:Group")&&!xo(e)&&!function(e){return!!e.waypoints}(e)}));if(o.length){var a=ft(o);U(i,function(e,t){t={width:t.width+40+30,height:t.height+40};var n=Math.max(e.width,t.width),i=Math.max(e.height,t.height);return{x:-n/2,y:-i/2,width:n,height:i}}(i,a)),n.createConstraints=function(e,t){return{bottom:(t=hn(t)).top+e.height/2-Ol,left:t.right-e.width/2+Sl,top:t.bottom-e.height/2+Ol,right:t.left+e.width/2-Sl-30}}(i,a)}}})),t.on("create.start",Cl,(function(n){var i=n.context.shape,r=e.getRootElement(),o=e.getGraphics(r);function a(e){e.element=r,e.gfx=o}Dr(i,"bpmn:Participant")&&Dr(r,"bpmn:Process")&&(t.on("element.hover",Cl,a),t.once("create.cleanup",(function(){t.off("element.hover",a)})))})),this.preExecute("shape.create",(function(e){var t=e.parent;Dr(e.shape,"bpmn:Participant")&&Dr(t,"bpmn:Process")&&i(e)}),!0),this.execute("shape.create",(function(e){var t=e.process,n=e.shape;t&&(e.oldProcessRef=n.businessObject.processRef,n.businessObject.processRef=t.businessObject)}),!0),this.revert("shape.create",(function(e){var t=e.process,n=e.shape;t&&(n.businessObject.processRef=e.oldProcessRef)}),!0),this.postExecute("shape.create",(function(e){var t=e.process,i=e.shape;if(t){var r=t.children.slice();n.moveElements(r,{x:0,y:0},i)}}),!0),this.preExecute("elements.create",Cl,(function(e){var t,n=e.elements,r=e.parent;Al(n)&&Dr(r,"bpmn:Process")&&(i(e),t=Al(n),e.oldProcessRef=t.businessObject.processRef,t.businessObject.processRef=r.businessObject)}),!0),this.revert("elements.create",(function(e){var t=e.elements;e.process&&(Al(t).businessObject.processRef=e.oldProcessRef)}),!0),this.postExecute("elements.create",(function(e){var t,i=e.elements,r=e.process;if(r){t=Al(i);var o=r.children.slice();n.moveElements(o,{x:0,y:0},t)}}),!0)}function Al(e){return x(e,(function(e){return Dr(e,"bpmn:Participant")}))}Tl.$inject=["canvas","eventBus","modeling"],i(Tl,as);var Rl="__targetRef_placeholder";function kl(e,t){function n(e,n){var i=e.get("properties"),r=x(i,(function(e){return e.name===Rl}));return!r&&n&&wt(i,r=t.create("bpmn:Property",{name:Rl})),r}function i(e,t){var i=n(e);i&&(function(e,t,n){return x(e.get("dataInputAssociations"),(function(e){return e!==n&&e.targetRef===t}))}(e,i,t)||Et(e.get("properties"),i))}function r(e){var t,r=e.context,o=r.connection,a=o.businessObject,s=o.target,c=s&&s.businessObject,p=r.newTarget,u=p&&p.businessObject,l=r.oldTarget||r.target,d=l&&l.businessObject,h=o.businessObject;d&&d!==c&&i(d,a),u&&u!==c&&i(u,a),c?(t=n(c,!0),h.targetRef=t):h.targetRef=null}as.call(this,e),this.executed(["connection.create","connection.delete","connection.move","connection.reconnect"],jl(r)),this.reverted(["connection.create","connection.delete","connection.move","connection.reconnect"],jl(r))}function jl(e){return function(t){if(Dr(t.context.connection,"bpmn:DataInputAssociation"))return e(t)}}function Ml(e){this._bpmnUpdater=e}function Dl(e,t,n,i){function r(e){return e.children.filter((function(e){return Dr(e,"bpmn:DataStoreReference")&&!e.labelTarget}))}function o(e,i){var r=e.businessObject||e;if(i=i||n.filter((function(e){return Dr(e,"bpmn:Participant")&&Br(e).processRef}))[0]){var o=i.businessObject||i;t.execute("dataStore.updateContainment",{dataStoreBo:r,newSemanticParent:o.processRef||o,newDiParent:o.di})}}as.call(this,i),t.registerHandler("dataStore.updateContainment",Ml),this.preExecute("shape.create",(function(e){var t=e.context,n=t.shape;Dr(n,"bpmn:DataStoreReference")&&"label"!==n.type&&(t.hints||(t.hints={}),t.hints.autoResize=!1)})),this.preExecute("elements.move",(function(e){var t=e.context,n=t.shapes;n.filter((function(e){return Dr(e,"bpmn:DataStoreReference")})).length&&(t.hints||(t.hints={}),t.hints.autoResize=n.filter((function(e){return!Dr(e,"bpmn:DataStoreReference")})))})),this.postExecute("shape.create",(function(e){var t=e.context.shape,n=t.parent;Dr(t,"bpmn:DataStoreReference")&&"label"!==t.type&&Dr(n,"bpmn:Collaboration")&&o(t)})),this.postExecute("shape.move",(function(e){var t=e.context,n=t.shape,i=t.oldParent,r=n.parent;Dr(i,"bpmn:Collaboration")||Dr(n,"bpmn:DataStoreReference")&&"label"!==n.type&&Dr(r,"bpmn:Collaboration")&&o(n,Dr(i,"bpmn:Participant")?i:function(e,t){for(;e.parent;){if(Dr(e.parent,t))return e.parent;e=e.parent}}(i,"bpmn:Participant"))})),this.postExecute("shape.delete",(function(t){var n=t.context.shape,i=e.getRootElement();Qa(n,["bpmn:Participant","bpmn:SubProcess"])&&Dr(i,"bpmn:Collaboration")&&r(i).filter((function(e){return function(e,t){var n=e.businessObject||e,i=t.businessObject||t;for(;n.$parent;){if(n.$parent===i.processRef||i)return!0;n=n.$parent}return!1}(e,n)})).forEach((function(e){o(e)}))})),this.postExecute("canvas.updateRoot",(function(e){var t=e.context,n=t.oldRoot,i=t.newRoot;r(n).forEach((function(e){Dr(i,"bpmn:Process")&&o(e,i)}))}))}kl.$inject=["eventBus","bpmnFactory"],i(kl,as),Ml.$inject=["bpmnUpdater"],Ml.prototype.execute=function(e){var t=e.dataStoreBo,n=e.newSemanticParent,i=e.newDiParent;e.oldSemanticParent=t.$parent,e.oldDiParent=t.di.$parent,this._bpmnUpdater.updateSemanticParent(t,n),this._bpmnUpdater.updateDiParent(t.di,i)},Ml.prototype.revert=function(e){var t=e.dataStoreBo,n=e.oldSemanticParent,i=e.oldDiParent;this._bpmnUpdater.updateSemanticParent(t,n),this._bpmnUpdater.updateDiParent(t.di,i)},Dl.$inject=["canvas","commandStack","elementRegistry","eventBus"],i(Dl,as);function Bl(e,t,n){as.call(this,e),this.postExecuted("shape.delete",500,(function(e){var t=e.context,i=t.hints,r=t.shape,o=t.oldParent;Dr(r,"bpmn:Lane")&&(i&&i.nested||function(e,t){var i,r,o,a=tu(t),s=[],c=[];ht(a,(function(t){return t.y>e.y?c.push(t):s.push(t),t.children})),a.length&&(i=c.length&&s.length?e.height/2:e.height,s.length&&(r=n.calculateAdjustments(s,"y",i,e.y-10),n.makeSpace(r.movingShapes,r.resizingShapes,{x:0,y:i},"s")),c.length&&(o=n.calculateAdjustments(c,"y",-i,e.y+e.height+10),n.makeSpace(o.movingShapes,o.resizingShapes,{x:0,y:-i},"n")))}(r,o))}))}Bl.$inject=["eventBus","modeling","spaceTool"],i(Bl,as);function Il(e,t){t.invoke(as,this),this._bpmnReplace=e;var n=this;this.postExecuted("elements.create",500,(function(e){var t=e.elements;t.filter((function(e){return Nl(e,e.host)})).map((function(e){return t.indexOf(e)})).forEach((function(i){e.elements[i]=n.replaceShape(t[i])}))}),!0),this.preExecute("elements.move",500,(function(e){var t=e.shapes,i=e.newHost;t.forEach((function(e,r){var o,a=e.host;Nl(e,(o=a,-1!==t.indexOf(o)?a:i))&&(t[r]=n.replaceShape(e))}))}),!0)}function Nl(e,t){return!xo(e)&&Dr(e,"bpmn:BoundaryEvent")&&!t}function Ll(e,t,n){function i(e,i,r){var o,a,s,c,p,u,l,d,h=i.waypoints,m=e.outgoing.slice(),v=e.incoming.slice(),y=Ts(h,d=f(r.width)?fn(r):r);if(y){if(o=h.slice(0,y.index),a=h.slice(y.index+(y.bendpoint?1:0)),!o.length||!a.length)return;s=y.bendpoint?h[y.index]:d,Fl(e,o[o.length-1])||o.push(Vl(s)),Fl(e,a[0])||a.unshift(Vl(s))}c=i.source,p=i.target,t.canConnect(c,e,i)&&(n.reconnectEnd(i,e,o||d),u=i),t.canConnect(e,p,i)&&(u?l=n.connect(e,p,{type:i.type,waypoints:a}):(n.reconnectStart(i,e,a||d),l=i));var g=[].concat(u&&w(v,(function(e){return e.source===u.source}))||[],l&&w(m,(function(e){return e.target===l.target}))||[]);g.length&&n.removeElements(g)}as.call(this,e),this.preExecute("elements.move",(function(e){var n=e.newParent,i=e.shapes,r=e.delta,o=i[0];if(o&&n){n&&n.waypoints&&(e.newParent=n=n.parent);var a=fn(o),s={x:a.x+r.x,y:a.y+r.y},c=x(n.children,(function(e){return t.canInsert(i,e)&&Ts(e.waypoints,s)}));c&&(e.targetFlow=c,e.position=s)}}),!0),this.postExecuted("elements.move",(function(e){var t=e.shapes,n=e.targetFlow,r=e.position;n&&i(t[0],n,r)}),!0),this.preExecute("shape.create",(function(e){var n=e.parent,i=e.shape;t.canInsert(i,n)&&(e.targetFlow=n,e.parent=n.parent)}),!0),this.postExecuted("shape.create",(function(e){var t=e.shape,n=e.targetFlow,r=e.position;n&&i(t,n,r)}),!0)}function Fl(e,t){var n=t.x,i=t.y;return n>=e.x&&n<=e.x+e.width&&i>=e.y&&i<=e.y+e.height}function Vl(e){return U({},e)}function $l(e,t){as.call(this,e),this.preExecuted("connection.create",(function(e){var n=e.context,i=n.source,r=n.target,o=r.incoming.slice();n.hints&&!1===n.hints.createElementsBehavior||Dr(i,"bpmn:EventBasedGateway")&&r.incoming.length&&o.filter(zl).forEach((function(e){t.removeConnection(e)}))})),this.preExecuted("shape.replace",(function(e){var n=e.context.newShape;Dr(n,"bpmn:EventBasedGateway")&&n.outgoing.filter(zl).map((function(e){return e.target})).reduce((function(e,t){var n=t.incoming.filter(zl);return e.concat(n)}),[]).forEach((function(e){e.source!==n&&t.removeConnection(e)}))}))}function zl(e){return Dr(e,"bpmn:SequenceFlow")}Il.$inject=["bpmnReplace","injector"],i(Il,as),Il.prototype.replaceShape=function(e){var t,n,i=(n=Br(e).eventDefinitions)&&n[0];return t=i?{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:i.$type}:{type:"bpmn:IntermediateThrowEvent"},this._bpmnReplace.replaceElement(e,t,{layoutConnection:!1})},i(Ll,as),Ll.$inject=["eventBus","bpmnRules","modeling"],$l.$inject=["eventBus","modeling"],i($l,as);function ql(e,t,n,i,r,o){function a(){return Br(t.getRootElement()).$parent}function s(e){var t=Br(e).categoryValueRef;if(t){var n=t.$parent;t&&(Et(n.categoryValue,t),n&&!n.categoryValue.length&&function(e){Et(a().get("rootElements"),e)}(n))}}r.invoke(as,this),this.executed("shape.delete",(function(e){var t,i=e.context.shape;if(Dr(i,"bpmn:Group")){var r=Br(i).categoryValueRef,o=n.filter((function(e){return Dr(e,"bpmn:Group")}));t=r,o.some((function(e){var n=Br(e);return n.categoryValueRef&&n.categoryValueRef===t}))||s(i)}})),this.reverted("shape.delete",(function(e){var t=e.context.shape;if(Dr(t,"bpmn:Group")){var n=Br(t).categoryValueRef,i=a(),r=n?n.$parent:null;wt(r.get("categoryValue"),n),wt(i.get("rootElements"),r)}})),this.execute("shape.create",(function(t){var n=Br(t.context.shape);if(Dr(n,"bpmn:Group")&&!n.categoryValueRef){var i=il(a(),e);n.categoryValueRef=i}})),this.revert("shape.create",(function(e){var t=e.context.shape;Dr(t,"bpmn:Group")&&(s(t),delete Br(t).categoryValueRef)})),i.on("moddleCopy.canCopyProperty",2e3,(function(t){var n,i=t.property;if(Dr(i,"bpmn:CategoryValue"))return n=il(a(),e),o.copyElement(i,n)}))}function Ul(e,t,n,i){var r,o,a,s;return 0==(r=(i.y-n.y)*(t.x-e.x)-(i.x-n.x)*(t.y-e.y))?null:(o=e.y-n.y,a=e.x-n.x,s=((i.x-n.x)*o-(i.y-n.y)*a)/r,{x:Math.round(e.x+s*(t.x-e.x)),y:Math.round(e.y+s*(t.y-e.y))})}function Gl(e){function t(e,t,n){var i,r={x:n.x,y:n.y-50},o={x:n.x-50,y:n.y},a=Ul(e,t,n,r),s=Ul(e,t,n,o);i=a&&s?Hl(a,n)>Hl(s,n)?s:a:a||s,e.original=i}e.on("bpmnElement.added",(function(e){var n,i,r=e.element;r.waypoints&&(t((i=(n=r).waypoints)[0],i[1],fn(n.source)),t(i[i.length-1],i[i.length-2],fn(n.target)))}))}function Hl(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Wl(e){as.call(this,e);var t=["bpmn:Participant","bpmn:Lane"];this.executed(["shape.move","shape.create","shape.resize"],(function(e){var n=Br(e.context.shape);Qa(n,t)&&!n.di.get("isHorizontal")&&n.di.set("isHorizontal",!0)}))}function Kl(e){return Math.sqrt(Math.pow(e.x,2)+Math.pow(e.y,2))}function Xl(e){return Math.atan((e[1].y-e[0].y)/(e[1].x-e[0].x))}function Yl(e,t){var n=t[0],i=t[1],r={x:i.x-n.x,y:i.y-n.y},o=function(e,t,n){var i=[{n:e[0]-n[0],lambda:t[0]},{n:e[1]-n[1],lambda:t[1]}];return-(i[0].n*t[0]+i[1].n*t[1])/(i[0].lambda*t[0]+i[1].lambda*t[1])}([n.x,n.y],[r.x,r.y],[e.x,e.y]);return{x:n.x+o*r.x,y:n.y+o*r.y}}function Jl(e,t){var n=Yl(e,t);return Kl({x:n.x-e.x,y:n.y-e.y})}function Zl(e,t){return Kl({x:e.x-t.x,y:e.y-t.y})}ql.$inject=["bpmnFactory","canvas","elementRegistry","eventBus","injector","moddleCopy"],i(ql,as),Gl.$inject=["eventBus"],Wl.$inject=["eventBus"],i(Wl,as);var Ql=Math.sqrt,ed=Math.min,td=Math.max,nd=Math.abs;function id(e){return Math.pow(e,2)}function rd(e,t){return Ql(id(e.x-t.x)+id(e.y-t.y))}function od(e,t,n,i){var r=t.x-e.x,o=t.y-e.y,a=n.x-e.x,s=n.y-e.y,c=r*r+o*o,p=(r*a+o*s)/c,u=p*p-(a*a+s*s-i*i)/c;if(u<0&&u>-1e-6&&(u=0),u<0)return[];var l=Ql(u),d=-p+l,h=-p-l,m={x:e.x-r*d,y:e.y-o*d};return 0===u?[m]:[m,{x:e.x-r*h,y:e.y-o*h}].filter((function(n){return function(e,t,n){return ad(e.x,t.x,n.x)&&ad(e.y,t.y,n.y)}(n,e,t)}))}function ad(e,t,n){return e>=ed(t,n)-sd&&e<=td(t,n)+sd}var sd=.1;function cd(e,t){return nd(e.x-t.x)<=sd&&nd(e.y-t.y)<=sd}function pd(e,t,n,i){var r=0,o=0,a=function(e){return{x:e.x+e.width/2,y:e.y+e.height/2}}(e),s=function(e,t){var n,i,r,o,a,s,c,p,u,l,d,h,m=0;for(m=0;m<t.length-1;m++){if(cd(n=t[m],i=t[m+1])?s=[n]:(r=rd(e,n),o=rd(e,i),s=od(n,i,e,ed(r,o))),s.length<1)throw new Error("expected between [1, 2] circle -> line intersections");1===s.length&&(c={type:"bendpoint",position:s[0],segmentIndex:m,bendpointIndex:cd(n,s[0])?m:m+1}),2===s.length&&(d=s[0],h=s[1],c={type:"segment",position:a={x:(d.x+h.x)/2,y:(d.y+h.y)/2},segmentIndex:m,relativeLocation:rd(n,a)/rd(n,i)}),p=rd(c.position,e),(!l||u>p)&&(l=c,u=p)}return l}(a,n),c=s.segmentIndex,p=function(e,t,n,i){var r=n.segmentIndex,o=t.length-e.length;if(i.segmentMove){var a=i.segmentMove.segmentStartIndex,s=i.segmentMove.newSegmentStartIndex;return r===a?s:r>=s?r+o<s?s:r+o:r}if(i.bendpointMove){var c,p=i.bendpointMove.insert,u=i.bendpointMove.bendpointIndex;return 0===o?r:(r>=u&&(c=p?r+1:r-1),r<u&&(c=r,p&&"bendpoint"!==n.type&&u-1===r&&ud(t,u)<n.relativeLocation&&c++),c)}return 0===o?r:i.connectionStart?0===r?0:null:i.connectionEnd&&r===e.length-2?t.length-2:null}(n,t,s,i);if(null===p)return{x:r,y:o};if(p<0||p>t.length-2)return{x:r,y:o};var u,l,d=ld(n,c),h=ld(t,p),m=s.position,f=function(e,t){var n=Zl(e[0],e[1]),i=Zl(e[0],t);return 0===n?0:i/n}(d,m),v=(u=h,l=Xl(d),Xl(u)-l);if("bendpoint"===s.type){var y=t.length-n.length,g=s.bendpointIndex,b=n[g];if(-1!==t.indexOf(b))return{x:r,y:o};if(0===y){var x=t[g];return{x:x.x-s.position.x,y:x.y-s.position.y}}y<0&&0!==g&&g<n.length-1&&(f=ud(n,g))}var E,w,_=(h[1].x-h[0].x)*f+h[0].x,P=(h[1].y-h[0].y)*f+h[0].y,S=(E={x:a.x-m.x,y:a.y-m.y},(w=v)?{x:Math.cos(w)*E.x-Math.sin(w)*E.y,y:Math.sin(w)*E.x+Math.cos(w)*E.y}:E);return dn({x:r=_+S.x-a.x,y:o=P+S.y-a.y})}function ud(e,t){var n=Zl(e[t-1],e[t]);return n/(n+Zl(e[t],e[t+1]))}function ld(e,t){return[e[t],e[t+1]]}function dd(e,t,n){var i=xa(t),r=xa(n),o=Ea(e,i),a=o.x*(n.width/t.width),s=o.y*(n.height/t.height);return dn({x:r.x+a,y:r.y+s})}function hd(e,t,n){var i=xa(e),r=xa(t),o=xa(n),a=Ea(e,i),s=Ea(i,r),c=function(e,t,n){var i=hn(t),r=hn(n);if(function(e,t){return function(e,t){return e.right!==t.right&&e.left!==t.left}(e,t)||function(e,t){return e.top!==t.top&&e.bottom!==t.bottom}(e,t)}(i,r))return null;var o,a,s=vn(t,e);if("top"===s)o={x:0,y:r.bottom-i.bottom};else if("bottom"===s)o={x:0,y:r.top-i.top};else if("right"===s)o={x:r.left-i.left,y:0};else{if("left"!==s)return null;o={x:r.right-i.right,y:0}}if(a={x:e.x+o.x,y:e.y+o.y},vn(n,a)!==s)return null;return o}(i,t,n);if(c)return c;var p=s.x*(n.width/t.width),u=s.y*(n.height/t.height),l=o.x+p,d=o.y+u;return dn({x:l+a.x-e.x,y:d+a.y-e.y})}var md={width:90,height:20},fd="name",vd="text";function yd(e,t,n,i){as.call(this,e),this.postExecute("element.updateProperties",(function(e){var n=e.context,r=n.element,o=n.properties;if(fd in o&&t.updateLabel(r,o.name),vd in o&&Dr(r,"bpmn:TextAnnotation")){var a=i.getTextAnnotationBounds({x:r.x,y:r.y,width:r.width,height:r.height},o.text||"");t.updateLabel(r,o.text,a)}})),this.postExecute(["shape.create","connection.create"],(function(e){var n=e.context;if(!1!==(n.hints||{}).createElementsBehavior){var r=n.shape||n.connection,o=r.businessObject;if(!xo(r)&&vo(r)&&Hr(r)){var a=bo(r),s=i.getExternalLabelBounds(md,Hr(r));t.createLabel(r,a,{id:o.id+"_label",businessObject:o,width:s.width,height:s.height})}}})),this.postExecute("shape.delete",(function(e){var n=e.context,i=n.labelTarget,r=n.hints||{};i&&!1!==r.unsetLabel&&t.updateLabel(i,null,null,{removeShape:!1})})),this.postExecute(["label.create"],(function(e){var t,i=e.context.shape;i.labelTarget&&Dr(i.labelTarget||i,"bpmn:BaseElement")&&((t=i.businessObject.di).label||(t.label=n.create("bpmndi:BPMNLabel",{bounds:n.create("dc:Bounds")})),U(t.label.bounds,{x:i.x,y:i.y,width:i.width,height:i.height}))})),this.postExecute(["connection.layout","connection.updateWaypoints"],(function(e){var n=e.context;if(!1!==(n.hints||{}).labelBehavior){var i,r=n.connection.label;r&&r.parent&&(i=function(e){var t=e.context,n=t.connection,i=n.label,r=U({},t.hints),o=t.newWaypoints||n.waypoints,a=t.oldWaypoints;return void 0===r.startChanged&&(r.startChanged=!!r.connectionStart),void 0===r.endChanged&&(r.endChanged=!!r.connectionEnd),pd(i,o,a,r)}(e),t.moveShape(r,i))}})),this.postExecute(["shape.replace"],(function(e){var t=e.context,n=t.newShape,i=t.oldShape,r=Br(n);r&&vo(r)&&i.label&&n.label&&(n.label.x=i.label.x,n.label.y=i.label.y)})),this.postExecute("shape.resize",(function(e){var n,i=e.context,r=i.shape,o=i.newBounds,a=i.oldBounds;if(yo(r)){var s=r.label,c=gd(function(e,t){if(!t.length)return;var n=function(e,t){return B(t.map((function(t){return{line:t,distance:Jl(e,t)}})),"distance")[0].line}(e,t);return Yl(e,n)}(fn(s),[[{x:(n=a).x,y:n.y},{x:n.x+(n.width||0),y:n.y}],[{x:n.x+(n.width||0),y:n.y},{x:n.x+(n.width||0),y:n.y+(n.height||0)}],[{x:n.x,y:n.y+(n.height||0)},{x:n.x+(n.width||0),y:n.y+(n.height||0)}],[{x:n.x,y:n.y},{x:n.x,y:n.y+(n.height||0)}]]),a,o);t.moveShape(s,c)}}))}function gd(e,t,n){return dn(Ea(dd(e,t,n),e))}function bd(e,t,n){var i=Pd(e),r=Sd(i,t),o=i[0];return r.length?r[r.length-1]:dd(o.original||o,n,t)}function xd(e,t,n){var i=Pd(e),r=Sd(i,t),o=i[i.length-1];return r.length?r[0]:dd(o.original||o,n,t)}function Ed(e,t,n){var i=Pd(e),r=_d(t,n),o=i[0];return dd(o.original||o,r,t)}function wd(e,t,n){var i=Pd(e),r=_d(t,n),o=i[i.length-1];return dd(o.original||o,r,t)}function _d(e,t){return{x:e.x-t.x,y:e.y-t.y,width:e.width,height:e.height}}function Pd(e){var t=e.waypoints;if(!t.length)throw new Error("connection#"+e.id+": no waypoints");return t}function Sd(e,t){return w(T(e,Od),(function(e){return function(e,t){return"intersect"===vn(t,e,1)}(e,t)}))}function Od(e){return e.original||e}function Cd(e,t){as.call(this,e),this.postExecute("shape.replace",(function(e){var n=e.oldShape,i=e.newShape;if(function(e,t){return Dr(e,"bpmn:Participant")&&Nr(e)&&Dr(t,"bpmn:Participant")&&!Nr(t)}(n,i)){var r=function(e){var t=mt([e],!1),n=[],i=[];return t.forEach((function(t){t!==e&&(t.incoming.forEach((function(e){Dr(e,"bpmn:MessageFlow")&&n.push(e)})),t.outgoing.forEach((function(e){Dr(e,"bpmn:MessageFlow")&&i.push(e)})))}),[]),{incoming:n,outgoing:i}}(n);r.incoming.forEach((function(e){var r=xd(e,i,n);t.reconnectEnd(e,i,r)})),r.outgoing.forEach((function(e){var r=bd(e,i,n);t.reconnectStart(e,i,r)}))}}),!0)}i(yd,as),yd.$inject=["eventBus","modeling","bpmnFactory","textRenderer"],Cd.$inject=["eventBus","modeling"],i(Cd,as);function Td(e,t,n){e.on(["shape.move.rejected","create.rejected"],(function(e){var i,r,o,a=e.context,s=a.shape;Dr(a.target,"bpmn:Collaboration")&&Dr(s,"bpmn:FlowNode")&&(i=e,r=n("flow elements must be children of pools/participants"),t.add({position:{x:i.x+5,y:i.y+5},type:"error",timeout:o||2e3,html:"<div>"+r+"</div>"}))}))}function Ad(e,t,n,i){as.call(this,e);var r=i.get("dragging",!1);function o(e){var i,r,o=e.source,a=e.target;e.parent&&(Dr(e,"bpmn:SequenceFlow")&&(n.canConnectSequenceFlow(o,a)||(r=!0),n.canConnectMessageFlow(o,a)&&(i="bpmn:MessageFlow")),Dr(e,"bpmn:MessageFlow")&&(n.canConnectMessageFlow(o,a)||(r=!0),n.canConnectSequenceFlow(o,a)&&(i="bpmn:SequenceFlow")),Dr(e,"bpmn:Association")&&!n.canConnectAssociation(o,a)&&(r=!0),r&&t.removeConnection(e),i&&t.connect(o,a,{type:i,waypoints:e.waypoints.slice()}))}this.postExecuted("elements.move",(function(e){_(e.closure.allConnections,o)}),!0),this.preExecute("connection.reconnect",(function(e){var i,o,a=e.context,s=a.connection,c=a.newSource||s.source,p=a.newTarget||s.target;(i=n.canConnect(c,p))&&i.type!==s.type&&(o=t.connect(c,p,{type:i.type,waypoints:s.waypoints.slice()}),t.removeConnection(s),a.connection=o,r&&function(e,t){var n,i=r.context(),o=i&&i.payload.previousSelection;if(!o||!o.length)return;if(-1===(n=o.indexOf(e)))return;o.splice(n,1,t)}(s,o))})),this.postExecuted("element.updateProperties",(function(e){var n,i=e.context,r=i.properties,o=i.element,a=o.businessObject;r.default&&(n=x(o.outgoing,I({id:o.businessObject.default.id})))&&t.updateProperties(n,{conditionExpression:void 0}),r.conditionExpression&&a.sourceRef.default===a&&t.updateProperties(o.source,{default:void 0})}))}function Rd(e,t){as.call(this,e),this.preExecute("shape.delete",(function(e){var t=e.shape,n=t.parent;Dr(t,"bpmn:Participant")&&(e.collaborationRoot=n)}),!0),this.postExecute("shape.delete",(function(e){var n=e.collaborationRoot;n&&!n.businessObject.participants.length&&t.makeProcess()}),!0)}function kd(e,t,n,i,r,o){i.invoke(as,this),this._bpmnReplace=e,this._elementRegistry=n,this._selection=o,this.postExecuted(["elements.create"],500,(function(e){var n=e.context,i=n.parent,r=n.elements,o=t.canReplace(r,i);o&&this.replaceElements(r,o.replacements)}),this),this.postExecuted(["elements.move"],500,(function(e){var n=e.context,i=n.newParent,r=n.newHost,o=[];_(n.closure.topLevel,(function(e){o=Fr(e)?o.concat(e.children):o.concat(e)})),1===o.length&&r&&(i=r);var a=t.canReplace(o,i);a&&this.replaceElements(o,a.replacements,r)}),this),this.postExecute(["shape.replace"],1500,(function(e){var n,i=e.context,r=i.oldShape,o=i.newShape,a=r.attachers;a&&a.length&&(n=t.canReplace(a,o),this.replaceElements(a,n.replacements))}),this),this.postExecuted(["shape.replace"],1500,(function(e){var t=e.context,n=t.oldShape,i=t.newShape;r.unclaimId(n.businessObject.id,n.businessObject),r.updateProperties(i,{id:n.id})}))}Td.$inject=["eventBus","tooltips","translate"],i(Ad,as),Ad.$inject=["eventBus","modeling","bpmnRules","injector"],Rd.$inject=["eventBus","modeling"],i(Rd,as),i(kd,as),kd.prototype.replaceElements=function(e,t){var n=this._elementRegistry,i=this._bpmnReplace,r=this._selection;_(t,(function(t){var r={type:t.newElementType},o=n.get(t.oldElementId),a=e.indexOf(o);e[a]=i.replaceElement(o,r,{select:!1})})),t&&r.select(e)},kd.$inject=["bpmnReplace","bpmnRules","elementRegistry","injector","modeling","selection"];var jd=300,Md=60,Dd={width:300,height:150},Bd={width:140,height:120},Id={width:50,height:30};function Nd(e){e.on("resize.start",1500,(function(e){var t=e.context,n=t.shape,i=t.direction,r=t.balanced;(Dr(n,"bpmn:Lane")||Dr(n,"bpmn:Participant"))&&(t.resizeConstraints=function(e,t,n){var i=nu(e),r=!0,o=!0,a=eu(i,[i]),s=hn(e),c={},p={};/e/.test(t)?p.right=s.left+jd:/w/.test(t)&&(p.left=s.right-jd);return a.forEach((function(e){var i=hn(e);/n/.test(t)&&(i.top<s.top-10&&(r=!1),n&&Ld(s.top-i.bottom)<10&&qd(c,"top",i.top+Md),Ld(s.top-i.top)<5&&zd(p,"top",i.bottom-Md)),/s/.test(t)&&(i.bottom>s.bottom+10&&(o=!1),n&&Ld(s.bottom-i.top)<10&&zd(c,"bottom",i.bottom-Md),Ld(s.bottom-i.bottom)<5&&qd(p,"bottom",i.top+Md))})),i.children.filter((function(e){return!e.hidden&&!e.waypoints&&(Dr(e,"bpmn:FlowElement")||Dr(e,"bpmn:Artifact"))})).forEach((function(e){var n=hn(e);r&&/n/.test(t)&&zd(p,"top",n.top-20),/e/.test(t)&&qd(p,"right",n.right+20),o&&/s/.test(t)&&qd(p,"bottom",n.bottom+20),/w/.test(t)&&zd(p,"left",n.left-50)})),{min:p,max:c}}(n,i,r)),Dr(n,"bpmn:Participant")&&(t.minDimensions=Dd),Dr(n,"bpmn:SubProcess")&&Nr(n)&&(t.minDimensions=Bd),Dr(n,"bpmn:TextAnnotation")&&(t.minDimensions=Id)}))}Nd.$inject=["eventBus"];var Ld=Math.abs,Fd=Math.min,Vd=Math.max;function $d(e,t,n,i){var r=e[t];e[t]=void 0===r?n:i(n,r)}function zd(e,t,n){return $d(e,t,n,Fd)}function qd(e,t,n){return $d(e,t,n,Vd)}function Ud(e,t){e.on("resize.start",1501,(function(e){var t=e.context,n=t.shape;(Dr(n,"bpmn:Lane")||Dr(n,"bpmn:Participant"))&&(t.balanced=!jo(e))})),e.on("resize.end",1001,(function(e){var n=e.context,i=n.shape,r=n.canExecute,o=n.newBounds;if(Dr(i,"bpmn:Lane")||Dr(i,"bpmn:Participant"))return r&&(o=ln(o),t.resizeLane(i,o,n.balanced)),!1}))}function Gd(e,t,n){as.call(this,e),this.preExecute("shape.delete",(function(e){var i=e.context.shape;if(1===i.incoming.length&&1===i.outgoing.length){var r=i.incoming[0],o=i.outgoing[0];if(Dr(r,"bpmn:SequenceFlow")&&Dr(o,"bpmn:SequenceFlow")&&t.canConnect(r.source,o.target,r)){var a=function(e,t){var n=Ul(Hd(e[e.length-2]),Hd(e[e.length-1]),Hd(t[1]),Hd(t[0]));return n?[].concat(e.slice(0,e.length-1),[n],t.slice(1)):[Hd(e[0]),Hd(t[t.length-1])]}(r.waypoints,o.waypoints);n.reconnectEnd(r,o.target,a)}}}))}function Hd(e){return e.original||e}Ud.$inject=["eventBus","modeling"],i(Gd,as),Gd.$inject=["eventBus","bpmnRules","modeling"];var Wd=Math.max;function Kd(e){e.on("spaceTool.getMinDimensions",(function(e){var t=e.shapes,n=e.axis,i=e.start,r={};return _(t,(function(e){var t=e.id;Dr(e,"bpmn:Participant")&&(!function(e){return"x"===e}(n)?r[t]={width:Dd.width,height:Xd(e,i)}:r[t]=Dd),Dr(e,"bpmn:SubProcess")&&Nr(e)&&(r[t]=Bd),Dr(e,"bpmn:TextAnnotation")&&(r[t]=Id)})),r}))}function Xd(e,t){var n;return tu(e).length?(n=function(e,t){var n,i=tu(e);return n=Yd(i,t),e.height-n.height+Md}(e,t),Wd(Dd.height,n)):Dd.height}function Yd(e,t){var n,i,r;for(n=0;n<e.length;n++)if(t>=(i=e[n]).y&&t<=i.y+i.height)return(r=tu(i)).length?Yd(r,t):i}function Jd(e,t){e.invoke(as,this),this.postExecuted("shape.replace",(function(e){var n=e.context.oldShape,i=e.context.newShape;if(Dr(i,"bpmn:SubProcess")&&Dr(n,"bpmn:Task")&&Nr(i)){var r,o={x:(r=i).x+r.width/6,y:r.y+r.height/2};t.createShape({type:"bpmn:StartEvent"},o,i)}}))}Kd.$inject=["eventBus"],Jd.$inject=["injector","modeling"],i(Jd,as);function Zd(e,t,n,i){as.call(this,e),this.executed(["shape.toggleCollapse"],500,(function(e){var t,n=e.context.shape;Dr(n,"bpmn:SubProcess")&&(n.collapsed?Br(n).di.isExpanded=!1:((t=n.children).length&&t.forEach((function(e){"label"!==e.type||e.businessObject.name||(e.hidden=!0)})),Br(n).di.isExpanded=!0))})),this.reverted(["shape.toggleCollapse"],500,(function(e){var t=e.context.shape;t.collapsed?Br(t).di.isExpanded=!1:Br(t).di.isExpanded=!0})),this.postExecuted(["shape.toggleCollapse"],500,(function(e){var i,r=e.context.shape,o=t._getDefaultSize(r);i=r.collapsed?function(e,t){return{x:e.x+(e.width-t.width)/2,y:e.y+(e.height-t.height)/2,width:t.width,height:t.height}}(r,o):function(e,t){var n,i,r=e.children,o=t;return(n=Yp((i=r,i.filter((function(e){return!e.hidden}))).concat([e])))?(o.width=Math.max(n.width,o.width),o.height=Math.max(n.height,o.height),o.x=n.x+(n.width-o.width)/2,o.y=n.y+(n.height-o.height)/2):(o.x=e.x+(e.width-o.width)/2,o.y=e.y+(e.height-o.height)/2),o}(r,o),n.resizeShape(r,i,null,{autoResize:!r.collapsed&&"nwse"})}))}function Qd(e,t,n,i){t.invoke(as,this),this.preExecute("shape.delete",(function(e){var t=e.context.shape,r=t.businessObject;xo(t)||(Dr(t,"bpmn:Participant")&&Nr(t)&&n.ids.unclaim(r.processRef.id),i.unclaimId(r.id,r))})),this.preExecute("connection.delete",(function(e){var t=e.context.connection.businessObject;i.unclaimId(t.id,t)})),this.preExecute("canvas.updateRoot",(function(){var t=e.getRootElement().businessObject;n.ids.unclaim(t.id)}))}i(Zd,as),Zd.$inject=["eventBus","elementFactory","modeling"],i(Qd,as),Qd.$inject=["canvas","injector","moddle","modeling"];function eh(e,t,n){var i;function r(){if(!i)throw new Error(n("out of bounds release"));return i}as.call(this,e);var o=["spaceTool","lane.add","lane.resize","lane.split","elements.create","elements.delete","elements.move","shape.create","shape.delete","shape.move","shape.resize"];this.preExecute(o,5e3,(function(e){(i=i||new th).enter()})),this.postExecuted(o,500,(function(e){!function(){if(!i)throw new Error(n("out of bounds release"));var e=i.leave();e&&(t.updateLaneRefs(i.flowNodes,i.lanes),i=null)}()})),this.preExecute(["shape.create","shape.move","shape.delete","shape.resize"],(function(e){var t=e.context.shape,n=r();t.labelTarget||(Dr(t,"bpmn:Lane")&&n.addLane(t),Dr(t,"bpmn:FlowNode")&&n.addFlowNode(t))}))}function th(){this.flowNodes=[],this.lanes=[],this.counter=0,this.addLane=function(e){this.lanes.push(e)},this.addFlowNode=function(e){this.flowNodes.push(e)},this.enter=function(){this.counter++},this.leave=function(){return this.counter--,!this.counter}}function nh(e,t){as.call(this,e),this.preExecute("connection.delete",(function(e){var n=e.context.connection,i=n.source;(function(e,t){if(!Dr(e,"bpmn:SequenceFlow"))return!1;var n=Br(t),i=Br(e);return n.get("default")===i})(n,i)&&t.updateProperties(i,{default:null})}))}eh.$inject=["eventBus","modeling","translate"],i(eh,as),i(nh,as),nh.$inject=["eventBus","modeling"];var ih={__init__:["adaptiveLabelPositioningBehavior","appendBehavior","associationBehavior","attachEventBehavior","boundaryEventBehavior","rootElementReferenceBehavior","createBehavior","fixHoverBehavior","createDataObjectBehavior","createParticipantBehavior","dataStoreBehavior","dataInputAssociationBehavior","deleteLaneBehavior","detachEventBehavior","dropOnFlowBehavior","eventBasedGatewayBehavior","groupBehavior","importDockingFix","isHorizontalFix","labelBehavior","messageFlowBehavior","modelingFeedback","removeElementBehavior","removeParticipantBehavior","replaceConnectionBehavior","replaceElementBehaviour","resizeBehavior","resizeLaneBehavior","toggleElementCollapseBehaviour","spaceToolBehavior","subProcessStartEventBehavior","unclaimIdBehavior","unsetDefaultFlowBehavior","updateFlowNodeRefsBehavior"],adaptiveLabelPositioningBehavior:["type",hl],appendBehavior:["type",fl],associationBehavior:["type",vl],attachEventBehavior:["type",yl],boundaryEventBehavior:["type",bl],rootElementReferenceBehavior:["type",xl],createBehavior:["type",El],fixHoverBehavior:["type",_l],createDataObjectBehavior:["type",Pl],createParticipantBehavior:["type",Tl],dataInputAssociationBehavior:["type",kl],dataStoreBehavior:["type",Dl],deleteLaneBehavior:["type",Bl],detachEventBehavior:["type",Il],dropOnFlowBehavior:["type",Ll],eventBasedGatewayBehavior:["type",$l],groupBehavior:["type",ql],importDockingFix:["type",Gl],isHorizontalFix:["type",Wl],labelBehavior:["type",yd],messageFlowBehavior:["type",Cd],modelingFeedback:["type",Td],replaceConnectionBehavior:["type",Ad],removeParticipantBehavior:["type",Rd],replaceElementBehaviour:["type",kd],resizeBehavior:["type",Nd],resizeLaneBehavior:["type",Ud],removeElementBehavior:["type",Gd],toggleElementCollapseBehaviour:["type",Zd],spaceToolBehavior:["type",Kd],subProcessStartEventBehavior:["type",Jd],unclaimIdBehavior:["type",Qd],updateFlowNodeRefsBehavior:["type",eh],unsetDefaultFlowBehavior:["type",nh]};function rh(e,t){var n=vn(e,t,-15);return"intersect"!==n?n:null}function oh(e){us.call(this,e)}function ah(e){return!e||xo(e)}function sh(e){do{if(Dr(e,"bpmn:Process"))return Br(e);if(Dr(e,"bpmn:Participant"))return Br(e).processRef||Br(e)}while(e=e.parent)}function ch(e){return Dr(e,"bpmn:TextAnnotation")}function ph(e){return Dr(e,"bpmn:Group")&&!e.labelTarget}function uh(e){return Dr(e,"bpmn:BoundaryEvent")&&hh(e,"bpmn:CompensateEventDefinition")}function lh(e){return Br(e).isForCompensation}function dh(e){for(var t=e;t=t.parent;){if(Dr(t,"bpmn:FlowElementsContainer"))return Br(t);if(Dr(t,"bpmn:Participant"))return Br(t).processRef}return null}function hh(e,t){return!!x(Br(e).eventDefinitions||[],(function(e){return Dr(e,t)}))}function mh(e,t){return(Br(e).eventDefinitions||[]).every((function(e){return Dr(e,t)}))}function fh(e){return Dr(e,"bpmn:ReceiveTask")||Dr(e,"bpmn:IntermediateCatchEvent")&&(hh(e,"bpmn:MessageEventDefinition")||hh(e,"bpmn:TimerEventDefinition")||hh(e,"bpmn:ConditionalEventDefinition")||hh(e,"bpmn:SignalEventDefinition"))}function vh(e){return e.waypoints}function yh(e,t){return-1!==function(e){for(var t=[];e;)(e=e.parent)&&t.push(e);return t}(t).indexOf(e)}function gh(e,t,n){if(ah(e)||ah(t))return null;if(!Dr(n,"bpmn:DataAssociation")){if(kh(e,t))return{type:"bpmn:MessageFlow"};if(jh(e,t))return{type:"bpmn:SequenceFlow"}}var i=Mh(e,t);return i||(uh(e)&&lh(t)?{type:"bpmn:Association",associationDirection:"One"}:!!Rh(e,t)&&{type:"bpmn:Association"})}function bh(e,t,n){return!(!xo(e)&&!ph(e))||!(Dr(t,"bpmn:Participant")&&!Nr(t))&&(Dr(e,"bpmn:Participant")?Dr(t,"bpmn:Process")||Dr(t,"bpmn:Collaboration"):Qa(e,["bpmn:DataInput","bpmn:DataOutput"])&&e.parent?t===e.parent:Dr(e,"bpmn:Lane")?Dr(t,"bpmn:Participant")||Dr(t,"bpmn:Lane"):!(Dr(e,"bpmn:BoundaryEvent")&&(i=e,!Br(i).cancelActivity||!wh(i)&&!_h(i)))&&(Dr(e,"bpmn:FlowElement")&&!Dr(e,"bpmn:DataStoreReference")?Dr(t,"bpmn:FlowElementsContainer")?Nr(t):Qa(t,["bpmn:Participant","bpmn:Lane"]):Dr(e,"bpmn:DataStoreReference")&&Dr(t,"bpmn:Collaboration")?C(Br(t).get("participants"),(function(e){return!!e.get("processRef")})):Qa(e,["bpmn:Artifact","bpmn:DataAssociation","bpmn:DataStoreReference"])?Qa(t,["bpmn:Collaboration","bpmn:Lane","bpmn:Participant","bpmn:Process","bpmn:SubProcess"]):!!Dr(e,"bpmn:MessageFlow")&&(Dr(t,"bpmn:Collaboration")||e.source.parent==t||e.target.parent==t)));var i}function xh(e){return Dr(e,"bpmn:Lane")}function Eh(e){return!!function(e){return!xo(e)&&Dr(e,"bpmn:BoundaryEvent")}(e)||(!(!Dr(e,"bpmn:IntermediateThrowEvent")||!wh(e))||Dr(e,"bpmn:IntermediateCatchEvent")&&_h(e))}function wh(e){var t=Br(e);return t&&!(t.eventDefinitions&&t.eventDefinitions.length)}function _h(e){return Ph(e,["bpmn:MessageEventDefinition","bpmn:TimerEventDefinition","bpmn:SignalEventDefinition","bpmn:ConditionalEventDefinition"])}function Ph(e,t){return t.some((function(t){return hh(e,t)}))}function Sh(e,t,n,i){if(Array.isArray(e)||(e=[e]),1!==e.length)return!1;var r=e[0];return!xo(r)&&(!!Eh(r)&&(!Fr(t)&&(!(!Dr(t,"bpmn:Activity")||lh(t))&&(!(i&&!rh(i,t))&&(!function(e){return Dr(e,"bpmn:ReceiveTask")&&x(e.incoming,(function(e){return Dr(e.source,"bpmn:EventBasedGateway")}))}(t)&&"attach")))))}function Oh(e,t,n){if(!t)return!1;var i={replacements:[]};return _(e,(function(e){Fr(t)||Dr(e,"bpmn:StartEvent")&&"label"!==e.type&&bh(e,t)&&(Lr(e)||i.replacements.push({oldElementId:e.id,newElementType:"bpmn:StartEvent"}),($r(e)||zr(e)||qr(e))&&i.replacements.push({oldElementId:e.id,newElementType:"bpmn:StartEvent"}),Ph(e,["bpmn:MessageEventDefinition","bpmn:TimerEventDefinition","bpmn:SignalEventDefinition","bpmn:ConditionalEventDefinition"])&&Dr(t,"bpmn:SubProcess")&&i.replacements.push({oldElementId:e.id,newElementType:"bpmn:StartEvent"})),Dr(t,"bpmn:Transaction")||hh(e,"bpmn:CancelEventDefinition")&&"label"!==e.type&&(Dr(e,"bpmn:EndEvent")&&bh(e,t)&&i.replacements.push({oldElementId:e.id,newElementType:"bpmn:EndEvent"}),Dr(e,"bpmn:BoundaryEvent")&&Sh(e,t,0,n)&&i.replacements.push({oldElementId:e.id,newElementType:"bpmn:BoundaryEvent"}))})),!!i.replacements.length&&i}function Ch(e,t){return!C(e,xh)&&(!t||e.every((function(e){return bh(e,t)})))}function Th(e,t,n,i){return!!t&&(!(!xo(e)&&!ph(e))||n!==t&&((!n||!yh(n,t))&&(bh(e,t)||Dh(e,t))))}function Ah(e,t){return Dr(e,"bpmn:SubProcess")?Nr(e)&&(!t||t.width>=100&&t.height>=80):Dr(e,"bpmn:Lane")?!t||t.width>=130&&t.height>=60:Dr(e,"bpmn:Participant")?!t||t.width>=250&&t.height>=50:!!ch(e)||!!ph(e)}function Rh(e,t){return!vh(e)&&!vh(t)&&(!(!uh(e)||!lh(t))||!yh(t,e)&&!yh(e,t)&&(!!function(e,t){var n=ch(e),i=ch(t);return(n||i)&&n!==i}(e,t)||!!Mh(e,t)))}function kh(e,t){return!(Nh(e)&&!Nh(t))&&(Dr(i=e,"bpmn:InteractionNode")&&!Dr(i,"bpmn:BoundaryEvent")&&(!Dr(i,"bpmn:Event")||Dr(i,"bpmn:ThrowEvent")&&mh(i,"bpmn:MessageEventDefinition"))&&function(e){return Dr(e,"bpmn:InteractionNode")&&!lh(e)&&(!Dr(e,"bpmn:Event")||Dr(e,"bpmn:CatchEvent")&&mh(e,"bpmn:MessageEventDefinition"))&&!(Dr(e,"bpmn:BoundaryEvent")&&!hh(e,"bpmn:MessageEventDefinition"))}(t)&&(n=t,!(sh(e)===sh(n))));var n,i}function jh(e,t){return!(fh(t)&&t.incoming.length>0&&(n=t.incoming,(n=n||[]).some(Ih))&&!Dr(e,"bpmn:EventBasedGateway"))&&(Dr(r=e,"bpmn:FlowNode")&&!Dr(r,"bpmn:EndEvent")&&!Fr(r)&&!(Dr(r,"bpmn:IntermediateThrowEvent")&&hh(r,"bpmn:LinkEventDefinition"))&&!uh(r)&&!lh(r)&&function(e){return Dr(e,"bpmn:FlowNode")&&!Dr(e,"bpmn:StartEvent")&&!Dr(e,"bpmn:BoundaryEvent")&&!Fr(e)&&!(Dr(e,"bpmn:IntermediateCatchEvent")&&hh(e,"bpmn:LinkEventDefinition"))&&!lh(e)}(t)&&(i=t,dh(e)===dh(i))&&!(Dr(e,"bpmn:EventBasedGateway")&&!fh(t)));var n,i,r}function Mh(e,t){return Qa(e,["bpmn:DataObjectReference","bpmn:DataStoreReference"])&&Qa(t,["bpmn:Activity","bpmn:ThrowEvent"])?{type:"bpmn:DataInputAssociation"}:!(!Qa(t,["bpmn:DataObjectReference","bpmn:DataStoreReference"])||!Qa(e,["bpmn:Activity","bpmn:CatchEvent"]))&&{type:"bpmn:DataOutputAssociation"}}function Dh(e,t,n){if(!t)return!1;if(Array.isArray(e)){if(1!==e.length)return!1;e=e[0]}return t.source!==e&&t.target!==e&&(Qa(t,["bpmn:SequenceFlow","bpmn:MessageFlow"])&&!xo(t)&&Dr(e,"bpmn:FlowNode")&&!Dr(e,"bpmn:BoundaryEvent")&&bh(e,t.parent))}function Bh(e,t){return!!xo(t)||!(Dr(t,"bpmn:Lane")&&!function(e,t){return e&&t&&-1!==e.indexOf(t)}(e,t.parent))}function Ih(e){if(e&&e.source)return Dr(e.source,"bpmn:EventBasedGateway")}function Nh(e){return es(e,"bpmn:Process")||es(e,"bpmn:Collaboration")}i(oh,us),oh.$inject=["eventBus"],oh.prototype.init=function(){this.addRule("connection.start",(function(e){return function(e){if(ah(e))return null;return Qa(e,["bpmn:FlowNode","bpmn:InteractionNode","bpmn:DataObjectReference","bpmn:DataStoreReference","bpmn:Group","bpmn:TextAnnotation"])}(e.source)})),this.addRule("connection.create",(function(e){var t=e.source,n=e.target,i=e.hints||{},r=i.targetParent;if(i.targetAttach)return!1;r&&(n.parent=r);try{return gh(t,n)}finally{r&&(n.parent=null)}})),this.addRule("connection.reconnect",(function(e){var t=e.connection;return gh(e.source,e.target,t)})),this.addRule("connection.updateWaypoints",(function(e){return{type:e.connection.type}})),this.addRule("shape.resize",(function(e){return Ah(e.shape,e.newBounds)})),this.addRule("elements.create",(function(e){var t=e.elements,n=e.position,i=e.target;return!(vh(i)&&!Dh(t,i))&&O(t,(function(e){return vh(e)?gh(e.source,e.target,e):e.host?Sh(e,e.host,null,n):Th(e,i,null)}))})),this.addRule("elements.move",(function(e){var t=e.target,n=e.shapes,i=e.position;return Sh(n,t,null,i)||Oh(n,t,i)||Ch(n,t)||Dh(n,t)})),this.addRule("shape.create",(function(e){return Th(e.shape,e.target,e.source,e.position)})),this.addRule("shape.attach",(function(e){return Sh(e.shape,e.target,null,e.position)})),this.addRule("element.copy",(function(e){var t=e.element;return Bh(e.elements,t)}))},oh.prototype.canConnectMessageFlow=kh,oh.prototype.canConnectSequenceFlow=jh,oh.prototype.canConnectDataAssociation=Mh,oh.prototype.canConnectAssociation=Rh,oh.prototype.canMove=Ch,oh.prototype.canAttach=Sh,oh.prototype.canReplace=Oh,oh.prototype.canDrop=bh,oh.prototype.canInsert=Dh,oh.prototype.canCreate=Th,oh.prototype.canConnect=gh,oh.prototype.canResize=Ah,oh.prototype.canCopy=Bh;var Lh={__depends__:[Ss],__init__:["bpmnRules"],bpmnRules:["type",oh]};function Fh(e,t){e.on("saveXML.start",2e3,(function(){var e,n,i=t.getRootElement(),r=Br(i).di;e=w(e=mt([i],!1),(function(e){return e!==i&&!e.labelTarget})),n=T(e,Kr),r.set("planeElement",n)}))}Fh.$inject=["eventBus","canvas"];var Vh={__init__:["bpmnDiOrdering"],bpmnDiOrdering:["type",Fh]};function $h(e){as.call(this,e);var t=this;this.preExecute(["shape.create","connection.create"],(function(e){var n=e.context,i=n.shape||n.connection,r=n.parent,o=t.getOrdering(i,r);o&&(void 0!==o.parent&&(n.parent=o.parent),n.parentIndex=o.index)})),this.preExecute(["shape.move","connection.move"],(function(e){var n=e.context,i=n.shape||n.connection,r=n.newParent||i.parent,o=t.getOrdering(i,r);o&&(void 0!==o.parent&&(n.newParent=o.parent),n.newParentIndex=o.index)}))}function zh(e,t,n){$h.call(this,e);var i=[{type:"bpmn:SubProcess",order:{level:6}},{type:"bpmn:SequenceFlow",order:{level:3,containers:["bpmn:Participant","bpmn:FlowElementsContainer"]}},{type:"bpmn:DataAssociation",order:{level:9,containers:["bpmn:Collaboration","bpmn:Process"]}},{type:"bpmn:MessageFlow",order:{level:9,containers:["bpmn:Collaboration"]}},{type:"bpmn:Association",order:{level:6,containers:["bpmn:Participant","bpmn:FlowElementsContainer","bpmn:Collaboration"]}},{type:"bpmn:BoundaryEvent",order:{level:8}},{type:"bpmn:Group",order:{level:10,containers:["bpmn:Collaboration","bpmn:Process"]}},{type:"bpmn:FlowElement",order:{level:5}},{type:"bpmn:Participant",order:{level:-2}},{type:"bpmn:Lane",order:{level:-1}}];function r(e){var t=e.order;if(t||(e.order=t=function(e){if(e.labelTarget)return{level:10};var t=x(i,(function(t){return Qa(e,[t.type])}));return t&&t.order||{level:1}}(e)),!t)throw new Error("no order for <"+e.id+">");return t}this.getOrdering=function(e,n){if(e.labelTarget)return{parent:t.getRootElement(),index:-1};var i=r(e);i.containers&&(n=function(e,t,n){for(var i=t;i&&!Qa(i,n);)i=i.parent;if(!i)throw new Error("no parent for <"+e.id+"> in <"+(t&&t.id)+">");return i}(e,n,i.containers));var o=n.children.indexOf(e),a=E(n.children,(function(t){return!(!e.labelTarget&&t.labelTarget)&&i.level<r(t).level}));return-1!==a&&-1!==o&&o<a&&(a-=1),{index:a,parent:n}}}$h.prototype.getOrdering=function(e,t){return null},i($h,as),zh.$inject=["eventBus","canvas","translate"],i(zh,$h);var qh={__depends__:[ho],__init__:["bpmnOrderingProvider"],bpmnOrderingProvider:["type",zh]};function Uh(e,t){this._handlerMap={},this._stack=[],this._stackIdx=-1,this._currentExecution={actions:[],dirty:[],trigger:null},this._injector=t,this._eventBus=e,this._uid=1,e.on(["diagram.destroy","diagram.clear"],(function(){this.clear(!1)}),this)}Uh.$inject=["eventBus","injector"],Uh.prototype.execute=function(e,t){if(!e)throw new Error("command required");this._currentExecution.trigger="execute";var n={command:e,context:t};this._pushAction(n),this._internalExecute(n),this._popAction(n)},Uh.prototype.canExecute=function(e,t){var n={command:e,context:t},i=this._getHandler(e),r=this._fire(e,"canExecute",n);if(void 0===r){if(!i)return!1;i.canExecute&&(r=i.canExecute(t))}return r},Uh.prototype.clear=function(e){this._stack.length=0,this._stackIdx=-1,!1!==e&&this._fire("changed",{trigger:"clear"})},Uh.prototype.undo=function(){var e,t=this._getUndoAction();if(t){for(this._currentExecution.trigger="undo",this._pushAction(t);t&&(this._internalUndo(t),(e=this._getUndoAction())&&e.id===t.id);)t=e;this._popAction()}},Uh.prototype.redo=function(){var e,t=this._getRedoAction();if(t){for(this._currentExecution.trigger="redo",this._pushAction(t);t&&(this._internalExecute(t,!0),(e=this._getRedoAction())&&e.id===t.id);)t=e;this._popAction()}},Uh.prototype.register=function(e,t){this._setHandler(e,t)},Uh.prototype.registerHandler=function(e,t){if(!e||!t)throw new Error("command and handlerCls must be defined");var n=this._injector.instantiate(t);this.register(e,n)},Uh.prototype.canUndo=function(){return!!this._getUndoAction()},Uh.prototype.canRedo=function(){return!!this._getRedoAction()},Uh.prototype._getRedoAction=function(){return this._stack[this._stackIdx+1]},Uh.prototype._getUndoAction=function(){return this._stack[this._stackIdx]},Uh.prototype._internalUndo=function(e){var t=this,n=e.command,i=e.context,r=this._getHandler(n);this._atomicDo((function(){t._fire(n,"revert",e),r.revert&&t._markDirty(r.revert(i)),t._revertedAction(e),t._fire(n,"reverted",e)}))},Uh.prototype._fire=function(e,t,n){arguments.length<3&&(n=t,t=null);var i,r,o,a=t?[e+"."+t,t]:[e];for(n=this._eventBus.createEvent(n),i=0;(r=a[i])&&(o=this._eventBus.fire("commandStack."+r,n),!n.cancelBubble);i++);return o},Uh.prototype._createId=function(){return this._uid++},Uh.prototype._atomicDo=function(e){var t=this._currentExecution;t.atomic=!0;try{e()}finally{t.atomic=!1}},Uh.prototype._internalExecute=function(e,t){var n=this,i=e.command,r=e.context,o=this._getHandler(i);if(!o)throw new Error("no command handler registered for <"+i+">");this._pushAction(e),t||(this._fire(i,"preExecute",e),o.preExecute&&o.preExecute(r),this._fire(i,"preExecuted",e)),this._atomicDo((function(){n._fire(i,"execute",e),o.execute&&n._markDirty(o.execute(r)),n._executedAction(e,t),n._fire(i,"executed",e)})),t||(this._fire(i,"postExecute",e),o.postExecute&&o.postExecute(r),this._fire(i,"postExecuted",e)),this._popAction(e)},Uh.prototype._pushAction=function(e){var t=this._currentExecution,n=t.actions,i=n[0];if(t.atomic)throw new Error("illegal invocation in <execute> or <revert> phase (action: "+e.command+")");e.id||(e.id=i&&i.id||this._createId()),n.push(e)},Uh.prototype._popAction=function(){var e=this._currentExecution,t=e.trigger,n=e.actions,i=e.dirty;n.pop(),n.length||(this._eventBus.fire("elements.changed",{elements:M("id",i.reverse())}),i.length=0,this._fire("changed",{trigger:t}),e.trigger=null)},Uh.prototype._markDirty=function(e){var t=this._currentExecution;e&&(e=h(e)?e:[e],t.dirty=t.dirty.concat(e))},Uh.prototype._executedAction=function(e,t){var n=++this._stackIdx;t||this._stack.splice(n,this._stack.length,e)},Uh.prototype._revertedAction=function(e){this._stackIdx--},Uh.prototype._getHandler=function(e){return this._handlerMap[e]},Uh.prototype._setHandler=function(e,t){if(!e||!t)throw new Error("command and handler required");if(this._handlerMap[e])throw new Error("overriding handler for command <"+e+">");this._handlerMap[e]=t};var Gh={commandStack:["type",Uh]},Hh=new Wo("tt");function Wh(e,t){e.style.display=!1===t?"none":""}var Kh=".djs-tooltip";function Xh(e,t){this._eventBus=e,this._canvas=t,this._ids=Hh,this._tooltipDefaults={show:{minZoom:.7,maxZoom:5}},this._tooltips={},this._tooltipRoot=function(e){var t=he('<div class="djs-tooltip-container" style="position: absolute; width: 0; height: 0;" />');return e.insertBefore(t,e.firstChild),t}(t.getContainer());var n=this;de.bind(this._tooltipRoot,Kh,"mousedown",(function(e){e.stopPropagation()})),de.bind(this._tooltipRoot,Kh,"mouseover",(function(e){n.trigger("mouseover",e)})),de.bind(this._tooltipRoot,Kh,"mouseout",(function(e){n.trigger("mouseout",e)})),this._init()}Xh.$inject=["eventBus","canvas"],Xh.prototype.add=function(e){if(!e.position)throw new Error("must specifiy tooltip position");if(!e.html)throw new Error("must specifiy tooltip html");var t=this._ids.next();return e=U({},this._tooltipDefaults,e,{id:t}),this._addTooltip(e),e.timeout&&this.setTimeout(e),t},Xh.prototype.trigger=function(e,t){var n=t.delegateTarget||t.target,i=this.get(K(n,"data-tooltip-id"));i&&("mouseover"===e&&i.timeout&&this.clearTimeout(i),"mouseout"===e&&i.timeout&&(i.timeout=1e3,this.setTimeout(i)))},Xh.prototype.get=function(e){return"string"!=typeof e&&(e=e.id),this._tooltips[e]},Xh.prototype.clearTimeout=function(e){if(e=this.get(e)){var t=e.removeTimer;t&&(clearTimeout(t),e.removeTimer=null)}},Xh.prototype.setTimeout=function(e){if(e=this.get(e)){this.clearTimeout(e);var t=this;e.removeTimer=setTimeout((function(){t.remove(e)}),e.timeout)}},Xh.prototype.remove=function(e){var t=this.get(e);t&&(ge(t.html),ge(t.htmlContainer),delete t.htmlContainer,delete this._tooltips[t.id])},Xh.prototype.show=function(){Wh(this._tooltipRoot)},Xh.prototype.hide=function(){Wh(this._tooltipRoot,!1)},Xh.prototype._updateRoot=function(e){var t=e.scale||1,n=e.scale||1,i="matrix("+t+",0,0,"+n+","+-1*e.x*t+","+-1*e.y*n+")";this._tooltipRoot.style.transform=i,this._tooltipRoot.style["-ms-transform"]=i},Xh.prototype._addTooltip=function(e){var t,n=e.id,i=e.html,r=this._tooltipRoot;i.get&&i.constructor.prototype.jquery&&(i=i.get(0)),y(i)&&(i=he(i)),(t=he('<div data-tooltip-id="'+n+'" class="'+'djs-tooltip" style="position: absolute">')).appendChild(i),e.type&&Q(t).add("djs-tooltip-"+e.type),e.className&&Q(t).add(e.className),e.htmlContainer=t,r.appendChild(t),this._tooltips[n]=e,this._updateTooltip(e)},Xh.prototype._updateTooltip=function(e){var t,n,i,r=e.position,o=e.htmlContainer;t=o,n=r.x,i=r.y,U(t.style,{left:n+"px",top:i+"px"})},Xh.prototype._updateTooltipVisibilty=function(e){_(this._tooltips,(function(t){var n=t.show,i=t.htmlContainer,r=!0;n&&((n.minZoom>e.scale||n.maxZoom<e.scale)&&(r=!1),Wh(i,r))}))},Xh.prototype._init=function(){var e=this;this._eventBus.on("canvas.viewbox.changing",(function(t){e.hide()})),this._eventBus.on("canvas.viewbox.changed",(function(t){var n;n=t.viewbox,e._updateRoot(n),e._updateTooltipVisibilty(n),e.show()}))};var Yh={__init__:["tooltips"],tooltips:["type",Xh]};function Jh(e,t){if("function"!=typeof t)throw new Error("removeFn iterator must be a function");if(e){for(var n;n=e[0];)t(n);return e}}function Zh(e,t,n){as.call(this,t);var i=e.get("movePreview",!1);t.on("shape.move.start",1400,(function(e){var t=e.context,n=t.shapes,i=t.validatedShapes;t.shapes=Qh(n),t.validatedShapes=Qh(i)})),i&&t.on("shape.move.start",250,(function(e){var t=e.context,n=t.shapes,r=[];_(n,(function(e){_(e.labels,(function(n){n.hidden||-1!==t.shapes.indexOf(n)||r.push(n),e.labelTarget&&r.push(e)}))})),_(r,(function(e){i.makeDraggable(t,e,!0)}))})),this.preExecuted("elements.move",1400,(function(e){var t=e.context.closure,n=t.enclosedElements,i=[];_(n,(function(e){_(e.labels,(function(e){n[e.id]||i.push(e)}))})),t.addAll(i)})),this.preExecute(["connection.delete","shape.delete"],(function(e){var t=e.context;Jh((t.connection||t.shape).labels,(function(e){n.removeShape(e,{nested:!0})}))})),this.execute("shape.delete",(function(e){var t=e.context,n=t.shape,i=n.labelTarget;i&&(t.labelTargetIndex=_t(i.labels,n),t.labelTarget=i,n.labelTarget=null)})),this.revert("shape.delete",(function(e){var t=e.context,n=t.shape,i=t.labelTarget,r=t.labelTargetIndex;i&&(wt(i.labels,n,r),n.labelTarget=i)}))}function Qh(e){return w(e,(function(t){return-1===e.indexOf(t.labelTarget)}))}i(Zh,as),Zh.$inject=["injector","eventBus","modeling"];var em={__init__:["labelSupport"],labelSupport:["type",Zh]},tm="attach-ok";function nm(e,t,n,i,r){as.call(this,t);var o=e.get("movePreview",!1);t.on("shape.move.start",1401,(function(e){var t,n,i=e.context,r=i.shapes,o=i.validatedShapes;i.shapes=(n=im(t=r),D("id",t,n)),i.validatedShapes=function(e){var t=j(e,"id");return w(e,(function(e){for(;e;){if(e.host&&t[e.host.id])return!1;e=e.parent}return!0}))}(o)})),o&&t.on("shape.move.start",251,(function(e){var t=e.context;_(im(t.shapes),(function(e){o.makeDraggable(t,e,!0),_(e.labels,(function(e){o.makeDraggable(t,e,!0)}))}))})),o&&t.on("shape.move.start",(function(e){var i=e.context.shapes;if(1===i.length){var r=i[0].host;r&&(n.addMarker(r,tm),t.once(["shape.move.out","shape.move.cleanup"],(function(){n.removeMarker(r,tm)})))}})),this.preExecuted("elements.move",1401,(function(e){var t=e.context,n=t.closure;_(im(t.shapes),(function(e){n.add(e,n.topLevel[e.host.id])}))})),this.postExecuted("elements.move",(function(e){var t=e.context,n=t.shapes,i=t.newHost;i&&1!==n.length||_(i?n:w(n,(function(e){var t,i=e.host;return function(e){return!!e.host}(e)&&(t=i,!(-1!==n.indexOf(t)))})),(function(e){r.updateAttachment(e,i)}))})),this.postExecuted("elements.move",(function(e){_(e.context.shapes,(function(e){_(e.attachers,(function(e){_(e.outgoing.slice(),(function(e){i.allowed("connection.reconnect",{connection:e,source:e.source,target:e.target})||r.removeConnection(e)})),_(e.incoming.slice(),(function(e){i.allowed("connection.reconnect",{connection:e,source:e.source,target:e.target})||r.removeConnection(e)}))}))}))})),this.postExecute("shape.create",(function(e){var t=e.context,n=t.shape,i=t.host;i&&r.updateAttachment(n,i)})),this.postExecute("shape.replace",(function(e){var t=e.context,n=t.oldShape,o=t.newShape;Jh(n.attachers,(function(e){"attach"===i.allowed("elements.move",{target:o,shapes:[e]})?r.updateAttachment(e,o):r.removeShape(e)})),o.attachers.length&&_(o.attachers,(function(e){var t=hd(e,n,o);r.moveShape(e,t,e.parent)}))})),this.postExecute("shape.resize",(function(e){var t=e.context,n=t.shape,i=t.oldBounds,o=t.newBounds,a=n.attachers;!1!==(t.hints||{}).attachSupport&&_(a,(function(e){var t=hd(e,i,o);r.moveShape(e,t,e.parent),_(e.labels,(function(e){r.moveShape(e,t,e.parent)}))}))})),this.preExecute("shape.delete",(function(e){var t=e.context.shape;Jh(t.attachers,(function(e){r.removeShape(e)})),t.host&&r.updateAttachment(t,null)}))}function im(e){return s(T(e,(function(e){return e.attachers||[]})))}i(nm,as),nm.$inject=["injector","eventBus","canvas","rules","modeling"];var rm={__depends__:[Ss],__init__:["attachSupport"],attachSupport:["type",nm]};function om(e,t){this._eventBus=e,this._dragging=t,this._tools=[],this._active=null}om.$inject=["eventBus","dragging"],om.prototype.registerTool=function(e,t){var n=this._tools;if(!t)throw new Error('A tool has to be registered with it\'s "events"');n.push(e),this.bindEvents(e,t)},om.prototype.isActive=function(e){return e&&this._active===e},om.prototype.length=function(e){return this._tools.length},om.prototype.setActive=function(e){var t=this._eventBus;this._active!==e&&(this._active=e,t.fire("tool-manager.update",{tool:e}))},om.prototype.bindEvents=function(e,t){var n=this._eventBus,i=this._dragging,r=[];n.on(t.tool+".init",(function(t){if(!t.context.reactivate&&this.isActive(e))return this.setActive(null),void i.cancel();this.setActive(e)}),this),_(t,(function(e){r.push(e+".ended"),r.push(e+".canceled")})),n.on(r,250,(function(e){this._active&&(function(e){var t=e.originalEvent&&e.originalEvent.target;return t&&oe(t,'.group[data-group="tools"]')}(e)||this.setActive(null))}),this)};var am={__depends__:[xs],__init__:["toolManager"],toolManager:["type",om]};function sm(e,t){return-1!==e.indexOf(t)}var cm=Math.abs,pm=Math.round,um={x:"width",y:"height"},lm="crosshair",dm={n:"top",w:"left",s:"bottom",e:"right"},hm={n:"s",w:"e",s:"n",e:"w"};function mm(e,t,n,i,r,o,a){this._canvas=e,this._dragging=t,this._eventBus=n,this._modeling=i,this._rules=r,this._toolManager=o,this._mouse=a;var s=this;o.registerTool("space",{tool:"spaceTool.selection",dragging:"spaceTool"}),n.on("spaceTool.selection.end",(function(e){n.once("spaceTool.selection.ended",(function(){s.activateMakeSpace(e.originalEvent)}))})),n.on("spaceTool.move",1500,(function(e){var t=e.context,n=t.initialized;n||(n=t.initialized=s.init(e,t)),n&&vm(e)})),n.on("spaceTool.end",(function(e){var t=e.context,i=t.axis,r=t.direction,o=t.movingShapes,a=t.resizingShapes,c=t.start;if(t.initialized){vm(e);var p={x:0,y:0};p[i]=pm(e["d"+i]),s.makeSpace(o,a,p,r,c),n.once("spaceTool.ended",(function(e){s.activateSelection(e.originalEvent,!0,!0)}))}}))}function fm(e){return{top:e.top-20,right:e.right+20,bottom:e.bottom+20,left:e.left-20}}function vm(e){var t,n,i=e.context.spaceToolConstraints;i&&(f(i.left)&&(t=Math.max(e.x,i.left),e.dx=e.dx+t-e.x,e.x=t),f(i.right)&&(t=Math.min(e.x,i.right),e.dx=e.dx+t-e.x,e.x=t),f(i.top)&&(n=Math.max(e.y,i.top),e.dy=e.dy+n-e.y,e.y=n),f(i.bottom)&&(n=Math.min(e.y,i.bottom),e.dy=e.dy+n-e.y,e.y=n))}function ym(e,t){return-1!==e.indexOf(t)}function gm(e){return!!e.waypoints}function bm(e){return!!e.labelTarget}mm.$inject=["canvas","dragging","eventBus","modeling","rules","toolManager","mouse"],mm.prototype.activateSelection=function(e,t,n){this._dragging.init(e,"spaceTool.selection",{autoActivate:t,cursor:lm,data:{context:{reactivate:n}},trapClick:!1})},mm.prototype.activateMakeSpace=function(e){this._dragging.init(e,"spaceTool",{autoActivate:!0,cursor:lm,data:{context:{}}})},mm.prototype.makeSpace=function(e,t,n,i,r){return this._modeling.createSpace(e,t,n,i,r)},mm.prototype.init=function(e,t){var n=cm(e.dx)>cm(e.dy)?"x":"y",i=e["d"+n],r=e[n]-i;if(cm(i)<5)return!1;i<0&&(i*=-1),jo(e)&&(i*=-1);var o=function(e,t){if("x"===e){if(t>0)return"e";if(t<0)return"w"}if("y"===e){if(t>0)return"s";if(t<0)return"n"}return null}(n,i),a=mt(this._canvas.getRootElement(),!0),s=this.calculateAdjustments(a,n,i,r);return U(t,s,{axis:n,direction:o,spaceToolConstraints:function(e,t,n,i,r){var o=e.movingShapes,a=e.resizingShapes;if(!a.length)return;var s,c,p={};return _(a,(function(e){var u,l,d,h=hn(e),m=w(e.children,(function(e){return!(gm(e)||bm(e)||ym(o,e)||ym(a,e))})),v=w(e.children,(function(e){return!gm(e)&&!bm(e)&&ym(o,e)}));m.length&&(l=fm(hn(ft(m))),u=i-h[dm[n]]+l[dm[n]],"n"===n?p.bottom=c=f(c)?Math.min(c,u):u:"w"===n?p.right=c=f(c)?Math.min(c,u):u:"s"===n?p.top=s=f(s)?Math.max(s,u):u:"e"===n&&(p.left=s=f(s)?Math.max(s,u):u)),v.length&&(d=fm(hn(ft(v))),u=i-d[dm[hm[n]]]+h[dm[hm[n]]],"n"===n?p.bottom=c=f(c)?Math.min(c,u):u:"w"===n?p.right=c=f(c)?Math.min(c,u):u:"s"===n?p.top=s=f(s)?Math.max(s,u):u:"e"===n&&(p.left=s=f(s)?Math.max(s,u):u));var y=r&&r[e.id];y&&("n"===n?(u=i+e[um[t]]-y[um[t]],p.bottom=c=f(c)?Math.min(c,u):u):"w"===n?(u=i+e[um[t]]-y[um[t]],p.right=c=f(c)?Math.min(c,u):u):"s"===n?(u=i-e[um[t]]+y[um[t]],p.top=s=f(s)?Math.max(s,u):u):"e"===n&&(u=i-e[um[t]]+y[um[t]],p.left=s=f(s)?Math.max(s,u):u))})),p}(s,n,o,r,this._eventBus.fire("spaceTool.getMinDimensions",{axis:n,direction:o,shapes:s.resizingShapes,start:r})),start:r}),ya("resize-"+("x"===n?"ew":"ns")),!0},mm.prototype.calculateAdjustments=function(e,t,n,i){var r=this._rules,o=[],a=[];return _(e,(function(e){if(e.parent&&!gm(e)){var s=e[t],c=s+e[um[t]];return n>0&&s>i||n<0&&c<i?o.push(e):s<i&&c>i&&r.allowed("shape.resize",{shape:e})?a.push(e):void 0}})),{movingShapes:o,resizingShapes:a}},mm.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var e=this._mouse.getLastMoveEvent();this.activateSelection(e,!!e)},mm.prototype.isActive=function(){var e=this._dragging.context();return e&&/^spaceTool/.test(e.prefix)};var xm="djs-dragging",Em="djs-resizing",wm=Math.max;function _m(e,t,n,i,r){function o(e,t){_(e,(function(e){r.addDragger(e,t),n.addMarker(e,xm)}))}e.on("spaceTool.selection.start",(function(e){var t=n.getLayer("space"),r=e.context,o="M 0,-10000 L 0,10000",a="M -10000,0 L 10000,0",s=Ne("g");Pe(s,i.cls("djs-crosshair-group",["no-events"])),Ee(t,s);var c=Ne("path");Pe(c,"d",o),Ae(c).add("djs-crosshair"),Ee(s,c);var p=Ne("path");Pe(p,"d",a),Ae(p).add("djs-crosshair"),Ee(s,p),r.crosshairGroup=s})),e.on("spaceTool.selection.move",(function(e){Yn(e.context.crosshairGroup,e.x,e.y)})),e.on("spaceTool.selection.cleanup",(function(e){var t=e.context.crosshairGroup;t&&ke(t)})),e.on("spaceTool.move",250,(function(e){var a=e.context,s=a.line,c=a.axis,p=a.movingShapes,u=a.resizingShapes;if(a.initialized){if(!a.dragGroup){var l=n.getLayer("space");Pe(s=Ne("path"),"d","M0,0 L0,0"),Ae(s).add("djs-crosshair"),Ee(l,s),a.line=s;var d=Ne("g");Pe(d,i.cls("djs-drag-group",["no-events"])),Ee(n.getActiveLayer(),d),o(p,d),o(a.movingConnections=t.filter((function(e){var t=!1;_(p,(function(n){_(n.outgoing,(function(n){e===n&&(t=!0)}))}));var n=!1;_(p,(function(t){_(t.incoming,(function(t){e===t&&(n=!0)}))}));var i=!1;_(u,(function(t){_(t.outgoing,(function(t){e===t&&(i=!0)}))}));var r=!1;return _(u,(function(t){_(t.incoming,(function(t){e===t&&(r=!0)}))})),function(e){return e.waypoints}(e)&&(t||i)&&(n||r)})),d),a.dragGroup=d}if(!a.frameGroup){var h=Ne("g");Pe(h,i.cls("djs-frame-group",["no-events"])),Ee(n.getActiveLayer(),h);var m=[];_(u,(function(e){var t=r.addFrame(e,h),i=t.getBBox();m.push({element:t,initialBounds:i}),n.addMarker(e,Em)})),a.frameGroup=h,a.frames=m}Pe(s,{d:{x:"M"+e.x+", -10000 L"+e.x+", 10000",y:"M -10000, "+e.y+" L 10000, "+e.y}[c]});var f={x:e.dx,y:e.dy};f[{x:"y",y:"x"}[a.axis]]=0,Yn(a.dragGroup,f.x,f.y),_(a.frames,(function(e){var t,n,i=e.element,r=e.initialBounds;"e"===a.direction?Pe(i,{width:wm(r.width+f.x,5)}):Pe(i,{width:t=wm(r.width-f.x,5),x:r.x+r.width-t}),"s"===a.direction?Pe(i,{height:wm(r.height+f.y,5)}):Pe(i,{height:n=wm(r.height-f.y,5),y:r.y+r.height-n})}))}})),e.on("spaceTool.cleanup",(function(e){var t=e.context,i=t.movingShapes,r=t.movingConnections,o=t.resizingShapes,a=t.line,s=t.dragGroup,c=t.frameGroup;_(i,(function(e){n.removeMarker(e,xm)})),_(r,(function(e){n.removeMarker(e,xm)})),s&&(ke(a),ke(s)),_(o,(function(e){n.removeMarker(e,Em)})),c&&ke(c)}))}_m.$inject=["eventBus","elementRegistry","canvas","styles","previewSupport"];var Pm={__init__:["spaceToolPreview"],__depends__:[xs,Ss,am,Fc,rp],spaceTool:["type",mm],spaceToolPreview:["type",_m]};function Sm(e){this._model=e}function Om(e,t,n,i){as.call(this,e),this._bpmnFactory=t,this._translate=i;var r=this;function o(e){_(e.context.oldRoot.children,(function(e){Dr(e,"bpmn:BaseElement")&&r.updateParent(e)}))}function a(e){var t=e.context.shape;Dr(t,"bpmn:BaseElement")&&r.updateBounds(t)}function s(e){r.updateConnection(e.context)}function c(e){r.updateConnectionWaypoints(e.context.connection)}function p(e){r.updateAttachment(e.context)}this.executed(["connection.layout","connection.create"],(function(e){var t,i=e.context,r=i.hints||{};i.cropped||!1===r.createElementsBehavior||((t=i.connection).waypoints=n.getCroppedWaypoints(t),i.cropped=!0)})),this.reverted(["connection.layout"],(function(e){delete e.context.cropped})),this.executed(["shape.move","shape.create","shape.delete","connection.create","connection.move","connection.delete"],Cm((function(e){var t=e.context;r.updateParent(t.shape||t.connection,t.oldParent)}))),this.reverted(["shape.move","shape.create","shape.delete","connection.create","connection.move","connection.delete"],Cm((function(e){var t=e.context,n=t.shape||t.connection,i=t.parent||t.newParent;r.updateParent(n,i)}))),this.executed(["canvas.updateRoot"],o),this.reverted(["canvas.updateRoot"],o),this.executed(["shape.move","shape.create","shape.resize"],Cm((function(e){"label"!==e.context.shape.type&&a(e)}))),this.reverted(["shape.move","shape.create","shape.resize"],Cm((function(e){"label"!==e.context.shape.type&&a(e)}))),e.on("shape.changed",(function(e){"label"===e.element.type&&a({context:{shape:e.element}})})),this.executed(["connection.create","connection.move","connection.delete","connection.reconnect"],Cm(s)),this.reverted(["connection.create","connection.move","connection.delete","connection.reconnect"],Cm(s)),this.executed(["connection.layout","connection.move","connection.updateWaypoints"],Cm(c)),this.reverted(["connection.layout","connection.move","connection.updateWaypoints"],Cm(c)),this.executed("connection.reconnect",Cm((function(e){var t=e.context,n=t.connection,i=t.oldSource,r=t.newSource,o=Br(n),a=Br(i),s=Br(r);o.conditionExpression&&!Qa(s,["bpmn:Activity","bpmn:ExclusiveGateway","bpmn:InclusiveGateway"])&&(t.oldConditionExpression=o.conditionExpression,delete o.conditionExpression),i!==r&&a.default===o&&(t.oldDefault=a.default,delete a.default)}))),this.reverted("connection.reconnect",Cm((function(e){var t=e.context,n=t.connection,i=t.oldSource,r=t.newSource,o=Br(n),a=Br(i),s=Br(r);t.oldConditionExpression&&(o.conditionExpression=t.oldConditionExpression),t.oldDefault&&(a.default=t.oldDefault,delete s.default)}))),this.executed(["element.updateAttachment"],Cm(p)),this.reverted(["element.updateAttachment"],Cm(p))}function Cm(e){return function(t){var n=t.context;Dr(n.shape||n.connection,"bpmn:BaseElement")&&e(t)}}function Tm(e,t,n){Un.call(this),this._bpmnFactory=e,this._moddle=t,this._translate=n}function Am(e,t,n){e[n]=t[n],delete t[n]}function Rm(e,t){this._modeling=e,this._canvas=t}function km(e){this._modeling=e}function jm(e,t){this._canvas=e,this._layouter=t}Sm.$inject=["moddle"],Sm.prototype._needsId=function(e){return Qa(e,["bpmn:RootElement","bpmn:FlowElement","bpmn:MessageFlow","bpmn:DataAssociation","bpmn:Artifact","bpmn:Participant","bpmn:Lane","bpmn:LaneSet","bpmn:Process","bpmn:Collaboration","bpmndi:BPMNShape","bpmndi:BPMNEdge","bpmndi:BPMNDiagram","bpmndi:BPMNPlane","bpmn:Property","bpmn:CategoryValue"])},Sm.prototype._ensureId=function(e){var t;t=Dr(e,"bpmn:Activity")?"Activity":Dr(e,"bpmn:Event")?"Event":Dr(e,"bpmn:Gateway")?"Gateway":Qa(e,["bpmn:SequenceFlow","bpmn:MessageFlow"])?"Flow":(e.$type||"").replace(/^[^:]*:/g,""),t+="_",!e.id&&this._needsId(e)&&(e.id=this._model.ids.nextPrefixed(t,e))},Sm.prototype.create=function(e,t){var n=this._model.create(e,t||{});return this._ensureId(n),n},Sm.prototype.createDiLabel=function(){return this.create("bpmndi:BPMNLabel",{bounds:this.createDiBounds()})},Sm.prototype.createDiShape=function(e,t,n){return this.create("bpmndi:BPMNShape",U({bpmnElement:e,bounds:this.createDiBounds(t)},n))},Sm.prototype.createDiBounds=function(e){return this.create("dc:Bounds",e)},Sm.prototype.createDiWaypoints=function(e){var t=this;return T(e,(function(e){return t.createDiWaypoint(e)}))},Sm.prototype.createDiWaypoint=function(e){return this.create("dc:Point",G(e,["x","y"]))},Sm.prototype.createDiEdge=function(e,t,n){return this.create("bpmndi:BPMNEdge",U({bpmnElement:e},n))},Sm.prototype.createDiPlane=function(e){return this.create("bpmndi:BPMNPlane",{bpmnElement:e})},i(Om,as),Om.$inject=["eventBus","bpmnFactory","connectionDocking","translate"],Om.prototype.updateAttachment=function(e){var t=e.shape,n=t.businessObject,i=t.host;n.attachedToRef=i&&i.businessObject},Om.prototype.updateParent=function(e,t){if(!(e instanceof $n||Dr(e,"bpmn:DataStoreReference")&&e.parent&&Dr(e.parent,"bpmn:Collaboration"))){var n=e.parent,i=e.businessObject,r=n&&n.businessObject,o=r&&r.di;Dr(e,"bpmn:FlowNode")&&this.updateFlowNodeRefs(i,r,t&&t.businessObject),Dr(e,"bpmn:DataOutputAssociation")&&(r=e.source?e.source.businessObject:null),Dr(e,"bpmn:DataInputAssociation")&&(r=e.target?e.target.businessObject:null),this.updateSemanticParent(i,r),Dr(e,"bpmn:DataObjectReference")&&i.dataObjectRef&&this.updateSemanticParent(i.dataObjectRef,r),this.updateDiParent(i.di,o)}},Om.prototype.updateBounds=function(e){var t=e.businessObject.di,n=e instanceof $n?this._getLabel(t):t,i=n.bounds;i||(i=this._bpmnFactory.createDiBounds(),n.set("bounds",i)),U(i,{x:e.x,y:e.y,width:e.width,height:e.height})},Om.prototype.updateFlowNodeRefs=function(e,t,n){n!==t&&(Dr(n,"bpmn:Lane")&&Et(n.get("flowNodeRef"),e),Dr(t,"bpmn:Lane")&&wt(t.get("flowNodeRef"),e))},Om.prototype.updateDiConnection=function(e,t,n){e.sourceElement&&e.sourceElement.bpmnElement!==t&&(e.sourceElement=t&&t.di),e.targetElement&&e.targetElement.bpmnElement!==n&&(e.targetElement=n&&n.di)},Om.prototype.updateDiParent=function(e,t){if(t&&!Dr(t,"bpmndi:BPMNPlane")&&(t=t.$parent),e.$parent!==t){var n=(t||e.$parent).get("planeElement");t?(n.push(e),e.$parent=t):(Et(n,e),e.$parent=null)}},Om.prototype.getLaneSet=function(e){var t,n;return Dr(e,"bpmn:Lane")?((t=e.childLaneSet)||(t=this._bpmnFactory.create("bpmn:LaneSet"),e.childLaneSet=t,t.$parent=e),t):(Dr(e,"bpmn:Participant")&&(e=e.processRef),(t=(n=e.get("laneSets"))[0])||((t=this._bpmnFactory.create("bpmn:LaneSet")).$parent=e,n.push(t)),t)},Om.prototype.updateSemanticParent=function(e,t,n){var i,r=this._translate;if(e.$parent!==t&&(!Dr(e,"bpmn:DataInput")&&!Dr(e,"bpmn:DataOutput")||(Dr(t,"bpmn:Participant")&&"processRef"in t&&(t=t.processRef),!("ioSpecification"in t)||t.ioSpecification!==e.$parent))){if(Dr(e,"bpmn:Lane"))t&&(t=this.getLaneSet(t)),i="lanes";else if(Dr(e,"bpmn:FlowElement")){if(t)if(Dr(t,"bpmn:Participant"))t=t.processRef;else if(Dr(t,"bpmn:Lane"))do{t=t.$parent.$parent}while(Dr(t,"bpmn:Lane"));i="flowElements"}else if(Dr(e,"bpmn:Artifact")){for(;t&&!Dr(t,"bpmn:Process")&&!Dr(t,"bpmn:SubProcess")&&!Dr(t,"bpmn:Collaboration");){if(Dr(t,"bpmn:Participant")){t=t.processRef;break}t=t.$parent}i="artifacts"}else if(Dr(e,"bpmn:MessageFlow"))i="messageFlows";else if(Dr(e,"bpmn:Participant")){i="participants";var o,a=e.processRef;a&&(o=function(e){for(;e&&!Dr(e,"bpmn:Definitions");)e=e.$parent;return e}(e.$parent||t),e.$parent&&(Et(o.get("rootElements"),a),a.$parent=null),t&&(wt(o.get("rootElements"),a),a.$parent=o))}else Dr(e,"bpmn:DataOutputAssociation")?i="dataOutputAssociations":Dr(e,"bpmn:DataInputAssociation")&&(i="dataInputAssociations");if(!i)throw new Error(r("no parent for {element} in {parent}",{element:e.id,parent:t.id}));var s;if(e.$parent&&Et(s=e.$parent.get(i),e),t?((s=t.get(i)).push(e),e.$parent=t):e.$parent=null,n){var c=n.get(i);Et(s,e),t&&(c||(c=[],t.set(i,c)),c.push(e))}}},Om.prototype.updateConnectionWaypoints=function(e){e.businessObject.di.set("waypoint",this._bpmnFactory.createDiWaypoints(e.waypoints))},Om.prototype.updateConnection=function(e){var t,n=e.connection,i=Br(n),r=Br(n.source),o=Br(n.target);if(Dr(i,"bpmn:DataAssociation"))Dr(i,"bpmn:DataInputAssociation")?(i.get("sourceRef")[0]=r,t=e.parent||e.newParent||o,this.updateSemanticParent(i,o,t)):Dr(i,"bpmn:DataOutputAssociation")&&(t=e.parent||e.newParent||r,this.updateSemanticParent(i,r,t),i.targetRef=o);else{var a=Dr(i,"bpmn:SequenceFlow");i.sourceRef!==r&&(a&&(Et(i.sourceRef&&i.sourceRef.get("outgoing"),i),r&&r.get("outgoing")&&r.get("outgoing").push(i)),i.sourceRef=r),i.targetRef!==o&&(a&&(Et(i.targetRef&&i.targetRef.get("incoming"),i),o&&o.get("incoming")&&o.get("incoming").push(i)),i.targetRef=o)}this.updateConnectionWaypoints(n),this.updateDiConnection(i.di,r,o)},Om.prototype._getLabel=function(e){return e.label||(e.label=this._bpmnFactory.createDiLabel()),e.label},i(Tm,Un),Tm.$inject=["bpmnFactory","moddle","translate"],Tm.prototype.baseCreate=Un.prototype.create,Tm.prototype.create=function(e,t){return"label"===e?this.baseCreate(e,U({type:"label"},fo,t)):this.createBpmnElement(e,t)},Tm.prototype.createBpmnElement=function(e,t){var n,i,r,o=this._translate,a=(t=t||{}).businessObject;if(!a){if(!t.type)throw new Error(o("no shape type specified"));a=this._bpmnFactory.create(t.type)}return a.di||(a.di="root"===e?this._bpmnFactory.createDiPlane(a,[],{id:a.id+"_di"}):"connection"===e?this._bpmnFactory.createDiEdge(a,[],{id:a.id+"_di"}):this._bpmnFactory.createDiShape(a,{},{id:a.id+"_di"})),Dr(a,"bpmn:Group")&&(t=U({isFrame:!0},t)),t.di&&(U(a.di,t.di),delete t.di),function(e,t,n){_(n,(function(n){void 0!==t[n]&&Am(e,t,n)}))}(a,t,["processRef","isInterrupting","associationDirection","isForCompensation"]),t.isExpanded&&Am(a.di,t,"isExpanded"),Dr(a,"bpmn:ExclusiveGateway")&&(a.di.isMarkerVisible=!0),t.eventDefinitionType&&(i=a.get("eventDefinitions")||[],r=this._bpmnFactory.create(t.eventDefinitionType,t.eventDefinitionAttrs),"bpmn:ConditionalEventDefinition"===t.eventDefinitionType&&(r.condition=this._bpmnFactory.create("bpmn:FormalExpression")),i.push(r),r.$parent=a,a.eventDefinitions=i,delete t.eventDefinitionType),n=this._getDefaultSize(a),t=U({businessObject:a,id:a.id},n,t),this.baseCreate(e,t)},Tm.prototype._getDefaultSize=function(e){return Dr(e,"bpmn:SubProcess")?Nr(e)?{width:350,height:200}:{width:100,height:80}:Dr(e,"bpmn:Task")?{width:100,height:80}:Dr(e,"bpmn:Gateway")?{width:50,height:50}:Dr(e,"bpmn:Event")?{width:36,height:36}:Dr(e,"bpmn:Participant")?Nr(e)?{width:600,height:250}:{width:400,height:60}:Dr(e,"bpmn:Lane")?{width:400,height:100}:Dr(e,"bpmn:DataObjectReference")?{width:36,height:50}:Dr(e,"bpmn:DataStoreReference")?{width:50,height:50}:Dr(e,"bpmn:TextAnnotation")?{width:100,height:30}:Dr(e,"bpmn:Group")?{width:300,height:300}:{width:100,height:80}},Tm.prototype.createParticipantShape=function(e){return m(e)||(e={isExpanded:e}),!1!==(e=U({type:"bpmn:Participant"},e||{})).isExpanded&&(e.processRef=this._bpmnFactory.create("bpmn:Process")),this.createShape(e)},Rm.$inject=["modeling","canvas"],Rm.prototype.preExecute=function(e){var t=this._modeling,n=e.elements,i=e.alignment;_(n,(function(e){var n={x:0,y:0};i.left?n.x=i.left-e.x:i.right?n.x=i.right-e.width-e.x:i.center?n.x=i.center-Math.round(e.width/2)-e.x:i.top?n.y=i.top-e.y:i.bottom?n.y=i.bottom-e.height-e.y:i.middle&&(n.y=i.middle-Math.round(e.height/2)-e.y),t.moveElements([e],n,e.parent)}))},Rm.prototype.postExecute=function(e){},km.$inject=["modeling"],km.prototype.preExecute=function(e){var t=e.source;if(!t)throw new Error("source required");var n=e.target||t.parent,i=e.shape,r=e.hints||{};i=e.shape=this._modeling.createShape(i,e.position,n,{attach:r.attach}),e.shape=i},km.prototype.postExecute=function(e){var t,n,i=e.hints||{};t=e.source,n=e.shape,C(t.outgoing,(function(e){return e.target===n}))||(i.connectionTarget===e.source?this._modeling.connect(e.shape,e.source,e.connection):this._modeling.connect(e.source,e.shape,e.connection))},jm.$inject=["canvas","layouter"],jm.prototype.execute=function(e){var t=e.connection,n=e.source,i=e.target,r=e.parent,o=e.parentIndex,a=e.hints;if(!n||!i)throw new Error("source and target required");if(!r)throw new Error("parent required");return t.source=n,t.target=i,t.waypoints||(t.waypoints=this._layouter.layoutConnection(t,a)),this._canvas.addConnection(t,r,o),t},jm.prototype.revert=function(e){var t=e.connection;return this._canvas.removeConnection(t),t.source=null,t.target=null,t};var Mm=Math.round;function Dm(e){this._modeling=e}function Bm(e){return!!e.waypoints}Dm.$inject=["modeling"],Dm.prototype.preExecute=function(e){var t=e.elements,n=e.parent,i=e.parentIndex,r=e.position,o=e.hints,a=this._modeling;_(t,(function(e){f(e.x)||(e.x=0),f(e.y)||(e.y=0)}));var s=ft(t);_(t,(function(e){Bm(e)&&(e.waypoints=T(e.waypoints,(function(e){return{x:Mm(e.x-s.x-s.width/2+r.x),y:Mm(e.y-s.y-s.height/2+r.y)}}))),U(e,{x:Mm(e.x-s.x-s.width/2+r.x),y:Mm(e.y-s.y-s.height/2+r.y)})}));var c=ut(t),p={};_(t,(function(e){if(Bm(e))p[e.id]=f(i)?a.createConnection(p[e.source.id],p[e.target.id],i,e,e.parent||n,o):a.createConnection(p[e.source.id],p[e.target.id],e,e.parent||n,o);else{var t=U({},o);-1===c.indexOf(e)&&(t.autoResize=!1),p[e.id]=f(i)?a.createShape(e,G(e,["x","y","width","height"]),e.parent||n,i,t):a.createShape(e,G(e,["x","y","width","height"]),e.parent||n,t)}})),e.elements=k(p)};var Im=Math.round;function Nm(e){this._canvas=e}function Lm(e){Nm.call(this,e)}Nm.$inject=["canvas"],Nm.prototype.execute=function(e){var t=e.shape,n=e.position,i=e.parent,r=e.parentIndex;if(!i)throw new Error("parent required");if(!n)throw new Error("position required");return void 0!==n.width?U(t,n):U(t,{x:n.x-Im(t.width/2),y:n.y-Im(t.height/2)}),this._canvas.addShape(t,i,r),t},Nm.prototype.revert=function(e){var t=e.shape;return this._canvas.removeShape(t),t},i(Lm,Nm),Lm.$inject=["canvas"];var Fm=Nm.prototype.execute;Lm.prototype.execute=function(e){var t=e.shape;return function(e){["width","height"].forEach((function(t){void 0===e[t]&&(e[t]=0)}))}(t),t.labelTarget=e.labelTarget,Fm.call(this,e)};var Vm=Nm.prototype.revert;function $m(e,t){this._canvas=e,this._modeling=t}function zm(e,t){this._modeling=e,this._elementRegistry=t}function qm(e,t){this._canvas=e,this._modeling=t}function Um(e){this._modeling=e}Lm.prototype.revert=function(e){return e.shape.labelTarget=null,Vm.call(this,e)},$m.$inject=["canvas","modeling"],$m.prototype.execute=function(e){var t=e.connection,n=t.parent;return e.parent=n,e.parentIndex=_t(n.children,t),e.source=t.source,e.target=t.target,this._canvas.removeConnection(t),t.source=null,t.target=null,t},$m.prototype.revert=function(e){var t=e.connection,n=e.parent,i=e.parentIndex;return t.source=e.source,t.target=e.target,wt(n.children,t,i),this._canvas.addConnection(t,n),t},zm.$inject=["modeling","elementRegistry"],zm.prototype.postExecute=function(e){var t=this._modeling,n=this._elementRegistry;_(e.elements,(function(e){n.get(e.id)&&(e.waypoints?t.removeConnection(e):t.removeShape(e))}))},qm.$inject=["canvas","modeling"],qm.prototype.preExecute=function(e){var t=this._modeling,n=e.shape;Jh(n.incoming,(function(e){t.removeConnection(e,{nested:!0})})),Jh(n.outgoing,(function(e){t.removeConnection(e,{nested:!0})})),Jh(n.children,(function(e){e.waypoints?t.removeConnection(e,{nested:!0}):t.removeShape(e,{nested:!0})}))},qm.prototype.execute=function(e){var t=this._canvas,n=e.shape,i=n.parent;return e.oldParent=i,e.oldParentIndex=_t(i.children,n),t.removeShape(n),n},qm.prototype.revert=function(e){var t=this._canvas,n=e.shape,i=e.oldParent,r=e.oldParentIndex;return wt(i.children,n,r),t.addShape(n,i),n},Um.$inject=["modeling"];var Gm={x:"y",y:"x"};function Hm(e,t){this._layouter=e,this._canvas=t}function Wm(){}function Km(){this.allShapes={},this.allConnections={},this.enclosedElements={},this.enclosedConnections={},this.topLevel={}}function Xm(e){this._modeling=e}function Ym(e){this._helper=new Xm(e)}function Jm(e){this._modeling=e,this._helper=new Xm(e)}function Zm(e){this._modeling=e}function Qm(e){return e.original||e}function ef(e,t){this._modeling=e,this._rules=t}function tf(e){this._modeling=e}function nf(e){this._modeling=e}function rf(e){return U({},e)}function of(e){switch(e){case"n":return"y";case"w":return"x";case"s":return"y";case"e":return"x"}}function af(e,t,n){var i=of(n);return/e|s/.test(n)?e[i]>t:/n|w/.test(n)?e[i]<t:void 0}function sf(e,t){return-1!==e.indexOf(t)}function cf(e){this._modeling=e}function pf(e){var t={};return _(e,(function(e){t[e.id]=e.hidden,e.children&&(t=U({},t,pf(e.children)))})),t}function uf(e,t){var n=[];return _(e,(function(e){e.hidden=t,n=n.concat(e),e.children&&(n=n.concat(uf(e.children,e.collapsed||t)))})),n}function lf(e,t){var n=[];return _(e,(function(e){e.hidden=t[e.id],n=n.concat(e),e.children&&(n=n.concat(lf(e.children,t)))})),n}function df(e){this._modeling=e}function hf(e,t){return Et(e&&e.attachers,t)}function mf(e,t,n){if(e){var i=e.attachers;i||(e.attachers=i=[]),wt(i,t,n)}}function ff(){}function vf(e,t,n){this._eventBus=e,this._elementFactory=t,this._commandStack=n;var i=this;e.on("diagram.init",(function(){i.registerHandlers(n)}))}function yf(e){this._elementRegistry=e}function gf(e,t){_(t,(function(t,n){e.set(n,t)}))}Um.prototype.preExecute=function(e){var t=this._modeling,n=e.groups,i=e.axis,r=e.dimension;function o(e,t){e.range.min=Math.min(t[i],e.range.min),e.range.max=Math.max(t[i]+t[r],e.range.max)}function a(e){return e[i]+e[r]/2}function s(e){return e.length-1}function c(e){return e.max-e.min}var p,u,l=n[0],d=s(n),h=n[d],m=0;_(n,(function(e,p){var u,l,h;e.elements.length<2?p&&p!==n.length-1&&(o(e,e.elements[0]),m+=c(e.range)):(l=(u=B(e.elements,i))[0],p===d&&(l=u[s(u)]),h=a(l),e.range=null,_(u,(function(n){!function(e,n){var r={y:0};r[i]=e-a(n),r[i]&&(r[Gm[i]]=0,t.moveElements([n],r,n.parent))}(h,n),null!==e.range?o(e,n):e.range={min:n[i],max:n[i]+n[r]}})),p&&p!==n.length-1&&(m+=c(e.range)))})),u=Math.abs(h.range.min-l.range.max),(p=Math.round((u-m)/(n.length-1)))<n.length-1||_(n,(function(e,o){var a,s={};e!==l&&e!==h&&(a=n[o-1],e.range.max=0,_(e.elements,(function(n,o){s[Gm[i]]=0,s[i]=a.range.max-n[i]+p,e.range.min!==n[i]&&(s[i]+=n[i]-e.range.min),s[i]&&t.moveElements([n],s,n.parent),e.range.max=Math.max(n[i]+n[r],o?e.range.max:0)})))}))},Um.prototype.postExecute=function(e){},Hm.$inject=["layouter","canvas"],Hm.prototype.execute=function(e){var t=e.connection;return U(e,{oldWaypoints:t.waypoints}),t.waypoints=this._layouter.layoutConnection(t,e.hints),t},Hm.prototype.revert=function(e){var t=e.connection;return t.waypoints=e.oldWaypoints,t},Wm.prototype.execute=function(e){var t=e.connection,n=e.delta,i=e.newParent||t.parent,r=e.newParentIndex,o=t.parent;return e.oldParent=o,e.oldParentIndex=Et(o.children,t),wt(i.children,t,r),t.parent=i,_(t.waypoints,(function(e){e.x+=n.x,e.y+=n.y,e.original&&(e.original.x+=n.x,e.original.y+=n.y)})),t},Wm.prototype.revert=function(e){var t=e.connection,n=t.parent,i=e.oldParent,r=e.oldParentIndex,o=e.delta;return Et(n.children,t),wt(i.children,t,r),t.parent=i,_(t.waypoints,(function(e){e.x-=o.x,e.y-=o.y,e.original&&(e.original.x-=o.x,e.original.y-=o.y)})),t},Km.prototype.add=function(e,t){return this.addAll([e],t)},Km.prototype.addAll=function(e,t){return U(this,function(e,t,n){u(t)&&(t=!0),m(t)&&(n=t,t=!0);var i=gt((n=n||{}).allShapes),r=gt(n.allConnections),o=gt(n.enclosedElements),a=gt(n.enclosedConnections),s=gt(n.topLevel,t&&j(e,(function(e){return e.id})));function c(e){s[e.source.id]&&s[e.target.id]&&(s[e.id]=[e]),i[e.source.id]&&i[e.target.id]&&(a[e.id]=o[e.id]=e),r[e.id]=e}return ht(e,(function(e){if(o[e.id]=e,!e.waypoints)return i[e.id]=e,_(e.incoming,c),_(e.outgoing,c),e.children;a[e.id]=r[e.id]=e})),{allShapes:i,allConnections:r,topLevel:s,enclosedConnections:a,enclosedElements:o}}(e,!!t,this)),this},Xm.prototype.moveRecursive=function(e,t,n){return e?this.moveClosure(this.getClosure(e),t,n):[]},Xm.prototype.moveClosure=function(e,t,n,i,r){var o=this._modeling,a=e.allShapes,s=e.allConnections,c=e.enclosedConnections,p=e.topLevel,u=!1;r&&r.parent===n&&(u=!0),_(a,(function(e){o.moveShape(e,t,p[e.id]&&!u&&n,{recurse:!1,layout:!1})})),_(s,(function(e){var i=!!a[e.source.id],r=!!a[e.target.id];c[e.id]&&i&&r?o.moveConnection(e,t,p[e.id]&&!u&&n):o.layoutConnection(e,{connectionStart:i&&Ed(e,e.source,t),connectionEnd:r&&wd(e,e.target,t)})}))},Xm.prototype.getClosure=function(e){return(new Km).addAll(e,!0)},Ym.$inject=["modeling"],Ym.prototype.preExecute=function(e){e.closure=this._helper.getClosure(e.shapes)},Ym.prototype.postExecute=function(e){var t,n=e.hints;n&&n.primaryShape&&(t=n.primaryShape,n.oldParent=t.parent),this._helper.moveClosure(e.closure,e.delta,e.newParent,e.newHost,t)},Jm.$inject=["modeling"],Jm.prototype.execute=function(e){var t=e.shape,n=e.delta,i=e.newParent||t.parent,r=e.newParentIndex,o=t.parent;return e.oldBounds=G(t,["x","y","width","height"]),e.oldParent=o,e.oldParentIndex=Et(o.children,t),wt(i.children,t,r),U(t,{parent:i,x:t.x+n.x,y:t.y+n.y}),t},Jm.prototype.postExecute=function(e){var t=e.shape,n=e.delta,i=e.hints,r=this._modeling;!1!==i.layout&&(_(t.incoming,(function(e){r.layoutConnection(e,{connectionEnd:wd(e,t,n)})})),_(t.outgoing,(function(e){r.layoutConnection(e,{connectionStart:Ed(e,t,n)})}))),!1!==i.recurse&&this.moveChildren(e)},Jm.prototype.revert=function(e){var t=e.shape,n=e.oldParent,i=e.oldParentIndex,r=e.delta;return wt(n.children,t,i),U(t,{parent:n,x:t.x-r.x,y:t.y-r.y}),t},Jm.prototype.moveChildren=function(e){var t=e.delta,n=e.shape;this._helper.moveRecursive(n.children,t,null)},Jm.prototype.getNewParent=function(e){return e.newParent||e.shape.parent},Zm.$inject=["modeling"],Zm.prototype.execute=function(e){var t=e.newSource,n=e.newTarget,i=e.connection,r=e.dockingOrPoints;if(!t&&!n)throw new Error("newSource or newTarget required");return h(r)&&(e.oldWaypoints=i.waypoints,i.waypoints=r),t&&(e.oldSource=i.source,i.source=t),n&&(e.oldTarget=i.target,i.target=n),i},Zm.prototype.postExecute=function(e){var t=e.connection,n=e.newSource,i=e.newTarget,r=e.dockingOrPoints,o=e.hints||{},a={};o.connectionStart&&(a.connectionStart=o.connectionStart),o.connectionEnd&&(a.connectionEnd=o.connectionEnd),!1!==o.layoutConnection&&(!n||i&&"source"!==o.docking||(a.connectionStart=a.connectionStart||Qm(h(r)?r[0]:r)),!i||n&&"target"!==o.docking||(a.connectionEnd=a.connectionEnd||Qm(h(r)?r[r.length-1]:r)),o.newWaypoints&&(a.waypoints=o.newWaypoints),this._modeling.layoutConnection(t,a))},Zm.prototype.revert=function(e){var t=e.oldSource,n=e.oldTarget,i=e.oldWaypoints,r=e.connection;return t&&(r.source=t),n&&(r.target=n),i&&(r.waypoints=i),r},ef.$inject=["modeling","rules"],ef.prototype.preExecute=function(e){var t,n=this,i=this._modeling,r=this._rules,o=e.oldShape,a=e.newData,s=e.hints||{};function c(e,t,n){return r.allowed("connection.reconnect",{connection:n,source:e,target:t})}var p,u={x:a.x,y:a.y},l={x:o.x,y:o.y,width:o.width,height:o.height};t=e.newShape=e.newShape||n.createShape(a,u,o.parent,s),o.host&&i.updateAttachment(t,o.host),!1!==s.moveChildren&&(p=o.children.slice(),i.moveElements(p,{x:0,y:0},t,s));var d=o.incoming.slice(),h=o.outgoing.slice();_(d,(function(e){c(e.source,t,e)&&n.reconnectEnd(e,t,xd(e,t,l),s)})),_(h,(function(e){var i=e.target;c(t,i,e)&&n.reconnectStart(e,t,bd(e,t,l),s)}))},ef.prototype.postExecute=function(e){var t=e.oldShape;this._modeling.removeShape(t)},ef.prototype.execute=function(e){},ef.prototype.revert=function(e){},ef.prototype.createShape=function(e,t,n,i){return this._modeling.createShape(e,t,n,i)},ef.prototype.reconnectStart=function(e,t,n,i){this._modeling.reconnectStart(e,t,n,i)},ef.prototype.reconnectEnd=function(e,t,n,i){this._modeling.reconnectEnd(e,t,n,i)},tf.$inject=["modeling"],tf.prototype.execute=function(e){var t=e.shape,n=e.newBounds,i=e.minBounds;if(void 0===n.x||void 0===n.y||void 0===n.width||void 0===n.height)throw new Error("newBounds must have {x, y, width, height} properties");if(i&&(n.width<i.width||n.height<i.height))throw new Error("width and height cannot be less than minimum height and width");if(!i&&n.width<10||n.height<10)throw new Error("width and height cannot be less than 10px");return e.oldBounds={width:t.width,height:t.height,x:t.x,y:t.y},U(t,{width:n.width,height:n.height,x:n.x,y:n.y}),t},tf.prototype.postExecute=function(e){var t=this._modeling,n=e.shape,i=e.oldBounds;!1!==(e.hints||{}).layout&&(_(n.incoming,(function(e){t.layoutConnection(e,{connectionEnd:xd(e,n,i)})})),_(n.outgoing,(function(e){t.layoutConnection(e,{connectionStart:bd(e,n,i)})})))},tf.prototype.revert=function(e){var t=e.shape,n=e.oldBounds;return U(t,{width:n.width,height:n.height,x:n.x,y:n.y}),t},nf.$inject=["modeling"],nf.prototype.preExecute=function(e){var t=e.delta,n=e.direction,i=e.movingShapes,r=e.resizingShapes,o=e.start,a={};this.moveShapes(i,t),_(r,(function(e){a[e.id]=function(e){return{x:e.x,y:e.y,height:e.height,width:e.width}}(e)})),this.resizeShapes(r,t,n),this.updateConnectionWaypoints(function(e,t){var n=[];return _(e.concat(t),(function(i){var r=i.incoming,o=i.outgoing;_(r.concat(o),(function(i){var r=i.source,o=i.target;(sm(e,r)||sm(e,o)||sm(t,r)||sm(t,o))&&(sm(n,i)||n.push(i))}))})),n}(i,r),t,n,o,i,r,a)},nf.prototype.execute=function(){},nf.prototype.revert=function(){},nf.prototype.moveShapes=function(e,t){var n=this;_(e,(function(e){n._modeling.moveShape(e,t,null,{autoResize:!1,layout:!1,recurse:!1})}))},nf.prototype.resizeShapes=function(e,t,n){var i=this;_(e,(function(e){var r=function(e,t,n){var i=e.x,r=e.y,o=e.width,a=e.height,s=n.x,c=n.y;switch(t){case"n":return{x:i,y:r+c,width:o,height:a-c};case"s":return{x:i,y:r,width:o,height:a+c};case"w":return{x:i+s,y:r,width:o-s,height:a};case"e":return{x:i,y:r,width:o+s,height:a};default:throw new Error("unknown direction: "+t)}}(e,n,t);i._modeling.resizeShape(e,r,null,{attachSupport:!1,autoResize:!1,layout:!1})}))},nf.prototype.updateConnectionWaypoints=function(e,t,n,i,r,o,a){var s=this,c=r.concat(o);_(e,(function(e){var p=e.source,u=e.target,l=function(e){return T(e.waypoints,(function(e){return(e=rf(e)).original&&(e.original=rf(e.original)),e}))}(e),d=of(n),h={labelBehavior:!1};sf(c,p)&&sf(c,u)?(l=T(l,(function(e){return af(e,i,n)&&(e[d]=e[d]+t[d]),e.original&&af(e.original,i,n)&&(e.original[d]=e.original[d]+t[d]),e})),s._modeling.updateWaypoints(e,l,{labelBehavior:!1})):(sf(c,p)||sf(c,u))&&(sf(r,p)?h.connectionStart=Ed(e,p,t):sf(r,u)?h.connectionEnd=wd(e,u,t):sf(o,p)?h.connectionStart=bd(e,p,a[p.id]):sf(o,u)&&(h.connectionEnd=xd(e,u,a[u.id])),s._modeling.layoutConnection(e,h))}))},cf.$inject=["modeling"],cf.prototype.execute=function(e){var t=e.shape,n=t.children;e.oldChildrenVisibility=pf(n),t.collapsed=!t.collapsed;var i=uf(n,t.collapsed);return[t].concat(i)},cf.prototype.revert=function(e){var t=e.shape,n=e.oldChildrenVisibility,i=lf(t.children,n);return t.collapsed=!t.collapsed,[t].concat(i)},df.$inject=["modeling"],df.prototype.execute=function(e){var t=e.shape,n=e.newHost,i=t.host;return e.oldHost=i,e.attacherIdx=hf(i,t),mf(n,t),t.host=n,t},df.prototype.revert=function(e){var t=e.shape,n=e.newHost,i=e.oldHost,r=e.attacherIdx;return t.host=i,hf(n,t),mf(i,t,r),t},ff.prototype.execute=function(e){var t=e.connection,n=e.newWaypoints;return e.oldWaypoints=t.waypoints,t.waypoints=n,t},ff.prototype.revert=function(e){var t=e.connection,n=e.oldWaypoints;return t.waypoints=n,t},vf.$inject=["eventBus","elementFactory","commandStack"],vf.prototype.getHandlers=function(){return{"shape.append":km,"shape.create":Nm,"shape.delete":qm,"shape.move":Jm,"shape.resize":tf,"shape.replace":ef,"shape.toggleCollapse":cf,spaceTool:nf,"label.create":Lm,"connection.create":jm,"connection.delete":$m,"connection.move":Wm,"connection.layout":Hm,"connection.updateWaypoints":ff,"connection.reconnect":Zm,"elements.create":Dm,"elements.move":Ym,"elements.delete":zm,"elements.distribute":Um,"elements.align":Rm,"element.updateAttachment":df}},vf.prototype.registerHandlers=function(e){_(this.getHandlers(),(function(t,n){e.registerHandler(n,t)}))},vf.prototype.moveShape=function(e,t,n,i,r){"object"==typeof i&&(r=i,i=null);var o={shape:e,delta:t,newParent:n,newParentIndex:i,hints:r||{}};this._commandStack.execute("shape.move",o)},vf.prototype.updateAttachment=function(e,t){var n={shape:e,newHost:t};this._commandStack.execute("element.updateAttachment",n)},vf.prototype.moveElements=function(e,t,n,i){var r,o=(i=i||{}).attach,a=n;!0===o?(r=n,a=n.parent):!1===o&&(r=null);var s={shapes:e,delta:t,newParent:a,newHost:r,hints:i};this._commandStack.execute("elements.move",s)},vf.prototype.moveConnection=function(e,t,n,i,r){"object"==typeof i&&(r=i,i=void 0);var o={connection:e,delta:t,newParent:n,newParentIndex:i,hints:r||{}};this._commandStack.execute("connection.move",o)},vf.prototype.layoutConnection=function(e,t){var n={connection:e,hints:t||{}};this._commandStack.execute("connection.layout",n)},vf.prototype.createConnection=function(e,t,n,i,r,o){"object"==typeof n&&(o=r,r=i,i=n,n=void 0);var a={source:e,target:t,parent:r,parentIndex:n,connection:i=this._create("connection",i),hints:o};return this._commandStack.execute("connection.create",a),a.connection},vf.prototype.createShape=function(e,t,n,i,r){"number"!=typeof i&&(r=i,i=void 0);var o,a,s=(r=r||{}).attach;e=this._create("shape",e),s?(o=n.parent,a=n):o=n;var c={position:t,shape:e,parent:o,parentIndex:i,host:a,hints:r};return this._commandStack.execute("shape.create",c),c.shape},vf.prototype.createElements=function(e,t,n,i,r){h(e)||(e=[e]),"number"!=typeof i&&(r=i,i=void 0);var o={position:t,elements:e,parent:n,parentIndex:i,hints:r=r||{}};return this._commandStack.execute("elements.create",o),o.elements},vf.prototype.createLabel=function(e,t,n,i){n=this._create("label",n);var r={labelTarget:e,position:t,parent:i||e.parent,shape:n};return this._commandStack.execute("label.create",r),r.shape},vf.prototype.appendShape=function(e,t,n,i,r){r=r||{};var o={source:e,position:n,target:i,shape:t=this._create("shape",t),connection:r.connection,connectionParent:r.connectionParent,hints:r};return this._commandStack.execute("shape.append",o),o.shape},vf.prototype.removeElements=function(e){var t={elements:e};this._commandStack.execute("elements.delete",t)},vf.prototype.distributeElements=function(e,t,n){var i={groups:e,axis:t,dimension:n};this._commandStack.execute("elements.distribute",i)},vf.prototype.removeShape=function(e,t){var n={shape:e,hints:t||{}};this._commandStack.execute("shape.delete",n)},vf.prototype.removeConnection=function(e,t){var n={connection:e,hints:t||{}};this._commandStack.execute("connection.delete",n)},vf.prototype.replaceShape=function(e,t,n){var i={oldShape:e,newData:t,hints:n||{}};return this._commandStack.execute("shape.replace",i),i.newShape},vf.prototype.alignElements=function(e,t){var n={elements:e,alignment:t};this._commandStack.execute("elements.align",n)},vf.prototype.resizeShape=function(e,t,n,i){var r={shape:e,newBounds:t,minBounds:n,hints:i};this._commandStack.execute("shape.resize",r)},vf.prototype.createSpace=function(e,t,n,i,r){var o={delta:n,direction:i,movingShapes:e,resizingShapes:t,start:r};this._commandStack.execute("spaceTool",o)},vf.prototype.updateWaypoints=function(e,t,n){var i={connection:e,newWaypoints:t,hints:n||{}};this._commandStack.execute("connection.updateWaypoints",i)},vf.prototype.reconnect=function(e,t,n,i,r){var o={connection:e,newSource:t,newTarget:n,dockingOrPoints:i,hints:r||{}};this._commandStack.execute("connection.reconnect",o)},vf.prototype.reconnectStart=function(e,t,n,i){i||(i={}),this.reconnect(e,t,e.target,n,U(i,{docking:"source"}))},vf.prototype.reconnectEnd=function(e,t,n,i){i||(i={}),this.reconnect(e,e.source,t,n,U(i,{docking:"target"}))},vf.prototype.connect=function(e,t,n,i){return this.createConnection(e,t,n||{},e.parent,i)},vf.prototype._create=function(e,t){return t instanceof Ln?t:this._elementFactory.create(e,t)},vf.prototype.toggleCollapse=function(e,t){var n={shape:e,hints:t||{}};this._commandStack.execute("shape.toggleCollapse",n)},yf.$inject=["elementRegistry"],yf.prototype.execute=function(e){var t=e.element,n=e.moddleElement,i=e.properties;if(!n)throw new Error("<moddleElement> required");var r=e.changed||this.getVisualReferences(n).concat(t),o=e.oldProperties||function(e,t){return S(t,(function(t,n){return t[n]=e.get(n),t}),{})}(n,A(i));return gf(n,i),e.oldProperties=o,e.changed=r,r},yf.prototype.revert=function(e){var t=e.oldProperties,n=e.moddleElement,i=e.changed;return gf(n,t),i},yf.prototype.getVisualReferences=function(e){var t=this._elementRegistry;return Dr(e,"bpmn:DataObject")?function(e,t){return t.filter((function(t){return Dr(t,"bpmn:DataObjectReference")&&Br(t).dataObjectRef===e}))}(e,t):[]};var bf="default",xf="id",Ef="di",wf={width:0,height:0};function _f(e,t,n,i,r){this._elementRegistry=e,this._moddle=t,this._translate=n,this._modeling=i,this._textRenderer=r}function Pf(e,t){return xf in e&&e.id!==t.id}function Sf(e,t){_(t,(function(t,n){n!==Ef?e.set(n,t):e.di&&function(e,t){_(t,(function(t,n){e.set(n,t)}))}(e.di,t)}))}_f.$inject=["elementRegistry","moddle","translate","modeling","textRenderer"],_f.prototype.execute=function(e){var t=e.element,n=[t],i=this._translate;if(!t)throw new Error(i("element required"));var r=this._elementRegistry,o=this._moddle.ids,a=t.businessObject,s=function(e){var t=U({},e);return Of.forEach((function(n){n in e&&(t[n]=Br(t[n]))})),t}(e.properties),c=e.oldProperties||function(e,t){return S(A(t),(function(n,i){return n[i]=i!==Ef?e.get(i):function(e,t){return S(t,(function(t,n){return t[n]=e.get(n),t}),{})}(e.di,A(t.di)),n}),{})}(a,s);return Pf(s,a)&&(o.unclaim(a.id),r.updateId(t,s.id),o.claim(s.id,a)),bf in s&&(s.default&&n.push(r.get(s.default.id)),a.default&&n.push(r.get(a.default.id))),Sf(a,s),e.oldProperties=c,e.changed=n,n},_f.prototype.postExecute=function(e){var t=e.element.label,n=t&&Br(t).name;if(n){var i=this._textRenderer.getExternalLabelBounds(t,n);this._modeling.resizeShape(t,i,wf)}},_f.prototype.revert=function(e){var t=e.element,n=e.properties,i=e.oldProperties,r=t.businessObject,o=this._elementRegistry,a=this._moddle.ids;return Sf(r,i),Pf(n,r)&&(a.unclaim(n.id),o.updateId(t,i.id),a.claim(i.id,r)),e.changed};var Of=["default"];function Cf(e,t){this._canvas=e,this._modeling=t}function Tf(e,t){this._modeling=e,this._spaceTool=t}function Af(e,t){this._modeling=e,this._translate=t}function Rf(e,t){this._modeling=e,this._spaceTool=t}Cf.$inject=["canvas","modeling"],Cf.prototype.execute=function(e){var t=this._canvas,n=e.newRoot,i=n.businessObject,r=t.getRootElement(),o=r.businessObject,a=o.$parent,s=o.di;t.setRootElement(n,!0),wt(a.rootElements,i),i.$parent=a,Et(a.rootElements,o),o.$parent=null,o.di=null,s.bpmnElement=i,i.di=s,e.oldRoot=r},Cf.prototype.revert=function(e){var t=this._canvas,n=e.newRoot.businessObject,i=e.oldRoot,r=i.businessObject,o=n.$parent,a=n.di;t.setRootElement(i,!0),Et(o.rootElements,n),n.$parent=null,wt(o.rootElements,r),r.$parent=o,n.di=null,a.bpmnElement=r,r.di=a},Tf.$inject=["modeling","spaceTool"],Tf.prototype.preExecute=function(e){var t=this._spaceTool,n=this._modeling,i=e.shape,r=e.location,o=nu(i),a=o===i,s=a?i:i.parent;tu(s).length||n.createShape({type:"bpmn:Lane"},{x:i.x+Qp,y:i.y,width:i.width-Qp,height:i.height},s);var c=[];ht(o,(function(e){return c.push(e),e.label&&c.push(e.label),e===i?[]:w(e.children,(function(e){return e!==i}))}));var p="top"===r?-120:120,u="top"===r?i.y:i.y+i.height,l=u+("top"===r?10:-10),d="top"===r?"n":"s",h=t.calculateAdjustments(c,"y",p,l);t.makeSpace(h.movingShapes,h.resizingShapes,{x:0,y:p},d,l),e.newLane=n.createShape({type:"bpmn:Lane"},{x:i.x+(a?Qp:0),y:u-("top"===r?120:0),width:i.width-(a?Qp:0),height:120},s)},Af.$inject=["modeling","translate"],Af.prototype.preExecute=function(e){var t=this._modeling,n=this._translate,i=e.shape,r=e.count,o=tu(i),a=o.length;if(a>r)throw new Error(n("more than {count} child lanes",{count:r}));var s,c,p,u,l,d=Math.round(i.height/r);for(l=0;l<r;l++)s=i.y+l*d,c=l===r-1?i.height-d*l:d,p={x:i.x+Qp,y:s,width:i.width-Qp,height:c},l<a?t.resizeShape(o[l],p):(u={type:"bpmn:Lane"},t.createShape(u,p,i))},Rf.$inject=["modeling","spaceTool"],Rf.prototype.preExecute=function(e){var t=e.shape,n=e.newBounds;!1!==e.balanced?this.resizeBalanced(t,n):this.resizeSpace(t,n)},Rf.prototype.resizeBalanced=function(e,t){var n=this._modeling,i=iu(e,t);n.resizeShape(e,t),i.forEach((function(e){n.resizeShape(e.shape,e.newBounds)}))},Rf.prototype.resizeSpace=function(e,t){var n,i,r,o,a,s=this._spaceTool,c=hn(e),p=Hp(hn(t),c),u=nu(e),l=[],d=[];ht(u,(function(e){return l.push(e),(Dr(e,"bpmn:Lane")||Dr(e,"bpmn:Participant"))&&d.push(e),e.children})),(p.bottom||p.top)&&(n=p.bottom||p.top,i=e.y+(p.bottom?e.height:0)+(p.bottom?-10:10),r=p.bottom?"s":"n",o=p.top>0||p.bottom<0?-n:n,a=s.calculateAdjustments(l,"y",o,i),s.makeSpace(a.movingShapes,a.resizingShapes,{x:0,y:n},r)),(p.left||p.right)&&(n=p.right||p.left,i=e.x+(p.right?e.width:0)+(p.right?-10:100),r=p.right?"e":"w",o=p.left>0||p.right<0?-n:n,a=s.calculateAdjustments(d,"x",o,i),s.makeSpace(a.movingShapes,a.resizingShapes,{x:n,y:0},r))};var kf="flowNodeRef",jf="lanes";function Mf(e){this._elementRegistry=e}function Df(e){this._moddle=e}Mf.$inject=["elementRegistry"],Mf.prototype.computeUpdates=function(e,t){var n=[],i=[],r={},o=[];function a(e){-1===n.indexOf(e)&&(o.push(e),n.push(e))}function s(e){return e.parent?function(e){var t=nu(e);return r[t.id]||(r[t.id]=eu(t)),r[t.id]}(e).filter((function(t){return n=e,i=hn(t),r=n.x+n.width/2,o=n.y+n.height/2,r>i.left&&r<i.right&&o>i.top&&o<i.bottom;var n,i,r,o})).map((function(e){return e.businessObject})):[]}return t.forEach((function(e){var t=nu(e);t&&-1===n.indexOf(t)&&(t.children.filter((function(e){return Dr(e,"bpmn:FlowNode")})).forEach(a),n.push(t))})),e.forEach(a),o.forEach((function(e){var t=e.businessObject,n=t.get(jf).slice(),r=s(e);i.push({flowNode:t,remove:n,add:r})})),t.forEach((function(e){var t=e.businessObject;e.parent||t.get(kf).forEach((function(e){i.push({flowNode:e,remove:[t],add:[]})}))})),i},Mf.prototype.execute=function(e){var t=e.updates;t||(t=e.updates=this.computeUpdates(e.flowNodeShapes,e.laneShapes)),t.forEach((function(e){var t=e.flowNode,n=t.get(jf);e.remove.forEach((function(e){Et(n,e),Et(e.get(kf),t)})),e.add.forEach((function(e){wt(n,e),wt(e.get(kf),t)}))}))},Mf.prototype.revert=function(e){e.updates.forEach((function(e){var t=e.flowNode,n=t.get(jf);e.add.forEach((function(e){Et(n,e),Et(e.get(kf),t)})),e.remove.forEach((function(e){wt(n,e),wt(e.get(kf),t)}))}))},Df.$inject=["moddle"],Df.prototype.execute=function(e){var t=this._moddle.ids,n=e.id,i=e.element;e.claiming?t.claim(n,i):t.unclaim(n)},Df.prototype.revert=function(e){var t=this._moddle.ids,n=e.id,i=e.element;e.claiming?t.unclaim(n):t.claim(n,i)};var Bf={fill:void 0,stroke:void 0};function If(e){this._commandStack=e,this._normalizeColor=function(e){if(e){if(y(e)){var t=function(e){var t=document.createElement("canvas").getContext("2d");return t.fillStyle="transparent",t.fillStyle=e,/^#[0-9a-fA-F]{6}$/.test(t.fillStyle)?t.fillStyle:null}(e);if(t)return t}throw new Error("invalid color value: "+e)}}}If.$inject=["commandStack"],If.prototype.postExecute=function(e){var t=e.elements,n=e.colors||Bf,i=this,r={};"fill"in n&&U(r,{"background-color":this._normalizeColor(n.fill)}),"stroke"in n&&U(r,{"border-color":this._normalizeColor(n.stroke)}),_(t,(function(e){var t=function(e){return!!e.waypoints}(e)?G(r,["border-color"]):r;!function(e){"border-color"in e&&(e.stroke=e["border-color"]);"background-color"in e&&(e.fill=e["background-color"])}(t),i._commandStack.execute("element.updateProperties",{element:e,properties:{di:t}})}))};var Nf={width:0,height:0};function Lf(e,t){function n(e,t){var n=e.label||e,i=e.labelTarget||e;return function(e,t,n){var i=e.businessObject,r=Gr(i);r&&("categoryValueRef"===r?i.categoryValueRef.value=t:i[r]=t)}(n,t),[n,i]}this.preExecute=function(t){var n=t.element,i=n.businessObject,r=t.newLabel;if(!xo(n)&&vo(n)&&!yo(n)&&!Ff(r)){var o=bo(n);o={x:o.x,y:o.y+7},e.createLabel(n,o,{id:i.id+"_label",businessObject:i})}},this.execute=function(e){return e.oldLabel=Hr(e.element),n(e.element,e.newLabel)},this.revert=function(e){return n(e.element,e.oldLabel)},this.postExecute=function(n){var i=n.element,r=i.label||i,o=n.newLabel,a=n.newBounds,s=n.hints||{};if(xo(r)||Dr(r,"bpmn:TextAnnotation"))if(xo(r)&&Ff(o))!1!==s.removeShape&&e.removeShape(r,{unsetLabel:!1});else{var c=Hr(r);void 0===a&&(a=t.getExternalLabelBounds(r,c)),a&&e.resizeShape(r,a,Nf)}}}function Ff(e){return!e||!e.trim()}function Vf(e,t,n,i){vf.call(this,e,t,n),this._bpmnRules=i}function $f(){}Lf.$inject=["modeling","textRenderer"],i(Vf,vf),Vf.$inject=["eventBus","elementFactory","commandStack","bpmnRules"],Vf.prototype.getHandlers=function(){var e=vf.prototype.getHandlers.call(this);return e["element.updateModdleProperties"]=yf,e["element.updateProperties"]=_f,e["canvas.updateRoot"]=Cf,e["lane.add"]=Tf,e["lane.resize"]=Rf,e["lane.split"]=Af,e["lane.updateRefs"]=Mf,e["id.updateClaim"]=Df,e["element.setColor"]=If,e["element.updateLabel"]=Lf,e},Vf.prototype.updateLabel=function(e,t,n,i){this._commandStack.execute("element.updateLabel",{element:e,newLabel:t,newBounds:n,hints:i||{}})},Vf.prototype.connect=function(e,t,n,i){var r=this._bpmnRules;if(n||(n=r.canConnect(e,t)),n)return this.createConnection(e,t,n,e.parent,i)},Vf.prototype.updateModdleProperties=function(e,t,n){this._commandStack.execute("element.updateModdleProperties",{element:e,moddleElement:t,properties:n})},Vf.prototype.updateProperties=function(e,t){this._commandStack.execute("element.updateProperties",{element:e,properties:t})},Vf.prototype.resizeLane=function(e,t,n){this._commandStack.execute("lane.resize",{shape:e,newBounds:t,balanced:n})},Vf.prototype.addLane=function(e,t){var n={shape:e,location:t};return this._commandStack.execute("lane.add",n),n.newLane},Vf.prototype.splitLane=function(e,t){this._commandStack.execute("lane.split",{shape:e,count:t})},Vf.prototype.makeCollaboration=function(){var e=this._create("root",{type:"bpmn:Collaboration"}),t={newRoot:e};return this._commandStack.execute("canvas.updateRoot",t),e},Vf.prototype.updateLaneRefs=function(e,t){this._commandStack.execute("lane.updateRefs",{flowNodeShapes:e,laneShapes:t})},Vf.prototype.makeProcess=function(){var e={newRoot:this._create("root",{type:"bpmn:Process"})};this._commandStack.execute("canvas.updateRoot",e)},Vf.prototype.claimId=function(e,t){this._commandStack.execute("id.updateClaim",{id:e,element:t,claiming:!0})},Vf.prototype.unclaimId=function(e,t){this._commandStack.execute("id.updateClaim",{id:e,element:t})},Vf.prototype.setColor=function(e,t){e.length||(e=[e]),this._commandStack.execute("element.setColor",{elements:e,colors:t})},$f.prototype.layoutConnection=function(e,t){return[(t=t||{}).connectionStart||fn(t.source||e.source),t.connectionEnd||fn(t.target||e.target)]};var zf=Math.round,qf={"h:h":20,"v:v":20,"h:v":-10,"v:h":-10};function Uf(e,t,n){var i,r,o,a=vn(t,e,5),s=n.split(":")[0],c=zf((t.x-e.x)/2+e.x),p=zf((t.y-e.y)/2+e.y),u=(o=a,{t:/top/,r:/right/,b:/bottom/,l:/left/,h:/left|right/,v:/top|bottom/}[s].test(o)),l=/h|r|l/.test(s),d=!1;return u?(i=l?{x:c,y:e.y}:{x:e.x,y:p},r=l?"h:h":"v:v"):(r=l?"h:v":"v:h",function(e,t){return!{t:/top/,r:/right/,b:/bottom/,l:/left/,h:/./,v:/./}[t].test(e)}(a,s)?l?(d=p===e.y,i={x:e.x+20*(/l/.test(s)?-1:1),y:d?p+20:p}):i={x:(d=c===e.x)?c+20:c,y:e.y+20*(/t/.test(s)?-1:1)}:i={x:c,y:p}),{waypoints:Hf(e,i,r).concat(i),directions:r,turnNextDirections:d}}function Gf(e){return e.split(":").reverse().join(":")}function Hf(e,t,n){if(!function(e){return e&&/^h|v|t|r|b|l:h|v|t|r|b|l$/.test(e)}(n=n||"h:h"))throw new Error("unknown directions: <"+n+">: must be specified as <start>:<end> with start/end in { h,v,t,r,b,l }");if(Jf(n)){var i=function(e,t,n){return Uf(e,t,n)}(e,t,n),r=function(e,t,n){var i=Uf(t,e,Gf(n));return{waypoints:i.waypoints.slice().reverse(),directions:Gf(i.directions),turnNextDirections:i.turnNextDirections}}(e,t,n),o=function(e,t){var n=e.directions.split(":")[1],i=t.directions.split(":")[0];e.turnNextDirections&&(n="h"==n?"v":"h"),t.turnNextDirections&&(i="h"==i?"v":"h");var r=n+":"+i;return{waypoints:Hf(e.waypoints[e.waypoints.length-1],t.waypoints[0],r),directions:r}}(i,r);return[].concat(i.waypoints,o.waypoints,r.waypoints)}return function(e,t,n){var i=zf((t.x-e.x)/2+e.x),r=zf((t.y-e.y)/2+e.y);if("h:v"===n)return[{x:t.x,y:e.y}];if("v:h"===n)return[{x:e.x,y:t.y}];if("h:h"===n)return[{x:i,y:e.y},{x:i,y:t.y}];if("v:v"===n)return[{x:e.x,y:r},{x:t.x,y:r}];throw new Error("invalid directions: can only handle varians of [hv]:[hv]")}(e,t,n)}function Wf(e,t,n,i,r){var o=P(r&&r.preferredLayouts||[],"straight")[0]||"h:h",a=vn(e,t,qf[o]||0),s=function(e,t){if(Jf(t))return t;switch(e){case"intersect":return"t:t";case"top":case"bottom":return"v:v";case"left":case"right":return"h:h";default:return t}}(a,o);n=n||fn(e),i=i||fn(t);var c=s.split(":");return function(e,t,n){var i=Hf(e,t,n);return i.unshift(e),i.push(t),Qf(i)}(Zf(n,e,c[0],function(e){return{top:"bottom",bottom:"top",left:"right",right:"left","top-left":"bottom-right","bottom-right":"top-left","top-right":"bottom-left","bottom-left":"top-right"}[e]}(a)),Zf(i,t,c[1],a),s)}function Kf(e,t,n,i,r,o){var a;return h(n)&&(r=n,o=i,n=fn(e),i=fn(t)),r=r||[],(a=-1!==(o=U({preferredLayouts:[]},o)).preferredLayouts.indexOf("straight")&&function(e,t,n,i,r){var o,a,s={};if(a=vn(e,t),!/^(top|bottom|left|right)$/.test(a))return null;/top|bottom/.test(a)&&(o="x");/left|right/.test(a)&&(o="y");return"target"===r.preserveDocking?Xf(o,i,e)?(s[o]=i[o],[{x:void 0!==s.x?s.x:n.x,y:void 0!==s.y?s.y:n.y,original:{x:void 0!==s.x?s.x:n.x,y:void 0!==s.y?s.y:n.y}},{x:i.x,y:i.y}]):null:Xf(o,n,t)?(s[o]=n[o],[{x:n.x,y:n.y},{x:void 0!==s.x?s.x:i.x,y:void 0!==s.y?s.y:i.y,original:{x:void 0!==s.x?s.x:i.x,y:void 0!==s.y?s.y:i.y}}]):null}(e,t,n,i,o))||(a=o.connectionEnd&&function(e,t,n,i){var r=i.slice().reverse();return(r=Yf(e,t,n,r))?r.reverse():null}(t,e,i,r))?a:(a=o.connectionStart&&Yf(e,t,n,r))||(!o.connectionStart&&!o.connectionEnd&&r&&r.length?r:Wf(e,t,n,i,o))}function Xf(e,t,n){return function(e,t,n){return e>=t&&e<=n}(t[e],n[e],n[e]+n[{x:"width",y:"height"}[e]])}function Yf(e,t,n,i){if(function(e){return e.length<3||!(e.length>4)&&!!x(e,(function(t,n){var i=e[n-1];return i&&St(t,i)<3}))}(i))return null;var r,o=i[0],a=i.slice();return a[0]=n,a[1]=function(e,t,n){switch(Ct(t,e)){case"v":return{x:n.x,y:e.y};case"h":return{x:e.x,y:n.y}}return{x:e.x,y:e.y}}(a[1],o,n),(r=function(e,t,n){var i;for(i=e.length-2;0!==i;i--)if(Tt(e[i],t,20)||Tt(e[i],n,20))return e.slice(i);return e}(a,e,t))!==a&&(a=Yf(e,t,n,r)),a&&Ct(a)?null:a}function Jf(e){return e&&/t|r|b|l/.test(e)}function Zf(e,t,n,i){if("h"===n&&(n=/left/.test(i)?"l":"r"),"v"===n&&(n=/top/.test(i)?"t":"b"),"t"===n)return{original:e,x:e.x,y:t.y};if("r"===n)return{original:e,x:t.x+t.width,y:e.y};if("b"===n)return{original:e,x:e.x,y:t.y+t.height};if("l"===n)return{original:e,x:t.x,y:e.y};throw new Error("unexpected dockingDirection: <"+n+">")}function Qf(e){return e.reduce((function(t,n,i){return Ot(t[t.length-1],e[i+1],n,0)||t.push(n),t}),[])}var ev={top:"bottom","top-right":"bottom-left","top-left":"bottom-right",right:"left",bottom:"top","bottom-right":"top-left","bottom-left":"top-right",left:"right"},tv={top:"t",right:"r",bottom:"b",left:"l"};function nv(){}function iv(e,t){return Dr(t,"bpmn:Participant")?"source":Dr(e,"bpmn:Participant")?"target":sv(t)?"source":sv(e)||Dr(t,"bpmn:Event")?"target":Dr(e,"bpmn:Event")?"source":null}function rv(e){return sv(e)?"target":"source"}function ov(e,t){return e?e.original||e:fn(t)}function av(e,t){return Dr(t,"bpmn:Activity")&&Dr(e,"bpmn:BoundaryEvent")&&t.businessObject.isForCompensation}function sv(e){return Dr(e,"bpmn:SubProcess")&&Nr(e)}function cv(e,t){return e===t}function pv(e){var t=/right|left/.exec(e);return t&&t[0]}function uv(e){var t=/top|bottom/.exec(e);return t&&t[0]}function lv(e){return"right"===e||"left"===e}function dv(e,t){var n=t.waypoints,i=n&&n.length&&vn(n[0],e);return"top"===i?["t:r"]:"right"===i?["r:b"]:"left"===i?["l:t"]:["b:l"]}function hv(e,t,n){var i,r,o=fn(e),a=fn(t),s=(r=(i=e).host,vn(fn(i),r,-10)),c=cv(e.host,t),p=-1!==["top","right","bottom","left"].indexOf(s),u=vn(a,o,{x:e.width/2+t.width/2,y:e.height/2+t.height/2});return c?function(e,t,n,i,r){var o,a=t?e:uv(e),s=tv[a];o=t?lv(e)?mv("y",n,i,r)?"h":"b":mv("x",n,i,r)?"v":"l":"v";return[s+":"+o]}(s,p,e,t,n):[function(e,t,n){if(n)return tv[e];if(cv(uv(e),uv(t))||(i=pv(e),r=pv(t),ev[i]===r))return tv[uv(e)];var i,r;return tv[pv(e)]}(s,u,p)+":"+function(e,t,n){if(n)return lv(e)?(i=t,r=pv(e),o=ev[r],-1!==i.indexOf(o)||cv(e,t)?"h":"v"):function(e,t){var n=uv(e),i=ev[n];return-1!==t.indexOf(i)}(e,t)||cv(e,t)?"v":"h";var i,r,o;return lv(t)||cv(uv(e),uv(t))&&pv(t)?"h":"v"}(s,u,p)]}function mv(e,t,n,i){return!(fv(e,i,n,40)||fv(e,i,{x:n.x+n.width,y:n.y+n.height},40)||fv(e,i,fn(t),40))}function fv(e,t,n,i){return Math.abs(t[e]-n[e])<i}function vv(e){return U({original:e.point.original||e.point},e.actual)}function yv(e,t){this._elementRegistry=e,this._graphicsFactory=t}i(nv,$f),nv.prototype.layoutConnection=function(e,t){t||(t={});var n,i,r=t.source||e.source,o=t.target||e.target,a=t.waypoints||e.waypoints,s=t.connectionStart,c=t.connectionEnd;return s||(s=ov(a&&a[0],r)),c||(c=ov(a&&a[a.length-1],o)),(Dr(e,"bpmn:Association")||Dr(e,"bpmn:DataAssociation"))&&a&&!av(r,o)?[].concat([s],a.slice(1,-1),[c]):(Dr(e,"bpmn:MessageFlow")?n=function(e,t){return{preferredLayouts:["straight","v:v"],preserveDocking:iv(e,t)}}(r,o):(Dr(e,"bpmn:SequenceFlow")||av(r,o))&&(n=r===o?{preferredLayouts:dv(r,e)}:Dr(r,"bpmn:BoundaryEvent")?{preferredLayouts:hv(r,o,c)}:sv(r)||sv(o)?function(e){return{preferredLayouts:["straight","h:h"],preserveDocking:rv(e)}}(r):Dr(r,"bpmn:Gateway")?{preferredLayouts:["v:h"]}:Dr(o,"bpmn:Gateway")?{preferredLayouts:["h:v"]}:{preferredLayouts:["h:h"]}),n&&(i=Qf(Kf(r,o,s,c,a,n=U(n,t)))),i||[s,c])},yv.$inject=["elementRegistry","graphicsFactory"],yv.prototype.getCroppedWaypoints=function(e,t,n){t=t||e.source,n=n||e.target;var i=this.getDockingPoint(e,t,!0),r=this.getDockingPoint(e,n),o=e.waypoints.slice(i.idx+1,r.idx);return o.unshift(vv(i)),o.push(vv(r)),o},yv.prototype.getDockingPoint=function(e,t,n){var i,r,o=e.waypoints;return{point:r=o[i=n?0:o.length-1],actual:this._getIntersection(t,e,n)||r,idx:i}},yv.prototype._getIntersection=function(e,t,n){return yn(this._getShapePath(e),this._getConnectionPath(t),n)},yv.prototype._getConnectionPath=function(e){return this._graphicsFactory.getConnectionPath(e)},yv.prototype._getShapePath=function(e){return this._graphicsFactory.getShapePath(e)},yv.prototype._getGfx=function(e){return this._elementRegistry.getGraphics(e)};var gv={__init__:["modeling","bpmnUpdater"],__depends__:[ih,Lh,Vh,qh,Sp,Gh,Yh,em,rm,Ho,Gu,Pm],bpmnFactory:["type",Sm],bpmnUpdater:["type",Om],elementFactory:["type",Tm],modeling:["type",Vf],layouter:["type",nv],connectionDocking:["type",yv]},bv=Math.round;function xv(e,t,n,i,r){function o(e,t,n,i){return r.allowed("elements.move",{shapes:e,delta:t,position:n,target:i})}function a(e,n,i,r){if(m(i)&&(r=i,i=!1),!n.waypoints&&n.parent){var o=function(e){return{x:e.x+bv(e.width/2),y:e.y+bv(e.height/2)}}(n);return t.init(e,o,"shape.move",{cursor:"grabbing",autoActivate:i,data:{shape:n,context:r||{}}}),!0}}e.on("shape.move.start",1500,(function(e){var t=e.context,n=e.shape,r=i.get().slice();-1===r.indexOf(n)&&(r=[n]),U(t,{shapes:r=function(e){var t=j(e,"id");return w(e,(function(e){for(;e=e.parent;)if(t[e.id])return!1;return!0}))}(r),validatedShapes:r,shape:n})})),e.on("shape.move.start",1250,(function(e){var t=e.context,n=t.validatedShapes;if(!(t.canExecute=o(n)))return!1})),e.on("shape.move.move",500,(function(e){var t,n=e.context,i=n.validatedShapes,r=e.hover,a={x:e.dx,y:e.dy};t=o(i,a,{x:e.x,y:e.y},r),n.delta=a,n.canExecute=t,n.target=null!==t?r:null})),e.on("shape.move.end",(function(e){var t=e.context,i=t.delta,r=t.canExecute,o="attach"===r,a=t.shapes;if(!1===r)return!1;i.x=bv(i.x),i.y=bv(i.y),0===i.x&&0===i.y||n.moveElements(a,i,t.target,{primaryShape:t.shape,attach:o})})),e.on("element.mousedown",(function(e){if(ko(e)){var t=Co(e);if(!t)throw new Error("must supply DOM mousedown event");return a(t,e.element)}})),this.start=a}xv.$inject=["eventBus","dragging","modeling","selection","rules"];var Ev="djs-dragging",wv="drop-ok",_v="drop-not-ok",Pv="new-parent",Sv="attach-ok";function Ov(e,t,n,i){function r(e){return function(e){return w(e,(function(t){return!function(e){return e.waypoints}(t)||x(e,I({id:t.source.id}))&&x(e,I({id:t.target.id}))}))}(o(e))}function o(e){var t=mt(e,!0),n=T(t,(function(e){return(e.incoming||[]).concat(e.outgoing||[])}));return s(t.concat(n))}function a(e,n){[Sv,wv,_v,Pv].forEach((function(i){i===n?t.addMarker(e,i):t.removeMarker(e,i)}))}e.on("shape.move.start",499,(function(e){var a=e.context,c=a.shapes,p=a.allDraggedElements,u=r(c);if(!a.dragGroup){var l=Ne("g");Pe(l,n.cls("djs-drag-group",["no-events"])),Ee(t.getActiveLayer(),l),a.dragGroup=l}u.forEach((function(e){i.addDragger(e,a.dragGroup)})),_(p=p?s([p,o(c)]):o(c),(function(e){t.addMarker(e,Ev)})),a.allDraggedElements=p,a.differentParents=1!==R(j(c,(function(e){return e.parent&&e.parent.id})))})),e.on("shape.move.move",499,(function(e){var t=e.context,n=t.dragGroup,i=t.target,r=t.shape.parent,o=t.canExecute;i&&("attach"===o?a(i,Sv):t.canExecute&&i&&i.id!==r.id?a(i,Pv):a(i,t.canExecute?wv:_v)),Yn(n,e.dx,e.dy)})),e.on(["shape.move.out","shape.move.cleanup"],(function(e){var t=e.context.target;t&&a(t,null)})),e.on("shape.move.cleanup",(function(e){var n=e.context,i=n.allDraggedElements,r=n.dragGroup;_(i,(function(e){t.removeMarker(e,Ev)})),r&&ke(r)})),this.makeDraggable=function(e,n,r){i.addDragger(n,e.dragGroup),r&&t.addMarker(n,Ev),e.allDraggedElements?e.allDraggedElements.push(n):e.allDraggedElements=[n]}}Ov.$inject=["eventBus","canvas","styles","previewSupport"];var Cv={__depends__:[No,Ho,Fo,Ss,xs,Fc],__init__:["move","movePreview"],move:["type",xv],movePreview:["type",Ov]},Tv=".djs-palette-toggle",Av=".entry",Rv="open";function kv(e,t){this._eventBus=e,this._canvas=t;var n=this;e.on("tool-manager.update",(function(e){var t=e.tool;n.updateToolHighlight(t)})),e.on("i18n.changed",(function(){n._update()})),e.on("diagram.init",(function(){n._diagramInitialized=!0,n._rebuild()}))}function jv(e,t){var n=t.getPaletteEntries();return v(n)?n(e):(_(n,(function(t,n){e[n]=t})),e)}kv.$inject=["eventBus","canvas"],kv.prototype.registerProvider=function(e,t){t||(t=e,e=1e3),this._eventBus.on("palette.getProviders",e,(function(e){e.providers.push(t)})),this._rebuild()},kv.prototype.getEntries=function(){return this._getProviders().reduce(jv,{})},kv.prototype._rebuild=function(){this._diagramInitialized&&(this._getProviders().length&&(this._container||this._init(),this._update()))},kv.prototype._init=function(){var e=this,t=this._eventBus,n=this._getParentContainer(),i=this._container=he(kv.HTML_MARKUP);n.appendChild(i),de.bind(i,".djs-palette-toggle, .entry","click",(function(t){var n=t.delegateTarget;if(re(n,Tv))return e.toggle();e.trigger("click",t)})),pe.bind(i,"mousedown",(function(e){e.stopPropagation()})),de.bind(i,Av,"dragstart",(function(t){e.trigger("dragstart",t)})),t.on("canvas.resized",this._layoutChanged,this),t.fire("palette.create",{container:i})},kv.prototype._getProviders=function(e){var t=this._eventBus.createEvent({type:"palette.getProviders",providers:[]});return this._eventBus.fire(t),t.providers},kv.prototype._toggleState=function(e){e=e||{};var t,n=this._getParentContainer(),i=this._container,r=this._eventBus,o=Q(i);t="twoColumn"in e?e.twoColumn:this._needsCollapse(n.clientHeight,this._entries||{}),o.toggle("two-column",t),"open"in e&&o.toggle(Rv,e.open),r.fire("palette.changed",{twoColumn:t,open:this.isOpen()})},kv.prototype._update=function(){var e=ve(".djs-palette-entries",this._container),t=this._entries=this.getEntries();te(e),_(t,(function(t,n){var i=t.group||"default",r=ve("[data-group="+i+"]",e);r||(r=he('<div class="group" data-group="'+i+'"></div>'),e.appendChild(r));var o=t.html||(t.separator?'<hr class="separator" />':'<div class="entry" draggable="true"></div>'),a=he(o);r.appendChild(a),t.separator||(K(a,"data-action",n),t.title&&K(a,"title",t.title),t.className&&function(e,t){var n=Q(e);(h(t)?t:t.split(/\s+/g)).forEach((function(e){n.add(e)}))}(a,t.className),t.imageUrl&&a.appendChild(he('<img src="'+t.imageUrl+'">')))})),this.open()},kv.prototype.trigger=function(e,t,n){var i,r,o,a=this._entries,s=t.delegateTarget||t.target;if(!s)return t.preventDefault();(i=a[K(s,"data-action")])&&(r=i.action,o=t.originalEvent||t,v(r)?"click"===e&&r(o,n):r[e]&&r[e](o,n),t.preventDefault())},kv.prototype._layoutChanged=function(){this._toggleState({})},kv.prototype._needsCollapse=function(e,t){return e<46*Object.keys(t).length+50},kv.prototype.close=function(){this._toggleState({open:!1,twoColumn:!1})},kv.prototype.open=function(){this._toggleState({open:!0})},kv.prototype.toggle=function(e){this.isOpen()?this.close():this.open()},kv.prototype.isActiveTool=function(e){return e&&this._activeTool===e},kv.prototype.updateToolHighlight=function(e){var t;this._toolsContainer||(t=ve(".djs-palette-entries",this._container),this._toolsContainer=ve("[data-group=tools]",t)),_(this._toolsContainer.children,(function(t){var n=t.getAttribute("data-action");if(n){var i=Q(t);n=n.replace("-tool",""),i.contains("entry")&&n===e?i.add("highlighted-entry"):i.remove("highlighted-entry")}}))},kv.prototype.isOpen=function(){return Q(this._container).has(Rv)},kv.prototype._getParentContainer=function(){return this._canvas.getContainer()},kv.HTML_MARKUP='<div class="djs-palette"><div class="djs-palette-entries"></div><div class="djs-palette-toggle"></div></div>';var Mv={__init__:["palette"],palette:["type",kv]},Dv="crosshair";function Bv(e,t,n,i,r,o,a){this._selection=r,this._dragging=n,this._mouse=a;var s=this,c=function(e){var n,i=t.getActiveLayer();Pe(n=e.frame=Ne("rect"),{class:"djs-lasso-overlay",width:1,height:1,x:0,y:0}),Ee(i,n)},p=function(e){var t=e.frame,n=e.bbox;Pe(t,{x:n.x,y:n.y,width:n.width,height:n.height})},u=function(e){e.frame&&ke(e.frame)};o.registerTool("lasso",{tool:"lasso.selection",dragging:"lasso"}),e.on("lasso.selection.end",(function(t){var n=t.originalEvent.target;(t.hover||n instanceof SVGElement)&&e.once("lasso.selection.ended",(function(){s.activateLasso(t.originalEvent,!0)}))})),e.on("lasso.end",(function(e){var t=Iv(e),n=i.filter((function(e){return e}));s.select(n,t)})),e.on("lasso.start",(function(e){var t=e.context;t.bbox=Iv(e),c(t)})),e.on("lasso.move",(function(e){var t=e.context;t.bbox=Iv(e),p(t)})),e.on("lasso.cleanup",(function(e){var t=e.context;u(t)})),e.on("element.mousedown",1500,(function(e){if(Mo(e))return s.activateLasso(e.originalEvent),!0}))}function Iv(e){var t={x:e.x-e.dx,y:e.y-e.dy},n={x:e.x,y:e.y};return t.x<=n.x&&t.y<n.y||t.x<n.x&&t.y<=n.y?{x:t.x,y:t.y,width:n.x-t.x,height:n.y-t.y}:t.x>=n.x&&t.y<n.y||t.x>n.x&&t.y<=n.y?{x:n.x,y:t.y,width:t.x-n.x,height:n.y-t.y}:t.x<=n.x&&t.y>n.y||t.x<n.x&&t.y>=n.y?{x:t.x,y:n.y,width:n.x-t.x,height:t.y-n.y}:t.x>=n.x&&t.y>n.y||t.x>n.x&&t.y>=n.y?{x:n.x,y:n.y,width:t.x-n.x,height:t.y-n.y}:{x:n.x,y:n.y,width:0,height:0}}Bv.$inject=["eventBus","canvas","dragging","elementRegistry","selection","toolManager","mouse"],Bv.prototype.activateLasso=function(e,t){this._dragging.init(e,"lasso",{autoActivate:t,cursor:Dv,data:{context:{}}})},Bv.prototype.activateSelection=function(e,t){this._dragging.init(e,"lasso.selection",{trapClick:!1,autoActivate:t,cursor:Dv,data:{context:{}}})},Bv.prototype.select=function(e,t){var n=function(e,t){var n={};return _(e,(function(e){var i=e;i.waypoints&&(i=ft(i)),!f(t.y)&&i.x>t.x&&(n[e.id]=e),!f(t.x)&&i.y>t.y&&(n[e.id]=e),i.x>t.x&&i.y>t.y&&(f(t.width)&&f(t.height)&&i.width+i.x<t.width+t.x&&i.height+i.y<t.height+t.y?n[e.id]=e:f(t.width)&&f(t.height)||(n[e.id]=e))})),n}(e,t);this._selection.select(k(n))},Bv.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var e=this._mouse.getLastMoveEvent();this.activateSelection(e,!!e)},Bv.prototype.isActive=function(){var e=this._dragging.context();return e&&/^lasso/.test(e.prefix)};var Nv={__depends__:[am,rp],__init__:["lassoTool"],lassoTool:["type",Bv]},Lv=1500,Fv="grab";function Vv(e,t,n,i,r,o){this._dragging=n,this._mouse=o;var a=this,s=i.get("keyboard",!1);r.registerTool("hand",{tool:"hand",dragging:"hand.move"}),e.on("element.mousedown",Lv,(function(e){if(jo(e))return a.activateMove(e.originalEvent,!0),!1})),s&&s.addListener(Lv,(function(e){if($v(e.keyEvent)&&!a.isActive()){var t=a._mouse.getLastMoveEvent();a.activateMove(t,!!t)}}),"keyboard.keydown"),s&&s.addListener(Lv,(function(e){$v(e.keyEvent)&&a.isActive()&&a.toggle()}),"keyboard.keyup"),e.on("hand.end",(function(t){var n=t.originalEvent.target;if(!(t.hover||n instanceof SVGElement))return!1;e.once("hand.ended",(function(){a.activateMove(t.originalEvent,{reactivate:!0})}))})),e.on("hand.move.move",(function(e){var n=t.viewbox().scale;t.scroll({dx:e.dx*n,dy:e.dy*n})})),e.on("hand.move.end",(function(t){var n=t.context.reactivate;return!jo(t)&&n&&e.once("hand.move.ended",(function(e){a.activateHand(e.originalEvent,!0,!0)})),!1}))}function $v(e){return na(" ",e)}Vv.$inject=["eventBus","canvas","dragging","injector","toolManager","mouse"],Vv.prototype.activateMove=function(e,t,n){"object"==typeof t&&(n=t,t=!1),this._dragging.init(e,"hand.move",{autoActivate:t,cursor:Fv,data:{context:n||{}}})},Vv.prototype.activateHand=function(e,t,n){this._dragging.init(e,"hand",{trapClick:!1,autoActivate:t,cursor:Fv,data:{context:{reactivate:n}}})},Vv.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var e=this._mouse.getLastMoveEvent();this.activateHand(e,!!e)},Vv.prototype.isActive=function(){var e=this._dragging.context();return!!e&&/^(hand|hand\.move)$/.test(e.prefix)};var zv={__depends__:[am,rp],__init__:["handTool"],handTool:["type",Vv]},qv="connect-ok",Uv="connect-not-ok";function Gv(e,t,n,i,r,o,a){var s=this;this._dragging=t,this._rules=o,this._mouse=a,r.registerTool("global-connect",{tool:"global-connect",dragging:"global-connect.drag"}),e.on("global-connect.hover",(function(e){var t=e.context,n=e.hover,r=t.canStartConnect=s.canStartConnect(n);null!==r&&(t.startTarget=n,i.addMarker(n,r?qv:Uv))})),e.on(["global-connect.out","global-connect.cleanup"],(function(e){var t=e.context.startTarget,n=e.context.canStartConnect;t&&i.removeMarker(t,n?qv:Uv)})),e.on(["global-connect.ended"],(function(t){var i=t.context.startTarget,r={x:t.x,y:t.y};if(s.canStartConnect(i))return e.once("element.out",(function(){e.once(["connect.ended","connect.canceled"],(function(){e.fire("global-connect.drag.ended")})),n.start(null,i,r)})),!1}))}Gv.$inject=["eventBus","dragging","connect","canvas","toolManager","rules","mouse"],Gv.prototype.start=function(e,t){this._dragging.init(e,"global-connect",{autoActivate:t,trapClick:!1,data:{context:{}}})},Gv.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var e=this._mouse.getLastMoveEvent();return this.start(e,!!e)},Gv.prototype.isActive=function(){var e=this._dragging.context();return e&&/^global-connect/.test(e.prefix)},Gv.prototype.canStartConnect=function(e){return this._rules.allowed("connection.start",{source:e})};var Hv={__depends__:[_c,Ss,xs,am,rp],globalConnect:["type",Gv]};function Wv(e,t,n,i,r,o,a,s){this._palette=e,this._create=t,this._elementFactory=n,this._spaceTool=i,this._lassoTool=r,this._handTool=o,this._globalConnect=a,this._translate=s,e.registerProvider(this)}Wv.$inject=["palette","create","elementFactory","spaceTool","lassoTool","handTool","globalConnect","translate"],Wv.prototype.getPaletteEntries=function(e){var t={},n=this._create,i=this._elementFactory,r=this._spaceTool,o=this._lassoTool,a=this._handTool,s=this._globalConnect,c=this._translate;function p(e,t,r,o,a){function s(t){var r=i.createShape(U({type:e},a));a&&(r.businessObject.di.isExpanded=a.isExpanded),n.start(t,r)}var p=e.replace(/^bpmn:/,"");return{group:t,className:r,title:o||c("Create {type}",{type:p}),action:{dragstart:s,click:s}}}function u(e){var t=i.createShape({type:"bpmn:SubProcess",x:0,y:0,isExpanded:!0}),r=i.createShape({type:"bpmn:StartEvent",x:40,y:82,parent:t});n.start(e,[t,r],{hints:{autoSelect:[r]}})}function l(e){n.start(e,i.createParticipantShape())}return U(t,{"hand-tool":{group:"tools",className:"bpmn-icon-hand-tool",title:c("Activate the hand tool"),action:{click:function(e){a.activateHand(e)}}},"lasso-tool":{group:"tools",className:"bpmn-icon-lasso-tool",title:c("Activate the lasso tool"),action:{click:function(e){o.activateSelection(e)}}},"space-tool":{group:"tools",className:"bpmn-icon-space-tool",title:c("Activate the create/remove space tool"),action:{click:function(e){r.activateSelection(e)}}},"global-connect-tool":{group:"tools",className:"bpmn-icon-connection-multi",title:c("Activate the global connect tool"),action:{click:function(e){s.start(e)}}},"tool-separator":{group:"tools",separator:!0},"create.start-event":p("bpmn:StartEvent","event","bpmn-icon-start-event-none",c("Create StartEvent")),"create.intermediate-event":p("bpmn:IntermediateThrowEvent","event","bpmn-icon-intermediate-event-none",c("Create Intermediate/Boundary Event")),"create.end-event":p("bpmn:EndEvent","event","bpmn-icon-end-event-none",c("Create EndEvent")),"create.exclusive-gateway":p("bpmn:ExclusiveGateway","gateway","bpmn-icon-gateway-none",c("Create Gateway")),"create.task":p("bpmn:Task","activity","bpmn-icon-task",c("Create Task")),"create.data-object":p("bpmn:DataObjectReference","data-object","bpmn-icon-data-object",c("Create DataObjectReference")),"create.data-store":p("bpmn:DataStoreReference","data-store","bpmn-icon-data-store",c("Create DataStoreReference")),"create.subprocess-expanded":{group:"activity",className:"bpmn-icon-subprocess-expanded",title:c("Create expanded SubProcess"),action:{dragstart:u,click:u}},"create.participant-expanded":{group:"collaboration",className:"bpmn-icon-participant",title:c("Create Pool/Participant"),action:{dragstart:l,click:l}},"create.group":p("bpmn:Group","artifact","bpmn-icon-group",c("Create Group"))}),t};var Kv={__depends__:[Mv,Yc,Pm,Nv,zv,Hv,ho],__init__:["paletteProvider"],paletteProvider:["type",Wv]};function Xv(e,t,n,i,r){as.call(this,e),e.on("shape.move.move",250,(function(e){var o=e.context,a=o.canExecute;o.visualReplacements||(o.visualReplacements={}),a&&a.replacements?function(e){_(e.canExecute.replacements,(function(o){var a=o.oldElementId,s={type:o.newElementType};if(!e.visualReplacements[a]){var c=t.get(a);U(s,{x:c.x,y:c.y});var p=n.createShape(s);i.addShape(p,c.parent);var u=ve('[data-element-id="'+Is(c.id)+'"]',e.dragGroup);u&&Pe(u,{display:"none"});var l=r.addDragger(p,e.dragGroup);e.visualReplacements[a]=l,i.removeShape(p)}}))}(o):function(e){var t=e.visualReplacements;_(t,(function(n,i){var r=ve('[data-element-id="'+Is(i)+'"]',e.dragGroup);r&&Pe(r,{display:"inline"}),n.remove(),t[i]&&delete t[i]}))}(o)}))}Xv.$inject=["eventBus","elementRegistry","elementFactory","canvas","previewSupport"],i(Xv,as);var Yv={__depends__:[Fc],__init__:["bpmnReplacePreview"],bpmnReplacePreview:["type",Xv]},Jv=40,Zv=["x","y"],Qv=Math.abs;function ey(e){e.on(["connect.hover","connect.move","connect.end"],1250,(function(e){var t=e.context,n=t.canExecute,i=t.start,r=t.hover,o=t.source,a=t.target;e.originalEvent&&ta(e.originalEvent)||(t.initialConnectionStart||(t.initialConnectionStart=t.connectionStart),n&&r&&function(e,t,n){Zv.forEach((function(i){var r=iy(i,t);e[i]<t[i]+n?dc(e,i,t[i]+n):e[i]>t[i]+r-n&&dc(e,i,t[i]+r-n)}))}(e,r,function(e){return Dr(e,"bpmn:Task")?10:20}(r)),r&&function(e,t){return C(t,(function(t){return ny(e,t)}))}(n,["bpmn:Association","bpmn:DataInputAssociation","bpmn:DataOutputAssociation","bpmn:SequenceFlow"])?(t.connectionStart=uc(i),Qa(r,["bpmn:Event","bpmn:Gateway"])&&ty(e,uc(r)),Qa(r,["bpmn:Task","bpmn:SubProcess"])&&function(e,t){var n=uc(t);Zv.forEach((function(i){(function(e,t,n){return e[n]>t[n]+20&&e[n]<t[n]+iy(n,t)-20})(e,t,i)&&dc(e,i,n[i])}))}(e,r),Dr(o,"bpmn:BoundaryEvent")&&a===o.host&&function(e){var t=e.context,n=t.source,i=t.target;if(function(e){var t=e.hover,n=e.source;return t&&n&&t===n}(t))return;var r=uc(n),o=vn(r,i,-10),a=[];/top|bottom/.test(o)&&a.push("x");/left|right/.test(o)&&a.push("y");a.forEach((function(t){var n,i=e[t];Qv(i-r[t])<Jv&&(n=i>r[t]?r[t]+Jv:r[t]-Jv,dc(e,t,n))}))}(e)):ny(n,"bpmn:MessageFlow")?(Dr(i,"bpmn:Event")&&(t.connectionStart=uc(i)),Dr(r,"bpmn:Event")&&ty(e,uc(r))):t.connectionStart=t.initialConnectionStart)}))}function ty(e,t){dc(e,"x",t.x),dc(e,"y",t.y)}function ny(e,t){return e&&e.type===t}function iy(e,t){return"x"===e?t.width:t.height}function ry(){this._targets={},this._snapOrigins={},this._snapLocations=[],this._defaultSnaps={}}function oy(e){this._snapValues={}}ey.$inject=["eventBus"],ry.prototype.getSnapOrigin=function(e){return this._snapOrigins[e]},ry.prototype.setSnapOrigin=function(e,t){this._snapOrigins[e]=t,-1===this._snapLocations.indexOf(e)&&this._snapLocations.push(e)},ry.prototype.addDefaultSnap=function(e,t){var n=this._defaultSnaps[e];n||(n=this._defaultSnaps[e]=[]),n.push(t)},ry.prototype.getSnapLocations=function(){return this._snapLocations},ry.prototype.setSnapLocations=function(e){this._snapLocations=e},ry.prototype.pointsForTarget=function(e){var t=e.id||e,n=this._targets[t];return n||(n=this._targets[t]=new oy).initDefaults(this._defaultSnaps),n},oy.prototype.add=function(e,t){var n=this._snapValues[e];n||(n=this._snapValues[e]={x:[],y:[]}),-1===n.x.indexOf(t.x)&&n.x.push(t.x),-1===n.y.indexOf(t.y)&&n.y.push(t.y)},oy.prototype.snap=function(e,t,n,i){var r=this._snapValues[t];return r&&function(e,t,n){var i,r;for(n=void 0===n?10:n,i=0;i<t.length;i++)if(r=t[i],ac(r-e)<=n)return r}(e[n],r[n],i)},oy.prototype.initDefaults=function(e){var t=this;_(e||{},(function(e,n){_(e,(function(e){t.add(n,e)}))}))};function ay(e,t,n){var i=this;this._elementRegistry=e,t.on(["create.start","shape.move.start"],(function(e){i.initSnap(e)})),t.on(["create.move","create.end","shape.move.move","shape.move.end"],1250,(function(e){var t=e.context,r=t.shape,o=t.snapContext,a=t.target;if((!e.originalEvent||!ta(e.originalEvent))&&!lc(e)&&a){var s=o.pointsForTarget(a);s.initialized||((s=i.addSnapTargetPoints(s,r,a)).initialized=!0),n.snap(e,s)}})),t.on(["create.cleanup","shape.move.cleanup"],(function(){n.hide()}))}function sy(e){return!!e.labelTarget}ay.$inject=["elementRegistry","eventBus","snapping"],ay.prototype.initSnap=function(e){var t,n=this._elementRegistry,i=e.context,r=i.shape,o=i.snapContext;o||(o=i.snapContext=new ry);var a=(t=n.get(r.id)?uc(r,e):{x:e.x+uc(r).x,y:e.y+uc(r).y}).x-r.width/2,s=t.y-r.height/2,c=t.x+r.width/2,p=t.y+r.height/2;return o.setSnapOrigin("mid",{x:t.x-e.x,y:t.y-e.y}),sy(r)||(o.setSnapOrigin("top-left",{x:a-e.x,y:s-e.y}),o.setSnapOrigin("bottom-right",{x:c-e.x,y:p-e.y})),o},ay.prototype.addSnapTargetPoints=function(e,t,n){return _(this.getSnapTargets(t,n),(function(n){if(sy(n))sy(t)&&e.add("mid",uc(n));else if(n.waypoints){if(n.waypoints.length<3)return;_(n.waypoints.slice(1,-1),(function(t){e.add("mid",t)}))}else{e.add("mid",uc(n))}})),f(t.x)&&f(t.y)?(this._elementRegistry.get(t.id)&&e.add("mid",uc(t)),e):e},ay.prototype.getSnapTargets=function(e,t){return hc(t).filter((function(e){return!e.hidden}))};function cy(e,t){t.invoke(ay,this),e.on(["create.move","create.end"],1500,py),e.on(["create.move","create.end","shape.move.move","shape.move.end"],1500,(function(e){var t=e.context,n=t.canExecute,i=t.target;n&&("attach"===n||n.attach)&&!lc(e)&&function(e,t){var n,i=hn(t),r=rh(e,t),o=e.context.shape;n=o.parent?{x:0,y:0}:fn(o);/top/.test(r)?dc(e,"y",i.top-n.y):/bottom/.test(r)&&dc(e,"y",i.bottom-n.y);/left/.test(r)?dc(e,"x",i.left-n.x):/right/.test(r)&&dc(e,"x",i.right-n.x)}(e,i)}))}function py(e){var t=e.context.createConstraints;if(t){var n=t.top,i=t.right,r=t.bottom,o=t.left;(o&&o>=e.x||i&&i<=e.x)&&dc(e,"x",e.x),(n&&n>=e.y||r&&r<=e.y)&&dc(e,"y",e.y)}}function uy(e,t){return-1!==e.indexOf(t)}function ly(e,t,n){return t?{x:e.x-n.x,y:e.y-n.y}:{x:e.x,y:e.y}}i(cy,ay),cy.$inject=["eventBus","injector"],cy.prototype.initSnap=function(e){var t=ay.prototype.initSnap.call(this,e),n=e.shape,i=!!this._elementRegistry.get(n.id);return _(n.outgoing,(function(n){var r=n.waypoints[0];r=r.original||r,t.setSnapOrigin(n.id+"-docking",ly(r,i,e))})),_(n.incoming,(function(n){var r=n.waypoints[n.waypoints.length-1];r=r.original||r,t.setSnapOrigin(n.id+"-docking",ly(r,i,e))})),Dr(n,"bpmn:Participant")&&t.setSnapLocations(["top-left","bottom-right","mid"]),t},cy.prototype.addSnapTargetPoints=function(e,t,n){ay.prototype.addSnapTargetPoints.call(this,e,t,n);var i=this.getSnapTargets(t,n);_(i,(function(n){var i;(function(e){if(Dr(e,"bpmn:SubProcess")&&Nr(e))return!0;return Dr(e,"bpmn:Participant")}(n)||(i="bpmn:TextAnnotation",[t,n].every((function(e){return Dr(e,i)}))))&&(e.add("top-left",cc(n)),e.add("bottom-right",pc(n)))}));var r=this._elementRegistry;return _(t.incoming,(function(n){if(r.get(t.id)){uy(i,n.source)||e.add("mid",fn(n.source));var o=n.waypoints[0];e.add(n.id+"-docking",o.original||o)}})),_(t.outgoing,(function(n){if(r.get(t.id)){uy(i,n.target)||e.add("mid",fn(n.target));var o=n.waypoints[n.waypoints.length-1];e.add(n.id+"-docking",o.original||o)}})),Dr(n,"bpmn:SequenceFlow")&&(e=this.addSnapTargetPoints(e,t,n.parent)),e},cy.prototype.getSnapTargets=function(e,t){return ay.prototype.getSnapTargets.call(this,e,t).filter((function(e){return!Dr(e,"bpmn:Lane")}))};function dy(e,t){var n=this;e.on(["resize.start"],(function(e){n.initSnap(e)})),e.on(["resize.move","resize.end"],1250,(function(e){var i=e.context,r=i.shape,o=r.parent,a=i.direction,s=i.snapContext;if(!(e.originalEvent&&ta(e.originalEvent)||lc(e))){var c=s.pointsForTarget(o);c.initialized||((c=n.addSnapTargetPoints(c,r,o,a)).initialized=!0),function(e){return"n"===e||"s"===e}(a)&&dc(e,"x",e.x),function(e){return"e"===e||"w"===e}(a)&&dc(e,"y",e.y),t.snap(e,c)}})),e.on(["resize.cleanup"],(function(){t.hide()}))}function hy(e,t){var n=fn(e),i=hn(e),r={x:n.x,y:n.y};return-1!==t.indexOf("n")?r.y=i.top:-1!==t.indexOf("s")&&(r.y=i.bottom),-1!==t.indexOf("e")?r.x=i.right:-1!==t.indexOf("w")&&(r.x=i.left),r}dy.prototype.initSnap=function(e){var t=e.context,n=t.shape,i=t.direction,r=t.snapContext;r||(r=t.snapContext=new ry);var o=hy(n,i);return r.setSnapOrigin("corner",{x:o.x-e.x,y:o.y-e.y}),r},dy.prototype.addSnapTargetPoints=function(e,t,n,i){return _(this.getSnapTargets(t,n),(function(t){e.add("corner",pc(t)),e.add("corner",cc(t))})),e.add("corner",hy(t,i)),e},dy.$inject=["eventBus","snapping"],dy.prototype.getSnapTargets=function(e,t){return hc(t).filter((function(t){return!(n=t,i=e,n.host===i||function(e){return!!e.waypoints}(t)||function(e){return!!e.hidden}(t)||function(e){return!!e.labelTarget}(t));var n,i}))};function my(e){this._canvas=e,this._asyncHide=$(z(this.hide,this),1e3)}my.$inject=["canvas"],my.prototype.snap=function(e,t){var n=e.context.snapContext,i=n.getSnapLocations(),r={x:lc(e,"x"),y:lc(e,"y")};_(i,(function(i){var o=n.getSnapOrigin(i),a={x:e.x+o.x,y:e.y+o.y};if(_(["x","y"],(function(e){var n;r[e]||void 0!==(n=t.snap(a,i,e,7))&&(r[e]={value:n,originValue:n-o[e]})})),r.x&&r.y)return!1})),this.showSnapLine("vertical",r.x&&r.x.value),this.showSnapLine("horizontal",r.y&&r.y.value),_(["x","y"],(function(t){var n=r[t];m(n)&&dc(e,t,n.originValue)}))},my.prototype._createLine=function(e){var t=this._canvas.getLayer("snap"),n=Ne("path");return Pe(n,{d:"M0,0 L0,0"}),Ae(n).add("djs-snap-line"),Ee(t,n),{update:function(t){f(t)?Pe(n,"horizontal"===e?{d:"M-100000,"+t+" L+100000,"+t,display:""}:{d:"M "+t+",-100000 L "+t+", +100000",display:""}):Pe(n,{display:"none"})}}},my.prototype._createSnapLines=function(){this._snapLines={horizontal:this._createLine("horizontal"),vertical:this._createLine("vertical")}},my.prototype.showSnapLine=function(e,t){var n=this.getSnapLine(e);n&&n.update(t),this._asyncHide()},my.prototype.getSnapLine=function(e){return this._snapLines||this._createSnapLines(),this._snapLines[e]},my.prototype.hide=function(){_(this._snapLines,(function(e){e.update()}))};var fy={__depends__:[{__init__:["createMoveSnapping","resizeSnapping","snapping"],createMoveSnapping:["type",ay],resizeSnapping:["type",dy],snapping:["type",my]}],__init__:["connectSnapping","createMoveSnapping"],connectSnapping:["type",ey],createMoveSnapping:["type",cy]};function vy(e,t,n,i){this._open=!1,this._results=[],this._eventMaps=[],this._canvas=e,this._eventBus=t,this._overlays=n,this._selection=i,this._container=he(vy.BOX_HTML),this._searchInput=ve(vy.INPUT_SELECTOR,this._container),this._resultsContainer=ve(vy.RESULTS_CONTAINER_SELECTOR,this._container),this._canvas.getContainer().appendChild(this._container),t.on(["canvas.destroy","diagram.destroy"],this.close,this)}function yy(e,t,n){var i=function(e){var t="";return e.forEach((function(e){e.matched?t+='<strong class="'+vy.RESULT_HIGHLIGHT_CLASS+'">'+Ls(e.matched)+"</strong>":t+=Ls(e.normal)})),""!==t?t:null}(t),r=he(n);r.innerHTML=i,e.appendChild(r)}vy.$inject=["canvas","eventBus","overlays","selection"],vy.prototype._bindEvents=function(){var e=this;function t(t,n,i,r){e._eventMaps.push({el:t,type:i,listener:de.bind(t,n,i,r)})}t(document,"html","click",(function(t){e.close()})),t(this._container,vy.INPUT_SELECTOR,"click",(function(e){e.stopPropagation(),e.delegateTarget.focus()})),t(this._container,vy.RESULT_SELECTOR,"mouseover",(function(t){t.stopPropagation(),e._scrollToNode(t.delegateTarget),e._preselect(t.delegateTarget)})),t(this._container,vy.RESULT_SELECTOR,"click",(function(t){t.stopPropagation(),e._select(t.delegateTarget)})),t(this._container,vy.INPUT_SELECTOR,"keydown",(function(e){38===e.keyCode&&e.preventDefault(),40===e.keyCode&&e.preventDefault()})),t(this._container,vy.INPUT_SELECTOR,"keyup",(function(t){if(27===t.keyCode)return e.close();if(13===t.keyCode){var n=e._getCurrentResult();return n?e._select(n):e.close()}return 38===t.keyCode?e._scrollToDirection(!0):40===t.keyCode?e._scrollToDirection():void(37!==t.keyCode&&39!==t.keyCode&&e._search(t.delegateTarget.value))}))},vy.prototype._unbindEvents=function(){this._eventMaps.forEach((function(e){de.unbind(e.el,e.type,e.listener)}))},vy.prototype._search=function(e){var t=this;if(this._clearResults(),e&&""!==e){var n=this._searchProvider.find(e);if(n.length){n.forEach((function(e){var n=e.element.id,i=t._createResultNode(e,n);t._results[n]={element:e.element,node:i}}));var i=ve(vy.RESULT_SELECTOR,this._resultsContainer);this._scrollToNode(i),this._preselect(i)}}},vy.prototype._scrollToDirection=function(e){var t=this._getCurrentResult();if(t){var n=e?t.previousElementSibling:t.nextElementSibling;n&&(this._scrollToNode(n),this._preselect(n))}},vy.prototype._scrollToNode=function(e){if(e&&e!==this._getCurrentResult()){var t=e.offsetTop,n=this._resultsContainer.scrollTop,i=t-this._resultsContainer.clientHeight+e.clientHeight;t<n?this._resultsContainer.scrollTop=t:n<i&&(this._resultsContainer.scrollTop=i)}},vy.prototype._clearResults=function(){te(this._resultsContainer),this._results=[],this._resetOverlay(),this._eventBus.fire("searchPad.cleared")},vy.prototype._getCurrentResult=function(){return ve(vy.RESULT_SELECTED_SELECTOR,this._resultsContainer)},vy.prototype._createResultNode=function(e,t){var n=he(vy.RESULT_HTML);return e.primaryTokens.length>0&&yy(n,e.primaryTokens,vy.RESULT_PRIMARY_HTML),yy(n,e.secondaryTokens,vy.RESULT_SECONDARY_HTML),K(n,vy.RESULT_ID_ATTRIBUTE,t),this._resultsContainer.appendChild(n),n},vy.prototype.registerProvider=function(e){this._searchProvider=e},vy.prototype.open=function(){if(!this._searchProvider)throw new Error("no search provider registered");this.isOpen()||(this._bindEvents(),this._open=!0,Q(this._container).add("open"),this._searchInput.focus(),this._eventBus.fire("searchPad.opened"))},vy.prototype.close=function(){this.isOpen()&&(this._unbindEvents(),this._open=!1,Q(this._container).remove("open"),this._clearResults(),this._searchInput.value="",this._searchInput.blur(),this._resetOverlay(),this._eventBus.fire("searchPad.closed"))},vy.prototype.toggle=function(){this.isOpen()?this.close():this.open()},vy.prototype.isOpen=function(){return this._open},vy.prototype._preselect=function(e){var t=this._getCurrentResult();if(e!==t){t&&Q(t).remove(vy.RESULT_SELECTED_CLASS);var n=K(e,vy.RESULT_ID_ATTRIBUTE),i=this._results[n].element;Q(e).add(vy.RESULT_SELECTED_CLASS),this._resetOverlay(i),this._canvas.scrollToElement(i,{top:400}),this._selection.select(i),this._eventBus.fire("searchPad.preselected",i)}},vy.prototype._select=function(e){var t=K(e,vy.RESULT_ID_ATTRIBUTE),n=this._results[t].element;this.close(),this._resetOverlay(),this._canvas.scrollToElement(n,{top:400}),this._selection.select(n),this._eventBus.fire("searchPad.selected",n)},vy.prototype._resetOverlay=function(e){if(this._overlayId&&this._overlays.remove(this._overlayId),e){var t=function(e){var t=6,n=e.width+2*t,i=e.height+2*t,r=["width: "+n+"px","height: "+i+"px"].join("; ");return{position:{bottom:i-t,right:n-t},show:!0,html:'<div style="'+r+'" class="'+vy.OVERLAY_CLASS+'"></div>'}}(ft(e));this._overlayId=this._overlays.add(e,t)}},vy.CONTAINER_SELECTOR=".djs-search-container",vy.INPUT_SELECTOR=".djs-search-input input",vy.RESULTS_CONTAINER_SELECTOR=".djs-search-results",vy.RESULT_SELECTOR=".djs-search-result",vy.RESULT_SELECTED_CLASS="djs-search-result-selected",vy.RESULT_SELECTED_SELECTOR="."+vy.RESULT_SELECTED_CLASS,vy.RESULT_ID_ATTRIBUTE="data-result-id",vy.RESULT_HIGHLIGHT_CLASS="djs-search-highlight",vy.OVERLAY_CLASS="djs-search-overlay",vy.BOX_HTML='<div class="djs-search-container djs-draggable djs-scrollable"><div class="djs-search-input"><input type="text"/></div><div class="djs-search-results"></div></div>',vy.RESULT_HTML='<div class="djs-search-result"></div>',vy.RESULT_PRIMARY_HTML='<div class="djs-search-result-primary"></div>',vy.RESULT_SECONDARY_HTML='<p class="djs-search-result-secondary"></p>';var gy={__depends__:[Qo,Ho],searchPad:["type",vy]};function by(e,t,n){this._elementRegistry=e,this._canvas=n,t.registerProvider(this)}function xy(e){return w(e,(function(e){return!!e.matched})).length>0}function Ey(e,t){var n=[],i=e;if(!e)return n;e=e.toLowerCase(),t=t.toLowerCase();var r=e.indexOf(t);return r>-1?(0!==r&&n.push({normal:i.substr(0,r)}),n.push({matched:i.substr(r,t.length)}),t.length+r<e.length&&n.push({normal:i.substr(t.length+r,e.length)})):n.push({normal:i}),n}by.$inject=["elementRegistry","searchPad","canvas"],by.prototype.find=function(e){var t=this._canvas.getRootElement(),n=this._elementRegistry.filter((function(e){return!e.labelTarget}));return n=w(n,(function(e){return e!==t})),n=B(n=w(n=T(n,(function(t){return{primaryTokens:Ey(Hr(t),e),secondaryTokens:Ey(t.id,e),element:t}})),(function(e){return xy(e.primaryTokens)||xy(e.secondaryTokens)})),(function(e){return Hr(e.element)+e.element.id}))};var wy={__depends__:[gy],__init__:["bpmnSearch"],bpmnSearch:["type",by]};function _y(e){Mr.call(this,e)}i(_y,Mr),_y.Viewer=ea,_y.NavigatedViewer=Ra,_y.prototype.createDiagram=_r((function(){return this.importXML('<?xml version="1.0" encoding="UTF-8"?><bpmn:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" targetNamespace="http://bpmn.io/schema/bpmn" id="Definitions_1"><bpmn:process id="Process_1" isExecutable="false"><bpmn:startEvent id="StartEvent_1"/></bpmn:process><bpmndi:BPMNDiagram id="BPMNDiagram_1"><bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process_1"><bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1"><dc:Bounds height="36.0" width="36.0" x="173.0" y="102.0"/></bpmndi:BPMNShape></bpmndi:BPMNPlane></bpmndi:BPMNDiagram></bpmn:definitions>')})),_y.prototype._interactionModules=[fa,_a,La,Aa],_y.prototype._modelingModules=[Ua,os,_s,hs,yc,_c,Sc,au,yp,Yc,lu,yu,ku,Mu,Bu,qu,ul,gv,Cv,Kv,Yv,nl,fy,wy],_y.prototype._modules=[].concat(ea.prototype._modules,_y.prototype._interactionModules,_y.prototype._modelingModules);var Py={min:.2,max:4};function Sy(e,t,n,i,r){var o=this;function a(e){o._state._svgClientRect&&!Ry(o._state._svgClientRect)||(o._state._svgClientRect=o._svg.getBoundingClientRect()),Cy(Oy({x:e.clientX-o._state._svgClientRect.left,y:e.clientY-o._state._svgClientRect.top},o._svg,o._lastViewbox),o._canvas),o._update()}function s(e){return function(t){o._state._svgClientRect&&!Ry(o._state._svgClientRect)||(o._state._svgClientRect=o._svg.getBoundingClientRect()),e&&a(t);var n=Oy({x:t.clientX-o._state._svgClientRect.left,y:t.clientY-o._state._svgClientRect.top},o._svg,o._lastViewbox),r=i.viewbox(),s=function(e,t){var n={x:t.x+t.width/2,y:t.y+t.height/2};return{x:e.x-n.x,y:e.y-n.y}}(n,r),u=o._viewportDom.getBoundingClientRect(),l={x:t.clientX-u.left+1,y:t.clientY-u.top+1};U(o._state,{cachedViewbox:r,initialDragPosition:{x:t.clientX,y:t.clientY},isDragging:!0,offsetViewport:s,offsetViewportDom:l,viewportClientRect:o._viewport.getBoundingClientRect(),parentClientRect:o._parent.getBoundingClientRect()}),pe.bind(document,"mousemove",c),pe.bind(document,"mouseup",p)}}function c(e){if(o._state.isDragging){o._state._svgClientRect&&!Ry(o._state._svgClientRect)||(o._state._svgClientRect=o._svg.getBoundingClientRect());var t=o._state.offsetViewportDom,n=o._state.viewportClientRect,i=o._state.parentClientRect;U(o._viewportDom.style,{top:e.clientY-t.y-i.top+"px",left:e.clientX-t.x-i.left+"px"});var r=jy(i,{top:e.clientY-t.y-i.top,left:e.clientX-t.x-i.left,width:n.width,height:n.height});U(o._overlay.style,{clipPath:r});var a=Oy({x:e.clientX-o._state._svgClientRect.left,y:e.clientY-o._state._svgClientRect.top},o._svg,o._lastViewbox);Cy({x:a.x-o._state.offsetViewport.x,y:a.y-o._state.offsetViewport.y},o._canvas)}}function p(e){o._state.isDragging&&(o._state.initialDragPosition.x===e.clientX&&o._state.initialDragPosition.y===e.clientY&&a(e),o._update(),U(o._state,{cachedViewbox:null,initialDragPosition:null,isDragging:!1,offsetViewport:null,offsetViewportDom:null}),pe.unbind(document,"mousemove",c),pe.unbind(document,"mouseup",p))}this._canvas=i,this._elementRegistry=r,this._eventBus=n,this._injector=t,this._state={isOpen:void 0,isDragging:!1,initialDragPosition:null,offsetViewport:null,cachedViewbox:null,dragger:null,svgClientRect:null,parentClientRect:null,zoomDelta:0},this._init(),this.toggle(e&&e.open||!1),pe.bind(this._svg,"click",(function(e){e.preventDefault(),e.stopPropagation(),a(e)})),pe.bind(this._viewportDom,"mousedown",s(!1)),pe.bind(this._svg,"mousedown",s(!0)),pe.bind(this._parent,"wheel",(function(e){if(e.preventDefault(),e.stopPropagation(),e.ctrlKey&&(o._state._svgClientRect&&!Ry(o._state._svgClientRect)||(o._state._svgClientRect=o._svg.getBoundingClientRect()),t=e,n=o._state._svgClientRect,t.x>n.left&&t.x<n.left+n.width&&t.y>n.top&&t.y<n.top+n.height)){var t,n,r=0===e.deltaMode?.02:.32,a=Math.sqrt(Math.pow(e.deltaY,2)+Math.pow(e.deltaX,2))*ky(e.deltaY)*-r;if(o._state.zoomDelta+=a,Math.abs(o._state.zoomDelta)>.1){var s=a>0?1:-1,c=Math.log(i.zoom())/Math.log(10),p=function(e,t){var n=Math.log(e.min)/Math.log(10),i=Math.log(e.max)/Math.log(10);return(Math.abs(n)+Math.abs(i))/t}(Py,20),u=Math.round(c/p)*p;u+=p*s;var l=Math.pow(10,u);i.zoom(function(e,t){return Math.max(e.min,Math.min(e.max,t))}(Py,l),d),o._state.zoomDelta=0;var d=Oy({x:e.clientX-o._state._svgClientRect.left,y:e.clientY-o._state._svgClientRect.top},o._svg,o._lastViewbox);Cy(d,o._canvas),o._update()}}})),pe.bind(this._toggle,"click",(function(e){e.preventDefault(),e.stopPropagation(),o.toggle()})),n.on(["shape.added","connection.added"],(function(e){var t=e.element;o._addElement(t),o._update()})),n.on(["shape.removed","connection.removed"],(function(e){var t=e.element;o._removeElement(t),o._update()})),n.on("elements.changed",250,(function(e){e.elements.forEach((function(e){o._updateElement(e)})),o._update()})),n.on("element.updateId",(function(e){var t=e.element,n=e.newId;o._updateElementId(t,n)})),n.on("canvas.viewbox.changed",(function(){o._state.isDragging||o._update()})),n.on("canvas.resized",(function(){document.body.contains(o._parent)&&(o._state.isDragging||o._update(),o._state._svgClientRect=o._svg.getBoundingClientRect())}))}function Oy(e,t,n){var i=t.getBoundingClientRect(),r=function(e,t){var n=e.width/e.height,i=U({},{x:e.x,y:e.y,width:e.width,height:e.height});if(n>t){var r=i.width*(1/t);U(i,{y:i.y-(r-i.height)/2,height:r})}else if(n<t){var o=i.height*t;U(i,{x:i.x-(o-i.width)/2,width:o})}return i}(n,i.width/i.height);return{x:Ty(e.x,0,i.width,r.x,r.x+r.width),y:Ty(e.y,0,i.height,r.y,r.y+r.height)}}function Cy(e,t){var n=t.viewbox(),i=n.width,r=n.height;t.viewbox({x:e.x-i/2,y:e.y-r/2,width:i,height:r})}function Ty(e,t,n,i,r){return(e-t)*(r-i)/(n-t)+i}function Ay(e,t,n){var i=[].slice.call(t.childNodes)[n];t.insertBefore(e,i.nextSibling)}function Ry(e){return 0===e.width&&0===e.height}Sy.$inject=["config.minimap","injector","eventBus","canvas","elementRegistry"],Sy.prototype._init=function(){var e=this._canvas.getContainer(),t=this._parent=document.createElement("div");Q(t).add("djs-minimap"),e.appendChild(t);var n=this._toggle=document.createElement("div");Q(n).add("toggle"),t.appendChild(n);var i=this._map=document.createElement("div");Q(i).add("map"),t.appendChild(i);var r=this._svg=Ne("svg");Pe(r,{width:"100%",height:"100%"}),Ee(i,r),Ee(r,this._elementsGroup=Ne("g"));var o=this._viewportGroup=Ne("g");Ee(r,o);var a=this._viewport=Ne("rect");Ae(a).add("viewport"),Ee(o,a),pe.bind(t,"mousedown",(function(e){e.stopPropagation()}));var s=this._viewportDom=document.createElement("div");Q(s).add("viewport-dom"),this._parent.appendChild(s);var c=this._overlay=document.createElement("div");Q(c).add("overlay"),this._parent.appendChild(c)},Sy.prototype._update=function(){var e=this._canvas.viewbox(),t=e.inner,n=e.outer;if(Dy(e)){var i,r,o,a,s=n.width-t.width,c=n.height-t.height;t.width<n.width?(i=t.x-s/2,o=n.width,t.x+t.width<n.width&&(i=Math.min(0,t.x))):(i=t.x,o=t.width),t.height<n.height?(r=t.y-c/2,a=n.height,t.y+t.height<n.height&&(r=Math.min(0,t.y))):(r=t.y,a=t.height),i-=50,r-=50,o+=100,a+=100,this._lastViewbox={x:i,y:r,width:o,height:a},Pe(this._svg,{viewBox:i+", "+r+", "+o+", "+a}),Pe(this._viewport,{x:e.x,y:e.y,width:e.width,height:e.height});var p=this._state._parentClientRect=this._parent.getBoundingClientRect(),u=this._viewport.getBoundingClientRect(),l={top:u.top-p.top,left:u.left-p.left,width:u.width,height:u.height};U(this._viewportDom.style,{top:l.top+"px",left:l.left+"px",width:l.width+"px",height:l.height+"px"});var d=jy(p,l);U(this._overlay.style,{clipPath:d})}},Sy.prototype.open=function(){U(this._state,{isOpen:!0}),Q(this._parent).add("open");var e=this._injector.get("translate",!1)||function(e){return e};K(this._toggle,"title",e("Close minimap")),this._update(),this._eventBus.fire("minimap.toggle",{open:!0})},Sy.prototype.close=function(){U(this._state,{isOpen:!1}),Q(this._parent).remove("open");var e=this._injector.get("translate",!1)||function(e){return e};K(this._toggle,"title",e("Open minimap")),this._eventBus.fire("minimap.toggle",{open:!1})},Sy.prototype.toggle=function(e){var t=this.isOpen();void 0===e&&(e=!t),e!=t&&(e?this.open():this.close())},Sy.prototype.isOpen=function(){return this._state.isOpen},Sy.prototype._updateElement=function(e){try{void 0!==e.parent&&null!==e.parent&&(this._removeElement(e),this._addElement(e))}catch(e){console.warn("Minimap#_updateElement errored",e)}},Sy.prototype._updateElementId=function(e,t){try{var n=ve("#"+Is(e.id),this._elementsGroup);n&&(n.id=t)}catch(e){console.warn("Minimap#_updateElementId errored",e)}},Sy.prototype._addElement=function(e){var t,n,i,r=this;this._removeElement(e);var o=this._createElement(e),a=ve("#"+Is(e.parent.id),this._elementsGroup);if(o){var s=function(e,t){var n=ve(".djs-children",t.parentNode);if(!n)return;var i=[].slice.call(n.childNodes),r=-1;return i.forEach((function(t,n){ve(".djs-element",t)===e&&(r=n)})),r}(this._elementRegistry.getGraphics(e),this._elementRegistry.getGraphics(e.parent));return"undefined"!==s&&a?a.childNodes.length>s?Ay(o,a,s):Ay(o,a,a.childNodes.length-1):this._elementsGroup.appendChild(o),!function(e){return e.waypoints}(e)?(n=e.x,i=e.y,a&&(n-=(t=e.parent).x,i-=t.y),Pe(o,{transform:"translate("+n+" "+i+")"})):(n=0,i=0,void 0!==(t=e.parent).x&&void 0!==t.y&&(n=-t.x,i=-t.y),Pe(o,{transform:"translate("+n+" "+i+")"})),e.children&&e.children.length&&e.children.forEach((function(e){r._addElement(e)})),o}},Sy.prototype._removeElement=function(e){var t=this._svg.getElementById(e.id);t&&ke(t)},Sy.prototype._createElement=function(e){var t,n=this._elementRegistry.getGraphics(e);if(n&&(t=Kn(n))){var i=Me(t);return Pe(i,{id:e.id}),i}};var ky=Math.sign||function(e){return e>=0?1:-1};function jy(e,t){return"polygon("+[My(t.left,t.top),My(t.left+t.width,t.top),My(t.left+t.width,t.top+t.height),My(t.left,t.top+t.height),My(t.left,e.height),My(e.width,e.height),My(e.width,0),My(0,0),My(0,e.height),My(t.left,e.height)].join(", ")+")"}function My(e,t){return e+"px "+t+"px"}function Dy(e){return O(e,(function(e){return m(e)?Dy(e):f(e)&&isFinite(e)}))}var By={__init__:["minimap"],minimap:["type",Sy]};function Iy(e,t){var n,i,r=(e=e||{}).borderColor||"rgba(0,0,0,0.1)",o=e.crossColor||"#CCC",a=-1;Ee(t.getLayer("djs-origin",-1),n=Fy("g",{"pointer-events":"none"})),!1!==e.showBorder&&Ee(n,Fy("path",{class:Ly("border"),d:Ny(["M",-22,a,"H",-1e3,"M",22,a,"H",6e3,"M",a,-22,"V",-1e3,"M",a,22,"V",3e3]),fill:"none",stroke:r,"stroke-width":"2px","stroke-dasharray":"6, 6","shape-rendering":"crispedges"})),Ee(n,Fy("path",{d:Ny(["M",-15,a,"H",15,"M",a,-15,"V",15]),class:Ly("cross"),fill:"none",stroke:o,"stroke-width":"2px","stroke-linecap":"round"})),(i=Fy("text",{x:-40,y:-10,fill:o,class:Ly("label")})).textContent="(0, 0)",Ee(n,i)}function Ny(e){return e.join(" ")}function Ly(e){return"djs-origin-"+e}function Fy(e,t){var n=Ne(e);return Pe(n,t),n}Iy.$inject=["config.origin","canvas"];var Vy={__init__:[Iy]},$y={offset:{x:150,y:75},tolerance:50,alignOnSave:!0};function zy(e,t,n,i,r,o){function a(e,n){var i=n.offset,r=n.tolerance,o={};return["x","y"].forEach((function(n){var a=-e[n]+i[n],s=t.get("gridSnapping",!1);s&&(a=function(e,t,n){n||(n="round");return Math[n](e/t)*t}(a,s.getGridSpacing())),o[n]=Math.abs(a)<r?0:a})),o}function s(){var t=r.viewbox().inner,n=r.getRootElement().children;if(n.length){var o=a(t,e);0===o.x&&0===o.y||i.execute("elements.alignToOrigin",{elements:n,delta:o})}}function c(e){return function(t){n.once("commandStack.changed",(function(){var n=t.delta,i=r.viewbox().scale;r.scroll({dx:e*n.x*i,dy:e*n.y*i})}))}}e=function(e){var t=U({},$y,e||{});return f(t.offset)&&(t.offset={x:t.offset,y:t.offset}),t}(e),i.register("elements.alignToOrigin",{preExecute:function(e){var t=e.delta,n=e.elements;o.moveElements(n,t)},execute:c(-1),revert:c(1)}),e.alignOnSave&&function(){var e=t.get("_parent",!1),i=n,r=e&&e._eventBus;(r||i).on("saveXML.start",1250,s),r&&i.on("diagram.destroy",(function(){r.off("saveXML.start",s)}))}(),this.align=s,this.computeAdjustment=a,this._config=e}zy.$inject=["config.alignToOrigin","injector","eventBus","commandStack","canvas","modeling"];var qy={__init__:["alignToOrigin"],alignToOrigin:["type",zy]};function Uy(e){function t(e){if(!e.labelTarget){var t=Br(e);Dr(t,"bpmn:Participant")&&(t=t.processRef),Dr(t,"bpmn:Process")&&(t.isExecutable=!!t.isExecutable)}}e.on(["shape.added","root.added"],(function(e){t(e.element)})),e.on("elements.changed",(function(e){e.elements.forEach((function(e){t(e)}))}))}Uy.$inject=["eventBus"];var Gy={__init__:[Uy]};class Hy{constructor(e,t,n,i,r,o){this._eventBus=e,this._bpmnImporter=t,this._bpmnjs=n,this._canvas=i,this._modeling=r,this._translate=o}execute(e){var t=this,n=this._eventBus,i=e.subProcess,r=e.subProcessDiagram,o=[],a=new Er({element:function(n,i){e.cached||(e.cached={});var r=e.cached[n.id];if(r)return r.label&&t._canvas.addShape(r.label,i),r.waypoints?t._canvas.addConnection(r,i):t._canvas.addShape(r,i);var o=t._bpmnImporter.add(n,i);return e.cached[o.id]=o,o},error:function(e,t){o.push({message:e,context:t})}},this._translate);r.plane.planeElement.forEach((function(e){a.registerDi(e)})),Wy(r,this.findDiagram(this._canvas.getRootElement().id));var s,c=Br(i);n.fire("signavio.import.render.start",{subProcess:c});try{a.handleSubProcess(c,i),a.handleDeferred()}catch(e){s=e}n.fire("signavio.import.render.complete",{error:s,subProcess:c,warnings:o}),n.fire("signavio.import.done",{error:s,subProcess:c,warnings:o})}postExecute(e){var t=e.subProcess,n=Yp(t.children.filter((function(e){return!e.hidden}))),i=n.x+n.width/2,r=n.y+n.height/2,o={x:t.x+t.width/2-i,y:t.y+t.height/2-r};this._modeling.moveElements(t.children,o,t)}revert(e){var t=this;var n=e.subProcess,i=e.subProcessDiagram,r=this.findDiagram(this._canvas.getRootElement().id),o=r.plane.planeElement.filter((function(e){return function(e,t){for(;e.bpmnElement&&e.bpmnElement.$parent;){if(e.bpmnElement.$parent.id===t)return!0;e=e.bpmnElement.$parent}return!1}(e,n.id)}));o.forEach((function(e){delete e.bpmnElement.di})),Wy(r,i,o),n.children&&n.children.length&&Jh(n.children,(function(e){!function(e){e.waypoints?t._canvas.removeConnection(e):t._canvas.removeShape(e)}(e)}))}findDiagram(e){return x(this._bpmnjs.getDefinitions().diagrams,(function(t){return t.plane.bpmnElement.id===e}))}}function Wy(e,t,n){n=n||e.plane.planeElement;var i=t.plane.planeElement;n.forEach((function(e){wt(i,e)})),n.slice().forEach((function(n){Et(e.plane.planeElement,n),n.$parent=t.plane}))}Hy.$inject=["eventBus","bpmnImporter","bpmnjs","canvas","modeling","translate"];class Ky{constructor(e,t,n,i,r){this._bpmnFactory=e,this._bpmnImporter=t,this._bpmnjs=n,this._canvas=i,this._translate=r}execute(e){var t=this;function n(e){e.children&&e.children.length&&e.children.slice().forEach(n),e.waypoints?t._canvas.removeConnection(e):t._canvas.removeShape(e)}var i=e.subProcess,r=e.subProcessDiagram;this.findDiagram(i.id)||(r||(r=this._bpmnFactory.create("bpmndi:BPMNDiagram",{plane:this._bpmnFactory.createDiPlane(Br(i))}),e.created=!0,e.subProcessDiagram=r),wt(this._bpmnjs.getDefinitions().diagrams,r));var o=this.findDiagram(this._canvas.getRootElement().id),a=o.plane.planeElement.filter((function(e){return function(e,t){for(;e.bpmnElement&&e.bpmnElement.$parent;){if(e.bpmnElement.$parent.id===t)return!0;e=e.bpmnElement.$parent}return!1}(e,i.id)}));a.forEach((function(e){delete e.bpmnElement.di})),Xy(o,r,a),i.children&&i.children.length&&Jh(i.children,(function(e){n(e)}))}revert(e){var t=this,n=e.subProcess,i=e.subProcessDiagram,r=e.created,o=[],a=new Er({element:function(e,n){return t._bpmnImporter.add(e,n)},error:function(e,t){o.push({message:e,context:t})}},this._translate);(i.plane.planeElement.forEach((function(e){a.registerDi(e)})),Xy(i,this.findDiagram(this._canvas.getRootElement().id)),r)&&Et(this._bpmnjs.getDefinitions().diagrams,i);try{a.handleSubProcess(Br(n),n),a.handleDeferred()}catch(e){console.error(e)}o.length&&console.warn(o)}findDiagram(e){return x(this._bpmnjs.getDefinitions().diagrams,(function(t){return t.plane.bpmnElement.id===e}))}}function Xy(e,t,n){n=n||e.plane.planeElement;var i=t.plane.get("planeElement");n.forEach((function(e){wt(i,e)})),n.slice().forEach((function(n){Et(e.plane.planeElement,n),n.$parent=t.plane}))}Ky.$inject=["bpmnFactory","bpmnImporter","bpmnjs","canvas","translate"];class Yy extends as{constructor(e,t,n,i,r,o,a){super(r),this._bpmnjs=e,i.registerHandler("signavioCompat.importSubProcess",Hy),i.registerHandler("signavioCompat.deleteSubProcess",Ky),this.postExecuted(["shape.toggleCollapse"],2e3,(t=>{if(!x(e.getDefinitions().$attrs,(function(e){return"http://www.signavio.com"===e})))return;const n=t.context.shape;var r;if(Dr(n,"bpmn:SubProcess"))if(n.collapsed)r={subProcess:n,subProcessDiagram:this.findDiagram(n.id)},i.execute("signavioCompat.deleteSubProcess",r);else{const e=this.findDiagram(n.id);if(!e)return;r={subProcess:n,subProcessDiagram:e},i.execute("signavioCompat.importSubProcess",r)}}))}findDiagram(e){return x(this._bpmnjs.getDefinitions().diagrams,(function(t){return t.plane.bpmnElement.id===e}))}}Yy.$inject=["bpmnjs","bpmnImporter","canvas","commandStack","eventBus","modeling","translate"];var Jy={__init__:["signavioBehavior"],signavioBehavior:["type",Yy]},Zy="replace-with-collapsed-subprocess",Qy="replace-with-expanded-subprocess";function eg(e,t,n){e.registerProvider("bpmn-replace",this),this._bpmnReplace=t,this._translate=n}function tg(e){return Dr(e,"bpmn:SubProcess")&&!Dr(e,"bpmn:Transaction")&&!Fr(e)}eg.$inject=["popupMenu","bpmnReplace","translate"],eg.prototype.getPopupMenuEntries=function(e){var t=this._bpmnReplace,n=this._translate,i={"expand-subprocess":{className:"bpmn-icon-subprocess-expanded",label:n("Expand (not reversible)"),action:function(){t.replaceElement(e,{type:"bpmn:SubProcess",isExpanded:!0})}}};return function(r){return function(e){return Dr(e,"bpmn:Task")}(e)?(delete r[Qy],delete r[Zy],r["replace-with-subprocess"]={className:"bpmn-icon-subprocess-collapsed",label:n("Sub Process"),action:function(){t.replaceElement(e,{type:"bpmn:SubProcess",isExpanded:!1})}},r):tg(e)&&Nr(e)?(delete r[Zy],r):tg(e)&&!Nr(e)?function(e){return e.children&&e.children.length}(e)?i:(delete r[Zy],delete r[Qy],U(r,i)):r}};var ng={__depends__:["popupMenu","bpmnReplace"],__init__:["disabledCollapsedSubprocessPopupProvider"],disabledCollapsedSubprocessPopupProvider:["type",eg]};var ig=function(e,t){for(var n=-1,i=null==e?0:e.length;++n<i&&!1!==t(e[n],n,e););return e};var rg=function(e){return function(t,n,i){for(var r=-1,o=Object(t),a=i(t),s=a.length;s--;){var c=a[e?s:++r];if(!1===n(o[c],c,o))break}return t}}();var og=function(e,t){for(var n=-1,i=Array(e);++n<e;)i[n]=t(n);return i},ag="object"==typeof e&&e&&e.Object===Object&&e,sg="object"==typeof self&&self&&self.Object===Object&&self,cg=ag||sg||Function("return this")(),pg=cg.Symbol,ug=Object.prototype,lg=ug.hasOwnProperty,dg=ug.toString,hg=pg?pg.toStringTag:void 0;var mg=function(e){var t=lg.call(e,hg),n=e[hg];try{e[hg]=void 0;var i=!0}catch(e){}var r=dg.call(e);return i&&(t?e[hg]=n:delete e[hg]),r},fg=Object.prototype.toString;var vg=function(e){return fg.call(e)},yg=pg?pg.toStringTag:void 0;var gg=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":yg&&yg in Object(e)?mg(e):vg(e)};var bg=function(e){return null!=e&&"object"==typeof e};var xg=function(e){return bg(e)&&"[object Arguments]"==gg(e)},Eg=Object.prototype,wg=Eg.hasOwnProperty,_g=Eg.propertyIsEnumerable,Pg=xg(function(){return arguments}())?xg:function(e){return bg(e)&&wg.call(e,"callee")&&!_g.call(e,"callee")},Sg=Array.isArray;var Og=function(){return!1},Cg=n((function(e,t){var n=t&&!t.nodeType&&t,i=n&&e&&!e.nodeType&&e,r=i&&i.exports===n?cg.Buffer:void 0,o=(r?r.isBuffer:void 0)||Og;e.exports=o})),Tg=/^(?:0|[1-9]\d*)$/;var Ag=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&Tg.test(e))&&e>-1&&e%1==0&&e<t};var Rg=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},kg={};kg["[object Float32Array]"]=kg["[object Float64Array]"]=kg["[object Int8Array]"]=kg["[object Int16Array]"]=kg["[object Int32Array]"]=kg["[object Uint8Array]"]=kg["[object Uint8ClampedArray]"]=kg["[object Uint16Array]"]=kg["[object Uint32Array]"]=!0,kg["[object Arguments]"]=kg["[object Array]"]=kg["[object ArrayBuffer]"]=kg["[object Boolean]"]=kg["[object DataView]"]=kg["[object Date]"]=kg["[object Error]"]=kg["[object Function]"]=kg["[object Map]"]=kg["[object Number]"]=kg["[object Object]"]=kg["[object RegExp]"]=kg["[object Set]"]=kg["[object String]"]=kg["[object WeakMap]"]=!1;var jg=function(e){return bg(e)&&Rg(e.length)&&!!kg[gg(e)]};var Mg=function(e){return function(t){return e(t)}},Dg=n((function(e,t){var n=t&&!t.nodeType&&t,i=n&&e&&!e.nodeType&&e,r=i&&i.exports===n&&ag.process,o=function(){try{var e=i&&i.require&&i.require("util").types;return e||r&&r.binding&&r.binding("util")}catch(e){}}();e.exports=o})),Bg=Dg&&Dg.isTypedArray,Ig=Bg?Mg(Bg):jg,Ng=Object.prototype.hasOwnProperty;var Lg=function(e,t){var n=Sg(e),i=!n&&Pg(e),r=!n&&!i&&Cg(e),o=!n&&!i&&!r&&Ig(e),a=n||i||r||o,s=a?og(e.length,String):[],c=s.length;for(var p in e)!t&&!Ng.call(e,p)||a&&("length"==p||r&&("offset"==p||"parent"==p)||o&&("buffer"==p||"byteLength"==p||"byteOffset"==p)||Ag(p,c))||s.push(p);return s},Fg=Object.prototype;var Vg=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Fg)};var $g=function(e,t){return function(n){return e(t(n))}},zg=$g(Object.keys,Object),qg=Object.prototype.hasOwnProperty;var Ug=function(e){if(!Vg(e))return zg(e);var t=[];for(var n in Object(e))qg.call(e,n)&&"constructor"!=n&&t.push(n);return t};var Gg=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)};var Hg=function(e){if(!Gg(e))return!1;var t=gg(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t};var Wg=function(e){return null!=e&&Rg(e.length)&&!Hg(e)};var Kg=function(e){return Wg(e)?Lg(e):Ug(e)};var Xg=function(e,t){return e&&rg(e,t,Kg)};var Yg=function(e,t){return function(n,i){if(null==n)return n;if(!Wg(n))return e(n,i);for(var r=n.length,o=t?r:-1,a=Object(n);(t?o--:++o<r)&&!1!==i(a[o],o,a););return n}}(Xg);var Jg=function(e){return e};var Zg=function(e){return"function"==typeof e?e:Jg};var Qg=function(e,t){return(Sg(e)?ig:Yg)(e,Zg(t))},eb=Object.create,tb=function(){function e(){}return function(t){if(!Gg(t))return{};if(eb)return eb(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();var nb=function(){this.__data__=[],this.size=0};var ib=function(e,t){return e===t||e!=e&&t!=t};var rb=function(e,t){for(var n=e.length;n--;)if(ib(e[n][0],t))return n;return-1},ob=Array.prototype.splice;var ab=function(e){var t=this.__data__,n=rb(t,e);return!(n<0)&&(n==t.length-1?t.pop():ob.call(t,n,1),--this.size,!0)};var sb=function(e){var t=this.__data__,n=rb(t,e);return n<0?void 0:t[n][1]};var cb=function(e){return rb(this.__data__,e)>-1};var pb=function(e,t){var n=this.__data__,i=rb(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this};function ub(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}ub.prototype.clear=nb,ub.prototype.delete=ab,ub.prototype.get=sb,ub.prototype.has=cb,ub.prototype.set=pb;var lb=ub;var db=function(){this.__data__=new lb,this.size=0};var hb=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n};var mb=function(e){return this.__data__.get(e)};var fb,vb=function(e){return this.__data__.has(e)},yb=cg["__core-js_shared__"],gb=(fb=/[^.]+$/.exec(yb&&yb.keys&&yb.keys.IE_PROTO||""))?"Symbol(src)_1."+fb:"";var bb=function(e){return!!gb&&gb in e},xb=Function.prototype.toString;var Eb=function(e){if(null!=e){try{return xb.call(e)}catch(e){}try{return e+""}catch(e){}}return""},wb=/^\[object .+?Constructor\]$/,_b=Function.prototype,Pb=Object.prototype,Sb=_b.toString,Ob=Pb.hasOwnProperty,Cb=RegExp("^"+Sb.call(Ob).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var Tb=function(e){return!(!Gg(e)||bb(e))&&(Hg(e)?Cb:wb).test(Eb(e))};var Ab=function(e,t){return null==e?void 0:e[t]};var Rb=function(e,t){var n=Ab(e,t);return Tb(n)?n:void 0},kb=Rb(cg,"Map"),jb=Rb(Object,"create");var Mb=function(){this.__data__=jb?jb(null):{},this.size=0};var Db=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Bb=Object.prototype.hasOwnProperty;var Ib=function(e){var t=this.__data__;if(jb){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return Bb.call(t,e)?t[e]:void 0},Nb=Object.prototype.hasOwnProperty;var Lb=function(e){var t=this.__data__;return jb?void 0!==t[e]:Nb.call(t,e)};var Fb=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=jb&&void 0===t?"__lodash_hash_undefined__":t,this};function Vb(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}Vb.prototype.clear=Mb,Vb.prototype.delete=Db,Vb.prototype.get=Ib,Vb.prototype.has=Lb,Vb.prototype.set=Fb;var $b=Vb;var zb=function(){this.size=0,this.__data__={hash:new $b,map:new(kb||lb),string:new $b}};var qb=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};var Ub=function(e,t){var n=e.__data__;return qb(t)?n["string"==typeof t?"string":"hash"]:n.map};var Gb=function(e){var t=Ub(this,e).delete(e);return this.size-=t?1:0,t};var Hb=function(e){return Ub(this,e).get(e)};var Wb=function(e){return Ub(this,e).has(e)};var Kb=function(e,t){var n=Ub(this,e),i=n.size;return n.set(e,t),this.size+=n.size==i?0:1,this};function Xb(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}Xb.prototype.clear=zb,Xb.prototype.delete=Gb,Xb.prototype.get=Hb,Xb.prototype.has=Wb,Xb.prototype.set=Kb;var Yb=Xb;var Jb=function(e,t){var n=this.__data__;if(n instanceof lb){var i=n.__data__;if(!kb||i.length<199)return i.push([e,t]),this.size=++n.size,this;n=this.__data__=new Yb(i)}return n.set(e,t),this.size=n.size,this};function Zb(e){var t=this.__data__=new lb(e);this.size=t.size}Zb.prototype.clear=db,Zb.prototype.delete=hb,Zb.prototype.get=mb,Zb.prototype.has=vb,Zb.prototype.set=Jb;var Qb=Zb;var ex=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this};var tx=function(e){return this.__data__.has(e)};function nx(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Yb;++t<n;)this.add(e[t])}nx.prototype.add=nx.prototype.push=ex,nx.prototype.has=tx;var ix=nx;var rx=function(e,t){for(var n=-1,i=null==e?0:e.length;++n<i;)if(t(e[n],n,e))return!0;return!1};var ox=function(e,t){return e.has(t)};var ax=function(e,t,n,i,r,o){var a=1&n,s=e.length,c=t.length;if(s!=c&&!(a&&c>s))return!1;var p=o.get(e),u=o.get(t);if(p&&u)return p==t&&u==e;var l=-1,d=!0,h=2&n?new ix:void 0;for(o.set(e,t),o.set(t,e);++l<s;){var m=e[l],f=t[l];if(i)var v=a?i(f,m,l,t,e,o):i(m,f,l,e,t,o);if(void 0!==v){if(v)continue;d=!1;break}if(h){if(!rx(t,(function(e,t){if(!ox(h,t)&&(m===e||r(m,e,n,i,o)))return h.push(t)}))){d=!1;break}}else if(m!==f&&!r(m,f,n,i,o)){d=!1;break}}return o.delete(e),o.delete(t),d},sx=cg.Uint8Array;var cx=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,i){n[++t]=[i,e]})),n};var px=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n},ux=pg?pg.prototype:void 0,lx=ux?ux.valueOf:void 0;var dx=function(e,t,n,i,r,o,a){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!o(new sx(e),new sx(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return ib(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var s=cx;case"[object Set]":var c=1&i;if(s||(s=px),e.size!=t.size&&!c)return!1;var p=a.get(e);if(p)return p==t;i|=2,a.set(e,t);var u=ax(s(e),s(t),i,r,o,a);return a.delete(e),u;case"[object Symbol]":if(lx)return lx.call(e)==lx.call(t)}return!1};var hx=function(e,t){for(var n=-1,i=t.length,r=e.length;++n<i;)e[r+n]=t[n];return e};var mx=function(e,t,n){var i=t(e);return Sg(e)?i:hx(i,n(e))};var fx=function(e,t){for(var n=-1,i=null==e?0:e.length,r=0,o=[];++n<i;){var a=e[n];t(a,n,e)&&(o[r++]=a)}return o};var vx=function(){return[]},yx=Object.prototype.propertyIsEnumerable,gx=Object.getOwnPropertySymbols,bx=gx?function(e){return null==e?[]:(e=Object(e),fx(gx(e),(function(t){return yx.call(e,t)})))}:vx;var xx=function(e){return mx(e,Kg,bx)},Ex=Object.prototype.hasOwnProperty;var wx=function(e,t,n,i,r,o){var a=1&n,s=xx(e),c=s.length;if(c!=xx(t).length&&!a)return!1;for(var p=c;p--;){var u=s[p];if(!(a?u in t:Ex.call(t,u)))return!1}var l=o.get(e),d=o.get(t);if(l&&d)return l==t&&d==e;var h=!0;o.set(e,t),o.set(t,e);for(var m=a;++p<c;){var f=e[u=s[p]],v=t[u];if(i)var y=a?i(v,f,u,t,e,o):i(f,v,u,e,t,o);if(!(void 0===y?f===v||r(f,v,n,i,o):y)){h=!1;break}m||(m="constructor"==u)}if(h&&!m){var g=e.constructor,b=t.constructor;g==b||!("constructor"in e)||!("constructor"in t)||"function"==typeof g&&g instanceof g&&"function"==typeof b&&b instanceof b||(h=!1)}return o.delete(e),o.delete(t),h},_x=Rb(cg,"DataView"),Px=Rb(cg,"Promise"),Sx=Rb(cg,"Set"),Ox=Rb(cg,"WeakMap"),Cx="[object Map]",Tx="[object Promise]",Ax="[object Set]",Rx="[object WeakMap]",kx="[object DataView]",jx=Eb(_x),Mx=Eb(kb),Dx=Eb(Px),Bx=Eb(Sx),Ix=Eb(Ox),Nx=gg;(_x&&Nx(new _x(new ArrayBuffer(1)))!=kx||kb&&Nx(new kb)!=Cx||Px&&Nx(Px.resolve())!=Tx||Sx&&Nx(new Sx)!=Ax||Ox&&Nx(new Ox)!=Rx)&&(Nx=function(e){var t=gg(e),n="[object Object]"==t?e.constructor:void 0,i=n?Eb(n):"";if(i)switch(i){case jx:return kx;case Mx:return Cx;case Dx:return Tx;case Bx:return Ax;case Ix:return Rx}return t});var Lx=Nx,Fx="[object Arguments]",Vx="[object Array]",$x="[object Object]",zx=Object.prototype.hasOwnProperty;var qx=function(e,t,n,i,r,o){var a=Sg(e),s=Sg(t),c=a?Vx:Lx(e),p=s?Vx:Lx(t),u=(c=c==Fx?$x:c)==$x,l=(p=p==Fx?$x:p)==$x,d=c==p;if(d&&Cg(e)){if(!Cg(t))return!1;a=!0,u=!1}if(d&&!u)return o||(o=new Qb),a||Ig(e)?ax(e,t,n,i,r,o):dx(e,t,c,n,i,r,o);if(!(1&n)){var h=u&&zx.call(e,"__wrapped__"),m=l&&zx.call(t,"__wrapped__");if(h||m){var f=h?e.value():e,v=m?t.value():t;return o||(o=new Qb),r(f,v,n,i,o)}}return!!d&&(o||(o=new Qb),wx(e,t,n,i,r,o))};var Ux=function e(t,n,i,r,o){return t===n||(null==t||null==n||!bg(t)&&!bg(n)?t!=t&&n!=n:qx(t,n,i,r,e,o))};var Gx=function(e,t,n,i){var r=n.length,o=r,a=!i;if(null==e)return!o;for(e=Object(e);r--;){var s=n[r];if(a&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++r<o;){var c=(s=n[r])[0],p=e[c],u=s[1];if(a&&s[2]){if(void 0===p&&!(c in e))return!1}else{var l=new Qb;if(i)var d=i(p,u,c,e,t,l);if(!(void 0===d?Ux(u,p,3,i,l):d))return!1}}return!0};var Hx=function(e){return e==e&&!Gg(e)};var Wx=function(e){for(var t=Kg(e),n=t.length;n--;){var i=t[n],r=e[i];t[n]=[i,r,Hx(r)]}return t};var Kx=function(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in Object(n)))}};var Xx=function(e){var t=Wx(e);return 1==t.length&&t[0][2]?Kx(t[0][0],t[0][1]):function(n){return n===e||Gx(n,e,t)}};var Yx=function(e){return"symbol"==typeof e||bg(e)&&"[object Symbol]"==gg(e)},Jx=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Zx=/^\w*$/;var Qx=function(e,t){if(Sg(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!Yx(e))||(Zx.test(e)||!Jx.test(e)||null!=t&&e in Object(t))};function eE(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var i=arguments,r=t?t.apply(this,i):i[0],o=n.cache;if(o.has(r))return o.get(r);var a=e.apply(this,i);return n.cache=o.set(r,a)||o,a};return n.cache=new(eE.Cache||Yb),n}eE.Cache=Yb;var tE=eE;var nE=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,iE=/\\(\\)?/g,rE=function(e){var t=tE(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t}((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(nE,(function(e,n,i,r){t.push(i?r.replace(iE,"$1"):n||e)})),t}));var oE=function(e,t){for(var n=-1,i=null==e?0:e.length,r=Array(i);++n<i;)r[n]=t(e[n],n,e);return r},aE=pg?pg.prototype:void 0,sE=aE?aE.toString:void 0;var cE=function e(t){if("string"==typeof t)return t;if(Sg(t))return oE(t,e)+"";if(Yx(t))return sE?sE.call(t):"";var n=t+"";return"0"==n&&1/t==-Infinity?"-0":n};var pE=function(e){return null==e?"":cE(e)};var uE=function(e,t){return Sg(e)?e:Qx(e,t)?[e]:rE(pE(e))};var lE=function(e){if("string"==typeof e||Yx(e))return e;var t=e+"";return"0"==t&&1/e==-Infinity?"-0":t};var dE=function(e,t){for(var n=0,i=(t=uE(t,e)).length;null!=e&&n<i;)e=e[lE(t[n++])];return n&&n==i?e:void 0};var hE=function(e,t,n){var i=null==e?void 0:dE(e,t);return void 0===i?n:i};var mE=function(e,t){return null!=e&&t in Object(e)};var fE=function(e,t,n){for(var i=-1,r=(t=uE(t,e)).length,o=!1;++i<r;){var a=lE(t[i]);if(!(o=null!=e&&n(e,a)))break;e=e[a]}return o||++i!=r?o:!!(r=null==e?0:e.length)&&Rg(r)&&Ag(a,r)&&(Sg(e)||Pg(e))};var vE=function(e,t){return null!=e&&fE(e,t,mE)};var yE=function(e,t){return Qx(e)&&Hx(t)?Kx(lE(e),t):function(n){var i=hE(n,e);return void 0===i&&i===t?vE(n,e):Ux(t,i,3)}};var gE=function(e){return function(t){return null==t?void 0:t[e]}};var bE=function(e){return function(t){return dE(t,e)}};var xE=function(e){return Qx(e)?gE(lE(e)):bE(e)};var EE=function(e){return"function"==typeof e?e:null==e?Jg:"object"==typeof e?Sg(e)?yE(e[0],e[1]):Xx(e):xE(e)},wE=$g(Object.getPrototypeOf,Object);var _E=function(e,t,n){var i=Sg(e),r=i||Cg(e)||Ig(e);if(t=EE(t),null==n){var o=e&&e.constructor;n=r?i?new o:[]:Gg(e)&&Hg(o)?tb(wE(e)):{}}return(r?ig:Xg)(e,(function(e,i,r){return t(n,e,i,r)})),n},PE=t(Ir),SE=PE.is;function OE(e){this._elementRegistry=e}OE.$inject=["elementRegistry"];var CE=OE;function TE(e,t){Qg(t,(function(t,n){e.set(n,t)}))}OE.prototype.execute=function(e){var t=e.element,n=e.businessObject,i=function(e){for(var t=e;t.$parent;)t=t.$parent;return t}(n).rootElements,r=e.referenceType,o=e.referenceProperty,a=[t];if(!t)throw new Error("element required");if(!n)throw new Error("businessObject required");var s=e.properties,c=e.oldProperties||function(e,t){return _E(t,(function(t,n){return t[n]=e.get(n),t}),{})}(n,Kg(s));return void 0!==r&&void 0!==o&&Qg(i,(function(e){SE(e,r)&&e.id===s[o]&&(s[o]=e)})),TE(n,s),e.oldProperties=c,e.changed=a,a},OE.prototype.revert=function(e){var t=e.oldProperties;return TE(e.businessObject,t),e.changed};var AE={},RE=AE;function kE(e,t){this._elementRegistry=e,this._bpmnFactory=t}AE.createElement=function(e,t,n,i){var r=i.create(e,t);return r.$parent=n,r},kE.$inject=["elementRegistry","bpmnFactory"];var jE=kE;function ME(e,t){if(!e)throw new Error(t+" required");return e}function DE(e,t){this._elementRegistry=e,this._bpmnFactory=t}kE.prototype.execute=function(e){var t=ME(e.referencingObject,"referencingObject"),n=ME(e.referenceProperty,"referenceProperty"),i=ME(e.newObject,"newObject"),r=ME(e.newObjectContainer,"newObjectContainer"),o=ME(e.newObjectParent,"newObjectParent"),a=[e.element],s=RE.createElement(i.type,i.properties,o,this._bpmnFactory);return e.referencedObject=s,r.push(s),e.previousReference=t[n],t[n]=s,e.changed=a,a},kE.prototype.revert=function(e){var t=e.referencingObject,n=e.referenceProperty,i=e.previousReference,r=e.referencedObject,o=e.newObjectContainer;return t.set(n,i),o.splice(o.indexOf(r),1),e.changed},DE.$inject=["elementRegistry","bpmnFactory"];var BE=DE;function IE(e,t){if(!e)throw new Error(t+" required");return e}function NE(e,t){this._elementRegistry=e,this._bpmnFactory=t}DE.prototype.execute=function(e){var t=IE(e.currentObject,"currentObject"),n=IE(e.propertyName,"propertyName"),i=function(e,t){if(!e||"[object Array]"!==Object.prototype.toString.call(e))throw new Error(t+" needs to be a list");return e}(e.newObjects,"newObjects"),r=[e.element],o=[],a=this;return Qg(i,(function(e){var n=RE.createElement(e.type,e.properties,t,a._bpmnFactory);o.push(n)})),e.childObject=o,e.previousChilds=t[n],t[n]=o,e.changed=r,r},DE.prototype.revert=function(e){var t=e.currentObject,n=e.propertyName,i=e.previousChilds;return t.set(n,i),e.changed},NE.$inject=["elementRegistry","bpmnFactory"];var LE=NE;function FE(e,t){if(!e)throw new Error(t+"required");return e}function VE(e){this._commandStack=e}NE.prototype.execute=function(e){var t,n=FE(e.currentObject,"currentObject"),i=FE(e.propertyName,"propertyName"),r=e.updatedObjectList,o=e.objectsToRemove||[],a=e.objectsToAdd||[],s=e.objectsToPrepend||[],c=[e.element];e.referencePropertyName&&(t=e.referencePropertyName);var p=n[i];if(e.previousList=n[i],r)n[i]=r;else{var u=s.slice();if(Qg(p,(function(e){-1==o.indexOf(e)&&u.push(e)})),(u=u.concat(a)).length>0||!t)n[i]=u;else if(t){n.$parent.set(t,void 0)}}return e.changed=c,c},NE.prototype.revert=function(e){var t=e.currentObject,n=e.propertyName,i=e.previousList,r=t.$parent;return e.referencePropertyName&&r.set(e.referencePropertyName,t),t.set(n,i),e.changed},VE.$inject=["commandStack"];var $E=VE;VE.prototype.preExecute=function(e){var t=this._commandStack;Qg(e,(function(e){t.execute(e.cmd,e.context)}))};var zE={"properties-panel.update-businessobject":CE,"properties-panel.create-and-reference":jE,"properties-panel.create-businessobject-list":BE,"properties-panel.update-businessobject-list":LE,"properties-panel.multi-command-executor":$E};function qE(e,t){e.on("diagram.init",(function(){Qg(zE,(function(e,n){t.registerHandler(n,e)}))}))}qE.$inject=["eventBus","commandStack"];var UE={__init__:[qE]},GE=t(be),HE=t(a),WE=GE.query,KE=GE.clear,XE=GE.classes,YE=PE.is,JE=GE.domify,ZE=HE.default,QE=/\s/,ew=/^([a-z][\w-.]*:)?[a-z_][\w-.]*$/i,tw=/^[a-z_][\w-.]*$/i,nw={"&":"&","<":"<",">":">",'"':""","'":"'"};function iw(e){if(e.selectedIndex>=0)return e.options[e.selectedIndex].value}function rw(e){for(var t=e;t.$parent;)t=t.$parent;return t}function ow(e,t){var n=[];return Qg(e||[],(function(e){YE(e,t)&&n.push(e)})),n}function aw(e,t){return ow(rw(e).rootElements,t)}function sw(e){return e.push({label:"",value:"",name:""})}function cw(e){var t=e.name||"";return e.errorCode&&(t+=" (code="+e.errorCode+")"),e.escalationCode&&(t+=" (code="+e.escalationCode+")"),t}function pw(e,t){var n=[],i=aw(e,t);return Qg(i,(function(e){n.push({label:cw(e),value:e.id,name:e.name})})),n}function uw(e,t){return lw(e)?t("Id must not contain spaces."):tw.test(e)?void 0:ew.test(e)?t("Id must not contain prefix."):t("Id must be a valid QName.")}function lw(e){return QE.test(e)}function dw(e){return(e=""+e)&&e.replace(/[&<>"']/g,(function(e){return nw[e]}))}var hw={selectedOption:iw,selectedType:function(e,t){return iw(WE(e,t))},getRoot:rw,filterElementsByType:ow,findRootElementsByType:aw,removeAllChildren:function(e){for(;e.firstChild;)e.removeChild(e.firstChild)},addEmptyParameter:sw,refreshOptionsModel:pw,updateOptionsDropDown:function(e,t,n,i){var r=pw(t,n);sw(r);var o=WE(e,i);return KE(o),Qg(r,(function(e){var t=JE('<option value="'+dw(e.value)+'">'+dw(e.label)+"</option>");o.appendChild(t)})),r},isIdValid:function(e,t,n){var i=e.$model.ids.assigned(t);return!t||i&&i!==e?n("Element must have an unique id."):uw(t,n)},validateId:uw,containsSpace:lw,nextId:function(e){return new ZE([32,32,1]).nextPrefixed(e)},triggerClickEvent:function(e){var t,n="click";if(document.createEvent){try{t=new MouseEvent(n,{view:window,bubbles:!0,cancelable:!0})}catch(e){(t=document.createEvent("MouseEvent")).initEvent(n,!0,!0)}return e.dispatchEvent(t)}return t=document.createEventObject(),e.fireEvent("onclick",t)},escapeHTML:dw,createDropdown:function(e){var t,n=e.menu,i=JE('<div class="group__dropdown"><button class="group__dropdown-button"><svg width="16" height="16" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 192 512"><path fill="currentColor" d="M96 184c39.8 0 72 32.2 72 72s-32.2 72-72 72-72-32.2-72-72 32.2-72 72-72zM24 80c0 39.8 32.2 72 72 72s72-32.2 72-72S135.8 8 96 8 24 40.2 24 80zm0 352c0 39.8 32.2 72 72 72s72-32.2 72-72-32.2-72-72-72-72 32.2-72 72z"></path></svg></button><div class="group__dropdown-menu"></div></div>'),r=WE(".group__dropdown-button",i),o=WE(".group__dropdown-menu",i);return r.addEventListener("click",(function(e){XE(i).toggle("group__dropdown--open"),function(e){function n(t){if(t!==e){var r=t.target;o===r||o.contains(r)||(XE(i).remove("group__dropdown--open"),document.removeEventListener("click",n))}}t&&document.removeEventListener("click",t);document.addEventListener("click",n),t=n}(e)})),Qg(n,(function(e){var t=JE('<div class="group__dropdown-menu-item" data-dropdown-action="'+e.id+'">'+dw(e.label)+"</div>");t.addEventListener("click",(function(){e.onClick(),XE(i).remove("group__dropdown--open")})),o.appendChild(t)})),i}};var mw=function(e,t){var n=[];return Yg(e,(function(e,i,r){t(e,i,r)&&n.push(e)})),n};var fw=function(e,t){return(Sg(e)?fx:mw)(e,EE(t))},vw=Object.prototype.hasOwnProperty;var yw=function(e){if(null==e)return!0;if(Wg(e)&&(Sg(e)||"string"==typeof e||"function"==typeof e.splice||Cg(e)||Ig(e)||Pg(e)))return!e.length;var t=Lx(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(Vg(e))return!Ug(e).length;for(var n in e)if(vw.call(e,n))return!1;return!0};var gw=function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)},bw=Math.max;var xw=function(e,t,n){return t=bw(void 0===t?e.length-1:t,0),function(){for(var i=arguments,r=-1,o=bw(i.length-t,0),a=Array(o);++r<o;)a[r]=i[t+r];r=-1;for(var s=Array(t+1);++r<t;)s[r]=i[r];return s[t]=n(a),gw(e,this,s)}};var Ew=function(e){return function(){return e}},ww=function(){try{var e=Rb(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),_w=ww?function(e,t){return ww(e,"toString",{configurable:!0,enumerable:!1,value:Ew(t),writable:!0})}:Jg,Pw=Date.now;var Sw=function(e){var t=0,n=0;return function(){var i=Pw(),r=16-(i-n);if(n=i,r>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}},Ow=Sw(_w);var Cw=function(e,t){return Ow(xw(e,t,Jg),e+"")};var Tw=function(e,t,n,i){for(var r=e.length,o=n+(i?1:-1);i?o--:++o<r;)if(t(e[o],o,e))return o;return-1};var Aw=function(e){return e!=e};var Rw=function(e,t,n){for(var i=n-1,r=e.length;++i<r;)if(e[i]===t)return i;return-1};var kw=function(e,t,n){return t==t?Rw(e,t,n):Tw(e,Aw,n)};var jw=function(e,t){return!!(null==e?0:e.length)&&kw(e,t,0)>-1};var Mw=function(e,t,n){for(var i=-1,r=null==e?0:e.length;++i<r;)if(n(t,e[i]))return!0;return!1};var Dw=function(e,t,n,i){var r=-1,o=jw,a=!0,s=e.length,c=[],p=t.length;if(!s)return c;n&&(t=oE(t,Mg(n))),i?(o=Mw,a=!1):t.length>=200&&(o=ox,a=!1,t=new ix(t));e:for(;++r<s;){var u=e[r],l=null==n?u:n(u);if(u=i||0!==u?u:0,a&&l==l){for(var d=p;d--;)if(t[d]===l)continue e;c.push(u)}else o(t,l,i)||c.push(u)}return c},Bw=pg?pg.isConcatSpreadable:void 0;var Iw=function(e){return Sg(e)||Pg(e)||!!(Bw&&e&&e[Bw])};var Nw=function e(t,n,i,r,o){var a=-1,s=t.length;for(i||(i=Iw),o||(o=[]);++a<s;){var c=t[a];n>0&&i(c)?n>1?e(c,n-1,i,r,o):hx(o,c):r||(o[o.length]=c)}return o};var Lw=function(){},Fw=Sx&&1/px(new Sx([,-0]))[1]==1/0?function(e){return new Sx(e)}:Lw;var Vw=function(e,t,n){var i=-1,r=jw,o=e.length,a=!0,s=[],c=s;if(n)a=!1,r=Mw;else if(o>=200){var p=t?null:Fw(e);if(p)return px(p);a=!1,r=ox,c=new ix}else c=t?[]:s;e:for(;++i<o;){var u=e[i],l=t?t(u):u;if(u=n||0!==u?u:0,a&&l==l){for(var d=c.length;d--;)if(c[d]===l)continue e;t&&c.push(l),s.push(u)}else r(c,l,n)||(c!==s&&c.push(l),s.push(u))}return s};var $w=function(e,t,n){var i=e.length;if(i<2)return i?Vw(e[0]):[];for(var r=-1,o=Array(i);++r<i;)for(var a=e[r],s=-1;++s<i;)s!=r&&(o[r]=Dw(o[r]||a,e[s],t,n));return Vw(Nw(o,1),t,n)};var zw=function(e){return bg(e)&&Wg(e)},qw=Cw((function(e){return $w(fx(e,zw))})),Uw=function(){return cg.Date.now()},Gw=/\s/;var Hw=function(e){for(var t=e.length;t--&&Gw.test(e.charAt(t)););return t},Ww=/^\s+/;var Kw=function(e){return e?e.slice(0,Hw(e)+1).replace(Ww,""):e},Xw=/^[-+]0x[0-9a-f]+$/i,Yw=/^0b[01]+$/i,Jw=/^0o[0-7]+$/i,Zw=parseInt;var Qw=function(e){if("number"==typeof e)return e;if(Yx(e))return NaN;if(Gg(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Gg(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Kw(e);var n=Yw.test(e);return n||Jw.test(e)?Zw(e.slice(2),n?2:8):Xw.test(e)?NaN:+e},e_=Math.max,t_=Math.min;var n_=function(e,t,n){var i,r,o,a,s,c,p=0,u=!1,l=!1,d=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function h(t){var n=i,o=r;return i=r=void 0,p=t,a=e.apply(o,n)}function m(e){return p=e,s=setTimeout(v,t),u?h(e):a}function f(e){var n=e-c;return void 0===c||n>=t||n<0||l&&e-p>=o}function v(){var e=Uw();if(f(e))return y(e);s=setTimeout(v,function(e){var n=t-(e-c);return l?t_(n,o-(e-p)):n}(e))}function y(e){return s=void 0,d&&i?h(e):(i=r=void 0,a)}function g(){var e=Uw(),n=f(e);if(i=arguments,r=this,c=e,n){if(void 0===s)return m(c);if(l)return clearTimeout(s),s=setTimeout(v,t),h(c)}return void 0===s&&(s=setTimeout(v,t)),a}return t=Qw(t)||0,Gg(n)&&(u=!!n.leading,o=(l="maxWait"in n)?e_(Qw(n.maxWait)||0,t):o,d="trailing"in n?!!n.trailing:d),g.cancel=function(){void 0!==s&&clearTimeout(s),p=0,i=c=r=s=void 0},g.flush=function(){return void 0===s?a:y(Uw())},g};var i_=function(e){return(null==e?0:e.length)?Nw(e,Infinity):[]};var r_=function(e,t,n){"__proto__"==t&&ww?ww(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n};var o_=function(e,t,n,i){for(var r=-1,o=null==e?0:e.length;++r<o;){var a=e[r];t(i,a,n(a),e)}return i};var a_=function(e,t,n,i){return Yg(e,(function(e,r,o){t(i,e,n(e),o)})),i};var s_=function(e,t){return function(n,i){var r=Sg(n)?o_:a_,o=t?t():{};return r(n,e,EE(i),o)}}((function(e,t,n){r_(e,n,t)}));var c_=function(e,t){var n=-1,i=Wg(e)?Array(e.length):[];return Yg(e,(function(e,r,o){i[++n]=t(e,r,o)})),i};var p_=function(e,t){return(Sg(e)?oE:c_)(e,EE(t))};var u_=function(e,t,n,i){var r=-1,o=null==e?0:e.length;for(i&&o&&(n=e[++r]);++r<o;)n=t(n,e[r],r,e);return n};var l_=function(e,t,n,i,r){return r(e,(function(e,r,o){n=i?(i=!1,e):t(n,e,r,o)})),n};var d_=function(e,t,n){var i=Sg(e)?u_:l_,r=arguments.length<3;return i(e,EE(t),n,r,Yg)};var h_=function(e,t,n){var i=e.start,r=i,o=n.length-t.length;n.length,t.length;var a=t.substring(i);return n.lastIndexOf(a)===n.length-a.length&&(t=t.substring(0,t.length-a.length),n=n.substring(0,n.length-a.length)),(o=function(e,t){var n,i,r,o=0,a=0;t.length>e.length?(i=t,r=e):(i=e,r=t);for(;o<i.length;)i.charAt(o)!==r.charAt(a)?(n||(n={l_start:o,s_start:a}),o++):(n&&!n.complete&&(n.l_end=o,n.s_end=a,n.complete=!0),a++,o++);n&&!n.complete&&(n.complete=!0,n.s_end=r.length,n.l_end=i.length);if(!n)return;return t.length>e.length?{newStart:n.l_start,newEnd:n.l_end,type:"add"}:{newStart:n.s_start,newEnd:n.s_end,type:t.length<e.length?"remove":"replace"}}(t,n))&&(r="remove"===o.type?o.newStart:o.newEnd),m_(r)};function m_(e,t){return{start:e,end:void 0===t?e:t}}var f_=m_;h_.range=f_;var v_={scrollSymbolLeft:"‹",scrollSymbolRight:"›"};function y_(e,t){U(this,function(e){return e=e||Object.create(null),{on:function(t,n){(e[t]||(e[t]=[])).push(n)},off:function(t,n){e[t]&&e[t].splice(e[t].indexOf(n)>>>0,1)},emit:function(t,n){(e[t]||[]).slice().map((function(e){e(n)})),(e["*"]||[]).slice().map((function(e){e(t,n)}))}}}()),this.options=t=U({},v_,t),this.container=e,this._createScrollButtons(e,t),this._bindEvents(e)}function g_(e,t){var n=b_(e);return n||(n=new y_(e,t),e.__scrollTabs=n),n}function b_(e){return e.__scrollTabs}y_.prototype._createButton=function(e,t){var n=t.className,i=t.direction,r=ve("."+n,e);return r||(r=he('<span class="scroll-tabs-button '+n+'">'+t.label+"</span>"),e.insertBefore(r,e.childNodes[0])),K(r,"data-direction",i),r},y_.prototype._createScrollButtons=function(e,t){this._createButton(e,{className:"scroll-tabs-left",label:t.scrollSymbolLeft,direction:-1}),this._createButton(e,{className:"scroll-tabs-right",label:t.scrollSymbolRight,direction:1})},y_.prototype.getActiveTabNode=function(){return ve(this.options.selectors.active,this.container)},y_.prototype.getTabsContainerNode=function(){return ve(this.options.selectors.tabsContainer,this.container)},y_.prototype.getAllTabNodes=function(){return ye(this.options.selectors.tab,this.container)},y_.prototype.getVisibleTabs=function(){var e=this.getAllTabNodes(),t=this.options.selectors.ignore;return w(e,(function(e){return!re(e,t)}))},y_.prototype.getAdjacentTab=function(e,t){var n=this.getVisibleTabs(),i=n.indexOf(e);return n[i+t]},y_.prototype._bindEvents=function(e){this._bindWheelEvent(e),this._bindTabClickEvents(e),this._bindScrollButtonEvents(e)},y_.prototype._bindTabClickEvents=function(e){var t=this.options.selectors.tab,n=this;de.bind(e,t,"click",(function(e){n.scrollToTabNode(e.delegateTarget)}))},y_.prototype._bindWheelEvent=function(e){var t=this;pe.bind(e,"wheel",(function(e){var n=Math.sign(e.deltaY),i=t.getActiveTabNode(),r=t.getAdjacentTab(i,n);r&&(t.scrollToTabNode(r),t.emit("scroll",r,i,n)),e.preventDefault()}))},y_.prototype._bindScrollButtonEvents=function(e){var t=this;de.bind(e,".scroll-tabs-button","click",(function(e){var n=e.delegateTarget,i=parseInt(K(n,"data-direction"),10),r=t.getActiveTabNode(),o=t.getAdjacentTab(r,i);o&&(t.scrollToTabNode(o),t.emit("scroll",o,r,i)),e.preventDefault()}))},y_.prototype.scrollToTabNode=function(e){if(e){var t=e.parentNode,n=e.offsetWidth,i=e.offsetLeft,r=i+n,o=t.offsetWidth;t.scrollLeft>i?t.scrollLeft=0:r>o&&(t.scrollLeft=r-o)}},y_.prototype.update=function(){var e=this.getTabsContainerNode(),t=e.scrollWidth>e.offsetWidth;Q(this.container).toggle("scroll-tabs-overflow",t),t&&this.scrollToTabNode(this.getActiveTabNode())},g_.get=b_;var x_=t(Object.freeze({__proto__:null,default:g_})),E_=hw.createDropdown,w_=hw.escapeHTML,__=GE.domify,P_=GE.query,S_=GE.queryAll,O_=GE.remove,C_=GE.classes,T_=GE.closest,A_=GE.attr,R_=GE.delegate,k_=GE.matches,j_=x_.default,M_=PE.getBusinessObject,D_="bpp-hidden";function B_(e){return"checkbox"===e.type||"radio"===e.type}function I_(e){return A_(e,"contenteditable")}function N_(e,t){var n=S_("input[name], textarea[name], select[name], [contenteditable]",e);return n&&n.length||(n=k_(e,"option")?[e]:n),t||(n=fw(n,(function(e){return!T_(e,".bpp-hidden")}))),n}function L_(e){var t={},n=N_(e);return Qg(n,(function(e){var n=e.value,i=A_(e,"name")||A_(e,"data-name");B_(e)?n=e.checked?!A_(e,"value")||e.value:null:I_(e)&&(n=e.innerText),null!==n&&(t[i]=n)})),t}function F_(e){var t,n=P_("[data-list-entry-container]",e);if(n){t=[];var i=n.children||[];Qg(i,(function(e){t.push(L_(e))}))}else t=L_(e);return t}function V_(e,t){return!(e&&!t)&&Kg(e).concat(Kg(t)).every((function(n){return e[n]===t[n]}))}function $_(e){return s_(i_(p_(i_(p_(e,"groups")),"entries")),"id")}function z_(e,t,n,i,r,o){this._eventBus=n,this._modeling=i,this._commandStack=r,this._canvas=o;var a=t.get("propertiesProvider",!1);a&&this.registerProvider(a),this._init(e)}z_.$inject=["config.propertiesPanel","injector","eventBus","modeling","commandStack","canvas"];var q_=z_;function U_(e){return e&&(e.isImplicit||"__implicitroot"===e.id)}z_.prototype.registerProvider=function(e,t){t||(t=e,e=1e3),"function"==typeof t.getTabs?(this._eventBus.on("propertiesPanel.getProviders",e,(function(e){e.providers.push(t)})),this._eventBus.fire("propertiesPanel.providersChanged")):console.error("Properties provider does not impement #getTabs(element) API")},z_.prototype._init=function(e){var t=this._canvas,n=this._eventBus,i=this;n.on("root.added",(function(e){var t=e.element;U_(t)||i.update(t)})),n.on("selection.changed",(function(e){var n=e.newSelection[0];U_(t.getRootElement())||i.update(n)})),n.on(["propertiesPanel.changed","propertiesPanel.resized"],(function(e){var t=P_(".bpp-properties-tab-bar",i._container);if(t){var n=j_.get(t);n||(n=j_(t,{selectors:{tabsContainer:".bpp-properties-tabs-links",tab:".bpp-properties-tabs-links li",ignore:".bpp-hidden",active:".bpp-active"}})).on("scroll",(function(e,t,n){var r=P_("[data-tab-target]",e),o=A_(r,"data-tab-target");i.activateTab(o)})),n.update()}})),n.on("elements.changed",(function(e){var t=i._current,n=t&&t.element;n&&-1!==e.elements.indexOf(n)&&i.update(n)})),n.on(["elementTemplates.changed","propertiesPanel.providersChanged"],(function(){var e=i._current,t=e&&e.element;t&&i.update(t)})),n.on("diagram.destroy",(function(){i.detach()})),this._container=__('<div class="bpp-properties-panel" input-handle-modified-keys="z,y"></div>'),this._bindListeners(this._container),e&&e.parent&&this.attachTo(e.parent)},z_.prototype.attachTo=function(e){if(!e)throw new Error("parentNode required");this.detach(),e.get&&e.constructor.prototype.jquery&&(e=e.get(0)),"string"==typeof e&&(e=P_(e));var t=this._container;e.appendChild(t),this._emit("attach")},z_.prototype.detach=function(){var e=this._container,t=e.parentNode;t&&(this._emit("detach"),t.removeChild(e))},z_.prototype.activateTab=function(e){Gg(e)&&(e=e.id);var t=S_(".bpp-properties-tab",this._current.panel),n=S_(".bpp-properties-tab-link",this._current.panel);Qg(t,(function(e){C_(e).remove("bpp-active")})),Qg(n,(function(e){C_(e).remove("bpp-active")}));var i=fw(t,(function(e){return!C_(e).has(D_)})),r=d_(i,(function(t,n){return A_(n,"data-tab")===e?n:t}),i[0]);r&&C_(r).add("bpp-active");var o=fw(n,(function(e){return!C_(e).has(D_)})),a=d_(o,(function(t,n){return A_(P_("a[data-tab-target]",n),"data-tab-target")===e?n:t}),o[0]);a&&C_(a).add("bpp-active")},z_.prototype._getProviders=function(){var e=this._eventBus.createEvent({type:"propertiesPanel.getProviders",providers:[]});return this._eventBus.fire(e),e.providers},z_.prototype._getTabs=function(e){var t=this._getProviders();return d_(t,(function(t,n){var i=n.getTabs(e);return Hg(i)?i(t):i}),[])},z_.prototype.update=function(e){e||(e=this._canvas.getRootElement());var t,n,i=this._getTabs(e);this._current&&(n=P_(".bpp-properties-tab.bpp-active",this._current.panel))&&(t=A_(n,"data-tab")),this._current&&this._current.element===e&&!this._entriesChanged(this._current.entries,$_(i))||(this._current&&O_(this._current.panel),this._current=this._create(e,i)),this._updateActivation(this._current),t?this.activateTab(t):this.activateTab(this._current.tabs[0]),this._emit("changed")},z_.prototype._entriesChanged=function(e,t){var n=Kg(e),i=Kg(t);return!yw(qw(n,i))},z_.prototype._emit=function(e){this._eventBus.fire("propertiesPanel."+e,{panel:this,current:this._current})},z_.prototype._bindListeners=function(e){var t=this,n=function(e){var n,i,r=e.delegateTarget,o=T_(r,"[data-entry]");if(o){n=A_(o,"data-entry"),i=t.getEntry(n);var a=F_(o);if("change"===e.type){var s=A_(r,"data-on-change");if(s)if(!t.executeAction(i,o,s,e))return t.update(t._current.element)}t.applyChanges(i,a,o),t.updateState(i,o)}};R_.bind(e,"input, textarea, [contenteditable]","input",n_(n,300)),R_.bind(e,"input, textarea, select, [contenteditable]","change",n),R_.bind(e,"[contenteditable]","paste",(function(e){var t=(e.clipboardData||window.clipboardData).getData("text");n=t,t=n.replace(/\r\n|\r|\n/g,"\n"),document.execCommand("insertText",!1,t),e.preventDefault();var n})),R_.bind(e,"select","keydown",(function(e){46===e.keyCode&&(e.stopPropagation(),e.preventDefault())})),R_.bind(e,"[data-auto-suggest]","input",(function(e){var n=e.delegateTarget,i=T_(n,"[data-entry]");if(i){var r=A_(n,"data-auto-suggest"),o=A_(i,"data-entry"),a=t.getEntry(o);t.executeAction(a,i,r,e)}}),!0),R_.bind(e,"[data-action]","click",(function(e){var n=e.delegateTarget,i=T_(n,"[data-entry]"),r=A_(n,"data-action"),o=A_(i,"data-entry"),a=t.getEntry(o);if(!t.executeAction(a,i,r,e))return t.update(t._current.element);var s=F_(i);t.applyChanges(a,s,i),t.updateState(a,i)})),R_.bind(e,"[data-blur]","blur",(function(e,n){var i=e.delegateTarget,r=T_(i,"[data-entry]");if(r){var o=A_(i,"data-blur"),a=A_(r,"data-entry"),s=t.getEntry(a);if(t.executeAction(s,r,o,e)){var c=F_(r);t.applyChanges(s,c,r)}t.updateState(s,r)}}),!0),R_.bind(e,".bpp-properties-tabs-links [data-tab-target]","click",(function(e){e.preventDefault();var n=e.delegateTarget,i=A_(n,"data-tab-target");t.activateTab(i)}))},z_.prototype.updateState=function(e,t){this.updateShow(e,t),this.updateDisable(e,t)},z_.prototype.updateShow=function(e,t){var n=this._current;if(n){var i=S_("[data-show]",t)||[];Qg(i,(function(i){var r=A_(i,"data-show"),o=hE(e,r);if(o){var a=T_(i,"[data-scope]")||t;o(n.element,t,i,a)||!1?C_(i).remove(D_):C_(i).add(D_)}}))}},z_.prototype.updateDisable=function(e,t){var n=this._current;if(n){var i=S_("[data-disable]",t)||[];Qg(i,(function(i){var r=A_(i,"data-disable"),o=hE(e,r);if(o){var a=T_(i,"[data-scope]")||t,s=o(n.element,t,i,a)||!1;A_(i,"disabled",s?"":null)}}))}},z_.prototype.executeAction=function(e,t,n,i){var r=this._current;if(r){var o=hE(e,n);if(o){var a=T_(i.target,"[data-scope]")||t;return o.apply(e,[r.element,t,i,a])}}},z_.prototype.applyChanges=function(e,t,n){var i=this._current.element;if(!function(e,t){return Sg(e)?e.length===t.length&&e.every((function(e,n){return V_(e,t[n])})):V_(e,t)}(t,e.oldValues)){var r,o=e.set(i,t,n);Sg(o)?o.length&&(r={cmd:"properties-panel.multi-command-executor",context:i_(o)}):r=o,r?this._commandStack.execute(r.cmd,r.context||{element:i}):this.update(i)}},z_.prototype.applyValidationErrors=function(e,t){var n=!0,i=N_(t,!0);return Qg(i,(function(t){var i=A_(t,"name")||A_(t,"data-name"),r=e&&e[i],o=P_(".bpp-error-message",t.parentNode);r?(n=!1,o||(o=__("<div></div>"),C_(o).add("bpp-error-message"),t.parentNode.insertBefore(o,t.nextSibling)),o.textContent=r,C_(t).add("invalid")):(C_(t).remove("invalid"),o&&t.parentNode.removeChild(o))})),n},z_.prototype.validate=function(e,t,n){var i=this._current,r=!0;if(n=n||P_('[data-entry="'+e.id+'"]',i.panel),t instanceof Array)for(var o=P_("[data-list-entry-container]",n).children||[],a=0;a<t.length;a++){var s=t[a];if(e.validateListItem){var c=e.validateListItem(i.element,s,n,a),p=o[a];r=this.applyValidationErrors(c,p)&&r}}else e.validate&&(this.validationErrors=e.validate(i.element,t,n),r=this.applyValidationErrors(this.validationErrors,n)&&r);return r},z_.prototype.getEntry=function(e){return this._current&&this._current.entries[e]},z_.prototype._create=function(e,t){if(!e)return null;var n=this._container,i=this._createPanel(e,t);n.appendChild(i);var r=$_(t);return{tabs:t,groups:function(e){return s_(i_(p_(e,"groups")),"id")}(t),entries:r,element:e,panel:i}},z_.prototype._bindTemplate=function(e,t,n,i,r){var o=this._eventBus;var a=function(e){var t="input[name], textarea[name], [data-value], [contenteditable]",n=S_(t,e);return n&&n.length||!k_(e,t)||(n=[e]),n}(i);Qg(a,(function(a){var s,c,p;"value"in a||"true"===I_(a)?(s=A_(a,"name")||A_(a,"data-name"),c=n[s],(p=function(t,n){return o.fire("propertiesPanel.isPropertyEditable",{entry:t,propertyName:n,element:e})}(t,s))&&t.editable&&(p=t.editable(e,i,a,s,c,r)),A_(a,"readonly",p?null:""),A_(a,"disabled",p?null:""),t.setControlValue?t.setControlValue(e,i,a,s,c,r):B_(a)?function(e,t){var n=e.value;e.checked=t===n||!A_(e,"value")&&t}(a,c):function(e){return"select-one"===e.type}(a)?function(e,t){void 0!==t&&(e.value=t)}(a,c):function(e,t){var n,i=I_(e),r=i?e.innerText:e.value;void 0===t&&(t="");if(r===t)return;document.activeElement===e&&(n=h_(function(e){return I_(e)?function(e){var t=window.getSelection(),n=t.focusNode,i=t.focusOffset,r=t.anchorOffset;if(!n)throw new Error("not selected");if(!e.contains(n))throw new Error("not selected");return{start:Math.min(i,r),end:Math.max(i,r)}}(e):{start:e.selectionStart,end:e.selectionEnd}}(e),r,t));i?e.innerText=t:e.value=t;n&&function(e,t){I_(e)?function(e,t){var n,i,r;n=e.firstChild||e,(i=document.createRange()).setStart(n,t.start),i.setEnd(n,t.end),(r=window.getSelection()).removeAllRanges(),r.addRange(i)}(e,t):(e.selectionStart=t.start,e.selectionEnd=t.end)}(e,n)}(a,c)):(s=A_(a,"data-value"),c=n[s],t.setControlValue?t.setControlValue(e,i,a,s,c,r):function(e,t){e.textContent=t}(a,c))}))},z_.prototype._updateActivation=function(e){var t=this,n=this._eventBus,i=e.element;function r(e,t){C_(e).toggle(D_,!t)}function o(e,t,n){var i=P_(t,e);i&&(i.textContent=n)}var a=e.panel;Qg(e.tabs,(function(e){var s=P_("[data-tab="+e.id+"]",a),c=P_("[data-tab-target="+e.id+"]",a).parentNode,p=!1;Qg(e.groups,(function(a){var c=!1,u=P_("[data-group="+a.id+"]",s);Qg(a.entries,(function(o){var s=P_('[data-entry="'+o.id+'"]',u),p=function(e,t,r){return n.fire("propertiesPanel.isEntryVisible",{element:i,entry:e,group:t,tab:r})}(o,a,e);c=c||p,r(s,p);var l="get"in o?o.get(i,s):{};if(l instanceof Array){for(var d=P_("[data-list-entry-container]",s),h=d.children||[],m=0;m<l.length;m++){var f=l[m],v=h[m];v||(v=__(o.createListEntryTemplate(f,m,d)),d.appendChild(v)),A_(v,"data-index",m),t._bindTemplate(i,o,f,v,m)}for(var y=h.length-l.length,g=0;g<y;g++)d.removeChild(d.lastChild)}else t._bindTemplate(i,o,l,s);t.updateState(o,s),t.validate(o,l,s),o.oldValues=F_(s)})),"function"==typeof a.label&&o(u,".group-label",a.label(i,u)),c=c&&function(e,t,n){return!Hg(e.enabled)||e.enabled(t,n)}(a,i,u),p=p||c,r(u,c)})),p=p&&function(e,t){return!Hg(e.enabled)||e.enabled(t)}(e,i),r(s,p),r(c,p)})),o(a,"[data-label-id]",M_(i).id||"")},z_.prototype._createPanel=function(e,t){var n=this,i=__('<div class="bpp-properties"></div>'),r=__('<div class="bpp-properties-header"><div class="label" data-label-id></div></div>'),o=__('<div class="bpp-properties-tab-bar"></div>'),a=__('<ul class="bpp-properties-tabs-links"></ul>'),s=__('<div class="bpp-properties-tabs-container"></div>');return i.appendChild(r),Qg(t,(function(e,t){if(!e.id)throw new Error("tab must have an id");var i=__('<div class="bpp-properties-tab" data-tab="'+w_(e.id)+'"></div>'),r=__('<li class="bpp-properties-tab-link"><a href data-tab-target="'+w_(e.id)+'">'+w_(e.label)+"</a></li>"),o=e.groups;Qg(o,(function(e){if(!e.id)throw new Error("group must have an id");var t=__('<div class="bpp-properties-group" data-group="'+w_(e.id)+'"><span class="group-toggle"></span><div class="group-header"><span class="group-label">'+w_(e.label)+"</span></div></div>");e.dropdown&&P_(".group-header",t).appendChild(E_(e.dropdown)),t.querySelector(".group-toggle").addEventListener("click",(function(e){C_(t).toggle("group-closed"),e.preventDefault(),e.stopPropagation()})),t.addEventListener("click",(function(e){!e.defaultPrevented&&C_(t).has("group-closed")&&C_(t).remove("group-closed")})),Qg(e.entries,(function(e){if(!e.id)throw new Error("entry must have an id");var i=e.html;"string"==typeof i&&(i=__(i)),i.get&&i.constructor.prototype.jquery&&(i=i.get(0));var r=__('<div class="bpp-properties-entry" data-entry="'+w_(e.id)+'"></div>');Qg(e.cssClasses||[],(function(e){C_(r).add(e)})),r.appendChild(i),t.appendChild(r),n.updateState(e,r)})),i.appendChild(t)})),a.appendChild(r),s.appendChild(i)})),o.appendChild(a),i.appendChild(o),i.appendChild(s),i};var G_=t(mo),H_={__depends__:[UE,G_.default],__init__:["propertiesPanel"],propertiesPanel:["type",q_]};function W_(e,t){var n=this;t=t||1e3,e.on("propertiesPanel.isEntryVisible",t,(function(e){var t=e.element,i=e.entry,r=e.group,o=e.tab;return n.isEntryVisible(t,i,r,o)})),e.on("propertiesPanel.isPropertyEditable",t,(function(e){var t=e.element,i=e.entry,r=e.group,o=e.propertyName,a=e.tab;return n.isPropertyEditable(o,t,i,r,a)}))}W_.$inject=["eventBus"];var K_=W_;W_.prototype.isEntryVisible=function(e,t,n,i){return!0},W_.prototype.isPropertyEditable=function(e,t,n,i,r){return!0};var X_=GE.domify,Y_=GE.classes,J_=GE.event,Z_=hw.escapeHTML,Q_=function(e,t,n){for(var i,r,o,a=n&&n.show,s=[],c=/(?:\[([^\]]+)\]\((https?:\/\/[^)]+)\))|(?:<a href="(https?:\/\/[^"]+)">(.+?(?=<\/))<\/a>)/gi,p=0;i=c.exec(t);)i.index>p&&s.push(eP(t.substring(p,i.index))),r=i[2]&&encodeURI(i[2])||i[3],o=i[1]||i[4],s.push('<a href="'+r+'" target="_blank">'+eP(o)+"</a>"),p=i.index+i[0].length;p<t.length&&s.push(eP(t.substring(p))),t=s.join("");var u=X_('<div class="bpp-field-description description description--expanded"'+(a?'data-show="'+a+'">':">")+"</div>"),l=X_('<span class="description__text">'+t+"</span>");function d(n){n?(Y_(u).add("description--expanded"),l.textContent=t+" ",m.textContent=e("Less")):(Y_(u).remove("description--expanded"),l.textContent=h+" ... ",m.textContent=e("More"))}u.appendChild(l);var h,m,f=!1;return t.length>200&&(h=t.slice(0,200),m=X_('<span class="bpp-entry-link description__expand">'+e("More")+"</span>"),J_.bind(m,"click",(function(){d(f=!f)})),u.appendChild(m),d(f)),u};function eP(e){for(var t,n=0,i=[],r=/<br\s*\/?>/gi;t=r.exec(e);)t.index>n&&i.push(Z_(e.substring(n,t.index))),i.push("<br />"),n=t.index+t[0].length;return n<e.length&&i.push(Z_(e.substring(n))),i.join("")}var tP=hw.escapeHTML,nP=GE.domify,iP=GE.query,rP=function(e,t,n){var i=n,r=t.label||i.id,o=t.dataValueLabel,a=t.buttonLabel||"X",s=void 0!==t.buttonAction?t.buttonAction.name:"clear",c=void 0!==t.buttonAction?t.buttonAction.method:function(e,n){return iP('input[name="'+t.modelProperty+'"]',n).value="",!0},p=void 0!==t.buttonShow?t.buttonShow.name:"canClear",u=void 0!==t.buttonShow?t.buttonShow.method:function(e,n){return""!==iP('input[name="'+t.modelProperty+'"]',n).value},l=!!t.disabled&&"function"==typeof t.disabled,d=!!t.hidden&&"function"==typeof t.hidden,h=t.description;return i.html=nP('<label for="camunda-'+tP(i.id)+'" '+(l?'data-disable="isDisabled" ':"")+(d?'data-show="isHidden" ':"")+(o?'data-value="'+tP(o)+'"':"")+">"+tP(r)+'</label><div class="bpp-field-wrapper" '+(l?'data-disable="isDisabled"':"")+(d?'data-show="isHidden"':"")+'><input id="camunda-'+tP(i.id)+'" type="text" name="'+tP(t.modelProperty)+'" '+(l?'data-disable="isDisabled"':"")+(d?'data-show="isHidden"':"")+' /><button class="action-button '+tP(s)+'" data-action="'+tP(s)+'" data-show="'+tP(p)+'" '+(l?'data-disable="isDisabled"':"")+(d?' data-show="isHidden"':"")+"><span>"+tP(a)+"</span></button></div>"),h&&i.html.appendChild(Q_(e,h,{show:d&&"isHidden"})),i[s]=c,i[p]=u,l&&(i.isDisabled=function(){return t.disabled.apply(i,arguments)}),d&&(i.isHidden=function(){return!t.hidden.apply(i,arguments)}),i.cssClasses=["bpp-textfield"],i},oP={},aP=oP;oP.updateProperties=function(e,t){return{cmd:"element.updateProperties",context:{element:e,properties:t}}},oP.updateBusinessObject=function(e,t,n){return{cmd:"properties-panel.update-businessobject",context:{element:e,businessObject:t,properties:n}}},oP.addElementsTolist=function(e,t,n,i,r){return{cmd:"properties-panel.update-businessobject-list",context:{element:e,currentObject:t,propertyName:n,objectsToPrepend:r,objectsToAdd:i}}},oP.removeElementsFromList=function(e,t,n,i,r){return{cmd:"properties-panel.update-businessobject-list",context:{element:e,currentObject:t,propertyName:n,referencePropertyName:i,objectsToRemove:r}}},oP.addAndRemoveElementsFromList=function(e,t,n,i,r,o){return{cmd:"properties-panel.update-businessobject-list",context:{element:e,currentObject:t,propertyName:n,referencePropertyName:i,objectsToAdd:r,objectsToRemove:o}}},oP.setList=function(e,t,n,i){return{cmd:"properties-panel.update-businessobject-list",context:{element:e,currentObject:t,propertyName:n,updatedObjectList:i}}};var sP=GE.domify,cP=PE.getBusinessObject,pP=hw.escapeHTML,uP=function(e,t,n){var i=n,r=i.id,o=t.label||r,a=!!t.disabled&&"function"==typeof t.disabled,s=!!t.hidden&&"function"==typeof t.hidden,c=t.description;return i.html=sP('<input id="camunda-'+pP(r)+'" type="checkbox" name="'+pP(t.modelProperty)+'" '+(a?'data-disable="isDisabled"':"")+(s?'data-show="isHidden"':"")+' /><label for="camunda-'+pP(r)+'" '+(a?'data-disable="isDisabled"':"")+(s?'data-show="isHidden"':"")+">"+pP(o)+"</label>"),c&&i.html.appendChild(Q_(e,c,{show:s&&"isHidden"})),i.get=function(e){var n=cP(e),i={};return i[t.modelProperty]=n.get(t.modelProperty),i},i.set=function(e,n){var i={};return i[t.modelProperty]=!!n[t.modelProperty],aP.updateProperties(e,i)},"function"==typeof t.set&&(i.set=t.set),"function"==typeof t.get&&(i.get=t.get),a&&(i.isDisabled=function(){return t.disabled.apply(i,arguments)}),s&&(i.isHidden=function(){return!t.hidden.apply(i,arguments)}),i.cssClasses=["bpp-checkbox"],i},lP=hw.escapeHTML,dP=GE.domify,hP=GE.query,mP=function(e,t,n){var i=n,r=t.label||i.id,o=t.selectOptions||[{name:"",value:""}],a=t.modelProperty,s=t.emptyParameter,c=!!t.disabled&&"function"==typeof t.disabled,p=!!t.hidden&&"function"==typeof t.hidden,u=t.description;s&&(o=o.concat([{name:"",value:""}])),i.html=dP('<label for="camunda-'+lP(i.id)+'"'+(c?'data-disable="isDisabled" ':"")+(p?'data-show="isHidden" ':"")+">"+lP(r)+'</label><select id="camunda-'+lP(i.id)+'-select" name="'+lP(a)+'"'+(c?'data-disable="isDisabled" ':"")+(p?'data-show="isHidden" ':"")+" data-value></select>");var l=hP("select",i.html);return function(e){return!(!e||"[object Array]"!==Object.prototype.toString.call(e))}(o)&&Qg(o,(function(e){l.appendChild(dP('<option value="'+lP(e.value)+(e.title?'" title="'+lP(e.title):"")+'">'+(e.name?lP(e.name):"")+"</option>"))})),u&&"function"!=typeof t.showCustomInput&&i.html.appendChild(Q_(e,u,{show:p&&"isHidden"})),i.setControlValue=function(e,t,n,i,r){if("function"==typeof o){var a=o(e,n);if(a){for(;n.firstChild;)n.removeChild(n.firstChild);Qg(a,(function(e){var t=dP(function(e){return'<option value="'+e.value+'">'+e.name+"</option>"}(e));n.appendChild(t)}))}}void 0!==r&&(n.value=r)},c&&(i.isDisabled=function(){return t.disabled.apply(i,arguments)}),p&&(i.isHidden=function(){return!t.hidden.apply(i,arguments)}),i.cssClasses=["bpp-dropdown"],i},fP=Object.prototype.hasOwnProperty;var vP=function(e,t,n){var i=e[t];fP.call(e,t)&&ib(i,n)&&(void 0!==n||t in e)||r_(e,t,n)};var yP=function(e,t,n,i){var r=!n;n||(n={});for(var o=-1,a=t.length;++o<a;){var s=t[o],c=i?i(n[s],e[s],s,n,e):void 0;void 0===c&&(c=e[s]),r?r_(n,s,c):vP(n,s,c)}return n};var gP=function(e,t,n){if(!Gg(n))return!1;var i=typeof t;return!!("number"==i?Wg(n)&&Ag(t,n.length):"string"==i&&t in n)&&ib(n[t],e)};var bP=function(e){return Cw((function(t,n){var i=-1,r=n.length,o=r>1?n[r-1]:void 0,a=r>2?n[2]:void 0;for(o=e.length>3&&"function"==typeof o?(r--,o):void 0,a&&gP(n[0],n[1],a)&&(o=r<3?void 0:o,r=1),t=Object(t);++i<r;){var s=n[i];s&&e(t,s,i,o)}return t}))},xP=Object.prototype.hasOwnProperty,EP=bP((function(e,t){if(Vg(t)||Wg(t))yP(t,Kg(t),e);else for(var n in t)xP.call(t,n)&&vP(e,n,t[n])}));var wP=function(e){return function(t,n,i){var r=Object(t);if(!Wg(t)){var o=EE(n);t=Kg(t),n=function(e){return o(r[e],e,r)}}var a=e(t,n,i);return a>-1?r[o?t[a]:a]:void 0}},_P=1/0;var PP=function(e){return e?(e=Qw(e))===_P||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0};var SP=function(e){var t=PP(e),n=t%1;return t==t?n?t-n:t:0},OP=Math.max;var CP=wP((function(e,t,n){var i=null==e?0:e.length;if(!i)return-1;var r=null==n?0:SP(n);return r<0&&(r=OP(i+r,0)),Tw(e,EE(t),r)})),TP=GE.domify,AP=GE.query,RP=hw.escapeHTML,kP=function(e,t){var n=t.selectOptions,i=t.modelProperty,r=t.customValue||"custom",o=t.customName||"custom "+i,a=t.description,s=EP({},t);s.showCustomInput=function(e,n){var i=AP('[data-entry="'+t.id+'"] select',n.parentNode);return!!i&&i.value===r},s.get=function(e,o){var a=t.get(e,o),s={};return function(e){return void 0!==e[i]&&!CP(n,(function(t){return e[i]===t.value}))}(a)?(s[i]=r,s["custom-"+i]=a[i],s):(s[i]=a[i]||"",s)},s.set=function(e,n,o){var a={};return n[i]===r?a[i]=n["custom-"+i]||"":t.emptyParameter&&""===n[i]?a[i]=void 0:a[i]=n[i],t.set(e,a,o)},s.selectOptions.push({name:o,value:r});var c=EP({},mP(e,s,s)),p=document.createDocumentFragment();return p.appendChild(c.html),c.html=p,c.html.appendChild(TP('<div class="bpp-field-wrapper bpp-combo-input" data-show="showCustomInput"><input id="camunda-'+RP(t.id)+'-input" type="text" name="custom-'+RP(i)+'" /></div>')),a&&c.html.appendChild(Q_(e,a,{show:"showCustomInput"})),c},jP=GE.domify,MP=hw.escapeHTML,DP=function(e,t,n){var i=n,r=t.label||i.id,o=!!t.show&&"function"==typeof t.show,a=t.description;return i.html=jP('<label for="camunda-'+MP(i.id)+'" '+(o?'data-show="isShown"':"")+">"+r+'</label><div class="bpp-field-wrapper" '+(o?'data-show="isShown"':"")+'><div contenteditable="true" id="camunda-'+MP(i.id)+'" name="'+MP(t.modelProperty)+'" /></div>'),a&&i.html.appendChild(Q_(e,a,{show:o&&"isShown"})),o&&(i.isShown=function(){return t.show.apply(i,arguments)}),i.cssClasses=["bpp-textbox"],i},BP=function(e,t,n){var i=t.modelProperty;n.get=function(e,n){var r=this.__lastInvalidValue;delete this.__lastInvalidValue;var o={};return o[i]=void 0!==r?r:t.getProperty(e,n),o},n.set=function(e,n,o){var a=r.apply(this,[e,n,o]),s=n[i];if(a&&a[i])return this.__lastInvalidValue=s,t.setProperty(e,{},o);var c={};return c[i]=s,t.setProperty(e,c,o)};var r=n.validate=function(e,n,r){var o=n[i]||this.__lastInvalidValue,a={};return a[i]=o,t.validate(e,a,r)};return rP(e,t,n)},IP=hw.escapeHTML,NP=GE.query,LP=GE.attr,FP=GE.closest,VP=GE.domify,$P='<div class="bpp-field-wrapper bpp-table-row">';function zP(e,t){var n=$P;return n+=function(e,t){var n=e.length,i="";return Qg(e,(function(e,r){i+='<input class="bpp-table-row-columns-'+n+" "+(t?"bpp-table-row-removable":"")+'" id="camunda-table-row-cell-input-value-'+r+'"type="text" name="'+IP(e)+'" />'})),i}(e,t),n+=t?'<button class="action-button clear" data-action="deleteElement"><span>X</span></button>':"",n+="</div>"}function qP(e){var t=$P;return t+=function(e){var t=e.length,n="";return Qg(e,(function(e){n+='<label class="bpp-table-row-columns-'+t+'">'+IP(e)+"</label>"})),n}(e),t+="</div>"}function UP(e,t,n,i,r){return fw(n,(function(n,o){return!function(e,t,n,i,r,o){if(n&&!i)return!1;return Kg(n).concat(Kg(i)).every((function(a){var s=n[a]||void 0,c=i[a]||void 0;return!r(e,t,a,o)||s===c}))}(e,t,n,i[o],r,o)}))}function GP(e){return FP(e,"[data-entry]",!0)}function HP(e){return NP("div[data-list-entry-container]",e)}var WP=function(e,t){var n=t.id,i=t.modelProperties,r=t.labels,o=t.description,a=qP(r),s=t.getElements,c=t.removeElement,p="function"==typeof c,u=t.addElement,l="function"==typeof u,d=t.addLabel||"Add Value",h=t.updateElement,m="function"==typeof h,f=t.editable||function(){return!0},v=t.setControlValue,y=t.show,g="function"==typeof y,b=function(e,t){return function(e,t){return(e||[]).map((function(e){var n={};return Qg(t,(function(t){n[t]=e[t]||""})),n}))}(s(e,t),i)},x=VP((l?'<div class="bpp-table-add-row" '+(g?'data-show="show"':"")+"><label>"+IP(d)+'</label><button class="action-button add" data-action="addElement"><span>+</span></button></div>':"")+'<div class="bpp-table" data-show="showTable"><div class="bpp-field-wrapper bpp-table-row">'+a+"</div><div data-list-entry-container></div></div>");o&&x.appendChild(Q_(e,o,{show:"showTable"}));var E={id:n,html:x,get:function(e,t){var n=b(e,t,this.__invalidValues),r=this.__invalidValues;return delete this.__invalidValues,Qg(r,(function(e,t){var r=n[t];Qg(i,(function(t){r[t]=e[t]}))})),n},set:function(e,n,i){var r=this.__action||{};if(delete this.__action,"delete-element"===r.id)return c(e,i,r.idx);if("add-element"===r.id)return u(e,i);if(m){var o=[],a=n;"function"!=typeof t.validate&&(a=UP(e,i,n,b(e,i),f));var s=this;return Qg(a,(function(r){var a,c=n.indexOf(r);if("function"==typeof t.validate&&(a=t.validate(e,r,i,c)),a)s.__invalidValues=s.__invalidValues||{},s.__invalidValues[c]=r,o.push(aP.updateProperties(e,{}));else{var p=h(e,r,i,c);p&&o.push(p)}})),o}},createListEntryTemplate:function(e,t,n){return zP(i,p)},addElement:function(e,t,n,r){var o=VP(zP(i,p));return HP(t).appendChild(o),this.__action={id:"add-element"},!0},deleteElement:function(e,t,n,i){var r=HP(t),o=n.delegateTarget.parentNode,a=parseInt(LP(o,"data-index"),10);return r.removeChild(o),this.__action={id:"delete-element",idx:a},!0},editable:function(e,t,n,i,r,o){var a=FP(t,"[data-entry]");return f(e,a,i,o)},show:function(e,t,n,i){return t=GP(t),y(e,t,n,i)},showTable:function(e,t,n,i){t=GP(t);var r=b(e,t);return r&&r.length&&(!g||y(e,t,n,i))},validateListItem:function(e,n,i,r){if("function"==typeof t.validate)return t.validate(e,n,i,r)}};return v&&(E.setControlValue=function(e,t,n,i,r,o){var a,s=GP(t),c=LP(n,"readonly"),p=n.value;void 0===r&&(r=""),c&&p===r||(document.activeElement===n&&(a=h_(function(e){return{start:e.selectionStart,end:e.selectionEnd}}(n),p,r)),v(e,s,n,i,r,o),a&&function(e,t){e.selectionStart=t.start,e.selectionEnd=t.end}(n,a))}),E},KP=function(e){return{id:e.id,html:'<label data-value="label" data-show="showLabel" class="entry-label'+(e.divider?" divider":"")+'"></label>',get:function(t,n){return"function"==typeof e.get?e.get(t,n):{label:e.labelText}},showLabel:function(t,n){return"function"!=typeof e.showLabel||e.showLabel(t,n)}}},XP=Ox&&new Ox,YP=XP?function(e,t){return XP.set(e,t),e}:Jg;var JP=function(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=tb(e.prototype),i=e.apply(n,t);return Gg(i)?i:n}};var ZP=function(e,t,n){var i=1&t,r=JP(e);return function t(){var o=this&&this!==cg&&this instanceof t?r:e;return o.apply(i?n:this,arguments)}},QP=Math.max;var eS=function(e,t,n,i){for(var r=-1,o=e.length,a=n.length,s=-1,c=t.length,p=QP(o-a,0),u=Array(c+p),l=!i;++s<c;)u[s]=t[s];for(;++r<a;)(l||r<o)&&(u[n[r]]=e[r]);for(;p--;)u[s++]=e[r++];return u},tS=Math.max;var nS=function(e,t,n,i){for(var r=-1,o=e.length,a=-1,s=n.length,c=-1,p=t.length,u=tS(o-s,0),l=Array(u+p),d=!i;++r<u;)l[r]=e[r];for(var h=r;++c<p;)l[h+c]=t[c];for(;++a<s;)(d||r<o)&&(l[h+n[a]]=e[r++]);return l};var iS=function(e,t){for(var n=e.length,i=0;n--;)e[n]===t&&++i;return i};var rS=function(){};function oS(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}oS.prototype=tb(rS.prototype),oS.prototype.constructor=oS;var aS=oS,sS=XP?function(e){return XP.get(e)}:Lw,cS={},pS=Object.prototype.hasOwnProperty;var uS=function(e){for(var t=e.name+"",n=cS[t],i=pS.call(cS,t)?n.length:0;i--;){var r=n[i],o=r.func;if(null==o||o==e)return r.name}return t};function lS(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}lS.prototype=tb(rS.prototype),lS.prototype.constructor=lS;var dS=lS;var hS=function(e,t){var n=-1,i=e.length;for(t||(t=Array(i));++n<i;)t[n]=e[n];return t};var mS=function(e){if(e instanceof aS)return e.clone();var t=new dS(e.__wrapped__,e.__chain__);return t.__actions__=hS(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t},fS=Object.prototype.hasOwnProperty;function vS(e){if(bg(e)&&!Sg(e)&&!(e instanceof aS)){if(e instanceof dS)return e;if(fS.call(e,"__wrapped__"))return mS(e)}return new dS(e)}vS.prototype=rS.prototype,vS.prototype.constructor=vS;var yS=vS;var gS=function(e){var t=uS(e),n=yS[t];if("function"!=typeof n||!(t in aS.prototype))return!1;if(e===n)return!0;var i=sS(n);return!!i&&e===i[0]},bS=Sw(YP),xS=/\{\n\/\* \[wrapped with (.+)\] \*/,ES=/,? & /;var wS=function(e){var t=e.match(xS);return t?t[1].split(ES):[]},_S=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;var PS=function(e,t){var n=t.length;if(!n)return e;var i=n-1;return t[i]=(n>1?"& ":"")+t[i],t=t.join(n>2?", ":" "),e.replace(_S,"{\n/* [wrapped with "+t+"] */\n")},SS=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]];var OS=function(e,t){return ig(SS,(function(n){var i="_."+n[0];t&n[1]&&!jw(e,i)&&e.push(i)})),e.sort()};var CS=function(e,t,n){var i=t+"";return Ow(e,PS(i,OS(wS(i),n)))};var TS=function(e,t,n,i,r,o,a,s,c,p){var u=8&t;t|=u?32:64,4&(t&=~(u?64:32))||(t&=-4);var l=[e,t,r,u?o:void 0,u?a:void 0,u?void 0:o,u?void 0:a,s,c,p],d=n.apply(void 0,l);return gS(e)&&bS(d,l),d.placeholder=i,CS(d,e,t)};var AS=function(e){return e.placeholder},RS=Math.min;var kS=function(e,t){for(var n=e.length,i=RS(t.length,n),r=hS(e);i--;){var o=t[i];e[i]=Ag(o,n)?r[o]:void 0}return e},jS="__lodash_placeholder__";var MS=function(e,t){for(var n=-1,i=e.length,r=0,o=[];++n<i;){var a=e[n];a!==t&&a!==jS||(e[n]=jS,o[r++]=n)}return o};var DS=function e(t,n,i,r,o,a,s,c,p,u){var l=128&n,d=1&n,h=2&n,m=24&n,f=512&n,v=h?void 0:JP(t);return function y(){for(var g=arguments.length,b=Array(g),x=g;x--;)b[x]=arguments[x];if(m)var E=AS(y),w=iS(b,E);if(r&&(b=eS(b,r,o,m)),a&&(b=nS(b,a,s,m)),g-=w,m&&g<u){var _=MS(b,E);return TS(t,n,e,y.placeholder,i,b,_,c,p,u-g)}var P=d?i:this,S=h?P[t]:t;return g=b.length,c?b=kS(b,c):f&&g>1&&b.reverse(),l&&p<g&&(b.length=p),this&&this!==cg&&this instanceof y&&(S=v||JP(S)),S.apply(P,b)}};var BS=function(e,t,n){var i=JP(e);return function r(){for(var o=arguments.length,a=Array(o),s=o,c=AS(r);s--;)a[s]=arguments[s];var p=o<3&&a[0]!==c&&a[o-1]!==c?[]:MS(a,c);if((o-=p.length)<n)return TS(e,t,DS,r.placeholder,void 0,a,p,void 0,void 0,n-o);var u=this&&this!==cg&&this instanceof r?i:e;return gw(u,this,a)}};var IS=function(e,t,n,i){var r=1&t,o=JP(e);return function t(){for(var a=-1,s=arguments.length,c=-1,p=i.length,u=Array(p+s),l=this&&this!==cg&&this instanceof t?o:e;++c<p;)u[c]=i[c];for(;s--;)u[c++]=arguments[++a];return gw(l,r?n:this,u)}},NS="__lodash_placeholder__",LS=128,FS=Math.min;var VS=function(e,t){var n=e[1],i=t[1],r=n|i,o=r<131,a=i==LS&&8==n||i==LS&&256==n&&e[7].length<=t[8]||384==i&&t[7].length<=t[8]&&8==n;if(!o&&!a)return e;1&i&&(e[2]=t[2],r|=1&n?0:4);var s=t[3];if(s){var c=e[3];e[3]=c?eS(c,s,t[4]):s,e[4]=c?MS(e[3],NS):t[4]}return(s=t[5])&&(c=e[5],e[5]=c?nS(c,s,t[6]):s,e[6]=c?MS(e[5],NS):t[6]),(s=t[7])&&(e[7]=s),i&LS&&(e[8]=null==e[8]?t[8]:FS(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=r,e},$S=Math.max;var zS=function(e,t,n,i,r,o,a,s){var c=2&t;if(!c&&"function"!=typeof e)throw new TypeError("Expected a function");var p=i?i.length:0;if(p||(t&=-97,i=r=void 0),a=void 0===a?a:$S(SP(a),0),s=void 0===s?s:SP(s),p-=r?r.length:0,64&t){var u=i,l=r;i=r=void 0}var d=c?void 0:sS(e),h=[e,t,n,i,r,u,l,o,a,s];if(d&&VS(h,d),e=h[0],t=h[1],n=h[2],i=h[3],r=h[4],!(s=h[9]=void 0===h[9]?c?0:e.length:$S(h[9]-p,0))&&24&t&&(t&=-25),t&&1!=t)m=8==t||16==t?BS(e,t,s):32!=t&&33!=t||r.length?DS.apply(void 0,h):IS(e,t,n,i);else var m=ZP(e,t,n);return CS((d?YP:bS)(m,h),e,t)},qS=Cw((function(e,t,n){var i=1;if(n.length){var r=MS(n,AS(qS));i|=32}return zS(e,i,t,n,r)}));qS.placeholder={};var US=qS,GS=GE.domify,HS=hw.escapeHTML;var WS=function(e,t){var n=t.id,i=t.buttonLabel||n,r=t.showLink,o=t.handleClick,a=t.description,s=t.label;if(r&&"function"!=typeof r)throw new Error("options.showLink must be a function");if("function"!=typeof o)throw new Error("options.handleClick must be a function");var c={id:n,html:document.createDocumentFragment()};return s&&c.html.appendChild(GS('<label for="camunda-'+HS(n)+'" '+(r?'data-show="showLink" ':"")+">"+HS(s)+"</label>")),c.html.appendChild(GS('<div class="bpp-field-wrapper"><a data-action="handleClick" '+(r?'data-show="showLink" ':"")+'class="bpp-entry-link'+(t.cssClasses?" "+HS(t.cssClasses):"")+'">'+HS(i)+"</a></div>")),a&&c.html.appendChild(Q_(e,a,{show:"showLink"})),c.handleClick=US(o,c),"function"==typeof r&&(c.showLink=function(){return r.apply(c,arguments)}),c},KS=t(W),XS=GE.classes,YS=GE.domify,JS=GE.query,ZS=KS.assign,QS=KS.find,eO=KS.forEach,tO=KS.debounce,nO=hw.escapeHTML,iO="active",rO="#text",oO=function(){},aO=function(e,t,n){var i=n,r=t.label||i.id,o=!!t.show&&"function"==typeof t.show,a=t.description;function s(e,t){var n=sO().range.getBoundingClientRect(),i=t.getBoundingClientRect(),r=e.getBoundingClientRect(),o={"top-left":{x:n.right-r.width,y:n.top-r.height},"top-right":{x:n.right,y:n.top-r.height},"bottom-left":{x:n.right-r.width,y:n.top+15},"bottom-right":{x:n.right,y:n.top+15}},a="";return a=n.top+15+r.height>i.height+i.top?"top-":"bottom-",n.right+r.width>i.width+i.left?a+="left":a+="right",{orientation:a,position:o[a]}}return i.html=YS('<label for="camunda-'+nO(i.id)+'" '+(o?'data-show="isShown"':"")+">"+r+'</label><div class="bpp-field-wrapper" '+(o?'data-show="isShown"':"")+'><div contenteditable="true"id="camunda-'+nO(i.id)+'" name="'+nO(t.modelProperty)+'" data-auto-suggest="suggestItems"data-blur="handleFocusLeave"></div><div class="bpp-autosuggest-list"></div></div>'),a&&JS(".bpp-field-wrapper",i.html).appendChild(Q_(e,a)),o&&(i.isShown=function(){return t.show.apply(i,arguments)}),i.handleFocusLeave=tO((function(e,t){pO(t),cO(t)}),"150"),i.suggestItems=function(e,n,i){var r=i.delegateTarget,o=sO(),a=o.focusNode,c=function(e){return e.startOffset}(o.range),p=t.canSuggest||oO,u=t.getItems;function l(e){var t=e.target.innerText,i=d.index,r=i,o=i+d[0].length;!function(e,t,n){var i=document.createRange(),r=window.getSelection();i.setStart(e,t),i.setEnd(e,n),r.removeAllRanges(),r.addRange(i)}(a,r,o),document.execCommand("insertText",!1,t),pO(n),cO(n)}cO(n);var d=function(e,t){var n=function(e){return function(e,t){var n,i=RegExp(t),r=[];for(;null!==(n=i.exec(e));)r.push(n);return r}(e,/[^\s\r\(\)\,\+\-\*\/\{\}]+/g)}(e.nodeName===rO?e.wholeText:e.innerText);return QS(n,(function(e){var n=e[0],i=e.index,r=i+n.length-1;return i<=t-1&&r>=t-1}))}(a,c)||[];if(d&&p(d,r,a)){var h=u(e,n),m=[],f=d[0];eO(h,(function(e){var t=e.toLowerCase(),n=f&&f.toLowerCase();0===t.indexOf(n)&&m.push(e)})),eO(h,(function(e){var t=e.toLowerCase(e),n=f&&f.toLowerCase();t.indexOf(n)>=1&&m.push(e)})),function(e){var t=JS(".bpp-autosuggest-list",n);if(pO(n),e.length){XS(t).add(iO),eO(e,(function(e){!function(e,t){var n=YS('<div class="bpp-autosuggest-item"></div>');n.innerText=nO(t),e.appendChild(n),n.addEventListener("click",l)}(t,e)}));var i,r,o,a=s(t,document.body).position;i=t,r=a.x,o=a.y,ZS(i.style,{left:r+"px",top:o+"px"})}}(m)}},i.getSuggestionListPosition=s,i.cssClasses=["bpp-autosuggest-textbox"],i};function sO(){var e=document.getSelection();return{range:e.getRangeAt(0),focusNode:e.focusNode}}function cO(e){var t=JS(".bpp-autosuggest-list",e);XS(t).remove(iO)}function pO(e){for(var t=JS(".bpp-autosuggest-list",e);t.firstChild;)t.removeChild(t.firstChild)}var uO=hw.escapeHTML,lO=GE.query;var dO=function(e){var t=e.id,n=e.title||"",i=e.description||"",r=!!e.open||!1,o=e.onToggle||hO,a=e.onRemove,s=e.cssClasses||[],c={id:t,toggle:function(e,t,n,i){var a=!r;p(a,t),o(a,t)},isOpen:function(){return r},set:function(){var e=this._commands;if(e)return delete this._commands,e},setOpen:p,get:function(t,r){if(e.get)return e.get(t,r);return{title:n||"",description:i||""}}};function p(e,t){r=e,t.classList.toggle("bpp-collapsible--collapsed",!e)}return"function"==typeof a&&(c.onRemove=function(e,t,n,i){var r=a(e,t,n,i);if(r)return function(e,t){c._commands=e,lO('input[type="hidden"]',t).value=1}(r,t),!0}),c.html='<div class="bpp-field-wrapper" data-action="toggle"><input name="hidden" type="hidden"><span class="bpp-collapsible__icon"></span><label class="bpp-collapsible__title" data-value="title">'+uO(n)+'</label><label class="bpp-collapsible__description" data-value="description">'+uO(i)+"</label>"+(a?'<button class="bpp-collapsible__remove action-button clear" data-action="onRemove"></button>':"")+"</div>",c.cssClasses=s.concat(r?["bpp-collapsible"]:["bpp-collapsible","bpp-collapsible--collapsed"]),c};function hO(){}var mO=PE.getBusinessObject,fO=hw.escapeHTML,vO=GE.domify,yO=function(e,t,n){var i=n,r=i.id,o=t.label||r,a=!!t.hidden&&"function"==typeof t.hidden,s=t.isOn,c=t.descriptionOn,p=t.descriptionOff,u=t.labelOn,l=t.labelOff;return i.html=document.createDocumentFragment(),i.html.appendChild(vO('<label for="'+fO(r)+'" '+(a?'data-show="shouldShow"':"")+">"+fO(o)+'</label><div class="bpp-field-wrapper"'+(a?'data-show="shouldShow"':"")+'><label class="bpp-toggle-switch__switcher"><input id="'+fO(r)+'" type="checkbox" name="'+fO(t.modelProperty)+'" /><span class="bpp-toggle-switch__slider"></span></label><p class="bpp-toggle-switch__label" data-show="isOn">'+fO(u)+'</p><p class="bpp-toggle-switch__label" data-show="isOff">'+fO(l)+"</p></div>")),c&&i.html.appendChild(Q_(e,c,{show:"isOn"})),p&&i.html.appendChild(Q_(e,p,{show:"isOff"})),i.get=function(e){var n=mO(e),i={};return i[t.modelProperty]=n.get(t.modelProperty),i},i.set=function(e,n){var i={};return i[t.modelProperty]=!!n[t.modelProperty],aP.updateProperties(e,i)},"function"==typeof t.set&&(i.set=t.set),"function"==typeof t.get&&(i.get=t.get),a&&(i.shouldShow=function(){return!t.hidden.apply(i,arguments)}),i.isOn=function(){return!(a&&!i.shouldShow())&&s.apply(i,arguments)},i.isOff=function(){return!(a&&!i.shouldShow())&&!i.isOn()},i.cssClasses=["bpp-toggle-switch"],i},gO=PE.getBusinessObject;function bO(e){if(!e)throw new Error(e+" must be set.");return e}var xO=function(e){return{id:e.id,description:e.description||"",get:e.get||function(t){var n=gO(t),i={},r=bO(e.modelProperty);return i[r]=n.get(r),i},set:e.set||function(t,n){var i={},r=bO(e.modelProperty);return""!==n[r]?i[r]=n[r]:i[r]=void 0,aP.updateProperties(t,i)},validate:e.validate||function(){return{}},html:""}};function EO(){}EO.textField=function(e,t){return rP(e,t,xO(t))},EO.validationAwareTextField=function(e,t){return BP(e,t,xO(t))},EO.checkbox=function(e,t){return uP(e,t,xO(t))},EO.textBox=function(e,t){return DP(e,t,xO(t))},EO.selectBox=function(e,t){return mP(e,t,xO(t))},EO.comboBox=function(e,t){return kP(e,t)},EO.table=function(e,t){return WP(e,t)},EO.label=function(e){return KP(e)},EO.link=function(e,t){return WS(e,t)},EO.autoSuggest=function(e,t){return aO(e,t,xO(t))},EO.collapsible=function(e){return dO(e)},EO.toggleSwitch=function(e,t){return yO(e,t,xO(t))};var wO=EO,_O=PE.is,PO=PE.getBusinessObject,SO={},OO=SO;SO.modifyProcessBusinessObject=function(e,t,n){if(!_O(e,"bpmn:Participant"))return{};var i=PO(e).get("processRef"),r={};return r[t]=n[t],aP.updateBusinessObject(e,i,r)},SO.getProcessBusinessObject=function(e,t){if(!_O(e,"bpmn:Participant"))return{};var n=PO(e).get("processRef"),i={};return i[t]=n.get(t),i};var CO=function(e,t,n){var i=(t=t||{}).id||"name",r=t.label||n("Name"),o=t.modelProperty||"name";return[wO.textBox(n,{id:i,label:r,modelProperty:o,get:t.get,set:t.set})]},TO=PE.is,AO=PE.getBusinessObject,RO=function(e,t,n,i){var r=AO(t),o=i&&i.processIdDescription;if((TO(t,"bpmn:Process")||TO(t,"bpmn:Participant")&&r.get("processRef"))&&TO(t,"bpmn:Participant")){var a=wO.validationAwareTextField(n,{id:"process-id",label:n("Process Id"),description:o&&n(o),modelProperty:"processId"});a.get=function(e){return{processId:OO.getProcessBusinessObject(e,"id").id}},a.set=function(e,t){return OO.modifyProcessBusinessObject(e,"id",{id:t.processId})},a.validate=function(e,t){var i=t.processId,r=AO(e),o=hw.isIdValid(r.processRef,i,n);return o?{processId:o}:{}},e.entries.push(a);var s=CO(0,{id:"process-name",label:n("Process Name")})[0];s.get=function(e){return OO.getProcessBusinessObject(e,"name")},s.set=function(e,t){return OO.modifyProcessBusinessObject(e,"name",t)},e.entries.push(s)}},kO=PE.getBusinessObject,jO=PE.is,MO={},DO=MO;MO.getEventDefinition=function(e,t){var n=kO(e),i=null;return n.eventDefinitions&&Qg(n.eventDefinitions,(function(e){jO(e,t)&&(i=e)})),i},MO.getTimerEventDefinition=function(e){return this.getEventDefinition(e,"bpmn:TimerEventDefinition")},MO.getMessageEventDefinition=function(e){return this.getEventDefinition(e,"bpmn:MessageEventDefinition")},MO.getSignalEventDefinition=function(e){return this.getEventDefinition(e,"bpmn:SignalEventDefinition")},MO.getErrorEventDefinition=function(e){return this.getEventDefinition(e,"bpmn:ErrorEventDefinition")},MO.getEscalationEventDefinition=function(e){return this.getEventDefinition(e,"bpmn:EscalationEventDefinition")},MO.getCompensateEventDefinition=function(e){return this.getEventDefinition(e,"bpmn:CompensateEventDefinition")},MO.getLinkEventDefinition=function(e){return this.getEventDefinition(e,"bpmn:LinkEventDefinition")},MO.getConditionalEventDefinition=function(e){return this.getEventDefinition(e,"bpmn:ConditionalEventDefinition")};var BO=GE.query,IO=GE.domify,NO=GE.attr,LO=hw.escapeHTML,FO="select[name=selectedElement]";var VO=function(e,t,n,i){var r=i.elementName||"",o=i.elementType,a=i.referenceProperty,s=i.newElementIdPrefix||"elem_",c=i.label||"",p=i.description||"",u=[],l=!!i.hidden&&"function"==typeof i.hidden;return u.push({id:i.id||"event-definitions-"+r,description:p,isShown:function(){return l?!i.hidden.apply(t,arguments):!i.hidden},html:'<div class="bpp-row bpp-select" data-show="isShown"><label for="camunda-'+LO(r)+'">'+LO(c)+'</label><div class="bpp-field-wrapper"><select id="camunda-'+LO(r)+'" name="selectedElement" data-value></select><button class="action-button add" id="addElement" data-action="addElement"><span>+</span></button></div></div>',get:function(e,n){hw.updateOptionsDropDown(FO,t,o,n);var i=t.get(a);return{selectedElement:i&&i.id||""}},set:function(e,i){var r=i.selectedElement,s={};if(!r||void 0===r)return s[a]=void 0,aP.updateBusinessObject(e,t,s);var c,p,u,l,d=[],h=(c=t,p=o,u=r,l=hw.findRootElementsByType(c,p),CP(l,(function(e){return e.id===u})));if(!h){var m=hw.getRoot(t);h=RE.createElement(o,{name:r},m,n),d.push(aP.addAndRemoveElementsFromList(e,m,"rootElements",null,[h]))}return s[a]=h,d.push(aP.updateBusinessObject(e,t,s)),d},addElement:function(e,t){var n=hw.nextId(s),i=IO('<option value="'+LO(n)+'"> (id='+LO(n)+")</option>"),r=function(e){return BO(FO,e)}(t);return r.insertBefore(i,r.firstChild),Qg(r,(function(e){e.value===n?NO(e,"selected","selected"):NO(e,"selected",null)})),!0}}),u},$O=function(e,t,n,i,r){var o=r.id||"element-property",a=r.label,s=r.referenceProperty,c=r.modelProperty||"name",p=r.shouldValidate||!1,u=r.description,l=!!r.hidden&&"function"==typeof r.hidden,d=wO.textField(i,{id:o,label:a,modelProperty:c,description:u,get:function(e,n){var i=t.get(s),r={};return r[c]=i&&i.get(c),r},set:function(e,n,i){var r=t.get(s),o={};return o[c]=n[c]||void 0,aP.updateBusinessObject(e,r,o)},hidden:function(e,n){return l&&r.hidden.apply(t,arguments)||!t.get(s)}});return p&&(d.validate=function(e,n,i){if(t.get(s)&&!n[c]){var r={};return r[c]="Must provide a value",r}}),[d]},zO=function(e,t,n,i,r){e.entries=e.entries.concat(VO(0,i,n,{label:r("Global Message referenced"),elementName:"message",elementType:"bpmn:Message",referenceProperty:"messageRef",newElementIdPrefix:"Message_"})),e.entries=e.entries.concat($O(0,i,0,r,{id:"message-element-name",label:r("Global Message Name"),referenceProperty:"messageRef",modelProperty:"name",shouldValidate:!0}))};function qO(e){if(e)return void 0!==e.get("timeDate")?"timeDate":void 0!==e.get("timeCycle")?"timeCycle":void 0!==e.get("timeDuration")?"timeDuration":void 0}function UO(e,t,n){return"function"==typeof e?e(t,n):e}var GO=function(e,t,n,i,r,o){var a=[{value:"timeDate",name:r("Date")},{value:"timeDuration",name:r("Duration")},{value:"timeCycle",name:r("Cycle")}],s=o&&o.idPrefix,c=o&&o.createTimerEventDefinition;e.entries.push(wO.selectBox(r,{id:s+"timer-event-definition-type",label:r("Timer Definition Type"),selectOptions:a,emptyParameter:!0,modelProperty:"timerDefinitionType",get:function(e,t){return{timerDefinitionType:qO(UO(i,e,t))||""}},set:function(e,t,r){var o={timeDuration:void 0,timeDate:void 0,timeCycle:void 0},a=UO(i,e,r),s=t.timerDefinitionType;if(a||"function"!=typeof c||(a=c(e,r)),t.timerDefinitionType){var p,u=qO(a);if(u)p=a.get(u).get("body");o[s]=function(e,t,n){return t=t||void 0,RE.createElement("bpmn:FormalExpression",{body:t},e,n)}(a,p,n)}return aP.updateBusinessObject(e,a,o)},hidden:function(e,t){return void 0===UO(i,e,t)}})),e.entries.push(wO.textField(r,{id:s+"timer-event-definition",label:r("Timer Definition"),modelProperty:"timerDefinition",get:function(e,t){var n=UO(i,e,t),r=qO(n),o=r&&n.get(r);return{timerDefinition:o&&o.get("body")}},set:function(e,t,n){var r=UO(i,e,n),o=qO(r),a=o&&r.get(o);if(a)return aP.updateBusinessObject(e,a,{body:t.timerDefinition||void 0})},validate:function(e,t){var n=UO(i,e,t),o=qO(n),a=o&&n.get(o);if(a&&!a.get("body"))return{timerDefinition:r("Must provide a value")}},hidden:function(e,t){return!qO(UO(i,e,t))}}))},HO=PE.getBusinessObject,WO=PE.is;function KO(e,t){return hw.filterElementsByType(e.flowElements,t)}function XO(e,t){return WO(e,"bpmn:SubProcess")&&!e.triggeredByEvent||WO(e,"bpmn:CallActivity")||function(e,t){var n=e.id;return!!CP(t,(function(e){var t=DO.getCompensateEventDefinition(e),i=e.attachedToRef;return t&&i&&i.id===n}))}(e,t)}function YO(e){var t=function(e){return KO(e,"bpmn:BoundaryEvent")}(e);return fw(function(e){return KO(e,"bpmn:Activity")}(e),(function(e){return XO(e,t)}))}function JO(e){var t=[{value:""}],n=function(e){var t=HO(e).$parent,n=YO(t);return WO(t,"bpmn:SubProcess")&&t.triggeredByEvent&&(t=t.$parent)&&(n=n.concat(YO(t))),n}(e);return Qg(n,(function(e){var n=e.id,i=(e.name?e.name+" ":"")+"(id="+n+")";t.push({value:n,name:i})})),t}var ZO=t(Ur),QO=PE.is,eC=ZO.isEventSubProcess,tC=t(ts),nC=PE.is,iC=tC.isAny,rC=PE.getBusinessObject,oC=function(e,t,n,i,r){Qg(["bpmn:StartEvent","bpmn:EndEvent","bpmn:IntermediateThrowEvent","bpmn:BoundaryEvent","bpmn:IntermediateCatchEvent"],(function(i){if(nC(t,i)){var o=DO.getMessageEventDefinition(t),a=DO.getSignalEventDefinition(t);o&&zO(e,0,n,o,r),a&&function(e,t,n,i,r){e.entries=e.entries.concat(VO(0,i,n,{label:r("Global Signal referenced"),elementName:"signal",elementType:"bpmn:Signal",referenceProperty:"signalRef",newElementIdPrefix:"Signal_"})),e.entries=e.entries.concat($O(0,i,0,r,{id:"signal-element-name",label:r("Global Signal Name"),referenceProperty:"signalRef",modelProperty:"name",shouldValidate:!0}))}(e,0,n,a,r)}})),nC(t,"bpmn:ReceiveTask")&&zO(e,0,n,rC(t),r);Qg(["bpmn:StartEvent","bpmn:BoundaryEvent","bpmn:EndEvent"],(function(i){if(nC(t,i)){var o=DO.getErrorEventDefinition(t);o&&function(e,t,n,i,r){e.entries=e.entries.concat(VO(0,i,n,{label:r("Global Error referenced"),elementName:"error",elementType:"bpmn:Error",referenceProperty:"errorRef",newElementIdPrefix:"Error_"})),e.entries=e.entries.concat($O(0,i,0,r,{id:"error-element-name",label:r("Name"),referenceProperty:"errorRef",modelProperty:"name",shouldValidate:!0})),e.entries=e.entries.concat($O(0,i,0,r,{id:"error-element-code",label:r("Code"),referenceProperty:"errorRef",modelProperty:"errorCode"}))}(e,0,n,o,r)}}));Qg(["bpmn:StartEvent","bpmn:BoundaryEvent","bpmn:IntermediateThrowEvent","bpmn:EndEvent"],(function(i){if(nC(t,i)){var o=nC(t,"bpmn:StartEvent")||nC(t,"bpmn:BoundaryEvent"),a=DO.getEscalationEventDefinition(t);a&&function(e,t,n,i,r,o){e.entries=e.entries.concat(VO(0,i,n,{label:o("Global Escalation referenced"),elementName:"escalation",elementType:"bpmn:Escalation",referenceProperty:"escalationRef",newElementIdPrefix:"Escalation_"})),e.entries=e.entries.concat($O(0,i,0,o,{id:"escalation-element-name",label:o("Global Escalation Name"),referenceProperty:"escalationRef",modelProperty:"name",shouldValidate:!0})),e.entries=e.entries.concat($O(0,i,0,o,{id:"escalation-element-code",label:o("Global Escalation Code"),referenceProperty:"escalationRef",modelProperty:"escalationCode"})),r&&e.entries.push(wO.validationAwareTextField(o,{id:"escalationCodeVariable",label:o("Escalation Code Variable"),modelProperty:"escalationCodeVariable",description:o("Define the name of the variable that will contain the escalation code"),getProperty:function(e){return i.get("camunda:escalationCodeVariable")},setProperty:function(e,t){return""===t.escalationCodeVariable&&(t.escalationCodeVariable=void 0),aP.updateBusinessObject(e,i,t)},validate:function(e,t){var n={},i=t.escalationCodeVariable;return hw.containsSpace(i)&&(n.escalationCodeVariable=o("Escalation code variable must not contain spaces.")),n}}))}(e,0,n,a,o,r)}}));Qg(["bpmn:StartEvent","bpmn:BoundaryEvent","bpmn:IntermediateCatchEvent"],(function(i){if(nC(t,i)){var o=DO.getTimerEventDefinition(t);o&&GO(e,t,n,o,r)}}));Qg(["bpmn:EndEvent","bpmn:IntermediateThrowEvent"],(function(n){if(nC(t,n)){var o=DO.getCompensateEventDefinition(t);o&&function(e,t,n,i,r,o){e.entries.push(wO.checkbox(o,{id:"wait-for-completion",label:o("Wait for Completion"),modelProperty:"waitForCompletion",get:function(e,t){return{waitForCompletion:i.waitForCompletion}},set:function(e,t){return t.waitForCompletion=t.waitForCompletion||!1,aP.updateBusinessObject(e,i,t)}})),e.entries.push(wO.selectBox(o,{id:"activity-ref",label:o("Activity Ref"),selectOptions:JO(t),modelProperty:"activityRef",get:function(e,t){var n=i.activityRef;return{activityRef:(n=n&&n.id)||""}},set:function(e,t){var n=t.activityRef||void 0;return n=n&&HO(r.get(n)),aP.updateBusinessObject(e,i,{activityRef:n})}}))}(e,t,0,o,i,r)}}));if(iC(t,["bpmn:StartEvent","bpmn:BoundaryEvent","bpmn:IntermediateThrowEvent","bpmn:IntermediateCatchEvent"])){var o=DO.getConditionalEventDefinition(t);o&&function(e,t,n,i,r,o){var a=function(e){return function(t){var n=i.get("camunda:"+e),r={};return r[e]=n,r}},s=function(e){return function(t,n){var r={};return r["camunda:"+e]=n[e]||void 0,aP.updateBusinessObject(t,i,r)}};e.entries.push(wO.textField(o,{id:"variableName",label:o("Variable Name"),modelProperty:"variableName",get:a("variableName"),set:s("variableName")})),QO(t,"bpmn:StartEvent")&&!eC(t.parent)||e.entries.push(wO.textField(o,{id:"variableEvents",label:o("Variable Events"),description:o("Specify more than one variable change event as a comma separated list."),modelProperty:"variableEvents",get:a("variableEvents"),set:s("variableEvents")}))}(e,t,0,o,0,r)}},aC=PE.is,sC=PE.getBusinessObject;var cC=function(e,t,n){Qg(["bpmn:IntermediateThrowEvent","bpmn:IntermediateCatchEvent"],(function(i){if(aC(t,i)){var r=function(e){var t=sC(e),n=null;return t.eventDefinitions&&Qg(t.eventDefinitions,(function(e){aC(e,"bpmn:LinkEventDefinition")&&(n=e)})),n}(t);if(r){var o=wO.textField(n,{id:"link-event",label:n("Link Name"),modelProperty:"link-name"});o.get=function(){return{"link-name":r.get("name")}},o.set=function(e,t){var n={name:t["link-name"]};return aP.updateBusinessObject(e,r,n)},e.entries.push(o)}}}))},pC=PE.is,uC=PE.getBusinessObject,lC="text/plain",dC=function(e,t,n,i){var r,o=function(e){return e.find((function(e){return(e.textFormat||lC)===lC}))},a=function(e){return function(t){var n=o(e&&e.get("documentation"));return{documentation:n&&n.text||""}}},s=function(e){return function(t,i){var r=i.documentation,a=o(e&&e.get("documentation"));return a?r?aP.updateBusinessObject(t,a,{text:i.documentation}):aP.removeElementsFromList(t,e,"documentation",null,[a]):r?aP.addElementsTolist(t,e,"documentation",[n.create("bpmn:Documentation",{text:i.documentation})]):void 0}},c=wO.textBox(i,{id:"documentation",label:i("Element Documentation"),modelProperty:"documentation"});if(c.set=s(uC(t)),c.get=a(uC(t)),e.entries.push(c),pC(t,"bpmn:Participant")&&(r=uC(t).processRef)){var p=wO.textBox(i,{id:"process-documentation",label:i("Process Documentation"),modelProperty:"documentation"});p.set=s(r),p.get=a(r),e.entries.push(p)}},hC=PE.getBusinessObject,mC=function(e,t,n,i){i||(i={}),e.entries.push(wO.validationAwareTextField(n,{id:i.id||"id",label:n(i.label||"Id"),description:i.description&&n(i.description),modelProperty:"id",getProperty:function(e){return hC(e).id},setProperty:function(e,t){return e=e.labelTarget||e,aP.updateProperties(e,t)},validate:function(e,t){var i=t.id,r=hC(e),o=hw.isIdValid(r,i,n);return o?{id:o}:{}}}))},fC=t(Pt),vC=fC.add,yC=PE.getBusinessObject,gC={},bC=gC;gC.createCategoryValue=function(e,t){var n=t.create("bpmn:CategoryValue"),i=t.create("bpmn:Category",{categoryValue:[n]});return vC(e.get("rootElements"),i),yC(i).$parent=e,yC(n).$parent=i,n};var xC=bC.createCategoryValue,EC=PE.is,wC=PE.getBusinessObject,_C=function(e,t,n,i,r,o){if(o||(o={}),!EC(t,"bpmn:Collaboration")){var a={id:o.id,label:o.label&&r(o.label)};EC(t,"bpmn:TextAnnotation")?(a.modelProperty="text",a.label=r("Text")):EC(t,"bpmn:Group")&&(a.modelProperty="categoryValue",a.label=r("Category Value"),a.get=function(e){return{categoryValue:(wC(e).categoryValueRef||{}).value}},a.set=function(e,t){var r,o,a,s,c=wC(e);return c.categoryValueRef||(r=c,o=i.getRootElement(),a=wC(o).$parent,s=xC(a,n),r.categoryValueRef=s),{cmd:"element.updateLabel",context:{element:e,newLabel:t.categoryValue}}}),e.entries=e.entries.concat(CO(0,a,r))}},PC=PE.is,SC=PE.getBusinessObject,OC=function(e,t,n){var i=SC(t);if(i&&(PC(t,"bpmn:Process")||PC(t,"bpmn:Participant")&&i.get("processRef"))){var r=wO.checkbox(n,{id:"process-is-executable",label:n("Executable"),modelProperty:"isExecutable"});PC(t,"bpmn:Participant")&&(r.get=function(e){return OO.getProcessBusinessObject(e,"isExecutable")},r.set=function(e,t){return OO.modifyProcessBusinessObject(e,"isExecutable",t)}),e.entries.push(r)}},CC=PE.is;function TC(e,t,n,i,r){var o={id:"general",label:r("General"),entries:[]};mC(o,0,r,function(e){if(CC(e,"bpmn:Participant"))return{id:"participant-id",label:"Participant Id"}}(e)),_C(o,e,n,t,r,function(e){if(CC(e,"bpmn:Participant"))return{id:"participant-name",label:"Participant Name"}}(e)),RO(o,e,r),OC(o,e,r);var a={id:"details",label:r("Details"),entries:[]};cC(a,e,r),oC(a,e,n,i,r);var s={id:"documentation",label:r("Documentation"),entries:[]};return dC(s,e,n,r),[o,a,s]}function AC(e,t,n,i,r){K_.call(this,e),this.getTabs=function(e){return[{id:"general",label:r("General"),groups:TC(e,t,n,i,r)}]}}AC.$inject=["eventBus","canvas","bpmnFactory","elementRegistry","translate"],i(AC,K_);var RC={__init__:["propertiesProvider"],propertiesProvider:["type",AC]};function kC(e={}){this._injectOriginModule(e),_y.call(this,e)}i(kC,_y),kC.prototype._injectOriginModule=function(e){this._modules=[].concat(this._modules,e&&e.disableAdjustOrigin?Vy:qy)},kC.prototype._extensionModules=[By,Gy,Jy,ng,H_,RC],kC.prototype._modules=[].concat(_y.prototype._modules,kC.prototype._extensionModules);function jC(e){as.call(this,e),this.executed(["properties-panel.update-businessobject","element.updateProperties"],5e3,(function(e){const{element:t,oldProperties:n,properties:i}=e,r=Br(t).extensionElements;Dr(t,"camunda:ExternalCapable")&&r&&function(e,t){const{"camunda:type":n}=e,{"camunda:type":i}=t;return"external"===n&&"external"!==i}(n,i)&&(e.deletedErrorEventDefinitions=r.values,r.values=r.values.filter((e=>!Dr(e,"camunda:ErrorEventDefinition"))))}),!0),this.reverted(["properties-panel.update-businessobject","element.updateProperties"],5e3,(function({context:e}){const{element:t,deletedErrorEventDefinitions:n}=e,i=Br(t);if(n){i.extensionElements.values=n}}))}jC.$inject=["eventBus"],i(jC,as);function MC(e){as.call(this,e),this.executed(["properties-panel.update-businessobject","element.updateProperties"],15e3,(function(e){const{element:t,properties:n}=e,i=Br(t),r=i.extensionElements;if(Dr(t,"camunda:AsyncCapable")&&n&&(!1===n["camunda:asyncBefore"]||!1===n["camunda:asyncAfter"])&&r&&r.values.length&&r.values.find((e=>Dr(e,"camunda:FailedJobRetryTimeCycle")))&&!function(e){return function(e,t){const n=Br(e);return x(n.get("eventDefinitions")||[],(function(e){return Dr(e,t)}))}(e,"bpmn:TimerEventDefinition")}(t)){if((o=i).get("camunda:asyncBefore")||o.get("camunda:async")||function(e){return!!e.get("camunda:asyncAfter")}(i))return;e.deleteRetryCycleOldExtElements=r.values,r.values=r.values.filter((e=>!Dr(e,"camunda:FailedJobRetryTimeCycle")))}var o}),!0),this.reverted(["properties-panel.update-businessobject","element.updateProperties"],15e3,(function({context:e}){const{element:t,deleteRetryCycleOldExtElements:n}=e,i=Br(t);if(n){i.extensionElements.values=n}}))}MC.$inject=["eventBus"],i(MC,as);function DC(e){as.call(this,e),this.preExecute(["properties-panel.update-businessobject","element.updateProperties"],15e3,(function(e){const{element:t,properties:n}=e,i=Br(t);if(Dr(t,"camunda:AsyncCapable")&&n&&(!1===n["camunda:asyncBefore"]||!1===n["camunda:asyncAfter"])&&!i.get("camunda:exclusive")){if(function(e){return!!e.get("camunda:asyncAfter")}(i)&&!1!==n["camunda:asyncAfter"]||function(e){return!(!e.get("camunda:asyncBefore")&&!e.get("camunda:async"))}(i)&&!1!==n["camunda:asyncBefore"]||n["camunda:asyncBefore"]||n["camunda:asyncAfter"])return;n["camunda:exclusive"]=!0}}),!0)}function BC(e,t){as.call(this,e),this.postExecute(["element.updateProperties","element.updateModdleProperties","properties-panel.update-businessobject-list"],(function(e){const{element:n,oldProperties:i,propertyName:r}=e,o=Br(n),a=function(e){const t=e.get("extensionElements");if(!t)return;return t.get("values").find((e=>Dr(e,"camunda:InputOutput")))}(o),s=o.get("extensionElements");if((i||"values"!==r)&&a&&function(e){const t=function(e){return e.get("inputParameters")}(e),n=function(e){return e.get("outputParameters")}(e);return 0===t.length&&0===n.length}(a)){const e=s.values.filter((function(e){return e!==a}));t.updateModdleProperties(n,s,{values:e})}}),!0)}DC.$inject=["eventBus"],i(DC,as),BC.$inject=["eventBus","modeling"],i(BC,as);function IC(e){as.call(this,e),this.preExecute(["properties-panel.update-businessobject","element.updateProperties"],5e3,(function(e){const{element:t,properties:n}=e;var i;Dr(t,"camunda:DmnCapable")&&b(n,"camunda:resultVariable")&&(null==(i=n["camunda:resultVariable"])||""===i)&&(n["camunda:mapDecisionResult"]=null)}),!0)}IC.$inject=["eventBus"],i(IC,as);class NC extends as{constructor(e){super(e),this.preExecute(["element.updateProperties","element.updateModdleProperties","properties-panel.update-businessobject"],(function(e){const{properties:t}=e,n=e.moddleElement||e.businessObject||e.element.businessObject;"camunda:formKey"in t?Object.assign(t,{"camunda:formRef":void 0,"camunda:formRefBinding":void 0,"camunda:formRefVersion":void 0}):"camunda:formRef"in t&&(Object.assign(t,{"camunda:formKey":void 0}),u(t["camunda:formRef"])&&Object.assign(t,{"camunda:formRefBinding":void 0,"camunda:formRefVersion":void 0}),!("camunda:formRefBinding"in t)&&u(n.get("camunda:formRefBinding"))&&Object.assign(t,{"camunda:formRefBinding":"latest"})),"camunda:formRefBinding"in t&&"version"!==t["camunda:formRefBinding"]&&Object.assign(t,{"camunda:formRefVersion":void 0})}),!0)}}NC.$inject=["eventBus"];class LC extends as{constructor(e,t){super(e),this.preExecute(["element.updateModdleProperties","properties-panel.update-businessobject"],(function(e){let{businessObject:t,moddleElement:n,properties:i}=e;t=t||n,Dr(t,"camunda:FormField")&&"camunda:type"in i&&"enum"!==i["camunda:type"]&&(i["camunda:values"]=void 0)}),!0),this.preExecute(["element.updateModdleProperties","properties-panel.update-businessobject"],(function(e){let{businessObject:n,element:i,moddleElement:r,properties:o}=e;if(n=n||r,!Dr(n,"camunda:FormField"))return;const a=function(e){const t=Br(e).get("extensionElements");if(!t)return;return t.get("values").find((e=>Dr(e,"camunda:FormData")))}(i);"camunda:id"in o&&function(e,t){return e.get("camunda:id")===t.get("camunda:businessKey")}(n,a)&&t.updateModdleProperties(i,a,{"camunda:businessKey":o["camunda:id"]})}),!0),this.postExecute("properties-panel.update-businessobject-list",(function(e){const{currentObject:n,element:i,propertyName:r,objectsToRemove:o=[]}=e;if(!Dr(n,"camunda:FormData")||"fields"!==r||!o.length)return;const a=n.get("camunda:businessKey");a&&o.forEach((e=>{Dr(e,"camunda:FormField")&&e.get("camunda:id")===a&&t.updateModdleProperties(i,n,{"camunda:businessKey":void 0})}))}),!0)}}LC.$inject=["eventBus","modeling"];var FC={__depends__:[{__init__:["deleteErrorEventDefinitionBehavior","deleteRetryTimeCycleBehavior","updateCamundaExclusiveBehavior","updateResultVariableBehavior","updateInputOutputBehavior","userTaskFormsBehavior","userTaskGeneratedFormsBehavior"],deleteErrorEventDefinitionBehavior:["type",jC],deleteRetryTimeCycleBehavior:["type",MC],updateCamundaExclusiveBehavior:["type",DC],updateResultVariableBehavior:["type",IC],updateInputOutputBehavior:["type",BC],userTaskFormsBehavior:["type",NC],userTaskGeneratedFormsBehavior:["type",LC]}]},VC=PE.getBusinessObject,$C=PE.is,zC=tC.isAny,qC="camunda:modelerTemplate",UC="camunda:modelerTemplateVersion";function GC(e,t){var n=HC(e);return n?n.get("values").filter((function(e){return zC(e,t)})):[]}function HC(e){var t=VC(e);return $C(t,"bpmn:ExtensionElements")?t:t.extensionElements}function WC(e,t){if("camunda:in"===t.type&&t.target)return e.target===t.target;if("camunda:out"===t.type){if(t.source)return e.source===t.source;if(t.sourceExpression)return e.sourceExpression===t.sourceExpression}return t.variables?"all"===e.variables&&("local"!==t.variables||e.local):void 0}var KC={TEMPLATE_ID_ATTR:"camunda:modelerTemplate",TEMPLATE_VERSION_ATTR:"camunda:modelerTemplateVersion",getTemplateId:function(e){var t=VC(e);if(t)return t.get(qC)},getTemplateVersion:function(e){var t=VC(e);if(t)return t.get(UC)},findExtension:function(e,t){var n,i=VC(e);return(n=$C(i,"bpmn:ExtensionElements")?i:i.extensionElements)?CP(n.get("values"),(function(e){return $C(e,t)})):null},findExtensions:GC,findCamundaInOut:function(e,t){var n,i=HC(e);if(i)return"camunda:in"===t.type?n=function(e){return $C(e,"camunda:In")&&WC(e,t)}:"camunda:out"===t.type?n=function(e){return $C(e,"camunda:Out")&&WC(e,t)}:"camunda:in:businessKey"===t.type&&(n=function(e){return $C(e,"camunda:In")&&"businessKey"in e}),CP(i.get("values"),n)},findCamundaProperty:function(e,t){return CP(e.get("values"),(function(e){return e.name===t.name}))},findInputParameter:function(e,t){var n=e.get("inputParameters");return CP(n,(function(e){return e.name===t.name}))},findOutputParameter:function(e,t){var n=e.get("outputParameters");return CP(n,(function(e){var n=e.value;if(!t.scriptFormat)return n===t.source;var i=e.definition;return!(!i||t.scriptFormat!==i.scriptFormat)&&i.value===t.source}))},findCamundaErrorEventDefinition:function(e,t){var n,i=GC(e,["camunda:ErrorEventDefinition"]);return CP(i,(function(e){if(n=e.errorRef)return 0==n.id.indexOf("Error_"+t)}))}},XC=KS.assign,YC=KS.forEach,JC=KS.keys,ZC=KS.isObject,QC=function(e){var t=[];return ZC(e)?(YC(JC(e),(function(n){t.push(XC({type:n},e[n]))})),t):e},eT=hw.nextId;function tT(e,t){var n={};if("camunda:in"===e.type)if(!e.target||e.expression||e.variables)if(e.target&&!0===e.expression&&!e.variables)n.target=e.target,n.sourceExpression=t;else if(e.target||e.expression||"local"!==e.variables)if(e.target&&!e.expression&&"local"===e.variables)n.local=!0,n.source=t,n.target=e.target;else if(e.target&&e.expression&&"local"===e.variables)n.local=!0,n.sourceExpression=t,n.target=e.target;else{if(e.target||e.expression||"all"!==e.variables)throw new Error("invalid configuration for camunda:in element template binding");n.variables="all"}else n.local=!0,n.variables="all";else n.target=e.target,n.source=t;if("camunda:out"===e.type)if(!e.source||e.sourceExpression||e.variables)if(e.source||!e.sourceExpression||e.variables)if(e.source||e.sourceExpression||"all"!==e.variables)if(e.source&&!e.sourceExpression&&"local"===e.variables)n.local=!0,n.source=e.source,n.target=t;else if(!e.source&&e.sourceExpression&&"local"===e.variables)n.local=!0,n.sourceExpression=e.sourceExpression,n.target=t;else{if(e.source||e.sourceExpression||"local"!==e.variables)throw new Error("invalid configuration for camunda:out element template binding");n.local=!0,n.variables="all"}else n.variables="all";else n.target=t,n.sourceExpression=e.sourceExpression;else n.target=t,n.source=e.source;return n}var nT={createInputParameter:function(e,t,n){var i,r,o=e.scriptFormat;return o?r=n.create("camunda:Script",{scriptFormat:o,value:t}):i=t,n.create("camunda:InputParameter",{name:e.name,value:i,definition:r})},createOutputParameter:function(e,t,n){var i,r,o=e.scriptFormat;return o?r=n.create("camunda:Script",{scriptFormat:o,value:e.source}):i=e.source,n.create("camunda:OutputParameter",{name:t,value:i,definition:r})},createCamundaProperty:function(e,t,n){return n.create("camunda:Property",{name:e.name,value:t||""})},createCamundaIn:function(e,t,n){var i=tT(e,t);return n.create("camunda:In",i)},createCamundaInWithBusinessKey:function(e,t,n){return n.create("camunda:In",{businessKey:t})},createCamundaOut:function(e,t,n){var i=tT(e,t);return n.create("camunda:Out",i)},createCamundaExecutionListenerScript:function(e,t,n){var i,r,o=e.scriptFormat;return o?r=n.create("camunda:Script",{scriptFormat:o,value:t}):i=t,n.create("camunda:ExecutionListener",{event:e.event,value:i,script:r})},createCamundaFieldInjection:function(e,t,n){var i=EP({},{string:void 0,expression:void 0,name:void 0});return e.expression?i.expression=t:i.string=t,i.name=e.name,n.create("camunda:Field",i)},createCamundaErrorEventDefinition:function(e,t,n,i,r){var o=n,a=t,s=r.create("camunda:ErrorEventDefinition",{expression:a,errorRef:o});return s.$parent=i,s},createError:function(e,t,n){var i=n.create("bpmn:Error",{id:eT("Error_"+e+"_")});return i.$parent=t,i}};var iT=function(e){return"string"==typeof e||!Sg(e)&&bg(e)&&"[object String]"==gg(e)};var rT=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0};var oT=function(e,t,n){var i=-1,r=e.length;t<0&&(t=-t>r?0:r+t),(n=n>r?r:n)<0&&(n+=r),r=t>n?0:n-t>>>0,t>>>=0;for(var o=Array(r);++i<r;)o[i]=e[i+t];return o};var aT=function(e,t){return t.length<2?e:dE(e,oT(t,0,-1))};var sT=function(e,t){return t=uE(t,e),null==(e=aT(e,t))||delete e[lE(rT(t))]},cT=Array.prototype.splice;var pT=function(e,t){for(var n=e?t.length:0,i=n-1;n--;){var r=t[n];if(n==i||r!==o){var o=r;Ag(r)?cT.call(e,r,1):sT(e,r)}}return e};var uT=function(e,t){var n=[];if(!e||!e.length)return n;var i=-1,r=[],o=e.length;for(t=EE(t);++i<o;){var a=e[i];t(a,i,e)&&(n.push(a),r.push(i))}return pT(e,r),n},lT=KC.findExtension,dT=KC.findExtensions,hT=KC.findCamundaErrorEventDefinition,mT=nT.createCamundaExecutionListenerScript,fT=nT.createCamundaFieldInjection,vT=nT.createCamundaIn,yT=nT.createCamundaInWithBusinessKey,gT=nT.createCamundaOut,bT=nT.createCamundaProperty,xT=nT.createInputParameter,ET=nT.createOutputParameter,wT=nT.createCamundaErrorEventDefinition,_T=nT.createError,PT=hw.getRoot,ST=PE.getBusinessObject,OT=PE.is,CT=tC.isAny,TT=["camunda:class","camunda:delegateExpression","camunda:expression"];function AT(e,t,n){this._bpmnFactory=e,this._commandStack=t,this._modeling=n}AT.$inject=["bpmnFactory","commandStack","modeling"];var RT=AT;function kT(e,t){var n,i=ST(e),r=t.binding,o=r.type;if("camunda:field"===o){if(n=CT(i,["camunda:ExecutionListener","camunda:TaskListener"])?"camunda:fields":"bpmn:values",!i||!i.get(n)||!i.get(n).length)return;return CP(i.get(n),(function(e){return e.get("camunda:name")===r.name}))}if("camunda:in"===o)return CP(i.get("values"),(function(e){return e.get("target")===r.target}));if("camunda:in:businessKey"===o)return CP(i.get("values"),(function(e){return iT(e.get("businessKey"))}));if("camunda:out"===o)return CP(i.get("values"),(function(e){return e.get("source")===r.source||e.get("sourceExpression")||r.sourceExpression}));if("camunda:inputParameter"===o||"camunda:outputParameter"===o){if(OT(i,"camunda:Connector")){if(!(i=i.get("camunda:inputOutput")))return}else if(!(i=lT(i,"camunda:InputOutput")))return;return"camunda:inputParameter"===o?CP(i.get("camunda:inputParameters"),(function(e){return e.get("camunda:name")===r.name})):CP(i.get("camunda:outputParameters"),(function(e){var t;return r.scriptFormat?(t=e.get("camunda:definition"))&&t.get("camunda:value")===r.source:e.get("camunda:value")===r.source}))}if("camunda:property"===o){if(!i||!i.get("values")||!i.get("values").length)return;if(!(i=lT(i,"camunda:Properties")))return;return CP(i.get("values"),(function(e){return e.get("camunda:name")===r.name}))}return"camunda:errorEventDefinition"===o?hT(e,r.errorRef):void 0}function jT(e,t){if(e){var n=e.properties,i=t.binding,r=i.name,o=i.type;return"property"===o?CP(n,(function(e){var t=e.binding,n=t.name;return"property"===t.type&&n===r})):"camunda:field"===o?CP(n,(function(e){var t=e.binding,n=t.name;return"camunda:field"===t.type&&n===r})):"camunda:in"===o?CP(n,(function(e){var t=e.binding;if("camunda:in"===t.type&&!(t.expression&&!i.expression||!t.expression&&i.expression))return t.target===i.target})):"camunda:in:businessKey"===o?CP(n,(function(e){return"camunda:in:businessKey"===e.binding.type})):"camunda:out"===o?CP(n,(function(e){var t=e.binding;return"camunda:out"===t.type&&(t.source===i.source||t.sourceExpression===i.sourceExpression)})):"camunda:inputParameter"===o?CP(n,(function(e){var t=e.binding,n=t.name;if("camunda:inputParameter"===t.type)return n===r&&t.scriptFormat===i.scriptFormat})):"camunda:outputParameter"===o?CP(n,(function(e){var t=e.binding;if("camunda:outputParameter"===t.type)return t.source===i.source&&t.scriptFormat===i.scriptFormat})):"camunda:property"===o?CP(n,(function(e){var t=e.binding,n=t.name;return"camunda:property"===t.type&&n===r})):"camunda:errorEventDefinition"===o?CP(n,(function(e){var t=i.errorRef,n=e.binding,r=n.errorRef;return"camunda:errorEventDefinition"===n.type&&r===t})):void 0}}function MT(e){return["bpmn:Error"].includes(e)}function DT(e,t){var n,i=ST(e),r=t.binding,o=r.name,a=r.type,s=t.value;return"property"===a?"conditionExpression"===o?i.get("bpmn:conditionExpression").get("bpmn:body")!==s:i.get(o)!==s:"camunda:field"===a?i.get("camunda:string")!==s:"camunda:in"===a?r.expression?i.get("sourceExpression")!==s:i.get("camunda:source")!==s:"camunda:in:businessKey"===a?i.get("camunda:businessKey")!==s:"camunda:out"===a?i.get("camunda:target")!==s:"camunda:inputParameter"===a?r.scriptFormat?(n=i.get("camunda:definition"))&&n.get("camunda:value")!==s:i.get("camunda:value")!==s:"camunda:outputParameter"===a?i.get("camunda:name")!==s:"camunda:property"===a?i.get("camunda:value")!==s:"camunda:errorEventDefinition"===a?i.get("expression")!==s:void 0}function BT(e,t,n){e.registerHandler("propertiesPanel.camunda.changeTemplate",RT),n.on(["commandStack.shape.create.postExecuted"],(function(n){NT(n.context.shape,t,e)})),n.on(["commandStack.connection.create.postExecuted"],(function(n){NT(n.context.connection,t,e)}))}AT.prototype.preExecute=function(e){var t=e.element,n=e.newTemplate,i=e.oldTemplate,r=this;this._updateCamundaModelerTemplate(t,n),n&&(this._updateProperties(t,i,n),this._updateCamundaExecutionListenerProperties(t,n),this._updateCamundaFieldProperties(t,i,n),this._updateCamundaInOutProperties(t,i,n),this._updateCamundaInputOutputParameterProperties(t,i,n),this._updateCamundaPropertyProperties(t,i,n),this._updateCamundaErrorEventDefinitionProperties(t,i,n),Qg(QC(n.scopes),(function(e){r._updateScopeProperties(t,i,e,n)})))},AT.prototype._getOrCreateExtensionElements=function(e){var t=this._bpmnFactory,n=this._modeling,i=ST(e),r=i.get("extensionElements");return r||((r=t.create("bpmn:ExtensionElements",{values:[]})).$parent=i,n.updateProperties(e,{extensionElements:r})),r},AT.prototype._updateCamundaErrorEventDefinitionProperties=function(e,t,n){var i=this._bpmnFactory,r=this._commandStack,o=n.properties.filter((function(e){return"camunda:errorEventDefinition"===e.binding.type}));if(o.length){var a=this._getOrCreateExtensionElements(e),s=dT(e,["camunda:ErrorEventDefinition"]);o.forEach((function(n){var o=jT(t,n),c=o&&kT(a,o),p=n.binding;if(o&&c)DT(c,o)||r.execute("properties-panel.update-businessobject",{element:e,businessObject:c,properties:{expression:n.value}}),uT(s,c);else{var u=PT(ST(e)),l=_T(p.errorRef,u,i),d=wT(p,n.value,l,a,i);r.execute("properties-panel.update-businessobject-list",{element:e,currentObject:u,propertyName:"rootElements",objectsToAdd:[l],objectsToRemove:[]}),r.execute("properties-panel.update-businessobject-list",{element:e,currentObject:a,propertyName:"values",objectsToAdd:[d],objectsToRemove:[]})}})),s.length&&r.execute("properties-panel.update-businessobject-list",{element:e,currentObject:a,propertyName:"values",objectsToAdd:[],objectsToRemove:s})}},AT.prototype._updateCamundaExecutionListenerProperties=function(e,t){var n=this._bpmnFactory,i=this._commandStack,r=t.properties.filter((function(e){return"camunda:executionListener"===e.binding.type}));if(r.length){var o=this._getOrCreateExtensionElements(e),a=dT(e,["camunda:ExecutionListener"]),s=r.map((function(e){var t=e.binding,i=e.value;return mT(t,i,n)}));i.execute("properties-panel.update-businessobject-list",{element:e,currentObject:o,propertyName:"values",objectsToAdd:s,objectsToRemove:a})}},AT.prototype._updateCamundaFieldProperties=function(e,t,n,i){var r=this._bpmnFactory,o=this._commandStack,a=n.properties.filter((function(e){return"camunda:field"===e.binding.type}));if(a.length){i||(i=this._getOrCreateExtensionElements(e));var s=CT(i,["camunda:ExecutionListener","camunda:TaskListener"])?"fields":"values",c=dT(e,["camunda:Field"]);a.forEach((function(n){var a=jT(t,n),p=a&&kT(i,a),u=n.binding;a&&p?(DT(p,a)||o.execute("properties-panel.update-businessobject",{element:e,businessObject:p,properties:{string:n.value}}),uT(c,p)):o.execute("properties-panel.update-businessobject-list",{element:e,currentObject:i,propertyName:s,objectsToAdd:[fT(u,n.value,r)],objectsToRemove:[]})})),c.length&&o.execute("properties-panel.update-businessobject-list",{element:e,currentObject:i,propertyName:s,objectsToAdd:[],objectsToRemove:c})}},AT.prototype._updateCamundaInOutProperties=function(e,t,n){var i=this._bpmnFactory,r=this._commandStack,o=n.properties.filter((function(e){var t=e.binding.type;return"camunda:in"===t||"camunda:in:businessKey"===t||"camunda:out"===t}));if(o.length){var a=this._getOrCreateExtensionElements(DO.getSignalEventDefinition(e)||e),s=dT(a,["camunda:In","camunda:Out"]);o.forEach((function(n){var o,c=jT(t,n),p=c&&c.binding,u=c&&kT(a,c),l=n.value,d=n.binding,h=d.type,m={};c&&u?(DT(u,c)||("camunda:in"===h?d.expression?m["camunda:sourceExpression"]=l:m["camunda:source"]=l:"camunda:in:businessKey"===h?m["camunda:businessKey"]=l:"camunda:out"===h&&(m["camunda:target"]=l)),(p.local&&!d.local||!p.local&&d.local)&&(m.local=d.local),Kg(m)&&r.execute("properties-panel.update-businessobject",{element:e,businessObject:u,properties:m}),uT(s,u)):("camunda:in"===h?o=vT(d,l,i):"camunda:out"===h?o=gT(d,l,i):"camunda:in:businessKey"===h&&(o=yT(d,l,i)),r.execute("properties-panel.update-businessobject-list",{element:e,currentObject:a,propertyName:"values",objectsToAdd:[o],objectsToRemove:[]}))})),s.length&&r.execute("properties-panel.update-businessobject-list",{element:e,currentObject:a,propertyName:"values",objectsToAdd:[],objectsToRemove:s})}},AT.prototype._updateCamundaInputOutputParameterProperties=function(e,t,n,i){var r=this._bpmnFactory,o=this._commandStack,a=n.properties.filter((function(e){var t=e.binding.type;return"camunda:inputParameter"===t||"camunda:outputParameter"===t}));if(a.length){var s;i||(i=this._getOrCreateExtensionElements(e)),OT(i,"camunda:Connector")?(s=i.get("camunda:inputOutput"))||(s=r.create("camunda:InputOutput"),o.execute("properties-panel.update-businessobject",{element:e,businessObject:i,properties:{inputOutput:s}})):(s=lT(i,"camunda:InputOutput"))||(s=r.create("camunda:InputOutput"),o.execute("properties-panel.update-businessobject-list",{element:e,currentObject:i,propertyName:"values",objectsToAdd:[s],objectsToRemove:[]}));var c,p=s.get("camunda:inputParameters")?s.get("camunda:inputParameters").slice():[],u=s.get("camunda:outputParameters")?s.get("camunda:outputParameters").slice():[];a.forEach((function(n){var a,l,d=jT(t,n),h=d&&kT(i,d),m=n.value,f=n.binding,v=f.type;d&&h?(DT(h,d)||(l=OT(h,"camunda:InputParameter")?{value:m}:{name:m},o.execute("properties-panel.update-businessobject",{element:e,businessObject:h,properties:l})),OT(h,"camunda:InputParameter")?uT(p,h):uT(u,h)):("camunda:inputParameter"===v?(c="inputParameters",a=xT(f,m,r)):(c="outputParameters",a=ET(f,m,r)),o.execute("properties-panel.update-businessobject-list",{element:e,currentObject:s,propertyName:c,objectsToAdd:[a],objectsToRemove:[]}))})),p.length&&o.execute("properties-panel.update-businessobject-list",{element:e,currentObject:s,propertyName:"inputParameters",objectsToAdd:[],objectsToRemove:p}),u.length&&o.execute("properties-panel.update-businessobject-list",{element:e,currentObject:s,propertyName:"outputParameters",objectsToAdd:[],objectsToRemove:u})}},AT.prototype._updateCamundaModelerTemplate=function(e,t){this._modeling.updateProperties(e,{"camunda:modelerTemplate":t&&t.id,"camunda:modelerTemplateVersion":t&&t.version})},AT.prototype._updateCamundaPropertyProperties=function(e,t,n,i){var r=this._bpmnFactory,o=this._commandStack,a=n.properties.filter((function(e){return"camunda:property"===e.binding.type}));if(a.length){i=i?this._getOrCreateExtensionElements(i):this._getOrCreateExtensionElements(e);var s=lT(i,"camunda:Properties");s||(s=r.create("camunda:Properties"),o.execute("properties-panel.update-businessobject-list",{element:e,currentObject:i,propertyName:"values",objectsToAdd:[s],objectsToRemove:[]}));var c=s.get("camunda:values")?s.get("camunda:values").slice():[];a.forEach((function(n){var a=jT(t,n),p=a&&kT(i,a),u=n.value,l=n.binding;a&&p?(DT(p,a)||o.execute("properties-panel.update-businessobject",{element:e,businessObject:p,properties:{value:u}}),uT(c,p)):o.execute("properties-panel.update-businessobject-list",{element:e,currentObject:s,propertyName:"values",objectsToAdd:[bT(l,u,r)],objectsToRemove:[]})})),c.length&&o.execute("properties-panel.update-businessobject-list",{element:e,currentObject:s,propertyName:"values",objectsToAdd:[],objectsToRemove:c})}},AT.prototype._updateConditionExpression=function(e,t,n){var i=this._bpmnFactory,r=this._commandStack,o=this._modeling,a=n.binding,s=n.value;if(t){var c=t.binding,p=t.value,u=ST(e).get("bpmn:conditionExpression"),l={};u.get("body")===p&&(l.body=s),u.get("language")===c.scriptFormat&&(l.language=a.scriptFormat),Kg(l).length&&r.execute("properties-panel.update-businessobject",{element:e,businessObject:u,properties:l})}else o.updateProperties(e,{conditionExpression:i.create("bpmn:FormalExpression",{body:s,language:a.scriptFormat})})},AT.prototype._updateProperties=function(e,t,n,i){var r=this,o=this._commandStack,a=n.properties.filter((function(e){return"property"===e.binding.type}));a.length&&(i||(i=ST(e)),a.forEach((function(n){var a,s,c=jT(t,n),p=n.binding.name,u=n.value;if("conditionExpression"===p)r._updateConditionExpression(e,c,n);else{if(a=OT(i,"bpmn:Error")?i:e,c&&DT(a,c))return;(s={})[p]=u,-1!==TT.indexOf(p)&&TT.forEach((function(e){e!==p&&(s[e]=void 0)})),o.execute("properties-panel.update-businessobject",{element:e,businessObject:i,properties:s})}})))},AT.prototype._updateScopeProperties=function(e,t,n,i){var r,o=this._bpmnFactory,a=this._commandStack,s=n.type;(r=function(e,t,n){var i=t.type,r=t.id;if("camunda:Connector"===i)return lT(e,"camunda:Connector");if("bpmn:Error"===i){var o=function(e,t){return CP(e.properties,(function(e){return e.binding.errorRef===t}))}(n,r);if(!o)return;var a=kT(e,o);if(!a)return;return a.errorRef}}(e,n,i))||(r=o.create(s));var c=function(e,t){var n=e.type,i=e.id,r=t&&QC(t.scopes);return r&&CP(r,(function(e){return MT(n)?e.id===i:e.type===n}))}(n,t);if(this._updateProperties(e,c,n,r),this._updateCamundaExecutionListenerProperties(e,n),this._updateCamundaInOutProperties(e,c,n),this._updateCamundaInputOutputParameterProperties(e,c,n,r),this._updateCamundaFieldProperties(e,c,n,r),this._updateCamundaPropertyProperties(e,c,n,r),!MT(s)){var p=this._getOrCreateExtensionElements(e);a.execute("properties-panel.update-businessobject-list",{element:e,currentObject:p,propertyName:"values",objectsToAdd:[r],objectsToRemove:[]})}},BT.$inject=["commandStack","elementTemplates","eventBus"];var IT={__init__:[BT]};function NT(e,t,n){if(!t.get(e)&&t.getDefault(e)){var i={element:e,newTemplate:t.getDefault(e)};n.execute("propertiesPanel.camunda.changeTemplate",i)}}var LT=function(e){return!0===e||!1===e||bg(e)&&"[object Boolean]"==gg(e)},FT=KC.getTemplateId,VT=KS.find,$T=KS.isNumber;function zT(e,t){K_.call(this,e,1100),this.isEntryVisible=function(e,n,i,r){var o=t.get(e);if(FT(e)&&!function(e,t,n){var i=e.id;if("element-template"===t.id)return!0;var r=n&&n.entriesVisible||GT;if(LT(r))return r;var o=r._all||!1,a=r[i];return o?!1!==a:!0===a}(n,r,o))return!1},this.isPropertyEditable=function(e,n,i,r,o){var a=t.get(n);if(a&&!function(e,t){var n;if(function(e){return UT.test(e.id)}(e))return(n=function(e,t){var n,i,r=function(){throw new Error("cannot extract property index for entry <"+t.id+">")},o=t.id.replace("custom-"+e.id+"-","");if(!o.includes("-"))return n=parseInt(o,10),$T(n)||r(),e.properties[n];var a=o.split("-");if(2==a.length&&(i=a[0].replace(/_/g,":"),n=parseInt(a[1],10),i&&$T(n)))return function(e,t){return VT(e,(function(e){return e.type===t}))}(QC(e.scopes),i).properties[n];r()}(t,e))&&!1!==n.editable;return!0}(i,a))return!1}}zT.$inject=["eventBus","elementTemplates"],i(zT,K_);var qT=zT,UT=/^custom-/,GT={_all:!1};var HT=function(e){return(null==e?0:e.length)?Nw(e,1):[]};var WT=function(e){return void 0===e};var KT=function(e,t){return oE(t,(function(t){return e[t]}))};var XT=function(e){return null==e?[]:KT(e,Kg(e))},YT=KC.getTemplateId,JT=KC.getTemplateVersion,ZT=tC.isAny;function QT(){this._templates={}}QT.prototype.get=function(e,t){var n,i=this._templates;return WT(e)?null:iT(e)?(WT(t)&&(t="_"),i[e]&&i[e][t]?i[e][t]:null):(n=e,this.get(YT(n),JT(n)))},QT.prototype.getDefault=function(e){return CP(this.getAll(),(function(t){return ZT(e,t.appliesTo)&&t.isDefault}))||null},QT.prototype.getAll=function(e){return!WT(e)&&this._templates[e]?XT(this._templates[e]):HT(XT(this._templates).map(XT))},QT.prototype.set=function(e){var t=this;this._templates={},e.forEach((function(e){var n=e.id,i=WT(e.version)?"_":e.version;t._templates[n]||(t._templates[n]={}),t._templates[n][i]=e}))};var eA=QT,tA=n((function(e,t){var n;t=e.exports=l,n="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?function(){var e=Array.prototype.slice.call(arguments,0);e.unshift("SEMVER"),console.log.apply(console,e)}:function(){},t.SEMVER_SPEC_VERSION="2.0.0";var i=Number.MAX_SAFE_INTEGER||9007199254740991,r=t.re=[],o=t.src=[],a=t.tokens={},s=0;function c(e){a[e]=s++}c("NUMERICIDENTIFIER"),o[a.NUMERICIDENTIFIER]="0|[1-9]\\d*",c("NUMERICIDENTIFIERLOOSE"),o[a.NUMERICIDENTIFIERLOOSE]="[0-9]+",c("NONNUMERICIDENTIFIER"),o[a.NONNUMERICIDENTIFIER]="\\d*[a-zA-Z-][a-zA-Z0-9-]*",c("MAINVERSION"),o[a.MAINVERSION]="("+o[a.NUMERICIDENTIFIER]+")\\.("+o[a.NUMERICIDENTIFIER]+")\\.("+o[a.NUMERICIDENTIFIER]+")",c("MAINVERSIONLOOSE"),o[a.MAINVERSIONLOOSE]="("+o[a.NUMERICIDENTIFIERLOOSE]+")\\.("+o[a.NUMERICIDENTIFIERLOOSE]+")\\.("+o[a.NUMERICIDENTIFIERLOOSE]+")",c("PRERELEASEIDENTIFIER"),o[a.PRERELEASEIDENTIFIER]="(?:"+o[a.NUMERICIDENTIFIER]+"|"+o[a.NONNUMERICIDENTIFIER]+")",c("PRERELEASEIDENTIFIERLOOSE"),o[a.PRERELEASEIDENTIFIERLOOSE]="(?:"+o[a.NUMERICIDENTIFIERLOOSE]+"|"+o[a.NONNUMERICIDENTIFIER]+")",c("PRERELEASE"),o[a.PRERELEASE]="(?:-("+o[a.PRERELEASEIDENTIFIER]+"(?:\\."+o[a.PRERELEASEIDENTIFIER]+")*))",c("PRERELEASELOOSE"),o[a.PRERELEASELOOSE]="(?:-?("+o[a.PRERELEASEIDENTIFIERLOOSE]+"(?:\\."+o[a.PRERELEASEIDENTIFIERLOOSE]+")*))",c("BUILDIDENTIFIER"),o[a.BUILDIDENTIFIER]="[0-9A-Za-z-]+",c("BUILD"),o[a.BUILD]="(?:\\+("+o[a.BUILDIDENTIFIER]+"(?:\\."+o[a.BUILDIDENTIFIER]+")*))",c("FULL"),c("FULLPLAIN"),o[a.FULLPLAIN]="v?"+o[a.MAINVERSION]+o[a.PRERELEASE]+"?"+o[a.BUILD]+"?",o[a.FULL]="^"+o[a.FULLPLAIN]+"$",c("LOOSEPLAIN"),o[a.LOOSEPLAIN]="[v=\\s]*"+o[a.MAINVERSIONLOOSE]+o[a.PRERELEASELOOSE]+"?"+o[a.BUILD]+"?",c("LOOSE"),o[a.LOOSE]="^"+o[a.LOOSEPLAIN]+"$",c("GTLT"),o[a.GTLT]="((?:<|>)?=?)",c("XRANGEIDENTIFIERLOOSE"),o[a.XRANGEIDENTIFIERLOOSE]=o[a.NUMERICIDENTIFIERLOOSE]+"|x|X|\\*",c("XRANGEIDENTIFIER"),o[a.XRANGEIDENTIFIER]=o[a.NUMERICIDENTIFIER]+"|x|X|\\*",c("XRANGEPLAIN"),o[a.XRANGEPLAIN]="[v=\\s]*("+o[a.XRANGEIDENTIFIER]+")(?:\\.("+o[a.XRANGEIDENTIFIER]+")(?:\\.("+o[a.XRANGEIDENTIFIER]+")(?:"+o[a.PRERELEASE]+")?"+o[a.BUILD]+"?)?)?",c("XRANGEPLAINLOOSE"),o[a.XRANGEPLAINLOOSE]="[v=\\s]*("+o[a.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+o[a.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+o[a.XRANGEIDENTIFIERLOOSE]+")(?:"+o[a.PRERELEASELOOSE]+")?"+o[a.BUILD]+"?)?)?",c("XRANGE"),o[a.XRANGE]="^"+o[a.GTLT]+"\\s*"+o[a.XRANGEPLAIN]+"$",c("XRANGELOOSE"),o[a.XRANGELOOSE]="^"+o[a.GTLT]+"\\s*"+o[a.XRANGEPLAINLOOSE]+"$",c("COERCE"),o[a.COERCE]="(^|[^\\d])(\\d{1,16})(?:\\.(\\d{1,16}))?(?:\\.(\\d{1,16}))?(?:$|[^\\d])",c("COERCERTL"),r[a.COERCERTL]=new RegExp(o[a.COERCE],"g"),c("LONETILDE"),o[a.LONETILDE]="(?:~>?)",c("TILDETRIM"),o[a.TILDETRIM]="(\\s*)"+o[a.LONETILDE]+"\\s+",r[a.TILDETRIM]=new RegExp(o[a.TILDETRIM],"g");c("TILDE"),o[a.TILDE]="^"+o[a.LONETILDE]+o[a.XRANGEPLAIN]+"$",c("TILDELOOSE"),o[a.TILDELOOSE]="^"+o[a.LONETILDE]+o[a.XRANGEPLAINLOOSE]+"$",c("LONECARET"),o[a.LONECARET]="(?:\\^)",c("CARETTRIM"),o[a.CARETTRIM]="(\\s*)"+o[a.LONECARET]+"\\s+",r[a.CARETTRIM]=new RegExp(o[a.CARETTRIM],"g");c("CARET"),o[a.CARET]="^"+o[a.LONECARET]+o[a.XRANGEPLAIN]+"$",c("CARETLOOSE"),o[a.CARETLOOSE]="^"+o[a.LONECARET]+o[a.XRANGEPLAINLOOSE]+"$",c("COMPARATORLOOSE"),o[a.COMPARATORLOOSE]="^"+o[a.GTLT]+"\\s*("+o[a.LOOSEPLAIN]+")$|^$",c("COMPARATOR"),o[a.COMPARATOR]="^"+o[a.GTLT]+"\\s*("+o[a.FULLPLAIN]+")$|^$",c("COMPARATORTRIM"),o[a.COMPARATORTRIM]="(\\s*)"+o[a.GTLT]+"\\s*("+o[a.LOOSEPLAIN]+"|"+o[a.XRANGEPLAIN]+")",r[a.COMPARATORTRIM]=new RegExp(o[a.COMPARATORTRIM],"g");c("HYPHENRANGE"),o[a.HYPHENRANGE]="^\\s*("+o[a.XRANGEPLAIN]+")\\s+-\\s+("+o[a.XRANGEPLAIN]+")\\s*$",c("HYPHENRANGELOOSE"),o[a.HYPHENRANGELOOSE]="^\\s*("+o[a.XRANGEPLAINLOOSE]+")\\s+-\\s+("+o[a.XRANGEPLAINLOOSE]+")\\s*$",c("STAR"),o[a.STAR]="(<|>)?=?\\s*\\*";for(var p=0;p<s;p++)n(p,o[p]),r[p]||(r[p]=new RegExp(o[p]));function u(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof l)return e;if("string"!=typeof e)return null;if(e.length>256)return null;if(!(t.loose?r[a.LOOSE]:r[a.FULL]).test(e))return null;try{return new l(e,t)}catch(e){return null}}function l(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof l){if(e.loose===t.loose)return e;e=e.version}else if("string"!=typeof e)throw new TypeError("Invalid Version: "+e);if(e.length>256)throw new TypeError("version is longer than 256 characters");if(!(this instanceof l))return new l(e,t);n("SemVer",e,t),this.options=t,this.loose=!!t.loose;var o=e.trim().match(t.loose?r[a.LOOSE]:r[a.FULL]);if(!o)throw new TypeError("Invalid Version: "+e);if(this.raw=e,this.major=+o[1],this.minor=+o[2],this.patch=+o[3],this.major>i||this.major<0)throw new TypeError("Invalid major version");if(this.minor>i||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>i||this.patch<0)throw new TypeError("Invalid patch version");o[4]?this.prerelease=o[4].split(".").map((function(e){if(/^[0-9]+$/.test(e)){var t=+e;if(t>=0&&t<i)return t}return e})):this.prerelease=[],this.build=o[5]?o[5].split("."):[],this.format()}t.parse=u,t.valid=function(e,t){var n=u(e,t);return n?n.version:null},t.clean=function(e,t){var n=u(e.trim().replace(/^[=v]+/,""),t);return n?n.version:null},t.SemVer=l,l.prototype.format=function(){return this.version=this.major+"."+this.minor+"."+this.patch,this.prerelease.length&&(this.version+="-"+this.prerelease.join(".")),this.version},l.prototype.toString=function(){return this.version},l.prototype.compare=function(e){return n("SemVer.compare",this.version,this.options,e),e instanceof l||(e=new l(e,this.options)),this.compareMain(e)||this.comparePre(e)},l.prototype.compareMain=function(e){return e instanceof l||(e=new l(e,this.options)),h(this.major,e.major)||h(this.minor,e.minor)||h(this.patch,e.patch)},l.prototype.comparePre=function(e){if(e instanceof l||(e=new l(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;var t=0;do{var i=this.prerelease[t],r=e.prerelease[t];if(n("prerelease compare",t,i,r),void 0===i&&void 0===r)return 0;if(void 0===r)return 1;if(void 0===i)return-1;if(i!==r)return h(i,r)}while(++t)},l.prototype.compareBuild=function(e){e instanceof l||(e=new l(e,this.options));var t=0;do{var i=this.build[t],r=e.build[t];if(n("prerelease compare",t,i,r),void 0===i&&void 0===r)return 0;if(void 0===r)return 1;if(void 0===i)return-1;if(i!==r)return h(i,r)}while(++t)},l.prototype.inc=function(e,t){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t),this.inc("pre",t);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t),this.inc("pre",t);break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":if(0===this.prerelease.length)this.prerelease=[0];else{for(var n=this.prerelease.length;--n>=0;)"number"==typeof this.prerelease[n]&&(this.prerelease[n]++,n=-2);-1===n&&this.prerelease.push(0)}t&&(this.prerelease[0]===t?isNaN(this.prerelease[1])&&(this.prerelease=[t,0]):this.prerelease=[t,0]);break;default:throw new Error("invalid increment argument: "+e)}return this.format(),this.raw=this.version,this},t.inc=function(e,t,n,i){"string"==typeof n&&(i=n,n=void 0);try{return new l(e,n).inc(t,i).version}catch(e){return null}},t.diff=function(e,t){if(y(e,t))return null;var n=u(e),i=u(t),r="";if(n.prerelease.length||i.prerelease.length){r="pre";var o="prerelease"}for(var a in n)if(("major"===a||"minor"===a||"patch"===a)&&n[a]!==i[a])return r+a;return o},t.compareIdentifiers=h;var d=/^[0-9]+$/;function h(e,t){var n=d.test(e),i=d.test(t);return n&&i&&(e=+e,t=+t),e===t?0:n&&!i?-1:i&&!n?1:e<t?-1:1}function m(e,t,n){return new l(e,n).compare(new l(t,n))}function f(e,t,n){return m(e,t,n)>0}function v(e,t,n){return m(e,t,n)<0}function y(e,t,n){return 0===m(e,t,n)}function g(e,t,n){return 0!==m(e,t,n)}function b(e,t,n){return m(e,t,n)>=0}function x(e,t,n){return m(e,t,n)<=0}function E(e,t,n,i){switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e===n;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e!==n;case"":case"=":case"==":return y(e,n,i);case"!=":return g(e,n,i);case">":return f(e,n,i);case">=":return b(e,n,i);case"<":return v(e,n,i);case"<=":return x(e,n,i);default:throw new TypeError("Invalid operator: "+t)}}function w(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof w){if(e.loose===!!t.loose)return e;e=e.value}if(!(this instanceof w))return new w(e,t);n("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===_?this.value="":this.value=this.operator+this.semver.version,n("comp",this)}t.rcompareIdentifiers=function(e,t){return h(t,e)},t.major=function(e,t){return new l(e,t).major},t.minor=function(e,t){return new l(e,t).minor},t.patch=function(e,t){return new l(e,t).patch},t.compare=m,t.compareLoose=function(e,t){return m(e,t,!0)},t.compareBuild=function(e,t,n){var i=new l(e,n),r=new l(t,n);return i.compare(r)||i.compareBuild(r)},t.rcompare=function(e,t,n){return m(t,e,n)},t.sort=function(e,n){return e.sort((function(e,i){return t.compareBuild(e,i,n)}))},t.rsort=function(e,n){return e.sort((function(e,i){return t.compareBuild(i,e,n)}))},t.gt=f,t.lt=v,t.eq=y,t.neq=g,t.gte=b,t.lte=x,t.cmp=E,t.Comparator=w;var _={};function P(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof P)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new P(e.raw,t);if(e instanceof w)return new P(e.value,t);if(!(this instanceof P))return new P(e,t);if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e,this.set=e.split(/\s*\|\|\s*/).map((function(e){return this.parseRange(e.trim())}),this).filter((function(e){return e.length})),!this.set.length)throw new TypeError("Invalid SemVer Range: "+e);this.format()}function S(e,t){for(var n=!0,i=e.slice(),r=i.pop();n&&i.length;)n=i.every((function(e){return r.intersects(e,t)})),r=i.pop();return n}function O(e){return!e||"x"===e.toLowerCase()||"*"===e}function C(e,t,n,i,r,o,a,s,c,p,u,l,d){return((t=O(n)?"":O(i)?">="+n+".0.0":O(r)?">="+n+"."+i+".0":">="+t)+" "+(s=O(c)?"":O(p)?"<"+(+c+1)+".0.0":O(u)?"<"+c+"."+(+p+1)+".0":l?"<="+c+"."+p+"."+u+"-"+l:"<="+s)).trim()}function T(e,t,i){for(var r=0;r<e.length;r++)if(!e[r].test(t))return!1;if(t.prerelease.length&&!i.includePrerelease){for(r=0;r<e.length;r++)if(n(e[r].semver),e[r].semver!==_&&e[r].semver.prerelease.length>0){var o=e[r].semver;if(o.major===t.major&&o.minor===t.minor&&o.patch===t.patch)return!0}return!1}return!0}function A(e,t,n){try{t=new P(t,n)}catch(e){return!1}return t.test(e)}function R(e,t,n,i){var r,o,a,s,c;switch(e=new l(e,i),t=new P(t,i),n){case">":r=f,o=x,a=v,s=">",c=">=";break;case"<":r=v,o=b,a=f,s="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(A(e,t,i))return!1;for(var p=0;p<t.set.length;++p){var u=t.set[p],d=null,h=null;if(u.forEach((function(e){e.semver===_&&(e=new w(">=0.0.0")),d=d||e,h=h||e,r(e.semver,d.semver,i)?d=e:a(e.semver,h.semver,i)&&(h=e)})),d.operator===s||d.operator===c)return!1;if((!h.operator||h.operator===s)&&o(e,h.semver))return!1;if(h.operator===c&&a(e,h.semver))return!1}return!0}w.prototype.parse=function(e){var t=this.options.loose?r[a.COMPARATORLOOSE]:r[a.COMPARATOR],n=e.match(t);if(!n)throw new TypeError("Invalid comparator: "+e);this.operator=void 0!==n[1]?n[1]:"","="===this.operator&&(this.operator=""),n[2]?this.semver=new l(n[2],this.options.loose):this.semver=_},w.prototype.toString=function(){return this.value},w.prototype.test=function(e){if(n("Comparator.test",e,this.options.loose),this.semver===_||e===_)return!0;if("string"==typeof e)try{e=new l(e,this.options)}catch(e){return!1}return E(e,this.operator,this.semver,this.options)},w.prototype.intersects=function(e,t){if(!(e instanceof w))throw new TypeError("a Comparator is required");var n;if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),""===this.operator)return""===this.value||(n=new P(e.value,t),A(this.value,n,t));if(""===e.operator)return""===e.value||(n=new P(this.value,t),A(e.semver,n,t));var i=!(">="!==this.operator&&">"!==this.operator||">="!==e.operator&&">"!==e.operator),r=!("<="!==this.operator&&"<"!==this.operator||"<="!==e.operator&&"<"!==e.operator),o=this.semver.version===e.semver.version,a=!(">="!==this.operator&&"<="!==this.operator||">="!==e.operator&&"<="!==e.operator),s=E(this.semver,"<",e.semver,t)&&(">="===this.operator||">"===this.operator)&&("<="===e.operator||"<"===e.operator),c=E(this.semver,">",e.semver,t)&&("<="===this.operator||"<"===this.operator)&&(">="===e.operator||">"===e.operator);return i||r||o&&a||s||c},t.Range=P,P.prototype.format=function(){return this.range=this.set.map((function(e){return e.join(" ").trim()})).join("||").trim(),this.range},P.prototype.toString=function(){return this.range},P.prototype.parseRange=function(e){var t=this.options.loose;e=e.trim();var i=t?r[a.HYPHENRANGELOOSE]:r[a.HYPHENRANGE];e=e.replace(i,C),n("hyphen replace",e),e=e.replace(r[a.COMPARATORTRIM],"$1$2$3"),n("comparator trim",e,r[a.COMPARATORTRIM]),e=(e=(e=e.replace(r[a.TILDETRIM],"$1~")).replace(r[a.CARETTRIM],"$1^")).split(/\s+/).join(" ");var o=t?r[a.COMPARATORLOOSE]:r[a.COMPARATOR],s=e.split(" ").map((function(e){return function(e,t){return n("comp",e,t),e=function(e,t){return e.trim().split(/\s+/).map((function(e){return function(e,t){n("caret",e,t);var i=t.loose?r[a.CARETLOOSE]:r[a.CARET];return e.replace(i,(function(t,i,r,o,a){var s;return n("caret",e,t,i,r,o,a),O(i)?s="":O(r)?s=">="+i+".0.0 <"+(+i+1)+".0.0":O(o)?s="0"===i?">="+i+"."+r+".0 <"+i+"."+(+r+1)+".0":">="+i+"."+r+".0 <"+(+i+1)+".0.0":a?(n("replaceCaret pr",a),s="0"===i?"0"===r?">="+i+"."+r+"."+o+"-"+a+" <"+i+"."+r+"."+(+o+1):">="+i+"."+r+"."+o+"-"+a+" <"+i+"."+(+r+1)+".0":">="+i+"."+r+"."+o+"-"+a+" <"+(+i+1)+".0.0"):(n("no pr"),s="0"===i?"0"===r?">="+i+"."+r+"."+o+" <"+i+"."+r+"."+(+o+1):">="+i+"."+r+"."+o+" <"+i+"."+(+r+1)+".0":">="+i+"."+r+"."+o+" <"+(+i+1)+".0.0"),n("caret return",s),s}))}(e,t)})).join(" ")}(e,t),n("caret",e),e=function(e,t){return e.trim().split(/\s+/).map((function(e){return function(e,t){var i=t.loose?r[a.TILDELOOSE]:r[a.TILDE];return e.replace(i,(function(t,i,r,o,a){var s;return n("tilde",e,t,i,r,o,a),O(i)?s="":O(r)?s=">="+i+".0.0 <"+(+i+1)+".0.0":O(o)?s=">="+i+"."+r+".0 <"+i+"."+(+r+1)+".0":a?(n("replaceTilde pr",a),s=">="+i+"."+r+"."+o+"-"+a+" <"+i+"."+(+r+1)+".0"):s=">="+i+"."+r+"."+o+" <"+i+"."+(+r+1)+".0",n("tilde return",s),s}))}(e,t)})).join(" ")}(e,t),n("tildes",e),e=function(e,t){return n("replaceXRanges",e,t),e.split(/\s+/).map((function(e){return function(e,t){e=e.trim();var i=t.loose?r[a.XRANGELOOSE]:r[a.XRANGE];return e.replace(i,(function(i,r,o,a,s,c){n("xRange",e,i,r,o,a,s,c);var p=O(o),u=p||O(a),l=u||O(s),d=l;return"="===r&&d&&(r=""),c=t.includePrerelease?"-0":"",p?i=">"===r||"<"===r?"<0.0.0-0":"*":r&&d?(u&&(a=0),s=0,">"===r?(r=">=",u?(o=+o+1,a=0,s=0):(a=+a+1,s=0)):"<="===r&&(r="<",u?o=+o+1:a=+a+1),i=r+o+"."+a+"."+s+c):u?i=">="+o+".0.0"+c+" <"+(+o+1)+".0.0"+c:l&&(i=">="+o+"."+a+".0"+c+" <"+o+"."+(+a+1)+".0"+c),n("xRange return",i),i}))}(e,t)})).join(" ")}(e,t),n("xrange",e),e=function(e,t){return n("replaceStars",e,t),e.trim().replace(r[a.STAR],"")}(e,t),n("stars",e),e}(e,this.options)}),this).join(" ").split(/\s+/);return this.options.loose&&(s=s.filter((function(e){return!!e.match(o)}))),s=s.map((function(e){return new w(e,this.options)}),this)},P.prototype.intersects=function(e,t){if(!(e instanceof P))throw new TypeError("a Range is required");return this.set.some((function(n){return S(n,t)&&e.set.some((function(e){return S(e,t)&&n.every((function(n){return e.every((function(e){return n.intersects(e,t)}))}))}))}))},t.toComparators=function(e,t){return new P(e,t).set.map((function(e){return e.map((function(e){return e.value})).join(" ").trim().split(" ")}))},P.prototype.test=function(e){if(!e)return!1;if("string"==typeof e)try{e=new l(e,this.options)}catch(e){return!1}for(var t=0;t<this.set.length;t++)if(T(this.set[t],e,this.options))return!0;return!1},t.satisfies=A,t.maxSatisfying=function(e,t,n){var i=null,r=null;try{var o=new P(t,n)}catch(e){return null}return e.forEach((function(e){o.test(e)&&(i&&-1!==r.compare(e)||(r=new l(i=e,n)))})),i},t.minSatisfying=function(e,t,n){var i=null,r=null;try{var o=new P(t,n)}catch(e){return null}return e.forEach((function(e){o.test(e)&&(i&&1!==r.compare(e)||(r=new l(i=e,n)))})),i},t.minVersion=function(e,t){e=new P(e,t);var n=new l("0.0.0");if(e.test(n))return n;if(n=new l("0.0.0-0"),e.test(n))return n;n=null;for(var i=0;i<e.set.length;++i){e.set[i].forEach((function(e){var t=new l(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":n&&!f(n,t)||(n=t);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+e.operator)}}))}if(n&&e.test(n))return n;return null},t.validRange=function(e,t){try{return new P(e,t).range||"*"}catch(e){return null}},t.ltr=function(e,t,n){return R(e,t,"<",n)},t.gtr=function(e,t,n){return R(e,t,">",n)},t.outside=R,t.prerelease=function(e,t){var n=u(e,t);return n&&n.prerelease.length?n.prerelease:null},t.intersects=function(e,t,n){return e=new P(e,n),t=new P(t,n),e.intersects(t)},t.coerce=function(e,t){if(e instanceof l)return e;"number"==typeof e&&(e=String(e));if("string"!=typeof e)return null;var n=null;if((t=t||{}).rtl){for(var i;(i=r[a.COERCERTL].exec(e))&&(!n||n.index+n[0].length!==e.length);)n&&i.index+i[0].length===n.index+n[0].length||(n=i),r[a.COERCERTL].lastIndex=i.index+i[1].length+i[2].length;r[a.COERCERTL].lastIndex=-1}else n=e.match(r[a.COERCE]);if(null===n)return null;return u(n[2]+"."+(n[3]||"0")+"."+(n[4]||"0"),t)}})),nA=("a".charCodeAt(),["number","bigint","boolean","string","object"]);function iA(e){return nA.indexOf(typeof e)>=0}var rA=/"|\\/g,oA=/[\b]/g,aA=/\f/g,sA=/\n/g,cA=/\r/g,pA=/\t/g;function uA(e){return'"'+(e=e.replace(rA,"\\$&").replace(aA,"\\f").replace(oA,"\\b").replace(sA,"\\n").replace(cA,"\\r").replace(pA,"\\t"))+'"'}var lA=/~/g,dA=/\//g;function hA(e){return e.replace(lA,"~0").replace(dA,"~1")}var mA=function(e,t,n){if(iA(e)){var i,r,o=0,a="object"==typeof n?n.space:n;switch(typeof a){case"number":var s=a>10?10:a<0?0:Math.floor(a);a=s&&g(s," "),i=s,r=s;break;case"string":a=a.slice(0,10),i=0,r=0;for(var c=0;c<a.length;c++){switch(a[c]){case" ":r++;break;case"\t":r+=4;break;case"\r":r=0;break;case"\n":r=0,o++;break;default:throw new Error("whitespace characters not allowed in JSON")}i++}break;default:a=void 0}var p="",u={},l=0,d=0,h=0,m=n&&n.es6&&"function"==typeof Map;return function e(t,n,i){switch(y(i,"value"),typeof t){case"number":case"bigint":case"boolean":f(""+t);break;case"string":f(uA(t));break;case"object":null===t?f("null"):"function"==typeof t.toJSON?f(uA(t.toJSON())):Array.isArray(t)?r():m?t.constructor.BYTES_PER_ELEMENT?r():t instanceof Map?s():t instanceof Set?s(!0):o():o()}function r(){if(t.length){f("[");for(var r=n+1,o=0;o<t.length;o++){o&&f(","),v(r);var a=iA(t[o])?t[o]:null;e(a,r,i+"/"+o)}v(n),f("]")}else f("[]")}function o(){var r=Object.keys(t);if(r.length){f("{");for(var o=n+1,s=0;s<r.length;s++){var c=r[s],p=t[c];if(iA(p)){s&&f(",");var u=i+"/"+hA(c);v(o),y(u,"key"),f(uA(c)),y(u,"keyEnd"),f(":"),a&&f(" "),e(p,o,u)}}v(n),f("}")}else f("{}")}function s(r){if(t.size){f("{");for(var o=n+1,s=!0,c=t.entries(),p=c.next();!p.done;){var u=p.value,l=u[0],d=!!r||u[1];if(iA(d)){s||f(","),s=!1;var h=i+"/"+hA(l);v(o),y(h,"key"),f(uA(l)),y(h,"keyEnd"),f(":"),a&&f(" "),e(d,o,h)}p=c.next()}v(n),f("}")}else f("{}")}y(i,"valueEnd")}(e,0,""),{json:p,pointers:u}}function f(e){d+=e.length,h+=e.length,p+=e}function v(e){if(a){for(p+="\n"+g(e,a),l++,d=0;e--;)o?(l+=o,d=r):d+=r,h+=i;h+=1}}function y(e,t){u[e]=u[e]||{},u[e][t]={line:l,column:d,pos:h}}function g(e,t){return Array(e+1).join(t)}},fA=function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;var i,r,o;if(Array.isArray(t)){if((i=t.length)!=n.length)return!1;for(r=i;0!=r--;)if(!e(t[r],n[r]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((i=(o=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(r=i;0!=r--;)if(!Object.prototype.hasOwnProperty.call(n,o[r]))return!1;for(r=i;0!=r--;){var a=o[r];if(!e(t[a],n[a]))return!1}return!0}return t!=t&&n!=n},vA=OA,yA=OA;const gA={type:"object",required:["name","id","appliesTo","properties"],properties:{name:{$id:"#/name",type:"string",title:"element template name",description:"The name of the element template"},id:{$id:"#/id",type:"string",title:"element template id",description:"The identifier of the element template"},description:{$id:"#/description",type:"string",title:"element template description",description:"The description of the element template"},version:{$id:"#/version",type:"number",title:"element template version",description:"The version of the element template"},isDefault:{$id:"#/isDefault",type:"boolean",title:"element template is default",description:"Indicates whether the element template is a default template"},appliesTo:{$id:"#/appliesTo",type:"array",title:"element template applies to",description:"The definition for which element types the element template can be applied",default:[],items:{$id:"#/appliesTo/items",type:"string",pattern:"^(.*?:)",errorMessage:{pattern:'invalid item for "appliesTo", should contain namespaced property, example: "bpmn:Task"'}}},properties:{$ref:"#/definitions/properties",$id:"#/properties"},metadata:{$id:"#/metadata",type:"object",title:"element template metadata",description:"Some metadata for further configuration"},scopes:{oneOf:[{$ref:"#/definitions/scopes_old"},{$ref:"#/definitions/scopes"}]},entriesVisible:{$id:"#/entriesVisible",deprecated:!0,type:["object","boolean"],title:"element template entries visible",description:"@Deprecated - Select which entries are visible in the properties panel"}},errorMessage:{required:{name:"missing template name",id:"missing template id",appliesTo:"missing appliesTo=[]",properties:"missing properties=[]"}}},bA={type:"array",title:"element template properties",description:"The properties of the element template",default:[],items:{$id:"#/properties/property",type:"object",title:"element template property",description:"A property defined for the element template",default:{},required:["binding"],errorMessage:{required:{binding:'missing binding for property "${0#}"'}},allOf:[{if:{properties:{type:{const:"Dropdown"}},required:["type"]},then:{required:["choices"],errorMessage:'must provide choices=[] with "Dropdown" type'}},{if:{properties:{binding:{properties:{type:{const:"property"}},required:["type"]}},required:["binding"]},then:{properties:{type:{enum:["String","Text","Hidden","Dropdown","Boolean"],errorMessage:'invalid property type ${0} for binding type "property"; must be any of { String, Text, Hidden, Dropdown, Boolean }'}}}},{if:{properties:{binding:{properties:{type:{const:"camunda:executionListener"}},required:["type"]}},required:["binding"]},then:{properties:{type:{enum:["Hidden"],errorMessage:'invalid property type ${1/type} for binding type "camunda:executionListener"; must be "Hidden"'}}}},{if:{properties:{binding:{properties:{type:{enum:["camunda:property","camunda:outputParameter","camunda:in","camunda:in:businessKey","camunda:out","camunda:errorEventDefinition"]}},required:["type"]}},required:["binding"]},then:{properties:{type:{enum:["String","Hidden","Dropdown"],errorMessage:"invalid property type ${0} for binding type ${1/binding/type}; must be any of { String, Hidden, Dropdown }"}}}},{if:{properties:{binding:{properties:{type:{enum:["camunda:inputParameter","camunda:field"]}},required:["type"]}},required:["binding"]},then:{properties:{type:{enum:["String","Text","Hidden","Dropdown"],errorMessage:"invalid property type ${0} for binding type ${1/binding/type}; must be any of { String, Text, Hidden, Dropdown }"}}}}],properties:{value:{$id:"#/properties/property/value",type:["string","boolean"],title:"property value",description:"The value of the control field for the property"},description:{$id:"#/properties/property/description",type:"string",title:"property description",description:"The description of the control field"},label:{$id:"#/properties/property/label",type:"string",title:"property label",description:"The label of the control field for the property"},type:{$id:"#/properties/property/type",type:"string",title:"property type",description:"The type of the control field"},editable:{$id:"#/properties/property/editable",type:"boolean",title:"property editable",description:"Indicates whether the property is editable or not"},choices:{$id:"#/properties/property/choices",type:"array",title:"property choices",description:"The choices for dropdown properties",items:{$id:"#/properties/property/choices/item",type:"object",properties:{name:{$id:"#/properties/property/choices/item/name",type:"string",title:"choice name",description:"The name of the choice"},value:{$id:"#/properties/property/choices/item/value",type:"string",title:"choice value",description:"The value of the choice"}},required:["value","name"],errorMessage:'{ name, value } must be specified for "Dropdown" choices'}},binding:{$id:"#/properties/property/binding",type:"object",title:"property binding",description:"A binding to a BPMN 2.0 property",required:["type"],allOf:[{if:{properties:{type:{enum:["property","camunda:property","camunda:inputParameter","camunda:field"]}},required:["type"]},then:{required:["name"],errorMessage:"property.binding ${0/type} requires name"}},{if:{properties:{type:{const:"camunda:outputParameter"}},required:["type"]},then:{required:["source"],errorMessage:"property.binding ${0/type} requires source"}},{if:{properties:{type:{const:"camunda:in"}},required:["type"]},then:{anyOf:[{required:["variables"]},{required:["target"]}],errorMessage:"property.binding ${0/type} requires variables, target, or both"}},{if:{properties:{type:{const:"camunda:out"}},required:["type"]},then:{oneOf:[{required:["variables"],not:{anyOf:[{required:["source"]},{required:["sourceExpression"]}]}},{required:["source"],not:{anyOf:[{required:["variables"]},{required:["sourceExpression"]}]}},{required:["sourceExpression"],not:{anyOf:[{required:["variables"]},{required:["source"]}]}},{required:["variables","sourceExpression"],not:{required:["source"]}},{required:["variables","source"],not:{required:["sourceExpression"]}}],errorMessage:"property.binding ${0/type} requires one of the following: variables, sourceExpression, source, (sourceExpression and variables), or (source and variables)"}},{if:{properties:{type:{const:"camunda:errorEventDefinition"}},required:["type"]},then:{oneOf:[{required:["errorRef"]}],errorMessage:"property.binding ${0/type} requires errorRef"}}],properties:{type:{$id:"#/properties/property/binding/type",type:"string",title:"property binding type",enum:["property","camunda:property","camunda:inputParameter","camunda:outputParameter","camunda:in","camunda:out","camunda:in:businessKey","camunda:executionListener","camunda:field","camunda:errorEventDefinition"],errorMessage:"invalid property.binding type ${0}; must be any of { property, camunda:property, camunda:inputParameter, camunda:outputParameter, camunda:in, camunda:out, camunda:in:businessKey, camunda:executionListener, camunda:field, camunda:errorEventDefinition }",description:"The type of the property binding"},name:{$id:"#/properties/property/binding/name",type:"string",title:"property binding name",description:"The name of binding xml property"},event:{$id:"#/properties/property/binding/event",type:"string",title:"property binding event",description:"The event type of an execution listener binding"},scriptFormat:{$id:"#/properties/property/binding/scriptFormat",type:"string",title:"property binding script format",description:"The format of a script property binding (camunda:outputParameter, camunda:inputParameter)"},source:{$id:"#/properties/property/binding/source",type:"string",title:"property binding source",description:"The source value of a property binding (camunda:outputParameter, camunda:out)"},target:{$id:"#/properties/property/binding/target",type:"string",title:"property binding target",description:"The target value to be mapped to (camunda:in)"},expression:{$id:"#/properties/property/binding/expression",type:"boolean",title:"property binding expression",description:"True indicates that the control field value is an expression (camunda:in, camunda:field)"},variables:{$id:"#/properties/property/binding/variables",type:"string",title:"property binding variables",enum:["all","local"],description:"Either all or local indicating the variable mapping (camunda:in)"},sourceExpression:{$id:"#/properties/property/binding/sourceExpression",type:"string",title:"property binding source expression",description:"The string containing the expression for the source attribute (camunda:out)"}}},constraints:{$id:"#/properties/property/constraints",type:"object",title:"property constraints",description:"The validation constraints",properties:{notEmpty:{$id:"#/properties/property/constraints/notEmpty",type:"boolean",title:"property constraints not empty",description:"The control field must not be empty"},minLength:{$id:"#/properties/property/constraints/minLength",type:"number",title:"property constraints min length",description:"The minimal length for the control field value"},maxLength:{$id:"#/properties/property/constraints/maxLength",type:"number",title:"property constraints max length",description:"The maximal length for the control field value"},pattern:{$id:"#/properties/property/constraints/pattern",title:"property constraints pattern",description:"A regular expression pattern for the constraints",oneOf:[{type:"object",properties:{value:{$id:"#/properties/property/constraints/pattern/value",type:"string",title:"property constraints pattern value",description:"The regular expression of the pattern constraint"},message:{$id:"#/properties/property/constraints/pattern/message",type:"string",title:"property constraints pattern message",description:"The validation message of the pattern constraint"}}},{type:"string"}]}}}}}},xA=new RegExp("^(.*?:)","u"),EA={required:"missingProperty",dependencies:"property",dependentRequired:"property"};function wA(e,{dataPath:t="",parentData:n,parentDataProperty:i,rootData:r=e}={}){let o=null,a=0;if(e&&"object"==typeof e&&!Array.isArray(e)){for(const n in e)if("camunda:Connector"!==n){const e={keyword:"not",dataPath:t+"/"+n.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/additionalProperties/not",params:{},message:"should NOT be valid"};if(null===o?o=[e]:o.push(e),a++,a>0){const e=[];for(const i of o)"errorMessage"===i.keyword||i.emUsed||i.dataPath!==t+"/"+n.replace(/~/g,"~0").replace(/\//g,"~1")&&(0!==i.dataPath.indexOf(t+"/"+n.replace(/~/g,"~0").replace(/\//g,"~1"))||"/"!==i.dataPath[t+"/"+n.replace(/~/g,"~0").replace(/\//g,"~1").length])||0!==i.schemaPath.indexOf("#/additionalProperties")||"/"!==i.schemaPath["#/additionalProperties".length]||(e.push(i),i.emUsed=!0);if(e.length){const i={keyword:"errorMessage",dataPath:t+"/"+n.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/additionalProperties/errorMessage",params:{errors:e},message:"invalid scope "+JSON.stringify(n)+', object descriptor is only supported for "camunda:Connector"'};null===o?o=[i]:o.push(i),a++}const i=[];for(const e of o)e.emUsed||i.push(e);o=i,a=i.length}}if(void 0!==e["camunda:Connector"]){let n=e["camunda:Connector"];if(n&&"object"==typeof n&&!Array.isArray(n)){if(void 0!==n.properties){let e=n.properties;if(Array.isArray(e)){const n=e.length;for(let i=0;i<n;i++){let n=e[i];const r=a;let _=!0;const P=a;if(n&&"object"==typeof n&&!Array.isArray(n))if(void 0===n.type){const e={};null===o?o=[e]:o.push(e),a++}else if(void 0!==n.type&&!fA(n.type,"Dropdown")){const e={};null===o?o=[e]:o.push(e),a++}var s=P===a;if(a=r,null!==o&&(r?o.length=r:o=null),s){const e=a;if(n&&"object"==typeof n&&!Array.isArray(n)&&void 0===n.choices){const e={keyword:"required",dataPath:t+"/camunda:Connector/properties/"+i,schemaPath:"#/definitions/properties/items/allOf/0/then/required",params:{missingProperty:"choices"},message:"should have required property 'choices'"};null===o?o=[e]:o.push(e),a++}if(a>0){const e=[];for(const n of o)"errorMessage"===n.keyword||n.emUsed||n.dataPath!==t+"/camunda:Connector/properties/"+i&&(0!==n.dataPath.indexOf(t+"/camunda:Connector/properties/"+i)||"/"!==n.dataPath[t+"/camunda:Connector/properties/"+i.length])||0!==n.schemaPath.indexOf("#/definitions/properties/items/allOf/0/then")||"/"!==n.schemaPath["#/definitions/properties/items/allOf/0/then".length]||(e.push(n),n.emUsed=!0);if(e.length){const n={keyword:"errorMessage",dataPath:t+"/camunda:Connector/properties/"+i,schemaPath:"#/definitions/properties/items/allOf/0/then/errorMessage",params:{errors:e},message:'must provide choices=[] with "Dropdown" type'};null===o?o=[n]:o.push(n),a++}const n=[];for(const e of o)e.emUsed||n.push(e);o=n,a=n.length}_=s=e===a}if(!_){const e={keyword:"if",dataPath:t+"/camunda:Connector/properties/"+i,schemaPath:"#/definitions/properties/items/allOf/0/if",params:{failingKeyword:"then"},message:'should match "then" schema'};null===o?o=[e]:o.push(e),a++}const S=a;let O=!0;const C=a;if(n&&"object"==typeof n&&!Array.isArray(n))if(void 0===n.binding){const e={};null===o?o=[e]:o.push(e),a++}else if(void 0!==n.binding){let e=n.binding;if(e&&"object"==typeof e&&!Array.isArray(e))if(void 0===e.type){const e={};null===o?o=[e]:o.push(e),a++}else if(void 0!==e.type&&!fA(e.type,"property")){const e={};null===o?o=[e]:o.push(e),a++}}var c=C===a;if(a=S,null!==o&&(S?o.length=S:o=null),c){const e=a;if(n&&"object"==typeof n&&!Array.isArray(n)&&void 0!==n.type){let e=n.type;if("String"!==e&&"Text"!==e&&"Hidden"!==e&&"Dropdown"!==e&&"Boolean"!==e){const e={keyword:"enum",dataPath:t+"/camunda:Connector/properties/"+i+"/type",schemaPath:"#/definitions/properties/items/allOf/1/then/properties/type/enum",params:{allowedValues:bA.items.allOf[1].then.properties.type.enum},message:"should be equal to one of the allowed values"};null===o?o=[e]:o.push(e),a++}if(a>0){const n=[];for(const e of o)"errorMessage"===e.keyword||e.emUsed||e.dataPath!==t+"/camunda:Connector/properties/"+i+"/type"&&(0!==e.dataPath.indexOf(t+"/camunda:Connector/properties/"+i+"/type")||"/"!==e.dataPath[t+"/camunda:Connector/properties/"+i+"/type".length])||0!==e.schemaPath.indexOf("#/definitions/properties/items/allOf/1/then/properties/type")||"/"!==e.schemaPath["#/definitions/properties/items/allOf/1/then/properties/type".length]||(n.push(e),e.emUsed=!0);if(n.length){const r={keyword:"errorMessage",dataPath:t+"/camunda:Connector/properties/"+i+"/type",schemaPath:"#/definitions/properties/items/allOf/1/then/properties/type/errorMessage",params:{errors:n},message:"invalid property type "+JSON.stringify(e)+' for binding type "property"; must be any of { String, Text, Hidden, Dropdown, Boolean }'};null===o?o=[r]:o.push(r),a++}const r=[];for(const e of o)e.emUsed||r.push(e);o=r,a=r.length}}O=c=e===a}if(!O){const e={keyword:"if",dataPath:t+"/camunda:Connector/properties/"+i,schemaPath:"#/definitions/properties/items/allOf/1/if",params:{failingKeyword:"then"},message:'should match "then" schema'};null===o?o=[e]:o.push(e),a++}const T=a;let A=!0;const R=a;if(n&&"object"==typeof n&&!Array.isArray(n))if(void 0===n.binding){const e={};null===o?o=[e]:o.push(e),a++}else if(void 0!==n.binding){let e=n.binding;if(e&&"object"==typeof e&&!Array.isArray(e))if(void 0===e.type){const e={};null===o?o=[e]:o.push(e),a++}else if(void 0!==e.type&&!fA(e.type,"camunda:executionListener")){const e={};null===o?o=[e]:o.push(e),a++}}var p=R===a;if(a=T,null!==o&&(T?o.length=T:o=null),p){const e=a;if(n&&"object"==typeof n&&!Array.isArray(n)&&void 0!==n.type){if("Hidden"!==n.type){const e={keyword:"enum",dataPath:t+"/camunda:Connector/properties/"+i+"/type",schemaPath:"#/definitions/properties/items/allOf/2/then/properties/type/enum",params:{allowedValues:bA.items.allOf[2].then.properties.type.enum},message:"should be equal to one of the allowed values"};null===o?o=[e]:o.push(e),a++}if(a>0){const e=[];for(const n of o)"errorMessage"===n.keyword||n.emUsed||n.dataPath!==t+"/camunda:Connector/properties/"+i+"/type"&&(0!==n.dataPath.indexOf(t+"/camunda:Connector/properties/"+i+"/type")||"/"!==n.dataPath[t+"/camunda:Connector/properties/"+i+"/type".length])||0!==n.schemaPath.indexOf("#/definitions/properties/items/allOf/2/then/properties/type")||"/"!==n.schemaPath["#/definitions/properties/items/allOf/2/then/properties/type".length]||(e.push(n),n.emUsed=!0);if(e.length){const r={keyword:"errorMessage",dataPath:t+"/camunda:Connector/properties/"+i+"/type",schemaPath:"#/definitions/properties/items/allOf/2/then/properties/type/errorMessage",params:{errors:e},message:"invalid property type "+JSON.stringify(n&&n.type)+' for binding type "camunda:executionListener"; must be "Hidden"'};null===o?o=[r]:o.push(r),a++}const r=[];for(const e of o)e.emUsed||r.push(e);o=r,a=r.length}}A=p=e===a}if(!A){const e={keyword:"if",dataPath:t+"/camunda:Connector/properties/"+i,schemaPath:"#/definitions/properties/items/allOf/2/if",params:{failingKeyword:"then"},message:'should match "then" schema'};null===o?o=[e]:o.push(e),a++}const k=a;let j=!0;const M=a;if(n&&"object"==typeof n&&!Array.isArray(n))if(void 0===n.binding){const e={};null===o?o=[e]:o.push(e),a++}else if(void 0!==n.binding){let e=n.binding;if(e&&"object"==typeof e&&!Array.isArray(e))if(void 0===e.type){const e={};null===o?o=[e]:o.push(e),a++}else if(void 0!==e.type){let t=e.type;if("camunda:property"!==t&&"camunda:outputParameter"!==t&&"camunda:in"!==t&&"camunda:in:businessKey"!==t&&"camunda:out"!==t&&"camunda:errorEventDefinition"!==t){const e={};null===o?o=[e]:o.push(e),a++}}}var u=M===a;if(a=k,null!==o&&(k?o.length=k:o=null),u){const e=a;if(n&&"object"==typeof n&&!Array.isArray(n)&&void 0!==n.type){let e=n.type;if("String"!==e&&"Hidden"!==e&&"Dropdown"!==e){const e={keyword:"enum",dataPath:t+"/camunda:Connector/properties/"+i+"/type",schemaPath:"#/definitions/properties/items/allOf/3/then/properties/type/enum",params:{allowedValues:bA.items.allOf[3].then.properties.type.enum},message:"should be equal to one of the allowed values"};null===o?o=[e]:o.push(e),a++}if(a>0){const r=[];for(const e of o)"errorMessage"===e.keyword||e.emUsed||e.dataPath!==t+"/camunda:Connector/properties/"+i+"/type"&&(0!==e.dataPath.indexOf(t+"/camunda:Connector/properties/"+i+"/type")||"/"!==e.dataPath[t+"/camunda:Connector/properties/"+i+"/type".length])||0!==e.schemaPath.indexOf("#/definitions/properties/items/allOf/3/then/properties/type")||"/"!==e.schemaPath["#/definitions/properties/items/allOf/3/then/properties/type".length]||(r.push(e),e.emUsed=!0);if(r.length){const s={keyword:"errorMessage",dataPath:t+"/camunda:Connector/properties/"+i+"/type",schemaPath:"#/definitions/properties/items/allOf/3/then/properties/type/errorMessage",params:{errors:r},message:"invalid property type "+JSON.stringify(e)+" for binding type "+JSON.stringify(n&&n.binding&&n.binding.type)+"; must be any of { String, Hidden, Dropdown }"};null===o?o=[s]:o.push(s),a++}const s=[];for(const e of o)e.emUsed||s.push(e);o=s,a=s.length}}j=u=e===a}if(!j){const e={keyword:"if",dataPath:t+"/camunda:Connector/properties/"+i,schemaPath:"#/definitions/properties/items/allOf/3/if",params:{failingKeyword:"then"},message:'should match "then" schema'};null===o?o=[e]:o.push(e),a++}const D=a;let B=!0;const I=a;if(n&&"object"==typeof n&&!Array.isArray(n))if(void 0===n.binding){const e={};null===o?o=[e]:o.push(e),a++}else if(void 0!==n.binding){let e=n.binding;if(e&&"object"==typeof e&&!Array.isArray(e))if(void 0===e.type){const e={};null===o?o=[e]:o.push(e),a++}else if(void 0!==e.type){let t=e.type;if("camunda:inputParameter"!==t&&"camunda:field"!==t){const e={};null===o?o=[e]:o.push(e),a++}}}var l=I===a;if(a=D,null!==o&&(D?o.length=D:o=null),l){const e=a;if(n&&"object"==typeof n&&!Array.isArray(n)&&void 0!==n.type){let e=n.type;if("String"!==e&&"Text"!==e&&"Hidden"!==e&&"Dropdown"!==e){const e={keyword:"enum",dataPath:t+"/camunda:Connector/properties/"+i+"/type",schemaPath:"#/definitions/properties/items/allOf/4/then/properties/type/enum",params:{allowedValues:bA.items.allOf[4].then.properties.type.enum},message:"should be equal to one of the allowed values"};null===o?o=[e]:o.push(e),a++}if(a>0){const r=[];for(const e of o)"errorMessage"===e.keyword||e.emUsed||e.dataPath!==t+"/camunda:Connector/properties/"+i+"/type"&&(0!==e.dataPath.indexOf(t+"/camunda:Connector/properties/"+i+"/type")||"/"!==e.dataPath[t+"/camunda:Connector/properties/"+i+"/type".length])||0!==e.schemaPath.indexOf("#/definitions/properties/items/allOf/4/then/properties/type")||"/"!==e.schemaPath["#/definitions/properties/items/allOf/4/then/properties/type".length]||(r.push(e),e.emUsed=!0);if(r.length){const s={keyword:"errorMessage",dataPath:t+"/camunda:Connector/properties/"+i+"/type",schemaPath:"#/definitions/properties/items/allOf/4/then/properties/type/errorMessage",params:{errors:r},message:"invalid property type "+JSON.stringify(e)+" for binding type "+JSON.stringify(n&&n.binding&&n.binding.type)+"; must be any of { String, Text, Hidden, Dropdown }"};null===o?o=[s]:o.push(s),a++}const s=[];for(const e of o)e.emUsed||s.push(e);o=s,a=s.length}}B=l=e===a}if(!B){const e={keyword:"if",dataPath:t+"/camunda:Connector/properties/"+i,schemaPath:"#/definitions/properties/items/allOf/4/if",params:{failingKeyword:"then"},message:'should match "then" schema'};null===o?o=[e]:o.push(e),a++}if(n&&"object"==typeof n&&!Array.isArray(n)){if(void 0===n.binding){const e={keyword:"required",dataPath:t+"/camunda:Connector/properties/"+i,schemaPath:"#/definitions/properties/items/required",params:{missingProperty:"binding"},message:"should have required property 'binding'"};null===o?o=[e]:o.push(e),a++}if(void 0!==n.value){let e=n.value;if("string"!=typeof e&&"boolean"!=typeof e){const e={keyword:"type",dataPath:t+"/camunda:Connector/properties/"+i+"/value",schemaPath:"#/definitions/properties/items/properties/value/type",params:{type:bA.items.properties.value.type},message:"should be string,boolean"};null===o?o=[e]:o.push(e),a++}}if(void 0!==n.description&&"string"!=typeof n.description){const e={keyword:"type",dataPath:t+"/camunda:Connector/properties/"+i+"/description",schemaPath:"#/definitions/properties/items/properties/description/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}if(void 0!==n.label&&"string"!=typeof n.label){const e={keyword:"type",dataPath:t+"/camunda:Connector/properties/"+i+"/label",schemaPath:"#/definitions/properties/items/properties/label/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}if(void 0!==n.type&&"string"!=typeof n.type){const e={keyword:"type",dataPath:t+"/camunda:Connector/properties/"+i+"/type",schemaPath:"#/definitions/properties/items/properties/type/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}if(void 0!==n.editable&&"boolean"!=typeof n.editable){const e={keyword:"type",dataPath:t+"/camunda:Connector/properties/"+i+"/editable",schemaPath:"#/definitions/properties/items/properties/editable/type",params:{type:"boolean"},message:"should be boolean"};null===o?o=[e]:o.push(e),a++}if(void 0!==n.choices){let e=n.choices;if(Array.isArray(e)){const n=e.length;for(let r=0;r<n;r++){let n=e[r];if(n&&"object"==typeof n&&!Array.isArray(n)){if(void 0===n.value){const e={keyword:"required",dataPath:t+"/camunda:Connector/properties/"+i+"/choices/"+r,schemaPath:"#/definitions/properties/items/properties/choices/items/required",params:{missingProperty:"value"},message:"should have required property 'value'"};null===o?o=[e]:o.push(e),a++}if(void 0===n.name){const e={keyword:"required",dataPath:t+"/camunda:Connector/properties/"+i+"/choices/"+r,schemaPath:"#/definitions/properties/items/properties/choices/items/required",params:{missingProperty:"name"},message:"should have required property 'name'"};null===o?o=[e]:o.push(e),a++}if(void 0!==n.name&&"string"!=typeof n.name){const e={keyword:"type",dataPath:t+"/camunda:Connector/properties/"+i+"/choices/"+r+"/name",schemaPath:"#/definitions/properties/items/properties/choices/items/properties/name/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}if(void 0!==n.value&&"string"!=typeof n.value){const e={keyword:"type",dataPath:t+"/camunda:Connector/properties/"+i+"/choices/"+r+"/value",schemaPath:"#/definitions/properties/items/properties/choices/items/properties/value/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}}else{const e={keyword:"type",dataPath:t+"/camunda:Connector/properties/"+i+"/choices/"+r,schemaPath:"#/definitions/properties/items/properties/choices/items/type",params:{type:"object"},message:"should be object"};null===o?o=[e]:o.push(e),a++}if(a>0){const e=[];for(const n of o)"errorMessage"===n.keyword||n.emUsed||n.dataPath!==t+"/camunda:Connector/properties/"+i+"/choices/"+r&&(0!==n.dataPath.indexOf(t+"/camunda:Connector/properties/"+i+"/choices/"+r)||"/"!==n.dataPath[t+"/camunda:Connector/properties/"+i+"/choices/"+r.length])||0!==n.schemaPath.indexOf("#/definitions/properties/items/properties/choices/items")||"/"!==n.schemaPath["#/definitions/properties/items/properties/choices/items".length]||(e.push(n),n.emUsed=!0);if(e.length){const n={keyword:"errorMessage",dataPath:t+"/camunda:Connector/properties/"+i+"/choices/"+r,schemaPath:"#/definitions/properties/items/properties/choices/items/errorMessage",params:{errors:e},message:'{ name, value } must be specified for "Dropdown" choices'};null===o?o=[n]:o.push(n),a++}const n=[];for(const e of o)e.emUsed||n.push(e);o=n,a=n.length}}}else{const e={keyword:"type",dataPath:t+"/camunda:Connector/properties/"+i+"/choices",schemaPath:"#/definitions/properties/items/properties/choices/type",params:{type:"array"},message:"should be array"};null===o?o=[e]:o.push(e),a++}}if(void 0!==n.binding){let e=n.binding;const r=a;let s=!0;const c=a;if(e&&"object"==typeof e&&!Array.isArray(e))if(void 0===e.type){const e={};null===o?o=[e]:o.push(e),a++}else if(void 0!==e.type){let t=e.type;if("property"!==t&&"camunda:property"!==t&&"camunda:inputParameter"!==t&&"camunda:field"!==t){const e={};null===o?o=[e]:o.push(e),a++}}var d=c===a;if(a=r,null!==o&&(r?o.length=r:o=null),d){const n=a;if(e&&"object"==typeof e&&!Array.isArray(e)&&void 0===e.name){const e={keyword:"required",dataPath:t+"/camunda:Connector/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/0/then/required",params:{missingProperty:"name"},message:"should have required property 'name'"};null===o?o=[e]:o.push(e),a++}if(a>0){const n=[];for(const e of o)"errorMessage"===e.keyword||e.emUsed||e.dataPath!==t+"/camunda:Connector/properties/"+i+"/binding"&&(0!==e.dataPath.indexOf(t+"/camunda:Connector/properties/"+i+"/binding")||"/"!==e.dataPath[t+"/camunda:Connector/properties/"+i+"/binding".length])||0!==e.schemaPath.indexOf("#/definitions/properties/items/properties/binding/allOf/0/then")||"/"!==e.schemaPath["#/definitions/properties/items/properties/binding/allOf/0/then".length]||(n.push(e),e.emUsed=!0);if(n.length){const r={keyword:"errorMessage",dataPath:t+"/camunda:Connector/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/0/then/errorMessage",params:{errors:n},message:"property.binding "+JSON.stringify(e&&e.type)+" requires name"};null===o?o=[r]:o.push(r),a++}const r=[];for(const e of o)e.emUsed||r.push(e);o=r,a=r.length}s=d=n===a}if(!s){const e={keyword:"if",dataPath:t+"/camunda:Connector/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/0/if",params:{failingKeyword:"then"},message:'should match "then" schema'};null===o?o=[e]:o.push(e),a++}const p=a;let u=!0;const l=a;if(e&&"object"==typeof e&&!Array.isArray(e))if(void 0===e.type){const e={};null===o?o=[e]:o.push(e),a++}else if(void 0!==e.type&&!fA(e.type,"camunda:outputParameter")){const e={};null===o?o=[e]:o.push(e),a++}var h=l===a;if(a=p,null!==o&&(p?o.length=p:o=null),h){const n=a;if(e&&"object"==typeof e&&!Array.isArray(e)&&void 0===e.source){const e={keyword:"required",dataPath:t+"/camunda:Connector/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/1/then/required",params:{missingProperty:"source"},message:"should have required property 'source'"};null===o?o=[e]:o.push(e),a++}if(a>0){const n=[];for(const e of o)"errorMessage"===e.keyword||e.emUsed||e.dataPath!==t+"/camunda:Connector/properties/"+i+"/binding"&&(0!==e.dataPath.indexOf(t+"/camunda:Connector/properties/"+i+"/binding")||"/"!==e.dataPath[t+"/camunda:Connector/properties/"+i+"/binding".length])||0!==e.schemaPath.indexOf("#/definitions/properties/items/properties/binding/allOf/1/then")||"/"!==e.schemaPath["#/definitions/properties/items/properties/binding/allOf/1/then".length]||(n.push(e),e.emUsed=!0);if(n.length){const r={keyword:"errorMessage",dataPath:t+"/camunda:Connector/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/1/then/errorMessage",params:{errors:n},message:"property.binding "+JSON.stringify(e&&e.type)+" requires source"};null===o?o=[r]:o.push(r),a++}const r=[];for(const e of o)e.emUsed||r.push(e);o=r,a=r.length}u=h=n===a}if(!u){const e={keyword:"if",dataPath:t+"/camunda:Connector/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/1/if",params:{failingKeyword:"then"},message:'should match "then" schema'};null===o?o=[e]:o.push(e),a++}const w=a;let _=!0;const P=a;if(e&&"object"==typeof e&&!Array.isArray(e))if(void 0===e.type){const e={};null===o?o=[e]:o.push(e),a++}else if(void 0!==e.type&&!fA(e.type,"camunda:in")){const e={};null===o?o=[e]:o.push(e),a++}var m=P===a;if(a=w,null!==o&&(w?o.length=w:o=null),m){const n=a,r=a;let s=!1;const c=a;if(e&&"object"==typeof e&&!Array.isArray(e)&&void 0===e.variables){const e={keyword:"required",dataPath:t+"/camunda:Connector/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/2/then/anyOf/0/required",params:{missingProperty:"variables"},message:"should have required property 'variables'"};null===o?o=[e]:o.push(e),a++}var f=c===a;if(s=s||f,!s){const n=a;if(e&&"object"==typeof e&&!Array.isArray(e)&&void 0===e.target){const e={keyword:"required",dataPath:t+"/camunda:Connector/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/2/then/anyOf/1/required",params:{missingProperty:"target"},message:"should have required property 'target'"};null===o?o=[e]:o.push(e),a++}f=n===a;s=s||f}if(s)a=r,null!==o&&(r?o.length=r:o=null);else{const e={keyword:"anyOf",dataPath:t+"/camunda:Connector/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/2/then/anyOf",params:{},message:"should match some schema in anyOf"};null===o?o=[e]:o.push(e),a++}if(a>0){const n=[];for(const e of o)"errorMessage"===e.keyword||e.emUsed||e.dataPath!==t+"/camunda:Connector/properties/"+i+"/binding"&&(0!==e.dataPath.indexOf(t+"/camunda:Connector/properties/"+i+"/binding")||"/"!==e.dataPath[t+"/camunda:Connector/properties/"+i+"/binding".length])||0!==e.schemaPath.indexOf("#/definitions/properties/items/properties/binding/allOf/2/then")||"/"!==e.schemaPath["#/definitions/properties/items/properties/binding/allOf/2/then".length]||(n.push(e),e.emUsed=!0);if(n.length){const r={keyword:"errorMessage",dataPath:t+"/camunda:Connector/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/2/then/errorMessage",params:{errors:n},message:"property.binding "+JSON.stringify(e&&e.type)+" requires variables, target, or both"};null===o?o=[r]:o.push(r),a++}const r=[];for(const e of o)e.emUsed||r.push(e);o=r,a=r.length}_=m=n===a}if(!_){const e={keyword:"if",dataPath:t+"/camunda:Connector/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/2/if",params:{failingKeyword:"then"},message:'should match "then" schema'};null===o?o=[e]:o.push(e),a++}const S=a;let O=!0;const C=a;if(e&&"object"==typeof e&&!Array.isArray(e))if(void 0===e.type){const e={};null===o?o=[e]:o.push(e),a++}else if(void 0!==e.type&&!fA(e.type,"camunda:out")){const e={};null===o?o=[e]:o.push(e),a++}var v=C===a;if(a=S,null!==o&&(S?o.length=S:o=null),v){const n=a,r=a;let s=!1,c=null;const p=a,u=a,l=a,d=a;let h=!1;const m=a;if(e&&"object"==typeof e&&!Array.isArray(e)&&void 0===e.source){const e={};null===o?o=[e]:o.push(e),a++}var y=m===a;if(h=h||y,!h){const t=a;if(e&&"object"==typeof e&&!Array.isArray(e)&&void 0===e.sourceExpression){const e={};null===o?o=[e]:o.push(e),a++}y=t===a;h=h||y}if(h)a=d,null!==o&&(d?o.length=d:o=null);else{const e={};null===o?o=[e]:o.push(e),a++}if(l===a){const e={keyword:"not",dataPath:t+"/camunda:Connector/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/3/then/oneOf/0/not",params:{},message:"should NOT be valid"};null===o?o=[e]:o.push(e),a++}else a=u,null!==o&&(u?o.length=u:o=null);if(e&&"object"==typeof e&&!Array.isArray(e)&&void 0===e.variables){const e={keyword:"required",dataPath:t+"/camunda:Connector/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/3/then/oneOf/0/required",params:{missingProperty:"variables"},message:"should have required property 'variables'"};null===o?o=[e]:o.push(e),a++}(x=p===a)&&(s=!0,c=0);const f=a,E=a,w=a,_=a;let P=!1;const S=a;if(e&&"object"==typeof e&&!Array.isArray(e)&&void 0===e.variables){const e={};null===o?o=[e]:o.push(e),a++}var g=S===a;if(P=P||g,!P){const t=a;if(e&&"object"==typeof e&&!Array.isArray(e)&&void 0===e.sourceExpression){const e={};null===o?o=[e]:o.push(e),a++}g=t===a;P=P||g}if(P)a=_,null!==o&&(_?o.length=_:o=null);else{const e={};null===o?o=[e]:o.push(e),a++}if(w===a){const e={keyword:"not",dataPath:t+"/camunda:Connector/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/3/then/oneOf/1/not",params:{},message:"should NOT be valid"};null===o?o=[e]:o.push(e),a++}else a=E,null!==o&&(E?o.length=E:o=null);if(e&&"object"==typeof e&&!Array.isArray(e)&&void 0===e.source){const e={keyword:"required",dataPath:t+"/camunda:Connector/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/3/then/oneOf/1/required",params:{missingProperty:"source"},message:"should have required property 'source'"};null===o?o=[e]:o.push(e),a++}if((x=f===a)&&s)s=!1,c=[c,1];else{x&&(s=!0,c=1);const n=a,r=a,p=a,u=a;let l=!1;const d=a;if(e&&"object"==typeof e&&!Array.isArray(e)&&void 0===e.variables){const e={};null===o?o=[e]:o.push(e),a++}var b=d===a;if(l=l||b,!l){const t=a;if(e&&"object"==typeof e&&!Array.isArray(e)&&void 0===e.source){const e={};null===o?o=[e]:o.push(e),a++}b=t===a;l=l||b}if(l)a=u,null!==o&&(u?o.length=u:o=null);else{const e={};null===o?o=[e]:o.push(e),a++}if(p===a){const e={keyword:"not",dataPath:t+"/camunda:Connector/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/3/then/oneOf/2/not",params:{},message:"should NOT be valid"};null===o?o=[e]:o.push(e),a++}else a=r,null!==o&&(r?o.length=r:o=null);if(e&&"object"==typeof e&&!Array.isArray(e)&&void 0===e.sourceExpression){const e={keyword:"required",dataPath:t+"/camunda:Connector/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/3/then/oneOf/2/required",params:{missingProperty:"sourceExpression"},message:"should have required property 'sourceExpression'"};null===o?o=[e]:o.push(e),a++}if((x=n===a)&&s)s=!1,c=[c,2];else{x&&(s=!0,c=2);const n=a,r=a,p=a;if(e&&"object"==typeof e&&!Array.isArray(e)&&void 0===e.source){const e={};null===o?o=[e]:o.push(e),a++}if(p===a){const e={keyword:"not",dataPath:t+"/camunda:Connector/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/3/then/oneOf/3/not",params:{},message:"should NOT be valid"};null===o?o=[e]:o.push(e),a++}else a=r,null!==o&&(r?o.length=r:o=null);if(e&&"object"==typeof e&&!Array.isArray(e)){if(void 0===e.variables){const e={keyword:"required",dataPath:t+"/camunda:Connector/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/3/then/oneOf/3/required",params:{missingProperty:"variables"},message:"should have required property 'variables'"};null===o?o=[e]:o.push(e),a++}if(void 0===e.sourceExpression){const e={keyword:"required",dataPath:t+"/camunda:Connector/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/3/then/oneOf/3/required",params:{missingProperty:"sourceExpression"},message:"should have required property 'sourceExpression'"};null===o?o=[e]:o.push(e),a++}}if((x=n===a)&&s)s=!1,c=[c,3];else{x&&(s=!0,c=3);const n=a,r=a,p=a;if(e&&"object"==typeof e&&!Array.isArray(e)&&void 0===e.sourceExpression){const e={};null===o?o=[e]:o.push(e),a++}var x;if(p===a){const e={keyword:"not",dataPath:t+"/camunda:Connector/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/3/then/oneOf/4/not",params:{},message:"should NOT be valid"};null===o?o=[e]:o.push(e),a++}else a=r,null!==o&&(r?o.length=r:o=null);if(e&&"object"==typeof e&&!Array.isArray(e)){if(void 0===e.variables){const e={keyword:"required",dataPath:t+"/camunda:Connector/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/3/then/oneOf/4/required",params:{missingProperty:"variables"},message:"should have required property 'variables'"};null===o?o=[e]:o.push(e),a++}if(void 0===e.source){const e={keyword:"required",dataPath:t+"/camunda:Connector/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/3/then/oneOf/4/required",params:{missingProperty:"source"},message:"should have required property 'source'"};null===o?o=[e]:o.push(e),a++}}(x=n===a)&&s?(s=!1,c=[c,4]):x&&(s=!0,c=4)}}}if(s)a=r,null!==o&&(r?o.length=r:o=null);else{const e={keyword:"oneOf",dataPath:t+"/camunda:Connector/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/3/then/oneOf",params:{passingSchemas:c},message:"should match exactly one schema in oneOf"};null===o?o=[e]:o.push(e),a++}if(a>0){const n=[];for(const e of o)"errorMessage"===e.keyword||e.emUsed||e.dataPath!==t+"/camunda:Connector/properties/"+i+"/binding"&&(0!==e.dataPath.indexOf(t+"/camunda:Connector/properties/"+i+"/binding")||"/"!==e.dataPath[t+"/camunda:Connector/properties/"+i+"/binding".length])||0!==e.schemaPath.indexOf("#/definitions/properties/items/properties/binding/allOf/3/then")||"/"!==e.schemaPath["#/definitions/properties/items/properties/binding/allOf/3/then".length]||(n.push(e),e.emUsed=!0);if(n.length){const r={keyword:"errorMessage",dataPath:t+"/camunda:Connector/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/3/then/errorMessage",params:{errors:n},message:"property.binding "+JSON.stringify(e&&e.type)+" requires one of the following: variables, sourceExpression, source, (sourceExpression and variables), or (source and variables)"};null===o?o=[r]:o.push(r),a++}const r=[];for(const e of o)e.emUsed||r.push(e);o=r,a=r.length}O=v=n===a}if(!O){const e={keyword:"if",dataPath:t+"/camunda:Connector/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/3/if",params:{failingKeyword:"then"},message:'should match "then" schema'};null===o?o=[e]:o.push(e),a++}const T=a;let A=!0;const R=a;if(e&&"object"==typeof e&&!Array.isArray(e))if(void 0===e.type){const e={};null===o?o=[e]:o.push(e),a++}else if(void 0!==e.type&&!fA(e.type,"camunda:errorEventDefinition")){const e={};null===o?o=[e]:o.push(e),a++}var E=R===a;if(a=T,null!==o&&(T?o.length=T:o=null),E){const n=a,r=a;let s=!1,c=null;const p=a;if(e&&"object"==typeof e&&!Array.isArray(e)&&void 0===e.errorRef){const e={keyword:"required",dataPath:t+"/camunda:Connector/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/4/then/oneOf/0/required",params:{missingProperty:"errorRef"},message:"should have required property 'errorRef'"};null===o?o=[e]:o.push(e),a++}if(p===a&&(s=!0,c=0),s)a=r,null!==o&&(r?o.length=r:o=null);else{const e={keyword:"oneOf",dataPath:t+"/camunda:Connector/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/4/then/oneOf",params:{passingSchemas:c},message:"should match exactly one schema in oneOf"};null===o?o=[e]:o.push(e),a++}if(a>0){const n=[];for(const e of o)"errorMessage"===e.keyword||e.emUsed||e.dataPath!==t+"/camunda:Connector/properties/"+i+"/binding"&&(0!==e.dataPath.indexOf(t+"/camunda:Connector/properties/"+i+"/binding")||"/"!==e.dataPath[t+"/camunda:Connector/properties/"+i+"/binding".length])||0!==e.schemaPath.indexOf("#/definitions/properties/items/properties/binding/allOf/4/then")||"/"!==e.schemaPath["#/definitions/properties/items/properties/binding/allOf/4/then".length]||(n.push(e),e.emUsed=!0);if(n.length){const r={keyword:"errorMessage",dataPath:t+"/camunda:Connector/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/4/then/errorMessage",params:{errors:n},message:"property.binding "+JSON.stringify(e&&e.type)+" requires errorRef"};null===o?o=[r]:o.push(r),a++}const r=[];for(const e of o)e.emUsed||r.push(e);o=r,a=r.length}A=E=n===a}if(!A){const e={keyword:"if",dataPath:t+"/camunda:Connector/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/4/if",params:{failingKeyword:"then"},message:'should match "then" schema'};null===o?o=[e]:o.push(e),a++}if(e&&"object"==typeof e&&!Array.isArray(e)){if(void 0===e.type){const e={keyword:"required",dataPath:t+"/camunda:Connector/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/required",params:{missingProperty:"type"},message:"should have required property 'type'"};null===o?o=[e]:o.push(e),a++}if(void 0!==e.type){let n=e.type;if("string"!=typeof n){const e={keyword:"type",dataPath:t+"/camunda:Connector/properties/"+i+"/binding/type",schemaPath:"#/definitions/properties/items/properties/binding/properties/type/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}if("property"!==n&&"camunda:property"!==n&&"camunda:inputParameter"!==n&&"camunda:outputParameter"!==n&&"camunda:in"!==n&&"camunda:out"!==n&&"camunda:in:businessKey"!==n&&"camunda:executionListener"!==n&&"camunda:field"!==n&&"camunda:errorEventDefinition"!==n){const e={keyword:"enum",dataPath:t+"/camunda:Connector/properties/"+i+"/binding/type",schemaPath:"#/definitions/properties/items/properties/binding/properties/type/enum",params:{allowedValues:bA.items.properties.binding.properties.type.enum},message:"should be equal to one of the allowed values"};null===o?o=[e]:o.push(e),a++}if(a>0){const e=[];for(const n of o)"errorMessage"===n.keyword||n.emUsed||n.dataPath!==t+"/camunda:Connector/properties/"+i+"/binding/type"&&(0!==n.dataPath.indexOf(t+"/camunda:Connector/properties/"+i+"/binding/type")||"/"!==n.dataPath[t+"/camunda:Connector/properties/"+i+"/binding/type".length])||0!==n.schemaPath.indexOf("#/definitions/properties/items/properties/binding/properties/type")||"/"!==n.schemaPath["#/definitions/properties/items/properties/binding/properties/type".length]||(e.push(n),n.emUsed=!0);if(e.length){const r={keyword:"errorMessage",dataPath:t+"/camunda:Connector/properties/"+i+"/binding/type",schemaPath:"#/definitions/properties/items/properties/binding/properties/type/errorMessage",params:{errors:e},message:"invalid property.binding type "+JSON.stringify(n)+"; must be any of { property, camunda:property, camunda:inputParameter, camunda:outputParameter, camunda:in, camunda:out, camunda:in:businessKey, camunda:executionListener, camunda:field, camunda:errorEventDefinition }"};null===o?o=[r]:o.push(r),a++}const r=[];for(const e of o)e.emUsed||r.push(e);o=r,a=r.length}}if(void 0!==e.name&&"string"!=typeof e.name){const e={keyword:"type",dataPath:t+"/camunda:Connector/properties/"+i+"/binding/name",schemaPath:"#/definitions/properties/items/properties/binding/properties/name/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}if(void 0!==e.event&&"string"!=typeof e.event){const e={keyword:"type",dataPath:t+"/camunda:Connector/properties/"+i+"/binding/event",schemaPath:"#/definitions/properties/items/properties/binding/properties/event/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}if(void 0!==e.scriptFormat&&"string"!=typeof e.scriptFormat){const e={keyword:"type",dataPath:t+"/camunda:Connector/properties/"+i+"/binding/scriptFormat",schemaPath:"#/definitions/properties/items/properties/binding/properties/scriptFormat/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}if(void 0!==e.source&&"string"!=typeof e.source){const e={keyword:"type",dataPath:t+"/camunda:Connector/properties/"+i+"/binding/source",schemaPath:"#/definitions/properties/items/properties/binding/properties/source/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}if(void 0!==e.target&&"string"!=typeof e.target){const e={keyword:"type",dataPath:t+"/camunda:Connector/properties/"+i+"/binding/target",schemaPath:"#/definitions/properties/items/properties/binding/properties/target/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}if(void 0!==e.expression&&"boolean"!=typeof e.expression){const e={keyword:"type",dataPath:t+"/camunda:Connector/properties/"+i+"/binding/expression",schemaPath:"#/definitions/properties/items/properties/binding/properties/expression/type",params:{type:"boolean"},message:"should be boolean"};null===o?o=[e]:o.push(e),a++}if(void 0!==e.variables){let n=e.variables;if("string"!=typeof n){const e={keyword:"type",dataPath:t+"/camunda:Connector/properties/"+i+"/binding/variables",schemaPath:"#/definitions/properties/items/properties/binding/properties/variables/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}if("all"!==n&&"local"!==n){const e={keyword:"enum",dataPath:t+"/camunda:Connector/properties/"+i+"/binding/variables",schemaPath:"#/definitions/properties/items/properties/binding/properties/variables/enum",params:{allowedValues:bA.items.properties.binding.properties.variables.enum},message:"should be equal to one of the allowed values"};null===o?o=[e]:o.push(e),a++}}if(void 0!==e.sourceExpression&&"string"!=typeof e.sourceExpression){const e={keyword:"type",dataPath:t+"/camunda:Connector/properties/"+i+"/binding/sourceExpression",schemaPath:"#/definitions/properties/items/properties/binding/properties/sourceExpression/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}}else{const e={keyword:"type",dataPath:t+"/camunda:Connector/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/type",params:{type:"object"},message:"should be object"};null===o?o=[e]:o.push(e),a++}}if(void 0!==n.constraints){let e=n.constraints;if(e&&"object"==typeof e&&!Array.isArray(e)){if(void 0!==e.notEmpty&&"boolean"!=typeof e.notEmpty){const e={keyword:"type",dataPath:t+"/camunda:Connector/properties/"+i+"/constraints/notEmpty",schemaPath:"#/definitions/properties/items/properties/constraints/properties/notEmpty/type",params:{type:"boolean"},message:"should be boolean"};null===o?o=[e]:o.push(e),a++}if(void 0!==e.minLength&&"number"!=typeof e.minLength){const e={keyword:"type",dataPath:t+"/camunda:Connector/properties/"+i+"/constraints/minLength",schemaPath:"#/definitions/properties/items/properties/constraints/properties/minLength/type",params:{type:"number"},message:"should be number"};null===o?o=[e]:o.push(e),a++}if(void 0!==e.maxLength&&"number"!=typeof e.maxLength){const e={keyword:"type",dataPath:t+"/camunda:Connector/properties/"+i+"/constraints/maxLength",schemaPath:"#/definitions/properties/items/properties/constraints/properties/maxLength/type",params:{type:"number"},message:"should be number"};null===o?o=[e]:o.push(e),a++}if(void 0!==e.pattern){let n=e.pattern;const r=a;let s=!1,c=null;const p=a;if(n&&"object"==typeof n&&!Array.isArray(n)){if(void 0!==n.value&&"string"!=typeof n.value){const e={keyword:"type",dataPath:t+"/camunda:Connector/properties/"+i+"/constraints/pattern/value",schemaPath:"#/definitions/properties/items/properties/constraints/properties/pattern/oneOf/0/properties/value/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}if(void 0!==n.message&&"string"!=typeof n.message){const e={keyword:"type",dataPath:t+"/camunda:Connector/properties/"+i+"/constraints/pattern/message",schemaPath:"#/definitions/properties/items/properties/constraints/properties/pattern/oneOf/0/properties/message/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}}else{const e={keyword:"type",dataPath:t+"/camunda:Connector/properties/"+i+"/constraints/pattern",schemaPath:"#/definitions/properties/items/properties/constraints/properties/pattern/oneOf/0/type",params:{type:"object"},message:"should be object"};null===o?o=[e]:o.push(e),a++}(w=p===a)&&(s=!0,c=0);const u=a;if("string"!=typeof n){const e={keyword:"type",dataPath:t+"/camunda:Connector/properties/"+i+"/constraints/pattern",schemaPath:"#/definitions/properties/items/properties/constraints/properties/pattern/oneOf/1/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}var w;if((w=u===a)&&s?(s=!1,c=[c,1]):w&&(s=!0,c=1),s)a=r,null!==o&&(r?o.length=r:o=null);else{const e={keyword:"oneOf",dataPath:t+"/camunda:Connector/properties/"+i+"/constraints/pattern",schemaPath:"#/definitions/properties/items/properties/constraints/properties/pattern/oneOf",params:{passingSchemas:c},message:"should match exactly one schema in oneOf"};null===o?o=[e]:o.push(e),a++}}}else{const e={keyword:"type",dataPath:t+"/camunda:Connector/properties/"+i+"/constraints",schemaPath:"#/definitions/properties/items/properties/constraints/type",params:{type:"object"},message:"should be object"};null===o?o=[e]:o.push(e),a++}}}else{const e={keyword:"type",dataPath:t+"/camunda:Connector/properties/"+i,schemaPath:"#/definitions/properties/items/type",params:{type:"object"},message:"should be object"};null===o?o=[e]:o.push(e),a++}if(a>0){const e={required:{binding:[]}},n={required:{binding:function(){return'missing binding for property "'+JSON.stringify(i)+'"'}}};let r,s;for(const n of o)"errorMessage"!==n.keyword&&!n.emUsed&&n.dataPath===t+"/camunda:Connector/properties/"+i&&n.keyword in e&&0===n.schemaPath.indexOf("#/definitions/properties/items")&&/^\/[^\/]*$/.test(n.schemaPath.slice(30))&&(r=EA[n.keyword],s=e[n.keyword][n.params[r]],s&&(s.push(n),n.emUsed=!0));for(const r in e)for(const c in e[r])if(s=e[r][c],s.length){const e=n[r]&&n[r][c],p={keyword:"errorMessage",dataPath:t+"/camunda:Connector/properties/"+i,schemaPath:"#/definitions/properties/items/errorMessage",params:{errors:s},message:e?e():bA.items.errorMessage[r][c]};null===o?o=[p]:o.push(p),a++}const c=[];for(const e of o)e.emUsed||c.push(e);o=c,a=c.length}}}else{const e={keyword:"type",dataPath:t+"/camunda:Connector/properties",schemaPath:"#/definitions/properties/type",params:{type:"array"},message:"should be array"};null===o?o=[e]:o.push(e),a++}}}else{const e={keyword:"type",dataPath:t+"/camunda:Connector",schemaPath:"#/properties/camunda%3AConnector/type",params:{type:"object"},message:"should be object"};null===o?o=[e]:o.push(e),a++}}}else{const e={keyword:"type",dataPath:t,schemaPath:"#/type",params:{type:"object"},message:"should be object"};null===o?o=[e]:o.push(e),a++}return wA.errors=o,0===a}const _A={$id:"#/definitions/scopes",type:"array",title:"element template scope",description:"Special scoped bindings that allow you to configure nested elements",items:{$id:"#/scopes/item",type:"object",title:"element template scope item",description:"Scoped binding to configure nested elements",properties:{type:{$id:"#scopes/item/type",type:"string",enum:["camunda:Connector","bpmn:Error"],errorMessage:"invalid scope type ${0}; must be any of { camunda:Connector, bpmn:Error }"},properties:{$ref:"#/definitions/properties"}},required:["type","properties"],errorMessage:{required:{type:"invalid scope, missing type",properties:"invalid scope ${0/type}, missing properties=[]"}},allOf:[{if:{properties:{type:{enum:["bpmn:Error"]}},required:["type"]},then:{required:["id"],errorMessage:"invalid scope ${0/type}, missing id"}}]}};function PA(e,{dataPath:t="",parentData:n,parentDataProperty:i,rootData:r=e}={}){let o=null,a=0;if(Array.isArray(e)){const n=e.length;for(let i=0;i<n;i++){let n=e[i];const r=a;let P=!0;const S=a;if(n&&"object"==typeof n&&!Array.isArray(n))if(void 0===n.type){const e={};null===o?o=[e]:o.push(e),a++}else if(void 0!==n.type&&"bpmn:Error"!==n.type){const e={};null===o?o=[e]:o.push(e),a++}var s=S===a;if(a=r,null!==o&&(r?o.length=r:o=null),s){const e=a;if(n&&"object"==typeof n&&!Array.isArray(n)&&void 0===n.id){const e={keyword:"required",dataPath:t+"/"+i,schemaPath:"#/items/allOf/0/then/required",params:{missingProperty:"id"},message:"should have required property 'id'"};null===o?o=[e]:o.push(e),a++}if(a>0){const e=[];for(const n of o)"errorMessage"===n.keyword||n.emUsed||n.dataPath!==t+"/"+i&&(0!==n.dataPath.indexOf(t+"/"+i)||"/"!==n.dataPath[t+"/"+i.length])||0!==n.schemaPath.indexOf("#/items/allOf/0/then")||"/"!==n.schemaPath["#/items/allOf/0/then".length]||(e.push(n),n.emUsed=!0);if(e.length){const r={keyword:"errorMessage",dataPath:t+"/"+i,schemaPath:"#/items/allOf/0/then/errorMessage",params:{errors:e},message:"invalid scope "+JSON.stringify(n&&n.type)+", missing id"};null===o?o=[r]:o.push(r),a++}const r=[];for(const e of o)e.emUsed||r.push(e);o=r,a=r.length}P=s=e===a}if(!P){const e={keyword:"if",dataPath:t+"/"+i,schemaPath:"#/items/allOf/0/if",params:{failingKeyword:"then"},message:'should match "then" schema'};null===o?o=[e]:o.push(e),a++}if(n&&"object"==typeof n&&!Array.isArray(n)){if(void 0===n.type){const e={keyword:"required",dataPath:t+"/"+i,schemaPath:"#/items/required",params:{missingProperty:"type"},message:"should have required property 'type'"};null===o?o=[e]:o.push(e),a++}if(void 0===n.properties){const e={keyword:"required",dataPath:t+"/"+i,schemaPath:"#/items/required",params:{missingProperty:"properties"},message:"should have required property 'properties'"};null===o?o=[e]:o.push(e),a++}if(void 0!==n.type){let e=n.type;if("string"!=typeof e){const e={keyword:"type",dataPath:t+"/"+i+"/type",schemaPath:"#/items/properties/type/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}if("camunda:Connector"!==e&&"bpmn:Error"!==e){const e={keyword:"enum",dataPath:t+"/"+i+"/type",schemaPath:"#/items/properties/type/enum",params:{allowedValues:_A.items.properties.type.enum},message:"should be equal to one of the allowed values"};null===o?o=[e]:o.push(e),a++}if(a>0){const n=[];for(const e of o)"errorMessage"===e.keyword||e.emUsed||e.dataPath!==t+"/"+i+"/type"&&(0!==e.dataPath.indexOf(t+"/"+i+"/type")||"/"!==e.dataPath[t+"/"+i+"/type".length])||0!==e.schemaPath.indexOf("#/items/properties/type")||"/"!==e.schemaPath["#/items/properties/type".length]||(n.push(e),e.emUsed=!0);if(n.length){const r={keyword:"errorMessage",dataPath:t+"/"+i+"/type",schemaPath:"#/items/properties/type/errorMessage",params:{errors:n},message:"invalid scope type "+JSON.stringify(e)+"; must be any of { camunda:Connector, bpmn:Error }"};null===o?o=[r]:o.push(r),a++}const r=[];for(const e of o)e.emUsed||r.push(e);o=r,a=r.length}}if(void 0!==n.properties){let e=n.properties;if(Array.isArray(e)){const n=e.length;for(let r=0;r<n;r++){let n=e[r];const s=a;let P=!0;const S=a;if(n&&"object"==typeof n&&!Array.isArray(n))if(void 0===n.type){const e={};null===o?o=[e]:o.push(e),a++}else if(void 0!==n.type&&!fA(n.type,"Dropdown")){const e={};null===o?o=[e]:o.push(e),a++}var c=S===a;if(a=s,null!==o&&(s?o.length=s:o=null),c){const e=a;if(n&&"object"==typeof n&&!Array.isArray(n)&&void 0===n.choices){const e={keyword:"required",dataPath:t+"/"+i+"/properties/"+r,schemaPath:"#/definitions/properties/items/allOf/0/then/required",params:{missingProperty:"choices"},message:"should have required property 'choices'"};null===o?o=[e]:o.push(e),a++}if(a>0){const e=[];for(const n of o)"errorMessage"===n.keyword||n.emUsed||n.dataPath!==t+"/"+i+"/properties/"+r&&(0!==n.dataPath.indexOf(t+"/"+i+"/properties/"+r)||"/"!==n.dataPath[t+"/"+i+"/properties/"+r.length])||0!==n.schemaPath.indexOf("#/definitions/properties/items/allOf/0/then")||"/"!==n.schemaPath["#/definitions/properties/items/allOf/0/then".length]||(e.push(n),n.emUsed=!0);if(e.length){const n={keyword:"errorMessage",dataPath:t+"/"+i+"/properties/"+r,schemaPath:"#/definitions/properties/items/allOf/0/then/errorMessage",params:{errors:e},message:'must provide choices=[] with "Dropdown" type'};null===o?o=[n]:o.push(n),a++}const n=[];for(const e of o)e.emUsed||n.push(e);o=n,a=n.length}P=c=e===a}if(!P){const e={keyword:"if",dataPath:t+"/"+i+"/properties/"+r,schemaPath:"#/definitions/properties/items/allOf/0/if",params:{failingKeyword:"then"},message:'should match "then" schema'};null===o?o=[e]:o.push(e),a++}const O=a;let C=!0;const T=a;if(n&&"object"==typeof n&&!Array.isArray(n))if(void 0===n.binding){const e={};null===o?o=[e]:o.push(e),a++}else if(void 0!==n.binding){let e=n.binding;if(e&&"object"==typeof e&&!Array.isArray(e))if(void 0===e.type){const e={};null===o?o=[e]:o.push(e),a++}else if(void 0!==e.type&&!fA(e.type,"property")){const e={};null===o?o=[e]:o.push(e),a++}}var p=T===a;if(a=O,null!==o&&(O?o.length=O:o=null),p){const e=a;if(n&&"object"==typeof n&&!Array.isArray(n)&&void 0!==n.type){let e=n.type;if("String"!==e&&"Text"!==e&&"Hidden"!==e&&"Dropdown"!==e&&"Boolean"!==e){const e={keyword:"enum",dataPath:t+"/"+i+"/properties/"+r+"/type",schemaPath:"#/definitions/properties/items/allOf/1/then/properties/type/enum",params:{allowedValues:bA.items.allOf[1].then.properties.type.enum},message:"should be equal to one of the allowed values"};null===o?o=[e]:o.push(e),a++}if(a>0){const n=[];for(const e of o)"errorMessage"===e.keyword||e.emUsed||e.dataPath!==t+"/"+i+"/properties/"+r+"/type"&&(0!==e.dataPath.indexOf(t+"/"+i+"/properties/"+r+"/type")||"/"!==e.dataPath[t+"/"+i+"/properties/"+r+"/type".length])||0!==e.schemaPath.indexOf("#/definitions/properties/items/allOf/1/then/properties/type")||"/"!==e.schemaPath["#/definitions/properties/items/allOf/1/then/properties/type".length]||(n.push(e),e.emUsed=!0);if(n.length){const s={keyword:"errorMessage",dataPath:t+"/"+i+"/properties/"+r+"/type",schemaPath:"#/definitions/properties/items/allOf/1/then/properties/type/errorMessage",params:{errors:n},message:"invalid property type "+JSON.stringify(e)+' for binding type "property"; must be any of { String, Text, Hidden, Dropdown, Boolean }'};null===o?o=[s]:o.push(s),a++}const s=[];for(const e of o)e.emUsed||s.push(e);o=s,a=s.length}}C=p=e===a}if(!C){const e={keyword:"if",dataPath:t+"/"+i+"/properties/"+r,schemaPath:"#/definitions/properties/items/allOf/1/if",params:{failingKeyword:"then"},message:'should match "then" schema'};null===o?o=[e]:o.push(e),a++}const A=a;let R=!0;const k=a;if(n&&"object"==typeof n&&!Array.isArray(n))if(void 0===n.binding){const e={};null===o?o=[e]:o.push(e),a++}else if(void 0!==n.binding){let e=n.binding;if(e&&"object"==typeof e&&!Array.isArray(e))if(void 0===e.type){const e={};null===o?o=[e]:o.push(e),a++}else if(void 0!==e.type&&!fA(e.type,"camunda:executionListener")){const e={};null===o?o=[e]:o.push(e),a++}}var u=k===a;if(a=A,null!==o&&(A?o.length=A:o=null),u){const e=a;if(n&&"object"==typeof n&&!Array.isArray(n)&&void 0!==n.type){if("Hidden"!==n.type){const e={keyword:"enum",dataPath:t+"/"+i+"/properties/"+r+"/type",schemaPath:"#/definitions/properties/items/allOf/2/then/properties/type/enum",params:{allowedValues:bA.items.allOf[2].then.properties.type.enum},message:"should be equal to one of the allowed values"};null===o?o=[e]:o.push(e),a++}if(a>0){const e=[];for(const n of o)"errorMessage"===n.keyword||n.emUsed||n.dataPath!==t+"/"+i+"/properties/"+r+"/type"&&(0!==n.dataPath.indexOf(t+"/"+i+"/properties/"+r+"/type")||"/"!==n.dataPath[t+"/"+i+"/properties/"+r+"/type".length])||0!==n.schemaPath.indexOf("#/definitions/properties/items/allOf/2/then/properties/type")||"/"!==n.schemaPath["#/definitions/properties/items/allOf/2/then/properties/type".length]||(e.push(n),n.emUsed=!0);if(e.length){const s={keyword:"errorMessage",dataPath:t+"/"+i+"/properties/"+r+"/type",schemaPath:"#/definitions/properties/items/allOf/2/then/properties/type/errorMessage",params:{errors:e},message:"invalid property type "+JSON.stringify(n&&n.type)+' for binding type "camunda:executionListener"; must be "Hidden"'};null===o?o=[s]:o.push(s),a++}const s=[];for(const e of o)e.emUsed||s.push(e);o=s,a=s.length}}R=u=e===a}if(!R){const e={keyword:"if",dataPath:t+"/"+i+"/properties/"+r,schemaPath:"#/definitions/properties/items/allOf/2/if",params:{failingKeyword:"then"},message:'should match "then" schema'};null===o?o=[e]:o.push(e),a++}const j=a;let M=!0;const D=a;if(n&&"object"==typeof n&&!Array.isArray(n))if(void 0===n.binding){const e={};null===o?o=[e]:o.push(e),a++}else if(void 0!==n.binding){let e=n.binding;if(e&&"object"==typeof e&&!Array.isArray(e))if(void 0===e.type){const e={};null===o?o=[e]:o.push(e),a++}else if(void 0!==e.type){let t=e.type;if("camunda:property"!==t&&"camunda:outputParameter"!==t&&"camunda:in"!==t&&"camunda:in:businessKey"!==t&&"camunda:out"!==t&&"camunda:errorEventDefinition"!==t){const e={};null===o?o=[e]:o.push(e),a++}}}var l=D===a;if(a=j,null!==o&&(j?o.length=j:o=null),l){const e=a;if(n&&"object"==typeof n&&!Array.isArray(n)&&void 0!==n.type){let e=n.type;if("String"!==e&&"Hidden"!==e&&"Dropdown"!==e){const e={keyword:"enum",dataPath:t+"/"+i+"/properties/"+r+"/type",schemaPath:"#/definitions/properties/items/allOf/3/then/properties/type/enum",params:{allowedValues:bA.items.allOf[3].then.properties.type.enum},message:"should be equal to one of the allowed values"};null===o?o=[e]:o.push(e),a++}if(a>0){const s=[];for(const e of o)"errorMessage"===e.keyword||e.emUsed||e.dataPath!==t+"/"+i+"/properties/"+r+"/type"&&(0!==e.dataPath.indexOf(t+"/"+i+"/properties/"+r+"/type")||"/"!==e.dataPath[t+"/"+i+"/properties/"+r+"/type".length])||0!==e.schemaPath.indexOf("#/definitions/properties/items/allOf/3/then/properties/type")||"/"!==e.schemaPath["#/definitions/properties/items/allOf/3/then/properties/type".length]||(s.push(e),e.emUsed=!0);if(s.length){const c={keyword:"errorMessage",dataPath:t+"/"+i+"/properties/"+r+"/type",schemaPath:"#/definitions/properties/items/allOf/3/then/properties/type/errorMessage",params:{errors:s},message:"invalid property type "+JSON.stringify(e)+" for binding type "+JSON.stringify(n&&n.binding&&n.binding.type)+"; must be any of { String, Hidden, Dropdown }"};null===o?o=[c]:o.push(c),a++}const c=[];for(const e of o)e.emUsed||c.push(e);o=c,a=c.length}}M=l=e===a}if(!M){const e={keyword:"if",dataPath:t+"/"+i+"/properties/"+r,schemaPath:"#/definitions/properties/items/allOf/3/if",params:{failingKeyword:"then"},message:'should match "then" schema'};null===o?o=[e]:o.push(e),a++}const B=a;let I=!0;const N=a;if(n&&"object"==typeof n&&!Array.isArray(n))if(void 0===n.binding){const e={};null===o?o=[e]:o.push(e),a++}else if(void 0!==n.binding){let e=n.binding;if(e&&"object"==typeof e&&!Array.isArray(e))if(void 0===e.type){const e={};null===o?o=[e]:o.push(e),a++}else if(void 0!==e.type){let t=e.type;if("camunda:inputParameter"!==t&&"camunda:field"!==t){const e={};null===o?o=[e]:o.push(e),a++}}}var d=N===a;if(a=B,null!==o&&(B?o.length=B:o=null),d){const e=a;if(n&&"object"==typeof n&&!Array.isArray(n)&&void 0!==n.type){let e=n.type;if("String"!==e&&"Text"!==e&&"Hidden"!==e&&"Dropdown"!==e){const e={keyword:"enum",dataPath:t+"/"+i+"/properties/"+r+"/type",schemaPath:"#/definitions/properties/items/allOf/4/then/properties/type/enum",params:{allowedValues:bA.items.allOf[4].then.properties.type.enum},message:"should be equal to one of the allowed values"};null===o?o=[e]:o.push(e),a++}if(a>0){const s=[];for(const e of o)"errorMessage"===e.keyword||e.emUsed||e.dataPath!==t+"/"+i+"/properties/"+r+"/type"&&(0!==e.dataPath.indexOf(t+"/"+i+"/properties/"+r+"/type")||"/"!==e.dataPath[t+"/"+i+"/properties/"+r+"/type".length])||0!==e.schemaPath.indexOf("#/definitions/properties/items/allOf/4/then/properties/type")||"/"!==e.schemaPath["#/definitions/properties/items/allOf/4/then/properties/type".length]||(s.push(e),e.emUsed=!0);if(s.length){const c={keyword:"errorMessage",dataPath:t+"/"+i+"/properties/"+r+"/type",schemaPath:"#/definitions/properties/items/allOf/4/then/properties/type/errorMessage",params:{errors:s},message:"invalid property type "+JSON.stringify(e)+" for binding type "+JSON.stringify(n&&n.binding&&n.binding.type)+"; must be any of { String, Text, Hidden, Dropdown }"};null===o?o=[c]:o.push(c),a++}const c=[];for(const e of o)e.emUsed||c.push(e);o=c,a=c.length}}I=d=e===a}if(!I){const e={keyword:"if",dataPath:t+"/"+i+"/properties/"+r,schemaPath:"#/definitions/properties/items/allOf/4/if",params:{failingKeyword:"then"},message:'should match "then" schema'};null===o?o=[e]:o.push(e),a++}if(n&&"object"==typeof n&&!Array.isArray(n)){if(void 0===n.binding){const e={keyword:"required",dataPath:t+"/"+i+"/properties/"+r,schemaPath:"#/definitions/properties/items/required",params:{missingProperty:"binding"},message:"should have required property 'binding'"};null===o?o=[e]:o.push(e),a++}if(void 0!==n.value){let e=n.value;if("string"!=typeof e&&"boolean"!=typeof e){const e={keyword:"type",dataPath:t+"/"+i+"/properties/"+r+"/value",schemaPath:"#/definitions/properties/items/properties/value/type",params:{type:bA.items.properties.value.type},message:"should be string,boolean"};null===o?o=[e]:o.push(e),a++}}if(void 0!==n.description&&"string"!=typeof n.description){const e={keyword:"type",dataPath:t+"/"+i+"/properties/"+r+"/description",schemaPath:"#/definitions/properties/items/properties/description/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}if(void 0!==n.label&&"string"!=typeof n.label){const e={keyword:"type",dataPath:t+"/"+i+"/properties/"+r+"/label",schemaPath:"#/definitions/properties/items/properties/label/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}if(void 0!==n.type&&"string"!=typeof n.type){const e={keyword:"type",dataPath:t+"/"+i+"/properties/"+r+"/type",schemaPath:"#/definitions/properties/items/properties/type/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}if(void 0!==n.editable&&"boolean"!=typeof n.editable){const e={keyword:"type",dataPath:t+"/"+i+"/properties/"+r+"/editable",schemaPath:"#/definitions/properties/items/properties/editable/type",params:{type:"boolean"},message:"should be boolean"};null===o?o=[e]:o.push(e),a++}if(void 0!==n.choices){let e=n.choices;if(Array.isArray(e)){const n=e.length;for(let s=0;s<n;s++){let n=e[s];if(n&&"object"==typeof n&&!Array.isArray(n)){if(void 0===n.value){const e={keyword:"required",dataPath:t+"/"+i+"/properties/"+r+"/choices/"+s,schemaPath:"#/definitions/properties/items/properties/choices/items/required",params:{missingProperty:"value"},message:"should have required property 'value'"};null===o?o=[e]:o.push(e),a++}if(void 0===n.name){const e={keyword:"required",dataPath:t+"/"+i+"/properties/"+r+"/choices/"+s,schemaPath:"#/definitions/properties/items/properties/choices/items/required",params:{missingProperty:"name"},message:"should have required property 'name'"};null===o?o=[e]:o.push(e),a++}if(void 0!==n.name&&"string"!=typeof n.name){const e={keyword:"type",dataPath:t+"/"+i+"/properties/"+r+"/choices/"+s+"/name",schemaPath:"#/definitions/properties/items/properties/choices/items/properties/name/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}if(void 0!==n.value&&"string"!=typeof n.value){const e={keyword:"type",dataPath:t+"/"+i+"/properties/"+r+"/choices/"+s+"/value",schemaPath:"#/definitions/properties/items/properties/choices/items/properties/value/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}}else{const e={keyword:"type",dataPath:t+"/"+i+"/properties/"+r+"/choices/"+s,schemaPath:"#/definitions/properties/items/properties/choices/items/type",params:{type:"object"},message:"should be object"};null===o?o=[e]:o.push(e),a++}if(a>0){const e=[];for(const n of o)"errorMessage"===n.keyword||n.emUsed||n.dataPath!==t+"/"+i+"/properties/"+r+"/choices/"+s&&(0!==n.dataPath.indexOf(t+"/"+i+"/properties/"+r+"/choices/"+s)||"/"!==n.dataPath[t+"/"+i+"/properties/"+r+"/choices/"+s.length])||0!==n.schemaPath.indexOf("#/definitions/properties/items/properties/choices/items")||"/"!==n.schemaPath["#/definitions/properties/items/properties/choices/items".length]||(e.push(n),n.emUsed=!0);if(e.length){const n={keyword:"errorMessage",dataPath:t+"/"+i+"/properties/"+r+"/choices/"+s,schemaPath:"#/definitions/properties/items/properties/choices/items/errorMessage",params:{errors:e},message:'{ name, value } must be specified for "Dropdown" choices'};null===o?o=[n]:o.push(n),a++}const n=[];for(const e of o)e.emUsed||n.push(e);o=n,a=n.length}}}else{const e={keyword:"type",dataPath:t+"/"+i+"/properties/"+r+"/choices",schemaPath:"#/definitions/properties/items/properties/choices/type",params:{type:"array"},message:"should be array"};null===o?o=[e]:o.push(e),a++}}if(void 0!==n.binding){let e=n.binding;const s=a;let c=!0;const p=a;if(e&&"object"==typeof e&&!Array.isArray(e))if(void 0===e.type){const e={};null===o?o=[e]:o.push(e),a++}else if(void 0!==e.type){let t=e.type;if("property"!==t&&"camunda:property"!==t&&"camunda:inputParameter"!==t&&"camunda:field"!==t){const e={};null===o?o=[e]:o.push(e),a++}}var h=p===a;if(a=s,null!==o&&(s?o.length=s:o=null),h){const n=a;if(e&&"object"==typeof e&&!Array.isArray(e)&&void 0===e.name){const e={keyword:"required",dataPath:t+"/"+i+"/properties/"+r+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/0/then/required",params:{missingProperty:"name"},message:"should have required property 'name'"};null===o?o=[e]:o.push(e),a++}if(a>0){const n=[];for(const e of o)"errorMessage"===e.keyword||e.emUsed||e.dataPath!==t+"/"+i+"/properties/"+r+"/binding"&&(0!==e.dataPath.indexOf(t+"/"+i+"/properties/"+r+"/binding")||"/"!==e.dataPath[t+"/"+i+"/properties/"+r+"/binding".length])||0!==e.schemaPath.indexOf("#/definitions/properties/items/properties/binding/allOf/0/then")||"/"!==e.schemaPath["#/definitions/properties/items/properties/binding/allOf/0/then".length]||(n.push(e),e.emUsed=!0);if(n.length){const s={keyword:"errorMessage",dataPath:t+"/"+i+"/properties/"+r+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/0/then/errorMessage",params:{errors:n},message:"property.binding "+JSON.stringify(e&&e.type)+" requires name"};null===o?o=[s]:o.push(s),a++}const s=[];for(const e of o)e.emUsed||s.push(e);o=s,a=s.length}c=h=n===a}if(!c){const e={keyword:"if",dataPath:t+"/"+i+"/properties/"+r+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/0/if",params:{failingKeyword:"then"},message:'should match "then" schema'};null===o?o=[e]:o.push(e),a++}const u=a;let l=!0;const d=a;if(e&&"object"==typeof e&&!Array.isArray(e))if(void 0===e.type){const e={};null===o?o=[e]:o.push(e),a++}else if(void 0!==e.type&&!fA(e.type,"camunda:outputParameter")){const e={};null===o?o=[e]:o.push(e),a++}var m=d===a;if(a=u,null!==o&&(u?o.length=u:o=null),m){const n=a;if(e&&"object"==typeof e&&!Array.isArray(e)&&void 0===e.source){const e={keyword:"required",dataPath:t+"/"+i+"/properties/"+r+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/1/then/required",params:{missingProperty:"source"},message:"should have required property 'source'"};null===o?o=[e]:o.push(e),a++}if(a>0){const n=[];for(const e of o)"errorMessage"===e.keyword||e.emUsed||e.dataPath!==t+"/"+i+"/properties/"+r+"/binding"&&(0!==e.dataPath.indexOf(t+"/"+i+"/properties/"+r+"/binding")||"/"!==e.dataPath[t+"/"+i+"/properties/"+r+"/binding".length])||0!==e.schemaPath.indexOf("#/definitions/properties/items/properties/binding/allOf/1/then")||"/"!==e.schemaPath["#/definitions/properties/items/properties/binding/allOf/1/then".length]||(n.push(e),e.emUsed=!0);if(n.length){const s={keyword:"errorMessage",dataPath:t+"/"+i+"/properties/"+r+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/1/then/errorMessage",params:{errors:n},message:"property.binding "+JSON.stringify(e&&e.type)+" requires source"};null===o?o=[s]:o.push(s),a++}const s=[];for(const e of o)e.emUsed||s.push(e);o=s,a=s.length}l=m=n===a}if(!l){const e={keyword:"if",dataPath:t+"/"+i+"/properties/"+r+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/1/if",params:{failingKeyword:"then"},message:'should match "then" schema'};null===o?o=[e]:o.push(e),a++}const _=a;let P=!0;const S=a;if(e&&"object"==typeof e&&!Array.isArray(e))if(void 0===e.type){const e={};null===o?o=[e]:o.push(e),a++}else if(void 0!==e.type&&!fA(e.type,"camunda:in")){const e={};null===o?o=[e]:o.push(e),a++}var f=S===a;if(a=_,null!==o&&(_?o.length=_:o=null),f){const n=a,s=a;let c=!1;const p=a;if(e&&"object"==typeof e&&!Array.isArray(e)&&void 0===e.variables){const e={keyword:"required",dataPath:t+"/"+i+"/properties/"+r+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/2/then/anyOf/0/required",params:{missingProperty:"variables"},message:"should have required property 'variables'"};null===o?o=[e]:o.push(e),a++}var v=p===a;if(c=c||v,!c){const n=a;if(e&&"object"==typeof e&&!Array.isArray(e)&&void 0===e.target){const e={keyword:"required",dataPath:t+"/"+i+"/properties/"+r+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/2/then/anyOf/1/required",params:{missingProperty:"target"},message:"should have required property 'target'"};null===o?o=[e]:o.push(e),a++}v=n===a;c=c||v}if(c)a=s,null!==o&&(s?o.length=s:o=null);else{const e={keyword:"anyOf",dataPath:t+"/"+i+"/properties/"+r+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/2/then/anyOf",params:{},message:"should match some schema in anyOf"};null===o?o=[e]:o.push(e),a++}if(a>0){const n=[];for(const e of o)"errorMessage"===e.keyword||e.emUsed||e.dataPath!==t+"/"+i+"/properties/"+r+"/binding"&&(0!==e.dataPath.indexOf(t+"/"+i+"/properties/"+r+"/binding")||"/"!==e.dataPath[t+"/"+i+"/properties/"+r+"/binding".length])||0!==e.schemaPath.indexOf("#/definitions/properties/items/properties/binding/allOf/2/then")||"/"!==e.schemaPath["#/definitions/properties/items/properties/binding/allOf/2/then".length]||(n.push(e),e.emUsed=!0);if(n.length){const s={keyword:"errorMessage",dataPath:t+"/"+i+"/properties/"+r+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/2/then/errorMessage",params:{errors:n},message:"property.binding "+JSON.stringify(e&&e.type)+" requires variables, target, or both"};null===o?o=[s]:o.push(s),a++}const s=[];for(const e of o)e.emUsed||s.push(e);o=s,a=s.length}P=f=n===a}if(!P){const e={keyword:"if",dataPath:t+"/"+i+"/properties/"+r+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/2/if",params:{failingKeyword:"then"},message:'should match "then" schema'};null===o?o=[e]:o.push(e),a++}const O=a;let C=!0;const T=a;if(e&&"object"==typeof e&&!Array.isArray(e))if(void 0===e.type){const e={};null===o?o=[e]:o.push(e),a++}else if(void 0!==e.type&&!fA(e.type,"camunda:out")){const e={};null===o?o=[e]:o.push(e),a++}var y=T===a;if(a=O,null!==o&&(O?o.length=O:o=null),y){const n=a,s=a;let c=!1,p=null;const u=a,l=a,d=a,h=a;let m=!1;const f=a;if(e&&"object"==typeof e&&!Array.isArray(e)&&void 0===e.source){const e={};null===o?o=[e]:o.push(e),a++}var g=f===a;if(m=m||g,!m){const t=a;if(e&&"object"==typeof e&&!Array.isArray(e)&&void 0===e.sourceExpression){const e={};null===o?o=[e]:o.push(e),a++}g=t===a;m=m||g}if(m)a=h,null!==o&&(h?o.length=h:o=null);else{const e={};null===o?o=[e]:o.push(e),a++}if(d===a){const e={keyword:"not",dataPath:t+"/"+i+"/properties/"+r+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/3/then/oneOf/0/not",params:{},message:"should NOT be valid"};null===o?o=[e]:o.push(e),a++}else a=l,null!==o&&(l?o.length=l:o=null);if(e&&"object"==typeof e&&!Array.isArray(e)&&void 0===e.variables){const e={keyword:"required",dataPath:t+"/"+i+"/properties/"+r+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/3/then/oneOf/0/required",params:{missingProperty:"variables"},message:"should have required property 'variables'"};null===o?o=[e]:o.push(e),a++}(E=u===a)&&(c=!0,p=0);const v=a,w=a,_=a,P=a;let S=!1;const O=a;if(e&&"object"==typeof e&&!Array.isArray(e)&&void 0===e.variables){const e={};null===o?o=[e]:o.push(e),a++}var b=O===a;if(S=S||b,!S){const t=a;if(e&&"object"==typeof e&&!Array.isArray(e)&&void 0===e.sourceExpression){const e={};null===o?o=[e]:o.push(e),a++}b=t===a;S=S||b}if(S)a=P,null!==o&&(P?o.length=P:o=null);else{const e={};null===o?o=[e]:o.push(e),a++}if(_===a){const e={keyword:"not",dataPath:t+"/"+i+"/properties/"+r+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/3/then/oneOf/1/not",params:{},message:"should NOT be valid"};null===o?o=[e]:o.push(e),a++}else a=w,null!==o&&(w?o.length=w:o=null);if(e&&"object"==typeof e&&!Array.isArray(e)&&void 0===e.source){const e={keyword:"required",dataPath:t+"/"+i+"/properties/"+r+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/3/then/oneOf/1/required",params:{missingProperty:"source"},message:"should have required property 'source'"};null===o?o=[e]:o.push(e),a++}if((E=v===a)&&c)c=!1,p=[p,1];else{E&&(c=!0,p=1);const n=a,s=a,u=a,l=a;let d=!1;const h=a;if(e&&"object"==typeof e&&!Array.isArray(e)&&void 0===e.variables){const e={};null===o?o=[e]:o.push(e),a++}var x=h===a;if(d=d||x,!d){const t=a;if(e&&"object"==typeof e&&!Array.isArray(e)&&void 0===e.source){const e={};null===o?o=[e]:o.push(e),a++}x=t===a;d=d||x}if(d)a=l,null!==o&&(l?o.length=l:o=null);else{const e={};null===o?o=[e]:o.push(e),a++}if(u===a){const e={keyword:"not",dataPath:t+"/"+i+"/properties/"+r+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/3/then/oneOf/2/not",params:{},message:"should NOT be valid"};null===o?o=[e]:o.push(e),a++}else a=s,null!==o&&(s?o.length=s:o=null);if(e&&"object"==typeof e&&!Array.isArray(e)&&void 0===e.sourceExpression){const e={keyword:"required",dataPath:t+"/"+i+"/properties/"+r+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/3/then/oneOf/2/required",params:{missingProperty:"sourceExpression"},message:"should have required property 'sourceExpression'"};null===o?o=[e]:o.push(e),a++}if((E=n===a)&&c)c=!1,p=[p,2];else{E&&(c=!0,p=2);const n=a,s=a,u=a;if(e&&"object"==typeof e&&!Array.isArray(e)&&void 0===e.source){const e={};null===o?o=[e]:o.push(e),a++}if(u===a){const e={keyword:"not",dataPath:t+"/"+i+"/properties/"+r+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/3/then/oneOf/3/not",params:{},message:"should NOT be valid"};null===o?o=[e]:o.push(e),a++}else a=s,null!==o&&(s?o.length=s:o=null);if(e&&"object"==typeof e&&!Array.isArray(e)){if(void 0===e.variables){const e={keyword:"required",dataPath:t+"/"+i+"/properties/"+r+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/3/then/oneOf/3/required",params:{missingProperty:"variables"},message:"should have required property 'variables'"};null===o?o=[e]:o.push(e),a++}if(void 0===e.sourceExpression){const e={keyword:"required",dataPath:t+"/"+i+"/properties/"+r+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/3/then/oneOf/3/required",params:{missingProperty:"sourceExpression"},message:"should have required property 'sourceExpression'"};null===o?o=[e]:o.push(e),a++}}if((E=n===a)&&c)c=!1,p=[p,3];else{E&&(c=!0,p=3);const n=a,s=a,u=a;if(e&&"object"==typeof e&&!Array.isArray(e)&&void 0===e.sourceExpression){const e={};null===o?o=[e]:o.push(e),a++}var E;if(u===a){const e={keyword:"not",dataPath:t+"/"+i+"/properties/"+r+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/3/then/oneOf/4/not",params:{},message:"should NOT be valid"};null===o?o=[e]:o.push(e),a++}else a=s,null!==o&&(s?o.length=s:o=null);if(e&&"object"==typeof e&&!Array.isArray(e)){if(void 0===e.variables){const e={keyword:"required",dataPath:t+"/"+i+"/properties/"+r+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/3/then/oneOf/4/required",params:{missingProperty:"variables"},message:"should have required property 'variables'"};null===o?o=[e]:o.push(e),a++}if(void 0===e.source){const e={keyword:"required",dataPath:t+"/"+i+"/properties/"+r+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/3/then/oneOf/4/required",params:{missingProperty:"source"},message:"should have required property 'source'"};null===o?o=[e]:o.push(e),a++}}(E=n===a)&&c?(c=!1,p=[p,4]):E&&(c=!0,p=4)}}}if(c)a=s,null!==o&&(s?o.length=s:o=null);else{const e={keyword:"oneOf",dataPath:t+"/"+i+"/properties/"+r+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/3/then/oneOf",params:{passingSchemas:p},message:"should match exactly one schema in oneOf"};null===o?o=[e]:o.push(e),a++}if(a>0){const n=[];for(const e of o)"errorMessage"===e.keyword||e.emUsed||e.dataPath!==t+"/"+i+"/properties/"+r+"/binding"&&(0!==e.dataPath.indexOf(t+"/"+i+"/properties/"+r+"/binding")||"/"!==e.dataPath[t+"/"+i+"/properties/"+r+"/binding".length])||0!==e.schemaPath.indexOf("#/definitions/properties/items/properties/binding/allOf/3/then")||"/"!==e.schemaPath["#/definitions/properties/items/properties/binding/allOf/3/then".length]||(n.push(e),e.emUsed=!0);if(n.length){const s={keyword:"errorMessage",dataPath:t+"/"+i+"/properties/"+r+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/3/then/errorMessage",params:{errors:n},message:"property.binding "+JSON.stringify(e&&e.type)+" requires one of the following: variables, sourceExpression, source, (sourceExpression and variables), or (source and variables)"};null===o?o=[s]:o.push(s),a++}const s=[];for(const e of o)e.emUsed||s.push(e);o=s,a=s.length}C=y=n===a}if(!C){const e={keyword:"if",dataPath:t+"/"+i+"/properties/"+r+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/3/if",params:{failingKeyword:"then"},message:'should match "then" schema'};null===o?o=[e]:o.push(e),a++}const A=a;let R=!0;const k=a;if(e&&"object"==typeof e&&!Array.isArray(e))if(void 0===e.type){const e={};null===o?o=[e]:o.push(e),a++}else if(void 0!==e.type&&!fA(e.type,"camunda:errorEventDefinition")){const e={};null===o?o=[e]:o.push(e),a++}var w=k===a;if(a=A,null!==o&&(A?o.length=A:o=null),w){const n=a,s=a;let c=!1,p=null;const u=a;if(e&&"object"==typeof e&&!Array.isArray(e)&&void 0===e.errorRef){const e={keyword:"required",dataPath:t+"/"+i+"/properties/"+r+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/4/then/oneOf/0/required",params:{missingProperty:"errorRef"},message:"should have required property 'errorRef'"};null===o?o=[e]:o.push(e),a++}if(u===a&&(c=!0,p=0),c)a=s,null!==o&&(s?o.length=s:o=null);else{const e={keyword:"oneOf",dataPath:t+"/"+i+"/properties/"+r+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/4/then/oneOf",params:{passingSchemas:p},message:"should match exactly one schema in oneOf"};null===o?o=[e]:o.push(e),a++}if(a>0){const n=[];for(const e of o)"errorMessage"===e.keyword||e.emUsed||e.dataPath!==t+"/"+i+"/properties/"+r+"/binding"&&(0!==e.dataPath.indexOf(t+"/"+i+"/properties/"+r+"/binding")||"/"!==e.dataPath[t+"/"+i+"/properties/"+r+"/binding".length])||0!==e.schemaPath.indexOf("#/definitions/properties/items/properties/binding/allOf/4/then")||"/"!==e.schemaPath["#/definitions/properties/items/properties/binding/allOf/4/then".length]||(n.push(e),e.emUsed=!0);if(n.length){const s={keyword:"errorMessage",dataPath:t+"/"+i+"/properties/"+r+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/4/then/errorMessage",params:{errors:n},message:"property.binding "+JSON.stringify(e&&e.type)+" requires errorRef"};null===o?o=[s]:o.push(s),a++}const s=[];for(const e of o)e.emUsed||s.push(e);o=s,a=s.length}R=w=n===a}if(!R){const e={keyword:"if",dataPath:t+"/"+i+"/properties/"+r+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/4/if",params:{failingKeyword:"then"},message:'should match "then" schema'};null===o?o=[e]:o.push(e),a++}if(e&&"object"==typeof e&&!Array.isArray(e)){if(void 0===e.type){const e={keyword:"required",dataPath:t+"/"+i+"/properties/"+r+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/required",params:{missingProperty:"type"},message:"should have required property 'type'"};null===o?o=[e]:o.push(e),a++}if(void 0!==e.type){let n=e.type;if("string"!=typeof n){const e={keyword:"type",dataPath:t+"/"+i+"/properties/"+r+"/binding/type",schemaPath:"#/definitions/properties/items/properties/binding/properties/type/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}if("property"!==n&&"camunda:property"!==n&&"camunda:inputParameter"!==n&&"camunda:outputParameter"!==n&&"camunda:in"!==n&&"camunda:out"!==n&&"camunda:in:businessKey"!==n&&"camunda:executionListener"!==n&&"camunda:field"!==n&&"camunda:errorEventDefinition"!==n){const e={keyword:"enum",dataPath:t+"/"+i+"/properties/"+r+"/binding/type",schemaPath:"#/definitions/properties/items/properties/binding/properties/type/enum",params:{allowedValues:bA.items.properties.binding.properties.type.enum},message:"should be equal to one of the allowed values"};null===o?o=[e]:o.push(e),a++}if(a>0){const e=[];for(const n of o)"errorMessage"===n.keyword||n.emUsed||n.dataPath!==t+"/"+i+"/properties/"+r+"/binding/type"&&(0!==n.dataPath.indexOf(t+"/"+i+"/properties/"+r+"/binding/type")||"/"!==n.dataPath[t+"/"+i+"/properties/"+r+"/binding/type".length])||0!==n.schemaPath.indexOf("#/definitions/properties/items/properties/binding/properties/type")||"/"!==n.schemaPath["#/definitions/properties/items/properties/binding/properties/type".length]||(e.push(n),n.emUsed=!0);if(e.length){const s={keyword:"errorMessage",dataPath:t+"/"+i+"/properties/"+r+"/binding/type",schemaPath:"#/definitions/properties/items/properties/binding/properties/type/errorMessage",params:{errors:e},message:"invalid property.binding type "+JSON.stringify(n)+"; must be any of { property, camunda:property, camunda:inputParameter, camunda:outputParameter, camunda:in, camunda:out, camunda:in:businessKey, camunda:executionListener, camunda:field, camunda:errorEventDefinition }"};null===o?o=[s]:o.push(s),a++}const s=[];for(const e of o)e.emUsed||s.push(e);o=s,a=s.length}}if(void 0!==e.name&&"string"!=typeof e.name){const e={keyword:"type",dataPath:t+"/"+i+"/properties/"+r+"/binding/name",schemaPath:"#/definitions/properties/items/properties/binding/properties/name/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}if(void 0!==e.event&&"string"!=typeof e.event){const e={keyword:"type",dataPath:t+"/"+i+"/properties/"+r+"/binding/event",schemaPath:"#/definitions/properties/items/properties/binding/properties/event/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}if(void 0!==e.scriptFormat&&"string"!=typeof e.scriptFormat){const e={keyword:"type",dataPath:t+"/"+i+"/properties/"+r+"/binding/scriptFormat",schemaPath:"#/definitions/properties/items/properties/binding/properties/scriptFormat/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}if(void 0!==e.source&&"string"!=typeof e.source){const e={keyword:"type",dataPath:t+"/"+i+"/properties/"+r+"/binding/source",schemaPath:"#/definitions/properties/items/properties/binding/properties/source/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}if(void 0!==e.target&&"string"!=typeof e.target){const e={keyword:"type",dataPath:t+"/"+i+"/properties/"+r+"/binding/target",schemaPath:"#/definitions/properties/items/properties/binding/properties/target/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}if(void 0!==e.expression&&"boolean"!=typeof e.expression){const e={keyword:"type",dataPath:t+"/"+i+"/properties/"+r+"/binding/expression",schemaPath:"#/definitions/properties/items/properties/binding/properties/expression/type",params:{type:"boolean"},message:"should be boolean"};null===o?o=[e]:o.push(e),a++}if(void 0!==e.variables){let n=e.variables;if("string"!=typeof n){const e={keyword:"type",dataPath:t+"/"+i+"/properties/"+r+"/binding/variables",schemaPath:"#/definitions/properties/items/properties/binding/properties/variables/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}if("all"!==n&&"local"!==n){const e={keyword:"enum",dataPath:t+"/"+i+"/properties/"+r+"/binding/variables",schemaPath:"#/definitions/properties/items/properties/binding/properties/variables/enum",params:{allowedValues:bA.items.properties.binding.properties.variables.enum},message:"should be equal to one of the allowed values"};null===o?o=[e]:o.push(e),a++}}if(void 0!==e.sourceExpression&&"string"!=typeof e.sourceExpression){const e={keyword:"type",dataPath:t+"/"+i+"/properties/"+r+"/binding/sourceExpression",schemaPath:"#/definitions/properties/items/properties/binding/properties/sourceExpression/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}}else{const e={keyword:"type",dataPath:t+"/"+i+"/properties/"+r+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/type",params:{type:"object"},message:"should be object"};null===o?o=[e]:o.push(e),a++}}if(void 0!==n.constraints){let e=n.constraints;if(e&&"object"==typeof e&&!Array.isArray(e)){if(void 0!==e.notEmpty&&"boolean"!=typeof e.notEmpty){const e={keyword:"type",dataPath:t+"/"+i+"/properties/"+r+"/constraints/notEmpty",schemaPath:"#/definitions/properties/items/properties/constraints/properties/notEmpty/type",params:{type:"boolean"},message:"should be boolean"};null===o?o=[e]:o.push(e),a++}if(void 0!==e.minLength&&"number"!=typeof e.minLength){const e={keyword:"type",dataPath:t+"/"+i+"/properties/"+r+"/constraints/minLength",schemaPath:"#/definitions/properties/items/properties/constraints/properties/minLength/type",params:{type:"number"},message:"should be number"};null===o?o=[e]:o.push(e),a++}if(void 0!==e.maxLength&&"number"!=typeof e.maxLength){const e={keyword:"type",dataPath:t+"/"+i+"/properties/"+r+"/constraints/maxLength",schemaPath:"#/definitions/properties/items/properties/constraints/properties/maxLength/type",params:{type:"number"},message:"should be number"};null===o?o=[e]:o.push(e),a++}if(void 0!==e.pattern){let n=e.pattern;const s=a;let c=!1,p=null;const u=a;if(n&&"object"==typeof n&&!Array.isArray(n)){if(void 0!==n.value&&"string"!=typeof n.value){const e={keyword:"type",dataPath:t+"/"+i+"/properties/"+r+"/constraints/pattern/value",schemaPath:"#/definitions/properties/items/properties/constraints/properties/pattern/oneOf/0/properties/value/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}if(void 0!==n.message&&"string"!=typeof n.message){const e={keyword:"type",dataPath:t+"/"+i+"/properties/"+r+"/constraints/pattern/message",schemaPath:"#/definitions/properties/items/properties/constraints/properties/pattern/oneOf/0/properties/message/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}}else{const e={keyword:"type",dataPath:t+"/"+i+"/properties/"+r+"/constraints/pattern",schemaPath:"#/definitions/properties/items/properties/constraints/properties/pattern/oneOf/0/type",params:{type:"object"},message:"should be object"};null===o?o=[e]:o.push(e),a++}(_=u===a)&&(c=!0,p=0);const l=a;if("string"!=typeof n){const e={keyword:"type",dataPath:t+"/"+i+"/properties/"+r+"/constraints/pattern",schemaPath:"#/definitions/properties/items/properties/constraints/properties/pattern/oneOf/1/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}var _;if((_=l===a)&&c?(c=!1,p=[p,1]):_&&(c=!0,p=1),c)a=s,null!==o&&(s?o.length=s:o=null);else{const e={keyword:"oneOf",dataPath:t+"/"+i+"/properties/"+r+"/constraints/pattern",schemaPath:"#/definitions/properties/items/properties/constraints/properties/pattern/oneOf",params:{passingSchemas:p},message:"should match exactly one schema in oneOf"};null===o?o=[e]:o.push(e),a++}}}else{const e={keyword:"type",dataPath:t+"/"+i+"/properties/"+r+"/constraints",schemaPath:"#/definitions/properties/items/properties/constraints/type",params:{type:"object"},message:"should be object"};null===o?o=[e]:o.push(e),a++}}}else{const e={keyword:"type",dataPath:t+"/"+i+"/properties/"+r,schemaPath:"#/definitions/properties/items/type",params:{type:"object"},message:"should be object"};null===o?o=[e]:o.push(e),a++}if(a>0){const e={required:{binding:[]}},n={required:{binding:function(){return'missing binding for property "'+JSON.stringify(r)+'"'}}};let s,c;for(const n of o)"errorMessage"!==n.keyword&&!n.emUsed&&n.dataPath===t+"/"+i+"/properties/"+r&&n.keyword in e&&0===n.schemaPath.indexOf("#/definitions/properties/items")&&/^\/[^\/]*$/.test(n.schemaPath.slice(30))&&(s=EA[n.keyword],c=e[n.keyword][n.params[s]],c&&(c.push(n),n.emUsed=!0));for(const s in e)for(const p in e[s])if(c=e[s][p],c.length){const e=n[s]&&n[s][p],u={keyword:"errorMessage",dataPath:t+"/"+i+"/properties/"+r,schemaPath:"#/definitions/properties/items/errorMessage",params:{errors:c},message:e?e():bA.items.errorMessage[s][p]};null===o?o=[u]:o.push(u),a++}const p=[];for(const e of o)e.emUsed||p.push(e);o=p,a=p.length}}}else{const e={keyword:"type",dataPath:t+"/"+i+"/properties",schemaPath:"#/definitions/properties/type",params:{type:"array"},message:"should be array"};null===o?o=[e]:o.push(e),a++}}}else{const e={keyword:"type",dataPath:t+"/"+i,schemaPath:"#/items/type",params:{type:"object"},message:"should be object"};null===o?o=[e]:o.push(e),a++}if(a>0){const e={required:{type:[],properties:[]}},r={required:{properties:function(){return"invalid scope "+JSON.stringify(n&&n.type)+", missing properties=[]"}}};let s,c;for(const n of o)"errorMessage"!==n.keyword&&!n.emUsed&&n.dataPath===t+"/"+i&&n.keyword in e&&0===n.schemaPath.indexOf("#/items")&&/^\/[^\/]*$/.test(n.schemaPath.slice(7))&&(s=EA[n.keyword],c=e[n.keyword][n.params[s]],c&&(c.push(n),n.emUsed=!0));for(const n in e)for(const s in e[n])if(c=e[n][s],c.length){const e=r[n]&&r[n][s],p={keyword:"errorMessage",dataPath:t+"/"+i,schemaPath:"#/items/errorMessage",params:{errors:c},message:e?e():_A.items.errorMessage[n][s]};null===o?o=[p]:o.push(p),a++}const p=[];for(const e of o)e.emUsed||p.push(e);o=p,a=p.length}}}else{const e={keyword:"type",dataPath:t,schemaPath:"#/type",params:{type:"array"},message:"should be array"};null===o?o=[e]:o.push(e),a++}return PA.errors=o,0===a}function SA(e,{dataPath:t="",parentData:n,parentDataProperty:i,rootData:r=e}={}){let o=null,a=0;if(e&&"object"==typeof e&&!Array.isArray(e)){if(void 0===e.name){const e={keyword:"required",dataPath:t,schemaPath:"#/required",params:{missingProperty:"name"},message:"should have required property 'name'"};null===o?o=[e]:o.push(e),a++}if(void 0===e.id){const e={keyword:"required",dataPath:t,schemaPath:"#/required",params:{missingProperty:"id"},message:"should have required property 'id'"};null===o?o=[e]:o.push(e),a++}if(void 0===e.appliesTo){const e={keyword:"required",dataPath:t,schemaPath:"#/required",params:{missingProperty:"appliesTo"},message:"should have required property 'appliesTo'"};null===o?o=[e]:o.push(e),a++}if(void 0===e.properties){const e={keyword:"required",dataPath:t,schemaPath:"#/required",params:{missingProperty:"properties"},message:"should have required property 'properties'"};null===o?o=[e]:o.push(e),a++}if(void 0!==e.name&&"string"!=typeof e.name){const e={keyword:"type",dataPath:t+"/name",schemaPath:"#/properties/name/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}if(void 0!==e.id&&"string"!=typeof e.id){const e={keyword:"type",dataPath:t+"/id",schemaPath:"#/properties/id/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}if(void 0!==e.description&&"string"!=typeof e.description){const e={keyword:"type",dataPath:t+"/description",schemaPath:"#/properties/description/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}if(void 0!==e.version&&"number"!=typeof e.version){const e={keyword:"type",dataPath:t+"/version",schemaPath:"#/properties/version/type",params:{type:"number"},message:"should be number"};null===o?o=[e]:o.push(e),a++}if(void 0!==e.isDefault&&"boolean"!=typeof e.isDefault){const e={keyword:"type",dataPath:t+"/isDefault",schemaPath:"#/properties/isDefault/type",params:{type:"boolean"},message:"should be boolean"};null===o?o=[e]:o.push(e),a++}if(void 0!==e.appliesTo){let n=e.appliesTo;if(Array.isArray(n)){const e=n.length;for(let i=0;i<e;i++){let e=n[i];if("string"==typeof e){if(!xA.test(e)){const e={keyword:"pattern",dataPath:t+"/appliesTo/"+i,schemaPath:"#/properties/appliesTo/items/pattern",params:{pattern:"^(.*?:)"},message:'should match pattern "^(.*?:)"'};null===o?o=[e]:o.push(e),a++}}else{const e={keyword:"type",dataPath:t+"/appliesTo/"+i,schemaPath:"#/properties/appliesTo/items/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}if(a>0){const e={pattern:[]},n={};for(const n of o)"errorMessage"!==n.keyword&&!n.emUsed&&n.dataPath===t+"/appliesTo/"+i&&n.keyword in e&&0===n.schemaPath.indexOf("#/properties/appliesTo/items")&&/^\/[^\/]*$/.test(n.schemaPath.slice(28))&&(e[n.keyword].push(n),n.emUsed=!0);for(const r in e)if(e[r].length){const s={keyword:"errorMessage",dataPath:t+"/appliesTo/"+i,schemaPath:"#/properties/appliesTo/items/errorMessage",params:{errors:e[r]},message:r in n?n[r]():gA.properties.appliesTo.items.errorMessage[r]};null===o?o=[s]:o.push(s),a++}const r=[];for(const e of o)e.emUsed||r.push(e);o=r,a=r.length}}}else{const e={keyword:"type",dataPath:t+"/appliesTo",schemaPath:"#/properties/appliesTo/type",params:{type:"array"},message:"should be array"};null===o?o=[e]:o.push(e),a++}}if(void 0!==e.properties){let n=e.properties;if(Array.isArray(n)){const e=n.length;for(let i=0;i<e;i++){let e=n[i];const r=a;let _=!0;const P=a;if(e&&"object"==typeof e&&!Array.isArray(e))if(void 0===e.type){const e={};null===o?o=[e]:o.push(e),a++}else if(void 0!==e.type&&!fA(e.type,"Dropdown")){const e={};null===o?o=[e]:o.push(e),a++}var s=P===a;if(a=r,null!==o&&(r?o.length=r:o=null),s){const n=a;if(e&&"object"==typeof e&&!Array.isArray(e)&&void 0===e.choices){const e={keyword:"required",dataPath:t+"/properties/"+i,schemaPath:"#/definitions/properties/items/allOf/0/then/required",params:{missingProperty:"choices"},message:"should have required property 'choices'"};null===o?o=[e]:o.push(e),a++}if(a>0){const e=[];for(const n of o)"errorMessage"===n.keyword||n.emUsed||n.dataPath!==t+"/properties/"+i&&(0!==n.dataPath.indexOf(t+"/properties/"+i)||"/"!==n.dataPath[t+"/properties/"+i.length])||0!==n.schemaPath.indexOf("#/definitions/properties/items/allOf/0/then")||"/"!==n.schemaPath["#/definitions/properties/items/allOf/0/then".length]||(e.push(n),n.emUsed=!0);if(e.length){const n={keyword:"errorMessage",dataPath:t+"/properties/"+i,schemaPath:"#/definitions/properties/items/allOf/0/then/errorMessage",params:{errors:e},message:'must provide choices=[] with "Dropdown" type'};null===o?o=[n]:o.push(n),a++}const n=[];for(const e of o)e.emUsed||n.push(e);o=n,a=n.length}_=s=n===a}if(!_){const e={keyword:"if",dataPath:t+"/properties/"+i,schemaPath:"#/definitions/properties/items/allOf/0/if",params:{failingKeyword:"then"},message:'should match "then" schema'};null===o?o=[e]:o.push(e),a++}const S=a;let O=!0;const C=a;if(e&&"object"==typeof e&&!Array.isArray(e))if(void 0===e.binding){const e={};null===o?o=[e]:o.push(e),a++}else if(void 0!==e.binding){let t=e.binding;if(t&&"object"==typeof t&&!Array.isArray(t))if(void 0===t.type){const e={};null===o?o=[e]:o.push(e),a++}else if(void 0!==t.type&&!fA(t.type,"property")){const e={};null===o?o=[e]:o.push(e),a++}}var c=C===a;if(a=S,null!==o&&(S?o.length=S:o=null),c){const n=a;if(e&&"object"==typeof e&&!Array.isArray(e)&&void 0!==e.type){let n=e.type;if("String"!==n&&"Text"!==n&&"Hidden"!==n&&"Dropdown"!==n&&"Boolean"!==n){const e={keyword:"enum",dataPath:t+"/properties/"+i+"/type",schemaPath:"#/definitions/properties/items/allOf/1/then/properties/type/enum",params:{allowedValues:bA.items.allOf[1].then.properties.type.enum},message:"should be equal to one of the allowed values"};null===o?o=[e]:o.push(e),a++}if(a>0){const e=[];for(const n of o)"errorMessage"===n.keyword||n.emUsed||n.dataPath!==t+"/properties/"+i+"/type"&&(0!==n.dataPath.indexOf(t+"/properties/"+i+"/type")||"/"!==n.dataPath[t+"/properties/"+i+"/type".length])||0!==n.schemaPath.indexOf("#/definitions/properties/items/allOf/1/then/properties/type")||"/"!==n.schemaPath["#/definitions/properties/items/allOf/1/then/properties/type".length]||(e.push(n),n.emUsed=!0);if(e.length){const r={keyword:"errorMessage",dataPath:t+"/properties/"+i+"/type",schemaPath:"#/definitions/properties/items/allOf/1/then/properties/type/errorMessage",params:{errors:e},message:"invalid property type "+JSON.stringify(n)+' for binding type "property"; must be any of { String, Text, Hidden, Dropdown, Boolean }'};null===o?o=[r]:o.push(r),a++}const r=[];for(const e of o)e.emUsed||r.push(e);o=r,a=r.length}}O=c=n===a}if(!O){const e={keyword:"if",dataPath:t+"/properties/"+i,schemaPath:"#/definitions/properties/items/allOf/1/if",params:{failingKeyword:"then"},message:'should match "then" schema'};null===o?o=[e]:o.push(e),a++}const T=a;let A=!0;const R=a;if(e&&"object"==typeof e&&!Array.isArray(e))if(void 0===e.binding){const e={};null===o?o=[e]:o.push(e),a++}else if(void 0!==e.binding){let t=e.binding;if(t&&"object"==typeof t&&!Array.isArray(t))if(void 0===t.type){const e={};null===o?o=[e]:o.push(e),a++}else if(void 0!==t.type&&!fA(t.type,"camunda:executionListener")){const e={};null===o?o=[e]:o.push(e),a++}}var p=R===a;if(a=T,null!==o&&(T?o.length=T:o=null),p){const n=a;if(e&&"object"==typeof e&&!Array.isArray(e)&&void 0!==e.type){if("Hidden"!==e.type){const e={keyword:"enum",dataPath:t+"/properties/"+i+"/type",schemaPath:"#/definitions/properties/items/allOf/2/then/properties/type/enum",params:{allowedValues:bA.items.allOf[2].then.properties.type.enum},message:"should be equal to one of the allowed values"};null===o?o=[e]:o.push(e),a++}if(a>0){const n=[];for(const e of o)"errorMessage"===e.keyword||e.emUsed||e.dataPath!==t+"/properties/"+i+"/type"&&(0!==e.dataPath.indexOf(t+"/properties/"+i+"/type")||"/"!==e.dataPath[t+"/properties/"+i+"/type".length])||0!==e.schemaPath.indexOf("#/definitions/properties/items/allOf/2/then/properties/type")||"/"!==e.schemaPath["#/definitions/properties/items/allOf/2/then/properties/type".length]||(n.push(e),e.emUsed=!0);if(n.length){const r={keyword:"errorMessage",dataPath:t+"/properties/"+i+"/type",schemaPath:"#/definitions/properties/items/allOf/2/then/properties/type/errorMessage",params:{errors:n},message:"invalid property type "+JSON.stringify(e&&e.type)+' for binding type "camunda:executionListener"; must be "Hidden"'};null===o?o=[r]:o.push(r),a++}const r=[];for(const e of o)e.emUsed||r.push(e);o=r,a=r.length}}A=p=n===a}if(!A){const e={keyword:"if",dataPath:t+"/properties/"+i,schemaPath:"#/definitions/properties/items/allOf/2/if",params:{failingKeyword:"then"},message:'should match "then" schema'};null===o?o=[e]:o.push(e),a++}const k=a;let j=!0;const M=a;if(e&&"object"==typeof e&&!Array.isArray(e))if(void 0===e.binding){const e={};null===o?o=[e]:o.push(e),a++}else if(void 0!==e.binding){let t=e.binding;if(t&&"object"==typeof t&&!Array.isArray(t))if(void 0===t.type){const e={};null===o?o=[e]:o.push(e),a++}else if(void 0!==t.type){let e=t.type;if("camunda:property"!==e&&"camunda:outputParameter"!==e&&"camunda:in"!==e&&"camunda:in:businessKey"!==e&&"camunda:out"!==e&&"camunda:errorEventDefinition"!==e){const e={};null===o?o=[e]:o.push(e),a++}}}var u=M===a;if(a=k,null!==o&&(k?o.length=k:o=null),u){const n=a;if(e&&"object"==typeof e&&!Array.isArray(e)&&void 0!==e.type){let n=e.type;if("String"!==n&&"Hidden"!==n&&"Dropdown"!==n){const e={keyword:"enum",dataPath:t+"/properties/"+i+"/type",schemaPath:"#/definitions/properties/items/allOf/3/then/properties/type/enum",params:{allowedValues:bA.items.allOf[3].then.properties.type.enum},message:"should be equal to one of the allowed values"};null===o?o=[e]:o.push(e),a++}if(a>0){const r=[];for(const e of o)"errorMessage"===e.keyword||e.emUsed||e.dataPath!==t+"/properties/"+i+"/type"&&(0!==e.dataPath.indexOf(t+"/properties/"+i+"/type")||"/"!==e.dataPath[t+"/properties/"+i+"/type".length])||0!==e.schemaPath.indexOf("#/definitions/properties/items/allOf/3/then/properties/type")||"/"!==e.schemaPath["#/definitions/properties/items/allOf/3/then/properties/type".length]||(r.push(e),e.emUsed=!0);if(r.length){const s={keyword:"errorMessage",dataPath:t+"/properties/"+i+"/type",schemaPath:"#/definitions/properties/items/allOf/3/then/properties/type/errorMessage",params:{errors:r},message:"invalid property type "+JSON.stringify(n)+" for binding type "+JSON.stringify(e&&e.binding&&e.binding.type)+"; must be any of { String, Hidden, Dropdown }"};null===o?o=[s]:o.push(s),a++}const s=[];for(const e of o)e.emUsed||s.push(e);o=s,a=s.length}}j=u=n===a}if(!j){const e={keyword:"if",dataPath:t+"/properties/"+i,schemaPath:"#/definitions/properties/items/allOf/3/if",params:{failingKeyword:"then"},message:'should match "then" schema'};null===o?o=[e]:o.push(e),a++}const D=a;let B=!0;const I=a;if(e&&"object"==typeof e&&!Array.isArray(e))if(void 0===e.binding){const e={};null===o?o=[e]:o.push(e),a++}else if(void 0!==e.binding){let t=e.binding;if(t&&"object"==typeof t&&!Array.isArray(t))if(void 0===t.type){const e={};null===o?o=[e]:o.push(e),a++}else if(void 0!==t.type){let e=t.type;if("camunda:inputParameter"!==e&&"camunda:field"!==e){const e={};null===o?o=[e]:o.push(e),a++}}}var l=I===a;if(a=D,null!==o&&(D?o.length=D:o=null),l){const n=a;if(e&&"object"==typeof e&&!Array.isArray(e)&&void 0!==e.type){let n=e.type;if("String"!==n&&"Text"!==n&&"Hidden"!==n&&"Dropdown"!==n){const e={keyword:"enum",dataPath:t+"/properties/"+i+"/type",schemaPath:"#/definitions/properties/items/allOf/4/then/properties/type/enum",params:{allowedValues:bA.items.allOf[4].then.properties.type.enum},message:"should be equal to one of the allowed values"};null===o?o=[e]:o.push(e),a++}if(a>0){const r=[];for(const e of o)"errorMessage"===e.keyword||e.emUsed||e.dataPath!==t+"/properties/"+i+"/type"&&(0!==e.dataPath.indexOf(t+"/properties/"+i+"/type")||"/"!==e.dataPath[t+"/properties/"+i+"/type".length])||0!==e.schemaPath.indexOf("#/definitions/properties/items/allOf/4/then/properties/type")||"/"!==e.schemaPath["#/definitions/properties/items/allOf/4/then/properties/type".length]||(r.push(e),e.emUsed=!0);if(r.length){const s={keyword:"errorMessage",dataPath:t+"/properties/"+i+"/type",schemaPath:"#/definitions/properties/items/allOf/4/then/properties/type/errorMessage",params:{errors:r},message:"invalid property type "+JSON.stringify(n)+" for binding type "+JSON.stringify(e&&e.binding&&e.binding.type)+"; must be any of { String, Text, Hidden, Dropdown }"};null===o?o=[s]:o.push(s),a++}const s=[];for(const e of o)e.emUsed||s.push(e);o=s,a=s.length}}B=l=n===a}if(!B){const e={keyword:"if",dataPath:t+"/properties/"+i,schemaPath:"#/definitions/properties/items/allOf/4/if",params:{failingKeyword:"then"},message:'should match "then" schema'};null===o?o=[e]:o.push(e),a++}if(e&&"object"==typeof e&&!Array.isArray(e)){if(void 0===e.binding){const e={keyword:"required",dataPath:t+"/properties/"+i,schemaPath:"#/definitions/properties/items/required",params:{missingProperty:"binding"},message:"should have required property 'binding'"};null===o?o=[e]:o.push(e),a++}if(void 0!==e.value){let n=e.value;if("string"!=typeof n&&"boolean"!=typeof n){const e={keyword:"type",dataPath:t+"/properties/"+i+"/value",schemaPath:"#/definitions/properties/items/properties/value/type",params:{type:bA.items.properties.value.type},message:"should be string,boolean"};null===o?o=[e]:o.push(e),a++}}if(void 0!==e.description&&"string"!=typeof e.description){const e={keyword:"type",dataPath:t+"/properties/"+i+"/description",schemaPath:"#/definitions/properties/items/properties/description/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}if(void 0!==e.label&&"string"!=typeof e.label){const e={keyword:"type",dataPath:t+"/properties/"+i+"/label",schemaPath:"#/definitions/properties/items/properties/label/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}if(void 0!==e.type&&"string"!=typeof e.type){const e={keyword:"type",dataPath:t+"/properties/"+i+"/type",schemaPath:"#/definitions/properties/items/properties/type/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}if(void 0!==e.editable&&"boolean"!=typeof e.editable){const e={keyword:"type",dataPath:t+"/properties/"+i+"/editable",schemaPath:"#/definitions/properties/items/properties/editable/type",params:{type:"boolean"},message:"should be boolean"};null===o?o=[e]:o.push(e),a++}if(void 0!==e.choices){let n=e.choices;if(Array.isArray(n)){const e=n.length;for(let r=0;r<e;r++){let e=n[r];if(e&&"object"==typeof e&&!Array.isArray(e)){if(void 0===e.value){const e={keyword:"required",dataPath:t+"/properties/"+i+"/choices/"+r,schemaPath:"#/definitions/properties/items/properties/choices/items/required",params:{missingProperty:"value"},message:"should have required property 'value'"};null===o?o=[e]:o.push(e),a++}if(void 0===e.name){const e={keyword:"required",dataPath:t+"/properties/"+i+"/choices/"+r,schemaPath:"#/definitions/properties/items/properties/choices/items/required",params:{missingProperty:"name"},message:"should have required property 'name'"};null===o?o=[e]:o.push(e),a++}if(void 0!==e.name&&"string"!=typeof e.name){const e={keyword:"type",dataPath:t+"/properties/"+i+"/choices/"+r+"/name",schemaPath:"#/definitions/properties/items/properties/choices/items/properties/name/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}if(void 0!==e.value&&"string"!=typeof e.value){const e={keyword:"type",dataPath:t+"/properties/"+i+"/choices/"+r+"/value",schemaPath:"#/definitions/properties/items/properties/choices/items/properties/value/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}}else{const e={keyword:"type",dataPath:t+"/properties/"+i+"/choices/"+r,schemaPath:"#/definitions/properties/items/properties/choices/items/type",params:{type:"object"},message:"should be object"};null===o?o=[e]:o.push(e),a++}if(a>0){const e=[];for(const n of o)"errorMessage"===n.keyword||n.emUsed||n.dataPath!==t+"/properties/"+i+"/choices/"+r&&(0!==n.dataPath.indexOf(t+"/properties/"+i+"/choices/"+r)||"/"!==n.dataPath[t+"/properties/"+i+"/choices/"+r.length])||0!==n.schemaPath.indexOf("#/definitions/properties/items/properties/choices/items")||"/"!==n.schemaPath["#/definitions/properties/items/properties/choices/items".length]||(e.push(n),n.emUsed=!0);if(e.length){const n={keyword:"errorMessage",dataPath:t+"/properties/"+i+"/choices/"+r,schemaPath:"#/definitions/properties/items/properties/choices/items/errorMessage",params:{errors:e},message:'{ name, value } must be specified for "Dropdown" choices'};null===o?o=[n]:o.push(n),a++}const n=[];for(const e of o)e.emUsed||n.push(e);o=n,a=n.length}}}else{const e={keyword:"type",dataPath:t+"/properties/"+i+"/choices",schemaPath:"#/definitions/properties/items/properties/choices/type",params:{type:"array"},message:"should be array"};null===o?o=[e]:o.push(e),a++}}if(void 0!==e.binding){let n=e.binding;const r=a;let s=!0;const c=a;if(n&&"object"==typeof n&&!Array.isArray(n))if(void 0===n.type){const e={};null===o?o=[e]:o.push(e),a++}else if(void 0!==n.type){let e=n.type;if("property"!==e&&"camunda:property"!==e&&"camunda:inputParameter"!==e&&"camunda:field"!==e){const e={};null===o?o=[e]:o.push(e),a++}}var d=c===a;if(a=r,null!==o&&(r?o.length=r:o=null),d){const e=a;if(n&&"object"==typeof n&&!Array.isArray(n)&&void 0===n.name){const e={keyword:"required",dataPath:t+"/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/0/then/required",params:{missingProperty:"name"},message:"should have required property 'name'"};null===o?o=[e]:o.push(e),a++}if(a>0){const e=[];for(const n of o)"errorMessage"===n.keyword||n.emUsed||n.dataPath!==t+"/properties/"+i+"/binding"&&(0!==n.dataPath.indexOf(t+"/properties/"+i+"/binding")||"/"!==n.dataPath[t+"/properties/"+i+"/binding".length])||0!==n.schemaPath.indexOf("#/definitions/properties/items/properties/binding/allOf/0/then")||"/"!==n.schemaPath["#/definitions/properties/items/properties/binding/allOf/0/then".length]||(e.push(n),n.emUsed=!0);if(e.length){const r={keyword:"errorMessage",dataPath:t+"/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/0/then/errorMessage",params:{errors:e},message:"property.binding "+JSON.stringify(n&&n.type)+" requires name"};null===o?o=[r]:o.push(r),a++}const r=[];for(const e of o)e.emUsed||r.push(e);o=r,a=r.length}s=d=e===a}if(!s){const e={keyword:"if",dataPath:t+"/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/0/if",params:{failingKeyword:"then"},message:'should match "then" schema'};null===o?o=[e]:o.push(e),a++}const p=a;let u=!0;const l=a;if(n&&"object"==typeof n&&!Array.isArray(n))if(void 0===n.type){const e={};null===o?o=[e]:o.push(e),a++}else if(void 0!==n.type&&!fA(n.type,"camunda:outputParameter")){const e={};null===o?o=[e]:o.push(e),a++}var h=l===a;if(a=p,null!==o&&(p?o.length=p:o=null),h){const e=a;if(n&&"object"==typeof n&&!Array.isArray(n)&&void 0===n.source){const e={keyword:"required",dataPath:t+"/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/1/then/required",params:{missingProperty:"source"},message:"should have required property 'source'"};null===o?o=[e]:o.push(e),a++}if(a>0){const e=[];for(const n of o)"errorMessage"===n.keyword||n.emUsed||n.dataPath!==t+"/properties/"+i+"/binding"&&(0!==n.dataPath.indexOf(t+"/properties/"+i+"/binding")||"/"!==n.dataPath[t+"/properties/"+i+"/binding".length])||0!==n.schemaPath.indexOf("#/definitions/properties/items/properties/binding/allOf/1/then")||"/"!==n.schemaPath["#/definitions/properties/items/properties/binding/allOf/1/then".length]||(e.push(n),n.emUsed=!0);if(e.length){const r={keyword:"errorMessage",dataPath:t+"/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/1/then/errorMessage",params:{errors:e},message:"property.binding "+JSON.stringify(n&&n.type)+" requires source"};null===o?o=[r]:o.push(r),a++}const r=[];for(const e of o)e.emUsed||r.push(e);o=r,a=r.length}u=h=e===a}if(!u){const e={keyword:"if",dataPath:t+"/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/1/if",params:{failingKeyword:"then"},message:'should match "then" schema'};null===o?o=[e]:o.push(e),a++}const w=a;let _=!0;const P=a;if(n&&"object"==typeof n&&!Array.isArray(n))if(void 0===n.type){const e={};null===o?o=[e]:o.push(e),a++}else if(void 0!==n.type&&!fA(n.type,"camunda:in")){const e={};null===o?o=[e]:o.push(e),a++}var m=P===a;if(a=w,null!==o&&(w?o.length=w:o=null),m){const e=a,r=a;let s=!1;const c=a;if(n&&"object"==typeof n&&!Array.isArray(n)&&void 0===n.variables){const e={keyword:"required",dataPath:t+"/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/2/then/anyOf/0/required",params:{missingProperty:"variables"},message:"should have required property 'variables'"};null===o?o=[e]:o.push(e),a++}var f=c===a;if(s=s||f,!s){const e=a;if(n&&"object"==typeof n&&!Array.isArray(n)&&void 0===n.target){const e={keyword:"required",dataPath:t+"/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/2/then/anyOf/1/required",params:{missingProperty:"target"},message:"should have required property 'target'"};null===o?o=[e]:o.push(e),a++}f=e===a;s=s||f}if(s)a=r,null!==o&&(r?o.length=r:o=null);else{const e={keyword:"anyOf",dataPath:t+"/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/2/then/anyOf",params:{},message:"should match some schema in anyOf"};null===o?o=[e]:o.push(e),a++}if(a>0){const e=[];for(const n of o)"errorMessage"===n.keyword||n.emUsed||n.dataPath!==t+"/properties/"+i+"/binding"&&(0!==n.dataPath.indexOf(t+"/properties/"+i+"/binding")||"/"!==n.dataPath[t+"/properties/"+i+"/binding".length])||0!==n.schemaPath.indexOf("#/definitions/properties/items/properties/binding/allOf/2/then")||"/"!==n.schemaPath["#/definitions/properties/items/properties/binding/allOf/2/then".length]||(e.push(n),n.emUsed=!0);if(e.length){const r={keyword:"errorMessage",dataPath:t+"/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/2/then/errorMessage",params:{errors:e},message:"property.binding "+JSON.stringify(n&&n.type)+" requires variables, target, or both"};null===o?o=[r]:o.push(r),a++}const r=[];for(const e of o)e.emUsed||r.push(e);o=r,a=r.length}_=m=e===a}if(!_){const e={keyword:"if",dataPath:t+"/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/2/if",params:{failingKeyword:"then"},message:'should match "then" schema'};null===o?o=[e]:o.push(e),a++}const S=a;let O=!0;const C=a;if(n&&"object"==typeof n&&!Array.isArray(n))if(void 0===n.type){const e={};null===o?o=[e]:o.push(e),a++}else if(void 0!==n.type&&!fA(n.type,"camunda:out")){const e={};null===o?o=[e]:o.push(e),a++}var v=C===a;if(a=S,null!==o&&(S?o.length=S:o=null),v){const e=a,r=a;let s=!1,c=null;const p=a,u=a,l=a,d=a;let h=!1;const m=a;if(n&&"object"==typeof n&&!Array.isArray(n)&&void 0===n.source){const e={};null===o?o=[e]:o.push(e),a++}var y=m===a;if(h=h||y,!h){const e=a;if(n&&"object"==typeof n&&!Array.isArray(n)&&void 0===n.sourceExpression){const e={};null===o?o=[e]:o.push(e),a++}y=e===a;h=h||y}if(h)a=d,null!==o&&(d?o.length=d:o=null);else{const e={};null===o?o=[e]:o.push(e),a++}if(l===a){const e={keyword:"not",dataPath:t+"/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/3/then/oneOf/0/not",params:{},message:"should NOT be valid"};null===o?o=[e]:o.push(e),a++}else a=u,null!==o&&(u?o.length=u:o=null);if(n&&"object"==typeof n&&!Array.isArray(n)&&void 0===n.variables){const e={keyword:"required",dataPath:t+"/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/3/then/oneOf/0/required",params:{missingProperty:"variables"},message:"should have required property 'variables'"};null===o?o=[e]:o.push(e),a++}(x=p===a)&&(s=!0,c=0);const f=a,E=a,w=a,_=a;let P=!1;const S=a;if(n&&"object"==typeof n&&!Array.isArray(n)&&void 0===n.variables){const e={};null===o?o=[e]:o.push(e),a++}var g=S===a;if(P=P||g,!P){const e=a;if(n&&"object"==typeof n&&!Array.isArray(n)&&void 0===n.sourceExpression){const e={};null===o?o=[e]:o.push(e),a++}g=e===a;P=P||g}if(P)a=_,null!==o&&(_?o.length=_:o=null);else{const e={};null===o?o=[e]:o.push(e),a++}if(w===a){const e={keyword:"not",dataPath:t+"/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/3/then/oneOf/1/not",params:{},message:"should NOT be valid"};null===o?o=[e]:o.push(e),a++}else a=E,null!==o&&(E?o.length=E:o=null);if(n&&"object"==typeof n&&!Array.isArray(n)&&void 0===n.source){const e={keyword:"required",dataPath:t+"/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/3/then/oneOf/1/required",params:{missingProperty:"source"},message:"should have required property 'source'"};null===o?o=[e]:o.push(e),a++}if((x=f===a)&&s)s=!1,c=[c,1];else{x&&(s=!0,c=1);const e=a,r=a,p=a,u=a;let l=!1;const d=a;if(n&&"object"==typeof n&&!Array.isArray(n)&&void 0===n.variables){const e={};null===o?o=[e]:o.push(e),a++}var b=d===a;if(l=l||b,!l){const e=a;if(n&&"object"==typeof n&&!Array.isArray(n)&&void 0===n.source){const e={};null===o?o=[e]:o.push(e),a++}b=e===a;l=l||b}if(l)a=u,null!==o&&(u?o.length=u:o=null);else{const e={};null===o?o=[e]:o.push(e),a++}if(p===a){const e={keyword:"not",dataPath:t+"/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/3/then/oneOf/2/not",params:{},message:"should NOT be valid"};null===o?o=[e]:o.push(e),a++}else a=r,null!==o&&(r?o.length=r:o=null);if(n&&"object"==typeof n&&!Array.isArray(n)&&void 0===n.sourceExpression){const e={keyword:"required",dataPath:t+"/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/3/then/oneOf/2/required",params:{missingProperty:"sourceExpression"},message:"should have required property 'sourceExpression'"};null===o?o=[e]:o.push(e),a++}if((x=e===a)&&s)s=!1,c=[c,2];else{x&&(s=!0,c=2);const e=a,r=a,p=a;if(n&&"object"==typeof n&&!Array.isArray(n)&&void 0===n.source){const e={};null===o?o=[e]:o.push(e),a++}if(p===a){const e={keyword:"not",dataPath:t+"/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/3/then/oneOf/3/not",params:{},message:"should NOT be valid"};null===o?o=[e]:o.push(e),a++}else a=r,null!==o&&(r?o.length=r:o=null);if(n&&"object"==typeof n&&!Array.isArray(n)){if(void 0===n.variables){const e={keyword:"required",dataPath:t+"/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/3/then/oneOf/3/required",params:{missingProperty:"variables"},message:"should have required property 'variables'"};null===o?o=[e]:o.push(e),a++}if(void 0===n.sourceExpression){const e={keyword:"required",dataPath:t+"/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/3/then/oneOf/3/required",params:{missingProperty:"sourceExpression"},message:"should have required property 'sourceExpression'"};null===o?o=[e]:o.push(e),a++}}if((x=e===a)&&s)s=!1,c=[c,3];else{x&&(s=!0,c=3);const e=a,r=a,p=a;if(n&&"object"==typeof n&&!Array.isArray(n)&&void 0===n.sourceExpression){const e={};null===o?o=[e]:o.push(e),a++}var x;if(p===a){const e={keyword:"not",dataPath:t+"/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/3/then/oneOf/4/not",params:{},message:"should NOT be valid"};null===o?o=[e]:o.push(e),a++}else a=r,null!==o&&(r?o.length=r:o=null);if(n&&"object"==typeof n&&!Array.isArray(n)){if(void 0===n.variables){const e={keyword:"required",dataPath:t+"/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/3/then/oneOf/4/required",params:{missingProperty:"variables"},message:"should have required property 'variables'"};null===o?o=[e]:o.push(e),a++}if(void 0===n.source){const e={keyword:"required",dataPath:t+"/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/3/then/oneOf/4/required",params:{missingProperty:"source"},message:"should have required property 'source'"};null===o?o=[e]:o.push(e),a++}}(x=e===a)&&s?(s=!1,c=[c,4]):x&&(s=!0,c=4)}}}if(s)a=r,null!==o&&(r?o.length=r:o=null);else{const e={keyword:"oneOf",dataPath:t+"/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/3/then/oneOf",params:{passingSchemas:c},message:"should match exactly one schema in oneOf"};null===o?o=[e]:o.push(e),a++}if(a>0){const e=[];for(const n of o)"errorMessage"===n.keyword||n.emUsed||n.dataPath!==t+"/properties/"+i+"/binding"&&(0!==n.dataPath.indexOf(t+"/properties/"+i+"/binding")||"/"!==n.dataPath[t+"/properties/"+i+"/binding".length])||0!==n.schemaPath.indexOf("#/definitions/properties/items/properties/binding/allOf/3/then")||"/"!==n.schemaPath["#/definitions/properties/items/properties/binding/allOf/3/then".length]||(e.push(n),n.emUsed=!0);if(e.length){const r={keyword:"errorMessage",dataPath:t+"/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/3/then/errorMessage",params:{errors:e},message:"property.binding "+JSON.stringify(n&&n.type)+" requires one of the following: variables, sourceExpression, source, (sourceExpression and variables), or (source and variables)"};null===o?o=[r]:o.push(r),a++}const r=[];for(const e of o)e.emUsed||r.push(e);o=r,a=r.length}O=v=e===a}if(!O){const e={keyword:"if",dataPath:t+"/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/3/if",params:{failingKeyword:"then"},message:'should match "then" schema'};null===o?o=[e]:o.push(e),a++}const T=a;let A=!0;const R=a;if(n&&"object"==typeof n&&!Array.isArray(n))if(void 0===n.type){const e={};null===o?o=[e]:o.push(e),a++}else if(void 0!==n.type&&!fA(n.type,"camunda:errorEventDefinition")){const e={};null===o?o=[e]:o.push(e),a++}var E=R===a;if(a=T,null!==o&&(T?o.length=T:o=null),E){const e=a,r=a;let s=!1,c=null;const p=a;if(n&&"object"==typeof n&&!Array.isArray(n)&&void 0===n.errorRef){const e={keyword:"required",dataPath:t+"/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/4/then/oneOf/0/required",params:{missingProperty:"errorRef"},message:"should have required property 'errorRef'"};null===o?o=[e]:o.push(e),a++}if(p===a&&(s=!0,c=0),s)a=r,null!==o&&(r?o.length=r:o=null);else{const e={keyword:"oneOf",dataPath:t+"/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/4/then/oneOf",params:{passingSchemas:c},message:"should match exactly one schema in oneOf"};null===o?o=[e]:o.push(e),a++}if(a>0){const e=[];for(const n of o)"errorMessage"===n.keyword||n.emUsed||n.dataPath!==t+"/properties/"+i+"/binding"&&(0!==n.dataPath.indexOf(t+"/properties/"+i+"/binding")||"/"!==n.dataPath[t+"/properties/"+i+"/binding".length])||0!==n.schemaPath.indexOf("#/definitions/properties/items/properties/binding/allOf/4/then")||"/"!==n.schemaPath["#/definitions/properties/items/properties/binding/allOf/4/then".length]||(e.push(n),n.emUsed=!0);if(e.length){const r={keyword:"errorMessage",dataPath:t+"/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/4/then/errorMessage",params:{errors:e},message:"property.binding "+JSON.stringify(n&&n.type)+" requires errorRef"};null===o?o=[r]:o.push(r),a++}const r=[];for(const e of o)e.emUsed||r.push(e);o=r,a=r.length}A=E=e===a}if(!A){const e={keyword:"if",dataPath:t+"/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/4/if",params:{failingKeyword:"then"},message:'should match "then" schema'};null===o?o=[e]:o.push(e),a++}if(n&&"object"==typeof n&&!Array.isArray(n)){if(void 0===n.type){const e={keyword:"required",dataPath:t+"/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/required",params:{missingProperty:"type"},message:"should have required property 'type'"};null===o?o=[e]:o.push(e),a++}if(void 0!==n.type){let e=n.type;if("string"!=typeof e){const e={keyword:"type",dataPath:t+"/properties/"+i+"/binding/type",schemaPath:"#/definitions/properties/items/properties/binding/properties/type/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}if("property"!==e&&"camunda:property"!==e&&"camunda:inputParameter"!==e&&"camunda:outputParameter"!==e&&"camunda:in"!==e&&"camunda:out"!==e&&"camunda:in:businessKey"!==e&&"camunda:executionListener"!==e&&"camunda:field"!==e&&"camunda:errorEventDefinition"!==e){const e={keyword:"enum",dataPath:t+"/properties/"+i+"/binding/type",schemaPath:"#/definitions/properties/items/properties/binding/properties/type/enum",params:{allowedValues:bA.items.properties.binding.properties.type.enum},message:"should be equal to one of the allowed values"};null===o?o=[e]:o.push(e),a++}if(a>0){const n=[];for(const e of o)"errorMessage"===e.keyword||e.emUsed||e.dataPath!==t+"/properties/"+i+"/binding/type"&&(0!==e.dataPath.indexOf(t+"/properties/"+i+"/binding/type")||"/"!==e.dataPath[t+"/properties/"+i+"/binding/type".length])||0!==e.schemaPath.indexOf("#/definitions/properties/items/properties/binding/properties/type")||"/"!==e.schemaPath["#/definitions/properties/items/properties/binding/properties/type".length]||(n.push(e),e.emUsed=!0);if(n.length){const r={keyword:"errorMessage",dataPath:t+"/properties/"+i+"/binding/type",schemaPath:"#/definitions/properties/items/properties/binding/properties/type/errorMessage",params:{errors:n},message:"invalid property.binding type "+JSON.stringify(e)+"; must be any of { property, camunda:property, camunda:inputParameter, camunda:outputParameter, camunda:in, camunda:out, camunda:in:businessKey, camunda:executionListener, camunda:field, camunda:errorEventDefinition }"};null===o?o=[r]:o.push(r),a++}const r=[];for(const e of o)e.emUsed||r.push(e);o=r,a=r.length}}if(void 0!==n.name&&"string"!=typeof n.name){const e={keyword:"type",dataPath:t+"/properties/"+i+"/binding/name",schemaPath:"#/definitions/properties/items/properties/binding/properties/name/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}if(void 0!==n.event&&"string"!=typeof n.event){const e={keyword:"type",dataPath:t+"/properties/"+i+"/binding/event",schemaPath:"#/definitions/properties/items/properties/binding/properties/event/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}if(void 0!==n.scriptFormat&&"string"!=typeof n.scriptFormat){const e={keyword:"type",dataPath:t+"/properties/"+i+"/binding/scriptFormat",schemaPath:"#/definitions/properties/items/properties/binding/properties/scriptFormat/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}if(void 0!==n.source&&"string"!=typeof n.source){const e={keyword:"type",dataPath:t+"/properties/"+i+"/binding/source",schemaPath:"#/definitions/properties/items/properties/binding/properties/source/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}if(void 0!==n.target&&"string"!=typeof n.target){const e={keyword:"type",dataPath:t+"/properties/"+i+"/binding/target",schemaPath:"#/definitions/properties/items/properties/binding/properties/target/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}if(void 0!==n.expression&&"boolean"!=typeof n.expression){const e={keyword:"type",dataPath:t+"/properties/"+i+"/binding/expression",schemaPath:"#/definitions/properties/items/properties/binding/properties/expression/type",params:{type:"boolean"},message:"should be boolean"};null===o?o=[e]:o.push(e),a++}if(void 0!==n.variables){let e=n.variables;if("string"!=typeof e){const e={keyword:"type",dataPath:t+"/properties/"+i+"/binding/variables",schemaPath:"#/definitions/properties/items/properties/binding/properties/variables/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}if("all"!==e&&"local"!==e){const e={keyword:"enum",dataPath:t+"/properties/"+i+"/binding/variables",schemaPath:"#/definitions/properties/items/properties/binding/properties/variables/enum",params:{allowedValues:bA.items.properties.binding.properties.variables.enum},message:"should be equal to one of the allowed values"};null===o?o=[e]:o.push(e),a++}}if(void 0!==n.sourceExpression&&"string"!=typeof n.sourceExpression){const e={keyword:"type",dataPath:t+"/properties/"+i+"/binding/sourceExpression",schemaPath:"#/definitions/properties/items/properties/binding/properties/sourceExpression/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}}else{const e={keyword:"type",dataPath:t+"/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/type",params:{type:"object"},message:"should be object"};null===o?o=[e]:o.push(e),a++}}if(void 0!==e.constraints){let n=e.constraints;if(n&&"object"==typeof n&&!Array.isArray(n)){if(void 0!==n.notEmpty&&"boolean"!=typeof n.notEmpty){const e={keyword:"type",dataPath:t+"/properties/"+i+"/constraints/notEmpty",schemaPath:"#/definitions/properties/items/properties/constraints/properties/notEmpty/type",params:{type:"boolean"},message:"should be boolean"};null===o?o=[e]:o.push(e),a++}if(void 0!==n.minLength&&"number"!=typeof n.minLength){const e={keyword:"type",dataPath:t+"/properties/"+i+"/constraints/minLength",schemaPath:"#/definitions/properties/items/properties/constraints/properties/minLength/type",params:{type:"number"},message:"should be number"};null===o?o=[e]:o.push(e),a++}if(void 0!==n.maxLength&&"number"!=typeof n.maxLength){const e={keyword:"type",dataPath:t+"/properties/"+i+"/constraints/maxLength",schemaPath:"#/definitions/properties/items/properties/constraints/properties/maxLength/type",params:{type:"number"},message:"should be number"};null===o?o=[e]:o.push(e),a++}if(void 0!==n.pattern){let e=n.pattern;const r=a;let s=!1,c=null;const p=a;if(e&&"object"==typeof e&&!Array.isArray(e)){if(void 0!==e.value&&"string"!=typeof e.value){const e={keyword:"type",dataPath:t+"/properties/"+i+"/constraints/pattern/value",schemaPath:"#/definitions/properties/items/properties/constraints/properties/pattern/oneOf/0/properties/value/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}if(void 0!==e.message&&"string"!=typeof e.message){const e={keyword:"type",dataPath:t+"/properties/"+i+"/constraints/pattern/message",schemaPath:"#/definitions/properties/items/properties/constraints/properties/pattern/oneOf/0/properties/message/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}}else{const e={keyword:"type",dataPath:t+"/properties/"+i+"/constraints/pattern",schemaPath:"#/definitions/properties/items/properties/constraints/properties/pattern/oneOf/0/type",params:{type:"object"},message:"should be object"};null===o?o=[e]:o.push(e),a++}(w=p===a)&&(s=!0,c=0);const u=a;if("string"!=typeof e){const e={keyword:"type",dataPath:t+"/properties/"+i+"/constraints/pattern",schemaPath:"#/definitions/properties/items/properties/constraints/properties/pattern/oneOf/1/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}var w;if((w=u===a)&&s?(s=!1,c=[c,1]):w&&(s=!0,c=1),s)a=r,null!==o&&(r?o.length=r:o=null);else{const e={keyword:"oneOf",dataPath:t+"/properties/"+i+"/constraints/pattern",schemaPath:"#/definitions/properties/items/properties/constraints/properties/pattern/oneOf",params:{passingSchemas:c},message:"should match exactly one schema in oneOf"};null===o?o=[e]:o.push(e),a++}}}else{const e={keyword:"type",dataPath:t+"/properties/"+i+"/constraints",schemaPath:"#/definitions/properties/items/properties/constraints/type",params:{type:"object"},message:"should be object"};null===o?o=[e]:o.push(e),a++}}}else{const e={keyword:"type",dataPath:t+"/properties/"+i,schemaPath:"#/definitions/properties/items/type",params:{type:"object"},message:"should be object"};null===o?o=[e]:o.push(e),a++}if(a>0){const e={required:{binding:[]}},n={required:{binding:function(){return'missing binding for property "'+JSON.stringify(i)+'"'}}};let r,s;for(const n of o)"errorMessage"!==n.keyword&&!n.emUsed&&n.dataPath===t+"/properties/"+i&&n.keyword in e&&0===n.schemaPath.indexOf("#/definitions/properties/items")&&/^\/[^\/]*$/.test(n.schemaPath.slice(30))&&(r=EA[n.keyword],s=e[n.keyword][n.params[r]],s&&(s.push(n),n.emUsed=!0));for(const r in e)for(const c in e[r])if(s=e[r][c],s.length){const e=n[r]&&n[r][c],p={keyword:"errorMessage",dataPath:t+"/properties/"+i,schemaPath:"#/definitions/properties/items/errorMessage",params:{errors:s},message:e?e():bA.items.errorMessage[r][c]};null===o?o=[p]:o.push(p),a++}const c=[];for(const e of o)e.emUsed||c.push(e);o=c,a=c.length}}}else{const e={keyword:"type",dataPath:t+"/properties",schemaPath:"#/definitions/properties/type",params:{type:"array"},message:"should be array"};null===o?o=[e]:o.push(e),a++}}if(void 0!==e.metadata){let n=e.metadata;if(!n||"object"!=typeof n||Array.isArray(n)){const e={keyword:"type",dataPath:t+"/metadata",schemaPath:"#/properties/metadata/type",params:{type:"object"},message:"should be object"};null===o?o=[e]:o.push(e),a++}}if(void 0!==e.scopes){let n=e.scopes;const i=a;let s=!1,c=null;const p=a;wA(n,{dataPath:t+"/scopes",parentData:e,parentDataProperty:"scopes",rootData:r})||(o=null===o?wA.errors:o.concat(wA.errors),a=o.length),(_=p===a)&&(s=!0,c=0);const u=a;var _;if(PA(n,{dataPath:t+"/scopes",parentData:e,parentDataProperty:"scopes",rootData:r})||(o=null===o?PA.errors:o.concat(PA.errors),a=o.length),(_=u===a)&&s?(s=!1,c=[c,1]):_&&(s=!0,c=1),s)a=i,null!==o&&(i?o.length=i:o=null);else{const e={keyword:"oneOf",dataPath:t+"/scopes",schemaPath:"#/properties/scopes/oneOf",params:{passingSchemas:c},message:"should match exactly one schema in oneOf"};null===o?o=[e]:o.push(e),a++}}if(void 0!==e.entriesVisible){let n=e.entriesVisible;if((!n||"object"!=typeof n||Array.isArray(n))&&"boolean"!=typeof n){const e={keyword:"type",dataPath:t+"/entriesVisible",schemaPath:"#/properties/entriesVisible/type",params:{type:gA.properties.entriesVisible.type},message:"should be object,boolean"};null===o?o=[e]:o.push(e),a++}}}else{const e={keyword:"type",dataPath:t,schemaPath:"#/type",params:{type:"object"},message:"should be object"};null===o?o=[e]:o.push(e),a++}if(a>0){const e={required:{name:[],id:[],appliesTo:[],properties:[]}},n={required:{}};let i,r;for(const n of o)"errorMessage"!==n.keyword&&!n.emUsed&&n.dataPath===t&&n.keyword in e&&0===n.schemaPath.indexOf("#")&&/^\/[^\/]*$/.test(n.schemaPath.slice(1))&&(i=EA[n.keyword],r=e[n.keyword][n.params[i]],r&&(r.push(n),n.emUsed=!0));for(const i in e)for(const s in e[i])if(r=e[i][s],r.length){const e=n[i]&&n[i][s],c={keyword:"errorMessage",dataPath:t,schemaPath:"#/errorMessage",params:{errors:r},message:e?e():gA.errorMessage[i][s]};null===o?o=[c]:o.push(c),a++}const s=[];for(const e of o)e.emUsed||s.push(e);o=s,a=s.length}return SA.errors=o,0===a}function OA(e,{dataPath:t="",parentData:n,parentDataProperty:i,rootData:r=e}={}){let o=null,a=0;const s=a;let c=!1,p=null;const u=a;SA(e,{dataPath:t,parentData:n,parentDataProperty:i,rootData:r})||(o=null===o?SA.errors:o.concat(SA.errors),a=o.length),(d=u===a)&&(c=!0,p=0);const l=a;if(Array.isArray(e)){const n=e.length;for(let i=0;i<n;i++)SA(e[i],{dataPath:t+"/"+i,parentData:e,parentDataProperty:i,rootData:r})||(o=null===o?SA.errors:o.concat(SA.errors),a=o.length)}else{const e={keyword:"type",dataPath:t,schemaPath:"#/oneOf/1/type",params:{type:"array"},message:"should be array"};null===o?o=[e]:o.push(e),a++}var d;if((d=l===a)&&c?(c=!1,p=[p,1]):d&&(c=!0,p=1),c)a=s,null!==o&&(s?o.length=s:o=null);else{const e={keyword:"oneOf",dataPath:t,schemaPath:"#/oneOf",params:{passingSchemas:p},message:"should match exactly one schema in oneOf"};null===o?o=[e]:o.push(e),a++}return OA.errors=o,0===a}function CA(e){const t=function(e){return mA(e,null,2).pointers}(e),n=vA(e);let i=vA.errors;return i&&i.length&&(_(i,TA),i=function(e){return w(e,(function(e){return"if"!==e.keyword}))}(i),_(i,(function(e){!function(e,t){const n=e.dataPath,i=t[n];e.dataPointer=i}(e,t)}))),{valid:n,object:e,errors:i}}function TA(e){const t=e.params;t&&t.errors&&(t.rawErrors=t.errors,delete t.errors)}vA.default=yA;var AA=t(Object.freeze({__proto__:null,getSchemaVersion:function(){return"0.4.0"},validate:CA,validateAll:function(e){const t=[];let n=!0;return _(e,(function(e){const i=CA(e);i.valid||(n=!1),t.push(i)})),{valid:n,results:t}}})),RA=KS.isArray,kA=KS.filter,jA=AA.validate,MA=(0,AA.getSchemaVersion)();var DA=function(){this._templatesById={},this._validTemplates=[],this._errors=[],this.addAll=function(e){return RA(e)?e.forEach(this.add,this):this._logError("templates must be []"),this},this.add=function(e){var t,n;return this._validateTemplate(e)||(t=e.id,n=e.version||"_",this._templatesById[t]||(this._templatesById[t]={}),this._templatesById[t][n]=e,this._validTemplates.push(e)),this},this._validateTemplate=function(e){var t,n=e.id,i=e.version||"_",r=e.$schema&&function(e){var t=/\d+\.\d+\.\d+/g,n=e.match(t);return null===n?void 0:n[0]}(e.$schema),o=this;if(r&&tA.compare(MA,r)<0)return this._logError("unsupported element template schema version <"+r+">. Your installation only supports up to version <"+MA+">. Please update your installation",e);if(this._templatesById[n]&&this._templatesById[n][i])return"_"===i?this._logError("template id <"+n+"> already used",e):this._logError("template id <"+n+"> and version <"+i+"> already used",e);var a,s=jA(e),c=s.valid,p=s.errors;return c||(t=new Error("invalid template"),(a=p,kA(a,(function(e){return"errorMessage"===e.keyword||!("type"!==e.keyword||!e.dataPath||"/scopes"===e.dataPath)}))).forEach((function(t){o._logError(t.message,e)}))),t},this._logError=function(e,t){return"string"==typeof e&&(t&&(e="template(id: <"+t.id+">, name: <"+t.name+">): "+e),e=new Error(e)),this._errors.push(e),e},this.getErrors=function(){return this._errors},this.getValidTemplates=function(){return this._validTemplates}};function BA(e,t,n){this._loadTemplates=e,this._eventBus=t,this._elementTemplates=n;var i=this;t.on("diagram.init",(function(){i.reload()}))}var IA=BA;BA.$inject=["config.elementTemplates","eventBus","elementTemplates"],BA.prototype.reload=function(){var e=this,t=this._loadTemplates;if(void 0!==t)return"function"==typeof t?t((function(t,n){if(t)return e.templateErrors([t]);e.setTemplates(n)})):t.length?this.setTemplates(t):void 0},BA.prototype.setTemplates=function(e){var t=this._elementTemplates,n=(new DA).addAll(e),i=n.getErrors(),r=n.getValidTemplates();t.set(r),i.length&&this.templateErrors(i),this.templatesChanged()},BA.prototype.templatesChanged=function(){this._eventBus.fire("elementTemplates.changed")},BA.prototype.templateErrors=function(e){this._eventBus.fire("elementTemplates.errors",{errors:e})};var NA=PE.is;function LA(e,t){t.on("moddleCopy.canCopyProperty",(function(t){var n=t.parent,i=t.property;if("modelerTemplate"===t.propertyName){var r=e.get(i);return!!r&&(!!r.appliesTo.reduce((function(e,t){return e||NA(n,t)}),!1)&&void 0)}}))}LA.$inject=["elementTemplates","eventBus"];var FA=LA,VA={__depends__:[IT,G_.default],__init__:["customElementsPropertiesActivator","elementTemplatesLoader","replaceBehavior"],customElementsPropertiesActivator:["type",qT],elementTemplates:["type",eA],elementTemplatesLoader:["type",IA],replaceBehavior:["type",FA]},$A=PE.is,zA={getExtensionElements:function(e,t){var n=[],i=e.get("extensionElements");if(void 0!==i){var r=i.get("values");void 0!==r&&(n=r.filter((function(e){return $A(e,t)})))}return n},addEntry:function(e,t,n,i){var r=e.get("extensionElements");return r?aP.addElementsTolist(t,r,"values",[n]):{extensionElements:r=RE.createElement("bpmn:ExtensionElements",{values:[n]},e,i)}},removeEntry:function(e,t,n){var i=e.get("extensionElements");return i?aP.removeElementsFromList(t,i,"values","extensionElements",[n]):{}}},qA=zA;var UA={isAsyncBefore:function(e){return!(!e.get("camunda:asyncBefore")&&!e.get("camunda:async"))},isAsyncAfter:function(e){return!!e.get("camunda:asyncAfter")},isExclusive:function(e){return!!e.get("camunda:exclusive")},getFailedJobRetryTimeCycle:function(e){return qA.getExtensionElements(e,"camunda:FailedJobRetryTimeCycle")[0]},removeFailedJobRetryTimeCycle:function(e,t){var n=qA.getExtensionElements(e,"camunda:FailedJobRetryTimeCycle");return p_(n,(function(n){return qA.removeEntry(e,t,n)}))}},GA=PE.is,HA=PE.getBusinessObject,WA={},KA=WA;WA.isServiceTaskLike=function(e){return GA(e,"camunda:ServiceTaskLike")},WA.isDmnCapable=function(e){return GA(e,"camunda:DmnCapable")},WA.isExternalCapable=function(e){return GA(e,"camunda:ExternalCapable")},WA.isTaskListener=function(e){return GA(e,"camunda:TaskListener")},WA.isExecutionListener=function(e){return GA(e,"camunda:ExecutionListener")},WA.isListener=function(e){return this.isTaskListener(e)||this.isExecutionListener(e)},WA.isSequenceFlow=function(e){return GA(e,"bpmn:SequenceFlow")},WA.getServiceTaskLikeBusinessObject=function(e){if(GA(e,"bpmn:IntermediateThrowEvent")||GA(e,"bpmn:EndEvent")){var t=DO.getMessageEventDefinition(e);t&&(e=t)}return this.isServiceTaskLike(e)&&HA(e)},WA.getImplementationType=function(e){var t=this.getServiceTaskLikeBusinessObject(e);if(!t){if(!this.isListener(e))return;t=e}if(this.isDmnCapable(t)&&void 0!==t.get("camunda:decisionRef"))return"dmn";if(this.isServiceTaskLike(t)&&qA.getExtensionElements(t,"camunda:Connector").length)return"connector";if(this.isExternalCapable(t)&&"external"===t.get("camunda:type"))return"external";if(void 0!==t.get("camunda:class"))return"class";if(void 0!==t.get("camunda:expression"))return"expression";if(void 0!==t.get("camunda:delegateExpression"))return"delegateExpression";if(this.isListener(t)&&void 0!==t.get("script"))return"script"};var XA=PE.is,YA=PE.getBusinessObject,JA={},ZA=JA;function QA(e,t,n){var i=qA.getExtensionElements(e,t);return n?(i[0]||{})[n]||[]:i}function eR(e,t,n){var i=JA.getInputOutput(e,n);return i&&i.get(t)||[]}JA.getInputOutput=function(e,t){if(!t)return(QA(YA(e),"camunda:InputOutput")||[])[0];var n=this.getConnector(e);return n&&n.get("inputOutput")},JA.getConnector=function(e){var t=KA.getServiceTaskLikeBusinessObject(e);return t&&(QA(t,"camunda:Connector")||[])[0]},JA.getInputParameters=function(e,t){return eR.apply(this,[e,"inputParameters",t])},JA.getOutputParameters=function(e,t){return eR.apply(this,[e,"outputParameters",t])},JA.getInputParameter=function(e,t,n){return this.getInputParameters(e,t)[n]},JA.getOutputParameter=function(e,t,n){return this.getOutputParameters(e,t)[n]},JA.isInputOutputSupported=function(e,t){if(t)return!0;var n=YA(e);return XA(n,"bpmn:FlowNode")&&!(XA(n,"bpmn:StartEvent")||XA(n,"bpmn:Gateway")||XA(n,"bpmn:BoundaryEvent")||XA(n,"bpmn:SubProcess")&&n.get("triggeredByEvent"))},JA.areOutputParametersSupported=function(e,t){var n=YA(e);return t||!XA(n,"bpmn:EndEvent")&&!n.loopCharacteristics};var tR=["class","expression","delegateExpression"],nR={"camunda:class":void 0,"camunda:expression":void 0,"camunda:delegateExpression":void 0,"camunda:resultVariable":void 0},iR={"camunda:decisionRef":void 0,"camunda:decisionRefBinding":"latest","camunda:decisionRefVersion":void 0,"camunda:mapDecisionResult":"resultList","camunda:decisionRefTenantId":void 0},rR={"camunda:type":void 0,"camunda:topic":void 0},oR=["class","expression","delegateExpression"],aR={class:"camunda:class",expression:"camunda:expression",delegateExpression:"camunda:delegateExpression"};function sR(e){return-1!==oR.indexOf(e)}function cR(e){return aR[e]}var pR=function(e,t,n,i){var r=n.getImplementationType,o=n.getBusinessObject;return[wO.textField(i,{id:"delegate",label:i("Value"),dataValueLabel:"delegationLabel",modelProperty:"delegate",get:function(e,t){var n=o(e),a=r(e),s=cR(a),c=function(e){switch(e){case"class":return i("Java Class");case"expression":return i("Expression");case"delegateExpression":return i("Delegate Expression");default:return""}}(a);return{delegate:n.get(s),delegationLabel:c}},set:function(e,t,n){var i=o(e),a={};return a[cR(r(e))]=t.delegate||"",aP.updateBusinessObject(e,i,a)},validate:function(e,t,n){return sR(r(e))&&!t.delegate?{delegate:i("Must provide a value")}:{}},hidden:function(e,t){return!sR(r(e))}})]},uR=PE.is,lR=function(e,t,n,i){var r=n.getBusinessObject,o=n.hideResultVariable,a=n.id||"resultVariable",s=wO.textField(i,{id:a,label:i("Result Variable"),modelProperty:"resultVariable",get:function(e,t){return{resultVariable:r(e).get("camunda:resultVariable")}},set:function(e,t,n){var i=r(e),o=t.resultVariable||void 0,a={"camunda:resultVariable":o};return uR(i,"camunda:DmnCapable")&&!o&&(a=EP({"camunda:mapDecisionResult":"resultList"},a)),aP.updateBusinessObject(e,i,a)},hidden:function(e,t){if("function"==typeof o)return o.apply(s,arguments)}});return[s]},dR=PE.getBusinessObject,hR=PE.is,mR={bpmn:{element:"calledElement",binding:"camunda:calledElementBinding",version:"camunda:calledElementVersion",versionTag:"camunda:calledElementVersionTag",tenantId:"camunda:calledElementTenantId"},cmmn:{element:"camunda:caseRef",binding:"camunda:caseBinding",version:"camunda:caseVersion",tenantId:"camunda:caseTenantId"},dmn:{element:"camunda:decisionRef",binding:"camunda:decisionRefBinding",version:"camunda:decisionRefVersion",versionTag:"camunda:decisionRefVersionTag",tenantId:"camunda:decisionRefTenantId"}},fR=[{name:"singleEntry (TypedValue)",value:"singleEntry"},{name:"singleResult (Map<String, Object>)",value:"singleResult"},{name:"collectEntries (List<Object>)",value:"collectEntries"},{name:"resultList (List<Map<String, Object>>)",value:"resultList"}],vR=[{name:"variableMappingClass",value:"variableMappingClass"},{name:"variableMappingDelegateExpression",value:"variableMappingDelegateExpression"}];function yR(e){var t=[],n=dR(e),i=qA.getExtensionElements(n,"camunda:In");return Qg(i,(function(e){void 0!==e.businessKey&&t.push(e)})),t}function gR(e,t,n){var i=[],r=yR(e);if(r.length)i.push(aP.updateBusinessObject(e,r[0],{businessKey:t}));else{var o=dR(e),a=o.extensionElements;a||(a=RE.createElement("bpmn:ExtensionElements",{values:[]},o,n),i.push(aP.updateProperties(e,{extensionElements:a})));var s=RE.createElement("camunda:In",{businessKey:t},a,n);i.push(aP.addAndRemoveElementsFromList(e,a,"values","extensionElements",[s],[]))}return i}function bR(e){return-1!==["bpmn","cmmn","dmn"].indexOf(e)}var xR=function(e,t,n,i){var r=[{name:i("latest"),value:"latest"},{name:i("deployment"),value:"deployment"},{name:i("version"),value:"version"},{name:i("versionTag"),value:"versionTag"}],o=n.getCallableType,a=[];function s(e,t){var n=o(e);return(mR[n]||{})[t]}function c(e){var t=o(e),n=dR(e),i=(mR[t]||{}).binding;return n.get(i)}function p(e){var t=dR(e),n=t.get("camunda:variableMappingClass"),i=t.get("camunda:variableMappingDelegateExpression"),r="";return void 0!==n?r="variableMappingClass":void 0!==i&&(r="variableMappingDelegateExpression"),r}return a.push(wO.textField(i,{id:"callable-element-ref",dataValueLabel:"callableElementLabel",modelProperty:"callableElementRef",get:function(e,t){var n,r=s(e,"element");r&&(n=dR(e).get(r));var a="",c=o(e);return"bpmn"===c?a=i("Called Element"):"cmmn"===c?a=i("Case Ref"):"dmn"===c&&(a=i("Decision Ref")),{callableElementRef:n,callableElementLabel:a}},set:function(e,t,n){var i=t.callableElementRef,r={};return r[s(e,"element")]=i||"",aP.updateProperties(e,r)},validate:function(e,t,n){var r=t.callableElementRef;return bR(o(e))&&!r?{callableElementRef:i("Must provide a value")}:{}},hidden:function(e,t){return!bR(o(e))}})),a.push(wO.selectBox(i,{id:"callable-binding",label:i("Binding"),selectOptions:function(e){return"cmmn"===o(e)?r.filter((function(e){return"versionTag"!==e.value})):r},modelProperty:"callableBinding",get:function(e,t){var n,i=s(e,"binding");i&&(n=dR(e).get(i)||"latest");return{callableBinding:n}},set:function(e,t,n){var i=t.callableBinding,r=s(e,"binding"),o=s(e,"version"),a=s(e,"versionTag"),c={};return c[r]=i,c[o]=void 0,c[a]=void 0,aP.updateProperties(e,c)},hidden:function(e,t){return!bR(o(e))}})),a.push(wO.textField(i,{id:"callable-version",label:i("Version"),modelProperty:"callableVersion",get:function(e,t){var n,i=s(e,"version");i&&(n=dR(e).get(i));return{callableVersion:n}},set:function(e,t,n){var i=t.callableVersion,r={};return r[s(e,"version")]=i||void 0,aP.updateProperties(e,r)},validate:function(e,t,n){var r=t.callableVersion;return bR(o(e))&&"version"===c(e)&&(r?{}:{callableVersion:i("Must provide a value")})},hidden:function(e,t){return!bR(o(e))||"version"!==c(e)}})),a.push(wO.textField(i,{id:"callable-version-tag",label:i("Version Tag"),modelProperty:"versionTag",get:function(e,t){var n,i=s(e,"versionTag");i&&(n=dR(e).get(i));return{versionTag:n}},set:function(e,t,n){var i=t.versionTag,r={};return r[s(e,"versionTag")]=i||void 0,aP.updateProperties(e,r)},validate:function(e,t,n){var r=t.versionTag;return bR(o(e))&&"versionTag"===c(e)&&(r?{}:{versionTag:i("Must provide a value")})},hidden:function(e,t){return!bR(o(e))||"versionTag"!==c(e)}})),a.push(wO.textField(i,{id:"tenant-id",label:i("Tenant Id"),modelProperty:"tenantId",get:function(e,t){var n,i=s(e,"tenantId");i&&(n=dR(e).get(i));return{tenantId:n}},set:function(e,t,n){var i=t.tenantId,r={};return r[s(e,"tenantId")]=i||void 0,aP.updateProperties(e,r)},hidden:function(e,t){return!bR(o(e))}})),hR(dR(e),"bpmn:CallActivity")&&a.push(wO.checkbox(i,{id:"callable-business-key",label:i("Business Key"),modelProperty:"callableBusinessKey",get:function(e,t){var n=yR(e);return{callableBusinessKey:!!(n&&n.length>0)}},set:function(e,n,i){return n.callableBusinessKey?gR(e,"#{execution.processBusinessKey}",t):function(e){var t=yR(e),n=[];return Qg(t,(function(t){n.push(qA.removeEntry(dR(e),e,t))})),n}(e)}})),a.push(wO.textField(i,{id:"business-key-expression",label:i("Business Key Expression"),modelProperty:"businessKey",get:function(e,t){var n=yR(e);return{businessKey:n.length?n[0].get("camunda:businessKey"):void 0}},set:function(e,n,i){return gR(e,n.businessKey,t)},validate:function(e,t,n){return""===t.businessKey?{businessKey:i("Must provide a value")}:{}},hidden:function(e,t){return!yR(e).length}})),(a=a.concat(lR(0,0,{id:"dmn-resultVariable",getBusinessObject:dR,getImplementationType:o,hideResultVariable:function(e,t){return"dmn"!==o(e)}},i))).push(wO.selectBox(i,{id:"dmn-map-decision-result",label:i("Map Decision Result"),selectOptions:fR,modelProperty:"mapDecisionResult",get:function(e,t){return{mapDecisionResult:dR(e).get("camunda:mapDecisionResult")||"resultList"}},set:function(e,t,n){return aP.updateProperties(e,{"camunda:mapDecisionResult":t.mapDecisionResult||"resultList"})},hidden:function(e,t){var n=dR(e).get("camunda:resultVariable");return!("dmn"===o(e)&&void 0!==n)}})),a.push(wO.selectBox(i,{id:"delegateVariableMappingType",label:i("Delegate Variable Mapping"),selectOptions:vR,emptyParameter:!0,modelProperty:"delegateVariableMappingType",get:function(e,t){return{delegateVariableMappingType:p(e)}},set:function(e,t,n){var i=t.delegateVariableMappingType,r={"camunda:variableMappingClass":void 0,"camunda:variableMappingDelegateExpression":void 0};return"variableMappingClass"===i?r["camunda:variableMappingClass"]="":"variableMappingDelegateExpression"===i&&(r["camunda:variableMappingDelegateExpression"]=""),aP.updateProperties(e,r)},hidden:function(e,t){return"bpmn"!==o(e)}})),a.push(wO.textField(i,{id:"delegateVariableMapping",dataValueLabel:"delegateVariableMappingLabel",modelProperty:"delegateVariableMapping",get:function(e,t){var n=dR(e),r="",o=void 0,a=p(e);return"variableMappingClass"===a?(r=i("Class"),o=n.get("camunda:variableMappingClass")):"variableMappingDelegateExpression"===a&&(r=i("Delegate Expression"),o=n.get("camunda:variableMappingDelegateExpression")),{delegateVariableMapping:o,delegateVariableMappingLabel:r}},set:function(e,t,n){var i=t.delegateVariableMapping,r={};return r["camunda:"+p(e)]=i||void 0,aP.updateProperties(e,r)},validate:function(e,t,n){var r=t.delegateVariableMapping;return"bpmn"===o(e)&&(r?{}:{delegateVariableMapping:i("Must provide a value")})},hidden:function(e,t){return!("bpmn"===o(e)&&""!==p(e))}})),a},ER=hw.escapeHTML,wR=hw.triggerClickEvent,_R=GE.query,PR=GE.closest,SR=GE.classes;function OR(e){return KA.getImplementationType(e)}function CR(e){return KA.getServiceTaskLikeBusinessObject(e)}var TR=function(e,t,n,i){if(function(e){return KA.isServiceTaskLike(e)}(CR(t))){var r=function(e){return KA.isDmnCapable(e)}(t),o=function(e){return KA.isExternalCapable(e)}(CR(t));e.entries=e.entries.concat(function(e,t,n,i){var r=[{value:"class",name:i("Java Class")},{value:"expression",name:i("Expression")},{value:"delegateExpression",name:i("Delegate Expression")}],o=[{value:"dmn",name:i("DMN")}],a=[{value:"external",name:i("External")}],s=[{value:"connector",name:i("Connector")}],c=[{value:"script",name:i("Script")}],p=n.getImplementationType,u=n.getBusinessObject,l=n.hasDmnSupport,d=n.hasExternalSupport,h=n.hasServiceTaskLikeSupport,m=n.hasScriptSupport,f=[],v=r.concat([]);return l&&(v=v.concat(o)),d&&(v=v.concat(a)),h&&(v=v.concat(s)),m&&(v=v.concat(c)),v.push({value:""}),f.push(wO.selectBox(i,{id:"implementation",label:i("Implementation"),selectOptions:v,modelProperty:"implType",get:function(e,t){return{implType:p(e)||""}},set:function(e,n,i){var r=u(e),o=p(e),a=n.implType,s=EP({},nR);if(-1!==tR.indexOf(a)){var c="";-1!==tR.indexOf(o)&&(c=r.get("camunda:"+o)),s["camunda:"+a]=c}l&&(s=EP(s,iR),"dmn"===a&&(s["camunda:decisionRef"]="")),d&&(s=EP(s,rR),"external"===a&&(s["camunda:type"]="external",s["camunda:topic"]="")),m&&(s["camunda:script"]=void 0,"script"===a&&(s["camunda:script"]=RE.createElement("camunda:Script",{},r,t)));var f=[];if(f.push(aP.updateBusinessObject(e,r,s)),"external"===o&&"external"!==a){var v=qA.getExtensionElements(r,"camunda:ErrorEventDefinition");f.push(p_(v,(function(t){return qA.removeEntry(r,e,t)})))}if(h){var y=qA.getExtensionElements(r,"camunda:Connector");if(f.push(p_(y,(function(t){return qA.removeEntry(r,e,t)}))),"connector"===a){var g=r.get("extensionElements");g||(g=RE.createElement("bpmn:ExtensionElements",{values:[]},r,t),f.push(aP.updateBusinessObject(e,r,{extensionElements:g})));var b=RE.createElement("camunda:Connector",{},g,t);f.push(aP.addAndRemoveElementsFromList(e,g,"values","extensionElements",[b],[]))}}return f}})),f}(0,n,{getBusinessObject:CR,getImplementationType:OR,hasDmnSupport:r,hasExternalSupport:o,hasServiceTaskLikeSupport:!0},i)),e.entries=e.entries.concat(pR(0,0,{getBusinessObject:CR,getImplementationType:OR},i)),e.entries=e.entries.concat(lR(0,0,{getBusinessObject:CR,getImplementationType:OR,hideResultVariable:function(e,t){return"expression"!==OR(e)}},i)),o&&(e.entries=e.entries.concat(function(e,t,n,i){var r=n.getImplementationType,o=n.getBusinessObject;function a(e){return"external"===r(e)}return[wO.textField(i,{id:"externalTopic",label:i("Topic"),modelProperty:"externalTopic",get:function(e,t){return{externalTopic:o(e).get("camunda:topic")}},set:function(e,t,n){var i=o(e);return aP.updateBusinessObject(e,i,{"camunda:topic":t.externalTopic})},validate:function(e,t,n){return a(e)&&!t.externalTopic?{externalTopic:i("Must provide a value")}:{}},hidden:function(e,t){return!a(e)}})]}(0,0,{getBusinessObject:CR,getImplementationType:OR},i))),r&&(e.entries=e.entries.concat(xR(t,n,{getCallableType:OR},i)));e.entries.push(wO.link(i,{id:"configureConnectorLink",buttonLabel:i("Configure Connector"),handleClick:function(e,t,n){var i,r,o=(i="connector",r=PR(t,".bpp-properties-panel"),_R('a[data-tab-target="'+i+'"]',r));return o&&wR(o),!1},showLink:function(e,t){var n=_R("a",t);return n.textContent="",SR(n).remove("bpp-error-message"),!!function(e){return"connector"===OR(e)}(e)&&(ZA.getConnector(e).get("connectorId")?n.textContent=i("Configure Connector"):(n.innerHTML='<span class="bpp-icon-warning"></span> '+ER(i("Must configure Connector")),SR(n).add("bpp-error-message")),!0)}}))}};var AR=PE.is;function RR(e){return UA.isAsyncBefore(e)}function kR(e){return UA.isAsyncAfter(e)}function jR(e){return UA.isExclusive(e)}function MR(e,t){return UA.removeFailedJobRetryTimeCycle(e,t)}function DR(e){return!DO.getTimerEventDefinition(e)}var BR=function(e,t,n,i){var r=n.getBusinessObject,o=n.idPrefix||"",a=n.labelPrefix||"";return[wO.checkbox(i,{id:o+"asyncBefore",label:a+i("Asynchronous Before"),modelProperty:"asyncBefore",get:function(e,t){return{asyncBefore:RR(r(e))}},set:function(e,t){var n=r(e),i=!!t.asyncBefore,o={"camunda:asyncBefore":i,"camunda:async":!1},a=[];return kR(n)||i||(o=EP({"camunda:exclusive":!0},o),DR(e)&&a.push(MR(n,e))),a.push(aP.updateBusinessObject(e,n,o)),a}}),wO.checkbox(i,{id:o+"asyncAfter",label:a+i("Asynchronous After"),modelProperty:"asyncAfter",get:function(e,t){return{asyncAfter:kR(r(e))}},set:function(e,t){var n=r(e),i=!!t.asyncAfter,o={"camunda:asyncAfter":i},a=[];return RR(n)||i||(o=EP({"camunda:exclusive":!0},o),DR(e)&&a.push(MR(n,e))),a.push(aP.updateBusinessObject(e,n,o)),a}}),wO.checkbox(i,{id:o+"exclusive",label:a+i("Exclusive"),modelProperty:"exclusive",get:function(e,t){return{exclusive:jR(r(e))}},set:function(e,t){var n=r(e);return aP.updateBusinessObject(e,n,{"camunda:exclusive":!!t.exclusive})},hidden:function(e){var t=r(e);return t&&!kR(t)&&!RR(t)}})]},IR=PE.getBusinessObject,NR=PE.is,LR=PE.getBusinessObject,FR=PE.is;function VR(e){var t=LR(e),n=t.get("calledElement"),i=t.get("camunda:caseRef"),r="";return void 0!==n?r="bpmn":void 0!==i&&(r="cmmn"),r}var $R={calledElement:void 0,"camunda:calledElementBinding":"latest","camunda:calledElementVersion":void 0,"camunda:calledElementTenantId":void 0,"camunda:variableMappingClass":void 0,"camunda:variableMappingDelegateExpression":void 0,"camunda:caseRef":void 0,"camunda:caseBinding":"latest","camunda:caseVersion":void 0,"camunda:caseTenantId":void 0},zR=PE.getBusinessObject,qR=hw.escapeHTML,UR=GE.classes;function GR(e,t){var n=WR(e);return n&&n.get(t)}function HR(e){return e&&e.get("body")}function WR(e){return zR(e).loopCharacteristics}function KR(e){return HR(function(e){return GR(e,"loopCardinality")}(e))}function XR(e){return HR(function(e){return GR(e,"completionCondition")}(e))}function YR(e){return GR(e,"camunda:collection")}function JR(e){return GR(e,"camunda:elementVariable")}function ZR(e,t,n,i){var r=WR(e),o={};if(!n)return o[t]=void 0,aP.updateBusinessObject(e,r,o);var a=r.get(t);return a?aP.updateBusinessObject(e,a,{body:n}):(o[t]=function(e,t,n){return RE.createElement("bpmn:FormalExpression",{body:t},e,n)}(r,n,i),aP.updateBusinessObject(e,r,o))}var QR=PE.is;function ek(e){return UA.getFailedJobRetryTimeCycle(e)}var tk=function(e,t,n,i){var r=n.getBusinessObject,o=n.idPrefix||"",a=n.labelPrefix||"";return[wO.textField(i,{id:o+"retryTimeCycle",label:a+i("Retry Time Cycle"),modelProperty:"cycle",get:function(e,t){var n=ek(r(e));return{cycle:n&&n.get("body")}},set:function(e,n,i){var o=n.cycle,a=r(e);if(""===o||void 0===o)return function(e,t){return UA.removeFailedJobRetryTimeCycle(e,t)}(a,e);var s=ek(a);if(!s){var c=[],p=a.get("extensionElements");return p||(p=function(e,t){return RE.createElement("bpmn:ExtensionElements",{values:[]},e,t)}(a,t),c.push(aP.updateBusinessObject(e,a,{extensionElements:p}))),s=function(e,t,n){return RE.createElement("camunda:FailedJobRetryTimeCycle",{body:n},e,t)}(p,t,o),c.push(aP.addAndRemoveElementsFromList(e,p,"values","extensionElements",[s],[])),c}return aP.updateBusinessObject(e,s,{body:o})},hidden:function(e){var t=r(e);return(!t||!function(e){return UA.isAsyncBefore(e)}(t)&&!function(e){return UA.isAsyncAfter(e)}(t))&&(!QR(e,"bpmn:Event")||!DO.getTimerEventDefinition(e))}})]},nk=PE.getBusinessObject,ik=PE.is;function rk(e){return nk(e).loopCharacteristics}var ok=function(e,t,n,i){(function(e){var t=rk(e);return!!t&&ik(t,"camunda:Collectable")})(t)&&(e.entries=e.entries.concat(function(e,t,n){var i=[];return i.push({id:"multiInstance-errorMessage",html:'<div data-show="isValid"><span class="bpp-icon-warning"></span> '+qR(n("Must provide either loop cardinality or collection"))+"</div>",isValid:function(e,t,n,i){var r=!0;if(WR(e)){var o=KR(e),a=YR(e);r=!o&&!a}return UR(t).toggle("bpp-hidden",!r),UR(n).toggle("bpp-error-message",r),r}}),i.push(wO.textField(n,{id:"multiInstance-loopCardinality",label:n("Loop Cardinality"),modelProperty:"loopCardinality",get:function(e,t){return{loopCardinality:KR(e)}},set:function(e,n){return ZR(e,"loopCardinality",n.loopCardinality,t)}})),i.push(wO.textField(n,{id:"multiInstance-collection",label:n("Collection"),modelProperty:"collection",get:function(e,t){return{collection:YR(e)}},set:function(e,t){var n=WR(e);return aP.updateBusinessObject(e,n,{"camunda:collection":t.collection||void 0})},validate:function(e,t,n){var i=YR(e),r=JR(e);if(!i&&r)return{collection:"Must provide a value"}}})),i.push(wO.textField(n,{id:"multiInstance-elementVariable",label:n("Element Variable"),modelProperty:"elementVariable",get:function(e,t){return{elementVariable:JR(e)}},set:function(e,t){var n=WR(e);return aP.updateBusinessObject(e,n,{"camunda:elementVariable":t.elementVariable||void 0})}})),i.push(wO.textField(n,{id:"multiInstance-completionCondition",label:n("Completion Condition"),modelProperty:"completionCondition",get:function(e){return{completionCondition:XR(e)}},set:function(e,n){return ZR(e,"completionCondition",n.completionCondition,t)}})),i}(0,n,i)),e.entries=e.entries.concat(BR(0,0,{getBusinessObject:rk,idPrefix:"multiInstance-",labelPrefix:i("Multi Instance ")},i)),e.entries=e.entries.concat(tk(0,n,{getBusinessObject:rk,idPrefix:"multiInstance-",labelPrefix:i("Multi Instance ")},i)))},ak=GE.query,sk=hw.escapeHTML;function ck(e,t){var n;return n=t&&""!=t?'select[id="'+t+'cam-script-type"]':'select[name="scriptType"]',hw.selectedType(n,e.parentElement)}var pk=function(e,t,n,i,r){var o=r&&r.idPrefix||"";return{template:'<div class="bpp-row bpp-textfield"><label for="'+o+'cam-script-format">'+sk(i("Script Format"))+'</label><div class="bpp-field-wrapper"><input id="'+o+'cam-script-format" type="text" name="scriptFormat" /><button class="action-button clear" data-action="script.clearScriptFormat" data-show="script.canClearScriptFormat"><span>X</span></button></div></div><div class="bpp-row"><label for="'+o+'cam-script-type">'+sk(i("Script Type"))+'</label><div class="bpp-field-wrapper"><select id="'+o+'cam-script-type" name="scriptType" data-value><option value="script" selected>'+sk(i("Inline Script"))+'</option><option value="scriptResource">'+sk(i("External Resource"))+'</option></select></div></div><div class="bpp-row bpp-textfield"><label for="'+o+'cam-script-resource-val" data-show="script.isScriptResource">'+sk(i("Resource"))+'</label><div class="bpp-field-wrapper" data-show="script.isScriptResource"><input id="'+o+'cam-script-resource-val" type="text" name="scriptResourceValue" /><button class="action-button clear" data-action="script.clearScriptResource" data-show="script.canClearScriptResource"><span>X</span></button></div></div><div class="bpp-row"><label for="'+o+'cam-script-val" data-show="script.isScript">'+sk(i("Script"))+'</label><div class="bpp-field-wrapper" data-show="script.isScript"><textarea id="'+o+'cam-script-val" type="text" name="scriptValue"></textarea></div></div>',get:function(n,i){var r={},o=i.get("camunda:resource"),a=i.get(t),s=i.get(e);return void 0!==o?(r.scriptResourceValue=o,r.scriptType="scriptResource"):(r.scriptValue=a,r.scriptType="script"),r.scriptFormat=s,r},set:function(i,r,o){var a=r.scriptFormat,s=r.scriptType,c=r.scriptResourceValue,p=r.scriptValue,u={"camunda:resource":void 0};return u[t]=void 0,u[e]=void 0,n?u[e]=a||"":""!==a&&(u[e]=a),"scriptResource"===s?u["camunda:resource"]=c||"":u[t]=p||"",u},validate:function(e,t){var r={};return"script"!==t.scriptType||t.scriptValue||(r.scriptValue=i("Must provide a value")),"scriptResource"!==t.scriptType||t.scriptResourceValue||(r.scriptResourceValue=i("Must provide a value")),!n||t.scriptFormat&&0!==t.scriptFormat.length||(r.scriptFormat=i("Must provide a value")),r},clearScriptFormat:function(e,t,n,i){return ak("input[name=scriptFormat]",i).value="",!0},canClearScriptFormat:function(e,t,n,i){return""!==ak("input[name=scriptFormat]",i).value},clearScriptResource:function(e,t,n,i){return ak("input[name=scriptResourceValue]",i).value="",!0},canClearScriptResource:function(e,t,n,i){return""!==ak("input[name=scriptResourceValue]",i).value},clearScript:function(e,t,n,i){return ak("textarea[name=scriptValue]",i).value="",!0},canClearScript:function(e,t,n,i){return""!==ak("textarea[name=scriptValue]",i).value},isScriptResource:function(e,t,n,i){return"scriptResource"===ck(i,o)},isScript:function(e,t,n,i){return"script"===ck(i,o)}}},uk=PE.is,lk=tC.isAny,dk=PE.getBusinessObject,hk=hw.escapeHTML,mk=GE.query,fk=function(e,t,n,i){var r=dk(t);if(r){var o=DO.getConditionalEventDefinition(t);if(uk(t,"bpmn:SequenceFlow")&&function(e){return lk(e,vk)}(t.source)||o){var a=pk("language","body",!0,i);e.entries.push({id:"condition",label:i("Condition"),html:'<div class="bpp-row"><label for="cam-condition-type">'+hk(i("Condition Type"))+'</label><div class="bpp-field-wrapper"><select id="cam-condition-type" name="conditionType" data-value><option value="expression">'+hk(i("Expression"))+'</option><option value="script">'+hk(i("Script"))+'</option><option value="" selected></option></select></div></div><div class="bpp-row"><label for="cam-condition" data-show="isExpression">'+hk(i("Expression"))+'</label><div class="bpp-field-wrapper" data-show="isExpression"><input id="cam-condition" type="text" name="condition" /><button class="action-button clear" data-action="clear" data-show="canClear"><span>X</span></button></div><div data-show="isScript">'+a.template+"</div></div>",get:function(e,t){var n=DO.getConditionalEventDefinition(e),i=n?n.condition:r.conditionExpression,o={},s="";i&&(void 0!==i.language?(s="script",o=a.get(e,i)):(s="expression",o.condition=i.get("body")));return o.conditionType=s,o},set:function(e,t,i){var s,c=t.conditionType,p=[],u={body:void 0};if("script"===c)u=a.set(e,t,i);else{var l=t.condition;u.body=l}if(c){s=RE.createElement("bpmn:FormalExpression",u,o||r,n);var d=e.source;d&&d.businessObject.default===r&&p.push(aP.updateProperties(d,{default:void 0}))}var h=o?{condition:s}:{conditionExpression:s};return p.push(aP.updateBusinessObject(e,o||r,h)),p},validate:function(e,t){var n={};return t.condition||"expression"!==t.conditionType?"script"===t.conditionType&&(n=a.validate(e,t)):n.condition=i("Must provide a value"),n},isExpression:function(e,t){var n=mk("select[name=conditionType]",t);if(n.selectedIndex>=0)return"expression"===n.options[n.selectedIndex].value},isScript:function(e,t){var n=mk("select[name=conditionType]",t);if(n.selectedIndex>=0)return"script"===n.options[n.selectedIndex].value},clear:function(e,t){return mk("input[name=condition]",t).value="",!0},canClear:function(e,t){return""!==mk("input[name=condition]",t).value},script:a,cssClasses:["bpp-textfield"]})}}},vk=["bpmn:Activity","bpmn:ExclusiveGateway","bpmn:InclusiveGateway","bpmn:ComplexGateway"];var yk=PE.getBusinessObject,gk=PE.is,bk=PE.is,xk=function(e,t,n,i){Qg(["bpmn:StartEvent","bpmn:BoundaryEvent","bpmn:EndEvent"],(function(n){if(bk(t,n)){var r=DO.getErrorEventDefinition(t);if(r){var o=bk(t,"bpmn:StartEvent")||bk(t,"bpmn:BoundaryEvent");!function(e,t,n,i,r,o,a){var s=function(e){return function(t){return i.get("camunda:"+e)}},c=function(e){return function(t,n){return""===n[e]&&(n[e]=void 0),aP.updateBusinessObject(t,i,n)}};e.entries=e.entries.concat($O(0,i,0,a,{id:"error-element-message",label:a("Message"),referenceProperty:"errorRef",modelProperty:"errorMessage"})),r&&e.entries.push(wO.validationAwareTextField(a,{id:"errorCodeVariable",label:a("Code Variable"),modelProperty:"errorCodeVariable",description:a("Define the name of the variable that will contain the error code"),getProperty:s("errorCodeVariable"),setProperty:c("errorCodeVariable"),validate:function(e,t){var n={},i=t.errorCodeVariable;return hw.containsSpace(i)&&(n.errorCodeVariable=a("Error code variable must not contain spaces.")),n}})),o&&e.entries.push(wO.validationAwareTextField(a,{id:"errorMessageVariable",label:a("Message Variable"),modelProperty:"errorMessageVariable",getProperty:s("errorMessageVariable"),setProperty:c("errorMessageVariable"),description:a("Define the name of the variable that will contain the error message"),validate:function(e,t){var n={},i=t.errorMessageVariable;return hw.containsSpace(i)&&(n.errorMessageVariable=a("Error message variable must not contain spaces.")),n}}))}(e,0,0,r,o,o,i)}}}))},Ek=PE.getBusinessObject,wk=GE.query,_k=GE.closest,Pk=GE.domify,Sk=hw.escapeHTML;function Ok(e,t){var n=_k(e,"div.bpp-properties-tab");return wk("select[name=selectedExtensionElement]"+(t?"[id=cam-extensionElements-"+t+"]":""),n)}function Ck(e,t){var n=Ok(e,t);return{value:(n||{}).value,idx:(n||{}).selectedIndex}}var Tk="create-extension-element",Ak="remove-extension-element",Rk=function(e,t,n,i){var r=n.id,o=n.prefix||"elem",a=n.label||r,s=!1!==n.idGeneration||n.idGeneration,c=n.businessObject||Ek(e),p=n.modelProperty||"id",u=n.getExtensionElements,l=n.createExtensionElement,d="function"==typeof l,h=n.removeExtensionElement,m="function"==typeof h,f=n.onSelectionChange,v=n.hideExtensionElements,y="function"==typeof v,g=n.setOptionLabelValue,b=n.size||5,x=n.resizable,E=n.reference||void 0,w=function(e,t,n,i){if("function"==typeof f)return f(e,t,n,i)},_=function(e){return'<option value="'+Sk(e)+'" data-value data-name="extensionElementValue">'+Sk(e)+"</option>"},P=function(e,t){x&&(e.size=t>b?t:b)};return{id:r,html:'<div class="bpp-row bpp-element-list" '+(y?'data-show="hideElements"':"")+'><label for="cam-extensionElements-'+Sk(r)+'">'+Sk(a)+'</label><div class="bpp-field-wrapper"><select id="cam-extensionElements-'+Sk(r)+'"name="selectedExtensionElement" size="'+Sk(b)+'" data-list-entry-container data-on-change="selectElement"></select>'+(d?'<button class="action-button add" id="cam-extensionElements-create-'+Sk(r)+'" data-action="createElement"><span>+</span></button>':"")+(m?'<button class="action-button clear" id="cam-extensionElements-remove-'+Sk(r)+'" data-action="removeElement" data-disable="disableRemove"><span>-</span></button>':"")+"</div></div>",get:function(e,t){var n=u(e,t),i=[];Qg(n,(function(e){i.push({extensionElementValue:e.get(p)})}));var o=Ok(t.parentNode,r);return P(o,i.length),i},set:function(e,n,i){var r=this.__action;delete this.__action,c=c||Ek(e);var o=E&&c.get(E)?c.get(E):c,a=o.get("extensionElements");if(r.id===Tk){var s=[];return a||(a=RE.createElement("bpmn:ExtensionElements",{values:[]},o,t),s.push(aP.updateBusinessObject(e,o,{extensionElements:a}))),s.push(l(e,a,r.value,i)),s}if(r.id===Ak)return h(e,a,r.value,r.idx,i)},createListEntryTemplate:function(e,t,n){return P(n,n.options.length+1),_(e.extensionElementValue)},deselect:function(e,t){Ok(t,r).selectedIndex=-1},getSelected:function(e,t){return Ck(t,r)},setControlValue:function(e,t,n,i,r,o){t.value=r,g?g(e,t,n,i,r,o):t.text=r},createElement:function(e,t){var n;s&&(n=function(e){return e+="_",hw.nextId(e)}(o));var i=Ok(t,r),a=Pk(_(n));return i.appendChild(a),i.lastChild.selected="selected",w(e,t),P(i,i.options.length),this.__action={id:Tk,value:n},!0},removeElement:function(e,t){var n=Ck(t,r),i=Ok(t,r);return i.removeChild(i.options[n.idx]),P(i,i.options.length),this.__action={id:Ak,value:n.value,idx:n.idx},!0},hideElements:function(e,t,n,i){return!v(e,t,n,i)},disableRemove:function(e,t,n,i){return(Ck(t,r)||{}).idx<0},selectElement:w}},kk=PE.getBusinessObject,jk=PE.is;function Mk(e){var t=e&&Dk(e);return t&&t.values?t.values:[]}function Dk(e){return Bk(e)?function(e){return CP(e.values,(function(e){return jk(e,"camunda:Properties")}))}(e):e.properties}function Bk(e){return jk(e,"bpmn:ExtensionElements")}var Ik=function(e,t,n,i){var r=n.getParent,o=n.modelProperties,a=n.createParent,s=kk(e);if(jk(e,"bpmn:Participant")&&(s=s.get("processRef")),s)return EP(n,{addLabel:i("Add Property"),getElements:function(e,t){return Mk(r(e,t,s))},addElement:function(e,n){var i=[],c=r(e,n,s);if(!c&&"function"==typeof a){var p=a(e,s);c=p.parent,i.push(p.cmd)}var u=Dk(c);u||(u=RE.createElement("camunda:Properties",{},c,t),Bk(c)?i.push(aP.addAndRemoveElementsFromList(e,c,"values","extensionElements",[u],[])):i.push(aP.updateBusinessObject(e,c,{properties:u})));var l={};Qg(o,(function(e){l[e]=void 0})),o.indexOf("id")>=0&&(l.id=hw.nextId("Property_"));var d=RE.createElement("camunda:Property",l,u,t);return i.push(aP.addElementsTolist(e,u,"values",[d])),i},updateElement:function(e,t,n,i){var a=Mk(r(e,n,s))[i];return Qg(o,(function(e){t[e]=t[e]||void 0})),aP.updateBusinessObject(e,a,t)},validate:function(e,t,n,a){if(o.indexOf("id")>=0){var c=Mk(r(e,n,s))[a];if(c){var p=hw.isIdValid(c,t.id,i);if(p)return{id:p}}}},removeElement:function(e,t,n){var i=[],o=r(e,t,s),a=Dk(o),c=Mk(o),p=c[n];return i.push(aP.removeElementsFromList(e,a,"values",null,[p])),1===c.length&&(Bk(o)?Qg(o.values,(function(t){jk(t,"camunda:Properties")&&i.push(qA.removeEntry(s,e,t))})):i.push(aP.updateBusinessObject(e,o,{properties:void 0}))),i}}),wO.table(i,n)},Nk=PE.getBusinessObject,Lk=qA.getExtensionElements,Fk={},Vk=Fk;Fk.getFormData=function(e){var t=Nk(e);return Lk(t,"camunda:FormData")[0]},Fk.getFormFields=function(e){var t=this.getFormData(e);return void 0===t?[]:t.fields||[]},Fk.getFormField=function(e,t){return this.getFormFields(e)[t]},Fk.getConstraints=function(e){return e&&e.validation&&e.validation.constraints?e.validation.constraints:[]},Fk.getEnumValues=function(e){return e&&e.values?e.values:[]};var $k=PE.getBusinessObject,zk=qA.getExtensionElements,qk=qA.removeEntry,Uk=Rk,Gk=Ik,Hk=PE.is;function Wk(e,t,n){var i=t.id,r=t.label,o=t.modelProperty,a=t.validate;return wO.textField(e,{id:i,label:r,modelProperty:o,get:function(e,t){var i=n(e,t)||{},r={};return r[o]=i[o],r},set:function(e,i,r){var a=[];if("function"==typeof t.set){var s=t.set(e,i,r);s&&a.push(s)}var c=n(e,r),p={};return p[o]=i[o]||void 0,a.push(aP.updateBusinessObject(e,c,p)),a},hidden:function(e,t){return!n(e,t)},validate:a})}var Kk=function(e,t,n,i){if(function(e){return Hk(e,"bpmn:StartEvent")&&!Hk(e.parent,"bpmn:SubProcess")||Hk(e,"bpmn:UserTask")}(t)){e.entries.push(wO.selectBox(i,{id:"form-type",label:i("Type"),selectOptions:[{value:"",name:i("<none>")},{value:"formKey",name:i("Embedded or External Task Forms")},{value:"formRef",name:i("Camunda Forms")}],modelProperty:"formType",get:function(e,t){var n=$k(e),i={formType:""};return WT(n.get("camunda:formKey"))?WT(n.get("camunda:formRef"))||(i.formType="formRef"):i.formType="formKey",i},set:function(e,t,n){var i={},r=t.formType;i="formKey"===r?{"camunda:formKey":""}:"formRef"===r?{"camunda:formRef":""}:{"camunda:formRef":void 0,"camunda:formRefBinding":void 0,"camunda:formRefVersion":void 0,"camunda:formKey":void 0};var o=$k(e);return[aP.updateBusinessObject(e,o,i)]}})),e.entries.push(wO.textField(i,{id:"form-key",label:i("Form Key"),modelProperty:"formKey",get:function(e,t){return{formKey:$k(e).get("camunda:formKey")}},set:function(e,t,n){var i=$k(e),r=t.formKey;return aP.updateBusinessObject(e,i,{"camunda:formKey":r})},hidden:function(e,t){return"formKey"!==Yk(e)}})),e.entries.push(wO.textField(i,{id:"form-ref",label:i("Form Ref"),modelProperty:"formRef",get:function(e,t){return{formRef:$k(e).get("camunda:formRef")}},set:function(e,t,n){var i=$k(e),r=t.formRef;return aP.updateBusinessObject(e,i,{"camunda:formRef":r})},hidden:function(e,t){return"formRef"!==Yk(e)}})),e.entries.push(wO.selectBox(i,{id:"form-ref-binding",label:i("Binding"),selectOptions:[{value:"deployment",name:i("deployment")},{value:"latest",name:i("latest")},{value:"version",name:i("version")}],modelProperty:"formRefBinding",get:function(e,t){return{formRefBinding:Xk(e)}},set:function(e,t,n){var i={"camunda:formRefBinding":t.formRefBinding},r=$k(e);return[aP.updateBusinessObject(e,r,i)]},hidden:function(e,t){return"formRef"!==Yk(e)}})),e.entries.push(wO.textField(i,{id:"form-ref-version",label:i("Version"),modelProperty:"formRefVersion",get:function(e,t){return{formRefVersion:$k(e).get("camunda:formRefVersion")}},set:function(e,t,n){var i=$k(e),r=t.formRefVersion||void 0;return aP.updateBusinessObject(e,i,{"camunda:formRefVersion":r})},hidden:function(e,t){return"version"!==Xk(e)}}));var r=Uk(t,n,{id:"form-fields",label:i("Form Fields"),modelProperty:"id",prefix:"FormField",createExtensionElement:function(e,t,i){var r=$k(e),o=[];t||(t=RE.createElement("bpmn:ExtensionElements",{values:[]},r,n),o.push(aP.updateProperties(e,{extensionElements:t})));var a=Vk.getFormData(e);a||(a=RE.createElement("camunda:FormData",{fields:[]},t,n),o.push(aP.addAndRemoveElementsFromList(e,t,"values","extensionElements",[a],[])));var s=RE.createElement("camunda:FormField",{id:i},a,n);return void 0!==a.fields?o.push(aP.addElementsTolist(e,a,"fields",[s])):o.push(aP.updateBusinessObject(e,a,{fields:[s]})),o},removeExtensionElement:function(e,t,n,i){var r=zk($k(e),"camunda:FormData")[0],o=r.fields[i],a=[];return r.fields.length<2?a.push(qk($k(e),e,r)):(a.push(aP.removeElementsFromList(e,r,"fields",null,[o])),o.id===r.get("businessKey")&&a.push(aP.updateBusinessObject(e,r,{businessKey:void 0}))),a},getExtensionElements:function(e){return Vk.getFormFields(e)},hideExtensionElements:function(e,t){return!1}});e.entries.push(r);var o=wO.selectBox(i,{id:"form-business-key",label:i("Business Key"),modelProperty:"businessKey",selectOptions:function(e,t){var n=[{name:"",value:""}],i=Vk.getFormFields(e);return Qg(i,(function(e){"boolean"!==e.type&&n.push({name:e.id,value:e.id})})),n},get:function(e,t){var n={businessKey:""},i=$k(e),r=zk(i,"camunda:FormData");r.length&&(n={businessKey:r[0].get("businessKey")});return n},set:function(e,t,n){var i=zk($k(e),"camunda:FormData")[0];return aP.updateBusinessObject(e,i,{businessKey:t.businessKey||void 0})},hidden:function(e,t){return!(Hk(e,"bpmn:StartEvent")&&Vk.getFormFields(e).length>0)}});e.entries.push(o),e.entries.push(wO.label({id:"form-field-header",labelText:i("Form Field"),showLabel:function(e,t){return!!a(e,t)}})),e.entries.push(wO.validationAwareTextField(i,{id:"form-field-id",label:i("ID (process variable name)"),modelProperty:"id",getProperty:function(e,t){return(a(e,t)||{}).id},setProperty:function(e,t,n){var i=a(e,n);return aP.updateBusinessObject(e,i,t)},hidden:function(e,t){return!a(e,t)},validate:function(e,t,n){var i=a(e,n);if(i){var r=t.id;if(!r||""===r.trim())return{id:"Form field id must not be empty"};var o=Vk.getFormFields(e);if(CP(o,(function(e){return e!==i&&e.id===r})))return{id:"Form field id already used in form data."}}}})),e.entries.push(wO.comboBox(i,{id:"form-field-type",label:i("Type"),selectOptions:[{name:"string",value:"string"},{name:"long",value:"long"},{name:"boolean",value:"boolean"},{name:"date",value:"date"},{name:"enum",value:"enum"}],modelProperty:"type",emptyParameter:!0,get:function(e,t){var n=a(e,t);return n?{type:n.type}:{}},set:function(e,t,n){var i=a(e,n),r=zk($k(e),"camunda:FormData")[0],o=[];return"enum"===i.type&&"enum"!==t.type&&o.push(aP.updateBusinessObject(e,i,{values:void 0})),"boolean"===t.type&&i.get("id")===r.get("businessKey")&&o.push(aP.updateBusinessObject(e,r,{businessKey:void 0})),o.push(aP.updateBusinessObject(e,i,t)),o},hidden:function(e,t){return!a(e,t)}})),e.entries.push(Wk(i,{id:"form-field-label",label:i("Label"),modelProperty:"label"},a)),e.entries.push(Wk(i,{id:"form-field-defaultValue",label:i("Default Value"),modelProperty:"defaultValue"},a)),e.entries.push(wO.label({id:"form-field-enum-values-header",labelText:i("Values"),divider:!0,showLabel:function(e,t){var n=a(e,t);return n&&"enum"===n.type}})),e.entries.push(wO.table(i,{id:"form-field-enum-values",labels:[i("Id"),i("Name")],modelProperties:["id","name"],show:function(e,t){var n=a(e,t);return n&&"enum"===n.type},getElements:function(e,t){var n=a(e,t);return Vk.getEnumValues(n)},addElement:function(e,t){var i=a(e,t),r=hw.nextId("Value_"),o=RE.createElement("camunda:Value",{id:r,name:void 0},$k(e),n);return aP.addElementsTolist(e,i,"values",[o])},removeElement:function(e,t,n){var i=a(e,t),r=i.values[n];return aP.removeElementsFromList(e,i,"values",null,[r])},updateElement:function(e,t,n,i){var r=a(e,n).values[i];return t.name=t.name||void 0,aP.updateBusinessObject(e,r,t)},validate:function(e,t,n,r){var o=a(e,n).values[r];if(o){var s=hw.isIdValid(o,t.id,i);if(s)return{id:s}}}})),e.entries.push(wO.label({id:"form-field-validation-header",labelText:i("Validation"),divider:!0,showLabel:function(e,t){return!!a(e,t)}})),e.entries.push(wO.table(i,{id:"constraints-list",modelProperties:["name","config"],labels:[i("Name"),i("Config")],addLabel:i("Add Constraint"),getElements:function(e,t){var n=a(e,t);return Vk.getConstraints(n)},addElement:function(e,t){var i=[],r=a(e,t),o=r.validation;o||(o=RE.createElement("camunda:Validation",{},$k(e),n),i.push(aP.updateBusinessObject(e,r,{validation:o})));var s=RE.createElement("camunda:Constraint",{name:void 0,config:void 0},o,n);return i.push(aP.addElementsTolist(e,o,"constraints",[s])),i},updateElement:function(e,t,n,i){var r=a(e,n),o=Vk.getConstraints(r)[i];return t.name=t.name||void 0,t.config=t.config||void 0,aP.updateBusinessObject(e,o,t)},removeElement:function(e,t,n){var i=[],r=a(e,t),o=Vk.getConstraints(r),s=o[n];return i.push(aP.removeElementsFromList(e,r.validation,"constraints",null,[s])),1===o.length&&i.push(aP.updateBusinessObject(e,r,{validation:void 0})),i},show:function(e,t){return!!a(e,t)}})),e.entries.push(wO.label({id:"form-field-properties-header",labelText:i("Properties"),divider:!0,showLabel:function(e,t){return!!a(e,t)}})),e.entries.push(Gk(t,n,{id:"form-field-properties",modelProperties:["id","value"],labels:[i("Id"),i("Value")],getParent:function(e,t){return a(e,t)},show:function(e,t){return!!a(e,t)}},i))}function a(e,t){var n=r.getSelected(e,t.parentNode);if(-1!==n.idx)return Vk.getFormField(e,n.idx)}};function Xk(e){return $k(e).get("camunda:formRefBinding")}function Yk(e){var t=$k(e);return WT(t.get("camunda:formKey"))?WT(t.get("camunda:formRef"))?void 0:"formRef":"formKey"}var Jk=PE.is,Zk=PE.getBusinessObject,Qk=PE.is,ej=tC.isAny,tj=PE.getBusinessObject;function nj(e,t){var n=function(e,t){var n=tj(e),i=DO.getSignalEventDefinition(n);return qA.getExtensionElements(i||n,t)}(e,t);return fw(n,(function(e){return!e.businessKey}))}function ij(e){var t="source";return"all"===e.variables?t="variables":void 0!==e.source?t="source":void 0!==e.sourceExpression&&(t="sourceExpression"),t}var rj="camunda:In",oj="camunda:Out",aj=/\s/,sj=PE.is,cj=PE.getBusinessObject;function pj(e){var t=function(e){return uj(e,"camunda:FormData")[0]}(e);return t&&t.get("fields")||[]}function uj(e,t,n){var i=function(e,t){var n=[],i=e.get("extensionElements");if(void 0!==i){var r=i.get("values");void 0!==r&&(n=w(r,(function(e){return function(e,t){return e&&"function"==typeof e.$instanceOf&&e.$instanceOf(t)}(e,t)})))}return n}(e,t);return n?(i[0]||{})[n]||[]:i}function lj(e,t){var n=function(e){return(uj(e,"camunda:InputOutput")||[])[0]}(e);return n&&n.get(t)||[]}function dj(e){for(var t=[],n=e;n.$parent;)t.push(n.$parent),n=n.$parent;return t}function hj(e,t,n){n=n||0,h(e)||(e=[e]),_(e,(function(e,i){var r=t(e,i,n);h(r)&&r.length&&hj(r,t,n+1)}))}function mj(e,t,n){var i=!n||-1===e.indexOf(t);return i&&e.push(t),i}function fj(e,t,n){var i=[],r=[];return hj(e,(function(e,o,a){mj(i,e,t);var s=e.flowElements;if((-1===n||a<n)&&s&&mj(r,s,t))return s})),i}function vj(e,t){return fj(e,!t,-1)}function yj(e,t){var n,i,r=E(e,(function(e){return e.name===t.name&&e.scope===t.scope}));r>=0?e[r].origin=(n=e[r].origin,i=t.origin,n.concat(i)):e.push(t)}function gj(e,t,n){var i,r;return{name:t,origin:[e],scope:(i=n,r=t,x(dj(e),(function(e){return function(e,t){return e&&"function"==typeof e.$instanceOf&&e.$instanceOf(t)}(e,"bpmn:SubProcess")&&function(e,t){return x(function(e){return lj(e,"inputParameters")}(e),(function(e){return e.name===t}))}(e,r)}))||i)}}function bj(e,t){var n=e.eventDefinitions;return n&&t?w(n,(function(e){return function(e,t){return e&&"function"==typeof e.$instanceOf&&e.$instanceOf(t)}(e,t)})):n}var xj=[function(e){var t=e.elements,n=e.containerElement,i=e.processVariables;return h(t)||(t=[t]),_(t,(function(e){_(function(e){return lj(e,"outputParameters")}(e),(function(t){var r=gj(e,t.name,n);yj(i,r)}))})),i},function(e){var t=e.elements,n=e.containerElement,i=e.processVariables;return h(t)||(t=[t]),_(t,(function(e){var t=function(e){return e.get("camunda:resultVariable")}(e);if(t){var r=gj(e,t,n);yj(i,r)}})),i},function(e){var t=e.elements,n=e.containerElement,i=e.processVariables;return h(t)||(t=[t]),_(t,(function(e){_(pj(e),(function(t){var r=gj(e,t.id,n);yj(i,r)}))})),i},function(e){var t=e.elements,n=e.containerElement,i=e.processVariables;return h(t)||(t=[t]),_(t,(function(e){_(function(e){return uj(e,"camunda:Out")}(e),(function(t){if(!t.local){var r=gj(e,t.target,n);yj(i,r)}}))})),i},function(e){var t=e.elements,n=e.containerElement,i=e.processVariables,r=function(e,t){var r=gj(e,t,n);yj(i,r)};return h(t)||(t=[t]),_(t,(function(e){_(function(e){return bj(e,"bpmn:ErrorEventDefinition")}(e),(function(t){var n=t.get("errorCodeVariable"),i=t.get("errorMessageVariable");n&&r(e,n),i&&r(e,i)})),_(function(e){return bj(e,"bpmn:EscalationEventDefinition")}(e),(function(t){var n=t.get("escalationCodeVariable");n&&r(e,n)}))})),i}];function Ej(e){var t=[],n=vj([e],!1);return _(xj,(function(i){i({elements:n,containerElement:e,processVariables:t})})),t}var wj=t(Object.freeze({__proto__:null,getProcessVariables:Ej,getVariablesForScope:function(e,t){var n,i=Ej(t),r=function(e,t){return x(vj(t),(function(t){return t.id===e}))}(e,t),o=w(i,(function(e){return e.scope.id===r.id})),a=dj(r),s=w(i,(function(e){return x(a,(function(t){return t.id===e.scope.id}))}));return n=s,o.concat(n)}})),_j=wj.getVariablesForScope,Pj=KS.groupBy,Sj=KS.flatten,Oj=KS.forEach,Cj=KS.keys,Tj=KS.map,Aj=KS.sortBy,Rj=PE.getBusinessObject,kj=PE.is,jj=tC.isAny,Mj=hw.escapeHTML,Dj=function(e,t){var n=[];function i(e,n){var i=n?n+"-":"";return Sj(Tj(e,(function(e,n){var r=e.name,o=e.origin,a=[],s=wO.collapsible({id:i+"variable- "+n+"-collapsible",title:Mj(r),description:o.toString(),open:!1,get:function(){return{title:Mj(r),description:o.toString()}}}),c=s.isOpen;a.push(s);var p='<div data-show="show"><b>'+Mj(t("Created in"))+"</b>"+function(e){var t="";return Oj(e,(function(e){t+='<p class="bpp-process-variables__created-in-item">'+e+"</p>"})),t}(o)+"</div>";return a.push({id:i+"variable- "+n+"-created-in",html:p,cssClasses:["bpp-process-variables","bpp-process-variables__created-in"],show:function(){return c()}}),a})))}if(!function(e){var t=Rj(e);return jj(e,["bpmn:Process","bpmn:SubProcess"])||kj(e,"bpmn:Participant")&&t.get("processRef")}(e))return n;var r,o=function(e){var t=Rj(e);if(kj(t,"bpmn:Participant"))return t.processRef;if(kj(t,"bpmn:Process"))return t;var n=t;for(;n.$parent&&!kj(n,"bpmn:Process");)n=n.$parent;return n}(Rj(e)),a=function(e){if(kj(e,"bpmn:Participant"))return Rj(e).processRef.id;return e.id}(e),s=function(e){return Oj(e,(function(e){var t=Tj(e.origin,(function(e){return e.name||e.id}));e.origin=t,e.scope=e.scope.name||e.scope.id})),e}(function(e){return Aj(e,(function(e){return e.name}))}(_j(a,o))),c=function(e){return Pj(e,"scope")}(s),p=Q_(t,t("Available process variables, identified in the diagram."));if(n.push({id:"process-variables-description",html:p,cssClasses:["bpp-process-variables","bpp-process-variables__description"]}),!s.length){var u=Q_(t,t("No variables found."));return n.push({id:"process-variables-placeholder",html:u}),n}return Cj(c).length>1?Oj((r=Cj(c),Tj(r,(function(e,t){return r[r.length-1-t]}))),(function(e){var r=c[e];n.push({id:e+"-scope-title",html:"<div>"+Mj(t("Scope: "))+e+"</div>",cssClasses:["bpp-process-variables","bpp-process-variables__scope-title","bpp-collapsible-break"]}),n=n.concat(i(r,e))})):n=n.concat(i(s)),n};var Bj=tC.isAny,Ij=PE.is,Nj=PE.getBusinessObject,Lj=function(e,t,n){if(function(e){var t=Nj(e);return Bj(e,["bpmn:Process","bpmn:SubProcess"])||Ij(e,"bpmn:Participant")&&t.get("processRef")}(t)){var i=Dj(t,n);e.entries=e.entries.concat(i)}};var Fj=PE.is,Vj=PE.getBusinessObject;function $j(e,t){return e&&qA.getExtensionElements(e,t)||[]}var zj="camunda:ExecutionListener",qj="camunda:TaskListener",Uj=function(e,t,n,i){var r=function(e,t,n,i){var r,o={class:i("Java Class"),expression:i("Expression"),delegateExpression:i("Delegate Expression"),script:i("Script")},a={getSelectedListener:function(e,t){var n=d&&d.getSelected(e,t)||{idx:-1},i=$j(r,zj)[n.idx];return!i&&h&&(n=h.getSelected(e,t),i=$j(r,qj)[n.idx]),i}},s=a.entries=[],c=KA.isSequenceFlow(e),p=function(e){return function(t,n,i,a,s,c){var p=$j(r,e)[c],u=KA.getImplementationType(p),l=((p.get("event")?p.get("event"):"<empty>")||"*")+" : "+(o[u]||"");i.text=l}},u=function(e,n,i){return function(e,r,o){var a={event:i,class:""},s=RE.createElement(n,a,r,t);return aP.addElementsTolist(e,r,"values",[s])}},l=function(e,t){return function(e,n,i,o){var a=$j(r,t)[o];if(a)return qA.removeEntry(r,e,a)}};if((Fj(e,"bpmn:FlowElement")||Fj(e,"bpmn:Process")||Fj(e,"bpmn:Participant"))&&(r=Vj(e),Fj(e,"bpmn:Participant")&&(e=e.processRef,r=r.get("processRef")),r)){var d=Rk(e,t,{id:"executionListeners",label:i("Execution Listener"),modelProperty:"name",idGeneration:"false",reference:"processRef",createExtensionElement:u(0,zj,c?"take":"start"),removeExtensionElement:l(0,zj),getExtensionElements:function(e){return $j(r,zj)},onSelectionChange:function(e,t,n,i){h&&h.deselect(e,t)},setOptionLabelValue:p(zj)});s.push(d)}if(Fj(e,"bpmn:UserTask")){r=Vj(e);var h=Rk(e,t,{id:"taskListeners",label:i("Task Listener"),modelProperty:"name",idGeneration:"false",createExtensionElement:u(0,qj,"create"),removeExtensionElement:l(0,qj),getExtensionElements:function(e){return $j(r,qj)},onSelectionChange:function(e,t,n,i){d.deselect(e,t)},setOptionLabelValue:p(qj)});s.push(h)}return a}(t,n,0,i);return e.entries=e.entries.concat(r.entries),{getSelectedListener:r.getSelectedListener}},Gj=PE.is,Hj=KS.find,Wj=function(e,t,n,i,r){var o={class:r("Java Class"),expression:r("Expression"),delegateExpression:r("Delegate Expression"),script:r("Script")},a=(i=i||{}).getSelectedListener,s="class",c="expression",p="delegateExpression",u="script",l=KA.isSequenceFlow(t)?[{name:r("take"),value:"take"}]:[{name:r("start"),value:"start"},{name:r("end"),value:"end"}],d=[{name:r("create"),value:"create"},{name:r("assignment"),value:"assignment"},{name:r("complete"),value:"complete"},{name:r("delete"),value:"delete"},{name:r("update"),value:"update"},{name:r("timeout"),value:"timeout"}],h=function(e,t){return a(e,t)};e.entries.push(wO.selectBox(r,{id:"listener-event-type",label:r("Event Type"),modelProperty:"eventType",emptyParameter:!1,get:function(e,t){var n=a(e,t);return{eventType:n&&n.get("event")}},set:function(e,t,n){var i=t.eventType,r=a(e,n),o=r&&r.eventDefinitions;return o&&"timeout"!==i&&(o=[]),aP.updateBusinessObject(e,r,{event:i,eventDefinitions:o})},selectOptions:function(e,t){var n,i=a(e,t);return KA.isTaskListener(i)?n=d:KA.isExecutionListener(i)&&(n=l),n},hidden:function(e,t){return!h(e,t)}})),e.entries.push(wO.textField(r,{id:"listener-id",label:r("Listener Id"),modelProperty:"listenerId",get:function(e,t){var n={},i=a(e,t);return n.listenerId=i&&i.get("id")||void 0,n},set:function(e,t,n){var i={},r=a(e,n);return i.id=t.listenerId||"",aP.updateBusinessObject(e,r,i)},hidden:function(e,t){var n=a(e,t);return!KA.isTaskListener(n)},validate:function(e,t,n){var i=t.listenerId,o=a(e,n),s={};return!i&&Kj(o)&&(s.listenerId=r("Must provide a value for timeout task listener")),s}})),e.entries.push(wO.selectBox(r,{id:"listener-type",label:r("Listener Type"),selectOptions:[{value:s,name:r("Java Class")},{value:c,name:r("Expression")},{value:p,name:r("Delegate Expression")},{value:u,name:r("Script")}],modelProperty:"listenerType",emptyParameter:!1,get:function(e,t){var n=a(e,t);return{listenerType:KA.getImplementationType(n)}},set:function(e,t,i){var r=a(e,i),o=t.listenerType||void 0,l={};return l.class=o===s?"":void 0,l.expression=o===c?"":void 0,l.delegateExpression=o===p?"":void 0,l.script=o===u?n.create("camunda:Script"):void 0,aP.updateBusinessObject(e,r,l)},hidden:function(e,t){return!h(e,t)}})),e.entries.push(wO.textField(r,{id:"listener-value",dataValueLabel:"listenerValueLabel",modelProperty:"listenerValue",get:function(e,t){var n={},i=a(e,t),r=KA.getImplementationType(i);return n.listenerValueLabel=o[r]||"",n.listenerValue=i&&i.get(r)||void 0,n},set:function(e,t,n){var i={},r=a(e,n);return i[KA.getImplementationType(r)]=t.listenerValue||"",aP.updateBusinessObject(e,r,i)},hidden:function(e,t){var n=a(e,t);return!n||n.script},validate:function(e,t){var n={};return t.listenerValue||(n.listenerValue=r("Must provide a value")),n}}));var m=pk("scriptFormat","value",!0,r);e.entries.push({id:"listener-script-value",html:'<div data-show="isScript">'+m.template+"</div>",get:function(e,t){var n=a(e,t);return n&&n.script?m.get(e,n.script):{}},set:function(e,t,n){var i=a(e,n),r=m.set(e,t,i);return aP.updateBusinessObject(e,i.script,r)},validate:function(e,t,n){var i=a(e,n);return i&&i.script?m.validate(e,t):{}},isScript:function(e,t){var n=a(e,t);return n&&n.script},script:m});var f={idPrefix:"listener-",createTimerEventDefinition:function(e,t){var i=a(e,t);if(i&&Kj(i)){var r=i.get("eventDefinitions")||[],o=n.create("bpmn:TimerEventDefinition");return r.push(o),i.eventDefinitions=r,o}}};GO(e,t,n,(function(e,t){var n=a(e,t);if(n&&Kj(n)){var i,r=(i=n.eventDefinitions||[],Hj(i,(function(e){return Gj(e,"bpmn:TimerEventDefinition")})));return r||!1}}),r,f)};function Kj(e){return"timeout"===(e&&e.event)}var Xj=PE.getBusinessObject,Yj={stringValue:void 0,string:void 0,expression:void 0},Jj="camunda:Field",Zj=function(e,t,n,i){var r=!!(i=i||{}).insideListener,o=i.idPrefix||"",a=i.getSelectedListener,s=i.businessObject||Xj(e),c=[],p=function(e,t){return u(e,t)};function u(e,t){var n=h.getSelected(e,t.parentNode);if(-1!==n.idx)return l(e,t)[n.idx]}function l(e,t){return r?function(e,t){var n=a(e,t);return n&&n.fields||[]}(e,t):s&&qA.getExtensionElements(s,Jj)}function d(e){var t="string",n=e&&e.expression;return void 0!==(e&&(e.string||e.stringValue))?t="string":void 0!==n&&(t="expression"),t}var h=Rk(e,t,{id:o+"fields",label:n("Fields"),modelProperty:"fieldName",idGeneration:"false",businessObject:s,createExtensionElement:function(e,n,i,o){var s,c={name:"",string:""};if(r){var p=a(e,o);return s=RE.createElement(Jj,c,p,t),aP.addElementsTolist(e,p,"fields",[s])}return s=RE.createElement(Jj,c,n,t),aP.addElementsTolist(e,n,"values",[s])},removeExtensionElement:function(e,t,n,i,o){var c=l(e,o)[i];if(c){if(!r)return qA.removeEntry(s,e,c);var p=a(e,o);return aP.removeElementsFromList(e,p,"fields",null,[c])}},getExtensionElements:function(e,t){return l(e,t)},setOptionLabelValue:function(e,t,n,i,r,o){var a=l(e,t)[o],s=o+" : "+(a.name?a.name:"<empty>");n.text=s}});c.push(h),c.push(wO.validationAwareTextField(n,{id:o+"field-name",label:n("Name"),modelProperty:"fieldName",getProperty:function(e,t){return(u(e,t)||{}).name},setProperty:function(e,t,n){var i=u(e,n);return aP.updateBusinessObject(e,i,{name:t.fieldName})},validate:function(e,t,i){var r={};if(u(e,i)){var o=t.fieldName;o?hw.containsSpace(o)&&(r.fieldName=n("Name must not contain spaces")):r.fieldName=n("Parameter must have a name")}return r},hidden:function(e,t){return!p(e,t)}}));var m=[{name:n("String"),value:"string"},{name:n("Expression"),value:"expression"}];return c.push(wO.selectBox(n,{id:o+"field-type",label:n("Type"),selectOptions:m,modelProperty:"fieldType",get:function(e,t){return{fieldType:d(u(e,t))}},set:function(e,t,n){var i=EP({},Yj),r=t.fieldType;return"string"===r?i.string="":"expression"===r&&(i.expression=""),aP.updateBusinessObject(e,u(e,n),i)},hidden:function(e,t){return!p(e,t)}})),c.push(wO.textBox(n,{id:o+"field-value",label:n("Value"),modelProperty:"fieldValue",get:function(e,t){var n,i=u(e,t),r=d(i);return"string"===r?n=i&&(i.string||i.stringValue):"expression"===r&&(n=i&&i.expression),{fieldValue:n}},set:function(e,t,n){var i=u(e,n),r=d(i),o=EP({},Yj),a=t.fieldValue||void 0;return"string"===r?o.string=a:"expression"===r&&(o.expression=a),aP.updateBusinessObject(e,i,o)},validate:function(e,t,i){var r={};return u(e,i)&&(t.fieldValue||(r.fieldValue=n("Must provide a value"))),r},show:function(e,t){return p(e,t)}})),c},Qj=tC.isAny,eM="element-template-option-empty",tM={name:"",value:eM};function nM(e,t,n){var i=n(t.name);t.version&&(i+=" (v"+t.version+")");var r={id:t.id,name:i,value:e};return t.version&&(r.version=t.version),r}function iM(e){var t=new Date(e),n=t.getFullYear(),i=rM(String(t.getMonth()+1),2,"0");return rM(String(t.getDate()),2,"0")+"."+i+"."+n}function rM(e,t,n){for(;e.length<t;)e=n+e;return e}var oM={ELEMENT_TEMPLATE_OPTION_EMPTY:"element-template-option-empty",getOptions:function(e,t,n){var i=[tM],r=t.getDefault(e);if(r)return i.push(nM("element-template-option-0",r,n)),i;var o=0;return t.getAll().forEach((function(t){Qj(e,t.appliesTo)&&(i.push(nM("element-template-option-"+o,t,n)),o++)})),i},getOption:function(e,t){return CP(t,(function(t){return e===t.value}))},getVersionOrDateFromTemplate:function(e){var t=e.metadata,n=e.version;if(t){if(!WT(t.created))return"Version "+iM(t.created);if(!WT(t.updated))return"Version "+iM(t.updated)}return WT(n)?null:"Version "+n}},aM=hw.escapeHTML,sM=KC.getTemplateId,cM=GE.classes,pM=GE.event,uM=GE.domify,lM=GE.query,dM=PE.getBusinessObject,hM=oM.getVersionOrDateFromTemplate,mM=200,fM=function(e,t,n,i,r,o,a){var s,c,p=n.get(e),u=[];return p?((c=function(e,t){if(WT(t.version))return null;return e.getAll().filter((function(e){return t.id===e.id&&!WT(e.version)})).reduce((function(e,n){return t.version<n.version||e&&e.version<n.version?n:e}),null)}(n,p))&&u.push({id:"element-template-update",cssClasses:["bpp-entry--warning"],html:yM(e,p,c,t,a)}),(s=p.description)&&u.push(function(e,t){e=aM(e);var n=uM('<p class="description description--expanded"></p>'),i=uM('<span class="description__text">'+e+"</span>");function r(r){r?(cM(n).add("description--expanded"),i.textContent=e+" ",a.textContent=t("Less")):(cM(n).remove("description--expanded"),i.textContent=o+" ... ",a.textContent=t("More"))}n.appendChild(i);var o,a,s=!1;e.length>mM&&(o=e.slice(0,mM),a=uM('<span class="bpp-entry-link description__expand">'+t("More")+"</span>"),pM.bind(a,"click",(function(){r(s=!s)})),n.appendChild(a),r(s));return{id:"element-template-description",html:n}}(s,a))):u.push({id:"element-template-not-found",cssClasses:["bpp-entry--warning"],html:vM(e,i,a)}),p&&p.version&&u.push({id:"element-template-version",html:"<p>"+hM(p)+"</p>"}),{id:"elementTemplateDescription",label:p?p.name:a("Missing Template"),dropdown:{menu:[{id:"element-template-unlink",label:a("Unlink"),onClick:function(){i.updateProperties(e,{"camunda:modelerTemplate":null,"camunda:modelerTemplateVersion":null})}},{id:"element-template-remove",label:a("Remove"),onClick:function(){var t=dM(e),n=t.$type,i=function(e){if(!e.eventDefinitions)return null;var t=e.eventDefinitions[0];if(!t)return null;return t.$type}(t),a=r.replaceElement(e,{type:n,eventDefinitionType:i});o.select(a)}}]},entries:u}};function vM(e,t,n){var i=sM(e),r=uM("<p>"+n("The applied Template <{templateId}> was not found and therefore its data is not accessible.<br /><br />Unlink in order to access the data.",{templateId:i})+'</p><p style="text-align: right;"><a class="bpp-entry-link bpp-entry-link-button">Unlink</a></p>');return lM(".bpp-entry-link",r).addEventListener("click",(function(){t.updateProperties(e,{"camunda:modelerTemplate":null})})),r}function yM(e,t,n,i,r){var o=hM(n),a=uM("<p>"+r("A new version of the Template ({newElementTemplateVersion}) is available.",{newElementTemplateVersion:o})+'</p><p style="text-align: right;"><a class="bpp-entry-link bpp-entry-link-button">Update</a></p>');return lM(".bpp-entry-link",a).addEventListener("click",(function(){i.execute("propertiesPanel.camunda.changeTemplate",{element:e,newTemplate:n,oldTemplate:t})})),a}var gM=function(e){return null===e};var bM=function(e,t,n,i){if(!Gg(e))return e;for(var r=-1,o=(t=uE(t,e)).length,a=o-1,s=e;null!=s&&++r<o;){var c=lE(t[r]),p=n;if("__proto__"===c||"constructor"===c||"prototype"===c)return e;if(r!=a){var u=s[c];void 0===(p=i?i(u,c,s):void 0)&&(p=Gg(u)?u:Ag(t[r+1])?[]:{})}vP(s,c,p),s=s[c]}return e};var xM=function(e,t,n){for(var i=-1,r=t.length,o={};++i<r;){var a=t[i],s=dE(e,a);n(s,a)&&bM(o,uE(a,e),s)}return o};var EM=function(e,t){return xM(e,t,(function(t,n){return vE(e,n)}))};var wM=function(e){return Ow(xw(e,void 0,HT),e+"")}((function(e,t){return null==e?{}:EM(e,t)})),_M=oM.getOption,PM=oM.getOptions,SM=KC.getTemplateId,OM=KC.ELEMENT_TEMPLATE_OPTION_EMPTY;var CM=PE.getBusinessObject,TM=KC.findExtension,AM=KC.findExtensions,RM=KC.findInputParameter,kM=KC.findOutputParameter,jM=KC.findCamundaProperty,MM=KC.findCamundaInOut,DM=KC.findCamundaErrorEventDefinition,BM=nT.createCamundaProperty,IM=nT.createInputParameter,NM=nT.createOutputParameter,LM=nT.createCamundaIn,FM=nT.createCamundaOut,VM=nT.createCamundaInWithBusinessKey,$M=nT.createCamundaFieldInjection,zM=nT.createCamundaErrorEventDefinition,qM=nT.createError,UM=hw.getRoot,GM="property",HM="camunda:property",WM="camunda:inputParameter",KM="camunda:outputParameter",XM="camunda:in",YM="camunda:out",JM="camunda:in:businessKey",ZM="camunda:executionListener",QM="camunda:field",eD="camunda:errorEventDefinition",tD=["Boolean","Integer","String"],nD=[HM,WM,KM,XM,YM,JM,QM,eD],iD=[WM,KM],rD=[XM,YM,JM],oD=function(e,t,n,i){var r=t.get(e);if(!r)return[];var o,a,s=function(e,t,r){var o,a=t.type,s={id:e,description:t.description,label:t.label?i(t.label):t.label,modelProperty:e,get:aD(e,t),set:sD(e,t,n),validate:cD(e,t,i)};return a||(a=function(e){var t=e.binding.type;if(t===GM||t===HM||t===XM||t===JM||t===YM||t===QM)return"String";if(t===ZM)return"Hidden"}(t)),"Boolean"===a&&(o=wO.checkbox(i,s)),"String"===a&&(o=wO.textField(i,s)),"Text"===a&&(o=wO.textBox(i,s)),"Dropdown"===a&&(s.selectOptions=t.choices,o=wO.selectBox(i,s)),o},c=[],p={id:"customField",label:i("Custom Fields"),entries:[]};return r.properties.forEach((function(e,t){o="custom-"+r.id+"-"+t,(a=s(o,e))&&p.entries.push(a)})),p.entries.length>0&&c.push(p),r.scopes&&QC(r.scopes).forEach((function(e){var t=e.type,n=t.replace(/:/g,"_"),o={id:"customField-"+n,label:i("Custom Fields for scope: ")+t,entries:[]};e.properties.forEach((function(t,i){var c="custom-"+r.id+"-"+n+"-"+i,p=function(e,t){var n=t.type,i=t.id;if(!n)return e;return EP({},e,{scope:{name:n,id:i}})}(t,e);(a=s(c,p))&&o.entries.push(a)})),o.entries.length>0&&c.push(o)})),c};function aD(e,t){return function(n){var i=pD(n,t);return dD(e,i)}}function sD(e,t,n){return function(i,r){var o=r[e];return uD(i,t,o,n)}}function cD(e,t,n){return function(i,r){var o=function(e,t,n){var i=t.constraints||{};if(i.notEmpty&&(r=e,!r||/^\s*$/.test(r)))return n("Must not be empty");var r;if(i.maxLength&&e.length>i.maxLength)return n("Must have max length {length}",{length:i.maxLength});if(i.minLength&&e.length<i.minLength)return n("Must have min length {length}",{length:i.minLength});var o,a=i.pattern;if(a&&("string"!=typeof a&&(o=a.message,a=a.value),!function(e,t){return new RegExp(t).test(e)}(e,a)))return o||n("Must match pattern {pattern}",{pattern:a})}(r[e],t,n);if(o)return dD(e,o)}}function pD(e,t){var n,i,r,o,a,s,c,p=CM(e),u=t.binding,l=t.scope,d=u.type,h=u.name,m=t.value||"";if(l&&!(p=hD(p,l)))return m;if("property"===d){var f=p.get(h);return"conditionExpression"===h?f?f.body:m:void 0!==f?f:m}if(d===HM)return(n=l?p.get("properties"):TM(p,"camunda:Properties"))&&(i=jM(n,u))?i.value:m;if(-1!==iD.indexOf(d)&&!(r=l?p.get("inputOutput"):TM(p,"camunda:InputOutput")))return m;if(d===WM){if(o=RM(r,u)){if(!u.scriptFormat)return o.value||"";if(o.definition)return o.definition.value}return m}if(u.type===KM)return(o=kM(r,u))?o.name:m;if(-1!=rD.indexOf(d)){if(a=MM(p,u)){if(d===JM)return a.businessKey;if(d===YM)return a.target;if(d===XM)return a[u.expression?"sourceExpression":"source"]}return m}if(d===ZM)return(l?p.get("executionListener"):TM(p,"camunda:ExecutionListener")).script.value;if(QM===d)return AM(p,["camunda:Field"]).forEach((function(e){e.name===u.name&&(s=e)})),s?s.string||s.expression:"";if(eD===d)return(c=DM(p,u.errorRef))?c.expression:"";throw function(e){var t=e.binding;return new Error("unknown binding: <"+t.type+">")}(t)}function uD(e,t,n,i){var r,o,a,s,c,p,u,l,d,h,m=CM(e),f=t.binding,v=t.scope,y=f.type,g=f.name,b=UM(m),x=[];if(-1!==nD.indexOf(y)&&((o=m.get("extensionElements"))||(o=RE.createElement("bpmn:ExtensionElements",null,e,i),x.push(aP.updateBusinessObject(e,m,dD("extensionElements",o))))),v&&((m=hD(m,v))||("bpmn:Error"===v.name?(m=qM(v.id,b,i),x.push(aP.addElementsTolist(m,b,"rootElements",[m]))):(m=RE.createElement(v.name,null,e,i),x.push(aP.addElementsTolist(m,o,"values",[m]))))),"property"===y){if("conditionExpression"===g)r=RE.createElement("bpmn:FormalExpression",{body:n,language:f.scriptFormat},m,i);else{var E=m.$descriptor.propertiesByName[g].type;if(-1===tD.indexOf(E))throw new Error("cannot set moddle type <"+E+">");"Boolean"===E?r=!!n:"Integer"===E?(r=parseInt(n,10),isNaN(r)&&(r=void 0)):r=n}void 0!==r&&x.push(aP.updateBusinessObject(e,m,dD(g,r)))}if(y===HM&&((a=v?m.get("properties"):TM(o,"camunda:Properties"))||(a=RE.createElement("camunda:Properties",null,m,i),v?x.push(aP.updateBusinessObject(e,m,{properties:a})):x.push(aP.addElementsTolist(e,o,"values",[a]))),s=jM(a,f),c=BM(f,n,i),x.push(aP.addAndRemoveElementsFromList(e,a,"values",null,[c],s?[s]:[]))),-1!==iD.indexOf(y)&&((p=v?m.get("inputOutput"):TM(o,"camunda:InputOutput"))||(p=RE.createElement("camunda:InputOutput",null,m,i),v?x.push(aP.updateBusinessObject(e,m,{inputOutput:p})):x.push(aP.addElementsTolist(e,o,"values",p)))),y===WM&&(u=RM(p,f),l=IM(f,n,i),x.push(aP.addAndRemoveElementsFromList(e,p,"inputParameters",null,[l],u?[u]:[]))),y===KM&&(u=kM(p,f),l=NM(f,n,i),x.push(aP.addAndRemoveElementsFromList(e,p,"outputParameters",null,[l],u?[u]:[]))),-1!==rD.indexOf(y)&&(d=MM(m,f),h=y===XM?LM(f,n,i):y===YM?FM(f,n,i):VM(f,n,i),x.push(aP.addAndRemoveElementsFromList(e,o,"values",null,[h],d?[d]:[]))),y===QM){var w=AM(m,["camunda:Field"]),_=[];w.length>0?w.forEach((function(e){e.name===f.name?_.push($M(f,n,i)):_.push(e)})):_.push($M(f,n,i)),x.push(aP.addAndRemoveElementsFromList(e,o,"values",null,_,w||[]))}if(y===eD){var P=DM(m,f.errorRef);if(P)x.push(aP.updateBusinessObject(e,P,{expression:n}));else{var S=qM(f.errorRef,b,i),O=zM(f,n,S,o,i);x.push(aP.addAndRemoveElementsFromList(e,b,"rootElements",null,[S],[])),x.push(aP.addAndRemoveElementsFromList(e,o,"values",null,[O],[]))}}if(x.length)return x;console.warn("no update",e,t,n)}var lD=uD;function dD(e,t){var n={};return n[e]=t,n}function hD(e,t){var n=t.name,i=t.id;if("bpmn:Error"===n){var r=DM(e,i);if(r)return r.errorRef}return TM(e,n)}oD.getPropertyValue=pD,oD.setPropertyValue=lD;var mD=PE.is,fD=PE.getBusinessObject,vD=tC.isAny,yD=wj.getVariablesForScope,gD=KS.filter,bD=KS.map,xD=KS.sortBy,ED=GE.query,wD=function(e,t,n,i){var r={"camunda:Map":{value:"map",label:i("Map")},"camunda:List":{value:"list",label:i("List")},"camunda:Script":{value:"script",label:i("Script")}},o=(n=n||{}).idPrefix||"",a=n.getParameter&&"function"==typeof n.getParameter?function(){return n.getParameter()}:function(){return e},s={},c=[];s.entries=c;var p=wO.collapsible({id:o+"collapsible",title:e.name,description:CD(e),cssClasses:["bpp-collapsible--with-mapping"],open:!1,onRemove:n.onRemove,onToggle:n.onToggle,get:function(){return{title:a().name,description:CD(a())}}}),u=n.isOpen||p.isOpen;s.setOpen=function(e,t){var n=ED('[data-entry="'+p.id+'"]',t);p.setOpen(e,n)},c.push(p),c.push(wO.validationAwareTextField(i,{id:o+"parameterName",label:mD(e,"camunda:InputParameter")?i("Local Variable Name"):i("Process Variable Name"),modelProperty:"name",getProperty:function(t,n){return e.name},setProperty:function(t,n,i){return aP.updateBusinessObject(t,e,n)},validate:function(e,t,n){var r={},o=t.name;return o?hw.containsSpace(o)&&(r.name=i("Name must not contain spaces")):r.name=i("Parameter must have a name"),r},hidden:function(e,t){return!u()}}));var l=[{value:"text",name:i("String or Expression")},{value:"script",name:i("Script")},{value:"list",name:i("List")},{value:"map",name:i("Map")}];c.push(wO.selectBox(i,{id:o+"parameterType",label:i("Variable Assignment Type"),selectOptions:l,modelProperty:"parameterType",get:function(e,t){var n="text",i=a().get("definition");if(void 0!==i){var o=i.$type;n=r[o].value}return{parameterType:n}},set:function(e,n,i){var r={value:void 0,definition:void 0},o=function(e){return _D(e,a(),t)},s=n.parameterType;return"script"===s?r.definition=o("camunda:Script"):"list"===s?r.definition=o("camunda:List"):"map"===s&&(r.definition=o("camunda:Map")),aP.updateBusinessObject(e,a(),r)},hidden:function(e,t){return!u()}})),c.push(wO.autoSuggest(i,{id:o+"parameterType-text",label:i("Variable Assignment Value"),description:i('Start typing "${}" to create an expression.'),modelProperty:"value",get:function(e,t){return{value:a().value}},set:function(e,t,n){return t.value=t.value||void 0,aP.updateBusinessObject(e,a(),t)},show:function(e,t){return u()&&!a().definition},getItems:function(e){var t=function(e){var t=fD(e);if(vD(t,["bpmn:Process","bpmn:SubProcess"]))return t.id;var n=t;for(;n.$parent&&!vD(n,["bpmn:Process","bpmn:SubProcess"]);)n=n.$parent;return n.id}(e),n=function(e){var t=fD(e);for(;t.$parent&&!mD(t,"bpmn:Process");)t=t.$parent;return t}(e),i=yD(t,n),r=function(e){return xD(e,(function(e){return e.name}))}(i=gD(i,(function(t){var n=t.origin;return!!gD(n,(function(t){return t.id!==e.id})).length})));return bD(r,(function(e){return e.name}))},canSuggest:function(e,t,n){var i=function(e,t,n){for(var i=t.childNodes,r="",o=0;o<=i.length-1;o++){var a=i[o];if(a.contains(n))break;r+=(a.innerText||a.wholeText)+"\n"}return r.length+(e.index||0)}(e,t,n);return!!function(e,t){var n=e.indexOf("${"),i=e.indexOf("}");return n>-1&&n<=t&&i>-1&&t<i}(t.innerText,i)||!!function(e,t){var n=e.lastIndexOf("}",t),i=e.indexOf("${",n+1);return i>-1&&i<=t}(t.innerText,i)}}));var d=pk("scriptFormat","value",!0,i,{idPrefix:o});return c.push({id:o+"parameterType-script",html:'<div data-show="show">'+d.template+"</div>",get:function(e,t){return PD(a().definition)?d.get(e,a().definition):{}},set:function(e,t,n){var i=d.set(e,t);return aP.updateBusinessObject(e,a().definition,i)},validate:function(e,t,n){return PD(a().definition)?d.validate(e,a().definition):{}},script:d,show:function(e,t){return u()&&a().definition&&PD(a().definition)}}),c.push(wO.table(i,{id:o+"parameterType-list",modelProperties:["value"],labels:[i("Value")],addLabel:i("Add Value"),getElements:function(e,t){return SD(a().definition)?a().definition.items:[]},updateElement:function(e,t,n,i){var r=a().definition.items[i];return aP.updateBusinessObject(e,r,t)},addElement:function(e,n){var i=_D("camunda:Value",a().definition,t,{value:void 0});return aP.addElementsTolist(e,a().definition,"items",[i])},removeElement:function(e,t,n){return aP.removeElementsFromList(e,a().definition,"items",null,[a().definition.items[n]])},editable:function(e,t,n,i){var r=a().definition.items[i];return!OD(r)&&!SD(r)&&!PD(r)},setControlValue:function(e,t,n,i,o,s){var c=a().definition.items[s];OD(c)||SD(c)||PD(c)?n.value=r[c.$type].label:n.value=o},show:function(e,t){return u()&&a().definition&&SD(a().definition)}})),c.push(wO.table(i,{id:o+"parameterType-map",modelProperties:["key","value"],labels:[i("Key"),i("Value")],addLabel:i("Add Entry"),getElements:function(e,t){return a()&&OD(a().definition)?a().definition.entries:[]},updateElement:function(e,t,n,i){var r=a().definition.entries[i];return(OD(r.definition)||SD(r.definition)||PD(r.definition))&&(t={key:t.key}),aP.updateBusinessObject(e,r,t)},addElement:function(e,n){var i=_D("camunda:Entry",a().definition,t,{key:void 0,value:void 0});return aP.addElementsTolist(e,a().definition,"entries",[i])},removeElement:function(e,t,n){return aP.removeElementsFromList(e,a().definition,"entries",null,[a().definition.entries[n]])},editable:function(e,t,n,i){var r=a().definition.entries[i];return"key"===n||!OD(r.definition)&&!SD(r.definition)&&!PD(r.definition)},setControlValue:function(e,t,n,i,o,s){var c=a().definition.entries[s];"key"!==i&&(OD(c.definition)||SD(c.definition)||PD(c.definition))?n.value=r[c.definition.$type].label:n.value=o},show:function(e,t){return u()&&a().definition&&OD(a().definition)}})),s};function _D(e,t,n,i){return RE.createElement(e,i,t,n)}function PD(e){return mD(e,"camunda:Script")}function SD(e){return mD(e,"camunda:List")}function OD(e){return mD(e,"camunda:Map")}function CD(e){var t=e.get("definition");return t?PD(t)?t.value:SD(t)?"List":OD(t)?"Map":void 0:e.value}var TD=KS.assign,AD=KS.flatten,RD=KS.filter,kD=KS.findIndex,jD=KS.forEach,MD=GE.classes,DD=GE.event,BD=GE.domify,ID=GE.query,ND=PE.getBusinessObject,LD=KC.findExtension,FD=KC.findInputParameter,VD=nT.createInputParameter,$D=hw.escapeHTML,zD=200,qD={get:function(){},set:function(){}},UD=function(e,t,n,i,r){var o=n.get(t);if(!o)return[];var a=[];function s(e,t){if(e){var n=t.dataset.entry;a.forEach((function(e){var t=e[0];if(t.id!==n){var i=ID('[data-entry="'+t.id+'"]');t.setOpen(!1,i)}}))}}function c(e,n){var o,a=[],c=ND(t),p=LD(c,"camunda:InputOutput");if(!p)return a;var u,l=function(){return FD(p,n.binding)||qD},d=l(),h=function(){return o.isOpen()},m=function(){var e=LD(ND(t),"camunda:InputOutput");return!!FD(e,n.binding)},f=GD(a=wD(d,i,{idPrefix:e+"-",onToggle:s,getParameter:l,isOpen:function(){return h()&&m()}},r).entries,e+"-parameterName"),v=(o=a[GD(a,e+"-collapsible")]).get;return o.get=function(){return TD(v(),{title:n.label?r(n.label):n.binding.name})},u=f,a.splice(u,1),n.description&&a.splice(1,0,function(e,t,n,i){e=$D(e);var r=BD('<p class="description description--expanded" data-show="show"></p>'),o=BD('<span class="description__text">'+e+"</span>");function a(t){t?(MD(r).add("description--expanded"),o.textContent=e+" ",c.textContent=i("Less")):(MD(r).remove("description--expanded"),o.textContent=s+" ... ",c.textContent=i("More"))}r.appendChild(o);var s,c,p=!1;e.length>zD&&(s=e.slice(0,zD),c=BD('<span class="bpp-entry-link description__expand">'+i("More")+"</span>"),DD.bind(c,"click",(function(){a(p=!p)})),r.appendChild(c),a(p));return{id:t+"-description",html:r,show:n}}(n.description,e,o.isOpen,r)),a.splice(n.description?2:1,0,wO.toggleSwitch(r,{id:e+"-assignment-toggle",label:r("Local Variable Assignment"),modelProperty:"isActive",labelOn:r("On"),labelOff:r("Off"),descriptionOff:r("The parameter won't be created as local variable."),isOn:m,get:function(e,t){return{isActive:m()}},set:function(e,t,r){return t.isActive||!1?function(e,t,n){var i=ND(e),r=[],o=i.get("extensionElements");o||(o=RE.createElement("bpmn:ExtensionElements",null,e,n),r.push(aP.updateBusinessObject(e,i,{extensionElements:o})));var a=LD(o,"camunda:InputOutput");a||(a=RE.createElement("camunda:InputOutput",null,i,n),r.push(aP.addElementsTolist(e,o,"values",a)));var s=VD(t,null,n);return r.push(aP.addAndRemoveElementsFromList(e,a,"inputParameters",null,[s],[])),r}(e,n.binding,i):function(e,t){var n=ND(e),i=[],r=n.get("extensionElements");if(!r)return i;var o=LD(r,"camunda:InputOutput");if(!o)return i;var a=FD(o,t);if(!a)return i;return i.push(aP.removeElementsFromList(e,o,"inputParameters",null,[a])),i}(e,n.binding)},hidden:function(e,t){return!h()}})),a}var p=RD(o.properties,(function(e){return!e.type&&"camunda:inputParameter"===e.binding.type}));jD(p,(function(e,t){var n="template-inputs-"+o.id+"-"+t;a.push(c(n,e))})),e.entries=e.entries.concat(AD(a))};function GD(e,t){return kD(e,(function(e){return e.id===t}))}var HD=KS.flatten,WD=KS.filter,KD=KS.forEach,XD=PE.getBusinessObject,YD=KC.findExtension,JD=KC.findOutputParameter,ZD=nT.createOutputParameter,QD=GE.classes,eB=GE.event,tB=GE.domify,nB=GE.query,iB=hw.escapeHTML,rB=200,oB={get:function(){},set:function(){}},aB=function(e,t,n,i,r){var o=n.get(t);if(!o)return[];var a=[];function s(e,t){if(e){var n=t.dataset.entry;a.forEach((function(e){var t=e[0];if(t.id!==n){var i=nB('[data-entry="'+t.id+'"]');t.setOpen(!1,i)}}))}}function c(e,n){var o=[],a=XD(t),c=YD(a,"camunda:InputOutput");if(!c)return o;var p=function(){return JD(c,n.binding)||oB},u=wO.collapsible({id:e+"-collapsible",title:r(n.label),cssClasses:["bpp-collapsible--with-mapping","bpp-collapsible--with-template-out"],onToggle:s,open:!1,get:function(){return{title:r(n.label),description:p().name}}});o.push(u);var l=u.isOpen,d=function(){var e=YD(XD(t),"camunda:InputOutput");return!!JD(e,n.binding)};return n.description&&o.push(function(e,t,n,i){e=iB(e);var r=tB('<p class="description description--expanded" data-show="show"></p>'),o=tB('<span class="description__text">'+e+"</span>");function a(t){t?(QD(r).add("description--expanded"),o.textContent=e+" ",c.textContent=i("Less")):(QD(r).remove("description--expanded"),o.textContent=s+" ... ",c.textContent=i("More"))}r.appendChild(o);var s,c,p=!1;e.length>rB&&(s=e.slice(0,rB),c=tB('<span class="bpp-entry-link description__expand">'+i("More")+"</span>"),eB.bind(c,"click",(function(){a(p=!p)})),r.appendChild(c),a(p));return{id:t+"-description",html:r,show:n}}(n.description,e,l,r)),o.splice(n.description?2:1,0,wO.toggleSwitch(r,{id:e+"-assignment-toggle",label:r("Process Variable Assignment"),modelProperty:"isActive",labelOn:r("On"),labelOff:r("Off"),descriptionOff:r("The parameter won't be available in the process scope."),isOn:d,get:function(e,t){return{isActive:d()}},set:function(e,t,r){return t.isActive||!1?function(e,t,n){var i=XD(e),r=[],o=i.get("extensionElements");o||(o=RE.createElement("bpmn:ExtensionElements",null,e,n),r.push(aP.updateBusinessObject(e,i,{extensionElements:o})));var a=YD(o,"camunda:InputOutput");a||(a=RE.createElement("camunda:InputOutput",null,i,n),r.push(aP.addElementsTolist(e,o,"values",a)));var s=ZD(t,null,n);return r.push(aP.addAndRemoveElementsFromList(e,a,"outputParameters",null,[s],[])),r}(e,n.binding,i):function(e,t){var n=XD(e),i=[],r=n.get("extensionElements");if(!r)return i;var o=YD(r,"camunda:InputOutput");if(!o)return i;var a=JD(o,t);if(!a)return i;return i.push(aP.removeElementsFromList(e,o,"outputParameters",null,[a])),i}(e,n.binding)},hidden:function(e,t){return!l()}})),o.push(wO.validationAwareTextField(r,{id:e+"-variableName",label:r("Assign to Process Variable"),modelProperty:"variableName",getProperty:function(e){return p().name},setProperty:function(e,t){return aP.updateBusinessObject(e,p(),{name:t.variableName})},validate:function(e,t){var n={},i=t.variableName;return i?hw.containsSpace(i)&&(n.variableName=r("Process Variable Name must not contain spaces.")):n.variableName=r("Process Variable Name must not be empty."),n},hidden:function(e,t){return!l()||!d()}})),o}var p=WD(o.properties,(function(e){return!e.type&&"camunda:outputParameter"===e.binding.type}));KD(p,(function(e,t){var n="template-outputs-"+o.id+"-"+t;a.push(c(n,e))})),e.entries=e.entries.concat(HD(a))};var sB=GE.query,cB=function(e,t,n,i,r){var o=(i=i||{}).idPrefix||"",a=i.getError&&"function"==typeof i.getError?function(){return i.getError()}:function(){return e},s={},c=[];s.entries=c;var p=function(){var e=a(),t="No Error referenced";return e.errorRef&&(t=e.errorRef.name,e.errorRef.errorCode&&(t+=" (code = "+e.errorRef.errorCode+")")),t},u=wO.collapsible({id:o+"collapsible",title:p(),description:a().expression||"",cssClasses:["bpp-collapsible-error"],open:!1,onRemove:i.onRemove,onToggle:i.onToggle,get:function(){return{title:p(),description:a().expression||""}}}),l=i.isOpen||u.isOpen;return s.setOpen=function(e){var t=sB('[data-entry="'+u.id+'"]');u.setOpen(e,t)},c.push(u),c.push(wO.validationAwareTextField(r,{id:o+"error-expression",label:r("Throw Expression"),modelProperty:"expression",getProperty:function(t,n){return e.expression},setProperty:function(t,n,i){return aP.updateBusinessObject(t,e,n)},validate:function(e,t,n){var i={};return t.expression||(i.expression=r("Error must have an expression")),i},hidden:function(e,t){return!l()}})),c.push.apply(c,VO(0,e,t,{id:o+"error-reference",label:r("Global Error referenced"),elementName:"error",elementType:"bpmn:Error",referenceProperty:"errorRef",newElementIdPrefix:"Error_",hidden:function(e,t){return!l()}})),c.push.apply(c,$O(0,e,0,r,{id:o+"error-element-name",label:r("Name"),referenceProperty:"errorRef",modelProperty:"name",shouldValidate:!0,hidden:function(e,t){return!l()}})),c.push.apply(c,$O(0,e,0,r,{id:o+"error-element-code",label:r("Code"),referenceProperty:"errorRef",modelProperty:"errorCode",shouldValidate:!0,hidden:function(e,t){return!l()}})),c.push.apply(c,$O(0,e,0,r,{id:o+"error-element-message",label:r("Message"),referenceProperty:"errorRef",modelProperty:"errorMessage",hidden:function(e,t){return!l()}})),s},pB=KS.forEach,uB=KS.filter,lB=KS.flatten,dB=KS.findIndex,hB=PE.getBusinessObject,mB=KC.findExtensions,fB=KC.findCamundaErrorEventDefinition,vB=GE.query,yB={get:function(){},set:function(){},errorRef:{}},gB=function(e,t,n,i,r){var o=n.get(t);if(!o)return[];var a=[];function s(e,t){if(e){var n=t.dataset.entry;a.forEach((function(e){var t=e[0];if(t.id!==n){var i=vB('[data-entry="'+t.id+'"]');t.setOpen(!1,i)}}))}}var c=uB(o.properties,(function(e){return!e.type&&"camunda:errorEventDefinition"===e.binding.type}));pB(c,(function(e,n){var c="template-errors-"+o.id+"-"+n;a.push(function(e,n){var o,a=n.binding.errorRef,c=[],p=hB(t);if(!mB(p,["camunda:ErrorEventDefinition"]))return c;var u=function(){return fB(t,a)||yB},l=u(),d=function(){return o.isOpen()},h=bB(c=cB(l,i,0,{idPrefix:e+"-",onToggle:s,getError:u,isOpen:function(){return d()}},r).entries,e+"-error-reference");o=c[bB(c,e+"-collapsible")];var m=bB(c,e+"-error-expression");xB(c,m);var f=wO.textField(r,{id:e+"-error-expression",label:r("Throw Expression"),modelProperty:"expression",get:function(){return{expression:u().expression}},buttonShow:{method:function(){return!1}},hidden:function(){return!d()},disabled:function(){return!0}});return c.splice(m,0,f),xB(c,h),c}(c,e))})),e.entries=e.entries.concat(lB(a))};function bB(e,t){return dB(e,(function(e){return e.id===t}))}function xB(e,t){e.splice(t,1)}var EB=PE.getBusinessObject,wB=GE.query,_B=function(e,t,n,i){var r=!!(n=n||{}).insideConnector,o=n.idPrefix||"",a={},s=a.entries=[];if(!ZA.isInputOutputSupported(e,r))return a;var c,p,u={insideConnector:r,idPrefix:o};return s.push(function(e,t,n){var i=n.idPrefix||"",r=n.prefix,o=n.type,a=n.prop,s=n.insideConnector,c={id:i+r+"-heading",cssClasses:["bpp-input-output"],html:'<div class="bpp-field-wrapper"><button type="button" class="bpp-input-output__add add action-button" data-action="createElement"></button><input name="hidden" type="hidden"></div>'};function p(){var n=[],i=EB(e),c=i.get("extensionElements");c||(c=RE.createElement("bpmn:ExtensionElements",{values:[]},i,t),n.push(aP.updateBusinessObject(e,i,{extensionElements:c})));var p=SB(e,s);if(!p){var u=s?OB(e):c;p=function(e,t,n){return CB("camunda:InputOutput",e,t,n)}(u,t,{inputParameters:[],outputParameters:[]}),s?n.push(aP.updateBusinessObject(e,u,{inputOutput:p})):n.push(aP.addAndRemoveElementsFromList(e,c,"values","extensionElements",[p],[]))}var l=function(e,t,n,i){return CB(e,t,n,i)}(o,p,t,{name:PB(r)});return n.push(aP.addElementsTolist(e,p,a,[],[l])),n}function u(e,t){c._commands=e,wB('input[type="hidden"]',t).value=1}return c.createElement=function(e,t){var n=p();if(n)return u(n,t),!0},c.set=function(){var e=c._commands;if(e)return delete c._commands,e},c}(e,t,{idPrefix:o,insideConnector:r,type:"camunda:InputParameter",prop:"inputParameters",prefix:"Input"})),c=s,p=function(e,t,n,i){var r=n.idPrefix,o=n.insideConnector,a=SB(e,o),s=function(e,t){return ZA.getInputParameters(e,t)}(e,o);if(!s.length){var c=Q_(i,i("No variables defined."));return[{id:r+"input-parameter-placeholder",cssClasses:["bpp-input-output-placeholder"],html:c}]}var p,u=s.map((function(n,s){function c(){var t=[];if(t.push(aP.removeElementsFromList(e,a,"inputParameters",null,[n])),1===a.get("inputParameters").length&&0===(a.get("outputParameters")||[]).length)if(o){var i=OB(e);t.push(aP.updateBusinessObject(e,i,{inputOutput:void 0}))}else t.push(qA.removeEntry(EB(e),e,a));return t}return wD(n,t,{idPrefix:r+"input-parameter-"+s,onRemove:c,onToggle:l},i)}));function l(e,t){if(e){var n=t.dataset.entry;u.forEach((function(e){e.entries[0].id!==n&&e.setOpen(!1,t.parentElement)}))}}return p=u.map((function(e){return e.entries})),Array.prototype.concat.apply([],p)}(e,t,u,i),Array.prototype.push.apply(c,p),a};function PB(e){return e+="_",hw.nextId(e)}function SB(e,t){return ZA.getInputOutput(e,t)}function OB(e){return ZA.getConnector(e)}function CB(e,t,n,i){return RE.createElement(e,i,t,n)}var TB=PE.getBusinessObject,AB=GE.query,RB=function(e,t,n,i){var r=!!(n=n||{}).insideConnector,o=n.idPrefix||"",a={},s=a.entries=[];if(!ZA.isInputOutputSupported(e,r)||!ZA.areOutputParametersSupported(e,r))return a;var c,p,u={insideConnector:r,idPrefix:o};return s.push(function(e,t,n){var i=n.idPrefix||"",r=n.prefix,o=n.type,a=n.prop,s=n.insideConnector,c={id:i+r+"-heading",cssClasses:["bpp-input-output"],html:'<div class="bpp-field-wrapper"><button type="button" class="bpp-input-output__add add action-button" data-action="createElement"></button><input name="hidden" type="hidden"></div>'};function p(){var n=[],i=TB(e),c=i.get("extensionElements");c||(c=RE.createElement("bpmn:ExtensionElements",{values:[]},i,t),n.push(aP.updateBusinessObject(e,i,{extensionElements:c})));var p=jB(e,s);if(!p){var u=s?MB(e):c;p=function(e,t,n){return DB("camunda:InputOutput",e,t,n)}(u,t,{inputParameters:[],outputParameters:[]}),s?n.push(aP.updateBusinessObject(e,u,{inputOutput:p})):n.push(aP.addAndRemoveElementsFromList(e,c,"values","extensionElements",[p],[]))}var l=function(e,t,n,i){return DB(e,t,n,i)}(o,p,t,{name:kB(r)});return n.push(aP.addElementsTolist(e,p,a,[],[l])),n}function u(e,t){c._commands=e,AB('input[type="hidden"]',t).value=1}return c.createElement=function(e,t){var n=p();if(n)return u(n,t),!0},c.set=function(){var e=c._commands;if(e)return delete c._commands,e},c}(e,t,{idPrefix:o,insideConnector:r,type:"camunda:OutputParameter",prop:"outputParameters",prefix:"Output"})),c=s,p=function(e,t,n,i){var r=n.idPrefix,o=n.insideConnector,a=jB(e,o),s=function(e,t){return ZA.getOutputParameters(e,t)}(e,o);if(!s.length){var c=Q_(i,i("No variables defined."));return[{id:r+"output-parameter-placeholder",cssClasses:["bpp-input-output-placeholder"],html:c}]}var p,u=s.map((function(n,s){function c(){var t=[];if(t.push(aP.removeElementsFromList(e,a,"outputParameters",null,[n])),1===a.get("outputParameters").length&&0===(a.get("inputParameters")||[]).length)if(o){var i=MB(e);t.push(aP.updateBusinessObject(e,i,{inputOutput:void 0}))}else t.push(qA.removeEntry(TB(e),e,a));return t}return wD(n,t,{idPrefix:r+"output-parameter-"+s,onRemove:c,onToggle:l},i)}));function l(e,t){if(e){var n=t.dataset.entry;u.forEach((function(e){e.entries[0].id!==n&&e.setOpen(!1,t.parentElement)}))}}return p=u.map((function(e){return e.entries})),Array.prototype.concat.apply([],p)}(e,t,u,i),Array.prototype.push.apply(c,p),a};function kB(e){return e+="_",hw.nextId(e)}function jB(e,t){return ZA.getInputOutput(e,t)}function MB(e){return ZA.getConnector(e)}function DB(e,t,n,i){return RE.createElement(e,i,t,n)}var BB=PE.getBusinessObject,IB=GE.query,NB=function(e,t,n,i){var r,o,a={},s=a.entries=[];return s.push(function(e,t,n){var i={id:n.prefix+"-heading",cssClasses:["bpp-error"],html:'<div class="bpp-field-wrapper"><button type="button" class="bpp-error__add add action-button" data-action="createElement"></button><input name="hidden" type="hidden"></div>'};function r(){var n=[],i=BB(e),r=i.get("extensionElements");r||(r=RE.createElement("bpmn:ExtensionElements",{values:[]},i,t),n.push(aP.updateBusinessObject(e,i,{extensionElements:r})));var o=RE.createElement("camunda:ErrorEventDefinition",{},r,t);return n.push(aP.addElementsTolist(e,r,"values",[o])),n}function o(e,t){i._commands=e,IB('input[type="hidden"]',t).value=1}return i.createElement=function(e,t){var n=r();if(n)return o(n,t),!0},i.set=function(){var e=i._commands;if(e)return delete i._commands,e},i}(e,t,{type:"camunda:ErrorEventDefinition",prop:"errorEventDefinition",prefix:"Error"})),r=s,o=function(e,t,n,i){var r=n.idPrefix||"",o=BB(e),a=function(e){return qA.getExtensionElements(e,"camunda:ErrorEventDefinition")||[]}(o),s=o.get("extensionElements");if(a&&!a.length){var c=Q_(i,i("No errors defined."));return[{id:r+"error-placeholder",cssClasses:["bpp-error-placeholder"],html:c}]}var p,u=a.map((function(n,o){function a(){var t=[];return t.push(aP.removeElementsFromList(e,s,"values","extensionElements",[n])),t}return cB(n,t,0,{idPrefix:r+"error-"+o,onRemove:a,onToggle:c},i);function c(e,t){if(e){var n=t.dataset.entry;u.forEach((function(e){e.entries[0].id!==n&&e.setOpen(!1,t.parentElement)}))}}}));return p=u.map((function(e){return e.entries})),Array.prototype.concat.apply([],p)}(e,t,{},i),Array.prototype.push.apply(r,o),a};function LB(e){return KA.getServiceTaskLikeBusinessObject(e)}function FB(e){return ZA.getConnector(e)}function VB(e){return"connector"===function(e){return KA.getImplementationType(e)}(e)}var $B=PE.is,zB=PE.getBusinessObject,qB=function(e,t,n,i){var r=zB(t);($B(t,"camunda:JobPriorized")||$B(t,"bpmn:Participant")&&r.get("processRef"))&&(e.entries=e.entries.concat(function(e,t,n,i){var r=n.getBusinessObject;return[wO.textField(i,{id:"jobPriority",label:i("Job Priority"),modelProperty:"jobPriority",get:function(e,t){return{jobPriority:r(e).get("camunda:jobPriority")}},set:function(e,t){var n=r(e);return aP.updateBusinessObject(e,n,{"camunda:jobPriority":t.jobPriority||void 0})}})]}(0,0,{getBusinessObject:function(e){var t=zB(e);return $B(t,"bpmn:Participant")?t.get("processRef"):t}},i))),$B(t,"camunda:AsyncCapable")&&(e.entries=e.entries.concat(tk(0,n,{getBusinessObject:zB},i)))},UB=PE.is,GB=PE.getBusinessObject,HB=function(e,t,n,i){var r=GB(t);(UB(t,"camunda:Process")||UB(t,"bpmn:Participant")&&r.get("processRef"))&&(e.entries=e.entries.concat(function(e,t,n,i){var r=n.getBusinessObject;return[wO.textField(i,{id:"historyTimeToLive",label:i("History Time To Live"),modelProperty:"historyTimeToLive",get:function(e,t){return{historyTimeToLive:r(e).get("camunda:historyTimeToLive")||""}},set:function(e,t){var n=r(e);return aP.updateBusinessObject(e,n,{"camunda:historyTimeToLive":t.historyTimeToLive||void 0})}})]}(0,0,{getBusinessObject:function(e){var t=GB(e);return UB(t,"bpmn:Participant")?t.get("processRef"):t}},i)))},WB=PE.is,KB=PE.getBusinessObject,XB=function(e,t,n,i){var r=KB(t);(WB(t,"camunda:Process")||WB(t,"bpmn:Participant")&&r.get("processRef"))&&(e.entries=e.entries.concat(function(e,t,n,i){var r=n.getBusinessObject;return[wO.textField(i,{id:"candidateStarterGroups",label:i("Candidate Starter Groups"),modelProperty:"candidateStarterGroups",description:i("Specify more than one group as a comma separated list."),get:function(e,t){return{candidateStarterGroups:r(e).get("camunda:candidateStarterGroups")||""}},set:function(e,t){var n=r(e);return aP.updateBusinessObject(e,n,{"camunda:candidateStarterGroups":t.candidateStarterGroups||void 0})}}),wO.textField(i,{id:"candidateStarterUsers",label:i("Candidate Starter Users"),modelProperty:"candidateStarterUsers",description:i("Specify more than one user as a comma separated list."),get:function(e,t){return{candidateStarterUsers:r(e).get("camunda:candidateStarterUsers")||""}},set:function(e,t){var n=r(e);return aP.updateBusinessObject(e,n,{"camunda:candidateStarterUsers":t.candidateStarterUsers||void 0})}})]}(0,0,{getBusinessObject:function(e){var t=KB(e);return WB(t,"bpmn:Participant")?t.get("processRef"):t}},i)))},YB=PE.is,JB=PE.getBusinessObject,ZB=function(e,t,n,i){var r=JB(t);(YB(t,"camunda:Process")||YB(t,"bpmn:Participant")&&r.get("processRef"))&&(e.entries=e.entries.concat(function(e,t,n,i){var r=n.getBusinessObject;return[wO.checkbox(i,{id:"isStartableInTasklist",label:i("Startable"),modelProperty:"isStartableInTasklist",get:function(e,t){return{isStartableInTasklist:r(e).get("camunda:isStartableInTasklist")||""}},set:function(e,t){var n=r(e);return aP.updateBusinessObject(e,n,{"camunda:isStartableInTasklist":!!t.isStartableInTasklist})}})]}(0,0,{getBusinessObject:function(e){var t=JB(e);return YB(t,"bpmn:Participant")?t.get("processRef"):t}},i)))},QB=PE.is,eI=PE.getBusinessObject;var tI=function(e,t,n,i){var r=function(e){var t=KA.getServiceTaskLikeBusinessObject(e);return t||(t=eI(e)),t}(t);r&&(QB(r,"camunda:TaskPriorized")||QB(r,"bpmn:Participant")&&r.get("processRef"))&&(e.entries=e.entries.concat(function(e,t,n,i){var r=n.getBusinessObject;return[wO.textField(i,{id:"externalTaskPriority",label:i("Task Priority"),modelProperty:"taskPriority",get:function(e,t){return{taskPriority:r(e).get("camunda:taskPriority")}},set:function(e,t){var n=r(e);return aP.updateBusinessObject(e,n,{"camunda:taskPriority":t.taskPriority||void 0})}})]}(0,0,{getBusinessObject:function(e){return QB(r,"bpmn:Participant")?r.get("processRef"):r}},i)))},nI=PE.is,iI=KC.getTemplateId,rI=PE.getBusinessObject,oI=KA,aI=function(e){var t=rI(e);if(nI(e,"bpmn:Process")||nI(e,"bpmn:Participant")&&t.get("processRef"))return!0;var n=KA.getServiceTaskLikeBusinessObject(e),i="external"===KA.getImplementationType(n);return!!KA.isExternalCapable(n)&&i},sI=function(e){var t=rI(e);if(nI(e,"bpmn:Process")||nI(e,"bpmn:Participant")&&t.get("processRef"))return!0;var n=rI(e);return!(!UA.isAsyncBefore(n)&&!UA.isAsyncAfter(n))||!!nI(e,"bpmn:Event")&&!!DO.getTimerEventDefinition(e)},cI="This maps to the process definition key.";function pI(e){return nI(e,"bpmn:Participant")?{id:"participant-id",label:"Participant Id"}:nI(e,"bpmn:Process")?{description:cI}:nI(e,"bpmn:UserTask")?{description:"This maps to the task definition key."}:void 0}function uI(e){if(nI(e,"bpmn:Participant"))return{processIdDescription:cI}}function lI(e,t,n,i,r,o,a,s,c){if(!iI(e))return[];var p=fM(e,i,r,o,a,s,c),u=pI(e)||{};u.id="element-template-element-id";mC(p,0,c,u),_C(p,e,t,n,c,{id:"element-template-element-name"}),RO(p,e,c,uI(e));var l={id:"template-inputs",label:c("Input Parameters"),entries:[]};UD(l,e,r,t,c);var d={id:"template-outputs",label:c("Output Parameters"),entries:[]};aB(d,e,r,t,c);var h={id:"template-errors",label:c("Errors"),entries:[]};gB(h,e,r,t,c);var m=oD(e,r,t,c);return[p,l,d,h].concat(m)}function dI(e,t,n,i,r,o){e=e.labelTarget||e;var a={id:"general",label:o("General"),entries:[]};mC(a,0,o,pI(e)),_C(a,e,n,t,o,function(e){if(nI(e,"bpmn:Participant"))return{id:"participant-name",label:"Participant Name"}}(e)),RO(a,e,o,uI(e)),function(e,t,n){var i=cj(t);if(i&&(sj(t,"bpmn:Process")||sj(t,"bpmn:Participant")&&i.get("processRef"))){var r=wO.textField(n,{id:"versionTag",label:n("Version Tag"),modelProperty:"versionTag"});sj(t,"bpmn:Participant")&&(r.get=function(e){return{versionTag:i.get("processRef").get("camunda:versionTag")}},r.set=function(e,t){var n=i.get("processRef");return aP.updateBusinessObject(e,n,{"camunda:versionTag":t.versionTag||void 0})}),e.entries.push(r)}}(a,e,o),OC(a,e,o),function(e,t,n,i){if(WT(SM(t))||gM(SM(t))){var r=PM(t,n,i);if(1!==r.length){var o=r.map((function(e){return wM(e,["name","value"])}));e.entries.push(wO.selectBox(i,{id:"elementTemplate-chooser",label:i("Element Template"),modelProperty:"elementTemplateOption",selectOptions:o,get:function(e){return{elementTemplateOption:OM}},set:function(e,t){var i=t.elementTemplateOption,o=_M(i,r),a=o.id,s=o.version;return function(e,t,n){var i=n.get(e);if(i!==t)return{cmd:"propertiesPanel.camunda.changeTemplate",context:{element:e,oldTemplate:i,newTemplate:t}}}(e,n.get(a,s),n)}}))}}}(a,e,r,o);var s={id:"details",label:o("Details"),entries:[]};TR(s,e,n,o),function(e,t,n){AR(t,"camunda:Assignable")&&(e.entries.push(wO.textField(n,{id:"assignee",label:n("Assignee"),modelProperty:"assignee"})),e.entries.push(wO.textField(n,{id:"candidateUsers",label:n("Candidate Users"),modelProperty:"candidateUsers"})),e.entries.push(wO.textField(n,{id:"candidateGroups",label:n("Candidate Groups"),modelProperty:"candidateGroups"})),e.entries.push(wO.textField(n,{id:"dueDate",description:n("The due date as an EL expression (e.g. ${someDate} or an ISO date (e.g. 2015-06-26T09:54:00)"),label:n("Due Date"),modelProperty:"dueDate"})),e.entries.push(wO.textField(n,{id:"followUpDate",description:n("The follow up date as an EL expression (e.g. ${someDate} or an ISO date (e.g. 2015-06-26T09:54:00)"),label:n("Follow Up Date"),modelProperty:"followUpDate"})),e.entries.push(wO.textField(n,{id:"priority",label:n("Priority"),modelProperty:"priority"})))}(s,e,o),function(e,t,n,i){var r;if(gk(t,"bpmn:ScriptTask")&&(r=yk(t)),r){var o=pk("scriptFormat","script",!1,i);e.entries.push({id:"script-implementation",label:i("Script"),html:o.template,get:function(e){return o.get(e,r)},set:function(e,t,n){var i=o.set(e,t,n);return aP.updateProperties(e,i)},validate:function(e,t){return o.validate(e,t)},script:o,cssClasses:["bpp-textfield"]}),e.entries.push(wO.textField(i,{id:"scriptResultVariable",label:i("Result Variable"),modelProperty:"scriptResultVariable",get:function(e,t){return{scriptResultVariable:r.get("camunda:resultVariable")}},set:function(e,t,n){return aP.updateProperties(e,{"camunda:resultVariable":t.scriptResultVariable.length?t.scriptResultVariable:void 0})}}))}}(s,e,0,o),cC(s,e,o),function(e,t,n,i){FR(t,"camunda:CallActivity")&&(e.entries.push(wO.selectBox(i,{id:"callActivity",label:i("CallActivity Type"),selectOptions:[{name:"BPMN",value:"bpmn"},{name:"CMMN",value:"cmmn"}],emptyParameter:!0,modelProperty:"callActivityType",get:function(e,t){return{callActivityType:VR(e)}},set:function(e,t,n){var i=t.callActivityType,r=EP({},$R);return"bpmn"===i?r.calledElement="":"cmmn"===i&&(r["camunda:caseRef"]=""),aP.updateProperties(e,r)}})),e.entries.push(xR(t,n,{getCallableType:VR},i)),e.entries=i_(e.entries))}(s,e,n,o),oC(s,e,n,i,o),xk(s,e,0,o),fk(s,e,n,o),function(e,t,n){Zk(t)&&Jk(t,"camunda:Initiator")&&!Jk(t.parent,"bpmn:SubProcess")&&e.entries.push(wO.textField(n,{id:"initiator",label:n("Initiator"),modelProperty:"initiator"}))}(s,e,o);var c={id:"multiInstance",label:o("Multi Instance"),entries:[]};ok(c,e,n,o);var p={id:"async",label:o("Asynchronous Continuations"),entries:[]};!function(e,t,n,i){NR(t,"camunda:AsyncCapable")&&(e.entries=e.entries.concat(BR(0,0,{getBusinessObject:IR},i)))}(p,e,0,o);var u={id:"jobConfiguration",label:o("Job Configuration"),entries:[],enabled:sI};qB(u,e,n,o);var l={id:"externalTaskConfiguration",label:o("External Task Configuration"),entries:[],enabled:aI};tI(l,e,0,o);var d={id:"candidateStarterConfiguration",label:o("Candidate Starter Configuration"),entries:[]};XB(d,e,0,o);var h={id:"historyConfiguration",label:o("History Configuration"),entries:[]};HB(h,e,0,o);var m={id:"tasklist",label:o("Tasklist Configuration"),entries:[]};ZB(m,e,0,o);var f={id:"documentation",label:o("Documentation"),entries:[]};dC(f,e,n,o);var v=[];return v.push(a),v.push(s),v.push(l),v.push(c),v.push(p),v.push(u),v.push(d),v.push(h),v.push(m),v.push(f),v}function hI(e,t,n,i){var r={id:"variables",label:i("Variables"),entries:[]};return function(e,t,n,i){var r=[{name:i("Source"),value:"source"},{name:i("Source Expression"),value:"sourceExpression"},{name:i("All"),value:"variables"}],o=DO.getSignalEventDefinition(t);if((Qk(t,"camunda:CallActivity")||o)&&(!o||ej(t,["bpmn:IntermediateThrowEvent","bpmn:EndEvent"]))){var a=function(e,t){return!!s(e,t)},s=function(e,t){var n=t.parentNode,i=l.getSelected(e,n),r=nj(e,rj)[i.idx];return!r&&d&&(i=d.getSelected(e,n),r=nj(e,oj)[i.idx]),r},c=function(e){return function(t,n,i,r,o,a){var s=nj(t,e)[a],c=(s.target||"<undefined>")+" := ",p=ij(s);"variables"===p?c="all":c+="source"===p?s.source||"<empty>":"sourceExpression"===p&&s.sourceExpression||"<empty>",i.text=c}},p=function(e){return function(t,i,r){var o=RE.createElement(e,{source:""},i,n);return aP.addElementsTolist(t,i,"values",[o])}},u=function(e){return function(t,n,i,r){var a=nj(t,e)[r];if(a)return qA.removeEntry(o||tj(t),t,a)}},l=Rk(t,n,{id:"variableMapping-in",label:i("In Mapping"),modelProperty:"source",prefix:"In",idGeneration:!1,resizable:!0,businessObject:o||tj(t),createExtensionElement:p(rj),removeExtensionElement:u(rj),getExtensionElements:function(e){return nj(e,rj)},onSelectionChange:function(e,t,n,i){d&&d.deselect(e,t.parentNode)},setOptionLabelValue:c(rj)});if(e.entries.push(l),!o){var d=Rk(t,n,{id:"variableMapping-out",label:i("Out Mapping"),modelProperty:"source",prefix:"Out",idGeneration:!1,resizable:!0,createExtensionElement:p(oj),removeExtensionElement:u(oj),getExtensionElements:function(e){return nj(e,oj)},onSelectionChange:function(e,t,n,i){l.deselect(e,t.parentNode)},setOptionLabelValue:c(oj)});e.entries.push(d)}e.entries.push(wO.label({id:"variableMapping-typeLabel",get:function(e,t){var n=s(e,t),r="";return Qk(n,rj)?r=i("In Mapping"):Qk(n,oj)&&(r=i("Out Mapping")),{label:r}},showLabel:function(e,t){return a(e,t)}})),e.entries.push(wO.selectBox(i,{id:"variableMapping-inOutType",label:i("Type"),selectOptions:r,modelProperty:"inOutType",get:function(e,t){return{inOutType:ij(s(e,t)||{})}},set:function(e,t,n){var i=t.inOutType,r={source:void 0,sourceExpression:void 0,variables:void 0};"source"===i?r.source="":"sourceExpression"===i?r.sourceExpression="":"variables"===i&&(r.variables="all",r.target=void 0);var o=s(e,n);return aP.updateBusinessObject(e,o,r)},hidden:function(e,t){return!a(e,t)}})),e.entries.push(wO.textField(i,{id:"variableMapping-source",dataValueLabel:"sourceLabel",modelProperty:"source",get:function(e,t){var n=s(e,t)||{},r="",o=ij(n);return"source"===o?r=i("Source"):"sourceExpression"===o&&(r=i("Source Expression")),{source:n[o],sourceLabel:r}},set:function(e,t,n){t.source=t.source||void 0;var i=s(e,n),r={};return r[ij(i)]=t.source||"",aP.updateBusinessObject(e,i,r)},validate:function(e,t,n){var r=s(e,n),o={};if(r){t.source||(o.source=o.source=t.sourceLabel?i("Mapping must have a {value}",{value:t.sourceLabel.toLowerCase()}):i("Mapping must have a value"));var a=ij(r);aj.test(t.source)&&"sourceExpression"!==a&&(o.source=i("{label} must not contain whitespace",{label:t.sourceLabel}))}return o},hidden:function(e,t){var n=s(e,t);return!n||n&&n.variables}})),e.entries.push(wO.textField(i,{id:"variableMapping-target",label:i("Target"),modelProperty:"target",get:function(e,t){return{target:(s(e,t)||{}).target}},set:function(e,t,n){t.target=t.target||void 0;var i=s(e,n);return aP.updateBusinessObject(e,i,t)},validate:function(e,t,n){var r=s(e,n),o={};if(r){var a=ij(r);t.target||"variables"===a||(o.target=i("Mapping must have a target")),t.target&&aj.test(t.target)&&"variables"!==a&&(o.target=i("Target must not contain whitespace"))}return o},hidden:function(e,t){var n=s(e,t);return!n||n&&n.variables}})),e.entries.push(wO.checkbox(i,{id:"variableMapping-local",label:i("Local"),modelProperty:"local",get:function(e,t){return{local:(s(e,t)||{}).local}},set:function(e,t,n){t.local=t.local||!1;var i=s(e,n);return aP.updateBusinessObject(e,i,t)},hidden:function(e,t){return!a(e,t)}}))}}(r,e,t,i),[r]}function mI(e,t){var n={id:"process-variables",label:t("Variables"),entries:[]};return Lj(n,e,t),[n]}function fI(e,t,n,i){var r={id:"forms",label:i("Forms"),entries:[]};return Kk(r,e,t,i),[r]}function vI(e,t,n,i){var r={id:"listeners",label:i("Listeners"),entries:[]},o=Uj(r,e,t,i),a={id:"listener-details",entries:[],enabled:function(e,t){return o.getSelectedListener(e,t)},label:function(e,t){return function(e,t){return nI(e,"camunda:ExecutionListener")?t("Execution Listener"):nI(e,"camunda:TaskListener")?t("Task Listener"):""}(o.getSelectedListener(e,t),i)}};Wj(a,e,t,o,i);var s={id:"listener-fields",label:i("Field Injection"),entries:[],enabled:function(e,t){return o.getSelectedListener(e,t)}};return function(e,t,n,i,r){i=EP({idPrefix:"listener-",insideListener:!0},i);var o=Zj(t,n,r,i);o&&o.length>0&&(e.entries=e.entries.concat(o))}(s,e,t,o,i),[r,a,s]}function yI(e,t,n,i){var r={id:"input-parameters",label:i("Input Parameters"),entries:[]};!function(e,t,n,i,r){if(!i.get(t)){var o=_B(t,n,{},r);e.entries=e.entries.concat(o.entries)}}(r,e,t,n,i);var o={id:"output-parameters",label:i("Output Parameters"),entries:[]};!function(e,t,n,i,r){if(!i.get(t)){var o=RB(t,n,{},r);e.entries=e.entries.concat(o.entries)}}(o,e,t,n,i);var a={id:"errors",label:i("Errors"),entries:[],enabled:function(e,t){var n=rI(e),i="external"===KA.getImplementationType(n);return nI(e,"bpmn:ServiceTask")&&i}};return function(e,t,n,i,r){if(!i.get(t)){var o=NB(t,n,0,r);e.entries=e.entries.concat(o.entries)}}(a,e,t,n,i),[r,o,a]}function gI(e,t,n,i){var r={id:"connector-details",label:i("Details"),entries:[]};!function(e,t,n,i){e.entries.push(wO.textField(i,{id:"connectorId",label:i("Connector Id"),modelProperty:"connectorId",get:function(e,t){var n=LB(e),i=n&&FB(n);return{connectorId:i&&i.get("connectorId")}},set:function(e,t,n){var i=FB(LB(e));return aP.updateBusinessObject(e,i,{connectorId:t.connectorId||void 0})},validate:function(e,t,n){return VB(e)&&!t.connectorId?{connectorId:i("Must provide a value")}:{}},hidden:function(e,t){return!VB(e)}}))}(r,0,0,i);var o={id:"connector-input-parameters",label:i("Input Parameters"),entries:[]};!function(e,t,n,i){var r=_B(t,n,{idPrefix:"connector-",insideConnector:!0},i);e.entries=e.entries.concat(r.entries)}(o,e,t,i);var a={id:"connector-output-parameters",label:i("Output Parameters"),entries:[]};return function(e,t,n,i){var r=RB(t,n,{idPrefix:"connector-",insideConnector:!0},i);e.entries=e.entries.concat(r.entries)}(a,e,t,i),[r,o,a]}function bI(e,t,n,i){var r={id:"field-injections-properties",label:i("Field Injections"),entries:[]};return function(e,t,n,i){var r=KA.getServiceTaskLikeBusinessObject(t);if(r){var o=Zj(t,n,i,{businessObject:r});o&&o.length>0&&(e.entries=e.entries.concat(o))}}(r,e,t,i),[r]}function xI(e,t,n,i){var r={id:"extensionElements-properties",label:i("Properties"),entries:[]};return function(e,t,n,i){var r=Ik(t,n,{id:"properties",modelProperties:["name","value"],labels:[i("Name"),i("Value")],getParent:function(e,t,n){return n.extensionElements},createParent:function(e,t){var i=RE.createElement("bpmn:ExtensionElements",{values:[]},t,n);return{cmd:aP.updateBusinessObject(e,t,{extensionElements:i}),parent:i}}},i);r&&e.entries.push(r)}(r,e,t,i),[r]}function EI(e,t,n,i,r,o,a,s,c,p){K_.call(this,o),this.getTabs=function(o){var u={id:"general",label:p("General"),groups:dI(o,t,e,i,r,p)},l={id:"element-template",label:p("Template"),groups:lI(o,e,t,n,r,a,s,c,p)},d={id:"variables",label:p("Variables"),groups:hI(o,e,0,p)},h={id:"process-variables",label:p("Variables"),groups:mI(o,p)},m={id:"forms",label:p("Forms"),groups:fI(o,e,0,p)},f={id:"listeners",label:p("Listeners"),groups:vI(o,e,0,p),enabled:function(e){return!DO.getLinkEventDefinition(e)||!nI(e,"bpmn:IntermediateThrowEvent")&&DO.getLinkEventDefinition(e)}},v={id:"input-output",label:p("Input/Output"),groups:yI(o,e,r,p)};return[u,l,d,h,{id:"connector",label:p("Connector"),groups:gI(o,e,0,p),enabled:function(e){var t=oI.getServiceTaskLikeBusinessObject(e);return t&&"connector"===oI.getImplementationType(t)}},m,f,v,{id:"field-injections",label:p("Field Injections"),groups:bI(o,e,0,p)},{id:"extensionElements",label:p("Extensions"),groups:xI(o,e,0,p)}]}}EI.$inject=["bpmnFactory","canvas","commandStack","elementRegistry","elementTemplates","eventBus","modeling","replace","selection","translate"],i(EI,K_);var wI=EI,_I={__depends__:[VA,G_.default],__init__:["propertiesProvider"],propertiesProvider:["type",wI]},PI={name:"Camunda",uri:"http://camunda.org/schema/1.0/bpmn",prefix:"camunda",xml:{tagAlias:"lowerCase"},associations:[],types:[{name:"Definitions",isAbstract:!0,extends:["bpmn:Definitions"],properties:[{name:"diagramRelationId",isAttr:!0,type:"String"}]},{name:"InOutBinding",superClass:["Element"],isAbstract:!0,properties:[{name:"source",isAttr:!0,type:"String"},{name:"sourceExpression",isAttr:!0,type:"String"},{name:"target",isAttr:!0,type:"String"},{name:"businessKey",isAttr:!0,type:"String"},{name:"local",isAttr:!0,type:"Boolean",default:!1},{name:"variables",isAttr:!0,type:"String"}]},{name:"In",superClass:["InOutBinding"],meta:{allowedIn:["bpmn:CallActivity","bpmn:SignalEventDefinition"]}},{name:"Out",superClass:["InOutBinding"],meta:{allowedIn:["bpmn:CallActivity"]}},{name:"AsyncCapable",isAbstract:!0,extends:["bpmn:Activity","bpmn:Gateway","bpmn:Event"],properties:[{name:"async",isAttr:!0,type:"Boolean",default:!1},{name:"asyncBefore",isAttr:!0,type:"Boolean",default:!1},{name:"asyncAfter",isAttr:!0,type:"Boolean",default:!1},{name:"exclusive",isAttr:!0,type:"Boolean",default:!0}]},{name:"JobPriorized",isAbstract:!0,extends:["bpmn:Process","camunda:AsyncCapable"],properties:[{name:"jobPriority",isAttr:!0,type:"String"}]},{name:"SignalEventDefinitionExtension",isAbstract:!0,extends:["bpmn:SignalEventDefinition"],properties:[{name:"async",isAttr:!0,type:"Boolean",default:!1}]},{name:"ErrorEventDefinitionExtension",isAbstract:!0,extends:["bpmn:ErrorEventDefinition"],properties:[{name:"errorCodeVariable",isAttr:!0,type:"String"},{name:"errorMessageVariable",isAttr:!0,type:"String"}]},{name:"ErrorEventDefinition",superClass:["bpmn:ErrorEventDefinition","Element"],properties:[{name:"expression",isAttr:!0,type:"String"}],meta:{allowedIn:["bpmn:ServiceTask"]}},{name:"Error",isAbstract:!0,extends:["bpmn:Error"],properties:[{name:"camunda:errorMessage",isAttr:!0,type:"String"}]},{name:"PotentialStarter",superClass:["Element"],properties:[{name:"resourceAssignmentExpression",type:"bpmn:ResourceAssignmentExpression"}]},{name:"FormSupported",isAbstract:!0,extends:["bpmn:StartEvent","bpmn:UserTask"],properties:[{name:"formHandlerClass",isAttr:!0,type:"String"},{name:"formKey",isAttr:!0,type:"String"},{name:"formRef",isAttr:!0,type:"String"},{name:"formRefBinding",isAttr:!0,type:"String"},{name:"formRefVersion",isAttr:!0,type:"String"}]},{name:"TemplateSupported",isAbstract:!0,extends:["bpmn:Collaboration","bpmn:Process","bpmn:FlowElement"],properties:[{name:"modelerTemplate",isAttr:!0,type:"String"},{name:"modelerTemplateVersion",isAttr:!0,type:"Integer"}]},{name:"Initiator",isAbstract:!0,extends:["bpmn:StartEvent"],properties:[{name:"initiator",isAttr:!0,type:"String"}]},{name:"ScriptTask",isAbstract:!0,extends:["bpmn:ScriptTask"],properties:[{name:"resultVariable",isAttr:!0,type:"String"},{name:"resource",isAttr:!0,type:"String"}]},{name:"Process",isAbstract:!0,extends:["bpmn:Process"],properties:[{name:"candidateStarterGroups",isAttr:!0,type:"String"},{name:"candidateStarterUsers",isAttr:!0,type:"String"},{name:"versionTag",isAttr:!0,type:"String"},{name:"historyTimeToLive",isAttr:!0,type:"String"},{name:"isStartableInTasklist",isAttr:!0,type:"Boolean",default:!0}]},{name:"EscalationEventDefinitionExtension",isAbstract:!0,extends:["bpmn:EscalationEventDefinition"],properties:[{name:"escalationCodeVariable",isAttr:!0,type:"String"}]},{name:"FormalExpression",isAbstract:!0,extends:["bpmn:FormalExpression"],properties:[{name:"resource",isAttr:!0,type:"String"}]},{name:"Assignable",extends:["bpmn:UserTask"],properties:[{name:"assignee",isAttr:!0,type:"String"},{name:"candidateUsers",isAttr:!0,type:"String"},{name:"candidateGroups",isAttr:!0,type:"String"},{name:"dueDate",isAttr:!0,type:"String"},{name:"followUpDate",isAttr:!0,type:"String"},{name:"priority",isAttr:!0,type:"String"}]},{name:"CallActivity",extends:["bpmn:CallActivity"],properties:[{name:"calledElementBinding",isAttr:!0,type:"String",default:"latest"},{name:"calledElementVersion",isAttr:!0,type:"String"},{name:"calledElementVersionTag",isAttr:!0,type:"String"},{name:"calledElementTenantId",isAttr:!0,type:"String"},{name:"caseRef",isAttr:!0,type:"String"},{name:"caseBinding",isAttr:!0,type:"String",default:"latest"},{name:"caseVersion",isAttr:!0,type:"String"},{name:"caseTenantId",isAttr:!0,type:"String"},{name:"variableMappingClass",isAttr:!0,type:"String"},{name:"variableMappingDelegateExpression",isAttr:!0,type:"String"}]},{name:"ServiceTaskLike",extends:["bpmn:ServiceTask","bpmn:BusinessRuleTask","bpmn:SendTask","bpmn:MessageEventDefinition"],properties:[{name:"expression",isAttr:!0,type:"String"},{name:"class",isAttr:!0,type:"String"},{name:"delegateExpression",isAttr:!0,type:"String"},{name:"resultVariable",isAttr:!0,type:"String"}]},{name:"DmnCapable",extends:["bpmn:BusinessRuleTask"],properties:[{name:"decisionRef",isAttr:!0,type:"String"},{name:"decisionRefBinding",isAttr:!0,type:"String",default:"latest"},{name:"decisionRefVersion",isAttr:!0,type:"String"},{name:"mapDecisionResult",isAttr:!0,type:"String",default:"resultList"},{name:"decisionRefTenantId",isAttr:!0,type:"String"}]},{name:"ExternalCapable",extends:["camunda:ServiceTaskLike"],properties:[{name:"type",isAttr:!0,type:"String"},{name:"topic",isAttr:!0,type:"String"}]},{name:"TaskPriorized",extends:["bpmn:Process","camunda:ExternalCapable"],properties:[{name:"taskPriority",isAttr:!0,type:"String"}]},{name:"Properties",superClass:["Element"],meta:{allowedIn:["*"]},properties:[{name:"values",type:"Property",isMany:!0}]},{name:"Property",superClass:["Element"],properties:[{name:"id",type:"String",isAttr:!0},{name:"name",type:"String",isAttr:!0},{name:"value",type:"String",isAttr:!0}]},{name:"Connector",superClass:["Element"],meta:{allowedIn:["camunda:ServiceTaskLike"]},properties:[{name:"inputOutput",type:"InputOutput"},{name:"connectorId",type:"String"}]},{name:"InputOutput",superClass:["Element"],meta:{allowedIn:["bpmn:FlowNode","camunda:Connector"]},properties:[{name:"inputOutput",type:"InputOutput"},{name:"connectorId",type:"String"},{name:"inputParameters",isMany:!0,type:"InputParameter"},{name:"outputParameters",isMany:!0,type:"OutputParameter"}]},{name:"InputOutputParameter",properties:[{name:"name",isAttr:!0,type:"String"},{name:"value",isBody:!0,type:"String"},{name:"definition",type:"InputOutputParameterDefinition"}]},{name:"InputOutputParameterDefinition",isAbstract:!0},{name:"List",superClass:["InputOutputParameterDefinition"],properties:[{name:"items",isMany:!0,type:"InputOutputParameterDefinition"}]},{name:"Map",superClass:["InputOutputParameterDefinition"],properties:[{name:"entries",isMany:!0,type:"Entry"}]},{name:"Entry",properties:[{name:"key",isAttr:!0,type:"String"},{name:"value",isBody:!0,type:"String"},{name:"definition",type:"InputOutputParameterDefinition"}]},{name:"Value",superClass:["InputOutputParameterDefinition"],properties:[{name:"id",isAttr:!0,type:"String"},{name:"name",isAttr:!0,type:"String"},{name:"value",isBody:!0,type:"String"}]},{name:"Script",superClass:["InputOutputParameterDefinition"],properties:[{name:"scriptFormat",isAttr:!0,type:"String"},{name:"resource",isAttr:!0,type:"String"},{name:"value",isBody:!0,type:"String"}]},{name:"Field",superClass:["Element"],meta:{allowedIn:["camunda:ServiceTaskLike","camunda:ExecutionListener","camunda:TaskListener"]},properties:[{name:"name",isAttr:!0,type:"String"},{name:"expression",type:"String"},{name:"stringValue",isAttr:!0,type:"String"},{name:"string",type:"String"}]},{name:"InputParameter",superClass:["InputOutputParameter"]},{name:"OutputParameter",superClass:["InputOutputParameter"]},{name:"Collectable",isAbstract:!0,extends:["bpmn:MultiInstanceLoopCharacteristics"],superClass:["camunda:AsyncCapable"],properties:[{name:"collection",isAttr:!0,type:"String"},{name:"elementVariable",isAttr:!0,type:"String"}]},{name:"FailedJobRetryTimeCycle",superClass:["Element"],meta:{allowedIn:["camunda:AsyncCapable","bpmn:MultiInstanceLoopCharacteristics"]},properties:[{name:"body",isBody:!0,type:"String"}]},{name:"ExecutionListener",superClass:["Element"],meta:{allowedIn:["bpmn:Task","bpmn:ServiceTask","bpmn:UserTask","bpmn:BusinessRuleTask","bpmn:ScriptTask","bpmn:ReceiveTask","bpmn:ManualTask","bpmn:ExclusiveGateway","bpmn:SequenceFlow","bpmn:ParallelGateway","bpmn:InclusiveGateway","bpmn:EventBasedGateway","bpmn:StartEvent","bpmn:IntermediateCatchEvent","bpmn:IntermediateThrowEvent","bpmn:EndEvent","bpmn:BoundaryEvent","bpmn:CallActivity","bpmn:SubProcess","bpmn:Process"]},properties:[{name:"expression",isAttr:!0,type:"String"},{name:"class",isAttr:!0,type:"String"},{name:"delegateExpression",isAttr:!0,type:"String"},{name:"event",isAttr:!0,type:"String"},{name:"script",type:"Script"},{name:"fields",type:"Field",isMany:!0}]},{name:"TaskListener",superClass:["Element"],meta:{allowedIn:["bpmn:UserTask"]},properties:[{name:"expression",isAttr:!0,type:"String"},{name:"class",isAttr:!0,type:"String"},{name:"delegateExpression",isAttr:!0,type:"String"},{name:"event",isAttr:!0,type:"String"},{name:"script",type:"Script"},{name:"fields",type:"Field",isMany:!0},{name:"id",type:"String",isAttr:!0},{name:"eventDefinitions",type:"bpmn:TimerEventDefinition",isMany:!0}]},{name:"FormProperty",superClass:["Element"],meta:{allowedIn:["bpmn:StartEvent","bpmn:UserTask"]},properties:[{name:"id",type:"String",isAttr:!0},{name:"name",type:"String",isAttr:!0},{name:"type",type:"String",isAttr:!0},{name:"required",type:"String",isAttr:!0},{name:"readable",type:"String",isAttr:!0},{name:"writable",type:"String",isAttr:!0},{name:"variable",type:"String",isAttr:!0},{name:"expression",type:"String",isAttr:!0},{name:"datePattern",type:"String",isAttr:!0},{name:"default",type:"String",isAttr:!0},{name:"values",type:"Value",isMany:!0}]},{name:"FormData",superClass:["Element"],meta:{allowedIn:["bpmn:StartEvent","bpmn:UserTask"]},properties:[{name:"fields",type:"FormField",isMany:!0},{name:"businessKey",type:"String",isAttr:!0}]},{name:"FormField",superClass:["Element"],properties:[{name:"id",type:"String",isAttr:!0},{name:"label",type:"String",isAttr:!0},{name:"type",type:"String",isAttr:!0},{name:"datePattern",type:"String",isAttr:!0},{name:"defaultValue",type:"String",isAttr:!0},{name:"properties",type:"Properties"},{name:"validation",type:"Validation"},{name:"values",type:"Value",isMany:!0}]},{name:"Validation",superClass:["Element"],properties:[{name:"constraints",type:"Constraint",isMany:!0}]},{name:"Constraint",superClass:["Element"],properties:[{name:"name",type:"String",isAttr:!0},{name:"config",type:"String",isAttr:!0}]},{name:"ConditionalEventDefinitionExtension",isAbstract:!0,extends:["bpmn:ConditionalEventDefinition"],properties:[{name:"variableName",isAttr:!0,type:"String"},{name:"variableEvents",isAttr:!0,type:"String"}]}],emumerations:[]},SI=KS.isFunction,OI=KS.isObject,CI=KS.some;function TI(e){var t=this;e.on("moddleCopy.canCopyProperty",(function(e){var n=e.property,i=e.parent;return t.canCopyProperty(n,i)}))}TI.$inject=["eventBus"],TI.prototype.canCopyProperty=function(e,t){return!(OI(e)&&!function(e,t){var n=e.$type&&e.$model.getTypeDescriptor(e.$type),i=n&&n.meta&&n.meta.allowedIn;if(!i||function(e){return-1!==e.indexOf("*")}(i))return!0;return CI(i,(function(e){return jI(t,e)}))}(e,t))&&(!(RI(e,"camunda:InputOutput")&&!this.canHostInputOutput(t))&&(!(kI(e,["camunda:Connector","camunda:Field"])&&!this.canHostConnector(t))&&(!(RI(e,"camunda:In")&&!this.canHostIn(t))&&void 0)))},TI.prototype.canHostInputOutput=function(e){if(jI(e,"camunda:Connector"))return!0;var t=jI(e,"bpmn:FlowNode");return!!t&&(!kI(t,["bpmn:StartEvent","bpmn:Gateway","bpmn:BoundaryEvent"])&&(!RI(t,"bpmn:SubProcess")||!t.get("triggeredByEvent")))},TI.prototype.canHostConnector=function(e){return!RI(jI(e,"camunda:ServiceTaskLike"),"bpmn:MessageEventDefinition")||(jI(e,"bpmn:IntermediateThrowEvent")||jI(e,"bpmn:EndEvent"))},TI.prototype.canHostIn=function(e){return!!jI(e,"bpmn:CallActivity")||(!jI(e,"bpmn:SignalEventDefinition")||(jI(e,"bpmn:IntermediateThrowEvent")||jI(e,"bpmn:EndEvent")))};var AI=TI;function RI(e,t){return e&&SI(e.$instanceOf)&&e.$instanceOf(t)}function kI(e,t){return CI(t,(function(t){return RI(e,t)}))}function jI(e,t){return t?RI(e,t)?e:e.$parent?jI(e.$parent,t):void 0:e.$parent}var MI=t(ss),DI=KS.find,BI=KS.matchPattern,II=MI.default,NI=fC.add,LI=fC.remove,FI=PE.getBusinessObject,VI=PE.is;function $I(e,t,n,i,r){function o(t){var n=e.getDefinitions().get("rootElements");return!!DI(n,BI({id:t.id}))}n.invoke(II,this),this.executed("shape.create",(function(t){var n=t.shape,i=FI(n);if(GI(i)){var r=HI(i,qI(n)),a=e.getDefinitions().get("rootElements");t.addedRootElements=[],r.forEach((function(e){var n=e.referencedElement;n&&!o(n)&&(NI(a,n),t.addedRootElements.push(n))}))}}),!0),this.reverted("shape.create",(function(t){var n=t.addedRootElements;if(n){var i=e.getDefinitions().get("rootElements");n.forEach((function(e){LI(i,e)}))}}),!0),t.on("copyPaste.copyElement",(function(e){var t=e.descriptor,n=e.element,i=FI(n);if(GI(i)){var r=HI(i,qI(n));r&&(t.referencedRootElements=r)}})),t.on("copyPaste.pasteElement",500,(function(e){var t=e.descriptor,n=t.businessObject;if(GI(n)){var a=t.referencedRootElements;a&&a.length&&a.forEach((function(e){var t=e.referencedElement,a=e.idx;t&&(o(t)||(t=i.copyElement(t,r.create(t.$type))),function(e,t,n){var i=e.get("extensionElements").values[n];i.set(UI(i),t)}(n,t,a))})),delete t.referencedRootElements}}))}$I.$inject=["bpmnjs","eventBus","injector","moddleCopy","bpmnFactory"],i($I,II);var zI=$I;function qI(e){if(VI(e,"bpmn:ServiceTask"))return"camunda:ErrorEventDefinition"}function UI(e){if(VI(e,"camunda:ErrorEventDefinition"))return"errorRef"}function GI(e){return VI(e,"bpmn:ServiceTask")&&"external"===e.type}function HI(e,t){var n,i=e.get("extensionElements"),r=[];return i&&(r=i.values.filter((function(e){return VI(e,t)}))),r.reduce((function(t,i){return(n=i[UI(i)])&&t.push({idx:WI(e,i),referencedElement:n}),t}),[])}function WI(e,t){var n=e.get("extensionElements");return n?n.values.indexOf(t):-1}var KI=MI.default,XI=PE.is,YI=PE.getBusinessObject;function JI(e,t){t.invoke(KI,this),this.postExecuted(["shape.create","shape.move"],(function(t){var n=t.shape,i=t.newParent||t.parent,r=YI(n);XI(n,"bpmn:StartEvent")&&void 0!==r.get("camunda:initiator")&&XI(i,"bpmn:SubProcess")&&e.updateProperties(n,{"camunda:initiator":void 0})}),!0)}JI.$inject=["modeling","injector"],i(JI,KI);var ZI=JI,QI=MI.default,eN=PE.is,tN=PE.getBusinessObject;function nN(e,t,n,i){t.invoke(QI,this),this.postExecuted(["shape.move","shape.create"],(function(t){var r,o,a=t.newParent||t.parent,s=tN(a),c=t.shape,p=tN(c),u=!1;eN(c,"bpmn:StartEvent")&&(eN(a,"bpmn:SubProcess")&&s.get("triggeredByEvent")||(r=p.get("eventDefinitions"),(o=r.slice()).forEach((function(e,t){if(eN(e,"bpmn:ConditionalEventDefinition")&&e.get("camunda:variableEvents")){u=!0;var r=n.create("bpmn:ConditionalEventDefinition");i.copyElement(e,r),r.$parent=e.$parent,r.variableEvents=void 0,o[t]=r}})),u&&e.updateProperties(c,{eventDefinitions:o})))}),!0)}nN.$inject=["modeling","injector","bpmnFactory","moddleCopy"],i(nN,QI);var iN={__init__:["camundaCopyPasteBehavior","camundaCopyPasteRootElementBehavior","camundaRemoveInitiatorBehaviour","camundaRemoveVariableEventBehaviour"],camundaCopyPasteBehavior:["type",AI],camundaCopyPasteRootElementBehavior:["type",zI],camundaRemoveInitiatorBehaviour:["type",ZI],camundaRemoveVariableEventBehaviour:["type",nN]};function rN(e={}){e={...e,moddleExtensions:{camunda:PI,...e.moddleExtensions}},kC.call(this,e)}return i(rN,kC),rN.prototype._camundaPlatformModules=[iN,FC,_I],rN.prototype._modules=[].concat(kC.prototype._modules,rN.prototype._camundaPlatformModules),rN}));
|
|
8
|
+
/*! https://mths.be/cssescape v1.5.1 by @mathias | MIT license */(t,n,i),a=Ne("rect");Pe(a,{x:-7,y:-1.5,width:14,height:3}),Ae(a).add("djs-visual"),Ee(r,a);var s=Ne("rect");return Pe(s,{x:-o/2,y:-7,width:o,height:14}),Ae(s).add("djs-hit"),Ee(r,s),Jn(r,"v"===i?90:0),r}function Ds(e,t,n){var i=Ne("g"),r=At(t,n),o=Ct(t,n);return Ee(e,i),Ms(i,t,n,o),Ae(i).add(Rs),Ae(i).add("h"===o?"horizontal":"vertical"),Yn(i,r.x,r.y),i}function Bs(e){return Math.abs(Math.round(2*e/3))}var Is=n((function(t,n){!function(e,n){t.exports=function(e){if(e.CSS&&e.CSS.escape)return e.CSS.escape;var t=function(e){if(0==arguments.length)throw new TypeError("`CSS.escape` requires an argument.");for(var t,n=String(e),i=n.length,r=-1,o="",a=n.charCodeAt(0);++r<i;)0!=(t=n.charCodeAt(r))?o+=t>=1&&t<=31||127==t||0==r&&t>=48&&t<=57||1==r&&t>=48&&t<=57&&45==a?"\\"+t.toString(16)+" ":(0!=r||1!=i||45!=t)&&(t>=128||45==t||95==t||t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122)?n.charAt(r):"\\"+n.charAt(r):o+="�";return o};e.CSS||(e.CSS={});return e.CSS.escape=t,t}(e)}(e)})),Ns={"&":"&","<":"<",">":">",'"':""","'":"'"};function Ls(e){return(e=""+e)&&e.replace(/[&<>"']/g,(function(e){return Ns[e]}))}function Fs(e,t,n,i,r){function o(e,n){var o=n.waypoints,a=ks(t,o,e);if(a)return!function(e,t,n){var i,r,o,a,s,c,p=e.index,u=e.point;return!(p<=0||e.bendpoint)&&(o=At(i=t[p-1],r=t[p]),a=Ct(i,r),s=Math.abs(u.x-o.x),c=Math.abs(u.y-o.y),a&&s<=n&&c<=n)}(a,o,function(e,t){var n,i,r=e.waypoints;return t.index<=0||t.bendpoint?null:(i=Ct((n={start:r[t.index-1],end:r[t.index]}).start,n.end))?Bs("h"===i?n.end.x-n.start.x:n.end.y-n.start.y)/2:null}(n,a))?i.start(e,n,a.index,!a.bendpoint):r.start(e,n,a.index),!0}function a(e,t,i){pe.bind(e,t,(function(e){n.triggerMouseEvent(t,e,i),e.stopPropagation()}))}function s(e,n){var i=t.getLayer("overlays"),r=ve('.djs-bendpoints[data-element-id="'+Is(e.id)+'"]',i);return!r&&n&&(Pe(r=Ne("g"),{"data-element-id":e.id}),Ae(r).add("djs-bendpoints"),Ee(i,r),a(r,"mousedown",e),a(r,"click",e),a(r,"dblclick",e)),r}function c(e,t){return ve('.djs-segment-dragger[data-segment-idx="'+e+'"]',t)}function p(e,t){t.waypoints.forEach((function(t,n){var i=js(e);Ee(e,i),Yn(i,t.x,t.y)})),js(e,"floating")}function u(e,t){for(var n,i,r,o=t.waypoints,s=1;s<o.length;s++)Ct(n=o[s-1],i=o[s])&&(Pe(r=Ds(e,n,i),{"data-segment-idx":s}),a(r,"mousemove",t))}function l(e){var t=s(e);return t||(p(t=s(e,!0),e),u(t,e)),t}function d(e){var t=s(e);t&&(!function(e){_(ye(".djs-segment-dragger",e),(function(e){ke(e)}))}(t),function(e){_(ye(".djs-bendpoint",e),(function(e){ke(e)}))}(t),u(t,e),p(t,e))}function h(e,t,n){var i,r,o=c(t.index,e),a=n[t.index-1],s=n[t.index],p=t.point,u=At(a,s),l=Ct(a,s);o&&(i=function(e){return ve(".djs-visual",e)}(o),r={x:p.x-u.x,y:p.y-u.y},"v"===l&&(r={x:r.y,y:r.x}),Yn(i,r.x,r.y))}e.on("connection.changed",(function(e){d(e.element)})),e.on("connection.remove",(function(e){var t=s(e.element);t&&ke(t)})),e.on("element.marker.update",(function(e){var t,n=e.element;n.waypoints&&(t=l(n),e.add?Ae(t).add(e.marker):Ae(t).remove(e.marker))})),e.on("element.mousemove",(function(e){var n,i,r=e.element,o=r.waypoints;if(o){if(n=s(r,!0),!(i=ks(t,o,e.originalEvent)))return;!function(e,t){var n=ve(".floating",e),i=t.point;n&&Yn(n,i.x,i.y)}(n,i),i.bendpoint||h(n,i,o)}})),e.on("element.mousedown",(function(e){if(ko(e)){var t=e.originalEvent,n=e.element;if(n.waypoints)return o(t,n)}})),e.on("selection.changed",(function(e){var t=e.newSelection[0];t&&t.waypoints&&l(t)})),e.on("element.hover",(function(e){var t=e.element;t.waypoints&&(l(t),n.registerEvent(e.gfx,"mousemove","element.mousemove"))})),e.on("element.out",(function(e){n.unregisterEvent(e.gfx,"mousemove","element.mousemove")})),e.on("element.updateId",(function(e){var t=e.element,n=e.newId;if(t.waypoints){var i=s(t);i&&Pe(i,{"data-element-id":n})}})),this.addHandles=l,this.updateHandles=d,this.getBendpointsContainer=s,this.getSegmentDragger=c}Fs.$inject=["eventBus","canvas","interactionEvents","bendpointMove","connectionSegmentMove"];var Vs=Math.round,$s="reconnectStart",zs="reconnectEnd",qs="updateWaypoints";function Us(e,t,n,i,r,o){this._injector=e,this.start=function(e,t,o,a){var s,c=n.getGraphics(t),p=t.source,u=t.target,l=t.waypoints,d=(s=a||0!==o?a||o!==l.length-1?qs:zs:$s)===qs?"connection.updateWaypoints":"connection.reconnect",h=r.allowed(d,{connection:t,source:p,target:u});!1===h&&(h=r.allowed(d,{connection:t,source:u,target:p})),!1!==h&&i.init(e,"bendpoint.move",{data:{connection:t,connectionGfx:c,context:{allowed:h,bendpointIndex:o,connection:t,source:p,target:u,insert:a,type:s}}})},t.on("bendpoint.move.hover",(function(e){var t,n=e.context,i=n.connection,o=i.source,a=i.target,s=e.hover,c=n.type;if(n.hover=s,s){var p=c===qs?"connection.updateWaypoints":"connection.reconnect";if(t=n.allowed=r.allowed(p,{connection:i,source:c===$s?s:o,target:c===zs?s:a}))return n.source=c===$s?s:o,void(n.target=c===zs?s:a);!1===t&&(t=n.allowed=r.allowed(p,{connection:i,source:c===zs?s:a,target:c===$s?s:o})),t&&(n.source=c===zs?s:a,n.target=c===$s?s:o)}})),t.on(["bendpoint.move.out","bendpoint.move.cleanup"],(function(e){var t=e.context,n=t.type;t.hover=null,t.source=null,t.target=null,n!==qs&&(t.allowed=!1)})),t.on("bendpoint.move.end",(function(e){var t=e.context,n=t.allowed,i=t.bendpointIndex,r=t.connection,a=t.insert,s=r.waypoints.slice(),c=t.source,p=t.target,u=t.type,l=t.hints||{},d={x:Vs(e.x),y:Vs(e.y)};if(!n)return!1;u===qs?(a?s.splice(i,0,d):s[i]=d,l.bendpointMove={insert:a,bendpointIndex:i},s=this.cropWaypoints(r,s),o.updateWaypoints(r,function(e){e=e.slice();for(var t,n,i,r=0;e[r];)t=e[r],n=e[r-1],0===St(t,i=e[r+1])||Ot(n,i,t)?e.splice(r,1):r++;return e}(s),l)):(u===$s?(l.docking="source",Gs(t)&&(l.docking="target",l.newWaypoints=s.reverse())):u===zs&&(l.docking="target",Gs(t)&&(l.docking="source",l.newWaypoints=s.reverse())),o.reconnect(r,c,p,d,l))}),this)}function Gs(e){var t=e.hover,n=e.source,i=e.target,r=e.type;return r===$s?t&&i&&t===i&&n!==i:r===zs?t&&n&&t===n&&n!==i:void 0}Us.$inject=["injector","eventBus","canvas","dragging","rules","modeling"],Us.prototype.cropWaypoints=function(e,t){var n=this._injector.get("connectionDocking",!1);if(!n)return t;var i=e.waypoints;return e.waypoints=t,e.waypoints=n.getCroppedWaypoints(e),t=e.waypoints,e.waypoints=i,t};var Hs="updateWaypoints",Ws="connect-ok",Ks="connect-not-ok",Xs="connect-hover",Ys="djs-updating",Js="djs-element-hidden";function Zs(e,t,n,i){this._injector=t;var r=t.get("connectionPreview",!1);n.on("bendpoint.move.start",(function(e){var t=e.context,n=t.bendpointIndex,r=t.connection,o=t.insert,a=r.waypoints,s=a.slice();t.waypoints=a,o&&s.splice(n,0,{x:e.x,y:e.y}),r.waypoints=s,Ae(t.draggerGfx=js(i.getLayer("overlays"))).add("djs-dragging"),i.addMarker(r,Js),i.addMarker(r,Ys)})),n.on("bendpoint.move.hover",(function(e){var t=e.context,n=t.allowed,r=t.hover,o=t.type;if(r){if(i.addMarker(r,Xs),o===Hs)return;n?(i.removeMarker(r,Ks),i.addMarker(r,Ws)):!1===n&&(i.removeMarker(r,Ws),i.addMarker(r,Ks))}})),n.on(["bendpoint.move.out","bendpoint.move.cleanup"],1100,(function(e){var t=e.context,n=t.hover,r=t.target;n&&(i.removeMarker(n,Xs),i.removeMarker(n,r?Ws:Ks))})),n.on("bendpoint.move.move",(function(t){var n=t.context,i=n.allowed,o=n.bendpointIndex,a=n.draggerGfx,s=n.hover,c=n.type,p=n.connection,u=p.source,l=p.target,d=p.waypoints.slice(),h={x:t.x,y:t.y},m=n.hints||{},f={};r&&(m.connectionStart&&(f.connectionStart=m.connectionStart),m.connectionEnd&&(f.connectionEnd=m.connectionEnd),"reconnectStart"===c?Gs(n)?(f.connectionEnd=f.connectionEnd||h,f.source=l,f.target=s||u,d=d.reverse()):(f.connectionStart=f.connectionStart||h,f.source=s||u,f.target=l):"reconnectEnd"===c?Gs(n)?(f.connectionStart=f.connectionStart||h,f.source=s||l,f.target=u,d=d.reverse()):(f.connectionEnd=f.connectionEnd||h,f.source=u,f.target=s||l):(f.noCropping=!0,f.noLayout=!0,d[o]=h),c===Hs&&(d=e.cropWaypoints(p,d)),f.waypoints=d,r.drawPreview(n,i,f)),Yn(a,t.x,t.y)}),this),n.on(["bendpoint.move.end","bendpoint.move.cancel"],1100,(function(e){var t=e.context,n=t.connection,o=t.draggerGfx,a=t.hover,s=t.target,c=t.waypoints;n.waypoints=c,ke(o),i.removeMarker(n,Ys),i.removeMarker(n,Js),a&&(i.removeMarker(a,Ws),i.removeMarker(a,s?Ws:Ks)),r&&r.cleanUp(t)}))}Zs.$inject=["bendpointMove","injector","eventBus","canvas"];var Qs="connect-hover",ec="djs-updating";function tc(e,t,n){return nc(e,t,e[t]+n)}function nc(e,t,n){return{x:"x"===t?n:e.x,y:"y"===t?n:e.y}}function ic(e){return"x"===e?"y":"x"}function rc(e,t,n){var i,r;return e.original?e.original:(i=fn(t),nc(e,r=ic(n),i[r]))}function oc(e,t,n,i,r,o){var a=e.get("connectionDocking",!1);function s(e,t){if(!a)return t;var n,i=e.waypoints;return e.waypoints=t,n=a.getCroppedWaypoints(e),e.waypoints=i,n}function c(e){r.update("connection",e.connection,e.connectionGfx)}function p(e,t,n){var i=e.newWaypoints,r=function(e,t,n,i){var r=Math.max(t[i],n[i]),o=Math.min(t[i],n[i]);return nc(t,i,Math.min(Math.max(o+20,e[i]),r-20))}(n,i[e.segmentStartIndex+t],i[e.segmentEndIndex+t],ic(e.axis));Yn(e.draggerGfx,r.x,r.y)}this.start=function(e,t,r){var o,a,s,c,p=n.getGraphics(t),u=r-1,l=r,d=t.waypoints,h=d[u],m=d[l],f=ks(n,d,e);(a=Ct(h,m))&&(s="v"===a?"x":"y",0===u&&(h=rc(h,t.source,s)),l===d.length-1&&(m=rc(m,t.target,s)),o={connection:t,segmentStartIndex:u,segmentEndIndex:l,segmentStart:h,segmentEnd:m,axis:s,dragPosition:c=f?f.point:{x:(h.x+m.x)/2,y:(h.y+m.y)/2}},i.init(e,c,"connectionSegment.move",{cursor:"x"===s?"resize-ew":"resize-ns",data:{connection:t,connectionGfx:p,context:o}}))},t.on("connectionSegment.move.start",(function(e){var t=e.context,i=e.connection,r=n.getLayer("overlays");t.originalWaypoints=i.waypoints.slice(),t.draggerGfx=Ds(r,t.segmentStart,t.segmentEnd),Ae(t.draggerGfx).add("djs-dragging"),n.addMarker(i,ec)})),t.on("connectionSegment.move.move",(function(e){var t,n,i=e.context,r=i.connection,o=i.segmentStartIndex,a=i.segmentEndIndex,u=i.segmentStart,l=i.segmentEnd,d=i.axis,h=i.originalWaypoints.slice(),m=tc(u,d,e["d"+d]),f=tc(l,d,e["d"+d]),v=h.length,y=0;h[o]=m,h[a]=f,o<2&&(t=vn(r.source,m),1===o?"intersect"===t&&(h.shift(),h[0]=m,y--):"intersect"!==t&&(h.unshift(u),y++)),a>v-3&&(n=vn(r.target,f),a===v-2?"intersect"===n&&(h.pop(),h[h.length-1]=f):"intersect"!==n&&h.push(l)),i.newWaypoints=r.waypoints=s(r,h),p(i,y,e),i.newSegmentStartIndex=o+y,c(e)})),t.on("connectionSegment.move.hover",(function(e){e.context.hover=e.hover,n.addMarker(e.hover,Qs)})),t.on(["connectionSegment.move.out","connectionSegment.move.cleanup"],(function(e){var t=e.context.hover;t&&n.removeMarker(t,Qs)})),t.on("connectionSegment.move.cleanup",(function(e){var t=e.context,i=t.connection;t.draggerGfx&&ke(t.draggerGfx),n.removeMarker(i,ec)})),t.on(["connectionSegment.move.cancel","connectionSegment.move.end"],(function(e){var t=e.context;t.connection.waypoints=t.originalWaypoints,c(e)})),t.on("connectionSegment.move.end",(function(e){var t=e.context,n=t.connection,i=t.newWaypoints,r=t.newSegmentStartIndex,a=function(e,t){var n=0;return{waypoints:e.filter((function(i,r){return!Ot(e[r-1],e[r+1],i)||(n=r<=t?n-1:n,!1)})),segmentOffset:n}}(i=i.map((function(e){return{original:e.original,x:Math.round(e.x),y:Math.round(e.y)}})),r),c=s(n,a.waypoints),p=a.segmentOffset,u={segmentMove:{segmentStartIndex:t.segmentStartIndex,newSegmentStartIndex:r+p}};o.updateWaypoints(n,c,u)}))}oc.$inject=["injector","eventBus","canvas","dragging","graphicsFactory","modeling"];var ac=Math.abs,sc=Math.round;function cc(e){return{x:e.x,y:e.y}}function pc(e){return{x:e.x+e.width,y:e.y+e.height}}function uc(e,t){return!e||isNaN(e.x)||isNaN(e.y)?t:{x:sc(e.x+e.width/2),y:sc(e.y+e.height/2)}}function lc(e,t){var n=e.snapped;return!!n&&("string"==typeof t?n[t]:n.x&&n.y)}function dc(e,t,n){if("string"!=typeof t)throw new Error("axis must be in [x, y]");if("number"!=typeof n&&!1!==n)throw new Error("value must be Number or false");var i,r=e[t],o=e.snapped=e.snapped||{};return!1===n?o[t]=!1:(o[t]=!0,i=n-r,e[t]+=i,e["d"+t]+=i),r}function hc(e){return e.children||[]}var mc=Math.abs,fc=Math.round;function vc(e){function t(e,t){if(h(e)){for(var n=e.length;n--;)if(mc(e[n]-t)<=10)return e[n]}else{var i=t%(e=+e);if(i<10)return t-i;if(i>e-10)return t-i+e}return t}function n(e){if(e.width)return{x:fc(e.width/2+e.x),y:fc(e.height/2+e.y)}}e.on("connectionSegment.move.move",1500,(function(e){var i,r,o=function(e){var t=e.snapPoints,i=e.connection,r=i.waypoints,o=e.segmentStart,a=e.segmentStartIndex,s=e.segmentEnd,c=e.segmentEndIndex,p=e.axis;if(t)return t;var u=[r[a-1],o,s,r[c+1]];return a<2&&u.unshift(n(i.source)),c>r.length-3&&u.unshift(n(i.target)),e.snapPoints=t={horizontal:[],vertical:[]},_(u,(function(e){e&&(e=e.original||e,"y"===p&&t.horizontal.push(e.y),"x"===p&&t.vertical.push(e.x))})),t}(e.context),a=e.x,s=e.y;if(o){var c=a-(i=t(o.vertical,a)),p=s-(r=t(o.horizontal,s));U(e,{dx:e.dx-c,dy:e.dy-p,x:i,y:r}),(c||-1!==o.vertical.indexOf(a))&&dc(e,"x",i),(p||-1!==o.horizontal.indexOf(s))&&dc(e,"y",r)}})),e.on(["bendpoint.move.move","bendpoint.move.end"],1500,(function(e){var i,r,o=e.context,a=function(e){var t=e.snapPoints,n=e.connection.waypoints,i=e.bendpointIndex;if(t)return t;var r=[n[i-1],n[i+1]];return e.snapPoints=t={horizontal:[],vertical:[]},_(r,(function(e){e&&(e=e.original||e,t.horizontal.push(e.y),t.vertical.push(e.x))})),t}(o),s=o.hover,c=s&&n(s),p=e.x,u=e.y;if(a){var l=p-(i=t(c?a.vertical.concat([c.x]):a.vertical,p)),d=u-(r=t(c?a.horizontal.concat([c.y]):a.horizontal,u));U(e,{dx:e.dx-l,dy:e.dy-d,x:e.x-l,y:e.y-d}),(l||-1!==a.vertical.indexOf(p))&&dc(e,"x",i),(d||-1!==a.horizontal.indexOf(u))&&dc(e,"y",r)}}))}vc.$inject=["eventBus"];var yc={__depends__:[xs,Ss],__init__:["bendpoints","bendpointSnapping","bendpointMovePreview"],bendpoints:["type",Fs],bendpointMove:["type",Us],bendpointMovePreview:["type",Zs],connectionSegmentMove:["type",oc],bendpointSnapping:["type",vc]};function gc(e,t,n,i){function r(e,t){return i.allowed("connection.create",{source:e,target:t})}e.on("connect.hover",(function(e){var t,n=e.context,i=n.start,o=e.hover;if(n.hover=o,!d(t=n.canExecute=r(i,o))){if(!1!==t)return n.source=i,void(n.target=o);d(t=n.canExecute=r(o,i))||!1!==t&&(n.source=o,n.target=i)}})),e.on(["connect.out","connect.cleanup"],(function(e){var t=e.context;t.hover=null,t.source=null,t.target=null,t.canExecute=!1})),e.on("connect.end",(function(e){var t=e.context,i=t.canExecute,r=t.connectionStart,o={x:e.x,y:e.y},a=t.source,s=t.target;if(!i)return!1;var c=null,p={connectionStart:bc(t)?o:r,connectionEnd:bc(t)?r:o};m(i)&&(c=i),n.connect(a,s,c,p)})),this.start=function(e,n,i,r){m(i)||(r=i,i=fn(n)),t.init(e,"connect",{autoActivate:r,data:{shape:n,context:{start:n,connectionStart:i}}})}}function bc(e){var t=e.hover,n=e.source,i=e.target;return t&&n&&t===n&&n!==i}gc.$inject=["eventBus","dragging","modeling","rules"];var xc="connect-ok",Ec="connect-not-ok";function wc(e,t,n){var i=e.get("connectionPreview",!1);i&&t.on("connect.move",(function(e){var t=e.context,n=t.canExecute,r=t.hover,o=t.source,a=t.start,s=t.startPosition,c=t.target,p=t.connectionStart||s,u=t.connectionEnd||{x:e.x,y:e.y},l=p,d=u;bc(t)&&(l=u,d=p),i.drawPreview(t,n,{source:o||a,target:c||r,connectionStart:l,connectionEnd:d})})),t.on("connect.hover",900,(function(e){var t=e.context,i=e.hover,r=t.canExecute;null!==r&&n.addMarker(i,r?xc:Ec)})),t.on(["connect.out","connect.cleanup"],1100,(function(e){var t=e.hover;t&&(n.removeMarker(t,xc),n.removeMarker(t,Ec))})),i&&t.on("connect.cleanup",(function(e){i.cleanUp(e.context)}))}wc.$inject=["injector","eventBus","canvas"];var _c={__depends__:[Ho,Ss,xs],__init__:["connectPreview"],connect:["type",gc],connectPreview:["type",wc]};function Pc(e,t,n,i){this._canvas=t,this._graphicsFactory=n,this._elementFactory=i,this._connectionDocking=e.get("connectionDocking",!1),this._layouter=e.get("layouter",!1)}Pc.$inject=["injector","canvas","graphicsFactory","elementFactory"],Pc.prototype.drawPreview=function(e,t,n){n=n||{};var i,r,o,a=e.connectionPreviewGfx,s=e.getConnection,c=n.source,p=n.target,u=n.waypoints,l=n.connectionStart,d=n.connectionEnd,h=n.noLayout,m=n.noCropping,f=n.noNoop,v=this;a||(a=e.connectionPreviewGfx=this.createConnectionPreviewGfx()),je(a),s||(s=e.getConnection=(r=function(e,t,n){return v.getConnection(e,t,n)},o={},function(e){var t=JSON.stringify(e),n=o[t];return n||(n=o[t]=r.apply(null,arguments)),n})),t&&(i=s(t,c,p)),i?(i.waypoints=u||[],this._layouter&&!h&&(i.waypoints=this._layouter.layoutConnection(i,{source:c,target:p,connectionStart:l,connectionEnd:d,waypoints:n.waypoints||i.waypoints})),i.waypoints&&i.waypoints.length||(i.waypoints=[c?fn(c):l,p?fn(p):d]),this._connectionDocking&&(c||p)&&!m&&(i.waypoints=this._connectionDocking.getCroppedWaypoints(i,c,p)),this._graphicsFactory.drawConnection(a,i)):!f&&this.drawNoopPreview(a,n)},Pc.prototype.drawNoopPreview=function(e,t){var n=t.source,i=t.target,r=t.connectionStart||fn(n),o=t.connectionEnd||fn(i),a=this.cropWaypoints(r,o,n,i);Ee(e,this.createNoopConnection(a[0],a[1]))},Pc.prototype.cropWaypoints=function(e,t,n,i){var r=this._graphicsFactory,o=n&&r.getShapePath(n),a=i&&r.getShapePath(i),s=r.getConnectionPath({waypoints:[e,t]});return[e=n&&yn(o,s,!0)||e,t=i&&yn(a,s,!1)||t]},Pc.prototype.cleanUp=function(e){e&&e.connectionPreviewGfx&&ke(e.connectionPreviewGfx)},Pc.prototype.getConnection=function(e){var t=function(e){return m(e)?e:{}}(e);return this._elementFactory.createConnection(t)},Pc.prototype.createConnectionPreviewGfx=function(){var e=Ne("g");return Pe(e,{pointerEvents:"none"}),Ae(e).add("djs-connection-preview"),Ee(this._canvas.getActiveLayer(),e),e},Pc.prototype.createNoopConnection=function(e,t){var n=Ne("polyline");return Pe(n,{stroke:"#333",strokeDasharray:[1],strokeWidth:2,"pointer-events":"none"}),Pe(n,{points:[e.x,e.y,t.x,t.y]}),n};var Sc={__init__:["connectionPreview"],connectionPreview:["type",Pc]},Oc=Math.min,Cc=Math.max;function Tc(e){e.preventDefault()}function Ac(e){e.stopPropagation()}function Rc(e){this.container=e.container,this.parent=he('<div class="djs-direct-editing-parent"><div class="djs-direct-editing-content" contenteditable="true"></div></div>'),this.content=ve("[contenteditable]",this.parent),this.keyHandler=e.keyHandler||function(){},this.resizeHandler=e.resizeHandler||function(){},this.autoResize=z(this.autoResize,this),this.handlePaste=z(this.handlePaste,this)}function kc(e,t){this._eventBus=e,this._providers=[],this._textbox=new Rc({container:t.getContainer(),keyHandler:z(this._handleKey,this),resizeHandler:z(this._handleResize,this)})}Rc.prototype.create=function(e,t,n,i){var r=this.parent,o=this.content,a=this.container;i=this.options=i||{};var s=G(t=this.style=t||{},["width","height","maxWidth","maxHeight","minWidth","minHeight","left","top","backgroundColor","position","overflow","border","wordWrap","textAlign","outline","transform"]);U(r.style,{width:e.width+"px",height:e.height+"px",maxWidth:e.maxWidth+"px",maxHeight:e.maxHeight+"px",minWidth:e.minWidth+"px",minHeight:e.minHeight+"px",left:e.x+"px",top:e.y+"px",backgroundColor:"#ffffff",position:"absolute",overflow:"visible",border:"1px solid #ccc",boxSizing:"border-box",wordWrap:"normal",textAlign:"center",outline:"none"},s);var c=G(t,["fontFamily","fontSize","fontWeight","lineHeight","padding","paddingTop","paddingRight","paddingBottom","paddingLeft"]);return U(o.style,{boxSizing:"border-box",width:"100%",outline:"none",wordWrap:"break-word"},c),i.centerVertically&&U(o.style,{position:"absolute",top:"50%",transform:"translate(0, -50%)"},c),o.innerText=n,pe.bind(o,"keydown",this.keyHandler),pe.bind(o,"mousedown",Ac),pe.bind(o,"paste",this.handlePaste),i.autoResize&&pe.bind(o,"input",this.autoResize),i.resizable&&this.resizable(t),a.appendChild(r),this.setSelection(o.lastChild,o.lastChild&&o.lastChild.length),r},Rc.prototype.handlePaste=function(e){var t,n=this.options,i=this.style;if(e.preventDefault(),t=e.clipboardData?e.clipboardData.getData("text/plain"):window.clipboardData.getData("Text"),this.insertText(t),n.autoResize){var r=this.autoResize(i);r&&this.resizeHandler(r)}},Rc.prototype.insertText=function(e){e=e.replace(/\r\n|\r|\n/g,"\n"),document.execCommand("insertText",!1,e)||this._insertTextIE(e)},Rc.prototype._insertTextIE=function(e){var t,n,i,r=this.getSelection(),o=r.startContainer,a=r.endContainer,s=r.startOffset,c=r.endOffset,p=r.commonAncestorContainer,u=(t=p.childNodes,[].slice.call(t));if(function(e){return e.nodeType===Node.TEXT_NODE}(p)){var l=o.textContent;o.textContent=l.substring(0,s)+e+l.substring(c),n=o,i=s+e.length}else if(o===this.content&&a===this.content){var d=document.createTextNode(e);this.content.insertBefore(d,u[s]),n=d,i=d.textContent.length}else{var h=u.indexOf(o),m=u.indexOf(a);u.forEach((function(t,n){n===h?t.textContent=o.textContent.substring(0,s)+e+a.textContent.substring(c):n>h&&n<=m&&ge(t)})),n=o,i=s+e.length}n&&void 0!==i&&setTimeout((function(){self.setSelection(n,i)}))},Rc.prototype.autoResize=function(){var e=this.parent,t=this.content,n=parseInt(this.style.fontSize)||12;if(t.scrollHeight>e.offsetHeight||t.scrollHeight<e.offsetHeight-n){var i=e.getBoundingClientRect(),r=t.scrollHeight;e.style.height=r+"px",this.resizeHandler({width:i.width,height:i.height,dx:0,dy:r-i.height})}},Rc.prototype.resizable=function(){var e=this,t=this.parent,n=this.resizeHandle,i=parseInt(this.style.minWidth)||0,r=parseInt(this.style.minHeight)||0,o=parseInt(this.style.maxWidth)||1/0,a=parseInt(this.style.maxHeight)||1/0;if(!n){var s,c,p,u;n=this.resizeHandle=he('<div class="djs-direct-editing-resize-handle"></div>');var l=function(n){Tc(n),Ac(n);var l=Oc(Cc(p+n.clientX-s,i),o),d=Oc(Cc(u+n.clientY-c,r),a);t.style.width=l+"px",t.style.height=d+"px",e.resizeHandler({width:p,height:u,dx:n.clientX-s,dy:n.clientY-c})},d=function(e){Tc(e),Ac(e),pe.unbind(document,"mousemove",l,!1),pe.unbind(document,"mouseup",d,!1)};pe.bind(n,"mousedown",(function(e){Tc(e),Ac(e),s=e.clientX,c=e.clientY;var n=t.getBoundingClientRect();p=n.width,u=n.height,pe.bind(document,"mousemove",l),pe.bind(document,"mouseup",d)}))}U(n.style,{position:"absolute",bottom:"0px",right:"0px",cursor:"nwse-resize",width:"0",height:"0",borderTop:(parseInt(this.style.fontSize)/4||3)+"px solid transparent",borderRight:(parseInt(this.style.fontSize)/4||3)+"px solid #ccc",borderBottom:(parseInt(this.style.fontSize)/4||3)+"px solid #ccc",borderLeft:(parseInt(this.style.fontSize)/4||3)+"px solid transparent"}),t.appendChild(n)},Rc.prototype.destroy=function(){var e=this.parent,t=this.content,n=this.resizeHandle;t.innerText="",e.removeAttribute("style"),t.removeAttribute("style"),pe.unbind(t,"keydown",this.keyHandler),pe.unbind(t,"mousedown",Ac),pe.unbind(t,"input",this.autoResize),pe.unbind(t,"paste",this.handlePaste),n&&(n.removeAttribute("style"),ge(n)),ge(e)},Rc.prototype.getValue=function(){return this.content.innerText.trim()},Rc.prototype.getSelection=function(){return window.getSelection().getRangeAt(0)},Rc.prototype.setSelection=function(e,t){var n=document.createRange();null===e?n.selectNodeContents(this.content):(n.setStart(e,t),n.setEnd(e,t));var i=window.getSelection();i.removeAllRanges(),i.addRange(n)},kc.$inject=["eventBus","canvas"],kc.prototype.registerProvider=function(e){this._providers.push(e)},kc.prototype.isActive=function(){return!!this._active},kc.prototype.cancel=function(){this._active&&(this._fire("cancel"),this.close())},kc.prototype._fire=function(e,t){this._eventBus.fire("directEditing."+e,t||{active:this._active})},kc.prototype.close=function(){this._textbox.destroy(),this._fire("deactivate"),this._active=null,this.resizable=void 0},kc.prototype.complete=function(){var e=this._active;if(e){var t,n=e.context.bounds,i=this.$textbox.getBoundingClientRect(),r=this.getValue();r===e.context.text&&i.height===n.height&&i.width===n.width||(t=this._textbox.container.getBoundingClientRect(),e.provider.update(e.element,r,e.context.text,{x:i.left-t.left,y:i.top-t.top,width:i.width,height:i.height})),this._fire("complete"),this.close()}},kc.prototype.getValue=function(){return this._textbox.getValue()},kc.prototype._handleKey=function(e){e.stopPropagation();var t=e.keyCode||e.charCode;return 27===t?(e.preventDefault(),this.cancel()):13!==t||e.shiftKey?void 0:(e.preventDefault(),this.complete())},kc.prototype._handleResize=function(e){this._fire("resize",e)},kc.prototype.activate=function(e){var t;this.isActive()&&this.cancel();var n=x(this._providers,(function(n){return(t=n.activate(e))?n:null}));return t&&(this.$textbox=this._textbox.create(t.bounds,t.style,t.text,t.options),this._active={element:e,context:t,provider:n},t.options&&t.options.resizable&&(this.resizable=!0),this._fire("activate")),!!t};var jc={__depends__:[No],__init__:["directEditing"],directEditing:["type",kc]},Mc=".entry";function Dc(e,t,n){this._eventBus=t,this._overlays=n;var i=l(e&&e.scale)?e.scale:{min:1,max:1.5};this._overlaysConfig={position:{right:-9,top:-6},scale:i},this._current=null,this._init()}Dc.$inject=["config.contextPad","eventBus","overlays"],Dc.prototype._init=function(){var e=this._eventBus,t=this;e.on("selection.changed",(function(e){var n=e.newSelection;1===n.length?t.open(n[0]):t.close()})),e.on("elements.delete",(function(e){_(e.elements,(function(e){t.isOpen(e)&&t.close()}))})),e.on("element.changed",(function(e){var n=e.element,i=t._current;i&&i.element===n&&t.open(n,!0)}))},Dc.prototype.registerProvider=function(e,t){t||(t=e,e=1e3),this._eventBus.on("contextPad.getProviders",e,(function(e){e.providers.push(t)}))},Dc.prototype.getEntries=function(e){var t=this._getProviders(),n={};return _(t,(function(t){var i=t.getContextPadEntries(e);v(i)?n=i(n):_(i,(function(e,t){n[t]=e}))})),n},Dc.prototype.trigger=function(e,t,n){var i,r,o=this._current.element,a=this._current.entries,s=t.delegateTarget||t.target;if(!s)return t.preventDefault();if(i=a[K(s,"data-action")].action,r=t.originalEvent||t,v(i)){if("click"===e)return i(r,o,n)}else if(i[e])return i[e](r,o,n);t.preventDefault()},Dc.prototype.open=function(e,t){!t&&this.isOpen(e)||(this.close(),this._updateAndOpen(e))},Dc.prototype._getProviders=function(){var e=this._eventBus.createEvent({type:"contextPad.getProviders",providers:[]});return this._eventBus.fire(e),e.providers},Dc.prototype._updateAndOpen=function(e){var t=this.getEntries(e),n=this.getPad(e),i=n.html;_(t,(function(e,t){var n,r=e.group||"default",o=he(e.html||'<div class="entry" draggable="true"></div>');K(o,"data-action",t),(n=ve("[data-group="+r+"]",i))||(n=he('<div class="group" data-group="'+r+'"></div>'),i.appendChild(n)),n.appendChild(o),e.className&&function(e,t){var n=Q(e);(h(t)?t:t.split(/\s+/g)).forEach((function(e){n.add(e)}))}(o,e.className),e.title&&K(o,"title",e.title),e.imageUrl&&o.appendChild(he('<img src="'+e.imageUrl+'">'))})),Q(i).add("open"),this._current={element:e,pad:n,entries:t},this._eventBus.fire("contextPad.open",{current:this._current})},Dc.prototype.getPad=function(e){if(this.isOpen())return this._current.pad;var t=this,n=this._overlays,i=he('<div class="djs-context-pad"></div>'),r=U({html:i},this._overlaysConfig);de.bind(i,Mc,"click",(function(e){t.trigger("click",e)})),de.bind(i,Mc,"dragstart",(function(e){t.trigger("dragstart",e)})),pe.bind(i,"mousedown",(function(e){e.stopPropagation()})),this._overlayId=n.add(e,"context-pad",r);var o=n.get(this._overlayId);return this._eventBus.fire("contextPad.create",{element:e,pad:o}),o},Dc.prototype.close=function(){this.isOpen()&&(this._overlays.remove(this._overlayId),this._overlayId=null,this._eventBus.fire("contextPad.close",{current:this._current}),this._current=null)},Dc.prototype.isOpen=function(e){return!(!this._current||e&&this._current.element!==e)};var Bc={__depends__:[No,Qo],contextPad:["type",Dc]},Ic=["marker-start","marker-mid","marker-end"],Nc=["circle","ellipse","line","path","polygon","polyline","rect"];function Lc(e,t,n,i){this._elementRegistry=e,this._canvas=n,this._styles=i,this._clonedMarkers={};var r=this;t.on("drag.cleanup",(function(){_(r._clonedMarkers,(function(e){ke(e)})),r._clonedMarkers={}}))}Lc.$inject=["elementRegistry","eventBus","canvas","styles"],Lc.prototype.getGfx=function(e){return this._elementRegistry.getGraphics(e)},Lc.prototype.addDragger=function(e,t,n){var i=Me(n=n||this.getGfx(e)),r=n.getBoundingClientRect();return this._cloneMarkers(Kn(i)),Pe(i,this._styles.cls("djs-dragger",[],{x:r.top,y:r.left})),Ee(t,i),i},Lc.prototype.addFrame=function(e,t){var n=Ne("rect",{class:"djs-resize-overlay",width:e.width,height:e.height,x:e.x,y:e.y});return Ee(t,n),n},Lc.prototype._cloneMarkers=function(e){var t=this;if(e.childNodes)for(var n=0;n<e.childNodes.length;n++)t._cloneMarkers(e.childNodes[n]);(function(e){return-1!==Nc.indexOf(e.nodeName)})(e)&&Ic.forEach((function(n){if(Pe(e,n)){var i=function(e,t,n){return ve("marker#"+(i=Pe(e,t),i.match(/url\(['"]?#([^'"]*)['"]?\)/)[1]),n||document);var i}(e,n,t._canvas.getContainer());t._cloneMarker(e,i,n)}}))},Lc.prototype._cloneMarker=function(e,t,n){var i=t.id,r=this._clonedMarkers[i];if(!r){var o=i+"-clone";(r=Me(t)).id=o,Ae(r).add("djs-dragger").add("djs-dragger-marker"),this._clonedMarkers[i]=r;var a=ve("defs",this._canvas._svg);a||(a=Ne("defs"),Ee(this._canvas._svg,a)),Ee(a,r)}Pe(e,n,"url(#"+this._clonedMarkers[i].id+")")};var Fc={__init__:["previewSupport"],previewSupport:["type",Lc]},Vc="drop-ok",$c="drop-not-ok",zc="attach-ok",qc="new-parent",Uc="create";function Gc(e,t,n,i,r){function o(t,n){[zc,Vc,$c,qc].forEach((function(i){i===n?e.addMarker(t,i):e.removeMarker(t,i)}))}function a(){var e=t.context();e&&e.prefix===Uc&&t.cancel()}n.on(["create.move","create.hover"],(function(e){var t=e.context,n=t.elements,i=e.hover,a=t.source,s=t.hints||{};if(!i)return t.canExecute=!1,void(t.target=null);Hc(e);var c={x:e.x,y:e.y},p=t.canExecute=i&&function(e,t,n,i,o){if(!t)return!1;var a=x(e=w(e,(function(t){var n=t.labelTarget;return!(t.parent||function(e){return!!e.labelTarget}(t)&&-1!==e.indexOf(n))})),(function(e){return!Wc(e)})),s=!1,c=!1,p=!1;Kc(e)&&(s=r.allowed("shape.attach",{position:n,shape:a,target:t})),s||(p=Kc(e)?r.allowed("shape.create",{position:n,shape:a,source:i,target:t}):r.allowed("elements.create",{elements:e,position:n,target:t}));var u=o.connectionTarget;return p||s?(a&&i&&(c=r.allowed("connection.create",{source:u===i?a:i,target:u===i?i:a,hints:{targetParent:t,targetAttach:s}})),{attach:s,connect:c}):(null===p||null===s)&&null}(n,i,c,a,s);i&&null!==p&&(t.target=i,p&&p.attach?o(i,zc):o(i,p?qc:$c))})),n.on(["create.end","create.out","create.cleanup"],(function(e){var t=e.hover;t&&o(t,null)})),n.on("create.end",(function(e){var t=e.context,n=t.source,r=t.shape,o=t.elements,a=t.target,s=t.canExecute,c=s&&s.attach,p=s&&s.connect,u=t.hints||{};if(!1===s||!a)return!1;Hc(e);var l={x:e.x,y:e.y};r=p?i.appendShape(n,r,l,a,{attach:c,connection:!0===p?{}:p,connectionTarget:u.connectionTarget}):x(o=i.createElements(o,l,a,U({},u,{attach:c})),(function(e){return!Wc(e)})),U(t,{elements:o,shape:r}),U(e,{elements:o,shape:r})})),n.on("create.init",(function(){n.on("elements.changed",a),n.once(["create.cancel","create.end"],2e3,(function(){n.off("elements.changed",a)}))})),this.start=function(e,n,i){h(n)||(n=[n]);var r=x(n,(function(e){return!Wc(e)}));if(r){i=U({elements:n,hints:{},shape:r},i||{}),_(n,(function(e){f(e.x)||(e.x=0),f(e.y)||(e.y=0)}));var o=ft(n);_(n,(function(e){Wc(e)&&(e.waypoints=T(e.waypoints,(function(e){return{x:e.x-o.x-o.width/2,y:e.y-o.y-o.height/2}}))),U(e,{x:e.x-o.x-o.width/2,y:e.y-o.y-o.height/2})})),t.init(e,Uc,{cursor:"grabbing",autoActivate:!0,data:{shape:r,elements:n,context:i}})}}}function Hc(e){var t=e.context.createConstraints;t&&(t.left&&(e.x=Math.max(e.x,t.left)),t.right&&(e.x=Math.min(e.x,t.right)),t.top&&(e.y=Math.max(e.y,t.top)),t.bottom&&(e.y=Math.min(e.y,t.bottom)))}function Wc(e){return!!e.waypoints}function Kc(e){return e&&1===e.length&&!Wc(e[0])}Gc.$inject=["canvas","dragging","eventBus","modeling","rules"];function Xc(e,t,n,i,r){t.on("create.move",750,(function(t){var o=t.hover,a=t.context,s=a.elements,c=a.dragGroup;c||(c=a.dragGroup=function(e){var t=Ne("g");Pe(t,r.cls("djs-drag-group",["no-events"]));var o=Ne("g");return e.forEach((function(e){var r;e.hidden||(e.waypoints?(r=n._createContainer("connection",o),n.drawConnection(Kn(r),e)):(r=n._createContainer("shape",o),n.drawShape(Kn(r),e),Yn(r,e.x,e.y)),i.addDragger(e,t,r))})),t}(s)),o?(c.parentNode||Ee(e.getActiveLayer(),c),Yn(c,t.x,t.y)):ke(c)})),t.on("create.cleanup",(function(e){var t=e.context.dragGroup;t&&ke(t)}))}Xc.$inject=["canvas","eventBus","graphicsFactory","previewSupport","styles"];var Yc={__depends__:[xs,Fc,Ss,Ho],__init__:["create","createPreview"],create:["type",Gc],createPreview:["type",Xc]},Jc="data-id",Zc=["contextPad.close","canvas.viewbox.changing","commandStack.changed"];function Qc(e,t,n){var i=l(e&&e.scale)?e.scale:{min:1,max:1.5};this._config={scale:i},this._eventBus=t,this._canvas=n,this._providers={},this._current={}}Qc.$inject=["config.popupMenu","eventBus","canvas"],Qc.prototype.registerProvider=function(e,t,n){n||(n=t,t=1e3),this._eventBus.on("popupMenu.getProviders."+e,t,(function(e){e.providers.push(n)}))},Qc.prototype.isEmpty=function(e,t){if(!e)throw new Error("element parameter is missing");if(!t)throw new Error("providerId parameter is missing");var n=this._getProviders(t);if(!n)return!0;var i=this._getEntries(e,n),r=this._getHeaderEntries(e,n),o=R(i)>0,a=r&&R(r)>0;return!o&&!a},Qc.prototype.open=function(e,t,n){var i=this._getProviders(t);if(!e)throw new Error("Element is missing");if(!i||!i.length)throw new Error("No registered providers for: "+t);if(!n)throw new Error("the position argument is missing");this.isOpen()&&this.close(),this._emit("open");var r=this._current={className:t,element:e,position:n},o=this._getEntries(e,i),a=this._getHeaderEntries(e,i);r.entries=U({},o,a),r.container=this._createContainer(),R(a)&&r.container.appendChild(this._createEntries(a,"djs-popup-header")),R(o)&&r.container.appendChild(this._createEntries(o,"djs-popup-body"));var s=this._canvas.getContainer();this._attachContainer(r.container,s,n.cursor),this._bindAutoClose()},Qc.prototype.close=function(){this.isOpen()&&(this._emit("close"),this._unbindAutoClose(),ge(this._current.container),this._current.container=null)},Qc.prototype.isOpen=function(){return!!this._current.container},Qc.prototype.trigger=function(e){e.preventDefault();var t=K(e.delegateTarget||e.target,Jc),n=this._getEntry(t);if(n.action)return n.action.call(null,e,n)},Qc.prototype._getProviders=function(e){var t=this._eventBus.createEvent({type:"popupMenu.getProviders."+e,providers:[]});return this._eventBus.fire(t),t.providers},Qc.prototype._getEntries=function(e,t){var n={};return _(t,(function(t){if(t.getPopupMenuEntries){var i=t.getPopupMenuEntries(e);v(i)?n=i(n):_(i,(function(e,t){n[t]=e}))}else _(t.getEntries(e),(function(e){var t=e.id;if(!t)throw new Error("every entry must have the id property set");n[t]=H(e,["id"])}))})),n},Qc.prototype._getHeaderEntries=function(e,t){var n={};return _(t,(function(t){if(t.getPopupMenuHeaderEntries){var i=t.getPopupMenuHeaderEntries(e);v(i)?n=i(n):_(i,(function(e,t){n[t]=e}))}else{if(!t.getHeaderEntries)return;_(t.getHeaderEntries(e),(function(e){var t=e.id;if(!t)throw new Error("every entry must have the id property set");n[t]=H(e,["id"])}))}})),n},Qc.prototype._getEntry=function(e){var t=this._current.entries[e];if(!t)throw new Error("entry not found");return t},Qc.prototype._emit=function(e){this._eventBus.fire("popupMenu."+e)},Qc.prototype._createContainer=function(){var e=he('<div class="djs-popup">'),t=this._current.position,n=this._current.className;return U(e.style,{position:"absolute",left:t.x+"px",top:t.y+"px",visibility:"hidden"}),Q(e).add(n),e},Qc.prototype._attachContainer=function(e,t,n){var i=this;de.bind(e,".entry","click",(function(e){i.trigger(e)})),this._updateScale(e),t.appendChild(e),n&&this._assureIsInbounds(e,n)},Qc.prototype._updateScale=function(e){var t,n,i=this._canvas.zoom(),r=this._config.scale,o=i;!0!==r&&(!1===r?(t=1,n=1):(t=r.min,n=r.max),l(t)&&i<t&&(o=t),l(n)&&i>n&&(o=n)),function(e,t){e.style["transform-origin"]="top left",["","-ms-","-webkit-"].forEach((function(n){e.style[n+"transform"]=t}))}(e,"scale("+o+")")},Qc.prototype._assureIsInbounds=function(e,t){var n,i,r=this._canvas._container.getBoundingClientRect(),o=e.offsetLeft,a=e.offsetTop,s=e.scrollWidth,c=e.scrollHeight,p={},u=t.x-r.left,l=t.y-r.top;o+s>r.width&&(p.x=!0),a+c>r.height&&(p.y=!0),p.x&&p.y?(n=u-s+"px",i=l-c+"px"):p.x?(n=u-s+"px",i=l+"px"):p.y&&l<c?(n=u+"px",i="10px"):p.y&&(n=u+"px",i=l-c+"px"),U(e.style,{left:n,top:i},{visibility:"visible","z-index":1e3})},Qc.prototype._createEntries=function(e,t){var n=he("<div>"),i=this;return Q(n).add(t),_(e,(function(e,t){var r=i._createEntry(e,t);n.appendChild(r)})),n},Qc.prototype._createEntry=function(e,t){var n=he("<div>"),i=Q(n);if(i.add("entry"),e.className&&e.className.split(" ").forEach((function(e){i.add(e)})),K(n,Jc,t),e.label){var r=he("<span>");r.textContent=e.label,n.appendChild(r)}return e.imageUrl&&n.appendChild(he('<img src="'+e.imageUrl+'" />')),!0===e.active&&i.add("active"),!0===e.disabled&&i.add("disabled"),e.title&&(n.title=e.title),n},Qc.prototype._bindAutoClose=function(){this._eventBus.once(Zc,this.close,this)},Qc.prototype._unbindAutoClose=function(){this._eventBus.off(Zc,this.close,this)};var ep={__init__:["popupMenu"],popupMenu:["type",Qc]};function tp(){}tp.prototype.get=function(){return this._data},tp.prototype.set=function(e){this._data=e},tp.prototype.clear=function(){var e=this._data;return delete this._data,e},tp.prototype.isEmpty=function(){return!this._data};var np={clipboard:["type",tp]};function ip(e){var t=this;function n(e){t._lastMoveEvent=e}this._lastMoveEvent=null,e.on("canvas.init",(function(e){(t._svg=e.svg).addEventListener("mousemove",n)})),e.on("canvas.destroy",(function(){t._lastMouseEvent=null,t._svg.removeEventListener("mousemove",n)}))}ip.$inject=["eventBus"],ip.prototype.getLastMoveEvent=function(){return this._lastMoveEvent||function(e,t){var n=document.createEvent("MouseEvent"),i=e,r=t,o=e,a=t;n.initMouseEvent&&n.initMouseEvent("mousemove",!0,!0,window,0,i,r,o,a,!1,!1,!1,!1,0,null);return n}(0,0)};var rp={__init__:["mouse"],mouse:["type",ip]};function op(e,t,n,i,r,o,a,s){this._canvas=e,this._create=t,this._clipboard=n,this._elementFactory=i,this._eventBus=r,this._modeling=o,this._mouse=a,this._rules=s,r.on("copyPaste.copyElement",(function(e){var t=e.descriptor,n=e.element,i=e.elements;t.priority=1,t.id=n.id,x(i,(function(e){return e===n.parent}))&&(t.parent=n.parent.id),function(e){return!!e.host}(n)&&(t.priority=2,t.host=n.host.id),ap(n)&&(t.priority=3,t.source=n.source.id,t.target=n.target.id,t.waypoints=function(e){return T(e.waypoints,(function(e){return(e=cp(e)).original&&(e.original=cp(e.original)),e}))}(n)),sp(n)&&(t.priority=4,t.labelTarget=n.labelTarget.id),_(["x","y","width","height"],(function(e){f(n[e])&&(t[e]=n[e])})),t.hidden=n.hidden,t.collapsed=n.collapsed})),r.on("copyPaste.pasteElements",(function(e){U(e.hints,{createElementsBehavior:!1})}))}function ap(e){return!!e.waypoints}function sp(e){return!!e.labelTarget}function cp(e){return U({},e)}function pp(e,t){var n=t.indexOf(e);return-1===n?t:t.splice(n,1)}op.$inject=["canvas","create","clipboard","elementFactory","eventBus","modeling","mouse","rules"],op.prototype.copy=function(e){var t,n;return h(e)||(e=e?[e]:[]),n=!1===(t=this._eventBus.fire("copyPaste.canCopyElements",{elements:e}))?{}:this.createTree(h(t)?t:e),this._clipboard.set(n),this._eventBus.fire("copyPaste.elementsCopied",{elements:e,tree:n}),n},op.prototype.paste=function(e){var t=this._clipboard.get();if(!this._clipboard.isEmpty()){var n=e&&e.hints||{};this._eventBus.fire("copyPaste.pasteElements",{hints:n});var i=this._createElements(t);if(e&&e.element&&e.point)return this._paste(i,e.element,e.point,n);this._create.start(this._mouse.getLastMoveEvent(),i,{hints:n||{}})}},op.prototype._paste=function(e,t,n,i){_(e,(function(e){f(e.x)||(e.x=0),f(e.y)||(e.y=0)}));var r=ft(e);return _(e,(function(e){ap(e)&&(e.waypoints=T(e.waypoints,(function(e){return{x:e.x-r.x-r.width/2,y:e.y-r.y-r.height/2}}))),U(e,{x:e.x-r.x-r.width/2,y:e.y-r.y-r.height/2})})),this._modeling.createElements(e,n,t,U({},i))},op.prototype._createElements=function(e){var t=this,n=this._eventBus,i={},r=[];return _(e,(function(e,o){_(e=B(e,"priority"),(function(e){var o,a=U({},H(e,["priority"]));return i[e.parent]?a.parent=i[e.parent]:delete a.parent,n.fire("copyPaste.pasteElement",{cache:i,descriptor:a}),ap(a)?(a.source=i[e.source],a.target=i[e.target],o=i[e.id]=t.createConnection(a),void r.push(o)):sp(a)?(a.labelTarget=i[a.labelTarget],o=i[e.id]=t.createLabel(a),void r.push(o)):(a.host&&(a.host=i[a.host]),o=i[e.id]=t.createShape(a),void r.push(o))}))})),r},op.prototype.createConnection=function(e){return this._elementFactory.createConnection(H(e,["id"]))},op.prototype.createLabel=function(e){return this._elementFactory.createLabel(H(e,["id"]))},op.prototype.createShape=function(e){return this._elementFactory.createShape(H(e,["id"]))},op.prototype.hasRelations=function(e,t){var n,i;return!(ap(e)&&(n=x(t,I({id:e.source.id})),i=x(t,I({id:e.target.id})),!n||!i))&&!(sp(e)&&!x(t,I({id:e.labelTarget.id})))},op.prototype.createTree=function(e){var t=this._rules,n=this,i={},r=[];function o(e,t){var n=x(r,(function(t){return e===t.element}));n?n.depth<t&&(r=function(e,t){var n=t.indexOf(e);-1!==n&&t.splice(n,1);return t}(n,r)).push({element:n.element,depth:t}):r.push({element:e,depth:t})}return ht(ut(e),(function(e,t,n){if(!sp(e))return _(e.labels,(function(e){o(e,n)})),_([e.attachers,e.incoming,e.outgoing],(function(e){e&&e.length&&_(e,(function(e){_(e.labels,(function(e){o(e,n)})),o(e,n)}))})),o(e,n),e.children})),e=T(r,(function(e){return e.element})),r=B(r=T(r,(function(t){return t.descriptor={},n._eventBus.fire("copyPaste.copyElement",{descriptor:t.descriptor,element:t.element,elements:e}),t})),(function(e){return e.descriptor.priority})),e=T(r,(function(e){return e.element})),_(r,(function(r){var o=r.depth;n.hasRelations(r.element,e)?!function(e,n){return t.allowed("element.copy",{element:e,elements:n})}(r.element,e)?pp(r.element,e):(i[o]||(i[o]=[]),i[o].push(r.descriptor)):pp(r.element,e)})),i};var up={__depends__:[np,Yc,rp,Ss],__init__:["copyPaste"],copyPaste:["type",op]};function lp(e,t,n){h(n)||(n=[n]),_(n,(function(n){u(e[n])||(t[n]=e[n])}))}function dp(e,t,n){var i;t.on("copyPaste.copyElement",750,(function(e){var t=e.descriptor,n=e.element,i=t.oldBusinessObject=Br(n);if(t.type=n.type,lp(i,t,"name"),t.di={},lp(i.di,t.di,["fill","stroke","background-color","border-color","color"]),lp(i.di,t,"isExpanded"),hp(t))return t;i.default&&(t.default=i.default.id)})),t.on("moddleCopy.canCopyProperty",(function(t){var i,r=t.parent,o=t.property;if("processRef"===t.propertyName&&Dr(r,"bpmn:Participant")&&Dr(o,"bpmn:Process"))return i=e.create("bpmn:Process"),n.copyElement(o,i)})),t.on("copyPaste.pasteElements",(function(){i={}})),t.on("copyPaste.pasteElement",(function(t){var r,o=t.cache,a=t.descriptor,s=a.oldBusinessObject;hp(a)?a.businessObject=Br(o[a.labelTarget]):(r=e.create(s.$type),a.businessObject=n.copyElement(s,r),function(e,t){var n=Br(e);e.default&&(i[e.default]={element:n,property:"default"}),e.host&&(Br(e).attachedToRef=Br(t[e.host])),i=H(i,S(i,(function(t,i,r){var o=i.element,a=i.property;return r===e.id&&(o[a]=n,t.push(e.id)),t}),[]))}(a,o),lp(a,r,["isExpanded","name"]),function(e,t){h(t)||(t=[t]),_(t,(function(t){e[t]&&delete e[t]}))}(a,"oldBusinessObject"))}))}function hp(e){return!!e.labelTarget}dp.$inject=["bpmnFactory","eventBus","moddleCopy"];var mp=["artifacts","dataInputAssociations","dataOutputAssociations","default","flowElements","lanes","incoming","outgoing"];function fp(e,t,n){this._bpmnFactory=t,this._eventBus=e,this._moddle=n,e.on("moddleCopy.canCopyProperties",(function(e){var t=e.propertyNames;if(t&&t.length)return B(t,(function(e){return"extensionElements"===e}))})),e.on("moddleCopy.canCopyProperty",(function(e){var t=e.parent,n=m(t)&&t.$descriptor,i=e.propertyName;return(!i||-1===mp.indexOf(i))&&(!(i&&n&&!x(n.properties,I({name:i})))&&void 0)})),e.on("moddleCopy.canSetCopiedProperty",(function(e){var t,n,i=e.property;if(n="bpmn:ExtensionElements",(t=i)&&"function"==typeof t.$instanceOf&&t.$instanceOf(n)&&(!i.values||!i.values.length))return!1}))}function vp(e,t){return S(e.properties,(function(e,n){return t&&n.default?e:e.concat(n.name)}),[])}fp.$inject=["eventBus","bpmnFactory","moddle"],fp.prototype.copyElement=function(e,t,n){var i=this;n&&!h(n)&&(n=[n]),n=n||vp(e.$descriptor);var r=this._eventBus.fire("moddleCopy.canCopyProperties",{propertyNames:n,sourceElement:e,targetElement:t});return!1===r||(h(r)&&(n=r),_(n,(function(n){var r;b(e,n)&&(r=e.get(n));var o=i.copyProperty(r,t,n);!1!==i._eventBus.fire("moddleCopy.canSetCopiedProperty",{parent:t,property:o,propertyName:n})&&l(o)&&t.set(n,o)}))),t},fp.prototype.copyProperty=function(e,t,n){var i=this,r=this._eventBus.fire("moddleCopy.canCopyProperty",{parent:t,property:e,propertyName:n});if(!1!==r){if(r)return m(r)&&r.$type&&!r.$parent&&(r.$parent=t),r;var o=this._moddle.getPropertyDescriptor(t,n);if(!o.isReference){if(o.isId)return this._copyId(e,t);if(h(e))return S(e,(function(e,o){return(r=i.copyProperty(o,t,n))?(r.$parent=t,e.concat(r)):e}),[]);if(m(e)&&e.$type){if(this._moddle.getElementDescriptor(e).isGeneric)return;return(r=i._bpmnFactory.create(e.$type)).$parent=t,r=i.copyElement(e,r)}return e}}},fp.prototype._copyId=function(e,t){return this._moddle.ids.assigned(e)?void 0:(this._moddle.ids.claim(e,t),e)};var yp={__depends__:[up],__init__:["bpmnCopyPaste","moddleCopy"],bpmnCopyPaste:["type",dp],moddleCopy:["type",fp]},gp=Math.round;function bp(e){this._modeling=e}bp.$inject=["modeling"],bp.prototype.replaceElement=function(e,t,n){if(e.waypoints)return null;var i=this._modeling,r=t.width||e.width,o=t.height||e.height,a=t.x||e.x,s=t.y||e.y,c=gp(a+r/2),p=gp(s+o/2);return i.replaceShape(e,U({},t,{x:c,y:p,width:r,height:o}),n)};var xp={__init__:["replace"],replace:["type",bp]};var Ep=["cancelActivity","instantiate","eventGatewayType","triggeredByEvent","isInterrupting"];function wp(e,t,n,i,r,o,a){this.replaceElement=function(s,c,p){p=p||{};var l=c.type,d=s.businessObject;if(_p(d)&&"bpmn:SubProcess"===l&&function(e,t){var n=e&&b(e,"collapsed")?e.collapsed:!Nr(e);return n!==(t&&(b(t,"collapsed")||b(t,"isExpanded"))?b(t,"collapsed")?t.collapsed:!t.isExpanded:n)&&(e.collapsed=n,!0)}(s,c))return i.toggleCollapse(s),s;var m,f=e.create(l),v={type:l,businessObject:f},y=vp(d.$descriptor),g=vp(f.$descriptor,!0),x=(m=g,y.filter((function(e){return-1!==m.indexOf(e)})));U(f,G(c,Ep));var E=w(x,(function(e){return"eventDefinitions"===e?Pp(s,c.eventDefinitionType):"loopCharacteristics"===e?!Fr(f):!b(f,e)&&(("processRef"!==e||!1!==c.isExpanded)&&"triggeredByEvent"!==e)}));return f=n.copyElement(d,f,E),c.eventDefinitionType&&(Pp(f,c.eventDefinitionType)||(v.eventDefinitionType=c.eventDefinitionType,v.eventDefinitionAttrs=c.eventDefinitionAttrs)),Dr(d,"bpmn:Activity")&&(_p(d)?v.isExpanded=Nr(d):c&&b(c,"isExpanded")&&(v.isExpanded=c.isExpanded),Nr(d)&&!Dr(d,"bpmn:Task")&&v.isExpanded&&(v.width=s.width,v.height=s.height)),_p(d)&&!_p(f)&&(p.moveChildren=!1),Dr(d,"bpmn:Participant")&&(!0===c.isExpanded?f.processRef=e.create("bpmn:Process"):p.moveChildren=!1,v.width=s.width,v.height=t._getDefaultSize(f).height),o.allowed("shape.resize",{shape:f})||(v.height=t._getDefaultSize(f).height,v.width=t._getDefaultSize(f).width),f.name=d.name,Qa(d,["bpmn:ExclusiveGateway","bpmn:InclusiveGateway","bpmn:Activity"])&&Qa(f,["bpmn:ExclusiveGateway","bpmn:InclusiveGateway","bpmn:Activity"])&&(f.default=d.default),c.host&&!Dr(d,"bpmn:BoundaryEvent")&&Dr(f,"bpmn:BoundaryEvent")&&(v.host=c.host),"bpmn:DataStoreReference"!==v.type&&"bpmn:DataObjectReference"!==v.type||(v.x=s.x+(s.width-v.width)/2),v.di={},function(e,t,n){h(n)||(n=[n]),_(n,(function(n){u(e[n])||(t[n]=e[n])}))}(d.di,v.di,["fill","stroke","background-color","border-color","color"]),v=r.replaceElement(s,v,p),!1!==p.select&&a.select(v),v}}function _p(e){return Dr(e,"bpmn:SubProcess")}function Pp(e,t){var n=Br(e);return t&&n.get("eventDefinitions").some((function(e){return Dr(e,t)}))}wp.$inject=["bpmnFactory","elementFactory","moddleCopy","modeling","replace","rules","selection"];var Sp={__depends__:[yp,xp,Ho],bpmnReplace:["type",wp]};function Op(e){return function(t){var n=t.target,i=Br(e),r=i.eventDefinitions&&i.eventDefinitions[0],o=i.$type===n.type,a=(r&&r.$type)===n.eventDefinitionType,s=i.triggeredByEvent===n.triggeredByEvent,c=void 0===n.isExpanded||n.isExpanded===Nr(i);return!(o&&a&&s&&c)}}var Cp=[{label:"Start Event",actionName:"replace-with-none-start",className:"bpmn-icon-start-event-none",target:{type:"bpmn:StartEvent"}},{label:"Intermediate Throw Event",actionName:"replace-with-none-intermediate-throwing",className:"bpmn-icon-intermediate-event-none",target:{type:"bpmn:IntermediateThrowEvent"}},{label:"End Event",actionName:"replace-with-none-end",className:"bpmn-icon-end-event-none",target:{type:"bpmn:EndEvent"}},{label:"Message Start Event",actionName:"replace-with-message-start",className:"bpmn-icon-start-event-message",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},{label:"Timer Start Event",actionName:"replace-with-timer-start",className:"bpmn-icon-start-event-timer",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:TimerEventDefinition"}},{label:"Conditional Start Event",actionName:"replace-with-conditional-start",className:"bpmn-icon-start-event-condition",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition"}},{label:"Signal Start Event",actionName:"replace-with-signal-start",className:"bpmn-icon-start-event-signal",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}}],Tp=[{label:"Start Event",actionName:"replace-with-none-start",className:"bpmn-icon-start-event-none",target:{type:"bpmn:StartEvent"}},{label:"Intermediate Throw Event",actionName:"replace-with-none-intermediate-throwing",className:"bpmn-icon-intermediate-event-none",target:{type:"bpmn:IntermediateThrowEvent"}},{label:"End Event",actionName:"replace-with-none-end",className:"bpmn-icon-end-event-none",target:{type:"bpmn:EndEvent"}}],Ap=[{label:"Start Event",actionName:"replace-with-none-start",className:"bpmn-icon-start-event-none",target:{type:"bpmn:StartEvent"}},{label:"Intermediate Throw Event",actionName:"replace-with-none-intermediate-throw",className:"bpmn-icon-intermediate-event-none",target:{type:"bpmn:IntermediateThrowEvent"}},{label:"End Event",actionName:"replace-with-none-end",className:"bpmn-icon-end-event-none",target:{type:"bpmn:EndEvent"}},{label:"Message Intermediate Catch Event",actionName:"replace-with-message-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-message",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},{label:"Message Intermediate Throw Event",actionName:"replace-with-message-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-message",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},{label:"Timer Intermediate Catch Event",actionName:"replace-with-timer-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-timer",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:TimerEventDefinition"}},{label:"Escalation Intermediate Throw Event",actionName:"replace-with-escalation-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-escalation",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:EscalationEventDefinition"}},{label:"Conditional Intermediate Catch Event",actionName:"replace-with-conditional-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-condition",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition"}},{label:"Link Intermediate Catch Event",actionName:"replace-with-link-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-link",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:LinkEventDefinition",eventDefinitionAttrs:{name:""}}},{label:"Link Intermediate Throw Event",actionName:"replace-with-link-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-link",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:LinkEventDefinition",eventDefinitionAttrs:{name:""}}},{label:"Compensation Intermediate Throw Event",actionName:"replace-with-compensation-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-compensation",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:CompensateEventDefinition"}},{label:"Signal Intermediate Catch Event",actionName:"replace-with-signal-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-signal",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}},{label:"Signal Intermediate Throw Event",actionName:"replace-with-signal-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-signal",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}}],Rp=[{label:"Start Event",actionName:"replace-with-none-start",className:"bpmn-icon-start-event-none",target:{type:"bpmn:StartEvent"}},{label:"Intermediate Throw Event",actionName:"replace-with-none-intermediate-throw",className:"bpmn-icon-intermediate-event-none",target:{type:"bpmn:IntermediateThrowEvent"}},{label:"End Event",actionName:"replace-with-none-end",className:"bpmn-icon-end-event-none",target:{type:"bpmn:EndEvent"}},{label:"Message End Event",actionName:"replace-with-message-end",className:"bpmn-icon-end-event-message",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},{label:"Escalation End Event",actionName:"replace-with-escalation-end",className:"bpmn-icon-end-event-escalation",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:EscalationEventDefinition"}},{label:"Error End Event",actionName:"replace-with-error-end",className:"bpmn-icon-end-event-error",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:ErrorEventDefinition"}},{label:"Cancel End Event",actionName:"replace-with-cancel-end",className:"bpmn-icon-end-event-cancel",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:CancelEventDefinition"}},{label:"Compensation End Event",actionName:"replace-with-compensation-end",className:"bpmn-icon-end-event-compensation",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:CompensateEventDefinition"}},{label:"Signal End Event",actionName:"replace-with-signal-end",className:"bpmn-icon-end-event-signal",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}},{label:"Terminate End Event",actionName:"replace-with-terminate-end",className:"bpmn-icon-end-event-terminate",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:TerminateEventDefinition"}}],kp=[{label:"Exclusive Gateway",actionName:"replace-with-exclusive-gateway",className:"bpmn-icon-gateway-xor",target:{type:"bpmn:ExclusiveGateway"}},{label:"Parallel Gateway",actionName:"replace-with-parallel-gateway",className:"bpmn-icon-gateway-parallel",target:{type:"bpmn:ParallelGateway"}},{label:"Inclusive Gateway",actionName:"replace-with-inclusive-gateway",className:"bpmn-icon-gateway-or",target:{type:"bpmn:InclusiveGateway"}},{label:"Complex Gateway",actionName:"replace-with-complex-gateway",className:"bpmn-icon-gateway-complex",target:{type:"bpmn:ComplexGateway"}},{label:"Event based Gateway",actionName:"replace-with-event-based-gateway",className:"bpmn-icon-gateway-eventbased",target:{type:"bpmn:EventBasedGateway",instantiate:!1,eventGatewayType:"Exclusive"}}],jp=[{label:"Transaction",actionName:"replace-with-transaction",className:"bpmn-icon-transaction",target:{type:"bpmn:Transaction",isExpanded:!0}},{label:"Event Sub Process",actionName:"replace-with-event-subprocess",className:"bpmn-icon-event-subprocess-expanded",target:{type:"bpmn:SubProcess",triggeredByEvent:!0,isExpanded:!0}},{label:"Sub Process (collapsed)",actionName:"replace-with-collapsed-subprocess",className:"bpmn-icon-subprocess-collapsed",target:{type:"bpmn:SubProcess",isExpanded:!1}}],Mp=[{label:"Sub Process",actionName:"replace-with-subprocess",className:"bpmn-icon-subprocess-expanded",target:{type:"bpmn:SubProcess",isExpanded:!0}},{label:"Event Sub Process",actionName:"replace-with-event-subprocess",className:"bpmn-icon-event-subprocess-expanded",target:{type:"bpmn:SubProcess",triggeredByEvent:!0,isExpanded:!0}}],Dp=[{label:"Sub Process",actionName:"replace-with-subprocess",className:"bpmn-icon-subprocess-expanded",target:{type:"bpmn:SubProcess",isExpanded:!0}},{label:"Transaction",actionName:"replace-with-transaction",className:"bpmn-icon-transaction",target:{type:"bpmn:Transaction",isExpanded:!0}}],Bp=[{label:"Task",actionName:"replace-with-task",className:"bpmn-icon-task",target:{type:"bpmn:Task"}},{label:"Send Task",actionName:"replace-with-send-task",className:"bpmn-icon-send",target:{type:"bpmn:SendTask"}},{label:"Receive Task",actionName:"replace-with-receive-task",className:"bpmn-icon-receive",target:{type:"bpmn:ReceiveTask"}},{label:"User Task",actionName:"replace-with-user-task",className:"bpmn-icon-user",target:{type:"bpmn:UserTask"}},{label:"Manual Task",actionName:"replace-with-manual-task",className:"bpmn-icon-manual",target:{type:"bpmn:ManualTask"}},{label:"Business Rule Task",actionName:"replace-with-rule-task",className:"bpmn-icon-business-rule",target:{type:"bpmn:BusinessRuleTask"}},{label:"Service Task",actionName:"replace-with-service-task",className:"bpmn-icon-service",target:{type:"bpmn:ServiceTask"}},{label:"Script Task",actionName:"replace-with-script-task",className:"bpmn-icon-script",target:{type:"bpmn:ScriptTask"}},{label:"Call Activity",actionName:"replace-with-call-activity",className:"bpmn-icon-call-activity",target:{type:"bpmn:CallActivity"}},{label:"Sub Process (collapsed)",actionName:"replace-with-collapsed-subprocess",className:"bpmn-icon-subprocess-collapsed",target:{type:"bpmn:SubProcess",isExpanded:!1}},{label:"Sub Process (expanded)",actionName:"replace-with-expanded-subprocess",className:"bpmn-icon-subprocess-expanded",target:{type:"bpmn:SubProcess",isExpanded:!0}}],Ip=[{label:"Data Store Reference",actionName:"replace-with-data-store-reference",className:"bpmn-icon-data-store",target:{type:"bpmn:DataStoreReference"}}],Np=[{label:"Data Object Reference",actionName:"replace-with-data-object-reference",className:"bpmn-icon-data-object",target:{type:"bpmn:DataObjectReference"}}],Lp=[{label:"Message Boundary Event",actionName:"replace-with-message-boundary",className:"bpmn-icon-intermediate-event-catch-message",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},{label:"Timer Boundary Event",actionName:"replace-with-timer-boundary",className:"bpmn-icon-intermediate-event-catch-timer",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:TimerEventDefinition"}},{label:"Escalation Boundary Event",actionName:"replace-with-escalation-boundary",className:"bpmn-icon-intermediate-event-catch-escalation",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:EscalationEventDefinition"}},{label:"Conditional Boundary Event",actionName:"replace-with-conditional-boundary",className:"bpmn-icon-intermediate-event-catch-condition",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition"}},{label:"Error Boundary Event",actionName:"replace-with-error-boundary",className:"bpmn-icon-intermediate-event-catch-error",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:ErrorEventDefinition"}},{label:"Cancel Boundary Event",actionName:"replace-with-cancel-boundary",className:"bpmn-icon-intermediate-event-catch-cancel",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:CancelEventDefinition"}},{label:"Signal Boundary Event",actionName:"replace-with-signal-boundary",className:"bpmn-icon-intermediate-event-catch-signal",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}},{label:"Compensation Boundary Event",actionName:"replace-with-compensation-boundary",className:"bpmn-icon-intermediate-event-catch-compensation",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:CompensateEventDefinition"}},{label:"Message Boundary Event (non-interrupting)",actionName:"replace-with-non-interrupting-message-boundary",className:"bpmn-icon-intermediate-event-catch-non-interrupting-message",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:MessageEventDefinition",cancelActivity:!1}},{label:"Timer Boundary Event (non-interrupting)",actionName:"replace-with-non-interrupting-timer-boundary",className:"bpmn-icon-intermediate-event-catch-non-interrupting-timer",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:TimerEventDefinition",cancelActivity:!1}},{label:"Escalation Boundary Event (non-interrupting)",actionName:"replace-with-non-interrupting-escalation-boundary",className:"bpmn-icon-intermediate-event-catch-non-interrupting-escalation",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:EscalationEventDefinition",cancelActivity:!1}},{label:"Conditional Boundary Event (non-interrupting)",actionName:"replace-with-non-interrupting-conditional-boundary",className:"bpmn-icon-intermediate-event-catch-non-interrupting-condition",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition",cancelActivity:!1}},{label:"Signal Boundary Event (non-interrupting)",actionName:"replace-with-non-interrupting-signal-boundary",className:"bpmn-icon-intermediate-event-catch-non-interrupting-signal",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:SignalEventDefinition",cancelActivity:!1}}],Fp=[{label:"Message Start Event",actionName:"replace-with-message-start",className:"bpmn-icon-start-event-message",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},{label:"Timer Start Event",actionName:"replace-with-timer-start",className:"bpmn-icon-start-event-timer",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:TimerEventDefinition"}},{label:"Conditional Start Event",actionName:"replace-with-conditional-start",className:"bpmn-icon-start-event-condition",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition"}},{label:"Signal Start Event",actionName:"replace-with-signal-start",className:"bpmn-icon-start-event-signal",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}},{label:"Error Start Event",actionName:"replace-with-error-start",className:"bpmn-icon-start-event-error",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:ErrorEventDefinition"}},{label:"Escalation Start Event",actionName:"replace-with-escalation-start",className:"bpmn-icon-start-event-escalation",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:EscalationEventDefinition"}},{label:"Compensation Start Event",actionName:"replace-with-compensation-start",className:"bpmn-icon-start-event-compensation",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:CompensateEventDefinition"}},{label:"Message Start Event (non-interrupting)",actionName:"replace-with-non-interrupting-message-start",className:"bpmn-icon-start-event-non-interrupting-message",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:MessageEventDefinition",isInterrupting:!1}},{label:"Timer Start Event (non-interrupting)",actionName:"replace-with-non-interrupting-timer-start",className:"bpmn-icon-start-event-non-interrupting-timer",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:TimerEventDefinition",isInterrupting:!1}},{label:"Conditional Start Event (non-interrupting)",actionName:"replace-with-non-interrupting-conditional-start",className:"bpmn-icon-start-event-non-interrupting-condition",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition",isInterrupting:!1}},{label:"Signal Start Event (non-interrupting)",actionName:"replace-with-non-interrupting-signal-start",className:"bpmn-icon-start-event-non-interrupting-signal",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:SignalEventDefinition",isInterrupting:!1}},{label:"Escalation Start Event (non-interrupting)",actionName:"replace-with-non-interrupting-escalation-start",className:"bpmn-icon-start-event-non-interrupting-escalation",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:EscalationEventDefinition",isInterrupting:!1}}],Vp=[{label:"Sequence Flow",actionName:"replace-with-sequence-flow",className:"bpmn-icon-connection"},{label:"Default Flow",actionName:"replace-with-default-flow",className:"bpmn-icon-default-flow"},{label:"Conditional Flow",actionName:"replace-with-conditional-flow",className:"bpmn-icon-conditional-flow"}],$p=[{label:"Expanded Pool",actionName:"replace-with-expanded-pool",className:"bpmn-icon-participant",target:{type:"bpmn:Participant",isExpanded:!0}},{label:function(e){var t="Empty Pool";return e.children&&e.children.length&&(t+=" (removes content)"),t},actionName:"replace-with-collapsed-pool",className:"bpmn-icon-lane",target:{type:"bpmn:Participant",isExpanded:!1}}];function zp(e,t,n,i,r,o,a){this._bpmnFactory=e,this._popupMenu=t,this._modeling=n,this._moddle=i,this._bpmnReplace=r,this._rules=o,this._translate=a,this.register()}zp.$inject=["bpmnFactory","popupMenu","modeling","moddle","bpmnReplace","rules","translate"],zp.prototype.register=function(){this._popupMenu.registerProvider("bpmn-replace",this)},zp.prototype.getEntries=function(e){var t,n=e.businessObject;if(!this._rules.allowed("shape.replace",{element:e}))return[];var i=Op(e);return Dr(n,"bpmn:DataObjectReference")?this._createEntries(e,Ip):Dr(n,"bpmn:DataStoreReference")?this._createEntries(e,Np):Dr(n,"bpmn:StartEvent")&&!Dr(n.$parent,"bpmn:SubProcess")?(t=w(Cp,i),this._createEntries(e,t)):Dr(n,"bpmn:Participant")?(t=w($p,(function(e){return Nr(n)!==e.target.isExpanded})),this._createEntries(e,t)):Dr(n,"bpmn:StartEvent")&&Fr(n.$parent)?(t=w(Fp,(function(t){var n=!1!==t.target.isInterrupting,r=Br(e).isInterrupting===n;return i(t)||!i(t)&&!r})),this._createEntries(e,t)):Dr(n,"bpmn:StartEvent")&&!Fr(n.$parent)&&Dr(n.$parent,"bpmn:SubProcess")?(t=w(Tp,i),this._createEntries(e,t)):Dr(n,"bpmn:EndEvent")?(t=w(Rp,(function(e){return!("bpmn:CancelEventDefinition"==e.target.eventDefinitionType&&!Dr(n.$parent,"bpmn:Transaction"))&&i(e)})),this._createEntries(e,t)):Dr(n,"bpmn:BoundaryEvent")?(t=w(Lp,(function(e){var t=e.target;if("bpmn:CancelEventDefinition"==t.eventDefinitionType&&!Dr(n.attachedToRef,"bpmn:Transaction"))return!1;var r=!1!==t.cancelActivity,o=n.cancelActivity==r;return i(e)||!i(e)&&!o})),this._createEntries(e,t)):Dr(n,"bpmn:IntermediateCatchEvent")||Dr(n,"bpmn:IntermediateThrowEvent")?(t=w(Ap,i),this._createEntries(e,t)):Dr(n,"bpmn:Gateway")?(t=w(kp,i),this._createEntries(e,t)):Dr(n,"bpmn:Transaction")?(t=w(Mp,i),this._createEntries(e,t)):Fr(n)&&Nr(n)?(t=w(Dp,i),this._createEntries(e,t)):Dr(n,"bpmn:SubProcess")&&Nr(n)?(t=w(jp,i),this._createEntries(e,t)):Dr(n,"bpmn:AdHocSubProcess")&&!Nr(n)?(t=w(Bp,(function(t){var n=t.target,i="bpmn:SubProcess"===n.type,r=!0===n.isExpanded;return Op(e)&&(!i||r)})),this._createEntries(e,t)):Dr(n,"bpmn:SequenceFlow")?this._createSequenceFlowEntries(e,Vp):Dr(n,"bpmn:FlowNode")?(t=w(Bp,i),Dr(n,"bpmn:SubProcess")&&!Nr(n)&&(t=w(t,(function(e){return"Sub Process (collapsed)"!==e.label}))),this._createEntries(e,t)):[]},zp.prototype.getHeaderEntries=function(e){var t=[];return Dr(e,"bpmn:Activity")&&!Fr(e)&&(t=t.concat(this._getLoopEntries(e))),Dr(e,"bpmn:DataObjectReference")&&(t=t.concat(this._getDataObjectIsCollection(e))),Dr(e,"bpmn:Participant")&&(t=t.concat(this._getParticipantMultiplicity(e))),!Dr(e,"bpmn:SubProcess")||Dr(e,"bpmn:Transaction")||Fr(e)||t.push(this._getAdHocEntry(e)),t},zp.prototype._createEntries=function(e,t){var n=[],i=this;return _(t,(function(t){var r=i._createMenuEntry(t,e);n.push(r)})),n},zp.prototype._createSequenceFlowEntries=function(e,t){var n=Br(e),i=[],r=this._modeling,o=this._moddle,a=this;return _(t,(function(t){switch(t.actionName){case"replace-with-default-flow":n.sourceRef.default!==n&&(Dr(n.sourceRef,"bpmn:ExclusiveGateway")||Dr(n.sourceRef,"bpmn:InclusiveGateway")||Dr(n.sourceRef,"bpmn:ComplexGateway")||Dr(n.sourceRef,"bpmn:Activity"))&&i.push(a._createMenuEntry(t,e,(function(){r.updateProperties(e.source,{default:n})})));break;case"replace-with-conditional-flow":!n.conditionExpression&&Dr(n.sourceRef,"bpmn:Activity")&&i.push(a._createMenuEntry(t,e,(function(){var t=o.create("bpmn:FormalExpression",{body:""});r.updateProperties(e,{conditionExpression:t})})));break;default:if(Dr(n.sourceRef,"bpmn:Activity")&&n.conditionExpression)return i.push(a._createMenuEntry(t,e,(function(){r.updateProperties(e,{conditionExpression:void 0})})));if((Dr(n.sourceRef,"bpmn:ExclusiveGateway")||Dr(n.sourceRef,"bpmn:InclusiveGateway")||Dr(n.sourceRef,"bpmn:ComplexGateway")||Dr(n.sourceRef,"bpmn:Activity"))&&n.sourceRef.default===n)return i.push(a._createMenuEntry(t,e,(function(){r.updateProperties(e.source,{default:void 0})})))}})),i},zp.prototype._createMenuEntry=function(e,t,n){var i=this._translate,r=this._bpmnReplace.replaceElement,o=e.label;return o&&"function"==typeof o&&(o=o(t)),n=n||function(){return r(t,e.target)},{label:i(o),className:e.className,id:e.actionName,action:n}},zp.prototype._getLoopEntries=function(e){var t=this,n=this._translate;function i(n,i){var r;i.active?r=void 0:(r=t._moddle.create(i.options.loopCharacteristics),i.options.isSequential&&(r.isSequential=i.options.isSequential)),t._modeling.updateProperties(e,{loopCharacteristics:r})}var r,o,a,s=Br(e).loopCharacteristics;return s&&(r=s.isSequential,o=void 0===s.isSequential,a=void 0!==s.isSequential&&!s.isSequential),[{id:"toggle-parallel-mi",className:"bpmn-icon-parallel-mi-marker",title:n("Parallel Multi Instance"),active:a,action:i,options:{loopCharacteristics:"bpmn:MultiInstanceLoopCharacteristics",isSequential:!1}},{id:"toggle-sequential-mi",className:"bpmn-icon-sequential-mi-marker",title:n("Sequential Multi Instance"),active:r,action:i,options:{loopCharacteristics:"bpmn:MultiInstanceLoopCharacteristics",isSequential:!0}},{id:"toggle-loop",className:"bpmn-icon-loop-marker",title:n("Loop"),active:o,action:i,options:{loopCharacteristics:"bpmn:StandardLoopCharacteristics"}}]},zp.prototype._getDataObjectIsCollection=function(e){var t=this,n=this._translate;var i=e.businessObject.dataObjectRef,r=i.isCollection;return[{id:"toggle-is-collection",className:"bpmn-icon-parallel-mi-marker",title:n("Collection"),active:r,action:function(n,r){t._modeling.updateModdleProperties(e,i,{isCollection:!r.active})}}]},zp.prototype._getParticipantMultiplicity=function(e){var t=this,n=this._bpmnFactory,i=this._translate;var r=e.businessObject.participantMultiplicity;return[{id:"toggle-participant-multiplicity",className:"bpmn-icon-parallel-mi-marker",title:i("Participant Multiplicity"),active:!!r,action:function(i,r){var o;r.active||(o=n.create("bpmn:ParticipantMultiplicity")),t._modeling.updateProperties(e,{participantMultiplicity:o})}}]},zp.prototype._getAdHocEntry=function(e){var t=this._translate,n=Dr(Br(e),"bpmn:AdHocSubProcess"),i=this._bpmnReplace.replaceElement;return{id:"toggle-adhoc",className:"bpmn-icon-ad-hoc-marker",title:t("Ad-hoc"),active:n,action:function(t,r){return i(e,n?{type:"bpmn:SubProcess"}:{type:"bpmn:AdHocSubProcess"},{autoResize:!1,layoutConnection:!1})}}};var qp={__depends__:[ep,Sp],__init__:["replaceMenuProvider"],replaceMenuProvider:["type",zp]},Up=Math.max,Gp=Math.min;function Hp(e,t){return{top:e.top-t.top,right:e.right-t.right,bottom:e.bottom-t.bottom,left:e.left-t.left}}function Wp(e,t,n){var i=t[e],r=n.min&&n.min[e],o=n.max&&n.max[e];return f(r)&&(i=(/top|left/.test(e)?Gp:Up)(i,r)),f(o)&&(i=(/top|left/.test(e)?Up:Gp)(i,o)),i}function Kp(e,t){return void 0!==e?e:20}function Xp(e){return!e.waypoints&&"label"!==e.type}function Yp(e,t){var n;if((n=void 0===e.length?w(e.children,Xp):e).length)return function(e,t){var n,i,r,o;return"object"==typeof t?(n=Kp(t.left),i=Kp(t.right),r=Kp(t.top),o=Kp(t.bottom)):n=i=r=o=Kp(t),{x:e.x-n,y:e.y-r,width:e.width+n+i,height:e.height+r+o}}(ft(n),t)}var Jp=Math.abs;var Zp=["bpmn:Participant","bpmn:Process","bpmn:SubProcess"],Qp=30;function eu(e,t){return t=t||[],e.children.filter((function(e){Dr(e,"bpmn:Lane")&&(eu(e,t),t.push(e))})),t}function tu(e){return e.children.filter((function(e){return Dr(e,"bpmn:Lane")}))}function nu(e){return es(e,Zp)||e}function iu(e,t){var n=nu(e),i=eu(n,Dr(n,"bpmn:Process")?[]:[n]),r=hn(e),o=hn(t),a=function(e,t){return Hp(hn(t),hn(e))}(e,t),s=[];return i.forEach((function(t){if(t!==e){var n,i,c=0,p=a.right,u=0,l=a.left,d=hn(t);a.top&&(Jp(d.bottom-r.top)<10&&(u=o.top-d.bottom),Jp(d.top-r.top)<5&&(c=o.top-d.top)),a.bottom&&(Jp(d.top-r.bottom)<10&&(c=o.bottom-d.top),Jp(d.bottom-r.bottom)<5&&(u=o.bottom-d.bottom)),(c||p||u||l)&&s.push({shape:t,newBounds:(n=t,i={top:c,right:p,bottom:u,left:l},{x:n.x+(i.left||0),y:n.y+(i.top||0),width:n.width-(i.left||0)+(i.right||0),height:n.height-(i.top||0)+(i.bottom||0)})})}})),s}function ru(e,t,n,i,r,o,a,s,c,p,u,l){e=e||{},i.registerProvider(this),this._contextPad=i,this._modeling=r,this._elementFactory=o,this._connect=a,this._create=s,this._popupMenu=c,this._canvas=p,this._rules=u,this._translate=l,!1!==e.autoPlace&&(this._autoPlace=t.get("autoPlace",!1)),n.on("create.end",250,(function(e){var t=e.context.shape;if(jo(e)&&i.isOpen(t)){var n=i.getEntries(t);n.replace&&n.replace.action.click(e,t)}}))}function ou(e,t,n){var i=e.$instanceOf(t),r=!1;return _(e.eventDefinitions||[],(function(e){e.$type===n&&(r=!0)})),i&&r}ru.$inject=["config.contextPad","injector","eventBus","contextPad","modeling","elementFactory","connect","create","popupMenu","canvas","rules","translate"],ru.prototype.getContextPadEntries=function(e){var t=this._contextPad,n=this._modeling,i=this._elementFactory,r=this._connect,o=this._create,a=this._popupMenu,s=this._canvas,c=this._rules,p=this._autoPlace,u=this._translate,l={};if("label"===e.type)return l;var d=e.businessObject;function m(e,t){r.start(e,t)}function f(e,t,n,r){function a(t,n){var a=i.createShape(U({type:e},r));o.start(t,a,{source:n})}return"string"!=typeof n&&(r=n,n=u("Append {type}",{type:e.replace(/^bpmn:/,"")})),{group:"model",className:t,title:n,action:{dragstart:a,click:p?function(t,n){var o=i.createShape(U({type:e},r));p.append(n,o)}:a}}}function v(e){return function(i,r){n.splitLane(r,e),t.open(r,!0)}}if(Qa(d,["bpmn:Lane","bpmn:Participant"])&&Nr(d)){var y=tu(e);U(l,{"lane-insert-above":{group:"lane-insert-above",className:"bpmn-icon-lane-insert-above",title:u("Add Lane above"),action:{click:function(e,t){n.addLane(t,"top")}}}}),y.length<2&&(e.height>=120&&U(l,{"lane-divide-two":{group:"lane-divide",className:"bpmn-icon-lane-divide-two",title:u("Divide into two Lanes"),action:{click:v(2)}}}),e.height>=180&&U(l,{"lane-divide-three":{group:"lane-divide",className:"bpmn-icon-lane-divide-three",title:u("Divide into three Lanes"),action:{click:v(3)}}})),U(l,{"lane-insert-below":{group:"lane-insert-below",className:"bpmn-icon-lane-insert-below",title:u("Add Lane below"),action:{click:function(e,t){n.addLane(t,"bottom")}}}})}Dr(d,"bpmn:FlowNode")&&(Dr(d,"bpmn:EventBasedGateway")?U(l,{"append.receive-task":f("bpmn:ReceiveTask","bpmn-icon-receive-task",u("Append ReceiveTask")),"append.message-intermediate-event":f("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-message",u("Append MessageIntermediateCatchEvent"),{eventDefinitionType:"bpmn:MessageEventDefinition"}),"append.timer-intermediate-event":f("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-timer",u("Append TimerIntermediateCatchEvent"),{eventDefinitionType:"bpmn:TimerEventDefinition"}),"append.condition-intermediate-event":f("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-condition",u("Append ConditionIntermediateCatchEvent"),{eventDefinitionType:"bpmn:ConditionalEventDefinition"}),"append.signal-intermediate-event":f("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-signal",u("Append SignalIntermediateCatchEvent"),{eventDefinitionType:"bpmn:SignalEventDefinition"})}):ou(d,"bpmn:BoundaryEvent","bpmn:CompensateEventDefinition")?U(l,{"append.compensation-activity":f("bpmn:Task","bpmn-icon-task",u("Append compensation activity"),{isForCompensation:!0})}):Dr(d,"bpmn:EndEvent")||d.isForCompensation||ou(d,"bpmn:IntermediateThrowEvent","bpmn:LinkEventDefinition")||Fr(d)||U(l,{"append.end-event":f("bpmn:EndEvent","bpmn-icon-end-event-none",u("Append EndEvent")),"append.gateway":f("bpmn:ExclusiveGateway","bpmn-icon-gateway-none",u("Append Gateway")),"append.append-task":f("bpmn:Task","bpmn-icon-task",u("Append Task")),"append.intermediate-event":f("bpmn:IntermediateThrowEvent","bpmn-icon-intermediate-event-none",u("Append Intermediate/Boundary Event"))})),a.isEmpty(e,"bpmn-replace")||U(l,{replace:{group:"edit",className:"bpmn-icon-screw-wrench",title:u("Change type"),action:{click:function(e,n){var i=U(function(e){var n=s.getContainer(),i=t.getPad(e).html,r=n.getBoundingClientRect(),o=i.getBoundingClientRect(),a=o.top-r.top;return{x:o.left-r.left,y:a+o.height+5}}(n),{cursor:{x:e.x,y:e.y}});a.open(n,"bpmn-replace",i)}}}}),Qa(d,["bpmn:FlowNode","bpmn:InteractionNode","bpmn:DataObjectReference","bpmn:DataStoreReference"])&&U(l,{"append.text-annotation":f("bpmn:TextAnnotation","bpmn-icon-text-annotation"),connect:{group:"connect",className:"bpmn-icon-connection-multi",title:u("Connect using "+(d.isForCompensation?"":"Sequence/MessageFlow or ")+"Association"),action:{click:m,dragstart:m}}}),Dr(d,"bpmn:TextAnnotation")&&U(l,{connect:{group:"connect",className:"bpmn-icon-connection-multi",title:u("Connect using Association"),action:{click:m,dragstart:m}}}),Qa(d,["bpmn:DataObjectReference","bpmn:DataStoreReference"])&&U(l,{connect:{group:"connect",className:"bpmn-icon-connection-multi",title:u("Connect using DataInputAssociation"),action:{click:m,dragstart:m}}}),Dr(d,"bpmn:Group")&&U(l,{"append.text-annotation":f("bpmn:TextAnnotation","bpmn-icon-text-annotation")});var g=c.allowed("elements.delete",{elements:[e]});return h(g)&&(g=g[0]===e),g&&U(l,{delete:{group:"edit",className:"bpmn-icon-trash",title:u("Remove"),action:{click:function(t){n.removeElements([e])}}}}),l};var au={__depends__:[jc,Bc,Ho,_c,Yc,qp],__init__:["contextPadProvider"],contextPadProvider:["type",ru]},su={horizontal:["x","width"],vertical:["y","height"]};function cu(e){this._modeling=e,this._filters=[],this.registerFilter((function(e,t,n){var i,r=0,o=0;return _(e,(function(e){e.waypoints||e.labelTarget||(r+=e[n],o+=1)})),i=Math.round(r/o),w(e,(function(e){return e[n]<i+50}))}))}cu.$inject=["modeling"],cu.prototype.registerFilter=function(e){if("function"!=typeof e)throw new Error("the filter has to be a function");this._filters.push(e)},cu.prototype.trigger=function(e,t){var n,i,r=this._modeling;if(!(e.length<3||(this._setOrientation(t),i=this._filterElements(e),(n=this._createGroups(i)).length<=2)))return r.distributeElements(n,this._axis,this._dimension),n},cu.prototype._filterElements=function(e){var t=this._filters,n=this._axis,i=this._dimension,r=[].concat(e);return t.length?(_(t,(function(e){r=e(r,n,i)})),r):e},cu.prototype._createGroups=function(e){var t=[],n=this,i=this._axis,r=this._dimension;if(!i)throw new Error('must have a defined "axis" and "dimension"');return _(B(e,i),(function(e,o){var a,s=n._findRange(e,i,r),c=t[t.length-1];c&&n._hasIntersection(c.range,s)?t[t.length-1].elements.push(e):(a={range:s,elements:[e]},t.push(a))})),t},cu.prototype._setOrientation=function(e){var t=su[e];this._axis=t[0],this._dimension=t[1]},cu.prototype._hasIntersection=function(e,t){return Math.max(e.min,e.max)>=Math.min(t.min,t.max)&&Math.min(e.min,e.max)<=Math.max(t.min,t.max)},cu.prototype._findRange=function(e){var t=e[this._axis];return{min:t+5,max:t+e[this._dimension]-5}};var pu={__init__:["distributeElements"],distributeElements:["type",cu]};function uu(e){e.registerFilter((function(e){return w(e,(function(e){var t=Qa(e,["bpmn:Association","bpmn:BoundaryEvent","bpmn:DataInputAssociation","bpmn:DataOutputAssociation","bpmn:Lane","bpmn:MessageFlow","bpmn:Participant","bpmn:SequenceFlow","bpmn:TextAnnotation"]);return!(e.labelTarget||t)}))}))}uu.$inject=["distributeElements"];var lu={__depends__:[pu],__init__:["bpmnDistributeElements"],bpmnDistributeElements:["type",uu]},du="is not a registered action";function hu(e,t){this._actions={};var n=this;e.on("diagram.init",(function(){n._registerDefaultActions(t),e.fire("editorActions.init",{editorActions:n})}))}function mu(e,t){return new Error(e+" "+t)}hu.$inject=["eventBus","injector"],hu.prototype._registerDefaultActions=function(e){var t=e.get("commandStack",!1),n=e.get("modeling",!1),i=e.get("selection",!1),r=e.get("zoomScroll",!1),o=e.get("copyPaste",!1),a=e.get("canvas",!1),s=e.get("rules",!1),c=e.get("keyboardMove",!1),p=e.get("keyboardMoveSelection",!1);t&&(this.register("undo",(function(){t.undo()})),this.register("redo",(function(){t.redo()}))),o&&i&&this.register("copy",(function(){var e=i.get();o.copy(e)})),o&&this.register("paste",(function(){o.paste()})),r&&this.register("stepZoom",(function(e){r.stepZoom(e.value)})),a&&this.register("zoom",(function(e){a.zoom(e.value)})),n&&i&&s&&this.register("removeSelection",(function(){var e=i.get();if(e.length){var t,r=s.allowed("elements.delete",{elements:e});!1!==r&&(t=h(r)?r:e).length&&n.removeElements(t.slice())}})),c&&this.register("moveCanvas",(function(e){c.moveCanvas(e)})),p&&this.register("moveSelection",(function(e){p.moveSelection(e.direction,e.accelerated)}))},hu.prototype.trigger=function(e,t){if(!this._actions[e])throw mu(e,du);return this._actions[e](t)},hu.prototype.register=function(e,t){var n=this;if("string"==typeof e)return this._registerAction(e,t);_(e,(function(e,t){n._registerAction(t,e)}))},hu.prototype._registerAction=function(e,t){if(this.isRegistered(e))throw mu(e,"is already registered");this._actions[e]=t},hu.prototype.unregister=function(e){if(!this.isRegistered(e))throw mu(e,du);this._actions[e]=void 0},hu.prototype.getActions=function(){return Object.keys(this._actions)},hu.prototype.isRegistered=function(e){return!!this._actions[e]};var fu={__init__:["editorActions"],editorActions:["type",hu]};function vu(e){e.invoke(hu,this)}i(vu,hu),vu.$inject=["injector"],vu.prototype._registerDefaultActions=function(e){hu.prototype._registerDefaultActions.call(this,e);var t=e.get("canvas",!1),n=e.get("elementRegistry",!1),i=e.get("selection",!1),r=e.get("spaceTool",!1),o=e.get("lassoTool",!1),a=e.get("handTool",!1),s=e.get("globalConnect",!1),c=e.get("distributeElements",!1),p=e.get("alignElements",!1),u=e.get("directEditing",!1),l=e.get("searchPad",!1),d=e.get("modeling",!1);t&&n&&i&&this._registerAction("selectElements",(function(){var e=t.getRootElement(),r=n.filter((function(t){return t!==e}));return i.select(r),r})),r&&this._registerAction("spaceTool",(function(){r.toggle()})),o&&this._registerAction("lassoTool",(function(){o.toggle()})),a&&this._registerAction("handTool",(function(){a.toggle()})),s&&this._registerAction("globalConnectTool",(function(){s.toggle()})),i&&c&&this._registerAction("distributeElements",(function(e){var t=i.get(),n=e.type;t.length&&c.trigger(t,n)})),i&&p&&this._registerAction("alignElements",(function(e){var t=i.get(),n=[],r=e.type;t.length&&(n=w(t,(function(e){return!Dr(e,"bpmn:Lane")})),p.trigger(n,r))})),i&&d&&this._registerAction("setColor",(function(e){var t=i.get();t.length&&d.setColor(t,e)})),i&&u&&this._registerAction("directEditing",(function(){var e=i.get();e.length&&u.activate(e[0])})),l&&this._registerAction("find",(function(){l.toggle()})),t&&d&&this._registerAction("moveToOrigin",(function(){var e,i,r=t.getRootElement();e=ft(i=Dr(r,"bpmn:Collaboration")?n.filter((function(e){return Dr(e.parent,"bpmn:Collaboration")})):n.filter((function(e){return e!==r&&!Dr(e.parent,"bpmn:SubProcess")}))),d.moveElements(i,{x:-e.x,y:-e.y},r)}))};var yu={__depends__:[fu],editorActions:["type",vu]};function gu(e){e.on(["create.init","shape.move.init"],(function(e){var t=e.context;Qa(e.shape,["bpmn:Participant","bpmn:SubProcess","bpmn:TextAnnotation"])&&(t.gridSnappingContext||(t.gridSnappingContext={}),t.gridSnappingContext.snapLocation="top-left")}))}gu.$inject=["eventBus"];function bu(e,t,n){return n||(n="round"),Math[n](e/t)*t}function xu(e,t,n){var i=!n||!1!==n.active;this._eventBus=t;var r=this;t.on("diagram.init",800,(function(){r.setActive(i)})),t.on(["create.move","create.end","bendpoint.move.move","bendpoint.move.end","connect.move","connect.end","connectionSegment.move.move","connectionSegment.move.end","resize.move","resize.end","shape.move.move","shape.move.end"],1200,(function(t){var n=t.originalEvent;if(!(!r.active||n&&ta(n))){var i=t.context,o=i.gridSnappingContext;o||(o=i.gridSnappingContext={}),["x","y"].forEach((function(n){var i={},o=function(e,t,n){var i=e.context,r=e.shape,o=i.gridSnappingContext,a=o.snapLocation,s=o.snapOffset;if(s&&f(s[t]))return s[t];s||(s=o.snapOffset={});f(s[t])||(s[t]=0);if(!r)return s[t];n.get(r.id)||(Eu(t)?s[t]+=r[t]+r.width/2:s[t]+=r[t]+r.height/2);if(!a)return s[t];"x"===t?/left/.test(a)?s[t]-=r.width/2:/right/.test(a)&&(s[t]+=r.width/2):/top/.test(a)?s[t]-=r.height/2:/bottom/.test(a)&&(s[t]+=r.height/2);return s[t]}(t,n,e);o&&(i.offset=o);var a=function(e,t){var n=e.context,i=n.createConstraints,r=n.resizeConstraints||{},o=n.gridSnappingContext,a=o.snapConstraints;if(a&&a[t])return a[t];a||(a=o.snapConstraints={});a[t]||(a[t]={});var s=n.direction;i&&(Eu(t)?(a.x.min=i.left,a.x.max=i.right):(a.y.min=i.top,a.y.max=i.bottom));var c=r.min,p=r.max;c&&(Eu(t)?_u(s)?a.x.max=c.left:a.x.min=c.right:wu(s)?a.y.max=c.top:a.y.min=c.bottom);p&&(Eu(t)?_u(s)?a.x.min=p.left:a.x.max=p.right:wu(s)?a.y.min=p.top:a.y.max=p.bottom);return a[t]}(t,n);a&&U(i,a),lc(t,n)||r.snapEvent(t,n,i)}))}}))}function Eu(e){return"x"===e}function wu(e){return-1!==e.indexOf("n")}function _u(e){return-1!==e.indexOf("w")}function Pu(e,t){as.call(this,e),this._gridSnapping=t;var n=this;this.preExecute("shape.resize",(function(e){var t=e.context,i=(t.hints||{}).autoResize;if(i){var r=t.shape,o=t.newBounds;y(i)?t.newBounds=n.snapComplex(o,i):t.newBounds=n.snapSimple(r,o)}}))}xu.prototype.snapEvent=function(e,t,n){dc(e,t,this.snapValue(e[t],n))},xu.prototype.getGridSpacing=function(){return 10},xu.prototype.snapValue=function(e,t){var n,i,r=0;return t&&t.offset&&(r=t.offset),e=bu(e+=r,10),t&&t.min&&f(n=t.min)&&(n=bu(n+r,10,"ceil"),e=Math.max(e,n)),t&&t.max&&f(i=t.max)&&(i=bu(i+r,10,"floor"),e=Math.min(e,i)),e-=r},xu.prototype.isActive=function(){return this.active},xu.prototype.setActive=function(e){this.active=e,this._eventBus.fire("gridSnapping.toggle",{active:e})},xu.prototype.toggleActive=function(){this.setActive(!this.active)},xu.$inject=["elementRegistry","eventBus","config.gridSnapping"],Pu.$inject=["eventBus","gridSnapping","modeling"],i(Pu,as),Pu.prototype.snapSimple=function(e,t){var n=this._gridSnapping;return t.width=n.snapValue(t.width,{min:t.width}),t.height=n.snapValue(t.height,{min:t.height}),t.x=e.x+e.width/2-t.width/2,t.y=e.y+e.height/2-t.height/2,t},Pu.prototype.snapComplex=function(e,t){return/w|e/.test(t)&&(e=this.snapHorizontally(e,t)),/n|s/.test(t)&&(e=this.snapVertically(e,t)),e},Pu.prototype.snapHorizontally=function(e,t){var n=this._gridSnapping,i=/w/.test(t),r=/e/.test(t),o={};return o.width=n.snapValue(e.width,{min:e.width}),r&&(i?(o.x=n.snapValue(e.x,{max:e.x}),o.width+=n.snapValue(e.x-o.x,{min:e.x-o.x})):e.x=e.x+e.width-o.width),U(e,o),e},Pu.prototype.snapVertically=function(e,t){var n=this._gridSnapping,i=/n/.test(t),r=/s/.test(t),o={};return o.height=n.snapValue(e.height,{min:e.height}),i&&(r?(o.y=n.snapValue(e.y,{max:e.y}),o.height+=n.snapValue(e.y-o.y,{min:e.y-o.y})):e.y=e.y+e.height-o.height),U(e,o),e};function Su(e,t){e.on(["spaceTool.move","spaceTool.end"],2e3,(function(e){var n,i=e.context;i.initialized&&("x"===i.axis?(n=t.snapValue(e.dx),e.x=e.x+n-e.dx,e.dx=n):(n=t.snapValue(e.dy),e.y=e.y+n-e.dy,e.dy=n))}))}Su.$inject=["eventBus","gridSnapping"];var Ou={__depends__:[{__init__:["gridSnappingResizeBehavior","gridSnappingSpaceToolBehavior"],gridSnappingResizeBehavior:["type",Pu],gridSnappingSpaceToolBehavior:["type",Su]}],__init__:["gridSnapping"],gridSnapping:["type",xu]};function Cu(e,t){e.on("autoPlace",2e3,(function(e){var n=e.source,i=fn(n),r=e.shape,o=ns(n,r);return["x","y"].forEach((function(e){var n={};o[e]!==i[e]&&(o[e]>i[e]?n.min=o[e]:n.max=o[e],Dr(r,"bpmn:TextAnnotation")&&(!function(e){return"x"===e}(e)?n.offset=-r.height/2:n.offset=-r.width/2),o[e]=t.snapValue(o[e],n))})),o}))}Cu.$inject=["eventBus","gridSnapping"];function Tu(e,t,n){t.on(["create.start","shape.move.start"],1750,(function(t){var i=t.context,r=i.shape,o=e.getRootElement();Dr(r,"bpmn:Participant")&&Dr(o,"bpmn:Process")&&o.children.length&&(i.createConstraints&&(r.width=n.snapValue(r.width,{min:r.width}),r.height=n.snapValue(r.height,{min:r.height})))}))}Tu.$inject=["canvas","eventBus","gridSnapping"];function Au(e,t,n){as.call(this,e),this._gridSnapping=t;var i=this;this.postExecuted(["connection.create","connection.layout"],3e3,(function(e){var t=e.context,r=t.connection,o=t.hints||{},a=r.waypoints;o.connectionStart||o.connectionEnd||!1===o.createElementsBehavior||function(e){return e.length>3}(a)&&n.updateWaypoints(r,i.snapMiddleSegments(a))}))}function Ru(e,t,n){var i=Ct(t,n),r={};return function(e){return"h"===e}(i)&&(r.y=e.snapValue(t.y)),function(e){return"v"===e}(i)&&(r.x=e.snapValue(t.x)),("x"in r||"y"in r)&&(t=U({},t,r),n=U({},n,r)),[t,n]}Au.$inject=["eventBus","gridSnapping","modeling"],i(Au,as),Au.prototype.snapMiddleSegments=function(e){var t,n=this._gridSnapping;e=e.slice();for(var i=1;i<e.length-2;i++)t=Ru(n,e[i],e[i+1]),e[i]=t[0],e[i+1]=t[1];return e};var ku={__depends__:[Ou,{__init__:["gridSnappingAutoPlaceBehavior","gridSnappingCreateParticipantBehavior","gridSnappingLayoutConnectionBehavior"],gridSnappingAutoPlaceBehavior:["type",Cu],gridSnappingCreateParticipantBehavior:["type",Tu],gridSnappingLayoutConnectionBehavior:["type",Au]}],__init__:["bpmnGridSnapping"],bpmnGridSnapping:["type",gu]};function ju(e,t){this._interactionEvents=t;var n=this;e.on(["interactionEvents.createHit","interactionEvents.updateHit"],(function(e){var t=e.element,i=e.gfx;return Dr(t,"bpmn:Lane")?n.createParticipantHit(t,i):Dr(t,"bpmn:Participant")?Nr(t)?n.createParticipantHit(t,i):n.createDefaultHit(t,i):Dr(t,"bpmn:SubProcess")?Nr(t)?n.createSubProcessHit(t,i):n.createDefaultHit(t,i):void 0}))}ju.$inject=["eventBus","interactionEvents"],ju.prototype.createDefaultHit=function(e,t){return this._interactionEvents.removeHits(t),this._interactionEvents.createDefaultHit(e,t),!0},ju.prototype.createParticipantHit=function(e,t){return this._interactionEvents.removeHits(t),this._interactionEvents.createBoxHit(t,"click-stroke",{width:e.width,height:e.height}),this._interactionEvents.createBoxHit(t,"all",{width:30,height:e.height}),!0},ju.prototype.createSubProcessHit=function(e,t){return this._interactionEvents.removeHits(t),this._interactionEvents.createBoxHit(t,"click-stroke",{width:e.width,height:e.height}),this._interactionEvents.createBoxHit(t,"all",{width:e.width,height:30}),!0};var Mu={__init__:["bpmnInteractionEvents"],bpmnInteractionEvents:["type",ju]};function Du(e){e.invoke(la,this)}i(Du,la),Du.$inject=["injector"],Du.prototype.registerBindings=function(e,t){function n(n,i){t.isRegistered(n)&&e.addListener(i)}la.prototype.registerBindings.call(this,e,t),n("selectElements",(function(n){var i=n.keyEvent;if(e.isKey(["a","A"],i)&&e.isCmd(i))return t.trigger("selectElements"),!0})),n("find",(function(n){var i=n.keyEvent;if(e.isKey(["f","F"],i)&&e.isCmd(i))return t.trigger("find"),!0})),n("spaceTool",(function(n){var i=n.keyEvent;if(!e.hasModifier(i))return e.isKey(["s","S"],i)?(t.trigger("spaceTool"),!0):void 0})),n("lassoTool",(function(n){var i=n.keyEvent;if(!e.hasModifier(i))return e.isKey(["l","L"],i)?(t.trigger("lassoTool"),!0):void 0})),n("handTool",(function(n){var i=n.keyEvent;if(!e.hasModifier(i))return e.isKey(["h","H"],i)?(t.trigger("handTool"),!0):void 0})),n("globalConnectTool",(function(n){var i=n.keyEvent;if(!e.hasModifier(i))return e.isKey(["c","C"],i)?(t.trigger("globalConnectTool"),!0):void 0})),n("directEditing",(function(n){var i=n.keyEvent;if(!e.hasModifier(i))return e.isKey(["e","E"],i)?(t.trigger("directEditing"),!0):void 0}))};var Bu={__depends__:[da],__init__:["keyboardBindings"],keyboardBindings:["type",Du]},Iu={moveSpeed:1,moveSpeedAccelerated:10},Nu="left",Lu="right",Fu="down",Vu={ArrowLeft:Nu,Left:Nu,ArrowUp:"up",Up:"up",ArrowRight:Lu,Right:Lu,ArrowDown:Fu,Down:Fu},$u={left:function(e){return{x:-e,y:0}},up:function(e){return{x:0,y:-e}},right:function(e){return{x:e,y:0}},down:function(e){return{x:0,y:e}}};function zu(e,t,n,i,r){var o=this;this._config=U({},Iu,e||{}),t.addListener(1500,(function(e){var n=e.keyEvent,i=Vu[n.key];if(i&&!t.isCmd(n)){var r=t.isShift(n);return o.moveSelection(i,r),!0}})),this.moveSelection=function(e,t){var o=r.get();if(o.length){var a=this._config[t?"moveSpeedAccelerated":"moveSpeed"],s=$u[e](a);i.allowed("elements.move",{shapes:o})&&n.moveElements(o,s)}}}zu.$inject=["config.keyboardMoveSelection","keyboard","modeling","rules","selection"];var qu={__depends__:[da,Ho],__init__:["keyboardMoveSelection"],keyboardMoveSelection:["type",zu]};function Uu(e,t,n,i){e.on("element.changed",(function(i){var r=i.element;(r.parent||r===t.getRootElement())&&(i.gfx=n.getGraphics(r)),i.gfx&&e.fire(vt(r)+".changed",i)})),e.on("elements.changed",(function(t){var n=t.elements;n.forEach((function(t){e.fire("element.changed",{element:t})})),i.updateContainments(n)})),e.on("shape.changed",(function(e){i.update("shape",e.element,e.gfx)})),e.on("connection.changed",(function(e){i.update("connection",e.element,e.gfx)}))}Uu.$inject=["eventBus","canvas","elementRegistry","graphicsFactory"];var Gu={__init__:["changeSupport"],changeSupport:["type",Uu]};function Hu(e,t,n,i){this._dragging=i,this._rules=t;var r=this;function o(e,t){var n,i=e.shape,o=e.direction,a=e.resizeConstraints;e.delta=t,n=function(e,t,n){var i=n.x,r=n.y,o={x:e.x,y:e.y,width:e.width,height:e.height};return-1!==t.indexOf("n")?(o.y=e.y+r,o.height=e.height-r):-1!==t.indexOf("s")&&(o.height=e.height+r),-1!==t.indexOf("e")?o.width=e.width+i:-1!==t.indexOf("w")&&(o.x=e.x+i,o.width=e.width-i),o}(i,o,t),e.newBounds=function(e,t){if(!t)return e;var n=hn(e);return mn({top:Wp("top",n,t),right:Wp("right",n,t),bottom:Wp("bottom",n,t),left:Wp("left",n,t)})}(n,a),e.canExecute=r.canResize(e)}e.on("resize.start",(function(e){var t,n,i;t=e.context,n=t.resizeConstraints,i=t.minBounds,void 0===n&&(void 0===i&&(i=r.computeMinResizeBox(t)),t.resizeConstraints={min:hn(i)})})),e.on("resize.move",(function(e){var t={x:e.dx,y:e.dy};o(e.context,t)})),e.on("resize.end",(function(e){!function(e){var t=e.shape,i=e.canExecute,r=e.newBounds;if(i){if(!function(e,t){return e.x!==t.x||e.y!==t.y||e.width!==t.width||e.height!==t.height}(t,r=ln(r)))return;n.resizeShape(t,r)}}(e.context)}))}function Wu(e,t){var n=fn(e),i=hn(e),r={x:n.x,y:n.y};return-1!==t.indexOf("n")?r.y=i.top:-1!==t.indexOf("s")&&(r.y=i.bottom),-1!==t.indexOf("e")?r.x=i.right:-1!==t.indexOf("w")&&(r.x=i.left),r}function Ku(e){return"n"===e||"s"===e?"resize-ns":"e"===e||"w"===e?"resize-ew":"nw"===e||"se"===e?"resize-nwse":"resize-nesw"}Hu.prototype.canResize=function(e){var t=this._rules,n=G(e,["newBounds","shape","delta","direction"]);return t.allowed("shape.resize",n)},Hu.prototype.activate=function(e,t,n){var i,r,o=this._dragging;if("string"==typeof n&&(n={direction:n}),!(r=(i=U({shape:t},n)).direction))throw new Error("must provide a direction (n|w|s|e|nw|se|ne|sw)");o.init(e,Wu(t,r),"resize",{autoActivate:!0,cursor:Ku(r),data:{shape:t,context:i}})},Hu.prototype.computeMinResizeBox=function(e){var t=e.shape;return function(e,t,n,i){var r=hn(t),o={top:/n/.test(e)?r.bottom-n.height:r.top,left:/w/.test(e)?r.right-n.width:r.left,bottom:/s/.test(e)?r.top+n.height:r.bottom,right:/e/.test(e)?r.left+n.width:r.right},a=i?hn(i):o;return mn({top:Gp(o.top,a.top),left:Gp(o.left,a.left),bottom:Up(o.bottom,a.bottom),right:Up(o.right,a.right)})}(e.direction,t,e.minDimensions||{width:10,height:10},Yp(t,e.childrenBoxPadding))},Hu.$inject=["eventBus","rules","modeling","dragging"];var Xu="djs-resizing",Yu="resize-not-ok";function Ju(e,t,n){e.on("resize.move",500,(function(e){var i,r,o,a;i=e.context,r=i.shape,o=i.newBounds,(a=i.frame)||(a=i.frame=n.addFrame(r,t.getActiveLayer()),t.addMarker(r,Xu)),o.width>5&&Pe(a,{x:o.x,width:o.width}),o.height>5&&Pe(a,{y:o.y,height:o.height}),i.canExecute?Ae(a).remove(Yu):Ae(a).add(Yu)})),e.on("resize.cleanup",(function(e){var n,i;n=e.context,i=n.shape,n.frame&&ke(n.frame),t.removeMarker(i,Xu)}))}Ju.$inject=["eventBus","canvas","previewSupport"];var Zu=-6,Qu="djs-resizer",el=["n","w","s","e","nw","ne","se","sw"];function tl(e,t,n,i){this._resize=i,this._canvas=t;var r=this;e.on("selection.changed",(function(e){var t=e.newSelection;r.removeResizers(),1===t.length&&_(t,z(r.addResizer,r))})),e.on("shape.changed",(function(e){var t=e.element;n.isSelected(t)&&(r.removeResizers(),r.addResizer(t))}))}tl.prototype.makeDraggable=function(e,t,n){var i=this._resize;function r(t){ko(t)&&i.activate(t,e,n)}pe.bind(t,"mousedown",r),pe.bind(t,"touchstart",r)},tl.prototype._createResizer=function(e,t,n,i){var r=this._getResizersParent(),o=function(e){var t={x:0,y:0};-1!==e.indexOf("e")?t.x=6:-1!==e.indexOf("w")&&(t.x=Zu);-1!==e.indexOf("s")?t.y=6:-1!==e.indexOf("n")&&(t.y=Zu);return t}(i),a=Ne("g");Ae(a).add(Qu),Ae(a).add("djs-resizer-"+e.id),Ae(a).add("djs-resizer-"+i),Ee(r,a);var s=Ne("rect");Pe(s,{x:-2+o.x,y:-2+o.y,width:4,height:4}),Ae(s).add("djs-resizer-visual"),Ee(a,s);var c=Ne("rect");return Pe(c,{x:-10+o.x,y:-10+o.y,width:20,height:20}),Ae(c).add("djs-resizer-hit"),Ee(a,c),Xn(a,t,n),a},tl.prototype.createResizer=function(e,t){var n=Wu(e,t),i=this._createResizer(e,n.x,n.y,t);this.makeDraggable(e,i,t)},tl.prototype.addResizer=function(e){var t=this;this._resize.canResize({shape:e})&&_(el,(function(n){t.createResizer(e,n)}))},tl.prototype.removeResizers=function(){je(this._getResizersParent())},tl.prototype._getResizersParent=function(){return this._canvas.getLayer("resizers")},tl.$inject=["eventBus","canvas","selection","resize"];var nl={__depends__:[Ss,xs,Fc],__init__:["resize","resizePreview","resizeHandles"],resize:["type",Hu],resizePreview:["type",Ju],resizeHandles:["type",tl]};function il(e,t){var n=t.create("bpmn:CategoryValue"),i=t.create("bpmn:Category",{categoryValue:[n]});return wt(e.get("rootElements"),i),Br(i).$parent=e,Br(n).$parent=i,n}function rl(e,t,n,i,r,o,a){function s(e,t){(t||Qa(e,["bpmn:Task","bpmn:TextAnnotation","bpmn:Group"])||ol(e))&&i.activate(e)}this._bpmnFactory=t,this._canvas=n,this._modeling=r,this._textRenderer=a,i.registerProvider(this),e.on("element.dblclick",(function(e){s(e.element,!0)})),e.on(["autoPlace.start","canvas.viewbox.changing","drag.init","element.mousedown","popupMenu.open"],(function(e){i.isActive()&&i.complete()})),e.on(["commandStack.changed"],(function(e){i.isActive()&&i.cancel()})),e.on("directEditing.activate",(function(e){o.removeResizers()})),e.on("create.end",500,(function(e){var t=e.context,n=t.shape,i=e.context.canExecute;e.isTouch||i&&(t.hints&&!1===t.hints.createElementsBehavior||s(n))})),e.on("autoPlace.end",500,(function(e){s(e.shape)}))}function ol(e){return Dr(e,"bpmn:SubProcess")&&!Nr(e)}rl.$inject=["eventBus","bpmnFactory","canvas","directEditing","modeling","resizeHandles","textRenderer"],rl.prototype.activate=function(e){var t=Hr(e);if(void 0!==t){var n={text:t};U(n,this.getEditingBBox(e));var i={};return(Qa(e,["bpmn:Task","bpmn:Participant","bpmn:Lane","bpmn:CallActivity"])||ol(e))&&U(i,{centerVertically:!0}),vo(e)&&U(i,{autoResize:!0}),Dr(e,"bpmn:TextAnnotation")&&U(i,{resizable:!0,autoResize:!0}),U(n,{options:i}),n}},rl.prototype.getEditingBBox=function(e){var t=this._canvas,n=e.label||e,i=t.getAbsoluteBBox(n),r=i.x+i.width/2,o=i.y+i.height/2,a={x:i.x,y:i.y},s=t.zoom(),c=this._textRenderer.getDefaultStyle(),p=this._textRenderer.getExternalStyle(),u=p.fontSize*s,l=p.lineHeight,d=c.fontSize*s,h=c.lineHeight,m={fontFamily:this._textRenderer.getDefaultStyle().fontFamily,fontWeight:this._textRenderer.getDefaultStyle().fontWeight};(Dr(e,"bpmn:Lane")||function(e){return Dr(e,"bpmn:Participant")&&Nr(e)}(e))&&(U(a,{width:i.height,height:30*s,x:i.x-i.height/2+15*s,y:o-30*s/2}),U(m,{fontSize:d+"px",lineHeight:h,paddingTop:7*s+"px",paddingBottom:7*s+"px",paddingLeft:5*s+"px",paddingRight:5*s+"px",transform:"rotate(-90deg)"})),(Qa(e,["bpmn:Task","bpmn:CallActivity"])||function(e){return Dr(e,"bpmn:Participant")&&!Nr(e)}(e)||ol(e))&&(U(a,{width:i.width,height:i.height}),U(m,{fontSize:d+"px",lineHeight:h,paddingTop:7*s+"px",paddingBottom:7*s+"px",paddingLeft:5*s+"px",paddingRight:5*s+"px"})),function(e){return Dr(e,"bpmn:SubProcess")&&Nr(e)}(e)&&(U(a,{width:i.width,x:i.x}),U(m,{fontSize:d+"px",lineHeight:h,paddingTop:7*s+"px",paddingBottom:7*s+"px",paddingLeft:5*s+"px",paddingRight:5*s+"px"}));var f=90*s,v=7*s,y=4*s;if(n.labelTarget&&(U(a,{width:f,height:i.height+v+y,x:r-f/2,y:i.y-v}),U(m,{fontSize:u+"px",lineHeight:l,paddingTop:v+"px",paddingBottom:y+"px"})),vo(n)&&!yo(n)&&!xo(n)){var g=bo(e),b=t.getAbsoluteBBox({x:g.x,y:g.y,width:0,height:0}),x=u+v+y;U(a,{width:f,height:x,x:b.x-f/2,y:b.y-x/2}),U(m,{fontSize:u+"px",lineHeight:l,paddingTop:v+"px",paddingBottom:y+"px"})}return Dr(e,"bpmn:TextAnnotation")&&(U(a,{width:i.width,height:i.height,minWidth:30*s,minHeight:10*s}),U(m,{textAlign:"left",paddingTop:5*s+"px",paddingBottom:7*s+"px",paddingLeft:7*s+"px",paddingRight:5*s+"px",fontSize:d+"px",lineHeight:h})),{bounds:a,style:m}},rl.prototype.update=function(e,t,n,i){var r,o;if((Dr(e,"bpmn:TextAnnotation")&&(o=this._canvas.getAbsoluteBBox(e),r={x:e.x,y:e.y,width:e.width/o.width*i.width,height:e.height/o.height*i.height}),Dr(e,"bpmn:Group"))&&!Br(e).categoryValueRef){var a=il(Br(this._canvas.getRootElement()).$parent,this._bpmnFactory);Br(e).categoryValueRef=a}(function(e){return!e||!e.trim()})(t)&&(t=null),this._modeling.updateLabel(e,t,r)};var al="djs-element-hidden",sl="djs-label-hidden";function cl(e,t,n,i){var r,o,a,s=this,c=t.getDefaultLayer();e.on("directEditing.activate",(function(e){var n=e.active;if(Dr(r=n.element.label||n.element,"bpmn:TextAnnotation")){o=t.getAbsoluteBBox(r),a=Ne("g");var p=i.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:r.width,containerHeight:r.height,position:{mx:0,my:0}}),u=s.path=Ne("path");Pe(u,{d:p,strokeWidth:2,stroke:pl(r)}),Ee(a,u),Ee(c,a),Yn(a,r.x,r.y)}Dr(r,"bpmn:TextAnnotation")||r.labelTarget?t.addMarker(r,al):(Dr(r,"bpmn:Task")||Dr(r,"bpmn:CallActivity")||Dr(r,"bpmn:SubProcess")||Dr(r,"bpmn:Participant"))&&t.addMarker(r,sl)})),e.on("directEditing.resize",(function(e){if(Dr(r,"bpmn:TextAnnotation")){var t=e.height,n=e.dy,a=Math.max(r.height/o.height*(t+n),0),c=i.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:r.width,containerHeight:a,position:{mx:0,my:0}});Pe(s.path,{d:c})}})),e.on(["directEditing.complete","directEditing.cancel"],(function(e){var n=e.active;n&&(t.removeMarker(n.element.label||n.element,al),t.removeMarker(r,sl)),r=void 0,o=void 0,a&&(ke(a),a=void 0)}))}function pl(e,t){return Br(e).di.get("stroke")||t||"black"}cl.$inject=["eventBus","canvas","elementRegistry","pathMap"];var ul={__depends__:[Gu,nl,jc],__init__:["labelEditingProvider","labelEditingPreview"],labelEditingProvider:["type",rl],labelEditingPreview:["type",cl]},ll=["top","bottom","left","right"],dl=10;function hl(e,t){function n(e){if(yo(e)){var n=function(e){var t=fn(e.label),n=ml(fn(e),t);if(i=n,-1===ll.indexOf(i))return;var i;var r=function(e){var t=fn(e);return[].concat(e.incoming.map((function(e){return e.waypoints[e.waypoints.length-2]})),e.outgoing.map((function(e){return e.waypoints[1]}))).map((function(e){return ml(t,e)}))}(e);if(e.host){var o=function(e){var t,n=e.host,i=vn(fn(e),n);t=i.indexOf("-")>=0?i.split("-"):[i];return ll.filter((function(e){return-1===t.indexOf(e)}))}(e);r=r.concat(o)}var a=ll.filter((function(e){return-1===r.indexOf(e)}));if(-1!==a.indexOf(n))return;return a[0]}(e);n&&function(e,n){var i=fn(e),r=e.label,o=fn(r);if(!r.parent)return;var a,s=hn(e);switch(n){case"top":a={x:i.x,y:s.top-dl-r.height/2};break;case"left":a={x:s.left-dl-r.width/2,y:i.y};break;case"bottom":a={x:i.x,y:s.bottom+dl+r.height/2};break;case"right":a={x:s.right+dl+r.width/2,y:i.y}}var c=Ea(a,o);t.moveShape(r,c)}(e,n)}}as.call(this,e),this.postExecuted(["connection.create","connection.layout","connection.updateWaypoints"],(function(e){var t=e.context,i=t.connection,r=i.source,o=i.target;!1!==(t.hints||{}).createElementsBehavior&&(n(r),n(o))})),this.postExecuted(["label.create"],(function(e){var t=e.context,i=t.shape;!1!==(t.hints||{}).createElementsBehavior&&n(i.labelTarget)})),this.postExecuted(["elements.create"],(function(e){var t=e.context,i=t.elements;!1!==(t.hints||{}).createElementsBehavior&&i.forEach((function(e){n(e)}))}))}function ml(e,t){return vn(t,e,5)}function fl(e,t,n){as.call(this,e),this.preExecute("shape.append",(function(e){var t=e.source,n=e.shape;e.position||(Dr(n,"bpmn:TextAnnotation")?e.position={x:t.x+t.width/2+75,y:t.y-50-n.height/2}:e.position={x:t.x+t.width+80+n.width/2,y:t.y+t.height/2})}),!0)}function vl(e,t){e.invoke(as,this),this.postExecute("shape.move",(function(e){var n=e.newParent,i=e.shape;_(w(i.incoming.concat(i.outgoing),(function(e){return Dr(e,"bpmn:Association")})),(function(e){t.moveConnection(e,{x:0,y:0},n)}))}),!0)}i(hl,as),hl.$inject=["eventBus","modeling"],i(fl,as),fl.$inject=["eventBus","elementFactory","bpmnRules"],i(vl,as),vl.$inject=["injector","modeling"];function yl(e,t){t.invoke(as,this),this._bpmnReplace=e;var n=this;this.postExecuted("elements.create",500,(function(e){var t=e.elements;1===(t=t.filter((function(e){return gl(e,e.host)}))).length&&t.map((function(e){return t.indexOf(e)})).forEach((function(i){var r=t[i];e.elements[i]=n.replaceShape(t[i],r)}))}),!0),this.preExecute("elements.move",500,(function(e){var t=e.shapes,i=e.newHost;if(1===t.length){var r=t[0];gl(r,i)&&(e.shapes=[n.replaceShape(r,i)])}}),!0)}function gl(e,t){return!xo(e)&&Qa(e,["bpmn:IntermediateThrowEvent","bpmn:IntermediateCatchEvent"])&&!!t}yl.$inject=["bpmnReplace","injector"],i(yl,as),yl.prototype.replaceShape=function(e,t){var n,i=(n=Br(e).eventDefinitions)&&n[0],r={type:"bpmn:BoundaryEvent",host:t};return i&&(r.eventDefinitionType=i.$type),this._bpmnReplace.replaceElement(e,r,{layoutConnection:!1})};function bl(e,t,n){function i(e){return w(e.attachers,(function(e){return Dr(e,"bpmn:BoundaryEvent")}))}as.call(this,e),this.postExecute("connection.create",(function(e){var t=e.context.source,r=e.context.target,o=i(r);Dr(t,"bpmn:EventBasedGateway")&&Dr(r,"bpmn:ReceiveTask")&&o.length>0&&n.removeElements(o)})),this.postExecute("connection.reconnect",(function(e){var t=e.context.oldSource,r=e.context.newSource;Dr(t,"bpmn:Gateway")&&Dr(r,"bpmn:EventBasedGateway")&&_(r.outgoing,(function(e){var t=e.target,r=i(t);Dr(t,"bpmn:ReceiveTask")&&r.length>0&&n.removeElements(r)}))})),e.on("moddleCopy.canCopyProperty",2e3,(function(e){var n=e.parent,i=e.property,r=e.propertyName,o=t.getPropertyDescriptor(n,r);o&&o.isReference&&Dr(i,"bpmn:RootElement")&&n.set(r,i)}))}bl.$inject=["eventBus","moddle","modeling"],i(bl,as);function xl(e,t,n,i,r){function o(e){return Qa(e,["bpmn:ReceiveTask","bpmn:SendTask"])||function(e,t){h(t)||(t=[t]);return C(t,(function(t){return Vr(e,t)}))}(e,["bpmn:ErrorEventDefinition","bpmn:EscalationEventDefinition","bpmn:MessageEventDefinition","bpmn:SignalEventDefinition"])}function a(t){return!!x(e.getDefinitions().get("rootElements"),I({id:t.id}))}function s(e){return Dr(e,"bpmn:ErrorEventDefinition")?"errorRef":Dr(e,"bpmn:EscalationEventDefinition")?"escalationRef":Dr(e,"bpmn:MessageEventDefinition")?"messageRef":Dr(e,"bpmn:SignalEventDefinition")?"signalRef":void 0}function c(e){if(Qa(e,["bpmn:ReceiveTask","bpmn:SendTask"]))return e.get("messageRef");var t=e.get("eventDefinitions")[0];return t.get(s(t))}n.invoke(as,this),this.executed("shape.create",(function(t){var n=t.shape;if(o(n)){var i=c(Br(n));i&&!a(i)&&(wt(e.getDefinitions().get("rootElements"),i),t.addedRootElement=i)}}),!0),this.reverted("shape.create",(function(t){var n=t.addedRootElement;n&&Et(e.getDefinitions().get("rootElements"),n)}),!0),t.on("copyPaste.copyElement",(function(e){var t=e.descriptor,n=e.element;if(o(n)){var i=c(Br(n));i&&(t.referencedRootElement=i)}})),t.on("copyPaste.pasteElement",500,(function(e){var t=e.descriptor,n=t.businessObject;if(o(n)){var c=t.referencedRootElement;c&&(a(c)||(c=i.copyElement(c,r.create(c.$type))),function(e,t){if(Qa(e,["bpmn:ReceiveTask","bpmn:SendTask"]))return e.set("messageRef",t);var n=e.get("eventDefinitions")[0];n.set(s(n),t)}(n,c))}}))}function El(e){e.invoke(as,this),this.preExecute("shape.create",1500,(function(e){var t=e.context,n=t.parent,i=t.shape;Dr(n,"bpmn:Lane")&&!Dr(i,"bpmn:Lane")&&(t.parent=es(n,"bpmn:Participant"))}))}xl.$inject=["bpmnjs","eventBus","injector","moddleCopy","bpmnFactory"],i(xl,as),El.$inject=["injector"],i(El,as);var wl=1500;function _l(e,t,n){t.on(["create.hover","create.move","create.out","create.end","shape.move.hover","shape.move.move","shape.move.out","shape.move.end"],wl,(function(t){var i=t.context.shape||t.shape,r=t.hover;Dr(r,"bpmn:Lane")&&!Qa(i,["bpmn:Lane","bpmn:Participant"])&&(t.hover=nu(r),t.hoverGfx=e.getGraphics(t.hover));var o=n.getRootElement();r!==o&&(i.labelTarget||Dr(i,"bpmn:Group"))&&(t.hover=o,t.hoverGfx=e.getGraphics(t.hover))})),t.on(["connect.hover","connect.out","connect.end","connect.cleanup","global-connect.hover","global-connect.out","global-connect.end","global-connect.cleanup"],wl,(function(t){var n=t.hover;Dr(n,"bpmn:Lane")&&(t.hover=nu(n)||n,t.hoverGfx=e.getGraphics(t.hover))})),t.on(["bendpoint.move.hover"],wl,(function(t){var n=t.context,i=t.hover,r=n.type;Dr(i,"bpmn:Lane")&&/reconnect/.test(r)&&(t.hover=nu(i)||i,t.hoverGfx=e.getGraphics(t.hover))})),t.on(["connect.start"],wl,(function(e){var t=e.context,n=t.start;Dr(n,"bpmn:Lane")&&(t.start=nu(n)||n)})),t.on("shape.move.start",2e3,(function(e){var t=e.shape;Dr(t,"bpmn:Lane")&&(e.shape=nu(t)||t)}))}function Pl(e,t,n){as.call(this,e),this.preExecute("shape.create",(function(e){var n=e.context.shape;if(Dr(n,"bpmn:DataObjectReference")&&"label"!==n.type){var i=t.create("bpmn:DataObject");n.businessObject.dataObjectRef=i}}))}_l.$inject=["elementRegistry","eventBus","canvas"],Pl.$inject=["eventBus","bpmnFactory","moddle"],i(Pl,as);var Sl=20,Ol=20,Cl=2e3;function Tl(e,t,n){function i(t){var i,r=t.parent,o=e.getRootElement();Dr(o,"bpmn:Collaboration")?i=o:(i=n.makeCollaboration(),t.process=r),t.parent=i}as.call(this,t),t.on(["create.start","shape.move.start"],Cl,(function(t){var n=t.context,i=n.shape,r=e.getRootElement();if(Dr(i,"bpmn:Participant")&&Dr(r,"bpmn:Process")&&r.children.length){var o=r.children.filter((function(e){return!Dr(e,"bpmn:Group")&&!xo(e)&&!function(e){return!!e.waypoints}(e)}));if(o.length){var a=ft(o);U(i,function(e,t){t={width:t.width+40+30,height:t.height+40};var n=Math.max(e.width,t.width),i=Math.max(e.height,t.height);return{x:-n/2,y:-i/2,width:n,height:i}}(i,a)),n.createConstraints=function(e,t){return{bottom:(t=hn(t)).top+e.height/2-Ol,left:t.right-e.width/2+Sl,top:t.bottom-e.height/2+Ol,right:t.left+e.width/2-Sl-30}}(i,a)}}})),t.on("create.start",Cl,(function(n){var i=n.context.shape,r=e.getRootElement(),o=e.getGraphics(r);function a(e){e.element=r,e.gfx=o}Dr(i,"bpmn:Participant")&&Dr(r,"bpmn:Process")&&(t.on("element.hover",Cl,a),t.once("create.cleanup",(function(){t.off("element.hover",a)})))})),this.preExecute("shape.create",(function(e){var t=e.parent;Dr(e.shape,"bpmn:Participant")&&Dr(t,"bpmn:Process")&&i(e)}),!0),this.execute("shape.create",(function(e){var t=e.process,n=e.shape;t&&(e.oldProcessRef=n.businessObject.processRef,n.businessObject.processRef=t.businessObject)}),!0),this.revert("shape.create",(function(e){var t=e.process,n=e.shape;t&&(n.businessObject.processRef=e.oldProcessRef)}),!0),this.postExecute("shape.create",(function(e){var t=e.process,i=e.shape;if(t){var r=t.children.slice();n.moveElements(r,{x:0,y:0},i)}}),!0),this.preExecute("elements.create",Cl,(function(e){var t,n=e.elements,r=e.parent;Al(n)&&Dr(r,"bpmn:Process")&&(i(e),t=Al(n),e.oldProcessRef=t.businessObject.processRef,t.businessObject.processRef=r.businessObject)}),!0),this.revert("elements.create",(function(e){var t=e.elements;e.process&&(Al(t).businessObject.processRef=e.oldProcessRef)}),!0),this.postExecute("elements.create",(function(e){var t,i=e.elements,r=e.process;if(r){t=Al(i);var o=r.children.slice();n.moveElements(o,{x:0,y:0},t)}}),!0)}function Al(e){return x(e,(function(e){return Dr(e,"bpmn:Participant")}))}Tl.$inject=["canvas","eventBus","modeling"],i(Tl,as);var Rl="__targetRef_placeholder";function kl(e,t){function n(e,n){var i=e.get("properties"),r=x(i,(function(e){return e.name===Rl}));return!r&&n&&wt(i,r=t.create("bpmn:Property",{name:Rl})),r}function i(e,t){var i=n(e);i&&(function(e,t,n){return x(e.get("dataInputAssociations"),(function(e){return e!==n&&e.targetRef===t}))}(e,i,t)||Et(e.get("properties"),i))}function r(e){var t,r=e.context,o=r.connection,a=o.businessObject,s=o.target,c=s&&s.businessObject,p=r.newTarget,u=p&&p.businessObject,l=r.oldTarget||r.target,d=l&&l.businessObject,h=o.businessObject;d&&d!==c&&i(d,a),u&&u!==c&&i(u,a),c?(t=n(c,!0),h.targetRef=t):h.targetRef=null}as.call(this,e),this.executed(["connection.create","connection.delete","connection.move","connection.reconnect"],jl(r)),this.reverted(["connection.create","connection.delete","connection.move","connection.reconnect"],jl(r))}function jl(e){return function(t){if(Dr(t.context.connection,"bpmn:DataInputAssociation"))return e(t)}}function Ml(e){this._bpmnUpdater=e}function Dl(e,t,n,i){function r(e){return e.children.filter((function(e){return Dr(e,"bpmn:DataStoreReference")&&!e.labelTarget}))}function o(e,i){var r=e.businessObject||e;if(i=i||n.filter((function(e){return Dr(e,"bpmn:Participant")&&Br(e).processRef}))[0]){var o=i.businessObject||i;t.execute("dataStore.updateContainment",{dataStoreBo:r,newSemanticParent:o.processRef||o,newDiParent:o.di})}}as.call(this,i),t.registerHandler("dataStore.updateContainment",Ml),this.preExecute("shape.create",(function(e){var t=e.context,n=t.shape;Dr(n,"bpmn:DataStoreReference")&&"label"!==n.type&&(t.hints||(t.hints={}),t.hints.autoResize=!1)})),this.preExecute("elements.move",(function(e){var t=e.context,n=t.shapes;n.filter((function(e){return Dr(e,"bpmn:DataStoreReference")})).length&&(t.hints||(t.hints={}),t.hints.autoResize=n.filter((function(e){return!Dr(e,"bpmn:DataStoreReference")})))})),this.postExecute("shape.create",(function(e){var t=e.context.shape,n=t.parent;Dr(t,"bpmn:DataStoreReference")&&"label"!==t.type&&Dr(n,"bpmn:Collaboration")&&o(t)})),this.postExecute("shape.move",(function(e){var t=e.context,n=t.shape,i=t.oldParent,r=n.parent;Dr(i,"bpmn:Collaboration")||Dr(n,"bpmn:DataStoreReference")&&"label"!==n.type&&Dr(r,"bpmn:Collaboration")&&o(n,Dr(i,"bpmn:Participant")?i:function(e,t){for(;e.parent;){if(Dr(e.parent,t))return e.parent;e=e.parent}}(i,"bpmn:Participant"))})),this.postExecute("shape.delete",(function(t){var n=t.context.shape,i=e.getRootElement();Qa(n,["bpmn:Participant","bpmn:SubProcess"])&&Dr(i,"bpmn:Collaboration")&&r(i).filter((function(e){return function(e,t){var n=e.businessObject||e,i=t.businessObject||t;for(;n.$parent;){if(n.$parent===i.processRef||i)return!0;n=n.$parent}return!1}(e,n)})).forEach((function(e){o(e)}))})),this.postExecute("canvas.updateRoot",(function(e){var t=e.context,n=t.oldRoot,i=t.newRoot;r(n).forEach((function(e){Dr(i,"bpmn:Process")&&o(e,i)}))}))}kl.$inject=["eventBus","bpmnFactory"],i(kl,as),Ml.$inject=["bpmnUpdater"],Ml.prototype.execute=function(e){var t=e.dataStoreBo,n=e.newSemanticParent,i=e.newDiParent;e.oldSemanticParent=t.$parent,e.oldDiParent=t.di.$parent,this._bpmnUpdater.updateSemanticParent(t,n),this._bpmnUpdater.updateDiParent(t.di,i)},Ml.prototype.revert=function(e){var t=e.dataStoreBo,n=e.oldSemanticParent,i=e.oldDiParent;this._bpmnUpdater.updateSemanticParent(t,n),this._bpmnUpdater.updateDiParent(t.di,i)},Dl.$inject=["canvas","commandStack","elementRegistry","eventBus"],i(Dl,as);function Bl(e,t,n){as.call(this,e),this.postExecuted("shape.delete",500,(function(e){var t=e.context,i=t.hints,r=t.shape,o=t.oldParent;Dr(r,"bpmn:Lane")&&(i&&i.nested||function(e,t){var i,r,o,a=tu(t),s=[],c=[];ht(a,(function(t){return t.y>e.y?c.push(t):s.push(t),t.children})),a.length&&(i=c.length&&s.length?e.height/2:e.height,s.length&&(r=n.calculateAdjustments(s,"y",i,e.y-10),n.makeSpace(r.movingShapes,r.resizingShapes,{x:0,y:i},"s")),c.length&&(o=n.calculateAdjustments(c,"y",-i,e.y+e.height+10),n.makeSpace(o.movingShapes,o.resizingShapes,{x:0,y:-i},"n")))}(r,o))}))}Bl.$inject=["eventBus","modeling","spaceTool"],i(Bl,as);function Il(e,t){t.invoke(as,this),this._bpmnReplace=e;var n=this;this.postExecuted("elements.create",500,(function(e){var t=e.elements;t.filter((function(e){return Nl(e,e.host)})).map((function(e){return t.indexOf(e)})).forEach((function(i){e.elements[i]=n.replaceShape(t[i])}))}),!0),this.preExecute("elements.move",500,(function(e){var t=e.shapes,i=e.newHost;t.forEach((function(e,r){var o,a=e.host;Nl(e,(o=a,-1!==t.indexOf(o)?a:i))&&(t[r]=n.replaceShape(e))}))}),!0)}function Nl(e,t){return!xo(e)&&Dr(e,"bpmn:BoundaryEvent")&&!t}function Ll(e,t,n){function i(e,i,r){var o,a,s,c,p,u,l,d,h=i.waypoints,m=e.outgoing.slice(),v=e.incoming.slice(),y=Ts(h,d=f(r.width)?fn(r):r);if(y){if(o=h.slice(0,y.index),a=h.slice(y.index+(y.bendpoint?1:0)),!o.length||!a.length)return;s=y.bendpoint?h[y.index]:d,Fl(e,o[o.length-1])||o.push(Vl(s)),Fl(e,a[0])||a.unshift(Vl(s))}c=i.source,p=i.target,t.canConnect(c,e,i)&&(n.reconnectEnd(i,e,o||d),u=i),t.canConnect(e,p,i)&&(u?l=n.connect(e,p,{type:i.type,waypoints:a}):(n.reconnectStart(i,e,a||d),l=i));var g=[].concat(u&&w(v,(function(e){return e.source===u.source}))||[],l&&w(m,(function(e){return e.target===l.target}))||[]);g.length&&n.removeElements(g)}as.call(this,e),this.preExecute("elements.move",(function(e){var n=e.newParent,i=e.shapes,r=e.delta,o=i[0];if(o&&n){n&&n.waypoints&&(e.newParent=n=n.parent);var a=fn(o),s={x:a.x+r.x,y:a.y+r.y},c=x(n.children,(function(e){return t.canInsert(i,e)&&Ts(e.waypoints,s)}));c&&(e.targetFlow=c,e.position=s)}}),!0),this.postExecuted("elements.move",(function(e){var t=e.shapes,n=e.targetFlow,r=e.position;n&&i(t[0],n,r)}),!0),this.preExecute("shape.create",(function(e){var n=e.parent,i=e.shape;t.canInsert(i,n)&&(e.targetFlow=n,e.parent=n.parent)}),!0),this.postExecuted("shape.create",(function(e){var t=e.shape,n=e.targetFlow,r=e.position;n&&i(t,n,r)}),!0)}function Fl(e,t){var n=t.x,i=t.y;return n>=e.x&&n<=e.x+e.width&&i>=e.y&&i<=e.y+e.height}function Vl(e){return U({},e)}function $l(e,t){as.call(this,e),this.preExecuted("connection.create",(function(e){var n=e.context,i=n.source,r=n.target,o=r.incoming.slice();n.hints&&!1===n.hints.createElementsBehavior||Dr(i,"bpmn:EventBasedGateway")&&r.incoming.length&&o.filter(zl).forEach((function(e){t.removeConnection(e)}))})),this.preExecuted("shape.replace",(function(e){var n=e.context.newShape;Dr(n,"bpmn:EventBasedGateway")&&n.outgoing.filter(zl).map((function(e){return e.target})).reduce((function(e,t){var n=t.incoming.filter(zl);return e.concat(n)}),[]).forEach((function(e){e.source!==n&&t.removeConnection(e)}))}))}function zl(e){return Dr(e,"bpmn:SequenceFlow")}Il.$inject=["bpmnReplace","injector"],i(Il,as),Il.prototype.replaceShape=function(e){var t,n,i=(n=Br(e).eventDefinitions)&&n[0];return t=i?{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:i.$type}:{type:"bpmn:IntermediateThrowEvent"},this._bpmnReplace.replaceElement(e,t,{layoutConnection:!1})},i(Ll,as),Ll.$inject=["eventBus","bpmnRules","modeling"],$l.$inject=["eventBus","modeling"],i($l,as);function ql(e,t,n,i,r,o){function a(){return Br(t.getRootElement()).$parent}function s(e){var t=Br(e).categoryValueRef;if(t){var n=t.$parent;t&&(Et(n.categoryValue,t),n&&!n.categoryValue.length&&function(e){Et(a().get("rootElements"),e)}(n))}}r.invoke(as,this),this.executed("shape.delete",(function(e){var t,i=e.context.shape;if(Dr(i,"bpmn:Group")){var r=Br(i).categoryValueRef,o=n.filter((function(e){return Dr(e,"bpmn:Group")}));t=r,o.some((function(e){var n=Br(e);return n.categoryValueRef&&n.categoryValueRef===t}))||s(i)}})),this.reverted("shape.delete",(function(e){var t=e.context.shape;if(Dr(t,"bpmn:Group")){var n=Br(t).categoryValueRef,i=a(),r=n?n.$parent:null;wt(r.get("categoryValue"),n),wt(i.get("rootElements"),r)}})),this.execute("shape.create",(function(t){var n=Br(t.context.shape);if(Dr(n,"bpmn:Group")&&!n.categoryValueRef){var i=il(a(),e);n.categoryValueRef=i}})),this.revert("shape.create",(function(e){var t=e.context.shape;Dr(t,"bpmn:Group")&&(s(t),delete Br(t).categoryValueRef)})),i.on("moddleCopy.canCopyProperty",2e3,(function(t){var n,i=t.property;if(Dr(i,"bpmn:CategoryValue"))return n=il(a(),e),o.copyElement(i,n)}))}function Ul(e,t,n,i){var r,o,a,s;return 0==(r=(i.y-n.y)*(t.x-e.x)-(i.x-n.x)*(t.y-e.y))?null:(o=e.y-n.y,a=e.x-n.x,s=((i.x-n.x)*o-(i.y-n.y)*a)/r,{x:Math.round(e.x+s*(t.x-e.x)),y:Math.round(e.y+s*(t.y-e.y))})}function Gl(e){function t(e,t,n){var i,r={x:n.x,y:n.y-50},o={x:n.x-50,y:n.y},a=Ul(e,t,n,r),s=Ul(e,t,n,o);i=a&&s?Hl(a,n)>Hl(s,n)?s:a:a||s,e.original=i}e.on("bpmnElement.added",(function(e){var n,i,r=e.element;r.waypoints&&(t((i=(n=r).waypoints)[0],i[1],fn(n.source)),t(i[i.length-1],i[i.length-2],fn(n.target)))}))}function Hl(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Wl(e){as.call(this,e);var t=["bpmn:Participant","bpmn:Lane"];this.executed(["shape.move","shape.create","shape.resize"],(function(e){var n=Br(e.context.shape);Qa(n,t)&&!n.di.get("isHorizontal")&&n.di.set("isHorizontal",!0)}))}function Kl(e){return Math.sqrt(Math.pow(e.x,2)+Math.pow(e.y,2))}function Xl(e){return Math.atan((e[1].y-e[0].y)/(e[1].x-e[0].x))}function Yl(e,t){var n=t[0],i=t[1],r={x:i.x-n.x,y:i.y-n.y},o=function(e,t,n){var i=[{n:e[0]-n[0],lambda:t[0]},{n:e[1]-n[1],lambda:t[1]}];return-(i[0].n*t[0]+i[1].n*t[1])/(i[0].lambda*t[0]+i[1].lambda*t[1])}([n.x,n.y],[r.x,r.y],[e.x,e.y]);return{x:n.x+o*r.x,y:n.y+o*r.y}}function Jl(e,t){var n=Yl(e,t);return Kl({x:n.x-e.x,y:n.y-e.y})}function Zl(e,t){return Kl({x:e.x-t.x,y:e.y-t.y})}ql.$inject=["bpmnFactory","canvas","elementRegistry","eventBus","injector","moddleCopy"],i(ql,as),Gl.$inject=["eventBus"],Wl.$inject=["eventBus"],i(Wl,as);var Ql=Math.sqrt,ed=Math.min,td=Math.max,nd=Math.abs;function id(e){return Math.pow(e,2)}function rd(e,t){return Ql(id(e.x-t.x)+id(e.y-t.y))}function od(e,t,n,i){var r=t.x-e.x,o=t.y-e.y,a=n.x-e.x,s=n.y-e.y,c=r*r+o*o,p=(r*a+o*s)/c,u=p*p-(a*a+s*s-i*i)/c;if(u<0&&u>-1e-6&&(u=0),u<0)return[];var l=Ql(u),d=-p+l,h=-p-l,m={x:e.x-r*d,y:e.y-o*d};return 0===u?[m]:[m,{x:e.x-r*h,y:e.y-o*h}].filter((function(n){return function(e,t,n){return ad(e.x,t.x,n.x)&&ad(e.y,t.y,n.y)}(n,e,t)}))}function ad(e,t,n){return e>=ed(t,n)-sd&&e<=td(t,n)+sd}var sd=.1;function cd(e,t){return nd(e.x-t.x)<=sd&&nd(e.y-t.y)<=sd}function pd(e,t,n,i){var r=0,o=0,a=function(e){return{x:e.x+e.width/2,y:e.y+e.height/2}}(e),s=function(e,t){var n,i,r,o,a,s,c,p,u,l,d,h,m=0;for(m=0;m<t.length-1;m++){if(cd(n=t[m],i=t[m+1])?s=[n]:(r=rd(e,n),o=rd(e,i),s=od(n,i,e,ed(r,o))),s.length<1)throw new Error("expected between [1, 2] circle -> line intersections");1===s.length&&(c={type:"bendpoint",position:s[0],segmentIndex:m,bendpointIndex:cd(n,s[0])?m:m+1}),2===s.length&&(d=s[0],h=s[1],c={type:"segment",position:a={x:(d.x+h.x)/2,y:(d.y+h.y)/2},segmentIndex:m,relativeLocation:rd(n,a)/rd(n,i)}),p=rd(c.position,e),(!l||u>p)&&(l=c,u=p)}return l}(a,n),c=s.segmentIndex,p=function(e,t,n,i){var r=n.segmentIndex,o=t.length-e.length;if(i.segmentMove){var a=i.segmentMove.segmentStartIndex,s=i.segmentMove.newSegmentStartIndex;return r===a?s:r>=s?r+o<s?s:r+o:r}if(i.bendpointMove){var c,p=i.bendpointMove.insert,u=i.bendpointMove.bendpointIndex;return 0===o?r:(r>=u&&(c=p?r+1:r-1),r<u&&(c=r,p&&"bendpoint"!==n.type&&u-1===r&&ud(t,u)<n.relativeLocation&&c++),c)}return 0===o?r:i.connectionStart?0===r?0:null:i.connectionEnd&&r===e.length-2?t.length-2:null}(n,t,s,i);if(null===p)return{x:r,y:o};if(p<0||p>t.length-2)return{x:r,y:o};var u,l,d=ld(n,c),h=ld(t,p),m=s.position,f=function(e,t){var n=Zl(e[0],e[1]),i=Zl(e[0],t);return 0===n?0:i/n}(d,m),v=(u=h,l=Xl(d),Xl(u)-l);if("bendpoint"===s.type){var y=t.length-n.length,g=s.bendpointIndex,b=n[g];if(-1!==t.indexOf(b))return{x:r,y:o};if(0===y){var x=t[g];return{x:x.x-s.position.x,y:x.y-s.position.y}}y<0&&0!==g&&g<n.length-1&&(f=ud(n,g))}var E,w,_=(h[1].x-h[0].x)*f+h[0].x,P=(h[1].y-h[0].y)*f+h[0].y,S=(E={x:a.x-m.x,y:a.y-m.y},(w=v)?{x:Math.cos(w)*E.x-Math.sin(w)*E.y,y:Math.sin(w)*E.x+Math.cos(w)*E.y}:E);return dn({x:r=_+S.x-a.x,y:o=P+S.y-a.y})}function ud(e,t){var n=Zl(e[t-1],e[t]);return n/(n+Zl(e[t],e[t+1]))}function ld(e,t){return[e[t],e[t+1]]}function dd(e,t,n){var i=xa(t),r=xa(n),o=Ea(e,i),a=o.x*(n.width/t.width),s=o.y*(n.height/t.height);return dn({x:r.x+a,y:r.y+s})}function hd(e,t,n){var i=xa(e),r=xa(t),o=xa(n),a=Ea(e,i),s=Ea(i,r),c=function(e,t,n){var i=hn(t),r=hn(n);if(function(e,t){return function(e,t){return e.right!==t.right&&e.left!==t.left}(e,t)||function(e,t){return e.top!==t.top&&e.bottom!==t.bottom}(e,t)}(i,r))return null;var o,a,s=vn(t,e);if("top"===s)o={x:0,y:r.bottom-i.bottom};else if("bottom"===s)o={x:0,y:r.top-i.top};else if("right"===s)o={x:r.left-i.left,y:0};else{if("left"!==s)return null;o={x:r.right-i.right,y:0}}if(a={x:e.x+o.x,y:e.y+o.y},vn(n,a)!==s)return null;return o}(i,t,n);if(c)return c;var p=s.x*(n.width/t.width),u=s.y*(n.height/t.height),l=o.x+p,d=o.y+u;return dn({x:l+a.x-e.x,y:d+a.y-e.y})}var md={width:90,height:20},fd="name",vd="text";function yd(e,t,n,i){as.call(this,e),this.postExecute("element.updateProperties",(function(e){var n=e.context,r=n.element,o=n.properties;if(fd in o&&t.updateLabel(r,o.name),vd in o&&Dr(r,"bpmn:TextAnnotation")){var a=i.getTextAnnotationBounds({x:r.x,y:r.y,width:r.width,height:r.height},o.text||"");t.updateLabel(r,o.text,a)}})),this.postExecute(["shape.create","connection.create"],(function(e){var n=e.context;if(!1!==(n.hints||{}).createElementsBehavior){var r=n.shape||n.connection,o=r.businessObject;if(!xo(r)&&vo(r)&&Hr(r)){var a=bo(r),s=i.getExternalLabelBounds(md,Hr(r));t.createLabel(r,a,{id:o.id+"_label",businessObject:o,width:s.width,height:s.height})}}})),this.postExecute("shape.delete",(function(e){var n=e.context,i=n.labelTarget,r=n.hints||{};i&&!1!==r.unsetLabel&&t.updateLabel(i,null,null,{removeShape:!1})})),this.postExecute(["label.create"],(function(e){var t,i=e.context.shape;i.labelTarget&&Dr(i.labelTarget||i,"bpmn:BaseElement")&&((t=i.businessObject.di).label||(t.label=n.create("bpmndi:BPMNLabel",{bounds:n.create("dc:Bounds")})),U(t.label.bounds,{x:i.x,y:i.y,width:i.width,height:i.height}))})),this.postExecute(["connection.layout","connection.updateWaypoints"],(function(e){var n=e.context;if(!1!==(n.hints||{}).labelBehavior){var i,r=n.connection.label;r&&r.parent&&(i=function(e){var t=e.context,n=t.connection,i=n.label,r=U({},t.hints),o=t.newWaypoints||n.waypoints,a=t.oldWaypoints;return void 0===r.startChanged&&(r.startChanged=!!r.connectionStart),void 0===r.endChanged&&(r.endChanged=!!r.connectionEnd),pd(i,o,a,r)}(e),t.moveShape(r,i))}})),this.postExecute(["shape.replace"],(function(e){var t=e.context,n=t.newShape,i=t.oldShape,r=Br(n);r&&vo(r)&&i.label&&n.label&&(n.label.x=i.label.x,n.label.y=i.label.y)})),this.postExecute("shape.resize",(function(e){var n,i=e.context,r=i.shape,o=i.newBounds,a=i.oldBounds;if(yo(r)){var s=r.label,c=gd(function(e,t){if(!t.length)return;var n=function(e,t){return B(t.map((function(t){return{line:t,distance:Jl(e,t)}})),"distance")[0].line}(e,t);return Yl(e,n)}(fn(s),[[{x:(n=a).x,y:n.y},{x:n.x+(n.width||0),y:n.y}],[{x:n.x+(n.width||0),y:n.y},{x:n.x+(n.width||0),y:n.y+(n.height||0)}],[{x:n.x,y:n.y+(n.height||0)},{x:n.x+(n.width||0),y:n.y+(n.height||0)}],[{x:n.x,y:n.y},{x:n.x,y:n.y+(n.height||0)}]]),a,o);t.moveShape(s,c)}}))}function gd(e,t,n){return dn(Ea(dd(e,t,n),e))}function bd(e,t,n){var i=Pd(e),r=Sd(i,t),o=i[0];return r.length?r[r.length-1]:dd(o.original||o,n,t)}function xd(e,t,n){var i=Pd(e),r=Sd(i,t),o=i[i.length-1];return r.length?r[0]:dd(o.original||o,n,t)}function Ed(e,t,n){var i=Pd(e),r=_d(t,n),o=i[0];return dd(o.original||o,r,t)}function wd(e,t,n){var i=Pd(e),r=_d(t,n),o=i[i.length-1];return dd(o.original||o,r,t)}function _d(e,t){return{x:e.x-t.x,y:e.y-t.y,width:e.width,height:e.height}}function Pd(e){var t=e.waypoints;if(!t.length)throw new Error("connection#"+e.id+": no waypoints");return t}function Sd(e,t){return w(T(e,Od),(function(e){return function(e,t){return"intersect"===vn(t,e,1)}(e,t)}))}function Od(e){return e.original||e}function Cd(e,t){as.call(this,e),this.postExecute("shape.replace",(function(e){var n=e.oldShape,i=e.newShape;if(function(e,t){return Dr(e,"bpmn:Participant")&&Nr(e)&&Dr(t,"bpmn:Participant")&&!Nr(t)}(n,i)){var r=function(e){var t=mt([e],!1),n=[],i=[];return t.forEach((function(t){t!==e&&(t.incoming.forEach((function(e){Dr(e,"bpmn:MessageFlow")&&n.push(e)})),t.outgoing.forEach((function(e){Dr(e,"bpmn:MessageFlow")&&i.push(e)})))}),[]),{incoming:n,outgoing:i}}(n);r.incoming.forEach((function(e){var r=xd(e,i,n);t.reconnectEnd(e,i,r)})),r.outgoing.forEach((function(e){var r=bd(e,i,n);t.reconnectStart(e,i,r)}))}}),!0)}i(yd,as),yd.$inject=["eventBus","modeling","bpmnFactory","textRenderer"],Cd.$inject=["eventBus","modeling"],i(Cd,as);function Td(e,t,n){e.on(["shape.move.rejected","create.rejected"],(function(e){var i,r,o,a=e.context,s=a.shape;Dr(a.target,"bpmn:Collaboration")&&Dr(s,"bpmn:FlowNode")&&(i=e,r=n("flow elements must be children of pools/participants"),t.add({position:{x:i.x+5,y:i.y+5},type:"error",timeout:o||2e3,html:"<div>"+r+"</div>"}))}))}function Ad(e,t,n,i){as.call(this,e);var r=i.get("dragging",!1);function o(e){var i,r,o=e.source,a=e.target;e.parent&&(Dr(e,"bpmn:SequenceFlow")&&(n.canConnectSequenceFlow(o,a)||(r=!0),n.canConnectMessageFlow(o,a)&&(i="bpmn:MessageFlow")),Dr(e,"bpmn:MessageFlow")&&(n.canConnectMessageFlow(o,a)||(r=!0),n.canConnectSequenceFlow(o,a)&&(i="bpmn:SequenceFlow")),Dr(e,"bpmn:Association")&&!n.canConnectAssociation(o,a)&&(r=!0),r&&t.removeConnection(e),i&&t.connect(o,a,{type:i,waypoints:e.waypoints.slice()}))}this.postExecuted("elements.move",(function(e){_(e.closure.allConnections,o)}),!0),this.preExecute("connection.reconnect",(function(e){var i,o,a=e.context,s=a.connection,c=a.newSource||s.source,p=a.newTarget||s.target;(i=n.canConnect(c,p))&&i.type!==s.type&&(o=t.connect(c,p,{type:i.type,waypoints:s.waypoints.slice()}),t.removeConnection(s),a.connection=o,r&&function(e,t){var n,i=r.context(),o=i&&i.payload.previousSelection;if(!o||!o.length)return;if(-1===(n=o.indexOf(e)))return;o.splice(n,1,t)}(s,o))})),this.postExecuted("element.updateProperties",(function(e){var n,i=e.context,r=i.properties,o=i.element,a=o.businessObject;r.default&&(n=x(o.outgoing,I({id:o.businessObject.default.id})))&&t.updateProperties(n,{conditionExpression:void 0}),r.conditionExpression&&a.sourceRef.default===a&&t.updateProperties(o.source,{default:void 0})}))}function Rd(e,t){as.call(this,e),this.preExecute("shape.delete",(function(e){var t=e.shape,n=t.parent;Dr(t,"bpmn:Participant")&&(e.collaborationRoot=n)}),!0),this.postExecute("shape.delete",(function(e){var n=e.collaborationRoot;n&&!n.businessObject.participants.length&&t.makeProcess()}),!0)}function kd(e,t,n,i,r,o){i.invoke(as,this),this._bpmnReplace=e,this._elementRegistry=n,this._selection=o,this.postExecuted(["elements.create"],500,(function(e){var n=e.context,i=n.parent,r=n.elements,o=t.canReplace(r,i);o&&this.replaceElements(r,o.replacements)}),this),this.postExecuted(["elements.move"],500,(function(e){var n=e.context,i=n.newParent,r=n.newHost,o=[];_(n.closure.topLevel,(function(e){o=Fr(e)?o.concat(e.children):o.concat(e)})),1===o.length&&r&&(i=r);var a=t.canReplace(o,i);a&&this.replaceElements(o,a.replacements,r)}),this),this.postExecute(["shape.replace"],1500,(function(e){var n,i=e.context,r=i.oldShape,o=i.newShape,a=r.attachers;a&&a.length&&(n=t.canReplace(a,o),this.replaceElements(a,n.replacements))}),this),this.postExecuted(["shape.replace"],1500,(function(e){var t=e.context,n=t.oldShape,i=t.newShape;r.unclaimId(n.businessObject.id,n.businessObject),r.updateProperties(i,{id:n.id})}))}Td.$inject=["eventBus","tooltips","translate"],i(Ad,as),Ad.$inject=["eventBus","modeling","bpmnRules","injector"],Rd.$inject=["eventBus","modeling"],i(Rd,as),i(kd,as),kd.prototype.replaceElements=function(e,t){var n=this._elementRegistry,i=this._bpmnReplace,r=this._selection;_(t,(function(t){var r={type:t.newElementType},o=n.get(t.oldElementId),a=e.indexOf(o);e[a]=i.replaceElement(o,r,{select:!1})})),t&&r.select(e)},kd.$inject=["bpmnReplace","bpmnRules","elementRegistry","injector","modeling","selection"];var jd=300,Md=60,Dd={width:300,height:150},Bd={width:140,height:120},Id={width:50,height:30};function Nd(e){e.on("resize.start",1500,(function(e){var t=e.context,n=t.shape,i=t.direction,r=t.balanced;(Dr(n,"bpmn:Lane")||Dr(n,"bpmn:Participant"))&&(t.resizeConstraints=function(e,t,n){var i=nu(e),r=!0,o=!0,a=eu(i,[i]),s=hn(e),c={},p={};/e/.test(t)?p.right=s.left+jd:/w/.test(t)&&(p.left=s.right-jd);return a.forEach((function(e){var i=hn(e);/n/.test(t)&&(i.top<s.top-10&&(r=!1),n&&Ld(s.top-i.bottom)<10&&qd(c,"top",i.top+Md),Ld(s.top-i.top)<5&&zd(p,"top",i.bottom-Md)),/s/.test(t)&&(i.bottom>s.bottom+10&&(o=!1),n&&Ld(s.bottom-i.top)<10&&zd(c,"bottom",i.bottom-Md),Ld(s.bottom-i.bottom)<5&&qd(p,"bottom",i.top+Md))})),i.children.filter((function(e){return!e.hidden&&!e.waypoints&&(Dr(e,"bpmn:FlowElement")||Dr(e,"bpmn:Artifact"))})).forEach((function(e){var n=hn(e);r&&/n/.test(t)&&zd(p,"top",n.top-20),/e/.test(t)&&qd(p,"right",n.right+20),o&&/s/.test(t)&&qd(p,"bottom",n.bottom+20),/w/.test(t)&&zd(p,"left",n.left-50)})),{min:p,max:c}}(n,i,r)),Dr(n,"bpmn:Participant")&&(t.minDimensions=Dd),Dr(n,"bpmn:SubProcess")&&Nr(n)&&(t.minDimensions=Bd),Dr(n,"bpmn:TextAnnotation")&&(t.minDimensions=Id)}))}Nd.$inject=["eventBus"];var Ld=Math.abs,Fd=Math.min,Vd=Math.max;function $d(e,t,n,i){var r=e[t];e[t]=void 0===r?n:i(n,r)}function zd(e,t,n){return $d(e,t,n,Fd)}function qd(e,t,n){return $d(e,t,n,Vd)}function Ud(e,t){e.on("resize.start",1501,(function(e){var t=e.context,n=t.shape;(Dr(n,"bpmn:Lane")||Dr(n,"bpmn:Participant"))&&(t.balanced=!jo(e))})),e.on("resize.end",1001,(function(e){var n=e.context,i=n.shape,r=n.canExecute,o=n.newBounds;if(Dr(i,"bpmn:Lane")||Dr(i,"bpmn:Participant"))return r&&(o=ln(o),t.resizeLane(i,o,n.balanced)),!1}))}function Gd(e,t,n){as.call(this,e),this.preExecute("shape.delete",(function(e){var i=e.context.shape;if(1===i.incoming.length&&1===i.outgoing.length){var r=i.incoming[0],o=i.outgoing[0];if(Dr(r,"bpmn:SequenceFlow")&&Dr(o,"bpmn:SequenceFlow")&&t.canConnect(r.source,o.target,r)){var a=function(e,t){var n=Ul(Hd(e[e.length-2]),Hd(e[e.length-1]),Hd(t[1]),Hd(t[0]));return n?[].concat(e.slice(0,e.length-1),[n],t.slice(1)):[Hd(e[0]),Hd(t[t.length-1])]}(r.waypoints,o.waypoints);n.reconnectEnd(r,o.target,a)}}}))}function Hd(e){return e.original||e}Ud.$inject=["eventBus","modeling"],i(Gd,as),Gd.$inject=["eventBus","bpmnRules","modeling"];var Wd=Math.max;function Kd(e){e.on("spaceTool.getMinDimensions",(function(e){var t=e.shapes,n=e.axis,i=e.start,r={};return _(t,(function(e){var t=e.id;Dr(e,"bpmn:Participant")&&(!function(e){return"x"===e}(n)?r[t]={width:Dd.width,height:Xd(e,i)}:r[t]=Dd),Dr(e,"bpmn:SubProcess")&&Nr(e)&&(r[t]=Bd),Dr(e,"bpmn:TextAnnotation")&&(r[t]=Id)})),r}))}function Xd(e,t){var n;return tu(e).length?(n=function(e,t){var n,i=tu(e);return n=Yd(i,t),e.height-n.height+Md}(e,t),Wd(Dd.height,n)):Dd.height}function Yd(e,t){var n,i,r;for(n=0;n<e.length;n++)if(t>=(i=e[n]).y&&t<=i.y+i.height)return(r=tu(i)).length?Yd(r,t):i}function Jd(e,t){e.invoke(as,this),this.postExecuted("shape.replace",(function(e){var n=e.context.oldShape,i=e.context.newShape;if(Dr(i,"bpmn:SubProcess")&&Dr(n,"bpmn:Task")&&Nr(i)){var r,o={x:(r=i).x+r.width/6,y:r.y+r.height/2};t.createShape({type:"bpmn:StartEvent"},o,i)}}))}Kd.$inject=["eventBus"],Jd.$inject=["injector","modeling"],i(Jd,as);function Zd(e,t,n,i){as.call(this,e),this.executed(["shape.toggleCollapse"],500,(function(e){var t,n=e.context.shape;Dr(n,"bpmn:SubProcess")&&(n.collapsed?Br(n).di.isExpanded=!1:((t=n.children).length&&t.forEach((function(e){"label"!==e.type||e.businessObject.name||(e.hidden=!0)})),Br(n).di.isExpanded=!0))})),this.reverted(["shape.toggleCollapse"],500,(function(e){var t=e.context.shape;t.collapsed?Br(t).di.isExpanded=!1:Br(t).di.isExpanded=!0})),this.postExecuted(["shape.toggleCollapse"],500,(function(e){var i,r=e.context.shape,o=t._getDefaultSize(r);i=r.collapsed?function(e,t){return{x:e.x+(e.width-t.width)/2,y:e.y+(e.height-t.height)/2,width:t.width,height:t.height}}(r,o):function(e,t){var n,i,r=e.children,o=t;return(n=Yp((i=r,i.filter((function(e){return!e.hidden}))).concat([e])))?(o.width=Math.max(n.width,o.width),o.height=Math.max(n.height,o.height),o.x=n.x+(n.width-o.width)/2,o.y=n.y+(n.height-o.height)/2):(o.x=e.x+(e.width-o.width)/2,o.y=e.y+(e.height-o.height)/2),o}(r,o),n.resizeShape(r,i,null,{autoResize:!r.collapsed&&"nwse"})}))}function Qd(e,t,n,i){t.invoke(as,this),this.preExecute("shape.delete",(function(e){var t=e.context.shape,r=t.businessObject;xo(t)||(Dr(t,"bpmn:Participant")&&Nr(t)&&n.ids.unclaim(r.processRef.id),i.unclaimId(r.id,r))})),this.preExecute("connection.delete",(function(e){var t=e.context.connection.businessObject;i.unclaimId(t.id,t)})),this.preExecute("canvas.updateRoot",(function(){var t=e.getRootElement().businessObject;n.ids.unclaim(t.id)}))}i(Zd,as),Zd.$inject=["eventBus","elementFactory","modeling"],i(Qd,as),Qd.$inject=["canvas","injector","moddle","modeling"];function eh(e,t,n){var i;function r(){if(!i)throw new Error(n("out of bounds release"));return i}as.call(this,e);var o=["spaceTool","lane.add","lane.resize","lane.split","elements.create","elements.delete","elements.move","shape.create","shape.delete","shape.move","shape.resize"];this.preExecute(o,5e3,(function(e){(i=i||new th).enter()})),this.postExecuted(o,500,(function(e){!function(){if(!i)throw new Error(n("out of bounds release"));var e=i.leave();e&&(t.updateLaneRefs(i.flowNodes,i.lanes),i=null)}()})),this.preExecute(["shape.create","shape.move","shape.delete","shape.resize"],(function(e){var t=e.context.shape,n=r();t.labelTarget||(Dr(t,"bpmn:Lane")&&n.addLane(t),Dr(t,"bpmn:FlowNode")&&n.addFlowNode(t))}))}function th(){this.flowNodes=[],this.lanes=[],this.counter=0,this.addLane=function(e){this.lanes.push(e)},this.addFlowNode=function(e){this.flowNodes.push(e)},this.enter=function(){this.counter++},this.leave=function(){return this.counter--,!this.counter}}function nh(e,t){as.call(this,e),this.preExecute("connection.delete",(function(e){var n=e.context.connection,i=n.source;(function(e,t){if(!Dr(e,"bpmn:SequenceFlow"))return!1;var n=Br(t),i=Br(e);return n.get("default")===i})(n,i)&&t.updateProperties(i,{default:null})}))}eh.$inject=["eventBus","modeling","translate"],i(eh,as),i(nh,as),nh.$inject=["eventBus","modeling"];var ih={__init__:["adaptiveLabelPositioningBehavior","appendBehavior","associationBehavior","attachEventBehavior","boundaryEventBehavior","rootElementReferenceBehavior","createBehavior","fixHoverBehavior","createDataObjectBehavior","createParticipantBehavior","dataStoreBehavior","dataInputAssociationBehavior","deleteLaneBehavior","detachEventBehavior","dropOnFlowBehavior","eventBasedGatewayBehavior","groupBehavior","importDockingFix","isHorizontalFix","labelBehavior","messageFlowBehavior","modelingFeedback","removeElementBehavior","removeParticipantBehavior","replaceConnectionBehavior","replaceElementBehaviour","resizeBehavior","resizeLaneBehavior","toggleElementCollapseBehaviour","spaceToolBehavior","subProcessStartEventBehavior","unclaimIdBehavior","unsetDefaultFlowBehavior","updateFlowNodeRefsBehavior"],adaptiveLabelPositioningBehavior:["type",hl],appendBehavior:["type",fl],associationBehavior:["type",vl],attachEventBehavior:["type",yl],boundaryEventBehavior:["type",bl],rootElementReferenceBehavior:["type",xl],createBehavior:["type",El],fixHoverBehavior:["type",_l],createDataObjectBehavior:["type",Pl],createParticipantBehavior:["type",Tl],dataInputAssociationBehavior:["type",kl],dataStoreBehavior:["type",Dl],deleteLaneBehavior:["type",Bl],detachEventBehavior:["type",Il],dropOnFlowBehavior:["type",Ll],eventBasedGatewayBehavior:["type",$l],groupBehavior:["type",ql],importDockingFix:["type",Gl],isHorizontalFix:["type",Wl],labelBehavior:["type",yd],messageFlowBehavior:["type",Cd],modelingFeedback:["type",Td],replaceConnectionBehavior:["type",Ad],removeParticipantBehavior:["type",Rd],replaceElementBehaviour:["type",kd],resizeBehavior:["type",Nd],resizeLaneBehavior:["type",Ud],removeElementBehavior:["type",Gd],toggleElementCollapseBehaviour:["type",Zd],spaceToolBehavior:["type",Kd],subProcessStartEventBehavior:["type",Jd],unclaimIdBehavior:["type",Qd],updateFlowNodeRefsBehavior:["type",eh],unsetDefaultFlowBehavior:["type",nh]};function rh(e,t){var n=vn(e,t,-15);return"intersect"!==n?n:null}function oh(e){us.call(this,e)}function ah(e){return!e||xo(e)}function sh(e){do{if(Dr(e,"bpmn:Process"))return Br(e);if(Dr(e,"bpmn:Participant"))return Br(e).processRef||Br(e)}while(e=e.parent)}function ch(e){return Dr(e,"bpmn:TextAnnotation")}function ph(e){return Dr(e,"bpmn:Group")&&!e.labelTarget}function uh(e){return Dr(e,"bpmn:BoundaryEvent")&&hh(e,"bpmn:CompensateEventDefinition")}function lh(e){return Br(e).isForCompensation}function dh(e){for(var t=e;t=t.parent;){if(Dr(t,"bpmn:FlowElementsContainer"))return Br(t);if(Dr(t,"bpmn:Participant"))return Br(t).processRef}return null}function hh(e,t){return!!x(Br(e).eventDefinitions||[],(function(e){return Dr(e,t)}))}function mh(e,t){return(Br(e).eventDefinitions||[]).every((function(e){return Dr(e,t)}))}function fh(e){return Dr(e,"bpmn:ReceiveTask")||Dr(e,"bpmn:IntermediateCatchEvent")&&(hh(e,"bpmn:MessageEventDefinition")||hh(e,"bpmn:TimerEventDefinition")||hh(e,"bpmn:ConditionalEventDefinition")||hh(e,"bpmn:SignalEventDefinition"))}function vh(e){return e.waypoints}function yh(e,t){return-1!==function(e){for(var t=[];e;)(e=e.parent)&&t.push(e);return t}(t).indexOf(e)}function gh(e,t,n){if(ah(e)||ah(t))return null;if(!Dr(n,"bpmn:DataAssociation")){if(kh(e,t))return{type:"bpmn:MessageFlow"};if(jh(e,t))return{type:"bpmn:SequenceFlow"}}var i=Mh(e,t);return i||(uh(e)&&lh(t)?{type:"bpmn:Association",associationDirection:"One"}:!!Rh(e,t)&&{type:"bpmn:Association"})}function bh(e,t,n){return!(!xo(e)&&!ph(e))||!(Dr(t,"bpmn:Participant")&&!Nr(t))&&(Dr(e,"bpmn:Participant")?Dr(t,"bpmn:Process")||Dr(t,"bpmn:Collaboration"):Qa(e,["bpmn:DataInput","bpmn:DataOutput"])&&e.parent?t===e.parent:Dr(e,"bpmn:Lane")?Dr(t,"bpmn:Participant")||Dr(t,"bpmn:Lane"):!(Dr(e,"bpmn:BoundaryEvent")&&(i=e,!Br(i).cancelActivity||!wh(i)&&!_h(i)))&&(Dr(e,"bpmn:FlowElement")&&!Dr(e,"bpmn:DataStoreReference")?Dr(t,"bpmn:FlowElementsContainer")?Nr(t):Qa(t,["bpmn:Participant","bpmn:Lane"]):Dr(e,"bpmn:DataStoreReference")&&Dr(t,"bpmn:Collaboration")?C(Br(t).get("participants"),(function(e){return!!e.get("processRef")})):Qa(e,["bpmn:Artifact","bpmn:DataAssociation","bpmn:DataStoreReference"])?Qa(t,["bpmn:Collaboration","bpmn:Lane","bpmn:Participant","bpmn:Process","bpmn:SubProcess"]):!!Dr(e,"bpmn:MessageFlow")&&(Dr(t,"bpmn:Collaboration")||e.source.parent==t||e.target.parent==t)));var i}function xh(e){return Dr(e,"bpmn:Lane")}function Eh(e){return!!function(e){return!xo(e)&&Dr(e,"bpmn:BoundaryEvent")}(e)||(!(!Dr(e,"bpmn:IntermediateThrowEvent")||!wh(e))||Dr(e,"bpmn:IntermediateCatchEvent")&&_h(e))}function wh(e){var t=Br(e);return t&&!(t.eventDefinitions&&t.eventDefinitions.length)}function _h(e){return Ph(e,["bpmn:MessageEventDefinition","bpmn:TimerEventDefinition","bpmn:SignalEventDefinition","bpmn:ConditionalEventDefinition"])}function Ph(e,t){return t.some((function(t){return hh(e,t)}))}function Sh(e,t,n,i){if(Array.isArray(e)||(e=[e]),1!==e.length)return!1;var r=e[0];return!xo(r)&&(!!Eh(r)&&(!Fr(t)&&(!(!Dr(t,"bpmn:Activity")||lh(t))&&(!(i&&!rh(i,t))&&(!function(e){return Dr(e,"bpmn:ReceiveTask")&&x(e.incoming,(function(e){return Dr(e.source,"bpmn:EventBasedGateway")}))}(t)&&"attach")))))}function Oh(e,t,n){if(!t)return!1;var i={replacements:[]};return _(e,(function(e){Fr(t)||Dr(e,"bpmn:StartEvent")&&"label"!==e.type&&bh(e,t)&&(Lr(e)||i.replacements.push({oldElementId:e.id,newElementType:"bpmn:StartEvent"}),($r(e)||zr(e)||qr(e))&&i.replacements.push({oldElementId:e.id,newElementType:"bpmn:StartEvent"}),Ph(e,["bpmn:MessageEventDefinition","bpmn:TimerEventDefinition","bpmn:SignalEventDefinition","bpmn:ConditionalEventDefinition"])&&Dr(t,"bpmn:SubProcess")&&i.replacements.push({oldElementId:e.id,newElementType:"bpmn:StartEvent"})),Dr(t,"bpmn:Transaction")||hh(e,"bpmn:CancelEventDefinition")&&"label"!==e.type&&(Dr(e,"bpmn:EndEvent")&&bh(e,t)&&i.replacements.push({oldElementId:e.id,newElementType:"bpmn:EndEvent"}),Dr(e,"bpmn:BoundaryEvent")&&Sh(e,t,0,n)&&i.replacements.push({oldElementId:e.id,newElementType:"bpmn:BoundaryEvent"}))})),!!i.replacements.length&&i}function Ch(e,t){return!C(e,xh)&&(!t||e.every((function(e){return bh(e,t)})))}function Th(e,t,n,i){return!!t&&(!(!xo(e)&&!ph(e))||n!==t&&((!n||!yh(n,t))&&(bh(e,t)||Dh(e,t))))}function Ah(e,t){return Dr(e,"bpmn:SubProcess")?Nr(e)&&(!t||t.width>=100&&t.height>=80):Dr(e,"bpmn:Lane")?!t||t.width>=130&&t.height>=60:Dr(e,"bpmn:Participant")?!t||t.width>=250&&t.height>=50:!!ch(e)||!!ph(e)}function Rh(e,t){return!vh(e)&&!vh(t)&&(!(!uh(e)||!lh(t))||!yh(t,e)&&!yh(e,t)&&(!!function(e,t){var n=ch(e),i=ch(t);return(n||i)&&n!==i}(e,t)||!!Mh(e,t)))}function kh(e,t){return!(Nh(e)&&!Nh(t))&&(Dr(i=e,"bpmn:InteractionNode")&&!Dr(i,"bpmn:BoundaryEvent")&&(!Dr(i,"bpmn:Event")||Dr(i,"bpmn:ThrowEvent")&&mh(i,"bpmn:MessageEventDefinition"))&&function(e){return Dr(e,"bpmn:InteractionNode")&&!lh(e)&&(!Dr(e,"bpmn:Event")||Dr(e,"bpmn:CatchEvent")&&mh(e,"bpmn:MessageEventDefinition"))&&!(Dr(e,"bpmn:BoundaryEvent")&&!hh(e,"bpmn:MessageEventDefinition"))}(t)&&(n=t,!(sh(e)===sh(n))));var n,i}function jh(e,t){return!(fh(t)&&t.incoming.length>0&&(n=t.incoming,(n=n||[]).some(Ih))&&!Dr(e,"bpmn:EventBasedGateway"))&&(Dr(r=e,"bpmn:FlowNode")&&!Dr(r,"bpmn:EndEvent")&&!Fr(r)&&!(Dr(r,"bpmn:IntermediateThrowEvent")&&hh(r,"bpmn:LinkEventDefinition"))&&!uh(r)&&!lh(r)&&function(e){return Dr(e,"bpmn:FlowNode")&&!Dr(e,"bpmn:StartEvent")&&!Dr(e,"bpmn:BoundaryEvent")&&!Fr(e)&&!(Dr(e,"bpmn:IntermediateCatchEvent")&&hh(e,"bpmn:LinkEventDefinition"))&&!lh(e)}(t)&&(i=t,dh(e)===dh(i))&&!(Dr(e,"bpmn:EventBasedGateway")&&!fh(t)));var n,i,r}function Mh(e,t){return Qa(e,["bpmn:DataObjectReference","bpmn:DataStoreReference"])&&Qa(t,["bpmn:Activity","bpmn:ThrowEvent"])?{type:"bpmn:DataInputAssociation"}:!(!Qa(t,["bpmn:DataObjectReference","bpmn:DataStoreReference"])||!Qa(e,["bpmn:Activity","bpmn:CatchEvent"]))&&{type:"bpmn:DataOutputAssociation"}}function Dh(e,t,n){if(!t)return!1;if(Array.isArray(e)){if(1!==e.length)return!1;e=e[0]}return t.source!==e&&t.target!==e&&(Qa(t,["bpmn:SequenceFlow","bpmn:MessageFlow"])&&!xo(t)&&Dr(e,"bpmn:FlowNode")&&!Dr(e,"bpmn:BoundaryEvent")&&bh(e,t.parent))}function Bh(e,t){return!!xo(t)||!(Dr(t,"bpmn:Lane")&&!function(e,t){return e&&t&&-1!==e.indexOf(t)}(e,t.parent))}function Ih(e){if(e&&e.source)return Dr(e.source,"bpmn:EventBasedGateway")}function Nh(e){return es(e,"bpmn:Process")||es(e,"bpmn:Collaboration")}i(oh,us),oh.$inject=["eventBus"],oh.prototype.init=function(){this.addRule("connection.start",(function(e){return function(e){if(ah(e))return null;return Qa(e,["bpmn:FlowNode","bpmn:InteractionNode","bpmn:DataObjectReference","bpmn:DataStoreReference","bpmn:Group","bpmn:TextAnnotation"])}(e.source)})),this.addRule("connection.create",(function(e){var t=e.source,n=e.target,i=e.hints||{},r=i.targetParent;if(i.targetAttach)return!1;r&&(n.parent=r);try{return gh(t,n)}finally{r&&(n.parent=null)}})),this.addRule("connection.reconnect",(function(e){var t=e.connection;return gh(e.source,e.target,t)})),this.addRule("connection.updateWaypoints",(function(e){return{type:e.connection.type}})),this.addRule("shape.resize",(function(e){return Ah(e.shape,e.newBounds)})),this.addRule("elements.create",(function(e){var t=e.elements,n=e.position,i=e.target;return!(vh(i)&&!Dh(t,i))&&O(t,(function(e){return vh(e)?gh(e.source,e.target,e):e.host?Sh(e,e.host,null,n):Th(e,i,null)}))})),this.addRule("elements.move",(function(e){var t=e.target,n=e.shapes,i=e.position;return Sh(n,t,null,i)||Oh(n,t,i)||Ch(n,t)||Dh(n,t)})),this.addRule("shape.create",(function(e){return Th(e.shape,e.target,e.source,e.position)})),this.addRule("shape.attach",(function(e){return Sh(e.shape,e.target,null,e.position)})),this.addRule("element.copy",(function(e){var t=e.element;return Bh(e.elements,t)}))},oh.prototype.canConnectMessageFlow=kh,oh.prototype.canConnectSequenceFlow=jh,oh.prototype.canConnectDataAssociation=Mh,oh.prototype.canConnectAssociation=Rh,oh.prototype.canMove=Ch,oh.prototype.canAttach=Sh,oh.prototype.canReplace=Oh,oh.prototype.canDrop=bh,oh.prototype.canInsert=Dh,oh.prototype.canCreate=Th,oh.prototype.canConnect=gh,oh.prototype.canResize=Ah,oh.prototype.canCopy=Bh;var Lh={__depends__:[Ss],__init__:["bpmnRules"],bpmnRules:["type",oh]};function Fh(e,t){e.on("saveXML.start",2e3,(function(){var e,n,i=t.getRootElement(),r=Br(i).di;e=w(e=mt([i],!1),(function(e){return e!==i&&!e.labelTarget})),n=T(e,Kr),r.set("planeElement",n)}))}Fh.$inject=["eventBus","canvas"];var Vh={__init__:["bpmnDiOrdering"],bpmnDiOrdering:["type",Fh]};function $h(e){as.call(this,e);var t=this;this.preExecute(["shape.create","connection.create"],(function(e){var n=e.context,i=n.shape||n.connection,r=n.parent,o=t.getOrdering(i,r);o&&(void 0!==o.parent&&(n.parent=o.parent),n.parentIndex=o.index)})),this.preExecute(["shape.move","connection.move"],(function(e){var n=e.context,i=n.shape||n.connection,r=n.newParent||i.parent,o=t.getOrdering(i,r);o&&(void 0!==o.parent&&(n.newParent=o.parent),n.newParentIndex=o.index)}))}function zh(e,t,n){$h.call(this,e);var i=[{type:"bpmn:SubProcess",order:{level:6}},{type:"bpmn:SequenceFlow",order:{level:3,containers:["bpmn:Participant","bpmn:FlowElementsContainer"]}},{type:"bpmn:DataAssociation",order:{level:9,containers:["bpmn:Collaboration","bpmn:Process"]}},{type:"bpmn:MessageFlow",order:{level:9,containers:["bpmn:Collaboration"]}},{type:"bpmn:Association",order:{level:6,containers:["bpmn:Participant","bpmn:FlowElementsContainer","bpmn:Collaboration"]}},{type:"bpmn:BoundaryEvent",order:{level:8}},{type:"bpmn:Group",order:{level:10,containers:["bpmn:Collaboration","bpmn:Process"]}},{type:"bpmn:FlowElement",order:{level:5}},{type:"bpmn:Participant",order:{level:-2}},{type:"bpmn:Lane",order:{level:-1}}];function r(e){var t=e.order;if(t||(e.order=t=function(e){if(e.labelTarget)return{level:10};var t=x(i,(function(t){return Qa(e,[t.type])}));return t&&t.order||{level:1}}(e)),!t)throw new Error("no order for <"+e.id+">");return t}this.getOrdering=function(e,n){if(e.labelTarget)return{parent:t.getRootElement(),index:-1};var i=r(e);i.containers&&(n=function(e,t,n){for(var i=t;i&&!Qa(i,n);)i=i.parent;if(!i)throw new Error("no parent for <"+e.id+"> in <"+(t&&t.id)+">");return i}(e,n,i.containers));var o=n.children.indexOf(e),a=E(n.children,(function(t){return!(!e.labelTarget&&t.labelTarget)&&i.level<r(t).level}));return-1!==a&&-1!==o&&o<a&&(a-=1),{index:a,parent:n}}}$h.prototype.getOrdering=function(e,t){return null},i($h,as),zh.$inject=["eventBus","canvas","translate"],i(zh,$h);var qh={__depends__:[ho],__init__:["bpmnOrderingProvider"],bpmnOrderingProvider:["type",zh]};function Uh(e,t){this._handlerMap={},this._stack=[],this._stackIdx=-1,this._currentExecution={actions:[],dirty:[],trigger:null},this._injector=t,this._eventBus=e,this._uid=1,e.on(["diagram.destroy","diagram.clear"],(function(){this.clear(!1)}),this)}Uh.$inject=["eventBus","injector"],Uh.prototype.execute=function(e,t){if(!e)throw new Error("command required");this._currentExecution.trigger="execute";var n={command:e,context:t};this._pushAction(n),this._internalExecute(n),this._popAction(n)},Uh.prototype.canExecute=function(e,t){var n={command:e,context:t},i=this._getHandler(e),r=this._fire(e,"canExecute",n);if(void 0===r){if(!i)return!1;i.canExecute&&(r=i.canExecute(t))}return r},Uh.prototype.clear=function(e){this._stack.length=0,this._stackIdx=-1,!1!==e&&this._fire("changed",{trigger:"clear"})},Uh.prototype.undo=function(){var e,t=this._getUndoAction();if(t){for(this._currentExecution.trigger="undo",this._pushAction(t);t&&(this._internalUndo(t),(e=this._getUndoAction())&&e.id===t.id);)t=e;this._popAction()}},Uh.prototype.redo=function(){var e,t=this._getRedoAction();if(t){for(this._currentExecution.trigger="redo",this._pushAction(t);t&&(this._internalExecute(t,!0),(e=this._getRedoAction())&&e.id===t.id);)t=e;this._popAction()}},Uh.prototype.register=function(e,t){this._setHandler(e,t)},Uh.prototype.registerHandler=function(e,t){if(!e||!t)throw new Error("command and handlerCls must be defined");var n=this._injector.instantiate(t);this.register(e,n)},Uh.prototype.canUndo=function(){return!!this._getUndoAction()},Uh.prototype.canRedo=function(){return!!this._getRedoAction()},Uh.prototype._getRedoAction=function(){return this._stack[this._stackIdx+1]},Uh.prototype._getUndoAction=function(){return this._stack[this._stackIdx]},Uh.prototype._internalUndo=function(e){var t=this,n=e.command,i=e.context,r=this._getHandler(n);this._atomicDo((function(){t._fire(n,"revert",e),r.revert&&t._markDirty(r.revert(i)),t._revertedAction(e),t._fire(n,"reverted",e)}))},Uh.prototype._fire=function(e,t,n){arguments.length<3&&(n=t,t=null);var i,r,o,a=t?[e+"."+t,t]:[e];for(n=this._eventBus.createEvent(n),i=0;(r=a[i])&&(o=this._eventBus.fire("commandStack."+r,n),!n.cancelBubble);i++);return o},Uh.prototype._createId=function(){return this._uid++},Uh.prototype._atomicDo=function(e){var t=this._currentExecution;t.atomic=!0;try{e()}finally{t.atomic=!1}},Uh.prototype._internalExecute=function(e,t){var n=this,i=e.command,r=e.context,o=this._getHandler(i);if(!o)throw new Error("no command handler registered for <"+i+">");this._pushAction(e),t||(this._fire(i,"preExecute",e),o.preExecute&&o.preExecute(r),this._fire(i,"preExecuted",e)),this._atomicDo((function(){n._fire(i,"execute",e),o.execute&&n._markDirty(o.execute(r)),n._executedAction(e,t),n._fire(i,"executed",e)})),t||(this._fire(i,"postExecute",e),o.postExecute&&o.postExecute(r),this._fire(i,"postExecuted",e)),this._popAction(e)},Uh.prototype._pushAction=function(e){var t=this._currentExecution,n=t.actions,i=n[0];if(t.atomic)throw new Error("illegal invocation in <execute> or <revert> phase (action: "+e.command+")");e.id||(e.id=i&&i.id||this._createId()),n.push(e)},Uh.prototype._popAction=function(){var e=this._currentExecution,t=e.trigger,n=e.actions,i=e.dirty;n.pop(),n.length||(this._eventBus.fire("elements.changed",{elements:M("id",i.reverse())}),i.length=0,this._fire("changed",{trigger:t}),e.trigger=null)},Uh.prototype._markDirty=function(e){var t=this._currentExecution;e&&(e=h(e)?e:[e],t.dirty=t.dirty.concat(e))},Uh.prototype._executedAction=function(e,t){var n=++this._stackIdx;t||this._stack.splice(n,this._stack.length,e)},Uh.prototype._revertedAction=function(e){this._stackIdx--},Uh.prototype._getHandler=function(e){return this._handlerMap[e]},Uh.prototype._setHandler=function(e,t){if(!e||!t)throw new Error("command and handler required");if(this._handlerMap[e])throw new Error("overriding handler for command <"+e+">");this._handlerMap[e]=t};var Gh={commandStack:["type",Uh]},Hh=new Wo("tt");function Wh(e,t){e.style.display=!1===t?"none":""}var Kh=".djs-tooltip";function Xh(e,t){this._eventBus=e,this._canvas=t,this._ids=Hh,this._tooltipDefaults={show:{minZoom:.7,maxZoom:5}},this._tooltips={},this._tooltipRoot=function(e){var t=he('<div class="djs-tooltip-container" style="position: absolute; width: 0; height: 0;" />');return e.insertBefore(t,e.firstChild),t}(t.getContainer());var n=this;de.bind(this._tooltipRoot,Kh,"mousedown",(function(e){e.stopPropagation()})),de.bind(this._tooltipRoot,Kh,"mouseover",(function(e){n.trigger("mouseover",e)})),de.bind(this._tooltipRoot,Kh,"mouseout",(function(e){n.trigger("mouseout",e)})),this._init()}Xh.$inject=["eventBus","canvas"],Xh.prototype.add=function(e){if(!e.position)throw new Error("must specifiy tooltip position");if(!e.html)throw new Error("must specifiy tooltip html");var t=this._ids.next();return e=U({},this._tooltipDefaults,e,{id:t}),this._addTooltip(e),e.timeout&&this.setTimeout(e),t},Xh.prototype.trigger=function(e,t){var n=t.delegateTarget||t.target,i=this.get(K(n,"data-tooltip-id"));i&&("mouseover"===e&&i.timeout&&this.clearTimeout(i),"mouseout"===e&&i.timeout&&(i.timeout=1e3,this.setTimeout(i)))},Xh.prototype.get=function(e){return"string"!=typeof e&&(e=e.id),this._tooltips[e]},Xh.prototype.clearTimeout=function(e){if(e=this.get(e)){var t=e.removeTimer;t&&(clearTimeout(t),e.removeTimer=null)}},Xh.prototype.setTimeout=function(e){if(e=this.get(e)){this.clearTimeout(e);var t=this;e.removeTimer=setTimeout((function(){t.remove(e)}),e.timeout)}},Xh.prototype.remove=function(e){var t=this.get(e);t&&(ge(t.html),ge(t.htmlContainer),delete t.htmlContainer,delete this._tooltips[t.id])},Xh.prototype.show=function(){Wh(this._tooltipRoot)},Xh.prototype.hide=function(){Wh(this._tooltipRoot,!1)},Xh.prototype._updateRoot=function(e){var t=e.scale||1,n=e.scale||1,i="matrix("+t+",0,0,"+n+","+-1*e.x*t+","+-1*e.y*n+")";this._tooltipRoot.style.transform=i,this._tooltipRoot.style["-ms-transform"]=i},Xh.prototype._addTooltip=function(e){var t,n=e.id,i=e.html,r=this._tooltipRoot;i.get&&i.constructor.prototype.jquery&&(i=i.get(0)),y(i)&&(i=he(i)),(t=he('<div data-tooltip-id="'+n+'" class="'+'djs-tooltip" style="position: absolute">')).appendChild(i),e.type&&Q(t).add("djs-tooltip-"+e.type),e.className&&Q(t).add(e.className),e.htmlContainer=t,r.appendChild(t),this._tooltips[n]=e,this._updateTooltip(e)},Xh.prototype._updateTooltip=function(e){var t,n,i,r=e.position,o=e.htmlContainer;t=o,n=r.x,i=r.y,U(t.style,{left:n+"px",top:i+"px"})},Xh.prototype._updateTooltipVisibilty=function(e){_(this._tooltips,(function(t){var n=t.show,i=t.htmlContainer,r=!0;n&&((n.minZoom>e.scale||n.maxZoom<e.scale)&&(r=!1),Wh(i,r))}))},Xh.prototype._init=function(){var e=this;this._eventBus.on("canvas.viewbox.changing",(function(t){e.hide()})),this._eventBus.on("canvas.viewbox.changed",(function(t){var n;n=t.viewbox,e._updateRoot(n),e._updateTooltipVisibilty(n),e.show()}))};var Yh={__init__:["tooltips"],tooltips:["type",Xh]};function Jh(e,t){if("function"!=typeof t)throw new Error("removeFn iterator must be a function");if(e){for(var n;n=e[0];)t(n);return e}}function Zh(e,t,n){as.call(this,t);var i=e.get("movePreview",!1);t.on("shape.move.start",1400,(function(e){var t=e.context,n=t.shapes,i=t.validatedShapes;t.shapes=Qh(n),t.validatedShapes=Qh(i)})),i&&t.on("shape.move.start",250,(function(e){var t=e.context,n=t.shapes,r=[];_(n,(function(e){_(e.labels,(function(n){n.hidden||-1!==t.shapes.indexOf(n)||r.push(n),e.labelTarget&&r.push(e)}))})),_(r,(function(e){i.makeDraggable(t,e,!0)}))})),this.preExecuted("elements.move",1400,(function(e){var t=e.context.closure,n=t.enclosedElements,i=[];_(n,(function(e){_(e.labels,(function(e){n[e.id]||i.push(e)}))})),t.addAll(i)})),this.preExecute(["connection.delete","shape.delete"],(function(e){var t=e.context;Jh((t.connection||t.shape).labels,(function(e){n.removeShape(e,{nested:!0})}))})),this.execute("shape.delete",(function(e){var t=e.context,n=t.shape,i=n.labelTarget;i&&(t.labelTargetIndex=_t(i.labels,n),t.labelTarget=i,n.labelTarget=null)})),this.revert("shape.delete",(function(e){var t=e.context,n=t.shape,i=t.labelTarget,r=t.labelTargetIndex;i&&(wt(i.labels,n,r),n.labelTarget=i)}))}function Qh(e){return w(e,(function(t){return-1===e.indexOf(t.labelTarget)}))}i(Zh,as),Zh.$inject=["injector","eventBus","modeling"];var em={__init__:["labelSupport"],labelSupport:["type",Zh]},tm="attach-ok";function nm(e,t,n,i,r){as.call(this,t);var o=e.get("movePreview",!1);t.on("shape.move.start",1401,(function(e){var t,n,i=e.context,r=i.shapes,o=i.validatedShapes;i.shapes=(n=im(t=r),D("id",t,n)),i.validatedShapes=function(e){var t=j(e,"id");return w(e,(function(e){for(;e;){if(e.host&&t[e.host.id])return!1;e=e.parent}return!0}))}(o)})),o&&t.on("shape.move.start",251,(function(e){var t=e.context;_(im(t.shapes),(function(e){o.makeDraggable(t,e,!0),_(e.labels,(function(e){o.makeDraggable(t,e,!0)}))}))})),o&&t.on("shape.move.start",(function(e){var i=e.context.shapes;if(1===i.length){var r=i[0].host;r&&(n.addMarker(r,tm),t.once(["shape.move.out","shape.move.cleanup"],(function(){n.removeMarker(r,tm)})))}})),this.preExecuted("elements.move",1401,(function(e){var t=e.context,n=t.closure;_(im(t.shapes),(function(e){n.add(e,n.topLevel[e.host.id])}))})),this.postExecuted("elements.move",(function(e){var t=e.context,n=t.shapes,i=t.newHost;i&&1!==n.length||_(i?n:w(n,(function(e){var t,i=e.host;return function(e){return!!e.host}(e)&&(t=i,!(-1!==n.indexOf(t)))})),(function(e){r.updateAttachment(e,i)}))})),this.postExecuted("elements.move",(function(e){_(e.context.shapes,(function(e){_(e.attachers,(function(e){_(e.outgoing.slice(),(function(e){i.allowed("connection.reconnect",{connection:e,source:e.source,target:e.target})||r.removeConnection(e)})),_(e.incoming.slice(),(function(e){i.allowed("connection.reconnect",{connection:e,source:e.source,target:e.target})||r.removeConnection(e)}))}))}))})),this.postExecute("shape.create",(function(e){var t=e.context,n=t.shape,i=t.host;i&&r.updateAttachment(n,i)})),this.postExecute("shape.replace",(function(e){var t=e.context,n=t.oldShape,o=t.newShape;Jh(n.attachers,(function(e){"attach"===i.allowed("elements.move",{target:o,shapes:[e]})?r.updateAttachment(e,o):r.removeShape(e)})),o.attachers.length&&_(o.attachers,(function(e){var t=hd(e,n,o);r.moveShape(e,t,e.parent)}))})),this.postExecute("shape.resize",(function(e){var t=e.context,n=t.shape,i=t.oldBounds,o=t.newBounds,a=n.attachers;!1!==(t.hints||{}).attachSupport&&_(a,(function(e){var t=hd(e,i,o);r.moveShape(e,t,e.parent),_(e.labels,(function(e){r.moveShape(e,t,e.parent)}))}))})),this.preExecute("shape.delete",(function(e){var t=e.context.shape;Jh(t.attachers,(function(e){r.removeShape(e)})),t.host&&r.updateAttachment(t,null)}))}function im(e){return s(T(e,(function(e){return e.attachers||[]})))}i(nm,as),nm.$inject=["injector","eventBus","canvas","rules","modeling"];var rm={__depends__:[Ss],__init__:["attachSupport"],attachSupport:["type",nm]};function om(e,t){this._eventBus=e,this._dragging=t,this._tools=[],this._active=null}om.$inject=["eventBus","dragging"],om.prototype.registerTool=function(e,t){var n=this._tools;if(!t)throw new Error('A tool has to be registered with it\'s "events"');n.push(e),this.bindEvents(e,t)},om.prototype.isActive=function(e){return e&&this._active===e},om.prototype.length=function(e){return this._tools.length},om.prototype.setActive=function(e){var t=this._eventBus;this._active!==e&&(this._active=e,t.fire("tool-manager.update",{tool:e}))},om.prototype.bindEvents=function(e,t){var n=this._eventBus,i=this._dragging,r=[];n.on(t.tool+".init",(function(t){if(!t.context.reactivate&&this.isActive(e))return this.setActive(null),void i.cancel();this.setActive(e)}),this),_(t,(function(e){r.push(e+".ended"),r.push(e+".canceled")})),n.on(r,250,(function(e){this._active&&(function(e){var t=e.originalEvent&&e.originalEvent.target;return t&&oe(t,'.group[data-group="tools"]')}(e)||this.setActive(null))}),this)};var am={__depends__:[xs],__init__:["toolManager"],toolManager:["type",om]};function sm(e,t){return-1!==e.indexOf(t)}var cm=Math.abs,pm=Math.round,um={x:"width",y:"height"},lm="crosshair",dm={n:"top",w:"left",s:"bottom",e:"right"},hm={n:"s",w:"e",s:"n",e:"w"};function mm(e,t,n,i,r,o,a){this._canvas=e,this._dragging=t,this._eventBus=n,this._modeling=i,this._rules=r,this._toolManager=o,this._mouse=a;var s=this;o.registerTool("space",{tool:"spaceTool.selection",dragging:"spaceTool"}),n.on("spaceTool.selection.end",(function(e){n.once("spaceTool.selection.ended",(function(){s.activateMakeSpace(e.originalEvent)}))})),n.on("spaceTool.move",1500,(function(e){var t=e.context,n=t.initialized;n||(n=t.initialized=s.init(e,t)),n&&vm(e)})),n.on("spaceTool.end",(function(e){var t=e.context,i=t.axis,r=t.direction,o=t.movingShapes,a=t.resizingShapes,c=t.start;if(t.initialized){vm(e);var p={x:0,y:0};p[i]=pm(e["d"+i]),s.makeSpace(o,a,p,r,c),n.once("spaceTool.ended",(function(e){s.activateSelection(e.originalEvent,!0,!0)}))}}))}function fm(e){return{top:e.top-20,right:e.right+20,bottom:e.bottom+20,left:e.left-20}}function vm(e){var t,n,i=e.context.spaceToolConstraints;i&&(f(i.left)&&(t=Math.max(e.x,i.left),e.dx=e.dx+t-e.x,e.x=t),f(i.right)&&(t=Math.min(e.x,i.right),e.dx=e.dx+t-e.x,e.x=t),f(i.top)&&(n=Math.max(e.y,i.top),e.dy=e.dy+n-e.y,e.y=n),f(i.bottom)&&(n=Math.min(e.y,i.bottom),e.dy=e.dy+n-e.y,e.y=n))}function ym(e,t){return-1!==e.indexOf(t)}function gm(e){return!!e.waypoints}function bm(e){return!!e.labelTarget}mm.$inject=["canvas","dragging","eventBus","modeling","rules","toolManager","mouse"],mm.prototype.activateSelection=function(e,t,n){this._dragging.init(e,"spaceTool.selection",{autoActivate:t,cursor:lm,data:{context:{reactivate:n}},trapClick:!1})},mm.prototype.activateMakeSpace=function(e){this._dragging.init(e,"spaceTool",{autoActivate:!0,cursor:lm,data:{context:{}}})},mm.prototype.makeSpace=function(e,t,n,i,r){return this._modeling.createSpace(e,t,n,i,r)},mm.prototype.init=function(e,t){var n=cm(e.dx)>cm(e.dy)?"x":"y",i=e["d"+n],r=e[n]-i;if(cm(i)<5)return!1;i<0&&(i*=-1),jo(e)&&(i*=-1);var o=function(e,t){if("x"===e){if(t>0)return"e";if(t<0)return"w"}if("y"===e){if(t>0)return"s";if(t<0)return"n"}return null}(n,i),a=mt(this._canvas.getRootElement(),!0),s=this.calculateAdjustments(a,n,i,r);return U(t,s,{axis:n,direction:o,spaceToolConstraints:function(e,t,n,i,r){var o=e.movingShapes,a=e.resizingShapes;if(!a.length)return;var s,c,p={};return _(a,(function(e){var u,l,d,h=hn(e),m=w(e.children,(function(e){return!(gm(e)||bm(e)||ym(o,e)||ym(a,e))})),v=w(e.children,(function(e){return!gm(e)&&!bm(e)&&ym(o,e)}));m.length&&(l=fm(hn(ft(m))),u=i-h[dm[n]]+l[dm[n]],"n"===n?p.bottom=c=f(c)?Math.min(c,u):u:"w"===n?p.right=c=f(c)?Math.min(c,u):u:"s"===n?p.top=s=f(s)?Math.max(s,u):u:"e"===n&&(p.left=s=f(s)?Math.max(s,u):u)),v.length&&(d=fm(hn(ft(v))),u=i-d[dm[hm[n]]]+h[dm[hm[n]]],"n"===n?p.bottom=c=f(c)?Math.min(c,u):u:"w"===n?p.right=c=f(c)?Math.min(c,u):u:"s"===n?p.top=s=f(s)?Math.max(s,u):u:"e"===n&&(p.left=s=f(s)?Math.max(s,u):u));var y=r&&r[e.id];y&&("n"===n?(u=i+e[um[t]]-y[um[t]],p.bottom=c=f(c)?Math.min(c,u):u):"w"===n?(u=i+e[um[t]]-y[um[t]],p.right=c=f(c)?Math.min(c,u):u):"s"===n?(u=i-e[um[t]]+y[um[t]],p.top=s=f(s)?Math.max(s,u):u):"e"===n&&(u=i-e[um[t]]+y[um[t]],p.left=s=f(s)?Math.max(s,u):u))})),p}(s,n,o,r,this._eventBus.fire("spaceTool.getMinDimensions",{axis:n,direction:o,shapes:s.resizingShapes,start:r})),start:r}),ya("resize-"+("x"===n?"ew":"ns")),!0},mm.prototype.calculateAdjustments=function(e,t,n,i){var r=this._rules,o=[],a=[];return _(e,(function(e){if(e.parent&&!gm(e)){var s=e[t],c=s+e[um[t]];return n>0&&s>i||n<0&&c<i?o.push(e):s<i&&c>i&&r.allowed("shape.resize",{shape:e})?a.push(e):void 0}})),{movingShapes:o,resizingShapes:a}},mm.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var e=this._mouse.getLastMoveEvent();this.activateSelection(e,!!e)},mm.prototype.isActive=function(){var e=this._dragging.context();return e&&/^spaceTool/.test(e.prefix)};var xm="djs-dragging",Em="djs-resizing",wm=Math.max;function _m(e,t,n,i,r){function o(e,t){_(e,(function(e){r.addDragger(e,t),n.addMarker(e,xm)}))}e.on("spaceTool.selection.start",(function(e){var t=n.getLayer("space"),r=e.context,o="M 0,-10000 L 0,10000",a="M -10000,0 L 10000,0",s=Ne("g");Pe(s,i.cls("djs-crosshair-group",["no-events"])),Ee(t,s);var c=Ne("path");Pe(c,"d",o),Ae(c).add("djs-crosshair"),Ee(s,c);var p=Ne("path");Pe(p,"d",a),Ae(p).add("djs-crosshair"),Ee(s,p),r.crosshairGroup=s})),e.on("spaceTool.selection.move",(function(e){Yn(e.context.crosshairGroup,e.x,e.y)})),e.on("spaceTool.selection.cleanup",(function(e){var t=e.context.crosshairGroup;t&&ke(t)})),e.on("spaceTool.move",250,(function(e){var a=e.context,s=a.line,c=a.axis,p=a.movingShapes,u=a.resizingShapes;if(a.initialized){if(!a.dragGroup){var l=n.getLayer("space");Pe(s=Ne("path"),"d","M0,0 L0,0"),Ae(s).add("djs-crosshair"),Ee(l,s),a.line=s;var d=Ne("g");Pe(d,i.cls("djs-drag-group",["no-events"])),Ee(n.getActiveLayer(),d),o(p,d),o(a.movingConnections=t.filter((function(e){var t=!1;_(p,(function(n){_(n.outgoing,(function(n){e===n&&(t=!0)}))}));var n=!1;_(p,(function(t){_(t.incoming,(function(t){e===t&&(n=!0)}))}));var i=!1;_(u,(function(t){_(t.outgoing,(function(t){e===t&&(i=!0)}))}));var r=!1;return _(u,(function(t){_(t.incoming,(function(t){e===t&&(r=!0)}))})),function(e){return e.waypoints}(e)&&(t||i)&&(n||r)})),d),a.dragGroup=d}if(!a.frameGroup){var h=Ne("g");Pe(h,i.cls("djs-frame-group",["no-events"])),Ee(n.getActiveLayer(),h);var m=[];_(u,(function(e){var t=r.addFrame(e,h),i=t.getBBox();m.push({element:t,initialBounds:i}),n.addMarker(e,Em)})),a.frameGroup=h,a.frames=m}Pe(s,{d:{x:"M"+e.x+", -10000 L"+e.x+", 10000",y:"M -10000, "+e.y+" L 10000, "+e.y}[c]});var f={x:e.dx,y:e.dy};f[{x:"y",y:"x"}[a.axis]]=0,Yn(a.dragGroup,f.x,f.y),_(a.frames,(function(e){var t,n,i=e.element,r=e.initialBounds;"e"===a.direction?Pe(i,{width:wm(r.width+f.x,5)}):Pe(i,{width:t=wm(r.width-f.x,5),x:r.x+r.width-t}),"s"===a.direction?Pe(i,{height:wm(r.height+f.y,5)}):Pe(i,{height:n=wm(r.height-f.y,5),y:r.y+r.height-n})}))}})),e.on("spaceTool.cleanup",(function(e){var t=e.context,i=t.movingShapes,r=t.movingConnections,o=t.resizingShapes,a=t.line,s=t.dragGroup,c=t.frameGroup;_(i,(function(e){n.removeMarker(e,xm)})),_(r,(function(e){n.removeMarker(e,xm)})),s&&(ke(a),ke(s)),_(o,(function(e){n.removeMarker(e,Em)})),c&&ke(c)}))}_m.$inject=["eventBus","elementRegistry","canvas","styles","previewSupport"];var Pm={__init__:["spaceToolPreview"],__depends__:[xs,Ss,am,Fc,rp],spaceTool:["type",mm],spaceToolPreview:["type",_m]};function Sm(e){this._model=e}function Om(e,t,n,i){as.call(this,e),this._bpmnFactory=t,this._translate=i;var r=this;function o(e){_(e.context.oldRoot.children,(function(e){Dr(e,"bpmn:BaseElement")&&r.updateParent(e)}))}function a(e){var t=e.context.shape;Dr(t,"bpmn:BaseElement")&&r.updateBounds(t)}function s(e){r.updateConnection(e.context)}function c(e){r.updateConnectionWaypoints(e.context.connection)}function p(e){r.updateAttachment(e.context)}this.executed(["connection.layout","connection.create"],(function(e){var t,i=e.context,r=i.hints||{};i.cropped||!1===r.createElementsBehavior||((t=i.connection).waypoints=n.getCroppedWaypoints(t),i.cropped=!0)})),this.reverted(["connection.layout"],(function(e){delete e.context.cropped})),this.executed(["shape.move","shape.create","shape.delete","connection.create","connection.move","connection.delete"],Cm((function(e){var t=e.context;r.updateParent(t.shape||t.connection,t.oldParent)}))),this.reverted(["shape.move","shape.create","shape.delete","connection.create","connection.move","connection.delete"],Cm((function(e){var t=e.context,n=t.shape||t.connection,i=t.parent||t.newParent;r.updateParent(n,i)}))),this.executed(["canvas.updateRoot"],o),this.reverted(["canvas.updateRoot"],o),this.executed(["shape.move","shape.create","shape.resize"],Cm((function(e){"label"!==e.context.shape.type&&a(e)}))),this.reverted(["shape.move","shape.create","shape.resize"],Cm((function(e){"label"!==e.context.shape.type&&a(e)}))),e.on("shape.changed",(function(e){"label"===e.element.type&&a({context:{shape:e.element}})})),this.executed(["connection.create","connection.move","connection.delete","connection.reconnect"],Cm(s)),this.reverted(["connection.create","connection.move","connection.delete","connection.reconnect"],Cm(s)),this.executed(["connection.layout","connection.move","connection.updateWaypoints"],Cm(c)),this.reverted(["connection.layout","connection.move","connection.updateWaypoints"],Cm(c)),this.executed("connection.reconnect",Cm((function(e){var t=e.context,n=t.connection,i=t.oldSource,r=t.newSource,o=Br(n),a=Br(i),s=Br(r);o.conditionExpression&&!Qa(s,["bpmn:Activity","bpmn:ExclusiveGateway","bpmn:InclusiveGateway"])&&(t.oldConditionExpression=o.conditionExpression,delete o.conditionExpression),i!==r&&a.default===o&&(t.oldDefault=a.default,delete a.default)}))),this.reverted("connection.reconnect",Cm((function(e){var t=e.context,n=t.connection,i=t.oldSource,r=t.newSource,o=Br(n),a=Br(i),s=Br(r);t.oldConditionExpression&&(o.conditionExpression=t.oldConditionExpression),t.oldDefault&&(a.default=t.oldDefault,delete s.default)}))),this.executed(["element.updateAttachment"],Cm(p)),this.reverted(["element.updateAttachment"],Cm(p))}function Cm(e){return function(t){var n=t.context;Dr(n.shape||n.connection,"bpmn:BaseElement")&&e(t)}}function Tm(e,t,n){Un.call(this),this._bpmnFactory=e,this._moddle=t,this._translate=n}function Am(e,t,n){e[n]=t[n],delete t[n]}function Rm(e,t){this._modeling=e,this._canvas=t}function km(e){this._modeling=e}function jm(e,t){this._canvas=e,this._layouter=t}Sm.$inject=["moddle"],Sm.prototype._needsId=function(e){return Qa(e,["bpmn:RootElement","bpmn:FlowElement","bpmn:MessageFlow","bpmn:DataAssociation","bpmn:Artifact","bpmn:Participant","bpmn:Lane","bpmn:LaneSet","bpmn:Process","bpmn:Collaboration","bpmndi:BPMNShape","bpmndi:BPMNEdge","bpmndi:BPMNDiagram","bpmndi:BPMNPlane","bpmn:Property","bpmn:CategoryValue"])},Sm.prototype._ensureId=function(e){var t;t=Dr(e,"bpmn:Activity")?"Activity":Dr(e,"bpmn:Event")?"Event":Dr(e,"bpmn:Gateway")?"Gateway":Qa(e,["bpmn:SequenceFlow","bpmn:MessageFlow"])?"Flow":(e.$type||"").replace(/^[^:]*:/g,""),t+="_",!e.id&&this._needsId(e)&&(e.id=this._model.ids.nextPrefixed(t,e))},Sm.prototype.create=function(e,t){var n=this._model.create(e,t||{});return this._ensureId(n),n},Sm.prototype.createDiLabel=function(){return this.create("bpmndi:BPMNLabel",{bounds:this.createDiBounds()})},Sm.prototype.createDiShape=function(e,t,n){return this.create("bpmndi:BPMNShape",U({bpmnElement:e,bounds:this.createDiBounds(t)},n))},Sm.prototype.createDiBounds=function(e){return this.create("dc:Bounds",e)},Sm.prototype.createDiWaypoints=function(e){var t=this;return T(e,(function(e){return t.createDiWaypoint(e)}))},Sm.prototype.createDiWaypoint=function(e){return this.create("dc:Point",G(e,["x","y"]))},Sm.prototype.createDiEdge=function(e,t,n){return this.create("bpmndi:BPMNEdge",U({bpmnElement:e},n))},Sm.prototype.createDiPlane=function(e){return this.create("bpmndi:BPMNPlane",{bpmnElement:e})},i(Om,as),Om.$inject=["eventBus","bpmnFactory","connectionDocking","translate"],Om.prototype.updateAttachment=function(e){var t=e.shape,n=t.businessObject,i=t.host;n.attachedToRef=i&&i.businessObject},Om.prototype.updateParent=function(e,t){if(!(e instanceof $n||Dr(e,"bpmn:DataStoreReference")&&e.parent&&Dr(e.parent,"bpmn:Collaboration"))){var n=e.parent,i=e.businessObject,r=n&&n.businessObject,o=r&&r.di;Dr(e,"bpmn:FlowNode")&&this.updateFlowNodeRefs(i,r,t&&t.businessObject),Dr(e,"bpmn:DataOutputAssociation")&&(r=e.source?e.source.businessObject:null),Dr(e,"bpmn:DataInputAssociation")&&(r=e.target?e.target.businessObject:null),this.updateSemanticParent(i,r),Dr(e,"bpmn:DataObjectReference")&&i.dataObjectRef&&this.updateSemanticParent(i.dataObjectRef,r),this.updateDiParent(i.di,o)}},Om.prototype.updateBounds=function(e){var t=e.businessObject.di,n=e instanceof $n?this._getLabel(t):t,i=n.bounds;i||(i=this._bpmnFactory.createDiBounds(),n.set("bounds",i)),U(i,{x:e.x,y:e.y,width:e.width,height:e.height})},Om.prototype.updateFlowNodeRefs=function(e,t,n){n!==t&&(Dr(n,"bpmn:Lane")&&Et(n.get("flowNodeRef"),e),Dr(t,"bpmn:Lane")&&wt(t.get("flowNodeRef"),e))},Om.prototype.updateDiConnection=function(e,t,n){e.sourceElement&&e.sourceElement.bpmnElement!==t&&(e.sourceElement=t&&t.di),e.targetElement&&e.targetElement.bpmnElement!==n&&(e.targetElement=n&&n.di)},Om.prototype.updateDiParent=function(e,t){if(t&&!Dr(t,"bpmndi:BPMNPlane")&&(t=t.$parent),e.$parent!==t){var n=(t||e.$parent).get("planeElement");t?(n.push(e),e.$parent=t):(Et(n,e),e.$parent=null)}},Om.prototype.getLaneSet=function(e){var t,n;return Dr(e,"bpmn:Lane")?((t=e.childLaneSet)||(t=this._bpmnFactory.create("bpmn:LaneSet"),e.childLaneSet=t,t.$parent=e),t):(Dr(e,"bpmn:Participant")&&(e=e.processRef),(t=(n=e.get("laneSets"))[0])||((t=this._bpmnFactory.create("bpmn:LaneSet")).$parent=e,n.push(t)),t)},Om.prototype.updateSemanticParent=function(e,t,n){var i,r=this._translate;if(e.$parent!==t&&(!Dr(e,"bpmn:DataInput")&&!Dr(e,"bpmn:DataOutput")||(Dr(t,"bpmn:Participant")&&"processRef"in t&&(t=t.processRef),!("ioSpecification"in t)||t.ioSpecification!==e.$parent))){if(Dr(e,"bpmn:Lane"))t&&(t=this.getLaneSet(t)),i="lanes";else if(Dr(e,"bpmn:FlowElement")){if(t)if(Dr(t,"bpmn:Participant"))t=t.processRef;else if(Dr(t,"bpmn:Lane"))do{t=t.$parent.$parent}while(Dr(t,"bpmn:Lane"));i="flowElements"}else if(Dr(e,"bpmn:Artifact")){for(;t&&!Dr(t,"bpmn:Process")&&!Dr(t,"bpmn:SubProcess")&&!Dr(t,"bpmn:Collaboration");){if(Dr(t,"bpmn:Participant")){t=t.processRef;break}t=t.$parent}i="artifacts"}else if(Dr(e,"bpmn:MessageFlow"))i="messageFlows";else if(Dr(e,"bpmn:Participant")){i="participants";var o,a=e.processRef;a&&(o=function(e){for(;e&&!Dr(e,"bpmn:Definitions");)e=e.$parent;return e}(e.$parent||t),e.$parent&&(Et(o.get("rootElements"),a),a.$parent=null),t&&(wt(o.get("rootElements"),a),a.$parent=o))}else Dr(e,"bpmn:DataOutputAssociation")?i="dataOutputAssociations":Dr(e,"bpmn:DataInputAssociation")&&(i="dataInputAssociations");if(!i)throw new Error(r("no parent for {element} in {parent}",{element:e.id,parent:t.id}));var s;if(e.$parent&&Et(s=e.$parent.get(i),e),t?((s=t.get(i)).push(e),e.$parent=t):e.$parent=null,n){var c=n.get(i);Et(s,e),t&&(c||(c=[],t.set(i,c)),c.push(e))}}},Om.prototype.updateConnectionWaypoints=function(e){e.businessObject.di.set("waypoint",this._bpmnFactory.createDiWaypoints(e.waypoints))},Om.prototype.updateConnection=function(e){var t,n=e.connection,i=Br(n),r=Br(n.source),o=Br(n.target);if(Dr(i,"bpmn:DataAssociation"))Dr(i,"bpmn:DataInputAssociation")?(i.get("sourceRef")[0]=r,t=e.parent||e.newParent||o,this.updateSemanticParent(i,o,t)):Dr(i,"bpmn:DataOutputAssociation")&&(t=e.parent||e.newParent||r,this.updateSemanticParent(i,r,t),i.targetRef=o);else{var a=Dr(i,"bpmn:SequenceFlow");i.sourceRef!==r&&(a&&(Et(i.sourceRef&&i.sourceRef.get("outgoing"),i),r&&r.get("outgoing")&&r.get("outgoing").push(i)),i.sourceRef=r),i.targetRef!==o&&(a&&(Et(i.targetRef&&i.targetRef.get("incoming"),i),o&&o.get("incoming")&&o.get("incoming").push(i)),i.targetRef=o)}this.updateConnectionWaypoints(n),this.updateDiConnection(i.di,r,o)},Om.prototype._getLabel=function(e){return e.label||(e.label=this._bpmnFactory.createDiLabel()),e.label},i(Tm,Un),Tm.$inject=["bpmnFactory","moddle","translate"],Tm.prototype.baseCreate=Un.prototype.create,Tm.prototype.create=function(e,t){return"label"===e?this.baseCreate(e,U({type:"label"},fo,t)):this.createBpmnElement(e,t)},Tm.prototype.createBpmnElement=function(e,t){var n,i,r,o=this._translate,a=(t=t||{}).businessObject;if(!a){if(!t.type)throw new Error(o("no shape type specified"));a=this._bpmnFactory.create(t.type)}return a.di||(a.di="root"===e?this._bpmnFactory.createDiPlane(a,[],{id:a.id+"_di"}):"connection"===e?this._bpmnFactory.createDiEdge(a,[],{id:a.id+"_di"}):this._bpmnFactory.createDiShape(a,{},{id:a.id+"_di"})),Dr(a,"bpmn:Group")&&(t=U({isFrame:!0},t)),t.di&&(U(a.di,t.di),delete t.di),function(e,t,n){_(n,(function(n){void 0!==t[n]&&Am(e,t,n)}))}(a,t,["processRef","isInterrupting","associationDirection","isForCompensation"]),t.isExpanded&&Am(a.di,t,"isExpanded"),Dr(a,"bpmn:ExclusiveGateway")&&(a.di.isMarkerVisible=!0),t.eventDefinitionType&&(i=a.get("eventDefinitions")||[],r=this._bpmnFactory.create(t.eventDefinitionType,t.eventDefinitionAttrs),"bpmn:ConditionalEventDefinition"===t.eventDefinitionType&&(r.condition=this._bpmnFactory.create("bpmn:FormalExpression")),i.push(r),r.$parent=a,a.eventDefinitions=i,delete t.eventDefinitionType),n=this._getDefaultSize(a),t=U({businessObject:a,id:a.id},n,t),this.baseCreate(e,t)},Tm.prototype._getDefaultSize=function(e){return Dr(e,"bpmn:SubProcess")?Nr(e)?{width:350,height:200}:{width:100,height:80}:Dr(e,"bpmn:Task")?{width:100,height:80}:Dr(e,"bpmn:Gateway")?{width:50,height:50}:Dr(e,"bpmn:Event")?{width:36,height:36}:Dr(e,"bpmn:Participant")?Nr(e)?{width:600,height:250}:{width:400,height:60}:Dr(e,"bpmn:Lane")?{width:400,height:100}:Dr(e,"bpmn:DataObjectReference")?{width:36,height:50}:Dr(e,"bpmn:DataStoreReference")?{width:50,height:50}:Dr(e,"bpmn:TextAnnotation")?{width:100,height:30}:Dr(e,"bpmn:Group")?{width:300,height:300}:{width:100,height:80}},Tm.prototype.createParticipantShape=function(e){return m(e)||(e={isExpanded:e}),!1!==(e=U({type:"bpmn:Participant"},e||{})).isExpanded&&(e.processRef=this._bpmnFactory.create("bpmn:Process")),this.createShape(e)},Rm.$inject=["modeling","canvas"],Rm.prototype.preExecute=function(e){var t=this._modeling,n=e.elements,i=e.alignment;_(n,(function(e){var n={x:0,y:0};i.left?n.x=i.left-e.x:i.right?n.x=i.right-e.width-e.x:i.center?n.x=i.center-Math.round(e.width/2)-e.x:i.top?n.y=i.top-e.y:i.bottom?n.y=i.bottom-e.height-e.y:i.middle&&(n.y=i.middle-Math.round(e.height/2)-e.y),t.moveElements([e],n,e.parent)}))},Rm.prototype.postExecute=function(e){},km.$inject=["modeling"],km.prototype.preExecute=function(e){var t=e.source;if(!t)throw new Error("source required");var n=e.target||t.parent,i=e.shape,r=e.hints||{};i=e.shape=this._modeling.createShape(i,e.position,n,{attach:r.attach}),e.shape=i},km.prototype.postExecute=function(e){var t,n,i=e.hints||{};t=e.source,n=e.shape,C(t.outgoing,(function(e){return e.target===n}))||(i.connectionTarget===e.source?this._modeling.connect(e.shape,e.source,e.connection):this._modeling.connect(e.source,e.shape,e.connection))},jm.$inject=["canvas","layouter"],jm.prototype.execute=function(e){var t=e.connection,n=e.source,i=e.target,r=e.parent,o=e.parentIndex,a=e.hints;if(!n||!i)throw new Error("source and target required");if(!r)throw new Error("parent required");return t.source=n,t.target=i,t.waypoints||(t.waypoints=this._layouter.layoutConnection(t,a)),this._canvas.addConnection(t,r,o),t},jm.prototype.revert=function(e){var t=e.connection;return this._canvas.removeConnection(t),t.source=null,t.target=null,t};var Mm=Math.round;function Dm(e){this._modeling=e}function Bm(e){return!!e.waypoints}Dm.$inject=["modeling"],Dm.prototype.preExecute=function(e){var t=e.elements,n=e.parent,i=e.parentIndex,r=e.position,o=e.hints,a=this._modeling;_(t,(function(e){f(e.x)||(e.x=0),f(e.y)||(e.y=0)}));var s=ft(t);_(t,(function(e){Bm(e)&&(e.waypoints=T(e.waypoints,(function(e){return{x:Mm(e.x-s.x-s.width/2+r.x),y:Mm(e.y-s.y-s.height/2+r.y)}}))),U(e,{x:Mm(e.x-s.x-s.width/2+r.x),y:Mm(e.y-s.y-s.height/2+r.y)})}));var c=ut(t),p={};_(t,(function(e){if(Bm(e))p[e.id]=f(i)?a.createConnection(p[e.source.id],p[e.target.id],i,e,e.parent||n,o):a.createConnection(p[e.source.id],p[e.target.id],e,e.parent||n,o);else{var t=U({},o);-1===c.indexOf(e)&&(t.autoResize=!1),p[e.id]=f(i)?a.createShape(e,G(e,["x","y","width","height"]),e.parent||n,i,t):a.createShape(e,G(e,["x","y","width","height"]),e.parent||n,t)}})),e.elements=k(p)};var Im=Math.round;function Nm(e){this._canvas=e}function Lm(e){Nm.call(this,e)}Nm.$inject=["canvas"],Nm.prototype.execute=function(e){var t=e.shape,n=e.position,i=e.parent,r=e.parentIndex;if(!i)throw new Error("parent required");if(!n)throw new Error("position required");return void 0!==n.width?U(t,n):U(t,{x:n.x-Im(t.width/2),y:n.y-Im(t.height/2)}),this._canvas.addShape(t,i,r),t},Nm.prototype.revert=function(e){var t=e.shape;return this._canvas.removeShape(t),t},i(Lm,Nm),Lm.$inject=["canvas"];var Fm=Nm.prototype.execute;Lm.prototype.execute=function(e){var t=e.shape;return function(e){["width","height"].forEach((function(t){void 0===e[t]&&(e[t]=0)}))}(t),t.labelTarget=e.labelTarget,Fm.call(this,e)};var Vm=Nm.prototype.revert;function $m(e,t){this._canvas=e,this._modeling=t}function zm(e,t){this._modeling=e,this._elementRegistry=t}function qm(e,t){this._canvas=e,this._modeling=t}function Um(e){this._modeling=e}Lm.prototype.revert=function(e){return e.shape.labelTarget=null,Vm.call(this,e)},$m.$inject=["canvas","modeling"],$m.prototype.execute=function(e){var t=e.connection,n=t.parent;return e.parent=n,e.parentIndex=_t(n.children,t),e.source=t.source,e.target=t.target,this._canvas.removeConnection(t),t.source=null,t.target=null,t},$m.prototype.revert=function(e){var t=e.connection,n=e.parent,i=e.parentIndex;return t.source=e.source,t.target=e.target,wt(n.children,t,i),this._canvas.addConnection(t,n),t},zm.$inject=["modeling","elementRegistry"],zm.prototype.postExecute=function(e){var t=this._modeling,n=this._elementRegistry;_(e.elements,(function(e){n.get(e.id)&&(e.waypoints?t.removeConnection(e):t.removeShape(e))}))},qm.$inject=["canvas","modeling"],qm.prototype.preExecute=function(e){var t=this._modeling,n=e.shape;Jh(n.incoming,(function(e){t.removeConnection(e,{nested:!0})})),Jh(n.outgoing,(function(e){t.removeConnection(e,{nested:!0})})),Jh(n.children,(function(e){e.waypoints?t.removeConnection(e,{nested:!0}):t.removeShape(e,{nested:!0})}))},qm.prototype.execute=function(e){var t=this._canvas,n=e.shape,i=n.parent;return e.oldParent=i,e.oldParentIndex=_t(i.children,n),t.removeShape(n),n},qm.prototype.revert=function(e){var t=this._canvas,n=e.shape,i=e.oldParent,r=e.oldParentIndex;return wt(i.children,n,r),t.addShape(n,i),n},Um.$inject=["modeling"];var Gm={x:"y",y:"x"};function Hm(e,t){this._layouter=e,this._canvas=t}function Wm(){}function Km(){this.allShapes={},this.allConnections={},this.enclosedElements={},this.enclosedConnections={},this.topLevel={}}function Xm(e){this._modeling=e}function Ym(e){this._helper=new Xm(e)}function Jm(e){this._modeling=e,this._helper=new Xm(e)}function Zm(e){this._modeling=e}function Qm(e){return e.original||e}function ef(e,t){this._modeling=e,this._rules=t}function tf(e){this._modeling=e}function nf(e){this._modeling=e}function rf(e){return U({},e)}function of(e){switch(e){case"n":return"y";case"w":return"x";case"s":return"y";case"e":return"x"}}function af(e,t,n){var i=of(n);return/e|s/.test(n)?e[i]>t:/n|w/.test(n)?e[i]<t:void 0}function sf(e,t){return-1!==e.indexOf(t)}function cf(e){this._modeling=e}function pf(e){var t={};return _(e,(function(e){t[e.id]=e.hidden,e.children&&(t=U({},t,pf(e.children)))})),t}function uf(e,t){var n=[];return _(e,(function(e){e.hidden=t,n=n.concat(e),e.children&&(n=n.concat(uf(e.children,e.collapsed||t)))})),n}function lf(e,t){var n=[];return _(e,(function(e){e.hidden=t[e.id],n=n.concat(e),e.children&&(n=n.concat(lf(e.children,t)))})),n}function df(e){this._modeling=e}function hf(e,t){return Et(e&&e.attachers,t)}function mf(e,t,n){if(e){var i=e.attachers;i||(e.attachers=i=[]),wt(i,t,n)}}function ff(){}function vf(e,t,n){this._eventBus=e,this._elementFactory=t,this._commandStack=n;var i=this;e.on("diagram.init",(function(){i.registerHandlers(n)}))}function yf(e){this._elementRegistry=e}function gf(e,t){_(t,(function(t,n){e.set(n,t)}))}Um.prototype.preExecute=function(e){var t=this._modeling,n=e.groups,i=e.axis,r=e.dimension;function o(e,t){e.range.min=Math.min(t[i],e.range.min),e.range.max=Math.max(t[i]+t[r],e.range.max)}function a(e){return e[i]+e[r]/2}function s(e){return e.length-1}function c(e){return e.max-e.min}var p,u,l=n[0],d=s(n),h=n[d],m=0;_(n,(function(e,p){var u,l,h;e.elements.length<2?p&&p!==n.length-1&&(o(e,e.elements[0]),m+=c(e.range)):(l=(u=B(e.elements,i))[0],p===d&&(l=u[s(u)]),h=a(l),e.range=null,_(u,(function(n){!function(e,n){var r={y:0};r[i]=e-a(n),r[i]&&(r[Gm[i]]=0,t.moveElements([n],r,n.parent))}(h,n),null!==e.range?o(e,n):e.range={min:n[i],max:n[i]+n[r]}})),p&&p!==n.length-1&&(m+=c(e.range)))})),u=Math.abs(h.range.min-l.range.max),(p=Math.round((u-m)/(n.length-1)))<n.length-1||_(n,(function(e,o){var a,s={};e!==l&&e!==h&&(a=n[o-1],e.range.max=0,_(e.elements,(function(n,o){s[Gm[i]]=0,s[i]=a.range.max-n[i]+p,e.range.min!==n[i]&&(s[i]+=n[i]-e.range.min),s[i]&&t.moveElements([n],s,n.parent),e.range.max=Math.max(n[i]+n[r],o?e.range.max:0)})))}))},Um.prototype.postExecute=function(e){},Hm.$inject=["layouter","canvas"],Hm.prototype.execute=function(e){var t=e.connection;return U(e,{oldWaypoints:t.waypoints}),t.waypoints=this._layouter.layoutConnection(t,e.hints),t},Hm.prototype.revert=function(e){var t=e.connection;return t.waypoints=e.oldWaypoints,t},Wm.prototype.execute=function(e){var t=e.connection,n=e.delta,i=e.newParent||t.parent,r=e.newParentIndex,o=t.parent;return e.oldParent=o,e.oldParentIndex=Et(o.children,t),wt(i.children,t,r),t.parent=i,_(t.waypoints,(function(e){e.x+=n.x,e.y+=n.y,e.original&&(e.original.x+=n.x,e.original.y+=n.y)})),t},Wm.prototype.revert=function(e){var t=e.connection,n=t.parent,i=e.oldParent,r=e.oldParentIndex,o=e.delta;return Et(n.children,t),wt(i.children,t,r),t.parent=i,_(t.waypoints,(function(e){e.x-=o.x,e.y-=o.y,e.original&&(e.original.x-=o.x,e.original.y-=o.y)})),t},Km.prototype.add=function(e,t){return this.addAll([e],t)},Km.prototype.addAll=function(e,t){return U(this,function(e,t,n){u(t)&&(t=!0),m(t)&&(n=t,t=!0);var i=gt((n=n||{}).allShapes),r=gt(n.allConnections),o=gt(n.enclosedElements),a=gt(n.enclosedConnections),s=gt(n.topLevel,t&&j(e,(function(e){return e.id})));function c(e){s[e.source.id]&&s[e.target.id]&&(s[e.id]=[e]),i[e.source.id]&&i[e.target.id]&&(a[e.id]=o[e.id]=e),r[e.id]=e}return ht(e,(function(e){if(o[e.id]=e,!e.waypoints)return i[e.id]=e,_(e.incoming,c),_(e.outgoing,c),e.children;a[e.id]=r[e.id]=e})),{allShapes:i,allConnections:r,topLevel:s,enclosedConnections:a,enclosedElements:o}}(e,!!t,this)),this},Xm.prototype.moveRecursive=function(e,t,n){return e?this.moveClosure(this.getClosure(e),t,n):[]},Xm.prototype.moveClosure=function(e,t,n,i,r){var o=this._modeling,a=e.allShapes,s=e.allConnections,c=e.enclosedConnections,p=e.topLevel,u=!1;r&&r.parent===n&&(u=!0),_(a,(function(e){o.moveShape(e,t,p[e.id]&&!u&&n,{recurse:!1,layout:!1})})),_(s,(function(e){var i=!!a[e.source.id],r=!!a[e.target.id];c[e.id]&&i&&r?o.moveConnection(e,t,p[e.id]&&!u&&n):o.layoutConnection(e,{connectionStart:i&&Ed(e,e.source,t),connectionEnd:r&&wd(e,e.target,t)})}))},Xm.prototype.getClosure=function(e){return(new Km).addAll(e,!0)},Ym.$inject=["modeling"],Ym.prototype.preExecute=function(e){e.closure=this._helper.getClosure(e.shapes)},Ym.prototype.postExecute=function(e){var t,n=e.hints;n&&n.primaryShape&&(t=n.primaryShape,n.oldParent=t.parent),this._helper.moveClosure(e.closure,e.delta,e.newParent,e.newHost,t)},Jm.$inject=["modeling"],Jm.prototype.execute=function(e){var t=e.shape,n=e.delta,i=e.newParent||t.parent,r=e.newParentIndex,o=t.parent;return e.oldBounds=G(t,["x","y","width","height"]),e.oldParent=o,e.oldParentIndex=Et(o.children,t),wt(i.children,t,r),U(t,{parent:i,x:t.x+n.x,y:t.y+n.y}),t},Jm.prototype.postExecute=function(e){var t=e.shape,n=e.delta,i=e.hints,r=this._modeling;!1!==i.layout&&(_(t.incoming,(function(e){r.layoutConnection(e,{connectionEnd:wd(e,t,n)})})),_(t.outgoing,(function(e){r.layoutConnection(e,{connectionStart:Ed(e,t,n)})}))),!1!==i.recurse&&this.moveChildren(e)},Jm.prototype.revert=function(e){var t=e.shape,n=e.oldParent,i=e.oldParentIndex,r=e.delta;return wt(n.children,t,i),U(t,{parent:n,x:t.x-r.x,y:t.y-r.y}),t},Jm.prototype.moveChildren=function(e){var t=e.delta,n=e.shape;this._helper.moveRecursive(n.children,t,null)},Jm.prototype.getNewParent=function(e){return e.newParent||e.shape.parent},Zm.$inject=["modeling"],Zm.prototype.execute=function(e){var t=e.newSource,n=e.newTarget,i=e.connection,r=e.dockingOrPoints;if(!t&&!n)throw new Error("newSource or newTarget required");return h(r)&&(e.oldWaypoints=i.waypoints,i.waypoints=r),t&&(e.oldSource=i.source,i.source=t),n&&(e.oldTarget=i.target,i.target=n),i},Zm.prototype.postExecute=function(e){var t=e.connection,n=e.newSource,i=e.newTarget,r=e.dockingOrPoints,o=e.hints||{},a={};o.connectionStart&&(a.connectionStart=o.connectionStart),o.connectionEnd&&(a.connectionEnd=o.connectionEnd),!1!==o.layoutConnection&&(!n||i&&"source"!==o.docking||(a.connectionStart=a.connectionStart||Qm(h(r)?r[0]:r)),!i||n&&"target"!==o.docking||(a.connectionEnd=a.connectionEnd||Qm(h(r)?r[r.length-1]:r)),o.newWaypoints&&(a.waypoints=o.newWaypoints),this._modeling.layoutConnection(t,a))},Zm.prototype.revert=function(e){var t=e.oldSource,n=e.oldTarget,i=e.oldWaypoints,r=e.connection;return t&&(r.source=t),n&&(r.target=n),i&&(r.waypoints=i),r},ef.$inject=["modeling","rules"],ef.prototype.preExecute=function(e){var t,n=this,i=this._modeling,r=this._rules,o=e.oldShape,a=e.newData,s=e.hints||{};function c(e,t,n){return r.allowed("connection.reconnect",{connection:n,source:e,target:t})}var p,u={x:a.x,y:a.y},l={x:o.x,y:o.y,width:o.width,height:o.height};t=e.newShape=e.newShape||n.createShape(a,u,o.parent,s),o.host&&i.updateAttachment(t,o.host),!1!==s.moveChildren&&(p=o.children.slice(),i.moveElements(p,{x:0,y:0},t,s));var d=o.incoming.slice(),h=o.outgoing.slice();_(d,(function(e){c(e.source,t,e)&&n.reconnectEnd(e,t,xd(e,t,l),s)})),_(h,(function(e){var i=e.target;c(t,i,e)&&n.reconnectStart(e,t,bd(e,t,l),s)}))},ef.prototype.postExecute=function(e){var t=e.oldShape;this._modeling.removeShape(t)},ef.prototype.execute=function(e){},ef.prototype.revert=function(e){},ef.prototype.createShape=function(e,t,n,i){return this._modeling.createShape(e,t,n,i)},ef.prototype.reconnectStart=function(e,t,n,i){this._modeling.reconnectStart(e,t,n,i)},ef.prototype.reconnectEnd=function(e,t,n,i){this._modeling.reconnectEnd(e,t,n,i)},tf.$inject=["modeling"],tf.prototype.execute=function(e){var t=e.shape,n=e.newBounds,i=e.minBounds;if(void 0===n.x||void 0===n.y||void 0===n.width||void 0===n.height)throw new Error("newBounds must have {x, y, width, height} properties");if(i&&(n.width<i.width||n.height<i.height))throw new Error("width and height cannot be less than minimum height and width");if(!i&&n.width<10||n.height<10)throw new Error("width and height cannot be less than 10px");return e.oldBounds={width:t.width,height:t.height,x:t.x,y:t.y},U(t,{width:n.width,height:n.height,x:n.x,y:n.y}),t},tf.prototype.postExecute=function(e){var t=this._modeling,n=e.shape,i=e.oldBounds;!1!==(e.hints||{}).layout&&(_(n.incoming,(function(e){t.layoutConnection(e,{connectionEnd:xd(e,n,i)})})),_(n.outgoing,(function(e){t.layoutConnection(e,{connectionStart:bd(e,n,i)})})))},tf.prototype.revert=function(e){var t=e.shape,n=e.oldBounds;return U(t,{width:n.width,height:n.height,x:n.x,y:n.y}),t},nf.$inject=["modeling"],nf.prototype.preExecute=function(e){var t=e.delta,n=e.direction,i=e.movingShapes,r=e.resizingShapes,o=e.start,a={};this.moveShapes(i,t),_(r,(function(e){a[e.id]=function(e){return{x:e.x,y:e.y,height:e.height,width:e.width}}(e)})),this.resizeShapes(r,t,n),this.updateConnectionWaypoints(function(e,t){var n=[];return _(e.concat(t),(function(i){var r=i.incoming,o=i.outgoing;_(r.concat(o),(function(i){var r=i.source,o=i.target;(sm(e,r)||sm(e,o)||sm(t,r)||sm(t,o))&&(sm(n,i)||n.push(i))}))})),n}(i,r),t,n,o,i,r,a)},nf.prototype.execute=function(){},nf.prototype.revert=function(){},nf.prototype.moveShapes=function(e,t){var n=this;_(e,(function(e){n._modeling.moveShape(e,t,null,{autoResize:!1,layout:!1,recurse:!1})}))},nf.prototype.resizeShapes=function(e,t,n){var i=this;_(e,(function(e){var r=function(e,t,n){var i=e.x,r=e.y,o=e.width,a=e.height,s=n.x,c=n.y;switch(t){case"n":return{x:i,y:r+c,width:o,height:a-c};case"s":return{x:i,y:r,width:o,height:a+c};case"w":return{x:i+s,y:r,width:o-s,height:a};case"e":return{x:i,y:r,width:o+s,height:a};default:throw new Error("unknown direction: "+t)}}(e,n,t);i._modeling.resizeShape(e,r,null,{attachSupport:!1,autoResize:!1,layout:!1})}))},nf.prototype.updateConnectionWaypoints=function(e,t,n,i,r,o,a){var s=this,c=r.concat(o);_(e,(function(e){var p=e.source,u=e.target,l=function(e){return T(e.waypoints,(function(e){return(e=rf(e)).original&&(e.original=rf(e.original)),e}))}(e),d=of(n),h={labelBehavior:!1};sf(c,p)&&sf(c,u)?(l=T(l,(function(e){return af(e,i,n)&&(e[d]=e[d]+t[d]),e.original&&af(e.original,i,n)&&(e.original[d]=e.original[d]+t[d]),e})),s._modeling.updateWaypoints(e,l,{labelBehavior:!1})):(sf(c,p)||sf(c,u))&&(sf(r,p)?h.connectionStart=Ed(e,p,t):sf(r,u)?h.connectionEnd=wd(e,u,t):sf(o,p)?h.connectionStart=bd(e,p,a[p.id]):sf(o,u)&&(h.connectionEnd=xd(e,u,a[u.id])),s._modeling.layoutConnection(e,h))}))},cf.$inject=["modeling"],cf.prototype.execute=function(e){var t=e.shape,n=t.children;e.oldChildrenVisibility=pf(n),t.collapsed=!t.collapsed;var i=uf(n,t.collapsed);return[t].concat(i)},cf.prototype.revert=function(e){var t=e.shape,n=e.oldChildrenVisibility,i=lf(t.children,n);return t.collapsed=!t.collapsed,[t].concat(i)},df.$inject=["modeling"],df.prototype.execute=function(e){var t=e.shape,n=e.newHost,i=t.host;return e.oldHost=i,e.attacherIdx=hf(i,t),mf(n,t),t.host=n,t},df.prototype.revert=function(e){var t=e.shape,n=e.newHost,i=e.oldHost,r=e.attacherIdx;return t.host=i,hf(n,t),mf(i,t,r),t},ff.prototype.execute=function(e){var t=e.connection,n=e.newWaypoints;return e.oldWaypoints=t.waypoints,t.waypoints=n,t},ff.prototype.revert=function(e){var t=e.connection,n=e.oldWaypoints;return t.waypoints=n,t},vf.$inject=["eventBus","elementFactory","commandStack"],vf.prototype.getHandlers=function(){return{"shape.append":km,"shape.create":Nm,"shape.delete":qm,"shape.move":Jm,"shape.resize":tf,"shape.replace":ef,"shape.toggleCollapse":cf,spaceTool:nf,"label.create":Lm,"connection.create":jm,"connection.delete":$m,"connection.move":Wm,"connection.layout":Hm,"connection.updateWaypoints":ff,"connection.reconnect":Zm,"elements.create":Dm,"elements.move":Ym,"elements.delete":zm,"elements.distribute":Um,"elements.align":Rm,"element.updateAttachment":df}},vf.prototype.registerHandlers=function(e){_(this.getHandlers(),(function(t,n){e.registerHandler(n,t)}))},vf.prototype.moveShape=function(e,t,n,i,r){"object"==typeof i&&(r=i,i=null);var o={shape:e,delta:t,newParent:n,newParentIndex:i,hints:r||{}};this._commandStack.execute("shape.move",o)},vf.prototype.updateAttachment=function(e,t){var n={shape:e,newHost:t};this._commandStack.execute("element.updateAttachment",n)},vf.prototype.moveElements=function(e,t,n,i){var r,o=(i=i||{}).attach,a=n;!0===o?(r=n,a=n.parent):!1===o&&(r=null);var s={shapes:e,delta:t,newParent:a,newHost:r,hints:i};this._commandStack.execute("elements.move",s)},vf.prototype.moveConnection=function(e,t,n,i,r){"object"==typeof i&&(r=i,i=void 0);var o={connection:e,delta:t,newParent:n,newParentIndex:i,hints:r||{}};this._commandStack.execute("connection.move",o)},vf.prototype.layoutConnection=function(e,t){var n={connection:e,hints:t||{}};this._commandStack.execute("connection.layout",n)},vf.prototype.createConnection=function(e,t,n,i,r,o){"object"==typeof n&&(o=r,r=i,i=n,n=void 0);var a={source:e,target:t,parent:r,parentIndex:n,connection:i=this._create("connection",i),hints:o};return this._commandStack.execute("connection.create",a),a.connection},vf.prototype.createShape=function(e,t,n,i,r){"number"!=typeof i&&(r=i,i=void 0);var o,a,s=(r=r||{}).attach;e=this._create("shape",e),s?(o=n.parent,a=n):o=n;var c={position:t,shape:e,parent:o,parentIndex:i,host:a,hints:r};return this._commandStack.execute("shape.create",c),c.shape},vf.prototype.createElements=function(e,t,n,i,r){h(e)||(e=[e]),"number"!=typeof i&&(r=i,i=void 0);var o={position:t,elements:e,parent:n,parentIndex:i,hints:r=r||{}};return this._commandStack.execute("elements.create",o),o.elements},vf.prototype.createLabel=function(e,t,n,i){n=this._create("label",n);var r={labelTarget:e,position:t,parent:i||e.parent,shape:n};return this._commandStack.execute("label.create",r),r.shape},vf.prototype.appendShape=function(e,t,n,i,r){r=r||{};var o={source:e,position:n,target:i,shape:t=this._create("shape",t),connection:r.connection,connectionParent:r.connectionParent,hints:r};return this._commandStack.execute("shape.append",o),o.shape},vf.prototype.removeElements=function(e){var t={elements:e};this._commandStack.execute("elements.delete",t)},vf.prototype.distributeElements=function(e,t,n){var i={groups:e,axis:t,dimension:n};this._commandStack.execute("elements.distribute",i)},vf.prototype.removeShape=function(e,t){var n={shape:e,hints:t||{}};this._commandStack.execute("shape.delete",n)},vf.prototype.removeConnection=function(e,t){var n={connection:e,hints:t||{}};this._commandStack.execute("connection.delete",n)},vf.prototype.replaceShape=function(e,t,n){var i={oldShape:e,newData:t,hints:n||{}};return this._commandStack.execute("shape.replace",i),i.newShape},vf.prototype.alignElements=function(e,t){var n={elements:e,alignment:t};this._commandStack.execute("elements.align",n)},vf.prototype.resizeShape=function(e,t,n,i){var r={shape:e,newBounds:t,minBounds:n,hints:i};this._commandStack.execute("shape.resize",r)},vf.prototype.createSpace=function(e,t,n,i,r){var o={delta:n,direction:i,movingShapes:e,resizingShapes:t,start:r};this._commandStack.execute("spaceTool",o)},vf.prototype.updateWaypoints=function(e,t,n){var i={connection:e,newWaypoints:t,hints:n||{}};this._commandStack.execute("connection.updateWaypoints",i)},vf.prototype.reconnect=function(e,t,n,i,r){var o={connection:e,newSource:t,newTarget:n,dockingOrPoints:i,hints:r||{}};this._commandStack.execute("connection.reconnect",o)},vf.prototype.reconnectStart=function(e,t,n,i){i||(i={}),this.reconnect(e,t,e.target,n,U(i,{docking:"source"}))},vf.prototype.reconnectEnd=function(e,t,n,i){i||(i={}),this.reconnect(e,e.source,t,n,U(i,{docking:"target"}))},vf.prototype.connect=function(e,t,n,i){return this.createConnection(e,t,n||{},e.parent,i)},vf.prototype._create=function(e,t){return t instanceof Ln?t:this._elementFactory.create(e,t)},vf.prototype.toggleCollapse=function(e,t){var n={shape:e,hints:t||{}};this._commandStack.execute("shape.toggleCollapse",n)},yf.$inject=["elementRegistry"],yf.prototype.execute=function(e){var t=e.element,n=e.moddleElement,i=e.properties;if(!n)throw new Error("<moddleElement> required");var r=e.changed||this.getVisualReferences(n).concat(t),o=e.oldProperties||function(e,t){return S(t,(function(t,n){return t[n]=e.get(n),t}),{})}(n,A(i));return gf(n,i),e.oldProperties=o,e.changed=r,r},yf.prototype.revert=function(e){var t=e.oldProperties,n=e.moddleElement,i=e.changed;return gf(n,t),i},yf.prototype.getVisualReferences=function(e){var t=this._elementRegistry;return Dr(e,"bpmn:DataObject")?function(e,t){return t.filter((function(t){return Dr(t,"bpmn:DataObjectReference")&&Br(t).dataObjectRef===e}))}(e,t):[]};var bf="default",xf="id",Ef="di",wf={width:0,height:0};function _f(e,t,n,i,r){this._elementRegistry=e,this._moddle=t,this._translate=n,this._modeling=i,this._textRenderer=r}function Pf(e,t){return xf in e&&e.id!==t.id}function Sf(e,t){_(t,(function(t,n){n!==Ef?e.set(n,t):e.di&&function(e,t){_(t,(function(t,n){e.set(n,t)}))}(e.di,t)}))}_f.$inject=["elementRegistry","moddle","translate","modeling","textRenderer"],_f.prototype.execute=function(e){var t=e.element,n=[t],i=this._translate;if(!t)throw new Error(i("element required"));var r=this._elementRegistry,o=this._moddle.ids,a=t.businessObject,s=function(e){var t=U({},e);return Of.forEach((function(n){n in e&&(t[n]=Br(t[n]))})),t}(e.properties),c=e.oldProperties||function(e,t){return S(A(t),(function(n,i){return n[i]=i!==Ef?e.get(i):function(e,t){return S(t,(function(t,n){return t[n]=e.get(n),t}),{})}(e.di,A(t.di)),n}),{})}(a,s);return Pf(s,a)&&(o.unclaim(a.id),r.updateId(t,s.id),o.claim(s.id,a)),bf in s&&(s.default&&n.push(r.get(s.default.id)),a.default&&n.push(r.get(a.default.id))),Sf(a,s),e.oldProperties=c,e.changed=n,n},_f.prototype.postExecute=function(e){var t=e.element.label,n=t&&Br(t).name;if(n){var i=this._textRenderer.getExternalLabelBounds(t,n);this._modeling.resizeShape(t,i,wf)}},_f.prototype.revert=function(e){var t=e.element,n=e.properties,i=e.oldProperties,r=t.businessObject,o=this._elementRegistry,a=this._moddle.ids;return Sf(r,i),Pf(n,r)&&(a.unclaim(n.id),o.updateId(t,i.id),a.claim(i.id,r)),e.changed};var Of=["default"];function Cf(e,t){this._canvas=e,this._modeling=t}function Tf(e,t){this._modeling=e,this._spaceTool=t}function Af(e,t){this._modeling=e,this._translate=t}function Rf(e,t){this._modeling=e,this._spaceTool=t}Cf.$inject=["canvas","modeling"],Cf.prototype.execute=function(e){var t=this._canvas,n=e.newRoot,i=n.businessObject,r=t.getRootElement(),o=r.businessObject,a=o.$parent,s=o.di;t.setRootElement(n,!0),wt(a.rootElements,i),i.$parent=a,Et(a.rootElements,o),o.$parent=null,o.di=null,s.bpmnElement=i,i.di=s,e.oldRoot=r},Cf.prototype.revert=function(e){var t=this._canvas,n=e.newRoot.businessObject,i=e.oldRoot,r=i.businessObject,o=n.$parent,a=n.di;t.setRootElement(i,!0),Et(o.rootElements,n),n.$parent=null,wt(o.rootElements,r),r.$parent=o,n.di=null,a.bpmnElement=r,r.di=a},Tf.$inject=["modeling","spaceTool"],Tf.prototype.preExecute=function(e){var t=this._spaceTool,n=this._modeling,i=e.shape,r=e.location,o=nu(i),a=o===i,s=a?i:i.parent;tu(s).length||n.createShape({type:"bpmn:Lane"},{x:i.x+Qp,y:i.y,width:i.width-Qp,height:i.height},s);var c=[];ht(o,(function(e){return c.push(e),e.label&&c.push(e.label),e===i?[]:w(e.children,(function(e){return e!==i}))}));var p="top"===r?-120:120,u="top"===r?i.y:i.y+i.height,l=u+("top"===r?10:-10),d="top"===r?"n":"s",h=t.calculateAdjustments(c,"y",p,l);t.makeSpace(h.movingShapes,h.resizingShapes,{x:0,y:p},d,l),e.newLane=n.createShape({type:"bpmn:Lane"},{x:i.x+(a?Qp:0),y:u-("top"===r?120:0),width:i.width-(a?Qp:0),height:120},s)},Af.$inject=["modeling","translate"],Af.prototype.preExecute=function(e){var t=this._modeling,n=this._translate,i=e.shape,r=e.count,o=tu(i),a=o.length;if(a>r)throw new Error(n("more than {count} child lanes",{count:r}));var s,c,p,u,l,d=Math.round(i.height/r);for(l=0;l<r;l++)s=i.y+l*d,c=l===r-1?i.height-d*l:d,p={x:i.x+Qp,y:s,width:i.width-Qp,height:c},l<a?t.resizeShape(o[l],p):(u={type:"bpmn:Lane"},t.createShape(u,p,i))},Rf.$inject=["modeling","spaceTool"],Rf.prototype.preExecute=function(e){var t=e.shape,n=e.newBounds;!1!==e.balanced?this.resizeBalanced(t,n):this.resizeSpace(t,n)},Rf.prototype.resizeBalanced=function(e,t){var n=this._modeling,i=iu(e,t);n.resizeShape(e,t),i.forEach((function(e){n.resizeShape(e.shape,e.newBounds)}))},Rf.prototype.resizeSpace=function(e,t){var n,i,r,o,a,s=this._spaceTool,c=hn(e),p=Hp(hn(t),c),u=nu(e),l=[],d=[];ht(u,(function(e){return l.push(e),(Dr(e,"bpmn:Lane")||Dr(e,"bpmn:Participant"))&&d.push(e),e.children})),(p.bottom||p.top)&&(n=p.bottom||p.top,i=e.y+(p.bottom?e.height:0)+(p.bottom?-10:10),r=p.bottom?"s":"n",o=p.top>0||p.bottom<0?-n:n,a=s.calculateAdjustments(l,"y",o,i),s.makeSpace(a.movingShapes,a.resizingShapes,{x:0,y:n},r)),(p.left||p.right)&&(n=p.right||p.left,i=e.x+(p.right?e.width:0)+(p.right?-10:100),r=p.right?"e":"w",o=p.left>0||p.right<0?-n:n,a=s.calculateAdjustments(d,"x",o,i),s.makeSpace(a.movingShapes,a.resizingShapes,{x:n,y:0},r))};var kf="flowNodeRef",jf="lanes";function Mf(e){this._elementRegistry=e}function Df(e){this._moddle=e}Mf.$inject=["elementRegistry"],Mf.prototype.computeUpdates=function(e,t){var n=[],i=[],r={},o=[];function a(e){-1===n.indexOf(e)&&(o.push(e),n.push(e))}function s(e){return e.parent?function(e){var t=nu(e);return r[t.id]||(r[t.id]=eu(t)),r[t.id]}(e).filter((function(t){return n=e,i=hn(t),r=n.x+n.width/2,o=n.y+n.height/2,r>i.left&&r<i.right&&o>i.top&&o<i.bottom;var n,i,r,o})).map((function(e){return e.businessObject})):[]}return t.forEach((function(e){var t=nu(e);t&&-1===n.indexOf(t)&&(t.children.filter((function(e){return Dr(e,"bpmn:FlowNode")})).forEach(a),n.push(t))})),e.forEach(a),o.forEach((function(e){var t=e.businessObject,n=t.get(jf).slice(),r=s(e);i.push({flowNode:t,remove:n,add:r})})),t.forEach((function(e){var t=e.businessObject;e.parent||t.get(kf).forEach((function(e){i.push({flowNode:e,remove:[t],add:[]})}))})),i},Mf.prototype.execute=function(e){var t=e.updates;t||(t=e.updates=this.computeUpdates(e.flowNodeShapes,e.laneShapes)),t.forEach((function(e){var t=e.flowNode,n=t.get(jf);e.remove.forEach((function(e){Et(n,e),Et(e.get(kf),t)})),e.add.forEach((function(e){wt(n,e),wt(e.get(kf),t)}))}))},Mf.prototype.revert=function(e){e.updates.forEach((function(e){var t=e.flowNode,n=t.get(jf);e.add.forEach((function(e){Et(n,e),Et(e.get(kf),t)})),e.remove.forEach((function(e){wt(n,e),wt(e.get(kf),t)}))}))},Df.$inject=["moddle"],Df.prototype.execute=function(e){var t=this._moddle.ids,n=e.id,i=e.element;e.claiming?t.claim(n,i):t.unclaim(n)},Df.prototype.revert=function(e){var t=this._moddle.ids,n=e.id,i=e.element;e.claiming?t.unclaim(n):t.claim(n,i)};var Bf={fill:void 0,stroke:void 0};function If(e){this._commandStack=e,this._normalizeColor=function(e){if(e){if(y(e)){var t=function(e){var t=document.createElement("canvas").getContext("2d");return t.fillStyle="transparent",t.fillStyle=e,/^#[0-9a-fA-F]{6}$/.test(t.fillStyle)?t.fillStyle:null}(e);if(t)return t}throw new Error("invalid color value: "+e)}}}If.$inject=["commandStack"],If.prototype.postExecute=function(e){var t=e.elements,n=e.colors||Bf,i=this,r={};"fill"in n&&U(r,{"background-color":this._normalizeColor(n.fill)}),"stroke"in n&&U(r,{"border-color":this._normalizeColor(n.stroke)}),_(t,(function(e){var t=function(e){return!!e.waypoints}(e)?G(r,["border-color"]):r;!function(e){"border-color"in e&&(e.stroke=e["border-color"]);"background-color"in e&&(e.fill=e["background-color"])}(t),i._commandStack.execute("element.updateProperties",{element:e,properties:{di:t}})}))};var Nf={width:0,height:0};function Lf(e,t){function n(e,t){var n=e.label||e,i=e.labelTarget||e;return function(e,t,n){var i=e.businessObject,r=Gr(i);r&&("categoryValueRef"===r?i.categoryValueRef.value=t:i[r]=t)}(n,t),[n,i]}this.preExecute=function(t){var n=t.element,i=n.businessObject,r=t.newLabel;if(!xo(n)&&vo(n)&&!yo(n)&&!Ff(r)){var o=bo(n);o={x:o.x,y:o.y+7},e.createLabel(n,o,{id:i.id+"_label",businessObject:i})}},this.execute=function(e){return e.oldLabel=Hr(e.element),n(e.element,e.newLabel)},this.revert=function(e){return n(e.element,e.oldLabel)},this.postExecute=function(n){var i=n.element,r=i.label||i,o=n.newLabel,a=n.newBounds,s=n.hints||{};if(xo(r)||Dr(r,"bpmn:TextAnnotation"))if(xo(r)&&Ff(o))!1!==s.removeShape&&e.removeShape(r,{unsetLabel:!1});else{var c=Hr(r);void 0===a&&(a=t.getExternalLabelBounds(r,c)),a&&e.resizeShape(r,a,Nf)}}}function Ff(e){return!e||!e.trim()}function Vf(e,t,n,i){vf.call(this,e,t,n),this._bpmnRules=i}function $f(){}Lf.$inject=["modeling","textRenderer"],i(Vf,vf),Vf.$inject=["eventBus","elementFactory","commandStack","bpmnRules"],Vf.prototype.getHandlers=function(){var e=vf.prototype.getHandlers.call(this);return e["element.updateModdleProperties"]=yf,e["element.updateProperties"]=_f,e["canvas.updateRoot"]=Cf,e["lane.add"]=Tf,e["lane.resize"]=Rf,e["lane.split"]=Af,e["lane.updateRefs"]=Mf,e["id.updateClaim"]=Df,e["element.setColor"]=If,e["element.updateLabel"]=Lf,e},Vf.prototype.updateLabel=function(e,t,n,i){this._commandStack.execute("element.updateLabel",{element:e,newLabel:t,newBounds:n,hints:i||{}})},Vf.prototype.connect=function(e,t,n,i){var r=this._bpmnRules;if(n||(n=r.canConnect(e,t)),n)return this.createConnection(e,t,n,e.parent,i)},Vf.prototype.updateModdleProperties=function(e,t,n){this._commandStack.execute("element.updateModdleProperties",{element:e,moddleElement:t,properties:n})},Vf.prototype.updateProperties=function(e,t){this._commandStack.execute("element.updateProperties",{element:e,properties:t})},Vf.prototype.resizeLane=function(e,t,n){this._commandStack.execute("lane.resize",{shape:e,newBounds:t,balanced:n})},Vf.prototype.addLane=function(e,t){var n={shape:e,location:t};return this._commandStack.execute("lane.add",n),n.newLane},Vf.prototype.splitLane=function(e,t){this._commandStack.execute("lane.split",{shape:e,count:t})},Vf.prototype.makeCollaboration=function(){var e=this._create("root",{type:"bpmn:Collaboration"}),t={newRoot:e};return this._commandStack.execute("canvas.updateRoot",t),e},Vf.prototype.updateLaneRefs=function(e,t){this._commandStack.execute("lane.updateRefs",{flowNodeShapes:e,laneShapes:t})},Vf.prototype.makeProcess=function(){var e={newRoot:this._create("root",{type:"bpmn:Process"})};this._commandStack.execute("canvas.updateRoot",e)},Vf.prototype.claimId=function(e,t){this._commandStack.execute("id.updateClaim",{id:e,element:t,claiming:!0})},Vf.prototype.unclaimId=function(e,t){this._commandStack.execute("id.updateClaim",{id:e,element:t})},Vf.prototype.setColor=function(e,t){e.length||(e=[e]),this._commandStack.execute("element.setColor",{elements:e,colors:t})},$f.prototype.layoutConnection=function(e,t){return[(t=t||{}).connectionStart||fn(t.source||e.source),t.connectionEnd||fn(t.target||e.target)]};var zf=Math.round,qf={"h:h":20,"v:v":20,"h:v":-10,"v:h":-10};function Uf(e,t,n){var i,r,o,a=vn(t,e,5),s=n.split(":")[0],c=zf((t.x-e.x)/2+e.x),p=zf((t.y-e.y)/2+e.y),u=(o=a,{t:/top/,r:/right/,b:/bottom/,l:/left/,h:/left|right/,v:/top|bottom/}[s].test(o)),l=/h|r|l/.test(s),d=!1;return u?(i=l?{x:c,y:e.y}:{x:e.x,y:p},r=l?"h:h":"v:v"):(r=l?"h:v":"v:h",function(e,t){return!{t:/top/,r:/right/,b:/bottom/,l:/left/,h:/./,v:/./}[t].test(e)}(a,s)?l?(d=p===e.y,i={x:e.x+20*(/l/.test(s)?-1:1),y:d?p+20:p}):i={x:(d=c===e.x)?c+20:c,y:e.y+20*(/t/.test(s)?-1:1)}:i={x:c,y:p}),{waypoints:Hf(e,i,r).concat(i),directions:r,turnNextDirections:d}}function Gf(e){return e.split(":").reverse().join(":")}function Hf(e,t,n){if(!function(e){return e&&/^h|v|t|r|b|l:h|v|t|r|b|l$/.test(e)}(n=n||"h:h"))throw new Error("unknown directions: <"+n+">: must be specified as <start>:<end> with start/end in { h,v,t,r,b,l }");if(Jf(n)){var i=function(e,t,n){return Uf(e,t,n)}(e,t,n),r=function(e,t,n){var i=Uf(t,e,Gf(n));return{waypoints:i.waypoints.slice().reverse(),directions:Gf(i.directions),turnNextDirections:i.turnNextDirections}}(e,t,n),o=function(e,t){var n=e.directions.split(":")[1],i=t.directions.split(":")[0];e.turnNextDirections&&(n="h"==n?"v":"h"),t.turnNextDirections&&(i="h"==i?"v":"h");var r=n+":"+i;return{waypoints:Hf(e.waypoints[e.waypoints.length-1],t.waypoints[0],r),directions:r}}(i,r);return[].concat(i.waypoints,o.waypoints,r.waypoints)}return function(e,t,n){var i=zf((t.x-e.x)/2+e.x),r=zf((t.y-e.y)/2+e.y);if("h:v"===n)return[{x:t.x,y:e.y}];if("v:h"===n)return[{x:e.x,y:t.y}];if("h:h"===n)return[{x:i,y:e.y},{x:i,y:t.y}];if("v:v"===n)return[{x:e.x,y:r},{x:t.x,y:r}];throw new Error("invalid directions: can only handle varians of [hv]:[hv]")}(e,t,n)}function Wf(e,t,n,i,r){var o=P(r&&r.preferredLayouts||[],"straight")[0]||"h:h",a=vn(e,t,qf[o]||0),s=function(e,t){if(Jf(t))return t;switch(e){case"intersect":return"t:t";case"top":case"bottom":return"v:v";case"left":case"right":return"h:h";default:return t}}(a,o);n=n||fn(e),i=i||fn(t);var c=s.split(":");return function(e,t,n){var i=Hf(e,t,n);return i.unshift(e),i.push(t),Qf(i)}(Zf(n,e,c[0],function(e){return{top:"bottom",bottom:"top",left:"right",right:"left","top-left":"bottom-right","bottom-right":"top-left","top-right":"bottom-left","bottom-left":"top-right"}[e]}(a)),Zf(i,t,c[1],a),s)}function Kf(e,t,n,i,r,o){var a;return h(n)&&(r=n,o=i,n=fn(e),i=fn(t)),r=r||[],(a=-1!==(o=U({preferredLayouts:[]},o)).preferredLayouts.indexOf("straight")&&function(e,t,n,i,r){var o,a,s={};if(a=vn(e,t),!/^(top|bottom|left|right)$/.test(a))return null;/top|bottom/.test(a)&&(o="x");/left|right/.test(a)&&(o="y");return"target"===r.preserveDocking?Xf(o,i,e)?(s[o]=i[o],[{x:void 0!==s.x?s.x:n.x,y:void 0!==s.y?s.y:n.y,original:{x:void 0!==s.x?s.x:n.x,y:void 0!==s.y?s.y:n.y}},{x:i.x,y:i.y}]):null:Xf(o,n,t)?(s[o]=n[o],[{x:n.x,y:n.y},{x:void 0!==s.x?s.x:i.x,y:void 0!==s.y?s.y:i.y,original:{x:void 0!==s.x?s.x:i.x,y:void 0!==s.y?s.y:i.y}}]):null}(e,t,n,i,o))||(a=o.connectionEnd&&function(e,t,n,i){var r=i.slice().reverse();return(r=Yf(e,t,n,r))?r.reverse():null}(t,e,i,r))?a:(a=o.connectionStart&&Yf(e,t,n,r))||(!o.connectionStart&&!o.connectionEnd&&r&&r.length?r:Wf(e,t,n,i,o))}function Xf(e,t,n){return function(e,t,n){return e>=t&&e<=n}(t[e],n[e],n[e]+n[{x:"width",y:"height"}[e]])}function Yf(e,t,n,i){if(function(e){return e.length<3||!(e.length>4)&&!!x(e,(function(t,n){var i=e[n-1];return i&&St(t,i)<3}))}(i))return null;var r,o=i[0],a=i.slice();return a[0]=n,a[1]=function(e,t,n){switch(Ct(t,e)){case"v":return{x:n.x,y:e.y};case"h":return{x:e.x,y:n.y}}return{x:e.x,y:e.y}}(a[1],o,n),(r=function(e,t,n){var i;for(i=e.length-2;0!==i;i--)if(Tt(e[i],t,20)||Tt(e[i],n,20))return e.slice(i);return e}(a,e,t))!==a&&(a=Yf(e,t,n,r)),a&&Ct(a)?null:a}function Jf(e){return e&&/t|r|b|l/.test(e)}function Zf(e,t,n,i){if("h"===n&&(n=/left/.test(i)?"l":"r"),"v"===n&&(n=/top/.test(i)?"t":"b"),"t"===n)return{original:e,x:e.x,y:t.y};if("r"===n)return{original:e,x:t.x+t.width,y:e.y};if("b"===n)return{original:e,x:e.x,y:t.y+t.height};if("l"===n)return{original:e,x:t.x,y:e.y};throw new Error("unexpected dockingDirection: <"+n+">")}function Qf(e){return e.reduce((function(t,n,i){return Ot(t[t.length-1],e[i+1],n,0)||t.push(n),t}),[])}var ev={top:"bottom","top-right":"bottom-left","top-left":"bottom-right",right:"left",bottom:"top","bottom-right":"top-left","bottom-left":"top-right",left:"right"},tv={top:"t",right:"r",bottom:"b",left:"l"};function nv(){}function iv(e,t){return Dr(t,"bpmn:Participant")?"source":Dr(e,"bpmn:Participant")?"target":sv(t)?"source":sv(e)||Dr(t,"bpmn:Event")?"target":Dr(e,"bpmn:Event")?"source":null}function rv(e){return sv(e)?"target":"source"}function ov(e,t){return e?e.original||e:fn(t)}function av(e,t){return Dr(t,"bpmn:Activity")&&Dr(e,"bpmn:BoundaryEvent")&&t.businessObject.isForCompensation}function sv(e){return Dr(e,"bpmn:SubProcess")&&Nr(e)}function cv(e,t){return e===t}function pv(e){var t=/right|left/.exec(e);return t&&t[0]}function uv(e){var t=/top|bottom/.exec(e);return t&&t[0]}function lv(e){return"right"===e||"left"===e}function dv(e,t){var n=t.waypoints,i=n&&n.length&&vn(n[0],e);return"top"===i?["t:r"]:"right"===i?["r:b"]:"left"===i?["l:t"]:["b:l"]}function hv(e,t,n){var i,r,o=fn(e),a=fn(t),s=(r=(i=e).host,vn(fn(i),r,-10)),c=cv(e.host,t),p=-1!==["top","right","bottom","left"].indexOf(s),u=vn(a,o,{x:e.width/2+t.width/2,y:e.height/2+t.height/2});return c?function(e,t,n,i,r){var o,a=t?e:uv(e),s=tv[a];o=t?lv(e)?mv("y",n,i,r)?"h":"b":mv("x",n,i,r)?"v":"l":"v";return[s+":"+o]}(s,p,e,t,n):[function(e,t,n){if(n)return tv[e];if(cv(uv(e),uv(t))||(i=pv(e),r=pv(t),ev[i]===r))return tv[uv(e)];var i,r;return tv[pv(e)]}(s,u,p)+":"+function(e,t,n){if(n)return lv(e)?(i=t,r=pv(e),o=ev[r],-1!==i.indexOf(o)||cv(e,t)?"h":"v"):function(e,t){var n=uv(e),i=ev[n];return-1!==t.indexOf(i)}(e,t)||cv(e,t)?"v":"h";var i,r,o;return lv(t)||cv(uv(e),uv(t))&&pv(t)?"h":"v"}(s,u,p)]}function mv(e,t,n,i){return!(fv(e,i,n,40)||fv(e,i,{x:n.x+n.width,y:n.y+n.height},40)||fv(e,i,fn(t),40))}function fv(e,t,n,i){return Math.abs(t[e]-n[e])<i}function vv(e){return U({original:e.point.original||e.point},e.actual)}function yv(e,t){this._elementRegistry=e,this._graphicsFactory=t}i(nv,$f),nv.prototype.layoutConnection=function(e,t){t||(t={});var n,i,r=t.source||e.source,o=t.target||e.target,a=t.waypoints||e.waypoints,s=t.connectionStart,c=t.connectionEnd;return s||(s=ov(a&&a[0],r)),c||(c=ov(a&&a[a.length-1],o)),(Dr(e,"bpmn:Association")||Dr(e,"bpmn:DataAssociation"))&&a&&!av(r,o)?[].concat([s],a.slice(1,-1),[c]):(Dr(e,"bpmn:MessageFlow")?n=function(e,t){return{preferredLayouts:["straight","v:v"],preserveDocking:iv(e,t)}}(r,o):(Dr(e,"bpmn:SequenceFlow")||av(r,o))&&(n=r===o?{preferredLayouts:dv(r,e)}:Dr(r,"bpmn:BoundaryEvent")?{preferredLayouts:hv(r,o,c)}:sv(r)||sv(o)?function(e){return{preferredLayouts:["straight","h:h"],preserveDocking:rv(e)}}(r):Dr(r,"bpmn:Gateway")?{preferredLayouts:["v:h"]}:Dr(o,"bpmn:Gateway")?{preferredLayouts:["h:v"]}:{preferredLayouts:["h:h"]}),n&&(i=Qf(Kf(r,o,s,c,a,n=U(n,t)))),i||[s,c])},yv.$inject=["elementRegistry","graphicsFactory"],yv.prototype.getCroppedWaypoints=function(e,t,n){t=t||e.source,n=n||e.target;var i=this.getDockingPoint(e,t,!0),r=this.getDockingPoint(e,n),o=e.waypoints.slice(i.idx+1,r.idx);return o.unshift(vv(i)),o.push(vv(r)),o},yv.prototype.getDockingPoint=function(e,t,n){var i,r,o=e.waypoints;return{point:r=o[i=n?0:o.length-1],actual:this._getIntersection(t,e,n)||r,idx:i}},yv.prototype._getIntersection=function(e,t,n){return yn(this._getShapePath(e),this._getConnectionPath(t),n)},yv.prototype._getConnectionPath=function(e){return this._graphicsFactory.getConnectionPath(e)},yv.prototype._getShapePath=function(e){return this._graphicsFactory.getShapePath(e)},yv.prototype._getGfx=function(e){return this._elementRegistry.getGraphics(e)};var gv={__init__:["modeling","bpmnUpdater"],__depends__:[ih,Lh,Vh,qh,Sp,Gh,Yh,em,rm,Ho,Gu,Pm],bpmnFactory:["type",Sm],bpmnUpdater:["type",Om],elementFactory:["type",Tm],modeling:["type",Vf],layouter:["type",nv],connectionDocking:["type",yv]},bv=Math.round;function xv(e,t,n,i,r){function o(e,t,n,i){return r.allowed("elements.move",{shapes:e,delta:t,position:n,target:i})}function a(e,n,i,r){if(m(i)&&(r=i,i=!1),!n.waypoints&&n.parent){var o=function(e){return{x:e.x+bv(e.width/2),y:e.y+bv(e.height/2)}}(n);return t.init(e,o,"shape.move",{cursor:"grabbing",autoActivate:i,data:{shape:n,context:r||{}}}),!0}}e.on("shape.move.start",1500,(function(e){var t=e.context,n=e.shape,r=i.get().slice();-1===r.indexOf(n)&&(r=[n]),U(t,{shapes:r=function(e){var t=j(e,"id");return w(e,(function(e){for(;e=e.parent;)if(t[e.id])return!1;return!0}))}(r),validatedShapes:r,shape:n})})),e.on("shape.move.start",1250,(function(e){var t=e.context,n=t.validatedShapes;if(!(t.canExecute=o(n)))return!1})),e.on("shape.move.move",500,(function(e){var t,n=e.context,i=n.validatedShapes,r=e.hover,a={x:e.dx,y:e.dy};t=o(i,a,{x:e.x,y:e.y},r),n.delta=a,n.canExecute=t,n.target=null!==t?r:null})),e.on("shape.move.end",(function(e){var t=e.context,i=t.delta,r=t.canExecute,o="attach"===r,a=t.shapes;if(!1===r)return!1;i.x=bv(i.x),i.y=bv(i.y),0===i.x&&0===i.y||n.moveElements(a,i,t.target,{primaryShape:t.shape,attach:o})})),e.on("element.mousedown",(function(e){if(ko(e)){var t=Co(e);if(!t)throw new Error("must supply DOM mousedown event");return a(t,e.element)}})),this.start=a}xv.$inject=["eventBus","dragging","modeling","selection","rules"];var Ev="djs-dragging",wv="drop-ok",_v="drop-not-ok",Pv="new-parent",Sv="attach-ok";function Ov(e,t,n,i){function r(e){return function(e){return w(e,(function(t){return!function(e){return e.waypoints}(t)||x(e,I({id:t.source.id}))&&x(e,I({id:t.target.id}))}))}(o(e))}function o(e){var t=mt(e,!0),n=T(t,(function(e){return(e.incoming||[]).concat(e.outgoing||[])}));return s(t.concat(n))}function a(e,n){[Sv,wv,_v,Pv].forEach((function(i){i===n?t.addMarker(e,i):t.removeMarker(e,i)}))}e.on("shape.move.start",499,(function(e){var a=e.context,c=a.shapes,p=a.allDraggedElements,u=r(c);if(!a.dragGroup){var l=Ne("g");Pe(l,n.cls("djs-drag-group",["no-events"])),Ee(t.getActiveLayer(),l),a.dragGroup=l}u.forEach((function(e){i.addDragger(e,a.dragGroup)})),_(p=p?s([p,o(c)]):o(c),(function(e){t.addMarker(e,Ev)})),a.allDraggedElements=p,a.differentParents=1!==R(j(c,(function(e){return e.parent&&e.parent.id})))})),e.on("shape.move.move",499,(function(e){var t=e.context,n=t.dragGroup,i=t.target,r=t.shape.parent,o=t.canExecute;i&&("attach"===o?a(i,Sv):t.canExecute&&i&&i.id!==r.id?a(i,Pv):a(i,t.canExecute?wv:_v)),Yn(n,e.dx,e.dy)})),e.on(["shape.move.out","shape.move.cleanup"],(function(e){var t=e.context.target;t&&a(t,null)})),e.on("shape.move.cleanup",(function(e){var n=e.context,i=n.allDraggedElements,r=n.dragGroup;_(i,(function(e){t.removeMarker(e,Ev)})),r&&ke(r)})),this.makeDraggable=function(e,n,r){i.addDragger(n,e.dragGroup),r&&t.addMarker(n,Ev),e.allDraggedElements?e.allDraggedElements.push(n):e.allDraggedElements=[n]}}Ov.$inject=["eventBus","canvas","styles","previewSupport"];var Cv={__depends__:[No,Ho,Fo,Ss,xs,Fc],__init__:["move","movePreview"],move:["type",xv],movePreview:["type",Ov]},Tv=".djs-palette-toggle",Av=".entry",Rv="open";function kv(e,t){this._eventBus=e,this._canvas=t;var n=this;e.on("tool-manager.update",(function(e){var t=e.tool;n.updateToolHighlight(t)})),e.on("i18n.changed",(function(){n._update()})),e.on("diagram.init",(function(){n._diagramInitialized=!0,n._rebuild()}))}function jv(e,t){var n=t.getPaletteEntries();return v(n)?n(e):(_(n,(function(t,n){e[n]=t})),e)}kv.$inject=["eventBus","canvas"],kv.prototype.registerProvider=function(e,t){t||(t=e,e=1e3),this._eventBus.on("palette.getProviders",e,(function(e){e.providers.push(t)})),this._rebuild()},kv.prototype.getEntries=function(){return this._getProviders().reduce(jv,{})},kv.prototype._rebuild=function(){this._diagramInitialized&&(this._getProviders().length&&(this._container||this._init(),this._update()))},kv.prototype._init=function(){var e=this,t=this._eventBus,n=this._getParentContainer(),i=this._container=he(kv.HTML_MARKUP);n.appendChild(i),de.bind(i,".djs-palette-toggle, .entry","click",(function(t){var n=t.delegateTarget;if(re(n,Tv))return e.toggle();e.trigger("click",t)})),pe.bind(i,"mousedown",(function(e){e.stopPropagation()})),de.bind(i,Av,"dragstart",(function(t){e.trigger("dragstart",t)})),t.on("canvas.resized",this._layoutChanged,this),t.fire("palette.create",{container:i})},kv.prototype._getProviders=function(e){var t=this._eventBus.createEvent({type:"palette.getProviders",providers:[]});return this._eventBus.fire(t),t.providers},kv.prototype._toggleState=function(e){e=e||{};var t,n=this._getParentContainer(),i=this._container,r=this._eventBus,o=Q(i);t="twoColumn"in e?e.twoColumn:this._needsCollapse(n.clientHeight,this._entries||{}),o.toggle("two-column",t),"open"in e&&o.toggle(Rv,e.open),r.fire("palette.changed",{twoColumn:t,open:this.isOpen()})},kv.prototype._update=function(){var e=ve(".djs-palette-entries",this._container),t=this._entries=this.getEntries();te(e),_(t,(function(t,n){var i=t.group||"default",r=ve("[data-group="+i+"]",e);r||(r=he('<div class="group" data-group="'+i+'"></div>'),e.appendChild(r));var o=t.html||(t.separator?'<hr class="separator" />':'<div class="entry" draggable="true"></div>'),a=he(o);r.appendChild(a),t.separator||(K(a,"data-action",n),t.title&&K(a,"title",t.title),t.className&&function(e,t){var n=Q(e);(h(t)?t:t.split(/\s+/g)).forEach((function(e){n.add(e)}))}(a,t.className),t.imageUrl&&a.appendChild(he('<img src="'+t.imageUrl+'">')))})),this.open()},kv.prototype.trigger=function(e,t,n){var i,r,o,a=this._entries,s=t.delegateTarget||t.target;if(!s)return t.preventDefault();(i=a[K(s,"data-action")])&&(r=i.action,o=t.originalEvent||t,v(r)?"click"===e&&r(o,n):r[e]&&r[e](o,n),t.preventDefault())},kv.prototype._layoutChanged=function(){this._toggleState({})},kv.prototype._needsCollapse=function(e,t){return e<46*Object.keys(t).length+50},kv.prototype.close=function(){this._toggleState({open:!1,twoColumn:!1})},kv.prototype.open=function(){this._toggleState({open:!0})},kv.prototype.toggle=function(e){this.isOpen()?this.close():this.open()},kv.prototype.isActiveTool=function(e){return e&&this._activeTool===e},kv.prototype.updateToolHighlight=function(e){var t;this._toolsContainer||(t=ve(".djs-palette-entries",this._container),this._toolsContainer=ve("[data-group=tools]",t)),_(this._toolsContainer.children,(function(t){var n=t.getAttribute("data-action");if(n){var i=Q(t);n=n.replace("-tool",""),i.contains("entry")&&n===e?i.add("highlighted-entry"):i.remove("highlighted-entry")}}))},kv.prototype.isOpen=function(){return Q(this._container).has(Rv)},kv.prototype._getParentContainer=function(){return this._canvas.getContainer()},kv.HTML_MARKUP='<div class="djs-palette"><div class="djs-palette-entries"></div><div class="djs-palette-toggle"></div></div>';var Mv={__init__:["palette"],palette:["type",kv]},Dv="crosshair";function Bv(e,t,n,i,r,o,a){this._selection=r,this._dragging=n,this._mouse=a;var s=this,c=function(e){var n,i=t.getActiveLayer();Pe(n=e.frame=Ne("rect"),{class:"djs-lasso-overlay",width:1,height:1,x:0,y:0}),Ee(i,n)},p=function(e){var t=e.frame,n=e.bbox;Pe(t,{x:n.x,y:n.y,width:n.width,height:n.height})},u=function(e){e.frame&&ke(e.frame)};o.registerTool("lasso",{tool:"lasso.selection",dragging:"lasso"}),e.on("lasso.selection.end",(function(t){var n=t.originalEvent.target;(t.hover||n instanceof SVGElement)&&e.once("lasso.selection.ended",(function(){s.activateLasso(t.originalEvent,!0)}))})),e.on("lasso.end",(function(e){var t=Iv(e),n=i.filter((function(e){return e}));s.select(n,t)})),e.on("lasso.start",(function(e){var t=e.context;t.bbox=Iv(e),c(t)})),e.on("lasso.move",(function(e){var t=e.context;t.bbox=Iv(e),p(t)})),e.on("lasso.cleanup",(function(e){var t=e.context;u(t)})),e.on("element.mousedown",1500,(function(e){if(Mo(e))return s.activateLasso(e.originalEvent),!0}))}function Iv(e){var t={x:e.x-e.dx,y:e.y-e.dy},n={x:e.x,y:e.y};return t.x<=n.x&&t.y<n.y||t.x<n.x&&t.y<=n.y?{x:t.x,y:t.y,width:n.x-t.x,height:n.y-t.y}:t.x>=n.x&&t.y<n.y||t.x>n.x&&t.y<=n.y?{x:n.x,y:t.y,width:t.x-n.x,height:n.y-t.y}:t.x<=n.x&&t.y>n.y||t.x<n.x&&t.y>=n.y?{x:t.x,y:n.y,width:n.x-t.x,height:t.y-n.y}:t.x>=n.x&&t.y>n.y||t.x>n.x&&t.y>=n.y?{x:n.x,y:n.y,width:t.x-n.x,height:t.y-n.y}:{x:n.x,y:n.y,width:0,height:0}}Bv.$inject=["eventBus","canvas","dragging","elementRegistry","selection","toolManager","mouse"],Bv.prototype.activateLasso=function(e,t){this._dragging.init(e,"lasso",{autoActivate:t,cursor:Dv,data:{context:{}}})},Bv.prototype.activateSelection=function(e,t){this._dragging.init(e,"lasso.selection",{trapClick:!1,autoActivate:t,cursor:Dv,data:{context:{}}})},Bv.prototype.select=function(e,t){var n=function(e,t){var n={};return _(e,(function(e){var i=e;i.waypoints&&(i=ft(i)),!f(t.y)&&i.x>t.x&&(n[e.id]=e),!f(t.x)&&i.y>t.y&&(n[e.id]=e),i.x>t.x&&i.y>t.y&&(f(t.width)&&f(t.height)&&i.width+i.x<t.width+t.x&&i.height+i.y<t.height+t.y?n[e.id]=e:f(t.width)&&f(t.height)||(n[e.id]=e))})),n}(e,t);this._selection.select(k(n))},Bv.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var e=this._mouse.getLastMoveEvent();this.activateSelection(e,!!e)},Bv.prototype.isActive=function(){var e=this._dragging.context();return e&&/^lasso/.test(e.prefix)};var Nv={__depends__:[am,rp],__init__:["lassoTool"],lassoTool:["type",Bv]},Lv=1500,Fv="grab";function Vv(e,t,n,i,r,o){this._dragging=n,this._mouse=o;var a=this,s=i.get("keyboard",!1);r.registerTool("hand",{tool:"hand",dragging:"hand.move"}),e.on("element.mousedown",Lv,(function(e){if(jo(e))return a.activateMove(e.originalEvent,!0),!1})),s&&s.addListener(Lv,(function(e){if($v(e.keyEvent)&&!a.isActive()){var t=a._mouse.getLastMoveEvent();a.activateMove(t,!!t)}}),"keyboard.keydown"),s&&s.addListener(Lv,(function(e){$v(e.keyEvent)&&a.isActive()&&a.toggle()}),"keyboard.keyup"),e.on("hand.end",(function(t){var n=t.originalEvent.target;if(!(t.hover||n instanceof SVGElement))return!1;e.once("hand.ended",(function(){a.activateMove(t.originalEvent,{reactivate:!0})}))})),e.on("hand.move.move",(function(e){var n=t.viewbox().scale;t.scroll({dx:e.dx*n,dy:e.dy*n})})),e.on("hand.move.end",(function(t){var n=t.context.reactivate;return!jo(t)&&n&&e.once("hand.move.ended",(function(e){a.activateHand(e.originalEvent,!0,!0)})),!1}))}function $v(e){return na(" ",e)}Vv.$inject=["eventBus","canvas","dragging","injector","toolManager","mouse"],Vv.prototype.activateMove=function(e,t,n){"object"==typeof t&&(n=t,t=!1),this._dragging.init(e,"hand.move",{autoActivate:t,cursor:Fv,data:{context:n||{}}})},Vv.prototype.activateHand=function(e,t,n){this._dragging.init(e,"hand",{trapClick:!1,autoActivate:t,cursor:Fv,data:{context:{reactivate:n}}})},Vv.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var e=this._mouse.getLastMoveEvent();this.activateHand(e,!!e)},Vv.prototype.isActive=function(){var e=this._dragging.context();return!!e&&/^(hand|hand\.move)$/.test(e.prefix)};var zv={__depends__:[am,rp],__init__:["handTool"],handTool:["type",Vv]},qv="connect-ok",Uv="connect-not-ok";function Gv(e,t,n,i,r,o,a){var s=this;this._dragging=t,this._rules=o,this._mouse=a,r.registerTool("global-connect",{tool:"global-connect",dragging:"global-connect.drag"}),e.on("global-connect.hover",(function(e){var t=e.context,n=e.hover,r=t.canStartConnect=s.canStartConnect(n);null!==r&&(t.startTarget=n,i.addMarker(n,r?qv:Uv))})),e.on(["global-connect.out","global-connect.cleanup"],(function(e){var t=e.context.startTarget,n=e.context.canStartConnect;t&&i.removeMarker(t,n?qv:Uv)})),e.on(["global-connect.ended"],(function(t){var i=t.context.startTarget,r={x:t.x,y:t.y};if(s.canStartConnect(i))return e.once("element.out",(function(){e.once(["connect.ended","connect.canceled"],(function(){e.fire("global-connect.drag.ended")})),n.start(null,i,r)})),!1}))}Gv.$inject=["eventBus","dragging","connect","canvas","toolManager","rules","mouse"],Gv.prototype.start=function(e,t){this._dragging.init(e,"global-connect",{autoActivate:t,trapClick:!1,data:{context:{}}})},Gv.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var e=this._mouse.getLastMoveEvent();return this.start(e,!!e)},Gv.prototype.isActive=function(){var e=this._dragging.context();return e&&/^global-connect/.test(e.prefix)},Gv.prototype.canStartConnect=function(e){return this._rules.allowed("connection.start",{source:e})};var Hv={__depends__:[_c,Ss,xs,am,rp],globalConnect:["type",Gv]};function Wv(e,t,n,i,r,o,a,s){this._palette=e,this._create=t,this._elementFactory=n,this._spaceTool=i,this._lassoTool=r,this._handTool=o,this._globalConnect=a,this._translate=s,e.registerProvider(this)}Wv.$inject=["palette","create","elementFactory","spaceTool","lassoTool","handTool","globalConnect","translate"],Wv.prototype.getPaletteEntries=function(e){var t={},n=this._create,i=this._elementFactory,r=this._spaceTool,o=this._lassoTool,a=this._handTool,s=this._globalConnect,c=this._translate;function p(e,t,r,o,a){function s(t){var r=i.createShape(U({type:e},a));a&&(r.businessObject.di.isExpanded=a.isExpanded),n.start(t,r)}var p=e.replace(/^bpmn:/,"");return{group:t,className:r,title:o||c("Create {type}",{type:p}),action:{dragstart:s,click:s}}}function u(e){var t=i.createShape({type:"bpmn:SubProcess",x:0,y:0,isExpanded:!0}),r=i.createShape({type:"bpmn:StartEvent",x:40,y:82,parent:t});n.start(e,[t,r],{hints:{autoSelect:[r]}})}function l(e){n.start(e,i.createParticipantShape())}return U(t,{"hand-tool":{group:"tools",className:"bpmn-icon-hand-tool",title:c("Activate the hand tool"),action:{click:function(e){a.activateHand(e)}}},"lasso-tool":{group:"tools",className:"bpmn-icon-lasso-tool",title:c("Activate the lasso tool"),action:{click:function(e){o.activateSelection(e)}}},"space-tool":{group:"tools",className:"bpmn-icon-space-tool",title:c("Activate the create/remove space tool"),action:{click:function(e){r.activateSelection(e)}}},"global-connect-tool":{group:"tools",className:"bpmn-icon-connection-multi",title:c("Activate the global connect tool"),action:{click:function(e){s.start(e)}}},"tool-separator":{group:"tools",separator:!0},"create.start-event":p("bpmn:StartEvent","event","bpmn-icon-start-event-none",c("Create StartEvent")),"create.intermediate-event":p("bpmn:IntermediateThrowEvent","event","bpmn-icon-intermediate-event-none",c("Create Intermediate/Boundary Event")),"create.end-event":p("bpmn:EndEvent","event","bpmn-icon-end-event-none",c("Create EndEvent")),"create.exclusive-gateway":p("bpmn:ExclusiveGateway","gateway","bpmn-icon-gateway-none",c("Create Gateway")),"create.task":p("bpmn:Task","activity","bpmn-icon-task",c("Create Task")),"create.data-object":p("bpmn:DataObjectReference","data-object","bpmn-icon-data-object",c("Create DataObjectReference")),"create.data-store":p("bpmn:DataStoreReference","data-store","bpmn-icon-data-store",c("Create DataStoreReference")),"create.subprocess-expanded":{group:"activity",className:"bpmn-icon-subprocess-expanded",title:c("Create expanded SubProcess"),action:{dragstart:u,click:u}},"create.participant-expanded":{group:"collaboration",className:"bpmn-icon-participant",title:c("Create Pool/Participant"),action:{dragstart:l,click:l}},"create.group":p("bpmn:Group","artifact","bpmn-icon-group",c("Create Group"))}),t};var Kv={__depends__:[Mv,Yc,Pm,Nv,zv,Hv,ho],__init__:["paletteProvider"],paletteProvider:["type",Wv]};function Xv(e,t,n,i,r){as.call(this,e),e.on("shape.move.move",250,(function(e){var o=e.context,a=o.canExecute;o.visualReplacements||(o.visualReplacements={}),a&&a.replacements?function(e){_(e.canExecute.replacements,(function(o){var a=o.oldElementId,s={type:o.newElementType};if(!e.visualReplacements[a]){var c=t.get(a);U(s,{x:c.x,y:c.y});var p=n.createShape(s);i.addShape(p,c.parent);var u=ve('[data-element-id="'+Is(c.id)+'"]',e.dragGroup);u&&Pe(u,{display:"none"});var l=r.addDragger(p,e.dragGroup);e.visualReplacements[a]=l,i.removeShape(p)}}))}(o):function(e){var t=e.visualReplacements;_(t,(function(n,i){var r=ve('[data-element-id="'+Is(i)+'"]',e.dragGroup);r&&Pe(r,{display:"inline"}),n.remove(),t[i]&&delete t[i]}))}(o)}))}Xv.$inject=["eventBus","elementRegistry","elementFactory","canvas","previewSupport"],i(Xv,as);var Yv={__depends__:[Fc],__init__:["bpmnReplacePreview"],bpmnReplacePreview:["type",Xv]},Jv=40,Zv=["x","y"],Qv=Math.abs;function ey(e){e.on(["connect.hover","connect.move","connect.end"],1250,(function(e){var t=e.context,n=t.canExecute,i=t.start,r=t.hover,o=t.source,a=t.target;e.originalEvent&&ta(e.originalEvent)||(t.initialConnectionStart||(t.initialConnectionStart=t.connectionStart),n&&r&&function(e,t,n){Zv.forEach((function(i){var r=iy(i,t);e[i]<t[i]+n?dc(e,i,t[i]+n):e[i]>t[i]+r-n&&dc(e,i,t[i]+r-n)}))}(e,r,function(e){return Dr(e,"bpmn:Task")?10:20}(r)),r&&function(e,t){return C(t,(function(t){return ny(e,t)}))}(n,["bpmn:Association","bpmn:DataInputAssociation","bpmn:DataOutputAssociation","bpmn:SequenceFlow"])?(t.connectionStart=uc(i),Qa(r,["bpmn:Event","bpmn:Gateway"])&&ty(e,uc(r)),Qa(r,["bpmn:Task","bpmn:SubProcess"])&&function(e,t){var n=uc(t);Zv.forEach((function(i){(function(e,t,n){return e[n]>t[n]+20&&e[n]<t[n]+iy(n,t)-20})(e,t,i)&&dc(e,i,n[i])}))}(e,r),Dr(o,"bpmn:BoundaryEvent")&&a===o.host&&function(e){var t=e.context,n=t.source,i=t.target;if(function(e){var t=e.hover,n=e.source;return t&&n&&t===n}(t))return;var r=uc(n),o=vn(r,i,-10),a=[];/top|bottom/.test(o)&&a.push("x");/left|right/.test(o)&&a.push("y");a.forEach((function(t){var n,i=e[t];Qv(i-r[t])<Jv&&(n=i>r[t]?r[t]+Jv:r[t]-Jv,dc(e,t,n))}))}(e)):ny(n,"bpmn:MessageFlow")?(Dr(i,"bpmn:Event")&&(t.connectionStart=uc(i)),Dr(r,"bpmn:Event")&&ty(e,uc(r))):t.connectionStart=t.initialConnectionStart)}))}function ty(e,t){dc(e,"x",t.x),dc(e,"y",t.y)}function ny(e,t){return e&&e.type===t}function iy(e,t){return"x"===e?t.width:t.height}function ry(){this._targets={},this._snapOrigins={},this._snapLocations=[],this._defaultSnaps={}}function oy(e){this._snapValues={}}ey.$inject=["eventBus"],ry.prototype.getSnapOrigin=function(e){return this._snapOrigins[e]},ry.prototype.setSnapOrigin=function(e,t){this._snapOrigins[e]=t,-1===this._snapLocations.indexOf(e)&&this._snapLocations.push(e)},ry.prototype.addDefaultSnap=function(e,t){var n=this._defaultSnaps[e];n||(n=this._defaultSnaps[e]=[]),n.push(t)},ry.prototype.getSnapLocations=function(){return this._snapLocations},ry.prototype.setSnapLocations=function(e){this._snapLocations=e},ry.prototype.pointsForTarget=function(e){var t=e.id||e,n=this._targets[t];return n||(n=this._targets[t]=new oy).initDefaults(this._defaultSnaps),n},oy.prototype.add=function(e,t){var n=this._snapValues[e];n||(n=this._snapValues[e]={x:[],y:[]}),-1===n.x.indexOf(t.x)&&n.x.push(t.x),-1===n.y.indexOf(t.y)&&n.y.push(t.y)},oy.prototype.snap=function(e,t,n,i){var r=this._snapValues[t];return r&&function(e,t,n){var i,r;for(n=void 0===n?10:n,i=0;i<t.length;i++)if(r=t[i],ac(r-e)<=n)return r}(e[n],r[n],i)},oy.prototype.initDefaults=function(e){var t=this;_(e||{},(function(e,n){_(e,(function(e){t.add(n,e)}))}))};function ay(e,t,n){var i=this;this._elementRegistry=e,t.on(["create.start","shape.move.start"],(function(e){i.initSnap(e)})),t.on(["create.move","create.end","shape.move.move","shape.move.end"],1250,(function(e){var t=e.context,r=t.shape,o=t.snapContext,a=t.target;if((!e.originalEvent||!ta(e.originalEvent))&&!lc(e)&&a){var s=o.pointsForTarget(a);s.initialized||((s=i.addSnapTargetPoints(s,r,a)).initialized=!0),n.snap(e,s)}})),t.on(["create.cleanup","shape.move.cleanup"],(function(){n.hide()}))}function sy(e){return!!e.labelTarget}ay.$inject=["elementRegistry","eventBus","snapping"],ay.prototype.initSnap=function(e){var t,n=this._elementRegistry,i=e.context,r=i.shape,o=i.snapContext;o||(o=i.snapContext=new ry);var a=(t=n.get(r.id)?uc(r,e):{x:e.x+uc(r).x,y:e.y+uc(r).y}).x-r.width/2,s=t.y-r.height/2,c=t.x+r.width/2,p=t.y+r.height/2;return o.setSnapOrigin("mid",{x:t.x-e.x,y:t.y-e.y}),sy(r)||(o.setSnapOrigin("top-left",{x:a-e.x,y:s-e.y}),o.setSnapOrigin("bottom-right",{x:c-e.x,y:p-e.y})),o},ay.prototype.addSnapTargetPoints=function(e,t,n){return _(this.getSnapTargets(t,n),(function(n){if(sy(n))sy(t)&&e.add("mid",uc(n));else if(n.waypoints){if(n.waypoints.length<3)return;_(n.waypoints.slice(1,-1),(function(t){e.add("mid",t)}))}else{e.add("mid",uc(n))}})),f(t.x)&&f(t.y)?(this._elementRegistry.get(t.id)&&e.add("mid",uc(t)),e):e},ay.prototype.getSnapTargets=function(e,t){return hc(t).filter((function(e){return!e.hidden}))};function cy(e,t){t.invoke(ay,this),e.on(["create.move","create.end"],1500,py),e.on(["create.move","create.end","shape.move.move","shape.move.end"],1500,(function(e){var t=e.context,n=t.canExecute,i=t.target;n&&("attach"===n||n.attach)&&!lc(e)&&function(e,t){var n,i=hn(t),r=rh(e,t),o=e.context.shape;n=o.parent?{x:0,y:0}:fn(o);/top/.test(r)?dc(e,"y",i.top-n.y):/bottom/.test(r)&&dc(e,"y",i.bottom-n.y);/left/.test(r)?dc(e,"x",i.left-n.x):/right/.test(r)&&dc(e,"x",i.right-n.x)}(e,i)}))}function py(e){var t=e.context.createConstraints;if(t){var n=t.top,i=t.right,r=t.bottom,o=t.left;(o&&o>=e.x||i&&i<=e.x)&&dc(e,"x",e.x),(n&&n>=e.y||r&&r<=e.y)&&dc(e,"y",e.y)}}function uy(e,t){return-1!==e.indexOf(t)}function ly(e,t,n){return t?{x:e.x-n.x,y:e.y-n.y}:{x:e.x,y:e.y}}i(cy,ay),cy.$inject=["eventBus","injector"],cy.prototype.initSnap=function(e){var t=ay.prototype.initSnap.call(this,e),n=e.shape,i=!!this._elementRegistry.get(n.id);return _(n.outgoing,(function(n){var r=n.waypoints[0];r=r.original||r,t.setSnapOrigin(n.id+"-docking",ly(r,i,e))})),_(n.incoming,(function(n){var r=n.waypoints[n.waypoints.length-1];r=r.original||r,t.setSnapOrigin(n.id+"-docking",ly(r,i,e))})),Dr(n,"bpmn:Participant")&&t.setSnapLocations(["top-left","bottom-right","mid"]),t},cy.prototype.addSnapTargetPoints=function(e,t,n){ay.prototype.addSnapTargetPoints.call(this,e,t,n);var i=this.getSnapTargets(t,n);_(i,(function(n){var i;(function(e){if(Dr(e,"bpmn:SubProcess")&&Nr(e))return!0;return Dr(e,"bpmn:Participant")}(n)||(i="bpmn:TextAnnotation",[t,n].every((function(e){return Dr(e,i)}))))&&(e.add("top-left",cc(n)),e.add("bottom-right",pc(n)))}));var r=this._elementRegistry;return _(t.incoming,(function(n){if(r.get(t.id)){uy(i,n.source)||e.add("mid",fn(n.source));var o=n.waypoints[0];e.add(n.id+"-docking",o.original||o)}})),_(t.outgoing,(function(n){if(r.get(t.id)){uy(i,n.target)||e.add("mid",fn(n.target));var o=n.waypoints[n.waypoints.length-1];e.add(n.id+"-docking",o.original||o)}})),Dr(n,"bpmn:SequenceFlow")&&(e=this.addSnapTargetPoints(e,t,n.parent)),e},cy.prototype.getSnapTargets=function(e,t){return ay.prototype.getSnapTargets.call(this,e,t).filter((function(e){return!Dr(e,"bpmn:Lane")}))};function dy(e,t){var n=this;e.on(["resize.start"],(function(e){n.initSnap(e)})),e.on(["resize.move","resize.end"],1250,(function(e){var i=e.context,r=i.shape,o=r.parent,a=i.direction,s=i.snapContext;if(!(e.originalEvent&&ta(e.originalEvent)||lc(e))){var c=s.pointsForTarget(o);c.initialized||((c=n.addSnapTargetPoints(c,r,o,a)).initialized=!0),function(e){return"n"===e||"s"===e}(a)&&dc(e,"x",e.x),function(e){return"e"===e||"w"===e}(a)&&dc(e,"y",e.y),t.snap(e,c)}})),e.on(["resize.cleanup"],(function(){t.hide()}))}function hy(e,t){var n=fn(e),i=hn(e),r={x:n.x,y:n.y};return-1!==t.indexOf("n")?r.y=i.top:-1!==t.indexOf("s")&&(r.y=i.bottom),-1!==t.indexOf("e")?r.x=i.right:-1!==t.indexOf("w")&&(r.x=i.left),r}dy.prototype.initSnap=function(e){var t=e.context,n=t.shape,i=t.direction,r=t.snapContext;r||(r=t.snapContext=new ry);var o=hy(n,i);return r.setSnapOrigin("corner",{x:o.x-e.x,y:o.y-e.y}),r},dy.prototype.addSnapTargetPoints=function(e,t,n,i){return _(this.getSnapTargets(t,n),(function(t){e.add("corner",pc(t)),e.add("corner",cc(t))})),e.add("corner",hy(t,i)),e},dy.$inject=["eventBus","snapping"],dy.prototype.getSnapTargets=function(e,t){return hc(t).filter((function(t){return!(n=t,i=e,n.host===i||function(e){return!!e.waypoints}(t)||function(e){return!!e.hidden}(t)||function(e){return!!e.labelTarget}(t));var n,i}))};function my(e){this._canvas=e,this._asyncHide=$(z(this.hide,this),1e3)}my.$inject=["canvas"],my.prototype.snap=function(e,t){var n=e.context.snapContext,i=n.getSnapLocations(),r={x:lc(e,"x"),y:lc(e,"y")};_(i,(function(i){var o=n.getSnapOrigin(i),a={x:e.x+o.x,y:e.y+o.y};if(_(["x","y"],(function(e){var n;r[e]||void 0!==(n=t.snap(a,i,e,7))&&(r[e]={value:n,originValue:n-o[e]})})),r.x&&r.y)return!1})),this.showSnapLine("vertical",r.x&&r.x.value),this.showSnapLine("horizontal",r.y&&r.y.value),_(["x","y"],(function(t){var n=r[t];m(n)&&dc(e,t,n.originValue)}))},my.prototype._createLine=function(e){var t=this._canvas.getLayer("snap"),n=Ne("path");return Pe(n,{d:"M0,0 L0,0"}),Ae(n).add("djs-snap-line"),Ee(t,n),{update:function(t){f(t)?Pe(n,"horizontal"===e?{d:"M-100000,"+t+" L+100000,"+t,display:""}:{d:"M "+t+",-100000 L "+t+", +100000",display:""}):Pe(n,{display:"none"})}}},my.prototype._createSnapLines=function(){this._snapLines={horizontal:this._createLine("horizontal"),vertical:this._createLine("vertical")}},my.prototype.showSnapLine=function(e,t){var n=this.getSnapLine(e);n&&n.update(t),this._asyncHide()},my.prototype.getSnapLine=function(e){return this._snapLines||this._createSnapLines(),this._snapLines[e]},my.prototype.hide=function(){_(this._snapLines,(function(e){e.update()}))};var fy={__depends__:[{__init__:["createMoveSnapping","resizeSnapping","snapping"],createMoveSnapping:["type",ay],resizeSnapping:["type",dy],snapping:["type",my]}],__init__:["connectSnapping","createMoveSnapping"],connectSnapping:["type",ey],createMoveSnapping:["type",cy]};function vy(e,t,n,i){this._open=!1,this._results=[],this._eventMaps=[],this._canvas=e,this._eventBus=t,this._overlays=n,this._selection=i,this._container=he(vy.BOX_HTML),this._searchInput=ve(vy.INPUT_SELECTOR,this._container),this._resultsContainer=ve(vy.RESULTS_CONTAINER_SELECTOR,this._container),this._canvas.getContainer().appendChild(this._container),t.on(["canvas.destroy","diagram.destroy"],this.close,this)}function yy(e,t,n){var i=function(e){var t="";return e.forEach((function(e){e.matched?t+='<strong class="'+vy.RESULT_HIGHLIGHT_CLASS+'">'+Ls(e.matched)+"</strong>":t+=Ls(e.normal)})),""!==t?t:null}(t),r=he(n);r.innerHTML=i,e.appendChild(r)}vy.$inject=["canvas","eventBus","overlays","selection"],vy.prototype._bindEvents=function(){var e=this;function t(t,n,i,r){e._eventMaps.push({el:t,type:i,listener:de.bind(t,n,i,r)})}t(document,"html","click",(function(t){e.close()})),t(this._container,vy.INPUT_SELECTOR,"click",(function(e){e.stopPropagation(),e.delegateTarget.focus()})),t(this._container,vy.RESULT_SELECTOR,"mouseover",(function(t){t.stopPropagation(),e._scrollToNode(t.delegateTarget),e._preselect(t.delegateTarget)})),t(this._container,vy.RESULT_SELECTOR,"click",(function(t){t.stopPropagation(),e._select(t.delegateTarget)})),t(this._container,vy.INPUT_SELECTOR,"keydown",(function(e){38===e.keyCode&&e.preventDefault(),40===e.keyCode&&e.preventDefault()})),t(this._container,vy.INPUT_SELECTOR,"keyup",(function(t){if(27===t.keyCode)return e.close();if(13===t.keyCode){var n=e._getCurrentResult();return n?e._select(n):e.close()}return 38===t.keyCode?e._scrollToDirection(!0):40===t.keyCode?e._scrollToDirection():void(37!==t.keyCode&&39!==t.keyCode&&e._search(t.delegateTarget.value))}))},vy.prototype._unbindEvents=function(){this._eventMaps.forEach((function(e){de.unbind(e.el,e.type,e.listener)}))},vy.prototype._search=function(e){var t=this;if(this._clearResults(),e&&""!==e){var n=this._searchProvider.find(e);if(n.length){n.forEach((function(e){var n=e.element.id,i=t._createResultNode(e,n);t._results[n]={element:e.element,node:i}}));var i=ve(vy.RESULT_SELECTOR,this._resultsContainer);this._scrollToNode(i),this._preselect(i)}}},vy.prototype._scrollToDirection=function(e){var t=this._getCurrentResult();if(t){var n=e?t.previousElementSibling:t.nextElementSibling;n&&(this._scrollToNode(n),this._preselect(n))}},vy.prototype._scrollToNode=function(e){if(e&&e!==this._getCurrentResult()){var t=e.offsetTop,n=this._resultsContainer.scrollTop,i=t-this._resultsContainer.clientHeight+e.clientHeight;t<n?this._resultsContainer.scrollTop=t:n<i&&(this._resultsContainer.scrollTop=i)}},vy.prototype._clearResults=function(){te(this._resultsContainer),this._results=[],this._resetOverlay(),this._eventBus.fire("searchPad.cleared")},vy.prototype._getCurrentResult=function(){return ve(vy.RESULT_SELECTED_SELECTOR,this._resultsContainer)},vy.prototype._createResultNode=function(e,t){var n=he(vy.RESULT_HTML);return e.primaryTokens.length>0&&yy(n,e.primaryTokens,vy.RESULT_PRIMARY_HTML),yy(n,e.secondaryTokens,vy.RESULT_SECONDARY_HTML),K(n,vy.RESULT_ID_ATTRIBUTE,t),this._resultsContainer.appendChild(n),n},vy.prototype.registerProvider=function(e){this._searchProvider=e},vy.prototype.open=function(){if(!this._searchProvider)throw new Error("no search provider registered");this.isOpen()||(this._bindEvents(),this._open=!0,Q(this._container).add("open"),this._searchInput.focus(),this._eventBus.fire("searchPad.opened"))},vy.prototype.close=function(){this.isOpen()&&(this._unbindEvents(),this._open=!1,Q(this._container).remove("open"),this._clearResults(),this._searchInput.value="",this._searchInput.blur(),this._resetOverlay(),this._eventBus.fire("searchPad.closed"))},vy.prototype.toggle=function(){this.isOpen()?this.close():this.open()},vy.prototype.isOpen=function(){return this._open},vy.prototype._preselect=function(e){var t=this._getCurrentResult();if(e!==t){t&&Q(t).remove(vy.RESULT_SELECTED_CLASS);var n=K(e,vy.RESULT_ID_ATTRIBUTE),i=this._results[n].element;Q(e).add(vy.RESULT_SELECTED_CLASS),this._resetOverlay(i),this._canvas.scrollToElement(i,{top:400}),this._selection.select(i),this._eventBus.fire("searchPad.preselected",i)}},vy.prototype._select=function(e){var t=K(e,vy.RESULT_ID_ATTRIBUTE),n=this._results[t].element;this.close(),this._resetOverlay(),this._canvas.scrollToElement(n,{top:400}),this._selection.select(n),this._eventBus.fire("searchPad.selected",n)},vy.prototype._resetOverlay=function(e){if(this._overlayId&&this._overlays.remove(this._overlayId),e){var t=function(e){var t=6,n=e.width+2*t,i=e.height+2*t,r=["width: "+n+"px","height: "+i+"px"].join("; ");return{position:{bottom:i-t,right:n-t},show:!0,html:'<div style="'+r+'" class="'+vy.OVERLAY_CLASS+'"></div>'}}(ft(e));this._overlayId=this._overlays.add(e,t)}},vy.CONTAINER_SELECTOR=".djs-search-container",vy.INPUT_SELECTOR=".djs-search-input input",vy.RESULTS_CONTAINER_SELECTOR=".djs-search-results",vy.RESULT_SELECTOR=".djs-search-result",vy.RESULT_SELECTED_CLASS="djs-search-result-selected",vy.RESULT_SELECTED_SELECTOR="."+vy.RESULT_SELECTED_CLASS,vy.RESULT_ID_ATTRIBUTE="data-result-id",vy.RESULT_HIGHLIGHT_CLASS="djs-search-highlight",vy.OVERLAY_CLASS="djs-search-overlay",vy.BOX_HTML='<div class="djs-search-container djs-draggable djs-scrollable"><div class="djs-search-input"><input type="text"/></div><div class="djs-search-results"></div></div>',vy.RESULT_HTML='<div class="djs-search-result"></div>',vy.RESULT_PRIMARY_HTML='<div class="djs-search-result-primary"></div>',vy.RESULT_SECONDARY_HTML='<p class="djs-search-result-secondary"></p>';var gy={__depends__:[Qo,Ho],searchPad:["type",vy]};function by(e,t,n){this._elementRegistry=e,this._canvas=n,t.registerProvider(this)}function xy(e){return w(e,(function(e){return!!e.matched})).length>0}function Ey(e,t){var n=[],i=e;if(!e)return n;e=e.toLowerCase(),t=t.toLowerCase();var r=e.indexOf(t);return r>-1?(0!==r&&n.push({normal:i.substr(0,r)}),n.push({matched:i.substr(r,t.length)}),t.length+r<e.length&&n.push({normal:i.substr(t.length+r,e.length)})):n.push({normal:i}),n}by.$inject=["elementRegistry","searchPad","canvas"],by.prototype.find=function(e){var t=this._canvas.getRootElement(),n=this._elementRegistry.filter((function(e){return!e.labelTarget}));return n=w(n,(function(e){return e!==t})),n=B(n=w(n=T(n,(function(t){return{primaryTokens:Ey(Hr(t),e),secondaryTokens:Ey(t.id,e),element:t}})),(function(e){return xy(e.primaryTokens)||xy(e.secondaryTokens)})),(function(e){return Hr(e.element)+e.element.id}))};var wy={__depends__:[gy],__init__:["bpmnSearch"],bpmnSearch:["type",by]};function _y(e){Mr.call(this,e)}i(_y,Mr),_y.Viewer=ea,_y.NavigatedViewer=Ra,_y.prototype.createDiagram=_r((function(){return this.importXML('<?xml version="1.0" encoding="UTF-8"?><bpmn:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" targetNamespace="http://bpmn.io/schema/bpmn" id="Definitions_1"><bpmn:process id="Process_1" isExecutable="false"><bpmn:startEvent id="StartEvent_1"/></bpmn:process><bpmndi:BPMNDiagram id="BPMNDiagram_1"><bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process_1"><bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1"><dc:Bounds height="36.0" width="36.0" x="173.0" y="102.0"/></bpmndi:BPMNShape></bpmndi:BPMNPlane></bpmndi:BPMNDiagram></bpmn:definitions>')})),_y.prototype._interactionModules=[fa,_a,La,Aa],_y.prototype._modelingModules=[Ua,os,_s,hs,yc,_c,Sc,au,yp,Yc,lu,yu,ku,Mu,Bu,qu,ul,gv,Cv,Kv,Yv,nl,fy,wy],_y.prototype._modules=[].concat(ea.prototype._modules,_y.prototype._interactionModules,_y.prototype._modelingModules);var Py={min:.2,max:4};function Sy(e,t,n,i,r){var o=this;function a(e){o._state._svgClientRect&&!Ry(o._state._svgClientRect)||(o._state._svgClientRect=o._svg.getBoundingClientRect()),Cy(Oy({x:e.clientX-o._state._svgClientRect.left,y:e.clientY-o._state._svgClientRect.top},o._svg,o._lastViewbox),o._canvas),o._update()}function s(e){return function(t){o._state._svgClientRect&&!Ry(o._state._svgClientRect)||(o._state._svgClientRect=o._svg.getBoundingClientRect()),e&&a(t);var n=Oy({x:t.clientX-o._state._svgClientRect.left,y:t.clientY-o._state._svgClientRect.top},o._svg,o._lastViewbox),r=i.viewbox(),s=function(e,t){var n={x:t.x+t.width/2,y:t.y+t.height/2};return{x:e.x-n.x,y:e.y-n.y}}(n,r),u=o._viewportDom.getBoundingClientRect(),l={x:t.clientX-u.left+1,y:t.clientY-u.top+1};U(o._state,{cachedViewbox:r,initialDragPosition:{x:t.clientX,y:t.clientY},isDragging:!0,offsetViewport:s,offsetViewportDom:l,viewportClientRect:o._viewport.getBoundingClientRect(),parentClientRect:o._parent.getBoundingClientRect()}),pe.bind(document,"mousemove",c),pe.bind(document,"mouseup",p)}}function c(e){if(o._state.isDragging){o._state._svgClientRect&&!Ry(o._state._svgClientRect)||(o._state._svgClientRect=o._svg.getBoundingClientRect());var t=o._state.offsetViewportDom,n=o._state.viewportClientRect,i=o._state.parentClientRect;U(o._viewportDom.style,{top:e.clientY-t.y-i.top+"px",left:e.clientX-t.x-i.left+"px"});var r=jy(i,{top:e.clientY-t.y-i.top,left:e.clientX-t.x-i.left,width:n.width,height:n.height});U(o._overlay.style,{clipPath:r});var a=Oy({x:e.clientX-o._state._svgClientRect.left,y:e.clientY-o._state._svgClientRect.top},o._svg,o._lastViewbox);Cy({x:a.x-o._state.offsetViewport.x,y:a.y-o._state.offsetViewport.y},o._canvas)}}function p(e){o._state.isDragging&&(o._state.initialDragPosition.x===e.clientX&&o._state.initialDragPosition.y===e.clientY&&a(e),o._update(),U(o._state,{cachedViewbox:null,initialDragPosition:null,isDragging:!1,offsetViewport:null,offsetViewportDom:null}),pe.unbind(document,"mousemove",c),pe.unbind(document,"mouseup",p))}this._canvas=i,this._elementRegistry=r,this._eventBus=n,this._injector=t,this._state={isOpen:void 0,isDragging:!1,initialDragPosition:null,offsetViewport:null,cachedViewbox:null,dragger:null,svgClientRect:null,parentClientRect:null,zoomDelta:0},this._init(),this.toggle(e&&e.open||!1),pe.bind(this._svg,"click",(function(e){e.preventDefault(),e.stopPropagation(),a(e)})),pe.bind(this._viewportDom,"mousedown",s(!1)),pe.bind(this._svg,"mousedown",s(!0)),pe.bind(this._parent,"wheel",(function(e){if(e.preventDefault(),e.stopPropagation(),e.ctrlKey&&(o._state._svgClientRect&&!Ry(o._state._svgClientRect)||(o._state._svgClientRect=o._svg.getBoundingClientRect()),t=e,n=o._state._svgClientRect,t.x>n.left&&t.x<n.left+n.width&&t.y>n.top&&t.y<n.top+n.height)){var t,n,r=0===e.deltaMode?.02:.32,a=Math.sqrt(Math.pow(e.deltaY,2)+Math.pow(e.deltaX,2))*ky(e.deltaY)*-r;if(o._state.zoomDelta+=a,Math.abs(o._state.zoomDelta)>.1){var s=a>0?1:-1,c=Math.log(i.zoom())/Math.log(10),p=function(e,t){var n=Math.log(e.min)/Math.log(10),i=Math.log(e.max)/Math.log(10);return(Math.abs(n)+Math.abs(i))/t}(Py,20),u=Math.round(c/p)*p;u+=p*s;var l=Math.pow(10,u);i.zoom(function(e,t){return Math.max(e.min,Math.min(e.max,t))}(Py,l),d),o._state.zoomDelta=0;var d=Oy({x:e.clientX-o._state._svgClientRect.left,y:e.clientY-o._state._svgClientRect.top},o._svg,o._lastViewbox);Cy(d,o._canvas),o._update()}}})),pe.bind(this._toggle,"click",(function(e){e.preventDefault(),e.stopPropagation(),o.toggle()})),n.on(["shape.added","connection.added"],(function(e){var t=e.element;o._addElement(t),o._update()})),n.on(["shape.removed","connection.removed"],(function(e){var t=e.element;o._removeElement(t),o._update()})),n.on("elements.changed",250,(function(e){e.elements.forEach((function(e){o._updateElement(e)})),o._update()})),n.on("element.updateId",(function(e){var t=e.element,n=e.newId;o._updateElementId(t,n)})),n.on("canvas.viewbox.changed",(function(){o._state.isDragging||o._update()})),n.on("canvas.resized",(function(){document.body.contains(o._parent)&&(o._state.isDragging||o._update(),o._state._svgClientRect=o._svg.getBoundingClientRect())}))}function Oy(e,t,n){var i=t.getBoundingClientRect(),r=function(e,t){var n=e.width/e.height,i=U({},{x:e.x,y:e.y,width:e.width,height:e.height});if(n>t){var r=i.width*(1/t);U(i,{y:i.y-(r-i.height)/2,height:r})}else if(n<t){var o=i.height*t;U(i,{x:i.x-(o-i.width)/2,width:o})}return i}(n,i.width/i.height);return{x:Ty(e.x,0,i.width,r.x,r.x+r.width),y:Ty(e.y,0,i.height,r.y,r.y+r.height)}}function Cy(e,t){var n=t.viewbox(),i=n.width,r=n.height;t.viewbox({x:e.x-i/2,y:e.y-r/2,width:i,height:r})}function Ty(e,t,n,i,r){return(e-t)*(r-i)/(n-t)+i}function Ay(e,t,n){var i=[].slice.call(t.childNodes)[n];t.insertBefore(e,i.nextSibling)}function Ry(e){return 0===e.width&&0===e.height}Sy.$inject=["config.minimap","injector","eventBus","canvas","elementRegistry"],Sy.prototype._init=function(){var e=this._canvas.getContainer(),t=this._parent=document.createElement("div");Q(t).add("djs-minimap"),e.appendChild(t);var n=this._toggle=document.createElement("div");Q(n).add("toggle"),t.appendChild(n);var i=this._map=document.createElement("div");Q(i).add("map"),t.appendChild(i);var r=this._svg=Ne("svg");Pe(r,{width:"100%",height:"100%"}),Ee(i,r),Ee(r,this._elementsGroup=Ne("g"));var o=this._viewportGroup=Ne("g");Ee(r,o);var a=this._viewport=Ne("rect");Ae(a).add("viewport"),Ee(o,a),pe.bind(t,"mousedown",(function(e){e.stopPropagation()}));var s=this._viewportDom=document.createElement("div");Q(s).add("viewport-dom"),this._parent.appendChild(s);var c=this._overlay=document.createElement("div");Q(c).add("overlay"),this._parent.appendChild(c)},Sy.prototype._update=function(){var e=this._canvas.viewbox(),t=e.inner,n=e.outer;if(Dy(e)){var i,r,o,a,s=n.width-t.width,c=n.height-t.height;t.width<n.width?(i=t.x-s/2,o=n.width,t.x+t.width<n.width&&(i=Math.min(0,t.x))):(i=t.x,o=t.width),t.height<n.height?(r=t.y-c/2,a=n.height,t.y+t.height<n.height&&(r=Math.min(0,t.y))):(r=t.y,a=t.height),i-=50,r-=50,o+=100,a+=100,this._lastViewbox={x:i,y:r,width:o,height:a},Pe(this._svg,{viewBox:i+", "+r+", "+o+", "+a}),Pe(this._viewport,{x:e.x,y:e.y,width:e.width,height:e.height});var p=this._state._parentClientRect=this._parent.getBoundingClientRect(),u=this._viewport.getBoundingClientRect(),l={top:u.top-p.top,left:u.left-p.left,width:u.width,height:u.height};U(this._viewportDom.style,{top:l.top+"px",left:l.left+"px",width:l.width+"px",height:l.height+"px"});var d=jy(p,l);U(this._overlay.style,{clipPath:d})}},Sy.prototype.open=function(){U(this._state,{isOpen:!0}),Q(this._parent).add("open");var e=this._injector.get("translate",!1)||function(e){return e};K(this._toggle,"title",e("Close minimap")),this._update(),this._eventBus.fire("minimap.toggle",{open:!0})},Sy.prototype.close=function(){U(this._state,{isOpen:!1}),Q(this._parent).remove("open");var e=this._injector.get("translate",!1)||function(e){return e};K(this._toggle,"title",e("Open minimap")),this._eventBus.fire("minimap.toggle",{open:!1})},Sy.prototype.toggle=function(e){var t=this.isOpen();void 0===e&&(e=!t),e!=t&&(e?this.open():this.close())},Sy.prototype.isOpen=function(){return this._state.isOpen},Sy.prototype._updateElement=function(e){try{void 0!==e.parent&&null!==e.parent&&(this._removeElement(e),this._addElement(e))}catch(e){console.warn("Minimap#_updateElement errored",e)}},Sy.prototype._updateElementId=function(e,t){try{var n=ve("#"+Is(e.id),this._elementsGroup);n&&(n.id=t)}catch(e){console.warn("Minimap#_updateElementId errored",e)}},Sy.prototype._addElement=function(e){var t,n,i,r=this;this._removeElement(e);var o=this._createElement(e),a=ve("#"+Is(e.parent.id),this._elementsGroup);if(o){var s=function(e,t){var n=ve(".djs-children",t.parentNode);if(!n)return;var i=[].slice.call(n.childNodes),r=-1;return i.forEach((function(t,n){ve(".djs-element",t)===e&&(r=n)})),r}(this._elementRegistry.getGraphics(e),this._elementRegistry.getGraphics(e.parent));return"undefined"!==s&&a?a.childNodes.length>s?Ay(o,a,s):Ay(o,a,a.childNodes.length-1):this._elementsGroup.appendChild(o),!function(e){return e.waypoints}(e)?(n=e.x,i=e.y,a&&(n-=(t=e.parent).x,i-=t.y),Pe(o,{transform:"translate("+n+" "+i+")"})):(n=0,i=0,void 0!==(t=e.parent).x&&void 0!==t.y&&(n=-t.x,i=-t.y),Pe(o,{transform:"translate("+n+" "+i+")"})),e.children&&e.children.length&&e.children.forEach((function(e){r._addElement(e)})),o}},Sy.prototype._removeElement=function(e){var t=this._svg.getElementById(e.id);t&&ke(t)},Sy.prototype._createElement=function(e){var t,n=this._elementRegistry.getGraphics(e);if(n&&(t=Kn(n))){var i=Me(t);return Pe(i,{id:e.id}),i}};var ky=Math.sign||function(e){return e>=0?1:-1};function jy(e,t){return"polygon("+[My(t.left,t.top),My(t.left+t.width,t.top),My(t.left+t.width,t.top+t.height),My(t.left,t.top+t.height),My(t.left,e.height),My(e.width,e.height),My(e.width,0),My(0,0),My(0,e.height),My(t.left,e.height)].join(", ")+")"}function My(e,t){return e+"px "+t+"px"}function Dy(e){return O(e,(function(e){return m(e)?Dy(e):f(e)&&isFinite(e)}))}var By={__init__:["minimap"],minimap:["type",Sy]};function Iy(e,t){var n,i,r=(e=e||{}).borderColor||"rgba(0,0,0,0.1)",o=e.crossColor||"#CCC",a=-1;Ee(t.getLayer("djs-origin",-1),n=Fy("g",{"pointer-events":"none"})),!1!==e.showBorder&&Ee(n,Fy("path",{class:Ly("border"),d:Ny(["M",-22,a,"H",-1e3,"M",22,a,"H",6e3,"M",a,-22,"V",-1e3,"M",a,22,"V",3e3]),fill:"none",stroke:r,"stroke-width":"2px","stroke-dasharray":"6, 6","shape-rendering":"crispedges"})),Ee(n,Fy("path",{d:Ny(["M",-15,a,"H",15,"M",a,-15,"V",15]),class:Ly("cross"),fill:"none",stroke:o,"stroke-width":"2px","stroke-linecap":"round"})),(i=Fy("text",{x:-40,y:-10,fill:o,class:Ly("label")})).textContent="(0, 0)",Ee(n,i)}function Ny(e){return e.join(" ")}function Ly(e){return"djs-origin-"+e}function Fy(e,t){var n=Ne(e);return Pe(n,t),n}Iy.$inject=["config.origin","canvas"];var Vy={__init__:[Iy]},$y={offset:{x:150,y:75},tolerance:50,alignOnSave:!0};function zy(e,t,n,i,r,o){function a(e,n){var i=n.offset,r=n.tolerance,o={};return["x","y"].forEach((function(n){var a=-e[n]+i[n],s=t.get("gridSnapping",!1);s&&(a=function(e,t,n){n||(n="round");return Math[n](e/t)*t}(a,s.getGridSpacing())),o[n]=Math.abs(a)<r?0:a})),o}function s(){var t=r.viewbox().inner,n=r.getRootElement().children;if(n.length){var o=a(t,e);0===o.x&&0===o.y||i.execute("elements.alignToOrigin",{elements:n,delta:o})}}function c(e){return function(t){n.once("commandStack.changed",(function(){var n=t.delta,i=r.viewbox().scale;r.scroll({dx:e*n.x*i,dy:e*n.y*i})}))}}e=function(e){var t=U({},$y,e||{});return f(t.offset)&&(t.offset={x:t.offset,y:t.offset}),t}(e),i.register("elements.alignToOrigin",{preExecute:function(e){var t=e.delta,n=e.elements;o.moveElements(n,t)},execute:c(-1),revert:c(1)}),e.alignOnSave&&function(){var e=t.get("_parent",!1),i=n,r=e&&e._eventBus;(r||i).on("saveXML.start",1250,s),r&&i.on("diagram.destroy",(function(){r.off("saveXML.start",s)}))}(),this.align=s,this.computeAdjustment=a,this._config=e}zy.$inject=["config.alignToOrigin","injector","eventBus","commandStack","canvas","modeling"];var qy={__init__:["alignToOrigin"],alignToOrigin:["type",zy]};function Uy(e){function t(e){if(!e.labelTarget){var t=Br(e);Dr(t,"bpmn:Participant")&&(t=t.processRef),Dr(t,"bpmn:Process")&&(t.isExecutable=!!t.isExecutable)}}e.on(["shape.added","root.added"],(function(e){t(e.element)})),e.on("elements.changed",(function(e){e.elements.forEach((function(e){t(e)}))}))}Uy.$inject=["eventBus"];var Gy={__init__:[Uy]};class Hy{constructor(e,t,n,i,r,o){this._eventBus=e,this._bpmnImporter=t,this._bpmnjs=n,this._canvas=i,this._modeling=r,this._translate=o}execute(e){var t=this,n=this._eventBus,i=e.subProcess,r=e.subProcessDiagram,o=[],a=new Er({element:function(n,i){e.cached||(e.cached={});var r=e.cached[n.id];if(r)return r.label&&t._canvas.addShape(r.label,i),r.waypoints?t._canvas.addConnection(r,i):t._canvas.addShape(r,i);var o=t._bpmnImporter.add(n,i);return e.cached[o.id]=o,o},error:function(e,t){o.push({message:e,context:t})}},this._translate);r.plane.planeElement.forEach((function(e){a.registerDi(e)})),Wy(r,this.findDiagram(this._canvas.getRootElement().id));var s,c=Br(i);n.fire("signavio.import.render.start",{subProcess:c});try{a.handleSubProcess(c,i),a.handleDeferred()}catch(e){s=e}n.fire("signavio.import.render.complete",{error:s,subProcess:c,warnings:o}),n.fire("signavio.import.done",{error:s,subProcess:c,warnings:o})}postExecute(e){var t=e.subProcess,n=Yp(t.children.filter((function(e){return!e.hidden}))),i=n.x+n.width/2,r=n.y+n.height/2,o={x:t.x+t.width/2-i,y:t.y+t.height/2-r};this._modeling.moveElements(t.children,o,t)}revert(e){var t=this;var n=e.subProcess,i=e.subProcessDiagram,r=this.findDiagram(this._canvas.getRootElement().id),o=r.plane.planeElement.filter((function(e){return function(e,t){for(;e.bpmnElement&&e.bpmnElement.$parent;){if(e.bpmnElement.$parent.id===t)return!0;e=e.bpmnElement.$parent}return!1}(e,n.id)}));o.forEach((function(e){delete e.bpmnElement.di})),Wy(r,i,o),n.children&&n.children.length&&Jh(n.children,(function(e){!function(e){e.waypoints?t._canvas.removeConnection(e):t._canvas.removeShape(e)}(e)}))}findDiagram(e){return x(this._bpmnjs.getDefinitions().diagrams,(function(t){return t.plane.bpmnElement.id===e}))}}function Wy(e,t,n){n=n||e.plane.planeElement;var i=t.plane.planeElement;n.forEach((function(e){wt(i,e)})),n.slice().forEach((function(n){Et(e.plane.planeElement,n),n.$parent=t.plane}))}Hy.$inject=["eventBus","bpmnImporter","bpmnjs","canvas","modeling","translate"];class Ky{constructor(e,t,n,i,r){this._bpmnFactory=e,this._bpmnImporter=t,this._bpmnjs=n,this._canvas=i,this._translate=r}execute(e){var t=this;function n(e){e.children&&e.children.length&&e.children.slice().forEach(n),e.waypoints?t._canvas.removeConnection(e):t._canvas.removeShape(e)}var i=e.subProcess,r=e.subProcessDiagram;this.findDiagram(i.id)||(r||(r=this._bpmnFactory.create("bpmndi:BPMNDiagram",{plane:this._bpmnFactory.createDiPlane(Br(i))}),e.created=!0,e.subProcessDiagram=r),wt(this._bpmnjs.getDefinitions().diagrams,r));var o=this.findDiagram(this._canvas.getRootElement().id),a=o.plane.planeElement.filter((function(e){return function(e,t){for(;e.bpmnElement&&e.bpmnElement.$parent;){if(e.bpmnElement.$parent.id===t)return!0;e=e.bpmnElement.$parent}return!1}(e,i.id)}));a.forEach((function(e){delete e.bpmnElement.di})),Xy(o,r,a),i.children&&i.children.length&&Jh(i.children,(function(e){n(e)}))}revert(e){var t=this,n=e.subProcess,i=e.subProcessDiagram,r=e.created,o=[],a=new Er({element:function(e,n){return t._bpmnImporter.add(e,n)},error:function(e,t){o.push({message:e,context:t})}},this._translate);(i.plane.planeElement.forEach((function(e){a.registerDi(e)})),Xy(i,this.findDiagram(this._canvas.getRootElement().id)),r)&&Et(this._bpmnjs.getDefinitions().diagrams,i);try{a.handleSubProcess(Br(n),n),a.handleDeferred()}catch(e){console.error(e)}o.length&&console.warn(o)}findDiagram(e){return x(this._bpmnjs.getDefinitions().diagrams,(function(t){return t.plane.bpmnElement.id===e}))}}function Xy(e,t,n){n=n||e.plane.planeElement;var i=t.plane.get("planeElement");n.forEach((function(e){wt(i,e)})),n.slice().forEach((function(n){Et(e.plane.planeElement,n),n.$parent=t.plane}))}Ky.$inject=["bpmnFactory","bpmnImporter","bpmnjs","canvas","translate"];class Yy extends as{constructor(e,t,n,i,r,o,a){super(r),this._bpmnjs=e,i.registerHandler("signavioCompat.importSubProcess",Hy),i.registerHandler("signavioCompat.deleteSubProcess",Ky),this.postExecuted(["shape.toggleCollapse"],2e3,(t=>{if(!x(e.getDefinitions().$attrs,(function(e){return"http://www.signavio.com"===e})))return;const n=t.context.shape;var r;if(Dr(n,"bpmn:SubProcess"))if(n.collapsed)r={subProcess:n,subProcessDiagram:this.findDiagram(n.id)},i.execute("signavioCompat.deleteSubProcess",r);else{const e=this.findDiagram(n.id);if(!e)return;r={subProcess:n,subProcessDiagram:e},i.execute("signavioCompat.importSubProcess",r)}}))}findDiagram(e){return x(this._bpmnjs.getDefinitions().diagrams,(function(t){return t.plane.bpmnElement.id===e}))}}Yy.$inject=["bpmnjs","bpmnImporter","canvas","commandStack","eventBus","modeling","translate"];var Jy={__init__:["signavioBehavior"],signavioBehavior:["type",Yy]},Zy="replace-with-collapsed-subprocess",Qy="replace-with-expanded-subprocess";function eg(e,t,n){e.registerProvider("bpmn-replace",this),this._bpmnReplace=t,this._translate=n}function tg(e){return Dr(e,"bpmn:SubProcess")&&!Dr(e,"bpmn:Transaction")&&!Fr(e)}eg.$inject=["popupMenu","bpmnReplace","translate"],eg.prototype.getPopupMenuEntries=function(e){var t=this._bpmnReplace,n=this._translate,i={"expand-subprocess":{className:"bpmn-icon-subprocess-expanded",label:n("Expand (not reversible)"),action:function(){t.replaceElement(e,{type:"bpmn:SubProcess",isExpanded:!0})}}};return function(r){return function(e){return Dr(e,"bpmn:Task")}(e)?(delete r[Qy],delete r[Zy],r["replace-with-subprocess"]={className:"bpmn-icon-subprocess-collapsed",label:n("Sub Process"),action:function(){t.replaceElement(e,{type:"bpmn:SubProcess",isExpanded:!1})}},r):tg(e)&&Nr(e)?(delete r[Zy],r):tg(e)&&!Nr(e)?function(e){return e.children&&e.children.length}(e)?i:(delete r[Zy],delete r[Qy],U(r,i)):r}};var ng={__depends__:["popupMenu","bpmnReplace"],__init__:["disabledCollapsedSubprocessPopupProvider"],disabledCollapsedSubprocessPopupProvider:["type",eg]};var ig=function(e,t){for(var n=-1,i=null==e?0:e.length;++n<i&&!1!==t(e[n],n,e););return e};var rg=function(e){return function(t,n,i){for(var r=-1,o=Object(t),a=i(t),s=a.length;s--;){var c=a[e?s:++r];if(!1===n(o[c],c,o))break}return t}}();var og=function(e,t){for(var n=-1,i=Array(e);++n<e;)i[n]=t(n);return i},ag="object"==typeof e&&e&&e.Object===Object&&e,sg="object"==typeof self&&self&&self.Object===Object&&self,cg=ag||sg||Function("return this")(),pg=cg.Symbol,ug=Object.prototype,lg=ug.hasOwnProperty,dg=ug.toString,hg=pg?pg.toStringTag:void 0;var mg=function(e){var t=lg.call(e,hg),n=e[hg];try{e[hg]=void 0;var i=!0}catch(e){}var r=dg.call(e);return i&&(t?e[hg]=n:delete e[hg]),r},fg=Object.prototype.toString;var vg=function(e){return fg.call(e)},yg=pg?pg.toStringTag:void 0;var gg=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":yg&&yg in Object(e)?mg(e):vg(e)};var bg=function(e){return null!=e&&"object"==typeof e};var xg=function(e){return bg(e)&&"[object Arguments]"==gg(e)},Eg=Object.prototype,wg=Eg.hasOwnProperty,_g=Eg.propertyIsEnumerable,Pg=xg(function(){return arguments}())?xg:function(e){return bg(e)&&wg.call(e,"callee")&&!_g.call(e,"callee")},Sg=Array.isArray;var Og=function(){return!1},Cg=n((function(e,t){var n=t&&!t.nodeType&&t,i=n&&e&&!e.nodeType&&e,r=i&&i.exports===n?cg.Buffer:void 0,o=(r?r.isBuffer:void 0)||Og;e.exports=o})),Tg=/^(?:0|[1-9]\d*)$/;var Ag=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&Tg.test(e))&&e>-1&&e%1==0&&e<t};var Rg=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},kg={};kg["[object Float32Array]"]=kg["[object Float64Array]"]=kg["[object Int8Array]"]=kg["[object Int16Array]"]=kg["[object Int32Array]"]=kg["[object Uint8Array]"]=kg["[object Uint8ClampedArray]"]=kg["[object Uint16Array]"]=kg["[object Uint32Array]"]=!0,kg["[object Arguments]"]=kg["[object Array]"]=kg["[object ArrayBuffer]"]=kg["[object Boolean]"]=kg["[object DataView]"]=kg["[object Date]"]=kg["[object Error]"]=kg["[object Function]"]=kg["[object Map]"]=kg["[object Number]"]=kg["[object Object]"]=kg["[object RegExp]"]=kg["[object Set]"]=kg["[object String]"]=kg["[object WeakMap]"]=!1;var jg=function(e){return bg(e)&&Rg(e.length)&&!!kg[gg(e)]};var Mg=function(e){return function(t){return e(t)}},Dg=n((function(e,t){var n=t&&!t.nodeType&&t,i=n&&e&&!e.nodeType&&e,r=i&&i.exports===n&&ag.process,o=function(){try{var e=i&&i.require&&i.require("util").types;return e||r&&r.binding&&r.binding("util")}catch(e){}}();e.exports=o})),Bg=Dg&&Dg.isTypedArray,Ig=Bg?Mg(Bg):jg,Ng=Object.prototype.hasOwnProperty;var Lg=function(e,t){var n=Sg(e),i=!n&&Pg(e),r=!n&&!i&&Cg(e),o=!n&&!i&&!r&&Ig(e),a=n||i||r||o,s=a?og(e.length,String):[],c=s.length;for(var p in e)!t&&!Ng.call(e,p)||a&&("length"==p||r&&("offset"==p||"parent"==p)||o&&("buffer"==p||"byteLength"==p||"byteOffset"==p)||Ag(p,c))||s.push(p);return s},Fg=Object.prototype;var Vg=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Fg)};var $g=function(e,t){return function(n){return e(t(n))}},zg=$g(Object.keys,Object),qg=Object.prototype.hasOwnProperty;var Ug=function(e){if(!Vg(e))return zg(e);var t=[];for(var n in Object(e))qg.call(e,n)&&"constructor"!=n&&t.push(n);return t};var Gg=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)};var Hg=function(e){if(!Gg(e))return!1;var t=gg(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t};var Wg=function(e){return null!=e&&Rg(e.length)&&!Hg(e)};var Kg=function(e){return Wg(e)?Lg(e):Ug(e)};var Xg=function(e,t){return e&&rg(e,t,Kg)};var Yg=function(e,t){return function(n,i){if(null==n)return n;if(!Wg(n))return e(n,i);for(var r=n.length,o=t?r:-1,a=Object(n);(t?o--:++o<r)&&!1!==i(a[o],o,a););return n}}(Xg);var Jg=function(e){return e};var Zg=function(e){return"function"==typeof e?e:Jg};var Qg=function(e,t){return(Sg(e)?ig:Yg)(e,Zg(t))},eb=Object.create,tb=function(){function e(){}return function(t){if(!Gg(t))return{};if(eb)return eb(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();var nb=function(){this.__data__=[],this.size=0};var ib=function(e,t){return e===t||e!=e&&t!=t};var rb=function(e,t){for(var n=e.length;n--;)if(ib(e[n][0],t))return n;return-1},ob=Array.prototype.splice;var ab=function(e){var t=this.__data__,n=rb(t,e);return!(n<0)&&(n==t.length-1?t.pop():ob.call(t,n,1),--this.size,!0)};var sb=function(e){var t=this.__data__,n=rb(t,e);return n<0?void 0:t[n][1]};var cb=function(e){return rb(this.__data__,e)>-1};var pb=function(e,t){var n=this.__data__,i=rb(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this};function ub(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}ub.prototype.clear=nb,ub.prototype.delete=ab,ub.prototype.get=sb,ub.prototype.has=cb,ub.prototype.set=pb;var lb=ub;var db=function(){this.__data__=new lb,this.size=0};var hb=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n};var mb=function(e){return this.__data__.get(e)};var fb,vb=function(e){return this.__data__.has(e)},yb=cg["__core-js_shared__"],gb=(fb=/[^.]+$/.exec(yb&&yb.keys&&yb.keys.IE_PROTO||""))?"Symbol(src)_1."+fb:"";var bb=function(e){return!!gb&&gb in e},xb=Function.prototype.toString;var Eb=function(e){if(null!=e){try{return xb.call(e)}catch(e){}try{return e+""}catch(e){}}return""},wb=/^\[object .+?Constructor\]$/,_b=Function.prototype,Pb=Object.prototype,Sb=_b.toString,Ob=Pb.hasOwnProperty,Cb=RegExp("^"+Sb.call(Ob).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var Tb=function(e){return!(!Gg(e)||bb(e))&&(Hg(e)?Cb:wb).test(Eb(e))};var Ab=function(e,t){return null==e?void 0:e[t]};var Rb=function(e,t){var n=Ab(e,t);return Tb(n)?n:void 0},kb=Rb(cg,"Map"),jb=Rb(Object,"create");var Mb=function(){this.__data__=jb?jb(null):{},this.size=0};var Db=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Bb=Object.prototype.hasOwnProperty;var Ib=function(e){var t=this.__data__;if(jb){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return Bb.call(t,e)?t[e]:void 0},Nb=Object.prototype.hasOwnProperty;var Lb=function(e){var t=this.__data__;return jb?void 0!==t[e]:Nb.call(t,e)};var Fb=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=jb&&void 0===t?"__lodash_hash_undefined__":t,this};function Vb(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}Vb.prototype.clear=Mb,Vb.prototype.delete=Db,Vb.prototype.get=Ib,Vb.prototype.has=Lb,Vb.prototype.set=Fb;var $b=Vb;var zb=function(){this.size=0,this.__data__={hash:new $b,map:new(kb||lb),string:new $b}};var qb=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};var Ub=function(e,t){var n=e.__data__;return qb(t)?n["string"==typeof t?"string":"hash"]:n.map};var Gb=function(e){var t=Ub(this,e).delete(e);return this.size-=t?1:0,t};var Hb=function(e){return Ub(this,e).get(e)};var Wb=function(e){return Ub(this,e).has(e)};var Kb=function(e,t){var n=Ub(this,e),i=n.size;return n.set(e,t),this.size+=n.size==i?0:1,this};function Xb(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}Xb.prototype.clear=zb,Xb.prototype.delete=Gb,Xb.prototype.get=Hb,Xb.prototype.has=Wb,Xb.prototype.set=Kb;var Yb=Xb;var Jb=function(e,t){var n=this.__data__;if(n instanceof lb){var i=n.__data__;if(!kb||i.length<199)return i.push([e,t]),this.size=++n.size,this;n=this.__data__=new Yb(i)}return n.set(e,t),this.size=n.size,this};function Zb(e){var t=this.__data__=new lb(e);this.size=t.size}Zb.prototype.clear=db,Zb.prototype.delete=hb,Zb.prototype.get=mb,Zb.prototype.has=vb,Zb.prototype.set=Jb;var Qb=Zb;var ex=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this};var tx=function(e){return this.__data__.has(e)};function nx(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Yb;++t<n;)this.add(e[t])}nx.prototype.add=nx.prototype.push=ex,nx.prototype.has=tx;var ix=nx;var rx=function(e,t){for(var n=-1,i=null==e?0:e.length;++n<i;)if(t(e[n],n,e))return!0;return!1};var ox=function(e,t){return e.has(t)};var ax=function(e,t,n,i,r,o){var a=1&n,s=e.length,c=t.length;if(s!=c&&!(a&&c>s))return!1;var p=o.get(e),u=o.get(t);if(p&&u)return p==t&&u==e;var l=-1,d=!0,h=2&n?new ix:void 0;for(o.set(e,t),o.set(t,e);++l<s;){var m=e[l],f=t[l];if(i)var v=a?i(f,m,l,t,e,o):i(m,f,l,e,t,o);if(void 0!==v){if(v)continue;d=!1;break}if(h){if(!rx(t,(function(e,t){if(!ox(h,t)&&(m===e||r(m,e,n,i,o)))return h.push(t)}))){d=!1;break}}else if(m!==f&&!r(m,f,n,i,o)){d=!1;break}}return o.delete(e),o.delete(t),d},sx=cg.Uint8Array;var cx=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,i){n[++t]=[i,e]})),n};var px=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n},ux=pg?pg.prototype:void 0,lx=ux?ux.valueOf:void 0;var dx=function(e,t,n,i,r,o,a){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!o(new sx(e),new sx(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return ib(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var s=cx;case"[object Set]":var c=1&i;if(s||(s=px),e.size!=t.size&&!c)return!1;var p=a.get(e);if(p)return p==t;i|=2,a.set(e,t);var u=ax(s(e),s(t),i,r,o,a);return a.delete(e),u;case"[object Symbol]":if(lx)return lx.call(e)==lx.call(t)}return!1};var hx=function(e,t){for(var n=-1,i=t.length,r=e.length;++n<i;)e[r+n]=t[n];return e};var mx=function(e,t,n){var i=t(e);return Sg(e)?i:hx(i,n(e))};var fx=function(e,t){for(var n=-1,i=null==e?0:e.length,r=0,o=[];++n<i;){var a=e[n];t(a,n,e)&&(o[r++]=a)}return o};var vx=function(){return[]},yx=Object.prototype.propertyIsEnumerable,gx=Object.getOwnPropertySymbols,bx=gx?function(e){return null==e?[]:(e=Object(e),fx(gx(e),(function(t){return yx.call(e,t)})))}:vx;var xx=function(e){return mx(e,Kg,bx)},Ex=Object.prototype.hasOwnProperty;var wx=function(e,t,n,i,r,o){var a=1&n,s=xx(e),c=s.length;if(c!=xx(t).length&&!a)return!1;for(var p=c;p--;){var u=s[p];if(!(a?u in t:Ex.call(t,u)))return!1}var l=o.get(e),d=o.get(t);if(l&&d)return l==t&&d==e;var h=!0;o.set(e,t),o.set(t,e);for(var m=a;++p<c;){var f=e[u=s[p]],v=t[u];if(i)var y=a?i(v,f,u,t,e,o):i(f,v,u,e,t,o);if(!(void 0===y?f===v||r(f,v,n,i,o):y)){h=!1;break}m||(m="constructor"==u)}if(h&&!m){var g=e.constructor,b=t.constructor;g==b||!("constructor"in e)||!("constructor"in t)||"function"==typeof g&&g instanceof g&&"function"==typeof b&&b instanceof b||(h=!1)}return o.delete(e),o.delete(t),h},_x=Rb(cg,"DataView"),Px=Rb(cg,"Promise"),Sx=Rb(cg,"Set"),Ox=Rb(cg,"WeakMap"),Cx="[object Map]",Tx="[object Promise]",Ax="[object Set]",Rx="[object WeakMap]",kx="[object DataView]",jx=Eb(_x),Mx=Eb(kb),Dx=Eb(Px),Bx=Eb(Sx),Ix=Eb(Ox),Nx=gg;(_x&&Nx(new _x(new ArrayBuffer(1)))!=kx||kb&&Nx(new kb)!=Cx||Px&&Nx(Px.resolve())!=Tx||Sx&&Nx(new Sx)!=Ax||Ox&&Nx(new Ox)!=Rx)&&(Nx=function(e){var t=gg(e),n="[object Object]"==t?e.constructor:void 0,i=n?Eb(n):"";if(i)switch(i){case jx:return kx;case Mx:return Cx;case Dx:return Tx;case Bx:return Ax;case Ix:return Rx}return t});var Lx=Nx,Fx="[object Arguments]",Vx="[object Array]",$x="[object Object]",zx=Object.prototype.hasOwnProperty;var qx=function(e,t,n,i,r,o){var a=Sg(e),s=Sg(t),c=a?Vx:Lx(e),p=s?Vx:Lx(t),u=(c=c==Fx?$x:c)==$x,l=(p=p==Fx?$x:p)==$x,d=c==p;if(d&&Cg(e)){if(!Cg(t))return!1;a=!0,u=!1}if(d&&!u)return o||(o=new Qb),a||Ig(e)?ax(e,t,n,i,r,o):dx(e,t,c,n,i,r,o);if(!(1&n)){var h=u&&zx.call(e,"__wrapped__"),m=l&&zx.call(t,"__wrapped__");if(h||m){var f=h?e.value():e,v=m?t.value():t;return o||(o=new Qb),r(f,v,n,i,o)}}return!!d&&(o||(o=new Qb),wx(e,t,n,i,r,o))};var Ux=function e(t,n,i,r,o){return t===n||(null==t||null==n||!bg(t)&&!bg(n)?t!=t&&n!=n:qx(t,n,i,r,e,o))};var Gx=function(e,t,n,i){var r=n.length,o=r,a=!i;if(null==e)return!o;for(e=Object(e);r--;){var s=n[r];if(a&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++r<o;){var c=(s=n[r])[0],p=e[c],u=s[1];if(a&&s[2]){if(void 0===p&&!(c in e))return!1}else{var l=new Qb;if(i)var d=i(p,u,c,e,t,l);if(!(void 0===d?Ux(u,p,3,i,l):d))return!1}}return!0};var Hx=function(e){return e==e&&!Gg(e)};var Wx=function(e){for(var t=Kg(e),n=t.length;n--;){var i=t[n],r=e[i];t[n]=[i,r,Hx(r)]}return t};var Kx=function(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in Object(n)))}};var Xx=function(e){var t=Wx(e);return 1==t.length&&t[0][2]?Kx(t[0][0],t[0][1]):function(n){return n===e||Gx(n,e,t)}};var Yx=function(e){return"symbol"==typeof e||bg(e)&&"[object Symbol]"==gg(e)},Jx=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Zx=/^\w*$/;var Qx=function(e,t){if(Sg(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!Yx(e))||(Zx.test(e)||!Jx.test(e)||null!=t&&e in Object(t))};function eE(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var i=arguments,r=t?t.apply(this,i):i[0],o=n.cache;if(o.has(r))return o.get(r);var a=e.apply(this,i);return n.cache=o.set(r,a)||o,a};return n.cache=new(eE.Cache||Yb),n}eE.Cache=Yb;var tE=eE;var nE=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,iE=/\\(\\)?/g,rE=function(e){var t=tE(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t}((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(nE,(function(e,n,i,r){t.push(i?r.replace(iE,"$1"):n||e)})),t}));var oE=function(e,t){for(var n=-1,i=null==e?0:e.length,r=Array(i);++n<i;)r[n]=t(e[n],n,e);return r},aE=pg?pg.prototype:void 0,sE=aE?aE.toString:void 0;var cE=function e(t){if("string"==typeof t)return t;if(Sg(t))return oE(t,e)+"";if(Yx(t))return sE?sE.call(t):"";var n=t+"";return"0"==n&&1/t==-Infinity?"-0":n};var pE=function(e){return null==e?"":cE(e)};var uE=function(e,t){return Sg(e)?e:Qx(e,t)?[e]:rE(pE(e))};var lE=function(e){if("string"==typeof e||Yx(e))return e;var t=e+"";return"0"==t&&1/e==-Infinity?"-0":t};var dE=function(e,t){for(var n=0,i=(t=uE(t,e)).length;null!=e&&n<i;)e=e[lE(t[n++])];return n&&n==i?e:void 0};var hE=function(e,t,n){var i=null==e?void 0:dE(e,t);return void 0===i?n:i};var mE=function(e,t){return null!=e&&t in Object(e)};var fE=function(e,t,n){for(var i=-1,r=(t=uE(t,e)).length,o=!1;++i<r;){var a=lE(t[i]);if(!(o=null!=e&&n(e,a)))break;e=e[a]}return o||++i!=r?o:!!(r=null==e?0:e.length)&&Rg(r)&&Ag(a,r)&&(Sg(e)||Pg(e))};var vE=function(e,t){return null!=e&&fE(e,t,mE)};var yE=function(e,t){return Qx(e)&&Hx(t)?Kx(lE(e),t):function(n){var i=hE(n,e);return void 0===i&&i===t?vE(n,e):Ux(t,i,3)}};var gE=function(e){return function(t){return null==t?void 0:t[e]}};var bE=function(e){return function(t){return dE(t,e)}};var xE=function(e){return Qx(e)?gE(lE(e)):bE(e)};var EE=function(e){return"function"==typeof e?e:null==e?Jg:"object"==typeof e?Sg(e)?yE(e[0],e[1]):Xx(e):xE(e)},wE=$g(Object.getPrototypeOf,Object);var _E=function(e,t,n){var i=Sg(e),r=i||Cg(e)||Ig(e);if(t=EE(t),null==n){var o=e&&e.constructor;n=r?i?new o:[]:Gg(e)&&Hg(o)?tb(wE(e)):{}}return(r?ig:Xg)(e,(function(e,i,r){return t(n,e,i,r)})),n},PE=t(Ir),SE=PE.is;function OE(e){this._elementRegistry=e}OE.$inject=["elementRegistry"];var CE=OE;function TE(e,t){Qg(t,(function(t,n){e.set(n,t)}))}OE.prototype.execute=function(e){var t=e.element,n=e.businessObject,i=function(e){for(var t=e;t.$parent;)t=t.$parent;return t}(n).rootElements,r=e.referenceType,o=e.referenceProperty,a=[t];if(!t)throw new Error("element required");if(!n)throw new Error("businessObject required");var s=e.properties,c=e.oldProperties||function(e,t){return _E(t,(function(t,n){return t[n]=e.get(n),t}),{})}(n,Kg(s));return void 0!==r&&void 0!==o&&Qg(i,(function(e){SE(e,r)&&e.id===s[o]&&(s[o]=e)})),TE(n,s),e.oldProperties=c,e.changed=a,a},OE.prototype.revert=function(e){var t=e.oldProperties;return TE(e.businessObject,t),e.changed};var AE={},RE=AE;function kE(e,t){this._elementRegistry=e,this._bpmnFactory=t}AE.createElement=function(e,t,n,i){var r=i.create(e,t);return r.$parent=n,r},kE.$inject=["elementRegistry","bpmnFactory"];var jE=kE;function ME(e,t){if(!e)throw new Error(t+" required");return e}function DE(e,t){this._elementRegistry=e,this._bpmnFactory=t}kE.prototype.execute=function(e){var t=ME(e.referencingObject,"referencingObject"),n=ME(e.referenceProperty,"referenceProperty"),i=ME(e.newObject,"newObject"),r=ME(e.newObjectContainer,"newObjectContainer"),o=ME(e.newObjectParent,"newObjectParent"),a=[e.element],s=RE.createElement(i.type,i.properties,o,this._bpmnFactory);return e.referencedObject=s,r.push(s),e.previousReference=t[n],t[n]=s,e.changed=a,a},kE.prototype.revert=function(e){var t=e.referencingObject,n=e.referenceProperty,i=e.previousReference,r=e.referencedObject,o=e.newObjectContainer;return t.set(n,i),o.splice(o.indexOf(r),1),e.changed},DE.$inject=["elementRegistry","bpmnFactory"];var BE=DE;function IE(e,t){if(!e)throw new Error(t+" required");return e}function NE(e,t){this._elementRegistry=e,this._bpmnFactory=t}DE.prototype.execute=function(e){var t=IE(e.currentObject,"currentObject"),n=IE(e.propertyName,"propertyName"),i=function(e,t){if(!e||"[object Array]"!==Object.prototype.toString.call(e))throw new Error(t+" needs to be a list");return e}(e.newObjects,"newObjects"),r=[e.element],o=[],a=this;return Qg(i,(function(e){var n=RE.createElement(e.type,e.properties,t,a._bpmnFactory);o.push(n)})),e.childObject=o,e.previousChilds=t[n],t[n]=o,e.changed=r,r},DE.prototype.revert=function(e){var t=e.currentObject,n=e.propertyName,i=e.previousChilds;return t.set(n,i),e.changed},NE.$inject=["elementRegistry","bpmnFactory"];var LE=NE;function FE(e,t){if(!e)throw new Error(t+"required");return e}function VE(e){this._commandStack=e}NE.prototype.execute=function(e){var t,n=FE(e.currentObject,"currentObject"),i=FE(e.propertyName,"propertyName"),r=e.updatedObjectList,o=e.objectsToRemove||[],a=e.objectsToAdd||[],s=e.objectsToPrepend||[],c=[e.element];e.referencePropertyName&&(t=e.referencePropertyName);var p=n[i];if(e.previousList=n[i],r)n[i]=r;else{var u=s.slice();if(Qg(p,(function(e){-1==o.indexOf(e)&&u.push(e)})),(u=u.concat(a)).length>0||!t)n[i]=u;else if(t){n.$parent.set(t,void 0)}}return e.changed=c,c},NE.prototype.revert=function(e){var t=e.currentObject,n=e.propertyName,i=e.previousList,r=t.$parent;return e.referencePropertyName&&r.set(e.referencePropertyName,t),t.set(n,i),e.changed},VE.$inject=["commandStack"];var $E=VE;VE.prototype.preExecute=function(e){var t=this._commandStack;Qg(e,(function(e){t.execute(e.cmd,e.context)}))};var zE={"properties-panel.update-businessobject":CE,"properties-panel.create-and-reference":jE,"properties-panel.create-businessobject-list":BE,"properties-panel.update-businessobject-list":LE,"properties-panel.multi-command-executor":$E};function qE(e,t){e.on("diagram.init",(function(){Qg(zE,(function(e,n){t.registerHandler(n,e)}))}))}qE.$inject=["eventBus","commandStack"];var UE={__init__:[qE]},GE=t(be),HE=t(a),WE=GE.query,KE=GE.clear,XE=GE.classes,YE=PE.is,JE=GE.domify,ZE=HE.default,QE=/\s/,ew=/^([a-z][\w-.]*:)?[a-z_][\w-.]*$/i,tw=/^[a-z_][\w-.]*$/i,nw={"&":"&","<":"<",">":">",'"':""","'":"'"};function iw(e){if(e.selectedIndex>=0)return e.options[e.selectedIndex].value}function rw(e){for(var t=e;t.$parent;)t=t.$parent;return t}function ow(e,t){var n=[];return Qg(e||[],(function(e){YE(e,t)&&n.push(e)})),n}function aw(e,t){return ow(rw(e).rootElements,t)}function sw(e){return e.push({label:"",value:"",name:""})}function cw(e){var t=e.name||"";return e.errorCode&&(t+=" (code="+e.errorCode+")"),e.escalationCode&&(t+=" (code="+e.escalationCode+")"),t}function pw(e,t){var n=[],i=aw(e,t);return Qg(i,(function(e){n.push({label:cw(e),value:e.id,name:e.name})})),n}function uw(e,t){return lw(e)?t("Id must not contain spaces."):tw.test(e)?void 0:ew.test(e)?t("Id must not contain prefix."):t("Id must be a valid QName.")}function lw(e){return QE.test(e)}function dw(e){return(e=""+e)&&e.replace(/[&<>"']/g,(function(e){return nw[e]}))}var hw={selectedOption:iw,selectedType:function(e,t){return iw(WE(e,t))},getRoot:rw,filterElementsByType:ow,findRootElementsByType:aw,removeAllChildren:function(e){for(;e.firstChild;)e.removeChild(e.firstChild)},addEmptyParameter:sw,refreshOptionsModel:pw,updateOptionsDropDown:function(e,t,n,i){var r=pw(t,n);sw(r);var o=WE(e,i);return KE(o),Qg(r,(function(e){var t=JE('<option value="'+dw(e.value)+'">'+dw(e.label)+"</option>");o.appendChild(t)})),r},isIdValid:function(e,t,n){var i=e.$model.ids.assigned(t);return!t||i&&i!==e?n("Element must have an unique id."):uw(t,n)},validateId:uw,containsSpace:lw,nextId:function(e){return new ZE([32,32,1]).nextPrefixed(e)},triggerClickEvent:function(e){var t,n="click";if(document.createEvent){try{t=new MouseEvent(n,{view:window,bubbles:!0,cancelable:!0})}catch(e){(t=document.createEvent("MouseEvent")).initEvent(n,!0,!0)}return e.dispatchEvent(t)}return t=document.createEventObject(),e.fireEvent("onclick",t)},escapeHTML:dw,createDropdown:function(e){var t,n=e.menu,i=JE('<div class="group__dropdown"><button class="group__dropdown-button"><svg width="16" height="16" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 192 512"><path fill="currentColor" d="M96 184c39.8 0 72 32.2 72 72s-32.2 72-72 72-72-32.2-72-72 32.2-72 72-72zM24 80c0 39.8 32.2 72 72 72s72-32.2 72-72S135.8 8 96 8 24 40.2 24 80zm0 352c0 39.8 32.2 72 72 72s72-32.2 72-72-32.2-72-72-72-72 32.2-72 72z"></path></svg></button><div class="group__dropdown-menu"></div></div>'),r=WE(".group__dropdown-button",i),o=WE(".group__dropdown-menu",i);return r.addEventListener("click",(function(e){XE(i).toggle("group__dropdown--open"),function(e){function n(t){if(t!==e){var r=t.target;o===r||o.contains(r)||(XE(i).remove("group__dropdown--open"),document.removeEventListener("click",n))}}t&&document.removeEventListener("click",t);document.addEventListener("click",n),t=n}(e)})),Qg(n,(function(e){var t=JE('<div class="group__dropdown-menu-item" data-dropdown-action="'+e.id+'">'+dw(e.label)+"</div>");t.addEventListener("click",(function(){e.onClick(),XE(i).remove("group__dropdown--open")})),o.appendChild(t)})),i}};var mw=function(e,t){var n=[];return Yg(e,(function(e,i,r){t(e,i,r)&&n.push(e)})),n};var fw=function(e,t){return(Sg(e)?fx:mw)(e,EE(t))},vw=Object.prototype.hasOwnProperty;var yw=function(e){if(null==e)return!0;if(Wg(e)&&(Sg(e)||"string"==typeof e||"function"==typeof e.splice||Cg(e)||Ig(e)||Pg(e)))return!e.length;var t=Lx(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(Vg(e))return!Ug(e).length;for(var n in e)if(vw.call(e,n))return!1;return!0};var gw=function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)},bw=Math.max;var xw=function(e,t,n){return t=bw(void 0===t?e.length-1:t,0),function(){for(var i=arguments,r=-1,o=bw(i.length-t,0),a=Array(o);++r<o;)a[r]=i[t+r];r=-1;for(var s=Array(t+1);++r<t;)s[r]=i[r];return s[t]=n(a),gw(e,this,s)}};var Ew=function(e){return function(){return e}},ww=function(){try{var e=Rb(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),_w=ww?function(e,t){return ww(e,"toString",{configurable:!0,enumerable:!1,value:Ew(t),writable:!0})}:Jg,Pw=Date.now;var Sw=function(e){var t=0,n=0;return function(){var i=Pw(),r=16-(i-n);if(n=i,r>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}},Ow=Sw(_w);var Cw=function(e,t){return Ow(xw(e,t,Jg),e+"")};var Tw=function(e,t,n,i){for(var r=e.length,o=n+(i?1:-1);i?o--:++o<r;)if(t(e[o],o,e))return o;return-1};var Aw=function(e){return e!=e};var Rw=function(e,t,n){for(var i=n-1,r=e.length;++i<r;)if(e[i]===t)return i;return-1};var kw=function(e,t,n){return t==t?Rw(e,t,n):Tw(e,Aw,n)};var jw=function(e,t){return!!(null==e?0:e.length)&&kw(e,t,0)>-1};var Mw=function(e,t,n){for(var i=-1,r=null==e?0:e.length;++i<r;)if(n(t,e[i]))return!0;return!1};var Dw=function(e,t,n,i){var r=-1,o=jw,a=!0,s=e.length,c=[],p=t.length;if(!s)return c;n&&(t=oE(t,Mg(n))),i?(o=Mw,a=!1):t.length>=200&&(o=ox,a=!1,t=new ix(t));e:for(;++r<s;){var u=e[r],l=null==n?u:n(u);if(u=i||0!==u?u:0,a&&l==l){for(var d=p;d--;)if(t[d]===l)continue e;c.push(u)}else o(t,l,i)||c.push(u)}return c},Bw=pg?pg.isConcatSpreadable:void 0;var Iw=function(e){return Sg(e)||Pg(e)||!!(Bw&&e&&e[Bw])};var Nw=function e(t,n,i,r,o){var a=-1,s=t.length;for(i||(i=Iw),o||(o=[]);++a<s;){var c=t[a];n>0&&i(c)?n>1?e(c,n-1,i,r,o):hx(o,c):r||(o[o.length]=c)}return o};var Lw=function(){},Fw=Sx&&1/px(new Sx([,-0]))[1]==1/0?function(e){return new Sx(e)}:Lw;var Vw=function(e,t,n){var i=-1,r=jw,o=e.length,a=!0,s=[],c=s;if(n)a=!1,r=Mw;else if(o>=200){var p=t?null:Fw(e);if(p)return px(p);a=!1,r=ox,c=new ix}else c=t?[]:s;e:for(;++i<o;){var u=e[i],l=t?t(u):u;if(u=n||0!==u?u:0,a&&l==l){for(var d=c.length;d--;)if(c[d]===l)continue e;t&&c.push(l),s.push(u)}else r(c,l,n)||(c!==s&&c.push(l),s.push(u))}return s};var $w=function(e,t,n){var i=e.length;if(i<2)return i?Vw(e[0]):[];for(var r=-1,o=Array(i);++r<i;)for(var a=e[r],s=-1;++s<i;)s!=r&&(o[r]=Dw(o[r]||a,e[s],t,n));return Vw(Nw(o,1),t,n)};var zw=function(e){return bg(e)&&Wg(e)},qw=Cw((function(e){return $w(fx(e,zw))})),Uw=function(){return cg.Date.now()},Gw=/\s/;var Hw=function(e){for(var t=e.length;t--&&Gw.test(e.charAt(t)););return t},Ww=/^\s+/;var Kw=function(e){return e?e.slice(0,Hw(e)+1).replace(Ww,""):e},Xw=/^[-+]0x[0-9a-f]+$/i,Yw=/^0b[01]+$/i,Jw=/^0o[0-7]+$/i,Zw=parseInt;var Qw=function(e){if("number"==typeof e)return e;if(Yx(e))return NaN;if(Gg(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Gg(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Kw(e);var n=Yw.test(e);return n||Jw.test(e)?Zw(e.slice(2),n?2:8):Xw.test(e)?NaN:+e},e_=Math.max,t_=Math.min;var n_=function(e,t,n){var i,r,o,a,s,c,p=0,u=!1,l=!1,d=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function h(t){var n=i,o=r;return i=r=void 0,p=t,a=e.apply(o,n)}function m(e){return p=e,s=setTimeout(v,t),u?h(e):a}function f(e){var n=e-c;return void 0===c||n>=t||n<0||l&&e-p>=o}function v(){var e=Uw();if(f(e))return y(e);s=setTimeout(v,function(e){var n=t-(e-c);return l?t_(n,o-(e-p)):n}(e))}function y(e){return s=void 0,d&&i?h(e):(i=r=void 0,a)}function g(){var e=Uw(),n=f(e);if(i=arguments,r=this,c=e,n){if(void 0===s)return m(c);if(l)return clearTimeout(s),s=setTimeout(v,t),h(c)}return void 0===s&&(s=setTimeout(v,t)),a}return t=Qw(t)||0,Gg(n)&&(u=!!n.leading,o=(l="maxWait"in n)?e_(Qw(n.maxWait)||0,t):o,d="trailing"in n?!!n.trailing:d),g.cancel=function(){void 0!==s&&clearTimeout(s),p=0,i=c=r=s=void 0},g.flush=function(){return void 0===s?a:y(Uw())},g};var i_=function(e){return(null==e?0:e.length)?Nw(e,Infinity):[]};var r_=function(e,t,n){"__proto__"==t&&ww?ww(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n};var o_=function(e,t,n,i){for(var r=-1,o=null==e?0:e.length;++r<o;){var a=e[r];t(i,a,n(a),e)}return i};var a_=function(e,t,n,i){return Yg(e,(function(e,r,o){t(i,e,n(e),o)})),i};var s_=function(e,t){return function(n,i){var r=Sg(n)?o_:a_,o=t?t():{};return r(n,e,EE(i),o)}}((function(e,t,n){r_(e,n,t)}));var c_=function(e,t){var n=-1,i=Wg(e)?Array(e.length):[];return Yg(e,(function(e,r,o){i[++n]=t(e,r,o)})),i};var p_=function(e,t){return(Sg(e)?oE:c_)(e,EE(t))};var u_=function(e,t,n,i){var r=-1,o=null==e?0:e.length;for(i&&o&&(n=e[++r]);++r<o;)n=t(n,e[r],r,e);return n};var l_=function(e,t,n,i,r){return r(e,(function(e,r,o){n=i?(i=!1,e):t(n,e,r,o)})),n};var d_=function(e,t,n){var i=Sg(e)?u_:l_,r=arguments.length<3;return i(e,EE(t),n,r,Yg)};var h_=function(e,t,n){var i=e.start,r=i,o=n.length-t.length;n.length,t.length;var a=t.substring(i);return n.lastIndexOf(a)===n.length-a.length&&(t=t.substring(0,t.length-a.length),n=n.substring(0,n.length-a.length)),(o=function(e,t){var n,i,r,o=0,a=0;t.length>e.length?(i=t,r=e):(i=e,r=t);for(;o<i.length;)i.charAt(o)!==r.charAt(a)?(n||(n={l_start:o,s_start:a}),o++):(n&&!n.complete&&(n.l_end=o,n.s_end=a,n.complete=!0),a++,o++);n&&!n.complete&&(n.complete=!0,n.s_end=r.length,n.l_end=i.length);if(!n)return;return t.length>e.length?{newStart:n.l_start,newEnd:n.l_end,type:"add"}:{newStart:n.s_start,newEnd:n.s_end,type:t.length<e.length?"remove":"replace"}}(t,n))&&(r="remove"===o.type?o.newStart:o.newEnd),m_(r)};function m_(e,t){return{start:e,end:void 0===t?e:t}}var f_=m_;h_.range=f_;var v_={scrollSymbolLeft:"‹",scrollSymbolRight:"›"};function y_(e,t){U(this,function(e){return e=e||Object.create(null),{on:function(t,n){(e[t]||(e[t]=[])).push(n)},off:function(t,n){e[t]&&e[t].splice(e[t].indexOf(n)>>>0,1)},emit:function(t,n){(e[t]||[]).slice().map((function(e){e(n)})),(e["*"]||[]).slice().map((function(e){e(t,n)}))}}}()),this.options=t=U({},v_,t),this.container=e,this._createScrollButtons(e,t),this._bindEvents(e)}function g_(e,t){var n=b_(e);return n||(n=new y_(e,t),e.__scrollTabs=n),n}function b_(e){return e.__scrollTabs}y_.prototype._createButton=function(e,t){var n=t.className,i=t.direction,r=ve("."+n,e);return r||(r=he('<span class="scroll-tabs-button '+n+'">'+t.label+"</span>"),e.insertBefore(r,e.childNodes[0])),K(r,"data-direction",i),r},y_.prototype._createScrollButtons=function(e,t){this._createButton(e,{className:"scroll-tabs-left",label:t.scrollSymbolLeft,direction:-1}),this._createButton(e,{className:"scroll-tabs-right",label:t.scrollSymbolRight,direction:1})},y_.prototype.getActiveTabNode=function(){return ve(this.options.selectors.active,this.container)},y_.prototype.getTabsContainerNode=function(){return ve(this.options.selectors.tabsContainer,this.container)},y_.prototype.getAllTabNodes=function(){return ye(this.options.selectors.tab,this.container)},y_.prototype.getVisibleTabs=function(){var e=this.getAllTabNodes(),t=this.options.selectors.ignore;return w(e,(function(e){return!re(e,t)}))},y_.prototype.getAdjacentTab=function(e,t){var n=this.getVisibleTabs(),i=n.indexOf(e);return n[i+t]},y_.prototype._bindEvents=function(e){this._bindWheelEvent(e),this._bindTabClickEvents(e),this._bindScrollButtonEvents(e)},y_.prototype._bindTabClickEvents=function(e){var t=this.options.selectors.tab,n=this;de.bind(e,t,"click",(function(e){n.scrollToTabNode(e.delegateTarget)}))},y_.prototype._bindWheelEvent=function(e){var t=this;pe.bind(e,"wheel",(function(e){var n=Math.sign(e.deltaY),i=t.getActiveTabNode(),r=t.getAdjacentTab(i,n);r&&(t.scrollToTabNode(r),t.emit("scroll",r,i,n)),e.preventDefault()}))},y_.prototype._bindScrollButtonEvents=function(e){var t=this;de.bind(e,".scroll-tabs-button","click",(function(e){var n=e.delegateTarget,i=parseInt(K(n,"data-direction"),10),r=t.getActiveTabNode(),o=t.getAdjacentTab(r,i);o&&(t.scrollToTabNode(o),t.emit("scroll",o,r,i)),e.preventDefault()}))},y_.prototype.scrollToTabNode=function(e){if(e){var t=e.parentNode,n=e.offsetWidth,i=e.offsetLeft,r=i+n,o=t.offsetWidth;t.scrollLeft>i?t.scrollLeft=0:r>o&&(t.scrollLeft=r-o)}},y_.prototype.update=function(){var e=this.getTabsContainerNode(),t=e.scrollWidth>e.offsetWidth;Q(this.container).toggle("scroll-tabs-overflow",t),t&&this.scrollToTabNode(this.getActiveTabNode())},g_.get=b_;var x_=t(Object.freeze({__proto__:null,default:g_})),E_=hw.createDropdown,w_=hw.escapeHTML,__=GE.domify,P_=GE.query,S_=GE.queryAll,O_=GE.remove,C_=GE.classes,T_=GE.closest,A_=GE.attr,R_=GE.delegate,k_=GE.matches,j_=x_.default,M_=PE.getBusinessObject,D_="bpp-hidden";function B_(e){return"checkbox"===e.type||"radio"===e.type}function I_(e){return A_(e,"contenteditable")}function N_(e,t){var n=S_("input[name], textarea[name], select[name], [contenteditable]",e);return n&&n.length||(n=k_(e,"option")?[e]:n),t||(n=fw(n,(function(e){return!T_(e,".bpp-hidden")}))),n}function L_(e){var t={},n=N_(e);return Qg(n,(function(e){var n=e.value,i=A_(e,"name")||A_(e,"data-name");B_(e)?n=e.checked?!A_(e,"value")||e.value:null:I_(e)&&(n=e.innerText),null!==n&&(t[i]=n)})),t}function F_(e){var t,n=P_("[data-list-entry-container]",e);if(n){t=[];var i=n.children||[];Qg(i,(function(e){t.push(L_(e))}))}else t=L_(e);return t}function V_(e,t){return!(e&&!t)&&Kg(e).concat(Kg(t)).every((function(n){return e[n]===t[n]}))}function $_(e){return s_(i_(p_(i_(p_(e,"groups")),"entries")),"id")}function z_(e,t,n,i,r,o){this._eventBus=n,this._modeling=i,this._commandStack=r,this._canvas=o;var a=t.get("propertiesProvider",!1);a&&this.registerProvider(a),this._init(e)}z_.$inject=["config.propertiesPanel","injector","eventBus","modeling","commandStack","canvas"];var q_=z_;function U_(e){return e&&(e.isImplicit||"__implicitroot"===e.id)}z_.prototype.registerProvider=function(e,t){t||(t=e,e=1e3),"function"==typeof t.getTabs?(this._eventBus.on("propertiesPanel.getProviders",e,(function(e){e.providers.push(t)})),this._eventBus.fire("propertiesPanel.providersChanged")):console.error("Properties provider does not impement #getTabs(element) API")},z_.prototype._init=function(e){var t=this._canvas,n=this._eventBus,i=this;n.on("root.added",(function(e){var t=e.element;U_(t)||i.update(t)})),n.on("selection.changed",(function(e){var n=e.newSelection[0];U_(t.getRootElement())||i.update(n)})),n.on(["propertiesPanel.changed","propertiesPanel.resized"],(function(e){var t=P_(".bpp-properties-tab-bar",i._container);if(t){var n=j_.get(t);n||(n=j_(t,{selectors:{tabsContainer:".bpp-properties-tabs-links",tab:".bpp-properties-tabs-links li",ignore:".bpp-hidden",active:".bpp-active"}})).on("scroll",(function(e,t,n){var r=P_("[data-tab-target]",e),o=A_(r,"data-tab-target");i.activateTab(o)})),n.update()}})),n.on("elements.changed",(function(e){var t=i._current,n=t&&t.element;n&&-1!==e.elements.indexOf(n)&&i.update(n)})),n.on(["elementTemplates.changed","propertiesPanel.providersChanged"],(function(){var e=i._current,t=e&&e.element;t&&i.update(t)})),n.on("diagram.destroy",(function(){i.detach()})),this._container=__('<div class="bpp-properties-panel" input-handle-modified-keys="z,y"></div>'),this._bindListeners(this._container),e&&e.parent&&this.attachTo(e.parent)},z_.prototype.attachTo=function(e){if(!e)throw new Error("parentNode required");this.detach(),e.get&&e.constructor.prototype.jquery&&(e=e.get(0)),"string"==typeof e&&(e=P_(e));var t=this._container;e.appendChild(t),this._emit("attach")},z_.prototype.detach=function(){var e=this._container,t=e.parentNode;t&&(this._emit("detach"),t.removeChild(e))},z_.prototype.activateTab=function(e){Gg(e)&&(e=e.id);var t=S_(".bpp-properties-tab",this._current.panel),n=S_(".bpp-properties-tab-link",this._current.panel);Qg(t,(function(e){C_(e).remove("bpp-active")})),Qg(n,(function(e){C_(e).remove("bpp-active")}));var i=fw(t,(function(e){return!C_(e).has(D_)})),r=d_(i,(function(t,n){return A_(n,"data-tab")===e?n:t}),i[0]);r&&C_(r).add("bpp-active");var o=fw(n,(function(e){return!C_(e).has(D_)})),a=d_(o,(function(t,n){return A_(P_("a[data-tab-target]",n),"data-tab-target")===e?n:t}),o[0]);a&&C_(a).add("bpp-active")},z_.prototype._getProviders=function(){var e=this._eventBus.createEvent({type:"propertiesPanel.getProviders",providers:[]});return this._eventBus.fire(e),e.providers},z_.prototype._getTabs=function(e){var t=this._getProviders();return d_(t,(function(t,n){var i=n.getTabs(e);return Hg(i)?i(t):i}),[])},z_.prototype.update=function(e){e||(e=this._canvas.getRootElement());var t,n,i=this._getTabs(e);this._current&&(n=P_(".bpp-properties-tab.bpp-active",this._current.panel))&&(t=A_(n,"data-tab")),this._current&&this._current.element===e&&!this._entriesChanged(this._current.entries,$_(i))||(this._current&&O_(this._current.panel),this._current=this._create(e,i)),this._updateActivation(this._current),t?this.activateTab(t):this.activateTab(this._current.tabs[0]),this._emit("changed")},z_.prototype._entriesChanged=function(e,t){var n=Kg(e),i=Kg(t);return!yw(qw(n,i))},z_.prototype._emit=function(e){this._eventBus.fire("propertiesPanel."+e,{panel:this,current:this._current})},z_.prototype._bindListeners=function(e){var t=this,n=function(e){var n,i,r=e.delegateTarget,o=T_(r,"[data-entry]");if(o){n=A_(o,"data-entry"),i=t.getEntry(n);var a=F_(o);if("change"===e.type){var s=A_(r,"data-on-change");if(s)if(!t.executeAction(i,o,s,e))return t.update(t._current.element)}t.applyChanges(i,a,o),t.updateState(i,o)}};R_.bind(e,"input, textarea, [contenteditable]","input",n_(n,300)),R_.bind(e,"input, textarea, select, [contenteditable]","change",n),R_.bind(e,"[contenteditable]","paste",(function(e){var t=(e.clipboardData||window.clipboardData).getData("text");n=t,t=n.replace(/\r\n|\r|\n/g,"\n"),document.execCommand("insertText",!1,t),e.preventDefault();var n})),R_.bind(e,"select","keydown",(function(e){46===e.keyCode&&(e.stopPropagation(),e.preventDefault())})),R_.bind(e,"[data-auto-suggest]","input",(function(e){var n=e.delegateTarget,i=T_(n,"[data-entry]");if(i){var r=A_(n,"data-auto-suggest"),o=A_(i,"data-entry"),a=t.getEntry(o);t.executeAction(a,i,r,e)}}),!0),R_.bind(e,"[data-action]","click",(function(e){var n=e.delegateTarget,i=T_(n,"[data-entry]"),r=A_(n,"data-action"),o=A_(i,"data-entry"),a=t.getEntry(o);if(!t.executeAction(a,i,r,e))return t.update(t._current.element);var s=F_(i);t.applyChanges(a,s,i),t.updateState(a,i)})),R_.bind(e,"[data-blur]","blur",(function(e,n){var i=e.delegateTarget,r=T_(i,"[data-entry]");if(r){var o=A_(i,"data-blur"),a=A_(r,"data-entry"),s=t.getEntry(a);if(t.executeAction(s,r,o,e)){var c=F_(r);t.applyChanges(s,c,r)}t.updateState(s,r)}}),!0),R_.bind(e,".bpp-properties-tabs-links [data-tab-target]","click",(function(e){e.preventDefault();var n=e.delegateTarget,i=A_(n,"data-tab-target");t.activateTab(i)}))},z_.prototype.updateState=function(e,t){this.updateShow(e,t),this.updateDisable(e,t)},z_.prototype.updateShow=function(e,t){var n=this._current;if(n){var i=S_("[data-show]",t)||[];Qg(i,(function(i){var r=A_(i,"data-show"),o=hE(e,r);if(o){var a=T_(i,"[data-scope]")||t;o(n.element,t,i,a)||!1?C_(i).remove(D_):C_(i).add(D_)}}))}},z_.prototype.updateDisable=function(e,t){var n=this._current;if(n){var i=S_("[data-disable]",t)||[];Qg(i,(function(i){var r=A_(i,"data-disable"),o=hE(e,r);if(o){var a=T_(i,"[data-scope]")||t,s=o(n.element,t,i,a)||!1;A_(i,"disabled",s?"":null)}}))}},z_.prototype.executeAction=function(e,t,n,i){var r=this._current;if(r){var o=hE(e,n);if(o){var a=T_(i.target,"[data-scope]")||t;return o.apply(e,[r.element,t,i,a])}}},z_.prototype.applyChanges=function(e,t,n){var i=this._current.element;if(!function(e,t){return Sg(e)?e.length===t.length&&e.every((function(e,n){return V_(e,t[n])})):V_(e,t)}(t,e.oldValues)){var r,o=e.set(i,t,n);Sg(o)?o.length&&(r={cmd:"properties-panel.multi-command-executor",context:i_(o)}):r=o,r?this._commandStack.execute(r.cmd,r.context||{element:i}):this.update(i)}},z_.prototype.applyValidationErrors=function(e,t){var n=!0,i=N_(t,!0);return Qg(i,(function(t){var i=A_(t,"name")||A_(t,"data-name"),r=e&&e[i],o=P_(".bpp-error-message",t.parentNode);r?(n=!1,o||(o=__("<div></div>"),C_(o).add("bpp-error-message"),t.parentNode.insertBefore(o,t.nextSibling)),o.textContent=r,C_(t).add("invalid")):(C_(t).remove("invalid"),o&&t.parentNode.removeChild(o))})),n},z_.prototype.validate=function(e,t,n){var i=this._current,r=!0;if(n=n||P_('[data-entry="'+e.id+'"]',i.panel),t instanceof Array)for(var o=P_("[data-list-entry-container]",n).children||[],a=0;a<t.length;a++){var s=t[a];if(e.validateListItem){var c=e.validateListItem(i.element,s,n,a),p=o[a];r=this.applyValidationErrors(c,p)&&r}}else e.validate&&(this.validationErrors=e.validate(i.element,t,n),r=this.applyValidationErrors(this.validationErrors,n)&&r);return r},z_.prototype.getEntry=function(e){return this._current&&this._current.entries[e]},z_.prototype._create=function(e,t){if(!e)return null;var n=this._container,i=this._createPanel(e,t);n.appendChild(i);var r=$_(t);return{tabs:t,groups:function(e){return s_(i_(p_(e,"groups")),"id")}(t),entries:r,element:e,panel:i}},z_.prototype._bindTemplate=function(e,t,n,i,r){var o=this._eventBus;var a=function(e){var t="input[name], textarea[name], [data-value], [contenteditable]",n=S_(t,e);return n&&n.length||!k_(e,t)||(n=[e]),n}(i);Qg(a,(function(a){var s,c,p;"value"in a||"true"===I_(a)?(s=A_(a,"name")||A_(a,"data-name"),c=n[s],(p=function(t,n){return o.fire("propertiesPanel.isPropertyEditable",{entry:t,propertyName:n,element:e})}(t,s))&&t.editable&&(p=t.editable(e,i,a,s,c,r)),A_(a,"readonly",p?null:""),A_(a,"disabled",p?null:""),t.setControlValue?t.setControlValue(e,i,a,s,c,r):B_(a)?function(e,t){var n=e.value;e.checked=t===n||!A_(e,"value")&&t}(a,c):function(e){return"select-one"===e.type}(a)?function(e,t){void 0!==t&&(e.value=t)}(a,c):function(e,t){var n,i=I_(e),r=i?e.innerText:e.value;void 0===t&&(t="");if(r===t)return;document.activeElement===e&&(n=h_(function(e){return I_(e)?function(e){var t=window.getSelection(),n=t.focusNode,i=t.focusOffset,r=t.anchorOffset;if(!n)throw new Error("not selected");if(!e.contains(n))throw new Error("not selected");return{start:Math.min(i,r),end:Math.max(i,r)}}(e):{start:e.selectionStart,end:e.selectionEnd}}(e),r,t));i?e.innerText=t:e.value=t;n&&function(e,t){I_(e)?function(e,t){var n,i,r;n=e.firstChild||e,(i=document.createRange()).setStart(n,t.start),i.setEnd(n,t.end),(r=window.getSelection()).removeAllRanges(),r.addRange(i)}(e,t):(e.selectionStart=t.start,e.selectionEnd=t.end)}(e,n)}(a,c)):(s=A_(a,"data-value"),c=n[s],t.setControlValue?t.setControlValue(e,i,a,s,c,r):function(e,t){e.textContent=t}(a,c))}))},z_.prototype._updateActivation=function(e){var t=this,n=this._eventBus,i=e.element;function r(e,t){C_(e).toggle(D_,!t)}function o(e,t,n){var i=P_(t,e);i&&(i.textContent=n)}var a=e.panel;Qg(e.tabs,(function(e){var s=P_("[data-tab="+e.id+"]",a),c=P_("[data-tab-target="+e.id+"]",a).parentNode,p=!1;Qg(e.groups,(function(a){var c=!1,u=P_("[data-group="+a.id+"]",s);Qg(a.entries,(function(o){var s=P_('[data-entry="'+o.id+'"]',u),p=function(e,t,r){return n.fire("propertiesPanel.isEntryVisible",{element:i,entry:e,group:t,tab:r})}(o,a,e);c=c||p,r(s,p);var l="get"in o?o.get(i,s):{};if(l instanceof Array){for(var d=P_("[data-list-entry-container]",s),h=d.children||[],m=0;m<l.length;m++){var f=l[m],v=h[m];v||(v=__(o.createListEntryTemplate(f,m,d)),d.appendChild(v)),A_(v,"data-index",m),t._bindTemplate(i,o,f,v,m)}for(var y=h.length-l.length,g=0;g<y;g++)d.removeChild(d.lastChild)}else t._bindTemplate(i,o,l,s);t.updateState(o,s),t.validate(o,l,s),o.oldValues=F_(s)})),"function"==typeof a.label&&o(u,".group-label",a.label(i,u)),c=c&&function(e,t,n){return!Hg(e.enabled)||e.enabled(t,n)}(a,i,u),p=p||c,r(u,c)})),p=p&&function(e,t){return!Hg(e.enabled)||e.enabled(t)}(e,i),r(s,p),r(c,p)})),o(a,"[data-label-id]",M_(i).id||"")},z_.prototype._createPanel=function(e,t){var n=this,i=__('<div class="bpp-properties"></div>'),r=__('<div class="bpp-properties-header"><div class="label" data-label-id></div></div>'),o=__('<div class="bpp-properties-tab-bar"></div>'),a=__('<ul class="bpp-properties-tabs-links"></ul>'),s=__('<div class="bpp-properties-tabs-container"></div>');return i.appendChild(r),Qg(t,(function(e,t){if(!e.id)throw new Error("tab must have an id");var i=__('<div class="bpp-properties-tab" data-tab="'+w_(e.id)+'"></div>'),r=__('<li class="bpp-properties-tab-link"><a href data-tab-target="'+w_(e.id)+'">'+w_(e.label)+"</a></li>"),o=e.groups;Qg(o,(function(e){if(!e.id)throw new Error("group must have an id");var t=__('<div class="bpp-properties-group" data-group="'+w_(e.id)+'"><span class="group-toggle"></span><div class="group-header"><span class="group-label">'+w_(e.label)+"</span></div></div>");e.dropdown&&P_(".group-header",t).appendChild(E_(e.dropdown)),t.querySelector(".group-toggle").addEventListener("click",(function(e){C_(t).toggle("group-closed"),e.preventDefault(),e.stopPropagation()})),t.addEventListener("click",(function(e){!e.defaultPrevented&&C_(t).has("group-closed")&&C_(t).remove("group-closed")})),Qg(e.entries,(function(e){if(!e.id)throw new Error("entry must have an id");var i=e.html;"string"==typeof i&&(i=__(i)),i.get&&i.constructor.prototype.jquery&&(i=i.get(0));var r=__('<div class="bpp-properties-entry" data-entry="'+w_(e.id)+'"></div>');Qg(e.cssClasses||[],(function(e){C_(r).add(e)})),r.appendChild(i),t.appendChild(r),n.updateState(e,r)})),i.appendChild(t)})),a.appendChild(r),s.appendChild(i)})),o.appendChild(a),i.appendChild(o),i.appendChild(s),i};var G_=t(mo),H_={__depends__:[UE,G_.default],__init__:["propertiesPanel"],propertiesPanel:["type",q_]};function W_(e,t){var n=this;t=t||1e3,e.on("propertiesPanel.isEntryVisible",t,(function(e){var t=e.element,i=e.entry,r=e.group,o=e.tab;return n.isEntryVisible(t,i,r,o)})),e.on("propertiesPanel.isPropertyEditable",t,(function(e){var t=e.element,i=e.entry,r=e.group,o=e.propertyName,a=e.tab;return n.isPropertyEditable(o,t,i,r,a)}))}W_.$inject=["eventBus"];var K_=W_;W_.prototype.isEntryVisible=function(e,t,n,i){return!0},W_.prototype.isPropertyEditable=function(e,t,n,i,r){return!0};var X_=GE.domify,Y_=GE.classes,J_=GE.event,Z_=hw.escapeHTML,Q_=function(e,t,n){for(var i,r,o,a=n&&n.show,s=[],c=/(?:\[([^\]]+)\]\((https?:\/\/[^)]+)\))|(?:<a href="(https?:\/\/[^"]+)">(.+?(?=<\/))<\/a>)/gi,p=0;i=c.exec(t);)i.index>p&&s.push(eP(t.substring(p,i.index))),r=i[2]&&encodeURI(i[2])||i[3],o=i[1]||i[4],s.push('<a href="'+r+'" target="_blank">'+eP(o)+"</a>"),p=i.index+i[0].length;p<t.length&&s.push(eP(t.substring(p))),t=s.join("");var u=X_('<div class="bpp-field-description description description--expanded"'+(a?'data-show="'+a+'">':">")+"</div>"),l=X_('<span class="description__text">'+t+"</span>");function d(n){n?(Y_(u).add("description--expanded"),l.textContent=t+" ",m.textContent=e("Less")):(Y_(u).remove("description--expanded"),l.textContent=h+" ... ",m.textContent=e("More"))}u.appendChild(l);var h,m,f=!1;return t.length>200&&(h=t.slice(0,200),m=X_('<span class="bpp-entry-link description__expand">'+e("More")+"</span>"),J_.bind(m,"click",(function(){d(f=!f)})),u.appendChild(m),d(f)),u};function eP(e){for(var t,n=0,i=[],r=/<br\s*\/?>/gi;t=r.exec(e);)t.index>n&&i.push(Z_(e.substring(n,t.index))),i.push("<br />"),n=t.index+t[0].length;return n<e.length&&i.push(Z_(e.substring(n))),i.join("")}var tP=hw.escapeHTML,nP=GE.domify,iP=GE.query,rP=function(e,t,n){var i=n,r=t.label||i.id,o=t.dataValueLabel,a=t.buttonLabel||"X",s=void 0!==t.buttonAction?t.buttonAction.name:"clear",c=void 0!==t.buttonAction?t.buttonAction.method:function(e,n){return iP('input[name="'+t.modelProperty+'"]',n).value="",!0},p=void 0!==t.buttonShow?t.buttonShow.name:"canClear",u=void 0!==t.buttonShow?t.buttonShow.method:function(e,n){return""!==iP('input[name="'+t.modelProperty+'"]',n).value},l=!!t.disabled&&"function"==typeof t.disabled,d=!!t.hidden&&"function"==typeof t.hidden,h=t.description;return i.html=nP('<label for="camunda-'+tP(i.id)+'" '+(l?'data-disable="isDisabled" ':"")+(d?'data-show="isHidden" ':"")+(o?'data-value="'+tP(o)+'"':"")+">"+tP(r)+'</label><div class="bpp-field-wrapper" '+(l?'data-disable="isDisabled"':"")+(d?'data-show="isHidden"':"")+'><input id="camunda-'+tP(i.id)+'" type="text" name="'+tP(t.modelProperty)+'" '+(l?'data-disable="isDisabled"':"")+(d?'data-show="isHidden"':"")+' /><button class="action-button '+tP(s)+'" data-action="'+tP(s)+'" data-show="'+tP(p)+'" '+(l?'data-disable="isDisabled"':"")+(d?' data-show="isHidden"':"")+"><span>"+tP(a)+"</span></button></div>"),h&&i.html.appendChild(Q_(e,h,{show:d&&"isHidden"})),i[s]=c,i[p]=u,l&&(i.isDisabled=function(){return t.disabled.apply(i,arguments)}),d&&(i.isHidden=function(){return!t.hidden.apply(i,arguments)}),i.cssClasses=["bpp-textfield"],i},oP={},aP=oP;oP.updateProperties=function(e,t){return{cmd:"element.updateProperties",context:{element:e,properties:t}}},oP.updateBusinessObject=function(e,t,n){return{cmd:"properties-panel.update-businessobject",context:{element:e,businessObject:t,properties:n}}},oP.addElementsTolist=function(e,t,n,i,r){return{cmd:"properties-panel.update-businessobject-list",context:{element:e,currentObject:t,propertyName:n,objectsToPrepend:r,objectsToAdd:i}}},oP.removeElementsFromList=function(e,t,n,i,r){return{cmd:"properties-panel.update-businessobject-list",context:{element:e,currentObject:t,propertyName:n,referencePropertyName:i,objectsToRemove:r}}},oP.addAndRemoveElementsFromList=function(e,t,n,i,r,o){return{cmd:"properties-panel.update-businessobject-list",context:{element:e,currentObject:t,propertyName:n,referencePropertyName:i,objectsToAdd:r,objectsToRemove:o}}},oP.setList=function(e,t,n,i){return{cmd:"properties-panel.update-businessobject-list",context:{element:e,currentObject:t,propertyName:n,updatedObjectList:i}}};var sP=GE.domify,cP=PE.getBusinessObject,pP=hw.escapeHTML,uP=function(e,t,n){var i=n,r=i.id,o=t.label||r,a=!!t.disabled&&"function"==typeof t.disabled,s=!!t.hidden&&"function"==typeof t.hidden,c=t.description;return i.html=sP('<input id="camunda-'+pP(r)+'" type="checkbox" name="'+pP(t.modelProperty)+'" '+(a?'data-disable="isDisabled"':"")+(s?'data-show="isHidden"':"")+' /><label for="camunda-'+pP(r)+'" '+(a?'data-disable="isDisabled"':"")+(s?'data-show="isHidden"':"")+">"+pP(o)+"</label>"),c&&i.html.appendChild(Q_(e,c,{show:s&&"isHidden"})),i.get=function(e){var n=cP(e),i={};return i[t.modelProperty]=n.get(t.modelProperty),i},i.set=function(e,n){var i={};return i[t.modelProperty]=!!n[t.modelProperty],aP.updateProperties(e,i)},"function"==typeof t.set&&(i.set=t.set),"function"==typeof t.get&&(i.get=t.get),a&&(i.isDisabled=function(){return t.disabled.apply(i,arguments)}),s&&(i.isHidden=function(){return!t.hidden.apply(i,arguments)}),i.cssClasses=["bpp-checkbox"],i},lP=hw.escapeHTML,dP=GE.domify,hP=GE.query,mP=function(e,t,n){var i=n,r=t.label||i.id,o=t.selectOptions||[{name:"",value:""}],a=t.modelProperty,s=t.emptyParameter,c=!!t.disabled&&"function"==typeof t.disabled,p=!!t.hidden&&"function"==typeof t.hidden,u=t.description;s&&(o=o.concat([{name:"",value:""}])),i.html=dP('<label for="camunda-'+lP(i.id)+'"'+(c?'data-disable="isDisabled" ':"")+(p?'data-show="isHidden" ':"")+">"+lP(r)+'</label><select id="camunda-'+lP(i.id)+'-select" name="'+lP(a)+'"'+(c?'data-disable="isDisabled" ':"")+(p?'data-show="isHidden" ':"")+" data-value></select>");var l=hP("select",i.html);return function(e){return!(!e||"[object Array]"!==Object.prototype.toString.call(e))}(o)&&Qg(o,(function(e){l.appendChild(dP('<option value="'+lP(e.value)+(e.title?'" title="'+lP(e.title):"")+'">'+(e.name?lP(e.name):"")+"</option>"))})),u&&"function"!=typeof t.showCustomInput&&i.html.appendChild(Q_(e,u,{show:p&&"isHidden"})),i.setControlValue=function(e,t,n,i,r){if("function"==typeof o){var a=o(e,n);if(a){for(;n.firstChild;)n.removeChild(n.firstChild);Qg(a,(function(e){var t=dP(function(e){return'<option value="'+e.value+'">'+e.name+"</option>"}(e));n.appendChild(t)}))}}void 0!==r&&(n.value=r)},c&&(i.isDisabled=function(){return t.disabled.apply(i,arguments)}),p&&(i.isHidden=function(){return!t.hidden.apply(i,arguments)}),i.cssClasses=["bpp-dropdown"],i},fP=Object.prototype.hasOwnProperty;var vP=function(e,t,n){var i=e[t];fP.call(e,t)&&ib(i,n)&&(void 0!==n||t in e)||r_(e,t,n)};var yP=function(e,t,n,i){var r=!n;n||(n={});for(var o=-1,a=t.length;++o<a;){var s=t[o],c=i?i(n[s],e[s],s,n,e):void 0;void 0===c&&(c=e[s]),r?r_(n,s,c):vP(n,s,c)}return n};var gP=function(e,t,n){if(!Gg(n))return!1;var i=typeof t;return!!("number"==i?Wg(n)&&Ag(t,n.length):"string"==i&&t in n)&&ib(n[t],e)};var bP=function(e){return Cw((function(t,n){var i=-1,r=n.length,o=r>1?n[r-1]:void 0,a=r>2?n[2]:void 0;for(o=e.length>3&&"function"==typeof o?(r--,o):void 0,a&&gP(n[0],n[1],a)&&(o=r<3?void 0:o,r=1),t=Object(t);++i<r;){var s=n[i];s&&e(t,s,i,o)}return t}))},xP=Object.prototype.hasOwnProperty,EP=bP((function(e,t){if(Vg(t)||Wg(t))yP(t,Kg(t),e);else for(var n in t)xP.call(t,n)&&vP(e,n,t[n])}));var wP=function(e){return function(t,n,i){var r=Object(t);if(!Wg(t)){var o=EE(n);t=Kg(t),n=function(e){return o(r[e],e,r)}}var a=e(t,n,i);return a>-1?r[o?t[a]:a]:void 0}},_P=1/0;var PP=function(e){return e?(e=Qw(e))===_P||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0};var SP=function(e){var t=PP(e),n=t%1;return t==t?n?t-n:t:0},OP=Math.max;var CP=wP((function(e,t,n){var i=null==e?0:e.length;if(!i)return-1;var r=null==n?0:SP(n);return r<0&&(r=OP(i+r,0)),Tw(e,EE(t),r)})),TP=GE.domify,AP=GE.query,RP=hw.escapeHTML,kP=function(e,t){var n=t.selectOptions,i=t.modelProperty,r=t.customValue||"custom",o=t.customName||"custom "+i,a=t.description,s=EP({},t);s.showCustomInput=function(e,n){var i=AP('[data-entry="'+t.id+'"] select',n.parentNode);return!!i&&i.value===r},s.get=function(e,o){var a=t.get(e,o),s={};return function(e){return void 0!==e[i]&&!CP(n,(function(t){return e[i]===t.value}))}(a)?(s[i]=r,s["custom-"+i]=a[i],s):(s[i]=a[i]||"",s)},s.set=function(e,n,o){var a={};return n[i]===r?a[i]=n["custom-"+i]||"":t.emptyParameter&&""===n[i]?a[i]=void 0:a[i]=n[i],t.set(e,a,o)},s.selectOptions.push({name:o,value:r});var c=EP({},mP(e,s,s)),p=document.createDocumentFragment();return p.appendChild(c.html),c.html=p,c.html.appendChild(TP('<div class="bpp-field-wrapper bpp-combo-input" data-show="showCustomInput"><input id="camunda-'+RP(t.id)+'-input" type="text" name="custom-'+RP(i)+'" /></div>')),a&&c.html.appendChild(Q_(e,a,{show:"showCustomInput"})),c},jP=GE.domify,MP=hw.escapeHTML,DP=function(e,t,n){var i=n,r=t.label||i.id,o=!!t.show&&"function"==typeof t.show,a=t.description;return i.html=jP('<label for="camunda-'+MP(i.id)+'" '+(o?'data-show="isShown"':"")+">"+r+'</label><div class="bpp-field-wrapper" '+(o?'data-show="isShown"':"")+'><div contenteditable="true" id="camunda-'+MP(i.id)+'" name="'+MP(t.modelProperty)+'" /></div>'),a&&i.html.appendChild(Q_(e,a,{show:o&&"isShown"})),o&&(i.isShown=function(){return t.show.apply(i,arguments)}),i.cssClasses=["bpp-textbox"],i},BP=function(e,t,n){var i=t.modelProperty;n.get=function(e,n){var r=this.__lastInvalidValue;delete this.__lastInvalidValue;var o={};return o[i]=void 0!==r?r:t.getProperty(e,n),o},n.set=function(e,n,o){var a=r.apply(this,[e,n,o]),s=n[i];if(a&&a[i])return this.__lastInvalidValue=s,t.setProperty(e,{},o);var c={};return c[i]=s,t.setProperty(e,c,o)};var r=n.validate=function(e,n,r){var o=n[i]||this.__lastInvalidValue,a={};return a[i]=o,t.validate(e,a,r)};return rP(e,t,n)},IP=hw.escapeHTML,NP=GE.query,LP=GE.attr,FP=GE.closest,VP=GE.domify,$P='<div class="bpp-field-wrapper bpp-table-row">';function zP(e,t){var n=$P;return n+=function(e,t){var n=e.length,i="";return Qg(e,(function(e,r){i+='<input class="bpp-table-row-columns-'+n+" "+(t?"bpp-table-row-removable":"")+'" id="camunda-table-row-cell-input-value-'+r+'"type="text" name="'+IP(e)+'" />'})),i}(e,t),n+=t?'<button class="action-button clear" data-action="deleteElement"><span>X</span></button>':"",n+="</div>"}function qP(e){var t=$P;return t+=function(e){var t=e.length,n="";return Qg(e,(function(e){n+='<label class="bpp-table-row-columns-'+t+'">'+IP(e)+"</label>"})),n}(e),t+="</div>"}function UP(e,t,n,i,r){return fw(n,(function(n,o){return!function(e,t,n,i,r,o){if(n&&!i)return!1;return Kg(n).concat(Kg(i)).every((function(a){var s=n[a]||void 0,c=i[a]||void 0;return!r(e,t,a,o)||s===c}))}(e,t,n,i[o],r,o)}))}function GP(e){return FP(e,"[data-entry]",!0)}function HP(e){return NP("div[data-list-entry-container]",e)}var WP=function(e,t){var n=t.id,i=t.modelProperties,r=t.labels,o=t.description,a=qP(r),s=t.getElements,c=t.removeElement,p="function"==typeof c,u=t.addElement,l="function"==typeof u,d=t.addLabel||"Add Value",h=t.updateElement,m="function"==typeof h,f=t.editable||function(){return!0},v=t.setControlValue,y=t.show,g="function"==typeof y,b=function(e,t){return function(e,t){return(e||[]).map((function(e){var n={};return Qg(t,(function(t){n[t]=e[t]||""})),n}))}(s(e,t),i)},x=VP((l?'<div class="bpp-table-add-row" '+(g?'data-show="show"':"")+"><label>"+IP(d)+'</label><button class="action-button add" data-action="addElement"><span>+</span></button></div>':"")+'<div class="bpp-table" data-show="showTable"><div class="bpp-field-wrapper bpp-table-row">'+a+"</div><div data-list-entry-container></div></div>");o&&x.appendChild(Q_(e,o,{show:"showTable"}));var E={id:n,html:x,get:function(e,t){var n=b(e,t,this.__invalidValues),r=this.__invalidValues;return delete this.__invalidValues,Qg(r,(function(e,t){var r=n[t];Qg(i,(function(t){r[t]=e[t]}))})),n},set:function(e,n,i){var r=this.__action||{};if(delete this.__action,"delete-element"===r.id)return c(e,i,r.idx);if("add-element"===r.id)return u(e,i);if(m){var o=[],a=n;"function"!=typeof t.validate&&(a=UP(e,i,n,b(e,i),f));var s=this;return Qg(a,(function(r){var a,c=n.indexOf(r);if("function"==typeof t.validate&&(a=t.validate(e,r,i,c)),a)s.__invalidValues=s.__invalidValues||{},s.__invalidValues[c]=r,o.push(aP.updateProperties(e,{}));else{var p=h(e,r,i,c);p&&o.push(p)}})),o}},createListEntryTemplate:function(e,t,n){return zP(i,p)},addElement:function(e,t,n,r){var o=VP(zP(i,p));return HP(t).appendChild(o),this.__action={id:"add-element"},!0},deleteElement:function(e,t,n,i){var r=HP(t),o=n.delegateTarget.parentNode,a=parseInt(LP(o,"data-index"),10);return r.removeChild(o),this.__action={id:"delete-element",idx:a},!0},editable:function(e,t,n,i,r,o){var a=FP(t,"[data-entry]");return f(e,a,i,o)},show:function(e,t,n,i){return t=GP(t),y(e,t,n,i)},showTable:function(e,t,n,i){t=GP(t);var r=b(e,t);return r&&r.length&&(!g||y(e,t,n,i))},validateListItem:function(e,n,i,r){if("function"==typeof t.validate)return t.validate(e,n,i,r)}};return v&&(E.setControlValue=function(e,t,n,i,r,o){var a,s=GP(t),c=LP(n,"readonly"),p=n.value;void 0===r&&(r=""),c&&p===r||(document.activeElement===n&&(a=h_(function(e){return{start:e.selectionStart,end:e.selectionEnd}}(n),p,r)),v(e,s,n,i,r,o),a&&function(e,t){e.selectionStart=t.start,e.selectionEnd=t.end}(n,a))}),E},KP=function(e){return{id:e.id,html:'<label data-value="label" data-show="showLabel" class="entry-label'+(e.divider?" divider":"")+'"></label>',get:function(t,n){return"function"==typeof e.get?e.get(t,n):{label:e.labelText}},showLabel:function(t,n){return"function"!=typeof e.showLabel||e.showLabel(t,n)}}},XP=Ox&&new Ox,YP=XP?function(e,t){return XP.set(e,t),e}:Jg;var JP=function(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=tb(e.prototype),i=e.apply(n,t);return Gg(i)?i:n}};var ZP=function(e,t,n){var i=1&t,r=JP(e);return function t(){var o=this&&this!==cg&&this instanceof t?r:e;return o.apply(i?n:this,arguments)}},QP=Math.max;var eS=function(e,t,n,i){for(var r=-1,o=e.length,a=n.length,s=-1,c=t.length,p=QP(o-a,0),u=Array(c+p),l=!i;++s<c;)u[s]=t[s];for(;++r<a;)(l||r<o)&&(u[n[r]]=e[r]);for(;p--;)u[s++]=e[r++];return u},tS=Math.max;var nS=function(e,t,n,i){for(var r=-1,o=e.length,a=-1,s=n.length,c=-1,p=t.length,u=tS(o-s,0),l=Array(u+p),d=!i;++r<u;)l[r]=e[r];for(var h=r;++c<p;)l[h+c]=t[c];for(;++a<s;)(d||r<o)&&(l[h+n[a]]=e[r++]);return l};var iS=function(e,t){for(var n=e.length,i=0;n--;)e[n]===t&&++i;return i};var rS=function(){};function oS(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}oS.prototype=tb(rS.prototype),oS.prototype.constructor=oS;var aS=oS,sS=XP?function(e){return XP.get(e)}:Lw,cS={},pS=Object.prototype.hasOwnProperty;var uS=function(e){for(var t=e.name+"",n=cS[t],i=pS.call(cS,t)?n.length:0;i--;){var r=n[i],o=r.func;if(null==o||o==e)return r.name}return t};function lS(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}lS.prototype=tb(rS.prototype),lS.prototype.constructor=lS;var dS=lS;var hS=function(e,t){var n=-1,i=e.length;for(t||(t=Array(i));++n<i;)t[n]=e[n];return t};var mS=function(e){if(e instanceof aS)return e.clone();var t=new dS(e.__wrapped__,e.__chain__);return t.__actions__=hS(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t},fS=Object.prototype.hasOwnProperty;function vS(e){if(bg(e)&&!Sg(e)&&!(e instanceof aS)){if(e instanceof dS)return e;if(fS.call(e,"__wrapped__"))return mS(e)}return new dS(e)}vS.prototype=rS.prototype,vS.prototype.constructor=vS;var yS=vS;var gS=function(e){var t=uS(e),n=yS[t];if("function"!=typeof n||!(t in aS.prototype))return!1;if(e===n)return!0;var i=sS(n);return!!i&&e===i[0]},bS=Sw(YP),xS=/\{\n\/\* \[wrapped with (.+)\] \*/,ES=/,? & /;var wS=function(e){var t=e.match(xS);return t?t[1].split(ES):[]},_S=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;var PS=function(e,t){var n=t.length;if(!n)return e;var i=n-1;return t[i]=(n>1?"& ":"")+t[i],t=t.join(n>2?", ":" "),e.replace(_S,"{\n/* [wrapped with "+t+"] */\n")},SS=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]];var OS=function(e,t){return ig(SS,(function(n){var i="_."+n[0];t&n[1]&&!jw(e,i)&&e.push(i)})),e.sort()};var CS=function(e,t,n){var i=t+"";return Ow(e,PS(i,OS(wS(i),n)))};var TS=function(e,t,n,i,r,o,a,s,c,p){var u=8&t;t|=u?32:64,4&(t&=~(u?64:32))||(t&=-4);var l=[e,t,r,u?o:void 0,u?a:void 0,u?void 0:o,u?void 0:a,s,c,p],d=n.apply(void 0,l);return gS(e)&&bS(d,l),d.placeholder=i,CS(d,e,t)};var AS=function(e){return e.placeholder},RS=Math.min;var kS=function(e,t){for(var n=e.length,i=RS(t.length,n),r=hS(e);i--;){var o=t[i];e[i]=Ag(o,n)?r[o]:void 0}return e},jS="__lodash_placeholder__";var MS=function(e,t){for(var n=-1,i=e.length,r=0,o=[];++n<i;){var a=e[n];a!==t&&a!==jS||(e[n]=jS,o[r++]=n)}return o};var DS=function e(t,n,i,r,o,a,s,c,p,u){var l=128&n,d=1&n,h=2&n,m=24&n,f=512&n,v=h?void 0:JP(t);return function y(){for(var g=arguments.length,b=Array(g),x=g;x--;)b[x]=arguments[x];if(m)var E=AS(y),w=iS(b,E);if(r&&(b=eS(b,r,o,m)),a&&(b=nS(b,a,s,m)),g-=w,m&&g<u){var _=MS(b,E);return TS(t,n,e,y.placeholder,i,b,_,c,p,u-g)}var P=d?i:this,S=h?P[t]:t;return g=b.length,c?b=kS(b,c):f&&g>1&&b.reverse(),l&&p<g&&(b.length=p),this&&this!==cg&&this instanceof y&&(S=v||JP(S)),S.apply(P,b)}};var BS=function(e,t,n){var i=JP(e);return function r(){for(var o=arguments.length,a=Array(o),s=o,c=AS(r);s--;)a[s]=arguments[s];var p=o<3&&a[0]!==c&&a[o-1]!==c?[]:MS(a,c);if((o-=p.length)<n)return TS(e,t,DS,r.placeholder,void 0,a,p,void 0,void 0,n-o);var u=this&&this!==cg&&this instanceof r?i:e;return gw(u,this,a)}};var IS=function(e,t,n,i){var r=1&t,o=JP(e);return function t(){for(var a=-1,s=arguments.length,c=-1,p=i.length,u=Array(p+s),l=this&&this!==cg&&this instanceof t?o:e;++c<p;)u[c]=i[c];for(;s--;)u[c++]=arguments[++a];return gw(l,r?n:this,u)}},NS="__lodash_placeholder__",LS=128,FS=Math.min;var VS=function(e,t){var n=e[1],i=t[1],r=n|i,o=r<131,a=i==LS&&8==n||i==LS&&256==n&&e[7].length<=t[8]||384==i&&t[7].length<=t[8]&&8==n;if(!o&&!a)return e;1&i&&(e[2]=t[2],r|=1&n?0:4);var s=t[3];if(s){var c=e[3];e[3]=c?eS(c,s,t[4]):s,e[4]=c?MS(e[3],NS):t[4]}return(s=t[5])&&(c=e[5],e[5]=c?nS(c,s,t[6]):s,e[6]=c?MS(e[5],NS):t[6]),(s=t[7])&&(e[7]=s),i&LS&&(e[8]=null==e[8]?t[8]:FS(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=r,e},$S=Math.max;var zS=function(e,t,n,i,r,o,a,s){var c=2&t;if(!c&&"function"!=typeof e)throw new TypeError("Expected a function");var p=i?i.length:0;if(p||(t&=-97,i=r=void 0),a=void 0===a?a:$S(SP(a),0),s=void 0===s?s:SP(s),p-=r?r.length:0,64&t){var u=i,l=r;i=r=void 0}var d=c?void 0:sS(e),h=[e,t,n,i,r,u,l,o,a,s];if(d&&VS(h,d),e=h[0],t=h[1],n=h[2],i=h[3],r=h[4],!(s=h[9]=void 0===h[9]?c?0:e.length:$S(h[9]-p,0))&&24&t&&(t&=-25),t&&1!=t)m=8==t||16==t?BS(e,t,s):32!=t&&33!=t||r.length?DS.apply(void 0,h):IS(e,t,n,i);else var m=ZP(e,t,n);return CS((d?YP:bS)(m,h),e,t)},qS=Cw((function(e,t,n){var i=1;if(n.length){var r=MS(n,AS(qS));i|=32}return zS(e,i,t,n,r)}));qS.placeholder={};var US=qS,GS=GE.domify,HS=hw.escapeHTML;var WS=function(e,t){var n=t.id,i=t.buttonLabel||n,r=t.showLink,o=t.handleClick,a=t.description,s=t.label;if(r&&"function"!=typeof r)throw new Error("options.showLink must be a function");if("function"!=typeof o)throw new Error("options.handleClick must be a function");var c={id:n,html:document.createDocumentFragment()};return s&&c.html.appendChild(GS('<label for="camunda-'+HS(n)+'" '+(r?'data-show="showLink" ':"")+">"+HS(s)+"</label>")),c.html.appendChild(GS('<div class="bpp-field-wrapper"><a data-action="handleClick" '+(r?'data-show="showLink" ':"")+'class="bpp-entry-link'+(t.cssClasses?" "+HS(t.cssClasses):"")+'">'+HS(i)+"</a></div>")),a&&c.html.appendChild(Q_(e,a,{show:"showLink"})),c.handleClick=US(o,c),"function"==typeof r&&(c.showLink=function(){return r.apply(c,arguments)}),c},KS=t(W),XS=GE.classes,YS=GE.domify,JS=GE.query,ZS=KS.assign,QS=KS.find,eO=KS.forEach,tO=KS.debounce,nO=hw.escapeHTML,iO="active",rO="#text",oO=function(){},aO=function(e,t,n){var i=n,r=t.label||i.id,o=!!t.show&&"function"==typeof t.show,a=t.description;function s(e,t){var n=sO().range.getBoundingClientRect(),i=t.getBoundingClientRect(),r=e.getBoundingClientRect(),o={"top-left":{x:n.right-r.width,y:n.top-r.height},"top-right":{x:n.right,y:n.top-r.height},"bottom-left":{x:n.right-r.width,y:n.top+15},"bottom-right":{x:n.right,y:n.top+15}},a="";return a=n.top+15+r.height>i.height+i.top?"top-":"bottom-",n.right+r.width>i.width+i.left?a+="left":a+="right",{orientation:a,position:o[a]}}return i.html=YS('<label for="camunda-'+nO(i.id)+'" '+(o?'data-show="isShown"':"")+">"+r+'</label><div class="bpp-field-wrapper" '+(o?'data-show="isShown"':"")+'><div contenteditable="true"id="camunda-'+nO(i.id)+'" name="'+nO(t.modelProperty)+'" data-auto-suggest="suggestItems"data-blur="handleFocusLeave"></div><div class="bpp-autosuggest-list"></div></div>'),a&&JS(".bpp-field-wrapper",i.html).appendChild(Q_(e,a)),o&&(i.isShown=function(){return t.show.apply(i,arguments)}),i.handleFocusLeave=tO((function(e,t){pO(t),cO(t)}),"150"),i.suggestItems=function(e,n,i){var r=i.delegateTarget,o=sO(),a=o.focusNode,c=function(e){return e.startOffset}(o.range),p=t.canSuggest||oO,u=t.getItems;function l(e){var t=e.target.innerText,i=d.index,r=i,o=i+d[0].length;!function(e,t,n){var i=document.createRange(),r=window.getSelection();i.setStart(e,t),i.setEnd(e,n),r.removeAllRanges(),r.addRange(i)}(a,r,o),document.execCommand("insertText",!1,t),pO(n),cO(n)}cO(n);var d=function(e,t){var n=function(e){return function(e,t){var n,i=RegExp(t),r=[];for(;null!==(n=i.exec(e));)r.push(n);return r}(e,/[^\s\r\(\)\,\+\-\*\/\{\}]+/g)}(e.nodeName===rO?e.wholeText:e.innerText);return QS(n,(function(e){var n=e[0],i=e.index,r=i+n.length-1;return i<=t-1&&r>=t-1}))}(a,c)||[];if(d&&p(d,r,a)){var h=u(e,n),m=[],f=d[0];eO(h,(function(e){var t=e.toLowerCase(),n=f&&f.toLowerCase();0===t.indexOf(n)&&m.push(e)})),eO(h,(function(e){var t=e.toLowerCase(e),n=f&&f.toLowerCase();t.indexOf(n)>=1&&m.push(e)})),function(e){var t=JS(".bpp-autosuggest-list",n);if(pO(n),e.length){XS(t).add(iO),eO(e,(function(e){!function(e,t){var n=YS('<div class="bpp-autosuggest-item"></div>');n.innerText=nO(t),e.appendChild(n),n.addEventListener("click",l)}(t,e)}));var i,r,o,a=s(t,document.body).position;i=t,r=a.x,o=a.y,ZS(i.style,{left:r+"px",top:o+"px"})}}(m)}},i.getSuggestionListPosition=s,i.cssClasses=["bpp-autosuggest-textbox"],i};function sO(){var e=document.getSelection();return{range:e.getRangeAt(0),focusNode:e.focusNode}}function cO(e){var t=JS(".bpp-autosuggest-list",e);XS(t).remove(iO)}function pO(e){for(var t=JS(".bpp-autosuggest-list",e);t.firstChild;)t.removeChild(t.firstChild)}var uO=hw.escapeHTML,lO=GE.query;var dO=function(e){var t=e.id,n=e.title||"",i=e.description||"",r=!!e.open||!1,o=e.onToggle||hO,a=e.onRemove,s=e.cssClasses||[],c={id:t,toggle:function(e,t,n,i){var a=!r;p(a,t),o(a,t)},isOpen:function(){return r},set:function(){var e=this._commands;if(e)return delete this._commands,e},setOpen:p,get:function(t,r){if(e.get)return e.get(t,r);return{title:n||"",description:i||""}}};function p(e,t){r=e,t.classList.toggle("bpp-collapsible--collapsed",!e)}return"function"==typeof a&&(c.onRemove=function(e,t,n,i){var r=a(e,t,n,i);if(r)return function(e,t){c._commands=e,lO('input[type="hidden"]',t).value=1}(r,t),!0}),c.html='<div class="bpp-field-wrapper" data-action="toggle"><input name="hidden" type="hidden"><span class="bpp-collapsible__icon"></span><label class="bpp-collapsible__title" data-value="title">'+uO(n)+'</label><label class="bpp-collapsible__description" data-value="description">'+uO(i)+"</label>"+(a?'<button class="bpp-collapsible__remove action-button clear" data-action="onRemove"></button>':"")+"</div>",c.cssClasses=s.concat(r?["bpp-collapsible"]:["bpp-collapsible","bpp-collapsible--collapsed"]),c};function hO(){}var mO=PE.getBusinessObject,fO=hw.escapeHTML,vO=GE.domify,yO=function(e,t,n){var i=n,r=i.id,o=t.label||r,a=!!t.hidden&&"function"==typeof t.hidden,s=t.isOn,c=t.descriptionOn,p=t.descriptionOff,u=t.labelOn,l=t.labelOff;return i.html=document.createDocumentFragment(),i.html.appendChild(vO('<label for="'+fO(r)+'" '+(a?'data-show="shouldShow"':"")+">"+fO(o)+'</label><div class="bpp-field-wrapper"'+(a?'data-show="shouldShow"':"")+'><label class="bpp-toggle-switch__switcher"><input id="'+fO(r)+'" type="checkbox" name="'+fO(t.modelProperty)+'" /><span class="bpp-toggle-switch__slider"></span></label><p class="bpp-toggle-switch__label" data-show="isOn">'+fO(u)+'</p><p class="bpp-toggle-switch__label" data-show="isOff">'+fO(l)+"</p></div>")),c&&i.html.appendChild(Q_(e,c,{show:"isOn"})),p&&i.html.appendChild(Q_(e,p,{show:"isOff"})),i.get=function(e){var n=mO(e),i={};return i[t.modelProperty]=n.get(t.modelProperty),i},i.set=function(e,n){var i={};return i[t.modelProperty]=!!n[t.modelProperty],aP.updateProperties(e,i)},"function"==typeof t.set&&(i.set=t.set),"function"==typeof t.get&&(i.get=t.get),a&&(i.shouldShow=function(){return!t.hidden.apply(i,arguments)}),i.isOn=function(){return!(a&&!i.shouldShow())&&s.apply(i,arguments)},i.isOff=function(){return!(a&&!i.shouldShow())&&!i.isOn()},i.cssClasses=["bpp-toggle-switch"],i},gO=PE.getBusinessObject;function bO(e){if(!e)throw new Error(e+" must be set.");return e}var xO=function(e){return{id:e.id,description:e.description||"",get:e.get||function(t){var n=gO(t),i={},r=bO(e.modelProperty);return i[r]=n.get(r),i},set:e.set||function(t,n){var i={},r=bO(e.modelProperty);return""!==n[r]?i[r]=n[r]:i[r]=void 0,aP.updateProperties(t,i)},validate:e.validate||function(){return{}},html:""}};function EO(){}EO.textField=function(e,t){return rP(e,t,xO(t))},EO.validationAwareTextField=function(e,t){return BP(e,t,xO(t))},EO.checkbox=function(e,t){return uP(e,t,xO(t))},EO.textBox=function(e,t){return DP(e,t,xO(t))},EO.selectBox=function(e,t){return mP(e,t,xO(t))},EO.comboBox=function(e,t){return kP(e,t)},EO.table=function(e,t){return WP(e,t)},EO.label=function(e){return KP(e)},EO.link=function(e,t){return WS(e,t)},EO.autoSuggest=function(e,t){return aO(e,t,xO(t))},EO.collapsible=function(e){return dO(e)},EO.toggleSwitch=function(e,t){return yO(e,t,xO(t))};var wO=EO,_O=PE.is,PO=PE.getBusinessObject,SO={},OO=SO;SO.modifyProcessBusinessObject=function(e,t,n){if(!_O(e,"bpmn:Participant"))return{};var i=PO(e).get("processRef"),r={};return r[t]=n[t],aP.updateBusinessObject(e,i,r)},SO.getProcessBusinessObject=function(e,t){if(!_O(e,"bpmn:Participant"))return{};var n=PO(e).get("processRef"),i={};return i[t]=n.get(t),i};var CO=function(e,t,n){var i=(t=t||{}).id||"name",r=t.label||n("Name"),o=t.modelProperty||"name";return[wO.textBox(n,{id:i,label:r,modelProperty:o,get:t.get,set:t.set})]},TO=PE.is,AO=PE.getBusinessObject,RO=function(e,t,n,i){var r=AO(t),o=i&&i.processIdDescription;if((TO(t,"bpmn:Process")||TO(t,"bpmn:Participant")&&r.get("processRef"))&&TO(t,"bpmn:Participant")){var a=wO.validationAwareTextField(n,{id:"process-id",label:n("Process Id"),description:o&&n(o),modelProperty:"processId"});a.get=function(e){return{processId:OO.getProcessBusinessObject(e,"id").id}},a.set=function(e,t){return OO.modifyProcessBusinessObject(e,"id",{id:t.processId})},a.validate=function(e,t){var i=t.processId,r=AO(e),o=hw.isIdValid(r.processRef,i,n);return o?{processId:o}:{}},e.entries.push(a);var s=CO(0,{id:"process-name",label:n("Process Name")})[0];s.get=function(e){return OO.getProcessBusinessObject(e,"name")},s.set=function(e,t){return OO.modifyProcessBusinessObject(e,"name",t)},e.entries.push(s)}},kO=PE.getBusinessObject,jO=PE.is,MO={},DO=MO;MO.getEventDefinition=function(e,t){var n=kO(e),i=null;return n.eventDefinitions&&Qg(n.eventDefinitions,(function(e){jO(e,t)&&(i=e)})),i},MO.getTimerEventDefinition=function(e){return this.getEventDefinition(e,"bpmn:TimerEventDefinition")},MO.getMessageEventDefinition=function(e){return this.getEventDefinition(e,"bpmn:MessageEventDefinition")},MO.getSignalEventDefinition=function(e){return this.getEventDefinition(e,"bpmn:SignalEventDefinition")},MO.getErrorEventDefinition=function(e){return this.getEventDefinition(e,"bpmn:ErrorEventDefinition")},MO.getEscalationEventDefinition=function(e){return this.getEventDefinition(e,"bpmn:EscalationEventDefinition")},MO.getCompensateEventDefinition=function(e){return this.getEventDefinition(e,"bpmn:CompensateEventDefinition")},MO.getLinkEventDefinition=function(e){return this.getEventDefinition(e,"bpmn:LinkEventDefinition")},MO.getConditionalEventDefinition=function(e){return this.getEventDefinition(e,"bpmn:ConditionalEventDefinition")};var BO=GE.query,IO=GE.domify,NO=GE.attr,LO=hw.escapeHTML,FO="select[name=selectedElement]";var VO=function(e,t,n,i){var r=i.elementName||"",o=i.elementType,a=i.referenceProperty,s=i.newElementIdPrefix||"elem_",c=i.label||"",p=i.description||"",u=[],l=!!i.hidden&&"function"==typeof i.hidden;return u.push({id:i.id||"event-definitions-"+r,description:p,isShown:function(){return l?!i.hidden.apply(t,arguments):!i.hidden},html:'<div class="bpp-row bpp-select" data-show="isShown"><label for="camunda-'+LO(r)+'">'+LO(c)+'</label><div class="bpp-field-wrapper"><select id="camunda-'+LO(r)+'" name="selectedElement" data-value></select><button class="action-button add" id="addElement" data-action="addElement"><span>+</span></button></div></div>',get:function(e,n){hw.updateOptionsDropDown(FO,t,o,n);var i=t.get(a);return{selectedElement:i&&i.id||""}},set:function(e,i){var r=i.selectedElement,s={};if(!r||void 0===r)return s[a]=void 0,aP.updateBusinessObject(e,t,s);var c,p,u,l,d=[],h=(c=t,p=o,u=r,l=hw.findRootElementsByType(c,p),CP(l,(function(e){return e.id===u})));if(!h){var m=hw.getRoot(t);h=RE.createElement(o,{name:r},m,n),d.push(aP.addAndRemoveElementsFromList(e,m,"rootElements",null,[h]))}return s[a]=h,d.push(aP.updateBusinessObject(e,t,s)),d},addElement:function(e,t){var n=hw.nextId(s),i=IO('<option value="'+LO(n)+'"> (id='+LO(n)+")</option>"),r=function(e){return BO(FO,e)}(t);return r.insertBefore(i,r.firstChild),Qg(r,(function(e){e.value===n?NO(e,"selected","selected"):NO(e,"selected",null)})),!0}}),u},$O=function(e,t,n,i,r){var o=r.id||"element-property",a=r.label,s=r.referenceProperty,c=r.modelProperty||"name",p=r.shouldValidate||!1,u=r.description,l=!!r.hidden&&"function"==typeof r.hidden,d=wO.textField(i,{id:o,label:a,modelProperty:c,description:u,get:function(e,n){var i=t.get(s),r={};return r[c]=i&&i.get(c),r},set:function(e,n,i){var r=t.get(s),o={};return o[c]=n[c]||void 0,aP.updateBusinessObject(e,r,o)},hidden:function(e,n){return l&&r.hidden.apply(t,arguments)||!t.get(s)}});return p&&(d.validate=function(e,n,i){if(t.get(s)&&!n[c]){var r={};return r[c]="Must provide a value",r}}),[d]},zO=function(e,t,n,i,r){e.entries=e.entries.concat(VO(0,i,n,{label:r("Global Message referenced"),elementName:"message",elementType:"bpmn:Message",referenceProperty:"messageRef",newElementIdPrefix:"Message_"})),e.entries=e.entries.concat($O(0,i,0,r,{id:"message-element-name",label:r("Global Message Name"),referenceProperty:"messageRef",modelProperty:"name",shouldValidate:!0}))};function qO(e){if(e)return void 0!==e.get("timeDate")?"timeDate":void 0!==e.get("timeCycle")?"timeCycle":void 0!==e.get("timeDuration")?"timeDuration":void 0}function UO(e,t,n){return"function"==typeof e?e(t,n):e}var GO=function(e,t,n,i,r,o){var a=[{value:"timeDate",name:r("Date")},{value:"timeDuration",name:r("Duration")},{value:"timeCycle",name:r("Cycle")}],s=o&&o.idPrefix,c=o&&o.createTimerEventDefinition;e.entries.push(wO.selectBox(r,{id:s+"timer-event-definition-type",label:r("Timer Definition Type"),selectOptions:a,emptyParameter:!0,modelProperty:"timerDefinitionType",get:function(e,t){return{timerDefinitionType:qO(UO(i,e,t))||""}},set:function(e,t,r){var o={timeDuration:void 0,timeDate:void 0,timeCycle:void 0},a=UO(i,e,r),s=t.timerDefinitionType;if(a||"function"!=typeof c||(a=c(e,r)),t.timerDefinitionType){var p,u=qO(a);if(u)p=a.get(u).get("body");o[s]=function(e,t,n){return t=t||void 0,RE.createElement("bpmn:FormalExpression",{body:t},e,n)}(a,p,n)}return aP.updateBusinessObject(e,a,o)},hidden:function(e,t){return void 0===UO(i,e,t)}})),e.entries.push(wO.textField(r,{id:s+"timer-event-definition",label:r("Timer Definition"),modelProperty:"timerDefinition",get:function(e,t){var n=UO(i,e,t),r=qO(n),o=r&&n.get(r);return{timerDefinition:o&&o.get("body")}},set:function(e,t,n){var r=UO(i,e,n),o=qO(r),a=o&&r.get(o);if(a)return aP.updateBusinessObject(e,a,{body:t.timerDefinition||void 0})},validate:function(e,t){var n=UO(i,e,t),o=qO(n),a=o&&n.get(o);if(a&&!a.get("body"))return{timerDefinition:r("Must provide a value")}},hidden:function(e,t){return!qO(UO(i,e,t))}}))},HO=PE.getBusinessObject,WO=PE.is;function KO(e,t){return hw.filterElementsByType(e.flowElements,t)}function XO(e,t){return WO(e,"bpmn:SubProcess")&&!e.triggeredByEvent||WO(e,"bpmn:CallActivity")||function(e,t){var n=e.id;return!!CP(t,(function(e){var t=DO.getCompensateEventDefinition(e),i=e.attachedToRef;return t&&i&&i.id===n}))}(e,t)}function YO(e){var t=function(e){return KO(e,"bpmn:BoundaryEvent")}(e);return fw(function(e){return KO(e,"bpmn:Activity")}(e),(function(e){return XO(e,t)}))}function JO(e){var t=[{value:""}],n=function(e){var t=HO(e).$parent,n=YO(t);return WO(t,"bpmn:SubProcess")&&t.triggeredByEvent&&(t=t.$parent)&&(n=n.concat(YO(t))),n}(e);return Qg(n,(function(e){var n=e.id,i=(e.name?e.name+" ":"")+"(id="+n+")";t.push({value:n,name:i})})),t}var ZO=t(Ur),QO=PE.is,eC=ZO.isEventSubProcess,tC=t(ts),nC=PE.is,iC=tC.isAny,rC=PE.getBusinessObject,oC=function(e,t,n,i,r){Qg(["bpmn:StartEvent","bpmn:EndEvent","bpmn:IntermediateThrowEvent","bpmn:BoundaryEvent","bpmn:IntermediateCatchEvent"],(function(i){if(nC(t,i)){var o=DO.getMessageEventDefinition(t),a=DO.getSignalEventDefinition(t);o&&zO(e,0,n,o,r),a&&function(e,t,n,i,r){e.entries=e.entries.concat(VO(0,i,n,{label:r("Global Signal referenced"),elementName:"signal",elementType:"bpmn:Signal",referenceProperty:"signalRef",newElementIdPrefix:"Signal_"})),e.entries=e.entries.concat($O(0,i,0,r,{id:"signal-element-name",label:r("Global Signal Name"),referenceProperty:"signalRef",modelProperty:"name",shouldValidate:!0}))}(e,0,n,a,r)}})),nC(t,"bpmn:ReceiveTask")&&zO(e,0,n,rC(t),r);Qg(["bpmn:StartEvent","bpmn:BoundaryEvent","bpmn:EndEvent"],(function(i){if(nC(t,i)){var o=DO.getErrorEventDefinition(t);o&&function(e,t,n,i,r){e.entries=e.entries.concat(VO(0,i,n,{label:r("Global Error referenced"),elementName:"error",elementType:"bpmn:Error",referenceProperty:"errorRef",newElementIdPrefix:"Error_"})),e.entries=e.entries.concat($O(0,i,0,r,{id:"error-element-name",label:r("Name"),referenceProperty:"errorRef",modelProperty:"name",shouldValidate:!0})),e.entries=e.entries.concat($O(0,i,0,r,{id:"error-element-code",label:r("Code"),referenceProperty:"errorRef",modelProperty:"errorCode"}))}(e,0,n,o,r)}}));Qg(["bpmn:StartEvent","bpmn:BoundaryEvent","bpmn:IntermediateThrowEvent","bpmn:EndEvent"],(function(i){if(nC(t,i)){var o=nC(t,"bpmn:StartEvent")||nC(t,"bpmn:BoundaryEvent"),a=DO.getEscalationEventDefinition(t);a&&function(e,t,n,i,r,o){e.entries=e.entries.concat(VO(0,i,n,{label:o("Global Escalation referenced"),elementName:"escalation",elementType:"bpmn:Escalation",referenceProperty:"escalationRef",newElementIdPrefix:"Escalation_"})),e.entries=e.entries.concat($O(0,i,0,o,{id:"escalation-element-name",label:o("Global Escalation Name"),referenceProperty:"escalationRef",modelProperty:"name",shouldValidate:!0})),e.entries=e.entries.concat($O(0,i,0,o,{id:"escalation-element-code",label:o("Global Escalation Code"),referenceProperty:"escalationRef",modelProperty:"escalationCode"})),r&&e.entries.push(wO.validationAwareTextField(o,{id:"escalationCodeVariable",label:o("Escalation Code Variable"),modelProperty:"escalationCodeVariable",description:o("Define the name of the variable that will contain the escalation code"),getProperty:function(e){return i.get("camunda:escalationCodeVariable")},setProperty:function(e,t){return""===t.escalationCodeVariable&&(t.escalationCodeVariable=void 0),aP.updateBusinessObject(e,i,t)},validate:function(e,t){var n={},i=t.escalationCodeVariable;return hw.containsSpace(i)&&(n.escalationCodeVariable=o("Escalation code variable must not contain spaces.")),n}}))}(e,0,n,a,o,r)}}));Qg(["bpmn:StartEvent","bpmn:BoundaryEvent","bpmn:IntermediateCatchEvent"],(function(i){if(nC(t,i)){var o=DO.getTimerEventDefinition(t);o&&GO(e,t,n,o,r)}}));Qg(["bpmn:EndEvent","bpmn:IntermediateThrowEvent"],(function(n){if(nC(t,n)){var o=DO.getCompensateEventDefinition(t);o&&function(e,t,n,i,r,o){e.entries.push(wO.checkbox(o,{id:"wait-for-completion",label:o("Wait for Completion"),modelProperty:"waitForCompletion",get:function(e,t){return{waitForCompletion:i.waitForCompletion}},set:function(e,t){return t.waitForCompletion=t.waitForCompletion||!1,aP.updateBusinessObject(e,i,t)}})),e.entries.push(wO.selectBox(o,{id:"activity-ref",label:o("Activity Ref"),selectOptions:JO(t),modelProperty:"activityRef",get:function(e,t){var n=i.activityRef;return{activityRef:(n=n&&n.id)||""}},set:function(e,t){var n=t.activityRef||void 0;return n=n&&HO(r.get(n)),aP.updateBusinessObject(e,i,{activityRef:n})}}))}(e,t,0,o,i,r)}}));if(iC(t,["bpmn:StartEvent","bpmn:BoundaryEvent","bpmn:IntermediateThrowEvent","bpmn:IntermediateCatchEvent"])){var o=DO.getConditionalEventDefinition(t);o&&function(e,t,n,i,r,o){var a=function(e){return function(t){var n=i.get("camunda:"+e),r={};return r[e]=n,r}},s=function(e){return function(t,n){var r={};return r["camunda:"+e]=n[e]||void 0,aP.updateBusinessObject(t,i,r)}};e.entries.push(wO.textField(o,{id:"variableName",label:o("Variable Name"),modelProperty:"variableName",get:a("variableName"),set:s("variableName")})),QO(t,"bpmn:StartEvent")&&!eC(t.parent)||e.entries.push(wO.textField(o,{id:"variableEvents",label:o("Variable Events"),description:o("Specify more than one variable change event as a comma separated list."),modelProperty:"variableEvents",get:a("variableEvents"),set:s("variableEvents")}))}(e,t,0,o,0,r)}},aC=PE.is,sC=PE.getBusinessObject;var cC=function(e,t,n){Qg(["bpmn:IntermediateThrowEvent","bpmn:IntermediateCatchEvent"],(function(i){if(aC(t,i)){var r=function(e){var t=sC(e),n=null;return t.eventDefinitions&&Qg(t.eventDefinitions,(function(e){aC(e,"bpmn:LinkEventDefinition")&&(n=e)})),n}(t);if(r){var o=wO.textField(n,{id:"link-event",label:n("Link Name"),modelProperty:"link-name"});o.get=function(){return{"link-name":r.get("name")}},o.set=function(e,t){var n={name:t["link-name"]};return aP.updateBusinessObject(e,r,n)},e.entries.push(o)}}}))},pC=PE.is,uC=PE.getBusinessObject,lC="text/plain",dC=function(e,t,n,i){var r,o=function(e){return e.find((function(e){return(e.textFormat||lC)===lC}))},a=function(e){return function(t){var n=o(e&&e.get("documentation"));return{documentation:n&&n.text||""}}},s=function(e){return function(t,i){var r=i.documentation,a=o(e&&e.get("documentation"));return a?r?aP.updateBusinessObject(t,a,{text:i.documentation}):aP.removeElementsFromList(t,e,"documentation",null,[a]):r?aP.addElementsTolist(t,e,"documentation",[n.create("bpmn:Documentation",{text:i.documentation})]):void 0}},c=wO.textBox(i,{id:"documentation",label:i("Element Documentation"),modelProperty:"documentation"});if(c.set=s(uC(t)),c.get=a(uC(t)),e.entries.push(c),pC(t,"bpmn:Participant")&&(r=uC(t).processRef)){var p=wO.textBox(i,{id:"process-documentation",label:i("Process Documentation"),modelProperty:"documentation"});p.set=s(r),p.get=a(r),e.entries.push(p)}},hC=PE.getBusinessObject,mC=function(e,t,n,i){i||(i={}),e.entries.push(wO.validationAwareTextField(n,{id:i.id||"id",label:n(i.label||"Id"),description:i.description&&n(i.description),modelProperty:"id",getProperty:function(e){return hC(e).id},setProperty:function(e,t){return e=e.labelTarget||e,aP.updateProperties(e,t)},validate:function(e,t){var i=t.id,r=hC(e),o=hw.isIdValid(r,i,n);return o?{id:o}:{}}}))},fC=t(Pt),vC=fC.add,yC=PE.getBusinessObject,gC={},bC=gC;gC.createCategoryValue=function(e,t){var n=t.create("bpmn:CategoryValue"),i=t.create("bpmn:Category",{categoryValue:[n]});return vC(e.get("rootElements"),i),yC(i).$parent=e,yC(n).$parent=i,n};var xC=bC.createCategoryValue,EC=PE.is,wC=PE.getBusinessObject,_C=function(e,t,n,i,r,o){if(o||(o={}),!EC(t,"bpmn:Collaboration")){var a={id:o.id,label:o.label&&r(o.label)};EC(t,"bpmn:TextAnnotation")?(a.modelProperty="text",a.label=r("Text")):EC(t,"bpmn:Group")&&(a.modelProperty="categoryValue",a.label=r("Category Value"),a.get=function(e){return{categoryValue:(wC(e).categoryValueRef||{}).value}},a.set=function(e,t){var r,o,a,s,c=wC(e);return c.categoryValueRef||(r=c,o=i.getRootElement(),a=wC(o).$parent,s=xC(a,n),r.categoryValueRef=s),{cmd:"element.updateLabel",context:{element:e,newLabel:t.categoryValue}}}),e.entries=e.entries.concat(CO(0,a,r))}},PC=PE.is,SC=PE.getBusinessObject,OC=function(e,t,n){var i=SC(t);if(i&&(PC(t,"bpmn:Process")||PC(t,"bpmn:Participant")&&i.get("processRef"))){var r=wO.checkbox(n,{id:"process-is-executable",label:n("Executable"),modelProperty:"isExecutable"});PC(t,"bpmn:Participant")&&(r.get=function(e){return OO.getProcessBusinessObject(e,"isExecutable")},r.set=function(e,t){return OO.modifyProcessBusinessObject(e,"isExecutable",t)}),e.entries.push(r)}},CC=PE.is;function TC(e,t,n,i,r){var o={id:"general",label:r("General"),entries:[]};mC(o,0,r,function(e){if(CC(e,"bpmn:Participant"))return{id:"participant-id",label:"Participant Id"}}(e)),_C(o,e,n,t,r,function(e){if(CC(e,"bpmn:Participant"))return{id:"participant-name",label:"Participant Name"}}(e)),RO(o,e,r),OC(o,e,r);var a={id:"details",label:r("Details"),entries:[]};cC(a,e,r),oC(a,e,n,i,r);var s={id:"documentation",label:r("Documentation"),entries:[]};return dC(s,e,n,r),[o,a,s]}function AC(e,t,n,i,r){K_.call(this,e),this.getTabs=function(e){return[{id:"general",label:r("General"),groups:TC(e,t,n,i,r)}]}}AC.$inject=["eventBus","canvas","bpmnFactory","elementRegistry","translate"],i(AC,K_);var RC={__init__:["propertiesProvider"],propertiesProvider:["type",AC]};function kC(e={}){this._injectOriginModule(e),_y.call(this,e)}i(kC,_y),kC.prototype._injectOriginModule=function(e){this._modules=[].concat(this._modules,e&&e.disableAdjustOrigin?Vy:qy)},kC.prototype._extensionModules=[By,Gy,Jy,ng,H_,RC],kC.prototype._modules=[].concat(_y.prototype._modules,kC.prototype._extensionModules);class jC extends as{constructor(e,t){super(e),this.postExecute(["element.updateProperties","properties-panel.update-businessobject"],5e3,(function(e){const{element:n,oldProperties:i,properties:r}=e,o=Br(n).get("extensionElements");if(Dr(n,"camunda:ExternalCapable")&&o&&function(e,t){const{"camunda:type":n}=e,{"camunda:type":i}=t;return"external"===n&&"external"!==i}(i,r)){const e=o.get("values").filter((e=>!Dr(e,"camunda:ErrorEventDefinition")));t.updateModdleProperties(n,o,{values:e})}}),!0)}}jC.$inject=["eventBus","modeling"];class MC extends as{constructor(e,t){super(e),this.postExecute(["element.updateProperties","properties-panel.update-businessobject"],5e3,(function(e){const{element:n,properties:i}=e,r=Br(n),o=r.extensionElements;if(!Dr(n,"camunda:AsyncCapable")||!1!==i["camunda:asyncBefore"]&&!1!==i["camunda:asyncAfter"]||!o||!o.get("values").length||!o.get("values").find((e=>Dr(e,"camunda:FailedJobRetryTimeCycle")))||function(e){return function(e,t){const n=Br(e);return(n.get("eventDefinitions")||[]).find((e=>Dr(e,t)))}(e,"bpmn:TimerEventDefinition")}(n)||function(e){return!(!e.get("camunda:asyncBefore")&&!e.get("camunda:async"))}(r)||function(e){return!!e.get("camunda:asyncAfter")}(r))return;const a=o.get("values").filter((e=>!Dr(e,"camunda:FailedJobRetryTimeCycle")));t.updateModdleProperties(n,o,{values:a})}),!0)}}MC.$inject=["eventBus","modeling"];class DC extends as{constructor(e){super(e),this.preExecute(["element.updateProperties","properties-panel.update-businessobject"],5e3,(function(e){const{element:t,properties:n}=e,i=Br(t);!Dr(t,"camunda:AsyncCapable")||!1!==n["camunda:asyncBefore"]&&!1!==n["camunda:asyncAfter"]||function(e){return!!e.get("camunda:exclusive")}(i)||function(e){return!!e.get("camunda:asyncAfter")}(i)&&!1!==n["camunda:asyncAfter"]||function(e){return!(!e.get("camunda:asyncBefore")&&!e.get("camunda:async"))}(i)&&!1!==n["camunda:asyncBefore"]||!0===n["camunda:asyncBefore"]||!0===n["camunda:asyncAfter"]||(n["camunda:exclusive"]=!0)}),!0)}}DC.$inject=["eventBus"];class BC extends as{constructor(e,t){super(e),this.postExecute(["element.updateProperties","element.updateModdleProperties","properties-panel.update-businessobject-list"],(function(e){const{element:n,oldProperties:i,propertyName:r}=e,o=Br(n),a=function(e){const t=e.get("extensionElements");if(t)return t.get("values").find((e=>Dr(e,"camunda:InputOutput")))}(o),s=o.get("extensionElements");if((i||"values"!==r)&&a&&function(e){const t=function(e){return e.get("inputParameters")}(e),n=function(e){return e.get("outputParameters")}(e);return!t.length&&!n.length}(a)){const e=s.get("values").filter((function(e){return e!==a}));t.updateModdleProperties(n,s,{values:e})}}),!0)}}BC.$inject=["eventBus","modeling"];class IC extends as{constructor(e){super(e),this.preExecute(["element.updateProperties","properties-panel.update-businessobject"],5e3,(function(e){const{element:t,properties:n}=e;var i;Dr(t,"camunda:DmnCapable")&&b(n,"camunda:resultVariable")&&(null==(i=n["camunda:resultVariable"])||""===i)&&(n["camunda:mapDecisionResult"]=null)}),!0)}}IC.$inject=["eventBus"];class NC extends as{constructor(e){super(e),this.preExecute(["element.updateProperties","element.updateModdleProperties","properties-panel.update-businessobject"],(function(e){const{properties:t}=e,n=e.moddleElement||e.businessObject||e.element.businessObject;b(t,"camunda:formKey")?Object.assign(t,{"camunda:formRef":void 0,"camunda:formRefBinding":void 0,"camunda:formRefVersion":void 0}):b(t,"camunda:formRef")&&(Object.assign(t,{"camunda:formKey":void 0}),u(t["camunda:formRef"])&&Object.assign(t,{"camunda:formRefBinding":void 0,"camunda:formRefVersion":void 0}),!b(t,"camunda:formRefBinding")&&u(n.get("camunda:formRefBinding"))&&Object.assign(t,{"camunda:formRefBinding":"latest"})),b(t,"camunda:formRefBinding")&&"version"!==t["camunda:formRefBinding"]&&Object.assign(t,{"camunda:formRefVersion":void 0})}),!0)}}NC.$inject=["eventBus"];class LC extends as{constructor(e,t){super(e),this.preExecute(["element.updateModdleProperties","properties-panel.update-businessobject"],(function(e){let{businessObject:t,moddleElement:n,properties:i}=e;t=t||n,Dr(t,"camunda:FormField")&&"camunda:type"in i&&"enum"!==i["camunda:type"]&&(i["camunda:values"]=void 0)}),!0),this.preExecute(["element.updateModdleProperties","properties-panel.update-businessobject"],(function(e){let{businessObject:n,element:i,moddleElement:r,properties:o}=e;if(n=n||r,!Dr(n,"camunda:FormField"))return;const a=function(e){const t=Br(e).get("extensionElements");if(!t)return;return t.get("values").find((e=>Dr(e,"camunda:FormData")))}(i);"camunda:id"in o&&function(e,t){return e.get("camunda:id")===t.get("camunda:businessKey")}(n,a)&&t.updateModdleProperties(i,a,{"camunda:businessKey":o["camunda:id"]})}),!0),this.postExecute("properties-panel.update-businessobject-list",(function(e){const{currentObject:n,element:i,propertyName:r,objectsToRemove:o=[]}=e;if(!Dr(n,"camunda:FormData")||"fields"!==r||!o.length)return;const a=n.get("camunda:businessKey");a&&o.forEach((e=>{Dr(e,"camunda:FormField")&&e.get("camunda:id")===a&&t.updateModdleProperties(i,n,{"camunda:businessKey":void 0})}))}),!0)}}LC.$inject=["eventBus","modeling"];var FC={__depends__:[{__init__:["deleteErrorEventDefinitionBehavior","deleteRetryTimeCycleBehavior","updateCamundaExclusiveBehavior","updateResultVariableBehavior","updateInputOutputBehavior","userTaskFormsBehavior","userTaskGeneratedFormsBehavior"],deleteErrorEventDefinitionBehavior:["type",jC],deleteRetryTimeCycleBehavior:["type",MC],updateCamundaExclusiveBehavior:["type",DC],updateResultVariableBehavior:["type",IC],updateInputOutputBehavior:["type",BC],userTaskFormsBehavior:["type",NC],userTaskGeneratedFormsBehavior:["type",LC]}]},VC=PE.getBusinessObject,$C=PE.is,zC=tC.isAny,qC="camunda:modelerTemplate",UC="camunda:modelerTemplateVersion";function GC(e,t){var n=HC(e);return n?n.get("values").filter((function(e){return zC(e,t)})):[]}function HC(e){var t=VC(e);return $C(t,"bpmn:ExtensionElements")?t:t.extensionElements}function WC(e,t){if("camunda:in"===t.type&&t.target)return e.target===t.target;if("camunda:out"===t.type){if(t.source)return e.source===t.source;if(t.sourceExpression)return e.sourceExpression===t.sourceExpression}return t.variables?"all"===e.variables&&("local"!==t.variables||e.local):void 0}var KC={TEMPLATE_ID_ATTR:"camunda:modelerTemplate",TEMPLATE_VERSION_ATTR:"camunda:modelerTemplateVersion",getTemplateId:function(e){var t=VC(e);if(t)return t.get(qC)},getTemplateVersion:function(e){var t=VC(e);if(t)return t.get(UC)},findExtension:function(e,t){var n,i=VC(e);return(n=$C(i,"bpmn:ExtensionElements")?i:i.extensionElements)?CP(n.get("values"),(function(e){return $C(e,t)})):null},findExtensions:GC,findCamundaInOut:function(e,t){var n,i=HC(e);if(i)return"camunda:in"===t.type?n=function(e){return $C(e,"camunda:In")&&WC(e,t)}:"camunda:out"===t.type?n=function(e){return $C(e,"camunda:Out")&&WC(e,t)}:"camunda:in:businessKey"===t.type&&(n=function(e){return $C(e,"camunda:In")&&"businessKey"in e}),CP(i.get("values"),n)},findCamundaProperty:function(e,t){return CP(e.get("values"),(function(e){return e.name===t.name}))},findInputParameter:function(e,t){var n=e.get("inputParameters");return CP(n,(function(e){return e.name===t.name}))},findOutputParameter:function(e,t){var n=e.get("outputParameters");return CP(n,(function(e){var n=e.value;if(!t.scriptFormat)return n===t.source;var i=e.definition;return!(!i||t.scriptFormat!==i.scriptFormat)&&i.value===t.source}))},findCamundaErrorEventDefinition:function(e,t){var n,i=GC(e,["camunda:ErrorEventDefinition"]);return CP(i,(function(e){if(n=e.errorRef)return 0==n.id.indexOf("Error_"+t)}))}},XC=KS.assign,YC=KS.forEach,JC=KS.keys,ZC=KS.isObject,QC=function(e){var t=[];return ZC(e)?(YC(JC(e),(function(n){t.push(XC({type:n},e[n]))})),t):e},eT=hw.nextId;function tT(e,t){var n={};if("camunda:in"===e.type)if(!e.target||e.expression||e.variables)if(e.target&&!0===e.expression&&!e.variables)n.target=e.target,n.sourceExpression=t;else if(e.target||e.expression||"local"!==e.variables)if(e.target&&!e.expression&&"local"===e.variables)n.local=!0,n.source=t,n.target=e.target;else if(e.target&&e.expression&&"local"===e.variables)n.local=!0,n.sourceExpression=t,n.target=e.target;else{if(e.target||e.expression||"all"!==e.variables)throw new Error("invalid configuration for camunda:in element template binding");n.variables="all"}else n.local=!0,n.variables="all";else n.target=e.target,n.source=t;if("camunda:out"===e.type)if(!e.source||e.sourceExpression||e.variables)if(e.source||!e.sourceExpression||e.variables)if(e.source||e.sourceExpression||"all"!==e.variables)if(e.source&&!e.sourceExpression&&"local"===e.variables)n.local=!0,n.source=e.source,n.target=t;else if(!e.source&&e.sourceExpression&&"local"===e.variables)n.local=!0,n.sourceExpression=e.sourceExpression,n.target=t;else{if(e.source||e.sourceExpression||"local"!==e.variables)throw new Error("invalid configuration for camunda:out element template binding");n.local=!0,n.variables="all"}else n.variables="all";else n.target=t,n.sourceExpression=e.sourceExpression;else n.target=t,n.source=e.source;return n}var nT={createInputParameter:function(e,t,n){var i,r,o=e.scriptFormat;return o?r=n.create("camunda:Script",{scriptFormat:o,value:t}):i=t,n.create("camunda:InputParameter",{name:e.name,value:i,definition:r})},createOutputParameter:function(e,t,n){var i,r,o=e.scriptFormat;return o?r=n.create("camunda:Script",{scriptFormat:o,value:e.source}):i=e.source,n.create("camunda:OutputParameter",{name:t,value:i,definition:r})},createCamundaProperty:function(e,t,n){return n.create("camunda:Property",{name:e.name,value:t||""})},createCamundaIn:function(e,t,n){var i=tT(e,t);return n.create("camunda:In",i)},createCamundaInWithBusinessKey:function(e,t,n){return n.create("camunda:In",{businessKey:t})},createCamundaOut:function(e,t,n){var i=tT(e,t);return n.create("camunda:Out",i)},createCamundaExecutionListenerScript:function(e,t,n){var i,r,o=e.scriptFormat;return o?r=n.create("camunda:Script",{scriptFormat:o,value:t}):i=t,n.create("camunda:ExecutionListener",{event:e.event,value:i,script:r})},createCamundaFieldInjection:function(e,t,n){var i=EP({},{string:void 0,expression:void 0,name:void 0});return e.expression?i.expression=t:i.string=t,i.name=e.name,n.create("camunda:Field",i)},createCamundaErrorEventDefinition:function(e,t,n,i,r){var o=n,a=t,s=r.create("camunda:ErrorEventDefinition",{expression:a,errorRef:o});return s.$parent=i,s},createError:function(e,t,n){var i=n.create("bpmn:Error",{id:eT("Error_"+e+"_")});return i.$parent=t,i}};var iT=function(e){return"string"==typeof e||!Sg(e)&&bg(e)&&"[object String]"==gg(e)};var rT=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0};var oT=function(e,t,n){var i=-1,r=e.length;t<0&&(t=-t>r?0:r+t),(n=n>r?r:n)<0&&(n+=r),r=t>n?0:n-t>>>0,t>>>=0;for(var o=Array(r);++i<r;)o[i]=e[i+t];return o};var aT=function(e,t){return t.length<2?e:dE(e,oT(t,0,-1))};var sT=function(e,t){return t=uE(t,e),null==(e=aT(e,t))||delete e[lE(rT(t))]},cT=Array.prototype.splice;var pT=function(e,t){for(var n=e?t.length:0,i=n-1;n--;){var r=t[n];if(n==i||r!==o){var o=r;Ag(r)?cT.call(e,r,1):sT(e,r)}}return e};var uT=function(e,t){var n=[];if(!e||!e.length)return n;var i=-1,r=[],o=e.length;for(t=EE(t);++i<o;){var a=e[i];t(a,i,e)&&(n.push(a),r.push(i))}return pT(e,r),n},lT=KC.findExtension,dT=KC.findExtensions,hT=KC.findCamundaErrorEventDefinition,mT=nT.createCamundaExecutionListenerScript,fT=nT.createCamundaFieldInjection,vT=nT.createCamundaIn,yT=nT.createCamundaInWithBusinessKey,gT=nT.createCamundaOut,bT=nT.createCamundaProperty,xT=nT.createInputParameter,ET=nT.createOutputParameter,wT=nT.createCamundaErrorEventDefinition,_T=nT.createError,PT=hw.getRoot,ST=PE.getBusinessObject,OT=PE.is,CT=tC.isAny,TT=["camunda:class","camunda:delegateExpression","camunda:expression"];function AT(e,t,n){this._bpmnFactory=e,this._commandStack=t,this._modeling=n}AT.$inject=["bpmnFactory","commandStack","modeling"];var RT=AT;function kT(e,t){var n,i=ST(e),r=t.binding,o=r.type;if("camunda:field"===o){if(n=CT(i,["camunda:ExecutionListener","camunda:TaskListener"])?"camunda:fields":"bpmn:values",!i||!i.get(n)||!i.get(n).length)return;return CP(i.get(n),(function(e){return e.get("camunda:name")===r.name}))}if("camunda:in"===o)return CP(i.get("values"),(function(e){return e.get("target")===r.target}));if("camunda:in:businessKey"===o)return CP(i.get("values"),(function(e){return iT(e.get("businessKey"))}));if("camunda:out"===o)return CP(i.get("values"),(function(e){return e.get("source")===r.source||e.get("sourceExpression")||r.sourceExpression}));if("camunda:inputParameter"===o||"camunda:outputParameter"===o){if(OT(i,"camunda:Connector")){if(!(i=i.get("camunda:inputOutput")))return}else if(!(i=lT(i,"camunda:InputOutput")))return;return"camunda:inputParameter"===o?CP(i.get("camunda:inputParameters"),(function(e){return e.get("camunda:name")===r.name})):CP(i.get("camunda:outputParameters"),(function(e){var t;return r.scriptFormat?(t=e.get("camunda:definition"))&&t.get("camunda:value")===r.source:e.get("camunda:value")===r.source}))}if("camunda:property"===o){if(!i||!i.get("values")||!i.get("values").length)return;if(!(i=lT(i,"camunda:Properties")))return;return CP(i.get("values"),(function(e){return e.get("camunda:name")===r.name}))}return"camunda:errorEventDefinition"===o?hT(e,r.errorRef):void 0}function jT(e,t){if(e){var n=e.properties,i=t.binding,r=i.name,o=i.type;return"property"===o?CP(n,(function(e){var t=e.binding,n=t.name;return"property"===t.type&&n===r})):"camunda:field"===o?CP(n,(function(e){var t=e.binding,n=t.name;return"camunda:field"===t.type&&n===r})):"camunda:in"===o?CP(n,(function(e){var t=e.binding;if("camunda:in"===t.type&&!(t.expression&&!i.expression||!t.expression&&i.expression))return t.target===i.target})):"camunda:in:businessKey"===o?CP(n,(function(e){return"camunda:in:businessKey"===e.binding.type})):"camunda:out"===o?CP(n,(function(e){var t=e.binding;return"camunda:out"===t.type&&(t.source===i.source||t.sourceExpression===i.sourceExpression)})):"camunda:inputParameter"===o?CP(n,(function(e){var t=e.binding,n=t.name;if("camunda:inputParameter"===t.type)return n===r&&t.scriptFormat===i.scriptFormat})):"camunda:outputParameter"===o?CP(n,(function(e){var t=e.binding;if("camunda:outputParameter"===t.type)return t.source===i.source&&t.scriptFormat===i.scriptFormat})):"camunda:property"===o?CP(n,(function(e){var t=e.binding,n=t.name;return"camunda:property"===t.type&&n===r})):"camunda:errorEventDefinition"===o?CP(n,(function(e){var t=i.errorRef,n=e.binding,r=n.errorRef;return"camunda:errorEventDefinition"===n.type&&r===t})):void 0}}function MT(e){return["bpmn:Error"].includes(e)}function DT(e,t){var n,i=ST(e),r=t.binding,o=r.name,a=r.type,s=t.value;return"property"===a?"conditionExpression"===o?i.get("bpmn:conditionExpression").get("bpmn:body")!==s:i.get(o)!==s:"camunda:field"===a?i.get("camunda:string")!==s:"camunda:in"===a?r.expression?i.get("sourceExpression")!==s:i.get("camunda:source")!==s:"camunda:in:businessKey"===a?i.get("camunda:businessKey")!==s:"camunda:out"===a?i.get("camunda:target")!==s:"camunda:inputParameter"===a?r.scriptFormat?(n=i.get("camunda:definition"))&&n.get("camunda:value")!==s:i.get("camunda:value")!==s:"camunda:outputParameter"===a?i.get("camunda:name")!==s:"camunda:property"===a?i.get("camunda:value")!==s:"camunda:errorEventDefinition"===a?i.get("expression")!==s:void 0}function BT(e,t,n){e.registerHandler("propertiesPanel.camunda.changeTemplate",RT),n.on(["commandStack.shape.create.postExecuted"],(function(n){NT(n.context.shape,t,e)})),n.on(["commandStack.connection.create.postExecuted"],(function(n){NT(n.context.connection,t,e)}))}AT.prototype.preExecute=function(e){var t=e.element,n=e.newTemplate,i=e.oldTemplate,r=this;this._updateCamundaModelerTemplate(t,n),n&&(this._updateProperties(t,i,n),this._updateCamundaExecutionListenerProperties(t,n),this._updateCamundaFieldProperties(t,i,n),this._updateCamundaInOutProperties(t,i,n),this._updateCamundaInputOutputParameterProperties(t,i,n),this._updateCamundaPropertyProperties(t,i,n),this._updateCamundaErrorEventDefinitionProperties(t,i,n),Qg(QC(n.scopes),(function(e){r._updateScopeProperties(t,i,e,n)})))},AT.prototype._getOrCreateExtensionElements=function(e){var t=this._bpmnFactory,n=this._modeling,i=ST(e),r=i.get("extensionElements");return r||((r=t.create("bpmn:ExtensionElements",{values:[]})).$parent=i,n.updateProperties(e,{extensionElements:r})),r},AT.prototype._updateCamundaErrorEventDefinitionProperties=function(e,t,n){var i=this._bpmnFactory,r=this._commandStack,o=n.properties.filter((function(e){return"camunda:errorEventDefinition"===e.binding.type}));if(o.length){var a=this._getOrCreateExtensionElements(e),s=dT(e,["camunda:ErrorEventDefinition"]);o.forEach((function(n){var o=jT(t,n),c=o&&kT(a,o),p=n.binding;if(o&&c)DT(c,o)||r.execute("properties-panel.update-businessobject",{element:e,businessObject:c,properties:{expression:n.value}}),uT(s,c);else{var u=PT(ST(e)),l=_T(p.errorRef,u,i),d=wT(p,n.value,l,a,i);r.execute("properties-panel.update-businessobject-list",{element:e,currentObject:u,propertyName:"rootElements",objectsToAdd:[l],objectsToRemove:[]}),r.execute("properties-panel.update-businessobject-list",{element:e,currentObject:a,propertyName:"values",objectsToAdd:[d],objectsToRemove:[]})}})),s.length&&r.execute("properties-panel.update-businessobject-list",{element:e,currentObject:a,propertyName:"values",objectsToAdd:[],objectsToRemove:s})}},AT.prototype._updateCamundaExecutionListenerProperties=function(e,t){var n=this._bpmnFactory,i=this._commandStack,r=t.properties.filter((function(e){return"camunda:executionListener"===e.binding.type}));if(r.length){var o=this._getOrCreateExtensionElements(e),a=dT(e,["camunda:ExecutionListener"]),s=r.map((function(e){var t=e.binding,i=e.value;return mT(t,i,n)}));i.execute("properties-panel.update-businessobject-list",{element:e,currentObject:o,propertyName:"values",objectsToAdd:s,objectsToRemove:a})}},AT.prototype._updateCamundaFieldProperties=function(e,t,n,i){var r=this._bpmnFactory,o=this._commandStack,a=n.properties.filter((function(e){return"camunda:field"===e.binding.type}));if(a.length){i||(i=this._getOrCreateExtensionElements(e));var s=CT(i,["camunda:ExecutionListener","camunda:TaskListener"])?"fields":"values",c=dT(e,["camunda:Field"]);a.forEach((function(n){var a=jT(t,n),p=a&&kT(i,a),u=n.binding;a&&p?(DT(p,a)||o.execute("properties-panel.update-businessobject",{element:e,businessObject:p,properties:{string:n.value}}),uT(c,p)):o.execute("properties-panel.update-businessobject-list",{element:e,currentObject:i,propertyName:s,objectsToAdd:[fT(u,n.value,r)],objectsToRemove:[]})})),c.length&&o.execute("properties-panel.update-businessobject-list",{element:e,currentObject:i,propertyName:s,objectsToAdd:[],objectsToRemove:c})}},AT.prototype._updateCamundaInOutProperties=function(e,t,n){var i=this._bpmnFactory,r=this._commandStack,o=n.properties.filter((function(e){var t=e.binding.type;return"camunda:in"===t||"camunda:in:businessKey"===t||"camunda:out"===t}));if(o.length){var a=this._getOrCreateExtensionElements(DO.getSignalEventDefinition(e)||e),s=dT(a,["camunda:In","camunda:Out"]);o.forEach((function(n){var o,c=jT(t,n),p=c&&c.binding,u=c&&kT(a,c),l=n.value,d=n.binding,h=d.type,m={};c&&u?(DT(u,c)||("camunda:in"===h?d.expression?m["camunda:sourceExpression"]=l:m["camunda:source"]=l:"camunda:in:businessKey"===h?m["camunda:businessKey"]=l:"camunda:out"===h&&(m["camunda:target"]=l)),(p.local&&!d.local||!p.local&&d.local)&&(m.local=d.local),Kg(m)&&r.execute("properties-panel.update-businessobject",{element:e,businessObject:u,properties:m}),uT(s,u)):("camunda:in"===h?o=vT(d,l,i):"camunda:out"===h?o=gT(d,l,i):"camunda:in:businessKey"===h&&(o=yT(d,l,i)),r.execute("properties-panel.update-businessobject-list",{element:e,currentObject:a,propertyName:"values",objectsToAdd:[o],objectsToRemove:[]}))})),s.length&&r.execute("properties-panel.update-businessobject-list",{element:e,currentObject:a,propertyName:"values",objectsToAdd:[],objectsToRemove:s})}},AT.prototype._updateCamundaInputOutputParameterProperties=function(e,t,n,i){var r=this._bpmnFactory,o=this._commandStack,a=n.properties.filter((function(e){var t=e.binding.type;return"camunda:inputParameter"===t||"camunda:outputParameter"===t}));if(a.length){var s;i||(i=this._getOrCreateExtensionElements(e)),OT(i,"camunda:Connector")?(s=i.get("camunda:inputOutput"))||(s=r.create("camunda:InputOutput"),o.execute("properties-panel.update-businessobject",{element:e,businessObject:i,properties:{inputOutput:s}})):(s=lT(i,"camunda:InputOutput"))||(s=r.create("camunda:InputOutput"),o.execute("properties-panel.update-businessobject-list",{element:e,currentObject:i,propertyName:"values",objectsToAdd:[s],objectsToRemove:[]}));var c,p=s.get("camunda:inputParameters")?s.get("camunda:inputParameters").slice():[],u=s.get("camunda:outputParameters")?s.get("camunda:outputParameters").slice():[];a.forEach((function(n){var a,l,d=jT(t,n),h=d&&kT(i,d),m=n.value,f=n.binding,v=f.type;d&&h?(DT(h,d)||(l=OT(h,"camunda:InputParameter")?{value:m}:{name:m},o.execute("properties-panel.update-businessobject",{element:e,businessObject:h,properties:l})),OT(h,"camunda:InputParameter")?uT(p,h):uT(u,h)):("camunda:inputParameter"===v?(c="inputParameters",a=xT(f,m,r)):(c="outputParameters",a=ET(f,m,r)),o.execute("properties-panel.update-businessobject-list",{element:e,currentObject:s,propertyName:c,objectsToAdd:[a],objectsToRemove:[]}))})),p.length&&o.execute("properties-panel.update-businessobject-list",{element:e,currentObject:s,propertyName:"inputParameters",objectsToAdd:[],objectsToRemove:p}),u.length&&o.execute("properties-panel.update-businessobject-list",{element:e,currentObject:s,propertyName:"outputParameters",objectsToAdd:[],objectsToRemove:u})}},AT.prototype._updateCamundaModelerTemplate=function(e,t){this._modeling.updateProperties(e,{"camunda:modelerTemplate":t&&t.id,"camunda:modelerTemplateVersion":t&&t.version})},AT.prototype._updateCamundaPropertyProperties=function(e,t,n,i){var r=this._bpmnFactory,o=this._commandStack,a=n.properties.filter((function(e){return"camunda:property"===e.binding.type}));if(a.length){i=i?this._getOrCreateExtensionElements(i):this._getOrCreateExtensionElements(e);var s=lT(i,"camunda:Properties");s||(s=r.create("camunda:Properties"),o.execute("properties-panel.update-businessobject-list",{element:e,currentObject:i,propertyName:"values",objectsToAdd:[s],objectsToRemove:[]}));var c=s.get("camunda:values")?s.get("camunda:values").slice():[];a.forEach((function(n){var a=jT(t,n),p=a&&kT(i,a),u=n.value,l=n.binding;a&&p?(DT(p,a)||o.execute("properties-panel.update-businessobject",{element:e,businessObject:p,properties:{value:u}}),uT(c,p)):o.execute("properties-panel.update-businessobject-list",{element:e,currentObject:s,propertyName:"values",objectsToAdd:[bT(l,u,r)],objectsToRemove:[]})})),c.length&&o.execute("properties-panel.update-businessobject-list",{element:e,currentObject:s,propertyName:"values",objectsToAdd:[],objectsToRemove:c})}},AT.prototype._updateConditionExpression=function(e,t,n){var i=this._bpmnFactory,r=this._commandStack,o=this._modeling,a=n.binding,s=n.value;if(t){var c=t.binding,p=t.value,u=ST(e).get("bpmn:conditionExpression"),l={};u.get("body")===p&&(l.body=s),u.get("language")===c.scriptFormat&&(l.language=a.scriptFormat),Kg(l).length&&r.execute("properties-panel.update-businessobject",{element:e,businessObject:u,properties:l})}else o.updateProperties(e,{conditionExpression:i.create("bpmn:FormalExpression",{body:s,language:a.scriptFormat})})},AT.prototype._updateProperties=function(e,t,n,i){var r=this,o=this._commandStack,a=n.properties.filter((function(e){return"property"===e.binding.type}));a.length&&(i||(i=ST(e)),a.forEach((function(n){var a,s,c=jT(t,n),p=n.binding.name,u=n.value;if("conditionExpression"===p)r._updateConditionExpression(e,c,n);else{if(a=OT(i,"bpmn:Error")?i:e,c&&DT(a,c))return;(s={})[p]=u,-1!==TT.indexOf(p)&&TT.forEach((function(e){e!==p&&(s[e]=void 0)})),o.execute("properties-panel.update-businessobject",{element:e,businessObject:i,properties:s})}})))},AT.prototype._updateScopeProperties=function(e,t,n,i){var r,o=this._bpmnFactory,a=this._commandStack,s=n.type;(r=function(e,t,n){var i=t.type,r=t.id;if("camunda:Connector"===i)return lT(e,"camunda:Connector");if("bpmn:Error"===i){var o=function(e,t){return CP(e.properties,(function(e){return e.binding.errorRef===t}))}(n,r);if(!o)return;var a=kT(e,o);if(!a)return;return a.errorRef}}(e,n,i))||(r=o.create(s));var c=function(e,t){var n=e.type,i=e.id,r=t&&QC(t.scopes);return r&&CP(r,(function(e){return MT(n)?e.id===i:e.type===n}))}(n,t);if(this._updateProperties(e,c,n,r),this._updateCamundaExecutionListenerProperties(e,n),this._updateCamundaInOutProperties(e,c,n),this._updateCamundaInputOutputParameterProperties(e,c,n,r),this._updateCamundaFieldProperties(e,c,n,r),this._updateCamundaPropertyProperties(e,c,n,r),!MT(s)){var p=this._getOrCreateExtensionElements(e);a.execute("properties-panel.update-businessobject-list",{element:e,currentObject:p,propertyName:"values",objectsToAdd:[r],objectsToRemove:[]})}},BT.$inject=["commandStack","elementTemplates","eventBus"];var IT={__init__:[BT]};function NT(e,t,n){if(!t.get(e)&&t.getDefault(e)){var i={element:e,newTemplate:t.getDefault(e)};n.execute("propertiesPanel.camunda.changeTemplate",i)}}var LT=function(e){return!0===e||!1===e||bg(e)&&"[object Boolean]"==gg(e)},FT=KC.getTemplateId,VT=KS.find,$T=KS.isNumber;function zT(e,t){K_.call(this,e,1100),this.isEntryVisible=function(e,n,i,r){var o=t.get(e);if(FT(e)&&!function(e,t,n){var i=e.id;if("element-template"===t.id)return!0;var r=n&&n.entriesVisible||GT;if(LT(r))return r;var o=r._all||!1,a=r[i];return o?!1!==a:!0===a}(n,r,o))return!1},this.isPropertyEditable=function(e,n,i,r,o){var a=t.get(n);if(a&&!function(e,t){var n;if(function(e){return UT.test(e.id)}(e))return(n=function(e,t){var n,i,r=function(){throw new Error("cannot extract property index for entry <"+t.id+">")},o=t.id.replace("custom-"+e.id+"-","");if(!o.includes("-"))return n=parseInt(o,10),$T(n)||r(),e.properties[n];var a=o.split("-");if(2==a.length&&(i=a[0].replace(/_/g,":"),n=parseInt(a[1],10),i&&$T(n)))return function(e,t){return VT(e,(function(e){return e.type===t}))}(QC(e.scopes),i).properties[n];r()}(t,e))&&!1!==n.editable;return!0}(i,a))return!1}}zT.$inject=["eventBus","elementTemplates"],i(zT,K_);var qT=zT,UT=/^custom-/,GT={_all:!1};var HT=function(e){return(null==e?0:e.length)?Nw(e,1):[]};var WT=function(e){return void 0===e};var KT=function(e,t){return oE(t,(function(t){return e[t]}))};var XT=function(e){return null==e?[]:KT(e,Kg(e))},YT=KC.getTemplateId,JT=KC.getTemplateVersion,ZT=tC.isAny;function QT(){this._templates={}}QT.prototype.get=function(e,t){var n,i=this._templates;return WT(e)?null:iT(e)?(WT(t)&&(t="_"),i[e]&&i[e][t]?i[e][t]:null):(n=e,this.get(YT(n),JT(n)))},QT.prototype.getDefault=function(e){return CP(this.getAll(),(function(t){return ZT(e,t.appliesTo)&&t.isDefault}))||null},QT.prototype.getAll=function(e){return!WT(e)&&this._templates[e]?XT(this._templates[e]):HT(XT(this._templates).map(XT))},QT.prototype.set=function(e){var t=this;this._templates={},e.forEach((function(e){var n=e.id,i=WT(e.version)?"_":e.version;t._templates[n]||(t._templates[n]={}),t._templates[n][i]=e}))};var eA=QT,tA=n((function(e,t){var n;t=e.exports=l,n="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?function(){var e=Array.prototype.slice.call(arguments,0);e.unshift("SEMVER"),console.log.apply(console,e)}:function(){},t.SEMVER_SPEC_VERSION="2.0.0";var i=Number.MAX_SAFE_INTEGER||9007199254740991,r=t.re=[],o=t.src=[],a=t.tokens={},s=0;function c(e){a[e]=s++}c("NUMERICIDENTIFIER"),o[a.NUMERICIDENTIFIER]="0|[1-9]\\d*",c("NUMERICIDENTIFIERLOOSE"),o[a.NUMERICIDENTIFIERLOOSE]="[0-9]+",c("NONNUMERICIDENTIFIER"),o[a.NONNUMERICIDENTIFIER]="\\d*[a-zA-Z-][a-zA-Z0-9-]*",c("MAINVERSION"),o[a.MAINVERSION]="("+o[a.NUMERICIDENTIFIER]+")\\.("+o[a.NUMERICIDENTIFIER]+")\\.("+o[a.NUMERICIDENTIFIER]+")",c("MAINVERSIONLOOSE"),o[a.MAINVERSIONLOOSE]="("+o[a.NUMERICIDENTIFIERLOOSE]+")\\.("+o[a.NUMERICIDENTIFIERLOOSE]+")\\.("+o[a.NUMERICIDENTIFIERLOOSE]+")",c("PRERELEASEIDENTIFIER"),o[a.PRERELEASEIDENTIFIER]="(?:"+o[a.NUMERICIDENTIFIER]+"|"+o[a.NONNUMERICIDENTIFIER]+")",c("PRERELEASEIDENTIFIERLOOSE"),o[a.PRERELEASEIDENTIFIERLOOSE]="(?:"+o[a.NUMERICIDENTIFIERLOOSE]+"|"+o[a.NONNUMERICIDENTIFIER]+")",c("PRERELEASE"),o[a.PRERELEASE]="(?:-("+o[a.PRERELEASEIDENTIFIER]+"(?:\\."+o[a.PRERELEASEIDENTIFIER]+")*))",c("PRERELEASELOOSE"),o[a.PRERELEASELOOSE]="(?:-?("+o[a.PRERELEASEIDENTIFIERLOOSE]+"(?:\\."+o[a.PRERELEASEIDENTIFIERLOOSE]+")*))",c("BUILDIDENTIFIER"),o[a.BUILDIDENTIFIER]="[0-9A-Za-z-]+",c("BUILD"),o[a.BUILD]="(?:\\+("+o[a.BUILDIDENTIFIER]+"(?:\\."+o[a.BUILDIDENTIFIER]+")*))",c("FULL"),c("FULLPLAIN"),o[a.FULLPLAIN]="v?"+o[a.MAINVERSION]+o[a.PRERELEASE]+"?"+o[a.BUILD]+"?",o[a.FULL]="^"+o[a.FULLPLAIN]+"$",c("LOOSEPLAIN"),o[a.LOOSEPLAIN]="[v=\\s]*"+o[a.MAINVERSIONLOOSE]+o[a.PRERELEASELOOSE]+"?"+o[a.BUILD]+"?",c("LOOSE"),o[a.LOOSE]="^"+o[a.LOOSEPLAIN]+"$",c("GTLT"),o[a.GTLT]="((?:<|>)?=?)",c("XRANGEIDENTIFIERLOOSE"),o[a.XRANGEIDENTIFIERLOOSE]=o[a.NUMERICIDENTIFIERLOOSE]+"|x|X|\\*",c("XRANGEIDENTIFIER"),o[a.XRANGEIDENTIFIER]=o[a.NUMERICIDENTIFIER]+"|x|X|\\*",c("XRANGEPLAIN"),o[a.XRANGEPLAIN]="[v=\\s]*("+o[a.XRANGEIDENTIFIER]+")(?:\\.("+o[a.XRANGEIDENTIFIER]+")(?:\\.("+o[a.XRANGEIDENTIFIER]+")(?:"+o[a.PRERELEASE]+")?"+o[a.BUILD]+"?)?)?",c("XRANGEPLAINLOOSE"),o[a.XRANGEPLAINLOOSE]="[v=\\s]*("+o[a.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+o[a.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+o[a.XRANGEIDENTIFIERLOOSE]+")(?:"+o[a.PRERELEASELOOSE]+")?"+o[a.BUILD]+"?)?)?",c("XRANGE"),o[a.XRANGE]="^"+o[a.GTLT]+"\\s*"+o[a.XRANGEPLAIN]+"$",c("XRANGELOOSE"),o[a.XRANGELOOSE]="^"+o[a.GTLT]+"\\s*"+o[a.XRANGEPLAINLOOSE]+"$",c("COERCE"),o[a.COERCE]="(^|[^\\d])(\\d{1,16})(?:\\.(\\d{1,16}))?(?:\\.(\\d{1,16}))?(?:$|[^\\d])",c("COERCERTL"),r[a.COERCERTL]=new RegExp(o[a.COERCE],"g"),c("LONETILDE"),o[a.LONETILDE]="(?:~>?)",c("TILDETRIM"),o[a.TILDETRIM]="(\\s*)"+o[a.LONETILDE]+"\\s+",r[a.TILDETRIM]=new RegExp(o[a.TILDETRIM],"g");c("TILDE"),o[a.TILDE]="^"+o[a.LONETILDE]+o[a.XRANGEPLAIN]+"$",c("TILDELOOSE"),o[a.TILDELOOSE]="^"+o[a.LONETILDE]+o[a.XRANGEPLAINLOOSE]+"$",c("LONECARET"),o[a.LONECARET]="(?:\\^)",c("CARETTRIM"),o[a.CARETTRIM]="(\\s*)"+o[a.LONECARET]+"\\s+",r[a.CARETTRIM]=new RegExp(o[a.CARETTRIM],"g");c("CARET"),o[a.CARET]="^"+o[a.LONECARET]+o[a.XRANGEPLAIN]+"$",c("CARETLOOSE"),o[a.CARETLOOSE]="^"+o[a.LONECARET]+o[a.XRANGEPLAINLOOSE]+"$",c("COMPARATORLOOSE"),o[a.COMPARATORLOOSE]="^"+o[a.GTLT]+"\\s*("+o[a.LOOSEPLAIN]+")$|^$",c("COMPARATOR"),o[a.COMPARATOR]="^"+o[a.GTLT]+"\\s*("+o[a.FULLPLAIN]+")$|^$",c("COMPARATORTRIM"),o[a.COMPARATORTRIM]="(\\s*)"+o[a.GTLT]+"\\s*("+o[a.LOOSEPLAIN]+"|"+o[a.XRANGEPLAIN]+")",r[a.COMPARATORTRIM]=new RegExp(o[a.COMPARATORTRIM],"g");c("HYPHENRANGE"),o[a.HYPHENRANGE]="^\\s*("+o[a.XRANGEPLAIN]+")\\s+-\\s+("+o[a.XRANGEPLAIN]+")\\s*$",c("HYPHENRANGELOOSE"),o[a.HYPHENRANGELOOSE]="^\\s*("+o[a.XRANGEPLAINLOOSE]+")\\s+-\\s+("+o[a.XRANGEPLAINLOOSE]+")\\s*$",c("STAR"),o[a.STAR]="(<|>)?=?\\s*\\*";for(var p=0;p<s;p++)n(p,o[p]),r[p]||(r[p]=new RegExp(o[p]));function u(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof l)return e;if("string"!=typeof e)return null;if(e.length>256)return null;if(!(t.loose?r[a.LOOSE]:r[a.FULL]).test(e))return null;try{return new l(e,t)}catch(e){return null}}function l(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof l){if(e.loose===t.loose)return e;e=e.version}else if("string"!=typeof e)throw new TypeError("Invalid Version: "+e);if(e.length>256)throw new TypeError("version is longer than 256 characters");if(!(this instanceof l))return new l(e,t);n("SemVer",e,t),this.options=t,this.loose=!!t.loose;var o=e.trim().match(t.loose?r[a.LOOSE]:r[a.FULL]);if(!o)throw new TypeError("Invalid Version: "+e);if(this.raw=e,this.major=+o[1],this.minor=+o[2],this.patch=+o[3],this.major>i||this.major<0)throw new TypeError("Invalid major version");if(this.minor>i||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>i||this.patch<0)throw new TypeError("Invalid patch version");o[4]?this.prerelease=o[4].split(".").map((function(e){if(/^[0-9]+$/.test(e)){var t=+e;if(t>=0&&t<i)return t}return e})):this.prerelease=[],this.build=o[5]?o[5].split("."):[],this.format()}t.parse=u,t.valid=function(e,t){var n=u(e,t);return n?n.version:null},t.clean=function(e,t){var n=u(e.trim().replace(/^[=v]+/,""),t);return n?n.version:null},t.SemVer=l,l.prototype.format=function(){return this.version=this.major+"."+this.minor+"."+this.patch,this.prerelease.length&&(this.version+="-"+this.prerelease.join(".")),this.version},l.prototype.toString=function(){return this.version},l.prototype.compare=function(e){return n("SemVer.compare",this.version,this.options,e),e instanceof l||(e=new l(e,this.options)),this.compareMain(e)||this.comparePre(e)},l.prototype.compareMain=function(e){return e instanceof l||(e=new l(e,this.options)),h(this.major,e.major)||h(this.minor,e.minor)||h(this.patch,e.patch)},l.prototype.comparePre=function(e){if(e instanceof l||(e=new l(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;var t=0;do{var i=this.prerelease[t],r=e.prerelease[t];if(n("prerelease compare",t,i,r),void 0===i&&void 0===r)return 0;if(void 0===r)return 1;if(void 0===i)return-1;if(i!==r)return h(i,r)}while(++t)},l.prototype.compareBuild=function(e){e instanceof l||(e=new l(e,this.options));var t=0;do{var i=this.build[t],r=e.build[t];if(n("prerelease compare",t,i,r),void 0===i&&void 0===r)return 0;if(void 0===r)return 1;if(void 0===i)return-1;if(i!==r)return h(i,r)}while(++t)},l.prototype.inc=function(e,t){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t),this.inc("pre",t);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t),this.inc("pre",t);break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":if(0===this.prerelease.length)this.prerelease=[0];else{for(var n=this.prerelease.length;--n>=0;)"number"==typeof this.prerelease[n]&&(this.prerelease[n]++,n=-2);-1===n&&this.prerelease.push(0)}t&&(this.prerelease[0]===t?isNaN(this.prerelease[1])&&(this.prerelease=[t,0]):this.prerelease=[t,0]);break;default:throw new Error("invalid increment argument: "+e)}return this.format(),this.raw=this.version,this},t.inc=function(e,t,n,i){"string"==typeof n&&(i=n,n=void 0);try{return new l(e,n).inc(t,i).version}catch(e){return null}},t.diff=function(e,t){if(y(e,t))return null;var n=u(e),i=u(t),r="";if(n.prerelease.length||i.prerelease.length){r="pre";var o="prerelease"}for(var a in n)if(("major"===a||"minor"===a||"patch"===a)&&n[a]!==i[a])return r+a;return o},t.compareIdentifiers=h;var d=/^[0-9]+$/;function h(e,t){var n=d.test(e),i=d.test(t);return n&&i&&(e=+e,t=+t),e===t?0:n&&!i?-1:i&&!n?1:e<t?-1:1}function m(e,t,n){return new l(e,n).compare(new l(t,n))}function f(e,t,n){return m(e,t,n)>0}function v(e,t,n){return m(e,t,n)<0}function y(e,t,n){return 0===m(e,t,n)}function g(e,t,n){return 0!==m(e,t,n)}function b(e,t,n){return m(e,t,n)>=0}function x(e,t,n){return m(e,t,n)<=0}function E(e,t,n,i){switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e===n;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e!==n;case"":case"=":case"==":return y(e,n,i);case"!=":return g(e,n,i);case">":return f(e,n,i);case">=":return b(e,n,i);case"<":return v(e,n,i);case"<=":return x(e,n,i);default:throw new TypeError("Invalid operator: "+t)}}function w(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof w){if(e.loose===!!t.loose)return e;e=e.value}if(!(this instanceof w))return new w(e,t);n("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===_?this.value="":this.value=this.operator+this.semver.version,n("comp",this)}t.rcompareIdentifiers=function(e,t){return h(t,e)},t.major=function(e,t){return new l(e,t).major},t.minor=function(e,t){return new l(e,t).minor},t.patch=function(e,t){return new l(e,t).patch},t.compare=m,t.compareLoose=function(e,t){return m(e,t,!0)},t.compareBuild=function(e,t,n){var i=new l(e,n),r=new l(t,n);return i.compare(r)||i.compareBuild(r)},t.rcompare=function(e,t,n){return m(t,e,n)},t.sort=function(e,n){return e.sort((function(e,i){return t.compareBuild(e,i,n)}))},t.rsort=function(e,n){return e.sort((function(e,i){return t.compareBuild(i,e,n)}))},t.gt=f,t.lt=v,t.eq=y,t.neq=g,t.gte=b,t.lte=x,t.cmp=E,t.Comparator=w;var _={};function P(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof P)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new P(e.raw,t);if(e instanceof w)return new P(e.value,t);if(!(this instanceof P))return new P(e,t);if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e,this.set=e.split(/\s*\|\|\s*/).map((function(e){return this.parseRange(e.trim())}),this).filter((function(e){return e.length})),!this.set.length)throw new TypeError("Invalid SemVer Range: "+e);this.format()}function S(e,t){for(var n=!0,i=e.slice(),r=i.pop();n&&i.length;)n=i.every((function(e){return r.intersects(e,t)})),r=i.pop();return n}function O(e){return!e||"x"===e.toLowerCase()||"*"===e}function C(e,t,n,i,r,o,a,s,c,p,u,l,d){return((t=O(n)?"":O(i)?">="+n+".0.0":O(r)?">="+n+"."+i+".0":">="+t)+" "+(s=O(c)?"":O(p)?"<"+(+c+1)+".0.0":O(u)?"<"+c+"."+(+p+1)+".0":l?"<="+c+"."+p+"."+u+"-"+l:"<="+s)).trim()}function T(e,t,i){for(var r=0;r<e.length;r++)if(!e[r].test(t))return!1;if(t.prerelease.length&&!i.includePrerelease){for(r=0;r<e.length;r++)if(n(e[r].semver),e[r].semver!==_&&e[r].semver.prerelease.length>0){var o=e[r].semver;if(o.major===t.major&&o.minor===t.minor&&o.patch===t.patch)return!0}return!1}return!0}function A(e,t,n){try{t=new P(t,n)}catch(e){return!1}return t.test(e)}function R(e,t,n,i){var r,o,a,s,c;switch(e=new l(e,i),t=new P(t,i),n){case">":r=f,o=x,a=v,s=">",c=">=";break;case"<":r=v,o=b,a=f,s="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(A(e,t,i))return!1;for(var p=0;p<t.set.length;++p){var u=t.set[p],d=null,h=null;if(u.forEach((function(e){e.semver===_&&(e=new w(">=0.0.0")),d=d||e,h=h||e,r(e.semver,d.semver,i)?d=e:a(e.semver,h.semver,i)&&(h=e)})),d.operator===s||d.operator===c)return!1;if((!h.operator||h.operator===s)&&o(e,h.semver))return!1;if(h.operator===c&&a(e,h.semver))return!1}return!0}w.prototype.parse=function(e){var t=this.options.loose?r[a.COMPARATORLOOSE]:r[a.COMPARATOR],n=e.match(t);if(!n)throw new TypeError("Invalid comparator: "+e);this.operator=void 0!==n[1]?n[1]:"","="===this.operator&&(this.operator=""),n[2]?this.semver=new l(n[2],this.options.loose):this.semver=_},w.prototype.toString=function(){return this.value},w.prototype.test=function(e){if(n("Comparator.test",e,this.options.loose),this.semver===_||e===_)return!0;if("string"==typeof e)try{e=new l(e,this.options)}catch(e){return!1}return E(e,this.operator,this.semver,this.options)},w.prototype.intersects=function(e,t){if(!(e instanceof w))throw new TypeError("a Comparator is required");var n;if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),""===this.operator)return""===this.value||(n=new P(e.value,t),A(this.value,n,t));if(""===e.operator)return""===e.value||(n=new P(this.value,t),A(e.semver,n,t));var i=!(">="!==this.operator&&">"!==this.operator||">="!==e.operator&&">"!==e.operator),r=!("<="!==this.operator&&"<"!==this.operator||"<="!==e.operator&&"<"!==e.operator),o=this.semver.version===e.semver.version,a=!(">="!==this.operator&&"<="!==this.operator||">="!==e.operator&&"<="!==e.operator),s=E(this.semver,"<",e.semver,t)&&(">="===this.operator||">"===this.operator)&&("<="===e.operator||"<"===e.operator),c=E(this.semver,">",e.semver,t)&&("<="===this.operator||"<"===this.operator)&&(">="===e.operator||">"===e.operator);return i||r||o&&a||s||c},t.Range=P,P.prototype.format=function(){return this.range=this.set.map((function(e){return e.join(" ").trim()})).join("||").trim(),this.range},P.prototype.toString=function(){return this.range},P.prototype.parseRange=function(e){var t=this.options.loose;e=e.trim();var i=t?r[a.HYPHENRANGELOOSE]:r[a.HYPHENRANGE];e=e.replace(i,C),n("hyphen replace",e),e=e.replace(r[a.COMPARATORTRIM],"$1$2$3"),n("comparator trim",e,r[a.COMPARATORTRIM]),e=(e=(e=e.replace(r[a.TILDETRIM],"$1~")).replace(r[a.CARETTRIM],"$1^")).split(/\s+/).join(" ");var o=t?r[a.COMPARATORLOOSE]:r[a.COMPARATOR],s=e.split(" ").map((function(e){return function(e,t){return n("comp",e,t),e=function(e,t){return e.trim().split(/\s+/).map((function(e){return function(e,t){n("caret",e,t);var i=t.loose?r[a.CARETLOOSE]:r[a.CARET];return e.replace(i,(function(t,i,r,o,a){var s;return n("caret",e,t,i,r,o,a),O(i)?s="":O(r)?s=">="+i+".0.0 <"+(+i+1)+".0.0":O(o)?s="0"===i?">="+i+"."+r+".0 <"+i+"."+(+r+1)+".0":">="+i+"."+r+".0 <"+(+i+1)+".0.0":a?(n("replaceCaret pr",a),s="0"===i?"0"===r?">="+i+"."+r+"."+o+"-"+a+" <"+i+"."+r+"."+(+o+1):">="+i+"."+r+"."+o+"-"+a+" <"+i+"."+(+r+1)+".0":">="+i+"."+r+"."+o+"-"+a+" <"+(+i+1)+".0.0"):(n("no pr"),s="0"===i?"0"===r?">="+i+"."+r+"."+o+" <"+i+"."+r+"."+(+o+1):">="+i+"."+r+"."+o+" <"+i+"."+(+r+1)+".0":">="+i+"."+r+"."+o+" <"+(+i+1)+".0.0"),n("caret return",s),s}))}(e,t)})).join(" ")}(e,t),n("caret",e),e=function(e,t){return e.trim().split(/\s+/).map((function(e){return function(e,t){var i=t.loose?r[a.TILDELOOSE]:r[a.TILDE];return e.replace(i,(function(t,i,r,o,a){var s;return n("tilde",e,t,i,r,o,a),O(i)?s="":O(r)?s=">="+i+".0.0 <"+(+i+1)+".0.0":O(o)?s=">="+i+"."+r+".0 <"+i+"."+(+r+1)+".0":a?(n("replaceTilde pr",a),s=">="+i+"."+r+"."+o+"-"+a+" <"+i+"."+(+r+1)+".0"):s=">="+i+"."+r+"."+o+" <"+i+"."+(+r+1)+".0",n("tilde return",s),s}))}(e,t)})).join(" ")}(e,t),n("tildes",e),e=function(e,t){return n("replaceXRanges",e,t),e.split(/\s+/).map((function(e){return function(e,t){e=e.trim();var i=t.loose?r[a.XRANGELOOSE]:r[a.XRANGE];return e.replace(i,(function(i,r,o,a,s,c){n("xRange",e,i,r,o,a,s,c);var p=O(o),u=p||O(a),l=u||O(s),d=l;return"="===r&&d&&(r=""),c=t.includePrerelease?"-0":"",p?i=">"===r||"<"===r?"<0.0.0-0":"*":r&&d?(u&&(a=0),s=0,">"===r?(r=">=",u?(o=+o+1,a=0,s=0):(a=+a+1,s=0)):"<="===r&&(r="<",u?o=+o+1:a=+a+1),i=r+o+"."+a+"."+s+c):u?i=">="+o+".0.0"+c+" <"+(+o+1)+".0.0"+c:l&&(i=">="+o+"."+a+".0"+c+" <"+o+"."+(+a+1)+".0"+c),n("xRange return",i),i}))}(e,t)})).join(" ")}(e,t),n("xrange",e),e=function(e,t){return n("replaceStars",e,t),e.trim().replace(r[a.STAR],"")}(e,t),n("stars",e),e}(e,this.options)}),this).join(" ").split(/\s+/);return this.options.loose&&(s=s.filter((function(e){return!!e.match(o)}))),s=s.map((function(e){return new w(e,this.options)}),this)},P.prototype.intersects=function(e,t){if(!(e instanceof P))throw new TypeError("a Range is required");return this.set.some((function(n){return S(n,t)&&e.set.some((function(e){return S(e,t)&&n.every((function(n){return e.every((function(e){return n.intersects(e,t)}))}))}))}))},t.toComparators=function(e,t){return new P(e,t).set.map((function(e){return e.map((function(e){return e.value})).join(" ").trim().split(" ")}))},P.prototype.test=function(e){if(!e)return!1;if("string"==typeof e)try{e=new l(e,this.options)}catch(e){return!1}for(var t=0;t<this.set.length;t++)if(T(this.set[t],e,this.options))return!0;return!1},t.satisfies=A,t.maxSatisfying=function(e,t,n){var i=null,r=null;try{var o=new P(t,n)}catch(e){return null}return e.forEach((function(e){o.test(e)&&(i&&-1!==r.compare(e)||(r=new l(i=e,n)))})),i},t.minSatisfying=function(e,t,n){var i=null,r=null;try{var o=new P(t,n)}catch(e){return null}return e.forEach((function(e){o.test(e)&&(i&&1!==r.compare(e)||(r=new l(i=e,n)))})),i},t.minVersion=function(e,t){e=new P(e,t);var n=new l("0.0.0");if(e.test(n))return n;if(n=new l("0.0.0-0"),e.test(n))return n;n=null;for(var i=0;i<e.set.length;++i){e.set[i].forEach((function(e){var t=new l(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":n&&!f(n,t)||(n=t);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+e.operator)}}))}if(n&&e.test(n))return n;return null},t.validRange=function(e,t){try{return new P(e,t).range||"*"}catch(e){return null}},t.ltr=function(e,t,n){return R(e,t,"<",n)},t.gtr=function(e,t,n){return R(e,t,">",n)},t.outside=R,t.prerelease=function(e,t){var n=u(e,t);return n&&n.prerelease.length?n.prerelease:null},t.intersects=function(e,t,n){return e=new P(e,n),t=new P(t,n),e.intersects(t)},t.coerce=function(e,t){if(e instanceof l)return e;"number"==typeof e&&(e=String(e));if("string"!=typeof e)return null;var n=null;if((t=t||{}).rtl){for(var i;(i=r[a.COERCERTL].exec(e))&&(!n||n.index+n[0].length!==e.length);)n&&i.index+i[0].length===n.index+n[0].length||(n=i),r[a.COERCERTL].lastIndex=i.index+i[1].length+i[2].length;r[a.COERCERTL].lastIndex=-1}else n=e.match(r[a.COERCE]);if(null===n)return null;return u(n[2]+"."+(n[3]||"0")+"."+(n[4]||"0"),t)}})),nA=("a".charCodeAt(),["number","bigint","boolean","string","object"]);function iA(e){return nA.indexOf(typeof e)>=0}var rA=/"|\\/g,oA=/[\b]/g,aA=/\f/g,sA=/\n/g,cA=/\r/g,pA=/\t/g;function uA(e){return'"'+(e=e.replace(rA,"\\$&").replace(aA,"\\f").replace(oA,"\\b").replace(sA,"\\n").replace(cA,"\\r").replace(pA,"\\t"))+'"'}var lA=/~/g,dA=/\//g;function hA(e){return e.replace(lA,"~0").replace(dA,"~1")}var mA=function(e,t,n){if(iA(e)){var i,r,o=0,a="object"==typeof n?n.space:n;switch(typeof a){case"number":var s=a>10?10:a<0?0:Math.floor(a);a=s&&g(s," "),i=s,r=s;break;case"string":a=a.slice(0,10),i=0,r=0;for(var c=0;c<a.length;c++){switch(a[c]){case" ":r++;break;case"\t":r+=4;break;case"\r":r=0;break;case"\n":r=0,o++;break;default:throw new Error("whitespace characters not allowed in JSON")}i++}break;default:a=void 0}var p="",u={},l=0,d=0,h=0,m=n&&n.es6&&"function"==typeof Map;return function e(t,n,i){switch(y(i,"value"),typeof t){case"number":case"bigint":case"boolean":f(""+t);break;case"string":f(uA(t));break;case"object":null===t?f("null"):"function"==typeof t.toJSON?f(uA(t.toJSON())):Array.isArray(t)?r():m?t.constructor.BYTES_PER_ELEMENT?r():t instanceof Map?s():t instanceof Set?s(!0):o():o()}function r(){if(t.length){f("[");for(var r=n+1,o=0;o<t.length;o++){o&&f(","),v(r);var a=iA(t[o])?t[o]:null;e(a,r,i+"/"+o)}v(n),f("]")}else f("[]")}function o(){var r=Object.keys(t);if(r.length){f("{");for(var o=n+1,s=0;s<r.length;s++){var c=r[s],p=t[c];if(iA(p)){s&&f(",");var u=i+"/"+hA(c);v(o),y(u,"key"),f(uA(c)),y(u,"keyEnd"),f(":"),a&&f(" "),e(p,o,u)}}v(n),f("}")}else f("{}")}function s(r){if(t.size){f("{");for(var o=n+1,s=!0,c=t.entries(),p=c.next();!p.done;){var u=p.value,l=u[0],d=!!r||u[1];if(iA(d)){s||f(","),s=!1;var h=i+"/"+hA(l);v(o),y(h,"key"),f(uA(l)),y(h,"keyEnd"),f(":"),a&&f(" "),e(d,o,h)}p=c.next()}v(n),f("}")}else f("{}")}y(i,"valueEnd")}(e,0,""),{json:p,pointers:u}}function f(e){d+=e.length,h+=e.length,p+=e}function v(e){if(a){for(p+="\n"+g(e,a),l++,d=0;e--;)o?(l+=o,d=r):d+=r,h+=i;h+=1}}function y(e,t){u[e]=u[e]||{},u[e][t]={line:l,column:d,pos:h}}function g(e,t){return Array(e+1).join(t)}},fA=function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;var i,r,o;if(Array.isArray(t)){if((i=t.length)!=n.length)return!1;for(r=i;0!=r--;)if(!e(t[r],n[r]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((i=(o=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(r=i;0!=r--;)if(!Object.prototype.hasOwnProperty.call(n,o[r]))return!1;for(r=i;0!=r--;){var a=o[r];if(!e(t[a],n[a]))return!1}return!0}return t!=t&&n!=n},vA=OA,yA=OA;const gA={type:"object",required:["name","id","appliesTo","properties"],properties:{name:{$id:"#/name",type:"string",title:"element template name",description:"The name of the element template"},id:{$id:"#/id",type:"string",title:"element template id",description:"The identifier of the element template"},description:{$id:"#/description",type:"string",title:"element template description",description:"The description of the element template"},version:{$id:"#/version",type:"number",title:"element template version",description:"The version of the element template"},isDefault:{$id:"#/isDefault",type:"boolean",title:"element template is default",description:"Indicates whether the element template is a default template"},appliesTo:{$id:"#/appliesTo",type:"array",title:"element template applies to",description:"The definition for which element types the element template can be applied",default:[],items:{$id:"#/appliesTo/items",type:"string",pattern:"^(.*?:)",errorMessage:{pattern:'invalid item for "appliesTo", should contain namespaced property, example: "bpmn:Task"'}}},properties:{$ref:"#/definitions/properties",$id:"#/properties"},metadata:{$id:"#/metadata",type:"object",title:"element template metadata",description:"Some metadata for further configuration"},scopes:{oneOf:[{$ref:"#/definitions/scopes_old"},{$ref:"#/definitions/scopes"}]},entriesVisible:{$id:"#/entriesVisible",deprecated:!0,type:["object","boolean"],title:"element template entries visible",description:"@Deprecated - Select which entries are visible in the properties panel"}},errorMessage:{required:{name:"missing template name",id:"missing template id",appliesTo:"missing appliesTo=[]",properties:"missing properties=[]"}}},bA={type:"array",title:"element template properties",description:"The properties of the element template",default:[],items:{$id:"#/properties/property",type:"object",title:"element template property",description:"A property defined for the element template",default:{},required:["binding"],errorMessage:{required:{binding:'missing binding for property "${0#}"'}},allOf:[{if:{properties:{type:{const:"Dropdown"}},required:["type"]},then:{required:["choices"],errorMessage:'must provide choices=[] with "Dropdown" type'}},{if:{properties:{binding:{properties:{type:{const:"property"}},required:["type"]}},required:["binding"]},then:{properties:{type:{enum:["String","Text","Hidden","Dropdown","Boolean"],errorMessage:'invalid property type ${0} for binding type "property"; must be any of { String, Text, Hidden, Dropdown, Boolean }'}}}},{if:{properties:{binding:{properties:{type:{const:"camunda:executionListener"}},required:["type"]}},required:["binding"]},then:{properties:{type:{enum:["Hidden"],errorMessage:'invalid property type ${1/type} for binding type "camunda:executionListener"; must be "Hidden"'}}}},{if:{properties:{binding:{properties:{type:{enum:["camunda:property","camunda:outputParameter","camunda:in","camunda:in:businessKey","camunda:out","camunda:errorEventDefinition"]}},required:["type"]}},required:["binding"]},then:{properties:{type:{enum:["String","Hidden","Dropdown"],errorMessage:"invalid property type ${0} for binding type ${1/binding/type}; must be any of { String, Hidden, Dropdown }"}}}},{if:{properties:{binding:{properties:{type:{enum:["camunda:inputParameter","camunda:field"]}},required:["type"]}},required:["binding"]},then:{properties:{type:{enum:["String","Text","Hidden","Dropdown"],errorMessage:"invalid property type ${0} for binding type ${1/binding/type}; must be any of { String, Text, Hidden, Dropdown }"}}}}],properties:{value:{$id:"#/properties/property/value",type:["string","boolean"],title:"property value",description:"The value of the control field for the property"},description:{$id:"#/properties/property/description",type:"string",title:"property description",description:"The description of the control field"},label:{$id:"#/properties/property/label",type:"string",title:"property label",description:"The label of the control field for the property"},type:{$id:"#/properties/property/type",type:"string",title:"property type",description:"The type of the control field"},editable:{$id:"#/properties/property/editable",type:"boolean",title:"property editable",description:"Indicates whether the property is editable or not"},choices:{$id:"#/properties/property/choices",type:"array",title:"property choices",description:"The choices for dropdown properties",items:{$id:"#/properties/property/choices/item",type:"object",properties:{name:{$id:"#/properties/property/choices/item/name",type:"string",title:"choice name",description:"The name of the choice"},value:{$id:"#/properties/property/choices/item/value",type:"string",title:"choice value",description:"The value of the choice"}},required:["value","name"],errorMessage:'{ name, value } must be specified for "Dropdown" choices'}},binding:{$id:"#/properties/property/binding",type:"object",title:"property binding",description:"A binding to a BPMN 2.0 property",required:["type"],allOf:[{if:{properties:{type:{enum:["property","camunda:property","camunda:inputParameter","camunda:field"]}},required:["type"]},then:{required:["name"],errorMessage:"property.binding ${0/type} requires name"}},{if:{properties:{type:{const:"camunda:outputParameter"}},required:["type"]},then:{required:["source"],errorMessage:"property.binding ${0/type} requires source"}},{if:{properties:{type:{const:"camunda:in"}},required:["type"]},then:{anyOf:[{required:["variables"]},{required:["target"]}],errorMessage:"property.binding ${0/type} requires variables, target, or both"}},{if:{properties:{type:{const:"camunda:out"}},required:["type"]},then:{oneOf:[{required:["variables"],not:{anyOf:[{required:["source"]},{required:["sourceExpression"]}]}},{required:["source"],not:{anyOf:[{required:["variables"]},{required:["sourceExpression"]}]}},{required:["sourceExpression"],not:{anyOf:[{required:["variables"]},{required:["source"]}]}},{required:["variables","sourceExpression"],not:{required:["source"]}},{required:["variables","source"],not:{required:["sourceExpression"]}}],errorMessage:"property.binding ${0/type} requires one of the following: variables, sourceExpression, source, (sourceExpression and variables), or (source and variables)"}},{if:{properties:{type:{const:"camunda:errorEventDefinition"}},required:["type"]},then:{oneOf:[{required:["errorRef"]}],errorMessage:"property.binding ${0/type} requires errorRef"}}],properties:{type:{$id:"#/properties/property/binding/type",type:"string",title:"property binding type",enum:["property","camunda:property","camunda:inputParameter","camunda:outputParameter","camunda:in","camunda:out","camunda:in:businessKey","camunda:executionListener","camunda:field","camunda:errorEventDefinition"],errorMessage:"invalid property.binding type ${0}; must be any of { property, camunda:property, camunda:inputParameter, camunda:outputParameter, camunda:in, camunda:out, camunda:in:businessKey, camunda:executionListener, camunda:field, camunda:errorEventDefinition }",description:"The type of the property binding"},name:{$id:"#/properties/property/binding/name",type:"string",title:"property binding name",description:"The name of binding xml property"},event:{$id:"#/properties/property/binding/event",type:"string",title:"property binding event",description:"The event type of an execution listener binding"},scriptFormat:{$id:"#/properties/property/binding/scriptFormat",type:"string",title:"property binding script format",description:"The format of a script property binding (camunda:outputParameter, camunda:inputParameter)"},source:{$id:"#/properties/property/binding/source",type:"string",title:"property binding source",description:"The source value of a property binding (camunda:outputParameter, camunda:out)"},target:{$id:"#/properties/property/binding/target",type:"string",title:"property binding target",description:"The target value to be mapped to (camunda:in)"},expression:{$id:"#/properties/property/binding/expression",type:"boolean",title:"property binding expression",description:"True indicates that the control field value is an expression (camunda:in, camunda:field)"},variables:{$id:"#/properties/property/binding/variables",type:"string",title:"property binding variables",enum:["all","local"],description:"Either all or local indicating the variable mapping (camunda:in)"},sourceExpression:{$id:"#/properties/property/binding/sourceExpression",type:"string",title:"property binding source expression",description:"The string containing the expression for the source attribute (camunda:out)"}}},constraints:{$id:"#/properties/property/constraints",type:"object",title:"property constraints",description:"The validation constraints",properties:{notEmpty:{$id:"#/properties/property/constraints/notEmpty",type:"boolean",title:"property constraints not empty",description:"The control field must not be empty"},minLength:{$id:"#/properties/property/constraints/minLength",type:"number",title:"property constraints min length",description:"The minimal length for the control field value"},maxLength:{$id:"#/properties/property/constraints/maxLength",type:"number",title:"property constraints max length",description:"The maximal length for the control field value"},pattern:{$id:"#/properties/property/constraints/pattern",title:"property constraints pattern",description:"A regular expression pattern for the constraints",oneOf:[{type:"object",properties:{value:{$id:"#/properties/property/constraints/pattern/value",type:"string",title:"property constraints pattern value",description:"The regular expression of the pattern constraint"},message:{$id:"#/properties/property/constraints/pattern/message",type:"string",title:"property constraints pattern message",description:"The validation message of the pattern constraint"}}},{type:"string"}]}}}}}},xA=new RegExp("^(.*?:)","u"),EA={required:"missingProperty",dependencies:"property",dependentRequired:"property"};function wA(e,{dataPath:t="",parentData:n,parentDataProperty:i,rootData:r=e}={}){let o=null,a=0;if(e&&"object"==typeof e&&!Array.isArray(e)){for(const n in e)if("camunda:Connector"!==n){const e={keyword:"not",dataPath:t+"/"+n.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/additionalProperties/not",params:{},message:"should NOT be valid"};if(null===o?o=[e]:o.push(e),a++,a>0){const e=[];for(const i of o)"errorMessage"===i.keyword||i.emUsed||i.dataPath!==t+"/"+n.replace(/~/g,"~0").replace(/\//g,"~1")&&(0!==i.dataPath.indexOf(t+"/"+n.replace(/~/g,"~0").replace(/\//g,"~1"))||"/"!==i.dataPath[t+"/"+n.replace(/~/g,"~0").replace(/\//g,"~1").length])||0!==i.schemaPath.indexOf("#/additionalProperties")||"/"!==i.schemaPath["#/additionalProperties".length]||(e.push(i),i.emUsed=!0);if(e.length){const i={keyword:"errorMessage",dataPath:t+"/"+n.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/additionalProperties/errorMessage",params:{errors:e},message:"invalid scope "+JSON.stringify(n)+', object descriptor is only supported for "camunda:Connector"'};null===o?o=[i]:o.push(i),a++}const i=[];for(const e of o)e.emUsed||i.push(e);o=i,a=i.length}}if(void 0!==e["camunda:Connector"]){let n=e["camunda:Connector"];if(n&&"object"==typeof n&&!Array.isArray(n)){if(void 0!==n.properties){let e=n.properties;if(Array.isArray(e)){const n=e.length;for(let i=0;i<n;i++){let n=e[i];const r=a;let _=!0;const P=a;if(n&&"object"==typeof n&&!Array.isArray(n))if(void 0===n.type){const e={};null===o?o=[e]:o.push(e),a++}else if(void 0!==n.type&&!fA(n.type,"Dropdown")){const e={};null===o?o=[e]:o.push(e),a++}var s=P===a;if(a=r,null!==o&&(r?o.length=r:o=null),s){const e=a;if(n&&"object"==typeof n&&!Array.isArray(n)&&void 0===n.choices){const e={keyword:"required",dataPath:t+"/camunda:Connector/properties/"+i,schemaPath:"#/definitions/properties/items/allOf/0/then/required",params:{missingProperty:"choices"},message:"should have required property 'choices'"};null===o?o=[e]:o.push(e),a++}if(a>0){const e=[];for(const n of o)"errorMessage"===n.keyword||n.emUsed||n.dataPath!==t+"/camunda:Connector/properties/"+i&&(0!==n.dataPath.indexOf(t+"/camunda:Connector/properties/"+i)||"/"!==n.dataPath[t+"/camunda:Connector/properties/"+i.length])||0!==n.schemaPath.indexOf("#/definitions/properties/items/allOf/0/then")||"/"!==n.schemaPath["#/definitions/properties/items/allOf/0/then".length]||(e.push(n),n.emUsed=!0);if(e.length){const n={keyword:"errorMessage",dataPath:t+"/camunda:Connector/properties/"+i,schemaPath:"#/definitions/properties/items/allOf/0/then/errorMessage",params:{errors:e},message:'must provide choices=[] with "Dropdown" type'};null===o?o=[n]:o.push(n),a++}const n=[];for(const e of o)e.emUsed||n.push(e);o=n,a=n.length}_=s=e===a}if(!_){const e={keyword:"if",dataPath:t+"/camunda:Connector/properties/"+i,schemaPath:"#/definitions/properties/items/allOf/0/if",params:{failingKeyword:"then"},message:'should match "then" schema'};null===o?o=[e]:o.push(e),a++}const S=a;let O=!0;const C=a;if(n&&"object"==typeof n&&!Array.isArray(n))if(void 0===n.binding){const e={};null===o?o=[e]:o.push(e),a++}else if(void 0!==n.binding){let e=n.binding;if(e&&"object"==typeof e&&!Array.isArray(e))if(void 0===e.type){const e={};null===o?o=[e]:o.push(e),a++}else if(void 0!==e.type&&!fA(e.type,"property")){const e={};null===o?o=[e]:o.push(e),a++}}var c=C===a;if(a=S,null!==o&&(S?o.length=S:o=null),c){const e=a;if(n&&"object"==typeof n&&!Array.isArray(n)&&void 0!==n.type){let e=n.type;if("String"!==e&&"Text"!==e&&"Hidden"!==e&&"Dropdown"!==e&&"Boolean"!==e){const e={keyword:"enum",dataPath:t+"/camunda:Connector/properties/"+i+"/type",schemaPath:"#/definitions/properties/items/allOf/1/then/properties/type/enum",params:{allowedValues:bA.items.allOf[1].then.properties.type.enum},message:"should be equal to one of the allowed values"};null===o?o=[e]:o.push(e),a++}if(a>0){const n=[];for(const e of o)"errorMessage"===e.keyword||e.emUsed||e.dataPath!==t+"/camunda:Connector/properties/"+i+"/type"&&(0!==e.dataPath.indexOf(t+"/camunda:Connector/properties/"+i+"/type")||"/"!==e.dataPath[t+"/camunda:Connector/properties/"+i+"/type".length])||0!==e.schemaPath.indexOf("#/definitions/properties/items/allOf/1/then/properties/type")||"/"!==e.schemaPath["#/definitions/properties/items/allOf/1/then/properties/type".length]||(n.push(e),e.emUsed=!0);if(n.length){const r={keyword:"errorMessage",dataPath:t+"/camunda:Connector/properties/"+i+"/type",schemaPath:"#/definitions/properties/items/allOf/1/then/properties/type/errorMessage",params:{errors:n},message:"invalid property type "+JSON.stringify(e)+' for binding type "property"; must be any of { String, Text, Hidden, Dropdown, Boolean }'};null===o?o=[r]:o.push(r),a++}const r=[];for(const e of o)e.emUsed||r.push(e);o=r,a=r.length}}O=c=e===a}if(!O){const e={keyword:"if",dataPath:t+"/camunda:Connector/properties/"+i,schemaPath:"#/definitions/properties/items/allOf/1/if",params:{failingKeyword:"then"},message:'should match "then" schema'};null===o?o=[e]:o.push(e),a++}const T=a;let A=!0;const R=a;if(n&&"object"==typeof n&&!Array.isArray(n))if(void 0===n.binding){const e={};null===o?o=[e]:o.push(e),a++}else if(void 0!==n.binding){let e=n.binding;if(e&&"object"==typeof e&&!Array.isArray(e))if(void 0===e.type){const e={};null===o?o=[e]:o.push(e),a++}else if(void 0!==e.type&&!fA(e.type,"camunda:executionListener")){const e={};null===o?o=[e]:o.push(e),a++}}var p=R===a;if(a=T,null!==o&&(T?o.length=T:o=null),p){const e=a;if(n&&"object"==typeof n&&!Array.isArray(n)&&void 0!==n.type){if("Hidden"!==n.type){const e={keyword:"enum",dataPath:t+"/camunda:Connector/properties/"+i+"/type",schemaPath:"#/definitions/properties/items/allOf/2/then/properties/type/enum",params:{allowedValues:bA.items.allOf[2].then.properties.type.enum},message:"should be equal to one of the allowed values"};null===o?o=[e]:o.push(e),a++}if(a>0){const e=[];for(const n of o)"errorMessage"===n.keyword||n.emUsed||n.dataPath!==t+"/camunda:Connector/properties/"+i+"/type"&&(0!==n.dataPath.indexOf(t+"/camunda:Connector/properties/"+i+"/type")||"/"!==n.dataPath[t+"/camunda:Connector/properties/"+i+"/type".length])||0!==n.schemaPath.indexOf("#/definitions/properties/items/allOf/2/then/properties/type")||"/"!==n.schemaPath["#/definitions/properties/items/allOf/2/then/properties/type".length]||(e.push(n),n.emUsed=!0);if(e.length){const r={keyword:"errorMessage",dataPath:t+"/camunda:Connector/properties/"+i+"/type",schemaPath:"#/definitions/properties/items/allOf/2/then/properties/type/errorMessage",params:{errors:e},message:"invalid property type "+JSON.stringify(n&&n.type)+' for binding type "camunda:executionListener"; must be "Hidden"'};null===o?o=[r]:o.push(r),a++}const r=[];for(const e of o)e.emUsed||r.push(e);o=r,a=r.length}}A=p=e===a}if(!A){const e={keyword:"if",dataPath:t+"/camunda:Connector/properties/"+i,schemaPath:"#/definitions/properties/items/allOf/2/if",params:{failingKeyword:"then"},message:'should match "then" schema'};null===o?o=[e]:o.push(e),a++}const k=a;let j=!0;const M=a;if(n&&"object"==typeof n&&!Array.isArray(n))if(void 0===n.binding){const e={};null===o?o=[e]:o.push(e),a++}else if(void 0!==n.binding){let e=n.binding;if(e&&"object"==typeof e&&!Array.isArray(e))if(void 0===e.type){const e={};null===o?o=[e]:o.push(e),a++}else if(void 0!==e.type){let t=e.type;if("camunda:property"!==t&&"camunda:outputParameter"!==t&&"camunda:in"!==t&&"camunda:in:businessKey"!==t&&"camunda:out"!==t&&"camunda:errorEventDefinition"!==t){const e={};null===o?o=[e]:o.push(e),a++}}}var u=M===a;if(a=k,null!==o&&(k?o.length=k:o=null),u){const e=a;if(n&&"object"==typeof n&&!Array.isArray(n)&&void 0!==n.type){let e=n.type;if("String"!==e&&"Hidden"!==e&&"Dropdown"!==e){const e={keyword:"enum",dataPath:t+"/camunda:Connector/properties/"+i+"/type",schemaPath:"#/definitions/properties/items/allOf/3/then/properties/type/enum",params:{allowedValues:bA.items.allOf[3].then.properties.type.enum},message:"should be equal to one of the allowed values"};null===o?o=[e]:o.push(e),a++}if(a>0){const r=[];for(const e of o)"errorMessage"===e.keyword||e.emUsed||e.dataPath!==t+"/camunda:Connector/properties/"+i+"/type"&&(0!==e.dataPath.indexOf(t+"/camunda:Connector/properties/"+i+"/type")||"/"!==e.dataPath[t+"/camunda:Connector/properties/"+i+"/type".length])||0!==e.schemaPath.indexOf("#/definitions/properties/items/allOf/3/then/properties/type")||"/"!==e.schemaPath["#/definitions/properties/items/allOf/3/then/properties/type".length]||(r.push(e),e.emUsed=!0);if(r.length){const s={keyword:"errorMessage",dataPath:t+"/camunda:Connector/properties/"+i+"/type",schemaPath:"#/definitions/properties/items/allOf/3/then/properties/type/errorMessage",params:{errors:r},message:"invalid property type "+JSON.stringify(e)+" for binding type "+JSON.stringify(n&&n.binding&&n.binding.type)+"; must be any of { String, Hidden, Dropdown }"};null===o?o=[s]:o.push(s),a++}const s=[];for(const e of o)e.emUsed||s.push(e);o=s,a=s.length}}j=u=e===a}if(!j){const e={keyword:"if",dataPath:t+"/camunda:Connector/properties/"+i,schemaPath:"#/definitions/properties/items/allOf/3/if",params:{failingKeyword:"then"},message:'should match "then" schema'};null===o?o=[e]:o.push(e),a++}const D=a;let B=!0;const I=a;if(n&&"object"==typeof n&&!Array.isArray(n))if(void 0===n.binding){const e={};null===o?o=[e]:o.push(e),a++}else if(void 0!==n.binding){let e=n.binding;if(e&&"object"==typeof e&&!Array.isArray(e))if(void 0===e.type){const e={};null===o?o=[e]:o.push(e),a++}else if(void 0!==e.type){let t=e.type;if("camunda:inputParameter"!==t&&"camunda:field"!==t){const e={};null===o?o=[e]:o.push(e),a++}}}var l=I===a;if(a=D,null!==o&&(D?o.length=D:o=null),l){const e=a;if(n&&"object"==typeof n&&!Array.isArray(n)&&void 0!==n.type){let e=n.type;if("String"!==e&&"Text"!==e&&"Hidden"!==e&&"Dropdown"!==e){const e={keyword:"enum",dataPath:t+"/camunda:Connector/properties/"+i+"/type",schemaPath:"#/definitions/properties/items/allOf/4/then/properties/type/enum",params:{allowedValues:bA.items.allOf[4].then.properties.type.enum},message:"should be equal to one of the allowed values"};null===o?o=[e]:o.push(e),a++}if(a>0){const r=[];for(const e of o)"errorMessage"===e.keyword||e.emUsed||e.dataPath!==t+"/camunda:Connector/properties/"+i+"/type"&&(0!==e.dataPath.indexOf(t+"/camunda:Connector/properties/"+i+"/type")||"/"!==e.dataPath[t+"/camunda:Connector/properties/"+i+"/type".length])||0!==e.schemaPath.indexOf("#/definitions/properties/items/allOf/4/then/properties/type")||"/"!==e.schemaPath["#/definitions/properties/items/allOf/4/then/properties/type".length]||(r.push(e),e.emUsed=!0);if(r.length){const s={keyword:"errorMessage",dataPath:t+"/camunda:Connector/properties/"+i+"/type",schemaPath:"#/definitions/properties/items/allOf/4/then/properties/type/errorMessage",params:{errors:r},message:"invalid property type "+JSON.stringify(e)+" for binding type "+JSON.stringify(n&&n.binding&&n.binding.type)+"; must be any of { String, Text, Hidden, Dropdown }"};null===o?o=[s]:o.push(s),a++}const s=[];for(const e of o)e.emUsed||s.push(e);o=s,a=s.length}}B=l=e===a}if(!B){const e={keyword:"if",dataPath:t+"/camunda:Connector/properties/"+i,schemaPath:"#/definitions/properties/items/allOf/4/if",params:{failingKeyword:"then"},message:'should match "then" schema'};null===o?o=[e]:o.push(e),a++}if(n&&"object"==typeof n&&!Array.isArray(n)){if(void 0===n.binding){const e={keyword:"required",dataPath:t+"/camunda:Connector/properties/"+i,schemaPath:"#/definitions/properties/items/required",params:{missingProperty:"binding"},message:"should have required property 'binding'"};null===o?o=[e]:o.push(e),a++}if(void 0!==n.value){let e=n.value;if("string"!=typeof e&&"boolean"!=typeof e){const e={keyword:"type",dataPath:t+"/camunda:Connector/properties/"+i+"/value",schemaPath:"#/definitions/properties/items/properties/value/type",params:{type:bA.items.properties.value.type},message:"should be string,boolean"};null===o?o=[e]:o.push(e),a++}}if(void 0!==n.description&&"string"!=typeof n.description){const e={keyword:"type",dataPath:t+"/camunda:Connector/properties/"+i+"/description",schemaPath:"#/definitions/properties/items/properties/description/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}if(void 0!==n.label&&"string"!=typeof n.label){const e={keyword:"type",dataPath:t+"/camunda:Connector/properties/"+i+"/label",schemaPath:"#/definitions/properties/items/properties/label/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}if(void 0!==n.type&&"string"!=typeof n.type){const e={keyword:"type",dataPath:t+"/camunda:Connector/properties/"+i+"/type",schemaPath:"#/definitions/properties/items/properties/type/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}if(void 0!==n.editable&&"boolean"!=typeof n.editable){const e={keyword:"type",dataPath:t+"/camunda:Connector/properties/"+i+"/editable",schemaPath:"#/definitions/properties/items/properties/editable/type",params:{type:"boolean"},message:"should be boolean"};null===o?o=[e]:o.push(e),a++}if(void 0!==n.choices){let e=n.choices;if(Array.isArray(e)){const n=e.length;for(let r=0;r<n;r++){let n=e[r];if(n&&"object"==typeof n&&!Array.isArray(n)){if(void 0===n.value){const e={keyword:"required",dataPath:t+"/camunda:Connector/properties/"+i+"/choices/"+r,schemaPath:"#/definitions/properties/items/properties/choices/items/required",params:{missingProperty:"value"},message:"should have required property 'value'"};null===o?o=[e]:o.push(e),a++}if(void 0===n.name){const e={keyword:"required",dataPath:t+"/camunda:Connector/properties/"+i+"/choices/"+r,schemaPath:"#/definitions/properties/items/properties/choices/items/required",params:{missingProperty:"name"},message:"should have required property 'name'"};null===o?o=[e]:o.push(e),a++}if(void 0!==n.name&&"string"!=typeof n.name){const e={keyword:"type",dataPath:t+"/camunda:Connector/properties/"+i+"/choices/"+r+"/name",schemaPath:"#/definitions/properties/items/properties/choices/items/properties/name/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}if(void 0!==n.value&&"string"!=typeof n.value){const e={keyword:"type",dataPath:t+"/camunda:Connector/properties/"+i+"/choices/"+r+"/value",schemaPath:"#/definitions/properties/items/properties/choices/items/properties/value/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}}else{const e={keyword:"type",dataPath:t+"/camunda:Connector/properties/"+i+"/choices/"+r,schemaPath:"#/definitions/properties/items/properties/choices/items/type",params:{type:"object"},message:"should be object"};null===o?o=[e]:o.push(e),a++}if(a>0){const e=[];for(const n of o)"errorMessage"===n.keyword||n.emUsed||n.dataPath!==t+"/camunda:Connector/properties/"+i+"/choices/"+r&&(0!==n.dataPath.indexOf(t+"/camunda:Connector/properties/"+i+"/choices/"+r)||"/"!==n.dataPath[t+"/camunda:Connector/properties/"+i+"/choices/"+r.length])||0!==n.schemaPath.indexOf("#/definitions/properties/items/properties/choices/items")||"/"!==n.schemaPath["#/definitions/properties/items/properties/choices/items".length]||(e.push(n),n.emUsed=!0);if(e.length){const n={keyword:"errorMessage",dataPath:t+"/camunda:Connector/properties/"+i+"/choices/"+r,schemaPath:"#/definitions/properties/items/properties/choices/items/errorMessage",params:{errors:e},message:'{ name, value } must be specified for "Dropdown" choices'};null===o?o=[n]:o.push(n),a++}const n=[];for(const e of o)e.emUsed||n.push(e);o=n,a=n.length}}}else{const e={keyword:"type",dataPath:t+"/camunda:Connector/properties/"+i+"/choices",schemaPath:"#/definitions/properties/items/properties/choices/type",params:{type:"array"},message:"should be array"};null===o?o=[e]:o.push(e),a++}}if(void 0!==n.binding){let e=n.binding;const r=a;let s=!0;const c=a;if(e&&"object"==typeof e&&!Array.isArray(e))if(void 0===e.type){const e={};null===o?o=[e]:o.push(e),a++}else if(void 0!==e.type){let t=e.type;if("property"!==t&&"camunda:property"!==t&&"camunda:inputParameter"!==t&&"camunda:field"!==t){const e={};null===o?o=[e]:o.push(e),a++}}var d=c===a;if(a=r,null!==o&&(r?o.length=r:o=null),d){const n=a;if(e&&"object"==typeof e&&!Array.isArray(e)&&void 0===e.name){const e={keyword:"required",dataPath:t+"/camunda:Connector/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/0/then/required",params:{missingProperty:"name"},message:"should have required property 'name'"};null===o?o=[e]:o.push(e),a++}if(a>0){const n=[];for(const e of o)"errorMessage"===e.keyword||e.emUsed||e.dataPath!==t+"/camunda:Connector/properties/"+i+"/binding"&&(0!==e.dataPath.indexOf(t+"/camunda:Connector/properties/"+i+"/binding")||"/"!==e.dataPath[t+"/camunda:Connector/properties/"+i+"/binding".length])||0!==e.schemaPath.indexOf("#/definitions/properties/items/properties/binding/allOf/0/then")||"/"!==e.schemaPath["#/definitions/properties/items/properties/binding/allOf/0/then".length]||(n.push(e),e.emUsed=!0);if(n.length){const r={keyword:"errorMessage",dataPath:t+"/camunda:Connector/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/0/then/errorMessage",params:{errors:n},message:"property.binding "+JSON.stringify(e&&e.type)+" requires name"};null===o?o=[r]:o.push(r),a++}const r=[];for(const e of o)e.emUsed||r.push(e);o=r,a=r.length}s=d=n===a}if(!s){const e={keyword:"if",dataPath:t+"/camunda:Connector/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/0/if",params:{failingKeyword:"then"},message:'should match "then" schema'};null===o?o=[e]:o.push(e),a++}const p=a;let u=!0;const l=a;if(e&&"object"==typeof e&&!Array.isArray(e))if(void 0===e.type){const e={};null===o?o=[e]:o.push(e),a++}else if(void 0!==e.type&&!fA(e.type,"camunda:outputParameter")){const e={};null===o?o=[e]:o.push(e),a++}var h=l===a;if(a=p,null!==o&&(p?o.length=p:o=null),h){const n=a;if(e&&"object"==typeof e&&!Array.isArray(e)&&void 0===e.source){const e={keyword:"required",dataPath:t+"/camunda:Connector/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/1/then/required",params:{missingProperty:"source"},message:"should have required property 'source'"};null===o?o=[e]:o.push(e),a++}if(a>0){const n=[];for(const e of o)"errorMessage"===e.keyword||e.emUsed||e.dataPath!==t+"/camunda:Connector/properties/"+i+"/binding"&&(0!==e.dataPath.indexOf(t+"/camunda:Connector/properties/"+i+"/binding")||"/"!==e.dataPath[t+"/camunda:Connector/properties/"+i+"/binding".length])||0!==e.schemaPath.indexOf("#/definitions/properties/items/properties/binding/allOf/1/then")||"/"!==e.schemaPath["#/definitions/properties/items/properties/binding/allOf/1/then".length]||(n.push(e),e.emUsed=!0);if(n.length){const r={keyword:"errorMessage",dataPath:t+"/camunda:Connector/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/1/then/errorMessage",params:{errors:n},message:"property.binding "+JSON.stringify(e&&e.type)+" requires source"};null===o?o=[r]:o.push(r),a++}const r=[];for(const e of o)e.emUsed||r.push(e);o=r,a=r.length}u=h=n===a}if(!u){const e={keyword:"if",dataPath:t+"/camunda:Connector/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/1/if",params:{failingKeyword:"then"},message:'should match "then" schema'};null===o?o=[e]:o.push(e),a++}const w=a;let _=!0;const P=a;if(e&&"object"==typeof e&&!Array.isArray(e))if(void 0===e.type){const e={};null===o?o=[e]:o.push(e),a++}else if(void 0!==e.type&&!fA(e.type,"camunda:in")){const e={};null===o?o=[e]:o.push(e),a++}var m=P===a;if(a=w,null!==o&&(w?o.length=w:o=null),m){const n=a,r=a;let s=!1;const c=a;if(e&&"object"==typeof e&&!Array.isArray(e)&&void 0===e.variables){const e={keyword:"required",dataPath:t+"/camunda:Connector/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/2/then/anyOf/0/required",params:{missingProperty:"variables"},message:"should have required property 'variables'"};null===o?o=[e]:o.push(e),a++}var f=c===a;if(s=s||f,!s){const n=a;if(e&&"object"==typeof e&&!Array.isArray(e)&&void 0===e.target){const e={keyword:"required",dataPath:t+"/camunda:Connector/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/2/then/anyOf/1/required",params:{missingProperty:"target"},message:"should have required property 'target'"};null===o?o=[e]:o.push(e),a++}f=n===a;s=s||f}if(s)a=r,null!==o&&(r?o.length=r:o=null);else{const e={keyword:"anyOf",dataPath:t+"/camunda:Connector/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/2/then/anyOf",params:{},message:"should match some schema in anyOf"};null===o?o=[e]:o.push(e),a++}if(a>0){const n=[];for(const e of o)"errorMessage"===e.keyword||e.emUsed||e.dataPath!==t+"/camunda:Connector/properties/"+i+"/binding"&&(0!==e.dataPath.indexOf(t+"/camunda:Connector/properties/"+i+"/binding")||"/"!==e.dataPath[t+"/camunda:Connector/properties/"+i+"/binding".length])||0!==e.schemaPath.indexOf("#/definitions/properties/items/properties/binding/allOf/2/then")||"/"!==e.schemaPath["#/definitions/properties/items/properties/binding/allOf/2/then".length]||(n.push(e),e.emUsed=!0);if(n.length){const r={keyword:"errorMessage",dataPath:t+"/camunda:Connector/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/2/then/errorMessage",params:{errors:n},message:"property.binding "+JSON.stringify(e&&e.type)+" requires variables, target, or both"};null===o?o=[r]:o.push(r),a++}const r=[];for(const e of o)e.emUsed||r.push(e);o=r,a=r.length}_=m=n===a}if(!_){const e={keyword:"if",dataPath:t+"/camunda:Connector/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/2/if",params:{failingKeyword:"then"},message:'should match "then" schema'};null===o?o=[e]:o.push(e),a++}const S=a;let O=!0;const C=a;if(e&&"object"==typeof e&&!Array.isArray(e))if(void 0===e.type){const e={};null===o?o=[e]:o.push(e),a++}else if(void 0!==e.type&&!fA(e.type,"camunda:out")){const e={};null===o?o=[e]:o.push(e),a++}var v=C===a;if(a=S,null!==o&&(S?o.length=S:o=null),v){const n=a,r=a;let s=!1,c=null;const p=a,u=a,l=a,d=a;let h=!1;const m=a;if(e&&"object"==typeof e&&!Array.isArray(e)&&void 0===e.source){const e={};null===o?o=[e]:o.push(e),a++}var y=m===a;if(h=h||y,!h){const t=a;if(e&&"object"==typeof e&&!Array.isArray(e)&&void 0===e.sourceExpression){const e={};null===o?o=[e]:o.push(e),a++}y=t===a;h=h||y}if(h)a=d,null!==o&&(d?o.length=d:o=null);else{const e={};null===o?o=[e]:o.push(e),a++}if(l===a){const e={keyword:"not",dataPath:t+"/camunda:Connector/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/3/then/oneOf/0/not",params:{},message:"should NOT be valid"};null===o?o=[e]:o.push(e),a++}else a=u,null!==o&&(u?o.length=u:o=null);if(e&&"object"==typeof e&&!Array.isArray(e)&&void 0===e.variables){const e={keyword:"required",dataPath:t+"/camunda:Connector/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/3/then/oneOf/0/required",params:{missingProperty:"variables"},message:"should have required property 'variables'"};null===o?o=[e]:o.push(e),a++}(x=p===a)&&(s=!0,c=0);const f=a,E=a,w=a,_=a;let P=!1;const S=a;if(e&&"object"==typeof e&&!Array.isArray(e)&&void 0===e.variables){const e={};null===o?o=[e]:o.push(e),a++}var g=S===a;if(P=P||g,!P){const t=a;if(e&&"object"==typeof e&&!Array.isArray(e)&&void 0===e.sourceExpression){const e={};null===o?o=[e]:o.push(e),a++}g=t===a;P=P||g}if(P)a=_,null!==o&&(_?o.length=_:o=null);else{const e={};null===o?o=[e]:o.push(e),a++}if(w===a){const e={keyword:"not",dataPath:t+"/camunda:Connector/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/3/then/oneOf/1/not",params:{},message:"should NOT be valid"};null===o?o=[e]:o.push(e),a++}else a=E,null!==o&&(E?o.length=E:o=null);if(e&&"object"==typeof e&&!Array.isArray(e)&&void 0===e.source){const e={keyword:"required",dataPath:t+"/camunda:Connector/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/3/then/oneOf/1/required",params:{missingProperty:"source"},message:"should have required property 'source'"};null===o?o=[e]:o.push(e),a++}if((x=f===a)&&s)s=!1,c=[c,1];else{x&&(s=!0,c=1);const n=a,r=a,p=a,u=a;let l=!1;const d=a;if(e&&"object"==typeof e&&!Array.isArray(e)&&void 0===e.variables){const e={};null===o?o=[e]:o.push(e),a++}var b=d===a;if(l=l||b,!l){const t=a;if(e&&"object"==typeof e&&!Array.isArray(e)&&void 0===e.source){const e={};null===o?o=[e]:o.push(e),a++}b=t===a;l=l||b}if(l)a=u,null!==o&&(u?o.length=u:o=null);else{const e={};null===o?o=[e]:o.push(e),a++}if(p===a){const e={keyword:"not",dataPath:t+"/camunda:Connector/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/3/then/oneOf/2/not",params:{},message:"should NOT be valid"};null===o?o=[e]:o.push(e),a++}else a=r,null!==o&&(r?o.length=r:o=null);if(e&&"object"==typeof e&&!Array.isArray(e)&&void 0===e.sourceExpression){const e={keyword:"required",dataPath:t+"/camunda:Connector/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/3/then/oneOf/2/required",params:{missingProperty:"sourceExpression"},message:"should have required property 'sourceExpression'"};null===o?o=[e]:o.push(e),a++}if((x=n===a)&&s)s=!1,c=[c,2];else{x&&(s=!0,c=2);const n=a,r=a,p=a;if(e&&"object"==typeof e&&!Array.isArray(e)&&void 0===e.source){const e={};null===o?o=[e]:o.push(e),a++}if(p===a){const e={keyword:"not",dataPath:t+"/camunda:Connector/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/3/then/oneOf/3/not",params:{},message:"should NOT be valid"};null===o?o=[e]:o.push(e),a++}else a=r,null!==o&&(r?o.length=r:o=null);if(e&&"object"==typeof e&&!Array.isArray(e)){if(void 0===e.variables){const e={keyword:"required",dataPath:t+"/camunda:Connector/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/3/then/oneOf/3/required",params:{missingProperty:"variables"},message:"should have required property 'variables'"};null===o?o=[e]:o.push(e),a++}if(void 0===e.sourceExpression){const e={keyword:"required",dataPath:t+"/camunda:Connector/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/3/then/oneOf/3/required",params:{missingProperty:"sourceExpression"},message:"should have required property 'sourceExpression'"};null===o?o=[e]:o.push(e),a++}}if((x=n===a)&&s)s=!1,c=[c,3];else{x&&(s=!0,c=3);const n=a,r=a,p=a;if(e&&"object"==typeof e&&!Array.isArray(e)&&void 0===e.sourceExpression){const e={};null===o?o=[e]:o.push(e),a++}var x;if(p===a){const e={keyword:"not",dataPath:t+"/camunda:Connector/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/3/then/oneOf/4/not",params:{},message:"should NOT be valid"};null===o?o=[e]:o.push(e),a++}else a=r,null!==o&&(r?o.length=r:o=null);if(e&&"object"==typeof e&&!Array.isArray(e)){if(void 0===e.variables){const e={keyword:"required",dataPath:t+"/camunda:Connector/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/3/then/oneOf/4/required",params:{missingProperty:"variables"},message:"should have required property 'variables'"};null===o?o=[e]:o.push(e),a++}if(void 0===e.source){const e={keyword:"required",dataPath:t+"/camunda:Connector/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/3/then/oneOf/4/required",params:{missingProperty:"source"},message:"should have required property 'source'"};null===o?o=[e]:o.push(e),a++}}(x=n===a)&&s?(s=!1,c=[c,4]):x&&(s=!0,c=4)}}}if(s)a=r,null!==o&&(r?o.length=r:o=null);else{const e={keyword:"oneOf",dataPath:t+"/camunda:Connector/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/3/then/oneOf",params:{passingSchemas:c},message:"should match exactly one schema in oneOf"};null===o?o=[e]:o.push(e),a++}if(a>0){const n=[];for(const e of o)"errorMessage"===e.keyword||e.emUsed||e.dataPath!==t+"/camunda:Connector/properties/"+i+"/binding"&&(0!==e.dataPath.indexOf(t+"/camunda:Connector/properties/"+i+"/binding")||"/"!==e.dataPath[t+"/camunda:Connector/properties/"+i+"/binding".length])||0!==e.schemaPath.indexOf("#/definitions/properties/items/properties/binding/allOf/3/then")||"/"!==e.schemaPath["#/definitions/properties/items/properties/binding/allOf/3/then".length]||(n.push(e),e.emUsed=!0);if(n.length){const r={keyword:"errorMessage",dataPath:t+"/camunda:Connector/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/3/then/errorMessage",params:{errors:n},message:"property.binding "+JSON.stringify(e&&e.type)+" requires one of the following: variables, sourceExpression, source, (sourceExpression and variables), or (source and variables)"};null===o?o=[r]:o.push(r),a++}const r=[];for(const e of o)e.emUsed||r.push(e);o=r,a=r.length}O=v=n===a}if(!O){const e={keyword:"if",dataPath:t+"/camunda:Connector/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/3/if",params:{failingKeyword:"then"},message:'should match "then" schema'};null===o?o=[e]:o.push(e),a++}const T=a;let A=!0;const R=a;if(e&&"object"==typeof e&&!Array.isArray(e))if(void 0===e.type){const e={};null===o?o=[e]:o.push(e),a++}else if(void 0!==e.type&&!fA(e.type,"camunda:errorEventDefinition")){const e={};null===o?o=[e]:o.push(e),a++}var E=R===a;if(a=T,null!==o&&(T?o.length=T:o=null),E){const n=a,r=a;let s=!1,c=null;const p=a;if(e&&"object"==typeof e&&!Array.isArray(e)&&void 0===e.errorRef){const e={keyword:"required",dataPath:t+"/camunda:Connector/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/4/then/oneOf/0/required",params:{missingProperty:"errorRef"},message:"should have required property 'errorRef'"};null===o?o=[e]:o.push(e),a++}if(p===a&&(s=!0,c=0),s)a=r,null!==o&&(r?o.length=r:o=null);else{const e={keyword:"oneOf",dataPath:t+"/camunda:Connector/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/4/then/oneOf",params:{passingSchemas:c},message:"should match exactly one schema in oneOf"};null===o?o=[e]:o.push(e),a++}if(a>0){const n=[];for(const e of o)"errorMessage"===e.keyword||e.emUsed||e.dataPath!==t+"/camunda:Connector/properties/"+i+"/binding"&&(0!==e.dataPath.indexOf(t+"/camunda:Connector/properties/"+i+"/binding")||"/"!==e.dataPath[t+"/camunda:Connector/properties/"+i+"/binding".length])||0!==e.schemaPath.indexOf("#/definitions/properties/items/properties/binding/allOf/4/then")||"/"!==e.schemaPath["#/definitions/properties/items/properties/binding/allOf/4/then".length]||(n.push(e),e.emUsed=!0);if(n.length){const r={keyword:"errorMessage",dataPath:t+"/camunda:Connector/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/4/then/errorMessage",params:{errors:n},message:"property.binding "+JSON.stringify(e&&e.type)+" requires errorRef"};null===o?o=[r]:o.push(r),a++}const r=[];for(const e of o)e.emUsed||r.push(e);o=r,a=r.length}A=E=n===a}if(!A){const e={keyword:"if",dataPath:t+"/camunda:Connector/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/4/if",params:{failingKeyword:"then"},message:'should match "then" schema'};null===o?o=[e]:o.push(e),a++}if(e&&"object"==typeof e&&!Array.isArray(e)){if(void 0===e.type){const e={keyword:"required",dataPath:t+"/camunda:Connector/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/required",params:{missingProperty:"type"},message:"should have required property 'type'"};null===o?o=[e]:o.push(e),a++}if(void 0!==e.type){let n=e.type;if("string"!=typeof n){const e={keyword:"type",dataPath:t+"/camunda:Connector/properties/"+i+"/binding/type",schemaPath:"#/definitions/properties/items/properties/binding/properties/type/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}if("property"!==n&&"camunda:property"!==n&&"camunda:inputParameter"!==n&&"camunda:outputParameter"!==n&&"camunda:in"!==n&&"camunda:out"!==n&&"camunda:in:businessKey"!==n&&"camunda:executionListener"!==n&&"camunda:field"!==n&&"camunda:errorEventDefinition"!==n){const e={keyword:"enum",dataPath:t+"/camunda:Connector/properties/"+i+"/binding/type",schemaPath:"#/definitions/properties/items/properties/binding/properties/type/enum",params:{allowedValues:bA.items.properties.binding.properties.type.enum},message:"should be equal to one of the allowed values"};null===o?o=[e]:o.push(e),a++}if(a>0){const e=[];for(const n of o)"errorMessage"===n.keyword||n.emUsed||n.dataPath!==t+"/camunda:Connector/properties/"+i+"/binding/type"&&(0!==n.dataPath.indexOf(t+"/camunda:Connector/properties/"+i+"/binding/type")||"/"!==n.dataPath[t+"/camunda:Connector/properties/"+i+"/binding/type".length])||0!==n.schemaPath.indexOf("#/definitions/properties/items/properties/binding/properties/type")||"/"!==n.schemaPath["#/definitions/properties/items/properties/binding/properties/type".length]||(e.push(n),n.emUsed=!0);if(e.length){const r={keyword:"errorMessage",dataPath:t+"/camunda:Connector/properties/"+i+"/binding/type",schemaPath:"#/definitions/properties/items/properties/binding/properties/type/errorMessage",params:{errors:e},message:"invalid property.binding type "+JSON.stringify(n)+"; must be any of { property, camunda:property, camunda:inputParameter, camunda:outputParameter, camunda:in, camunda:out, camunda:in:businessKey, camunda:executionListener, camunda:field, camunda:errorEventDefinition }"};null===o?o=[r]:o.push(r),a++}const r=[];for(const e of o)e.emUsed||r.push(e);o=r,a=r.length}}if(void 0!==e.name&&"string"!=typeof e.name){const e={keyword:"type",dataPath:t+"/camunda:Connector/properties/"+i+"/binding/name",schemaPath:"#/definitions/properties/items/properties/binding/properties/name/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}if(void 0!==e.event&&"string"!=typeof e.event){const e={keyword:"type",dataPath:t+"/camunda:Connector/properties/"+i+"/binding/event",schemaPath:"#/definitions/properties/items/properties/binding/properties/event/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}if(void 0!==e.scriptFormat&&"string"!=typeof e.scriptFormat){const e={keyword:"type",dataPath:t+"/camunda:Connector/properties/"+i+"/binding/scriptFormat",schemaPath:"#/definitions/properties/items/properties/binding/properties/scriptFormat/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}if(void 0!==e.source&&"string"!=typeof e.source){const e={keyword:"type",dataPath:t+"/camunda:Connector/properties/"+i+"/binding/source",schemaPath:"#/definitions/properties/items/properties/binding/properties/source/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}if(void 0!==e.target&&"string"!=typeof e.target){const e={keyword:"type",dataPath:t+"/camunda:Connector/properties/"+i+"/binding/target",schemaPath:"#/definitions/properties/items/properties/binding/properties/target/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}if(void 0!==e.expression&&"boolean"!=typeof e.expression){const e={keyword:"type",dataPath:t+"/camunda:Connector/properties/"+i+"/binding/expression",schemaPath:"#/definitions/properties/items/properties/binding/properties/expression/type",params:{type:"boolean"},message:"should be boolean"};null===o?o=[e]:o.push(e),a++}if(void 0!==e.variables){let n=e.variables;if("string"!=typeof n){const e={keyword:"type",dataPath:t+"/camunda:Connector/properties/"+i+"/binding/variables",schemaPath:"#/definitions/properties/items/properties/binding/properties/variables/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}if("all"!==n&&"local"!==n){const e={keyword:"enum",dataPath:t+"/camunda:Connector/properties/"+i+"/binding/variables",schemaPath:"#/definitions/properties/items/properties/binding/properties/variables/enum",params:{allowedValues:bA.items.properties.binding.properties.variables.enum},message:"should be equal to one of the allowed values"};null===o?o=[e]:o.push(e),a++}}if(void 0!==e.sourceExpression&&"string"!=typeof e.sourceExpression){const e={keyword:"type",dataPath:t+"/camunda:Connector/properties/"+i+"/binding/sourceExpression",schemaPath:"#/definitions/properties/items/properties/binding/properties/sourceExpression/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}}else{const e={keyword:"type",dataPath:t+"/camunda:Connector/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/type",params:{type:"object"},message:"should be object"};null===o?o=[e]:o.push(e),a++}}if(void 0!==n.constraints){let e=n.constraints;if(e&&"object"==typeof e&&!Array.isArray(e)){if(void 0!==e.notEmpty&&"boolean"!=typeof e.notEmpty){const e={keyword:"type",dataPath:t+"/camunda:Connector/properties/"+i+"/constraints/notEmpty",schemaPath:"#/definitions/properties/items/properties/constraints/properties/notEmpty/type",params:{type:"boolean"},message:"should be boolean"};null===o?o=[e]:o.push(e),a++}if(void 0!==e.minLength&&"number"!=typeof e.minLength){const e={keyword:"type",dataPath:t+"/camunda:Connector/properties/"+i+"/constraints/minLength",schemaPath:"#/definitions/properties/items/properties/constraints/properties/minLength/type",params:{type:"number"},message:"should be number"};null===o?o=[e]:o.push(e),a++}if(void 0!==e.maxLength&&"number"!=typeof e.maxLength){const e={keyword:"type",dataPath:t+"/camunda:Connector/properties/"+i+"/constraints/maxLength",schemaPath:"#/definitions/properties/items/properties/constraints/properties/maxLength/type",params:{type:"number"},message:"should be number"};null===o?o=[e]:o.push(e),a++}if(void 0!==e.pattern){let n=e.pattern;const r=a;let s=!1,c=null;const p=a;if(n&&"object"==typeof n&&!Array.isArray(n)){if(void 0!==n.value&&"string"!=typeof n.value){const e={keyword:"type",dataPath:t+"/camunda:Connector/properties/"+i+"/constraints/pattern/value",schemaPath:"#/definitions/properties/items/properties/constraints/properties/pattern/oneOf/0/properties/value/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}if(void 0!==n.message&&"string"!=typeof n.message){const e={keyword:"type",dataPath:t+"/camunda:Connector/properties/"+i+"/constraints/pattern/message",schemaPath:"#/definitions/properties/items/properties/constraints/properties/pattern/oneOf/0/properties/message/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}}else{const e={keyword:"type",dataPath:t+"/camunda:Connector/properties/"+i+"/constraints/pattern",schemaPath:"#/definitions/properties/items/properties/constraints/properties/pattern/oneOf/0/type",params:{type:"object"},message:"should be object"};null===o?o=[e]:o.push(e),a++}(w=p===a)&&(s=!0,c=0);const u=a;if("string"!=typeof n){const e={keyword:"type",dataPath:t+"/camunda:Connector/properties/"+i+"/constraints/pattern",schemaPath:"#/definitions/properties/items/properties/constraints/properties/pattern/oneOf/1/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}var w;if((w=u===a)&&s?(s=!1,c=[c,1]):w&&(s=!0,c=1),s)a=r,null!==o&&(r?o.length=r:o=null);else{const e={keyword:"oneOf",dataPath:t+"/camunda:Connector/properties/"+i+"/constraints/pattern",schemaPath:"#/definitions/properties/items/properties/constraints/properties/pattern/oneOf",params:{passingSchemas:c},message:"should match exactly one schema in oneOf"};null===o?o=[e]:o.push(e),a++}}}else{const e={keyword:"type",dataPath:t+"/camunda:Connector/properties/"+i+"/constraints",schemaPath:"#/definitions/properties/items/properties/constraints/type",params:{type:"object"},message:"should be object"};null===o?o=[e]:o.push(e),a++}}}else{const e={keyword:"type",dataPath:t+"/camunda:Connector/properties/"+i,schemaPath:"#/definitions/properties/items/type",params:{type:"object"},message:"should be object"};null===o?o=[e]:o.push(e),a++}if(a>0){const e={required:{binding:[]}},n={required:{binding:function(){return'missing binding for property "'+JSON.stringify(i)+'"'}}};let r,s;for(const n of o)"errorMessage"!==n.keyword&&!n.emUsed&&n.dataPath===t+"/camunda:Connector/properties/"+i&&n.keyword in e&&0===n.schemaPath.indexOf("#/definitions/properties/items")&&/^\/[^\/]*$/.test(n.schemaPath.slice(30))&&(r=EA[n.keyword],s=e[n.keyword][n.params[r]],s&&(s.push(n),n.emUsed=!0));for(const r in e)for(const c in e[r])if(s=e[r][c],s.length){const e=n[r]&&n[r][c],p={keyword:"errorMessage",dataPath:t+"/camunda:Connector/properties/"+i,schemaPath:"#/definitions/properties/items/errorMessage",params:{errors:s},message:e?e():bA.items.errorMessage[r][c]};null===o?o=[p]:o.push(p),a++}const c=[];for(const e of o)e.emUsed||c.push(e);o=c,a=c.length}}}else{const e={keyword:"type",dataPath:t+"/camunda:Connector/properties",schemaPath:"#/definitions/properties/type",params:{type:"array"},message:"should be array"};null===o?o=[e]:o.push(e),a++}}}else{const e={keyword:"type",dataPath:t+"/camunda:Connector",schemaPath:"#/properties/camunda%3AConnector/type",params:{type:"object"},message:"should be object"};null===o?o=[e]:o.push(e),a++}}}else{const e={keyword:"type",dataPath:t,schemaPath:"#/type",params:{type:"object"},message:"should be object"};null===o?o=[e]:o.push(e),a++}return wA.errors=o,0===a}const _A={$id:"#/definitions/scopes",type:"array",title:"element template scope",description:"Special scoped bindings that allow you to configure nested elements",items:{$id:"#/scopes/item",type:"object",title:"element template scope item",description:"Scoped binding to configure nested elements",properties:{type:{$id:"#scopes/item/type",type:"string",enum:["camunda:Connector","bpmn:Error"],errorMessage:"invalid scope type ${0}; must be any of { camunda:Connector, bpmn:Error }"},properties:{$ref:"#/definitions/properties"}},required:["type","properties"],errorMessage:{required:{type:"invalid scope, missing type",properties:"invalid scope ${0/type}, missing properties=[]"}},allOf:[{if:{properties:{type:{enum:["bpmn:Error"]}},required:["type"]},then:{required:["id"],errorMessage:"invalid scope ${0/type}, missing id"}}]}};function PA(e,{dataPath:t="",parentData:n,parentDataProperty:i,rootData:r=e}={}){let o=null,a=0;if(Array.isArray(e)){const n=e.length;for(let i=0;i<n;i++){let n=e[i];const r=a;let P=!0;const S=a;if(n&&"object"==typeof n&&!Array.isArray(n))if(void 0===n.type){const e={};null===o?o=[e]:o.push(e),a++}else if(void 0!==n.type&&"bpmn:Error"!==n.type){const e={};null===o?o=[e]:o.push(e),a++}var s=S===a;if(a=r,null!==o&&(r?o.length=r:o=null),s){const e=a;if(n&&"object"==typeof n&&!Array.isArray(n)&&void 0===n.id){const e={keyword:"required",dataPath:t+"/"+i,schemaPath:"#/items/allOf/0/then/required",params:{missingProperty:"id"},message:"should have required property 'id'"};null===o?o=[e]:o.push(e),a++}if(a>0){const e=[];for(const n of o)"errorMessage"===n.keyword||n.emUsed||n.dataPath!==t+"/"+i&&(0!==n.dataPath.indexOf(t+"/"+i)||"/"!==n.dataPath[t+"/"+i.length])||0!==n.schemaPath.indexOf("#/items/allOf/0/then")||"/"!==n.schemaPath["#/items/allOf/0/then".length]||(e.push(n),n.emUsed=!0);if(e.length){const r={keyword:"errorMessage",dataPath:t+"/"+i,schemaPath:"#/items/allOf/0/then/errorMessage",params:{errors:e},message:"invalid scope "+JSON.stringify(n&&n.type)+", missing id"};null===o?o=[r]:o.push(r),a++}const r=[];for(const e of o)e.emUsed||r.push(e);o=r,a=r.length}P=s=e===a}if(!P){const e={keyword:"if",dataPath:t+"/"+i,schemaPath:"#/items/allOf/0/if",params:{failingKeyword:"then"},message:'should match "then" schema'};null===o?o=[e]:o.push(e),a++}if(n&&"object"==typeof n&&!Array.isArray(n)){if(void 0===n.type){const e={keyword:"required",dataPath:t+"/"+i,schemaPath:"#/items/required",params:{missingProperty:"type"},message:"should have required property 'type'"};null===o?o=[e]:o.push(e),a++}if(void 0===n.properties){const e={keyword:"required",dataPath:t+"/"+i,schemaPath:"#/items/required",params:{missingProperty:"properties"},message:"should have required property 'properties'"};null===o?o=[e]:o.push(e),a++}if(void 0!==n.type){let e=n.type;if("string"!=typeof e){const e={keyword:"type",dataPath:t+"/"+i+"/type",schemaPath:"#/items/properties/type/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}if("camunda:Connector"!==e&&"bpmn:Error"!==e){const e={keyword:"enum",dataPath:t+"/"+i+"/type",schemaPath:"#/items/properties/type/enum",params:{allowedValues:_A.items.properties.type.enum},message:"should be equal to one of the allowed values"};null===o?o=[e]:o.push(e),a++}if(a>0){const n=[];for(const e of o)"errorMessage"===e.keyword||e.emUsed||e.dataPath!==t+"/"+i+"/type"&&(0!==e.dataPath.indexOf(t+"/"+i+"/type")||"/"!==e.dataPath[t+"/"+i+"/type".length])||0!==e.schemaPath.indexOf("#/items/properties/type")||"/"!==e.schemaPath["#/items/properties/type".length]||(n.push(e),e.emUsed=!0);if(n.length){const r={keyword:"errorMessage",dataPath:t+"/"+i+"/type",schemaPath:"#/items/properties/type/errorMessage",params:{errors:n},message:"invalid scope type "+JSON.stringify(e)+"; must be any of { camunda:Connector, bpmn:Error }"};null===o?o=[r]:o.push(r),a++}const r=[];for(const e of o)e.emUsed||r.push(e);o=r,a=r.length}}if(void 0!==n.properties){let e=n.properties;if(Array.isArray(e)){const n=e.length;for(let r=0;r<n;r++){let n=e[r];const s=a;let P=!0;const S=a;if(n&&"object"==typeof n&&!Array.isArray(n))if(void 0===n.type){const e={};null===o?o=[e]:o.push(e),a++}else if(void 0!==n.type&&!fA(n.type,"Dropdown")){const e={};null===o?o=[e]:o.push(e),a++}var c=S===a;if(a=s,null!==o&&(s?o.length=s:o=null),c){const e=a;if(n&&"object"==typeof n&&!Array.isArray(n)&&void 0===n.choices){const e={keyword:"required",dataPath:t+"/"+i+"/properties/"+r,schemaPath:"#/definitions/properties/items/allOf/0/then/required",params:{missingProperty:"choices"},message:"should have required property 'choices'"};null===o?o=[e]:o.push(e),a++}if(a>0){const e=[];for(const n of o)"errorMessage"===n.keyword||n.emUsed||n.dataPath!==t+"/"+i+"/properties/"+r&&(0!==n.dataPath.indexOf(t+"/"+i+"/properties/"+r)||"/"!==n.dataPath[t+"/"+i+"/properties/"+r.length])||0!==n.schemaPath.indexOf("#/definitions/properties/items/allOf/0/then")||"/"!==n.schemaPath["#/definitions/properties/items/allOf/0/then".length]||(e.push(n),n.emUsed=!0);if(e.length){const n={keyword:"errorMessage",dataPath:t+"/"+i+"/properties/"+r,schemaPath:"#/definitions/properties/items/allOf/0/then/errorMessage",params:{errors:e},message:'must provide choices=[] with "Dropdown" type'};null===o?o=[n]:o.push(n),a++}const n=[];for(const e of o)e.emUsed||n.push(e);o=n,a=n.length}P=c=e===a}if(!P){const e={keyword:"if",dataPath:t+"/"+i+"/properties/"+r,schemaPath:"#/definitions/properties/items/allOf/0/if",params:{failingKeyword:"then"},message:'should match "then" schema'};null===o?o=[e]:o.push(e),a++}const O=a;let C=!0;const T=a;if(n&&"object"==typeof n&&!Array.isArray(n))if(void 0===n.binding){const e={};null===o?o=[e]:o.push(e),a++}else if(void 0!==n.binding){let e=n.binding;if(e&&"object"==typeof e&&!Array.isArray(e))if(void 0===e.type){const e={};null===o?o=[e]:o.push(e),a++}else if(void 0!==e.type&&!fA(e.type,"property")){const e={};null===o?o=[e]:o.push(e),a++}}var p=T===a;if(a=O,null!==o&&(O?o.length=O:o=null),p){const e=a;if(n&&"object"==typeof n&&!Array.isArray(n)&&void 0!==n.type){let e=n.type;if("String"!==e&&"Text"!==e&&"Hidden"!==e&&"Dropdown"!==e&&"Boolean"!==e){const e={keyword:"enum",dataPath:t+"/"+i+"/properties/"+r+"/type",schemaPath:"#/definitions/properties/items/allOf/1/then/properties/type/enum",params:{allowedValues:bA.items.allOf[1].then.properties.type.enum},message:"should be equal to one of the allowed values"};null===o?o=[e]:o.push(e),a++}if(a>0){const n=[];for(const e of o)"errorMessage"===e.keyword||e.emUsed||e.dataPath!==t+"/"+i+"/properties/"+r+"/type"&&(0!==e.dataPath.indexOf(t+"/"+i+"/properties/"+r+"/type")||"/"!==e.dataPath[t+"/"+i+"/properties/"+r+"/type".length])||0!==e.schemaPath.indexOf("#/definitions/properties/items/allOf/1/then/properties/type")||"/"!==e.schemaPath["#/definitions/properties/items/allOf/1/then/properties/type".length]||(n.push(e),e.emUsed=!0);if(n.length){const s={keyword:"errorMessage",dataPath:t+"/"+i+"/properties/"+r+"/type",schemaPath:"#/definitions/properties/items/allOf/1/then/properties/type/errorMessage",params:{errors:n},message:"invalid property type "+JSON.stringify(e)+' for binding type "property"; must be any of { String, Text, Hidden, Dropdown, Boolean }'};null===o?o=[s]:o.push(s),a++}const s=[];for(const e of o)e.emUsed||s.push(e);o=s,a=s.length}}C=p=e===a}if(!C){const e={keyword:"if",dataPath:t+"/"+i+"/properties/"+r,schemaPath:"#/definitions/properties/items/allOf/1/if",params:{failingKeyword:"then"},message:'should match "then" schema'};null===o?o=[e]:o.push(e),a++}const A=a;let R=!0;const k=a;if(n&&"object"==typeof n&&!Array.isArray(n))if(void 0===n.binding){const e={};null===o?o=[e]:o.push(e),a++}else if(void 0!==n.binding){let e=n.binding;if(e&&"object"==typeof e&&!Array.isArray(e))if(void 0===e.type){const e={};null===o?o=[e]:o.push(e),a++}else if(void 0!==e.type&&!fA(e.type,"camunda:executionListener")){const e={};null===o?o=[e]:o.push(e),a++}}var u=k===a;if(a=A,null!==o&&(A?o.length=A:o=null),u){const e=a;if(n&&"object"==typeof n&&!Array.isArray(n)&&void 0!==n.type){if("Hidden"!==n.type){const e={keyword:"enum",dataPath:t+"/"+i+"/properties/"+r+"/type",schemaPath:"#/definitions/properties/items/allOf/2/then/properties/type/enum",params:{allowedValues:bA.items.allOf[2].then.properties.type.enum},message:"should be equal to one of the allowed values"};null===o?o=[e]:o.push(e),a++}if(a>0){const e=[];for(const n of o)"errorMessage"===n.keyword||n.emUsed||n.dataPath!==t+"/"+i+"/properties/"+r+"/type"&&(0!==n.dataPath.indexOf(t+"/"+i+"/properties/"+r+"/type")||"/"!==n.dataPath[t+"/"+i+"/properties/"+r+"/type".length])||0!==n.schemaPath.indexOf("#/definitions/properties/items/allOf/2/then/properties/type")||"/"!==n.schemaPath["#/definitions/properties/items/allOf/2/then/properties/type".length]||(e.push(n),n.emUsed=!0);if(e.length){const s={keyword:"errorMessage",dataPath:t+"/"+i+"/properties/"+r+"/type",schemaPath:"#/definitions/properties/items/allOf/2/then/properties/type/errorMessage",params:{errors:e},message:"invalid property type "+JSON.stringify(n&&n.type)+' for binding type "camunda:executionListener"; must be "Hidden"'};null===o?o=[s]:o.push(s),a++}const s=[];for(const e of o)e.emUsed||s.push(e);o=s,a=s.length}}R=u=e===a}if(!R){const e={keyword:"if",dataPath:t+"/"+i+"/properties/"+r,schemaPath:"#/definitions/properties/items/allOf/2/if",params:{failingKeyword:"then"},message:'should match "then" schema'};null===o?o=[e]:o.push(e),a++}const j=a;let M=!0;const D=a;if(n&&"object"==typeof n&&!Array.isArray(n))if(void 0===n.binding){const e={};null===o?o=[e]:o.push(e),a++}else if(void 0!==n.binding){let e=n.binding;if(e&&"object"==typeof e&&!Array.isArray(e))if(void 0===e.type){const e={};null===o?o=[e]:o.push(e),a++}else if(void 0!==e.type){let t=e.type;if("camunda:property"!==t&&"camunda:outputParameter"!==t&&"camunda:in"!==t&&"camunda:in:businessKey"!==t&&"camunda:out"!==t&&"camunda:errorEventDefinition"!==t){const e={};null===o?o=[e]:o.push(e),a++}}}var l=D===a;if(a=j,null!==o&&(j?o.length=j:o=null),l){const e=a;if(n&&"object"==typeof n&&!Array.isArray(n)&&void 0!==n.type){let e=n.type;if("String"!==e&&"Hidden"!==e&&"Dropdown"!==e){const e={keyword:"enum",dataPath:t+"/"+i+"/properties/"+r+"/type",schemaPath:"#/definitions/properties/items/allOf/3/then/properties/type/enum",params:{allowedValues:bA.items.allOf[3].then.properties.type.enum},message:"should be equal to one of the allowed values"};null===o?o=[e]:o.push(e),a++}if(a>0){const s=[];for(const e of o)"errorMessage"===e.keyword||e.emUsed||e.dataPath!==t+"/"+i+"/properties/"+r+"/type"&&(0!==e.dataPath.indexOf(t+"/"+i+"/properties/"+r+"/type")||"/"!==e.dataPath[t+"/"+i+"/properties/"+r+"/type".length])||0!==e.schemaPath.indexOf("#/definitions/properties/items/allOf/3/then/properties/type")||"/"!==e.schemaPath["#/definitions/properties/items/allOf/3/then/properties/type".length]||(s.push(e),e.emUsed=!0);if(s.length){const c={keyword:"errorMessage",dataPath:t+"/"+i+"/properties/"+r+"/type",schemaPath:"#/definitions/properties/items/allOf/3/then/properties/type/errorMessage",params:{errors:s},message:"invalid property type "+JSON.stringify(e)+" for binding type "+JSON.stringify(n&&n.binding&&n.binding.type)+"; must be any of { String, Hidden, Dropdown }"};null===o?o=[c]:o.push(c),a++}const c=[];for(const e of o)e.emUsed||c.push(e);o=c,a=c.length}}M=l=e===a}if(!M){const e={keyword:"if",dataPath:t+"/"+i+"/properties/"+r,schemaPath:"#/definitions/properties/items/allOf/3/if",params:{failingKeyword:"then"},message:'should match "then" schema'};null===o?o=[e]:o.push(e),a++}const B=a;let I=!0;const N=a;if(n&&"object"==typeof n&&!Array.isArray(n))if(void 0===n.binding){const e={};null===o?o=[e]:o.push(e),a++}else if(void 0!==n.binding){let e=n.binding;if(e&&"object"==typeof e&&!Array.isArray(e))if(void 0===e.type){const e={};null===o?o=[e]:o.push(e),a++}else if(void 0!==e.type){let t=e.type;if("camunda:inputParameter"!==t&&"camunda:field"!==t){const e={};null===o?o=[e]:o.push(e),a++}}}var d=N===a;if(a=B,null!==o&&(B?o.length=B:o=null),d){const e=a;if(n&&"object"==typeof n&&!Array.isArray(n)&&void 0!==n.type){let e=n.type;if("String"!==e&&"Text"!==e&&"Hidden"!==e&&"Dropdown"!==e){const e={keyword:"enum",dataPath:t+"/"+i+"/properties/"+r+"/type",schemaPath:"#/definitions/properties/items/allOf/4/then/properties/type/enum",params:{allowedValues:bA.items.allOf[4].then.properties.type.enum},message:"should be equal to one of the allowed values"};null===o?o=[e]:o.push(e),a++}if(a>0){const s=[];for(const e of o)"errorMessage"===e.keyword||e.emUsed||e.dataPath!==t+"/"+i+"/properties/"+r+"/type"&&(0!==e.dataPath.indexOf(t+"/"+i+"/properties/"+r+"/type")||"/"!==e.dataPath[t+"/"+i+"/properties/"+r+"/type".length])||0!==e.schemaPath.indexOf("#/definitions/properties/items/allOf/4/then/properties/type")||"/"!==e.schemaPath["#/definitions/properties/items/allOf/4/then/properties/type".length]||(s.push(e),e.emUsed=!0);if(s.length){const c={keyword:"errorMessage",dataPath:t+"/"+i+"/properties/"+r+"/type",schemaPath:"#/definitions/properties/items/allOf/4/then/properties/type/errorMessage",params:{errors:s},message:"invalid property type "+JSON.stringify(e)+" for binding type "+JSON.stringify(n&&n.binding&&n.binding.type)+"; must be any of { String, Text, Hidden, Dropdown }"};null===o?o=[c]:o.push(c),a++}const c=[];for(const e of o)e.emUsed||c.push(e);o=c,a=c.length}}I=d=e===a}if(!I){const e={keyword:"if",dataPath:t+"/"+i+"/properties/"+r,schemaPath:"#/definitions/properties/items/allOf/4/if",params:{failingKeyword:"then"},message:'should match "then" schema'};null===o?o=[e]:o.push(e),a++}if(n&&"object"==typeof n&&!Array.isArray(n)){if(void 0===n.binding){const e={keyword:"required",dataPath:t+"/"+i+"/properties/"+r,schemaPath:"#/definitions/properties/items/required",params:{missingProperty:"binding"},message:"should have required property 'binding'"};null===o?o=[e]:o.push(e),a++}if(void 0!==n.value){let e=n.value;if("string"!=typeof e&&"boolean"!=typeof e){const e={keyword:"type",dataPath:t+"/"+i+"/properties/"+r+"/value",schemaPath:"#/definitions/properties/items/properties/value/type",params:{type:bA.items.properties.value.type},message:"should be string,boolean"};null===o?o=[e]:o.push(e),a++}}if(void 0!==n.description&&"string"!=typeof n.description){const e={keyword:"type",dataPath:t+"/"+i+"/properties/"+r+"/description",schemaPath:"#/definitions/properties/items/properties/description/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}if(void 0!==n.label&&"string"!=typeof n.label){const e={keyword:"type",dataPath:t+"/"+i+"/properties/"+r+"/label",schemaPath:"#/definitions/properties/items/properties/label/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}if(void 0!==n.type&&"string"!=typeof n.type){const e={keyword:"type",dataPath:t+"/"+i+"/properties/"+r+"/type",schemaPath:"#/definitions/properties/items/properties/type/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}if(void 0!==n.editable&&"boolean"!=typeof n.editable){const e={keyword:"type",dataPath:t+"/"+i+"/properties/"+r+"/editable",schemaPath:"#/definitions/properties/items/properties/editable/type",params:{type:"boolean"},message:"should be boolean"};null===o?o=[e]:o.push(e),a++}if(void 0!==n.choices){let e=n.choices;if(Array.isArray(e)){const n=e.length;for(let s=0;s<n;s++){let n=e[s];if(n&&"object"==typeof n&&!Array.isArray(n)){if(void 0===n.value){const e={keyword:"required",dataPath:t+"/"+i+"/properties/"+r+"/choices/"+s,schemaPath:"#/definitions/properties/items/properties/choices/items/required",params:{missingProperty:"value"},message:"should have required property 'value'"};null===o?o=[e]:o.push(e),a++}if(void 0===n.name){const e={keyword:"required",dataPath:t+"/"+i+"/properties/"+r+"/choices/"+s,schemaPath:"#/definitions/properties/items/properties/choices/items/required",params:{missingProperty:"name"},message:"should have required property 'name'"};null===o?o=[e]:o.push(e),a++}if(void 0!==n.name&&"string"!=typeof n.name){const e={keyword:"type",dataPath:t+"/"+i+"/properties/"+r+"/choices/"+s+"/name",schemaPath:"#/definitions/properties/items/properties/choices/items/properties/name/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}if(void 0!==n.value&&"string"!=typeof n.value){const e={keyword:"type",dataPath:t+"/"+i+"/properties/"+r+"/choices/"+s+"/value",schemaPath:"#/definitions/properties/items/properties/choices/items/properties/value/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}}else{const e={keyword:"type",dataPath:t+"/"+i+"/properties/"+r+"/choices/"+s,schemaPath:"#/definitions/properties/items/properties/choices/items/type",params:{type:"object"},message:"should be object"};null===o?o=[e]:o.push(e),a++}if(a>0){const e=[];for(const n of o)"errorMessage"===n.keyword||n.emUsed||n.dataPath!==t+"/"+i+"/properties/"+r+"/choices/"+s&&(0!==n.dataPath.indexOf(t+"/"+i+"/properties/"+r+"/choices/"+s)||"/"!==n.dataPath[t+"/"+i+"/properties/"+r+"/choices/"+s.length])||0!==n.schemaPath.indexOf("#/definitions/properties/items/properties/choices/items")||"/"!==n.schemaPath["#/definitions/properties/items/properties/choices/items".length]||(e.push(n),n.emUsed=!0);if(e.length){const n={keyword:"errorMessage",dataPath:t+"/"+i+"/properties/"+r+"/choices/"+s,schemaPath:"#/definitions/properties/items/properties/choices/items/errorMessage",params:{errors:e},message:'{ name, value } must be specified for "Dropdown" choices'};null===o?o=[n]:o.push(n),a++}const n=[];for(const e of o)e.emUsed||n.push(e);o=n,a=n.length}}}else{const e={keyword:"type",dataPath:t+"/"+i+"/properties/"+r+"/choices",schemaPath:"#/definitions/properties/items/properties/choices/type",params:{type:"array"},message:"should be array"};null===o?o=[e]:o.push(e),a++}}if(void 0!==n.binding){let e=n.binding;const s=a;let c=!0;const p=a;if(e&&"object"==typeof e&&!Array.isArray(e))if(void 0===e.type){const e={};null===o?o=[e]:o.push(e),a++}else if(void 0!==e.type){let t=e.type;if("property"!==t&&"camunda:property"!==t&&"camunda:inputParameter"!==t&&"camunda:field"!==t){const e={};null===o?o=[e]:o.push(e),a++}}var h=p===a;if(a=s,null!==o&&(s?o.length=s:o=null),h){const n=a;if(e&&"object"==typeof e&&!Array.isArray(e)&&void 0===e.name){const e={keyword:"required",dataPath:t+"/"+i+"/properties/"+r+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/0/then/required",params:{missingProperty:"name"},message:"should have required property 'name'"};null===o?o=[e]:o.push(e),a++}if(a>0){const n=[];for(const e of o)"errorMessage"===e.keyword||e.emUsed||e.dataPath!==t+"/"+i+"/properties/"+r+"/binding"&&(0!==e.dataPath.indexOf(t+"/"+i+"/properties/"+r+"/binding")||"/"!==e.dataPath[t+"/"+i+"/properties/"+r+"/binding".length])||0!==e.schemaPath.indexOf("#/definitions/properties/items/properties/binding/allOf/0/then")||"/"!==e.schemaPath["#/definitions/properties/items/properties/binding/allOf/0/then".length]||(n.push(e),e.emUsed=!0);if(n.length){const s={keyword:"errorMessage",dataPath:t+"/"+i+"/properties/"+r+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/0/then/errorMessage",params:{errors:n},message:"property.binding "+JSON.stringify(e&&e.type)+" requires name"};null===o?o=[s]:o.push(s),a++}const s=[];for(const e of o)e.emUsed||s.push(e);o=s,a=s.length}c=h=n===a}if(!c){const e={keyword:"if",dataPath:t+"/"+i+"/properties/"+r+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/0/if",params:{failingKeyword:"then"},message:'should match "then" schema'};null===o?o=[e]:o.push(e),a++}const u=a;let l=!0;const d=a;if(e&&"object"==typeof e&&!Array.isArray(e))if(void 0===e.type){const e={};null===o?o=[e]:o.push(e),a++}else if(void 0!==e.type&&!fA(e.type,"camunda:outputParameter")){const e={};null===o?o=[e]:o.push(e),a++}var m=d===a;if(a=u,null!==o&&(u?o.length=u:o=null),m){const n=a;if(e&&"object"==typeof e&&!Array.isArray(e)&&void 0===e.source){const e={keyword:"required",dataPath:t+"/"+i+"/properties/"+r+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/1/then/required",params:{missingProperty:"source"},message:"should have required property 'source'"};null===o?o=[e]:o.push(e),a++}if(a>0){const n=[];for(const e of o)"errorMessage"===e.keyword||e.emUsed||e.dataPath!==t+"/"+i+"/properties/"+r+"/binding"&&(0!==e.dataPath.indexOf(t+"/"+i+"/properties/"+r+"/binding")||"/"!==e.dataPath[t+"/"+i+"/properties/"+r+"/binding".length])||0!==e.schemaPath.indexOf("#/definitions/properties/items/properties/binding/allOf/1/then")||"/"!==e.schemaPath["#/definitions/properties/items/properties/binding/allOf/1/then".length]||(n.push(e),e.emUsed=!0);if(n.length){const s={keyword:"errorMessage",dataPath:t+"/"+i+"/properties/"+r+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/1/then/errorMessage",params:{errors:n},message:"property.binding "+JSON.stringify(e&&e.type)+" requires source"};null===o?o=[s]:o.push(s),a++}const s=[];for(const e of o)e.emUsed||s.push(e);o=s,a=s.length}l=m=n===a}if(!l){const e={keyword:"if",dataPath:t+"/"+i+"/properties/"+r+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/1/if",params:{failingKeyword:"then"},message:'should match "then" schema'};null===o?o=[e]:o.push(e),a++}const _=a;let P=!0;const S=a;if(e&&"object"==typeof e&&!Array.isArray(e))if(void 0===e.type){const e={};null===o?o=[e]:o.push(e),a++}else if(void 0!==e.type&&!fA(e.type,"camunda:in")){const e={};null===o?o=[e]:o.push(e),a++}var f=S===a;if(a=_,null!==o&&(_?o.length=_:o=null),f){const n=a,s=a;let c=!1;const p=a;if(e&&"object"==typeof e&&!Array.isArray(e)&&void 0===e.variables){const e={keyword:"required",dataPath:t+"/"+i+"/properties/"+r+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/2/then/anyOf/0/required",params:{missingProperty:"variables"},message:"should have required property 'variables'"};null===o?o=[e]:o.push(e),a++}var v=p===a;if(c=c||v,!c){const n=a;if(e&&"object"==typeof e&&!Array.isArray(e)&&void 0===e.target){const e={keyword:"required",dataPath:t+"/"+i+"/properties/"+r+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/2/then/anyOf/1/required",params:{missingProperty:"target"},message:"should have required property 'target'"};null===o?o=[e]:o.push(e),a++}v=n===a;c=c||v}if(c)a=s,null!==o&&(s?o.length=s:o=null);else{const e={keyword:"anyOf",dataPath:t+"/"+i+"/properties/"+r+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/2/then/anyOf",params:{},message:"should match some schema in anyOf"};null===o?o=[e]:o.push(e),a++}if(a>0){const n=[];for(const e of o)"errorMessage"===e.keyword||e.emUsed||e.dataPath!==t+"/"+i+"/properties/"+r+"/binding"&&(0!==e.dataPath.indexOf(t+"/"+i+"/properties/"+r+"/binding")||"/"!==e.dataPath[t+"/"+i+"/properties/"+r+"/binding".length])||0!==e.schemaPath.indexOf("#/definitions/properties/items/properties/binding/allOf/2/then")||"/"!==e.schemaPath["#/definitions/properties/items/properties/binding/allOf/2/then".length]||(n.push(e),e.emUsed=!0);if(n.length){const s={keyword:"errorMessage",dataPath:t+"/"+i+"/properties/"+r+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/2/then/errorMessage",params:{errors:n},message:"property.binding "+JSON.stringify(e&&e.type)+" requires variables, target, or both"};null===o?o=[s]:o.push(s),a++}const s=[];for(const e of o)e.emUsed||s.push(e);o=s,a=s.length}P=f=n===a}if(!P){const e={keyword:"if",dataPath:t+"/"+i+"/properties/"+r+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/2/if",params:{failingKeyword:"then"},message:'should match "then" schema'};null===o?o=[e]:o.push(e),a++}const O=a;let C=!0;const T=a;if(e&&"object"==typeof e&&!Array.isArray(e))if(void 0===e.type){const e={};null===o?o=[e]:o.push(e),a++}else if(void 0!==e.type&&!fA(e.type,"camunda:out")){const e={};null===o?o=[e]:o.push(e),a++}var y=T===a;if(a=O,null!==o&&(O?o.length=O:o=null),y){const n=a,s=a;let c=!1,p=null;const u=a,l=a,d=a,h=a;let m=!1;const f=a;if(e&&"object"==typeof e&&!Array.isArray(e)&&void 0===e.source){const e={};null===o?o=[e]:o.push(e),a++}var g=f===a;if(m=m||g,!m){const t=a;if(e&&"object"==typeof e&&!Array.isArray(e)&&void 0===e.sourceExpression){const e={};null===o?o=[e]:o.push(e),a++}g=t===a;m=m||g}if(m)a=h,null!==o&&(h?o.length=h:o=null);else{const e={};null===o?o=[e]:o.push(e),a++}if(d===a){const e={keyword:"not",dataPath:t+"/"+i+"/properties/"+r+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/3/then/oneOf/0/not",params:{},message:"should NOT be valid"};null===o?o=[e]:o.push(e),a++}else a=l,null!==o&&(l?o.length=l:o=null);if(e&&"object"==typeof e&&!Array.isArray(e)&&void 0===e.variables){const e={keyword:"required",dataPath:t+"/"+i+"/properties/"+r+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/3/then/oneOf/0/required",params:{missingProperty:"variables"},message:"should have required property 'variables'"};null===o?o=[e]:o.push(e),a++}(E=u===a)&&(c=!0,p=0);const v=a,w=a,_=a,P=a;let S=!1;const O=a;if(e&&"object"==typeof e&&!Array.isArray(e)&&void 0===e.variables){const e={};null===o?o=[e]:o.push(e),a++}var b=O===a;if(S=S||b,!S){const t=a;if(e&&"object"==typeof e&&!Array.isArray(e)&&void 0===e.sourceExpression){const e={};null===o?o=[e]:o.push(e),a++}b=t===a;S=S||b}if(S)a=P,null!==o&&(P?o.length=P:o=null);else{const e={};null===o?o=[e]:o.push(e),a++}if(_===a){const e={keyword:"not",dataPath:t+"/"+i+"/properties/"+r+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/3/then/oneOf/1/not",params:{},message:"should NOT be valid"};null===o?o=[e]:o.push(e),a++}else a=w,null!==o&&(w?o.length=w:o=null);if(e&&"object"==typeof e&&!Array.isArray(e)&&void 0===e.source){const e={keyword:"required",dataPath:t+"/"+i+"/properties/"+r+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/3/then/oneOf/1/required",params:{missingProperty:"source"},message:"should have required property 'source'"};null===o?o=[e]:o.push(e),a++}if((E=v===a)&&c)c=!1,p=[p,1];else{E&&(c=!0,p=1);const n=a,s=a,u=a,l=a;let d=!1;const h=a;if(e&&"object"==typeof e&&!Array.isArray(e)&&void 0===e.variables){const e={};null===o?o=[e]:o.push(e),a++}var x=h===a;if(d=d||x,!d){const t=a;if(e&&"object"==typeof e&&!Array.isArray(e)&&void 0===e.source){const e={};null===o?o=[e]:o.push(e),a++}x=t===a;d=d||x}if(d)a=l,null!==o&&(l?o.length=l:o=null);else{const e={};null===o?o=[e]:o.push(e),a++}if(u===a){const e={keyword:"not",dataPath:t+"/"+i+"/properties/"+r+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/3/then/oneOf/2/not",params:{},message:"should NOT be valid"};null===o?o=[e]:o.push(e),a++}else a=s,null!==o&&(s?o.length=s:o=null);if(e&&"object"==typeof e&&!Array.isArray(e)&&void 0===e.sourceExpression){const e={keyword:"required",dataPath:t+"/"+i+"/properties/"+r+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/3/then/oneOf/2/required",params:{missingProperty:"sourceExpression"},message:"should have required property 'sourceExpression'"};null===o?o=[e]:o.push(e),a++}if((E=n===a)&&c)c=!1,p=[p,2];else{E&&(c=!0,p=2);const n=a,s=a,u=a;if(e&&"object"==typeof e&&!Array.isArray(e)&&void 0===e.source){const e={};null===o?o=[e]:o.push(e),a++}if(u===a){const e={keyword:"not",dataPath:t+"/"+i+"/properties/"+r+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/3/then/oneOf/3/not",params:{},message:"should NOT be valid"};null===o?o=[e]:o.push(e),a++}else a=s,null!==o&&(s?o.length=s:o=null);if(e&&"object"==typeof e&&!Array.isArray(e)){if(void 0===e.variables){const e={keyword:"required",dataPath:t+"/"+i+"/properties/"+r+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/3/then/oneOf/3/required",params:{missingProperty:"variables"},message:"should have required property 'variables'"};null===o?o=[e]:o.push(e),a++}if(void 0===e.sourceExpression){const e={keyword:"required",dataPath:t+"/"+i+"/properties/"+r+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/3/then/oneOf/3/required",params:{missingProperty:"sourceExpression"},message:"should have required property 'sourceExpression'"};null===o?o=[e]:o.push(e),a++}}if((E=n===a)&&c)c=!1,p=[p,3];else{E&&(c=!0,p=3);const n=a,s=a,u=a;if(e&&"object"==typeof e&&!Array.isArray(e)&&void 0===e.sourceExpression){const e={};null===o?o=[e]:o.push(e),a++}var E;if(u===a){const e={keyword:"not",dataPath:t+"/"+i+"/properties/"+r+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/3/then/oneOf/4/not",params:{},message:"should NOT be valid"};null===o?o=[e]:o.push(e),a++}else a=s,null!==o&&(s?o.length=s:o=null);if(e&&"object"==typeof e&&!Array.isArray(e)){if(void 0===e.variables){const e={keyword:"required",dataPath:t+"/"+i+"/properties/"+r+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/3/then/oneOf/4/required",params:{missingProperty:"variables"},message:"should have required property 'variables'"};null===o?o=[e]:o.push(e),a++}if(void 0===e.source){const e={keyword:"required",dataPath:t+"/"+i+"/properties/"+r+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/3/then/oneOf/4/required",params:{missingProperty:"source"},message:"should have required property 'source'"};null===o?o=[e]:o.push(e),a++}}(E=n===a)&&c?(c=!1,p=[p,4]):E&&(c=!0,p=4)}}}if(c)a=s,null!==o&&(s?o.length=s:o=null);else{const e={keyword:"oneOf",dataPath:t+"/"+i+"/properties/"+r+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/3/then/oneOf",params:{passingSchemas:p},message:"should match exactly one schema in oneOf"};null===o?o=[e]:o.push(e),a++}if(a>0){const n=[];for(const e of o)"errorMessage"===e.keyword||e.emUsed||e.dataPath!==t+"/"+i+"/properties/"+r+"/binding"&&(0!==e.dataPath.indexOf(t+"/"+i+"/properties/"+r+"/binding")||"/"!==e.dataPath[t+"/"+i+"/properties/"+r+"/binding".length])||0!==e.schemaPath.indexOf("#/definitions/properties/items/properties/binding/allOf/3/then")||"/"!==e.schemaPath["#/definitions/properties/items/properties/binding/allOf/3/then".length]||(n.push(e),e.emUsed=!0);if(n.length){const s={keyword:"errorMessage",dataPath:t+"/"+i+"/properties/"+r+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/3/then/errorMessage",params:{errors:n},message:"property.binding "+JSON.stringify(e&&e.type)+" requires one of the following: variables, sourceExpression, source, (sourceExpression and variables), or (source and variables)"};null===o?o=[s]:o.push(s),a++}const s=[];for(const e of o)e.emUsed||s.push(e);o=s,a=s.length}C=y=n===a}if(!C){const e={keyword:"if",dataPath:t+"/"+i+"/properties/"+r+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/3/if",params:{failingKeyword:"then"},message:'should match "then" schema'};null===o?o=[e]:o.push(e),a++}const A=a;let R=!0;const k=a;if(e&&"object"==typeof e&&!Array.isArray(e))if(void 0===e.type){const e={};null===o?o=[e]:o.push(e),a++}else if(void 0!==e.type&&!fA(e.type,"camunda:errorEventDefinition")){const e={};null===o?o=[e]:o.push(e),a++}var w=k===a;if(a=A,null!==o&&(A?o.length=A:o=null),w){const n=a,s=a;let c=!1,p=null;const u=a;if(e&&"object"==typeof e&&!Array.isArray(e)&&void 0===e.errorRef){const e={keyword:"required",dataPath:t+"/"+i+"/properties/"+r+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/4/then/oneOf/0/required",params:{missingProperty:"errorRef"},message:"should have required property 'errorRef'"};null===o?o=[e]:o.push(e),a++}if(u===a&&(c=!0,p=0),c)a=s,null!==o&&(s?o.length=s:o=null);else{const e={keyword:"oneOf",dataPath:t+"/"+i+"/properties/"+r+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/4/then/oneOf",params:{passingSchemas:p},message:"should match exactly one schema in oneOf"};null===o?o=[e]:o.push(e),a++}if(a>0){const n=[];for(const e of o)"errorMessage"===e.keyword||e.emUsed||e.dataPath!==t+"/"+i+"/properties/"+r+"/binding"&&(0!==e.dataPath.indexOf(t+"/"+i+"/properties/"+r+"/binding")||"/"!==e.dataPath[t+"/"+i+"/properties/"+r+"/binding".length])||0!==e.schemaPath.indexOf("#/definitions/properties/items/properties/binding/allOf/4/then")||"/"!==e.schemaPath["#/definitions/properties/items/properties/binding/allOf/4/then".length]||(n.push(e),e.emUsed=!0);if(n.length){const s={keyword:"errorMessage",dataPath:t+"/"+i+"/properties/"+r+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/4/then/errorMessage",params:{errors:n},message:"property.binding "+JSON.stringify(e&&e.type)+" requires errorRef"};null===o?o=[s]:o.push(s),a++}const s=[];for(const e of o)e.emUsed||s.push(e);o=s,a=s.length}R=w=n===a}if(!R){const e={keyword:"if",dataPath:t+"/"+i+"/properties/"+r+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/4/if",params:{failingKeyword:"then"},message:'should match "then" schema'};null===o?o=[e]:o.push(e),a++}if(e&&"object"==typeof e&&!Array.isArray(e)){if(void 0===e.type){const e={keyword:"required",dataPath:t+"/"+i+"/properties/"+r+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/required",params:{missingProperty:"type"},message:"should have required property 'type'"};null===o?o=[e]:o.push(e),a++}if(void 0!==e.type){let n=e.type;if("string"!=typeof n){const e={keyword:"type",dataPath:t+"/"+i+"/properties/"+r+"/binding/type",schemaPath:"#/definitions/properties/items/properties/binding/properties/type/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}if("property"!==n&&"camunda:property"!==n&&"camunda:inputParameter"!==n&&"camunda:outputParameter"!==n&&"camunda:in"!==n&&"camunda:out"!==n&&"camunda:in:businessKey"!==n&&"camunda:executionListener"!==n&&"camunda:field"!==n&&"camunda:errorEventDefinition"!==n){const e={keyword:"enum",dataPath:t+"/"+i+"/properties/"+r+"/binding/type",schemaPath:"#/definitions/properties/items/properties/binding/properties/type/enum",params:{allowedValues:bA.items.properties.binding.properties.type.enum},message:"should be equal to one of the allowed values"};null===o?o=[e]:o.push(e),a++}if(a>0){const e=[];for(const n of o)"errorMessage"===n.keyword||n.emUsed||n.dataPath!==t+"/"+i+"/properties/"+r+"/binding/type"&&(0!==n.dataPath.indexOf(t+"/"+i+"/properties/"+r+"/binding/type")||"/"!==n.dataPath[t+"/"+i+"/properties/"+r+"/binding/type".length])||0!==n.schemaPath.indexOf("#/definitions/properties/items/properties/binding/properties/type")||"/"!==n.schemaPath["#/definitions/properties/items/properties/binding/properties/type".length]||(e.push(n),n.emUsed=!0);if(e.length){const s={keyword:"errorMessage",dataPath:t+"/"+i+"/properties/"+r+"/binding/type",schemaPath:"#/definitions/properties/items/properties/binding/properties/type/errorMessage",params:{errors:e},message:"invalid property.binding type "+JSON.stringify(n)+"; must be any of { property, camunda:property, camunda:inputParameter, camunda:outputParameter, camunda:in, camunda:out, camunda:in:businessKey, camunda:executionListener, camunda:field, camunda:errorEventDefinition }"};null===o?o=[s]:o.push(s),a++}const s=[];for(const e of o)e.emUsed||s.push(e);o=s,a=s.length}}if(void 0!==e.name&&"string"!=typeof e.name){const e={keyword:"type",dataPath:t+"/"+i+"/properties/"+r+"/binding/name",schemaPath:"#/definitions/properties/items/properties/binding/properties/name/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}if(void 0!==e.event&&"string"!=typeof e.event){const e={keyword:"type",dataPath:t+"/"+i+"/properties/"+r+"/binding/event",schemaPath:"#/definitions/properties/items/properties/binding/properties/event/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}if(void 0!==e.scriptFormat&&"string"!=typeof e.scriptFormat){const e={keyword:"type",dataPath:t+"/"+i+"/properties/"+r+"/binding/scriptFormat",schemaPath:"#/definitions/properties/items/properties/binding/properties/scriptFormat/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}if(void 0!==e.source&&"string"!=typeof e.source){const e={keyword:"type",dataPath:t+"/"+i+"/properties/"+r+"/binding/source",schemaPath:"#/definitions/properties/items/properties/binding/properties/source/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}if(void 0!==e.target&&"string"!=typeof e.target){const e={keyword:"type",dataPath:t+"/"+i+"/properties/"+r+"/binding/target",schemaPath:"#/definitions/properties/items/properties/binding/properties/target/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}if(void 0!==e.expression&&"boolean"!=typeof e.expression){const e={keyword:"type",dataPath:t+"/"+i+"/properties/"+r+"/binding/expression",schemaPath:"#/definitions/properties/items/properties/binding/properties/expression/type",params:{type:"boolean"},message:"should be boolean"};null===o?o=[e]:o.push(e),a++}if(void 0!==e.variables){let n=e.variables;if("string"!=typeof n){const e={keyword:"type",dataPath:t+"/"+i+"/properties/"+r+"/binding/variables",schemaPath:"#/definitions/properties/items/properties/binding/properties/variables/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}if("all"!==n&&"local"!==n){const e={keyword:"enum",dataPath:t+"/"+i+"/properties/"+r+"/binding/variables",schemaPath:"#/definitions/properties/items/properties/binding/properties/variables/enum",params:{allowedValues:bA.items.properties.binding.properties.variables.enum},message:"should be equal to one of the allowed values"};null===o?o=[e]:o.push(e),a++}}if(void 0!==e.sourceExpression&&"string"!=typeof e.sourceExpression){const e={keyword:"type",dataPath:t+"/"+i+"/properties/"+r+"/binding/sourceExpression",schemaPath:"#/definitions/properties/items/properties/binding/properties/sourceExpression/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}}else{const e={keyword:"type",dataPath:t+"/"+i+"/properties/"+r+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/type",params:{type:"object"},message:"should be object"};null===o?o=[e]:o.push(e),a++}}if(void 0!==n.constraints){let e=n.constraints;if(e&&"object"==typeof e&&!Array.isArray(e)){if(void 0!==e.notEmpty&&"boolean"!=typeof e.notEmpty){const e={keyword:"type",dataPath:t+"/"+i+"/properties/"+r+"/constraints/notEmpty",schemaPath:"#/definitions/properties/items/properties/constraints/properties/notEmpty/type",params:{type:"boolean"},message:"should be boolean"};null===o?o=[e]:o.push(e),a++}if(void 0!==e.minLength&&"number"!=typeof e.minLength){const e={keyword:"type",dataPath:t+"/"+i+"/properties/"+r+"/constraints/minLength",schemaPath:"#/definitions/properties/items/properties/constraints/properties/minLength/type",params:{type:"number"},message:"should be number"};null===o?o=[e]:o.push(e),a++}if(void 0!==e.maxLength&&"number"!=typeof e.maxLength){const e={keyword:"type",dataPath:t+"/"+i+"/properties/"+r+"/constraints/maxLength",schemaPath:"#/definitions/properties/items/properties/constraints/properties/maxLength/type",params:{type:"number"},message:"should be number"};null===o?o=[e]:o.push(e),a++}if(void 0!==e.pattern){let n=e.pattern;const s=a;let c=!1,p=null;const u=a;if(n&&"object"==typeof n&&!Array.isArray(n)){if(void 0!==n.value&&"string"!=typeof n.value){const e={keyword:"type",dataPath:t+"/"+i+"/properties/"+r+"/constraints/pattern/value",schemaPath:"#/definitions/properties/items/properties/constraints/properties/pattern/oneOf/0/properties/value/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}if(void 0!==n.message&&"string"!=typeof n.message){const e={keyword:"type",dataPath:t+"/"+i+"/properties/"+r+"/constraints/pattern/message",schemaPath:"#/definitions/properties/items/properties/constraints/properties/pattern/oneOf/0/properties/message/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}}else{const e={keyword:"type",dataPath:t+"/"+i+"/properties/"+r+"/constraints/pattern",schemaPath:"#/definitions/properties/items/properties/constraints/properties/pattern/oneOf/0/type",params:{type:"object"},message:"should be object"};null===o?o=[e]:o.push(e),a++}(_=u===a)&&(c=!0,p=0);const l=a;if("string"!=typeof n){const e={keyword:"type",dataPath:t+"/"+i+"/properties/"+r+"/constraints/pattern",schemaPath:"#/definitions/properties/items/properties/constraints/properties/pattern/oneOf/1/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}var _;if((_=l===a)&&c?(c=!1,p=[p,1]):_&&(c=!0,p=1),c)a=s,null!==o&&(s?o.length=s:o=null);else{const e={keyword:"oneOf",dataPath:t+"/"+i+"/properties/"+r+"/constraints/pattern",schemaPath:"#/definitions/properties/items/properties/constraints/properties/pattern/oneOf",params:{passingSchemas:p},message:"should match exactly one schema in oneOf"};null===o?o=[e]:o.push(e),a++}}}else{const e={keyword:"type",dataPath:t+"/"+i+"/properties/"+r+"/constraints",schemaPath:"#/definitions/properties/items/properties/constraints/type",params:{type:"object"},message:"should be object"};null===o?o=[e]:o.push(e),a++}}}else{const e={keyword:"type",dataPath:t+"/"+i+"/properties/"+r,schemaPath:"#/definitions/properties/items/type",params:{type:"object"},message:"should be object"};null===o?o=[e]:o.push(e),a++}if(a>0){const e={required:{binding:[]}},n={required:{binding:function(){return'missing binding for property "'+JSON.stringify(r)+'"'}}};let s,c;for(const n of o)"errorMessage"!==n.keyword&&!n.emUsed&&n.dataPath===t+"/"+i+"/properties/"+r&&n.keyword in e&&0===n.schemaPath.indexOf("#/definitions/properties/items")&&/^\/[^\/]*$/.test(n.schemaPath.slice(30))&&(s=EA[n.keyword],c=e[n.keyword][n.params[s]],c&&(c.push(n),n.emUsed=!0));for(const s in e)for(const p in e[s])if(c=e[s][p],c.length){const e=n[s]&&n[s][p],u={keyword:"errorMessage",dataPath:t+"/"+i+"/properties/"+r,schemaPath:"#/definitions/properties/items/errorMessage",params:{errors:c},message:e?e():bA.items.errorMessage[s][p]};null===o?o=[u]:o.push(u),a++}const p=[];for(const e of o)e.emUsed||p.push(e);o=p,a=p.length}}}else{const e={keyword:"type",dataPath:t+"/"+i+"/properties",schemaPath:"#/definitions/properties/type",params:{type:"array"},message:"should be array"};null===o?o=[e]:o.push(e),a++}}}else{const e={keyword:"type",dataPath:t+"/"+i,schemaPath:"#/items/type",params:{type:"object"},message:"should be object"};null===o?o=[e]:o.push(e),a++}if(a>0){const e={required:{type:[],properties:[]}},r={required:{properties:function(){return"invalid scope "+JSON.stringify(n&&n.type)+", missing properties=[]"}}};let s,c;for(const n of o)"errorMessage"!==n.keyword&&!n.emUsed&&n.dataPath===t+"/"+i&&n.keyword in e&&0===n.schemaPath.indexOf("#/items")&&/^\/[^\/]*$/.test(n.schemaPath.slice(7))&&(s=EA[n.keyword],c=e[n.keyword][n.params[s]],c&&(c.push(n),n.emUsed=!0));for(const n in e)for(const s in e[n])if(c=e[n][s],c.length){const e=r[n]&&r[n][s],p={keyword:"errorMessage",dataPath:t+"/"+i,schemaPath:"#/items/errorMessage",params:{errors:c},message:e?e():_A.items.errorMessage[n][s]};null===o?o=[p]:o.push(p),a++}const p=[];for(const e of o)e.emUsed||p.push(e);o=p,a=p.length}}}else{const e={keyword:"type",dataPath:t,schemaPath:"#/type",params:{type:"array"},message:"should be array"};null===o?o=[e]:o.push(e),a++}return PA.errors=o,0===a}function SA(e,{dataPath:t="",parentData:n,parentDataProperty:i,rootData:r=e}={}){let o=null,a=0;if(e&&"object"==typeof e&&!Array.isArray(e)){if(void 0===e.name){const e={keyword:"required",dataPath:t,schemaPath:"#/required",params:{missingProperty:"name"},message:"should have required property 'name'"};null===o?o=[e]:o.push(e),a++}if(void 0===e.id){const e={keyword:"required",dataPath:t,schemaPath:"#/required",params:{missingProperty:"id"},message:"should have required property 'id'"};null===o?o=[e]:o.push(e),a++}if(void 0===e.appliesTo){const e={keyword:"required",dataPath:t,schemaPath:"#/required",params:{missingProperty:"appliesTo"},message:"should have required property 'appliesTo'"};null===o?o=[e]:o.push(e),a++}if(void 0===e.properties){const e={keyword:"required",dataPath:t,schemaPath:"#/required",params:{missingProperty:"properties"},message:"should have required property 'properties'"};null===o?o=[e]:o.push(e),a++}if(void 0!==e.name&&"string"!=typeof e.name){const e={keyword:"type",dataPath:t+"/name",schemaPath:"#/properties/name/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}if(void 0!==e.id&&"string"!=typeof e.id){const e={keyword:"type",dataPath:t+"/id",schemaPath:"#/properties/id/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}if(void 0!==e.description&&"string"!=typeof e.description){const e={keyword:"type",dataPath:t+"/description",schemaPath:"#/properties/description/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}if(void 0!==e.version&&"number"!=typeof e.version){const e={keyword:"type",dataPath:t+"/version",schemaPath:"#/properties/version/type",params:{type:"number"},message:"should be number"};null===o?o=[e]:o.push(e),a++}if(void 0!==e.isDefault&&"boolean"!=typeof e.isDefault){const e={keyword:"type",dataPath:t+"/isDefault",schemaPath:"#/properties/isDefault/type",params:{type:"boolean"},message:"should be boolean"};null===o?o=[e]:o.push(e),a++}if(void 0!==e.appliesTo){let n=e.appliesTo;if(Array.isArray(n)){const e=n.length;for(let i=0;i<e;i++){let e=n[i];if("string"==typeof e){if(!xA.test(e)){const e={keyword:"pattern",dataPath:t+"/appliesTo/"+i,schemaPath:"#/properties/appliesTo/items/pattern",params:{pattern:"^(.*?:)"},message:'should match pattern "^(.*?:)"'};null===o?o=[e]:o.push(e),a++}}else{const e={keyword:"type",dataPath:t+"/appliesTo/"+i,schemaPath:"#/properties/appliesTo/items/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}if(a>0){const e={pattern:[]},n={};for(const n of o)"errorMessage"!==n.keyword&&!n.emUsed&&n.dataPath===t+"/appliesTo/"+i&&n.keyword in e&&0===n.schemaPath.indexOf("#/properties/appliesTo/items")&&/^\/[^\/]*$/.test(n.schemaPath.slice(28))&&(e[n.keyword].push(n),n.emUsed=!0);for(const r in e)if(e[r].length){const s={keyword:"errorMessage",dataPath:t+"/appliesTo/"+i,schemaPath:"#/properties/appliesTo/items/errorMessage",params:{errors:e[r]},message:r in n?n[r]():gA.properties.appliesTo.items.errorMessage[r]};null===o?o=[s]:o.push(s),a++}const r=[];for(const e of o)e.emUsed||r.push(e);o=r,a=r.length}}}else{const e={keyword:"type",dataPath:t+"/appliesTo",schemaPath:"#/properties/appliesTo/type",params:{type:"array"},message:"should be array"};null===o?o=[e]:o.push(e),a++}}if(void 0!==e.properties){let n=e.properties;if(Array.isArray(n)){const e=n.length;for(let i=0;i<e;i++){let e=n[i];const r=a;let _=!0;const P=a;if(e&&"object"==typeof e&&!Array.isArray(e))if(void 0===e.type){const e={};null===o?o=[e]:o.push(e),a++}else if(void 0!==e.type&&!fA(e.type,"Dropdown")){const e={};null===o?o=[e]:o.push(e),a++}var s=P===a;if(a=r,null!==o&&(r?o.length=r:o=null),s){const n=a;if(e&&"object"==typeof e&&!Array.isArray(e)&&void 0===e.choices){const e={keyword:"required",dataPath:t+"/properties/"+i,schemaPath:"#/definitions/properties/items/allOf/0/then/required",params:{missingProperty:"choices"},message:"should have required property 'choices'"};null===o?o=[e]:o.push(e),a++}if(a>0){const e=[];for(const n of o)"errorMessage"===n.keyword||n.emUsed||n.dataPath!==t+"/properties/"+i&&(0!==n.dataPath.indexOf(t+"/properties/"+i)||"/"!==n.dataPath[t+"/properties/"+i.length])||0!==n.schemaPath.indexOf("#/definitions/properties/items/allOf/0/then")||"/"!==n.schemaPath["#/definitions/properties/items/allOf/0/then".length]||(e.push(n),n.emUsed=!0);if(e.length){const n={keyword:"errorMessage",dataPath:t+"/properties/"+i,schemaPath:"#/definitions/properties/items/allOf/0/then/errorMessage",params:{errors:e},message:'must provide choices=[] with "Dropdown" type'};null===o?o=[n]:o.push(n),a++}const n=[];for(const e of o)e.emUsed||n.push(e);o=n,a=n.length}_=s=n===a}if(!_){const e={keyword:"if",dataPath:t+"/properties/"+i,schemaPath:"#/definitions/properties/items/allOf/0/if",params:{failingKeyword:"then"},message:'should match "then" schema'};null===o?o=[e]:o.push(e),a++}const S=a;let O=!0;const C=a;if(e&&"object"==typeof e&&!Array.isArray(e))if(void 0===e.binding){const e={};null===o?o=[e]:o.push(e),a++}else if(void 0!==e.binding){let t=e.binding;if(t&&"object"==typeof t&&!Array.isArray(t))if(void 0===t.type){const e={};null===o?o=[e]:o.push(e),a++}else if(void 0!==t.type&&!fA(t.type,"property")){const e={};null===o?o=[e]:o.push(e),a++}}var c=C===a;if(a=S,null!==o&&(S?o.length=S:o=null),c){const n=a;if(e&&"object"==typeof e&&!Array.isArray(e)&&void 0!==e.type){let n=e.type;if("String"!==n&&"Text"!==n&&"Hidden"!==n&&"Dropdown"!==n&&"Boolean"!==n){const e={keyword:"enum",dataPath:t+"/properties/"+i+"/type",schemaPath:"#/definitions/properties/items/allOf/1/then/properties/type/enum",params:{allowedValues:bA.items.allOf[1].then.properties.type.enum},message:"should be equal to one of the allowed values"};null===o?o=[e]:o.push(e),a++}if(a>0){const e=[];for(const n of o)"errorMessage"===n.keyword||n.emUsed||n.dataPath!==t+"/properties/"+i+"/type"&&(0!==n.dataPath.indexOf(t+"/properties/"+i+"/type")||"/"!==n.dataPath[t+"/properties/"+i+"/type".length])||0!==n.schemaPath.indexOf("#/definitions/properties/items/allOf/1/then/properties/type")||"/"!==n.schemaPath["#/definitions/properties/items/allOf/1/then/properties/type".length]||(e.push(n),n.emUsed=!0);if(e.length){const r={keyword:"errorMessage",dataPath:t+"/properties/"+i+"/type",schemaPath:"#/definitions/properties/items/allOf/1/then/properties/type/errorMessage",params:{errors:e},message:"invalid property type "+JSON.stringify(n)+' for binding type "property"; must be any of { String, Text, Hidden, Dropdown, Boolean }'};null===o?o=[r]:o.push(r),a++}const r=[];for(const e of o)e.emUsed||r.push(e);o=r,a=r.length}}O=c=n===a}if(!O){const e={keyword:"if",dataPath:t+"/properties/"+i,schemaPath:"#/definitions/properties/items/allOf/1/if",params:{failingKeyword:"then"},message:'should match "then" schema'};null===o?o=[e]:o.push(e),a++}const T=a;let A=!0;const R=a;if(e&&"object"==typeof e&&!Array.isArray(e))if(void 0===e.binding){const e={};null===o?o=[e]:o.push(e),a++}else if(void 0!==e.binding){let t=e.binding;if(t&&"object"==typeof t&&!Array.isArray(t))if(void 0===t.type){const e={};null===o?o=[e]:o.push(e),a++}else if(void 0!==t.type&&!fA(t.type,"camunda:executionListener")){const e={};null===o?o=[e]:o.push(e),a++}}var p=R===a;if(a=T,null!==o&&(T?o.length=T:o=null),p){const n=a;if(e&&"object"==typeof e&&!Array.isArray(e)&&void 0!==e.type){if("Hidden"!==e.type){const e={keyword:"enum",dataPath:t+"/properties/"+i+"/type",schemaPath:"#/definitions/properties/items/allOf/2/then/properties/type/enum",params:{allowedValues:bA.items.allOf[2].then.properties.type.enum},message:"should be equal to one of the allowed values"};null===o?o=[e]:o.push(e),a++}if(a>0){const n=[];for(const e of o)"errorMessage"===e.keyword||e.emUsed||e.dataPath!==t+"/properties/"+i+"/type"&&(0!==e.dataPath.indexOf(t+"/properties/"+i+"/type")||"/"!==e.dataPath[t+"/properties/"+i+"/type".length])||0!==e.schemaPath.indexOf("#/definitions/properties/items/allOf/2/then/properties/type")||"/"!==e.schemaPath["#/definitions/properties/items/allOf/2/then/properties/type".length]||(n.push(e),e.emUsed=!0);if(n.length){const r={keyword:"errorMessage",dataPath:t+"/properties/"+i+"/type",schemaPath:"#/definitions/properties/items/allOf/2/then/properties/type/errorMessage",params:{errors:n},message:"invalid property type "+JSON.stringify(e&&e.type)+' for binding type "camunda:executionListener"; must be "Hidden"'};null===o?o=[r]:o.push(r),a++}const r=[];for(const e of o)e.emUsed||r.push(e);o=r,a=r.length}}A=p=n===a}if(!A){const e={keyword:"if",dataPath:t+"/properties/"+i,schemaPath:"#/definitions/properties/items/allOf/2/if",params:{failingKeyword:"then"},message:'should match "then" schema'};null===o?o=[e]:o.push(e),a++}const k=a;let j=!0;const M=a;if(e&&"object"==typeof e&&!Array.isArray(e))if(void 0===e.binding){const e={};null===o?o=[e]:o.push(e),a++}else if(void 0!==e.binding){let t=e.binding;if(t&&"object"==typeof t&&!Array.isArray(t))if(void 0===t.type){const e={};null===o?o=[e]:o.push(e),a++}else if(void 0!==t.type){let e=t.type;if("camunda:property"!==e&&"camunda:outputParameter"!==e&&"camunda:in"!==e&&"camunda:in:businessKey"!==e&&"camunda:out"!==e&&"camunda:errorEventDefinition"!==e){const e={};null===o?o=[e]:o.push(e),a++}}}var u=M===a;if(a=k,null!==o&&(k?o.length=k:o=null),u){const n=a;if(e&&"object"==typeof e&&!Array.isArray(e)&&void 0!==e.type){let n=e.type;if("String"!==n&&"Hidden"!==n&&"Dropdown"!==n){const e={keyword:"enum",dataPath:t+"/properties/"+i+"/type",schemaPath:"#/definitions/properties/items/allOf/3/then/properties/type/enum",params:{allowedValues:bA.items.allOf[3].then.properties.type.enum},message:"should be equal to one of the allowed values"};null===o?o=[e]:o.push(e),a++}if(a>0){const r=[];for(const e of o)"errorMessage"===e.keyword||e.emUsed||e.dataPath!==t+"/properties/"+i+"/type"&&(0!==e.dataPath.indexOf(t+"/properties/"+i+"/type")||"/"!==e.dataPath[t+"/properties/"+i+"/type".length])||0!==e.schemaPath.indexOf("#/definitions/properties/items/allOf/3/then/properties/type")||"/"!==e.schemaPath["#/definitions/properties/items/allOf/3/then/properties/type".length]||(r.push(e),e.emUsed=!0);if(r.length){const s={keyword:"errorMessage",dataPath:t+"/properties/"+i+"/type",schemaPath:"#/definitions/properties/items/allOf/3/then/properties/type/errorMessage",params:{errors:r},message:"invalid property type "+JSON.stringify(n)+" for binding type "+JSON.stringify(e&&e.binding&&e.binding.type)+"; must be any of { String, Hidden, Dropdown }"};null===o?o=[s]:o.push(s),a++}const s=[];for(const e of o)e.emUsed||s.push(e);o=s,a=s.length}}j=u=n===a}if(!j){const e={keyword:"if",dataPath:t+"/properties/"+i,schemaPath:"#/definitions/properties/items/allOf/3/if",params:{failingKeyword:"then"},message:'should match "then" schema'};null===o?o=[e]:o.push(e),a++}const D=a;let B=!0;const I=a;if(e&&"object"==typeof e&&!Array.isArray(e))if(void 0===e.binding){const e={};null===o?o=[e]:o.push(e),a++}else if(void 0!==e.binding){let t=e.binding;if(t&&"object"==typeof t&&!Array.isArray(t))if(void 0===t.type){const e={};null===o?o=[e]:o.push(e),a++}else if(void 0!==t.type){let e=t.type;if("camunda:inputParameter"!==e&&"camunda:field"!==e){const e={};null===o?o=[e]:o.push(e),a++}}}var l=I===a;if(a=D,null!==o&&(D?o.length=D:o=null),l){const n=a;if(e&&"object"==typeof e&&!Array.isArray(e)&&void 0!==e.type){let n=e.type;if("String"!==n&&"Text"!==n&&"Hidden"!==n&&"Dropdown"!==n){const e={keyword:"enum",dataPath:t+"/properties/"+i+"/type",schemaPath:"#/definitions/properties/items/allOf/4/then/properties/type/enum",params:{allowedValues:bA.items.allOf[4].then.properties.type.enum},message:"should be equal to one of the allowed values"};null===o?o=[e]:o.push(e),a++}if(a>0){const r=[];for(const e of o)"errorMessage"===e.keyword||e.emUsed||e.dataPath!==t+"/properties/"+i+"/type"&&(0!==e.dataPath.indexOf(t+"/properties/"+i+"/type")||"/"!==e.dataPath[t+"/properties/"+i+"/type".length])||0!==e.schemaPath.indexOf("#/definitions/properties/items/allOf/4/then/properties/type")||"/"!==e.schemaPath["#/definitions/properties/items/allOf/4/then/properties/type".length]||(r.push(e),e.emUsed=!0);if(r.length){const s={keyword:"errorMessage",dataPath:t+"/properties/"+i+"/type",schemaPath:"#/definitions/properties/items/allOf/4/then/properties/type/errorMessage",params:{errors:r},message:"invalid property type "+JSON.stringify(n)+" for binding type "+JSON.stringify(e&&e.binding&&e.binding.type)+"; must be any of { String, Text, Hidden, Dropdown }"};null===o?o=[s]:o.push(s),a++}const s=[];for(const e of o)e.emUsed||s.push(e);o=s,a=s.length}}B=l=n===a}if(!B){const e={keyword:"if",dataPath:t+"/properties/"+i,schemaPath:"#/definitions/properties/items/allOf/4/if",params:{failingKeyword:"then"},message:'should match "then" schema'};null===o?o=[e]:o.push(e),a++}if(e&&"object"==typeof e&&!Array.isArray(e)){if(void 0===e.binding){const e={keyword:"required",dataPath:t+"/properties/"+i,schemaPath:"#/definitions/properties/items/required",params:{missingProperty:"binding"},message:"should have required property 'binding'"};null===o?o=[e]:o.push(e),a++}if(void 0!==e.value){let n=e.value;if("string"!=typeof n&&"boolean"!=typeof n){const e={keyword:"type",dataPath:t+"/properties/"+i+"/value",schemaPath:"#/definitions/properties/items/properties/value/type",params:{type:bA.items.properties.value.type},message:"should be string,boolean"};null===o?o=[e]:o.push(e),a++}}if(void 0!==e.description&&"string"!=typeof e.description){const e={keyword:"type",dataPath:t+"/properties/"+i+"/description",schemaPath:"#/definitions/properties/items/properties/description/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}if(void 0!==e.label&&"string"!=typeof e.label){const e={keyword:"type",dataPath:t+"/properties/"+i+"/label",schemaPath:"#/definitions/properties/items/properties/label/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}if(void 0!==e.type&&"string"!=typeof e.type){const e={keyword:"type",dataPath:t+"/properties/"+i+"/type",schemaPath:"#/definitions/properties/items/properties/type/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}if(void 0!==e.editable&&"boolean"!=typeof e.editable){const e={keyword:"type",dataPath:t+"/properties/"+i+"/editable",schemaPath:"#/definitions/properties/items/properties/editable/type",params:{type:"boolean"},message:"should be boolean"};null===o?o=[e]:o.push(e),a++}if(void 0!==e.choices){let n=e.choices;if(Array.isArray(n)){const e=n.length;for(let r=0;r<e;r++){let e=n[r];if(e&&"object"==typeof e&&!Array.isArray(e)){if(void 0===e.value){const e={keyword:"required",dataPath:t+"/properties/"+i+"/choices/"+r,schemaPath:"#/definitions/properties/items/properties/choices/items/required",params:{missingProperty:"value"},message:"should have required property 'value'"};null===o?o=[e]:o.push(e),a++}if(void 0===e.name){const e={keyword:"required",dataPath:t+"/properties/"+i+"/choices/"+r,schemaPath:"#/definitions/properties/items/properties/choices/items/required",params:{missingProperty:"name"},message:"should have required property 'name'"};null===o?o=[e]:o.push(e),a++}if(void 0!==e.name&&"string"!=typeof e.name){const e={keyword:"type",dataPath:t+"/properties/"+i+"/choices/"+r+"/name",schemaPath:"#/definitions/properties/items/properties/choices/items/properties/name/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}if(void 0!==e.value&&"string"!=typeof e.value){const e={keyword:"type",dataPath:t+"/properties/"+i+"/choices/"+r+"/value",schemaPath:"#/definitions/properties/items/properties/choices/items/properties/value/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}}else{const e={keyword:"type",dataPath:t+"/properties/"+i+"/choices/"+r,schemaPath:"#/definitions/properties/items/properties/choices/items/type",params:{type:"object"},message:"should be object"};null===o?o=[e]:o.push(e),a++}if(a>0){const e=[];for(const n of o)"errorMessage"===n.keyword||n.emUsed||n.dataPath!==t+"/properties/"+i+"/choices/"+r&&(0!==n.dataPath.indexOf(t+"/properties/"+i+"/choices/"+r)||"/"!==n.dataPath[t+"/properties/"+i+"/choices/"+r.length])||0!==n.schemaPath.indexOf("#/definitions/properties/items/properties/choices/items")||"/"!==n.schemaPath["#/definitions/properties/items/properties/choices/items".length]||(e.push(n),n.emUsed=!0);if(e.length){const n={keyword:"errorMessage",dataPath:t+"/properties/"+i+"/choices/"+r,schemaPath:"#/definitions/properties/items/properties/choices/items/errorMessage",params:{errors:e},message:'{ name, value } must be specified for "Dropdown" choices'};null===o?o=[n]:o.push(n),a++}const n=[];for(const e of o)e.emUsed||n.push(e);o=n,a=n.length}}}else{const e={keyword:"type",dataPath:t+"/properties/"+i+"/choices",schemaPath:"#/definitions/properties/items/properties/choices/type",params:{type:"array"},message:"should be array"};null===o?o=[e]:o.push(e),a++}}if(void 0!==e.binding){let n=e.binding;const r=a;let s=!0;const c=a;if(n&&"object"==typeof n&&!Array.isArray(n))if(void 0===n.type){const e={};null===o?o=[e]:o.push(e),a++}else if(void 0!==n.type){let e=n.type;if("property"!==e&&"camunda:property"!==e&&"camunda:inputParameter"!==e&&"camunda:field"!==e){const e={};null===o?o=[e]:o.push(e),a++}}var d=c===a;if(a=r,null!==o&&(r?o.length=r:o=null),d){const e=a;if(n&&"object"==typeof n&&!Array.isArray(n)&&void 0===n.name){const e={keyword:"required",dataPath:t+"/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/0/then/required",params:{missingProperty:"name"},message:"should have required property 'name'"};null===o?o=[e]:o.push(e),a++}if(a>0){const e=[];for(const n of o)"errorMessage"===n.keyword||n.emUsed||n.dataPath!==t+"/properties/"+i+"/binding"&&(0!==n.dataPath.indexOf(t+"/properties/"+i+"/binding")||"/"!==n.dataPath[t+"/properties/"+i+"/binding".length])||0!==n.schemaPath.indexOf("#/definitions/properties/items/properties/binding/allOf/0/then")||"/"!==n.schemaPath["#/definitions/properties/items/properties/binding/allOf/0/then".length]||(e.push(n),n.emUsed=!0);if(e.length){const r={keyword:"errorMessage",dataPath:t+"/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/0/then/errorMessage",params:{errors:e},message:"property.binding "+JSON.stringify(n&&n.type)+" requires name"};null===o?o=[r]:o.push(r),a++}const r=[];for(const e of o)e.emUsed||r.push(e);o=r,a=r.length}s=d=e===a}if(!s){const e={keyword:"if",dataPath:t+"/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/0/if",params:{failingKeyword:"then"},message:'should match "then" schema'};null===o?o=[e]:o.push(e),a++}const p=a;let u=!0;const l=a;if(n&&"object"==typeof n&&!Array.isArray(n))if(void 0===n.type){const e={};null===o?o=[e]:o.push(e),a++}else if(void 0!==n.type&&!fA(n.type,"camunda:outputParameter")){const e={};null===o?o=[e]:o.push(e),a++}var h=l===a;if(a=p,null!==o&&(p?o.length=p:o=null),h){const e=a;if(n&&"object"==typeof n&&!Array.isArray(n)&&void 0===n.source){const e={keyword:"required",dataPath:t+"/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/1/then/required",params:{missingProperty:"source"},message:"should have required property 'source'"};null===o?o=[e]:o.push(e),a++}if(a>0){const e=[];for(const n of o)"errorMessage"===n.keyword||n.emUsed||n.dataPath!==t+"/properties/"+i+"/binding"&&(0!==n.dataPath.indexOf(t+"/properties/"+i+"/binding")||"/"!==n.dataPath[t+"/properties/"+i+"/binding".length])||0!==n.schemaPath.indexOf("#/definitions/properties/items/properties/binding/allOf/1/then")||"/"!==n.schemaPath["#/definitions/properties/items/properties/binding/allOf/1/then".length]||(e.push(n),n.emUsed=!0);if(e.length){const r={keyword:"errorMessage",dataPath:t+"/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/1/then/errorMessage",params:{errors:e},message:"property.binding "+JSON.stringify(n&&n.type)+" requires source"};null===o?o=[r]:o.push(r),a++}const r=[];for(const e of o)e.emUsed||r.push(e);o=r,a=r.length}u=h=e===a}if(!u){const e={keyword:"if",dataPath:t+"/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/1/if",params:{failingKeyword:"then"},message:'should match "then" schema'};null===o?o=[e]:o.push(e),a++}const w=a;let _=!0;const P=a;if(n&&"object"==typeof n&&!Array.isArray(n))if(void 0===n.type){const e={};null===o?o=[e]:o.push(e),a++}else if(void 0!==n.type&&!fA(n.type,"camunda:in")){const e={};null===o?o=[e]:o.push(e),a++}var m=P===a;if(a=w,null!==o&&(w?o.length=w:o=null),m){const e=a,r=a;let s=!1;const c=a;if(n&&"object"==typeof n&&!Array.isArray(n)&&void 0===n.variables){const e={keyword:"required",dataPath:t+"/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/2/then/anyOf/0/required",params:{missingProperty:"variables"},message:"should have required property 'variables'"};null===o?o=[e]:o.push(e),a++}var f=c===a;if(s=s||f,!s){const e=a;if(n&&"object"==typeof n&&!Array.isArray(n)&&void 0===n.target){const e={keyword:"required",dataPath:t+"/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/2/then/anyOf/1/required",params:{missingProperty:"target"},message:"should have required property 'target'"};null===o?o=[e]:o.push(e),a++}f=e===a;s=s||f}if(s)a=r,null!==o&&(r?o.length=r:o=null);else{const e={keyword:"anyOf",dataPath:t+"/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/2/then/anyOf",params:{},message:"should match some schema in anyOf"};null===o?o=[e]:o.push(e),a++}if(a>0){const e=[];for(const n of o)"errorMessage"===n.keyword||n.emUsed||n.dataPath!==t+"/properties/"+i+"/binding"&&(0!==n.dataPath.indexOf(t+"/properties/"+i+"/binding")||"/"!==n.dataPath[t+"/properties/"+i+"/binding".length])||0!==n.schemaPath.indexOf("#/definitions/properties/items/properties/binding/allOf/2/then")||"/"!==n.schemaPath["#/definitions/properties/items/properties/binding/allOf/2/then".length]||(e.push(n),n.emUsed=!0);if(e.length){const r={keyword:"errorMessage",dataPath:t+"/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/2/then/errorMessage",params:{errors:e},message:"property.binding "+JSON.stringify(n&&n.type)+" requires variables, target, or both"};null===o?o=[r]:o.push(r),a++}const r=[];for(const e of o)e.emUsed||r.push(e);o=r,a=r.length}_=m=e===a}if(!_){const e={keyword:"if",dataPath:t+"/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/2/if",params:{failingKeyword:"then"},message:'should match "then" schema'};null===o?o=[e]:o.push(e),a++}const S=a;let O=!0;const C=a;if(n&&"object"==typeof n&&!Array.isArray(n))if(void 0===n.type){const e={};null===o?o=[e]:o.push(e),a++}else if(void 0!==n.type&&!fA(n.type,"camunda:out")){const e={};null===o?o=[e]:o.push(e),a++}var v=C===a;if(a=S,null!==o&&(S?o.length=S:o=null),v){const e=a,r=a;let s=!1,c=null;const p=a,u=a,l=a,d=a;let h=!1;const m=a;if(n&&"object"==typeof n&&!Array.isArray(n)&&void 0===n.source){const e={};null===o?o=[e]:o.push(e),a++}var y=m===a;if(h=h||y,!h){const e=a;if(n&&"object"==typeof n&&!Array.isArray(n)&&void 0===n.sourceExpression){const e={};null===o?o=[e]:o.push(e),a++}y=e===a;h=h||y}if(h)a=d,null!==o&&(d?o.length=d:o=null);else{const e={};null===o?o=[e]:o.push(e),a++}if(l===a){const e={keyword:"not",dataPath:t+"/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/3/then/oneOf/0/not",params:{},message:"should NOT be valid"};null===o?o=[e]:o.push(e),a++}else a=u,null!==o&&(u?o.length=u:o=null);if(n&&"object"==typeof n&&!Array.isArray(n)&&void 0===n.variables){const e={keyword:"required",dataPath:t+"/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/3/then/oneOf/0/required",params:{missingProperty:"variables"},message:"should have required property 'variables'"};null===o?o=[e]:o.push(e),a++}(x=p===a)&&(s=!0,c=0);const f=a,E=a,w=a,_=a;let P=!1;const S=a;if(n&&"object"==typeof n&&!Array.isArray(n)&&void 0===n.variables){const e={};null===o?o=[e]:o.push(e),a++}var g=S===a;if(P=P||g,!P){const e=a;if(n&&"object"==typeof n&&!Array.isArray(n)&&void 0===n.sourceExpression){const e={};null===o?o=[e]:o.push(e),a++}g=e===a;P=P||g}if(P)a=_,null!==o&&(_?o.length=_:o=null);else{const e={};null===o?o=[e]:o.push(e),a++}if(w===a){const e={keyword:"not",dataPath:t+"/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/3/then/oneOf/1/not",params:{},message:"should NOT be valid"};null===o?o=[e]:o.push(e),a++}else a=E,null!==o&&(E?o.length=E:o=null);if(n&&"object"==typeof n&&!Array.isArray(n)&&void 0===n.source){const e={keyword:"required",dataPath:t+"/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/3/then/oneOf/1/required",params:{missingProperty:"source"},message:"should have required property 'source'"};null===o?o=[e]:o.push(e),a++}if((x=f===a)&&s)s=!1,c=[c,1];else{x&&(s=!0,c=1);const e=a,r=a,p=a,u=a;let l=!1;const d=a;if(n&&"object"==typeof n&&!Array.isArray(n)&&void 0===n.variables){const e={};null===o?o=[e]:o.push(e),a++}var b=d===a;if(l=l||b,!l){const e=a;if(n&&"object"==typeof n&&!Array.isArray(n)&&void 0===n.source){const e={};null===o?o=[e]:o.push(e),a++}b=e===a;l=l||b}if(l)a=u,null!==o&&(u?o.length=u:o=null);else{const e={};null===o?o=[e]:o.push(e),a++}if(p===a){const e={keyword:"not",dataPath:t+"/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/3/then/oneOf/2/not",params:{},message:"should NOT be valid"};null===o?o=[e]:o.push(e),a++}else a=r,null!==o&&(r?o.length=r:o=null);if(n&&"object"==typeof n&&!Array.isArray(n)&&void 0===n.sourceExpression){const e={keyword:"required",dataPath:t+"/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/3/then/oneOf/2/required",params:{missingProperty:"sourceExpression"},message:"should have required property 'sourceExpression'"};null===o?o=[e]:o.push(e),a++}if((x=e===a)&&s)s=!1,c=[c,2];else{x&&(s=!0,c=2);const e=a,r=a,p=a;if(n&&"object"==typeof n&&!Array.isArray(n)&&void 0===n.source){const e={};null===o?o=[e]:o.push(e),a++}if(p===a){const e={keyword:"not",dataPath:t+"/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/3/then/oneOf/3/not",params:{},message:"should NOT be valid"};null===o?o=[e]:o.push(e),a++}else a=r,null!==o&&(r?o.length=r:o=null);if(n&&"object"==typeof n&&!Array.isArray(n)){if(void 0===n.variables){const e={keyword:"required",dataPath:t+"/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/3/then/oneOf/3/required",params:{missingProperty:"variables"},message:"should have required property 'variables'"};null===o?o=[e]:o.push(e),a++}if(void 0===n.sourceExpression){const e={keyword:"required",dataPath:t+"/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/3/then/oneOf/3/required",params:{missingProperty:"sourceExpression"},message:"should have required property 'sourceExpression'"};null===o?o=[e]:o.push(e),a++}}if((x=e===a)&&s)s=!1,c=[c,3];else{x&&(s=!0,c=3);const e=a,r=a,p=a;if(n&&"object"==typeof n&&!Array.isArray(n)&&void 0===n.sourceExpression){const e={};null===o?o=[e]:o.push(e),a++}var x;if(p===a){const e={keyword:"not",dataPath:t+"/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/3/then/oneOf/4/not",params:{},message:"should NOT be valid"};null===o?o=[e]:o.push(e),a++}else a=r,null!==o&&(r?o.length=r:o=null);if(n&&"object"==typeof n&&!Array.isArray(n)){if(void 0===n.variables){const e={keyword:"required",dataPath:t+"/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/3/then/oneOf/4/required",params:{missingProperty:"variables"},message:"should have required property 'variables'"};null===o?o=[e]:o.push(e),a++}if(void 0===n.source){const e={keyword:"required",dataPath:t+"/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/3/then/oneOf/4/required",params:{missingProperty:"source"},message:"should have required property 'source'"};null===o?o=[e]:o.push(e),a++}}(x=e===a)&&s?(s=!1,c=[c,4]):x&&(s=!0,c=4)}}}if(s)a=r,null!==o&&(r?o.length=r:o=null);else{const e={keyword:"oneOf",dataPath:t+"/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/3/then/oneOf",params:{passingSchemas:c},message:"should match exactly one schema in oneOf"};null===o?o=[e]:o.push(e),a++}if(a>0){const e=[];for(const n of o)"errorMessage"===n.keyword||n.emUsed||n.dataPath!==t+"/properties/"+i+"/binding"&&(0!==n.dataPath.indexOf(t+"/properties/"+i+"/binding")||"/"!==n.dataPath[t+"/properties/"+i+"/binding".length])||0!==n.schemaPath.indexOf("#/definitions/properties/items/properties/binding/allOf/3/then")||"/"!==n.schemaPath["#/definitions/properties/items/properties/binding/allOf/3/then".length]||(e.push(n),n.emUsed=!0);if(e.length){const r={keyword:"errorMessage",dataPath:t+"/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/3/then/errorMessage",params:{errors:e},message:"property.binding "+JSON.stringify(n&&n.type)+" requires one of the following: variables, sourceExpression, source, (sourceExpression and variables), or (source and variables)"};null===o?o=[r]:o.push(r),a++}const r=[];for(const e of o)e.emUsed||r.push(e);o=r,a=r.length}O=v=e===a}if(!O){const e={keyword:"if",dataPath:t+"/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/3/if",params:{failingKeyword:"then"},message:'should match "then" schema'};null===o?o=[e]:o.push(e),a++}const T=a;let A=!0;const R=a;if(n&&"object"==typeof n&&!Array.isArray(n))if(void 0===n.type){const e={};null===o?o=[e]:o.push(e),a++}else if(void 0!==n.type&&!fA(n.type,"camunda:errorEventDefinition")){const e={};null===o?o=[e]:o.push(e),a++}var E=R===a;if(a=T,null!==o&&(T?o.length=T:o=null),E){const e=a,r=a;let s=!1,c=null;const p=a;if(n&&"object"==typeof n&&!Array.isArray(n)&&void 0===n.errorRef){const e={keyword:"required",dataPath:t+"/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/4/then/oneOf/0/required",params:{missingProperty:"errorRef"},message:"should have required property 'errorRef'"};null===o?o=[e]:o.push(e),a++}if(p===a&&(s=!0,c=0),s)a=r,null!==o&&(r?o.length=r:o=null);else{const e={keyword:"oneOf",dataPath:t+"/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/4/then/oneOf",params:{passingSchemas:c},message:"should match exactly one schema in oneOf"};null===o?o=[e]:o.push(e),a++}if(a>0){const e=[];for(const n of o)"errorMessage"===n.keyword||n.emUsed||n.dataPath!==t+"/properties/"+i+"/binding"&&(0!==n.dataPath.indexOf(t+"/properties/"+i+"/binding")||"/"!==n.dataPath[t+"/properties/"+i+"/binding".length])||0!==n.schemaPath.indexOf("#/definitions/properties/items/properties/binding/allOf/4/then")||"/"!==n.schemaPath["#/definitions/properties/items/properties/binding/allOf/4/then".length]||(e.push(n),n.emUsed=!0);if(e.length){const r={keyword:"errorMessage",dataPath:t+"/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/4/then/errorMessage",params:{errors:e},message:"property.binding "+JSON.stringify(n&&n.type)+" requires errorRef"};null===o?o=[r]:o.push(r),a++}const r=[];for(const e of o)e.emUsed||r.push(e);o=r,a=r.length}A=E=e===a}if(!A){const e={keyword:"if",dataPath:t+"/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/allOf/4/if",params:{failingKeyword:"then"},message:'should match "then" schema'};null===o?o=[e]:o.push(e),a++}if(n&&"object"==typeof n&&!Array.isArray(n)){if(void 0===n.type){const e={keyword:"required",dataPath:t+"/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/required",params:{missingProperty:"type"},message:"should have required property 'type'"};null===o?o=[e]:o.push(e),a++}if(void 0!==n.type){let e=n.type;if("string"!=typeof e){const e={keyword:"type",dataPath:t+"/properties/"+i+"/binding/type",schemaPath:"#/definitions/properties/items/properties/binding/properties/type/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}if("property"!==e&&"camunda:property"!==e&&"camunda:inputParameter"!==e&&"camunda:outputParameter"!==e&&"camunda:in"!==e&&"camunda:out"!==e&&"camunda:in:businessKey"!==e&&"camunda:executionListener"!==e&&"camunda:field"!==e&&"camunda:errorEventDefinition"!==e){const e={keyword:"enum",dataPath:t+"/properties/"+i+"/binding/type",schemaPath:"#/definitions/properties/items/properties/binding/properties/type/enum",params:{allowedValues:bA.items.properties.binding.properties.type.enum},message:"should be equal to one of the allowed values"};null===o?o=[e]:o.push(e),a++}if(a>0){const n=[];for(const e of o)"errorMessage"===e.keyword||e.emUsed||e.dataPath!==t+"/properties/"+i+"/binding/type"&&(0!==e.dataPath.indexOf(t+"/properties/"+i+"/binding/type")||"/"!==e.dataPath[t+"/properties/"+i+"/binding/type".length])||0!==e.schemaPath.indexOf("#/definitions/properties/items/properties/binding/properties/type")||"/"!==e.schemaPath["#/definitions/properties/items/properties/binding/properties/type".length]||(n.push(e),e.emUsed=!0);if(n.length){const r={keyword:"errorMessage",dataPath:t+"/properties/"+i+"/binding/type",schemaPath:"#/definitions/properties/items/properties/binding/properties/type/errorMessage",params:{errors:n},message:"invalid property.binding type "+JSON.stringify(e)+"; must be any of { property, camunda:property, camunda:inputParameter, camunda:outputParameter, camunda:in, camunda:out, camunda:in:businessKey, camunda:executionListener, camunda:field, camunda:errorEventDefinition }"};null===o?o=[r]:o.push(r),a++}const r=[];for(const e of o)e.emUsed||r.push(e);o=r,a=r.length}}if(void 0!==n.name&&"string"!=typeof n.name){const e={keyword:"type",dataPath:t+"/properties/"+i+"/binding/name",schemaPath:"#/definitions/properties/items/properties/binding/properties/name/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}if(void 0!==n.event&&"string"!=typeof n.event){const e={keyword:"type",dataPath:t+"/properties/"+i+"/binding/event",schemaPath:"#/definitions/properties/items/properties/binding/properties/event/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}if(void 0!==n.scriptFormat&&"string"!=typeof n.scriptFormat){const e={keyword:"type",dataPath:t+"/properties/"+i+"/binding/scriptFormat",schemaPath:"#/definitions/properties/items/properties/binding/properties/scriptFormat/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}if(void 0!==n.source&&"string"!=typeof n.source){const e={keyword:"type",dataPath:t+"/properties/"+i+"/binding/source",schemaPath:"#/definitions/properties/items/properties/binding/properties/source/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}if(void 0!==n.target&&"string"!=typeof n.target){const e={keyword:"type",dataPath:t+"/properties/"+i+"/binding/target",schemaPath:"#/definitions/properties/items/properties/binding/properties/target/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}if(void 0!==n.expression&&"boolean"!=typeof n.expression){const e={keyword:"type",dataPath:t+"/properties/"+i+"/binding/expression",schemaPath:"#/definitions/properties/items/properties/binding/properties/expression/type",params:{type:"boolean"},message:"should be boolean"};null===o?o=[e]:o.push(e),a++}if(void 0!==n.variables){let e=n.variables;if("string"!=typeof e){const e={keyword:"type",dataPath:t+"/properties/"+i+"/binding/variables",schemaPath:"#/definitions/properties/items/properties/binding/properties/variables/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}if("all"!==e&&"local"!==e){const e={keyword:"enum",dataPath:t+"/properties/"+i+"/binding/variables",schemaPath:"#/definitions/properties/items/properties/binding/properties/variables/enum",params:{allowedValues:bA.items.properties.binding.properties.variables.enum},message:"should be equal to one of the allowed values"};null===o?o=[e]:o.push(e),a++}}if(void 0!==n.sourceExpression&&"string"!=typeof n.sourceExpression){const e={keyword:"type",dataPath:t+"/properties/"+i+"/binding/sourceExpression",schemaPath:"#/definitions/properties/items/properties/binding/properties/sourceExpression/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}}else{const e={keyword:"type",dataPath:t+"/properties/"+i+"/binding",schemaPath:"#/definitions/properties/items/properties/binding/type",params:{type:"object"},message:"should be object"};null===o?o=[e]:o.push(e),a++}}if(void 0!==e.constraints){let n=e.constraints;if(n&&"object"==typeof n&&!Array.isArray(n)){if(void 0!==n.notEmpty&&"boolean"!=typeof n.notEmpty){const e={keyword:"type",dataPath:t+"/properties/"+i+"/constraints/notEmpty",schemaPath:"#/definitions/properties/items/properties/constraints/properties/notEmpty/type",params:{type:"boolean"},message:"should be boolean"};null===o?o=[e]:o.push(e),a++}if(void 0!==n.minLength&&"number"!=typeof n.minLength){const e={keyword:"type",dataPath:t+"/properties/"+i+"/constraints/minLength",schemaPath:"#/definitions/properties/items/properties/constraints/properties/minLength/type",params:{type:"number"},message:"should be number"};null===o?o=[e]:o.push(e),a++}if(void 0!==n.maxLength&&"number"!=typeof n.maxLength){const e={keyword:"type",dataPath:t+"/properties/"+i+"/constraints/maxLength",schemaPath:"#/definitions/properties/items/properties/constraints/properties/maxLength/type",params:{type:"number"},message:"should be number"};null===o?o=[e]:o.push(e),a++}if(void 0!==n.pattern){let e=n.pattern;const r=a;let s=!1,c=null;const p=a;if(e&&"object"==typeof e&&!Array.isArray(e)){if(void 0!==e.value&&"string"!=typeof e.value){const e={keyword:"type",dataPath:t+"/properties/"+i+"/constraints/pattern/value",schemaPath:"#/definitions/properties/items/properties/constraints/properties/pattern/oneOf/0/properties/value/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}if(void 0!==e.message&&"string"!=typeof e.message){const e={keyword:"type",dataPath:t+"/properties/"+i+"/constraints/pattern/message",schemaPath:"#/definitions/properties/items/properties/constraints/properties/pattern/oneOf/0/properties/message/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}}else{const e={keyword:"type",dataPath:t+"/properties/"+i+"/constraints/pattern",schemaPath:"#/definitions/properties/items/properties/constraints/properties/pattern/oneOf/0/type",params:{type:"object"},message:"should be object"};null===o?o=[e]:o.push(e),a++}(w=p===a)&&(s=!0,c=0);const u=a;if("string"!=typeof e){const e={keyword:"type",dataPath:t+"/properties/"+i+"/constraints/pattern",schemaPath:"#/definitions/properties/items/properties/constraints/properties/pattern/oneOf/1/type",params:{type:"string"},message:"should be string"};null===o?o=[e]:o.push(e),a++}var w;if((w=u===a)&&s?(s=!1,c=[c,1]):w&&(s=!0,c=1),s)a=r,null!==o&&(r?o.length=r:o=null);else{const e={keyword:"oneOf",dataPath:t+"/properties/"+i+"/constraints/pattern",schemaPath:"#/definitions/properties/items/properties/constraints/properties/pattern/oneOf",params:{passingSchemas:c},message:"should match exactly one schema in oneOf"};null===o?o=[e]:o.push(e),a++}}}else{const e={keyword:"type",dataPath:t+"/properties/"+i+"/constraints",schemaPath:"#/definitions/properties/items/properties/constraints/type",params:{type:"object"},message:"should be object"};null===o?o=[e]:o.push(e),a++}}}else{const e={keyword:"type",dataPath:t+"/properties/"+i,schemaPath:"#/definitions/properties/items/type",params:{type:"object"},message:"should be object"};null===o?o=[e]:o.push(e),a++}if(a>0){const e={required:{binding:[]}},n={required:{binding:function(){return'missing binding for property "'+JSON.stringify(i)+'"'}}};let r,s;for(const n of o)"errorMessage"!==n.keyword&&!n.emUsed&&n.dataPath===t+"/properties/"+i&&n.keyword in e&&0===n.schemaPath.indexOf("#/definitions/properties/items")&&/^\/[^\/]*$/.test(n.schemaPath.slice(30))&&(r=EA[n.keyword],s=e[n.keyword][n.params[r]],s&&(s.push(n),n.emUsed=!0));for(const r in e)for(const c in e[r])if(s=e[r][c],s.length){const e=n[r]&&n[r][c],p={keyword:"errorMessage",dataPath:t+"/properties/"+i,schemaPath:"#/definitions/properties/items/errorMessage",params:{errors:s},message:e?e():bA.items.errorMessage[r][c]};null===o?o=[p]:o.push(p),a++}const c=[];for(const e of o)e.emUsed||c.push(e);o=c,a=c.length}}}else{const e={keyword:"type",dataPath:t+"/properties",schemaPath:"#/definitions/properties/type",params:{type:"array"},message:"should be array"};null===o?o=[e]:o.push(e),a++}}if(void 0!==e.metadata){let n=e.metadata;if(!n||"object"!=typeof n||Array.isArray(n)){const e={keyword:"type",dataPath:t+"/metadata",schemaPath:"#/properties/metadata/type",params:{type:"object"},message:"should be object"};null===o?o=[e]:o.push(e),a++}}if(void 0!==e.scopes){let n=e.scopes;const i=a;let s=!1,c=null;const p=a;wA(n,{dataPath:t+"/scopes",parentData:e,parentDataProperty:"scopes",rootData:r})||(o=null===o?wA.errors:o.concat(wA.errors),a=o.length),(_=p===a)&&(s=!0,c=0);const u=a;var _;if(PA(n,{dataPath:t+"/scopes",parentData:e,parentDataProperty:"scopes",rootData:r})||(o=null===o?PA.errors:o.concat(PA.errors),a=o.length),(_=u===a)&&s?(s=!1,c=[c,1]):_&&(s=!0,c=1),s)a=i,null!==o&&(i?o.length=i:o=null);else{const e={keyword:"oneOf",dataPath:t+"/scopes",schemaPath:"#/properties/scopes/oneOf",params:{passingSchemas:c},message:"should match exactly one schema in oneOf"};null===o?o=[e]:o.push(e),a++}}if(void 0!==e.entriesVisible){let n=e.entriesVisible;if((!n||"object"!=typeof n||Array.isArray(n))&&"boolean"!=typeof n){const e={keyword:"type",dataPath:t+"/entriesVisible",schemaPath:"#/properties/entriesVisible/type",params:{type:gA.properties.entriesVisible.type},message:"should be object,boolean"};null===o?o=[e]:o.push(e),a++}}}else{const e={keyword:"type",dataPath:t,schemaPath:"#/type",params:{type:"object"},message:"should be object"};null===o?o=[e]:o.push(e),a++}if(a>0){const e={required:{name:[],id:[],appliesTo:[],properties:[]}},n={required:{}};let i,r;for(const n of o)"errorMessage"!==n.keyword&&!n.emUsed&&n.dataPath===t&&n.keyword in e&&0===n.schemaPath.indexOf("#")&&/^\/[^\/]*$/.test(n.schemaPath.slice(1))&&(i=EA[n.keyword],r=e[n.keyword][n.params[i]],r&&(r.push(n),n.emUsed=!0));for(const i in e)for(const s in e[i])if(r=e[i][s],r.length){const e=n[i]&&n[i][s],c={keyword:"errorMessage",dataPath:t,schemaPath:"#/errorMessage",params:{errors:r},message:e?e():gA.errorMessage[i][s]};null===o?o=[c]:o.push(c),a++}const s=[];for(const e of o)e.emUsed||s.push(e);o=s,a=s.length}return SA.errors=o,0===a}function OA(e,{dataPath:t="",parentData:n,parentDataProperty:i,rootData:r=e}={}){let o=null,a=0;const s=a;let c=!1,p=null;const u=a;SA(e,{dataPath:t,parentData:n,parentDataProperty:i,rootData:r})||(o=null===o?SA.errors:o.concat(SA.errors),a=o.length),(d=u===a)&&(c=!0,p=0);const l=a;if(Array.isArray(e)){const n=e.length;for(let i=0;i<n;i++)SA(e[i],{dataPath:t+"/"+i,parentData:e,parentDataProperty:i,rootData:r})||(o=null===o?SA.errors:o.concat(SA.errors),a=o.length)}else{const e={keyword:"type",dataPath:t,schemaPath:"#/oneOf/1/type",params:{type:"array"},message:"should be array"};null===o?o=[e]:o.push(e),a++}var d;if((d=l===a)&&c?(c=!1,p=[p,1]):d&&(c=!0,p=1),c)a=s,null!==o&&(s?o.length=s:o=null);else{const e={keyword:"oneOf",dataPath:t,schemaPath:"#/oneOf",params:{passingSchemas:p},message:"should match exactly one schema in oneOf"};null===o?o=[e]:o.push(e),a++}return OA.errors=o,0===a}function CA(e){const t=function(e){return mA(e,null,2).pointers}(e),n=vA(e);let i=vA.errors;return i&&i.length&&(_(i,TA),i=function(e){return w(e,(function(e){return"if"!==e.keyword}))}(i),_(i,(function(e){!function(e,t){const n=e.dataPath,i=t[n];e.dataPointer=i}(e,t)}))),{valid:n,object:e,errors:i}}function TA(e){const t=e.params;t&&t.errors&&(t.rawErrors=t.errors,delete t.errors)}vA.default=yA;var AA=t(Object.freeze({__proto__:null,getSchemaVersion:function(){return"0.4.0"},validate:CA,validateAll:function(e){const t=[];let n=!0;return _(e,(function(e){const i=CA(e);i.valid||(n=!1),t.push(i)})),{valid:n,results:t}}})),RA=KS.isArray,kA=KS.filter,jA=AA.validate,MA=(0,AA.getSchemaVersion)();var DA=function(){this._templatesById={},this._validTemplates=[],this._errors=[],this.addAll=function(e){return RA(e)?e.forEach(this.add,this):this._logError("templates must be []"),this},this.add=function(e){var t,n;return this._validateTemplate(e)||(t=e.id,n=e.version||"_",this._templatesById[t]||(this._templatesById[t]={}),this._templatesById[t][n]=e,this._validTemplates.push(e)),this},this._validateTemplate=function(e){var t,n=e.id,i=e.version||"_",r=e.$schema&&function(e){var t=/\d+\.\d+\.\d+/g,n=e.match(t);return null===n?void 0:n[0]}(e.$schema),o=this;if(r&&tA.compare(MA,r)<0)return this._logError("unsupported element template schema version <"+r+">. Your installation only supports up to version <"+MA+">. Please update your installation",e);if(this._templatesById[n]&&this._templatesById[n][i])return"_"===i?this._logError("template id <"+n+"> already used",e):this._logError("template id <"+n+"> and version <"+i+"> already used",e);var a,s=jA(e),c=s.valid,p=s.errors;return c||(t=new Error("invalid template"),(a=p,kA(a,(function(e){return"errorMessage"===e.keyword||!("type"!==e.keyword||!e.dataPath||"/scopes"===e.dataPath)}))).forEach((function(t){o._logError(t.message,e)}))),t},this._logError=function(e,t){return"string"==typeof e&&(t&&(e="template(id: <"+t.id+">, name: <"+t.name+">): "+e),e=new Error(e)),this._errors.push(e),e},this.getErrors=function(){return this._errors},this.getValidTemplates=function(){return this._validTemplates}};function BA(e,t,n){this._loadTemplates=e,this._eventBus=t,this._elementTemplates=n;var i=this;t.on("diagram.init",(function(){i.reload()}))}var IA=BA;BA.$inject=["config.elementTemplates","eventBus","elementTemplates"],BA.prototype.reload=function(){var e=this,t=this._loadTemplates;if(void 0!==t)return"function"==typeof t?t((function(t,n){if(t)return e.templateErrors([t]);e.setTemplates(n)})):t.length?this.setTemplates(t):void 0},BA.prototype.setTemplates=function(e){var t=this._elementTemplates,n=(new DA).addAll(e),i=n.getErrors(),r=n.getValidTemplates();t.set(r),i.length&&this.templateErrors(i),this.templatesChanged()},BA.prototype.templatesChanged=function(){this._eventBus.fire("elementTemplates.changed")},BA.prototype.templateErrors=function(e){this._eventBus.fire("elementTemplates.errors",{errors:e})};var NA=PE.is;function LA(e,t){t.on("moddleCopy.canCopyProperty",(function(t){var n=t.parent,i=t.property;if("modelerTemplate"===t.propertyName){var r=e.get(i);return!!r&&(!!r.appliesTo.reduce((function(e,t){return e||NA(n,t)}),!1)&&void 0)}}))}LA.$inject=["elementTemplates","eventBus"];var FA=LA,VA={__depends__:[IT,G_.default],__init__:["customElementsPropertiesActivator","elementTemplatesLoader","replaceBehavior"],customElementsPropertiesActivator:["type",qT],elementTemplates:["type",eA],elementTemplatesLoader:["type",IA],replaceBehavior:["type",FA]},$A=PE.is,zA={getExtensionElements:function(e,t){var n=[],i=e.get("extensionElements");if(void 0!==i){var r=i.get("values");void 0!==r&&(n=r.filter((function(e){return $A(e,t)})))}return n},addEntry:function(e,t,n,i){var r=e.get("extensionElements");return r?aP.addElementsTolist(t,r,"values",[n]):{extensionElements:r=RE.createElement("bpmn:ExtensionElements",{values:[n]},e,i)}},removeEntry:function(e,t,n){var i=e.get("extensionElements");return i?aP.removeElementsFromList(t,i,"values","extensionElements",[n]):{}}},qA=zA;var UA={isAsyncBefore:function(e){return!(!e.get("camunda:asyncBefore")&&!e.get("camunda:async"))},isAsyncAfter:function(e){return!!e.get("camunda:asyncAfter")},isExclusive:function(e){return!!e.get("camunda:exclusive")},getFailedJobRetryTimeCycle:function(e){return qA.getExtensionElements(e,"camunda:FailedJobRetryTimeCycle")[0]},removeFailedJobRetryTimeCycle:function(e,t){var n=qA.getExtensionElements(e,"camunda:FailedJobRetryTimeCycle");return p_(n,(function(n){return qA.removeEntry(e,t,n)}))}},GA=PE.is,HA=PE.getBusinessObject,WA={},KA=WA;WA.isServiceTaskLike=function(e){return GA(e,"camunda:ServiceTaskLike")},WA.isDmnCapable=function(e){return GA(e,"camunda:DmnCapable")},WA.isExternalCapable=function(e){return GA(e,"camunda:ExternalCapable")},WA.isTaskListener=function(e){return GA(e,"camunda:TaskListener")},WA.isExecutionListener=function(e){return GA(e,"camunda:ExecutionListener")},WA.isListener=function(e){return this.isTaskListener(e)||this.isExecutionListener(e)},WA.isSequenceFlow=function(e){return GA(e,"bpmn:SequenceFlow")},WA.getServiceTaskLikeBusinessObject=function(e){if(GA(e,"bpmn:IntermediateThrowEvent")||GA(e,"bpmn:EndEvent")){var t=DO.getMessageEventDefinition(e);t&&(e=t)}return this.isServiceTaskLike(e)&&HA(e)},WA.getImplementationType=function(e){var t=this.getServiceTaskLikeBusinessObject(e);if(!t){if(!this.isListener(e))return;t=e}if(this.isDmnCapable(t)&&void 0!==t.get("camunda:decisionRef"))return"dmn";if(this.isServiceTaskLike(t)&&qA.getExtensionElements(t,"camunda:Connector").length)return"connector";if(this.isExternalCapable(t)&&"external"===t.get("camunda:type"))return"external";if(void 0!==t.get("camunda:class"))return"class";if(void 0!==t.get("camunda:expression"))return"expression";if(void 0!==t.get("camunda:delegateExpression"))return"delegateExpression";if(this.isListener(t)&&void 0!==t.get("script"))return"script"};var XA=PE.is,YA=PE.getBusinessObject,JA={},ZA=JA;function QA(e,t,n){var i=qA.getExtensionElements(e,t);return n?(i[0]||{})[n]||[]:i}function eR(e,t,n){var i=JA.getInputOutput(e,n);return i&&i.get(t)||[]}JA.getInputOutput=function(e,t){if(!t)return(QA(YA(e),"camunda:InputOutput")||[])[0];var n=this.getConnector(e);return n&&n.get("inputOutput")},JA.getConnector=function(e){var t=KA.getServiceTaskLikeBusinessObject(e);return t&&(QA(t,"camunda:Connector")||[])[0]},JA.getInputParameters=function(e,t){return eR.apply(this,[e,"inputParameters",t])},JA.getOutputParameters=function(e,t){return eR.apply(this,[e,"outputParameters",t])},JA.getInputParameter=function(e,t,n){return this.getInputParameters(e,t)[n]},JA.getOutputParameter=function(e,t,n){return this.getOutputParameters(e,t)[n]},JA.isInputOutputSupported=function(e,t){if(t)return!0;var n=YA(e);return XA(n,"bpmn:FlowNode")&&!(XA(n,"bpmn:StartEvent")||XA(n,"bpmn:Gateway")||XA(n,"bpmn:BoundaryEvent")||XA(n,"bpmn:SubProcess")&&n.get("triggeredByEvent"))},JA.areOutputParametersSupported=function(e,t){var n=YA(e);return t||!XA(n,"bpmn:EndEvent")&&!n.loopCharacteristics};var tR=["class","expression","delegateExpression"],nR={"camunda:class":void 0,"camunda:expression":void 0,"camunda:delegateExpression":void 0,"camunda:resultVariable":void 0},iR={"camunda:decisionRef":void 0,"camunda:decisionRefBinding":"latest","camunda:decisionRefVersion":void 0,"camunda:mapDecisionResult":"resultList","camunda:decisionRefTenantId":void 0},rR={"camunda:type":void 0,"camunda:topic":void 0},oR=["class","expression","delegateExpression"],aR={class:"camunda:class",expression:"camunda:expression",delegateExpression:"camunda:delegateExpression"};function sR(e){return-1!==oR.indexOf(e)}function cR(e){return aR[e]}var pR=function(e,t,n,i){var r=n.getImplementationType,o=n.getBusinessObject;return[wO.textField(i,{id:"delegate",label:i("Value"),dataValueLabel:"delegationLabel",modelProperty:"delegate",get:function(e,t){var n=o(e),a=r(e),s=cR(a),c=function(e){switch(e){case"class":return i("Java Class");case"expression":return i("Expression");case"delegateExpression":return i("Delegate Expression");default:return""}}(a);return{delegate:n.get(s),delegationLabel:c}},set:function(e,t,n){var i=o(e),a={};return a[cR(r(e))]=t.delegate||"",aP.updateBusinessObject(e,i,a)},validate:function(e,t,n){return sR(r(e))&&!t.delegate?{delegate:i("Must provide a value")}:{}},hidden:function(e,t){return!sR(r(e))}})]},uR=PE.is,lR=function(e,t,n,i){var r=n.getBusinessObject,o=n.hideResultVariable,a=n.id||"resultVariable",s=wO.textField(i,{id:a,label:i("Result Variable"),modelProperty:"resultVariable",get:function(e,t){return{resultVariable:r(e).get("camunda:resultVariable")}},set:function(e,t,n){var i=r(e),o=t.resultVariable||void 0,a={"camunda:resultVariable":o};return uR(i,"camunda:DmnCapable")&&!o&&(a=EP({"camunda:mapDecisionResult":"resultList"},a)),aP.updateBusinessObject(e,i,a)},hidden:function(e,t){if("function"==typeof o)return o.apply(s,arguments)}});return[s]},dR=PE.getBusinessObject,hR=PE.is,mR={bpmn:{element:"calledElement",binding:"camunda:calledElementBinding",version:"camunda:calledElementVersion",versionTag:"camunda:calledElementVersionTag",tenantId:"camunda:calledElementTenantId"},cmmn:{element:"camunda:caseRef",binding:"camunda:caseBinding",version:"camunda:caseVersion",tenantId:"camunda:caseTenantId"},dmn:{element:"camunda:decisionRef",binding:"camunda:decisionRefBinding",version:"camunda:decisionRefVersion",versionTag:"camunda:decisionRefVersionTag",tenantId:"camunda:decisionRefTenantId"}},fR=[{name:"singleEntry (TypedValue)",value:"singleEntry"},{name:"singleResult (Map<String, Object>)",value:"singleResult"},{name:"collectEntries (List<Object>)",value:"collectEntries"},{name:"resultList (List<Map<String, Object>>)",value:"resultList"}],vR=[{name:"variableMappingClass",value:"variableMappingClass"},{name:"variableMappingDelegateExpression",value:"variableMappingDelegateExpression"}];function yR(e){var t=[],n=dR(e),i=qA.getExtensionElements(n,"camunda:In");return Qg(i,(function(e){void 0!==e.businessKey&&t.push(e)})),t}function gR(e,t,n){var i=[],r=yR(e);if(r.length)i.push(aP.updateBusinessObject(e,r[0],{businessKey:t}));else{var o=dR(e),a=o.extensionElements;a||(a=RE.createElement("bpmn:ExtensionElements",{values:[]},o,n),i.push(aP.updateProperties(e,{extensionElements:a})));var s=RE.createElement("camunda:In",{businessKey:t},a,n);i.push(aP.addAndRemoveElementsFromList(e,a,"values","extensionElements",[s],[]))}return i}function bR(e){return-1!==["bpmn","cmmn","dmn"].indexOf(e)}var xR=function(e,t,n,i){var r=[{name:i("latest"),value:"latest"},{name:i("deployment"),value:"deployment"},{name:i("version"),value:"version"},{name:i("versionTag"),value:"versionTag"}],o=n.getCallableType,a=[];function s(e,t){var n=o(e);return(mR[n]||{})[t]}function c(e){var t=o(e),n=dR(e),i=(mR[t]||{}).binding;return n.get(i)}function p(e){var t=dR(e),n=t.get("camunda:variableMappingClass"),i=t.get("camunda:variableMappingDelegateExpression"),r="";return void 0!==n?r="variableMappingClass":void 0!==i&&(r="variableMappingDelegateExpression"),r}return a.push(wO.textField(i,{id:"callable-element-ref",dataValueLabel:"callableElementLabel",modelProperty:"callableElementRef",get:function(e,t){var n,r=s(e,"element");r&&(n=dR(e).get(r));var a="",c=o(e);return"bpmn"===c?a=i("Called Element"):"cmmn"===c?a=i("Case Ref"):"dmn"===c&&(a=i("Decision Ref")),{callableElementRef:n,callableElementLabel:a}},set:function(e,t,n){var i=t.callableElementRef,r={};return r[s(e,"element")]=i||"",aP.updateProperties(e,r)},validate:function(e,t,n){var r=t.callableElementRef;return bR(o(e))&&!r?{callableElementRef:i("Must provide a value")}:{}},hidden:function(e,t){return!bR(o(e))}})),a.push(wO.selectBox(i,{id:"callable-binding",label:i("Binding"),selectOptions:function(e){return"cmmn"===o(e)?r.filter((function(e){return"versionTag"!==e.value})):r},modelProperty:"callableBinding",get:function(e,t){var n,i=s(e,"binding");i&&(n=dR(e).get(i)||"latest");return{callableBinding:n}},set:function(e,t,n){var i=t.callableBinding,r=s(e,"binding"),o=s(e,"version"),a=s(e,"versionTag"),c={};return c[r]=i,c[o]=void 0,c[a]=void 0,aP.updateProperties(e,c)},hidden:function(e,t){return!bR(o(e))}})),a.push(wO.textField(i,{id:"callable-version",label:i("Version"),modelProperty:"callableVersion",get:function(e,t){var n,i=s(e,"version");i&&(n=dR(e).get(i));return{callableVersion:n}},set:function(e,t,n){var i=t.callableVersion,r={};return r[s(e,"version")]=i||void 0,aP.updateProperties(e,r)},validate:function(e,t,n){var r=t.callableVersion;return bR(o(e))&&"version"===c(e)&&(r?{}:{callableVersion:i("Must provide a value")})},hidden:function(e,t){return!bR(o(e))||"version"!==c(e)}})),a.push(wO.textField(i,{id:"callable-version-tag",label:i("Version Tag"),modelProperty:"versionTag",get:function(e,t){var n,i=s(e,"versionTag");i&&(n=dR(e).get(i));return{versionTag:n}},set:function(e,t,n){var i=t.versionTag,r={};return r[s(e,"versionTag")]=i||void 0,aP.updateProperties(e,r)},validate:function(e,t,n){var r=t.versionTag;return bR(o(e))&&"versionTag"===c(e)&&(r?{}:{versionTag:i("Must provide a value")})},hidden:function(e,t){return!bR(o(e))||"versionTag"!==c(e)}})),a.push(wO.textField(i,{id:"tenant-id",label:i("Tenant Id"),modelProperty:"tenantId",get:function(e,t){var n,i=s(e,"tenantId");i&&(n=dR(e).get(i));return{tenantId:n}},set:function(e,t,n){var i=t.tenantId,r={};return r[s(e,"tenantId")]=i||void 0,aP.updateProperties(e,r)},hidden:function(e,t){return!bR(o(e))}})),hR(dR(e),"bpmn:CallActivity")&&a.push(wO.checkbox(i,{id:"callable-business-key",label:i("Business Key"),modelProperty:"callableBusinessKey",get:function(e,t){var n=yR(e);return{callableBusinessKey:!!(n&&n.length>0)}},set:function(e,n,i){return n.callableBusinessKey?gR(e,"#{execution.processBusinessKey}",t):function(e){var t=yR(e),n=[];return Qg(t,(function(t){n.push(qA.removeEntry(dR(e),e,t))})),n}(e)}})),a.push(wO.textField(i,{id:"business-key-expression",label:i("Business Key Expression"),modelProperty:"businessKey",get:function(e,t){var n=yR(e);return{businessKey:n.length?n[0].get("camunda:businessKey"):void 0}},set:function(e,n,i){return gR(e,n.businessKey,t)},validate:function(e,t,n){return""===t.businessKey?{businessKey:i("Must provide a value")}:{}},hidden:function(e,t){return!yR(e).length}})),(a=a.concat(lR(0,0,{id:"dmn-resultVariable",getBusinessObject:dR,getImplementationType:o,hideResultVariable:function(e,t){return"dmn"!==o(e)}},i))).push(wO.selectBox(i,{id:"dmn-map-decision-result",label:i("Map Decision Result"),selectOptions:fR,modelProperty:"mapDecisionResult",get:function(e,t){return{mapDecisionResult:dR(e).get("camunda:mapDecisionResult")||"resultList"}},set:function(e,t,n){return aP.updateProperties(e,{"camunda:mapDecisionResult":t.mapDecisionResult||"resultList"})},hidden:function(e,t){var n=dR(e).get("camunda:resultVariable");return!("dmn"===o(e)&&void 0!==n)}})),a.push(wO.selectBox(i,{id:"delegateVariableMappingType",label:i("Delegate Variable Mapping"),selectOptions:vR,emptyParameter:!0,modelProperty:"delegateVariableMappingType",get:function(e,t){return{delegateVariableMappingType:p(e)}},set:function(e,t,n){var i=t.delegateVariableMappingType,r={"camunda:variableMappingClass":void 0,"camunda:variableMappingDelegateExpression":void 0};return"variableMappingClass"===i?r["camunda:variableMappingClass"]="":"variableMappingDelegateExpression"===i&&(r["camunda:variableMappingDelegateExpression"]=""),aP.updateProperties(e,r)},hidden:function(e,t){return"bpmn"!==o(e)}})),a.push(wO.textField(i,{id:"delegateVariableMapping",dataValueLabel:"delegateVariableMappingLabel",modelProperty:"delegateVariableMapping",get:function(e,t){var n=dR(e),r="",o=void 0,a=p(e);return"variableMappingClass"===a?(r=i("Class"),o=n.get("camunda:variableMappingClass")):"variableMappingDelegateExpression"===a&&(r=i("Delegate Expression"),o=n.get("camunda:variableMappingDelegateExpression")),{delegateVariableMapping:o,delegateVariableMappingLabel:r}},set:function(e,t,n){var i=t.delegateVariableMapping,r={};return r["camunda:"+p(e)]=i||void 0,aP.updateProperties(e,r)},validate:function(e,t,n){var r=t.delegateVariableMapping;return"bpmn"===o(e)&&(r?{}:{delegateVariableMapping:i("Must provide a value")})},hidden:function(e,t){return!("bpmn"===o(e)&&""!==p(e))}})),a},ER=hw.escapeHTML,wR=hw.triggerClickEvent,_R=GE.query,PR=GE.closest,SR=GE.classes;function OR(e){return KA.getImplementationType(e)}function CR(e){return KA.getServiceTaskLikeBusinessObject(e)}var TR=function(e,t,n,i){if(function(e){return KA.isServiceTaskLike(e)}(CR(t))){var r=function(e){return KA.isDmnCapable(e)}(t),o=function(e){return KA.isExternalCapable(e)}(CR(t));e.entries=e.entries.concat(function(e,t,n,i){var r=[{value:"class",name:i("Java Class")},{value:"expression",name:i("Expression")},{value:"delegateExpression",name:i("Delegate Expression")}],o=[{value:"dmn",name:i("DMN")}],a=[{value:"external",name:i("External")}],s=[{value:"connector",name:i("Connector")}],c=[{value:"script",name:i("Script")}],p=n.getImplementationType,u=n.getBusinessObject,l=n.hasDmnSupport,d=n.hasExternalSupport,h=n.hasServiceTaskLikeSupport,m=n.hasScriptSupport,f=[],v=r.concat([]);return l&&(v=v.concat(o)),d&&(v=v.concat(a)),h&&(v=v.concat(s)),m&&(v=v.concat(c)),v.push({value:""}),f.push(wO.selectBox(i,{id:"implementation",label:i("Implementation"),selectOptions:v,modelProperty:"implType",get:function(e,t){return{implType:p(e)||""}},set:function(e,n,i){var r=u(e),o=p(e),a=n.implType,s=EP({},nR);if(-1!==tR.indexOf(a)){var c="";-1!==tR.indexOf(o)&&(c=r.get("camunda:"+o)),s["camunda:"+a]=c}l&&(s=EP(s,iR),"dmn"===a&&(s["camunda:decisionRef"]="")),d&&(s=EP(s,rR),"external"===a&&(s["camunda:type"]="external",s["camunda:topic"]="")),m&&(s["camunda:script"]=void 0,"script"===a&&(s["camunda:script"]=RE.createElement("camunda:Script",{},r,t)));var f=[];if(f.push(aP.updateBusinessObject(e,r,s)),"external"===o&&"external"!==a){var v=qA.getExtensionElements(r,"camunda:ErrorEventDefinition");f.push(p_(v,(function(t){return qA.removeEntry(r,e,t)})))}if(h){var y=qA.getExtensionElements(r,"camunda:Connector");if(f.push(p_(y,(function(t){return qA.removeEntry(r,e,t)}))),"connector"===a){var g=r.get("extensionElements");g||(g=RE.createElement("bpmn:ExtensionElements",{values:[]},r,t),f.push(aP.updateBusinessObject(e,r,{extensionElements:g})));var b=RE.createElement("camunda:Connector",{},g,t);f.push(aP.addAndRemoveElementsFromList(e,g,"values","extensionElements",[b],[]))}}return f}})),f}(0,n,{getBusinessObject:CR,getImplementationType:OR,hasDmnSupport:r,hasExternalSupport:o,hasServiceTaskLikeSupport:!0},i)),e.entries=e.entries.concat(pR(0,0,{getBusinessObject:CR,getImplementationType:OR},i)),e.entries=e.entries.concat(lR(0,0,{getBusinessObject:CR,getImplementationType:OR,hideResultVariable:function(e,t){return"expression"!==OR(e)}},i)),o&&(e.entries=e.entries.concat(function(e,t,n,i){var r=n.getImplementationType,o=n.getBusinessObject;function a(e){return"external"===r(e)}return[wO.textField(i,{id:"externalTopic",label:i("Topic"),modelProperty:"externalTopic",get:function(e,t){return{externalTopic:o(e).get("camunda:topic")}},set:function(e,t,n){var i=o(e);return aP.updateBusinessObject(e,i,{"camunda:topic":t.externalTopic})},validate:function(e,t,n){return a(e)&&!t.externalTopic?{externalTopic:i("Must provide a value")}:{}},hidden:function(e,t){return!a(e)}})]}(0,0,{getBusinessObject:CR,getImplementationType:OR},i))),r&&(e.entries=e.entries.concat(xR(t,n,{getCallableType:OR},i)));e.entries.push(wO.link(i,{id:"configureConnectorLink",buttonLabel:i("Configure Connector"),handleClick:function(e,t,n){var i,r,o=(i="connector",r=PR(t,".bpp-properties-panel"),_R('a[data-tab-target="'+i+'"]',r));return o&&wR(o),!1},showLink:function(e,t){var n=_R("a",t);return n.textContent="",SR(n).remove("bpp-error-message"),!!function(e){return"connector"===OR(e)}(e)&&(ZA.getConnector(e).get("connectorId")?n.textContent=i("Configure Connector"):(n.innerHTML='<span class="bpp-icon-warning"></span> '+ER(i("Must configure Connector")),SR(n).add("bpp-error-message")),!0)}}))}};var AR=PE.is;function RR(e){return UA.isAsyncBefore(e)}function kR(e){return UA.isAsyncAfter(e)}function jR(e){return UA.isExclusive(e)}function MR(e,t){return UA.removeFailedJobRetryTimeCycle(e,t)}function DR(e){return!DO.getTimerEventDefinition(e)}var BR=function(e,t,n,i){var r=n.getBusinessObject,o=n.idPrefix||"",a=n.labelPrefix||"";return[wO.checkbox(i,{id:o+"asyncBefore",label:a+i("Asynchronous Before"),modelProperty:"asyncBefore",get:function(e,t){return{asyncBefore:RR(r(e))}},set:function(e,t){var n=r(e),i=!!t.asyncBefore,o={"camunda:asyncBefore":i,"camunda:async":!1},a=[];return kR(n)||i||(o=EP({"camunda:exclusive":!0},o),DR(e)&&a.push(MR(n,e))),a.push(aP.updateBusinessObject(e,n,o)),a}}),wO.checkbox(i,{id:o+"asyncAfter",label:a+i("Asynchronous After"),modelProperty:"asyncAfter",get:function(e,t){return{asyncAfter:kR(r(e))}},set:function(e,t){var n=r(e),i=!!t.asyncAfter,o={"camunda:asyncAfter":i},a=[];return RR(n)||i||(o=EP({"camunda:exclusive":!0},o),DR(e)&&a.push(MR(n,e))),a.push(aP.updateBusinessObject(e,n,o)),a}}),wO.checkbox(i,{id:o+"exclusive",label:a+i("Exclusive"),modelProperty:"exclusive",get:function(e,t){return{exclusive:jR(r(e))}},set:function(e,t){var n=r(e);return aP.updateBusinessObject(e,n,{"camunda:exclusive":!!t.exclusive})},hidden:function(e){var t=r(e);return t&&!kR(t)&&!RR(t)}})]},IR=PE.getBusinessObject,NR=PE.is,LR=PE.getBusinessObject,FR=PE.is;function VR(e){var t=LR(e),n=t.get("calledElement"),i=t.get("camunda:caseRef"),r="";return void 0!==n?r="bpmn":void 0!==i&&(r="cmmn"),r}var $R={calledElement:void 0,"camunda:calledElementBinding":"latest","camunda:calledElementVersion":void 0,"camunda:calledElementTenantId":void 0,"camunda:variableMappingClass":void 0,"camunda:variableMappingDelegateExpression":void 0,"camunda:caseRef":void 0,"camunda:caseBinding":"latest","camunda:caseVersion":void 0,"camunda:caseTenantId":void 0},zR=PE.getBusinessObject,qR=hw.escapeHTML,UR=GE.classes;function GR(e,t){var n=WR(e);return n&&n.get(t)}function HR(e){return e&&e.get("body")}function WR(e){return zR(e).loopCharacteristics}function KR(e){return HR(function(e){return GR(e,"loopCardinality")}(e))}function XR(e){return HR(function(e){return GR(e,"completionCondition")}(e))}function YR(e){return GR(e,"camunda:collection")}function JR(e){return GR(e,"camunda:elementVariable")}function ZR(e,t,n,i){var r=WR(e),o={};if(!n)return o[t]=void 0,aP.updateBusinessObject(e,r,o);var a=r.get(t);return a?aP.updateBusinessObject(e,a,{body:n}):(o[t]=function(e,t,n){return RE.createElement("bpmn:FormalExpression",{body:t},e,n)}(r,n,i),aP.updateBusinessObject(e,r,o))}var QR=PE.is;function ek(e){return UA.getFailedJobRetryTimeCycle(e)}var tk=function(e,t,n,i){var r=n.getBusinessObject,o=n.idPrefix||"",a=n.labelPrefix||"";return[wO.textField(i,{id:o+"retryTimeCycle",label:a+i("Retry Time Cycle"),modelProperty:"cycle",get:function(e,t){var n=ek(r(e));return{cycle:n&&n.get("body")}},set:function(e,n,i){var o=n.cycle,a=r(e);if(""===o||void 0===o)return function(e,t){return UA.removeFailedJobRetryTimeCycle(e,t)}(a,e);var s=ek(a);if(!s){var c=[],p=a.get("extensionElements");return p||(p=function(e,t){return RE.createElement("bpmn:ExtensionElements",{values:[]},e,t)}(a,t),c.push(aP.updateBusinessObject(e,a,{extensionElements:p}))),s=function(e,t,n){return RE.createElement("camunda:FailedJobRetryTimeCycle",{body:n},e,t)}(p,t,o),c.push(aP.addAndRemoveElementsFromList(e,p,"values","extensionElements",[s],[])),c}return aP.updateBusinessObject(e,s,{body:o})},hidden:function(e){var t=r(e);return(!t||!function(e){return UA.isAsyncBefore(e)}(t)&&!function(e){return UA.isAsyncAfter(e)}(t))&&(!QR(e,"bpmn:Event")||!DO.getTimerEventDefinition(e))}})]},nk=PE.getBusinessObject,ik=PE.is;function rk(e){return nk(e).loopCharacteristics}var ok=function(e,t,n,i){(function(e){var t=rk(e);return!!t&&ik(t,"camunda:Collectable")})(t)&&(e.entries=e.entries.concat(function(e,t,n){var i=[];return i.push({id:"multiInstance-errorMessage",html:'<div data-show="isValid"><span class="bpp-icon-warning"></span> '+qR(n("Must provide either loop cardinality or collection"))+"</div>",isValid:function(e,t,n,i){var r=!0;if(WR(e)){var o=KR(e),a=YR(e);r=!o&&!a}return UR(t).toggle("bpp-hidden",!r),UR(n).toggle("bpp-error-message",r),r}}),i.push(wO.textField(n,{id:"multiInstance-loopCardinality",label:n("Loop Cardinality"),modelProperty:"loopCardinality",get:function(e,t){return{loopCardinality:KR(e)}},set:function(e,n){return ZR(e,"loopCardinality",n.loopCardinality,t)}})),i.push(wO.textField(n,{id:"multiInstance-collection",label:n("Collection"),modelProperty:"collection",get:function(e,t){return{collection:YR(e)}},set:function(e,t){var n=WR(e);return aP.updateBusinessObject(e,n,{"camunda:collection":t.collection||void 0})},validate:function(e,t,n){var i=YR(e),r=JR(e);if(!i&&r)return{collection:"Must provide a value"}}})),i.push(wO.textField(n,{id:"multiInstance-elementVariable",label:n("Element Variable"),modelProperty:"elementVariable",get:function(e,t){return{elementVariable:JR(e)}},set:function(e,t){var n=WR(e);return aP.updateBusinessObject(e,n,{"camunda:elementVariable":t.elementVariable||void 0})}})),i.push(wO.textField(n,{id:"multiInstance-completionCondition",label:n("Completion Condition"),modelProperty:"completionCondition",get:function(e){return{completionCondition:XR(e)}},set:function(e,n){return ZR(e,"completionCondition",n.completionCondition,t)}})),i}(0,n,i)),e.entries=e.entries.concat(BR(0,0,{getBusinessObject:rk,idPrefix:"multiInstance-",labelPrefix:i("Multi Instance ")},i)),e.entries=e.entries.concat(tk(0,n,{getBusinessObject:rk,idPrefix:"multiInstance-",labelPrefix:i("Multi Instance ")},i)))},ak=GE.query,sk=hw.escapeHTML;function ck(e,t){var n;return n=t&&""!=t?'select[id="'+t+'cam-script-type"]':'select[name="scriptType"]',hw.selectedType(n,e.parentElement)}var pk=function(e,t,n,i,r){var o=r&&r.idPrefix||"";return{template:'<div class="bpp-row bpp-textfield"><label for="'+o+'cam-script-format">'+sk(i("Script Format"))+'</label><div class="bpp-field-wrapper"><input id="'+o+'cam-script-format" type="text" name="scriptFormat" /><button class="action-button clear" data-action="script.clearScriptFormat" data-show="script.canClearScriptFormat"><span>X</span></button></div></div><div class="bpp-row"><label for="'+o+'cam-script-type">'+sk(i("Script Type"))+'</label><div class="bpp-field-wrapper"><select id="'+o+'cam-script-type" name="scriptType" data-value><option value="script" selected>'+sk(i("Inline Script"))+'</option><option value="scriptResource">'+sk(i("External Resource"))+'</option></select></div></div><div class="bpp-row bpp-textfield"><label for="'+o+'cam-script-resource-val" data-show="script.isScriptResource">'+sk(i("Resource"))+'</label><div class="bpp-field-wrapper" data-show="script.isScriptResource"><input id="'+o+'cam-script-resource-val" type="text" name="scriptResourceValue" /><button class="action-button clear" data-action="script.clearScriptResource" data-show="script.canClearScriptResource"><span>X</span></button></div></div><div class="bpp-row"><label for="'+o+'cam-script-val" data-show="script.isScript">'+sk(i("Script"))+'</label><div class="bpp-field-wrapper" data-show="script.isScript"><textarea id="'+o+'cam-script-val" type="text" name="scriptValue"></textarea></div></div>',get:function(n,i){var r={},o=i.get("camunda:resource"),a=i.get(t),s=i.get(e);return void 0!==o?(r.scriptResourceValue=o,r.scriptType="scriptResource"):(r.scriptValue=a,r.scriptType="script"),r.scriptFormat=s,r},set:function(i,r,o){var a=r.scriptFormat,s=r.scriptType,c=r.scriptResourceValue,p=r.scriptValue,u={"camunda:resource":void 0};return u[t]=void 0,u[e]=void 0,n?u[e]=a||"":""!==a&&(u[e]=a),"scriptResource"===s?u["camunda:resource"]=c||"":u[t]=p||"",u},validate:function(e,t){var r={};return"script"!==t.scriptType||t.scriptValue||(r.scriptValue=i("Must provide a value")),"scriptResource"!==t.scriptType||t.scriptResourceValue||(r.scriptResourceValue=i("Must provide a value")),!n||t.scriptFormat&&0!==t.scriptFormat.length||(r.scriptFormat=i("Must provide a value")),r},clearScriptFormat:function(e,t,n,i){return ak("input[name=scriptFormat]",i).value="",!0},canClearScriptFormat:function(e,t,n,i){return""!==ak("input[name=scriptFormat]",i).value},clearScriptResource:function(e,t,n,i){return ak("input[name=scriptResourceValue]",i).value="",!0},canClearScriptResource:function(e,t,n,i){return""!==ak("input[name=scriptResourceValue]",i).value},clearScript:function(e,t,n,i){return ak("textarea[name=scriptValue]",i).value="",!0},canClearScript:function(e,t,n,i){return""!==ak("textarea[name=scriptValue]",i).value},isScriptResource:function(e,t,n,i){return"scriptResource"===ck(i,o)},isScript:function(e,t,n,i){return"script"===ck(i,o)}}},uk=PE.is,lk=tC.isAny,dk=PE.getBusinessObject,hk=hw.escapeHTML,mk=GE.query,fk=function(e,t,n,i){var r=dk(t);if(r){var o=DO.getConditionalEventDefinition(t);if(uk(t,"bpmn:SequenceFlow")&&function(e){return lk(e,vk)}(t.source)||o){var a=pk("language","body",!0,i);e.entries.push({id:"condition",label:i("Condition"),html:'<div class="bpp-row"><label for="cam-condition-type">'+hk(i("Condition Type"))+'</label><div class="bpp-field-wrapper"><select id="cam-condition-type" name="conditionType" data-value><option value="expression">'+hk(i("Expression"))+'</option><option value="script">'+hk(i("Script"))+'</option><option value="" selected></option></select></div></div><div class="bpp-row"><label for="cam-condition" data-show="isExpression">'+hk(i("Expression"))+'</label><div class="bpp-field-wrapper" data-show="isExpression"><input id="cam-condition" type="text" name="condition" /><button class="action-button clear" data-action="clear" data-show="canClear"><span>X</span></button></div><div data-show="isScript">'+a.template+"</div></div>",get:function(e,t){var n=DO.getConditionalEventDefinition(e),i=n?n.condition:r.conditionExpression,o={},s="";i&&(void 0!==i.language?(s="script",o=a.get(e,i)):(s="expression",o.condition=i.get("body")));return o.conditionType=s,o},set:function(e,t,i){var s,c=t.conditionType,p=[],u={body:void 0};if("script"===c)u=a.set(e,t,i);else{var l=t.condition;u.body=l}if(c){s=RE.createElement("bpmn:FormalExpression",u,o||r,n);var d=e.source;d&&d.businessObject.default===r&&p.push(aP.updateProperties(d,{default:void 0}))}var h=o?{condition:s}:{conditionExpression:s};return p.push(aP.updateBusinessObject(e,o||r,h)),p},validate:function(e,t){var n={};return t.condition||"expression"!==t.conditionType?"script"===t.conditionType&&(n=a.validate(e,t)):n.condition=i("Must provide a value"),n},isExpression:function(e,t){var n=mk("select[name=conditionType]",t);if(n.selectedIndex>=0)return"expression"===n.options[n.selectedIndex].value},isScript:function(e,t){var n=mk("select[name=conditionType]",t);if(n.selectedIndex>=0)return"script"===n.options[n.selectedIndex].value},clear:function(e,t){return mk("input[name=condition]",t).value="",!0},canClear:function(e,t){return""!==mk("input[name=condition]",t).value},script:a,cssClasses:["bpp-textfield"]})}}},vk=["bpmn:Activity","bpmn:ExclusiveGateway","bpmn:InclusiveGateway","bpmn:ComplexGateway"];var yk=PE.getBusinessObject,gk=PE.is,bk=PE.is,xk=function(e,t,n,i){Qg(["bpmn:StartEvent","bpmn:BoundaryEvent","bpmn:EndEvent"],(function(n){if(bk(t,n)){var r=DO.getErrorEventDefinition(t);if(r){var o=bk(t,"bpmn:StartEvent")||bk(t,"bpmn:BoundaryEvent");!function(e,t,n,i,r,o,a){var s=function(e){return function(t){return i.get("camunda:"+e)}},c=function(e){return function(t,n){return""===n[e]&&(n[e]=void 0),aP.updateBusinessObject(t,i,n)}};e.entries=e.entries.concat($O(0,i,0,a,{id:"error-element-message",label:a("Message"),referenceProperty:"errorRef",modelProperty:"errorMessage"})),r&&e.entries.push(wO.validationAwareTextField(a,{id:"errorCodeVariable",label:a("Code Variable"),modelProperty:"errorCodeVariable",description:a("Define the name of the variable that will contain the error code"),getProperty:s("errorCodeVariable"),setProperty:c("errorCodeVariable"),validate:function(e,t){var n={},i=t.errorCodeVariable;return hw.containsSpace(i)&&(n.errorCodeVariable=a("Error code variable must not contain spaces.")),n}})),o&&e.entries.push(wO.validationAwareTextField(a,{id:"errorMessageVariable",label:a("Message Variable"),modelProperty:"errorMessageVariable",getProperty:s("errorMessageVariable"),setProperty:c("errorMessageVariable"),description:a("Define the name of the variable that will contain the error message"),validate:function(e,t){var n={},i=t.errorMessageVariable;return hw.containsSpace(i)&&(n.errorMessageVariable=a("Error message variable must not contain spaces.")),n}}))}(e,0,0,r,o,o,i)}}}))},Ek=PE.getBusinessObject,wk=GE.query,_k=GE.closest,Pk=GE.domify,Sk=hw.escapeHTML;function Ok(e,t){var n=_k(e,"div.bpp-properties-tab");return wk("select[name=selectedExtensionElement]"+(t?"[id=cam-extensionElements-"+t+"]":""),n)}function Ck(e,t){var n=Ok(e,t);return{value:(n||{}).value,idx:(n||{}).selectedIndex}}var Tk="create-extension-element",Ak="remove-extension-element",Rk=function(e,t,n,i){var r=n.id,o=n.prefix||"elem",a=n.label||r,s=!1!==n.idGeneration||n.idGeneration,c=n.businessObject||Ek(e),p=n.modelProperty||"id",u=n.getExtensionElements,l=n.createExtensionElement,d="function"==typeof l,h=n.removeExtensionElement,m="function"==typeof h,f=n.onSelectionChange,v=n.hideExtensionElements,y="function"==typeof v,g=n.setOptionLabelValue,b=n.size||5,x=n.resizable,E=n.reference||void 0,w=function(e,t,n,i){if("function"==typeof f)return f(e,t,n,i)},_=function(e){return'<option value="'+Sk(e)+'" data-value data-name="extensionElementValue">'+Sk(e)+"</option>"},P=function(e,t){x&&(e.size=t>b?t:b)};return{id:r,html:'<div class="bpp-row bpp-element-list" '+(y?'data-show="hideElements"':"")+'><label for="cam-extensionElements-'+Sk(r)+'">'+Sk(a)+'</label><div class="bpp-field-wrapper"><select id="cam-extensionElements-'+Sk(r)+'"name="selectedExtensionElement" size="'+Sk(b)+'" data-list-entry-container data-on-change="selectElement"></select>'+(d?'<button class="action-button add" id="cam-extensionElements-create-'+Sk(r)+'" data-action="createElement"><span>+</span></button>':"")+(m?'<button class="action-button clear" id="cam-extensionElements-remove-'+Sk(r)+'" data-action="removeElement" data-disable="disableRemove"><span>-</span></button>':"")+"</div></div>",get:function(e,t){var n=u(e,t),i=[];Qg(n,(function(e){i.push({extensionElementValue:e.get(p)})}));var o=Ok(t.parentNode,r);return P(o,i.length),i},set:function(e,n,i){var r=this.__action;delete this.__action,c=c||Ek(e);var o=E&&c.get(E)?c.get(E):c,a=o.get("extensionElements");if(r.id===Tk){var s=[];return a||(a=RE.createElement("bpmn:ExtensionElements",{values:[]},o,t),s.push(aP.updateBusinessObject(e,o,{extensionElements:a}))),s.push(l(e,a,r.value,i)),s}if(r.id===Ak)return h(e,a,r.value,r.idx,i)},createListEntryTemplate:function(e,t,n){return P(n,n.options.length+1),_(e.extensionElementValue)},deselect:function(e,t){Ok(t,r).selectedIndex=-1},getSelected:function(e,t){return Ck(t,r)},setControlValue:function(e,t,n,i,r,o){t.value=r,g?g(e,t,n,i,r,o):t.text=r},createElement:function(e,t){var n;s&&(n=function(e){return e+="_",hw.nextId(e)}(o));var i=Ok(t,r),a=Pk(_(n));return i.appendChild(a),i.lastChild.selected="selected",w(e,t),P(i,i.options.length),this.__action={id:Tk,value:n},!0},removeElement:function(e,t){var n=Ck(t,r),i=Ok(t,r);return i.removeChild(i.options[n.idx]),P(i,i.options.length),this.__action={id:Ak,value:n.value,idx:n.idx},!0},hideElements:function(e,t,n,i){return!v(e,t,n,i)},disableRemove:function(e,t,n,i){return(Ck(t,r)||{}).idx<0},selectElement:w}},kk=PE.getBusinessObject,jk=PE.is;function Mk(e){var t=e&&Dk(e);return t&&t.values?t.values:[]}function Dk(e){return Bk(e)?function(e){return CP(e.values,(function(e){return jk(e,"camunda:Properties")}))}(e):e.properties}function Bk(e){return jk(e,"bpmn:ExtensionElements")}var Ik=function(e,t,n,i){var r=n.getParent,o=n.modelProperties,a=n.createParent,s=kk(e);if(jk(e,"bpmn:Participant")&&(s=s.get("processRef")),s)return EP(n,{addLabel:i("Add Property"),getElements:function(e,t){return Mk(r(e,t,s))},addElement:function(e,n){var i=[],c=r(e,n,s);if(!c&&"function"==typeof a){var p=a(e,s);c=p.parent,i.push(p.cmd)}var u=Dk(c);u||(u=RE.createElement("camunda:Properties",{},c,t),Bk(c)?i.push(aP.addAndRemoveElementsFromList(e,c,"values","extensionElements",[u],[])):i.push(aP.updateBusinessObject(e,c,{properties:u})));var l={};Qg(o,(function(e){l[e]=void 0})),o.indexOf("id")>=0&&(l.id=hw.nextId("Property_"));var d=RE.createElement("camunda:Property",l,u,t);return i.push(aP.addElementsTolist(e,u,"values",[d])),i},updateElement:function(e,t,n,i){var a=Mk(r(e,n,s))[i];return Qg(o,(function(e){t[e]=t[e]||void 0})),aP.updateBusinessObject(e,a,t)},validate:function(e,t,n,a){if(o.indexOf("id")>=0){var c=Mk(r(e,n,s))[a];if(c){var p=hw.isIdValid(c,t.id,i);if(p)return{id:p}}}},removeElement:function(e,t,n){var i=[],o=r(e,t,s),a=Dk(o),c=Mk(o),p=c[n];return i.push(aP.removeElementsFromList(e,a,"values",null,[p])),1===c.length&&(Bk(o)?Qg(o.values,(function(t){jk(t,"camunda:Properties")&&i.push(qA.removeEntry(s,e,t))})):i.push(aP.updateBusinessObject(e,o,{properties:void 0}))),i}}),wO.table(i,n)},Nk=PE.getBusinessObject,Lk=qA.getExtensionElements,Fk={},Vk=Fk;Fk.getFormData=function(e){var t=Nk(e);return Lk(t,"camunda:FormData")[0]},Fk.getFormFields=function(e){var t=this.getFormData(e);return void 0===t?[]:t.fields||[]},Fk.getFormField=function(e,t){return this.getFormFields(e)[t]},Fk.getConstraints=function(e){return e&&e.validation&&e.validation.constraints?e.validation.constraints:[]},Fk.getEnumValues=function(e){return e&&e.values?e.values:[]};var $k=PE.getBusinessObject,zk=qA.getExtensionElements,qk=qA.removeEntry,Uk=Rk,Gk=Ik,Hk=PE.is;function Wk(e,t,n){var i=t.id,r=t.label,o=t.modelProperty,a=t.validate;return wO.textField(e,{id:i,label:r,modelProperty:o,get:function(e,t){var i=n(e,t)||{},r={};return r[o]=i[o],r},set:function(e,i,r){var a=[];if("function"==typeof t.set){var s=t.set(e,i,r);s&&a.push(s)}var c=n(e,r),p={};return p[o]=i[o]||void 0,a.push(aP.updateBusinessObject(e,c,p)),a},hidden:function(e,t){return!n(e,t)},validate:a})}var Kk=function(e,t,n,i){if(function(e){return Hk(e,"bpmn:StartEvent")&&!Hk(e.parent,"bpmn:SubProcess")||Hk(e,"bpmn:UserTask")}(t)){e.entries.push(wO.selectBox(i,{id:"form-type",label:i("Type"),selectOptions:[{value:"",name:i("<none>")},{value:"formKey",name:i("Embedded or External Task Forms")},{value:"formRef",name:i("Camunda Forms")}],modelProperty:"formType",get:function(e,t){var n=$k(e),i={formType:""};return WT(n.get("camunda:formKey"))?WT(n.get("camunda:formRef"))||(i.formType="formRef"):i.formType="formKey",i},set:function(e,t,n){var i={},r=t.formType;i="formKey"===r?{"camunda:formKey":""}:"formRef"===r?{"camunda:formRef":""}:{"camunda:formRef":void 0,"camunda:formRefBinding":void 0,"camunda:formRefVersion":void 0,"camunda:formKey":void 0};var o=$k(e);return[aP.updateBusinessObject(e,o,i)]}})),e.entries.push(wO.textField(i,{id:"form-key",label:i("Form Key"),modelProperty:"formKey",get:function(e,t){return{formKey:$k(e).get("camunda:formKey")}},set:function(e,t,n){var i=$k(e),r=t.formKey;return aP.updateBusinessObject(e,i,{"camunda:formKey":r})},hidden:function(e,t){return"formKey"!==Yk(e)}})),e.entries.push(wO.textField(i,{id:"form-ref",label:i("Form Ref"),modelProperty:"formRef",get:function(e,t){return{formRef:$k(e).get("camunda:formRef")}},set:function(e,t,n){var i=$k(e),r=t.formRef;return aP.updateBusinessObject(e,i,{"camunda:formRef":r})},hidden:function(e,t){return"formRef"!==Yk(e)}})),e.entries.push(wO.selectBox(i,{id:"form-ref-binding",label:i("Binding"),selectOptions:[{value:"deployment",name:i("deployment")},{value:"latest",name:i("latest")},{value:"version",name:i("version")}],modelProperty:"formRefBinding",get:function(e,t){return{formRefBinding:Xk(e)}},set:function(e,t,n){var i={"camunda:formRefBinding":t.formRefBinding},r=$k(e);return[aP.updateBusinessObject(e,r,i)]},hidden:function(e,t){return"formRef"!==Yk(e)}})),e.entries.push(wO.textField(i,{id:"form-ref-version",label:i("Version"),modelProperty:"formRefVersion",get:function(e,t){return{formRefVersion:$k(e).get("camunda:formRefVersion")}},set:function(e,t,n){var i=$k(e),r=t.formRefVersion||void 0;return aP.updateBusinessObject(e,i,{"camunda:formRefVersion":r})},hidden:function(e,t){return"version"!==Xk(e)}}));var r=Uk(t,n,{id:"form-fields",label:i("Form Fields"),modelProperty:"id",prefix:"FormField",createExtensionElement:function(e,t,i){var r=$k(e),o=[];t||(t=RE.createElement("bpmn:ExtensionElements",{values:[]},r,n),o.push(aP.updateProperties(e,{extensionElements:t})));var a=Vk.getFormData(e);a||(a=RE.createElement("camunda:FormData",{fields:[]},t,n),o.push(aP.addAndRemoveElementsFromList(e,t,"values","extensionElements",[a],[])));var s=RE.createElement("camunda:FormField",{id:i},a,n);return void 0!==a.fields?o.push(aP.addElementsTolist(e,a,"fields",[s])):o.push(aP.updateBusinessObject(e,a,{fields:[s]})),o},removeExtensionElement:function(e,t,n,i){var r=zk($k(e),"camunda:FormData")[0],o=r.fields[i],a=[];return r.fields.length<2?a.push(qk($k(e),e,r)):(a.push(aP.removeElementsFromList(e,r,"fields",null,[o])),o.id===r.get("businessKey")&&a.push(aP.updateBusinessObject(e,r,{businessKey:void 0}))),a},getExtensionElements:function(e){return Vk.getFormFields(e)},hideExtensionElements:function(e,t){return!1}});e.entries.push(r);var o=wO.selectBox(i,{id:"form-business-key",label:i("Business Key"),modelProperty:"businessKey",selectOptions:function(e,t){var n=[{name:"",value:""}],i=Vk.getFormFields(e);return Qg(i,(function(e){"boolean"!==e.type&&n.push({name:e.id,value:e.id})})),n},get:function(e,t){var n={businessKey:""},i=$k(e),r=zk(i,"camunda:FormData");r.length&&(n={businessKey:r[0].get("businessKey")});return n},set:function(e,t,n){var i=zk($k(e),"camunda:FormData")[0];return aP.updateBusinessObject(e,i,{businessKey:t.businessKey||void 0})},hidden:function(e,t){return!(Hk(e,"bpmn:StartEvent")&&Vk.getFormFields(e).length>0)}});e.entries.push(o),e.entries.push(wO.label({id:"form-field-header",labelText:i("Form Field"),showLabel:function(e,t){return!!a(e,t)}})),e.entries.push(wO.validationAwareTextField(i,{id:"form-field-id",label:i("ID (process variable name)"),modelProperty:"id",getProperty:function(e,t){return(a(e,t)||{}).id},setProperty:function(e,t,n){var i=a(e,n);return aP.updateBusinessObject(e,i,t)},hidden:function(e,t){return!a(e,t)},validate:function(e,t,n){var i=a(e,n);if(i){var r=t.id;if(!r||""===r.trim())return{id:"Form field id must not be empty"};var o=Vk.getFormFields(e);if(CP(o,(function(e){return e!==i&&e.id===r})))return{id:"Form field id already used in form data."}}}})),e.entries.push(wO.comboBox(i,{id:"form-field-type",label:i("Type"),selectOptions:[{name:"string",value:"string"},{name:"long",value:"long"},{name:"boolean",value:"boolean"},{name:"date",value:"date"},{name:"enum",value:"enum"}],modelProperty:"type",emptyParameter:!0,get:function(e,t){var n=a(e,t);return n?{type:n.type}:{}},set:function(e,t,n){var i=a(e,n),r=zk($k(e),"camunda:FormData")[0],o=[];return"enum"===i.type&&"enum"!==t.type&&o.push(aP.updateBusinessObject(e,i,{values:void 0})),"boolean"===t.type&&i.get("id")===r.get("businessKey")&&o.push(aP.updateBusinessObject(e,r,{businessKey:void 0})),o.push(aP.updateBusinessObject(e,i,t)),o},hidden:function(e,t){return!a(e,t)}})),e.entries.push(Wk(i,{id:"form-field-label",label:i("Label"),modelProperty:"label"},a)),e.entries.push(Wk(i,{id:"form-field-defaultValue",label:i("Default Value"),modelProperty:"defaultValue"},a)),e.entries.push(wO.label({id:"form-field-enum-values-header",labelText:i("Values"),divider:!0,showLabel:function(e,t){var n=a(e,t);return n&&"enum"===n.type}})),e.entries.push(wO.table(i,{id:"form-field-enum-values",labels:[i("Id"),i("Name")],modelProperties:["id","name"],show:function(e,t){var n=a(e,t);return n&&"enum"===n.type},getElements:function(e,t){var n=a(e,t);return Vk.getEnumValues(n)},addElement:function(e,t){var i=a(e,t),r=hw.nextId("Value_"),o=RE.createElement("camunda:Value",{id:r,name:void 0},$k(e),n);return aP.addElementsTolist(e,i,"values",[o])},removeElement:function(e,t,n){var i=a(e,t),r=i.values[n];return aP.removeElementsFromList(e,i,"values",null,[r])},updateElement:function(e,t,n,i){var r=a(e,n).values[i];return t.name=t.name||void 0,aP.updateBusinessObject(e,r,t)},validate:function(e,t,n,r){var o=a(e,n).values[r];if(o){var s=hw.isIdValid(o,t.id,i);if(s)return{id:s}}}})),e.entries.push(wO.label({id:"form-field-validation-header",labelText:i("Validation"),divider:!0,showLabel:function(e,t){return!!a(e,t)}})),e.entries.push(wO.table(i,{id:"constraints-list",modelProperties:["name","config"],labels:[i("Name"),i("Config")],addLabel:i("Add Constraint"),getElements:function(e,t){var n=a(e,t);return Vk.getConstraints(n)},addElement:function(e,t){var i=[],r=a(e,t),o=r.validation;o||(o=RE.createElement("camunda:Validation",{},$k(e),n),i.push(aP.updateBusinessObject(e,r,{validation:o})));var s=RE.createElement("camunda:Constraint",{name:void 0,config:void 0},o,n);return i.push(aP.addElementsTolist(e,o,"constraints",[s])),i},updateElement:function(e,t,n,i){var r=a(e,n),o=Vk.getConstraints(r)[i];return t.name=t.name||void 0,t.config=t.config||void 0,aP.updateBusinessObject(e,o,t)},removeElement:function(e,t,n){var i=[],r=a(e,t),o=Vk.getConstraints(r),s=o[n];return i.push(aP.removeElementsFromList(e,r.validation,"constraints",null,[s])),1===o.length&&i.push(aP.updateBusinessObject(e,r,{validation:void 0})),i},show:function(e,t){return!!a(e,t)}})),e.entries.push(wO.label({id:"form-field-properties-header",labelText:i("Properties"),divider:!0,showLabel:function(e,t){return!!a(e,t)}})),e.entries.push(Gk(t,n,{id:"form-field-properties",modelProperties:["id","value"],labels:[i("Id"),i("Value")],getParent:function(e,t){return a(e,t)},show:function(e,t){return!!a(e,t)}},i))}function a(e,t){var n=r.getSelected(e,t.parentNode);if(-1!==n.idx)return Vk.getFormField(e,n.idx)}};function Xk(e){return $k(e).get("camunda:formRefBinding")}function Yk(e){var t=$k(e);return WT(t.get("camunda:formKey"))?WT(t.get("camunda:formRef"))?void 0:"formRef":"formKey"}var Jk=PE.is,Zk=PE.getBusinessObject,Qk=PE.is,ej=tC.isAny,tj=PE.getBusinessObject;function nj(e,t){var n=function(e,t){var n=tj(e),i=DO.getSignalEventDefinition(n);return qA.getExtensionElements(i||n,t)}(e,t);return fw(n,(function(e){return!e.businessKey}))}function ij(e){var t="source";return"all"===e.variables?t="variables":void 0!==e.source?t="source":void 0!==e.sourceExpression&&(t="sourceExpression"),t}var rj="camunda:In",oj="camunda:Out",aj=/\s/,sj=PE.is,cj=PE.getBusinessObject;function pj(e){var t=function(e){return uj(e,"camunda:FormData")[0]}(e);return t&&t.get("fields")||[]}function uj(e,t,n){var i=function(e,t){var n=[],i=e.get("extensionElements");if(void 0!==i){var r=i.get("values");void 0!==r&&(n=w(r,(function(e){return function(e,t){return e&&"function"==typeof e.$instanceOf&&e.$instanceOf(t)}(e,t)})))}return n}(e,t);return n?(i[0]||{})[n]||[]:i}function lj(e,t){var n=function(e){return(uj(e,"camunda:InputOutput")||[])[0]}(e);return n&&n.get(t)||[]}function dj(e){for(var t=[],n=e;n.$parent;)t.push(n.$parent),n=n.$parent;return t}function hj(e,t,n){n=n||0,h(e)||(e=[e]),_(e,(function(e,i){var r=t(e,i,n);h(r)&&r.length&&hj(r,t,n+1)}))}function mj(e,t,n){var i=!n||-1===e.indexOf(t);return i&&e.push(t),i}function fj(e,t,n){var i=[],r=[];return hj(e,(function(e,o,a){mj(i,e,t);var s=e.flowElements;if((-1===n||a<n)&&s&&mj(r,s,t))return s})),i}function vj(e,t){return fj(e,!t,-1)}function yj(e,t){var n,i,r=E(e,(function(e){return e.name===t.name&&e.scope===t.scope}));r>=0?e[r].origin=(n=e[r].origin,i=t.origin,n.concat(i)):e.push(t)}function gj(e,t,n){var i,r;return{name:t,origin:[e],scope:(i=n,r=t,x(dj(e),(function(e){return function(e,t){return e&&"function"==typeof e.$instanceOf&&e.$instanceOf(t)}(e,"bpmn:SubProcess")&&function(e,t){return x(function(e){return lj(e,"inputParameters")}(e),(function(e){return e.name===t}))}(e,r)}))||i)}}function bj(e,t){var n=e.eventDefinitions;return n&&t?w(n,(function(e){return function(e,t){return e&&"function"==typeof e.$instanceOf&&e.$instanceOf(t)}(e,t)})):n}var xj=[function(e){var t=e.elements,n=e.containerElement,i=e.processVariables;return h(t)||(t=[t]),_(t,(function(e){_(function(e){return lj(e,"outputParameters")}(e),(function(t){var r=gj(e,t.name,n);yj(i,r)}))})),i},function(e){var t=e.elements,n=e.containerElement,i=e.processVariables;return h(t)||(t=[t]),_(t,(function(e){var t=function(e){return e.get("camunda:resultVariable")}(e);if(t){var r=gj(e,t,n);yj(i,r)}})),i},function(e){var t=e.elements,n=e.containerElement,i=e.processVariables;return h(t)||(t=[t]),_(t,(function(e){_(pj(e),(function(t){var r=gj(e,t.id,n);yj(i,r)}))})),i},function(e){var t=e.elements,n=e.containerElement,i=e.processVariables;return h(t)||(t=[t]),_(t,(function(e){_(function(e){return uj(e,"camunda:Out")}(e),(function(t){if(!t.local){var r=gj(e,t.target,n);yj(i,r)}}))})),i},function(e){var t=e.elements,n=e.containerElement,i=e.processVariables,r=function(e,t){var r=gj(e,t,n);yj(i,r)};return h(t)||(t=[t]),_(t,(function(e){_(function(e){return bj(e,"bpmn:ErrorEventDefinition")}(e),(function(t){var n=t.get("errorCodeVariable"),i=t.get("errorMessageVariable");n&&r(e,n),i&&r(e,i)})),_(function(e){return bj(e,"bpmn:EscalationEventDefinition")}(e),(function(t){var n=t.get("escalationCodeVariable");n&&r(e,n)}))})),i}];function Ej(e){var t=[],n=vj([e],!1);return _(xj,(function(i){i({elements:n,containerElement:e,processVariables:t})})),t}var wj=t(Object.freeze({__proto__:null,getProcessVariables:Ej,getVariablesForScope:function(e,t){var n,i=Ej(t),r=function(e,t){return x(vj(t),(function(t){return t.id===e}))}(e,t),o=w(i,(function(e){return e.scope.id===r.id})),a=dj(r),s=w(i,(function(e){return x(a,(function(t){return t.id===e.scope.id}))}));return n=s,o.concat(n)}})),_j=wj.getVariablesForScope,Pj=KS.groupBy,Sj=KS.flatten,Oj=KS.forEach,Cj=KS.keys,Tj=KS.map,Aj=KS.sortBy,Rj=PE.getBusinessObject,kj=PE.is,jj=tC.isAny,Mj=hw.escapeHTML,Dj=function(e,t){var n=[];function i(e,n){var i=n?n+"-":"";return Sj(Tj(e,(function(e,n){var r=e.name,o=e.origin,a=[],s=wO.collapsible({id:i+"variable- "+n+"-collapsible",title:Mj(r),description:o.toString(),open:!1,get:function(){return{title:Mj(r),description:o.toString()}}}),c=s.isOpen;a.push(s);var p='<div data-show="show"><b>'+Mj(t("Created in"))+"</b>"+function(e){var t="";return Oj(e,(function(e){t+='<p class="bpp-process-variables__created-in-item">'+e+"</p>"})),t}(o)+"</div>";return a.push({id:i+"variable- "+n+"-created-in",html:p,cssClasses:["bpp-process-variables","bpp-process-variables__created-in"],show:function(){return c()}}),a})))}if(!function(e){var t=Rj(e);return jj(e,["bpmn:Process","bpmn:SubProcess"])||kj(e,"bpmn:Participant")&&t.get("processRef")}(e))return n;var r,o=function(e){var t=Rj(e);if(kj(t,"bpmn:Participant"))return t.processRef;if(kj(t,"bpmn:Process"))return t;var n=t;for(;n.$parent&&!kj(n,"bpmn:Process");)n=n.$parent;return n}(Rj(e)),a=function(e){if(kj(e,"bpmn:Participant"))return Rj(e).processRef.id;return e.id}(e),s=function(e){return Oj(e,(function(e){var t=Tj(e.origin,(function(e){return e.name||e.id}));e.origin=t,e.scope=e.scope.name||e.scope.id})),e}(function(e){return Aj(e,(function(e){return e.name}))}(_j(a,o))),c=function(e){return Pj(e,"scope")}(s),p=Q_(t,t("Available process variables, identified in the diagram."));if(n.push({id:"process-variables-description",html:p,cssClasses:["bpp-process-variables","bpp-process-variables__description"]}),!s.length){var u=Q_(t,t("No variables found."));return n.push({id:"process-variables-placeholder",html:u}),n}return Cj(c).length>1?Oj((r=Cj(c),Tj(r,(function(e,t){return r[r.length-1-t]}))),(function(e){var r=c[e];n.push({id:e+"-scope-title",html:"<div>"+Mj(t("Scope: "))+e+"</div>",cssClasses:["bpp-process-variables","bpp-process-variables__scope-title","bpp-collapsible-break"]}),n=n.concat(i(r,e))})):n=n.concat(i(s)),n};var Bj=tC.isAny,Ij=PE.is,Nj=PE.getBusinessObject,Lj=function(e,t,n){if(function(e){var t=Nj(e);return Bj(e,["bpmn:Process","bpmn:SubProcess"])||Ij(e,"bpmn:Participant")&&t.get("processRef")}(t)){var i=Dj(t,n);e.entries=e.entries.concat(i)}};var Fj=PE.is,Vj=PE.getBusinessObject;function $j(e,t){return e&&qA.getExtensionElements(e,t)||[]}var zj="camunda:ExecutionListener",qj="camunda:TaskListener",Uj=function(e,t,n,i){var r=function(e,t,n,i){var r,o={class:i("Java Class"),expression:i("Expression"),delegateExpression:i("Delegate Expression"),script:i("Script")},a={getSelectedListener:function(e,t){var n=d&&d.getSelected(e,t)||{idx:-1},i=$j(r,zj)[n.idx];return!i&&h&&(n=h.getSelected(e,t),i=$j(r,qj)[n.idx]),i}},s=a.entries=[],c=KA.isSequenceFlow(e),p=function(e){return function(t,n,i,a,s,c){var p=$j(r,e)[c],u=KA.getImplementationType(p),l=((p.get("event")?p.get("event"):"<empty>")||"*")+" : "+(o[u]||"");i.text=l}},u=function(e,n,i){return function(e,r,o){var a={event:i,class:""},s=RE.createElement(n,a,r,t);return aP.addElementsTolist(e,r,"values",[s])}},l=function(e,t){return function(e,n,i,o){var a=$j(r,t)[o];if(a)return qA.removeEntry(r,e,a)}};if((Fj(e,"bpmn:FlowElement")||Fj(e,"bpmn:Process")||Fj(e,"bpmn:Participant"))&&(r=Vj(e),Fj(e,"bpmn:Participant")&&(e=e.processRef,r=r.get("processRef")),r)){var d=Rk(e,t,{id:"executionListeners",label:i("Execution Listener"),modelProperty:"name",idGeneration:"false",reference:"processRef",createExtensionElement:u(0,zj,c?"take":"start"),removeExtensionElement:l(0,zj),getExtensionElements:function(e){return $j(r,zj)},onSelectionChange:function(e,t,n,i){h&&h.deselect(e,t)},setOptionLabelValue:p(zj)});s.push(d)}if(Fj(e,"bpmn:UserTask")){r=Vj(e);var h=Rk(e,t,{id:"taskListeners",label:i("Task Listener"),modelProperty:"name",idGeneration:"false",createExtensionElement:u(0,qj,"create"),removeExtensionElement:l(0,qj),getExtensionElements:function(e){return $j(r,qj)},onSelectionChange:function(e,t,n,i){d.deselect(e,t)},setOptionLabelValue:p(qj)});s.push(h)}return a}(t,n,0,i);return e.entries=e.entries.concat(r.entries),{getSelectedListener:r.getSelectedListener}},Gj=PE.is,Hj=KS.find,Wj=function(e,t,n,i,r){var o={class:r("Java Class"),expression:r("Expression"),delegateExpression:r("Delegate Expression"),script:r("Script")},a=(i=i||{}).getSelectedListener,s="class",c="expression",p="delegateExpression",u="script",l=KA.isSequenceFlow(t)?[{name:r("take"),value:"take"}]:[{name:r("start"),value:"start"},{name:r("end"),value:"end"}],d=[{name:r("create"),value:"create"},{name:r("assignment"),value:"assignment"},{name:r("complete"),value:"complete"},{name:r("delete"),value:"delete"},{name:r("update"),value:"update"},{name:r("timeout"),value:"timeout"}],h=function(e,t){return a(e,t)};e.entries.push(wO.selectBox(r,{id:"listener-event-type",label:r("Event Type"),modelProperty:"eventType",emptyParameter:!1,get:function(e,t){var n=a(e,t);return{eventType:n&&n.get("event")}},set:function(e,t,n){var i=t.eventType,r=a(e,n),o=r&&r.eventDefinitions;return o&&"timeout"!==i&&(o=[]),aP.updateBusinessObject(e,r,{event:i,eventDefinitions:o})},selectOptions:function(e,t){var n,i=a(e,t);return KA.isTaskListener(i)?n=d:KA.isExecutionListener(i)&&(n=l),n},hidden:function(e,t){return!h(e,t)}})),e.entries.push(wO.textField(r,{id:"listener-id",label:r("Listener Id"),modelProperty:"listenerId",get:function(e,t){var n={},i=a(e,t);return n.listenerId=i&&i.get("id")||void 0,n},set:function(e,t,n){var i={},r=a(e,n);return i.id=t.listenerId||"",aP.updateBusinessObject(e,r,i)},hidden:function(e,t){var n=a(e,t);return!KA.isTaskListener(n)},validate:function(e,t,n){var i=t.listenerId,o=a(e,n),s={};return!i&&Kj(o)&&(s.listenerId=r("Must provide a value for timeout task listener")),s}})),e.entries.push(wO.selectBox(r,{id:"listener-type",label:r("Listener Type"),selectOptions:[{value:s,name:r("Java Class")},{value:c,name:r("Expression")},{value:p,name:r("Delegate Expression")},{value:u,name:r("Script")}],modelProperty:"listenerType",emptyParameter:!1,get:function(e,t){var n=a(e,t);return{listenerType:KA.getImplementationType(n)}},set:function(e,t,i){var r=a(e,i),o=t.listenerType||void 0,l={};return l.class=o===s?"":void 0,l.expression=o===c?"":void 0,l.delegateExpression=o===p?"":void 0,l.script=o===u?n.create("camunda:Script"):void 0,aP.updateBusinessObject(e,r,l)},hidden:function(e,t){return!h(e,t)}})),e.entries.push(wO.textField(r,{id:"listener-value",dataValueLabel:"listenerValueLabel",modelProperty:"listenerValue",get:function(e,t){var n={},i=a(e,t),r=KA.getImplementationType(i);return n.listenerValueLabel=o[r]||"",n.listenerValue=i&&i.get(r)||void 0,n},set:function(e,t,n){var i={},r=a(e,n);return i[KA.getImplementationType(r)]=t.listenerValue||"",aP.updateBusinessObject(e,r,i)},hidden:function(e,t){var n=a(e,t);return!n||n.script},validate:function(e,t){var n={};return t.listenerValue||(n.listenerValue=r("Must provide a value")),n}}));var m=pk("scriptFormat","value",!0,r);e.entries.push({id:"listener-script-value",html:'<div data-show="isScript">'+m.template+"</div>",get:function(e,t){var n=a(e,t);return n&&n.script?m.get(e,n.script):{}},set:function(e,t,n){var i=a(e,n),r=m.set(e,t,i);return aP.updateBusinessObject(e,i.script,r)},validate:function(e,t,n){var i=a(e,n);return i&&i.script?m.validate(e,t):{}},isScript:function(e,t){var n=a(e,t);return n&&n.script},script:m});var f={idPrefix:"listener-",createTimerEventDefinition:function(e,t){var i=a(e,t);if(i&&Kj(i)){var r=i.get("eventDefinitions")||[],o=n.create("bpmn:TimerEventDefinition");return r.push(o),i.eventDefinitions=r,o}}};GO(e,t,n,(function(e,t){var n=a(e,t);if(n&&Kj(n)){var i,r=(i=n.eventDefinitions||[],Hj(i,(function(e){return Gj(e,"bpmn:TimerEventDefinition")})));return r||!1}}),r,f)};function Kj(e){return"timeout"===(e&&e.event)}var Xj=PE.getBusinessObject,Yj={stringValue:void 0,string:void 0,expression:void 0},Jj="camunda:Field",Zj=function(e,t,n,i){var r=!!(i=i||{}).insideListener,o=i.idPrefix||"",a=i.getSelectedListener,s=i.businessObject||Xj(e),c=[],p=function(e,t){return u(e,t)};function u(e,t){var n=h.getSelected(e,t.parentNode);if(-1!==n.idx)return l(e,t)[n.idx]}function l(e,t){return r?function(e,t){var n=a(e,t);return n&&n.fields||[]}(e,t):s&&qA.getExtensionElements(s,Jj)}function d(e){var t="string",n=e&&e.expression;return void 0!==(e&&(e.string||e.stringValue))?t="string":void 0!==n&&(t="expression"),t}var h=Rk(e,t,{id:o+"fields",label:n("Fields"),modelProperty:"fieldName",idGeneration:"false",businessObject:s,createExtensionElement:function(e,n,i,o){var s,c={name:"",string:""};if(r){var p=a(e,o);return s=RE.createElement(Jj,c,p,t),aP.addElementsTolist(e,p,"fields",[s])}return s=RE.createElement(Jj,c,n,t),aP.addElementsTolist(e,n,"values",[s])},removeExtensionElement:function(e,t,n,i,o){var c=l(e,o)[i];if(c){if(!r)return qA.removeEntry(s,e,c);var p=a(e,o);return aP.removeElementsFromList(e,p,"fields",null,[c])}},getExtensionElements:function(e,t){return l(e,t)},setOptionLabelValue:function(e,t,n,i,r,o){var a=l(e,t)[o],s=o+" : "+(a.name?a.name:"<empty>");n.text=s}});c.push(h),c.push(wO.validationAwareTextField(n,{id:o+"field-name",label:n("Name"),modelProperty:"fieldName",getProperty:function(e,t){return(u(e,t)||{}).name},setProperty:function(e,t,n){var i=u(e,n);return aP.updateBusinessObject(e,i,{name:t.fieldName})},validate:function(e,t,i){var r={};if(u(e,i)){var o=t.fieldName;o?hw.containsSpace(o)&&(r.fieldName=n("Name must not contain spaces")):r.fieldName=n("Parameter must have a name")}return r},hidden:function(e,t){return!p(e,t)}}));var m=[{name:n("String"),value:"string"},{name:n("Expression"),value:"expression"}];return c.push(wO.selectBox(n,{id:o+"field-type",label:n("Type"),selectOptions:m,modelProperty:"fieldType",get:function(e,t){return{fieldType:d(u(e,t))}},set:function(e,t,n){var i=EP({},Yj),r=t.fieldType;return"string"===r?i.string="":"expression"===r&&(i.expression=""),aP.updateBusinessObject(e,u(e,n),i)},hidden:function(e,t){return!p(e,t)}})),c.push(wO.textBox(n,{id:o+"field-value",label:n("Value"),modelProperty:"fieldValue",get:function(e,t){var n,i=u(e,t),r=d(i);return"string"===r?n=i&&(i.string||i.stringValue):"expression"===r&&(n=i&&i.expression),{fieldValue:n}},set:function(e,t,n){var i=u(e,n),r=d(i),o=EP({},Yj),a=t.fieldValue||void 0;return"string"===r?o.string=a:"expression"===r&&(o.expression=a),aP.updateBusinessObject(e,i,o)},validate:function(e,t,i){var r={};return u(e,i)&&(t.fieldValue||(r.fieldValue=n("Must provide a value"))),r},show:function(e,t){return p(e,t)}})),c},Qj=tC.isAny,eM="element-template-option-empty",tM={name:"",value:eM};function nM(e,t,n){var i=n(t.name);t.version&&(i+=" (v"+t.version+")");var r={id:t.id,name:i,value:e};return t.version&&(r.version=t.version),r}function iM(e){var t=new Date(e),n=t.getFullYear(),i=rM(String(t.getMonth()+1),2,"0");return rM(String(t.getDate()),2,"0")+"."+i+"."+n}function rM(e,t,n){for(;e.length<t;)e=n+e;return e}var oM={ELEMENT_TEMPLATE_OPTION_EMPTY:"element-template-option-empty",getOptions:function(e,t,n){var i=[tM],r=t.getDefault(e);if(r)return i.push(nM("element-template-option-0",r,n)),i;var o=0;return t.getAll().forEach((function(t){Qj(e,t.appliesTo)&&(i.push(nM("element-template-option-"+o,t,n)),o++)})),i},getOption:function(e,t){return CP(t,(function(t){return e===t.value}))},getVersionOrDateFromTemplate:function(e){var t=e.metadata,n=e.version;if(t){if(!WT(t.created))return"Version "+iM(t.created);if(!WT(t.updated))return"Version "+iM(t.updated)}return WT(n)?null:"Version "+n}},aM=hw.escapeHTML,sM=KC.getTemplateId,cM=GE.classes,pM=GE.event,uM=GE.domify,lM=GE.query,dM=PE.getBusinessObject,hM=oM.getVersionOrDateFromTemplate,mM=200,fM=function(e,t,n,i,r,o,a){var s,c,p=n.get(e),u=[];return p?((c=function(e,t){if(WT(t.version))return null;return e.getAll().filter((function(e){return t.id===e.id&&!WT(e.version)})).reduce((function(e,n){return t.version<n.version||e&&e.version<n.version?n:e}),null)}(n,p))&&u.push({id:"element-template-update",cssClasses:["bpp-entry--warning"],html:yM(e,p,c,t,a)}),(s=p.description)&&u.push(function(e,t){e=aM(e);var n=uM('<p class="description description--expanded"></p>'),i=uM('<span class="description__text">'+e+"</span>");function r(r){r?(cM(n).add("description--expanded"),i.textContent=e+" ",a.textContent=t("Less")):(cM(n).remove("description--expanded"),i.textContent=o+" ... ",a.textContent=t("More"))}n.appendChild(i);var o,a,s=!1;e.length>mM&&(o=e.slice(0,mM),a=uM('<span class="bpp-entry-link description__expand">'+t("More")+"</span>"),pM.bind(a,"click",(function(){r(s=!s)})),n.appendChild(a),r(s));return{id:"element-template-description",html:n}}(s,a))):u.push({id:"element-template-not-found",cssClasses:["bpp-entry--warning"],html:vM(e,i,a)}),p&&p.version&&u.push({id:"element-template-version",html:"<p>"+hM(p)+"</p>"}),{id:"elementTemplateDescription",label:p?p.name:a("Missing Template"),dropdown:{menu:[{id:"element-template-unlink",label:a("Unlink"),onClick:function(){i.updateProperties(e,{"camunda:modelerTemplate":null,"camunda:modelerTemplateVersion":null})}},{id:"element-template-remove",label:a("Remove"),onClick:function(){var t=dM(e),n=t.$type,i=function(e){if(!e.eventDefinitions)return null;var t=e.eventDefinitions[0];if(!t)return null;return t.$type}(t),a=r.replaceElement(e,{type:n,eventDefinitionType:i});o.select(a)}}]},entries:u}};function vM(e,t,n){var i=sM(e),r=uM("<p>"+n("The applied Template <{templateId}> was not found and therefore its data is not accessible.<br /><br />Unlink in order to access the data.",{templateId:i})+'</p><p style="text-align: right;"><a class="bpp-entry-link bpp-entry-link-button">Unlink</a></p>');return lM(".bpp-entry-link",r).addEventListener("click",(function(){t.updateProperties(e,{"camunda:modelerTemplate":null})})),r}function yM(e,t,n,i,r){var o=hM(n),a=uM("<p>"+r("A new version of the Template ({newElementTemplateVersion}) is available.",{newElementTemplateVersion:o})+'</p><p style="text-align: right;"><a class="bpp-entry-link bpp-entry-link-button">Update</a></p>');return lM(".bpp-entry-link",a).addEventListener("click",(function(){i.execute("propertiesPanel.camunda.changeTemplate",{element:e,newTemplate:n,oldTemplate:t})})),a}var gM=function(e){return null===e};var bM=function(e,t,n,i){if(!Gg(e))return e;for(var r=-1,o=(t=uE(t,e)).length,a=o-1,s=e;null!=s&&++r<o;){var c=lE(t[r]),p=n;if("__proto__"===c||"constructor"===c||"prototype"===c)return e;if(r!=a){var u=s[c];void 0===(p=i?i(u,c,s):void 0)&&(p=Gg(u)?u:Ag(t[r+1])?[]:{})}vP(s,c,p),s=s[c]}return e};var xM=function(e,t,n){for(var i=-1,r=t.length,o={};++i<r;){var a=t[i],s=dE(e,a);n(s,a)&&bM(o,uE(a,e),s)}return o};var EM=function(e,t){return xM(e,t,(function(t,n){return vE(e,n)}))};var wM=function(e){return Ow(xw(e,void 0,HT),e+"")}((function(e,t){return null==e?{}:EM(e,t)})),_M=oM.getOption,PM=oM.getOptions,SM=KC.getTemplateId,OM=KC.ELEMENT_TEMPLATE_OPTION_EMPTY;var CM=PE.getBusinessObject,TM=KC.findExtension,AM=KC.findExtensions,RM=KC.findInputParameter,kM=KC.findOutputParameter,jM=KC.findCamundaProperty,MM=KC.findCamundaInOut,DM=KC.findCamundaErrorEventDefinition,BM=nT.createCamundaProperty,IM=nT.createInputParameter,NM=nT.createOutputParameter,LM=nT.createCamundaIn,FM=nT.createCamundaOut,VM=nT.createCamundaInWithBusinessKey,$M=nT.createCamundaFieldInjection,zM=nT.createCamundaErrorEventDefinition,qM=nT.createError,UM=hw.getRoot,GM="property",HM="camunda:property",WM="camunda:inputParameter",KM="camunda:outputParameter",XM="camunda:in",YM="camunda:out",JM="camunda:in:businessKey",ZM="camunda:executionListener",QM="camunda:field",eD="camunda:errorEventDefinition",tD=["Boolean","Integer","String"],nD=[HM,WM,KM,XM,YM,JM,QM,eD],iD=[WM,KM],rD=[XM,YM,JM],oD=function(e,t,n,i){var r=t.get(e);if(!r)return[];var o,a,s=function(e,t,r){var o,a=t.type,s={id:e,description:t.description,label:t.label?i(t.label):t.label,modelProperty:e,get:aD(e,t),set:sD(e,t,n),validate:cD(e,t,i)};return a||(a=function(e){var t=e.binding.type;if(t===GM||t===HM||t===XM||t===JM||t===YM||t===QM)return"String";if(t===ZM)return"Hidden"}(t)),"Boolean"===a&&(o=wO.checkbox(i,s)),"String"===a&&(o=wO.textField(i,s)),"Text"===a&&(o=wO.textBox(i,s)),"Dropdown"===a&&(s.selectOptions=t.choices,o=wO.selectBox(i,s)),o},c=[],p={id:"customField",label:i("Custom Fields"),entries:[]};return r.properties.forEach((function(e,t){o="custom-"+r.id+"-"+t,(a=s(o,e))&&p.entries.push(a)})),p.entries.length>0&&c.push(p),r.scopes&&QC(r.scopes).forEach((function(e){var t=e.type,n=t.replace(/:/g,"_"),o={id:"customField-"+n,label:i("Custom Fields for scope: ")+t,entries:[]};e.properties.forEach((function(t,i){var c="custom-"+r.id+"-"+n+"-"+i,p=function(e,t){var n=t.type,i=t.id;if(!n)return e;return EP({},e,{scope:{name:n,id:i}})}(t,e);(a=s(c,p))&&o.entries.push(a)})),o.entries.length>0&&c.push(o)})),c};function aD(e,t){return function(n){var i=pD(n,t);return dD(e,i)}}function sD(e,t,n){return function(i,r){var o=r[e];return uD(i,t,o,n)}}function cD(e,t,n){return function(i,r){var o=function(e,t,n){var i=t.constraints||{};if(i.notEmpty&&(r=e,!r||/^\s*$/.test(r)))return n("Must not be empty");var r;if(i.maxLength&&e.length>i.maxLength)return n("Must have max length {length}",{length:i.maxLength});if(i.minLength&&e.length<i.minLength)return n("Must have min length {length}",{length:i.minLength});var o,a=i.pattern;if(a&&("string"!=typeof a&&(o=a.message,a=a.value),!function(e,t){return new RegExp(t).test(e)}(e,a)))return o||n("Must match pattern {pattern}",{pattern:a})}(r[e],t,n);if(o)return dD(e,o)}}function pD(e,t){var n,i,r,o,a,s,c,p=CM(e),u=t.binding,l=t.scope,d=u.type,h=u.name,m=t.value||"";if(l&&!(p=hD(p,l)))return m;if("property"===d){var f=p.get(h);return"conditionExpression"===h?f?f.body:m:void 0!==f?f:m}if(d===HM)return(n=l?p.get("properties"):TM(p,"camunda:Properties"))&&(i=jM(n,u))?i.value:m;if(-1!==iD.indexOf(d)&&!(r=l?p.get("inputOutput"):TM(p,"camunda:InputOutput")))return m;if(d===WM){if(o=RM(r,u)){if(!u.scriptFormat)return o.value||"";if(o.definition)return o.definition.value}return m}if(u.type===KM)return(o=kM(r,u))?o.name:m;if(-1!=rD.indexOf(d)){if(a=MM(p,u)){if(d===JM)return a.businessKey;if(d===YM)return a.target;if(d===XM)return a[u.expression?"sourceExpression":"source"]}return m}if(d===ZM)return(l?p.get("executionListener"):TM(p,"camunda:ExecutionListener")).script.value;if(QM===d)return AM(p,["camunda:Field"]).forEach((function(e){e.name===u.name&&(s=e)})),s?s.string||s.expression:"";if(eD===d)return(c=DM(p,u.errorRef))?c.expression:"";throw function(e){var t=e.binding;return new Error("unknown binding: <"+t.type+">")}(t)}function uD(e,t,n,i){var r,o,a,s,c,p,u,l,d,h,m=CM(e),f=t.binding,v=t.scope,y=f.type,g=f.name,b=UM(m),x=[];if(-1!==nD.indexOf(y)&&((o=m.get("extensionElements"))||(o=RE.createElement("bpmn:ExtensionElements",null,e,i),x.push(aP.updateBusinessObject(e,m,dD("extensionElements",o))))),v&&((m=hD(m,v))||("bpmn:Error"===v.name?(m=qM(v.id,b,i),x.push(aP.addElementsTolist(m,b,"rootElements",[m]))):(m=RE.createElement(v.name,null,e,i),x.push(aP.addElementsTolist(m,o,"values",[m]))))),"property"===y){if("conditionExpression"===g)r=RE.createElement("bpmn:FormalExpression",{body:n,language:f.scriptFormat},m,i);else{var E=m.$descriptor.propertiesByName[g].type;if(-1===tD.indexOf(E))throw new Error("cannot set moddle type <"+E+">");"Boolean"===E?r=!!n:"Integer"===E?(r=parseInt(n,10),isNaN(r)&&(r=void 0)):r=n}void 0!==r&&x.push(aP.updateBusinessObject(e,m,dD(g,r)))}if(y===HM&&((a=v?m.get("properties"):TM(o,"camunda:Properties"))||(a=RE.createElement("camunda:Properties",null,m,i),v?x.push(aP.updateBusinessObject(e,m,{properties:a})):x.push(aP.addElementsTolist(e,o,"values",[a]))),s=jM(a,f),c=BM(f,n,i),x.push(aP.addAndRemoveElementsFromList(e,a,"values",null,[c],s?[s]:[]))),-1!==iD.indexOf(y)&&((p=v?m.get("inputOutput"):TM(o,"camunda:InputOutput"))||(p=RE.createElement("camunda:InputOutput",null,m,i),v?x.push(aP.updateBusinessObject(e,m,{inputOutput:p})):x.push(aP.addElementsTolist(e,o,"values",p)))),y===WM&&(u=RM(p,f),l=IM(f,n,i),x.push(aP.addAndRemoveElementsFromList(e,p,"inputParameters",null,[l],u?[u]:[]))),y===KM&&(u=kM(p,f),l=NM(f,n,i),x.push(aP.addAndRemoveElementsFromList(e,p,"outputParameters",null,[l],u?[u]:[]))),-1!==rD.indexOf(y)&&(d=MM(m,f),h=y===XM?LM(f,n,i):y===YM?FM(f,n,i):VM(f,n,i),x.push(aP.addAndRemoveElementsFromList(e,o,"values",null,[h],d?[d]:[]))),y===QM){var w=AM(m,["camunda:Field"]),_=[];w.length>0?w.forEach((function(e){e.name===f.name?_.push($M(f,n,i)):_.push(e)})):_.push($M(f,n,i)),x.push(aP.addAndRemoveElementsFromList(e,o,"values",null,_,w||[]))}if(y===eD){var P=DM(m,f.errorRef);if(P)x.push(aP.updateBusinessObject(e,P,{expression:n}));else{var S=qM(f.errorRef,b,i),O=zM(f,n,S,o,i);x.push(aP.addAndRemoveElementsFromList(e,b,"rootElements",null,[S],[])),x.push(aP.addAndRemoveElementsFromList(e,o,"values",null,[O],[]))}}if(x.length)return x;console.warn("no update",e,t,n)}var lD=uD;function dD(e,t){var n={};return n[e]=t,n}function hD(e,t){var n=t.name,i=t.id;if("bpmn:Error"===n){var r=DM(e,i);if(r)return r.errorRef}return TM(e,n)}oD.getPropertyValue=pD,oD.setPropertyValue=lD;var mD=PE.is,fD=PE.getBusinessObject,vD=tC.isAny,yD=wj.getVariablesForScope,gD=KS.filter,bD=KS.map,xD=KS.sortBy,ED=GE.query,wD=function(e,t,n,i){var r={"camunda:Map":{value:"map",label:i("Map")},"camunda:List":{value:"list",label:i("List")},"camunda:Script":{value:"script",label:i("Script")}},o=(n=n||{}).idPrefix||"",a=n.getParameter&&"function"==typeof n.getParameter?function(){return n.getParameter()}:function(){return e},s={},c=[];s.entries=c;var p=wO.collapsible({id:o+"collapsible",title:e.name,description:CD(e),cssClasses:["bpp-collapsible--with-mapping"],open:!1,onRemove:n.onRemove,onToggle:n.onToggle,get:function(){return{title:a().name,description:CD(a())}}}),u=n.isOpen||p.isOpen;s.setOpen=function(e,t){var n=ED('[data-entry="'+p.id+'"]',t);p.setOpen(e,n)},c.push(p),c.push(wO.validationAwareTextField(i,{id:o+"parameterName",label:mD(e,"camunda:InputParameter")?i("Local Variable Name"):i("Process Variable Name"),modelProperty:"name",getProperty:function(t,n){return e.name},setProperty:function(t,n,i){return aP.updateBusinessObject(t,e,n)},validate:function(e,t,n){var r={},o=t.name;return o?hw.containsSpace(o)&&(r.name=i("Name must not contain spaces")):r.name=i("Parameter must have a name"),r},hidden:function(e,t){return!u()}}));var l=[{value:"text",name:i("String or Expression")},{value:"script",name:i("Script")},{value:"list",name:i("List")},{value:"map",name:i("Map")}];c.push(wO.selectBox(i,{id:o+"parameterType",label:i("Variable Assignment Type"),selectOptions:l,modelProperty:"parameterType",get:function(e,t){var n="text",i=a().get("definition");if(void 0!==i){var o=i.$type;n=r[o].value}return{parameterType:n}},set:function(e,n,i){var r={value:void 0,definition:void 0},o=function(e){return _D(e,a(),t)},s=n.parameterType;return"script"===s?r.definition=o("camunda:Script"):"list"===s?r.definition=o("camunda:List"):"map"===s&&(r.definition=o("camunda:Map")),aP.updateBusinessObject(e,a(),r)},hidden:function(e,t){return!u()}})),c.push(wO.autoSuggest(i,{id:o+"parameterType-text",label:i("Variable Assignment Value"),description:i('Start typing "${}" to create an expression.'),modelProperty:"value",get:function(e,t){return{value:a().value}},set:function(e,t,n){return t.value=t.value||void 0,aP.updateBusinessObject(e,a(),t)},show:function(e,t){return u()&&!a().definition},getItems:function(e){var t=function(e){var t=fD(e);if(vD(t,["bpmn:Process","bpmn:SubProcess"]))return t.id;var n=t;for(;n.$parent&&!vD(n,["bpmn:Process","bpmn:SubProcess"]);)n=n.$parent;return n.id}(e),n=function(e){var t=fD(e);for(;t.$parent&&!mD(t,"bpmn:Process");)t=t.$parent;return t}(e),i=yD(t,n),r=function(e){return xD(e,(function(e){return e.name}))}(i=gD(i,(function(t){var n=t.origin;return!!gD(n,(function(t){return t.id!==e.id})).length})));return bD(r,(function(e){return e.name}))},canSuggest:function(e,t,n){var i=function(e,t,n){for(var i=t.childNodes,r="",o=0;o<=i.length-1;o++){var a=i[o];if(a.contains(n))break;r+=(a.innerText||a.wholeText)+"\n"}return r.length+(e.index||0)}(e,t,n);return!!function(e,t){var n=e.indexOf("${"),i=e.indexOf("}");return n>-1&&n<=t&&i>-1&&t<i}(t.innerText,i)||!!function(e,t){var n=e.lastIndexOf("}",t),i=e.indexOf("${",n+1);return i>-1&&i<=t}(t.innerText,i)}}));var d=pk("scriptFormat","value",!0,i,{idPrefix:o});return c.push({id:o+"parameterType-script",html:'<div data-show="show">'+d.template+"</div>",get:function(e,t){return PD(a().definition)?d.get(e,a().definition):{}},set:function(e,t,n){var i=d.set(e,t);return aP.updateBusinessObject(e,a().definition,i)},validate:function(e,t,n){return PD(a().definition)?d.validate(e,a().definition):{}},script:d,show:function(e,t){return u()&&a().definition&&PD(a().definition)}}),c.push(wO.table(i,{id:o+"parameterType-list",modelProperties:["value"],labels:[i("Value")],addLabel:i("Add Value"),getElements:function(e,t){return SD(a().definition)?a().definition.items:[]},updateElement:function(e,t,n,i){var r=a().definition.items[i];return aP.updateBusinessObject(e,r,t)},addElement:function(e,n){var i=_D("camunda:Value",a().definition,t,{value:void 0});return aP.addElementsTolist(e,a().definition,"items",[i])},removeElement:function(e,t,n){return aP.removeElementsFromList(e,a().definition,"items",null,[a().definition.items[n]])},editable:function(e,t,n,i){var r=a().definition.items[i];return!OD(r)&&!SD(r)&&!PD(r)},setControlValue:function(e,t,n,i,o,s){var c=a().definition.items[s];OD(c)||SD(c)||PD(c)?n.value=r[c.$type].label:n.value=o},show:function(e,t){return u()&&a().definition&&SD(a().definition)}})),c.push(wO.table(i,{id:o+"parameterType-map",modelProperties:["key","value"],labels:[i("Key"),i("Value")],addLabel:i("Add Entry"),getElements:function(e,t){return a()&&OD(a().definition)?a().definition.entries:[]},updateElement:function(e,t,n,i){var r=a().definition.entries[i];return(OD(r.definition)||SD(r.definition)||PD(r.definition))&&(t={key:t.key}),aP.updateBusinessObject(e,r,t)},addElement:function(e,n){var i=_D("camunda:Entry",a().definition,t,{key:void 0,value:void 0});return aP.addElementsTolist(e,a().definition,"entries",[i])},removeElement:function(e,t,n){return aP.removeElementsFromList(e,a().definition,"entries",null,[a().definition.entries[n]])},editable:function(e,t,n,i){var r=a().definition.entries[i];return"key"===n||!OD(r.definition)&&!SD(r.definition)&&!PD(r.definition)},setControlValue:function(e,t,n,i,o,s){var c=a().definition.entries[s];"key"!==i&&(OD(c.definition)||SD(c.definition)||PD(c.definition))?n.value=r[c.definition.$type].label:n.value=o},show:function(e,t){return u()&&a().definition&&OD(a().definition)}})),s};function _D(e,t,n,i){return RE.createElement(e,i,t,n)}function PD(e){return mD(e,"camunda:Script")}function SD(e){return mD(e,"camunda:List")}function OD(e){return mD(e,"camunda:Map")}function CD(e){var t=e.get("definition");return t?PD(t)?t.value:SD(t)?"List":OD(t)?"Map":void 0:e.value}var TD=KS.assign,AD=KS.flatten,RD=KS.filter,kD=KS.findIndex,jD=KS.forEach,MD=GE.classes,DD=GE.event,BD=GE.domify,ID=GE.query,ND=PE.getBusinessObject,LD=KC.findExtension,FD=KC.findInputParameter,VD=nT.createInputParameter,$D=hw.escapeHTML,zD=200,qD={get:function(){},set:function(){}},UD=function(e,t,n,i,r){var o=n.get(t);if(!o)return[];var a=[];function s(e,t){if(e){var n=t.dataset.entry;a.forEach((function(e){var t=e[0];if(t.id!==n){var i=ID('[data-entry="'+t.id+'"]');t.setOpen(!1,i)}}))}}function c(e,n){var o,a=[],c=ND(t),p=LD(c,"camunda:InputOutput");if(!p)return a;var u,l=function(){return FD(p,n.binding)||qD},d=l(),h=function(){return o.isOpen()},m=function(){var e=LD(ND(t),"camunda:InputOutput");return!!FD(e,n.binding)},f=GD(a=wD(d,i,{idPrefix:e+"-",onToggle:s,getParameter:l,isOpen:function(){return h()&&m()}},r).entries,e+"-parameterName"),v=(o=a[GD(a,e+"-collapsible")]).get;return o.get=function(){return TD(v(),{title:n.label?r(n.label):n.binding.name})},u=f,a.splice(u,1),n.description&&a.splice(1,0,function(e,t,n,i){e=$D(e);var r=BD('<p class="description description--expanded" data-show="show"></p>'),o=BD('<span class="description__text">'+e+"</span>");function a(t){t?(MD(r).add("description--expanded"),o.textContent=e+" ",c.textContent=i("Less")):(MD(r).remove("description--expanded"),o.textContent=s+" ... ",c.textContent=i("More"))}r.appendChild(o);var s,c,p=!1;e.length>zD&&(s=e.slice(0,zD),c=BD('<span class="bpp-entry-link description__expand">'+i("More")+"</span>"),DD.bind(c,"click",(function(){a(p=!p)})),r.appendChild(c),a(p));return{id:t+"-description",html:r,show:n}}(n.description,e,o.isOpen,r)),a.splice(n.description?2:1,0,wO.toggleSwitch(r,{id:e+"-assignment-toggle",label:r("Local Variable Assignment"),modelProperty:"isActive",labelOn:r("On"),labelOff:r("Off"),descriptionOff:r("The parameter won't be created as local variable."),isOn:m,get:function(e,t){return{isActive:m()}},set:function(e,t,r){return t.isActive||!1?function(e,t,n){var i=ND(e),r=[],o=i.get("extensionElements");o||(o=RE.createElement("bpmn:ExtensionElements",null,e,n),r.push(aP.updateBusinessObject(e,i,{extensionElements:o})));var a=LD(o,"camunda:InputOutput");a||(a=RE.createElement("camunda:InputOutput",null,i,n),r.push(aP.addElementsTolist(e,o,"values",a)));var s=VD(t,null,n);return r.push(aP.addAndRemoveElementsFromList(e,a,"inputParameters",null,[s],[])),r}(e,n.binding,i):function(e,t){var n=ND(e),i=[],r=n.get("extensionElements");if(!r)return i;var o=LD(r,"camunda:InputOutput");if(!o)return i;var a=FD(o,t);if(!a)return i;return i.push(aP.removeElementsFromList(e,o,"inputParameters",null,[a])),i}(e,n.binding)},hidden:function(e,t){return!h()}})),a}var p=RD(o.properties,(function(e){return!e.type&&"camunda:inputParameter"===e.binding.type}));jD(p,(function(e,t){var n="template-inputs-"+o.id+"-"+t;a.push(c(n,e))})),e.entries=e.entries.concat(AD(a))};function GD(e,t){return kD(e,(function(e){return e.id===t}))}var HD=KS.flatten,WD=KS.filter,KD=KS.forEach,XD=PE.getBusinessObject,YD=KC.findExtension,JD=KC.findOutputParameter,ZD=nT.createOutputParameter,QD=GE.classes,eB=GE.event,tB=GE.domify,nB=GE.query,iB=hw.escapeHTML,rB=200,oB={get:function(){},set:function(){}},aB=function(e,t,n,i,r){var o=n.get(t);if(!o)return[];var a=[];function s(e,t){if(e){var n=t.dataset.entry;a.forEach((function(e){var t=e[0];if(t.id!==n){var i=nB('[data-entry="'+t.id+'"]');t.setOpen(!1,i)}}))}}function c(e,n){var o=[],a=XD(t),c=YD(a,"camunda:InputOutput");if(!c)return o;var p=function(){return JD(c,n.binding)||oB},u=wO.collapsible({id:e+"-collapsible",title:r(n.label),cssClasses:["bpp-collapsible--with-mapping","bpp-collapsible--with-template-out"],onToggle:s,open:!1,get:function(){return{title:r(n.label),description:p().name}}});o.push(u);var l=u.isOpen,d=function(){var e=YD(XD(t),"camunda:InputOutput");return!!JD(e,n.binding)};return n.description&&o.push(function(e,t,n,i){e=iB(e);var r=tB('<p class="description description--expanded" data-show="show"></p>'),o=tB('<span class="description__text">'+e+"</span>");function a(t){t?(QD(r).add("description--expanded"),o.textContent=e+" ",c.textContent=i("Less")):(QD(r).remove("description--expanded"),o.textContent=s+" ... ",c.textContent=i("More"))}r.appendChild(o);var s,c,p=!1;e.length>rB&&(s=e.slice(0,rB),c=tB('<span class="bpp-entry-link description__expand">'+i("More")+"</span>"),eB.bind(c,"click",(function(){a(p=!p)})),r.appendChild(c),a(p));return{id:t+"-description",html:r,show:n}}(n.description,e,l,r)),o.splice(n.description?2:1,0,wO.toggleSwitch(r,{id:e+"-assignment-toggle",label:r("Process Variable Assignment"),modelProperty:"isActive",labelOn:r("On"),labelOff:r("Off"),descriptionOff:r("The parameter won't be available in the process scope."),isOn:d,get:function(e,t){return{isActive:d()}},set:function(e,t,r){return t.isActive||!1?function(e,t,n){var i=XD(e),r=[],o=i.get("extensionElements");o||(o=RE.createElement("bpmn:ExtensionElements",null,e,n),r.push(aP.updateBusinessObject(e,i,{extensionElements:o})));var a=YD(o,"camunda:InputOutput");a||(a=RE.createElement("camunda:InputOutput",null,i,n),r.push(aP.addElementsTolist(e,o,"values",a)));var s=ZD(t,null,n);return r.push(aP.addAndRemoveElementsFromList(e,a,"outputParameters",null,[s],[])),r}(e,n.binding,i):function(e,t){var n=XD(e),i=[],r=n.get("extensionElements");if(!r)return i;var o=YD(r,"camunda:InputOutput");if(!o)return i;var a=JD(o,t);if(!a)return i;return i.push(aP.removeElementsFromList(e,o,"outputParameters",null,[a])),i}(e,n.binding)},hidden:function(e,t){return!l()}})),o.push(wO.validationAwareTextField(r,{id:e+"-variableName",label:r("Assign to Process Variable"),modelProperty:"variableName",getProperty:function(e){return p().name},setProperty:function(e,t){return aP.updateBusinessObject(e,p(),{name:t.variableName})},validate:function(e,t){var n={},i=t.variableName;return i?hw.containsSpace(i)&&(n.variableName=r("Process Variable Name must not contain spaces.")):n.variableName=r("Process Variable Name must not be empty."),n},hidden:function(e,t){return!l()||!d()}})),o}var p=WD(o.properties,(function(e){return!e.type&&"camunda:outputParameter"===e.binding.type}));KD(p,(function(e,t){var n="template-outputs-"+o.id+"-"+t;a.push(c(n,e))})),e.entries=e.entries.concat(HD(a))};var sB=GE.query,cB=function(e,t,n,i,r){var o=(i=i||{}).idPrefix||"",a=i.getError&&"function"==typeof i.getError?function(){return i.getError()}:function(){return e},s={},c=[];s.entries=c;var p=function(){var e=a(),t="No Error referenced";return e.errorRef&&(t=e.errorRef.name,e.errorRef.errorCode&&(t+=" (code = "+e.errorRef.errorCode+")")),t},u=wO.collapsible({id:o+"collapsible",title:p(),description:a().expression||"",cssClasses:["bpp-collapsible-error"],open:!1,onRemove:i.onRemove,onToggle:i.onToggle,get:function(){return{title:p(),description:a().expression||""}}}),l=i.isOpen||u.isOpen;return s.setOpen=function(e){var t=sB('[data-entry="'+u.id+'"]');u.setOpen(e,t)},c.push(u),c.push(wO.validationAwareTextField(r,{id:o+"error-expression",label:r("Throw Expression"),modelProperty:"expression",getProperty:function(t,n){return e.expression},setProperty:function(t,n,i){return aP.updateBusinessObject(t,e,n)},validate:function(e,t,n){var i={};return t.expression||(i.expression=r("Error must have an expression")),i},hidden:function(e,t){return!l()}})),c.push.apply(c,VO(0,e,t,{id:o+"error-reference",label:r("Global Error referenced"),elementName:"error",elementType:"bpmn:Error",referenceProperty:"errorRef",newElementIdPrefix:"Error_",hidden:function(e,t){return!l()}})),c.push.apply(c,$O(0,e,0,r,{id:o+"error-element-name",label:r("Name"),referenceProperty:"errorRef",modelProperty:"name",shouldValidate:!0,hidden:function(e,t){return!l()}})),c.push.apply(c,$O(0,e,0,r,{id:o+"error-element-code",label:r("Code"),referenceProperty:"errorRef",modelProperty:"errorCode",shouldValidate:!0,hidden:function(e,t){return!l()}})),c.push.apply(c,$O(0,e,0,r,{id:o+"error-element-message",label:r("Message"),referenceProperty:"errorRef",modelProperty:"errorMessage",hidden:function(e,t){return!l()}})),s},pB=KS.forEach,uB=KS.filter,lB=KS.flatten,dB=KS.findIndex,hB=PE.getBusinessObject,mB=KC.findExtensions,fB=KC.findCamundaErrorEventDefinition,vB=GE.query,yB={get:function(){},set:function(){},errorRef:{}},gB=function(e,t,n,i,r){var o=n.get(t);if(!o)return[];var a=[];function s(e,t){if(e){var n=t.dataset.entry;a.forEach((function(e){var t=e[0];if(t.id!==n){var i=vB('[data-entry="'+t.id+'"]');t.setOpen(!1,i)}}))}}var c=uB(o.properties,(function(e){return!e.type&&"camunda:errorEventDefinition"===e.binding.type}));pB(c,(function(e,n){var c="template-errors-"+o.id+"-"+n;a.push(function(e,n){var o,a=n.binding.errorRef,c=[],p=hB(t);if(!mB(p,["camunda:ErrorEventDefinition"]))return c;var u=function(){return fB(t,a)||yB},l=u(),d=function(){return o.isOpen()},h=bB(c=cB(l,i,0,{idPrefix:e+"-",onToggle:s,getError:u,isOpen:function(){return d()}},r).entries,e+"-error-reference");o=c[bB(c,e+"-collapsible")];var m=bB(c,e+"-error-expression");xB(c,m);var f=wO.textField(r,{id:e+"-error-expression",label:r("Throw Expression"),modelProperty:"expression",get:function(){return{expression:u().expression}},buttonShow:{method:function(){return!1}},hidden:function(){return!d()},disabled:function(){return!0}});return c.splice(m,0,f),xB(c,h),c}(c,e))})),e.entries=e.entries.concat(lB(a))};function bB(e,t){return dB(e,(function(e){return e.id===t}))}function xB(e,t){e.splice(t,1)}var EB=PE.getBusinessObject,wB=GE.query,_B=function(e,t,n,i){var r=!!(n=n||{}).insideConnector,o=n.idPrefix||"",a={},s=a.entries=[];if(!ZA.isInputOutputSupported(e,r))return a;var c,p,u={insideConnector:r,idPrefix:o};return s.push(function(e,t,n){var i=n.idPrefix||"",r=n.prefix,o=n.type,a=n.prop,s=n.insideConnector,c={id:i+r+"-heading",cssClasses:["bpp-input-output"],html:'<div class="bpp-field-wrapper"><button type="button" class="bpp-input-output__add add action-button" data-action="createElement"></button><input name="hidden" type="hidden"></div>'};function p(){var n=[],i=EB(e),c=i.get("extensionElements");c||(c=RE.createElement("bpmn:ExtensionElements",{values:[]},i,t),n.push(aP.updateBusinessObject(e,i,{extensionElements:c})));var p=SB(e,s);if(!p){var u=s?OB(e):c;p=function(e,t,n){return CB("camunda:InputOutput",e,t,n)}(u,t,{inputParameters:[],outputParameters:[]}),s?n.push(aP.updateBusinessObject(e,u,{inputOutput:p})):n.push(aP.addAndRemoveElementsFromList(e,c,"values","extensionElements",[p],[]))}var l=function(e,t,n,i){return CB(e,t,n,i)}(o,p,t,{name:PB(r)});return n.push(aP.addElementsTolist(e,p,a,[],[l])),n}function u(e,t){c._commands=e,wB('input[type="hidden"]',t).value=1}return c.createElement=function(e,t){var n=p();if(n)return u(n,t),!0},c.set=function(){var e=c._commands;if(e)return delete c._commands,e},c}(e,t,{idPrefix:o,insideConnector:r,type:"camunda:InputParameter",prop:"inputParameters",prefix:"Input"})),c=s,p=function(e,t,n,i){var r=n.idPrefix,o=n.insideConnector,a=SB(e,o),s=function(e,t){return ZA.getInputParameters(e,t)}(e,o);if(!s.length){var c=Q_(i,i("No variables defined."));return[{id:r+"input-parameter-placeholder",cssClasses:["bpp-input-output-placeholder"],html:c}]}var p,u=s.map((function(n,s){function c(){var t=[];if(t.push(aP.removeElementsFromList(e,a,"inputParameters",null,[n])),1===a.get("inputParameters").length&&0===(a.get("outputParameters")||[]).length)if(o){var i=OB(e);t.push(aP.updateBusinessObject(e,i,{inputOutput:void 0}))}else t.push(qA.removeEntry(EB(e),e,a));return t}return wD(n,t,{idPrefix:r+"input-parameter-"+s,onRemove:c,onToggle:l},i)}));function l(e,t){if(e){var n=t.dataset.entry;u.forEach((function(e){e.entries[0].id!==n&&e.setOpen(!1,t.parentElement)}))}}return p=u.map((function(e){return e.entries})),Array.prototype.concat.apply([],p)}(e,t,u,i),Array.prototype.push.apply(c,p),a};function PB(e){return e+="_",hw.nextId(e)}function SB(e,t){return ZA.getInputOutput(e,t)}function OB(e){return ZA.getConnector(e)}function CB(e,t,n,i){return RE.createElement(e,i,t,n)}var TB=PE.getBusinessObject,AB=GE.query,RB=function(e,t,n,i){var r=!!(n=n||{}).insideConnector,o=n.idPrefix||"",a={},s=a.entries=[];if(!ZA.isInputOutputSupported(e,r)||!ZA.areOutputParametersSupported(e,r))return a;var c,p,u={insideConnector:r,idPrefix:o};return s.push(function(e,t,n){var i=n.idPrefix||"",r=n.prefix,o=n.type,a=n.prop,s=n.insideConnector,c={id:i+r+"-heading",cssClasses:["bpp-input-output"],html:'<div class="bpp-field-wrapper"><button type="button" class="bpp-input-output__add add action-button" data-action="createElement"></button><input name="hidden" type="hidden"></div>'};function p(){var n=[],i=TB(e),c=i.get("extensionElements");c||(c=RE.createElement("bpmn:ExtensionElements",{values:[]},i,t),n.push(aP.updateBusinessObject(e,i,{extensionElements:c})));var p=jB(e,s);if(!p){var u=s?MB(e):c;p=function(e,t,n){return DB("camunda:InputOutput",e,t,n)}(u,t,{inputParameters:[],outputParameters:[]}),s?n.push(aP.updateBusinessObject(e,u,{inputOutput:p})):n.push(aP.addAndRemoveElementsFromList(e,c,"values","extensionElements",[p],[]))}var l=function(e,t,n,i){return DB(e,t,n,i)}(o,p,t,{name:kB(r)});return n.push(aP.addElementsTolist(e,p,a,[],[l])),n}function u(e,t){c._commands=e,AB('input[type="hidden"]',t).value=1}return c.createElement=function(e,t){var n=p();if(n)return u(n,t),!0},c.set=function(){var e=c._commands;if(e)return delete c._commands,e},c}(e,t,{idPrefix:o,insideConnector:r,type:"camunda:OutputParameter",prop:"outputParameters",prefix:"Output"})),c=s,p=function(e,t,n,i){var r=n.idPrefix,o=n.insideConnector,a=jB(e,o),s=function(e,t){return ZA.getOutputParameters(e,t)}(e,o);if(!s.length){var c=Q_(i,i("No variables defined."));return[{id:r+"output-parameter-placeholder",cssClasses:["bpp-input-output-placeholder"],html:c}]}var p,u=s.map((function(n,s){function c(){var t=[];if(t.push(aP.removeElementsFromList(e,a,"outputParameters",null,[n])),1===a.get("outputParameters").length&&0===(a.get("inputParameters")||[]).length)if(o){var i=MB(e);t.push(aP.updateBusinessObject(e,i,{inputOutput:void 0}))}else t.push(qA.removeEntry(TB(e),e,a));return t}return wD(n,t,{idPrefix:r+"output-parameter-"+s,onRemove:c,onToggle:l},i)}));function l(e,t){if(e){var n=t.dataset.entry;u.forEach((function(e){e.entries[0].id!==n&&e.setOpen(!1,t.parentElement)}))}}return p=u.map((function(e){return e.entries})),Array.prototype.concat.apply([],p)}(e,t,u,i),Array.prototype.push.apply(c,p),a};function kB(e){return e+="_",hw.nextId(e)}function jB(e,t){return ZA.getInputOutput(e,t)}function MB(e){return ZA.getConnector(e)}function DB(e,t,n,i){return RE.createElement(e,i,t,n)}var BB=PE.getBusinessObject,IB=GE.query,NB=function(e,t,n,i){var r,o,a={},s=a.entries=[];return s.push(function(e,t,n){var i={id:n.prefix+"-heading",cssClasses:["bpp-error"],html:'<div class="bpp-field-wrapper"><button type="button" class="bpp-error__add add action-button" data-action="createElement"></button><input name="hidden" type="hidden"></div>'};function r(){var n=[],i=BB(e),r=i.get("extensionElements");r||(r=RE.createElement("bpmn:ExtensionElements",{values:[]},i,t),n.push(aP.updateBusinessObject(e,i,{extensionElements:r})));var o=RE.createElement("camunda:ErrorEventDefinition",{},r,t);return n.push(aP.addElementsTolist(e,r,"values",[o])),n}function o(e,t){i._commands=e,IB('input[type="hidden"]',t).value=1}return i.createElement=function(e,t){var n=r();if(n)return o(n,t),!0},i.set=function(){var e=i._commands;if(e)return delete i._commands,e},i}(e,t,{type:"camunda:ErrorEventDefinition",prop:"errorEventDefinition",prefix:"Error"})),r=s,o=function(e,t,n,i){var r=n.idPrefix||"",o=BB(e),a=function(e){return qA.getExtensionElements(e,"camunda:ErrorEventDefinition")||[]}(o),s=o.get("extensionElements");if(a&&!a.length){var c=Q_(i,i("No errors defined."));return[{id:r+"error-placeholder",cssClasses:["bpp-error-placeholder"],html:c}]}var p,u=a.map((function(n,o){function a(){var t=[];return t.push(aP.removeElementsFromList(e,s,"values","extensionElements",[n])),t}return cB(n,t,0,{idPrefix:r+"error-"+o,onRemove:a,onToggle:c},i);function c(e,t){if(e){var n=t.dataset.entry;u.forEach((function(e){e.entries[0].id!==n&&e.setOpen(!1,t.parentElement)}))}}}));return p=u.map((function(e){return e.entries})),Array.prototype.concat.apply([],p)}(e,t,{},i),Array.prototype.push.apply(r,o),a};function LB(e){return KA.getServiceTaskLikeBusinessObject(e)}function FB(e){return ZA.getConnector(e)}function VB(e){return"connector"===function(e){return KA.getImplementationType(e)}(e)}var $B=PE.is,zB=PE.getBusinessObject,qB=function(e,t,n,i){var r=zB(t);($B(t,"camunda:JobPriorized")||$B(t,"bpmn:Participant")&&r.get("processRef"))&&(e.entries=e.entries.concat(function(e,t,n,i){var r=n.getBusinessObject;return[wO.textField(i,{id:"jobPriority",label:i("Job Priority"),modelProperty:"jobPriority",get:function(e,t){return{jobPriority:r(e).get("camunda:jobPriority")}},set:function(e,t){var n=r(e);return aP.updateBusinessObject(e,n,{"camunda:jobPriority":t.jobPriority||void 0})}})]}(0,0,{getBusinessObject:function(e){var t=zB(e);return $B(t,"bpmn:Participant")?t.get("processRef"):t}},i))),$B(t,"camunda:AsyncCapable")&&(e.entries=e.entries.concat(tk(0,n,{getBusinessObject:zB},i)))},UB=PE.is,GB=PE.getBusinessObject,HB=function(e,t,n,i){var r=GB(t);(UB(t,"camunda:Process")||UB(t,"bpmn:Participant")&&r.get("processRef"))&&(e.entries=e.entries.concat(function(e,t,n,i){var r=n.getBusinessObject;return[wO.textField(i,{id:"historyTimeToLive",label:i("History Time To Live"),modelProperty:"historyTimeToLive",get:function(e,t){return{historyTimeToLive:r(e).get("camunda:historyTimeToLive")||""}},set:function(e,t){var n=r(e);return aP.updateBusinessObject(e,n,{"camunda:historyTimeToLive":t.historyTimeToLive||void 0})}})]}(0,0,{getBusinessObject:function(e){var t=GB(e);return UB(t,"bpmn:Participant")?t.get("processRef"):t}},i)))},WB=PE.is,KB=PE.getBusinessObject,XB=function(e,t,n,i){var r=KB(t);(WB(t,"camunda:Process")||WB(t,"bpmn:Participant")&&r.get("processRef"))&&(e.entries=e.entries.concat(function(e,t,n,i){var r=n.getBusinessObject;return[wO.textField(i,{id:"candidateStarterGroups",label:i("Candidate Starter Groups"),modelProperty:"candidateStarterGroups",description:i("Specify more than one group as a comma separated list."),get:function(e,t){return{candidateStarterGroups:r(e).get("camunda:candidateStarterGroups")||""}},set:function(e,t){var n=r(e);return aP.updateBusinessObject(e,n,{"camunda:candidateStarterGroups":t.candidateStarterGroups||void 0})}}),wO.textField(i,{id:"candidateStarterUsers",label:i("Candidate Starter Users"),modelProperty:"candidateStarterUsers",description:i("Specify more than one user as a comma separated list."),get:function(e,t){return{candidateStarterUsers:r(e).get("camunda:candidateStarterUsers")||""}},set:function(e,t){var n=r(e);return aP.updateBusinessObject(e,n,{"camunda:candidateStarterUsers":t.candidateStarterUsers||void 0})}})]}(0,0,{getBusinessObject:function(e){var t=KB(e);return WB(t,"bpmn:Participant")?t.get("processRef"):t}},i)))},YB=PE.is,JB=PE.getBusinessObject,ZB=function(e,t,n,i){var r=JB(t);(YB(t,"camunda:Process")||YB(t,"bpmn:Participant")&&r.get("processRef"))&&(e.entries=e.entries.concat(function(e,t,n,i){var r=n.getBusinessObject;return[wO.checkbox(i,{id:"isStartableInTasklist",label:i("Startable"),modelProperty:"isStartableInTasklist",get:function(e,t){return{isStartableInTasklist:r(e).get("camunda:isStartableInTasklist")||""}},set:function(e,t){var n=r(e);return aP.updateBusinessObject(e,n,{"camunda:isStartableInTasklist":!!t.isStartableInTasklist})}})]}(0,0,{getBusinessObject:function(e){var t=JB(e);return YB(t,"bpmn:Participant")?t.get("processRef"):t}},i)))},QB=PE.is,eI=PE.getBusinessObject;var tI=function(e,t,n,i){var r=function(e){var t=KA.getServiceTaskLikeBusinessObject(e);return t||(t=eI(e)),t}(t);r&&(QB(r,"camunda:TaskPriorized")||QB(r,"bpmn:Participant")&&r.get("processRef"))&&(e.entries=e.entries.concat(function(e,t,n,i){var r=n.getBusinessObject;return[wO.textField(i,{id:"externalTaskPriority",label:i("Task Priority"),modelProperty:"taskPriority",get:function(e,t){return{taskPriority:r(e).get("camunda:taskPriority")}},set:function(e,t){var n=r(e);return aP.updateBusinessObject(e,n,{"camunda:taskPriority":t.taskPriority||void 0})}})]}(0,0,{getBusinessObject:function(e){return QB(r,"bpmn:Participant")?r.get("processRef"):r}},i)))},nI=PE.is,iI=KC.getTemplateId,rI=PE.getBusinessObject,oI=KA,aI=function(e){var t=rI(e);if(nI(e,"bpmn:Process")||nI(e,"bpmn:Participant")&&t.get("processRef"))return!0;var n=KA.getServiceTaskLikeBusinessObject(e),i="external"===KA.getImplementationType(n);return!!KA.isExternalCapable(n)&&i},sI=function(e){var t=rI(e);if(nI(e,"bpmn:Process")||nI(e,"bpmn:Participant")&&t.get("processRef"))return!0;var n=rI(e);return!(!UA.isAsyncBefore(n)&&!UA.isAsyncAfter(n))||!!nI(e,"bpmn:Event")&&!!DO.getTimerEventDefinition(e)},cI="This maps to the process definition key.";function pI(e){return nI(e,"bpmn:Participant")?{id:"participant-id",label:"Participant Id"}:nI(e,"bpmn:Process")?{description:cI}:nI(e,"bpmn:UserTask")?{description:"This maps to the task definition key."}:void 0}function uI(e){if(nI(e,"bpmn:Participant"))return{processIdDescription:cI}}function lI(e,t,n,i,r,o,a,s,c){if(!iI(e))return[];var p=fM(e,i,r,o,a,s,c),u=pI(e)||{};u.id="element-template-element-id";mC(p,0,c,u),_C(p,e,t,n,c,{id:"element-template-element-name"}),RO(p,e,c,uI(e));var l={id:"template-inputs",label:c("Input Parameters"),entries:[]};UD(l,e,r,t,c);var d={id:"template-outputs",label:c("Output Parameters"),entries:[]};aB(d,e,r,t,c);var h={id:"template-errors",label:c("Errors"),entries:[]};gB(h,e,r,t,c);var m=oD(e,r,t,c);return[p,l,d,h].concat(m)}function dI(e,t,n,i,r,o){e=e.labelTarget||e;var a={id:"general",label:o("General"),entries:[]};mC(a,0,o,pI(e)),_C(a,e,n,t,o,function(e){if(nI(e,"bpmn:Participant"))return{id:"participant-name",label:"Participant Name"}}(e)),RO(a,e,o,uI(e)),function(e,t,n){var i=cj(t);if(i&&(sj(t,"bpmn:Process")||sj(t,"bpmn:Participant")&&i.get("processRef"))){var r=wO.textField(n,{id:"versionTag",label:n("Version Tag"),modelProperty:"versionTag"});sj(t,"bpmn:Participant")&&(r.get=function(e){return{versionTag:i.get("processRef").get("camunda:versionTag")}},r.set=function(e,t){var n=i.get("processRef");return aP.updateBusinessObject(e,n,{"camunda:versionTag":t.versionTag||void 0})}),e.entries.push(r)}}(a,e,o),OC(a,e,o),function(e,t,n,i){if(WT(SM(t))||gM(SM(t))){var r=PM(t,n,i);if(1!==r.length){var o=r.map((function(e){return wM(e,["name","value"])}));e.entries.push(wO.selectBox(i,{id:"elementTemplate-chooser",label:i("Element Template"),modelProperty:"elementTemplateOption",selectOptions:o,get:function(e){return{elementTemplateOption:OM}},set:function(e,t){var i=t.elementTemplateOption,o=_M(i,r),a=o.id,s=o.version;return function(e,t,n){var i=n.get(e);if(i!==t)return{cmd:"propertiesPanel.camunda.changeTemplate",context:{element:e,oldTemplate:i,newTemplate:t}}}(e,n.get(a,s),n)}}))}}}(a,e,r,o);var s={id:"details",label:o("Details"),entries:[]};TR(s,e,n,o),function(e,t,n){AR(t,"camunda:Assignable")&&(e.entries.push(wO.textField(n,{id:"assignee",label:n("Assignee"),modelProperty:"assignee"})),e.entries.push(wO.textField(n,{id:"candidateUsers",label:n("Candidate Users"),modelProperty:"candidateUsers"})),e.entries.push(wO.textField(n,{id:"candidateGroups",label:n("Candidate Groups"),modelProperty:"candidateGroups"})),e.entries.push(wO.textField(n,{id:"dueDate",description:n("The due date as an EL expression (e.g. ${someDate} or an ISO date (e.g. 2015-06-26T09:54:00)"),label:n("Due Date"),modelProperty:"dueDate"})),e.entries.push(wO.textField(n,{id:"followUpDate",description:n("The follow up date as an EL expression (e.g. ${someDate} or an ISO date (e.g. 2015-06-26T09:54:00)"),label:n("Follow Up Date"),modelProperty:"followUpDate"})),e.entries.push(wO.textField(n,{id:"priority",label:n("Priority"),modelProperty:"priority"})))}(s,e,o),function(e,t,n,i){var r;if(gk(t,"bpmn:ScriptTask")&&(r=yk(t)),r){var o=pk("scriptFormat","script",!1,i);e.entries.push({id:"script-implementation",label:i("Script"),html:o.template,get:function(e){return o.get(e,r)},set:function(e,t,n){var i=o.set(e,t,n);return aP.updateProperties(e,i)},validate:function(e,t){return o.validate(e,t)},script:o,cssClasses:["bpp-textfield"]}),e.entries.push(wO.textField(i,{id:"scriptResultVariable",label:i("Result Variable"),modelProperty:"scriptResultVariable",get:function(e,t){return{scriptResultVariable:r.get("camunda:resultVariable")}},set:function(e,t,n){return aP.updateProperties(e,{"camunda:resultVariable":t.scriptResultVariable.length?t.scriptResultVariable:void 0})}}))}}(s,e,0,o),cC(s,e,o),function(e,t,n,i){FR(t,"camunda:CallActivity")&&(e.entries.push(wO.selectBox(i,{id:"callActivity",label:i("CallActivity Type"),selectOptions:[{name:"BPMN",value:"bpmn"},{name:"CMMN",value:"cmmn"}],emptyParameter:!0,modelProperty:"callActivityType",get:function(e,t){return{callActivityType:VR(e)}},set:function(e,t,n){var i=t.callActivityType,r=EP({},$R);return"bpmn"===i?r.calledElement="":"cmmn"===i&&(r["camunda:caseRef"]=""),aP.updateProperties(e,r)}})),e.entries.push(xR(t,n,{getCallableType:VR},i)),e.entries=i_(e.entries))}(s,e,n,o),oC(s,e,n,i,o),xk(s,e,0,o),fk(s,e,n,o),function(e,t,n){Zk(t)&&Jk(t,"camunda:Initiator")&&!Jk(t.parent,"bpmn:SubProcess")&&e.entries.push(wO.textField(n,{id:"initiator",label:n("Initiator"),modelProperty:"initiator"}))}(s,e,o);var c={id:"multiInstance",label:o("Multi Instance"),entries:[]};ok(c,e,n,o);var p={id:"async",label:o("Asynchronous Continuations"),entries:[]};!function(e,t,n,i){NR(t,"camunda:AsyncCapable")&&(e.entries=e.entries.concat(BR(0,0,{getBusinessObject:IR},i)))}(p,e,0,o);var u={id:"jobConfiguration",label:o("Job Configuration"),entries:[],enabled:sI};qB(u,e,n,o);var l={id:"externalTaskConfiguration",label:o("External Task Configuration"),entries:[],enabled:aI};tI(l,e,0,o);var d={id:"candidateStarterConfiguration",label:o("Candidate Starter Configuration"),entries:[]};XB(d,e,0,o);var h={id:"historyConfiguration",label:o("History Configuration"),entries:[]};HB(h,e,0,o);var m={id:"tasklist",label:o("Tasklist Configuration"),entries:[]};ZB(m,e,0,o);var f={id:"documentation",label:o("Documentation"),entries:[]};dC(f,e,n,o);var v=[];return v.push(a),v.push(s),v.push(l),v.push(c),v.push(p),v.push(u),v.push(d),v.push(h),v.push(m),v.push(f),v}function hI(e,t,n,i){var r={id:"variables",label:i("Variables"),entries:[]};return function(e,t,n,i){var r=[{name:i("Source"),value:"source"},{name:i("Source Expression"),value:"sourceExpression"},{name:i("All"),value:"variables"}],o=DO.getSignalEventDefinition(t);if((Qk(t,"camunda:CallActivity")||o)&&(!o||ej(t,["bpmn:IntermediateThrowEvent","bpmn:EndEvent"]))){var a=function(e,t){return!!s(e,t)},s=function(e,t){var n=t.parentNode,i=l.getSelected(e,n),r=nj(e,rj)[i.idx];return!r&&d&&(i=d.getSelected(e,n),r=nj(e,oj)[i.idx]),r},c=function(e){return function(t,n,i,r,o,a){var s=nj(t,e)[a],c=(s.target||"<undefined>")+" := ",p=ij(s);"variables"===p?c="all":c+="source"===p?s.source||"<empty>":"sourceExpression"===p&&s.sourceExpression||"<empty>",i.text=c}},p=function(e){return function(t,i,r){var o=RE.createElement(e,{source:""},i,n);return aP.addElementsTolist(t,i,"values",[o])}},u=function(e){return function(t,n,i,r){var a=nj(t,e)[r];if(a)return qA.removeEntry(o||tj(t),t,a)}},l=Rk(t,n,{id:"variableMapping-in",label:i("In Mapping"),modelProperty:"source",prefix:"In",idGeneration:!1,resizable:!0,businessObject:o||tj(t),createExtensionElement:p(rj),removeExtensionElement:u(rj),getExtensionElements:function(e){return nj(e,rj)},onSelectionChange:function(e,t,n,i){d&&d.deselect(e,t.parentNode)},setOptionLabelValue:c(rj)});if(e.entries.push(l),!o){var d=Rk(t,n,{id:"variableMapping-out",label:i("Out Mapping"),modelProperty:"source",prefix:"Out",idGeneration:!1,resizable:!0,createExtensionElement:p(oj),removeExtensionElement:u(oj),getExtensionElements:function(e){return nj(e,oj)},onSelectionChange:function(e,t,n,i){l.deselect(e,t.parentNode)},setOptionLabelValue:c(oj)});e.entries.push(d)}e.entries.push(wO.label({id:"variableMapping-typeLabel",get:function(e,t){var n=s(e,t),r="";return Qk(n,rj)?r=i("In Mapping"):Qk(n,oj)&&(r=i("Out Mapping")),{label:r}},showLabel:function(e,t){return a(e,t)}})),e.entries.push(wO.selectBox(i,{id:"variableMapping-inOutType",label:i("Type"),selectOptions:r,modelProperty:"inOutType",get:function(e,t){return{inOutType:ij(s(e,t)||{})}},set:function(e,t,n){var i=t.inOutType,r={source:void 0,sourceExpression:void 0,variables:void 0};"source"===i?r.source="":"sourceExpression"===i?r.sourceExpression="":"variables"===i&&(r.variables="all",r.target=void 0);var o=s(e,n);return aP.updateBusinessObject(e,o,r)},hidden:function(e,t){return!a(e,t)}})),e.entries.push(wO.textField(i,{id:"variableMapping-source",dataValueLabel:"sourceLabel",modelProperty:"source",get:function(e,t){var n=s(e,t)||{},r="",o=ij(n);return"source"===o?r=i("Source"):"sourceExpression"===o&&(r=i("Source Expression")),{source:n[o],sourceLabel:r}},set:function(e,t,n){t.source=t.source||void 0;var i=s(e,n),r={};return r[ij(i)]=t.source||"",aP.updateBusinessObject(e,i,r)},validate:function(e,t,n){var r=s(e,n),o={};if(r){t.source||(o.source=o.source=t.sourceLabel?i("Mapping must have a {value}",{value:t.sourceLabel.toLowerCase()}):i("Mapping must have a value"));var a=ij(r);aj.test(t.source)&&"sourceExpression"!==a&&(o.source=i("{label} must not contain whitespace",{label:t.sourceLabel}))}return o},hidden:function(e,t){var n=s(e,t);return!n||n&&n.variables}})),e.entries.push(wO.textField(i,{id:"variableMapping-target",label:i("Target"),modelProperty:"target",get:function(e,t){return{target:(s(e,t)||{}).target}},set:function(e,t,n){t.target=t.target||void 0;var i=s(e,n);return aP.updateBusinessObject(e,i,t)},validate:function(e,t,n){var r=s(e,n),o={};if(r){var a=ij(r);t.target||"variables"===a||(o.target=i("Mapping must have a target")),t.target&&aj.test(t.target)&&"variables"!==a&&(o.target=i("Target must not contain whitespace"))}return o},hidden:function(e,t){var n=s(e,t);return!n||n&&n.variables}})),e.entries.push(wO.checkbox(i,{id:"variableMapping-local",label:i("Local"),modelProperty:"local",get:function(e,t){return{local:(s(e,t)||{}).local}},set:function(e,t,n){t.local=t.local||!1;var i=s(e,n);return aP.updateBusinessObject(e,i,t)},hidden:function(e,t){return!a(e,t)}}))}}(r,e,t,i),[r]}function mI(e,t){var n={id:"process-variables",label:t("Variables"),entries:[]};return Lj(n,e,t),[n]}function fI(e,t,n,i){var r={id:"forms",label:i("Forms"),entries:[]};return Kk(r,e,t,i),[r]}function vI(e,t,n,i){var r={id:"listeners",label:i("Listeners"),entries:[]},o=Uj(r,e,t,i),a={id:"listener-details",entries:[],enabled:function(e,t){return o.getSelectedListener(e,t)},label:function(e,t){return function(e,t){return nI(e,"camunda:ExecutionListener")?t("Execution Listener"):nI(e,"camunda:TaskListener")?t("Task Listener"):""}(o.getSelectedListener(e,t),i)}};Wj(a,e,t,o,i);var s={id:"listener-fields",label:i("Field Injection"),entries:[],enabled:function(e,t){return o.getSelectedListener(e,t)}};return function(e,t,n,i,r){i=EP({idPrefix:"listener-",insideListener:!0},i);var o=Zj(t,n,r,i);o&&o.length>0&&(e.entries=e.entries.concat(o))}(s,e,t,o,i),[r,a,s]}function yI(e,t,n,i){var r={id:"input-parameters",label:i("Input Parameters"),entries:[]};!function(e,t,n,i,r){if(!i.get(t)){var o=_B(t,n,{},r);e.entries=e.entries.concat(o.entries)}}(r,e,t,n,i);var o={id:"output-parameters",label:i("Output Parameters"),entries:[]};!function(e,t,n,i,r){if(!i.get(t)){var o=RB(t,n,{},r);e.entries=e.entries.concat(o.entries)}}(o,e,t,n,i);var a={id:"errors",label:i("Errors"),entries:[],enabled:function(e,t){var n=rI(e),i="external"===KA.getImplementationType(n);return nI(e,"bpmn:ServiceTask")&&i}};return function(e,t,n,i,r){if(!i.get(t)){var o=NB(t,n,0,r);e.entries=e.entries.concat(o.entries)}}(a,e,t,n,i),[r,o,a]}function gI(e,t,n,i){var r={id:"connector-details",label:i("Details"),entries:[]};!function(e,t,n,i){e.entries.push(wO.textField(i,{id:"connectorId",label:i("Connector Id"),modelProperty:"connectorId",get:function(e,t){var n=LB(e),i=n&&FB(n);return{connectorId:i&&i.get("connectorId")}},set:function(e,t,n){var i=FB(LB(e));return aP.updateBusinessObject(e,i,{connectorId:t.connectorId||void 0})},validate:function(e,t,n){return VB(e)&&!t.connectorId?{connectorId:i("Must provide a value")}:{}},hidden:function(e,t){return!VB(e)}}))}(r,0,0,i);var o={id:"connector-input-parameters",label:i("Input Parameters"),entries:[]};!function(e,t,n,i){var r=_B(t,n,{idPrefix:"connector-",insideConnector:!0},i);e.entries=e.entries.concat(r.entries)}(o,e,t,i);var a={id:"connector-output-parameters",label:i("Output Parameters"),entries:[]};return function(e,t,n,i){var r=RB(t,n,{idPrefix:"connector-",insideConnector:!0},i);e.entries=e.entries.concat(r.entries)}(a,e,t,i),[r,o,a]}function bI(e,t,n,i){var r={id:"field-injections-properties",label:i("Field Injections"),entries:[]};return function(e,t,n,i){var r=KA.getServiceTaskLikeBusinessObject(t);if(r){var o=Zj(t,n,i,{businessObject:r});o&&o.length>0&&(e.entries=e.entries.concat(o))}}(r,e,t,i),[r]}function xI(e,t,n,i){var r={id:"extensionElements-properties",label:i("Properties"),entries:[]};return function(e,t,n,i){var r=Ik(t,n,{id:"properties",modelProperties:["name","value"],labels:[i("Name"),i("Value")],getParent:function(e,t,n){return n.extensionElements},createParent:function(e,t){var i=RE.createElement("bpmn:ExtensionElements",{values:[]},t,n);return{cmd:aP.updateBusinessObject(e,t,{extensionElements:i}),parent:i}}},i);r&&e.entries.push(r)}(r,e,t,i),[r]}function EI(e,t,n,i,r,o,a,s,c,p){K_.call(this,o),this.getTabs=function(o){var u={id:"general",label:p("General"),groups:dI(o,t,e,i,r,p)},l={id:"element-template",label:p("Template"),groups:lI(o,e,t,n,r,a,s,c,p)},d={id:"variables",label:p("Variables"),groups:hI(o,e,0,p)},h={id:"process-variables",label:p("Variables"),groups:mI(o,p)},m={id:"forms",label:p("Forms"),groups:fI(o,e,0,p)},f={id:"listeners",label:p("Listeners"),groups:vI(o,e,0,p),enabled:function(e){return!DO.getLinkEventDefinition(e)||!nI(e,"bpmn:IntermediateThrowEvent")&&DO.getLinkEventDefinition(e)}},v={id:"input-output",label:p("Input/Output"),groups:yI(o,e,r,p)};return[u,l,d,h,{id:"connector",label:p("Connector"),groups:gI(o,e,0,p),enabled:function(e){var t=oI.getServiceTaskLikeBusinessObject(e);return t&&"connector"===oI.getImplementationType(t)}},m,f,v,{id:"field-injections",label:p("Field Injections"),groups:bI(o,e,0,p)},{id:"extensionElements",label:p("Extensions"),groups:xI(o,e,0,p)}]}}EI.$inject=["bpmnFactory","canvas","commandStack","elementRegistry","elementTemplates","eventBus","modeling","replace","selection","translate"],i(EI,K_);var wI=EI,_I={__depends__:[VA,G_.default],__init__:["propertiesProvider"],propertiesProvider:["type",wI]},PI={name:"Camunda",uri:"http://camunda.org/schema/1.0/bpmn",prefix:"camunda",xml:{tagAlias:"lowerCase"},associations:[],types:[{name:"Definitions",isAbstract:!0,extends:["bpmn:Definitions"],properties:[{name:"diagramRelationId",isAttr:!0,type:"String"}]},{name:"InOutBinding",superClass:["Element"],isAbstract:!0,properties:[{name:"source",isAttr:!0,type:"String"},{name:"sourceExpression",isAttr:!0,type:"String"},{name:"target",isAttr:!0,type:"String"},{name:"businessKey",isAttr:!0,type:"String"},{name:"local",isAttr:!0,type:"Boolean",default:!1},{name:"variables",isAttr:!0,type:"String"}]},{name:"In",superClass:["InOutBinding"],meta:{allowedIn:["bpmn:CallActivity","bpmn:SignalEventDefinition"]}},{name:"Out",superClass:["InOutBinding"],meta:{allowedIn:["bpmn:CallActivity"]}},{name:"AsyncCapable",isAbstract:!0,extends:["bpmn:Activity","bpmn:Gateway","bpmn:Event"],properties:[{name:"async",isAttr:!0,type:"Boolean",default:!1},{name:"asyncBefore",isAttr:!0,type:"Boolean",default:!1},{name:"asyncAfter",isAttr:!0,type:"Boolean",default:!1},{name:"exclusive",isAttr:!0,type:"Boolean",default:!0}]},{name:"JobPriorized",isAbstract:!0,extends:["bpmn:Process","camunda:AsyncCapable"],properties:[{name:"jobPriority",isAttr:!0,type:"String"}]},{name:"SignalEventDefinitionExtension",isAbstract:!0,extends:["bpmn:SignalEventDefinition"],properties:[{name:"async",isAttr:!0,type:"Boolean",default:!1}]},{name:"ErrorEventDefinitionExtension",isAbstract:!0,extends:["bpmn:ErrorEventDefinition"],properties:[{name:"errorCodeVariable",isAttr:!0,type:"String"},{name:"errorMessageVariable",isAttr:!0,type:"String"}]},{name:"ErrorEventDefinition",superClass:["bpmn:ErrorEventDefinition","Element"],properties:[{name:"expression",isAttr:!0,type:"String"}],meta:{allowedIn:["bpmn:ServiceTask"]}},{name:"Error",isAbstract:!0,extends:["bpmn:Error"],properties:[{name:"camunda:errorMessage",isAttr:!0,type:"String"}]},{name:"PotentialStarter",superClass:["Element"],properties:[{name:"resourceAssignmentExpression",type:"bpmn:ResourceAssignmentExpression"}]},{name:"FormSupported",isAbstract:!0,extends:["bpmn:StartEvent","bpmn:UserTask"],properties:[{name:"formHandlerClass",isAttr:!0,type:"String"},{name:"formKey",isAttr:!0,type:"String"},{name:"formRef",isAttr:!0,type:"String"},{name:"formRefBinding",isAttr:!0,type:"String"},{name:"formRefVersion",isAttr:!0,type:"String"}]},{name:"TemplateSupported",isAbstract:!0,extends:["bpmn:Collaboration","bpmn:Process","bpmn:FlowElement"],properties:[{name:"modelerTemplate",isAttr:!0,type:"String"},{name:"modelerTemplateVersion",isAttr:!0,type:"Integer"}]},{name:"Initiator",isAbstract:!0,extends:["bpmn:StartEvent"],properties:[{name:"initiator",isAttr:!0,type:"String"}]},{name:"ScriptTask",isAbstract:!0,extends:["bpmn:ScriptTask"],properties:[{name:"resultVariable",isAttr:!0,type:"String"},{name:"resource",isAttr:!0,type:"String"}]},{name:"Process",isAbstract:!0,extends:["bpmn:Process"],properties:[{name:"candidateStarterGroups",isAttr:!0,type:"String"},{name:"candidateStarterUsers",isAttr:!0,type:"String"},{name:"versionTag",isAttr:!0,type:"String"},{name:"historyTimeToLive",isAttr:!0,type:"String"},{name:"isStartableInTasklist",isAttr:!0,type:"Boolean",default:!0}]},{name:"EscalationEventDefinitionExtension",isAbstract:!0,extends:["bpmn:EscalationEventDefinition"],properties:[{name:"escalationCodeVariable",isAttr:!0,type:"String"}]},{name:"FormalExpression",isAbstract:!0,extends:["bpmn:FormalExpression"],properties:[{name:"resource",isAttr:!0,type:"String"}]},{name:"Assignable",extends:["bpmn:UserTask"],properties:[{name:"assignee",isAttr:!0,type:"String"},{name:"candidateUsers",isAttr:!0,type:"String"},{name:"candidateGroups",isAttr:!0,type:"String"},{name:"dueDate",isAttr:!0,type:"String"},{name:"followUpDate",isAttr:!0,type:"String"},{name:"priority",isAttr:!0,type:"String"}]},{name:"CallActivity",extends:["bpmn:CallActivity"],properties:[{name:"calledElementBinding",isAttr:!0,type:"String",default:"latest"},{name:"calledElementVersion",isAttr:!0,type:"String"},{name:"calledElementVersionTag",isAttr:!0,type:"String"},{name:"calledElementTenantId",isAttr:!0,type:"String"},{name:"caseRef",isAttr:!0,type:"String"},{name:"caseBinding",isAttr:!0,type:"String",default:"latest"},{name:"caseVersion",isAttr:!0,type:"String"},{name:"caseTenantId",isAttr:!0,type:"String"},{name:"variableMappingClass",isAttr:!0,type:"String"},{name:"variableMappingDelegateExpression",isAttr:!0,type:"String"}]},{name:"ServiceTaskLike",extends:["bpmn:ServiceTask","bpmn:BusinessRuleTask","bpmn:SendTask","bpmn:MessageEventDefinition"],properties:[{name:"expression",isAttr:!0,type:"String"},{name:"class",isAttr:!0,type:"String"},{name:"delegateExpression",isAttr:!0,type:"String"},{name:"resultVariable",isAttr:!0,type:"String"}]},{name:"DmnCapable",extends:["bpmn:BusinessRuleTask"],properties:[{name:"decisionRef",isAttr:!0,type:"String"},{name:"decisionRefBinding",isAttr:!0,type:"String",default:"latest"},{name:"decisionRefVersion",isAttr:!0,type:"String"},{name:"mapDecisionResult",isAttr:!0,type:"String",default:"resultList"},{name:"decisionRefTenantId",isAttr:!0,type:"String"}]},{name:"ExternalCapable",extends:["camunda:ServiceTaskLike"],properties:[{name:"type",isAttr:!0,type:"String"},{name:"topic",isAttr:!0,type:"String"}]},{name:"TaskPriorized",extends:["bpmn:Process","camunda:ExternalCapable"],properties:[{name:"taskPriority",isAttr:!0,type:"String"}]},{name:"Properties",superClass:["Element"],meta:{allowedIn:["*"]},properties:[{name:"values",type:"Property",isMany:!0}]},{name:"Property",superClass:["Element"],properties:[{name:"id",type:"String",isAttr:!0},{name:"name",type:"String",isAttr:!0},{name:"value",type:"String",isAttr:!0}]},{name:"Connector",superClass:["Element"],meta:{allowedIn:["camunda:ServiceTaskLike"]},properties:[{name:"inputOutput",type:"InputOutput"},{name:"connectorId",type:"String"}]},{name:"InputOutput",superClass:["Element"],meta:{allowedIn:["bpmn:FlowNode","camunda:Connector"]},properties:[{name:"inputOutput",type:"InputOutput"},{name:"connectorId",type:"String"},{name:"inputParameters",isMany:!0,type:"InputParameter"},{name:"outputParameters",isMany:!0,type:"OutputParameter"}]},{name:"InputOutputParameter",properties:[{name:"name",isAttr:!0,type:"String"},{name:"value",isBody:!0,type:"String"},{name:"definition",type:"InputOutputParameterDefinition"}]},{name:"InputOutputParameterDefinition",isAbstract:!0},{name:"List",superClass:["InputOutputParameterDefinition"],properties:[{name:"items",isMany:!0,type:"InputOutputParameterDefinition"}]},{name:"Map",superClass:["InputOutputParameterDefinition"],properties:[{name:"entries",isMany:!0,type:"Entry"}]},{name:"Entry",properties:[{name:"key",isAttr:!0,type:"String"},{name:"value",isBody:!0,type:"String"},{name:"definition",type:"InputOutputParameterDefinition"}]},{name:"Value",superClass:["InputOutputParameterDefinition"],properties:[{name:"id",isAttr:!0,type:"String"},{name:"name",isAttr:!0,type:"String"},{name:"value",isBody:!0,type:"String"}]},{name:"Script",superClass:["InputOutputParameterDefinition"],properties:[{name:"scriptFormat",isAttr:!0,type:"String"},{name:"resource",isAttr:!0,type:"String"},{name:"value",isBody:!0,type:"String"}]},{name:"Field",superClass:["Element"],meta:{allowedIn:["camunda:ServiceTaskLike","camunda:ExecutionListener","camunda:TaskListener"]},properties:[{name:"name",isAttr:!0,type:"String"},{name:"expression",type:"String"},{name:"stringValue",isAttr:!0,type:"String"},{name:"string",type:"String"}]},{name:"InputParameter",superClass:["InputOutputParameter"]},{name:"OutputParameter",superClass:["InputOutputParameter"]},{name:"Collectable",isAbstract:!0,extends:["bpmn:MultiInstanceLoopCharacteristics"],superClass:["camunda:AsyncCapable"],properties:[{name:"collection",isAttr:!0,type:"String"},{name:"elementVariable",isAttr:!0,type:"String"}]},{name:"FailedJobRetryTimeCycle",superClass:["Element"],meta:{allowedIn:["camunda:AsyncCapable","bpmn:MultiInstanceLoopCharacteristics"]},properties:[{name:"body",isBody:!0,type:"String"}]},{name:"ExecutionListener",superClass:["Element"],meta:{allowedIn:["bpmn:Task","bpmn:ServiceTask","bpmn:UserTask","bpmn:BusinessRuleTask","bpmn:ScriptTask","bpmn:ReceiveTask","bpmn:ManualTask","bpmn:ExclusiveGateway","bpmn:SequenceFlow","bpmn:ParallelGateway","bpmn:InclusiveGateway","bpmn:EventBasedGateway","bpmn:StartEvent","bpmn:IntermediateCatchEvent","bpmn:IntermediateThrowEvent","bpmn:EndEvent","bpmn:BoundaryEvent","bpmn:CallActivity","bpmn:SubProcess","bpmn:Process"]},properties:[{name:"expression",isAttr:!0,type:"String"},{name:"class",isAttr:!0,type:"String"},{name:"delegateExpression",isAttr:!0,type:"String"},{name:"event",isAttr:!0,type:"String"},{name:"script",type:"Script"},{name:"fields",type:"Field",isMany:!0}]},{name:"TaskListener",superClass:["Element"],meta:{allowedIn:["bpmn:UserTask"]},properties:[{name:"expression",isAttr:!0,type:"String"},{name:"class",isAttr:!0,type:"String"},{name:"delegateExpression",isAttr:!0,type:"String"},{name:"event",isAttr:!0,type:"String"},{name:"script",type:"Script"},{name:"fields",type:"Field",isMany:!0},{name:"id",type:"String",isAttr:!0},{name:"eventDefinitions",type:"bpmn:TimerEventDefinition",isMany:!0}]},{name:"FormProperty",superClass:["Element"],meta:{allowedIn:["bpmn:StartEvent","bpmn:UserTask"]},properties:[{name:"id",type:"String",isAttr:!0},{name:"name",type:"String",isAttr:!0},{name:"type",type:"String",isAttr:!0},{name:"required",type:"String",isAttr:!0},{name:"readable",type:"String",isAttr:!0},{name:"writable",type:"String",isAttr:!0},{name:"variable",type:"String",isAttr:!0},{name:"expression",type:"String",isAttr:!0},{name:"datePattern",type:"String",isAttr:!0},{name:"default",type:"String",isAttr:!0},{name:"values",type:"Value",isMany:!0}]},{name:"FormData",superClass:["Element"],meta:{allowedIn:["bpmn:StartEvent","bpmn:UserTask"]},properties:[{name:"fields",type:"FormField",isMany:!0},{name:"businessKey",type:"String",isAttr:!0}]},{name:"FormField",superClass:["Element"],properties:[{name:"id",type:"String",isAttr:!0},{name:"label",type:"String",isAttr:!0},{name:"type",type:"String",isAttr:!0},{name:"datePattern",type:"String",isAttr:!0},{name:"defaultValue",type:"String",isAttr:!0},{name:"properties",type:"Properties"},{name:"validation",type:"Validation"},{name:"values",type:"Value",isMany:!0}]},{name:"Validation",superClass:["Element"],properties:[{name:"constraints",type:"Constraint",isMany:!0}]},{name:"Constraint",superClass:["Element"],properties:[{name:"name",type:"String",isAttr:!0},{name:"config",type:"String",isAttr:!0}]},{name:"ConditionalEventDefinitionExtension",isAbstract:!0,extends:["bpmn:ConditionalEventDefinition"],properties:[{name:"variableName",isAttr:!0,type:"String"},{name:"variableEvents",isAttr:!0,type:"String"}]}],emumerations:[]},SI=KS.isFunction,OI=KS.isObject,CI=KS.some;function TI(e){var t=this;e.on("moddleCopy.canCopyProperty",(function(e){var n=e.property,i=e.parent;return t.canCopyProperty(n,i)}))}TI.$inject=["eventBus"],TI.prototype.canCopyProperty=function(e,t){return!(OI(e)&&!function(e,t){var n=e.$type&&e.$model.getTypeDescriptor(e.$type),i=n&&n.meta&&n.meta.allowedIn;if(!i||function(e){return-1!==e.indexOf("*")}(i))return!0;return CI(i,(function(e){return jI(t,e)}))}(e,t))&&(!(RI(e,"camunda:InputOutput")&&!this.canHostInputOutput(t))&&(!(kI(e,["camunda:Connector","camunda:Field"])&&!this.canHostConnector(t))&&(!(RI(e,"camunda:In")&&!this.canHostIn(t))&&void 0)))},TI.prototype.canHostInputOutput=function(e){if(jI(e,"camunda:Connector"))return!0;var t=jI(e,"bpmn:FlowNode");return!!t&&(!kI(t,["bpmn:StartEvent","bpmn:Gateway","bpmn:BoundaryEvent"])&&(!RI(t,"bpmn:SubProcess")||!t.get("triggeredByEvent")))},TI.prototype.canHostConnector=function(e){return!RI(jI(e,"camunda:ServiceTaskLike"),"bpmn:MessageEventDefinition")||(jI(e,"bpmn:IntermediateThrowEvent")||jI(e,"bpmn:EndEvent"))},TI.prototype.canHostIn=function(e){return!!jI(e,"bpmn:CallActivity")||(!jI(e,"bpmn:SignalEventDefinition")||(jI(e,"bpmn:IntermediateThrowEvent")||jI(e,"bpmn:EndEvent")))};var AI=TI;function RI(e,t){return e&&SI(e.$instanceOf)&&e.$instanceOf(t)}function kI(e,t){return CI(t,(function(t){return RI(e,t)}))}function jI(e,t){return t?RI(e,t)?e:e.$parent?jI(e.$parent,t):void 0:e.$parent}var MI=t(ss),DI=KS.find,BI=KS.matchPattern,II=MI.default,NI=fC.add,LI=fC.remove,FI=PE.getBusinessObject,VI=PE.is;function $I(e,t,n,i,r){function o(t){var n=e.getDefinitions().get("rootElements");return!!DI(n,BI({id:t.id}))}n.invoke(II,this),this.executed("shape.create",(function(t){var n=t.shape,i=FI(n);if(GI(i)){var r=HI(i,qI(n)),a=e.getDefinitions().get("rootElements");t.addedRootElements=[],r.forEach((function(e){var n=e.referencedElement;n&&!o(n)&&(NI(a,n),t.addedRootElements.push(n))}))}}),!0),this.reverted("shape.create",(function(t){var n=t.addedRootElements;if(n){var i=e.getDefinitions().get("rootElements");n.forEach((function(e){LI(i,e)}))}}),!0),t.on("copyPaste.copyElement",(function(e){var t=e.descriptor,n=e.element,i=FI(n);if(GI(i)){var r=HI(i,qI(n));r&&(t.referencedRootElements=r)}})),t.on("copyPaste.pasteElement",500,(function(e){var t=e.descriptor,n=t.businessObject;if(GI(n)){var a=t.referencedRootElements;a&&a.length&&a.forEach((function(e){var t=e.referencedElement,a=e.idx;t&&(o(t)||(t=i.copyElement(t,r.create(t.$type))),function(e,t,n){var i=e.get("extensionElements").values[n];i.set(UI(i),t)}(n,t,a))})),delete t.referencedRootElements}}))}$I.$inject=["bpmnjs","eventBus","injector","moddleCopy","bpmnFactory"],i($I,II);var zI=$I;function qI(e){if(VI(e,"bpmn:ServiceTask"))return"camunda:ErrorEventDefinition"}function UI(e){if(VI(e,"camunda:ErrorEventDefinition"))return"errorRef"}function GI(e){return VI(e,"bpmn:ServiceTask")&&"external"===e.type}function HI(e,t){var n,i=e.get("extensionElements"),r=[];return i&&(r=i.values.filter((function(e){return VI(e,t)}))),r.reduce((function(t,i){return(n=i[UI(i)])&&t.push({idx:WI(e,i),referencedElement:n}),t}),[])}function WI(e,t){var n=e.get("extensionElements");return n?n.values.indexOf(t):-1}var KI=MI.default,XI=PE.is,YI=PE.getBusinessObject;function JI(e,t){t.invoke(KI,this),this.postExecuted(["shape.create","shape.move"],(function(t){var n=t.shape,i=t.newParent||t.parent,r=YI(n);XI(n,"bpmn:StartEvent")&&void 0!==r.get("camunda:initiator")&&XI(i,"bpmn:SubProcess")&&e.updateProperties(n,{"camunda:initiator":void 0})}),!0)}JI.$inject=["modeling","injector"],i(JI,KI);var ZI=JI,QI=MI.default,eN=PE.is,tN=PE.getBusinessObject;function nN(e,t,n,i){t.invoke(QI,this),this.postExecuted(["shape.move","shape.create"],(function(t){var r,o,a=t.newParent||t.parent,s=tN(a),c=t.shape,p=tN(c),u=!1;eN(c,"bpmn:StartEvent")&&(eN(a,"bpmn:SubProcess")&&s.get("triggeredByEvent")||(r=p.get("eventDefinitions"),(o=r.slice()).forEach((function(e,t){if(eN(e,"bpmn:ConditionalEventDefinition")&&e.get("camunda:variableEvents")){u=!0;var r=n.create("bpmn:ConditionalEventDefinition");i.copyElement(e,r),r.$parent=e.$parent,r.variableEvents=void 0,o[t]=r}})),u&&e.updateProperties(c,{eventDefinitions:o})))}),!0)}nN.$inject=["modeling","injector","bpmnFactory","moddleCopy"],i(nN,QI);var iN={__init__:["camundaCopyPasteBehavior","camundaCopyPasteRootElementBehavior","camundaRemoveInitiatorBehaviour","camundaRemoveVariableEventBehaviour"],camundaCopyPasteBehavior:["type",AI],camundaCopyPasteRootElementBehavior:["type",zI],camundaRemoveInitiatorBehaviour:["type",ZI],camundaRemoveVariableEventBehaviour:["type",nN]};function rN(e={}){e={...e,moddleExtensions:{camunda:PI,...e.moddleExtensions}},kC.call(this,e)}return i(rN,kC),rN.prototype._camundaPlatformModules=[iN,FC,_I],rN.prototype._modules=[].concat(kC.prototype._modules,rN.prototype._camundaPlatformModules),rN}));
|