7){e[t].shift();for(var i=e[t];i.length;)s[t]="A",e.splice(t++,0,["C",...i.splice(0,6)]);e.splice(t,1),p=n.length}},s=[],a="",l="",c=0,p=n.length;c=r.right,a=i.top-n.y>=r.bottom,l=o?"top":a?"bottom":null,c=i.right+n.x<=r.left?"left":s?"right":null;return c&&l?l+"-"+c:c||l||"intersect"}function kn(e,t,n){var i=function(e,t){return pn(e,t)}(e,t);return 1===i.length||2===i.length&&Dt(i[0],i[1])<1?xn(i[0]):i.length>1?(i=R(i,(function(e){var t=Math.floor(100*e.t2)||1;return t=((t=100-t)<10?"0":"")+t,e.segment2+"#"+t})),xn(i[n?0:i.length-1])):null}function Sn(e,t){return Math.round(e*t)/t}function Cn(e){return m(e)?e+"px":e}function Tn(e,t,n){const i=Le("g");Me(i).add(t);const r=void 0!==n?n:e.childNodes.length-1;return e.insertBefore(i,e.childNodes[r]||null),i}const An={shape:["x","y","width","height"],connection:["waypoints"]};function Mn(e,t,n,i){this._eventBus=t,this._elementRegistry=i,this._graphicsFactory=n,this._rootsIdx=0,this._layers={},this._planes=[],this._rootElement=null,this._init(e||{})}function Dn(e,t){const n="matrix("+t.a+","+t.b+","+t.c+","+t.d+","+t.e+","+t.f+")";e.setAttribute("transform",n)}Mn.$inject=["config.canvas","eventBus","graphicsFactory","elementRegistry"],Mn.prototype._init=function(e){const t=this._eventBus,n=this._container=function(e){const t=(e=z({},{width:"100%",height:"100%"},e)).container||document.body,n=document.createElement("div");return n.setAttribute("class","djs-container djs-parent"),Z(n,{position:"relative",overflow:"hidden",width:Cn(e.width),height:Cn(e.height)}),t.appendChild(n),n}(e),i=this._svg=Le("svg");Te(i,{width:"100%",height:"100%"}),ke(n,i);const r=this._viewport=Tn(i,"viewport");e.deferUpdate&&(this._viewboxChanged=B(q(this._viewboxChanged,this),300)),t.on("diagram.init",(()=>{t.fire("canvas.init",{svg:i,viewport:r})})),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)},Mn.prototype._destroy=function(){this._eventBus.fire("canvas.destroy",{svg:this._svg,viewport:this._viewport});const 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},Mn.prototype._clear=function(){this._elementRegistry.getAll().forEach((e=>{const t=Ot(e);"root"===t?this.removeRootElement(e):this._removeElement(e,t)})),this._planes=[],this._rootElement=null,delete this._cachedViewbox},Mn.prototype.getDefaultLayer=function(){return this.getLayer("base",0)},Mn.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)),void 0!==t&&n.index!==t)throw new Error("layer <"+e+"> already created at index <"+t+">");return n.group},Mn.prototype._getChildIndex=function(e){return O(this._layers,(function(t,n){return n.visible&&e>=n.index&&t++,t}),0)},Mn.prototype._createLayer=function(e,t){void 0===t&&(t=1);const n=this._getChildIndex(t);return{group:Tn(this._viewport,"layer-"+e,n),index:t,visible:!0}},Mn.prototype.showLayer=function(e){if(!e)throw new Error("must specify a name");const t=this._layers[e];if(!t)throw new Error("layer <"+e+"> does not exist");const n=this._viewport,i=t.group,r=t.index;if(t.visible)return i;const o=this._getChildIndex(r);return n.insertBefore(i,n.childNodes[o]||null),t.visible=!0,i},Mn.prototype.hideLayer=function(e){if(!e)throw new Error("must specify a name");const t=this._layers[e];if(!t)throw new Error("layer <"+e+"> does not exist");const n=t.group;return t.visible?(Ke(n),t.visible=!1,n):n},Mn.prototype._removeLayer=function(e){const t=this._layers[e];t&&(delete this._layers[e],Ke(t.group))},Mn.prototype.getActiveLayer=function(){const e=this._findPlaneForRoot(this.getRootElement());return e?e.layer:null},Mn.prototype.findRoot=function(e){if("string"==typeof e&&(e=this._elementRegistry.get(e)),!e)return;const t=this._findPlaneForRoot(function(e){for(;e.parent;)e=e.parent;return e}(e))||{};return t.rootElement},Mn.prototype.getRootElements=function(){return this._planes.map((function(e){return e.rootElement}))},Mn.prototype._findPlaneForRoot=function(e){return b(this._planes,(function(t){return t.rootElement===e}))},Mn.prototype.getContainer=function(){return this._container},Mn.prototype._updateMarker=function(e,t,n){let i;e.id||(e=this._elementRegistry.get(e)),i=this._elementRegistry._elements[e.id],i&&(_([i.gfx,i.secondaryGfx],(function(e){e&&(n?Me(e).add(t):Me(e).remove(t))})),this._eventBus.fire("element.marker.update",{element:e,gfx:i.gfx,marker:t,add:!!n}))},Mn.prototype.addMarker=function(e,t){this._updateMarker(e,t,!0)},Mn.prototype.removeMarker=function(e,t){this._updateMarker(e,t,!1)},Mn.prototype.hasMarker=function(e,t){e.id||(e=this._elementRegistry.get(e));return Me(this.getGraphics(e)).has(t)},Mn.prototype.toggleMarker=function(e,t){this.hasMarker(e,t)?this.removeMarker(e,t):this.addMarker(e,t)},Mn.prototype.getRootElement=function(){const e=this._rootElement;return e||this._planes.length?e:this.setRootElement(this.addRootElement(null))},Mn.prototype.addRootElement=function(e){const t=this._rootsIdx++;e||(e={id:"__implicitroot_"+t,children:[],isImplicit:!0});const n=e.layer="root-"+t;this._ensureValid("root",e);const i=this.getLayer(n,0);return this.hideLayer(n),this._addRoot(e,i),this._planes.push({rootElement:e,layer:i}),e},Mn.prototype.removeRootElement=function(e){"string"==typeof e&&(e=this._elementRegistry.get(e));if(this._findPlaneForRoot(e))return this._removeRoot(e),this._removeLayer(e.layer),this._planes=this._planes.filter((function(t){return t.rootElement!==e})),this._rootElement===e&&(this._rootElement=null),e},Mn.prototype.setRootElement=function(e){if(e===this._rootElement)return;let t;if(!e)throw new Error("rootElement required");return t=this._findPlaneForRoot(e),t||(e=this.addRootElement(e)),this._setRoot(e),e},Mn.prototype._removeRoot=function(e){const t=this._elementRegistry,n=this._eventBus;n.fire("root.remove",{element:e}),n.fire("root.removed",{element:e}),t.remove(e)},Mn.prototype._addRoot=function(e,t){const n=this._elementRegistry,i=this._eventBus;i.fire("root.add",{element:e}),n.add(e,t),i.fire("root.added",{element:e,gfx:t})},Mn.prototype._setRoot=function(e,t){const 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})},Mn.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");const n=An[e],i=P(n,(function(e){return void 0!==t[e]}));if(!i)throw new Error("must supply { "+n.join(", ")+" } with "+e)},Mn.prototype._setParent=function(e,t,n){At(t.children,e,n),e.parent=t},Mn.prototype._addElement=function(e,t,n,i){n=n||this.getRootElement();const r=this._eventBus,o=this._graphicsFactory;this._ensureValid(e,t),r.fire(e+".add",{element:t,parent:n}),this._setParent(t,n,i);const s=o.create(e,t,i);return this._elementRegistry.add(t,s),o.update(e,t,s),r.fire(e+".added",{element:t,gfx:s}),t},Mn.prototype.addShape=function(e,t,n){return this._addElement("shape",e,t,n)},Mn.prototype.addConnection=function(e,t,n){return this._addElement("connection",e,t,n)},Mn.prototype._removeElement=function(e,t){const n=this._elementRegistry,i=this._graphicsFactory,r=this._eventBus;if(e=n.get(e.id||e))return r.fire(t+".remove",{element:e}),i.remove(e),Tt(e.parent&&e.parent.children,e),e.parent=null,r.fire(t+".removed",{element:e}),n.remove(e),e},Mn.prototype.removeShape=function(e){return this._removeElement(e,"shape")},Mn.prototype.removeConnection=function(e){return this._removeElement(e,"connection")},Mn.prototype.getGraphics=function(e,t){return this._elementRegistry.getGraphics(e,t)},Mn.prototype._changeViewbox=function(e){this._eventBus.fire("canvas.viewbox.changing"),e.apply(this),this._cachedViewbox=null,this._viewboxChanged()},Mn.prototype._viewboxChanged=function(){this._eventBus.fire("canvas.viewbox.changed",{viewbox:this.viewbox()})},Mn.prototype.viewbox=function(e){if(void 0===e&&this._cachedViewbox)return this._cachedViewbox;const t=this._viewport,n=this.getSize();let i,r,o,s,a,l,c;return e?(this._changeViewbox((function(){a=Math.min(n.width/e.width,n.height/e.height);const i=this._svg.createSVGMatrix().scale(a).translate(-e.x,-e.y);Ze(t,i)})),e):(o=this._rootElement?this.getActiveLayer():null,i=o&&o.getBBox()||{},s=Ze(t),r=s?s.matrix:function(e,t,n,i,r,o){var s=qe().createSVGMatrix();switch(arguments.length){case 0:return s;case 1:return ze(s,e);case 6:return ze(s,{a:e,b:t,c:n,d:i,e:r,f:o})}}(),a=Sn(r.a,1e3),l=Sn(-r.e||0,1e3),c=Sn(-r.f||0,1e3),e=this._cachedViewbox={x:l?l/a:0,y:c?c/a:0,width:n.width/a,height:n.height/a,scale:a,inner:{width:i.width||0,height:i.height||0,x:i.x||0,y:i.y||0},outer:n})},Mn.prototype.scroll=function(e){const t=this._viewport;let n=t.getCTM();return e&&this._changeViewbox((function(){e=z({dx:0,dy:0},e||{}),n=this._svg.createSVGMatrix().translate(e.dx,e.dy).multiply(n),Dn(t,n)})),{x:n.e,y:n.f}},Mn.prototype.scrollToElement=function(e,t){let n=100;"string"==typeof e&&(e=this._elementRegistry.get(e));const i=this.findRoot(e);if(i!==this.getRootElement()&&this.setRootElement(i),i===e)return;t||(t={}),"number"==typeof t&&(n=t),t={top:t.top||n,right:t.right||n,bottom:t.bottom||n,left:t.left||n};const r=Et(e),o=wn(r),s=this.viewbox(),a=this.zoom();let l,c;s.y+=t.top/a,s.x+=t.left/a,s.width-=(t.right+t.left)/a,s.height-=(t.bottom+t.top)/a;const p=wn(s);if(r.width=0&&i.y>=0&&i.x+i.width<=n.width&&i.y+i.height<=n.height&&!e?o={x:0,y:0,width:Math.max(i.width+i.x,n.width),height:Math.max(i.height+i.y,n.height)}:(r=Math.min(1,n.width/i.width,n.height/i.height),o={x:i.x+(e?i.width/2-n.width/r/2:0),y:i.y+(e?i.height/2-n.height/r/2:0),width:n.width/r,height:n.height/r}),this.viewbox(o),this.viewbox(!1).scale},Mn.prototype._setZoom=function(e,t){const n=this._svg,i=this._viewport,r=n.createSVGMatrix(),o=n.createSVGPoint();let s,a,l,c,p;l=i.getCTM();const u=l.a;return t?(s=z(o,t),a=s.matrixTransform(l.inverse()),c=r.translate(a.x,a.y).scale(1/u*e).translate(-a.x,-a.y),p=l.multiply(c)):p=r.scale(e),Dn(this._viewport,p),p},Mn.prototype.getSize=function(){return{width:this._container.clientWidth,height:this._container.clientHeight}},Mn.prototype.getAbsoluteBBox=function(e){const t=this.viewbox();let n;if(e.waypoints){n=this.getGraphics(e).getBBox()}else n=e;return{x:n.x*t.scale-t.x*t.scale,y:n.y*t.scale-t.y*t.scale,width:n.width*t.scale,height:n.height*t.scale}},Mn.prototype.resized=function(){delete this._cachedViewbox,this._eventBus.fire("canvas.resized")};var Rn="data-element-id";function Nn(e){this._elements={},this._eventBus=e}function $n(e,t,n,i){var r=n.inverse;return Object.defineProperty(e,"remove",{value:function(e){var n=this.indexOf(e);return-1!==n&&(this.splice(n,1),t.unset(e,r,i)),e}}),Object.defineProperty(e,"contains",{value:function(e){return-1!==this.indexOf(e)}}),Object.defineProperty(e,"add",{value:function(e,n){var o=this.indexOf(e);if(void 0===n){if(-1!==o)return;n=this.length}-1!==o&&this.splice(o,1),this.splice(n,0,e),-1===o&&t.set(e,r,i)}}),Object.defineProperty(e,"__refs_collection",{value:!0}),e}function jn(e){return!0===e.__refs_collection}Nn.$inject=["eventBus"],Nn.prototype.add=function(e,t,n){var i=e.id;this._validateId(i),Te(t,Rn,i),n&&Te(n,Rn,i),this._elements[i]={element:e,gfx:t,secondaryGfx:n}},Nn.prototype.remove=function(e){var t=this._elements,n=e.id||e,i=n&&t[n];i&&(Te(i.gfx,Rn,""),i.secondaryGfx&&Te(i.secondaryGfx,Rn,""),delete t[n])},Nn.prototype.updateId=function(e,t){this._validateId(t),"string"==typeof e&&(e=this.get(e)),this._eventBus.fire("element.updateId",{element:e,newId:t});var n=this.getGraphics(e),i=this.getGraphics(e,!0);this.remove(e),e.id=t,this.add(e,n,i)},Nn.prototype.updateGraphics=function(e,t,n){var i=e.id||e,r=this._elements[i];return n?r.secondaryGfx=t:r.gfx=t,t&&Te(t,Rn,i),t},Nn.prototype.get=function(e){var t;t="string"==typeof e?e:e&&Te(e,Rn);var n=this._elements[t];return n&&n.element},Nn.prototype.filter=function(e){var t=[];return this.forEach((function(n,i){e(n,i)&&t.push(n)})),t},Nn.prototype.find=function(e){for(var t=this._elements,n=Object.keys(t),i=0;i in ref");t=this.props[t]}t.collection?In(this,t,e):function(e,t,n){var i=t.inverse,r=n[t.name];Object.defineProperty(n,t.name,{configurable:t.configurable,enumerable:t.enumerable,get:function(){return r},set:function(t){if(t!==r){var o=r;r=null,o&&e.unset(o,i,n),r=t,e.set(r,i,n)}}})}(this,t,e)},Ln.prototype.ensureRefsCollection=function(e,t){var n=e[t.name];return jn(n)||In(this,t,e),n},Ln.prototype.ensureBound=function(e,t){(function(e,t){return Object.prototype.hasOwnProperty.call(e,t.name||t)})(e,t)||this.bind(e,t)},Ln.prototype.unset=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).remove(n):e[t.name]=void 0)},Ln.prototype.set=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).add(n):e[t.name]=n)};var Bn=new Ln({name:"children",enumerable:!0,collection:!0},{name:"parent"}),qn=new Ln({name:"labels",enumerable:!0,collection:!0},{name:"labelTarget"}),zn=new Ln({name:"attachers",collection:!0},{name:"host"}),Fn=new Ln({name:"outgoing",collection:!0},{name:"source"}),Vn=new Ln({name:"incoming",collection:!0},{name:"target"});function Hn(){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)}}),Bn.bind(this,"parent"),qn.bind(this,"labels"),Fn.bind(this,"outgoing"),Vn.bind(this,"incoming")}function Un(){Hn.call(this),Bn.bind(this,"children"),zn.bind(this,"host"),zn.bind(this,"attachers")}function Wn(){Hn.call(this),Bn.bind(this,"children")}function Gn(){Un.call(this),qn.bind(this,"labelTarget")}function Qn(){Hn.call(this),Fn.bind(this,"source"),Vn.bind(this,"target")}i(Un,Hn),i(Wn,Un),i(Gn,Un),i(Qn,Hn);var Xn={connection:Qn,shape:Un,label:Gn,root:Wn};function Kn(){this._uid=12}Kn.prototype.createRoot=function(e){return this.create("root",e)},Kn.prototype.createLabel=function(e){return this.create("label",e)},Kn.prototype.createShape=function(e){return this.create("shape",e)},Kn.prototype.createConnection=function(e){return this.create("connection",e)},Kn.prototype.create=function(e,t){return(t=z({},t||{})).id||(t.id=e+"_"+this._uid++),function(e,t){var n=Xn[e];if(!n)throw new Error("unknown type: <"+e+">");return z(new n,t)}(e,t)};var Yn="__fn",Zn=Array.prototype.slice;function Jn(){this._listeners={},this.on("diagram.destroy",1,this._destroy,this)}function ei(){}function ti(e){return e.childNodes[0]}function ni(e,t,n,i,r){var o=Fe();o.setTranslate(t,n);var s=Fe();s.setRotate(i||0,0,0);var a=Fe();a.setScale(r||1,r||1),Ze(e,[o,s,a])}function ii(e,t,n){var i=Fe();i.setTranslate(t,n),Ze(e,i)}function ri(e,t){var n=Fe();n.setRotate(t,0,0),Ze(e,n)}function oi(e,t){this._eventBus=e,this._elementRegistry=t}function si(e,t,n){var i=n||t.firstChild;e!==i&&t.insertBefore(e,i)}Jn.prototype.on=function(e,t,n,i){if(e=h(e)?e:[e],g(t)&&(i=n,n=t,t=1e3),!m(t))throw new Error("priority must be a number");var r=n;i&&((r=q(n,i))[Yn]=n[Yn]||n);var o=this;e.forEach((function(e){o._addListener(e,{priority:t,callback:r,next:null})}))},Jn.prototype.once=function(e,t,n,i){var r=this;if(g(t)&&(i=n,n=t,t=1e3),!m(t))throw new Error("priority must be a number");function o(){o.__isTomb=!0;var t=n.apply(i,arguments);return r.off(e,o),t}o[Yn]=n,this.on(e,t,o)},Jn.prototype.off=function(e,t){e=h(e)?e:[e];var n=this;e.forEach((function(e){n._removeListener(e,t)}))},Jn.prototype.createEvent=function(e){var t=new ei;return t.init(e),t},Jn.prototype.fire=function(e,t){var n,i,r,o;if(o=Zn.call(arguments),"object"==typeof e&&(e=(t=e).type),!e)throw new Error("no event type specified");if(i=this._listeners[e]){n=t instanceof ei?t:this.createEvent(t),o[0]=n;var s=n.type;e!==s&&(n.type=e);try{r=this._invokeListeners(n,o,i)}finally{e!==s&&(n.type=s)}return void 0===r&&n.defaultPrevented&&(r=!1),r}},Jn.prototype.handleError=function(e){return!1===this.fire("error",{error:e})},Jn.prototype._destroy=function(){this._listeners={}},Jn.prototype._invokeListeners=function(e,t,n){for(var i;n&&!e.cancelBubble;)i=this._invokeListener(e,t,n),n=n.next;return i},Jn.prototype._invokeListener=function(e,t,n){var i;if(n.callback.__isTomb)return i;try{i=function(e,t){return e.apply(null,t)}(n.callback,t),void 0!==i&&(e.returnValue=i,e.stopPropagation()),!1===i&&e.preventDefault()}catch(e){if(!this.handleError(e))throw console.error("unhandled error in event listener",e),e}return i},Jn.prototype._addListener=function(e,t){var n,i=this._getListeners(e);if(i){for(;i;){if(i.priority or , got "+e);n=r[1],i=r[0]}return{name:e=(i?i+":":"")+n,prefix:i,localName:n}}function vi(e){this.ns=e,this.name=e.name,this.allTypes=[],this.allTypesByName={},this.properties=[],this.propertiesByName={}}function bi(e,t){this.packageMap={},this.typeMap={},this.packages=[],this.properties=t,_(e,q(this.registerPackage,this))}function xi(e,t,n){var i=t[n];if(i in e)throw new Error("package with "+n+" <"+i+"> already defined")}function wi(e){this.model=e}function _i(e,t,n){Object.defineProperty(e,t.name,{enumerable:!t.isReference,writable:!0,value:n,configurable:!0})}function Ei(e){return e.replace(/^:/,"")}function Oi(e,t={}){this.properties=new wi(this),this.factory=new ui(this,this.properties),this.registry=new bi(e,this.properties),this.typeCache={},this.config=t}vi.prototype.build=function(){return V(this,["ns","name","allTypes","allTypesByName","properties","propertiesByName","bodyProperty","idProperty"])},vi.prototype.addProperty=function(e,t,n){"boolean"==typeof t&&(n=t,t=void 0),this.addNamedProperty(e,!1!==n);var i=this.properties;void 0!==t?i.splice(t,0,e):i.push(e)},vi.prototype.replaceProperty=function(e,t,n){var i=e.ns,r=this.properties,o=this.propertiesByName,s=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 a=r.indexOf(e);if(-1===a)throw new Error("property <"+i.name+"> not found in property list");r.splice(a,1),this.addProperty(t,n?void 0:a,s),o[i.name]=o[i.localName]=t},vi.prototype.redefineProperty=function(e,t,n){var i=e.ns.prefix,r=t.split("#"),o=yi(r[0],i),s=yi(r[1],o.prefix).name,a=this.propertiesByName[s];if(!a)throw new Error("refined property <"+s+"> not found");this.replaceProperty(a,e,n),delete e.redefines},vi.prototype.addNamedProperty=function(e,t){var n=e.ns,i=this.propertiesByName;t&&(this.assertNotDefined(e,n.name),this.assertNotDefined(e,n.localName)),i[n.name]=i[n.localName]=e},vi.prototype.removeNamedProperty=function(e){var t=e.ns,n=this.propertiesByName;delete n[t.name],delete n[t.localName]},vi.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},vi.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},vi.prototype.assertNotTrait=function(e){if((e.extends||[]).length)throw new Error(`cannot create <${e.name}> extending <${e.extends}>`)},vi.prototype.assertNotDefined=function(e,t){var n=e.name,i=this.propertiesByName[n];if(i)throw new Error("property <"+n+"> already defined; override of <"+i.definedBy.ns.name+"#"+i.ns.name+"> by <"+e.definedBy.ns.name+"#"+e.ns.name+"> not allowed without redefines")},vi.prototype.hasProperty=function(e){return this.propertiesByName[e]},vi.prototype.addTrait=function(e,t){t&&this.assertNotTrait(e);var n=this.allTypesByName,i=this.allTypes,r=e.name;r in n||(_(e.properties,q((function(n){n=z({},n,{name:n.ns.localName,inherited:t}),Object.defineProperty(n,"definedBy",{value:e});var i=n.replaces,r=n.redefines;i||r?this.redefineProperty(n,i||r,i):(n.isBody&&this.setBodyProperty(n),n.isId&&this.setIdProperty(n),this.addProperty(n))}),this)),i.push(e),n[r]=e)},bi.prototype.getPackage=function(e){return this.packageMap[e]},bi.prototype.getPackages=function(){return this.packages},bi.prototype.registerPackage=function(e){e=z({},e);var t=this.packageMap;xi(t,e,"prefix"),xi(t,e,"uri"),_(e.types,q((function(t){this.registerType(t,e)}),this)),t[e.uri]=t[e.prefix]=e,this.packages.push(e)},bi.prototype.registerType=function(e,t){var n=yi((e=z({},e,{superClass:(e.superClass||[]).slice(),extends:(e.extends||[]).slice(),properties:(e.properties||[]).slice(),meta:z(e.meta||{})})).name,t.prefix),i=n.name,r={};_(e.properties,q((function(e){var t=yi(e.name,n.prefix),i=t.name;mi(e.type)||(e.type=yi(e.type,t.prefix).name),z(e,{ns:t,name:i}),r[i]=e}),this)),z(e,{ns:n,name:i,propertiesByName:r}),_(e.extends,q((function(e){var t=yi(e,n.prefix),r=this.typeMap[t.name];r.traits=r.traits||[],r.traits.push(i)}),this)),this.definePackage(e,t),this.typeMap[i]=e},bi.prototype.mapTypes=function(e,t,n){var i=mi(e.name)?{name:e.name}:this.typeMap[e.name],r=this;function o(n,i){var o=yi(n,mi(n)?"":e.prefix);r.mapTypes(o,t,i)}function s(e){return o(e,!0)}if(!i)throw new Error("unknown type <"+e.name+">");_(i.superClass,n?s:function(e){return o(e,!1)}),t(i,!n),_(i.traits,s)},bi.prototype.getEffectiveDescriptor=function(e){var t=yi(e),n=new vi(t);this.mapTypes(t,(function(e,t){n.addTrait(e,t)}));var i=n.build();return this.definePackage(i,i.allTypes[i.allTypes.length-1].$pkg),i},bi.prototype.definePackage=function(e,t){this.properties.define(e,"$pkg",{value:t})},wi.prototype.set=function(e,t,n){if(!y(t)||!t.length)throw new TypeError("property name must be a non-empty string");var i=this.getProperty(e,t),r=i&&i.name;void 0===n?i?delete e[r]:delete e.$attrs[Ei(t)]:i?r in e?e[r]=n:_i(e,i,n):e.$attrs[Ei(t)]=n},wi.prototype.get=function(e,t){var n=this.getProperty(e,t);if(!n)return e.$attrs[Ei(t)];var i=n.name;return!e[i]&&n.isMany&&_i(e,n,[]),e[i]},wi.prototype.define=function(e,t,n){if(!n.writable){var i=n.value;delete(n=z({},n,{get:function(){return i}})).value}Object.defineProperty(e,t,n)},wi.prototype.defineDescriptor=function(e,t){this.define(e,"$descriptor",{value:t})},wi.prototype.defineModel=function(e,t){this.define(e,"$model",{value:t})},wi.prototype.getProperty=function(e,t){var n=this.model,i=n.getPropertyDescriptor(e,t);if(i)return i;if(t.includes(":"))return null;const r=n.config.strict;if(void 0!==r){const n=new TypeError(`unknown property <${t}> on <${e.$type}>`);if(r)throw n;"undefined"!=typeof console&&console.warn(n)}return null},Oi.prototype.create=function(e,t){var n=this.getType(e);if(!n)throw new Error("unknown type <"+e+">");return new n(t)},Oi.prototype.getType=function(e){var t=this.typeCache,n=y(e)?e:e.ns.name,i=t[n];return i||(e=this.registry.getEffectiveDescriptor(n),i=t[n]=this.factory.createType(e)),i},Oi.prototype.createAny=function(e,t,n){var i=yi(e),r={$type:e,$instanceOf:function(e){return e===this.$type},get:function(e){return this[e]},set:function(e,t){F(this,[e],t)}},o={name:e,isGeneric:!0,ns:{prefix:i.prefix,localName:i.localName,uri:t}};return this.properties.defineDescriptor(r,o),this.properties.defineModel(r,this),this.properties.define(r,"get",{enumerable:!1,writable:!0}),this.properties.define(r,"set",{enumerable:!1,writable:!0}),this.properties.define(r,"$parent",{enumerable:!1,writable:!0}),this.properties.define(r,"$instanceOf",{enumerable:!1,writable:!0}),_(n,(function(e,t){f(e)&&void 0!==e.value?r[e.name]=e.value:r[t]=e})),r},Oi.prototype.getPackage=function(e){return this.registry.getPackage(e)},Oi.prototype.getPackages=function(){return this.registry.getPackages()},Oi.prototype.getElementDescriptor=function(e){return e.$descriptor},Oi.prototype.hasType=function(e,t){return void 0===t&&(t=e,e=this),t in e.$model.getElementDescriptor(e).allTypesByName},Oi.prototype.getPropertyDescriptor=function(e,t){return this.getElementDescriptor(e).propertiesByName[t]},Oi.prototype.getTypeDescriptor=function(e){return this.registry.typeMap[e]};var Pi=String.fromCharCode,ki=Object.prototype.hasOwnProperty,Si=/(\d+);|([0-9a-f]+);|&(\w+);/gi,Ci={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'};function Ti(e,t,n,i){return i?ki.call(Ci,i)?Ci[i]:"&"+i+";":Pi(t||parseInt(n,16))}function Ai(e){return e.length>3&&-1!==e.indexOf("&")?e.replace(Si,Ti):e}Object.keys(Ci).forEach((function(e){Ci[e.toUpperCase()]=Ci[e]}));var Mi="xsi:type",Di="non-whitespace outside of root node";function Ri(e){return new Error(e)}function Ni(e){return"missing namespace for prefix <"+e+">"}function $i(e){return{get:e,enumerable:!0}}function ji(e){var t,n={};for(t in e)n[t]=e[t];return n}function Ii(e){return e+"$uri"}function Li(){return{line:0,column:0}}function Bi(e){throw e}function qi(e){if(!this)return new qi(e);var t,n,i,r,o,s,a,l,c,p=e&&e.proxy,u=Bi,d=Li,h=!1,f=!1,m=null,g=!1;function y(e){e instanceof Error||(e=Ri(e)),m=e,u(e,d)}function v(e){o&&(e instanceof Error||(e=Ri(e)),o(e,d))}this.on=function(e,c){if("function"!=typeof c)throw Ri("required args ");switch(e){case"openTag":n=c;break;case"text":t=c;break;case"closeTag":i=c;break;case"error":u=c;break;case"warn":o=c;break;case"cdata":r=c;break;case"attention":l=c;break;case"question":a=c;break;case"comment":s=c;break;default:throw Ri("unsupported event: "+e)}return this},this.ns=function(e){if(void 0===e&&(e={}),"object"!=typeof e)throw Ri("required args ");var t,n={};for(t in e)n[t]=e[t];return n["http://www.w3.org/2001/XMLSchema-instance"]="xsi",f=!0,c=n,this},this.parse=function(e){if("string"!=typeof e)throw Ri("required args ");return m=null,function(e){var o,u,m,b,x,w,_,E,O,P,k,S=f?[]:null,C=f?function(e){var t,n,i={};for(t in e)i[n=e[t]]=n,i[Ii(n)]=t;return i}(c):null,T=[],A=0,M=!1,D=!1,R=0,N=0,$="",j=0;function I(){if(null!==k)return k;var e,t,n,i,r,o,s,a,l,p,u,d=f&&C.xmlns,m=f&&h?[]:null,g=j,y=$,b=y.length,x={},w={};e:for(;g8)){for((p<65||p>122||p>90&&p<97)&&95!==p&&58!==p&&(v("illegal first char attribute name"),l=!0),u=g+1;u96&&p<123||p>64&&p<91||p>47&&p<59||46===p||45===p||95===p)){if(32===p||p<14&&p>8){v("missing attribute value"),g=u;continue e}if(61===p)break;v("illegal attribute name char"),l=!0}if("xmlns:xmlns"===(a=y.substring(g,u))&&(v("illegal declaration of xmlns"),l=!0),34===(p=y.charCodeAt(u+1)))-1===(u=y.indexOf('"',g=u+2))&&-1!==(u=y.indexOf("'",g))&&(v("attribute value quote missmatch"),l=!0);else if(39===p)-1===(u=y.indexOf("'",g=u+2))&&-1!==(u=y.indexOf('"',g))&&(v("attribute value quote missmatch"),l=!0);else for(v("missing attribute value quotes"),l=!0,u+=1;u8);u++);for(-1===u&&(v("missing closing quotes"),u=b,l=!0),l||(o=y.substring(g,u)),g=u;u+18);u++)g===u&&(v("illegal character after attribute end"),l=!0);if(g=u+1,!l)if(a in w)v("attribute <"+a+"> already defined");else if(w[a]=!0,f)if(h){if(null!==(r="xmlns"===a?"xmlns":120===a.charCodeAt(0)&&"xmlns:"===a.substr(0,6)?a.substr(6):null)){if(e=Ai(o),t=Ii(r),!(s=c[e])){if("xmlns"===r||t in C&&C[t]!==e)do{s="ns"+A++}while(void 0!==C[s]);else s=r;c[e]=s}C[r]!==s&&(i||(C=ji(C),i=!0),C[r]=s,"xmlns"===r&&(C[Ii(s)]=e,d=s),C[t]=e),x[a]=o;continue}m.push(a,o)}else-1!==(p=a.indexOf(":"))?(n=C[a.substring(0,p)])?((a=d===n?a.substr(p+1):n+a.substr(p))===Mi&&(-1!==(p=o.indexOf(":"))?(n=o.substring(0,p),o=(n=C[n]||n)+o.substring(p)):o=d+":"+o),x[a]=o):v(Ni(a.substring(0,p))):x[a]=o;else x[a]=o}if(h)for(g=0,b=m.length;g=s&&(t=i.exec(e))&&!((a=t[0].length+t.index)>R);)r+=1,s=a;return-1==R?(o=a,n=e.substring(N)):0===N?n=e.substring(N,R):(o=R-s,n=-1==N?e.substring(R):e.substring(R,N+1)),{data:n,line:r,column:o}}d=L,p&&(P=Object.create({},{name:$i((function(){return E})),originalName:$i((function(){return O})),attrs:$i(I),ns:$i((function(){return C}))}));for(;-1!==N;){if(-1===(R=60===e.charCodeAt(N)?N:e.indexOf("<",N)))return T.length?y("unexpected end of file"):0===N?y("missing start tag"):void(N",R)))return y("unclosed cdata");if(r&&(r(e.substring(R+9,N),d),g))return;N+=3;continue}if(45===b&&45===e.charCodeAt(R+3)){if(-1===(N=e.indexOf("--\x3e",R)))return y("unclosed comment");if(s&&(s(e.substring(R+4,N),Ai,d),g))return;N+=3;continue}}if(63!==x){for(u=R+1;;u++){if(w=e.charCodeAt(u),isNaN(w))return N=-1,y("unclosed tag");if(34===w)u=-1!==(b=e.indexOf('"',u+1))?b:u;else if(39===w)u=-1!==(b=e.indexOf("'",u+1))?b:u;else if(62===w){N=u;break}}if(33!==x){if(k={},47===x){if(M=!1,D=!0,!T.length)return y("missing open tag");if(u=E=T.pop(),b=R+2+u.length,e.substring(R+2,b)!==u)return y("closing tag mismatch");for(;b8&&x<14))return y("close tag")}else{if(47===e.charCodeAt(N-1)?(u=E=e.substring(R+1,N-1),M=!0,D=!0):(u=E=e.substring(R+1,N),M=!0,D=!1),!(x>96&&x<123||x>64&&x<91||95===x||58===x))return y("illegal first char nodeName");for(b=1,m=u.length;b96&&x<123||x>64&&x<91||x>47&&x<59||45===x||95===x||46==x)){if(32===x||x<14&&x>8){E=u.substring(0,b),k=null;break}return y("invalid nodeName")}D||T.push(E)}if(f){if(o=C,M&&(D||S.push(o),null===k&&(h=-1!==u.indexOf("xmlns",b))&&(j=b,$=u,I(),h=!1)),O=E,-1!==(x=E.indexOf(":"))){if(!(_=C[E.substring(0,x)]))return y("missing namespace on <"+O+">");E=E.substr(x+1)}else _=C.xmlns;_&&(E=_+":"+E)}if(M&&(j=b,$=u,n&&(p?n(P,Ai,D,d):n(E,I,Ai,D,d),g)))return;if(D){if(i&&(i(p?P:E,Ai,M,d),g))return;f&&(C=M?o:S.pop())}N+=1}else{if(l&&(l(e.substring(R,N+1),Ai,d),g))return;N+=1}}else{if(-1===(N=e.indexOf("?>",R)))return y("unclosed question");if(a&&(a(e.substring(R,N+2),d),g))return;N+=2}}}(e),d=Li,g=!1,m},this.stop=function(){g=!0}}function zi(e){return e.xml&&"lowerCase"===e.xml.tagAlias}var Fi={xsi:"http://www.w3.org/2001/XMLSchema-instance",xml:"http://www.w3.org/XML/1998/namespace"},Vi="xsi:type";function Hi(e){return e.xml&&e.xml.serialize}function Ui(e){return Hi(e)===Vi}function Wi(e,t){return zi(t)?e.prefix+":"+((n=e.localName).charAt(0).toUpperCase()+n.slice(1)):e.name;var n}function Gi(e){return new Error(e)}function Qi(e){return e.$descriptor}function Xi(e){z(this,e),this.elementsById={},this.references=[],this.warnings=[],this.addReference=function(e){this.references.push(e)},this.addElement=function(e){if(!e)throw Gi("expected element");var t,n=this.elementsById,i=Qi(e).idProperty;if(i&&(t=e.get(i.name))){if(!/^([a-z][\w-.]*:)?[a-z_][\w-.]*$/i.test(t))throw new Error("illegal ID <"+t+">");if(n[t])throw Gi("duplicate ID <"+t+">");n[t]=e}},this.addWarning=function(e){this.warnings.push(e)}}function Ki(){}function Yi(){}function Zi(){}function Ji(e,t){this.property=e,this.context=t}function er(e,t){this.element=t,this.propertyDesc=e}function tr(){}function nr(e,t,n){this.model=e,this.type=e.getType(t),this.context=n}function ir(e,t,n){nr.call(this,e,t,n)}function rr(e,t,n){this.model=e,this.context=n}function or(e){e instanceof Oi&&(e={model:e}),z(this,{lax:!1},e)}Ki.prototype.handleEnd=function(){},Ki.prototype.handleText=function(){},Ki.prototype.handleNode=function(){},Yi.prototype=Object.create(Ki.prototype),Yi.prototype.handleNode=function(){return this},Zi.prototype=Object.create(Ki.prototype),Zi.prototype.handleText=function(e){this.body=(this.body||"")+e},Ji.prototype=Object.create(Zi.prototype),Ji.prototype.handleNode=function(e){if(this.element)throw Gi("expected no sub nodes");return this.element=this.createReference(e),this},Ji.prototype.handleEnd=function(){this.element.id=this.body},Ji.prototype.createReference=function(e){return{property:this.property.ns.name,id:""}},er.prototype=Object.create(Zi.prototype),er.prototype.handleEnd=function(){var e=this.body||"",t=this.element,n=this.propertyDesc;e=fi(n.type,e),n.isMany?t.get(n.name).push(e):t.set(n.name,e)},tr.prototype=Object.create(Zi.prototype),tr.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},nr.prototype=Object.create(tr.prototype),nr.prototype.addReference=function(e){this.context.addReference(e)},nr.prototype.handleText=function(e){if(!Qi(this.element).bodyProperty)throw Gi("unexpected body text <"+e+">");Zi.prototype.handleText.call(this,e)},nr.prototype.handleEnd=function(){var e=this.body,t=this.element,n=Qi(t).bodyProperty;n&&void 0!==e&&(e=fi(n.type,e),t.set(n.name,e))},nr.prototype.createElement=function(e){var t,n=e.attributes,i=this.type,r=Qi(i),o=this.context,s=new i({}),a=this.model;return _(n,(function(e,n){var i=r.propertiesByName[n];i&&i.isReference?i.isMany?_(e.split(" "),(function(e){o.addReference({element:s,property:i.ns.name,id:e})})):o.addReference({element:s,property:i.ns.name,id:e}):(i?e=fi(i.type,e):"xmlns"!==n&&(t=yi(n,r.ns.prefix),a.getPackage(t.prefix)&&o.addWarning({message:"unknown attribute <"+n+">",element:s,property:n,value:e})),s.set(n,e))})),s},nr.prototype.getPropertyForNode=function(e){var t,n,i=yi(e.name),r=this.type,o=this.model,s=Qi(r),a=i.name,l=s.propertiesByName[a];if(l&&!l.isAttr)return Ui(l)&&(t=e.attributes[Vi])?(t=function(e,t){var n=yi(e);return function(e,t){var n=e.name,i=e.localName,r=t.xml&&t.xml.typePrefix;return r&&0===i.indexOf(r)?e.prefix+":"+i.slice(r.length):n}(n,t.getPackage(n.prefix))}(t,o),z({},l,{effectiveType:Qi(n=o.getType(t)).name})):l;var c=o.getPackage(i.prefix);if(c){if(t=Wi(i,c),n=o.getType(t),l=b(s.properties,(function(e){return!e.isVirtual&&!e.isReference&&!e.isAttribute&&n.hasType(e.type)})),l)return z({},l,{effectiveType:Qi(n).name})}else if(l=b(s.properties,(function(e){return!e.isReference&&!e.isAttribute&&"Element"===e.type})),l)return l;throw Gi("unrecognized element <"+i.name+">")},nr.prototype.toString=function(){return"ElementDescriptor["+Qi(this.type).name+"]"},nr.prototype.valueHandler=function(e,t){return new er(e,t)},nr.prototype.referenceHandler=function(e){return new Ji(e,this.context)},nr.prototype.handler=function(e){return"Element"===e?new rr(this.model,e,this.context):new nr(this.model,e,this.context)},nr.prototype.handleChild=function(e){var t,n,i,r;if(t=this.getPropertyForNode(e),i=this.element,gi(n=t.effectiveType||t.type))return this.valueHandler(t,i);var o=(r=t.isReference?this.referenceHandler(t).handleNode(e):this.handler(n).handleNode(e)).element;return void 0!==o&&(t.isMany?i.get(t.name).push(o):i.set(t.name,o),t.isReference?(z(o,{element:i}),this.context.addReference(o)):o.$parent=i),r},ir.prototype=Object.create(nr.prototype),ir.prototype.createElement=function(e){var t=e.name,n=yi(t),i=this.model,r=this.type,o=i.getPackage(n.prefix),s=o&&Wi(n,o)||t;if(!r.hasType(s))throw Gi("unexpected element <"+e.originalName+">");return nr.prototype.createElement.call(this,e)},rr.prototype=Object.create(tr.prototype),rr.prototype.createElement=function(e){var t=e.name,n=yi(t).prefix,i=e.ns[n+"$uri"],r=e.attributes;return this.model.createAny(t,i,r)},rr.prototype.handleChild=function(e){var t=new rr(this.model,"Element",this.context).handleNode(e),n=this.element,i=t.element;return void 0!==i&&((n.$children=n.$children||[]).push(i),i.$parent=n),t},rr.prototype.handleEnd=function(){this.body&&(this.element.$body=this.body)},or.prototype.fromXML=function(e,t,n){var i=t.rootHandler;t instanceof nr?(i=t,t={}):"string"==typeof t?(i=this.handler(t),t={}):"string"==typeof i&&(i=this.handler(i));var r=this.model,o=this.lax,s=new Xi(z({},t,{rootHandler:i})),a=new qi({proxy:!0}),l=function(){var e=[];return Object.defineProperty(e,"peek",{value:function(){return this[this.length-1]}}),e}();function c(e,t,n){var i=t(),r=i.line,o=i.column,a=i.data;"<"===a.charAt(0)&&-1!==a.indexOf(" ")&&(a=a.slice(0,a.indexOf(" "))+">");var l="unparsable content "+(a?a+" ":"")+"detected\n\tline: "+r+"\n\tcolumn: "+o+"\n\tnested error: "+e.message;if(n)return s.addWarning({message:l,error:e}),!0;throw Gi(l)}function p(e,t){return c(e,t,!0)}i.context=s,l.push(i);var u=/^<\?xml /i,d=/ encoding="([^"]+)"/i,h=/^utf-8$/i;function f(e,t){try{l.peek().handleText(e)}catch(e){p(e,t)}}var m=r.getPackages().reduce((function(e,t){return e[t.uri]=t.prefix,e}),{"http://www.w3.org/XML/1998/namespace":"xml"});return a.ns(m).on("openTag",(function(e,t,n,i){var r=e.attrs||{},s=Object.keys(r).reduce((function(e,n){var i=t(r[n]);return e[n]=i,e}),{});!function(e,t){var n=l.peek();try{l.push(n.handleNode(e))}catch(e){c(e,t,o)&&l.push(new Yi)}}({name:e.name,originalName:e.originalName,attributes:s,ns:e.ns},i)})).on("question",(function(e){if(u.test(e)){var t=d.exec(e),n=t&&t[1];n&&!h.test(n)&&s.addWarning({message:"unsupported document encoding <"+n+">, falling back to UTF-8"})}})).on("closeTag",(function(){l.pop().handleEnd()})).on("cdata",f).on("text",(function(e,t,n){!function(e,t){e.trim()&&f(e,t)}(t(e),n)})).on("error",c).on("warn",p),new Promise((function(t,n){var r;try{a.parse(e),function(){var e,t,n=s.elementsById,i=s.references;for(e=0;t=i[e];e++){var r=t.element,o=n[t.id],a=Qi(r).propertiesByName[t.property];if(o||s.addWarning({message:"unresolved reference <"+t.id+">",element:t.element,property:t.property,value:t.id}),a.isMany){var l=r.get(a.name),c=l.indexOf(t);-1===c&&(c=l.length),o?l[c]=o:l.splice(c,1)}else r.set(a.name,o)}}()}catch(e){r=e}var o=i.element;r||o||(r=Gi("failed to parse document as <"+i.type.$descriptor.name+">"));var l=s.warnings,c=s.references,p=s.elementsById;return r?(r.warnings=l,n(r)):t({rootElement:o,elementsById:p,references:c,warnings:l})}))},or.prototype.handler=function(e){return new ir(this.model,e)};var sr=/<|>|'|"|&|\n\r|\n/g,ar=/<|>|&/g;function lr(e){var t={},n={},i={},r=[],o=[];this.byUri=function(t){return n[t]||e&&e.byUri(t)},this.add=function(e,t){n[e.uri]=e,t?r.push(e):o.push(e),this.mapPrefix(e.prefix,e.uri)},this.uriByPrefix=function(e){return t[e||"xmlns"]},this.mapPrefix=function(e,n){t[e||"xmlns"]=n},this.getNSKey=function(e){return void 0!==e.prefix?e.uri+"|"+e.prefix:e.uri},this.logUsed=function(t){var n=t.uri,r=this.getNSKey(t);i[r]=this.byUri(n),e&&e.logUsed(t)},this.getUsed=function(e){var t=this;return[].concat(r,o).filter((function(e){var n=t.getNSKey(e);return i[n]}))}}function cr(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}function pr(e){return y(e)?e:(e.prefix?e.prefix+":":"")+e.localName}var ur={"\n":"#10","\n\r":"#10",'"':"#34","'":"#39","<":"#60",">":"#62","&":"#38"},dr={"<":"lt",">":"gt","&":"amp"};function hr(e,t,n){return(e=y(e)?e:""+e).replace(t,(function(e){return"&"+n[e]+";"}))}function fr(e){this.tagName=e}function mr(){}function gr(e){this.tagName=e}function yr(e,t){this.body=[],this.attrs=[],this.parent=e,this.propertyDescriptor=t}function vr(e,t){yr.call(this,e,t)}function br(){this.value="",this.write=function(e){this.value+=e}}function xr(e,t){var n=[""];this.append=function(t){return e.write(t),this},this.appendNewLine=function(){return t&&e.write("\n"),this},this.appendIndent=function(){return t&&e.write(n.join(" ")),this},this.indent=function(){return n.push(""),this},this.unindent=function(){return n.pop(),this}}function wr(e){return e=z({format:!1,preamble:!0},e||{}),{toXML:function(t,n){var i=n||new br,r=new xr(i,e.format);if(e.preamble&&r.append('\n'),(new yr).build(t).serializeTo(r),!n)return i.value}}}function _r(e,t){Oi.call(this,e,t)}fr.prototype.build=function(e){return this.element=e,this},fr.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"+this.element.id+""+this.tagName+">").appendNewLine()},mr.prototype.serializeValue=mr.prototype.serializeTo=function(e){e.append(this.escape?hr(this.value,ar,dr):this.value)},mr.prototype.build=function(e,t){return this.value=t,"String"===e.type&&-1!==t.search(ar)&&(this.escape=!0),this},cr(gr,mr),gr.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"),this.serializeValue(e),e.append(""+this.tagName+">").appendNewLine()},yr.prototype.build=function(e){this.element=e;var t,n,i=e.$descriptor,r=this.propertyDescriptor,o=i.isGeneric;return t=o?this.parseGeneric(e):this.parseNsAttributes(e),this.ns=r?this.nsPropertyTagName(r):this.nsTagName(i),this.tagName=this.addTagName(this.ns),o||(n=function(e){return w(e.$descriptor.properties,(function(t){var n=t.name;if(t.isVirtual)return!1;if(!v(e,n))return!1;var i=e[n];return i!==t.default&&null!==i&&(!t.isMany||i.length)}))}(e),this.parseAttributes(w(n,(function(e){return e.isAttr}))),this.parseContainments(function(e){return w(e,(function(e){return!e.isAttr}))}(n))),this.parseGenericAttributes(e,t),this},yr.prototype.nsTagName=function(e){return function(e,t){return t.isGeneric?z({localName:t.ns.localName},e):z({localName:(n=t.ns.localName,i=t.$pkg,zi(i)?function(e){return e.charAt(0).toLowerCase()+e.slice(1)}(n):n)},e);var n,i}(this.logNamespaceUsed(e.ns),e)},yr.prototype.nsPropertyTagName=function(e){return function(e,t){return z({localName:t.ns.localName},e)}(this.logNamespaceUsed(e.ns),e)},yr.prototype.isLocalNs=function(e){return e.uri===this.ns.uri},yr.prototype.nsAttributeName=function(e){var t;if(t=y(e)?yi(e):e.ns,e.inherited)return{localName:t.localName};var n=this.logNamespaceUsed(t);return this.getNamespaces().logUsed(n),this.isLocalNs(n)?{localName:t.localName}:z({localName:t.localName},n)},yr.prototype.parseGeneric=function(e){var t=this,n=this.body,i=[];return _(e,(function(r,o){"$body"===o?n.push((new mr).build({type:"String"},r)):"$children"===o?_(r,(function(e){n.push(new yr(t).build(e))})):0!==o.indexOf("$")&&t.parseNsAttribute(e,o,r)&&i.push({name:o,value:r})})),i},yr.prototype.parseNsAttribute=function(e,t,n){var i,r=e.$model,o=yi(t);if("xmlns"===o.prefix&&(i={prefix:o.localName,uri:n}),o.prefix||"xmlns"!==o.localName||(i={uri:n}),!i)return{name:t,value:n};if(r&&r.getPackage(n))this.logNamespace(i,!0,!0);else{var s=this.logNamespaceUsed(i,!0);this.getNamespaces().logUsed(s)}},yr.prototype.parseNsAttributes=function(e,t){var n=this,i=e.$attrs,r=[];return _(i,(function(t,i){var o=n.parseNsAttribute(e,i,t);o&&r.push(o)})),r},yr.prototype.parseGenericAttributes=function(e,t){var n=this;_(t,(function(t){if(t.name!==Vi)try{n.addAttribute(n.nsAttributeName(t.name),t.value)}catch(n){console.warn("missing namespace information for ",t.name,"=",t.value,"on",e,n)}}))},yr.prototype.parseContainments=function(e){var t=this,n=this.body,i=this.element;_(e,(function(e){var r=i.get(e.name),o=e.isReference;if(e.isMany||(r=[r]),e.isBody)n.push((new mr).build(e,r[0]));else if(gi(e.type))_(r,(function(i){n.push(new gr(t.addTagName(t.nsPropertyTagName(e))).build(e,i))}));else if(o)_(r,(function(i){n.push(new fr(t.addTagName(t.nsPropertyTagName(e))).build(i))}));else{var s=Ui(e),a=function(e){return"property"===Hi(e)}(e);_(r,(function(i){var r;r=s?new vr(t,e):a?new yr(t,e):new yr(t),n.push(r.build(i))}))}}))},yr.prototype.getNamespaces=function(e){var t,n=this.namespaces,i=this.parent;return n||(t=i&&i.getNamespaces(),e||!t?this.namespaces=n=new lr(t):n=t),n},yr.prototype.logNamespace=function(e,t,n){var i=this.getNamespaces(n),r=e.uri,o=e.prefix;return i.byUri(r)&&!n||i.add(e,t),i.mapPrefix(o,r),e},yr.prototype.logNamespaceUsed=function(e,t){var n,i,r,o=this.element.$model,s=this.getNamespaces(t),a=e.prefix,l=e.uri;if(!a&&!l)return{localName:e.localName};if(r=Fi[a]||o&&(o.getPackage(a)||{}).uri,!(l=l||r||s.uriByPrefix(a)))throw new Error("no namespace uri given for prefix <"+a+">");if(!(e=s.byUri(l))){for(n=a,i=1;s.uriByPrefix(n);)n=a+"_"+i++;e=this.logNamespace({prefix:n,uri:l},r===l)}return a&&s.mapPrefix(a,l),e},yr.prototype.parseAttributes=function(e){var t=this,n=this.element;_(e,(function(e){var i=n.get(e.name);if(e.isReference)if(e.isMany){var r=[];_(i,(function(e){r.push(e.id)})),i=r.join(" ")}else i=i.id;t.addAttribute(t.nsAttributeName(e),i)}))},yr.prototype.addTagName=function(e){var t=this.logNamespaceUsed(e);return this.getNamespaces().logUsed(t),pr(e)},yr.prototype.addAttribute=function(e,t){var n=this.attrs;y(t)&&(t=hr(t,sr,ur));var i=x(n,(function(t){return t.name.localName===e.localName&&t.name.uri===e.uri&&t.name.prefix===e.prefix})),r={name:e,value:t};-1!==i?n.splice(i,1,r):n.push(r)},yr.prototype.serializeAttributes=function(e){var t=this.attrs,n=this.namespaces;n&&(t=function(e){return e.getUsed().filter((function(e){return"xml"!==e.prefix})).map((function(e){return{name:"xmlns"+(e.prefix?":"+e.prefix:""),value:e.uri}}))}(n).concat(t)),_(t,(function(t){e.append(" ").append(pr(t.name)).append('="').append(t.value).append('"')}))},yr.prototype.serializeTo=function(e){var t=this.body[0],n=t&&t.constructor!==mr;e.appendIndent().append("<"+this.tagName),this.serializeAttributes(e),e.append(t?">":" />"),t&&(n&&e.appendNewLine().indent(),_(this.body,(function(t){t.serializeTo(e)})),n&&e.unindent().appendIndent(),e.append(""+this.tagName+">")),e.appendNewLine()},cr(vr,yr),vr.prototype.parseNsAttributes=function(e){var t=yr.prototype.parseNsAttributes.call(this,e),n=e.$descriptor;if(n.name===this.propertyDescriptor.type)return t;var i=this.typeNs=this.nsTagName(n);this.getNamespaces().logUsed(this.typeNs);var r=e.$model.getPackage(i.uri),o=r.xml&&r.xml.typePrefix||"";return this.addAttribute(this.nsAttributeName(Vi),(i.prefix?i.prefix+":":"")+o+n.ns.localName),t},vr.prototype.isLocalNs=function(e){return e.uri===(this.typeNs||this.ns).uri},_r.prototype=Object.create(Oi.prototype),_r.prototype.fromXML=function(e,t,n){y(t)||(n=t,t="bpmn:Definitions");var i=new or(z({model:this,lax:!0},n)),r=i.handler(t);return i.fromXML(e,r)},_r.prototype.toXML=function(e,t){var n=new wr(t);return new Promise((function(t,i){try{return t({xml:n.toXML(e)})}catch(e){return i(e)}}))};var Er={bpmn:{name:"BPMN20",uri:"http://www.omg.org/spec/BPMN/20100524/MODEL",prefix:"bpmn",associations:[],types:[{name:"Interface",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"operations",type:"Operation",isMany:!0},{name:"implementationRef",isAttr:!0,type:"String"}]},{name:"Operation",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"inMessageRef",type:"Message",isReference:!0},{name:"outMessageRef",type:"Message",isReference:!0},{name:"errorRef",type:"Error",isMany:!0,isReference:!0},{name:"implementationRef",isAttr:!0,type:"String"}]},{name:"EndPoint",superClass:["RootElement"]},{name:"Auditing",superClass:["BaseElement"]},{name:"GlobalTask",superClass:["CallableElement"],properties:[{name:"resources",type:"ResourceRole",isMany:!0}]},{name:"Monitoring",superClass:["BaseElement"]},{name:"Performer",superClass:["ResourceRole"]},{name:"Process",superClass:["FlowElementsContainer","CallableElement"],properties:[{name:"processType",type:"ProcessType",isAttr:!0},{name:"isClosed",isAttr:!0,type:"Boolean"},{name:"auditing",type:"Auditing"},{name:"monitoring",type:"Monitoring"},{name:"properties",type:"Property",isMany:!0},{name:"laneSets",isMany:!0,replaces:"FlowElementsContainer#laneSets",type:"LaneSet"},{name:"flowElements",isMany:!0,replaces:"FlowElementsContainer#flowElements",type:"FlowElement"},{name:"artifacts",type:"Artifact",isMany:!0},{name:"resources",type:"ResourceRole",isMany:!0},{name:"correlationSubscriptions",type:"CorrelationSubscription",isMany:!0},{name:"supports",type:"Process",isMany:!0,isReference:!0},{name:"definitionalCollaborationRef",type:"Collaboration",isAttr:!0,isReference:!0},{name:"isExecutable",isAttr:!0,type:"Boolean"}]},{name:"LaneSet",superClass:["BaseElement"],properties:[{name:"lanes",type:"Lane",isMany:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Lane",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"partitionElementRef",type:"BaseElement",isAttr:!0,isReference:!0},{name:"partitionElement",type:"BaseElement"},{name:"flowNodeRef",type:"FlowNode",isMany:!0,isReference:!0},{name:"childLaneSet",type:"LaneSet",xml:{serialize:"xsi:type"}}]},{name:"GlobalManualTask",superClass:["GlobalTask"]},{name:"ManualTask",superClass:["Task"]},{name:"UserTask",superClass:["Task"],properties:[{name:"renderings",type:"Rendering",isMany:!0},{name:"implementation",isAttr:!0,type:"String"}]},{name:"Rendering",superClass:["BaseElement"]},{name:"HumanPerformer",superClass:["Performer"]},{name:"PotentialOwner",superClass:["HumanPerformer"]},{name:"GlobalUserTask",superClass:["GlobalTask"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"renderings",type:"Rendering",isMany:!0}]},{name:"Gateway",isAbstract:!0,superClass:["FlowNode"],properties:[{name:"gatewayDirection",type:"GatewayDirection",default:"Unspecified",isAttr:!0}]},{name:"EventBasedGateway",superClass:["Gateway"],properties:[{name:"instantiate",default:!1,isAttr:!0,type:"Boolean"},{name:"eventGatewayType",type:"EventBasedGatewayType",isAttr:!0,default:"Exclusive"}]},{name:"ComplexGateway",superClass:["Gateway"],properties:[{name:"activationCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0}]},{name:"ExclusiveGateway",superClass:["Gateway"],properties:[{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0}]},{name:"InclusiveGateway",superClass:["Gateway"],properties:[{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0}]},{name:"ParallelGateway",superClass:["Gateway"]},{name:"RootElement",isAbstract:!0,superClass:["BaseElement"]},{name:"Relationship",superClass:["BaseElement"],properties:[{name:"type",isAttr:!0,type:"String"},{name:"direction",type:"RelationshipDirection",isAttr:!0},{name:"source",isMany:!0,isReference:!0,type:"Element"},{name:"target",isMany:!0,isReference:!0,type:"Element"}]},{name:"BaseElement",isAbstract:!0,properties:[{name:"id",isAttr:!0,type:"String",isId:!0},{name:"documentation",type:"Documentation",isMany:!0},{name:"extensionDefinitions",type:"ExtensionDefinition",isMany:!0,isReference:!0},{name:"extensionElements",type:"ExtensionElements"}]},{name:"Extension",properties:[{name:"mustUnderstand",default:!1,isAttr:!0,type:"Boolean"},{name:"definition",type:"ExtensionDefinition",isAttr:!0,isReference:!0}]},{name:"ExtensionDefinition",properties:[{name:"name",isAttr:!0,type:"String"},{name:"extensionAttributeDefinitions",type:"ExtensionAttributeDefinition",isMany:!0}]},{name:"ExtensionAttributeDefinition",properties:[{name:"name",isAttr:!0,type:"String"},{name:"type",isAttr:!0,type:"String"},{name:"isReference",default:!1,isAttr:!0,type:"Boolean"},{name:"extensionDefinition",type:"ExtensionDefinition",isAttr:!0,isReference:!0}]},{name:"ExtensionElements",properties:[{name:"valueRef",isAttr:!0,isReference:!0,type:"Element"},{name:"values",type:"Element",isMany:!0},{name:"extensionAttributeDefinition",type:"ExtensionAttributeDefinition",isAttr:!0,isReference:!0}]},{name:"Documentation",superClass:["BaseElement"],properties:[{name:"text",type:"String",isBody:!0},{name:"textFormat",default:"text/plain",isAttr:!0,type:"String"}]},{name:"Event",isAbstract:!0,superClass:["FlowNode","InteractionNode"],properties:[{name:"properties",type:"Property",isMany:!0}]},{name:"IntermediateCatchEvent",superClass:["CatchEvent"]},{name:"IntermediateThrowEvent",superClass:["ThrowEvent"]},{name:"EndEvent",superClass:["ThrowEvent"]},{name:"StartEvent",superClass:["CatchEvent"],properties:[{name:"isInterrupting",default:!0,isAttr:!0,type:"Boolean"}]},{name:"ThrowEvent",isAbstract:!0,superClass:["Event"],properties:[{name:"dataInputs",type:"DataInput",isMany:!0},{name:"dataInputAssociations",type:"DataInputAssociation",isMany:!0},{name:"inputSet",type:"InputSet"},{name:"eventDefinitions",type:"EventDefinition",isMany:!0},{name:"eventDefinitionRef",type:"EventDefinition",isMany:!0,isReference:!0}]},{name:"CatchEvent",isAbstract:!0,superClass:["Event"],properties:[{name:"parallelMultiple",isAttr:!0,type:"Boolean",default:!1},{name:"dataOutputs",type:"DataOutput",isMany:!0},{name:"dataOutputAssociations",type:"DataOutputAssociation",isMany:!0},{name:"outputSet",type:"OutputSet"},{name:"eventDefinitions",type:"EventDefinition",isMany:!0},{name:"eventDefinitionRef",type:"EventDefinition",isMany:!0,isReference:!0}]},{name:"BoundaryEvent",superClass:["CatchEvent"],properties:[{name:"cancelActivity",default:!0,isAttr:!0,type:"Boolean"},{name:"attachedToRef",type:"Activity",isAttr:!0,isReference:!0}]},{name:"EventDefinition",isAbstract:!0,superClass:["RootElement"]},{name:"CancelEventDefinition",superClass:["EventDefinition"]},{name:"ErrorEventDefinition",superClass:["EventDefinition"],properties:[{name:"errorRef",type:"Error",isAttr:!0,isReference:!0}]},{name:"TerminateEventDefinition",superClass:["EventDefinition"]},{name:"EscalationEventDefinition",superClass:["EventDefinition"],properties:[{name:"escalationRef",type:"Escalation",isAttr:!0,isReference:!0}]},{name:"Escalation",properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"escalationCode",isAttr:!0,type:"String"}],superClass:["RootElement"]},{name:"CompensateEventDefinition",superClass:["EventDefinition"],properties:[{name:"waitForCompletion",isAttr:!0,type:"Boolean",default:!0},{name:"activityRef",type:"Activity",isAttr:!0,isReference:!0}]},{name:"TimerEventDefinition",superClass:["EventDefinition"],properties:[{name:"timeDate",type:"Expression",xml:{serialize:"xsi:type"}},{name:"timeCycle",type:"Expression",xml:{serialize:"xsi:type"}},{name:"timeDuration",type:"Expression",xml:{serialize:"xsi:type"}}]},{name:"LinkEventDefinition",superClass:["EventDefinition"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"target",type:"LinkEventDefinition",isReference:!0},{name:"source",type:"LinkEventDefinition",isMany:!0,isReference:!0}]},{name:"MessageEventDefinition",superClass:["EventDefinition"],properties:[{name:"messageRef",type:"Message",isAttr:!0,isReference:!0},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0}]},{name:"ConditionalEventDefinition",superClass:["EventDefinition"],properties:[{name:"condition",type:"Expression",xml:{serialize:"xsi:type"}}]},{name:"SignalEventDefinition",superClass:["EventDefinition"],properties:[{name:"signalRef",type:"Signal",isAttr:!0,isReference:!0}]},{name:"Signal",superClass:["RootElement"],properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"ImplicitThrowEvent",superClass:["ThrowEvent"]},{name:"DataState",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"}]},{name:"ItemAwareElement",superClass:["BaseElement"],properties:[{name:"itemSubjectRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"dataState",type:"DataState"}]},{name:"DataAssociation",superClass:["BaseElement"],properties:[{name:"sourceRef",type:"ItemAwareElement",isMany:!0,isReference:!0},{name:"targetRef",type:"ItemAwareElement",isReference:!0},{name:"transformation",type:"FormalExpression",xml:{serialize:"property"}},{name:"assignment",type:"Assignment",isMany:!0}]},{name:"DataInput",superClass:["ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"},{name:"inputSetRef",type:"InputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"inputSetWithOptional",type:"InputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"inputSetWithWhileExecuting",type:"InputSet",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"DataOutput",superClass:["ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"},{name:"outputSetRef",type:"OutputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"outputSetWithOptional",type:"OutputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"outputSetWithWhileExecuting",type:"OutputSet",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"InputSet",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"dataInputRefs",type:"DataInput",isMany:!0,isReference:!0},{name:"optionalInputRefs",type:"DataInput",isMany:!0,isReference:!0},{name:"whileExecutingInputRefs",type:"DataInput",isMany:!0,isReference:!0},{name:"outputSetRefs",type:"OutputSet",isMany:!0,isReference:!0}]},{name:"OutputSet",superClass:["BaseElement"],properties:[{name:"dataOutputRefs",type:"DataOutput",isMany:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"inputSetRefs",type:"InputSet",isMany:!0,isReference:!0},{name:"optionalOutputRefs",type:"DataOutput",isMany:!0,isReference:!0},{name:"whileExecutingOutputRefs",type:"DataOutput",isMany:!0,isReference:!0}]},{name:"Property",superClass:["ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"}]},{name:"DataInputAssociation",superClass:["DataAssociation"]},{name:"DataOutputAssociation",superClass:["DataAssociation"]},{name:"InputOutputSpecification",superClass:["BaseElement"],properties:[{name:"dataInputs",type:"DataInput",isMany:!0},{name:"dataOutputs",type:"DataOutput",isMany:!0},{name:"inputSets",type:"InputSet",isMany:!0},{name:"outputSets",type:"OutputSet",isMany:!0}]},{name:"DataObject",superClass:["FlowElement","ItemAwareElement"],properties:[{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"}]},{name:"InputOutputBinding",properties:[{name:"inputDataRef",type:"InputSet",isAttr:!0,isReference:!0},{name:"outputDataRef",type:"OutputSet",isAttr:!0,isReference:!0},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0}]},{name:"Assignment",superClass:["BaseElement"],properties:[{name:"from",type:"Expression",xml:{serialize:"xsi:type"}},{name:"to",type:"Expression",xml:{serialize:"xsi:type"}}]},{name:"DataStore",superClass:["RootElement","ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"capacity",isAttr:!0,type:"Integer"},{name:"isUnlimited",default:!0,isAttr:!0,type:"Boolean"}]},{name:"DataStoreReference",superClass:["ItemAwareElement","FlowElement"],properties:[{name:"dataStoreRef",type:"DataStore",isAttr:!0,isReference:!0}]},{name:"DataObjectReference",superClass:["ItemAwareElement","FlowElement"],properties:[{name:"dataObjectRef",type:"DataObject",isAttr:!0,isReference:!0}]},{name:"ConversationLink",superClass:["BaseElement"],properties:[{name:"sourceRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"targetRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"ConversationAssociation",superClass:["BaseElement"],properties:[{name:"innerConversationNodeRef",type:"ConversationNode",isAttr:!0,isReference:!0},{name:"outerConversationNodeRef",type:"ConversationNode",isAttr:!0,isReference:!0}]},{name:"CallConversation",superClass:["ConversationNode"],properties:[{name:"calledCollaborationRef",type:"Collaboration",isAttr:!0,isReference:!0},{name:"participantAssociations",type:"ParticipantAssociation",isMany:!0}]},{name:"Conversation",superClass:["ConversationNode"]},{name:"SubConversation",superClass:["ConversationNode"],properties:[{name:"conversationNodes",type:"ConversationNode",isMany:!0}]},{name:"ConversationNode",isAbstract:!0,superClass:["InteractionNode","BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"participantRef",type:"Participant",isMany:!0,isReference:!0},{name:"messageFlowRefs",type:"MessageFlow",isMany:!0,isReference:!0},{name:"correlationKeys",type:"CorrelationKey",isMany:!0}]},{name:"GlobalConversation",superClass:["Collaboration"]},{name:"PartnerEntity",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"participantRef",type:"Participant",isMany:!0,isReference:!0}]},{name:"PartnerRole",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"participantRef",type:"Participant",isMany:!0,isReference:!0}]},{name:"CorrelationProperty",superClass:["RootElement"],properties:[{name:"correlationPropertyRetrievalExpression",type:"CorrelationPropertyRetrievalExpression",isMany:!0},{name:"name",isAttr:!0,type:"String"},{name:"type",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"Error",superClass:["RootElement"],properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"errorCode",isAttr:!0,type:"String"}]},{name:"CorrelationKey",superClass:["BaseElement"],properties:[{name:"correlationPropertyRef",type:"CorrelationProperty",isMany:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Expression",superClass:["BaseElement"],isAbstract:!1,properties:[{name:"body",isBody:!0,type:"String"}]},{name:"FormalExpression",superClass:["Expression"],properties:[{name:"language",isAttr:!0,type:"String"},{name:"evaluatesToTypeRef",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"Message",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"itemRef",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"ItemDefinition",superClass:["RootElement"],properties:[{name:"itemKind",type:"ItemKind",isAttr:!0},{name:"structureRef",isAttr:!0,type:"String"},{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"},{name:"import",type:"Import",isAttr:!0,isReference:!0}]},{name:"FlowElement",isAbstract:!0,superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"auditing",type:"Auditing"},{name:"monitoring",type:"Monitoring"},{name:"categoryValueRef",type:"CategoryValue",isMany:!0,isReference:!0}]},{name:"SequenceFlow",superClass:["FlowElement"],properties:[{name:"isImmediate",isAttr:!0,type:"Boolean"},{name:"conditionExpression",type:"Expression",xml:{serialize:"xsi:type"}},{name:"sourceRef",type:"FlowNode",isAttr:!0,isReference:!0},{name:"targetRef",type:"FlowNode",isAttr:!0,isReference:!0}]},{name:"FlowElementsContainer",isAbstract:!0,superClass:["BaseElement"],properties:[{name:"laneSets",type:"LaneSet",isMany:!0},{name:"flowElements",type:"FlowElement",isMany:!0}]},{name:"CallableElement",isAbstract:!0,superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"ioSpecification",type:"InputOutputSpecification",xml:{serialize:"property"}},{name:"supportedInterfaceRef",type:"Interface",isMany:!0,isReference:!0},{name:"ioBinding",type:"InputOutputBinding",isMany:!0,xml:{serialize:"property"}}]},{name:"FlowNode",isAbstract:!0,superClass:["FlowElement"],properties:[{name:"incoming",type:"SequenceFlow",isMany:!0,isReference:!0},{name:"outgoing",type:"SequenceFlow",isMany:!0,isReference:!0},{name:"lanes",type:"Lane",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"CorrelationPropertyRetrievalExpression",superClass:["BaseElement"],properties:[{name:"messagePath",type:"FormalExpression"},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"CorrelationPropertyBinding",superClass:["BaseElement"],properties:[{name:"dataPath",type:"FormalExpression"},{name:"correlationPropertyRef",type:"CorrelationProperty",isAttr:!0,isReference:!0}]},{name:"Resource",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"resourceParameters",type:"ResourceParameter",isMany:!0}]},{name:"ResourceParameter",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isRequired",isAttr:!0,type:"Boolean"},{name:"type",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"CorrelationSubscription",superClass:["BaseElement"],properties:[{name:"correlationKeyRef",type:"CorrelationKey",isAttr:!0,isReference:!0},{name:"correlationPropertyBinding",type:"CorrelationPropertyBinding",isMany:!0}]},{name:"MessageFlow",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"sourceRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"targetRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"MessageFlowAssociation",superClass:["BaseElement"],properties:[{name:"innerMessageFlowRef",type:"MessageFlow",isAttr:!0,isReference:!0},{name:"outerMessageFlowRef",type:"MessageFlow",isAttr:!0,isReference:!0}]},{name:"InteractionNode",isAbstract:!0,properties:[{name:"incomingConversationLinks",type:"ConversationLink",isMany:!0,isVirtual:!0,isReference:!0},{name:"outgoingConversationLinks",type:"ConversationLink",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"Participant",superClass:["InteractionNode","BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"interfaceRef",type:"Interface",isMany:!0,isReference:!0},{name:"participantMultiplicity",type:"ParticipantMultiplicity"},{name:"endPointRefs",type:"EndPoint",isMany:!0,isReference:!0},{name:"processRef",type:"Process",isAttr:!0,isReference:!0}]},{name:"ParticipantAssociation",superClass:["BaseElement"],properties:[{name:"innerParticipantRef",type:"Participant",isAttr:!0,isReference:!0},{name:"outerParticipantRef",type:"Participant",isAttr:!0,isReference:!0}]},{name:"ParticipantMultiplicity",properties:[{name:"minimum",default:0,isAttr:!0,type:"Integer"},{name:"maximum",default:1,isAttr:!0,type:"Integer"}],superClass:["BaseElement"]},{name:"Collaboration",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isClosed",isAttr:!0,type:"Boolean"},{name:"participants",type:"Participant",isMany:!0},{name:"messageFlows",type:"MessageFlow",isMany:!0},{name:"artifacts",type:"Artifact",isMany:!0},{name:"conversations",type:"ConversationNode",isMany:!0},{name:"conversationAssociations",type:"ConversationAssociation"},{name:"participantAssociations",type:"ParticipantAssociation",isMany:!0},{name:"messageFlowAssociations",type:"MessageFlowAssociation",isMany:!0},{name:"correlationKeys",type:"CorrelationKey",isMany:!0},{name:"choreographyRef",type:"Choreography",isMany:!0,isReference:!0},{name:"conversationLinks",type:"ConversationLink",isMany:!0}]},{name:"ChoreographyActivity",isAbstract:!0,superClass:["FlowNode"],properties:[{name:"participantRef",type:"Participant",isMany:!0,isReference:!0},{name:"initiatingParticipantRef",type:"Participant",isAttr:!0,isReference:!0},{name:"correlationKeys",type:"CorrelationKey",isMany:!0},{name:"loopType",type:"ChoreographyLoopType",default:"None",isAttr:!0}]},{name:"CallChoreography",superClass:["ChoreographyActivity"],properties:[{name:"calledChoreographyRef",type:"Choreography",isAttr:!0,isReference:!0},{name:"participantAssociations",type:"ParticipantAssociation",isMany:!0}]},{name:"SubChoreography",superClass:["ChoreographyActivity","FlowElementsContainer"],properties:[{name:"artifacts",type:"Artifact",isMany:!0}]},{name:"ChoreographyTask",superClass:["ChoreographyActivity"],properties:[{name:"messageFlowRef",type:"MessageFlow",isMany:!0,isReference:!0}]},{name:"Choreography",superClass:["Collaboration","FlowElementsContainer"]},{name:"GlobalChoreographyTask",superClass:["Choreography"],properties:[{name:"initiatingParticipantRef",type:"Participant",isAttr:!0,isReference:!0}]},{name:"TextAnnotation",superClass:["Artifact"],properties:[{name:"text",type:"String"},{name:"textFormat",default:"text/plain",isAttr:!0,type:"String"}]},{name:"Group",superClass:["Artifact"],properties:[{name:"categoryValueRef",type:"CategoryValue",isAttr:!0,isReference:!0}]},{name:"Association",superClass:["Artifact"],properties:[{name:"associationDirection",type:"AssociationDirection",isAttr:!0},{name:"sourceRef",type:"BaseElement",isAttr:!0,isReference:!0},{name:"targetRef",type:"BaseElement",isAttr:!0,isReference:!0}]},{name:"Category",superClass:["RootElement"],properties:[{name:"categoryValue",type:"CategoryValue",isMany:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Artifact",isAbstract:!0,superClass:["BaseElement"]},{name:"CategoryValue",superClass:["BaseElement"],properties:[{name:"categorizedFlowElements",type:"FlowElement",isMany:!0,isVirtual:!0,isReference:!0},{name:"value",isAttr:!0,type:"String"}]},{name:"Activity",isAbstract:!0,superClass:["FlowNode"],properties:[{name:"isForCompensation",default:!1,isAttr:!0,type:"Boolean"},{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0},{name:"ioSpecification",type:"InputOutputSpecification",xml:{serialize:"property"}},{name:"boundaryEventRefs",type:"BoundaryEvent",isMany:!0,isReference:!0},{name:"properties",type:"Property",isMany:!0},{name:"dataInputAssociations",type:"DataInputAssociation",isMany:!0},{name:"dataOutputAssociations",type:"DataOutputAssociation",isMany:!0},{name:"startQuantity",default:1,isAttr:!0,type:"Integer"},{name:"resources",type:"ResourceRole",isMany:!0},{name:"completionQuantity",default:1,isAttr:!0,type:"Integer"},{name:"loopCharacteristics",type:"LoopCharacteristics"}]},{name:"ServiceTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0}]},{name:"SubProcess",superClass:["Activity","FlowElementsContainer","InteractionNode"],properties:[{name:"triggeredByEvent",default:!1,isAttr:!0,type:"Boolean"},{name:"artifacts",type:"Artifact",isMany:!0}]},{name:"LoopCharacteristics",isAbstract:!0,superClass:["BaseElement"]},{name:"MultiInstanceLoopCharacteristics",superClass:["LoopCharacteristics"],properties:[{name:"isSequential",default:!1,isAttr:!0,type:"Boolean"},{name:"behavior",type:"MultiInstanceBehavior",default:"All",isAttr:!0},{name:"loopCardinality",type:"Expression",xml:{serialize:"xsi:type"}},{name:"loopDataInputRef",type:"ItemAwareElement",isReference:!0},{name:"loopDataOutputRef",type:"ItemAwareElement",isReference:!0},{name:"inputDataItem",type:"DataInput",xml:{serialize:"property"}},{name:"outputDataItem",type:"DataOutput",xml:{serialize:"property"}},{name:"complexBehaviorDefinition",type:"ComplexBehaviorDefinition",isMany:!0},{name:"completionCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"oneBehaviorEventRef",type:"EventDefinition",isAttr:!0,isReference:!0},{name:"noneBehaviorEventRef",type:"EventDefinition",isAttr:!0,isReference:!0}]},{name:"StandardLoopCharacteristics",superClass:["LoopCharacteristics"],properties:[{name:"testBefore",default:!1,isAttr:!0,type:"Boolean"},{name:"loopCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"loopMaximum",type:"Integer",isAttr:!0}]},{name:"CallActivity",superClass:["Activity","InteractionNode"],properties:[{name:"calledElement",type:"String",isAttr:!0}]},{name:"Task",superClass:["Activity","InteractionNode"]},{name:"SendTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"ReceiveTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"instantiate",default:!1,isAttr:!0,type:"Boolean"},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"ScriptTask",superClass:["Task"],properties:[{name:"scriptFormat",isAttr:!0,type:"String"},{name:"script",type:"String"}]},{name:"BusinessRuleTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"}]},{name:"AdHocSubProcess",superClass:["SubProcess"],properties:[{name:"completionCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"ordering",type:"AdHocOrdering",isAttr:!0},{name:"cancelRemainingInstances",default:!0,isAttr:!0,type:"Boolean"}]},{name:"Transaction",superClass:["SubProcess"],properties:[{name:"protocol",isAttr:!0,type:"String"},{name:"method",isAttr:!0,type:"String"}]},{name:"GlobalScriptTask",superClass:["GlobalTask"],properties:[{name:"scriptLanguage",isAttr:!0,type:"String"},{name:"script",isAttr:!0,type:"String"}]},{name:"GlobalBusinessRuleTask",superClass:["GlobalTask"],properties:[{name:"implementation",isAttr:!0,type:"String"}]},{name:"ComplexBehaviorDefinition",superClass:["BaseElement"],properties:[{name:"condition",type:"FormalExpression"},{name:"event",type:"ImplicitThrowEvent"}]},{name:"ResourceRole",superClass:["BaseElement"],properties:[{name:"resourceRef",type:"Resource",isReference:!0},{name:"resourceParameterBindings",type:"ResourceParameterBinding",isMany:!0},{name:"resourceAssignmentExpression",type:"ResourceAssignmentExpression"},{name:"name",isAttr:!0,type:"String"}]},{name:"ResourceParameterBinding",properties:[{name:"expression",type:"Expression",xml:{serialize:"xsi:type"}},{name:"parameterRef",type:"ResourceParameter",isAttr:!0,isReference:!0}],superClass:["BaseElement"]},{name:"ResourceAssignmentExpression",properties:[{name:"expression",type:"Expression",xml:{serialize:"xsi:type"}}],superClass:["BaseElement"]},{name:"Import",properties:[{name:"importType",isAttr:!0,type:"String"},{name:"location",isAttr:!0,type:"String"},{name:"namespace",isAttr:!0,type:"String"}]},{name:"Definitions",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"targetNamespace",isAttr:!0,type:"String"},{name:"expressionLanguage",default:"http://www.w3.org/1999/XPath",isAttr:!0,type:"String"},{name:"typeLanguage",default:"http://www.w3.org/2001/XMLSchema",isAttr:!0,type:"String"},{name:"imports",type:"Import",isMany:!0},{name:"extensions",type:"Extension",isMany:!0},{name:"rootElements",type:"RootElement",isMany:!0},{name:"diagrams",isMany:!0,type:"bpmndi:BPMNDiagram"},{name:"exporter",isAttr:!0,type:"String"},{name:"relationships",type:"Relationship",isMany:!0},{name:"exporterVersion",isAttr:!0,type:"String"}]}],enumerations:[{name:"ProcessType",literalValues:[{name:"None"},{name:"Public"},{name:"Private"}]},{name:"GatewayDirection",literalValues:[{name:"Unspecified"},{name:"Converging"},{name:"Diverging"},{name:"Mixed"}]},{name:"EventBasedGatewayType",literalValues:[{name:"Parallel"},{name:"Exclusive"}]},{name:"RelationshipDirection",literalValues:[{name:"None"},{name:"Forward"},{name:"Backward"},{name:"Both"}]},{name:"ItemKind",literalValues:[{name:"Physical"},{name:"Information"}]},{name:"ChoreographyLoopType",literalValues:[{name:"None"},{name:"Standard"},{name:"MultiInstanceSequential"},{name:"MultiInstanceParallel"}]},{name:"AssociationDirection",literalValues:[{name:"None"},{name:"One"},{name:"Both"}]},{name:"MultiInstanceBehavior",literalValues:[{name:"None"},{name:"One"},{name:"All"},{name:"Complex"}]},{name:"AdHocOrdering",literalValues:[{name:"Parallel"},{name:"Sequential"}]}],xml:{tagAlias:"lowerCase",typePrefix:"t"}},bpmndi:{name:"BPMNDI",uri:"http://www.omg.org/spec/BPMN/20100524/DI",prefix:"bpmndi",types:[{name:"BPMNDiagram",properties:[{name:"plane",type:"BPMNPlane",redefines:"di:Diagram#rootElement"},{name:"labelStyle",type:"BPMNLabelStyle",isMany:!0}],superClass:["di:Diagram"]},{name:"BPMNPlane",properties:[{name:"bpmnElement",isAttr:!0,isReference:!0,type:"bpmn:BaseElement",redefines:"di:DiagramElement#modelElement"}],superClass:["di:Plane"]},{name:"BPMNShape",properties:[{name:"bpmnElement",isAttr:!0,isReference:!0,type:"bpmn:BaseElement",redefines:"di:DiagramElement#modelElement"},{name:"isHorizontal",isAttr:!0,type:"Boolean"},{name:"isExpanded",isAttr:!0,type:"Boolean"},{name:"isMarkerVisible",isAttr:!0,type:"Boolean"},{name:"label",type:"BPMNLabel"},{name:"isMessageVisible",isAttr:!0,type:"Boolean"},{name:"participantBandKind",type:"ParticipantBandKind",isAttr:!0},{name:"choreographyActivityShape",type:"BPMNShape",isAttr:!0,isReference:!0}],superClass:["di:LabeledShape"]},{name:"BPMNEdge",properties:[{name:"label",type:"BPMNLabel"},{name:"bpmnElement",isAttr:!0,isReference:!0,type:"bpmn:BaseElement",redefines:"di:DiagramElement#modelElement"},{name:"sourceElement",isAttr:!0,isReference:!0,type:"di:DiagramElement",redefines:"di:Edge#source"},{name:"targetElement",isAttr:!0,isReference:!0,type:"di:DiagramElement",redefines:"di:Edge#target"},{name:"messageVisibleKind",type:"MessageVisibleKind",isAttr:!0,default:"initiating"}],superClass:["di:LabeledEdge"]},{name:"BPMNLabel",properties:[{name:"labelStyle",type:"BPMNLabelStyle",isAttr:!0,isReference:!0,redefines:"di:DiagramElement#style"}],superClass:["di:Label"]},{name:"BPMNLabelStyle",properties:[{name:"font",type:"dc:Font"}],superClass:["di:Style"]}],enumerations:[{name:"ParticipantBandKind",literalValues:[{name:"top_initiating"},{name:"middle_initiating"},{name:"bottom_initiating"},{name:"top_non_initiating"},{name:"middle_non_initiating"},{name:"bottom_non_initiating"}]},{name:"MessageVisibleKind",literalValues:[{name:"initiating"},{name:"non_initiating"}]}],associations:[]},dc:{name:"DC",uri:"http://www.omg.org/spec/DD/20100524/DC",prefix:"dc",types:[{name:"Boolean"},{name:"Integer"},{name:"Real"},{name:"String"},{name:"Font",properties:[{name:"name",type:"String",isAttr:!0},{name:"size",type:"Real",isAttr:!0},{name:"isBold",type:"Boolean",isAttr:!0},{name:"isItalic",type:"Boolean",isAttr:!0},{name:"isUnderline",type:"Boolean",isAttr:!0},{name:"isStrikeThrough",type:"Boolean",isAttr:!0}]},{name:"Point",properties:[{name:"x",type:"Real",default:"0",isAttr:!0},{name:"y",type:"Real",default:"0",isAttr:!0}]},{name:"Bounds",properties:[{name:"x",type:"Real",default:"0",isAttr:!0},{name:"y",type:"Real",default:"0",isAttr:!0},{name:"width",type:"Real",isAttr:!0},{name:"height",type:"Real",isAttr:!0}]}],associations:[]},di:{name:"DI",uri:"http://www.omg.org/spec/DD/20100524/DI",prefix:"di",types:[{name:"DiagramElement",isAbstract:!0,properties:[{name:"id",isAttr:!0,isId:!0,type:"String"},{name:"extension",type:"Extension"},{name:"owningDiagram",type:"Diagram",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"owningElement",type:"DiagramElement",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"modelElement",isReadOnly:!0,isVirtual:!0,isReference:!0,type:"Element"},{name:"style",type:"Style",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"ownedElement",type:"DiagramElement",isReadOnly:!0,isMany:!0,isVirtual:!0}]},{name:"Node",isAbstract:!0,superClass:["DiagramElement"]},{name:"Edge",isAbstract:!0,superClass:["DiagramElement"],properties:[{name:"source",type:"DiagramElement",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"target",type:"DiagramElement",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"waypoint",isUnique:!1,isMany:!0,type:"dc:Point",xml:{serialize:"xsi:type"}}]},{name:"Diagram",isAbstract:!0,properties:[{name:"id",isAttr:!0,isId:!0,type:"String"},{name:"rootElement",type:"DiagramElement",isReadOnly:!0,isVirtual:!0},{name:"name",isAttr:!0,type:"String"},{name:"documentation",isAttr:!0,type:"String"},{name:"resolution",isAttr:!0,type:"Real"},{name:"ownedStyle",type:"Style",isReadOnly:!0,isMany:!0,isVirtual:!0}]},{name:"Shape",isAbstract:!0,superClass:["Node"],properties:[{name:"bounds",type:"dc:Bounds"}]},{name:"Plane",isAbstract:!0,superClass:["Node"],properties:[{name:"planeElement",type:"DiagramElement",subsettedProperty:"DiagramElement-ownedElement",isMany:!0}]},{name:"LabeledEdge",isAbstract:!0,superClass:["Edge"],properties:[{name:"ownedLabel",type:"Label",isReadOnly:!0,subsettedProperty:"DiagramElement-ownedElement",isMany:!0,isVirtual:!0}]},{name:"LabeledShape",isAbstract:!0,superClass:["Shape"],properties:[{name:"ownedLabel",type:"Label",isReadOnly:!0,subsettedProperty:"DiagramElement-ownedElement",isMany:!0,isVirtual:!0}]},{name:"Label",isAbstract:!0,superClass:["Node"],properties:[{name:"bounds",type:"dc:Bounds"}]},{name:"Style",isAbstract:!0,properties:[{name:"id",isAttr:!0,isId:!0,type:"String"}]},{name:"Extension",properties:[{name:"values",isMany:!0,type:"Element"}]}],associations:[],xml:{tagAlias:"lowerCase"}},bioc:{name:"bpmn.io colors for BPMN",uri:"http://bpmn.io/schema/bpmn/biocolor/1.0",prefix:"bioc",types:[{name:"ColoredShape",extends:["bpmndi:BPMNShape"],properties:[{name:"stroke",isAttr:!0,type:"String"},{name:"fill",isAttr:!0,type:"String"}]},{name:"ColoredEdge",extends:["bpmndi:BPMNEdge"],properties:[{name:"stroke",isAttr:!0,type:"String"},{name:"fill",isAttr:!0,type:"String"}]}],enumerations:[],associations:[]},color:{name:"BPMN in Color",uri:"http://www.omg.org/spec/BPMN/non-normative/color/1.0",prefix:"color",types:[{name:"ColoredLabel",extends:["bpmndi:BPMNLabel"],properties:[{name:"color",isAttr:!0,type:"String"}]},{name:"ColoredShape",extends:["bpmndi:BPMNShape"],properties:[{name:"background-color",isAttr:!0,type:"String"},{name:"border-color",isAttr:!0,type:"String"}]},{name:"ColoredEdge",extends:["bpmndi:BPMNEdge"],properties:[{name:"border-color",isAttr:!0,type:"String"}]}],enumerations:[],associations:[]}};function Or(e,t){return new _r(z({},Er,e),t)}function Pr(e){return e?"<"+e.$type+(e.id?' id="'+e.id:"")+'" />':""}function kr(e){v(e,"di")||Object.defineProperty(e,"di",{enumerable:!1,get:function(){throw new Error("Tried to access di from the businessObject. The di is available through the diagram element only. For more information, see https://github.com/bpmn-io/bpmn-js/issues/1472")}})}function Sr(e,t){return e.$instanceOf(t)}function Cr(e,t){var n={},i=[],r={};function o(e,t){return function(n){e(n,t)}}function s(e){n[e.id]=e}function a(n,i){try{var o=r[n.id]&&function(n,i){if(n.gfx)throw new Error(t("already rendered {element}",{element:Pr(n)}));return e.element(n,r[n.id],i)}(n,i);return s(n),o}catch(e){l(e.message,{element:n,error:e}),console.error(t("failed to import {element}",{element:Pr(n)})),console.error(e)}}function l(t,n){e.error(t,n)}var c=this.registerDi=function(e){var n=e.bpmnElement;n?r[n.id]?l(t("multiple DI elements defined for {element}",{element:Pr(n)}),{element:n}):(r[n.id]=e,kr(n)):l(t("no bpmnElement referenced in {element}",{element:Pr(e)}),{element:e})};function p(e){var t;t=e.plane,c(t),_(t.planeElement,u)}function u(e){c(e)}this.handleDefinitions=function(s,a){var u=s.diagrams;if(a&&-1===u.indexOf(a))throw new Error(t("diagram not part of bpmn:Definitions"));if(!a&&u&&u.length&&(a=u[0]),!a)throw new Error(t("no diagram to display"));r={},p(a);var m=a.plane;if(!m)throw new Error(t("no plane for {element}",{element:Pr(a)}));var g=m.bpmnElement;if(!g){if(g=function(e){return b(e.rootElements,(function(e){return Sr(e,"bpmn:Process")||Sr(e,"bpmn:Collaboration")}))}(s),!g)throw new Error(t("no process or collaboration to display"));l(t("correcting missing bpmnElement on {plane} to {rootElement}",{plane:Pr(m),rootElement:Pr(g)})),m.bpmnElement=g,c(m)}var y,v,E=function(t,n){return e.root(t,r[t.id],n)}(g,m);if(Sr(g,"bpmn:Process")||Sr(g,"bpmn:SubProcess"))h(g,E);else{if(!Sr(g,"bpmn:Collaboration"))throw new Error(t("unsupported bpmnElement for {plane}: {rootElement}",{plane:Pr(m),rootElement:Pr(g)}));v=E,_((y=g).participants,o(A,v)),x(y.artifacts,v),i.push((function(){!function(e,t){_(e,o(f,t))}(y.messageFlows,v)})),function(e,t){w(e,(function(e){return!n[e.id]&&Sr(e,"bpmn:Process")&&e.laneSets})).forEach(o(h,t))}(s.rootElements,E)}d(i)};var d=this.handleDeferred=function(){for(;i.length;)i.shift()()};function h(e,t){T(e,t),E(e.ioSpecification,t),x(e.artifacts,t),s(e)}function f(e,t){a(e,t)}function m(e,t){a(e,t)}function g(e,t){a(e,t)}function y(e,t){a(e,t)}function v(e,t){a(e,t)}function x(e,t){_(e,(function(e){Sr(e,"bpmn:Association")?i.push((function(){v(e,t)})):v(e,t)}))}function E(e,t){e&&(_(e.dataInputs,o(g,t)),_(e.dataOutputs,o(y,t)))}var O=this.handleSubProcess=function(e,t){T(e,t),x(e.artifacts,t)};function P(e,t){var n=a(e,t);Sr(e,"bpmn:SubProcess")&&O(e,n||t),Sr(e,"bpmn:Activity")&&E(e.ioSpecification,t),i.push((function(){_(e.dataInputAssociations,o(m,t)),_(e.dataOutputAssociations,o(m,t))}))}function k(e,t){a(e,t)}function S(e,t){i.push((function(){var n=a(e,t);e.childLaneSet&&C(e.childLaneSet,n||t),function(e){_(e.flowNodeRef,(function(t){var n=t.get("lanes");n&&n.push(e)}))}(e)}))}function C(e,t){_(e.lanes,o(S,t))}function T(e,n){!function(e,n){_(e,(function(e){Sr(e,"bpmn:SequenceFlow")?i.push((function(){!function(e,t){a(e,t)}(e,n)})):Sr(e,"bpmn:BoundaryEvent")?i.unshift((function(){P(e,n)})):Sr(e,"bpmn:FlowNode")?P(e,n):Sr(e,"bpmn:DataObject")||(Sr(e,"bpmn:DataStoreReference")||Sr(e,"bpmn:DataObjectReference")?k(e,n):l(t("unrecognized flowElement {element} in context {context}",{element:Pr(e),context:n?Pr(n.businessObject):"null"}),{element:e,context:n}))}))}(e.flowElements,n),e.laneSets&&function(e,t){_(e,o(C,t))}(e.laneSets,n)}function A(e,t){var n=a(e,t),i=e.processRef;i&&h(i,n||t)}}function Tr(e,t){var n=Mr(e);return n&&"function"==typeof n.$instanceOf&&n.$instanceOf(t)}function Ar(e,t){return k(t,(function(t){return Tr(e,t)}))}function Mr(e){return e&&e.businessObject||e}function Dr(e){return e&&e.di}function Rr(e,t,n){var i,r,o,s,a=[];function l(e,t){var n=new Cr({root:function(e,t){return i.add(e,t)},element:function(e,t,n){return i.add(e,t,n)},error:function(e,t){a.push({message:e,context:t})}},o);t=t||e.diagrams&&e.diagrams[0];var r=function(e,t){if(!t)return;var n,i=t.plane.bpmnElement,r=i;Tr(i,"bpmn:Process")||Tr(i,"bpmn:Collaboration")||(r=function(e){var t=e;for(;t;){if(Tr(t,"bpmn:Process"))return t;t=t.$parent}}(i));n=Tr(r,"bpmn:Collaboration")?r:b(e.rootElements,(function(e){if(Tr(e,"bpmn:Collaboration"))return b(e.participants,(function(e){return e.processRef===r}))}));var o=[r];n&&(o=S(n.participants,(function(e){return e.processRef}))).push(n);var s=Nr(o),a=[t],l=[i];return _(e.diagrams,(function(e){var t=e.plane.bpmnElement;-1!==s.indexOf(t)&&-1===l.indexOf(t)&&(a.push(e),l.push(t))})),a}(e,t);if(!r)throw new Error(o("no diagram to display"));_(r,(function(t){n.handleDefinitions(e,t)}));var l=t.plane.bpmnElement.id;s.setRootElement(s.findRoot(l+"_plane")||s.findRoot(l))}return new Promise((function(c,p){try{return i=e.get("bpmnImporter"),r=e.get("eventBus"),o=e.get("translate"),s=e.get("canvas"),r.fire("import.render.start",{definitions:t}),l(t,n),r.fire("import.render.complete",{error:undefined,warnings:a}),c({warnings:a})}catch(e){return e.warnings=a,p(e)}}))}function Nr(e){var t=[];return _(e,(function(e){e&&(t.push(e),t=t.concat(Nr(e.flowElements)))})),t}var $r,jr=' ',Ir={verticalAlign:"middle"},Lr={color:"#404040"},Br={zIndex:"1001",position:"fixed",top:"0",left:"0",right:"0",bottom:"0"},qr={width:"100%",height:"100%",background:"rgba(40,40,40,0.2)"},zr={position:"absolute",left:"50%",top:"40%",transform:"translate(-50%)",width:"260px",padding:"10px",background:"white",boxShadow:"0 1px 4px rgba(0,0,0,0.3)",fontFamily:"Helvetica, Arial, sans-serif",fontSize:"14px",display:"flex",lineHeight:"1.3"},Fr='
'+jr+' Web-based tooling for BPMN, DMN and forms powered by bpmn.io . ';function Vr(){$r||(Z($r=be(Fr),Br),Z(we("svg",$r),Ir),Z(we(".backdrop",$r),qr),Z(we(".notice",$r),zr),Z(we(".link",$r),Lr,{margin:"15px 20px 15px 10px",alignSelf:"center"}),me.bind($r,".backdrop","click",(function(e){document.body.removeChild($r)}))),document.body.appendChild($r)}function Hr(e){e=z({},Wr,e),this._moddle=this._createModdle(e),this._container=this._createContainer(e),function(e){const t=be(''+jr+" ");Z(we("svg",t),Ir),Z(t,Lr,{position:"absolute",bottom:"15px",right:"15px",zIndex:"100"}),e.appendChild(t),de.bind(t,"click",(function(e){Vr(),e.preventDefault()}))}(this._container),this._init(this._container,this._moddle,e)}function Ur(e,t){return e.warnings=t,e}i(Hr,ci),Hr.prototype.importXML=async function(e,t){const n=this;let i=[];try{let o;e=this._emit("import.parse.start",{xml:e})||e;try{o=await this._moddle.fromXML(e,"bpmn:Definitions")}catch(e){throw this._emit("import.parse.complete",{error:e}),e}let s=o.rootElement;const a=o.references,l=o.warnings,c=o.elementsById;i=i.concat(l),s=this._emit("import.parse.complete",(r={error:null,definitions:s,elementsById:c,references:a,warnings:i},n.get("eventBus").createEvent(r)))||s;const p=await this.importDefinitions(s,t);return i=i.concat(p.warnings),this._emit("import.done",{error:null,warnings:i}),{warnings:i}}catch(e){let t=e;throw i=i.concat(t.warnings||[]),Ur(t,i),t=function(e){const t=/unparsable content <([^>]+)> detected([\s\S]*)$/.exec(e.message);t&&(e.message="unparsable content <"+t[1]+"> detected; this may indicate an invalid BPMN 2.0 diagram file"+t[2]);return e}(t),this._emit("import.done",{error:t,warnings:t.warnings}),t}var r},Hr.prototype.importDefinitions=async function(e,t){this._setDefinitions(e);return{warnings:(await this.open(t)).warnings}},Hr.prototype.open=async function(e){const t=this._definitions;let n=e;if(!t){const e=new Error("no XML imported");throw Ur(e,[]),e}if("string"==typeof e&&(n=function(e,t){if(!t)return null;return b(e.diagrams,(function(e){return e.id===t}))||null}(t,e),!n)){const t=new Error("BPMNDiagram <"+e+"> not found");throw Ur(t,[]),t}try{this.clear()}catch(e){throw Ur(e,[]),e}const{warnings:i}=await Rr(this,t,n);return{warnings:i}},Hr.prototype.saveXML=async function(e){e=e||{};let t,n,i=this._definitions;try{if(!i)throw new Error("no definitions loaded");i=this._emit("saveXML.start",{definitions:i})||i;n=(await this._moddle.toXML(i,e)).xml,n=this._emit("saveXML.serialized",{xml:n})||n}catch(e){t=e}const r=t?{error:t}:{xml:n};if(this._emit("saveXML.done",r),t)throw t;return r},Hr.prototype.saveSVG=async function(){let e,t;this._emit("saveSVG.start");try{const t=this.get("canvas"),n=t.getActiveLayer(),i=we("defs",t._svg),r=Xe(n),o=i?""+Xe(i)+" ":"",s=n.getBBox();e='\n\x3c!-- created with bpmn-js / http://bpmn.io --\x3e\n\n'+o+r+" "}catch(e){t=e}if(this._emit("saveSVG.done",{error:t,svg:e}),t)throw t;return{svg:e}},Hr.prototype._setDefinitions=function(e){this._definitions=e},Hr.prototype.getModules=function(){return this._modules},Hr.prototype.clear=function(){this.getDefinitions()&&ci.prototype.clear.call(this)},Hr.prototype.destroy=function(){ci.prototype.destroy.call(this),Ee(this._container)},Hr.prototype.on=function(e,t,n,i){return this.get("eventBus").on(e,t,n,i)},Hr.prototype.off=function(e,t){this.get("eventBus").off(e,t)},Hr.prototype.attachTo=function(e){if(!e)throw new Error("parentNode required");this.detach(),e.get&&e.constructor.prototype.jquery&&(e=e.get(0)),"string"==typeof e&&(e=we(e)),e.appendChild(this._container),this._emit("attach",{}),this.get("canvas").resized()},Hr.prototype.getDefinitions=function(){return this._definitions},Hr.prototype.detach=function(){const e=this._container,t=e.parentNode;t&&(this._emit("detach",{}),t.removeChild(e))},Hr.prototype._init=function(e,t,n){const i=n.modules||this.getModules(n),r=n.additionalModules||[],o=[].concat([{bpmnjs:["value",this],moddle:["value",t]}],i,r),s=z(H(n,["additionalModules"]),{canvas:z({},n.canvas,{container:e}),modules:o});ci.call(this,s),n&&n.container&&this.attachTo(n.container)},Hr.prototype._emit=function(e,t){return this.get("eventBus").fire(e,t)},Hr.prototype._createContainer=function(e){const t=be('
');return Z(t,{width:Gr(e.width),height:Gr(e.height),position:e.position}),t},Hr.prototype._createModdle=function(e){return new Or(z({},this._moddleExtensions,e.moddleExtensions))},Hr.prototype._modules=[];const Wr={width:"100%",height:"100%",position:"relative"};function Gr(e){return e+(m(e)?"px":"")}function Qr(e){Hr.call(this,e),this.on("import.parse.complete",(function(e){e.error||this._collectIds(e.definitions,e.elementsById)}),this),this.on("diagram.destroy",(function(){this.get("moddle").ids.clear()}),this)}function Xr(e,t){return!Tr(e,"bpmn:CallActivity")&&(Tr(e,"bpmn:SubProcess")?!(!(t=t||Dr(e))||!Tr(t,"bpmndi:BPMNPlane"))||t&&!!t.isExpanded:!Tr(e,"bpmn:Participant")||!!Mr(e).processRef)}function Kr(e){if(Tr(e,"bpmn:Participant")||Tr(e,"bpmn:Lane")){var t=Dr(e).isHorizontal;return void 0===t||t}}function Yr(e){return e&&!!Mr(e).triggeredByEvent}function Zr(e,t){return k(Mr(e).eventDefinitions,(function(e){return Tr(e,t)}))}i(Qr,Hr),Qr.prototype._createModdle=function(e){var t=Hr.prototype._createModdle.call(this,e);return t.ids=new s([32,36,1]),t},Qr.prototype._collectIds=function(e,t){var n,i=e.$model.ids;for(n in i.clear(),t)i.claim(n,t[n])};var Jr={width:90,height:20};function eo(e){return Tr(e,"bpmn:Event")||Tr(e,"bpmn:Gateway")||Tr(e,"bpmn:DataStoreReference")||Tr(e,"bpmn:DataObjectReference")||Tr(e,"bpmn:DataInput")||Tr(e,"bpmn:DataOutput")||Tr(e,"bpmn:SequenceFlow")||Tr(e,"bpmn:MessageFlow")||Tr(e,"bpmn:Group")}function to(e){return vn(e.label)}function no(e){var t=e.length/2-1,n=e[Math.floor(t)],i=e[Math.ceil(t+.01)],r=function(e){var t=e.length/2-1,n=e[Math.floor(t)],i=e[Math.ceil(t+.01)];return{x:n.x+(i.x-n.x)/2,y:n.y+(i.y-n.y)/2}}(e),o=Math.atan((i.y-n.y)/(i.x-n.x)),s=r.x,a=r.y;return Math.abs(o)1?r.get("parallelMultiple")?I(t,e,n,o):j(t,e,n,o):ao(r,"bpmn:MessageEventDefinition")?S(t,e,n,o):ao(r,"bpmn:TimerEventDefinition")?C(t,e,n,o):ao(r,"bpmn:ConditionalEventDefinition")?A(t,e,n,o):ao(r,"bpmn:SignalEventDefinition")?$(t,e,n,o):ao(r,"bpmn:EscalationEventDefinition")?T(t,e,n,o):ao(r,"bpmn:LinkEventDefinition")?M(t,e,n,o):ao(r,"bpmn:ErrorEventDefinition")?D(t,e,n,o):ao(r,"bpmn:CancelEventDefinition")?R(t,e,n,o):ao(r,"bpmn:CompensateEventDefinition")?N(t,e,n,o):ao(r,"bpmn:TerminateEventDefinition")?L(t,e,n,o):null}var q={ParticipantMultiplicityMarker:function(e,t,n={}){var r=ho(t,n),o=fo(t,n);O("participant-multiplicity",e,i.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:r,containerHeight:o,position:{mx:(r/2-6)/r,my:(o-15)/o}}),{strokeWidth:2,fill:lo(t,a,n.fill),stroke:co(t,l,n.stroke)})},SubProcessMarker:function(e,t,n={}){ii(b(e,14,14,0,{strokeWidth:1,fill:lo(t,a,n.fill),stroke:co(t,l,n.stroke)}),t.width/2-7.5,t.height-20),O("sub-process",e,i.getScaledPath("MARKER_SUB_PROCESS",{xScaleFactor:1.5,yScaleFactor:1.5,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2-7.5)/t.width,my:(t.height-20)/t.height}}),{fill:lo(t,a,n.fill),stroke:co(t,l,n.stroke)})},ParallelMarker:function(e,t,n){var r=ho(t,n),o=fo(t,n);O("parallel",e,i.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:r,containerHeight:o,position:{mx:(r/2+n.parallel)/r,my:(o-20)/o}}),{fill:lo(t,a,n.fill),stroke:co(t,l,n.stroke)})},SequentialMarker:function(e,t,n){O("sequential",e,i.getScaledPath("MARKER_SEQUENTIAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2+n.seq)/t.width,my:(t.height-19)/t.height}}),{fill:lo(t,a,n.fill),stroke:co(t,l,n.stroke)})},CompensationMarker:function(e,t,n){O("compensation",e,i.getScaledPath("MARKER_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2+n.compensation)/t.width,my:(t.height-13)/t.height}}),{strokeWidth:1,fill:lo(t,a,n.fill),stroke:co(t,l,n.stroke)})},LoopMarker:function(e,t,n){var r=ho(t,n),o=fo(t,n);O("loop",e,i.getScaledPath("MARKER_LOOP",{xScaleFactor:1,yScaleFactor:1,containerWidth:r,containerHeight:o,position:{mx:(r/2+n.loop)/r,my:(o-7)/o}}),{strokeWidth:1.5,fill:"none",stroke:co(t,l,n.stroke),strokeMiterlimit:.5})},AdhocMarker:function(e,t,n){var r=ho(t,n),o=fo(t,n);O("adhoc",e,i.getScaledPath("MARKER_ADHOC",{xScaleFactor:1,yScaleFactor:1,containerWidth:r,containerHeight:o,position:{mx:(r/2+n.adhoc)/r,my:(o-15)/o}}),{strokeWidth:1,fill:co(t,l,n.stroke),stroke:co(t,l,n.stroke)})}};function F(e,t,n,i){q[e](t,n,i)}function V(e,t,n,i={}){i={fill:i.fill,stroke:i.stroke,width:ho(t,i),height:fo(t,i)};var r=Mr(t),o=n&&n.includes("SubProcessMarker");i=o?{...i,seq:-21,parallel:-22,compensation:-42,loop:-18,adhoc:10}:{...i,seq:-5,parallel:-6,compensation:-27,loop:0,adhoc:10},_(n,(function(n){F(n,e,t,i)})),r.get("isForCompensation")&&F("CompensationMarker",e,t,i),Tr(r,"bpmn:AdHocSubProcess")&&F("AdhocMarker",e,t,i);var s=r.get("loopCharacteristics"),a=s&&s.get("isSequential");s&&(void 0===a&&F("LoopMarker",e,t,i),!1===a&&F("ParallelMarker",e,t,i),!0===a&&F("SequentialMarker",e,t,i))}function H(e,t,n={}){n=z({size:{width:100}},n);var i=o.createText(t||"",n);return Me(i).add("djs-label"),ke(e,i),i}function U(e,t,n,i={}){var r=Mr(t),o=uo({x:t.x,y:t.y,width:t.width,height:t.height},i);return H(e,r.name,{align:n,box:o,padding:7,style:{fill:po(t,c,l,i.stroke)}})}function W(e,t,n,i={}){var r=Kr(n),o=H(e,t,{box:{height:30,width:r?fo(n,i):ho(n,i)},align:"center-middle",style:{fill:po(n,c,l,i.stroke)}});r&&ni(o,0,-(-1*fo(n,i)),270)}function G(e,t,n={}){var{width:i,height:r}=uo(t,n);return b(e,i,r,10,{...n,fill:lo(t,a,n.fill),fillOpacity:go,stroke:co(t,l,n.stroke)})}function Q(e,t,n={}){var i=Mr(t),r=lo(t,a,n.fill),o=co(t,l,n.stroke);return"One"!==i.get("associationDirection")&&"Both"!==i.get("associationDirection")||(n.markerEnd=y("association-end",r,o)),"Both"===i.get("associationDirection")&&(n.markerStart=y("association-start",r,o)),n=vo(n,["markerStart","markerEnd"]),w(e,t.waypoints,{...n,stroke:o,strokeDasharray:"0, 5"})}function X(e,t,n={}){var r=lo(t,a,n.fill),o=co(t,l,n.stroke),s=E(e,i.getScaledPath("DATA_OBJECT_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.474,my:.296}}),{fill:r,fillOpacity:go,stroke:o});(function(e){var t=e.dataObjectRef;return e.isCollection||t&&t.isCollection})(Mr(t))&&E(e,i.getScaledPath("DATA_OBJECT_COLLECTION_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.33,my:(t.height-18)/t.height}}),{strokeWidth:2,fill:r,stroke:o});return s}function K(e,t,n={}){return v(e,t.width,t.height,{fillOpacity:go,...n,fill:lo(t,a,n.fill),stroke:co(t,l,n.stroke)})}function Y(e,t,n={}){return function(e,t,n,i){var r=t/2,o=n/2,s=[{x:r,y:0},{x:t,y:o},{x:r,y:n},{x:0,y:o}].map((function(e){return e.x+","+e.y})).join(" ");i=d(i);var a=Le("polygon",{...i,points:s});return ke(e,a),a}(e,t.width,t.height,{fill:lo(t,a,n.fill),fillOpacity:go,stroke:co(t,l,n.stroke)})}function Z(e,t,n={}){var i=b(e,ho(t,n),fo(t,n),0,{fill:lo(t,a,n.fill),fillOpacity:n.fillOpacity||go,stroke:co(t,l,n.stroke),strokeWidth:1.5}),r=Mr(t);Tr(r,"bpmn:Lane")&&W(e,r.get("name"),t,n);return i}function J(e,t,n={}){var i=G(e,t,n);Yr(t)&&Te(i,{strokeDasharray:"0, 5.5",strokeWidth:2.5});var r=Xr(t);return U(e,t,r?"center-top":"center-middle",n),V(e,t,r?void 0:["SubProcessMarker"],n),i}function ee(e,t,n={}){var i=G(e,t,n);return U(e,t,"center-middle",n),V(e,t,void 0,n),i}var te=this.handlers={"bpmn:AdHocSubProcess":function(e,t,n={}){return J(e,t,n=Xr(t)?vo(n,["fill","stroke","width","height"]):vo(n,["fill","stroke"]))},"bpmn:Association":function(e,t,n={}){return Q(e,t,n=vo(n,["fill","stroke"]))},"bpmn:BoundaryEvent":function(e,t,n={}){var{renderIcon:i=!0}=n;n=vo(n,["fill","stroke"]);var r=Mr(t).get("cancelActivity");n={strokeWidth:1.5,fill:lo(t,a,n.fill),fillOpacity:1,stroke:co(t,l,n.stroke)},r||(n.strokeDasharray="6");var o=K(e,t,n);return v(e,t.width,t.height,3,{...n,fill:"none"}),i&&B(t,e,n),o},"bpmn:BusinessRuleTask":function(e,t,n={}){var r=ee(e,t,n=vo(n,["fill","stroke"]));return Te(E(e,i.getScaledPath("TASK_TYPE_BUSINESS_RULE_MAIN",{abspos:{x:8,y:8}})),{fill:lo(t,a,n.fill),stroke:co(t,l,n.stroke),strokeWidth:1}),Te(E(e,i.getScaledPath("TASK_TYPE_BUSINESS_RULE_HEADER",{abspos:{x:8,y:8}})),{fill:co(t,l,n.stroke),stroke:co(t,l,n.stroke),strokeWidth:1}),r},"bpmn:CallActivity":function(e,t,n={}){return n=vo(n,["fill","stroke"]),J(e,t,{strokeWidth:5,...n})},"bpmn:ComplexGateway":function(e,t,n={}){var r=Y(e,t,n=vo(n,["fill","stroke"]));return E(e,i.getScaledPath("GATEWAY_COMPLEX",{xScaleFactor:.5,yScaleFactor:.5,containerWidth:t.width,containerHeight:t.height,position:{mx:.46,my:.26}}),{fill:co(t,l,n.stroke),stroke:co(t,l,n.stroke),strokeWidth:1}),r},"bpmn:DataInput":function(e,t,n={}){n=vo(n,["fill","stroke"]);var r=i.getRawPath("DATA_ARROW"),o=X(e,t,n);return E(e,r,{fill:"none",stroke:co(t,l,n.stroke),strokeWidth:1}),o},"bpmn:DataInputAssociation":function(e,t,n={}){return n=vo(n,["fill","stroke"]),Q(e,t,{...n,markerEnd:y("association-end",lo(t,a,n.fill),co(t,l,n.stroke))})},"bpmn:DataObject":function(e,t,n={}){return X(e,t,n=vo(n,["fill","stroke"]))},"bpmn:DataObjectReference":k("bpmn:DataObject"),"bpmn:DataOutput":function(e,t,n={}){n=vo(n,["fill","stroke"]);var r=i.getRawPath("DATA_ARROW"),o=X(e,t,n);return E(e,r,{strokeWidth:1,fill:lo(t,a,n.fill),stroke:co(t,l,n.stroke)}),o},"bpmn:DataOutputAssociation":function(e,t,n={}){return n=vo(n,["fill","stroke"]),Q(e,t,{...n,markerEnd:y("association-end",lo(t,a,n.fill),co(t,l,n.stroke))})},"bpmn:DataStoreReference":function(e,t,n={}){return n=vo(n,["fill","stroke"]),E(e,i.getScaledPath("DATA_STORE",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:0,my:.133}}),{fill:lo(t,a,n.fill),fillOpacity:go,stroke:co(t,l,n.stroke),strokeWidth:2})},"bpmn:EndEvent":function(e,t,n={}){var{renderIcon:i=!0}=n;n=vo(n,["fill","stroke"]);var r=K(e,t,{...n,strokeWidth:4});return i&&B(t,e,n),r},"bpmn:EventBasedGateway":function(e,t,n={}){n=vo(n,["fill","stroke"]);var r=Mr(t),o=Y(e,t,n);v(e,t.width,t.height,.2*t.height,{fill:lo(t,"none",n.fill),stroke:co(t,l,n.stroke),strokeWidth:1});var s=r.get("eventGatewayType"),a=!!r.get("instantiate");if("Parallel"===s){var c=i.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:t.width,containerHeight:t.height,position:{mx:.474,my:.296}});E(e,c,{fill:"none",stroke:co(t,l,n.stroke),strokeWidth:1})}else"Exclusive"===s&&(a||v(e,t.width,t.height,.26*t.height,{fill:"none",stroke:co(t,l,n.stroke),strokeWidth:1}),function(){var r=i.getScaledPath("GATEWAY_EVENT_BASED",{xScaleFactor:.18,yScaleFactor:.18,containerWidth:t.width,containerHeight:t.height,position:{mx:.36,my:.44}});E(e,r,{fill:"none",stroke:co(t,l,n.stroke),strokeWidth:2})}());return o},"bpmn:ExclusiveGateway":function(e,t,n={}){var r=Y(e,t,n=vo(n,["fill","stroke"])),o=i.getScaledPath("GATEWAY_EXCLUSIVE",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:t.width,containerHeight:t.height,position:{mx:.32,my:.3}});return Dr(t).get("isMarkerVisible")&&E(e,o,{fill:co(t,l,n.stroke),stroke:co(t,l,n.stroke),strokeWidth:1}),r},"bpmn:Gateway":function(e,t,n={}){return Y(e,t,n=vo(n,["fill","stroke"]))},"bpmn:Group":function(e,t,n={}){return n=vo(n,["fill","stroke","width","height"]),b(e,t.width,t.height,10,{stroke:co(t,l,n.stroke),strokeWidth:1.5,strokeDasharray:"10, 6, 0, 6",fill:"none",pointerEvents:"none",width:ho(t,n),height:fo(t,n)})},"bpmn:InclusiveGateway":function(e,t,n={}){var i=Y(e,t,n=vo(n,["fill","stroke"]));return v(e,t.width,t.height,.24*t.height,{fill:lo(t,a,n.fill),stroke:co(t,l,n.stroke),strokeWidth:2.5}),i},"bpmn:IntermediateEvent":function(e,t,n={}){var{renderIcon:i=!0}=n;n=vo(n,["fill","stroke"]);var r=K(e,t,{...n,strokeWidth:1.5});return v(e,t.width,t.height,3,{fill:"none",stroke:co(t,l,n.stroke),strokeWidth:1.5}),i&&B(t,e,n),r},"bpmn:IntermediateCatchEvent":k("bpmn:IntermediateEvent"),"bpmn:IntermediateThrowEvent":k("bpmn:IntermediateEvent"),"bpmn:Lane":function(e,t,n={}){return n=vo(n,["fill","stroke","width","height"]),Z(e,t,{...n,fillOpacity:.25})},"bpmn:ManualTask":function(e,t,n={}){var r=ee(e,t,n=vo(n,["fill","stroke"]));return E(e,i.getScaledPath("TASK_TYPE_MANUAL",{abspos:{x:17,y:15}}),{fill:lo(t,a,n.fill),stroke:co(t,l,n.stroke),strokeWidth:.5}),r},"bpmn:MessageFlow":function(e,t,n={}){n=vo(n,["fill","stroke"]);var r=Mr(t),o=Dr(t),s=lo(t,a,n.fill),c=co(t,l,n.stroke),p=w(e,t.waypoints,{markerEnd:y("messageflow-end",s,c),markerStart:y("messageflow-start",s,c),stroke:c,strokeDasharray:"10, 11",strokeWidth:1.5});if(r.get("messageRef")){var u=p.getPointAtLength(p.getTotalLength()/2),d=i.getScaledPath("MESSAGE_FLOW_MARKER",{abspos:{x:u.x,y:u.y}}),h={strokeWidth:1};"initiating"===o.get("messageVisibleKind")?(h.fill=s,h.stroke=c):(h.fill=c,h.stroke=s);var f=E(e,d,h),m=H(e,r.get("messageRef").get("name"),{align:"center-top",fitBox:!0,style:{fill:c}}),g=f.getBBox(),v=m.getBBox();ni(m,u.x-v.width/2,u.y+g.height/2+10,0)}return p},"bpmn:ParallelGateway":function(e,t,n={}){var r=Y(e,t,n=vo(n,["fill","stroke"]));return E(e,i.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.6,yScaleFactor:.6,containerWidth:t.width,containerHeight:t.height,position:{mx:.46,my:.2}}),{fill:co(t,l,n.stroke),stroke:co(t,l,n.stroke),strokeWidth:1}),r},"bpmn:Participant":function(e,t,n={}){var i=Z(e,t,n=vo(n,["fill","stroke","width","height"])),r=Xr(t),o=Kr(t),s=Mr(t),a=s.get("name");if(r){x(e,o?[{x:30,y:0},{x:30,y:fo(t,n)}]:[{x:0,y:30},{x:ho(t,n),y:30}],{stroke:co(t,l,n.stroke),strokeWidth:1.5}),W(e,a,t,n)}else{var p=uo(t,n);o||(p.height=ho(t,n),p.width=fo(t,n));var u=H(e,a,{box:p,align:"center-middle",style:{fill:po(t,c,l,n.stroke)}});if(!o)ni(u,0,-(-1*fo(t,n)),270)}return s.get("participantMultiplicity")&&F("ParticipantMultiplicityMarker",e,t,n),i},"bpmn:ReceiveTask":function(e,t,n={}){n=vo(n,["fill","stroke"]);var r,o=Mr(t),s=ee(e,t,n);return o.get("instantiate")?(v(e,28,28,4.4,{fill:lo(t,a,n.fill),stroke:co(t,l,n.stroke),strokeWidth:1}),r=i.getScaledPath("TASK_TYPE_INSTANTIATING_SEND",{abspos:{x:7.77,y:9.52}})):r=i.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:21,containerHeight:14,position:{mx:.3,my:.4}}),E(e,r,{fill:lo(t,a,n.fill),stroke:co(t,l,n.stroke),strokeWidth:1}),s},"bpmn:ScriptTask":function(e,t,n={}){var r=ee(e,t,n=vo(n,["fill","stroke"]));return E(e,i.getScaledPath("TASK_TYPE_SCRIPT",{abspos:{x:15,y:20}}),{fill:lo(t,a,n.fill),stroke:co(t,l,n.stroke),strokeWidth:1}),r},"bpmn:SendTask":function(e,t,n={}){var r=ee(e,t,n=vo(n,["fill","stroke"]));return E(e,i.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:1,yScaleFactor:1,containerWidth:21,containerHeight:14,position:{mx:.285,my:.357}}),{fill:co(t,l,n.stroke),stroke:lo(t,a,n.fill),strokeWidth:1}),r},"bpmn:SequenceFlow":function(e,t,n={}){n=vo(n,["fill","stroke"]);var i=lo(t,a,n.fill),r=co(t,l,n.stroke),o=w(e,t.waypoints,{markerEnd:y("sequenceflow-end",i,r),stroke:r}),s=Mr(t),{source:c}=t;if(c){var p=Mr(c);s.get("conditionExpression")&&Tr(p,"bpmn:Activity")&&Te(o,{markerStart:y("conditional-flow-marker",i,r)}),p.get("default")&&(Tr(p,"bpmn:Gateway")||Tr(p,"bpmn:Activity"))&&p.get("default")===s&&Te(o,{markerStart:y("conditional-default-flow-marker",i,r)})}return o},"bpmn:ServiceTask":function(e,t,n={}){var r=ee(e,t,n=vo(n,["fill","stroke"]));return v(e,10,10,{fill:lo(t,a,n.fill),stroke:"none",transform:"translate(6, 6)"}),E(e,i.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:12,y:18}}),{fill:lo(t,a,n.fill),stroke:co(t,l,n.stroke),strokeWidth:1}),v(e,10,10,{fill:lo(t,a,n.fill),stroke:"none",transform:"translate(11, 10)"}),E(e,i.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:17,y:22}}),{fill:lo(t,a,n.fill),stroke:co(t,l,n.stroke),strokeWidth:1}),r},"bpmn:StartEvent":function(e,t,n={}){var{renderIcon:i=!0}=n;n=vo(n,["fill","stroke"]),Mr(t).get("isInterrupting")||(n={...n,strokeDasharray:"6"});var r=K(e,t,n);return i&&B(t,e,n),r},"bpmn:SubProcess":function(e,t,n={}){return J(e,t,n=Xr(t)?vo(n,["fill","stroke","width","height"]):vo(n,["fill","stroke"]))},"bpmn:Task":function(e,t,n={}){return ee(e,t,n=vo(n,["fill","stroke"]))},"bpmn:TextAnnotation":function(e,t,n={}){n=vo(n,["fill","stroke","width","height"]);var{width:r,height:o}=uo(t,n),s=b(e,r,o,0,0,{fill:"none",stroke:"none"});return E(e,i.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:r,containerHeight:o,position:{mx:0,my:0}}),{stroke:co(t,l,n.stroke)}),H(e,Mr(t).get("text")||"",{align:"left-top",box:uo(t,n),padding:7,style:{fill:po(t,c,l,n.stroke)}}),s},"bpmn:Transaction":function(e,t,i={}){i=Xr(t)?vo(i,["fill","stroke","width","height"]):vo(i,["fill","stroke"]);var r=J(e,t,{strokeWidth:1.5,...i}),o=n.style(["no-fill","no-events"],{stroke:co(t,l,i.stroke),strokeWidth:1.5});return Xr(t)||(i={}),b(e,ho(t,i),fo(t,i),7,3,o),r},"bpmn:UserTask":function(e,t,n={}){var r=ee(e,t,n=vo(n,["fill","stroke"]));return E(e,i.getScaledPath("TASK_TYPE_USER_1",{abspos:{x:15,y:12}}),{fill:lo(t,a,n.fill),stroke:co(t,l,n.stroke),strokeWidth:.5}),E(e,i.getScaledPath("TASK_TYPE_USER_2",{abspos:{x:15,y:12}}),{fill:lo(t,a,n.fill),stroke:co(t,l,n.stroke),strokeWidth:.5}),E(e,i.getScaledPath("TASK_TYPE_USER_3",{abspos:{x:15,y:12}}),{fill:co(t,l,n.stroke),stroke:co(t,l,n.stroke),strokeWidth:.5}),r},label:function(e,t,n={}){return function(e,t,n={}){var i={width:90,height:30,x:t.width/2+t.x,y:t.height/2+t.y};return H(e,oo(t),{box:i,fitBox:!0,style:z({},o.getExternalStyle(),{fill:po(t,c,l,n.stroke)})})}(e,t,n)}};this._drawPath=E,this._renderer=P}function vo(e,t=[]){return t.reduce(((t,n)=>(e[n]&&(t[n]=e[n]),t)),{})}i(yo,ct),yo.$inject=["config.bpmnRenderer","eventBus","styles","pathMap","canvas","textRenderer"],yo.prototype.canRender=function(e){return Tr(e,"bpmn:BaseElement")},yo.prototype.drawShape=function(e,t,n={}){var{type:i}=t;return this._renderer(i)(e,t,n)},yo.prototype.drawConnection=function(e,t,n={}){var{type:i}=t;return this._renderer(i)(e,t,n)},yo.prototype.getShapePath=function(e){return Tr(e,"bpmn:Event")?(n=(t=e).x+t.width/2,i=t.y+t.height/2,r=t.width/2,pt([["M",n,i],["m",0,-r],["a",r,r,0,1,1,0,2*r],["a",r,r,0,1,1,0,-2*r],["z"]])):Tr(e,"bpmn:Activity")?function(e,t){var n=e.x,i=e.y,r=e.width,o=e.height;return pt([["M",n+t,i],["l",r-2*t,0],["a",t,t,0,0,1,t,t],["l",0,o-2*t],["a",t,t,0,0,1,-t,t],["l",2*t-r,0],["a",t,t,0,0,1,-t,-t],["l",0,2*t-o],["a",t,t,0,0,1,t,-t],["z"]])}(e,10):Tr(e,"bpmn:Gateway")?function(e){var t=e.width/2,n=e.height/2;return pt([["M",e.x+t,e.y],["l",t,n],["l",-t,n],["l",-t,-n],["z"]])}(e):function(e){var t=e.x,n=e.y,i=e.width;return pt([["M",t,n],["l",i,0],["l",0,e.height],["l",-i,0],["z"]])}(e);var t,n,i,r};var bo={width:150,height:50};function xo(e,t){var n;t.textContent=e;try{var i,r=""===e;return t.textContent=r?"dummy":e,i={width:(n=t.getBBox()).width+2*n.x,height:n.height},r&&(i.width=0),i}catch(e){return{width:0,height:0}}}function wo(e,t,n){for(var i,r=e.shift(),o=r;;){if((i=xo(o,n)).width=o?i.width:0," "===o||""===o||i.width1)for(;n=i.shift();){if(!(n.length+oe?t.width:e}),0),m=o.top;"middle"===r.vertical&&(m+=(n.height-d)/2),m-=(a||c[0].height)/4;var g=Le("text");return Te(g,i),_(c,(function(e){var t;switch(m+=a||e.height,r.horizontal){case"left":t=o.left;break;case"right":t=(s?h:p)-o.right-e.width;break;default:t=Math.max(((s?h:p)-e.width)/2+o.left,0)}var n=Le("tspan");Te(n,{x:t,y:m}),n.textContent=e.text,ke(g,n)})),Ke(u),{dimensions:{width:h,height:d},element:g}};function ko(e){var t=z({fontFamily:"Arial, sans-serif",fontSize:12,fontWeight:"normal",lineHeight:1.2},e&&e.defaultStyle||{}),n=parseInt(t.fontSize,10)-1,i=z({},t,{fontSize:n},e&&e.externalStyle||{}),r=new Po({style:t});this.getExternalLabelBounds=function(e,t){var n=r.getDimensions(t,{box:{width:90,height:30},style:i});return{x:Math.round(e.x+e.width/2-n.width/2),y:Math.round(e.y),width:Math.ceil(n.width),height:Math.ceil(n.height)}},this.getTextAnnotationBounds=function(e,n){var i=r.getDimensions(n,{box:e,style:t,align:"left-top",padding:5});return{x:e.x,y:e.y,width:e.width,height:Math.max(30,Math.round(i.height))}},this.createText=function(e,t){return r.createText(e,t||{})},this.getDefaultStyle=function(){return t},this.getExternalStyle=function(){return i}}ko.$inject=["config.textRenderer"];var So=/\{([^{}]+)\}/g,Co=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g;const To={__init__:["bpmnRenderer"],bpmnRenderer:["type",yo],textRenderer:["type",ko],pathMap:["type",function(){this.pathMap={EVENT_MESSAGE:{d:"m {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}",height:36,width:36,heightElements:[6,14],widthElements:[10.5,21]},EVENT_SIGNAL:{d:"M {mx},{my} l {e.x0},{e.y0} l -{e.x1},0 Z",height:36,width:36,heightElements:[18],widthElements:[10,20]},EVENT_ESCALATION:{d:"M {mx},{my} l {e.x0},{e.y0} l -{e.x0},-{e.y1} l -{e.x0},{e.y1} Z",height:36,width:36,heightElements:[20,7],widthElements:[8]},EVENT_CONDITIONAL:{d:"M {e.x0},{e.y0} l {e.x1},0 l 0,{e.y2} l -{e.x1},0 Z M {e.x2},{e.y3} l {e.x0},0 M {e.x2},{e.y4} l {e.x0},0 M {e.x2},{e.y5} l {e.x0},0 M {e.x2},{e.y6} l {e.x0},0 M {e.x2},{e.y7} l {e.x0},0 M {e.x2},{e.y8} l {e.x0},0 ",height:36,width:36,heightElements:[8.5,14.5,18,11.5,14.5,17.5,20.5,23.5,26.5],widthElements:[10.5,14.5,12.5]},EVENT_LINK:{d:"m {mx},{my} 0,{e.y0} -{e.x1},0 0,{e.y1} {e.x1},0 0,{e.y0} {e.x0},-{e.y2} -{e.x0},-{e.y2} z",height:36,width:36,heightElements:[4.4375,6.75,7.8125],widthElements:[9.84375,13.5]},EVENT_ERROR:{d:"m {mx},{my} {e.x0},-{e.y0} {e.x1},-{e.y1} {e.x2},{e.y2} {e.x3},-{e.y3} -{e.x4},{e.y4} -{e.x5},-{e.y5} z",height:36,width:36,heightElements:[.023,8.737,8.151,16.564,10.591,8.714],widthElements:[.085,6.672,6.97,4.273,5.337,6.636]},EVENT_CANCEL_45:{d:"m {mx},{my} -{e.x1},0 0,{e.x0} {e.x1},0 0,{e.y1} {e.x0},0 0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z",height:36,width:36,heightElements:[4.75,8.5],widthElements:[4.75,8.5]},EVENT_COMPENSATION:{d:"m {mx},{my} {e.x0},-{e.y0} 0,{e.y1} z m {e.x1},-{e.y2} {e.x2},-{e.y3} 0,{e.y1} -{e.x2},-{e.y3} z",height:36,width:36,heightElements:[6.5,13,.4,6.1],widthElements:[9,9.3,8.7]},EVENT_TIMER_WH:{d:"M {mx},{my} l {e.x0},-{e.y0} m -{e.x0},{e.y0} l {e.x1},{e.y1} ",height:36,width:36,heightElements:[10,2],widthElements:[3,7]},EVENT_TIMER_LINE:{d:"M {mx},{my} m {e.x0},{e.y0} l -{e.x1},{e.y1} ",height:36,width:36,heightElements:[10,3],widthElements:[0,0]},EVENT_MULTIPLE:{d:"m {mx},{my} {e.x1},-{e.y0} {e.x1},{e.y0} -{e.x0},{e.y1} -{e.x2},0 z",height:36,width:36,heightElements:[6.28099,12.56199],widthElements:[3.1405,9.42149,12.56198]},EVENT_PARALLEL_MULTIPLE:{d:"m {mx},{my} {e.x0},0 0,{e.y1} {e.x1},0 0,{e.y0} -{e.x1},0 0,{e.y1} -{e.x0},0 0,-{e.y1} -{e.x1},0 0,-{e.y0} {e.x1},0 z",height:36,width:36,heightElements:[2.56228,7.68683],widthElements:[2.56228,7.68683]},GATEWAY_EXCLUSIVE:{d:"m {mx},{my} {e.x0},{e.y0} {e.x1},{e.y0} {e.x2},0 {e.x4},{e.y2} {e.x4},{e.y1} {e.x2},0 {e.x1},{e.y3} {e.x0},{e.y3} {e.x3},0 {e.x5},{e.y1} {e.x5},{e.y2} {e.x3},0 z",height:17.5,width:17.5,heightElements:[8.5,6.5312,-6.5312,-8.5],widthElements:[6.5,-6.5,3,-3,5,-5]},GATEWAY_PARALLEL:{d:"m {mx},{my} 0,{e.y1} -{e.x1},0 0,{e.y0} {e.x1},0 0,{e.y1} {e.x0},0 0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z",height:30,width:30,heightElements:[5,12.5],widthElements:[5,12.5]},GATEWAY_EVENT_BASED:{d:"m {mx},{my} {e.x0},{e.y0} {e.x0},{e.y1} {e.x1},{e.y2} {e.x2},0 z",height:11,width:11,heightElements:[-6,6,12,-12],widthElements:[9,-3,-12]},GATEWAY_COMPLEX:{d:"m {mx},{my} 0,{e.y0} -{e.x0},-{e.y1} -{e.x1},{e.y2} {e.x0},{e.y1} -{e.x2},0 0,{e.y3} {e.x2},0 -{e.x0},{e.y1} l {e.x1},{e.y2} {e.x0},-{e.y1} 0,{e.y0} {e.x3},0 0,-{e.y0} {e.x0},{e.y1} {e.x1},-{e.y2} -{e.x0},-{e.y1} {e.x2},0 0,-{e.y3} -{e.x2},0 {e.x0},-{e.y1} -{e.x1},-{e.y2} -{e.x0},{e.y1} 0,-{e.y0} -{e.x3},0 z",height:17.125,width:17.125,heightElements:[4.875,3.4375,2.125,3],widthElements:[3.4375,2.125,4.875,3]},DATA_OBJECT_PATH:{d:"m 0,0 {e.x1},0 {e.x0},{e.y0} 0,{e.y1} -{e.x2},0 0,-{e.y2} {e.x1},0 0,{e.y0} {e.x0},0",height:61,width:51,heightElements:[10,50,60],widthElements:[10,40,50,60]},DATA_OBJECT_COLLECTION_PATH:{d:"m{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10",height:10,width:10,heightElements:[],widthElements:[]},DATA_ARROW:{d:"m 5,9 9,0 0,-3 5,5 -5,5 0,-3 -9,0 z",height:61,width:51,heightElements:[],widthElements:[]},DATA_STORE:{d:"m {mx},{my} l 0,{e.y2} c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 l 0,-{e.y2} c -{e.x0},-{e.y1} -{e.x1},-{e.y1} -{e.x2},0c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 m -{e.x2},{e.y0}c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0m -{e.x2},{e.y0}c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0",height:61,width:61,heightElements:[7,10,45],widthElements:[2,58,60]},TEXT_ANNOTATION:{d:"m {mx}, {my} m 10,0 l -10,0 l 0,{e.y0} l 10,0",height:30,width:10,heightElements:[30],widthElements:[10]},MARKER_SUB_PROCESS:{d:"m{mx},{my} m 7,2 l 0,10 m -5,-5 l 10,0",height:10,width:10,heightElements:[],widthElements:[]},MARKER_PARALLEL:{d:"m{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10",height:10,width:10,heightElements:[],widthElements:[]},MARKER_SEQUENTIAL:{d:"m{mx},{my} m 0,3 l 10,0 m -10,3 l 10,0 m -10,3 l 10,0",height:10,width:10,heightElements:[],widthElements:[]},MARKER_COMPENSATION:{d:"m {mx},{my} 7,-5 0,10 z m 7.1,-0.3 6.9,-4.7 0,10 -6.9,-4.7 z",height:10,width:21,heightElements:[],widthElements:[]},MARKER_LOOP:{d:"m {mx},{my} c 3.526979,0 6.386161,-2.829858 6.386161,-6.320661 0,-3.490806 -2.859182,-6.320661 -6.386161,-6.320661 -3.526978,0 -6.38616,2.829855 -6.38616,6.320661 0,1.745402 0.714797,3.325567 1.870463,4.469381 0.577834,0.571908 1.265885,1.034728 2.029916,1.35457 l -0.718163,-3.909793 m 0.718163,3.909793 -3.885211,0.802902",height:13.9,width:13.7,heightElements:[],widthElements:[]},MARKER_ADHOC:{d:"m {mx},{my} m 0.84461,2.64411 c 1.05533,-1.23780996 2.64337,-2.07882 4.29653,-1.97997996 2.05163,0.0805 3.85579,1.15803 5.76082,1.79107 1.06385,0.34139996 2.24454,0.1438 3.18759,-0.43767 0.61743,-0.33642 1.2775,-0.64078 1.7542,-1.17511 0,0.56023 0,1.12046 0,1.6807 -0.98706,0.96237996 -2.29792,1.62393996 -3.6918,1.66181996 -1.24459,0.0927 -2.46671,-0.2491 -3.59505,-0.74812 -1.35789,-0.55965 -2.75133,-1.33436996 -4.27027,-1.18121996 -1.37741,0.14601 -2.41842,1.13685996 -3.44288,1.96782996 z",height:4,width:15,heightElements:[],widthElements:[]},TASK_TYPE_SEND:{d:"m {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}",height:14,width:21,heightElements:[6,14],widthElements:[10.5,21]},TASK_TYPE_SCRIPT:{d:"m {mx},{my} c 9.966553,-6.27276 -8.000926,-7.91932 2.968968,-14.938 l -8.802728,0 c -10.969894,7.01868 6.997585,8.66524 -2.968967,14.938 z m -7,-12 l 5,0 m -4.5,3 l 4.5,0 m -3,3 l 5,0m -4,3 l 5,0",height:15,width:12.6,heightElements:[6,14],widthElements:[10.5,21]},TASK_TYPE_USER_1:{d:"m {mx},{my} c 0.909,-0.845 1.594,-2.049 1.594,-3.385 0,-2.554 -1.805,-4.62199999 -4.357,-4.62199999 -2.55199998,0 -4.28799998,2.06799999 -4.28799998,4.62199999 0,1.348 0.974,2.562 1.89599998,3.405 -0.52899998,0.187 -5.669,2.097 -5.794,4.7560005 v 6.718 h 17 v -6.718 c 0,-2.2980005 -5.5279996,-4.5950005 -6.0509996,-4.7760005 zm -8,6 l 0,5.5 m 11,0 l 0,-5"},TASK_TYPE_USER_2:{d:"m {mx},{my} m 2.162,1.009 c 0,2.4470005 -2.158,4.4310005 -4.821,4.4310005 -2.66499998,0 -4.822,-1.981 -4.822,-4.4310005 "},TASK_TYPE_USER_3:{d:"m {mx},{my} m -6.9,-3.80 c 0,0 2.25099998,-2.358 4.27399998,-1.177 2.024,1.181 4.221,1.537 4.124,0.965 -0.098,-0.57 -0.117,-3.79099999 -4.191,-4.13599999 -3.57499998,0.001 -4.20799998,3.36699999 -4.20699998,4.34799999 z"},TASK_TYPE_MANUAL:{d:"m {mx},{my} c 0.234,-0.01 5.604,0.008 8.029,0.004 0.808,0 1.271,-0.172 1.417,-0.752 0.227,-0.898 -0.334,-1.314 -1.338,-1.316 -2.467,-0.01 -7.886,-0.004 -8.108,-0.004 -0.014,-0.079 0.016,-0.533 0,-0.61 0.195,-0.042 8.507,0.006 9.616,0.002 0.877,-0.007 1.35,-0.438 1.353,-1.208 0.003,-0.768 -0.479,-1.09 -1.35,-1.091 -2.968,-0.002 -9.619,-0.013 -9.619,-0.013 v -0.591 c 0,0 5.052,-0.016 7.225,-0.016 0.888,-0.002 1.354,-0.416 1.351,-1.193 -0.006,-0.761 -0.492,-1.196 -1.361,-1.196 -3.473,-0.005 -10.86,-0.003 -11.0829995,-0.003 -0.022,-0.047 -0.045,-0.094 -0.069,-0.139 0.3939995,-0.319 2.0409995,-1.626 2.4149995,-2.017 0.469,-0.4870005 0.519,-1.1650005 0.162,-1.6040005 -0.414,-0.511 -0.973,-0.5 -1.48,-0.236 -1.4609995,0.764 -6.5999995,3.6430005 -7.7329995,4.2710005 -0.9,0.499 -1.516,1.253 -1.882,2.19 -0.37000002,0.95 -0.17,2.01 -0.166,2.979 0.004,0.718 -0.27300002,1.345 -0.055,2.063 0.629,2.087 2.425,3.312 4.859,3.318 4.6179995,0.014 9.2379995,-0.139 13.8569995,-0.158 0.755,-0.004 1.171,-0.301 1.182,-1.033 0.012,-0.754 -0.423,-0.969 -1.183,-0.973 -1.778,-0.01 -5.824,-0.004 -6.04,-0.004 10e-4,-0.084 0.003,-0.586 10e-4,-0.67 z"},TASK_TYPE_INSTANTIATING_SEND:{d:"m {mx},{my} l 0,8.4 l 12.6,0 l 0,-8.4 z l 6.3,3.6 l 6.3,-3.6"},TASK_TYPE_SERVICE:{d:"m {mx},{my} v -1.71335 c 0.352326,-0.0705 0.703932,-0.17838 1.047628,-0.32133 0.344416,-0.14465 0.665822,-0.32133 0.966377,-0.52145 l 1.19431,1.18005 1.567487,-1.57688 -1.195028,-1.18014 c 0.403376,-0.61394 0.683079,-1.29908 0.825447,-2.01824 l 1.622133,-0.01 v -2.2196 l -1.636514,0.01 c -0.07333,-0.35153 -0.178319,-0.70024 -0.323564,-1.04372 -0.145244,-0.34406 -0.321407,-0.6644 -0.522735,-0.96217 l 1.131035,-1.13631 -1.583305,-1.56293 -1.129598,1.13589 c -0.614052,-0.40108 -1.302883,-0.68093 -2.022633,-0.82247 l 0.0093,-1.61852 h -2.241173 l 0.0042,1.63124 c -0.353763,0.0736 -0.705369,0.17977 -1.049785,0.32371 -0.344415,0.14437 -0.665102,0.32092 -0.9635006,0.52046 l -1.1698628,-1.15823 -1.5667691,1.5792 1.1684265,1.15669 c -0.4026573,0.61283 -0.68308,1.29797 -0.8247287,2.01713 l -1.6588041,0.003 v 2.22174 l 1.6724648,-0.006 c 0.073327,0.35077 0.1797598,0.70243 0.3242851,1.04472 0.1452428,0.34448 0.3214064,0.6644 0.5227339,0.96066 l -1.1993431,1.19723 1.5840256,1.56011 1.1964668,-1.19348 c 0.6140517,0.40346 1.3028827,0.68232 2.0233517,0.82331 l 7.19e-4,1.69892 h 2.226848 z m 0.221462,-3.9957 c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z"},TASK_TYPE_SERVICE_FILL:{d:"m {mx},{my} c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z"},TASK_TYPE_BUSINESS_RULE_HEADER:{d:"m {mx},{my} 0,4 20,0 0,-4 z"},TASK_TYPE_BUSINESS_RULE_MAIN:{d:"m {mx},{my} 0,12 20,0 0,-12 zm 0,8 l 20,0 m -13,-4 l 0,8"},MESSAGE_FLOW_MARKER:{d:"m {mx},{my} m -10.5 ,-7 l 0,14 l 21,0 l 0,-14 z l 10.5,6 l 10.5,-6"}},this.getRawPath=function(e){return this.pathMap[e].d},this.getScaledPath=function(e,t){var n,i,r=this.pathMap[e];t.abspos?(n=t.abspos.x,i=t.abspos.y):(n=t.containerWidth*t.position.mx,i=t.containerHeight*t.position.my);var o,s,a={};if(t.position){for(var l=t.containerHeight/r.height*t.yScaleFactor,c=t.containerWidth/r.width*t.xScaleFactor,p=0;p=e.x&&n<=e.x+e.width&&i>=e.y&&i<=e.y+e.height}(n,On(p))||(n=this._canvas.findRoot(n))),this._canvas.addShape(i,n,o)}else{if(!Tr(t,"bpmndi:BPMNEdge"))throw new Error(s("unknown di {di} for element {semantic}",{di:Pr(t),semantic:Pr(e)}));var u=this._getSource(e),d=this._getTarget(e);r=n&&(n.hidden||n.collapsed),i=this._elementFactory.createConnection(Mo(e,t,{hidden:r,source:u,target:d,waypoints:Do(t,u,d)})),Tr(e,"bpmn:DataAssociation")&&(n=this._canvas.findRoot(n)),this._canvas.addConnection(i,n,o)}return eo(e)&&oo(i)&&this.addLabel(e,t,i),this._eventBus.fire("bpmnElement.added",{element:i}),i},No.prototype._attachBoundary=function(e,t){var n=this._translate,i=e.attachedToRef;if(!i)throw new Error(n("missing {semantic}#attachedToRef",{semantic:Pr(e)}));var r=this._elementRegistry.get(i.id),o=r&&r.attachers;if(!r)throw Ro(n,e,i,"attachedToRef");t.host=r,o||(r.attachers=o=[]),-1===o.indexOf(t)&&o.push(t)},No.prototype.addLabel=function(e,t,n){var i,r,o;return i=function(e,t){var n,i,r,o=e.label;return o&&o.bounds?(r=o.bounds,i={width:Math.max(Jr.width,r.width),height:r.height},n={x:r.x+r.width/2,y:r.y+r.height/2}):(n=io(t),i=Jr),z({x:n.x-i.width/2,y:n.y-i.height/2},i)}(t,n),(r=oo(n))&&(i=this._textRenderer.getExternalLabelBounds(i,r)),o=this._elementFactory.createLabel(Mo(e,t,{id:e.id+"_label",labelTarget:n,type:"label",hidden:n.hidden||!oo(n),x:Math.round(i.x),y:Math.round(i.y),width:Math.round(i.width),height:Math.round(i.height)})),this._canvas.addShape(o,n.parent)},No.prototype._getConnectedElement=function(e,t){var n,i,r=e.$type,o=this._translate;if(i=e[t+"Ref"],"source"===t&&"bpmn:DataInputAssociation"===r&&(i=i&&i[0]),("source"===t&&"bpmn:DataOutputAssociation"===r||"target"===t&&"bpmn:DataInputAssociation"===r)&&(i=e.$parent),n=i&&this._getElement(i))return n;throw i?Ro(o,e,i,t+"Ref"):new Error(o("{semantic}#{side} Ref not specified",{semantic:Pr(e),side:t}))},No.prototype._getSource=function(e){return this._getConnectedElement(e,"source")},No.prototype._getTarget=function(e){return this._getConnectedElement(e,"target")},No.prototype._getElement=function(e){return this._elementRegistry.get(e.id)};const $o={__depends__:[To,{__depends__:[Ao],bpmnImporter:["type",No]}]};function jo(e){e&&"function"==typeof e.stopPropagation&&e.stopPropagation()}function Io(e){return e.originalEvent||e.srcEvent}function Lo(e){jo(e),jo(Io(e))}function Bo(e){return e.pointers&&e.pointers.length&&(e=e.pointers[0]),e.touches&&e.touches.length&&(e=e.touches[0]),e?{x:e.clientX,y:e.clientY}:null}function qo(){return/mac/i.test(navigator.platform)}function zo(e,t){return(Io(e)||e).button===t}function Fo(e){return zo(e,0)}function Vo(e){var t=Io(e)||e;return!!Fo(e)&&(qo()?t.metaKey:t.ctrlKey)}function Ho(e){var t=Io(e)||e;return Fo(e)&&t.shiftKey}function Uo(e){return!0}function Wo(e){return Fo(e)||function(e){return zo(e,1)}(e)}function Go(e,t,n){var i=this;function r(n,i,r){var o,s;(function(e,t){var n=l[e]||Fo;return!n(t)})(n,i)||(r?s=t.getGraphics(r):(o=i.delegateTarget||i.target)&&(s=o,r=t.get(s)),s&&r&&!1===e.fire(n,{element:r,gfx:s,originalEvent:i})&&(i.stopPropagation(),i.preventDefault()))}var o={};function s(e){return o[e]}var a={click:"element.click",contextmenu:"element.contextmenu",dblclick:"element.dblclick",mousedown:"element.mousedown",mousemove:"element.mousemove",mouseover:"element.hover",mouseout:"element.out",mouseup:"element.mouseup"},l={"element.contextmenu":Uo,"element.mousedown":Wo,"element.mouseup":Wo,"element.click":Wo,"element.dblclick":Wo};function c(e,t,n,i){var s=o[n]=function(e){r(n,e)};i&&(l[n]=i),s.$delegate=me.bind(e,"svg, .djs-element",t,s)}function p(e,t,n){var i=s(n);i&&me.unbind(e,t,i.$delegate)}e.on("canvas.destroy",(function(e){!function(e){_(a,(function(t,n){p(e,n,t)}))}(e.svg)})),e.on("canvas.init",(function(e){!function(e){_(a,(function(t,n){c(e,n,t)}))}(e.svg)})),e.on(["shape.added","connection.added"],(function(t){var n=t.element,i=t.gfx;e.fire("interactionEvents.createHit",{element:n,gfx:i})})),e.on(["shape.changed","connection.changed"],500,(function(t){var n=t.element,i=t.gfx;e.fire("interactionEvents.updateHit",{element:n,gfx:i})})),e.on("interactionEvents.createHit",500,(function(e){var t=e.element,n=e.gfx;i.createDefaultHit(t,n)})),e.on("interactionEvents.updateHit",(function(e){var t=e.element,n=e.gfx;i.updateDefaultHit(t,n)}));var u=f("djs-hit djs-hit-stroke"),d=f("djs-hit djs-hit-click-stroke"),h={all:f("djs-hit djs-hit-all"),"click-stroke":d,stroke:u,"no-move":f("djs-hit djs-hit-no-move")};function f(e,t){return t=z({stroke:"white",strokeWidth:15},t||{}),n.cls(e,["no-fill","no-border"],t)}function m(e,t){var n=h[t];if(!n)throw new Error("invalid hit type <"+t+">");return Te(e,n),e}function g(e,t){ke(e,t)}this.removeHits=function(e){_(_e(".djs-hit",e),Ke)},this.createDefaultHit=function(e,t){var n,i=e.waypoints,r=e.isFrame;return i?this.createWaypointsHit(t,i):(n=r?"stroke":"all",this.createBoxHit(t,n,{width:e.width,height:e.height}))},this.createWaypointsHit=function(e,t){var n=mt(t);return m(n,"stroke"),g(e,n),n},this.createBoxHit=function(e,t,n){n=z({x:0,y:0},n);var i=Le("rect");return m(i,t),Te(i,n),g(e,i),i},this.updateDefaultHit=function(e,t){var n=we(".djs-hit",t);if(n)return e.waypoints?gt(n,e.waypoints):Te(n,{width:e.width,height:e.height}),n},this.fire=r,this.triggerMouseEvent=function(e,t,n){var i=a[e];if(!i)throw new Error("unmapped DOM event name <"+e+">");return r(i,t,n)},this.mouseHandler=s,this.registerEvent=c,this.unregisterEvent=p}Go.$inject=["eventBus","elementRegistry","styles"];const Qo={__init__:["interactionEvents"],interactionEvents:["type",Go]};function Xo(e,t){this._eventBus=e,this.offset=5;var n=t.cls("djs-outline",["no-fill"]),i=this;function r(e){var t=Le("rect");return Te(t,z({x:0,y:0,rx:4,width:100,height:100},n)),t}e.on(["shape.added","shape.changed"],500,(function(e){var t=e.element,n=e.gfx,o=we(".djs-outline",n);o||ke(n,o=i.getOutline(t)||r()),i.updateShapeOutline(o,t)})),e.on(["connection.added","connection.changed"],(function(e){var t=e.element,n=e.gfx,o=we(".djs-outline",n);o||ke(n,o=r()),i.updateConnectionOutline(o,t)}))}Xo.prototype.updateShapeOutline=function(e,t){var n=!1,i=this._getProviders();i.length&&_(i,(function(i){n=n||i.updateOutline(t,e)})),n||Te(e,{x:-this.offset,y:-this.offset,width:t.width+2*this.offset,height:t.height+2*this.offset})},Xo.prototype.updateConnectionOutline=function(e,t){var n=Et(t);Te(e,{x:n.x-this.offset,y:n.y-this.offset,width:n.width+2*this.offset,height:n.height+2*this.offset})},Xo.prototype.registerProvider=function(e,t){t||(t=e,e=1e3),this._eventBus.on("outline.getProviders",e,(function(e){e.providers.push(t)}))},Xo.prototype._getProviders=function(){var e=this._eventBus.createEvent({type:"outline.getProviders",providers:[]});return this._eventBus.fire(e),e.providers},Xo.prototype.getOutline=function(e){var t;return _(this._getProviders(),(function(n){g(n.getOutline)&&(t=t||n.getOutline(e))})),t},Xo.$inject=["eventBus","styles","elementRegistry"];const Ko={__init__:["outline"],outline:["type",Xo]};function Yo(e,t){this._eventBus=e,this._canvas=t,this._selectedElements=[];var n=this;e.on(["shape.remove","connection.remove"],(function(e){var t=e.element;n.deselect(t)})),e.on(["diagram.clear","root.set"],(function(e){n.select(null)}))}Yo.$inject=["eventBus","canvas"],Yo.prototype.deselect=function(e){var t=this._selectedElements,n=t.indexOf(e);if(-1!==n){var i=t.slice();t.splice(n,1),this._eventBus.fire("selection.changed",{oldSelection:i,newSelection:t})}},Yo.prototype.get=function(){return this._selectedElements},Yo.prototype.isSelected=function(e){return-1!==this._selectedElements.indexOf(e)},Yo.prototype.select=function(e,t){var n=this._selectedElements,i=n.slice();h(e)||(e=e?[e]:[]);var r=this._canvas,o=r.getRootElement();e=e.filter((function(e){var t=r.findRoot(e);return o===t})),t?_(e,(function(e){-1===n.indexOf(e)&&n.push(e)})):this._selectedElements=n=e.slice(),this._eventBus.fire("selection.changed",{oldSelection:i,newSelection:n})};var Zo="hover",Jo="selected";function es(e,t,n){this._canvas=e;var i=this;function r(t,n){e.addMarker(t,n)}function o(t,n){e.removeMarker(t,n)}this._multiSelectionBox=null,t.on("element.hover",(function(e){r(e.element,Zo)})),t.on("element.out",(function(e){o(e.element,Zo)})),t.on("selection.changed",(function(e){var t=e.oldSelection,n=e.newSelection;_(t,(function(e){-1===n.indexOf(e)&&function(e){o(e,Jo)}(e)})),_(n,(function(e){-1===t.indexOf(e)&&function(e){r(e,Jo)}(e)})),i._updateSelectionOutline(n)})),t.on("element.changed",(function(e){n.isSelected(e.element)&&i._updateSelectionOutline(n.get())}))}function ts(e,t,n,i){e.on("create.end",500,(function(e){var n=e.context,i=n.canExecute,r=n.elements,o=(n.hints||{}).autoSelect;if(i){if(!1===o)return;h(o)?t.select(o):t.select(r.filter(ns))}})),e.on("connect.end",500,(function(e){var n=e.context.connection;n&&t.select(n)})),e.on("shape.move.end",500,(function(e){var n=e.previousSelection||[],r=i.get(e.context.shape.id);b(n,(function(e){return r.id===e.id}))||t.select(r)})),e.on("element.click",(function(e){if(Fo(e)){var i=e.element;i===n.getRootElement()&&(i=null);var r=t.isSelected(i),o=t.get().length>1,s=Vo(e)||Ho(e);if(r&&o)return s?t.deselect(i):t.select(i);r?t.deselect(i):t.select(i,s)}}))}function ns(e){return!e.hidden}es.$inject=["canvas","eventBus","selection"],es.prototype._updateSelectionOutline=function(e){var t=this._canvas.getLayer("selectionOutline");Re(t);var n=e.length>1;if(Me(this._canvas.getContainer())[n?"add":"remove"]("djs-multi-select"),n){var i=function(e){return{x:e.x-6,y:e.y-6,width:e.width+12,height:e.height+12}}(Et(e)),r=Le("rect");Te(r,z({rx:3},i)),Me(r).add("djs-selection-outline"),ke(t,r)}},ts.$inject=["eventBus","selection","canvas","elementRegistry"];const is={__init__:["selectionVisuals","selectionBehavior"],__depends__:[Qo,Ko],selection:["type",Yo],selectionVisuals:["type",es],selectionBehavior:["type",ts]};function rs(e){this._counter=0,this._prefix=(e?e+"-":"")+Math.floor(1e9*Math.random())+"-"}rs.prototype.next=function(){return this._prefix+ ++this._counter};var os=new rs("ov");function ss(e,t,n,i){var r,o;this._eventBus=t,this._canvas=n,this._elementRegistry=i,this._ids=os,this._overlayDefaults=z({show:null,scale:!0},e&&e.defaults),this._overlays={},this._overlayContainers=[],this._overlayRoot=(r=n.getContainer(),Z(o=be('
'),{position:"absolute",width:0,height:0}),r.insertBefore(o,r.firstChild),o),this._init()}function as(e,t,n){Z(e,{left:t+"px",top:n+"px"})}function ls(e,t){e.style.display=!1===t?"none":""}function cs(e,t){e.style["transform-origin"]="top left",["","-ms-","-webkit-"].forEach((function(n){e.style[n+"transform"]=t}))}ss.$inject=["config.overlays","eventBus","canvas","elementRegistry"],ss.prototype.get=function(e){if(y(e)&&(e={id:e}),y(e.element)&&(e.element=this._elementRegistry.get(e.element)),e.element){var t=this._getOverlayContainer(e.element,!0);return t?e.type?w(t.overlays,N({type:e.type})):t.overlays.slice():[]}return e.type?w(this._overlays,N({type:e.type})):e.id?this._overlays[e.id]:null},ss.prototype.add=function(e,t,n){if(f(t)&&(n=t,t=null),e.id||(e=this._elementRegistry.get(e)),!n.position)throw new Error("must specifiy overlay position");if(!n.html)throw new Error("must specifiy overlay html");if(!e)throw new Error("invalid element specified");var i=this._ids.next();return n=z({},this._overlayDefaults,n,{id:i,type:t,element:e,html:n.html}),this._addOverlay(n),i},ss.prototype.remove=function(e){var t=this.get(e)||[];h(t)||(t=[t]);var n=this;_(t,(function(e){var t=n._getOverlayContainer(e.element,!0);if(e&&(Ee(e.html),Ee(e.htmlContainer),delete e.htmlContainer,delete e.element,delete n._overlays[e.id]),t){var i=t.overlays.indexOf(e);-1!==i&&t.overlays.splice(i,1)}}))},ss.prototype.isShown=function(){return"none"!==this._overlayRoot.style.display},ss.prototype.show=function(){ls(this._overlayRoot)},ss.prototype.hide=function(){ls(this._overlayRoot,!1)},ss.prototype.clear=function(){this._overlays={},this._overlayContainers=[],ie(this._overlayRoot)},ss.prototype._updateOverlayContainer=function(e){var t=e.element,n=e.html,i=t.x,r=t.y;if(t.waypoints){var o=Et(t);i=o.x,r=o.y}as(n,i,r),J(e.html,"data-container-id",t.id)},ss.prototype._updateOverlay=function(e){var t,n,i=e.position,r=e.htmlContainer,o=e.element,s=i.left,a=i.top;void 0!==i.right&&(t=o.waypoints?Et(o).width:o.width,s=-1*i.right+t);void 0!==i.bottom&&(n=o.waypoints?Et(o).height:o.height,a=-1*i.bottom+n);as(r,s||0,a||0),this._updateOverlayVisibilty(e,this._canvas.viewbox())},ss.prototype._createOverlayContainer=function(e){var t=be('
');Z(t,{position:"absolute"}),this._overlayRoot.appendChild(t);var n={html:t,element:e,overlays:[]};return this._updateOverlayContainer(n),this._overlayContainers.push(n),n},ss.prototype._updateRoot=function(e){var t=e.scale||1,n="matrix("+[t,0,0,t,-1*e.x*t,-1*e.y*t].join(",")+")";cs(this._overlayRoot,n)},ss.prototype._getOverlayContainer=function(e,t){var n=b(this._overlayContainers,(function(t){return t.element===e}));return n||t?n:this._createOverlayContainer(e)},ss.prototype._addOverlay=function(e){var t,n,i=e.id,r=e.element,o=e.html;o.get&&o.constructor.prototype.jquery&&(o=o.get(0)),y(o)&&(o=be(o)),n=this._getOverlayContainer(r),Z(t=be(''),{position:"absolute"}),t.appendChild(o),e.type&&te(t).add("djs-overlay-"+e.type),ls(t,this._canvas.findRoot(r)===this._canvas.getRootElement()),e.htmlContainer=t,n.overlays.push(e),n.html.appendChild(t),this._overlays[i]=e,this._updateOverlay(e),this._updateOverlayVisibilty(e,this._canvas.viewbox())},ss.prototype._updateOverlayVisibilty=function(e,t){var n=e.show,i=this._canvas.findRoot(e.element),r=n&&n.minZoom,o=n&&n.maxZoom,s=e.htmlContainer,a=!0;(i!==this._canvas.getRootElement()||n&&(u(r)&&r>t.scale||u(o)&&o
i&&(r=(1/t.scale||1)*i)),u(r)&&(a="scale("+r+","+r+")"),cs(s,a)},ss.prototype._updateOverlaysVisibilty=function(e){var t=this;_(this._overlays,(function(n){t._updateOverlayVisibilty(n,e)}))},ss.prototype._init=function(){var e=this._eventBus,t=this;e.on("canvas.viewbox.changing",(function(e){t.hide()})),e.on("canvas.viewbox.changed",(function(e){var n;n=e.viewbox,t._updateRoot(n),t._updateOverlaysVisibilty(n),t.show()})),e.on(["shape.remove","connection.remove"],(function(e){var n=e.element;_(t.get({element:n}),(function(e){t.remove(e.id)}));var i=t._getOverlayContainer(n);if(i){Ee(i.html);var r=t._overlayContainers.indexOf(i);-1!==r&&t._overlayContainers.splice(r,1)}})),e.on("element.changed",500,(function(e){var n=e.element,i=t._getOverlayContainer(n,!0);i&&(_(i.overlays,(function(e){t._updateOverlay(e)})),t._updateOverlayContainer(i))})),e.on("element.marker.update",(function(e){var n=t._getOverlayContainer(e.element,!0);n&&te(n.html)[e.add?"add":"remove"](e.marker)})),e.on("root.set",(function(){t._updateOverlaysVisibilty(t._canvas.viewbox())})),e.on("diagram.clear",this.clear,this)};const ps={__init__:["overlays"],overlays:["type",ss]};function us(e,t,n,i){e.on("element.changed",(function(i){var r=i.element;(r.parent||r===t.getRootElement())&&(i.gfx=n.getGraphics(r)),i.gfx&&e.fire(Ot(r)+".changed",i)})),e.on("elements.changed",(function(t){var n=t.elements;n.forEach((function(t){e.fire("element.changed",{element:t})})),i.updateContainments(n)})),e.on("shape.changed",(function(e){i.update("shape",e.element,e.gfx)})),e.on("connection.changed",(function(e){i.update("connection",e.element,e.gfx)}))}us.$inject=["eventBus","canvas","elementRegistry","graphicsFactory"];const ds={__init__:["changeSupport"],changeSupport:["type",us]};function hs(e){this._eventBus=e}function fs(e){return function(t,n,i,r,o){(g(t)||m(t))&&(o=r,r=i,i=n,n=t,t=null),this.on(t,e,n,i,r,o)}}function ms(e,t){t.invoke(hs,this),this.executed((function(t){var n=t.context;n.rootElement?e.setRootElement(n.rootElement):n.rootElement=e.getRootElement()})),this.revert((function(t){var n=t.context;n.rootElement&&e.setRootElement(n.rootElement)}))}hs.$inject=["eventBus"],hs.prototype.on=function(e,t,n,i,r,o){if((g(t)||m(t))&&(o=r,r=i,i=n,n=t,t=null),g(n)&&(o=r,r=i,i=n,n=1e3),f(r)&&(o=r,r=!1),!g(i))throw new Error("handlerFn must be a function");h(e)||(e=[e]);var s=this._eventBus;_(e,(function(e){var a=["commandStack",e,t].filter((function(e){return e})).join(".");s.on(a,n,r?function(e,t){return function(n){return e.call(t||null,n.context,n.command,n)}}(i,o):i,o)}))},hs.prototype.canExecute=fs("canExecute"),hs.prototype.preExecute=fs("preExecute"),hs.prototype.preExecuted=fs("preExecuted"),hs.prototype.execute=fs("execute"),hs.prototype.executed=fs("executed"),hs.prototype.postExecute=fs("postExecute"),hs.prototype.postExecuted=fs("postExecuted"),hs.prototype.revert=fs("revert"),hs.prototype.reverted=fs("reverted"),i(ms,hs),ms.$inject=["canvas","injector"];const gs={__init__:["rootElementsBehavior"],rootElementsBehavior:["type",ms]};function ys(e){return CSS.escape(e)}var vs={"&":"&","<":"<",">":">",'"':""","'":"'"};function bs(e){return(e=""+e)&&e.replace(/[&<>"']/g,(function(e){return vs[e]}))}var xs="_plane";function ws(e){return function(e){return e.replace(new RegExp(xs+"$"),"")}(e.id)}function _s(e){var t=e.id;return Tr(e,"bpmn:SubProcess")?Ps(t):t}function Es(e){return Ps(e)}function Os(e){return Tr(Dr(e),"bpmndi:BPMNPlane")}function Ps(e){return e+xs}function ks(e,t,n){var i=be(''),r=n.getContainer(),o=te(r);r.appendChild(i);var s=[];function a(e){e&&(s=function(e){for(var t=Mr(e),n=[],i=t;i;i=i.$parent)(Tr(i,"bpmn:SubProcess")||Tr(i,"bpmn:Process"))&&n.push(i);return n.reverse()}(e));var r=s.map((function(e){var i=bs(e.name||e.id),r=be(''+i+" "),o=n.findRoot(_s(e))||n.findRoot(e.id);if(!o&&Tr(e,"bpmn:Process")){var s=t.find((function(t){var n=Mr(t);return n&&n.get("processRef")&&n.get("processRef")===e}));o=n.findRoot(s.id)}return r.addEventListener("click",(function(){n.setRootElement(o)})),r}));i.innerHTML="";var a=r.length>1;o.toggle("bjs-breadcrumbs-shown",a),r.forEach((function(e){i.appendChild(e)}))}e.on("element.changed",(function(e){var t=Mr(e.element);b(s,(function(e){return e===t}))&&a()})),e.on("root.set",(function(e){a(e.element)}))}function Ss(e,t){var n=null,i=new Cs;e.on("root.set",(function(e){var r=e.element,o=t.viewbox(),s=i.get(r);if(i.set(n,{x:o.x,y:o.y,zoom:o.scale}),n=r,!Tr(r,"bpmn:Collaboration")||s){s=s||{x:0,y:0,zoom:1};var a=(o.x-s.x)*o.scale,l=(o.y-s.y)*o.scale;0===a&&0===l||t.scroll({dx:a,dy:l}),s.zoom!==o.scale&&t.zoom(s.zoom,{x:0,y:0})}})),e.on("diagram.clear",(function(){i.clear(),n=null}))}function Cs(){this._entries=[],this.set=function(e,t){var n=!1;for(var i in this._entries)if(this._entries[i][0]===e){this._entries[i][1]=t,n=!0;break}n||this._entries.push([e,t])},this.get=function(e){for(var t in this._entries)if(this._entries[t][0]===e)return this._entries[t][1];return null},this.clear=function(){this._entries.length=0},this.remove=function(e){var t=-1;for(var n in this._entries)if(this._entries[n][0]===e){t=n;break}-1!==t&&this._entries.splice(t,1)}}ks.$inject=["eventBus","elementRegistry","canvas"],Ss.$inject=["eventBus","canvas"];var Ts=180,As=160;function Ms(e,t){this._eventBus=e,this._moddle=t;var n=this;e.on("import.render.start",1500,(function(e,t){n._handleImport(t.definitions)}))}function Ds(e){return Tr(e,"bpmndi:BPMNDiagram")?e:Ds(e.$parent)}Ms.prototype._handleImport=function(e){if(e.diagrams){var t=this;this._definitions=e,this._processToDiagramMap={},e.diagrams.forEach((function(e){e.plane&&e.plane.bpmnElement&&(t._processToDiagramMap[e.plane.bpmnElement.id]=e)}));var n=[];e.diagrams.forEach((function(e){var i=t._createNewDiagrams(e.plane);Array.prototype.push.apply(n,i)})),n.forEach((function(e){t._movePlaneElementsToOrigin(e.plane)}))}},Ms.prototype._createNewDiagrams=function(e){var t=this,n=[],i=[];e.get("planeElement").forEach((function(t){var r=t.bpmnElement;if(r){var o=r.$parent;Tr(r,"bpmn:SubProcess")&&!t.isExpanded&&n.push(r),function(e,t){var n=e.$parent;if(!Tr(n,"bpmn:SubProcess")||n===t.bpmnElement)return!1;if(Ar(e,["bpmn:DataInputAssociation","bpmn:DataOutputAssociation"]))return!1;return!0}(r,e)&&i.push({diElement:t,parent:o})}}));var r=[];return n.forEach((function(e){if(!t._processToDiagramMap[e.id]){var n=t._createDiagram(e);t._processToDiagramMap[e.id]=n,r.push(n)}})),i.forEach((function(e){for(var i=e.diElement,r=e.parent;r&&-1===n.indexOf(r);)r=r.$parent;if(r){var o=t._processToDiagramMap[r.id];t._moveToDiPlane(i,o.plane)}})),r},Ms.prototype._movePlaneElementsToOrigin=function(e){var t=e.get("planeElement"),n=function(e){var t={top:1/0,right:-1/0,bottom:-1/0,left:1/0};return e.planeElement.forEach((function(e){if(e.bounds){var n=wn(e.bounds);t.top=Math.min(n.top,t.top),t.left=Math.min(n.left,t.left)}})),_n(t)}(e),i=n.x-Ts,r=n.y-As;t.forEach((function(e){e.waypoint?e.waypoint.forEach((function(e){e.x=e.x-i,e.y=e.y-r})):e.bounds&&(e.bounds.x=e.bounds.x-i,e.bounds.y=e.bounds.y-r)}))},Ms.prototype._moveToDiPlane=function(e,t){var n=Ds(e).plane.get("planeElement");n.splice(n.indexOf(e),1),t.get("planeElement").push(e)},Ms.prototype._createDiagram=function(e){var t=this._moddle.create("bpmndi:BPMNPlane",{bpmnElement:e}),n=this._moddle.create("bpmndi:BPMNDiagram",{plane:t});return t.$parent=n,t.bpmnElement=e,n.$parent=this._definitions,this._definitions.diagrams.push(n),n},Ms.$inject=["eventBus","moddle"];var Rs=250;function Ns(e,t,n,i){hs.call(this,t),this._canvas=e,this._eventBus=t,this._elementRegistry=n,this._overlays=i;var r=this;this.executed("shape.toggleCollapse",Rs,(function(e){var t=e.shape;r._canDrillDown(t)?r._addOverlay(t):r._removeOverlay(t)}),!0),this.reverted("shape.toggleCollapse",Rs,(function(e){var t=e.shape;r._canDrillDown(t)?r._addOverlay(t):r._removeOverlay(t)}),!0),this.executed(["shape.create","shape.move","shape.delete"],Rs,(function(e){var t=e.oldParent,n=e.newParent||e.parent,i=e.shape;r._canDrillDown(i)&&r._addOverlay(i),r._updateDrilldownOverlay(t),r._updateDrilldownOverlay(n),r._updateDrilldownOverlay(i)}),!0),this.reverted(["shape.create","shape.move","shape.delete"],Rs,(function(e){var t=e.oldParent,n=e.newParent||e.parent,i=e.shape;r._canDrillDown(i)&&r._addOverlay(i),r._updateDrilldownOverlay(t),r._updateDrilldownOverlay(n),r._updateDrilldownOverlay(i)}),!0),t.on("import.render.complete",(function(){n.filter((function(e){return r._canDrillDown(e)})).map((function(e){r._addOverlay(e)}))}))}i(Ns,hs),Ns.prototype._updateDrilldownOverlay=function(e){var t=this._canvas;if(e){var n=t.findRoot(e);n&&this._updateOverlayVisibility(n)}},Ns.prototype._canDrillDown=function(e){var t=this._canvas;return Tr(e,"bpmn:SubProcess")&&t.findRoot(_s(e))},Ns.prototype._updateOverlayVisibility=function(e){var t=this._overlays,n=Mr(e),i=t.get({element:n.id,type:"drilldown"})[0];if(i){var r=n&&n.get("flowElements")&&n.get("flowElements").length;te(i.html).toggle("bjs-drilldown-empty",!r)}},Ns.prototype._addOverlay=function(e){var t=this._canvas,n=this._overlays;n.get({element:e,type:"drilldown"}).length&&this._removeOverlay(e);var i=be(' ');i.addEventListener("click",(function(){t.setRootElement(t.findRoot(_s(e)))})),n.add(e,"drilldown",{position:{bottom:-7,right:-8},html:i}),this._updateOverlayVisibility(e)},Ns.prototype._removeOverlay=function(e){this._overlays.remove({element:e,type:"drilldown"})},Ns.$inject=["canvas","eventBus","elementRegistry","overlays"];const $s={__depends__:[ps,ds,gs],__init__:["drilldownBreadcrumbs","drilldownOverlayBehavior","drilldownCentering","subprocessCompatibility"],drilldownBreadcrumbs:["type",ks],drilldownCentering:["type",Ss],drilldownOverlayBehavior:["type",Ns],subprocessCompatibility:["type",Ms]};function js(e){Hr.call(this,e)}i(js,Hr),js.prototype._modules=[$o,Ao,is,ps,$s],js.prototype._moddleExtensions={};var Is=["c","C"],Ls=["v","V"],Bs=["y","Y"],qs=["z","Z"];function zs(e){return!e.altKey&&(e.ctrlKey||e.metaKey)}function Fs(e,t){return-1!==(e=h(e)?e:[e]).indexOf(t.key)||-1!==e.indexOf(t.code)}function Vs(e){return e.shiftKey}var Hs="keyboard.keydown",Us="input-handle-modified-keys";function Ws(e,t){var n=this;this._config=e||{},this._eventBus=t,this._keydownHandler=this._keydownHandler.bind(this),this._keyupHandler=this._keyupHandler.bind(this),t.on("diagram.destroy",(function(){n._fire("destroy"),n.unbind()})),t.on("diagram.init",(function(){n._fire("init")})),t.on("attach",(function(){e&&e.bindTo&&n.bind(e.bindTo)})),t.on("detach",(function(){n.unbind()}))}Ws.$inject=["config.keyboard","eventBus"],Ws.prototype._keydownHandler=function(e){this._keyHandler(e,Hs)},Ws.prototype._keyupHandler=function(e){this._keyHandler(e,"keyboard.keyup")},Ws.prototype._keyHandler=function(e,t){if(!this._isEventIgnored(e)){var n={keyEvent:e};this._eventBus.fire(t||Hs,n)&&e.preventDefault()}},Ws.prototype._isEventIgnored=function(e){return!!e.defaultPrevented||(t=e.target)&&(xe(t,"input, textarea")||"true"===t.contentEditable)&&this._isModifiedKeyIgnored(e);var t},Ws.prototype._isModifiedKeyIgnored=function(e){return!zs(e)||-1===this._getAllowedModifiers(e.target).indexOf(e.key)},Ws.prototype._getAllowedModifiers=function(e){var t=re(e,"["+Us+"]",!0);return!t||this._node&&!this._node.contains(t)?[]:t.getAttribute(Us).split(",")},Ws.prototype.bind=function(e){this.unbind(),this._node=e,de.bind(e,"keydown",this._keydownHandler),de.bind(e,"keyup",this._keyupHandler),this._fire("bind")},Ws.prototype.getBinding=function(){return this._node},Ws.prototype.unbind=function(){var e=this._node;e&&(this._fire("unbind"),de.unbind(e,"keydown",this._keydownHandler),de.unbind(e,"keyup",this._keyupHandler)),this._node=null},Ws.prototype._fire=function(e){this._eventBus.fire("keyboard."+e,{node:this._node})},Ws.prototype.addListener=function(e,t,n){g(e)&&(n=t,t=e,e=1e3),this._eventBus.on(n||Hs,e,t)},Ws.prototype.removeListener=function(e,t){this._eventBus.off(t||Hs,e)},Ws.prototype.hasModifier=function(e){return e.ctrlKey||e.metaKey||e.shiftKey||e.altKey},Ws.prototype.isCmd=zs,Ws.prototype.isShift=Vs,Ws.prototype.isKey=Fs;function Gs(e,t){var n=this;e.on("editorActions.init",500,(function(e){var i=e.editorActions;n.registerBindings(t,i)}))}Gs.$inject=["eventBus","keyboard"],Gs.prototype.registerBindings=function(e,t){function n(n,i){t.isRegistered(n)&&e.addListener(i)}n("undo",(function(e){if(function(e){return zs(e)&&!Vs(e)&&Fs(qs,e)}(e.keyEvent))return t.trigger("undo"),!0})),n("redo",(function(e){if(function(e){return zs(e)&&(Fs(Bs,e)||Fs(qs,e)&&Vs(e))}(e.keyEvent))return t.trigger("redo"),!0})),n("copy",(function(e){if(function(e){return zs(e)&&Fs(Is,e)}(e.keyEvent))return t.trigger("copy"),!0})),n("paste",(function(e){if(function(e){return zs(e)&&Fs(Ls,e)}(e.keyEvent))return t.trigger("paste"),!0})),n("stepZoom",(function(e){var n=e.keyEvent;if(Fs(["+","Add","="],n)&&zs(n))return t.trigger("stepZoom",{value:1}),!0})),n("stepZoom",(function(e){var n=e.keyEvent;if(Fs(["-","Subtract"],n)&&zs(n))return t.trigger("stepZoom",{value:-1}),!0})),n("zoom",(function(e){var n=e.keyEvent;if(Fs("0",n)&&zs(n))return t.trigger("zoom",{value:1}),!0})),n("removeSelection",(function(e){if(Fs(["Backspace","Delete","Del"],e.keyEvent))return t.trigger("removeSelection"),!0}))};const Qs={__init__:["keyboard","keyboardBindings"],keyboard:["type",Ws],keyboardBindings:["type",Gs]};var Xs={moveSpeed:50,moveSpeedAccelerated:200};function Ks(e,t,n){var i=this;this._config=z({},Xs,e||{}),t.addListener((function(e){var n=e.keyEvent,r=i._config;if(!t.isCmd(n))return;if(t.isKey(["ArrowLeft","Left","ArrowUp","Up","ArrowDown","Down","ArrowRight","Right"],n)){var o,s=t.isShift(n)?r.moveSpeedAccelerated:r.moveSpeed;switch(n.key){case"ArrowLeft":case"Left":o="left";break;case"ArrowUp":case"Up":o="up";break;case"ArrowRight":case"Right":o="right";break;case"ArrowDown":case"Down":o="down"}return i.moveCanvas({speed:s,direction:o}),!0}})),this.moveCanvas=function(e){var t=0,i=0,r=e.speed/Math.min(Math.sqrt(n.viewbox().scale),1);switch(e.direction){case"left":t=r;break;case"up":i=r;break;case"right":t=-r;break;case"down":i=-r}n.scroll({dx:t,dy:i})}}Ks.$inject=["config.keyboardMove","keyboard","canvas"];const Ys={__depends__:[Qs],__init__:["keyboardMove"],keyboardMove:["type",Ks]};var Zs=/^djs-cursor-.*$/;function Js(e){var t=te(document.body);t.removeMatching(Zs),e&&t.add("djs-cursor-"+e)}function ea(){Js(null)}function ta(e,t){function n(){return!1}return t=t||"element.click",e.once(t,5e3,n),function(){e.off(t,n)}}function na(e){return{x:e.x+e.width/2,y:e.y+e.height/2}}function ia(e,t){return{x:e.x-t.x,y:e.y-t.y}}function ra(e,t){var n;function i(i){var r,o=n.start,s=n.button,a=Bo(i),l=ia(a,o);(!n.dragging&&(r=l,Math.sqrt(Math.pow(r.x,2)+Math.pow(r.y,2))>15)&&(n.dragging=!0,0===s&&ta(e),Js("grab")),n.dragging)&&(l=ia(a,n.last||n.start),t.scroll({dx:l.x,dy:l.y}),n.last=a);i.preventDefault()}function r(e){de.unbind(document,"mousemove",i),de.unbind(document,"mouseup",r),n=null,ea()}e.on("element.mousedown",500,(function(e){return function(e){if(re(e.target,".djs-draggable"))return;var t=e.button;if(t>=2||e.ctrlKey||e.shiftKey||e.altKey)return;return n={button:t,start:Bo(e)},de.bind(document,"mousemove",i),de.bind(document,"mouseup",r),!0}(e.originalEvent)})),this.isActive=function(){return!!n}}ra.$inject=["eventBus","canvas"];const oa={__init__:["moveCanvas"],moveCanvas:["type",ra]};function sa(e){return Math.log(e)/Math.log(10)}function aa(e,t){var n=sa(e.min),i=sa(e.max);return(Math.abs(n)+Math.abs(i))/t}var la=Math.sign||function(e){return e>=0?1:-1},ca={min:.2,max:4};function pa(e,t,n){e=e||{},this._enabled=!1,this._canvas=n,this._container=n._container,this._handleWheel=q(this._handleWheel,this),this._totalDelta=0,this._scale=e.scale||.75;var i=this;t.on("canvas.init",(function(t){i._init(!1!==e.enabled)}))}pa.$inject=["config.zoomScroll","eventBus","canvas"],pa.prototype.scroll=function(e){this._canvas.scroll(e)},pa.prototype.reset=function(){this._canvas.zoom("fit-viewport")},pa.prototype.zoom=function(e,t){var n=aa(ca,20);this._totalDelta+=e,Math.abs(this._totalDelta)>.1&&(this._zoom(e,t,n),this._totalDelta=0)},pa.prototype._handleWheel=function(e){if(!re(e.target,".djs-scrollable",!0)){var t=this._container;e.preventDefault();var n,i=e.ctrlKey||qo()&&e.metaKey,r=e.shiftKey,o=-1*this._scale;if(o*=i?0===e.deltaMode?.02:.32:0===e.deltaMode?1:16,i){var s=t.getBoundingClientRect(),a={x:e.clientX-s.left,y:e.clientY-s.top};n=Math.sqrt(Math.pow(e.deltaY,2)+Math.pow(e.deltaX,2))*la(e.deltaY)*o,this.zoom(n,a)}else n=r?{dx:o*e.deltaY,dy:0}:{dx:o*e.deltaX,dy:o*e.deltaY},this.scroll(n)}},pa.prototype.stepZoom=function(e,t){var n=aa(ca,10);this._zoom(e,t,n)},pa.prototype._zoom=function(e,t,n){var i=this._canvas,r=e>0?1:-1,o=sa(i.zoom()),s=Math.round(o/n)*n;s+=n*r;var a=Math.pow(10,s);i.zoom(function(e,t){return Math.max(e.min,Math.min(e.max,t))}(ca,a),t)},pa.prototype.toggle=function(e){var t=this._container,n=this._handleWheel,i=this._enabled;return void 0===e&&(e=!i),i!==e&&de[e?"bind":"unbind"](t,"wheel",n,!1),this._enabled=e,e},pa.prototype._init=function(e){this.toggle(e)};const ua={__init__:["zoomScroll"],zoomScroll:["type",pa]};function da(e){js.call(this,e)}i(da,js),da.prototype._navigationModules=[Ys,oa,ua],da.prototype._modules=[].concat(js.prototype._modules,da.prototype._navigationModules);var ha=n(168),fa=n.n(ha),ma=["mousedown","mouseup","mouseover","mouseout","click","dblclick"];function ga(e,t){return t.get(e,!1)}function ya(e){e.preventDefault(),"function"==typeof e.stopPropagation?e.stopPropagation():e.srcEvent&&"function"==typeof e.srcEvent.stopPropagation&&e.srcEvent.stopPropagation(),"function"==typeof e.stopImmediatePropagation&&e.stopImmediatePropagation()}function va(e){function t(t){setTimeout((function(){_(ma,(function(t){de.unbind(e,t,ya,!0)}))}),500)}de.bind(e,"touchstart",(function(t){_(ma,(function(t){de.bind(e,t,ya,!0)}))}),!0),de.bind(e,"touchend",t,!0),de.bind(e,"touchcancel",t,!0);var n=new(fa().Manager)(e,{inputClass:fa().TouchInput,recognizers:[],domEvents:!0}),i=new(fa().Tap),r=new(fa().Pan)({threshold:10}),o=new(fa().Press),s=new(fa().Pinch),a=new(fa().Tap)({event:"doubletap",taps:2});return s.requireFailure(r),s.requireFailure(o),n.add([r,o,s,a,i]),n.reset=function(e){var t=this.recognizers,i=this.session;i.stopped||(n.stop(e),setTimeout((function(){var e,n;for(e=0;n=t[e];e++)n.reset(),n.state=8;i.curRecognizer=null}),0))},n.on("hammer.input",(function(e){e.srcEvent.defaultPrevented&&n.reset(!0)})),n}function ba(e,t,n,i,r){var o,s=ga("dragging",e),a=ga("move",e),l=ga("contextPad",e),c=ga("palette",e);function p(e,t){return function(n){var o=u(n.target),s=o&&i.get(o);return t&&(n.srcEvent.button=t),r.fire(e,n,s)}}function u(e){return re(e,"svg, .djs-element",!0)}function d(e){function n(e){var n=u(e.target),r=n&&i.get(n);if(a&&t.getRootElement()!==r)return a.start(e,r,!0);!function(){var e=0,n=0;function i(i){var r=i.deltaX-e,o=i.deltaY-n;t.scroll({dx:r,dy:o}),e=i.deltaX,n=i.deltaY}function r(e){o.off("panmove",i),o.off("panend",r),o.off("pancancel",r)}o.on("panmove",i),o.on("panend",r),o.on("pancancel",r)}()}(o=va(e)).on("tap",p("element.click")),o.on("doubletap",p("element.dblclick",1)),o.on("panstart",n),o.on("press",n),o.on("pinchstart",(function(e){var n=t.zoom(),i=e.center;function r(e){var r=1-(1-e.scale)/1.5,o=Math.max(.2,Math.min(4,r*n));t.zoom(o,i),ya(e)}function s(e){o.off("pinchmove",r),o.off("pinchend",s),o.off("pinchcancel",s),o.reset(!0)}o.on("pinchmove",r),o.on("pinchend",s),o.on("pinchcancel",s)}))}s&&n.on("drag.move",(function(e){var t=e.originalEvent;if(t&&!(t instanceof MouseEvent)){var n=Bo(t),r=u(document.elementFromPoint(n.x,n.y)),o=r&&i.get(r);o!==e.hover&&(e.hover&&s.out(e),o&&(s.hover({element:o,gfx:r}),e.hover=o,e.hoverGfx=r))}})),l&&n.on("contextPad.create",(function(e){var t=va(e.pad.html);t.on("panstart",(function(e){l.trigger("dragstart",e,!0)})),t.on("press",(function(e){l.trigger("dragstart",e,!0)})),t.on("tap",(function(e){l.trigger("click",e)}))})),c&&n.on("palette.create",(function(e){var t=va(e.container);t.on("panstart",(function(e){c.trigger("dragstart",e,!0)})),t.on("press",(function(e){c.trigger("dragstart",e,!0)})),t.on("tap",(function(e){c.trigger("click",e)}))})),n.on("canvas.init",(function(e){d(e.svg)}))}function xa(e){var t=this;e.on("canvas.init",(function(e){t.addBBoxMarker(e.svg)}))}ba.$inject=["injector","canvas","eventBus","elementRegistry","interactionEvents","touchFix"],xa.$inject=["eventBus"],xa.prototype.addBBoxMarker=function(e){var t={fill:"none",class:"outer-bound-marker"},n=Le("rect");Te(n,{x:-1e4,y:1e4,width:10,height:10}),Te(n,t),ke(e,n);var i=Le("rect");Te(i,{x:1e4,y:1e4,width:10,height:10}),Te(i,t),ke(e,i)};const wa={__depends__:[{__depends__:[Qo],__init__:["touchInteractionEvents"],touchInteractionEvents:["type",ba],touchFix:["type",xa]}]};function _a(e){return e&&e[e.length-1]}function Ea(e){return e.y}function Oa(e){return e.x}var Pa={left:Oa,center:Oa,right:function(e){return e.x+e.width},top:Ea,middle:Ea,bottom:function(e){return e.y+e.height}};function ka(e,t){this._modeling=e,this._rules=t}ka.$inject=["modeling","rules"],ka.prototype._getOrientationDetails=function(e){var t="x",n="width";return-1!==["top","bottom","middle"].indexOf(e)&&(t="y",n="height"),{axis:t,dimension:n}},ka.prototype._isType=function(e,t){return-1!==t.indexOf(e)},ka.prototype._alignmentPosition=function(e,t){var n,i,r,o=this._getOrientationDetails(e),s=o.axis,a=o.dimension,l={},c={},p=!1;if(this._isType(e,["left","top"]))l[e]=t[0][s];else if(this._isType(e,["right","bottom"]))r=_a(t),l[e]=r[s]+r[a];else if(this._isType(e,["center","middle"])){if(_(t,(function(e){var t=e[s]+Math.round(e[a]/2);c[t]?c[t].elements.push(e):c[t]={elements:[e],center:t}})),n=R(c,(function(e){return e.elements.length>1&&(p=!0),e.elements.length})),p)return l[e]=_a(n).center,l;i=t[0],r=_a(t=R(t,(function(e){return e[s]+e[a]}))),l[e]=function(e,t){return Math.round((e[s]+t[s]+t[a])/2)}(i,r)}return l},ka.prototype.trigger=function(e,t){var n,i=this._modeling,r=w(e,(function(e){return!(e.waypoints||e.host||e.labelTarget)}));if(h(n=this._rules.allowed("elements.align",{elements:r}))&&(r=n),!(r.length<2)&&n){var o=R(r,Pa[t]),s=this._alignmentPosition(t,o);i.alignElements(o,s)}};const Sa={__init__:["alignElements"],alignElements:["type",ka]};var Ca=".entry";function Ta(e,t,n,i){this._canvas=e,this._eventBus=n,this._overlays=i;var r=u(t&&t.scale)?t.scale:{min:1,max:1.5};this._overlaysConfig={scale:r},this._current=null,this._init()}function Aa(e,t){return-1!==e.indexOf(t)}Ta.$inject=["canvas","config.contextPad","eventBus","overlays"],Ta.prototype._init=function(){var e=this;this._eventBus.on("selection.changed",(function(t){var n=t.newSelection,i=n.length?1===n.length?n[0]:n:null;i?e.open(i,!0):e.close()})),this._eventBus.on("elements.changed",(function(t){var n=t.elements,i=e._current;if(i){var r=i.target;k(h(r)?r:[r],(function(e){return Aa(n,e)}))&&e.open(r,!0)}}))},Ta.prototype.registerProvider=function(e,t){t||(t=e,e=1e3),this._eventBus.on("contextPad.getProviders",e,(function(e){e.providers.push(t)}))},Ta.prototype.getEntries=function(e){var t=this._getProviders(),n=h(e)?"getMultiElementContextPadEntries":"getContextPadEntries",i={};return _(t,(function(t){if(g(t[n])){var r=t[n](e);g(r)?i=r(i):_(r,(function(e,t){i[t]=e}))}})),i},Ta.prototype.trigger=function(e,t,n){var i,r,o=t.delegateTarget||t.target;return o?(i=J(o,"data-action"),r=t.originalEvent||t,"mouseover"===e?this._timeout=setTimeout((()=>{this._mouseout=this.triggerEntry(i,"hover",r,n)}),300):"mouseout"===e&&(clearTimeout(this._timeout),this._mouseout&&(this._mouseout(),this._mouseout=null)),this.triggerEntry(i,e,r,n)):t.preventDefault()},Ta.prototype.triggerEntry=function(e,t,n,i){if(this.isShown()){var r=this._current.target,o=this._current.entries[e];if(o){var s=o.action;if(!1!==this._eventBus.fire("contextPad.trigger",{entry:o,event:n})){if(g(s)){if("click"===t)return s(n,r,i)}else if(s[t])return s[t](n,r,i);n.preventDefault()}}}},Ta.prototype.open=function(e,t){!t&&this.isOpen(e)||(this.close(),this._updateAndOpen(e))},Ta.prototype._getProviders=function(){var e=this._eventBus.createEvent({type:"contextPad.getProviders",providers:[]});return this._eventBus.fire(e),e.providers},Ta.prototype._updateAndOpen=function(e){var t,n=this.getEntries(e),i=this.getPad(e),r=i.html;_(n,(function(e,n){var i,o=e.group||"default",s=be(e.html||'
');J(s,"data-action",n),(i=we("[data-group="+ys(o)+"]",r))||(J(i=be('
'),"data-group",o),r.appendChild(i)),i.appendChild(s),e.className&&function(e,t){var n=te(e);(t=h(t)?t:t.split(/\s+/g)).forEach((function(e){n.add(e)}))}(s,e.className),e.title&&J(s,"title",e.title),e.imageUrl&&(J(t=be(" "),"src",e.imageUrl),t.style.width="100%",t.style.height="100%",s.appendChild(t))})),te(r).add("open"),this._current={target:e,entries:n,pad:i},this._eventBus.fire("contextPad.open",{current:this._current})},Ta.prototype.getPad=function(e){if(this.isOpen())return this._current.pad;var t=this,n=this._overlays,i=be('
'),r=this._getPosition(e),o=z({html:i},this._overlaysConfig,r);me.bind(i,Ca,"click",(function(e){t.trigger("click",e)})),me.bind(i,Ca,"dragstart",(function(e){t.trigger("dragstart",e)})),me.bind(i,Ca,"mouseover",(function(e){t.trigger("mouseover",e)})),me.bind(i,Ca,"mouseout",(function(e){t.trigger("mouseout",e)})),de.bind(i,"mousedown",(function(e){e.stopPropagation()}));var s=this._canvas.getRootElement();this._overlayId=n.add(s,"context-pad",o);var a=n.get(this._overlayId);return this._eventBus.fire("contextPad.create",{target:e,pad:a}),a},Ta.prototype.close=function(){this.isOpen()&&(clearTimeout(this._timeout),this._overlays.remove(this._overlayId),this._overlayId=null,this._eventBus.fire("contextPad.close",{current:this._current}),this._current=null)},Ta.prototype.isOpen=function(e){var t=this._current;if(!t)return!1;if(!e)return!0;var n=t.target;return h(e)===h(n)&&(h(e)?e.length===n.length&&P(e,(function(e){return Aa(n,e)})):n===e)},Ta.prototype.isShown=function(){return this.isOpen()&&this._overlays.isShown()},Ta.prototype._getPosition=function(e){var t,n=Et(h(e=yn(e)?(t=e).waypoints[t.waypoints.length-1]:e)?e:[e]);return{position:{left:n.x+n.width+12,top:n.y-6}}};const Ma={__depends__:[Qo,ps],contextPad:["type",Ta]};var Da,Ra,Na,$a,ja,Ia,La,Ba,qa,za,Fa={},Va=[],Ha=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Ua=Array.isArray;function Wa(e,t){for(var n in t)e[n]=t[n];return e}function Ga(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function Qa(e,t,n){var i,r,o,s={};for(o in t)"key"==o?i=t[o]:"ref"==o?r=t[o]:s[o]=t[o];if(arguments.length>2&&(s.children=arguments.length>3?Da.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(o in e.defaultProps)void 0===s[o]&&(s[o]=e.defaultProps[o]);return Xa(e,s,i,r,null)}function Xa(e,t,n,i,r){var o={type:e,props:t,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==r?++Na:r,__i:-1,__u:0};return null==r&&null!=Ra.vnode&&Ra.vnode(o),o}function Ka(e){return e.children}function Ya(e,t){this.props=e,this.context=t}function Za(e,t){if(null==t)return e.__?Za(e.__,e.__i+1):null;for(var n;tt&&$a.sort(La));tl.__r=0}function nl(e,t,n,i,r,o,s,a,l,c,p){var u,d,h,f,m,g=i&&i.__k||Va,y=t.length;for(n.__d=l,il(n,t,g),l=n.__d,u=0;u0?Xa(r.type,r.props,r.key,r.ref?r.ref:null,r.__v):r).__=e,r.__b=e.__b+1,o=null,-1!==(a=r.__i=ol(r,n,s,p))&&(p--,(o=n[a])&&(o.__u|=131072)),null==o||null===o.__v?(-1==a&&u--,"function"!=typeof r.type&&(r.__u|=65536)):a!==s&&(a==s-1?u--:a==s+1?u++:(a>s?u--:u++,r.__u|=65536))):r=e.__k[i]=null;if(p)for(i=0;i(null==l||131072&l.__u?0:1))for(;s>=0||a=0){if((l=t[s])&&!(131072&l.__u)&&r==l.key&&o===l.type)return s;s--}if(a=5&&((r||!e&&5===i)&&(s.push(i,0,r,n),i=6),e&&(s.push(i,e,0,n),i=6)),r=""},l=0;l"===t?(i=1,r=""):r=t+r[0]:o?t===o?o="":r+=t:'"'===t||"'"===t?o=t:">"===t?(a(),i=1):i&&("="===t?(i=5,n=r,r=""):"/"===t&&(i<5||">"===e[l][c+1])?(a(),3===i&&(s=s[0]),i=s,(s=s[0]).push(2,0,i),i=0):" "===t||"\t"===t||"\n"===t||"\r"===t?(a(),i=2):r+=t),3===i&&"!--"===r&&(i=4,s=s[0])}return a(),s}(e)),t),arguments,[])).length>1?t:t[0]}.bind(Qa),El=0,Ol=[],Pl=Ra,kl=Pl.__b,Sl=Pl.__r,Cl=Pl.diffed,Tl=Pl.__c,Al=Pl.unmount,Ml=Pl.__;function Dl(e,t){Pl.__h&&Pl.__h(bl,e,El||t),El=0;var n=bl.__H||(bl.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function Rl(e){return El=1,function(e,t,n){var i=Dl(vl++,2);if(i.t=e,!i.__c&&(i.__=[n?n(t):Ul(void 0,t),function(e){var t=i.__N?i.__N[0]:i.__[0],n=i.t(t,e);t!==n&&(i.__N=[n,i.__[1]],i.__c.setState({}))}],i.__c=bl,!bl.u)){var r=function(e,t,n){if(!i.__c.__H)return!0;var r=i.__c.__H.__.filter((function(e){return!!e.__c}));if(r.every((function(e){return!e.__N})))return!o||o.call(this,e,t,n);var s=i.__c.props!==e;return r.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(s=!0)}})),o&&o.call(this,e,t,n)||s};bl.u=!0;var o=bl.shouldComponentUpdate,s=bl.componentWillUpdate;bl.componentWillUpdate=function(e,t,n){if(this.__e){var i=o;o=void 0,r(e,t,n),o=i}s&&s.call(this,e,t,n)},bl.shouldComponentUpdate=r}return i.__N||i.__}(Ul,e)}function Nl(e,t){var n=Dl(vl++,3);!Pl.__s&&Hl(n.__H,t)&&(n.__=e,n.i=t,bl.__H.__h.push(n))}function $l(e,t){var n=Dl(vl++,4);!Pl.__s&&Hl(n.__H,t)&&(n.__=e,n.i=t,bl.__h.push(n))}function jl(e){return El=5,Il((function(){return{current:e}}),[])}function Il(e,t){var n=Dl(vl++,7);return Hl(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function Ll(e,t){return El=8,Il((function(){return e}),t)}function Bl(){for(var e;e=Ol.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Fl),e.__H.__h.forEach(Vl),e.__H.__h=[]}catch(t){e.__H.__h=[],Pl.__e(t,e.__v)}}Pl.__b=function(e){bl=null,kl&&kl(e)},Pl.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Ml&&Ml(e,t)},Pl.__r=function(e){Sl&&Sl(e),vl=0;var t=(bl=e.__c).__H;t&&(xl===bl?(t.__h=[],bl.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.i=e.__N=void 0}))):(t.__h.forEach(Fl),t.__h.forEach(Vl),t.__h=[],vl=0)),xl=bl},Pl.diffed=function(e){Cl&&Cl(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==Ol.push(t)&&wl===Pl.requestAnimationFrame||((wl=Pl.requestAnimationFrame)||zl)(Bl)),t.__H.__.forEach((function(e){e.i&&(e.__H=e.i),e.i=void 0}))),xl=bl=null},Pl.__c=function(e,t){t.some((function(e){try{e.__h.forEach(Fl),e.__h=e.__h.filter((function(e){return!e.__||Vl(e)}))}catch(n){t.some((function(e){e.__h&&(e.__h=[])})),t=[],Pl.__e(n,e.__v)}})),Tl&&Tl(e,t)},Pl.unmount=function(e){Al&&Al(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach((function(e){try{Fl(e)}catch(e){t=e}})),n.__H=void 0,t&&Pl.__e(t,n.__v))};var ql="function"==typeof requestAnimationFrame;function zl(e){var t,n=function(){clearTimeout(i),ql&&cancelAnimationFrame(t),setTimeout(e)},i=setTimeout(n,100);ql&&(t=requestAnimationFrame(n))}function Fl(e){var t=bl,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),bl=t}function Vl(e){var t=bl;e.__c=e.__(),bl=t}function Hl(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function Ul(e,t){return"function"==typeof t?t(e):t}function Wl(e){var t,n,i="";if("string"==typeof e||"number"==typeof e)i+=e;else if("object"==typeof e)if(Array.isArray(e)){var r=e.length;for(t=0;t{var e,t={505:(e,t,n)=>{e.exports=n(15)},592:(e,t,n)=>{"use strict";var i=n(516),r=n(522),o=n(948),s=n(106),a=n(615),l=n(631),c=n(202),p=n(763);e.exports=function(e){return new Promise((function(t,n){var u=e.data,d=e.headers,h=e.responseType;i.isFormData(u)&&delete d["Content-Type"];var f=new XMLHttpRequest;if(e.auth){var m=e.auth.username||"",g=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";d.Authorization="Basic "+btoa(m+":"+g)}var y=a(e.baseURL,e.url);function v(){if(f){var i="getAllResponseHeaders"in f?l(f.getAllResponseHeaders()):null,o={data:h&&"text"!==h&&"json"!==h?f.response:f.responseText,status:f.status,statusText:f.statusText,headers:i,config:e,request:f};r(t,n,o),f=null}}if(f.open(e.method.toUpperCase(),s(y,e.params,e.paramsSerializer),!0),f.timeout=e.timeout,"onloadend"in f?f.onloadend=v:f.onreadystatechange=function(){f&&4===f.readyState&&(0!==f.status||f.responseURL&&0===f.responseURL.indexOf("file:"))&&setTimeout(v)},f.onabort=function(){f&&(n(p("Request aborted",e,"ECONNABORTED",f)),f=null)},f.onerror=function(){n(p("Network Error",e,null,f)),f=null},f.ontimeout=function(){var t="timeout of "+e.timeout+"ms exceeded";e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(p(t,e,e.transitional&&e.transitional.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",f)),f=null},i.isStandardBrowserEnv()){var b=(e.withCredentials||c(y))&&e.xsrfCookieName?o.read(e.xsrfCookieName):void 0;b&&(d[e.xsrfHeaderName]=b)}"setRequestHeader"in f&&i.forEach(d,(function(e,t){void 0===u&&"content-type"===t.toLowerCase()?delete d[t]:f.setRequestHeader(t,e)})),i.isUndefined(e.withCredentials)||(f.withCredentials=!!e.withCredentials),h&&"json"!==h&&(f.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&f.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&f.upload&&f.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then((function(e){f&&(f.abort(),n(e),f=null)})),u||(u=null),f.send(u)}))}},15:(e,t,n)=>{"use strict";var i=n(516),r=n(12),o=n(155),s=n(343);function a(e){var t=new o(e),n=r(o.prototype.request,t);return i.extend(n,o.prototype,t),i.extend(n,t),n}var l=a(n(987));l.Axios=o,l.create=function(e){return a(s(l.defaults,e))},l.Cancel=n(928),l.CancelToken=n(191),l.isCancel=n(864),l.all=function(e){return Promise.all(e)},l.spread=n(980),l.isAxiosError=n(19),e.exports=l,e.exports.default=l},928:e=>{"use strict";function t(e){this.message=e}t.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},t.prototype.__CANCEL__=!0,e.exports=t},191:(e,t,n)=>{"use strict";var i=n(928);function r(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var n=this;e((function(e){n.reason||(n.reason=new i(e),t(n.reason))}))}r.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},r.source=function(){var e;return{token:new r((function(t){e=t})),cancel:e}},e.exports=r},864:e=>{"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},155:(e,t,n)=>{"use strict";var i=n(516),r=n(106),o=n(471),s=n(490),a=n(343),l=n(841),c=l.validators;function p(e){this.defaults=e,this.interceptors={request:new o,response:new o}}p.prototype.request=function(e){"string"==typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=a(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var t=e.transitional;void 0!==t&&l.assertOptions(t,{silentJSONParsing:c.transitional(c.boolean,"1.0.0"),forcedJSONParsing:c.transitional(c.boolean,"1.0.0"),clarifyTimeoutError:c.transitional(c.boolean,"1.0.0")},!1);var n=[],i=!0;this.interceptors.request.forEach((function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(i=i&&t.synchronous,n.unshift(t.fulfilled,t.rejected))}));var r,o=[];if(this.interceptors.response.forEach((function(e){o.push(e.fulfilled,e.rejected)})),!i){var p=[s,void 0];for(Array.prototype.unshift.apply(p,n),p=p.concat(o),r=Promise.resolve(e);p.length;)r=r.then(p.shift(),p.shift());return r}for(var u=e;n.length;){var d=n.shift(),h=n.shift();try{u=d(u)}catch(e){h(e);break}}try{r=s(u)}catch(e){return Promise.reject(e)}for(;o.length;)r=r.then(o.shift(),o.shift());return r},p.prototype.getUri=function(e){return e=a(this.defaults,e),r(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},i.forEach(["delete","get","head","options"],(function(e){p.prototype[e]=function(t,n){return this.request(a(n||{},{method:e,url:t,data:(n||{}).data}))}})),i.forEach(["post","put","patch"],(function(e){p.prototype[e]=function(t,n,i){return this.request(a(i||{},{method:e,url:t,data:n}))}})),e.exports=p},471:(e,t,n)=>{"use strict";var i=n(516);function r(){this.handlers=[]}r.prototype.use=function(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1},r.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},r.prototype.forEach=function(e){i.forEach(this.handlers,(function(t){null!==t&&e(t)}))},e.exports=r},615:(e,t,n)=>{"use strict";var i=n(137),r=n(680);e.exports=function(e,t){return e&&!i(t)?r(e,t):t}},763:(e,t,n)=>{"use strict";var i=n(449);e.exports=function(e,t,n,r,o){var s=new Error(e);return i(s,t,n,r,o)}},490:(e,t,n)=>{"use strict";var i=n(516),r=n(881),o=n(864),s=n(987);function a(e){e.cancelToken&&e.cancelToken.throwIfRequested()}e.exports=function(e){return a(e),e.headers=e.headers||{},e.data=r.call(e,e.data,e.headers,e.transformRequest),e.headers=i.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),i.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||s.adapter)(e).then((function(t){return a(e),t.data=r.call(e,t.data,t.headers,e.transformResponse),t}),(function(t){return o(t)||(a(e),t&&t.response&&(t.response.data=r.call(e,t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))}},449:e=>{"use strict";e.exports=function(e,t,n,i,r){return e.config=t,n&&(e.code=n),e.request=i,e.response=r,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},e}},343:(e,t,n)=>{"use strict";var i=n(516);e.exports=function(e,t){t=t||{};var n={},r=["url","method","data"],o=["headers","auth","proxy","params"],s=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],a=["validateStatus"];function l(e,t){return i.isPlainObject(e)&&i.isPlainObject(t)?i.merge(e,t):i.isPlainObject(t)?i.merge({},t):i.isArray(t)?t.slice():t}function c(r){i.isUndefined(t[r])?i.isUndefined(e[r])||(n[r]=l(void 0,e[r])):n[r]=l(e[r],t[r])}i.forEach(r,(function(e){i.isUndefined(t[e])||(n[e]=l(void 0,t[e]))})),i.forEach(o,c),i.forEach(s,(function(r){i.isUndefined(t[r])?i.isUndefined(e[r])||(n[r]=l(void 0,e[r])):n[r]=l(void 0,t[r])})),i.forEach(a,(function(i){i in t?n[i]=l(e[i],t[i]):i in e&&(n[i]=l(void 0,e[i]))}));var p=r.concat(o).concat(s).concat(a),u=Object.keys(e).concat(Object.keys(t)).filter((function(e){return-1===p.indexOf(e)}));return i.forEach(u,c),n}},522:(e,t,n)=>{"use strict";var i=n(763);e.exports=function(e,t,n){var r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(i("Request failed with status code "+n.status,n.config,null,n.request,n)):e(n)}},881:(e,t,n)=>{"use strict";var i=n(516),r=n(987);e.exports=function(e,t,n){var o=this||r;return i.forEach(n,(function(n){e=n.call(o,e,t)})),e}},987:(e,t,n)=>{"use strict";var i=n(225),r=n(516),o=n(18),s=n(449),a={"Content-Type":"application/x-www-form-urlencoded"};function l(e,t){!r.isUndefined(e)&&r.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var c,p={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:(("undefined"!=typeof XMLHttpRequest||void 0!==i&&"[object process]"===Object.prototype.toString.call(i))&&(c=n(592)),c),transformRequest:[function(e,t){return o(t,"Accept"),o(t,"Content-Type"),r.isFormData(e)||r.isArrayBuffer(e)||r.isBuffer(e)||r.isStream(e)||r.isFile(e)||r.isBlob(e)?e:r.isArrayBufferView(e)?e.buffer:r.isURLSearchParams(e)?(l(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):r.isObject(e)||t&&"application/json"===t["Content-Type"]?(l(t,"application/json"),function(e,t,n){if(r.isString(e))try{return(t||JSON.parse)(e),r.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional,n=t&&t.silentJSONParsing,i=t&&t.forcedJSONParsing,o=!n&&"json"===this.responseType;if(o||i&&r.isString(e)&&e.length)try{return JSON.parse(e)}catch(e){if(o){if("SyntaxError"===e.name)throw s(e,this,"E_JSON_PARSE");throw e}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300}};p.headers={common:{Accept:"application/json, text/plain, */*"}},r.forEach(["delete","get","head"],(function(e){p.headers[e]={}})),r.forEach(["post","put","patch"],(function(e){p.headers[e]=r.merge(a)})),e.exports=p},12:e=>{"use strict";e.exports=function(e,t){return function(){for(var n=new Array(arguments.length),i=0;i{"use strict";var i=n(516);function r(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(e,t,n){if(!t)return e;var o;if(n)o=n(t);else if(i.isURLSearchParams(t))o=t.toString();else{var s=[];i.forEach(t,(function(e,t){null!=e&&(i.isArray(e)?t+="[]":e=[e],i.forEach(e,(function(e){i.isDate(e)?e=e.toISOString():i.isObject(e)&&(e=JSON.stringify(e)),s.push(r(t)+"="+r(e))})))})),o=s.join("&")}if(o){var a=e.indexOf("#");-1!==a&&(e=e.slice(0,a)),e+=(-1===e.indexOf("?")?"?":"&")+o}return e}},680:e=>{"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},948:(e,t,n)=>{"use strict";var i=n(516);e.exports=i.isStandardBrowserEnv()?{write:function(e,t,n,r,o,s){var a=[];a.push(e+"="+encodeURIComponent(t)),i.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),i.isString(r)&&a.push("path="+r),i.isString(o)&&a.push("domain="+o),!0===s&&a.push("secure"),document.cookie=a.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},137:e=>{"use strict";e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},19:e=>{"use strict";e.exports=function(e){return"object"==typeof e&&!0===e.isAxiosError}},202:(e,t,n)=>{"use strict";var i=n(516);e.exports=i.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function r(e){var i=e;return t&&(n.setAttribute("href",i),i=n.href),n.setAttribute("href",i),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return e=r(window.location.href),function(t){var n=i.isString(t)?r(t):t;return n.protocol===e.protocol&&n.host===e.host}}():function(){return!0}},18:(e,t,n)=>{"use strict";var i=n(516);e.exports=function(e,t){i.forEach(e,(function(n,i){i!==t&&i.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[i])}))}},631:(e,t,n)=>{"use strict";var i=n(516),r=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,n,o,s={};return e?(i.forEach(e.split("\n"),(function(e){if(o=e.indexOf(":"),t=i.trim(e.substr(0,o)).toLowerCase(),n=i.trim(e.substr(o+1)),t){if(s[t]&&r.indexOf(t)>=0)return;s[t]="set-cookie"===t?(s[t]?s[t]:[]).concat([n]):s[t]?s[t]+", "+n:n}})),s):s}},980:e=>{"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},841:(e,t,n)=>{"use strict";var i=n(198),r={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){r[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));var o={},s=i.version.split(".");function a(e,t){for(var n=t?t.split("."):s,i=e.split("."),r=0;r<3;r++){if(n[r]>i[r])return!0;if(n[r]0;){var o=i[r],s=t[o];if(s){var a=e[o],l=void 0===a||s(a,o,e);if(!0!==l)throw new TypeError("option "+o+" must be "+l)}else if(!0!==n)throw Error("Unknown option "+o)}},validators:r}},516:(e,t,n)=>{"use strict";var i=n(12),r=Object.prototype.toString;function o(e){return"[object Array]"===r.call(e)}function s(e){return void 0===e}function a(e){return null!==e&&"object"==typeof e}function l(e){if("[object Object]"!==r.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function c(e){return"[object Function]"===r.call(e)}function p(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),o(e))for(var n=0,i=e.length;n{n(571),window.BpmnModeler=n(74),$(document).ready((function(){$('[data-toggle="tooltip"]').tooltip();var e=document.querySelectorAll(".sidebar-platform .sidebar-list .li-parent"),t=document.querySelector(".sidebar-platform .sidebar-content");e.length&&e.forEach((function(e,n){e.nextElementSibling;e.addEventListener("mouseover",(function(){t.style.overflow="visible",e.style.top=0===n?"-50px":"".concat(50*n,"px")})),e.addEventListener("mouseout",(function(){t.style.overflow=null,e.style.top=null}))})),$(".tree-toggle").click((function(){$("#app").hasClass("menu-open")&&($(this).parent().children("ul.tree-content").slideToggle(200),$(this).toggleClass("active"))})),$(".menu-trigger").click((function(){axios.get("/ru/set_open_menu").then((function(e){console.log(e.data)})),$("#app").hasClass("menu-open")?$("#app").removeClass("menu-open"):$("#app").addClass("menu-open")})),$(".filter-trigger").on("click",(function(e){e.stopPropagation(),$("#filter_block").slideToggle(200),$(this).toggleClass("active")})),Waves.init(),Waves.attach(".sidebar-list li a"),Waves.attach(".sidebar-list li .tree-toggle"),Waves.attach(".navbar-platform .item-nav"),Waves.attach(".btn"),$('[data-toggle="tooltip"]').tooltip()}))},571:(e,t,n)=>{"use strict";n.r(t);var i=n(692),r=n.n(i),o=n(454);window._=n(543);try{n(454)}catch(e){}window.axios=n(505),window.axios.defaults.headers.common["X-Requested-With"]="XMLHttpRequest",window.$=window.jQuery=r(),n(458),window.bootstrap=o},454:(e,t,n)=>{"use strict";n.r(t),n.d(t,{Alert:()=>Ct,Button:()=>At,Carousel:()=>un,Collapse:()=>Pn,Dropdown:()=>Kn,Modal:()=>Mi,Offcanvas:()=>Xi,Popover:()=>xr,ScrollSpy:()=>Mr,Tab:()=>eo,Toast:()=>go,Tooltip:()=>mr});var i={};n.r(i),n.d(i,{afterMain:()=>E,afterRead:()=>x,afterWrite:()=>k,applyStyles:()=>R,arrow:()=>J,auto:()=>l,basePlacements:()=>c,beforeMain:()=>w,beforeRead:()=>v,beforeWrite:()=>O,bottom:()=>o,clippingParents:()=>d,computeStyles:()=>ie,createPopper:()=>Re,createPopperBase:()=>De,createPopperLite:()=>Ne,detectOverflow:()=>be,end:()=>u,eventListeners:()=>oe,flip:()=>xe,hide:()=>Ee,left:()=>a,main:()=>_,modifierPhases:()=>S,offset:()=>Oe,placements:()=>y,popper:()=>f,popperGenerator:()=>Me,popperOffsets:()=>Pe,preventOverflow:()=>ke,read:()=>b,reference:()=>m,right:()=>s,start:()=>p,top:()=>r,variationPlacements:()=>g,viewport:()=>h,write:()=>P});var r="top",o="bottom",s="right",a="left",l="auto",c=[r,o,s,a],p="start",u="end",d="clippingParents",h="viewport",f="popper",m="reference",g=c.reduce((function(e,t){return e.concat([t+"-"+p,t+"-"+u])}),[]),y=[].concat(c,[l]).reduce((function(e,t){return e.concat([t,t+"-"+p,t+"-"+u])}),[]),v="beforeRead",b="read",x="afterRead",w="beforeMain",_="main",E="afterMain",O="beforeWrite",P="write",k="afterWrite",S=[v,b,x,w,_,E,O,P,k];function C(e){return e?(e.nodeName||"").toLowerCase():null}function T(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function A(e){return e instanceof T(e).Element||e instanceof Element}function M(e){return e instanceof T(e).HTMLElement||e instanceof HTMLElement}function D(e){return"undefined"!=typeof ShadowRoot&&(e instanceof T(e).ShadowRoot||e instanceof ShadowRoot)}const R={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var n=t.styles[e]||{},i=t.attributes[e]||{},r=t.elements[e];M(r)&&C(r)&&(Object.assign(r.style,n),Object.keys(i).forEach((function(e){var t=i[e];!1===t?r.removeAttribute(e):r.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach((function(e){var i=t.elements[e],r=t.attributes[e]||{},o=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{});M(i)&&C(i)&&(Object.assign(i.style,o),Object.keys(r).forEach((function(e){i.removeAttribute(e)})))}))}},requires:["computeStyles"]};function N(e){return e.split("-")[0]}var $=Math.max,j=Math.min,I=Math.round;function L(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map((function(e){return e.brand+"/"+e.version})).join(" "):navigator.userAgent}function B(){return!/^((?!chrome|android).)*safari/i.test(L())}function q(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var i=e.getBoundingClientRect(),r=1,o=1;t&&M(e)&&(r=e.offsetWidth>0&&I(i.width)/e.offsetWidth||1,o=e.offsetHeight>0&&I(i.height)/e.offsetHeight||1);var s=(A(e)?T(e):window).visualViewport,a=!B()&&n,l=(i.left+(a&&s?s.offsetLeft:0))/r,c=(i.top+(a&&s?s.offsetTop:0))/o,p=i.width/r,u=i.height/o;return{width:p,height:u,top:c,right:l+p,bottom:c+u,left:l,x:l,y:c}}function z(e){var t=q(e),n=e.offsetWidth,i=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-i)<=1&&(i=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:i}}function F(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&D(n)){var i=t;do{if(i&&e.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function V(e){return T(e).getComputedStyle(e)}function H(e){return["table","td","th"].indexOf(C(e))>=0}function U(e){return((A(e)?e.ownerDocument:e.document)||window.document).documentElement}function W(e){return"html"===C(e)?e:e.assignedSlot||e.parentNode||(D(e)?e.host:null)||U(e)}function G(e){return M(e)&&"fixed"!==V(e).position?e.offsetParent:null}function Q(e){for(var t=T(e),n=G(e);n&&H(n)&&"static"===V(n).position;)n=G(n);return n&&("html"===C(n)||"body"===C(n)&&"static"===V(n).position)?t:n||function(e){var t=/firefox/i.test(L());if(/Trident/i.test(L())&&M(e)&&"fixed"===V(e).position)return null;var n=W(e);for(D(n)&&(n=n.host);M(n)&&["html","body"].indexOf(C(n))<0;){var i=V(n);if("none"!==i.transform||"none"!==i.perspective||"paint"===i.contain||-1!==["transform","perspective"].indexOf(i.willChange)||t&&"filter"===i.willChange||t&&i.filter&&"none"!==i.filter)return n;n=n.parentNode}return null}(e)||t}function X(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function K(e,t,n){return $(e,j(t,n))}function Y(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function Z(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}const J={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,i=e.name,l=e.options,p=n.elements.arrow,u=n.modifiersData.popperOffsets,d=N(n.placement),h=X(d),f=[a,s].indexOf(d)>=0?"height":"width";if(p&&u){var m=function(e,t){return Y("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:Z(e,c))}(l.padding,n),g=z(p),y="y"===h?r:a,v="y"===h?o:s,b=n.rects.reference[f]+n.rects.reference[h]-u[h]-n.rects.popper[f],x=u[h]-n.rects.reference[h],w=Q(p),_=w?"y"===h?w.clientHeight||0:w.clientWidth||0:0,E=b/2-x/2,O=m[y],P=_-g[f]-m[v],k=_/2-g[f]/2+E,S=K(O,k,P),C=h;n.modifiersData[i]=((t={})[C]=S,t.centerOffset=S-k,t)}},effect:function(e){var t=e.state,n=e.options.element,i=void 0===n?"[data-popper-arrow]":n;null!=i&&("string"!=typeof i||(i=t.elements.popper.querySelector(i)))&&F(t.elements.popper,i)&&(t.elements.arrow=i)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function ee(e){return e.split("-")[1]}var te={top:"auto",right:"auto",bottom:"auto",left:"auto"};function ne(e){var t,n=e.popper,i=e.popperRect,l=e.placement,c=e.variation,p=e.offsets,d=e.position,h=e.gpuAcceleration,f=e.adaptive,m=e.roundOffsets,g=e.isFixed,y=p.x,v=void 0===y?0:y,b=p.y,x=void 0===b?0:b,w="function"==typeof m?m({x:v,y:x}):{x:v,y:x};v=w.x,x=w.y;var _=p.hasOwnProperty("x"),E=p.hasOwnProperty("y"),O=a,P=r,k=window;if(f){var S=Q(n),C="clientHeight",A="clientWidth";if(S===T(n)&&"static"!==V(S=U(n)).position&&"absolute"===d&&(C="scrollHeight",A="scrollWidth"),l===r||(l===a||l===s)&&c===u)P=o,x-=(g&&S===k&&k.visualViewport?k.visualViewport.height:S[C])-i.height,x*=h?1:-1;if(l===a||(l===r||l===o)&&c===u)O=s,v-=(g&&S===k&&k.visualViewport?k.visualViewport.width:S[A])-i.width,v*=h?1:-1}var M,D=Object.assign({position:d},f&&te),R=!0===m?function(e,t){var n=e.x,i=e.y,r=t.devicePixelRatio||1;return{x:I(n*r)/r||0,y:I(i*r)/r||0}}({x:v,y:x},T(n)):{x:v,y:x};return v=R.x,x=R.y,h?Object.assign({},D,((M={})[P]=E?"0":"",M[O]=_?"0":"",M.transform=(k.devicePixelRatio||1)<=1?"translate("+v+"px, "+x+"px)":"translate3d("+v+"px, "+x+"px, 0)",M)):Object.assign({},D,((t={})[P]=E?x+"px":"",t[O]=_?v+"px":"",t.transform="",t))}const ie={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,i=n.gpuAcceleration,r=void 0===i||i,o=n.adaptive,s=void 0===o||o,a=n.roundOffsets,l=void 0===a||a,c={placement:N(t.placement),variation:ee(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:r,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,ne(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:s,roundOffsets:l})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,ne(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}};var re={passive:!0};const oe={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,n=e.instance,i=e.options,r=i.scroll,o=void 0===r||r,s=i.resize,a=void 0===s||s,l=T(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&c.forEach((function(e){e.addEventListener("scroll",n.update,re)})),a&&l.addEventListener("resize",n.update,re),function(){o&&c.forEach((function(e){e.removeEventListener("scroll",n.update,re)})),a&&l.removeEventListener("resize",n.update,re)}},data:{}};var se={left:"right",right:"left",bottom:"top",top:"bottom"};function ae(e){return e.replace(/left|right|bottom|top/g,(function(e){return se[e]}))}var le={start:"end",end:"start"};function ce(e){return e.replace(/start|end/g,(function(e){return le[e]}))}function pe(e){var t=T(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function ue(e){return q(U(e)).left+pe(e).scrollLeft}function de(e){var t=V(e),n=t.overflow,i=t.overflowX,r=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+r+i)}function he(e){return["html","body","#document"].indexOf(C(e))>=0?e.ownerDocument.body:M(e)&&de(e)?e:he(W(e))}function fe(e,t){var n;void 0===t&&(t=[]);var i=he(e),r=i===(null==(n=e.ownerDocument)?void 0:n.body),o=T(i),s=r?[o].concat(o.visualViewport||[],de(i)?i:[]):i,a=t.concat(s);return r?a:a.concat(fe(W(s)))}function me(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function ge(e,t,n){return t===h?me(function(e,t){var n=T(e),i=U(e),r=n.visualViewport,o=i.clientWidth,s=i.clientHeight,a=0,l=0;if(r){o=r.width,s=r.height;var c=B();(c||!c&&"fixed"===t)&&(a=r.offsetLeft,l=r.offsetTop)}return{width:o,height:s,x:a+ue(e),y:l}}(e,n)):A(t)?function(e,t){var n=q(e,!1,"fixed"===t);return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}(t,n):me(function(e){var t,n=U(e),i=pe(e),r=null==(t=e.ownerDocument)?void 0:t.body,o=$(n.scrollWidth,n.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),s=$(n.scrollHeight,n.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),a=-i.scrollLeft+ue(e),l=-i.scrollTop;return"rtl"===V(r||n).direction&&(a+=$(n.clientWidth,r?r.clientWidth:0)-o),{width:o,height:s,x:a,y:l}}(U(e)))}function ye(e,t,n,i){var r="clippingParents"===t?function(e){var t=fe(W(e)),n=["absolute","fixed"].indexOf(V(e).position)>=0&&M(e)?Q(e):e;return A(n)?t.filter((function(e){return A(e)&&F(e,n)&&"body"!==C(e)})):[]}(e):[].concat(t),o=[].concat(r,[n]),s=o[0],a=o.reduce((function(t,n){var r=ge(e,n,i);return t.top=$(r.top,t.top),t.right=j(r.right,t.right),t.bottom=j(r.bottom,t.bottom),t.left=$(r.left,t.left),t}),ge(e,s,i));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function ve(e){var t,n=e.reference,i=e.element,l=e.placement,c=l?N(l):null,d=l?ee(l):null,h=n.x+n.width/2-i.width/2,f=n.y+n.height/2-i.height/2;switch(c){case r:t={x:h,y:n.y-i.height};break;case o:t={x:h,y:n.y+n.height};break;case s:t={x:n.x+n.width,y:f};break;case a:t={x:n.x-i.width,y:f};break;default:t={x:n.x,y:n.y}}var m=c?X(c):null;if(null!=m){var g="y"===m?"height":"width";switch(d){case p:t[m]=t[m]-(n[g]/2-i[g]/2);break;case u:t[m]=t[m]+(n[g]/2-i[g]/2)}}return t}function be(e,t){void 0===t&&(t={});var n=t,i=n.placement,a=void 0===i?e.placement:i,l=n.strategy,p=void 0===l?e.strategy:l,u=n.boundary,g=void 0===u?d:u,y=n.rootBoundary,v=void 0===y?h:y,b=n.elementContext,x=void 0===b?f:b,w=n.altBoundary,_=void 0!==w&&w,E=n.padding,O=void 0===E?0:E,P=Y("number"!=typeof O?O:Z(O,c)),k=x===f?m:f,S=e.rects.popper,C=e.elements[_?k:x],T=ye(A(C)?C:C.contextElement||U(e.elements.popper),g,v,p),M=q(e.elements.reference),D=ve({reference:M,element:S,strategy:"absolute",placement:a}),R=me(Object.assign({},S,D)),N=x===f?R:M,$={top:T.top-N.top+P.top,bottom:N.bottom-T.bottom+P.bottom,left:T.left-N.left+P.left,right:N.right-T.right+P.right},j=e.modifiersData.offset;if(x===f&&j){var I=j[a];Object.keys($).forEach((function(e){var t=[s,o].indexOf(e)>=0?1:-1,n=[r,o].indexOf(e)>=0?"y":"x";$[e]+=I[n]*t}))}return $}const xe={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,i=e.name;if(!t.modifiersData[i]._skip){for(var u=n.mainAxis,d=void 0===u||u,h=n.altAxis,f=void 0===h||h,m=n.fallbackPlacements,v=n.padding,b=n.boundary,x=n.rootBoundary,w=n.altBoundary,_=n.flipVariations,E=void 0===_||_,O=n.allowedAutoPlacements,P=t.options.placement,k=N(P),S=m||(k===P||!E?[ae(P)]:function(e){if(N(e)===l)return[];var t=ae(e);return[ce(e),t,ce(t)]}(P)),C=[P].concat(S).reduce((function(e,n){return e.concat(N(n)===l?function(e,t){void 0===t&&(t={});var n=t,i=n.placement,r=n.boundary,o=n.rootBoundary,s=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,p=void 0===l?y:l,u=ee(i),d=u?a?g:g.filter((function(e){return ee(e)===u})):c,h=d.filter((function(e){return p.indexOf(e)>=0}));0===h.length&&(h=d);var f=h.reduce((function(t,n){return t[n]=be(e,{placement:n,boundary:r,rootBoundary:o,padding:s})[N(n)],t}),{});return Object.keys(f).sort((function(e,t){return f[e]-f[t]}))}(t,{placement:n,boundary:b,rootBoundary:x,padding:v,flipVariations:E,allowedAutoPlacements:O}):n)}),[]),T=t.rects.reference,A=t.rects.popper,M=new Map,D=!0,R=C[0],$=0;$=0,q=B?"width":"height",z=be(t,{placement:j,boundary:b,rootBoundary:x,altBoundary:w,padding:v}),F=B?L?s:a:L?o:r;T[q]>A[q]&&(F=ae(F));var V=ae(F),H=[];if(d&&H.push(z[I]<=0),f&&H.push(z[F]<=0,z[V]<=0),H.every((function(e){return e}))){R=j,D=!1;break}M.set(j,H)}if(D)for(var U=function(e){var t=C.find((function(t){var n=M.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return R=t,"break"},W=E?3:1;W>0;W--){if("break"===U(W))break}t.placement!==R&&(t.modifiersData[i]._skip=!0,t.placement=R,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function we(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function _e(e){return[r,s,o,a].some((function(t){return e[t]>=0}))}const Ee={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,i=t.rects.reference,r=t.rects.popper,o=t.modifiersData.preventOverflow,s=be(t,{elementContext:"reference"}),a=be(t,{altBoundary:!0}),l=we(s,i),c=we(a,r,o),p=_e(l),u=_e(c);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:p,hasPopperEscaped:u},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":p,"data-popper-escaped":u})}};const Oe={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,i=e.name,o=n.offset,l=void 0===o?[0,0]:o,c=y.reduce((function(e,n){return e[n]=function(e,t,n){var i=N(e),o=[a,r].indexOf(i)>=0?-1:1,l="function"==typeof n?n(Object.assign({},t,{placement:e})):n,c=l[0],p=l[1];return c=c||0,p=(p||0)*o,[a,s].indexOf(i)>=0?{x:p,y:c}:{x:c,y:p}}(n,t.rects,l),e}),{}),p=c[t.placement],u=p.x,d=p.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=u,t.modifiersData.popperOffsets.y+=d),t.modifiersData[i]=c}};const Pe={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=ve({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}};const ke={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,i=e.name,l=n.mainAxis,c=void 0===l||l,u=n.altAxis,d=void 0!==u&&u,h=n.boundary,f=n.rootBoundary,m=n.altBoundary,g=n.padding,y=n.tether,v=void 0===y||y,b=n.tetherOffset,x=void 0===b?0:b,w=be(t,{boundary:h,rootBoundary:f,padding:g,altBoundary:m}),_=N(t.placement),E=ee(t.placement),O=!E,P=X(_),k="x"===P?"y":"x",S=t.modifiersData.popperOffsets,C=t.rects.reference,T=t.rects.popper,A="function"==typeof x?x(Object.assign({},t.rects,{placement:t.placement})):x,M="number"==typeof A?{mainAxis:A,altAxis:A}:Object.assign({mainAxis:0,altAxis:0},A),D=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,R={x:0,y:0};if(S){if(c){var I,L="y"===P?r:a,B="y"===P?o:s,q="y"===P?"height":"width",F=S[P],V=F+w[L],H=F-w[B],U=v?-T[q]/2:0,W=E===p?C[q]:T[q],G=E===p?-T[q]:-C[q],Y=t.elements.arrow,Z=v&&Y?z(Y):{width:0,height:0},J=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},te=J[L],ne=J[B],ie=K(0,C[q],Z[q]),re=O?C[q]/2-U-ie-te-M.mainAxis:W-ie-te-M.mainAxis,oe=O?-C[q]/2+U+ie+ne+M.mainAxis:G+ie+ne+M.mainAxis,se=t.elements.arrow&&Q(t.elements.arrow),ae=se?"y"===P?se.clientTop||0:se.clientLeft||0:0,le=null!=(I=null==D?void 0:D[P])?I:0,ce=F+oe-le,pe=K(v?j(V,F+re-le-ae):V,F,v?$(H,ce):H);S[P]=pe,R[P]=pe-F}if(d){var ue,de="x"===P?r:a,he="x"===P?o:s,fe=S[k],me="y"===k?"height":"width",ge=fe+w[de],ye=fe-w[he],ve=-1!==[r,a].indexOf(_),xe=null!=(ue=null==D?void 0:D[k])?ue:0,we=ve?ge:fe-C[me]-T[me]-xe+M.altAxis,_e=ve?fe+C[me]+T[me]-xe-M.altAxis:ye,Ee=v&&ve?function(e,t,n){var i=K(e,t,n);return i>n?n:i}(we,fe,_e):K(v?we:ge,fe,v?_e:ye);S[k]=Ee,R[k]=Ee-fe}t.modifiersData[i]=R}},requiresIfExists:["offset"]};function Se(e,t,n){void 0===n&&(n=!1);var i,r,o=M(t),s=M(t)&&function(e){var t=e.getBoundingClientRect(),n=I(t.width)/e.offsetWidth||1,i=I(t.height)/e.offsetHeight||1;return 1!==n||1!==i}(t),a=U(t),l=q(e,s,n),c={scrollLeft:0,scrollTop:0},p={x:0,y:0};return(o||!o&&!n)&&(("body"!==C(t)||de(a))&&(c=(i=t)!==T(i)&&M(i)?{scrollLeft:(r=i).scrollLeft,scrollTop:r.scrollTop}:pe(i)),M(t)?((p=q(t,!0)).x+=t.clientLeft,p.y+=t.clientTop):a&&(p.x=ue(a))),{x:l.left+c.scrollLeft-p.x,y:l.top+c.scrollTop-p.y,width:l.width,height:l.height}}function Ce(e){var t=new Map,n=new Set,i=[];function r(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var i=t.get(e);i&&r(i)}})),i.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||r(e)})),i}var Te={placement:"bottom",modifiers:[],strategy:"absolute"};function Ae(){for(var e=arguments.length,t=new Array(e),n=0;n$e.has(e)&&$e.get(e).get(t)||null,remove(e,t){if(!$e.has(e))return;const n=$e.get(e);n.delete(t),0===n.size&&$e.delete(e)}},Ie="transitionend",Le=e=>(e&&window.CSS&&window.CSS.escape&&(e=e.replace(/#([^\s"#']+)/g,((e,t)=>`#${CSS.escape(t)}`))),e),Be=e=>{e.dispatchEvent(new Event(Ie))},qe=e=>!(!e||"object"!=typeof e)&&(void 0!==e.jquery&&(e=e[0]),void 0!==e.nodeType),ze=e=>qe(e)?e.jquery?e[0]:e:"string"==typeof e&&e.length>0?document.querySelector(Le(e)):null,Fe=e=>{if(!qe(e)||0===e.getClientRects().length)return!1;const t="visible"===getComputedStyle(e).getPropertyValue("visibility"),n=e.closest("details:not([open])");if(!n)return t;if(n!==e){const t=e.closest("summary");if(t&&t.parentNode!==n)return!1;if(null===t)return!1}return t},Ve=e=>!e||e.nodeType!==Node.ELEMENT_NODE||(!!e.classList.contains("disabled")||(void 0!==e.disabled?e.disabled:e.hasAttribute("disabled")&&"false"!==e.getAttribute("disabled"))),He=e=>{if(!document.documentElement.attachShadow)return null;if("function"==typeof e.getRootNode){const t=e.getRootNode();return t instanceof ShadowRoot?t:null}return e instanceof ShadowRoot?e:e.parentNode?He(e.parentNode):null},Ue=()=>{},We=e=>{e.offsetHeight},Ge=()=>window.jQuery&&!document.body.hasAttribute("data-bs-no-jquery")?window.jQuery:null,Qe=[],Xe=()=>"rtl"===document.documentElement.dir,Ke=e=>{var t;t=()=>{const t=Ge();if(t){const n=e.NAME,i=t.fn[n];t.fn[n]=e.jQueryInterface,t.fn[n].Constructor=e,t.fn[n].noConflict=()=>(t.fn[n]=i,e.jQueryInterface)}},"loading"===document.readyState?(Qe.length||document.addEventListener("DOMContentLoaded",(()=>{for(const e of Qe)e()})),Qe.push(t)):t()},Ye=(e,t=[],n=e)=>"function"==typeof e?e(...t):n,Ze=(e,t,n=!0)=>{if(!n)return void Ye(e);const i=(e=>{if(!e)return 0;let{transitionDuration:t,transitionDelay:n}=window.getComputedStyle(e);const i=Number.parseFloat(t),r=Number.parseFloat(n);return i||r?(t=t.split(",")[0],n=n.split(",")[0],1e3*(Number.parseFloat(t)+Number.parseFloat(n))):0})(t)+5;let r=!1;const o=({target:n})=>{n===t&&(r=!0,t.removeEventListener(Ie,o),Ye(e))};t.addEventListener(Ie,o),setTimeout((()=>{r||Be(t)}),i)},Je=(e,t,n,i)=>{const r=e.length;let o=e.indexOf(t);return-1===o?!n&&i?e[r-1]:e[0]:(o+=n?1:-1,i&&(o=(o+r)%r),e[Math.max(0,Math.min(o,r-1))])},et=/[^.]*(?=\..*)\.|.*/,tt=/\..*/,nt=/::\d+$/,it={};let rt=1;const ot={mouseenter:"mouseover",mouseleave:"mouseout"},st=new Set(["click","dblclick","mouseup","mousedown","contextmenu","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","selectstart","selectend","keydown","keypress","keyup","orientationchange","touchstart","touchmove","touchend","touchcancel","pointerdown","pointermove","pointerup","pointerleave","pointercancel","gesturestart","gesturechange","gestureend","focus","blur","change","reset","select","submit","focusin","focusout","load","unload","beforeunload","resize","move","DOMContentLoaded","readystatechange","error","abort","scroll"]);function at(e,t){return t&&`${t}::${rt++}`||e.uidEvent||rt++}function lt(e){const t=at(e);return e.uidEvent=t,it[t]=it[t]||{},it[t]}function ct(e,t,n=null){return Object.values(e).find((e=>e.callable===t&&e.delegationSelector===n))}function pt(e,t,n){const i="string"==typeof t,r=i?n:t||n;let o=ft(e);return st.has(o)||(o=e),[i,r,o]}function ut(e,t,n,i,r){if("string"!=typeof t||!e)return;let[o,s,a]=pt(t,n,i);if(t in ot){const e=e=>function(t){if(!t.relatedTarget||t.relatedTarget!==t.delegateTarget&&!t.delegateTarget.contains(t.relatedTarget))return e.call(this,t)};s=e(s)}const l=lt(e),c=l[a]||(l[a]={}),p=ct(c,s,o?n:null);if(p)return void(p.oneOff=p.oneOff&&r);const u=at(s,t.replace(et,"")),d=o?function(e,t,n){return function i(r){const o=e.querySelectorAll(t);for(let{target:s}=r;s&&s!==this;s=s.parentNode)for(const a of o)if(a===s)return gt(r,{delegateTarget:s}),i.oneOff&&mt.off(e,r.type,t,n),n.apply(s,[r])}}(e,n,s):function(e,t){return function n(i){return gt(i,{delegateTarget:e}),n.oneOff&&mt.off(e,i.type,t),t.apply(e,[i])}}(e,s);d.delegationSelector=o?n:null,d.callable=s,d.oneOff=r,d.uidEvent=u,c[u]=d,e.addEventListener(a,d,o)}function dt(e,t,n,i,r){const o=ct(t[n],i,r);o&&(e.removeEventListener(n,o,Boolean(r)),delete t[n][o.uidEvent])}function ht(e,t,n,i){const r=t[n]||{};for(const[o,s]of Object.entries(r))o.includes(i)&&dt(e,t,n,s.callable,s.delegationSelector)}function ft(e){return e=e.replace(tt,""),ot[e]||e}const mt={on(e,t,n,i){ut(e,t,n,i,!1)},one(e,t,n,i){ut(e,t,n,i,!0)},off(e,t,n,i){if("string"!=typeof t||!e)return;const[r,o,s]=pt(t,n,i),a=s!==t,l=lt(e),c=l[s]||{},p=t.startsWith(".");if(void 0===o){if(p)for(const n of Object.keys(l))ht(e,l,n,t.slice(1));for(const[n,i]of Object.entries(c)){const r=n.replace(nt,"");a&&!t.includes(r)||dt(e,l,s,i.callable,i.delegationSelector)}}else{if(!Object.keys(c).length)return;dt(e,l,s,o,r?n:null)}},trigger(e,t,n){if("string"!=typeof t||!e)return null;const i=Ge();let r=null,o=!0,s=!0,a=!1;t!==ft(t)&&i&&(r=i.Event(t,n),i(e).trigger(r),o=!r.isPropagationStopped(),s=!r.isImmediatePropagationStopped(),a=r.isDefaultPrevented());const l=gt(new Event(t,{bubbles:o,cancelable:!0}),n);return a&&l.preventDefault(),s&&e.dispatchEvent(l),l.defaultPrevented&&r&&r.preventDefault(),l}};function gt(e,t={}){for(const[n,i]of Object.entries(t))try{e[n]=i}catch(t){Object.defineProperty(e,n,{configurable:!0,get:()=>i})}return e}function yt(e){if("true"===e)return!0;if("false"===e)return!1;if(e===Number(e).toString())return Number(e);if(""===e||"null"===e)return null;if("string"!=typeof e)return e;try{return JSON.parse(decodeURIComponent(e))}catch(t){return e}}function vt(e){return e.replace(/[A-Z]/g,(e=>`-${e.toLowerCase()}`))}const bt={setDataAttribute(e,t,n){e.setAttribute(`data-bs-${vt(t)}`,n)},removeDataAttribute(e,t){e.removeAttribute(`data-bs-${vt(t)}`)},getDataAttributes(e){if(!e)return{};const t={},n=Object.keys(e.dataset).filter((e=>e.startsWith("bs")&&!e.startsWith("bsConfig")));for(const i of n){let n=i.replace(/^bs/,"");n=n.charAt(0).toLowerCase()+n.slice(1,n.length),t[n]=yt(e.dataset[i])}return t},getDataAttribute:(e,t)=>yt(e.getAttribute(`data-bs-${vt(t)}`))};class xt{static get Default(){return{}}static get DefaultType(){return{}}static get NAME(){throw new Error('You have to implement the static method "NAME", for each component!')}_getConfig(e){return e=this._mergeConfigObj(e),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}_configAfterMerge(e){return e}_mergeConfigObj(e,t){const n=qe(t)?bt.getDataAttribute(t,"config"):{};return{...this.constructor.Default,..."object"==typeof n?n:{},...qe(t)?bt.getDataAttributes(t):{},..."object"==typeof e?e:{}}}_typeCheckConfig(e,t=this.constructor.DefaultType){for(const[i,r]of Object.entries(t)){const t=e[i],o=qe(t)?"element":null==(n=t)?`${n}`:Object.prototype.toString.call(n).match(/\s([a-z]+)/i)[1].toLowerCase();if(!new RegExp(r).test(o))throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option "${i}" provided type "${o}" but expected type "${r}".`)}var n}}class wt extends xt{constructor(e,t){super(),(e=ze(e))&&(this._element=e,this._config=this._getConfig(t),je.set(this._element,this.constructor.DATA_KEY,this))}dispose(){je.remove(this._element,this.constructor.DATA_KEY),mt.off(this._element,this.constructor.EVENT_KEY);for(const e of Object.getOwnPropertyNames(this))this[e]=null}_queueCallback(e,t,n=!0){Ze(e,t,n)}_getConfig(e){return e=this._mergeConfigObj(e,this._element),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}static getInstance(e){return je.get(ze(e),this.DATA_KEY)}static getOrCreateInstance(e,t={}){return this.getInstance(e)||new this(e,"object"==typeof t?t:null)}static get VERSION(){return"5.3.3"}static get DATA_KEY(){return`bs.${this.NAME}`}static get EVENT_KEY(){return`.${this.DATA_KEY}`}static eventName(e){return`${e}${this.EVENT_KEY}`}}const _t=e=>{let t=e.getAttribute("data-bs-target");if(!t||"#"===t){let n=e.getAttribute("href");if(!n||!n.includes("#")&&!n.startsWith("."))return null;n.includes("#")&&!n.startsWith("#")&&(n=`#${n.split("#")[1]}`),t=n&&"#"!==n?n.trim():null}return t?t.split(",").map((e=>Le(e))).join(","):null},Et={find:(e,t=document.documentElement)=>[].concat(...Element.prototype.querySelectorAll.call(t,e)),findOne:(e,t=document.documentElement)=>Element.prototype.querySelector.call(t,e),children:(e,t)=>[].concat(...e.children).filter((e=>e.matches(t))),parents(e,t){const n=[];let i=e.parentNode.closest(t);for(;i;)n.push(i),i=i.parentNode.closest(t);return n},prev(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return[n];n=n.previousElementSibling}return[]},next(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return[n];n=n.nextElementSibling}return[]},focusableChildren(e){const t=["a","button","input","textarea","select","details","[tabindex]",'[contenteditable="true"]'].map((e=>`${e}:not([tabindex^="-"])`)).join(",");return this.find(t,e).filter((e=>!Ve(e)&&Fe(e)))},getSelectorFromElement(e){const t=_t(e);return t&&Et.findOne(t)?t:null},getElementFromSelector(e){const t=_t(e);return t?Et.findOne(t):null},getMultipleElementsFromSelector(e){const t=_t(e);return t?Et.find(t):[]}},Ot=(e,t="hide")=>{const n=`click.dismiss${e.EVENT_KEY}`,i=e.NAME;mt.on(document,n,`[data-bs-dismiss="${i}"]`,(function(n){if(["A","AREA"].includes(this.tagName)&&n.preventDefault(),Ve(this))return;const r=Et.getElementFromSelector(this)||this.closest(`.${i}`);e.getOrCreateInstance(r)[t]()}))},Pt=".bs.alert",kt=`close${Pt}`,St=`closed${Pt}`;class Ct extends wt{static get NAME(){return"alert"}close(){if(mt.trigger(this._element,kt).defaultPrevented)return;this._element.classList.remove("show");const e=this._element.classList.contains("fade");this._queueCallback((()=>this._destroyElement()),this._element,e)}_destroyElement(){this._element.remove(),mt.trigger(this._element,St),this.dispose()}static jQueryInterface(e){return this.each((function(){const t=Ct.getOrCreateInstance(this);if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError(`No method named "${e}"`);t[e](this)}}))}}Ot(Ct,"close"),Ke(Ct);const Tt='[data-bs-toggle="button"]';class At extends wt{static get NAME(){return"button"}toggle(){this._element.setAttribute("aria-pressed",this._element.classList.toggle("active"))}static jQueryInterface(e){return this.each((function(){const t=At.getOrCreateInstance(this);"toggle"===e&&t[e]()}))}}mt.on(document,"click.bs.button.data-api",Tt,(e=>{e.preventDefault();const t=e.target.closest(Tt);At.getOrCreateInstance(t).toggle()})),Ke(At);const Mt=".bs.swipe",Dt=`touchstart${Mt}`,Rt=`touchmove${Mt}`,Nt=`touchend${Mt}`,$t=`pointerdown${Mt}`,jt=`pointerup${Mt}`,It={endCallback:null,leftCallback:null,rightCallback:null},Lt={endCallback:"(function|null)",leftCallback:"(function|null)",rightCallback:"(function|null)"};class Bt extends xt{constructor(e,t){super(),this._element=e,e&&Bt.isSupported()&&(this._config=this._getConfig(t),this._deltaX=0,this._supportPointerEvents=Boolean(window.PointerEvent),this._initEvents())}static get Default(){return It}static get DefaultType(){return Lt}static get NAME(){return"swipe"}dispose(){mt.off(this._element,Mt)}_start(e){this._supportPointerEvents?this._eventIsPointerPenTouch(e)&&(this._deltaX=e.clientX):this._deltaX=e.touches[0].clientX}_end(e){this._eventIsPointerPenTouch(e)&&(this._deltaX=e.clientX-this._deltaX),this._handleSwipe(),Ye(this._config.endCallback)}_move(e){this._deltaX=e.touches&&e.touches.length>1?0:e.touches[0].clientX-this._deltaX}_handleSwipe(){const e=Math.abs(this._deltaX);if(e<=40)return;const t=e/this._deltaX;this._deltaX=0,t&&Ye(t>0?this._config.rightCallback:this._config.leftCallback)}_initEvents(){this._supportPointerEvents?(mt.on(this._element,$t,(e=>this._start(e))),mt.on(this._element,jt,(e=>this._end(e))),this._element.classList.add("pointer-event")):(mt.on(this._element,Dt,(e=>this._start(e))),mt.on(this._element,Rt,(e=>this._move(e))),mt.on(this._element,Nt,(e=>this._end(e))))}_eventIsPointerPenTouch(e){return this._supportPointerEvents&&("pen"===e.pointerType||"touch"===e.pointerType)}static isSupported(){return"ontouchstart"in document.documentElement||navigator.maxTouchPoints>0}}const qt=".bs.carousel",zt=".data-api",Ft="ArrowLeft",Vt="ArrowRight",Ht="next",Ut="prev",Wt="left",Gt="right",Qt=`slide${qt}`,Xt=`slid${qt}`,Kt=`keydown${qt}`,Yt=`mouseenter${qt}`,Zt=`mouseleave${qt}`,Jt=`dragstart${qt}`,en=`load${qt}${zt}`,tn=`click${qt}${zt}`,nn="carousel",rn="active",on=".active",sn=".carousel-item",an=on+sn,ln={[Ft]:Gt,[Vt]:Wt},cn={interval:5e3,keyboard:!0,pause:"hover",ride:!1,touch:!0,wrap:!0},pn={interval:"(number|boolean)",keyboard:"boolean",pause:"(string|boolean)",ride:"(boolean|string)",touch:"boolean",wrap:"boolean"};class un extends wt{constructor(e,t){super(e,t),this._interval=null,this._activeElement=null,this._isSliding=!1,this.touchTimeout=null,this._swipeHelper=null,this._indicatorsElement=Et.findOne(".carousel-indicators",this._element),this._addEventListeners(),this._config.ride===nn&&this.cycle()}static get Default(){return cn}static get DefaultType(){return pn}static get NAME(){return"carousel"}next(){this._slide(Ht)}nextWhenVisible(){!document.hidden&&Fe(this._element)&&this.next()}prev(){this._slide(Ut)}pause(){this._isSliding&&Be(this._element),this._clearInterval()}cycle(){this._clearInterval(),this._updateInterval(),this._interval=setInterval((()=>this.nextWhenVisible()),this._config.interval)}_maybeEnableCycle(){this._config.ride&&(this._isSliding?mt.one(this._element,Xt,(()=>this.cycle())):this.cycle())}to(e){const t=this._getItems();if(e>t.length-1||e<0)return;if(this._isSliding)return void mt.one(this._element,Xt,(()=>this.to(e)));const n=this._getItemIndex(this._getActive());if(n===e)return;const i=e>n?Ht:Ut;this._slide(i,t[e])}dispose(){this._swipeHelper&&this._swipeHelper.dispose(),super.dispose()}_configAfterMerge(e){return e.defaultInterval=e.interval,e}_addEventListeners(){this._config.keyboard&&mt.on(this._element,Kt,(e=>this._keydown(e))),"hover"===this._config.pause&&(mt.on(this._element,Yt,(()=>this.pause())),mt.on(this._element,Zt,(()=>this._maybeEnableCycle()))),this._config.touch&&Bt.isSupported()&&this._addTouchEventListeners()}_addTouchEventListeners(){for(const e of Et.find(".carousel-item img",this._element))mt.on(e,Jt,(e=>e.preventDefault()));const e={leftCallback:()=>this._slide(this._directionToOrder(Wt)),rightCallback:()=>this._slide(this._directionToOrder(Gt)),endCallback:()=>{"hover"===this._config.pause&&(this.pause(),this.touchTimeout&&clearTimeout(this.touchTimeout),this.touchTimeout=setTimeout((()=>this._maybeEnableCycle()),500+this._config.interval))}};this._swipeHelper=new Bt(this._element,e)}_keydown(e){if(/input|textarea/i.test(e.target.tagName))return;const t=ln[e.key];t&&(e.preventDefault(),this._slide(this._directionToOrder(t)))}_getItemIndex(e){return this._getItems().indexOf(e)}_setActiveIndicatorElement(e){if(!this._indicatorsElement)return;const t=Et.findOne(on,this._indicatorsElement);t.classList.remove(rn),t.removeAttribute("aria-current");const n=Et.findOne(`[data-bs-slide-to="${e}"]`,this._indicatorsElement);n&&(n.classList.add(rn),n.setAttribute("aria-current","true"))}_updateInterval(){const e=this._activeElement||this._getActive();if(!e)return;const t=Number.parseInt(e.getAttribute("data-bs-interval"),10);this._config.interval=t||this._config.defaultInterval}_slide(e,t=null){if(this._isSliding)return;const n=this._getActive(),i=e===Ht,r=t||Je(this._getItems(),n,i,this._config.wrap);if(r===n)return;const o=this._getItemIndex(r),s=t=>mt.trigger(this._element,t,{relatedTarget:r,direction:this._orderToDirection(e),from:this._getItemIndex(n),to:o});if(s(Qt).defaultPrevented)return;if(!n||!r)return;const a=Boolean(this._interval);this.pause(),this._isSliding=!0,this._setActiveIndicatorElement(o),this._activeElement=r;const l=i?"carousel-item-start":"carousel-item-end",c=i?"carousel-item-next":"carousel-item-prev";r.classList.add(c),We(r),n.classList.add(l),r.classList.add(l);this._queueCallback((()=>{r.classList.remove(l,c),r.classList.add(rn),n.classList.remove(rn,c,l),this._isSliding=!1,s(Xt)}),n,this._isAnimated()),a&&this.cycle()}_isAnimated(){return this._element.classList.contains("slide")}_getActive(){return Et.findOne(an,this._element)}_getItems(){return Et.find(sn,this._element)}_clearInterval(){this._interval&&(clearInterval(this._interval),this._interval=null)}_directionToOrder(e){return Xe()?e===Wt?Ut:Ht:e===Wt?Ht:Ut}_orderToDirection(e){return Xe()?e===Ut?Wt:Gt:e===Ut?Gt:Wt}static jQueryInterface(e){return this.each((function(){const t=un.getOrCreateInstance(this,e);if("number"!=typeof e){if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError(`No method named "${e}"`);t[e]()}}else t.to(e)}))}}mt.on(document,tn,"[data-bs-slide], [data-bs-slide-to]",(function(e){const t=Et.getElementFromSelector(this);if(!t||!t.classList.contains(nn))return;e.preventDefault();const n=un.getOrCreateInstance(t),i=this.getAttribute("data-bs-slide-to");return i?(n.to(i),void n._maybeEnableCycle()):"next"===bt.getDataAttribute(this,"slide")?(n.next(),void n._maybeEnableCycle()):(n.prev(),void n._maybeEnableCycle())})),mt.on(window,en,(()=>{const e=Et.find('[data-bs-ride="carousel"]');for(const t of e)un.getOrCreateInstance(t)})),Ke(un);const dn=".bs.collapse",hn=`show${dn}`,fn=`shown${dn}`,mn=`hide${dn}`,gn=`hidden${dn}`,yn=`click${dn}.data-api`,vn="show",bn="collapse",xn="collapsing",wn=`:scope .${bn} .${bn}`,_n='[data-bs-toggle="collapse"]',En={parent:null,toggle:!0},On={parent:"(null|element)",toggle:"boolean"};class Pn extends wt{constructor(e,t){super(e,t),this._isTransitioning=!1,this._triggerArray=[];const n=Et.find(_n);for(const e of n){const t=Et.getSelectorFromElement(e),n=Et.find(t).filter((e=>e===this._element));null!==t&&n.length&&this._triggerArray.push(e)}this._initializeChildren(),this._config.parent||this._addAriaAndCollapsedClass(this._triggerArray,this._isShown()),this._config.toggle&&this.toggle()}static get Default(){return En}static get DefaultType(){return On}static get NAME(){return"collapse"}toggle(){this._isShown()?this.hide():this.show()}show(){if(this._isTransitioning||this._isShown())return;let e=[];if(this._config.parent&&(e=this._getFirstLevelChildren(".collapse.show, .collapse.collapsing").filter((e=>e!==this._element)).map((e=>Pn.getOrCreateInstance(e,{toggle:!1})))),e.length&&e[0]._isTransitioning)return;if(mt.trigger(this._element,hn).defaultPrevented)return;for(const t of e)t.hide();const t=this._getDimension();this._element.classList.remove(bn),this._element.classList.add(xn),this._element.style[t]=0,this._addAriaAndCollapsedClass(this._triggerArray,!0),this._isTransitioning=!0;const n=`scroll${t[0].toUpperCase()+t.slice(1)}`;this._queueCallback((()=>{this._isTransitioning=!1,this._element.classList.remove(xn),this._element.classList.add(bn,vn),this._element.style[t]="",mt.trigger(this._element,fn)}),this._element,!0),this._element.style[t]=`${this._element[n]}px`}hide(){if(this._isTransitioning||!this._isShown())return;if(mt.trigger(this._element,mn).defaultPrevented)return;const e=this._getDimension();this._element.style[e]=`${this._element.getBoundingClientRect()[e]}px`,We(this._element),this._element.classList.add(xn),this._element.classList.remove(bn,vn);for(const e of this._triggerArray){const t=Et.getElementFromSelector(e);t&&!this._isShown(t)&&this._addAriaAndCollapsedClass([e],!1)}this._isTransitioning=!0;this._element.style[e]="",this._queueCallback((()=>{this._isTransitioning=!1,this._element.classList.remove(xn),this._element.classList.add(bn),mt.trigger(this._element,gn)}),this._element,!0)}_isShown(e=this._element){return e.classList.contains(vn)}_configAfterMerge(e){return e.toggle=Boolean(e.toggle),e.parent=ze(e.parent),e}_getDimension(){return this._element.classList.contains("collapse-horizontal")?"width":"height"}_initializeChildren(){if(!this._config.parent)return;const e=this._getFirstLevelChildren(_n);for(const t of e){const e=Et.getElementFromSelector(t);e&&this._addAriaAndCollapsedClass([t],this._isShown(e))}}_getFirstLevelChildren(e){const t=Et.find(wn,this._config.parent);return Et.find(e,this._config.parent).filter((e=>!t.includes(e)))}_addAriaAndCollapsedClass(e,t){if(e.length)for(const n of e)n.classList.toggle("collapsed",!t),n.setAttribute("aria-expanded",t)}static jQueryInterface(e){const t={};return"string"==typeof e&&/show|hide/.test(e)&&(t.toggle=!1),this.each((function(){const n=Pn.getOrCreateInstance(this,t);if("string"==typeof e){if(void 0===n[e])throw new TypeError(`No method named "${e}"`);n[e]()}}))}}mt.on(document,yn,_n,(function(e){("A"===e.target.tagName||e.delegateTarget&&"A"===e.delegateTarget.tagName)&&e.preventDefault();for(const e of Et.getMultipleElementsFromSelector(this))Pn.getOrCreateInstance(e,{toggle:!1}).toggle()})),Ke(Pn);const kn="dropdown",Sn=".bs.dropdown",Cn=".data-api",Tn="ArrowUp",An="ArrowDown",Mn=`hide${Sn}`,Dn=`hidden${Sn}`,Rn=`show${Sn}`,Nn=`shown${Sn}`,$n=`click${Sn}${Cn}`,jn=`keydown${Sn}${Cn}`,In=`keyup${Sn}${Cn}`,Ln="show",Bn='[data-bs-toggle="dropdown"]:not(.disabled):not(:disabled)',qn=`${Bn}.${Ln}`,zn=".dropdown-menu",Fn=Xe()?"top-end":"top-start",Vn=Xe()?"top-start":"top-end",Hn=Xe()?"bottom-end":"bottom-start",Un=Xe()?"bottom-start":"bottom-end",Wn=Xe()?"left-start":"right-start",Gn=Xe()?"right-start":"left-start",Qn={autoClose:!0,boundary:"clippingParents",display:"dynamic",offset:[0,2],popperConfig:null,reference:"toggle"},Xn={autoClose:"(boolean|string)",boundary:"(string|element)",display:"string",offset:"(array|string|function)",popperConfig:"(null|object|function)",reference:"(string|element|object)"};class Kn extends wt{constructor(e,t){super(e,t),this._popper=null,this._parent=this._element.parentNode,this._menu=Et.next(this._element,zn)[0]||Et.prev(this._element,zn)[0]||Et.findOne(zn,this._parent),this._inNavbar=this._detectNavbar()}static get Default(){return Qn}static get DefaultType(){return Xn}static get NAME(){return kn}toggle(){return this._isShown()?this.hide():this.show()}show(){if(Ve(this._element)||this._isShown())return;const e={relatedTarget:this._element};if(!mt.trigger(this._element,Rn,e).defaultPrevented){if(this._createPopper(),"ontouchstart"in document.documentElement&&!this._parent.closest(".navbar-nav"))for(const e of[].concat(...document.body.children))mt.on(e,"mouseover",Ue);this._element.focus(),this._element.setAttribute("aria-expanded",!0),this._menu.classList.add(Ln),this._element.classList.add(Ln),mt.trigger(this._element,Nn,e)}}hide(){if(Ve(this._element)||!this._isShown())return;const e={relatedTarget:this._element};this._completeHide(e)}dispose(){this._popper&&this._popper.destroy(),super.dispose()}update(){this._inNavbar=this._detectNavbar(),this._popper&&this._popper.update()}_completeHide(e){if(!mt.trigger(this._element,Mn,e).defaultPrevented){if("ontouchstart"in document.documentElement)for(const e of[].concat(...document.body.children))mt.off(e,"mouseover",Ue);this._popper&&this._popper.destroy(),this._menu.classList.remove(Ln),this._element.classList.remove(Ln),this._element.setAttribute("aria-expanded","false"),bt.removeDataAttribute(this._menu,"popper"),mt.trigger(this._element,Dn,e)}}_getConfig(e){if("object"==typeof(e=super._getConfig(e)).reference&&!qe(e.reference)&&"function"!=typeof e.reference.getBoundingClientRect)throw new TypeError(`${kn.toUpperCase()}: Option "reference" provided type "object" without a required "getBoundingClientRect" method.`);return e}_createPopper(){let e=this._element;"parent"===this._config.reference?e=this._parent:qe(this._config.reference)?e=ze(this._config.reference):"object"==typeof this._config.reference&&(e=this._config.reference);const t=this._getPopperConfig();this._popper=Re(e,this._menu,t)}_isShown(){return this._menu.classList.contains(Ln)}_getPlacement(){const e=this._parent;if(e.classList.contains("dropend"))return Wn;if(e.classList.contains("dropstart"))return Gn;if(e.classList.contains("dropup-center"))return"top";if(e.classList.contains("dropdown-center"))return"bottom";const t="end"===getComputedStyle(this._menu).getPropertyValue("--bs-position").trim();return e.classList.contains("dropup")?t?Vn:Fn:t?Un:Hn}_detectNavbar(){return null!==this._element.closest(".navbar")}_getOffset(){const{offset:e}=this._config;return"string"==typeof e?e.split(",").map((e=>Number.parseInt(e,10))):"function"==typeof e?t=>e(t,this._element):e}_getPopperConfig(){const e={placement:this._getPlacement(),modifiers:[{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"offset",options:{offset:this._getOffset()}}]};return(this._inNavbar||"static"===this._config.display)&&(bt.setDataAttribute(this._menu,"popper","static"),e.modifiers=[{name:"applyStyles",enabled:!1}]),{...e,...Ye(this._config.popperConfig,[e])}}_selectMenuItem({key:e,target:t}){const n=Et.find(".dropdown-menu .dropdown-item:not(.disabled):not(:disabled)",this._menu).filter((e=>Fe(e)));n.length&&Je(n,t,e===An,!n.includes(t)).focus()}static jQueryInterface(e){return this.each((function(){const t=Kn.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e])throw new TypeError(`No method named "${e}"`);t[e]()}}))}static clearMenus(e){if(2===e.button||"keyup"===e.type&&"Tab"!==e.key)return;const t=Et.find(qn);for(const n of t){const t=Kn.getInstance(n);if(!t||!1===t._config.autoClose)continue;const i=e.composedPath(),r=i.includes(t._menu);if(i.includes(t._element)||"inside"===t._config.autoClose&&!r||"outside"===t._config.autoClose&&r)continue;if(t._menu.contains(e.target)&&("keyup"===e.type&&"Tab"===e.key||/input|select|option|textarea|form/i.test(e.target.tagName)))continue;const o={relatedTarget:t._element};"click"===e.type&&(o.clickEvent=e),t._completeHide(o)}}static dataApiKeydownHandler(e){const t=/input|textarea/i.test(e.target.tagName),n="Escape"===e.key,i=[Tn,An].includes(e.key);if(!i&&!n)return;if(t&&!n)return;e.preventDefault();const r=this.matches(Bn)?this:Et.prev(this,Bn)[0]||Et.next(this,Bn)[0]||Et.findOne(Bn,e.delegateTarget.parentNode),o=Kn.getOrCreateInstance(r);if(i)return e.stopPropagation(),o.show(),void o._selectMenuItem(e);o._isShown()&&(e.stopPropagation(),o.hide(),r.focus())}}mt.on(document,jn,Bn,Kn.dataApiKeydownHandler),mt.on(document,jn,zn,Kn.dataApiKeydownHandler),mt.on(document,$n,Kn.clearMenus),mt.on(document,In,Kn.clearMenus),mt.on(document,$n,Bn,(function(e){e.preventDefault(),Kn.getOrCreateInstance(this).toggle()})),Ke(Kn);const Yn="backdrop",Zn="show",Jn=`mousedown.bs.${Yn}`,ei={className:"modal-backdrop",clickCallback:null,isAnimated:!1,isVisible:!0,rootElement:"body"},ti={className:"string",clickCallback:"(function|null)",isAnimated:"boolean",isVisible:"boolean",rootElement:"(element|string)"};class ni extends xt{constructor(e){super(),this._config=this._getConfig(e),this._isAppended=!1,this._element=null}static get Default(){return ei}static get DefaultType(){return ti}static get NAME(){return Yn}show(e){if(!this._config.isVisible)return void Ye(e);this._append();const t=this._getElement();this._config.isAnimated&&We(t),t.classList.add(Zn),this._emulateAnimation((()=>{Ye(e)}))}hide(e){this._config.isVisible?(this._getElement().classList.remove(Zn),this._emulateAnimation((()=>{this.dispose(),Ye(e)}))):Ye(e)}dispose(){this._isAppended&&(mt.off(this._element,Jn),this._element.remove(),this._isAppended=!1)}_getElement(){if(!this._element){const e=document.createElement("div");e.className=this._config.className,this._config.isAnimated&&e.classList.add("fade"),this._element=e}return this._element}_configAfterMerge(e){return e.rootElement=ze(e.rootElement),e}_append(){if(this._isAppended)return;const e=this._getElement();this._config.rootElement.append(e),mt.on(e,Jn,(()=>{Ye(this._config.clickCallback)})),this._isAppended=!0}_emulateAnimation(e){Ze(e,this._getElement(),this._config.isAnimated)}}const ii=".bs.focustrap",ri=`focusin${ii}`,oi=`keydown.tab${ii}`,si="backward",ai={autofocus:!0,trapElement:null},li={autofocus:"boolean",trapElement:"element"};class ci extends xt{constructor(e){super(),this._config=this._getConfig(e),this._isActive=!1,this._lastTabNavDirection=null}static get Default(){return ai}static get DefaultType(){return li}static get NAME(){return"focustrap"}activate(){this._isActive||(this._config.autofocus&&this._config.trapElement.focus(),mt.off(document,ii),mt.on(document,ri,(e=>this._handleFocusin(e))),mt.on(document,oi,(e=>this._handleKeydown(e))),this._isActive=!0)}deactivate(){this._isActive&&(this._isActive=!1,mt.off(document,ii))}_handleFocusin(e){const{trapElement:t}=this._config;if(e.target===document||e.target===t||t.contains(e.target))return;const n=Et.focusableChildren(t);0===n.length?t.focus():this._lastTabNavDirection===si?n[n.length-1].focus():n[0].focus()}_handleKeydown(e){"Tab"===e.key&&(this._lastTabNavDirection=e.shiftKey?si:"forward")}}const pi=".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",ui=".sticky-top",di="padding-right",hi="margin-right";class fi{constructor(){this._element=document.body}getWidth(){const e=document.documentElement.clientWidth;return Math.abs(window.innerWidth-e)}hide(){const e=this.getWidth();this._disableOverFlow(),this._setElementAttributes(this._element,di,(t=>t+e)),this._setElementAttributes(pi,di,(t=>t+e)),this._setElementAttributes(ui,hi,(t=>t-e))}reset(){this._resetElementAttributes(this._element,"overflow"),this._resetElementAttributes(this._element,di),this._resetElementAttributes(pi,di),this._resetElementAttributes(ui,hi)}isOverflowing(){return this.getWidth()>0}_disableOverFlow(){this._saveInitialAttribute(this._element,"overflow"),this._element.style.overflow="hidden"}_setElementAttributes(e,t,n){const i=this.getWidth();this._applyManipulationCallback(e,(e=>{if(e!==this._element&&window.innerWidth>e.clientWidth+i)return;this._saveInitialAttribute(e,t);const r=window.getComputedStyle(e).getPropertyValue(t);e.style.setProperty(t,`${n(Number.parseFloat(r))}px`)}))}_saveInitialAttribute(e,t){const n=e.style.getPropertyValue(t);n&&bt.setDataAttribute(e,t,n)}_resetElementAttributes(e,t){this._applyManipulationCallback(e,(e=>{const n=bt.getDataAttribute(e,t);null!==n?(bt.removeDataAttribute(e,t),e.style.setProperty(t,n)):e.style.removeProperty(t)}))}_applyManipulationCallback(e,t){if(qe(e))t(e);else for(const n of Et.find(e,this._element))t(n)}}const mi=".bs.modal",gi=`hide${mi}`,yi=`hidePrevented${mi}`,vi=`hidden${mi}`,bi=`show${mi}`,xi=`shown${mi}`,wi=`resize${mi}`,_i=`click.dismiss${mi}`,Ei=`mousedown.dismiss${mi}`,Oi=`keydown.dismiss${mi}`,Pi=`click${mi}.data-api`,ki="modal-open",Si="show",Ci="modal-static",Ti={backdrop:!0,focus:!0,keyboard:!0},Ai={backdrop:"(boolean|string)",focus:"boolean",keyboard:"boolean"};class Mi extends wt{constructor(e,t){super(e,t),this._dialog=Et.findOne(".modal-dialog",this._element),this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._isShown=!1,this._isTransitioning=!1,this._scrollBar=new fi,this._addEventListeners()}static get Default(){return Ti}static get DefaultType(){return Ai}static get NAME(){return"modal"}toggle(e){return this._isShown?this.hide():this.show(e)}show(e){if(this._isShown||this._isTransitioning)return;mt.trigger(this._element,bi,{relatedTarget:e}).defaultPrevented||(this._isShown=!0,this._isTransitioning=!0,this._scrollBar.hide(),document.body.classList.add(ki),this._adjustDialog(),this._backdrop.show((()=>this._showElement(e))))}hide(){if(!this._isShown||this._isTransitioning)return;mt.trigger(this._element,gi).defaultPrevented||(this._isShown=!1,this._isTransitioning=!0,this._focustrap.deactivate(),this._element.classList.remove(Si),this._queueCallback((()=>this._hideModal()),this._element,this._isAnimated()))}dispose(){mt.off(window,mi),mt.off(this._dialog,mi),this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}handleUpdate(){this._adjustDialog()}_initializeBackDrop(){return new ni({isVisible:Boolean(this._config.backdrop),isAnimated:this._isAnimated()})}_initializeFocusTrap(){return new ci({trapElement:this._element})}_showElement(e){document.body.contains(this._element)||document.body.append(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.scrollTop=0;const t=Et.findOne(".modal-body",this._dialog);t&&(t.scrollTop=0),We(this._element),this._element.classList.add(Si);this._queueCallback((()=>{this._config.focus&&this._focustrap.activate(),this._isTransitioning=!1,mt.trigger(this._element,xi,{relatedTarget:e})}),this._dialog,this._isAnimated())}_addEventListeners(){mt.on(this._element,Oi,(e=>{"Escape"===e.key&&(this._config.keyboard?this.hide():this._triggerBackdropTransition())})),mt.on(window,wi,(()=>{this._isShown&&!this._isTransitioning&&this._adjustDialog()})),mt.on(this._element,Ei,(e=>{mt.one(this._element,_i,(t=>{this._element===e.target&&this._element===t.target&&("static"!==this._config.backdrop?this._config.backdrop&&this.hide():this._triggerBackdropTransition())}))}))}_hideModal(){this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._isTransitioning=!1,this._backdrop.hide((()=>{document.body.classList.remove(ki),this._resetAdjustments(),this._scrollBar.reset(),mt.trigger(this._element,vi)}))}_isAnimated(){return this._element.classList.contains("fade")}_triggerBackdropTransition(){if(mt.trigger(this._element,yi).defaultPrevented)return;const e=this._element.scrollHeight>document.documentElement.clientHeight,t=this._element.style.overflowY;"hidden"===t||this._element.classList.contains(Ci)||(e||(this._element.style.overflowY="hidden"),this._element.classList.add(Ci),this._queueCallback((()=>{this._element.classList.remove(Ci),this._queueCallback((()=>{this._element.style.overflowY=t}),this._dialog)}),this._dialog),this._element.focus())}_adjustDialog(){const e=this._element.scrollHeight>document.documentElement.clientHeight,t=this._scrollBar.getWidth(),n=t>0;if(n&&!e){const e=Xe()?"paddingLeft":"paddingRight";this._element.style[e]=`${t}px`}if(!n&&e){const e=Xe()?"paddingRight":"paddingLeft";this._element.style[e]=`${t}px`}}_resetAdjustments(){this._element.style.paddingLeft="",this._element.style.paddingRight=""}static jQueryInterface(e,t){return this.each((function(){const n=Mi.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===n[e])throw new TypeError(`No method named "${e}"`);n[e](t)}}))}}mt.on(document,Pi,'[data-bs-toggle="modal"]',(function(e){const t=Et.getElementFromSelector(this);["A","AREA"].includes(this.tagName)&&e.preventDefault(),mt.one(t,bi,(e=>{e.defaultPrevented||mt.one(t,vi,(()=>{Fe(this)&&this.focus()}))}));const n=Et.findOne(".modal.show");n&&Mi.getInstance(n).hide();Mi.getOrCreateInstance(t).toggle(this)})),Ot(Mi),Ke(Mi);const Di=".bs.offcanvas",Ri=".data-api",Ni=`load${Di}${Ri}`,$i="show",ji="showing",Ii="hiding",Li=".offcanvas.show",Bi=`show${Di}`,qi=`shown${Di}`,zi=`hide${Di}`,Fi=`hidePrevented${Di}`,Vi=`hidden${Di}`,Hi=`resize${Di}`,Ui=`click${Di}${Ri}`,Wi=`keydown.dismiss${Di}`,Gi={backdrop:!0,keyboard:!0,scroll:!1},Qi={backdrop:"(boolean|string)",keyboard:"boolean",scroll:"boolean"};class Xi extends wt{constructor(e,t){super(e,t),this._isShown=!1,this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._addEventListeners()}static get Default(){return Gi}static get DefaultType(){return Qi}static get NAME(){return"offcanvas"}toggle(e){return this._isShown?this.hide():this.show(e)}show(e){if(this._isShown)return;if(mt.trigger(this._element,Bi,{relatedTarget:e}).defaultPrevented)return;this._isShown=!0,this._backdrop.show(),this._config.scroll||(new fi).hide(),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.classList.add(ji);this._queueCallback((()=>{this._config.scroll&&!this._config.backdrop||this._focustrap.activate(),this._element.classList.add($i),this._element.classList.remove(ji),mt.trigger(this._element,qi,{relatedTarget:e})}),this._element,!0)}hide(){if(!this._isShown)return;if(mt.trigger(this._element,zi).defaultPrevented)return;this._focustrap.deactivate(),this._element.blur(),this._isShown=!1,this._element.classList.add(Ii),this._backdrop.hide();this._queueCallback((()=>{this._element.classList.remove($i,Ii),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._config.scroll||(new fi).reset(),mt.trigger(this._element,Vi)}),this._element,!0)}dispose(){this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}_initializeBackDrop(){const e=Boolean(this._config.backdrop);return new ni({className:"offcanvas-backdrop",isVisible:e,isAnimated:!0,rootElement:this._element.parentNode,clickCallback:e?()=>{"static"!==this._config.backdrop?this.hide():mt.trigger(this._element,Fi)}:null})}_initializeFocusTrap(){return new ci({trapElement:this._element})}_addEventListeners(){mt.on(this._element,Wi,(e=>{"Escape"===e.key&&(this._config.keyboard?this.hide():mt.trigger(this._element,Fi))}))}static jQueryInterface(e){return this.each((function(){const t=Xi.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError(`No method named "${e}"`);t[e](this)}}))}}mt.on(document,Ui,'[data-bs-toggle="offcanvas"]',(function(e){const t=Et.getElementFromSelector(this);if(["A","AREA"].includes(this.tagName)&&e.preventDefault(),Ve(this))return;mt.one(t,Vi,(()=>{Fe(this)&&this.focus()}));const n=Et.findOne(Li);n&&n!==t&&Xi.getInstance(n).hide();Xi.getOrCreateInstance(t).toggle(this)})),mt.on(window,Ni,(()=>{for(const e of Et.find(Li))Xi.getOrCreateInstance(e).show()})),mt.on(window,Hi,(()=>{for(const e of Et.find("[aria-modal][class*=show][class*=offcanvas-]"))"fixed"!==getComputedStyle(e).position&&Xi.getOrCreateInstance(e).hide()})),Ot(Xi),Ke(Xi);const Ki={"*":["class","dir","id","lang","role",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],dd:[],div:[],dl:[],dt:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","srcset","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},Yi=new Set(["background","cite","href","itemtype","longdesc","poster","src","xlink:href"]),Zi=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i,Ji=(e,t)=>{const n=e.nodeName.toLowerCase();return t.includes(n)?!Yi.has(n)||Boolean(Zi.test(e.nodeValue)):t.filter((e=>e instanceof RegExp)).some((e=>e.test(n)))};const er={allowList:Ki,content:{},extraClass:"",html:!1,sanitize:!0,sanitizeFn:null,template:"
"},tr={allowList:"object",content:"object",extraClass:"(string|function)",html:"boolean",sanitize:"boolean",sanitizeFn:"(null|function)",template:"string"},nr={entry:"(string|element|function|null)",selector:"(string|element)"};class ir extends xt{constructor(e){super(),this._config=this._getConfig(e)}static get Default(){return er}static get DefaultType(){return tr}static get NAME(){return"TemplateFactory"}getContent(){return Object.values(this._config.content).map((e=>this._resolvePossibleFunction(e))).filter(Boolean)}hasContent(){return this.getContent().length>0}changeContent(e){return this._checkContent(e),this._config.content={...this._config.content,...e},this}toHtml(){const e=document.createElement("div");e.innerHTML=this._maybeSanitize(this._config.template);for(const[t,n]of Object.entries(this._config.content))this._setContent(e,n,t);const t=e.children[0],n=this._resolvePossibleFunction(this._config.extraClass);return n&&t.classList.add(...n.split(" ")),t}_typeCheckConfig(e){super._typeCheckConfig(e),this._checkContent(e.content)}_checkContent(e){for(const[t,n]of Object.entries(e))super._typeCheckConfig({selector:t,entry:n},nr)}_setContent(e,t,n){const i=Et.findOne(n,e);i&&((t=this._resolvePossibleFunction(t))?qe(t)?this._putElementInTemplate(ze(t),i):this._config.html?i.innerHTML=this._maybeSanitize(t):i.textContent=t:i.remove())}_maybeSanitize(e){return this._config.sanitize?function(e,t,n){if(!e.length)return e;if(n&&"function"==typeof n)return n(e);const i=(new window.DOMParser).parseFromString(e,"text/html"),r=[].concat(...i.body.querySelectorAll("*"));for(const e of r){const n=e.nodeName.toLowerCase();if(!Object.keys(t).includes(n)){e.remove();continue}const i=[].concat(...e.attributes),r=[].concat(t["*"]||[],t[n]||[]);for(const t of i)Ji(t,r)||e.removeAttribute(t.nodeName)}return i.body.innerHTML}(e,this._config.allowList,this._config.sanitizeFn):e}_resolvePossibleFunction(e){return Ye(e,[this])}_putElementInTemplate(e,t){if(this._config.html)return t.innerHTML="",void t.append(e);t.textContent=e.textContent}}const rr=new Set(["sanitize","allowList","sanitizeFn"]),or="fade",sr="show",ar=".tooltip-inner",lr=".modal",cr="hide.bs.modal",pr="hover",ur="focus",dr={AUTO:"auto",TOP:"top",RIGHT:Xe()?"left":"right",BOTTOM:"bottom",LEFT:Xe()?"right":"left"},hr={allowList:Ki,animation:!0,boundary:"clippingParents",container:!1,customClass:"",delay:0,fallbackPlacements:["top","right","bottom","left"],html:!1,offset:[0,6],placement:"top",popperConfig:null,sanitize:!0,sanitizeFn:null,selector:!1,template:'',title:"",trigger:"hover focus"},fr={allowList:"object",animation:"boolean",boundary:"(string|element)",container:"(string|element|boolean)",customClass:"(string|function)",delay:"(number|object)",fallbackPlacements:"array",html:"boolean",offset:"(array|string|function)",placement:"(string|function)",popperConfig:"(null|object|function)",sanitize:"boolean",sanitizeFn:"(null|function)",selector:"(string|boolean)",template:"string",title:"(string|element|function)",trigger:"string"};class mr extends wt{constructor(e,t){super(e,t),this._isEnabled=!0,this._timeout=0,this._isHovered=null,this._activeTrigger={},this._popper=null,this._templateFactory=null,this._newContent=null,this.tip=null,this._setListeners(),this._config.selector||this._fixTitle()}static get Default(){return hr}static get DefaultType(){return fr}static get NAME(){return"tooltip"}enable(){this._isEnabled=!0}disable(){this._isEnabled=!1}toggleEnabled(){this._isEnabled=!this._isEnabled}toggle(){this._isEnabled&&(this._activeTrigger.click=!this._activeTrigger.click,this._isShown()?this._leave():this._enter())}dispose(){clearTimeout(this._timeout),mt.off(this._element.closest(lr),cr,this._hideModalHandler),this._element.getAttribute("data-bs-original-title")&&this._element.setAttribute("title",this._element.getAttribute("data-bs-original-title")),this._disposePopper(),super.dispose()}show(){if("none"===this._element.style.display)throw new Error("Please use show on visible elements");if(!this._isWithContent()||!this._isEnabled)return;const e=mt.trigger(this._element,this.constructor.eventName("show")),t=(He(this._element)||this._element.ownerDocument.documentElement).contains(this._element);if(e.defaultPrevented||!t)return;this._disposePopper();const n=this._getTipElement();this._element.setAttribute("aria-describedby",n.getAttribute("id"));const{container:i}=this._config;if(this._element.ownerDocument.documentElement.contains(this.tip)||(i.append(n),mt.trigger(this._element,this.constructor.eventName("inserted"))),this._popper=this._createPopper(n),n.classList.add(sr),"ontouchstart"in document.documentElement)for(const e of[].concat(...document.body.children))mt.on(e,"mouseover",Ue);this._queueCallback((()=>{mt.trigger(this._element,this.constructor.eventName("shown")),!1===this._isHovered&&this._leave(),this._isHovered=!1}),this.tip,this._isAnimated())}hide(){if(!this._isShown())return;if(mt.trigger(this._element,this.constructor.eventName("hide")).defaultPrevented)return;if(this._getTipElement().classList.remove(sr),"ontouchstart"in document.documentElement)for(const e of[].concat(...document.body.children))mt.off(e,"mouseover",Ue);this._activeTrigger.click=!1,this._activeTrigger[ur]=!1,this._activeTrigger[pr]=!1,this._isHovered=null;this._queueCallback((()=>{this._isWithActiveTrigger()||(this._isHovered||this._disposePopper(),this._element.removeAttribute("aria-describedby"),mt.trigger(this._element,this.constructor.eventName("hidden")))}),this.tip,this._isAnimated())}update(){this._popper&&this._popper.update()}_isWithContent(){return Boolean(this._getTitle())}_getTipElement(){return this.tip||(this.tip=this._createTipElement(this._newContent||this._getContentForTemplate())),this.tip}_createTipElement(e){const t=this._getTemplateFactory(e).toHtml();if(!t)return null;t.classList.remove(or,sr),t.classList.add(`bs-${this.constructor.NAME}-auto`);const n=(e=>{do{e+=Math.floor(1e6*Math.random())}while(document.getElementById(e));return e})(this.constructor.NAME).toString();return t.setAttribute("id",n),this._isAnimated()&&t.classList.add(or),t}setContent(e){this._newContent=e,this._isShown()&&(this._disposePopper(),this.show())}_getTemplateFactory(e){return this._templateFactory?this._templateFactory.changeContent(e):this._templateFactory=new ir({...this._config,content:e,extraClass:this._resolvePossibleFunction(this._config.customClass)}),this._templateFactory}_getContentForTemplate(){return{[ar]:this._getTitle()}}_getTitle(){return this._resolvePossibleFunction(this._config.title)||this._element.getAttribute("data-bs-original-title")}_initializeOnDelegatedTarget(e){return this.constructor.getOrCreateInstance(e.delegateTarget,this._getDelegateConfig())}_isAnimated(){return this._config.animation||this.tip&&this.tip.classList.contains(or)}_isShown(){return this.tip&&this.tip.classList.contains(sr)}_createPopper(e){const t=Ye(this._config.placement,[this,e,this._element]),n=dr[t.toUpperCase()];return Re(this._element,e,this._getPopperConfig(n))}_getOffset(){const{offset:e}=this._config;return"string"==typeof e?e.split(",").map((e=>Number.parseInt(e,10))):"function"==typeof e?t=>e(t,this._element):e}_resolvePossibleFunction(e){return Ye(e,[this._element])}_getPopperConfig(e){const t={placement:e,modifiers:[{name:"flip",options:{fallbackPlacements:this._config.fallbackPlacements}},{name:"offset",options:{offset:this._getOffset()}},{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"arrow",options:{element:`.${this.constructor.NAME}-arrow`}},{name:"preSetPlacement",enabled:!0,phase:"beforeMain",fn:e=>{this._getTipElement().setAttribute("data-popper-placement",e.state.placement)}}]};return{...t,...Ye(this._config.popperConfig,[t])}}_setListeners(){const e=this._config.trigger.split(" ");for(const t of e)if("click"===t)mt.on(this._element,this.constructor.eventName("click"),this._config.selector,(e=>{this._initializeOnDelegatedTarget(e).toggle()}));else if("manual"!==t){const e=t===pr?this.constructor.eventName("mouseenter"):this.constructor.eventName("focusin"),n=t===pr?this.constructor.eventName("mouseleave"):this.constructor.eventName("focusout");mt.on(this._element,e,this._config.selector,(e=>{const t=this._initializeOnDelegatedTarget(e);t._activeTrigger["focusin"===e.type?ur:pr]=!0,t._enter()})),mt.on(this._element,n,this._config.selector,(e=>{const t=this._initializeOnDelegatedTarget(e);t._activeTrigger["focusout"===e.type?ur:pr]=t._element.contains(e.relatedTarget),t._leave()}))}this._hideModalHandler=()=>{this._element&&this.hide()},mt.on(this._element.closest(lr),cr,this._hideModalHandler)}_fixTitle(){const e=this._element.getAttribute("title");e&&(this._element.getAttribute("aria-label")||this._element.textContent.trim()||this._element.setAttribute("aria-label",e),this._element.setAttribute("data-bs-original-title",e),this._element.removeAttribute("title"))}_enter(){this._isShown()||this._isHovered?this._isHovered=!0:(this._isHovered=!0,this._setTimeout((()=>{this._isHovered&&this.show()}),this._config.delay.show))}_leave(){this._isWithActiveTrigger()||(this._isHovered=!1,this._setTimeout((()=>{this._isHovered||this.hide()}),this._config.delay.hide))}_setTimeout(e,t){clearTimeout(this._timeout),this._timeout=setTimeout(e,t)}_isWithActiveTrigger(){return Object.values(this._activeTrigger).includes(!0)}_getConfig(e){const t=bt.getDataAttributes(this._element);for(const e of Object.keys(t))rr.has(e)&&delete t[e];return e={...t,..."object"==typeof e&&e?e:{}},e=this._mergeConfigObj(e),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}_configAfterMerge(e){return e.container=!1===e.container?document.body:ze(e.container),"number"==typeof e.delay&&(e.delay={show:e.delay,hide:e.delay}),"number"==typeof e.title&&(e.title=e.title.toString()),"number"==typeof e.content&&(e.content=e.content.toString()),e}_getDelegateConfig(){const e={};for(const[t,n]of Object.entries(this._config))this.constructor.Default[t]!==n&&(e[t]=n);return e.selector=!1,e.trigger="manual",e}_disposePopper(){this._popper&&(this._popper.destroy(),this._popper=null),this.tip&&(this.tip.remove(),this.tip=null)}static jQueryInterface(e){return this.each((function(){const t=mr.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e])throw new TypeError(`No method named "${e}"`);t[e]()}}))}}Ke(mr);const gr=".popover-header",yr=".popover-body",vr={...mr.Default,content:"",offset:[0,8],placement:"right",template:'',trigger:"click"},br={...mr.DefaultType,content:"(null|string|element|function)"};class xr extends mr{static get Default(){return vr}static get DefaultType(){return br}static get NAME(){return"popover"}_isWithContent(){return this._getTitle()||this._getContent()}_getContentForTemplate(){return{[gr]:this._getTitle(),[yr]:this._getContent()}}_getContent(){return this._resolvePossibleFunction(this._config.content)}static jQueryInterface(e){return this.each((function(){const t=xr.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e])throw new TypeError(`No method named "${e}"`);t[e]()}}))}}Ke(xr);const wr=".bs.scrollspy",_r=`activate${wr}`,Er=`click${wr}`,Or=`load${wr}.data-api`,Pr="active",kr="[href]",Sr=".nav-link",Cr=`${Sr}, .nav-item > ${Sr}, .list-group-item`,Tr={offset:null,rootMargin:"0px 0px -25%",smoothScroll:!1,target:null,threshold:[.1,.5,1]},Ar={offset:"(number|null)",rootMargin:"string",smoothScroll:"boolean",target:"element",threshold:"array"};class Mr extends wt{constructor(e,t){super(e,t),this._targetLinks=new Map,this._observableSections=new Map,this._rootElement="visible"===getComputedStyle(this._element).overflowY?null:this._element,this._activeTarget=null,this._observer=null,this._previousScrollData={visibleEntryTop:0,parentScrollTop:0},this.refresh()}static get Default(){return Tr}static get DefaultType(){return Ar}static get NAME(){return"scrollspy"}refresh(){this._initializeTargetsAndObservables(),this._maybeEnableSmoothScroll(),this._observer?this._observer.disconnect():this._observer=this._getNewObserver();for(const e of this._observableSections.values())this._observer.observe(e)}dispose(){this._observer.disconnect(),super.dispose()}_configAfterMerge(e){return e.target=ze(e.target)||document.body,e.rootMargin=e.offset?`${e.offset}px 0px -30%`:e.rootMargin,"string"==typeof e.threshold&&(e.threshold=e.threshold.split(",").map((e=>Number.parseFloat(e)))),e}_maybeEnableSmoothScroll(){this._config.smoothScroll&&(mt.off(this._config.target,Er),mt.on(this._config.target,Er,kr,(e=>{const t=this._observableSections.get(e.target.hash);if(t){e.preventDefault();const n=this._rootElement||window,i=t.offsetTop-this._element.offsetTop;if(n.scrollTo)return void n.scrollTo({top:i,behavior:"smooth"});n.scrollTop=i}})))}_getNewObserver(){const e={root:this._rootElement,threshold:this._config.threshold,rootMargin:this._config.rootMargin};return new IntersectionObserver((e=>this._observerCallback(e)),e)}_observerCallback(e){const t=e=>this._targetLinks.get(`#${e.target.id}`),n=e=>{this._previousScrollData.visibleEntryTop=e.target.offsetTop,this._process(t(e))},i=(this._rootElement||document.documentElement).scrollTop,r=i>=this._previousScrollData.parentScrollTop;this._previousScrollData.parentScrollTop=i;for(const o of e){if(!o.isIntersecting){this._activeTarget=null,this._clearActiveClass(t(o));continue}const e=o.target.offsetTop>=this._previousScrollData.visibleEntryTop;if(r&&e){if(n(o),!i)return}else r||e||n(o)}}_initializeTargetsAndObservables(){this._targetLinks=new Map,this._observableSections=new Map;const e=Et.find(kr,this._config.target);for(const t of e){if(!t.hash||Ve(t))continue;const e=Et.findOne(decodeURI(t.hash),this._element);Fe(e)&&(this._targetLinks.set(decodeURI(t.hash),t),this._observableSections.set(t.hash,e))}}_process(e){this._activeTarget!==e&&(this._clearActiveClass(this._config.target),this._activeTarget=e,e.classList.add(Pr),this._activateParents(e),mt.trigger(this._element,_r,{relatedTarget:e}))}_activateParents(e){if(e.classList.contains("dropdown-item"))Et.findOne(".dropdown-toggle",e.closest(".dropdown")).classList.add(Pr);else for(const t of Et.parents(e,".nav, .list-group"))for(const e of Et.prev(t,Cr))e.classList.add(Pr)}_clearActiveClass(e){e.classList.remove(Pr);const t=Et.find(`${kr}.${Pr}`,e);for(const e of t)e.classList.remove(Pr)}static jQueryInterface(e){return this.each((function(){const t=Mr.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError(`No method named "${e}"`);t[e]()}}))}}mt.on(window,Or,(()=>{for(const e of Et.find('[data-bs-spy="scroll"]'))Mr.getOrCreateInstance(e)})),Ke(Mr);const Dr=".bs.tab",Rr=`hide${Dr}`,Nr=`hidden${Dr}`,$r=`show${Dr}`,jr=`shown${Dr}`,Ir=`click${Dr}`,Lr=`keydown${Dr}`,Br=`load${Dr}`,qr="ArrowLeft",zr="ArrowRight",Fr="ArrowUp",Vr="ArrowDown",Hr="Home",Ur="End",Wr="active",Gr="fade",Qr="show",Xr=".dropdown-toggle",Kr=`:not(${Xr})`,Yr='[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]',Zr=`${`.nav-link${Kr}, .list-group-item${Kr}, [role="tab"]${Kr}`}, ${Yr}`,Jr=`.${Wr}[data-bs-toggle="tab"], .${Wr}[data-bs-toggle="pill"], .${Wr}[data-bs-toggle="list"]`;class eo extends wt{constructor(e){super(e),this._parent=this._element.closest('.list-group, .nav, [role="tablist"]'),this._parent&&(this._setInitialAttributes(this._parent,this._getChildren()),mt.on(this._element,Lr,(e=>this._keydown(e))))}static get NAME(){return"tab"}show(){const e=this._element;if(this._elemIsActive(e))return;const t=this._getActiveElem(),n=t?mt.trigger(t,Rr,{relatedTarget:e}):null;mt.trigger(e,$r,{relatedTarget:t}).defaultPrevented||n&&n.defaultPrevented||(this._deactivate(t,e),this._activate(e,t))}_activate(e,t){if(!e)return;e.classList.add(Wr),this._activate(Et.getElementFromSelector(e));this._queueCallback((()=>{"tab"===e.getAttribute("role")?(e.removeAttribute("tabindex"),e.setAttribute("aria-selected",!0),this._toggleDropDown(e,!0),mt.trigger(e,jr,{relatedTarget:t})):e.classList.add(Qr)}),e,e.classList.contains(Gr))}_deactivate(e,t){if(!e)return;e.classList.remove(Wr),e.blur(),this._deactivate(Et.getElementFromSelector(e));this._queueCallback((()=>{"tab"===e.getAttribute("role")?(e.setAttribute("aria-selected",!1),e.setAttribute("tabindex","-1"),this._toggleDropDown(e,!1),mt.trigger(e,Nr,{relatedTarget:t})):e.classList.remove(Qr)}),e,e.classList.contains(Gr))}_keydown(e){if(![qr,zr,Fr,Vr,Hr,Ur].includes(e.key))return;e.stopPropagation(),e.preventDefault();const t=this._getChildren().filter((e=>!Ve(e)));let n;if([Hr,Ur].includes(e.key))n=t[e.key===Hr?0:t.length-1];else{const i=[zr,Vr].includes(e.key);n=Je(t,e.target,i,!0)}n&&(n.focus({preventScroll:!0}),eo.getOrCreateInstance(n).show())}_getChildren(){return Et.find(Zr,this._parent)}_getActiveElem(){return this._getChildren().find((e=>this._elemIsActive(e)))||null}_setInitialAttributes(e,t){this._setAttributeIfNotExists(e,"role","tablist");for(const e of t)this._setInitialAttributesOnChild(e)}_setInitialAttributesOnChild(e){e=this._getInnerElement(e);const t=this._elemIsActive(e),n=this._getOuterElement(e);e.setAttribute("aria-selected",t),n!==e&&this._setAttributeIfNotExists(n,"role","presentation"),t||e.setAttribute("tabindex","-1"),this._setAttributeIfNotExists(e,"role","tab"),this._setInitialAttributesOnTargetPanel(e)}_setInitialAttributesOnTargetPanel(e){const t=Et.getElementFromSelector(e);t&&(this._setAttributeIfNotExists(t,"role","tabpanel"),e.id&&this._setAttributeIfNotExists(t,"aria-labelledby",`${e.id}`))}_toggleDropDown(e,t){const n=this._getOuterElement(e);if(!n.classList.contains("dropdown"))return;const i=(e,i)=>{const r=Et.findOne(e,n);r&&r.classList.toggle(i,t)};i(Xr,Wr),i(".dropdown-menu",Qr),n.setAttribute("aria-expanded",t)}_setAttributeIfNotExists(e,t,n){e.hasAttribute(t)||e.setAttribute(t,n)}_elemIsActive(e){return e.classList.contains(Wr)}_getInnerElement(e){return e.matches(Zr)?e:Et.findOne(Zr,e)}_getOuterElement(e){return e.closest(".nav-item, .list-group-item")||e}static jQueryInterface(e){return this.each((function(){const t=eo.getOrCreateInstance(this);if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError(`No method named "${e}"`);t[e]()}}))}}mt.on(document,Ir,Yr,(function(e){["A","AREA"].includes(this.tagName)&&e.preventDefault(),Ve(this)||eo.getOrCreateInstance(this).show()})),mt.on(window,Br,(()=>{for(const e of Et.find(Jr))eo.getOrCreateInstance(e)})),Ke(eo);const to=".bs.toast",no=`mouseover${to}`,io=`mouseout${to}`,ro=`focusin${to}`,oo=`focusout${to}`,so=`hide${to}`,ao=`hidden${to}`,lo=`show${to}`,co=`shown${to}`,po="hide",uo="show",ho="showing",fo={animation:"boolean",autohide:"boolean",delay:"number"},mo={animation:!0,autohide:!0,delay:5e3};class go extends wt{constructor(e,t){super(e,t),this._timeout=null,this._hasMouseInteraction=!1,this._hasKeyboardInteraction=!1,this._setListeners()}static get Default(){return mo}static get DefaultType(){return fo}static get NAME(){return"toast"}show(){if(mt.trigger(this._element,lo).defaultPrevented)return;this._clearTimeout(),this._config.animation&&this._element.classList.add("fade");this._element.classList.remove(po),We(this._element),this._element.classList.add(uo,ho),this._queueCallback((()=>{this._element.classList.remove(ho),mt.trigger(this._element,co),this._maybeScheduleHide()}),this._element,this._config.animation)}hide(){if(!this.isShown())return;if(mt.trigger(this._element,so).defaultPrevented)return;this._element.classList.add(ho),this._queueCallback((()=>{this._element.classList.add(po),this._element.classList.remove(ho,uo),mt.trigger(this._element,ao)}),this._element,this._config.animation)}dispose(){this._clearTimeout(),this.isShown()&&this._element.classList.remove(uo),super.dispose()}isShown(){return this._element.classList.contains(uo)}_maybeScheduleHide(){this._config.autohide&&(this._hasMouseInteraction||this._hasKeyboardInteraction||(this._timeout=setTimeout((()=>{this.hide()}),this._config.delay)))}_onInteraction(e,t){switch(e.type){case"mouseover":case"mouseout":this._hasMouseInteraction=t;break;case"focusin":case"focusout":this._hasKeyboardInteraction=t}if(t)return void this._clearTimeout();const n=e.relatedTarget;this._element===n||this._element.contains(n)||this._maybeScheduleHide()}_setListeners(){mt.on(this._element,no,(e=>this._onInteraction(e,!0))),mt.on(this._element,io,(e=>this._onInteraction(e,!1))),mt.on(this._element,ro,(e=>this._onInteraction(e,!0))),mt.on(this._element,oo,(e=>this._onInteraction(e,!1)))}_clearTimeout(){clearTimeout(this._timeout),this._timeout=null}static jQueryInterface(e){return this.each((function(){const t=go.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e])throw new TypeError(`No method named "${e}"`);t[e](this)}}))}}Ot(go),Ke(go)},515:(e,t,n)=>{"use strict";var i=n(603);function r(e){return(s(e,"zeebe:IoMapping")||[])[0]}function o(e){return function(e,t){var n=r(e);return n&&n.get(t)||[]}(e,"inputParameters")}function s(e,t,n){var r=function(e,t){var n=[],r=e.get("extensionElements");if(void 0!==r){var o=r.get("values");void 0!==o&&(n=i.filter(o,(function(e){return function(e,t){return e&&"function"==typeof e.$instanceOf&&e.$instanceOf(t)}(e,t)})))}return n}(e,t);return n?(r[0]||{})[n]||[]:r}function a(e){for(var t=[],n=e;n.$parent;)t.push(n.$parent),n=n.$parent;return t}function l(e,t,n){n=n||0,i.isArray(e)||(e=[e]),i.forEach(e,(function(e,r){var o=t(e,r,n);i.isArray(o)&&o.length&&l(o,t,n+1)}))}function c(e,t,n){var i=!n||-1===e.indexOf(t);return i&&e.push(t),i}function p(e,t,n){var i=[],r=[];return l(e,(function(e,o,s){c(i,e,t);var a=e.flowElements;if((-1===n||s=0?e[o].origin=(n=e[o].origin,r=t.origin,n.concat(r)):e.push(t)}function h(e,t,n){var r,s,l,c,p=(r=n,s=t,l=a(e),c=i.find(l,(function(e){return function(e,t){return e&&"function"==typeof e.$instanceOf&&e.$instanceOf(t)}(e,"bpmn:SubProcess")&&function(e,t){return i.find(o(e),(function(e){return e.target===t}))}(e,s)})),c||r);return{name:t,origin:[e],scope:p}}var f=[function(e){var t=e.elements,n=e.processVariables;return i.isArray(t)||(t=[t]),i.forEach(t,(function(e){var t=function(e){return(r(e)||{}).inputParameters}(e);i.forEach(t,(function(t){var i=h(e,t.target,e);d(n,i)}))})),n},function(e){var t=e.elements,n=e.processVariables;return i.isArray(t)||(t=[t]),i.forEach(t,(function(e){var t=e.loopCharacteristics,i=t&&function(e){const t=s(e,"zeebe:LoopCharacteristics")[0];return t&&t.inputElement}(t);if(i){var r=h(e,i,e);d(n,r)}})),n},function(e){var t=e.elements,n=e.containerElement,o=e.processVariables;return i.isArray(t)||(t=[t]),i.forEach(t,(function(e){var t=function(e){return(r(e)||{}).outputParameters}(e);i.forEach(t,(function(t){var i=h(e,t.target,n);d(o,i)}))})),o},function(e){var t=e.elements,n=e.containerElement,r=e.processVariables;return i.isArray(t)||(t=[t]),i.forEach(t,(function(e){var t=e.loopCharacteristics,i=t&&function(e){const t=s(e,"zeebe:LoopCharacteristics")[0];return t&&t.outputCollection}(t);if(i){var o=h(e,i,n);d(r,o)}})),r},function(e){var t=e.elements,n=e.containerElement,r=e.processVariables;return i.isArray(t)||(t=[t]),i.forEach(t,(function(e){var t=function(e){return(s(e,"zeebe:CalledDecision")||[])[0]}(e)||function(e){return(s(e,"zeebe:Script")||[])[0]}(e);if(t){var i=t.resultVariable;if(i){var o=h(e,i,n);d(r,o)}}})),r}];function m(e,t=[]){var n=[],r=u([e],!1);const o=[];return i.forEach([...f,...t],(function(t){o.push(t({elements:r,containerElement:e,processVariables:n}))})),Promise.all(o).then((()=>n))}async function g(e,t,n=[]){var r,o=await m(t,n),s=function(e,t){var n=u(t);return i.find(n,(function(t){return t.id===e}))}(e,t),l=i.filter(o,(function(e){return e.scope.id===s.id})),c=a(s),p=i.filter(o,(function(e){return i.find(c,(function(t){return t.id===e.scope.id}))}));return r=p,l.concat(r)}function y(e){return e&&e.businessObject||e}function v(e,t){var n=y(e);return n&&"function"==typeof n.$instanceOf&&n.$instanceOf(t)}t.Hp=function(e,t=[]){return g(function(e){const t=y(e);if(v(e,"bpmn:Participant"))return t.processRef.id;return t.id}(e),function(e){const t=y(e);if(v(t,"bpmn:Participant"))return t.processRef;if(v(t,"bpmn:Process"))return t;let n=t;for(;n.$parent&&!v(n,"bpmn:Process");)n=n.$parent;return n}(e),t)}},35:e=>{function t(e){this.cache=e}e.exports=t,t.prototype.resolveRule=function(e,t){return this.resolve("rule",e,t)},t.prototype.resolveConfig=function(e,t){return this.resolve("config",e,t)},t.prototype.resolve=function(e,t,n){const i=`${t}/${n}`,r=this.cache[`${e}:${i}`];if(!r)throw new Error(`unknown ${e} <${i}>`);return r}},74:(e,t,n)=>{"use strict";function i(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}n.r(t),n.d(t,{default:()=>ute});var r=function(e,t){return e(t={exports:{}},t.exports),t.exports}((function(e){var t=e.exports=function(e,n){if(n||(n=16),void 0===e&&(e=128),e<=0)return"0";for(var i=Math.log(Math.pow(2,e))/Math.log(n),r=2;i===1/0;r*=2)i=Math.log(Math.pow(2,e/r))/Math.log(n)*r;var o=i-Math.floor(i),s="";for(r=0;r=Math.pow(2,e)?t(e,n):s};t.rack=function(e,n,i){var r=function(r){var s=0;do{if(s++>10){if(!i)throw new Error("too many ID collisions, use more bits");e+=i}var a=t(e,n)}while(Object.hasOwnProperty.call(o,a));return o[a]=r,a},o=r.hats={};return r.get=function(e){return r.hats[e]},r.set=function(e,t){return r.hats[e]=t,r},r.bits=e||128,r.base=n||16,r}}));function o(e){if(!(this instanceof o))return new o(e);e=e||[128,36,1],this._seed=e.length?r.rack(e[0],e[1],e[2]):e}o.prototype.next=function(e){return this._seed(e||!0)},o.prototype.nextPrefixed=function(e,t){var n;do{n=e+this.next(!0)}while(this.assigned(n));return this.claim(n,t),n},o.prototype.claim=function(e,t){this._seed.set(e,t||!0)},o.prototype.assigned=function(e){return this._seed.get(e)||!1},o.prototype.unclaim=function(e){delete this._seed.hats[e]},o.prototype.clear=function(){var e,t=this._seed.hats;for(e in t)this.unclaim(e)};const s=o;function a(e){return Array.prototype.concat.apply([],e)}const l=Object.prototype.toString,c=Object.prototype.hasOwnProperty;function p(e){return void 0===e}function u(e){return void 0!==e}function d(e){return null==e}function h(e){return"[object Array]"===l.call(e)}function f(e){return"[object Object]"===l.call(e)}function m(e){return"[object Number]"===l.call(e)}function g(e){const t=l.call(e);return"[object Function]"===t||"[object AsyncFunction]"===t||"[object GeneratorFunction]"===t||"[object AsyncGeneratorFunction]"===t||"[object Proxy]"===t}function y(e){return"[object String]"===l.call(e)}function v(e,t){return!d(e)&&c.call(e,t)}function b(e,t){const n=j(t);let i;return _(e,(function(e,t){if(n(e,t))return i=e,!1})),i}function x(e,t){const n=j(t);let i=h(e)?-1:void 0;return _(e,(function(e,t){if(n(e,t))return i=t,!1})),i}function w(e,t){const n=j(t);let i=[];return _(e,(function(e,t){n(e,t)&&i.push(e)})),i}function _(e,t){let n,i;if(p(e))return;const r=h(e)?L:I;for(let o in e)if(v(e,o)&&(n=e[o],i=t(n,r(o)),!1===i))return n}function E(e,t){if(p(e))return[];!function(e){if(!h(e))throw new Error("must supply array")}(e);const n=j(t);return e.filter((function(e,t){return!n(e,t)}))}function O(e,t,n){return _(e,(function(e,i){n=t(n,e,i)})),n}function P(e,t){return!!O(e,(function(e,n,i){return e&&t(n,i)}),!0)}function k(e,t){return!!b(e,t)}function S(e,t){let n=[];return _(e,(function(e,i){n.push(t(e,i))})),n}function C(e){return e&&Object.keys(e)||[]}function T(e){return S(e,(e=>e))}function A(e,t,n={}){return t=$(t),_(e,(function(e){let i=t(e)||"_",r=n[i];r||(r=n[i]=[]),r.push(e)})),n}function M(e,...t){e=$(e);let n={};return _(t,(t=>A(t,e,n))),S(n,(function(e,t){return e[0]}))}const D=M;function R(e,t){t=$(t);let n=[];return _(e,(function(e,i){let r=t(e,i),o={d:r,v:e};for(var s=0;se.v))}function N(e){return function(t){return P(e,(function(e,n){return t[n]===e}))}}function $(e){return g(e)?e:t=>t[e]}function j(e){return g(e)?e:t=>t===e}function I(e){return e}function L(e){return Number(e)}function B(e,t){let n,i,r,o;function s(n){let s=Date.now(),c=n?0:o+t-s;if(c>0)return a(c);e.apply(r,i),l()}function a(e){n=setTimeout(s,e)}function l(){n&&clearTimeout(n),n=o=i=r=void 0}function c(...e){o=Date.now(),i=e,r=this,n||a(t)}return c.flush=function(){n&&s(!0),l()},c.cancel=l,c}function q(e,t){return e.bind(t)}function z(e,...t){return Object.assign(e,...t)}function F(e,t,n){let i=e;return _(t,(function(e,r){if("number"!=typeof e&&"string"!=typeof e)throw new Error("illegal key type: "+typeof e+". Key should be of type number or string.");if("constructor"===e)throw new Error("illegal key: constructor");if("__proto__"===e)throw new Error("illegal key: __proto__");let o=t[r+1],s=i[e];u(o)&&d(s)&&(s=i[e]=isNaN(+o)?{}:[]),p(o)?p(n)?delete i[e]:i[e]=n:i=s})),e}function V(e,t){let n={},i=Object(e);return _(t,(function(t){t in i&&(n[t]=e[t])})),n}function H(e,t){let n={};return _(Object(e),(function(e,i){-1===t.indexOf(i)&&(n[i]=e)})),n}function U(e,t){return t.forEach((function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach((function(n){if("default"!==n&&!(n in e)){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}}))})),Object.freeze(e)}const W=Object.prototype.toString,G=Object.prototype.hasOwnProperty;function Q(e,t){return G.call(e,t)}function X(e,t){let n,i;if(void 0===e)return;const r=function(e){return"[object Array]"===W.call(e)}(e)?Y:K;for(let o in e)if(Q(e,o)&&(n=e[o],i=t(n,r(o)),!1===i))return n}function K(e){return e}function Y(e){return Number(e)}function Z(e,...t){const n=e.style;return X(t,(function(e){e&&X(e,(function(e,t){n[t]=e}))})),e}function J(e,t,n){return 2==arguments.length?e.getAttribute(t):null===n?e.removeAttribute(t):(e.setAttribute(t,n),e)}const ee=Object.prototype.toString;function te(e){return new ne(e)}function ne(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}function ie(e){for(var t;t=e.firstChild;)e.removeChild(t);return e}function re(e,t,n){var i=n?e:e.parentNode;return i&&"function"==typeof i.closest&&i.closest(t)||null}ne.prototype.add=function(e){return this.list.add(e),this},ne.prototype.remove=function(e){return"[object RegExp]"==ee.call(e)?this.removeMatching(e):(this.list.remove(e),this)},ne.prototype.removeMatching=function(e){const t=this.array();for(let n=0;na ',ye=!fe.getElementsByTagName("link").length,fe=void 0);var ve={legend:[1,""," "],tr:[2,""],col:[2,""],_default:ye?[1,"X","
"]:[0,"",""]};ve.td=ve.th=[3,""],ve.option=ve.optgroup=[1,''," "],ve.thead=ve.tbody=ve.colgroup=ve.caption=ve.tfoot=[1,""],ve.polyline=ve.ellipse=ve.polygon=ve.circle=ve.text=ve.line=ve.path=ve.rect=ve.g=[1,''," "];var be=ge;function xe(e,t){return e&&"function"==typeof e.matches&&e.matches(t)||!1}function we(e,t){return(t=t||document).querySelector(e)}function _e(e,t){return(t=t||document).querySelectorAll(e)}function Ee(e){e.parentNode&&e.parentNode.removeChild(e)}function Oe(e,t){if(e.ownerDocument!==t.ownerDocument)try{return t.ownerDocument.importNode(e,!0)}catch(e){}return e}function Pe(e,t){return t.appendChild(Oe(e,t))}function ke(e,t){return Pe(t,e),e}var Se={"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":2,"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":2,"text-anchor":1,"text-decoration":1,"text-rendering":1,"unicode-bidi":1,visibility:1,"word-spacing":1,"writing-mode":1};function Ce(e,t,n){var i=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),r=Se[i];r?(2===r&&"number"==typeof n&&(n=String(n)+"px"),e.style[i]=n):e.setAttributeNS(null,t,n)}function Te(e,t,n){if("string"==typeof t){if(void 0===n)return function(e,t){return Se[t]?e.style[t]:e.getAttributeNS(null,t)}(e,t);Ce(e,t,n)}else!function(e,t){var n,i,r=Object.keys(t);for(n=0;i=r[n];n++)Ce(e,i,t[i])}(e,t);return e}const Ae=Object.prototype.toString;function Me(e){return new De(e)}function De(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}function Re(e){for(var t;t=e.firstChild;)e.removeChild(t);return e}function Ne(e){return e.cloneNode(!0)}De.prototype.add=function(e){return this.list.add(e),this},De.prototype.remove=function(e){return"[object RegExp]"==Ae.call(e)?this.removeMatching(e):(this.list.remove(e),this)},De.prototype.removeMatching=function(e){const t=this.array();for(let n=0;n"+e+"",t=!0);var n=function(e){var t;return(t=new DOMParser).async=!1,t.parseFromString(e,"text/xml")}(e);if(!t)return n;for(var i=document.createDocumentFragment(),r=n.firstChild;r.firstChild;)i.appendChild(r.firstChild);return i}function Le(e,t){var n;return"<"===(e=e.trim()).charAt(0)?(n=Ie(e).firstChild,n=document.importNode(n,!0)):n=document.createElementNS($e,e),t&&Te(n,t),n}var Be=null;function qe(){return null===Be&&(Be=Le("svg")),Be}function ze(e,t){var n,i,r=Object.keys(t);for(n=0;i=r[n];n++)e[i]=t[i];return e}function Fe(e){return e?qe().createSVGTransformFromMatrix(e):qe().createSVGTransform()}var Ve=/([&<>]{1})/g,He=/([&<>\n\r"]{1})/g,Ue={"&":"&","<":"<",">":">",'"':"'"};function We(e,t){return e.replace(t,(function(e,t){return Ue[t]||t}))}function Ge(e,t){var n,i,r,o,s;switch(e.nodeType){case 3:t.push(We(e.textContent,Ve));break;case 1:if(t.push("<",e.tagName),e.hasAttributes())for(n=0,i=(r=e.attributes).length;n"),n=0,i=(s=e.childNodes).length;n")}else t.push("/>");break;case 8:t.push("\x3c!--",We(e.nodeValue,Ve),"--\x3e");break;case 4:t.push("");break;default:throw new Error("unable to handle node "+e.nodeType)}return t}function Qe(e,t){var n=Ie(t);if(Re(e),t){(function(e){return"#document-fragment"===e.nodeName})(n)||(n=n.documentElement);for(var i,r=(i=n.childNodes,Array.prototype.slice.call(i)),o=0;o{const t=e.match(ot);return(t&&t[1]||e).trim()}))||[]}function at(e,t){const n=t||{get:function(e,t){if(i.push(e),!1===t)return null;throw a(`No provider for "${e}"!`)}},i=[],r=this._providers=Object.create(n._providers||null),o=this._instances=Object.create(null),s=o.injector=this,a=function(e){const t=i.join(" -> ");return i.length=0,new Error(t?`${e} (Resolving: ${t})`:e)};function l(e,t){if(!r[e]&&e.includes(".")){const t=e.split(".");let n=l(t.shift());for(;t.length;)n=n[t.shift()];return n}if(tt(o,e))return o[e];if(tt(r,e)){if(-1!==i.indexOf(e))throw i.push(e),a("Cannot resolve circular dependency!");return i.push(e),o[e]=r[e][0](r[e][1]),i.pop(),o[e]}return n.get(e,t)}function c(e,t){if(void 0===t&&(t={}),"function"!=typeof e){if(!et(e))throw a(`Cannot invoke "${e}". Expected a function!`);e=nt(e.slice())}return{fn:e,dependencies:(e.$inject||st(e)).map((e=>tt(t,e)?t[e]:l(e)))}}function p(e){const{fn:t,dependencies:n}=c(e);return new(Function.prototype.bind.call(t,null,...n))}function u(e,t,n){const{fn:i,dependencies:r}=c(e,n);return i.apply(t,r)}function d(e){return nt((t=>e.get(t)))}function h(e,t){if(t&&t.length){const n=Object.create(null),i=Object.create(null),o=[],s=[],a=[];let l,c,p,u;for(let e in r)l=r[e],-1!==t.indexOf(e)&&("private"===l[2]?(c=o.indexOf(l[3]),-1===c?(p=l[3].createChild([],t),u=d(p),o.push(l[3]),s.push(p),a.push(u),n[e]=[u,e,"private",p]):n[e]=[a[c],e,"private",s[c]]):n[e]=[l[2],l[1]],i[e]=!0),"factory"!==l[2]&&"type"!==l[2]||!l[1].$scope||t.forEach((t=>{-1!==l[1].$scope.indexOf(t)&&(n[e]=[l[2],l[1]],i[t]=!0)}));t.forEach((e=>{if(!i[e])throw new Error('No provider for "'+e+'". Cannot use provider from the parent!')})),e.unshift(n)}return new at(e,s)}const f={factory:u,type:p,value:function(e){return e}};function m(e,t){const n=e.__init__||[];return function(){n.forEach((e=>{"string"==typeof e?t.get(e):t.invoke(e)}))}}function g(e){const t=e.__exports__;if(t){const n=e.__modules__,i=Object.keys(e).reduce(((t,n)=>("__exports__"!==n&&"__modules__"!==n&&"__init__"!==n&&"__depends__"!==n&&(t[n]=e[n]),t)),Object.create(null)),o=h((n||[]).concat(i)),s=nt((function(e){return o.get(e)}));t.forEach((function(e){r[e]=[s,e,"private",o]}));const a=(e.__init__||[]).slice();return a.unshift((function(){o.init()})),m(e=Object.assign({},e,{__init__:a}),o)}return Object.keys(e).forEach((function(t){if("__init__"===t||"__depends__"===t)return;const n=e[t];if("private"===n[2])return void(r[t]=n);const i=n[0],o=n[1];r[t]=[f[i],lt(i,o),i]})),m(e,s)}function y(e,t){return-1!==e.indexOf(t)||-1!==(e=(t.__depends__||[]).reduce(y,e)).indexOf(t)?e:e.concat(t)}this.get=l,this.invoke=u,this.instantiate=p,this.createChild=h,this.init=function(e){const t=e.reduce(y,[]).map(g);let n=!1;return function(){n||(n=!0,t.forEach((e=>e())))}}(e)}function lt(e,t){return"value"!==e&&et(t)&&(t=nt(t.slice())),t}function ct(e,t){var n=this;t=t||1e3,e.on(["render.shape","render.connection"],t,(function(e,t){var i=e.type,r=t.element,o=t.gfx,s=t.attrs;if(n.canRender(r))return"render.shape"===i?n.drawShape(o,r,s):n.drawConnection(o,r,s)})),e.on(["render.getShapePath","render.getConnectionPath"],t,(function(e,t){if(n.canRender(t))return"render.getShapePath"===e.type?n.getShapePath(t):n.getConnectionPath(t)}))}function pt(e){return e.flat().join(",").replace(/,?([A-z]),?/g,"$1")}function ut(e){return["L",e.x,e.y]}function dt(e,t){const n=e.length,i=[(r=e[0],["M",r.x,r.y])];var r,o,s,a;for(let r=1;rr||void 0===r)&&(r=a+p),(l+c>o||void 0===o)&&(o=l+c)})),{x:n,y:i,height:o-i,width:r-n}}function Ot(e){return"waypoints"in e?"connection":"x"in e?"shape":"root"}function Pt(e){return!(!e||!e.isFrame)}function kt(e,t){return z({},e||{},t||{})}ct.prototype.canRender=function(e){},ct.prototype.drawShape=function(e,t){},ct.prototype.drawConnection=function(e,t){},ct.prototype.getShapePath=function(e){},ct.prototype.getConnectionPath=function(e){};function St(e,t){ct.call(this,e,1),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})}i(St,ct),St.prototype.canRender=function(){return!0},St.prototype.drawShape=function(e,t,n){var i=Le("rect");return Te(i,{x:0,y:0,width:t.width||0,height:t.height||0}),Pt(t)?Te(i,z({},this.FRAME_STYLE,n||{})):Te(i,z({},this.SHAPE_STYLE,n||{})),ke(e,i),i},St.prototype.drawConnection=function(e,t,n){var i=mt(t.waypoints,z({},this.CONNECTION_STYLE,n||{}));return ke(e,i),i},St.prototype.getShapePath=function(e){var t=e.x,n=e.y,i=e.width;return pt([["M",t,n],["l",i,0],["l",0,e.height],["l",-i,0],["z"]])},St.prototype.getConnectionPath=function(e){var t,n,i=e.waypoints,r=[];for(t=0;n=i[t];t++)n=n.original||n,r.push([0===t?"M":"L",n.x,n.y]);return pt(r)},St.$inject=["eventBus","styles"];const Ct={__init__:["defaultRenderer"],defaultRenderer:["type",St],styles:["type",function(){var e={"no-fill":{fill:"none"},"no-border":{strokeOpacity:0},"no-events":{pointerEvents:"none"}},t=this;this.cls=function(e,t,n){return z(this.style(t,n),{class:e})},this.style=function(t,n){h(t)||n||(n=t,t=[]);var i=O(t,(function(t,n){return z(t,e[n]||{})}),{});return n?z(i,n):i},this.computeStyle=function(e,n,i){return h(n)||(i=n,n=[]),t.style(n||[],z({},i,e||{}))}}]};function Tt(e,t){if(!e||!t)return-1;var n=e.indexOf(t);return-1!==n&&e.splice(n,1),n}function At(e,t,n){if(e&&t){"number"!=typeof n&&(n=-1);var i=e.indexOf(t);if(-1!==i){if(i===n)return;if(-1===n)return;e.splice(i,1)}-1!==n?e.splice(n,0,t):e.push(t)}}function Mt(e,t){return e&&t?e.indexOf(t):-1}function Dt(e,t){return e&&t?Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)):-1}function Rt(e,t,n,i){if(void 0===i&&(i=5),!e||!t||!n)return!1;var r=(t.x-e.x)*(n.y-e.y)-(t.y-e.y)*(n.x-e.x),o=Dt(e,t);return Math.abs(r/o)<=i}function Nt(e,t){var n=Array.from(arguments).flat();const i={x:"v",y:"h"};for(const[e,t]of Object.entries(i))if($t(e,n))return t;return!1}function $t(e,t){const n=t[0];return P(t,(function(t){return Math.abs(n[e]-t[e])<=2}))}function jt(e,t,n){return n=n||0,e.x>t.x-n&&e.y>t.y-n&&e.x=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height}function on(e,t,n,i,r){return e*(e*(-3*t+9*n-9*i+3*r)+6*t-12*n+6*i)-3*t+3*n}function sn(e,t,n,i,r,o,s,a,l){null==l&&(l=1);for(var c=(l=l>1?1:l<0?0:l)/2,p=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],u=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],d=0,h=0;h<12;h++){var f=c*p[h]+c,m=on(f,e,n,r,s),g=on(f,t,i,o,a),y=m*m+g*g;d+=u[h]*qt.sqrt(y)}return c*d}function an(e,t,n,i,r,o,s,a){if(!(Vt(e,n)Vt(r,s)||Vt(t,i)Vt(o,a))){var l=(e*i-t*n)*(o-a)-(t-i)*(r*a-o*s),c=(e-n)*(o-a)-(t-i)*(r-s);if(c){var p=ln(((e*i-t*n)*(r-s)-(e-n)*(r*a-o*s))/c),u=ln(l/c),d=+p.toFixed(2),h=+u.toFixed(2);if(!(d<+Ft(e,n).toFixed(2)||d>+Vt(e,n).toFixed(2)||d<+Ft(r,s).toFixed(2)||d>+Vt(r,s).toFixed(2)||h<+Ft(t,i).toFixed(2)||h>+Vt(t,i).toFixed(2)||h<+Ft(o,a).toFixed(2)||h>+Vt(o,a).toFixed(2)))return{x:p,y:u}}}}function ln(e){return Math.round(1e11*e)/1e11}function cn(e,t,n){if(!function(e,t){return e=Zt(e),rn(t=Zt(t),e.x,e.y)||rn(t,e.x2,e.y)||rn(t,e.x,e.y2)||rn(t,e.x2,e.y2)||rn(e,t.x,t.y)||rn(e,t.x2,t.y)||rn(e,t.x,t.y2)||rn(e,t.x2,t.y2)||(e.xt.x||t.xe.x)&&(e.yt.y||t.ye.y)}(nn(e),nn(t)))return n?0:[];for(var i=sn(...e),r=sn(...t),o=dn(e)?1:~~(i/5)||1,s=dn(t)?1:~~(r/5)||1,a=[],l=[],c={},p=n?0:[],u=0;u=0&&_<=1&&E>=0&&E<=1&&(n?p++:p.push({x:w.x,y:w.y,t1:_,t2:E}))}}return p}function pn(e,t,n){e=gn(e),t=gn(t);for(var i,r,o,s,a,l,c,p,u,d,h=n?0:[],f=0,m=e.length;f2&&(i.push([t,...o.splice(0,2)]),s="l",t="m"==t?"l":"L");o.length>=n[s]&&(i.push([t,...o.splice(0,n[s])]),n[s]););})),i.toString=Yt.toString,t.arr=Kt(i),i}(e)),!e||!e.length)return[["M",0,0]];var n,i=[],r=0,o=0,s=0,a=0,l=0;"M"==e[0][0]&&(s=r=+e[0][1],a=o=+e[0][2],l++,i[0]=["M",r,o]);for(var c,p,u=l,d=e.length;u=1e3&&delete i[r.shift()],r.push(n),i[n]=e(...arguments),i[n])}}((function(e,t,n){return{x:e*qt.cos(n)-t*qt.sin(n),y:e*qt.sin(n)+t*qt.cos(n)}}));if(c)E=c[0],O=c[1],w=c[2],_=c[3];else{e=(p=f(e,t,-d)).x,t=p.y;var m=(e-(a=(p=f(a,l,-d)).x))/2,g=(t-(l=p.y))/2,y=m*m/(n*n)+g*g/(i*i);y>1&&(n*=y=qt.sqrt(y),i*=y);var v=n*n,b=i*i,x=(o==s?-1:1)*qt.sqrt(Ut((v*b-v*g*g-b*m*m)/(v*g*g+b*m*m))),w=x*n*g/i+(e+a)/2,_=x*-i*m/n+(t+l)/2,E=qt.asin(((t-_)/i).toFixed(9)),O=qt.asin(((l-_)/i).toFixed(9));(E=eO&&(E-=2*zt),!s&&O>E&&(O-=2*zt)}var P=O-E;if(Ut(P)>u){var k=O,S=a,C=l;O=E+u*(s&&O>E?1:-1),h=mn(a=w+n*qt.cos(O),l=_+i*qt.sin(O),n,i,r,0,s,S,C,[O,k,w,_])}P=O-E;var T=qt.cos(E),A=qt.sin(E),M=qt.cos(O),D=qt.sin(O),R=qt.tan(P/4),N=4/3*n*R,$=4/3*i*R,j=[e,t],I=[e+N*A,t-$*T],L=[a+N*D,l-$*M],B=[a,l];if(I[0]=2*j[0]-I[0],I[1]=2*j[1]-I[1],c)return[I,L,B].concat(h);for(var q=[],z=0,F=(h=[I,L,B].concat(h).join().split(",")).length;z7){e[t].shift();for(var i=e[t];i.length;)s[t]="A",e.splice(t++,0,["C",...i.splice(0,6)]);e.splice(t,1),p=n.length}},s=[],a="",l="",c=0,p=n.length;c=r.right,a=i.top-n.y>=r.bottom,l=o?"top":a?"bottom":null,c=i.right+n.x<=r.left?"left":s?"right":null;return c&&l?l+"-"+c:c||l||"intersect"}function kn(e,t,n){var i=function(e,t){return pn(e,t)}(e,t);return 1===i.length||2===i.length&&Dt(i[0],i[1])<1?xn(i[0]):i.length>1?(i=R(i,(function(e){var t=Math.floor(100*e.t2)||1;return t=((t=100-t)<10?"0":"")+t,e.segment2+"#"+t})),xn(i[n?0:i.length-1])):null}function Sn(e,t){return Math.round(e*t)/t}function Cn(e){return m(e)?e+"px":e}function Tn(e,t,n){const i=Le("g");Me(i).add(t);const r=void 0!==n?n:e.childNodes.length-1;return e.insertBefore(i,e.childNodes[r]||null),i}const An={shape:["x","y","width","height"],connection:["waypoints"]};function Mn(e,t,n,i){this._eventBus=t,this._elementRegistry=i,this._graphicsFactory=n,this._rootsIdx=0,this._layers={},this._planes=[],this._rootElement=null,this._init(e||{})}function Dn(e,t){const n="matrix("+t.a+","+t.b+","+t.c+","+t.d+","+t.e+","+t.f+")";e.setAttribute("transform",n)}Mn.$inject=["config.canvas","eventBus","graphicsFactory","elementRegistry"],Mn.prototype._init=function(e){const t=this._eventBus,n=this._container=function(e){const t=(e=z({},{width:"100%",height:"100%"},e)).container||document.body,n=document.createElement("div");return n.setAttribute("class","djs-container djs-parent"),Z(n,{position:"relative",overflow:"hidden",width:Cn(e.width),height:Cn(e.height)}),t.appendChild(n),n}(e),i=this._svg=Le("svg");Te(i,{width:"100%",height:"100%"}),ke(n,i);const r=this._viewport=Tn(i,"viewport");e.deferUpdate&&(this._viewboxChanged=B(q(this._viewboxChanged,this),300)),t.on("diagram.init",(()=>{t.fire("canvas.init",{svg:i,viewport:r})})),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)},Mn.prototype._destroy=function(){this._eventBus.fire("canvas.destroy",{svg:this._svg,viewport:this._viewport});const 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},Mn.prototype._clear=function(){this._elementRegistry.getAll().forEach((e=>{const t=Ot(e);"root"===t?this.removeRootElement(e):this._removeElement(e,t)})),this._planes=[],this._rootElement=null,delete this._cachedViewbox},Mn.prototype.getDefaultLayer=function(){return this.getLayer("base",0)},Mn.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)),void 0!==t&&n.index!==t)throw new Error("layer <"+e+"> already created at index <"+t+">");return n.group},Mn.prototype._getChildIndex=function(e){return O(this._layers,(function(t,n){return n.visible&&e>=n.index&&t++,t}),0)},Mn.prototype._createLayer=function(e,t){void 0===t&&(t=1);const n=this._getChildIndex(t);return{group:Tn(this._viewport,"layer-"+e,n),index:t,visible:!0}},Mn.prototype.showLayer=function(e){if(!e)throw new Error("must specify a name");const t=this._layers[e];if(!t)throw new Error("layer <"+e+"> does not exist");const n=this._viewport,i=t.group,r=t.index;if(t.visible)return i;const o=this._getChildIndex(r);return n.insertBefore(i,n.childNodes[o]||null),t.visible=!0,i},Mn.prototype.hideLayer=function(e){if(!e)throw new Error("must specify a name");const t=this._layers[e];if(!t)throw new Error("layer <"+e+"> does not exist");const n=t.group;return t.visible?(Ke(n),t.visible=!1,n):n},Mn.prototype._removeLayer=function(e){const t=this._layers[e];t&&(delete this._layers[e],Ke(t.group))},Mn.prototype.getActiveLayer=function(){const e=this._findPlaneForRoot(this.getRootElement());return e?e.layer:null},Mn.prototype.findRoot=function(e){if("string"==typeof e&&(e=this._elementRegistry.get(e)),!e)return;const t=this._findPlaneForRoot(function(e){for(;e.parent;)e=e.parent;return e}(e))||{};return t.rootElement},Mn.prototype.getRootElements=function(){return this._planes.map((function(e){return e.rootElement}))},Mn.prototype._findPlaneForRoot=function(e){return b(this._planes,(function(t){return t.rootElement===e}))},Mn.prototype.getContainer=function(){return this._container},Mn.prototype._updateMarker=function(e,t,n){let i;e.id||(e=this._elementRegistry.get(e)),i=this._elementRegistry._elements[e.id],i&&(_([i.gfx,i.secondaryGfx],(function(e){e&&(n?Me(e).add(t):Me(e).remove(t))})),this._eventBus.fire("element.marker.update",{element:e,gfx:i.gfx,marker:t,add:!!n}))},Mn.prototype.addMarker=function(e,t){this._updateMarker(e,t,!0)},Mn.prototype.removeMarker=function(e,t){this._updateMarker(e,t,!1)},Mn.prototype.hasMarker=function(e,t){e.id||(e=this._elementRegistry.get(e));return Me(this.getGraphics(e)).has(t)},Mn.prototype.toggleMarker=function(e,t){this.hasMarker(e,t)?this.removeMarker(e,t):this.addMarker(e,t)},Mn.prototype.getRootElement=function(){const e=this._rootElement;return e||this._planes.length?e:this.setRootElement(this.addRootElement(null))},Mn.prototype.addRootElement=function(e){const t=this._rootsIdx++;e||(e={id:"__implicitroot_"+t,children:[],isImplicit:!0});const n=e.layer="root-"+t;this._ensureValid("root",e);const i=this.getLayer(n,0);return this.hideLayer(n),this._addRoot(e,i),this._planes.push({rootElement:e,layer:i}),e},Mn.prototype.removeRootElement=function(e){"string"==typeof e&&(e=this._elementRegistry.get(e));if(this._findPlaneForRoot(e))return this._removeRoot(e),this._removeLayer(e.layer),this._planes=this._planes.filter((function(t){return t.rootElement!==e})),this._rootElement===e&&(this._rootElement=null),e},Mn.prototype.setRootElement=function(e){if(e===this._rootElement)return;let t;if(!e)throw new Error("rootElement required");return t=this._findPlaneForRoot(e),t||(e=this.addRootElement(e)),this._setRoot(e),e},Mn.prototype._removeRoot=function(e){const t=this._elementRegistry,n=this._eventBus;n.fire("root.remove",{element:e}),n.fire("root.removed",{element:e}),t.remove(e)},Mn.prototype._addRoot=function(e,t){const n=this._elementRegistry,i=this._eventBus;i.fire("root.add",{element:e}),n.add(e,t),i.fire("root.added",{element:e,gfx:t})},Mn.prototype._setRoot=function(e,t){const 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})},Mn.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");const n=An[e],i=P(n,(function(e){return void 0!==t[e]}));if(!i)throw new Error("must supply { "+n.join(", ")+" } with "+e)},Mn.prototype._setParent=function(e,t,n){At(t.children,e,n),e.parent=t},Mn.prototype._addElement=function(e,t,n,i){n=n||this.getRootElement();const r=this._eventBus,o=this._graphicsFactory;this._ensureValid(e,t),r.fire(e+".add",{element:t,parent:n}),this._setParent(t,n,i);const s=o.create(e,t,i);return this._elementRegistry.add(t,s),o.update(e,t,s),r.fire(e+".added",{element:t,gfx:s}),t},Mn.prototype.addShape=function(e,t,n){return this._addElement("shape",e,t,n)},Mn.prototype.addConnection=function(e,t,n){return this._addElement("connection",e,t,n)},Mn.prototype._removeElement=function(e,t){const n=this._elementRegistry,i=this._graphicsFactory,r=this._eventBus;if(e=n.get(e.id||e))return r.fire(t+".remove",{element:e}),i.remove(e),Tt(e.parent&&e.parent.children,e),e.parent=null,r.fire(t+".removed",{element:e}),n.remove(e),e},Mn.prototype.removeShape=function(e){return this._removeElement(e,"shape")},Mn.prototype.removeConnection=function(e){return this._removeElement(e,"connection")},Mn.prototype.getGraphics=function(e,t){return this._elementRegistry.getGraphics(e,t)},Mn.prototype._changeViewbox=function(e){this._eventBus.fire("canvas.viewbox.changing"),e.apply(this),this._cachedViewbox=null,this._viewboxChanged()},Mn.prototype._viewboxChanged=function(){this._eventBus.fire("canvas.viewbox.changed",{viewbox:this.viewbox()})},Mn.prototype.viewbox=function(e){if(void 0===e&&this._cachedViewbox)return this._cachedViewbox;const t=this._viewport,n=this.getSize();let i,r,o,s,a,l,c;return e?(this._changeViewbox((function(){a=Math.min(n.width/e.width,n.height/e.height);const i=this._svg.createSVGMatrix().scale(a).translate(-e.x,-e.y);Ze(t,i)})),e):(o=this._rootElement?this.getActiveLayer():null,i=o&&o.getBBox()||{},s=Ze(t),r=s?s.matrix:function(e,t,n,i,r,o){var s=qe().createSVGMatrix();switch(arguments.length){case 0:return s;case 1:return ze(s,e);case 6:return ze(s,{a:e,b:t,c:n,d:i,e:r,f:o})}}(),a=Sn(r.a,1e3),l=Sn(-r.e||0,1e3),c=Sn(-r.f||0,1e3),e=this._cachedViewbox={x:l?l/a:0,y:c?c/a:0,width:n.width/a,height:n.height/a,scale:a,inner:{width:i.width||0,height:i.height||0,x:i.x||0,y:i.y||0},outer:n})},Mn.prototype.scroll=function(e){const t=this._viewport;let n=t.getCTM();return e&&this._changeViewbox((function(){e=z({dx:0,dy:0},e||{}),n=this._svg.createSVGMatrix().translate(e.dx,e.dy).multiply(n),Dn(t,n)})),{x:n.e,y:n.f}},Mn.prototype.scrollToElement=function(e,t){let n=100;"string"==typeof e&&(e=this._elementRegistry.get(e));const i=this.findRoot(e);if(i!==this.getRootElement()&&this.setRootElement(i),i===e)return;t||(t={}),"number"==typeof t&&(n=t),t={top:t.top||n,right:t.right||n,bottom:t.bottom||n,left:t.left||n};const r=Et(e),o=wn(r),s=this.viewbox(),a=this.zoom();let l,c;s.y+=t.top/a,s.x+=t.left/a,s.width-=(t.right+t.left)/a,s.height-=(t.bottom+t.top)/a;const p=wn(s);if(r.width=0&&i.y>=0&&i.x+i.width<=n.width&&i.y+i.height<=n.height&&!e?o={x:0,y:0,width:Math.max(i.width+i.x,n.width),height:Math.max(i.height+i.y,n.height)}:(r=Math.min(1,n.width/i.width,n.height/i.height),o={x:i.x+(e?i.width/2-n.width/r/2:0),y:i.y+(e?i.height/2-n.height/r/2:0),width:n.width/r,height:n.height/r}),this.viewbox(o),this.viewbox(!1).scale},Mn.prototype._setZoom=function(e,t){const n=this._svg,i=this._viewport,r=n.createSVGMatrix(),o=n.createSVGPoint();let s,a,l,c,p;l=i.getCTM();const u=l.a;return t?(s=z(o,t),a=s.matrixTransform(l.inverse()),c=r.translate(a.x,a.y).scale(1/u*e).translate(-a.x,-a.y),p=l.multiply(c)):p=r.scale(e),Dn(this._viewport,p),p},Mn.prototype.getSize=function(){return{width:this._container.clientWidth,height:this._container.clientHeight}},Mn.prototype.getAbsoluteBBox=function(e){const t=this.viewbox();let n;if(e.waypoints){n=this.getGraphics(e).getBBox()}else n=e;return{x:n.x*t.scale-t.x*t.scale,y:n.y*t.scale-t.y*t.scale,width:n.width*t.scale,height:n.height*t.scale}},Mn.prototype.resized=function(){delete this._cachedViewbox,this._eventBus.fire("canvas.resized")};var Rn="data-element-id";function Nn(e){this._elements={},this._eventBus=e}function $n(e,t,n,i){var r=n.inverse;return Object.defineProperty(e,"remove",{value:function(e){var n=this.indexOf(e);return-1!==n&&(this.splice(n,1),t.unset(e,r,i)),e}}),Object.defineProperty(e,"contains",{value:function(e){return-1!==this.indexOf(e)}}),Object.defineProperty(e,"add",{value:function(e,n){var o=this.indexOf(e);if(void 0===n){if(-1!==o)return;n=this.length}-1!==o&&this.splice(o,1),this.splice(n,0,e),-1===o&&t.set(e,r,i)}}),Object.defineProperty(e,"__refs_collection",{value:!0}),e}function jn(e){return!0===e.__refs_collection}Nn.$inject=["eventBus"],Nn.prototype.add=function(e,t,n){var i=e.id;this._validateId(i),Te(t,Rn,i),n&&Te(n,Rn,i),this._elements[i]={element:e,gfx:t,secondaryGfx:n}},Nn.prototype.remove=function(e){var t=this._elements,n=e.id||e,i=n&&t[n];i&&(Te(i.gfx,Rn,""),i.secondaryGfx&&Te(i.secondaryGfx,Rn,""),delete t[n])},Nn.prototype.updateId=function(e,t){this._validateId(t),"string"==typeof e&&(e=this.get(e)),this._eventBus.fire("element.updateId",{element:e,newId:t});var n=this.getGraphics(e),i=this.getGraphics(e,!0);this.remove(e),e.id=t,this.add(e,n,i)},Nn.prototype.updateGraphics=function(e,t,n){var i=e.id||e,r=this._elements[i];return n?r.secondaryGfx=t:r.gfx=t,t&&Te(t,Rn,i),t},Nn.prototype.get=function(e){var t;t="string"==typeof e?e:e&&Te(e,Rn);var n=this._elements[t];return n&&n.element},Nn.prototype.filter=function(e){var t=[];return this.forEach((function(n,i){e(n,i)&&t.push(n)})),t},Nn.prototype.find=function(e){for(var t=this._elements,n=Object.keys(t),i=0;i in ref");t=this.props[t]}t.collection?In(this,t,e):function(e,t,n){var i=t.inverse,r=n[t.name];Object.defineProperty(n,t.name,{configurable:t.configurable,enumerable:t.enumerable,get:function(){return r},set:function(t){if(t!==r){var o=r;r=null,o&&e.unset(o,i,n),r=t,e.set(r,i,n)}}})}(this,t,e)},Ln.prototype.ensureRefsCollection=function(e,t){var n=e[t.name];return jn(n)||In(this,t,e),n},Ln.prototype.ensureBound=function(e,t){(function(e,t){return Object.prototype.hasOwnProperty.call(e,t.name||t)})(e,t)||this.bind(e,t)},Ln.prototype.unset=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).remove(n):e[t.name]=void 0)},Ln.prototype.set=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).add(n):e[t.name]=n)};var Bn=new Ln({name:"children",enumerable:!0,collection:!0},{name:"parent"}),qn=new Ln({name:"labels",enumerable:!0,collection:!0},{name:"labelTarget"}),zn=new Ln({name:"attachers",collection:!0},{name:"host"}),Fn=new Ln({name:"outgoing",collection:!0},{name:"source"}),Vn=new Ln({name:"incoming",collection:!0},{name:"target"});function Hn(){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)}}),Bn.bind(this,"parent"),qn.bind(this,"labels"),Fn.bind(this,"outgoing"),Vn.bind(this,"incoming")}function Un(){Hn.call(this),Bn.bind(this,"children"),zn.bind(this,"host"),zn.bind(this,"attachers")}function Wn(){Hn.call(this),Bn.bind(this,"children")}function Gn(){Un.call(this),qn.bind(this,"labelTarget")}function Qn(){Hn.call(this),Fn.bind(this,"source"),Vn.bind(this,"target")}i(Un,Hn),i(Wn,Un),i(Gn,Un),i(Qn,Hn);var Xn={connection:Qn,shape:Un,label:Gn,root:Wn};function Kn(){this._uid=12}Kn.prototype.createRoot=function(e){return this.create("root",e)},Kn.prototype.createLabel=function(e){return this.create("label",e)},Kn.prototype.createShape=function(e){return this.create("shape",e)},Kn.prototype.createConnection=function(e){return this.create("connection",e)},Kn.prototype.create=function(e,t){return(t=z({},t||{})).id||(t.id=e+"_"+this._uid++),function(e,t){var n=Xn[e];if(!n)throw new Error("unknown type: <"+e+">");return z(new n,t)}(e,t)};var Yn="__fn",Zn=Array.prototype.slice;function Jn(){this._listeners={},this.on("diagram.destroy",1,this._destroy,this)}function ei(){}function ti(e){return e.childNodes[0]}function ni(e,t,n,i,r){var o=Fe();o.setTranslate(t,n);var s=Fe();s.setRotate(i||0,0,0);var a=Fe();a.setScale(r||1,r||1),Ze(e,[o,s,a])}function ii(e,t,n){var i=Fe();i.setTranslate(t,n),Ze(e,i)}function ri(e,t){var n=Fe();n.setRotate(t,0,0),Ze(e,n)}function oi(e,t){this._eventBus=e,this._elementRegistry=t}function si(e,t,n){var i=n||t.firstChild;e!==i&&t.insertBefore(e,i)}Jn.prototype.on=function(e,t,n,i){if(e=h(e)?e:[e],g(t)&&(i=n,n=t,t=1e3),!m(t))throw new Error("priority must be a number");var r=n;i&&((r=q(n,i))[Yn]=n[Yn]||n);var o=this;e.forEach((function(e){o._addListener(e,{priority:t,callback:r,next:null})}))},Jn.prototype.once=function(e,t,n,i){var r=this;if(g(t)&&(i=n,n=t,t=1e3),!m(t))throw new Error("priority must be a number");function o(){o.__isTomb=!0;var t=n.apply(i,arguments);return r.off(e,o),t}o[Yn]=n,this.on(e,t,o)},Jn.prototype.off=function(e,t){e=h(e)?e:[e];var n=this;e.forEach((function(e){n._removeListener(e,t)}))},Jn.prototype.createEvent=function(e){var t=new ei;return t.init(e),t},Jn.prototype.fire=function(e,t){var n,i,r,o;if(o=Zn.call(arguments),"object"==typeof e&&(e=(t=e).type),!e)throw new Error("no event type specified");if(i=this._listeners[e]){n=t instanceof ei?t:this.createEvent(t),o[0]=n;var s=n.type;e!==s&&(n.type=e);try{r=this._invokeListeners(n,o,i)}finally{e!==s&&(n.type=s)}return void 0===r&&n.defaultPrevented&&(r=!1),r}},Jn.prototype.handleError=function(e){return!1===this.fire("error",{error:e})},Jn.prototype._destroy=function(){this._listeners={}},Jn.prototype._invokeListeners=function(e,t,n){for(var i;n&&!e.cancelBubble;)i=this._invokeListener(e,t,n),n=n.next;return i},Jn.prototype._invokeListener=function(e,t,n){var i;if(n.callback.__isTomb)return i;try{i=function(e,t){return e.apply(null,t)}(n.callback,t),void 0!==i&&(e.returnValue=i,e.stopPropagation()),!1===i&&e.preventDefault()}catch(e){if(!this.handleError(e))throw console.error("unhandled error in event listener",e),e}return i},Jn.prototype._addListener=function(e,t){var n,i=this._getListeners(e);if(i){for(;i;){if(i.priority or , got "+e);n=r[1],i=r[0]}return{name:e=(i?i+":":"")+n,prefix:i,localName:n}}function vi(e){this.ns=e,this.name=e.name,this.allTypes=[],this.allTypesByName={},this.properties=[],this.propertiesByName={}}function bi(e,t){this.packageMap={},this.typeMap={},this.packages=[],this.properties=t,_(e,q(this.registerPackage,this))}function xi(e,t,n){var i=t[n];if(i in e)throw new Error("package with "+n+" <"+i+"> already defined")}function wi(e){this.model=e}function _i(e,t,n){Object.defineProperty(e,t.name,{enumerable:!t.isReference,writable:!0,value:n,configurable:!0})}function Ei(e){return e.replace(/^:/,"")}function Oi(e,t={}){this.properties=new wi(this),this.factory=new ui(this,this.properties),this.registry=new bi(e,this.properties),this.typeCache={},this.config=t}vi.prototype.build=function(){return V(this,["ns","name","allTypes","allTypesByName","properties","propertiesByName","bodyProperty","idProperty"])},vi.prototype.addProperty=function(e,t,n){"boolean"==typeof t&&(n=t,t=void 0),this.addNamedProperty(e,!1!==n);var i=this.properties;void 0!==t?i.splice(t,0,e):i.push(e)},vi.prototype.replaceProperty=function(e,t,n){var i=e.ns,r=this.properties,o=this.propertiesByName,s=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 a=r.indexOf(e);if(-1===a)throw new Error("property <"+i.name+"> not found in property list");r.splice(a,1),this.addProperty(t,n?void 0:a,s),o[i.name]=o[i.localName]=t},vi.prototype.redefineProperty=function(e,t,n){var i=e.ns.prefix,r=t.split("#"),o=yi(r[0],i),s=yi(r[1],o.prefix).name,a=this.propertiesByName[s];if(!a)throw new Error("refined property <"+s+"> not found");this.replaceProperty(a,e,n),delete e.redefines},vi.prototype.addNamedProperty=function(e,t){var n=e.ns,i=this.propertiesByName;t&&(this.assertNotDefined(e,n.name),this.assertNotDefined(e,n.localName)),i[n.name]=i[n.localName]=e},vi.prototype.removeNamedProperty=function(e){var t=e.ns,n=this.propertiesByName;delete n[t.name],delete n[t.localName]},vi.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},vi.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},vi.prototype.assertNotTrait=function(e){if((e.extends||[]).length)throw new Error(`cannot create <${e.name}> extending <${e.extends}>`)},vi.prototype.assertNotDefined=function(e,t){var n=e.name,i=this.propertiesByName[n];if(i)throw new Error("property <"+n+"> already defined; override of <"+i.definedBy.ns.name+"#"+i.ns.name+"> by <"+e.definedBy.ns.name+"#"+e.ns.name+"> not allowed without redefines")},vi.prototype.hasProperty=function(e){return this.propertiesByName[e]},vi.prototype.addTrait=function(e,t){t&&this.assertNotTrait(e);var n=this.allTypesByName,i=this.allTypes,r=e.name;r in n||(_(e.properties,q((function(n){n=z({},n,{name:n.ns.localName,inherited:t}),Object.defineProperty(n,"definedBy",{value:e});var i=n.replaces,r=n.redefines;i||r?this.redefineProperty(n,i||r,i):(n.isBody&&this.setBodyProperty(n),n.isId&&this.setIdProperty(n),this.addProperty(n))}),this)),i.push(e),n[r]=e)},bi.prototype.getPackage=function(e){return this.packageMap[e]},bi.prototype.getPackages=function(){return this.packages},bi.prototype.registerPackage=function(e){e=z({},e);var t=this.packageMap;xi(t,e,"prefix"),xi(t,e,"uri"),_(e.types,q((function(t){this.registerType(t,e)}),this)),t[e.uri]=t[e.prefix]=e,this.packages.push(e)},bi.prototype.registerType=function(e,t){var n=yi((e=z({},e,{superClass:(e.superClass||[]).slice(),extends:(e.extends||[]).slice(),properties:(e.properties||[]).slice(),meta:z(e.meta||{})})).name,t.prefix),i=n.name,r={};_(e.properties,q((function(e){var t=yi(e.name,n.prefix),i=t.name;mi(e.type)||(e.type=yi(e.type,t.prefix).name),z(e,{ns:t,name:i}),r[i]=e}),this)),z(e,{ns:n,name:i,propertiesByName:r}),_(e.extends,q((function(e){var t=yi(e,n.prefix),r=this.typeMap[t.name];r.traits=r.traits||[],r.traits.push(i)}),this)),this.definePackage(e,t),this.typeMap[i]=e},bi.prototype.mapTypes=function(e,t,n){var i=mi(e.name)?{name:e.name}:this.typeMap[e.name],r=this;function o(n,i){var o=yi(n,mi(n)?"":e.prefix);r.mapTypes(o,t,i)}function s(e){return o(e,!0)}if(!i)throw new Error("unknown type <"+e.name+">");_(i.superClass,n?s:function(e){return o(e,!1)}),t(i,!n),_(i.traits,s)},bi.prototype.getEffectiveDescriptor=function(e){var t=yi(e),n=new vi(t);this.mapTypes(t,(function(e,t){n.addTrait(e,t)}));var i=n.build();return this.definePackage(i,i.allTypes[i.allTypes.length-1].$pkg),i},bi.prototype.definePackage=function(e,t){this.properties.define(e,"$pkg",{value:t})},wi.prototype.set=function(e,t,n){if(!y(t)||!t.length)throw new TypeError("property name must be a non-empty string");var i=this.getProperty(e,t),r=i&&i.name;void 0===n?i?delete e[r]:delete e.$attrs[Ei(t)]:i?r in e?e[r]=n:_i(e,i,n):e.$attrs[Ei(t)]=n},wi.prototype.get=function(e,t){var n=this.getProperty(e,t);if(!n)return e.$attrs[Ei(t)];var i=n.name;return!e[i]&&n.isMany&&_i(e,n,[]),e[i]},wi.prototype.define=function(e,t,n){if(!n.writable){var i=n.value;delete(n=z({},n,{get:function(){return i}})).value}Object.defineProperty(e,t,n)},wi.prototype.defineDescriptor=function(e,t){this.define(e,"$descriptor",{value:t})},wi.prototype.defineModel=function(e,t){this.define(e,"$model",{value:t})},wi.prototype.getProperty=function(e,t){var n=this.model,i=n.getPropertyDescriptor(e,t);if(i)return i;if(t.includes(":"))return null;const r=n.config.strict;if(void 0!==r){const n=new TypeError(`unknown property <${t}> on <${e.$type}>`);if(r)throw n;"undefined"!=typeof console&&console.warn(n)}return null},Oi.prototype.create=function(e,t){var n=this.getType(e);if(!n)throw new Error("unknown type <"+e+">");return new n(t)},Oi.prototype.getType=function(e){var t=this.typeCache,n=y(e)?e:e.ns.name,i=t[n];return i||(e=this.registry.getEffectiveDescriptor(n),i=t[n]=this.factory.createType(e)),i},Oi.prototype.createAny=function(e,t,n){var i=yi(e),r={$type:e,$instanceOf:function(e){return e===this.$type},get:function(e){return this[e]},set:function(e,t){F(this,[e],t)}},o={name:e,isGeneric:!0,ns:{prefix:i.prefix,localName:i.localName,uri:t}};return this.properties.defineDescriptor(r,o),this.properties.defineModel(r,this),this.properties.define(r,"get",{enumerable:!1,writable:!0}),this.properties.define(r,"set",{enumerable:!1,writable:!0}),this.properties.define(r,"$parent",{enumerable:!1,writable:!0}),this.properties.define(r,"$instanceOf",{enumerable:!1,writable:!0}),_(n,(function(e,t){f(e)&&void 0!==e.value?r[e.name]=e.value:r[t]=e})),r},Oi.prototype.getPackage=function(e){return this.registry.getPackage(e)},Oi.prototype.getPackages=function(){return this.registry.getPackages()},Oi.prototype.getElementDescriptor=function(e){return e.$descriptor},Oi.prototype.hasType=function(e,t){return void 0===t&&(t=e,e=this),t in e.$model.getElementDescriptor(e).allTypesByName},Oi.prototype.getPropertyDescriptor=function(e,t){return this.getElementDescriptor(e).propertiesByName[t]},Oi.prototype.getTypeDescriptor=function(e){return this.registry.typeMap[e]};var Pi=String.fromCharCode,ki=Object.prototype.hasOwnProperty,Si=/(\d+);|([0-9a-f]+);|&(\w+);/gi,Ci={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'};function Ti(e,t,n,i){return i?ki.call(Ci,i)?Ci[i]:"&"+i+";":Pi(t||parseInt(n,16))}function Ai(e){return e.length>3&&-1!==e.indexOf("&")?e.replace(Si,Ti):e}Object.keys(Ci).forEach((function(e){Ci[e.toUpperCase()]=Ci[e]}));var Mi="xsi:type",Di="non-whitespace outside of root node";function Ri(e){return new Error(e)}function Ni(e){return"missing namespace for prefix <"+e+">"}function $i(e){return{get:e,enumerable:!0}}function ji(e){var t,n={};for(t in e)n[t]=e[t];return n}function Ii(e){return e+"$uri"}function Li(){return{line:0,column:0}}function Bi(e){throw e}function qi(e){if(!this)return new qi(e);var t,n,i,r,o,s,a,l,c,p=e&&e.proxy,u=Bi,d=Li,h=!1,f=!1,m=null,g=!1;function y(e){e instanceof Error||(e=Ri(e)),m=e,u(e,d)}function v(e){o&&(e instanceof Error||(e=Ri(e)),o(e,d))}this.on=function(e,c){if("function"!=typeof c)throw Ri("required args ");switch(e){case"openTag":n=c;break;case"text":t=c;break;case"closeTag":i=c;break;case"error":u=c;break;case"warn":o=c;break;case"cdata":r=c;break;case"attention":l=c;break;case"question":a=c;break;case"comment":s=c;break;default:throw Ri("unsupported event: "+e)}return this},this.ns=function(e){if(void 0===e&&(e={}),"object"!=typeof e)throw Ri("required args ");var t,n={};for(t in e)n[t]=e[t];return n["http://www.w3.org/2001/XMLSchema-instance"]="xsi",f=!0,c=n,this},this.parse=function(e){if("string"!=typeof e)throw Ri("required args ");return m=null,function(e){var o,u,m,b,x,w,_,E,O,P,k,S=f?[]:null,C=f?function(e){var t,n,i={};for(t in e)i[n=e[t]]=n,i[Ii(n)]=t;return i}(c):null,T=[],A=0,M=!1,D=!1,R=0,N=0,$="",j=0;function I(){if(null!==k)return k;var e,t,n,i,r,o,s,a,l,p,u,d=f&&C.xmlns,m=f&&h?[]:null,g=j,y=$,b=y.length,x={},w={};e:for(;g8)){for((p<65||p>122||p>90&&p<97)&&95!==p&&58!==p&&(v("illegal first char attribute name"),l=!0),u=g+1;u96&&p<123||p>64&&p<91||p>47&&p<59||46===p||45===p||95===p)){if(32===p||p<14&&p>8){v("missing attribute value"),g=u;continue e}if(61===p)break;v("illegal attribute name char"),l=!0}if("xmlns:xmlns"===(a=y.substring(g,u))&&(v("illegal declaration of xmlns"),l=!0),34===(p=y.charCodeAt(u+1)))-1===(u=y.indexOf('"',g=u+2))&&-1!==(u=y.indexOf("'",g))&&(v("attribute value quote missmatch"),l=!0);else if(39===p)-1===(u=y.indexOf("'",g=u+2))&&-1!==(u=y.indexOf('"',g))&&(v("attribute value quote missmatch"),l=!0);else for(v("missing attribute value quotes"),l=!0,u+=1;u8);u++);for(-1===u&&(v("missing closing quotes"),u=b,l=!0),l||(o=y.substring(g,u)),g=u;u+18);u++)g===u&&(v("illegal character after attribute end"),l=!0);if(g=u+1,!l)if(a in w)v("attribute <"+a+"> already defined");else if(w[a]=!0,f)if(h){if(null!==(r="xmlns"===a?"xmlns":120===a.charCodeAt(0)&&"xmlns:"===a.substr(0,6)?a.substr(6):null)){if(e=Ai(o),t=Ii(r),!(s=c[e])){if("xmlns"===r||t in C&&C[t]!==e)do{s="ns"+A++}while(void 0!==C[s]);else s=r;c[e]=s}C[r]!==s&&(i||(C=ji(C),i=!0),C[r]=s,"xmlns"===r&&(C[Ii(s)]=e,d=s),C[t]=e),x[a]=o;continue}m.push(a,o)}else-1!==(p=a.indexOf(":"))?(n=C[a.substring(0,p)])?((a=d===n?a.substr(p+1):n+a.substr(p))===Mi&&(-1!==(p=o.indexOf(":"))?(n=o.substring(0,p),o=(n=C[n]||n)+o.substring(p)):o=d+":"+o),x[a]=o):v(Ni(a.substring(0,p))):x[a]=o;else x[a]=o}if(h)for(g=0,b=m.length;g=s&&(t=i.exec(e))&&!((a=t[0].length+t.index)>R);)r+=1,s=a;return-1==R?(o=a,n=e.substring(N)):0===N?n=e.substring(N,R):(o=R-s,n=-1==N?e.substring(R):e.substring(R,N+1)),{data:n,line:r,column:o}}d=L,p&&(P=Object.create({},{name:$i((function(){return E})),originalName:$i((function(){return O})),attrs:$i(I),ns:$i((function(){return C}))}));for(;-1!==N;){if(-1===(R=60===e.charCodeAt(N)?N:e.indexOf("<",N)))return T.length?y("unexpected end of file"):0===N?y("missing start tag"):void(N",R)))return y("unclosed cdata");if(r&&(r(e.substring(R+9,N),d),g))return;N+=3;continue}if(45===b&&45===e.charCodeAt(R+3)){if(-1===(N=e.indexOf("--\x3e",R)))return y("unclosed comment");if(s&&(s(e.substring(R+4,N),Ai,d),g))return;N+=3;continue}}if(63!==x){for(u=R+1;;u++){if(w=e.charCodeAt(u),isNaN(w))return N=-1,y("unclosed tag");if(34===w)u=-1!==(b=e.indexOf('"',u+1))?b:u;else if(39===w)u=-1!==(b=e.indexOf("'",u+1))?b:u;else if(62===w){N=u;break}}if(33!==x){if(k={},47===x){if(M=!1,D=!0,!T.length)return y("missing open tag");if(u=E=T.pop(),b=R+2+u.length,e.substring(R+2,b)!==u)return y("closing tag mismatch");for(;b8&&x<14))return y("close tag")}else{if(47===e.charCodeAt(N-1)?(u=E=e.substring(R+1,N-1),M=!0,D=!0):(u=E=e.substring(R+1,N),M=!0,D=!1),!(x>96&&x<123||x>64&&x<91||95===x||58===x))return y("illegal first char nodeName");for(b=1,m=u.length;b96&&x<123||x>64&&x<91||x>47&&x<59||45===x||95===x||46==x)){if(32===x||x<14&&x>8){E=u.substring(0,b),k=null;break}return y("invalid nodeName")}D||T.push(E)}if(f){if(o=C,M&&(D||S.push(o),null===k&&(h=-1!==u.indexOf("xmlns",b))&&(j=b,$=u,I(),h=!1)),O=E,-1!==(x=E.indexOf(":"))){if(!(_=C[E.substring(0,x)]))return y("missing namespace on <"+O+">");E=E.substr(x+1)}else _=C.xmlns;_&&(E=_+":"+E)}if(M&&(j=b,$=u,n&&(p?n(P,Ai,D,d):n(E,I,Ai,D,d),g)))return;if(D){if(i&&(i(p?P:E,Ai,M,d),g))return;f&&(C=M?o:S.pop())}N+=1}else{if(l&&(l(e.substring(R,N+1),Ai,d),g))return;N+=1}}else{if(-1===(N=e.indexOf("?>",R)))return y("unclosed question");if(a&&(a(e.substring(R,N+2),d),g))return;N+=2}}}(e),d=Li,g=!1,m},this.stop=function(){g=!0}}function zi(e){return e.xml&&"lowerCase"===e.xml.tagAlias}var Fi={xsi:"http://www.w3.org/2001/XMLSchema-instance",xml:"http://www.w3.org/XML/1998/namespace"},Vi="xsi:type";function Hi(e){return e.xml&&e.xml.serialize}function Ui(e){return Hi(e)===Vi}function Wi(e,t){return zi(t)?e.prefix+":"+((n=e.localName).charAt(0).toUpperCase()+n.slice(1)):e.name;var n}function Gi(e){return new Error(e)}function Qi(e){return e.$descriptor}function Xi(e){z(this,e),this.elementsById={},this.references=[],this.warnings=[],this.addReference=function(e){this.references.push(e)},this.addElement=function(e){if(!e)throw Gi("expected element");var t,n=this.elementsById,i=Qi(e).idProperty;if(i&&(t=e.get(i.name))){if(!/^([a-z][\w-.]*:)?[a-z_][\w-.]*$/i.test(t))throw new Error("illegal ID <"+t+">");if(n[t])throw Gi("duplicate ID <"+t+">");n[t]=e}},this.addWarning=function(e){this.warnings.push(e)}}function Ki(){}function Yi(){}function Zi(){}function Ji(e,t){this.property=e,this.context=t}function er(e,t){this.element=t,this.propertyDesc=e}function tr(){}function nr(e,t,n){this.model=e,this.type=e.getType(t),this.context=n}function ir(e,t,n){nr.call(this,e,t,n)}function rr(e,t,n){this.model=e,this.context=n}function or(e){e instanceof Oi&&(e={model:e}),z(this,{lax:!1},e)}Ki.prototype.handleEnd=function(){},Ki.prototype.handleText=function(){},Ki.prototype.handleNode=function(){},Yi.prototype=Object.create(Ki.prototype),Yi.prototype.handleNode=function(){return this},Zi.prototype=Object.create(Ki.prototype),Zi.prototype.handleText=function(e){this.body=(this.body||"")+e},Ji.prototype=Object.create(Zi.prototype),Ji.prototype.handleNode=function(e){if(this.element)throw Gi("expected no sub nodes");return this.element=this.createReference(e),this},Ji.prototype.handleEnd=function(){this.element.id=this.body},Ji.prototype.createReference=function(e){return{property:this.property.ns.name,id:""}},er.prototype=Object.create(Zi.prototype),er.prototype.handleEnd=function(){var e=this.body||"",t=this.element,n=this.propertyDesc;e=fi(n.type,e),n.isMany?t.get(n.name).push(e):t.set(n.name,e)},tr.prototype=Object.create(Zi.prototype),tr.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},nr.prototype=Object.create(tr.prototype),nr.prototype.addReference=function(e){this.context.addReference(e)},nr.prototype.handleText=function(e){if(!Qi(this.element).bodyProperty)throw Gi("unexpected body text <"+e+">");Zi.prototype.handleText.call(this,e)},nr.prototype.handleEnd=function(){var e=this.body,t=this.element,n=Qi(t).bodyProperty;n&&void 0!==e&&(e=fi(n.type,e),t.set(n.name,e))},nr.prototype.createElement=function(e){var t,n=e.attributes,i=this.type,r=Qi(i),o=this.context,s=new i({}),a=this.model;return _(n,(function(e,n){var i=r.propertiesByName[n];i&&i.isReference?i.isMany?_(e.split(" "),(function(e){o.addReference({element:s,property:i.ns.name,id:e})})):o.addReference({element:s,property:i.ns.name,id:e}):(i?e=fi(i.type,e):"xmlns"!==n&&(t=yi(n,r.ns.prefix),a.getPackage(t.prefix)&&o.addWarning({message:"unknown attribute <"+n+">",element:s,property:n,value:e})),s.set(n,e))})),s},nr.prototype.getPropertyForNode=function(e){var t,n,i=yi(e.name),r=this.type,o=this.model,s=Qi(r),a=i.name,l=s.propertiesByName[a];if(l&&!l.isAttr)return Ui(l)&&(t=e.attributes[Vi])?(t=function(e,t){var n=yi(e);return function(e,t){var n=e.name,i=e.localName,r=t.xml&&t.xml.typePrefix;return r&&0===i.indexOf(r)?e.prefix+":"+i.slice(r.length):n}(n,t.getPackage(n.prefix))}(t,o),z({},l,{effectiveType:Qi(n=o.getType(t)).name})):l;var c=o.getPackage(i.prefix);if(c){if(t=Wi(i,c),n=o.getType(t),l=b(s.properties,(function(e){return!e.isVirtual&&!e.isReference&&!e.isAttribute&&n.hasType(e.type)})),l)return z({},l,{effectiveType:Qi(n).name})}else if(l=b(s.properties,(function(e){return!e.isReference&&!e.isAttribute&&"Element"===e.type})),l)return l;throw Gi("unrecognized element <"+i.name+">")},nr.prototype.toString=function(){return"ElementDescriptor["+Qi(this.type).name+"]"},nr.prototype.valueHandler=function(e,t){return new er(e,t)},nr.prototype.referenceHandler=function(e){return new Ji(e,this.context)},nr.prototype.handler=function(e){return"Element"===e?new rr(this.model,e,this.context):new nr(this.model,e,this.context)},nr.prototype.handleChild=function(e){var t,n,i,r;if(t=this.getPropertyForNode(e),i=this.element,gi(n=t.effectiveType||t.type))return this.valueHandler(t,i);var o=(r=t.isReference?this.referenceHandler(t).handleNode(e):this.handler(n).handleNode(e)).element;return void 0!==o&&(t.isMany?i.get(t.name).push(o):i.set(t.name,o),t.isReference?(z(o,{element:i}),this.context.addReference(o)):o.$parent=i),r},ir.prototype=Object.create(nr.prototype),ir.prototype.createElement=function(e){var t=e.name,n=yi(t),i=this.model,r=this.type,o=i.getPackage(n.prefix),s=o&&Wi(n,o)||t;if(!r.hasType(s))throw Gi("unexpected element <"+e.originalName+">");return nr.prototype.createElement.call(this,e)},rr.prototype=Object.create(tr.prototype),rr.prototype.createElement=function(e){var t=e.name,n=yi(t).prefix,i=e.ns[n+"$uri"],r=e.attributes;return this.model.createAny(t,i,r)},rr.prototype.handleChild=function(e){var t=new rr(this.model,"Element",this.context).handleNode(e),n=this.element,i=t.element;return void 0!==i&&((n.$children=n.$children||[]).push(i),i.$parent=n),t},rr.prototype.handleEnd=function(){this.body&&(this.element.$body=this.body)},or.prototype.fromXML=function(e,t,n){var i=t.rootHandler;t instanceof nr?(i=t,t={}):"string"==typeof t?(i=this.handler(t),t={}):"string"==typeof i&&(i=this.handler(i));var r=this.model,o=this.lax,s=new Xi(z({},t,{rootHandler:i})),a=new qi({proxy:!0}),l=function(){var e=[];return Object.defineProperty(e,"peek",{value:function(){return this[this.length-1]}}),e}();function c(e,t,n){var i=t(),r=i.line,o=i.column,a=i.data;"<"===a.charAt(0)&&-1!==a.indexOf(" ")&&(a=a.slice(0,a.indexOf(" "))+">");var l="unparsable content "+(a?a+" ":"")+"detected\n\tline: "+r+"\n\tcolumn: "+o+"\n\tnested error: "+e.message;if(n)return s.addWarning({message:l,error:e}),!0;throw Gi(l)}function p(e,t){return c(e,t,!0)}i.context=s,l.push(i);var u=/^<\?xml /i,d=/ encoding="([^"]+)"/i,h=/^utf-8$/i;function f(e,t){try{l.peek().handleText(e)}catch(e){p(e,t)}}var m=r.getPackages().reduce((function(e,t){return e[t.uri]=t.prefix,e}),{"http://www.w3.org/XML/1998/namespace":"xml"});return a.ns(m).on("openTag",(function(e,t,n,i){var r=e.attrs||{},s=Object.keys(r).reduce((function(e,n){var i=t(r[n]);return e[n]=i,e}),{});!function(e,t){var n=l.peek();try{l.push(n.handleNode(e))}catch(e){c(e,t,o)&&l.push(new Yi)}}({name:e.name,originalName:e.originalName,attributes:s,ns:e.ns},i)})).on("question",(function(e){if(u.test(e)){var t=d.exec(e),n=t&&t[1];n&&!h.test(n)&&s.addWarning({message:"unsupported document encoding <"+n+">, falling back to UTF-8"})}})).on("closeTag",(function(){l.pop().handleEnd()})).on("cdata",f).on("text",(function(e,t,n){!function(e,t){e.trim()&&f(e,t)}(t(e),n)})).on("error",c).on("warn",p),new Promise((function(t,n){var r;try{a.parse(e),function(){var e,t,n=s.elementsById,i=s.references;for(e=0;t=i[e];e++){var r=t.element,o=n[t.id],a=Qi(r).propertiesByName[t.property];if(o||s.addWarning({message:"unresolved reference <"+t.id+">",element:t.element,property:t.property,value:t.id}),a.isMany){var l=r.get(a.name),c=l.indexOf(t);-1===c&&(c=l.length),o?l[c]=o:l.splice(c,1)}else r.set(a.name,o)}}()}catch(e){r=e}var o=i.element;r||o||(r=Gi("failed to parse document as <"+i.type.$descriptor.name+">"));var l=s.warnings,c=s.references,p=s.elementsById;return r?(r.warnings=l,n(r)):t({rootElement:o,elementsById:p,references:c,warnings:l})}))},or.prototype.handler=function(e){return new ir(this.model,e)};var sr=/<|>|'|"|&|\n\r|\n/g,ar=/<|>|&/g;function lr(e){var t={},n={},i={},r=[],o=[];this.byUri=function(t){return n[t]||e&&e.byUri(t)},this.add=function(e,t){n[e.uri]=e,t?r.push(e):o.push(e),this.mapPrefix(e.prefix,e.uri)},this.uriByPrefix=function(e){return t[e||"xmlns"]},this.mapPrefix=function(e,n){t[e||"xmlns"]=n},this.getNSKey=function(e){return void 0!==e.prefix?e.uri+"|"+e.prefix:e.uri},this.logUsed=function(t){var n=t.uri,r=this.getNSKey(t);i[r]=this.byUri(n),e&&e.logUsed(t)},this.getUsed=function(e){var t=this;return[].concat(r,o).filter((function(e){var n=t.getNSKey(e);return i[n]}))}}function cr(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}function pr(e){return y(e)?e:(e.prefix?e.prefix+":":"")+e.localName}var ur={"\n":"#10","\n\r":"#10",'"':"#34","'":"#39","<":"#60",">":"#62","&":"#38"},dr={"<":"lt",">":"gt","&":"amp"};function hr(e,t,n){return(e=y(e)?e:""+e).replace(t,(function(e){return"&"+n[e]+";"}))}function fr(e){this.tagName=e}function mr(){}function gr(e){this.tagName=e}function yr(e,t){this.body=[],this.attrs=[],this.parent=e,this.propertyDescriptor=t}function vr(e,t){yr.call(this,e,t)}function br(){this.value="",this.write=function(e){this.value+=e}}function xr(e,t){var n=[""];this.append=function(t){return e.write(t),this},this.appendNewLine=function(){return t&&e.write("\n"),this},this.appendIndent=function(){return t&&e.write(n.join(" ")),this},this.indent=function(){return n.push(""),this},this.unindent=function(){return n.pop(),this}}function wr(e){return e=z({format:!1,preamble:!0},e||{}),{toXML:function(t,n){var i=n||new br,r=new xr(i,e.format);if(e.preamble&&r.append('\n'),(new yr).build(t).serializeTo(r),!n)return i.value}}}function _r(e,t){Oi.call(this,e,t)}fr.prototype.build=function(e){return this.element=e,this},fr.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"+this.element.id+""+this.tagName+">").appendNewLine()},mr.prototype.serializeValue=mr.prototype.serializeTo=function(e){e.append(this.escape?hr(this.value,ar,dr):this.value)},mr.prototype.build=function(e,t){return this.value=t,"String"===e.type&&-1!==t.search(ar)&&(this.escape=!0),this},cr(gr,mr),gr.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"),this.serializeValue(e),e.append(""+this.tagName+">").appendNewLine()},yr.prototype.build=function(e){this.element=e;var t,n,i=e.$descriptor,r=this.propertyDescriptor,o=i.isGeneric;return t=o?this.parseGeneric(e):this.parseNsAttributes(e),this.ns=r?this.nsPropertyTagName(r):this.nsTagName(i),this.tagName=this.addTagName(this.ns),o||(n=function(e){return w(e.$descriptor.properties,(function(t){var n=t.name;if(t.isVirtual)return!1;if(!v(e,n))return!1;var i=e[n];return i!==t.default&&null!==i&&(!t.isMany||i.length)}))}(e),this.parseAttributes(w(n,(function(e){return e.isAttr}))),this.parseContainments(function(e){return w(e,(function(e){return!e.isAttr}))}(n))),this.parseGenericAttributes(e,t),this},yr.prototype.nsTagName=function(e){return function(e,t){return t.isGeneric?z({localName:t.ns.localName},e):z({localName:(n=t.ns.localName,i=t.$pkg,zi(i)?function(e){return e.charAt(0).toLowerCase()+e.slice(1)}(n):n)},e);var n,i}(this.logNamespaceUsed(e.ns),e)},yr.prototype.nsPropertyTagName=function(e){return function(e,t){return z({localName:t.ns.localName},e)}(this.logNamespaceUsed(e.ns),e)},yr.prototype.isLocalNs=function(e){return e.uri===this.ns.uri},yr.prototype.nsAttributeName=function(e){var t;if(t=y(e)?yi(e):e.ns,e.inherited)return{localName:t.localName};var n=this.logNamespaceUsed(t);return this.getNamespaces().logUsed(n),this.isLocalNs(n)?{localName:t.localName}:z({localName:t.localName},n)},yr.prototype.parseGeneric=function(e){var t=this,n=this.body,i=[];return _(e,(function(r,o){"$body"===o?n.push((new mr).build({type:"String"},r)):"$children"===o?_(r,(function(e){n.push(new yr(t).build(e))})):0!==o.indexOf("$")&&t.parseNsAttribute(e,o,r)&&i.push({name:o,value:r})})),i},yr.prototype.parseNsAttribute=function(e,t,n){var i,r=e.$model,o=yi(t);if("xmlns"===o.prefix&&(i={prefix:o.localName,uri:n}),o.prefix||"xmlns"!==o.localName||(i={uri:n}),!i)return{name:t,value:n};if(r&&r.getPackage(n))this.logNamespace(i,!0,!0);else{var s=this.logNamespaceUsed(i,!0);this.getNamespaces().logUsed(s)}},yr.prototype.parseNsAttributes=function(e,t){var n=this,i=e.$attrs,r=[];return _(i,(function(t,i){var o=n.parseNsAttribute(e,i,t);o&&r.push(o)})),r},yr.prototype.parseGenericAttributes=function(e,t){var n=this;_(t,(function(t){if(t.name!==Vi)try{n.addAttribute(n.nsAttributeName(t.name),t.value)}catch(n){console.warn("missing namespace information for ",t.name,"=",t.value,"on",e,n)}}))},yr.prototype.parseContainments=function(e){var t=this,n=this.body,i=this.element;_(e,(function(e){var r=i.get(e.name),o=e.isReference;if(e.isMany||(r=[r]),e.isBody)n.push((new mr).build(e,r[0]));else if(gi(e.type))_(r,(function(i){n.push(new gr(t.addTagName(t.nsPropertyTagName(e))).build(e,i))}));else if(o)_(r,(function(i){n.push(new fr(t.addTagName(t.nsPropertyTagName(e))).build(i))}));else{var s=Ui(e),a=function(e){return"property"===Hi(e)}(e);_(r,(function(i){var r;r=s?new vr(t,e):a?new yr(t,e):new yr(t),n.push(r.build(i))}))}}))},yr.prototype.getNamespaces=function(e){var t,n=this.namespaces,i=this.parent;return n||(t=i&&i.getNamespaces(),e||!t?this.namespaces=n=new lr(t):n=t),n},yr.prototype.logNamespace=function(e,t,n){var i=this.getNamespaces(n),r=e.uri,o=e.prefix;return i.byUri(r)&&!n||i.add(e,t),i.mapPrefix(o,r),e},yr.prototype.logNamespaceUsed=function(e,t){var n,i,r,o=this.element.$model,s=this.getNamespaces(t),a=e.prefix,l=e.uri;if(!a&&!l)return{localName:e.localName};if(r=Fi[a]||o&&(o.getPackage(a)||{}).uri,!(l=l||r||s.uriByPrefix(a)))throw new Error("no namespace uri given for prefix <"+a+">");if(!(e=s.byUri(l))){for(n=a,i=1;s.uriByPrefix(n);)n=a+"_"+i++;e=this.logNamespace({prefix:n,uri:l},r===l)}return a&&s.mapPrefix(a,l),e},yr.prototype.parseAttributes=function(e){var t=this,n=this.element;_(e,(function(e){var i=n.get(e.name);if(e.isReference)if(e.isMany){var r=[];_(i,(function(e){r.push(e.id)})),i=r.join(" ")}else i=i.id;t.addAttribute(t.nsAttributeName(e),i)}))},yr.prototype.addTagName=function(e){var t=this.logNamespaceUsed(e);return this.getNamespaces().logUsed(t),pr(e)},yr.prototype.addAttribute=function(e,t){var n=this.attrs;y(t)&&(t=hr(t,sr,ur));var i=x(n,(function(t){return t.name.localName===e.localName&&t.name.uri===e.uri&&t.name.prefix===e.prefix})),r={name:e,value:t};-1!==i?n.splice(i,1,r):n.push(r)},yr.prototype.serializeAttributes=function(e){var t=this.attrs,n=this.namespaces;n&&(t=function(e){return e.getUsed().filter((function(e){return"xml"!==e.prefix})).map((function(e){return{name:"xmlns"+(e.prefix?":"+e.prefix:""),value:e.uri}}))}(n).concat(t)),_(t,(function(t){e.append(" ").append(pr(t.name)).append('="').append(t.value).append('"')}))},yr.prototype.serializeTo=function(e){var t=this.body[0],n=t&&t.constructor!==mr;e.appendIndent().append("<"+this.tagName),this.serializeAttributes(e),e.append(t?">":" />"),t&&(n&&e.appendNewLine().indent(),_(this.body,(function(t){t.serializeTo(e)})),n&&e.unindent().appendIndent(),e.append(""+this.tagName+">")),e.appendNewLine()},cr(vr,yr),vr.prototype.parseNsAttributes=function(e){var t=yr.prototype.parseNsAttributes.call(this,e),n=e.$descriptor;if(n.name===this.propertyDescriptor.type)return t;var i=this.typeNs=this.nsTagName(n);this.getNamespaces().logUsed(this.typeNs);var r=e.$model.getPackage(i.uri),o=r.xml&&r.xml.typePrefix||"";return this.addAttribute(this.nsAttributeName(Vi),(i.prefix?i.prefix+":":"")+o+n.ns.localName),t},vr.prototype.isLocalNs=function(e){return e.uri===(this.typeNs||this.ns).uri},_r.prototype=Object.create(Oi.prototype),_r.prototype.fromXML=function(e,t,n){y(t)||(n=t,t="bpmn:Definitions");var i=new or(z({model:this,lax:!0},n)),r=i.handler(t);return i.fromXML(e,r)},_r.prototype.toXML=function(e,t){var n=new wr(t);return new Promise((function(t,i){try{return t({xml:n.toXML(e)})}catch(e){return i(e)}}))};var Er={bpmn:{name:"BPMN20",uri:"http://www.omg.org/spec/BPMN/20100524/MODEL",prefix:"bpmn",associations:[],types:[{name:"Interface",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"operations",type:"Operation",isMany:!0},{name:"implementationRef",isAttr:!0,type:"String"}]},{name:"Operation",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"inMessageRef",type:"Message",isReference:!0},{name:"outMessageRef",type:"Message",isReference:!0},{name:"errorRef",type:"Error",isMany:!0,isReference:!0},{name:"implementationRef",isAttr:!0,type:"String"}]},{name:"EndPoint",superClass:["RootElement"]},{name:"Auditing",superClass:["BaseElement"]},{name:"GlobalTask",superClass:["CallableElement"],properties:[{name:"resources",type:"ResourceRole",isMany:!0}]},{name:"Monitoring",superClass:["BaseElement"]},{name:"Performer",superClass:["ResourceRole"]},{name:"Process",superClass:["FlowElementsContainer","CallableElement"],properties:[{name:"processType",type:"ProcessType",isAttr:!0},{name:"isClosed",isAttr:!0,type:"Boolean"},{name:"auditing",type:"Auditing"},{name:"monitoring",type:"Monitoring"},{name:"properties",type:"Property",isMany:!0},{name:"laneSets",isMany:!0,replaces:"FlowElementsContainer#laneSets",type:"LaneSet"},{name:"flowElements",isMany:!0,replaces:"FlowElementsContainer#flowElements",type:"FlowElement"},{name:"artifacts",type:"Artifact",isMany:!0},{name:"resources",type:"ResourceRole",isMany:!0},{name:"correlationSubscriptions",type:"CorrelationSubscription",isMany:!0},{name:"supports",type:"Process",isMany:!0,isReference:!0},{name:"definitionalCollaborationRef",type:"Collaboration",isAttr:!0,isReference:!0},{name:"isExecutable",isAttr:!0,type:"Boolean"}]},{name:"LaneSet",superClass:["BaseElement"],properties:[{name:"lanes",type:"Lane",isMany:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Lane",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"partitionElementRef",type:"BaseElement",isAttr:!0,isReference:!0},{name:"partitionElement",type:"BaseElement"},{name:"flowNodeRef",type:"FlowNode",isMany:!0,isReference:!0},{name:"childLaneSet",type:"LaneSet",xml:{serialize:"xsi:type"}}]},{name:"GlobalManualTask",superClass:["GlobalTask"]},{name:"ManualTask",superClass:["Task"]},{name:"UserTask",superClass:["Task"],properties:[{name:"renderings",type:"Rendering",isMany:!0},{name:"implementation",isAttr:!0,type:"String"}]},{name:"Rendering",superClass:["BaseElement"]},{name:"HumanPerformer",superClass:["Performer"]},{name:"PotentialOwner",superClass:["HumanPerformer"]},{name:"GlobalUserTask",superClass:["GlobalTask"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"renderings",type:"Rendering",isMany:!0}]},{name:"Gateway",isAbstract:!0,superClass:["FlowNode"],properties:[{name:"gatewayDirection",type:"GatewayDirection",default:"Unspecified",isAttr:!0}]},{name:"EventBasedGateway",superClass:["Gateway"],properties:[{name:"instantiate",default:!1,isAttr:!0,type:"Boolean"},{name:"eventGatewayType",type:"EventBasedGatewayType",isAttr:!0,default:"Exclusive"}]},{name:"ComplexGateway",superClass:["Gateway"],properties:[{name:"activationCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0}]},{name:"ExclusiveGateway",superClass:["Gateway"],properties:[{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0}]},{name:"InclusiveGateway",superClass:["Gateway"],properties:[{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0}]},{name:"ParallelGateway",superClass:["Gateway"]},{name:"RootElement",isAbstract:!0,superClass:["BaseElement"]},{name:"Relationship",superClass:["BaseElement"],properties:[{name:"type",isAttr:!0,type:"String"},{name:"direction",type:"RelationshipDirection",isAttr:!0},{name:"source",isMany:!0,isReference:!0,type:"Element"},{name:"target",isMany:!0,isReference:!0,type:"Element"}]},{name:"BaseElement",isAbstract:!0,properties:[{name:"id",isAttr:!0,type:"String",isId:!0},{name:"documentation",type:"Documentation",isMany:!0},{name:"extensionDefinitions",type:"ExtensionDefinition",isMany:!0,isReference:!0},{name:"extensionElements",type:"ExtensionElements"}]},{name:"Extension",properties:[{name:"mustUnderstand",default:!1,isAttr:!0,type:"Boolean"},{name:"definition",type:"ExtensionDefinition",isAttr:!0,isReference:!0}]},{name:"ExtensionDefinition",properties:[{name:"name",isAttr:!0,type:"String"},{name:"extensionAttributeDefinitions",type:"ExtensionAttributeDefinition",isMany:!0}]},{name:"ExtensionAttributeDefinition",properties:[{name:"name",isAttr:!0,type:"String"},{name:"type",isAttr:!0,type:"String"},{name:"isReference",default:!1,isAttr:!0,type:"Boolean"},{name:"extensionDefinition",type:"ExtensionDefinition",isAttr:!0,isReference:!0}]},{name:"ExtensionElements",properties:[{name:"valueRef",isAttr:!0,isReference:!0,type:"Element"},{name:"values",type:"Element",isMany:!0},{name:"extensionAttributeDefinition",type:"ExtensionAttributeDefinition",isAttr:!0,isReference:!0}]},{name:"Documentation",superClass:["BaseElement"],properties:[{name:"text",type:"String",isBody:!0},{name:"textFormat",default:"text/plain",isAttr:!0,type:"String"}]},{name:"Event",isAbstract:!0,superClass:["FlowNode","InteractionNode"],properties:[{name:"properties",type:"Property",isMany:!0}]},{name:"IntermediateCatchEvent",superClass:["CatchEvent"]},{name:"IntermediateThrowEvent",superClass:["ThrowEvent"]},{name:"EndEvent",superClass:["ThrowEvent"]},{name:"StartEvent",superClass:["CatchEvent"],properties:[{name:"isInterrupting",default:!0,isAttr:!0,type:"Boolean"}]},{name:"ThrowEvent",isAbstract:!0,superClass:["Event"],properties:[{name:"dataInputs",type:"DataInput",isMany:!0},{name:"dataInputAssociations",type:"DataInputAssociation",isMany:!0},{name:"inputSet",type:"InputSet"},{name:"eventDefinitions",type:"EventDefinition",isMany:!0},{name:"eventDefinitionRef",type:"EventDefinition",isMany:!0,isReference:!0}]},{name:"CatchEvent",isAbstract:!0,superClass:["Event"],properties:[{name:"parallelMultiple",isAttr:!0,type:"Boolean",default:!1},{name:"dataOutputs",type:"DataOutput",isMany:!0},{name:"dataOutputAssociations",type:"DataOutputAssociation",isMany:!0},{name:"outputSet",type:"OutputSet"},{name:"eventDefinitions",type:"EventDefinition",isMany:!0},{name:"eventDefinitionRef",type:"EventDefinition",isMany:!0,isReference:!0}]},{name:"BoundaryEvent",superClass:["CatchEvent"],properties:[{name:"cancelActivity",default:!0,isAttr:!0,type:"Boolean"},{name:"attachedToRef",type:"Activity",isAttr:!0,isReference:!0}]},{name:"EventDefinition",isAbstract:!0,superClass:["RootElement"]},{name:"CancelEventDefinition",superClass:["EventDefinition"]},{name:"ErrorEventDefinition",superClass:["EventDefinition"],properties:[{name:"errorRef",type:"Error",isAttr:!0,isReference:!0}]},{name:"TerminateEventDefinition",superClass:["EventDefinition"]},{name:"EscalationEventDefinition",superClass:["EventDefinition"],properties:[{name:"escalationRef",type:"Escalation",isAttr:!0,isReference:!0}]},{name:"Escalation",properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"escalationCode",isAttr:!0,type:"String"}],superClass:["RootElement"]},{name:"CompensateEventDefinition",superClass:["EventDefinition"],properties:[{name:"waitForCompletion",isAttr:!0,type:"Boolean",default:!0},{name:"activityRef",type:"Activity",isAttr:!0,isReference:!0}]},{name:"TimerEventDefinition",superClass:["EventDefinition"],properties:[{name:"timeDate",type:"Expression",xml:{serialize:"xsi:type"}},{name:"timeCycle",type:"Expression",xml:{serialize:"xsi:type"}},{name:"timeDuration",type:"Expression",xml:{serialize:"xsi:type"}}]},{name:"LinkEventDefinition",superClass:["EventDefinition"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"target",type:"LinkEventDefinition",isReference:!0},{name:"source",type:"LinkEventDefinition",isMany:!0,isReference:!0}]},{name:"MessageEventDefinition",superClass:["EventDefinition"],properties:[{name:"messageRef",type:"Message",isAttr:!0,isReference:!0},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0}]},{name:"ConditionalEventDefinition",superClass:["EventDefinition"],properties:[{name:"condition",type:"Expression",xml:{serialize:"xsi:type"}}]},{name:"SignalEventDefinition",superClass:["EventDefinition"],properties:[{name:"signalRef",type:"Signal",isAttr:!0,isReference:!0}]},{name:"Signal",superClass:["RootElement"],properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"ImplicitThrowEvent",superClass:["ThrowEvent"]},{name:"DataState",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"}]},{name:"ItemAwareElement",superClass:["BaseElement"],properties:[{name:"itemSubjectRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"dataState",type:"DataState"}]},{name:"DataAssociation",superClass:["BaseElement"],properties:[{name:"sourceRef",type:"ItemAwareElement",isMany:!0,isReference:!0},{name:"targetRef",type:"ItemAwareElement",isReference:!0},{name:"transformation",type:"FormalExpression",xml:{serialize:"property"}},{name:"assignment",type:"Assignment",isMany:!0}]},{name:"DataInput",superClass:["ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"},{name:"inputSetRef",type:"InputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"inputSetWithOptional",type:"InputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"inputSetWithWhileExecuting",type:"InputSet",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"DataOutput",superClass:["ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"},{name:"outputSetRef",type:"OutputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"outputSetWithOptional",type:"OutputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"outputSetWithWhileExecuting",type:"OutputSet",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"InputSet",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"dataInputRefs",type:"DataInput",isMany:!0,isReference:!0},{name:"optionalInputRefs",type:"DataInput",isMany:!0,isReference:!0},{name:"whileExecutingInputRefs",type:"DataInput",isMany:!0,isReference:!0},{name:"outputSetRefs",type:"OutputSet",isMany:!0,isReference:!0}]},{name:"OutputSet",superClass:["BaseElement"],properties:[{name:"dataOutputRefs",type:"DataOutput",isMany:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"inputSetRefs",type:"InputSet",isMany:!0,isReference:!0},{name:"optionalOutputRefs",type:"DataOutput",isMany:!0,isReference:!0},{name:"whileExecutingOutputRefs",type:"DataOutput",isMany:!0,isReference:!0}]},{name:"Property",superClass:["ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"}]},{name:"DataInputAssociation",superClass:["DataAssociation"]},{name:"DataOutputAssociation",superClass:["DataAssociation"]},{name:"InputOutputSpecification",superClass:["BaseElement"],properties:[{name:"dataInputs",type:"DataInput",isMany:!0},{name:"dataOutputs",type:"DataOutput",isMany:!0},{name:"inputSets",type:"InputSet",isMany:!0},{name:"outputSets",type:"OutputSet",isMany:!0}]},{name:"DataObject",superClass:["FlowElement","ItemAwareElement"],properties:[{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"}]},{name:"InputOutputBinding",properties:[{name:"inputDataRef",type:"InputSet",isAttr:!0,isReference:!0},{name:"outputDataRef",type:"OutputSet",isAttr:!0,isReference:!0},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0}]},{name:"Assignment",superClass:["BaseElement"],properties:[{name:"from",type:"Expression",xml:{serialize:"xsi:type"}},{name:"to",type:"Expression",xml:{serialize:"xsi:type"}}]},{name:"DataStore",superClass:["RootElement","ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"capacity",isAttr:!0,type:"Integer"},{name:"isUnlimited",default:!0,isAttr:!0,type:"Boolean"}]},{name:"DataStoreReference",superClass:["ItemAwareElement","FlowElement"],properties:[{name:"dataStoreRef",type:"DataStore",isAttr:!0,isReference:!0}]},{name:"DataObjectReference",superClass:["ItemAwareElement","FlowElement"],properties:[{name:"dataObjectRef",type:"DataObject",isAttr:!0,isReference:!0}]},{name:"ConversationLink",superClass:["BaseElement"],properties:[{name:"sourceRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"targetRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"ConversationAssociation",superClass:["BaseElement"],properties:[{name:"innerConversationNodeRef",type:"ConversationNode",isAttr:!0,isReference:!0},{name:"outerConversationNodeRef",type:"ConversationNode",isAttr:!0,isReference:!0}]},{name:"CallConversation",superClass:["ConversationNode"],properties:[{name:"calledCollaborationRef",type:"Collaboration",isAttr:!0,isReference:!0},{name:"participantAssociations",type:"ParticipantAssociation",isMany:!0}]},{name:"Conversation",superClass:["ConversationNode"]},{name:"SubConversation",superClass:["ConversationNode"],properties:[{name:"conversationNodes",type:"ConversationNode",isMany:!0}]},{name:"ConversationNode",isAbstract:!0,superClass:["InteractionNode","BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"participantRef",type:"Participant",isMany:!0,isReference:!0},{name:"messageFlowRefs",type:"MessageFlow",isMany:!0,isReference:!0},{name:"correlationKeys",type:"CorrelationKey",isMany:!0}]},{name:"GlobalConversation",superClass:["Collaboration"]},{name:"PartnerEntity",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"participantRef",type:"Participant",isMany:!0,isReference:!0}]},{name:"PartnerRole",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"participantRef",type:"Participant",isMany:!0,isReference:!0}]},{name:"CorrelationProperty",superClass:["RootElement"],properties:[{name:"correlationPropertyRetrievalExpression",type:"CorrelationPropertyRetrievalExpression",isMany:!0},{name:"name",isAttr:!0,type:"String"},{name:"type",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"Error",superClass:["RootElement"],properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"errorCode",isAttr:!0,type:"String"}]},{name:"CorrelationKey",superClass:["BaseElement"],properties:[{name:"correlationPropertyRef",type:"CorrelationProperty",isMany:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Expression",superClass:["BaseElement"],isAbstract:!1,properties:[{name:"body",isBody:!0,type:"String"}]},{name:"FormalExpression",superClass:["Expression"],properties:[{name:"language",isAttr:!0,type:"String"},{name:"evaluatesToTypeRef",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"Message",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"itemRef",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"ItemDefinition",superClass:["RootElement"],properties:[{name:"itemKind",type:"ItemKind",isAttr:!0},{name:"structureRef",isAttr:!0,type:"String"},{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"},{name:"import",type:"Import",isAttr:!0,isReference:!0}]},{name:"FlowElement",isAbstract:!0,superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"auditing",type:"Auditing"},{name:"monitoring",type:"Monitoring"},{name:"categoryValueRef",type:"CategoryValue",isMany:!0,isReference:!0}]},{name:"SequenceFlow",superClass:["FlowElement"],properties:[{name:"isImmediate",isAttr:!0,type:"Boolean"},{name:"conditionExpression",type:"Expression",xml:{serialize:"xsi:type"}},{name:"sourceRef",type:"FlowNode",isAttr:!0,isReference:!0},{name:"targetRef",type:"FlowNode",isAttr:!0,isReference:!0}]},{name:"FlowElementsContainer",isAbstract:!0,superClass:["BaseElement"],properties:[{name:"laneSets",type:"LaneSet",isMany:!0},{name:"flowElements",type:"FlowElement",isMany:!0}]},{name:"CallableElement",isAbstract:!0,superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"ioSpecification",type:"InputOutputSpecification",xml:{serialize:"property"}},{name:"supportedInterfaceRef",type:"Interface",isMany:!0,isReference:!0},{name:"ioBinding",type:"InputOutputBinding",isMany:!0,xml:{serialize:"property"}}]},{name:"FlowNode",isAbstract:!0,superClass:["FlowElement"],properties:[{name:"incoming",type:"SequenceFlow",isMany:!0,isReference:!0},{name:"outgoing",type:"SequenceFlow",isMany:!0,isReference:!0},{name:"lanes",type:"Lane",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"CorrelationPropertyRetrievalExpression",superClass:["BaseElement"],properties:[{name:"messagePath",type:"FormalExpression"},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"CorrelationPropertyBinding",superClass:["BaseElement"],properties:[{name:"dataPath",type:"FormalExpression"},{name:"correlationPropertyRef",type:"CorrelationProperty",isAttr:!0,isReference:!0}]},{name:"Resource",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"resourceParameters",type:"ResourceParameter",isMany:!0}]},{name:"ResourceParameter",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isRequired",isAttr:!0,type:"Boolean"},{name:"type",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"CorrelationSubscription",superClass:["BaseElement"],properties:[{name:"correlationKeyRef",type:"CorrelationKey",isAttr:!0,isReference:!0},{name:"correlationPropertyBinding",type:"CorrelationPropertyBinding",isMany:!0}]},{name:"MessageFlow",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"sourceRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"targetRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"MessageFlowAssociation",superClass:["BaseElement"],properties:[{name:"innerMessageFlowRef",type:"MessageFlow",isAttr:!0,isReference:!0},{name:"outerMessageFlowRef",type:"MessageFlow",isAttr:!0,isReference:!0}]},{name:"InteractionNode",isAbstract:!0,properties:[{name:"incomingConversationLinks",type:"ConversationLink",isMany:!0,isVirtual:!0,isReference:!0},{name:"outgoingConversationLinks",type:"ConversationLink",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"Participant",superClass:["InteractionNode","BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"interfaceRef",type:"Interface",isMany:!0,isReference:!0},{name:"participantMultiplicity",type:"ParticipantMultiplicity"},{name:"endPointRefs",type:"EndPoint",isMany:!0,isReference:!0},{name:"processRef",type:"Process",isAttr:!0,isReference:!0}]},{name:"ParticipantAssociation",superClass:["BaseElement"],properties:[{name:"innerParticipantRef",type:"Participant",isAttr:!0,isReference:!0},{name:"outerParticipantRef",type:"Participant",isAttr:!0,isReference:!0}]},{name:"ParticipantMultiplicity",properties:[{name:"minimum",default:0,isAttr:!0,type:"Integer"},{name:"maximum",default:1,isAttr:!0,type:"Integer"}],superClass:["BaseElement"]},{name:"Collaboration",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isClosed",isAttr:!0,type:"Boolean"},{name:"participants",type:"Participant",isMany:!0},{name:"messageFlows",type:"MessageFlow",isMany:!0},{name:"artifacts",type:"Artifact",isMany:!0},{name:"conversations",type:"ConversationNode",isMany:!0},{name:"conversationAssociations",type:"ConversationAssociation"},{name:"participantAssociations",type:"ParticipantAssociation",isMany:!0},{name:"messageFlowAssociations",type:"MessageFlowAssociation",isMany:!0},{name:"correlationKeys",type:"CorrelationKey",isMany:!0},{name:"choreographyRef",type:"Choreography",isMany:!0,isReference:!0},{name:"conversationLinks",type:"ConversationLink",isMany:!0}]},{name:"ChoreographyActivity",isAbstract:!0,superClass:["FlowNode"],properties:[{name:"participantRef",type:"Participant",isMany:!0,isReference:!0},{name:"initiatingParticipantRef",type:"Participant",isAttr:!0,isReference:!0},{name:"correlationKeys",type:"CorrelationKey",isMany:!0},{name:"loopType",type:"ChoreographyLoopType",default:"None",isAttr:!0}]},{name:"CallChoreography",superClass:["ChoreographyActivity"],properties:[{name:"calledChoreographyRef",type:"Choreography",isAttr:!0,isReference:!0},{name:"participantAssociations",type:"ParticipantAssociation",isMany:!0}]},{name:"SubChoreography",superClass:["ChoreographyActivity","FlowElementsContainer"],properties:[{name:"artifacts",type:"Artifact",isMany:!0}]},{name:"ChoreographyTask",superClass:["ChoreographyActivity"],properties:[{name:"messageFlowRef",type:"MessageFlow",isMany:!0,isReference:!0}]},{name:"Choreography",superClass:["Collaboration","FlowElementsContainer"]},{name:"GlobalChoreographyTask",superClass:["Choreography"],properties:[{name:"initiatingParticipantRef",type:"Participant",isAttr:!0,isReference:!0}]},{name:"TextAnnotation",superClass:["Artifact"],properties:[{name:"text",type:"String"},{name:"textFormat",default:"text/plain",isAttr:!0,type:"String"}]},{name:"Group",superClass:["Artifact"],properties:[{name:"categoryValueRef",type:"CategoryValue",isAttr:!0,isReference:!0}]},{name:"Association",superClass:["Artifact"],properties:[{name:"associationDirection",type:"AssociationDirection",isAttr:!0},{name:"sourceRef",type:"BaseElement",isAttr:!0,isReference:!0},{name:"targetRef",type:"BaseElement",isAttr:!0,isReference:!0}]},{name:"Category",superClass:["RootElement"],properties:[{name:"categoryValue",type:"CategoryValue",isMany:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Artifact",isAbstract:!0,superClass:["BaseElement"]},{name:"CategoryValue",superClass:["BaseElement"],properties:[{name:"categorizedFlowElements",type:"FlowElement",isMany:!0,isVirtual:!0,isReference:!0},{name:"value",isAttr:!0,type:"String"}]},{name:"Activity",isAbstract:!0,superClass:["FlowNode"],properties:[{name:"isForCompensation",default:!1,isAttr:!0,type:"Boolean"},{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0},{name:"ioSpecification",type:"InputOutputSpecification",xml:{serialize:"property"}},{name:"boundaryEventRefs",type:"BoundaryEvent",isMany:!0,isReference:!0},{name:"properties",type:"Property",isMany:!0},{name:"dataInputAssociations",type:"DataInputAssociation",isMany:!0},{name:"dataOutputAssociations",type:"DataOutputAssociation",isMany:!0},{name:"startQuantity",default:1,isAttr:!0,type:"Integer"},{name:"resources",type:"ResourceRole",isMany:!0},{name:"completionQuantity",default:1,isAttr:!0,type:"Integer"},{name:"loopCharacteristics",type:"LoopCharacteristics"}]},{name:"ServiceTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0}]},{name:"SubProcess",superClass:["Activity","FlowElementsContainer","InteractionNode"],properties:[{name:"triggeredByEvent",default:!1,isAttr:!0,type:"Boolean"},{name:"artifacts",type:"Artifact",isMany:!0}]},{name:"LoopCharacteristics",isAbstract:!0,superClass:["BaseElement"]},{name:"MultiInstanceLoopCharacteristics",superClass:["LoopCharacteristics"],properties:[{name:"isSequential",default:!1,isAttr:!0,type:"Boolean"},{name:"behavior",type:"MultiInstanceBehavior",default:"All",isAttr:!0},{name:"loopCardinality",type:"Expression",xml:{serialize:"xsi:type"}},{name:"loopDataInputRef",type:"ItemAwareElement",isReference:!0},{name:"loopDataOutputRef",type:"ItemAwareElement",isReference:!0},{name:"inputDataItem",type:"DataInput",xml:{serialize:"property"}},{name:"outputDataItem",type:"DataOutput",xml:{serialize:"property"}},{name:"complexBehaviorDefinition",type:"ComplexBehaviorDefinition",isMany:!0},{name:"completionCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"oneBehaviorEventRef",type:"EventDefinition",isAttr:!0,isReference:!0},{name:"noneBehaviorEventRef",type:"EventDefinition",isAttr:!0,isReference:!0}]},{name:"StandardLoopCharacteristics",superClass:["LoopCharacteristics"],properties:[{name:"testBefore",default:!1,isAttr:!0,type:"Boolean"},{name:"loopCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"loopMaximum",type:"Integer",isAttr:!0}]},{name:"CallActivity",superClass:["Activity","InteractionNode"],properties:[{name:"calledElement",type:"String",isAttr:!0}]},{name:"Task",superClass:["Activity","InteractionNode"]},{name:"SendTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"ReceiveTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"instantiate",default:!1,isAttr:!0,type:"Boolean"},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"ScriptTask",superClass:["Task"],properties:[{name:"scriptFormat",isAttr:!0,type:"String"},{name:"script",type:"String"}]},{name:"BusinessRuleTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"}]},{name:"AdHocSubProcess",superClass:["SubProcess"],properties:[{name:"completionCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"ordering",type:"AdHocOrdering",isAttr:!0},{name:"cancelRemainingInstances",default:!0,isAttr:!0,type:"Boolean"}]},{name:"Transaction",superClass:["SubProcess"],properties:[{name:"protocol",isAttr:!0,type:"String"},{name:"method",isAttr:!0,type:"String"}]},{name:"GlobalScriptTask",superClass:["GlobalTask"],properties:[{name:"scriptLanguage",isAttr:!0,type:"String"},{name:"script",isAttr:!0,type:"String"}]},{name:"GlobalBusinessRuleTask",superClass:["GlobalTask"],properties:[{name:"implementation",isAttr:!0,type:"String"}]},{name:"ComplexBehaviorDefinition",superClass:["BaseElement"],properties:[{name:"condition",type:"FormalExpression"},{name:"event",type:"ImplicitThrowEvent"}]},{name:"ResourceRole",superClass:["BaseElement"],properties:[{name:"resourceRef",type:"Resource",isReference:!0},{name:"resourceParameterBindings",type:"ResourceParameterBinding",isMany:!0},{name:"resourceAssignmentExpression",type:"ResourceAssignmentExpression"},{name:"name",isAttr:!0,type:"String"}]},{name:"ResourceParameterBinding",properties:[{name:"expression",type:"Expression",xml:{serialize:"xsi:type"}},{name:"parameterRef",type:"ResourceParameter",isAttr:!0,isReference:!0}],superClass:["BaseElement"]},{name:"ResourceAssignmentExpression",properties:[{name:"expression",type:"Expression",xml:{serialize:"xsi:type"}}],superClass:["BaseElement"]},{name:"Import",properties:[{name:"importType",isAttr:!0,type:"String"},{name:"location",isAttr:!0,type:"String"},{name:"namespace",isAttr:!0,type:"String"}]},{name:"Definitions",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"targetNamespace",isAttr:!0,type:"String"},{name:"expressionLanguage",default:"http://www.w3.org/1999/XPath",isAttr:!0,type:"String"},{name:"typeLanguage",default:"http://www.w3.org/2001/XMLSchema",isAttr:!0,type:"String"},{name:"imports",type:"Import",isMany:!0},{name:"extensions",type:"Extension",isMany:!0},{name:"rootElements",type:"RootElement",isMany:!0},{name:"diagrams",isMany:!0,type:"bpmndi:BPMNDiagram"},{name:"exporter",isAttr:!0,type:"String"},{name:"relationships",type:"Relationship",isMany:!0},{name:"exporterVersion",isAttr:!0,type:"String"}]}],enumerations:[{name:"ProcessType",literalValues:[{name:"None"},{name:"Public"},{name:"Private"}]},{name:"GatewayDirection",literalValues:[{name:"Unspecified"},{name:"Converging"},{name:"Diverging"},{name:"Mixed"}]},{name:"EventBasedGatewayType",literalValues:[{name:"Parallel"},{name:"Exclusive"}]},{name:"RelationshipDirection",literalValues:[{name:"None"},{name:"Forward"},{name:"Backward"},{name:"Both"}]},{name:"ItemKind",literalValues:[{name:"Physical"},{name:"Information"}]},{name:"ChoreographyLoopType",literalValues:[{name:"None"},{name:"Standard"},{name:"MultiInstanceSequential"},{name:"MultiInstanceParallel"}]},{name:"AssociationDirection",literalValues:[{name:"None"},{name:"One"},{name:"Both"}]},{name:"MultiInstanceBehavior",literalValues:[{name:"None"},{name:"One"},{name:"All"},{name:"Complex"}]},{name:"AdHocOrdering",literalValues:[{name:"Parallel"},{name:"Sequential"}]}],xml:{tagAlias:"lowerCase",typePrefix:"t"}},bpmndi:{name:"BPMNDI",uri:"http://www.omg.org/spec/BPMN/20100524/DI",prefix:"bpmndi",types:[{name:"BPMNDiagram",properties:[{name:"plane",type:"BPMNPlane",redefines:"di:Diagram#rootElement"},{name:"labelStyle",type:"BPMNLabelStyle",isMany:!0}],superClass:["di:Diagram"]},{name:"BPMNPlane",properties:[{name:"bpmnElement",isAttr:!0,isReference:!0,type:"bpmn:BaseElement",redefines:"di:DiagramElement#modelElement"}],superClass:["di:Plane"]},{name:"BPMNShape",properties:[{name:"bpmnElement",isAttr:!0,isReference:!0,type:"bpmn:BaseElement",redefines:"di:DiagramElement#modelElement"},{name:"isHorizontal",isAttr:!0,type:"Boolean"},{name:"isExpanded",isAttr:!0,type:"Boolean"},{name:"isMarkerVisible",isAttr:!0,type:"Boolean"},{name:"label",type:"BPMNLabel"},{name:"isMessageVisible",isAttr:!0,type:"Boolean"},{name:"participantBandKind",type:"ParticipantBandKind",isAttr:!0},{name:"choreographyActivityShape",type:"BPMNShape",isAttr:!0,isReference:!0}],superClass:["di:LabeledShape"]},{name:"BPMNEdge",properties:[{name:"label",type:"BPMNLabel"},{name:"bpmnElement",isAttr:!0,isReference:!0,type:"bpmn:BaseElement",redefines:"di:DiagramElement#modelElement"},{name:"sourceElement",isAttr:!0,isReference:!0,type:"di:DiagramElement",redefines:"di:Edge#source"},{name:"targetElement",isAttr:!0,isReference:!0,type:"di:DiagramElement",redefines:"di:Edge#target"},{name:"messageVisibleKind",type:"MessageVisibleKind",isAttr:!0,default:"initiating"}],superClass:["di:LabeledEdge"]},{name:"BPMNLabel",properties:[{name:"labelStyle",type:"BPMNLabelStyle",isAttr:!0,isReference:!0,redefines:"di:DiagramElement#style"}],superClass:["di:Label"]},{name:"BPMNLabelStyle",properties:[{name:"font",type:"dc:Font"}],superClass:["di:Style"]}],enumerations:[{name:"ParticipantBandKind",literalValues:[{name:"top_initiating"},{name:"middle_initiating"},{name:"bottom_initiating"},{name:"top_non_initiating"},{name:"middle_non_initiating"},{name:"bottom_non_initiating"}]},{name:"MessageVisibleKind",literalValues:[{name:"initiating"},{name:"non_initiating"}]}],associations:[]},dc:{name:"DC",uri:"http://www.omg.org/spec/DD/20100524/DC",prefix:"dc",types:[{name:"Boolean"},{name:"Integer"},{name:"Real"},{name:"String"},{name:"Font",properties:[{name:"name",type:"String",isAttr:!0},{name:"size",type:"Real",isAttr:!0},{name:"isBold",type:"Boolean",isAttr:!0},{name:"isItalic",type:"Boolean",isAttr:!0},{name:"isUnderline",type:"Boolean",isAttr:!0},{name:"isStrikeThrough",type:"Boolean",isAttr:!0}]},{name:"Point",properties:[{name:"x",type:"Real",default:"0",isAttr:!0},{name:"y",type:"Real",default:"0",isAttr:!0}]},{name:"Bounds",properties:[{name:"x",type:"Real",default:"0",isAttr:!0},{name:"y",type:"Real",default:"0",isAttr:!0},{name:"width",type:"Real",isAttr:!0},{name:"height",type:"Real",isAttr:!0}]}],associations:[]},di:{name:"DI",uri:"http://www.omg.org/spec/DD/20100524/DI",prefix:"di",types:[{name:"DiagramElement",isAbstract:!0,properties:[{name:"id",isAttr:!0,isId:!0,type:"String"},{name:"extension",type:"Extension"},{name:"owningDiagram",type:"Diagram",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"owningElement",type:"DiagramElement",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"modelElement",isReadOnly:!0,isVirtual:!0,isReference:!0,type:"Element"},{name:"style",type:"Style",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"ownedElement",type:"DiagramElement",isReadOnly:!0,isMany:!0,isVirtual:!0}]},{name:"Node",isAbstract:!0,superClass:["DiagramElement"]},{name:"Edge",isAbstract:!0,superClass:["DiagramElement"],properties:[{name:"source",type:"DiagramElement",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"target",type:"DiagramElement",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"waypoint",isUnique:!1,isMany:!0,type:"dc:Point",xml:{serialize:"xsi:type"}}]},{name:"Diagram",isAbstract:!0,properties:[{name:"id",isAttr:!0,isId:!0,type:"String"},{name:"rootElement",type:"DiagramElement",isReadOnly:!0,isVirtual:!0},{name:"name",isAttr:!0,type:"String"},{name:"documentation",isAttr:!0,type:"String"},{name:"resolution",isAttr:!0,type:"Real"},{name:"ownedStyle",type:"Style",isReadOnly:!0,isMany:!0,isVirtual:!0}]},{name:"Shape",isAbstract:!0,superClass:["Node"],properties:[{name:"bounds",type:"dc:Bounds"}]},{name:"Plane",isAbstract:!0,superClass:["Node"],properties:[{name:"planeElement",type:"DiagramElement",subsettedProperty:"DiagramElement-ownedElement",isMany:!0}]},{name:"LabeledEdge",isAbstract:!0,superClass:["Edge"],properties:[{name:"ownedLabel",type:"Label",isReadOnly:!0,subsettedProperty:"DiagramElement-ownedElement",isMany:!0,isVirtual:!0}]},{name:"LabeledShape",isAbstract:!0,superClass:["Shape"],properties:[{name:"ownedLabel",type:"Label",isReadOnly:!0,subsettedProperty:"DiagramElement-ownedElement",isMany:!0,isVirtual:!0}]},{name:"Label",isAbstract:!0,superClass:["Node"],properties:[{name:"bounds",type:"dc:Bounds"}]},{name:"Style",isAbstract:!0,properties:[{name:"id",isAttr:!0,isId:!0,type:"String"}]},{name:"Extension",properties:[{name:"values",isMany:!0,type:"Element"}]}],associations:[],xml:{tagAlias:"lowerCase"}},bioc:{name:"bpmn.io colors for BPMN",uri:"http://bpmn.io/schema/bpmn/biocolor/1.0",prefix:"bioc",types:[{name:"ColoredShape",extends:["bpmndi:BPMNShape"],properties:[{name:"stroke",isAttr:!0,type:"String"},{name:"fill",isAttr:!0,type:"String"}]},{name:"ColoredEdge",extends:["bpmndi:BPMNEdge"],properties:[{name:"stroke",isAttr:!0,type:"String"},{name:"fill",isAttr:!0,type:"String"}]}],enumerations:[],associations:[]},color:{name:"BPMN in Color",uri:"http://www.omg.org/spec/BPMN/non-normative/color/1.0",prefix:"color",types:[{name:"ColoredLabel",extends:["bpmndi:BPMNLabel"],properties:[{name:"color",isAttr:!0,type:"String"}]},{name:"ColoredShape",extends:["bpmndi:BPMNShape"],properties:[{name:"background-color",isAttr:!0,type:"String"},{name:"border-color",isAttr:!0,type:"String"}]},{name:"ColoredEdge",extends:["bpmndi:BPMNEdge"],properties:[{name:"border-color",isAttr:!0,type:"String"}]}],enumerations:[],associations:[]}};function Or(e,t){return new _r(z({},Er,e),t)}function Pr(e){return e?"<"+e.$type+(e.id?' id="'+e.id:"")+'" />':""}function kr(e){v(e,"di")||Object.defineProperty(e,"di",{enumerable:!1,get:function(){throw new Error("Tried to access di from the businessObject. The di is available through the diagram element only. For more information, see https://github.com/bpmn-io/bpmn-js/issues/1472")}})}function Sr(e,t){return e.$instanceOf(t)}function Cr(e,t){var n={},i=[],r={};function o(e,t){return function(n){e(n,t)}}function s(e){n[e.id]=e}function a(n,i){try{var o=r[n.id]&&function(n,i){if(n.gfx)throw new Error(t("already rendered {element}",{element:Pr(n)}));return e.element(n,r[n.id],i)}(n,i);return s(n),o}catch(e){l(e.message,{element:n,error:e}),console.error(t("failed to import {element}",{element:Pr(n)})),console.error(e)}}function l(t,n){e.error(t,n)}var c=this.registerDi=function(e){var n=e.bpmnElement;n?r[n.id]?l(t("multiple DI elements defined for {element}",{element:Pr(n)}),{element:n}):(r[n.id]=e,kr(n)):l(t("no bpmnElement referenced in {element}",{element:Pr(e)}),{element:e})};function p(e){var t;t=e.plane,c(t),_(t.planeElement,u)}function u(e){c(e)}this.handleDefinitions=function(s,a){var u=s.diagrams;if(a&&-1===u.indexOf(a))throw new Error(t("diagram not part of bpmn:Definitions"));if(!a&&u&&u.length&&(a=u[0]),!a)throw new Error(t("no diagram to display"));r={},p(a);var m=a.plane;if(!m)throw new Error(t("no plane for {element}",{element:Pr(a)}));var g=m.bpmnElement;if(!g){if(g=function(e){return b(e.rootElements,(function(e){return Sr(e,"bpmn:Process")||Sr(e,"bpmn:Collaboration")}))}(s),!g)throw new Error(t("no process or collaboration to display"));l(t("correcting missing bpmnElement on {plane} to {rootElement}",{plane:Pr(m),rootElement:Pr(g)})),m.bpmnElement=g,c(m)}var y,v,E=function(t,n){return e.root(t,r[t.id],n)}(g,m);if(Sr(g,"bpmn:Process")||Sr(g,"bpmn:SubProcess"))h(g,E);else{if(!Sr(g,"bpmn:Collaboration"))throw new Error(t("unsupported bpmnElement for {plane}: {rootElement}",{plane:Pr(m),rootElement:Pr(g)}));v=E,_((y=g).participants,o(A,v)),x(y.artifacts,v),i.push((function(){!function(e,t){_(e,o(f,t))}(y.messageFlows,v)})),function(e,t){w(e,(function(e){return!n[e.id]&&Sr(e,"bpmn:Process")&&e.laneSets})).forEach(o(h,t))}(s.rootElements,E)}d(i)};var d=this.handleDeferred=function(){for(;i.length;)i.shift()()};function h(e,t){T(e,t),E(e.ioSpecification,t),x(e.artifacts,t),s(e)}function f(e,t){a(e,t)}function m(e,t){a(e,t)}function g(e,t){a(e,t)}function y(e,t){a(e,t)}function v(e,t){a(e,t)}function x(e,t){_(e,(function(e){Sr(e,"bpmn:Association")?i.push((function(){v(e,t)})):v(e,t)}))}function E(e,t){e&&(_(e.dataInputs,o(g,t)),_(e.dataOutputs,o(y,t)))}var O=this.handleSubProcess=function(e,t){T(e,t),x(e.artifacts,t)};function P(e,t){var n=a(e,t);Sr(e,"bpmn:SubProcess")&&O(e,n||t),Sr(e,"bpmn:Activity")&&E(e.ioSpecification,t),i.push((function(){_(e.dataInputAssociations,o(m,t)),_(e.dataOutputAssociations,o(m,t))}))}function k(e,t){a(e,t)}function S(e,t){i.push((function(){var n=a(e,t);e.childLaneSet&&C(e.childLaneSet,n||t),function(e){_(e.flowNodeRef,(function(t){var n=t.get("lanes");n&&n.push(e)}))}(e)}))}function C(e,t){_(e.lanes,o(S,t))}function T(e,n){!function(e,n){_(e,(function(e){Sr(e,"bpmn:SequenceFlow")?i.push((function(){!function(e,t){a(e,t)}(e,n)})):Sr(e,"bpmn:BoundaryEvent")?i.unshift((function(){P(e,n)})):Sr(e,"bpmn:FlowNode")?P(e,n):Sr(e,"bpmn:DataObject")||(Sr(e,"bpmn:DataStoreReference")||Sr(e,"bpmn:DataObjectReference")?k(e,n):l(t("unrecognized flowElement {element} in context {context}",{element:Pr(e),context:n?Pr(n.businessObject):"null"}),{element:e,context:n}))}))}(e.flowElements,n),e.laneSets&&function(e,t){_(e,o(C,t))}(e.laneSets,n)}function A(e,t){var n=a(e,t),i=e.processRef;i&&h(i,n||t)}}function Tr(e,t){var n=Mr(e);return n&&"function"==typeof n.$instanceOf&&n.$instanceOf(t)}function Ar(e,t){return k(t,(function(t){return Tr(e,t)}))}function Mr(e){return e&&e.businessObject||e}function Dr(e){return e&&e.di}function Rr(e,t,n){var i,r,o,s,a=[];function l(e,t){var n=new Cr({root:function(e,t){return i.add(e,t)},element:function(e,t,n){return i.add(e,t,n)},error:function(e,t){a.push({message:e,context:t})}},o);t=t||e.diagrams&&e.diagrams[0];var r=function(e,t){if(!t)return;var n,i=t.plane.bpmnElement,r=i;Tr(i,"bpmn:Process")||Tr(i,"bpmn:Collaboration")||(r=function(e){var t=e;for(;t;){if(Tr(t,"bpmn:Process"))return t;t=t.$parent}}(i));n=Tr(r,"bpmn:Collaboration")?r:b(e.rootElements,(function(e){if(Tr(e,"bpmn:Collaboration"))return b(e.participants,(function(e){return e.processRef===r}))}));var o=[r];n&&(o=S(n.participants,(function(e){return e.processRef}))).push(n);var s=Nr(o),a=[t],l=[i];return _(e.diagrams,(function(e){var t=e.plane.bpmnElement;-1!==s.indexOf(t)&&-1===l.indexOf(t)&&(a.push(e),l.push(t))})),a}(e,t);if(!r)throw new Error(o("no diagram to display"));_(r,(function(t){n.handleDefinitions(e,t)}));var l=t.plane.bpmnElement.id;s.setRootElement(s.findRoot(l+"_plane")||s.findRoot(l))}return new Promise((function(c,p){try{return i=e.get("bpmnImporter"),r=e.get("eventBus"),o=e.get("translate"),s=e.get("canvas"),r.fire("import.render.start",{definitions:t}),l(t,n),r.fire("import.render.complete",{error:undefined,warnings:a}),c({warnings:a})}catch(e){return e.warnings=a,p(e)}}))}function Nr(e){var t=[];return _(e,(function(e){e&&(t.push(e),t=t.concat(Nr(e.flowElements)))})),t}var $r,jr=' ',Ir={verticalAlign:"middle"},Lr={color:"#404040"},Br={zIndex:"1001",position:"fixed",top:"0",left:"0",right:"0",bottom:"0"},qr={width:"100%",height:"100%",background:"rgba(40,40,40,0.2)"},zr={position:"absolute",left:"50%",top:"40%",transform:"translate(-50%)",width:"260px",padding:"10px",background:"white",boxShadow:"0 1px 4px rgba(0,0,0,0.3)",fontFamily:"Helvetica, Arial, sans-serif",fontSize:"14px",display:"flex",lineHeight:"1.3"},Fr='
'+jr+' Web-based tooling for BPMN, DMN and forms powered by bpmn.io . ';function Vr(){$r||(Z($r=be(Fr),Br),Z(we("svg",$r),Ir),Z(we(".backdrop",$r),qr),Z(we(".notice",$r),zr),Z(we(".link",$r),Lr,{margin:"15px 20px 15px 10px",alignSelf:"center"}),me.bind($r,".backdrop","click",(function(e){document.body.removeChild($r)}))),document.body.appendChild($r)}function Hr(e){e=z({},Wr,e),this._moddle=this._createModdle(e),this._container=this._createContainer(e),function(e){const t=be(''+jr+" ");Z(we("svg",t),Ir),Z(t,Lr,{position:"absolute",bottom:"15px",right:"15px",zIndex:"100"}),e.appendChild(t),de.bind(t,"click",(function(e){Vr(),e.preventDefault()}))}(this._container),this._init(this._container,this._moddle,e)}function Ur(e,t){return e.warnings=t,e}i(Hr,ci),Hr.prototype.importXML=async function(e,t){const n=this;let i=[];try{let o;e=this._emit("import.parse.start",{xml:e})||e;try{o=await this._moddle.fromXML(e,"bpmn:Definitions")}catch(e){throw this._emit("import.parse.complete",{error:e}),e}let s=o.rootElement;const a=o.references,l=o.warnings,c=o.elementsById;i=i.concat(l),s=this._emit("import.parse.complete",(r={error:null,definitions:s,elementsById:c,references:a,warnings:i},n.get("eventBus").createEvent(r)))||s;const p=await this.importDefinitions(s,t);return i=i.concat(p.warnings),this._emit("import.done",{error:null,warnings:i}),{warnings:i}}catch(e){let t=e;throw i=i.concat(t.warnings||[]),Ur(t,i),t=function(e){const t=/unparsable content <([^>]+)> detected([\s\S]*)$/.exec(e.message);t&&(e.message="unparsable content <"+t[1]+"> detected; this may indicate an invalid BPMN 2.0 diagram file"+t[2]);return e}(t),this._emit("import.done",{error:t,warnings:t.warnings}),t}var r},Hr.prototype.importDefinitions=async function(e,t){this._setDefinitions(e);return{warnings:(await this.open(t)).warnings}},Hr.prototype.open=async function(e){const t=this._definitions;let n=e;if(!t){const e=new Error("no XML imported");throw Ur(e,[]),e}if("string"==typeof e&&(n=function(e,t){if(!t)return null;return b(e.diagrams,(function(e){return e.id===t}))||null}(t,e),!n)){const t=new Error("BPMNDiagram <"+e+"> not found");throw Ur(t,[]),t}try{this.clear()}catch(e){throw Ur(e,[]),e}const{warnings:i}=await Rr(this,t,n);return{warnings:i}},Hr.prototype.saveXML=async function(e){e=e||{};let t,n,i=this._definitions;try{if(!i)throw new Error("no definitions loaded");i=this._emit("saveXML.start",{definitions:i})||i;n=(await this._moddle.toXML(i,e)).xml,n=this._emit("saveXML.serialized",{xml:n})||n}catch(e){t=e}const r=t?{error:t}:{xml:n};if(this._emit("saveXML.done",r),t)throw t;return r},Hr.prototype.saveSVG=async function(){let e,t;this._emit("saveSVG.start");try{const t=this.get("canvas"),n=t.getActiveLayer(),i=we("defs",t._svg),r=Xe(n),o=i?""+Xe(i)+" ":"",s=n.getBBox();e='\n\x3c!-- created with bpmn-js / http://bpmn.io --\x3e\n\n'+o+r+" "}catch(e){t=e}if(this._emit("saveSVG.done",{error:t,svg:e}),t)throw t;return{svg:e}},Hr.prototype._setDefinitions=function(e){this._definitions=e},Hr.prototype.getModules=function(){return this._modules},Hr.prototype.clear=function(){this.getDefinitions()&&ci.prototype.clear.call(this)},Hr.prototype.destroy=function(){ci.prototype.destroy.call(this),Ee(this._container)},Hr.prototype.on=function(e,t,n,i){return this.get("eventBus").on(e,t,n,i)},Hr.prototype.off=function(e,t){this.get("eventBus").off(e,t)},Hr.prototype.attachTo=function(e){if(!e)throw new Error("parentNode required");this.detach(),e.get&&e.constructor.prototype.jquery&&(e=e.get(0)),"string"==typeof e&&(e=we(e)),e.appendChild(this._container),this._emit("attach",{}),this.get("canvas").resized()},Hr.prototype.getDefinitions=function(){return this._definitions},Hr.prototype.detach=function(){const e=this._container,t=e.parentNode;t&&(this._emit("detach",{}),t.removeChild(e))},Hr.prototype._init=function(e,t,n){const i=n.modules||this.getModules(n),r=n.additionalModules||[],o=[].concat([{bpmnjs:["value",this],moddle:["value",t]}],i,r),s=z(H(n,["additionalModules"]),{canvas:z({},n.canvas,{container:e}),modules:o});ci.call(this,s),n&&n.container&&this.attachTo(n.container)},Hr.prototype._emit=function(e,t){return this.get("eventBus").fire(e,t)},Hr.prototype._createContainer=function(e){const t=be('
');return Z(t,{width:Gr(e.width),height:Gr(e.height),position:e.position}),t},Hr.prototype._createModdle=function(e){return new Or(z({},this._moddleExtensions,e.moddleExtensions))},Hr.prototype._modules=[];const Wr={width:"100%",height:"100%",position:"relative"};function Gr(e){return e+(m(e)?"px":"")}function Qr(e){Hr.call(this,e),this.on("import.parse.complete",(function(e){e.error||this._collectIds(e.definitions,e.elementsById)}),this),this.on("diagram.destroy",(function(){this.get("moddle").ids.clear()}),this)}function Xr(e,t){return!Tr(e,"bpmn:CallActivity")&&(Tr(e,"bpmn:SubProcess")?!(!(t=t||Dr(e))||!Tr(t,"bpmndi:BPMNPlane"))||t&&!!t.isExpanded:!Tr(e,"bpmn:Participant")||!!Mr(e).processRef)}function Kr(e){if(Tr(e,"bpmn:Participant")||Tr(e,"bpmn:Lane")){var t=Dr(e).isHorizontal;return void 0===t||t}}function Yr(e){return e&&!!Mr(e).triggeredByEvent}function Zr(e,t){return k(Mr(e).eventDefinitions,(function(e){return Tr(e,t)}))}i(Qr,Hr),Qr.prototype._createModdle=function(e){var t=Hr.prototype._createModdle.call(this,e);return t.ids=new s([32,36,1]),t},Qr.prototype._collectIds=function(e,t){var n,i=e.$model.ids;for(n in i.clear(),t)i.claim(n,t[n])};var Jr={width:90,height:20};function eo(e){return Tr(e,"bpmn:Event")||Tr(e,"bpmn:Gateway")||Tr(e,"bpmn:DataStoreReference")||Tr(e,"bpmn:DataObjectReference")||Tr(e,"bpmn:DataInput")||Tr(e,"bpmn:DataOutput")||Tr(e,"bpmn:SequenceFlow")||Tr(e,"bpmn:MessageFlow")||Tr(e,"bpmn:Group")}function to(e){return vn(e.label)}function no(e){var t=e.length/2-1,n=e[Math.floor(t)],i=e[Math.ceil(t+.01)],r=function(e){var t=e.length/2-1,n=e[Math.floor(t)],i=e[Math.ceil(t+.01)];return{x:n.x+(i.x-n.x)/2,y:n.y+(i.y-n.y)/2}}(e),o=Math.atan((i.y-n.y)/(i.x-n.x)),s=r.x,a=r.y;return Math.abs(o)1?r.get("parallelMultiple")?I(t,e,n,o):j(t,e,n,o):ao(r,"bpmn:MessageEventDefinition")?S(t,e,n,o):ao(r,"bpmn:TimerEventDefinition")?C(t,e,n,o):ao(r,"bpmn:ConditionalEventDefinition")?A(t,e,n,o):ao(r,"bpmn:SignalEventDefinition")?$(t,e,n,o):ao(r,"bpmn:EscalationEventDefinition")?T(t,e,n,o):ao(r,"bpmn:LinkEventDefinition")?M(t,e,n,o):ao(r,"bpmn:ErrorEventDefinition")?D(t,e,n,o):ao(r,"bpmn:CancelEventDefinition")?R(t,e,n,o):ao(r,"bpmn:CompensateEventDefinition")?N(t,e,n,o):ao(r,"bpmn:TerminateEventDefinition")?L(t,e,n,o):null}var q={ParticipantMultiplicityMarker:function(e,t,n={}){var r=ho(t,n),o=fo(t,n);O("participant-multiplicity",e,i.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:r,containerHeight:o,position:{mx:(r/2-6)/r,my:(o-15)/o}}),{strokeWidth:2,fill:lo(t,a,n.fill),stroke:co(t,l,n.stroke)})},SubProcessMarker:function(e,t,n={}){ii(b(e,14,14,0,{strokeWidth:1,fill:lo(t,a,n.fill),stroke:co(t,l,n.stroke)}),t.width/2-7.5,t.height-20),O("sub-process",e,i.getScaledPath("MARKER_SUB_PROCESS",{xScaleFactor:1.5,yScaleFactor:1.5,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2-7.5)/t.width,my:(t.height-20)/t.height}}),{fill:lo(t,a,n.fill),stroke:co(t,l,n.stroke)})},ParallelMarker:function(e,t,n){var r=ho(t,n),o=fo(t,n);O("parallel",e,i.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:r,containerHeight:o,position:{mx:(r/2+n.parallel)/r,my:(o-20)/o}}),{fill:lo(t,a,n.fill),stroke:co(t,l,n.stroke)})},SequentialMarker:function(e,t,n){O("sequential",e,i.getScaledPath("MARKER_SEQUENTIAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2+n.seq)/t.width,my:(t.height-19)/t.height}}),{fill:lo(t,a,n.fill),stroke:co(t,l,n.stroke)})},CompensationMarker:function(e,t,n){O("compensation",e,i.getScaledPath("MARKER_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2+n.compensation)/t.width,my:(t.height-13)/t.height}}),{strokeWidth:1,fill:lo(t,a,n.fill),stroke:co(t,l,n.stroke)})},LoopMarker:function(e,t,n){var r=ho(t,n),o=fo(t,n);O("loop",e,i.getScaledPath("MARKER_LOOP",{xScaleFactor:1,yScaleFactor:1,containerWidth:r,containerHeight:o,position:{mx:(r/2+n.loop)/r,my:(o-7)/o}}),{strokeWidth:1.5,fill:"none",stroke:co(t,l,n.stroke),strokeMiterlimit:.5})},AdhocMarker:function(e,t,n){var r=ho(t,n),o=fo(t,n);O("adhoc",e,i.getScaledPath("MARKER_ADHOC",{xScaleFactor:1,yScaleFactor:1,containerWidth:r,containerHeight:o,position:{mx:(r/2+n.adhoc)/r,my:(o-15)/o}}),{strokeWidth:1,fill:co(t,l,n.stroke),stroke:co(t,l,n.stroke)})}};function F(e,t,n,i){q[e](t,n,i)}function V(e,t,n,i={}){i={fill:i.fill,stroke:i.stroke,width:ho(t,i),height:fo(t,i)};var r=Mr(t),o=n&&n.includes("SubProcessMarker");i=o?{...i,seq:-21,parallel:-22,compensation:-42,loop:-18,adhoc:10}:{...i,seq:-5,parallel:-6,compensation:-27,loop:0,adhoc:10},_(n,(function(n){F(n,e,t,i)})),r.get("isForCompensation")&&F("CompensationMarker",e,t,i),Tr(r,"bpmn:AdHocSubProcess")&&F("AdhocMarker",e,t,i);var s=r.get("loopCharacteristics"),a=s&&s.get("isSequential");s&&(void 0===a&&F("LoopMarker",e,t,i),!1===a&&F("ParallelMarker",e,t,i),!0===a&&F("SequentialMarker",e,t,i))}function H(e,t,n={}){n=z({size:{width:100}},n);var i=o.createText(t||"",n);return Me(i).add("djs-label"),ke(e,i),i}function U(e,t,n,i={}){var r=Mr(t),o=uo({x:t.x,y:t.y,width:t.width,height:t.height},i);return H(e,r.name,{align:n,box:o,padding:7,style:{fill:po(t,c,l,i.stroke)}})}function W(e,t,n,i={}){var r=Kr(n),o=H(e,t,{box:{height:30,width:r?fo(n,i):ho(n,i)},align:"center-middle",style:{fill:po(n,c,l,i.stroke)}});r&&ni(o,0,-(-1*fo(n,i)),270)}function G(e,t,n={}){var{width:i,height:r}=uo(t,n);return b(e,i,r,10,{...n,fill:lo(t,a,n.fill),fillOpacity:go,stroke:co(t,l,n.stroke)})}function Q(e,t,n={}){var i=Mr(t),r=lo(t,a,n.fill),o=co(t,l,n.stroke);return"One"!==i.get("associationDirection")&&"Both"!==i.get("associationDirection")||(n.markerEnd=y("association-end",r,o)),"Both"===i.get("associationDirection")&&(n.markerStart=y("association-start",r,o)),n=vo(n,["markerStart","markerEnd"]),w(e,t.waypoints,{...n,stroke:o,strokeDasharray:"0, 5"})}function X(e,t,n={}){var r=lo(t,a,n.fill),o=co(t,l,n.stroke),s=E(e,i.getScaledPath("DATA_OBJECT_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.474,my:.296}}),{fill:r,fillOpacity:go,stroke:o});(function(e){var t=e.dataObjectRef;return e.isCollection||t&&t.isCollection})(Mr(t))&&E(e,i.getScaledPath("DATA_OBJECT_COLLECTION_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.33,my:(t.height-18)/t.height}}),{strokeWidth:2,fill:r,stroke:o});return s}function K(e,t,n={}){return v(e,t.width,t.height,{fillOpacity:go,...n,fill:lo(t,a,n.fill),stroke:co(t,l,n.stroke)})}function Y(e,t,n={}){return function(e,t,n,i){var r=t/2,o=n/2,s=[{x:r,y:0},{x:t,y:o},{x:r,y:n},{x:0,y:o}].map((function(e){return e.x+","+e.y})).join(" ");i=d(i);var a=Le("polygon",{...i,points:s});return ke(e,a),a}(e,t.width,t.height,{fill:lo(t,a,n.fill),fillOpacity:go,stroke:co(t,l,n.stroke)})}function Z(e,t,n={}){var i=b(e,ho(t,n),fo(t,n),0,{fill:lo(t,a,n.fill),fillOpacity:n.fillOpacity||go,stroke:co(t,l,n.stroke),strokeWidth:1.5}),r=Mr(t);Tr(r,"bpmn:Lane")&&W(e,r.get("name"),t,n);return i}function J(e,t,n={}){var i=G(e,t,n);Yr(t)&&Te(i,{strokeDasharray:"0, 5.5",strokeWidth:2.5});var r=Xr(t);return U(e,t,r?"center-top":"center-middle",n),V(e,t,r?void 0:["SubProcessMarker"],n),i}function ee(e,t,n={}){var i=G(e,t,n);return U(e,t,"center-middle",n),V(e,t,void 0,n),i}var te=this.handlers={"bpmn:AdHocSubProcess":function(e,t,n={}){return J(e,t,n=Xr(t)?vo(n,["fill","stroke","width","height"]):vo(n,["fill","stroke"]))},"bpmn:Association":function(e,t,n={}){return Q(e,t,n=vo(n,["fill","stroke"]))},"bpmn:BoundaryEvent":function(e,t,n={}){var{renderIcon:i=!0}=n;n=vo(n,["fill","stroke"]);var r=Mr(t).get("cancelActivity");n={strokeWidth:1.5,fill:lo(t,a,n.fill),fillOpacity:1,stroke:co(t,l,n.stroke)},r||(n.strokeDasharray="6");var o=K(e,t,n);return v(e,t.width,t.height,3,{...n,fill:"none"}),i&&B(t,e,n),o},"bpmn:BusinessRuleTask":function(e,t,n={}){var r=ee(e,t,n=vo(n,["fill","stroke"]));return Te(E(e,i.getScaledPath("TASK_TYPE_BUSINESS_RULE_MAIN",{abspos:{x:8,y:8}})),{fill:lo(t,a,n.fill),stroke:co(t,l,n.stroke),strokeWidth:1}),Te(E(e,i.getScaledPath("TASK_TYPE_BUSINESS_RULE_HEADER",{abspos:{x:8,y:8}})),{fill:co(t,l,n.stroke),stroke:co(t,l,n.stroke),strokeWidth:1}),r},"bpmn:CallActivity":function(e,t,n={}){return n=vo(n,["fill","stroke"]),J(e,t,{strokeWidth:5,...n})},"bpmn:ComplexGateway":function(e,t,n={}){var r=Y(e,t,n=vo(n,["fill","stroke"]));return E(e,i.getScaledPath("GATEWAY_COMPLEX",{xScaleFactor:.5,yScaleFactor:.5,containerWidth:t.width,containerHeight:t.height,position:{mx:.46,my:.26}}),{fill:co(t,l,n.stroke),stroke:co(t,l,n.stroke),strokeWidth:1}),r},"bpmn:DataInput":function(e,t,n={}){n=vo(n,["fill","stroke"]);var r=i.getRawPath("DATA_ARROW"),o=X(e,t,n);return E(e,r,{fill:"none",stroke:co(t,l,n.stroke),strokeWidth:1}),o},"bpmn:DataInputAssociation":function(e,t,n={}){return n=vo(n,["fill","stroke"]),Q(e,t,{...n,markerEnd:y("association-end",lo(t,a,n.fill),co(t,l,n.stroke))})},"bpmn:DataObject":function(e,t,n={}){return X(e,t,n=vo(n,["fill","stroke"]))},"bpmn:DataObjectReference":k("bpmn:DataObject"),"bpmn:DataOutput":function(e,t,n={}){n=vo(n,["fill","stroke"]);var r=i.getRawPath("DATA_ARROW"),o=X(e,t,n);return E(e,r,{strokeWidth:1,fill:lo(t,a,n.fill),stroke:co(t,l,n.stroke)}),o},"bpmn:DataOutputAssociation":function(e,t,n={}){return n=vo(n,["fill","stroke"]),Q(e,t,{...n,markerEnd:y("association-end",lo(t,a,n.fill),co(t,l,n.stroke))})},"bpmn:DataStoreReference":function(e,t,n={}){return n=vo(n,["fill","stroke"]),E(e,i.getScaledPath("DATA_STORE",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:0,my:.133}}),{fill:lo(t,a,n.fill),fillOpacity:go,stroke:co(t,l,n.stroke),strokeWidth:2})},"bpmn:EndEvent":function(e,t,n={}){var{renderIcon:i=!0}=n;n=vo(n,["fill","stroke"]);var r=K(e,t,{...n,strokeWidth:4});return i&&B(t,e,n),r},"bpmn:EventBasedGateway":function(e,t,n={}){n=vo(n,["fill","stroke"]);var r=Mr(t),o=Y(e,t,n);v(e,t.width,t.height,.2*t.height,{fill:lo(t,"none",n.fill),stroke:co(t,l,n.stroke),strokeWidth:1});var s=r.get("eventGatewayType"),a=!!r.get("instantiate");if("Parallel"===s){var c=i.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:t.width,containerHeight:t.height,position:{mx:.474,my:.296}});E(e,c,{fill:"none",stroke:co(t,l,n.stroke),strokeWidth:1})}else"Exclusive"===s&&(a||v(e,t.width,t.height,.26*t.height,{fill:"none",stroke:co(t,l,n.stroke),strokeWidth:1}),function(){var r=i.getScaledPath("GATEWAY_EVENT_BASED",{xScaleFactor:.18,yScaleFactor:.18,containerWidth:t.width,containerHeight:t.height,position:{mx:.36,my:.44}});E(e,r,{fill:"none",stroke:co(t,l,n.stroke),strokeWidth:2})}());return o},"bpmn:ExclusiveGateway":function(e,t,n={}){var r=Y(e,t,n=vo(n,["fill","stroke"])),o=i.getScaledPath("GATEWAY_EXCLUSIVE",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:t.width,containerHeight:t.height,position:{mx:.32,my:.3}});return Dr(t).get("isMarkerVisible")&&E(e,o,{fill:co(t,l,n.stroke),stroke:co(t,l,n.stroke),strokeWidth:1}),r},"bpmn:Gateway":function(e,t,n={}){return Y(e,t,n=vo(n,["fill","stroke"]))},"bpmn:Group":function(e,t,n={}){return n=vo(n,["fill","stroke","width","height"]),b(e,t.width,t.height,10,{stroke:co(t,l,n.stroke),strokeWidth:1.5,strokeDasharray:"10, 6, 0, 6",fill:"none",pointerEvents:"none",width:ho(t,n),height:fo(t,n)})},"bpmn:InclusiveGateway":function(e,t,n={}){var i=Y(e,t,n=vo(n,["fill","stroke"]));return v(e,t.width,t.height,.24*t.height,{fill:lo(t,a,n.fill),stroke:co(t,l,n.stroke),strokeWidth:2.5}),i},"bpmn:IntermediateEvent":function(e,t,n={}){var{renderIcon:i=!0}=n;n=vo(n,["fill","stroke"]);var r=K(e,t,{...n,strokeWidth:1.5});return v(e,t.width,t.height,3,{fill:"none",stroke:co(t,l,n.stroke),strokeWidth:1.5}),i&&B(t,e,n),r},"bpmn:IntermediateCatchEvent":k("bpmn:IntermediateEvent"),"bpmn:IntermediateThrowEvent":k("bpmn:IntermediateEvent"),"bpmn:Lane":function(e,t,n={}){return n=vo(n,["fill","stroke","width","height"]),Z(e,t,{...n,fillOpacity:.25})},"bpmn:ManualTask":function(e,t,n={}){var r=ee(e,t,n=vo(n,["fill","stroke"]));return E(e,i.getScaledPath("TASK_TYPE_MANUAL",{abspos:{x:17,y:15}}),{fill:lo(t,a,n.fill),stroke:co(t,l,n.stroke),strokeWidth:.5}),r},"bpmn:MessageFlow":function(e,t,n={}){n=vo(n,["fill","stroke"]);var r=Mr(t),o=Dr(t),s=lo(t,a,n.fill),c=co(t,l,n.stroke),p=w(e,t.waypoints,{markerEnd:y("messageflow-end",s,c),markerStart:y("messageflow-start",s,c),stroke:c,strokeDasharray:"10, 11",strokeWidth:1.5});if(r.get("messageRef")){var u=p.getPointAtLength(p.getTotalLength()/2),d=i.getScaledPath("MESSAGE_FLOW_MARKER",{abspos:{x:u.x,y:u.y}}),h={strokeWidth:1};"initiating"===o.get("messageVisibleKind")?(h.fill=s,h.stroke=c):(h.fill=c,h.stroke=s);var f=E(e,d,h),m=H(e,r.get("messageRef").get("name"),{align:"center-top",fitBox:!0,style:{fill:c}}),g=f.getBBox(),v=m.getBBox();ni(m,u.x-v.width/2,u.y+g.height/2+10,0)}return p},"bpmn:ParallelGateway":function(e,t,n={}){var r=Y(e,t,n=vo(n,["fill","stroke"]));return E(e,i.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.6,yScaleFactor:.6,containerWidth:t.width,containerHeight:t.height,position:{mx:.46,my:.2}}),{fill:co(t,l,n.stroke),stroke:co(t,l,n.stroke),strokeWidth:1}),r},"bpmn:Participant":function(e,t,n={}){var i=Z(e,t,n=vo(n,["fill","stroke","width","height"])),r=Xr(t),o=Kr(t),s=Mr(t),a=s.get("name");if(r){x(e,o?[{x:30,y:0},{x:30,y:fo(t,n)}]:[{x:0,y:30},{x:ho(t,n),y:30}],{stroke:co(t,l,n.stroke),strokeWidth:1.5}),W(e,a,t,n)}else{var p=uo(t,n);o||(p.height=ho(t,n),p.width=fo(t,n));var u=H(e,a,{box:p,align:"center-middle",style:{fill:po(t,c,l,n.stroke)}});if(!o)ni(u,0,-(-1*fo(t,n)),270)}return s.get("participantMultiplicity")&&F("ParticipantMultiplicityMarker",e,t,n),i},"bpmn:ReceiveTask":function(e,t,n={}){n=vo(n,["fill","stroke"]);var r,o=Mr(t),s=ee(e,t,n);return o.get("instantiate")?(v(e,28,28,4.4,{fill:lo(t,a,n.fill),stroke:co(t,l,n.stroke),strokeWidth:1}),r=i.getScaledPath("TASK_TYPE_INSTANTIATING_SEND",{abspos:{x:7.77,y:9.52}})):r=i.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:21,containerHeight:14,position:{mx:.3,my:.4}}),E(e,r,{fill:lo(t,a,n.fill),stroke:co(t,l,n.stroke),strokeWidth:1}),s},"bpmn:ScriptTask":function(e,t,n={}){var r=ee(e,t,n=vo(n,["fill","stroke"]));return E(e,i.getScaledPath("TASK_TYPE_SCRIPT",{abspos:{x:15,y:20}}),{fill:lo(t,a,n.fill),stroke:co(t,l,n.stroke),strokeWidth:1}),r},"bpmn:SendTask":function(e,t,n={}){var r=ee(e,t,n=vo(n,["fill","stroke"]));return E(e,i.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:1,yScaleFactor:1,containerWidth:21,containerHeight:14,position:{mx:.285,my:.357}}),{fill:co(t,l,n.stroke),stroke:lo(t,a,n.fill),strokeWidth:1}),r},"bpmn:SequenceFlow":function(e,t,n={}){n=vo(n,["fill","stroke"]);var i=lo(t,a,n.fill),r=co(t,l,n.stroke),o=w(e,t.waypoints,{markerEnd:y("sequenceflow-end",i,r),stroke:r}),s=Mr(t),{source:c}=t;if(c){var p=Mr(c);s.get("conditionExpression")&&Tr(p,"bpmn:Activity")&&Te(o,{markerStart:y("conditional-flow-marker",i,r)}),p.get("default")&&(Tr(p,"bpmn:Gateway")||Tr(p,"bpmn:Activity"))&&p.get("default")===s&&Te(o,{markerStart:y("conditional-default-flow-marker",i,r)})}return o},"bpmn:ServiceTask":function(e,t,n={}){var r=ee(e,t,n=vo(n,["fill","stroke"]));return v(e,10,10,{fill:lo(t,a,n.fill),stroke:"none",transform:"translate(6, 6)"}),E(e,i.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:12,y:18}}),{fill:lo(t,a,n.fill),stroke:co(t,l,n.stroke),strokeWidth:1}),v(e,10,10,{fill:lo(t,a,n.fill),stroke:"none",transform:"translate(11, 10)"}),E(e,i.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:17,y:22}}),{fill:lo(t,a,n.fill),stroke:co(t,l,n.stroke),strokeWidth:1}),r},"bpmn:StartEvent":function(e,t,n={}){var{renderIcon:i=!0}=n;n=vo(n,["fill","stroke"]),Mr(t).get("isInterrupting")||(n={...n,strokeDasharray:"6"});var r=K(e,t,n);return i&&B(t,e,n),r},"bpmn:SubProcess":function(e,t,n={}){return J(e,t,n=Xr(t)?vo(n,["fill","stroke","width","height"]):vo(n,["fill","stroke"]))},"bpmn:Task":function(e,t,n={}){return ee(e,t,n=vo(n,["fill","stroke"]))},"bpmn:TextAnnotation":function(e,t,n={}){n=vo(n,["fill","stroke","width","height"]);var{width:r,height:o}=uo(t,n),s=b(e,r,o,0,0,{fill:"none",stroke:"none"});return E(e,i.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:r,containerHeight:o,position:{mx:0,my:0}}),{stroke:co(t,l,n.stroke)}),H(e,Mr(t).get("text")||"",{align:"left-top",box:uo(t,n),padding:7,style:{fill:po(t,c,l,n.stroke)}}),s},"bpmn:Transaction":function(e,t,i={}){i=Xr(t)?vo(i,["fill","stroke","width","height"]):vo(i,["fill","stroke"]);var r=J(e,t,{strokeWidth:1.5,...i}),o=n.style(["no-fill","no-events"],{stroke:co(t,l,i.stroke),strokeWidth:1.5});return Xr(t)||(i={}),b(e,ho(t,i),fo(t,i),7,3,o),r},"bpmn:UserTask":function(e,t,n={}){var r=ee(e,t,n=vo(n,["fill","stroke"]));return E(e,i.getScaledPath("TASK_TYPE_USER_1",{abspos:{x:15,y:12}}),{fill:lo(t,a,n.fill),stroke:co(t,l,n.stroke),strokeWidth:.5}),E(e,i.getScaledPath("TASK_TYPE_USER_2",{abspos:{x:15,y:12}}),{fill:lo(t,a,n.fill),stroke:co(t,l,n.stroke),strokeWidth:.5}),E(e,i.getScaledPath("TASK_TYPE_USER_3",{abspos:{x:15,y:12}}),{fill:co(t,l,n.stroke),stroke:co(t,l,n.stroke),strokeWidth:.5}),r},label:function(e,t,n={}){return function(e,t,n={}){var i={width:90,height:30,x:t.width/2+t.x,y:t.height/2+t.y};return H(e,oo(t),{box:i,fitBox:!0,style:z({},o.getExternalStyle(),{fill:po(t,c,l,n.stroke)})})}(e,t,n)}};this._drawPath=E,this._renderer=P}function vo(e,t=[]){return t.reduce(((t,n)=>(e[n]&&(t[n]=e[n]),t)),{})}i(yo,ct),yo.$inject=["config.bpmnRenderer","eventBus","styles","pathMap","canvas","textRenderer"],yo.prototype.canRender=function(e){return Tr(e,"bpmn:BaseElement")},yo.prototype.drawShape=function(e,t,n={}){var{type:i}=t;return this._renderer(i)(e,t,n)},yo.prototype.drawConnection=function(e,t,n={}){var{type:i}=t;return this._renderer(i)(e,t,n)},yo.prototype.getShapePath=function(e){return Tr(e,"bpmn:Event")?(n=(t=e).x+t.width/2,i=t.y+t.height/2,r=t.width/2,pt([["M",n,i],["m",0,-r],["a",r,r,0,1,1,0,2*r],["a",r,r,0,1,1,0,-2*r],["z"]])):Tr(e,"bpmn:Activity")?function(e,t){var n=e.x,i=e.y,r=e.width,o=e.height;return pt([["M",n+t,i],["l",r-2*t,0],["a",t,t,0,0,1,t,t],["l",0,o-2*t],["a",t,t,0,0,1,-t,t],["l",2*t-r,0],["a",t,t,0,0,1,-t,-t],["l",0,2*t-o],["a",t,t,0,0,1,t,-t],["z"]])}(e,10):Tr(e,"bpmn:Gateway")?function(e){var t=e.width/2,n=e.height/2;return pt([["M",e.x+t,e.y],["l",t,n],["l",-t,n],["l",-t,-n],["z"]])}(e):function(e){var t=e.x,n=e.y,i=e.width;return pt([["M",t,n],["l",i,0],["l",0,e.height],["l",-i,0],["z"]])}(e);var t,n,i,r};var bo={width:150,height:50};function xo(e,t){var n;t.textContent=e;try{var i,r=""===e;return t.textContent=r?"dummy":e,i={width:(n=t.getBBox()).width+2*n.x,height:n.height},r&&(i.width=0),i}catch(e){return{width:0,height:0}}}function wo(e,t,n){for(var i,r=e.shift(),o=r;;){if((i=xo(o,n)).width=o?i.width:0," "===o||""===o||i.width1)for(;n=i.shift();){if(!(n.length+oe?t.width:e}),0),m=o.top;"middle"===r.vertical&&(m+=(n.height-d)/2),m-=(a||c[0].height)/4;var g=Le("text");return Te(g,i),_(c,(function(e){var t;switch(m+=a||e.height,r.horizontal){case"left":t=o.left;break;case"right":t=(s?h:p)-o.right-e.width;break;default:t=Math.max(((s?h:p)-e.width)/2+o.left,0)}var n=Le("tspan");Te(n,{x:t,y:m}),n.textContent=e.text,ke(g,n)})),Ke(u),{dimensions:{width:h,height:d},element:g}};function ko(e){var t=z({fontFamily:"Arial, sans-serif",fontSize:12,fontWeight:"normal",lineHeight:1.2},e&&e.defaultStyle||{}),n=parseInt(t.fontSize,10)-1,i=z({},t,{fontSize:n},e&&e.externalStyle||{}),r=new Po({style:t});this.getExternalLabelBounds=function(e,t){var n=r.getDimensions(t,{box:{width:90,height:30},style:i});return{x:Math.round(e.x+e.width/2-n.width/2),y:Math.round(e.y),width:Math.ceil(n.width),height:Math.ceil(n.height)}},this.getTextAnnotationBounds=function(e,n){var i=r.getDimensions(n,{box:e,style:t,align:"left-top",padding:5});return{x:e.x,y:e.y,width:e.width,height:Math.max(30,Math.round(i.height))}},this.createText=function(e,t){return r.createText(e,t||{})},this.getDefaultStyle=function(){return t},this.getExternalStyle=function(){return i}}ko.$inject=["config.textRenderer"];var So=/\{([^{}]+)\}/g,Co=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g;const To={__init__:["bpmnRenderer"],bpmnRenderer:["type",yo],textRenderer:["type",ko],pathMap:["type",function(){this.pathMap={EVENT_MESSAGE:{d:"m {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}",height:36,width:36,heightElements:[6,14],widthElements:[10.5,21]},EVENT_SIGNAL:{d:"M {mx},{my} l {e.x0},{e.y0} l -{e.x1},0 Z",height:36,width:36,heightElements:[18],widthElements:[10,20]},EVENT_ESCALATION:{d:"M {mx},{my} l {e.x0},{e.y0} l -{e.x0},-{e.y1} l -{e.x0},{e.y1} Z",height:36,width:36,heightElements:[20,7],widthElements:[8]},EVENT_CONDITIONAL:{d:"M {e.x0},{e.y0} l {e.x1},0 l 0,{e.y2} l -{e.x1},0 Z M {e.x2},{e.y3} l {e.x0},0 M {e.x2},{e.y4} l {e.x0},0 M {e.x2},{e.y5} l {e.x0},0 M {e.x2},{e.y6} l {e.x0},0 M {e.x2},{e.y7} l {e.x0},0 M {e.x2},{e.y8} l {e.x0},0 ",height:36,width:36,heightElements:[8.5,14.5,18,11.5,14.5,17.5,20.5,23.5,26.5],widthElements:[10.5,14.5,12.5]},EVENT_LINK:{d:"m {mx},{my} 0,{e.y0} -{e.x1},0 0,{e.y1} {e.x1},0 0,{e.y0} {e.x0},-{e.y2} -{e.x0},-{e.y2} z",height:36,width:36,heightElements:[4.4375,6.75,7.8125],widthElements:[9.84375,13.5]},EVENT_ERROR:{d:"m {mx},{my} {e.x0},-{e.y0} {e.x1},-{e.y1} {e.x2},{e.y2} {e.x3},-{e.y3} -{e.x4},{e.y4} -{e.x5},-{e.y5} z",height:36,width:36,heightElements:[.023,8.737,8.151,16.564,10.591,8.714],widthElements:[.085,6.672,6.97,4.273,5.337,6.636]},EVENT_CANCEL_45:{d:"m {mx},{my} -{e.x1},0 0,{e.x0} {e.x1},0 0,{e.y1} {e.x0},0 0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z",height:36,width:36,heightElements:[4.75,8.5],widthElements:[4.75,8.5]},EVENT_COMPENSATION:{d:"m {mx},{my} {e.x0},-{e.y0} 0,{e.y1} z m {e.x1},-{e.y2} {e.x2},-{e.y3} 0,{e.y1} -{e.x2},-{e.y3} z",height:36,width:36,heightElements:[6.5,13,.4,6.1],widthElements:[9,9.3,8.7]},EVENT_TIMER_WH:{d:"M {mx},{my} l {e.x0},-{e.y0} m -{e.x0},{e.y0} l {e.x1},{e.y1} ",height:36,width:36,heightElements:[10,2],widthElements:[3,7]},EVENT_TIMER_LINE:{d:"M {mx},{my} m {e.x0},{e.y0} l -{e.x1},{e.y1} ",height:36,width:36,heightElements:[10,3],widthElements:[0,0]},EVENT_MULTIPLE:{d:"m {mx},{my} {e.x1},-{e.y0} {e.x1},{e.y0} -{e.x0},{e.y1} -{e.x2},0 z",height:36,width:36,heightElements:[6.28099,12.56199],widthElements:[3.1405,9.42149,12.56198]},EVENT_PARALLEL_MULTIPLE:{d:"m {mx},{my} {e.x0},0 0,{e.y1} {e.x1},0 0,{e.y0} -{e.x1},0 0,{e.y1} -{e.x0},0 0,-{e.y1} -{e.x1},0 0,-{e.y0} {e.x1},0 z",height:36,width:36,heightElements:[2.56228,7.68683],widthElements:[2.56228,7.68683]},GATEWAY_EXCLUSIVE:{d:"m {mx},{my} {e.x0},{e.y0} {e.x1},{e.y0} {e.x2},0 {e.x4},{e.y2} {e.x4},{e.y1} {e.x2},0 {e.x1},{e.y3} {e.x0},{e.y3} {e.x3},0 {e.x5},{e.y1} {e.x5},{e.y2} {e.x3},0 z",height:17.5,width:17.5,heightElements:[8.5,6.5312,-6.5312,-8.5],widthElements:[6.5,-6.5,3,-3,5,-5]},GATEWAY_PARALLEL:{d:"m {mx},{my} 0,{e.y1} -{e.x1},0 0,{e.y0} {e.x1},0 0,{e.y1} {e.x0},0 0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z",height:30,width:30,heightElements:[5,12.5],widthElements:[5,12.5]},GATEWAY_EVENT_BASED:{d:"m {mx},{my} {e.x0},{e.y0} {e.x0},{e.y1} {e.x1},{e.y2} {e.x2},0 z",height:11,width:11,heightElements:[-6,6,12,-12],widthElements:[9,-3,-12]},GATEWAY_COMPLEX:{d:"m {mx},{my} 0,{e.y0} -{e.x0},-{e.y1} -{e.x1},{e.y2} {e.x0},{e.y1} -{e.x2},0 0,{e.y3} {e.x2},0 -{e.x0},{e.y1} l {e.x1},{e.y2} {e.x0},-{e.y1} 0,{e.y0} {e.x3},0 0,-{e.y0} {e.x0},{e.y1} {e.x1},-{e.y2} -{e.x0},-{e.y1} {e.x2},0 0,-{e.y3} -{e.x2},0 {e.x0},-{e.y1} -{e.x1},-{e.y2} -{e.x0},{e.y1} 0,-{e.y0} -{e.x3},0 z",height:17.125,width:17.125,heightElements:[4.875,3.4375,2.125,3],widthElements:[3.4375,2.125,4.875,3]},DATA_OBJECT_PATH:{d:"m 0,0 {e.x1},0 {e.x0},{e.y0} 0,{e.y1} -{e.x2},0 0,-{e.y2} {e.x1},0 0,{e.y0} {e.x0},0",height:61,width:51,heightElements:[10,50,60],widthElements:[10,40,50,60]},DATA_OBJECT_COLLECTION_PATH:{d:"m{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10",height:10,width:10,heightElements:[],widthElements:[]},DATA_ARROW:{d:"m 5,9 9,0 0,-3 5,5 -5,5 0,-3 -9,0 z",height:61,width:51,heightElements:[],widthElements:[]},DATA_STORE:{d:"m {mx},{my} l 0,{e.y2} c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 l 0,-{e.y2} c -{e.x0},-{e.y1} -{e.x1},-{e.y1} -{e.x2},0c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 m -{e.x2},{e.y0}c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0m -{e.x2},{e.y0}c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0",height:61,width:61,heightElements:[7,10,45],widthElements:[2,58,60]},TEXT_ANNOTATION:{d:"m {mx}, {my} m 10,0 l -10,0 l 0,{e.y0} l 10,0",height:30,width:10,heightElements:[30],widthElements:[10]},MARKER_SUB_PROCESS:{d:"m{mx},{my} m 7,2 l 0,10 m -5,-5 l 10,0",height:10,width:10,heightElements:[],widthElements:[]},MARKER_PARALLEL:{d:"m{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10",height:10,width:10,heightElements:[],widthElements:[]},MARKER_SEQUENTIAL:{d:"m{mx},{my} m 0,3 l 10,0 m -10,3 l 10,0 m -10,3 l 10,0",height:10,width:10,heightElements:[],widthElements:[]},MARKER_COMPENSATION:{d:"m {mx},{my} 7,-5 0,10 z m 7.1,-0.3 6.9,-4.7 0,10 -6.9,-4.7 z",height:10,width:21,heightElements:[],widthElements:[]},MARKER_LOOP:{d:"m {mx},{my} c 3.526979,0 6.386161,-2.829858 6.386161,-6.320661 0,-3.490806 -2.859182,-6.320661 -6.386161,-6.320661 -3.526978,0 -6.38616,2.829855 -6.38616,6.320661 0,1.745402 0.714797,3.325567 1.870463,4.469381 0.577834,0.571908 1.265885,1.034728 2.029916,1.35457 l -0.718163,-3.909793 m 0.718163,3.909793 -3.885211,0.802902",height:13.9,width:13.7,heightElements:[],widthElements:[]},MARKER_ADHOC:{d:"m {mx},{my} m 0.84461,2.64411 c 1.05533,-1.23780996 2.64337,-2.07882 4.29653,-1.97997996 2.05163,0.0805 3.85579,1.15803 5.76082,1.79107 1.06385,0.34139996 2.24454,0.1438 3.18759,-0.43767 0.61743,-0.33642 1.2775,-0.64078 1.7542,-1.17511 0,0.56023 0,1.12046 0,1.6807 -0.98706,0.96237996 -2.29792,1.62393996 -3.6918,1.66181996 -1.24459,0.0927 -2.46671,-0.2491 -3.59505,-0.74812 -1.35789,-0.55965 -2.75133,-1.33436996 -4.27027,-1.18121996 -1.37741,0.14601 -2.41842,1.13685996 -3.44288,1.96782996 z",height:4,width:15,heightElements:[],widthElements:[]},TASK_TYPE_SEND:{d:"m {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}",height:14,width:21,heightElements:[6,14],widthElements:[10.5,21]},TASK_TYPE_SCRIPT:{d:"m {mx},{my} c 9.966553,-6.27276 -8.000926,-7.91932 2.968968,-14.938 l -8.802728,0 c -10.969894,7.01868 6.997585,8.66524 -2.968967,14.938 z m -7,-12 l 5,0 m -4.5,3 l 4.5,0 m -3,3 l 5,0m -4,3 l 5,0",height:15,width:12.6,heightElements:[6,14],widthElements:[10.5,21]},TASK_TYPE_USER_1:{d:"m {mx},{my} c 0.909,-0.845 1.594,-2.049 1.594,-3.385 0,-2.554 -1.805,-4.62199999 -4.357,-4.62199999 -2.55199998,0 -4.28799998,2.06799999 -4.28799998,4.62199999 0,1.348 0.974,2.562 1.89599998,3.405 -0.52899998,0.187 -5.669,2.097 -5.794,4.7560005 v 6.718 h 17 v -6.718 c 0,-2.2980005 -5.5279996,-4.5950005 -6.0509996,-4.7760005 zm -8,6 l 0,5.5 m 11,0 l 0,-5"},TASK_TYPE_USER_2:{d:"m {mx},{my} m 2.162,1.009 c 0,2.4470005 -2.158,4.4310005 -4.821,4.4310005 -2.66499998,0 -4.822,-1.981 -4.822,-4.4310005 "},TASK_TYPE_USER_3:{d:"m {mx},{my} m -6.9,-3.80 c 0,0 2.25099998,-2.358 4.27399998,-1.177 2.024,1.181 4.221,1.537 4.124,0.965 -0.098,-0.57 -0.117,-3.79099999 -4.191,-4.13599999 -3.57499998,0.001 -4.20799998,3.36699999 -4.20699998,4.34799999 z"},TASK_TYPE_MANUAL:{d:"m {mx},{my} c 0.234,-0.01 5.604,0.008 8.029,0.004 0.808,0 1.271,-0.172 1.417,-0.752 0.227,-0.898 -0.334,-1.314 -1.338,-1.316 -2.467,-0.01 -7.886,-0.004 -8.108,-0.004 -0.014,-0.079 0.016,-0.533 0,-0.61 0.195,-0.042 8.507,0.006 9.616,0.002 0.877,-0.007 1.35,-0.438 1.353,-1.208 0.003,-0.768 -0.479,-1.09 -1.35,-1.091 -2.968,-0.002 -9.619,-0.013 -9.619,-0.013 v -0.591 c 0,0 5.052,-0.016 7.225,-0.016 0.888,-0.002 1.354,-0.416 1.351,-1.193 -0.006,-0.761 -0.492,-1.196 -1.361,-1.196 -3.473,-0.005 -10.86,-0.003 -11.0829995,-0.003 -0.022,-0.047 -0.045,-0.094 -0.069,-0.139 0.3939995,-0.319 2.0409995,-1.626 2.4149995,-2.017 0.469,-0.4870005 0.519,-1.1650005 0.162,-1.6040005 -0.414,-0.511 -0.973,-0.5 -1.48,-0.236 -1.4609995,0.764 -6.5999995,3.6430005 -7.7329995,4.2710005 -0.9,0.499 -1.516,1.253 -1.882,2.19 -0.37000002,0.95 -0.17,2.01 -0.166,2.979 0.004,0.718 -0.27300002,1.345 -0.055,2.063 0.629,2.087 2.425,3.312 4.859,3.318 4.6179995,0.014 9.2379995,-0.139 13.8569995,-0.158 0.755,-0.004 1.171,-0.301 1.182,-1.033 0.012,-0.754 -0.423,-0.969 -1.183,-0.973 -1.778,-0.01 -5.824,-0.004 -6.04,-0.004 10e-4,-0.084 0.003,-0.586 10e-4,-0.67 z"},TASK_TYPE_INSTANTIATING_SEND:{d:"m {mx},{my} l 0,8.4 l 12.6,0 l 0,-8.4 z l 6.3,3.6 l 6.3,-3.6"},TASK_TYPE_SERVICE:{d:"m {mx},{my} v -1.71335 c 0.352326,-0.0705 0.703932,-0.17838 1.047628,-0.32133 0.344416,-0.14465 0.665822,-0.32133 0.966377,-0.52145 l 1.19431,1.18005 1.567487,-1.57688 -1.195028,-1.18014 c 0.403376,-0.61394 0.683079,-1.29908 0.825447,-2.01824 l 1.622133,-0.01 v -2.2196 l -1.636514,0.01 c -0.07333,-0.35153 -0.178319,-0.70024 -0.323564,-1.04372 -0.145244,-0.34406 -0.321407,-0.6644 -0.522735,-0.96217 l 1.131035,-1.13631 -1.583305,-1.56293 -1.129598,1.13589 c -0.614052,-0.40108 -1.302883,-0.68093 -2.022633,-0.82247 l 0.0093,-1.61852 h -2.241173 l 0.0042,1.63124 c -0.353763,0.0736 -0.705369,0.17977 -1.049785,0.32371 -0.344415,0.14437 -0.665102,0.32092 -0.9635006,0.52046 l -1.1698628,-1.15823 -1.5667691,1.5792 1.1684265,1.15669 c -0.4026573,0.61283 -0.68308,1.29797 -0.8247287,2.01713 l -1.6588041,0.003 v 2.22174 l 1.6724648,-0.006 c 0.073327,0.35077 0.1797598,0.70243 0.3242851,1.04472 0.1452428,0.34448 0.3214064,0.6644 0.5227339,0.96066 l -1.1993431,1.19723 1.5840256,1.56011 1.1964668,-1.19348 c 0.6140517,0.40346 1.3028827,0.68232 2.0233517,0.82331 l 7.19e-4,1.69892 h 2.226848 z m 0.221462,-3.9957 c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z"},TASK_TYPE_SERVICE_FILL:{d:"m {mx},{my} c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z"},TASK_TYPE_BUSINESS_RULE_HEADER:{d:"m {mx},{my} 0,4 20,0 0,-4 z"},TASK_TYPE_BUSINESS_RULE_MAIN:{d:"m {mx},{my} 0,12 20,0 0,-12 zm 0,8 l 20,0 m -13,-4 l 0,8"},MESSAGE_FLOW_MARKER:{d:"m {mx},{my} m -10.5 ,-7 l 0,14 l 21,0 l 0,-14 z l 10.5,6 l 10.5,-6"}},this.getRawPath=function(e){return this.pathMap[e].d},this.getScaledPath=function(e,t){var n,i,r=this.pathMap[e];t.abspos?(n=t.abspos.x,i=t.abspos.y):(n=t.containerWidth*t.position.mx,i=t.containerHeight*t.position.my);var o,s,a={};if(t.position){for(var l=t.containerHeight/r.height*t.yScaleFactor,c=t.containerWidth/r.width*t.xScaleFactor,p=0;p=e.x&&n<=e.x+e.width&&i>=e.y&&i<=e.y+e.height}(n,On(p))||(n=this._canvas.findRoot(n))),this._canvas.addShape(i,n,o)}else{if(!Tr(t,"bpmndi:BPMNEdge"))throw new Error(s("unknown di {di} for element {semantic}",{di:Pr(t),semantic:Pr(e)}));var u=this._getSource(e),d=this._getTarget(e);r=n&&(n.hidden||n.collapsed),i=this._elementFactory.createConnection(Mo(e,t,{hidden:r,source:u,target:d,waypoints:Do(t,u,d)})),Tr(e,"bpmn:DataAssociation")&&(n=this._canvas.findRoot(n)),this._canvas.addConnection(i,n,o)}return eo(e)&&oo(i)&&this.addLabel(e,t,i),this._eventBus.fire("bpmnElement.added",{element:i}),i},No.prototype._attachBoundary=function(e,t){var n=this._translate,i=e.attachedToRef;if(!i)throw new Error(n("missing {semantic}#attachedToRef",{semantic:Pr(e)}));var r=this._elementRegistry.get(i.id),o=r&&r.attachers;if(!r)throw Ro(n,e,i,"attachedToRef");t.host=r,o||(r.attachers=o=[]),-1===o.indexOf(t)&&o.push(t)},No.prototype.addLabel=function(e,t,n){var i,r,o;return i=function(e,t){var n,i,r,o=e.label;return o&&o.bounds?(r=o.bounds,i={width:Math.max(Jr.width,r.width),height:r.height},n={x:r.x+r.width/2,y:r.y+r.height/2}):(n=io(t),i=Jr),z({x:n.x-i.width/2,y:n.y-i.height/2},i)}(t,n),(r=oo(n))&&(i=this._textRenderer.getExternalLabelBounds(i,r)),o=this._elementFactory.createLabel(Mo(e,t,{id:e.id+"_label",labelTarget:n,type:"label",hidden:n.hidden||!oo(n),x:Math.round(i.x),y:Math.round(i.y),width:Math.round(i.width),height:Math.round(i.height)})),this._canvas.addShape(o,n.parent)},No.prototype._getConnectedElement=function(e,t){var n,i,r=e.$type,o=this._translate;if(i=e[t+"Ref"],"source"===t&&"bpmn:DataInputAssociation"===r&&(i=i&&i[0]),("source"===t&&"bpmn:DataOutputAssociation"===r||"target"===t&&"bpmn:DataInputAssociation"===r)&&(i=e.$parent),n=i&&this._getElement(i))return n;throw i?Ro(o,e,i,t+"Ref"):new Error(o("{semantic}#{side} Ref not specified",{semantic:Pr(e),side:t}))},No.prototype._getSource=function(e){return this._getConnectedElement(e,"source")},No.prototype._getTarget=function(e){return this._getConnectedElement(e,"target")},No.prototype._getElement=function(e){return this._elementRegistry.get(e.id)};const $o={__depends__:[To,{__depends__:[Ao],bpmnImporter:["type",No]}]};function jo(e){e&&"function"==typeof e.stopPropagation&&e.stopPropagation()}function Io(e){return e.originalEvent||e.srcEvent}function Lo(e){jo(e),jo(Io(e))}function Bo(e){return e.pointers&&e.pointers.length&&(e=e.pointers[0]),e.touches&&e.touches.length&&(e=e.touches[0]),e?{x:e.clientX,y:e.clientY}:null}function qo(){return/mac/i.test(navigator.platform)}function zo(e,t){return(Io(e)||e).button===t}function Fo(e){return zo(e,0)}function Vo(e){var t=Io(e)||e;return!!Fo(e)&&(qo()?t.metaKey:t.ctrlKey)}function Ho(e){var t=Io(e)||e;return Fo(e)&&t.shiftKey}function Uo(e){return!0}function Wo(e){return Fo(e)||function(e){return zo(e,1)}(e)}function Go(e,t,n){var i=this;function r(n,i,r){var o,s;(function(e,t){var n=l[e]||Fo;return!n(t)})(n,i)||(r?s=t.getGraphics(r):(o=i.delegateTarget||i.target)&&(s=o,r=t.get(s)),s&&r&&!1===e.fire(n,{element:r,gfx:s,originalEvent:i})&&(i.stopPropagation(),i.preventDefault()))}var o={};function s(e){return o[e]}var a={click:"element.click",contextmenu:"element.contextmenu",dblclick:"element.dblclick",mousedown:"element.mousedown",mousemove:"element.mousemove",mouseover:"element.hover",mouseout:"element.out",mouseup:"element.mouseup"},l={"element.contextmenu":Uo,"element.mousedown":Wo,"element.mouseup":Wo,"element.click":Wo,"element.dblclick":Wo};function c(e,t,n,i){var s=o[n]=function(e){r(n,e)};i&&(l[n]=i),s.$delegate=me.bind(e,"svg, .djs-element",t,s)}function p(e,t,n){var i=s(n);i&&me.unbind(e,t,i.$delegate)}e.on("canvas.destroy",(function(e){!function(e){_(a,(function(t,n){p(e,n,t)}))}(e.svg)})),e.on("canvas.init",(function(e){!function(e){_(a,(function(t,n){c(e,n,t)}))}(e.svg)})),e.on(["shape.added","connection.added"],(function(t){var n=t.element,i=t.gfx;e.fire("interactionEvents.createHit",{element:n,gfx:i})})),e.on(["shape.changed","connection.changed"],500,(function(t){var n=t.element,i=t.gfx;e.fire("interactionEvents.updateHit",{element:n,gfx:i})})),e.on("interactionEvents.createHit",500,(function(e){var t=e.element,n=e.gfx;i.createDefaultHit(t,n)})),e.on("interactionEvents.updateHit",(function(e){var t=e.element,n=e.gfx;i.updateDefaultHit(t,n)}));var u=f("djs-hit djs-hit-stroke"),d=f("djs-hit djs-hit-click-stroke"),h={all:f("djs-hit djs-hit-all"),"click-stroke":d,stroke:u,"no-move":f("djs-hit djs-hit-no-move")};function f(e,t){return t=z({stroke:"white",strokeWidth:15},t||{}),n.cls(e,["no-fill","no-border"],t)}function m(e,t){var n=h[t];if(!n)throw new Error("invalid hit type <"+t+">");return Te(e,n),e}function g(e,t){ke(e,t)}this.removeHits=function(e){_(_e(".djs-hit",e),Ke)},this.createDefaultHit=function(e,t){var n,i=e.waypoints,r=e.isFrame;return i?this.createWaypointsHit(t,i):(n=r?"stroke":"all",this.createBoxHit(t,n,{width:e.width,height:e.height}))},this.createWaypointsHit=function(e,t){var n=mt(t);return m(n,"stroke"),g(e,n),n},this.createBoxHit=function(e,t,n){n=z({x:0,y:0},n);var i=Le("rect");return m(i,t),Te(i,n),g(e,i),i},this.updateDefaultHit=function(e,t){var n=we(".djs-hit",t);if(n)return e.waypoints?gt(n,e.waypoints):Te(n,{width:e.width,height:e.height}),n},this.fire=r,this.triggerMouseEvent=function(e,t,n){var i=a[e];if(!i)throw new Error("unmapped DOM event name <"+e+">");return r(i,t,n)},this.mouseHandler=s,this.registerEvent=c,this.unregisterEvent=p}Go.$inject=["eventBus","elementRegistry","styles"];const Qo={__init__:["interactionEvents"],interactionEvents:["type",Go]};function Xo(e,t){this._eventBus=e,this.offset=5;var n=t.cls("djs-outline",["no-fill"]),i=this;function r(e){var t=Le("rect");return Te(t,z({x:0,y:0,rx:4,width:100,height:100},n)),t}e.on(["shape.added","shape.changed"],500,(function(e){var t=e.element,n=e.gfx,o=we(".djs-outline",n);o||ke(n,o=i.getOutline(t)||r()),i.updateShapeOutline(o,t)})),e.on(["connection.added","connection.changed"],(function(e){var t=e.element,n=e.gfx,o=we(".djs-outline",n);o||ke(n,o=r()),i.updateConnectionOutline(o,t)}))}Xo.prototype.updateShapeOutline=function(e,t){var n=!1,i=this._getProviders();i.length&&_(i,(function(i){n=n||i.updateOutline(t,e)})),n||Te(e,{x:-this.offset,y:-this.offset,width:t.width+2*this.offset,height:t.height+2*this.offset})},Xo.prototype.updateConnectionOutline=function(e,t){var n=Et(t);Te(e,{x:n.x-this.offset,y:n.y-this.offset,width:n.width+2*this.offset,height:n.height+2*this.offset})},Xo.prototype.registerProvider=function(e,t){t||(t=e,e=1e3),this._eventBus.on("outline.getProviders",e,(function(e){e.providers.push(t)}))},Xo.prototype._getProviders=function(){var e=this._eventBus.createEvent({type:"outline.getProviders",providers:[]});return this._eventBus.fire(e),e.providers},Xo.prototype.getOutline=function(e){var t;return _(this._getProviders(),(function(n){g(n.getOutline)&&(t=t||n.getOutline(e))})),t},Xo.$inject=["eventBus","styles","elementRegistry"];const Ko={__init__:["outline"],outline:["type",Xo]};function Yo(e,t){this._eventBus=e,this._canvas=t,this._selectedElements=[];var n=this;e.on(["shape.remove","connection.remove"],(function(e){var t=e.element;n.deselect(t)})),e.on(["diagram.clear","root.set"],(function(e){n.select(null)}))}Yo.$inject=["eventBus","canvas"],Yo.prototype.deselect=function(e){var t=this._selectedElements,n=t.indexOf(e);if(-1!==n){var i=t.slice();t.splice(n,1),this._eventBus.fire("selection.changed",{oldSelection:i,newSelection:t})}},Yo.prototype.get=function(){return this._selectedElements},Yo.prototype.isSelected=function(e){return-1!==this._selectedElements.indexOf(e)},Yo.prototype.select=function(e,t){var n=this._selectedElements,i=n.slice();h(e)||(e=e?[e]:[]);var r=this._canvas,o=r.getRootElement();e=e.filter((function(e){var t=r.findRoot(e);return o===t})),t?_(e,(function(e){-1===n.indexOf(e)&&n.push(e)})):this._selectedElements=n=e.slice(),this._eventBus.fire("selection.changed",{oldSelection:i,newSelection:n})};var Zo="hover",Jo="selected";function es(e,t,n){this._canvas=e;var i=this;function r(t,n){e.addMarker(t,n)}function o(t,n){e.removeMarker(t,n)}this._multiSelectionBox=null,t.on("element.hover",(function(e){r(e.element,Zo)})),t.on("element.out",(function(e){o(e.element,Zo)})),t.on("selection.changed",(function(e){var t=e.oldSelection,n=e.newSelection;_(t,(function(e){-1===n.indexOf(e)&&function(e){o(e,Jo)}(e)})),_(n,(function(e){-1===t.indexOf(e)&&function(e){r(e,Jo)}(e)})),i._updateSelectionOutline(n)})),t.on("element.changed",(function(e){n.isSelected(e.element)&&i._updateSelectionOutline(n.get())}))}function ts(e,t,n,i){e.on("create.end",500,(function(e){var n=e.context,i=n.canExecute,r=n.elements,o=(n.hints||{}).autoSelect;if(i){if(!1===o)return;h(o)?t.select(o):t.select(r.filter(ns))}})),e.on("connect.end",500,(function(e){var n=e.context.connection;n&&t.select(n)})),e.on("shape.move.end",500,(function(e){var n=e.previousSelection||[],r=i.get(e.context.shape.id);b(n,(function(e){return r.id===e.id}))||t.select(r)})),e.on("element.click",(function(e){if(Fo(e)){var i=e.element;i===n.getRootElement()&&(i=null);var r=t.isSelected(i),o=t.get().length>1,s=Vo(e)||Ho(e);if(r&&o)return s?t.deselect(i):t.select(i);r?t.deselect(i):t.select(i,s)}}))}function ns(e){return!e.hidden}es.$inject=["canvas","eventBus","selection"],es.prototype._updateSelectionOutline=function(e){var t=this._canvas.getLayer("selectionOutline");Re(t);var n=e.length>1;if(Me(this._canvas.getContainer())[n?"add":"remove"]("djs-multi-select"),n){var i=function(e){return{x:e.x-6,y:e.y-6,width:e.width+12,height:e.height+12}}(Et(e)),r=Le("rect");Te(r,z({rx:3},i)),Me(r).add("djs-selection-outline"),ke(t,r)}},ts.$inject=["eventBus","selection","canvas","elementRegistry"];const is={__init__:["selectionVisuals","selectionBehavior"],__depends__:[Qo,Ko],selection:["type",Yo],selectionVisuals:["type",es],selectionBehavior:["type",ts]};function rs(e){this._counter=0,this._prefix=(e?e+"-":"")+Math.floor(1e9*Math.random())+"-"}rs.prototype.next=function(){return this._prefix+ ++this._counter};var os=new rs("ov");function ss(e,t,n,i){var r,o;this._eventBus=t,this._canvas=n,this._elementRegistry=i,this._ids=os,this._overlayDefaults=z({show:null,scale:!0},e&&e.defaults),this._overlays={},this._overlayContainers=[],this._overlayRoot=(r=n.getContainer(),Z(o=be('
'),{position:"absolute",width:0,height:0}),r.insertBefore(o,r.firstChild),o),this._init()}function as(e,t,n){Z(e,{left:t+"px",top:n+"px"})}function ls(e,t){e.style.display=!1===t?"none":""}function cs(e,t){e.style["transform-origin"]="top left",["","-ms-","-webkit-"].forEach((function(n){e.style[n+"transform"]=t}))}ss.$inject=["config.overlays","eventBus","canvas","elementRegistry"],ss.prototype.get=function(e){if(y(e)&&(e={id:e}),y(e.element)&&(e.element=this._elementRegistry.get(e.element)),e.element){var t=this._getOverlayContainer(e.element,!0);return t?e.type?w(t.overlays,N({type:e.type})):t.overlays.slice():[]}return e.type?w(this._overlays,N({type:e.type})):e.id?this._overlays[e.id]:null},ss.prototype.add=function(e,t,n){if(f(t)&&(n=t,t=null),e.id||(e=this._elementRegistry.get(e)),!n.position)throw new Error("must specifiy overlay position");if(!n.html)throw new Error("must specifiy overlay html");if(!e)throw new Error("invalid element specified");var i=this._ids.next();return n=z({},this._overlayDefaults,n,{id:i,type:t,element:e,html:n.html}),this._addOverlay(n),i},ss.prototype.remove=function(e){var t=this.get(e)||[];h(t)||(t=[t]);var n=this;_(t,(function(e){var t=n._getOverlayContainer(e.element,!0);if(e&&(Ee(e.html),Ee(e.htmlContainer),delete e.htmlContainer,delete e.element,delete n._overlays[e.id]),t){var i=t.overlays.indexOf(e);-1!==i&&t.overlays.splice(i,1)}}))},ss.prototype.isShown=function(){return"none"!==this._overlayRoot.style.display},ss.prototype.show=function(){ls(this._overlayRoot)},ss.prototype.hide=function(){ls(this._overlayRoot,!1)},ss.prototype.clear=function(){this._overlays={},this._overlayContainers=[],ie(this._overlayRoot)},ss.prototype._updateOverlayContainer=function(e){var t=e.element,n=e.html,i=t.x,r=t.y;if(t.waypoints){var o=Et(t);i=o.x,r=o.y}as(n,i,r),J(e.html,"data-container-id",t.id)},ss.prototype._updateOverlay=function(e){var t,n,i=e.position,r=e.htmlContainer,o=e.element,s=i.left,a=i.top;void 0!==i.right&&(t=o.waypoints?Et(o).width:o.width,s=-1*i.right+t);void 0!==i.bottom&&(n=o.waypoints?Et(o).height:o.height,a=-1*i.bottom+n);as(r,s||0,a||0),this._updateOverlayVisibilty(e,this._canvas.viewbox())},ss.prototype._createOverlayContainer=function(e){var t=be('
');Z(t,{position:"absolute"}),this._overlayRoot.appendChild(t);var n={html:t,element:e,overlays:[]};return this._updateOverlayContainer(n),this._overlayContainers.push(n),n},ss.prototype._updateRoot=function(e){var t=e.scale||1,n="matrix("+[t,0,0,t,-1*e.x*t,-1*e.y*t].join(",")+")";cs(this._overlayRoot,n)},ss.prototype._getOverlayContainer=function(e,t){var n=b(this._overlayContainers,(function(t){return t.element===e}));return n||t?n:this._createOverlayContainer(e)},ss.prototype._addOverlay=function(e){var t,n,i=e.id,r=e.element,o=e.html;o.get&&o.constructor.prototype.jquery&&(o=o.get(0)),y(o)&&(o=be(o)),n=this._getOverlayContainer(r),Z(t=be(''),{position:"absolute"}),t.appendChild(o),e.type&&te(t).add("djs-overlay-"+e.type),ls(t,this._canvas.findRoot(r)===this._canvas.getRootElement()),e.htmlContainer=t,n.overlays.push(e),n.html.appendChild(t),this._overlays[i]=e,this._updateOverlay(e),this._updateOverlayVisibilty(e,this._canvas.viewbox())},ss.prototype._updateOverlayVisibilty=function(e,t){var n=e.show,i=this._canvas.findRoot(e.element),r=n&&n.minZoom,o=n&&n.maxZoom,s=e.htmlContainer,a=!0;(i!==this._canvas.getRootElement()||n&&(u(r)&&r>t.scale||u(o)&&o
i&&(r=(1/t.scale||1)*i)),u(r)&&(a="scale("+r+","+r+")"),cs(s,a)},ss.prototype._updateOverlaysVisibilty=function(e){var t=this;_(this._overlays,(function(n){t._updateOverlayVisibilty(n,e)}))},ss.prototype._init=function(){var e=this._eventBus,t=this;e.on("canvas.viewbox.changing",(function(e){t.hide()})),e.on("canvas.viewbox.changed",(function(e){var n;n=e.viewbox,t._updateRoot(n),t._updateOverlaysVisibilty(n),t.show()})),e.on(["shape.remove","connection.remove"],(function(e){var n=e.element;_(t.get({element:n}),(function(e){t.remove(e.id)}));var i=t._getOverlayContainer(n);if(i){Ee(i.html);var r=t._overlayContainers.indexOf(i);-1!==r&&t._overlayContainers.splice(r,1)}})),e.on("element.changed",500,(function(e){var n=e.element,i=t._getOverlayContainer(n,!0);i&&(_(i.overlays,(function(e){t._updateOverlay(e)})),t._updateOverlayContainer(i))})),e.on("element.marker.update",(function(e){var n=t._getOverlayContainer(e.element,!0);n&&te(n.html)[e.add?"add":"remove"](e.marker)})),e.on("root.set",(function(){t._updateOverlaysVisibilty(t._canvas.viewbox())})),e.on("diagram.clear",this.clear,this)};const ps={__init__:["overlays"],overlays:["type",ss]};function us(e,t,n,i){e.on("element.changed",(function(i){var r=i.element;(r.parent||r===t.getRootElement())&&(i.gfx=n.getGraphics(r)),i.gfx&&e.fire(Ot(r)+".changed",i)})),e.on("elements.changed",(function(t){var n=t.elements;n.forEach((function(t){e.fire("element.changed",{element:t})})),i.updateContainments(n)})),e.on("shape.changed",(function(e){i.update("shape",e.element,e.gfx)})),e.on("connection.changed",(function(e){i.update("connection",e.element,e.gfx)}))}us.$inject=["eventBus","canvas","elementRegistry","graphicsFactory"];const ds={__init__:["changeSupport"],changeSupport:["type",us]};function hs(e){this._eventBus=e}function fs(e){return function(t,n,i,r,o){(g(t)||m(t))&&(o=r,r=i,i=n,n=t,t=null),this.on(t,e,n,i,r,o)}}function ms(e,t){t.invoke(hs,this),this.executed((function(t){var n=t.context;n.rootElement?e.setRootElement(n.rootElement):n.rootElement=e.getRootElement()})),this.revert((function(t){var n=t.context;n.rootElement&&e.setRootElement(n.rootElement)}))}hs.$inject=["eventBus"],hs.prototype.on=function(e,t,n,i,r,o){if((g(t)||m(t))&&(o=r,r=i,i=n,n=t,t=null),g(n)&&(o=r,r=i,i=n,n=1e3),f(r)&&(o=r,r=!1),!g(i))throw new Error("handlerFn must be a function");h(e)||(e=[e]);var s=this._eventBus;_(e,(function(e){var a=["commandStack",e,t].filter((function(e){return e})).join(".");s.on(a,n,r?function(e,t){return function(n){return e.call(t||null,n.context,n.command,n)}}(i,o):i,o)}))},hs.prototype.canExecute=fs("canExecute"),hs.prototype.preExecute=fs("preExecute"),hs.prototype.preExecuted=fs("preExecuted"),hs.prototype.execute=fs("execute"),hs.prototype.executed=fs("executed"),hs.prototype.postExecute=fs("postExecute"),hs.prototype.postExecuted=fs("postExecuted"),hs.prototype.revert=fs("revert"),hs.prototype.reverted=fs("reverted"),i(ms,hs),ms.$inject=["canvas","injector"];const gs={__init__:["rootElementsBehavior"],rootElementsBehavior:["type",ms]};function ys(e){return CSS.escape(e)}var vs={"&":"&","<":"<",">":">",'"':""","'":"'"};function bs(e){return(e=""+e)&&e.replace(/[&<>"']/g,(function(e){return vs[e]}))}var xs="_plane";function ws(e){return function(e){return e.replace(new RegExp(xs+"$"),"")}(e.id)}function _s(e){var t=e.id;return Tr(e,"bpmn:SubProcess")?Ps(t):t}function Es(e){return Ps(e)}function Os(e){return Tr(Dr(e),"bpmndi:BPMNPlane")}function Ps(e){return e+xs}function ks(e,t,n){var i=be(''),r=n.getContainer(),o=te(r);r.appendChild(i);var s=[];function a(e){e&&(s=function(e){for(var t=Mr(e),n=[],i=t;i;i=i.$parent)(Tr(i,"bpmn:SubProcess")||Tr(i,"bpmn:Process"))&&n.push(i);return n.reverse()}(e));var r=s.map((function(e){var i=bs(e.name||e.id),r=be(''+i+" "),o=n.findRoot(_s(e))||n.findRoot(e.id);if(!o&&Tr(e,"bpmn:Process")){var s=t.find((function(t){var n=Mr(t);return n&&n.get("processRef")&&n.get("processRef")===e}));o=n.findRoot(s.id)}return r.addEventListener("click",(function(){n.setRootElement(o)})),r}));i.innerHTML="";var a=r.length>1;o.toggle("bjs-breadcrumbs-shown",a),r.forEach((function(e){i.appendChild(e)}))}e.on("element.changed",(function(e){var t=Mr(e.element);b(s,(function(e){return e===t}))&&a()})),e.on("root.set",(function(e){a(e.element)}))}function Ss(e,t){var n=null,i=new Cs;e.on("root.set",(function(e){var r=e.element,o=t.viewbox(),s=i.get(r);if(i.set(n,{x:o.x,y:o.y,zoom:o.scale}),n=r,!Tr(r,"bpmn:Collaboration")||s){s=s||{x:0,y:0,zoom:1};var a=(o.x-s.x)*o.scale,l=(o.y-s.y)*o.scale;0===a&&0===l||t.scroll({dx:a,dy:l}),s.zoom!==o.scale&&t.zoom(s.zoom,{x:0,y:0})}})),e.on("diagram.clear",(function(){i.clear(),n=null}))}function Cs(){this._entries=[],this.set=function(e,t){var n=!1;for(var i in this._entries)if(this._entries[i][0]===e){this._entries[i][1]=t,n=!0;break}n||this._entries.push([e,t])},this.get=function(e){for(var t in this._entries)if(this._entries[t][0]===e)return this._entries[t][1];return null},this.clear=function(){this._entries.length=0},this.remove=function(e){var t=-1;for(var n in this._entries)if(this._entries[n][0]===e){t=n;break}-1!==t&&this._entries.splice(t,1)}}ks.$inject=["eventBus","elementRegistry","canvas"],Ss.$inject=["eventBus","canvas"];var Ts=180,As=160;function Ms(e,t){this._eventBus=e,this._moddle=t;var n=this;e.on("import.render.start",1500,(function(e,t){n._handleImport(t.definitions)}))}function Ds(e){return Tr(e,"bpmndi:BPMNDiagram")?e:Ds(e.$parent)}Ms.prototype._handleImport=function(e){if(e.diagrams){var t=this;this._definitions=e,this._processToDiagramMap={},e.diagrams.forEach((function(e){e.plane&&e.plane.bpmnElement&&(t._processToDiagramMap[e.plane.bpmnElement.id]=e)}));var n=[];e.diagrams.forEach((function(e){var i=t._createNewDiagrams(e.plane);Array.prototype.push.apply(n,i)})),n.forEach((function(e){t._movePlaneElementsToOrigin(e.plane)}))}},Ms.prototype._createNewDiagrams=function(e){var t=this,n=[],i=[];e.get("planeElement").forEach((function(t){var r=t.bpmnElement;if(r){var o=r.$parent;Tr(r,"bpmn:SubProcess")&&!t.isExpanded&&n.push(r),function(e,t){var n=e.$parent;if(!Tr(n,"bpmn:SubProcess")||n===t.bpmnElement)return!1;if(Ar(e,["bpmn:DataInputAssociation","bpmn:DataOutputAssociation"]))return!1;return!0}(r,e)&&i.push({diElement:t,parent:o})}}));var r=[];return n.forEach((function(e){if(!t._processToDiagramMap[e.id]){var n=t._createDiagram(e);t._processToDiagramMap[e.id]=n,r.push(n)}})),i.forEach((function(e){for(var i=e.diElement,r=e.parent;r&&-1===n.indexOf(r);)r=r.$parent;if(r){var o=t._processToDiagramMap[r.id];t._moveToDiPlane(i,o.plane)}})),r},Ms.prototype._movePlaneElementsToOrigin=function(e){var t=e.get("planeElement"),n=function(e){var t={top:1/0,right:-1/0,bottom:-1/0,left:1/0};return e.planeElement.forEach((function(e){if(e.bounds){var n=wn(e.bounds);t.top=Math.min(n.top,t.top),t.left=Math.min(n.left,t.left)}})),_n(t)}(e),i=n.x-Ts,r=n.y-As;t.forEach((function(e){e.waypoint?e.waypoint.forEach((function(e){e.x=e.x-i,e.y=e.y-r})):e.bounds&&(e.bounds.x=e.bounds.x-i,e.bounds.y=e.bounds.y-r)}))},Ms.prototype._moveToDiPlane=function(e,t){var n=Ds(e).plane.get("planeElement");n.splice(n.indexOf(e),1),t.get("planeElement").push(e)},Ms.prototype._createDiagram=function(e){var t=this._moddle.create("bpmndi:BPMNPlane",{bpmnElement:e}),n=this._moddle.create("bpmndi:BPMNDiagram",{plane:t});return t.$parent=n,t.bpmnElement=e,n.$parent=this._definitions,this._definitions.diagrams.push(n),n},Ms.$inject=["eventBus","moddle"];var Rs=250;function Ns(e,t,n,i){hs.call(this,t),this._canvas=e,this._eventBus=t,this._elementRegistry=n,this._overlays=i;var r=this;this.executed("shape.toggleCollapse",Rs,(function(e){var t=e.shape;r._canDrillDown(t)?r._addOverlay(t):r._removeOverlay(t)}),!0),this.reverted("shape.toggleCollapse",Rs,(function(e){var t=e.shape;r._canDrillDown(t)?r._addOverlay(t):r._removeOverlay(t)}),!0),this.executed(["shape.create","shape.move","shape.delete"],Rs,(function(e){var t=e.oldParent,n=e.newParent||e.parent,i=e.shape;r._canDrillDown(i)&&r._addOverlay(i),r._updateDrilldownOverlay(t),r._updateDrilldownOverlay(n),r._updateDrilldownOverlay(i)}),!0),this.reverted(["shape.create","shape.move","shape.delete"],Rs,(function(e){var t=e.oldParent,n=e.newParent||e.parent,i=e.shape;r._canDrillDown(i)&&r._addOverlay(i),r._updateDrilldownOverlay(t),r._updateDrilldownOverlay(n),r._updateDrilldownOverlay(i)}),!0),t.on("import.render.complete",(function(){n.filter((function(e){return r._canDrillDown(e)})).map((function(e){r._addOverlay(e)}))}))}i(Ns,hs),Ns.prototype._updateDrilldownOverlay=function(e){var t=this._canvas;if(e){var n=t.findRoot(e);n&&this._updateOverlayVisibility(n)}},Ns.prototype._canDrillDown=function(e){var t=this._canvas;return Tr(e,"bpmn:SubProcess")&&t.findRoot(_s(e))},Ns.prototype._updateOverlayVisibility=function(e){var t=this._overlays,n=Mr(e),i=t.get({element:n.id,type:"drilldown"})[0];if(i){var r=n&&n.get("flowElements")&&n.get("flowElements").length;te(i.html).toggle("bjs-drilldown-empty",!r)}},Ns.prototype._addOverlay=function(e){var t=this._canvas,n=this._overlays;n.get({element:e,type:"drilldown"}).length&&this._removeOverlay(e);var i=be(' ');i.addEventListener("click",(function(){t.setRootElement(t.findRoot(_s(e)))})),n.add(e,"drilldown",{position:{bottom:-7,right:-8},html:i}),this._updateOverlayVisibility(e)},Ns.prototype._removeOverlay=function(e){this._overlays.remove({element:e,type:"drilldown"})},Ns.$inject=["canvas","eventBus","elementRegistry","overlays"];const $s={__depends__:[ps,ds,gs],__init__:["drilldownBreadcrumbs","drilldownOverlayBehavior","drilldownCentering","subprocessCompatibility"],drilldownBreadcrumbs:["type",ks],drilldownCentering:["type",Ss],drilldownOverlayBehavior:["type",Ns],subprocessCompatibility:["type",Ms]};function js(e){Hr.call(this,e)}i(js,Hr),js.prototype._modules=[$o,Ao,is,ps,$s],js.prototype._moddleExtensions={};var Is=["c","C"],Ls=["v","V"],Bs=["y","Y"],qs=["z","Z"];function zs(e){return!e.altKey&&(e.ctrlKey||e.metaKey)}function Fs(e,t){return-1!==(e=h(e)?e:[e]).indexOf(t.key)||-1!==e.indexOf(t.code)}function Vs(e){return e.shiftKey}var Hs="keyboard.keydown",Us="input-handle-modified-keys";function Ws(e,t){var n=this;this._config=e||{},this._eventBus=t,this._keydownHandler=this._keydownHandler.bind(this),this._keyupHandler=this._keyupHandler.bind(this),t.on("diagram.destroy",(function(){n._fire("destroy"),n.unbind()})),t.on("diagram.init",(function(){n._fire("init")})),t.on("attach",(function(){e&&e.bindTo&&n.bind(e.bindTo)})),t.on("detach",(function(){n.unbind()}))}Ws.$inject=["config.keyboard","eventBus"],Ws.prototype._keydownHandler=function(e){this._keyHandler(e,Hs)},Ws.prototype._keyupHandler=function(e){this._keyHandler(e,"keyboard.keyup")},Ws.prototype._keyHandler=function(e,t){if(!this._isEventIgnored(e)){var n={keyEvent:e};this._eventBus.fire(t||Hs,n)&&e.preventDefault()}},Ws.prototype._isEventIgnored=function(e){return!!e.defaultPrevented||(t=e.target)&&(xe(t,"input, textarea")||"true"===t.contentEditable)&&this._isModifiedKeyIgnored(e);var t},Ws.prototype._isModifiedKeyIgnored=function(e){return!zs(e)||-1===this._getAllowedModifiers(e.target).indexOf(e.key)},Ws.prototype._getAllowedModifiers=function(e){var t=re(e,"["+Us+"]",!0);return!t||this._node&&!this._node.contains(t)?[]:t.getAttribute(Us).split(",")},Ws.prototype.bind=function(e){this.unbind(),this._node=e,de.bind(e,"keydown",this._keydownHandler),de.bind(e,"keyup",this._keyupHandler),this._fire("bind")},Ws.prototype.getBinding=function(){return this._node},Ws.prototype.unbind=function(){var e=this._node;e&&(this._fire("unbind"),de.unbind(e,"keydown",this._keydownHandler),de.unbind(e,"keyup",this._keyupHandler)),this._node=null},Ws.prototype._fire=function(e){this._eventBus.fire("keyboard."+e,{node:this._node})},Ws.prototype.addListener=function(e,t,n){g(e)&&(n=t,t=e,e=1e3),this._eventBus.on(n||Hs,e,t)},Ws.prototype.removeListener=function(e,t){this._eventBus.off(t||Hs,e)},Ws.prototype.hasModifier=function(e){return e.ctrlKey||e.metaKey||e.shiftKey||e.altKey},Ws.prototype.isCmd=zs,Ws.prototype.isShift=Vs,Ws.prototype.isKey=Fs;function Gs(e,t){var n=this;e.on("editorActions.init",500,(function(e){var i=e.editorActions;n.registerBindings(t,i)}))}Gs.$inject=["eventBus","keyboard"],Gs.prototype.registerBindings=function(e,t){function n(n,i){t.isRegistered(n)&&e.addListener(i)}n("undo",(function(e){if(function(e){return zs(e)&&!Vs(e)&&Fs(qs,e)}(e.keyEvent))return t.trigger("undo"),!0})),n("redo",(function(e){if(function(e){return zs(e)&&(Fs(Bs,e)||Fs(qs,e)&&Vs(e))}(e.keyEvent))return t.trigger("redo"),!0})),n("copy",(function(e){if(function(e){return zs(e)&&Fs(Is,e)}(e.keyEvent))return t.trigger("copy"),!0})),n("paste",(function(e){if(function(e){return zs(e)&&Fs(Ls,e)}(e.keyEvent))return t.trigger("paste"),!0})),n("stepZoom",(function(e){var n=e.keyEvent;if(Fs(["+","Add","="],n)&&zs(n))return t.trigger("stepZoom",{value:1}),!0})),n("stepZoom",(function(e){var n=e.keyEvent;if(Fs(["-","Subtract"],n)&&zs(n))return t.trigger("stepZoom",{value:-1}),!0})),n("zoom",(function(e){var n=e.keyEvent;if(Fs("0",n)&&zs(n))return t.trigger("zoom",{value:1}),!0})),n("removeSelection",(function(e){if(Fs(["Backspace","Delete","Del"],e.keyEvent))return t.trigger("removeSelection"),!0}))};const Qs={__init__:["keyboard","keyboardBindings"],keyboard:["type",Ws],keyboardBindings:["type",Gs]};var Xs={moveSpeed:50,moveSpeedAccelerated:200};function Ks(e,t,n){var i=this;this._config=z({},Xs,e||{}),t.addListener((function(e){var n=e.keyEvent,r=i._config;if(!t.isCmd(n))return;if(t.isKey(["ArrowLeft","Left","ArrowUp","Up","ArrowDown","Down","ArrowRight","Right"],n)){var o,s=t.isShift(n)?r.moveSpeedAccelerated:r.moveSpeed;switch(n.key){case"ArrowLeft":case"Left":o="left";break;case"ArrowUp":case"Up":o="up";break;case"ArrowRight":case"Right":o="right";break;case"ArrowDown":case"Down":o="down"}return i.moveCanvas({speed:s,direction:o}),!0}})),this.moveCanvas=function(e){var t=0,i=0,r=e.speed/Math.min(Math.sqrt(n.viewbox().scale),1);switch(e.direction){case"left":t=r;break;case"up":i=r;break;case"right":t=-r;break;case"down":i=-r}n.scroll({dx:t,dy:i})}}Ks.$inject=["config.keyboardMove","keyboard","canvas"];const Ys={__depends__:[Qs],__init__:["keyboardMove"],keyboardMove:["type",Ks]};var Zs=/^djs-cursor-.*$/;function Js(e){var t=te(document.body);t.removeMatching(Zs),e&&t.add("djs-cursor-"+e)}function ea(){Js(null)}function ta(e,t){function n(){return!1}return t=t||"element.click",e.once(t,5e3,n),function(){e.off(t,n)}}function na(e){return{x:e.x+e.width/2,y:e.y+e.height/2}}function ia(e,t){return{x:e.x-t.x,y:e.y-t.y}}function ra(e,t){var n;function i(i){var r,o=n.start,s=n.button,a=Bo(i),l=ia(a,o);(!n.dragging&&(r=l,Math.sqrt(Math.pow(r.x,2)+Math.pow(r.y,2))>15)&&(n.dragging=!0,0===s&&ta(e),Js("grab")),n.dragging)&&(l=ia(a,n.last||n.start),t.scroll({dx:l.x,dy:l.y}),n.last=a);i.preventDefault()}function r(e){de.unbind(document,"mousemove",i),de.unbind(document,"mouseup",r),n=null,ea()}e.on("element.mousedown",500,(function(e){return function(e){if(re(e.target,".djs-draggable"))return;var t=e.button;if(t>=2||e.ctrlKey||e.shiftKey||e.altKey)return;return n={button:t,start:Bo(e)},de.bind(document,"mousemove",i),de.bind(document,"mouseup",r),!0}(e.originalEvent)})),this.isActive=function(){return!!n}}ra.$inject=["eventBus","canvas"];const oa={__init__:["moveCanvas"],moveCanvas:["type",ra]};function sa(e){return Math.log(e)/Math.log(10)}function aa(e,t){var n=sa(e.min),i=sa(e.max);return(Math.abs(n)+Math.abs(i))/t}var la=Math.sign||function(e){return e>=0?1:-1},ca={min:.2,max:4};function pa(e,t,n){e=e||{},this._enabled=!1,this._canvas=n,this._container=n._container,this._handleWheel=q(this._handleWheel,this),this._totalDelta=0,this._scale=e.scale||.75;var i=this;t.on("canvas.init",(function(t){i._init(!1!==e.enabled)}))}pa.$inject=["config.zoomScroll","eventBus","canvas"],pa.prototype.scroll=function(e){this._canvas.scroll(e)},pa.prototype.reset=function(){this._canvas.zoom("fit-viewport")},pa.prototype.zoom=function(e,t){var n=aa(ca,20);this._totalDelta+=e,Math.abs(this._totalDelta)>.1&&(this._zoom(e,t,n),this._totalDelta=0)},pa.prototype._handleWheel=function(e){if(!re(e.target,".djs-scrollable",!0)){var t=this._container;e.preventDefault();var n,i=e.ctrlKey||qo()&&e.metaKey,r=e.shiftKey,o=-1*this._scale;if(o*=i?0===e.deltaMode?.02:.32:0===e.deltaMode?1:16,i){var s=t.getBoundingClientRect(),a={x:e.clientX-s.left,y:e.clientY-s.top};n=Math.sqrt(Math.pow(e.deltaY,2)+Math.pow(e.deltaX,2))*la(e.deltaY)*o,this.zoom(n,a)}else n=r?{dx:o*e.deltaY,dy:0}:{dx:o*e.deltaX,dy:o*e.deltaY},this.scroll(n)}},pa.prototype.stepZoom=function(e,t){var n=aa(ca,10);this._zoom(e,t,n)},pa.prototype._zoom=function(e,t,n){var i=this._canvas,r=e>0?1:-1,o=sa(i.zoom()),s=Math.round(o/n)*n;s+=n*r;var a=Math.pow(10,s);i.zoom(function(e,t){return Math.max(e.min,Math.min(e.max,t))}(ca,a),t)},pa.prototype.toggle=function(e){var t=this._container,n=this._handleWheel,i=this._enabled;return void 0===e&&(e=!i),i!==e&&de[e?"bind":"unbind"](t,"wheel",n,!1),this._enabled=e,e},pa.prototype._init=function(e){this.toggle(e)};const ua={__init__:["zoomScroll"],zoomScroll:["type",pa]};function da(e){js.call(this,e)}i(da,js),da.prototype._navigationModules=[Ys,oa,ua],da.prototype._modules=[].concat(js.prototype._modules,da.prototype._navigationModules);var ha=n(168),fa=n.n(ha),ma=["mousedown","mouseup","mouseover","mouseout","click","dblclick"];function ga(e,t){return t.get(e,!1)}function ya(e){e.preventDefault(),"function"==typeof e.stopPropagation?e.stopPropagation():e.srcEvent&&"function"==typeof e.srcEvent.stopPropagation&&e.srcEvent.stopPropagation(),"function"==typeof e.stopImmediatePropagation&&e.stopImmediatePropagation()}function va(e){function t(t){setTimeout((function(){_(ma,(function(t){de.unbind(e,t,ya,!0)}))}),500)}de.bind(e,"touchstart",(function(t){_(ma,(function(t){de.bind(e,t,ya,!0)}))}),!0),de.bind(e,"touchend",t,!0),de.bind(e,"touchcancel",t,!0);var n=new(fa().Manager)(e,{inputClass:fa().TouchInput,recognizers:[],domEvents:!0}),i=new(fa().Tap),r=new(fa().Pan)({threshold:10}),o=new(fa().Press),s=new(fa().Pinch),a=new(fa().Tap)({event:"doubletap",taps:2});return s.requireFailure(r),s.requireFailure(o),n.add([r,o,s,a,i]),n.reset=function(e){var t=this.recognizers,i=this.session;i.stopped||(n.stop(e),setTimeout((function(){var e,n;for(e=0;n=t[e];e++)n.reset(),n.state=8;i.curRecognizer=null}),0))},n.on("hammer.input",(function(e){e.srcEvent.defaultPrevented&&n.reset(!0)})),n}function ba(e,t,n,i,r){var o,s=ga("dragging",e),a=ga("move",e),l=ga("contextPad",e),c=ga("palette",e);function p(e,t){return function(n){var o=u(n.target),s=o&&i.get(o);return t&&(n.srcEvent.button=t),r.fire(e,n,s)}}function u(e){return re(e,"svg, .djs-element",!0)}function d(e){function n(e){var n=u(e.target),r=n&&i.get(n);if(a&&t.getRootElement()!==r)return a.start(e,r,!0);!function(){var e=0,n=0;function i(i){var r=i.deltaX-e,o=i.deltaY-n;t.scroll({dx:r,dy:o}),e=i.deltaX,n=i.deltaY}function r(e){o.off("panmove",i),o.off("panend",r),o.off("pancancel",r)}o.on("panmove",i),o.on("panend",r),o.on("pancancel",r)}()}(o=va(e)).on("tap",p("element.click")),o.on("doubletap",p("element.dblclick",1)),o.on("panstart",n),o.on("press",n),o.on("pinchstart",(function(e){var n=t.zoom(),i=e.center;function r(e){var r=1-(1-e.scale)/1.5,o=Math.max(.2,Math.min(4,r*n));t.zoom(o,i),ya(e)}function s(e){o.off("pinchmove",r),o.off("pinchend",s),o.off("pinchcancel",s),o.reset(!0)}o.on("pinchmove",r),o.on("pinchend",s),o.on("pinchcancel",s)}))}s&&n.on("drag.move",(function(e){var t=e.originalEvent;if(t&&!(t instanceof MouseEvent)){var n=Bo(t),r=u(document.elementFromPoint(n.x,n.y)),o=r&&i.get(r);o!==e.hover&&(e.hover&&s.out(e),o&&(s.hover({element:o,gfx:r}),e.hover=o,e.hoverGfx=r))}})),l&&n.on("contextPad.create",(function(e){var t=va(e.pad.html);t.on("panstart",(function(e){l.trigger("dragstart",e,!0)})),t.on("press",(function(e){l.trigger("dragstart",e,!0)})),t.on("tap",(function(e){l.trigger("click",e)}))})),c&&n.on("palette.create",(function(e){var t=va(e.container);t.on("panstart",(function(e){c.trigger("dragstart",e,!0)})),t.on("press",(function(e){c.trigger("dragstart",e,!0)})),t.on("tap",(function(e){c.trigger("click",e)}))})),n.on("canvas.init",(function(e){d(e.svg)}))}function xa(e){var t=this;e.on("canvas.init",(function(e){t.addBBoxMarker(e.svg)}))}ba.$inject=["injector","canvas","eventBus","elementRegistry","interactionEvents","touchFix"],xa.$inject=["eventBus"],xa.prototype.addBBoxMarker=function(e){var t={fill:"none",class:"outer-bound-marker"},n=Le("rect");Te(n,{x:-1e4,y:1e4,width:10,height:10}),Te(n,t),ke(e,n);var i=Le("rect");Te(i,{x:1e4,y:1e4,width:10,height:10}),Te(i,t),ke(e,i)};const wa={__depends__:[{__depends__:[Qo],__init__:["touchInteractionEvents"],touchInteractionEvents:["type",ba],touchFix:["type",xa]}]};function _a(e){return e&&e[e.length-1]}function Ea(e){return e.y}function Oa(e){return e.x}var Pa={left:Oa,center:Oa,right:function(e){return e.x+e.width},top:Ea,middle:Ea,bottom:function(e){return e.y+e.height}};function ka(e,t){this._modeling=e,this._rules=t}ka.$inject=["modeling","rules"],ka.prototype._getOrientationDetails=function(e){var t="x",n="width";return-1!==["top","bottom","middle"].indexOf(e)&&(t="y",n="height"),{axis:t,dimension:n}},ka.prototype._isType=function(e,t){return-1!==t.indexOf(e)},ka.prototype._alignmentPosition=function(e,t){var n,i,r,o=this._getOrientationDetails(e),s=o.axis,a=o.dimension,l={},c={},p=!1;if(this._isType(e,["left","top"]))l[e]=t[0][s];else if(this._isType(e,["right","bottom"]))r=_a(t),l[e]=r[s]+r[a];else if(this._isType(e,["center","middle"])){if(_(t,(function(e){var t=e[s]+Math.round(e[a]/2);c[t]?c[t].elements.push(e):c[t]={elements:[e],center:t}})),n=R(c,(function(e){return e.elements.length>1&&(p=!0),e.elements.length})),p)return l[e]=_a(n).center,l;i=t[0],r=_a(t=R(t,(function(e){return e[s]+e[a]}))),l[e]=function(e,t){return Math.round((e[s]+t[s]+t[a])/2)}(i,r)}return l},ka.prototype.trigger=function(e,t){var n,i=this._modeling,r=w(e,(function(e){return!(e.waypoints||e.host||e.labelTarget)}));if(h(n=this._rules.allowed("elements.align",{elements:r}))&&(r=n),!(r.length<2)&&n){var o=R(r,Pa[t]),s=this._alignmentPosition(t,o);i.alignElements(o,s)}};const Sa={__init__:["alignElements"],alignElements:["type",ka]};var Ca=".entry";function Ta(e,t,n,i){this._canvas=e,this._eventBus=n,this._overlays=i;var r=u(t&&t.scale)?t.scale:{min:1,max:1.5};this._overlaysConfig={scale:r},this._current=null,this._init()}function Aa(e,t){return-1!==e.indexOf(t)}Ta.$inject=["canvas","config.contextPad","eventBus","overlays"],Ta.prototype._init=function(){var e=this;this._eventBus.on("selection.changed",(function(t){var n=t.newSelection,i=n.length?1===n.length?n[0]:n:null;i?e.open(i,!0):e.close()})),this._eventBus.on("elements.changed",(function(t){var n=t.elements,i=e._current;if(i){var r=i.target;k(h(r)?r:[r],(function(e){return Aa(n,e)}))&&e.open(r,!0)}}))},Ta.prototype.registerProvider=function(e,t){t||(t=e,e=1e3),this._eventBus.on("contextPad.getProviders",e,(function(e){e.providers.push(t)}))},Ta.prototype.getEntries=function(e){var t=this._getProviders(),n=h(e)?"getMultiElementContextPadEntries":"getContextPadEntries",i={};return _(t,(function(t){if(g(t[n])){var r=t[n](e);g(r)?i=r(i):_(r,(function(e,t){i[t]=e}))}})),i},Ta.prototype.trigger=function(e,t,n){var i,r,o=t.delegateTarget||t.target;return o?(i=J(o,"data-action"),r=t.originalEvent||t,"mouseover"===e?this._timeout=setTimeout((()=>{this._mouseout=this.triggerEntry(i,"hover",r,n)}),300):"mouseout"===e&&(clearTimeout(this._timeout),this._mouseout&&(this._mouseout(),this._mouseout=null)),this.triggerEntry(i,e,r,n)):t.preventDefault()},Ta.prototype.triggerEntry=function(e,t,n,i){if(this.isShown()){var r=this._current.target,o=this._current.entries[e];if(o){var s=o.action;if(!1!==this._eventBus.fire("contextPad.trigger",{entry:o,event:n})){if(g(s)){if("click"===t)return s(n,r,i)}else if(s[t])return s[t](n,r,i);n.preventDefault()}}}},Ta.prototype.open=function(e,t){!t&&this.isOpen(e)||(this.close(),this._updateAndOpen(e))},Ta.prototype._getProviders=function(){var e=this._eventBus.createEvent({type:"contextPad.getProviders",providers:[]});return this._eventBus.fire(e),e.providers},Ta.prototype._updateAndOpen=function(e){var t,n=this.getEntries(e),i=this.getPad(e),r=i.html;_(n,(function(e,n){var i,o=e.group||"default",s=be(e.html||'
');J(s,"data-action",n),(i=we("[data-group="+ys(o)+"]",r))||(J(i=be('
'),"data-group",o),r.appendChild(i)),i.appendChild(s),e.className&&function(e,t){var n=te(e);(t=h(t)?t:t.split(/\s+/g)).forEach((function(e){n.add(e)}))}(s,e.className),e.title&&J(s,"title",e.title),e.imageUrl&&(J(t=be(" "),"src",e.imageUrl),t.style.width="100%",t.style.height="100%",s.appendChild(t))})),te(r).add("open"),this._current={target:e,entries:n,pad:i},this._eventBus.fire("contextPad.open",{current:this._current})},Ta.prototype.getPad=function(e){if(this.isOpen())return this._current.pad;var t=this,n=this._overlays,i=be('
'),r=this._getPosition(e),o=z({html:i},this._overlaysConfig,r);me.bind(i,Ca,"click",(function(e){t.trigger("click",e)})),me.bind(i,Ca,"dragstart",(function(e){t.trigger("dragstart",e)})),me.bind(i,Ca,"mouseover",(function(e){t.trigger("mouseover",e)})),me.bind(i,Ca,"mouseout",(function(e){t.trigger("mouseout",e)})),de.bind(i,"mousedown",(function(e){e.stopPropagation()}));var s=this._canvas.getRootElement();this._overlayId=n.add(s,"context-pad",o);var a=n.get(this._overlayId);return this._eventBus.fire("contextPad.create",{target:e,pad:a}),a},Ta.prototype.close=function(){this.isOpen()&&(clearTimeout(this._timeout),this._overlays.remove(this._overlayId),this._overlayId=null,this._eventBus.fire("contextPad.close",{current:this._current}),this._current=null)},Ta.prototype.isOpen=function(e){var t=this._current;if(!t)return!1;if(!e)return!0;var n=t.target;return h(e)===h(n)&&(h(e)?e.length===n.length&&P(e,(function(e){return Aa(n,e)})):n===e)},Ta.prototype.isShown=function(){return this.isOpen()&&this._overlays.isShown()},Ta.prototype._getPosition=function(e){var t,n=Et(h(e=yn(e)?(t=e).waypoints[t.waypoints.length-1]:e)?e:[e]);return{position:{left:n.x+n.width+12,top:n.y-6}}};const Ma={__depends__:[Qo,ps],contextPad:["type",Ta]};var Da,Ra,Na,$a,ja,Ia,La,Ba,qa,za,Fa={},Va=[],Ha=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Ua=Array.isArray;function Wa(e,t){for(var n in t)e[n]=t[n];return e}function Ga(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function Qa(e,t,n){var i,r,o,s={};for(o in t)"key"==o?i=t[o]:"ref"==o?r=t[o]:s[o]=t[o];if(arguments.length>2&&(s.children=arguments.length>3?Da.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(o in e.defaultProps)void 0===s[o]&&(s[o]=e.defaultProps[o]);return Xa(e,s,i,r,null)}function Xa(e,t,n,i,r){var o={type:e,props:t,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==r?++Na:r,__i:-1,__u:0};return null==r&&null!=Ra.vnode&&Ra.vnode(o),o}function Ka(e){return e.children}function Ya(e,t){this.props=e,this.context=t}function Za(e,t){if(null==t)return e.__?Za(e.__,e.__i+1):null;for(var n;tt&&$a.sort(La));tl.__r=0}function nl(e,t,n,i,r,o,s,a,l,c,p){var u,d,h,f,m,g=i&&i.__k||Va,y=t.length;for(n.__d=l,il(n,t,g),l=n.__d,u=0;u0?Xa(r.type,r.props,r.key,r.ref?r.ref:null,r.__v):r).__=e,r.__b=e.__b+1,o=null,-1!==(a=r.__i=ol(r,n,s,p))&&(p--,(o=n[a])&&(o.__u|=131072)),null==o||null===o.__v?(-1==a&&u--,"function"!=typeof r.type&&(r.__u|=65536)):a!==s&&(a==s-1?u--:a==s+1?u++:(a>s?u--:u++,r.__u|=65536))):r=e.__k[i]=null;if(p)for(i=0;i(null==l||131072&l.__u?0:1))for(;s>=0||a=0){if((l=t[s])&&!(131072&l.__u)&&r==l.key&&o===l.type)return s;s--}if(a=5&&((r||!e&&5===i)&&(s.push(i,0,r,n),i=6),e&&(s.push(i,e,0,n),i=6)),r=""},l=0;l"===t?(i=1,r=""):r=t+r[0]:o?t===o?o="":r+=t:'"'===t||"'"===t?o=t:">"===t?(a(),i=1):i&&("="===t?(i=5,n=r,r=""):"/"===t&&(i<5||">"===e[l][c+1])?(a(),3===i&&(s=s[0]),i=s,(s=s[0]).push(2,0,i),i=0):" "===t||"\t"===t||"\n"===t||"\r"===t?(a(),i=2):r+=t),3===i&&"!--"===r&&(i=4,s=s[0])}return a(),s}(e)),t),arguments,[])).length>1?t:t[0]}.bind(Qa),El=0,Ol=[],Pl=Ra,kl=Pl.__b,Sl=Pl.__r,Cl=Pl.diffed,Tl=Pl.__c,Al=Pl.unmount,Ml=Pl.__;function Dl(e,t){Pl.__h&&Pl.__h(bl,e,El||t),El=0;var n=bl.__H||(bl.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function Rl(e){return El=1,function(e,t,n){var i=Dl(vl++,2);if(i.t=e,!i.__c&&(i.__=[n?n(t):Ul(void 0,t),function(e){var t=i.__N?i.__N[0]:i.__[0],n=i.t(t,e);t!==n&&(i.__N=[n,i.__[1]],i.__c.setState({}))}],i.__c=bl,!bl.u)){var r=function(e,t,n){if(!i.__c.__H)return!0;var r=i.__c.__H.__.filter((function(e){return!!e.__c}));if(r.every((function(e){return!e.__N})))return!o||o.call(this,e,t,n);var s=i.__c.props!==e;return r.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(s=!0)}})),o&&o.call(this,e,t,n)||s};bl.u=!0;var o=bl.shouldComponentUpdate,s=bl.componentWillUpdate;bl.componentWillUpdate=function(e,t,n){if(this.__e){var i=o;o=void 0,r(e,t,n),o=i}s&&s.call(this,e,t,n)},bl.shouldComponentUpdate=r}return i.__N||i.__}(Ul,e)}function Nl(e,t){var n=Dl(vl++,3);!Pl.__s&&Hl(n.__H,t)&&(n.__=e,n.i=t,bl.__H.__h.push(n))}function $l(e,t){var n=Dl(vl++,4);!Pl.__s&&Hl(n.__H,t)&&(n.__=e,n.i=t,bl.__h.push(n))}function jl(e){return El=5,Il((function(){return{current:e}}),[])}function Il(e,t){var n=Dl(vl++,7);return Hl(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function Ll(e,t){return El=8,Il((function(){return e}),t)}function Bl(){for(var e;e=Ol.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Fl),e.__H.__h.forEach(Vl),e.__H.__h=[]}catch(t){e.__H.__h=[],Pl.__e(t,e.__v)}}Pl.__b=function(e){bl=null,kl&&kl(e)},Pl.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Ml&&Ml(e,t)},Pl.__r=function(e){Sl&&Sl(e),vl=0;var t=(bl=e.__c).__H;t&&(xl===bl?(t.__h=[],bl.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.i=e.__N=void 0}))):(t.__h.forEach(Fl),t.__h.forEach(Vl),t.__h=[],vl=0)),xl=bl},Pl.diffed=function(e){Cl&&Cl(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==Ol.push(t)&&wl===Pl.requestAnimationFrame||((wl=Pl.requestAnimationFrame)||zl)(Bl)),t.__H.__.forEach((function(e){e.i&&(e.__H=e.i),e.i=void 0}))),xl=bl=null},Pl.__c=function(e,t){t.some((function(e){try{e.__h.forEach(Fl),e.__h=e.__h.filter((function(e){return!e.__||Vl(e)}))}catch(n){t.some((function(e){e.__h&&(e.__h=[])})),t=[],Pl.__e(n,e.__v)}})),Tl&&Tl(e,t)},Pl.unmount=function(e){Al&&Al(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach((function(e){try{Fl(e)}catch(e){t=e}})),n.__H=void 0,t&&Pl.__e(t,n.__v))};var ql="function"==typeof requestAnimationFrame;function zl(e){var t,n=function(){clearTimeout(i),ql&&cancelAnimationFrame(t),setTimeout(e)},i=setTimeout(n,100);ql&&(t=requestAnimationFrame(n))}function Fl(e){var t=bl,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),bl=t}function Vl(e){var t=bl;e.__c=e.__(),bl=t}function Hl(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function Ul(e,t){return"function"==typeof t?t(e):t}function Wl(e){var t,n,i="";if("string"==typeof e||"number"==typeof e)i+=e;else if("object"==typeof e)if(Array.isArray(e)){var r=e.length;for(t=0;t {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar [chunkIds, fn, priority] = deferred[i];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","module.exports = require('./lib/axios');","'use strict';\n\nvar utils = require('./../utils');\nvar settle = require('./../core/settle');\nvar cookies = require('./../helpers/cookies');\nvar buildURL = require('./../helpers/buildURL');\nvar buildFullPath = require('../core/buildFullPath');\nvar parseHeaders = require('./../helpers/parseHeaders');\nvar isURLSameOrigin = require('./../helpers/isURLSameOrigin');\nvar createError = require('../core/createError');\n\nmodule.exports = function xhrAdapter(config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n var requestData = config.data;\n var requestHeaders = config.headers;\n var responseType = config.responseType;\n\n if (utils.isFormData(requestData)) {\n delete requestHeaders['Content-Type']; // Let the browser set it\n }\n\n var request = new XMLHttpRequest();\n\n // HTTP basic authentication\n if (config.auth) {\n var username = config.auth.username || '';\n var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';\n requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);\n }\n\n var fullPath = buildFullPath(config.baseURL, config.url);\n request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);\n\n // Set the request timeout in MS\n request.timeout = config.timeout;\n\n function onloadend() {\n if (!request) {\n return;\n }\n // Prepare the response\n var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;\n var responseData = !responseType || responseType === 'text' || responseType === 'json' ?\n request.responseText : request.response;\n var response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config: config,\n request: request\n };\n\n settle(resolve, reject, response);\n\n // Clean up request\n request = null;\n }\n\n if ('onloadend' in request) {\n // Use onloadend if available\n request.onloadend = onloadend;\n } else {\n // Listen for ready state to emulate onloadend\n request.onreadystatechange = function handleLoad() {\n if (!request || request.readyState !== 4) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n // readystate handler is calling before onerror or ontimeout handlers,\n // so we should call onloadend on the next 'tick'\n setTimeout(onloadend);\n };\n }\n\n // Handle browser request cancellation (as opposed to a manual cancellation)\n request.onabort = function handleAbort() {\n if (!request) {\n return;\n }\n\n reject(createError('Request aborted', config, 'ECONNABORTED', request));\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(createError('Network Error', config, null, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n var timeoutErrorMessage = 'timeout of ' + config.timeout + 'ms exceeded';\n if (config.timeoutErrorMessage) {\n timeoutErrorMessage = config.timeoutErrorMessage;\n }\n reject(createError(\n timeoutErrorMessage,\n config,\n config.transitional && config.transitional.clarifyTimeoutError ? 'ETIMEDOUT' : 'ECONNABORTED',\n request));\n\n // Clean up request\n request = null;\n };\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n if (utils.isStandardBrowserEnv()) {\n // Add xsrf header\n var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ?\n cookies.read(config.xsrfCookieName) :\n undefined;\n\n if (xsrfValue) {\n requestHeaders[config.xsrfHeaderName] = xsrfValue;\n }\n }\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders, function setRequestHeader(val, key) {\n if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {\n // Remove Content-Type if data is undefined\n delete requestHeaders[key];\n } else {\n // Otherwise add header to the request\n request.setRequestHeader(key, val);\n }\n });\n }\n\n // Add withCredentials to request if needed\n if (!utils.isUndefined(config.withCredentials)) {\n request.withCredentials = !!config.withCredentials;\n }\n\n // Add responseType to request if needed\n if (responseType && responseType !== 'json') {\n request.responseType = config.responseType;\n }\n\n // Handle progress if needed\n if (typeof config.onDownloadProgress === 'function') {\n request.addEventListener('progress', config.onDownloadProgress);\n }\n\n // Not all browsers support upload events\n if (typeof config.onUploadProgress === 'function' && request.upload) {\n request.upload.addEventListener('progress', config.onUploadProgress);\n }\n\n if (config.cancelToken) {\n // Handle cancellation\n config.cancelToken.promise.then(function onCanceled(cancel) {\n if (!request) {\n return;\n }\n\n request.abort();\n reject(cancel);\n // Clean up request\n request = null;\n });\n }\n\n if (!requestData) {\n requestData = null;\n }\n\n // Send the request\n request.send(requestData);\n });\n};\n","'use strict';\n\nvar utils = require('./utils');\nvar bind = require('./helpers/bind');\nvar Axios = require('./core/Axios');\nvar mergeConfig = require('./core/mergeConfig');\nvar defaults = require('./defaults');\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n * @return {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n var context = new Axios(defaultConfig);\n var instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context);\n\n // Copy context to instance\n utils.extend(instance, context);\n\n return instance;\n}\n\n// Create the default instance to be exported\nvar axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Factory for creating new instances\naxios.create = function create(instanceConfig) {\n return createInstance(mergeConfig(axios.defaults, instanceConfig));\n};\n\n// Expose Cancel & CancelToken\naxios.Cancel = require('./cancel/Cancel');\naxios.CancelToken = require('./cancel/CancelToken');\naxios.isCancel = require('./cancel/isCancel');\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\naxios.spread = require('./helpers/spread');\n\n// Expose isAxiosError\naxios.isAxiosError = require('./helpers/isAxiosError');\n\nmodule.exports = axios;\n\n// Allow use of default import syntax in TypeScript\nmodule.exports.default = axios;\n","'use strict';\n\n/**\n * A `Cancel` is an object that is thrown when an operation is canceled.\n *\n * @class\n * @param {string=} message The message.\n */\nfunction Cancel(message) {\n this.message = message;\n}\n\nCancel.prototype.toString = function toString() {\n return 'Cancel' + (this.message ? ': ' + this.message : '');\n};\n\nCancel.prototype.__CANCEL__ = true;\n\nmodule.exports = Cancel;\n","'use strict';\n\nvar Cancel = require('./Cancel');\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @class\n * @param {Function} executor The executor function.\n */\nfunction CancelToken(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n var resolvePromise;\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n var token = this;\n executor(function cancel(message) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new Cancel(message);\n resolvePromise(token.reason);\n });\n}\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nCancelToken.prototype.throwIfRequested = function throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n};\n\n/**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\nCancelToken.source = function source() {\n var cancel;\n var token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token: token,\n cancel: cancel\n };\n};\n\nmodule.exports = CancelToken;\n","'use strict';\n\nmodule.exports = function isCancel(value) {\n return !!(value && value.__CANCEL__);\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar buildURL = require('../helpers/buildURL');\nvar InterceptorManager = require('./InterceptorManager');\nvar dispatchRequest = require('./dispatchRequest');\nvar mergeConfig = require('./mergeConfig');\nvar validator = require('../helpers/validator');\n\nvar validators = validator.validators;\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n */\nfunction Axios(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n}\n\n/**\n * Dispatch a request\n *\n * @param {Object} config The config specific for this request (merged with this.defaults)\n */\nAxios.prototype.request = function request(config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof config === 'string') {\n config = arguments[1] || {};\n config.url = arguments[0];\n } else {\n config = config || {};\n }\n\n config = mergeConfig(this.defaults, config);\n\n // Set config.method\n if (config.method) {\n config.method = config.method.toLowerCase();\n } else if (this.defaults.method) {\n config.method = this.defaults.method.toLowerCase();\n } else {\n config.method = 'get';\n }\n\n var transitional = config.transitional;\n\n if (transitional !== undefined) {\n validator.assertOptions(transitional, {\n silentJSONParsing: validators.transitional(validators.boolean, '1.0.0'),\n forcedJSONParsing: validators.transitional(validators.boolean, '1.0.0'),\n clarifyTimeoutError: validators.transitional(validators.boolean, '1.0.0')\n }, false);\n }\n\n // filter out skipped interceptors\n var requestInterceptorChain = [];\n var synchronousRequestInterceptors = true;\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {\n return;\n }\n\n synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;\n\n requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n var responseInterceptorChain = [];\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n var promise;\n\n if (!synchronousRequestInterceptors) {\n var chain = [dispatchRequest, undefined];\n\n Array.prototype.unshift.apply(chain, requestInterceptorChain);\n chain = chain.concat(responseInterceptorChain);\n\n promise = Promise.resolve(config);\n while (chain.length) {\n promise = promise.then(chain.shift(), chain.shift());\n }\n\n return promise;\n }\n\n\n var newConfig = config;\n while (requestInterceptorChain.length) {\n var onFulfilled = requestInterceptorChain.shift();\n var onRejected = requestInterceptorChain.shift();\n try {\n newConfig = onFulfilled(newConfig);\n } catch (error) {\n onRejected(error);\n break;\n }\n }\n\n try {\n promise = dispatchRequest(newConfig);\n } catch (error) {\n return Promise.reject(error);\n }\n\n while (responseInterceptorChain.length) {\n promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift());\n }\n\n return promise;\n};\n\nAxios.prototype.getUri = function getUri(config) {\n config = mergeConfig(this.defaults, config);\n return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\\?/, '');\n};\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: (config || {}).data\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, data, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: data\n }));\n };\n});\n\nmodule.exports = Axios;\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction InterceptorManager() {\n this.handlers = [];\n}\n\n/**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\nInterceptorManager.prototype.use = function use(fulfilled, rejected, options) {\n this.handlers.push({\n fulfilled: fulfilled,\n rejected: rejected,\n synchronous: options ? options.synchronous : false,\n runWhen: options ? options.runWhen : null\n });\n return this.handlers.length - 1;\n};\n\n/**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n */\nInterceptorManager.prototype.eject = function eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n};\n\n/**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n */\nInterceptorManager.prototype.forEach = function forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n};\n\nmodule.exports = InterceptorManager;\n","'use strict';\n\nvar isAbsoluteURL = require('../helpers/isAbsoluteURL');\nvar combineURLs = require('../helpers/combineURLs');\n\n/**\n * Creates a new URL by combining the baseURL with the requestedURL,\n * only when the requestedURL is not already an absolute URL.\n * If the requestURL is absolute, this function returns the requestedURL untouched.\n *\n * @param {string} baseURL The base URL\n * @param {string} requestedURL Absolute or relative URL to combine\n * @returns {string} The combined full path\n */\nmodule.exports = function buildFullPath(baseURL, requestedURL) {\n if (baseURL && !isAbsoluteURL(requestedURL)) {\n return combineURLs(baseURL, requestedURL);\n }\n return requestedURL;\n};\n","'use strict';\n\nvar enhanceError = require('./enhanceError');\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The created error.\n */\nmodule.exports = function createError(message, config, code, request, response) {\n var error = new Error(message);\n return enhanceError(error, config, code, request, response);\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar transformData = require('./transformData');\nvar isCancel = require('../cancel/isCancel');\nvar defaults = require('../defaults');\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n * @returns {Promise} The Promise to be fulfilled\n */\nmodule.exports = function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n // Ensure headers exist\n config.headers = config.headers || {};\n\n // Transform request data\n config.data = transformData.call(\n config,\n config.data,\n config.headers,\n config.transformRequest\n );\n\n // Flatten headers\n config.headers = utils.merge(\n config.headers.common || {},\n config.headers[config.method] || {},\n config.headers\n );\n\n utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n function cleanHeaderConfig(method) {\n delete config.headers[method];\n }\n );\n\n var adapter = config.adapter || defaults.adapter;\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData.call(\n config,\n response.data,\n response.headers,\n config.transformResponse\n );\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData.call(\n config,\n reason.response.data,\n reason.response.headers,\n config.transformResponse\n );\n }\n }\n\n return Promise.reject(reason);\n });\n};\n","'use strict';\n\n/**\n * Update an Error with the specified config, error code, and response.\n *\n * @param {Error} error The error to update.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The error.\n */\nmodule.exports = function enhanceError(error, config, code, request, response) {\n error.config = config;\n if (code) {\n error.code = code;\n }\n\n error.request = request;\n error.response = response;\n error.isAxiosError = true;\n\n error.toJSON = function toJSON() {\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: this.config,\n code: this.code\n };\n };\n return error;\n};\n","'use strict';\n\nvar utils = require('../utils');\n\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n * @returns {Object} New object resulting from merging config2 to config1\n */\nmodule.exports = function mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config2 = config2 || {};\n var config = {};\n\n var valueFromConfig2Keys = ['url', 'method', 'data'];\n var mergeDeepPropertiesKeys = ['headers', 'auth', 'proxy', 'params'];\n var defaultToConfig2Keys = [\n 'baseURL', 'transformRequest', 'transformResponse', 'paramsSerializer',\n 'timeout', 'timeoutMessage', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName',\n 'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress', 'decompress',\n 'maxContentLength', 'maxBodyLength', 'maxRedirects', 'transport', 'httpAgent',\n 'httpsAgent', 'cancelToken', 'socketPath', 'responseEncoding'\n ];\n var directMergeKeys = ['validateStatus'];\n\n function getMergedValue(target, source) {\n if (utils.isPlainObject(target) && utils.isPlainObject(source)) {\n return utils.merge(target, source);\n } else if (utils.isPlainObject(source)) {\n return utils.merge({}, source);\n } else if (utils.isArray(source)) {\n return source.slice();\n }\n return source;\n }\n\n function mergeDeepProperties(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(config1[prop], config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n }\n\n utils.forEach(valueFromConfig2Keys, function valueFromConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(undefined, config2[prop]);\n }\n });\n\n utils.forEach(mergeDeepPropertiesKeys, mergeDeepProperties);\n\n utils.forEach(defaultToConfig2Keys, function defaultToConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(undefined, config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n });\n\n utils.forEach(directMergeKeys, function merge(prop) {\n if (prop in config2) {\n config[prop] = getMergedValue(config1[prop], config2[prop]);\n } else if (prop in config1) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n });\n\n var axiosKeys = valueFromConfig2Keys\n .concat(mergeDeepPropertiesKeys)\n .concat(defaultToConfig2Keys)\n .concat(directMergeKeys);\n\n var otherKeys = Object\n .keys(config1)\n .concat(Object.keys(config2))\n .filter(function filterAxiosKeys(key) {\n return axiosKeys.indexOf(key) === -1;\n });\n\n utils.forEach(otherKeys, mergeDeepProperties);\n\n return config;\n};\n","'use strict';\n\nvar createError = require('./createError');\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n */\nmodule.exports = function settle(resolve, reject, response) {\n var validateStatus = response.config.validateStatus;\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(createError(\n 'Request failed with status code ' + response.status,\n response.config,\n null,\n response.request,\n response\n ));\n }\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar defaults = require('./../defaults');\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Object|String} data The data to be transformed\n * @param {Array} headers The headers for the request or response\n * @param {Array|Function} fns A single function or Array of functions\n * @returns {*} The resulting transformed data\n */\nmodule.exports = function transformData(data, headers, fns) {\n var context = this || defaults;\n /*eslint no-param-reassign:0*/\n utils.forEach(fns, function transform(fn) {\n data = fn.call(context, data, headers);\n });\n\n return data;\n};\n","'use strict';\n\nvar utils = require('./utils');\nvar normalizeHeaderName = require('./helpers/normalizeHeaderName');\nvar enhanceError = require('./core/enhanceError');\n\nvar DEFAULT_CONTENT_TYPE = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n};\n\nfunction setContentTypeIfUnset(headers, value) {\n if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {\n headers['Content-Type'] = value;\n }\n}\n\nfunction getDefaultAdapter() {\n var adapter;\n if (typeof XMLHttpRequest !== 'undefined') {\n // For browsers use XHR adapter\n adapter = require('./adapters/xhr');\n } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {\n // For node use HTTP adapter\n adapter = require('./adapters/http');\n }\n return adapter;\n}\n\nfunction stringifySafely(rawValue, parser, encoder) {\n if (utils.isString(rawValue)) {\n try {\n (parser || JSON.parse)(rawValue);\n return utils.trim(rawValue);\n } catch (e) {\n if (e.name !== 'SyntaxError') {\n throw e;\n }\n }\n }\n\n return (encoder || JSON.stringify)(rawValue);\n}\n\nvar defaults = {\n\n transitional: {\n silentJSONParsing: true,\n forcedJSONParsing: true,\n clarifyTimeoutError: false\n },\n\n adapter: getDefaultAdapter(),\n\n transformRequest: [function transformRequest(data, headers) {\n normalizeHeaderName(headers, 'Accept');\n normalizeHeaderName(headers, 'Content-Type');\n\n if (utils.isFormData(data) ||\n utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');\n return data.toString();\n }\n if (utils.isObject(data) || (headers && headers['Content-Type'] === 'application/json')) {\n setContentTypeIfUnset(headers, 'application/json');\n return stringifySafely(data);\n }\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n var transitional = this.transitional;\n var silentJSONParsing = transitional && transitional.silentJSONParsing;\n var forcedJSONParsing = transitional && transitional.forcedJSONParsing;\n var strictJSONParsing = !silentJSONParsing && this.responseType === 'json';\n\n if (strictJSONParsing || (forcedJSONParsing && utils.isString(data) && data.length)) {\n try {\n return JSON.parse(data);\n } catch (e) {\n if (strictJSONParsing) {\n if (e.name === 'SyntaxError') {\n throw enhanceError(e, this, 'E_JSON_PARSE');\n }\n throw e;\n }\n }\n }\n\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n maxBodyLength: -1,\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n }\n};\n\ndefaults.headers = {\n common: {\n 'Accept': 'application/json, text/plain, */*'\n }\n};\n\nutils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {\n defaults.headers[method] = {};\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);\n});\n\nmodule.exports = defaults;\n","'use strict';\n\nmodule.exports = function bind(fn, thisArg) {\n return function wrap() {\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n return fn.apply(thisArg, args);\n };\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @returns {string} The formatted url\n */\nmodule.exports = function buildURL(url, params, paramsSerializer) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n\n var serializedParams;\n if (paramsSerializer) {\n serializedParams = paramsSerializer(params);\n } else if (utils.isURLSearchParams(params)) {\n serializedParams = params.toString();\n } else {\n var parts = [];\n\n utils.forEach(params, function serialize(val, key) {\n if (val === null || typeof val === 'undefined') {\n return;\n }\n\n if (utils.isArray(val)) {\n key = key + '[]';\n } else {\n val = [val];\n }\n\n utils.forEach(val, function parseValue(v) {\n if (utils.isDate(v)) {\n v = v.toISOString();\n } else if (utils.isObject(v)) {\n v = JSON.stringify(v);\n }\n parts.push(encode(key) + '=' + encode(v));\n });\n });\n\n serializedParams = parts.join('&');\n }\n\n if (serializedParams) {\n var hashmarkIndex = url.indexOf('#');\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n};\n","'use strict';\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n * @returns {string} The combined URL\n */\nmodule.exports = function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/+$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs support document.cookie\n (function standardBrowserEnv() {\n return {\n write: function write(name, value, expires, path, domain, secure) {\n var cookie = [];\n cookie.push(name + '=' + encodeURIComponent(value));\n\n if (utils.isNumber(expires)) {\n cookie.push('expires=' + new Date(expires).toGMTString());\n }\n\n if (utils.isString(path)) {\n cookie.push('path=' + path);\n }\n\n if (utils.isString(domain)) {\n cookie.push('domain=' + domain);\n }\n\n if (secure === true) {\n cookie.push('secure');\n }\n\n document.cookie = cookie.join('; ');\n },\n\n read: function read(name) {\n var match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove: function remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n };\n })() :\n\n // Non standard browser env (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return {\n write: function write() {},\n read: function read() { return null; },\n remove: function remove() {}\n };\n })()\n);\n","'use strict';\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nmodule.exports = function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d\\+\\-\\.]*:)?\\/\\//i.test(url);\n};\n","'use strict';\n\n/**\n * Determines whether the payload is an error thrown by Axios\n *\n * @param {*} payload The value to test\n * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false\n */\nmodule.exports = function isAxiosError(payload) {\n return (typeof payload === 'object') && (payload.isAxiosError === true);\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs have full support of the APIs needed to test\n // whether the request URL is of the same origin as current location.\n (function standardBrowserEnv() {\n var msie = /(msie|trident)/i.test(navigator.userAgent);\n var urlParsingNode = document.createElement('a');\n var originURL;\n\n /**\n * Parse a URL to discover it's components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\n function resolveURL(url) {\n var href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n urlParsingNode.pathname :\n '/' + urlParsingNode.pathname\n };\n }\n\n originURL = resolveURL(window.location.href);\n\n /**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestURL The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\n return function isURLSameOrigin(requestURL) {\n var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n return (parsed.protocol === originURL.protocol &&\n parsed.host === originURL.host);\n };\n })() :\n\n // Non standard browser envs (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return function isURLSameOrigin() {\n return true;\n };\n })()\n);\n","'use strict';\n\nvar utils = require('../utils');\n\nmodule.exports = function normalizeHeaderName(headers, normalizedName) {\n utils.forEach(headers, function processHeader(value, name) {\n if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {\n headers[normalizedName] = value;\n delete headers[name];\n }\n });\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\n// Headers whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nvar ignoreDuplicateOf = [\n 'age', 'authorization', 'content-length', 'content-type', 'etag',\n 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n 'referer', 'retry-after', 'user-agent'\n];\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} headers Headers needing to be parsed\n * @returns {Object} Headers parsed into an object\n */\nmodule.exports = function parseHeaders(headers) {\n var parsed = {};\n var key;\n var val;\n var i;\n\n if (!headers) { return parsed; }\n\n utils.forEach(headers.split('\\n'), function parser(line) {\n i = line.indexOf(':');\n key = utils.trim(line.substr(0, i)).toLowerCase();\n val = utils.trim(line.substr(i + 1));\n\n if (key) {\n if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {\n return;\n }\n if (key === 'set-cookie') {\n parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n }\n });\n\n return parsed;\n};\n","'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n * @returns {Function}\n */\nmodule.exports = function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n};\n","'use strict';\n\nvar pkg = require('./../../package.json');\n\nvar validators = {};\n\n// eslint-disable-next-line func-names\n['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach(function(type, i) {\n validators[type] = function validator(thing) {\n return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;\n };\n});\n\nvar deprecatedWarnings = {};\nvar currentVerArr = pkg.version.split('.');\n\n/**\n * Compare package versions\n * @param {string} version\n * @param {string?} thanVersion\n * @returns {boolean}\n */\nfunction isOlderVersion(version, thanVersion) {\n var pkgVersionArr = thanVersion ? thanVersion.split('.') : currentVerArr;\n var destVer = version.split('.');\n for (var i = 0; i < 3; i++) {\n if (pkgVersionArr[i] > destVer[i]) {\n return true;\n } else if (pkgVersionArr[i] < destVer[i]) {\n return false;\n }\n }\n return false;\n}\n\n/**\n * Transitional option validator\n * @param {function|boolean?} validator\n * @param {string?} version\n * @param {string} message\n * @returns {function}\n */\nvalidators.transitional = function transitional(validator, version, message) {\n var isDeprecated = version && isOlderVersion(version);\n\n function formatMessage(opt, desc) {\n return '[Axios v' + pkg.version + '] Transitional option \\'' + opt + '\\'' + desc + (message ? '. ' + message : '');\n }\n\n // eslint-disable-next-line func-names\n return function(value, opt, opts) {\n if (validator === false) {\n throw new Error(formatMessage(opt, ' has been removed in ' + version));\n }\n\n if (isDeprecated && !deprecatedWarnings[opt]) {\n deprecatedWarnings[opt] = true;\n // eslint-disable-next-line no-console\n console.warn(\n formatMessage(\n opt,\n ' has been deprecated since v' + version + ' and will be removed in the near future'\n )\n );\n }\n\n return validator ? validator(value, opt, opts) : true;\n };\n};\n\n/**\n * Assert object's properties type\n * @param {object} options\n * @param {object} schema\n * @param {boolean?} allowUnknown\n */\n\nfunction assertOptions(options, schema, allowUnknown) {\n if (typeof options !== 'object') {\n throw new TypeError('options must be an object');\n }\n var keys = Object.keys(options);\n var i = keys.length;\n while (i-- > 0) {\n var opt = keys[i];\n var validator = schema[opt];\n if (validator) {\n var value = options[opt];\n var result = value === undefined || validator(value, opt, options);\n if (result !== true) {\n throw new TypeError('option ' + opt + ' must be ' + result);\n }\n continue;\n }\n if (allowUnknown !== true) {\n throw Error('Unknown option ' + opt);\n }\n }\n}\n\nmodule.exports = {\n isOlderVersion: isOlderVersion,\n assertOptions: assertOptions,\n validators: validators\n};\n","'use strict';\n\nvar bind = require('./helpers/bind');\n\n// utils is a library of generic helper functions non-specific to axios\n\nvar toString = Object.prototype.toString;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Array, otherwise false\n */\nfunction isArray(val) {\n return toString.call(val) === '[object Array]';\n}\n\n/**\n * Determine if a value is undefined\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nfunction isUndefined(val) {\n return typeof val === 'undefined';\n}\n\n/**\n * Determine if a value is a Buffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Buffer, otherwise false\n */\nfunction isBuffer(val) {\n return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)\n && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nfunction isArrayBuffer(val) {\n return toString.call(val) === '[object ArrayBuffer]';\n}\n\n/**\n * Determine if a value is a FormData\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nfunction isFormData(val) {\n return (typeof FormData !== 'undefined') && (val instanceof FormData);\n}\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n var result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a String, otherwise false\n */\nfunction isString(val) {\n return typeof val === 'string';\n}\n\n/**\n * Determine if a value is a Number\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Number, otherwise false\n */\nfunction isNumber(val) {\n return typeof val === 'number';\n}\n\n/**\n * Determine if a value is an Object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Object, otherwise false\n */\nfunction isObject(val) {\n return val !== null && typeof val === 'object';\n}\n\n/**\n * Determine if a value is a plain Object\n *\n * @param {Object} val The value to test\n * @return {boolean} True if value is a plain Object, otherwise false\n */\nfunction isPlainObject(val) {\n if (toString.call(val) !== '[object Object]') {\n return false;\n }\n\n var prototype = Object.getPrototypeOf(val);\n return prototype === null || prototype === Object.prototype;\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Date, otherwise false\n */\nfunction isDate(val) {\n return toString.call(val) === '[object Date]';\n}\n\n/**\n * Determine if a value is a File\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a File, otherwise false\n */\nfunction isFile(val) {\n return toString.call(val) === '[object File]';\n}\n\n/**\n * Determine if a value is a Blob\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nfunction isBlob(val) {\n return toString.call(val) === '[object Blob]';\n}\n\n/**\n * Determine if a value is a Function\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nfunction isFunction(val) {\n return toString.call(val) === '[object Function]';\n}\n\n/**\n * Determine if a value is a Stream\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nfunction isStream(val) {\n return isObject(val) && isFunction(val.pipe);\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nfunction isURLSearchParams(val) {\n return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;\n}\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n * @returns {String} The String freed of excess whitespace\n */\nfunction trim(str) {\n return str.trim ? str.trim() : str.replace(/^\\s+|\\s+$/g, '');\n}\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n */\nfunction isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n */\nfunction forEach(obj, fn) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (var i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n fn.call(null, obj[key], key, obj);\n }\n }\n }\n}\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n var result = {};\n function assignValue(val, key) {\n if (isPlainObject(result[key]) && isPlainObject(val)) {\n result[key] = merge(result[key], val);\n } else if (isPlainObject(val)) {\n result[key] = merge({}, val);\n } else if (isArray(val)) {\n result[key] = val.slice();\n } else {\n result[key] = val;\n }\n }\n\n for (var i = 0, l = arguments.length; i < l; i++) {\n forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n * @return {Object} The resulting value of object a\n */\nfunction extend(a, b, thisArg) {\n forEach(b, function assignValue(val, key) {\n if (thisArg && typeof val === 'function') {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n });\n return a;\n}\n\n/**\n * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n *\n * @param {string} content with BOM\n * @return {string} content value without BOM\n */\nfunction stripBOM(content) {\n if (content.charCodeAt(0) === 0xFEFF) {\n content = content.slice(1);\n }\n return content;\n}\n\nmodule.exports = {\n isArray: isArray,\n isArrayBuffer: isArrayBuffer,\n isBuffer: isBuffer,\n isFormData: isFormData,\n isArrayBufferView: isArrayBufferView,\n isString: isString,\n isNumber: isNumber,\n isObject: isObject,\n isPlainObject: isPlainObject,\n isUndefined: isUndefined,\n isDate: isDate,\n isFile: isFile,\n isBlob: isBlob,\n isFunction: isFunction,\n isStream: isStream,\n isURLSearchParams: isURLSearchParams,\n isStandardBrowserEnv: isStandardBrowserEnv,\n forEach: forEach,\n merge: merge,\n extend: extend,\n trim: trim,\n stripBOM: stripBOM\n};\n","require('./bootstrap');\n\nwindow.BpmnModeler = require('camunda-bpmn-js/lib/camunda-platform/Modeler')\n\n$(document).ready(function () {\n\n $('[data-toggle=\"tooltip\"]').tooltip();\n //\n // const menuLinks = document.querySelectorAll('.sidebar-platform .sidebar-list li .parent-link');\n // const sidebarDiv = document.querySelector('.sidebar-platform');\n // menuLinks.forEach((link, index) => {\n // link.addEventListener('mouseover', (event) => {\n // const newLink = link.cloneNode(true);\n // newLink.classList.add('clone-link');\n // newLink.classList.add('clone-link' + index);\n // sidebarDiv.appendChild(newLink);\n // const posTop = link.getBoundingClientRect().top;\n // newLink.style.top = posTop + 'px';\n // });\n // link.addEventListener('mouseout', (event) => {\n // document.querySelector('.clone-link' + index).remove();\n // });\n // });\n // const sidebarTreeParents = document.querySelectorAll('.sidebar-platform .tree-content.tree-parent');\n // const appDiv = document.getElementById('app');\n // sidebarTreeParents.forEach(item => {\n // const treeToggleButton = item.previousElementSibling;\n // const newTitle = treeToggleButton.cloneNode(true);\n // newTitle.classList.add('clone-title');\n // item.appendChild(newTitle);\n // treeToggleButton.addEventListener('mouseover', (event) => {\n // const posTop = treeToggleButton.getBoundingClientRect().top;\n // const posBottom = Number(window.innerHeight - treeToggleButton.getBoundingClientRect().bottom);\n // item.style.top = null;\n // item.style.bottom = null;\n // item.style.maxHeight = null;\n // item.style.overflow = null;\n // if (!appDiv.classList.contains('menu-open')) {\n // if (posBottom < 250) {\n // item.style.bottom = posBottom + 'px';\n // item.style.maxHeight = `calc(100vh - ${posBottom}px)`;\n // } else {\n // item.style.top = posTop + 50 + 'px';\n // newTitle.style.top = posTop + 'px';\n // item.style.maxHeight = `calc(100vh - ${posTop + 50}px)`;\n // }\n // item.style.overflow = 'auto';\n // }\n // });\n // });\n //\n // const sidebarTreeParentsRemoveStyles = () => {\n // sidebarTreeParents.forEach(item => {\n // item.style.top = null;\n // item.style.bottom = null;\n // item.style.maxHeight = null;\n // item.style.overflow = null;\n // });\n // };\n\n const sidebarList = document.querySelectorAll('.sidebar-platform .sidebar-list .li-parent');\n const sidebarContent = document.querySelector('.sidebar-platform .sidebar-content');\n if(sidebarList.length){\n sidebarList.forEach((li, index) => {\n const nextLi = li.nextElementSibling;\n li.addEventListener('mouseover', () => {\n sidebarContent.style.overflow = 'visible';\n index === 0 ? li.style.top = '-50px' : li.style.top = `${index * 50}px`;\n });\n li.addEventListener('mouseout', () => {\n sidebarContent.style.overflow = null;\n li.style.top = null;\n })\n });\n }\n\n $('.tree-toggle').click(function () {\n if($('#app').hasClass('menu-open')){\n $(this).parent().children('ul.tree-content').slideToggle(200);\n $(this).toggleClass('active');\n }\n });\n\n $('.menu-trigger').click(function () {\n // sidebarTreeParentsRemoveStyles();\n axios.get('/ru/set_open_menu').then(resp => {\n console.log(resp.data);\n });\n if ($('#app').hasClass(\"menu-open\")) {\n $('#app').removeClass('menu-open');\n } else {\n $('#app').addClass('menu-open');\n }\n })\n\n $(\".filter-trigger\").on(\"click\", function (event) {\n event.stopPropagation();\n $(\"#filter_block\").slideToggle(200);\n $(this).toggleClass('active')\n });\n\n\n // save to localStorage history of redirected url\n // const locationPath = window.location.pathname + window.location.search;\n // const historyContent = document.querySelector('#history-urls');\n // const historyListEl = document.querySelector('#history-urls .history-list');\n // const clearButton = document.querySelector('#history-urls .clear-local-block');\n // const historyUrls = localStorage.getItem('historyUrls');\n //\n // function addEmpty() {\n // const span = document.createElement('span');\n // span.classList.add('no-history');\n // span.innerHTML = 'История пуста';\n // historyListEl.appendChild(span);\n // historyContent.classList.add('empty-list');\n // }\n //\n // function deleteChild() {\n // let child = historyListEl.lastElementChild;\n // while (child) {\n // historyListEl.removeChild(child);\n // child = historyListEl.lastElementChild;\n // }\n // }\n //\n // function textTimeFormatter(time, type) {\n // let text = '';\n // let lastNum = time;\n // if (time > 10) {\n // lastNum = Number(time.toString().split('')[1]);\n // }\n // if (type === 'sec') {\n // if (lastNum === 1) text = 'секунду';\n // if (lastNum > 1 && lastNum < 5) text = 'секунды';\n // if (lastNum >= 5 || lastNum === 0) text = 'секунд';\n // }\n // if (type === 'min') {\n // if (lastNum === 1) text = 'минуту';\n // if (lastNum > 1 && lastNum < 5) text = 'минуты';\n // if (lastNum >= 5 || lastNum === 0) text = 'минут';\n // }\n // if (type === 'hour') {\n // if (lastNum === 1) text = 'час';\n // if (lastNum > 1 && lastNum < 5) text = 'часа';\n // if (lastNum >= 5 || lastNum === 0) text = 'часов';\n // }\n // if (type === 'day') {\n // text = '1 дня';\n // }\n // return text;\n // }\n //\n // let historyUrlsArray = JSON.parse(historyUrls);\n // if (historyUrlsArray) {\n // historyContent.classList.remove('empty-list');\n // historyUrlsArray.forEach(item => {\n // let diffInDays = Math.floor((new Date() - new Date(item.date)) / 1000);\n // let timeType = '';\n // if (diffInDays < 60) {\n // timeType = 'sec';\n // } else if (diffInDays > 60 && diffInDays < 3600) {\n // diffInDays = Math.floor(diffInDays / 60);\n // timeType = 'min';\n // } else if (diffInDays > 3600 && diffInDays < 86400) {\n // diffInDays = Math.floor(diffInDays / 60 / 60);\n // timeType = 'hour';\n // } else {\n // timeType = 'day';\n // }\n // const timeTypeText = textTimeFormatter(diffInDays, timeType);\n // if (timeType === 'day') {\n // diffInDays = 'Более';\n // }\n // const a = document.createElement('a');\n // a.href = item.url;\n // a.innerHTML = `${item.url} ${item.dateString} ${diffInDays} ${timeTypeText} назад `;\n // historyListEl.prepend(a);\n // });\n // } else {\n // historyUrlsArray = [];\n // addEmpty();\n // }\n //\n // if (historyUrlsArray.length > 20) {\n // historyUrlsArray.pop();\n // }\n //\n // if (locationPath !== '/' && locationPath !== '/login' && locationPath !== '/register' && locationPath !== '/logout') {\n // historyUrlsArray.push({\n // url: locationPath,\n // date: new Date(),\n // dateString: new Date().toLocaleString()\n // });\n // }\n // localStorage.setItem('historyUrls', JSON.stringify(historyUrlsArray));\n //\n // clearButton.addEventListener('click', () => {\n // localStorage.setItem('historyUrls', null);\n // deleteChild();\n // addEmpty();\n // });\n // \n\n\n Waves.init();\n Waves.attach('.sidebar-list li a');\n Waves.attach('.sidebar-list li .tree-toggle');\n Waves.attach('.navbar-platform .item-nav');\n Waves.attach('.btn');\n $('[data-toggle=\"tooltip\"]').tooltip();\n});\n\n\n","window._ = require('lodash');\n\ntry {\n require('bootstrap');\n} catch (e) {}\n\n/**\n * We'll load the axios HTTP library which allows us to easily issue requests\n * to our Laravel back-end. This library automatically handles sending the\n * CSRF token as a header based on the value of the \"XSRF\" token cookie.\n */\n\nwindow.axios = require('axios');\n\nwindow.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';\n\n/**\n * Echo exposes an expressive API for subscribing to channels and listening\n * for events that are broadcast by Laravel. Echo and event broadcasting\n * allows your team to easily build robust real-time web applications.\n */\n\n// import Echo from 'laravel-echo';\n\n// window.Pusher = require('pusher-js');\n\n// window.Echo = new Echo({\n// broadcaster: 'pusher',\n// key: process.env.MIX_PUSHER_APP_KEY,\n// cluster: process.env.MIX_PUSHER_APP_CLUSTER,\n// forceTLS: true\n// });\n\nimport $ from 'jquery';\nwindow.$ = window.jQuery = $;\nrequire('select2');\n","export var top = 'top';\nexport var bottom = 'bottom';\nexport var right = 'right';\nexport var left = 'left';\nexport var auto = 'auto';\nexport var basePlacements = [top, bottom, right, left];\nexport var start = 'start';\nexport var end = 'end';\nexport var clippingParents = 'clippingParents';\nexport var viewport = 'viewport';\nexport var popper = 'popper';\nexport var reference = 'reference';\nexport var variationPlacements = /*#__PURE__*/basePlacements.reduce(function (acc, placement) {\n return acc.concat([placement + \"-\" + start, placement + \"-\" + end]);\n}, []);\nexport var placements = /*#__PURE__*/[].concat(basePlacements, [auto]).reduce(function (acc, placement) {\n return acc.concat([placement, placement + \"-\" + start, placement + \"-\" + end]);\n}, []); // modifiers that need to read the DOM\n\nexport var beforeRead = 'beforeRead';\nexport var read = 'read';\nexport var afterRead = 'afterRead'; // pure-logic modifiers\n\nexport var beforeMain = 'beforeMain';\nexport var main = 'main';\nexport var afterMain = 'afterMain'; // modifier with the purpose to write to the DOM (or write into a framework state)\n\nexport var beforeWrite = 'beforeWrite';\nexport var write = 'write';\nexport var afterWrite = 'afterWrite';\nexport var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite];","export default function getNodeName(element) {\n return element ? (element.nodeName || '').toLowerCase() : null;\n}","export default function getWindow(node) {\n if (node == null) {\n return window;\n }\n\n if (node.toString() !== '[object Window]') {\n var ownerDocument = node.ownerDocument;\n return ownerDocument ? ownerDocument.defaultView || window : window;\n }\n\n return node;\n}","import getWindow from \"./getWindow.js\";\n\nfunction isElement(node) {\n var OwnElement = getWindow(node).Element;\n return node instanceof OwnElement || node instanceof Element;\n}\n\nfunction isHTMLElement(node) {\n var OwnElement = getWindow(node).HTMLElement;\n return node instanceof OwnElement || node instanceof HTMLElement;\n}\n\nfunction isShadowRoot(node) {\n // IE 11 has no ShadowRoot\n if (typeof ShadowRoot === 'undefined') {\n return false;\n }\n\n var OwnElement = getWindow(node).ShadowRoot;\n return node instanceof OwnElement || node instanceof ShadowRoot;\n}\n\nexport { isElement, isHTMLElement, isShadowRoot };","import getNodeName from \"../dom-utils/getNodeName.js\";\nimport { isHTMLElement } from \"../dom-utils/instanceOf.js\"; // This modifier takes the styles prepared by the `computeStyles` modifier\n// and applies them to the HTMLElements such as popper and arrow\n\nfunction applyStyles(_ref) {\n var state = _ref.state;\n Object.keys(state.elements).forEach(function (name) {\n var style = state.styles[name] || {};\n var attributes = state.attributes[name] || {};\n var element = state.elements[name]; // arrow is optional + virtual elements\n\n if (!isHTMLElement(element) || !getNodeName(element)) {\n return;\n } // Flow doesn't support to extend this property, but it's the most\n // effective way to apply styles to an HTMLElement\n // $FlowFixMe[cannot-write]\n\n\n Object.assign(element.style, style);\n Object.keys(attributes).forEach(function (name) {\n var value = attributes[name];\n\n if (value === false) {\n element.removeAttribute(name);\n } else {\n element.setAttribute(name, value === true ? '' : value);\n }\n });\n });\n}\n\nfunction effect(_ref2) {\n var state = _ref2.state;\n var initialStyles = {\n popper: {\n position: state.options.strategy,\n left: '0',\n top: '0',\n margin: '0'\n },\n arrow: {\n position: 'absolute'\n },\n reference: {}\n };\n Object.assign(state.elements.popper.style, initialStyles.popper);\n state.styles = initialStyles;\n\n if (state.elements.arrow) {\n Object.assign(state.elements.arrow.style, initialStyles.arrow);\n }\n\n return function () {\n Object.keys(state.elements).forEach(function (name) {\n var element = state.elements[name];\n var attributes = state.attributes[name] || {};\n var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]); // Set all values to an empty string to unset them\n\n var style = styleProperties.reduce(function (style, property) {\n style[property] = '';\n return style;\n }, {}); // arrow is optional + virtual elements\n\n if (!isHTMLElement(element) || !getNodeName(element)) {\n return;\n }\n\n Object.assign(element.style, style);\n Object.keys(attributes).forEach(function (attribute) {\n element.removeAttribute(attribute);\n });\n });\n };\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'applyStyles',\n enabled: true,\n phase: 'write',\n fn: applyStyles,\n effect: effect,\n requires: ['computeStyles']\n};","import { auto } from \"../enums.js\";\nexport default function getBasePlacement(placement) {\n return placement.split('-')[0];\n}","export var max = Math.max;\nexport var min = Math.min;\nexport var round = Math.round;","export default function getUAString() {\n var uaData = navigator.userAgentData;\n\n if (uaData != null && uaData.brands && Array.isArray(uaData.brands)) {\n return uaData.brands.map(function (item) {\n return item.brand + \"/\" + item.version;\n }).join(' ');\n }\n\n return navigator.userAgent;\n}","import getUAString from \"../utils/userAgent.js\";\nexport default function isLayoutViewport() {\n return !/^((?!chrome|android).)*safari/i.test(getUAString());\n}","import { isElement, isHTMLElement } from \"./instanceOf.js\";\nimport { round } from \"../utils/math.js\";\nimport getWindow from \"./getWindow.js\";\nimport isLayoutViewport from \"./isLayoutViewport.js\";\nexport default function getBoundingClientRect(element, includeScale, isFixedStrategy) {\n if (includeScale === void 0) {\n includeScale = false;\n }\n\n if (isFixedStrategy === void 0) {\n isFixedStrategy = false;\n }\n\n var clientRect = element.getBoundingClientRect();\n var scaleX = 1;\n var scaleY = 1;\n\n if (includeScale && isHTMLElement(element)) {\n scaleX = element.offsetWidth > 0 ? round(clientRect.width) / element.offsetWidth || 1 : 1;\n scaleY = element.offsetHeight > 0 ? round(clientRect.height) / element.offsetHeight || 1 : 1;\n }\n\n var _ref = isElement(element) ? getWindow(element) : window,\n visualViewport = _ref.visualViewport;\n\n var addVisualOffsets = !isLayoutViewport() && isFixedStrategy;\n var x = (clientRect.left + (addVisualOffsets && visualViewport ? visualViewport.offsetLeft : 0)) / scaleX;\n var y = (clientRect.top + (addVisualOffsets && visualViewport ? visualViewport.offsetTop : 0)) / scaleY;\n var width = clientRect.width / scaleX;\n var height = clientRect.height / scaleY;\n return {\n width: width,\n height: height,\n top: y,\n right: x + width,\n bottom: y + height,\n left: x,\n x: x,\n y: y\n };\n}","import getBoundingClientRect from \"./getBoundingClientRect.js\"; // Returns the layout rect of an element relative to its offsetParent. Layout\n// means it doesn't take into account transforms.\n\nexport default function getLayoutRect(element) {\n var clientRect = getBoundingClientRect(element); // Use the clientRect sizes if it's not been transformed.\n // Fixes https://github.com/popperjs/popper-core/issues/1223\n\n var width = element.offsetWidth;\n var height = element.offsetHeight;\n\n if (Math.abs(clientRect.width - width) <= 1) {\n width = clientRect.width;\n }\n\n if (Math.abs(clientRect.height - height) <= 1) {\n height = clientRect.height;\n }\n\n return {\n x: element.offsetLeft,\n y: element.offsetTop,\n width: width,\n height: height\n };\n}","import { isShadowRoot } from \"./instanceOf.js\";\nexport default function contains(parent, child) {\n var rootNode = child.getRootNode && child.getRootNode(); // First, attempt with faster native method\n\n if (parent.contains(child)) {\n return true;\n } // then fallback to custom implementation with Shadow DOM support\n else if (rootNode && isShadowRoot(rootNode)) {\n var next = child;\n\n do {\n if (next && parent.isSameNode(next)) {\n return true;\n } // $FlowFixMe[prop-missing]: need a better way to handle this...\n\n\n next = next.parentNode || next.host;\n } while (next);\n } // Give up, the result is false\n\n\n return false;\n}","import getWindow from \"./getWindow.js\";\nexport default function getComputedStyle(element) {\n return getWindow(element).getComputedStyle(element);\n}","import getNodeName from \"./getNodeName.js\";\nexport default function isTableElement(element) {\n return ['table', 'td', 'th'].indexOf(getNodeName(element)) >= 0;\n}","import { isElement } from \"./instanceOf.js\";\nexport default function getDocumentElement(element) {\n // $FlowFixMe[incompatible-return]: assume body is always available\n return ((isElement(element) ? element.ownerDocument : // $FlowFixMe[prop-missing]\n element.document) || window.document).documentElement;\n}","import getNodeName from \"./getNodeName.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport { isShadowRoot } from \"./instanceOf.js\";\nexport default function getParentNode(element) {\n if (getNodeName(element) === 'html') {\n return element;\n }\n\n return (// this is a quicker (but less type safe) way to save quite some bytes from the bundle\n // $FlowFixMe[incompatible-return]\n // $FlowFixMe[prop-missing]\n element.assignedSlot || // step into the shadow DOM of the parent of a slotted node\n element.parentNode || ( // DOM Element detected\n isShadowRoot(element) ? element.host : null) || // ShadowRoot detected\n // $FlowFixMe[incompatible-call]: HTMLElement is a Node\n getDocumentElement(element) // fallback\n\n );\n}","import getWindow from \"./getWindow.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport getComputedStyle from \"./getComputedStyle.js\";\nimport { isHTMLElement, isShadowRoot } from \"./instanceOf.js\";\nimport isTableElement from \"./isTableElement.js\";\nimport getParentNode from \"./getParentNode.js\";\nimport getUAString from \"../utils/userAgent.js\";\n\nfunction getTrueOffsetParent(element) {\n if (!isHTMLElement(element) || // https://github.com/popperjs/popper-core/issues/837\n getComputedStyle(element).position === 'fixed') {\n return null;\n }\n\n return element.offsetParent;\n} // `.offsetParent` reports `null` for fixed elements, while absolute elements\n// return the containing block\n\n\nfunction getContainingBlock(element) {\n var isFirefox = /firefox/i.test(getUAString());\n var isIE = /Trident/i.test(getUAString());\n\n if (isIE && isHTMLElement(element)) {\n // In IE 9, 10 and 11 fixed elements containing block is always established by the viewport\n var elementCss = getComputedStyle(element);\n\n if (elementCss.position === 'fixed') {\n return null;\n }\n }\n\n var currentNode = getParentNode(element);\n\n if (isShadowRoot(currentNode)) {\n currentNode = currentNode.host;\n }\n\n while (isHTMLElement(currentNode) && ['html', 'body'].indexOf(getNodeName(currentNode)) < 0) {\n var css = getComputedStyle(currentNode); // This is non-exhaustive but covers the most common CSS properties that\n // create a containing block.\n // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n\n if (css.transform !== 'none' || css.perspective !== 'none' || css.contain === 'paint' || ['transform', 'perspective'].indexOf(css.willChange) !== -1 || isFirefox && css.willChange === 'filter' || isFirefox && css.filter && css.filter !== 'none') {\n return currentNode;\n } else {\n currentNode = currentNode.parentNode;\n }\n }\n\n return null;\n} // Gets the closest ancestor positioned element. Handles some edge cases,\n// such as table ancestors and cross browser bugs.\n\n\nexport default function getOffsetParent(element) {\n var window = getWindow(element);\n var offsetParent = getTrueOffsetParent(element);\n\n while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === 'static') {\n offsetParent = getTrueOffsetParent(offsetParent);\n }\n\n if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle(offsetParent).position === 'static')) {\n return window;\n }\n\n return offsetParent || getContainingBlock(element) || window;\n}","export default function getMainAxisFromPlacement(placement) {\n return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y';\n}","import { max as mathMax, min as mathMin } from \"./math.js\";\nexport function within(min, value, max) {\n return mathMax(min, mathMin(value, max));\n}\nexport function withinMaxClamp(min, value, max) {\n var v = within(min, value, max);\n return v > max ? max : v;\n}","import getFreshSideObject from \"./getFreshSideObject.js\";\nexport default function mergePaddingObject(paddingObject) {\n return Object.assign({}, getFreshSideObject(), paddingObject);\n}","export default function getFreshSideObject() {\n return {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0\n };\n}","export default function expandToHashMap(value, keys) {\n return keys.reduce(function (hashMap, key) {\n hashMap[key] = value;\n return hashMap;\n }, {});\n}","import getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getLayoutRect from \"../dom-utils/getLayoutRect.js\";\nimport contains from \"../dom-utils/contains.js\";\nimport getOffsetParent from \"../dom-utils/getOffsetParent.js\";\nimport getMainAxisFromPlacement from \"../utils/getMainAxisFromPlacement.js\";\nimport { within } from \"../utils/within.js\";\nimport mergePaddingObject from \"../utils/mergePaddingObject.js\";\nimport expandToHashMap from \"../utils/expandToHashMap.js\";\nimport { left, right, basePlacements, top, bottom } from \"../enums.js\"; // eslint-disable-next-line import/no-unused-modules\n\nvar toPaddingObject = function toPaddingObject(padding, state) {\n padding = typeof padding === 'function' ? padding(Object.assign({}, state.rects, {\n placement: state.placement\n })) : padding;\n return mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));\n};\n\nfunction arrow(_ref) {\n var _state$modifiersData$;\n\n var state = _ref.state,\n name = _ref.name,\n options = _ref.options;\n var arrowElement = state.elements.arrow;\n var popperOffsets = state.modifiersData.popperOffsets;\n var basePlacement = getBasePlacement(state.placement);\n var axis = getMainAxisFromPlacement(basePlacement);\n var isVertical = [left, right].indexOf(basePlacement) >= 0;\n var len = isVertical ? 'height' : 'width';\n\n if (!arrowElement || !popperOffsets) {\n return;\n }\n\n var paddingObject = toPaddingObject(options.padding, state);\n var arrowRect = getLayoutRect(arrowElement);\n var minProp = axis === 'y' ? top : left;\n var maxProp = axis === 'y' ? bottom : right;\n var endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets[axis] - state.rects.popper[len];\n var startDiff = popperOffsets[axis] - state.rects.reference[axis];\n var arrowOffsetParent = getOffsetParent(arrowElement);\n var clientSize = arrowOffsetParent ? axis === 'y' ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0;\n var centerToReference = endDiff / 2 - startDiff / 2; // Make sure the arrow doesn't overflow the popper if the center point is\n // outside of the popper bounds\n\n var min = paddingObject[minProp];\n var max = clientSize - arrowRect[len] - paddingObject[maxProp];\n var center = clientSize / 2 - arrowRect[len] / 2 + centerToReference;\n var offset = within(min, center, max); // Prevents breaking syntax highlighting...\n\n var axisProp = axis;\n state.modifiersData[name] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset, _state$modifiersData$.centerOffset = offset - center, _state$modifiersData$);\n}\n\nfunction effect(_ref2) {\n var state = _ref2.state,\n options = _ref2.options;\n var _options$element = options.element,\n arrowElement = _options$element === void 0 ? '[data-popper-arrow]' : _options$element;\n\n if (arrowElement == null) {\n return;\n } // CSS selector\n\n\n if (typeof arrowElement === 'string') {\n arrowElement = state.elements.popper.querySelector(arrowElement);\n\n if (!arrowElement) {\n return;\n }\n }\n\n if (!contains(state.elements.popper, arrowElement)) {\n return;\n }\n\n state.elements.arrow = arrowElement;\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'arrow',\n enabled: true,\n phase: 'main',\n fn: arrow,\n effect: effect,\n requires: ['popperOffsets'],\n requiresIfExists: ['preventOverflow']\n};","export default function getVariation(placement) {\n return placement.split('-')[1];\n}","import { top, left, right, bottom, end } from \"../enums.js\";\nimport getOffsetParent from \"../dom-utils/getOffsetParent.js\";\nimport getWindow from \"../dom-utils/getWindow.js\";\nimport getDocumentElement from \"../dom-utils/getDocumentElement.js\";\nimport getComputedStyle from \"../dom-utils/getComputedStyle.js\";\nimport getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getVariation from \"../utils/getVariation.js\";\nimport { round } from \"../utils/math.js\"; // eslint-disable-next-line import/no-unused-modules\n\nvar unsetSides = {\n top: 'auto',\n right: 'auto',\n bottom: 'auto',\n left: 'auto'\n}; // Round the offsets to the nearest suitable subpixel based on the DPR.\n// Zooming can change the DPR, but it seems to report a value that will\n// cleanly divide the values into the appropriate subpixels.\n\nfunction roundOffsetsByDPR(_ref, win) {\n var x = _ref.x,\n y = _ref.y;\n var dpr = win.devicePixelRatio || 1;\n return {\n x: round(x * dpr) / dpr || 0,\n y: round(y * dpr) / dpr || 0\n };\n}\n\nexport function mapToStyles(_ref2) {\n var _Object$assign2;\n\n var popper = _ref2.popper,\n popperRect = _ref2.popperRect,\n placement = _ref2.placement,\n variation = _ref2.variation,\n offsets = _ref2.offsets,\n position = _ref2.position,\n gpuAcceleration = _ref2.gpuAcceleration,\n adaptive = _ref2.adaptive,\n roundOffsets = _ref2.roundOffsets,\n isFixed = _ref2.isFixed;\n var _offsets$x = offsets.x,\n x = _offsets$x === void 0 ? 0 : _offsets$x,\n _offsets$y = offsets.y,\n y = _offsets$y === void 0 ? 0 : _offsets$y;\n\n var _ref3 = typeof roundOffsets === 'function' ? roundOffsets({\n x: x,\n y: y\n }) : {\n x: x,\n y: y\n };\n\n x = _ref3.x;\n y = _ref3.y;\n var hasX = offsets.hasOwnProperty('x');\n var hasY = offsets.hasOwnProperty('y');\n var sideX = left;\n var sideY = top;\n var win = window;\n\n if (adaptive) {\n var offsetParent = getOffsetParent(popper);\n var heightProp = 'clientHeight';\n var widthProp = 'clientWidth';\n\n if (offsetParent === getWindow(popper)) {\n offsetParent = getDocumentElement(popper);\n\n if (getComputedStyle(offsetParent).position !== 'static' && position === 'absolute') {\n heightProp = 'scrollHeight';\n widthProp = 'scrollWidth';\n }\n } // $FlowFixMe[incompatible-cast]: force type refinement, we compare offsetParent with window above, but Flow doesn't detect it\n\n\n offsetParent = offsetParent;\n\n if (placement === top || (placement === left || placement === right) && variation === end) {\n sideY = bottom;\n var offsetY = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.height : // $FlowFixMe[prop-missing]\n offsetParent[heightProp];\n y -= offsetY - popperRect.height;\n y *= gpuAcceleration ? 1 : -1;\n }\n\n if (placement === left || (placement === top || placement === bottom) && variation === end) {\n sideX = right;\n var offsetX = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.width : // $FlowFixMe[prop-missing]\n offsetParent[widthProp];\n x -= offsetX - popperRect.width;\n x *= gpuAcceleration ? 1 : -1;\n }\n }\n\n var commonStyles = Object.assign({\n position: position\n }, adaptive && unsetSides);\n\n var _ref4 = roundOffsets === true ? roundOffsetsByDPR({\n x: x,\n y: y\n }, getWindow(popper)) : {\n x: x,\n y: y\n };\n\n x = _ref4.x;\n y = _ref4.y;\n\n if (gpuAcceleration) {\n var _Object$assign;\n\n return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? '0' : '', _Object$assign[sideX] = hasX ? '0' : '', _Object$assign.transform = (win.devicePixelRatio || 1) <= 1 ? \"translate(\" + x + \"px, \" + y + \"px)\" : \"translate3d(\" + x + \"px, \" + y + \"px, 0)\", _Object$assign));\n }\n\n return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + \"px\" : '', _Object$assign2[sideX] = hasX ? x + \"px\" : '', _Object$assign2.transform = '', _Object$assign2));\n}\n\nfunction computeStyles(_ref5) {\n var state = _ref5.state,\n options = _ref5.options;\n var _options$gpuAccelerat = options.gpuAcceleration,\n gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat,\n _options$adaptive = options.adaptive,\n adaptive = _options$adaptive === void 0 ? true : _options$adaptive,\n _options$roundOffsets = options.roundOffsets,\n roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets;\n var commonStyles = {\n placement: getBasePlacement(state.placement),\n variation: getVariation(state.placement),\n popper: state.elements.popper,\n popperRect: state.rects.popper,\n gpuAcceleration: gpuAcceleration,\n isFixed: state.options.strategy === 'fixed'\n };\n\n if (state.modifiersData.popperOffsets != null) {\n state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, {\n offsets: state.modifiersData.popperOffsets,\n position: state.options.strategy,\n adaptive: adaptive,\n roundOffsets: roundOffsets\n })));\n }\n\n if (state.modifiersData.arrow != null) {\n state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, {\n offsets: state.modifiersData.arrow,\n position: 'absolute',\n adaptive: false,\n roundOffsets: roundOffsets\n })));\n }\n\n state.attributes.popper = Object.assign({}, state.attributes.popper, {\n 'data-popper-placement': state.placement\n });\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'computeStyles',\n enabled: true,\n phase: 'beforeWrite',\n fn: computeStyles,\n data: {}\n};","import getWindow from \"../dom-utils/getWindow.js\"; // eslint-disable-next-line import/no-unused-modules\n\nvar passive = {\n passive: true\n};\n\nfunction effect(_ref) {\n var state = _ref.state,\n instance = _ref.instance,\n options = _ref.options;\n var _options$scroll = options.scroll,\n scroll = _options$scroll === void 0 ? true : _options$scroll,\n _options$resize = options.resize,\n resize = _options$resize === void 0 ? true : _options$resize;\n var window = getWindow(state.elements.popper);\n var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper);\n\n if (scroll) {\n scrollParents.forEach(function (scrollParent) {\n scrollParent.addEventListener('scroll', instance.update, passive);\n });\n }\n\n if (resize) {\n window.addEventListener('resize', instance.update, passive);\n }\n\n return function () {\n if (scroll) {\n scrollParents.forEach(function (scrollParent) {\n scrollParent.removeEventListener('scroll', instance.update, passive);\n });\n }\n\n if (resize) {\n window.removeEventListener('resize', instance.update, passive);\n }\n };\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'eventListeners',\n enabled: true,\n phase: 'write',\n fn: function fn() {},\n effect: effect,\n data: {}\n};","var hash = {\n left: 'right',\n right: 'left',\n bottom: 'top',\n top: 'bottom'\n};\nexport default function getOppositePlacement(placement) {\n return placement.replace(/left|right|bottom|top/g, function (matched) {\n return hash[matched];\n });\n}","var hash = {\n start: 'end',\n end: 'start'\n};\nexport default function getOppositeVariationPlacement(placement) {\n return placement.replace(/start|end/g, function (matched) {\n return hash[matched];\n });\n}","import getWindow from \"./getWindow.js\";\nexport default function getWindowScroll(node) {\n var win = getWindow(node);\n var scrollLeft = win.pageXOffset;\n var scrollTop = win.pageYOffset;\n return {\n scrollLeft: scrollLeft,\n scrollTop: scrollTop\n };\n}","import getBoundingClientRect from \"./getBoundingClientRect.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport getWindowScroll from \"./getWindowScroll.js\";\nexport default function getWindowScrollBarX(element) {\n // If has a CSS width greater than the viewport, then this will be\n // incorrect for RTL.\n // Popper 1 is broken in this case and never had a bug report so let's assume\n // it's not an issue. I don't think anyone ever specifies width on \n // anyway.\n // Browsers where the left scrollbar doesn't cause an issue report `0` for\n // this (e.g. Edge 2019, IE11, Safari)\n return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft;\n}","import getComputedStyle from \"./getComputedStyle.js\";\nexport default function isScrollParent(element) {\n // Firefox wants us to check `-x` and `-y` variations as well\n var _getComputedStyle = getComputedStyle(element),\n overflow = _getComputedStyle.overflow,\n overflowX = _getComputedStyle.overflowX,\n overflowY = _getComputedStyle.overflowY;\n\n return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);\n}","import getParentNode from \"./getParentNode.js\";\nimport isScrollParent from \"./isScrollParent.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport { isHTMLElement } from \"./instanceOf.js\";\nexport default function getScrollParent(node) {\n if (['html', 'body', '#document'].indexOf(getNodeName(node)) >= 0) {\n // $FlowFixMe[incompatible-return]: assume body is always available\n return node.ownerDocument.body;\n }\n\n if (isHTMLElement(node) && isScrollParent(node)) {\n return node;\n }\n\n return getScrollParent(getParentNode(node));\n}","import getScrollParent from \"./getScrollParent.js\";\nimport getParentNode from \"./getParentNode.js\";\nimport getWindow from \"./getWindow.js\";\nimport isScrollParent from \"./isScrollParent.js\";\n/*\ngiven a DOM element, return the list of all scroll parents, up the list of ancesors\nuntil we get to the top window object. This list is what we attach scroll listeners\nto, because if any of these parent elements scroll, we'll need to re-calculate the\nreference element's position.\n*/\n\nexport default function listScrollParents(element, list) {\n var _element$ownerDocumen;\n\n if (list === void 0) {\n list = [];\n }\n\n var scrollParent = getScrollParent(element);\n var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body);\n var win = getWindow(scrollParent);\n var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent;\n var updatedList = list.concat(target);\n return isBody ? updatedList : // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here\n updatedList.concat(listScrollParents(getParentNode(target)));\n}","export default function rectToClientRect(rect) {\n return Object.assign({}, rect, {\n left: rect.x,\n top: rect.y,\n right: rect.x + rect.width,\n bottom: rect.y + rect.height\n });\n}","import { viewport } from \"../enums.js\";\nimport getViewportRect from \"./getViewportRect.js\";\nimport getDocumentRect from \"./getDocumentRect.js\";\nimport listScrollParents from \"./listScrollParents.js\";\nimport getOffsetParent from \"./getOffsetParent.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport getComputedStyle from \"./getComputedStyle.js\";\nimport { isElement, isHTMLElement } from \"./instanceOf.js\";\nimport getBoundingClientRect from \"./getBoundingClientRect.js\";\nimport getParentNode from \"./getParentNode.js\";\nimport contains from \"./contains.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport rectToClientRect from \"../utils/rectToClientRect.js\";\nimport { max, min } from \"../utils/math.js\";\n\nfunction getInnerBoundingClientRect(element, strategy) {\n var rect = getBoundingClientRect(element, false, strategy === 'fixed');\n rect.top = rect.top + element.clientTop;\n rect.left = rect.left + element.clientLeft;\n rect.bottom = rect.top + element.clientHeight;\n rect.right = rect.left + element.clientWidth;\n rect.width = element.clientWidth;\n rect.height = element.clientHeight;\n rect.x = rect.left;\n rect.y = rect.top;\n return rect;\n}\n\nfunction getClientRectFromMixedType(element, clippingParent, strategy) {\n return clippingParent === viewport ? rectToClientRect(getViewportRect(element, strategy)) : isElement(clippingParent) ? getInnerBoundingClientRect(clippingParent, strategy) : rectToClientRect(getDocumentRect(getDocumentElement(element)));\n} // A \"clipping parent\" is an overflowable container with the characteristic of\n// clipping (or hiding) overflowing elements with a position different from\n// `initial`\n\n\nfunction getClippingParents(element) {\n var clippingParents = listScrollParents(getParentNode(element));\n var canEscapeClipping = ['absolute', 'fixed'].indexOf(getComputedStyle(element).position) >= 0;\n var clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element;\n\n if (!isElement(clipperElement)) {\n return [];\n } // $FlowFixMe[incompatible-return]: https://github.com/facebook/flow/issues/1414\n\n\n return clippingParents.filter(function (clippingParent) {\n return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body';\n });\n} // Gets the maximum area that the element is visible in due to any number of\n// clipping parents\n\n\nexport default function getClippingRect(element, boundary, rootBoundary, strategy) {\n var mainClippingParents = boundary === 'clippingParents' ? getClippingParents(element) : [].concat(boundary);\n var clippingParents = [].concat(mainClippingParents, [rootBoundary]);\n var firstClippingParent = clippingParents[0];\n var clippingRect = clippingParents.reduce(function (accRect, clippingParent) {\n var rect = getClientRectFromMixedType(element, clippingParent, strategy);\n accRect.top = max(rect.top, accRect.top);\n accRect.right = min(rect.right, accRect.right);\n accRect.bottom = min(rect.bottom, accRect.bottom);\n accRect.left = max(rect.left, accRect.left);\n return accRect;\n }, getClientRectFromMixedType(element, firstClippingParent, strategy));\n clippingRect.width = clippingRect.right - clippingRect.left;\n clippingRect.height = clippingRect.bottom - clippingRect.top;\n clippingRect.x = clippingRect.left;\n clippingRect.y = clippingRect.top;\n return clippingRect;\n}","import getWindow from \"./getWindow.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport getWindowScrollBarX from \"./getWindowScrollBarX.js\";\nimport isLayoutViewport from \"./isLayoutViewport.js\";\nexport default function getViewportRect(element, strategy) {\n var win = getWindow(element);\n var html = getDocumentElement(element);\n var visualViewport = win.visualViewport;\n var width = html.clientWidth;\n var height = html.clientHeight;\n var x = 0;\n var y = 0;\n\n if (visualViewport) {\n width = visualViewport.width;\n height = visualViewport.height;\n var layoutViewport = isLayoutViewport();\n\n if (layoutViewport || !layoutViewport && strategy === 'fixed') {\n x = visualViewport.offsetLeft;\n y = visualViewport.offsetTop;\n }\n }\n\n return {\n width: width,\n height: height,\n x: x + getWindowScrollBarX(element),\n y: y\n };\n}","import getDocumentElement from \"./getDocumentElement.js\";\nimport getComputedStyle from \"./getComputedStyle.js\";\nimport getWindowScrollBarX from \"./getWindowScrollBarX.js\";\nimport getWindowScroll from \"./getWindowScroll.js\";\nimport { max } from \"../utils/math.js\"; // Gets the entire size of the scrollable document area, even extending outside\n// of the `` and `` rect bounds if horizontally scrollable\n\nexport default function getDocumentRect(element) {\n var _element$ownerDocumen;\n\n var html = getDocumentElement(element);\n var winScroll = getWindowScroll(element);\n var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;\n var width = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);\n var height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);\n var x = -winScroll.scrollLeft + getWindowScrollBarX(element);\n var y = -winScroll.scrollTop;\n\n if (getComputedStyle(body || html).direction === 'rtl') {\n x += max(html.clientWidth, body ? body.clientWidth : 0) - width;\n }\n\n return {\n width: width,\n height: height,\n x: x,\n y: y\n };\n}","import getBasePlacement from \"./getBasePlacement.js\";\nimport getVariation from \"./getVariation.js\";\nimport getMainAxisFromPlacement from \"./getMainAxisFromPlacement.js\";\nimport { top, right, bottom, left, start, end } from \"../enums.js\";\nexport default function computeOffsets(_ref) {\n var reference = _ref.reference,\n element = _ref.element,\n placement = _ref.placement;\n var basePlacement = placement ? getBasePlacement(placement) : null;\n var variation = placement ? getVariation(placement) : null;\n var commonX = reference.x + reference.width / 2 - element.width / 2;\n var commonY = reference.y + reference.height / 2 - element.height / 2;\n var offsets;\n\n switch (basePlacement) {\n case top:\n offsets = {\n x: commonX,\n y: reference.y - element.height\n };\n break;\n\n case bottom:\n offsets = {\n x: commonX,\n y: reference.y + reference.height\n };\n break;\n\n case right:\n offsets = {\n x: reference.x + reference.width,\n y: commonY\n };\n break;\n\n case left:\n offsets = {\n x: reference.x - element.width,\n y: commonY\n };\n break;\n\n default:\n offsets = {\n x: reference.x,\n y: reference.y\n };\n }\n\n var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null;\n\n if (mainAxis != null) {\n var len = mainAxis === 'y' ? 'height' : 'width';\n\n switch (variation) {\n case start:\n offsets[mainAxis] = offsets[mainAxis] - (reference[len] / 2 - element[len] / 2);\n break;\n\n case end:\n offsets[mainAxis] = offsets[mainAxis] + (reference[len] / 2 - element[len] / 2);\n break;\n\n default:\n }\n }\n\n return offsets;\n}","import getClippingRect from \"../dom-utils/getClippingRect.js\";\nimport getDocumentElement from \"../dom-utils/getDocumentElement.js\";\nimport getBoundingClientRect from \"../dom-utils/getBoundingClientRect.js\";\nimport computeOffsets from \"./computeOffsets.js\";\nimport rectToClientRect from \"./rectToClientRect.js\";\nimport { clippingParents, reference, popper, bottom, top, right, basePlacements, viewport } from \"../enums.js\";\nimport { isElement } from \"../dom-utils/instanceOf.js\";\nimport mergePaddingObject from \"./mergePaddingObject.js\";\nimport expandToHashMap from \"./expandToHashMap.js\"; // eslint-disable-next-line import/no-unused-modules\n\nexport default function detectOverflow(state, options) {\n if (options === void 0) {\n options = {};\n }\n\n var _options = options,\n _options$placement = _options.placement,\n placement = _options$placement === void 0 ? state.placement : _options$placement,\n _options$strategy = _options.strategy,\n strategy = _options$strategy === void 0 ? state.strategy : _options$strategy,\n _options$boundary = _options.boundary,\n boundary = _options$boundary === void 0 ? clippingParents : _options$boundary,\n _options$rootBoundary = _options.rootBoundary,\n rootBoundary = _options$rootBoundary === void 0 ? viewport : _options$rootBoundary,\n _options$elementConte = _options.elementContext,\n elementContext = _options$elementConte === void 0 ? popper : _options$elementConte,\n _options$altBoundary = _options.altBoundary,\n altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary,\n _options$padding = _options.padding,\n padding = _options$padding === void 0 ? 0 : _options$padding;\n var paddingObject = mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));\n var altContext = elementContext === popper ? reference : popper;\n var popperRect = state.rects.popper;\n var element = state.elements[altBoundary ? altContext : elementContext];\n var clippingClientRect = getClippingRect(isElement(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary, strategy);\n var referenceClientRect = getBoundingClientRect(state.elements.reference);\n var popperOffsets = computeOffsets({\n reference: referenceClientRect,\n element: popperRect,\n strategy: 'absolute',\n placement: placement\n });\n var popperClientRect = rectToClientRect(Object.assign({}, popperRect, popperOffsets));\n var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect; // positive = overflowing the clipping rect\n // 0 or negative = within the clipping rect\n\n var overflowOffsets = {\n top: clippingClientRect.top - elementClientRect.top + paddingObject.top,\n bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom,\n left: clippingClientRect.left - elementClientRect.left + paddingObject.left,\n right: elementClientRect.right - clippingClientRect.right + paddingObject.right\n };\n var offsetData = state.modifiersData.offset; // Offsets can be applied only to the popper element\n\n if (elementContext === popper && offsetData) {\n var offset = offsetData[placement];\n Object.keys(overflowOffsets).forEach(function (key) {\n var multiply = [right, bottom].indexOf(key) >= 0 ? 1 : -1;\n var axis = [top, bottom].indexOf(key) >= 0 ? 'y' : 'x';\n overflowOffsets[key] += offset[axis] * multiply;\n });\n }\n\n return overflowOffsets;\n}","import getOppositePlacement from \"../utils/getOppositePlacement.js\";\nimport getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getOppositeVariationPlacement from \"../utils/getOppositeVariationPlacement.js\";\nimport detectOverflow from \"../utils/detectOverflow.js\";\nimport computeAutoPlacement from \"../utils/computeAutoPlacement.js\";\nimport { bottom, top, start, right, left, auto } from \"../enums.js\";\nimport getVariation from \"../utils/getVariation.js\"; // eslint-disable-next-line import/no-unused-modules\n\nfunction getExpandedFallbackPlacements(placement) {\n if (getBasePlacement(placement) === auto) {\n return [];\n }\n\n var oppositePlacement = getOppositePlacement(placement);\n return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)];\n}\n\nfunction flip(_ref) {\n var state = _ref.state,\n options = _ref.options,\n name = _ref.name;\n\n if (state.modifiersData[name]._skip) {\n return;\n }\n\n var _options$mainAxis = options.mainAxis,\n checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,\n _options$altAxis = options.altAxis,\n checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis,\n specifiedFallbackPlacements = options.fallbackPlacements,\n padding = options.padding,\n boundary = options.boundary,\n rootBoundary = options.rootBoundary,\n altBoundary = options.altBoundary,\n _options$flipVariatio = options.flipVariations,\n flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio,\n allowedAutoPlacements = options.allowedAutoPlacements;\n var preferredPlacement = state.options.placement;\n var basePlacement = getBasePlacement(preferredPlacement);\n var isBasePlacement = basePlacement === preferredPlacement;\n var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [getOppositePlacement(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement));\n var placements = [preferredPlacement].concat(fallbackPlacements).reduce(function (acc, placement) {\n return acc.concat(getBasePlacement(placement) === auto ? computeAutoPlacement(state, {\n placement: placement,\n boundary: boundary,\n rootBoundary: rootBoundary,\n padding: padding,\n flipVariations: flipVariations,\n allowedAutoPlacements: allowedAutoPlacements\n }) : placement);\n }, []);\n var referenceRect = state.rects.reference;\n var popperRect = state.rects.popper;\n var checksMap = new Map();\n var makeFallbackChecks = true;\n var firstFittingPlacement = placements[0];\n\n for (var i = 0; i < placements.length; i++) {\n var placement = placements[i];\n\n var _basePlacement = getBasePlacement(placement);\n\n var isStartVariation = getVariation(placement) === start;\n var isVertical = [top, bottom].indexOf(_basePlacement) >= 0;\n var len = isVertical ? 'width' : 'height';\n var overflow = detectOverflow(state, {\n placement: placement,\n boundary: boundary,\n rootBoundary: rootBoundary,\n altBoundary: altBoundary,\n padding: padding\n });\n var mainVariationSide = isVertical ? isStartVariation ? right : left : isStartVariation ? bottom : top;\n\n if (referenceRect[len] > popperRect[len]) {\n mainVariationSide = getOppositePlacement(mainVariationSide);\n }\n\n var altVariationSide = getOppositePlacement(mainVariationSide);\n var checks = [];\n\n if (checkMainAxis) {\n checks.push(overflow[_basePlacement] <= 0);\n }\n\n if (checkAltAxis) {\n checks.push(overflow[mainVariationSide] <= 0, overflow[altVariationSide] <= 0);\n }\n\n if (checks.every(function (check) {\n return check;\n })) {\n firstFittingPlacement = placement;\n makeFallbackChecks = false;\n break;\n }\n\n checksMap.set(placement, checks);\n }\n\n if (makeFallbackChecks) {\n // `2` may be desired in some cases – research later\n var numberOfChecks = flipVariations ? 3 : 1;\n\n var _loop = function _loop(_i) {\n var fittingPlacement = placements.find(function (placement) {\n var checks = checksMap.get(placement);\n\n if (checks) {\n return checks.slice(0, _i).every(function (check) {\n return check;\n });\n }\n });\n\n if (fittingPlacement) {\n firstFittingPlacement = fittingPlacement;\n return \"break\";\n }\n };\n\n for (var _i = numberOfChecks; _i > 0; _i--) {\n var _ret = _loop(_i);\n\n if (_ret === \"break\") break;\n }\n }\n\n if (state.placement !== firstFittingPlacement) {\n state.modifiersData[name]._skip = true;\n state.placement = firstFittingPlacement;\n state.reset = true;\n }\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'flip',\n enabled: true,\n phase: 'main',\n fn: flip,\n requiresIfExists: ['offset'],\n data: {\n _skip: false\n }\n};","import getVariation from \"./getVariation.js\";\nimport { variationPlacements, basePlacements, placements as allPlacements } from \"../enums.js\";\nimport detectOverflow from \"./detectOverflow.js\";\nimport getBasePlacement from \"./getBasePlacement.js\";\nexport default function computeAutoPlacement(state, options) {\n if (options === void 0) {\n options = {};\n }\n\n var _options = options,\n placement = _options.placement,\n boundary = _options.boundary,\n rootBoundary = _options.rootBoundary,\n padding = _options.padding,\n flipVariations = _options.flipVariations,\n _options$allowedAutoP = _options.allowedAutoPlacements,\n allowedAutoPlacements = _options$allowedAutoP === void 0 ? allPlacements : _options$allowedAutoP;\n var variation = getVariation(placement);\n var placements = variation ? flipVariations ? variationPlacements : variationPlacements.filter(function (placement) {\n return getVariation(placement) === variation;\n }) : basePlacements;\n var allowedPlacements = placements.filter(function (placement) {\n return allowedAutoPlacements.indexOf(placement) >= 0;\n });\n\n if (allowedPlacements.length === 0) {\n allowedPlacements = placements;\n } // $FlowFixMe[incompatible-type]: Flow seems to have problems with two array unions...\n\n\n var overflows = allowedPlacements.reduce(function (acc, placement) {\n acc[placement] = detectOverflow(state, {\n placement: placement,\n boundary: boundary,\n rootBoundary: rootBoundary,\n padding: padding\n })[getBasePlacement(placement)];\n return acc;\n }, {});\n return Object.keys(overflows).sort(function (a, b) {\n return overflows[a] - overflows[b];\n });\n}","import { top, bottom, left, right } from \"../enums.js\";\nimport detectOverflow from \"../utils/detectOverflow.js\";\n\nfunction getSideOffsets(overflow, rect, preventedOffsets) {\n if (preventedOffsets === void 0) {\n preventedOffsets = {\n x: 0,\n y: 0\n };\n }\n\n return {\n top: overflow.top - rect.height - preventedOffsets.y,\n right: overflow.right - rect.width + preventedOffsets.x,\n bottom: overflow.bottom - rect.height + preventedOffsets.y,\n left: overflow.left - rect.width - preventedOffsets.x\n };\n}\n\nfunction isAnySideFullyClipped(overflow) {\n return [top, right, bottom, left].some(function (side) {\n return overflow[side] >= 0;\n });\n}\n\nfunction hide(_ref) {\n var state = _ref.state,\n name = _ref.name;\n var referenceRect = state.rects.reference;\n var popperRect = state.rects.popper;\n var preventedOffsets = state.modifiersData.preventOverflow;\n var referenceOverflow = detectOverflow(state, {\n elementContext: 'reference'\n });\n var popperAltOverflow = detectOverflow(state, {\n altBoundary: true\n });\n var referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect);\n var popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets);\n var isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets);\n var hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets);\n state.modifiersData[name] = {\n referenceClippingOffsets: referenceClippingOffsets,\n popperEscapeOffsets: popperEscapeOffsets,\n isReferenceHidden: isReferenceHidden,\n hasPopperEscaped: hasPopperEscaped\n };\n state.attributes.popper = Object.assign({}, state.attributes.popper, {\n 'data-popper-reference-hidden': isReferenceHidden,\n 'data-popper-escaped': hasPopperEscaped\n });\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'hide',\n enabled: true,\n phase: 'main',\n requiresIfExists: ['preventOverflow'],\n fn: hide\n};","import getBasePlacement from \"../utils/getBasePlacement.js\";\nimport { top, left, right, placements } from \"../enums.js\"; // eslint-disable-next-line import/no-unused-modules\n\nexport function distanceAndSkiddingToXY(placement, rects, offset) {\n var basePlacement = getBasePlacement(placement);\n var invertDistance = [left, top].indexOf(basePlacement) >= 0 ? -1 : 1;\n\n var _ref = typeof offset === 'function' ? offset(Object.assign({}, rects, {\n placement: placement\n })) : offset,\n skidding = _ref[0],\n distance = _ref[1];\n\n skidding = skidding || 0;\n distance = (distance || 0) * invertDistance;\n return [left, right].indexOf(basePlacement) >= 0 ? {\n x: distance,\n y: skidding\n } : {\n x: skidding,\n y: distance\n };\n}\n\nfunction offset(_ref2) {\n var state = _ref2.state,\n options = _ref2.options,\n name = _ref2.name;\n var _options$offset = options.offset,\n offset = _options$offset === void 0 ? [0, 0] : _options$offset;\n var data = placements.reduce(function (acc, placement) {\n acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset);\n return acc;\n }, {});\n var _data$state$placement = data[state.placement],\n x = _data$state$placement.x,\n y = _data$state$placement.y;\n\n if (state.modifiersData.popperOffsets != null) {\n state.modifiersData.popperOffsets.x += x;\n state.modifiersData.popperOffsets.y += y;\n }\n\n state.modifiersData[name] = data;\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'offset',\n enabled: true,\n phase: 'main',\n requires: ['popperOffsets'],\n fn: offset\n};","import computeOffsets from \"../utils/computeOffsets.js\";\n\nfunction popperOffsets(_ref) {\n var state = _ref.state,\n name = _ref.name;\n // Offsets are the actual position the popper needs to have to be\n // properly positioned near its reference element\n // This is the most basic placement, and will be adjusted by\n // the modifiers in the next step\n state.modifiersData[name] = computeOffsets({\n reference: state.rects.reference,\n element: state.rects.popper,\n strategy: 'absolute',\n placement: state.placement\n });\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'popperOffsets',\n enabled: true,\n phase: 'read',\n fn: popperOffsets,\n data: {}\n};","import { top, left, right, bottom, start } from \"../enums.js\";\nimport getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getMainAxisFromPlacement from \"../utils/getMainAxisFromPlacement.js\";\nimport getAltAxis from \"../utils/getAltAxis.js\";\nimport { within, withinMaxClamp } from \"../utils/within.js\";\nimport getLayoutRect from \"../dom-utils/getLayoutRect.js\";\nimport getOffsetParent from \"../dom-utils/getOffsetParent.js\";\nimport detectOverflow from \"../utils/detectOverflow.js\";\nimport getVariation from \"../utils/getVariation.js\";\nimport getFreshSideObject from \"../utils/getFreshSideObject.js\";\nimport { min as mathMin, max as mathMax } from \"../utils/math.js\";\n\nfunction preventOverflow(_ref) {\n var state = _ref.state,\n options = _ref.options,\n name = _ref.name;\n var _options$mainAxis = options.mainAxis,\n checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,\n _options$altAxis = options.altAxis,\n checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis,\n boundary = options.boundary,\n rootBoundary = options.rootBoundary,\n altBoundary = options.altBoundary,\n padding = options.padding,\n _options$tether = options.tether,\n tether = _options$tether === void 0 ? true : _options$tether,\n _options$tetherOffset = options.tetherOffset,\n tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset;\n var overflow = detectOverflow(state, {\n boundary: boundary,\n rootBoundary: rootBoundary,\n padding: padding,\n altBoundary: altBoundary\n });\n var basePlacement = getBasePlacement(state.placement);\n var variation = getVariation(state.placement);\n var isBasePlacement = !variation;\n var mainAxis = getMainAxisFromPlacement(basePlacement);\n var altAxis = getAltAxis(mainAxis);\n var popperOffsets = state.modifiersData.popperOffsets;\n var referenceRect = state.rects.reference;\n var popperRect = state.rects.popper;\n var tetherOffsetValue = typeof tetherOffset === 'function' ? tetherOffset(Object.assign({}, state.rects, {\n placement: state.placement\n })) : tetherOffset;\n var normalizedTetherOffsetValue = typeof tetherOffsetValue === 'number' ? {\n mainAxis: tetherOffsetValue,\n altAxis: tetherOffsetValue\n } : Object.assign({\n mainAxis: 0,\n altAxis: 0\n }, tetherOffsetValue);\n var offsetModifierState = state.modifiersData.offset ? state.modifiersData.offset[state.placement] : null;\n var data = {\n x: 0,\n y: 0\n };\n\n if (!popperOffsets) {\n return;\n }\n\n if (checkMainAxis) {\n var _offsetModifierState$;\n\n var mainSide = mainAxis === 'y' ? top : left;\n var altSide = mainAxis === 'y' ? bottom : right;\n var len = mainAxis === 'y' ? 'height' : 'width';\n var offset = popperOffsets[mainAxis];\n var min = offset + overflow[mainSide];\n var max = offset - overflow[altSide];\n var additive = tether ? -popperRect[len] / 2 : 0;\n var minLen = variation === start ? referenceRect[len] : popperRect[len];\n var maxLen = variation === start ? -popperRect[len] : -referenceRect[len]; // We need to include the arrow in the calculation so the arrow doesn't go\n // outside the reference bounds\n\n var arrowElement = state.elements.arrow;\n var arrowRect = tether && arrowElement ? getLayoutRect(arrowElement) : {\n width: 0,\n height: 0\n };\n var arrowPaddingObject = state.modifiersData['arrow#persistent'] ? state.modifiersData['arrow#persistent'].padding : getFreshSideObject();\n var arrowPaddingMin = arrowPaddingObject[mainSide];\n var arrowPaddingMax = arrowPaddingObject[altSide]; // If the reference length is smaller than the arrow length, we don't want\n // to include its full size in the calculation. If the reference is small\n // and near the edge of a boundary, the popper can overflow even if the\n // reference is not overflowing as well (e.g. virtual elements with no\n // width or height)\n\n var arrowLen = within(0, referenceRect[len], arrowRect[len]);\n var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis : minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis;\n var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis : maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis;\n var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow);\n var clientOffset = arrowOffsetParent ? mainAxis === 'y' ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0;\n var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0;\n var tetherMin = offset + minOffset - offsetModifierValue - clientOffset;\n var tetherMax = offset + maxOffset - offsetModifierValue;\n var preventedOffset = within(tether ? mathMin(min, tetherMin) : min, offset, tether ? mathMax(max, tetherMax) : max);\n popperOffsets[mainAxis] = preventedOffset;\n data[mainAxis] = preventedOffset - offset;\n }\n\n if (checkAltAxis) {\n var _offsetModifierState$2;\n\n var _mainSide = mainAxis === 'x' ? top : left;\n\n var _altSide = mainAxis === 'x' ? bottom : right;\n\n var _offset = popperOffsets[altAxis];\n\n var _len = altAxis === 'y' ? 'height' : 'width';\n\n var _min = _offset + overflow[_mainSide];\n\n var _max = _offset - overflow[_altSide];\n\n var isOriginSide = [top, left].indexOf(basePlacement) !== -1;\n\n var _offsetModifierValue = (_offsetModifierState$2 = offsetModifierState == null ? void 0 : offsetModifierState[altAxis]) != null ? _offsetModifierState$2 : 0;\n\n var _tetherMin = isOriginSide ? _min : _offset - referenceRect[_len] - popperRect[_len] - _offsetModifierValue + normalizedTetherOffsetValue.altAxis;\n\n var _tetherMax = isOriginSide ? _offset + referenceRect[_len] + popperRect[_len] - _offsetModifierValue - normalizedTetherOffsetValue.altAxis : _max;\n\n var _preventedOffset = tether && isOriginSide ? withinMaxClamp(_tetherMin, _offset, _tetherMax) : within(tether ? _tetherMin : _min, _offset, tether ? _tetherMax : _max);\n\n popperOffsets[altAxis] = _preventedOffset;\n data[altAxis] = _preventedOffset - _offset;\n }\n\n state.modifiersData[name] = data;\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'preventOverflow',\n enabled: true,\n phase: 'main',\n fn: preventOverflow,\n requiresIfExists: ['offset']\n};","export default function getAltAxis(axis) {\n return axis === 'x' ? 'y' : 'x';\n}","import getBoundingClientRect from \"./getBoundingClientRect.js\";\nimport getNodeScroll from \"./getNodeScroll.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport { isHTMLElement } from \"./instanceOf.js\";\nimport getWindowScrollBarX from \"./getWindowScrollBarX.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport isScrollParent from \"./isScrollParent.js\";\nimport { round } from \"../utils/math.js\";\n\nfunction isElementScaled(element) {\n var rect = element.getBoundingClientRect();\n var scaleX = round(rect.width) / element.offsetWidth || 1;\n var scaleY = round(rect.height) / element.offsetHeight || 1;\n return scaleX !== 1 || scaleY !== 1;\n} // Returns the composite rect of an element relative to its offsetParent.\n// Composite means it takes into account transforms as well as layout.\n\n\nexport default function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {\n if (isFixed === void 0) {\n isFixed = false;\n }\n\n var isOffsetParentAnElement = isHTMLElement(offsetParent);\n var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent);\n var documentElement = getDocumentElement(offsetParent);\n var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled, isFixed);\n var scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n var offsets = {\n x: 0,\n y: 0\n };\n\n if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {\n if (getNodeName(offsetParent) !== 'body' || // https://github.com/popperjs/popper-core/issues/1078\n isScrollParent(documentElement)) {\n scroll = getNodeScroll(offsetParent);\n }\n\n if (isHTMLElement(offsetParent)) {\n offsets = getBoundingClientRect(offsetParent, true);\n offsets.x += offsetParent.clientLeft;\n offsets.y += offsetParent.clientTop;\n } else if (documentElement) {\n offsets.x = getWindowScrollBarX(documentElement);\n }\n }\n\n return {\n x: rect.left + scroll.scrollLeft - offsets.x,\n y: rect.top + scroll.scrollTop - offsets.y,\n width: rect.width,\n height: rect.height\n };\n}","import getWindowScroll from \"./getWindowScroll.js\";\nimport getWindow from \"./getWindow.js\";\nimport { isHTMLElement } from \"./instanceOf.js\";\nimport getHTMLElementScroll from \"./getHTMLElementScroll.js\";\nexport default function getNodeScroll(node) {\n if (node === getWindow(node) || !isHTMLElement(node)) {\n return getWindowScroll(node);\n } else {\n return getHTMLElementScroll(node);\n }\n}","export default function getHTMLElementScroll(element) {\n return {\n scrollLeft: element.scrollLeft,\n scrollTop: element.scrollTop\n };\n}","import { modifierPhases } from \"../enums.js\"; // source: https://stackoverflow.com/questions/49875255\n\nfunction order(modifiers) {\n var map = new Map();\n var visited = new Set();\n var result = [];\n modifiers.forEach(function (modifier) {\n map.set(modifier.name, modifier);\n }); // On visiting object, check for its dependencies and visit them recursively\n\n function sort(modifier) {\n visited.add(modifier.name);\n var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []);\n requires.forEach(function (dep) {\n if (!visited.has(dep)) {\n var depModifier = map.get(dep);\n\n if (depModifier) {\n sort(depModifier);\n }\n }\n });\n result.push(modifier);\n }\n\n modifiers.forEach(function (modifier) {\n if (!visited.has(modifier.name)) {\n // check for visited object\n sort(modifier);\n }\n });\n return result;\n}\n\nexport default function orderModifiers(modifiers) {\n // order based on dependencies\n var orderedModifiers = order(modifiers); // order based on phase\n\n return modifierPhases.reduce(function (acc, phase) {\n return acc.concat(orderedModifiers.filter(function (modifier) {\n return modifier.phase === phase;\n }));\n }, []);\n}","import getCompositeRect from \"./dom-utils/getCompositeRect.js\";\nimport getLayoutRect from \"./dom-utils/getLayoutRect.js\";\nimport listScrollParents from \"./dom-utils/listScrollParents.js\";\nimport getOffsetParent from \"./dom-utils/getOffsetParent.js\";\nimport orderModifiers from \"./utils/orderModifiers.js\";\nimport debounce from \"./utils/debounce.js\";\nimport mergeByName from \"./utils/mergeByName.js\";\nimport detectOverflow from \"./utils/detectOverflow.js\";\nimport { isElement } from \"./dom-utils/instanceOf.js\";\nvar DEFAULT_OPTIONS = {\n placement: 'bottom',\n modifiers: [],\n strategy: 'absolute'\n};\n\nfunction areValidElements() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return !args.some(function (element) {\n return !(element && typeof element.getBoundingClientRect === 'function');\n });\n}\n\nexport function popperGenerator(generatorOptions) {\n if (generatorOptions === void 0) {\n generatorOptions = {};\n }\n\n var _generatorOptions = generatorOptions,\n _generatorOptions$def = _generatorOptions.defaultModifiers,\n defaultModifiers = _generatorOptions$def === void 0 ? [] : _generatorOptions$def,\n _generatorOptions$def2 = _generatorOptions.defaultOptions,\n defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2;\n return function createPopper(reference, popper, options) {\n if (options === void 0) {\n options = defaultOptions;\n }\n\n var state = {\n placement: 'bottom',\n orderedModifiers: [],\n options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions),\n modifiersData: {},\n elements: {\n reference: reference,\n popper: popper\n },\n attributes: {},\n styles: {}\n };\n var effectCleanupFns = [];\n var isDestroyed = false;\n var instance = {\n state: state,\n setOptions: function setOptions(setOptionsAction) {\n var options = typeof setOptionsAction === 'function' ? setOptionsAction(state.options) : setOptionsAction;\n cleanupModifierEffects();\n state.options = Object.assign({}, defaultOptions, state.options, options);\n state.scrollParents = {\n reference: isElement(reference) ? listScrollParents(reference) : reference.contextElement ? listScrollParents(reference.contextElement) : [],\n popper: listScrollParents(popper)\n }; // Orders the modifiers based on their dependencies and `phase`\n // properties\n\n var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers, state.options.modifiers))); // Strip out disabled modifiers\n\n state.orderedModifiers = orderedModifiers.filter(function (m) {\n return m.enabled;\n });\n runModifierEffects();\n return instance.update();\n },\n // Sync update – it will always be executed, even if not necessary. This\n // is useful for low frequency updates where sync behavior simplifies the\n // logic.\n // For high frequency updates (e.g. `resize` and `scroll` events), always\n // prefer the async Popper#update method\n forceUpdate: function forceUpdate() {\n if (isDestroyed) {\n return;\n }\n\n var _state$elements = state.elements,\n reference = _state$elements.reference,\n popper = _state$elements.popper; // Don't proceed if `reference` or `popper` are not valid elements\n // anymore\n\n if (!areValidElements(reference, popper)) {\n return;\n } // Store the reference and popper rects to be read by modifiers\n\n\n state.rects = {\n reference: getCompositeRect(reference, getOffsetParent(popper), state.options.strategy === 'fixed'),\n popper: getLayoutRect(popper)\n }; // Modifiers have the ability to reset the current update cycle. The\n // most common use case for this is the `flip` modifier changing the\n // placement, which then needs to re-run all the modifiers, because the\n // logic was previously ran for the previous placement and is therefore\n // stale/incorrect\n\n state.reset = false;\n state.placement = state.options.placement; // On each update cycle, the `modifiersData` property for each modifier\n // is filled with the initial data specified by the modifier. This means\n // it doesn't persist and is fresh on each update.\n // To ensure persistent data, use `${name}#persistent`\n\n state.orderedModifiers.forEach(function (modifier) {\n return state.modifiersData[modifier.name] = Object.assign({}, modifier.data);\n });\n\n for (var index = 0; index < state.orderedModifiers.length; index++) {\n if (state.reset === true) {\n state.reset = false;\n index = -1;\n continue;\n }\n\n var _state$orderedModifie = state.orderedModifiers[index],\n fn = _state$orderedModifie.fn,\n _state$orderedModifie2 = _state$orderedModifie.options,\n _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2,\n name = _state$orderedModifie.name;\n\n if (typeof fn === 'function') {\n state = fn({\n state: state,\n options: _options,\n name: name,\n instance: instance\n }) || state;\n }\n }\n },\n // Async and optimistically optimized update – it will not be executed if\n // not necessary (debounced to run at most once-per-tick)\n update: debounce(function () {\n return new Promise(function (resolve) {\n instance.forceUpdate();\n resolve(state);\n });\n }),\n destroy: function destroy() {\n cleanupModifierEffects();\n isDestroyed = true;\n }\n };\n\n if (!areValidElements(reference, popper)) {\n return instance;\n }\n\n instance.setOptions(options).then(function (state) {\n if (!isDestroyed && options.onFirstUpdate) {\n options.onFirstUpdate(state);\n }\n }); // Modifiers have the ability to execute arbitrary code before the first\n // update cycle runs. They will be executed in the same order as the update\n // cycle. This is useful when a modifier adds some persistent data that\n // other modifiers need to use, but the modifier is run after the dependent\n // one.\n\n function runModifierEffects() {\n state.orderedModifiers.forEach(function (_ref) {\n var name = _ref.name,\n _ref$options = _ref.options,\n options = _ref$options === void 0 ? {} : _ref$options,\n effect = _ref.effect;\n\n if (typeof effect === 'function') {\n var cleanupFn = effect({\n state: state,\n name: name,\n instance: instance,\n options: options\n });\n\n var noopFn = function noopFn() {};\n\n effectCleanupFns.push(cleanupFn || noopFn);\n }\n });\n }\n\n function cleanupModifierEffects() {\n effectCleanupFns.forEach(function (fn) {\n return fn();\n });\n effectCleanupFns = [];\n }\n\n return instance;\n };\n}\nexport var createPopper = /*#__PURE__*/popperGenerator(); // eslint-disable-next-line import/no-unused-modules\n\nexport { detectOverflow };","export default function debounce(fn) {\n var pending;\n return function () {\n if (!pending) {\n pending = new Promise(function (resolve) {\n Promise.resolve().then(function () {\n pending = undefined;\n resolve(fn());\n });\n });\n }\n\n return pending;\n };\n}","export default function mergeByName(modifiers) {\n var merged = modifiers.reduce(function (merged, current) {\n var existing = merged[current.name];\n merged[current.name] = existing ? Object.assign({}, existing, current, {\n options: Object.assign({}, existing.options, current.options),\n data: Object.assign({}, existing.data, current.data)\n }) : current;\n return merged;\n }, {}); // IE11 does not support Object.values\n\n return Object.keys(merged).map(function (key) {\n return merged[key];\n });\n}","import { popperGenerator, detectOverflow } from \"./createPopper.js\";\nimport eventListeners from \"./modifiers/eventListeners.js\";\nimport popperOffsets from \"./modifiers/popperOffsets.js\";\nimport computeStyles from \"./modifiers/computeStyles.js\";\nimport applyStyles from \"./modifiers/applyStyles.js\";\nimport offset from \"./modifiers/offset.js\";\nimport flip from \"./modifiers/flip.js\";\nimport preventOverflow from \"./modifiers/preventOverflow.js\";\nimport arrow from \"./modifiers/arrow.js\";\nimport hide from \"./modifiers/hide.js\";\nvar defaultModifiers = [eventListeners, popperOffsets, computeStyles, applyStyles, offset, flip, preventOverflow, arrow, hide];\nvar createPopper = /*#__PURE__*/popperGenerator({\n defaultModifiers: defaultModifiers\n}); // eslint-disable-next-line import/no-unused-modules\n\nexport { createPopper, popperGenerator, defaultModifiers, detectOverflow }; // eslint-disable-next-line import/no-unused-modules\n\nexport { createPopper as createPopperLite } from \"./popper-lite.js\"; // eslint-disable-next-line import/no-unused-modules\n\nexport * from \"./modifiers/index.js\";","import { popperGenerator, detectOverflow } from \"./createPopper.js\";\nimport eventListeners from \"./modifiers/eventListeners.js\";\nimport popperOffsets from \"./modifiers/popperOffsets.js\";\nimport computeStyles from \"./modifiers/computeStyles.js\";\nimport applyStyles from \"./modifiers/applyStyles.js\";\nvar defaultModifiers = [eventListeners, popperOffsets, computeStyles, applyStyles];\nvar createPopper = /*#__PURE__*/popperGenerator({\n defaultModifiers: defaultModifiers\n}); // eslint-disable-next-line import/no-unused-modules\n\nexport { createPopper, popperGenerator, defaultModifiers, detectOverflow };","/*!\n * Bootstrap v5.3.3 (https://getbootstrap.com/)\n * Copyright 2011-2024 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n */\nimport * as Popper from '@popperjs/core';\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap dom/data.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n/**\n * Constants\n */\n\nconst elementMap = new Map();\nconst Data = {\n set(element, key, instance) {\n if (!elementMap.has(element)) {\n elementMap.set(element, new Map());\n }\n const instanceMap = elementMap.get(element);\n\n // make it clear we only want one instance per element\n // can be removed later when multiple key/instances are fine to be used\n if (!instanceMap.has(key) && instanceMap.size !== 0) {\n // eslint-disable-next-line no-console\n console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(instanceMap.keys())[0]}.`);\n return;\n }\n instanceMap.set(key, instance);\n },\n get(element, key) {\n if (elementMap.has(element)) {\n return elementMap.get(element).get(key) || null;\n }\n return null;\n },\n remove(element, key) {\n if (!elementMap.has(element)) {\n return;\n }\n const instanceMap = elementMap.get(element);\n instanceMap.delete(key);\n\n // free up element references if there are no instances left for an element\n if (instanceMap.size === 0) {\n elementMap.delete(element);\n }\n }\n};\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap util/index.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nconst MAX_UID = 1000000;\nconst MILLISECONDS_MULTIPLIER = 1000;\nconst TRANSITION_END = 'transitionend';\n\n/**\n * Properly escape IDs selectors to handle weird IDs\n * @param {string} selector\n * @returns {string}\n */\nconst parseSelector = selector => {\n if (selector && window.CSS && window.CSS.escape) {\n // document.querySelector needs escaping to handle IDs (html5+) containing for instance /\n selector = selector.replace(/#([^\\s\"#']+)/g, (match, id) => `#${CSS.escape(id)}`);\n }\n return selector;\n};\n\n// Shout-out Angus Croll (https://goo.gl/pxwQGp)\nconst toType = object => {\n if (object === null || object === undefined) {\n return `${object}`;\n }\n return Object.prototype.toString.call(object).match(/\\s([a-z]+)/i)[1].toLowerCase();\n};\n\n/**\n * Public Util API\n */\n\nconst getUID = prefix => {\n do {\n prefix += Math.floor(Math.random() * MAX_UID);\n } while (document.getElementById(prefix));\n return prefix;\n};\nconst getTransitionDurationFromElement = element => {\n if (!element) {\n return 0;\n }\n\n // Get transition-duration of the element\n let {\n transitionDuration,\n transitionDelay\n } = window.getComputedStyle(element);\n const floatTransitionDuration = Number.parseFloat(transitionDuration);\n const floatTransitionDelay = Number.parseFloat(transitionDelay);\n\n // Return 0 if element or transition duration is not found\n if (!floatTransitionDuration && !floatTransitionDelay) {\n return 0;\n }\n\n // If multiple durations are defined, take the first\n transitionDuration = transitionDuration.split(',')[0];\n transitionDelay = transitionDelay.split(',')[0];\n return (Number.parseFloat(transitionDuration) + Number.parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER;\n};\nconst triggerTransitionEnd = element => {\n element.dispatchEvent(new Event(TRANSITION_END));\n};\nconst isElement = object => {\n if (!object || typeof object !== 'object') {\n return false;\n }\n if (typeof object.jquery !== 'undefined') {\n object = object[0];\n }\n return typeof object.nodeType !== 'undefined';\n};\nconst getElement = object => {\n // it's a jQuery object or a node element\n if (isElement(object)) {\n return object.jquery ? object[0] : object;\n }\n if (typeof object === 'string' && object.length > 0) {\n return document.querySelector(parseSelector(object));\n }\n return null;\n};\nconst isVisible = element => {\n if (!isElement(element) || element.getClientRects().length === 0) {\n return false;\n }\n const elementIsVisible = getComputedStyle(element).getPropertyValue('visibility') === 'visible';\n // Handle `details` element as its content may falsie appear visible when it is closed\n const closedDetails = element.closest('details:not([open])');\n if (!closedDetails) {\n return elementIsVisible;\n }\n if (closedDetails !== element) {\n const summary = element.closest('summary');\n if (summary && summary.parentNode !== closedDetails) {\n return false;\n }\n if (summary === null) {\n return false;\n }\n }\n return elementIsVisible;\n};\nconst isDisabled = element => {\n if (!element || element.nodeType !== Node.ELEMENT_NODE) {\n return true;\n }\n if (element.classList.contains('disabled')) {\n return true;\n }\n if (typeof element.disabled !== 'undefined') {\n return element.disabled;\n }\n return element.hasAttribute('disabled') && element.getAttribute('disabled') !== 'false';\n};\nconst findShadowRoot = element => {\n if (!document.documentElement.attachShadow) {\n return null;\n }\n\n // Can find the shadow root otherwise it'll return the document\n if (typeof element.getRootNode === 'function') {\n const root = element.getRootNode();\n return root instanceof ShadowRoot ? root : null;\n }\n if (element instanceof ShadowRoot) {\n return element;\n }\n\n // when we don't find a shadow root\n if (!element.parentNode) {\n return null;\n }\n return findShadowRoot(element.parentNode);\n};\nconst noop = () => {};\n\n/**\n * Trick to restart an element's animation\n *\n * @param {HTMLElement} element\n * @return void\n *\n * @see https://www.charistheo.io/blog/2021/02/restart-a-css-animation-with-javascript/#restarting-a-css-animation\n */\nconst reflow = element => {\n element.offsetHeight; // eslint-disable-line no-unused-expressions\n};\nconst getjQuery = () => {\n if (window.jQuery && !document.body.hasAttribute('data-bs-no-jquery')) {\n return window.jQuery;\n }\n return null;\n};\nconst DOMContentLoadedCallbacks = [];\nconst onDOMContentLoaded = callback => {\n if (document.readyState === 'loading') {\n // add listener on the first call when the document is in loading state\n if (!DOMContentLoadedCallbacks.length) {\n document.addEventListener('DOMContentLoaded', () => {\n for (const callback of DOMContentLoadedCallbacks) {\n callback();\n }\n });\n }\n DOMContentLoadedCallbacks.push(callback);\n } else {\n callback();\n }\n};\nconst isRTL = () => document.documentElement.dir === 'rtl';\nconst defineJQueryPlugin = plugin => {\n onDOMContentLoaded(() => {\n const $ = getjQuery();\n /* istanbul ignore if */\n if ($) {\n const name = plugin.NAME;\n const JQUERY_NO_CONFLICT = $.fn[name];\n $.fn[name] = plugin.jQueryInterface;\n $.fn[name].Constructor = plugin;\n $.fn[name].noConflict = () => {\n $.fn[name] = JQUERY_NO_CONFLICT;\n return plugin.jQueryInterface;\n };\n }\n });\n};\nconst execute = (possibleCallback, args = [], defaultValue = possibleCallback) => {\n return typeof possibleCallback === 'function' ? possibleCallback(...args) : defaultValue;\n};\nconst executeAfterTransition = (callback, transitionElement, waitForTransition = true) => {\n if (!waitForTransition) {\n execute(callback);\n return;\n }\n const durationPadding = 5;\n const emulatedDuration = getTransitionDurationFromElement(transitionElement) + durationPadding;\n let called = false;\n const handler = ({\n target\n }) => {\n if (target !== transitionElement) {\n return;\n }\n called = true;\n transitionElement.removeEventListener(TRANSITION_END, handler);\n execute(callback);\n };\n transitionElement.addEventListener(TRANSITION_END, handler);\n setTimeout(() => {\n if (!called) {\n triggerTransitionEnd(transitionElement);\n }\n }, emulatedDuration);\n};\n\n/**\n * Return the previous/next element of a list.\n *\n * @param {array} list The list of elements\n * @param activeElement The active element\n * @param shouldGetNext Choose to get next or previous element\n * @param isCycleAllowed\n * @return {Element|elem} The proper element\n */\nconst getNextActiveElement = (list, activeElement, shouldGetNext, isCycleAllowed) => {\n const listLength = list.length;\n let index = list.indexOf(activeElement);\n\n // if the element does not exist in the list return an element\n // depending on the direction and if cycle is allowed\n if (index === -1) {\n return !shouldGetNext && isCycleAllowed ? list[listLength - 1] : list[0];\n }\n index += shouldGetNext ? 1 : -1;\n if (isCycleAllowed) {\n index = (index + listLength) % listLength;\n }\n return list[Math.max(0, Math.min(index, listLength - 1))];\n};\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap dom/event-handler.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n\n/**\n * Constants\n */\n\nconst namespaceRegex = /[^.]*(?=\\..*)\\.|.*/;\nconst stripNameRegex = /\\..*/;\nconst stripUidRegex = /::\\d+$/;\nconst eventRegistry = {}; // Events storage\nlet uidEvent = 1;\nconst customEvents = {\n mouseenter: 'mouseover',\n mouseleave: 'mouseout'\n};\nconst nativeEvents = new Set(['click', 'dblclick', 'mouseup', 'mousedown', 'contextmenu', 'mousewheel', 'DOMMouseScroll', 'mouseover', 'mouseout', 'mousemove', 'selectstart', 'selectend', 'keydown', 'keypress', 'keyup', 'orientationchange', 'touchstart', 'touchmove', 'touchend', 'touchcancel', 'pointerdown', 'pointermove', 'pointerup', 'pointerleave', 'pointercancel', 'gesturestart', 'gesturechange', 'gestureend', 'focus', 'blur', 'change', 'reset', 'select', 'submit', 'focusin', 'focusout', 'load', 'unload', 'beforeunload', 'resize', 'move', 'DOMContentLoaded', 'readystatechange', 'error', 'abort', 'scroll']);\n\n/**\n * Private methods\n */\n\nfunction makeEventUid(element, uid) {\n return uid && `${uid}::${uidEvent++}` || element.uidEvent || uidEvent++;\n}\nfunction getElementEvents(element) {\n const uid = makeEventUid(element);\n element.uidEvent = uid;\n eventRegistry[uid] = eventRegistry[uid] || {};\n return eventRegistry[uid];\n}\nfunction bootstrapHandler(element, fn) {\n return function handler(event) {\n hydrateObj(event, {\n delegateTarget: element\n });\n if (handler.oneOff) {\n EventHandler.off(element, event.type, fn);\n }\n return fn.apply(element, [event]);\n };\n}\nfunction bootstrapDelegationHandler(element, selector, fn) {\n return function handler(event) {\n const domElements = element.querySelectorAll(selector);\n for (let {\n target\n } = event; target && target !== this; target = target.parentNode) {\n for (const domElement of domElements) {\n if (domElement !== target) {\n continue;\n }\n hydrateObj(event, {\n delegateTarget: target\n });\n if (handler.oneOff) {\n EventHandler.off(element, event.type, selector, fn);\n }\n return fn.apply(target, [event]);\n }\n }\n };\n}\nfunction findHandler(events, callable, delegationSelector = null) {\n return Object.values(events).find(event => event.callable === callable && event.delegationSelector === delegationSelector);\n}\nfunction normalizeParameters(originalTypeEvent, handler, delegationFunction) {\n const isDelegated = typeof handler === 'string';\n // TODO: tooltip passes `false` instead of selector, so we need to check\n const callable = isDelegated ? delegationFunction : handler || delegationFunction;\n let typeEvent = getTypeEvent(originalTypeEvent);\n if (!nativeEvents.has(typeEvent)) {\n typeEvent = originalTypeEvent;\n }\n return [isDelegated, callable, typeEvent];\n}\nfunction addHandler(element, originalTypeEvent, handler, delegationFunction, oneOff) {\n if (typeof originalTypeEvent !== 'string' || !element) {\n return;\n }\n let [isDelegated, callable, typeEvent] = normalizeParameters(originalTypeEvent, handler, delegationFunction);\n\n // in case of mouseenter or mouseleave wrap the handler within a function that checks for its DOM position\n // this prevents the handler from being dispatched the same way as mouseover or mouseout does\n if (originalTypeEvent in customEvents) {\n const wrapFunction = fn => {\n return function (event) {\n if (!event.relatedTarget || event.relatedTarget !== event.delegateTarget && !event.delegateTarget.contains(event.relatedTarget)) {\n return fn.call(this, event);\n }\n };\n };\n callable = wrapFunction(callable);\n }\n const events = getElementEvents(element);\n const handlers = events[typeEvent] || (events[typeEvent] = {});\n const previousFunction = findHandler(handlers, callable, isDelegated ? handler : null);\n if (previousFunction) {\n previousFunction.oneOff = previousFunction.oneOff && oneOff;\n return;\n }\n const uid = makeEventUid(callable, originalTypeEvent.replace(namespaceRegex, ''));\n const fn = isDelegated ? bootstrapDelegationHandler(element, handler, callable) : bootstrapHandler(element, callable);\n fn.delegationSelector = isDelegated ? handler : null;\n fn.callable = callable;\n fn.oneOff = oneOff;\n fn.uidEvent = uid;\n handlers[uid] = fn;\n element.addEventListener(typeEvent, fn, isDelegated);\n}\nfunction removeHandler(element, events, typeEvent, handler, delegationSelector) {\n const fn = findHandler(events[typeEvent], handler, delegationSelector);\n if (!fn) {\n return;\n }\n element.removeEventListener(typeEvent, fn, Boolean(delegationSelector));\n delete events[typeEvent][fn.uidEvent];\n}\nfunction removeNamespacedHandlers(element, events, typeEvent, namespace) {\n const storeElementEvent = events[typeEvent] || {};\n for (const [handlerKey, event] of Object.entries(storeElementEvent)) {\n if (handlerKey.includes(namespace)) {\n removeHandler(element, events, typeEvent, event.callable, event.delegationSelector);\n }\n }\n}\nfunction getTypeEvent(event) {\n // allow to get the native events from namespaced events ('click.bs.button' --> 'click')\n event = event.replace(stripNameRegex, '');\n return customEvents[event] || event;\n}\nconst EventHandler = {\n on(element, event, handler, delegationFunction) {\n addHandler(element, event, handler, delegationFunction, false);\n },\n one(element, event, handler, delegationFunction) {\n addHandler(element, event, handler, delegationFunction, true);\n },\n off(element, originalTypeEvent, handler, delegationFunction) {\n if (typeof originalTypeEvent !== 'string' || !element) {\n return;\n }\n const [isDelegated, callable, typeEvent] = normalizeParameters(originalTypeEvent, handler, delegationFunction);\n const inNamespace = typeEvent !== originalTypeEvent;\n const events = getElementEvents(element);\n const storeElementEvent = events[typeEvent] || {};\n const isNamespace = originalTypeEvent.startsWith('.');\n if (typeof callable !== 'undefined') {\n // Simplest case: handler is passed, remove that listener ONLY.\n if (!Object.keys(storeElementEvent).length) {\n return;\n }\n removeHandler(element, events, typeEvent, callable, isDelegated ? handler : null);\n return;\n }\n if (isNamespace) {\n for (const elementEvent of Object.keys(events)) {\n removeNamespacedHandlers(element, events, elementEvent, originalTypeEvent.slice(1));\n }\n }\n for (const [keyHandlers, event] of Object.entries(storeElementEvent)) {\n const handlerKey = keyHandlers.replace(stripUidRegex, '');\n if (!inNamespace || originalTypeEvent.includes(handlerKey)) {\n removeHandler(element, events, typeEvent, event.callable, event.delegationSelector);\n }\n }\n },\n trigger(element, event, args) {\n if (typeof event !== 'string' || !element) {\n return null;\n }\n const $ = getjQuery();\n const typeEvent = getTypeEvent(event);\n const inNamespace = event !== typeEvent;\n let jQueryEvent = null;\n let bubbles = true;\n let nativeDispatch = true;\n let defaultPrevented = false;\n if (inNamespace && $) {\n jQueryEvent = $.Event(event, args);\n $(element).trigger(jQueryEvent);\n bubbles = !jQueryEvent.isPropagationStopped();\n nativeDispatch = !jQueryEvent.isImmediatePropagationStopped();\n defaultPrevented = jQueryEvent.isDefaultPrevented();\n }\n const evt = hydrateObj(new Event(event, {\n bubbles,\n cancelable: true\n }), args);\n if (defaultPrevented) {\n evt.preventDefault();\n }\n if (nativeDispatch) {\n element.dispatchEvent(evt);\n }\n if (evt.defaultPrevented && jQueryEvent) {\n jQueryEvent.preventDefault();\n }\n return evt;\n }\n};\nfunction hydrateObj(obj, meta = {}) {\n for (const [key, value] of Object.entries(meta)) {\n try {\n obj[key] = value;\n } catch (_unused) {\n Object.defineProperty(obj, key, {\n configurable: true,\n get() {\n return value;\n }\n });\n }\n }\n return obj;\n}\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap dom/manipulator.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nfunction normalizeData(value) {\n if (value === 'true') {\n return true;\n }\n if (value === 'false') {\n return false;\n }\n if (value === Number(value).toString()) {\n return Number(value);\n }\n if (value === '' || value === 'null') {\n return null;\n }\n if (typeof value !== 'string') {\n return value;\n }\n try {\n return JSON.parse(decodeURIComponent(value));\n } catch (_unused) {\n return value;\n }\n}\nfunction normalizeDataKey(key) {\n return key.replace(/[A-Z]/g, chr => `-${chr.toLowerCase()}`);\n}\nconst Manipulator = {\n setDataAttribute(element, key, value) {\n element.setAttribute(`data-bs-${normalizeDataKey(key)}`, value);\n },\n removeDataAttribute(element, key) {\n element.removeAttribute(`data-bs-${normalizeDataKey(key)}`);\n },\n getDataAttributes(element) {\n if (!element) {\n return {};\n }\n const attributes = {};\n const bsKeys = Object.keys(element.dataset).filter(key => key.startsWith('bs') && !key.startsWith('bsConfig'));\n for (const key of bsKeys) {\n let pureKey = key.replace(/^bs/, '');\n pureKey = pureKey.charAt(0).toLowerCase() + pureKey.slice(1, pureKey.length);\n attributes[pureKey] = normalizeData(element.dataset[key]);\n }\n return attributes;\n },\n getDataAttribute(element, key) {\n return normalizeData(element.getAttribute(`data-bs-${normalizeDataKey(key)}`));\n }\n};\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap util/config.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n\n/**\n * Class definition\n */\n\nclass Config {\n // Getters\n static get Default() {\n return {};\n }\n static get DefaultType() {\n return {};\n }\n static get NAME() {\n throw new Error('You have to implement the static method \"NAME\", for each component!');\n }\n _getConfig(config) {\n config = this._mergeConfigObj(config);\n config = this._configAfterMerge(config);\n this._typeCheckConfig(config);\n return config;\n }\n _configAfterMerge(config) {\n return config;\n }\n _mergeConfigObj(config, element) {\n const jsonConfig = isElement(element) ? Manipulator.getDataAttribute(element, 'config') : {}; // try to parse\n\n return {\n ...this.constructor.Default,\n ...(typeof jsonConfig === 'object' ? jsonConfig : {}),\n ...(isElement(element) ? Manipulator.getDataAttributes(element) : {}),\n ...(typeof config === 'object' ? config : {})\n };\n }\n _typeCheckConfig(config, configTypes = this.constructor.DefaultType) {\n for (const [property, expectedTypes] of Object.entries(configTypes)) {\n const value = config[property];\n const valueType = isElement(value) ? 'element' : toType(value);\n if (!new RegExp(expectedTypes).test(valueType)) {\n throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option \"${property}\" provided type \"${valueType}\" but expected type \"${expectedTypes}\".`);\n }\n }\n }\n}\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap base-component.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n\n/**\n * Constants\n */\n\nconst VERSION = '5.3.3';\n\n/**\n * Class definition\n */\n\nclass BaseComponent extends Config {\n constructor(element, config) {\n super();\n element = getElement(element);\n if (!element) {\n return;\n }\n this._element = element;\n this._config = this._getConfig(config);\n Data.set(this._element, this.constructor.DATA_KEY, this);\n }\n\n // Public\n dispose() {\n Data.remove(this._element, this.constructor.DATA_KEY);\n EventHandler.off(this._element, this.constructor.EVENT_KEY);\n for (const propertyName of Object.getOwnPropertyNames(this)) {\n this[propertyName] = null;\n }\n }\n _queueCallback(callback, element, isAnimated = true) {\n executeAfterTransition(callback, element, isAnimated);\n }\n _getConfig(config) {\n config = this._mergeConfigObj(config, this._element);\n config = this._configAfterMerge(config);\n this._typeCheckConfig(config);\n return config;\n }\n\n // Static\n static getInstance(element) {\n return Data.get(getElement(element), this.DATA_KEY);\n }\n static getOrCreateInstance(element, config = {}) {\n return this.getInstance(element) || new this(element, typeof config === 'object' ? config : null);\n }\n static get VERSION() {\n return VERSION;\n }\n static get DATA_KEY() {\n return `bs.${this.NAME}`;\n }\n static get EVENT_KEY() {\n return `.${this.DATA_KEY}`;\n }\n static eventName(name) {\n return `${name}${this.EVENT_KEY}`;\n }\n}\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap dom/selector-engine.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nconst getSelector = element => {\n let selector = element.getAttribute('data-bs-target');\n if (!selector || selector === '#') {\n let hrefAttribute = element.getAttribute('href');\n\n // The only valid content that could double as a selector are IDs or classes,\n // so everything starting with `#` or `.`. If a \"real\" URL is used as the selector,\n // `document.querySelector` will rightfully complain it is invalid.\n // See https://github.com/twbs/bootstrap/issues/32273\n if (!hrefAttribute || !hrefAttribute.includes('#') && !hrefAttribute.startsWith('.')) {\n return null;\n }\n\n // Just in case some CMS puts out a full URL with the anchor appended\n if (hrefAttribute.includes('#') && !hrefAttribute.startsWith('#')) {\n hrefAttribute = `#${hrefAttribute.split('#')[1]}`;\n }\n selector = hrefAttribute && hrefAttribute !== '#' ? hrefAttribute.trim() : null;\n }\n return selector ? selector.split(',').map(sel => parseSelector(sel)).join(',') : null;\n};\nconst SelectorEngine = {\n find(selector, element = document.documentElement) {\n return [].concat(...Element.prototype.querySelectorAll.call(element, selector));\n },\n findOne(selector, element = document.documentElement) {\n return Element.prototype.querySelector.call(element, selector);\n },\n children(element, selector) {\n return [].concat(...element.children).filter(child => child.matches(selector));\n },\n parents(element, selector) {\n const parents = [];\n let ancestor = element.parentNode.closest(selector);\n while (ancestor) {\n parents.push(ancestor);\n ancestor = ancestor.parentNode.closest(selector);\n }\n return parents;\n },\n prev(element, selector) {\n let previous = element.previousElementSibling;\n while (previous) {\n if (previous.matches(selector)) {\n return [previous];\n }\n previous = previous.previousElementSibling;\n }\n return [];\n },\n // TODO: this is now unused; remove later along with prev()\n next(element, selector) {\n let next = element.nextElementSibling;\n while (next) {\n if (next.matches(selector)) {\n return [next];\n }\n next = next.nextElementSibling;\n }\n return [];\n },\n focusableChildren(element) {\n const focusables = ['a', 'button', 'input', 'textarea', 'select', 'details', '[tabindex]', '[contenteditable=\"true\"]'].map(selector => `${selector}:not([tabindex^=\"-\"])`).join(',');\n return this.find(focusables, element).filter(el => !isDisabled(el) && isVisible(el));\n },\n getSelectorFromElement(element) {\n const selector = getSelector(element);\n if (selector) {\n return SelectorEngine.findOne(selector) ? selector : null;\n }\n return null;\n },\n getElementFromSelector(element) {\n const selector = getSelector(element);\n return selector ? SelectorEngine.findOne(selector) : null;\n },\n getMultipleElementsFromSelector(element) {\n const selector = getSelector(element);\n return selector ? SelectorEngine.find(selector) : [];\n }\n};\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap util/component-functions.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nconst enableDismissTrigger = (component, method = 'hide') => {\n const clickEvent = `click.dismiss${component.EVENT_KEY}`;\n const name = component.NAME;\n EventHandler.on(document, clickEvent, `[data-bs-dismiss=\"${name}\"]`, function (event) {\n if (['A', 'AREA'].includes(this.tagName)) {\n event.preventDefault();\n }\n if (isDisabled(this)) {\n return;\n }\n const target = SelectorEngine.getElementFromSelector(this) || this.closest(`.${name}`);\n const instance = component.getOrCreateInstance(target);\n\n // Method argument is left, for Alert and only, as it doesn't implement the 'hide' method\n instance[method]();\n });\n};\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap alert.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n\n/**\n * Constants\n */\n\nconst NAME$f = 'alert';\nconst DATA_KEY$a = 'bs.alert';\nconst EVENT_KEY$b = `.${DATA_KEY$a}`;\nconst EVENT_CLOSE = `close${EVENT_KEY$b}`;\nconst EVENT_CLOSED = `closed${EVENT_KEY$b}`;\nconst CLASS_NAME_FADE$5 = 'fade';\nconst CLASS_NAME_SHOW$8 = 'show';\n\n/**\n * Class definition\n */\n\nclass Alert extends BaseComponent {\n // Getters\n static get NAME() {\n return NAME$f;\n }\n\n // Public\n close() {\n const closeEvent = EventHandler.trigger(this._element, EVENT_CLOSE);\n if (closeEvent.defaultPrevented) {\n return;\n }\n this._element.classList.remove(CLASS_NAME_SHOW$8);\n const isAnimated = this._element.classList.contains(CLASS_NAME_FADE$5);\n this._queueCallback(() => this._destroyElement(), this._element, isAnimated);\n }\n\n // Private\n _destroyElement() {\n this._element.remove();\n EventHandler.trigger(this._element, EVENT_CLOSED);\n this.dispose();\n }\n\n // Static\n static jQueryInterface(config) {\n return this.each(function () {\n const data = Alert.getOrCreateInstance(this);\n if (typeof config !== 'string') {\n return;\n }\n if (data[config] === undefined || config.startsWith('_') || config === 'constructor') {\n throw new TypeError(`No method named \"${config}\"`);\n }\n data[config](this);\n });\n }\n}\n\n/**\n * Data API implementation\n */\n\nenableDismissTrigger(Alert, 'close');\n\n/**\n * jQuery\n */\n\ndefineJQueryPlugin(Alert);\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap button.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n\n/**\n * Constants\n */\n\nconst NAME$e = 'button';\nconst DATA_KEY$9 = 'bs.button';\nconst EVENT_KEY$a = `.${DATA_KEY$9}`;\nconst DATA_API_KEY$6 = '.data-api';\nconst CLASS_NAME_ACTIVE$3 = 'active';\nconst SELECTOR_DATA_TOGGLE$5 = '[data-bs-toggle=\"button\"]';\nconst EVENT_CLICK_DATA_API$6 = `click${EVENT_KEY$a}${DATA_API_KEY$6}`;\n\n/**\n * Class definition\n */\n\nclass Button extends BaseComponent {\n // Getters\n static get NAME() {\n return NAME$e;\n }\n\n // Public\n toggle() {\n // Toggle class and sync the `aria-pressed` attribute with the return value of the `.toggle()` method\n this._element.setAttribute('aria-pressed', this._element.classList.toggle(CLASS_NAME_ACTIVE$3));\n }\n\n // Static\n static jQueryInterface(config) {\n return this.each(function () {\n const data = Button.getOrCreateInstance(this);\n if (config === 'toggle') {\n data[config]();\n }\n });\n }\n}\n\n/**\n * Data API implementation\n */\n\nEventHandler.on(document, EVENT_CLICK_DATA_API$6, SELECTOR_DATA_TOGGLE$5, event => {\n event.preventDefault();\n const button = event.target.closest(SELECTOR_DATA_TOGGLE$5);\n const data = Button.getOrCreateInstance(button);\n data.toggle();\n});\n\n/**\n * jQuery\n */\n\ndefineJQueryPlugin(Button);\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap util/swipe.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n\n/**\n * Constants\n */\n\nconst NAME$d = 'swipe';\nconst EVENT_KEY$9 = '.bs.swipe';\nconst EVENT_TOUCHSTART = `touchstart${EVENT_KEY$9}`;\nconst EVENT_TOUCHMOVE = `touchmove${EVENT_KEY$9}`;\nconst EVENT_TOUCHEND = `touchend${EVENT_KEY$9}`;\nconst EVENT_POINTERDOWN = `pointerdown${EVENT_KEY$9}`;\nconst EVENT_POINTERUP = `pointerup${EVENT_KEY$9}`;\nconst POINTER_TYPE_TOUCH = 'touch';\nconst POINTER_TYPE_PEN = 'pen';\nconst CLASS_NAME_POINTER_EVENT = 'pointer-event';\nconst SWIPE_THRESHOLD = 40;\nconst Default$c = {\n endCallback: null,\n leftCallback: null,\n rightCallback: null\n};\nconst DefaultType$c = {\n endCallback: '(function|null)',\n leftCallback: '(function|null)',\n rightCallback: '(function|null)'\n};\n\n/**\n * Class definition\n */\n\nclass Swipe extends Config {\n constructor(element, config) {\n super();\n this._element = element;\n if (!element || !Swipe.isSupported()) {\n return;\n }\n this._config = this._getConfig(config);\n this._deltaX = 0;\n this._supportPointerEvents = Boolean(window.PointerEvent);\n this._initEvents();\n }\n\n // Getters\n static get Default() {\n return Default$c;\n }\n static get DefaultType() {\n return DefaultType$c;\n }\n static get NAME() {\n return NAME$d;\n }\n\n // Public\n dispose() {\n EventHandler.off(this._element, EVENT_KEY$9);\n }\n\n // Private\n _start(event) {\n if (!this._supportPointerEvents) {\n this._deltaX = event.touches[0].clientX;\n return;\n }\n if (this._eventIsPointerPenTouch(event)) {\n this._deltaX = event.clientX;\n }\n }\n _end(event) {\n if (this._eventIsPointerPenTouch(event)) {\n this._deltaX = event.clientX - this._deltaX;\n }\n this._handleSwipe();\n execute(this._config.endCallback);\n }\n _move(event) {\n this._deltaX = event.touches && event.touches.length > 1 ? 0 : event.touches[0].clientX - this._deltaX;\n }\n _handleSwipe() {\n const absDeltaX = Math.abs(this._deltaX);\n if (absDeltaX <= SWIPE_THRESHOLD) {\n return;\n }\n const direction = absDeltaX / this._deltaX;\n this._deltaX = 0;\n if (!direction) {\n return;\n }\n execute(direction > 0 ? this._config.rightCallback : this._config.leftCallback);\n }\n _initEvents() {\n if (this._supportPointerEvents) {\n EventHandler.on(this._element, EVENT_POINTERDOWN, event => this._start(event));\n EventHandler.on(this._element, EVENT_POINTERUP, event => this._end(event));\n this._element.classList.add(CLASS_NAME_POINTER_EVENT);\n } else {\n EventHandler.on(this._element, EVENT_TOUCHSTART, event => this._start(event));\n EventHandler.on(this._element, EVENT_TOUCHMOVE, event => this._move(event));\n EventHandler.on(this._element, EVENT_TOUCHEND, event => this._end(event));\n }\n }\n _eventIsPointerPenTouch(event) {\n return this._supportPointerEvents && (event.pointerType === POINTER_TYPE_PEN || event.pointerType === POINTER_TYPE_TOUCH);\n }\n\n // Static\n static isSupported() {\n return 'ontouchstart' in document.documentElement || navigator.maxTouchPoints > 0;\n }\n}\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap carousel.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n\n/**\n * Constants\n */\n\nconst NAME$c = 'carousel';\nconst DATA_KEY$8 = 'bs.carousel';\nconst EVENT_KEY$8 = `.${DATA_KEY$8}`;\nconst DATA_API_KEY$5 = '.data-api';\nconst ARROW_LEFT_KEY$1 = 'ArrowLeft';\nconst ARROW_RIGHT_KEY$1 = 'ArrowRight';\nconst TOUCHEVENT_COMPAT_WAIT = 500; // Time for mouse compat events to fire after touch\n\nconst ORDER_NEXT = 'next';\nconst ORDER_PREV = 'prev';\nconst DIRECTION_LEFT = 'left';\nconst DIRECTION_RIGHT = 'right';\nconst EVENT_SLIDE = `slide${EVENT_KEY$8}`;\nconst EVENT_SLID = `slid${EVENT_KEY$8}`;\nconst EVENT_KEYDOWN$1 = `keydown${EVENT_KEY$8}`;\nconst EVENT_MOUSEENTER$1 = `mouseenter${EVENT_KEY$8}`;\nconst EVENT_MOUSELEAVE$1 = `mouseleave${EVENT_KEY$8}`;\nconst EVENT_DRAG_START = `dragstart${EVENT_KEY$8}`;\nconst EVENT_LOAD_DATA_API$3 = `load${EVENT_KEY$8}${DATA_API_KEY$5}`;\nconst EVENT_CLICK_DATA_API$5 = `click${EVENT_KEY$8}${DATA_API_KEY$5}`;\nconst CLASS_NAME_CAROUSEL = 'carousel';\nconst CLASS_NAME_ACTIVE$2 = 'active';\nconst CLASS_NAME_SLIDE = 'slide';\nconst CLASS_NAME_END = 'carousel-item-end';\nconst CLASS_NAME_START = 'carousel-item-start';\nconst CLASS_NAME_NEXT = 'carousel-item-next';\nconst CLASS_NAME_PREV = 'carousel-item-prev';\nconst SELECTOR_ACTIVE = '.active';\nconst SELECTOR_ITEM = '.carousel-item';\nconst SELECTOR_ACTIVE_ITEM = SELECTOR_ACTIVE + SELECTOR_ITEM;\nconst SELECTOR_ITEM_IMG = '.carousel-item img';\nconst SELECTOR_INDICATORS = '.carousel-indicators';\nconst SELECTOR_DATA_SLIDE = '[data-bs-slide], [data-bs-slide-to]';\nconst SELECTOR_DATA_RIDE = '[data-bs-ride=\"carousel\"]';\nconst KEY_TO_DIRECTION = {\n [ARROW_LEFT_KEY$1]: DIRECTION_RIGHT,\n [ARROW_RIGHT_KEY$1]: DIRECTION_LEFT\n};\nconst Default$b = {\n interval: 5000,\n keyboard: true,\n pause: 'hover',\n ride: false,\n touch: true,\n wrap: true\n};\nconst DefaultType$b = {\n interval: '(number|boolean)',\n // TODO:v6 remove boolean support\n keyboard: 'boolean',\n pause: '(string|boolean)',\n ride: '(boolean|string)',\n touch: 'boolean',\n wrap: 'boolean'\n};\n\n/**\n * Class definition\n */\n\nclass Carousel extends BaseComponent {\n constructor(element, config) {\n super(element, config);\n this._interval = null;\n this._activeElement = null;\n this._isSliding = false;\n this.touchTimeout = null;\n this._swipeHelper = null;\n this._indicatorsElement = SelectorEngine.findOne(SELECTOR_INDICATORS, this._element);\n this._addEventListeners();\n if (this._config.ride === CLASS_NAME_CAROUSEL) {\n this.cycle();\n }\n }\n\n // Getters\n static get Default() {\n return Default$b;\n }\n static get DefaultType() {\n return DefaultType$b;\n }\n static get NAME() {\n return NAME$c;\n }\n\n // Public\n next() {\n this._slide(ORDER_NEXT);\n }\n nextWhenVisible() {\n // FIXME TODO use `document.visibilityState`\n // Don't call next when the page isn't visible\n // or the carousel or its parent isn't visible\n if (!document.hidden && isVisible(this._element)) {\n this.next();\n }\n }\n prev() {\n this._slide(ORDER_PREV);\n }\n pause() {\n if (this._isSliding) {\n triggerTransitionEnd(this._element);\n }\n this._clearInterval();\n }\n cycle() {\n this._clearInterval();\n this._updateInterval();\n this._interval = setInterval(() => this.nextWhenVisible(), this._config.interval);\n }\n _maybeEnableCycle() {\n if (!this._config.ride) {\n return;\n }\n if (this._isSliding) {\n EventHandler.one(this._element, EVENT_SLID, () => this.cycle());\n return;\n }\n this.cycle();\n }\n to(index) {\n const items = this._getItems();\n if (index > items.length - 1 || index < 0) {\n return;\n }\n if (this._isSliding) {\n EventHandler.one(this._element, EVENT_SLID, () => this.to(index));\n return;\n }\n const activeIndex = this._getItemIndex(this._getActive());\n if (activeIndex === index) {\n return;\n }\n const order = index > activeIndex ? ORDER_NEXT : ORDER_PREV;\n this._slide(order, items[index]);\n }\n dispose() {\n if (this._swipeHelper) {\n this._swipeHelper.dispose();\n }\n super.dispose();\n }\n\n // Private\n _configAfterMerge(config) {\n config.defaultInterval = config.interval;\n return config;\n }\n _addEventListeners() {\n if (this._config.keyboard) {\n EventHandler.on(this._element, EVENT_KEYDOWN$1, event => this._keydown(event));\n }\n if (this._config.pause === 'hover') {\n EventHandler.on(this._element, EVENT_MOUSEENTER$1, () => this.pause());\n EventHandler.on(this._element, EVENT_MOUSELEAVE$1, () => this._maybeEnableCycle());\n }\n if (this._config.touch && Swipe.isSupported()) {\n this._addTouchEventListeners();\n }\n }\n _addTouchEventListeners() {\n for (const img of SelectorEngine.find(SELECTOR_ITEM_IMG, this._element)) {\n EventHandler.on(img, EVENT_DRAG_START, event => event.preventDefault());\n }\n const endCallBack = () => {\n if (this._config.pause !== 'hover') {\n return;\n }\n\n // If it's a touch-enabled device, mouseenter/leave are fired as\n // part of the mouse compatibility events on first tap - the carousel\n // would stop cycling until user tapped out of it;\n // here, we listen for touchend, explicitly pause the carousel\n // (as if it's the second time we tap on it, mouseenter compat event\n // is NOT fired) and after a timeout (to allow for mouse compatibility\n // events to fire) we explicitly restart cycling\n\n this.pause();\n if (this.touchTimeout) {\n clearTimeout(this.touchTimeout);\n }\n this.touchTimeout = setTimeout(() => this._maybeEnableCycle(), TOUCHEVENT_COMPAT_WAIT + this._config.interval);\n };\n const swipeConfig = {\n leftCallback: () => this._slide(this._directionToOrder(DIRECTION_LEFT)),\n rightCallback: () => this._slide(this._directionToOrder(DIRECTION_RIGHT)),\n endCallback: endCallBack\n };\n this._swipeHelper = new Swipe(this._element, swipeConfig);\n }\n _keydown(event) {\n if (/input|textarea/i.test(event.target.tagName)) {\n return;\n }\n const direction = KEY_TO_DIRECTION[event.key];\n if (direction) {\n event.preventDefault();\n this._slide(this._directionToOrder(direction));\n }\n }\n _getItemIndex(element) {\n return this._getItems().indexOf(element);\n }\n _setActiveIndicatorElement(index) {\n if (!this._indicatorsElement) {\n return;\n }\n const activeIndicator = SelectorEngine.findOne(SELECTOR_ACTIVE, this._indicatorsElement);\n activeIndicator.classList.remove(CLASS_NAME_ACTIVE$2);\n activeIndicator.removeAttribute('aria-current');\n const newActiveIndicator = SelectorEngine.findOne(`[data-bs-slide-to=\"${index}\"]`, this._indicatorsElement);\n if (newActiveIndicator) {\n newActiveIndicator.classList.add(CLASS_NAME_ACTIVE$2);\n newActiveIndicator.setAttribute('aria-current', 'true');\n }\n }\n _updateInterval() {\n const element = this._activeElement || this._getActive();\n if (!element) {\n return;\n }\n const elementInterval = Number.parseInt(element.getAttribute('data-bs-interval'), 10);\n this._config.interval = elementInterval || this._config.defaultInterval;\n }\n _slide(order, element = null) {\n if (this._isSliding) {\n return;\n }\n const activeElement = this._getActive();\n const isNext = order === ORDER_NEXT;\n const nextElement = element || getNextActiveElement(this._getItems(), activeElement, isNext, this._config.wrap);\n if (nextElement === activeElement) {\n return;\n }\n const nextElementIndex = this._getItemIndex(nextElement);\n const triggerEvent = eventName => {\n return EventHandler.trigger(this._element, eventName, {\n relatedTarget: nextElement,\n direction: this._orderToDirection(order),\n from: this._getItemIndex(activeElement),\n to: nextElementIndex\n });\n };\n const slideEvent = triggerEvent(EVENT_SLIDE);\n if (slideEvent.defaultPrevented) {\n return;\n }\n if (!activeElement || !nextElement) {\n // Some weirdness is happening, so we bail\n // TODO: change tests that use empty divs to avoid this check\n return;\n }\n const isCycling = Boolean(this._interval);\n this.pause();\n this._isSliding = true;\n this._setActiveIndicatorElement(nextElementIndex);\n this._activeElement = nextElement;\n const directionalClassName = isNext ? CLASS_NAME_START : CLASS_NAME_END;\n const orderClassName = isNext ? CLASS_NAME_NEXT : CLASS_NAME_PREV;\n nextElement.classList.add(orderClassName);\n reflow(nextElement);\n activeElement.classList.add(directionalClassName);\n nextElement.classList.add(directionalClassName);\n const completeCallBack = () => {\n nextElement.classList.remove(directionalClassName, orderClassName);\n nextElement.classList.add(CLASS_NAME_ACTIVE$2);\n activeElement.classList.remove(CLASS_NAME_ACTIVE$2, orderClassName, directionalClassName);\n this._isSliding = false;\n triggerEvent(EVENT_SLID);\n };\n this._queueCallback(completeCallBack, activeElement, this._isAnimated());\n if (isCycling) {\n this.cycle();\n }\n }\n _isAnimated() {\n return this._element.classList.contains(CLASS_NAME_SLIDE);\n }\n _getActive() {\n return SelectorEngine.findOne(SELECTOR_ACTIVE_ITEM, this._element);\n }\n _getItems() {\n return SelectorEngine.find(SELECTOR_ITEM, this._element);\n }\n _clearInterval() {\n if (this._interval) {\n clearInterval(this._interval);\n this._interval = null;\n }\n }\n _directionToOrder(direction) {\n if (isRTL()) {\n return direction === DIRECTION_LEFT ? ORDER_PREV : ORDER_NEXT;\n }\n return direction === DIRECTION_LEFT ? ORDER_NEXT : ORDER_PREV;\n }\n _orderToDirection(order) {\n if (isRTL()) {\n return order === ORDER_PREV ? DIRECTION_LEFT : DIRECTION_RIGHT;\n }\n return order === ORDER_PREV ? DIRECTION_RIGHT : DIRECTION_LEFT;\n }\n\n // Static\n static jQueryInterface(config) {\n return this.each(function () {\n const data = Carousel.getOrCreateInstance(this, config);\n if (typeof config === 'number') {\n data.to(config);\n return;\n }\n if (typeof config === 'string') {\n if (data[config] === undefined || config.startsWith('_') || config === 'constructor') {\n throw new TypeError(`No method named \"${config}\"`);\n }\n data[config]();\n }\n });\n }\n}\n\n/**\n * Data API implementation\n */\n\nEventHandler.on(document, EVENT_CLICK_DATA_API$5, SELECTOR_DATA_SLIDE, function (event) {\n const target = SelectorEngine.getElementFromSelector(this);\n if (!target || !target.classList.contains(CLASS_NAME_CAROUSEL)) {\n return;\n }\n event.preventDefault();\n const carousel = Carousel.getOrCreateInstance(target);\n const slideIndex = this.getAttribute('data-bs-slide-to');\n if (slideIndex) {\n carousel.to(slideIndex);\n carousel._maybeEnableCycle();\n return;\n }\n if (Manipulator.getDataAttribute(this, 'slide') === 'next') {\n carousel.next();\n carousel._maybeEnableCycle();\n return;\n }\n carousel.prev();\n carousel._maybeEnableCycle();\n});\nEventHandler.on(window, EVENT_LOAD_DATA_API$3, () => {\n const carousels = SelectorEngine.find(SELECTOR_DATA_RIDE);\n for (const carousel of carousels) {\n Carousel.getOrCreateInstance(carousel);\n }\n});\n\n/**\n * jQuery\n */\n\ndefineJQueryPlugin(Carousel);\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap collapse.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n\n/**\n * Constants\n */\n\nconst NAME$b = 'collapse';\nconst DATA_KEY$7 = 'bs.collapse';\nconst EVENT_KEY$7 = `.${DATA_KEY$7}`;\nconst DATA_API_KEY$4 = '.data-api';\nconst EVENT_SHOW$6 = `show${EVENT_KEY$7}`;\nconst EVENT_SHOWN$6 = `shown${EVENT_KEY$7}`;\nconst EVENT_HIDE$6 = `hide${EVENT_KEY$7}`;\nconst EVENT_HIDDEN$6 = `hidden${EVENT_KEY$7}`;\nconst EVENT_CLICK_DATA_API$4 = `click${EVENT_KEY$7}${DATA_API_KEY$4}`;\nconst CLASS_NAME_SHOW$7 = 'show';\nconst CLASS_NAME_COLLAPSE = 'collapse';\nconst CLASS_NAME_COLLAPSING = 'collapsing';\nconst CLASS_NAME_COLLAPSED = 'collapsed';\nconst CLASS_NAME_DEEPER_CHILDREN = `:scope .${CLASS_NAME_COLLAPSE} .${CLASS_NAME_COLLAPSE}`;\nconst CLASS_NAME_HORIZONTAL = 'collapse-horizontal';\nconst WIDTH = 'width';\nconst HEIGHT = 'height';\nconst SELECTOR_ACTIVES = '.collapse.show, .collapse.collapsing';\nconst SELECTOR_DATA_TOGGLE$4 = '[data-bs-toggle=\"collapse\"]';\nconst Default$a = {\n parent: null,\n toggle: true\n};\nconst DefaultType$a = {\n parent: '(null|element)',\n toggle: 'boolean'\n};\n\n/**\n * Class definition\n */\n\nclass Collapse extends BaseComponent {\n constructor(element, config) {\n super(element, config);\n this._isTransitioning = false;\n this._triggerArray = [];\n const toggleList = SelectorEngine.find(SELECTOR_DATA_TOGGLE$4);\n for (const elem of toggleList) {\n const selector = SelectorEngine.getSelectorFromElement(elem);\n const filterElement = SelectorEngine.find(selector).filter(foundElement => foundElement === this._element);\n if (selector !== null && filterElement.length) {\n this._triggerArray.push(elem);\n }\n }\n this._initializeChildren();\n if (!this._config.parent) {\n this._addAriaAndCollapsedClass(this._triggerArray, this._isShown());\n }\n if (this._config.toggle) {\n this.toggle();\n }\n }\n\n // Getters\n static get Default() {\n return Default$a;\n }\n static get DefaultType() {\n return DefaultType$a;\n }\n static get NAME() {\n return NAME$b;\n }\n\n // Public\n toggle() {\n if (this._isShown()) {\n this.hide();\n } else {\n this.show();\n }\n }\n show() {\n if (this._isTransitioning || this._isShown()) {\n return;\n }\n let activeChildren = [];\n\n // find active children\n if (this._config.parent) {\n activeChildren = this._getFirstLevelChildren(SELECTOR_ACTIVES).filter(element => element !== this._element).map(element => Collapse.getOrCreateInstance(element, {\n toggle: false\n }));\n }\n if (activeChildren.length && activeChildren[0]._isTransitioning) {\n return;\n }\n const startEvent = EventHandler.trigger(this._element, EVENT_SHOW$6);\n if (startEvent.defaultPrevented) {\n return;\n }\n for (const activeInstance of activeChildren) {\n activeInstance.hide();\n }\n const dimension = this._getDimension();\n this._element.classList.remove(CLASS_NAME_COLLAPSE);\n this._element.classList.add(CLASS_NAME_COLLAPSING);\n this._element.style[dimension] = 0;\n this._addAriaAndCollapsedClass(this._triggerArray, true);\n this._isTransitioning = true;\n const complete = () => {\n this._isTransitioning = false;\n this._element.classList.remove(CLASS_NAME_COLLAPSING);\n this._element.classList.add(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW$7);\n this._element.style[dimension] = '';\n EventHandler.trigger(this._element, EVENT_SHOWN$6);\n };\n const capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1);\n const scrollSize = `scroll${capitalizedDimension}`;\n this._queueCallback(complete, this._element, true);\n this._element.style[dimension] = `${this._element[scrollSize]}px`;\n }\n hide() {\n if (this._isTransitioning || !this._isShown()) {\n return;\n }\n const startEvent = EventHandler.trigger(this._element, EVENT_HIDE$6);\n if (startEvent.defaultPrevented) {\n return;\n }\n const dimension = this._getDimension();\n this._element.style[dimension] = `${this._element.getBoundingClientRect()[dimension]}px`;\n reflow(this._element);\n this._element.classList.add(CLASS_NAME_COLLAPSING);\n this._element.classList.remove(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW$7);\n for (const trigger of this._triggerArray) {\n const element = SelectorEngine.getElementFromSelector(trigger);\n if (element && !this._isShown(element)) {\n this._addAriaAndCollapsedClass([trigger], false);\n }\n }\n this._isTransitioning = true;\n const complete = () => {\n this._isTransitioning = false;\n this._element.classList.remove(CLASS_NAME_COLLAPSING);\n this._element.classList.add(CLASS_NAME_COLLAPSE);\n EventHandler.trigger(this._element, EVENT_HIDDEN$6);\n };\n this._element.style[dimension] = '';\n this._queueCallback(complete, this._element, true);\n }\n _isShown(element = this._element) {\n return element.classList.contains(CLASS_NAME_SHOW$7);\n }\n\n // Private\n _configAfterMerge(config) {\n config.toggle = Boolean(config.toggle); // Coerce string values\n config.parent = getElement(config.parent);\n return config;\n }\n _getDimension() {\n return this._element.classList.contains(CLASS_NAME_HORIZONTAL) ? WIDTH : HEIGHT;\n }\n _initializeChildren() {\n if (!this._config.parent) {\n return;\n }\n const children = this._getFirstLevelChildren(SELECTOR_DATA_TOGGLE$4);\n for (const element of children) {\n const selected = SelectorEngine.getElementFromSelector(element);\n if (selected) {\n this._addAriaAndCollapsedClass([element], this._isShown(selected));\n }\n }\n }\n _getFirstLevelChildren(selector) {\n const children = SelectorEngine.find(CLASS_NAME_DEEPER_CHILDREN, this._config.parent);\n // remove children if greater depth\n return SelectorEngine.find(selector, this._config.parent).filter(element => !children.includes(element));\n }\n _addAriaAndCollapsedClass(triggerArray, isOpen) {\n if (!triggerArray.length) {\n return;\n }\n for (const element of triggerArray) {\n element.classList.toggle(CLASS_NAME_COLLAPSED, !isOpen);\n element.setAttribute('aria-expanded', isOpen);\n }\n }\n\n // Static\n static jQueryInterface(config) {\n const _config = {};\n if (typeof config === 'string' && /show|hide/.test(config)) {\n _config.toggle = false;\n }\n return this.each(function () {\n const data = Collapse.getOrCreateInstance(this, _config);\n if (typeof config === 'string') {\n if (typeof data[config] === 'undefined') {\n throw new TypeError(`No method named \"${config}\"`);\n }\n data[config]();\n }\n });\n }\n}\n\n/**\n * Data API implementation\n */\n\nEventHandler.on(document, EVENT_CLICK_DATA_API$4, SELECTOR_DATA_TOGGLE$4, function (event) {\n // preventDefault only for elements (which change the URL) not inside the collapsible element\n if (event.target.tagName === 'A' || event.delegateTarget && event.delegateTarget.tagName === 'A') {\n event.preventDefault();\n }\n for (const element of SelectorEngine.getMultipleElementsFromSelector(this)) {\n Collapse.getOrCreateInstance(element, {\n toggle: false\n }).toggle();\n }\n});\n\n/**\n * jQuery\n */\n\ndefineJQueryPlugin(Collapse);\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap dropdown.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n\n/**\n * Constants\n */\n\nconst NAME$a = 'dropdown';\nconst DATA_KEY$6 = 'bs.dropdown';\nconst EVENT_KEY$6 = `.${DATA_KEY$6}`;\nconst DATA_API_KEY$3 = '.data-api';\nconst ESCAPE_KEY$2 = 'Escape';\nconst TAB_KEY$1 = 'Tab';\nconst ARROW_UP_KEY$1 = 'ArrowUp';\nconst ARROW_DOWN_KEY$1 = 'ArrowDown';\nconst RIGHT_MOUSE_BUTTON = 2; // MouseEvent.button value for the secondary button, usually the right button\n\nconst EVENT_HIDE$5 = `hide${EVENT_KEY$6}`;\nconst EVENT_HIDDEN$5 = `hidden${EVENT_KEY$6}`;\nconst EVENT_SHOW$5 = `show${EVENT_KEY$6}`;\nconst EVENT_SHOWN$5 = `shown${EVENT_KEY$6}`;\nconst EVENT_CLICK_DATA_API$3 = `click${EVENT_KEY$6}${DATA_API_KEY$3}`;\nconst EVENT_KEYDOWN_DATA_API = `keydown${EVENT_KEY$6}${DATA_API_KEY$3}`;\nconst EVENT_KEYUP_DATA_API = `keyup${EVENT_KEY$6}${DATA_API_KEY$3}`;\nconst CLASS_NAME_SHOW$6 = 'show';\nconst CLASS_NAME_DROPUP = 'dropup';\nconst CLASS_NAME_DROPEND = 'dropend';\nconst CLASS_NAME_DROPSTART = 'dropstart';\nconst CLASS_NAME_DROPUP_CENTER = 'dropup-center';\nconst CLASS_NAME_DROPDOWN_CENTER = 'dropdown-center';\nconst SELECTOR_DATA_TOGGLE$3 = '[data-bs-toggle=\"dropdown\"]:not(.disabled):not(:disabled)';\nconst SELECTOR_DATA_TOGGLE_SHOWN = `${SELECTOR_DATA_TOGGLE$3}.${CLASS_NAME_SHOW$6}`;\nconst SELECTOR_MENU = '.dropdown-menu';\nconst SELECTOR_NAVBAR = '.navbar';\nconst SELECTOR_NAVBAR_NAV = '.navbar-nav';\nconst SELECTOR_VISIBLE_ITEMS = '.dropdown-menu .dropdown-item:not(.disabled):not(:disabled)';\nconst PLACEMENT_TOP = isRTL() ? 'top-end' : 'top-start';\nconst PLACEMENT_TOPEND = isRTL() ? 'top-start' : 'top-end';\nconst PLACEMENT_BOTTOM = isRTL() ? 'bottom-end' : 'bottom-start';\nconst PLACEMENT_BOTTOMEND = isRTL() ? 'bottom-start' : 'bottom-end';\nconst PLACEMENT_RIGHT = isRTL() ? 'left-start' : 'right-start';\nconst PLACEMENT_LEFT = isRTL() ? 'right-start' : 'left-start';\nconst PLACEMENT_TOPCENTER = 'top';\nconst PLACEMENT_BOTTOMCENTER = 'bottom';\nconst Default$9 = {\n autoClose: true,\n boundary: 'clippingParents',\n display: 'dynamic',\n offset: [0, 2],\n popperConfig: null,\n reference: 'toggle'\n};\nconst DefaultType$9 = {\n autoClose: '(boolean|string)',\n boundary: '(string|element)',\n display: 'string',\n offset: '(array|string|function)',\n popperConfig: '(null|object|function)',\n reference: '(string|element|object)'\n};\n\n/**\n * Class definition\n */\n\nclass Dropdown extends BaseComponent {\n constructor(element, config) {\n super(element, config);\n this._popper = null;\n this._parent = this._element.parentNode; // dropdown wrapper\n // TODO: v6 revert #37011 & change markup https://getbootstrap.com/docs/5.3/forms/input-group/\n this._menu = SelectorEngine.next(this._element, SELECTOR_MENU)[0] || SelectorEngine.prev(this._element, SELECTOR_MENU)[0] || SelectorEngine.findOne(SELECTOR_MENU, this._parent);\n this._inNavbar = this._detectNavbar();\n }\n\n // Getters\n static get Default() {\n return Default$9;\n }\n static get DefaultType() {\n return DefaultType$9;\n }\n static get NAME() {\n return NAME$a;\n }\n\n // Public\n toggle() {\n return this._isShown() ? this.hide() : this.show();\n }\n show() {\n if (isDisabled(this._element) || this._isShown()) {\n return;\n }\n const relatedTarget = {\n relatedTarget: this._element\n };\n const showEvent = EventHandler.trigger(this._element, EVENT_SHOW$5, relatedTarget);\n if (showEvent.defaultPrevented) {\n return;\n }\n this._createPopper();\n\n // If this is a touch-enabled device we add extra\n // empty mouseover listeners to the body's immediate children;\n // only needed because of broken event delegation on iOS\n // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html\n if ('ontouchstart' in document.documentElement && !this._parent.closest(SELECTOR_NAVBAR_NAV)) {\n for (const element of [].concat(...document.body.children)) {\n EventHandler.on(element, 'mouseover', noop);\n }\n }\n this._element.focus();\n this._element.setAttribute('aria-expanded', true);\n this._menu.classList.add(CLASS_NAME_SHOW$6);\n this._element.classList.add(CLASS_NAME_SHOW$6);\n EventHandler.trigger(this._element, EVENT_SHOWN$5, relatedTarget);\n }\n hide() {\n if (isDisabled(this._element) || !this._isShown()) {\n return;\n }\n const relatedTarget = {\n relatedTarget: this._element\n };\n this._completeHide(relatedTarget);\n }\n dispose() {\n if (this._popper) {\n this._popper.destroy();\n }\n super.dispose();\n }\n update() {\n this._inNavbar = this._detectNavbar();\n if (this._popper) {\n this._popper.update();\n }\n }\n\n // Private\n _completeHide(relatedTarget) {\n const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE$5, relatedTarget);\n if (hideEvent.defaultPrevented) {\n return;\n }\n\n // If this is a touch-enabled device we remove the extra\n // empty mouseover listeners we added for iOS support\n if ('ontouchstart' in document.documentElement) {\n for (const element of [].concat(...document.body.children)) {\n EventHandler.off(element, 'mouseover', noop);\n }\n }\n if (this._popper) {\n this._popper.destroy();\n }\n this._menu.classList.remove(CLASS_NAME_SHOW$6);\n this._element.classList.remove(CLASS_NAME_SHOW$6);\n this._element.setAttribute('aria-expanded', 'false');\n Manipulator.removeDataAttribute(this._menu, 'popper');\n EventHandler.trigger(this._element, EVENT_HIDDEN$5, relatedTarget);\n }\n _getConfig(config) {\n config = super._getConfig(config);\n if (typeof config.reference === 'object' && !isElement(config.reference) && typeof config.reference.getBoundingClientRect !== 'function') {\n // Popper virtual elements require a getBoundingClientRect method\n throw new TypeError(`${NAME$a.toUpperCase()}: Option \"reference\" provided type \"object\" without a required \"getBoundingClientRect\" method.`);\n }\n return config;\n }\n _createPopper() {\n if (typeof Popper === 'undefined') {\n throw new TypeError('Bootstrap\\'s dropdowns require Popper (https://popper.js.org)');\n }\n let referenceElement = this._element;\n if (this._config.reference === 'parent') {\n referenceElement = this._parent;\n } else if (isElement(this._config.reference)) {\n referenceElement = getElement(this._config.reference);\n } else if (typeof this._config.reference === 'object') {\n referenceElement = this._config.reference;\n }\n const popperConfig = this._getPopperConfig();\n this._popper = Popper.createPopper(referenceElement, this._menu, popperConfig);\n }\n _isShown() {\n return this._menu.classList.contains(CLASS_NAME_SHOW$6);\n }\n _getPlacement() {\n const parentDropdown = this._parent;\n if (parentDropdown.classList.contains(CLASS_NAME_DROPEND)) {\n return PLACEMENT_RIGHT;\n }\n if (parentDropdown.classList.contains(CLASS_NAME_DROPSTART)) {\n return PLACEMENT_LEFT;\n }\n if (parentDropdown.classList.contains(CLASS_NAME_DROPUP_CENTER)) {\n return PLACEMENT_TOPCENTER;\n }\n if (parentDropdown.classList.contains(CLASS_NAME_DROPDOWN_CENTER)) {\n return PLACEMENT_BOTTOMCENTER;\n }\n\n // We need to trim the value because custom properties can also include spaces\n const isEnd = getComputedStyle(this._menu).getPropertyValue('--bs-position').trim() === 'end';\n if (parentDropdown.classList.contains(CLASS_NAME_DROPUP)) {\n return isEnd ? PLACEMENT_TOPEND : PLACEMENT_TOP;\n }\n return isEnd ? PLACEMENT_BOTTOMEND : PLACEMENT_BOTTOM;\n }\n _detectNavbar() {\n return this._element.closest(SELECTOR_NAVBAR) !== null;\n }\n _getOffset() {\n const {\n offset\n } = this._config;\n if (typeof offset === 'string') {\n return offset.split(',').map(value => Number.parseInt(value, 10));\n }\n if (typeof offset === 'function') {\n return popperData => offset(popperData, this._element);\n }\n return offset;\n }\n _getPopperConfig() {\n const defaultBsPopperConfig = {\n placement: this._getPlacement(),\n modifiers: [{\n name: 'preventOverflow',\n options: {\n boundary: this._config.boundary\n }\n }, {\n name: 'offset',\n options: {\n offset: this._getOffset()\n }\n }]\n };\n\n // Disable Popper if we have a static display or Dropdown is in Navbar\n if (this._inNavbar || this._config.display === 'static') {\n Manipulator.setDataAttribute(this._menu, 'popper', 'static'); // TODO: v6 remove\n defaultBsPopperConfig.modifiers = [{\n name: 'applyStyles',\n enabled: false\n }];\n }\n return {\n ...defaultBsPopperConfig,\n ...execute(this._config.popperConfig, [defaultBsPopperConfig])\n };\n }\n _selectMenuItem({\n key,\n target\n }) {\n const items = SelectorEngine.find(SELECTOR_VISIBLE_ITEMS, this._menu).filter(element => isVisible(element));\n if (!items.length) {\n return;\n }\n\n // if target isn't included in items (e.g. when expanding the dropdown)\n // allow cycling to get the last item in case key equals ARROW_UP_KEY\n getNextActiveElement(items, target, key === ARROW_DOWN_KEY$1, !items.includes(target)).focus();\n }\n\n // Static\n static jQueryInterface(config) {\n return this.each(function () {\n const data = Dropdown.getOrCreateInstance(this, config);\n if (typeof config !== 'string') {\n return;\n }\n if (typeof data[config] === 'undefined') {\n throw new TypeError(`No method named \"${config}\"`);\n }\n data[config]();\n });\n }\n static clearMenus(event) {\n if (event.button === RIGHT_MOUSE_BUTTON || event.type === 'keyup' && event.key !== TAB_KEY$1) {\n return;\n }\n const openToggles = SelectorEngine.find(SELECTOR_DATA_TOGGLE_SHOWN);\n for (const toggle of openToggles) {\n const context = Dropdown.getInstance(toggle);\n if (!context || context._config.autoClose === false) {\n continue;\n }\n const composedPath = event.composedPath();\n const isMenuTarget = composedPath.includes(context._menu);\n if (composedPath.includes(context._element) || context._config.autoClose === 'inside' && !isMenuTarget || context._config.autoClose === 'outside' && isMenuTarget) {\n continue;\n }\n\n // Tab navigation through the dropdown menu or events from contained inputs shouldn't close the menu\n if (context._menu.contains(event.target) && (event.type === 'keyup' && event.key === TAB_KEY$1 || /input|select|option|textarea|form/i.test(event.target.tagName))) {\n continue;\n }\n const relatedTarget = {\n relatedTarget: context._element\n };\n if (event.type === 'click') {\n relatedTarget.clickEvent = event;\n }\n context._completeHide(relatedTarget);\n }\n }\n static dataApiKeydownHandler(event) {\n // If not an UP | DOWN | ESCAPE key => not a dropdown command\n // If input/textarea && if key is other than ESCAPE => not a dropdown command\n\n const isInput = /input|textarea/i.test(event.target.tagName);\n const isEscapeEvent = event.key === ESCAPE_KEY$2;\n const isUpOrDownEvent = [ARROW_UP_KEY$1, ARROW_DOWN_KEY$1].includes(event.key);\n if (!isUpOrDownEvent && !isEscapeEvent) {\n return;\n }\n if (isInput && !isEscapeEvent) {\n return;\n }\n event.preventDefault();\n\n // TODO: v6 revert #37011 & change markup https://getbootstrap.com/docs/5.3/forms/input-group/\n const getToggleButton = this.matches(SELECTOR_DATA_TOGGLE$3) ? this : SelectorEngine.prev(this, SELECTOR_DATA_TOGGLE$3)[0] || SelectorEngine.next(this, SELECTOR_DATA_TOGGLE$3)[0] || SelectorEngine.findOne(SELECTOR_DATA_TOGGLE$3, event.delegateTarget.parentNode);\n const instance = Dropdown.getOrCreateInstance(getToggleButton);\n if (isUpOrDownEvent) {\n event.stopPropagation();\n instance.show();\n instance._selectMenuItem(event);\n return;\n }\n if (instance._isShown()) {\n // else is escape and we check if it is shown\n event.stopPropagation();\n instance.hide();\n getToggleButton.focus();\n }\n }\n}\n\n/**\n * Data API implementation\n */\n\nEventHandler.on(document, EVENT_KEYDOWN_DATA_API, SELECTOR_DATA_TOGGLE$3, Dropdown.dataApiKeydownHandler);\nEventHandler.on(document, EVENT_KEYDOWN_DATA_API, SELECTOR_MENU, Dropdown.dataApiKeydownHandler);\nEventHandler.on(document, EVENT_CLICK_DATA_API$3, Dropdown.clearMenus);\nEventHandler.on(document, EVENT_KEYUP_DATA_API, Dropdown.clearMenus);\nEventHandler.on(document, EVENT_CLICK_DATA_API$3, SELECTOR_DATA_TOGGLE$3, function (event) {\n event.preventDefault();\n Dropdown.getOrCreateInstance(this).toggle();\n});\n\n/**\n * jQuery\n */\n\ndefineJQueryPlugin(Dropdown);\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap util/backdrop.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n\n/**\n * Constants\n */\n\nconst NAME$9 = 'backdrop';\nconst CLASS_NAME_FADE$4 = 'fade';\nconst CLASS_NAME_SHOW$5 = 'show';\nconst EVENT_MOUSEDOWN = `mousedown.bs.${NAME$9}`;\nconst Default$8 = {\n className: 'modal-backdrop',\n clickCallback: null,\n isAnimated: false,\n isVisible: true,\n // if false, we use the backdrop helper without adding any element to the dom\n rootElement: 'body' // give the choice to place backdrop under different elements\n};\nconst DefaultType$8 = {\n className: 'string',\n clickCallback: '(function|null)',\n isAnimated: 'boolean',\n isVisible: 'boolean',\n rootElement: '(element|string)'\n};\n\n/**\n * Class definition\n */\n\nclass Backdrop extends Config {\n constructor(config) {\n super();\n this._config = this._getConfig(config);\n this._isAppended = false;\n this._element = null;\n }\n\n // Getters\n static get Default() {\n return Default$8;\n }\n static get DefaultType() {\n return DefaultType$8;\n }\n static get NAME() {\n return NAME$9;\n }\n\n // Public\n show(callback) {\n if (!this._config.isVisible) {\n execute(callback);\n return;\n }\n this._append();\n const element = this._getElement();\n if (this._config.isAnimated) {\n reflow(element);\n }\n element.classList.add(CLASS_NAME_SHOW$5);\n this._emulateAnimation(() => {\n execute(callback);\n });\n }\n hide(callback) {\n if (!this._config.isVisible) {\n execute(callback);\n return;\n }\n this._getElement().classList.remove(CLASS_NAME_SHOW$5);\n this._emulateAnimation(() => {\n this.dispose();\n execute(callback);\n });\n }\n dispose() {\n if (!this._isAppended) {\n return;\n }\n EventHandler.off(this._element, EVENT_MOUSEDOWN);\n this._element.remove();\n this._isAppended = false;\n }\n\n // Private\n _getElement() {\n if (!this._element) {\n const backdrop = document.createElement('div');\n backdrop.className = this._config.className;\n if (this._config.isAnimated) {\n backdrop.classList.add(CLASS_NAME_FADE$4);\n }\n this._element = backdrop;\n }\n return this._element;\n }\n _configAfterMerge(config) {\n // use getElement() with the default \"body\" to get a fresh Element on each instantiation\n config.rootElement = getElement(config.rootElement);\n return config;\n }\n _append() {\n if (this._isAppended) {\n return;\n }\n const element = this._getElement();\n this._config.rootElement.append(element);\n EventHandler.on(element, EVENT_MOUSEDOWN, () => {\n execute(this._config.clickCallback);\n });\n this._isAppended = true;\n }\n _emulateAnimation(callback) {\n executeAfterTransition(callback, this._getElement(), this._config.isAnimated);\n }\n}\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap util/focustrap.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n\n/**\n * Constants\n */\n\nconst NAME$8 = 'focustrap';\nconst DATA_KEY$5 = 'bs.focustrap';\nconst EVENT_KEY$5 = `.${DATA_KEY$5}`;\nconst EVENT_FOCUSIN$2 = `focusin${EVENT_KEY$5}`;\nconst EVENT_KEYDOWN_TAB = `keydown.tab${EVENT_KEY$5}`;\nconst TAB_KEY = 'Tab';\nconst TAB_NAV_FORWARD = 'forward';\nconst TAB_NAV_BACKWARD = 'backward';\nconst Default$7 = {\n autofocus: true,\n trapElement: null // The element to trap focus inside of\n};\nconst DefaultType$7 = {\n autofocus: 'boolean',\n trapElement: 'element'\n};\n\n/**\n * Class definition\n */\n\nclass FocusTrap extends Config {\n constructor(config) {\n super();\n this._config = this._getConfig(config);\n this._isActive = false;\n this._lastTabNavDirection = null;\n }\n\n // Getters\n static get Default() {\n return Default$7;\n }\n static get DefaultType() {\n return DefaultType$7;\n }\n static get NAME() {\n return NAME$8;\n }\n\n // Public\n activate() {\n if (this._isActive) {\n return;\n }\n if (this._config.autofocus) {\n this._config.trapElement.focus();\n }\n EventHandler.off(document, EVENT_KEY$5); // guard against infinite focus loop\n EventHandler.on(document, EVENT_FOCUSIN$2, event => this._handleFocusin(event));\n EventHandler.on(document, EVENT_KEYDOWN_TAB, event => this._handleKeydown(event));\n this._isActive = true;\n }\n deactivate() {\n if (!this._isActive) {\n return;\n }\n this._isActive = false;\n EventHandler.off(document, EVENT_KEY$5);\n }\n\n // Private\n _handleFocusin(event) {\n const {\n trapElement\n } = this._config;\n if (event.target === document || event.target === trapElement || trapElement.contains(event.target)) {\n return;\n }\n const elements = SelectorEngine.focusableChildren(trapElement);\n if (elements.length === 0) {\n trapElement.focus();\n } else if (this._lastTabNavDirection === TAB_NAV_BACKWARD) {\n elements[elements.length - 1].focus();\n } else {\n elements[0].focus();\n }\n }\n _handleKeydown(event) {\n if (event.key !== TAB_KEY) {\n return;\n }\n this._lastTabNavDirection = event.shiftKey ? TAB_NAV_BACKWARD : TAB_NAV_FORWARD;\n }\n}\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap util/scrollBar.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n\n/**\n * Constants\n */\n\nconst SELECTOR_FIXED_CONTENT = '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top';\nconst SELECTOR_STICKY_CONTENT = '.sticky-top';\nconst PROPERTY_PADDING = 'padding-right';\nconst PROPERTY_MARGIN = 'margin-right';\n\n/**\n * Class definition\n */\n\nclass ScrollBarHelper {\n constructor() {\n this._element = document.body;\n }\n\n // Public\n getWidth() {\n // https://developer.mozilla.org/en-US/docs/Web/API/Window/innerWidth#usage_notes\n const documentWidth = document.documentElement.clientWidth;\n return Math.abs(window.innerWidth - documentWidth);\n }\n hide() {\n const width = this.getWidth();\n this._disableOverFlow();\n // give padding to element to balance the hidden scrollbar width\n this._setElementAttributes(this._element, PROPERTY_PADDING, calculatedValue => calculatedValue + width);\n // trick: We adjust positive paddingRight and negative marginRight to sticky-top elements to keep showing fullwidth\n this._setElementAttributes(SELECTOR_FIXED_CONTENT, PROPERTY_PADDING, calculatedValue => calculatedValue + width);\n this._setElementAttributes(SELECTOR_STICKY_CONTENT, PROPERTY_MARGIN, calculatedValue => calculatedValue - width);\n }\n reset() {\n this._resetElementAttributes(this._element, 'overflow');\n this._resetElementAttributes(this._element, PROPERTY_PADDING);\n this._resetElementAttributes(SELECTOR_FIXED_CONTENT, PROPERTY_PADDING);\n this._resetElementAttributes(SELECTOR_STICKY_CONTENT, PROPERTY_MARGIN);\n }\n isOverflowing() {\n return this.getWidth() > 0;\n }\n\n // Private\n _disableOverFlow() {\n this._saveInitialAttribute(this._element, 'overflow');\n this._element.style.overflow = 'hidden';\n }\n _setElementAttributes(selector, styleProperty, callback) {\n const scrollbarWidth = this.getWidth();\n const manipulationCallBack = element => {\n if (element !== this._element && window.innerWidth > element.clientWidth + scrollbarWidth) {\n return;\n }\n this._saveInitialAttribute(element, styleProperty);\n const calculatedValue = window.getComputedStyle(element).getPropertyValue(styleProperty);\n element.style.setProperty(styleProperty, `${callback(Number.parseFloat(calculatedValue))}px`);\n };\n this._applyManipulationCallback(selector, manipulationCallBack);\n }\n _saveInitialAttribute(element, styleProperty) {\n const actualValue = element.style.getPropertyValue(styleProperty);\n if (actualValue) {\n Manipulator.setDataAttribute(element, styleProperty, actualValue);\n }\n }\n _resetElementAttributes(selector, styleProperty) {\n const manipulationCallBack = element => {\n const value = Manipulator.getDataAttribute(element, styleProperty);\n // We only want to remove the property if the value is `null`; the value can also be zero\n if (value === null) {\n element.style.removeProperty(styleProperty);\n return;\n }\n Manipulator.removeDataAttribute(element, styleProperty);\n element.style.setProperty(styleProperty, value);\n };\n this._applyManipulationCallback(selector, manipulationCallBack);\n }\n _applyManipulationCallback(selector, callBack) {\n if (isElement(selector)) {\n callBack(selector);\n return;\n }\n for (const sel of SelectorEngine.find(selector, this._element)) {\n callBack(sel);\n }\n }\n}\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap modal.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n\n/**\n * Constants\n */\n\nconst NAME$7 = 'modal';\nconst DATA_KEY$4 = 'bs.modal';\nconst EVENT_KEY$4 = `.${DATA_KEY$4}`;\nconst DATA_API_KEY$2 = '.data-api';\nconst ESCAPE_KEY$1 = 'Escape';\nconst EVENT_HIDE$4 = `hide${EVENT_KEY$4}`;\nconst EVENT_HIDE_PREVENTED$1 = `hidePrevented${EVENT_KEY$4}`;\nconst EVENT_HIDDEN$4 = `hidden${EVENT_KEY$4}`;\nconst EVENT_SHOW$4 = `show${EVENT_KEY$4}`;\nconst EVENT_SHOWN$4 = `shown${EVENT_KEY$4}`;\nconst EVENT_RESIZE$1 = `resize${EVENT_KEY$4}`;\nconst EVENT_CLICK_DISMISS = `click.dismiss${EVENT_KEY$4}`;\nconst EVENT_MOUSEDOWN_DISMISS = `mousedown.dismiss${EVENT_KEY$4}`;\nconst EVENT_KEYDOWN_DISMISS$1 = `keydown.dismiss${EVENT_KEY$4}`;\nconst EVENT_CLICK_DATA_API$2 = `click${EVENT_KEY$4}${DATA_API_KEY$2}`;\nconst CLASS_NAME_OPEN = 'modal-open';\nconst CLASS_NAME_FADE$3 = 'fade';\nconst CLASS_NAME_SHOW$4 = 'show';\nconst CLASS_NAME_STATIC = 'modal-static';\nconst OPEN_SELECTOR$1 = '.modal.show';\nconst SELECTOR_DIALOG = '.modal-dialog';\nconst SELECTOR_MODAL_BODY = '.modal-body';\nconst SELECTOR_DATA_TOGGLE$2 = '[data-bs-toggle=\"modal\"]';\nconst Default$6 = {\n backdrop: true,\n focus: true,\n keyboard: true\n};\nconst DefaultType$6 = {\n backdrop: '(boolean|string)',\n focus: 'boolean',\n keyboard: 'boolean'\n};\n\n/**\n * Class definition\n */\n\nclass Modal extends BaseComponent {\n constructor(element, config) {\n super(element, config);\n this._dialog = SelectorEngine.findOne(SELECTOR_DIALOG, this._element);\n this._backdrop = this._initializeBackDrop();\n this._focustrap = this._initializeFocusTrap();\n this._isShown = false;\n this._isTransitioning = false;\n this._scrollBar = new ScrollBarHelper();\n this._addEventListeners();\n }\n\n // Getters\n static get Default() {\n return Default$6;\n }\n static get DefaultType() {\n return DefaultType$6;\n }\n static get NAME() {\n return NAME$7;\n }\n\n // Public\n toggle(relatedTarget) {\n return this._isShown ? this.hide() : this.show(relatedTarget);\n }\n show(relatedTarget) {\n if (this._isShown || this._isTransitioning) {\n return;\n }\n const showEvent = EventHandler.trigger(this._element, EVENT_SHOW$4, {\n relatedTarget\n });\n if (showEvent.defaultPrevented) {\n return;\n }\n this._isShown = true;\n this._isTransitioning = true;\n this._scrollBar.hide();\n document.body.classList.add(CLASS_NAME_OPEN);\n this._adjustDialog();\n this._backdrop.show(() => this._showElement(relatedTarget));\n }\n hide() {\n if (!this._isShown || this._isTransitioning) {\n return;\n }\n const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE$4);\n if (hideEvent.defaultPrevented) {\n return;\n }\n this._isShown = false;\n this._isTransitioning = true;\n this._focustrap.deactivate();\n this._element.classList.remove(CLASS_NAME_SHOW$4);\n this._queueCallback(() => this._hideModal(), this._element, this._isAnimated());\n }\n dispose() {\n EventHandler.off(window, EVENT_KEY$4);\n EventHandler.off(this._dialog, EVENT_KEY$4);\n this._backdrop.dispose();\n this._focustrap.deactivate();\n super.dispose();\n }\n handleUpdate() {\n this._adjustDialog();\n }\n\n // Private\n _initializeBackDrop() {\n return new Backdrop({\n isVisible: Boolean(this._config.backdrop),\n // 'static' option will be translated to true, and booleans will keep their value,\n isAnimated: this._isAnimated()\n });\n }\n _initializeFocusTrap() {\n return new FocusTrap({\n trapElement: this._element\n });\n }\n _showElement(relatedTarget) {\n // try to append dynamic modal\n if (!document.body.contains(this._element)) {\n document.body.append(this._element);\n }\n this._element.style.display = 'block';\n this._element.removeAttribute('aria-hidden');\n this._element.setAttribute('aria-modal', true);\n this._element.setAttribute('role', 'dialog');\n this._element.scrollTop = 0;\n const modalBody = SelectorEngine.findOne(SELECTOR_MODAL_BODY, this._dialog);\n if (modalBody) {\n modalBody.scrollTop = 0;\n }\n reflow(this._element);\n this._element.classList.add(CLASS_NAME_SHOW$4);\n const transitionComplete = () => {\n if (this._config.focus) {\n this._focustrap.activate();\n }\n this._isTransitioning = false;\n EventHandler.trigger(this._element, EVENT_SHOWN$4, {\n relatedTarget\n });\n };\n this._queueCallback(transitionComplete, this._dialog, this._isAnimated());\n }\n _addEventListeners() {\n EventHandler.on(this._element, EVENT_KEYDOWN_DISMISS$1, event => {\n if (event.key !== ESCAPE_KEY$1) {\n return;\n }\n if (this._config.keyboard) {\n this.hide();\n return;\n }\n this._triggerBackdropTransition();\n });\n EventHandler.on(window, EVENT_RESIZE$1, () => {\n if (this._isShown && !this._isTransitioning) {\n this._adjustDialog();\n }\n });\n EventHandler.on(this._element, EVENT_MOUSEDOWN_DISMISS, event => {\n // a bad trick to segregate clicks that may start inside dialog but end outside, and avoid listen to scrollbar clicks\n EventHandler.one(this._element, EVENT_CLICK_DISMISS, event2 => {\n if (this._element !== event.target || this._element !== event2.target) {\n return;\n }\n if (this._config.backdrop === 'static') {\n this._triggerBackdropTransition();\n return;\n }\n if (this._config.backdrop) {\n this.hide();\n }\n });\n });\n }\n _hideModal() {\n this._element.style.display = 'none';\n this._element.setAttribute('aria-hidden', true);\n this._element.removeAttribute('aria-modal');\n this._element.removeAttribute('role');\n this._isTransitioning = false;\n this._backdrop.hide(() => {\n document.body.classList.remove(CLASS_NAME_OPEN);\n this._resetAdjustments();\n this._scrollBar.reset();\n EventHandler.trigger(this._element, EVENT_HIDDEN$4);\n });\n }\n _isAnimated() {\n return this._element.classList.contains(CLASS_NAME_FADE$3);\n }\n _triggerBackdropTransition() {\n const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE_PREVENTED$1);\n if (hideEvent.defaultPrevented) {\n return;\n }\n const isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight;\n const initialOverflowY = this._element.style.overflowY;\n // return if the following background transition hasn't yet completed\n if (initialOverflowY === 'hidden' || this._element.classList.contains(CLASS_NAME_STATIC)) {\n return;\n }\n if (!isModalOverflowing) {\n this._element.style.overflowY = 'hidden';\n }\n this._element.classList.add(CLASS_NAME_STATIC);\n this._queueCallback(() => {\n this._element.classList.remove(CLASS_NAME_STATIC);\n this._queueCallback(() => {\n this._element.style.overflowY = initialOverflowY;\n }, this._dialog);\n }, this._dialog);\n this._element.focus();\n }\n\n /**\n * The following methods are used to handle overflowing modals\n */\n\n _adjustDialog() {\n const isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight;\n const scrollbarWidth = this._scrollBar.getWidth();\n const isBodyOverflowing = scrollbarWidth > 0;\n if (isBodyOverflowing && !isModalOverflowing) {\n const property = isRTL() ? 'paddingLeft' : 'paddingRight';\n this._element.style[property] = `${scrollbarWidth}px`;\n }\n if (!isBodyOverflowing && isModalOverflowing) {\n const property = isRTL() ? 'paddingRight' : 'paddingLeft';\n this._element.style[property] = `${scrollbarWidth}px`;\n }\n }\n _resetAdjustments() {\n this._element.style.paddingLeft = '';\n this._element.style.paddingRight = '';\n }\n\n // Static\n static jQueryInterface(config, relatedTarget) {\n return this.each(function () {\n const data = Modal.getOrCreateInstance(this, config);\n if (typeof config !== 'string') {\n return;\n }\n if (typeof data[config] === 'undefined') {\n throw new TypeError(`No method named \"${config}\"`);\n }\n data[config](relatedTarget);\n });\n }\n}\n\n/**\n * Data API implementation\n */\n\nEventHandler.on(document, EVENT_CLICK_DATA_API$2, SELECTOR_DATA_TOGGLE$2, function (event) {\n const target = SelectorEngine.getElementFromSelector(this);\n if (['A', 'AREA'].includes(this.tagName)) {\n event.preventDefault();\n }\n EventHandler.one(target, EVENT_SHOW$4, showEvent => {\n if (showEvent.defaultPrevented) {\n // only register focus restorer if modal will actually get shown\n return;\n }\n EventHandler.one(target, EVENT_HIDDEN$4, () => {\n if (isVisible(this)) {\n this.focus();\n }\n });\n });\n\n // avoid conflict when clicking modal toggler while another one is open\n const alreadyOpen = SelectorEngine.findOne(OPEN_SELECTOR$1);\n if (alreadyOpen) {\n Modal.getInstance(alreadyOpen).hide();\n }\n const data = Modal.getOrCreateInstance(target);\n data.toggle(this);\n});\nenableDismissTrigger(Modal);\n\n/**\n * jQuery\n */\n\ndefineJQueryPlugin(Modal);\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap offcanvas.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n\n/**\n * Constants\n */\n\nconst NAME$6 = 'offcanvas';\nconst DATA_KEY$3 = 'bs.offcanvas';\nconst EVENT_KEY$3 = `.${DATA_KEY$3}`;\nconst DATA_API_KEY$1 = '.data-api';\nconst EVENT_LOAD_DATA_API$2 = `load${EVENT_KEY$3}${DATA_API_KEY$1}`;\nconst ESCAPE_KEY = 'Escape';\nconst CLASS_NAME_SHOW$3 = 'show';\nconst CLASS_NAME_SHOWING$1 = 'showing';\nconst CLASS_NAME_HIDING = 'hiding';\nconst CLASS_NAME_BACKDROP = 'offcanvas-backdrop';\nconst OPEN_SELECTOR = '.offcanvas.show';\nconst EVENT_SHOW$3 = `show${EVENT_KEY$3}`;\nconst EVENT_SHOWN$3 = `shown${EVENT_KEY$3}`;\nconst EVENT_HIDE$3 = `hide${EVENT_KEY$3}`;\nconst EVENT_HIDE_PREVENTED = `hidePrevented${EVENT_KEY$3}`;\nconst EVENT_HIDDEN$3 = `hidden${EVENT_KEY$3}`;\nconst EVENT_RESIZE = `resize${EVENT_KEY$3}`;\nconst EVENT_CLICK_DATA_API$1 = `click${EVENT_KEY$3}${DATA_API_KEY$1}`;\nconst EVENT_KEYDOWN_DISMISS = `keydown.dismiss${EVENT_KEY$3}`;\nconst SELECTOR_DATA_TOGGLE$1 = '[data-bs-toggle=\"offcanvas\"]';\nconst Default$5 = {\n backdrop: true,\n keyboard: true,\n scroll: false\n};\nconst DefaultType$5 = {\n backdrop: '(boolean|string)',\n keyboard: 'boolean',\n scroll: 'boolean'\n};\n\n/**\n * Class definition\n */\n\nclass Offcanvas extends BaseComponent {\n constructor(element, config) {\n super(element, config);\n this._isShown = false;\n this._backdrop = this._initializeBackDrop();\n this._focustrap = this._initializeFocusTrap();\n this._addEventListeners();\n }\n\n // Getters\n static get Default() {\n return Default$5;\n }\n static get DefaultType() {\n return DefaultType$5;\n }\n static get NAME() {\n return NAME$6;\n }\n\n // Public\n toggle(relatedTarget) {\n return this._isShown ? this.hide() : this.show(relatedTarget);\n }\n show(relatedTarget) {\n if (this._isShown) {\n return;\n }\n const showEvent = EventHandler.trigger(this._element, EVENT_SHOW$3, {\n relatedTarget\n });\n if (showEvent.defaultPrevented) {\n return;\n }\n this._isShown = true;\n this._backdrop.show();\n if (!this._config.scroll) {\n new ScrollBarHelper().hide();\n }\n this._element.setAttribute('aria-modal', true);\n this._element.setAttribute('role', 'dialog');\n this._element.classList.add(CLASS_NAME_SHOWING$1);\n const completeCallBack = () => {\n if (!this._config.scroll || this._config.backdrop) {\n this._focustrap.activate();\n }\n this._element.classList.add(CLASS_NAME_SHOW$3);\n this._element.classList.remove(CLASS_NAME_SHOWING$1);\n EventHandler.trigger(this._element, EVENT_SHOWN$3, {\n relatedTarget\n });\n };\n this._queueCallback(completeCallBack, this._element, true);\n }\n hide() {\n if (!this._isShown) {\n return;\n }\n const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE$3);\n if (hideEvent.defaultPrevented) {\n return;\n }\n this._focustrap.deactivate();\n this._element.blur();\n this._isShown = false;\n this._element.classList.add(CLASS_NAME_HIDING);\n this._backdrop.hide();\n const completeCallback = () => {\n this._element.classList.remove(CLASS_NAME_SHOW$3, CLASS_NAME_HIDING);\n this._element.removeAttribute('aria-modal');\n this._element.removeAttribute('role');\n if (!this._config.scroll) {\n new ScrollBarHelper().reset();\n }\n EventHandler.trigger(this._element, EVENT_HIDDEN$3);\n };\n this._queueCallback(completeCallback, this._element, true);\n }\n dispose() {\n this._backdrop.dispose();\n this._focustrap.deactivate();\n super.dispose();\n }\n\n // Private\n _initializeBackDrop() {\n const clickCallback = () => {\n if (this._config.backdrop === 'static') {\n EventHandler.trigger(this._element, EVENT_HIDE_PREVENTED);\n return;\n }\n this.hide();\n };\n\n // 'static' option will be translated to true, and booleans will keep their value\n const isVisible = Boolean(this._config.backdrop);\n return new Backdrop({\n className: CLASS_NAME_BACKDROP,\n isVisible,\n isAnimated: true,\n rootElement: this._element.parentNode,\n clickCallback: isVisible ? clickCallback : null\n });\n }\n _initializeFocusTrap() {\n return new FocusTrap({\n trapElement: this._element\n });\n }\n _addEventListeners() {\n EventHandler.on(this._element, EVENT_KEYDOWN_DISMISS, event => {\n if (event.key !== ESCAPE_KEY) {\n return;\n }\n if (this._config.keyboard) {\n this.hide();\n return;\n }\n EventHandler.trigger(this._element, EVENT_HIDE_PREVENTED);\n });\n }\n\n // Static\n static jQueryInterface(config) {\n return this.each(function () {\n const data = Offcanvas.getOrCreateInstance(this, config);\n if (typeof config !== 'string') {\n return;\n }\n if (data[config] === undefined || config.startsWith('_') || config === 'constructor') {\n throw new TypeError(`No method named \"${config}\"`);\n }\n data[config](this);\n });\n }\n}\n\n/**\n * Data API implementation\n */\n\nEventHandler.on(document, EVENT_CLICK_DATA_API$1, SELECTOR_DATA_TOGGLE$1, function (event) {\n const target = SelectorEngine.getElementFromSelector(this);\n if (['A', 'AREA'].includes(this.tagName)) {\n event.preventDefault();\n }\n if (isDisabled(this)) {\n return;\n }\n EventHandler.one(target, EVENT_HIDDEN$3, () => {\n // focus on trigger when it is closed\n if (isVisible(this)) {\n this.focus();\n }\n });\n\n // avoid conflict when clicking a toggler of an offcanvas, while another is open\n const alreadyOpen = SelectorEngine.findOne(OPEN_SELECTOR);\n if (alreadyOpen && alreadyOpen !== target) {\n Offcanvas.getInstance(alreadyOpen).hide();\n }\n const data = Offcanvas.getOrCreateInstance(target);\n data.toggle(this);\n});\nEventHandler.on(window, EVENT_LOAD_DATA_API$2, () => {\n for (const selector of SelectorEngine.find(OPEN_SELECTOR)) {\n Offcanvas.getOrCreateInstance(selector).show();\n }\n});\nEventHandler.on(window, EVENT_RESIZE, () => {\n for (const element of SelectorEngine.find('[aria-modal][class*=show][class*=offcanvas-]')) {\n if (getComputedStyle(element).position !== 'fixed') {\n Offcanvas.getOrCreateInstance(element).hide();\n }\n }\n});\nenableDismissTrigger(Offcanvas);\n\n/**\n * jQuery\n */\n\ndefineJQueryPlugin(Offcanvas);\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap util/sanitizer.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n// js-docs-start allow-list\nconst ARIA_ATTRIBUTE_PATTERN = /^aria-[\\w-]*$/i;\nconst DefaultAllowlist = {\n // Global attributes allowed on any supplied element below.\n '*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN],\n a: ['target', 'href', 'title', 'rel'],\n area: [],\n b: [],\n br: [],\n col: [],\n code: [],\n dd: [],\n div: [],\n dl: [],\n dt: [],\n em: [],\n hr: [],\n h1: [],\n h2: [],\n h3: [],\n h4: [],\n h5: [],\n h6: [],\n i: [],\n img: ['src', 'srcset', 'alt', 'title', 'width', 'height'],\n li: [],\n ol: [],\n p: [],\n pre: [],\n s: [],\n small: [],\n span: [],\n sub: [],\n sup: [],\n strong: [],\n u: [],\n ul: []\n};\n// js-docs-end allow-list\n\nconst uriAttributes = new Set(['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href']);\n\n/**\n * A pattern that recognizes URLs that are safe wrt. XSS in URL navigation\n * contexts.\n *\n * Shout-out to Angular https://github.com/angular/angular/blob/15.2.8/packages/core/src/sanitization/url_sanitizer.ts#L38\n */\n// eslint-disable-next-line unicorn/better-regex\nconst SAFE_URL_PATTERN = /^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i;\nconst allowedAttribute = (attribute, allowedAttributeList) => {\n const attributeName = attribute.nodeName.toLowerCase();\n if (allowedAttributeList.includes(attributeName)) {\n if (uriAttributes.has(attributeName)) {\n return Boolean(SAFE_URL_PATTERN.test(attribute.nodeValue));\n }\n return true;\n }\n\n // Check if a regular expression validates the attribute.\n return allowedAttributeList.filter(attributeRegex => attributeRegex instanceof RegExp).some(regex => regex.test(attributeName));\n};\nfunction sanitizeHtml(unsafeHtml, allowList, sanitizeFunction) {\n if (!unsafeHtml.length) {\n return unsafeHtml;\n }\n if (sanitizeFunction && typeof sanitizeFunction === 'function') {\n return sanitizeFunction(unsafeHtml);\n }\n const domParser = new window.DOMParser();\n const createdDocument = domParser.parseFromString(unsafeHtml, 'text/html');\n const elements = [].concat(...createdDocument.body.querySelectorAll('*'));\n for (const element of elements) {\n const elementName = element.nodeName.toLowerCase();\n if (!Object.keys(allowList).includes(elementName)) {\n element.remove();\n continue;\n }\n const attributeList = [].concat(...element.attributes);\n const allowedAttributes = [].concat(allowList['*'] || [], allowList[elementName] || []);\n for (const attribute of attributeList) {\n if (!allowedAttribute(attribute, allowedAttributes)) {\n element.removeAttribute(attribute.nodeName);\n }\n }\n }\n return createdDocument.body.innerHTML;\n}\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap util/template-factory.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n\n/**\n * Constants\n */\n\nconst NAME$5 = 'TemplateFactory';\nconst Default$4 = {\n allowList: DefaultAllowlist,\n content: {},\n // { selector : text , selector2 : text2 , }\n extraClass: '',\n html: false,\n sanitize: true,\n sanitizeFn: null,\n template: '
'\n};\nconst DefaultType$4 = {\n allowList: 'object',\n content: 'object',\n extraClass: '(string|function)',\n html: 'boolean',\n sanitize: 'boolean',\n sanitizeFn: '(null|function)',\n template: 'string'\n};\nconst DefaultContentType = {\n entry: '(string|element|function|null)',\n selector: '(string|element)'\n};\n\n/**\n * Class definition\n */\n\nclass TemplateFactory extends Config {\n constructor(config) {\n super();\n this._config = this._getConfig(config);\n }\n\n // Getters\n static get Default() {\n return Default$4;\n }\n static get DefaultType() {\n return DefaultType$4;\n }\n static get NAME() {\n return NAME$5;\n }\n\n // Public\n getContent() {\n return Object.values(this._config.content).map(config => this._resolvePossibleFunction(config)).filter(Boolean);\n }\n hasContent() {\n return this.getContent().length > 0;\n }\n changeContent(content) {\n this._checkContent(content);\n this._config.content = {\n ...this._config.content,\n ...content\n };\n return this;\n }\n toHtml() {\n const templateWrapper = document.createElement('div');\n templateWrapper.innerHTML = this._maybeSanitize(this._config.template);\n for (const [selector, text] of Object.entries(this._config.content)) {\n this._setContent(templateWrapper, text, selector);\n }\n const template = templateWrapper.children[0];\n const extraClass = this._resolvePossibleFunction(this._config.extraClass);\n if (extraClass) {\n template.classList.add(...extraClass.split(' '));\n }\n return template;\n }\n\n // Private\n _typeCheckConfig(config) {\n super._typeCheckConfig(config);\n this._checkContent(config.content);\n }\n _checkContent(arg) {\n for (const [selector, content] of Object.entries(arg)) {\n super._typeCheckConfig({\n selector,\n entry: content\n }, DefaultContentType);\n }\n }\n _setContent(template, content, selector) {\n const templateElement = SelectorEngine.findOne(selector, template);\n if (!templateElement) {\n return;\n }\n content = this._resolvePossibleFunction(content);\n if (!content) {\n templateElement.remove();\n return;\n }\n if (isElement(content)) {\n this._putElementInTemplate(getElement(content), templateElement);\n return;\n }\n if (this._config.html) {\n templateElement.innerHTML = this._maybeSanitize(content);\n return;\n }\n templateElement.textContent = content;\n }\n _maybeSanitize(arg) {\n return this._config.sanitize ? sanitizeHtml(arg, this._config.allowList, this._config.sanitizeFn) : arg;\n }\n _resolvePossibleFunction(arg) {\n return execute(arg, [this]);\n }\n _putElementInTemplate(element, templateElement) {\n if (this._config.html) {\n templateElement.innerHTML = '';\n templateElement.append(element);\n return;\n }\n templateElement.textContent = element.textContent;\n }\n}\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap tooltip.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n\n/**\n * Constants\n */\n\nconst NAME$4 = 'tooltip';\nconst DISALLOWED_ATTRIBUTES = new Set(['sanitize', 'allowList', 'sanitizeFn']);\nconst CLASS_NAME_FADE$2 = 'fade';\nconst CLASS_NAME_MODAL = 'modal';\nconst CLASS_NAME_SHOW$2 = 'show';\nconst SELECTOR_TOOLTIP_INNER = '.tooltip-inner';\nconst SELECTOR_MODAL = `.${CLASS_NAME_MODAL}`;\nconst EVENT_MODAL_HIDE = 'hide.bs.modal';\nconst TRIGGER_HOVER = 'hover';\nconst TRIGGER_FOCUS = 'focus';\nconst TRIGGER_CLICK = 'click';\nconst TRIGGER_MANUAL = 'manual';\nconst EVENT_HIDE$2 = 'hide';\nconst EVENT_HIDDEN$2 = 'hidden';\nconst EVENT_SHOW$2 = 'show';\nconst EVENT_SHOWN$2 = 'shown';\nconst EVENT_INSERTED = 'inserted';\nconst EVENT_CLICK$1 = 'click';\nconst EVENT_FOCUSIN$1 = 'focusin';\nconst EVENT_FOCUSOUT$1 = 'focusout';\nconst EVENT_MOUSEENTER = 'mouseenter';\nconst EVENT_MOUSELEAVE = 'mouseleave';\nconst AttachmentMap = {\n AUTO: 'auto',\n TOP: 'top',\n RIGHT: isRTL() ? 'left' : 'right',\n BOTTOM: 'bottom',\n LEFT: isRTL() ? 'right' : 'left'\n};\nconst Default$3 = {\n allowList: DefaultAllowlist,\n animation: true,\n boundary: 'clippingParents',\n container: false,\n customClass: '',\n delay: 0,\n fallbackPlacements: ['top', 'right', 'bottom', 'left'],\n html: false,\n offset: [0, 6],\n placement: 'top',\n popperConfig: null,\n sanitize: true,\n sanitizeFn: null,\n selector: false,\n template: '',\n title: '',\n trigger: 'hover focus'\n};\nconst DefaultType$3 = {\n allowList: 'object',\n animation: 'boolean',\n boundary: '(string|element)',\n container: '(string|element|boolean)',\n customClass: '(string|function)',\n delay: '(number|object)',\n fallbackPlacements: 'array',\n html: 'boolean',\n offset: '(array|string|function)',\n placement: '(string|function)',\n popperConfig: '(null|object|function)',\n sanitize: 'boolean',\n sanitizeFn: '(null|function)',\n selector: '(string|boolean)',\n template: 'string',\n title: '(string|element|function)',\n trigger: 'string'\n};\n\n/**\n * Class definition\n */\n\nclass Tooltip extends BaseComponent {\n constructor(element, config) {\n if (typeof Popper === 'undefined') {\n throw new TypeError('Bootstrap\\'s tooltips require Popper (https://popper.js.org)');\n }\n super(element, config);\n\n // Private\n this._isEnabled = true;\n this._timeout = 0;\n this._isHovered = null;\n this._activeTrigger = {};\n this._popper = null;\n this._templateFactory = null;\n this._newContent = null;\n\n // Protected\n this.tip = null;\n this._setListeners();\n if (!this._config.selector) {\n this._fixTitle();\n }\n }\n\n // Getters\n static get Default() {\n return Default$3;\n }\n static get DefaultType() {\n return DefaultType$3;\n }\n static get NAME() {\n return NAME$4;\n }\n\n // Public\n enable() {\n this._isEnabled = true;\n }\n disable() {\n this._isEnabled = false;\n }\n toggleEnabled() {\n this._isEnabled = !this._isEnabled;\n }\n toggle() {\n if (!this._isEnabled) {\n return;\n }\n this._activeTrigger.click = !this._activeTrigger.click;\n if (this._isShown()) {\n this._leave();\n return;\n }\n this._enter();\n }\n dispose() {\n clearTimeout(this._timeout);\n EventHandler.off(this._element.closest(SELECTOR_MODAL), EVENT_MODAL_HIDE, this._hideModalHandler);\n if (this._element.getAttribute('data-bs-original-title')) {\n this._element.setAttribute('title', this._element.getAttribute('data-bs-original-title'));\n }\n this._disposePopper();\n super.dispose();\n }\n show() {\n if (this._element.style.display === 'none') {\n throw new Error('Please use show on visible elements');\n }\n if (!(this._isWithContent() && this._isEnabled)) {\n return;\n }\n const showEvent = EventHandler.trigger(this._element, this.constructor.eventName(EVENT_SHOW$2));\n const shadowRoot = findShadowRoot(this._element);\n const isInTheDom = (shadowRoot || this._element.ownerDocument.documentElement).contains(this._element);\n if (showEvent.defaultPrevented || !isInTheDom) {\n return;\n }\n\n // TODO: v6 remove this or make it optional\n this._disposePopper();\n const tip = this._getTipElement();\n this._element.setAttribute('aria-describedby', tip.getAttribute('id'));\n const {\n container\n } = this._config;\n if (!this._element.ownerDocument.documentElement.contains(this.tip)) {\n container.append(tip);\n EventHandler.trigger(this._element, this.constructor.eventName(EVENT_INSERTED));\n }\n this._popper = this._createPopper(tip);\n tip.classList.add(CLASS_NAME_SHOW$2);\n\n // If this is a touch-enabled device we add extra\n // empty mouseover listeners to the body's immediate children;\n // only needed because of broken event delegation on iOS\n // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html\n if ('ontouchstart' in document.documentElement) {\n for (const element of [].concat(...document.body.children)) {\n EventHandler.on(element, 'mouseover', noop);\n }\n }\n const complete = () => {\n EventHandler.trigger(this._element, this.constructor.eventName(EVENT_SHOWN$2));\n if (this._isHovered === false) {\n this._leave();\n }\n this._isHovered = false;\n };\n this._queueCallback(complete, this.tip, this._isAnimated());\n }\n hide() {\n if (!this._isShown()) {\n return;\n }\n const hideEvent = EventHandler.trigger(this._element, this.constructor.eventName(EVENT_HIDE$2));\n if (hideEvent.defaultPrevented) {\n return;\n }\n const tip = this._getTipElement();\n tip.classList.remove(CLASS_NAME_SHOW$2);\n\n // If this is a touch-enabled device we remove the extra\n // empty mouseover listeners we added for iOS support\n if ('ontouchstart' in document.documentElement) {\n for (const element of [].concat(...document.body.children)) {\n EventHandler.off(element, 'mouseover', noop);\n }\n }\n this._activeTrigger[TRIGGER_CLICK] = false;\n this._activeTrigger[TRIGGER_FOCUS] = false;\n this._activeTrigger[TRIGGER_HOVER] = false;\n this._isHovered = null; // it is a trick to support manual triggering\n\n const complete = () => {\n if (this._isWithActiveTrigger()) {\n return;\n }\n if (!this._isHovered) {\n this._disposePopper();\n }\n this._element.removeAttribute('aria-describedby');\n EventHandler.trigger(this._element, this.constructor.eventName(EVENT_HIDDEN$2));\n };\n this._queueCallback(complete, this.tip, this._isAnimated());\n }\n update() {\n if (this._popper) {\n this._popper.update();\n }\n }\n\n // Protected\n _isWithContent() {\n return Boolean(this._getTitle());\n }\n _getTipElement() {\n if (!this.tip) {\n this.tip = this._createTipElement(this._newContent || this._getContentForTemplate());\n }\n return this.tip;\n }\n _createTipElement(content) {\n const tip = this._getTemplateFactory(content).toHtml();\n\n // TODO: remove this check in v6\n if (!tip) {\n return null;\n }\n tip.classList.remove(CLASS_NAME_FADE$2, CLASS_NAME_SHOW$2);\n // TODO: v6 the following can be achieved with CSS only\n tip.classList.add(`bs-${this.constructor.NAME}-auto`);\n const tipId = getUID(this.constructor.NAME).toString();\n tip.setAttribute('id', tipId);\n if (this._isAnimated()) {\n tip.classList.add(CLASS_NAME_FADE$2);\n }\n return tip;\n }\n setContent(content) {\n this._newContent = content;\n if (this._isShown()) {\n this._disposePopper();\n this.show();\n }\n }\n _getTemplateFactory(content) {\n if (this._templateFactory) {\n this._templateFactory.changeContent(content);\n } else {\n this._templateFactory = new TemplateFactory({\n ...this._config,\n // the `content` var has to be after `this._config`\n // to override config.content in case of popover\n content,\n extraClass: this._resolvePossibleFunction(this._config.customClass)\n });\n }\n return this._templateFactory;\n }\n _getContentForTemplate() {\n return {\n [SELECTOR_TOOLTIP_INNER]: this._getTitle()\n };\n }\n _getTitle() {\n return this._resolvePossibleFunction(this._config.title) || this._element.getAttribute('data-bs-original-title');\n }\n\n // Private\n _initializeOnDelegatedTarget(event) {\n return this.constructor.getOrCreateInstance(event.delegateTarget, this._getDelegateConfig());\n }\n _isAnimated() {\n return this._config.animation || this.tip && this.tip.classList.contains(CLASS_NAME_FADE$2);\n }\n _isShown() {\n return this.tip && this.tip.classList.contains(CLASS_NAME_SHOW$2);\n }\n _createPopper(tip) {\n const placement = execute(this._config.placement, [this, tip, this._element]);\n const attachment = AttachmentMap[placement.toUpperCase()];\n return Popper.createPopper(this._element, tip, this._getPopperConfig(attachment));\n }\n _getOffset() {\n const {\n offset\n } = this._config;\n if (typeof offset === 'string') {\n return offset.split(',').map(value => Number.parseInt(value, 10));\n }\n if (typeof offset === 'function') {\n return popperData => offset(popperData, this._element);\n }\n return offset;\n }\n _resolvePossibleFunction(arg) {\n return execute(arg, [this._element]);\n }\n _getPopperConfig(attachment) {\n const defaultBsPopperConfig = {\n placement: attachment,\n modifiers: [{\n name: 'flip',\n options: {\n fallbackPlacements: this._config.fallbackPlacements\n }\n }, {\n name: 'offset',\n options: {\n offset: this._getOffset()\n }\n }, {\n name: 'preventOverflow',\n options: {\n boundary: this._config.boundary\n }\n }, {\n name: 'arrow',\n options: {\n element: `.${this.constructor.NAME}-arrow`\n }\n }, {\n name: 'preSetPlacement',\n enabled: true,\n phase: 'beforeMain',\n fn: data => {\n // Pre-set Popper's placement attribute in order to read the arrow sizes properly.\n // Otherwise, Popper mixes up the width and height dimensions since the initial arrow style is for top placement\n this._getTipElement().setAttribute('data-popper-placement', data.state.placement);\n }\n }]\n };\n return {\n ...defaultBsPopperConfig,\n ...execute(this._config.popperConfig, [defaultBsPopperConfig])\n };\n }\n _setListeners() {\n const triggers = this._config.trigger.split(' ');\n for (const trigger of triggers) {\n if (trigger === 'click') {\n EventHandler.on(this._element, this.constructor.eventName(EVENT_CLICK$1), this._config.selector, event => {\n const context = this._initializeOnDelegatedTarget(event);\n context.toggle();\n });\n } else if (trigger !== TRIGGER_MANUAL) {\n const eventIn = trigger === TRIGGER_HOVER ? this.constructor.eventName(EVENT_MOUSEENTER) : this.constructor.eventName(EVENT_FOCUSIN$1);\n const eventOut = trigger === TRIGGER_HOVER ? this.constructor.eventName(EVENT_MOUSELEAVE) : this.constructor.eventName(EVENT_FOCUSOUT$1);\n EventHandler.on(this._element, eventIn, this._config.selector, event => {\n const context = this._initializeOnDelegatedTarget(event);\n context._activeTrigger[event.type === 'focusin' ? TRIGGER_FOCUS : TRIGGER_HOVER] = true;\n context._enter();\n });\n EventHandler.on(this._element, eventOut, this._config.selector, event => {\n const context = this._initializeOnDelegatedTarget(event);\n context._activeTrigger[event.type === 'focusout' ? TRIGGER_FOCUS : TRIGGER_HOVER] = context._element.contains(event.relatedTarget);\n context._leave();\n });\n }\n }\n this._hideModalHandler = () => {\n if (this._element) {\n this.hide();\n }\n };\n EventHandler.on(this._element.closest(SELECTOR_MODAL), EVENT_MODAL_HIDE, this._hideModalHandler);\n }\n _fixTitle() {\n const title = this._element.getAttribute('title');\n if (!title) {\n return;\n }\n if (!this._element.getAttribute('aria-label') && !this._element.textContent.trim()) {\n this._element.setAttribute('aria-label', title);\n }\n this._element.setAttribute('data-bs-original-title', title); // DO NOT USE IT. Is only for backwards compatibility\n this._element.removeAttribute('title');\n }\n _enter() {\n if (this._isShown() || this._isHovered) {\n this._isHovered = true;\n return;\n }\n this._isHovered = true;\n this._setTimeout(() => {\n if (this._isHovered) {\n this.show();\n }\n }, this._config.delay.show);\n }\n _leave() {\n if (this._isWithActiveTrigger()) {\n return;\n }\n this._isHovered = false;\n this._setTimeout(() => {\n if (!this._isHovered) {\n this.hide();\n }\n }, this._config.delay.hide);\n }\n _setTimeout(handler, timeout) {\n clearTimeout(this._timeout);\n this._timeout = setTimeout(handler, timeout);\n }\n _isWithActiveTrigger() {\n return Object.values(this._activeTrigger).includes(true);\n }\n _getConfig(config) {\n const dataAttributes = Manipulator.getDataAttributes(this._element);\n for (const dataAttribute of Object.keys(dataAttributes)) {\n if (DISALLOWED_ATTRIBUTES.has(dataAttribute)) {\n delete dataAttributes[dataAttribute];\n }\n }\n config = {\n ...dataAttributes,\n ...(typeof config === 'object' && config ? config : {})\n };\n config = this._mergeConfigObj(config);\n config = this._configAfterMerge(config);\n this._typeCheckConfig(config);\n return config;\n }\n _configAfterMerge(config) {\n config.container = config.container === false ? document.body : getElement(config.container);\n if (typeof config.delay === 'number') {\n config.delay = {\n show: config.delay,\n hide: config.delay\n };\n }\n if (typeof config.title === 'number') {\n config.title = config.title.toString();\n }\n if (typeof config.content === 'number') {\n config.content = config.content.toString();\n }\n return config;\n }\n _getDelegateConfig() {\n const config = {};\n for (const [key, value] of Object.entries(this._config)) {\n if (this.constructor.Default[key] !== value) {\n config[key] = value;\n }\n }\n config.selector = false;\n config.trigger = 'manual';\n\n // In the future can be replaced with:\n // const keysWithDifferentValues = Object.entries(this._config).filter(entry => this.constructor.Default[entry[0]] !== this._config[entry[0]])\n // `Object.fromEntries(keysWithDifferentValues)`\n return config;\n }\n _disposePopper() {\n if (this._popper) {\n this._popper.destroy();\n this._popper = null;\n }\n if (this.tip) {\n this.tip.remove();\n this.tip = null;\n }\n }\n\n // Static\n static jQueryInterface(config) {\n return this.each(function () {\n const data = Tooltip.getOrCreateInstance(this, config);\n if (typeof config !== 'string') {\n return;\n }\n if (typeof data[config] === 'undefined') {\n throw new TypeError(`No method named \"${config}\"`);\n }\n data[config]();\n });\n }\n}\n\n/**\n * jQuery\n */\n\ndefineJQueryPlugin(Tooltip);\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap popover.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n\n/**\n * Constants\n */\n\nconst NAME$3 = 'popover';\nconst SELECTOR_TITLE = '.popover-header';\nconst SELECTOR_CONTENT = '.popover-body';\nconst Default$2 = {\n ...Tooltip.Default,\n content: '',\n offset: [0, 8],\n placement: 'right',\n template: '',\n trigger: 'click'\n};\nconst DefaultType$2 = {\n ...Tooltip.DefaultType,\n content: '(null|string|element|function)'\n};\n\n/**\n * Class definition\n */\n\nclass Popover extends Tooltip {\n // Getters\n static get Default() {\n return Default$2;\n }\n static get DefaultType() {\n return DefaultType$2;\n }\n static get NAME() {\n return NAME$3;\n }\n\n // Overrides\n _isWithContent() {\n return this._getTitle() || this._getContent();\n }\n\n // Private\n _getContentForTemplate() {\n return {\n [SELECTOR_TITLE]: this._getTitle(),\n [SELECTOR_CONTENT]: this._getContent()\n };\n }\n _getContent() {\n return this._resolvePossibleFunction(this._config.content);\n }\n\n // Static\n static jQueryInterface(config) {\n return this.each(function () {\n const data = Popover.getOrCreateInstance(this, config);\n if (typeof config !== 'string') {\n return;\n }\n if (typeof data[config] === 'undefined') {\n throw new TypeError(`No method named \"${config}\"`);\n }\n data[config]();\n });\n }\n}\n\n/**\n * jQuery\n */\n\ndefineJQueryPlugin(Popover);\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap scrollspy.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n\n/**\n * Constants\n */\n\nconst NAME$2 = 'scrollspy';\nconst DATA_KEY$2 = 'bs.scrollspy';\nconst EVENT_KEY$2 = `.${DATA_KEY$2}`;\nconst DATA_API_KEY = '.data-api';\nconst EVENT_ACTIVATE = `activate${EVENT_KEY$2}`;\nconst EVENT_CLICK = `click${EVENT_KEY$2}`;\nconst EVENT_LOAD_DATA_API$1 = `load${EVENT_KEY$2}${DATA_API_KEY}`;\nconst CLASS_NAME_DROPDOWN_ITEM = 'dropdown-item';\nconst CLASS_NAME_ACTIVE$1 = 'active';\nconst SELECTOR_DATA_SPY = '[data-bs-spy=\"scroll\"]';\nconst SELECTOR_TARGET_LINKS = '[href]';\nconst SELECTOR_NAV_LIST_GROUP = '.nav, .list-group';\nconst SELECTOR_NAV_LINKS = '.nav-link';\nconst SELECTOR_NAV_ITEMS = '.nav-item';\nconst SELECTOR_LIST_ITEMS = '.list-group-item';\nconst SELECTOR_LINK_ITEMS = `${SELECTOR_NAV_LINKS}, ${SELECTOR_NAV_ITEMS} > ${SELECTOR_NAV_LINKS}, ${SELECTOR_LIST_ITEMS}`;\nconst SELECTOR_DROPDOWN = '.dropdown';\nconst SELECTOR_DROPDOWN_TOGGLE$1 = '.dropdown-toggle';\nconst Default$1 = {\n offset: null,\n // TODO: v6 @deprecated, keep it for backwards compatibility reasons\n rootMargin: '0px 0px -25%',\n smoothScroll: false,\n target: null,\n threshold: [0.1, 0.5, 1]\n};\nconst DefaultType$1 = {\n offset: '(number|null)',\n // TODO v6 @deprecated, keep it for backwards compatibility reasons\n rootMargin: 'string',\n smoothScroll: 'boolean',\n target: 'element',\n threshold: 'array'\n};\n\n/**\n * Class definition\n */\n\nclass ScrollSpy extends BaseComponent {\n constructor(element, config) {\n super(element, config);\n\n // this._element is the observablesContainer and config.target the menu links wrapper\n this._targetLinks = new Map();\n this._observableSections = new Map();\n this._rootElement = getComputedStyle(this._element).overflowY === 'visible' ? null : this._element;\n this._activeTarget = null;\n this._observer = null;\n this._previousScrollData = {\n visibleEntryTop: 0,\n parentScrollTop: 0\n };\n this.refresh(); // initialize\n }\n\n // Getters\n static get Default() {\n return Default$1;\n }\n static get DefaultType() {\n return DefaultType$1;\n }\n static get NAME() {\n return NAME$2;\n }\n\n // Public\n refresh() {\n this._initializeTargetsAndObservables();\n this._maybeEnableSmoothScroll();\n if (this._observer) {\n this._observer.disconnect();\n } else {\n this._observer = this._getNewObserver();\n }\n for (const section of this._observableSections.values()) {\n this._observer.observe(section);\n }\n }\n dispose() {\n this._observer.disconnect();\n super.dispose();\n }\n\n // Private\n _configAfterMerge(config) {\n // TODO: on v6 target should be given explicitly & remove the {target: 'ss-target'} case\n config.target = getElement(config.target) || document.body;\n\n // TODO: v6 Only for backwards compatibility reasons. Use rootMargin only\n config.rootMargin = config.offset ? `${config.offset}px 0px -30%` : config.rootMargin;\n if (typeof config.threshold === 'string') {\n config.threshold = config.threshold.split(',').map(value => Number.parseFloat(value));\n }\n return config;\n }\n _maybeEnableSmoothScroll() {\n if (!this._config.smoothScroll) {\n return;\n }\n\n // unregister any previous listeners\n EventHandler.off(this._config.target, EVENT_CLICK);\n EventHandler.on(this._config.target, EVENT_CLICK, SELECTOR_TARGET_LINKS, event => {\n const observableSection = this._observableSections.get(event.target.hash);\n if (observableSection) {\n event.preventDefault();\n const root = this._rootElement || window;\n const height = observableSection.offsetTop - this._element.offsetTop;\n if (root.scrollTo) {\n root.scrollTo({\n top: height,\n behavior: 'smooth'\n });\n return;\n }\n\n // Chrome 60 doesn't support `scrollTo`\n root.scrollTop = height;\n }\n });\n }\n _getNewObserver() {\n const options = {\n root: this._rootElement,\n threshold: this._config.threshold,\n rootMargin: this._config.rootMargin\n };\n return new IntersectionObserver(entries => this._observerCallback(entries), options);\n }\n\n // The logic of selection\n _observerCallback(entries) {\n const targetElement = entry => this._targetLinks.get(`#${entry.target.id}`);\n const activate = entry => {\n this._previousScrollData.visibleEntryTop = entry.target.offsetTop;\n this._process(targetElement(entry));\n };\n const parentScrollTop = (this._rootElement || document.documentElement).scrollTop;\n const userScrollsDown = parentScrollTop >= this._previousScrollData.parentScrollTop;\n this._previousScrollData.parentScrollTop = parentScrollTop;\n for (const entry of entries) {\n if (!entry.isIntersecting) {\n this._activeTarget = null;\n this._clearActiveClass(targetElement(entry));\n continue;\n }\n const entryIsLowerThanPrevious = entry.target.offsetTop >= this._previousScrollData.visibleEntryTop;\n // if we are scrolling down, pick the bigger offsetTop\n if (userScrollsDown && entryIsLowerThanPrevious) {\n activate(entry);\n // if parent isn't scrolled, let's keep the first visible item, breaking the iteration\n if (!parentScrollTop) {\n return;\n }\n continue;\n }\n\n // if we are scrolling up, pick the smallest offsetTop\n if (!userScrollsDown && !entryIsLowerThanPrevious) {\n activate(entry);\n }\n }\n }\n _initializeTargetsAndObservables() {\n this._targetLinks = new Map();\n this._observableSections = new Map();\n const targetLinks = SelectorEngine.find(SELECTOR_TARGET_LINKS, this._config.target);\n for (const anchor of targetLinks) {\n // ensure that the anchor has an id and is not disabled\n if (!anchor.hash || isDisabled(anchor)) {\n continue;\n }\n const observableSection = SelectorEngine.findOne(decodeURI(anchor.hash), this._element);\n\n // ensure that the observableSection exists & is visible\n if (isVisible(observableSection)) {\n this._targetLinks.set(decodeURI(anchor.hash), anchor);\n this._observableSections.set(anchor.hash, observableSection);\n }\n }\n }\n _process(target) {\n if (this._activeTarget === target) {\n return;\n }\n this._clearActiveClass(this._config.target);\n this._activeTarget = target;\n target.classList.add(CLASS_NAME_ACTIVE$1);\n this._activateParents(target);\n EventHandler.trigger(this._element, EVENT_ACTIVATE, {\n relatedTarget: target\n });\n }\n _activateParents(target) {\n // Activate dropdown parents\n if (target.classList.contains(CLASS_NAME_DROPDOWN_ITEM)) {\n SelectorEngine.findOne(SELECTOR_DROPDOWN_TOGGLE$1, target.closest(SELECTOR_DROPDOWN)).classList.add(CLASS_NAME_ACTIVE$1);\n return;\n }\n for (const listGroup of SelectorEngine.parents(target, SELECTOR_NAV_LIST_GROUP)) {\n // Set triggered links parents as active\n // With both and markup a parent is the previous sibling of any nav ancestor\n for (const item of SelectorEngine.prev(listGroup, SELECTOR_LINK_ITEMS)) {\n item.classList.add(CLASS_NAME_ACTIVE$1);\n }\n }\n }\n _clearActiveClass(parent) {\n parent.classList.remove(CLASS_NAME_ACTIVE$1);\n const activeNodes = SelectorEngine.find(`${SELECTOR_TARGET_LINKS}.${CLASS_NAME_ACTIVE$1}`, parent);\n for (const node of activeNodes) {\n node.classList.remove(CLASS_NAME_ACTIVE$1);\n }\n }\n\n // Static\n static jQueryInterface(config) {\n return this.each(function () {\n const data = ScrollSpy.getOrCreateInstance(this, config);\n if (typeof config !== 'string') {\n return;\n }\n if (data[config] === undefined || config.startsWith('_') || config === 'constructor') {\n throw new TypeError(`No method named \"${config}\"`);\n }\n data[config]();\n });\n }\n}\n\n/**\n * Data API implementation\n */\n\nEventHandler.on(window, EVENT_LOAD_DATA_API$1, () => {\n for (const spy of SelectorEngine.find(SELECTOR_DATA_SPY)) {\n ScrollSpy.getOrCreateInstance(spy);\n }\n});\n\n/**\n * jQuery\n */\n\ndefineJQueryPlugin(ScrollSpy);\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap tab.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n\n/**\n * Constants\n */\n\nconst NAME$1 = 'tab';\nconst DATA_KEY$1 = 'bs.tab';\nconst EVENT_KEY$1 = `.${DATA_KEY$1}`;\nconst EVENT_HIDE$1 = `hide${EVENT_KEY$1}`;\nconst EVENT_HIDDEN$1 = `hidden${EVENT_KEY$1}`;\nconst EVENT_SHOW$1 = `show${EVENT_KEY$1}`;\nconst EVENT_SHOWN$1 = `shown${EVENT_KEY$1}`;\nconst EVENT_CLICK_DATA_API = `click${EVENT_KEY$1}`;\nconst EVENT_KEYDOWN = `keydown${EVENT_KEY$1}`;\nconst EVENT_LOAD_DATA_API = `load${EVENT_KEY$1}`;\nconst ARROW_LEFT_KEY = 'ArrowLeft';\nconst ARROW_RIGHT_KEY = 'ArrowRight';\nconst ARROW_UP_KEY = 'ArrowUp';\nconst ARROW_DOWN_KEY = 'ArrowDown';\nconst HOME_KEY = 'Home';\nconst END_KEY = 'End';\nconst CLASS_NAME_ACTIVE = 'active';\nconst CLASS_NAME_FADE$1 = 'fade';\nconst CLASS_NAME_SHOW$1 = 'show';\nconst CLASS_DROPDOWN = 'dropdown';\nconst SELECTOR_DROPDOWN_TOGGLE = '.dropdown-toggle';\nconst SELECTOR_DROPDOWN_MENU = '.dropdown-menu';\nconst NOT_SELECTOR_DROPDOWN_TOGGLE = `:not(${SELECTOR_DROPDOWN_TOGGLE})`;\nconst SELECTOR_TAB_PANEL = '.list-group, .nav, [role=\"tablist\"]';\nconst SELECTOR_OUTER = '.nav-item, .list-group-item';\nconst SELECTOR_INNER = `.nav-link${NOT_SELECTOR_DROPDOWN_TOGGLE}, .list-group-item${NOT_SELECTOR_DROPDOWN_TOGGLE}, [role=\"tab\"]${NOT_SELECTOR_DROPDOWN_TOGGLE}`;\nconst SELECTOR_DATA_TOGGLE = '[data-bs-toggle=\"tab\"], [data-bs-toggle=\"pill\"], [data-bs-toggle=\"list\"]'; // TODO: could only be `tab` in v6\nconst SELECTOR_INNER_ELEM = `${SELECTOR_INNER}, ${SELECTOR_DATA_TOGGLE}`;\nconst SELECTOR_DATA_TOGGLE_ACTIVE = `.${CLASS_NAME_ACTIVE}[data-bs-toggle=\"tab\"], .${CLASS_NAME_ACTIVE}[data-bs-toggle=\"pill\"], .${CLASS_NAME_ACTIVE}[data-bs-toggle=\"list\"]`;\n\n/**\n * Class definition\n */\n\nclass Tab extends BaseComponent {\n constructor(element) {\n super(element);\n this._parent = this._element.closest(SELECTOR_TAB_PANEL);\n if (!this._parent) {\n return;\n // TODO: should throw exception in v6\n // throw new TypeError(`${element.outerHTML} has not a valid parent ${SELECTOR_INNER_ELEM}`)\n }\n\n // Set up initial aria attributes\n this._setInitialAttributes(this._parent, this._getChildren());\n EventHandler.on(this._element, EVENT_KEYDOWN, event => this._keydown(event));\n }\n\n // Getters\n static get NAME() {\n return NAME$1;\n }\n\n // Public\n show() {\n // Shows this elem and deactivate the active sibling if exists\n const innerElem = this._element;\n if (this._elemIsActive(innerElem)) {\n return;\n }\n\n // Search for active tab on same parent to deactivate it\n const active = this._getActiveElem();\n const hideEvent = active ? EventHandler.trigger(active, EVENT_HIDE$1, {\n relatedTarget: innerElem\n }) : null;\n const showEvent = EventHandler.trigger(innerElem, EVENT_SHOW$1, {\n relatedTarget: active\n });\n if (showEvent.defaultPrevented || hideEvent && hideEvent.defaultPrevented) {\n return;\n }\n this._deactivate(active, innerElem);\n this._activate(innerElem, active);\n }\n\n // Private\n _activate(element, relatedElem) {\n if (!element) {\n return;\n }\n element.classList.add(CLASS_NAME_ACTIVE);\n this._activate(SelectorEngine.getElementFromSelector(element)); // Search and activate/show the proper section\n\n const complete = () => {\n if (element.getAttribute('role') !== 'tab') {\n element.classList.add(CLASS_NAME_SHOW$1);\n return;\n }\n element.removeAttribute('tabindex');\n element.setAttribute('aria-selected', true);\n this._toggleDropDown(element, true);\n EventHandler.trigger(element, EVENT_SHOWN$1, {\n relatedTarget: relatedElem\n });\n };\n this._queueCallback(complete, element, element.classList.contains(CLASS_NAME_FADE$1));\n }\n _deactivate(element, relatedElem) {\n if (!element) {\n return;\n }\n element.classList.remove(CLASS_NAME_ACTIVE);\n element.blur();\n this._deactivate(SelectorEngine.getElementFromSelector(element)); // Search and deactivate the shown section too\n\n const complete = () => {\n if (element.getAttribute('role') !== 'tab') {\n element.classList.remove(CLASS_NAME_SHOW$1);\n return;\n }\n element.setAttribute('aria-selected', false);\n element.setAttribute('tabindex', '-1');\n this._toggleDropDown(element, false);\n EventHandler.trigger(element, EVENT_HIDDEN$1, {\n relatedTarget: relatedElem\n });\n };\n this._queueCallback(complete, element, element.classList.contains(CLASS_NAME_FADE$1));\n }\n _keydown(event) {\n if (![ARROW_LEFT_KEY, ARROW_RIGHT_KEY, ARROW_UP_KEY, ARROW_DOWN_KEY, HOME_KEY, END_KEY].includes(event.key)) {\n return;\n }\n event.stopPropagation(); // stopPropagation/preventDefault both added to support up/down keys without scrolling the page\n event.preventDefault();\n const children = this._getChildren().filter(element => !isDisabled(element));\n let nextActiveElement;\n if ([HOME_KEY, END_KEY].includes(event.key)) {\n nextActiveElement = children[event.key === HOME_KEY ? 0 : children.length - 1];\n } else {\n const isNext = [ARROW_RIGHT_KEY, ARROW_DOWN_KEY].includes(event.key);\n nextActiveElement = getNextActiveElement(children, event.target, isNext, true);\n }\n if (nextActiveElement) {\n nextActiveElement.focus({\n preventScroll: true\n });\n Tab.getOrCreateInstance(nextActiveElement).show();\n }\n }\n _getChildren() {\n // collection of inner elements\n return SelectorEngine.find(SELECTOR_INNER_ELEM, this._parent);\n }\n _getActiveElem() {\n return this._getChildren().find(child => this._elemIsActive(child)) || null;\n }\n _setInitialAttributes(parent, children) {\n this._setAttributeIfNotExists(parent, 'role', 'tablist');\n for (const child of children) {\n this._setInitialAttributesOnChild(child);\n }\n }\n _setInitialAttributesOnChild(child) {\n child = this._getInnerElement(child);\n const isActive = this._elemIsActive(child);\n const outerElem = this._getOuterElement(child);\n child.setAttribute('aria-selected', isActive);\n if (outerElem !== child) {\n this._setAttributeIfNotExists(outerElem, 'role', 'presentation');\n }\n if (!isActive) {\n child.setAttribute('tabindex', '-1');\n }\n this._setAttributeIfNotExists(child, 'role', 'tab');\n\n // set attributes to the related panel too\n this._setInitialAttributesOnTargetPanel(child);\n }\n _setInitialAttributesOnTargetPanel(child) {\n const target = SelectorEngine.getElementFromSelector(child);\n if (!target) {\n return;\n }\n this._setAttributeIfNotExists(target, 'role', 'tabpanel');\n if (child.id) {\n this._setAttributeIfNotExists(target, 'aria-labelledby', `${child.id}`);\n }\n }\n _toggleDropDown(element, open) {\n const outerElem = this._getOuterElement(element);\n if (!outerElem.classList.contains(CLASS_DROPDOWN)) {\n return;\n }\n const toggle = (selector, className) => {\n const element = SelectorEngine.findOne(selector, outerElem);\n if (element) {\n element.classList.toggle(className, open);\n }\n };\n toggle(SELECTOR_DROPDOWN_TOGGLE, CLASS_NAME_ACTIVE);\n toggle(SELECTOR_DROPDOWN_MENU, CLASS_NAME_SHOW$1);\n outerElem.setAttribute('aria-expanded', open);\n }\n _setAttributeIfNotExists(element, attribute, value) {\n if (!element.hasAttribute(attribute)) {\n element.setAttribute(attribute, value);\n }\n }\n _elemIsActive(elem) {\n return elem.classList.contains(CLASS_NAME_ACTIVE);\n }\n\n // Try to get the inner element (usually the .nav-link)\n _getInnerElement(elem) {\n return elem.matches(SELECTOR_INNER_ELEM) ? elem : SelectorEngine.findOne(SELECTOR_INNER_ELEM, elem);\n }\n\n // Try to get the outer element (usually the .nav-item)\n _getOuterElement(elem) {\n return elem.closest(SELECTOR_OUTER) || elem;\n }\n\n // Static\n static jQueryInterface(config) {\n return this.each(function () {\n const data = Tab.getOrCreateInstance(this);\n if (typeof config !== 'string') {\n return;\n }\n if (data[config] === undefined || config.startsWith('_') || config === 'constructor') {\n throw new TypeError(`No method named \"${config}\"`);\n }\n data[config]();\n });\n }\n}\n\n/**\n * Data API implementation\n */\n\nEventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {\n if (['A', 'AREA'].includes(this.tagName)) {\n event.preventDefault();\n }\n if (isDisabled(this)) {\n return;\n }\n Tab.getOrCreateInstance(this).show();\n});\n\n/**\n * Initialize on focus\n */\nEventHandler.on(window, EVENT_LOAD_DATA_API, () => {\n for (const element of SelectorEngine.find(SELECTOR_DATA_TOGGLE_ACTIVE)) {\n Tab.getOrCreateInstance(element);\n }\n});\n/**\n * jQuery\n */\n\ndefineJQueryPlugin(Tab);\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap toast.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n\n/**\n * Constants\n */\n\nconst NAME = 'toast';\nconst DATA_KEY = 'bs.toast';\nconst EVENT_KEY = `.${DATA_KEY}`;\nconst EVENT_MOUSEOVER = `mouseover${EVENT_KEY}`;\nconst EVENT_MOUSEOUT = `mouseout${EVENT_KEY}`;\nconst EVENT_FOCUSIN = `focusin${EVENT_KEY}`;\nconst EVENT_FOCUSOUT = `focusout${EVENT_KEY}`;\nconst EVENT_HIDE = `hide${EVENT_KEY}`;\nconst EVENT_HIDDEN = `hidden${EVENT_KEY}`;\nconst EVENT_SHOW = `show${EVENT_KEY}`;\nconst EVENT_SHOWN = `shown${EVENT_KEY}`;\nconst CLASS_NAME_FADE = 'fade';\nconst CLASS_NAME_HIDE = 'hide'; // @deprecated - kept here only for backwards compatibility\nconst CLASS_NAME_SHOW = 'show';\nconst CLASS_NAME_SHOWING = 'showing';\nconst DefaultType = {\n animation: 'boolean',\n autohide: 'boolean',\n delay: 'number'\n};\nconst Default = {\n animation: true,\n autohide: true,\n delay: 5000\n};\n\n/**\n * Class definition\n */\n\nclass Toast extends BaseComponent {\n constructor(element, config) {\n super(element, config);\n this._timeout = null;\n this._hasMouseInteraction = false;\n this._hasKeyboardInteraction = false;\n this._setListeners();\n }\n\n // Getters\n static get Default() {\n return Default;\n }\n static get DefaultType() {\n return DefaultType;\n }\n static get NAME() {\n return NAME;\n }\n\n // Public\n show() {\n const showEvent = EventHandler.trigger(this._element, EVENT_SHOW);\n if (showEvent.defaultPrevented) {\n return;\n }\n this._clearTimeout();\n if (this._config.animation) {\n this._element.classList.add(CLASS_NAME_FADE);\n }\n const complete = () => {\n this._element.classList.remove(CLASS_NAME_SHOWING);\n EventHandler.trigger(this._element, EVENT_SHOWN);\n this._maybeScheduleHide();\n };\n this._element.classList.remove(CLASS_NAME_HIDE); // @deprecated\n reflow(this._element);\n this._element.classList.add(CLASS_NAME_SHOW, CLASS_NAME_SHOWING);\n this._queueCallback(complete, this._element, this._config.animation);\n }\n hide() {\n if (!this.isShown()) {\n return;\n }\n const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE);\n if (hideEvent.defaultPrevented) {\n return;\n }\n const complete = () => {\n this._element.classList.add(CLASS_NAME_HIDE); // @deprecated\n this._element.classList.remove(CLASS_NAME_SHOWING, CLASS_NAME_SHOW);\n EventHandler.trigger(this._element, EVENT_HIDDEN);\n };\n this._element.classList.add(CLASS_NAME_SHOWING);\n this._queueCallback(complete, this._element, this._config.animation);\n }\n dispose() {\n this._clearTimeout();\n if (this.isShown()) {\n this._element.classList.remove(CLASS_NAME_SHOW);\n }\n super.dispose();\n }\n isShown() {\n return this._element.classList.contains(CLASS_NAME_SHOW);\n }\n\n // Private\n\n _maybeScheduleHide() {\n if (!this._config.autohide) {\n return;\n }\n if (this._hasMouseInteraction || this._hasKeyboardInteraction) {\n return;\n }\n this._timeout = setTimeout(() => {\n this.hide();\n }, this._config.delay);\n }\n _onInteraction(event, isInteracting) {\n switch (event.type) {\n case 'mouseover':\n case 'mouseout':\n {\n this._hasMouseInteraction = isInteracting;\n break;\n }\n case 'focusin':\n case 'focusout':\n {\n this._hasKeyboardInteraction = isInteracting;\n break;\n }\n }\n if (isInteracting) {\n this._clearTimeout();\n return;\n }\n const nextElement = event.relatedTarget;\n if (this._element === nextElement || this._element.contains(nextElement)) {\n return;\n }\n this._maybeScheduleHide();\n }\n _setListeners() {\n EventHandler.on(this._element, EVENT_MOUSEOVER, event => this._onInteraction(event, true));\n EventHandler.on(this._element, EVENT_MOUSEOUT, event => this._onInteraction(event, false));\n EventHandler.on(this._element, EVENT_FOCUSIN, event => this._onInteraction(event, true));\n EventHandler.on(this._element, EVENT_FOCUSOUT, event => this._onInteraction(event, false));\n }\n _clearTimeout() {\n clearTimeout(this._timeout);\n this._timeout = null;\n }\n\n // Static\n static jQueryInterface(config) {\n return this.each(function () {\n const data = Toast.getOrCreateInstance(this, config);\n if (typeof config === 'string') {\n if (typeof data[config] === 'undefined') {\n throw new TypeError(`No method named \"${config}\"`);\n }\n data[config](this);\n }\n });\n }\n}\n\n/**\n * Data API implementation\n */\n\nenableDismissTrigger(Toast);\n\n/**\n * jQuery\n */\n\ndefineJQueryPlugin(Toast);\n\nexport { Alert, Button, Carousel, Collapse, Dropdown, Modal, Offcanvas, Popover, ScrollSpy, Tab, Toast, Tooltip };\n//# sourceMappingURL=bootstrap.esm.js.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar minDash = require('min-dash');\n\n/**\n * Get a inputOutput from the business object\n *\n * @param {ModdleElement} element\n *\n * @return {ModdleElement} the inputOutput object\n */\nfunction getInputOutput(element) {\n return (getElements(element, 'zeebe:IoMapping') || [])[0];\n}\n\n/**\n * Return all input parameters existing in the business object, and\n * an empty array if none exist.\n *\n * @param {ModdleElement} element\n *\n * @return {Array} a list of input parameter objects\n */\nfunction getInputParameters(element) {\n return getParameters(element, 'inputParameters');\n}\n\n/**\n * Return out mappings existing in the business object\n *\n * @param {ModdleElement} element\n *\n * @return {Array}\n */\nfunction getOutMappings(element) {\n return (getInputOutput(element) || {}).outputParameters;\n}\n\n/**\n * Return out mappings existing in the business object\n *\n * @param {ModdleElement} element\n *\n * @return {Array}\n */\nfunction getInMappings(element) {\n return (getInputOutput(element) || {}).inputParameters;\n}\n\n/**\n * Get the inputElement name from a loopCharacteristics\n *\n * @param {MoodleElement} loopCharacteristics\n * @returns {String} outputCollection\n */\nfunction getInputElement(loopCharacteristics) {\n const extensionElement = getElements(loopCharacteristics, 'zeebe:LoopCharacteristics')[0];\n return extensionElement && extensionElement.inputElement;\n}\n\n/**\n * Get the outputCollection name from a loopCharacteristics\n *\n * @param {MoodleElement} loopCharacteristics\n * @returns {String} outputCollection\n */\nfunction getOutputCollection(loopCharacteristics) {\n const extensionElement = getElements(loopCharacteristics, 'zeebe:LoopCharacteristics')[0];\n return extensionElement && extensionElement.outputCollection;\n\n}\n\n/**\n * Get a calledDecision from the business object\n *\n * @param {MoodleElement} element\n * @returns {MoodleElement} the calledDecision object\n */\nfunction getCalledDecision(element) {\n return (getElements(element, 'zeebe:CalledDecision') || [])[0];\n}\n\n\n/**\n * Get a script from the business object\n *\n * @param {MoodleElement} element\n * @returns {MoodleElement} the script object\n */\nfunction getScript(element) {\n return (getElements(element, 'zeebe:Script') || [])[0];\n}\n\n// helpers //////////\n\nfunction getElements(element, type, property) {\n var elements = getExtensionElements(element, type);\n\n return !property ? elements : (elements[0] || {})[property] || [];\n}\n\nfunction getParameters(element, property) {\n var inputOutput = getInputOutput(element);\n\n return (inputOutput && inputOutput.get(property)) || [];\n}\n\nfunction getExtensionElements(element, type) {\n var elements = [];\n var extensionElements = element.get('extensionElements');\n\n if (typeof extensionElements !== 'undefined') {\n var extensionValues = extensionElements.get('values');\n\n if (typeof extensionValues !== 'undefined') {\n elements = minDash.filter(extensionValues, function(value) {\n return is$2(value, type);\n });\n }\n }\n\n return elements;\n}\n\nfunction is$2(element, type) {\n return (\n element &&\n typeof element.$instanceOf === 'function' &&\n element.$instanceOf(type)\n );\n}\n\n/**\n * Get all parent elements for a given element.\n *\n * @param {ModdleElement|string} element\n *\n * @returns {Array}\n */\nfunction getParents(element) {\n var parents = [];\n var current = element;\n\n while (current.$parent) {\n parents.push(current.$parent);\n current = current.$parent;\n }\n\n return parents;\n}\n\n/**\n * Iterate over each element in a collection, calling the iterator function `fn`\n * with (element, index, recursionDepth).\n *\n * Recurse into all elements that are returned by `fn`.\n *\n * @param {Object|Array} elements\n * @param {Function} fn iterator function called with (element, index, recursionDepth)\n * @param {number} [depth] maximum recursion depth\n */\nfunction eachElement(elements, fn, depth) {\n depth = depth || 0;\n\n if (!minDash.isArray(elements)) {\n elements = [ elements ];\n }\n\n minDash.forEach(elements, function(s, i) {\n var filter = fn(s, i, depth);\n\n if (minDash.isArray(filter) && filter.length) {\n eachElement(filter, fn, depth + 1);\n }\n });\n}\n\n/**\n * Adds an element to a collection and returns true if the\n * element was added.\n *\n * @param {Array} elements\n * @param {Object} e\n * @param {boolean} unique\n */\nfunction add(elements, e, unique) {\n var canAdd = !unique || elements.indexOf(e) === -1;\n\n if (canAdd) {\n elements.push(e);\n }\n\n return canAdd;\n}\n\n/**\n * Collects self + flow elements up to a given depth from a list of elements.\n *\n * @param {ModdleElement|Array} elements the elements to select the flowElements from\n * @param {boolean} unique whether to return a unique result set (no duplicates)\n * @param {number} maxDepth the depth to search through or -1 for infinite\n *\n * @return {Array} found elements\n */\nfunction selfAndFlowElements(elements, unique, maxDepth) {\n var result = [],\n processedFlowElements = [];\n\n eachElement(elements, function(element, i, depth) {\n add(result, element, unique);\n\n var flowElements = element.flowElements;\n\n // max traversal depth not reached yet\n if (maxDepth === -1 || depth < maxDepth) {\n\n // flowElements exist && flowElements not yet processed\n if (flowElements && add(processedFlowElements, flowElements, unique)) {\n return flowElements;\n }\n }\n });\n\n return result;\n}\n\n/**\n * Return self + ALL flowElements for a number of elements\n *\n * @param {Array} elements to query\n * @param {boolean} allowDuplicates to allow duplicates in the result set\n *\n * @return {Array} the collected elements\n */\nfunction selfAndAllFlowElements(elements, allowDuplicates) {\n return selfAndFlowElements(elements, !allowDuplicates, -1);\n}\n\n/**\n * Return full moddle element for given element id\n *\n * @param {string} elementId\n * @param {ModdleElement} rootElement\n *\n * @returns {ModdleElement}\n */\nfunction getElement(elementId, rootElement) {\n var allElements = selfAndAllFlowElements(rootElement);\n\n return minDash.find(allElements, function(element) {\n return element.id === elementId;\n });\n}\n\nfunction addVariableToList(variablesList, newVariable) {\n var foundIdx = minDash.findIndex(variablesList, function(variable) {\n return (\n variable.name === newVariable.name && variable.scope === newVariable.scope\n );\n });\n\n if (foundIdx >= 0) {\n variablesList[foundIdx].origin = combineArrays$1(\n variablesList[foundIdx].origin,\n newVariable.origin\n );\n } else {\n variablesList.push(newVariable);\n }\n}\n\n/**\n * Creates new process variable definition object\n * Identifies correct (highest) scope, in which variable is available\n *\n * @param {ModdleElement} flowElement\n * @param {String} name\n * @param {ModdleElement} defaultScope\n *\n * @returns {ProcessVariable}\n */\nfunction createProcessVariable(flowElement, name, defaultScope) {\n var scope = getScope$1(flowElement, defaultScope, name);\n\n return {\n name: name,\n origin: [ flowElement ],\n scope: scope\n };\n}\n\n\n// helpers ////////////////////\n\n/**\n * Set parent container if it defines it's own scope for the variable, so\n * when it defines an input mapping for it. Otherwise returns the default global scope\n */\nfunction getScope$1(element, globalScope, variableName) {\n var parents = getParents(element);\n\n var scopedParent = minDash.find(parents, function(parent) {\n return (\n is$1(parent, 'bpmn:SubProcess') && hasInputParameter(parent, variableName)\n );\n });\n\n return scopedParent ? scopedParent : globalScope;\n}\n\nfunction is$1(element, type) {\n return (\n element &&\n typeof element.$instanceOf === 'function' &&\n element.$instanceOf(type)\n );\n}\n\nfunction hasInputParameter(element, name) {\n return minDash.find(getInputParameters(element), function(input) {\n return input.target === name;\n });\n}\n\nfunction combineArrays$1(a, b) {\n return a.concat(b);\n}\n\n/**\n * Retrieves process variables defined in output mappings, e.g.\n *\n * \n * \n * \n * \n * \n * \n * \n *\n * => Adds one variable \"variable1\" to the list.\n *\n */\nfunction extractInMappings(options) {\n var elements = options.elements,\n processVariables = options.processVariables;\n\n if (!minDash.isArray(elements)) {\n elements = [ elements ];\n }\n\n minDash.forEach(elements, function(element) {\n\n var inMappings = getInMappings(element);\n\n // extract all variables with correct scope\n minDash.forEach(inMappings, function(mapping) {\n\n var newVariable = createProcessVariable(\n element,\n mapping.target,\n element\n );\n\n addVariableToList(processVariables, newVariable);\n });\n });\n\n return processVariables;\n}\n\n/**\n * Retrieves process variables defined in result variables, e.g.\n *\n * \n * \n * \n * \n * \n * \n * \n *\n * => Adds one variable \"inputElement\"to the list.\n *\n */\nfunction extractInputElement(options) {\n var elements = options.elements,\n processVariables = options.processVariables;\n\n if (!minDash.isArray(elements)) {\n elements = [ elements ];\n }\n\n minDash.forEach(elements, function(element) {\n\n var loopCharacteristics = element.loopCharacteristics;\n\n var inputElement = loopCharacteristics && getInputElement(loopCharacteristics);\n\n if (inputElement) {\n var newVariable = createProcessVariable(\n element,\n inputElement,\n element\n );\n\n addVariableToList(processVariables, newVariable);\n }\n });\n\n return processVariables;\n}\n\n/**\n * Retrieves process variables defined in output mappings, e.g.\n *\n * \n * \n * \n * \n * \n * \n * \n *\n * => Adds one variable \"variable1\" to the list.\n *\n */\nfunction extractOutMappings(options) {\n var elements = options.elements,\n containerElement = options.containerElement,\n processVariables = options.processVariables;\n\n if (!minDash.isArray(elements)) {\n elements = [ elements ];\n }\n\n minDash.forEach(elements, function(element) {\n\n var outMappings = getOutMappings(element);\n\n // extract all variables with correct scope\n minDash.forEach(outMappings, function(mapping) {\n var newVariable = createProcessVariable(\n element,\n mapping.target,\n containerElement\n );\n\n addVariableToList(processVariables, newVariable);\n });\n });\n\n return processVariables;\n}\n\n/**\n * Retrieves process variables defined in output collection, e.g.\n *\n * \n * \n * \n * \n * \n * \n * \n *\n * => Adds one variable \"outputCollection\"to the list.\n *\n */\nfunction extractOutputCollections(options) {\n var elements = options.elements,\n containerElement = options.containerElement,\n processVariables = options.processVariables;\n\n if (!minDash.isArray(elements)) {\n elements = [ elements ];\n }\n\n minDash.forEach(elements, function(element) {\n\n var loopCharacteristics = element.loopCharacteristics;\n\n var outputCollection = loopCharacteristics && getOutputCollection(loopCharacteristics);\n\n if (outputCollection) {\n var newVariable = createProcessVariable(\n element,\n outputCollection,\n containerElement\n );\n\n addVariableToList(processVariables, newVariable);\n }\n });\n\n return processVariables;\n}\n\n/**\n * Retrieves process variables defined in result variables, e.g.\n *\n * \n * \n * \n * \n * \n *\n *\n * => Adds one variable \"variable1\"to the list.\n *\n */\nfunction extractResultVariables(options) {\n var elements = options.elements,\n containerElement = options.containerElement,\n processVariables = options.processVariables;\n\n if (!minDash.isArray(elements)) {\n elements = [ elements ];\n }\n\n minDash.forEach(elements, function(element) {\n\n var baseElement = getCalledDecision(element) ||\n getScript(element);\n\n if (!baseElement) {\n return;\n }\n\n var resultVariable = baseElement.resultVariable;\n\n if (resultVariable) {\n var newVariable = createProcessVariable(\n element,\n resultVariable,\n containerElement\n );\n\n addVariableToList(processVariables, newVariable);\n }\n });\n\n return processVariables;\n}\n\nvar extractors = [\n extractInMappings,\n extractInputElement,\n extractOutMappings,\n extractOutputCollections,\n extractResultVariables\n];\n\n/**\n * @typedef {Object} ProcessVariable\n * @property {string} name\n * @property {Array} origin\n * @property {ModdleElement} scope\n */\n\n// api /////////////////////////\n\n/**\n * Extractors add ProcessVariables to the `options.processVariables` parameter.\n * @callback extractor\n * @param {Object} options\n * @param {Array} options.elements\n * @param {ModdleElement} options.containerElement\n * @param {Array} options.processVariables\n */\n\n/**\n * Retrieves all process variables for a given container element.\n * @param {ModdleElement} containerElement\n * @param {Array} [additionalExtractors]\n *\n * @returns {Promise>}\n */\nfunction getProcessVariables(containerElement, additionalExtractors = []) {\n var processVariables = [];\n\n // (1) extract all flow elements inside the container\n var elements = selfAndAllFlowElements([ containerElement ], false);\n\n const allPromises = [];\n\n // (2) extract all variables from the extractors\n minDash.forEach([ ...extractors, ...additionalExtractors ], function(extractor) {\n allPromises.push(extractor({\n elements: elements,\n containerElement: containerElement,\n processVariables: processVariables\n }));\n });\n\n return Promise.all(allPromises)\n .then(() => processVariables);\n}\n\n/**\n * Retrieves all variables which are available in the given scope\n *\n * * Exclude variables which are only available in other scopes\n * * Exclude variables which are produced by the given element\n * * Include variables which are available in parent scopes\n *\n * @param {string} scope\n * @param {ModdleElement} rootElement element from where to extract all variables\n * @param {Array} [additionalExtractors]\n *\n * @returns {Promise>}\n */\nasync function getVariablesForScope(scope, rootElement, additionalExtractors = []) {\n\n var allVariables = await getProcessVariables(rootElement, additionalExtractors);\n\n var scopeElement = getElement(scope, rootElement);\n\n // (1) get variables for given scope\n var scopeVariables = minDash.filter(allVariables, function(variable) {\n return variable.scope.id === scopeElement.id;\n });\n\n // (2) get variables for parent scopes\n var parents = getParents(scopeElement);\n\n var parentsScopeVariables = minDash.filter(allVariables, function(variable) {\n return minDash.find(parents, function(parent) {\n return parent.id === variable.scope.id;\n });\n });\n\n return combineArrays(scopeVariables, parentsScopeVariables);\n}\n\n\nfunction getVariablesForElement(element, additionalExtractors = []) {\n return getVariablesForScope(getScope(element), getRootElement(element), additionalExtractors);\n}\n\nfunction getScope(element) {\n const bo = getBusinessObject(element);\n\n if (is(element, 'bpmn:Participant')) {\n return bo.processRef.id;\n }\n\n return bo.id;\n}\n\nfunction getRootElement(element) {\n const businessObject = getBusinessObject(element);\n\n if (is(businessObject, 'bpmn:Participant')) {\n return businessObject.processRef;\n }\n\n if (is(businessObject, 'bpmn:Process')) {\n return businessObject;\n }\n\n let parent = businessObject;\n\n while (parent.$parent && !is(parent, 'bpmn:Process')) {\n parent = parent.$parent;\n }\n\n return parent;\n}\n\n\n// helpers ////////////////////\n\nfunction combineArrays(a, b) {\n return a.concat(b);\n}\n\n\nfunction getBusinessObject(element) {\n return (element && element.businessObject) || element;\n}\n\n\nfunction is(element, type) {\n var bo = getBusinessObject(element);\n\n return bo && (typeof bo.$instanceOf === 'function') && bo.$instanceOf(type);\n}\n\nexports.getProcessVariables = getProcessVariables;\nexports.getVariablesForElement = getVariablesForElement;\nexports.getVariablesForScope = getVariablesForScope;\n","function StaticResolver(cache) {\n this.cache = cache;\n}\n\nmodule.exports = StaticResolver;\n\n\nStaticResolver.prototype.resolveRule = function(pkg, ruleName) {\n return this.resolve('rule', pkg, ruleName);\n};\n\nStaticResolver.prototype.resolveConfig = function(pkg, configName) {\n return this.resolve('config', pkg, configName);\n};\n\nStaticResolver.prototype.resolve = function(type, pkg, name) {\n const id = `${pkg}/${name}`;\n\n const resolved = this.cache[`${type}:${id}`];\n\n if (!resolved) {\n throw new Error(`unknown ${type} <${id}>`);\n }\n\n return resolved;\n};","function e(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}export{e as default};\n//# sourceMappingURL=index.es.js.map\n","function createCommonjsModule(fn, module) {\n\treturn module = { exports: {} }, fn(module, module.exports), module.exports;\n}\n\nvar hat_1 = createCommonjsModule(function (module) {\nvar hat = module.exports = function (bits, base) {\n if (!base) base = 16;\n if (bits === undefined) bits = 128;\n if (bits <= 0) return '0';\n \n var digits = Math.log(Math.pow(2, bits)) / Math.log(base);\n for (var i = 2; digits === Infinity; i *= 2) {\n digits = Math.log(Math.pow(2, bits / i)) / Math.log(base) * i;\n }\n \n var rem = digits - Math.floor(digits);\n \n var res = '';\n \n for (var i = 0; i < Math.floor(digits); i++) {\n var x = Math.floor(Math.random() * base).toString(base);\n res = x + res;\n }\n \n if (rem) {\n var b = Math.pow(base, rem);\n var x = Math.floor(Math.random() * b).toString(base);\n res = x + res;\n }\n \n var parsed = parseInt(res, base);\n if (parsed !== Infinity && parsed >= Math.pow(2, bits)) {\n return hat(bits, base)\n }\n else return res;\n};\n\nhat.rack = function (bits, base, expandBy) {\n var fn = function (data) {\n var iters = 0;\n do {\n if (iters ++ > 10) {\n if (expandBy) bits += expandBy;\n else throw new Error('too many ID collisions, use more bits')\n }\n \n var id = hat(bits, base);\n } while (Object.hasOwnProperty.call(hats, id));\n \n hats[id] = data;\n return id;\n };\n var hats = fn.hats = {};\n \n fn.get = function (id) {\n return fn.hats[id];\n };\n \n fn.set = function (id, value) {\n fn.hats[id] = value;\n return fn;\n };\n \n fn.bits = bits || 128;\n fn.base = base || 16;\n return fn;\n};\n});\n\n/**\n * Create a new id generator / cache instance.\n *\n * You may optionally provide a seed that is used internally.\n *\n * @param {Seed} seed\n */\nfunction Ids(seed) {\n if (!(this instanceof Ids)) {\n return new Ids(seed);\n }\n seed = seed || [128, 36, 1];\n this._seed = seed.length ? hat_1.rack(seed[0], seed[1], seed[2]) : seed;\n}\n\n/**\n * Generate a next id.\n *\n * @param {Object} [element] element to bind the id to\n *\n * @return {String} id\n */\nIds.prototype.next = function (element) {\n return this._seed(element || true);\n};\n\n/**\n * Generate a next id with a given prefix.\n *\n * @param {Object} [element] element to bind the id to\n *\n * @return {String} id\n */\nIds.prototype.nextPrefixed = function (prefix, element) {\n var id;\n do {\n id = prefix + this.next(true);\n } while (this.assigned(id));\n\n // claim {prefix}{random}\n this.claim(id, element);\n\n // return\n return id;\n};\n\n/**\n * Manually claim an existing id.\n *\n * @param {String} id\n * @param {String} [element] element the id is claimed by\n */\nIds.prototype.claim = function (id, element) {\n this._seed.set(id, element || true);\n};\n\n/**\n * Returns true if the given id has already been assigned.\n *\n * @param {String} id\n * @return {Boolean}\n */\nIds.prototype.assigned = function (id) {\n return this._seed.get(id) || false;\n};\n\n/**\n * Unclaim an id.\n *\n * @param {String} id the id to unclaim\n */\nIds.prototype.unclaim = function (id) {\n delete this._seed.hats[id];\n};\n\n/**\n * Clear all claimed ids.\n */\nIds.prototype.clear = function () {\n var hats = this._seed.hats,\n id;\n for (id in hats) {\n this.unclaim(id);\n }\n};\n\nexport default Ids;\n//# sourceMappingURL=index.esm.js.map\n","/**\n * Flatten array, one level deep.\n *\n * @template T\n *\n * @param {T[][] | T[] | null} [arr]\n *\n * @return {T[]}\n */\nfunction flatten(arr) {\n return Array.prototype.concat.apply([], arr);\n}\n\nconst nativeToString = Object.prototype.toString;\nconst nativeHasOwnProperty = Object.prototype.hasOwnProperty;\n\nfunction isUndefined(obj) {\n return obj === undefined;\n}\n\nfunction isDefined(obj) {\n return obj !== undefined;\n}\n\nfunction isNil(obj) {\n return obj == null;\n}\n\nfunction isArray(obj) {\n return nativeToString.call(obj) === '[object Array]';\n}\n\nfunction isObject(obj) {\n return nativeToString.call(obj) === '[object Object]';\n}\n\nfunction isNumber(obj) {\n return nativeToString.call(obj) === '[object Number]';\n}\n\n/**\n * @param {any} obj\n *\n * @return {boolean}\n */\nfunction isFunction(obj) {\n const tag = nativeToString.call(obj);\n\n return (\n tag === '[object Function]' ||\n tag === '[object AsyncFunction]' ||\n tag === '[object GeneratorFunction]' ||\n tag === '[object AsyncGeneratorFunction]' ||\n tag === '[object Proxy]'\n );\n}\n\nfunction isString(obj) {\n return nativeToString.call(obj) === '[object String]';\n}\n\n\n/**\n * Ensure collection is an array.\n *\n * @param {Object} obj\n */\nfunction ensureArray(obj) {\n\n if (isArray(obj)) {\n return;\n }\n\n throw new Error('must supply array');\n}\n\n/**\n * Return true, if target owns a property with the given key.\n *\n * @param {Object} target\n * @param {String} key\n *\n * @return {Boolean}\n */\nfunction has(target, key) {\n return !isNil(target) && nativeHasOwnProperty.call(target, key);\n}\n\n/**\n * @template T\n * @typedef { (\n * ((e: T) => boolean) |\n * ((e: T, idx: number) => boolean) |\n * ((e: T, key: string) => boolean) |\n * string |\n * number\n * ) } Matcher\n */\n\n/**\n * @template T\n * @template U\n *\n * @typedef { (\n * ((e: T) => U) | string | number\n * ) } Extractor\n */\n\n\n/**\n * @template T\n * @typedef { (val: T, key: any) => boolean } MatchFn\n */\n\n/**\n * @template T\n * @typedef { T[] } ArrayCollection\n */\n\n/**\n * @template T\n * @typedef { { [key: string]: T } } StringKeyValueCollection\n */\n\n/**\n * @template T\n * @typedef { { [key: number]: T } } NumberKeyValueCollection\n */\n\n/**\n * @template T\n * @typedef { StringKeyValueCollection | NumberKeyValueCollection } KeyValueCollection\n */\n\n/**\n * @template T\n * @typedef { KeyValueCollection | ArrayCollection } Collection\n */\n\n/**\n * Find element in collection.\n *\n * @template T\n * @param {Collection} collection\n * @param {Matcher} matcher\n *\n * @return {Object}\n */\nfunction find(collection, matcher) {\n\n const matchFn = toMatcher(matcher);\n\n let match;\n\n forEach(collection, function(val, key) {\n if (matchFn(val, key)) {\n match = val;\n\n return false;\n }\n });\n\n return match;\n\n}\n\n\n/**\n * Find element index in collection.\n *\n * @template T\n * @param {Collection} collection\n * @param {Matcher} matcher\n *\n * @return {number | string | undefined}\n */\nfunction findIndex(collection, matcher) {\n\n const matchFn = toMatcher(matcher);\n\n let idx = isArray(collection) ? -1 : undefined;\n\n forEach(collection, function(val, key) {\n if (matchFn(val, key)) {\n idx = key;\n\n return false;\n }\n });\n\n return idx;\n}\n\n\n/**\n * Filter elements in collection.\n *\n * @template T\n * @param {Collection} collection\n * @param {Matcher} matcher\n *\n * @return {T[]} result\n */\nfunction filter(collection, matcher) {\n\n const matchFn = toMatcher(matcher);\n\n let result = [];\n\n forEach(collection, function(val, key) {\n if (matchFn(val, key)) {\n result.push(val);\n }\n });\n\n return result;\n}\n\n\n/**\n * Iterate over collection; returning something\n * (non-undefined) will stop iteration.\n *\n * @template T\n * @param {Collection} collection\n * @param { ((item: T, idx: number) => (boolean|void)) | ((item: T, key: string) => (boolean|void)) } iterator\n *\n * @return {T} return result that stopped the iteration\n */\nfunction forEach(collection, iterator) {\n\n let val,\n result;\n\n if (isUndefined(collection)) {\n return;\n }\n\n const convertKey = isArray(collection) ? toNum : identity;\n\n for (let key in collection) {\n\n if (has(collection, key)) {\n val = collection[key];\n\n result = iterator(val, convertKey(key));\n\n if (result === false) {\n return val;\n }\n }\n }\n}\n\n/**\n * Return collection without element.\n *\n * @template T\n * @param {ArrayCollection} arr\n * @param {Matcher} matcher\n *\n * @return {T[]}\n */\nfunction without(arr, matcher) {\n\n if (isUndefined(arr)) {\n return [];\n }\n\n ensureArray(arr);\n\n const matchFn = toMatcher(matcher);\n\n return arr.filter(function(el, idx) {\n return !matchFn(el, idx);\n });\n\n}\n\n\n/**\n * Reduce collection, returning a single result.\n *\n * @template T\n * @template V\n *\n * @param {Collection} collection\n * @param {(result: V, entry: T, index: any) => V} iterator\n * @param {V} result\n *\n * @return {V} result returned from last iterator\n */\nfunction reduce(collection, iterator, result) {\n\n forEach(collection, function(value, idx) {\n result = iterator(result, value, idx);\n });\n\n return result;\n}\n\n\n/**\n * Return true if every element in the collection\n * matches the criteria.\n *\n * @param {Object|Array} collection\n * @param {Function} matcher\n *\n * @return {Boolean}\n */\nfunction every(collection, matcher) {\n\n return !!reduce(collection, function(matches, val, key) {\n return matches && matcher(val, key);\n }, true);\n}\n\n\n/**\n * Return true if some elements in the collection\n * match the criteria.\n *\n * @param {Object|Array} collection\n * @param {Function} matcher\n *\n * @return {Boolean}\n */\nfunction some(collection, matcher) {\n\n return !!find(collection, matcher);\n}\n\n\n/**\n * Transform a collection into another collection\n * by piping each member through the given fn.\n *\n * @param {Object|Array} collection\n * @param {Function} fn\n *\n * @return {Array} transformed collection\n */\nfunction map(collection, fn) {\n\n let result = [];\n\n forEach(collection, function(val, key) {\n result.push(fn(val, key));\n });\n\n return result;\n}\n\n\n/**\n * Get the collections keys.\n *\n * @param {Object|Array} collection\n *\n * @return {Array}\n */\nfunction keys(collection) {\n return collection && Object.keys(collection) || [];\n}\n\n\n/**\n * Shorthand for `keys(o).length`.\n *\n * @param {Object|Array} collection\n *\n * @return {Number}\n */\nfunction size(collection) {\n return keys(collection).length;\n}\n\n\n/**\n * Get the values in the collection.\n *\n * @param {Object|Array} collection\n *\n * @return {Array}\n */\nfunction values(collection) {\n return map(collection, (val) => val);\n}\n\n\n/**\n * Group collection members by attribute.\n *\n * @param {Object|Array} collection\n * @param {Extractor} extractor\n *\n * @return {Object} map with { attrValue => [ a, b, c ] }\n */\nfunction groupBy(collection, extractor, grouped = {}) {\n\n extractor = toExtractor(extractor);\n\n forEach(collection, function(val) {\n let discriminator = extractor(val) || '_';\n\n let group = grouped[discriminator];\n\n if (!group) {\n group = grouped[discriminator] = [];\n }\n\n group.push(val);\n });\n\n return grouped;\n}\n\n\nfunction uniqueBy(extractor, ...collections) {\n\n extractor = toExtractor(extractor);\n\n let grouped = {};\n\n forEach(collections, (c) => groupBy(c, extractor, grouped));\n\n let result = map(grouped, function(val, key) {\n return val[0];\n });\n\n return result;\n}\n\n\nconst unionBy = uniqueBy;\n\n\n\n/**\n * Sort collection by criteria.\n *\n * @template T\n *\n * @param {Collection} collection\n * @param {Extractor} extractor\n *\n * @return {Array}\n */\nfunction sortBy(collection, extractor) {\n\n extractor = toExtractor(extractor);\n\n let sorted = [];\n\n forEach(collection, function(value, key) {\n let disc = extractor(value, key);\n\n let entry = {\n d: disc,\n v: value\n };\n\n for (var idx = 0; idx < sorted.length; idx++) {\n let { d } = sorted[idx];\n\n if (disc < d) {\n sorted.splice(idx, 0, entry);\n return;\n }\n }\n\n // not inserted, append (!)\n sorted.push(entry);\n });\n\n return map(sorted, (e) => e.v);\n}\n\n\n/**\n * Create an object pattern matcher.\n *\n * @example\n *\n * ```javascript\n * const matcher = matchPattern({ id: 1 });\n *\n * let element = find(elements, matcher);\n * ```\n *\n * @template T\n *\n * @param {T} pattern\n *\n * @return { (el: any) => boolean } matcherFn\n */\nfunction matchPattern(pattern) {\n\n return function(el) {\n\n return every(pattern, function(val, key) {\n return el[key] === val;\n });\n\n };\n}\n\n\n/**\n * @param {string | ((e: any) => any) } extractor\n *\n * @return { (e: any) => any }\n */\nfunction toExtractor(extractor) {\n\n /**\n * @satisfies { (e: any) => any }\n */\n return isFunction(extractor) ? extractor : (e) => {\n\n // @ts-ignore: just works\n return e[extractor];\n };\n}\n\n\n/**\n * @template T\n * @param {Matcher} matcher\n *\n * @return {MatchFn}\n */\nfunction toMatcher(matcher) {\n return isFunction(matcher) ? matcher : (e) => {\n return e === matcher;\n };\n}\n\n\nfunction identity(arg) {\n return arg;\n}\n\nfunction toNum(arg) {\n return Number(arg);\n}\n\n/* global setTimeout clearTimeout */\n\n/**\n * @typedef { {\n * (...args: any[]): any;\n * flush: () => void;\n * cancel: () => void;\n * } } DebouncedFunction\n */\n\n/**\n * Debounce fn, calling it only once if the given time\n * elapsed between calls.\n *\n * Lodash-style the function exposes methods to `#clear`\n * and `#flush` to control internal behavior.\n *\n * @param {Function} fn\n * @param {Number} timeout\n *\n * @return {DebouncedFunction} debounced function\n */\nfunction debounce(fn, timeout) {\n\n let timer;\n\n let lastArgs;\n let lastThis;\n\n let lastNow;\n\n function fire(force) {\n\n let now = Date.now();\n\n let scheduledDiff = force ? 0 : (lastNow + timeout) - now;\n\n if (scheduledDiff > 0) {\n return schedule(scheduledDiff);\n }\n\n fn.apply(lastThis, lastArgs);\n\n clear();\n }\n\n function schedule(timeout) {\n timer = setTimeout(fire, timeout);\n }\n\n function clear() {\n if (timer) {\n clearTimeout(timer);\n }\n\n timer = lastNow = lastArgs = lastThis = undefined;\n }\n\n function flush() {\n if (timer) {\n fire(true);\n }\n\n clear();\n }\n\n /**\n * @type { DebouncedFunction }\n */\n function callback(...args) {\n lastNow = Date.now();\n\n lastArgs = args;\n lastThis = this;\n\n // ensure an execution is scheduled\n if (!timer) {\n schedule(timeout);\n }\n }\n\n callback.flush = flush;\n callback.cancel = clear;\n\n return callback;\n}\n\n/**\n * Throttle fn, calling at most once\n * in the given interval.\n *\n * @param {Function} fn\n * @param {Number} interval\n *\n * @return {Function} throttled function\n */\nfunction throttle(fn, interval) {\n let throttling = false;\n\n return function(...args) {\n\n if (throttling) {\n return;\n }\n\n fn(...args);\n throttling = true;\n\n setTimeout(() => {\n throttling = false;\n }, interval);\n };\n}\n\n/**\n * Bind function against target .\n *\n * @param {Function} fn\n * @param {Object} target\n *\n * @return {Function} bound function\n */\nfunction bind(fn, target) {\n return fn.bind(target);\n}\n\n/**\n * Convenience wrapper for `Object.assign`.\n *\n * @param {Object} target\n * @param {...Object} others\n *\n * @return {Object} the target\n */\nfunction assign(target, ...others) {\n return Object.assign(target, ...others);\n}\n\n/**\n * Sets a nested property of a given object to the specified value.\n *\n * This mutates the object and returns it.\n *\n * @template T\n *\n * @param {T} target The target of the set operation.\n * @param {(string|number)[]} path The path to the nested value.\n * @param {any} value The value to set.\n *\n * @return {T}\n */\nfunction set(target, path, value) {\n\n let currentTarget = target;\n\n forEach(path, function(key, idx) {\n\n if (typeof key !== 'number' && typeof key !== 'string') {\n throw new Error('illegal key type: ' + typeof key + '. Key should be of type number or string.');\n }\n\n if (key === 'constructor') {\n throw new Error('illegal key: constructor');\n }\n\n if (key === '__proto__') {\n throw new Error('illegal key: __proto__');\n }\n\n let nextKey = path[idx + 1];\n let nextTarget = currentTarget[key];\n\n if (isDefined(nextKey) && isNil(nextTarget)) {\n nextTarget = currentTarget[key] = isNaN(+nextKey) ? {} : [];\n }\n\n if (isUndefined(nextKey)) {\n if (isUndefined(value)) {\n delete currentTarget[key];\n } else {\n currentTarget[key] = value;\n }\n } else {\n currentTarget = nextTarget;\n }\n });\n\n return target;\n}\n\n\n/**\n * Gets a nested property of a given object.\n *\n * @param {Object} target The target of the get operation.\n * @param {(string|number)[]} path The path to the nested value.\n * @param {any} [defaultValue] The value to return if no value exists.\n *\n * @return {any}\n */\nfunction get(target, path, defaultValue) {\n\n let currentTarget = target;\n\n forEach(path, function(key) {\n\n // accessing nil property yields \n if (isNil(currentTarget)) {\n currentTarget = undefined;\n\n return false;\n }\n\n currentTarget = currentTarget[key];\n });\n\n return isUndefined(currentTarget) ? defaultValue : currentTarget;\n}\n\n/**\n * Pick properties from the given target.\n *\n * @template T\n * @template {any[]} V\n *\n * @param {T} target\n * @param {V} properties\n *\n * @return Pick\n */\nfunction pick(target, properties) {\n\n let result = {};\n\n let obj = Object(target);\n\n forEach(properties, function(prop) {\n\n if (prop in obj) {\n result[prop] = target[prop];\n }\n });\n\n return result;\n}\n\n/**\n * Pick all target properties, excluding the given ones.\n *\n * @template T\n * @template {any[]} V\n *\n * @param {T} target\n * @param {V} properties\n *\n * @return {Omit} target\n */\nfunction omit(target, properties) {\n\n let result = {};\n\n let obj = Object(target);\n\n forEach(obj, function(prop, key) {\n\n if (properties.indexOf(key) === -1) {\n result[key] = prop;\n }\n });\n\n return result;\n}\n\n/**\n * Recursively merge `...sources` into given target.\n *\n * Does support merging objects; does not support merging arrays.\n *\n * @param {Object} target\n * @param {...Object} sources\n *\n * @return {Object} the target\n */\nfunction merge(target, ...sources) {\n\n if (!sources.length) {\n return target;\n }\n\n forEach(sources, function(source) {\n\n // skip non-obj sources, i.e. null\n if (!source || !isObject(source)) {\n return;\n }\n\n forEach(source, function(sourceVal, key) {\n\n if (key === '__proto__') {\n return;\n }\n\n let targetVal = target[key];\n\n if (isObject(sourceVal)) {\n\n if (!isObject(targetVal)) {\n\n // override target[key] with object\n targetVal = {};\n }\n\n target[key] = merge(targetVal, sourceVal);\n } else {\n target[key] = sourceVal;\n }\n\n });\n });\n\n return target;\n}\n\nexport { assign, bind, debounce, ensureArray, every, filter, find, findIndex, flatten, forEach, get, groupBy, has, isArray, isDefined, isFunction, isNil, isNumber, isObject, isString, isUndefined, keys, map, matchPattern, merge, omit, pick, reduce, set, size, some, sortBy, throttle, unionBy, uniqueBy, values, without };\n","function _mergeNamespaces(n, m) {\n m.forEach(function (e) {\n e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {\n if (k !== 'default' && !(k in n)) {\n var d = Object.getOwnPropertyDescriptor(e, k);\n Object.defineProperty(n, k, d.get ? d : {\n enumerable: true,\n get: function () { return e[k]; }\n });\n }\n });\n });\n return Object.freeze(n);\n}\n\n/**\n * Flatten array, one level deep.\n *\n * @template T\n *\n * @param {T[][] | T[] | null} [arr]\n *\n * @return {T[]}\n */\n\nconst nativeToString = Object.prototype.toString;\nconst nativeHasOwnProperty = Object.prototype.hasOwnProperty;\n\nfunction isUndefined(obj) {\n return obj === undefined;\n}\n\nfunction isArray(obj) {\n return nativeToString.call(obj) === '[object Array]';\n}\n\n/**\n * Return true, if target owns a property with the given key.\n *\n * @param {Object} target\n * @param {String} key\n *\n * @return {Boolean}\n */\nfunction has(target, key) {\n return nativeHasOwnProperty.call(target, key);\n}\n\n\n/**\n * Iterate over collection; returning something\n * (non-undefined) will stop iteration.\n *\n * @template T\n * @param {Collection} collection\n * @param { ((item: T, idx: number) => (boolean|void)) | ((item: T, key: string) => (boolean|void)) } iterator\n *\n * @return {T} return result that stopped the iteration\n */\nfunction forEach(collection, iterator) {\n\n let val,\n result;\n\n if (isUndefined(collection)) {\n return;\n }\n\n const convertKey = isArray(collection) ? toNum : identity;\n\n for (let key in collection) {\n\n if (has(collection, key)) {\n val = collection[key];\n\n result = iterator(val, convertKey(key));\n\n if (result === false) {\n return val;\n }\n }\n }\n}\n\n\nfunction identity(arg) {\n return arg;\n}\n\nfunction toNum(arg) {\n return Number(arg);\n}\n\n/**\n * Assigns style attributes in a style-src compliant way.\n *\n * @param {Element} element\n * @param {...Object} styleSources\n *\n * @return {Element} the element\n */\nfunction assign(element, ...styleSources) {\n const target = element.style;\n\n forEach(styleSources, function(style) {\n if (!style) {\n return;\n }\n\n forEach(style, function(value, key) {\n target[key] = value;\n });\n });\n\n return element;\n}\n\n/**\n * Set attribute `name` to `val`, or get attr `name`.\n *\n * @param {Element} el\n * @param {String} name\n * @param {String} [val]\n * @api public\n */\nfunction attr(el, name, val) {\n\n // get\n if (arguments.length == 2) {\n return el.getAttribute(name);\n }\n\n // remove\n if (val === null) {\n return el.removeAttribute(name);\n }\n\n // set\n el.setAttribute(name, val);\n\n return el;\n}\n\n/**\n * Taken from https://github.com/component/classes\n *\n * Without the component bits.\n */\n\n/**\n * toString reference.\n */\n\nconst toString = Object.prototype.toString;\n\n/**\n * Wrap `el` in a `ClassList`.\n *\n * @param {Element} el\n * @return {ClassList}\n * @api public\n */\n\nfunction classes(el) {\n return new ClassList(el);\n}\n\n/**\n * Initialize a new ClassList for `el`.\n *\n * @param {Element} el\n * @api private\n */\n\nfunction ClassList(el) {\n if (!el || !el.nodeType) {\n throw new Error('A DOM element reference is required');\n }\n this.el = el;\n this.list = el.classList;\n}\n\n/**\n * Add class `name` if not already present.\n *\n * @param {String} name\n * @return {ClassList}\n * @api public\n */\n\nClassList.prototype.add = function(name) {\n this.list.add(name);\n return this;\n};\n\n/**\n * Remove class `name` when present, or\n * pass a regular expression to remove\n * any which match.\n *\n * @param {String|RegExp} name\n * @return {ClassList}\n * @api public\n */\n\nClassList.prototype.remove = function(name) {\n if ('[object RegExp]' == toString.call(name)) {\n return this.removeMatching(name);\n }\n\n this.list.remove(name);\n return this;\n};\n\n/**\n * Remove all classes matching `re`.\n *\n * @param {RegExp} re\n * @return {ClassList}\n * @api private\n */\n\nClassList.prototype.removeMatching = function(re) {\n const arr = this.array();\n for (let i = 0; i < arr.length; i++) {\n if (re.test(arr[i])) {\n this.remove(arr[i]);\n }\n }\n return this;\n};\n\n/**\n * Toggle class `name`, can force state via `force`.\n *\n * For browsers that support classList, but do not support `force` yet,\n * the mistake will be detected and corrected.\n *\n * @param {String} name\n * @param {Boolean} force\n * @return {ClassList}\n * @api public\n */\n\nClassList.prototype.toggle = function(name, force) {\n if ('undefined' !== typeof force) {\n if (force !== this.list.toggle(name, force)) {\n this.list.toggle(name); // toggle again to correct\n }\n } else {\n this.list.toggle(name);\n }\n return this;\n};\n\n/**\n * Return an array of classes.\n *\n * @return {Array}\n * @api public\n */\n\nClassList.prototype.array = function() {\n return Array.from(this.list);\n};\n\n/**\n * Check if class `name` is present.\n *\n * @param {String} name\n * @return {ClassList}\n * @api public\n */\n\nClassList.prototype.has =\nClassList.prototype.contains = function(name) {\n return this.list.contains(name);\n};\n\n/**\n * Clear utility\n */\n\n/**\n * Removes all children from the given element\n *\n * @param {Element} element\n *\n * @return {Element} the element (for chaining)\n */\nfunction clear(element) {\n var child;\n\n while ((child = element.firstChild)) {\n element.removeChild(child);\n }\n\n return element;\n}\n\n/**\n * Closest\n *\n * @param {Element} el\n * @param {string} selector\n * @param {boolean} checkYourSelf (optional)\n */\nfunction closest(element, selector, checkYourSelf) {\n var actualElement = checkYourSelf ? element : element.parentNode;\n\n return actualElement && typeof actualElement.closest === 'function' && actualElement.closest(selector) || null;\n}\n\nvar componentEvent = {};\n\nvar bind$1, unbind$1, prefix;\n\nfunction detect () {\n bind$1 = window.addEventListener ? 'addEventListener' : 'attachEvent';\n unbind$1 = window.removeEventListener ? 'removeEventListener' : 'detachEvent';\n prefix = bind$1 !== 'addEventListener' ? 'on' : '';\n}\n\n/**\n * Bind `el` event `type` to `fn`.\n *\n * @param {Element} el\n * @param {String} type\n * @param {Function} fn\n * @param {Boolean} capture\n * @return {Function}\n * @api public\n */\n\nvar bind_1 = componentEvent.bind = function(el, type, fn, capture){\n if (!bind$1) detect();\n el[bind$1](prefix + type, fn, capture || false);\n return fn;\n};\n\n/**\n * Unbind `el` event `type`'s callback `fn`.\n *\n * @param {Element} el\n * @param {String} type\n * @param {Function} fn\n * @param {Boolean} capture\n * @return {Function}\n * @api public\n */\n\nvar unbind_1 = componentEvent.unbind = function(el, type, fn, capture){\n if (!unbind$1) detect();\n el[unbind$1](prefix + type, fn, capture || false);\n return fn;\n};\n\nvar event = /*#__PURE__*/_mergeNamespaces({\n __proto__: null,\n bind: bind_1,\n unbind: unbind_1,\n 'default': componentEvent\n}, [componentEvent]);\n\n/**\n * Module dependencies.\n */\n\n/**\n * Delegate event `type` to `selector`\n * and invoke `fn(e)`. A callback function\n * is returned which may be passed to `.unbind()`.\n *\n * @param {Element} el\n * @param {String} selector\n * @param {String} type\n * @param {Function} fn\n * @param {Boolean} capture\n * @return {Function}\n * @api public\n */\n\n// Some events don't bubble, so we want to bind to the capture phase instead\n// when delegating.\nvar forceCaptureEvents = [ 'focus', 'blur' ];\n\nfunction bind(el, selector, type, fn, capture) {\n if (forceCaptureEvents.indexOf(type) !== -1) {\n capture = true;\n }\n\n return event.bind(el, type, function(e) {\n var target = e.target || e.srcElement;\n e.delegateTarget = closest(target, selector, true);\n if (e.delegateTarget) {\n fn.call(el, e);\n }\n }, capture);\n}\n\n/**\n * Unbind event `type`'s callback `fn`.\n *\n * @param {Element} el\n * @param {String} type\n * @param {Function} fn\n * @param {Boolean} capture\n * @api public\n */\nfunction unbind(el, type, fn, capture) {\n if (forceCaptureEvents.indexOf(type) !== -1) {\n capture = true;\n }\n\n return event.unbind(el, type, fn, capture);\n}\n\nvar delegate = {\n bind,\n unbind\n};\n\n/**\n * Expose `parse`.\n */\n\nvar domify = parse;\n\n/**\n * Tests for browser support.\n */\n\nvar innerHTMLBug = false;\nvar bugTestDiv;\nif (typeof document !== 'undefined') {\n bugTestDiv = document.createElement('div');\n // Setup\n bugTestDiv.innerHTML = ' a ';\n // Make sure that link elements get serialized correctly by innerHTML\n // This requires a wrapper element in IE\n innerHTMLBug = !bugTestDiv.getElementsByTagName('link').length;\n bugTestDiv = undefined;\n}\n\n/**\n * Wrap map from jquery.\n */\n\nvar map = {\n legend: [1, '', ' '],\n tr: [2, ''],\n col: [2, ''],\n // for script/link/style tags to work in IE6-8, you have to wrap\n // in a div with a non-whitespace character in front, ha!\n _default: innerHTMLBug ? [1, 'X', '
'] : [0, '', '']\n};\n\nmap.td =\nmap.th = [3, ''];\n\nmap.option =\nmap.optgroup = [1, '', ' '];\n\nmap.thead =\nmap.tbody =\nmap.colgroup =\nmap.caption =\nmap.tfoot = [1, ''];\n\nmap.polyline =\nmap.ellipse =\nmap.polygon =\nmap.circle =\nmap.text =\nmap.line =\nmap.path =\nmap.rect =\nmap.g = [1, '',' '];\n\n/**\n * Parse `html` and return a DOM Node instance, which could be a TextNode,\n * HTML DOM Node of some kind ( for example), or a DocumentFragment\n * instance, depending on the contents of the `html` string.\n *\n * @param {String} html - HTML string to \"domify\"\n * @param {Document} doc - The `document` instance to create the Node for\n * @return {DOMNode} the TextNode, DOM Node, or DocumentFragment instance\n * @api private\n */\n\nfunction parse(html, doc) {\n if ('string' != typeof html) throw new TypeError('String expected');\n\n // default to the global `document` object\n if (!doc) doc = document;\n\n // tag name\n var m = /<([\\w:]+)/.exec(html);\n if (!m) return doc.createTextNode(html);\n\n html = html.replace(/^\\s+|\\s+$/g, ''); // Remove leading/trailing whitespace\n\n var tag = m[1];\n\n // body support\n if (tag == 'body') {\n var el = doc.createElement('html');\n el.innerHTML = html;\n return el.removeChild(el.lastChild);\n }\n\n // wrap map\n var wrap = Object.prototype.hasOwnProperty.call(map, tag) ? map[tag] : map._default;\n var depth = wrap[0];\n var prefix = wrap[1];\n var suffix = wrap[2];\n var el = doc.createElement('div');\n el.innerHTML = prefix + html + suffix;\n while (depth--) el = el.lastChild;\n\n // one element\n if (el.firstChild == el.lastChild) {\n return el.removeChild(el.firstChild);\n }\n\n // several elements\n var fragment = doc.createDocumentFragment();\n while (el.firstChild) {\n fragment.appendChild(el.removeChild(el.firstChild));\n }\n\n return fragment;\n}\n\nvar domify$1 = domify;\n\n/**\n * @param { HTMLElement } element\n * @param { String } selector\n *\n * @return { boolean }\n */\nfunction matches(element, selector) {\n return element && typeof element.matches === 'function' && element.matches(selector) || false;\n}\n\nfunction query(selector, el) {\n el = el || document;\n\n return el.querySelector(selector);\n}\n\nfunction all(selector, el) {\n el = el || document;\n\n return el.querySelectorAll(selector);\n}\n\nfunction remove(el) {\n el.parentNode && el.parentNode.removeChild(el);\n}\n\nexport { assign as assignStyle, attr, classes, clear, closest, delegate, domify$1 as domify, event, matches, query, all as queryAll, remove };\n//# sourceMappingURL=index.esm.js.map\n","function ensureImported(element, target) {\n\n if (element.ownerDocument !== target.ownerDocument) {\n try {\n\n // may fail on webkit\n return target.ownerDocument.importNode(element, true);\n } catch (e) {\n\n // ignore\n }\n }\n\n return element;\n}\n\n/**\n * appendTo utility\n */\n\n\n/**\n * Append a node to a target element and return the appended node.\n *\n * @param {SVGElement} element\n * @param {SVGElement} target\n *\n * @return {SVGElement} the appended node\n */\nfunction appendTo(element, target) {\n return target.appendChild(ensureImported(element, target));\n}\n\n/**\n * append utility\n */\n\n\n/**\n * Append a node to an element\n *\n * @param {SVGElement} element\n * @param {SVGElement} node\n *\n * @return {SVGElement} the element\n */\nfunction append(target, node) {\n appendTo(node, target);\n return target;\n}\n\n/**\n * attribute accessor utility\n */\n\nvar LENGTH_ATTR = 2;\n\nvar CSS_PROPERTIES = {\n 'alignment-baseline': 1,\n 'baseline-shift': 1,\n 'clip': 1,\n 'clip-path': 1,\n 'clip-rule': 1,\n 'color': 1,\n 'color-interpolation': 1,\n 'color-interpolation-filters': 1,\n 'color-profile': 1,\n 'color-rendering': 1,\n 'cursor': 1,\n 'direction': 1,\n 'display': 1,\n 'dominant-baseline': 1,\n 'enable-background': 1,\n 'fill': 1,\n 'fill-opacity': 1,\n 'fill-rule': 1,\n 'filter': 1,\n 'flood-color': 1,\n 'flood-opacity': 1,\n 'font': 1,\n 'font-family': 1,\n 'font-size': LENGTH_ATTR,\n 'font-size-adjust': 1,\n 'font-stretch': 1,\n 'font-style': 1,\n 'font-variant': 1,\n 'font-weight': 1,\n 'glyph-orientation-horizontal': 1,\n 'glyph-orientation-vertical': 1,\n 'image-rendering': 1,\n 'kerning': 1,\n 'letter-spacing': 1,\n 'lighting-color': 1,\n 'marker': 1,\n 'marker-end': 1,\n 'marker-mid': 1,\n 'marker-start': 1,\n 'mask': 1,\n 'opacity': 1,\n 'overflow': 1,\n 'pointer-events': 1,\n 'shape-rendering': 1,\n 'stop-color': 1,\n 'stop-opacity': 1,\n 'stroke': 1,\n 'stroke-dasharray': 1,\n 'stroke-dashoffset': 1,\n 'stroke-linecap': 1,\n 'stroke-linejoin': 1,\n 'stroke-miterlimit': 1,\n 'stroke-opacity': 1,\n 'stroke-width': LENGTH_ATTR,\n 'text-anchor': 1,\n 'text-decoration': 1,\n 'text-rendering': 1,\n 'unicode-bidi': 1,\n 'visibility': 1,\n 'word-spacing': 1,\n 'writing-mode': 1\n};\n\n\nfunction getAttribute(node, name) {\n if (CSS_PROPERTIES[name]) {\n return node.style[name];\n } else {\n return node.getAttributeNS(null, name);\n }\n}\n\nfunction setAttribute(node, name, value) {\n var hyphenated = name.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();\n\n var type = CSS_PROPERTIES[hyphenated];\n\n if (type) {\n\n // append pixel unit, unless present\n if (type === LENGTH_ATTR && typeof value === 'number') {\n value = String(value) + 'px';\n }\n\n node.style[hyphenated] = value;\n } else {\n node.setAttributeNS(null, name, value);\n }\n}\n\nfunction setAttributes(node, attrs) {\n\n var names = Object.keys(attrs), i, name;\n\n for (i = 0, name; (name = names[i]); i++) {\n setAttribute(node, name, attrs[name]);\n }\n}\n\n/**\n * Gets or sets raw attributes on a node.\n *\n * @param {SVGElement} node\n * @param {Object} [attrs]\n * @param {String} [name]\n * @param {String} [value]\n *\n * @return {String}\n */\nfunction attr(node, name, value) {\n if (typeof name === 'string') {\n if (value !== undefined) {\n setAttribute(node, name, value);\n } else {\n return getAttribute(node, name);\n }\n } else {\n setAttributes(node, name);\n }\n\n return node;\n}\n\n/**\r\n * Taken from https://github.com/component/classes\r\n *\r\n * Without the component bits.\r\n */\r\n\r\n/**\r\n * toString reference.\r\n */\r\n\r\nconst toString = Object.prototype.toString;\r\n\r\n/**\r\n * Wrap `el` in a `ClassList`.\r\n *\r\n * @param {Element} el\r\n * @return {ClassList}\r\n * @api public\r\n */\r\n\r\nfunction classes(el) {\r\n return new ClassList(el);\r\n}\r\n\r\nfunction ClassList(el) {\r\n if (!el || !el.nodeType) {\r\n throw new Error('A DOM element reference is required');\r\n }\r\n this.el = el;\r\n this.list = el.classList;\r\n}\r\n\r\n/**\r\n * Add class `name` if not already present.\r\n *\r\n * @param {String} name\r\n * @return {ClassList}\r\n * @api public\r\n */\r\n\r\nClassList.prototype.add = function(name) {\r\n this.list.add(name);\r\n return this;\r\n};\r\n\r\n/**\r\n * Remove class `name` when present, or\r\n * pass a regular expression to remove\r\n * any which match.\r\n *\r\n * @param {String|RegExp} name\r\n * @return {ClassList}\r\n * @api public\r\n */\r\n\r\nClassList.prototype.remove = function(name) {\r\n if ('[object RegExp]' == toString.call(name)) {\r\n return this.removeMatching(name);\r\n }\r\n\r\n this.list.remove(name);\r\n return this;\r\n};\r\n\r\n/**\r\n * Remove all classes matching `re`.\r\n *\r\n * @param {RegExp} re\r\n * @return {ClassList}\r\n * @api private\r\n */\r\n\r\nClassList.prototype.removeMatching = function(re) {\r\n const arr = this.array();\r\n for (let i = 0; i < arr.length; i++) {\r\n if (re.test(arr[i])) {\r\n this.remove(arr[i]);\r\n }\r\n }\r\n return this;\r\n};\r\n\r\n/**\r\n * Toggle class `name`, can force state via `force`.\r\n *\r\n * For browsers that support classList, but do not support `force` yet,\r\n * the mistake will be detected and corrected.\r\n *\r\n * @param {String} name\r\n * @param {Boolean} force\r\n * @return {ClassList}\r\n * @api public\r\n */\r\n\r\nClassList.prototype.toggle = function(name, force) {\r\n if ('undefined' !== typeof force) {\r\n if (force !== this.list.toggle(name, force)) {\r\n this.list.toggle(name); // toggle again to correct\r\n }\r\n } else {\r\n this.list.toggle(name);\r\n }\r\n return this;\r\n};\r\n\r\n/**\r\n * Return an array of classes.\r\n *\r\n * @return {Array}\r\n * @api public\r\n */\r\n\r\nClassList.prototype.array = function() {\r\n return Array.from(this.list);\r\n};\r\n\r\n/**\r\n * Check if class `name` is present.\r\n *\r\n * @param {String} name\r\n * @return {ClassList}\r\n * @api public\r\n */\r\n\r\nClassList.prototype.has =\r\n ClassList.prototype.contains = function(name) {\r\n return this.list.contains(name);\r\n };\n\n/**\n * Clear utility\n */\n\n/**\n * Removes all children from the given element\n *\n * @param {SVGElement} element\n * @return {Element} the element (for chaining)\n */\nfunction clear(element) {\n var child;\n\n while ((child = element.firstChild)) {\n element.removeChild(child);\n }\n\n return element;\n}\n\nfunction clone(element) {\n return element.cloneNode(true);\n}\n\nvar ns = {\n svg: 'http://www.w3.org/2000/svg'\n};\n\n/**\n * DOM parsing utility\n */\n\n\nvar SVG_START = '
' + svg + ' ';\n unwrap = true;\n }\n\n var parsed = parseDocument(svg);\n\n if (!unwrap) {\n return parsed;\n }\n\n var fragment = document.createDocumentFragment();\n\n var parent = parsed.firstChild;\n\n while (parent.firstChild) {\n fragment.appendChild(parent.firstChild);\n }\n\n return fragment;\n}\n\nfunction parseDocument(svg) {\n\n var parser;\n\n // parse\n parser = new DOMParser();\n parser.async = false;\n\n return parser.parseFromString(svg, 'text/xml');\n}\n\n/**\n * Create utility for SVG elements\n */\n\n\n\n/**\n * Create a specific type from name or SVG markup.\n *\n * @param {String} name the name or markup of the element\n * @param {Object} [attrs] attributes to set on the element\n *\n * @returns {SVGElement}\n */\nfunction create(name, attrs) {\n var element;\n\n name = name.trim();\n\n if (name.charAt(0) === '<') {\n element = parse(name).firstChild;\n element = document.importNode(element, true);\n } else {\n element = document.createElementNS(ns.svg, name);\n }\n\n if (attrs) {\n attr(element, attrs);\n }\n\n return element;\n}\n\n/**\n * Events handling utility\n */\n\nfunction on(node, event, listener, useCapture) {\n node.addEventListener(event, listener, useCapture);\n}\n\nfunction off(node, event, listener, useCapture) {\n node.removeEventListener(event, listener, useCapture);\n}\n\n/**\n * Geometry helpers\n */\n\n\n// fake node used to instantiate svg geometry elements\nvar node = null;\n\nfunction getNode() {\n if (node === null) {\n node = create('svg');\n }\n\n return node;\n}\n\nfunction extend(object, props) {\n var i, k, keys = Object.keys(props);\n\n for (i = 0; (k = keys[i]); i++) {\n object[k] = props[k];\n }\n\n return object;\n}\n\n\nfunction createPoint(x, y) {\n var point = getNode().createSVGPoint();\n\n switch (arguments.length) {\n case 0:\n return point;\n case 2:\n x = {\n x: x,\n y: y\n };\n break;\n }\n\n return extend(point, x);\n}\n\n/**\n * Create matrix via args.\n *\n * @example\n *\n * createMatrix({ a: 1, b: 1 });\n * createMatrix();\n * createMatrix(1, 2, 0, 0, 30, 20);\n *\n * @return {SVGMatrix}\n */\nfunction createMatrix(a, b, c, d, e, f) {\n var matrix = getNode().createSVGMatrix();\n\n switch (arguments.length) {\n case 0:\n return matrix;\n case 1:\n return extend(matrix, a);\n case 6:\n return extend(matrix, {\n a: a,\n b: b,\n c: c,\n d: d,\n e: e,\n f: f\n });\n }\n}\n\nfunction createTransform(matrix) {\n if (matrix) {\n return getNode().createSVGTransformFromMatrix(matrix);\n } else {\n return getNode().createSVGTransform();\n }\n}\n\n/**\n * Serialization util\n */\n\nvar TEXT_ENTITIES = /([&<>]{1})/g;\nvar ATTR_ENTITIES = /([&<>\\n\\r\"]{1})/g;\n\nvar ENTITY_REPLACEMENT = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '\\''\n};\n\nfunction escape(str, pattern) {\n\n function replaceFn(match, entity) {\n return ENTITY_REPLACEMENT[entity] || entity;\n }\n\n return str.replace(pattern, replaceFn);\n}\n\nfunction serialize(node, output) {\n\n var i, len, attrMap, attrNode, childNodes;\n\n switch (node.nodeType) {\n\n // TEXT\n case 3:\n\n // replace special XML characters\n output.push(escape(node.textContent, TEXT_ENTITIES));\n break;\n\n // ELEMENT\n case 1:\n output.push('<', node.tagName);\n\n if (node.hasAttributes()) {\n attrMap = node.attributes;\n for (i = 0, len = attrMap.length; i < len; ++i) {\n attrNode = attrMap.item(i);\n output.push(' ', attrNode.name, '=\"', escape(attrNode.value, ATTR_ENTITIES), '\"');\n }\n }\n\n if (node.hasChildNodes()) {\n output.push('>');\n childNodes = node.childNodes;\n for (i = 0, len = childNodes.length; i < len; ++i) {\n serialize(childNodes.item(i), output);\n }\n output.push('', node.tagName, '>');\n } else {\n output.push('/>');\n }\n break;\n\n // COMMENT\n case 8:\n output.push('');\n break;\n\n // CDATA\n case 4:\n output.push('');\n break;\n\n default:\n throw new Error('unable to handle node ' + node.nodeType);\n }\n\n return output;\n}\n\n/**\n * innerHTML like functionality for SVG elements.\n * based on innerSVG (https://code.google.com/p/innersvg)\n */\n\n\n\nfunction set(element, svg) {\n\n var parsed = parse(svg);\n\n // clear element contents\n clear(element);\n\n if (!svg) {\n return;\n }\n\n if (!isFragment(parsed)) {\n\n // extract
from parsed document\n parsed = parsed.documentElement;\n }\n\n var nodes = slice(parsed.childNodes);\n\n // import + append each node\n for (var i = 0; i < nodes.length; i++) {\n appendTo(nodes[i], element);\n }\n\n}\n\nfunction get(element) {\n var child = element.firstChild,\n output = [];\n\n while (child) {\n serialize(child, output);\n child = child.nextSibling;\n }\n\n return output.join('');\n}\n\nfunction isFragment(node) {\n return node.nodeName === '#document-fragment';\n}\n\nfunction innerSVG(element, svg) {\n\n if (svg !== undefined) {\n\n try {\n set(element, svg);\n } catch (e) {\n throw new Error('error parsing SVG: ' + e.message);\n }\n\n return element;\n } else {\n return get(element);\n }\n}\n\n\nfunction slice(arr) {\n return Array.prototype.slice.call(arr);\n}\n\n/**\n * Selection utilities\n */\n\nfunction select(node, selector) {\n return node.querySelector(selector);\n}\n\nfunction selectAll(node, selector) {\n var nodes = node.querySelectorAll(selector);\n\n return [].map.call(nodes, function(element) {\n return element;\n });\n}\n\n/**\n * prependTo utility\n */\n\n\n/**\n * Prepend a node to a target element and return the prepended node.\n *\n * @param {SVGElement} node\n * @param {SVGElement} target\n *\n * @return {SVGElement} the prepended node\n */\nfunction prependTo(node, target) {\n return target.insertBefore(ensureImported(node, target), target.firstChild || null);\n}\n\n/**\n * prepend utility\n */\n\n\n/**\n * Prepend a node to a target element\n *\n * @param {SVGElement} target\n * @param {SVGElement} node\n *\n * @return {SVGElement} the target element\n */\nfunction prepend(target, node) {\n prependTo(node, target);\n return target;\n}\n\nfunction remove(element) {\n var parent = element.parentNode;\n\n if (parent) {\n parent.removeChild(element);\n }\n\n return element;\n}\n\n/**\n * Replace utility\n */\n\n\nfunction replace(element, replacement) {\n element.parentNode.replaceChild(ensureImported(replacement, element), element);\n return replacement;\n}\n\n/**\n * transform accessor utility\n */\n\nfunction wrapMatrix(transformList, transform) {\n if (transform instanceof SVGMatrix) {\n return transformList.createSVGTransformFromMatrix(transform);\n }\n\n return transform;\n}\n\n\nfunction setTransforms(transformList, transforms) {\n var i, t;\n\n transformList.clear();\n\n for (i = 0; (t = transforms[i]); i++) {\n transformList.appendItem(wrapMatrix(transformList, t));\n }\n}\n\n/**\n * Get or set the transforms on the given node.\n *\n * @param {SVGElement} node\n * @param {SVGTransform|SVGMatrix|Array} [transforms]\n *\n * @return {SVGTransform} the consolidated transform\n */\nfunction transform(node, transforms) {\n var transformList = node.transform.baseVal;\n\n if (transforms) {\n\n if (!Array.isArray(transforms)) {\n transforms = [ transforms ];\n }\n\n setTransforms(transformList, transforms);\n }\n\n return transformList.consolidate();\n}\n\nexport { append, appendTo, attr, classes, clear, clone, create, createMatrix, createPoint, createTransform, innerSVG, off, on, prepend, prependTo, remove, replace, select, selectAll, transform };\n","const CLASS_PATTERN = /^class[ {]/;\n\n\n/**\n * @param {function} fn\n *\n * @return {boolean}\n */\nfunction isClass(fn) {\n return CLASS_PATTERN.test(fn.toString());\n}\n\n/**\n * @param {any} obj\n *\n * @return {boolean}\n */\nfunction isArray(obj) {\n return Array.isArray(obj);\n}\n\n/**\n * @param {any} obj\n * @param {string} prop\n *\n * @return {boolean}\n */\nfunction hasOwnProp(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n\n/**\n * @typedef {import('./index.js').InjectAnnotated } InjectAnnotated\n */\n\n/**\n * @template T\n *\n * @params {[...string[], T] | ...string[], T} args\n *\n * @return {T & InjectAnnotated}\n */\nfunction annotate(...args) {\n\n if (args.length === 1 && isArray(args[0])) {\n args = args[0];\n }\n\n args = [ ...args ];\n\n const fn = args.pop();\n\n fn.$inject = args;\n\n return fn;\n}\n\n\n// Current limitations:\n// - can't put into \"function arg\" comments\n// function /* (no parenthesis like this) */ (){}\n// function abc( /* xx (no parenthesis like this) */ a, b) {}\n//\n// Just put the comment before function or inside:\n// /* (((this is fine))) */ function(a, b) {}\n// function abc(a) { /* (((this is fine))) */}\n//\n// - can't reliably auto-annotate constructor; we'll match the\n// first constructor(...) pattern found which may be the one\n// of a nested class, too.\n\nconst CONSTRUCTOR_ARGS = /constructor\\s*[^(]*\\(\\s*([^)]*)\\)/m;\nconst FN_ARGS = /^(?:async\\s+)?(?:function\\s*[^(]*)?(?:\\(\\s*([^)]*)\\)|(\\w+))/m;\nconst FN_ARG = /\\/\\*([^*]*)\\*\\//m;\n\n/**\n * @param {unknown} fn\n *\n * @return {string[]}\n */\nfunction parseAnnotations(fn) {\n\n if (typeof fn !== 'function') {\n throw new Error(`Cannot annotate \"${fn}\". Expected a function!`);\n }\n\n const match = fn.toString().match(isClass(fn) ? CONSTRUCTOR_ARGS : FN_ARGS);\n\n // may parse class without constructor\n if (!match) {\n return [];\n }\n\n const args = match[1] || match[2];\n\n return args && args.split(',').map(arg => {\n const argMatch = arg.match(FN_ARG);\n return (argMatch && argMatch[1] || arg).trim();\n }) || [];\n}\n\n/**\n * @typedef { import('./index.js').ModuleDeclaration } ModuleDeclaration\n * @typedef { import('./index.js').ModuleDefinition } ModuleDefinition\n * @typedef { import('./index.js').InjectorContext } InjectorContext\n *\n * @typedef { import('./index.js').TypedDeclaration } TypedDeclaration\n */\n\n/**\n * Create a new injector with the given modules.\n *\n * @param {ModuleDefinition[]} modules\n * @param {InjectorContext} [_parent]\n */\nfunction Injector(modules, _parent) {\n\n const parent = _parent || /** @type InjectorContext */ ({\n get: function(name, strict) {\n currentlyResolving.push(name);\n\n if (strict === false) {\n return null;\n } else {\n throw error(`No provider for \"${ name }\"!`);\n }\n }\n });\n\n const currentlyResolving = [];\n const providers = this._providers = Object.create(parent._providers || null);\n const instances = this._instances = Object.create(null);\n\n const self = instances.injector = this;\n\n const error = function(msg) {\n const stack = currentlyResolving.join(' -> ');\n currentlyResolving.length = 0;\n return new Error(stack ? `${ msg } (Resolving: ${ stack })` : msg);\n };\n\n /**\n * Return a named service.\n *\n * @param {string} name\n * @param {boolean} [strict=true] if false, resolve missing services to null\n *\n * @return {any}\n */\n function get(name, strict) {\n if (!providers[name] && name.includes('.')) {\n\n const parts = name.split('.');\n let pivot = get(/** @type { string } */ (parts.shift()));\n\n while (parts.length) {\n pivot = pivot[/** @type { string } */ (parts.shift())];\n }\n\n return pivot;\n }\n\n if (hasOwnProp(instances, name)) {\n return instances[name];\n }\n\n if (hasOwnProp(providers, name)) {\n if (currentlyResolving.indexOf(name) !== -1) {\n currentlyResolving.push(name);\n throw error('Cannot resolve circular dependency!');\n }\n\n currentlyResolving.push(name);\n instances[name] = providers[name][0](providers[name][1]);\n currentlyResolving.pop();\n\n return instances[name];\n }\n\n return parent.get(name, strict);\n }\n\n function fnDef(fn, locals) {\n\n if (typeof locals === 'undefined') {\n locals = {};\n }\n\n if (typeof fn !== 'function') {\n if (isArray(fn)) {\n fn = annotate(fn.slice());\n } else {\n throw error(`Cannot invoke \"${ fn }\". Expected a function!`);\n }\n }\n\n /**\n * @type {string[]}\n */\n const inject = fn.$inject || parseAnnotations(fn);\n const dependencies = inject.map(dep => {\n if (hasOwnProp(locals, dep)) {\n return locals[dep];\n } else {\n return get(dep);\n }\n });\n\n return {\n fn: fn,\n dependencies\n };\n }\n\n /**\n * Instantiate the given type, injecting dependencies.\n *\n * @template T\n *\n * @param { Function | [...string[], Function ]} type\n *\n * @return T\n */\n function instantiate(type) {\n const {\n fn,\n dependencies\n } = fnDef(type);\n\n // instantiate var args constructor\n const Constructor = Function.prototype.bind.call(fn, null, ...dependencies);\n\n return new Constructor();\n }\n\n /**\n * Invoke the given function, injecting dependencies. Return the result.\n *\n * @template T\n *\n * @param { Function | [...string[], Function ]} func\n * @param { Object } [context]\n * @param { Object } [locals]\n *\n * @return {T} invocation result\n */\n function invoke(func, context, locals) {\n const {\n fn,\n dependencies\n } = fnDef(func, locals);\n\n return fn.apply(context, dependencies);\n }\n\n /**\n * @param {Injector} childInjector\n *\n * @return {Function}\n */\n function createPrivateInjectorFactory(childInjector) {\n return annotate(key => childInjector.get(key));\n }\n\n /**\n * @param {ModuleDefinition[]} modules\n * @param {string[]} [forceNewInstances]\n *\n * @return {Injector}\n */\n function createChild(modules, forceNewInstances) {\n if (forceNewInstances && forceNewInstances.length) {\n const fromParentModule = Object.create(null);\n const matchedScopes = Object.create(null);\n\n const privateInjectorsCache = [];\n const privateChildInjectors = [];\n const privateChildFactories = [];\n\n let provider;\n let cacheIdx;\n let privateChildInjector;\n let privateChildInjectorFactory;\n\n for (let name in providers) {\n provider = providers[name];\n\n if (forceNewInstances.indexOf(name) !== -1) {\n if (provider[2] === 'private') {\n cacheIdx = privateInjectorsCache.indexOf(provider[3]);\n if (cacheIdx === -1) {\n privateChildInjector = provider[3].createChild([], forceNewInstances);\n privateChildInjectorFactory = createPrivateInjectorFactory(privateChildInjector);\n privateInjectorsCache.push(provider[3]);\n privateChildInjectors.push(privateChildInjector);\n privateChildFactories.push(privateChildInjectorFactory);\n fromParentModule[name] = [ privateChildInjectorFactory, name, 'private', privateChildInjector ];\n } else {\n fromParentModule[name] = [ privateChildFactories[cacheIdx], name, 'private', privateChildInjectors[cacheIdx] ];\n }\n } else {\n fromParentModule[name] = [ provider[2], provider[1] ];\n }\n matchedScopes[name] = true;\n }\n\n if ((provider[2] === 'factory' || provider[2] === 'type') && provider[1].$scope) {\n /* jshint -W083 */\n forceNewInstances.forEach(scope => {\n if (provider[1].$scope.indexOf(scope) !== -1) {\n fromParentModule[name] = [ provider[2], provider[1] ];\n matchedScopes[scope] = true;\n }\n });\n }\n }\n\n forceNewInstances.forEach(scope => {\n if (!matchedScopes[scope]) {\n throw new Error('No provider for \"' + scope + '\". Cannot use provider from the parent!');\n }\n });\n\n modules.unshift(fromParentModule);\n }\n\n return new Injector(modules, self);\n }\n\n const factoryMap = {\n factory: invoke,\n type: instantiate,\n value: function(value) {\n return value;\n }\n };\n\n /**\n * @param {ModuleDefinition} moduleDefinition\n * @param {Injector} injector\n */\n function createInitializer(moduleDefinition, injector) {\n\n const initializers = moduleDefinition.__init__ || [];\n\n return function() {\n initializers.forEach(initializer => {\n\n // eagerly resolve component (fn or string)\n if (typeof initializer === 'string') {\n injector.get(initializer);\n } else {\n injector.invoke(initializer);\n }\n });\n };\n }\n\n /**\n * @param {ModuleDefinition} moduleDefinition\n */\n function loadModule(moduleDefinition) {\n\n const moduleExports = moduleDefinition.__exports__;\n\n // private module\n if (moduleExports) {\n const nestedModules = moduleDefinition.__modules__;\n\n const clonedModule = Object.keys(moduleDefinition).reduce((clonedModule, key) => {\n\n if (key !== '__exports__' && key !== '__modules__' && key !== '__init__' && key !== '__depends__') {\n clonedModule[key] = moduleDefinition[key];\n }\n\n return clonedModule;\n }, Object.create(null));\n\n const childModules = (nestedModules || []).concat(clonedModule);\n\n const privateInjector = createChild(childModules);\n const getFromPrivateInjector = annotate(function(key) {\n return privateInjector.get(key);\n });\n\n moduleExports.forEach(function(key) {\n providers[key] = [ getFromPrivateInjector, key, 'private', privateInjector ];\n });\n\n // ensure child injector initializes\n const initializers = (moduleDefinition.__init__ || []).slice();\n\n initializers.unshift(function() {\n privateInjector.init();\n });\n\n moduleDefinition = Object.assign({}, moduleDefinition, {\n __init__: initializers\n });\n\n return createInitializer(moduleDefinition, privateInjector);\n }\n\n // normal module\n Object.keys(moduleDefinition).forEach(function(key) {\n\n if (key === '__init__' || key === '__depends__') {\n return;\n }\n\n const typeDeclaration = /** @type { TypedDeclaration } */ (\n moduleDefinition[key]\n );\n\n if (typeDeclaration[2] === 'private') {\n providers[key] = typeDeclaration;\n return;\n }\n\n const type = typeDeclaration[0];\n const value = typeDeclaration[1];\n\n providers[key] = [ factoryMap[type], arrayUnwrap(type, value), type ];\n });\n\n return createInitializer(moduleDefinition, self);\n }\n\n /**\n * @param {ModuleDefinition[]} moduleDefinitions\n * @param {ModuleDefinition} moduleDefinition\n *\n * @return {ModuleDefinition[]}\n */\n function resolveDependencies(moduleDefinitions, moduleDefinition) {\n\n if (moduleDefinitions.indexOf(moduleDefinition) !== -1) {\n return moduleDefinitions;\n }\n\n moduleDefinitions = (moduleDefinition.__depends__ || []).reduce(resolveDependencies, moduleDefinitions);\n\n if (moduleDefinitions.indexOf(moduleDefinition) !== -1) {\n return moduleDefinitions;\n }\n\n return moduleDefinitions.concat(moduleDefinition);\n }\n\n /**\n * @param {ModuleDefinition[]} moduleDefinitions\n *\n * @return { () => void } initializerFn\n */\n function bootstrap(moduleDefinitions) {\n\n const initializers = moduleDefinitions\n .reduce(resolveDependencies, [])\n .map(loadModule);\n\n let initialized = false;\n\n return function() {\n\n if (initialized) {\n return;\n }\n\n initialized = true;\n\n initializers.forEach(initializer => initializer());\n };\n }\n\n // public API\n this.get = get;\n this.invoke = invoke;\n this.instantiate = instantiate;\n this.createChild = createChild;\n\n // setup\n this.init = bootstrap(modules);\n}\n\n\n// helpers ///////////////\n\nfunction arrayUnwrap(type, value) {\n if (type !== 'value' && isArray(value)) {\n value = annotate(value.slice());\n }\n\n return value;\n}\n\nexport { Injector, annotate, parseAnnotations };\n//# sourceMappingURL=index.js.map\n","var DEFAULT_RENDER_PRIORITY = 1000;\n\n/**\n * @typedef {import('../core/Types').ElementLike} Element\n * @typedef {import('../core/Types').ConnectionLike} Connection\n * @typedef {import('../core/Types').ShapeLike} Shape\n *\n * @typedef {import('../core/EventBus').default} EventBus\n */\n\n/**\n * The base implementation of shape and connection renderers.\n *\n * @param {EventBus} eventBus\n * @param {number} [renderPriority=1000]\n */\nexport default function BaseRenderer(eventBus, renderPriority) {\n var self = this;\n\n renderPriority = renderPriority || DEFAULT_RENDER_PRIORITY;\n\n eventBus.on([ 'render.shape', 'render.connection' ], renderPriority, function(evt, context) {\n var type = evt.type,\n element = context.element,\n visuals = context.gfx,\n attrs = context.attrs;\n\n if (self.canRender(element)) {\n if (type === 'render.shape') {\n return self.drawShape(visuals, element, attrs);\n } else {\n return self.drawConnection(visuals, element, attrs);\n }\n }\n });\n\n eventBus.on([ 'render.getShapePath', 'render.getConnectionPath' ], renderPriority, function(evt, element) {\n if (self.canRender(element)) {\n if (evt.type === 'render.getShapePath') {\n return self.getShapePath(element);\n } else {\n return self.getConnectionPath(element);\n }\n }\n });\n}\n\n/**\n * Checks whether an element can be rendered.\n *\n * @param {Element} element The element to be rendered.\n *\n * @return {boolean} Whether the element can be rendered.\n */\nBaseRenderer.prototype.canRender = function(element) {};\n\n/**\n * Draws a shape.\n *\n * @param {SVGElement} visuals The SVG element to draw the shape into.\n * @param {Shape} shape The shape to be drawn.\n *\n * @return {SVGElement} The SVG element of the shape drawn.\n */\nBaseRenderer.prototype.drawShape = function(visuals, shape) {};\n\n/**\n * Draws a connection.\n *\n * @param {SVGElement} visuals The SVG element to draw the connection into.\n * @param {Connection} connection The connection to be drawn.\n *\n * @return {SVGElement} The SVG element of the connection drawn.\n */\nBaseRenderer.prototype.drawConnection = function(visuals, connection) {};\n\n/**\n * Gets the SVG path of the graphical representation of a shape.\n *\n * @param {Shape} shape The shape.\n *\n * @return {string} The SVG path of the shape.\n */\nBaseRenderer.prototype.getShapePath = function(shape) {};\n\n/**\n * Gets the SVG path of the graphical representation of a connection.\n *\n * @param {Connection} connection The connection.\n *\n * @return {string} The SVG path of the connection.\n */\nBaseRenderer.prototype.getConnectionPath = function(connection) {};\n","import {\n isNumber\n} from 'min-dash';\n\nimport {\n attr as svgAttr,\n create as svgCreate\n} from 'tiny-svg';\n\n\n/**\n * @typedef {(string|number)[]} Component\n *\n * @typedef {import('../util/Types').Point} Point\n */\n\n/**\n * @param {Component[] | Component[][]} elements\n *\n * @return {string}\n */\nexport function componentsToPath(elements) {\n return elements.flat().join(',').replace(/,?([A-z]),?/g, '$1');\n}\n\n/**\n * @param {Point[]} points\n *\n * @return {string}\n */\nexport function toSVGPoints(points) {\n var result = '';\n\n for (var i = 0, p; (p = points[i]); i++) {\n result += p.x + ',' + p.y + ' ';\n }\n\n return result;\n}\n\n/**\n * @param {Point} point\n *\n * @return {Component[]}\n */\nfunction move(point) {\n return [ 'M', point.x, point.y ];\n}\n\n/**\n * @param {Point} point\n *\n * @return {Component[]}\n */\nfunction lineTo(point) {\n return [ 'L', point.x, point.y ];\n}\n\n/**\n * @param {Point} p1\n * @param {Point} p2\n * @param {Point} p3\n *\n * @return {Component[]}\n */\nfunction curveTo(p1, p2, p3) {\n return [ 'C', p1.x, p1.y, p2.x, p2.y, p3.x, p3.y ];\n}\n\n/**\n * @param {Point[]} waypoints\n * @param {number} [cornerRadius]\n * @return {Component[][]}\n */\nfunction drawPath(waypoints, cornerRadius) {\n const pointCount = waypoints.length;\n\n const path = [ move(waypoints[0]) ];\n\n for (let i = 1; i < pointCount; i++) {\n\n const pointBefore = waypoints[i - 1];\n const point = waypoints[i];\n const pointAfter = waypoints[i + 1];\n\n if (!pointAfter || !cornerRadius) {\n path.push(lineTo(point));\n\n continue;\n }\n\n const effectiveRadius = Math.min(\n cornerRadius,\n vectorLength(point.x - pointBefore.x, point.y - pointBefore.y),\n vectorLength(pointAfter.x - point.x, pointAfter.y - point.y)\n );\n\n if (!effectiveRadius) {\n path.push(lineTo(point));\n\n continue;\n }\n\n const beforePoint = getPointAtLength(point, pointBefore, effectiveRadius);\n const beforePoint2 = getPointAtLength(point, pointBefore, effectiveRadius * .5);\n\n const afterPoint = getPointAtLength(point, pointAfter, effectiveRadius);\n const afterPoint2 = getPointAtLength(point, pointAfter, effectiveRadius * .5);\n\n path.push(lineTo(beforePoint));\n path.push(curveTo(beforePoint2, afterPoint2, afterPoint));\n }\n\n return path;\n}\n\nfunction getPointAtLength(start, end, length) {\n\n const deltaX = end.x - start.x;\n const deltaY = end.y - start.y;\n\n const totalLength = vectorLength(deltaX, deltaY);\n\n const percent = length / totalLength;\n\n return {\n x: start.x + deltaX * percent,\n y: start.y + deltaY * percent\n };\n}\n\nfunction vectorLength(x, y) {\n return Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2));\n}\n\n/**\n * @param {Point[]} points\n * @param {number|Object} [attrs]\n * @param {number} [radius]\n *\n * @return {SVGElement}\n */\nexport function createLine(points, attrs, radius) {\n\n if (isNumber(attrs)) {\n radius = attrs;\n attrs = null;\n }\n\n if (!attrs) {\n attrs = {};\n }\n\n const line = svgCreate('path', attrs);\n\n if (isNumber(radius)) {\n line.dataset.cornerRadius = String(radius);\n }\n\n return updateLine(line, points);\n}\n\n/**\n * @param {SVGElement} gfx\n * @param {Point[]} points\n *\n * @return {SVGElement}\n */\nexport function updateLine(gfx, points) {\n\n const cornerRadius = parseInt(gfx.dataset.cornerRadius, 10) || 0;\n\n svgAttr(gfx, {\n d: componentsToPath(drawPath(points, cornerRadius))\n });\n\n return gfx;\n}\n","import {\n assign,\n filter,\n find,\n isArray,\n isNumber,\n isObject,\n isUndefined,\n groupBy,\n forEach\n} from 'min-dash';\n\n/**\n * @typedef {import('../model/Types').Connection} Connection\n * @typedef {import('../model/Types').Element} Element\n * @typedef {import('../model/Types').Shape} Shape\n *\n * @typedef {import('../../type/Types').Rect} Rect\n *\n * @typedef { {\n * allShapes: Record,\n * allConnections: Record,\n * topLevel: Record,\n * enclosedConnections: Record,\n * enclosedElements: Record\n * } } Closure\n */\n\n/**\n * Get parent elements.\n *\n * @param {Element[]} elements\n *\n * @return {Element[]}\n */\nexport function getParents(elements) {\n\n // find elements that are not children of any other elements\n return filter(elements, function(element) {\n return !find(elements, function(e) {\n return e !== element && getParent(element, e);\n });\n });\n}\n\n\nfunction getParent(element, parent) {\n if (!parent) {\n return;\n }\n\n if (element === parent) {\n return parent;\n }\n\n if (!element.parent) {\n return;\n }\n\n return getParent(element.parent, parent);\n}\n\n\n/**\n * Adds an element to a collection and returns true if the\n * element was added.\n *\n * @param {Object[]} elements\n * @param {Object} element\n * @param {boolean} [unique]\n */\nexport function add(elements, element, unique) {\n var canAdd = !unique || elements.indexOf(element) === -1;\n\n if (canAdd) {\n elements.push(element);\n }\n\n return canAdd;\n}\n\n\n/**\n * Iterate over each element in a collection, calling the iterator function `fn`\n * with (element, index, recursionDepth).\n *\n * Recurse into all elements that are returned by `fn`.\n *\n * @param {Element|Element[]} elements\n * @param {(element: Element, index: number, depth: number) => Element[] | boolean | undefined} fn\n * @param {number} [depth] maximum recursion depth\n */\nexport function eachElement(elements, fn, depth) {\n\n depth = depth || 0;\n\n if (!isArray(elements)) {\n elements = [ elements ];\n }\n\n forEach(elements, function(s, i) {\n var filter = fn(s, i, depth);\n\n if (isArray(filter) && filter.length) {\n eachElement(filter, fn, depth + 1);\n }\n });\n}\n\n\n/**\n * Collects self + child elements up to a given depth from a list of elements.\n *\n * @param {Element|Element[]} elements the elements to select the children from\n * @param {boolean} unique whether to return a unique result set (no duplicates)\n * @param {number} maxDepth the depth to search through or -1 for infinite\n *\n * @return {Element[]} found elements\n */\nexport function selfAndChildren(elements, unique, maxDepth) {\n var result = [],\n processedChildren = [];\n\n eachElement(elements, function(element, i, depth) {\n add(result, element, unique);\n\n var children = element.children;\n\n // max traversal depth not reached yet\n if (maxDepth === -1 || depth < maxDepth) {\n\n // children exist && children not yet processed\n if (children && add(processedChildren, children, unique)) {\n return children;\n }\n }\n });\n\n return result;\n}\n\n/**\n * Return self + direct children for a number of elements\n *\n * @param {Element[]} elements to query\n * @param {boolean} [allowDuplicates] to allow duplicates in the result set\n *\n * @return {Element[]} the collected elements\n */\nexport function selfAndDirectChildren(elements, allowDuplicates) {\n return selfAndChildren(elements, !allowDuplicates, 1);\n}\n\n\n/**\n * Return self + ALL children for a number of elements\n *\n * @param {Element[]} elements to query\n * @param {boolean} [allowDuplicates] to allow duplicates in the result set\n *\n * @return {Element[]} the collected elements\n */\nexport function selfAndAllChildren(elements, allowDuplicates) {\n return selfAndChildren(elements, !allowDuplicates, -1);\n}\n\n\n/**\n * Gets the the closure for all selected elements,\n * their enclosed children and connections.\n *\n * @param {Element[]} elements\n * @param {boolean} [isTopLevel=true]\n * @param {Closure} [closure]\n *\n * @return {Closure} newClosure\n */\nexport function getClosure(elements, isTopLevel, closure) {\n\n if (isUndefined(isTopLevel)) {\n isTopLevel = true;\n }\n\n if (isObject(isTopLevel)) {\n closure = isTopLevel;\n isTopLevel = true;\n }\n\n\n closure = closure || {};\n\n var allShapes = copyObject(closure.allShapes),\n allConnections = copyObject(closure.allConnections),\n enclosedElements = copyObject(closure.enclosedElements),\n enclosedConnections = copyObject(closure.enclosedConnections);\n\n var topLevel = copyObject(\n closure.topLevel,\n isTopLevel && groupBy(elements, function(e) { return e.id; })\n );\n\n\n function handleConnection(c) {\n if (topLevel[c.source.id] && topLevel[c.target.id]) {\n topLevel[c.id] = [ c ];\n }\n\n // not enclosed as a child, but maybe logically\n // (connecting two moved elements?)\n if (allShapes[c.source.id] && allShapes[c.target.id]) {\n enclosedConnections[c.id] = enclosedElements[c.id] = c;\n }\n\n allConnections[c.id] = c;\n }\n\n function handleElement(element) {\n\n enclosedElements[element.id] = element;\n\n if (element.waypoints) {\n\n // remember connection\n enclosedConnections[element.id] = allConnections[element.id] = element;\n } else {\n\n // remember shape\n allShapes[element.id] = element;\n\n // remember all connections\n forEach(element.incoming, handleConnection);\n\n forEach(element.outgoing, handleConnection);\n\n // recurse into children\n return element.children;\n }\n }\n\n eachElement(elements, handleElement);\n\n return {\n allShapes: allShapes,\n allConnections: allConnections,\n topLevel: topLevel,\n enclosedConnections: enclosedConnections,\n enclosedElements: enclosedElements\n };\n}\n\n/**\n * Returns the surrounding bbox for all elements in\n * the array or the element primitive.\n *\n * @param {Element|Element[]} elements\n * @param {boolean} [stopRecursion=false]\n *\n * @return {Rect}\n */\nexport function getBBox(elements, stopRecursion) {\n\n stopRecursion = !!stopRecursion;\n if (!isArray(elements)) {\n elements = [ elements ];\n }\n\n var minX,\n minY,\n maxX,\n maxY;\n\n forEach(elements, function(element) {\n\n // If element is a connection the bbox must be computed first\n var bbox = element;\n if (element.waypoints && !stopRecursion) {\n bbox = getBBox(element.waypoints, true);\n }\n\n var x = bbox.x,\n y = bbox.y,\n height = bbox.height || 0,\n width = bbox.width || 0;\n\n if (x < minX || minX === undefined) {\n minX = x;\n }\n if (y < minY || minY === undefined) {\n minY = y;\n }\n\n if ((x + width) > maxX || maxX === undefined) {\n maxX = x + width;\n }\n if ((y + height) > maxY || maxY === undefined) {\n maxY = y + height;\n }\n });\n\n return {\n x: minX,\n y: minY,\n height: maxY - minY,\n width: maxX - minX\n };\n}\n\n\n/**\n * Returns all elements that are enclosed from the bounding box.\n *\n * * If bbox.(width|height) is not specified the method returns\n * all elements with element.x/y > bbox.x/y\n * * If only bbox.x or bbox.y is specified, method return all elements with\n * e.x > bbox.x or e.y > bbox.y\n *\n * @param {Element[]} elements List of Elements to search through\n * @param {Rect} bbox the enclosing bbox.\n *\n * @return {Element[]} enclosed elements\n */\nexport function getEnclosedElements(elements, bbox) {\n\n var filteredElements = {};\n\n forEach(elements, function(element) {\n\n var e = element;\n\n if (e.waypoints) {\n e = getBBox(e);\n }\n\n if (!isNumber(bbox.y) && (e.x > bbox.x)) {\n filteredElements[element.id] = element;\n }\n if (!isNumber(bbox.x) && (e.y > bbox.y)) {\n filteredElements[element.id] = element;\n }\n if (e.x > bbox.x && e.y > bbox.y) {\n if (isNumber(bbox.width) && isNumber(bbox.height) &&\n e.width + e.x < bbox.width + bbox.x &&\n e.height + e.y < bbox.height + bbox.y) {\n\n filteredElements[element.id] = element;\n } else if (!isNumber(bbox.width) || !isNumber(bbox.height)) {\n filteredElements[element.id] = element;\n }\n }\n });\n\n return filteredElements;\n}\n\n/**\n * Get the element's type\n *\n * @param {Element} element\n *\n * @return {'connection' | 'shape' | 'root'}\n */\nexport function getType(element) {\n\n if ('waypoints' in element) {\n return 'connection';\n }\n\n if ('x' in element) {\n return 'shape';\n }\n\n return 'root';\n}\n\n/**\n * @param {Element} element\n *\n * @return {boolean}\n */\nexport function isFrameElement(element) {\n return !!(element && element.isFrame);\n}\n\n// helpers ///////////////////////////////\n\nfunction copyObject(src1, src2) {\n return assign({}, src1 || {}, src2 || {});\n}\n","import inherits from 'inherits-browser';\n\nimport BaseRenderer from './BaseRenderer';\n\nimport {\n componentsToPath,\n createLine\n} from '../util/RenderUtil';\n\nimport {\n append as svgAppend,\n attr as svgAttr,\n create as svgCreate\n} from 'tiny-svg';\n\nimport { assign } from 'min-dash';\n\nimport {\n isFrameElement\n} from '../util/Elements';\n\n/**\n * @typedef {import('../core/EventBus').default} EventBus\n * @typedef {import('./Styles').default} Styles\n */\n\n// apply default renderer with lowest possible priority\n// so that it only kicks in if noone else could render\nvar DEFAULT_RENDER_PRIORITY = 1;\n\n/**\n * The default renderer used for shapes and connections.\n *\n * @param {EventBus} eventBus\n * @param {Styles} styles\n */\nexport default function DefaultRenderer(eventBus, styles) {\n\n BaseRenderer.call(this, eventBus, DEFAULT_RENDER_PRIORITY);\n\n this.CONNECTION_STYLE = styles.style([ 'no-fill' ], { strokeWidth: 5, stroke: 'fuchsia' });\n this.SHAPE_STYLE = styles.style({ fill: 'white', stroke: 'fuchsia', strokeWidth: 2 });\n this.FRAME_STYLE = styles.style([ 'no-fill' ], { stroke: 'fuchsia', strokeDasharray: 4, strokeWidth: 2 });\n}\n\ninherits(DefaultRenderer, BaseRenderer);\n\n\n/**\n * @private\n */\nDefaultRenderer.prototype.canRender = function() {\n return true;\n};\n\n/**\n * @private\n */\nDefaultRenderer.prototype.drawShape = function drawShape(visuals, element, attrs) {\n var rect = svgCreate('rect');\n\n svgAttr(rect, {\n x: 0,\n y: 0,\n width: element.width || 0,\n height: element.height || 0\n });\n\n if (isFrameElement(element)) {\n svgAttr(rect, assign({}, this.FRAME_STYLE, attrs || {}));\n } else {\n svgAttr(rect, assign({}, this.SHAPE_STYLE, attrs || {}));\n }\n\n svgAppend(visuals, rect);\n\n return rect;\n};\n\n/**\n * @private\n */\nDefaultRenderer.prototype.drawConnection = function drawConnection(visuals, connection, attrs) {\n\n var line = createLine(connection.waypoints, assign({}, this.CONNECTION_STYLE, attrs || {}));\n svgAppend(visuals, line);\n\n return line;\n};\n\n/**\n * @private\n */\nDefaultRenderer.prototype.getShapePath = function getShapePath(shape) {\n\n var x = shape.x,\n y = shape.y,\n width = shape.width,\n height = shape.height;\n\n var shapePath = [\n [ 'M', x, y ],\n [ 'l', width, 0 ],\n [ 'l', 0, height ],\n [ 'l', -width, 0 ],\n [ 'z' ]\n ];\n\n return componentsToPath(shapePath);\n};\n\n/**\n * @private\n */\nDefaultRenderer.prototype.getConnectionPath = function getConnectionPath(connection) {\n var waypoints = connection.waypoints;\n\n var idx, point, connectionPath = [];\n\n for (idx = 0; (point = waypoints[idx]); idx++) {\n\n // take invisible docking into account\n // when creating the path\n point = point.original || point;\n\n connectionPath.push([ idx === 0 ? 'M' : 'L', point.x, point.y ]);\n }\n\n return componentsToPath(connectionPath);\n};\n\nDefaultRenderer.$inject = [ 'eventBus', 'styles' ];\n","import DefaultRenderer from './DefaultRenderer';\nimport Styles from './Styles';\n\n/**\n * @type { import('didi').ModuleDeclaration }\n */\nexport default {\n __init__: [ 'defaultRenderer' ],\n defaultRenderer: [ 'type', DefaultRenderer ],\n styles: [ 'type', Styles ]\n};\n","import {\n isArray,\n assign,\n reduce\n} from 'min-dash';\n\n\n/**\n * A component that manages shape styles\n */\nexport default function Styles() {\n\n var defaultTraits = {\n\n 'no-fill': {\n fill: 'none'\n },\n 'no-border': {\n strokeOpacity: 0.0\n },\n 'no-events': {\n pointerEvents: 'none'\n }\n };\n\n var self = this;\n\n /**\n * Builds a style definition from a className, a list of traits and an object\n * of additional attributes.\n *\n * @param {string} className\n * @param {string[]} [traits]\n * @param {Object} [additionalAttrs]\n *\n * @return {Object} the style definition\n */\n this.cls = function(className, traits, additionalAttrs) {\n var attrs = this.style(traits, additionalAttrs);\n\n return assign(attrs, { 'class': className });\n };\n\n /**\n * Builds a style definition from a list of traits and an object of additional\n * attributes.\n *\n * @param {string[]} [traits]\n * @param {Object} additionalAttrs\n *\n * @return {Object} the style definition\n */\n this.style = function(traits, additionalAttrs) {\n\n if (!isArray(traits) && !additionalAttrs) {\n additionalAttrs = traits;\n traits = [];\n }\n\n var attrs = reduce(traits, function(attrs, t) {\n return assign(attrs, defaultTraits[t] || {});\n }, {});\n\n return additionalAttrs ? assign(attrs, additionalAttrs) : attrs;\n };\n\n\n /**\n * Computes a style definition from a list of traits and an object of\n * additional attributes, with custom style definition object.\n *\n * @param {Object} custom\n * @param {string[]} [traits]\n * @param {Object} defaultStyles\n *\n * @return {Object} the style definition\n */\n this.computeStyle = function(custom, traits, defaultStyles) {\n if (!isArray(traits)) {\n defaultStyles = traits;\n traits = [];\n }\n\n return self.style(traits || [], assign({}, defaultStyles, custom || {}));\n };\n}\n","/**\n * Failsafe remove an element from a collection\n *\n * @param {Array} [collection]\n * @param {Object} [element]\n *\n * @return {number} the previous index of the element\n */\nexport function remove(collection, element) {\n\n if (!collection || !element) {\n return -1;\n }\n\n var idx = collection.indexOf(element);\n\n if (idx !== -1) {\n collection.splice(idx, 1);\n }\n\n return idx;\n}\n\n/**\n * Fail save add an element to the given connection, ensuring\n * it does not yet exist.\n *\n * @param {Array} collection\n * @param {Object} element\n * @param {number} [idx]\n */\nexport function add(collection, element, idx) {\n\n if (!collection || !element) {\n return;\n }\n\n if (typeof idx !== 'number') {\n idx = -1;\n }\n\n var currentIdx = collection.indexOf(element);\n\n if (currentIdx !== -1) {\n\n if (currentIdx === idx) {\n\n // nothing to do, position has not changed\n return;\n } else {\n\n if (idx !== -1) {\n\n // remove from current position\n collection.splice(currentIdx, 1);\n } else {\n\n // already exists in collection\n return;\n }\n }\n }\n\n if (idx !== -1) {\n\n // insert at specified position\n collection.splice(idx, 0, element);\n } else {\n\n // push to end\n collection.push(element);\n }\n}\n\n\n/**\n * Fail save get the index of an element in a collection.\n *\n * @param {Array} collection\n * @param {Object} element\n *\n * @return {number} the index or -1 if collection or element do\n * not exist or the element is not contained.\n */\nexport function indexOf(collection, element) {\n\n if (!collection || !element) {\n return -1;\n }\n\n return collection.indexOf(element);\n}\n","import {\n every\n} from 'min-dash';\n\n/**\n * @typedef {import('../util/Types').Axis} Axis\n * @typedef {import('../util/Types').Point} Point\n * @typedef {import('../util/Types').Rect} Rect\n */\n\n/**\n * Computes the distance between two points.\n *\n * @param {Point} a\n * @param {Point} b\n *\n * @return {number} The distance between the two points.\n */\nexport function pointDistance(a, b) {\n if (!a || !b) {\n return -1;\n }\n\n return Math.sqrt(\n Math.pow(a.x - b.x, 2) +\n Math.pow(a.y - b.y, 2)\n );\n}\n\n\n/**\n * Returns true if the point r is on the line between p and q.\n *\n * @param {Point} p\n * @param {Point} q\n * @param {Point} r\n * @param {number} [accuracy=5] The accuracy with which to check (lower is better).\n *\n * @return {boolean}\n */\nexport function pointsOnLine(p, q, r, accuracy) {\n\n if (typeof accuracy === 'undefined') {\n accuracy = 5;\n }\n\n if (!p || !q || !r) {\n return false;\n }\n\n var val = (q.x - p.x) * (r.y - p.y) - (q.y - p.y) * (r.x - p.x),\n dist = pointDistance(p, q);\n\n // @see http://stackoverflow.com/a/907491/412190\n return Math.abs(val / dist) <= accuracy;\n}\n\n\nvar ALIGNED_THRESHOLD = 2;\n\n/**\n * Check whether two points are horizontally or vertically aligned.\n *\n * @param {Point[]|Point} a\n * @param {Point} [b]\n *\n * @return {string|boolean} If and how the two points are aligned ('h', 'v' or `false`).\n */\nexport function pointsAligned(a, b) {\n var points = Array.from(arguments).flat();\n\n const axisMap = {\n 'x': 'v',\n 'y': 'h'\n };\n\n for (const [ axis, orientation ] of Object.entries(axisMap)) {\n if (pointsAlignedOnAxis(axis, points)) {\n return orientation;\n }\n }\n\n return false;\n}\n\n/**\n * @param {Axis} axis\n * @param {Point[]} points\n *\n * @return {boolean}\n */\nexport function pointsAlignedOnAxis(axis, points) {\n const referencePoint = points[0];\n\n return every(points, function(point) {\n return Math.abs(referencePoint[axis] - point[axis]) <= ALIGNED_THRESHOLD;\n });\n}\n\n/**\n * Returns true if the point p is inside the rectangle rect\n *\n * @param {Point} p\n * @param {Rect} rect\n * @param {number} tolerance\n *\n * @return {boolean}\n */\nexport function pointInRect(p, rect, tolerance) {\n tolerance = tolerance || 0;\n\n return p.x > rect.x - tolerance &&\n p.y > rect.y - tolerance &&\n p.x < rect.x + rect.width + tolerance &&\n p.y < rect.y + rect.height + tolerance;\n}\n\n/**\n * Returns a point in the middle of points p and q\n *\n * @param {Point} p\n * @param {Point} q\n *\n * @return {Point} The mid point between the two points.\n */\nexport function getMidPoint(p, q) {\n return {\n x: Math.round(p.x + ((q.x - p.x) / 2.0)),\n y: Math.round(p.y + ((q.y - p.y) / 2.0))\n };\n}\n","/**\n * This file contains source code adapted from Snap.svg (licensed Apache-2.0).\n *\n * @see https://github.com/adobe-webplatform/Snap.svg/blob/master/src/path.js\n */\n\n/* eslint no-fallthrough: \"off\" */\n\nvar p2s = /,?([a-z]),?/gi,\n toFloat = parseFloat,\n math = Math,\n PI = math.PI,\n mmin = math.min,\n mmax = math.max,\n pow = math.pow,\n abs = math.abs,\n pathCommand = /([a-z])[\\s,]*((-?\\d*\\.?\\d*(?:e[-+]?\\d+)?[\\s]*,?[\\s]*)+)/ig,\n pathValues = /(-?\\d*\\.?\\d*(?:e[-+]?\\d+)?)[\\s]*,?[\\s]*/ig;\n\nvar isArray = Array.isArray || function(o) { return o instanceof Array; };\n\nfunction hasProperty(obj, property) {\n return Object.prototype.hasOwnProperty.call(obj, property);\n}\n\nfunction clone(obj) {\n\n if (typeof obj == 'function' || Object(obj) !== obj) {\n return obj;\n }\n\n var res = new obj.constructor;\n\n for (var key in obj) {\n if (hasProperty(obj, key)) {\n res[key] = clone(obj[key]);\n }\n }\n\n return res;\n}\n\nfunction repush(array, item) {\n for (var i = 0, ii = array.length; i < ii; i++) if (array[i] === item) {\n return array.push(array.splice(i, 1)[0]);\n }\n}\n\nfunction cacher(f) {\n\n function newf() {\n\n var arg = Array.prototype.slice.call(arguments, 0),\n args = arg.join('\\u2400'),\n cache = newf.cache = newf.cache || {},\n count = newf.count = newf.count || [];\n\n if (hasProperty(cache, args)) {\n repush(count, args);\n return cache[args];\n }\n\n count.length >= 1e3 && delete cache[count.shift()];\n count.push(args);\n cache[args] = f(...arguments);\n\n return cache[args];\n }\n return newf;\n}\n\nfunction parsePathString(pathString) {\n\n if (!pathString) {\n return null;\n }\n\n var pth = paths(pathString);\n\n if (pth.arr) {\n return clone(pth.arr);\n }\n\n var paramCounts = { a: 7, c: 6, h: 1, l: 2, m: 2, q: 4, s: 4, t: 2, v: 1, z: 0 },\n data = [];\n\n if (isArray(pathString) && isArray(pathString[0])) { // rough assumption\n data = clone(pathString);\n }\n\n if (!data.length) {\n\n String(pathString).replace(pathCommand, function(a, b, c) {\n var params = [],\n name = b.toLowerCase();\n\n c.replace(pathValues, function(a, b) {\n b && params.push(+b);\n });\n\n if (name == 'm' && params.length > 2) {\n data.push([ b, ...params.splice(0, 2) ]);\n name = 'l';\n b = b == 'm' ? 'l' : 'L';\n }\n\n while (params.length >= paramCounts[name]) {\n data.push([ b, ...params.splice(0, paramCounts[name]) ]);\n if (!paramCounts[name]) {\n break;\n }\n }\n });\n }\n\n data.toString = paths.toString;\n pth.arr = clone(data);\n\n return data;\n}\n\nfunction paths(ps) {\n var p = paths.ps = paths.ps || {};\n\n if (p[ps]) {\n p[ps].sleep = 100;\n } else {\n p[ps] = {\n sleep: 100\n };\n }\n\n setTimeout(function() {\n for (var key in p) {\n if (hasProperty(p, key) && key != ps) {\n p[key].sleep--;\n !p[key].sleep && delete p[key];\n }\n }\n });\n\n return p[ps];\n}\n\nfunction rectBBox(x, y, width, height) {\n\n if (arguments.length === 1) {\n y = x.y;\n width = x.width;\n height = x.height;\n x = x.x;\n }\n\n return {\n x: x,\n y: y,\n width: width,\n height: height,\n x2: x + width,\n y2: y + height\n };\n}\n\nfunction pathToString() {\n return this.join(',').replace(p2s, '$1');\n}\n\nfunction pathClone(pathArray) {\n var res = clone(pathArray);\n res.toString = pathToString;\n return res;\n}\n\nfunction findDotsAtSegment(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, t) {\n var t1 = 1 - t,\n t13 = pow(t1, 3),\n t12 = pow(t1, 2),\n t2 = t * t,\n t3 = t2 * t,\n x = t13 * p1x + t12 * 3 * t * c1x + t1 * 3 * t * t * c2x + t3 * p2x,\n y = t13 * p1y + t12 * 3 * t * c1y + t1 * 3 * t * t * c2y + t3 * p2y;\n\n return {\n x: fixError(x),\n y: fixError(y)\n };\n}\n\nfunction bezierBBox(points) {\n\n var bbox = curveBBox(...points);\n\n return rectBBox(\n bbox.x0,\n bbox.y0,\n bbox.x1 - bbox.x0,\n bbox.y1 - bbox.y0\n );\n}\n\nfunction isPointInsideBBox(bbox, x, y) {\n return x >= bbox.x &&\n x <= bbox.x + bbox.width &&\n y >= bbox.y &&\n y <= bbox.y + bbox.height;\n}\n\nfunction isBBoxIntersect(bbox1, bbox2) {\n bbox1 = rectBBox(bbox1);\n bbox2 = rectBBox(bbox2);\n return isPointInsideBBox(bbox2, bbox1.x, bbox1.y)\n || isPointInsideBBox(bbox2, bbox1.x2, bbox1.y)\n || isPointInsideBBox(bbox2, bbox1.x, bbox1.y2)\n || isPointInsideBBox(bbox2, bbox1.x2, bbox1.y2)\n || isPointInsideBBox(bbox1, bbox2.x, bbox2.y)\n || isPointInsideBBox(bbox1, bbox2.x2, bbox2.y)\n || isPointInsideBBox(bbox1, bbox2.x, bbox2.y2)\n || isPointInsideBBox(bbox1, bbox2.x2, bbox2.y2)\n || (bbox1.x < bbox2.x2 && bbox1.x > bbox2.x\n || bbox2.x < bbox1.x2 && bbox2.x > bbox1.x)\n && (bbox1.y < bbox2.y2 && bbox1.y > bbox2.y\n || bbox2.y < bbox1.y2 && bbox2.y > bbox1.y);\n}\n\nfunction base3(t, p1, p2, p3, p4) {\n var t1 = -3 * p1 + 9 * p2 - 9 * p3 + 3 * p4,\n t2 = t * t1 + 6 * p1 - 12 * p2 + 6 * p3;\n return t * t2 - 3 * p1 + 3 * p2;\n}\n\nfunction bezlen(x1, y1, x2, y2, x3, y3, x4, y4, z) {\n\n if (z == null) {\n z = 1;\n }\n\n z = z > 1 ? 1 : z < 0 ? 0 : z;\n\n var z2 = z / 2,\n n = 12,\n Tvalues = [ -.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816 ],\n Cvalues = [ 0.2491,0.2491,0.2335,0.2335,0.2032,0.2032,0.1601,0.1601,0.1069,0.1069,0.0472,0.0472 ],\n sum = 0;\n\n for (var i = 0; i < n; i++) {\n var ct = z2 * Tvalues[i] + z2,\n xbase = base3(ct, x1, x2, x3, x4),\n ybase = base3(ct, y1, y2, y3, y4),\n comb = xbase * xbase + ybase * ybase;\n\n sum += Cvalues[i] * math.sqrt(comb);\n }\n\n return z2 * sum;\n}\n\n\nfunction intersectLines(x1, y1, x2, y2, x3, y3, x4, y4) {\n\n if (\n mmax(x1, x2) < mmin(x3, x4) ||\n mmin(x1, x2) > mmax(x3, x4) ||\n mmax(y1, y2) < mmin(y3, y4) ||\n mmin(y1, y2) > mmax(y3, y4)\n ) {\n return;\n }\n\n var nx = (x1 * y2 - y1 * x2) * (x3 - x4) - (x1 - x2) * (x3 * y4 - y3 * x4),\n ny = (x1 * y2 - y1 * x2) * (y3 - y4) - (y1 - y2) * (x3 * y4 - y3 * x4),\n denominator = (x1 - x2) * (y3 - y4) - (y1 - y2) * (x3 - x4);\n\n if (!denominator) {\n return;\n }\n\n var px = fixError(nx / denominator),\n py = fixError(ny / denominator),\n px2 = +px.toFixed(2),\n py2 = +py.toFixed(2);\n\n if (\n px2 < +mmin(x1, x2).toFixed(2) ||\n px2 > +mmax(x1, x2).toFixed(2) ||\n px2 < +mmin(x3, x4).toFixed(2) ||\n px2 > +mmax(x3, x4).toFixed(2) ||\n py2 < +mmin(y1, y2).toFixed(2) ||\n py2 > +mmax(y1, y2).toFixed(2) ||\n py2 < +mmin(y3, y4).toFixed(2) ||\n py2 > +mmax(y3, y4).toFixed(2)\n ) {\n return;\n }\n\n return { x: px, y: py };\n}\n\nfunction fixError(number) {\n return Math.round(number * 100000000000) / 100000000000;\n}\n\nfunction findBezierIntersections(bez1, bez2, justCount) {\n var bbox1 = bezierBBox(bez1),\n bbox2 = bezierBBox(bez2);\n\n if (!isBBoxIntersect(bbox1, bbox2)) {\n return justCount ? 0 : [];\n }\n\n // As an optimization, lines will have only 1 segment\n\n var l1 = bezlen(...bez1),\n l2 = bezlen(...bez2),\n n1 = isLine(bez1) ? 1 : ~~(l1 / 5) || 1,\n n2 = isLine(bez2) ? 1 : ~~(l2 / 5) || 1,\n dots1 = [],\n dots2 = [],\n xy = {},\n res = justCount ? 0 : [];\n\n for (var i = 0; i < n1 + 1; i++) {\n var p = findDotsAtSegment(...bez1, i / n1);\n dots1.push({ x: p.x, y: p.y, t: i / n1 });\n }\n\n for (i = 0; i < n2 + 1; i++) {\n p = findDotsAtSegment(...bez2, i / n2);\n dots2.push({ x: p.x, y: p.y, t: i / n2 });\n }\n\n for (i = 0; i < n1; i++) {\n\n for (var j = 0; j < n2; j++) {\n var di = dots1[i],\n di1 = dots1[i + 1],\n dj = dots2[j],\n dj1 = dots2[j + 1],\n ci = abs(di1.x - di.x) < .01 ? 'y' : 'x',\n cj = abs(dj1.x - dj.x) < .01 ? 'y' : 'x',\n is = intersectLines(di.x, di.y, di1.x, di1.y, dj.x, dj.y, dj1.x, dj1.y),\n key;\n\n if (is) {\n key = is.x.toFixed(9) + '#' + is.y.toFixed(9);\n\n if (xy[key]) {\n continue;\n }\n\n xy[key] = true;\n\n var t1 = di.t + abs((is[ci] - di[ci]) / (di1[ci] - di[ci])) * (di1.t - di.t),\n t2 = dj.t + abs((is[cj] - dj[cj]) / (dj1[cj] - dj[cj])) * (dj1.t - dj.t);\n\n if (t1 >= 0 && t1 <= 1 && t2 >= 0 && t2 <= 1) {\n\n if (justCount) {\n res++;\n } else {\n res.push({\n x: is.x,\n y: is.y,\n t1: t1,\n t2: t2\n });\n }\n }\n }\n }\n }\n\n return res;\n}\n\n\n/**\n * Find or counts the intersections between two SVG paths.\n *\n * Returns a number in counting mode and a list of intersections otherwise.\n *\n * A single intersection entry contains the intersection coordinates (x, y)\n * as well as additional information regarding the intersecting segments\n * on each path (segment1, segment2) and the relative location of the\n * intersection on these segments (t1, t2).\n *\n * The path may be an SVG path string or a list of path components\n * such as `[ [ 'M', 0, 10 ], [ 'L', 20, 0 ] ]`.\n *\n * @example\n *\n * var intersections = findPathIntersections(\n * 'M0,0L100,100',\n * [ [ 'M', 0, 100 ], [ 'L', 100, 0 ] ]\n * );\n *\n * // intersections = [\n * // { x: 50, y: 50, segment1: 1, segment2: 1, t1: 0.5, t2: 0.5 }\n * // ]\n *\n * @param {String|Array} path1\n * @param {String|Array} path2\n * @param {Boolean} [justCount=false]\n *\n * @return {Array|Number}\n */\nexport default function findPathIntersections(path1, path2, justCount) {\n path1 = pathToCurve(path1);\n path2 = pathToCurve(path2);\n\n var x1, y1, x2, y2, x1m, y1m, x2m, y2m, bez1, bez2,\n res = justCount ? 0 : [];\n\n for (var i = 0, ii = path1.length; i < ii; i++) {\n var pi = path1[i];\n\n if (pi[0] == 'M') {\n x1 = x1m = pi[1];\n y1 = y1m = pi[2];\n } else {\n\n if (pi[0] == 'C') {\n bez1 = [ x1, y1, ...pi.slice(1) ];\n x1 = bez1[6];\n y1 = bez1[7];\n } else {\n bez1 = [ x1, y1, x1, y1, x1m, y1m, x1m, y1m ];\n x1 = x1m;\n y1 = y1m;\n }\n\n for (var j = 0, jj = path2.length; j < jj; j++) {\n var pj = path2[j];\n\n if (pj[0] == 'M') {\n x2 = x2m = pj[1];\n y2 = y2m = pj[2];\n } else {\n\n if (pj[0] == 'C') {\n bez2 = [ x2, y2, ...pj.slice(1) ];\n x2 = bez2[6];\n y2 = bez2[7];\n } else {\n bez2 = [ x2, y2, x2, y2, x2m, y2m, x2m, y2m ];\n x2 = x2m;\n y2 = y2m;\n }\n\n var intr = findBezierIntersections(bez1, bez2, justCount);\n\n if (justCount) {\n res += intr;\n } else {\n\n for (var k = 0, kk = intr.length; k < kk; k++) {\n intr[k].segment1 = i;\n intr[k].segment2 = j;\n intr[k].bez1 = bez1;\n intr[k].bez2 = bez2;\n }\n\n res = res.concat(intr);\n }\n }\n }\n }\n }\n\n return res;\n}\n\n\nfunction pathToAbsolute(pathArray) {\n var pth = paths(pathArray);\n\n if (pth.abs) {\n return pathClone(pth.abs);\n }\n\n if (!isArray(pathArray) || !isArray(pathArray && pathArray[0])) { // rough assumption\n pathArray = parsePathString(pathArray);\n }\n\n if (!pathArray || !pathArray.length) {\n return [ [ 'M', 0, 0 ] ];\n }\n\n var res = [],\n x = 0,\n y = 0,\n mx = 0,\n my = 0,\n start = 0,\n pa0;\n\n if (pathArray[0][0] == 'M') {\n x = +pathArray[0][1];\n y = +pathArray[0][2];\n mx = x;\n my = y;\n start++;\n res[0] = [ 'M', x, y ];\n }\n\n for (var r, pa, i = start, ii = pathArray.length; i < ii; i++) {\n res.push(r = []);\n pa = pathArray[i];\n pa0 = pa[0];\n\n if (pa0 != pa0.toUpperCase()) {\n r[0] = pa0.toUpperCase();\n\n switch (r[0]) {\n case 'A':\n r[1] = pa[1];\n r[2] = pa[2];\n r[3] = pa[3];\n r[4] = pa[4];\n r[5] = pa[5];\n r[6] = +pa[6] + x;\n r[7] = +pa[7] + y;\n break;\n case 'V':\n r[1] = +pa[1] + y;\n break;\n case 'H':\n r[1] = +pa[1] + x;\n break;\n case 'M':\n mx = +pa[1] + x;\n my = +pa[2] + y;\n default:\n for (var j = 1, jj = pa.length; j < jj; j++) {\n r[j] = +pa[j] + ((j % 2) ? x : y);\n }\n }\n } else {\n for (var k = 0, kk = pa.length; k < kk; k++) {\n r[k] = pa[k];\n }\n }\n pa0 = pa0.toUpperCase();\n\n switch (r[0]) {\n case 'Z':\n x = +mx;\n y = +my;\n break;\n case 'H':\n x = r[1];\n break;\n case 'V':\n y = r[1];\n break;\n case 'M':\n mx = r[r.length - 2];\n my = r[r.length - 1];\n default:\n x = r[r.length - 2];\n y = r[r.length - 1];\n }\n }\n\n res.toString = pathToString;\n pth.abs = pathClone(res);\n\n return res;\n}\n\nfunction isLine(bez) {\n return (\n bez[0] === bez[2] &&\n bez[1] === bez[3] &&\n bez[4] === bez[6] &&\n bez[5] === bez[7]\n );\n}\n\nfunction lineToCurve(x1, y1, x2, y2) {\n return [\n x1, y1, x2,\n y2, x2, y2\n ];\n}\n\nfunction qubicToCurve(x1, y1, ax, ay, x2, y2) {\n var _13 = 1 / 3,\n _23 = 2 / 3;\n\n return [\n _13 * x1 + _23 * ax,\n _13 * y1 + _23 * ay,\n _13 * x2 + _23 * ax,\n _13 * y2 + _23 * ay,\n x2,\n y2\n ];\n}\n\nfunction arcToCurve(x1, y1, rx, ry, angle, large_arc_flag, sweep_flag, x2, y2, recursive) {\n\n // for more information of where this math came from visit:\n // http://www.w3.org/TR/SVG11/implnote.html#ArcImplementationNotes\n var _120 = PI * 120 / 180,\n rad = PI / 180 * (+angle || 0),\n res = [],\n xy,\n rotate = cacher(function(x, y, rad) {\n var X = x * math.cos(rad) - y * math.sin(rad),\n Y = x * math.sin(rad) + y * math.cos(rad);\n\n return { x: X, y: Y };\n });\n\n if (!recursive) {\n xy = rotate(x1, y1, -rad);\n x1 = xy.x;\n y1 = xy.y;\n xy = rotate(x2, y2, -rad);\n x2 = xy.x;\n y2 = xy.y;\n\n var x = (x1 - x2) / 2,\n y = (y1 - y2) / 2;\n\n var h = (x * x) / (rx * rx) + (y * y) / (ry * ry);\n\n if (h > 1) {\n h = math.sqrt(h);\n rx = h * rx;\n ry = h * ry;\n }\n\n var rx2 = rx * rx,\n ry2 = ry * ry,\n k = (large_arc_flag == sweep_flag ? -1 : 1) *\n math.sqrt(abs((rx2 * ry2 - rx2 * y * y - ry2 * x * x) / (rx2 * y * y + ry2 * x * x))),\n cx = k * rx * y / ry + (x1 + x2) / 2,\n cy = k * -ry * x / rx + (y1 + y2) / 2,\n f1 = math.asin(((y1 - cy) / ry).toFixed(9)),\n f2 = math.asin(((y2 - cy) / ry).toFixed(9));\n\n f1 = x1 < cx ? PI - f1 : f1;\n f2 = x2 < cx ? PI - f2 : f2;\n f1 < 0 && (f1 = PI * 2 + f1);\n f2 < 0 && (f2 = PI * 2 + f2);\n\n if (sweep_flag && f1 > f2) {\n f1 = f1 - PI * 2;\n }\n if (!sweep_flag && f2 > f1) {\n f2 = f2 - PI * 2;\n }\n } else {\n f1 = recursive[0];\n f2 = recursive[1];\n cx = recursive[2];\n cy = recursive[3];\n }\n\n var df = f2 - f1;\n\n if (abs(df) > _120) {\n var f2old = f2,\n x2old = x2,\n y2old = y2;\n\n f2 = f1 + _120 * (sweep_flag && f2 > f1 ? 1 : -1);\n x2 = cx + rx * math.cos(f2);\n y2 = cy + ry * math.sin(f2);\n res = arcToCurve(x2, y2, rx, ry, angle, 0, sweep_flag, x2old, y2old, [ f2, f2old, cx, cy ]);\n }\n\n df = f2 - f1;\n\n var c1 = math.cos(f1),\n s1 = math.sin(f1),\n c2 = math.cos(f2),\n s2 = math.sin(f2),\n t = math.tan(df / 4),\n hx = 4 / 3 * rx * t,\n hy = 4 / 3 * ry * t,\n m1 = [ x1, y1 ],\n m2 = [ x1 + hx * s1, y1 - hy * c1 ],\n m3 = [ x2 + hx * s2, y2 - hy * c2 ],\n m4 = [ x2, y2 ];\n\n m2[0] = 2 * m1[0] - m2[0];\n m2[1] = 2 * m1[1] - m2[1];\n\n if (recursive) {\n return [ m2, m3, m4 ].concat(res);\n } else {\n res = [ m2, m3, m4 ].concat(res).join().split(',');\n var newres = [];\n\n for (var i = 0, ii = res.length; i < ii; i++) {\n newres[i] = i % 2 ? rotate(res[i - 1], res[i], rad).y : rotate(res[i], res[i + 1], rad).x;\n }\n\n return newres;\n }\n}\n\n// Returns bounding box of cubic bezier curve.\n// Source: http://blog.hackers-cafe.net/2009/06/how-to-calculate-bezier-curves-bounding.html\n// Original version: NISHIO Hirokazu\n// Modifications: https://github.com/timo22345\nfunction curveBBox(x0, y0, x1, y1, x2, y2, x3, y3) {\n var tvalues = [],\n bounds = [ [], [] ],\n a, b, c, t, t1, t2, b2ac, sqrtb2ac;\n\n for (var i = 0; i < 2; ++i) {\n\n if (i == 0) {\n b = 6 * x0 - 12 * x1 + 6 * x2;\n a = -3 * x0 + 9 * x1 - 9 * x2 + 3 * x3;\n c = 3 * x1 - 3 * x0;\n } else {\n b = 6 * y0 - 12 * y1 + 6 * y2;\n a = -3 * y0 + 9 * y1 - 9 * y2 + 3 * y3;\n c = 3 * y1 - 3 * y0;\n }\n\n if (abs(a) < 1e-12) {\n\n if (abs(b) < 1e-12) {\n continue;\n }\n\n t = -c / b;\n\n if (0 < t && t < 1) {\n tvalues.push(t);\n }\n\n continue;\n }\n\n b2ac = b * b - 4 * c * a;\n sqrtb2ac = math.sqrt(b2ac);\n\n if (b2ac < 0) {\n continue;\n }\n\n t1 = (-b + sqrtb2ac) / (2 * a);\n\n if (0 < t1 && t1 < 1) {\n tvalues.push(t1);\n }\n\n t2 = (-b - sqrtb2ac) / (2 * a);\n\n if (0 < t2 && t2 < 1) {\n tvalues.push(t2);\n }\n }\n\n var j = tvalues.length,\n jlen = j,\n mt;\n\n while (j--) {\n t = tvalues[j];\n mt = 1 - t;\n bounds[0][j] = (mt * mt * mt * x0) + (3 * mt * mt * t * x1) + (3 * mt * t * t * x2) + (t * t * t * x3);\n bounds[1][j] = (mt * mt * mt * y0) + (3 * mt * mt * t * y1) + (3 * mt * t * t * y2) + (t * t * t * y3);\n }\n\n bounds[0][jlen] = x0;\n bounds[1][jlen] = y0;\n bounds[0][jlen + 1] = x3;\n bounds[1][jlen + 1] = y3;\n bounds[0].length = bounds[1].length = jlen + 2;\n\n return {\n x0: mmin(...bounds[0]),\n y0: mmin(...bounds[1]),\n x1: mmax(...bounds[0]),\n y1: mmax(...bounds[1])\n };\n}\n\nfunction pathToCurve(path) {\n\n var pth = paths(path);\n\n // return cached curve, if existing\n if (pth.curve) {\n return pathClone(pth.curve);\n }\n\n var curvedPath = pathToAbsolute(path),\n attrs = { x: 0, y: 0, bx: 0, by: 0, X: 0, Y: 0, qx: null, qy: null },\n processPath = function(path, d, pathCommand) {\n var nx, ny;\n\n if (!path) {\n return [ 'C', d.x, d.y, d.x, d.y, d.x, d.y ];\n }\n\n !(path[0] in { T: 1, Q: 1 }) && (d.qx = d.qy = null);\n\n switch (path[0]) {\n case 'M':\n d.X = path[1];\n d.Y = path[2];\n break;\n case 'A':\n path = [ 'C', ...arcToCurve(d.x, d.y, ...path.slice(1)) ];\n break;\n case 'S':\n if (pathCommand == 'C' || pathCommand == 'S') {\n\n // In 'S' case we have to take into account, if the previous command is C/S.\n nx = d.x * 2 - d.bx;\n\n // And reflect the previous\n ny = d.y * 2 - d.by;\n\n // command's control point relative to the current point.\n }\n else {\n\n // or some else or nothing\n nx = d.x;\n ny = d.y;\n }\n path = [ 'C', nx, ny, ...path.slice(1) ];\n break;\n case 'T':\n if (pathCommand == 'Q' || pathCommand == 'T') {\n\n // In 'T' case we have to take into account, if the previous command is Q/T.\n d.qx = d.x * 2 - d.qx;\n\n // And make a reflection similar\n d.qy = d.y * 2 - d.qy;\n\n // to case 'S'.\n }\n else {\n\n // or something else or nothing\n d.qx = d.x;\n d.qy = d.y;\n }\n path = [ 'C', ...qubicToCurve(d.x, d.y, d.qx, d.qy, path[1], path[2]) ];\n break;\n case 'Q':\n d.qx = path[1];\n d.qy = path[2];\n path = [ 'C', ...qubicToCurve(d.x, d.y, path[1], path[2], path[3], path[4]) ];\n break;\n case 'L':\n path = [ 'C', ...lineToCurve(d.x, d.y, path[1], path[2]) ];\n break;\n case 'H':\n path = [ 'C', ...lineToCurve(d.x, d.y, path[1], d.y) ];\n break;\n case 'V':\n path = [ 'C', ...lineToCurve(d.x, d.y, d.x, path[1]) ];\n break;\n case 'Z':\n path = [ 'C', ...lineToCurve(d.x, d.y, d.X, d.Y) ];\n break;\n }\n\n return path;\n },\n\n fixArc = function(pp, i) {\n\n if (pp[i].length > 7) {\n pp[i].shift();\n var pi = pp[i];\n\n while (pi.length) {\n pathCommands[i] = 'A'; // if created multiple C:s, their original seg is saved\n pp.splice(i++, 0, [ 'C', ...pi.splice(0, 6) ]);\n }\n\n pp.splice(i, 1);\n ii = curvedPath.length;\n }\n },\n\n pathCommands = [], // path commands of original path p\n pfirst = '', // temporary holder for original path command\n pathCommand = ''; // holder for previous path command of original path\n\n for (var i = 0, ii = curvedPath.length; i < ii; i++) {\n curvedPath[i] && (pfirst = curvedPath[i][0]); // save current path command\n\n if (pfirst != 'C') // C is not saved yet, because it may be result of conversion\n {\n pathCommands[i] = pfirst; // Save current path command\n i && (pathCommand = pathCommands[i - 1]); // Get previous path command pathCommand\n }\n curvedPath[i] = processPath(curvedPath[i], attrs, pathCommand); // Previous path command is inputted to processPath\n\n if (pathCommands[i] != 'A' && pfirst == 'C') pathCommands[i] = 'C'; // A is the only command\n // which may produce multiple C:s\n // so we have to make sure that C is also C in original path\n\n fixArc(curvedPath, i); // fixArc adds also the right amount of A:s to pathCommands\n\n var seg = curvedPath[i],\n seglen = seg.length;\n\n attrs.x = seg[seglen - 2];\n attrs.y = seg[seglen - 1];\n attrs.bx = toFloat(seg[seglen - 4]) || attrs.x;\n attrs.by = toFloat(seg[seglen - 3]) || attrs.y;\n }\n\n // cache curve\n pth.curve = pathClone(curvedPath);\n\n return curvedPath;\n}","import {\n has,\n isNil,\n isObject\n} from 'min-dash';\n\n/**\n * Checks whether a value is an instance of Connection.\n *\n * @param {any} value\n *\n * @return {boolean}\n */\nexport function isConnection(value) {\n return isObject(value) && has(value, 'waypoints');\n}\n\n/**\n * Checks whether a value is an instance of Label.\n *\n * @param {any} value\n *\n * @return {boolean}\n */\nexport function isLabel(value) {\n return isObject(value) && has(value, 'labelTarget');\n}\n\n/**\n * Checks whether a value is an instance of Root.\n *\n * @param {any} value\n *\n * @return {boolean}\n */\nexport function isRoot(value) {\n return isObject(value) && isNil(value.parent);\n}","import {\n isObject,\n sortBy\n} from 'min-dash';\n\nimport {\n pointDistance,\n pointsOnLine\n} from '../util/Geometry';\n\nimport intersectPaths from 'path-intersection';\n\nimport { isConnection } from '../util/ModelUtil';\n\n/**\n * @typedef {import('../core/Types').ElementLike} Element\n * @typedef {import('../core/Types').ConnectionLike} Connection\n *\n * @typedef {import('../util/Types').DirectionTRBL} DirectionTRBL\n * @typedef {import('../util/Types').Point} Point\n * @typedef {import('../util/Types').Rect} Rect\n * @typedef {import('../util/Types').RectTRBL} RectTRBL\n */\n\n/**\n * @param {Rect} bounds\n *\n * @returns {Rect}\n */\nexport function roundBounds(bounds) {\n return {\n x: Math.round(bounds.x),\n y: Math.round(bounds.y),\n width: Math.round(bounds.width),\n height: Math.round(bounds.height)\n };\n}\n\n/**\n * @param {Point} point\n *\n * @returns {Point}\n */\nexport function roundPoint(point) {\n\n return {\n x: Math.round(point.x),\n y: Math.round(point.y)\n };\n}\n\n\n/**\n * Convert the given bounds to a { top, left, bottom, right } descriptor.\n *\n * @param {Point|Rect} bounds\n *\n * @return {RectTRBL}\n */\nexport function asTRBL(bounds) {\n return {\n top: bounds.y,\n right: bounds.x + (bounds.width || 0),\n bottom: bounds.y + (bounds.height || 0),\n left: bounds.x\n };\n}\n\n\n/**\n * Convert a { top, left, bottom, right } to an objects bounds.\n *\n * @param {RectTRBL} trbl\n *\n * @return {Rect}\n */\nexport function asBounds(trbl) {\n return {\n x: trbl.left,\n y: trbl.top,\n width: trbl.right - trbl.left,\n height: trbl.bottom - trbl.top\n };\n}\n\n\n/**\n * Get the mid of the given bounds or point.\n *\n * @param {Point|Rect} bounds\n *\n * @return {Point}\n */\nexport function getBoundsMid(bounds) {\n return roundPoint({\n x: bounds.x + (bounds.width || 0) / 2,\n y: bounds.y + (bounds.height || 0) / 2\n });\n}\n\n\n/**\n * Get the mid of the given Connection.\n *\n * @param {Connection} connection\n *\n * @return {Point}\n */\nexport function getConnectionMid(connection) {\n var waypoints = connection.waypoints;\n\n // calculate total length and length of each segment\n var parts = waypoints.reduce(function(parts, point, index) {\n\n var lastPoint = waypoints[index - 1];\n\n if (lastPoint) {\n var lastPart = parts[parts.length - 1];\n\n var startLength = lastPart && lastPart.endLength || 0;\n var length = distance(lastPoint, point);\n\n parts.push({\n start: lastPoint,\n end: point,\n startLength: startLength,\n endLength: startLength + length,\n length: length\n });\n }\n\n return parts;\n }, []);\n\n var totalLength = parts.reduce(function(length, part) {\n return length + part.length;\n }, 0);\n\n // find which segement contains middle point\n var midLength = totalLength / 2;\n\n var i = 0;\n var midSegment = parts[i];\n\n while (midSegment.endLength < midLength) {\n midSegment = parts[++i];\n }\n\n // calculate relative position on mid segment\n var segmentProgress = (midLength - midSegment.startLength) / midSegment.length;\n\n var midPoint = {\n x: midSegment.start.x + (midSegment.end.x - midSegment.start.x) * segmentProgress,\n y: midSegment.start.y + (midSegment.end.y - midSegment.start.y) * segmentProgress\n };\n\n return midPoint;\n}\n\n\n/**\n * Get the mid of the given Element.\n *\n * @param {Element} element\n *\n * @return {Point}\n */\nexport function getMid(element) {\n if (isConnection(element)) {\n return getConnectionMid(element);\n }\n\n return getBoundsMid(element);\n}\n\n// orientation utils //////////////////////\n\n/**\n * Get orientation of the given rectangle with respect to\n * the reference rectangle.\n *\n * A padding (positive or negative) may be passed to influence\n * horizontal / vertical orientation and intersection.\n *\n * @param {Rect} rect\n * @param {Rect} reference\n * @param {Point|number} padding\n *\n * @return {DirectionTRBL} the orientation; one of top, top-left, left, ..., bottom, right or intersect.\n */\nexport function getOrientation(rect, reference, padding) {\n\n padding = padding || 0;\n\n // make sure we can use an object, too\n // for individual { x, y } padding\n if (!isObject(padding)) {\n padding = { x: padding, y: padding };\n }\n\n\n var rectOrientation = asTRBL(rect),\n referenceOrientation = asTRBL(reference);\n\n var top = rectOrientation.bottom + padding.y <= referenceOrientation.top,\n right = rectOrientation.left - padding.x >= referenceOrientation.right,\n bottom = rectOrientation.top - padding.y >= referenceOrientation.bottom,\n left = rectOrientation.right + padding.x <= referenceOrientation.left;\n\n var vertical = top ? 'top' : (bottom ? 'bottom' : null),\n horizontal = left ? 'left' : (right ? 'right' : null);\n\n if (horizontal && vertical) {\n return vertical + '-' + horizontal;\n } else {\n return horizontal || vertical || 'intersect';\n }\n}\n\n\n// intersection utils //////////////////////\n\n/**\n * Get intersection between an element and a line path.\n *\n * @param {string} elementPath\n * @param {string} linePath\n * @param {boolean} cropStart Whether to crop start or end.\n *\n * @return {Point}\n */\nexport function getElementLineIntersection(elementPath, linePath, cropStart) {\n\n var intersections = getIntersections(elementPath, linePath);\n\n // recognize intersections\n // only one -> choose\n // two close together -> choose first\n // two or more distinct -> pull out appropriate one\n // none -> ok (fallback to point itself)\n if (intersections.length === 1) {\n return roundPoint(intersections[0]);\n } else if (intersections.length === 2 && pointDistance(intersections[0], intersections[1]) < 1) {\n return roundPoint(intersections[0]);\n } else if (intersections.length > 1) {\n\n // sort by intersections based on connection segment +\n // distance from start\n intersections = sortBy(intersections, function(i) {\n var distance = Math.floor(i.t2 * 100) || 1;\n\n distance = 100 - distance;\n\n distance = (distance < 10 ? '0' : '') + distance;\n\n // create a sort string that makes sure we sort\n // line segment ASC + line segment position DESC (for cropStart)\n // line segment ASC + line segment position ASC (for cropEnd)\n return i.segment2 + '#' + distance;\n });\n\n return roundPoint(intersections[cropStart ? 0 : intersections.length - 1]);\n }\n\n return null;\n}\n\n\nexport function getIntersections(a, b) {\n return intersectPaths(a, b);\n}\n\n\nexport function filterRedundantWaypoints(waypoints) {\n\n // alter copy of waypoints, not original\n waypoints = waypoints.slice();\n\n var idx = 0,\n point,\n previousPoint,\n nextPoint;\n\n while (waypoints[idx]) {\n point = waypoints[idx];\n previousPoint = waypoints[idx - 1];\n nextPoint = waypoints[idx + 1];\n\n if (pointDistance(point, nextPoint) === 0 ||\n pointsOnLine(previousPoint, nextPoint, point)) {\n\n // remove point, if overlapping with {nextPoint}\n // or on line with {previousPoint} -> {point} -> {nextPoint}\n waypoints.splice(idx, 1);\n } else {\n idx++;\n }\n }\n\n return waypoints;\n}\n\n// helpers //////////////////////\n\nfunction distance(a, b) {\n return Math.sqrt(Math.pow(a.x - b.x, 2) + Math.pow(a.y - b.y, 2));\n}","import {\n isNumber,\n assign,\n forEach,\n every,\n debounce,\n bind,\n reduce,\n find\n} from 'min-dash';\n\nimport {\n assignStyle\n} from 'min-dom';\n\nimport {\n add as collectionAdd,\n remove as collectionRemove\n} from '../util/Collections';\n\nimport {\n getType,\n getBBox as getBoundingBox\n} from '../util/Elements';\n\nimport { asTRBL } from '../layout/LayoutUtil';\n\nimport {\n append as svgAppend,\n attr as svgAttr,\n classes as svgClasses,\n create as svgCreate,\n transform as svgTransform,\n remove as svgRemove\n} from 'tiny-svg';\n\nimport { createMatrix as createMatrix } from 'tiny-svg';\n\n\n/**\n * @typedef {import('./Types').ConnectionLike} ConnectionLike\n * @typedef {import('./Types').RootLike} RootLike\n * @typedef {import('./Types').ParentLike } ParentLike\n * @typedef {import('./Types').ShapeLike} ShapeLike\n *\n * @typedef { {\n * container?: HTMLElement;\n * deferUpdate?: boolean;\n * width?: number;\n * height?: number;\n * } } CanvasConfig\n * @typedef { {\n * group: SVGElement;\n * index: number;\n * visible: boolean;\n * } } CanvasLayer\n * @typedef { {\n * [key: string]: CanvasLayer;\n * } } CanvasLayers\n * @typedef { {\n * rootElement: ShapeLike;\n * layer: CanvasLayer;\n * } } CanvasPlane\n * @typedef { {\n * scale: number;\n * inner: Rect;\n * outer: Dimensions;\n * } & Rect } CanvasViewbox\n *\n * @typedef {import('./ElementRegistry').default} ElementRegistry\n * @typedef {import('./EventBus').default} EventBus\n * @typedef {import('./GraphicsFactory').default} GraphicsFactory\n *\n * @typedef {import('../util/Types').Dimensions} Dimensions\n * @typedef {import('../util/Types').Point} Point\n * @typedef {import('../util/Types').Rect} Rect\n * @typedef {import('../util/Types').RectTRBL} RectTRBL\n */\n\nfunction round(number, resolution) {\n return Math.round(number * resolution) / resolution;\n}\n\nfunction ensurePx(number) {\n return isNumber(number) ? number + 'px' : number;\n}\n\nfunction findRoot(element) {\n while (element.parent) {\n element = element.parent;\n }\n\n return element;\n}\n\n/**\n * Creates a HTML container element for a SVG element with\n * the given configuration\n *\n * @param {CanvasConfig} options\n *\n * @return {HTMLElement} the container element\n */\nfunction createContainer(options) {\n\n options = assign({}, { width: '100%', height: '100%' }, options);\n\n const container = options.container || document.body;\n\n // create a around the svg element with the respective size\n // this way we can always get the correct container size\n // (this is impossible for
elements at the moment)\n const parent = document.createElement('div');\n parent.setAttribute('class', 'djs-container djs-parent');\n\n assignStyle(parent, {\n position: 'relative',\n overflow: 'hidden',\n width: ensurePx(options.width),\n height: ensurePx(options.height)\n });\n\n container.appendChild(parent);\n\n return parent;\n}\n\nfunction createGroup(parent, cls, childIndex) {\n const group = svgCreate('g');\n svgClasses(group).add(cls);\n\n const index = childIndex !== undefined ? childIndex : parent.childNodes.length - 1;\n\n // must ensure second argument is node or _null_\n // cf. https://developer.mozilla.org/en-US/docs/Web/API/Node/insertBefore\n parent.insertBefore(group, parent.childNodes[index] || null);\n\n return group;\n}\n\nconst BASE_LAYER = 'base';\n\n// render plane contents behind utility layers\nconst PLANE_LAYER_INDEX = 0;\nconst UTILITY_LAYER_INDEX = 1;\n\n\nconst REQUIRED_MODEL_ATTRS = {\n shape: [ 'x', 'y', 'width', 'height' ],\n connection: [ 'waypoints' ]\n};\n\n/**\n * The main drawing canvas.\n *\n * @class\n * @constructor\n *\n * @emits Canvas#canvas.init\n *\n * @param {CanvasConfig|null} config\n * @param {EventBus} eventBus\n * @param {GraphicsFactory} graphicsFactory\n * @param {ElementRegistry} elementRegistry\n */\nexport default function Canvas(config, eventBus, graphicsFactory, elementRegistry) {\n this._eventBus = eventBus;\n this._elementRegistry = elementRegistry;\n this._graphicsFactory = graphicsFactory;\n\n /**\n * @type {number}\n */\n this._rootsIdx = 0;\n\n /**\n * @type {CanvasLayers}\n */\n this._layers = {};\n\n /**\n * @type {CanvasPlane[]}\n */\n this._planes = [];\n\n /**\n * @type {RootLike|null}\n */\n this._rootElement = null;\n\n this._init(config || {});\n}\n\nCanvas.$inject = [\n 'config.canvas',\n 'eventBus',\n 'graphicsFactory',\n 'elementRegistry'\n];\n\n/**\n * Creates a element that is wrapped into a .\n * This way we are always able to correctly figure out the size of the svg element\n * by querying the parent node.\n\n * (It is not possible to get the size of a svg element cross browser @ 2014-04-01)\n\n *
\n * \n * ...\n * \n *
\n *\n * @param {CanvasConfig} config\n */\nCanvas.prototype._init = function(config) {\n\n const eventBus = this._eventBus;\n\n // html container\n const container = this._container = createContainer(config);\n\n const svg = this._svg = svgCreate('svg');\n svgAttr(svg, { width: '100%', height: '100%' });\n\n svgAppend(container, svg);\n\n const viewport = this._viewport = createGroup(svg, 'viewport');\n\n // debounce canvas.viewbox.changed events when deferUpdate is set\n // to help with potential performance issues\n if (config.deferUpdate) {\n this._viewboxChanged = debounce(bind(this._viewboxChanged, this), 300);\n }\n\n eventBus.on('diagram.init', () => {\n\n /**\n * An event indicating that the canvas is ready to be drawn on.\n *\n * @memberOf Canvas\n *\n * @event canvas.init\n *\n * @type {Object}\n * @property {SVGElement} svg the created svg element\n * @property {SVGElement} viewport the direct parent of diagram elements and shapes\n */\n eventBus.fire('canvas.init', {\n svg: svg,\n viewport: viewport\n });\n\n });\n\n // reset viewbox on shape changes to\n // recompute the viewbox\n eventBus.on([\n 'shape.added',\n 'connection.added',\n 'shape.removed',\n 'connection.removed',\n 'elements.changed',\n 'root.set'\n ], () => {\n delete this._cachedViewbox;\n });\n\n eventBus.on('diagram.destroy', 500, this._destroy, this);\n eventBus.on('diagram.clear', 500, this._clear, this);\n};\n\nCanvas.prototype._destroy = function() {\n this._eventBus.fire('canvas.destroy', {\n svg: this._svg,\n viewport: this._viewport\n });\n\n const parent = this._container.parentNode;\n\n if (parent) {\n parent.removeChild(this._container);\n }\n\n delete this._svg;\n delete this._container;\n delete this._layers;\n delete this._planes;\n delete this._rootElement;\n delete this._viewport;\n};\n\nCanvas.prototype._clear = function() {\n\n const allElements = this._elementRegistry.getAll();\n\n // remove all elements\n allElements.forEach(element => {\n const type = getType(element);\n\n if (type === 'root') {\n this.removeRootElement(element);\n } else {\n this._removeElement(element, type);\n }\n });\n\n // remove all planes\n this._planes = [];\n this._rootElement = null;\n\n // force recomputation of view box\n delete this._cachedViewbox;\n};\n\n/**\n * Returns the default layer on which\n * all elements are drawn.\n *\n * @return {SVGElement} The SVG element of the layer.\n */\nCanvas.prototype.getDefaultLayer = function() {\n return this.getLayer(BASE_LAYER, PLANE_LAYER_INDEX);\n};\n\n/**\n * Returns a layer that is used to draw elements\n * or annotations on it.\n *\n * Non-existing layers retrieved through this method\n * will be created. During creation, the optional index\n * may be used to create layers below or above existing layers.\n * A layer with a certain index is always created above all\n * existing layers with the same index.\n *\n * @param {string} name The name of the layer.\n * @param {number} [index] The index of the layer.\n *\n * @return {SVGElement} The SVG element of the layer.\n */\nCanvas.prototype.getLayer = function(name, index) {\n\n if (!name) {\n throw new Error('must specify a name');\n }\n\n let layer = this._layers[name];\n\n if (!layer) {\n layer = this._layers[name] = this._createLayer(name, index);\n }\n\n // throw an error if layer creation / retrival is\n // requested on different index\n if (typeof index !== 'undefined' && layer.index !== index) {\n throw new Error('layer <' + name + '> already created at index <' + index + '>');\n }\n\n return layer.group;\n};\n\n/**\n * For a given index, return the number of layers that have a higher index and\n * are visible.\n *\n * This is used to determine the node a layer should be inserted at.\n *\n * @param {number} index\n *\n * @return {number}\n */\nCanvas.prototype._getChildIndex = function(index) {\n return reduce(this._layers, function(childIndex, layer) {\n if (layer.visible && index >= layer.index) {\n childIndex++;\n }\n\n return childIndex;\n }, 0);\n};\n\n/**\n * Creates a given layer and returns it.\n *\n * @param {string} name\n * @param {number} [index=0]\n *\n * @return {CanvasLayer}\n */\nCanvas.prototype._createLayer = function(name, index) {\n\n if (typeof index === 'undefined') {\n index = UTILITY_LAYER_INDEX;\n }\n\n const childIndex = this._getChildIndex(index);\n\n return {\n group: createGroup(this._viewport, 'layer-' + name, childIndex),\n index: index,\n visible: true\n };\n};\n\n\n/**\n * Shows a given layer.\n *\n * @param {string} name The name of the layer.\n *\n * @return {SVGElement} The SVG element of the layer.\n */\nCanvas.prototype.showLayer = function(name) {\n\n if (!name) {\n throw new Error('must specify a name');\n }\n\n const layer = this._layers[name];\n\n if (!layer) {\n throw new Error('layer <' + name + '> does not exist');\n }\n\n const viewport = this._viewport;\n const group = layer.group;\n const index = layer.index;\n\n if (layer.visible) {\n return group;\n }\n\n const childIndex = this._getChildIndex(index);\n\n viewport.insertBefore(group, viewport.childNodes[childIndex] || null);\n\n layer.visible = true;\n\n return group;\n};\n\n/**\n * Hides a given layer.\n *\n * @param {string} name The name of the layer.\n *\n * @return {SVGElement} The SVG element of the layer.\n */\nCanvas.prototype.hideLayer = function(name) {\n\n if (!name) {\n throw new Error('must specify a name');\n }\n\n const layer = this._layers[name];\n\n if (!layer) {\n throw new Error('layer <' + name + '> does not exist');\n }\n\n const group = layer.group;\n\n if (!layer.visible) {\n return group;\n }\n\n svgRemove(group);\n\n layer.visible = false;\n\n return group;\n};\n\n\nCanvas.prototype._removeLayer = function(name) {\n\n const layer = this._layers[name];\n\n if (layer) {\n delete this._layers[name];\n\n svgRemove(layer.group);\n }\n};\n\n/**\n * Returns the currently active layer. Can be null.\n *\n * @return {CanvasLayer|null} The active layer of `null`.\n */\nCanvas.prototype.getActiveLayer = function() {\n const plane = this._findPlaneForRoot(this.getRootElement());\n\n if (!plane) {\n return null;\n }\n\n return plane.layer;\n};\n\n\n/**\n * Returns the plane which contains the given element.\n *\n * @param {ShapeLike|ConnectionLike|string} element The element or its ID.\n *\n * @return {RootLike|undefined} The root of the element.\n */\nCanvas.prototype.findRoot = function(element) {\n if (typeof element === 'string') {\n element = this._elementRegistry.get(element);\n }\n\n if (!element) {\n return;\n }\n\n const plane = this._findPlaneForRoot(\n findRoot(element)\n ) || {};\n\n return plane.rootElement;\n};\n\n/**\n * Return a list of all root elements on the diagram.\n *\n * @return {(RootLike)[]} The list of root elements.\n */\nCanvas.prototype.getRootElements = function() {\n return this._planes.map(function(plane) {\n return plane.rootElement;\n });\n};\n\nCanvas.prototype._findPlaneForRoot = function(rootElement) {\n return find(this._planes, function(plane) {\n return plane.rootElement === rootElement;\n });\n};\n\n\n/**\n * Returns the html element that encloses the\n * drawing canvas.\n *\n * @return {HTMLElement} The HTML element of the container.\n */\nCanvas.prototype.getContainer = function() {\n return this._container;\n};\n\n\n// markers //////////////////////\n\nCanvas.prototype._updateMarker = function(element, marker, add) {\n let container;\n\n if (!element.id) {\n element = this._elementRegistry.get(element);\n }\n\n // we need to access all\n container = this._elementRegistry._elements[element.id];\n\n if (!container) {\n return;\n }\n\n forEach([ container.gfx, container.secondaryGfx ], function(gfx) {\n if (gfx) {\n\n // invoke either addClass or removeClass based on mode\n if (add) {\n svgClasses(gfx).add(marker);\n } else {\n svgClasses(gfx).remove(marker);\n }\n }\n });\n\n /**\n * An event indicating that a marker has been updated for an element\n *\n * @event element.marker.update\n * @type {Object}\n * @property {Element} element the shape\n * @property {SVGElement} gfx the graphical representation of the shape\n * @property {string} marker\n * @property {boolean} add true if the marker was added, false if it got removed\n */\n this._eventBus.fire('element.marker.update', { element: element, gfx: container.gfx, marker: marker, add: !!add });\n};\n\n\n/**\n * Adds a marker to an element (basically a css class).\n *\n * Fires the element.marker.update event, making it possible to\n * integrate extension into the marker life-cycle, too.\n *\n * @example\n *\n * ```javascript\n * canvas.addMarker('foo', 'some-marker');\n *\n * const fooGfx = canvas.getGraphics('foo');\n *\n * fooGfx; //
... \n * ```\n *\n * @param {ShapeLike|ConnectionLike|string} element The element or its ID.\n * @param {string} marker The marker.\n */\nCanvas.prototype.addMarker = function(element, marker) {\n this._updateMarker(element, marker, true);\n};\n\n\n/**\n * Remove a marker from an element.\n *\n * Fires the element.marker.update event, making it possible to\n * integrate extension into the marker life-cycle, too.\n *\n * @param {ShapeLike|ConnectionLike|string} element The element or its ID.\n * @param {string} marker The marker.\n */\nCanvas.prototype.removeMarker = function(element, marker) {\n this._updateMarker(element, marker, false);\n};\n\n/**\n * Check whether an element has a given marker.\n *\n * @param {ShapeLike|ConnectionLike|string} element The element or its ID.\n * @param {string} marker The marker.\n */\nCanvas.prototype.hasMarker = function(element, marker) {\n if (!element.id) {\n element = this._elementRegistry.get(element);\n }\n\n const gfx = this.getGraphics(element);\n\n return svgClasses(gfx).has(marker);\n};\n\n/**\n * Toggles a marker on an element.\n *\n * Fires the element.marker.update event, making it possible to\n * integrate extension into the marker life-cycle, too.\n *\n * @param {ShapeLike|ConnectionLike|string} element The element or its ID.\n * @param {string} marker The marker.\n */\nCanvas.prototype.toggleMarker = function(element, marker) {\n if (this.hasMarker(element, marker)) {\n this.removeMarker(element, marker);\n } else {\n this.addMarker(element, marker);\n }\n};\n\n/**\n * Returns the current root element.\n *\n * Supports two different modes for handling root elements:\n *\n * 1. if no root element has been added before, an implicit root will be added\n * and returned. This is used in applications that don't require explicit\n * root elements.\n *\n * 2. when root elements have been added before calling `getRootElement`,\n * root elements can be null. This is used for applications that want to manage\n * root elements themselves.\n *\n * @return {RootLike} The current root element.\n */\nCanvas.prototype.getRootElement = function() {\n const rootElement = this._rootElement;\n\n // can return null if root elements are present but none was set yet\n if (rootElement || this._planes.length) {\n return rootElement;\n }\n\n return this.setRootElement(this.addRootElement(null));\n};\n\n/**\n * Adds a given root element and returns it.\n *\n * @param {RootLike} [rootElement] The root element to be added.\n *\n * @return {RootLike} The added root element or an implicit root element.\n */\nCanvas.prototype.addRootElement = function(rootElement) {\n const idx = this._rootsIdx++;\n\n if (!rootElement) {\n rootElement = {\n id: '__implicitroot_' + idx,\n children: [],\n isImplicit: true\n };\n }\n\n const layerName = rootElement.layer = 'root-' + idx;\n\n this._ensureValid('root', rootElement);\n\n const layer = this.getLayer(layerName, PLANE_LAYER_INDEX);\n\n this.hideLayer(layerName);\n\n this._addRoot(rootElement, layer);\n\n this._planes.push({\n rootElement: rootElement,\n layer: layer\n });\n\n return rootElement;\n};\n\n/**\n * Removes a given root element and returns it.\n *\n * @param {RootLike|string} rootElement element or element ID\n *\n * @return {RootLike|undefined} removed element\n */\nCanvas.prototype.removeRootElement = function(rootElement) {\n\n if (typeof rootElement === 'string') {\n rootElement = this._elementRegistry.get(rootElement);\n }\n\n const plane = this._findPlaneForRoot(rootElement);\n\n if (!plane) {\n return;\n }\n\n // hook up life-cycle events\n this._removeRoot(rootElement);\n\n // clean up layer\n this._removeLayer(rootElement.layer);\n\n // clean up plane\n this._planes = this._planes.filter(function(plane) {\n return plane.rootElement !== rootElement;\n });\n\n // clean up active root\n if (this._rootElement === rootElement) {\n this._rootElement = null;\n }\n\n return rootElement;\n};\n\n\n/**\n * Sets a given element as the new root element for the canvas\n * and returns the new root element.\n *\n * @param {RootLike} rootElement The root element to be set.\n *\n * @return {RootLike} The set root element.\n */\nCanvas.prototype.setRootElement = function(rootElement) {\n\n if (rootElement === this._rootElement) {\n return;\n }\n\n let plane;\n\n if (!rootElement) {\n throw new Error('rootElement required');\n }\n\n plane = this._findPlaneForRoot(rootElement);\n\n // give set add semantics for backwards compatibility\n if (!plane) {\n rootElement = this.addRootElement(rootElement);\n }\n\n this._setRoot(rootElement);\n\n return rootElement;\n};\n\n\nCanvas.prototype._removeRoot = function(element) {\n const elementRegistry = this._elementRegistry,\n eventBus = this._eventBus;\n\n // simulate element remove event sequence\n eventBus.fire('root.remove', { element: element });\n eventBus.fire('root.removed', { element: element });\n\n elementRegistry.remove(element);\n};\n\n\nCanvas.prototype._addRoot = function(element, gfx) {\n const elementRegistry = this._elementRegistry,\n eventBus = this._eventBus;\n\n // resemble element add event sequence\n eventBus.fire('root.add', { element: element });\n\n elementRegistry.add(element, gfx);\n\n eventBus.fire('root.added', { element: element, gfx: gfx });\n};\n\n\nCanvas.prototype._setRoot = function(rootElement, layer) {\n\n const currentRoot = this._rootElement;\n\n if (currentRoot) {\n\n // un-associate previous root element
\n this._elementRegistry.updateGraphics(currentRoot, null, true);\n\n // hide previous layer\n this.hideLayer(currentRoot.layer);\n }\n\n if (rootElement) {\n\n if (!layer) {\n layer = this._findPlaneForRoot(rootElement).layer;\n }\n\n // associate element with \n this._elementRegistry.updateGraphics(rootElement, this._svg, true);\n\n // show root layer\n this.showLayer(rootElement.layer);\n }\n\n this._rootElement = rootElement;\n\n this._eventBus.fire('root.set', { element: rootElement });\n};\n\nCanvas.prototype._ensureValid = function(type, element) {\n if (!element.id) {\n throw new Error('element must have an id');\n }\n\n if (this._elementRegistry.get(element.id)) {\n throw new Error('element <' + element.id + '> already exists');\n }\n\n const requiredAttrs = REQUIRED_MODEL_ATTRS[type];\n\n const valid = every(requiredAttrs, function(attr) {\n return typeof element[attr] !== 'undefined';\n });\n\n if (!valid) {\n throw new Error(\n 'must supply { ' + requiredAttrs.join(', ') + ' } with ' + type);\n }\n};\n\nCanvas.prototype._setParent = function(element, parent, parentIndex) {\n collectionAdd(parent.children, element, parentIndex);\n element.parent = parent;\n};\n\n/**\n * Adds an element to the canvas.\n *\n * This wires the parent <-> child relationship between the element and\n * a explicitly specified parent or an implicit root element.\n *\n * During add it emits the events\n *\n * * <{type}.add> (element, parent)\n * * <{type}.added> (element, gfx)\n *\n * Extensions may hook into these events to perform their magic.\n *\n * @param {string} type\n * @param {ConnectionLike|ShapeLike} element\n * @param {ShapeLike} [parent]\n * @param {number} [parentIndex]\n *\n * @return {ConnectionLike|ShapeLike} The added element.\n */\nCanvas.prototype._addElement = function(type, element, parent, parentIndex) {\n\n parent = parent || this.getRootElement();\n\n const eventBus = this._eventBus,\n graphicsFactory = this._graphicsFactory;\n\n this._ensureValid(type, element);\n\n eventBus.fire(type + '.add', { element: element, parent: parent });\n\n this._setParent(element, parent, parentIndex);\n\n // create graphics\n const gfx = graphicsFactory.create(type, element, parentIndex);\n\n this._elementRegistry.add(element, gfx);\n\n // update its visual\n graphicsFactory.update(type, element, gfx);\n\n eventBus.fire(type + '.added', { element: element, gfx: gfx });\n\n return element;\n};\n\n/**\n * Adds a shape to the canvas.\n *\n * @param {ShapeLike} shape The shape to be added\n * @param {ParentLike} [parent] The shape's parent.\n * @param {number} [parentIndex] The index at which to add the shape to the parent's children.\n *\n * @return {ShapeLike} The added shape.\n */\nCanvas.prototype.addShape = function(shape, parent, parentIndex) {\n return this._addElement('shape', shape, parent, parentIndex);\n};\n\n/**\n * Adds a connection to the canvas.\n *\n * @param {ConnectionLike} connection The connection to be added.\n * @param {ParentLike} [parent] The connection's parent.\n * @param {number} [parentIndex] The index at which to add the connection to the parent's children.\n *\n * @return {ConnectionLike} The added connection.\n */\nCanvas.prototype.addConnection = function(connection, parent, parentIndex) {\n return this._addElement('connection', connection, parent, parentIndex);\n};\n\n\n/**\n * Internal remove element\n */\nCanvas.prototype._removeElement = function(element, type) {\n\n const elementRegistry = this._elementRegistry,\n graphicsFactory = this._graphicsFactory,\n eventBus = this._eventBus;\n\n element = elementRegistry.get(element.id || element);\n\n if (!element) {\n\n // element was removed already\n return;\n }\n\n eventBus.fire(type + '.remove', { element: element });\n\n graphicsFactory.remove(element);\n\n // unset parent <-> child relationship\n collectionRemove(element.parent && element.parent.children, element);\n element.parent = null;\n\n eventBus.fire(type + '.removed', { element: element });\n\n elementRegistry.remove(element);\n\n return element;\n};\n\n\n/**\n * Removes a shape from the canvas.\n *\n * @fires ShapeRemoveEvent\n * @fires ShapeRemovedEvent\n *\n * @param {ShapeLike|string} shape The shape or its ID.\n *\n * @return {ShapeLike} The removed shape.\n */\nCanvas.prototype.removeShape = function(shape) {\n\n /**\n * An event indicating that a shape is about to be removed from the canvas.\n *\n * @memberOf Canvas\n *\n * @event ShapeRemoveEvent\n * @type {Object}\n * @property {ShapeLike} element The shape.\n * @property {SVGElement} gfx The graphical element.\n */\n\n /**\n * An event indicating that a shape has been removed from the canvas.\n *\n * @memberOf Canvas\n *\n * @event ShapeRemovedEvent\n * @type {Object}\n * @property {ShapeLike} element The shape.\n * @property {SVGElement} gfx The graphical element.\n */\n return this._removeElement(shape, 'shape');\n};\n\n\n/**\n * Removes a connection from the canvas.\n *\n * @fires ConnectionRemoveEvent\n * @fires ConnectionRemovedEvent\n *\n * @param {ConnectionLike|string} connection The connection or its ID.\n *\n * @return {ConnectionLike} The removed connection.\n */\nCanvas.prototype.removeConnection = function(connection) {\n\n /**\n * An event indicating that a connection is about to be removed from the canvas.\n *\n * @memberOf Canvas\n *\n * @event ConnectionRemoveEvent\n * @type {Object}\n * @property {ConnectionLike} element The connection.\n * @property {SVGElement} gfx The graphical element.\n */\n\n /**\n * An event indicating that a connection has been removed from the canvas.\n *\n * @memberOf Canvas\n *\n * @event ConnectionRemovedEvent\n * @type {Object}\n * @property {ConnectionLike} element The connection.\n * @property {SVGElement} gfx The graphical element.\n */\n return this._removeElement(connection, 'connection');\n};\n\n\n/**\n * Returns the graphical element of an element.\n *\n * @param {ShapeLike|ConnectionLike|string} element The element or its ID.\n * @param {boolean} [secondary=false] Whether to return the secondary graphical element.\n *\n * @return {SVGElement} The graphical element.\n */\nCanvas.prototype.getGraphics = function(element, secondary) {\n return this._elementRegistry.getGraphics(element, secondary);\n};\n\n\n/**\n * Perform a viewbox update via a given change function.\n *\n * @param {Function} changeFn\n */\nCanvas.prototype._changeViewbox = function(changeFn) {\n\n // notify others of the upcoming viewbox change\n this._eventBus.fire('canvas.viewbox.changing');\n\n // perform actual change\n changeFn.apply(this);\n\n // reset the cached viewbox so that\n // a new get operation on viewbox or zoom\n // triggers a viewbox re-computation\n this._cachedViewbox = null;\n\n // notify others of the change; this step\n // may or may not be debounced\n this._viewboxChanged();\n};\n\nCanvas.prototype._viewboxChanged = function() {\n this._eventBus.fire('canvas.viewbox.changed', { viewbox: this.viewbox() });\n};\n\n\n/**\n * Gets or sets the view box of the canvas, i.e. the\n * area that is currently displayed.\n *\n * The getter may return a cached viewbox (if it is currently\n * changing). To force a recomputation, pass `false` as the first argument.\n *\n * @example\n *\n * ```javascript\n * canvas.viewbox({ x: 100, y: 100, width: 500, height: 500 })\n *\n * // sets the visible area of the diagram to (100|100) -> (600|100)\n * // and and scales it according to the diagram width\n *\n * const viewbox = canvas.viewbox(); // pass `false` to force recomputing the box.\n *\n * console.log(viewbox);\n * // {\n * // inner: Dimensions,\n * // outer: Dimensions,\n * // scale,\n * // x, y,\n * // width, height\n * // }\n *\n * // if the current diagram is zoomed and scrolled, you may reset it to the\n * // default zoom via this method, too:\n *\n * const zoomedAndScrolledViewbox = canvas.viewbox();\n *\n * canvas.viewbox({\n * x: 0,\n * y: 0,\n * width: zoomedAndScrolledViewbox.outer.width,\n * height: zoomedAndScrolledViewbox.outer.height\n * });\n * ```\n *\n * @param {Rect} [box] The viewbox to be set.\n *\n * @return {CanvasViewbox} The set viewbox.\n */\nCanvas.prototype.viewbox = function(box) {\n\n if (box === undefined && this._cachedViewbox) {\n return this._cachedViewbox;\n }\n\n const viewport = this._viewport,\n outerBox = this.getSize();\n let innerBox,\n matrix,\n activeLayer,\n transform,\n scale,\n x, y;\n\n if (!box) {\n\n // compute the inner box based on the\n // diagrams active layer. This allows us to exclude\n // external components, such as overlays\n\n activeLayer = this._rootElement ? this.getActiveLayer() : null;\n innerBox = activeLayer && activeLayer.getBBox() || {};\n\n transform = svgTransform(viewport);\n matrix = transform ? transform.matrix : createMatrix();\n scale = round(matrix.a, 1000);\n\n x = round(-matrix.e || 0, 1000);\n y = round(-matrix.f || 0, 1000);\n\n box = this._cachedViewbox = {\n x: x ? x / scale : 0,\n y: y ? y / scale : 0,\n width: outerBox.width / scale,\n height: outerBox.height / scale,\n scale: scale,\n inner: {\n width: innerBox.width || 0,\n height: innerBox.height || 0,\n x: innerBox.x || 0,\n y: innerBox.y || 0\n },\n outer: outerBox\n };\n\n return box;\n } else {\n\n this._changeViewbox(function() {\n scale = Math.min(outerBox.width / box.width, outerBox.height / box.height);\n\n const matrix = this._svg.createSVGMatrix()\n .scale(scale)\n .translate(-box.x, -box.y);\n\n svgTransform(viewport, matrix);\n });\n }\n\n return box;\n};\n\n\n/**\n * Gets or sets the scroll of the canvas.\n *\n * @param {Point} [delta] The scroll to be set.\n *\n * @return {Point}\n */\nCanvas.prototype.scroll = function(delta) {\n\n const node = this._viewport;\n let matrix = node.getCTM();\n\n if (delta) {\n this._changeViewbox(function() {\n delta = assign({ dx: 0, dy: 0 }, delta || {});\n\n matrix = this._svg.createSVGMatrix().translate(delta.dx, delta.dy).multiply(matrix);\n\n setCTM(node, matrix);\n });\n }\n\n return { x: matrix.e, y: matrix.f };\n};\n\n/**\n * Scrolls the viewbox to contain the given element.\n * Optionally specify a padding to be applied to the edges.\n *\n * @param {ShapeLike|ConnectionLike|string} element The element to scroll to or its ID.\n * @param {RectTRBL|number} [padding=100] The padding to be applied. Can also specify top, bottom, left and right.\n */\nCanvas.prototype.scrollToElement = function(element, padding) {\n let defaultPadding = 100;\n\n if (typeof element === 'string') {\n element = this._elementRegistry.get(element);\n }\n\n // set to correct rootElement\n const rootElement = this.findRoot(element);\n\n if (rootElement !== this.getRootElement()) {\n this.setRootElement(rootElement);\n }\n\n // element is rootElement, do not change viewport\n if (rootElement === element) {\n return;\n }\n\n if (!padding) {\n padding = {};\n }\n if (typeof padding === 'number') {\n defaultPadding = padding;\n }\n\n padding = {\n top: padding.top || defaultPadding,\n right: padding.right || defaultPadding,\n bottom: padding.bottom || defaultPadding,\n left: padding.left || defaultPadding\n };\n\n const elementBounds = getBoundingBox(element),\n elementTrbl = asTRBL(elementBounds),\n viewboxBounds = this.viewbox(),\n zoom = this.zoom();\n let dx, dy;\n\n // shrink viewboxBounds with padding\n viewboxBounds.y += padding.top / zoom;\n viewboxBounds.x += padding.left / zoom;\n viewboxBounds.width -= (padding.right + padding.left) / zoom;\n viewboxBounds.height -= (padding.bottom + padding.top) / zoom;\n\n const viewboxTrbl = asTRBL(viewboxBounds);\n\n const canFit = elementBounds.width < viewboxBounds.width && elementBounds.height < viewboxBounds.height;\n\n if (!canFit) {\n\n // top-left when element can't fit\n dx = elementBounds.x - viewboxBounds.x;\n dy = elementBounds.y - viewboxBounds.y;\n\n } else {\n\n const dRight = Math.max(0, elementTrbl.right - viewboxTrbl.right),\n dLeft = Math.min(0, elementTrbl.left - viewboxTrbl.left),\n dBottom = Math.max(0, elementTrbl.bottom - viewboxTrbl.bottom),\n dTop = Math.min(0, elementTrbl.top - viewboxTrbl.top);\n\n dx = dRight || dLeft;\n dy = dBottom || dTop;\n\n }\n\n this.scroll({ dx: -dx * zoom, dy: -dy * zoom });\n};\n\n/**\n * Gets or sets the current zoom of the canvas, optionally zooming to the\n * specified position.\n *\n * The getter may return a cached zoom level. Call it with `false` as the first\n * argument to force recomputation of the current level.\n *\n * @param {number|'fit-viewport'} [newScale] The new zoom level, either a number,\n * i.e. 0.9, or `fit-viewport` to adjust the size to fit the current viewport.\n * @param {Point} [center] The reference point { x: ..., y: ...} to zoom to.\n *\n * @return {number} The set zoom level.\n */\nCanvas.prototype.zoom = function(newScale, center) {\n\n if (!newScale) {\n return this.viewbox(newScale).scale;\n }\n\n if (newScale === 'fit-viewport') {\n return this._fitViewport(center);\n }\n\n let outer,\n matrix;\n\n this._changeViewbox(function() {\n\n if (typeof center !== 'object') {\n outer = this.viewbox().outer;\n\n center = {\n x: outer.width / 2,\n y: outer.height / 2\n };\n }\n\n matrix = this._setZoom(newScale, center);\n });\n\n return round(matrix.a, 1000);\n};\n\nfunction setCTM(node, m) {\n const mstr = 'matrix(' + m.a + ',' + m.b + ',' + m.c + ',' + m.d + ',' + m.e + ',' + m.f + ')';\n node.setAttribute('transform', mstr);\n}\n\nCanvas.prototype._fitViewport = function(center) {\n\n const vbox = this.viewbox(),\n outer = vbox.outer,\n inner = vbox.inner;\n let newScale,\n newViewbox;\n\n // display the complete diagram without zooming in.\n // instead of relying on internal zoom, we perform a\n // hard reset on the canvas viewbox to realize this\n //\n // if diagram does not need to be zoomed in, we focus it around\n // the diagram origin instead\n\n if (inner.x >= 0 &&\n inner.y >= 0 &&\n inner.x + inner.width <= outer.width &&\n inner.y + inner.height <= outer.height &&\n !center) {\n\n newViewbox = {\n x: 0,\n y: 0,\n width: Math.max(inner.width + inner.x, outer.width),\n height: Math.max(inner.height + inner.y, outer.height)\n };\n } else {\n\n newScale = Math.min(1, outer.width / inner.width, outer.height / inner.height);\n newViewbox = {\n x: inner.x + (center ? inner.width / 2 - outer.width / newScale / 2 : 0),\n y: inner.y + (center ? inner.height / 2 - outer.height / newScale / 2 : 0),\n width: outer.width / newScale,\n height: outer.height / newScale\n };\n }\n\n this.viewbox(newViewbox);\n\n return this.viewbox(false).scale;\n};\n\n\nCanvas.prototype._setZoom = function(scale, center) {\n\n const svg = this._svg,\n viewport = this._viewport;\n\n const matrix = svg.createSVGMatrix();\n const point = svg.createSVGPoint();\n\n let centerPoint,\n originalPoint,\n currentMatrix,\n scaleMatrix,\n newMatrix;\n\n currentMatrix = viewport.getCTM();\n\n const currentScale = currentMatrix.a;\n\n if (center) {\n centerPoint = assign(point, center);\n\n // revert applied viewport transformations\n originalPoint = centerPoint.matrixTransform(currentMatrix.inverse());\n\n // create scale matrix\n scaleMatrix = matrix\n .translate(originalPoint.x, originalPoint.y)\n .scale(1 / currentScale * scale)\n .translate(-originalPoint.x, -originalPoint.y);\n\n newMatrix = currentMatrix.multiply(scaleMatrix);\n } else {\n newMatrix = matrix.scale(scale);\n }\n\n setCTM(this._viewport, newMatrix);\n\n return newMatrix;\n};\n\n\n/**\n * Returns the size of the canvas.\n *\n * @return {Dimensions} The size of the canvas.\n */\nCanvas.prototype.getSize = function() {\n return {\n width: this._container.clientWidth,\n height: this._container.clientHeight\n };\n};\n\n\n/**\n * Returns the absolute bounding box of an element.\n *\n * The absolute bounding box may be used to display overlays in the callers\n * (browser) coordinate system rather than the zoomed in/out canvas coordinates.\n *\n * @param {ShapeLike|ConnectionLike} element The element.\n *\n * @return {Rect} The element's absolute bounding box.\n */\nCanvas.prototype.getAbsoluteBBox = function(element) {\n const vbox = this.viewbox();\n let bbox;\n\n // connection\n // use svg bbox\n if (element.waypoints) {\n const gfx = this.getGraphics(element);\n\n bbox = gfx.getBBox();\n }\n\n // shapes\n // use data\n else {\n bbox = element;\n }\n\n const x = bbox.x * vbox.scale - vbox.x * vbox.scale;\n const y = bbox.y * vbox.scale - vbox.y * vbox.scale;\n\n const width = bbox.width * vbox.scale;\n const height = bbox.height * vbox.scale;\n\n return {\n x: x,\n y: y,\n width: width,\n height: height\n };\n};\n\n/**\n * Fires an event so other modules can react to the canvas resizing.\n */\nCanvas.prototype.resized = function() {\n\n // force recomputation of view box\n delete this._cachedViewbox;\n\n this._eventBus.fire('canvas.resized');\n};\n","var ELEMENT_ID = 'data-element-id';\n\nimport { attr as svgAttr } from 'tiny-svg';\n\n/**\n * @typedef {import('./Types').ElementLike} ElementLike\n *\n * @typedef {import('./EventBus').default} EventBus\n *\n * @typedef { (element: ElementLike, gfx: SVGElement) => boolean|any } ElementRegistryFilterCallback\n * @typedef { (element: ElementLike, gfx: SVGElement) => any } ElementRegistryForEachCallback\n */\n\n/**\n * A registry that keeps track of all shapes in the diagram.\n *\n * @class\n * @constructor\n *\n * @param {EventBus} eventBus\n */\nexport default function ElementRegistry(eventBus) {\n\n /**\n * @type { {\n * [id: string]: {\n * element: ElementLike;\n * gfx?: SVGElement;\n * secondaryGfx?: SVGElement;\n * }\n * } }\n */\n this._elements = {};\n\n this._eventBus = eventBus;\n}\n\nElementRegistry.$inject = [ 'eventBus' ];\n\n/**\n * Add an element and its graphical representation(s) to the registry.\n *\n * @param {ElementLike} element The element to be added.\n * @param {SVGElement} gfx The primary graphical representation.\n * @param {SVGElement} [secondaryGfx] The secondary graphical representation.\n */\nElementRegistry.prototype.add = function(element, gfx, secondaryGfx) {\n\n var id = element.id;\n\n this._validateId(id);\n\n // associate dom node with element\n svgAttr(gfx, ELEMENT_ID, id);\n\n if (secondaryGfx) {\n svgAttr(secondaryGfx, ELEMENT_ID, id);\n }\n\n this._elements[id] = { element: element, gfx: gfx, secondaryGfx: secondaryGfx };\n};\n\n/**\n * Remove an element from the registry.\n *\n * @param {ElementLike|string} element\n */\nElementRegistry.prototype.remove = function(element) {\n var elements = this._elements,\n id = element.id || element,\n container = id && elements[id];\n\n if (container) {\n\n // unset element id on gfx\n svgAttr(container.gfx, ELEMENT_ID, '');\n\n if (container.secondaryGfx) {\n svgAttr(container.secondaryGfx, ELEMENT_ID, '');\n }\n\n delete elements[id];\n }\n};\n\n/**\n * Update an elements ID.\n *\n * @param {ElementLike|string} element The element or its ID.\n * @param {string} newId The new ID.\n */\nElementRegistry.prototype.updateId = function(element, newId) {\n\n this._validateId(newId);\n\n if (typeof element === 'string') {\n element = this.get(element);\n }\n\n this._eventBus.fire('element.updateId', {\n element: element,\n newId: newId\n });\n\n var gfx = this.getGraphics(element),\n secondaryGfx = this.getGraphics(element, true);\n\n this.remove(element);\n\n element.id = newId;\n\n this.add(element, gfx, secondaryGfx);\n};\n\n/**\n * Update the graphical representation of an element.\n *\n * @param {ElementLike|string} filter The element or its ID.\n * @param {SVGElement} gfx The new graphical representation.\n * @param {boolean} [secondary=false] Whether to update the secondary graphical representation.\n */\nElementRegistry.prototype.updateGraphics = function(filter, gfx, secondary) {\n var id = filter.id || filter;\n\n var container = this._elements[id];\n\n if (secondary) {\n container.secondaryGfx = gfx;\n } else {\n container.gfx = gfx;\n }\n\n if (gfx) {\n svgAttr(gfx, ELEMENT_ID, id);\n }\n\n return gfx;\n};\n\n/**\n * Get the element with the given ID or graphical representation.\n *\n * @example\n *\n * ```javascript\n * elementRegistry.get('SomeElementId_1');\n *\n * elementRegistry.get(gfx);\n * ```\n *\n * @param {string|SVGElement} filter The elements ID or graphical representation.\n *\n * @return {ElementLike|undefined} The element.\n */\nElementRegistry.prototype.get = function(filter) {\n var id;\n\n if (typeof filter === 'string') {\n id = filter;\n } else {\n id = filter && svgAttr(filter, ELEMENT_ID);\n }\n\n var container = this._elements[id];\n return container && container.element;\n};\n\n/**\n * Return all elements that match a given filter function.\n *\n * @param {ElementRegistryFilterCallback} fn The filter function.\n *\n * @return {ElementLike[]} The matching elements.\n */\nElementRegistry.prototype.filter = function(fn) {\n\n var filtered = [];\n\n this.forEach(function(element, gfx) {\n if (fn(element, gfx)) {\n filtered.push(element);\n }\n });\n\n return filtered;\n};\n\n/**\n * Return the first element that matches the given filter function.\n *\n * @param {ElementRegistryFilterCallback} fn The filter function.\n *\n * @return {ElementLike|undefined} The matching element.\n */\nElementRegistry.prototype.find = function(fn) {\n var map = this._elements,\n keys = Object.keys(map);\n\n for (var i = 0; i < keys.length; i++) {\n var id = keys[i],\n container = map[id],\n element = container.element,\n gfx = container.gfx;\n\n if (fn(element, gfx)) {\n return element;\n }\n }\n};\n\n/**\n * Get all elements.\n *\n * @return {ElementLike[]} All elements.\n */\nElementRegistry.prototype.getAll = function() {\n return this.filter(function(e) { return e; });\n};\n\n/**\n * Execute a given function for each element.\n *\n * @param {ElementRegistryForEachCallback} fn The function to execute.\n */\nElementRegistry.prototype.forEach = function(fn) {\n\n var map = this._elements;\n\n Object.keys(map).forEach(function(id) {\n var container = map[id],\n element = container.element,\n gfx = container.gfx;\n\n return fn(element, gfx);\n });\n};\n\n/**\n * Return the graphical representation of an element.\n *\n * @example\n *\n * ```javascript\n * elementRegistry.getGraphics('SomeElementId_1');\n *\n * elementRegistry.getGraphics(rootElement); // \n *\n * elementRegistry.getGraphics(rootElement, true); // \n * ```\n *\n * @param {ElementLike|string} filter The element or its ID.\n * @param {boolean} [secondary=false] Whether to return the secondary graphical representation.\n *\n * @return {SVGElement} The graphical representation.\n */\nElementRegistry.prototype.getGraphics = function(filter, secondary) {\n var id = filter.id || filter;\n\n var container = this._elements[id];\n return container && (secondary ? container.secondaryGfx : container.gfx);\n};\n\n/**\n * Validate an ID and throw an error if invalid.\n *\n * @param {string} id\n *\n * @throws {Error} Error indicating that the ID is invalid or already assigned.\n */\nElementRegistry.prototype._validateId = function(id) {\n if (!id) {\n throw new Error('element must have an id');\n }\n\n if (this._elements[id]) {\n throw new Error('element with id ' + id + ' already added');\n }\n};\n","/**\n * Extends a collection with {@link Refs} aware methods\n *\n * @param {Array} collection\n * @param {Refs} refs instance\n * @param {Object} property represented by the collection\n * @param {Object} target object the collection is attached to\n *\n * @return {RefsCollection} the extended array\n */\nfunction extend(collection, refs, property, target) {\n var inverseProperty = property.inverse;\n\n /**\n * Removes the given element from the array and returns it.\n *\n * @method RefsCollection#remove\n *\n * @param {Object} element the element to remove\n */\n Object.defineProperty(collection, 'remove', {\n value: function (element) {\n var idx = this.indexOf(element);\n if (idx !== -1) {\n this.splice(idx, 1);\n\n // unset inverse\n refs.unset(element, inverseProperty, target);\n }\n return element;\n }\n });\n\n /**\n * Returns true if the collection contains the given element\n *\n * @method RefsCollection#contains\n *\n * @param {Object} element the element to check for\n */\n Object.defineProperty(collection, 'contains', {\n value: function (element) {\n return this.indexOf(element) !== -1;\n }\n });\n\n /**\n * Adds an element to the array, unless it exists already (set semantics).\n *\n * @method RefsCollection#add\n *\n * @param {Object} element the element to add\n * @param {Number} optional index to add element to\n * (possibly moving other elements around)\n */\n Object.defineProperty(collection, 'add', {\n value: function (element, idx) {\n var currentIdx = this.indexOf(element);\n if (typeof idx === 'undefined') {\n if (currentIdx !== -1) {\n // element already in collection (!)\n return;\n }\n\n // add to end of array, as no idx is specified\n idx = this.length;\n }\n\n // handle already in collection\n if (currentIdx !== -1) {\n // remove element from currentIdx\n this.splice(currentIdx, 1);\n }\n\n // add element at idx\n this.splice(idx, 0, element);\n if (currentIdx === -1) {\n // set inverse, unless element was\n // in collection already\n refs.set(element, inverseProperty, target);\n }\n }\n });\n\n // a simple marker, identifying this element\n // as being a refs collection\n Object.defineProperty(collection, '__refs_collection', {\n value: true\n });\n return collection;\n}\n\n/**\n * Checks if a given collection is extended\n *\n * @param {Array} collection\n *\n * @return {boolean}\n */\nfunction isExtended(collection) {\n return collection.__refs_collection === true;\n}\n\nvar collection = {\n __proto__: null,\n extend: extend,\n isExtended: isExtended\n};\n\nfunction hasOwnProperty(e, property) {\n return Object.prototype.hasOwnProperty.call(e, property.name || property);\n}\nfunction defineCollectionProperty(ref, property, target) {\n var collection = extend(target[property.name] || [], ref, property, target);\n Object.defineProperty(target, property.name, {\n enumerable: property.enumerable,\n value: collection\n });\n if (collection.length) {\n collection.forEach(function (o) {\n ref.set(o, property.inverse, target);\n });\n }\n}\nfunction defineProperty(ref, property, target) {\n var inverseProperty = property.inverse;\n var _value = target[property.name];\n Object.defineProperty(target, property.name, {\n configurable: property.configurable,\n enumerable: property.enumerable,\n get: function () {\n return _value;\n },\n set: function (value) {\n // return if we already performed all changes\n if (value === _value) {\n return;\n }\n var old = _value;\n\n // temporary set null\n _value = null;\n if (old) {\n ref.unset(old, inverseProperty, target);\n }\n\n // set new value\n _value = value;\n\n // set inverse value\n ref.set(_value, inverseProperty, target);\n }\n });\n}\n\n/**\n * Creates a new references object defining two inversly related\n * attribute descriptors a and b.\n *\n * \n * When bound to an object using {@link Refs#bind} the references\n * get activated and ensure that add and remove operations are applied\n * reversely, too.\n *
\n *\n * \n * For attributes represented as collections {@link Refs} provides the\n * {@link RefsCollection#add}, {@link RefsCollection#remove} and {@link RefsCollection#contains} extensions\n * that must be used to properly hook into the inverse change mechanism.\n *
\n *\n * @class Refs\n *\n * @classdesc A bi-directional reference between two attributes.\n *\n * @param {Refs.AttributeDescriptor} a property descriptor\n * @param {Refs.AttributeDescriptor} b property descriptor\n *\n * @example\n *\n * var refs = Refs({ name: 'wheels', collection: true, enumerable: true }, { name: 'car' });\n *\n * var car = { name: 'toyota' };\n * var wheels = [{ pos: 'front-left' }, { pos: 'front-right' }];\n *\n * refs.bind(car, 'wheels');\n *\n * car.wheels // []\n * car.wheels.add(wheels[0]);\n * car.wheels.add(wheels[1]);\n *\n * car.wheels // [{ pos: 'front-left' }, { pos: 'front-right' }]\n *\n * wheels[0].car // { name: 'toyota' };\n * car.wheels.remove(wheels[0]);\n *\n * wheels[0].car // undefined\n */\nfunction Refs(a, b) {\n if (!(this instanceof Refs)) {\n return new Refs(a, b);\n }\n\n // link\n a.inverse = b;\n b.inverse = a;\n this.props = {};\n this.props[a.name] = a;\n this.props[b.name] = b;\n}\n\n/**\n * Binds one side of a bi-directional reference to a\n * target object.\n *\n * @memberOf Refs\n *\n * @param {Object} target\n * @param {String} property\n */\nRefs.prototype.bind = function (target, property) {\n if (typeof property === 'string') {\n if (!this.props[property]) {\n throw new Error('no property <' + property + '> in ref');\n }\n property = this.props[property];\n }\n if (property.collection) {\n defineCollectionProperty(this, property, target);\n } else {\n defineProperty(this, property, target);\n }\n};\nRefs.prototype.ensureRefsCollection = function (target, property) {\n var collection = target[property.name];\n if (!isExtended(collection)) {\n defineCollectionProperty(this, property, target);\n }\n return collection;\n};\nRefs.prototype.ensureBound = function (target, property) {\n if (!hasOwnProperty(target, property)) {\n this.bind(target, property);\n }\n};\nRefs.prototype.unset = function (target, property, value) {\n if (target) {\n this.ensureBound(target, property);\n if (property.collection) {\n this.ensureRefsCollection(target, property).remove(value);\n } else {\n target[property.name] = undefined;\n }\n }\n};\nRefs.prototype.set = function (target, property, value) {\n if (target) {\n this.ensureBound(target, property);\n if (property.collection) {\n this.ensureRefsCollection(target, property).add(value);\n } else {\n target[property.name] = value;\n }\n }\n};\n\n/**\n * An attribute descriptor to be used specify an attribute in a {@link Refs} instance\n *\n * @typedef {Object} Refs.AttributeDescriptor\n * @property {String} name\n * @property {boolean} [collection=false]\n * @property {boolean} [enumerable=false]\n */\n\nexport { collection as Collection, Refs };\n","import { assign } from 'min-dash';\nimport inherits from 'inherits-browser';\n\nimport { Refs } from 'object-refs';\n\nvar parentRefs = new Refs({ name: 'children', enumerable: true, collection: true }, { name: 'parent' }),\n labelRefs = new Refs({ name: 'labels', enumerable: true, collection: true }, { name: 'labelTarget' }),\n attacherRefs = new Refs({ name: 'attachers', collection: true }, { name: 'host' }),\n outgoingRefs = new Refs({ name: 'outgoing', collection: true }, { name: 'source' }),\n incomingRefs = new Refs({ name: 'incoming', collection: true }, { name: 'target' });\n\n/**\n * @typedef {import('./Types').Element} Element\n * @typedef {import('./Types').Shape} Shape\n * @typedef {import('./Types').Root} Root\n * @typedef {import('./Types').Label} Label\n * @typedef {import('./Types').Connection} Connection\n */\n\n/**\n * The basic graphical representation\n *\n * @class\n * @constructor\n */\nfunction ElementImpl() {\n\n /**\n * The object that backs up the shape\n *\n * @name Element#businessObject\n * @type Object\n */\n Object.defineProperty(this, 'businessObject', {\n writable: true\n });\n\n\n /**\n * Single label support, will mapped to multi label array\n *\n * @name Element#label\n * @type Object\n */\n Object.defineProperty(this, 'label', {\n get: function() {\n return this.labels[0];\n },\n set: function(newLabel) {\n\n var label = this.label,\n labels = this.labels;\n\n if (!newLabel && label) {\n labels.remove(label);\n } else {\n labels.add(newLabel, 0);\n }\n }\n });\n\n /**\n * The parent shape\n *\n * @name Element#parent\n * @type Shape\n */\n parentRefs.bind(this, 'parent');\n\n /**\n * The list of labels\n *\n * @name Element#labels\n * @type Label\n */\n labelRefs.bind(this, 'labels');\n\n /**\n * The list of outgoing connections\n *\n * @name Element#outgoing\n * @type Array\n */\n outgoingRefs.bind(this, 'outgoing');\n\n /**\n * The list of incoming connections\n *\n * @name Element#incoming\n * @type Array\n */\n incomingRefs.bind(this, 'incoming');\n}\n\n\n/**\n * A graphical object\n *\n * @class\n * @constructor\n *\n * @extends ElementImpl\n */\nfunction ShapeImpl() {\n ElementImpl.call(this);\n\n /**\n * Indicates frame shapes\n *\n * @name ShapeImpl#isFrame\n * @type boolean\n */\n\n /**\n * The list of children\n *\n * @name ShapeImpl#children\n * @type Element[]\n */\n parentRefs.bind(this, 'children');\n\n /**\n * @name ShapeImpl#host\n * @type Shape\n */\n attacherRefs.bind(this, 'host');\n\n /**\n * @name ShapeImpl#attachers\n * @type Shape\n */\n attacherRefs.bind(this, 'attachers');\n}\n\ninherits(ShapeImpl, ElementImpl);\n\n\n/**\n * A root graphical object\n *\n * @class\n * @constructor\n *\n * @extends ElementImpl\n */\nfunction RootImpl() {\n ElementImpl.call(this);\n\n /**\n * The list of children\n *\n * @name RootImpl#children\n * @type Element[]\n */\n parentRefs.bind(this, 'children');\n}\n\ninherits(RootImpl, ShapeImpl);\n\n\n/**\n * A label for an element\n *\n * @class\n * @constructor\n *\n * @extends ShapeImpl\n */\nfunction LabelImpl() {\n ShapeImpl.call(this);\n\n /**\n * The labeled element\n *\n * @name LabelImpl#labelTarget\n * @type Element\n */\n labelRefs.bind(this, 'labelTarget');\n}\n\ninherits(LabelImpl, ShapeImpl);\n\n\n/**\n * A connection between two elements\n *\n * @class\n * @constructor\n *\n * @extends ElementImpl\n */\nfunction ConnectionImpl() {\n ElementImpl.call(this);\n\n /**\n * The element this connection originates from\n *\n * @name ConnectionImpl#source\n * @type Element\n */\n outgoingRefs.bind(this, 'source');\n\n /**\n * The element this connection points to\n *\n * @name ConnectionImpl#target\n * @type Element\n */\n incomingRefs.bind(this, 'target');\n}\n\ninherits(ConnectionImpl, ElementImpl);\n\n\nvar types = {\n connection: ConnectionImpl,\n shape: ShapeImpl,\n label: LabelImpl,\n root: RootImpl\n};\n\n/**\n * Creates a root element.\n *\n * @overlord\n *\n * @example\n *\n * ```javascript\n * import * as Model from 'diagram-js/lib/model';\n *\n * const root = Model.create('root', {\n * x: 100,\n * y: 100,\n * width: 100,\n * height: 100\n * });\n * ```\n *\n * @param {'root'} type\n * @param {any} [attrs]\n *\n * @return {Root}\n */\n\n/**\n * Creates a connection.\n *\n * @overlord\n *\n * @example\n *\n * ```javascript\n * import * as Model from 'diagram-js/lib/model';\n *\n * const connection = Model.create('connection', {\n * waypoints: [\n * { x: 100, y: 100 },\n * { x: 200, y: 100 }\n * ]\n * });\n * ```\n *\n * @param {'connection'} type\n * @param {any} [attrs]\n *\n * @return {Connection}\n */\n\n/**\n * Creates a shape.\n *\n * @overlord\n *\n * @example\n *\n * ```javascript\n * import * as Model from 'diagram-js/lib/model';\n *\n * const shape = Model.create('shape', {\n * x: 100,\n * y: 100,\n * width: 100,\n * height: 100\n * });\n * ```\n *\n * @param {'shape'} type\n * @param {any} [attrs]\n *\n * @return {Shape}\n */\n\n/**\n * Creates a label.\n *\n * @example\n *\n * ```javascript\n * import * as Model from 'diagram-js/lib/model';\n *\n * const label = Model.create('label', {\n * x: 100,\n * y: 100,\n * width: 100,\n * height: 100,\n * labelTarget: shape\n * });\n * ```\n *\n * @param {'label'} type\n * @param {Object} [attrs]\n *\n * @return {Label}\n */\nexport function create(type, attrs) {\n var Type = types[type];\n if (!Type) {\n throw new Error('unknown type: <' + type + '>');\n }\n return assign(new Type(), attrs);\n}\n\n/**\n * Checks whether an object is a model instance.\n *\n * @param {any} obj\n *\n * @return {boolean}\n */\nexport function isModelElement(obj) {\n return obj instanceof ElementImpl;\n}","import {\n create\n} from '../model';\n\nimport { assign } from 'min-dash';\n\n/**\n * @typedef {import('../model/Types').Element} Element\n * @typedef {import('../model/Types').Connection} Connection\n * @typedef {import('../model/Types').Label} Label\n * @typedef {import('../model/Types').Root} Root\n * @typedef {import('../model/Types').Shape} Shape\n */\n\n/**\n * A factory for model elements.\n *\n * @template {Connection} [T=Connection]\n * @template {Label} [U=Label]\n * @template {Root} [V=Root]\n * @template {Shape} [W=Shape]\n */\nexport default function ElementFactory() {\n this._uid = 12;\n}\n\n/**\n * Create a root element.\n *\n * @param {Partial} [attrs]\n *\n * @return {V} The created root element.\n */\nElementFactory.prototype.createRoot = function(attrs) {\n return this.create('root', attrs);\n};\n\n/**\n * Create a label.\n *\n * @param {Partial} [attrs]\n *\n * @return {U} The created label.\n */\nElementFactory.prototype.createLabel = function(attrs) {\n return this.create('label', attrs);\n};\n\n/**\n * Create a shape.\n *\n * @param {Partial} [attrs]\n *\n * @return {W} The created shape.\n */\nElementFactory.prototype.createShape = function(attrs) {\n return this.create('shape', attrs);\n};\n\n/**\n * Create a connection.\n *\n * @param {Partial} [attrs]\n *\n * @return {T} The created connection.\n */\nElementFactory.prototype.createConnection = function(attrs) {\n return this.create('connection', attrs);\n};\n\n/**\n * Create a root element.\n *\n * @overlord\n * @param {'root'} type\n * @param {Partial} [attrs]\n * @return {V}\n */\n/**\n * Create a shape.\n *\n * @overlord\n * @param {'shape'} type\n * @param {Partial} [attrs]\n * @return {W}\n */\n/**\n * Create a connection.\n *\n * @overlord\n * @param {'connection'} type\n * @param {Partial} [attrs]\n * @return {T}\n */\n/**\n * Create a label.\n *\n * @param {'label'} type\n * @param {Partial} [attrs]\n * @return {U}\n */\nElementFactory.prototype.create = function(type, attrs) {\n\n attrs = assign({}, attrs || {});\n\n if (!attrs.id) {\n attrs.id = type + '_' + (this._uid++);\n }\n\n return create(type, attrs);\n};","import {\n isFunction,\n isArray,\n isNumber,\n bind,\n assign\n} from 'min-dash';\n\nvar FN_REF = '__fn';\n\nvar DEFAULT_PRIORITY = 1000;\n\nvar slice = Array.prototype.slice;\n\n/**\n * @typedef { {\n * stopPropagation(): void;\n * preventDefault(): void;\n * cancelBubble: boolean;\n * defaultPrevented: boolean;\n * returnValue: any;\n * } } Event\n */\n\n/**\n * @template E\n *\n * @typedef { (event: E & Event, ...any) => any } EventBusEventCallback\n */\n\n/**\n * @typedef { {\n * priority: number;\n * next: EventBusListener | null;\n * callback: EventBusEventCallback;\n * } } EventBusListener\n */\n\n/**\n * A general purpose event bus.\n *\n * This component is used to communicate across a diagram instance.\n * Other parts of a diagram can use it to listen to and broadcast events.\n *\n *\n * ## Registering for Events\n *\n * The event bus provides the {@link EventBus#on} and {@link EventBus#once}\n * methods to register for events. {@link EventBus#off} can be used to\n * remove event registrations. Listeners receive an instance of {@link Event}\n * as the first argument. It allows them to hook into the event execution.\n *\n * ```javascript\n *\n * // listen for event\n * eventBus.on('foo', function(event) {\n *\n * // access event type\n * event.type; // 'foo'\n *\n * // stop propagation to other listeners\n * event.stopPropagation();\n *\n * // prevent event default\n * event.preventDefault();\n * });\n *\n * // listen for event with custom payload\n * eventBus.on('bar', function(event, payload) {\n * console.log(payload);\n * });\n *\n * // listen for event returning value\n * eventBus.on('foobar', function(event) {\n *\n * // stop event propagation + prevent default\n * return false;\n *\n * // stop event propagation + return custom result\n * return {\n * complex: 'listening result'\n * };\n * });\n *\n *\n * // listen with custom priority (default=1000, higher is better)\n * eventBus.on('priorityfoo', 1500, function(event) {\n * console.log('invoked first!');\n * });\n *\n *\n * // listen for event and pass the context (`this`)\n * eventBus.on('foobar', function(event) {\n * this.foo();\n * }, this);\n * ```\n *\n *\n * ## Emitting Events\n *\n * Events can be emitted via the event bus using {@link EventBus#fire}.\n *\n * ```javascript\n *\n * // false indicates that the default action\n * // was prevented by listeners\n * if (eventBus.fire('foo') === false) {\n * console.log('default has been prevented!');\n * };\n *\n *\n * // custom args + return value listener\n * eventBus.on('sum', function(event, a, b) {\n * return a + b;\n * });\n *\n * // you can pass custom arguments + retrieve result values.\n * var sum = eventBus.fire('sum', 1, 2);\n * console.log(sum); // 3\n * ```\n */\nexport default function EventBus() {\n\n /**\n * @type { Record }\n */\n this._listeners = {};\n\n // cleanup on destroy on lowest priority to allow\n // message passing until the bitter end\n this.on('diagram.destroy', 1, this._destroy, this);\n}\n\n\n/**\n * Register an event listener for events with the given name.\n *\n * The callback will be invoked with `event, ...additionalArguments`\n * that have been passed to {@link EventBus#fire}.\n *\n * Returning false from a listener will prevent the events default action\n * (if any is specified). To stop an event from being processed further in\n * other listeners execute {@link Event#stopPropagation}.\n *\n * Returning anything but `undefined` from a listener will stop the listener propagation.\n *\n * @template T\n *\n * @param {string|string[]} events to subscribe to\n * @param {number} [priority=1000] listen priority\n * @param {EventBusEventCallback} callback\n * @param {any} [that] callback context\n */\nEventBus.prototype.on = function(events, priority, callback, that) {\n\n events = isArray(events) ? events : [ events ];\n\n if (isFunction(priority)) {\n that = callback;\n callback = priority;\n priority = DEFAULT_PRIORITY;\n }\n\n if (!isNumber(priority)) {\n throw new Error('priority must be a number');\n }\n\n var actualCallback = callback;\n\n if (that) {\n actualCallback = bind(callback, that);\n\n // make sure we remember and are able to remove\n // bound callbacks via {@link #off} using the original\n // callback\n actualCallback[FN_REF] = callback[FN_REF] || callback;\n }\n\n var self = this;\n\n events.forEach(function(e) {\n self._addListener(e, {\n priority: priority,\n callback: actualCallback,\n next: null\n });\n });\n};\n\n/**\n * Register an event listener that is called only once.\n *\n * @template T\n *\n * @param {string|string[]} events to subscribe to\n * @param {number} [priority=1000] the listen priority\n * @param {EventBusEventCallback} callback\n * @param {any} [that] callback context\n */\nEventBus.prototype.once = function(events, priority, callback, that) {\n var self = this;\n\n if (isFunction(priority)) {\n that = callback;\n callback = priority;\n priority = DEFAULT_PRIORITY;\n }\n\n if (!isNumber(priority)) {\n throw new Error('priority must be a number');\n }\n\n function wrappedCallback() {\n wrappedCallback.__isTomb = true;\n\n var result = callback.apply(that, arguments);\n\n self.off(events, wrappedCallback);\n\n return result;\n }\n\n // make sure we remember and are able to remove\n // bound callbacks via {@link #off} using the original\n // callback\n wrappedCallback[FN_REF] = callback;\n\n this.on(events, priority, wrappedCallback);\n};\n\n\n/**\n * Removes event listeners by event and callback.\n *\n * If no callback is given, all listeners for a given event name are being removed.\n *\n * @param {string|string[]} events\n * @param {EventBusEventCallback} [callback]\n */\nEventBus.prototype.off = function(events, callback) {\n\n events = isArray(events) ? events : [ events ];\n\n var self = this;\n\n events.forEach(function(event) {\n self._removeListener(event, callback);\n });\n\n};\n\n\n/**\n * Create an event recognized be the event bus.\n *\n * @param {Object} data Event data.\n *\n * @return {Event} An event that will be recognized by the event bus.\n */\nEventBus.prototype.createEvent = function(data) {\n var event = new InternalEvent();\n\n event.init(data);\n\n return event;\n};\n\n\n/**\n * Fires an event.\n *\n * @example\n *\n * ```javascript\n * // fire event by name\n * events.fire('foo');\n *\n * // fire event object with nested type\n * var event = { type: 'foo' };\n * events.fire(event);\n *\n * // fire event with explicit type\n * var event = { x: 10, y: 20 };\n * events.fire('element.moved', event);\n *\n * // pass additional arguments to the event\n * events.on('foo', function(event, bar) {\n * alert(bar);\n * });\n *\n * events.fire({ type: 'foo' }, 'I am bar!');\n * ```\n *\n * @param {string} [type] event type\n * @param {Object} [data] event or event data\n * @param {...any} [args] additional arguments the callback will be called with.\n *\n * @return {any} The return value. Will be set to `false` if the default was prevented.\n */\nEventBus.prototype.fire = function(type, data) {\n var event,\n firstListener,\n returnValue,\n args;\n\n args = slice.call(arguments);\n\n if (typeof type === 'object') {\n data = type;\n type = data.type;\n }\n\n if (!type) {\n throw new Error('no event type specified');\n }\n\n firstListener = this._listeners[type];\n\n if (!firstListener) {\n return;\n }\n\n // we make sure we fire instances of our home made\n // events here. We wrap them only once, though\n if (data instanceof InternalEvent) {\n\n // we are fine, we alread have an event\n event = data;\n } else {\n event = this.createEvent(data);\n }\n\n // ensure we pass the event as the first parameter\n args[0] = event;\n\n // original event type (in case we delegate)\n var originalType = event.type;\n\n // update event type before delegation\n if (type !== originalType) {\n event.type = type;\n }\n\n try {\n returnValue = this._invokeListeners(event, args, firstListener);\n } finally {\n\n // reset event type after delegation\n if (type !== originalType) {\n event.type = originalType;\n }\n }\n\n // set the return value to false if the event default\n // got prevented and no other return value exists\n if (returnValue === undefined && event.defaultPrevented) {\n returnValue = false;\n }\n\n return returnValue;\n};\n\n/**\n * Handle an error by firing an event.\n *\n * @param {Error} error The error to be handled.\n *\n * @return {boolean} Whether the error was handled.\n */\nEventBus.prototype.handleError = function(error) {\n return this.fire('error', { error: error }) === false;\n};\n\n\nEventBus.prototype._destroy = function() {\n this._listeners = {};\n};\n\n/**\n * @param {Event} event\n * @param {any[]} args\n * @param {EventBusListener} listener\n *\n * @return {any}\n */\nEventBus.prototype._invokeListeners = function(event, args, listener) {\n\n var returnValue;\n\n while (listener) {\n\n // handle stopped propagation\n if (event.cancelBubble) {\n break;\n }\n\n returnValue = this._invokeListener(event, args, listener);\n\n listener = listener.next;\n }\n\n return returnValue;\n};\n\n/**\n * @param {Event} event\n * @param {any[]} args\n * @param {EventBusListener} listener\n *\n * @return {any}\n */\nEventBus.prototype._invokeListener = function(event, args, listener) {\n\n var returnValue;\n\n if (listener.callback.__isTomb) {\n return returnValue;\n }\n\n try {\n\n // returning false prevents the default action\n returnValue = invokeFunction(listener.callback, args);\n\n // stop propagation on return value\n if (returnValue !== undefined) {\n event.returnValue = returnValue;\n event.stopPropagation();\n }\n\n // prevent default on return false\n if (returnValue === false) {\n event.preventDefault();\n }\n } catch (error) {\n if (!this.handleError(error)) {\n console.error('unhandled error in event listener', error);\n\n throw error;\n }\n }\n\n return returnValue;\n};\n\n/**\n * Add new listener with a certain priority to the list\n * of listeners (for the given event).\n *\n * The semantics of listener registration / listener execution are\n * first register, first serve: New listeners will always be inserted\n * after existing listeners with the same priority.\n *\n * Example: Inserting two listeners with priority 1000 and 1300\n *\n * * before: [ 1500, 1500, 1000, 1000 ]\n * * after: [ 1500, 1500, (new=1300), 1000, 1000, (new=1000) ]\n *\n * @param {string} event\n * @param {EventBusListener} newListener\n */\nEventBus.prototype._addListener = function(event, newListener) {\n\n var listener = this._getListeners(event),\n previousListener;\n\n // no prior listeners\n if (!listener) {\n this._setListeners(event, newListener);\n\n return;\n }\n\n // ensure we order listeners by priority from\n // 0 (high) to n > 0 (low)\n while (listener) {\n\n if (listener.priority < newListener.priority) {\n\n newListener.next = listener;\n\n if (previousListener) {\n previousListener.next = newListener;\n } else {\n this._setListeners(event, newListener);\n }\n\n return;\n }\n\n previousListener = listener;\n listener = listener.next;\n }\n\n // add new listener to back\n previousListener.next = newListener;\n};\n\n\n/**\n * @param {string} name\n *\n * @return {EventBusListener}\n */\nEventBus.prototype._getListeners = function(name) {\n return this._listeners[name];\n};\n\n/**\n * @param {string} name\n * @param {EventBusListener} listener\n */\nEventBus.prototype._setListeners = function(name, listener) {\n this._listeners[name] = listener;\n};\n\nEventBus.prototype._removeListener = function(event, callback) {\n\n var listener = this._getListeners(event),\n nextListener,\n previousListener,\n listenerCallback;\n\n if (!callback) {\n\n // clear listeners\n this._setListeners(event, null);\n\n return;\n }\n\n while (listener) {\n\n nextListener = listener.next;\n\n listenerCallback = listener.callback;\n\n if (listenerCallback === callback || listenerCallback[FN_REF] === callback) {\n if (previousListener) {\n previousListener.next = nextListener;\n } else {\n\n // new first listener\n this._setListeners(event, nextListener);\n }\n }\n\n previousListener = listener;\n listener = nextListener;\n }\n};\n\n/**\n * A event that is emitted via the event bus.\n */\nfunction InternalEvent() { }\n\nInternalEvent.prototype.stopPropagation = function() {\n this.cancelBubble = true;\n};\n\nInternalEvent.prototype.preventDefault = function() {\n this.defaultPrevented = true;\n};\n\nInternalEvent.prototype.init = function(data) {\n assign(this, data || {});\n};\n\n\n/**\n * Invoke function. Be fast...\n *\n * @param {Function} fn\n * @param {any[]} args\n *\n * @return {any}\n */\nfunction invokeFunction(fn, args) {\n return fn.apply(null, args);\n}\n","/**\n * SVGs for elements are generated by the {@link GraphicsFactory}.\n *\n * This utility gives quick access to the important semantic\n * parts of an element.\n */\n\n/**\n * Returns the visual part of a diagram element.\n *\n * @param {SVGElement} gfx\n *\n * @return {SVGElement}\n */\nexport function getVisual(gfx) {\n return gfx.childNodes[0];\n}\n\n/**\n * Returns the children for a given diagram element.\n *\n * @param {SVGElement} gfx\n * @return {SVGElement}\n */\nexport function getChildren(gfx) {\n return gfx.parentNode.childNodes[1];\n}","import {\r\n transform as svgTransform,\r\n createTransform\r\n} from 'tiny-svg';\r\n\r\n\r\n/**\r\n * @param {SVGElement} gfx\r\n * @param {number} x\r\n * @param {number} y\r\n * @param {number} [angle]\r\n * @param {number} [amount]\r\n */\r\nexport function transform(gfx, x, y, angle, amount) {\r\n var translate = createTransform();\r\n translate.setTranslate(x, y);\r\n\r\n var rotate = createTransform();\r\n rotate.setRotate(angle || 0, 0, 0);\r\n\r\n var scale = createTransform();\r\n scale.setScale(amount || 1, amount || 1);\r\n\r\n svgTransform(gfx, [ translate, rotate, scale ]);\r\n}\r\n\r\n\r\n/**\r\n * @param {SVGElement} gfx\r\n * @param {number} x\r\n * @param {number} y\r\n */\r\nexport function translate(gfx, x, y) {\r\n var translate = createTransform();\r\n translate.setTranslate(x, y);\r\n\r\n svgTransform(gfx, translate);\r\n}\r\n\r\n\r\n/**\r\n * @param {SVGElement} gfx\r\n * @param {number} angle\r\n */\r\nexport function rotate(gfx, angle) {\r\n var rotate = createTransform();\r\n rotate.setRotate(angle, 0, 0);\r\n\r\n svgTransform(gfx, rotate);\r\n}\r\n\r\n\r\n/**\r\n * @param {SVGElement} gfx\r\n * @param {number} amount\r\n */\r\nexport function scale(gfx, amount) {\r\n var scale = createTransform();\r\n scale.setScale(amount, amount);\r\n\r\n svgTransform(gfx, scale);\r\n}\r\n","import {\n forEach,\n reduce\n} from 'min-dash';\n\nimport {\n getChildren,\n getVisual\n} from '../util/GraphicsUtil';\n\nimport { translate } from '../util/SvgTransformUtil';\n\nimport { clear as domClear } from 'min-dom';\n\nimport {\n append as svgAppend,\n attr as svgAttr,\n classes as svgClasses,\n create as svgCreate,\n remove as svgRemove\n} from 'tiny-svg';\n\nimport {\n isFrameElement\n} from '../util/Elements';\n\n/**\n * @typedef {import('./Types').ConnectionLike} ConnectionLike\n * @typedef {import('./Types').ElementLike} ElementLike\n * @typedef {import('./Types').ShapeLike} ShapeLike\n *\n * @typedef {import('./ElementRegistry').default} ElementRegistry\n * @typedef {import('./EventBus').default} EventBus\n */\n\n/**\n * A factory that creates graphical elements.\n *\n * @param {EventBus} eventBus\n * @param {ElementRegistry} elementRegistry\n */\nexport default function GraphicsFactory(eventBus, elementRegistry) {\n this._eventBus = eventBus;\n this._elementRegistry = elementRegistry;\n}\n\nGraphicsFactory.$inject = [ 'eventBus' , 'elementRegistry' ];\n\n/**\n * @param { { parent?: any } } element\n * @return {SVGElement}\n */\nGraphicsFactory.prototype._getChildrenContainer = function(element) {\n\n var gfx = this._elementRegistry.getGraphics(element);\n\n var childrenGfx;\n\n // root element\n if (!element.parent) {\n childrenGfx = gfx;\n } else {\n childrenGfx = getChildren(gfx);\n if (!childrenGfx) {\n childrenGfx = svgCreate('g');\n svgClasses(childrenGfx).add('djs-children');\n\n svgAppend(gfx.parentNode, childrenGfx);\n }\n }\n\n return childrenGfx;\n};\n\n/**\n * Clears the graphical representation of the element and returns the\n * cleared visual (the element).\n */\nGraphicsFactory.prototype._clear = function(gfx) {\n var visual = getVisual(gfx);\n\n domClear(visual);\n\n return visual;\n};\n\n/**\n * Creates a gfx container for shapes and connections\n *\n * The layout is as follows:\n *\n * \n *\n * \n * \n * \n * \n * \n *\n * \n * \n * \n *\n * @param {string} type the type of the element, i.e. shape | connection\n * @param {SVGElement} childrenGfx\n * @param {number} [parentIndex] position to create container in parent\n * @param {boolean} [isFrame] is frame element\n *\n * @return {SVGElement}\n */\nGraphicsFactory.prototype._createContainer = function(\n type, childrenGfx, parentIndex, isFrame\n) {\n var outerGfx = svgCreate('g');\n svgClasses(outerGfx).add('djs-group');\n\n // insert node at position\n if (typeof parentIndex !== 'undefined') {\n prependTo(outerGfx, childrenGfx, childrenGfx.childNodes[parentIndex]);\n } else {\n svgAppend(childrenGfx, outerGfx);\n }\n\n var gfx = svgCreate('g');\n svgClasses(gfx).add('djs-element');\n svgClasses(gfx).add('djs-' + type);\n\n if (isFrame) {\n svgClasses(gfx).add('djs-frame');\n }\n\n svgAppend(outerGfx, gfx);\n\n // create visual\n var visual = svgCreate('g');\n svgClasses(visual).add('djs-visual');\n\n svgAppend(gfx, visual);\n\n return gfx;\n};\n\n/**\n * Create a graphical element.\n *\n * @param { 'shape' | 'connection' | 'label' | 'root' } type The type of the element.\n * @param {ElementLike} element The element.\n * @param {number} [parentIndex] The index at which to add the graphical element to its parent's children.\n *\n * @return {SVGElement} The graphical element.\n */\nGraphicsFactory.prototype.create = function(type, element, parentIndex) {\n var childrenGfx = this._getChildrenContainer(element.parent);\n return this._createContainer(type, childrenGfx, parentIndex, isFrameElement(element));\n};\n\n/**\n * Update the containments of the given elements.\n *\n * @param {ElementLike[]} elements The elements.\n */\nGraphicsFactory.prototype.updateContainments = function(elements) {\n\n var self = this,\n elementRegistry = this._elementRegistry,\n parents;\n\n parents = reduce(elements, function(map, e) {\n\n if (e.parent) {\n map[e.parent.id] = e.parent;\n }\n\n return map;\n }, {});\n\n // update all parents of changed and reorganized their children\n // in the correct order (as indicated in our model)\n forEach(parents, function(parent) {\n\n var children = parent.children;\n\n if (!children) {\n return;\n }\n\n var childrenGfx = self._getChildrenContainer(parent);\n\n forEach(children.slice().reverse(), function(child) {\n var childGfx = elementRegistry.getGraphics(child);\n\n prependTo(childGfx.parentNode, childrenGfx);\n });\n });\n};\n\n/**\n * Draw a shape.\n *\n * @param {SVGElement} visual The graphical element.\n * @param {ShapeLike} element The shape.\n * @param {Object} attrs Optional attributes.\n *\n * @return {SVGElement}\n */\nGraphicsFactory.prototype.drawShape = function(visual, element, attrs = {}) {\n var eventBus = this._eventBus;\n\n return eventBus.fire('render.shape', { gfx: visual, element, attrs });\n};\n\n/**\n * Get the path of a shape.\n *\n * @param {ShapeLike} element The shape.\n *\n * @return {string} The path of the shape.\n */\nGraphicsFactory.prototype.getShapePath = function(element) {\n var eventBus = this._eventBus;\n\n return eventBus.fire('render.getShapePath', element);\n};\n\n/**\n * Draw a connection.\n *\n * @param {SVGElement} visual The graphical element.\n * @param {ConnectionLike} element The connection.\n * @param {Object} attrs Optional attributes.\n *\n * @return {SVGElement}\n */\nGraphicsFactory.prototype.drawConnection = function(visual, element, attrs = {}) {\n var eventBus = this._eventBus;\n\n return eventBus.fire('render.connection', { gfx: visual, element, attrs });\n};\n\n/**\n * Get the path of a connection.\n *\n * @param {ConnectionLike} connection The connection.\n *\n * @return {string} The path of the connection.\n */\nGraphicsFactory.prototype.getConnectionPath = function(connection) {\n var eventBus = this._eventBus;\n\n return eventBus.fire('render.getConnectionPath', connection);\n};\n\n/**\n * Update an elements graphical representation.\n *\n * @param {'shape'|'connection'} type\n * @param {ElementLike} element\n * @param {SVGElement} gfx\n */\nGraphicsFactory.prototype.update = function(type, element, gfx) {\n\n // do NOT update root element\n if (!element.parent) {\n return;\n }\n\n var visual = this._clear(gfx);\n\n // redraw\n if (type === 'shape') {\n this.drawShape(visual, element);\n\n // update positioning\n translate(gfx, element.x, element.y);\n } else\n if (type === 'connection') {\n this.drawConnection(visual, element);\n } else {\n throw new Error('unknown type: ' + type);\n }\n\n if (element.hidden) {\n svgAttr(gfx, 'display', 'none');\n } else {\n svgAttr(gfx, 'display', 'block');\n }\n};\n\n/**\n * Remove a graphical element.\n *\n * @param {ElementLike} element The element.\n */\nGraphicsFactory.prototype.remove = function(element) {\n var gfx = this._elementRegistry.getGraphics(element);\n\n // remove\n svgRemove(gfx.parentNode);\n};\n\n\n// helpers //////////\n\nfunction prependTo(newNode, parentNode, siblingNode) {\n var node = siblingNode || parentNode.firstChild;\n\n // do not prepend node to itself to prevent IE from crashing\n // https://github.com/bpmn-io/bpmn-js/issues/746\n if (newNode === node) {\n return;\n }\n\n parentNode.insertBefore(newNode, node);\n}\n","import DrawModule from '../draw';\n\nimport Canvas from './Canvas';\nimport ElementRegistry from './ElementRegistry';\nimport ElementFactory from './ElementFactory';\nimport EventBus from './EventBus';\nimport GraphicsFactory from './GraphicsFactory';\n\n/**\n * @type { import('didi').ModuleDeclaration }\n */\nexport default {\n __depends__: [ DrawModule ],\n __init__: [ 'canvas' ],\n canvas: [ 'type', Canvas ],\n elementRegistry: [ 'type', ElementRegistry ],\n elementFactory: [ 'type', ElementFactory ],\n eventBus: [ 'type', EventBus ],\n graphicsFactory: [ 'type', GraphicsFactory ]\n};","import { Injector } from 'didi';\n\nimport CoreModule from './core';\n\n/**\n * @typedef {import('didi').InjectionContext} InjectionContext\n * @typedef {import('didi').LocalsMap} LocalsMap\n * @typedef {import('didi').ModuleDeclaration} ModuleDeclaration\n *\n * @typedef { {\n * modules?: ModuleDeclaration[];\n * } & Record } DiagramOptions\n */\n\n/**\n * Bootstrap an injector from a list of modules, instantiating a number of default components\n *\n * @param {ModuleDeclaration[]} modules\n *\n * @return {Injector} a injector to use to access the components\n */\nfunction bootstrap(modules) {\n var injector = new Injector(modules);\n\n injector.init();\n\n return injector;\n}\n\n/**\n * Creates an injector from passed options.\n *\n * @param {DiagramOptions} [options]\n *\n * @return {Injector}\n */\nfunction createInjector(options) {\n\n options = options || {};\n\n /**\n * @type { ModuleDeclaration }\n */\n var configModule = {\n 'config': [ 'value', options ]\n };\n\n var modules = [ configModule, CoreModule ].concat(options.modules || []);\n\n return bootstrap(modules);\n}\n\n\n/**\n * The main diagram-js entry point that bootstraps the diagram with the given\n * configuration.\n *\n * To register extensions with the diagram, pass them as Array to the constructor.\n *\n * @class\n * @constructor\n *\n * @example Creating a plug-in that logs whenever a shape is added to the canvas.\n *\n * ```javascript\n * // plug-in implementation\n * function MyLoggingPlugin(eventBus) {\n * eventBus.on('shape.added', function(event) {\n * console.log('shape ', event.shape, ' was added to the diagram');\n * });\n * }\n *\n * // export as module\n * export default {\n * __init__: [ 'myLoggingPlugin' ],\n * myLoggingPlugin: [ 'type', MyLoggingPlugin ]\n * };\n * ```\n *\n * Use the plug-in in a Diagram instance:\n *\n * ```javascript\n * import MyLoggingModule from 'path-to-my-logging-plugin';\n *\n * var diagram = new Diagram({\n * modules: [\n * MyLoggingModule\n * ]\n * });\n *\n * diagram.invoke([ 'canvas', function(canvas) {\n * // add shape to drawing canvas\n * canvas.addShape({ x: 10, y: 10 });\n * });\n *\n * // 'shape ... was added to the diagram' logged to console\n * ```\n *\n * @param {DiagramOptions} [options]\n * @param {Injector} [injector] An (optional) injector to bootstrap the diagram with.\n */\nexport default function Diagram(options, injector) {\n\n this._injector = injector = injector || createInjector(options);\n\n // API\n\n /**\n * Resolves a diagram service.\n *\n * @template T\n *\n * @param {string} name The name of the service to get.\n * @param {boolean} [strict=true] If false, resolve missing services to null.\n *\n * @return {T|null}\n */\n this.get = injector.get;\n\n /**\n * Executes a function with its dependencies injected.\n *\n * @template T\n *\n * @param {Function} func function to be invoked\n * @param {InjectionContext} [context] context of the invocation\n * @param {LocalsMap} [locals] locals provided\n *\n * @return {T|null}\n */\n this.invoke = injector.invoke;\n\n // init\n\n // indicate via event\n\n\n /**\n * An event indicating that all plug-ins are loaded.\n *\n * Use this event to fire other events to interested plug-ins\n *\n * @memberOf Diagram\n *\n * @event diagram.init\n *\n * @example\n *\n * ```javascript\n * eventBus.on('diagram.init', function() {\n * eventBus.fire('my-custom-event', { foo: 'BAR' });\n * });\n * ```\n *\n * @type {Object}\n */\n this.get('eventBus').fire('diagram.init');\n}\n\n\n/**\n * Destroys the diagram\n */\nDiagram.prototype.destroy = function() {\n this.get('eventBus').fire('diagram.destroy');\n};\n\n/**\n * Clear the diagram, removing all contents.\n */\nDiagram.prototype.clear = function() {\n this.get('eventBus').fire('diagram.clear');\n};\n","import { forEach, bind, pick, assign, isString, isObject, set } from 'min-dash';\n\n/**\n * Moddle base element.\n */\nfunction Base() { }\n\nBase.prototype.get = function(name) {\n return this.$model.properties.get(this, name);\n};\n\nBase.prototype.set = function(name, value) {\n this.$model.properties.set(this, name, value);\n};\n\n/**\n * A model element factory.\n *\n * @param {Moddle} model\n * @param {Properties} properties\n */\nfunction Factory(model, properties) {\n this.model = model;\n this.properties = properties;\n}\n\n\nFactory.prototype.createType = function(descriptor) {\n\n var model = this.model;\n\n var props = this.properties,\n prototype = Object.create(Base.prototype);\n\n // initialize default values\n forEach(descriptor.properties, function(p) {\n if (!p.isMany && p.default !== undefined) {\n prototype[p.name] = p.default;\n }\n });\n\n props.defineModel(prototype, model);\n props.defineDescriptor(prototype, descriptor);\n\n var name = descriptor.ns.name;\n\n /**\n * The new type constructor\n */\n function ModdleElement(attrs) {\n props.define(this, '$type', { value: name, enumerable: true });\n props.define(this, '$attrs', { value: {} });\n props.define(this, '$parent', { writable: true });\n\n forEach(attrs, bind(function(val, key) {\n this.set(key, val);\n }, this));\n }\n\n ModdleElement.prototype = prototype;\n\n ModdleElement.hasType = prototype.$instanceOf = this.model.hasType;\n\n // static links\n props.defineModel(ModdleElement, model);\n props.defineDescriptor(ModdleElement, descriptor);\n\n return ModdleElement;\n};\n\n/**\n * Built-in moddle types\n */\nvar BUILTINS = {\n String: true,\n Boolean: true,\n Integer: true,\n Real: true,\n Element: true\n};\n\n/**\n * Converters for built in types from string representations\n */\nvar TYPE_CONVERTERS = {\n String: function(s) { return s; },\n Boolean: function(s) { return s === 'true'; },\n Integer: function(s) { return parseInt(s, 10); },\n Real: function(s) { return parseFloat(s); }\n};\n\n/**\n * Convert a type to its real representation\n */\nfunction coerceType(type, value) {\n\n var converter = TYPE_CONVERTERS[type];\n\n if (converter) {\n return converter(value);\n } else {\n return value;\n }\n}\n\n/**\n * Return whether the given type is built-in\n */\nfunction isBuiltIn(type) {\n return !!BUILTINS[type];\n}\n\n/**\n * Return whether the given type is simple\n */\nfunction isSimple(type) {\n return !!TYPE_CONVERTERS[type];\n}\n\n/**\n * Parses a namespaced attribute name of the form (ns:)localName to an object,\n * given a default prefix to assume in case no explicit namespace is given.\n *\n * @param {String} name\n * @param {String} [defaultPrefix] the default prefix to take, if none is present.\n *\n * @return {Object} the parsed name\n */\nfunction parseName(name, defaultPrefix) {\n var parts = name.split(/:/),\n localName, prefix;\n\n // no prefix (i.e. only local name)\n if (parts.length === 1) {\n localName = name;\n prefix = defaultPrefix;\n } else\n\n // prefix + local name\n if (parts.length === 2) {\n localName = parts[1];\n prefix = parts[0];\n } else {\n throw new Error('expected or , got ' + name);\n }\n\n name = (prefix ? prefix + ':' : '') + localName;\n\n return {\n name: name,\n prefix: prefix,\n localName: localName\n };\n}\n\n/**\n * A utility to build element descriptors.\n */\nfunction DescriptorBuilder(nameNs) {\n this.ns = nameNs;\n this.name = nameNs.name;\n this.allTypes = [];\n this.allTypesByName = {};\n this.properties = [];\n this.propertiesByName = {};\n}\n\n\nDescriptorBuilder.prototype.build = function() {\n return pick(this, [\n 'ns',\n 'name',\n 'allTypes',\n 'allTypesByName',\n 'properties',\n 'propertiesByName',\n 'bodyProperty',\n 'idProperty'\n ]);\n};\n\n/**\n * Add property at given index.\n *\n * @param {Object} p\n * @param {Number} [idx]\n * @param {Boolean} [validate=true]\n */\nDescriptorBuilder.prototype.addProperty = function(p, idx, validate) {\n\n if (typeof idx === 'boolean') {\n validate = idx;\n idx = undefined;\n }\n\n this.addNamedProperty(p, validate !== false);\n\n var properties = this.properties;\n\n if (idx !== undefined) {\n properties.splice(idx, 0, p);\n } else {\n properties.push(p);\n }\n};\n\n\nDescriptorBuilder.prototype.replaceProperty = function(oldProperty, newProperty, replace) {\n var oldNameNs = oldProperty.ns;\n\n var props = this.properties,\n propertiesByName = this.propertiesByName,\n rename = oldProperty.name !== newProperty.name;\n\n if (oldProperty.isId) {\n if (!newProperty.isId) {\n throw new Error(\n 'property <' + newProperty.ns.name + '> must be id property ' +\n 'to refine <' + oldProperty.ns.name + '>');\n }\n\n this.setIdProperty(newProperty, false);\n }\n\n if (oldProperty.isBody) {\n\n if (!newProperty.isBody) {\n throw new Error(\n 'property <' + newProperty.ns.name + '> must be body property ' +\n 'to refine <' + oldProperty.ns.name + '>');\n }\n\n // TODO: Check compatibility\n this.setBodyProperty(newProperty, false);\n }\n\n // validate existence and get location of old property\n var idx = props.indexOf(oldProperty);\n if (idx === -1) {\n throw new Error('property <' + oldNameNs.name + '> not found in property list');\n }\n\n // remove old property\n props.splice(idx, 1);\n\n // replacing the named property is intentional\n //\n // * validate only if this is a \"rename\" operation\n // * add at specific index unless we \"replace\"\n //\n this.addProperty(newProperty, replace ? undefined : idx, rename);\n\n // make new property available under old name\n propertiesByName[oldNameNs.name] = propertiesByName[oldNameNs.localName] = newProperty;\n};\n\n\nDescriptorBuilder.prototype.redefineProperty = function(p, targetPropertyName, replace) {\n\n var nsPrefix = p.ns.prefix;\n var parts = targetPropertyName.split('#');\n\n var name = parseName(parts[0], nsPrefix);\n var attrName = parseName(parts[1], name.prefix).name;\n\n var redefinedProperty = this.propertiesByName[attrName];\n if (!redefinedProperty) {\n throw new Error('refined property <' + attrName + '> not found');\n } else {\n this.replaceProperty(redefinedProperty, p, replace);\n }\n\n delete p.redefines;\n};\n\nDescriptorBuilder.prototype.addNamedProperty = function(p, validate) {\n var ns = p.ns,\n propsByName = this.propertiesByName;\n\n if (validate) {\n this.assertNotDefined(p, ns.name);\n this.assertNotDefined(p, ns.localName);\n }\n\n propsByName[ns.name] = propsByName[ns.localName] = p;\n};\n\nDescriptorBuilder.prototype.removeNamedProperty = function(p) {\n var ns = p.ns,\n propsByName = this.propertiesByName;\n\n delete propsByName[ns.name];\n delete propsByName[ns.localName];\n};\n\nDescriptorBuilder.prototype.setBodyProperty = function(p, validate) {\n\n if (validate && this.bodyProperty) {\n throw new Error(\n 'body property defined multiple times ' +\n '(<' + this.bodyProperty.ns.name + '>, <' + p.ns.name + '>)');\n }\n\n this.bodyProperty = p;\n};\n\nDescriptorBuilder.prototype.setIdProperty = function(p, validate) {\n\n if (validate && this.idProperty) {\n throw new Error(\n 'id property defined multiple times ' +\n '(<' + this.idProperty.ns.name + '>, <' + p.ns.name + '>)');\n }\n\n this.idProperty = p;\n};\n\nDescriptorBuilder.prototype.assertNotTrait = function(typeDescriptor) {\n\n const _extends = typeDescriptor.extends || [];\n\n if (_extends.length) {\n throw new Error(\n `cannot create <${ typeDescriptor.name }> extending <${ typeDescriptor.extends }>`\n );\n }\n};\n\nDescriptorBuilder.prototype.assertNotDefined = function(p, name) {\n var propertyName = p.name,\n definedProperty = this.propertiesByName[propertyName];\n\n if (definedProperty) {\n throw new Error(\n 'property <' + propertyName + '> already defined; ' +\n 'override of <' + definedProperty.definedBy.ns.name + '#' + definedProperty.ns.name + '> by ' +\n '<' + p.definedBy.ns.name + '#' + p.ns.name + '> not allowed without redefines');\n }\n};\n\nDescriptorBuilder.prototype.hasProperty = function(name) {\n return this.propertiesByName[name];\n};\n\nDescriptorBuilder.prototype.addTrait = function(t, inherited) {\n\n if (inherited) {\n this.assertNotTrait(t);\n }\n\n var typesByName = this.allTypesByName,\n types = this.allTypes;\n\n var typeName = t.name;\n\n if (typeName in typesByName) {\n return;\n }\n\n forEach(t.properties, bind(function(p) {\n\n // clone property to allow extensions\n p = assign({}, p, {\n name: p.ns.localName,\n inherited: inherited\n });\n\n Object.defineProperty(p, 'definedBy', {\n value: t\n });\n\n var replaces = p.replaces,\n redefines = p.redefines;\n\n // add replace/redefine support\n if (replaces || redefines) {\n this.redefineProperty(p, replaces || redefines, replaces);\n } else {\n if (p.isBody) {\n this.setBodyProperty(p);\n }\n if (p.isId) {\n this.setIdProperty(p);\n }\n this.addProperty(p);\n }\n }, this));\n\n types.push(t);\n typesByName[typeName] = t;\n};\n\n/**\n * A registry of Moddle packages.\n *\n * @param {Array} packages\n * @param {Properties} properties\n */\nfunction Registry(packages, properties) {\n this.packageMap = {};\n this.typeMap = {};\n\n this.packages = [];\n\n this.properties = properties;\n\n forEach(packages, bind(this.registerPackage, this));\n}\n\n\nRegistry.prototype.getPackage = function(uriOrPrefix) {\n return this.packageMap[uriOrPrefix];\n};\n\nRegistry.prototype.getPackages = function() {\n return this.packages;\n};\n\n\nRegistry.prototype.registerPackage = function(pkg) {\n\n // copy package\n pkg = assign({}, pkg);\n\n var pkgMap = this.packageMap;\n\n ensureAvailable(pkgMap, pkg, 'prefix');\n ensureAvailable(pkgMap, pkg, 'uri');\n\n // register types\n forEach(pkg.types, bind(function(descriptor) {\n this.registerType(descriptor, pkg);\n }, this));\n\n pkgMap[pkg.uri] = pkgMap[pkg.prefix] = pkg;\n this.packages.push(pkg);\n};\n\n\n/**\n * Register a type from a specific package with us\n */\nRegistry.prototype.registerType = function(type, pkg) {\n\n type = assign({}, type, {\n superClass: (type.superClass || []).slice(),\n extends: (type.extends || []).slice(),\n properties: (type.properties || []).slice(),\n meta: assign((type.meta || {}))\n });\n\n var ns = parseName(type.name, pkg.prefix),\n name = ns.name,\n propertiesByName = {};\n\n // parse properties\n forEach(type.properties, bind(function(p) {\n\n // namespace property names\n var propertyNs = parseName(p.name, ns.prefix),\n propertyName = propertyNs.name;\n\n // namespace property types\n if (!isBuiltIn(p.type)) {\n p.type = parseName(p.type, propertyNs.prefix).name;\n }\n\n assign(p, {\n ns: propertyNs,\n name: propertyName\n });\n\n propertiesByName[propertyName] = p;\n }, this));\n\n // update ns + name\n assign(type, {\n ns: ns,\n name: name,\n propertiesByName: propertiesByName\n });\n\n forEach(type.extends, bind(function(extendsName) {\n var extendsNameNs = parseName(extendsName, ns.prefix);\n\n var extended = this.typeMap[extendsNameNs.name];\n\n extended.traits = extended.traits || [];\n extended.traits.push(name);\n }, this));\n\n // link to package\n this.definePackage(type, pkg);\n\n // register\n this.typeMap[name] = type;\n};\n\n\n/**\n * Traverse the type hierarchy from bottom to top,\n * calling iterator with (type, inherited) for all elements in\n * the inheritance chain.\n *\n * @param {Object} nsName\n * @param {Function} iterator\n * @param {Boolean} [trait=false]\n */\nRegistry.prototype.mapTypes = function(nsName, iterator, trait) {\n\n var type = isBuiltIn(nsName.name) ? { name: nsName.name } : this.typeMap[nsName.name];\n\n var self = this;\n\n /**\n * Traverse the selected super type or trait\n *\n * @param {String} cls\n * @param {Boolean} [trait=false]\n */\n function traverse(cls, trait) {\n var parentNs = parseName(cls, isBuiltIn(cls) ? '' : nsName.prefix);\n self.mapTypes(parentNs, iterator, trait);\n }\n\n /**\n * Traverse the selected trait.\n *\n * @param {String} cls\n */\n function traverseTrait(cls) {\n return traverse(cls, true);\n }\n\n /**\n * Traverse the selected super type\n *\n * @param {String} cls\n */\n function traverseSuper(cls) {\n return traverse(cls, false);\n }\n\n if (!type) {\n throw new Error('unknown type <' + nsName.name + '>');\n }\n\n forEach(type.superClass, trait ? traverseTrait : traverseSuper);\n\n // call iterator with (type, inherited=!trait)\n iterator(type, !trait);\n\n forEach(type.traits, traverseTrait);\n};\n\n\n/**\n * Returns the effective descriptor for a type.\n *\n * @param {String} type the namespaced name (ns:localName) of the type\n *\n * @return {Descriptor} the resulting effective descriptor\n */\nRegistry.prototype.getEffectiveDescriptor = function(name) {\n\n var nsName = parseName(name);\n\n var builder = new DescriptorBuilder(nsName);\n\n this.mapTypes(nsName, function(type, inherited) {\n builder.addTrait(type, inherited);\n });\n\n var descriptor = builder.build();\n\n // define package link\n this.definePackage(descriptor, descriptor.allTypes[descriptor.allTypes.length - 1].$pkg);\n\n return descriptor;\n};\n\n\nRegistry.prototype.definePackage = function(target, pkg) {\n this.properties.define(target, '$pkg', { value: pkg });\n};\n\n\n\n// helpers ////////////////////////////\n\nfunction ensureAvailable(packageMap, pkg, identifierKey) {\n\n var value = pkg[identifierKey];\n\n if (value in packageMap) {\n throw new Error('package with ' + identifierKey + ' <' + value + '> already defined');\n }\n}\n\n/**\n * A utility that gets and sets properties of model elements.\n *\n * @param {Model} model\n */\nfunction Properties(model) {\n this.model = model;\n}\n\n\n/**\n * Sets a named property on the target element.\n * If the value is undefined, the property gets deleted.\n *\n * @param {Object} target\n * @param {String} name\n * @param {Object} value\n */\nProperties.prototype.set = function(target, name, value) {\n\n if (!isString(name) || !name.length) {\n throw new TypeError('property name must be a non-empty string');\n }\n\n var property = this.getProperty(target, name);\n\n var propertyName = property && property.name;\n\n if (isUndefined(value)) {\n\n // unset the property, if the specified value is undefined;\n // delete from $attrs (for extensions) or the target itself\n if (property) {\n delete target[propertyName];\n } else {\n delete target.$attrs[stripGlobal(name)];\n }\n } else {\n\n // set the property, defining well defined properties on the fly\n // or simply updating them in target.$attrs (for extensions)\n if (property) {\n if (propertyName in target) {\n target[propertyName] = value;\n } else {\n defineProperty(target, property, value);\n }\n } else {\n target.$attrs[stripGlobal(name)] = value;\n }\n }\n};\n\n/**\n * Returns the named property of the given element\n *\n * @param {Object} target\n * @param {String} name\n *\n * @return {Object}\n */\nProperties.prototype.get = function(target, name) {\n\n var property = this.getProperty(target, name);\n\n if (!property) {\n return target.$attrs[stripGlobal(name)];\n }\n\n var propertyName = property.name;\n\n // check if access to collection property and lazily initialize it\n if (!target[propertyName] && property.isMany) {\n defineProperty(target, property, []);\n }\n\n return target[propertyName];\n};\n\n\n/**\n * Define a property on the target element\n *\n * @param {Object} target\n * @param {String} name\n * @param {Object} options\n */\nProperties.prototype.define = function(target, name, options) {\n\n if (!options.writable) {\n\n var value = options.value;\n\n // use getters for read-only variables to support ES6 proxies\n // cf. https://github.com/bpmn-io/internal-docs/issues/386\n options = assign({}, options, {\n get: function() { return value; }\n });\n\n delete options.value;\n }\n\n Object.defineProperty(target, name, options);\n};\n\n\n/**\n * Define the descriptor for an element\n */\nProperties.prototype.defineDescriptor = function(target, descriptor) {\n this.define(target, '$descriptor', { value: descriptor });\n};\n\n/**\n * Define the model for an element\n */\nProperties.prototype.defineModel = function(target, model) {\n this.define(target, '$model', { value: model });\n};\n\n/**\n * Return property with the given name on the element.\n *\n * @param {any} target\n * @param {string} name\n *\n * @return {object | null} property\n */\nProperties.prototype.getProperty = function(target, name) {\n\n var model = this.model;\n\n var property = model.getPropertyDescriptor(target, name);\n\n if (property) {\n return property;\n }\n\n if (name.includes(':')) {\n return null;\n }\n\n const strict = model.config.strict;\n\n if (typeof strict !== 'undefined') {\n const error = new TypeError(`unknown property <${ name }> on <${ target.$type }>`);\n\n if (strict) {\n throw error;\n } else {\n\n // eslint-disable-next-line no-undef\n typeof console !== 'undefined' && console.warn(error);\n }\n }\n\n return null;\n};\n\nfunction isUndefined(val) {\n return typeof val === 'undefined';\n}\n\nfunction defineProperty(target, property, value) {\n Object.defineProperty(target, property.name, {\n enumerable: !property.isReference,\n writable: true,\n value: value,\n configurable: true\n });\n}\n\nfunction stripGlobal(name) {\n return name.replace(/^:/, '');\n}\n\n// Moddle implementation /////////////////////////////////////////////////\n\n/**\n * @class Moddle\n *\n * A model that can be used to create elements of a specific type.\n *\n * @example\n *\n * var Moddle = require('moddle');\n *\n * var pkg = {\n * name: 'mypackage',\n * prefix: 'my',\n * types: [\n * { name: 'Root' }\n * ]\n * };\n *\n * var moddle = new Moddle([pkg]);\n *\n * @param {Array} packages the packages to contain\n *\n * @param { { strict?: boolean } } [config] moddle configuration\n */\nfunction Moddle(packages, config = {}) {\n\n this.properties = new Properties(this);\n\n this.factory = new Factory(this, this.properties);\n this.registry = new Registry(packages, this.properties);\n\n this.typeCache = {};\n\n this.config = config;\n}\n\n\n/**\n * Create an instance of the specified type.\n *\n * @method Moddle#create\n *\n * @example\n *\n * var foo = moddle.create('my:Foo');\n * var bar = moddle.create('my:Bar', { id: 'BAR_1' });\n *\n * @param {String|Object} descriptor the type descriptor or name know to the model\n * @param {Object} attrs a number of attributes to initialize the model instance with\n * @return {Object} model instance\n */\nModdle.prototype.create = function(descriptor, attrs) {\n var Type = this.getType(descriptor);\n\n if (!Type) {\n throw new Error('unknown type <' + descriptor + '>');\n }\n\n return new Type(attrs);\n};\n\n\n/**\n * Returns the type representing a given descriptor\n *\n * @method Moddle#getType\n *\n * @example\n *\n * var Foo = moddle.getType('my:Foo');\n * var foo = new Foo({ 'id' : 'FOO_1' });\n *\n * @param {String|Object} descriptor the type descriptor or name know to the model\n * @return {Object} the type representing the descriptor\n */\nModdle.prototype.getType = function(descriptor) {\n\n var cache = this.typeCache;\n\n var name = isString(descriptor) ? descriptor : descriptor.ns.name;\n\n var type = cache[name];\n\n if (!type) {\n descriptor = this.registry.getEffectiveDescriptor(name);\n type = cache[name] = this.factory.createType(descriptor);\n }\n\n return type;\n};\n\n\n/**\n * Creates an any-element type to be used within model instances.\n *\n * This can be used to create custom elements that lie outside the meta-model.\n * The created element contains all the meta-data required to serialize it\n * as part of meta-model elements.\n *\n * @method Moddle#createAny\n *\n * @example\n *\n * var foo = moddle.createAny('vendor:Foo', 'http://vendor', {\n * value: 'bar'\n * });\n *\n * var container = moddle.create('my:Container', 'http://my', {\n * any: [ foo ]\n * });\n *\n * // go ahead and serialize the stuff\n *\n *\n * @param {String} name the name of the element\n * @param {String} nsUri the namespace uri of the element\n * @param {Object} [properties] a map of properties to initialize the instance with\n * @return {Object} the any type instance\n */\nModdle.prototype.createAny = function(name, nsUri, properties) {\n\n var nameNs = parseName(name);\n\n var element = {\n $type: name,\n $instanceOf: function(type) {\n return type === this.$type;\n },\n get: function(key) {\n return this[key];\n },\n set: function(key, value) {\n set(this, [ key ], value);\n }\n };\n\n var descriptor = {\n name: name,\n isGeneric: true,\n ns: {\n prefix: nameNs.prefix,\n localName: nameNs.localName,\n uri: nsUri\n }\n };\n\n this.properties.defineDescriptor(element, descriptor);\n this.properties.defineModel(element, this);\n this.properties.define(element, 'get', { enumerable: false, writable: true });\n this.properties.define(element, 'set', { enumerable: false, writable: true });\n this.properties.define(element, '$parent', { enumerable: false, writable: true });\n this.properties.define(element, '$instanceOf', { enumerable: false, writable: true });\n\n forEach(properties, function(a, key) {\n if (isObject(a) && a.value !== undefined) {\n element[a.name] = a.value;\n } else {\n element[key] = a;\n }\n });\n\n return element;\n};\n\n/**\n * Returns a registered package by uri or prefix\n *\n * @return {Object} the package\n */\nModdle.prototype.getPackage = function(uriOrPrefix) {\n return this.registry.getPackage(uriOrPrefix);\n};\n\n/**\n * Returns a snapshot of all known packages\n *\n * @return {Object} the package\n */\nModdle.prototype.getPackages = function() {\n return this.registry.getPackages();\n};\n\n/**\n * Returns the descriptor for an element\n */\nModdle.prototype.getElementDescriptor = function(element) {\n return element.$descriptor;\n};\n\n/**\n * Returns true if the given descriptor or instance\n * represents the given type.\n *\n * May be applied to this, if element is omitted.\n */\nModdle.prototype.hasType = function(element, type) {\n if (type === undefined) {\n type = element;\n element = this;\n }\n\n var descriptor = element.$model.getElementDescriptor(element);\n\n return (type in descriptor.allTypesByName);\n};\n\n/**\n * Returns the descriptor of an elements named property\n */\nModdle.prototype.getPropertyDescriptor = function(element, property) {\n return this.getElementDescriptor(element).propertiesByName[property];\n};\n\n/**\n * Returns a mapped type's descriptor\n */\nModdle.prototype.getTypeDescriptor = function(type) {\n return this.registry.typeMap[type];\n};\n\nexport { Moddle, coerceType, isBuiltIn as isBuiltInType, isSimple as isSimpleType, parseName as parseNameNS };\n//# sourceMappingURL=index.esm.js.map\n","var fromCharCode = String.fromCharCode;\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n\nvar ENTITY_PATTERN = /(\\d+);|([0-9a-f]+);|&(\\w+);/ig;\n\nvar ENTITY_MAPPING = {\n 'amp': '&',\n 'apos': '\\'',\n 'gt': '>',\n 'lt': '<',\n 'quot': '\"'\n};\n\n// map UPPERCASE variants of supported special chars\nObject.keys(ENTITY_MAPPING).forEach(function(k) {\n ENTITY_MAPPING[k.toUpperCase()] = ENTITY_MAPPING[k];\n});\n\n\nfunction replaceEntities(_, d, x, z) {\n\n // reserved names, i.e. \n if (z) {\n if (hasOwnProperty.call(ENTITY_MAPPING, z)) {\n return ENTITY_MAPPING[z];\n } else {\n\n // fall back to original value\n return '&' + z + ';';\n }\n }\n\n // decimal encoded char\n if (d) {\n return fromCharCode(d);\n }\n\n // hex encoded char\n return fromCharCode(parseInt(x, 16));\n}\n\n\n/**\n * A basic entity decoder that can decode a minimal\n * sub-set of reserved names (&) as well as\n * hex (ય) and decimal (ӏ) encoded characters.\n *\n * @param {string} str\n *\n * @return {string} decoded string\n */\nfunction decodeEntities(s) {\n if (s.length > 3 && s.indexOf('&') !== -1) {\n return s.replace(ENTITY_PATTERN, replaceEntities);\n }\n\n return s;\n}\n\nvar XSI_URI = 'http://www.w3.org/2001/XMLSchema-instance';\nvar XSI_PREFIX = 'xsi';\nvar XSI_TYPE = 'xsi:type';\n\nvar NON_WHITESPACE_OUTSIDE_ROOT_NODE = 'non-whitespace outside of root node';\n\nfunction error(msg) {\n return new Error(msg);\n}\n\nfunction missingNamespaceForPrefix(prefix) {\n return 'missing namespace for prefix <' + prefix + '>';\n}\n\nfunction getter(getFn) {\n return {\n 'get': getFn,\n 'enumerable': true\n };\n}\n\nfunction cloneNsMatrix(nsMatrix) {\n var clone = {}, key;\n for (key in nsMatrix) {\n clone[key] = nsMatrix[key];\n }\n return clone;\n}\n\nfunction uriPrefix(prefix) {\n return prefix + '$uri';\n}\n\nfunction buildNsMatrix(nsUriToPrefix) {\n var nsMatrix = {},\n uri,\n prefix;\n\n for (uri in nsUriToPrefix) {\n prefix = nsUriToPrefix[uri];\n nsMatrix[prefix] = prefix;\n nsMatrix[uriPrefix(prefix)] = uri;\n }\n\n return nsMatrix;\n}\n\nfunction noopGetContext() {\n return { 'line': 0, 'column': 0 };\n}\n\nfunction throwFunc(err) {\n throw err;\n}\n\n/**\n * Creates a new parser with the given options.\n *\n * @constructor\n *\n * @param {!Object=} options\n */\nfunction Parser(options) {\n\n if (!this) {\n return new Parser(options);\n }\n\n var proxy = options && options['proxy'];\n\n var onText,\n onOpenTag,\n onCloseTag,\n onCDATA,\n onError = throwFunc,\n onWarning,\n onComment,\n onQuestion,\n onAttention;\n\n var getContext = noopGetContext;\n\n /**\n * Do we need to parse the current elements attributes for namespaces?\n *\n * @type {boolean}\n */\n var maybeNS = false;\n\n /**\n * Do we process namespaces at all?\n *\n * @type {boolean}\n */\n var isNamespace = false;\n\n /**\n * The caught error returned on parse end\n *\n * @type {Error}\n */\n var returnError = null;\n\n /**\n * Should we stop parsing?\n *\n * @type {boolean}\n */\n var parseStop = false;\n\n /**\n * A map of { uri: prefix } used by the parser.\n *\n * This map will ensure we can normalize prefixes during processing;\n * for each uri, only one prefix will be exposed to the handlers.\n *\n * @type {!Object}}\n */\n var nsUriToPrefix;\n\n /**\n * Handle parse error.\n *\n * @param {string|Error} err\n */\n function handleError(err) {\n if (!(err instanceof Error)) {\n err = error(err);\n }\n\n returnError = err;\n\n onError(err, getContext);\n }\n\n /**\n * Handle parse error.\n *\n * @param {string|Error} err\n */\n function handleWarning(err) {\n\n if (!onWarning) {\n return;\n }\n\n if (!(err instanceof Error)) {\n err = error(err);\n }\n\n onWarning(err, getContext);\n }\n\n /**\n * Register parse listener.\n *\n * @param {string} name\n * @param {Function} cb\n *\n * @return {Parser}\n */\n this['on'] = function(name, cb) {\n\n if (typeof cb !== 'function') {\n throw error('required args ');\n }\n\n switch (name) {\n case 'openTag': onOpenTag = cb; break;\n case 'text': onText = cb; break;\n case 'closeTag': onCloseTag = cb; break;\n case 'error': onError = cb; break;\n case 'warn': onWarning = cb; break;\n case 'cdata': onCDATA = cb; break;\n case 'attention': onAttention = cb; break; // \n case 'question': onQuestion = cb; break; // .... ?>\n case 'comment': onComment = cb; break;\n default:\n throw error('unsupported event: ' + name);\n }\n\n return this;\n };\n\n /**\n * Set the namespace to prefix mapping.\n *\n * @example\n *\n * parser.ns({\n * 'http://foo': 'foo',\n * 'http://bar': 'bar'\n * });\n *\n * @param {!Object