| /plugin/diagramsnet/lib/img/lib/ibm/vpc/ |
| D | FloatingIP.svg | 1 …+hyeT33lR+e1h5HdCOOnNudiFlfvFam9oefatG/6eajS9Qfa9x+PxeNJn+u4GlBWRXyxvrOV3c Vx+a1AWFrpg+cX5Pi6/qBCG…
|
| /plugin/flowcharts/ |
| D | mermaid.min.js | 1 …Vx(t){var e=t.curve;return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t.curve=function(t){retu…
|
| /plugin/jmol2/jmol/ |
| D | JmolApplet0.jar | META-INF/
META-INF/MANIFEST.MF
com/
com/obrador/
javax/
... |
| D | JmolAppletSigned0.jar | META-INF/MANIFEST.MF
META-INF/SELFSIGN.SF
META-INF/SELFSIGN ... |
| D | JmolApplet.jar | META-INF/
META-INF/MANIFEST.MF
org/
org/jmol/
org/ ... |
| D | JmolAppletSigned.jar | META-INF/MANIFEST.MF
META-INF/SELFSIGN.SF
META-INF/SELFSIGN ... |
| /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() method in GF.anonymousFunction9d0550af7ee00.Um.AnonymousClass9d0550af81c01.AnonymousClass9d0550af81e01 [all...] |
| /plugin/dirtylittlehelper/script/ |
| D | mermaid.min.js | 1 …Vx(t,e){this._context=t,this._alpha=e}Vx.prototype={areaStart:function(){this._line=0},areaEnd:fun…
|
| D | mermaid.min.js.map | 1 …Vx","$Vy","$Vz","$VA","$VB","$VC","$VD","$VE","$VF","$VG","$VH","$VI","$VJ","$VK","$VL","$VM","$VN…
|
| /plugin/diagramsnet/lib/js/mermaid/ |
| D | mermaid.min.js | 6 …Vx=function(){return Wx(Fx().curve(Ux))},Hx=function(){var t=Px().curve(Ux),e=t.curve,n=t.lineX0,r…
|
| /plugin/vegalite/ |
| H A D | vega.min.js | 1 …Vx=(t,e,n,r)=>{var i=n-t,o=r-e,a=Math.hypot(i,o)/2;return"M"+t+","+e+"A"+a+","+a+" "+180*Math.atan…
|
| /plugin/bpmnio/vendor/bpmn-js/dist/ |
| H A D | bpmn-modeler.production.min.js | 2 (()=>{var zE=Object.create;var fc=Object.defineProperty;var GE=Object.getOwnPropertyDescriptor;var VE=Object.getOwnPropertyNames;var WE=Object.getPrototypeOf,UE=Object.prototype.hasOwnProperty;var qE=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(r){throw n=[r],r}};var dc=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}},KE=(e,t)=>{for(var n in t)fc(e,n,{get:t[n],enumerable:!0})},Xd=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of VE(t))!UE.call(e,i)&&i!==n&&fc(e,i,{get:()=>t[i],enumerable:!(r=GE(t,i))||r.enumerable});return e};var YE=(e,t,n)=>(n=e!=null?zE(WE(e)):{},Xd(t||!e||!e.__esModule?fc(n,"default",{value:e,enumerable:!0}):n,e)),XE=e=>Xd(fc({},"__esModule",{value:!0}),e);var em={};KE(em,{assign:()=>C,bind:()=>tt,debounce:()=>Ca,ensureArray:()=>Qd,every:()=>ln,filter:()=>Q,find:()=>re,findIndex:()=>Sa,flatten:()=>_i,forEach:()=>E,get:()=>o0,groupBy:()=>Vt,has:()=>dt,isArray:()=>q,isDefined:()=>Ue,isFunction:()=>Le,isNil:()=>Yn,isNumber:()=>ne,isObject:()=>Se,isString:()=>st,isUndefined:()=>wn,keys:()=>bi,map:()=>je,matchPattern:()=>Ct,merge:()=>Jd,omit:()=>Nt,pick:()=>mt,reduce:()=>Ge,set:()=>_l,size:()=>vl,some:()=>Lt,sortBy:()=>At,throttle:()=>i0,unionBy:()=>gl,uniqueBy:()=>mc,values:()=>Sn,without:()=>hl});function _i(e){return Array.prototype.concat.apply([],e)}function wn(e){return e===void 0}function Ue(e){return e!==void 0}function Yn(e){return e==null}function q(e){return wa.call(e)==="[object Array]"}function Se(e){return wa.call(e)==="[object Object]"}function ne(e){return wa.call(e)==="[object Number]"}function Le(e){let t=wa.call(e);return t==="[object Function]"||t==="[object AsyncFunction]"||t==="[object GeneratorFunction]"||t==="[object AsyncGeneratorFunction]"||t==="[object Proxy]"}function st(e){return wa.call(e)==="[object String]"}function Qd(e){if(!q(e))throw new Error("must supply array")}function dt(e,t){return!Yn(e)&&t0.call(e,t)}function re(e,t){let n=hc(t),r;return E(e,function(i,o){if(n(i,o))return r=i,!1}),r}function Sa(e,t){let n=hc(t),r=q(e)?-1:void 0;return E(e,function(i,o){if(n(i,o))return r=o,!1}),r}function Q(e,t){let n=hc(t),r=[];return E(e,function(i,o){n(i,o)&&r.push(i)}),r}function E(e,t){let n,r;if(wn(e))return;let i=q(e)?r0:n0;for(let o in e)if(dt(e,o)&&(n=e[o],r=t(n,i(o)),r===!1))return n}function hl(e,t){if(wn(e))return[];Qd(e);let n=hc(t);return e.filter(function(r,i){return!n(r,i)})}function Ge(e,t,n){return E(e,function(r,i){n=t(n,r,i)}),n}function ln(e,t){return!!Ge(e,function(n,r,i){return n&&t(r,i)},!0)}function Lt(e,t){return!!re(e,t)}function je(e,t){let n=[];return E(e,function(r,i){n.push(t(r,i))}),n}function bi(e){return e&&Object.keys(e)||[]}function vl(e){return bi(e).length}function Sn(e){return je(e,t=>t)}function Vt(e,t,n={}){return t=yl(t),E(e,function(r){let i=t(r)||"_",o=n[i];o||(o=n[i]=[]),o.push(r)}),n}function mc(e,...t){e=yl(e);let n={};return E(t,i=>Vt(i,e,n)),je(n,function(i,o){return i[0]})}function At(e,t){t=yl(t);let n=[];return E(e,function(r,i){let o=t(r,i),a={d:o,v:r};for(var s=0;s<n.length;s++){let{d:c}=n[s];if(o<c){n.splice(s,0,a);return}}n.push(a)}),je(n,r=>r.v)}function Ct(e){return function(t){return ln(e,function(n,r){return t[r]===n})}}function yl(e){return Le(e)?e:t=>t[e]}function hc(e){return Le(e)?e:t=>t===e}function n0(e){return e}function r0(e){return Number(e)}function Ca(e,t){let n,r,i,o;function a(l){let f=Date.now(),d=l?0:o+t-f;if(d>0)return s(d);e.apply(i,r),c()}function s(l){n=setTimeout(a,l)}function c(){n&&clearTimeout(n),n=o=r=i=void 0}function u(){n&&a(!0),c()}function p(...l){o=Date.now(),r=l,i=this,n||s(t)}return p.flush=u,p.cancel=c,p}function i0(e,t){let n=!1;return function(...r){n||(e(...r),n=!0,setTimeout(()=>{n=!1},t))}}function tt(e,t){return e.bind(t)}function C(e,...t){return Object.assign(e,...t)}function _l(e,t,n){let r=e;return E(t,function(i,o){if(typeof i!="number"&&typeof i!="string")throw new Error("illegal key type: "+typeof i+". Key should be of type number or string.");if(i==="constructor")throw new Error("illegal key: constructor");if(i==="__proto__")throw new Error("illegal key: __proto__");let a=t[o+1],s=r[i];Ue(a)&&Yn(s)&&(s=r[i]=isNaN(+a)?{}:[]),wn(a)?wn(n)?delete r[i]:r[i]=n:r=s}),e}function o0(e,t,n){let r=e;return E(t,function(i){if(Yn(r))return r=void 0,!1;r=r[i]}),wn(r)?n:r}function mt(e,t){let n={},r=Object(e);return E(t,function(i){i in r&&(n[i]=e[i])}),n}function Nt(e,t){let n={},r=Object(e);return E(r,function(i,o){t.indexOf(o)===-1&&(n[o]=i)}),n}function Jd(e,...t){return t.length&&E(t,function(n){!n||!Se(n)||E(n,function(r,i){if(i==="__proto__")return;let o=e[i];Se(r)?(Se(o)||(o={}),e[i]=Jd(o,r)):e[i]=r})}),e}var wa,t0,gl,N=qE(()=>{wa=Object.prototype.toString,t0=Object.prototype.hasOwnProperty;gl=mc});var jx=dc((qee,Lx)=>{function vD(e){return["String","Boolean","Integer","Real"].includes(e)}Lx.exports=function e(t,n){let r=n.enter,i=n.leave,o=r&&r(t),a=t.$descriptor;o!==!1&&!a.isGeneric&&a.properties.filter(c=>!c.isAttr&&!c.isReference&&!vD(c.type)).forEach(c=>{if(c.name in t){let u=t[c.name];c.isMany?u.forEach(p=>{e(p,n)}):e(u,n)}}),i&&i(t)}});var Hx=dc((Kee,Fx)=>{var gD=jx(),{isArray:yD,isObject:_D,isFunction:bD}=(N(),XE(em)),_d=class{constructor({moddleRoot:t,rule:n}){this.rule=n,this.moddleRoot=t,this.messages=[],this.report=this.report.bind(this)}report(t,n,r){let i={id:t,message:n};r&&yD(r)&&(i={...i,path:r}),r&&_D(r)&&(i={...i,...r}),this.messages.push(i)}};Fx.exports=function({moddleRoot:t,rule:n}){let r=new _d({rule:n,moddleRoot:t}),i=n.check||{},o="leave"in i?i.leave:void 0,a="enter"in i?i.enter:bD(i)?i:void 0;if(!a&&!o)throw new Error("no check implemented");return gD(t,{enter:a?s=>a(s,r):void 0,leave:o?s=>o(s,r):void 0}),r.messages}});var Gx=dc((Yee,zx)=>{var xD=Hx(),ED=(e,t)=>e,wD={0:"off",1:"warn",2:"error",3:"info"},SD="rule-error";function On(e){let{config:t={},resolver:n,transformRule:r=ED}=e||{};if(typeof n=="undefined")throw new Error("must provide <options.resolver>");this.config=t,this.resolver=n,this.transformRule=r,this.cachedRules={},this.cachedConfigs={}}zx.exports=On;On.prototype.applyRule=function(t,n){let{config:r,rule:i,category:o,name:a}=n;try{return xD({moddleRoot:t,rule:i,config:r}).map(function(c){return{...c,meta:i.meta,category:o}})}catch(s){return console.error("rule <"+a+"> failed with error: ",s),[{message:s.message,category:SD}]}};On.prototype.resolveRule=function(e,t){let{pkg:n,ruleName:r}=this.parseRuleName(e),i=`${n}-${r}`,o=this.cachedRules[i];return o?Promise.resolve(o):Promise.resolve(this.resolver.resolveRule(n,r)).then(a=>{if(!a)throw new Error(`unknown rule <${e}>`);return this.cachedRules[i]=this.transformRule(a(t),{pkg:n,ruleName:r})})};On.prototype.resolveConfig=function(e){let{pkg:t,configName:n}=this.parseConfigName(e),r=`${t}-${n}`,i=this.cachedConfigs[r];return i?Promise.resolve(i):Promise.resolve(this.resolver.resolveConfig(t,n)).then(o=>{if(!o)throw new Error(`unknown config <${e}>`);return this.cachedConfigs[r]=this.normalizeConfig(o,t)})};On.prototype.resolveRules=function(e){return this.resolveConfiguredRules(e).then(t=>{let i=Object.entries(t).map(([o,a])=>{let{category:s,config:c}=this.parseRuleValue(a);return{name:o,category:s,config:c}}).filter(o=>o.category!=="off").map(o=>{let{name:a,config:s}=o;return this.resolveRule(a,s).then(function(c){return{...o,rule:c}})});return Promise.all(i)})};On.prototype.resolveConfiguredRules=function(e){let t=e.extends;return typeof t=="string"&&(t=[t]),typeof t=="undefined"&&(t=[]),Promise.all(t.map(n=>this.resolveConfig(n).then(r=>this.resolveConfiguredRules(r)))).then(n=>{let r=this.normalizeConfig(e,"bpmnlint").rules;return[...n,r].reduce((o,a)=>({...o,...a}),{})})};On.prototype.lint=function(e,t){return t=t||this.config,this.resolveRules(t).then(n=>{let r={};return n.forEach(i=>{let{name:o}=i,a=this.applyRule(e,i);a.length&&(r[o]=a)}),r})};On.prototype.parseRuleValue=function(e){let t,n;return Array.isArray(e)?(t=e[0],n=e[1]):(t=e,n={}),typeof t=="string"&&(t=t.toLowerCase()),t=wD[t]||t,{config:n,category:t}};On.prototype.parseRuleName=function(e,t="bpmnlint"){let n=/^(?:(?:(@[^/]+)\/)?([^@]{1}[^/]*)\/)?([^/]+)$/.exec(e);if(!n)throw new Error(`unparseable rule name <${e}>`);let[r,i,o,a]=n;return o?{pkg:`${i?i+"/":""}${$x(o)}`,ruleName:a}:{pkg:t,ruleName:a}};On.prototype.parseConfigName=function(e){let t=/^(?:(?:plugin:(?:(@[^/]+)\/)?([^@]{1}[^/]*)\/)|bpmnlint:)([^/]+)$/.exec(e);if(!t)throw new Error(`unparseable config name <${e}>`);let[n,r,i,o]=t;return i?{pkg:`${r?r+"/":""}${$x(i)}`,configName:o}:{pkg:"bpmnlint",configName:o}};On.prototype.getSimplePackageName=function(e){let t=/^(?:(@[^/]+)\/)?([^/]+)$/.exec(e);if(!t)throw new Error(`unparseable package name <${e}>`);let[n,r,i]=t;return`${r?r+"/":""}${CD(i)}`};On.prototype.normalizeConfig=function(e,t){let n=e.rules||{},r=Object.keys(n).reduce((i,o)=>{let a=n[o],{pkg:s,ruleName:c}=this.parseRuleName(o,t),u=s==="bpmnlint"?c:`${this.getSimplePackageName(s)}/${c}`;return i[u]=a,i},{});return{...e,rules:r}};function $x(e){return e==="bpmnlint"?"bpmnlint":e.startsWith("bpmnlint-plugin-")?e:`bpmnlint-plugin-${e}`}function CD(e){return e.startsWith("bpmnlint-plugin-")?e.substring(16):e}});var Wx=dc((Xee,Vx)=>{var RD=Gx();Vx.exports={Linter:RD}});function B(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}function ZE(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ml={exports:{}},Zd;function QE(){if(Zd)return ml.exports;Zd=1;var e=ml.exports=function(t,n){if(n||(n=16),t===void 0&&(t=128),t<=0)return"0";for(var r=Math.log(Math.pow(2,t))/Math.log(n),i=2;r===1/0;i*=2)r=Math.log(Math.pow(2,t/i))/Math.log(n)*i;for(var o=r-Math.floor(r),a="",i=0;i<Math.floor(r);i++){var s=Math.floor(Math.random()*n).toString(n);a=s+a}if(o){var c=Math.pow(n,o),s=Math.floor(Math.random()*c).toString(n);a=s+a}var u=parseInt(a,n);return u!==1/0&&u>=Math.pow(2,t)?e(t,n):a};return e.rack=function(t,n,r){var i=function(a){var s=0;do{if(s++>10)if(r)t+=r;else throw new Error("too many ID collisions, use more bits");var c=e(t,n)}while(Object.hasOwnProperty.call(o,c));return o[c]=a,c},o=i.hats={};return i.get=function(a){return i.hats[a]},i.set=function(a,s){return i.hats[a]=s,i},i.bits=t||128,i.base=n||16,i},ml.exports}var JE=QE(),e0=ZE(JE);function En(e){if(!(this instanceof En))return new En(e);e=e||[128,36,1],this._seed=e.length?e0.rack(e[0],e[1],e[2]):e}En.prototype.next=function(e){return this._seed(e||!0)};En.prototype.nextPrefixed=function(e,t){var n;do n=e+this.next(!0);while(this.assigned(n));return this.claim(n,t),n};En.prototype.claim=function(e,t){this._seed.set(e,t||!0)};En.prototype.assigned=function(e){return this._seed.get(e)||!1};En.prototype.unclaim=function(e){delete this._seed.hats[e]};En.prototype.clear=function(){var e=this._seed.hats,t;for(t in e)this.unclaim(t)};N();N();var ht={legend:[1,"<fieldset>","</fieldset>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],_default:[0,"",""]};ht.td=ht.th=[3,"<table><tbody><tr>","</tr></tbody></table>"];ht.option=ht.optgroup=[1,'<select multiple="multiple">',"</select>"];ht.thead=ht.tbody=ht.colgroup=ht.caption=ht.tfoot=[1,"<table>","</table>"];ht.polyline=ht.ellipse=ht.polygon=ht.circle=ht.text=ht.line=ht.path=ht.rect=ht.g=[1,'<svg xmlns="http://www.w3.org/2000/svg" version="1.1">',"</svg>"];function ue(e,t=globalThis.document){var u;if(typeof e!="string")throw new TypeError("String expected");let n=/^<!--(.*?)-->$/s.exec(e);if(n)return t.createComment(n[1]);let r=(u=/<([\w:]+)/.exec(e))==null?void 0:u[1];if(!r)return t.createTextNode(e);if(e=e.trim(),r==="body"){let p=t.createElement("html");p.innerHTML=e;let{lastChild:l}=p;return l.remove(),l}let[i,o,a]=Object.hasOwn(ht,r)?ht[r]:ht._default,s=t.createElement("div");for(s.innerHTML=o+e+a;i--;)s=s.lastChild;if(s.firstChild===s.lastChild){let{firstChild:p}=s;return p.remove(),p}let c=t.createDocumentFragment();return c.append(...s.childNodes),c}function a0(e,t){return t.forEach(function(n){n&&typeof n!="string"&&!Array.isArray(n)&&Object.keys(n).forEach(function(r){if(r!=="default"&&!(r in e)){var i=Object.getOwnPropertyDescriptor(n,r);Object.defineProperty(e,r,i.get?i:{enumerable:!0,get:function(){return n[r]}})}})}),Object.freeze(e)}function vt(e,...t){let n=e.style;return E(t,function(r){r&&E(r,function(i,o){n[o]=i})}),e}function nt(e,t,n){return arguments.length==2?e.getAttribute(t):n===null?e.removeAttribute(t):(e.setAttribute(t,n),e)}var s0=Object.prototype.toString;function Ne(e){return new Fr(e)}function Fr(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}Fr.prototype.add=function(e){return this.list.add(e),this};Fr.prototype.remove=function(e){return s0.call(e)=="[object RegExp]"?this.removeMatching(e):(this.list.remove(e),this)};Fr.prototype.removeMatching=function(e){let t=this.array();for(let n=0;n<t.length;n++)e.test(t[n])&&this.remove(t[n]);return this};Fr.prototype.toggle=function(e,t){return typeof t!="undefined"?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this};Fr.prototype.array=function(){return Array.from(this.list)};Fr.prototype.has=Fr.prototype.contains=function(e){return this.list.contains(e)};function Hr(e){for(var t;t=e.firstChild;)e.removeChild(t);return e}function Bn(e,t,n){var r=n?e:e.parentNode;return r&&typeof r.closest=="function"&&r.closest(t)||null}function c0(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var vc={},tm;function u0(){if(tm)return vc;tm=1;var e,t,n;function r(){e=window.addEventListener?"addEventListener":"attachEvent",t=window.removeEventListener?"removeEventListener":"detachEvent",n=e!=="addEventListener"?"on":""}return vc.bind=function(i,o,a,s){return e||r(),i[e](n+o,a,s||!1),a},vc.unbind=function(i,o,a,s){return t||r(),i[t](n+o,a,s||!1),a},vc}var nm=u0(),p0=c0(nm),se=a0({__proto__:null,default:p0},[nm]),rm=["focus","blur"];function l0(e,t,n,r,i){return rm.indexOf(n)!==-1&&(i=!0),se.bind(e,n,function(o){var a=o.target||o.srcElement;o.delegateTarget=Bn(a,t,!0),o.delegateTarget&&r.call(e,o)},i)}function f0(e,t,n,r){return rm.indexOf(t)!==-1&&(r=!0),se.unbind(e,t,n,r)}var bt={bind:l0,unbind:f0};function Ra(e,t){return e&&typeof e.matches=="function"&&e.matches(t)||!1}function _e(e,t){return t=t||document,t.querySelector(e)}function xi(e,t){return t=t||document,t.querySelectorAll(e)}function Wt(e){e.parentNode&&e.parentNode.removeChild(e)}function d0(e,t){if(e.ownerDocument!==t.ownerDocument)try{return t.ownerDocument.importNode(e,!0)}catch{}return e}function sm(e,t){return t.appendChild(d0(e,t))}function J(e,t){return sm(t,e),e}var El=2,cm={"alignment-baseline":1,"baseline-shift":1,clip:1,"clip-path":1,"clip-rule":1,color:1,"color-interpolation":1,"color-interpolation-filters":1,"color-profile":1,"color-rendering":1,cursor:1,direction:1,display:1,"dominant-baseline":1,"enable-background":1,fill:1,"fill-opacity":1,"fill-rule":1,filter:1,"flood-color":1,"flood-opacity":1,font:1,"font-family":1,"font-size":El,"font-size-adjust":1,"font-stretch":1,"font-style":1,"font-variant":1,"font-weight":1,"glyph-orientation-horizontal":1,"glyph-orientation-vertical":1,"image-rendering":1,kerning:1,"letter-spacing":1,"lighting-color":1,marker:1,"marker-end":1,"marker-mid":1,"marker-start":1,mask:1,opacity:1,overflow:1,"pointer-events":1,"shape-rendering":1,"stop-color":1,"stop-opacity":1,stroke:1,"stroke-dasharray":1,"stroke-dashoffset":1,"stroke-linecap":1,"stroke-linejoin":1,"stroke-miterlimit":1,"stroke-opacity":1,"stroke-width":El,"text-anchor":1,"text-decoration":1,"text-rendering":1,"unicode-bidi":1,visibility:1,"word-spacing":1,"writing-mode":1};function m0(e,t){return cm[t]?e.style[t]:e.getAttributeNS(null,t)}function um(e,t,n){var r=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),i=cm[r];i?(i===El&&typeof n=="number"&&(n=String(n)+"px"),e.style[r]=n):e.setAttributeNS(null,t,n)}function h0(e,t){var n=Object.keys(t),r,i;for(r=0,i;i=n[r];r++)um(e,i,t[i])}function $(e,t,n){if(typeof t=="string")if(n!==void 0)um(e,t,n);else return m0(e,t);else h0(e,t);return e}var v0=Object.prototype.toString;function pe(e){return new $r(e)}function $r(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}$r.prototype.add=function(e){return this.list.add(e),this};$r.prototype.remove=function(e){return v0.call(e)=="[object RegExp]"?this.removeMatching(e):(this.list.remove(e),this)};$r.prototype.removeMatching=function(e){let t=this.array();for(let n=0;n<t.length;n++)e.test(t[n])&&this.remove(t[n]);return this};$r.prototype.toggle=function(e,t){return typeof t!="undefined"?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this};$r.prototype.array=function(){return Array.from(this.list)};$r.prototype.has=$r.prototype.contains=function(e){return this.list.contains(e)};function _r(e){for(var t;t=e.firstChild;)e.removeChild(t);return e}function Sl(e){return e.cloneNode(!0)}var Cl={svg:"http://www.w3.org/2000/svg"},im='<svg xmlns="'+Cl.svg+'"';function pm(e){var t=!1;e.substring(0,4)==="<svg"?e.indexOf(Cl.svg)===-1&&(e=im+e.substring(4)):(e=im+">"+e+"</svg>",t=!0);var n=g0(e);if(!t)return n;for(var r=document.createDocumentFragment(),i=n.firstChild;i.firstChild;)r.appendChild(i.firstChild);return r}function g0(e){var t;return t=new DOMParser,t.async=!1,t.parseFromString(e,"text/xml")}function U(e,t){var n;return e=e.trim(),e.charAt(0)==="<"?(n=pm(e).firstChild,n=document.importNode(n,!0)):n=document.createElementNS(Cl.svg,e),t&&$(n,t),n}var bl=null;function wl(){return bl===null&&(bl=U("svg")),bl}function om(e,t){var n,r,i=Object.keys(t);for(n=0;r=i[n];n++)e[r]=t[r];return e}function lm(e,t,n,r,i,o){var a=wl().createSVGMatrix();switch(arguments.length){case 0:return a;case 1:return om(a,e);case 6:return om(a,{a:e,b:t,c:n,d:r,e:i,f:o})}}function so(e){return e?wl().createSVGTransformFromMatrix(e):wl().createSVGTransform()}var am=/([&<>]{1})/g,y0=/([&<>\n\r"]{1})/g,_0={"&":"&","<":"<",">":">",'"':"'"};function xl(e,t){function n(r,i){return _0[i]||i}return e.replace(t,n)}function fm(e,t){var n,r,i,o,a;switch(e.nodeType){case 3:t.push(xl(e.textContent,am));break;case 1:if(t.push("<",e.tagName),e.hasAttributes())for(i=e.attributes,n=0,r=i.length;n<r;++n)o=i.item(n),t.push(" ",o.name,'="',xl(o.value,y0),'"');if(e.hasChildNodes()){for(t.push(">"),a=e.childNodes,n=0,r=a.length;n<r;++n)fm(a.item(n),t);t.push("</",e.tagName,">")}else t.push("/>");break;case 8:t.push("<!--",xl(e.nodeValue,am),"-->");break;case 4:t.push("<![CDATA[",e.nodeValue,"]]>");break;default:throw new Error("unable to handle node "+e.nodeType)}return t}function b0(e,t){var n=pm(t);if(_r(e),!!t){E0(n)||(n=n.documentElement);for(var r=w0(n.childNodes),i=0;i<r.length;i++)sm(r[i],e)}}function x0(e){for(var t=e.firstChild,n=[];t;)fm(t,n),t=t.nextSibling;return n.join("")}function E0(e){return e.nodeName==="#document-fragment"}function Rl(e,t){if(t!==void 0){try{b0(e,t)}catch(n){throw new Error("error parsing SVG: "+n.message)}return e}else return x0(e)}function w0(e){return Array.prototype.slice.call(e)}function Pe(e){var t=e.parentNode;return t&&t.removeChild(e),e}function S0(e,t){return t instanceof SVGMatrix?e.createSVGTransformFromMatrix(t):t}function C0(e,t){var n,r;for(e.clear(),n=0;r=t[n];n++)e.appendItem(S0(e,r))}function Ei(e,t){var n=e.transform.baseVal;return t&&(Array.isArray(t)||(t=[t]),C0(n,t)),n.consolidate()}var R0=/^class[ {]/;function P0(e){return R0.test(e.toString())}function Al(e){return Array.isArray(e)}function Pl(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function gc(...e){e.length===1&&Al(e[0])&&(e=e[0]),e=[...e];let t=e.pop();return t.$inject=e,t}var A0=/constructor\s*[^(]*\(\s*([^)]*)\)/m,T0=/^(?:async\s+)?(?:function\s*[^(]*)?(?:\(\s*([^)]*)\)|(\w+))/m,M0=/\/\*([^*]*)\*\//m;function D0(e){if(typeof e!="function")throw new Error(`Cannot annotate "${e}". Expected a function!`);let t=e.toString().match(P0(e)?A0:T0);if(!t)return[];let n=t[1]||t[2];return n&&n.split(",").map(r=>{let i=r.match(M0);return(i&&i[1]||r).trim()})||[]}function Tl(e,t){let n=t||{get:function(x,b){if(r.push(x),b===!1)return null;throw s(`No provider for "${x}"!`)}},r=[],i=this._providers=Object.create(n._providers||null),o=this._instances=Object.create(null),a=o.injector=this,s=function(x){let b=r.join(" -> ");return r.length=0,new Error(b?`${x} (Resolving: ${b})`:x)};function c(x,b){if(!i[x]&&x.includes(".")){let R=x.split("."),A=c(R.shift());for(;R.length;)A=A[R.shift()];return A}if(Pl(o,x))return o[x];if(Pl(i,x)){if(r.indexOf(x)!==-1)throw r.push(x),s("Cannot resolve circular dependency!");return r.push(x),o[x]=i[x][0](i[x][1]),r.pop(),o[x]}return n.get(x,b)}function u(x,b){if(typeof b=="undefined"&&(b={}),typeof x!="function")if(Al(x))x=gc(x.slice());else throw s(`Cannot invoke "${x}". Expected a function!`);let A=(x.$inject||D0(x)).map(O=>Pl(b,O)?b[O]:c(O));return{fn:x,dependencies:A}}function p(x){let{fn:b,dependencies:R}=u(x),A=Function.prototype.bind.call(b,null,...R);return new A}function l(x,b,R){let{fn:A,dependencies:O}=u(x,R);return A.apply(b,O)}function f(x){return gc(b=>x.get(b))}function d(x,b){if(b&&b.length){let R=Object.create(null),A=Object.create(null),O=[],T=[],I=[],L,W,z,K;for(let ve in i)L=i[ve],b.indexOf(ve)!==-1&&(L[2]==="private"?(W=O.indexOf(L[3]),W===-1?(z=L[3].createChild([],b),K=f(z),O.push(L[3]),T.push(z),I.push(K),R[ve]=[K,ve,"private",z]):R[ve]=[I[W],ve,"private",T[W]]):R[ve]=[L[2],L[1]],A[ve]=!0),(L[2]==="factory"||L[2]==="type")&&L[1].$scope&&b.forEach(Jt=>{L[1].$scope.indexOf(Jt)!==-1&&(R[ve]=[L[2],L[1]],A[Jt]=!0)});b.forEach(ve=>{if(!A[ve])throw new Error('No provider for "'+ve+'". Cannot use provider from the parent!')}),x.unshift(R)}return new Tl(x,a)}let m={factory:l,type:p,value:function(x){return x}};function g(x,b){let R=x.__init__||[];return function(){R.forEach(A=>{typeof A=="string"?b.get(A):b.invoke(A)})}}function v(x){let b=x.__exports__;if(b){let R=x.__modules__,A=Object.keys(x).reduce((W,z)=>(z!=="__exports__"&&z!=="__modules__"&&z!=="__init__"&&z!=="__depends__"&&(W[z]=x[z]),W),Object.create(null)),O=(R||[]).concat(A),T=d(O),I=gc(function(W){return T.get(W)});b.forEach(function(W){i[W]=[I,W,"private",T]});let L=(x.__init__||[]).slice();return L.unshift(function(){T.init()}),x=Object.assign({},x,{__init__:L}),g(x,T)}return Object.keys(x).forEach(function(R){if(R==="__init__"||R==="__depends__")return;let A=x[R];if(A[2]==="private"){i[R]=A;return}let O=A[0],T=A[1];i[R]=[m[O],k0(O,T),O]}),g(x,a)}function w(x,b){return x.indexOf(b)!==-1||(x=(b.__depends__||[]).reduce(w,x),x.indexOf(b)!==-1)?x:x.concat(b)}function S(x){let b=x.reduce(w,[]).map(v),R=!1;return function(){R||(R=!0,b.forEach(A=>A()))}}this.get=c,this.invoke=l,this.instantiate=p,this.createChild=d,this.init=S(e)}function k0(e,t){return e!=="value"&&Al(t)&&(t=gc(t.slice())),t}var N0=1e3;function Cn(e,t){var n=this;t=t||N0,e.on(["render.shape","render.connection"],t,function(r,i){var o=r.type,a=i.element,s=i.gfx,c=i.attrs;if(n.canRender(a))return o==="render.shape"?n.drawShape(s,a,c):n.drawConnection(s,a,c)}),e.on(["render.getShapePath","render.getConnectionPath"],t,function(r,i){if(n.canRender(i))return r.type==="render.getShapePath"?n.getShapePath(i):n.getConnectionPath(i)})}Cn.prototype.canRender=function(e){};Cn.prototype.drawShape=function(e,t){};Cn.prototype.drawConnection=function(e,t){};Cn.prototype.getShapePath=function(e){};Cn.prototype.getConnectionPath=function(e){};N();function br(e){return e.flat().join(",").replace(/,?([A-Za-z]),?/g,"$1")}function O0(e){return["M",e.x,e.y]}function Ml(e){return["L",e.x,e.y]}function B0(e,t,n){return["C",e.x,e.y,t.x,t.y,n.x,n.y]}function I0(e,t){let n=e.length,r=[O0(e[0])];for(let i=1;i<n;i++){let o=e[i-1],a=e[i],s=e[i+1];if(!s||!t){r.push(Ml(a));continue}let c=Math.min(t,Dl(a.x-o.x,a.y-o.y),Dl(s.x-a.x,s.y-a.y));if(!c){r.push(Ml(a));continue}let u=yc(a,o,c),p=yc(a,o,c*.5),l=yc(a,s,c),f=yc(a,s,c*.5);r.push(Ml(u)),r.push(B0(p,f,l))}return r}function yc(e,t,n){let r=t.x-e.x,i=t.y-e.y,o=Dl(r,i),a=n/o;return{x:e.x+r*a,y:e.y+i*a}}function Dl(e,t){return Math.sqrt(Math.pow(e,2)+Math.pow(t,2))}function Xn(e,t,n){ne(t)&&(n=t,t=null),t||(t={});let r=U("path",t);return ne(n)&&(r.dataset.cornerRadius=String(n)),Pa(r,e)}function Pa(e,t){let n=parseInt(e.dataset.cornerRadius,10)||0;return $(e,{d:br(I0(t,n))}),e}N();N();function zr(e){return Q(e,function(t){return!re(e,function(n){return n!==t&&mm(t,n)})})}function mm(e,t){if(t){if(e===t)return t;if(e.parent)return mm(e.parent,t)}}function dm(e,t,n){var r=!n||e.indexOf(t)===-1;return r&&e.push(t),r}function In(e,t,n){n=n||0,q(e)||(e=[e]),E(e,function(r,i){var o=t(r,i,n);q(o)&&o.length&&In(o,t,n+1)})}function Ta(e,t,n){var r=[],i=[];return In(e,function(o,a,s){dm(r,o,t);var c=o.children;if((n===-1||s<n)&&c&&dm(i,c,t))return c}),r}function Zn(e,t){return Ta(e,!t,-1)}function hm(e,t,n){wn(t)&&(t=!0),Se(t)&&(n=t,t=!0),n=n||{};var r=Aa(n.allShapes),i=Aa(n.allConnections),o=Aa(n.enclosedElements),a=Aa(n.enclosedConnections),s=Aa(n.topLevel,t&&Vt(e,function(p){return p.id}));function c(p){s[p.source.id]&&s[p.target.id]&&(s[p.id]=[p]),r[p.source.id]&&r[p.target.id]&&(a[p.id]=o[p.id]=p),i[p.id]=p}function u(p){if(o[p.id]=p,p.waypoints)a[p.id]=i[p.id]=p;else return r[p.id]=p,E(p.incoming,c),E(p.outgoing,c),p.children}return In(e,u),{allShapes:r,allConnections:i,topLevel:s,enclosedConnections:a,enclosedElements:o}}function Ce(e,t){t=!!t,q(e)||(e=[e]);var n,r,i,o;return E(e,function(a){var s=a;a.waypoints&&!t&&(s=Ce(a.waypoints,!0));var c=s.x,u=s.y,p=s.height||0,l=s.width||0;(c<n||n===void 0)&&(n=c),(u<r||r===void 0)&&(r=u),(c+l>i||i===void 0)&&(i=c+l),(u+p>o||o===void 0)&&(o=u+p)}),{x:n,y:r,height:o-r,width:i-n}}function wi(e,t){var n={};return E(e,function(r){var i=r;i.waypoints&&(i=Ce(i)),!ne(t.y)&&i.x>t.x&&(n[r.id]=r),!ne(t.x)&&i.y>t.y&&(n[r.id]=r),i.x>t.x&&i.y>t.y&&(ne(t.width)&&ne(t.height)&&i.width+i.x<t.width+t.x&&i.height+i.y<t.height+t.y||!ne(t.width)||!ne(t.height))&&(n[r.id]=r)}),n}function _c(e){return"waypoints"in e?"connection":"x"in e?"shape":"root"}function bc(e){return!!(e&&e.isFrame)}function Aa(e,t){return C({},e||{},t||{})}var L0=1;function Qn(e,t){Cn.call(this,e,L0),this.CONNECTION_STYLE=t.style(["no-fill"],{strokeWidth:5,stroke:"fuchsia"}),this.SHAPE_STYLE=t.style({fill:"white",stroke:"fuchsia",strokeWidth:2}),this.FRAME_STYLE=t.style(["no-fill"],{stroke:"fuchsia",strokeDasharray:4,strokeWidth:2})}B(Qn,Cn);Qn.prototype.canRender=function(){return!0};Qn.prototype.drawShape=function(t,n,r){var i=U("rect");return $(i,{x:0,y:0,width:n.width||0,height:n.height||0}),bc(n)?$(i,C({},this.FRAME_STYLE,r||{})):$(i,C({},this.SHAPE_STYLE,r||{})),J(t,i),i};Qn.prototype.drawConnection=function(t,n,r){var i=Xn(n.waypoints,C({},this.CONNECTION_STYLE,r||{}));return J(t,i),i};Qn.prototype.getShapePath=function(t){var n=t.x,r=t.y,i=t.width,o=t.height,a=[["M",n,r],["l",i,0],["l",0,o],["l",-i,0],["z"]];return br(a)};Qn.prototype.getConnectionPath=function(t){var n=t.waypoints,r,i,o=[];for(r=0;i=n[r];r++)i=i.original||i,o.push([r===0?"M":"L",i.x,i.y]);return br(o)};Qn.$inject=["eventBus","styles"];N();function kl(){var e={"no-fill":{fill:"none"},"no-border":{strokeOpacity:0},"no-events":{pointerEvents:"none"}},t=this;this.cls=function(n,r,i){var o=this.style(r,i);return C(o,{class:n})},this.style=function(n,r){!q(n)&&!r&&(r=n,n=[]);var i=Ge(n,function(o,a){return C(o,e[a]||{})},{});return r?C(i,r):i},this.computeStyle=function(n,r,i){return q(r)||(i=r,r=[]),t.style(r||[],C({},i,n||{}))}}var vm={__init__:["defaultRenderer"],defaultRenderer:["type",Qn],styles:["type",kl]};N();function Oe(e,t){if(!e||!t)return-1;var n=e.indexOf(t);return n!==-1&&e.splice(n,1),n}function Ae(e,t,n){if(!(!e||!t)){typeof n!="number"&&(n=-1);var r=e.indexOf(t);if(r!==-1){if(r===n)return;if(n!==-1)e.splice(r,1);else return}n!==-1?e.splice(n,0,t):e.push(t)}}function co(e,t){return!e||!t?-1:e.indexOf(t)}N();N();function Gr(e,t){return!e||!t?-1:Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function uo(e,t,n,r){if(typeof r=="undefined"&&(r=5),!e||!t||!n)return!1;var i=(t.x-e.x)*(n.y-e.y)-(t.y-e.y)*(n.x-e.x),o=Gr(e,t);return Math.abs(i/o)<=r}var j0=2;function en(e,t){var n=Array.from(arguments).flat();let r={x:"v",y:"h"};for(let[i,o]of Object.entries(r))if(F0(i,n))return o;return!1}function F0(e,t){let n=t[0];return ln(t,function(r){return Math.abs(n[e]-r[e])<=j0})}function Nl(e,t,n){return n=n||0,e.x>t.x-n&&e.y>t.y-n&&e.x<t.x+t.width+n&&e.y<t.y+t.height+n}function Ma(e,t){return{x:Math.round(e.x+(t.x-e.x)/2),y:Math.round(e.y+(t.y-e.y)/2)}}var H0=/,?([a-z]),?/gi,gm=parseFloat,pt=Math,Vr=pt.PI,Jn=pt.min,er=pt.max,ym=pt.pow,Ur=pt.abs,$0=/([a-z])[\s,]*((-?\d*\.?\d*(?:e[-+]?\d+)?[\s]*,?[\s]*)+)/ig,z0=/(-?\d*\.?\d*(?:e[-+]?\d+)?)[\s]*,?[\s]*/ig,_m=Array.isArray||function(e){return e instanceof Array};function G0(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function V0(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return e.push(e.splice(n,1)[0])}function W0(e){function t(){var n=Array.prototype.slice.call(arguments,0),r=n.join("\u2400"),i=t.cache=t.cache||{},o=t.count=t.count||[];return G0(i,r)?(V0(o,r),i[r]):(o.length>=1e3&&delete i[o.shift()],o.push(r),i[r]=e(...arguments),i[r])}return t}function U0(e){if(!e)return null;var t={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},n=[];return String(e).replace($0,function(r,i,o){var a=[],s=i.toLowerCase();for(o.replace(z0,function(c,u){u&&a.push(+u)}),s=="m"&&a.length>2&&(n.push([i,...a.splice(0,2)]),s="l",i=i=="m"?"l":"L");a.length>=t[s]&&(n.push([i,...a.splice(0,t[s])]),!!t[s]););}),n.toString=Bl,n}function q0(e){for(var t=0,n=e.length;t<n;t++){var r=e[t][0];if(typeof r=="string"&&r!==r.toUpperCase())return!1}return!0}function K0(e){for(var t=0,n=e.length;t<n;t++){var r=e[t][0];if(r!=="M"&&r!=="C")return!1}return!0}function Ol(e,t,n,r){return arguments.length===1&&(t=e.y,n=e.width,r=e.height,e=e.x),{x:e,y:t,width:n,height:r,x2:e+n,y2:t+r}}function Bl(){return this.join(",").replace(H0,"$1")}function Y0(e){for(var t=new Array(e.length),n=0,r=e.length;n<r;n++)for(var i=e[n],o=t[n]=new Array(i.length),a=0,s=i.length;a<s;a++)o[a]=i[a];return t.toString=Bl,t}function bm(e,t,n,r,i,o,a,s,c){var u=1-c,p=ym(u,3),l=ym(u,2),f=c*c,d=f*c,m=p*e+l*3*c*n+u*3*c*c*i+d*a,g=p*t+l*3*c*r+u*3*c*c*o+d*s;return{x:Ec(m),y:Ec(g)}}function xm(e){var t=tw(...e);return Ol(t.x0,t.y0,t.x1-t.x0,t.y1-t.y0)}function Wr(e,t,n){return t>=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height}function X0(e,t){return e=Ol(e),t=Ol(t),Wr(t,e.x,e.y)||Wr(t,e.x2,e.y)||Wr(t,e.x,e.y2)||Wr(t,e.x2,e.y2)||Wr(e,t.x,t.y)||Wr(e,t.x2,t.y)||Wr(e,t.x,t.y2)||Wr(e,t.x2,t.y2)||(e.x<t.x2&&e.x>t.x||t.x<e.x2&&t.x>e.x)&&(e.y<t.y2&&e.y>t.y||t.y<e.y2&&t.y>e.y)}function Em(e,t,n,r,i){var o=-3*t+9*n-9*r+3*i,a=e*o+6*t-12*n+6*r;return e*a-3*t+3*n}function wm(e,t,n,r,i,o,a,s,c){c==null&&(c=1),c=c>1?1:c<0?0:c;for(var u=c/2,p=12,l=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],f=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],d=0,m=0;m<p;m++){var g=u*l[m]+u,v=Em(g,e,n,i,a),w=Em(g,t,r,o,s),S=v*v+w*w;d+=f[m]*pt.sqrt(S)}return u*d}function Z0(e,t,n,r,i,o,a,s){if(!(er(e,n)<Jn(i,a)||Jn(e,n)>er(i,a)||er(t,r)<Jn(o,s)||Jn(t,r)>er(o,s))){var c=(e*r-t*n)*(i-a)-(e-n)*(i*s-o*a),u=(e*r-t*n)*(o-s)-(t-r)*(i*s-o*a),p=(e-n)*(o-s)-(t-r)*(i-a);if(p){var l=Ec(c/p),f=Ec(u/p),d=+l.toFixed(2),m=+f.toFixed(2);if(!(d<+Jn(e,n).toFixed(2)||d>+er(e,n).toFixed(2)||d<+Jn(i,a).toFixed(2)||d>+er(i,a).toFixed(2)||m<+Jn(t,r).toFixed(2)||m>+er(t,r).toFixed(2)||m<+Jn(o,s).toFixed(2)||m>+er(o,s).toFixed(2)))return{x:l,y:f}}}}function Ec(e){return Math.round(e*1e11)/1e11}function Q0(e,t,n){var r=xm(e),i=xm(t);if(!X0(r,i))return n?0:[];var o=wm(...e),a=wm(...t),s=Sm(e)?1:~~(o/5)||1,c=Sm(t)?1:~~(a/5)||1,u=new Array(s+1),p=new Array(c+1),l={},f=n?0:[],d,m;for(d=0;d<s+1;d++){var g=bm(...e,d/s);u[d]={x:g.x,y:g.y,t:d/s}}for(d=0;d<c+1;d++)g=bm(...t,d/c),p[d]={x:g.x,y:g.y,t:d/c};for(d=0;d<s;d++)for(m=0;m<c;m++){var v=u[d],w=u[d+1],S=p[m],x=p[m+1],b=Ur(w.x-v.x)<.01?"y":"x",R=Ur(x.x-S.x)<.01?"y":"x",A=Z0(v.x,v.y,w.x,w.y,S.x,S.y,x.x,x.y),O;if(A){if(O=A.x.toFixed(9)+"#"+A.y.toFixed(9),l[O])continue;l[O]=!0;var T=v.t+Ur((A[b]-v[b])/(w[b]-v[b]))*(w.t-v.t),I=S.t+Ur((A[R]-S[R])/(x[R]-S[R]))*(x.t-S.t);T>=0&&T<=1&&I>=0&&I<=1&&(n?f++:f.push({x:A.x,y:A.y,t1:T,t2:I}))}}return f}function Da(e,t,n){e=Rm(e),t=Rm(t);for(var r,i,o,a,s,c,u,p,l,f,d=n?0:[],m=0,g=e.length;m<g;m++){var v=e[m];if(v[0]=="M")r=s=v[1],i=c=v[2];else{v[0]=="C"?(l=[r,i,...v.slice(1)],r=l[6],i=l[7]):(l=[r,i,r,i,s,c,s,c],r=s,i=c);for(var w=0,S=t.length;w<S;w++){var x=t[w];if(x[0]=="M")o=u=x[1],a=p=x[2];else{x[0]=="C"?(f=[o,a,...x.slice(1)],o=f[6],a=f[7]):(f=[o,a,o,a,u,p,u,p],o=u,a=p);var b=Q0(l,f,n);if(n)d+=b;else{for(var R=0,A=b.length;R<A;R++)b[R].segment1=m,b[R].segment2=w,b[R].bez1=l,b[R].bez2=f;d=d.concat(b)}}}}}return d}function J0(e){return _m(e)&&_m(e[0])}function ew(e){if(q0(e))return e;var t=new Array(e.length),n=0,r=0,i=0,o=0,a=0,s;e[0][0]=="M"&&(n=+e[0][1],r=+e[0][2],i=n,o=r,a++,t[0]=["M",n,r]);for(var c,u,p=a,l=e.length;p<l;p++){if(u=e[p],s=u[0],t[p]=c=new Array(u.length),s!=s.toUpperCase())switch(c[0]=s.toUpperCase(),c[0]){case"A":c[1]=u[1],c[2]=u[2],c[3]=u[3],c[4]=u[4],c[5]=u[5],c[6]=+u[6]+n,c[7]=+u[7]+r;break;case"V":c[1]=+u[1]+r;break;case"H":c[1]=+u[1]+n;break;case"M":i=+u[1]+n,o=+u[2]+r;default:for(var f=1,d=u.length;f<d;f++)c[f]=+u[f]+(f%2?n:r)}else for(var m=0,g=u.length;m<g;m++)c[m]=u[m];switch(s=s.toUpperCase(),c[0]){case"Z":n=+i,r=+o;break;case"H":n=c[1];break;case"V":r=c[1];break;case"M":i=c[c.length-2],o=c[c.length-1];default:n=c[c.length-2],r=c[c.length-1]}}return t.toString=Bl,t}function Sm(e){return e[0]===e[2]&&e[1]===e[3]&&e[4]===e[6]&&e[5]===e[7]}function xc(e,t,n,r){return[e,t,n,r,n,r]}function Cm(e,t,n,r,i,o){var a=.3333333333333333,s=2/3;return[a*e+s*n,a*t+s*r,a*i+s*n,a*o+s*r,i,o]}function Pm(e,t,n,r,i,o,a,s,c,u){var p=Vr*120/180,l=Vr/180*(+i||0),f=[],d,m=W0(function(P,_,y){var M=P*pt.cos(y)-_*pt.sin(y),D=P*pt.sin(y)+_*pt.cos(y);return{x:M,y:D}});if(u)O=u[0],T=u[1],R=u[2],A=u[3];else{d=m(e,t,-l),e=d.x,t=d.y,d=m(s,c,-l),s=d.x,c=d.y;var g=(e-s)/2,v=(t-c)/2,w=g*g/(n*n)+v*v/(r*r);w>1&&(w=pt.sqrt(w),n=w*n,r=w*r);var S=n*n,x=r*r,b=(o==a?-1:1)*pt.sqrt(Ur((S*x-S*v*v-x*g*g)/(S*v*v+x*g*g))),R=b*n*v/r+(e+s)/2,A=b*-r*g/n+(t+c)/2,O=pt.asin(((t-A)/r).toFixed(9)),T=pt.asin(((c-A)/r).toFixed(9));O=e<R?Vr-O:O,T=s<R?Vr-T:T,O<0&&(O=Vr*2+O),T<0&&(T=Vr*2+T),a&&O>T&&(O=O-Vr*2),!a&&T>O&&(T=T-Vr*2)}var I=T-O;if(Ur(I)>p){var L=T,W=s,z=c;T=O+p*(a&&T>O?1:-1),s=R+n*pt.cos(T),c=A+r*pt.sin(T),f=Pm(s,c,n,r,i,0,a,W,z,[T,L,R,A])}I=T-O;var K=pt.cos(O),ve=pt.sin(O),Jt=pt.cos(T),ke=pt.sin(T),ye=pt.tan(I/4),he=4/3*n*ye,we=4/3*r*ye,Ie=[e,t],Ze=[e+he*ve,t-we*K],H=[s+he*ke,c-we*Jt],G=[s,c];if(Ze[0]=2*Ie[0]-Ze[0],Ze[1]=2*Ie[1]-Ze[1],u)return[Ze,H,G].concat(f);f=[Ze,H,G].concat(f).join().split(",");for(var oe=[],xe=0,Gt=f.length;xe<Gt;xe++)oe[xe]=xe%2?m(f[xe-1],f[xe],l).y:m(f[xe],f[xe+1],l).x;return oe}function tw(e,t,n,r,i,o,a,s){for(var c=[],u=[[],[]],p,l,f,d,m,g,v,w,S=0;S<2;++S){if(S==0?(l=6*e-12*n+6*i,p=-3*e+9*n-9*i+3*a,f=3*n-3*e):(l=6*t-12*r+6*o,p=-3*t+9*r-9*o+3*s,f=3*r-3*t),Ur(p)<1e-12){if(Ur(l)<1e-12)continue;d=-f/l,0<d&&d<1&&c.push(d);continue}v=l*l-4*f*p,w=pt.sqrt(v),!(v<0)&&(m=(-l+w)/(2*p),0<m&&m<1&&c.push(m),g=(-l-w)/(2*p),0<g&&g<1&&c.push(g))}for(var x=c.length,b=x,R;x--;)d=c[x],R=1-d,u[0][x]=R*R*R*e+3*R*R*d*n+3*R*d*d*i+d*d*d*a,u[1][x]=R*R*R*t+3*R*R*d*r+3*R*d*d*o+d*d*d*s;return u[0][b]=e,u[1][b]=t,u[0][b+1]=a,u[1][b+1]=s,u[0].length=u[1].length=b+2,{x0:Jn(...u[0]),y0:Jn(...u[1]),x1:er(...u[0]),y1:er(...u[1])}}function Rm(e){if(J0(e)||(e=U0(e)),K0(e))return e;for(var t=Y0(ew(e)),n={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},r=function(f,d,m){var g,v;if(!f)return["C",d.x,d.y,d.x,d.y,d.x,d.y];switch(!(f[0]in{T:1,Q:1})&&(d.qx=d.qy=null),f[0]){case"M":d.X=f[1],d.Y=f[2];break;case"A":f=["C",...Pm(d.x,d.y,...f.slice(1))];break;case"S":m=="C"||m=="S"?(g=d.x*2-d.bx,v=d.y*2-d.by):(g=d.x,v=d.y),f=["C",g,v,...f.slice(1)];break;case"T":m=="Q"||m=="T"?(d.qx=d.x*2-d.qx,d.qy=d.y*2-d.qy):(d.qx=d.x,d.qy=d.y),f=["C",...Cm(d.x,d.y,d.qx,d.qy,f[1],f[2])];break;case"Q":d.qx=f[1],d.qy=f[2],f=["C",...Cm(d.x,d.y,f[1],f[2],f[3],f[4])];break;case"L":f=["C",...xc(d.x,d.y,f[1],f[2])];break;case"H":f=["C",...xc(d.x,d.y,f[1],d.y)];break;case"V":f=["C",...xc(d.x,d.y,d.x,f[1])];break;case"Z":f=["C",...xc(d.x,d.y,d.X,d.Y)];break}return f},i=function(f,d){if(f[d].length>7){f[d].shift();for(var m=f[d];m.length;)o[d]="A",f.splice(d++,0,["C",...m.splice(0,6)]);f.splice(d,1),u=t.length}},o=[],a="",s="",c=0,u=t.length;c<u;c++){t[c]&&(a=t[c][0]),a!="C"&&(o[c]=a,c&&(s=o[c-1])),t[c]=r(t[c],n,s),o[c]!="A"&&a=="C"&&(o[c]="C"),i(t,c);var p=t[c],l=p.length;n.x=p[l-2],n.y=p[l-1],n.bx=gm(p[l-4])||n.x,n.by=gm(p[l-3])||n.y}return t}N();function de(e){return Se(e)&&dt(e,"waypoints")}function ee(e){return Se(e)&&dt(e,"labelTarget")}function wc(e){return{x:Math.round(e.x),y:Math.round(e.y),width:Math.round(e.width),height:Math.round(e.height)}}function Rn(e){return{x:Math.round(e.x),y:Math.round(e.y)}}function Z(e){return{top:e.y,right:e.x+(e.width||0),bottom:e.y+(e.height||0),left:e.x}}function Si(e){return{x:e.left,y:e.top,width:e.right-e.left,height:e.bottom-e.top}}function nw(e){return Rn({x:e.x+(e.width||0)/2,y:e.y+(e.height||0)/2})}function rw(e){for(var t=e.waypoints,n=t.reduce(function(u,p,l){var f=t[l-1];if(f){var d=u[u.length-1],m=d&&d.endLength||0,g=ow(f,p);u.push({start:f,end:p,startLength:m,endLength:m+g,length:g})}return u},[]),r=n.reduce(function(u,p){return u+p.length},0),i=r/2,o=0,a=n[o];a.endLength<i;)a=n[++o];var s=(i-a.startLength)/a.length,c={x:a.start.x+(a.end.x-a.start.x)*s,y:a.start.y+(a.end.y-a.start.y)*s};return c}function X(e){return de(e)?rw(e):nw(e)}function He(e,t,n){n=n||0,Se(n)||(n={x:n,y:n});var r=Z(e),i=Z(t),o=r.bottom+n.y<=i.top,a=r.left-n.x>=i.right,s=r.top-n.y>=i.bottom,c=r.right+n.x<=i.left,u=o?"top":s?"bottom":null,p=c?"left":a?"right":null;return p&&u?u+"-"+p:p||u||"intersect"}function qr(e,t,n){var r=iw(e,t);return r.length===1||r.length===2&&Gr(r[0],r[1])<1?Rn(r[0]):r.length>1?(r=At(r,function(i){var o=Math.floor(i.t2*100)||1;return o=100-o,o=(o<10?"0":"")+o,i.segment2+"#"+o}),Rn(r[n?0:r.length-1])):null}function iw(e,t){return Da(e,t)}function Am(e){e=e.slice();for(var t=0,n,r,i;e[t];)n=e[t],r=e[t-1],i=e[t+1],Gr(n,i)===0||uo(r,i,n)?e.splice(t,1):t++;return e}function ow(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Sc(e,t){return Math.round(e*t)/t}function Tm(e){return ne(e)?e+"px":e}function aw(e){for(;e.parent;)e=e.parent;return e}function sw(e){e=C({},{width:"100%",height:"100%"},e);let t=e.container||document.body,n=document.createElement("div");return n.setAttribute("class","djs-container djs-parent"),vt(n,{position:"relative",overflow:"hidden",width:Tm(e.width),height:Tm(e.height)}),t.appendChild(n),n}function Mm(e,t,n){let r=U("g");pe(r).add(t);let i=n!==void 0?n:e.childNodes.length-1;return e.insertBefore(r,e.childNodes[i]||null),r}var cw="base",Dm=0,uw=1,pw={shape:["x","y","width","height"],connection:["waypoints"]};function le(e,t,n,r){this._eventBus=t,this._elementRegistry=r,this._graphicsFactory=n,this._rootsIdx=0,this._layers={},this._planes=[],this._rootElement=null,this._focused=!1,this._init(e||{})}le.$inject=["config.canvas","eventBus","graphicsFactory","elementRegistry"];le.prototype._init=function(e){let t=this._eventBus,n=this._container=sw(e),r=this._svg=U("svg");$(r,{width:"100%",height:"100%"}),nt(r,"tabindex",0),e.autoFocus&&t.on("element.hover",()=>{this.restoreFocus()}),t.on("element.mousedown",500,o=>{this.focus()}),r.addEventListener("focusin",()=>{this._setFocused(!0)}),r.addEventListener("focusout",()=>{this._setFocused(!1)}),r.addEventListener("mouseover",()=>{this._eventBus.fire("canvas.mouseover")}),r.addEventListener("mouseout",()=>{this._eventBus.fire("canvas.mouseout")}),J(n,r);let i=this._viewport=Mm(r,"viewport");e.deferUpdate&&(this._viewboxChanged=Ca(tt(this._viewboxChanged,this),300)),t.on("diagram.init",()=>{t.fire("canvas.init",{svg:r,viewport:i})}),t.on(["shape.added","connection.added","shape.removed","connection.removed","elements.changed","root.set"],()=>{delete this._cachedViewbox}),t.on("diagram.destroy",500,this._destroy,this),t.on("diagram.clear",500,this._clear,this)};le.prototype._destroy=function(){this._eventBus.fire("canvas.destroy",{svg:this._svg,viewport:this._viewport});let e=this._container.parentNode;e&&e.removeChild(this._container),delete this._svg,delete this._container,delete this._layers,delete this._planes,delete this._rootElement,delete this._viewport};le.prototype._setFocused=function(e){e!=this._focused&&(this._focused=e,this._eventBus.fire("canvas.focus.changed",{focused:e}))};le.prototype._clear=function(){this._elementRegistry.getAll().forEach(t=>{let n=_c(t);n==="root"?this.removeRootElement(t):this._removeElement(t,n)}),this._planes=[],this._rootElement=null,delete this._cachedViewbox};le.prototype.focus=function(){this._svg.focus({preventScroll:!0}),this._setFocused(!0)};le.prototype.restoreFocus=function(){document.activeElement===document.body&&this.focus()};le.prototype.isFocused=function(){return this._focused};le.prototype.getDefaultLayer=function(){return this.getLayer(cw,Dm)};le.prototype.getLayer=function(e,t){if(!e)throw new Error("must specify a name");let n=this._layers[e];if(n||(n=this._layers[e]=this._createLayer(e,t)),typeof t!="undefined"&&n.index!==t)throw new Error("layer <"+e+"> already created at index <"+t+">");return n.group};le.prototype._getChildIndex=function(e){return Ge(this._layers,function(t,n){return n.visible&&e>=n.index&&t++,t},0)};le.prototype._createLayer=function(e,t){typeof t=="undefined"&&(t=uw);let n=this._getChildIndex(t);return{group:Mm(this._viewport,"layer-"+e,n),index:t,visible:!0}};le.prototype.showLayer=function(e){if(!e)throw new Error("must specify a name");let t=this._layers[e];if(!t)throw new Error("layer <"+e+"> does not exist");let n=this._viewport,r=t.group,i=t.index;if(t.visible)return r;let o=this._getChildIndex(i);return n.insertBefore(r,n.childNodes[o]||null),t.visible=!0,r};le.prototype.hideLayer=function(e){if(!e)throw new Error("must specify a name");let t=this._layers[e];if(!t)throw new Error("layer <"+e+"> does not exist");let n=t.group;return t.visible&&(Pe(n),t.visible=!1),n};le.prototype._removeLayer=function(e){let t=this._layers[e];t&&(delete this._layers[e],Pe(t.group))};le.prototype.getActiveLayer=function(){let e=this._findPlaneForRoot(this.getRootElement());return e?e.layer:null};le.prototype.findRoot=function(e){return typeof e=="string"&&(e=this._elementRegistry.get(e)),e?(this._findPlaneForRoot(aw(e))||{}).rootElement:void 0};le.prototype.getRootElements=function(){return this._planes.map(function(e){return e.rootElement})};le.prototype._findPlaneForRoot=function(e){return re(this._planes,function(t){return t.rootElement===e})};le.prototype.getContainer=function(){return this._container};le.prototype._updateMarker=function(e,t,n){let r;e.id||(e=this._elementRegistry.get(e)),e.markers=e.markers||new Set,r=this._elementRegistry._elements[e.id],r&&(E([r.gfx,r.secondaryGfx],function(i){i&&(n?(e.markers.add(t),pe(i).add(t)):(e.markers.delete(t),pe(i).remove(t)))}),this._eventBus.fire("element.marker.update",{element:e,gfx:r.gfx,marker:t,add:!!n}))};le.prototype.addMarker=function(e,t){this._updateMarker(e,t,!0)};le.prototype.removeMarker=function(e,t){this._updateMarker(e,t,!1)};le.prototype.hasMarker=function(e,t){return e.id||(e=this._elementRegistry.get(e)),e.markers?e.markers.has(t):!1};le.prototype.toggleMarker=function(e,t){this.hasMarker(e,t)?this.removeMarker(e,t):this.addMarker(e,t)};le.prototype.getRootElement=function(){let e=this._rootElement;return e||this._planes.length?e:this.setRootElement(this.addRootElement(null))};le.prototype.addRootElement=function(e){let t=this._rootsIdx++;e||(e={id:"__implicitroot_"+t,children:[],isImplicit:!0});let n=e.layer="root-"+t;this._ensureValid("root",e);let r=this.getLayer(n,Dm);return this.hideLayer(n),this._addRoot(e,r),this._planes.push({rootElement:e,layer:r}),e};le.prototype.removeRootElement=function(e){if(typeof e=="string"&&(e=this._elementRegistry.get(e)),!!this._findPlaneForRoot(e))return this._removeRoot(e),this._removeLayer(e.layer),this._planes=this._planes.filter(function(n){return n.rootElement!==e}),this._rootElement===e&&(this._rootElement=null),e};le.prototype.setRootElement=function(e){if(e===this._rootElement)return e;let t;if(!e)throw new Error("rootElement required");return t=this._findPlaneForRoot(e),t||(e=this.addRootElement(e)),this._setRoot(e),e};le.prototype._removeRoot=function(e){let t=this._elementRegistry,n=this._eventBus;n.fire("root.remove",{element:e}),n.fire("root.removed",{element:e}),t.remove(e)};le.prototype._addRoot=function(e,t){let n=this._elementRegistry,r=this._eventBus;r.fire("root.add",{element:e}),n.add(e,t),r.fire("root.added",{element:e,gfx:t})};le.prototype._setRoot=function(e,t){let n=this._rootElement;n&&(this._elementRegistry.updateGraphics(n,null,!0),this.hideLayer(n.layer)),e&&(t||(t=this._findPlaneForRoot(e).layer),this._elementRegistry.updateGraphics(e,this._svg,!0),this.showLayer(e.layer)),this._rootElement=e,this._eventBus.fire("root.set",{element:e})};le.prototype._ensureValid=function(e,t){if(!t.id)throw new Error("element must have an id");if(this._elementRegistry.get(t.id))throw new Error("element <"+t.id+"> already exists");let n=pw[e];if(!ln(n,function(i){return typeof t[i]!="undefined"}))throw new Error("must supply { "+n.join(", ")+" } with "+e)};le.prototype._setParent=function(e,t,n){Ae(t.children,e,n),e.parent=t};le.prototype._addElement=function(e,t,n,r){n=n||this.getRootElement();let i=this._eventBus,o=this._graphicsFactory;this._ensureValid(e,t),i.fire(e+".add",{element:t,parent:n}),this._setParent(t,n,r);let a=o.create(e,t,r);return this._elementRegistry.add(t,a),o.update(e,t,a),i.fire(e+".added",{element:t,gfx:a}),t};le.prototype.addShape=function(e,t,n){return this._addElement("shape",e,t,n)};le.prototype.addConnection=function(e,t,n){return this._addElement("connection",e,t,n)};le.prototype._removeElement=function(e,t){let n=this._elementRegistry,r=this._graphicsFactory,i=this._eventBus;if(e=n.get(e.id||e),!!e)return i.fire(t+".remove",{element:e}),r.remove(e),Oe(e.parent&&e.parent.children,e),e.parent=null,i.fire(t+".removed",{element:e}),n.remove(e),e};le.prototype.removeShape=function(e){return this._removeElement(e,"shape")};le.prototype.removeConnection=function(e){return this._removeElement(e,"connection")};le.prototype.getGraphics=function(e,t){return this._elementRegistry.getGraphics(e,t)};le.prototype._changeViewbox=function(e){this._eventBus.fire("canvas.viewbox.changing"),e.apply(this),this._cachedViewbox=null,this._viewboxChanged()};le.prototype._viewboxChanged=function(){this._eventBus.fire("canvas.viewbox.changed",{viewbox:this.viewbox()})};le.prototype.viewbox=function(e){if(e===void 0&&this._cachedViewbox)return structuredClone(this._cachedViewbox);let t=this._viewport,n=this.getSize(),r,i,o,a,s,c,u;if(e)this._changeViewbox(function(){s=Math.min(n.width/e.width,n.height/e.height);let p=this._svg.createSVGMatrix().scale(s).translate(-e.x,-e.y);Ei(t,p)});else return o=this._rootElement?this.getActiveLayer():null,r=o&&o.getBBox()||{},a=Ei(t),i=a?a.matrix:lm(),s=Sc(i.a,1e3),c=Sc(-i.e||0,1e3),u=Sc(-i.f||0,1e3),e=this._cachedViewbox={x:c?c/s:0,y:u?u/s:0,width:n.width/s,height:n.height/s,scale:s,inner:{width:r.width||0,height:r.height||0,x:r.x||0,y:r.y||0},outer:n},e;return e};le.prototype.scroll=function(e){let t=this._viewport,n=t.getCTM();return e&&this._changeViewbox(function(){e=C({dx:0,dy:0},e||{}),n=this._svg.createSVGMatrix().translate(e.dx,e.dy).multiply(n),km(t,n)}),{x:n.e,y:n.f}};le.prototype.scrollToElement=function(e,t){let n=100;typeof e=="string"&&(e=this._elementRegistry.get(e));let r=this.findRoot(e);if(r!==this.getRootElement()&&this.setRootElement(r),r===e)return;t||(t={}),typeof t=="number"&&(n=t),t={top:t.top||n,right:t.right||n,bottom:t.bottom||n,left:t.left||n};let i=Ce(e),o=Z(i),a=this.viewbox(),s=this.zoom(),c,u;a.y+=t.top/s,a.x+=t.left/s,a.width-=(t.right+t.left)/s,a.height-=(t.bottom+t.top)/s;let p=Z(a);if(!(i.width<a.width&&i.height<a.height))c=i.x-a.x,u=i.y-a.y;else{let f=Math.max(0,o.right-p.right),d=Math.min(0,o.left-p.left),m=Math.max(0,o.bottom-p.bottom),g=Math.min(0,o.top-p.top);c=f||d,u=m||g}this.scroll({dx:-c*s,dy:-u*s})};le.prototype.zoom=function(e,t){if(!e)return this.viewbox(e).scale;if(e==="fit-viewport")return this._fitViewport(t);let n,r;return this._changeViewbox(function(){typeof t!="object"&&(n=this.viewbox().outer,t={x:n.width/2,y:n.height/2}),r=this._setZoom(e,t)}),Sc(r.a,1e3)};function km(e,t){let n="matrix("+t.a+","+t.b+","+t.c+","+t.d+","+t.e+","+t.f+")";e.setAttribute("transform",n)}le.prototype._fitViewport=function(e){let t=this.viewbox(),n=t.outer,r=t.inner,i,o;return r.x>=0&&r.y>=0&&r.x+r.width<=n.width&&r.y+r.height<=n.height&&!e?o={x:0,y:0,width:Math.max(r.width+r.x,n.width),height:Math.max(r.height+r.y,n.height)}:(i=Math.min(1,n.width/r.width,n.height/r.height),o={x:r.x+(e?r.width/2-n.width/i/2:0),y:r.y+(e?r.height/2-n.height/i/2:0),width:n.width/i,height:n.height/i}),this.viewbox(o),this.viewbox(!1).scale};le.prototype._setZoom=function(e,t){let n=this._svg,r=this._viewport,i=n.createSVGMatrix(),o=n.createSVGPoint(),a,s,c,u,p;c=r.getCTM();let l=c.a;return t?(a=C(o,t),s=a.matrixTransform(c.inverse()),u=i.translate(s.x,s.y).scale(1/l*e).translate(-s.x,-s.y),p=c.multiply(u)):p=i.scale(e),km(this._viewport,p),p};le.prototype.getSize=function(){return{width:this._container.clientWidth,height:this._container.clientHeight}};le.prototype.getAbsoluteBBox=function(e){let t=this.viewbox(),n;e.waypoints?n=this.getGraphics(e).getBBox():n=e;let r=n.x*t.scale-t.x*t.scale,i=n.y*t.scale-t.y*t.scale,o=n.width*t.scale,a=n.height*t.scale;return{x:r,y:i,width:o,height:a}};le.prototype.resized=function(){delete this._cachedViewbox,this._eventBus.fire("canvas.resized")};var po="data-element-id";function Ut(e){this._elements={},this._eventBus=e}Ut.$inject=["eventBus"];Ut.prototype.add=function(e,t,n){var r=e.id;this._validateId(r),$(t,po,r),n&&$(n,po,r),this._elements[r]={element:e,gfx:t,secondaryGfx:n}};Ut.prototype.remove=function(e){var t=this._elements,n=e.id||e,r=n&&t[n];r&&($(r.gfx,po,""),r.secondaryGfx&&$(r.secondaryGfx,po,""),delete t[n])};Ut.prototype.updateId=function(e,t){this._validateId(t),typeof e=="string"&&(e=this.get(e)),this._eventBus.fire("element.updateId",{element:e,newId:t});var n=this.getGraphics(e),r=this.getGraphics(e,!0);this.remove(e),e.id=t,this.add(e,n,r)};Ut.prototype.updateGraphics=function(e,t,n){var r=e.id||e,i=this._elements[r];return n?i.secondaryGfx=t:i.gfx=t,t&&$(t,po,r),t};Ut.prototype.get=function(e){var t;typeof e=="string"?t=e:t=e&&$(e,po);var n=this._elements[t];return n&&n.element};Ut.prototype.filter=function(e){var t=[];return this.forEach(function(n,r){e(n,r)&&t.push(n)}),t};Ut.prototype.find=function(e){for(var t=this._elements,n=Object.keys(t),r=0;r<n.length;r++){var i=n[r],o=t[i],a=o.element,s=o.gfx;if(e(a,s))return a}};Ut.prototype.getAll=function(){return this.filter(function(e){return e})};Ut.prototype.forEach=function(e){var t=this._elements;Object.keys(t).forEach(function(n){var r=t[n],i=r.element,o=r.gfx;return e(i,o)})};Ut.prototype.getGraphics=function(e,t){var n=e.id||e,r=this._elements[n];return r&&(t?r.secondaryGfx:r.gfx)};Ut.prototype._validateId=function(e){if(!e)throw new Error("element must have an id");if(this._elements[e])throw new Error("element with id "+e+" already added")};N();function lw(e,t,n,r){var i=n.inverse;return Object.defineProperty(e,"remove",{value:function(o){var a=this.indexOf(o);return a!==-1&&(this.splice(a,1),t.unset(o,i,r)),o}}),Object.defineProperty(e,"contains",{value:function(o){return this.indexOf(o)!==-1}}),Object.defineProperty(e,"add",{value:function(o,a){var s=this.indexOf(o);if(typeof a=="undefined"){if(s!==-1)return;a=this.length}s!==-1&&this.splice(s,1),this.splice(a,0,o),s===-1&&t.set(o,i,r)}}),Object.defineProperty(e,"__refs_collection",{value:!0}),e}function fw(e){return e.__refs_collection===!0}function dw(e,t){return Object.prototype.hasOwnProperty.call(e,t.name||t)}function Nm(e,t,n){var r=lw(n[t.name]||[],e,t,n);Object.defineProperty(n,t.name,{enumerable:t.enumerable,value:r}),r.length&&r.forEach(function(i){e.set(i,t.inverse,n)})}function mw(e,t,n){var r=t.inverse,i=n[t.name];Object.defineProperty(n,t.name,{configurable:t.configurable,enumerable:t.enumerable,get:function(){return i},set:function(o){if(o!==i){var a=i;i=null,a&&e.unset(a,r,n),i=o,e.set(i,r,n)}}})}function fn(e,t){if(!(this instanceof fn))return new fn(e,t);e.inverse=t,t.inverse=e,this.props={},this.props[e.name]=e,this.props[t.name]=t}fn.prototype.bind=function(e,t){if(typeof t=="string"){if(!this.props[t])throw new Error("no property <"+t+"> in ref");t=this.props[t]}t.collection?Nm(this,t,e):mw(this,t,e)};fn.prototype.ensureRefsCollection=function(e,t){var n=e[t.name];return fw(n)||Nm(this,t,e),n};fn.prototype.ensureBound=function(e,t){dw(e,t)||this.bind(e,t)};fn.prototype.unset=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).remove(n):e[t.name]=void 0)};fn.prototype.set=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).add(n):e[t.name]=n)};var Il=new fn({name:"children",enumerable:!0,collection:!0},{name:"parent"}),Bm=new fn({name:"labels",enumerable:!0,collection:!0},{name:"labelTarget"}),Om=new fn({name:"attachers",collection:!0},{name:"host"}),Im=new fn({name:"outgoing",collection:!0},{name:"source"}),Lm=new fn({name:"incoming",collection:!0},{name:"target"});function lo(){Object.defineProperty(this,"businessObject",{writable:!0}),Object.defineProperty(this,"label",{get:function(){return this.labels[0]},set:function(e){var t=this.label,n=this.labels;!e&&t?n.remove(t):n.add(e,0)}}),Il.bind(this,"parent"),Bm.bind(this,"labels"),Im.bind(this,"outgoing"),Lm.bind(this,"incoming")}function ka(){lo.call(this),Il.bind(this,"children"),Om.bind(this,"host"),Om.bind(this,"attachers")}B(ka,lo);function jm(){lo.call(this),Il.bind(this,"children")}B(jm,ka);function Fm(){ka.call(this),Bm.bind(this,"labelTarget")}B(Fm,ka);function Hm(){lo.call(this),Im.bind(this,"source"),Lm.bind(this,"target")}B(Hm,lo);var hw={connection:Hm,shape:ka,label:Fm,root:jm};function $m(e,t){var n=hw[e];if(!n)throw new Error("unknown type: <"+e+">");return C(new n,t)}function zm(e){return e instanceof lo}N();function Pn(){this._uid=12}Pn.prototype.createRoot=function(e){return this.create("root",e)};Pn.prototype.createLabel=function(e){return this.create("label",e)};Pn.prototype.createShape=function(e){return this.create("shape",e)};Pn.prototype.createConnection=function(e){return this.create("connection",e)};Pn.prototype.create=function(e,t){return t=C({},t||{}),t.id||(t.id=e+"_"+this._uid++),$m(e,t)};N();var Cc="__fn",Gm=1e3,vw=Array.prototype.slice;function jt(){this._listeners={},this.on("diagram.destroy",1,this._destroy,this)}jt.prototype.on=function(e,t,n,r){if(e=q(e)?e:[e],Le(t)&&(r=n,n=t,t=Gm),!ne(t))throw new Error("priority must be a number");var i=n;r&&(i=tt(n,r),i[Cc]=n[Cc]||n);var o=this;e.forEach(function(a){o._addListener(a,{priority:t,callback:i,next:null})})};jt.prototype.once=function(e,t,n,r){var i=this;if(Le(t)&&(r=n,n=t,t=Gm),!ne(t))throw new Error("priority must be a number");function o(){o.__isTomb=!0;var a=n.apply(r,arguments);return i.off(e,o),a}o[Cc]=n,this.on(e,t,o)};jt.prototype.off=function(e,t){e=q(e)?e:[e];var n=this;e.forEach(function(r){n._removeListener(r,t)})};jt.prototype.createEvent=function(e){var t=new Na;return t.init(e),t};jt.prototype.fire=function(e,t){var n,r,i,o;if(o=vw.call(arguments),typeof e=="object"&&(t=e,e=t.type),!e)throw new Error("no event type specified");if(r=this._listeners[e],!!r){t instanceof Na?n=t:n=this.createEvent(t),o[0]=n;var a=n.type;e!==a&&(n.type=e);try{i=this._invokeListeners(n,o,r)}finally{e!==a&&(n.type=a)}return i===void 0&&n.defaultPrevented&&(i=!1),i}};jt.prototype.handleError=function(e){return this.fire("error",{error:e})===!1};jt.prototype._destroy=function(){this._listeners={}};jt.prototype._invokeListeners=function(e,t,n){for(var r;n&&!e.cancelBubble;)r=this._invokeListener(e,t,n),n=n.next;return r};jt.prototype._invokeListener=function(e,t,n){var r;if(n.callback.__isTomb)return r;try{r=gw(n.callback,t),r!==void 0&&(e.returnValue=r,e.stopPropagation()),r===!1&&e.preventDefault()}catch(i){if(!this.handleError(i))throw console.error("unhandled error in event listener",i),i}return r};jt.prototype._addListener=function(e,t){var n=this._getListeners(e),r;if(!n){this._setListeners(e,t);return}for(;n;){if(n.priority<t.priority){t.next=n,r?r.next=t:this._setListeners(e,t);return}r=n,n=n.next}r.next=t};jt.prototype._getListeners=function(e){return this._listeners[e]};jt.prototype._setListeners=function(e,t){this._listeners[e]=t};jt.prototype._removeListener=function(e,t){var n=this._getListeners(e),r,i,o;if(!t){this._setListeners(e,null);return}for(;n;)r=n.next,o=n.callback,(o===t||o[Cc]===t)&&(i?i.next=r:this._setListeners(e,r)),i=n,n=r};function Na(){}Na.prototype.stopPropagation=function(){this.cancelBubble=!0};Na.prototype.preventDefault=function(){this.defaultPrevented=!0};Na.prototype.init=function(e){C(this,e||{})};function gw(e,t){return e.apply(null,t)}N();function Ln(e){return e.childNodes[0]}function Vm(e){return e.parentNode.childNodes[1]}function fo(e,t,n,r,i){var o=so();o.setTranslate(t,n);var a=so();a.setRotate(r||0,0,0);var s=so();s.setScale(i||1,i||1),Ei(e,[o,a,s])}function Fe(e,t,n){var r=so();r.setTranslate(t,n),Ei(e,r)}function Rc(e,t){var n=so();n.setRotate(t,0,0),Ei(e,n)}function qt(e,t){this._eventBus=e,this._elementRegistry=t}qt.$inject=["eventBus","elementRegistry"];qt.prototype._getChildrenContainer=function(e){var t=this._elementRegistry.getGraphics(e),n;return e.parent?(n=Vm(t),n||(n=U("g"),pe(n).add("djs-children"),J(t.parentNode,n))):n=t,n};qt.prototype._clear=function(e){var t=Ln(e);return Hr(t),t};qt.prototype._createContainer=function(e,t,n,r){var i=U("g");pe(i).add("djs-group"),typeof n!="undefined"?Wm(i,t,t.childNodes[n]):J(t,i);var o=U("g");pe(o).add("djs-element"),pe(o).add("djs-"+e),r&&pe(o).add("djs-frame"),J(i,o);var a=U("g");return pe(a).add("djs-visual"),J(o,a),o};qt.prototype.create=function(e,t,n){var r=this._getChildrenContainer(t.parent);return this._createContainer(e,r,n,bc(t))};qt.prototype.updateContainments=function(e){var t=this,n=this._elementRegistry,r;r=Ge(e,function(i,o){return o.parent&&(i[o.parent.id]=o.parent),i},{}),E(r,function(i){var o=i.children;if(o){var a=t._getChildrenContainer(i);E(o.slice().reverse(),function(s){var c=n.getGraphics(s);Wm(c.parentNode,a)})}})};qt.prototype.drawShape=function(e,t,n={}){var r=this._eventBus;return r.fire("render.shape",{gfx:e,element:t,attrs:n})};qt.prototype.getShapePath=function(e){var t=this._eventBus;return t.fire("render.getShapePath",e)};qt.prototype.drawConnection=function(e,t,n={}){var r=this._eventBus;return r.fire("render.connection",{gfx:e,element:t,attrs:n})};qt.prototype.getConnectionPath=function(e){var t=this._eventBus;return t.fire("render.getConnectionPath",e)};qt.prototype.update=function(e,t,n){if(t.parent){var r=this._clear(n);if(e==="shape")this.drawShape(r,t),Fe(n,t.x,t.y);else if(e==="connection")this.drawConnection(r,t);else throw new Error("unknown type: "+e);t.hidden?$(n,"display","none"):$(n,"display","block")}};qt.prototype.remove=function(e){var t=this._elementRegistry.getGraphics(e);Pe(t.parentNode)};function Wm(e,t,n){var r=n||t.firstChild;e!==r&&t.insertBefore(e,r)}var Um={__depends__:[vm],__init__:["canvas"],canvas:["type",le],elementRegistry:["type",Ut],elementFactory:["type",Pn],eventBus:["type",jt],graphicsFactory:["type",qt]};function yw(e){var t=new Tl(e);return t.init(),t}function _w(e){e=e||{};var t={config:["value",e]},n=[t,Um].concat(e.modules||[]);return yw(n)}function tr(e,t){this._injector=t||_w(e),this.get("eventBus").fire("diagram.init")}tr.prototype.get=function(e,t){return this._injector.get(e,t)};tr.prototype.invoke=function(e,t,n){return this._injector.invoke(e,t,n)};tr.prototype.destroy=function(){this.get("eventBus").fire("diagram.destroy")};tr.prototype.clear=function(){this.get("eventBus").fire("diagram.clear")};N();N();function Fl(){}Fl.prototype.get=function(e){return this.$model.properties.get(this,e)};Fl.prototype.set=function(e,t){this.$model.properties.set(this,e,t)};function Km(e,t){this.model=e,this.properties=t}Km.prototype.createType=function(e){var t=this.model,n=this.properties,r=Object.create(Fl.prototype);E(e.properties,function(a){!a.isMany&&a.default!==void 0&&(r[a.name]=a.default)}),n.defineModel(r,t),n.defineDescriptor(r,e);var i=e.ns.name;function o(a){n.define(this,"$type",{value:i,enumerable:!0}),n.define(this,"$attrs",{value:{}}),n.define(this,"$parent",{writable:!0}),E(a,tt(function(s,c){this.set(c,s)},this))}return o.prototype=r,o.hasType=r.$instanceOf=this.model.hasType,n.defineModel(o,t),n.defineDescriptor(o,e),o};var bw={String:!0,Boolean:!0,Integer:!0,Real:!0,Element:!0},Ym={String:function(e){return e},Boolean:function(e){return e==="true"},Integer:function(e){return parseInt(e,10)},Real:function(e){return parseFloat(e)}};function Pc(e,t){var n=Ym[e];return n?n(t):t}function Ll(e){return!!bw[e]}function Hl(e){return!!Ym[e]}function Tt(e,t){var n=e.split(/:/),r,i;if(n.length===1)r=e,i=t;else if(n.length===2)r=n[1],i=n[0];else throw new Error("expected <prefix:localName> or <localName>, got "+e);return e=(i?i+":":"")+r,{name:e,prefix:i,localName:r}}function dn(e){this.ns=e,this.name=e.name,this.allTypes=[],this.allTypesByName={},this.properties=[],this.propertiesByName={}}dn.prototype.build=function(){return mt(this,["ns","name","allTypes","allTypesByName","properties","propertiesByName","bodyProperty","idProperty"])};dn.prototype.addProperty=function(e,t,n){typeof t=="boolean"&&(n=t,t=void 0),this.addNamedProperty(e,n!==!1);var r=this.properties;t!==void 0?r.splice(t,0,e):r.push(e)};dn.prototype.replaceProperty=function(e,t,n){var r=e.ns,i=this.properties,o=this.propertiesByName,a=e.name!==t.name;if(e.isId){if(!t.isId)throw new Error("property <"+t.ns.name+"> must be id property to refine <"+e.ns.name+">");this.setIdProperty(t,!1)}if(e.isBody){if(!t.isBody)throw new Error("property <"+t.ns.name+"> must be body property to refine <"+e.ns.name+">");this.setBodyProperty(t,!1)}var s=i.indexOf(e);if(s===-1)throw new Error("property <"+r.name+"> not found in property list");i.splice(s,1),this.addProperty(t,n?void 0:s,a),o[r.name]=o[r.localName]=t};dn.prototype.redefineProperty=function(e,t,n){var r=e.ns.prefix,i=t.split("#"),o=Tt(i[0],r),a=Tt(i[1],o.prefix).name,s=this.propertiesByName[a];if(s)this.replaceProperty(s,e,n);else throw new Error("refined property <"+a+"> not found");delete e.redefines};dn.prototype.addNamedProperty=function(e,t){var n=e.ns,r=this.propertiesByName;t&&(this.assertNotDefined(e,n.name),this.assertNotDefined(e,n.localName)),r[n.name]=r[n.localName]=e};dn.prototype.removeNamedProperty=function(e){var t=e.ns,n=this.propertiesByName;delete n[t.name],delete n[t.localName]};dn.prototype.setBodyProperty=function(e,t){if(t&&this.bodyProperty)throw new Error("body property defined multiple times (<"+this.bodyProperty.ns.name+">, <"+e.ns.name+">)");this.bodyProperty=e};dn.prototype.setIdProperty=function(e,t){if(t&&this.idProperty)throw new Error("id property defined multiple times (<"+this.idProperty.ns.name+">, <"+e.ns.name+">)");this.idProperty=e};dn.prototype.assertNotTrait=function(e){if((e.extends||[]).length)throw new Error(`cannot create <${e.name}> extending <${e.extends}>`)};dn.prototype.assertNotDefined=function(e,t){var n=e.name,r=this.propertiesByName[n];if(r)throw new Error("property <"+n+"> already defined; override of <"+r.definedBy.ns.name+"#"+r.ns.name+"> by <"+e.definedBy.ns.name+"#"+e.ns.name+"> not allowed without redefines")};dn.prototype.hasProperty=function(e){return this.propertiesByName[e]};dn.prototype.addTrait=function(e,t){t&&this.assertNotTrait(e);var n=this.allTypesByName,r=this.allTypes,i=e.name;i in n||(E(e.properties,tt(function(o){o=C({},o,{name:o.ns.localName,inherited:t}),Object.defineProperty(o,"definedBy",{value:e});var a=o.replaces,s=o.redefines;a||s?this.redefineProperty(o,a||s,a):(o.isBody&&this.setBodyProperty(o),o.isId&&this.setIdProperty(o),this.addProperty(o))},this)),r.push(e),n[i]=e)};function Kr(e,t){this.packageMap={},this.typeMap={},this.packages=[],this.properties=t,E(e,tt(this.registerPackage,this))}Kr.prototype.getPackage=function(e){return this.packageMap[e]};Kr.prototype.getPackages=function(){return this.packages};Kr.prototype.registerPackage=function(e){e=C({},e);var t=this.packageMap;qm(t,e,"prefix"),qm(t,e,"uri"),E(e.types,tt(function(n){this.registerType(n,e)},this)),t[e.uri]=t[e.prefix]=e,this.packages.push(e)};Kr.prototype.registerType=function(e,t){e=C({},e,{superClass:(e.superClass||[]).slice(),extends:(e.extends||[]).slice(),properties:(e.properties||[]).slice(),meta:C(e.meta||{})});var n=Tt(e.name,t.prefix),r=n.name,i={};E(e.properties,tt(function(o){var a=Tt(o.name,n.prefix),s=a.name;Ll(o.type)||(o.type=Tt(o.type,a.prefix).name),C(o,{ns:a,name:s}),i[s]=o},this)),C(e,{ns:n,name:r,propertiesByName:i}),E(e.extends,tt(function(o){var a=Tt(o,n.prefix),s=this.typeMap[a.name];s.traits=s.traits||[],s.traits.push(r)},this)),this.definePackage(e,t),this.typeMap[r]=e};Kr.prototype.mapTypes=function(e,t,n){var r=Ll(e.name)?{name:e.name}:this.typeMap[e.name],i=this;function o(c,u){var p=Tt(c,Ll(c)?"":e.prefix);i.mapTypes(p,t,u)}function a(c){return o(c,!0)}function s(c){return o(c,!1)}if(!r)throw new Error("unknown type <"+e.name+">");E(r.superClass,n?a:s),t(r,!n),E(r.traits,a)};Kr.prototype.getEffectiveDescriptor=function(e){var t=Tt(e),n=new dn(t);this.mapTypes(t,function(i,o){n.addTrait(i,o)});var r=n.build();return this.definePackage(r,r.allTypes[r.allTypes.length-1].$pkg),r};Kr.prototype.definePackage=function(e,t){this.properties.define(e,"$pkg",{value:t})};function qm(e,t,n){var r=t[n];if(r in e)throw new Error("package with "+n+" <"+r+"> already defined")}function Ci(e){this.model=e}Ci.prototype.set=function(e,t,n){if(!st(t)||!t.length)throw new TypeError("property name must be a non-empty string");var r=this.getProperty(e,t),i=r&&r.name;xw(n)?r?delete e[i]:delete e.$attrs[jl(t)]:r?i in e?e[i]=n:Xm(e,r,n):e.$attrs[jl(t)]=n};Ci.prototype.get=function(e,t){var n=this.getProperty(e,t);if(!n)return e.$attrs[jl(t)];var r=n.name;return!e[r]&&n.isMany&&Xm(e,n,[]),e[r]};Ci.prototype.define=function(e,t,n){if(!n.writable){var r=n.value;n=C({},n,{get:function(){return r}}),delete n.value}Object.defineProperty(e,t,n)};Ci.prototype.defineDescriptor=function(e,t){this.define(e,"$descriptor",{value:t})};Ci.prototype.defineModel=function(e,t){this.define(e,"$model",{value:t})};Ci.prototype.getProperty=function(e,t){var n=this.model,r=n.getPropertyDescriptor(e,t);if(r)return r;if(t.includes(":"))return null;let i=n.config.strict;if(typeof i!="undefined"){let o=new TypeError(`unknown property <${t}> on <${e.$type}>`);if(i)throw o;typeof console!="undefined"&&console.warn(o)}return null};function xw(e){return typeof e=="undefined"}function Xm(e,t,n){Object.defineProperty(e,t.name,{enumerable:!t.isReference,writable:!0,value:n,configurable:!0})}function jl(e){return e.replace(/^:/,"")}function tn(e,t={}){this.properties=new Ci(this),this.factory=new Km(this,this.properties),this.registry=new Kr(e,this.properties),this.typeCache={},this.config=t}tn.prototype.create=function(e,t){var n=this.getType(e);if(!n)throw new Error("unknown type <"+e+">");return new n(t)};tn.prototype.getType=function(e){var t=this.typeCache,n=st(e)?e:e.ns.name,r=t[n];return r||(e=this.registry.getEffectiveDescriptor(n),r=t[n]=this.factory.createType(e)),r};tn.prototype.createAny=function(e,t,n){var r=Tt(e),i={$type:e,$instanceOf:function(a){return a===this.$type},get:function(a){return this[a]},set:function(a,s){_l(this,[a],s)}},o={name:e,isGeneric:!0,ns:{prefix:r.prefix,localName:r.localName,uri:t}};return this.properties.defineDescriptor(i,o),this.properties.defineModel(i,this),this.properties.define(i,"get",{enumerable:!1,writable:!0}),this.properties.define(i,"set",{enumerable:!1,writable:!0}),this.properties.define(i,"$parent",{enumerable:!1,writable:!0}),this.properties.define(i,"$instanceOf",{enumerable:!1,writable:!0}),E(n,function(a,s){Se(a)&&a.value!==void 0?i[a.name]=a.value:i[s]=a}),i};tn.prototype.getPackage=function(e){return this.registry.getPackage(e)};tn.prototype.getPackages=function(){return this.registry.getPackages()};tn.prototype.getElementDescriptor=function(e){return e.$descriptor};tn.prototype.hasType=function(e,t){t===void 0&&(t=e,e=this);var n=e.$model.getElementDescriptor(e);return t in n.allTypesByName};tn.prototype.getPropertyDescriptor=function(e,t){return this.getElementDescriptor(e).propertiesByName[t]};tn.prototype.getTypeDescriptor=function(e){return this.registry.typeMap[e]};N();var Zm=String.fromCharCode,Ew=Object.prototype.hasOwnProperty,ww=/&#(\d+);|&#x([0-9a-f]+);|&(\w+);/ig,Oa={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'};Object.keys(Oa).forEach(function(e){Oa[e.toUpperCase()]=Oa[e]});function Sw(e,t,n,r){return r?Ew.call(Oa,r)?Oa[r]:"&"+r+";":Zm(t||parseInt(n,16))}function Ri(e){return e.length>3&&e.indexOf("&")!==-1?e.replace(ww,Sw):e}var Qm="non-whitespace outside of root node";function mo(e){return new Error(e)}function Jm(e){return"missing namespace for prefix <"+e+">"}function Ac(e){return{get:e,enumerable:!0}}function Cw(e){var t={},n;for(n in e)t[n]=e[n];return t}function $l(e){return e+"$uri"}function Rw(e){var t={},n,r;for(n in e)r=e[n],t[r]=r,t[$l(r)]=n;return t}function eh(){return{line:0,column:0}}function Pw(e){throw e}function zl(e){if(!this)return new zl(e);var t=e&&e.proxy,n,r,i,o,a=Pw,s,c,u,p,l=eh,f=!1,d=!1,m=null,g=!1,v;function w(b){b instanceof Error||(b=mo(b)),m=b,a(b,l)}function S(b){s&&(b instanceof Error||(b=mo(b)),s(b,l))}this.on=function(b,R){if(typeof R!="function")throw mo("required args <name, cb>");switch(b){case"openTag":r=R;break;case"text":n=R;break;case"closeTag":i=R;break;case"error":a=R;break;case"warn":s=R;break;case"cdata":o=R;break;case"attention":p=R;break;case"question":u=R;break;case"comment":c=R;break;default:throw mo("unsupported event: "+b)}return this},this.ns=function(b){if(typeof b=="undefined"&&(b={}),typeof b!="object")throw mo("required args <nsMap={}>");var R={},A;for(A in b)R[A]=b[A];return d=!0,v=R,this},this.parse=function(b){if(typeof b!="string")throw mo("required args <xml=string>");return m=null,x(b),l=eh,g=!1,m},this.stop=function(){g=!0};function x(b){var R=d?[]:null,A=d?Rw(v):null,O,T=[],I=0,L=!1,W=!1,z=0,K=0,ve,Jt,ke,ye,he,we,Ie,Ze,H,G="",oe=0,xe;function Gt(){if(xe!==null)return xe;var _,y,M,D=d&&A.xmlns,F=d&&f?[]:null,V=oe,ae=G,be=ae.length,ft,at,St,xn,Be,yr={},lc={},pn,me,Te;e:for(;V<be;V++)if(pn=!1,me=ae.charCodeAt(V),!(me===32||me<14&&me>8)){for((me<65||me>122||me>90&&me<97)&&me!==95&&me!==58&&(S("illegal first char attribute name"),pn=!0),Te=V+1;Te<be;Te++)if(me=ae.charCodeAt(Te),!(me>96&&me<123||me>64&&me<91||me>47&&me<59||me===46||me===45||me===95)){if(me===32||me<14&&me>8){S("missing attribute value"),V=Te;continue e}if(me===61)break;S("illegal attribute name char"),pn=!0}if(Be=ae.substring(V,Te),Be==="xmlns:xmlns"&&(S("illegal declaration of xmlns"),pn=!0),me=ae.charCodeAt(Te+1),me===34)Te=ae.indexOf('"',V=Te+2),Te===-1&&(Te=ae.indexOf("'",V),Te!==-1&&(S("attribute value quote missmatch"),pn=!0));else if(me===39)Te=ae.indexOf("'",V=Te+2),Te===-1&&(Te=ae.indexOf('"',V),Te!==-1&&(S("attribute value quote missmatch"),pn=!0));else for(S("missing attribute value quotes"),pn=!0,Te=Te+1;Te<be&&(me=ae.charCodeAt(Te+1),!(me===32||me<14&&me>8));Te++);for(Te===-1&&(S("missing closing quotes"),Te=be,pn=!0),pn||(St=ae.substring(V,Te)),V=Te;Te+1<be&&(me=ae.charCodeAt(Te+1),!(me===32||me<14&&me>8));Te++)V===Te&&(S("illegal character after attribute end"),pn=!0);if(V=Te+1,pn)continue e;if(Be in lc){S("attribute <"+Be+"> already defined");continue}if(lc[Be]=!0,!d){yr[Be]=St;continue}if(f){if(at=Be==="xmlns"?"xmlns":Be.charCodeAt(0)===120&&Be.substr(0,6)==="xmlns:"?Be.substr(6):null,at!==null){if(_=Ri(St),y=$l(at),xn=v[_],!xn){if(at==="xmlns"||y in A&&A[y]!==_)do xn="ns"+I++;while(typeof A[xn]!="undefined");else xn=at;v[_]=xn}A[at]!==xn&&(ft||(A=Cw(A),ft=!0),A[at]=xn,at==="xmlns"&&(A[$l(xn)]=_,D=xn),A[y]=_),yr[Be]=St;continue}F.push(Be,St);continue}if(me=Be.indexOf(":"),me===-1){yr[Be]=St;continue}if(!(M=A[Be.substring(0,me)])){S(Jm(Be.substring(0,me)));continue}Be=D===M?Be.substr(me+1):M+Be.substr(me),yr[Be]=St}if(f)for(V=0,be=F.length;V<be;V++){if(Be=F[V++],St=F[V],me=Be.indexOf(":"),me!==-1){if(!(M=A[Be.substring(0,me)])){S(Jm(Be.substring(0,me)));continue}Be=D===M?Be.substr(me+1):M+Be.substr(me)}yr[Be]=St}return xe=yr}function P(){for(var _=/(\r\n|\r|\n)/g,y=0,M=0,D=0,F=K,V,ae;z>=D&&(V=_.exec(b),!(!V||(F=V[0].length+V.index,F>z)));)y+=1,D=F;return z==-1?(M=F,ae=b.substring(K)):K===0?ae=b.substring(K,z):(M=z-D,ae=K==-1?b.substring(z):b.substring(z,K+1)),{data:ae,line:y,column:M}}for(l=P,t&&(H=Object.create({},{name:Ac(function(){return Ie}),originalName:Ac(function(){return Ze}),attrs:Ac(Gt),ns:Ac(function(){return A})}));K!==-1;){if(b.charCodeAt(K)===60?z=K:z=b.indexOf("<",K),z===-1){if(T.length)return w("unexpected end of file");if(K===0)return w("missing start tag");K<b.length&&b.substring(K).trim()&&S(Qm);return}if(K!==z){if(T.length){if(n&&(n(b.substring(K,z),Ri,l),g))return}else if(b.substring(K,z).trim()&&(S(Qm),g))return}if(ye=b.charCodeAt(z+1),ye===33){if(ke=b.charCodeAt(z+2),ke===91&&b.substr(z+3,6)==="CDATA["){if(K=b.indexOf("]]>",z),K===-1)return w("unclosed cdata");if(o&&(o(b.substring(z+9,K),l),g))return;K+=3;continue}if(ke===45&&b.charCodeAt(z+3)===45){if(K=b.indexOf("-->",z),K===-1)return w("unclosed comment");if(c&&(c(b.substring(z+4,K),Ri,l),g))return;K+=3;continue}}if(ye===63){if(K=b.indexOf("?>",z),K===-1)return w("unclosed question");if(u&&(u(b.substring(z,K+2),l),g))return;K+=2;continue}for(ve=z+1;;ve++){if(he=b.charCodeAt(ve),isNaN(he))return K=-1,w("unclosed tag");if(he===34)ke=b.indexOf('"',ve+1),ve=ke!==-1?ke:ve;else if(he===39)ke=b.indexOf("'",ve+1),ve=ke!==-1?ke:ve;else if(he===62){K=ve;break}}if(ye===33){if(p&&(p(b.substring(z,K+1),Ri,l),g))return;K+=1;continue}if(xe={},ye===47){if(L=!1,W=!0,!T.length)return w("missing open tag");if(ve=Ie=T.pop(),ke=z+2+ve.length,b.substring(z+2,ke)!==ve)return w("closing tag mismatch");for(;ke<K;ke++)if(ye=b.charCodeAt(ke),!(ye===32||ye>8&&ye<14))return w("close tag")}else{if(b.charCodeAt(K-1)===47?(ve=Ie=b.substring(z+1,K-1),L=!0,W=!0):(ve=Ie=b.substring(z+1,K),L=!0,W=!1),!(ye>96&&ye<123||ye>64&&ye<91||ye===95||ye===58))return w("illegal first char nodeName");for(ke=1,Jt=ve.length;ke<Jt;ke++)if(ye=ve.charCodeAt(ke),!(ye>96&&ye<123||ye>64&&ye<91||ye>47&&ye<59||ye===45||ye===95||ye==46)){if(ye===32||ye<14&&ye>8){Ie=ve.substring(0,ke),xe=null;break}return w("invalid nodeName")}W||T.push(Ie)}if(d){if(O=A,L&&(W||R.push(O),xe===null&&(f=ve.indexOf("xmlns",ke)!==-1)&&(oe=ke,G=ve,Gt(),f=!1)),Ze=Ie,ye=Ie.indexOf(":"),ye!==-1){if(we=A[Ie.substring(0,ye)],!we)return w("missing namespace on <"+Ze+">");Ie=Ie.substr(ye+1)}else we=A.xmlns;we&&(Ie=we+":"+Ie)}if(L&&(oe=ke,G=ve,r&&(t?r(H,Ri,W,l):r(Ie,Gt,Ri,W,l),g)))return;if(W){if(i&&(i(t?H:Ie,Ri,L,l),g))return;d&&(L?A=O:A=R.pop())}K+=1}}}function th(e){return e.xml&&e.xml.tagAlias==="lowerCase"}var Gl={xsi:"http://www.w3.org/2001/XMLSchema-instance",xml:"http://www.w3.org/XML/1998/namespace"},nh="property";function rh(e){return e.xml&&e.xml.serialize}function Aw(e){let t=rh(e);return t!==nh&&(t||null)}function Tw(e){return e.charAt(0).toUpperCase()+e.slice(1)}function ih(e,t){return th(t)?e.prefix+":"+Tw(e.localName):e.name}function Mw(e,t){var n=e.name,r=e.localName,i=t&&t.xml&&t.xml.typePrefix;return i&&r.indexOf(i)===0?e.prefix+":"+r.slice(i.length):n}function Dw(e,t,n){let r=Tt(e,t.xmlns),i=`${t[r.prefix]||r.prefix}:${r.localName}`,o=Tt(i);var a=n.getPackage(o.prefix);return Mw(o,a)}function Yr(e){return new Error(e)}function xr(e){return e.$descriptor}function kw(e){C(this,e),this.elementsById={},this.references=[],this.warnings=[],this.addReference=function(t){this.references.push(t)},this.addElement=function(t){if(!t)throw Yr("expected element");var n=this.elementsById,r=xr(t),i=r.idProperty,o;if(i&&(o=t.get(i.name),o)){if(!/^([a-z][\w-.]*:)?[a-z_][\w-.]*$/i.test(o))throw new Error("illegal ID <"+o+">");if(n[o])throw Yr("duplicate ID <"+o+">");n[o]=t}},this.addWarning=function(t){this.warnings.push(t)}}function Ba(){}Ba.prototype.handleEnd=function(){};Ba.prototype.handleText=function(){};Ba.prototype.handleNode=function(){};function Vl(){}Vl.prototype=Object.create(Ba.prototype);Vl.prototype.handleNode=function(){return this};function vo(){}vo.prototype=Object.create(Ba.prototype);vo.prototype.handleText=function(e){this.body=(this.body||"")+e};function Ia(e,t){this.property=e,this.context=t}Ia.prototype=Object.create(vo.prototype);Ia.prototype.handleNode=function(e){if(this.element)throw Yr("expected no sub nodes");return this.element=this.createReference(e),this};Ia.prototype.handleEnd=function(){this.element.id=this.body};Ia.prototype.createReference=function(e){return{property:this.property.ns.name,id:""}};function Wl(e,t){this.element=t,this.propertyDesc=e}Wl.prototype=Object.create(vo.prototype);Wl.prototype.handleEnd=function(){var e=this.body||"",t=this.element,n=this.propertyDesc;e=Pc(n.type,e),n.isMany?t.get(n.name).push(e):t.set(n.name,e)};function Tc(){}Tc.prototype=Object.create(vo.prototype);Tc.prototype.handleNode=function(e){var t=this,n=this.element;return n?t=this.handleChild(e):(n=this.element=this.createElement(e),this.context.addElement(n)),t};function Ft(e,t,n){this.model=e,this.type=e.getType(t),this.context=n}Ft.prototype=Object.create(Tc.prototype);Ft.prototype.addReference=function(e){this.context.addReference(e)};Ft.prototype.handleText=function(e){var t=this.element,n=xr(t),r=n.bodyProperty;if(!r)throw Yr("unexpected body text <"+e+">");vo.prototype.handleText.call(this,e)};Ft.prototype.handleEnd=function(){var e=this.body,t=this.element,n=xr(t),r=n.bodyProperty;r&&e!==void 0&&(e=Pc(r.type,e),t.set(r.name,e))};Ft.prototype.createElement=function(e){var t=e.attributes,n=this.type,r=xr(n),i=this.context,o=new n({}),a=this.model,s;return E(t,function(c,u){var p=r.propertiesByName[u],l;p&&p.isReference?p.isMany?(l=c.split(" "),E(l,function(f){i.addReference({element:o,property:p.ns.name,id:f})})):i.addReference({element:o,property:p.ns.name,id:c}):(p?c=Pc(p.type,c):u==="xmlns"?u=":"+u:(s=Tt(u,r.ns.prefix),a.getPackage(s.prefix)&&i.addWarning({message:"unknown attribute <"+u+">",element:o,property:u,value:c})),o.set(u,c))}),o};Ft.prototype.getPropertyForNode=function(e){var t=e.name,n=Tt(t),r=this.type,i=this.model,o=xr(r),a=n.name,s=o.propertiesByName[a];if(s&&!s.isAttr){let u=Aw(s);if(u){let p=e.attributes[u];if(p){let l=Dw(p,e.ns,i),f=i.getType(l);return C({},s,{effectiveType:xr(f).name})}}return s}var c=i.getPackage(n.prefix);if(c){let u=ih(n,c),p=i.getType(u);if(s=re(o.properties,function(l){return!l.isVirtual&&!l.isReference&&!l.isAttribute&&p.hasType(l.type)}),s)return C({},s,{effectiveType:xr(p).name})}else if(s=re(o.properties,function(u){return!u.isReference&&!u.isAttribute&&u.type==="Element"}),s)return s;throw Yr("unrecognized element <"+n.name+">")};Ft.prototype.toString=function(){return"ElementDescriptor["+xr(this.type).name+"]"};Ft.prototype.valueHandler=function(e,t){return new Wl(e,t)};Ft.prototype.referenceHandler=function(e){return new Ia(e,this.context)};Ft.prototype.handler=function(e){return e==="Element"?new ho(this.model,e,this.context):new Ft(this.model,e,this.context)};Ft.prototype.handleChild=function(e){var t,n,r,i;if(t=this.getPropertyForNode(e),r=this.element,n=t.effectiveType||t.type,Hl(n))return this.valueHandler(t,r);t.isReference?i=this.referenceHandler(t).handleNode(e):i=this.handler(n).handleNode(e);var o=i.element;return o!==void 0&&(t.isMany?r.get(t.name).push(o):r.set(t.name,o),t.isReference?(C(o,{element:r}),this.context.addReference(o)):o.$parent=r),i};function Ul(e,t,n){Ft.call(this,e,t,n)}Ul.prototype=Object.create(Ft.prototype);Ul.prototype.createElement=function(e){var t=e.name,n=Tt(t),r=this.model,i=this.type,o=r.getPackage(n.prefix),a=o&&ih(n,o)||t;if(!i.hasType(a))throw Yr("unexpected element <"+e.originalName+">");return Ft.prototype.createElement.call(this,e)};function ho(e,t,n){this.model=e,this.context=n}ho.prototype=Object.create(Tc.prototype);ho.prototype.createElement=function(e){var t=e.name,n=Tt(t),r=n.prefix,i=e.ns[r+"$uri"],o=e.attributes;return this.model.createAny(t,i,o)};ho.prototype.handleChild=function(e){var t=new ho(this.model,"Element",this.context).handleNode(e),n=this.element,r=t.element,i;return r!==void 0&&(i=n.$children=n.$children||[],i.push(r),r.$parent=n),t};ho.prototype.handleEnd=function(){this.body&&(this.element.$body=this.body)};function Mc(e){e instanceof tn&&(e={model:e}),C(this,{lax:!1},e)}Mc.prototype.fromXML=function(e,t,n){var r=t.rootHandler;t instanceof Ft?(r=t,t={}):typeof t=="string"?(r=this.handler(t),t={}):typeof r=="string"&&(r=this.handler(r));var i=this.model,o=this.lax,a=new kw(C({},t,{rootHandler:r})),s=new zl({proxy:!0}),c=Nw();r.context=a,c.push(r);function u(R,A,O){var T=A(),I=T.line,L=T.column,W=T.data;W.charAt(0)==="<"&&W.indexOf(" ")!==-1&&(W=W.slice(0,W.indexOf(" "))+">");var z="unparsable content "+(W?W+" ":"")+`detected
|
| /plugin/diagramsnet/lib/js/ |
| D | extensions.min.js | 1705 …Vx=function(){return Wx(Fx().curve(Ux))},Hx=function(){var t=Px().curve(Ux),e=t.curve,n=t.lineX0,r…
|
| /plugin/ol3/ |
| D | script.js | 8 …Vx=Gc(cx,{when:function(t,e){var r=e[e.length-1].whens,n=Ec(t,!1),i=Date.parse(n);r.push(isNaN(i)?…
|
| /plugin/dirtylittlehelper/mermaid/editor/docs/ |
| D | bundle.js.map | 1 …Vx=[1,20,21,22,23,38,42,46,75,76,77,78,79,80,94,95,98,99,100,102,103,109,110,111,112,113,114],$Vy=…
|