| /plugin/bpmnioeditor/vendor/bpmnio-js/ |
| D | bpmn-modeler.production.min.js | 34 …_init__:["resize","resizePreview","resizeHandles"],resize:["type",Nu],resizePreview:["type",zu],re… property
|
| D | bpmn-modeler.development.js | 39083 resizePreview: [ 'type', ResizePreview ], property
|
| /plugin/bpmnio/vendor/dmn-js/dist/ |
| H A D | dmn-modeler.production.min.js | 265 `,mk={width:135,height:46},gk={width:100,height:63};function Lx(n,e,t){return Q("path",{d:n,strokeWidth:2,transform:`translate(${e.x}, ${e.y})`,...t})}var Dm=5;function Ja(n,e){this._styles=e,n.registerProvider(this)}Ja.$inject=["outline","styles"];Ja.prototype.getOutline=function(n){let e=this._styles.cls("djs-outline",["no-fill"]);var t;return O(n,"dmn:InputData")?(t=Q("rect"),j(t,T({x:-Dm,y:-Dm,rx:27,width:n.width+Dm*2,height:n.height+Dm*2},e))):O(n,"dmn:BusinessKnowledgeModel")&&yk(n,"dmn:BusinessKnowledgeModel")?t=Lx(dk,{x:-6,y:-6},e):O(n,"dmn:KnowledgeSource")&&yk(n,"dmn:KnowledgeSource")&&(t=Lx(pk,{x:-6,y:-1.5},e)),t};Ja.prototype.updateOutline=function(n){return!!Ge(n,["dmn:InputData","dmn:BusinessKnowledgeModel","dmn:KnowledgeSource"])};function yk(n,e){var t;return e==="dmn:BusinessKnowledgeModel"?t=mk:e==="dmn:KnowledgeSource"&&(t=gk),n.width===t.width&&n.height===t.height}var vk={__depends__:[Tm],__init__:["outlineProvider"],outlineProvider:["type",Ja]};var bk=".djs-palette-toggle",_k=".entry",XF=bk+", "+_k,Bx="djs-palette-",YF="shown",Nx="open",xk="two-column",ZF=1e3;function nt(n,e){this._eventBus=n,this._canvas=e;var t=this;n.on("tool-manager.update",function(i){var r=i.tool;t.updateToolHighlight(r)}),n.on("i18n.changed",function(){t._update()}),n.on("diagram.init",function(){t._diagramInitialized=!0,t._rebuild()})}nt.$inject=["eventBus","canvas"];nt.prototype.registerProvider=function(n,e){e||(e=n,n=ZF),this._eventBus.on("palette.getProviders",n,function(t){t.providers.push(e)}),this._rebuild()};nt.prototype.getEntries=function(){var n=this._getProviders();return n.reduce(e3,{})};nt.prototype._rebuild=function(){if(this._diagramInitialized){var n=this._getProviders();n.length&&(this._container||this._init(),this._update())}};nt.prototype._init=function(){var n=this,e=this._eventBus,t=this._getParentContainer(),i=this._container=te(nt.HTML_MARKUP);t.appendChild(i),ee(t).add(Bx+YF),_t.bind(i,XF,"click",function(r){var o=r.delegateTarget;if(hr(o,bk))return n.toggle();n.trigger("click",r)}),q.bind(i,"mousedown",function(r){r.stopPropagation()}),_t.bind(i,_k,"dragstart",function(r){n.trigger("dragstart",r)}),e.on("canvas.resized",this._layoutChanged,this),e.fire("palette.create",{container:i})};nt.prototype._getProviders=function(n){var e=this._eventBus.createEvent({type:"palette.getProviders",providers:[]});return this._eventBus.fire(e),e.providers};nt.prototype._toggleState=function(n){n=n||{};var e=this._getParentContainer(),t=this._container,i=this._eventBus,r,o=ee(t),s=ee(e);"twoColumn"in n?r=n.twoColumn:r=this._needsCollapse(e.clientHeight,this._entries||{}),o.toggle(xk,r),s.toggle(Bx+xk,r),"open"in n&&(o.toggle(Nx,n.open),s.toggle(Bx+Nx,n.open)),i.fire("palette.changed",{twoColumn:r,open:this.isOpen()})};nt.prototype._update=function(){var n=X(".djs-palette-entries",this._container),e=this._entries=this.getEntries();no(n),k(e,function(t,i){var r=t.group||"default",o=X("[data-group="+Sa(r)+"]",n);o||(o=te('<div class="group"></div>'),et(o,"data-group",r),n.appendChild(o));var s=t.html||(t.separator?'<hr class="separator" />':'<div class="entry" draggable="true"></div>'),a=te(s);if(o.appendChild(a),!t.separator&&(et(a,"data-action",i),t.title&&et(a,"title",t.title),t.className&&JF(a,t.className),t.imageUrl)){var l=te("<img>");et(l,"src",t.imageUrl),a.appendChild(l)}}),this.open()};nt.prototype.trigger=function(n,e,t){var i,r,o=e.delegateTarget||e.target;return o?(i=et(o,"data-action"),r=e.originalEvent||e,this.triggerEntry(i,n,r,t)):e.preventDefault()};nt.prototype.triggerEntry=function(n,e,t,i){var r=this._entries,o,s;if(o=r[n],!!o&&(s=o.action,this._eventBus.fire("palette.trigger",{entry:o,event:t})!==!1)){if(ge(s)){if(e==="click")return s(t,i)}else if(s[e])return s[e](t,i);t.preventDefault()}};nt.prototype._layoutChanged=function(){this._toggleState({})};nt.prototype._needsCollapse=function(n,e){var t=50,i=Object.keys(e).length*46;return n<i+t};nt.prototype.close=function(){this._toggleState({open:!1,twoColumn:!1})};nt.prototype.open=function(){this._toggleState({open:!0})};nt.prototype.toggle=function(){this.isOpen()?this.close():this.open()};nt.prototype.isActiveTool=function(n){return n&&this._activeTool===n};nt.prototype.updateToolHighlight=function(n){var e,t;this._toolsContainer||(e=X(".djs-palette-entries",this._container),this._toolsContainer=X("[data-group=tools]",e)),t=this._toolsContainer,k(t.children,function(i){var r=i.getAttribute("data-action");if(r){var o=ee(i);r=r.replace("-tool",""),o.contains("entry")&&r===n?o.add("highlighted-entry"):o.remove("highlighted-entry")}})};nt.prototype.isOpen=function(){return ee(this._container).has(Nx)};nt.prototype._getParentContainer=function(){return this._canvas.getContainer()};nt.HTML_MARKUP='<div class="djs-palette"><div class="djs-palette-entries"></div><div class="djs-palette-toggle"></div></div>';function JF(n,e){var t=ee(n),i=F(e)?e:e.split(/\s+/g);i.forEach(function(r){t.add(r)})}function e3(n,e){var t=e.getPaletteEntries();return ge(t)?t(n):(k(t,function(i,r){n[r]=i}),n)}var wk={__init__:["palette"],palette:["type",nt]};var t3=250;function Pr(n){this._eventBus=n,this._tools=[],this._active=null}Pr.$inject=["eventBus"];Pr.prototype.registerTool=function(n,e){var t=this._tools;if(!e)throw new Error(`A tool has to be registered with it's "events"`);t.push(n),this.bindEvents(n,e)};Pr.prototype.isActive=function(n){return n&&this._active===n};Pr.prototype.length=function(n){return this._tools.length};Pr.prototype.setActive=function(n){var e=this._eventBus;this._active!==n&&(this._active=n,e.fire("tool-manager.update",{tool:n}))};Pr.prototype.bindEvents=function(n,e){var t=this._eventBus,i=[];t.on(e.tool+".init",function(r){var o=r.context;if(!o.reactivate&&this.isActive(n)){this.setActive(null);return}this.setActive(n)},this),k(e,function(r){i.push(r+".ended"),i.push(r+".canceled")}),t.on(i,t3,function(r){this._active&&(n3(r)||this.setActive(null))},this)};function n3(n){var e=n.originalEvent&&n.originalEvent.target;return e&&De(e,'.group[data-group="tools"]')}var Im={__depends__:[gn],__init__:["toolManager"],toolManager:["type",Pr]};function Hf(n){var e=this;this._lastMoveEvent=null;function t(i){e._lastMoveEvent=i}n.on("canvas.init",function(i){var r=e._svg=i.svg;r.addEventListener("mousemove",t)}),n.on("canvas.destroy",function(){e._lastMouseEvent=null,e._svg.removeEventListener("mousemove",t)})}Hf.$inject=["eventBus"];Hf.prototype.getLastMoveEvent=function(){return this._lastMoveEvent||i3(0,0)};function i3(n,e){var t=document.createEvent("MouseEvent"),i=n,r=e,o=n,s=e;return t.initMouseEvent&&t.initMouseEvent("mousemove",!0,!0,window,0,i,r,o,s,!1,!1,!1,!1,0,null),t}var Lm={__init__:["mouse"],mouse:["type",Hf]};var Sk="crosshair",Ck="selected",r3="djs-dragging-active-lasso";function Ui(n,e,t,i,r,o,s){this._selection=r,this._dragging=t,this._mouse=s;var a=this,l={create:function(f){var h=e.getActiveLayer(),d=f.frame=Q("rect");j(d,{class:"djs-lasso-overlay",width:1,height:1,x:0,y:0}),K(h,d),c(!0),this.update(f)},update:function(f){var h=f.frame,d=f.bbox;h&&d&&j(h,{x:d.x,y:d.y,width:d.width,height:d.height});var p=f.marked,m=f.lastMarked;if(p&&m){for(let g of m)p.has(g)||e.removeMarker(g,Ck);for(let g of p)m.has(g)||e.addMarker(g,Ck)}},remove:function(f){this.update(f),f.frame&&Fe(f.frame),c(!1)}};function c(f){ne(e.getContainer()).toggle(r3,f)}function u(f){var h=i.getAll();return new Set(Wu(wv(h,f)))}o.registerTool("lasso",{tool:"lasso.selection",dragging:"lasso"}),n.on("lasso.selection.end",function(f){var h=f.originalEvent.target;!f.hover&&!(h instanceof SVGElement)||n.once("lasso.selection.ended",function(){a.activateLasso(f.originalEvent,!0)})}),n.on("lasso.end",0,function(f){var h=f.context;a._select(Array.from(h.marked))}),n.on("lasso.start",function(f){var h=f.context;h.bbox=Ek(f),h.add=df(f),h.lastMarked=new Set(r.get()),h.add?h.marked=h.lastMarked:h.marked=new Set,h.initialMarked=h.marked,l.create(h)}),n.on("lasso.move",function(f){var h=f.context,d=h.bbox=Ek(f),p=u(d),m=h.initialMarked.union(p);h.lastMarked=h.marked,h.marked=m,l.update(h)}),n.on("lasso.cleanup",function(f){var h=f.context;h.lastMarked=h.marked,h.marked=new Set(r.get()),l.remove(f.context)}),n.on("element.mousedown",1500,function(f){if(df(f))return a.activateLasso(f.originalEvent),!0})}Ui.$inject=["eventBus","canvas","dragging","elementRegistry","selection","toolManager","mouse"];Ui.prototype.activateLasso=function(n,e){this._dragging.init(n,"lasso",{autoActivate:e,cursor:Sk,data:{context:{}},keepSelection:!0})};Ui.prototype.activateSelection=function(n,e){this._dragging.init(n,"lasso.selection",{trapClick:!1,autoActivate:e,cursor:Sk,data:{context:{}},keepSelection:!0})};Ui.prototype._select=function(n){this._selection.select(n)};Ui.prototype.select=function(n,e,t=[]){var i=Wu(wv(n,e));this._select([...t,...i])};Ui.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var n=this._mouse.getLastMoveEvent();this.activateSelection(n,!!n)};Ui.prototype.isActive=function(){var n=this._dragging.context();return n&&/^lasso/.test(n.prefix)};function Ek(n){var e={x:n.x-n.dx,y:n.y-n.dy},t={x:n.x,y:n.y},i;return e.x<=t.x&&e.y<t.y||e.x<t.x&&e.y<=t.y?i={x:e.x,y:e.y,width:t.x-e.x,height:t.y-e.y}:e.x>=t.x&&e.y<t.y||e.x>t.x&&e.y<=t.y?i={x:t.x,y:e.y,width:e.x-t.x,height:t.y-e.y}:e.x<=t.x&&e.y>t.y||e.x<t.x&&e.y>=t.y?i={x:e.x,y:t.y,width:t.x-e.x,height:e.y-t.y}:e.x>=t.x&&e.y>t.y||e.x>t.x&&e.y>=t.y?i={x:t.x,y:t.y,width:e.x-t.x,height:e.y-t.y}:i={x:t.x,y:t.y,width:0,height:0},i}var Ok={__depends__:[Im,Lm],__init__:["lassoTool"],lassoTool:["type",Ui]};var $x=1500,Rk="grab";function Eo(n,e,t,i,r,o){this._dragging=t,this._mouse=o;var s=this,a=i.get("keyboard",!1);r.registerTool("hand",{tool:"hand",dragging:"hand.move"}),n.on("element.mousedown",$x,function(l){if(hf(l))return s.activateMove(l.originalEvent,!0),!1}),a&&a.addListener($x,function(l){if(!(!kk(l.keyEvent)||s.isActive())){var c=s._mouse.getLastMoveEvent();s.activateMove(c,!!c)}},"keyboard.keydown"),a&&a.addListener($x,function(l){!kk(l.keyEvent)||!s.isActive()||s.toggle()},"keyboard.keyup"),n.on("hand.end",function(l){var c=l.originalEvent.target;if(!l.hover&&!(c instanceof SVGElement))return!1;n.once("hand.ended",function(){s.activateMove(l.originalEvent,{reactivate:!0})})}),n.on("hand.move.move",function(l){var c=e.viewbox().scale;e.scroll({dx:l.dx*c,dy:l.dy*c})}),n.on("hand.move.end",function(l){var c=l.context,u=c.reactivate;return!hf(l)&&u&&n.once("hand.move.ended",function(f){s.activateHand(f.originalEvent,!0,!0)}),!1})}Eo.$inject=["eventBus","canvas","dragging","injector","toolManager","mouse"];Eo.prototype.activateMove=function(n,e,t){typeof e=="object"&&(t=e,e=!1),this._dragging.init(n,"hand.move",{autoActivate:e,cursor:Rk,data:{context:t||{}}})};Eo.prototype.activateHand=function(n,e,t){this._dragging.init(n,"hand",{trapClick:!1,autoActivate:e,cursor:Rk,data:{context:{reactivate:t}}})};Eo.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var n=this._mouse.getLastMoveEvent();this.activateHand(n,!!n)};Eo.prototype.isActive=function(){var n=this._dragging.context();return n?/^(hand|hand\.move)$/.test(n.prefix):!1};function kk(n){return Ve("Space",n)}var Tk={__depends__:[Im,Lm],__init__:["handTool"],handTool:["type",Eo]};function zf(n,e,t,i,r,o){this._palette=n,this._create=e,this._elementFactory=t,this._handTool=i,this._lassoTool=r,this._translate=o,n.registerProvider(this)}zf.$inject=["palette","create","elementFactory","handTool","lassoTool","translate"];zf.prototype.getPaletteEntries=function(n){var e={},t=this._create,i=this._elementFactory,r=this._handTool,o=this._lassoTool,s=this._translate;function a(l,c,u,f,h){function d(p){var m=i.createShape(T({type:l},h));t.start(p,m)}return{group:c,className:u,title:f,action:{dragstart:d,click:d}}}return T(e,{"hand-tool":{group:"tools",className:"dmn-icon-hand-tool",title:s("Activate hand tool"),action:{click:function(l){r.activateHand(l)}}},"lasso-tool":{group:"tools",className:"dmn-icon-lasso-tool",title:s("Activate lasso tool"),action:{click:function(l){o.activateSelection(l)}}},"tool-separator":{group:"tools",separator:!0},"create.decision":a("dmn:Decision","drd","dmn-icon-decision",s("Create decision")),"create.input-data":a("dmn:InputData","drd","dmn-icon-input-data",s("Create input data")),"create.knowledge-source":a("dmn:KnowledgeSource","drd","dmn-icon-knowledge-source",s("Create knowledge source")),"create.business-knowledge-model":a("dmn:BusinessKnowledgeModel","drd","dmn-icon-business-knowledge",s("Create knowledge model"))}),e};var Ak={__depends__:[qe,wk,Zp,Ok,Tk],__init__:["paletteProvider"],paletteProvider:["type",zf]};var Nm=Math.max,$m=Math.min,o3=20;function Mk(n,e,t){var i=t.x,r=t.y,o={x:n.x,y:n.y,width:n.width,height:n.height};return e.indexOf("n")!==-1?(o.y=n.y+r,o.height=n.height-r):e.indexOf("s")!==-1&&(o.height=n.height+r),e.indexOf("e")!==-1?o.width=n.width+i:e.indexOf("w")!==-1&&(o.x=n.x+i,o.width=n.width-i),o}function Bm(n,e,t){var i=e[n],r=t.min&&t.min[n],o=t.max&&t.max[n];return se(r)&&(i=(/top|left/.test(n)?$m:Nm)(i,r)),se(o)&&(i=(/top|left/.test(n)?Nm:$m)(i,o)),i}function Pk(n,e){if(!e)return n;var t=G(n);return Ov({top:Bm("top",t,e),right:Bm("right",t,e),bottom:Bm("bottom",t,e),left:Bm("left",t,e)})}function Dk(n,e,t,i){var r=G(e),o={top:/n/.test(n)?r.bottom-t.height:r.top,left:/w/.test(n)?r.right-t.width:r.left,bottom:/s/.test(n)?r.top+t.height:r.bottom,right:/e/.test(n)?r.left+t.width:r.right},s=i?G(i):o,a={top:$m(o.top,s.top),left:$m(o.left,s.left),bottom:Nm(o.bottom,s.bottom),right:Nm(o.right,s.right)};return Ov(a)}function Wf(n,e){return typeof n!="undefined"?n:o3}function s3(n,e){var t,i,r,o;return typeof e=="object"?(t=Wf(e.left),i=Wf(e.right),r=Wf(e.top),o=Wf(e.bottom)):t=i=r=o=Wf(e),{x:n.x-t,y:n.y-r,width:n.width+t+i,height:n.height+r+o}}function a3(n){return!(n.waypoints||n.type==="label")}function Ik(n,e){var t;if(n.length===void 0?t=Ee(n.children,a3):t=n,t.length)return s3(Tt(t),e)}var Lk=10;function ks(n,e,t,i){this._dragging=i,this._rules=e;var r=this;function o(l,c){var u=l.shape,f=l.direction,h=l.resizeConstraints,d;l.delta=c,d=Mk(u,f,c),l.newBounds=Pk(d,h),l.canExecute=r.canResize(l)}function s(l){var c=l.resizeConstraints,u=l.minBounds;c===void 0&&(u===void 0&&(u=r.computeMinResizeBox(l)),l.resizeConstraints={min:G(u)})}function a(l){var c=l.shape,u=l.canExecute,f=l.newBounds;if(u){if(f=F1(f),!l3(c,f))return;t.resizeShape(c,f)}}n.on("resize.start",function(l){s(l.context)}),n.on("resize.move",function(l){var c={x:l.dx,y:l.dy};o(l.context,c)}),n.on("resize.end",function(l){a(l.context)})}ks.prototype.canResize=function(n){var e=this._rules,t=hn(n,["newBounds","shape","delta","direction"]);return e.allowed("shape.resize",t)};ks.prototype.activate=function(n,e,t){var i=this._dragging,r,o;if(typeof t=="string"&&(t={direction:t}),r=T({shape:e},t),o=r.direction,!o)throw new Error("must provide a direction (n|w|s|e|nw|se|ne|sw)");i.init(n,jx(e,o),"resize",{autoActivate:!0,cursor:c3(o),data:{shape:e,context:r}})};ks.prototype.computeMinResizeBox=function(n){var e=n.shape,t=n.direction,i,r;return i=n.minDimensions||{width:Lk,height:Lk},r=Ik(e,n.childrenBoxPadding),Dk(t,e,i,r)};ks.$inject=["eventBus","rules","modeling","dragging"];function l3(n,e){return n.x!==e.x||n.y!==e.y||n.width!==e.width||n.height!==e.height}function jx(n,e){var t=le(n),i=G(n),r={x:t.x,y:t.y};return e.indexOf("n")!==-1?r.y=i.top:e.indexOf("s")!==-1&&(r.y=i.bottom),e.indexOf("e")!==-1?r.x=i.right:e.indexOf("w")!==-1&&(r.x=i.left),r}function c3(n){var e="resize-";return n==="n"||n==="s"?e+"ns":n==="e"||n==="w"?e+"ew":n==="nw"||n==="se"?e+"nwse":e+"nesw"}var Bk="djs-resizing",Nk="resize-not-ok",u3=500;function jm(n,e,t){function i(o){var s=o.shape,a=o.newBounds,l=o.frame;l||(l=o.frame=t.addFrame(s,e.getActiveLayer()),e.addMarker(s,Bk)),a.width>5&&j(l,{x:a.x,width:a.width}),a.height>5&&j(l,{y:a.y,height:a.height}),o.canExecute?ne(l).remove(Nk):ne(l).add(Nk)}function r(o){var s=o.shape,a=o.frame;a&&Fe(o.frame),e.removeMarker(s,Bk)}n.on("resize.move",u3,function(o){i(o.context)}),n.on("resize.cleanup",function(o){r(o.context)})}jm.$inject=["eventBus","canvas","previewSupport"];var Fm=-6,qm=8,Vm=20,Uf="djs-resizer",f3=["n","w","s","e","nw","ne","se","sw"];function Qi(n,e,t,i){this._resize=i,this._canvas=e;var r=this;n.on("selection.changed",function(o){var s=o.newSelection;r.removeResizers(),s.length===1&&k(s,at(r.addResizer,r))}),n.on("shape.changed",function(o){var s=o.element;t.isSelected(s)&&(r.removeResizers(),r.addResizer(s))})}Qi.prototype.makeDraggable=function(n,e,t){var i=this._resize;function r(o){Sn(o)&&i.activate(o,n,t)}q.bind(e,"mousedown",r),q.bind(e,"touchstart",r)};Qi.prototype._createResizer=function(n,e,t,i){var r=this._getResizersParent(),o=h3(i),s=Q("g");ne(s).add(Uf),ne(s).add(Uf+"-"+n.id),ne(s).add(Uf+"-"+i),K(r,s);var a=Q("rect");j(a,{x:-qm/2+o.x,y:-qm/2+o.y,width:qm,height:qm}),ne(a).add(Uf+"-visual"),K(s,a);var l=Q("rect");return j(l,{x:-Vm/2+o.x,y:-Vm/2+o.y,width:Vm,height:Vm}),ne(l).add(Uf+"-hit"),K(s,l),iC(s,e,t),s};Qi.prototype.createResizer=function(n,e){var t=jx(n,e),i=this._createResizer(n,t.x,t.y,e);this.makeDraggable(n,i,e)};Qi.prototype.addResizer=function(n){var e=this;Xe(n)||k(f3,function(t){e._resize.canResize({shape:n,direction:t})&&e.createResizer(n,t)})};Qi.prototype.removeResizers=function(){var n=this._getResizersParent();ss(n)};Qi.prototype._getResizersParent=function(){return this._canvas.getLayer("resizers")};Qi.$inject=["eventBus","canvas","selection","resize"];function h3(n){var e={x:0,y:0};return n.indexOf("e")!==-1?e.x=-Fm:n.indexOf("w")!==-1&&(e.x=Fm),n.indexOf("s")!==-1?e.y=-Fm:n.indexOf("n")!==-1&&(e.y=Fm),e}var $k={__depends__:[yn,gn,ka],__init__:["resize","resizePreview","resizeHandles"],resize:["type",ks],resizePreview:["type",jm],resizeHandles:["type",Qi]};var d3="reconnectStart",p3="reconnectEnd",m3=2e3;function Hm(n){n.on(["bendpoint.move.move","bendpoint.move.end"],m3,function(e){var t=e.context,i=t.allowed,r=t.hover,o=t.source,s=t.target,a=t.type;if(t.hints||(t.hints={}),delete t.hints.connectionStart,delete t.hints.connectionEnd,!(i&&i.type!=="dmn:InformationRequirement")&&!(!r||!Ge(r,["dmn:Decision","dmn:InputData"]))&&o!==s){var l=a===d3||a===p3,c=vt(o,s);l&&r===o?(g3(e,c),t.hints.connectionEnd=Fk(s,c)):l&&r===s&&(t.hints.connectionStart=jk(o,c),y3(e,c))}})}Hm.$inject=["eventBus"];function jk(n,e){var t=G(n),i=le(n);return e.includes("bottom")?i.y=t.top:e.includes("top")?i.y=t.bottom:e.includes("right")?i.x=t.left:i.x=t.right,i}function Fk(n,e){var t=G(n),i=le(n);return e.includes("bottom")?i.y=t.bottom:e.includes("top")?i.y=t.top:e.includes("right")?i.x=t.right:i.x=t.left,i}function g3(n,e){var t=n.context,i=t.source,r=jk(i,e),o=n.x-r.x,s=n.y-r.y;n.x-=o,n.y-=s,n.dx-=o,n.dy-=s}function y3(n,e){var t=n.context,i=t.target,r=Fk(i,e),o=0,s=0;e.includes("top")||e.includes("bottom")?s=n.y-r.y:o=n.x-r.x,n.x-=o,n.y-=s,n.dx-=o,n.dy-=s}var v3=250;function zm(n){n.on(["connect.hover","connect.move","connect.end"],v3,function(e){var t=e.context,i=t.canExecute,r=t.hover,o=t.source,s=t.target;if(i&&i.type==="dmn:InformationRequirement"){var a=vt(o,s);t.connectionStart=le(o),r===o?t.connectionEnd=le(s):t.connectionEnd={x:e.x,y:e.y},a.includes("bottom")?(t.connectionStart.y=G(o).top,t.connectionEnd.y=G(s).bottom):a.includes("top")?(t.connectionStart.y=G(o).bottom,t.connectionEnd.y=G(s).top):a.includes("right")?(t.connectionStart.x=G(o).left,t.connectionEnd.x=G(s).right):(t.connectionStart.x=G(o).right,t.connectionEnd.x=G(s).left)}else delete t.connectionStart,delete t.connectionEnd})}zm.$inject=["eventBus"];function vi(){this._targets={},this._snapOrigins={},this._snapLocations=[],this._defaultSnaps={}}vi.prototype.getSnapOrigin=function(n){return this._snapOrigins[n]};vi.prototype.setSnapOrigin=function(n,e){this._snapOrigins[n]=e,this._snapLocations.indexOf(n)===-1&&this._snapLocations.push(n)};vi.prototype.addDefaultSnap=function(n,e){var t=this._defaultSnaps[n];t||(t=this._defaultSnaps[n]=[]),t.push(e)};vi.prototype.getSnapLocations=function(){return this._snapLocations};vi.prototype.setSnapLocations=function(n){this._snapLocations=n};vi.prototype.pointsForTarget=function(n){var e=n.id||n,t=this._targets[e];return t||(t=this._targets[e]=new Wm,t.initDefaults(this._defaultSnaps)),t};function Wm(){this._snapValues={}}Wm.prototype.add=function(n,e){var t=this._snapValues[n];t||(t=this._snapValues[n]={x:[],y:[]}),t.x.indexOf(e.x)===-1&&t.x.push(e.x),t.y.indexOf(e.y)===-1&&t.y.push(e.y)};Wm.prototype.snap=function(n,e,t,i){var r=this._snapValues[e];return r&&ZE(n[t],r[t],i)};Wm.prototype.initDefaults=function(n){var e=this;k(n||{},function(t,i){k(t,function(r){e.add(i,r)})})};var x3=1250;function Rs(n,e,t){var i=this;this._elementRegistry=n,e.on(["create.start","shape.move.start"],function(r){i.initSnap(r)}),e.on(["create.move","create.end","shape.move.move","shape.move.end"],x3,function(r){var o=r.context,s=o.shape,a=o.snapContext,l=o.target;if(!(r.originalEvent&&Mt(r.originalEvent))&&!(wr(r)||!l)){var c=a.pointsForTarget(l);c.initialized||(c=i.addSnapTargetPoints(c,s,l),c.initialized=!0),t.snap(r,c)}}),e.on(["create.cleanup","shape.move.cleanup"],function(){t.hide()})}Rs.$inject=["elementRegistry","eventBus","snapping"];Rs.prototype.initSnap=function(n){var e=this._elementRegistry,t=n.context,i=t.shape,r=t.snapContext;r||(r=t.snapContext=new vi);var o;e.get(i.id)?o=ms(i,n):o={x:n.x+ms(i).x,y:n.y+ms(i).y};var s={x:o.x-i.width/2,y:o.y-i.height/2},a={x:o.x+i.width/2,y:o.y+i.height/2};return r.setSnapOrigin("mid",{x:o.x-n.x,y:o.y-n.y}),Bi(i)||(r.setSnapOrigin("top-left",{x:s.x-n.x,y:s.y-n.y}),r.setSnapOrigin("bottom-right",{x:a.x-n.x,y:a.y-n.y})),r};Rs.prototype.addSnapTargetPoints=function(n,e,t){var i=this.getSnapTargets(e,t);return k(i,function(r){if(Bi(r)){Bi(e)&&n.add("mid",ms(r));return}if(Xe(r)){if(r.waypoints.length<3)return;var o=r.waypoints.slice(1,-1);k(o,function(s){n.add("mid",s)});return}n.add("mid",ms(r))}),!se(e.x)||!se(e.y)||this._elementRegistry.get(e.id)&&n.add("mid",ms(e)),n};Rs.prototype.getSnapTargets=function(n,e){return zp(e).filter(function(t){return!b3(t)})};function b3(n){return!!n.hidden}var _3=1250;function Ts(n,e){var t=this;n.on(["resize.start"],function(i){t.initSnap(i)}),n.on(["resize.move","resize.end"],_3,function(i){var r=i.context,o=r.shape,s=o.parent,a=r.direction,l=r.snapContext;if(!(i.originalEvent&&Mt(i.originalEvent))&&!wr(i)){var c=l.pointsForTarget(s);c.initialized||(c=t.addSnapTargetPoints(c,o,s,a),c.initialized=!0),E3(a)&&vn(i,"x",i.x),S3(a)&&vn(i,"y",i.y),e.snap(i,c)}}),n.on(["resize.cleanup"],function(){e.hide()})}Ts.prototype.initSnap=function(n){var e=n.context,t=e.shape,i=e.direction,r=e.snapContext;r||(r=e.snapContext=new vi);var o=qk(t,i);return r.setSnapOrigin("corner",{x:o.x-n.x,y:o.y-n.y}),r};Ts.prototype.addSnapTargetPoints=function(n,e,t,i){var r=this.getSnapTargets(e,t);return k(r,function(o){n.add("corner",eS(o)),n.add("corner",JE(o))}),n.add("corner",qk(e,i)),n};Ts.$inject=["eventBus","snapping"];Ts.prototype.getSnapTargets=function(n,e){return zp(e).filter(function(t){return!w3(t,n)&&!Xe(t)&&!C3(t)&&!Bi(t)})};function qk(n,e){var t=le(n),i=G(n),r={x:t.x,y:t.y};return e.indexOf("n")!==-1?r.y=i.top:e.indexOf("s")!==-1&&(r.y=i.bottom),e.indexOf("e")!==-1?r.x=i.right:e.indexOf("w")!==-1&&(r.x=i.left),r}function w3(n,e){return n.host===e}function C3(n){return!!n.hidden}function E3(n){return n==="n"||n==="s"}function S3(n){return n==="e"||n==="w"}var O3=7,k3=1e3;function Ki(n){this._canvas=n,this._asyncHide=Mi(at(this.hide,this),k3)}Ki.$inject=["canvas"];Ki.prototype.snap=function(n,e){var t=n.context,i=t.snapContext,r=i.getSnapLocations(),o={x:wr(n,"x"),y:wr(n,"y")};k(r,function(s){var a=i.getSnapOrigin(s),l={x:n.x+a.x,y:n.y+a.y};if(k(["x","y"],function(c){var u;o[c]||(u=e.snap(l,s,c,O3),u!==void 0&&(o[c]={value:u,originValue:u-a[c]}))}),o.x&&o.y)return!1}),this.showSnapLine("vertical",o.x&&o.x.value),this.showSnapLine("horizontal",o.y&&o.y.value),k(["x","y"],function(s){var a=o[s];Pe(a)&&vn(n,s,a.originValue)})};Ki.prototype._createLine=function(n){var e=this._canvas.getLayer("snap"),t=Q("path");return j(t,{d:"M0,0 L0,0"}),ne(t).add("djs-snap-line"),K(e,t),{update:function(i){se(i)?n==="horizontal"?j(t,{d:"M-100000,"+i+" L+100000,"+i,display:""}):j(t,{d:"M "+i+",-100000 L "+i+", +100000",display:""}):j(t,{display:"none"})}}};Ki.prototype._createSnapLines=function(){this._snapLines={horizontal:this._createLine("horizontal"),vertical:this._createLine("vertical")}};Ki.prototype.showSnapLine=function(n,e){var t=this.getSnapLine(n);t&&t.update(e),this._asyncHide()};Ki.prototype.getSnapLine=function(n){return this._snapLines||this._createSnapLines(),this._snapLines[n]};Ki.prototype.hide=function(){k(this._snapLines,function(n){n.update()})};var Vk={__init__:["createMoveSnapping","resizeSnapping","snapping"],createMoveSnapping:["type",Rs],resizeSnapping:["type",Ts],snapping:["type",Ki]};var Hk={__depends__:[Vk],__init__:["bendpointSnapping","connectSnapping"],bendpointSnapping:["type",Hm],connectSnapping:["type",zm]};function So(n){br.call(this,n)}fe(So,br);So.prototype._modelingModules=[CE,ME,LE,nS,oO,sO,lO,fO,pO,mO,xO,_O,wO,kO,PO,sk,hk,vk,Ak,$k,Hk];So.prototype._modules=[].concat(So.prototype._modules,So.prototype._modelingModules);function Fx(n){let e={variables:[],rootElement:V3(n)};for(let t=n;t;t=t.$parent)R3(t,e);return e.variables}function R3(n,e){el(n,"dmn:Decision")?T3(n,e):el(n,"dmn:BusinessKnowledgeModel")?A3(n,e):el(n,"dmn:Expression")&&j3(n,e)}function T3(n,e){for(let t of n.get("informationRequirement"))M3(t,e);for(let t of n.get("knowledgeRequirement"))Wk(t,e)}function A3(n,e){for(let t of n.get("knowledgeRequirement"))Wk(t,e)}function M3(n,e){let t=n.get("requiredInput");t&&P3(t,e);let i=n.get("requiredDecision");i&&D3(i,e)}function P3(n,e){let t=qx(n,e.rootElement);if(!t)return;let i=t.get("name");i&&e.variables.push({name:i,origin:t})}function D3(n,e){let t=qx(n,e.rootElement);if(!t)return;let i=t.get("name");if(!i)return;let r={name:i,origin:t},o=t.get("decisionLogic");o&&I3(o,r,e),e.variables.push(r)}function I3(n,e,t){if(el(n,"dmn:DecisionTable")){let i=n.get("output");L3(i,e,t)}}function L3(n,e,t){if(n.length===1){let r={...zk(n[0]),name:e.name};Object.assign(e,r);return}let i=n.map(zk);e.entries=i.filter(r=>!!r.name)}function zk(n){let e={name:n.name};return n.typeRef&&(e.detail=n.typeRef),e}function Wk(n,e){let t=n.get("requiredKnowledge");t&&B3(t,e)}function B3(n,e){let t=qx(n,e.rootElement);t&&el(t,"dmn:BusinessKnowledgeModel")&&N3(t,e)}function N3(n,e){let t=n.get("name");if(!t)return;let i={name:t,origin:n},r=n.get("encapsulatedLogic");r&&$3(r,i),e.variables.push(i)}function $3(n,e,t){let r=n.get("formalParameter").map((o,s)=>{let a={name:o.get("name")||`param ${s+1}`,type:o.get("typeRef")};return a.type||delete a.type,a});Object.assign(e,{type:"function",params:r})}function j3(n,e){el(n,"dmn:FunctionDefinition")&&F3(n,e)}function F3(n,e){let t=n.get("formalParameter");for(let i of t)q3(i,e)}function q3(n,e){let t=n.get("name");if(!t)return;let i={name:t,origin:n};n.get("typeRef")&&(i.detail=n.get("typeRef")),e.variables.push(i)}function V3(n){let e=n;for(;e.$parent;)e=e.$parent;return e}function qx(n,e){let t=n.get("href");if(!t||!t.startsWith("#"))return;let i=t.slice(1);return e.get("drgElement").find(o=>o.get("id")===i)}function el(n,e){return n.$instanceOf(e)}var Qf=class{constructor(e){e.registerProvider(this)}getVariables(e,t){return e.concat(Fx(t))}};Qf.$inject=["variableResolver"];var Um=class{constructor(){this._providers=[]}registerProvider(e){this._providers.push(e)}getVariables(e){return this._providers.reduce((t,i)=>i.getVariables(t,e),[])}};var tl={__init__:["dmnVariableProvider"],dmnVariableProvider:["type",Qf],variableResolver:["type",Um]};var Oo=class{constructor(e){T(this,e),Dr(this,"businessObject",{writable:!0})}},Vx=class extends Oo{constructor(e){super(e),Dr(this,"rows",{enumerable:!0,value:this.rows||[]}),Dr(this,"cols",{enumerable:!0,value:this.cols||[]})}},pt=class extends Oo{constructor(e){super(e),Dr(this,"root",{writable:!0}),Dr(this,"cells",{enumerable:!0,value:this.cells||[]})}},mt=class extends Oo{constructor(e){super(e),Dr(this,"root",{writable:!0}),Dr(this,"cells",{enumerable:!0,value:this.cells||[]})}},ko=class extends Oo{constructor(e){super(e),Dr(this,"row",{writable:!0}),Dr(this,"col",{writable:!0})}},H3={root:Vx,row:pt,col:mt,cell:ko};function Uk(n,e){let t=H3[n];if(!t)throw new Error("unknown type "+n);return new t(e)}function Dr(n,e,t){Object.defineProperty(n,e,t)}var As=class{constructor(){this._uid=12}create(e,t={}){return t.id||(t.id=e+"_"+this._uid++),Uk(e,t)}createRoot(e){return this.create("root",e)}createRow(e){return this.create("row",e)}createCol(e){return this.create("col",e)}createCell(e){return this.create("cell",e)}};var nl=class{constructor(e){this._eventBus=e,this._elements={},e.on("table.clear",this.clear.bind(this))}add(e,t){let{id:i}=e;this._elements[i]=e}remove(e){let t=e.id||e;delete this._elements[t]}get(e){return this._elements[e]}getAll(){return Hx(this._elements)}forEach(e){Hx(this._elements).forEach(t=>e(t))}filter(e){return Hx(this._elements).filter(t=>e(t))}clear(){this._elements={}}updateId(e,t){this._validateId(t),typeof e=="string"&&(e=this.get(e)),this._eventBus.fire("element.updateId",{element:e,newId:t}),this.remove(e),e.id=t,this.add(e)}_validateId(e){if(!e)throw new Error("element must have an id");if(this._elements[e])throw new Error("element with id "+e+" already added")}};nl.$inject=["eventBus"];function Hx(n){return Object.keys(n).map(function(e){return n[e]})}var il=class{constructor(e){this._listeners={},e.on("elements.changed",({elements:t})=>{this.elementsChanged(t)}),e.on("root.remove",t=>{let i=t.root.id;this._listeners[i]&&e.once("root.add",r=>{let o=r.root.id;this.updateId(i,o)})}),e.on("element.updateId",({element:t,newId:i})=>{this.updateId(t.id,i)})}elementsChanged(e){let t={},i=e.length;for(let r=0;r<i;r++){let{id:o}=e[r];if(t[o])return;t[o]=!0;let s=this._listeners[o]&&this._listeners[o].length;if(s)for(let a=0;a<s;a++)this._listeners[o][a]&&this._listeners[o][a]()}}onElementsChanged(e,t){this._listeners[e]||(this._listeners[e]=[]),this._listeners[e][this._listeners[e].length]=t}offElementsChanged(e,t){if(this._listeners[e])if(t){let i=this._listeners[e].indexOf(t);i!==-1&&this._listeners[e].splice(i,1)}else this._listeners[e].length=0}updateId(e,t){this._listeners[e]&&(this._listeners[t]=this._listeners[e],delete this._listeners[e])}};il.$inject=["eventBus"];var z3=1e3,Kf=class{constructor(){this._listeners={}}getComponent(e,t){let i=this._listeners[e];if(!i)return;let r;for(let o=0;o<i.length&&(r=i[o].callback(t),!r);o++);return r}getComponents(e,t){let i=this._listeners[e],r=[];if(!i)return r;for(let o=0;o<i.length;o++){let s=i[o].callback(t);s&&r.push(s)}return r.length,r}onGetComponent(e,t,i){if(ge(t)&&(i=t,t=z3),!se(t))throw new Error("priority must be a number");let r=this._getListeners(e),o,s,a={priority:t,callback:i};for(s=0;o=r[s];s++)if(o.priority<t){r.splice(s,0,a);return}r.push(a)}offGetComponent(e,t){let i=this._getListeners(e),r,o,s;if(t)for(s=i.length-1;r=i[s];s--)o=r.callback,o===t&&i.splice(s,1);else i.length=0}_getListeners(e){let t=this._listeners[e];return t||(this._listeners[e]=t=[]),t}};var Gf=class extends L{constructor(e){super(e);let t=this._injector=e.injector;this._sheet=t.get("sheet"),this._changeSupport=t.get("changeSupport"),this._components=t.get("components"),this._eventBus=t.get("eventBus");let i=t.get("throttle");this.onElementsChanged=this.onElementsChanged.bind(this),this.onScroll=i(this.onScroll.bind(this))}onElementsChanged(){this.forceUpdate()}onScroll(){this._eventBus.fire("sheet.scroll")}getChildContext(){return{changeSupport:this._changeSupport,components:this._components,injector:this._injector}}componentWillMount(){let{id:e}=this._sheet.getRoot();this._changeSupport.onElementsChanged(e,this.onElementsChanged)}componentWillUnmount(){let{id:e}=this._sheet.getRoot();this._changeSupport.offElementsChanged(e,this.onElementsChanged)}render(){let{rows:e,cols:t}=this._sheet.getRoot(),i=this._components.getComponents("table.before"),r=this._components.getComponents("table.after"),o=this._components.getComponent("table.head"),s=this._components.getComponent("table.body"),a=this._components.getComponent("table.foot");return y(1,"div","tjs-container",[i&&i.map((l,c)=>P(2,l,null,c)),y(1,"div","tjs-table-container",y(1,"table","tjs-table",[o&&P(2,o,{rows:e,cols:t}),s&&P(2,s,{rows:e,cols:t}),a&&P(2,a,{rows:e,cols:t})],0),2,{onScroll:this.onScroll}),r&&r.map((l,c)=>P(2,l,null,c))],0)}};var rl=class{constructor(e,t,i,r,o){let{container:s}=i;this._container=s,r.on("root.added",()=>{xa(P(2,Gf,{injector:o}),s)}),r.on("root.remove",()=>{xa(null,s)})}getContainer(){return this._container}};rl.$inject=["changeSupport","components","config.renderer","eventBus","injector"];var Qm={__init__:["changeSupport","components","renderer"],changeSupport:["type",il],components:["type",Kf],renderer:["type",rl]};var ol=class{constructor(e,t){this._elementRegistry=e,this._eventBus=t,this._root=null,t.on("table.clear",()=>{this.setRoot(null)})}setRoot(e){if(this._root){let t=this._root;this._eventBus.fire("root.remove",{root:t}),this._root=null,this._eventBus.fire("root.removed",{root:t})}e&&this._eventBus.fire("root.add",{root:e}),this._root=e,e&&this._eventBus.fire("root.added",{root:e})}getRoot(){return this._root||this.setRoot({id:"__implicitroot",rows:[],cols:[]}),this._root}addRow(e,t){let i=this.getRoot();if(i.cols.length!=e.cells.length)throw new Error("number of cells is not equal to number of cols");return typeof t=="undefined"&&(t=i.rows.length),Km(t,i.rows,e),e.root=i,this._elementRegistry.add(e),e.cells.forEach((r,o)=>{this._elementRegistry.add(r),r.row=e,r.col=i.cols[o],Km(t,i.cols[o].cells,r)}),this._eventBus.fire("row.add",{row:e}),e}removeRow(e){let t=this.getRoot();typeof e=="string"&&(e=this._elementRegistry.get(e));let i=t.rows.indexOf(e);i!==-1&&(Gm(i,t.rows),e.root=void 0,this._elementRegistry.remove(e),e.cells.forEach((r,o)=>{this._elementRegistry.remove(r),r.col=void 0,Gm(i,t.cols[o].cells)}),this._eventBus.fire("row.remove",{row:e}))}addCol(e,t){let i=this.getRoot();if(this._elementRegistry.add(e),i.rows.length!=e.cells.length)throw new Error("number of cells is not equal to number of rows");return typeof t=="undefined"&&(t=i.cols.length),Km(t,i.cols,e),e.root=i,e.cells.forEach((r,o)=>{this._elementRegistry.add(r),r.col=e,r.row=i.rows[o],Km(t,i.rows[o].cells,r)}),this._eventBus.fire("col.add",{col:e}),e}removeCol(e){let t=this.getRoot();typeof e=="string"&&(e=this._elementRegistry.get(e));let i=t.cols.indexOf(e);i!==-1&&(Gm(i,t.cols),e.root=void 0,this._elementRegistry.remove(e),e.cells.forEach((r,o)=>{this._elementRegistry.remove(r),r.row=void 0,Gm(i,t.rows[o].cells)}),this._eventBus.fire("col.remove",{col:e}))}resized(){this._eventBus.fire("sheet.resized")}};ol.$inject=["elementRegistry","eventBus"];function Km(n,e,t){return e.splice(n,0,t)}function Gm(n,e){return e.splice(n,1)}function Xm(n=!0){let e=typeof n=="number"?n:n?300:0;return e?t=>Nw(t,e):t=>t}Xm.$inject=["config.throttle"];var Qk={__depends__:[Qm],__init__:["elementFactory","sheet"],elementFactory:["type",As],elementRegistry:["type",nl],eventBus:["type",ut],sheet:["type",ol],throttle:["factory",Xm]};var Xf=class{constructor(e={}){let{injector:t}=e;if(!t){let{modules:i,config:r}=this._init(e);t=W3(r,i)}this.get=t.get,this.invoke=t.invoke,this.get("eventBus").fire("table.init"),this.get("eventBus").fire("diagram.init")}_init(e){let{modules:t,...i}=e;return{modules:t,config:i}}destroy(){let e=this.get("eventBus");e.fire("table.destroy"),e.fire("diagram.destroy")}clear(){let e=this.get("eventBus");e.fire("table.clear"),e.fire("diagram.clear")}};function W3(n,e){let t=[{config:["value",n]},Qk].concat(e||[]),i=new os(t);return i.init(),i}var Kk=Xf;function Ym(n){if(!n)return"<null>";let e=n.id?` id="${n.id}"`:"";return`<${n.$type}${e} />`}function zx(n,e){function t(l,c,u){var f=l.gfx;if(f)throw new Error(`already rendered ${Ym(l)}`);return n.element(l,c,u)}function i(l){return n.table(l)}function r(l){l.id||(l.id="decision");let c=l.decisionLogic;if(c){if(!c.output)throw new Error(`missing output for ${Ym(c)}`);let u=i(c);c.input&&o(c.input,u,c),o(c.output,u,c),s(c.rule,u,c)}else throw new Error(`no table for ${Ym(l)}`)}function o(l,c,u){k(l,function(f){t(f,c,u)})}function s(l,c,u){k(l,function(f){t(f,c,u),a(f.inputEntry,f),a(f.outputEntry,f)})}function a(l,c,u){k(l,function(f){t(f,c,u)})}return{handleDecision:r}}function Gk(n,e,t){let i=n.get("tableImporter"),r=n.get("eventBus"),o=n.get("sheet"),s=n.get("modeling",!1),a,l=[];function c(u){let f={create(d,p,m,g){return i.create(d,p,m,g)},table(d){return i.add(d)},element(d,p,m){return i.add(d,p,m)},error(d,p){l.push({message:d,context:p})}};new zx(f,{canAddMissingEntries:s}).handleDecision(u)}r.fire("import.render.start",{decision:e});try{c(e)}catch(u){a=u}r.fire("import.render.complete",{error:a,warnings:l}),r.fire("elements.changed",{elements:[o.getRoot()]}),t(a,l)}function U3(){return{elements:[],index:{}}}function Xk(n,e){let{elements:t,index:i}=n;return i[e]?n:{elements:[...t,e],index:{...i,[e]:!0}}}function Q3(n,e){return n.elements.join(e)}function Ro(...n){let e=U3();return n.forEach(function(t){let i=typeof t;i==="string"&&t.length>0?e=Xk(e,t):i==="object"&&t!==null&&Object.keys(t).forEach(function(r){t[r]&&(e=Xk(e,r))})}),Q3(e," ")}function Ce(n){let e=n.constructor;return Zm(e,n)}function Zm(n,e){let t=n.$inject;if(!t)return;let{injector:i}=e.context,r=[...t,function(...o){for(let s in o){let a=t[s],l=o[s];e[a]=l}}];i.invoke(r)}function Wx(n,...e){return function(...t){let i;return e.forEach(function(r){if(i=r.call(n,...t),typeof i!="undefined")return!1}),i}.bind(n)}function Ut(n,e){Object.keys(e).forEach(function(t){if(t==="$inject"||t==="__init")return;let i=e[t];t==="constructor"&&i.call(n,n.props,n.context);let r=n[t];if(typeof r!="undefined"){if(typeof r!="function")throw new Error(`failed to mixin <${t}>: cannot combine with non-fn component value`);n[t]=Wx(n,r,i)}else n[t]=i.bind(n)}),"$inject"in e&&Zm(e,n),"__init"in e&&e.__init.call(n,n.props,n.context)}var Yk={getSelectionClasses(){let{selected:n,selectedSecondary:e,focussed:t}=this.state;return Ro({selected:n,"selected-secondary":e,focussed:t})},selectionChanged(n){this.setState(n)},componentWillUpdate(n){n.elementId!==this.props.elementId&&this.updateSelectionSubscription(!1)},componentDidUpdate(n){n.elementId!==this.props.elementId&&this.updateSelectionSubscription(!0)},componentDidMount(){this.updateSelectionSubscription(!0)},componentWillUnmount(){this.updateSelectionSubscription(!1)},updateSelectionSubscription(n){let{elementId:e}=this.props;e&&e&&this.eventBus[n?"on":"off"](`selection.${e}.changed`,this.selectionChanged)}},Yf=Yk;Yk.$inject=["eventBus"];var Zf=class extends L{constructor(e,t){super(e,t),Ut(this,Yf),Ce(this)}getRenderProps(...e){let{className:t,elementId:i,coords:r,...o}=this.props,s={className:Ro(...e,this.getSelectionClasses(),t)};return i&&(s["data-element-id"]=i),r&&(s["data-coords"]=r),{...s,...o}}};var Rn=class extends Zf{constructor(e,t){super(e,t),this.state={}}render(){let{children:e}=this.props,t=this.getRenderProps("cell");return En(y(1,"td",null,e,0,{...t}))}};var Zk={slotFill(n,e){let{type:t,context:i,...r}=n,o=this.components.getComponent(t,i)||e;return o?En(P(2,o,{...i,...r})):null},slotFills(n){let{type:e,context:t,...i}=n;return this.components.getComponents(e,t).map(o=>En(P(2,o,{...t,...i})))}},xi=Zk;Zk.$inject=["components"];var Jk=400,To=class extends L{constructor(t,i){super(t,i);M(this,"onElementsChanged",()=>{this.forceUpdate()});Ut(this,xi),Ce(this)}componentDidMount(){this.changeSupport.onElementsChanged(this.getRoot(),this.onElementsChanged)}componentWillUnmount(){this.changeSupport.offElementsChanged(this.getRoot(),this.onElementsChanged)}getRoot(){return this.sheet.getRoot()}render(){let r=(this.getRoot().businessObject.get("annotationsWidth")||Jk)+"px";return y(1,"th","annotation header",[this.slotFills({type:"cell-inner",context:{cellType:"annotations",col:this.sheet.getRoot(),minWidth:Jk}}),this.translate("Annotations")],0,{style:{width:r}})}};To.$inject=["changeSupport","sheet","translate"];function Ux(n){let{row:e}=n,{id:t,description:i}=e.businessObject;return P(2,Rn,{className:"annotation",elementId:t,children:i||"-"})}function Jm(n){n.onGetComponent("cell",({cellType:e})=>{if(e==="after-label-cells")return To;if(e==="after-rule-cells")return Ux})}Jm.$inject=["components"];var eR={__init__:["annotationsProvider"],annotationsProvider:["type",Jm]};function Jf(n,e){return T({id:n.id,type:n.$type,businessObject:n},e)}var sl=class{constructor(e,t,i){this._elementFactory=e,this._eventBus=t,this._sheet=i}add(e){let t;if(O(e,"dmn:DecisionTable"))t=this._elementFactory.createRoot(Jf(e)),this._sheet.setRoot(t);else if(O(e,"dmn:InputClause"))t=this._elementFactory.createCol(Jf(e)),this._sheet.addCol(t);else if(O(e,"dmn:OutputClause"))t=this._elementFactory.createCol(Jf(e)),this._sheet.addCol(t);else if(O(e,"dmn:DecisionRule")){e.inputEntry||(e.inputEntry=[]),e.outputEntry||(e.outputEntry=[]);let i=[...e.inputEntry,...e.outputEntry].map(r=>this._elementFactory.createCell(Jf(r)));t=this._elementFactory.createRow(T(Jf(e),{cells:i})),this._sheet.addRow(t)}return this._eventBus.fire("dmnElement.added",{element:t}),t}};sl.$inject=["elementFactory","eventBus","sheet"];var tR={__depends__:[qe],tableImporter:["type",sl]};var nR={__depends__:[tR,Qm]};var eh=class extends L{constructor(t,i){super(t,i);M(this,"onElementsChanged",()=>{this.forceUpdate()});Ut(this,xi),this._sheet=i.injector.get("sheet"),this._changeSupport=i.changeSupport}componentWillMount(){let t=this._sheet.getRoot();this._changeSupport.onElementsChanged(t.id,this.onElementsChanged)}componentWillUnmount(){let t=this._sheet.getRoot();this._changeSupport.offElementsChanged(t.id,this.onElementsChanged)}render(){let t=this._sheet.getRoot();if(!O(t,"dmn:DMNElement"))return null;let i=Ke(t),r=i.input,o=i.output;return y(1,"thead",null,y(1,"tr",null,[y(1,"th","index-column"),this.slotFills({type:"cell",context:{cellType:"before-label-cells"}}),r&&r.map((s,a)=>{let l=s.width||"192px";return this.slotFill({type:"cell",context:{cellType:"input-header",input:s,index:a,inputsLength:r.length,width:l},key:s.id},K3)}),o.map((s,a)=>this.slotFill({type:"cell",context:{cellType:"output-header",output:s,index:a,outputsLength:o.length},key:s.id},G3)),this.slotFills({type:"cell",context:{cellType:"after-label-cells"}})],0),2)}};function K3(n,e){let{input:t,className:i,index:r}=n,{label:o,inputExpression:s,inputValues:a}=t,l=e.injector.get("translate"),c=(i||"")+" input-cell";return y(1,"th",c,[y(1,"div","clause",l(r===0?"When":"And"),0),o?y(1,"div","input-label",o,0,{title:l("Input label: ")+o}):y(1,"div","input-expression",s.text,0,{title:l("Input expression: ")+s.text}),y(1,"div","input-variable",a&&a.text||s.typeRef,0,{title:a&&a.text?l("Input values"):l("Input type")})],0,{"data-col-id":t.id},t.id)}function G3(n,e){let{output:t,className:i,index:r}=n,{label:o,name:s,outputValues:a,typeRef:l}=t,c=e.injector.get("translate"),u=(i||"")+" output-cell";return y(1,"th",u,[y(1,"div","clause",c(r===0?"Then":"And"),0),o?y(1,"div","output-label",o,0,{title:c("Output label")}):y(1,"div","output-name",s,0,{title:c("Output name")}),y(1,"div","output-variable",a&&a.text||l,0,{title:a&&a.text?c("Output values"):c("Output type")})],0,null,t.id)}function eg(n){n.onGetComponent("table.head",()=>eh)}eg.$inject=["components"];var iR={__init__:["decisionTableHeadProvider"],decisionTableHeadProvider:["type",eg]};var al=class extends L{constructor(e,t){super(e,t),this._translate=t.injector.get("translate"),Ce(this)}render(){let e=this.sheet.getRoot();if(!O(e,"dmn:DMNElement"))return null;let{name:t}=e.businessObject.$parent,i=this.components.getComponent("hit-policy")||X3;return y(1,"div","decision-table-properties",[y(1,"div","decision-table-name",t,0,{title:this._translate("Decision name: ")+t}),y(1,"div","decision-table-header-separator"),P(2,i)],4)}};al.$inject=["sheet","components"];function X3(){return null}var Y3=500,ll=class{constructor(e){e.onGetComponent("table.before",Y3,()=>al)}};ll.$inject=["components"];var rR={__init__:["decisionTableProperties"],decisionTableProperties:["type",ll]};var th=class extends L{render(){let{row:e,rowIndex:t}=this.props,{components:i}=this.context,r=i.getComponents("cell-inner",{cellType:"rule-index",row:e,rowIndex:t});return y(1,"td","rule-index",[r&&r.map(o=>P(2,o,{row:e,rowIndex:t})),t+1],0,{"data-element-id":e.id,"data-row-id":e.id})}};var cl=class{constructor(e){e.onGetComponent("cell",({cellType:t})=>{if(t==="before-rule-cells")return th})}};cl.$inject=["components"];var oR={__init__:["decisionRuleIndices"],decisionRuleIndices:["type",cl]};var Z3=[{label:"FEEL",value:"feel"}],ul=class{constructor(e){this._injector=e;let t=e.get("config.expressionLanguages")||{};this._config={options:Z3,defaults:{editor:"feel"}},t.options&&(this._config.options=t.options);let i=this._getLegacyDefaults();T(this._config.defaults,i,t.defaults)}getDefault(e){let{defaults:t}=this._config,i=t[e]||t.editor;return this._getLanguageByValue(i)||this.getAll()[0]}getLabel(e){let t=this._getLanguageByValue(e);return t?t.label:e}getAll(){return this._config.options}_getLegacyDefaults(){let e={},t=this._injector,i=t.get("config.defaultInputExpressionLanguage"),r=t.get("config.defaultOutputExpressionLanguage");return i&&(e.inputCell=i),r&&(e.outputCell=r),e}_getLanguageByValue(e){return ye(this.getAll(),t=>e===t.value)}};ul.$inject=["injector"];var Qt={__init__:["expressionLanguages"],expressionLanguages:["type",ul]};var fl=class{constructor(e){this._feelLanguageContext=e}getConfig(){return this._feelLanguageContext}};fl.$inject=["config.feelLanguageContext"];var Yn={__init__:["feelLanguageContext"],feelLanguageContext:["type",fl]};var nh=class extends L{render({rows:e,cols:t}){let{components:i}=this.context;return y(1,"tbody",null,e.map((r,o)=>{let s=i.getComponent("row",{rowType:"rule"});return s&&P(2,s,{row:r,rowIndex:o,cols:t},r.id)}),0)}};var ih=class extends L{constructor(e,t){super(e,t),Ut(this,xi)}render(){let{row:e,rowIndex:t,cols:i}=this.props,{cells:r}=e;return y(1,"tr",null,[this.slotFills({type:"cell",context:{cellType:"before-rule-cells",row:e,rowIndex:t}}),r.map((o,s)=>this.slotFill({type:"cell",context:{cellType:"rule",cell:o,rowIndex:t,colIndex:s},key:o.id,row:e,col:i[s]})),this.slotFills({type:"cell",context:{cellType:"after-rule-cells",row:e,rowIndex:t}})],0)}};var rh=class extends L{render(){let{cell:e,row:t,col:i}=this.props;return O(e,"dmn:UnaryTests")?P(2,Rn,{className:"input-cell",elementId:e.id,"data-row-id":t.id,"data-col-id":i.id,children:e.businessObject.text}):P(2,Rn,{className:"output-cell",elementId:e.id,"data-row-id":t.id,"data-col-id":i.id,children:e.businessObject.text})}};var hl=class{constructor(e){e.onGetComponent("table.body",()=>nh),e.onGetComponent("row",({rowType:t})=>{if(t==="rule")return ih}),e.onGetComponent("cell",({cellType:t})=>{if(t==="rule")return rh})}};hl.$inject=["components"];var tg={__depends__:[Qt,Yn],__init__:["decisionRules"],decisionRules:["type",hl]};var oh=[{label:"Unique",value:{hitPolicy:"UNIQUE",aggregation:void 0},explanation:"No overlap is possible and all rules are disjoint. Only a single rule can be matched"},{label:"First",value:{hitPolicy:"FIRST",aggregation:void 0},explanation:"Rules may overlap. The first matching rule will be chosen"},{label:"Priority",value:{hitPolicy:"PRIORITY",aggregation:void 0},explanation:"Rules may overlap. The one with the highest priority will be chosen"},{label:"Any",value:{hitPolicy:"ANY",aggregation:void 0},explanation:"Rules may overlap. Their output have to match"},{label:"Collect",value:{hitPolicy:"COLLECT",aggregation:void 0},explanation:"Collects the values of all matching rules"},{label:"Collect (Sum)",value:{hitPolicy:"COLLECT",aggregation:"SUM"},explanation:"Collects the values of all matching rules and sums up to a single value"},{label:"Collect (Min)",value:{hitPolicy:"COLLECT",aggregation:"MIN"},explanation:"Collects the values of all matching rules and uses the lowest value"},{label:"Collect (Max)",value:{hitPolicy:"COLLECT",aggregation:"MAX"},explanation:"Collects the values of all matching rules and uses the highest value"},{label:"Collect (Count)",value:{hitPolicy:"COLLECT",aggregation:"COUNT"},explanation:"Collects the values of all matching rules and counts the number of them"},{label:"Rule order",value:{hitPolicy:"RULE ORDER",aggregation:void 0},explanation:"Collects the values of all matching rules in rule order"},{label:"Output order",value:{hitPolicy:"OUTPUT ORDER",aggregation:void 0},explanation:"Collects the values of all matching rules in decreasing output priority order"}];var dl=class extends L{constructor(e,t){super(e,t),this._translate=t.injector.get("translate"),Ce(this)}getRoot(){return this.sheet.getRoot()}render(){let e=this.getRoot(),t=e.businessObject,{aggregation:i,hitPolicy:r}=t,o=ye(oh,s=>J3(s.value,{aggregation:i,hitPolicy:r}));return y(1,"div","hit-policy header",[y(1,"label","dms-label",this._translate("Hit policy:"),0),y(1,"span","hit-policy-value",this._translate(o.label),0)],4,{title:this._translate(o.explanation)})}};dl.$inject=["sheet"];function J3(n,e){return n.hitPolicy===e.hitPolicy&&n.aggregation===e.aggregation}function ng(n){n.onGetComponent("hit-policy",()=>dl)}ng.$inject=["components"];var sR={__init__:["hitPolicyProvider"],hitPolicyProvider:["type",ng]};var sh=class extends L{constructor(t,i){super(t,i);M(this,"onClick",()=>{this._eventBus.fire("showDrd")});let{injector:r}=i;this._translate=r.get("translate"),this._eventBus=r.get("eventBus")}render(){return y(1,"div","view-drd",y(1,"button","view-drd-button",this._translate("View DRD"),0,{type:"button",onClick:this.onClick}),2,null,null,t=>this.node=t)}};var pl=class{constructor(e,t,i,r){this._injector=i,this._sheet=r,e.onGetComponent("table.before",()=>{if(this.canViewDrd())return sh}),t.on("showDrd",()=>{let o=i.get("_parent",!1),s=r.getRoot(),a=aR(s);if(!a)return;let l=o.getView(a);o.open(l)})}canViewDrd(){let e=this._injector.get("_parent",!1);if(!e)return!1;let t=this._sheet.getRoot(),i=aR(t);return!!e.getView(i)}};pl.$inject=["components","eventBus","injector","sheet"];function aR(n){let{businessObject:e}=n;return e?e.$parent.$parent:void 0}var lR={__init__:["viewDrd"],viewDrd:["type",pl]};var ml=class{constructor(e){e.onGetComponent("table.before",()=>co)}};ml.$inject=["components"];var cR={__init__:["poweredBy"],poweredBy:["type",ml]};var Ao=class n extends Kk{constructor(e={}){let t=n._createContainer();super(T(e,{renderer:{container:t}})),this._container=t}open(e){var t=this;return new Promise((i,r)=>{var o;try{return t._decision&&t.clear(),t._decision=e,Gk(t,e,function(s,a){s?(s.warnings=a||[],r(s)):i({warnings:a||[]})})}catch(s){o=s}o?(o.warnings=o.warnings||[],r(o)):i({warnings:[]})})}_init(e){let{modules:t,additionalModules:i,...r}=e,o=t||this.getModules(),s=i||[],a=[{decisionTable:["value",this]}];return{modules:[cR,...o,...s,...a],config:r}}on(e,t,i,r){return this.get("eventBus").on(e,t,i,r)}off(e,t){this.get("eventBus").off(e,t)}_emit(e,t){return this.get("eventBus").fire(e,t)}attachTo(e){if(!e)throw new Error("parentNode required");this.detach();let t=this._container;e.appendChild(t),this._emit("attach",{})}detach(){let e=this._container;e.parentNode&&(this._emit("detach",{}),Qe(e))}destroy(){super.destroy(),this.detach()}getModules(){return n._getModules()}static _getModules(){return[eR,nR,qe,iR,rR,oR,tg,sR,lR]}static _createContainer(){return te('<div class="dmn-decision-table-container"></div>')}};var gl=class extends L{constructor(t,i){super(t,i);M(this,"handleClick",t=>{t.stopPropagation(),this.addRule(t.target.dataset.colIndex)});Ce(this),this.addRule=this.addRule.bind(this)}componentWillMount(){this._eventBus=this.context.injector.get("eventBus")}addRule(t){this._eventBus.fire("addRule",{colIndex:t})}render(){let{cols:t}=this.props,i=[y(1,"td","add-rule-add",y(1,"button","dmn-icon-plus action-icon",null,1,{title:this.translate("Add rule")}),2)],{businessObject:r}=this.sheet.getRoot();(!r.input||!r.input.length)&&i.push(y(1,"td","input-cell",Z("-"),2));for(let o=0;o<t.length+1;o++){let s="add-rule",a=t[o]&&t[o].businessObject,l="";a?(a.$instanceOf("dmn:InputClause")&&(s+=" input-cell",l="-"),a.$instanceOf("dmn:OutputClause")&&(s+=" output-cell")):s+=" annotation",i.push(y(1,"td",s,l,0,{"data-col-index":o}))}return y(1,"tfoot","actionable add-rule",y(1,"tr",null,i,0),2,{onClick:this.handleClick})}};gl.$inject=["sheet","translate"];var yl=class{constructor(e,t,i,r){e.onGetComponent("table.foot",()=>gl),i.on("addRule",(o,s)=>{let a=t.trigger("addRule"),l=s.colIndex;a.cells[l]?r.select(a.cells[l]):r.select(a.cells[0])})}};yl.$inject=["components","editorActions","eventBus","selection"];var vl=class{constructor(e,t,i){this._elementRegistry=e,this._eventBus=t,this._renderer=i,this._selection=void 0,t.on("diagram.clear",()=>{this._selection=void 0})}select(e){Ie(e)&&(e=this._elementRegistry.get(e));let t=this._selection;t!==e&&(this._selection=e,this._eventBus.fire("selection.changed",{oldSelection:t,selection:e}))}deselect(){let e=this._selection;this._selection=void 0,this._eventBus.fire("selection.changed",{oldSelection:e,selection:this._selection})}get(){return this._selection}hasSelection(){return!!this._selection}};vl.$inject=["elementRegistry","eventBus","renderer"];var xl=class{constructor(e,t,i,r){this._elementRegistry=e,this._renderer=i,this._selection=r,t.on(["cell.click","cell.contextmenu"],({id:o})=>{let s=e.get(o);s&&r.select(s)}),t.on("row.remove",({row:o})=>{let s=r.get();s&&o===s.row&&r.deselect()}),t.on("col.remove",({col:o})=>{let s=r.get();s&&o===s.col&&r.deselect()})}};xl.$inject=["elementRegistry","eventBus","renderer","selection"];var Mo={__init__:["selection","selectionBehavior"],selection:["type",vl],selectionBehavior:["type",xl]};function e5(n,e,t){return(e=t5(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function t5(n){var e=n5(n,"string");return typeof e=="symbol"?e:e+""}function n5(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var uR=["click","dblclick","contextmenu","mousedown","mouseup","mouseenter","mouseleave","mouseout","mouseover","mousemove","focusin","focusout","drag","dragstart","dragend","dragover","dragenter","dragleave","drop"],bl=class{constructor(e,t){e5(this,"_handleEvent",i=>{let{target:r,type:o}=i,s=i5(r);if(!s)return;let a=s.getAttribute("data-element-id");if(a){let l=this._eventBus.createEvent({id:a,event:i,node:s,target:s});this._eventBus.fire(`cell.${o}`,l),l.defaultPrevented&&i.preventDefault(),l.cancelBubble&&i.stopPropagation()}}),this._eventBus=t,this._container=e.container,t.on("table.init",()=>{this._addEventListeners(uR)}),t.on("table.destroy",()=>{this._removeEventListeners(uR)})}_addEventListeners(e){let t=this._container;e.forEach(i=>{t.addEventListener(i,this._handleEvent)})}_removeEventListeners(e){let t=this._container;e.forEach(i=>{t.removeEventListener(i,this._handleEvent)})}};bl.$inject=["config.renderer","eventBus"];function i5(n){return De(n,"[data-element-id]",!0)}var _l={__init__:["interactionEvents"],interactionEvents:["type",bl]};var Jx=Pw(hR());function r5(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Kx,dR;function o5(){if(dR)return Kx;dR=1,Kx=n;function n(e,t){return e^t}return Kx}var Gx,pR;function s5(){if(pR)return Gx;pR=1;var n=/\b(Array|Date|Object|Math|JSON)\b/g;Gx=function(o,s){var a=i(e(o));return s&&typeof s=="string"&&(s=r(s)),s?t(o,a,s):a};function e(o){return o.replace(/\.\w+|\w+ *\(|"[^"]*"|'[^']*'|\/([^/]+)\//g,"").replace(n,"").match(/[a-zA-Z_]\w*/g)||[]}function t(o,s,a){var l=/\.\w+|\w+ *\(|"[^"]*"|'[^']*'|\/([^/]+)\/|[a-zA-Z_]\w*/g;return o.replace(l,function(c){return c[c.length-1]=="("||~s.indexOf(c)?a(c):c})}function i(o){for(var s=[],a=0;a<o.length;a++)~s.indexOf(o[a])||s.push(o[a]);return s}function r(o){return function(s){return o+s}}return Gx}var Xx,mR;function a5(){if(mR)return Xx;mR=1;var n=o5(),e=s5();Xx=t;function t(r,o){if(!(this instanceof t))return new t(r,o);if(this.node=this.start=this.peeked=r,this.root=o,this.closingTag=!1,this._revisit=!0,this._selects=[],this._rejects=[],r&&this.higher(r))throw new Error("root must be a parent or ancestor to node")}t.prototype.reset=function(r){return this.node=r||this.start,this},t.prototype.revisit=function(r){return this._revisit=r==null?!0:r,this},t.prototype.opening=function(){return this.node.nodeType==1&&(this.closingTag=!1),this},t.prototype.atOpening=function(){return!this.closingTag},t.prototype.closing=function(){return this.node.nodeType==1&&(this.closingTag=!0),this},t.prototype.atClosing=function(){return this.closingTag},t.prototype.next=i("nextSibling","firstChild"),t.prototype.previous=t.prototype.prev=i("previousSibling","lastChild");function i(r,o){var s=r=="nextSibling";return function(l,c,u){l=this.compile(l),c=c&&c>0?c:1;for(var f=this.node,h=this.closingTag,d=this._revisit;f;){if(n(s,h)&&f[o])f=f[o],h=!s;else if(f.nodeType==1&&!f[o]&&n(s,h)){if(h=s,!d)continue}else if(f[r])f=f[r],h=!s;else if(f=f.parentNode,h=s,!d)continue;if(!f||this.higher(f,this.root))break;if(l(f)&&this.selects(f,u)&&this.rejects(f,u)){if(--c)continue;return u||(this.node=f),this.closingTag=h,f}}return null}}return t.prototype.select=function(r){return r=this.compile(r),this._selects.push(r),this},t.prototype.selects=function(r,o){var s=this._selects,a=s.length;if(!a)return!0;for(var l=0;l<a;l++)if(s[l].call(this,r,o))return!0;return!1},t.prototype.reject=function(r){return r=this.compile(r),this._rejects.push(r),this},t.prototype.rejects=function(r,o){var s=this._rejects,a=s.length;if(!a)return!0;for(var l=0;l<a;l++)if(s[l].call(this,r,o))return!1;return!0},t.prototype.higher=function(r){var o=this.root;if(!o)return!1;for(r=r.parentNode;r&&r!=o;)r=r.parentNode;return r!=o},t.prototype.compile=function(r){switch(typeof r){case"number":return function(o){return r==o.nodeType};case"string":return new Function("node","Object.freeze(node); return "+e(r,"node."));case"function":return r;default:return function(){return!0}}},t.prototype.peak=t.prototype.peek=function(r,o){return arguments.length==1&&(o=r,r=!0),o=o==null?1:o,o?o>0?this.next(r,o,!0):this.prev(r,Math.abs(o),!0):this.node},t.prototype.use=function(r){return r(this),this},Xx}var l5=a5(),gR=r5(l5),Zn=window.getSelection();function Zx(n){Zn==null||Zn.removeAllRanges(),Zn==null||Zn.addRange(n)}function yR(){return Zn}function c5(n){if(!(Zn!=null&&Zn.rangeCount))return null;var e=Zn.focusNode;return ig(e)&&(e=e.parentNode),n==e||n.contains(e)}function rg(n,e){var t=u5(n,e);Zx(t)}function wl(n){if(!c5(n))return null;var e=Zn.getRangeAt(0),t=e.startContainer,i=e.endContainer,r=e.startOffset,o=e.endOffset,s=gR(n.firstChild,n),a=s.node,l,c=!1,u,f=0;function h(p,m){return arguments.length===1&&(m=p),p.parentNode===i&&m==i.childNodes[o]}function d(p,m){return arguments.length===1&&(m=p),p.parentNode===t&&m==t.childNodes[r]}for(;a&&(d(a)&&!c&&(u=f),!(h(a)||Yx(a)&&i===a));){if(c||(Yx(a)||l&&l.nextSibling==a&&(vR(a)||xR(a)))&&f++,ig(a)){if(t===a&&(u=f+r),i===a){f+=o;break}f+=a.textContent.length}if((ig(a)||c)&&(d(a,a.nextSibling)&&(u=f),h(a,a.nextSibling)))break;l=a,a=s.next(),c=s.closingTag}return{start:typeof u=="undefined"?f:u,end:f}}function u5(n,e){for(var t=e.start,i=e.end,r=document.createRange(),o=gR(n.firstChild,n),s=o.node,a=!1,l=0,c;s;){if(l===t&&(a?r.setStartAfter(s):r.setStartBefore(s)),l===i)return a?r.setEndAfter(s):r.setEndBefore(s),r;if(a||(Yx(s)||s.previousSibling&&(vR(s)||xR(s)))&&l++,ig(s)){if(c=s.textContent.length,l<=t&&l+c>t&&r.setStart(s,t-l),l+c>i)return r.setEnd(s,i-l),r;l+=c}s=o.next(),a=o.closingTag}return l<=t&&(n.lastChild?r.setStartAfter(n.lastChild):r.setStart(n,0)),n.lastChild?r.setEndAfter(n.lastChild):r.setEnd(n,0),r}function ig(n){return n.nodeType===3}function Yx(n){return n.nodeType===1&&n.nodeName==="BR"}function vR(n){return n.nodeType===1&&n.nodeName==="DIV"}function xR(n){return n.nodeType===1&&n.nodeName==="P"}var f5="[contenteditable]",h5="[data-element-id]";function ah(n){return n.getAttribute("data-element-id")}function bR(n){let e=n.getAttribute("data-coords");if(!e)return null;let[t,i]=e.split(":");return{row:t,col:i}}function _R(n,e){let t=`${n.row}:${n.col}`;return X(`[data-coords="${(0,Jx.default)(t)}"]`,e)}function Gi(n,e){return X(`[data-element-id="${(0,Jx.default)(n)}"]`,e)}function wR(n){return De(n,".no-deselect",!0)}function lh(n){return De(n,h5,!0)}function e0(n){let e=f5;return hr(n,e)?n:X(e,n)}function CR(n){let e=e0(n);if(!e||!document.body.contains(e)||document.activeElement===e)return;e.focus();let t=wl(e);(!t||t.end===0)&&window.getSelection().setPosition(e.firstChild,e.firstChild.length)}var t0=500,d5={above:!0,below:!0,right:!0,left:!0};function og(n,e,t,i,r){let{container:o}=n,s=null;function a(h,d){e.fire("selection."+h+".changed",d),e.fire("cellSelection.changed",{elementId:h,selection:d})}function l(h){let d=h.target;if(wR(d))return;let p=lh(d),m=p&&ah(p),g=!h.defaultPrevented;f(m,g)}function c(h){let d=ah(h.target),p=!h.defaultPrevented;return h.stopPropagation(),f(d,p)}function u(h){let d=ah(h.target);a(d,{focussed:!1})}function f(h,d=!0){s!==h&&a(s,{selected:!1,focussed:!1}),s=h,h&&a(h,{selected:!0,focussed:d}),h?i.select(h):i.deselect()}e.on("cell.click",t0,l),e.on("cell.focusin",t0,c),e.on("cell.focusout",t0,u),e.on("cellSelection.changed",function(h){let{elementId:d,selection:p}=h,m=Gi(d,o);p.focussed&&m&&CR(m)}),e.on("selection.changed",function(h){let{selection:d,oldSelection:p}=h;var m=d&&d.id,g=p&&p.id;m&&m!==s?f(d.id):g&&g===s&&f()}),this.isCellSelected=function(){return!!s},this.getCellSelection=function(){return s},this.selectCell=function(h){if(!s)return;if(!(h in d5))throw new Error("direction must be any of { above, below, left, right }");var d=Gi(s,o);let p=bR(d);if(!p)return!1;let m=p5(p,h),g=_R(m,o);if(!g)return!1;let b=ah(g);return b&&f(b,{focussed:!0,selected:!0}),!0},e.on("contextMenu.close",function(){if(s)return f(s)})}og.$inject=["config.renderer","eventBus","sheet","selection","elementRegistry"];function p5(n,e){let{row:t,col:i}=n;if(e==="above"||e==="below"){let r=parseInt(t,10);if(isNaN(r))return n;let o=e==="above"?r-1:r+1;return{col:i,row:o}}if(e==="left"||e==="right"){let r=parseInt(i,10);if(isNaN(r))return n;let o=e==="left"?r-1:r+1;return{row:t,col:o}}throw new Error("invalid direction <"+e+">")}var Po={__depends__:[_l,Mo],__init__:["cellSelection"],cellSelection:["type",og]};function Ms(){}Ms.prototype.get=function(){return this._data};Ms.prototype.set=function(n){this._data=n};Ms.prototype.clear=function(){var n=this._data;return delete this._data,n};Ms.prototype.isEmpty=function(){return!this._data};var sg={clipboard:["type",Ms]};var n0=2e3,Cl=class extends Vi{constructor(e,t){super(e),this._sheet=t}init(){this.addRule("col.move",n0,({col:e,index:t})=>{let{businessObject:i}=this._sheet.getRoot(),{input:r}=i;return ie(e)?t<r.length:t>=r.length}),this.addRule("col.remove",n0,({col:e})=>{let{cols:t}=this._sheet.getRoot();return Te(e)?t.filter(i=>Te(i)).length>1:!0}),this.addRule("paste",n0,({data:e,target:t})=>{if(!e||!t)return!1;let{root:i}=e;return t instanceof pt?this.canPasteRows(i):t instanceof mt?this.canPasteCols(i,t):!1})}canPasteRows(e){let{cols:t}=this._sheet.getRoot();return kt(e,i=>i.type!=="row"||i.cells.length!==t.length?!1:kt(i.cells,(r,o)=>ie(t[o])?r.businessObject.$type==="dmn:UnaryTests":r.businessObject.$type==="dmn:LiteralExpression"))}canPasteCols(e,t){let{rows:i}=this._sheet.getRoot();return kt(e,r=>r.type!=="col"||r.cells.length!==i.length?!1:ie(t)?r.businessObject.$type==="dmn:InputClause":r.businessObject.$type==="dmn:OutputClause")}};Cl.$inject=["eventBus","sheet"];var ER={__depends__:[yn]};var El={__depends__:[ER],__init__:["decisionTableModelingRules"],decisionTableModelingRules:["type",Cl]};var Sl=class{constructor(e,t,i){this._clipboard=e,this._modeling=t,this._sheet=i}execute(e){let{data:t}=e;return e.oldData=this._clipboard.get(),this._clipboard.set(t),this._sheet.getRoot()}postExecute(e){let{elements:t}=e;t.forEach(i=>{i instanceof pt?this._modeling.removeRow(i):i instanceof mt&&this._modeling.removeCol(i)})}revert(e){let{oldData:t}=e;return this._clipboard.set(t),this._sheet.getRoot()}};Sl.$inject=["clipboard","modeling","sheet"];var m5=[x5,b5],g5=[S5,E5];function ag(n,e,t){return t=t||m5,e=e||{},F(n)?y5(n,e,t):SR(n,e,t)}function y5(n,e,t){return st(n,(i,r)=>{var o=i.descriptorCache,s=i.root;let{root:a,descriptorCache:l}=SR(r,o,t);return{root:[...s,a],descriptorCache:{...o,...l}}},{root:[],descriptorCache:e})}function SR(n,e,t){var i=n.id,r={id:i},o=e.elements||{},s=o[i];if(s)return{root:s,descriptorCache:e};let a=v5(n,r,t,{...e,elements:o});return{root:a.root,descriptorCache:{...a.descriptorCache,elements:{...a.descriptorCache.elements,[i]:a.root}}}}function v5(n,e,t,i){function r(o,s){return ag(o,s,t)}return st(t,function(o,s){return s(n,o.root,o.descriptorCache,r)},{root:e,descriptorCache:i})}function x5(n,e,t,i){var r=t,o={...e,type:_5(n)};if(n instanceof pt||n instanceof mt){let s=i(n.cells,r);o.cells=s.root,r=s.descriptorCache}return{root:o,descriptorCache:r}}function b5(n,e,t){var i=n.businessObject;if(!i)return{root:e,descriptorCache:t};var r=i0(i,t);return{root:{...e,businessObject:r.root},descriptorCache:r.descriptorCache}}function _5(n){if(n instanceof pt)return"row";if(n instanceof mt)return"col";if(n instanceof ko)return"cell";throw new Error("cannot deduce element type: #"+n.id)}function i0(n,e){var t,i,r=n.id;if(r&&(t=e.boCache||{},i=t[r],i))return{root:i,descriptorCache:e};var o={$type:n.$type};return r&&(o.id=r,t={...t,[r]:o},e={...e,boCache:t}),n.$descriptor.properties.forEach(function(s){var a=n[s.name];if(a){if(F(a)&&(a=a.map(l=>{var c=i0(l,e);return e=c.descriptorCache,c.root})),a.$type){let l=i0(a,e);e=l.descriptorCache,a=l.root}o[s.name]=a}}),{root:o,descriptorCache:e}}function o0(n,e,t){return t=t||g5,e=e||{},F(n.root)?w5(n,e,t):OR(n,e,t)}function w5(n,e,t){let i=n.root,r=n.descriptorCache;return st(i,(o,s)=>{var a=o.reviveCache,l=o.root;let{root:c,reviveCache:u}=OR({root:s,descriptorCache:r},a,t);return{root:[...l,c],reviveCache:u}},{root:[],reviveCache:e})}function OR(n,e,t){var i=n.root,r=i.id,o=e.elements||{},s=o[r];if(s)return{root:s,reviveCache:e};var a={id:r};let l=C5(n,a,t,{...e,elements:o});return{root:l.root,reviveCache:{...l.reviveCache,elements:{...l.reviveCache.elements,[r]:l.root}}}}function C5(n,e,t,i){function r(o,s){return o0(o,s,t)}return st(t,function(o,s){return s(n,o.root,o.reviveCache,r)},{root:e,reviveCache:i})}function E5(n,e,t,i){var r=n.root,o=n.descriptorCache,s={...e};if(e.businessObject&&e.businessObject.id&&(s.id=e.businessObject.id),r.type==="row"||r.type==="col"){let c=i({root:r.cells,descriptorCache:o},t);s.cells=c.root,t=c.reviveCache}var a=O5(r),l=new a(s);return l instanceof pt?l.cells.forEach(c=>{c.row=l}):l instanceof mt&&l.cells.forEach(c=>{c.col=l}),{root:l,reviveCache:t}}function S5(n,e,t){var i=n.root.businessObject;if(!i)return{root:e,reviveCache:t};var r=r0({root:i,descriptorCache:n.descriptorCache},t);return{root:{...e,businessObject:r.root},reviveCache:r.reviveCache}}function O5(n){switch(n.type){case"row":return pt;case"cell":return ko;case"col":return mt;default:throw new Error("unknown element type: #"+n.type)}}function r0(n,e){var t=n.root,i=t.id;let r,o;if(i&&(r=e.boCache||{},o=r[i],o))return{root:o,reviveCache:e};var s={};di(t).forEach(c=>{let u,f;t[c].$type?(f=r0({root:t[c]},e),u=f.root,e=f.reviveCache,r=e.boCache||{}):F(t[c])?u=t[c].map(h=>(f=r0({root:h},e),e=f.reviveCache,r=e.boCache||{},f.root)):u=t[c],s[c]=u});let a=s.$type;delete s.$type,(!e._keepIds||e._model.ids.assigned(s.id))&&delete s.id;var l=e._dmnFactory.create(a,s);return k(s,c=>{c.$type&&(c.$parent=l),F(c)&&c.forEach(u=>u.$parent=l)}),i&&(r={...r,[i]:l},e={...e,boCache:r}),{root:l,reviveCache:e}}var Ol=class{constructor(e,t,i,r,o,s,a,l){this._clipboard=e,this._dmnFactory=t,this._elementFactory=i,this._elementRegistry=r,this._eventBus=o,this._model=s,this._modeling=a,this._sheet=l}postExecute(e){let{element:t,after:i}=e,r=this._clipboard.get();if(!r)throw new Error("missing clipboard data");let o=this._sheet.getRoot(),s=o0(r.elements,{_dmnFactory:this._dmnFactory,_keepIds:r.keepIds,_model:this._model}).root;if(t instanceof pt){let a=o.rows.indexOf(t);if(a===-1)return;s.forEach(l=>{i&&a++,this._modeling.addRow(l,a)})}else if(t instanceof mt){let a=o.cols.indexOf(t);if(a===-1)return;s.forEach(l=>{i&&a++,this._modeling.addCol(l,a)})}return e.oldElements=this._clipboard.get(),this._sheet.getRoot()}revert(e){}};Ol.$inject=["clipboard","dmnFactory","elementFactory","elementRegistry","eventBus","moddle","modeling","sheet"];var kl=class{constructor(e,t,i,r,o,s){this._clipboard=e,this._commandStack=t,this._eventBus=i,this._modeling=r,this._sheet=o,this._rules=s,t.registerHandler("cut",Sl),t.registerHandler("paste",Ol)}copy(e){F(e)||(e=[e]);let t={elements:ag(e)};this._eventBus.fire("copyCutPaste.copy",{data:t}),this._clipboard.set(t)}cut(e){F(e)||(e=[e]);let t={elements:ag(e),keepIds:!0},i={elements:e,data:t};this._eventBus.fire("copyCutPaste.cut",{data:t}),this._commandStack.execute("cut",i)}pasteBefore(e){return this._paste(e,{before:!0})}pasteAfter(e){return this._paste(e,{after:!0})}_paste(e,t){let i=this._clipboard.get();return i?this._rules.allowed("paste",{data:i.elements,target:e})?(this._commandStack.execute("paste",{element:e,...t}),this._clipboard.clear(),!0):!1:void 0}pasteAt(e){}};kl.$inject=["clipboard","commandStack","eventBus","modeling","sheet","rules"];var lg={__depends__:[sg,El],__init__:["copyCutPaste"],copyCutPaste:["type",kl]};var Rl=class{constructor(e,t,i,r,o,s){let a={addRule(){return i.addRow({type:"dmn:DecisionRule"})},addRuleAbove(l){let c=l&&l.rule;if(!c&&!r.hasSelection())return;c=c||r.get().row;let u=s.getRoot(),f=u.rows.indexOf(c);if(f!==-1)return i.addRow({type:"dmn:DecisionRule"},f)},addRuleBelow(l){let c=l&&l.rule;if(!c&&!r.hasSelection())return;c=c||r.get().row;let u=s.getRoot(),f=u.rows.indexOf(c);if(f!==-1)return i.addRow({type:"dmn:DecisionRule"},f+1)},removeRule(l){let c=l&&l.rule;!c&&!r.hasSelection()||(c=c||r.get().row,i.removeRow(c))},addInput(){let l=s.getRoot(),c=l.businessObject,{input:u}=c;return i.addCol({type:"dmn:InputClause"},u?u.length:0)},addInputLeft(l){let c=l&&l.input;if(!c&&!r.hasSelection())return;c=c||r.get().col;let u=s.getRoot(),f=u.cols.indexOf(c);if(f!==-1)return i.addCol({type:"dmn:InputClause"},f)},addInputRight(l){let c=l&&l.input;if(!c&&!r.hasSelection())return;c=c||r.get().col;let u=s.getRoot(),f=u.cols.indexOf(c);if(f!==-1)return i.addCol({type:"dmn:InputClause"},f+1)},removeInput(l){let c=l&&l.input;!c&&!r.hasSelection()||(c=c||r.get().col,i.removeCol(c))},addOutput(){let l=s.getRoot(),c=l.businessObject,u=c.get("input"),f=c.get("output");return i.addCol({type:"dmn:OutputClause"},u.length+f.length)},addOutputLeft(l){let c=l&&l.output;if(!c&&!r.hasSelection())return;c=c||r.get().col;let u=s.getRoot(),f=u.cols.indexOf(c);if(f!==-1)return i.addCol({type:"dmn:OutputClause"},f)},addOutputRight(l){let c=l&&l.output;if(!c&&!r.hasSelection())return;c=c||r.get().col;let u=s.getRoot(),f=u.cols.indexOf(c);if(f!==-1)return i.addCol({type:"dmn:OutputClause"},f+1)},removeOutput(l){let c=l&&l.output;!c&&!r.hasSelection()||(c=c||r.get().col,i.removeCol(c))},addClause(){if(!r.hasSelection())return;let l=r.get().col;if(O(l,"dmn:InputClause"))return a.addInput({input:l});if(O(l,"dmn:OutputClause"))return a.addOutput({output:l})},addClauseLeft(){if(!r.hasSelection())return;let l=r.get().col;if(O(l,"dmn:InputClause"))return a.addInputLeft({input:l});if(O(l,"dmn:OutputClause"))return a.addOutputLeft({output:l})},addClauseRight(){if(!r.hasSelection())return;let l=r.get().col;if(O(l,"dmn:InputClause"))return a.addInputRight({input:l});if(O(l,"dmn:OutputClause"))return a.addOutputRight({output:l})},removeClause(){if(!r.hasSelection())return;let l=r.get().col;if(O(l,"dmn:InputClause"))return a.removeInput({input:l});if(O(l,"dmn:OutputClause"))return a.removeOutput({output:l})},selectCellAbove(){return o.selectCell("above")},selectCellBelow(){return o.selectCell("below")},copy({element:l}){e.copy(l)},cut({element:l}){e.cut(l)},pasteBefore({element:l}){return e.pasteBefore(l)},pasteAfter({element:l}){return e.pasteAfter(l)}};t.register(a)}};Rl.$inject=["copyCutPaste","editorActions","modeling","selection","cellSelection","sheet"];var kR="is not a registered action",k5="is already registered",Tl=class{constructor(e,t,i,r){this._actions={undo(){e.undo()},redo(){e.redo()},select({cell:o}){r.select(o)},deselect(){r.deselect()},addRow({attrs:o,index:s}){i.addRow(o,s)},removeRow({row:o}){i.removeRow(o)},moveRow({row:o,index:s}){i.moveRow(o,s)},addCol({attrs:o,index:s}){i.addCol(o,s)},removeCol({col:o}){i.removeCol(o)},moveCol({col:o,index:s}){i.moveCol(o,s)}}}trigger(e,t){if(!this._actions[e])throw s0(e,kR);return this._actions[e](t)}register(e,t){if(typeof e=="string")return this._registerAction(e,t);k(e,(i,r)=>{this._registerAction(r,i)},this)}_registerAction(e,t){if(this.isRegistered(e))throw s0(e,k5);this._actions[e]=t}unregister(e){if(!this.isRegistered(e))throw s0(e,kR);this._actions[e]=void 0}isRegistered(e){return!!this._actions[e]}};Tl.$inject=["commandStack","eventBus","modeling","selection"];function s0(n,e){return new Error(n+" "+e)}var cg={__depends__:[Mo],__init__:["editorActions"],editorActions:["type",Tl]};var Jn={__depends__:[Po,lg,cg,Mo],__init__:["decisionTableEditorActions"],decisionTableEditorActions:["type",Rl]};var RR={__depends__:[Jn],__init__:["addRule"],addRule:["type",yl]};var PR=Pw(AR());function MR(n,e,t){var i=n.start,r=i,o=e.substring(i);t.lastIndexOf(o)===t.length-o.length&&(e=e.substring(0,e.length-o.length),t=t.substring(0,t.length-o.length));var s=A5(e,t);return s&&(s.type==="remove"?r=s.newStart:r=s.newEnd),M5(r)}function A5(n,e){var t,i,r,o=0,s,a,l=0;for(e.length>n.length?(i=e,s=n):(i=n,s=e);o<i.length;)r=i.charAt(o),a=s.charAt(l),r!==a?(t||(t={l_start:o,s_start:l}),o++):(t&&!t.complete&&(t.l_end=o,t.s_end=l,t.complete=!0),l++,o++);if(t&&!t.complete&&(t.complete=!0,t.s_end=s.length,t.l_end=i.length),!!t)return e.length>n.length?{newStart:t.l_start,newEnd:t.l_end,type:"add"}:{newStart:t.s_start,newEnd:t.s_end,type:e.length<n.length?"remove":"replace"}}function M5(n,e){return{start:n,end:e===void 0?n:e}}var Tn=class extends L{constructor(t,i){super(t,i);M(this,"onFocus",t=>{var i=this.props.onFocus;this.setState({focussed:!0}),typeof i=="function"&&i(t)});M(this,"onBlur",t=>{let{onBlur:i,onChange:r,value:o}=this.props;if(this.setState({focussed:!1}),typeof r=="function"&&this.node){let s=ug(this.node);s!==o&&r(s)}typeof i=="function"&&i(t)});M(this,"onkeydown",t=>{if(t.which===13){if(t.preventDefault(),this.props.ctrlForNewline&&!I5(t)||this.props.singleLine)return;t.stopPropagation(),D5(),this.onInput(t)}});M(this,"onInput",t=>{var i=this.props.onInput;if(typeof i=="function"){var r=ug(this.node);i(r)}});M(this,"onPaste",t=>{if(this.props.singleLine){let i=(t.clipboardData||window.clipboardData).getData("text");document.execCommand("insertText",!1,i.replace(/\n/g," ")),t.preventDefault()}});this.state={}}componentWillUpdate(t,i){var r=this.node,o=i.focussed&&wl(r);this.selected=o&&{range:o,text:ug(r)}}componentDidUpdate(){var t=this.selected;if(!t)return;let i=t.range,r=t.text,o=this.node,s=ug(o),a=s!==r?MR(i,r,s):i;rg(o,a)}getClassName(){let{className:t,placeholder:i,value:r}=this.props;return[t||"","content-editable",!r&&i?"placeholder":""].join(" ")}render(t){var{label:i,value:r,placeholder:o}=t;return r=(0,PR.default)(r).replace(/\r?\n/g,"<br/>")+"<br/>",y(1,"div",this.getClassName(),null,1,{"aria-label":i,role:"textbox","aria-multiline":!this.props.singleLine,tabIndex:"0",contentEditable:"true",spellCheck:"false","data-placeholder":o||"",onInput:this.onInput,onkeypress:this.onkeypress,onPaste:this.onPaste,onFocus:this.onFocus,onBlur:this.onBlur,onkeydown:this.onkeydown,dangerouslySetInnerHTML:{__html:r}},null,s=>this.node=s)}};function P5(){return document.createElement("br")}function ug(n){return n.innerText.replace(/\n$/,"")}function D5(){var n=yR(),e=n.getRangeAt(0);if(e){var t=e.cloneRange(),i=P5();t.deleteContents(),t.insertNode(i),t.setStartAfter(i),t.setEndAfter(i),Zx(t)}}function I5(n){return n.metaKey||n.ctrlKey}var an=class extends L{constructor(t,i){super(t,i);M(this,"onFocus",t=>{this.setState({focussed:!0});var{onFocus:i}=this.props;typeof i=="function"&&i(t)});M(this,"onBlur",t=>{this.setState({focussed:!1});let{invalid:i}=this.state;i&&this.setState({changing:!1,invalid:!1});let{onBlur:r}=this.props;typeof r=="function"&&r(t)});this.state={changing:!1,focussed:!1};let{injector:r}=i,o=r.get("debounceInput");this.inputChanged=o(s=>{let{onChange:a}=this.props;typeof a=="function"&&a(s);let l=this.state.changing;this.setState({changing:l===s?!1:l})}),this.onInput=s=>{var a=this.props.validate||function(){},l=a(s);this.setState({changing:s,invalid:l}),l||this.inputChanged(s)}}getClassName(){var{className:t,value:i}=this.props,{changing:r,focussed:o,invalid:s}=this.state;return t+=" editable",o&&(t+=" focussed"),s&&(t+=" invalid"),!i&&!r&&(t+=" empty"),t}getDisplayValue(){var{value:t,placeholder:i}=this.props,{focussed:r,changing:o}=this.state;return typeof o=="string"&&(t=o),t||(t=r?"":i||""),t}getEditor(t={}){return P(2,Tn,{className:t.className,ctrlForNewline:this.props.ctrlForNewline,label:this.props.label,onFocus:this.onFocus,onBlur:this.onBlur,onInput:this.onInput,value:this.getDisplayValue()})}};var Al=class extends L{constructor(t,i){super(t,i);M(this,"onElementsChanged",()=>{this.forceUpdate()});M(this,"setAnnotationValue",t=>{let{row:i}=this.props;this.modeling.editAnnotation(i.businessObject,t)});Ce(this)}componentWillMount(){let{row:t}=this.props;this.changeSupport.onElementsChanged(t.id,this.onElementsChanged)}componentWillUnmount(){let{row:t}=this.props;this.changeSupport.offElementsChanged(t.id,this.onElementsChanged)}render(){let{row:t,rowIndex:i}=this.props,{description:r,id:o}=t.businessObject;return P(2,Rn,{className:"annotation",onChange:this.setAnnotationValue,coords:`${i}:annotation`,value:r,elementId:o,"data-row-id":t.id,children:P(2,a0,{label:this.translate("Annotation"),ctrlForNewline:!0,className:"annotation-editor",onChange:this.setAnnotationValue,value:r})})}};Al.$inject=["changeSupport","modeling","translate"];var a0=class extends an{render(){return y(1,"div",this.getClassName(),this.getEditor(),0)}};function fg(n){n.onGetComponent("cell",({cellType:e})=>{if(e==="after-label-cells")return To;if(e==="after-rule-cells")return Al})}fg.$inject=["components"];var L5=300;function hg(n){return function(t){if(n!==!1){var i=se(n)?n:L5;return Mi(t,i)}else return t}}hg.$inject=["config.debounceInput"];var Kt={debounceInput:["factory",hg]};var DR={__depends__:[Kt],__init__:["annotationsProvider"],annotationsProvider:["type",fg]};function Ps(n,e,t){return(e=B5(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function B5(n){var e=N5(n,"string");return typeof e=="symbol"?e:e+""}function N5(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var $5={position:"absolute"},Ml=class extends L{constructor(e,t){super(e,t),Ps(this,"open",({position:i,context:r})=>{this.close(),this.setState({isOpen:!0,position:i||{x:0,y:0},context:r||{}})}),Ps(this,"close",()=>{this.state.isOpen&&this.setState({context:void 0,isOpen:!1,position:{x:0,y:0}})}),Ps(this,"triggerClose",()=>{this.eventBus.fire("contextMenu.close")}),this.state={isOpen:!1,position:{x:0,y:0}},Ce(this)}componentDidMount(){this.eventBus.on("contextMenu.open",this.open),this.eventBus.on("contextMenu.close",this.close)}componentWillUnmount(){this.eventBus.off("contextMenu.open",this.open),this.eventBus.off("contextMenu.close",this.close)}render(){let{isOpen:e,context:t,position:i}=this.state;if(!e)return null;let r=this.components.getComponents("context-menu",t);return r.length?P(2,dg,{className:"context-menu no-deselect",context:t,position:i,offset:t.offset||{x:0,y:0},autoFocus:t.autoFocus!==!1,autoClose:t.autoClose!==!1,components:r,onClose:this.triggerClose}):null}};Ml.$inject=["eventBus","components"];var dg=class extends L{constructor(e,t){super(e,t),Ps(this,"onGlobalMouseDown",i=>{this.checkClose(i.target)}),Ps(this,"onGlobalKey",i=>{var r=i.which;(r===13||r===27)&&(i.stopPropagation(),i.preventDefault(),this.close())}),Ps(this,"onFocusChanged",i=>{this.checkClose(i.target)}),Ps(this,"setNode",i=>{this.node=i;let{autoFocus:r}=this.props;i&&(this.updatePosition(),r&&F5(i))}),Ce(this)}close(){let{onClose:e}=this.props;ge(e)&&e()}checkClose(e){let{autoClose:t}=this.props;if(t){var i=this.node;i&&i!==e&&(i.contains(e)||this.close())}}componentDidMount(){document.addEventListener("focusin",this.onFocusChanged),document.addEventListener("keydown",this.onGlobalKey),document.addEventListener("mousedown",this.onGlobalMouseDown)}componentWillUnmount(){document.removeEventListener("focusin",this.onFocusChanged),document.removeEventListener("keydown",this.onGlobalKey),document.removeEventListener("mousedown",this.onGlobalMouseDown)}updatePosition(){let{position:e,offset:t}=this.props,{node:i}=this,r=i.getBoundingClientRect();e.width||(e.width=0),e.height||(e.height=0);let o=this.renderer.getContainer(),s=o.getBoundingClientRect();s.width>s.height?(this.node.classList.add("horizontal"),this.node.classList.remove("vertical")):(this.node.classList.add("vertical"),this.node.classList.remove("horizontal"));let{scrollLeft:a,scrollTop:l}=q5(i),c={},u;e.align&&(u=e.align.split("-"));let f,h;(u&&u[1]||(e.x+e.width/2>s.width/2?"left":"right"))==="left"?(f=e.x-s.left-r.width+t.x+a,i.classList.remove("right"),i.classList.add("left")):(f=-s.left+e.x+e.width-t.x+a,i.classList.remove("left"),i.classList.add("right")),f=u?f:IR(f,0+a,s.width-r.width+a),c.left=f+"px",(u&&u[0]||(e.y+e.height/2>s.height/2?"top":"bottom"))==="top"?(h=e.y-s.top-r.height+t.y+l,i.classList.remove("bottom"),i.classList.add("top")):(h=-s.top+e.y-t.y+l,i.classList.remove("top"),i.classList.add("bottom")),h=u?h:IR(h,0+l,s.height-r.height+l),c.top=h+"px",c.overflowY="auto",c.maxHeight=s.height-h+l+"px",T(this.node.style,$5,c)}render(){let{context:e,components:t,className:i}=this.props;return y(1,"div",i,t.map((r,o)=>P(2,r,{context:e},o)),0,{onContextMenu:r=>r.preventDefault()},null,this.setNode)}};dg.$inject=["renderer"];function IR(n,e,t){return Math.max(e,Math.min(t,n))}var j5=` 214 `,pk={width:135,height:46},mk={width:100,height:63};function Dx(n,e,t){return Q("path",{d:n,strokeWidth:2,transform:`translate(${e.x}, ${e.y})`,...t})}var Dm=5;function Ya(n,e){thi global() property [all...] |
| /plugin/bpmnio/vendor/bpmn-js/dist/ |
| H A D | bpmn-modeler.production.min.js | 282 </svg>`},cd=zT;N();var GT=900;function to(e,t,n,r){this._distributeElements=t,this._translate=n,this._popupMenu=e,this._rules=r,e.registerProvider("align-elements",GT,this)}to.$inject=["popupMenu","distributeElements","translate","rules"];to.prototype.getPopupMenuEntries=function(e){var t={};return this._isAllowed(e)&&C(t,this._getEntries(e)),t};to.prototype._isAllowed=function(e){return this._rules.allowed("elements.distribute",{elements:e})};to.prototype._getEntries=function(e){var t=this._distributeElements,n=this._translate,r=this._popupMenu,i={"distribute-elements-horizontal":{group:"distribute",title:n("Distribute elements horizontally"),className:"bjs-align-elements-menu-entry",imageHtml:cd.horizontal,action:function(o,a){t.trigger(e,"horizontal"),r.close()}},"distribute-elements-vertical":{group:"distribute",title:n("Distribute elements vertically"),imageHtml:cd.vertical,action:function(o,a){t.trigger(e,"vertical"),r.close()}}};return i};var gb={__depends__:[Do,vb],__init__:["bpmnDistributeElements","distributeElementsMenuProvider"],bpmnDistributeElements:["type",ha],distributeElementsMenuProvider:["type",to]};N();var yb="is not a registered action",VT="is already registered";function Zt(e,t){this._eventBus=e,this._actions={};var n=this;e.on("diagram.init",function(){n._registerDefaultActions(t),e.fire("editorActions.init",{editorActions:n})})}Zt.$inject=["eventBus","injector"];Zt.prototype._registerDefaultActions=function(e){var t=e.get("commandStack",!1),n=e.get("modeling",!1),r=e.get("selection",!1),i=e.get("zoomScroll",!1),o=e.get("copyPaste",!1),a=e.get("canvas",!1),s=e.get("rules",!1),c=e.get("keyboardMove",!1),u=e.get("keyboardMoveSelection",!1);t&&(this.register("undo",function(){t.undo()}),this.register("redo",function(){t.redo()})),o&&r&&this.register("copy",function(){var p=r.get();if(p.length)return o.copy(p)}),o&&r&&this.register("duplicate",function(){var p=r.get();if(p.length)return o.duplicate(p)}),o&&this.register("paste",function(){o.paste()}),o&&r&&s&&this.register("cut",function(){var p=r.get();if(p.length){var l=s.allowed("elements.delete",{elements:p});if(l!==!1){var f=q(l)?l:p;return o.cut(f.slice())}}}),i&&this.register("stepZoom",function(p){i.stepZoom(p.value)}),a&&this.register("zoom",function(p){a.zoom(p.value)}),n&&r&&s&&this.register("removeSelection",function(){var p=r.get();if(p.length){var l=s.allowed("elements.delete",{elements:p}),f;l!==!1&&(q(l)?f=l:f=p,f.length&&n.removeElements(f.slice()))}}),c&&this.register("moveCanvas",function(p){c.moveCanvas(p)}),u&&this.register("moveSelection",function(p){u.moveSelection(p.direction,p.accelerated)})};Zt.prototype.trigger=function(e,t){if(!this._actions[e])throw ud(e,yb);var n=this._eventBus.fire("editorActions.allowed",{action:e,opts:t});if(n!==!1)return this._actions[e](t)};Zt.prototype.register=function(e,t){var n=this;if(typeof e=="string")return this._registerAction(e,t);E(e,function(r,i){n._registerAction(i,r)})};Zt.prototype._registerAction=function(e,t){if(this.isRegistered(e))throw ud(e,VT);this._actions[e]=t};Zt.prototype.unregister=function(e){if(!this.isRegistered(e))throw ud(e,yb);this._actions[e]=void 0};Zt.prototype.getActions=function(){return Object.keys(this._actions)};Zt.prototype.isRegistered=function(e){return!!this._actions[e]};function ud(e,t){return new Error(e+" "+t)}var _b={__init__:["editorActions"],editorActions:["type",Zt]};N();function va(e){e.invoke(Zt,this)}B(va,Zt);va.$inject=["injector"];va.prototype._registerDefaultActions=function(e){Zt.prototype._registerDefaultActions.call(this,e);var t=e.get("canvas",!1),n=e.get("elementRegistry",!1),r=e.get("selection",!1),i=e.get("spaceTool",!1),o=e.get("lassoTool",!1),a=e.get("handTool",!1),s=e.get("globalConnect",!1),c=e.get("distributeElements",!1),u=e.get("alignElements",!1),p=e.get("directEditing",!1),l=e.get("searchPad",!1),f=e.get("modeling",!1),d=e.get("contextPad",!1);t&&n&&r&&this._registerAction("selectElements",function(){var m=t.getRootElement(),g=n.filter(function(v){return v!==m});return r.select(g),g}),i&&this._registerAction("spaceTool",function(){i.toggle()}),o&&this._registerAction("lassoTool",function(){o.toggle()}),a&&this._registerAction("handTool",function(){a.toggle()}),s&&this._registerAction("globalConnectTool",function(){s.toggle()}),r&&c&&this._registerAction("distributeElements",function(m){var g=r.get(),v=m.type;g.length&&c.trigger(g,v)}),r&&u&&this._registerAction("alignElements",function(m){var g=r.get(),v=[],w=m.type;g.length&&(v=Q(g,function(S){return!h(S,"bpmn:Lane")}),u.trigger(v,w))}),r&&f&&this._registerAction("setColor",function(m){var g=r.get();g.length&&f.setColor(g,m)}),r&&p&&this._registerAction("directEditing",function(){var m=r.get();m.length&&p.activate(m[0])}),l&&this._registerAction("find",function(){l.toggle()}),t&&f&&this._registerAction("moveToOrigin",function(){var m=t.getRootElement(),g,v;h(m,"bpmn:Collaboration")?v=n.filter(function(w){return h(w.parent,"bpmn:Collaboration")}):v=n.filter(function(w){return w!==m&&!h(w.parent,"bpmn:SubProcess")}),g=Ce(v),f.moveElements(v,{x:-g.x,y:-g.y},m)}),r&&d&&this._registerAction("replaceElement",function(m){d.triggerEntry("replace","click",m)})};var bb={__depends__:[_b],editorActions:["type",va]};function $p(e){e.on(["create.init","shape.move.init"],function(t){var n=t.context,r=t.shape;te(r,["bpmn:Participant","bpmn:SubProcess","bpmn:TextAnnotation"])&&(n.gridSnappingContext||(n.gridSnappingContext={}),n.gridSnappingContext.snapLocation="top-left")})}$p.$inject=["eventBus"];N();function Lr(e,t){k.call(this,e),this._gridSnapping=t;var n=this;this.preExecute("shape.resize",function(r){var i=r.context,o=i.hints||{},a=o.autoResize;if(a){var s=i.shape,c=i.newBounds;st(a)?i.newBounds=n.snapComplex(c,a):i.newBounds=n.snapSimple(s,c)}})}Lr.$inject=["eventBus","gridSnapping","modeling"];B(Lr,k);Lr.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};Lr.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};Lr.prototype.snapHorizontally=function(e,t){var n=this._gridSnapping,r=/w/.test(t),i=/e/.test(t),o={};return o.width=n.snapValue(e.width,{min:e.width}),i&&(r?(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),C(e,o),e};Lr.prototype.snapVertically=function(e,t){var n=this._gridSnapping,r=/n/.test(t),i=/s/.test(t),o={};return o.height=n.snapValue(e.height,{min:e.height}),r&&(i?(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),C(e,o),e};var WT=2e3;function zp(e,t){e.on(["spaceTool.move","spaceTool.end"],WT,function(n){var r=n.context;if(r.initialized){var i=r.axis,o;i==="x"?(o=t.snapValue(n.dx),n.x=n.x+o-n.dx,n.dx=o):(o=t.snapValue(n.dy),n.y=n.y+o-n.dy,n.dy=o)}})}zp.$inject=["eventBus","gridSnapping"];var xb={__init__:["gridSnappingResizeBehavior","gridSnappingSpaceToolBehavior"],gridSnappingResizeBehavior:["type",Lr],gridSnappingSpaceToolBehavior:["type",zp]};N();var ic=10;function Gp(e,t,n){return n||(n="round"),Math[n](e/t)*t}var UT=1200,qT=800;function mr(e,t,n){var r=!n||n.active!==!1;this._eventBus=t;var i=this;t.on("diagram.init",qT,function(){i.setActive(r)}),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"],UT,function(o){var a=o.originalEvent;if(!(!i.active||a&&xt(a))){var s=o.context,c=s.gridSnappingContext;c||(c=s.gridSnappingContext={}),["x","y"].forEach(function(u){var p={},l=YT(o,u,e);l&&(p.offset=l);var f=KT(o,u);f&&C(p,f),zn(o,u)||i.snapEvent(o,u,p)})}})}mr.prototype.snapEvent=function(e,t,n){var r=this.snapValue(e[t],n);ze(e,t,r)};mr.prototype.getGridSpacing=function(){return ic};mr.prototype.snapValue=function(e,t){var n=0;t&&t.offset&&(n=t.offset),e+=n,e=Gp(e,ic);var r,i;return t&&t.min&&(r=t.min,ne(r)&&(r=Gp(r+n,ic,"ceil"),e=Math.max(e,r))),t&&t.max&&(i=t.max,ne(i)&&(i=Gp(i+n,ic,"floor"),e=Math.min(e,i))),e-=n,e};mr.prototype.isActive=function(){return this.active};mr.prototype.setActive=function(e){this.active=e,this._eventBus.fire("gridSnapping.toggle",{active:e})};mr.prototype.toggleActive=function(){this.setActive(!this.active)};mr.$inject=["elementRegistry","eventBus","config.gridSnapping"];function KT(e,t){var n=e.context,r=n.createConstraints,i=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;r&&(Vp(t)?(a.x.min=r.left,a.x.max=r.right):(a.y.min=r.top,a.y.max=r.bottom));var c=i.min,u=i.max;return c&&(Vp(t)?wb(s)?a.x.max=c.left:a.x.min=c.right:Eb(s)?a.y.max=c.top:a.y.min=c.bottom),u&&(Vp(t)?wb(s)?a.x.min=u.left:a.x.max=u.right:Eb(s)?a.y.min=u.top:a.y.max=u.bottom),a[t]}function YT(e,t,n){var r=e.context,i=e.shape,o=r.gridSnappingContext,a=o.snapLocation,s=o.snapOffset;return s&&ne(s[t])||(s||(s=o.snapOffset={}),ne(s[t])||(s[t]=0),!i)||(n.get(i.id)||(Vp(t)?s[t]+=i[t]+i.width/2:s[t]+=i[t]+i.height/2),!a)||(t==="x"?/left/.test(a)?s[t]-=i.width/2:/right/.test(a)&&(s[t]+=i.width/2):/top/.test(a)?s[t]-=i.height/2:/bottom/.test(a)&&(s[t]+=i.height/2)),s[t]}function Vp(e){return e==="x"}function Eb(e){return e.indexOf("n")!==-1}function wb(e){return e.indexOf("w")!==-1}var Sb={__depends__:[xb],__init__:["gridSnapping"],gridSnapping:["type",mr]};var XT=2e3;function Wp(e,t,n){e.on("autoPlace",XT,function(r){var i=r.source,o=X(i),a=r.shape,s=Au(i,a,n);return["x","y"].forEach(function(c){var u={};s[c]!==o[c]&&(s[c]>o[c]?u.min=s[c]:u.max=s[c],h(a,"bpmn:TextAnnotation")&&(ZT(c)?u.offset=-a.width/2:u.offset=-a.height/2),s[c]=t.snapValue(s[c],u))}),s})}Wp.$inject=["eventBus","gridSnapping","elementRegistry"];function ZT(e){return e==="x"}var QT=1750;function Up(e,t,n){t.on(["create.start","shape.move.start"],QT,function(r){var i=r.context,o=i.shape,a=e.getRootElement();if(!(!h(o,"bpmn:Participant")||!h(a,"bpmn:Process")||!a.children.length)){var s=i.createConstraints;s&&(o.width=n.snapValue(o.width,{min:o.width}),o.height=n.snapValue(o.height,{min:o.height}))}})}Up.$inject=["canvas","eventBus","gridSnapping"];N();var JT=3e3;function ga(e,t,n){k.call(this,e),this._gridSnapping=t;var r=this;this.postExecuted(["connection.create","connection.layout"],JT,function(i){var o=i.context,a=o.connection,s=o.hints||{},c=a.waypoints;s.connectionStart||s.connectionEnd||s.createElementsBehavior===!1||eM(c)&&n.updateWaypoints(a,r.snapMiddleSegments(c))})}ga.$inject=["eventBus","gridSnapping","modeling"];B(ga,k);ga.prototype.snapMiddleSegments=function(e){var t=this._gridSnapping,n;e=e.slice();for(var r=1;r<e.length-2;r++)n=rM(t,e[r],e[r+1]),e[r]=n[0],e[r+1]=n[1];return e};function eM(e){return e.length>3}function tM(e){return e==="h"}function nM(e){return e==="v"}function rM(e,t,n){var r=en(t,n),i={};return tM(r)&&(i.y=e.snapValue(t.y)),nM(r)&&(i.x=e.snapValue(t.x)),("x"in i||"y"in i)&&(t=C({},t,i),n=C({},n,i)),[t,n]}var Cb={__init__:["gridSnappingAutoPlaceBehavior","gridSnappingParticipantBehavior","gridSnappingLayoutConnectionBehavior"],gridSnappingAutoPlaceBehavior:["type",Wp],gridSnappingParticipantBehavior:["type",Up],gridSnappingLayoutConnectionBehavior:["type",ga]};var Rb={__depends__:[Sb,Cb],__init__:["bpmnGridSnapping"],bpmnGridSnapping:["type",$p]};var iM=30,Pb=30;function no(e,t){this._interactionEvents=t;var n=this;e.on(["interactionEvents.createHit","interactionEvents.updateHit"],function(r){var i=r.element,o=r.gfx;if(h(i,"bpmn:Lane"))return n._createParticipantHit(i,o);if(h(i,"bpmn:Participant"))return ie(i)?n._createParticipantHit(i,o):n._createDefaultHit(i,o);if(h(i,"bpmn:SubProcess"))return ie(i)?n._createSubProcessHit(i,o):n._createDefaultHit(i,o)})}no.$inject=["eventBus","interactionEvents"];no.prototype._createDefaultHit=function(e,t){return this._interactionEvents.removeHits(t),this._interactionEvents.createDefaultHit(e,t),!0};no.prototype._createParticipantHit=function(e,t){this._interactionEvents.removeHits(t),this._interactionEvents.createBoxHit(t,"no-move",{width:e.width,height:e.height}),this._interactionEvents.createBoxHit(t,"click-stroke",{width:e.width,height:e.height});var n=Me(e)?{width:iM,height:e.height}:{width:e.width,height:Pb};return this._interactionEvents.createBoxHit(t,"all",n),!0};no.prototype._createSubProcessHit=function(e,t){return this._interactionEvents.removeHits(t),this._interactionEvents.createBoxHit(t,"no-move",{width:e.width,height:e.height}),this._interactionEvents.createBoxHit(t,"click-stroke",{width:e.width,height:e.height}),this._interactionEvents.createBoxHit(t,"all",{width:e.width,height:Pb}),!0};var Ab={__init__:["bpmnInteractionEvents"],bpmnInteractionEvents:["type",no]};function ya(e){e.invoke(Mr,this)}B(ya,Mr);ya.$inject=["injector"];ya.prototype.registerBindings=function(e,t){Mr.prototype.registerBindings.call(this,e,t);function n(r,i){t.isRegistered(r)&&e.addListener(i)}n("selectElements",function(r){var i=r.keyEvent;if(e.isKey(["a","A"],i)&&e.isCmd(i))return t.trigger("selectElements"),!0}),n("find",function(r){var i=r.keyEvent;if(e.isKey(["f","F"],i)&&e.isCmd(i))return t.trigger("find"),!0}),n("spaceTool",function(r){var i=r.keyEvent;if(!e.hasModifier(i)&&e.isKey(["s","S"],i))return t.trigger("spaceTool"),!0}),n("lassoTool",function(r){var i=r.keyEvent;if(!e.hasModifier(i)&&e.isKey(["l","L"],i))return t.trigger("lassoTool"),!0}),n("handTool",function(r){var i=r.keyEvent;if(!e.hasModifier(i)&&e.isKey(["h","H"],i))return t.trigger("handTool"),!0}),n("globalConnectTool",function(r){var i=r.keyEvent;if(!e.hasModifier(i)&&e.isKey(["c","C"],i))return t.trigger("globalConnectTool"),!0}),n("directEditing",function(r){var i=r.keyEvent;if(!e.hasModifier(i)&&e.isKey(["e","E"],i))return t.trigger("directEditing"),!0}),n("replaceElement",function(r){var i=r.keyEvent;if(!e.hasModifier(i)&&e.isKey(["r","R"],i))return t.trigger("replaceElement",i),!0})};var Tb={__depends__:[wo],__init__:["keyboardBindings"],keyboardBindings:["type",ya]};N();var oM={moveSpeed:1,moveSpeedAccelerated:10},aM=1500,Mb="left",Db="up",kb="right",Nb="down",sM={ArrowLeft:Mb,Left:Mb,ArrowUp:Db,Up:Db,ArrowRight:kb,Right:kb,ArrowDown:Nb,Down:Nb},cM={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 qp(e,t,n,r,i){var o=this;this._config=C({},oM,e||{}),t.addListener(aM,function(a){var s=a.keyEvent,c=sM[s.key];if(c&&!t.isCmd(s)){var u=t.isShift(s);return o.moveSelection(c,u),!0}}),this.moveSelection=function(a,s){var c=i.get();if(c.length){var u=this._config[s?"moveSpeedAccelerated":"moveSpeed"],p=cM[a](u),l=r.allowed("elements.move",{shapes:c,hints:{keyboardMove:!0}});l&&n.moveElements(c,p)}}}qp.$inject=["config.keyboardMoveSelection","keyboard","modeling","rules","selection"];var Ob={__depends__:[wo,rt],__init__:["keyboardMoveSelection"],keyboardMoveSelection:["type",qp]};N();var Bb=10;function ro(e,t,n,r){this._dragging=r,this._rules=t;var i=this;function o(c,u){var p=c.shape,l=c.direction,f=c.resizeConstraints,d;c.delta=u,d=Ng(p,l,u),c.newBounds=Bg(d,f),c.canExecute=i.canResize(c)}function a(c){var u=c.resizeConstraints,p=c.minBounds;u===void 0&&(p===void 0&&(p=i.computeMinResizeBox(c)),c.resizeConstraints={min:Z(p)})}function s(c){var u=c.shape,p=c.canExecute,l=c.newBounds;if(p){if(l=wc(l),!uM(u,l))return;n.resizeShape(u,l)}}e.on("resize.start",function(c){a(c.context)}),e.on("resize.move",function(c){var u={x:c.dx,y:c.dy};o(c.context,u)}),e.on("resize.end",function(c){s(c.context)})}ro.prototype.canResize=function(e){var t=this._rules,n=mt(e,["newBounds","shape","delta","direction"]);return t.allowed("shape.resize",n)};ro.prototype.activate=function(e,t,n){var r=this._dragging,i,o;if(typeof n=="string"&&(n={direction:n}),i=C({shape:t},n),o=i.direction,!o)throw new Error("must provide a direction (n|w|s|e|nw|se|ne|sw)");r.init(e,pd(t,o),"resize",{autoActivate:!0,cursor:pM(o),data:{shape:t,context:i}})};ro.prototype.computeMinResizeBox=function(e){var t=e.shape,n=e.direction,r,i;return r=e.minDimensions||{width:Bb,height:Bb},i=tp(t,e.childrenBoxPadding),Ig(n,t,r,i)};ro.$inject=["eventBus","rules","modeling","dragging"];function uM(e,t){return e.x!==t.x||e.y!==t.y||e.width!==t.width||e.height!==t.height}function pd(e,t){var n=X(e),r=Z(e),i={x:n.x,y:n.y};return t.indexOf("n")!==-1?i.y=r.top:t.indexOf("s")!==-1&&(i.y=r.bottom),t.indexOf("e")!==-1?i.x=r.right:t.indexOf("w")!==-1&&(i.x=r.left),i}function pM(e){var t="resize-";return e==="n"||e==="s"?t+"ns":e==="e"||e==="w"?t+"ew":e==="nw"||e==="se"?t+"nwse":t+"nesw"}var Ib="djs-resizing",Lb="resize-not-ok",lM=500;function Kp(e,t,n){function r(o){var a=o.shape,s=o.newBounds,c=o.frame;c||(c=o.frame=n.addFrame(a,t.getActiveLayer()),t.addMarker(a,Ib)),s.width>5&&$(c,{x:s.x,width:s.width}),s.height>5&&$(c,{y:s.y,height:s.height}),o.canExecute?pe(c).remove(Lb):pe(c).add(Lb)}function i(o){var a=o.shape,s=o.frame;s&&Pe(o.frame),t.removeMarker(a,Ib)}e.on("resize.move",lM,function(o){r(o.context)}),e.on("resize.cleanup",function(o){i(o.context)})}Kp.$inject=["eventBus","canvas","previewSupport"];N();var Yp=-6,Xp=8,Zp=20,oc="djs-resizer",fM=["n","w","s","e","nw","ne","se","sw"];function hr(e,t,n,r){this._resize=r,this._canvas=t;var i=this;e.on("selection.changed",function(o){var a=o.newSelection;i.removeResizers(),a.length===1&&E(a,tt(i.addResizer,i))}),e.on("shape.changed",function(o){var a=o.element;n.isSelected(a)&&(i.removeResizers(),i.addResizer(a))})}hr.prototype.makeDraggable=function(e,t,n){var r=this._resize;function i(o){gn(o)&&r.activate(o,e,n)}se.bind(t,"mousedown",i),se.bind(t,"touchstart",i)};hr.prototype._createResizer=function(e,t,n,r){var i=this._getResizersParent(),o=dM(r),a=U("g");pe(a).add(oc),pe(a).add(oc+"-"+e.id),pe(a).add(oc+"-"+r),J(i,a);var s=U("rect");$(s,{x:-Xp/2+o.x,y:-Xp/2+o.y,width:Xp,height:Xp}),pe(s).add(oc+"-visual"),J(a,s);var c=U("rect");return $(c,{x:-Zp/2+o.x,y:-Zp/2+o.y,width:Zp,height:Zp}),pe(c).add(oc+"-hit"),J(a,c),fo(a,t,n),a};hr.prototype.createResizer=function(e,t){var n=pd(e,t),r=this._createResizer(e,n.x,n.y,t);this.makeDraggable(e,r,t)};hr.prototype.addResizer=function(e){var t=this;de(e)||E(fM,function(n){t._resize.canResize({shape:e,direction:n})&&t.createResizer(e,n)})};hr.prototype.removeResizers=function(){var e=this._getResizersParent();_r(e)};hr.prototype._getResizersParent=function(){return this._canvas.getLayer("resizers")};hr.$inject=["eventBus","canvas","selection","resize"];function dM(e){var t={x:0,y:0};return e.indexOf("e")!==-1?t.x=-Yp:e.indexOf("w")!==-1&&(t.x=Yp),e.indexOf("s")!==-1?t.y=-Yp:e.indexOf("n")!==-1&&(t.y=Yp),t}var Qp={__depends__:[Et,kt,Dn],__init__:["resize","resizePreview","resizeHandles"],resize:["type",ro],resizePreview:["type",Kp],resizeHandles:["type",hr]};N();var mM=2e3;function io(e,t,n,r,i,o,a){this._bpmnFactory=t,this._canvas=n,this._modeling=i,this._textRenderer=a,r.registerProvider(this),e.on("element.dblclick",function(c){s(c.element,!0)}),e.on(["autoPlace.start","canvas.viewbox.changing","drag.init","element.mousedown","popupMenu.open","root.set","selection.changed"],function(){r.isActive()&&r.complete()}),e.on(["shape.remove","connection.remove"],mM,function(c){r.isActive(c.element)&&r.cancel()}),e.on(["commandStack.changed"],function(c){r.isActive()&&r.cancel()}),e.on("directEditing.activate",function(c){o.removeResizers()}),e.on("create.end",500,function(c){var u=c.context,p=u.shape,l=c.context.canExecute,f=c.isTouch;f||l&&(u.hints&&u.hints.createElementsBehavior===!1||s(p))}),e.on("autoPlace.end",500,function(c){s(c.shape)});function s(c,u){(u||te(c,["bpmn:Activity","bpmn:Event","bpmn:TextAnnotation","bpmn:Participant"]))&&r.activate(c)}}io.$inject=["eventBus","bpmnFactory","canvas","directEditing","modeling","resizeHandles","textRenderer"];io.prototype.activate=function(e){var t=gt(e);if(t!==void 0){var n={text:t},r=this.getEditingBBox(e);C(n,r);var i={},o=n.style||{};return C(o,{backgroundColor:null,border:null}),(te(e,["bpmn:Task","bpmn:Participant","bpmn:Lane","bpmn:CallActivity"])||jb(e))&&C(i,{centerVertically:!0}),mn(e)&&(C(i,{resizable:!0,autoResize:!0}),C(o,{backgroundColor:"#ffffff",border:"1px solid #ccc"})),h(e,"bpmn:TextAnnotation")&&(C(i,{resizable:!0,autoResize:!0}),C(o,{backgroundColor:"#ffffff",border:"1px solid #ccc"})),C(n,{options:i,style:o}),n}};io.prototype.getEditingBBox=function(e){var t=this._canvas,n=e.label||e,r=t.getAbsoluteBBox(n),i={x:r.x+r.width/2,y:r.y+r.height/2},o={x:r.x,y:r.y},a=t.zoom(),s=this._textRenderer.getDefaultStyle(),c=this._textRenderer.getExternalStyle(),u=c.fontSize*a,p=c.lineHeight,l=s.fontSize*a,f=s.lineHeight,d={fontFamily:this._textRenderer.getDefaultStyle().fontFamily,fontWeight:this._textRenderer.getDefaultStyle().fontWeight};if(h(e,"bpmn:Lane")||gM(e)){var m=Me(e),g=m?{width:r.height,height:30*a,x:r.x-r.height/2+15*a,y:i.y-30*a/2}:{width:r.width,height:30*a};C(o,g),C(d,{fontSize:l+"px",lineHeight:f,paddingTop:7*a+"px",paddingBottom:7*a+"px",paddingLeft:5*a+"px",paddingRight:5*a+"px",transform:m?"rotate(-90deg)":null})}if(vM(e)){var v=Me(e),w=v?{width:r.width,height:r.height}:{width:r.height,height:r.width,x:i.x-r.height/2,y:i.y-r.width/2};C(o,w),C(d,{fontSize:l+"px",lineHeight:f,paddingTop:7*a+"px",paddingBottom:7*a+"px",paddingLeft:5*a+"px",paddingRight:5*a+"px",transform:v?null:"rotate(-90deg)"})}(te(e,["bpmn:Task","bpmn:CallActivity"])||jb(e))&&(C(o,{width:r.width,height:r.height}),C(d,{fontSize:l+"px",lineHeight:f,paddingTop:7*a+"px",paddingBottom:7*a+"px",paddingLeft:5*a+"px",paddingRight:5*a+"px"})),hM(e)&&(C(o,{width:r.width,x:r.x}),C(d,{fontSize:l+"px",lineHeight:f,paddingTop:7*a+"px",paddingBottom:7*a+"px",paddingLeft:5*a+"px",paddingRight:5*a+"px"}));var S=1,x=r.width+2*S;if(n.labelTarget&&(C(o,{width:x,height:r.height+2*S,x:r.x-S,y:r.y-S}),C(d,{fontSize:u+"px",lineHeight:p})),mn(n)&&!Xr(n)&&!ee(n)){var b=La(e),R=t.getAbsoluteBBox({x:b.x,y:b.y,width:0,height:0}),A=u,O=ir.width*a+2*S;C(o,{width:O,height:A+2*S,x:R.x-O/2,y:R.y-A/2-S}),C(d,{fontSize:u+"px",lineHeight:p})}return h(e,"bpmn:TextAnnotation")&&(C(o,{width:r.width+2*S,height:r.height+2*S,x:r.x-S,y:r.y-S,minWidth:30*a,minHeight:10*a}),C(d,{textAlign:"left",paddingTop:wr*a+"px",paddingBottom:wr*a+"px",paddingLeft:wr*a+"px",paddingRight:wr*a+"px",fontSize:l+"px",lineHeight:f})),{bounds:o,style:d}};io.prototype.update=function(e,t,n,r){var i,o;h(e,"bpmn:TextAnnotation")&&(o=this._canvas.getAbsoluteBBox(e),i={x:e.x,y:e.y,width:e.width/o.width*r.width,height:e.height/o.height*r.height}),yM(t)&&(t=null),this._modeling.updateLabel(e,t,i)};function jb(e){return h(e,"bpmn:SubProcess")&&!ie(e)}function hM(e){return h(e,"bpmn:SubProcess")&&ie(e)}function vM(e){return h(e,"bpmn:Participant")&&!ie(e)}function gM(e){return h(e,"bpmn:Participant")&&ie(e)}function yM(e){return!e||!e.trim()}var Fb="djs-element-hidden",Hb="djs-label-hidden";function Jp(e,t,n){var r=this,i=t.getDefaultLayer(),o,a,s;e.on("directEditing.activate",function(c){var u=c.active;if(o=u.element.label||u.element,h(o,"bpmn:TextAnnotation")){a=t.getAbsoluteBBox(o),s=U("g");var p=n.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:o.width,containerHeight:o.height,position:{mx:0,my:0}}),l=r.path=U("path");$(l,{d:p,strokeWidth:2,stroke:_M(o)}),J(s,l),J(i,s),Fe(s,o.x,o.y)}h(o,"bpmn:TextAnnotation")||o.labelTarget?t.addMarker(o,Fb):(h(o,"bpmn:Task")||h(o,"bpmn:CallActivity")||h(o,"bpmn:SubProcess")||h(o,"bpmn:Participant")||h(o,"bpmn:Lane"))&&t.addMarker(o,Hb)}),e.on("directEditing.resize",function(c){if(h(o,"bpmn:TextAnnotation")){var u=c.height,p=c.dy,l=Math.max(o.height/a.height*(u+p),0),f=n.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:o.width,containerHeight:l,position:{mx:0,my:0}});$(r.path,{d:f})}}),e.on(["directEditing.complete","directEditing.cancel"],function(c){var u=c.active;u&&(t.removeMarker(u.element.label||u.element,Fb),t.removeMarker(o,Hb)),o=void 0,a=void 0,s&&(Pe(s),s=void 0)})}Jp.$inject=["eventBus","canvas","pathMap"];function _M(e,t){var n=ce(e);return n.get("stroke")||t||"black"}var $b={__depends__:[xo,Qp,Hp],__init__:["labelEditingProvider","labelEditingPreview"],labelEditingProvider:["type",io],labelEditingPreview:["type",Jp]};N();var bM=500,xM=1e3;function jr(e,t){this._eventBus=e,this.offset=5;var n=t.cls("djs-outline",["no-fill"]),r=this;function i(o){var a=U("rect");return $(a,C({x:0,y:0,rx:4,width:100,height:100},n)),a}e.on(["shape.added","shape.changed"],bM,function(o){var a=o.element,s=o.gfx,c=_e(".djs-outline",s);c||(c=r.getOutline(a)||i(s),J(s,c)),r.updateShapeOutline(c,a)}),e.on(["connection.added","connection.changed"],function(o){var a=o.element,s=o.gfx,c=_e(".djs-outline",s);c||(c=i(s),J(s,c)),r.updateConnectionOutline(c,a)})}jr.prototype.updateShapeOutline=function(e,t){var n=!1,r=this._getProviders();r.length&&E(r,function(i){n=n||i.updateOutline(t,e)}),n||$(e,{x:-this.offset,y:-this.offset,width:t.width+this.offset*2,height:t.height+this.offset*2})};jr.prototype.updateConnectionOutline=function(e,t){var n=Ce(t);$(e,{x:n.x-this.offset,y:n.y-this.offset,width:n.width+this.offset*2,height:n.height+this.offset*2})};jr.prototype.registerProvider=function(e,t){t||(t=e,e=xM),this._eventBus.on("outline.getProviders",e,function(n){n.providers.push(t)})};jr.prototype._getProviders=function(){var e=this._eventBus.createEvent({type:"outline.getProviders",providers:[]});return this._eventBus.fire(e),e.providers};jr.prototype.getOutline=function(e){var t,n=this._getProviders();return E(n,function(r){Le(r.getOutline)&&(t=t||r.getOutline(e))}),t};jr.$inject=["eventBus","styles","elementRegistry"];N();var el=6;function ac(e,t,n){this._canvas=t;var r=this;e.on("element.changed",function(i){n.isSelected(i.element)&&r._updateMultiSelectionOutline(n.get())}),e.on("selection.changed",function(i){var o=i.newSelection;r._updateMultiSelectionOutline(o)})}ac.prototype._updateMultiSelectionOutline=function(e){var t=this._canvas.getLayer("selectionOutline");_r(t);var n=e.length>1,r=this._canvas.getContainer();if(pe(r)[n?"add":"remove"]("djs-multi-select"),!!n){var i=EM(Ce(e)),o=U("rect");$(o,C({rx:3},i)),pe(o).add("djs-selection-outline"),J(t,o)}};ac.$inject=["eventBus","canvas","selection"];function EM(e){return{x:e.x-el,y:e.y-el,width:e.width+el*2,height:e.height+el*2}}var _a={__depends__:[rt],__init__:["outline","multiSelectionOutline"],outline:["type",jr],multiSelectionOutline:["type",ac]};var zb=["bpmn:Event","bpmn:SequenceFlow","bpmn:Gateway"],Gb={class:"bjs-label-link",stroke:"var(--element-selected-outline-secondary-stroke-color)",strokeDasharray:"5, 5"},wM=15,tl=2;function nl(e,t,n,r,i){let o=t.getLayer("overlays");e.on(["selection.changed","shape.changed"],function(){s()}),e.on("selection.changed",function({newSelection:l}){var d;let f=l.filter(m=>te(m,zb));if(f.length===1){let m=f[0];ee(m)?a(m,m.labelTarget,l):(d=m.labels)!=null&&d.length&&a(m.labels[0],m,l)}if(f.length===2){let m=f.find(ee),g=f.find(v=>{var w;return(w=v.labels)==null?void 0:w.includes(m)});m&&g&&a(m,g,l)}}),e.on("shape.changed",function({element:l}){var f;!te(l,zb)||!p(l)||(ee(l)?a(l,l.labelTarget,i.get()):(f=l.labels)!=null&&f.length&&a(l.labels[0],l,i.get()))});function a(l,f,d=[]){let m=Xn([X(f),X(l)],Gb),g=m.getAttribute("d"),w=d.includes(l)?c(l):u(l),S=qr(w,g);if(!S)return;let b=d.includes(f)?c(f):u(f),R=qr(b,g)||X(f);Li(R,S)<wM||(Pa(m,[R,S]),J(o,m))}function s(){xi(`.${Gb.class}`,o).forEach(Pe)}function c(l){let f=r.getOutline(l),d=r.offset;if(!f)return u(l);if(f.x){let m={x:l.x+oo(f,"x")-tl,y:l.y+oo(f,"y")-tl,width:oo(f,"width")+tl*2,height:oo(f,"height")+tl*2};return ja(m,oo(f,"rx"))}if(f.cx){let m={x:l.x-d,y:l.y-d,width:oo(f,"r")*2,height:oo(f,"r")*2};return Bc(m)}}function u(l){return n.getShapePath(l)}function p(l){return i.get().includes(l)}}nl.$inject=["eventBus","canvas","graphicsFactory","outline","selection"];function oo(e,t){return parseFloat($(e,t)||0)}var Vb={__depends__:[rt,_a],__init__:["labelLink"],labelLink:["type",nl]};N();var SM=new or("tt");function CM(e){var t=ue('<div class="djs-tooltip-container" />');return vt(t,{position:"absolute",width:"0",height:"0"}),e.insertBefore(t,e.firstChild),t}function RM(e,t,n){vt(e,{left:t+"px",top:n+"px"})}function fd(e,t){e.style.display=t===!1?"none":""}var Wb="djs-tooltip",ld="."+Wb;function It(e,t){this._eventBus=e,this._canvas=t,this._ids=SM,this._tooltipDefaults={show:{minZoom:.7,maxZoom:5}},this._tooltips={},this._tooltipRoot=CM(t.getContainer());var n=this;bt.bind(this._tooltipRoot,ld,"mousedown",function(r){r.stopPropagation()}),bt.bind(this._tooltipRoot,ld,"mouseover",function(r){n.trigger("mouseover",r)}),bt.bind(this._tooltipRoot,ld,"mouseout",function(r){n.trigger("mouseout",r)}),this._init()}It.$inject=["eventBus","canvas"];It.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=C({},this._tooltipDefaults,e,{id:t}),this._addTooltip(e),e.timeout&&this.setTimeout(e),t};It.prototype.trigger=function(e,t){var n=t.delegateTarget||t.target,r=this.get(nt(n,"data-tooltip-id"));r&&(e==="mouseover"&&r.timeout&&this.clearTimeout(r),e==="mouseout"&&r.timeout&&(r.timeout=1e3,this.setTimeout(r)))};It.prototype.get=function(e){return typeof e!="string"&&(e=e.id),this._tooltips[e]};It.prototype.clearTimeout=function(e){if(e=this.get(e),!!e){var t=e.removeTimer;t&&(clearTimeout(t),e.removeTimer=null)}};It.prototype.setTimeout=function(e){if(e=this.get(e),!!e){this.clearTimeout(e);var t=this;e.removeTimer=setTimeout(function(){t.remove(e)},e.timeout)}};It.prototype.remove=function(e){var t=this.get(e);t&&(Wt(t.html),Wt(t.htmlContainer),delete t.htmlContainer,delete this._tooltips[t.id])};It.prototype.show=function(){fd(this._tooltipRoot)};It.prototype.hide=function(){fd(this._tooltipRoot,!1)};It.prototype._updateRoot=function(e){var t=e.scale||1,n=e.scale||1,r="matrix("+t+",0,0,"+n+","+-1*e.x*t+","+-1*e.y*n+")";this._tooltipRoot.style.transform=r,this._tooltipRoot.style["-ms-transform"]=r};It.prototype._addTooltip=function(e){var t=e.id,n=e.html,r,i=this._tooltipRoot;n.get&&n.constructor.prototype.jquery&&(n=n.get(0)),st(n)&&(n=ue(n)),r=ue('<div data-tooltip-id="'+t+'" class="'+Wb+'">'),vt(r,{position:"absolute"}),r.appendChild(n),e.type&&Ne(r).add("djs-tooltip-"+e.type),e.className&&Ne(r).add(e.className),e.htmlContainer=r,i.appendChild(r),this._tooltips[t]=e,this._updateTooltip(e)};It.prototype._updateTooltip=function(e){var t=e.position,n=e.htmlContainer;RM(n,t.x,t.y)};It.prototype._updateTooltipVisibilty=function(e){E(this._tooltips,function(t){var n=t.show,r=t.htmlContainer,i=!0;n&&((n.minZoom>e.scale||n.maxZoom<e.scale)&&(i=!1),fd(r,i))})};It.prototype._init=function(){var e=this;function t(n){e._updateRoot(n),e._updateTooltipVisibilty(n),e.show()}this._eventBus.on("canvas.viewbox.changing",function(n){e.hide()}),this._eventBus.on("canvas.viewbox.changed",function(n){t(n.viewbox)})};var Ub={__init__:["tooltips"],tooltips:["type",It]};var PM="flow elements must be children of pools/participants",AM="Data object must be placed within a pool/participant.";function rl(e,t,n){function r(i,o,a){t.add({position:{x:i.x+5,y:i.y+5},type:"error",timeout:a||2e3,html:"<div>"+o+"</div>"})}e.on(["shape.move.rejected","create.rejected"],function(i){var o=i.context,a=o.shape,s=o.target;h(s,"bpmn:Collaboration")&&(h(a,"bpmn:FlowNode")?r(i,n(PM)):h(a,"bpmn:DataObjectReference")&&r(i,n(AM)))})}rl.$inject=["eventBus","tooltips","translate"];var qb={__depends__:[Ub],__init__:["modelingFeedback"],modelingFeedback:["type",rl]};N();var TM=500,MM=1250,DM=1500,il=Math.round;function kM(e){return{x:e.x+il(e.width/2),y:e.y+il(e.height/2)}}function ol(e,t,n,r,i){function o(s,c,u,p){return i.allowed("elements.move",{shapes:s,delta:c,position:u,target:p})}e.on("shape.move.start",DM,function(s){var c=s.context,u=s.shape,p=r.get().slice();p.indexOf(u)===-1&&(p=[u]),p=NM(p),C(c,{shapes:p,validatedShapes:p,shape:u})}),e.on("shape.move.start",MM,function(s){var c=s.context,u=c.validatedShapes,p;if(p=c.canExecute=o(u),!p)return!1}),e.on("shape.move.move",TM,function(s){var c=s.context,u=c.validatedShapes,p=s.hover,l={x:s.dx,y:s.dy},f={x:s.x,y:s.y},d;if(d=o(u,l,f,p),c.delta=l,c.canExecute=d,d===null){c.target=null;return}c.target=p}),e.on("shape.move.end",function(s){var c=s.context,u=c.delta,p=c.canExecute,l=p==="attach",f=c.shapes;if(p===!1)return!1;u.x=il(u.x),u.y=il(u.y),!(u.x===0&&u.y===0)&&n.moveElements(f,u,c.target,{primaryShape:c.shape,attach:l})}),e.on("element.mousedown",function(s){if(gn(s)){var c=Ar(s);if(!c)throw new Error("must supply DOM mousedown event");return a(c,s.element)}});function a(s,c,u,p){if(Se(u)&&(p=u,u=!1),!(c.waypoints||!c.parent)&&!pe(s.target).has("djs-hit-no-move")){var l=kM(c),f=t.init(s,l,"shape.move",{cursor:"grabbing",autoActivate:u,data:{shape:c,context:p||{}}});if(f!==!1)return!0}}this.start=a}ol.$inject=["eventBus","dragging","modeling","selection","rules"];function NM(e){var t=Vt(e,"id");return Q(e,function(n){for(;n=n.parent;)if(t[n.id])return!1;return!0})}N();var Kb=499,dd="djs-dragging",Yb="drop-ok",Xb="drop-not-ok",Zb="new-parent",Qb="attach-ok";function al(e,t,n,r){function i(c){var u=o(c),p=OM(u);return p}function o(c){var u=Zn(c,!0),p=u.flatMap(d=>(d.incoming||[]).concat(d.outgoing||[])),l=u.concat(p),f=[...new Set(l)];return f}function a(c,u){[Qb,Yb,Xb,Zb].forEach(function(p){p===u?t.addMarker(c,p):t.removeMarker(c,p)})}function s(c,u,p){r.addDragger(u,c.dragGroup),p&&t.addMarker(u,dd),c.allDraggedElements?c.allDraggedElements.push(u):c.allDraggedElements=[u]}e.on("shape.move.start",Kb,function(c){var u=c.context,p=u.shapes,l=u.allDraggedElements,f=i(p);if(!u.dragGroup){var d=U("g");$(d,n.cls("djs-drag-group",["no-events"]));var m=t.getActiveLayer();J(m,d),u.dragGroup=d}f.forEach(function(g){r.addDragger(g,u.dragGroup)}),l?l=_i([l,o(p)]):l=o(p),E(l,function(g){t.addMarker(g,dd)}),u.allDraggedElements=l,u.differentParents=BM(p)}),e.on("shape.move.move",Kb,function(c){var u=c.context,p=u.dragGroup,l=u.target,f=u.shape.parent,d=u.canExecute;l&&(d==="attach"?a(l,Qb):u.canExecute&&f&&l.id!==f.id?a(l,Zb):a(l,u.canExecute?Yb:Xb)),Fe(p,c.dx,c.dy)}),e.on(["shape.move.out","shape.move.cleanup"],function(c){var u=c.context,p=u.target;p&&a(p,null)}),e.on("shape.move.cleanup",function(c){var u=c.context,p=u.allDraggedElements,l=u.dragGroup;E(p,function(f){t.removeMarker(f,dd)}),l&&Pe(l)}),this.makeDraggable=s}al.$inject=["eventBus","canvas","styles","previewSupport"];function OM(e){var t=Q(e,function(n){return de(n)?re(e,Ct({id:n.source.id}))&&re(e,Ct({id:n.target.id})):!0});return t}function BM(e){return vl(Vt(e,function(t){return t.parent&&t.parent.id}))!==1}var Jb={__depends__:[ei,rt,_a,Et,kt,Dn],__init__:["move","movePreview"],move:["type",ol],movePreview:["type",al]};N();var tx=".djs-palette-toggle",nx=".entry",IM=tx+", "+nx,md="djs-palette-",LM="shown",hd="open",ex="two-column",jM=1e3;function ot(e,t){this._eventBus=e,this._canvas=t;var n=this;e.on("tool-manager.update",function(r){var i=r.tool;n.updateToolHighlight(i)}),e.on("i18n.changed",function(){n._update()}),e.on("diagram.init",function(){n._diagramInitialized=!0,n._rebuild()})}ot.$inject=["eventBus","canvas"];ot.prototype.registerProvider=function(e,t){t||(t=e,e=jM),this._eventBus.on("palette.getProviders",e,function(n){n.providers.push(t)}),this._rebuild()};ot.prototype.getEntries=function(){var e=this._getProviders();return e.reduce(HM,{})};ot.prototype._rebuild=function(){if(this._diagramInitialized){var e=this._getProviders();e.length&&(this._container||this._init(),this._update())}};ot.prototype._init=function(){var e=this,t=this._eventBus,n=this._getParentContainer(),r=this._container=ue(ot.HTML_MARKUP);n.appendChild(r),Ne(n).add(md+LM),bt.bind(r,IM,"click",function(i){var o=i.delegateTarget;if(Ra(o,tx))return e.toggle();e.trigger("click",i)}),se.bind(r,"mousedown",function(i){i.stopPropagation()}),bt.bind(r,nx,"dragstart",function(i){e.trigger("dragstart",i)}),t.on("canvas.resized",this._layoutChanged,this),t.fire("palette.create",{container:r})};ot.prototype._getProviders=function(e){var t=this._eventBus.createEvent({type:"palette.getProviders",providers:[]});return this._eventBus.fire(t),t.providers};ot.prototype._toggleState=function(e){e=e||{};var t=this._getParentContainer(),n=this._container,r=this._eventBus,i,o=Ne(n),a=Ne(t);"twoColumn"in e?i=e.twoColumn:i=this._needsCollapse(t.clientHeight,this._entries||{}),o.toggle(ex,i),a.toggle(md+ex,i),"open"in e&&(o.toggle(hd,e.open),a.toggle(md+hd,e.open)),r.fire("palette.changed",{twoColumn:i,open:this.isOpen()})};ot.prototype._update=function(){var e=_e(".djs-palette-entries",this._container),t=this._entries=this.getEntries();Hr(e),E(t,function(n,r){var i=n.group||"default",o=_e("[data-group="+Rr(i)+"]",e);o||(o=ue('<div class="group"></div>'),nt(o,"data-group",i),e.appendChild(o));var a=n.html||(n.separator?'<hr class="separator" />':'<div class="entry" draggable="true"></div>'),s=ue(a);if(o.appendChild(s),!n.separator&&(nt(s,"data-action",r),n.title&&nt(s,"title",n.title),n.className&&FM(s,n.className),n.imageUrl)){var c=ue("<img>");nt(c,"src",n.imageUrl),s.appendChild(c)}}),this.open()};ot.prototype.trigger=function(e,t,n){var r,i,o=t.delegateTarget||t.target;return o?(r=nt(o,"data-action"),i=t.originalEvent||t,this.triggerEntry(r,e,i,n)):t.preventDefault()};ot.prototype.triggerEntry=function(e,t,n,r){var i=this._entries,o,a;if(o=i[e],!!o&&(a=o.action,this._eventBus.fire("palette.trigger",{entry:o,event:n})!==!1)){if(Le(a)){if(t==="click")return a(n,r)}else if(a[t])return a[t](n,r);n.preventDefault()}};ot.prototype._layoutChanged=function(){this._toggleState({})};ot.prototype._needsCollapse=function(e,t){var n=50,r=Object.keys(t).length*46;return e<r+n};ot.prototype.close=function(){this._toggleState({open:!1,twoColumn:!1})};ot.prototype.open=function(){this._toggleState({open:!0})};ot.prototype.toggle=function(){this.isOpen()?this.close():this.open()};ot.prototype.isActiveTool=function(e){return e&&this._activeTool===e};ot.prototype.updateToolHighlight=function(e){var t,n;this._toolsContainer||(t=_e(".djs-palette-entries",this._container),this._toolsContainer=_e("[data-group=tools]",t)),n=this._toolsContainer,E(n.children,function(r){var i=r.getAttribute("data-action");if(i){var o=Ne(r);i=i.replace("-tool",""),o.contains("entry")&&i===e?o.add("highlighted-entry"):o.remove("highlighted-entry")}})};ot.prototype.isOpen=function(){return Ne(this._container).has(hd)};ot.prototype._getParentContainer=function(){return this._canvas.getContainer()};ot.HTML_MARKUP='<div class="djs-palette"><div class="djs-palette-entries"></div><div class="djs-palette-toggle"></div></div>';function FM(e,t){var n=Ne(e),r=q(t)?t:t.split(/\s+/g);r.forEach(function(i){n.add(i)})}function HM(e,t){var n=t.getPaletteEntries();return Le(n)?n(e):(E(n,function(r,i){e[i]=r}),e)}var rx={__init__:["palette"],palette:["type",ot]};N();var ax="crosshair",ix="selected",$M="djs-dragging-active-lasso";function vr(e,t,n,r,i,o,a){this._selection=i,this._dragging=n,this._mouse=a;var s=this,c={create:function(l){var f=t.getActiveLayer(),d=l.frame=U("rect");$(d,{class:"djs-lasso-overlay",width:1,height:1,x:0,y:0}),J(f,d),u(!0),this.update(l)},update:function(l){var f=l.frame,d=l.bbox;f&&d&&$(f,{x:d.x,y:d.y,width:d.width,height:d.height});var m=l.marked,g=l.lastMarked;if(m&&g){for(let v of g)m.has(v)||t.removeMarker(v,ix);for(let v of m)g.has(v)||t.addMarker(v,ix)}},remove:function(l){this.update(l),l.frame&&Pe(l.frame),u(!1)}};function u(l){pe(t.getContainer()).toggle($M,l)}function p(l){var f=r.getAll();return new Set(Sn(wi(f,l)))}o.registerTool("lasso",{tool:"lasso.selection",dragging:"lasso"}),e.on("lasso.selection.end",function(l){var f=l.originalEvent.target;!l.hover&&!(f instanceof SVGElement)||e.once("lasso.selection.ended",function(){s.activateLasso(l.originalEvent,!0)})}),e.on("lasso.end",0,function(l){var f=l.context;s._select(Array.from(f.marked))}),e.on("lasso.start",function(l){var f=l.context;f.bbox=ox(l),f.add=Mi(l),f.lastMarked=new Set(i.get()),f.add?f.marked=f.lastMarked:f.marked=new Set,f.initialMarked=f.marked,c.create(f)}),e.on("lasso.move",function(l){var f=l.context,d=f.bbox=ox(l),m=p(d),g=f.initialMarked.union(m);f.lastMarked=f.marked,f.marked=g,c.update(f)}),e.on("lasso.cleanup",function(l){var f=l.context;f.lastMarked=f.marked,f.marked=new Set(i.get()),c.remove(l.context)}),e.on("element.mousedown",1500,function(l){if(Mi(l))return s.activateLasso(l.originalEvent),!0})}vr.$inject=["eventBus","canvas","dragging","elementRegistry","selection","toolManager","mouse"];vr.prototype.activateLasso=function(e,t){this._dragging.init(e,"lasso",{autoActivate:t,cursor:ax,data:{context:{}},keepSelection:!0})};vr.prototype.activateSelection=function(e,t){this._dragging.init(e,"lasso.selection",{trapClick:!1,autoActivate:t,cursor:ax,data:{context:{}},keepSelection:!0})};vr.prototype._select=function(e){this._selection.select(e)};vr.prototype.select=function(e,t,n=[]){var r=Sn(wi(e,t));this._select([...n,...r])};vr.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var e=this._mouse.getLastMoveEvent();this.activateSelection(e,!!e)};vr.prototype.isActive=function(){var e=this._dragging.context();return e&&/^lasso/.test(e.prefix)};function ox(e){var t={x:e.x-e.dx,y:e.y-e.dy},n={x:e.x,y:e.y},r;return t.x<=n.x&&t.y<n.y||t.x<n.x&&t.y<=n.y?r={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?r={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?r={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?r={x:n.x,y:n.y,width:t.x-n.x,height:t.y-n.y}:r={x:n.x,y:n.y,width:0,height:0},r}var sx={__depends__:[fi,pr],__init__:["lassoTool"],lassoTool:["type",vr]};var vd=1500,ux="grab";function vi(e,t,n,r,i,o){this._dragging=n,this._mouse=o;var a=this,s=r.get("keyboard",!1);i.registerTool("hand",{tool:"hand",dragging:"hand.move"}),e.on("element.mousedown",vd,function(c){if(Tr(c))return a.activateMove(c.originalEvent,!0),!1}),s&&s.addListener(vd,function(c){if(!(!cx(c.keyEvent)||a.isActive())){var u=a._mouse.getLastMoveEvent();a.activateMove(u,!!u)}},"keyboard.keydown"),s&&s.addListener(vd,function(c){!cx(c.keyEvent)||!a.isActive()||a.toggle()},"keyboard.keyup"),e.on("hand.end",function(c){var u=c.originalEvent.target;if(!c.hover&&!(u instanceof SVGElement))return!1;e.once("hand.ended",function(){a.activateMove(c.originalEvent,{reactivate:!0})})}),e.on("hand.move.move",function(c){var u=t.viewbox().scale;t.scroll({dx:c.dx*u,dy:c.dy*u})}),e.on("hand.move.end",function(c){var u=c.context,p=u.reactivate;return!Tr(c)&&p&&e.once("hand.move.ended",function(l){a.activateHand(l.originalEvent,!0,!0)}),!1})}vi.$inject=["eventBus","canvas","dragging","injector","toolManager","mouse"];vi.prototype.activateMove=function(e,t,n){typeof t=="object"&&(n=t,t=!1),this._dragging.init(e,"hand.move",{autoActivate:t,cursor:ux,data:{context:n||{}}})};vi.prototype.activateHand=function(e,t,n){this._dragging.init(e,"hand",{trapClick:!1,autoActivate:t,cursor:ux,data:{context:{reactivate:n}}})};vi.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var e=this._mouse.getLastMoveEvent();this.activateHand(e,!!e)};vi.prototype.isActive=function(){var e=this._dragging.context();return e?/^(hand|hand\.move)$/.test(e.prefix):!1};function cx(e){return Ke("Space",e)}var px={__depends__:[fi,pr],__init__:["handTool"],handTool:["type",vi]};var lx="connect-ok",fx="connect-not-ok";function gi(e,t,n,r,i,o,a){var s=this;this._dragging=t,this._rules=o,this._mouse=a,i.registerTool("global-connect",{tool:"global-connect",dragging:"global-connect.drag"}),e.on("global-connect.hover",function(c){var u=c.context,p=c.hover,l=u.canStartConnect=s.canStartConnect(p);l!==null&&(u.startTarget=p,r.addMarker(p,l?lx:fx))}),e.on(["global-connect.out","global-connect.cleanup"],function(c){var u=c.context.startTarget,p=c.context.canStartConnect;u&&r.removeMarker(u,p?lx:fx)}),e.on(["global-connect.ended"],function(c){var u=c.context,p=u.startTarget,l={x:c.x,y:c.y},f=s.canStartConnect(p);if(f)return e.once("element.out",function(){e.once(["connect.ended","connect.canceled"],function(){e.fire("global-connect.drag.ended")}),n.start(null,p,l)}),!1})}gi.$inject=["eventBus","dragging","connect","canvas","toolManager","rules","mouse"];gi.prototype.start=function(e,t){this._dragging.init(e,"global-connect",{autoActivate:t,trapClick:!1,data:{context:{}}})};gi.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var e=this._mouse.getLastMoveEvent();return this.start(e,!!e)};gi.prototype.isActive=function(){var e=this._dragging.context();return e&&/^global-connect/.test(e.prefix)};gi.prototype.canStartConnect=function(e){return this._rules.allowed("connection.start",{source:e})};var dx={__depends__:[Lo,Et,kt,fi,pr],globalConnect:["type",gi]};N();function sc(e,t,n,r,i,o,a,s){this._palette=e,this._create=t,this._elementFactory=n,this._spaceTool=r,this._lassoTool=i,this._handTool=o,this._globalConnect=a,this._translate=s,e.registerProvider(this)}sc.$inject=["palette","create","elementFactory","spaceTool","lassoTool","handTool","globalConnect","translate"];sc.prototype.getPaletteEntries=function(){var e={},t=this._create,n=this._elementFactory,r=this._spaceTool,i=this._lassoTool,o=this._handTool,a=this._globalConnect,s=this._translate;function c(l,f,d,m,g){function v(w){var S=n.createShape(C({type:l},g));t.start(w,S)}return{group:f,className:d,title:m,action:{dragstart:v,click:v}}}function u(l){var f=n.createShape({type:"bpmn:SubProcess",x:0,y:0,isExpanded:!0}),d=n.createShape({type:"bpmn:StartEvent",x:40,y:82,parent:f});t.start(l,[f,d],{hints:{autoSelect:[f]}})}function p(l){t.start(l,n.createParticipantShape())}return C(e,{"hand-tool":{group:"tools",className:"bpmn-icon-hand-tool",title:s("Activate hand tool"),action:{click:function(l){o.activateHand(l)}}},"lasso-tool":{group:"tools",className:"bpmn-icon-lasso-tool",title:s("Activate lasso tool"),action:{click:function(l){i.activateSelection(l)}}},"space-tool":{group:"tools",className:"bpmn-icon-space-tool",title:s("Activate create/remove space tool"),action:{click:function(l){r.activateSelection(l)}}},"global-connect-tool":{group:"tools",className:"bpmn-icon-connection-multi",title:s("Activate global connect tool"),action:{click:function(l){a.start(l)}}},"tool-separator":{group:"tools",separator:!0},"create.start-event":c("bpmn:StartEvent","event","bpmn-icon-start-event-none",s("Create start event")),"create.intermediate-event":c("bpmn:IntermediateThrowEvent","event","bpmn-icon-intermediate-event-none",s("Create intermediate/boundary event")),"create.end-event":c("bpmn:EndEvent","event","bpmn-icon-end-event-none",s("Create end event")),"create.exclusive-gateway":c("bpmn:ExclusiveGateway","gateway","bpmn-icon-gateway-none",s("Create gateway")),"create.task":c("bpmn:Task","activity","bpmn-icon-task",s("Create task")),"create.data-object":c("bpmn:DataObjectReference","data-object","bpmn-icon-data-object",s("Create data object reference")),"create.data-store":c("bpmn:DataStoreReference","data-store","bpmn-icon-data-store",s("Create data store reference")),"create.subprocess-expanded":{group:"activity",className:"bpmn-icon-subprocess-expanded",title:s("Create expanded sub-process"),action:{dragstart:u,click:u}},"create.participant-expanded":{group:"collaboration",className:"bpmn-icon-participant",title:s("Create pool/participant"),action:{dragstart:p,click:p}},"create.group":c("bpmn:Group","artifact","bpmn-icon-group",s("Create group"))}),e};var mx={__depends__:[rx,li,Np,sx,px,dx,Zr],__init__:["paletteProvider"],paletteProvider:["type",sc]};N();var zM=250;function cc(e,t,n,r,i){k.call(this,e);function o(s){var c=s.canExecute.replacements;E(c,function(u){var p=u.oldElementId,l={type:u.newElementType};if(!s.visualReplacements[p]){var f=t.get(p);C(l,{x:f.x,y:f.y});var d=n.createShape(l);r.addShape(d,f.parent);var m=_e('[data-element-id="'+Rr(f.id)+'"]',s.dragGroup);m&&$(m,{display:"none"});var g=i.addDragger(d,s.dragGroup);s.visualReplacements[p]=g,r.removeShape(d)}})}function a(s){var c=s.visualReplacements;E(c,function(u,p){var l=_e('[data-element-id="'+Rr(p)+'"]',s.dragGroup);l&&$(l,{display:"inline"}),u.remove(),c[p]&&delete c[p]})}e.on("shape.move.move",zM,function(s){var c=s.context,u=c.canExecute;c.visualReplacements||(c.visualReplacements={}),u&&u.replacements?o(c):a(c)})}cc.$inject=["eventBus","elementRegistry","elementFactory","canvas","previewSupport"];B(cc,k);var hx={__depends__:[Dn],__init__:["bpmnReplacePreview"],bpmnReplacePreview:["type",cc]};N();var GM=1250,gd=40,VM=20,WM=10,vx=20,yx=["x","y"],UM=Math.abs;function sl(e){e.on(["connect.hover","connect.move","connect.end"],GM,function(t){var n=t.context,r=n.canExecute,i=n.start,o=n.hover,a=n.source,s=n.target;t.originalEvent&&xt(t.originalEvent)||(n.initialConnectionStart||(n.initialConnectionStart=n.connectionStart),r&&o&&qM(t,o,ZM(o)),o&&XM(r,["bpmn:Association","bpmn:DataInputAssociation","bpmn:DataOutputAssociation","bpmn:SequenceFlow"])?(n.connectionStart=rn(i),te(o,["bpmn:Event","bpmn:Gateway"])&&gx(t,rn(o)),te(o,["bpmn:Task","bpmn:SubProcess"])&&KM(t,o),h(a,"bpmn:BoundaryEvent")&&s===a.host&&YM(t)):_x(r,"bpmn:MessageFlow")?(h(i,"bpmn:Event")&&(n.connectionStart=rn(i)),h(o,"bpmn:Event")&&gx(t,rn(o))):n.connectionStart=n.initialConnectionStart)})}sl.$inject=["eventBus"];function qM(e,t,n){yx.forEach(function(r){var i=bx(r,t);e[r]<t[r]+n?ze(e,r,t[r]+n):e[r]>t[r]+i-n&&ze(e,r,t[r]+i-n)})}function KM(e,t){var n=rn(t);yx.forEach(function(r){QM(e,t,r)&&ze(e,r,n[r])})}function YM(e){var t=e.context,n=t.source,r=t.target;if(!JM(t)){var i=rn(n),o=He(i,r,-10),a=[];/top|bottom/.test(o)&&a.push("x"),/left|right/.test(o)&&a.push("y"),a.forEach(function(s){var c=e[s],u;UM(c-i[s])<gd&&(c>i[s]?u=i[s]+gd:u=i[s]-gd,ze(e,s,u))})}}function gx(e,t){ze(e,"x",t.x),ze(e,"y",t.y)}function _x(e,t){return e&&e.type===t}function XM(e,t){return Lt(t,function(n){return _x(e,n)})}function bx(e,t){return e==="x"?t.width:t.height}function ZM(e){return h(e,"bpmn:Task")?WM:VM}function QM(e,t,n){return e[n]>t[n]+vx&&e[n]<t[n]+bx(n,t)-vx}function JM(e){var t=e.hover,n=e.source;return t&&n&&t===n}N();function Kn(){this._targets={},this._snapOrigins={},this._snapLocations=[],this._defaultSnaps={}}Kn.prototype.getSnapOrigin=function(e){return this._snapOrigins[e]};Kn.prototype.setSnapOrigin=function(e,t){this._snapOrigins[e]=t,this._snapLocations.indexOf(e)===-1&&this._snapLocations.push(e)};Kn.prototype.addDefaultSnap=function(e,t){var n=this._defaultSnaps[e];n||(n=this._defaultSnaps[e]=[]),n.push(t)};Kn.prototype.getSnapLocations=function(){return this._snapLocations};Kn.prototype.setSnapLocations=function(e){this._snapLocations=e};Kn.prototype.pointsForTarget=function(e){var t=e.id||e,n=this._targets[t];return n||(n=this._targets[t]=new cl,n.initDefaults(this._defaultSnaps)),n};function cl(){this._snapValues={}}cl.prototype.add=function(e,t){var n=this._snapValues[e];n||(n=this._snapValues[e]={x:[],y:[]}),n.x.indexOf(t.x)===-1&&n.x.push(t.x),n.y.indexOf(t.y)===-1&&n.y.push(t.y)};cl.prototype.snap=function(e,t,n,r){var i=this._snapValues[t];return i&&bg(e[n],i[n],r)};cl.prototype.initDefaults=function(e){var t=this;E(e||{},function(n,r){E(n,function(i){t.add(r,i)})})};N();var eD=1250;function bn(e,t,n){var r=this;this._elementRegistry=e,t.on(["create.start","shape.move.start"],function(i){r.initSnap(i)}),t.on(["create.move","create.end","shape.move.move","shape.move.end"],eD,function(i){var o=i.context,a=o.shape,s=o.snapContext,c=o.target;if(!(i.originalEvent&&xt(i.originalEvent))&&!(zn(i)||!c)){var u=s.pointsForTarget(c);u.initialized||(u=r.addSnapTargetPoints(u,a,c),u.initialized=!0),n.snap(i,u)}}),t.on(["create.cleanup","shape.move.cleanup"],function(){n.hide()})}bn.$inject=["elementRegistry","eventBus","snapping"];bn.prototype.initSnap=function(e){var t=this._elementRegistry,n=e.context,r=n.shape,i=n.snapContext;i||(i=n.snapContext=new Kn);var o;t.get(r.id)?o=rn(r,e):o={x:e.x+rn(r).x,y:e.y+rn(r).y};var a={x:o.x-r.width/2,y:o.y-r.height/2},s={x:o.x+r.width/2,y:o.y+r.height/2};return i.setSnapOrigin("mid",{x:o.x-e.x,y:o.y-e.y}),ee(r)||(i.setSnapOrigin("top-left",{x:a.x-e.x,y:a.y-e.y}),i.setSnapOrigin("bottom-right",{x:s.x-e.x,y:s.y-e.y})),i};bn.prototype.addSnapTargetPoints=function(e,t,n){var r=this.getSnapTargets(t,n);return E(r,function(i){if(ee(i)){ee(t)&&e.add("mid",rn(i));return}if(de(i)){if(i.waypoints.length<3)return;var o=i.waypoints.slice(1,-1);E(o,function(a){e.add("mid",a)});return}e.add("mid",rn(i))}),!ne(t.x)||!ne(t.y)||this._elementRegistry.get(t.id)&&e.add("mid",rn(t)),e};bn.prototype.getSnapTargets=function(e,t){return zu(t).filter(function(n){return!tD(n)})};function tD(e){return!!e.hidden}N();var xx=1500;function yi(e,t){t.invoke(bn,this),e.on(["create.move","create.end"],xx,oD),e.on(["create.move","create.end","shape.move.move","shape.move.end"],xx,function(n){var r=n.context,i=r.canExecute,o=r.target,a=i&&(i==="attach"||i.attach);a&&!zn(n)&&nD(n,o)})}B(yi,bn);yi.$inject=["eventBus","injector"];yi.prototype.initSnap=function(e){var t=bn.prototype.initSnap.call(this,e),n=e.shape,r=!!this._elementRegistry.get(n.id);return E(n.outgoing,function(i){var o=i.waypoints[0];o=o.original||o,t.setSnapOrigin(i.id+"-docking",wx(o,r,e))}),E(n.incoming,function(i){var o=i.waypoints[i.waypoints.length-1];o=o.original||o,t.setSnapOrigin(i.id+"-docking",wx(o,r,e))}),h(n,"bpmn:Participant")&&t.setSnapLocations(["top-left","bottom-right","mid"]),t};yi.prototype.addSnapTargetPoints=function(e,t,n){bn.prototype.addSnapTargetPoints.call(this,e,t,n);var r=this.getSnapTargets(t,n);E(r,function(o){(iD(o)||rD([t,o],"bpmn:TextAnnotation"))&&(e.add("top-left",Hu(o)),e.add("bottom-right",$u(o)))});var i=this._elementRegistry;return E(t.incoming,function(o){if(i.get(t.id)){Ex(r,o.source)||e.add("mid",X(o.source));var a=o.waypoints[0];e.add(o.id+"-docking",a.original||a)}}),E(t.outgoing,function(o){if(i.get(t.id)){Ex(r,o.target)||e.add("mid",X(o.target));var a=o.waypoints[o.waypoints.length-1];e.add(o.id+"-docking",a.original||a)}}),h(n,"bpmn:SequenceFlow")&&(e=this.addSnapTargetPoints(e,t,n.parent)),e};yi.prototype.getSnapTargets=function(e,t){return bn.prototype.getSnapTargets.call(this,e,t).filter(function(n){return!h(n,"bpmn:Lane")})};function nD(e,t){var n=Z(t),r=hp(e,t),i=e.context,o=i.shape,a;o.parent?a={x:0,y:0}:a=X(o),/top/.test(r)?ze(e,"y",n.top-a.y):/bottom/.test(r)&&ze(e,"y",n.bottom-a.y),/left/.test(r)?ze(e,"x",n.left-a.x):/right/.test(r)&&ze(e,"x",n.right-a.x)}function rD(e,t){return e.every(function(n){return h(n,t)})}function iD(e){return h(e,"bpmn:SubProcess")&&ie(e)?!0:h(e,"bpmn:Participant")}function oD(e){var t=e.context,n=t.createConstraints;if(n){var r=n.top,i=n.right,o=n.bottom,a=n.left;(a&&a>=e.x||i&&i<=e.x)&&ze(e,"x",e.x),(r&&r>=e.y||o&&o<=e.y)&&ze(e,"y",e.y)}}function Ex(e,t){return e.indexOf(t)!==-1}function wx(e,t,n){return t?{x:e.x-n.x,y:e.y-n.y}:{x:e.x,y:e.y}}N();var aD=1250;function ao(e,t){var n=this;e.on(["resize.start"],function(r){n.initSnap(r)}),e.on(["resize.move","resize.end"],aD,function(r){var i=r.context,o=i.shape,a=o.parent,s=i.direction,c=i.snapContext;if(!(r.originalEvent&&xt(r.originalEvent))&&!zn(r)){var u=c.pointsForTarget(a);u.initialized||(u=n.addSnapTargetPoints(u,o,a,s),u.initialized=!0),uD(s)&&ze(r,"x",r.x),pD(s)&&ze(r,"y",r.y),t.snap(r,u)}}),e.on(["resize.cleanup"],function(){t.hide()})}ao.prototype.initSnap=function(e){var t=e.context,n=t.shape,r=t.direction,i=t.snapContext;i||(i=t.snapContext=new Kn);var o=Sx(n,r);return i.setSnapOrigin("corner",{x:o.x-e.x,y:o.y-e.y}),i};ao.prototype.addSnapTargetPoints=function(e,t,n,r){var i=this.getSnapTargets(t,n);return E(i,function(o){e.add("corner",$u(o)),e.add("corner",Hu(o))}),e.add("corner",Sx(t,r)),e};ao.$inject=["eventBus","snapping"];ao.prototype.getSnapTargets=function(e,t){return zu(t).filter(function(n){return!sD(n,e)&&!de(n)&&!cD(n)&&!ee(n)})};function Sx(e,t){var n=X(e),r=Z(e),i={x:n.x,y:n.y};return t.indexOf("n")!==-1?i.y=r.top:t.indexOf("s")!==-1&&(i.y=r.bottom),t.indexOf("e")!==-1?i.x=r.right:t.indexOf("w")!==-1&&(i.x=r.left),i}function sD(e,t){return e.host===t}function cD(e){return!!e.hidden}function uD(e){return e==="n"||e==="s"}function pD(e){return e==="e"||e==="w"}N();var lD=7,fD=1e3;function gr(e){this._canvas=e,this._asyncHide=Ca(tt(this.hide,this),fD)}gr.$inject=["canvas"];gr.prototype.snap=function(e,t){var n=e.context,r=n.snapContext,i=r.getSnapLocations(),o={x:zn(e,"x"),y:zn(e,"y")};E(i,function(a){var s=r.getSnapOrigin(a),c={x:e.x+s.x,y:e.y+s.y};if(E(["x","y"],function(u){var p;o[u]||(p=t.snap(c,a,u,lD),p!==void 0&&(o[u]={value:p,originValue:p-s[u]}))}),o.x&&o.y)return!1}),this.showSnapLine("vertical",o.x&&o.x.value),this.showSnapLine("horizontal",o.y&&o.y.value),E(["x","y"],function(a){var s=o[a];Se(s)&&ze(e,a,s.originValue)})};gr.prototype._createLine=function(e){var t=this._canvas.getLayer("snap"),n=U("path");return $(n,{d:"M0,0 L0,0"}),pe(n).add("djs-snap-line"),J(t,n),{update:function(r){ne(r)?e==="horizontal"?$(n,{d:"M-100000,"+r+" L+100000,"+r,display:""}):$(n,{d:"M "+r+",-100000 L "+r+", +100000",display:""}):$(n,{display:"none"})}}};gr.prototype._createSnapLines=function(){this._snapLines={horizontal:this._createLine("horizontal"),vertical:this._createLine("vertical")}};gr.prototype.showSnapLine=function(e,t){var n=this.getSnapLine(e);n&&n.update(t),this._asyncHide()};gr.prototype.getSnapLine=function(e){return this._snapLines||this._createSnapLines(),this._snapLines[e]};gr.prototype.hide=function(){E(this._snapLines,function(e){e.update()})};var Cx={__init__:["createMoveSnapping","resizeSnapping","snapping"],createMoveSnapping:["type",bn],resizeSnapping:["type",ao],snapping:["type",gr]};var Rx={__depends__:[Cx],__init__:["connectSnapping","createMoveSnapping"],connectSnapping:["type",sl],createMoveSnapping:["type",yi]};var Ax=300;function fe(e,t,n,r){this._open=!1,this._results={},this._eventMaps=[],this._cachedRootElement=null,this._cachedSelection=null,this._cachedViewbox=null,this._canvas=e,this._eventBus=t,this._selection=n,this._translate=r,this._container=this._getBoxHtml(),this._searchInput=_e(fe.INPUT_SELECTOR,this._container),this._resultsContainer=_e(fe.RESULTS_CONTAINER_SELECTOR,this._container),this._canvas.getContainer().appendChild(this._container),t.on(["canvas.destroy","diagram.destroy","drag.init","elements.changed"],this.close,this)}fe.$inject=["canvas","eventBus","selection","translate"];fe.prototype._bindEvents=function(){var e=this;function t(n,r,i,o){e._eventMaps.push({el:n,type:i,listener:bt.bind(n,r,i,o)})}t(document,"html","click",function(n){e.close(!1)}),t(this._container,fe.INPUT_SELECTOR,"click",function(n){n.stopPropagation(),n.delegateTarget.focus()}),t(this._container,fe.RESULT_SELECTOR,"mouseover",function(n){n.stopPropagation(),e._scrollToNode(n.delegateTarget),e._preselect(n.delegateTarget)}),t(this._container,fe.RESULT_SELECTOR,"click",function(n){n.stopPropagation(),e._select(n.delegateTarget)}),t(this._container,fe.INPUT_SELECTOR,"keydown",function(n){Ke("ArrowUp",n)&&n.preventDefault(),Ke("ArrowDown",n)&&n.preventDefault()}),t(this._container,fe.INPUT_SELECTOR,"keyup",function(n){if(Ke("Escape",n))return e.close();if(Ke("Enter",n)){var r=e._getCurrentResult();return r?e._select(r):e.close(!1)}if(Ke("ArrowUp",n))return e._scrollToDirection(!0);if(Ke("ArrowDown",n))return e._scrollToDirection();Ke(["ArrowLeft","ArrowRight"],n)||e._search(n.delegateTarget.value)})};fe.prototype._unbindEvents=function(){this._eventMaps.forEach(function(e){bt.unbind(e.el,e.type,e.listener)})};fe.prototype._search=function(e){var t=this;if(this._clearResults(),!!e.trim()){var n=this._searchProvider.find(e);if(n=n.filter(function(i){return!t._canvas.getRootElements().includes(i.element)}),!n.length){this._selection.select(null);return}n.forEach(function(i){var o=i.element.id,a=t._createResultNode(i,o);t._results[o]={element:i.element,node:a}});var r=_e(fe.RESULT_SELECTOR,this._resultsContainer);this._scrollToNode(r),this._preselect(r)}};fe.prototype._scrollToDirection=function(e){var t=this._getCurrentResult();if(t){var n=e?t.previousElementSibling:t.nextElementSibling;n&&(this._scrollToNode(n),this._preselect(n))}};fe.prototype._scrollToNode=function(e){if(!(!e||e===this._getCurrentResult())){var t=e.offsetTop,n=this._resultsContainer.scrollTop,r=t-this._resultsContainer.clientHeight+e.clientHeight;t<n?this._resultsContainer.scrollTop=t:n<r&&(this._resultsContainer.scrollTop=r)}};fe.prototype._clearResults=function(){Hr(this._resultsContainer),this._results={},this._eventBus.fire("searchPad.cleared")};fe.prototype._getCurrentResult=function(){return _e(fe.RESULT_SELECTED_SELECTOR,this._resultsContainer)};fe.prototype._createResultNode=function(e,t){var n=ue(fe.RESULT_HTML);return e.primaryTokens.length>0&&Px(n,e.primaryTokens,fe.RESULT_PRIMARY_HTML),Px(n,e.secondaryTokens,fe.RESULT_SECONDARY_HTML),nt(n,fe.RESULT_ID_ATTRIBUTE,t),this._resultsContainer.appendChild(n),n};fe.prototype.registerProvider=function(e){this._searchProvider=e};fe.prototype.open=function(){if(!this._searchProvider)throw new Error("no search provider registered");this.isOpen()||(this._cachedRootElement=this._canvas.getRootElement(),this._cachedSelection=this._selection.get(),this._cachedViewbox=this._canvas.viewbox(),this._selection.select(null),this._bindEvents(),this._open=!0,Ne(this._canvas.getContainer()).add("djs-search-open"),Ne(this._container).add("open"),this._searchInput.focus(),this._eventBus.fire("searchPad.opened"))};fe.prototype.close=function(e=!0){this.isOpen()&&(e&&(this._cachedRootElement&&this._canvas.setRootElement(this._cachedRootElement),this._cachedSelection&&this._selection.select(this._cachedSelection),this._cachedViewbox&&this._canvas.viewbox(this._cachedViewbox),this._eventBus.fire("searchPad.restored")),this._cachedRootElement=null,this._cachedSelection=null,this._cachedViewbox=null,this._unbindEvents(),this._open=!1,Ne(this._canvas.getContainer()).remove("djs-search-open"),Ne(this._container).remove("open"),this._clearResults(),this._searchInput.value="",this._searchInput.blur(),this._eventBus.fire("searchPad.closed"),this._canvas.restoreFocus())};fe.prototype.toggle=function(){this.isOpen()?this.close():this.open()};fe.prototype.isOpen=function(){return this._open};fe.prototype._preselect=function(e){var t=this._getCurrentResult();if(e!==t){t&&Ne(t).remove(fe.RESULT_SELECTED_CLASS);var n=nt(e,fe.RESULT_ID_ATTRIBUTE),r=this._results[n].element;Ne(e).add(fe.RESULT_SELECTED_CLASS),this._canvas.scrollToElement(r,{top:Ax}),this._selection.select(r),this._eventBus.fire("searchPad.preselected",r)}};fe.prototype._select=function(e){var t=nt(e,fe.RESULT_ID_ATTRIBUTE),n=this._results[t].element;this._cachedSelection=null,this._cachedViewbox=null,this.close(!1),this._canvas.scrollToElement(n,{top:Ax}),this._selection.select(n),this._eventBus.fire("searchPad.selected",n)};fe.prototype._getBoxHtml=function(){let e=ue(fe.BOX_HTML),t=_e(fe.INPUT_SELECTOR,e);return t&&t.setAttribute("aria-label",this._translate("Search in diagram")),e};function Px(e,t,n){var r=dD(t),i=ue(n);i.innerHTML=r,e.appendChild(i)}function dD(e){var t="";return e.forEach(function(n){var r=Hn(n.value||n.matched||n.normal),i=n.match||n.matched;i?t+='<b class="'+fe.RESULT_HIGHLIGHT_CLASS+'">'+r+"</b>":t+=r}),t!==""?t:null}fe.CONTAINER_SELECTOR=".djs-search-container";fe.INPUT_SELECTOR=".djs-search-input input";fe.RESULTS_CONTAINER_SELECTOR=".djs-search-results";fe.RESULT_SELECTOR=".djs-search-result";fe.RESULT_SELECTED_CLASS="djs-search-result-selected";fe.RESULT_SELECTED_SELECTOR="."+fe.RESULT_SELECTED_CLASS;fe.RESULT_ID_ATTRIBUTE="data-result-id";fe.RESULT_HIGHLIGHT_CLASS="djs-search-highlight";fe.BOX_HTML=`<div class="djs-search-container djs-scrollable"> 231 </svg>`},jf=wP;var SP=900;function Hi(e,t,n,r){this._distributeElements=t,this._translate=n,this._popupMenu=e,this._rules=r,e.registerProvider("align-elements",SP,this global() property
|