| H A D | dmn-modeler.production.min.js | 249 `)}function xn(n,e){this._eventBus=n,this._canvas=e,this._providers=[],this._textbox=new On({container:e.getContainer(),keyHandler:at(this._handleKey,this),resizeHandler:at(this._handleResize,this)})}xn.$inject=["eventBus","canvas"];xn.prototype.registerProvider=function(n){this._providers.push(n)};xn.prototype.isActive=function(n){return!!(this._active&&(!n||this._active.element===n))};xn.prototype.cancel=function(){this._active&&(this._fire("cancel"),this.close())};xn.prototype._fire=function(n,e){this._eventBus.fire("directEditing."+n,e||{active:this._active})};xn.prototype.close=function(){this._textbox.destroy(),this._fire("deactivate"),this._active=null,this.resizable=void 0,this._canvas.restoreFocus&&this._canvas.restoreFocus()};xn.prototype.complete=function(){var n=this._active;if(n){var e,t=n.context.bounds,i=this.$textbox.getBoundingClientRect(),r=this.getValue(),o=n.context.text;(r!==o||i.height!==t.height||i.width!==t.width)&&(e=this._textbox.container.getBoundingClientRect(),n.provider.update(n.element,r,n.context.text,{x:i.left-e.left,y:i.top-e.top,width:i.width,height:i.height})),this._fire("complete"),this.close()}};xn.prototype.getValue=function(){return this._textbox.getValue()};xn.prototype._handleKey=function(n){n.stopPropagation();var e=n.keyCode||n.charCode;if(e===27)return n.preventDefault(),this.cancel();if(e===13&&!n.shiftKey)return n.preventDefault(),this.complete()};xn.prototype._handleResize=function(n){this._fire("resize",n)};xn.prototype.activate=function(n){if(this.isActive()&&this.cancel(),this._eventBus.fire("directEditing.activate.allowed",{element:n})===!1)return!1;var e,t=ye(this._providers,function(i){return(e=i.activate(n))?i:null});return e&&(this.$textbox=this._textbox.create(e.bounds,e.style,e.text,e.options),this._active={element:n,context:e,provider:t},e.options&&e.options.resizable&&(this.resizable=!0),this._fire("activate")),!!e};var AO={__depends__:[fo],__init__:["directEditing"],directEditing:["type",xn]};var MO="djs-label-hidden";function bs(n,e,t,i,r){this._canvas=n,this._modeling=i,this._textRenderer=r,this._eventBus=t,e.registerProvider(this),t.on("element.dblclick",function(o){e.activate(o.element)}),t.on(["autoPlace.start","canvas.viewbox.changing","drag.init","drillDown.click","element.mousedown","popupMenu.open","selection.changed"],function(){e.complete()}),t.on(["commandStack.changed"],function(){e.cancel()}),t.on("create.end",500,function(o){var s=o.shape;(O(s,"dmn:Decision")||O(s,"dmn:InputData")||O(s,"dmn:BusinessKnowledgeModel")||O(s,"dmn:KnowledgeSource")||O(s,"dmn:TextAnnotation"))&&e.activate(s)}),t.on("autoPlace.end",500,function(o){e.activate(o.shape)}),this._eventBus.on(["directEditing.complete","directEditing.cancel"],function(o){var s=o.active;if(s){var a=s.element.label||s.element;n.removeMarker(a,MO)}})}bs.$inject=["canvas","directEditing","eventBus","modeling","textRenderer"];bs.prototype.activate=function(n){var e=fs(n);if(Me(e)){var t={text:e},i=this.getEditingBBox(n);T(t,i);var r={},o=t.style||{};return O(n,"dmn:DRGElement")&&(T(r,{centerVertically:!0}),T(o,{backgroundColor:null,border:null})),O(n,"dmn:TextAnnotation")&&T(r,{resizable:!0}),T(t,{options:r,style:o}),this._canvas.addMarker(n,MO),t}};bs.prototype.getEditingBBox=function(n){var e=this._canvas,t=n.label||n,i=e.getAbsoluteBBox(t),r={x:i.x,y:i.y},o=e.zoom(),s=this._textRenderer.getDefaultStyle(),a=s.fontSize*o,l=s.lineHeight,c={fontFamily:this._textRenderer.getDefaultStyle().fontFamily,fontWeight:this._textRenderer.getDefaultStyle().fontWeight};return O(n,"dmn:DRGElement")&&(T(r,{width:i.width,height:i.height}),T(c,{fontSize:a+"px",lineHeight:l,paddingTop:7*o+"px",paddingBottom:7*o+"px",paddingLeft:5*o+"px",paddingRight:5*o+"px"})),O(n,"dmn:TextAnnotation")&&(T(r,{width:i.width,height:i.height,minWidth:30*o,minHeight:10*o}),T(c,{textAlign:"left",paddingTop:5*o+"px",paddingBottom:7*o+"px",paddingLeft:7*o+"px",paddingRight:5*o+"px",fontSize:a+"px",lineHeight:l})),{bounds:r,style:c}};bs.prototype.update=function(n,e,t,i){var r,o;O(n,"dmn:TextAnnotation")&&(o=this._canvas.getAbsoluteBBox(n),r={x:n.x,y:n.y,width:n.width/o.width*i.width,height:n.height/o.height*i.height}),yF(e)&&(e=null),this._modeling.updateLabel(n,e,r)};function yF(n){return!n||!n.trim()}var PO={__depends__:[xs,Cm,AO],__init__:["labelEditingProvider"],labelEditingProvider:["type",bs]};function Mf(n,e){e.invoke(ae,this),this.preExecute("connection.create",function(t){var i=t.connection,r=i.businessObject,o=t.source,s=t.target,a,l,c;O(i,"dmn:Association")?(l=r.sourceRef=n.create("dmn:DMNElementReference",{href:"#"+o.id}),l.$parent=r,c=r.targetRef=n.create("dmn:DMNElementReference",{href:"#"+s.id}),c.$parent=r):(a=r["required"+vF(o)]=n.create("dmn:DMNElementReference",{href:"#"+o.id}),a.$parent=r)},!0)}Mf.$inject=["drdFactory","injector"];fe(Mf,ae);function vF(n){if(O(n,"dmn:BusinessKnowledgeModel"))return"Knowledge";if(O(n,"dmn:Decision"))return"Decision";if(O(n,"dmn:InputData"))return"Input";if(O(n,"dmn:KnowledgeSource"))return"Authority"}var xF=500;function Pf(n,e,t,i){n.invoke(ae,this),this.preExecute(["connection.create","connection.reconnect"],function(o){var s=o.connection,a=o.newSource||o.source,l=o.newTarget||o.target;if(!(O(s,"dmn:InformationRequirement")&&!i.allowed("connection.connect",{connection:s,source:a,target:l}))&&O(s,"dmn:InformationRequirement")){var c=vt(a,l);o.hints||(o.hints={}),T(o.hints,bF(a,l,c))}},!0);function r(o,s,a){s||(s=o.incoming.filter(function(c){return O(c,"dmn:InformationRequirement")}));var l={};a?l[a]=s:l=wF(o,s),k(l,function(c,u){c=CF(c,u);var f=_F(c,o,u);c.forEach((h,d)=>{var p=f[d].start,m=f[d].end,g=e.layoutConnection(h,{connectionStart:p,connectionEnd:m});t.updateWaypoints(h,g)})})}this.postExecuted(["connection.create","connection.delete","connection.reconnect"],function(o){var s=o.connection,a=s.source||o.source,l=s.target||o.target;if(O(s,"dmn:InformationRequirement")){var c=vt(a,l),u=l.incoming.filter(f=>{var h=vt(f.source,f.target);return O(f,"dmn:InformationRequirement")&&DO(h,c)});u.length&&r(l,u,c)}},!0),this.preExecute("connection.reconnect",function(o){var s=o.connection,a=s.source,l=s.target;if(O(s,"dmn:InformationRequirement")){var c=vt(a,l),u=l.incoming.filter(f=>{var h=vt(f.source,f.target);return f!==s&&O(f,"dmn:InformationRequirement")&&DO(h,c)});u.length&&r(l,u,c)}},!0),this.postExecuted("elements.move",xF,function(o){var s=o.shapes,a=o.closure,l=a.enclosedConnections;s.forEach(function(c){if(Ge(c,["dmn:Decision","dmn:InputData"])){var u=c.incoming.filter(function(f){return O(f,"dmn:InformationRequirement")&&!l[f.id]});u.length&&r(c,u),c.outgoing.forEach(function(f){!O(f,"dmn:InformationRequirement")||l[f.id]||r(f.target)})}})},!0)}Pf.$inject=["injector","layouter","modeling","rules"];fe(Pf,ae);function bF(n,e,t){var i=le(n),r=le(e);return t.includes("bottom")?(i.y=n.y,r.y=e.y+e.height):t.includes("top")?(i.y=n.y+n.height,r.y=e.y):t.includes("right")?(i.x=n.x,r.x=e.x+e.width):(i.x=n.x+n.width,r.x=e.x),{connectionStart:i,connectionEnd:r}}function _F(n,e,t){return n.map(function(i,r){var o=i.source,s=le(o),a=G(o),l=G(e),c=n.length;return t.includes("bottom")?{start:{x:s.x,y:a.top},end:{x:l.left+e.width/(c+1)*(r+1),y:l.bottom}}:t.includes("top")?{start:{x:s.x,y:a.bottom},end:{x:l.left+e.width/(c+1)*(r+1),y:l.top}}:t.includes("right")?{start:{x:a.left,y:s.y},end:{x:l.right,y:l.top+e.height/(c+1)*(r+1)}}:{start:{x:a.right,y:s.y},end:{x:l.left,y:l.top+e.height/(c+1)*(r+1)}}})}function wF(n,e){var t={};return e.forEach(function(i){var r=vt(i.source,n).split("-").shift();t[r]||(t[r]=[]),t[r].push(i)}),t}function DO(n,e){return n&&e&&n.split("-").shift()===e.split("-").shift()}function CF(n,e){var t;return e.includes("top")||e.includes("bottom")?t="x":t="y",n.sort(function(i,r){return le(i.source)[t]-le(r.source)[t]})}function Df(n,e,t){n.invoke(ae,this),this.preExecute("connection.reconnect",function(i){var r=i.connection,o=i.newSource||r.source,s=i.newTarget||r.target,a=r.waypoints.slice(),l=t.allowed("connection.reconnect",{connection:r,source:o,target:s});!l||l.type===r.type||(i.connection=e.connect(o,s,{type:l.type,waypoints:a}),e.removeConnection(r))},!0)}fe(Df,ae);Df.$inject=["injector","modeling","rules"];function If(n,e,t){ae.call(this,n),this._modeling=e,this.postExecuted(["shape.replace"],1500,function(i){var r=i.context,o=r.oldShape,s=r.newShape;e.unclaimId(o.businessObject.id,o.businessObject),e.updateProperties(s,{id:o.id}),t.select(s)})}fe(If,ae);If.$inject=["eventBus","modeling","selection"];var IO="id",Gn=class extends ae{constructor(e){super(e),this.executed("element.updateProperties",this.updateIds.bind(this))}updateIds({context:e}){let{element:t,oldProperties:i,properties:r}=e,o=Ke(t);if(this.shouldSkipUpdate(o,i,r))return;let s=SF(o);s.get("drgElement").forEach(c=>{OF(c,i.id,r.id)}),s.get("artifact").forEach(c=>{kF(c,i.id,r.id)})}shouldSkipUpdate(e,t,i){return!EF(t,i)||!O(e,"dmn:DRGElement")&&!O(e,"dmn:TextAnnotation")}};Gn.$inject=["eventBus"];function EF(n,e){return IO in n&&IO in e}function SF(n){let e=n;for(;!O(e,"dmn:Definitions");)e=e.$parent;return e}function OF(n,e,t){k({authorityRequirement:()=>{n.authorityRequirement.forEach(r=>{let{requiredAuthority:o,requiredDecision:s,requiredInput:a}=r;o&&o.href===`#${e}`&&(o.href=`#${t}`),s&&s.href===`#${e}`&&(s.href=`#${t}`),a&&a.href===`#${e}`&&(a.href=`#${t}`)})},informationRequirement:()=>{n.informationRequirement.forEach(r=>{let{requiredDecision:o,requiredInput:s}=r;o&&o.href===`#${e}`&&(o.href=`#${t}`),s&&s.href===`#${e}`&&(s.href=`#${t}`)})},knowledgeRequirement:()=>{n.knowledgeRequirement.forEach(r=>{let{requiredKnowledge:o}=r;o&&o.href===`#${e}`&&(o.href=`#${t}`)})}},(r,o)=>{n[o]&&r()})}function kF(n,e,t){k({sourceRef:()=>{let{sourceRef:r}=n;r.href===`#${e}`&&(r.href=`#${t}`)},targetRef:()=>{let{targetRef:r}=n;r.href===`#${e}`&&(r.href=`#${t}`)}},(r,o)=>{n[o]&&r()})}var qi=class extends ae{constructor(t,i){super(t);M(this,"updateVariableFromLabel",({context:t})=>{let{element:i,newLabel:r}=t,o=Ke(i),s=o.variable;s&&this._modeling.updateProperties(s,{name:r})});M(this,"updateVariableFromElement",({context:t})=>{let{element:i,properties:r}=t,o=Ke(i);o.variable&&(O(i,"dmn:Decision")||O(i,"dmn:BusinessKnowledgeModel"))&&this.isNameChanged(r)&&(this.isVariable(i)||this.shouldSyncVariable(i)||this.syncElementVariableChange(o))});this._modeling=i,this.postExecuted("element.updateProperties",this.updateVariableFromElement),this.postExecuted("element.updateLabel",this.updateVariableFromLabel)}isNameChanged(t){return"name"in t}isVariable(t){let i=RF(t);return O(t,"dmn:InformationItem")&&i&&i.get("variable")===t}shouldSyncVariable(t){let i=Ke(t),r=i.get("variable");return r&&i.name===r.name}syncElementVariableChange(t){let i=t.get("name"),r=t.variable;this._modeling.updateProperties(r,{name:i})}};M(qi,"$inject",["eventBus","modeling"]);function RF(n){return n.$parent}var LO={__init__:["createConnectionBehavior","idChangeBehavior","nameChangeBehavior","layoutConnectionBehavior","replaceConnectionBehavior","replaceElementBehavior"],createConnectionBehavior:["type",Mf],idChangeBehavior:["type",Gn],nameChangeBehavior:["type",qi],layoutConnectionBehavior:["type",Pf],replaceConnectionBehavior:["type",Df],replaceElementBehavior:["type",If]};function Vi(n){ae.call(this,n),this.init()}Vi.$inject=["eventBus"];fe(Vi,ae);Vi.prototype.addRule=function(n,e,t){var i=this;typeof n=="string"&&(n=[n]),n.forEach(function(r){i.canExecute(r,e,function(o,s,a){return t(o)},!0)})};Vi.prototype.init=function(){};function Rr(n){n.invoke(Vi,this)}fe(Rr,Vi);Rr.$inject=["injector"];Rr.prototype.init=function(){this.addRule("connection.create",function(n){var e=n.source,t=n.target;return Px(e,t)}),this.addRule("connection.reconnect",function(n){var e=n.connection,t=n.source,i=n.target;return Px(t,i,e)}),this.addRule("connection.updateWaypoints",function(n){let e=n.connection;return{type:e.type,businessObject:e.businessObject}}),this.addRule("elements.move",function(n){var e=n.target,t=n.shapes,i=n.position;return $O(t,e,i)}),this.addRule("shape.create",function(n){var e=n.shape,t=n.target;return NO(e,t)}),this.addRule("shape.resize",function(n){var e=n.shape;return O(e,"dmn:TextAnnotation")})};Rr.prototype.canConnect=Px;Rr.prototype.canCreate=NO;Rr.prototype.canMove=$O;function Px(n,e){if(!n||BO(n)||!e||BO(e))return null;if(n===e)return!1;if(O(n,"dmn:BusinessKnowledgeModel")&&Ge(e,["dmn:BusinessKnowledgeModel","dmn:Decision"]))return{type:"dmn:KnowledgeRequirement"};if(O(n,"dmn:Decision")){if(O(e,"dmn:Decision"))return{type:"dmn:InformationRequirement"};if(O(e,"dmn:KnowledgeSource"))return{type:"dmn:AuthorityRequirement"}}if(O(n,"dmn:Definitions")||O(e,"dmn:Definitions"))return!1;if(O(n,"dmn:InputData")){if(O(e,"dmn:Decision"))return{type:"dmn:InformationRequirement"};if(O(e,"dmn:KnowledgeSource"))return{type:"dmn:AuthorityRequirement"}}return O(n,"dmn:KnowledgeSource")&&Ge(e,["dmn:BusinessKnowledgeModel","dmn:Decision","dmn:KnowledgeSource"])?{type:"dmn:AuthorityRequirement"}:O(n,"dmn:TextAnnotation")&&!O(e,"dmn:TextAnnotation")||!O(n,"dmn:TextAnnotation")&&O(e,"dmn:TextAnnotation")?{type:"dmn:Association"}:!1}function NO(n,e){return Ge(n,["dmn:BusinessKnowledgeModel","dmn:Decision","dmn:InputData","dmn:KnowledgeSource","dmn:TextAnnotation"])&&O(e,"dmn:Definitions")}function $O(n,e){return F(n)||(n=[n]),!!(!e||kt(n,function(t){return Ge(t,["dmn:BusinessKnowledgeModel","dmn:Decision","dmn:InputData","dmn:KnowledgeSource","dmn:TextAnnotation","dmn:InformationRequirement","dmn:AuthorityRequirement","dmn:KnowledgeRequirement","dmn:Association"])})&&O(e,"dmn:Definitions"))}function BO(n){return!!n.labelTarget}var jO={__depends__:[yn],__init__:["drdRules"],drdRules:["type",Rr]};function kn(n){this._model=n}kn.$inject=["moddle"];kn.prototype._needsId=function(n){return Ge(n,["dmn:Artifact","dmn:DMNElement","dmn:DRGElement","dmndi:DMNDiagram","dmndi:DMNDiagramElement"])};kn.prototype._ensureId=function(n){var e=(n.$type||"").replace(/^[^:]*:/g,"")+"_";!n.id&&this._needsId(n)&&(n.id=this._model.ids.nextPrefixed(e,n))};kn.prototype.create=function(n,e){var t=this._model.create(n,e||{});return this._ensureId(t),t};kn.prototype.createDiShape=function(n,e,t){return this.create("dmndi:DMNShape",T({dmnElementRef:n,bounds:this.createDiBounds(e)},t))};kn.prototype.createDiBounds=function(n){return this.create("dc:Bounds",n)};kn.prototype.createDiEdge=function(n,e,t){return this.create("dmndi:DMNEdge",{dmnElementRef:n,waypoint:this.createDiWaypoints(e)},t)};kn.prototype.createDiWaypoints=function(n){var e=this;return n.map(function(t){return e.createDiWaypoint(t)})};kn.prototype.createDiWaypoint=function(n){return this.create("dc:Point",hn(n,["x","y"]))};kn.prototype.createExtensionElements=function(){return this.create("dmn:ExtensionElements",{values:[]})};function Hi(n,e,t,i,r){r.invoke(ae,this),this._definitionPropertiesView=e,this._drdFactory=t,this._drdRules=i;var o=this;function s(f){var h=f.connection,d=f.cropped;d||(h.waypoints=n.getCroppedWaypoints(h),f.cropped=!0)}this.executed(["connection.create","connection.layout"],s,!0),this.reverted(["connection.layout"],function(f){delete f.cropped},!0);function a(f){var h=f.connection,d=f.parent,p=f.shape;h&&!O(h,"dmn:Association")&&(d=h.target),o.updateParent(p||h,d)}function l(f){var h=f.connection,d=f.shape,p=f.parent||f.newParent;h&&!O(h,"dmn:Association")&&(p=h.target),o.updateParent(d||h,p)}this.executed(["connection.create","connection.delete","connection.move","shape.create","shape.delete"],a,!0),this.reverted(["connection.create","connection.delete","connection.move","shape.create","shape.delete"],l,!0);function c(f){var h=f.shape;(O(h,"dmn:DRGElement")||O(h,"dmn:TextAnnotation"))&&o.updateBounds(h)}this.executed(["shape.create","shape.move","shape.resize"],c,!0),this.reverted(["shape.create","shape.move","shape.resize"],c,!0);function u(f){o.updateConnectionWaypoints(f)}this.executed(["connection.create","connection.layout","connection.move","connection.updateWaypoints"],u,!0),this.reverted(["connection.create","connection.layout","connection.move","connection.updateWaypoints"],u,!0),this.executed("connection.create",function(f){var h=f.connection,d=h.businessObject,p=f.target,m=p.businessObject;O(h,"dmn:Association")?a(f):o.updateSemanticParent(d,m)},!0),this.reverted("connection.create",function(f){l(f)},!0),this.executed("connection.reconnect",function(f){var h=f.connection,d=h.businessObject,p=f.newTarget,m=p.businessObject;O(d,"dmn:Association")||o.updateSemanticParent(d,m)},!0),this.reverted("connection.reconnect",function(f){var h=f.connection,d=h.businessObject,p=f.oldTarget,m=p.businessObject;O(d,"dmn:Association")||o.updateSemanticParent(d,m)},!0),this.executed("element.updateProperties",function(f){e.update()},!0),this.reverted("element.updateProperties",function(f){e.update()},!0)}fe(Hi,ae);Hi.$inject=["connectionDocking","definitionPropertiesView","drdFactory","drdRules","injector"];Hi.prototype.updateBounds=function(n){var e=n.businessObject,t=e.di.bounds;T(t,{x:n.x,y:n.y,width:n.width,height:n.height})};Hi.prototype.updateConnectionWaypoints=function(n){var e=this._drdFactory,t=n.connection,i=t.businessObject,r=i.di;r.waypoint=e.createDiWaypoints(t.waypoints).map(function(o){return o.$parent=r,o})};Hi.prototype.updateParent=function(n,e){var t=n.parent;!O(n,"dmn:DRGElement")&&!O(n,"dmn:Artifact")&&(t=e);var i=n.businessObject,r=t&&t.businessObject;this.updateSemanticParent(i,r),this.updateDiParent(i.di,r&&r.di)};Hi.prototype.updateSemanticParent=function(n,e){var t,i;n.$parent!==e&&(O(n,"dmn:DRGElement")?i="drgElement":O(n,"dmn:Artifact")?i="artifact":O(n,"dmn:InformationRequirement")?i="informationRequirement":O(n,"dmn:AuthorityRequirement")?i="authorityRequirement":O(n,"dmn:KnowledgeRequirement")&&(i="knowledgeRequirement"),n.$parent&&(t=n.$parent.get(i),Vn(t,n)),e?(t=e.get(i),t&&(t.push(n),n.$parent=e)):n.$parent=null)};Hi.prototype.updateDiParent=function(n,e){if(n.$parent!==e)if(Ge(n,["dmndi:DMNEdge","dmndi:DMNShape"])){for(var t=e||n;!O(t,"dmndi:DMNDiagram");)t=t.$parent;var i=t.get("diagramElements");e?(n.$parent=t,zt(i,n)):(n.$parent=null,Vn(i,n))}else throw new Error("unsupported")};function Na(n,e){this._modeling=n,this._canvas=e}Na.$inject=["modeling","canvas"];Na.prototype.preExecute=function(n){var e=this._modeling,t=n.elements,i=n.alignment;k(t,function(r){var o={x:0,y:0};Me(i.left)?o.x=i.left-r.x:Me(i.right)?o.x=i.right-r.width-r.x:Me(i.center)?o.x=i.center-Math.round(r.width/2)-r.x:Me(i.top)?o.y=i.top-r.y:Me(i.bottom)?o.y=i.bottom-r.height-r.y:Me(i.middle)&&(o.y=i.middle-Math.round(r.height/2)-r.y),e.moveElements([r],o,r.parent)})};Na.prototype.postExecute=function(n){};function $a(n){this._modeling=n}$a.$inject=["modeling"];$a.prototype.preExecute=function(n){var e=n.source;if(!e)throw new Error("source required");var t=n.target||e.parent,i=n.shape,r=n.hints||{};i=n.shape=this._modeling.createShape(i,n.position,t,{attach:r.attach}),n.shape=i};$a.prototype.postExecute=function(n){var e=n.hints||{};TF(n.source,n.shape)||(e.connectionTarget===n.source?this._modeling.connect(n.shape,n.source,n.connection):this._modeling.connect(n.source,n.shape,n.connection))};function TF(n,e){return zd(n.outgoing,function(t){return t.target===e})}function ja(n,e){this._canvas=n,this._layouter=e}ja.$inject=["canvas","layouter"];ja.prototype.execute=function(n){var e=n.connection,t=n.source,i=n.target,r=n.parent,o=n.parentIndex,s=n.hints;if(!t||!i)throw new Error("source and target required");if(!r)throw new Error("parent required");return e.source=t,e.target=i,e.waypoints||(e.waypoints=this._layouter.layoutConnection(e,s)),this._canvas.addConnection(e,r,o),e};ja.prototype.revert=function(n){var e=n.connection;return this._canvas.removeConnection(e),e.source=null,e.target=null,e};var Em=Math.round;function Lf(n){this._modeling=n}Lf.$inject=["modeling"];Lf.prototype.preExecute=function(n){var e=n.elements,t=n.parent,i=n.parentIndex,r=n.position,o=n.hints,s=this._modeling;k(e,function(f){se(f.x)||(f.x=0),se(f.y)||(f.y=0)});var a=Ee(e,function(f){return!f.hidden}),l=Tt(a);k(e,function(f){Xe(f)&&(f.waypoints=Vt(f.waypoints,function(h){return{x:Em(h.x-l.x-l.width/2+r.x),y:Em(h.y-l.y-l.height/2+r.y)}})),T(f,{x:Em(f.x-l.x-l.width/2+r.x),y:Em(f.y-l.y-l.height/2+r.y)})});var c=E1(e),u={};k(e,function(f){if(Xe(f)){u[f.id]=se(i)?s.createConnection(u[f.source.id],u[f.target.id],i,f,f.parent||t,o):s.createConnection(u[f.source.id],u[f.target.id],f,f.parent||t,o);return}var h=T({},o);c.indexOf(f)===-1&&(h.autoResize=!1),Bi(f)&&(h=Uu(h,["attach"])),u[f.id]=se(i)?s.createShape(f,hn(f,["x","y","width","height"]),f.parent||t,i,h):s.createShape(f,hn(f,["x","y","width","height"]),f.parent||t,h)}),n.elements=Wu(u)};var FO=Math.round;function gi(n){this._canvas=n}gi.$inject=["canvas"];gi.prototype.execute=function(n){var e=n.shape,t=n.position,i=n.parent,r=n.parentIndex;if(!i)throw new Error("parent required");if(!t)throw new Error("position required");return t.width!==void 0?T(e,t):T(e,{x:t.x-FO(e.width/2),y:t.y-FO(e.height/2)}),this._canvas.addShape(e,i,r),e};gi.prototype.revert=function(n){var e=n.shape;return this._canvas.removeShape(e),e};function _s(n){gi.call(this,n)}fe(_s,gi);_s.$inject=["canvas"];var AF=gi.prototype.execute;_s.prototype.execute=function(n){var e=n.shape;return PF(e),e.labelTarget=n.labelTarget,AF.call(this,n)};var MF=gi.prototype.revert;_s.prototype.revert=function(n){return n.shape.labelTarget=null,MF.call(this,n)};function PF(n){["width","height"].forEach(function(e){typeof n[e]=="undefined"&&(n[e]=0)})}function ws(n,e){if(typeof e!="function")throw new Error("removeFn iterator must be a function");if(!n)return[];for(var t;t=n[0];)e(t);return n}function Cs(n,e){this._canvas=n,this._modeling=e}Cs.$inject=["canvas","modeling"];Cs.prototype.preExecute=function(n){var e=this._modeling,t=n.connection;ws(t.incoming,function(i){e.removeConnection(i,{nested:!0})}),ws(t.outgoing,function(i){e.removeConnection(i,{nested:!0})})};Cs.prototype.execute=function(n){var e=n.connection,t=e.parent;return n.parent=t,n.parentIndex=op(t.children,e),n.source=e.source,n.target=e.target,this._canvas.removeConnection(e),e.source=null,e.target=null,e};Cs.prototype.revert=function(n){var e=n.connection,t=n.parent,i=n.parentIndex;return e.source=n.source,e.target=n.target,zt(t.children,e,i),this._canvas.addConnection(e,t),e};function Bf(n,e){this._modeling=n,this._elementRegistry=e}Bf.$inject=["modeling","elementRegistry"];Bf.prototype.postExecute=function(n){var e=this._modeling,t=this._elementRegistry,i=n.elements;k(i,function(r){t.get(r.id)&&(r.waypoints?e.removeConnection(r):e.removeShape(r))})};function Es(n,e){this._canvas=n,this._modeling=e}Es.$inject=["canvas","modeling"];Es.prototype.preExecute=function(n){var e=this._modeling,t=n.shape;ws(t.incoming,function(i){e.removeConnection(i,{nested:!0})}),ws(t.outgoing,function(i){e.removeConnection(i,{nested:!0})}),ws(t.children,function(i){Xe(i)?e.removeConnection(i,{nested:!0}):e.removeShape(i,{nested:!0})})};Es.prototype.execute=function(n){var e=this._canvas,t=n.shape,i=t.parent;return n.oldParent=i,n.oldParentIndex=op(i.children,t),e.removeShape(t),t};Es.prototype.revert=function(n){var e=this._canvas,t=n.shape,i=n.oldParent,r=n.oldParentIndex;return zt(i.children,t,r),e.addShape(t,i),t};function Fa(n){this._modeling=n}Fa.$inject=["modeling"];var qO={x:"y",y:"x"};Fa.prototype.preExecute=function(n){var e=this._modeling,t=n.groups,i=n.axis,r=n.dimension;function o(g,b){g.range.min=Math.min(b[i],g.range.min),g.range.max=Math.max(b[i]+b[r],g.range.max)}function s(g){return g[i]+g[r]/2}function a(g){return g.length-1}function l(g){return g.max-g.min}function c(g,b){var _={y:0};_[i]=g-s(b),_[i]&&(_[qO[i]]=0,e.moveElements([b],_,b.parent))}var u=t[0],f=a(t),h=t[f],d,p,m=0;k(t,function(g,b){var _,v,x;if(g.elements.length<2){b&&b!==t.length-1&&(o(g,g.elements[0]),m+=l(g.range));return}_=Fn(g.elements,i),v=_[0],b===f&&(v=_[a(_)]),x=s(v),g.range=null,k(_,function(C){if(c(x,C),g.range===null){g.range={min:C[i],max:C[i]+C[r]};return}o(g,C)}),b&&b!==t.length-1&&(m+=l(g.range))}),p=Math.abs(h.range.min-u.range.max),d=Math.round((p-m)/(t.length-1)),!(d<t.length-1)&&k(t,function(g,b){var _={},v;g===u||g===h||(v=t[b-1],g.range.max=0,k(g.elements,function(x,C){_[qO[i]]=0,_[i]=v.range.max-x[i]+d,g.range.min!==x[i]&&(_[i]+=x[i]-g.range.min),_[i]&&e.moveElements([x],_,x.parent),g.range.max=Math.max(x[i]+x[r],C?g.range.max:0)}))})};Fa.prototype.postExecute=function(n){};function qa(n,e){this._layouter=n,this._canvas=e}qa.$inject=["layouter","canvas"];qa.prototype.execute=function(n){var e=n.connection,t=e.waypoints;return T(n,{oldWaypoints:t}),e.waypoints=this._layouter.layoutConnection(e,n.hints),e};qa.prototype.revert=function(n){var e=n.connection;return e.waypoints=n.oldWaypoints,e};function Nf(){}Nf.prototype.execute=function(n){var e=n.connection,t=n.delta,i=n.newParent||e.parent,r=n.newParentIndex,o=e.parent;return n.oldParent=o,n.oldParentIndex=Vn(o.children,e),zt(i.children,e,r),e.parent=i,k(e.waypoints,function(s){s.x+=t.x,s.y+=t.y,s.original&&(s.original.x+=t.x,s.original.y+=t.y)}),e};Nf.prototype.revert=function(n){var e=n.connection,t=e.parent,i=n.oldParent,r=n.oldParentIndex,o=n.delta;return Vn(t.children,e),zt(i.children,e,r),e.parent=i,k(e.waypoints,function(s){s.x-=o.x,s.y-=o.y,s.original&&(s.original.x-=o.x,s.original.y-=o.y)}),e};function $f(n,e,t){var i=Yv(e),r=Yv(t),o=xr(n,i),s={x:o.x*(t.width/e.width),y:o.y*(t.height/e.height)};return ma({x:r.x+s.x,y:r.y+s.y})}function Va(n,e,t){var i=Sm(n),r=HO(i,e),o=i[0];return r.length?r[r.length-1]:$f(o.original||o,t,e)}function Ha(n,e,t){var i=Sm(n),r=HO(i,e),o=i[i.length-1];return r.length?r[0]:$f(o.original||o,t,e)}function za(n,e,t){var i=Sm(n),r=VO(e,t),o=i[0];return $f(o.original||o,r,e)}function Wa(n,e,t){var i=Sm(n),r=VO(e,t),o=i[i.length-1];return $f(o.original||o,r,e)}function VO(n,e){return{x:n.x-e.x,y:n.y-e.y,width:n.width,height:n.height}}function Sm(n){var e=n.waypoints;if(!e.length)throw new Error("connection#"+n.id+": no waypoints");return e}function HO(n,e){var t=Vt(n,IF);return Ee(t,function(i){return DF(i,e)})}function DF(n,e){return vt(e,n,1)==="intersect"}function IF(n){return n.original||n}function jf(){this.allShapes={},this.allConnections={},this.enclosedElements={},this.enclosedConnections={},this.topLevel={}}jf.prototype.add=function(n,e){return this.addAll([n],e)};jf.prototype.addAll=function(n,e){var t=k1(n,!!e,this);return T(this,t),this};function wo(n){this._modeling=n}wo.prototype.moveRecursive=function(n,e,t){return n?this.moveClosure(this.getClosure(n),e,t):[]};wo.prototype.moveClosure=function(n,e,t,i,r){var o=this._modeling,s=n.allShapes,a=n.allConnections,l=n.enclosedConnections,c=n.topLevel,u=!1;r&&r.parent===t&&(u=!0),k(s,function(f){o.moveShape(f,e,c[f.id]&&!u&&t,{recurse:!1,layout:!1})}),k(a,function(f){var h=!!s[f.source.id],d=!!s[f.target.id];l[f.id]&&h&&d?o.moveConnection(f,e,c[f.id]&&!u&&t):o.layoutConnection(f,{connectionStart:h&&za(f,f.source,e),connectionEnd:d&&Wa(f,f.target,e)})})};wo.prototype.getClosure=function(n){return new jf().addAll(n,!0)};function Ua(n){this._helper=new wo(n)}Ua.$inject=["modeling"];Ua.prototype.preExecute=function(n){n.closure=this._helper.getClosure(n.shapes)};Ua.prototype.postExecute=function(n){var e=n.hints,t;e&&e.primaryShape&&(t=e.primaryShape,e.oldParent=t.parent),this._helper.moveClosure(n.closure,n.delta,n.newParent,n.newHost,t)};function Tr(n){this._modeling=n,this._helper=new wo(n)}Tr.$inject=["modeling"];Tr.prototype.execute=function(n){var e=n.shape,t=n.delta,i=n.newParent||e.parent,r=n.newParentIndex,o=e.parent;return n.oldBounds=hn(e,["x","y","width","height"]),n.oldParent=o,n.oldParentIndex=Vn(o.children,e),zt(i.children,e,r),T(e,{parent:i,x:e.x+t.x,y:e.y+t.y}),e};Tr.prototype.postExecute=function(n){var e=n.shape,t=n.delta,i=n.hints,r=this._modeling;i.layout!==!1&&(k(e.incoming,function(o){r.layoutConnection(o,{connectionEnd:Wa(o,e,t)})}),k(e.outgoing,function(o){r.layoutConnection(o,{connectionStart:za(o,e,t)})})),i.recurse!==!1&&this.moveChildren(n)};Tr.prototype.revert=function(n){var e=n.shape,t=n.oldParent,i=n.oldParentIndex,r=n.delta;return zt(t.children,e,i),T(e,{parent:t,x:e.x-r.x,y:e.y-r.y}),e};Tr.prototype.moveChildren=function(n){var e=n.delta,t=n.shape;this._helper.moveRecursive(t.children,e,null)};Tr.prototype.getNewParent=function(n){return n.newParent||n.shape.parent};function Ss(n){this._modeling=n}Ss.$inject=["modeling"];Ss.prototype.execute=function(n){var e=n.newSource,t=n.newTarget,i=n.connection,r=n.dockingOrPoints;if(!e&&!t)throw new Error("newSource or newTarget required");return F(r)&&(n.oldWaypoints=i.waypoints,i.waypoints=r),e&&(n.oldSource=i.source,i.source=e),t&&(n.oldTarget=i.target,i.target=t),i};Ss.prototype.postExecute=function(n){var e=n.connection,t=n.newSource,i=n.newTarget,r=n.dockingOrPoints,o=n.hints||{},s={};o.connectionStart&&(s.connectionStart=o.connectionStart),o.connectionEnd&&(s.connectionEnd=o.connectionEnd),o.layoutConnection!==!1&&(t&&(!i||o.docking==="source")&&(s.connectionStart=s.connectionStart||zO(F(r)?r[0]:r)),i&&(!t||o.docking==="target")&&(s.connectionEnd=s.connectionEnd||zO(F(r)?r[r.length-1]:r)),o.newWaypoints&&(s.waypoints=o.newWaypoints),this._modeling.layoutConnection(e,s))};Ss.prototype.revert=function(n){var e=n.oldSource,t=n.oldTarget,i=n.oldWaypoints,r=n.connection;return e&&(r.source=e),t&&(r.target=t),i&&(r.waypoints=i),r};function zO(n){return n.original||n}function yi(n,e){this._modeling=n,this._rules=e}yi.$inject=["modeling","rules"];yi.prototype.preExecute=function(n){var e=this,t=this._modeling,i=this._rules,r=n.oldShape,o=n.newData,s=n.hints||{},a;function l(p,m,g){return i.allowed("connection.reconnect",{connection:g,source:p,target:m})}var c={x:o.x,y:o.y},u={x:r.x,y:r.y,width:r.width,height:r.height};a=n.newShape=n.newShape||e.createShape(o,c,r.parent,s),r.host&&t.updateAttachment(a,r.host);var f;s.moveChildren!==!1&&(f=r.children.slice(),t.moveElements(f,{x:0,y:0},a,s));var h=r.incoming.slice(),d=r.outgoing.slice();k(h,function(p){var m=p.source,g=l(m,a,p);g&&e.reconnectEnd(p,a,Ha(p,a,u),s)}),k(d,function(p){var m=p.target,g=l(a,m,p);g&&e.reconnectStart(p,a,Va(p,a,u),s)})};yi.prototype.postExecute=function(n){var e=n.oldShape;this._modeling.removeShape(e)};yi.prototype.execute=function(n){};yi.prototype.revert=function(n){};yi.prototype.createShape=function(n,e,t,i){return this._modeling.createShape(n,e,t,i)};yi.prototype.reconnectStart=function(n,e,t,i){this._modeling.reconnectStart(n,e,t,i)};yi.prototype.reconnectEnd=function(n,e,t,i){this._modeling.reconnectEnd(n,e,t,i)};function Os(n){this._modeling=n}Os.$inject=["modeling"];Os.prototype.execute=function(n){var e=n.shape,t=n.newBounds,i=n.minBounds;if(t.x===void 0||t.y===void 0||t.width===void 0||t.height===void 0)throw new Error("newBounds must have {x, y, width, height} properties");if(i&&(t.width<i.width||t.height<i.height))throw new Error("width and height cannot be less than minimum height and width");if(!i&&t.width<10||t.height<10)throw new Error("width and height cannot be less than 10px");return n.oldBounds={width:e.width,height:e.height,x:e.x,y:e.y},T(e,{width:t.width,height:t.height,x:t.x,y:t.y}),e};Os.prototype.postExecute=function(n){var e=this._modeling,t=n.shape,i=n.oldBounds,r=n.hints||{};r.layout!==!1&&(k(t.incoming,function(o){e.layoutConnection(o,{connectionEnd:Ha(o,t,i)})}),k(t.outgoing,function(o){e.layoutConnection(o,{connectionStart:Va(o,t,i)})}))};Os.prototype.revert=function(n){var e=n.shape,t=n.oldBounds;return T(e,{width:t.width,height:t.height,x:t.x,y:t.y}),e};function WO(n,e){var t=[];return k(n.concat(e),function(i){var r=i.incoming,o=i.outgoing;k(r.concat(o),function(s){var a=s.source,l=s.target;(Ff(n,a)||Ff(n,l)||Ff(e,a)||Ff(e,l))&&(Ff(t,s)||t.push(s))})}),t}function Ff(n,e){return n.indexOf(e)!==-1}function UO(n,e,t){var i=n.x,r=n.y,o=n.width,s=n.height,a=t.x,l=t.y;switch(e){case"n":return{x:i,y:r+l,width:o,height:s-l};case"s":return{x:i,y:r,width:o,height:s+l};case"w":return{x:i+a,y:r,width:o-a,height:s};case"e":return{x:i,y:r,width:o+a,height:s};default:throw new Error("unknown direction: "+e)}}function zi(n){this._modeling=n}zi.$inject=["modeling"];zi.prototype.preExecute=function(n){var e=n.delta,t=n.direction,i=n.movingShapes,r=n.resizingShapes,o=n.start,s={};this.moveShapes(i,e),k(r,function(a){s[a.id]=BF(a)}),this.resizeShapes(r,e,t),this.updateConnectionWaypoints(WO(i,r),e,t,o,i,r,s)};zi.prototype.execute=function(){};zi.prototype.revert=function(){};zi.prototype.moveShapes=function(n,e){var t=this;k(n,function(i){t._modeling.moveShape(i,e,null,{autoResize:!1,layout:!1,recurse:!1})})};zi.prototype.resizeShapes=function(n,e,t){var i=this;k(n,function(r){var o=UO(r,t,e);i._modeling.resizeShape(r,o,null,{attachSupport:!1,autoResize:!1,layout:!1})})};zi.prototype.updateConnectionWaypoints=function(n,e,t,i,r,o,s){var a=this,l=r.concat(o);k(n,function(c){var u=c.source,f=c.target,h=LF(c),d=GO(t),p={};Co(l,u)&&Co(l,f)?(h=Vt(h,function(m){return KO(m,i,t)&&(m[d]=m[d]+e[d]),m.original&&KO(m.original,i,t)&&(m.original[d]=m.original[d]+e[d]),m}),a._modeling.updateWaypoints(c,h,{labelBehavior:!1})):(Co(l,u)||Co(l,f))&&(Co(r,u)?p.connectionStart=za(c,u,e):Co(r,f)?p.connectionEnd=Wa(c,f,e):Co(o,u)?p.connectionStart=Va(c,u,s[u.id]):Co(o,f)&&(p.connectionEnd=Ha(c,f,s[f.id])),a._modeling.layoutConnection(c,p))})};function QO(n){return T({},n)}function LF(n){return Vt(n.waypoints,function(e){return e=QO(e),e.original&&(e.original=QO(e.original)),e})}function GO(n){switch(n){case"n":return"y";case"w":return"x";case"s":return"y";case"e":return"x"}}function KO(n,e,t){var i=GO(t);if(/e|s/.test(t))return n[i]>e;if(/n|w/.test(t))return n[i]<e}function Co(n,e){return n.indexOf(e)!==-1}function BF(n){return{x:n.x,y:n.y,height:n.height,width:n.width}}function Qa(n){this._modeling=n}Qa.$inject=["modeling"];Qa.prototype.execute=function(n){var e=n.shape,t=e.children;n.oldChildrenVisibility=XO(t),e.collapsed=!e.collapsed;var i=YO(t,e.collapsed);return[e].concat(i)};Qa.prototype.revert=function(n){var e=n.shape,t=n.oldChildrenVisibility,i=e.children,r=ZO(i,t);return e.collapsed=!e.collapsed,[e].concat(r)};function XO(n){var e={};return k(n,function(t){e[t.id]=t.hidden,t.children&&(e=T({},e,XO(t.children)))}),e}function YO(n,e){var t=[];return k(n,function(i){i.hidden=e,t=t.concat(i),i.children&&(t=t.concat(YO(i.children,i.collapsed||e)))}),t}function ZO(n,e){var t=[];return k(n,function(i){i.hidden=e[i.id],t=t.concat(i),i.children&&(t=t.concat(ZO(i.children,e)))}),t}function Ka(n){this._modeling=n}Ka.$inject=["modeling"];Ka.prototype.execute=function(n){var e=n.shape,t=n.newHost,i=e.host;return n.oldHost=i,n.attacherIdx=JO(i,e),ek(t,e),e.host=t,e};Ka.prototype.revert=function(n){var e=n.shape,t=n.newHost,i=n.oldHost,r=n.attacherIdx;return e.host=i,JO(t,e),ek(i,e,r),e};function JO(n,e){return Vn(n&&n.attachers,e)}function ek(n,e,t){if(n){var i=n.attachers;i||(n.attachers=i=[]),zt(i,e,t)}}function qf(){}qf.prototype.execute=function(n){var e=n.connection,t=n.newWaypoints;return n.oldWaypoints=e.waypoints,e.waypoints=t,e};qf.prototype.revert=function(n){var e=n.connection,t=n.oldWaypoints;return e.waypoints=t,e};function Se(n,e,t){this._eventBus=n,this._elementFactory=e,this._commandStack=t;var i=this;n.on("diagram.init",function(){i.registerHandlers(t)})}Se.$inject=["eventBus","elementFactory","commandStack"];Se.prototype.getHandlers=function(){return{"shape.append":$a,"shape.create":gi,"shape.delete":Es,"shape.move":Tr,"shape.resize":Os,"shape.replace":yi,"shape.toggleCollapse":Qa,spaceTool:zi,"label.create":_s,"connection.create":ja,"connection.delete":Cs,"connection.move":Nf,"connection.layout":qa,"connection.updateWaypoints":qf,"connection.reconnect":Ss,"elements.create":Lf,"elements.move":Ua,"elements.delete":Bf,"elements.distribute":Fa,"elements.align":Na,"element.updateAttachment":Ka}};Se.prototype.registerHandlers=function(n){k(this.getHandlers(),function(e,t){n.registerHandler(t,e)})};Se.prototype.moveShape=function(n,e,t,i,r){typeof i=="object"&&(r=i,i=null);var o={shape:n,delta:e,newParent:t,newParentIndex:i,hints:r||{}};this._commandStack.execute("shape.move",o)};Se.prototype.updateAttachment=function(n,e){var t={shape:n,newHost:e};this._commandStack.execute("element.updateAttachment",t)};Se.prototype.moveElements=function(n,e,t,i){i=i||{};var r=i.attach,o=t,s;r===!0?(s=t,o=t.parent):r===!1&&(s=null);var a={shapes:n,delta:e,newParent:o,newHost:s,hints:i};this._commandStack.execute("elements.move",a)};Se.prototype.moveConnection=function(n,e,t,i,r){typeof i=="object"&&(r=i,i=void 0);var o={connection:n,delta:e,newParent:t,newParentIndex:i,hints:r||{}};this._commandStack.execute("connection.move",o)};Se.prototype.layoutConnection=function(n,e){var t={connection:n,hints:e||{}};this._commandStack.execute("connection.layout",t)};Se.prototype.createConnection=function(n,e,t,i,r,o){typeof t=="object"&&(o=r,r=i,i=t,t=void 0),i=this._create("connection",i);var s={source:n,target:e,parent:r,parentIndex:t,connection:i,hints:o};return this._commandStack.execute("connection.create",s),s.connection};Se.prototype.createShape=function(n,e,t,i,r){typeof i!="number"&&(r=i,i=void 0),r=r||{};var o=r.attach,s,a;n=this._create("shape",n),o?(s=t.parent,a=t):s=t;var l={position:e,shape:n,parent:s,parentIndex:i,host:a,hints:r};return this._commandStack.execute("shape.create",l),l.shape};Se.prototype.createElements=function(n,e,t,i,r){F(n)||(n=[n]),typeof i!="number"&&(r=i,i=void 0),r=r||{};var o={position:e,elements:n,parent:t,parentIndex:i,hints:r};return this._commandStack.execute("elements.create",o),o.elements};Se.prototype.createLabel=function(n,e,t,i){t=this._create("label",t);var r={labelTarget:n,position:e,parent:i||n.parent,shape:t};return this._commandStack.execute("label.create",r),r.shape};Se.prototype.appendShape=function(n,e,t,i,r){r=r||{},e=this._create("shape",e);var o={source:n,position:t,target:i,shape:e,connection:r.connection,connectionParent:r.connectionParent,hints:r};return this._commandStack.execute("shape.append",o),o.shape};Se.prototype.removeElements=function(n){var e={elements:n};this._commandStack.execute("elements.delete",e)};Se.prototype.distributeElements=function(n,e,t){var i={groups:n,axis:e,dimension:t};this._commandStack.execute("elements.distribute",i)};Se.prototype.removeShape=function(n,e){var t={shape:n,hints:e||{}};this._commandStack.execute("shape.delete",t)};Se.prototype.removeConnection=function(n,e){var t={connection:n,hints:e||{}};this._commandStack.execute("connection.delete",t)};Se.prototype.replaceShape=function(n,e,t){var i={oldShape:n,newData:e,hints:t||{}};return this._commandStack.execute("shape.replace",i),i.newShape};Se.prototype.alignElements=function(n,e){var t={elements:n,alignment:e};this._commandStack.execute("elements.align",t)};Se.prototype.resizeShape=function(n,e,t,i){var r={shape:n,newBounds:e,minBounds:t,hints:i};this._commandStack.execute("shape.resize",r)};Se.prototype.createSpace=function(n,e,t,i,r){var o={delta:t,direction:i,movingShapes:n,resizingShapes:e,start:r};this._commandStack.execute("spaceTool",o)};Se.prototype.updateWaypoints=function(n,e,t){var i={connection:n,newWaypoints:e,hints:t||{}};this._commandStack.execute("connection.updateWaypoints",i)};Se.prototype.reconnect=function(n,e,t,i,r){var o={connection:n,newSource:e,newTarget:t,dockingOrPoints:i,hints:r||{}};this._commandStack.execute("connection.reconnect",o)};Se.prototype.reconnectStart=function(n,e,t,i){i||(i={}),this.reconnect(n,e,n.target,t,T(i,{docking:"source"}))};Se.prototype.reconnectEnd=function(n,e,t,i){i||(i={}),this.reconnect(n,n.source,e,t,T(i,{docking:"target"}))};Se.prototype.connect=function(n,e,t,i){return this.createConnection(n,e,t||{},n.parent,i)};Se.prototype._create=function(n,e){return tC(e)?e:this._elementFactory.create(n,e)};Se.prototype.toggleCollapse=function(n,e){var t={shape:n,hints:e||{}};this._commandStack.execute("shape.toggleCollapse",t)};function Ga(n){this._moddle=n}Ga.$inject=["moddle"];Ga.prototype.execute=function(n){var e=this._moddle.ids,t=n.id,i=n.element,r=n.claiming;r?e.claim(t,i):e.unclaim(t)};Ga.prototype.revert=function(n){var e=this._moddle.ids,t=n.id,i=n.element,r=n.claiming;r?e.unclaim(t):e.claim(t,i)};function Dx(){function n(i,r){var o=i.label||i,s=i.labelTarget||i;return yE(o,r,s!==o),[o,s]}function e(i){return i.oldLabel=fs(i.element),n(i.element,i.newLabel)}function t(i){return n(i.element,i.oldLabel)}this.execute=e,this.revert=t}var NF="name",Ar="id";function Xa(n,e){this._elementRegistry=n,this._moddle=e}Xa.$inject=["elementRegistry","moddle"];Xa.prototype.execute=function(n){let{element:e,properties:t}=n,i=[e];if(!e)throw new Error("element required");let r=this._elementRegistry,o=this._moddle.ids,s=Ke(e),a=n.oldProperties||$F(s,di(t));return tk(t,s)&&(o.unclaim(s[Ar]),r.updateId(e,t[Ar]),o.claim(t[Ar],s)),NF in t&&e.label&&i.push(e.label),nk(s,t),n.oldProperties=a,n.changed=i,i};Xa.prototype.revert=function(n){let{element:e,properties:t,oldProperties:i}=n,r=Ke(e),o=this._elementRegistry,s=this._moddle.ids;return nk(r,i),tk(t,r)&&(s.unclaim(t[Ar]),o.updateId(e,i[Ar]),s.claim(i[Ar],r)),n.changed};function tk(n,e){return Ar in n&&n[Ar]!==e[Ar]}function $F(n,e){return st(e,function(t,i){return t[i]=n.get(i),t},{})}function nk(n,e){k(e,function(t,i){n.set(i,t)})}function Ya(n){this._elementRegistry=n}Ya.$inject=["elementRegistry"];Ya.prototype.execute=function(n){var e=n.element,t=n.moddleElement,i=n.properties;if(!t)throw new Error("<moddleElement> required");var r=n.changed||[e],o=n.oldProperties||jF(t,di(i));return ik(t,i),n.oldProperties=o,n.changed=r,r};Ya.prototype.revert=function(n){var e=n.oldProperties,t=n.moddleElement,i=n.changed;return ik(t,e),i};function jF(n,e){return st(e,function(t,i){return t[i]=n.get(i),t},{})}function ik(n,e){k(e,function(t,i){n.set(i,t)})}function Xn(n,e,t){this._canvas=n,this._drdRules=e,t.invoke(Se,this)}fe(Xn,Se);Xn.$inject=["canvas","drdRules","injector"];Xn.prototype.claimId=function(n,e){this._commandStack.execute("id.updateClaim",{id:n,element:e,claiming:!0})};Xn.prototype.connect=function(n,e,t,i){var r=this._drdRules,o=this._canvas.getRootElement();return t||(t=r.canConnect(n,e)||{type:"dmn:Association"}),this.createConnection(n,e,t,o,i)};Xn.prototype.getHandlers=function(){var n=Se.prototype.getHandlers.call(this);return n["id.updateClaim"]=Ga,n["element.updateLabel"]=Dx,n["element.updateProperties"]=Xa,n["element.updateModdleProperties"]=Ya,n};Xn.prototype.unclaimId=function(n,e){this._commandStack.execute("id.updateClaim",{id:n,element:e})};Xn.prototype.updateModdleProperties=function(n,e,t){this._commandStack.execute("element.updateModdleProperties",{element:n,moddleElement:e,properties:t})};Xn.prototype.updateProperties=function(n,e){this._commandStack.execute("element.updateProperties",{element:n,properties:e})};Xn.prototype.updateLabel=function(n,e,t,i){this._commandStack.execute("element.updateLabel",{element:n,newLabel:e,newBounds:t,hints:i||{}})};function Om(){}Om.prototype.layoutConnection=function(n,e){return e=e||{},[e.connectionStart||le(e.source||n.source),e.connectionEnd||le(e.target||n.target)]};var km=20;function Za(n){this._connectionDocking=n}fe(Za,Om);Za.$inject=["connectionDocking"];Za.prototype.layoutConnection=function(n,e){var t=this._connectionDocking;e||(e={});var i=e.source||n.source,r=e.target||n.target,o=e.waypoints||n.waypoints||[],s=e.connectionStart,a=e.connectionEnd,l=vt(i,r);if(s||(s=rk(o[0],i)),a||(a=rk(o[o.length-1],r)),O(n,"dmn:InformationRequirement")){o=[s,a];var c=t.getCroppedWaypoints(T({},n,{waypoints:o}),i,r);a=c.pop();var u={x:a.x,y:a.y};return l.includes("bottom")?u.y+=km:l.includes("top")?u.y-=km:l.includes("right")?u.x+=km:u.x-=km,o=c.concat([u,a]),o}return[s,a]};function rk(n,e){return n?n.original||n:le(e)}function ok(n){return T({original:n.point.original||n.point},n.actual)}function Wi(n,e){this._elementRegistry=n,this._graphicsFactory=e}Wi.$inject=["elementRegistry","graphicsFactory"];Wi.prototype.getCroppedWaypoints=function(n,e,t){e=e||n.source,t=t||n.target;var i=this.getDockingPoint(n,e,!0),r=this.getDockingPoint(n,t),o=n.waypoints.slice(i.idx+1,r.idx);return o.unshift(ok(i)),o.push(ok(r)),o};Wi.prototype.getDockingPoint=function(n,e,t){var i=n.waypoints,r,o,s;return r=t?0:i.length-1,o=i[r],s=this._getIntersection(e,n,t),{point:o,actual:s||o,idx:r}};Wi.prototype._getIntersection=function(n,e,t){var i=this._getShapePath(n),r=this._getConnectionPath(e);return tf(i,r,t)};Wi.prototype._getConnectionPath=function(n){return this._graphicsFactory.getConnectionPath(n)};Wi.prototype._getShapePath=function(n){return this._graphicsFactory.getShapePath(n)};Wi.prototype._getGfx=function(n){return this._elementRegistry.getGraphics(n)};var sk={__init__:["modeling","drdUpdater"],__depends__:[LO,jO,Ca,xs,ht,Cm],drdFactory:["type",kn],drdUpdater:["type",Hi],elementFactory:["type",_r],modeling:["type",Xn],layouter:["type",Za],connectionDocking:["type",Wi]};var FF=500,qF=1e3;function Mr(n,e){this._eventBus=n,this.offset=5;var t=e.cls("djs-outline",["no-fill"]),i=this;function r(o){var s=Q("rect");return j(s,T({x:0,y:0,rx:4,width:100,height:100},t)),s}n.on(["shape.added","shape.changed"],FF,function(o){var s=o.element,a=o.gfx,l=X(".djs-outline",a);l||(l=i.getOutline(s)||r(a),K(a,l)),i.updateShapeOutline(l,s)}),n.on(["connection.added","connection.changed"],function(o){var s=o.element,a=o.gfx,l=X(".djs-outline",a);l||(l=r(a),K(a,l)),i.updateConnectionOutline(l,s)})}Mr.prototype.updateShapeOutline=function(n,e){var t=!1,i=this._getProviders();i.length&&k(i,function(r){t=t||r.updateOutline(e,n)}),t||j(n,{x:-this.offset,y:-this.offset,width:e.width+this.offset*2,height:e.height+this.offset*2})};Mr.prototype.updateConnectionOutline=function(n,e){var t=Tt(e);j(n,{x:t.x-this.offset,y:t.y-this.offset,width:t.width+this.offset*2,height:t.height+this.offset*2})};Mr.prototype.registerProvider=function(n,e){e||(e=n,n=qF),this._eventBus.on("outline.getProviders",n,function(t){t.providers.push(e)})};Mr.prototype._getProviders=function(){var n=this._eventBus.createEvent({type:"outline.getProviders",providers:[]});return this._eventBus.fire(n),n.providers};Mr.prototype.getOutline=function(n){var e,t=this._getProviders();return k(t,function(i){ge(i.getOutline)&&(e=e||i.getOutline(n))}),e};Mr.$inject=["eventBus","styles","elementRegistry"];var Rm=6;function Vf(n,e,t){this._canvas=e;var i=this;n.on("element.changed",function(r){t.isSelected(r.element)&&i._updateMultiSelectionOutline(t.get())}),n.on("selection.changed",function(r){var o=r.newSelection;i._updateMultiSelectionOutline(o)})}Vf.prototype._updateMultiSelectionOutline=function(n){var e=this._canvas.getLayer("selectionOutline");ss(e);var t=n.length>1,i=this._canvas.getContainer();if(ne(i)[t?"add":"remove"]("djs-multi-select"),!!t){var r=VF(Tt(n)),o=Q("rect");j(o,T({rx:3},r)),ne(o).add("djs-selection-outline"),K(e,o)}};Vf.$inject=["eventBus","canvas","selection"];function VF(n){return{x:n.x-Rm,y:n.y-Rm,width:n.width+Rm*2,height:n.height+Rm*2}}var Tm={__depends__:[ht],__init__:["outline","multiSelectionOutline"],outline:["type",Mr],multiSelectionOutline:["type",Vf]};var HF=500,zF=1250,WF=1500,Am=Math.round;function UF(n){return{x:n.x+Am(n.width/2),y:n.y+Am(n.height/2)}}function Mm(n,e,t,i,r){function o(a,l,c,u){return r.allowed("elements.move",{shapes:a,delta:l,position:c,target:u})}n.on("shape.move.start",WF,function(a){var l=a.context,c=a.shape,u=i.get().slice();u.indexOf(c)===-1&&(u=[c]),u=QF(u),T(l,{shapes:u,validatedShapes:u,shape:c})}),n.on("shape.move.start",zF,function(a){var l=a.context,c=l.validatedShapes,u;if(u=l.canExecute=o(c),!u)return!1}),n.on("shape.move.move",HF,function(a){var l=a.context,c=l.validatedShapes,u=a.hover,f={x:a.dx,y:a.dy},h={x:a.x,y:a.y},d;if(d=o(c,f,h,u),l.delta=f,l.canExecute=d,d===null){l.target=null;return}l.target=u}),n.on("shape.move.end",function(a){var l=a.context,c=l.delta,u=l.canExecute,f=u==="attach",h=l.shapes;if(u===!1)return!1;c.x=Am(c.x),c.y=Am(c.y),!(c.x===0&&c.y===0)&&t.moveElements(h,c,l.target,{primaryShape:l.shape,attach:f})}),n.on("element.mousedown",function(a){if(Sn(a)){var l=vr(a);if(!l)throw new Error("must supply DOM mousedown event");return s(l,a.element)}});function s(a,l,c,u){if(Pe(c)&&(u=c,c=!1),!(l.waypoints||!l.parent)&&!ne(a.target).has("djs-hit-no-move")){var f=UF(l),h=e.init(a,f,"shape.move",{cursor:"grabbing",autoActivate:c,data:{shape:l,context:u||{}}});if(h!==!1)return!0}}this.start=s}Mm.$inject=["eventBus","dragging","modeling","selection","rules"];function QF(n){var e=ur(n,"id");return Ee(n,function(t){for(;t=t.parent;)if(e[t.id])return!1;return!0})}var ak=499,Ix="djs-dragging",lk="drop-ok",ck="drop-not-ok",uk="new-parent",fk="attach-ok";function Pm(n,e,t,i){function r(l){var c=o(l),u=KF(c);return u}function o(l){var c=O1(l,!0),u=c.flatMap(d=>(d.incoming||[]).concat(d.outgoing||[])),f=c.concat(u),h=[...new Set(f)];return h}function s(l,c){[fk,lk,ck,uk].forEach(function(u){u===c?e.addMarker(l,u):e.removeMarker(l,u)})}function a(l,c,u){i.addDragger(c,l.dragGroup),u&&e.addMarker(c,Ix),l.allDraggedElements?l.allDraggedElements.push(c):l.allDraggedElements=[c]}n.on("shape.move.start",ak,function(l){var c=l.context,u=c.shapes,f=c.allDraggedElements,h=r(u);if(!c.dragGroup){var d=Q("g");j(d,t.cls("djs-drag-group",["no-events"]));var p=e.getActiveLayer();K(p,d),c.dragGroup=d}h.forEach(function(m){i.addDragger(m,c.dragGroup)}),f?f=Dw([f,o(u)]):f=o(u),k(f,function(m){e.addMarker(m,Ix)}),c.allDraggedElements=f,c.differentParents=GF(u)}),n.on("shape.move.move",ak,function(l){var c=l.context,u=c.dragGroup,f=c.target,h=c.shape.parent,d=c.canExecute;f&&(d==="attach"?s(f,fk):c.canExecute&&h&&f.id!==h.id?s(f,uk):s(f,c.canExecute?lk:ck)),jt(u,l.dx,l.dy)}),n.on(["shape.move.out","shape.move.cleanup"],function(l){var c=l.context,u=c.target;u&&s(u,null)}),n.on("shape.move.cleanup",function(l){var c=l.context,u=c.allDraggedElements,f=c.dragGroup;k(u,function(h){e.removeMarker(h,Ix)}),f&&Fe(f)}),this.makeDraggable=a}Pm.$inject=["eventBus","canvas","styles","previewSupport"];function KF(n){var e=Ee(n,function(t){return Xe(t)?ye(n,la({id:t.source.id}))&&ye(n,la({id:t.target.id})):!0});return e}function GF(n){return Lw(ur(n,function(e){return e.parent&&e.parent.id}))!==1}var hk={__depends__:[fo,ht,Tm,yn,gn,ka],__init__:["move","movePreview"],move:["type",Mm],movePreview:["type",Pm]};var dk=` 288 %s`,this.path,this.context,CP(e," ")),this)}token(e){return Wr&&console.log("[%s] token <%s> + <%s>",this.path,this.tokens.join(" "),e),this.assign({tokens:[...this.tokens,e]})}literal(e){return Wr&&console.log("[%s] literal %o",this.path,e),this.pushChild(this.of({name:"Literal",value:e}))}computedValue(){for(let e=this;;e=xc(e.children)){if(!e)return null;if(!Yr(e.value))return e.value}}contextCache(){let e=this.cache.get(this.context);return e||(e=SP(this.context),this.cache.set(this.context,e)),e}get path(){var e,t;return((t=(e=this.parent)==null?void 0:e.path)==null?void 0:t.concat(" > ",this.name))||this.name}get(e){let t=e&&U_(e),i=this.contextCache().originalMap.get(t);if(typeof i=="undefined")return;let r=this.context.get(i);return r instanceof bc?r.get(this):r}resolveName(){let e=this.tokens.join(" "),t=[],i=this.assign({tokens:t}),r=this.of({name:"VariableName",parent:i,value:this.get(e),raw:e});return Wr&&console.log("[%s] resolve name <%s=%s>",r.path,e,this.get(e)),i.pushChild(r)}pushChild(e){if(!e)return this;let t=this.assign({children:[...this.children,e]});return e.parent=t,t}pushChildren(e){let t=this;for(let i of e)t=t.pushChild(i);return t}declareName(){if(this.tokens.length===0)throw Error("no tokens to declare name");let e=this.tokens.join(" ");return Wr&&console.log("[%s] declareName <%s>",this.path,e),this.assign({tokens:[]}).pushChild(this.of({name:"Name",value:e}))}define(e,t){if(typeof e!="string")return Wr&&console.log("[%s] no define <%s=%s>",this.path,e,t),this;Wr&&console.log("[%s] define <%s=%s>",this.path,e,t);let i=this.context,r=i.set(e,t),o=this.cache.get(i)||SP(i),s=NP(e,$P(o));return this.cache.set(r,s),this.assign({context:r})}assign(e={}){return n.of({...this,...e})}of(e={}){let t={context:this.context,parent:this.parent};return n.of({...t,...e})}static of(e){let{name:t,tokens:i=[],children:r=[],parent:o=null,context:s,value:a,raw:l,__cache:c}=e;if(!s)throw new Error("must provide <context>");return new n({name:t,tokens:[...i],children:[...r],context:s,parent:o,value:a,raw:l,__cache:c})}};function U_(n){return n.replace(/\s*([./\-'+]|\*\*?)\s*/g," $1 ").replace(/\s{2,}/g," ").trim()}function OP(n,e,t){var c;let i=n.children.filter(u=>u.name!==e),r=n.children.filter(u=>u.name===e),o=i[0],s=i[Math.max(1,i.length-1)],a=o==null?void 0:o.computedValue(),l=(c=s==null?void 0:s.computedValue())!=null?c:null;return n.assign({children:r}).enterScope(e).pushChildren(i).exitScope(t).define(a,l)}function Q_(n={},e=q_){let t=V_.of({context:e.of(n)});return new My({start:t,reduce(i,r,o,s){if(r===RP){let[f,h]=i.children.slice(-2);i=i.assign({value:e.of(f==null?void 0:f.computedValue(),h==null?void 0:h.computedValue())})}if(r===DP&&(i=i.assign({value:e.of(...i.children.map(f=>f==null?void 0:f.computedValue()))})),r===AP){let[f,h]=i.children.slice(-2);i=i.assign({value:f==null?void 0:f.computedValue()})}if(r===PP){let[f,...h]=i.children;(f==null?void 0:f.raw)==="get value"?i=Nz(i,h):i=i.assign({value:(f==null?void 0:f.computedValue())||e.of(void 0)})}let a=Pz[r];if(a)return i.enterScope(a);let l=Mz[r];if(l){let{children:f,context:h}=i,d=f.slice(0,-1),p=xc(f),m=null;return r===TP&&(m=e.of(p==null?void 0:p.computedValue())),r===MP&&(m=e.of(h,p==null?void 0:p.computedValue()).set("item",p==null?void 0:p.computedValue())),i.assign({children:d}).enterScope(l).pushChild(p).assign({context:m||h})}let c=s.read(s.pos,o.pos);if(Dz[r])return i.exitScope(c);if(r===gz){let f=i.children.filter(p=>p.name!=="ContextEntry"),h=f[0],d=xc(f);return OP(i,"ContextEntry",c).assign({value:e.of(i.value).set(h==null?void 0:h.computedValue(),d==null?void 0:d.computedValue())})}if(r===V6||r===X6)return OP(i,"InExpression",c);if(r===U6)return i.define("partial",bc.of(f=>{var h;return(h=xc(f.children))==null?void 0:h.computedValue()}));if(r===sz){let f=xc(i.children).computedValue();return i.define(f,1)}if(r===J6||r===ez||r===tz){let f=i.children.slice(0,-1),h=xc(i.children);return i.assign({children:f}).enterScope("ArithmeticExpression").pushChild(h)}if(r===nz)return i.enterScope("ArithmeticExpression");if(r===z6||r===W6||r===vz)return i.token(c);if(r===cz)return i.literal(c.replace(/^"|"$/g,"").replace(/\\(["\\])/g,"$1"));if(r===uz)return i.literal(c==="true");if(r===lz)return i.literal(parseFloat(c));if(r===az)return i.literal(null);if(r===iz)return i.resolveName();if(r===H6||r===yz)return i.declareName();if((r===_P||r===Y6)&&i.tokens.length>0)throw new Error("uncleared name");if(r===_P){let f=i;for(;f.parent;)f=f.exitScope(c);return f}return i}})}var Bz=Q_({});function Nz(n,e){if(!e.length)return n.assign({value:null});if(e[0].name==="Name"&&(e=$z(e,["m","key"])),e.length!==2)return n.assign({value:null});let[t,i]=e,r=i==null?void 0:i.computedValue(),o=t==null?void 0:t.computedValue();return!o||typeof o!="object"||typeof r!="string"?n.assign({value:null}):n.assign({value:[U_(r),r].reduce((s,a)=>o.get(a)||s,null)})}function $z(n,e){let t={};for(let i=0;i<n.length;i+=2){let[r,o]=n.slice(i,i+2);t[r.value]=o}return e.map(i=>t[i])}function xc(n){return n[n.length-1]}var jz=cy({StringLiteral:B.string,NumericLiteral:B.number,BooleanLiteral:B.bool,"AtLiteral!":B.special(B.string),CompareOp:B.compareOperator,ArithOp:B.arithmeticOperator,"for if then else some every return":B.controlKeyword,"in instance of and or satisfies between as":B.operatorKeyword,function:B.definitionKeyword,"Type/...":B.typeName,"Wildcard!":B.modifier,null:B.null,LineComment:B.lineComment,BlockComment:B.blockComment,"VariableName!":B.variableName,'"?"':B.special(B.variableName),"DateTimeConstructor! SpecialFunctionName!":B.standard(B.function(B.variableName)),"FunctionInvocation/VariableName!":B.function(B.variableName),"Name!":B.definition(B.variableName),"Key/Name! ContextEntryType/Name!":B.definition(B.propertyName),"PathExpression/VariableName!":B.propertyName,"FormalParameter/ParameterName!":B.function(B.definition(B.variableName)),"( )":B.paren,"[ ]":B.squareBracket,"{ }":B.brace,".":B.derefOperator,", ;":B.separator,"..":B.punctuation}),Fz={__proto__:null,for:10,in:32,return:36,if:40,then:42,else:44,some:48,every:50,satisfies:56,or:60,and:64,between:72,instance:86,of:89,days:101,time:103,duration:105,years:107,months:109,date:111,list:117,context:123,function:130,null:156,true:330,false:330,"?":170,external:186,not:211},jP=Py.deserialize({version:14,states:"CjO`QYOOO`QYOOO$yQYOOOOQU'#Ce'#CeO%TQYO'#C`O&^QYO'#FQOOQQ'#Fe'#FeO&hQYO'#FeO`QYO'#DVOOQU'#En'#EnO(_Q^O'#D]OOQU'#D^'#D^OOQU'#D]'#D]OOQO'#Fm'#FmO*[QWO'#DvOOQQ'#D}'#D}OOQQ'#EO'#EOOOQQ'#EP'#EPO*aOWO'#ESO*[QWO'#EQOOQQ'#EQ'#EQOOQQ'#Fs'#FsOOQQ'#Fq'#FqOOQQ'#Fy'#FyOOQQ'#EU'#EUO`QYO'#EWOOQQ'#FS'#FSO*iQ^O'#FSO,`QYO'#EXO,gQWO'#EYOOQP'#F}'#F}O,lQXO'#EaOOQQ'#Fz'#FzOOQQ'#FR'#FRQOQWOOOOQQ'#FT'#FTOOQQ'#F^'#F^O`QYO'#CoOOQQ'#F_'#F_O%TQYO'#CsO,zQYO'#DwOOQQ'#Fr'#FrO-PQYO'#EROOQO'#ER'#ERO`QYO'#EVO`QYO'#EUOOQO'#F{'#F{Q-XQWOOO-^QYO'#DRO.TQWO'#FaOOQO'#DT'#DTO.`QYO'#FeO.gQWOOO/^QYO'#CdO/kQYO'#FVOOQQ'#Cc'#CcO/pQYO'#FUOOQQ'#Cb'#CbO/xQYO,58zO`QYO,59iOOQQ'#Fb'#FbOOQQ'#Fc'#FcOOQQ'#Fd'#FdO`QYO,59qO`QYO,59qO`QYO,59qOOQQ'#Fk'#FkO/}QYO,5:^OOQQ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x&Z!k^OPQWilu|}!]!a!b!c!g!h!i!j!k!p#Y#[#^#b#f#q#}$O$X$]$`$o${%V%a%v%wQ!q^R!scR#y!pQ!wlR#z!p!kfOPQWilu|}!]!a!b!c!g!h!i!j!k!p#Y#[#^#b#f#q#}$O$X$]$`$o${%V%a%v%w!klOPQWilu|}!]!a!b!c!g!h!i!j!k!p#Y#[#^#b#f#q#}$O$X$]$`$o${%V%a%v%w!kmOPQWilu|}!]!a!b!c!g!h!i!j!k!p#Y#[#^#b#f#q#}$O$X$]$`$o${%V%a%v%wR$T!x!koOPQWilu|}!]!a!b!c!g!h!i!j!k!p#Y#[#^#b#f#q#}$O$X$]$`$o${%V%a%v%wR#Oo",nodeNames:"\u26A0 LineComment BlockComment Expression ForExpression for InExpressions InExpression Name Identifier Identifier ArithOp ArithOp ArithOp ArithOp ArithOp in IterationContext return IfExpression if then else QuantifiedExpression some every InExpressions InExpression satisfies Disjunction or Conjunction and Comparison CompareOp CompareOp between PositiveUnaryTest ( PositiveUnaryTests ) ArithmeticExpression InstanceOfExpression instance of Type QualifiedName VariableName BacktickIdentifier SpecialType days time duration years months date > ListType list < ContextType context ContextEntryTypes ContextEntryType FunctionType function ArgumentTypes ArgumentType PathExpression ] FilterExpression [ FunctionInvocation SpecialFunctionName NamedParameters NamedParameter ParameterName PositionalParameters null NumericLiteral StringLiteral BooleanLiteral DateTimeLiteral DateTimeConstructor AtLiteral ? SimplePositiveUnaryTest Interval ParenthesizedExpression List FunctionDefinition FormalParameters FormalParameter external FunctionBody } { Context ContextEntry Key Name Identifier Expressions UnaryTests Wildcard not",maxTerm:173,context:Bz,nodeProps:[["group",-17,4,19,23,29,31,33,41,42,68,70,72,85,86,88,89,90,97,"Expr",47,"Expr Expr",-5,78,79,80,81,82,"Expr Literal"],["closedBy",38,")",71,"]",96,"}"],["openedBy",40,"(",69,"[",95,"{"]],propSources:[jz],skippedNodes:[0,1,2],repeatNodeCount:14,tokenData:".v~RvXY#iYZ$^Z[#i]^$^p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i~~-}O!g~~.QTO#S-}#S#T.a#T;'S-};'S;=`.f<%lO-}~.fO$Y~~.iP;=`<%l-}~.qO#S~~.vO#R~",tokenizers:[Tz,Rz,Az,0,1],topRules:{Expression:[0,3],Expressions:[1,102],UnaryTests:[2,103]},dialects:{camunda:2564},dynamicPrecedences:{31:-1,68:1,72:-1,74:-1},specialized:[{term:122,get:n=>Fz[n]||-1}],tokenPrec:2567});function qz(n){let e=[];return n.iterate({enter:t=>{let i=t.node;if(!i.type.isError)return;let r=i.parent,o=qP(i),s={from:i.from,to:i.to,severity:"error",type:"Syntax Error"};if(i.from!==i.to)s.message=`Unrecognized token in <${r.name}>`;else if(o)s.message=`Unrecognized token <${o.name}> in <${r.name}>`,s.to=o.to;else{let a=r.enterUnfinishedNodesBefore(i.to);s.message=`Incomplete <${(a||r).name}>`}e.push(s)}}),e}function qP(n){return n?n.nextSibling||qP(n.parent):null}var Vz="first-item",Hz={create(n){return{enter(e){if(e.name!=="FilterExpression")return;let t=n.readContent(e.from,e.to);if(FP().test(t)){let{from:i,to:r}=e;n.report({from:i,to:r,message:"First item is accessed via [1]",severity:"warning",type:Vz,actions:[{name:"fix",apply(o,s=i,a=r){n.updateContent(s,a,t.replace(FP(),"[1]"))}}]})}}}}};function FP(){return/\[\s*0\s*\]$/}var zz=[Hz];function Wz(n){let{readContent:e,syntaxTree:t,updateContent:i}=n,r=[],o={readContent:e,report:a=>{r.push(a)},updateContent:i},s=zz.map(a=>a.create(o));return t.iterate({enter:a=>{for(let l of s)l.enter&&l.enter(a)},leave:a=>{for(let l of s)l.leave&&l.leave(a)}}),r}function Uz(n){return[...qz(n.syntaxTree),...Wz(n)]}var VP=()=>n=>{if(n.state.doc.length===0)return[];let e=lt(n.state);return Uz({syntaxTree:e,readContent:(i,r)=>n.state.sliceDoc(i,r),updateContent:(i,r,o)=>n.dispatch({changes:{from:i,to:r,insert:o}})}).map(i=>({...i,source:i.type}))};var G_=[li("function(${params}) ${body}",{label:"function",detail:"definition",type:"keyword"}),li("for ${var} in ${collection} return ${value}",{label:"for",detail:"expression",type:"keyword"}),li("every ${var} in ${collection} satisfies ${condition}",{label:"every",detail:"quantified expression",type:"keyword"}),li("some ${var} in ${collection} satisfies ${condition}",{label:"some",detail:"quantified expression",type:"keyword"}),li("if ${condition} then ${value} else ${other value}",{label:"if",detail:"block",type:"keyword"}),li("{ ${key}: ${value} }",{label:"context",detail:"block",type:"keyword"}),li("null",{label:"null",detail:"literal",type:"keyword"}),li("true",{label:"true",detail:"literal",type:"keyword"}),li("false",{label:"false",detail:"literal",type:"keyword"})];function K_(){return K_=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)({}).hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},K_.apply(null,arguments)}function Xh(n){let{context:e,after:t,before:i,keyword:r}=n;return Yz({nodes:e,before:i,after:t,keyword:r},pc([{label:r,type:"keyword",boost:10}]))}var X_=[Xh({context:"InExpression",keyword:"in"}),Xh({context:"IfExpression",keyword:"then",after:"if",before:"else"}),Xh({context:"IfExpression",keyword:"else",after:"then"}),Xh({context:"QuantifiedExpression",keyword:"satisfies"}),Xh({context:"ForExpression",after:"InExpressions",keyword:"return"})],HP=["StringLiteral","Identifier","LineComment","BlockComment","PathExpression","Context","Key","ParameterName"],Qz=["Expr","ContextEntry"];function Kz(n){let e=[...HP,...Qz];return t=>{let{state:i,pos:r}=t,o=UP(lt(i).resolveInner(r,-1),e);if(o){let[s,a]=o;if(HP.includes(a))return null}return n(t)}}function Gz(n){return Kz(pc(n.map(e=>K_({},e,{type:"text"}))))}function zP(n,e,t){return WP(n,e,t,-1)}function Xz(n,e,t){return WP(n,e,t,1)}function WP(n,e,t,i){let r=n[i>0?"childAfter":"childBefore"](e);for(;r;){if(t.includes(r.name))return r;if(r.type.isError&&r.firstChild&&t.includes(r.firstChild.name))return r.firstChild;r=r[i>0?"nextSibling":"prevSibling"]}return null}function UP(n,e){for(Array.isArray(e)||(e=[e]);n;n=n.parent){let t=n.type,i=e.find(r=>r&&t.is(r));if(i)return[n,i];if(t.isTop)break}return null}function Yz(n,e){let{nodes:t,before:i,after:r,keyword:o}=n;return s=>{let{state:a,pos:l}=s,c=UP(lt(a).resolveInner(l,-1),t);if(!c)return null;let[u]=c;return zP(u,l,[o,i])||Xz(u,l,[o,r])||r&&!zP(u,l,[r])?null:e(s)}}var QP=uy.define({parser:jP.configure({props:[t_.add({Context:n_({closing:"}"}),"List FilterExpression":n_({closing:"]"}),"ParenthesizedExpression FunctionInvocation":dy({except:/^\s*\)/}),"ForExpression QuantifiedExpression IfExpression":dy({except:/^\s*(then|else|return|satisfies)\b/}),FunctionDefinition:dy({except:/^\s*(\(|\))/})}),eM.add({Context:py,List:py,ParenthesizedExpression:py,FunctionDefinition(n){let e=n.getChild(")");return e?{from:e.to,to:n.to}:null}})]}),languageData:{indentOnInput:/^\s*(\)|\}|\]|then|else|return|satisfies)$/,commentTokens:{line:"//",block:{open:"/*",close:"*/"}}}}),Zz=QP.configure({top:"UnaryTests"},"FEEL unary tests"),Jz=QP.configure({top:"Expression"},"FEEL expression");function KP(n={}){let e=n.dialect==="unaryTests"?Zz:Jz,t=n.parserDialect,i=Q_(n.context),r=e.configure({contextTracker:i,dialect:t}),o=n.completions||[Gz(G_),X_].flat();return new fy(r,[...o.map(s=>r.data.of({autocomplete:s}))])}var eW=[{name:"not",type:"function",params:[{name:"negand"}],info:`<p>Returns the logical negation of the given value.</p> 198 `)}function vn(n,e){this._eventBus=n,this._canvas=e,this._providers=[],this._textbox=new On({container:e.getContainer(),keyHandler:it(this._handleKey,this),resizeHandler:it(this._h global() function [all...] |