1/*! dmn-js - dmn-navigated-viewer v14.1.2 | Copyright (c) 2014-present, camunda Services GmbH | bpmn.io/license */
2!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).DmnJS=t()}(this,(function(){"use strict";function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function t(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?e(Object(r),!0).forEach((function(e){a(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):e(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,g(r.key),r)}}function o(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function a(e,t,n){return(t=g(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&u(e,t)}function l(e){return l=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},l(e)}function u(e,t){return u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},u(e,t)}function c(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function p(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function f(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return p(e)}function h(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=l(e);if(t){var i=l(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return f(this,n)}}function d(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=l(e)););return e}function m(){return m="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=d(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},m.apply(this,arguments)}function v(e){return function(e){if(Array.isArray(e))return y(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return y(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return y(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function g(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}var b=Object.prototype.toString,w=Object.prototype.hasOwnProperty;function _(e){return void 0!==e}function x(e){return"[object Array]"===b.call(e)}function E(e){return"[object Object]"===b.call(e)}function k(e){return"[object Number]"===b.call(e)}function C(e){var t=b.call(e);return"[object Function]"===t||"[object AsyncFunction]"===t||"[object GeneratorFunction]"===t||"[object AsyncGeneratorFunction]"===t||"[object Proxy]"===t}function O(e){return"[object String]"===b.call(e)}function S(e,t){return w.call(e,t)}function M(e,t){var n;return t=function(e){return C(e)?e:function(t){return t===e}}(t),N(e,(function(e,r){if(t(e,r))return n=e,!1})),n}function j(e,t){var n=[];return N(e,(function(e,r){t(e,r)&&n.push(e)})),n}function N(e,t){var n;if(void 0!==e){var r=x(e)?A:T;for(var i in e)if(S(e,i)&&!1===t(n=e[i],r(i)))return n}}function P(e,t,n){return N(e,(function(e,r){n=t(n,e,r)})),n}function D(e,t){return!!P(e,(function(e,n,r){return e&&t(n,r)}),!0)}function R(e){return function(t){return D(e,(function(e,n){return t[n]===e}))}}function T(e){return e}function A(e){return Number(e)}function I(e,t){var n,r,i,o;function a(n){var a=Date.now(),u=n?0:o+t-a;if(u>0)return s(u);e.apply(i,r),l()}function s(e){n=setTimeout(a,e)}function l(){n&&clearTimeout(n),n=o=r=i=void 0}function u(){o=Date.now();for(var e=arguments.length,a=new Array(e),l=0;l<e;l++)a[l]=arguments[l];r=a,i=this,n||s(t)}return u.flush=function(){n&&a(!0),l()},u.cancel=l,u}function B(e,t){var n=!1;return function(){n||(e.apply(void 0,arguments),n=!0,setTimeout((function(){n=!1}),t))}}function L(e,t){return e.bind(t)}function $(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return Object.assign.apply(Object,[e].concat(n))}var V="__fn",z=Array.prototype.slice;function U(){this._listeners={},this.on("diagram.destroy",1,this._destroy,this)}function F(){}U.prototype.on=function(e,t,n,r){if(e=x(e)?e:[e],C(t)&&(r=n,n=t,t=1e3),!k(t))throw new Error("priority must be a number");var i=n;r&&((i=L(n,r))[V]=n[V]||n);var o=this;e.forEach((function(e){o._addListener(e,{priority:t,callback:i,next:null})}))},U.prototype.once=function(e,t,n,r){var i=this;if(C(t)&&(r=n,n=t,t=1e3),!k(t))throw new Error("priority must be a number");function o(){o.__isTomb=!0;var t=n.apply(r,arguments);return i.off(e,o),t}o[V]=n,this.on(e,t,o)},U.prototype.off=function(e,t){e=x(e)?e:[e];var n=this;e.forEach((function(e){n._removeListener(e,t)}))},U.prototype.createEvent=function(e){var t=new F;return t.init(e),t},U.prototype.fire=function(e,t){var r,i,o,a;if(a=z.call(arguments),"object"===n(e)&&(e=(t=e).type),!e)throw new Error("no event type specified");if(i=this._listeners[e]){r=t instanceof F?t:this.createEvent(t),a[0]=r;var s=r.type;e!==s&&(r.type=e);try{o=this._invokeListeners(r,a,i)}finally{e!==s&&(r.type=s)}return void 0===o&&r.defaultPrevented&&(o=!1),o}},U.prototype.handleError=function(e){return!1===this.fire("error",{error:e})},U.prototype._destroy=function(){this._listeners={}},U.prototype._invokeListeners=function(e,t,n){for(var r;n&&!e.cancelBubble;)r=this._invokeListener(e,t,n),n=n.next;return r},U.prototype._invokeListener=function(e,t,n){var r;if(n.callback.__isTomb)return r;try{r=function(e,t){return e.apply(null,t)}(n.callback,t),void 0!==r&&(e.returnValue=r,e.stopPropagation()),!1===r&&e.preventDefault()}catch(e){if(!this.handleError(e))throw console.error("unhandled error in event listener",e),e}return r},U.prototype._addListener=function(e,t){var n,r=this._getListeners(e);if(r){for(;r;){if(r.priority<t.priority)return t.next=r,void(n?n.next=t:this._setListeners(e,t));n=r,r=r.next}n.next=t}else this._setListeners(e,t)},U.prototype._getListeners=function(e){return this._listeners[e]},U.prototype._setListeners=function(e,t){this._listeners[e]=t},U.prototype._removeListener=function(e,t){var n,r,i,o=this._getListeners(e);if(t)for(;o;)n=o.next,(i=o.callback)!==t&&i[V]!==t||(r?r.next=n:this._setListeners(e,n)),r=o,o=n;else this._setListeners(e,null)},F.prototype.stopPropagation=function(){this.cancelBubble=!0},F.prototype.preventDefault=function(){this.defaultPrevented=!0},F.prototype.init=function(e){$(this,e||{})};var W=Object.prototype.toString;function q(){return q=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},q.apply(this,arguments)}function G(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return q.apply(void 0,[e].concat(n))}var H=Object.prototype.toString,X=Object.prototype.hasOwnProperty;function Y(e){return"[object String]"===H.call(e)}function K(e,t){return X.call(e,t)}function Z(e,t){var n;if(void 0!==e){var r=function(e){return"[object Array]"===H.call(e)}(e)?J:Q;for(var i in e)if(K(e,i)&&!1===t(n=e[i],r(i)))return n}}function Q(e){return e}function J(e){return Number(e)}function ee(e,t){return e.bind(t)}function te(){return te=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},te.apply(this,arguments)}function ne(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return te.apply(void 0,[e].concat(n))}function re(){}function ie(e,t){this.model=e,this.properties=t}re.prototype.get=function(e){return this.$model.properties.get(this,e)},re.prototype.set=function(e,t){this.$model.properties.set(this,e,t)},ie.prototype.createType=function(e){var t=this.model,n=this.properties,r=Object.create(re.prototype);Z(e.properties,(function(e){e.isMany||void 0===e.default||(r[e.name]=e.default)})),n.defineModel(r,t),n.defineDescriptor(r,e);var i=e.ns.name;function o(e){n.define(this,"$type",{value:i,enumerable:!0}),n.define(this,"$attrs",{value:{}}),n.define(this,"$parent",{writable:!0}),Z(e,ee((function(e,t){this.set(t,e)}),this))}return o.prototype=r,o.hasType=r.$instanceOf=this.model.hasType,n.defineModel(o,t),n.defineDescriptor(o,e),o};var oe={String:!0,Boolean:!0,Integer:!0,Real:!0,Element:!0},ae={String:function(e){return e},Boolean:function(e){return"true"===e},Integer:function(e){return parseInt(e,10)},Real:function(e){return parseFloat(e)}};function se(e,t){var n=ae[e];return n?n(t):t}function le(e){return!!oe[e]}function ue(e){return!!ae[e]}function ce(e,t){var n,r,i=e.split(/:/);if(1===i.length)n=e,r=t;else{if(2!==i.length)throw new Error("expected <prefix:localName> or <localName>, got "+e);n=i[1],r=i[0]}return{name:e=(r?r+":":"")+n,prefix:r,localName:n}}function pe(e){this.ns=e,this.name=e.name,this.allTypes=[],this.allTypesByName={},this.properties=[],this.propertiesByName={}}function fe(e,t){this.packageMap={},this.typeMap={},this.packages=[],this.properties=t,Z(e,ee(this.registerPackage,this))}function he(e,t,n){var r=t[n];if(r in e)throw new Error("package with "+n+" <"+r+"> already defined")}function de(e){this.model=e}function me(e,t,n){Object.defineProperty(e,t.name,{enumerable:!t.isReference,writable:!0,value:n,configurable:!0})}function ve(e){this.properties=new de(this),this.factory=new ie(this,this.properties),this.registry=new fe(e,this.properties),this.typeCache={}}pe.prototype.build=function(){return e=this,t=["ns","name","allTypes","allTypesByName","properties","propertiesByName","bodyProperty","idProperty"],n={},r=Object(e),Z(t,(function(t){t in r&&(n[t]=e[t])})),n;var e,t,n,r},pe.prototype.addProperty=function(e,t,n){"boolean"==typeof t&&(n=t,t=void 0),this.addNamedProperty(e,!1!==n);var r=this.properties;void 0!==t?r.splice(t,0,e):r.push(e)},pe.prototype.replaceProperty=function(e,t,n){var r=e.ns,i=this.properties,o=this.propertiesByName,a=e.name!==t.name;if(e.isId){if(!t.isId)throw new Error("property <"+t.ns.name+"> must be id property to refine <"+e.ns.name+">");this.setIdProperty(t,!1)}if(e.isBody){if(!t.isBody)throw new Error("property <"+t.ns.name+"> must be body property to refine <"+e.ns.name+">");this.setBodyProperty(t,!1)}var s=i.indexOf(e);if(-1===s)throw new Error("property <"+r.name+"> not found in property list");i.splice(s,1),this.addProperty(t,n?void 0:s,a),o[r.name]=o[r.localName]=t},pe.prototype.redefineProperty=function(e,t,n){var r=e.ns.prefix,i=t.split("#"),o=ce(i[0],r),a=ce(i[1],o.prefix).name,s=this.propertiesByName[a];if(!s)throw new Error("refined property <"+a+"> not found");this.replaceProperty(s,e,n),delete e.redefines},pe.prototype.addNamedProperty=function(e,t){var n=e.ns,r=this.propertiesByName;t&&(this.assertNotDefined(e,n.name),this.assertNotDefined(e,n.localName)),r[n.name]=r[n.localName]=e},pe.prototype.removeNamedProperty=function(e){var t=e.ns,n=this.propertiesByName;delete n[t.name],delete n[t.localName]},pe.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},pe.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},pe.prototype.assertNotDefined=function(e,t){var n=e.name,r=this.propertiesByName[n];if(r)throw new Error("property <"+n+"> already defined; override of <"+r.definedBy.ns.name+"#"+r.ns.name+"> by <"+e.definedBy.ns.name+"#"+e.ns.name+"> not allowed without redefines")},pe.prototype.hasProperty=function(e){return this.propertiesByName[e]},pe.prototype.addTrait=function(e,t){var n=this.allTypesByName,r=this.allTypes,i=e.name;i in n||(Z(e.properties,ee((function(n){n=ne({},n,{name:n.ns.localName,inherited:t}),Object.defineProperty(n,"definedBy",{value:e});var r=n.replaces,i=n.redefines;r||i?this.redefineProperty(n,r||i,r):(n.isBody&&this.setBodyProperty(n),n.isId&&this.setIdProperty(n),this.addProperty(n))}),this)),r.push(e),n[i]=e)},fe.prototype.getPackage=function(e){return this.packageMap[e]},fe.prototype.getPackages=function(){return this.packages},fe.prototype.registerPackage=function(e){e=ne({},e);var t=this.packageMap;he(t,e,"prefix"),he(t,e,"uri"),Z(e.types,ee((function(t){this.registerType(t,e)}),this)),t[e.uri]=t[e.prefix]=e,this.packages.push(e)},fe.prototype.registerType=function(e,t){var n=ce((e=ne({},e,{superClass:(e.superClass||[]).slice(),extends:(e.extends||[]).slice(),properties:(e.properties||[]).slice(),meta:ne(e.meta||{})})).name,t.prefix),r=n.name,i={};Z(e.properties,ee((function(e){var t=ce(e.name,n.prefix),r=t.name;le(e.type)||(e.type=ce(e.type,t.prefix).name),ne(e,{ns:t,name:r}),i[r]=e}),this)),ne(e,{ns:n,name:r,propertiesByName:i}),Z(e.extends,ee((function(e){var t=this.typeMap[e];t.traits=t.traits||[],t.traits.push(r)}),this)),this.definePackage(e,t),this.typeMap[r]=e},fe.prototype.mapTypes=function(e,t,n){var r=le(e.name)?{name:e.name}:this.typeMap[e.name],i=this;function o(e){return a(e,!0)}function a(n,r){var o=ce(n,le(n)?"":e.prefix);i.mapTypes(o,t,r)}if(!r)throw new Error("unknown type <"+e.name+">");Z(r.superClass,n?o:a),t(r,!n),Z(r.traits,o)},fe.prototype.getEffectiveDescriptor=function(e){var t=ce(e),n=new pe(t);this.mapTypes(t,(function(e,t){n.addTrait(e,t)}));var r=n.build();return this.definePackage(r,r.allTypes[r.allTypes.length-1].$pkg),r},fe.prototype.definePackage=function(e,t){this.properties.define(e,"$pkg",{value:t})},de.prototype.set=function(e,t,n){if(!Y(t)||!t.length)throw new TypeError("property name must be a non-empty string");var r=this.model.getPropertyDescriptor(e,t),i=r&&r.name;void 0===n?r?delete e[i]:delete e.$attrs[t]:r?i in e?e[i]=n:me(e,r,n):e.$attrs[t]=n},de.prototype.get=function(e,t){var n=this.model.getPropertyDescriptor(e,t);if(!n)return e.$attrs[t];var r=n.name;return!e[r]&&n.isMany&&me(e,n,[]),e[r]},de.prototype.define=function(e,t,n){if(!n.writable){var r=n.value;delete(n=ne({},n,{get:function(){return r}})).value}Object.defineProperty(e,t,n)},de.prototype.defineDescriptor=function(e,t){this.define(e,"$descriptor",{value:t})},de.prototype.defineModel=function(e,t){this.define(e,"$model",{value:t})},ve.prototype.create=function(e,t){var n=this.getType(e);if(!n)throw new Error("unknown type <"+e+">");return new n(t)},ve.prototype.getType=function(e){var t=this.typeCache,n=Y(e)?e:e.ns.name,r=t[n];return r||(e=this.registry.getEffectiveDescriptor(n),r=t[n]=this.factory.createType(e)),r},ve.prototype.createAny=function(e,t,n){var r=ce(e),i={$type:e,$instanceOf:function(e){return e===this.$type}},o={name:e,isGeneric:!0,ns:{prefix:r.prefix,localName:r.localName,uri:t}};return this.properties.defineDescriptor(i,o),this.properties.defineModel(i,this),this.properties.define(i,"$parent",{enumerable:!1,writable:!0}),this.properties.define(i,"$instanceOf",{enumerable:!1,writable:!0}),Z(n,(function(e,t){var n;n=e,"[object Object]"===H.call(n)&&void 0!==e.value?i[e.name]=e.value:i[t]=e})),i},ve.prototype.getPackage=function(e){return this.registry.getPackage(e)},ve.prototype.getPackages=function(){return this.registry.getPackages()},ve.prototype.getElementDescriptor=function(e){return e.$descriptor},ve.prototype.hasType=function(e,t){return void 0===t&&(t=e,e=this),t in e.$model.getElementDescriptor(e).allTypesByName},ve.prototype.getPropertyDescriptor=function(e,t){return this.getElementDescriptor(e).propertiesByName[t]},ve.prototype.getTypeDescriptor=function(e){return this.registry.typeMap[e]};var ye=Object.prototype.toString,ge=Object.prototype.hasOwnProperty;function be(e){return"[object Array]"===ye.call(e)}function we(e){return"[object String]"===ye.call(e)}function _e(e,t){return ge.call(e,t)}function xe(e,t){var n;return t=Ce(t),ke(e,(function(e,r){if(t(e,r))return n=e,!1})),n}function Ee(e,t){var n=[];return ke(e,(function(e,r){t(e,r)&&n.push(e)})),n}function ke(e,t){var n;if(void 0!==e){var r=be(e)?Se:Oe;for(var i in e)if(_e(e,i)&&!1===t(n=e[i],r(i)))return n}}function Ce(e){return t=e,"[object Function]"===(n=ye.call(t))||"[object AsyncFunction]"===n||"[object GeneratorFunction]"===n||"[object AsyncGeneratorFunction]"===n||"[object Proxy]"===n?e:function(t){return t===e};var t,n}function Oe(e){return e}function Se(e){return Number(e)}function Me(){return Me=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Me.apply(this,arguments)}function je(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return Me.apply(void 0,[e].concat(n))}var Ne=String.fromCharCode,Pe=Object.prototype.hasOwnProperty,De=/&#(\d+);|&#x([0-9a-f]+);|&(\w+);/gi,Re={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'};function Te(e,t,n,r){return r?Pe.call(Re,r)?Re[r]:"&"+r+";":Ne(t||parseInt(n,16))}function Ae(e){return e.length>3&&-1!==e.indexOf("&")?e.replace(De,Te):e}Object.keys(Re).forEach((function(e){Re[e.toUpperCase()]=Re[e]}));var Ie="xsi:type",Be="non-whitespace outside of root node";function Le(e){return new Error(e)}function $e(e){return"missing namespace for prefix <"+e+">"}function Ve(e){return{get:e,enumerable:!0}}function ze(e){var t,n={};for(t in e)n[t]=e[t];return n}function Ue(e){return e+"$uri"}function Fe(){return{line:0,column:0}}function We(e){throw e}function qe(e){if(!this)return new qe(e);var t,r,i,o,a,s,l,u,c,p=e&&e.proxy,f=We,h=Fe,d=!1,m=!1,v=null,y=!1;function g(e){e instanceof Error||(e=Le(e)),v=e,f(e,h)}function b(e){a&&(e instanceof Error||(e=Le(e)),a(e,h))}this.on=function(e,n){if("function"!=typeof n)throw Le("required args <name, cb>");switch(e){case"openTag":r=n;break;case"text":t=n;break;case"closeTag":i=n;break;case"error":f=n;break;case"warn":a=n;break;case"cdata":o=n;break;case"attention":u=n;break;case"question":l=n;break;case"comment":s=n;break;default:throw Le("unsupported event: "+e)}return this},this.ns=function(e){if(void 0===e&&(e={}),"object"!==n(e))throw Le("required args <nsMap={}>");var t,r={};for(t in e)r[t]=e[t];return r["http://www.w3.org/2001/XMLSchema-instance"]="xsi",m=!0,c=r,this},this.parse=function(e){if("string"!=typeof e)throw Le("required args <xml=string>");return v=null,function(e){var n,a,f,v,w,_,x,E,k,C,O,S=m?[]:null,M=m?function(e){var t,n,r={};for(t in e)r[n=e[t]]=n,r[Ue(n)]=t;return r}(c):null,j=[],N=0,P=!1,D=!1,R=0,T=0,A="",I=0;function B(){if(null!==O)return O;var e,t,n,r,i,o,a,s,l,u,p,f=m&&M.xmlns,h=m&&d?[]:null,v=I,y=A,g=y.length,w={},_={};e:for(;v<g;v++)if(l=!1,!(32===(u=y.charCodeAt(v))||u<14&&u>8)){for((u<65||u>122||u>90&&u<97)&&95!==u&&58!==u&&(b("illegal first char attribute name"),l=!0),p=v+1;p<g;p++)if(!((u=y.charCodeAt(p))>96&&u<123||u>64&&u<91||u>47&&u<59||46===u||45===u||95===u)){if(32===u||u<14&&u>8){b("missing attribute value"),v=p;continue e}if(61===u)break;b("illegal attribute name char"),l=!0}if("xmlns:xmlns"===(s=y.substring(v,p))&&(b("illegal declaration of xmlns"),l=!0),34===(u=y.charCodeAt(p+1)))-1===(p=y.indexOf('"',v=p+2))&&-1!==(p=y.indexOf("'",v))&&(b("attribute value quote missmatch"),l=!0);else if(39===u)-1===(p=y.indexOf("'",v=p+2))&&-1!==(p=y.indexOf('"',v))&&(b("attribute value quote missmatch"),l=!0);else for(b("missing attribute value quotes"),l=!0,p+=1;p<g&&!(32===(u=y.charCodeAt(p+1))||u<14&&u>8);p++);for(-1===p&&(b("missing closing quotes"),p=g,l=!0),l||(o=y.substring(v,p)),v=p;p+1<g&&!(32===(u=y.charCodeAt(p+1))||u<14&&u>8);p++)v===p&&(b("illegal character after attribute end"),l=!0);if(v=p+1,!l)if(s in _)b("attribute <"+s+"> already defined");else if(_[s]=!0,m)if(d){if(null!==(i="xmlns"===s?"xmlns":120===s.charCodeAt(0)&&"xmlns:"===s.substr(0,6)?s.substr(6):null)){if(e=Ae(o),t=Ue(i),!(a=c[e])){if("xmlns"===i||t in M&&M[t]!==e)do{a="ns"+N++}while(void 0!==M[a]);else a=i;c[e]=a}M[i]!==a&&(r||(M=ze(M),r=!0),M[i]=a,"xmlns"===i&&(M[Ue(a)]=e,f=a),M[t]=e),w[s]=o;continue}h.push(s,o)}else-1!==(u=s.indexOf(":"))?(n=M[s.substring(0,u)])?((s=f===n?s.substr(u+1):n+s.substr(u))===Ie&&(-1!==(u=o.indexOf(":"))?(n=o.substring(0,u),o=(n=M[n]||n)+o.substring(u)):o=f+":"+o),w[s]=o):b($e(s.substring(0,u))):w[s]=o;else w[s]=o}if(d)for(v=0,g=h.length;v<g;v++){if(s=h[v++],o=h[v],-1!==(u=s.indexOf(":"))){if(!(n=M[s.substring(0,u)])){b($e(s.substring(0,u)));continue}(s=f===n?s.substr(u+1):n+s.substr(u))===Ie&&(-1!==(u=o.indexOf(":"))?(n=o.substring(0,u),o=(n=M[n]||n)+o.substring(u)):o=f+":"+o)}w[s]=o}return O=w}function L(){for(var t,n,r=/(\r\n|\r|\n)/g,i=0,o=0,a=0,s=T;R>=a&&(t=r.exec(e))&&!((s=t[0].length+t.index)>R);)i+=1,a=s;return-1==R?(o=s,n=e.substring(T)):0===T?n=e.substring(T,R):(o=R-a,n=-1==T?e.substring(R):e.substring(R,T+1)),{data:n,line:i,column:o}}h=L,p&&(C=Object.create({},{name:Ve((function(){return E})),originalName:Ve((function(){return k})),attrs:Ve(B),ns:Ve((function(){return M}))}));for(;-1!==T;){if(-1===(R=60===e.charCodeAt(T)?T:e.indexOf("<",T)))return j.length?g("unexpected end of file"):0===T?g("missing start tag"):void(T<e.length&&e.substring(T).trim()&&b(Be));if(T!==R)if(j.length){if(t&&(t(e.substring(T,R),Ae,h),y))return}else if(e.substring(T,R).trim()&&(b(Be),y))return;if(33===(w=e.charCodeAt(R+1))){if(91===(v=e.charCodeAt(R+2))&&"CDATA["===e.substr(R+3,6)){if(-1===(T=e.indexOf("]]>",R)))return g("unclosed cdata");if(o&&(o(e.substring(R+9,T),h),y))return;T+=3;continue}if(45===v&&45===e.charCodeAt(R+3)){if(-1===(T=e.indexOf("--\x3e",R)))return g("unclosed comment");if(s&&(s(e.substring(R+4,T),Ae,h),y))return;T+=3;continue}}if(63!==w){for(a=R+1;;a++){if(_=e.charCodeAt(a),isNaN(_))return T=-1,g("unclosed tag");if(34===_)a=-1!==(v=e.indexOf('"',a+1))?v:a;else if(39===_)a=-1!==(v=e.indexOf("'",a+1))?v:a;else if(62===_){T=a;break}}if(33!==w){if(O={},47===w){if(P=!1,D=!0,!j.length)return g("missing open tag");if(a=E=j.pop(),v=R+2+a.length,e.substring(R+2,v)!==a)return g("closing tag mismatch");for(;v<T;v++)if(!(32===(w=e.charCodeAt(v))||w>8&&w<14))return g("close tag")}else{if(47===e.charCodeAt(T-1)?(a=E=e.substring(R+1,T-1),P=!0,D=!0):(a=E=e.substring(R+1,T),P=!0,D=!1),!(w>96&&w<123||w>64&&w<91||95===w||58===w))return g("illegal first char nodeName");for(v=1,f=a.length;v<f;v++)if(!((w=a.charCodeAt(v))>96&&w<123||w>64&&w<91||w>47&&w<59||45===w||95===w||46==w)){if(32===w||w<14&&w>8){E=a.substring(0,v),O=null;break}return g("invalid nodeName")}D||j.push(E)}if(m){if(n=M,P&&(D||S.push(n),null===O&&(d=-1!==a.indexOf("xmlns",v))&&(I=v,A=a,B(),d=!1)),k=E,-1!==(w=E.indexOf(":"))){if(!(x=M[E.substring(0,w)]))return g("missing namespace on <"+k+">");E=E.substr(w+1)}else x=M.xmlns;x&&(E=x+":"+E)}if(P&&(I=v,A=a,r&&(p?r(C,Ae,D,h):r(E,B,Ae,D,h),y)))return;if(D){if(i&&(i(p?C:E,Ae,P,h),y))return;m&&(M=P?n:S.pop())}T+=1}else{if(u&&(u(e.substring(R,T+1),Ae,h),y))return;T+=1}}else{if(-1===(T=e.indexOf("?>",R)))return g("unclosed question");if(l&&(l(e.substring(R,T+2),h),y))return;T+=2}}}(e),h=Fe,y=!1,v},this.stop=function(){y=!0}}function Ge(e){return e.xml&&"lowerCase"===e.xml.tagAlias}var He={xsi:"http://www.w3.org/2001/XMLSchema-instance",xml:"http://www.w3.org/XML/1998/namespace"},Xe="xsi:type";function Ye(e){return e.xml&&e.xml.serialize}function Ke(e){return Ye(e)===Xe}function Ze(e,t){return Ge(t)?e.prefix+":"+((n=e.localName).charAt(0).toUpperCase()+n.slice(1)):e.name;var n}function Qe(e){return new Error(e)}function Je(e){return e.$descriptor}function et(e){je(this,e),this.elementsById={},this.references=[],this.warnings=[],this.addReference=function(e){this.references.push(e)},this.addElement=function(e){if(!e)throw Qe("expected element");var t,n=this.elementsById,r=Je(e).idProperty;if(r&&(t=e.get(r.name))){if(!/^([a-z][\w-.]*:)?[a-z_][\w-.]*$/i.test(t))throw new Error("illegal ID <"+t+">");if(n[t])throw Qe("duplicate ID <"+t+">");n[t]=e}},this.addWarning=function(e){this.warnings.push(e)}}function tt(){}function nt(){}function rt(){}function it(e,t){this.property=e,this.context=t}function ot(e,t){this.element=t,this.propertyDesc=e}function at(){}function st(e,t,n){this.model=e,this.type=e.getType(t),this.context=n}function lt(e,t,n){st.call(this,e,t,n)}function ut(e,t,n){this.model=e,this.context=n}function ct(e){e instanceof ve&&(e={model:e}),je(this,{lax:!1},e)}tt.prototype.handleEnd=function(){},tt.prototype.handleText=function(){},tt.prototype.handleNode=function(){},nt.prototype=Object.create(tt.prototype),nt.prototype.handleNode=function(){return this},rt.prototype=Object.create(tt.prototype),rt.prototype.handleText=function(e){this.body=(this.body||"")+e},it.prototype=Object.create(rt.prototype),it.prototype.handleNode=function(e){if(this.element)throw Qe("expected no sub nodes");return this.element=this.createReference(e),this},it.prototype.handleEnd=function(){this.element.id=this.body},it.prototype.createReference=function(e){return{property:this.property.ns.name,id:""}},ot.prototype=Object.create(rt.prototype),ot.prototype.handleEnd=function(){var e=this.body||"",t=this.element,n=this.propertyDesc;e=se(n.type,e),n.isMany?t.get(n.name).push(e):t.set(n.name,e)},at.prototype=Object.create(rt.prototype),at.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},st.prototype=Object.create(at.prototype),st.prototype.addReference=function(e){this.context.addReference(e)},st.prototype.handleText=function(e){if(!Je(this.element).bodyProperty)throw Qe("unexpected body text <"+e+">");rt.prototype.handleText.call(this,e)},st.prototype.handleEnd=function(){var e=this.body,t=this.element,n=Je(t).bodyProperty;n&&void 0!==e&&(e=se(n.type,e),t.set(n.name,e))},st.prototype.createElement=function(e){var t,n=e.attributes,r=this.type,i=Je(r),o=this.context,a=new r({}),s=this.model;return ke(n,(function(e,n){var r=i.propertiesByName[n];r&&r.isReference?r.isMany?ke(e.split(" "),(function(e){o.addReference({element:a,property:r.ns.name,id:e})})):o.addReference({element:a,property:r.ns.name,id:e}):(r?e=se(r.type,e):"xmlns"!==n&&(t=ce(n,i.ns.prefix),s.getPackage(t.prefix)&&o.addWarning({message:"unknown attribute <"+n+">",element:a,property:n,value:e})),a.set(n,e))})),a},st.prototype.getPropertyForNode=function(e){var t,n,r=ce(e.name),i=this.type,o=this.model,a=Je(i),s=r.name,l=a.propertiesByName[s];if(l&&!l.isAttr)return Ke(l)&&(t=e.attributes[Xe])?(t=function(e,t){var n=ce(e);return function(e,t){var n=e.name,r=e.localName,i=t.xml&&t.xml.typePrefix;return i&&0===r.indexOf(i)?e.prefix+":"+r.slice(i.length):n}(n,t.getPackage(n.prefix))}(t,o),je({},l,{effectiveType:Je(n=o.getType(t)).name})):l;var u=o.getPackage(r.prefix);if(u){if(t=Ze(r,u),n=o.getType(t),l=xe(a.properties,(function(e){return!e.isVirtual&&!e.isReference&&!e.isAttribute&&n.hasType(e.type)})))return je({},l,{effectiveType:Je(n).name})}else if(l=xe(a.properties,(function(e){return!e.isReference&&!e.isAttribute&&"Element"===e.type})))return l;throw Qe("unrecognized element <"+r.name+">")},st.prototype.toString=function(){return"ElementDescriptor["+Je(this.type).name+"]"},st.prototype.valueHandler=function(e,t){return new ot(e,t)},st.prototype.referenceHandler=function(e){return new it(e,this.context)},st.prototype.handler=function(e){return"Element"===e?new ut(this.model,e,this.context):new st(this.model,e,this.context)},st.prototype.handleChild=function(e){var t,n,r,i;if(t=this.getPropertyForNode(e),r=this.element,ue(n=t.effectiveType||t.type))return this.valueHandler(t,r);var o=(i=t.isReference?this.referenceHandler(t).handleNode(e):this.handler(n).handleNode(e)).element;return void 0!==o&&(t.isMany?r.get(t.name).push(o):r.set(t.name,o),t.isReference?(je(o,{element:r}),this.context.addReference(o)):o.$parent=r),i},lt.prototype=Object.create(st.prototype),lt.prototype.createElement=function(e){var t=e.name,n=ce(t),r=this.model,i=this.type,o=r.getPackage(n.prefix),a=o&&Ze(n,o)||t;if(!i.hasType(a))throw Qe("unexpected element <"+e.originalName+">");return st.prototype.createElement.call(this,e)},ut.prototype=Object.create(at.prototype),ut.prototype.createElement=function(e){var t=e.name,n=ce(t).prefix,r=e.ns[n+"$uri"],i=e.attributes;return this.model.createAny(t,r,i)},ut.prototype.handleChild=function(e){var t=new ut(this.model,"Element",this.context).handleNode(e),n=this.element,r=t.element;return void 0!==r&&((n.$children=n.$children||[]).push(r),r.$parent=n),t},ut.prototype.handleEnd=function(){this.body&&(this.element.$body=this.body)},ct.prototype.fromXML=function(e,t,n){var r=t.rootHandler;t instanceof st?(r=t,t={}):"string"==typeof t?(r=this.handler(t),t={}):"string"==typeof r&&(r=this.handler(r));var i=this.model,o=this.lax,a=new et(je({},t,{rootHandler:r})),s=new qe({proxy:!0}),l=function(){var e=[];return Object.defineProperty(e,"peek",{value:function(){return this[this.length-1]}}),e}();function u(e,t,n){var r=t(),i=r.line,o=r.column,s=r.data;"<"===s.charAt(0)&&-1!==s.indexOf(" ")&&(s=s.slice(0,s.indexOf(" "))+">");var l="unparsable content "+(s?s+" ":"")+"detected\n\tline: "+i+"\n\tcolumn: "+o+"\n\tnested error: "+e.message;if(n)return a.addWarning({message:l,error:e}),!0;throw Qe(l)}function c(e,t){return u(e,t,!0)}r.context=a,l.push(r);var p=/^<\?xml /i,f=/ encoding="([^"]+)"/i,h=/^utf-8$/i;function d(e,t){try{l.peek().handleText(e)}catch(e){c(e,t)}}var m=i.getPackages().reduce((function(e,t){return e[t.uri]=t.prefix,e}),{"http://www.w3.org/XML/1998/namespace":"xml"});return s.ns(m).on("openTag",(function(e,t,n,r){var i=e.attrs||{},a=Object.keys(i).reduce((function(e,n){var r=t(i[n]);return e[n]=r,e}),{});!function(e,t){var n=l.peek();try{l.push(n.handleNode(e))}catch(e){u(e,t,o)&&l.push(new nt)}}({name:e.name,originalName:e.originalName,attributes:a,ns:e.ns},r)})).on("question",(function(e){if(p.test(e)){var t=f.exec(e),n=t&&t[1];n&&!h.test(n)&&a.addWarning({message:"unsupported document encoding <"+n+">, falling back to UTF-8"})}})).on("closeTag",(function(){l.pop().handleEnd()})).on("cdata",d).on("text",(function(e,t,n){!function(e,t){e.trim()&&d(e,t)}(t(e),n)})).on("error",u).on("warn",c),new Promise((function(t,n){var i;try{s.parse(e),function(){var e,t,n=a.elementsById,r=a.references;for(e=0;t=r[e];e++){var i=t.element,o=n[t.id],s=Je(i).propertiesByName[t.property];if(o||a.addWarning({message:"unresolved reference <"+t.id+">",element:t.element,property:t.property,value:t.id}),s.isMany){var l=i.get(s.name),u=l.indexOf(t);-1===u&&(u=l.length),o?l[u]=o:l.splice(u,1)}else i.set(s.name,o)}}()}catch(e){i=e}var o=r.element;i||o||(i=Qe("failed to parse document as <"+r.type.$descriptor.name+">"));var l=a.warnings,u=a.references,c=a.elementsById;return i?(i.warnings=l,n(i)):t({rootElement:o,elementsById:c,references:u,warnings:l})}))},ct.prototype.handler=function(e){return new lt(this.model,e)};var pt=/<|>|'|"|&|\n\r|\n/g,ft=/<|>|&/g;function ht(e){var t={},n={},r={},i=[],o=[];this.byUri=function(t){return n[t]||e&&e.byUri(t)},this.add=function(e,t){n[e.uri]=e,t?i.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,i=this.getNSKey(t);r[i]=this.byUri(n),e&&e.logUsed(t)},this.getUsed=function(e){var t=this;return[].concat(i,o).filter((function(e){var n=t.getNSKey(e);return r[n]}))}}function dt(e,t){return Ge(t)?(n=e).charAt(0).toLowerCase()+n.slice(1):e;var n}function mt(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}function vt(e){return we(e)?e:(e.prefix?e.prefix+":":"")+e.localName}var yt={"\n":"#10","\n\r":"#10",'"':"#34","'":"#39","<":"#60",">":"#62","&":"#38"},gt={"<":"lt",">":"gt","&":"amp"};function bt(e,t,n){return(e=we(e)?e:""+e).replace(t,(function(e){return"&"+n[e]+";"}))}function wt(e){this.tagName=e}function _t(){}function xt(e){this.tagName=e}function Et(e,t){this.body=[],this.attrs=[],this.parent=e,this.propertyDescriptor=t}function kt(e,t){Et.call(this,e,t)}function Ct(){this.value="",this.write=function(e){this.value+=e}}function Ot(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 St(e){return e=je({format:!1,preamble:!0},e||{}),{toXML:function(t,n){var r=n||new Ct,i=new Ot(r,e.format);if(e.preamble&&i.append('<?xml version="1.0" encoding="UTF-8"?>\n'),(new Et).build(t).serializeTo(i),!n)return r.value}}}function Mt(e,t){ve.call(this,e,t)}wt.prototype.build=function(e){return this.element=e,this},wt.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"+this.element.id+"</"+this.tagName+">").appendNewLine()},_t.prototype.serializeValue=_t.prototype.serializeTo=function(e){e.append(this.escape?bt(this.value,ft,gt):this.value)},_t.prototype.build=function(e,t){return this.value=t,"String"===e.type&&-1!==t.search(ft)&&(this.escape=!0),this},mt(xt,_t),xt.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"),this.serializeValue(e),e.append("</"+this.tagName+">").appendNewLine()},Et.prototype.build=function(e){this.element=e;var t,n,r=e.$descriptor,i=this.propertyDescriptor,o=r.isGeneric;return t=o?this.parseGeneric(e):this.parseNsAttributes(e),this.ns=i?this.nsPropertyTagName(i):this.nsTagName(r),this.tagName=this.addTagName(this.ns),o||(n=function(e){return Ee(e.$descriptor.properties,(function(t){var n=t.name;if(t.isVirtual)return!1;if(!_e(e,n))return!1;var r=e[n];return r!==t.default&&null!==r&&(!t.isMany||r.length)}))}(e),this.parseAttributes(Ee(n,(function(e){return e.isAttr}))),this.parseContainments(function(e){return Ee(e,(function(e){return!e.isAttr}))}(n))),this.parseGenericAttributes(e,t),this},Et.prototype.nsTagName=function(e){return function(e,t){return t.isGeneric?je({localName:t.ns.localName},e):je({localName:dt(t.ns.localName,t.$pkg)},e)}(this.logNamespaceUsed(e.ns),e)},Et.prototype.nsPropertyTagName=function(e){return function(e,t){return je({localName:t.ns.localName},e)}(this.logNamespaceUsed(e.ns),e)},Et.prototype.isLocalNs=function(e){return e.uri===this.ns.uri},Et.prototype.nsAttributeName=function(e){var t;if(t=we(e)?ce(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}:je({localName:t.localName},n)},Et.prototype.parseGeneric=function(e){var t=this,n=this.body,r=[];return ke(e,(function(i,o){"$body"===o?n.push((new _t).build({type:"String"},i)):"$children"===o?ke(i,(function(e){n.push(new Et(t).build(e))})):0!==o.indexOf("$")&&t.parseNsAttribute(e,o,i)&&r.push({name:o,value:i})})),r},Et.prototype.parseNsAttribute=function(e,t,n){var r,i=e.$model,o=ce(t);if("xmlns"===o.prefix&&(r={prefix:o.localName,uri:n}),o.prefix||"xmlns"!==o.localName||(r={uri:n}),!r)return{name:t,value:n};if(i&&i.getPackage(n))this.logNamespace(r,!0,!0);else{var a=this.logNamespaceUsed(r,!0);this.getNamespaces().logUsed(a)}},Et.prototype.parseNsAttributes=function(e,t){var n=this,r=e.$attrs,i=[];return ke(r,(function(t,r){var o=n.parseNsAttribute(e,r,t);o&&i.push(o)})),i},Et.prototype.parseGenericAttributes=function(e,t){var n=this;ke(t,(function(t){if(t.name!==Xe)try{n.addAttribute(n.nsAttributeName(t.name),t.value)}catch(n){console.warn("missing namespace information for ",t.name,"=",t.value,"on",e,n)}}))},Et.prototype.parseContainments=function(e){var t=this,n=this.body,r=this.element;ke(e,(function(e){var i=r.get(e.name),o=e.isReference;if(e.isMany||(i=[i]),e.isBody)n.push((new _t).build(e,i[0]));else if(ue(e.type))ke(i,(function(r){n.push(new xt(t.addTagName(t.nsPropertyTagName(e))).build(e,r))}));else if(o)ke(i,(function(r){n.push(new wt(t.addTagName(t.nsPropertyTagName(e))).build(r))}));else{var a=Ke(e),s=function(e){return"property"===Ye(e)}(e);ke(i,(function(r){var i;i=a?new kt(t,e):s?new Et(t,e):new Et(t),n.push(i.build(r))}))}}))},Et.prototype.getNamespaces=function(e){var t,n=this.namespaces,r=this.parent;return n||(t=r&&r.getNamespaces(),e||!t?this.namespaces=n=new ht(t):n=t),n},Et.prototype.logNamespace=function(e,t,n){var r=this.getNamespaces(n),i=e.uri,o=e.prefix;return r.byUri(i)&&!n||r.add(e,t),r.mapPrefix(o,i),e},Et.prototype.logNamespaceUsed=function(e,t){var n,r,i,o=this.element.$model,a=this.getNamespaces(t),s=e.prefix,l=e.uri;if(!s&&!l)return{localName:e.localName};if(i=He[s]||o&&(o.getPackage(s)||{}).uri,!(l=l||i||a.uriByPrefix(s)))throw new Error("no namespace uri given for prefix <"+s+">");if(!(e=a.byUri(l))){for(n=s,r=1;a.uriByPrefix(n);)n=s+"_"+r++;e=this.logNamespace({prefix:n,uri:l},i===l)}return s&&a.mapPrefix(s,l),e},Et.prototype.parseAttributes=function(e){var t=this,n=this.element;ke(e,(function(e){var r=n.get(e.name);if(e.isReference)if(e.isMany){var i=[];ke(r,(function(e){i.push(e.id)})),r=i.join(" ")}else r=r.id;t.addAttribute(t.nsAttributeName(e),r)}))},Et.prototype.addTagName=function(e){var t=this.logNamespaceUsed(e);return this.getNamespaces().logUsed(t),vt(e)},Et.prototype.addAttribute=function(e,t){var n=this.attrs;we(t)&&(t=bt(t,pt,yt));var r=function(e,t){t=Ce(t);var n=be(e)?-1:void 0;return ke(e,(function(e,r){if(t(e,r))return n=r,!1})),n}(n,(function(t){return t.name.localName===e.localName&&t.name.uri===e.uri&&t.name.prefix===e.prefix})),i={name:e,value:t};-1!==r?n.splice(r,1,i):n.push(i)},Et.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)),ke(t,(function(t){e.append(" ").append(vt(t.name)).append('="').append(t.value).append('"')}))},Et.prototype.serializeTo=function(e){var t=this.body[0],n=t&&t.constructor!==_t;e.appendIndent().append("<"+this.tagName),this.serializeAttributes(e),e.append(t?">":" />"),t&&(n&&e.appendNewLine().indent(),ke(this.body,(function(t){t.serializeTo(e)})),n&&e.unindent().appendIndent(),e.append("</"+this.tagName+">")),e.appendNewLine()},mt(kt,Et),kt.prototype.parseNsAttributes=function(e){var t=Et.prototype.parseNsAttributes.call(this,e),n=e.$descriptor;if(n.name===this.propertyDescriptor.type)return t;var r=this.typeNs=this.nsTagName(n);this.getNamespaces().logUsed(this.typeNs);var i=e.$model.getPackage(r.uri),o=i.xml&&i.xml.typePrefix||"";return this.addAttribute(this.nsAttributeName(Xe),(r.prefix?r.prefix+":":"")+o+n.ns.localName),t},kt.prototype.isLocalNs=function(e){return e.uri===(this.typeNs||this.ns).uri},Mt.prototype=Object.create(ve.prototype),Mt.prototype.fromXML=function(e,t,n){var r;r=t,"[object String]"!==W.call(r)&&(n=t,t="dmn:Definitions");var i=new ct(G({model:this,lax:!0},n)),o=i.handler(t);return i.fromXML(e,o)},Mt.prototype.toXML=function(e,t){var n=new St(t);return new Promise((function(t,r){try{return t({xml:n.toXML(e)})}catch(e){return r(e)}}))};var jt={dc:{name:"DC",prefix:"dc",uri:"http://www.omg.org/spec/DMN/20180521/DC/",types:[{name:"Dimension",properties:[{name:"width",isAttr:!0,type:"Real"},{name:"height",isAttr:!0,type:"Real"}]},{name:"Bounds",properties:[{name:"height",isAttr:!0,type:"Real"},{name:"width",isAttr:!0,type:"Real"},{name:"x",isAttr:!0,type:"Real"},{name:"y",isAttr:!0,type:"Real"}]},{name:"Point",properties:[{name:"x",isAttr:!0,type:"Real"},{name:"y",isAttr:!0,type:"Real"}]},{name:"Color",properties:[{name:"red",type:"UML_Standard_Profile.mdzip:eee_1045467100323_917313_65"},{name:"green",type:"UML_Standard_Profile.mdzip:eee_1045467100323_917313_65"},{name:"blue",type:"UML_Standard_Profile.mdzip:eee_1045467100323_917313_65"}]}],associations:[],enumerations:[{name:"AlignmentKind",literalValues:[{name:"start"},{name:"center"},{name:"end"}]}]},di:{name:"DI",prefix:"di",uri:"http://www.omg.org/spec/DMN/20180521/DI/",types:[{name:"DiagramElement",isAbstract:!0,properties:[{name:"extension",type:"Extension"},{name:"id",isAttr:!0,isId:!0,type:"String"},{name:"style",isReference:!0,type:"Style",xml:{serialize:"property"}},{name:"sharedStyle",isReference:!0,isVirtual:!0,type:"Style"}]},{name:"Diagram",superClass:["DiagramElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"documentation",isAttr:!0,type:"String"},{name:"resolution",isAttr:!0,type:"Real"}]},{name:"Shape",isAbstract:!0,properties:[{name:"bounds",type:"dc:Bounds"}],superClass:["DiagramElement"]},{name:"Edge",isAbstract:!0,properties:[{name:"waypoint",type:"dc:Point",isMany:!0,xml:{serialize:"property"}}],superClass:["DiagramElement"]},{name:"Style",isAbstract:!0,properties:[{name:"id",isAttr:!0,isId:!0,type:"String"}]},{name:"Extension",properties:[{name:"values",isMany:!0,type:"Element"}]}],associations:[],enumerations:[],xml:{tagAlias:"lowerCase"}},dmn:{name:"DMN",prefix:"dmn",uri:"https://www.omg.org/spec/DMN/20191111/MODEL/",types:[{name:"AuthorityRequirement",superClass:["DMNElement"],properties:[{name:"requiredAuthority",type:"DMNElementReference",xml:{serialize:"property"}},{name:"requiredDecision",type:"DMNElementReference",xml:{serialize:"property"}},{name:"requiredInput",type:"DMNElementReference",xml:{serialize:"property"}}]},{name:"ItemDefinition",superClass:["NamedElement"],properties:[{name:"typeRef",type:"String"},{name:"allowedValues",type:"UnaryTests",xml:{serialize:"property"}},{name:"typeLanguage",type:"String",isAttr:!0},{name:"itemComponent",type:"ItemDefinition",isMany:!0,xml:{serialize:"property"}},{name:"functionItem",type:"FunctionItem"},{name:"isCollection",isAttr:!0,type:"Boolean"}]},{name:"Definitions",superClass:["NamedElement"],properties:[{name:"import",type:"Import",isMany:!0},{name:"itemDefinition",type:"ItemDefinition",isMany:!0},{name:"drgElement",type:"DRGElement",isMany:!0},{name:"artifact",type:"Artifact",isMany:!0},{name:"elementCollection",type:"ElementCollection",isMany:!0},{name:"businessContextElement",type:"BusinessContextElement",isMany:!0},{name:"namespace",type:"String",isAttr:!0},{name:"expressionLanguage",type:"String",isAttr:!0},{name:"typeLanguage",type:"String",isAttr:!0},{name:"exporter",isAttr:!0,type:"String"},{name:"exporterVersion",isAttr:!0,type:"String"},{name:"dmnDI",type:"dmndi:DMNDI"}]},{name:"KnowledgeSource",superClass:["DRGElement"],properties:[{name:"authorityRequirement",type:"AuthorityRequirement",isMany:!0},{name:"type",type:"String"},{name:"owner",type:"DMNElementReference",xml:{serialize:"property"}},{name:"locationURI",type:"String",isAttr:!0}]},{name:"DecisionRule",superClass:["DMNElement"],properties:[{name:"inputEntry",type:"UnaryTests",isMany:!0,xml:{serialize:"property"}},{name:"outputEntry",type:"LiteralExpression",isMany:!0,xml:{serialize:"property"}},{name:"annotationEntry",type:"RuleAnnotation",isMany:!0,xml:{serialize:"property"}}]},{name:"Expression",isAbstract:!0,superClass:["DMNElement"],properties:[{name:"typeRef",isAttr:!0,type:"String"}]},{name:"InformationItem",superClass:["NamedElement"],properties:[{name:"typeRef",isAttr:!0,type:"String"}]},{name:"Decision",superClass:["DRGElement"],properties:[{name:"question",type:"String",xml:{serialize:"property"}},{name:"allowedAnswers",type:"String",xml:{serialize:"property"}},{name:"variable",type:"InformationItem",xml:{serialize:"property"}},{name:"informationRequirement",type:"InformationRequirement",isMany:!0},{name:"knowledgeRequirement",type:"KnowledgeRequirement",isMany:!0},{name:"authorityRequirement",type:"AuthorityRequirement",isMany:!0},{name:"supportedObjective",isMany:!0,type:"DMNElementReference",xml:{serialize:"property"}},{name:"impactedPerformanceIndicator",type:"DMNElementReference",isMany:!0,xml:{serialize:"property"}},{name:"decisionMaker",type:"DMNElementReference",isMany:!0,xml:{serialize:"property"}},{name:"decisionOwner",type:"DMNElementReference",isMany:!0,xml:{serialize:"property"}},{name:"usingProcess",isMany:!0,type:"DMNElementReference",xml:{serialize:"property"}},{name:"usingTask",isMany:!0,type:"DMNElementReference",xml:{serialize:"property"}},{name:"decisionLogic",type:"Expression"}]},{name:"Invocation",superClass:["Expression"],properties:[{name:"calledFunction",type:"Expression"},{name:"binding",type:"Binding",isMany:!0}]},{name:"OrganisationalUnit",superClass:["BusinessContextElement"],properties:[{name:"decisionMade",type:"Decision",isReference:!0,isMany:!0},{name:"decisionOwned",type:"Decision",isReference:!0,isMany:!0}]},{name:"Import",superClass:["NamedElement"],properties:[{name:"importType",type:"String",isAttr:!0},{name:"locationURI",type:"String",isAttr:!0},{name:"namespace",type:"String",isAttr:!0}]},{name:"InformationRequirement",superClass:["DMNElement"],properties:[{name:"requiredDecision",type:"DMNElementReference",xml:{serialize:"property"}},{name:"requiredInput",type:"DMNElementReference",xml:{serialize:"property"}}]},{name:"ElementCollection",superClass:["NamedElement"],properties:[{name:"drgElement",type:"DMNElementReference",isMany:!0,xml:{serialize:"property"}}]},{name:"DRGElement",isAbstract:!0,superClass:["NamedElement"],properties:[]},{name:"InputData",superClass:["DRGElement"],properties:[{name:"variable",type:"InformationItem",xml:{serialize:"property"}}]},{name:"DMNElement",isAbstract:!0,properties:[{name:"description",type:"String"},{name:"extensionElements",type:"ExtensionElements"},{name:"id",type:"String",isAttr:!0,isId:!0},{name:"extensionAttribute",type:"ExtensionAttribute",isMany:!0},{name:"label",isAttr:!0,type:"String"}]},{name:"InputClause",superClass:["DMNElement"],properties:[{name:"inputExpression",type:"LiteralExpression",xml:{serialize:"property"}},{name:"inputValues",type:"UnaryTests",xml:{serialize:"property"}}]},{name:"DecisionTable",superClass:["Expression"],properties:[{name:"input",type:"InputClause",isMany:!0,xml:{serialize:"property"}},{name:"output",type:"OutputClause",isMany:!0,xml:{serialize:"property"}},{name:"annotation",type:"RuleAnnotationClause",isMany:!0,xml:{serialize:"property"}},{name:"rule",type:"DecisionRule",isMany:!0,xml:{serialize:"property"}},{name:"hitPolicy",type:"HitPolicy",isAttr:!0,default:"UNIQUE"},{name:"aggregation",type:"BuiltinAggregator",isAttr:!0},{name:"preferredOrientation",type:"DecisionTableOrientation",isAttr:!0},{name:"outputLabel",isAttr:!0,type:"String"}]},{name:"LiteralExpression",superClass:["Expression"],properties:[{name:"expressionLanguage",type:"String",isAttr:!0},{name:"text",type:"String"},{name:"importedValues",type:"ImportedValues"}]},{name:"Binding",properties:[{name:"parameter",type:"InformationItem",xml:{serialize:"property"}},{name:"bindingFormula",type:"Expression"}]},{name:"KnowledgeRequirement",superClass:["DMNElement"],properties:[{name:"requiredKnowledge",type:"DMNElementReference",xml:{serialize:"property"}}]},{name:"BusinessKnowledgeModel",superClass:["Invocable"],properties:[{name:"encapsulatedLogic",type:"FunctionDefinition",xml:{serialize:"property"}},{name:"knowledgeRequirement",type:"KnowledgeRequirement",isMany:!0},{name:"authorityRequirement",type:"AuthorityRequirement",isMany:!0}]},{name:"BusinessContextElement",isAbstract:!0,superClass:["NamedElement"],properties:[{name:"URI",type:"String",isAttr:!0}]},{name:"PerformanceIndicator",superClass:["BusinessContextElement"],properties:[{name:"impactingDecision",type:"DMNElementReference",isMany:!0,xml:{serialize:"property"}}]},{name:"FunctionDefinition",superClass:["Expression"],properties:[{name:"formalParameter",type:"InformationItem",isMany:!0,xml:{serialize:"property"}},{name:"body",type:"Expression"},{name:"kind",type:"FunctionKind",isAttr:!0}]},{name:"Context",superClass:["Expression"],properties:[{name:"contextEntry",type:"ContextEntry",isMany:!0}]},{name:"ContextEntry",superClass:["DMNElement"],properties:[{name:"variable",type:"InformationItem",xml:{serialize:"property"}},{name:"value",type:"Expression"}]},{name:"List",superClass:["Expression"],properties:[{name:"elements",isMany:!0,type:"Expression"}]},{name:"Relation",superClass:["Expression"],properties:[{name:"column",type:"InformationItem",isMany:!0,xml:{serialize:"property"}},{name:"row",type:"List",isMany:!0,xml:{serialize:"property"}}]},{name:"OutputClause",superClass:["DMNElement"],properties:[{name:"outputValues",type:"UnaryTests",xml:{serialize:"property"}},{name:"defaultOutputEntry",type:"LiteralExpression",xml:{serialize:"property"}},{name:"name",isAttr:!0,type:"String"},{name:"typeRef",isAttr:!0,type:"String"}]},{name:"UnaryTests",superClass:["Expression"],properties:[{name:"text",type:"String"},{name:"expressionLanguage",type:"String",isAttr:!0}]},{name:"NamedElement",isAbstract:!0,superClass:["DMNElement"],properties:[{name:"name",isAttr:!0,type:"String"}]},{name:"ImportedValues",superClass:["Import"],properties:[{name:"importedElement",type:"String"},{name:"expressionLanguage",type:"String",isAttr:!0}]},{name:"DecisionService",superClass:["Invocable"],properties:[{name:"outputDecision",type:"DMNElementReference",isMany:!0,xml:{serialize:"property"}},{name:"encapsulatedDecision",type:"DMNElementReference",isMany:!0,xml:{serialize:"property"}},{name:"inputDecision",type:"DMNElementReference",isMany:!0,xml:{serialize:"property"}},{name:"inputData",type:"DMNElementReference",isMany:!0,xml:{serialize:"property"}}]},{name:"ExtensionElements",properties:[{name:"values",type:"Element",isMany:!0}]},{name:"ExtensionAttribute",properties:[{name:"value",type:"Element"},{name:"valueRef",type:"Element",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Element",isAbstract:!0,properties:[{name:"extensionAttribute",type:"ExtensionAttribute",isAttr:!0,isReference:!0},{name:"elements",type:"ExtensionElements",isAttr:!0,isReference:!0}]},{name:"Artifact",isAbstract:!0,superClass:["DMNElement"],properties:[]},{name:"Association",superClass:["Artifact"],properties:[{name:"sourceRef",type:"DMNElementReference",xml:{serialize:"property"}},{name:"targetRef",type:"DMNElementReference",xml:{serialize:"property"}},{name:"associationDirection",type:"AssociationDirection",isAttr:!0}]},{name:"TextAnnotation",superClass:["Artifact"],properties:[{name:"text",type:"String"},{name:"textFormat",isAttr:!0,type:"String",default:"text/plain"}]},{name:"RuleAnnotationClause",properties:[{name:"name",isAttr:!0,type:"String"}]},{name:"RuleAnnotation",properties:[{name:"text",type:"String"}]},{name:"Invocable",isAbstract:!0,superClass:["DRGElement"],properties:[{name:"variable",type:"InformationItem",xml:{serialize:"property"}}]},{name:"Group",superClass:["Artifact"],properties:[{name:"name",isAttr:!0,type:"String"}]},{name:"FunctionItem",superClass:["DMNElement"],properties:[{name:"parameters",isMany:!0,type:"InformationItem",xml:{serialize:"property"}},{name:"outputTypeRef",isAttr:!0,type:"String"}]},{name:"DMNElementReference",properties:[{isAttr:!0,name:"href",type:"String"}]}],enumerations:[{name:"HitPolicy",literalValues:[{name:"UNIQUE"},{name:"FIRST"},{name:"PRIORITY"},{name:"ANY"},{name:"COLLECT"},{name:"RULE ORDER"},{name:"OUTPUT ORDER"}]},{name:"BuiltinAggregator",literalValues:[{name:"SUM"},{name:"COUNT"},{name:"MIN"},{name:"MAX"}]},{name:"DecisionTableOrientation",literalValues:[{name:"Rule-as-Row"},{name:"Rule-as-Column"},{name:"CrossTable"}]},{name:"AssociationDirection",literalValues:[{name:"None"},{name:"One"},{name:"Both"}]},{name:"FunctionKind",literalValues:[{name:"FEEL"},{name:"Java"},{name:"PMML"}]}],associations:[],xml:{tagAlias:"lowerCase"}},dmndi:{name:"DMNDI",prefix:"dmndi",uri:"https://www.omg.org/spec/DMN/20191111/DMNDI/",types:[{name:"DMNDI",properties:[{name:"diagrams",type:"DMNDiagram",isMany:!0},{name:"styles",type:"DMNStyle",isMany:!0}]},{name:"DMNStyle",superClass:["di:Style"],properties:[{name:"fillColor",type:"dc:Color",isAttr:!0},{name:"strokeColor",type:"dc:Color",isAttr:!0},{name:"fontColor",type:"dc:Color",isAttr:!0},{name:"fontSize",isAttr:!0,type:"Real"},{name:"fontFamily",isAttr:!0,type:"String"},{name:"fontItalic",isAttr:!0,type:"Boolean"},{name:"fontBold",isAttr:!0,type:"Boolean"},{name:"fontUnderline",isAttr:!0,type:"Boolean"},{name:"fontStrikeThrough",isAttr:!0,type:"Boolean"},{name:"labelHorizontalAlignment",type:"dc:AlignmentKind",isAttr:!0},{name:"labelVerticalAlignment",type:"dc:AlignmentKind",isAttr:!0}]},{name:"DMNDiagram",superClass:["di:Diagram"],properties:[{name:"dmnElementRef",type:"dmn:DMNElement",isAttr:!0,isReference:!0},{name:"size",type:"Size"},{name:"localStyle",type:"DMNStyle",isVirtual:!0},{name:"sharedStyle",type:"DMNStyle",isVirtual:!0,isReference:!0,redefines:"di:DiagramElement#sharedStyle"},{name:"diagramElements",type:"DMNDiagramElement",isMany:!0}]},{name:"DMNDiagramElement",isAbstract:!0,superClass:["di:DiagramElement"],properties:[{name:"dmnElementRef",type:"dmn:DMNElement",isAttr:!0,isReference:!0},{name:"sharedStyle",type:"DMNStyle",isVirtual:!0,isReference:!0,redefines:"di:DiagramElement#sharedStyle"},{name:"localStyle",type:"DMNStyle",isVirtual:!0},{name:"label",type:"DMNLabel"}]},{name:"DMNLabel",superClass:["di:Shape"],properties:[{name:"text",type:"Text"}]},{name:"DMNShape",superClass:["di:Shape","DMNDiagramElement"],properties:[{name:"isListedInputData",isAttr:!0,type:"Boolean"},{name:"decisionServiceDividerLine",type:"DMNDecisionServiceDividerLine"},{name:"isCollapsed",isAttr:!0,type:"Boolean"}]},{name:"DMNEdge",superClass:["di:Edge","DMNDiagramElement"],properties:[{name:"sourceElement",type:"DMNDiagramElement",isAttr:!0,isReference:!0},{name:"targetElement",type:"DMNDiagramElement",isAttr:!0,isReference:!0}]},{name:"DMNDecisionServiceDividerLine",superClass:["di:Edge"]},{name:"Text",properties:[{name:"text",isBody:!0,type:"String"}]},{name:"Size",superClass:["dc:Dimension"]}],associations:[],enumerations:[]},biodi:{name:"bpmn.io DI for DMN",uri:"http://bpmn.io/schema/dmn/biodi/2.0",prefix:"biodi",xml:{tagAlias:"lowerCase"},types:[{name:"DecisionTable",isAbstract:!0,extends:["dmn:DecisionTable"],properties:[{name:"annotationsWidth",isAttr:!0,type:"Integer"}]},{name:"OutputClause",isAbstract:!0,extends:["dmn:OutputClause"],properties:[{name:"width",isAttr:!0,type:"Integer"}]},{name:"InputClause",isAbstract:!0,extends:["dmn:InputClause"],properties:[{name:"width",isAttr:!0,type:"Integer"}]}]}};function Nt(e,t){return new Mt(G({},jt,e),t)}function Pt(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 r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}}))})),Object.freeze(e)}var Dt=Object.prototype.toString,Rt=Object.prototype.hasOwnProperty;function Tt(e,t){return Rt.call(e,t)}function At(e,t){var n;if(void 0!==e){var r=function(e){return"[object Array]"===Dt.call(e)}(e)?Bt:It;for(var i in e)if(Tt(e,i)&&!1===t(n=e[i],r(i)))return n}}function It(e){return e}function Bt(e){return Number(e)}function Lt(e){for(var t=e.style,n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return At(r,(function(e){e&&At(e,(function(e,n){t[n]=e}))})),e}function $t(e,t,n){return 2==arguments.length?e.getAttribute(t):null===n?e.removeAttribute(t):(e.setAttribute(t,n),e)}var Vt=Object.prototype.toString;function zt(e){return new Ut(e)}function Ut(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}function Ft(e){for(var t;e.childNodes.length;)t=e.childNodes[0],e.removeChild(t);return e}function Wt(e,t){return e&&"function"==typeof e.matches&&e.matches(t)}function qt(e,t,n){for(var r=n?e:e.parentNode;r&&r.nodeType!==document.DOCUMENT_NODE&&r.nodeType!==document.DOCUMENT_FRAGMENT_NODE;){if(Wt(r,t))return r;r=r.parentNode}return Wt(r,t)?r:null}Ut.prototype.add=function(e){return this.list.add(e),this},Ut.prototype.remove=function(e){return"[object RegExp]"==Vt.call(e)?this.removeMatching(e):(this.list.remove(e),this)},Ut.prototype.removeMatching=function(e){for(var t=this.array(),n=0;n<t.length;n++)e.test(t[n])&&this.remove(t[n]);return this},Ut.prototype.toggle=function(e,t){return void 0!==t?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this},Ut.prototype.array=function(){return Array.from(this.list)},Ut.prototype.has=Ut.prototype.contains=function(e){return this.list.contains(e)};var Gt,Ht,Xt,Yt={};function Kt(){Gt=window.addEventListener?"addEventListener":"attachEvent",Ht=window.removeEventListener?"removeEventListener":"detachEvent",Xt="addEventListener"!==Gt?"on":""}var Zt=Pt({__proto__:null,bind:Yt.bind=function(e,t,n,r){return Gt||Kt(),e[Gt](Xt+t,n,r||!1),n},unbind:Yt.unbind=function(e,t,n,r){return Ht||Kt(),e[Ht](Xt+t,n,r||!1),n},default:Yt},[Yt]),Qt=["focus","blur"];var Jt,en={bind:function(e,t,n,r,i){return-1!==Qt.indexOf(n)&&(i=!0),Zt.bind(e,n,(function(n){var i=n.target||n.srcElement;n.delegateTarget=qt(i,t,!0),n.delegateTarget&&r.call(e,n)}),i)},unbind:function(e,t,n,r){return-1!==Qt.indexOf(t)&&(r=!0),Zt.unbind(e,t,n,r)}},tn=function(e,t){if("string"!=typeof e)throw new TypeError("String expected");t||(t=document);var n=/<([\w:]+)/.exec(e);if(!n)return t.createTextNode(e);e=e.replace(/^\s+|\s+$/g,"");var r=n[1];if("body"==r){return(i=t.createElement("html")).innerHTML=e,i.removeChild(i.lastChild)}var i,o=Object.prototype.hasOwnProperty.call(rn,r)?rn[r]:rn._default,a=o[0],s=o[1],l=o[2];(i=t.createElement("div")).innerHTML=s+e+l;for(;a--;)i=i.lastChild;if(i.firstChild==i.lastChild)return i.removeChild(i.firstChild);var u=t.createDocumentFragment();for(;i.firstChild;)u.appendChild(i.removeChild(i.firstChild));return u},nn=!1;"undefined"!=typeof document&&((Jt=document.createElement("div")).innerHTML='  <link/><table></table><a href="/a">a</a><input type="checkbox"/>',nn=!Jt.getElementsByTagName("link").length,Jt=void 0);var rn={legend:[1,"<fieldset>","</fieldset>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],_default:nn?[1,"X<div>","</div>"]:[0,"",""]};rn.td=rn.th=[3,"<table><tbody><tr>","</tr></tbody></table>"],rn.option=rn.optgroup=[1,'<select multiple="multiple">',"</select>"],rn.thead=rn.tbody=rn.colgroup=rn.caption=rn.tfoot=[1,"<table>","</table>"],rn.polyline=rn.ellipse=rn.polygon=rn.circle=rn.text=rn.line=rn.path=rn.rect=rn.g=[1,'<svg xmlns="http://www.w3.org/2000/svg" version="1.1">',"</svg>"];var on=tn;function an(e,t){return(t=t||document).querySelector(e)}function sn(e){e.parentNode&&e.parentNode.removeChild(e)}function ln(e){return function(){if(!window.Promise)throw new Error("Promises is not supported in this environment. Please polyfill Promise.");var t=arguments.length;if(!(t>=1&&C(arguments[t-1])))return e.apply(this,arguments);var n=arguments[t-1];console.warn(new Error("Passing callbacks to "+un(e.name)+" is deprecated and will be removed in a future major release. Please switch to promises: https://bpmn.io/l/moving-to-promises.html"));var r=Array.prototype.slice.call(arguments,0,-1);e.apply(this,r).then((function(e){var t=Object.keys(e)[0];return n(null,e[t])}),(function(e){return n(e,e.warnings)}))}}function un(e){return e.replace("bound ","")}function cn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function pn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?cn(Object(n),!0).forEach((function(t){fn(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cn(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function fn(e,t,r){return(t=function(e){var t=function(e,t){if("object"!==n(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!==n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===n(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var hn={width:"100%",height:"100%",position:"relative"},dn=function(){function e(){var t=this;r(this,e);var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};fn(this,"_viewsChanged",(function(){t._emit("views.changed",{views:t._views,activeView:t._activeView})})),this._eventBus=new U,this._viewsChanged=I(this._viewsChanged,0),this._views=[],this._viewers={},this.open=ln(this.open.bind(this)),this.importXML=ln(this.importXML.bind(this)),this.saveXML=ln(this.saveXML.bind(this)),this._init(n)}return o(e,[{key:"importXML",value:function(e,t){var n=this;return t=t||{open:!0},new Promise((function(i,o){var a=n._activeView;n._clear().then((function(){var s;e=n._emit("import.parse.start",{xml:e})||e,n._moddle.fromXML(e,"dmn:Definitions").then((function(e){var l=e.rootElement,u=e.references,c=e.elementsById;if(s=e.warnings,l=n._emit("import.parse.complete",r({error:null,definitions:l,elementsById:c,references:u,warnings:s}))||l,n._setDefinitions(l),!t.open)return n._emit("import.done",{error:null,warnings:s}),void i({warnings:s});var p=n._getInitialView(n._views,a);if(!p){var f=new Error("no displayable contents");return n._emit("import.done",{error:f,warnings:s}),f.warnings=s,o(f)}n.open(p).then((function(e){return{warnings:e.warnings}})).catch((function(e){return{error:e,warnings:e.warnings}})).then((function(e){var t=[].concat(s,e.warnings);n._emit("import.done",{error:e.error,warnings:t}),e.error?(e.error.warnings=t,o(e.error)):i({warnings:t})}))})).catch((function(t){return s=t.warnings,t=function(e,t){if("failed to parse document as <dmn:Definitions>"!==e.message)return null;var n=-1!==t.indexOf('"http://www.omg.org/spec/DMN/20151101/dmn.xsd"')?"1.1":-1!==t.indexOf('"http://www.omg.org/spec/DMN/20180521/MODEL/"')&&"1.2";if(!n)return null;return e=new Error("unsupported DMN "+n+" file detected; only DMN 1.3 files can be opened"),console.error("Cannot open what looks like a DMN "+n+" diagram. Please refer to https://bpmn.io/l/dmn-compatibility.html to learn how to make the toolkit compatible with older DMN files",e),e}(t,e)||function(e){var t=/unparsable content <([^>]+)> detected([\s\S]*)$/.exec(e.message);if(!t)return null;return e.message="unparsable content <"+t[1]+"> detected; this may indicate an invalid DMN 1.3 diagram file"+t[2],e}(t)||t,n._emit("import.parse.complete",r({error:t,warnings:s})),n._emit("import.done",{error:t,warnings:s}),t.warnings=s,o(t)}))})).catch((function(e){return n._emit("import.done",{error:e,warnings:[]}),e.warnings=[],o(e)}))}));function r(e){var t=n._eventBus.createEvent(e);return Object.defineProperty(t,"context",{enumerable:!0,get:function(){return console.warn(new Error("import.parse.complete <context> is deprecated and will be removed in future library versions")),{warnings:e.warnings,references:e.references,elementsById:e.elementsById}}}),t}}},{key:"getDefinitions",value:function(){return this._definitions}},{key:"getActiveView",value:function(){return this._activeView}},{key:"getActiveViewer",value:function(){var e=this.getActiveView();return e&&this._getViewer(e)}},{key:"getView",value:function(e){return this._views.filter((function(t){return t.element===e}))[0]}},{key:"getViews",value:function(){return this._views}},{key:"saveXML",value:function(e){var t=this;e=e||{};var n=this._definitions;return new Promise((function(r,i){n?(n=t._emit("saveXML.start",{definitions:n})||n,t._moddle.toXML(n,e).then((function(e){var n=e.xml;return{xml:n=t._emit("saveXML.serialized",{xml:n})||n}})).catch((function(e){return{error:e}})).then((function(e){t._emit("saveXML.done",e),e.error?i(e.error):r({xml:e.xml})}))):i(new Error("no definitions loaded"))}))}},{key:"on",value:function(){var e;(e=this._eventBus).on.apply(e,arguments)}},{key:"off",value:function(){var e;(e=this._eventBus).off.apply(e,arguments)}},{key:"once",value:function(){var e;(e=this._eventBus).once.apply(e,arguments)}},{key:"attachTo",value:function(e){e.get&&e.constructor.prototype.jquery&&(e=e.get(0)),"string"==typeof e&&(e=an(e)),e.appendChild(this._container),this._emit("attach",{})}},{key:"detach",value:function(){this._emit("detach",{}),sn(this._container)}},{key:"destroy",value:function(){var e=this;Object.keys(this._viewers).forEach((function(t){gn(e._viewers[t],"destroy")})),sn(this._container)}},{key:"_init",value:function(e){this._options=e,this._moddle=this._createModdle(e),this._viewers={},this._views=[];var t=on('<div class="dmn-js-parent"></div>'),n=$({},hn,e);$(t.style,{width:mn(n.width),height:mn(n.height),position:n.position}),this._container=t,e.container&&this.attachTo(e.container)}},{key:"_clear",value:function(){return this._switchView(null)}},{key:"open",value:function(e){return this._switchView(e)}},{key:"_setDefinitions",value:function(e){this._definitions=e,this._updateViews()}},{key:"_updateViews",value:function(){var e=this._definitions;if(!e)return this._views=[],void this._switchView(null);for(var t=this._getViewProviders(),n=[e].concat(v(e.drgElement||[])),r=this._views,i=[],o=0,a=n;o<a.length;o++){var s=a[o],l=M(t,(function(e){return"string"==typeof e.opens?e.opens===s.$type:e.opens(s)}));if(l){var u={element:s,id:s.id,name:s.name,type:l.id};i.push(u)}}var c,p=this._activeView;if(!p||(c=M(i,(function(e){return vn(p,e)}))||this._getInitialView(i),c)){var f=!vn(p,c)||yn(p,c),h=r.length!==i.length||!D(i,(function(e){return M(r,(function(t){return vn(t,e)&&!yn(t,e)}))}));this._activeView=c,this._views=i,(f||h)&&this._viewsChanged()}else this._switchView(null)}},{key:"_getInitialView",value:function(e,t){var n;return t&&(n=M(e,(function(e){return vn(e,t)}))||M(e,(function(e){return e.type===t}))),n||e[0]}},{key:"_switchView",value:function(e){var t=this;return new Promise((function(n,r){var i,o=function(e,i){t._viewsChanged(),e?r(e):n(i)},a=t.getActiveView(),s=e&&t._getViewer(e),l=e&&e.element;if(a&&(i=t._getViewer(a))!==s&&(gn(i,"clear"),i.detach()),t._activeView=e,s)return i!==s&&s.attachTo(t._container),t._emit("import.render.start",{view:e,element:l}),void s.open(l).then((function(n){t._emit("import.render.complete",{view:e,error:null,warnings:n.warnings}),o(null,n)})).catch((function(n){t._emit("import.render.complete",{view:e,error:n,warnings:n.warnings}),o(n,null)}));o()}))}},{key:"_getViewer",value:function(e){var t=e.type,n=this._viewers[t];return n||(n=this._viewers[t]=this._createViewer(e.type),this._emit("viewer.created",{type:t,viewer:n})),n}},{key:"_createViewer",value:function(e){var t=M(this._getViewProviders(),(function(t){return t.id===e}));if(!t)throw new Error("no provider for view type <"+e+">");var n=t.constructor,r=this._options[e]||{};return new n(pn(pn(pn({},this._options.common||{}),r),{},{additionalModules:[].concat(v(r.additionalModules||[]),[{_parent:["value",this],moddle:["value",this._moddle]}])}))}},{key:"_emit",value:function(){var e;return(e=this._eventBus).fire.apply(e,arguments)}},{key:"_createModdle",value:function(e){return new Nt(e.moddleExtensions)}},{key:"_getViewProviders",value:function(){return[]}}]),e}();function mn(e){return e+(k(e)?"px":"")}function vn(e,t){return _(e)?!!_(t)&&(e.element===t.element||e.id===t.id):!_(t)}function yn(e,t){return!e||!t||e.name!==t.name}function gn(e,t){C(e[t])&&e[t]()}function bn(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}var wn=/^class[ {]/;function _n(e){return Array.isArray(e)}function xn(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function En(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];1===t.length&&_n(t[0])&&(t=t[0]);var r=(t=v(t)).pop();return r.$inject=t,r}var kn=/constructor\s*[^(]*\(\s*([^)]*)\)/m,Cn=/^(?:async\s+)?(?:function\s*[^(]*)?(?:\(\s*([^)]*)\)|(\w+))/m,On=/\/\*([^*]*)\*\//m;function Sn(e){if("function"!=typeof e)throw new Error('Cannot annotate "'.concat(e,'". Expected a function!'));var t=e.toString().match(function(e){return wn.test(e.toString())}(e)?kn:Cn);if(!t)return[];var n=t[1]||t[2];return n&&n.split(",").map((function(e){var t=e.match(On);return(t&&t[1]||e).trim()}))||[]}function Mn(e,t){t=t||{get:function(e,t){if(n.push(e),!1===t)return null;throw a('No provider for "'.concat(e,'"!'))}};var n=[],r=this._providers=Object.create(t._providers||null),i=this._instances=Object.create(null),o=i.injector=this,a=function(e){var t=n.join(" -> ");return n.length=0,new Error(t?"".concat(e," (Resolving: ").concat(t,")"):e)};function s(e,o){if(!r[e]&&-1!==e.indexOf(".")){for(var l=e.split("."),u=s(l.shift());l.length;)u=u[l.shift()];return u}if(xn(i,e))return i[e];if(xn(r,e)){if(-1!==n.indexOf(e))throw n.push(e),a("Cannot resolve circular dependency!");return n.push(e),i[e]=r[e][0](r[e][1]),n.pop(),i[e]}return t.get(e,o)}function l(e,t){if(void 0===t&&(t={}),"function"!=typeof e){if(!_n(e))throw a('Cannot invoke "'.concat(e,'". Expected a function!'));e=En(e.slice())}return{fn:e,dependencies:(e.$inject||Sn(e)).map((function(e){return xn(t,e)?t[e]:s(e)}))}}function u(e){var t=l(e),n=t.fn,r=t.dependencies;return new(Function.prototype.bind.apply(n,[null].concat(r)))}function c(e,t,n){var r=l(e,n),i=r.fn,o=r.dependencies;return i.apply(t,o)}function p(e,t){if(t&&t.length){var n,i,a,s,l=Object.create(null),u=Object.create(null),c=[],p=[],f=[],h=function(e){var o;n=r[e],-1!==t.indexOf(e)&&("private"===n[2]?-1===(i=c.indexOf(n[3]))?(a=n[3].createChild([],t),o=a,s=En((function(e){return o.get(e)})),c.push(n[3]),p.push(a),f.push(s),l[e]=[s,e,"private",a]):l[e]=[f[i],e,"private",p[i]]:l[e]=[n[2],n[1]],u[e]=!0),"factory"!==n[2]&&"type"!==n[2]||!n[1].$scope||t.forEach((function(t){-1!==n[1].$scope.indexOf(t)&&(l[e]=[n[2],n[1]],u[t]=!0)}))};for(var d in r)h(d);t.forEach((function(e){if(!u[e])throw new Error('No provider for "'+e+'". Cannot use provider from the parent!')})),e.unshift(l)}return new Mn(e,o)}var f,h,d={factory:c,type:u,value:function(e){return e}};function m(e,t){var n=e.__init__||[];return function(){n.forEach((function(e){"string"==typeof e?t.get(e):t.invoke(e)}))}}function v(e){var t=e.__exports__;if(t){var n=e.__modules__,i=Object.keys(e).reduce((function(t,n){return"__exports__"!==n&&"__modules__"!==n&&"__init__"!==n&&"__depends__"!==n&&(t[n]=e[n]),t}),Object.create(null)),a=p((n||[]).concat(i)),s=En((function(e){return a.get(e)}));t.forEach((function(e){r[e]=[s,e,"private",a]}));var l=(e.__init__||[]).slice();return l.unshift((function(){a.init()})),m(e=Object.assign({},e,{__init__:l}),a)}return Object.keys(e).forEach((function(t){if("__init__"!==t&&"__depends__"!==t)if("private"!==e[t][2]){var n=e[t][0],i=e[t][1];r[t]=[d[n],jn(n,i),n]}else r[t]=e[t]})),m(e,o)}function y(e,t){return-1!==e.indexOf(t)||-1!==(e=(t.__depends__||[]).reduce(y,e)).indexOf(t)?e:e.concat(t)}this.get=s,this.invoke=c,this.instantiate=u,this.createChild=p,this.init=(f=e.reduce(y,[]).map(v),h=!1,function(){h||(h=!0,f.forEach((function(e){return e()})))})}function jn(e,t){return"value"!==e&&_n(t)&&(t=En(t.slice())),t}function Nn(e,t){var n=this;t=t||1e3,e.on(["render.shape","render.connection"],t,(function(e,t){var r=e.type,i=t.element,o=t.gfx,a=t.attrs;if(n.canRender(i))return"render.shape"===r?n.drawShape(o,i,a):n.drawConnection(o,i,a)})),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 Pn(e,t){return t.appendChild(function(e,t){if(e.ownerDocument!==t.ownerDocument)try{return t.ownerDocument.importNode(e,!0)}catch(e){}return e}(e,t))}function Dn(e,t){return Pn(t,e),e}Nn.prototype.canRender=function(e){},Nn.prototype.drawShape=function(e,t){},Nn.prototype.drawConnection=function(e,t){},Nn.prototype.getShapePath=function(e){},Nn.prototype.getConnectionPath=function(e){};var Rn={"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 Tn(e,t,n){var r=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),i=Rn[r];i?(2===i&&"number"==typeof n&&(n=String(n)+"px"),e.style[r]=n):e.setAttributeNS(null,t,n)}function An(e,t,n){if("string"==typeof t){if(void 0===n)return function(e,t){return Rn[t]?e.style[t]:e.getAttributeNS(null,t)}(e,t);Tn(e,t,n)}else!function(e,t){var n,r,i=Object.keys(t);for(n=0;r=i[n];n++)Tn(e,r,t[r])}(e,t);return e}var In=Object.prototype.toString;function Bn(e){return new Ln(e)}function Ln(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}function $n(e){var t=e.parentNode;return t&&t.removeChild(e),e}function Vn(e){for(var t;t=e.firstChild;)$n(t);return e}Ln.prototype.add=function(e){return this.list.add(e),this},Ln.prototype.remove=function(e){return"[object RegExp]"==In.call(e)?this.removeMatching(e):(this.list.remove(e),this)},Ln.prototype.removeMatching=function(e){for(var t=this.array(),n=0;n<t.length;n++)e.test(t[n])&&this.remove(t[n]);return this},Ln.prototype.toggle=function(e,t){return void 0!==t?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this},Ln.prototype.array=function(){return Array.from(this.list)},Ln.prototype.has=Ln.prototype.contains=function(e){return this.list.contains(e)};var zn="http://www.w3.org/2000/svg",Un='<svg xmlns="'+zn+'"';function Fn(e){var t=!1;"<svg"===e.substring(0,4)?-1===e.indexOf(zn)&&(e=Un+e.substring(4)):(e=Un+">"+e+"</svg>",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 r=document.createDocumentFragment(),i=n.firstChild;i.firstChild;)r.appendChild(i.firstChild);return r}function Wn(e,t){var n;return"<"===e.charAt(0)?(n=Fn(e).firstChild,n=document.importNode(n,!0)):n=document.createElementNS(zn,e),t&&An(n,t),n}var qn=null;function Gn(){return null===qn&&(qn=Wn("svg")),qn}function Hn(e,t){var n,r,i=Object.keys(t);for(n=0;r=i[n];n++)e[r]=t[r];return e}var Xn=/([&<>]{1})/g,Yn=/([\n\r"]{1})/g,Kn={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"'"};function Zn(e,t){return e.replace(t,(function(e,t){return Kn[t]||t}))}function Qn(e,t){var n,r,i,o,a;switch(e.nodeType){case 3:t.push(Zn(e.textContent,Xn));break;case 1:if(t.push("<",e.tagName),e.hasAttributes())for(n=0,r=(i=e.attributes).length;n<r;++n)o=i.item(n),t.push(" ",o.name,'="',Zn(o.value,Yn),'"');if(e.hasChildNodes()){for(t.push(">"),n=0,r=(a=e.childNodes).length;n<r;++n)Qn(a.item(n),t);t.push("</",e.tagName,">")}else t.push("/>");break;case 8:t.push("\x3c!--",Zn(e.nodeValue,Xn),"--\x3e");break;case 4:t.push("<![CDATA[",e.nodeValue,"]]>");break;default:throw new Error("unable to handle node "+e.nodeType)}return t}function Jn(e,t){var n=Fn(t);if(Vn(e),t){(function(e){return"#document-fragment"===e.nodeName})(n)||(n=n.documentElement);for(var r,i=(r=n.childNodes,Array.prototype.slice.call(r)),o=0;o<i.length;o++)Pn(i[o],e)}}function er(e,t){if(void 0!==t){try{Jn(e,t)}catch(e){throw new Error("error parsing SVG: "+e.message)}return e}return function(e){for(var t=e.firstChild,n=[];t;)Qn(t,n),t=t.nextSibling;return n.join("")}(e)}function tr(e,t){return t instanceof SVGMatrix?e.createSVGTransformFromMatrix(t):t}function nr(e,t){var n=e.transform.baseVal;return t&&(Array.isArray(t)||(t=[t]),function(e,t){var n,r;for(e.clear(),n=0;r=t[n];n++)e.appendItem(tr(e,r))}(n,t)),n.consolidate()}function rr(e){return e.flat().join(",").replace(/,?([A-z]),?/g,"$1")}function ir(e){return["M",e.x,e.y]}function or(e){return["L",e.x,e.y]}function ar(e,t){for(var n,r,i,o=e.length,a=[ir(e[0])],s=1;s<o;s++){var l=e[s-1],u=e[s],c=e[s+1];if(c&&t){var p=Math.min(t,lr(u.x-l.x,u.y-l.y),lr(c.x-u.x,c.y-u.y));if(p){var f=sr(u,l,p),h=sr(u,l,.5*p),d=sr(u,c,p),m=sr(u,c,.5*p);a.push(or(f)),a.push((r=m,i=d,["C",(n=h).x,n.y,r.x,r.y,i.x,i.y]))}else a.push(or(u))}else a.push(or(u))}return a}function sr(e,t,n){var r=t.x-e.x,i=t.y-e.y,o=n/lr(r,i);return{x:e.x+r*o,y:e.y+i*o}}function lr(e,t){return Math.sqrt(Math.pow(e,2)+Math.pow(t,2))}function ur(e,t,n){k(t)&&(n=t,t=null),t||(t={});var r=Wn("path",t);return k(n)&&(r.dataset.cornerRadius=String(n)),cr(r,e)}function cr(e,t){return An(e,{d:rr(ar(t,parseInt(e.dataset.cornerRadius,10)||0))}),e}function pr(e,t){var n,r,i,o;return t=!!t,x(e)||(e=[e]),N(e,(function(e){var a=e;e.waypoints&&!t&&(a=pr(e.waypoints,!0));var s=a.x,l=a.y,u=a.height||0,c=a.width||0;(s<n||void 0===n)&&(n=s),(l<r||void 0===r)&&(r=l),(s+c>i||void 0===i)&&(i=s+c),(l+u>o||void 0===o)&&(o=l+u)})),{x:n,y:r,height:o-r,width:i-n}}function fr(e){return!(!e||!e.isFrame)}function hr(e,t){Nn.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})}bn(hr,Nn),hr.prototype.canRender=function(){return!0},hr.prototype.drawShape=function(e,t,n){var r=Wn("rect");return An(r,{x:0,y:0,width:t.width||0,height:t.height||0}),fr(t)?An(r,$({},this.FRAME_STYLE,n||{})):An(r,$({},this.SHAPE_STYLE,n||{})),Dn(e,r),r},hr.prototype.drawConnection=function(e,t,n){var r=ur(t.waypoints,$({},this.CONNECTION_STYLE,n||{}));return Dn(e,r),r},hr.prototype.getShapePath=function(e){var t=e.x,n=e.y,r=e.width;return rr([["M",t,n],["l",r,0],["l",0,e.height],["l",-r,0],["z"]])},hr.prototype.getConnectionPath=function(e){var t,n,r=e.waypoints,i=[];for(t=0;n=r[t];t++)n=n.original||n,i.push([0===t?"M":"L",n.x,n.y]);return rr(i)},hr.$inject=["eventBus","styles"];var dr={__init__:["defaultRenderer"],defaultRenderer:["type",hr],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 $(this.style(t,n),{class:e})},this.style=function(t,n){x(t)||n||(n=t,t=[]);var r=P(t,(function(t,n){return $(t,e[n]||{})}),{});return n?$(r,n):r},this.computeStyle=function(e,n,r){return x(n)||(r=n,n=[]),t.style(n||[],$({},r,e||{}))}}]};function mr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function vr(e){return{top:e.y,right:e.x+(e.width||0),bottom:e.y+(e.height||0),left:e.x}}function yr(e,t){return Math.round(e*t)/t}function gr(e){return k(e)?e+"px":e}function br(e,t,n){var r=Wn("g");Bn(r).add(t);var i=void 0!==n?n:e.childNodes.length-1;return e.insertBefore(r,e.childNodes[i]||null),r}var wr={shape:["x","y","width","height"],connection:["waypoints"]};function _r(e,t,n,r){this._eventBus=t,this._elementRegistry=r,this._graphicsFactory=n,this._rootsIdx=0,this._layers={},this._planes=[],this._rootElement=null,this._init(e||{})}function xr(e,t){var n="matrix("+t.a+","+t.b+","+t.c+","+t.d+","+t.e+","+t.f+")";e.setAttribute("transform",n)}_r.$inject=["config.canvas","eventBus","graphicsFactory","elementRegistry"],_r.prototype._init=function(e){var t=this,n=this._eventBus,r=this._container=function(e){var t=(e=$({},{width:"100%",height:"100%"},e)).container||document.body,n=document.createElement("div");return n.setAttribute("class","djs-container djs-parent"),Lt(n,{position:"relative",overflow:"hidden",width:gr(e.width),height:gr(e.height)}),t.appendChild(n),n}(e),i=this._svg=Wn("svg");An(i,{width:"100%",height:"100%"}),Dn(r,i);var o=this._viewport=br(i,"viewport");!1!==e.deferUpdate&&(this._viewboxChanged=I(L(this._viewboxChanged,this),300)),n.on("diagram.init",(function(){n.fire("canvas.init",{svg:i,viewport:o})})),n.on(["shape.added","connection.added","shape.removed","connection.removed","elements.changed","root.set"],(function(){delete t._cachedViewbox})),n.on("diagram.destroy",500,this._destroy,this),n.on("diagram.clear",500,this._clear,this)},_r.prototype._destroy=function(){this._eventBus.fire("canvas.destroy",{svg:this._svg,viewport:this._viewport});var 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},_r.prototype._clear=function(){var e=this;this._elementRegistry.getAll().forEach((function(t){var n=function(e){return"waypoints"in e?"connection":"x"in e?"shape":"root"}(t);"root"===n?e.removeRootElement(t):e._removeElement(t,n)})),this._planes=[],this._rootElement=null,delete this._cachedViewbox},_r.prototype.getDefaultLayer=function(){return this.getLayer("base",0)},_r.prototype.getLayer=function(e,t){if(!e)throw new Error("must specify a name");var 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},_r.prototype._getChildIndex=function(e){return P(this._layers,(function(t,n){return n.visible&&e>=n.index&&t++,t}),0)},_r.prototype._createLayer=function(e,t){void 0===t&&(t=1);var n=this._getChildIndex(t);return{group:br(this._viewport,"layer-"+e,n),index:t,visible:!0}},_r.prototype.showLayer=function(e){if(!e)throw new Error("must specify a name");var t=this._layers[e];if(!t)throw new Error("layer <"+e+"> does not exist");var n=this._viewport,r=t.group,i=t.index;if(t.visible)return r;var o=this._getChildIndex(i);return n.insertBefore(r,n.childNodes[o]||null),t.visible=!0,r},_r.prototype.hideLayer=function(e){if(!e)throw new Error("must specify a name");var t=this._layers[e];if(!t)throw new Error("layer <"+e+"> does not exist");var n=t.group;return t.visible?($n(n),t.visible=!1,n):n},_r.prototype._removeLayer=function(e){var t=this._layers[e];t&&(delete this._layers[e],$n(t.group))},_r.prototype.getActiveLayer=function(){var e=this._findPlaneForRoot(this.getRootElement());return e?e.layer:null},_r.prototype.findRoot=function(e){if("string"==typeof e&&(e=this._elementRegistry.get(e)),e){var t=this._findPlaneForRoot(function(e){for(;e.parent;)e=e.parent;return e}(e))||{};return t.rootElement}},_r.prototype.getRootElements=function(){return this._planes.map((function(e){return e.rootElement}))},_r.prototype._findPlaneForRoot=function(e){return M(this._planes,(function(t){return t.rootElement===e}))},_r.prototype.getContainer=function(){return this._container},_r.prototype._updateMarker=function(e,t,n){var r;e.id||(e=this._elementRegistry.get(e)),(r=this._elementRegistry._elements[e.id])&&(N([r.gfx,r.secondaryGfx],(function(e){e&&(n?Bn(e).add(t):Bn(e).remove(t))})),this._eventBus.fire("element.marker.update",{element:e,gfx:r.gfx,marker:t,add:!!n}))},_r.prototype.addMarker=function(e,t){this._updateMarker(e,t,!0)},_r.prototype.removeMarker=function(e,t){this._updateMarker(e,t,!1)},_r.prototype.hasMarker=function(e,t){return e.id||(e=this._elementRegistry.get(e)),Bn(this.getGraphics(e)).has(t)},_r.prototype.toggleMarker=function(e,t){this.hasMarker(e,t)?this.removeMarker(e,t):this.addMarker(e,t)},_r.prototype.getRootElement=function(){var e=this._rootElement;return e||this._planes.length?e:this.setRootElement(this.addRootElement(null))},_r.prototype.addRootElement=function(e){var t=this._rootsIdx++;e||(e={id:"__implicitroot_"+t,children:[],isImplicit:!0});var n=e.layer="root-"+t;this._ensureValid("root",e);var r=this.getLayer(n,0);return this.hideLayer(n),this._addRoot(e,r),this._planes.push({rootElement:e,layer:r}),e},_r.prototype.removeRootElement=function(e){if("string"==typeof e&&(e=this._elementRegistry.get(e)),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},_r.prototype.setRootElement=function(e,t){if(_(t))throw new Error("override not supported");if(e!==this._rootElement){if(!e)throw new Error("rootElement required");return this._findPlaneForRoot(e)||(e=this.addRootElement(e)),this._setRoot(e),e}},_r.prototype._removeRoot=function(e){var t=this._elementRegistry,n=this._eventBus;n.fire("root.remove",{element:e}),n.fire("root.removed",{element:e}),t.remove(e)},_r.prototype._addRoot=function(e,t){var n=this._elementRegistry,r=this._eventBus;r.fire("root.add",{element:e}),n.add(e,t),r.fire("root.added",{element:e,gfx:t})},_r.prototype._setRoot=function(e,t){var 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})},_r.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");var n=wr[e],r=D(n,(function(e){return void 0!==t[e]}));if(!r)throw new Error("must supply { "+n.join(", ")+" } with "+e)},_r.prototype._setParent=function(e,t,n){!function(e,t,n){if(e&&t){"number"!=typeof n&&(n=-1);var r=e.indexOf(t);if(-1!==r){if(r===n)return;if(-1===n)return;e.splice(r,1)}-1!==n?e.splice(n,0,t):e.push(t)}}(t.children,e,n),e.parent=t},_r.prototype._addElement=function(e,t,n,r){n=n||this.getRootElement();var i=this._eventBus,o=this._graphicsFactory;this._ensureValid(e,t),i.fire(e+".add",{element:t,parent:n}),this._setParent(t,n,r);var a=o.create(e,t,r);return this._elementRegistry.add(t,a),o.update(e,t,a),i.fire(e+".added",{element:t,gfx:a}),t},_r.prototype.addShape=function(e,t,n){return this._addElement("shape",e,t,n)},_r.prototype.addConnection=function(e,t,n){return this._addElement("connection",e,t,n)},_r.prototype._removeElement=function(e,t){var n=this._elementRegistry,r=this._graphicsFactory,i=this._eventBus;if(e=n.get(e.id||e))return i.fire(t+".remove",{element:e}),r.remove(e),function(e,t){if(!e||!t)return-1;var n=e.indexOf(t);-1!==n&&e.splice(n,1)}(e.parent&&e.parent.children,e),e.parent=null,i.fire(t+".removed",{element:e}),n.remove(e),e},_r.prototype.removeShape=function(e){return this._removeElement(e,"shape")},_r.prototype.removeConnection=function(e){return this._removeElement(e,"connection")},_r.prototype.getGraphics=function(e,t){return this._elementRegistry.getGraphics(e,t)},_r.prototype._changeViewbox=function(e){this._eventBus.fire("canvas.viewbox.changing"),e.apply(this),this._cachedViewbox=null,this._viewboxChanged()},_r.prototype._viewboxChanged=function(){this._eventBus.fire("canvas.viewbox.changed",{viewbox:this.viewbox()})},_r.prototype.viewbox=function(e){if(void 0===e&&this._cachedViewbox)return this._cachedViewbox;var t,n,r,i,o,a,s,l=this._viewport,u=this.getSize();return e?(this._changeViewbox((function(){o=Math.min(u.width/e.width,u.height/e.height);var t=this._svg.createSVGMatrix().scale(o).translate(-e.x,-e.y);nr(l,t)})),e):(t=(r=this._rootElement?this.getActiveLayer():null)&&r.getBBox()||{},n=(i=nr(l))?i.matrix:function(e,t,n,r,i,o){var a=Gn().createSVGMatrix();switch(arguments.length){case 0:return a;case 1:return Hn(a,e);case 6:return Hn(a,{a:e,b:t,c:n,d:r,e:i,f:o})}}(),o=yr(n.a,1e3),a=yr(-n.e||0,1e3),s=yr(-n.f||0,1e3),e=this._cachedViewbox={x:a?a/o:0,y:s?s/o:0,width:u.width/o,height:u.height/o,scale:o,inner:{width:t.width||0,height:t.height||0,x:t.x||0,y:t.y||0},outer:u})},_r.prototype.scroll=function(e){var t=this._viewport,n=t.getCTM();return e&&this._changeViewbox((function(){e=$({dx:0,dy:0},e||{}),n=this._svg.createSVGMatrix().translate(e.dx,e.dy).multiply(n),xr(t,n)})),{x:n.e,y:n.f}},_r.prototype.scrollToElement=function(e,t){var n=100;"string"==typeof e&&(e=this._elementRegistry.get(e));var r=this.findRoot(e);r!==this.getRootElement()&&this.setRootElement(r),t||(t={}),"number"==typeof t&&(n=t),t={top:t.top||n,right:t.right||n,bottom:t.bottom||n,left:t.left||n};var i,o,a=pr(e),s=vr(a),l=this.viewbox(),u=this.zoom();l.y+=t.top/u,l.x+=t.left/u,l.width-=(t.right+t.left)/u,l.height-=(t.bottom+t.top)/u;var c=vr(l);if(a.width<l.width&&a.height<l.height){var p=Math.max(0,s.right-c.right),f=Math.min(0,s.left-c.left),h=Math.max(0,s.bottom-c.bottom),d=Math.min(0,s.top-c.top);i=p||f,o=h||d}else i=a.x-l.x,o=a.y-l.y;this.scroll({dx:-i*u,dy:-o*u})},_r.prototype.zoom=function(e,t){return e?"fit-viewport"===e?this._fitViewport(t):(this._changeViewbox((function(){"object"!==n(t)&&(r=this.viewbox().outer,t={x:r.width/2,y:r.height/2}),i=this._setZoom(e,t)})),yr(i.a,1e3)):this.viewbox(e).scale;var r,i},_r.prototype._fitViewport=function(e){var t,n,r=this.viewbox(),i=r.outer,o=r.inner;return o.x>=0&&o.y>=0&&o.x+o.width<=i.width&&o.y+o.height<=i.height&&!e?n={x:0,y:0,width:Math.max(o.width+o.x,i.width),height:Math.max(o.height+o.y,i.height)}:(t=Math.min(1,i.width/o.width,i.height/o.height),n={x:o.x+(e?o.width/2-i.width/t/2:0),y:o.y+(e?o.height/2-i.height/t/2:0),width:i.width/t,height:i.height/t}),this.viewbox(n),this.viewbox(!1).scale},_r.prototype._setZoom=function(e,t){var n,r,i,o,a=this._svg,s=this._viewport,l=a.createSVGMatrix(),u=a.createSVGPoint(),c=(r=s.getCTM()).a;return t?(n=$(u,t).matrixTransform(r.inverse()),i=l.translate(n.x,n.y).scale(1/c*e).translate(-n.x,-n.y),o=r.multiply(i)):o=l.scale(e),xr(this._viewport,o),o},_r.prototype.getSize=function(){return{width:this._container.clientWidth,height:this._container.clientHeight}},_r.prototype.getAbsoluteBBox=function(e){var t,n=this.viewbox();e.waypoints?t=this.getGraphics(e).getBBox():t=e;return{x:t.x*n.scale-n.x*n.scale,y:t.y*n.scale-n.y*n.scale,width:t.width*n.scale,height:t.height*n.scale}},_r.prototype.resized=function(){delete this._cachedViewbox,this._eventBus.fire("canvas.resized")};var Er="data-element-id";function kr(e){this._elements={},this._eventBus=e}kr.$inject=["eventBus"],kr.prototype.add=function(e,t,n){var r=e.id;this._validateId(r),An(t,Er,r),n&&An(n,Er,r),this._elements[r]={element:e,gfx:t,secondaryGfx:n}},kr.prototype.remove=function(e){var t=this._elements,n=e.id||e,r=n&&t[n];r&&(An(r.gfx,Er,""),r.secondaryGfx&&An(r.secondaryGfx,Er,""),delete t[n])},kr.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),r=this.getGraphics(e,!0);this.remove(e),e.id=t,this.add(e,n,r)},kr.prototype.updateGraphics=function(e,t,n){var r=e.id||e,i=this._elements[r];return n?i.secondaryGfx=t:i.gfx=t,t&&An(t,Er,r),t},kr.prototype.get=function(e){var t;t="string"==typeof e?e:e&&An(e,Er);var n=this._elements[t];return n&&n.element},kr.prototype.filter=function(e){var t=[];return this.forEach((function(n,r){e(n,r)&&t.push(n)})),t},kr.prototype.find=function(e){for(var t=this._elements,n=Object.keys(t),r=0;r<n.length;r++){var i=t[n[r]],o=i.element;if(e(o,i.gfx))return o}},kr.prototype.getAll=function(){return this.filter((function(e){return e}))},kr.prototype.forEach=function(e){var t=this._elements;Object.keys(t).forEach((function(n){var r=t[n],i=r.element,o=r.gfx;return e(i,o)}))},kr.prototype.getGraphics=function(e,t){var n=e.id||e,r=this._elements[n];return r&&(t?r.secondaryGfx:r.gfx)},kr.prototype._validateId=function(e){if(!e)throw new Error("element must have an id");if(this._elements[e])throw new Error("element with id "+e+" already added")};var Cr={},Or={get exports(){return Cr},set exports(e){Cr=e}},Sr={};Sr.extend=function(e,t,n,r){var i=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,i,r)),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,i,r)}}),Object.defineProperty(e,"__refs_collection",{value:!0}),e},Sr.isExtended=function(e){return!0===e.__refs_collection};var Mr=Sr;function jr(e,t,n){var r=Mr.extend(n[t.name]||[],e,t,n);Object.defineProperty(n,t.name,{enumerable:t.enumerable,value:r}),r.length&&r.forEach((function(r){e.set(r,t.inverse,n)}))}function Nr(e,t){if(!(this instanceof Nr))return new Nr(e,t);e.inverse=t,t.inverse=e,this.props={},this.props[e.name]=e,this.props[t.name]=t}Nr.prototype.bind=function(e,t){if("string"==typeof t){if(!this.props[t])throw new Error("no property <"+t+"> in ref");t=this.props[t]}t.collection?jr(this,t,e):function(e,t,n){var r=t.inverse,i=n[t.name];Object.defineProperty(n,t.name,{configurable:t.configurable,enumerable:t.enumerable,get:function(){return i},set:function(t){if(t!==i){var o=i;i=null,o&&e.unset(o,r,n),i=t,e.set(i,r,n)}}})}(this,t,e)},Nr.prototype.ensureRefsCollection=function(e,t){var n=e[t.name];return Mr.isExtended(n)||jr(this,t,e),n},Nr.prototype.ensureBound=function(e,t){(function(e,t){return Object.prototype.hasOwnProperty.call(e,t.name||t)})(e,t)||this.bind(e,t)},Nr.prototype.unset=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).remove(n):e[t.name]=void 0)},Nr.prototype.set=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).add(n):e[t.name]=n)};var Pr=Nr;!function(e){e.exports=Pr,e.exports.Collection=Sr}(Or);var Dr=mr(Cr),Rr=new Dr({name:"children",enumerable:!0,collection:!0},{name:"parent"}),Tr=new Dr({name:"labels",enumerable:!0,collection:!0},{name:"labelTarget"}),Ar=new Dr({name:"attachers",collection:!0},{name:"host"}),Ir=new Dr({name:"outgoing",collection:!0},{name:"source"}),Br=new Dr({name:"incoming",collection:!0},{name:"target"});function Lr(){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)}}),Rr.bind(this,"parent"),Tr.bind(this,"labels"),Ir.bind(this,"outgoing"),Br.bind(this,"incoming")}function $r(){Lr.call(this),Rr.bind(this,"children"),Ar.bind(this,"host"),Ar.bind(this,"attachers")}function Vr(){$r.call(this)}function zr(){$r.call(this),Tr.bind(this,"labelTarget")}function Ur(){Lr.call(this),Ir.bind(this,"source"),Br.bind(this,"target")}bn($r,Lr),bn(Vr,$r),bn(zr,$r),bn(Ur,Lr);var Fr={connection:Ur,shape:$r,label:zr,root:Vr};function Wr(){this._uid=12}function qr(e,t,n){var r,i=r?Gn().createSVGTransformFromMatrix(r):Gn().createSVGTransform();i.setTranslate(t,n),nr(e,i)}function Gr(e,t){this._eventBus=e,this._elementRegistry=t}function Hr(e,t,n){var r=n||t.firstChild;e!==r&&t.insertBefore(e,r)}Wr.prototype.createRoot=function(e){return this.create("root",e)},Wr.prototype.createLabel=function(e){return this.create("label",e)},Wr.prototype.createShape=function(e){return this.create("shape",e)},Wr.prototype.createConnection=function(e){return this.create("connection",e)},Wr.prototype.create=function(e,t){return(t=$({},t||{})).id||(t.id=e+"_"+this._uid++),function(e,t){var n=Fr[e];if(!n)throw new Error("unknown type: <"+e+">");return $(new n,t)}(e,t)},Gr.$inject=["eventBus","elementRegistry"],Gr.prototype._getChildrenContainer=function(e){var t,n=this._elementRegistry.getGraphics(e);return e.parent?(t=function(e){return e.parentNode.childNodes[1]}(n),t||(Bn(t=Wn("g")).add("djs-children"),Dn(n.parentNode,t))):t=n,t},Gr.prototype._clear=function(e){var t=function(e){return e.childNodes[0]}(e);return Ft(t),t},Gr.prototype._createContainer=function(e,t,n,r){var i=Wn("g");Bn(i).add("djs-group"),void 0!==n?Hr(i,t,t.childNodes[n]):Dn(t,i);var o=Wn("g");Bn(o).add("djs-element"),Bn(o).add("djs-"+e),r&&Bn(o).add("djs-frame"),Dn(i,o);var a=Wn("g");return Bn(a).add("djs-visual"),Dn(o,a),o},Gr.prototype.create=function(e,t,n){var r=this._getChildrenContainer(t.parent);return this._createContainer(e,r,n,fr(t))},Gr.prototype.updateContainments=function(e){var t,n=this,r=this._elementRegistry;t=P(e,(function(e,t){return t.parent&&(e[t.parent.id]=t.parent),e}),{}),N(t,(function(e){var t=e.children;if(t){var i=n._getChildrenContainer(e);N(t.slice().reverse(),(function(e){Hr(r.getGraphics(e).parentNode,i)}))}}))},Gr.prototype.drawShape=function(e,t){return this._eventBus.fire("render.shape",{gfx:e,element:t})},Gr.prototype.getShapePath=function(e){return this._eventBus.fire("render.getShapePath",e)},Gr.prototype.drawConnection=function(e,t){return this._eventBus.fire("render.connection",{gfx:e,element:t})},Gr.prototype.getConnectionPath=function(e){return this._eventBus.fire("render.getConnectionPath",e)},Gr.prototype.update=function(e,t,n){if(t.parent){var r=this._clear(n);if("shape"===e)this.drawShape(r,t),qr(n,t.x,t.y);else{if("connection"!==e)throw new Error("unknown type: "+e);this.drawConnection(r,t)}t.hidden?An(n,"display","none"):An(n,"display","block")}},Gr.prototype.remove=function(e){$n(this._elementRegistry.getGraphics(e).parentNode)};var Xr={__depends__:[dr],__init__:["canvas"],canvas:["type",_r],elementRegistry:["type",kr],elementFactory:["type",Wr],eventBus:["type",U],graphicsFactory:["type",Gr]};function Yr(e){return function(e){var t=new Mn(e);return t.init(),t}([{config:["value",e=e||{}]},Xr].concat(e.modules||[]))}function Kr(e,t){this.injector=t=t||Yr(e),this.get=t.get,this.invoke=t.invoke,this.get("eventBus").fire("diagram.init")}function Zr(e,t){var n=Qr(e);return n&&"function"==typeof n.$instanceOf&&n.$instanceOf(t)}function Qr(e){return e&&e.businessObject||e}Kr.prototype.destroy=function(){this.get("eventBus").fire("diagram.destroy")},Kr.prototype.clear=function(){this.get("eventBus").fire("diagram.clear")};var Jr=new Dr({name:"dmnElementRef",enumerable:!0},{name:"di",configurable:!0});function ei(e,t){var n=[];function r(t){try{var n=t.di&&function(t){if(t.gfx)throw new Error("already rendered "+t.id);return e.element(t)}(t);return n}catch(e){a(e.message,{element:t,error:e})}}function i(e){var t,n;(n=(t=e).dmnElementRef)?n.di?a("multiple DI elements defined for element",{element:n}):(Jr.bind(n,"di"),n.di=t):a("no DMN element referenced in element",{element:t})}function o(e){n.push(e)}function a(t,n){e.error(t,n)}return{handleDefinitions:function(t,a){var s=t.dmnDI;if(!s)throw new Error("no dmndi:DMNDI");var l,u=s.diagrams||[];if(a&&-1===u.indexOf(a))throw new Error("diagram not part of dmndi:DMNDI");if(!a&&u&&u.length&&(a=u[0]),!a)throw new Error("no diagram to display");t.di=a,function(e){N(e.diagramElements,i)}(a),l=t,e.root(l),N(t.get("drgElement"),(function(e){r(e),function(e){N(["informationRequirement","knowledgeRequirement","authorityRequirement"],(function(t){N(e[t],(function(e){o((function(){r(e)}))}))}))}(e)})),function(e){N(e,(function(e){Zr(e,"dmn:Association")?function(e){o((function(){r(e)}))}(e):r(e)}))}(t.get("artifact")),N(n,(function(e){e()}))}}}var ti=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 r=Math.log(Math.pow(2,e))/Math.log(n),i=2;r===1/0;i*=2)r=Math.log(Math.pow(2,e/i))/Math.log(n)*i;var o=r-Math.floor(r),a="";for(i=0;i<Math.floor(r);i++){a=Math.floor(Math.random()*n).toString(n)+a}if(o){var s=Math.pow(n,o);a=Math.floor(Math.random()*s).toString(n)+a}var l=parseInt(a,n);return l!==1/0&&l>=Math.pow(2,e)?t(e,n):a};t.rack=function(e,n,r){var i=function(i){var a=0;do{if(a++>10){if(!r)throw new Error("too many ID collisions, use more bits");e+=r}var s=t(e,n)}while(Object.hasOwnProperty.call(o,s));return o[s]=i,s},o=i.hats={};return i.get=function(e){return i.hats[e]},i.set=function(e,t){return i.hats[e]=t,i},i.bits=e||128,i.base=n||16,i}}));function ni(e){if(!(this instanceof ni))return new ni(e);e=e||[128,36,1],this._seed=e.length?ti.rack(e[0],e[1],e[2]):e}ni.prototype.next=function(e){return this._seed(e||!0)},ni.prototype.nextPrefixed=function(e,t){var n;do{n=e+this.next(!0)}while(this.assigned(n));return this.claim(n,t),n},ni.prototype.claim=function(e,t){this._seed.set(e,t||!0)},ni.prototype.assigned=function(e){return this._seed.get(e)||!1},ni.prototype.unclaim=function(e){delete this._seed.hats[e]},ni.prototype.clear=function(){var e,t=this._seed.hats;for(e in t)this.unclaim(e)};var ri=new ni,ii="hsl(225, 10%, 15%)";function oi(e,t,n,r,i,o){Nn.call(this,t);var a=ri.next(),s=r.computeStyle,l={},u=e&&e.defaultFillColor||"white",c=e&&e.defaultStrokeColor||ii,p=e&&e.defaultLabelColor;function f(e,t,n){var r=e+"-"+si(t)+"-"+si(n)+"-"+a;return l[r]||function(e,t,n,r){if("association-start"===t){var i=Wn("path");An(i,{d:"M 11 5 L 1 10 L 11 15"}),h(e,{element:i,attrs:{fill:"none",stroke:r,strokeWidth:1.5},ref:{x:1,y:10},scale:.5})}else if("association-end"===t){var o=Wn("path");An(o,{d:"M 1 5 L 11 10 L 1 15"}),h(e,{element:o,attrs:{fill:"none",stroke:r,strokeWidth:1.5},ref:{x:12,y:10},scale:.5})}else if("information-requirement-end"===t){var a=Wn("path");An(a,{d:"M 1 5 L 11 10 L 1 15 Z"}),h(e,{element:a,attrs:{fill:r,stroke:"none"},ref:{x:11,y:10},scale:1})}else if("knowledge-requirement-end"===t){var s=Wn("path");An(s,{d:"M 1 3 L 11 10 L 1 17"}),h(e,{element:s,attrs:{fill:"none",stroke:r,strokeWidth:2},ref:{x:11,y:10},scale:.8})}else if("authority-requirement-end"===t){var l=Wn("circle");An(l,{cx:3,cy:3,r:3}),h(e,{element:l,attrs:{fill:r,stroke:"none"},ref:{x:3,y:3},scale:.9})}}(r,e,0,n),"url(#"+r+")"}function h(e,t){var n=$({strokeWidth:1,strokeLinecap:"round",strokeDasharray:"none"},t.attrs),r=t.ref||{x:0,y:0},i=t.scale||1;"none"===n.strokeDasharray&&(n.strokeDasharray=[1e4,1]);var a=Wn("marker");An(t.element,n),Dn(a,t.element),An(a,{id:e,viewBox:"0 0 20 20",refX:r.x,refY:r.y,markerWidth:20*i,markerHeight:20*i,orient:"auto"});var s=an("defs",o._svg);s||(s=Wn("defs"),Dn(o._svg,s)),Dn(s,a),l[e]=a}function d(e,t,n,r,i,o){E(i)&&(o=i,i=0),i=i||0,o=s(o,{stroke:ii,strokeWidth:2,fill:"white"});var a=Wn("rect");return An(a,{x:i,y:i,width:t-2*i,height:n-2*i,rx:r,ry:r}),An(a,o),Dn(e,a),a}function m(e,t,n){var r=i.createText(t||"",n);return $t(r,"class","djs-label"),Dn(e,r),r}function v(e,t,n,r){var i=function(e){return Qr(e).name}(t);return m(e,i,r=$({box:t,align:n,padding:5,style:{fill:ci(t,p,c)}},r))}function y(e,t,n){n=s(n,["no-fill"],{strokeWidth:2,stroke:ii});var r=Wn("path");return An(r,{d:t}),An(r,n),Dn(e,r),r}var g={"dmn:Decision":function(e,t){var n=d(e,t.width,t.height,0,{stroke:li(t,c),fill:ui(t,u)});return v(e,t,"center-middle"),n},"dmn:KnowledgeSource":function(e,t){var r=y(e,n.getScaledPath("KNOWLEDGE_SOURCE",{xScaleFactor:1.021,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:0,my:.075}}),{strokeWidth:2,fill:ui(t,u),stroke:li(t,c)});return v(e,t,"center-middle"),r},"dmn:BusinessKnowledgeModel":function(e,t){var r=y(e,n.getScaledPath("BUSINESS_KNOWLEDGE_MODEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:0,my:.3}}),{strokeWidth:2,fill:ui(t,u),stroke:li(t,c)});return v(e,t,"center-middle"),r},"dmn:InputData":function(e,t){var n=d(e,t.width,t.height,22,{stroke:li(t,c),fill:ui(t,u)});return v(e,t,"center-middle"),n},"dmn:TextAnnotation":function(e,t){var r=d(e,t.width,t.height,0,0,{fill:"none",stroke:"none"});return y(e,n.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:0,my:0}}),{stroke:li(t,c)}),m(e,ai(t).text||"",{style:{fill:ci(t,p,c)},box:t,align:"left-top",padding:5}),r},"dmn:Association":function(e,t){var n=ai(t),r=ui(t,u),i=li(t,c),o={stroke:i,strokeDasharray:"0.5, 5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none"};return"One"!==n.associationDirection&&"Both"!==n.associationDirection||(o.markerEnd=f("association-end",r,i)),"Both"===n.associationDirection&&(o.markerStart=f("association-start",r,i)),b(e,t.waypoints,o)},"dmn:InformationRequirement":function(e,t){var n=ui(t,u),r=li(t,c),i={stroke:r,strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round",markerEnd:f("information-requirement-end",n,r)};return b(e,t.waypoints,i)},"dmn:KnowledgeRequirement":function(e,t){var n=ui(t,u),r=li(t,c),i={stroke:r,strokeWidth:1,strokeDasharray:5,strokeLinecap:"round",strokeLinejoin:"round",markerEnd:f("knowledge-requirement-end",n,r)};return b(e,t.waypoints,i)},"dmn:AuthorityRequirement":function(e,t){var n=ui(t,u),r=li(t,c),i={stroke:r,strokeWidth:1.5,strokeDasharray:5,strokeLinecap:"round",strokeLinejoin:"round",markerEnd:f("authority-requirement-end",n,r)};return b(e,t.waypoints,i)}};function b(e,t,n){var r=ur(t,n=s(n,["no-fill"],{stroke:ii,strokeWidth:2,fill:"none"}));return Dn(e,r),r}this.canRender=function(e){return Zr(e,"dmn:DMNElement")||Zr(e,"dmn:InformationRequirement")||Zr(e,"dmn:KnowledgeRequirement")||Zr(e,"dmn:AuthorityRequirement")},this.drawShape=function(e,t){var n=g[t.type];return n?n(e,t):Nn.prototype.drawShape.apply(this,[e,t])},this.drawConnection=function(e,t){var n=t.type,r=g[n];return r?r(e,t):Nn.prototype.drawConnection.apply(this,[e,t])}}function ai(e){return e.businessObject}function si(e){return e.replace(/[^0-9a-zA-z]+/g,"_")}function li(e,t){return t}function ui(e,t){return t}function ci(e,t,n){return t||li(0,n)}bn(oi,Nn),oi.$inject=["config.drdRenderer","eventBus","pathMap","styles","textRenderer","canvas"];var pi={width:150,height:50};function fi(e,t){var n;t.textContent=e;try{var r,i=""===e;return t.textContent=i?"dummy":e,r={width:(n=t.getBBox()).width+2*n.x,height:n.height},i&&(r.width=0),r}catch(e){return{width:0,height:0}}}function hi(e,t,n){for(var r,i=e.shift(),o=i;;){if((r=fi(o,n)).width=o?r.width:0," "===o||""===o||r.width<Math.round(t)||o.length<2)return di(e,o,i,r);o=mi(o,r.width,t)}}function di(e,t,n,r){if(t.length<n.length){var i=n.slice(t.length).trim();e.unshift(i)}return{width:r.width,height:r.height,text:t}}function mi(e,t,n){var r=Math.max(e.length*(n/t),1),i=function(e,t){var n,r=e.split(/(\s|-|\u00AD)/g),i=[],o=0;if(r.length>1)for(;n=r.shift();){if(!(n.length+o<t)){"-"!==n&&"­"!==n||i.pop();break}i.push(n),o+=n.length}var a=i[i.length-1];return a&&"­"===a&&(i[i.length-1]="-"),i.join("")}(e,r);return i||(i=e.slice(0,Math.max(Math.round(r-1),1))),i}function vi(e){this._config=$({},{size:pi,padding:0,style:{},align:"center-top"},e||{})}vi.prototype.createText=function(e,t){return this.layoutText(e,t).element},vi.prototype.getDimensions=function(e,t){return this.layoutText(e,t).dimensions},vi.prototype.layoutText=function(e,t){var n=$({},this._config.size,t.box),r=$({},this._config.style,t.style),i=function(e){var t=e.split("-");return{horizontal:t[0]||"center",vertical:t[1]||"top"}}(t.align||this._config.align),o=function(e){return E(e)?$({top:0,left:0,right:0,bottom:0},e):{top:e,left:e,right:e,bottom:e}}(void 0!==t.padding?t.padding:this._config.padding),a=t.fitBox||!1,s=function(e){if("fontSize"in e&&"lineHeight"in e)return e.lineHeight*parseInt(e.fontSize,10)}(r),l=e.split(/\u00AD?\r?\n/),u=[],c=n.width-o.left-o.right,p=Wn("text");for(An(p,{x:0,y:0}),An(p,r),Dn(function(){var e=document.getElementById("helper-svg");return e||(An(e=Wn("svg"),{id:"helper-svg"}),Lt(e,{visibility:"hidden",position:"fixed",width:0,height:0}),document.body.appendChild(e)),e}(),p);l.length;)u.push(hi(l,c,p));"middle"===i.vertical&&(o.top=o.bottom=0);var f=P(u,(function(e,t,n){return e+(s||t.height)}),0)+o.top+o.bottom,h=P(u,(function(e,t,n){return t.width>e?t.width:e}),0),d=o.top;"middle"===i.vertical&&(d+=(n.height-f)/2),d-=(s||u[0].height)/4;var m=Wn("text");return An(m,r),N(u,(function(e){var t;switch(d+=s||e.height,i.horizontal){case"left":t=o.left;break;case"right":t=(a?h:c)-o.right-e.width;break;default:t=Math.max(((a?h:c)-e.width)/2+o.left,0)}var n=Wn("tspan");An(n,{x:t,y:d}),n.textContent=e.text,Dn(m,n)})),$n(p),{dimensions:{width:h,height:f},element:m}};function yi(e){var t=$({fontFamily:"Arial, sans-serif",fontSize:12,fontWeight:"normal",lineHeight:1.2},e&&e.defaultStyle||{}),n=parseInt(t.fontSize,10)-1,r=$({},t,{fontSize:n},e&&e.externalStyle||{}),i=new vi({style:t});this.getExternalLabelBounds=function(e,t){var n=i.getDimensions(t,{box:{width:90,height:30,x:e.width/2+e.x,y:e.height/2+e.y},style:r});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 r=i.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(r.height))}},this.createText=function(e,t){return i.createText(e,t||{})},this.getDefaultStyle=function(){return t},this.getExternalStyle=function(){return r}}yi.$inject=["config.textRenderer"];var gi=/\{([^{}]+)\}/g,bi=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g;var wi={__init__:["drdRenderer"],drdRenderer:["type",oi],textRenderer:["type",yi],pathMap:["type",function(){this.pathMap={KNOWLEDGE_SOURCE:{d:"m {mx},{my} l 0,{e.y0} c {e.x0},{e.y1} {e.x1},-{e.y2} {e.x2},-{e.y3} c {e.x3},-{e.y4} {e.x4},{e.y5} {e.x5},{e.y6} l 0,-{e.y7}z",width:100,height:65,widthElements:[29.8,48.4,67.2,12.2,19.8,30.8],heightElements:[55.3,19.7,4.2,6.7,2.3,1.6,6.2,54.6]},BUSINESS_KNOWLEDGE_MODEL:{d:"m {mx},{my} l {e.x0},-{e.y0} l {e.x1},0 l 0,{e.y1} l -{e.x2},{e.y2} l -{e.x3},0z",width:125,height:45,widthElements:[13.8,109.2,13.8,109.1],heightElements:[13.2,29.8,13.2]},TEXT_ANNOTATION:{d:"m {mx}, {my} m 10,0 l -10,0 l 0,{e.y0} l 10,0",width:10,height:30,widthElements:[10],heightElements:[30]}},this.getRawPath=function(e){return this.pathMap[e].d},this.getScaledPath=function(e,t){var n,r,i=this.pathMap[e];t.abspos?(n=t.abspos.x,r=t.abspos.y):(n=t.containerWidth*t.position.mx,r=t.containerHeight*t.position.my);var o={};if(t.position){for(var a=t.containerHeight/i.height*t.yScaleFactor,s=t.containerWidth/i.width*t.xScaleFactor,l=0;l<i.heightElements.length;l++)o["y"+l]=i.heightElements[l]*a;for(var u=0;u<i.widthElements.length;u++)o["x"+u]=i.widthElements[u]*s}var c,p,f=(c=i.d,p={mx:n,my:r,e:o},String(c).replace(gi,(function(e,t){return function(e,t,n){var r=n;return t.replace(bi,(function(e,t,n,i,o){t=t||i,r&&(t in r&&(r=r[t]),"function"==typeof r&&o&&(r=r()))})),r=(null==r||r==n?e:r)+""}(e,t,p)})));return f}}]};function _i(e,t,n,r){this._eventBus=e,this._canvas=t,this._elementRegistry=r,this._elementFactory=n}function xi(e,t){return $({id:e.id,type:e.$type,businessObject:e},t)}function Ei(e){return e.split("#").pop()}_i.$inject=["eventBus","canvas","elementFactory","elementRegistry"],_i.prototype.root=function(e){var t=this._elementFactory.createRoot(xi(e));return this._canvas.setRootElement(t),t},_i.prototype.add=function(e){var t,n,r,i,o,a,s=this._elementFactory,l=this._canvas,u=this._eventBus,c=e.di;if(c.$instanceOf("dmndi:DMNShape"))a=c.bounds,o=xi(e,{x:Math.round(a.x),y:Math.round(a.y),width:Math.round(a.width),height:Math.round(a.height)}),t=s.createShape(o),l.addShape(t),u.fire("drdElement.added",{element:t,di:c});else{if(!c.$instanceOf("dmndi:DMNEdge"))throw new Error("unknown di for element "+e.id);n=function(e){var t=e.waypoint;if(t)return function(e,t){var n=[];return N(e,(function(e,r){n.push(t(e,r))})),n}(t,(function(e){var t={x:e.x,y:e.y};return $({original:t},t)}))}(c),r=this._getSource(e),i=this._getTarget(e),r&&i&&(o=xi(e,{hidden:!1,source:r,target:i,waypoints:n}),t=s.createConnection(o),l.addConnection(t),u.fire("drdElement.added",{element:t,di:c}))}return t},_i.prototype._getSource=function(e){var t,n;if(Zr(e,"dmn:Association")?n=e.sourceRef:Zr(e,"dmn:InformationRequirement")?n=e.requiredDecision||e.requiredInput:Zr(e,"dmn:KnowledgeRequirement")?n=e.requiredKnowledge:Zr(e,"dmn:AuthorityRequirement")&&(n=e.requiredDecision||e.requiredInput||e.requiredAuthority),n&&(t=n.href),t)return this._getShape(Ei(t))},_i.prototype._getTarget=function(e){return Zr(e,"dmn:Association")?e.targetRef&&this._getShape(Ei(e.targetRef.href)):this._getShape(e.$parent.id)},_i.prototype._getShape=function(e){return this._elementRegistry.get(e)};var ki={__depends__:[wi,{drdImporter:["type",_i]}]};var Ci={translate:["value",function(e,t){return t=t||{},e.replace(/{([^}]+)}/g,(function(e,n){return t[n]||"{"+n+"}"}))}]};function Oi(e){return e.originalEvent||e.srcEvent}function Si(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 Mi(e,t){return(Oi(e)||e).button===t}function ji(e){return Mi(e,0)}function Ni(e){var t=Oi(e)||e;return!!ji(e)&&(/mac/i.test(navigator.platform)?t.metaKey:t.ctrlKey)}function Pi(e){return!0}function Di(e){return ji(e)||function(e){return Mi(e,1)}(e)}function Ri(e,t,n){var r=this;function i(n,r,i){var o,a;(function(e,t){var n=l[e]||ji;return!n(t)})(n,r)||(i?a=t.getGraphics(i):(o=r.delegateTarget||r.target)&&(a=o,i=t.get(a)),a&&i&&!1===e.fire(n,{element:i,gfx:a,originalEvent:r})&&(r.stopPropagation(),r.preventDefault()))}var o={};function a(e){return o[e]}var s={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":Pi,"element.mousedown":Di,"element.mouseup":Di,"element.click":Di,"element.dblclick":Di};function u(e,t,n,r){var a=o[n]=function(e){i(n,e)};r&&(l[n]=r),a.$delegate=en.bind(e,"svg, .djs-element",t,a)}function c(e,t,n){var r=a(n);r&&en.unbind(e,t,r.$delegate)}e.on("canvas.destroy",(function(e){var t;t=e.svg,N(s,(function(e,n){c(t,n,e)}))})),e.on("canvas.init",(function(e){var t;t=e.svg,N(s,(function(e,n){u(t,n,e)}))})),e.on(["shape.added","connection.added"],(function(t){var n=t.element,r=t.gfx;e.fire("interactionEvents.createHit",{element:n,gfx:r})})),e.on(["shape.changed","connection.changed"],500,(function(t){var n=t.element,r=t.gfx;e.fire("interactionEvents.updateHit",{element:n,gfx:r})})),e.on("interactionEvents.createHit",500,(function(e){var t=e.element,n=e.gfx;r.createDefaultHit(t,n)})),e.on("interactionEvents.updateHit",(function(e){var t=e.element,n=e.gfx;r.updateDefaultHit(t,n)}));var p=d("djs-hit djs-hit-stroke"),f=d("djs-hit djs-hit-click-stroke"),h={all:d("djs-hit djs-hit-all"),"click-stroke":f,stroke:p,"no-move":d("djs-hit djs-hit-no-move")};function d(e,t){return t=$({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 An(e,n),e}function v(e,t){Dn(e,t)}this.removeHits=function(e){var t;N((t=".djs-hit",(e||document).querySelectorAll(t)),$n)},this.createDefaultHit=function(e,t){var n,r=e.waypoints,i=e.isFrame;return r?this.createWaypointsHit(t,r):(n=i?"stroke":"all",this.createBoxHit(t,n,{width:e.width,height:e.height}))},this.createWaypointsHit=function(e,t){var n=ur(t);return m(n,"stroke"),v(e,n),n},this.createBoxHit=function(e,t,n){n=$({x:0,y:0},n);var r=Wn("rect");return m(r,t),An(r,n),v(e,r),r},this.updateDefaultHit=function(e,t){var n=an(".djs-hit",t);if(n)return e.waypoints?cr(n,e.waypoints):An(n,{width:e.width,height:e.height}),n},this.fire=i,this.triggerMouseEvent=function(e,t,n){var r=s[e];if(!r)throw new Error("unmapped DOM event name <"+e+">");return i(r,t,n)},this.mouseHandler=a,this.registerEvent=u,this.unregisterEvent=c}Ri.$inject=["eventBus","elementRegistry","styles"];var Ti={__init__:["interactionEvents"],interactionEvents:["type",Ri]};function Ai(e,t){this.offset=6;var n=t.cls("djs-outline",["no-fill"]),r=this;function i(e,t){var r=Wn("rect");return An(r,$({x:10,y:10,rx:4,width:100,height:100},n)),Dn(e,r),r}e.on(["shape.added","shape.changed"],500,(function(e){var t=e.element,n=e.gfx,o=an(".djs-outline",n);o||(o=i(n)),r.updateShapeOutline(o,t)})),e.on(["connection.added","connection.changed"],(function(e){var t=e.element,n=e.gfx,o=an(".djs-outline",n);o||(o=i(n)),r.updateConnectionOutline(o,t)}))}Ai.prototype.updateShapeOutline=function(e,t){An(e,{x:-this.offset,y:-this.offset,width:t.width+2*this.offset,height:t.height+2*this.offset})},Ai.prototype.updateConnectionOutline=function(e,t){var n=pr(t);An(e,{x:n.x-this.offset,y:n.y-this.offset,width:n.width+2*this.offset,height:n.height+2*this.offset})},Ai.$inject=["eventBus","styles","elementRegistry"];var Ii={__init__:["outline"],outline:["type",Ai]};function Bi(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)}))}Bi.$inject=["eventBus","canvas"],Bi.prototype.deselect=function(e){var t=this._selectedElements,n=t.indexOf(e);if(-1!==n){var r=t.slice();t.splice(n,1),this._eventBus.fire("selection.changed",{oldSelection:r,newSelection:t})}},Bi.prototype.get=function(){return this._selectedElements},Bi.prototype.isSelected=function(e){return-1!==this._selectedElements.indexOf(e)},Bi.prototype.select=function(e,t){var n=this._selectedElements,r=n.slice();x(e)||(e=e?[e]:[]);var i=this._canvas,o=i.getRootElement();e=e.filter((function(e){var t=i.findRoot(e);return o===t})),t?N(e,(function(e){-1===n.indexOf(e)&&n.push(e)})):this._selectedElements=n=e.slice(),this._eventBus.fire("selection.changed",{oldSelection:r,newSelection:n})};var Li="hover",$i="selected";function Vi(e,t,n){this._canvas=e;var r=this;function i(t,n){e.addMarker(t,n)}function o(t,n){e.removeMarker(t,n)}this._multiSelectionBox=null,t.on("element.hover",(function(e){i(e.element,Li)})),t.on("element.out",(function(e){o(e.element,Li)})),t.on("selection.changed",(function(e){var t=e.oldSelection,n=e.newSelection;N(t,(function(e){-1===n.indexOf(e)&&o(e,$i)})),N(n,(function(e){-1===t.indexOf(e)&&i(e,$i)})),r._updateSelectionOutline(n)})),t.on("element.changed",(function(e){n.isSelected(e.element)&&r._updateSelectionOutline(n.get())}))}function zi(e,t,n,r){e.on("create.end",500,(function(e){var n=e.context,r=n.canExecute,i=n.elements,o=(n.hints||{}).autoSelect;if(r){if(!1===o)return;x(o)?t.select(o):t.select(i.filter(Ui))}})),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||[],i=r.get(e.context.shape.id);M(n,(function(e){return i.id===e.id}))||t.select(i)})),e.on("element.click",(function(e){if(ji(e)){var r=e.element;r===n.getRootElement()&&(r=null);var i=t.isSelected(r),o=t.get().length>1,a=Ni(e)||function(e){var t=Oi(e)||e;return ji(e)&&t.shiftKey}(e);if(i&&o)return a?t.deselect(r):t.select(r);i?t.deselect(r):t.select(r,a)}}))}function Ui(e){return!e.hidden}Vi.$inject=["canvas","eventBus","selection"],Vi.prototype._updateSelectionOutline=function(e){var t=this._canvas.getLayer("selectionOutline");Vn(t);var n=e.length>1;if(Bn(this._canvas.getContainer())[n?"add":"remove"]("djs-multi-select"),n){var r=function(e){return{x:e.x-6,y:e.y-6,width:e.width+12,height:e.height+12}}(pr(e)),i=Wn("rect");An(i,$({rx:3},r)),Bn(i).add("djs-selection-outline"),Dn(t,i)}},zi.$inject=["eventBus","selection","canvas","elementRegistry"];var Fi={__init__:["selectionVisuals","selectionBehavior"],__depends__:[Ti,Ii],selection:["type",Bi],selectionVisuals:["type",Vi],selectionBehavior:["type",zi]};function Wi(e){this._counter=0,this._prefix=(e?e+"-":"")+Math.floor(1e9*Math.random())+"-"}Wi.prototype.next=function(){return this._prefix+ ++this._counter};var qi=new Wi("ov");function Gi(e,t,n,r){var i,o;this._eventBus=t,this._canvas=n,this._elementRegistry=r,this._ids=qi,this._overlayDefaults=$({show:null,scale:!0},e&&e.defaults),this._overlays={},this._overlayContainers=[],this._overlayRoot=(i=n.getContainer(),Lt(o=on('<div class="djs-overlay-container" />'),{position:"absolute",width:0,height:0}),i.insertBefore(o,i.firstChild),o),this._init()}function Hi(e,t,n){Lt(e,{left:t+"px",top:n+"px"})}function Xi(e,t){e.style.display=!1===t?"none":""}function Yi(e,t){e.style["transform-origin"]="top left",["","-ms-","-webkit-"].forEach((function(n){e.style[n+"transform"]=t}))}Gi.$inject=["config.overlays","eventBus","canvas","elementRegistry"],Gi.prototype.get=function(e){if(O(e)&&(e={id:e}),O(e.element)&&(e.element=this._elementRegistry.get(e.element)),e.element){var t=this._getOverlayContainer(e.element,!0);return t?e.type?j(t.overlays,R({type:e.type})):t.overlays.slice():[]}return e.type?j(this._overlays,R({type:e.type})):e.id?this._overlays[e.id]:null},Gi.prototype.add=function(e,t,n){if(E(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 r=this._ids.next();return n=$({},this._overlayDefaults,n,{id:r,type:t,element:e,html:n.html}),this._addOverlay(n),r},Gi.prototype.remove=function(e){var t=this.get(e)||[];x(t)||(t=[t]);var n=this;N(t,(function(e){var t=n._getOverlayContainer(e.element,!0);if(e&&(sn(e.html),sn(e.htmlContainer),delete e.htmlContainer,delete e.element,delete n._overlays[e.id]),t){var r=t.overlays.indexOf(e);-1!==r&&t.overlays.splice(r,1)}}))},Gi.prototype.isShown=function(){return"none"!==this._overlayRoot.style.display},Gi.prototype.show=function(){Xi(this._overlayRoot)},Gi.prototype.hide=function(){Xi(this._overlayRoot,!1)},Gi.prototype.clear=function(){this._overlays={},this._overlayContainers=[],Ft(this._overlayRoot)},Gi.prototype._updateOverlayContainer=function(e){var t=e.element,n=e.html,r=t.x,i=t.y;if(t.waypoints){var o=pr(t);r=o.x,i=o.y}Hi(n,r,i),$t(e.html,"data-container-id",t.id)},Gi.prototype._updateOverlay=function(e){var t,n,r=e.position,i=e.htmlContainer,o=e.element,a=r.left,s=r.top;void 0!==r.right&&(t=o.waypoints?pr(o).width:o.width,a=-1*r.right+t);void 0!==r.bottom&&(n=o.waypoints?pr(o).height:o.height,s=-1*r.bottom+n);Hi(i,a||0,s||0),this._updateOverlayVisibilty(e,this._canvas.viewbox())},Gi.prototype._createOverlayContainer=function(e){var t=on('<div class="djs-overlays" />');Lt(t,{position:"absolute"}),this._overlayRoot.appendChild(t);var n={html:t,element:e,overlays:[]};return this._updateOverlayContainer(n),this._overlayContainers.push(n),n},Gi.prototype._updateRoot=function(e){var t=e.scale||1,n="matrix("+[t,0,0,t,-1*e.x*t,-1*e.y*t].join(",")+")";Yi(this._overlayRoot,n)},Gi.prototype._getOverlayContainer=function(e,t){var n=M(this._overlayContainers,(function(t){return t.element===e}));return n||t?n:this._createOverlayContainer(e)},Gi.prototype._addOverlay=function(e){var t,n,r=e.id,i=e.element,o=e.html;o.get&&o.constructor.prototype.jquery&&(o=o.get(0)),O(o)&&(o=on(o)),n=this._getOverlayContainer(i),Lt(t=on('<div class="djs-overlay" data-overlay-id="'+r+'">'),{position:"absolute"}),t.appendChild(o),e.type&&zt(t).add("djs-overlay-"+e.type),Xi(t,this._canvas.findRoot(i)===this._canvas.getRootElement()),e.htmlContainer=t,n.overlays.push(e),n.html.appendChild(t),this._overlays[r]=e,this._updateOverlay(e),this._updateOverlayVisibilty(e,this._canvas.viewbox())},Gi.prototype._updateOverlayVisibilty=function(e,t){var n=e.show,r=this._canvas.findRoot(e.element),i=n&&n.minZoom,o=n&&n.maxZoom,a=e.htmlContainer,s=!0;(r!==this._canvas.getRootElement()||n&&(_(i)&&i>t.scale||_(o)&&o<t.scale))&&(s=!1),Xi(a,s),this._updateOverlayScale(e,t)},Gi.prototype._updateOverlayScale=function(e,t){var n,r,i,o=e.scale,a=e.htmlContainer,s="";!0!==o&&(!1===o?(n=1,r=1):(n=o.min,r=o.max),_(n)&&t.scale<n&&(i=(1/t.scale||1)*n),_(r)&&t.scale>r&&(i=(1/t.scale||1)*r)),_(i)&&(s="scale("+i+","+i+")"),Yi(a,s)},Gi.prototype._updateOverlaysVisibilty=function(e){var t=this;N(this._overlays,(function(n){t._updateOverlayVisibilty(n,e)}))},Gi.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;N(t.get({element:n}),(function(e){t.remove(e.id)}));var r=t._getOverlayContainer(n);if(r){sn(r.html);var i=t._overlayContainers.indexOf(r);-1!==i&&t._overlayContainers.splice(i,1)}})),e.on("element.changed",500,(function(e){var n=e.element,r=t._getOverlayContainer(n,!0);r&&(N(r.overlays,(function(e){t._updateOverlay(e)})),t._updateOverlayContainer(r))})),e.on("element.marker.update",(function(e){var n=t._getOverlayContainer(e.element,!0);n&&zt(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)};var Ki={__init__:["overlays"],overlays:["type",Gi]};function Zi(e,t,n){this._eventBus=e,this._canvas=t,this._translate=n,e.on("diagram.init",(function(){this._init()}),this),e.on("import.done",(function(e){e.error||this.update()}),this),this.HTML_MARKUP='<div class="dmn-definitions"><div class="dmn-definitions-name" title="'+this._translate("Definition Name")+'" spellcheck="false"></div><div class="dmn-definitions-id" title="'+this._translate("Definition ID")+'" spellcheck="false"></div></div>'}function Qi(e,t){function n(e,n){zt(t.getContainer()).toggle(e,n)}e.on("palette.create",(function(){n("with-palette",!0)})),e.on("palette.changed",(function(e){n("with-palette-two-column",e.twoColumn)}))}Zi.$inject=["eventBus","canvas","translate"],Zi.prototype._init=function(){var e=this._canvas,t=this._eventBus,n=e.getContainer(),r=this._container=on(this.HTML_MARKUP);n.appendChild(r),this.nameElement=an(".dmn-definitions-name",this._container),this.idElement=an(".dmn-definitions-id",this._container),en.bind(r,".dmn-definitions-name, .dmn-definitions-id","mousedown",(function(e){e.stopPropagation()})),t.fire("definitionIdView.create",{html:r})},Zi.prototype.update=function(){var e=this._canvas.getRootElement().businessObject;this.nameElement.textContent=e.name,this.idElement.textContent=e.id},Qi.$inject=["eventBus","canvas"];var Ji={__depends__:[Ci],__init__:["definitionPropertiesView","definitionPropertiesPaletteAdapter"],definitionPropertiesView:["type",Zi],definitionPropertiesPaletteAdapter:["type",Qi]},eo=[{className:"dmn-icon-decision-table",matches:function(e){var t=e.businessObject;return Zr(t,"dmn:Decision")&&Zr(t.decisionLogic,"dmn:DecisionTable")}},{className:"dmn-icon-literal-expression",matches:function(e){var t=e.businessObject;return Zr(t,"dmn:Decision")&&Zr(t.decisionLogic,"dmn:LiteralExpression")}}],to=function(){function e(t,n,i,o){var a=this;r(this,e),this._injector=t,this._eventBus=n,this._overlays=i,this._config=o||{enabled:!0},n.on(["shape.added"],(function(e){for(var t=e.element,n=0;n<eo.length;n++){var r=eo[n],i=r.matches,o=r.className;i&&i(t)&&a.addOverlay(t,o)}}))}return o(e,[{key:"addOverlay",value:function(e,t){var n=on('\n      <div class="drill-down-overlay">\n        <span class="'.concat(t,'"></span>\n      </div>\n    ')),r=this._overlays.add(e,{position:{top:2,left:2},html:n});!1!==this._config.enabled&&(zt(n).add("interactive"),this.bindEventListener(e,n,r))}},{key:"bindEventListener",value:function(e,t,n){var r=this,i=this._overlays,o=this._eventBus,a=i._overlayRoot;en.bind(a,'[data-overlay-id="'+n+'"]',"click",(function(){!1!==o.fire("drillDown.click",{element:e})&&r.drillDown(e)}))}},{key:"drillDown",value:function(e){var t=this._injector.get("_parent",!1);if(!t)return!1;var n=t.getView(e.businessObject);return!!n&&(t.open(n),!0)}}]),e}();to.$inject=["injector","eventBus","overlays","config.drillDown"];var no={__depends__:[Ki],__init__:["drillDown"],drillDown:["type",to]},ro='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14.02 5.57" width="53" height="21" style="vertical-align:middle"><path fill="#000000" d="M1.88.92v.14c0 .41-.13.68-.4.8.33.14.46.44.46.86v.33c0 .61-.33.95-.95.95H0V0h.95c.65 0 .93.3.93.92zM.63.57v1.06h.24c.24 0 .38-.1.38-.43V.98c0-.28-.1-.4-.32-.4zm0 1.63v1.22h.36c.2 0 .32-.1.32-.39v-.35c0-.37-.12-.48-.4-.48H.63zM4.18.99v.52c0 .64-.31.98-.94.98h-.3V4h-.62V0h.92c.63 0 .94.35.94.99zM2.94.57v1.35h.3c.2 0 .3-.09.3-.37v-.6c0-.29-.1-.38-.3-.38h-.3zm2.89 2.27L6.25 0h.88v4h-.6V1.12L6.1 3.99h-.6l-.46-2.82v2.82h-.55V0h.87zM8.14 1.1V4h-.56V0h.79L9 2.4V0h.56v4h-.64zm2.49 2.29v.6h-.6v-.6zM12.12 1c0-.63.33-1 .95-1 .61 0 .95.37.95 1v2.04c0 .64-.34 1-.95 1-.62 0-.95-.37-.95-1zm.62 2.08c0 .28.13.39.33.39s.32-.1.32-.4V.98c0-.29-.12-.4-.32-.4s-.33.11-.33.4z"/><path fill="#000000" d="M0 4.53h14.02v1.04H0zM11.08 0h.63v.62h-.63zm.63 4V1h-.63v2.98z"/></svg>';
3/**
4   * This file must not be changed or exchanged.
5   *
6   * @see http://bpmn.io/license for more information.
7   */function io(e){return e.join(";")}var oo,ao='<div class="bjs-powered-by-lightbox" style="'+io(["z-index: 1001","position: fixed","top: 0","left: 0","right: 0","bottom: 0"])+'"><div class="backdrop" style="'+io(["width: 100%","height: 100%","background: rgba(40,40,40,0.2)"])+'"></div><div class="notice" style="'+io(["position: absolute","left: 50%","top: 40%","transform: translate(-50%)","width: 260px","padding: 10px","background: white","box-shadow: 0 1px 4px rgba(0,0,0,0.3)","font-family: Helvetica, Arial, sans-serif","font-size: 14px","display: flex","line-height: 1.3"])+'"><a href="https://bpmn.io" target="_blank" rel="noopener" style="margin: 15px 20px 15px 10px; align-self: center;">'+ro+'</a><span>Web-based tooling for BPMN, DMN and CMMN diagrams powered by <a href="https://bpmn.io" target="_blank" rel="noopener">bpmn.io</a>.</span></div></div>';var so=["additionalModules","canvas"];function lo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function uo(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?lo(Object(n),!0).forEach((function(t){co(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lo(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function co(e,t,r){return(t=function(e){var t=function(e,t){if("object"!==n(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!==n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===n(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function po(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function fo(e){
8/**
9   * Adds the project logo to the diagram container as
10   * required by the bpmn.io license.
11   *
12   * @see http://bpmn.io/license
13   *
14   * @param {Element} container
15   */
16var t,n;this._container=this._createContainer(),t=this._container,n=on('<a href="http://bpmn.io" target="_blank" class="bjs-powered-by" title="Powered by bpmn.io" style="position: absolute; bottom: 15px; right: 15px; z-index: 100;">'+ro+"</a>"),t.appendChild(n),Zt.bind(n,"click",(function(e){oo||(oo=on(ao),en.bind(oo,".backdrop","click",(function(e){document.body.removeChild(oo)}))),document.body.appendChild(oo),e.preventDefault()})),this._init(this._container,e)}function ho(e,t){return{x:e.x-t.x,y:e.y-t.y}}function mo(e){return Math.log(e)/Math.log(10)}function vo(e,t){var n=mo(e.min),r=mo(e.max);return(Math.abs(n)+Math.abs(r))/t}bn(fo,Kr),fo.prototype.saveSVG=ln((function(e){var t=this;return new Promise((function(e){var n=t.get("canvas"),r=n.getActiveLayer(),i=an("defs",n._svg),o=er(r),a=i&&i.outerHTML||"",s=r.getBBox();e({svg:'<?xml version="1.0" encoding="utf-8"?>\n\x3c!-- created with dmn-js / http://bpmn.io --\x3e\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="'+s.width+'" height="'+s.height+'" viewBox="'+s.x+" "+s.y+" "+s.width+" "+s.height+'" version="1.1">'+a+o+"</svg>"})}))})),fo.prototype.getModules=function(){return this._modules},fo.prototype.destroy=function(){Kr.prototype.destroy.call(this),sn(this._container)},fo.prototype.on=function(e,t,n,r){return this.get("eventBus").on(e,t,n,r)},fo.prototype.off=function(e,t){this.get("eventBus").off(e,t)},fo.prototype._init=function(e,t){var n=t.additionalModules,r=t.canvas,i=po(t,so),o=t.modules||this.getModules(),a=[].concat([{drd:["value",this]}],v(o),v(n||[])),s=uo(uo({},i),{},{canvas:uo(uo({},r),{},{container:e}),modules:a});Kr.call(this,s),t&&t.container&&this.attachTo(t.container)},fo.prototype._emit=function(e,t){return this.get("eventBus").fire(e,t)},fo.prototype._createContainer=function(){return on('<div class="dmn-drd-container"></div>')},fo.prototype.open=function(e){var t=this;return new Promise((function(n,r){var i;try{return t._definitions&&t.clear(),t._definitions=e,function(e,t,n){var r,i=e.get("drdImporter"),o=e.get("eventBus"),a=[];o.fire("import.start",{definitions:t});try{!function(e){new ei({root:function(e){return i.root(e)},element:function(e,t){return i.add(e,t)},error:function(e,t){a.push({message:e,context:t})}}).handleDefinitions(e)}(t)}catch(e){r=e}o.fire("import.done",{error:r,warnings:a}),n(r,a)}(t,e,(function(e,t){e?(e.warnings=t||[],r(e)):n({warnings:t||[]})}))}catch(e){i=e}i?(i.warnings=i.warnings||[],r(i)):n({warnings:[]})}))},fo.prototype.attachTo=function(e){if(!e)throw new Error("parentNode required");this.detach();var t=this._container;e.appendChild(t),this._emit("attach",{}),this.get("canvas").resized()},fo.prototype.detach=function(){var e=this._container,t=e.parentNode;t&&(this._emit("detach",{}),t.removeChild(e))},fo.prototype._modules=[ki,Ci,Fi,Ki,Ji,no];var yo=Math.sign||function(e){return e>=0?1:-1},go={min:.2,max:4};function bo(e,t,n){e=e||{},this._enabled=!1,this._canvas=n,this._container=n._container,this._handleWheel=L(this._handleWheel,this),this._totalDelta=0,this._scale=e.scale||.75;var r=this;t.on("canvas.init",(function(t){r._init(!1!==e.enabled)}))}bo.$inject=["config.zoomScroll","eventBus","canvas"],bo.prototype.scroll=function(e){this._canvas.scroll(e)},bo.prototype.reset=function(){this._canvas.zoom("fit-viewport")},bo.prototype.zoom=function(e,t){var n=vo(go,20);this._totalDelta+=e,Math.abs(this._totalDelta)>.1&&(this._zoom(e,t,n),this._totalDelta=0)},bo.prototype._handleWheel=function(e){if(!qt(e.target,".djs-scrollable",!0)){var t=this._container;e.preventDefault();var n,r=e.ctrlKey,i=e.shiftKey,o=-1*this._scale;if(o*=r?0===e.deltaMode?.02:.32:0===e.deltaMode?1:16,r){var a=t.getBoundingClientRect(),s={x:e.clientX-a.left,y:e.clientY-a.top};n=Math.sqrt(Math.pow(e.deltaY,2)+Math.pow(e.deltaX,2))*yo(e.deltaY)*o,this.zoom(n,s)}else n=i?{dx:o*e.deltaY,dy:0}:{dx:o*e.deltaX,dy:o*e.deltaY},this.scroll(n)}},bo.prototype.stepZoom=function(e,t){var n=vo(go,10);this._zoom(e,t,n)},bo.prototype._zoom=function(e,t,n){var r=this._canvas,i=e>0?1:-1,o=mo(r.zoom()),a=Math.round(o/n)*n;a+=n*i;var s,l,u=Math.pow(10,a);r.zoom((s=go,l=u,Math.max(s.min,Math.min(s.max,l))),t)},bo.prototype.toggle=function(e){var t=this._container,n=this._handleWheel,r=this._enabled;return void 0===e&&(e=!r),r!==e&&Zt[e?"bind":"unbind"](t,"wheel",n,!1),this._enabled=e,e},bo.prototype._init=function(e){this.toggle(e)};var wo={__init__:["zoomScroll"],zoomScroll:["type",bo]},_o=/^djs-cursor-.*$/;function xo(e){var t=zt(document.body);t.removeMatching(_o),e&&t.add("djs-cursor-"+e)}function Eo(e,t){var n;function r(r){var i,o=n.start,a=n.button,s=Si(r),l=ho(s,o);(!n.dragging&&(i=l,Math.sqrt(Math.pow(i.x,2)+Math.pow(i.y,2))>15)&&(n.dragging=!0,0===a&&function(e,t){function n(){return!1}t=t||"element.click",e.once(t,5e3,n)}(e),xo("grab")),n.dragging)&&(l=ho(s,n.last||n.start),t.scroll({dx:l.x,dy:l.y}),n.last=s);r.preventDefault()}function i(e){Zt.unbind(document,"mousemove",r),Zt.unbind(document,"mouseup",i),n=null,xo(null)}e.on("element.mousedown",500,(function(e){return function(e){if(qt(e.target,".djs-draggable"))return;var t=e.button;if(t>=2||e.ctrlKey||e.shiftKey||e.altKey)return;return n={button:t,start:Si(e)},Zt.bind(document,"mousemove",r),Zt.bind(document,"mouseup",i),!0}(e.originalEvent)})),this.isActive=function(){return!!n}}Eo.$inject=["eventBus","canvas"];var ko={__init__:["moveCanvas"],moveCanvas:["type",Eo]},Co={};!function(e){!function(t,r,i,o){var a,s=["","webkit","Moz","MS","ms","o"],l=r.createElement("div"),u=Math.round,c=Math.abs,p=Date.now;function f(e,t,n){return setTimeout(b(e,n),t)}function h(e,t,n){return!!Array.isArray(e)&&(d(e,n[t],n),!0)}function d(e,t,n){var r;if(e)if(e.forEach)e.forEach(t,n);else if(e.length!==o)for(r=0;r<e.length;)t.call(n,e[r],r,e),r++;else for(r in e)e.hasOwnProperty(r)&&t.call(n,e[r],r,e)}function m(e,n,r){var i="DEPRECATED METHOD: "+n+"\n"+r+" AT \n";return function(){var n=new Error("get-stack-trace"),r=n&&n.stack?n.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",o=t.console&&(t.console.warn||t.console.log);return o&&o.call(t.console,i,r),e.apply(this,arguments)}}a="function"!=typeof Object.assign?function(e){if(e===o||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;n<arguments.length;n++){var r=arguments[n];if(r!==o&&null!==r)for(var i in r)r.hasOwnProperty(i)&&(t[i]=r[i])}return t}:Object.assign;var v=m((function(e,t,n){for(var r=Object.keys(t),i=0;i<r.length;)(!n||n&&e[r[i]]===o)&&(e[r[i]]=t[r[i]]),i++;return e}),"extend","Use `assign`."),y=m((function(e,t){return v(e,t,!0)}),"merge","Use `assign`.");function g(e,t,n){var r,i=t.prototype;(r=e.prototype=Object.create(i)).constructor=e,r._super=i,n&&a(r,n)}function b(e,t){return function(){return e.apply(t,arguments)}}function w(e,t){return"function"==n(e)?e.apply(t&&t[0]||o,t):e}function _(e,t){return e===o?t:e}function x(e,t,n){d(O(t),(function(t){e.addEventListener(t,n,!1)}))}function E(e,t,n){d(O(t),(function(t){e.removeEventListener(t,n,!1)}))}function k(e,t){for(;e;){if(e==t)return!0;e=e.parentNode}return!1}function C(e,t){return e.indexOf(t)>-1}function O(e){return e.trim().split(/\s+/g)}function S(e,t,n){if(e.indexOf&&!n)return e.indexOf(t);for(var r=0;r<e.length;){if(n&&e[r][n]==t||!n&&e[r]===t)return r;r++}return-1}function M(e){return Array.prototype.slice.call(e,0)}function j(e,t,n){for(var r=[],i=[],o=0;o<e.length;){var a=t?e[o][t]:e[o];S(i,a)<0&&r.push(e[o]),i[o]=a,o++}return n&&(r=t?r.sort((function(e,n){return e[t]>n[t]})):r.sort()),r}function N(e,t){for(var n,r,i=t[0].toUpperCase()+t.slice(1),a=0;a<s.length;){if((r=(n=s[a])?n+i:t)in e)return r;a++}return o}var P=1;function D(e){var n=e.ownerDocument||e;return n.defaultView||n.parentWindow||t}var R="ontouchstart"in t,T=N(t,"PointerEvent")!==o,A=R&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),I="touch",B="mouse",L=24,$=["x","y"],V=["clientX","clientY"];function z(e,t){var n=this;this.manager=e,this.callback=t,this.element=e.element,this.target=e.options.inputTarget,this.domHandler=function(t){w(e.options.enable,[e])&&n.handler(t)},this.init()}function U(e,t,n){var r=n.pointers.length,i=n.changedPointers.length,a=1&t&&r-i==0,s=12&t&&r-i==0;n.isFirst=!!a,n.isFinal=!!s,a&&(e.session={}),n.eventType=t,function(e,t){var n=e.session,r=t.pointers,i=r.length;n.firstInput||(n.firstInput=F(t));i>1&&!n.firstMultiple?n.firstMultiple=F(t):1===i&&(n.firstMultiple=!1);var a=n.firstInput,s=n.firstMultiple,l=s?s.center:a.center,u=t.center=W(r);t.timeStamp=p(),t.deltaTime=t.timeStamp-a.timeStamp,t.angle=X(l,u),t.distance=H(l,u),function(e,t){var n=t.center,r=e.offsetDelta||{},i=e.prevDelta||{},o=e.prevInput||{};1!==t.eventType&&4!==o.eventType||(i=e.prevDelta={x:o.deltaX||0,y:o.deltaY||0},r=e.offsetDelta={x:n.x,y:n.y});t.deltaX=i.x+(n.x-r.x),t.deltaY=i.y+(n.y-r.y)}(n,t),t.offsetDirection=G(t.deltaX,t.deltaY);var f=q(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=f.x,t.overallVelocityY=f.y,t.overallVelocity=c(f.x)>c(f.y)?f.x:f.y,t.scale=s?(h=s.pointers,d=r,H(d[0],d[1],V)/H(h[0],h[1],V)):1,t.rotation=s?function(e,t){return X(t[1],t[0],V)+X(e[1],e[0],V)}(s.pointers,r):0,t.maxPointers=n.prevInput?t.pointers.length>n.prevInput.maxPointers?t.pointers.length:n.prevInput.maxPointers:t.pointers.length,function(e,t){var n,r,i,a,s=e.lastInterval||t,l=t.timeStamp-s.timeStamp;if(8!=t.eventType&&(l>25||s.velocity===o)){var u=t.deltaX-s.deltaX,p=t.deltaY-s.deltaY,f=q(l,u,p);r=f.x,i=f.y,n=c(f.x)>c(f.y)?f.x:f.y,a=G(u,p),e.lastInterval=t}else n=s.velocity,r=s.velocityX,i=s.velocityY,a=s.direction;t.velocity=n,t.velocityX=r,t.velocityY=i,t.direction=a}(n,t);var h,d;var m=e.element;k(t.srcEvent.target,m)&&(m=t.srcEvent.target);t.target=m}(e,n),e.emit("hammer.input",n),e.recognize(n),e.session.prevInput=n}function F(e){for(var t=[],n=0;n<e.pointers.length;)t[n]={clientX:u(e.pointers[n].clientX),clientY:u(e.pointers[n].clientY)},n++;return{timeStamp:p(),pointers:t,center:W(t),deltaX:e.deltaX,deltaY:e.deltaY}}function W(e){var t=e.length;if(1===t)return{x:u(e[0].clientX),y:u(e[0].clientY)};for(var n=0,r=0,i=0;i<t;)n+=e[i].clientX,r+=e[i].clientY,i++;return{x:u(n/t),y:u(r/t)}}function q(e,t,n){return{x:t/e||0,y:n/e||0}}function G(e,t){return e===t?1:c(e)>=c(t)?e<0?2:4:t<0?8:16}function H(e,t,n){n||(n=$);var r=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return Math.sqrt(r*r+i*i)}function X(e,t,n){n||(n=$);var r=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return 180*Math.atan2(i,r)/Math.PI}z.prototype={handler:function(){},init:function(){this.evEl&&x(this.element,this.evEl,this.domHandler),this.evTarget&&x(this.target,this.evTarget,this.domHandler),this.evWin&&x(D(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&E(this.element,this.evEl,this.domHandler),this.evTarget&&E(this.target,this.evTarget,this.domHandler),this.evWin&&E(D(this.element),this.evWin,this.domHandler)}};var Y={mousedown:1,mousemove:2,mouseup:4},K="mousedown",Z="mousemove mouseup";function Q(){this.evEl=K,this.evWin=Z,this.pressed=!1,z.apply(this,arguments)}g(Q,z,{handler:function(e){var t=Y[e.type];1&t&&0===e.button&&(this.pressed=!0),2&t&&1!==e.which&&(t=4),this.pressed&&(4&t&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:B,srcEvent:e}))}});var J={pointerdown:1,pointermove:2,pointerup:4,pointercancel:8,pointerout:8},ee={2:I,3:"pen",4:B,5:"kinect"},te="pointerdown",ne="pointermove pointerup pointercancel";function re(){this.evEl=te,this.evWin=ne,z.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}t.MSPointerEvent&&!t.PointerEvent&&(te="MSPointerDown",ne="MSPointerMove MSPointerUp MSPointerCancel"),g(re,z,{handler:function(e){var t=this.store,n=!1,r=e.type.toLowerCase().replace("ms",""),i=J[r],o=ee[e.pointerType]||e.pointerType,a=o==I,s=S(t,e.pointerId,"pointerId");1&i&&(0===e.button||a)?s<0&&(t.push(e),s=t.length-1):12&i&&(n=!0),s<0||(t[s]=e,this.callback(this.manager,i,{pointers:t,changedPointers:[e],pointerType:o,srcEvent:e}),n&&t.splice(s,1))}});var ie={touchstart:1,touchmove:2,touchend:4,touchcancel:8},oe="touchstart",ae="touchstart touchmove touchend touchcancel";function se(){this.evTarget=oe,this.evWin=ae,this.started=!1,z.apply(this,arguments)}function le(e,t){var n=M(e.touches),r=M(e.changedTouches);return 12&t&&(n=j(n.concat(r),"identifier",!0)),[n,r]}g(se,z,{handler:function(e){var t=ie[e.type];if(1===t&&(this.started=!0),this.started){var n=le.call(this,e,t);12&t&&n[0].length-n[1].length==0&&(this.started=!1),this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:I,srcEvent:e})}}});var ue={touchstart:1,touchmove:2,touchend:4,touchcancel:8},ce="touchstart touchmove touchend touchcancel";function pe(){this.evTarget=ce,this.targetIds={},z.apply(this,arguments)}function fe(e,t){var n=M(e.touches),r=this.targetIds;if(3&t&&1===n.length)return r[n[0].identifier]=!0,[n,n];var i,o,a=M(e.changedTouches),s=[],l=this.target;if(o=n.filter((function(e){return k(e.target,l)})),1===t)for(i=0;i<o.length;)r[o[i].identifier]=!0,i++;for(i=0;i<a.length;)r[a[i].identifier]&&s.push(a[i]),12&t&&delete r[a[i].identifier],i++;return s.length?[j(o.concat(s),"identifier",!0),s]:void 0}g(pe,z,{handler:function(e){var t=ue[e.type],n=fe.call(this,e,t);n&&this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:I,srcEvent:e})}});function he(){z.apply(this,arguments);var e=b(this.handler,this);this.touch=new pe(this.manager,e),this.mouse=new Q(this.manager,e),this.primaryTouch=null,this.lastTouches=[]}function de(e,t){1&e?(this.primaryTouch=t.changedPointers[0].identifier,me.call(this,t)):12&e&&me.call(this,t)}function me(e){var t=e.changedPointers[0];if(t.identifier===this.primaryTouch){var n={x:t.clientX,y:t.clientY};this.lastTouches.push(n);var r=this.lastTouches;setTimeout((function(){var e=r.indexOf(n);e>-1&&r.splice(e,1)}),2500)}}function ve(e){for(var t=e.srcEvent.clientX,n=e.srcEvent.clientY,r=0;r<this.lastTouches.length;r++){var i=this.lastTouches[r],o=Math.abs(t-i.x),a=Math.abs(n-i.y);if(o<=25&&a<=25)return!0}return!1}g(he,z,{handler:function(e,t,n){var r=n.pointerType==I,i=n.pointerType==B;if(!(i&&n.sourceCapabilities&&n.sourceCapabilities.firesTouchEvents)){if(r)de.call(this,t,n);else if(i&&ve.call(this,n))return;this.callback(e,t,n)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var ye=N(l.style,"touchAction"),ge=ye!==o,be="compute",we="auto",_e="manipulation",xe="none",Ee="pan-x",ke="pan-y",Ce=function(){if(!ge)return!1;var e={},n=t.CSS&&t.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach((function(r){e[r]=!n||t.CSS.supports("touch-action",r)})),e}();function Oe(e,t){this.manager=e,this.set(t)}Oe.prototype={set:function(e){e==be&&(e=this.compute()),ge&&this.manager.element.style&&Ce[e]&&(this.manager.element.style[ye]=e),this.actions=e.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var e=[];return d(this.manager.recognizers,(function(t){w(t.options.enable,[t])&&(e=e.concat(t.getTouchAction()))})),function(e){if(C(e,xe))return xe;var t=C(e,Ee),n=C(e,ke);if(t&&n)return xe;if(t||n)return t?Ee:ke;if(C(e,_e))return _e;return we}(e.join(" "))},preventDefaults:function(e){var t=e.srcEvent,n=e.offsetDirection;if(this.manager.session.prevented)t.preventDefault();else{var r=this.actions,i=C(r,xe)&&!Ce[xe],o=C(r,ke)&&!Ce[ke],a=C(r,Ee)&&!Ce[Ee];if(i){var s=1===e.pointers.length,l=e.distance<2,u=e.deltaTime<250;if(s&&l&&u)return}if(!a||!o)return i||o&&6&n||a&&n&L?this.preventSrc(t):void 0}},preventSrc:function(e){this.manager.session.prevented=!0,e.preventDefault()}};var Se=32;function Me(e){this.options=a({},this.defaults,e||{}),this.id=P++,this.manager=null,this.options.enable=_(this.options.enable,!0),this.state=1,this.simultaneous={},this.requireFail=[]}function je(e){return 16&e?"cancel":8&e?"end":4&e?"move":2&e?"start":""}function Ne(e){return 16==e?"down":8==e?"up":2==e?"left":4==e?"right":""}function Pe(e,t){var n=t.manager;return n?n.get(e):e}function De(){Me.apply(this,arguments)}function Re(){De.apply(this,arguments),this.pX=null,this.pY=null}function Te(){De.apply(this,arguments)}function Ae(){Me.apply(this,arguments),this._timer=null,this._input=null}function Ie(){De.apply(this,arguments)}function Be(){De.apply(this,arguments)}function Le(){Me.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function $e(e,t){return(t=t||{}).recognizers=_(t.recognizers,$e.defaults.preset),new Ve(e,t)}Me.prototype={defaults:{},set:function(e){return a(this.options,e),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(e){if(h(e,"recognizeWith",this))return this;var t=this.simultaneous;return t[(e=Pe(e,this)).id]||(t[e.id]=e,e.recognizeWith(this)),this},dropRecognizeWith:function(e){return h(e,"dropRecognizeWith",this)||(e=Pe(e,this),delete this.simultaneous[e.id]),this},requireFailure:function(e){if(h(e,"requireFailure",this))return this;var t=this.requireFail;return-1===S(t,e=Pe(e,this))&&(t.push(e),e.requireFailure(this)),this},dropRequireFailure:function(e){if(h(e,"dropRequireFailure",this))return this;e=Pe(e,this);var t=S(this.requireFail,e);return t>-1&&this.requireFail.splice(t,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(e){return!!this.simultaneous[e.id]},emit:function(e){var t=this,n=this.state;function r(n){t.manager.emit(n,e)}n<8&&r(t.options.event+je(n)),r(t.options.event),e.additionalEvent&&r(e.additionalEvent),n>=8&&r(t.options.event+je(n))},tryEmit:function(e){if(this.canEmit())return this.emit(e);this.state=Se},canEmit:function(){for(var e=0;e<this.requireFail.length;){if(!(33&this.requireFail[e].state))return!1;e++}return!0},recognize:function(e){var t=a({},e);if(!w(this.options.enable,[this,t]))return this.reset(),void(this.state=Se);56&this.state&&(this.state=1),this.state=this.process(t),30&this.state&&this.tryEmit(t)},process:function(e){},getTouchAction:function(){},reset:function(){}},g(De,Me,{defaults:{pointers:1},attrTest:function(e){var t=this.options.pointers;return 0===t||e.pointers.length===t},process:function(e){var t=this.state,n=e.eventType,r=6&t,i=this.attrTest(e);return r&&(8&n||!i)?16|t:r||i?4&n?8|t:2&t?4|t:2:Se}}),g(Re,De,{defaults:{event:"pan",threshold:10,pointers:1,direction:30},getTouchAction:function(){var e=this.options.direction,t=[];return 6&e&&t.push(ke),e&L&&t.push(Ee),t},directionTest:function(e){var t=this.options,n=!0,r=e.distance,i=e.direction,o=e.deltaX,a=e.deltaY;return i&t.direction||(6&t.direction?(i=0===o?1:o<0?2:4,n=o!=this.pX,r=Math.abs(e.deltaX)):(i=0===a?1:a<0?8:16,n=a!=this.pY,r=Math.abs(e.deltaY))),e.direction=i,n&&r>t.threshold&&i&t.direction},attrTest:function(e){return De.prototype.attrTest.call(this,e)&&(2&this.state||!(2&this.state)&&this.directionTest(e))},emit:function(e){this.pX=e.deltaX,this.pY=e.deltaY;var t=Ne(e.direction);t&&(e.additionalEvent=this.options.event+t),this._super.emit.call(this,e)}}),g(Te,De,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[xe]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.scale-1)>this.options.threshold||2&this.state)},emit:function(e){if(1!==e.scale){var t=e.scale<1?"in":"out";e.additionalEvent=this.options.event+t}this._super.emit.call(this,e)}}),g(Ae,Me,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[we]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,r=e.distance<t.threshold,i=e.deltaTime>t.time;if(this._input=e,!r||!n||12&e.eventType&&!i)this.reset();else if(1&e.eventType)this.reset(),this._timer=f((function(){this.state=8,this.tryEmit()}),t.time,this);else if(4&e.eventType)return 8;return Se},reset:function(){clearTimeout(this._timer)},emit:function(e){8===this.state&&(e&&4&e.eventType?this.manager.emit(this.options.event+"up",e):(this._input.timeStamp=p(),this.manager.emit(this.options.event,this._input)))}}),g(Ie,De,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[xe]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||2&this.state)}}),g(Be,De,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:30,pointers:1},getTouchAction:function(){return Re.prototype.getTouchAction.call(this)},attrTest:function(e){var t,n=this.options.direction;return 30&n?t=e.overallVelocity:6&n?t=e.overallVelocityX:n&L&&(t=e.overallVelocityY),this._super.attrTest.call(this,e)&&n&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers==this.options.pointers&&c(t)>this.options.velocity&&4&e.eventType},emit:function(e){var t=Ne(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)}}),g(Le,Me,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[_e]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,r=e.distance<t.threshold,i=e.deltaTime<t.time;if(this.reset(),1&e.eventType&&0===this.count)return this.failTimeout();if(r&&i&&n){if(4!=e.eventType)return this.failTimeout();var o=!this.pTime||e.timeStamp-this.pTime<t.interval,a=!this.pCenter||H(this.pCenter,e.center)<t.posThreshold;if(this.pTime=e.timeStamp,this.pCenter=e.center,a&&o?this.count+=1:this.count=1,this._input=e,0===this.count%t.taps)return this.hasRequireFailures()?(this._timer=f((function(){this.state=8,this.tryEmit()}),t.interval,this),2):8}return Se},failTimeout:function(){return this._timer=f((function(){this.state=Se}),this.options.interval,this),Se},reset:function(){clearTimeout(this._timer)},emit:function(){8==this.state&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),$e.VERSION="2.0.7",$e.defaults={domEvents:!1,touchAction:be,enable:!0,inputTarget:null,inputClass:null,preset:[[Ie,{enable:!1}],[Te,{enable:!1},["rotate"]],[Be,{direction:6}],[Re,{direction:6},["swipe"]],[Le],[Le,{event:"doubletap",taps:2},["tap"]],[Ae]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};function Ve(e,t){var n;this.options=a({},$e.defaults,t||{}),this.options.inputTarget=this.options.inputTarget||e,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=e,this.input=new((n=this).options.inputClass||(T?re:A?pe:R?he:Q))(n,U),this.touchAction=new Oe(this,this.options.touchAction),ze(this,!0),d(this.options.recognizers,(function(e){var t=this.add(new e[0](e[1]));e[2]&&t.recognizeWith(e[2]),e[3]&&t.requireFailure(e[3])}),this)}function ze(e,t){var n,r=e.element;r.style&&(d(e.options.cssProps,(function(i,o){n=N(r.style,o),t?(e.oldCssProps[n]=r.style[n],r.style[n]=i):r.style[n]=e.oldCssProps[n]||""})),t||(e.oldCssProps={}))}Ve.prototype={set:function(e){return a(this.options,e),e.touchAction&&this.touchAction.update(),e.inputTarget&&(this.input.destroy(),this.input.target=e.inputTarget,this.input.init()),this},stop:function(e){this.session.stopped=e?2:1},recognize:function(e){var t=this.session;if(!t.stopped){var n;this.touchAction.preventDefaults(e);var r=this.recognizers,i=t.curRecognizer;(!i||i&&8&i.state)&&(i=t.curRecognizer=null);for(var o=0;o<r.length;)n=r[o],2===t.stopped||i&&n!=i&&!n.canRecognizeWith(i)?n.reset():n.recognize(e),!i&&14&n.state&&(i=t.curRecognizer=n),o++}},get:function(e){if(e instanceof Me)return e;for(var t=this.recognizers,n=0;n<t.length;n++)if(t[n].options.event==e)return t[n];return null},add:function(e){if(h(e,"add",this))return this;var t=this.get(e.options.event);return t&&this.remove(t),this.recognizers.push(e),e.manager=this,this.touchAction.update(),e},remove:function(e){if(h(e,"remove",this))return this;if(e=this.get(e)){var t=this.recognizers,n=S(t,e);-1!==n&&(t.splice(n,1),this.touchAction.update())}return this},on:function(e,t){if(e!==o&&t!==o){var n=this.handlers;return d(O(e),(function(e){n[e]=n[e]||[],n[e].push(t)})),this}},off:function(e,t){if(e!==o){var n=this.handlers;return d(O(e),(function(e){t?n[e]&&n[e].splice(S(n[e],t),1):delete n[e]})),this}},emit:function(e,t){this.options.domEvents&&function(e,t){var n=r.createEvent("Event");n.initEvent(e,!0,!0),n.gesture=t,t.target.dispatchEvent(n)}(e,t);var n=this.handlers[e]&&this.handlers[e].slice();if(n&&n.length){t.type=e,t.preventDefault=function(){t.srcEvent.preventDefault()};for(var i=0;i<n.length;)n[i](t),i++}},destroy:function(){this.element&&ze(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},a($e,{INPUT_START:1,INPUT_MOVE:2,INPUT_END:4,INPUT_CANCEL:8,STATE_POSSIBLE:1,STATE_BEGAN:2,STATE_CHANGED:4,STATE_ENDED:8,STATE_RECOGNIZED:8,STATE_CANCELLED:16,STATE_FAILED:Se,DIRECTION_NONE:1,DIRECTION_LEFT:2,DIRECTION_RIGHT:4,DIRECTION_UP:8,DIRECTION_DOWN:16,DIRECTION_HORIZONTAL:6,DIRECTION_VERTICAL:L,DIRECTION_ALL:30,Manager:Ve,Input:z,TouchAction:Oe,TouchInput:pe,MouseInput:Q,PointerEventInput:re,TouchMouseInput:he,SingleTouchInput:se,Recognizer:Me,AttrRecognizer:De,Tap:Le,Pan:Re,Swipe:Be,Pinch:Te,Rotate:Ie,Press:Ae,on:x,off:E,each:d,merge:y,extend:v,assign:a,inherit:g,bindFn:b,prefixed:N}),(void 0!==t?t:"undefined"!=typeof self?self:{}).Hammer=$e,e.exports?e.exports=$e:t.Hammer=$e}(window,document)}({get exports(){return Co},set exports(e){Co=e}});var Oo=Co,So=["mousedown","mouseup","mouseover","mouseout","click","dblclick"];function Mo(e,t){return t.get(e,!1)}function jo(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 No(e){function t(t){setTimeout((function(){N(So,(function(t){Zt.unbind(e,t,jo,!0)}))}),500)}Zt.bind(e,"touchstart",(function(t){N(So,(function(t){Zt.bind(e,t,jo,!0)}))}),!0),Zt.bind(e,"touchend",t,!0),Zt.bind(e,"touchcancel",t,!0);var n=new Oo.Manager(e,{inputClass:Oo.TouchInput,recognizers:[],domEvents:!0}),r=new Oo.Tap,i=new Oo.Pan({threshold:10}),o=new Oo.Press,a=new Oo.Pinch,s=new Oo.Tap({event:"doubletap",taps:2});return a.requireFailure(i),a.requireFailure(o),n.add([i,o,a,s,r]),n.reset=function(e){var t=this.recognizers,r=this.session;r.stopped||(n.stop(e),setTimeout((function(){var e,n;for(e=0;n=t[e];e++)n.reset(),n.state=8;r.curRecognizer=null}),0))},n.on("hammer.input",(function(e){e.srcEvent.defaultPrevented&&n.reset(!0)})),n}function Po(e,t,n,r,i){var o,a=Mo("dragging",e),s=Mo("move",e),l=Mo("contextPad",e),u=Mo("palette",e);function c(e,t){return function(n){var o=p(n.target),a=o&&r.get(o);return t&&(n.srcEvent.button=t),i.fire(e,n,a)}}function p(e){return qt(e,"svg, .djs-element",!0)}function f(e){function n(e){var n=p(e.target),i=n&&r.get(n);if(s&&t.getRootElement()!==i)return s.start(e,i,!0);!function(e){var n=0,r=0;function i(e){var i=e.deltaX-n,o=e.deltaY-r;t.scroll({dx:i,dy:o}),n=e.deltaX,r=e.deltaY}function a(e){o.off("panmove",i),o.off("panend",a),o.off("pancancel",a)}o.on("panmove",i),o.on("panend",a),o.on("pancancel",a)}()}(o=No(e)).on("tap",c("element.click")),o.on("doubletap",c("element.dblclick",1)),o.on("panstart",n),o.on("press",n),o.on("pinchstart",(function(e){var n=t.zoom(),r=e.center;function i(e){var i=1-(1-e.scale)/1.5,o=Math.max(.2,Math.min(4,i*n));t.zoom(o,r),jo(e)}function a(e){o.off("pinchmove",i),o.off("pinchend",a),o.off("pinchcancel",a),o.reset(!0)}o.on("pinchmove",i),o.on("pinchend",a),o.on("pinchcancel",a)}))}a&&n.on("drag.move",(function(e){var t=e.originalEvent;if(t&&!(t instanceof MouseEvent)){var n=Si(t),i=p(document.elementFromPoint(n.x,n.y)),o=i&&r.get(i);o!==e.hover&&(e.hover&&a.out(e),o&&(a.hover({element:o,gfx:i}),e.hover=o,e.hoverGfx=i))}})),l&&n.on("contextPad.create",(function(e){var t=No(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)}))})),u&&n.on("palette.create",(function(e){var t=No(e.container);t.on("panstart",(function(e){u.trigger("dragstart",e,!0)})),t.on("press",(function(e){u.trigger("dragstart",e,!0)})),t.on("tap",(function(e){u.trigger("click",e)}))})),n.on("canvas.init",(function(e){f(e.svg)}))}function Do(e){var t=this;e.on("canvas.init",(function(e){t.addBBoxMarker(e.svg)}))}Po.$inject=["injector","canvas","eventBus","elementRegistry","interactionEvents","touchFix"],Do.$inject=["eventBus"],Do.prototype.addBBoxMarker=function(e){var t={fill:"none",class:"outer-bound-marker"},n=Wn("rect");An(n,{x:-1e4,y:1e4,width:10,height:10}),An(n,t),Dn(e,n);var r=Wn("rect");An(r,{x:1e4,y:1e4,width:10,height:10}),An(r,t),Dn(e,r)};var Ro={__depends__:[{__depends__:[Ti],__init__:["touchInteractionEvents"],touchInteractionEvents:["type",Po],touchFix:["type",Do]}]};function To(e){fo.call(this,e)}bn(To,fo),To.prototype._navigationModules=[wo,ko,Ro],To.prototype._modules=[].concat(To.prototype._modules,To.prototype._navigationModules);var Ao=o((function e(t){r(this,e),$(this,t),Lo(this,"businessObject",{writable:!0})})),Io={root:function(e){s(n,e);var t=h(n);function n(e){var i;return r(this,n),Lo(p(i=t.call(this,e)),"rows",{enumerable:!0,value:i.rows||[]}),Lo(p(i),"cols",{enumerable:!0,value:i.cols||[]}),i}return o(n)}(Ao),row:function(e){s(n,e);var t=h(n);function n(e){var i;return r(this,n),Lo(p(i=t.call(this,e)),"root",{writable:!0}),Lo(p(i),"cells",{enumerable:!0,value:i.cells||[]}),i}return o(n)}(Ao),col:function(e){s(n,e);var t=h(n);function n(e){var i;return r(this,n),Lo(p(i=t.call(this,e)),"root",{writable:!0}),Lo(p(i),"cells",{enumerable:!0,value:i.cells||[]}),i}return o(n)}(Ao),cell:function(e){s(n,e);var t=h(n);function n(e){var i;return r(this,n),Lo(p(i=t.call(this,e)),"row",{writable:!0}),Lo(p(i),"col",{writable:!0}),i}return o(n)}(Ao)};function Bo(e,t){var n=Io[e];if(!n)throw new Error("unknown type "+e);return new n(t)}function Lo(e,t,n){Object.defineProperty(e,t,n)}var $o=function(){function e(){r(this,e),this._uid=12}return o(e,[{key:"create",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t.id||(t.id=e+"_"+this._uid++),Bo(e,t)}},{key:"createRoot",value:function(e){return this.create("root",e)}},{key:"createRow",value:function(e){return this.create("row",e)}},{key:"createCol",value:function(e){return this.create("col",e)}},{key:"createCell",value:function(e){return this.create("cell",e)}}]),e}(),Vo=function(){function e(t){r(this,e),this._eventBus=t,this._elements={},t.on("table.clear",this.clear.bind(this))}return o(e,[{key:"add",value:function(e,t){var n=e.id;this._elements[n]=e}},{key:"remove",value:function(e){var t=e.id||e;delete this._elements[t]}},{key:"get",value:function(e){return this._elements[e]}},{key:"getAll",value:function(){return zo(this._elements)}},{key:"forEach",value:function(e){zo(this._elements).forEach((function(t){return e(t)}))}},{key:"filter",value:function(e){return zo(this._elements).filter((function(t){return e(t)}))}},{key:"clear",value:function(){this._elements={}}},{key:"updateId",value:function(e,t){this._validateId(t),"string"==typeof e&&(e=this.get(e)),this._eventBus.fire("element.updateId",{element:e,newId:t}),this.remove(e),e.id=t,this.add(e)}},{key:"_validateId",value:function(e){if(!e)throw new Error("element must have an id");if(this._elements[e])throw new Error("element with id "+e+" already added")}}]),e}();function zo(e){return Object.keys(e).map((function(t){return e[t]}))}Vo.$inject=["eventBus"];var Uo=function(){function e(t){var n=this;r(this,e),this._listeners={},t.on("elements.changed",(function(e){var t=e.elements;n.elementsChanged(t)})),t.on("root.remove",(function(e){var r=e.root.id;n._listeners[r]&&t.once("root.add",(function(e){var t=e.root.id;n.updateId(r,t)}))})),t.on("element.updateId",(function(e){var t=e.element,r=e.newId;n.updateId(t.id,r)}))}return o(e,[{key:"elementsChanged",value:function(e){for(var t={},n=e.length,r=0;r<n;r++){var i=e[r].id;if(t[i])return;t[i]=!0;var o=this._listeners[i]&&this._listeners[i].length;if(o)for(var a=0;a<o;a++)this._listeners[i][a]&&this._listeners[i][a]()}}},{key:"onElementsChanged",value:function(e,t){this._listeners[e]||(this._listeners[e]=[]),this._listeners[e][this._listeners[e].length]=t}},{key:"offElementsChanged",value:function(e,t){if(this._listeners[e])if(t){var n=this._listeners[e].indexOf(t);-1!==n&&this._listeners[e].splice(n,1)}else this._listeners[e].length=0}},{key:"updateId",value:function(e,t){this._listeners[e]&&(this._listeners[t]=this._listeners[e],delete this._listeners[e])}}]),e}();Uo.$inject=["eventBus"];var Fo=function(){function e(){r(this,e),this._listeners={}}return o(e,[{key:"getComponent",value:function(e,t){var n=this._listeners[e];if(n){for(var r,i=0;i<n.length&&!(r=n[i].callback(t));i++);return r}}},{key:"getComponents",value:function(e,t){var n=this._listeners[e],r=[];if(!n)return r;for(var i=0;i<n.length;i++){var o=n[i].callback(t);o&&r.push(o)}return r.length,r}},{key:"onGetComponent",value:function(e,t,n){if(C(t)&&(n=t,t=1e3),!k(t))throw new Error("priority must be a number");var r,i,o=this._getListeners(e),a={priority:t,callback:n};for(i=0;r=o[i];i++)if(r.priority<t)return void o.splice(i,0,a);o.push(a)}},{key:"offGetComponent",value:function(e,t){var n,r,i=this._getListeners(e);if(t)for(r=i.length-1;n=i[r];r--)n.callback===t&&i.splice(r,1);else i.length=0}},{key:"_getListeners",value:function(e){var t=this._listeners[e];return t||(this._listeners[e]=t=[]),t}}]),e}(),Wo="$NO_OP",qo=!("undefined"==typeof window||!window.document),Go=Array.isArray;function Ho(e){var t=n(e);return"string"===t||"number"===t}function Xo(e){return ea(e)||Jo(e)}function Yo(e){return Jo(e)||!1===e||function(e){return!0===e}(e)||ea(e)}function Ko(e){return"function"==typeof e}function Zo(e){return"string"==typeof e}function Qo(e){return"number"==typeof e}function Jo(e){return null===e}function ea(e){return void 0===e}function ta(e){throw e||(e="a runtime error occured! Use Inferno in development environment to find the error."),new Error("Inferno Error: "+e)}function na(e){console.error(e)}function ra(e,t){var n={};if(e)for(var r in e)n[r]=e[r];if(t)for(var i in t)n[i]=t[i];return n}function ia(e){var t;if(Go(e))t="Array("+(e.length>3?e.slice(0,3).toString()+",...":e.toString())+")";else if(Ho(e))t="Text("+e+")";else if(Yo(e))t="InvalidVNode("+e+")";else{var n=e.flags;if(481&n)t="<"+e.type+(e.className?' class="'+e.className+'"':"")+">";else if(16&n)t="Text("+e.children+")";else if(1024&n)t="Portal*";else{var r=e.type;t="<"+(r.name||r.displayName||r.constructor.name||(r.toString().match(/^function\s*([^\s(]+)/)||[])[1])+" />"}}return">> "+t+"\n"}function oa(e,t){for(var r={},i=0,o=e.length;i<o;i++){var a=e[i];if(Go(a))return"Encountered ARRAY in mount, array must be flattened, or normalize used. Location: \n"+ia(a);if(Yo(a)){if(t)return"Encountered invalid node when preparing to keyed algorithm. Location: \n"+ia(a);if(0!==Object.keys(r).length)return"Encountered invalid node with mixed keys. Location: \n"+ia(a)}else{"object"===n(a)&&(a.isValidated=!0);var s=a.key;if(!Xo(s)&&!Ho(s))return"Encountered child vNode where key property is not string or number. Location: \n"+ia(a);var l=a.children,u=a.childFlags;if(!Yo(l)){var c=void 0;if(12&u?c=oa(l,8&a.childFlags):2===u&&(c=oa([l],8&a.childFlags)),c)return c+=ia(a)}if(t&&Xo(s))return"Encountered child without key during keyed algorithm. If this error points to Array make sure children is flat list. Location: \n"+ia(a);if(t||!Xo(s)){if(r[s])return"Encountered two children with same key: {"+s+"}. Location: \n"+ia(a);r[s]=!0}else if(0!==Object.keys(r).length)return"Encountered children with key missing. Location: \n"+ia(a)}}}function aa(e){if(!(1&e.childFlags)&&(64&e.flags&&ta("input elements can't have children."),128&e.flags&&ta("textarea elements can't have children."),481&e.flags)){var t=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],n=e.type.toLowerCase();"media"===n&&ta("media elements can't have children.");var r=t.indexOf(n);-1!==r&&ta(t[r]+" elements can't have children.")}}function sa(e){if(!1===e.isValidated&&e.children&&481&e.flags){var t=oa(Array.isArray(e.children)?e.children:[e.children],(8&e.childFlags)>0);t&&ta(t+ia(e))}e.isValidated=!0}var la="$";function ua(e,t,n,r,i,o,a,s){return{childFlags:e,children:t,className:n,dom:null,flags:r,isValidated:!1,key:void 0===i?null:i,parentVNode:null,props:void 0===o?null:o,ref:void 0===a?null:a,type:s}}function ca(e,t,n,r,i,o,a,s){14&e&&ta("Creating Component vNodes using createVNode is not allowed. Use Inferno.createComponentVNode method.");var l=void 0===i?1:i,u=ua(l,r,n,e,a,o,s,t);return 0===l&&ya(u,u.children),aa(u),u}function pa(e,t,n,r,i){1&e&&ta("Creating element vNodes using createComponentVNode is not allowed. Use Inferno.createVNode method."),(2&e)>0&&(e=t.prototype&&Ko(t.prototype.render)?4:8);var o=t.defaultProps;if(!Xo(o))for(var a in n||(n={}),o)ea(n[a])&&(n[a]=o[a]);if((8&e)>0){var s=t.defaultHooks;if(!Xo(s))if(i)for(var l in s)ea(i[l])&&(i[l]=s[l]);else i=s}var u=ua(1,null,null,e,r,n,i,t),c=ga.createVNode;return Ko(c)&&c(u),u}function fa(e,t){return ua(1,Xo(e)?"":e,null,16,t,null,null,null)}function ha(e){var t=e.props;if(t){var n=e.flags;481&n&&(void 0!==t.children&&Xo(e.children)&&ya(e,t.children),void 0!==t.className&&(e.className=t.className||null,t.className=void 0)),void 0!==t.key&&(e.key=t.key,t.key=void 0),void 0!==t.ref&&(e.ref=8&n?ra(e.ref,t.ref):t.ref,t.ref=void 0)}return e}function da(e){var t,n=e.flags;if(14&n){var r,i=e.props;if(!Jo(i))for(var o in r={},i)r[o]=i[o];t=pa(n,e.type,r,e.key,e.ref)}else 481&n?t=ca(n,e.type,e.className,e.children,e.childFlags,e.props,e.key,e.ref):16&n?t=fa(e.children,e.key):1024&n&&(t=e);return t}function ma(){return fa("",null)}function va(e,t,n,r){for(var i=e.length;n<i;n++){var o=e[n];if(!Yo(o)){var a=r+la+n;if(Go(o))va(o,t,0,a);else{if(Ho(o))o=fa(o,a);else{var s=o.key,l=Zo(s)&&s[0]===la;Jo(o.dom)&&!l||(o=da(o)),Jo(s)||l?o.key=a:o.key=r+s}t.push(o)}}}}function ya(e,t){var n,r=1;if(Yo(t))n=t;else if(Zo(t))r=2,n=fa(t);else if(Qo(t))r=2,n=fa(t+"");else if(Go(t)){var i=t.length;if(0===i)n=null,r=1;else{(Object.isFrozen(t)||!0===t.$)&&(t=t.slice()),r=8;for(var o=0;o<i;o++){var a=t[o];if(Yo(a)||Go(a)){n=n||t.slice(0,o),va(t,n,o,"");break}if(Ho(a))(n=n||t.slice(0,o)).push(fa(a,la+o));else{var s=a.key,l=Jo(a.dom),u=Jo(s),c=!u&&Zo(s)&&s[0]===la;!l||u||c?(n=n||t.slice(0,o),l&&!c||(a=da(a)),(u||c)&&(a.key=la+o),n.push(a)):n&&n.push(a)}}(n=n||t).$=!0}}else n=t,Jo(t.dom)||(n=da(t)),r=2;return e.children=n,e.childFlags=r,aa(e),e}var ga={afterRender:null,beforeRender:null,createVNode:null,renderComplete:null},ba="http://www.w3.org/1999/xlink",wa="http://www.w3.org/XML/1998/namespace",_a={"xlink:actuate":ba,"xlink:arcrole":ba,"xlink:href":ba,"xlink:role":ba,"xlink:show":ba,"xlink:title":ba,"xlink:type":ba,"xml:base":wa,"xml:lang":wa,"xml:space":wa},xa={},Ea=[];function ka(e,t){e.appendChild(t)}function Ca(e,t,n){Xo(n)?ka(e,t):e.insertBefore(t,n)}function Oa(e,t,n){e.replaceChild(t,n)}function Sa(e){for(var t;void 0!==(t=e.shift());)t()}Object.freeze(xa);var Ma={},ja={};function Na(e,t,n){var r=Ma[e],i=n.$EV;t?(r||(ja[e]=function(e){var t=function(t){var n=t.type,r="click"===n||"dblclick"===n;if(r&&0!==t.button)return t.stopPropagation(),!1;t.stopPropagation=Da;var i={dom:document};Object.defineProperty(t,"currentTarget",{configurable:!0,get:function(){return i.dom}}),function(e,t,n,r,i){var o=t;for(;!Jo(o);){if(n&&o.disabled)return;var a=o.$EV;if(a){var s=a[r];if(s&&(i.dom=o,s.event?s.event(s.data,e):s(e),e.cancelBubble))return}o=o.parentNode}}(t,t.target,r,e,i)};return document.addEventListener(Pa(e),t),t}(e),Ma[e]=0),i||(i=n.$EV={}),i[e]||Ma[e]++,i[e]=t):i&&i[e]&&(Ma[e]--,1===r&&(document.removeEventListener(Pa(e),ja[e]),ja[e]=null),i[e]=t)}function Pa(e){return e.substr(2).toLowerCase()}function Da(){this.cancelBubble=!0,this.immediatePropagationStopped||this.stopImmediatePropagation()}function Ra(e,t){var n=document.createElement("i");return n.innerHTML=t,n.innerHTML===e.innerHTML}function Ta(e,t,n){if(e[t]){var r=e[t];r.event?r.event(r.data,n):r(n)}else{var i=t.toLowerCase();e[i]&&e[i](n)}}function Aa(e,t){var n=function(n){n.stopPropagation();var r=this.$V;if(r){var i=r.props||xa,o=r.dom;if(Zo(e))Ta(i,e,n);else for(var a=0;a<e.length;a++)Ta(i,e[a],n);if(Ko(t)){var s=this.$V,l=s.props||xa;t(l,o,!1,s)}}};return Object.defineProperty(n,"wrapped",{configurable:!1,enumerable:!1,value:!0,writable:!1}),n}function Ia(e){return"checkbox"===e||"radio"===e}var Ba=Aa("onInput",Va),La=Aa(["onClick","onChange"],Va);function $a(e){e.stopPropagation()}function Va(e,t){var n=e.type,r=e.value,i=e.checked,o=e.multiple,a=e.defaultValue,s=!Xo(r);n&&n!==t.type&&t.setAttribute("type",n),Xo(o)||o===t.multiple||(t.multiple=o),Xo(a)||s||(t.defaultValue=a+""),Ia(n)?(s&&(t.value=r),Xo(i)||(t.checked=i)):s&&t.value!==r?(t.defaultValue=r,t.value=r):Xo(i)||(t.checked=i)}function za(e,t){if("optgroup"===e.type){var n=e.children,r=e.childFlags;if(12&r)for(var i=0,o=n.length;i<o;i++)Ua(n[i],t);else 2===r&&Ua(n,t)}else Ua(e,t)}function Ua(e,t){var n=e.props||xa,r=e.dom;r.value=n.value,Go(t)&&-1!==t.indexOf(n.value)||n.value===t?r.selected=!0:Xo(t)&&Xo(n.selected)||(r.selected=n.selected||!1)}$a.wrapped=!0;var Fa=Aa("onChange",Wa);function Wa(e,t,n,r){var i=Boolean(e.multiple);Xo(e.multiple)||i===t.multiple||(t.multiple=i);var o=r.childFlags;if(0==(1&o)){var a=r.children,s=e.value;if(n&&Xo(s)&&(s=e.defaultValue),12&o)for(var l=0,u=a.length;l<u;l++)za(a[l],s);else 2===o&&za(a,s)}}var qa=Aa("onInput",Ha),Ga=Aa("onChange");function Ha(e,t,n){var r=e.value,i=t.value;if(Xo(r)){if(n){var o=e.defaultValue;Xo(o)||o===i||(t.defaultValue=o,t.value=o)}}else i!==r&&(t.defaultValue=r,t.value=r)}function Xa(e,t,n,r,i,o){64&e?Va(r,n):256&e?Wa(r,n,i,t):128&e&&Ha(r,n,i),o&&(n.$V=t)}function Ya(e,t,n){64&e?function(e,t){Ia(t.type)?(e.onchange=La,e.onclick=$a):e.oninput=Ba}(t,n):256&e?function(e){e.onchange=Fa}(t):128&e&&function(e,t){e.oninput=qa,t.onChange&&(e.onchange=Ga)}(t,n)}function Ka(e){return e.type&&Ia(e.type)?!Xo(e.checked):!Xo(e.value)}function Za(e,t){Qa(e),t&&e.dom&&(!function(e,t){e.removeChild(t)}(t,e.dom),e.dom=null)}function Qa(e){var t=e.flags;if(481&t){var n=e.ref,r=e.props;Ko(n)&&n(null);var i=e.children,o=e.childFlags;if(12&o?Ja(i):2===o&&Qa(i),!Jo(r))for(var a in r)switch(a){case"onClick":case"onDblClick":case"onFocusIn":case"onFocusOut":case"onKeyDown":case"onKeyPress":case"onKeyUp":case"onMouseDown":case"onMouseMove":case"onMouseUp":case"onSubmit":case"onTouchEnd":case"onTouchMove":case"onTouchStart":Na(a,null,e.dom)}}else{var s=e.children;if(s)if(14&t){var l=e.ref;4&t?(Ko(s.componentWillUnmount)&&s.componentWillUnmount(),Ko(l)&&l(null),s.$UN=!0,s.$LI&&Qa(s.$LI)):(!Xo(l)&&Ko(l.onComponentWillUnmount)&&l.onComponentWillUnmount(e.dom,e.props||xa),Qa(s))}else 1024&t&&Za(s,e.type)}}function Ja(e){for(var t=0,n=e.length;t<n;t++)Qa(e[t])}function es(e,t){Ja(t),e.textContent=""}function ts(e,t){switch(e){case"animationIterationCount":case"borderImageOutset":case"borderImageSlice":case"borderImageWidth":case"boxFlex":case"boxFlexGroup":case"boxOrdinalGroup":case"columnCount":case"fillOpacity":case"flex":case"flexGrow":case"flexNegative":case"flexOrder":case"flexPositive":case"flexShrink":case"floodOpacity":case"fontWeight":case"gridColumn":case"gridRow":case"lineClamp":case"lineHeight":case"opacity":case"order":case"orphans":case"stopOpacity":case"strokeDasharray":case"strokeDashoffset":case"strokeMiterlimit":case"strokeOpacity":case"strokeWidth":case"tabSize":case"widows":case"zIndex":case"zoom":return t;default:return t+"px"}}function ns(e,t,n,r,i,o,a){switch(e){case"onClick":case"onDblClick":case"onFocusIn":case"onFocusOut":case"onKeyDown":case"onKeyPress":case"onKeyUp":case"onMouseDown":case"onMouseMove":case"onMouseUp":case"onSubmit":case"onTouchEnd":case"onTouchMove":case"onTouchStart":Na(e,n,r);break;case"children":case"childrenType":case"className":case"defaultValue":case"key":case"multiple":case"ref":break;case"autoFocus":r.autofocus=!!n;break;case"allowfullscreen":case"autoplay":case"capture":case"checked":case"controls":case"default":case"disabled":case"hidden":case"indeterminate":case"loop":case"muted":case"novalidate":case"open":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"selected":r[e]=!!n;break;case"defaultChecked":case"value":case"volume":if(o&&"value"===e)return;var s=Xo(n)?"":n;r[e]!==s&&(r[e]=s);break;case"dangerouslySetInnerHTML":var l=t&&t.__html||"",u=n&&n.__html||"";l!==u&&(Xo(u)||Ra(r,u)||(Jo(a)||(12&a.childFlags?Ja(a.children):2===a.childFlags&&Qa(a.children),a.children=null,a.childFlags=1),r.innerHTML=u));break;default:"o"===e[0]&&"n"===e[1]?function(e,t,n){var r=e.toLowerCase();if(Ko(t)||Xo(t)){var i=n[r];i&&i.wrapped||(n[r]=t)}else{var o=t.event;o&&Ko(o)?n[r]=function(e,t){return function(n){e(t.data,n)}}(o,t):ta('an event on a VNode "'+e+'". was not a function or a valid linkEvent.')}}(e,n,r):Xo(n)?r.removeAttribute(e):"style"===e?function(e,t,n){var r,i,o=n.style;if(Zo(t))o.cssText=t;else if(Xo(e)||Zo(e))for(r in t)i=t[r],o[r]=Qo(i)?ts(r,i):i;else{for(r in t)(i=t[r])!==e[r]&&(o[r]=Qo(i)?ts(r,i):i);for(r in e)Xo(t[r])&&(o[r]="")}}(t,n,r):i&&_a[e]?r.setAttributeNS(_a[e],e,n):r.setAttribute(e,n)}}function rs(e,t,n,r,i){var o=!1,a=(448&t)>0;for(var s in a&&(o=Ka(n))&&Ya(t,r,n),n)ns(s,null,n[s],r,i,o,null);a&&Xa(t,e,r,n,!0,o)}function is(e,t,n,r){var i=new t(n,r);if(e.children=i,i.$V=e,i.$BS=!1,i.context=r,i.props===xa&&(i.props=n),i.$UN=!1,Ko(i.componentWillMount)){if(i.$BR=!0,i.componentWillMount(),i.$PSS){var o=i.state,a=i.$PS;if(Jo(o))i.state=a;else for(var s in a)o[s]=a[s];i.$PSS=!1,i.$PS=null}i.$BR=!1}Ko(ga.beforeRender)&&ga.beforeRender(i);var l,u=os(i.render(n,i.state,r),e);return Ko(i.getChildContext)&&(l=i.getChildContext()),Xo(l)?i.$CX=r:i.$CX=ra(r,l),Ko(ga.afterRender)&&ga.afterRender(i),i.$LI=u,i}function os(e,t){return Go(e)&&ta("a valid Inferno VNode (or null) must be returned from a component render. You may have returned an array or an invalid object."),Yo(e)?e=ma():Ho(e)?e=fa(e,null):(e.dom&&(e=da(e)),14&e.flags&&(e.parentVNode=t)),e}function as(e,t,r,i){var o=e.flags;return 481&o?ls(e,t,r,i):14&o?function(e,t,n,r,i){var o,a=e.type,s=e.props||xa,l=e.ref;if(i){var u=is(e,a,s,n);e.dom=o=as(u.$LI,null,u.$CX,r),cs(e,l,u),u.$UPD=!1}else{var c=os(a(s,n),e);e.children=c,e.dom=o=as(c,null,n,r),ps(s,l,o)}Jo(t)||ka(t,o);return o}(e,t,r,i,(4&o)>0):512&o||16&o?ss(e,t):1024&o?(as(e.children,e.type,r,!1),e.dom=ss(ma(),t)):void("object"===n(e)?ta("mount() received an object that's not a valid VNode, you should stringify it first, fix createVNode flags or call normalizeChildren. Object: \""+JSON.stringify(e)+'".'):ta('mount() expects a valid VNode, instead it received an object with the type "'+n(e)+'".'))}function ss(e,t){var n=e.dom=document.createTextNode(e.children);return Jo(t)||ka(t,n),n}function ls(e,t,n,r){var i=e.flags,o=e.children,a=e.props,s=e.className,l=e.ref,u=e.childFlags;r=r||(32&i)>0;var c=function(e,t){return t?document.createElementNS("http://www.w3.org/2000/svg",e):document.createElement(e)}(e.type,r);if(e.dom=c,Xo(s)||""===s||(r?c.setAttribute("class",s):c.className=s),sa(e),Jo(t)||ka(t,c),0==(1&u)){var p=!0===r&&"foreignObject"!==e.type;2===u?as(o,c,n,p):12&u&&us(o,c,n,p)}return Jo(a)||rs(e,i,a,c,r),Zo(l)&&ta('string "refs" are not supported in Inferno 1.0. Use callback "refs" instead.'),Ko(l)&&fs(c,l),c}function us(e,t,n,r){for(var i=0,o=e.length;i<o;i++){var a=e[i];Jo(a.dom)||(e[i]=a=da(a)),as(a,t,n,r)}}function cs(e,t,r){Ko(t)?t(r):Ho(t)?ta('string "refs" are not supported in Inferno 1.0. Use callback "refs" instead.'):!Xo(t)&&"object"===n(t)&&4&e.flags&&ta("functional component lifecycle events are not supported on ES2015 class components."),Ko(r.componentDidMount)&&Ea.push(function(e){return function(){e.$UPD=!0,e.componentDidMount(),e.$UPD=!1}}(r))}function ps(e,t,n){Xo(t)||(Ko(t.onComponentWillMount)&&t.onComponentWillMount(e),Ko(t.onComponentDidMount)&&Ea.push(function(e,t,n){return function(){return e.onComponentDidMount(t,n)}}(t,n,e)))}function fs(e,t){Ea.push((function(){return t(e)}))}function hs(e,t,n,r){var i=e.children,o=e.props,a=e.className,s=e.flags,l=e.ref;if(r=r||(32&s)>0,1!==t.nodeType||t.tagName.toLowerCase()!==e.type){na("Inferno hydration: Server-side markup doesn't match client-side markup or Initial render target is not empty");var u=ls(e,null,n,r);e.dom=u,Oa(t.parentNode,u,t)}else{e.dom=t;var c=t.firstChild,p=e.childFlags;if(0==(1&p)){for(var f=null;c;)f=c.nextSibling,8===c.nodeType&&("!"===c.data?t.replaceChild(document.createTextNode(""),c):t.removeChild(c)),c=f;if(c=t.firstChild,2===p)Jo(c)?as(i,t,n,r):(f=c.nextSibling,ds(i,c,n,r),c=f);else if(12&p)for(var h=0,d=i.length;h<d;h++){var m=i[h];Jo(c)?as(m,t,n,r):(f=c.nextSibling,ds(m,c,n,r),c=f)}for(;c;)f=c.nextSibling,t.removeChild(c),c=f}else Jo(t.firstChild)||function(e,t){return Boolean(t&&t.dangerouslySetInnerHTML&&t.dangerouslySetInnerHTML.__html&&Ra(e,t.dangerouslySetInnerHTML.__html))}(t,o)||(t.textContent="",448&s&&(t.defaultValue=""));Jo(o)||rs(e,s,o,t,r),Xo(a)?""!==t.className&&t.removeAttribute("class"):r?t.setAttribute("class",a):t.className=a,Ko(l)?fs(t,l):Zo(l)&&ta('string "refs" are not supported in Inferno 1.0. Use callback "refs" instead.')}}function ds(e,t,r,i){var o=e.flags;14&o?function(e,t,n,r,i){var o=e.type,a=e.ref,s=e.props||xa;if(i){var l=is(e,o,s,n),u=l.$LI;ds(u,t,l.$CX,r),e.dom=u.dom,cs(e,a,l),l.$UPD=!1}else{var c=os(o(s,n),e);ds(c,t,n,r),e.children=c,e.dom=c.dom,ps(s,a,t)}}(e,t,r,i,(4&o)>0):481&o?hs(e,t,r,i):16&o?function(e,t){if(3!==t.nodeType){var n=ss(e,null);e.dom=n,Oa(t.parentNode,n,t)}else{var r=e.children;t.nodeValue!==r&&(t.nodeValue=r),e.dom=t}}(e,t):512&o?e.dom=t:(ta('hydrate() expects a valid VNode, instead it received an object with the type "'+n(e)+'".'),ta())}function ms(e,t,n,r,i){Qa(e),Oa(n,as(t,null,r,i),e.dom)}function vs(e,t,n,r,i){var o=0|t.flags;e.flags!==o||2048&o?ms(e,t,n,r,i):481&o?function(e,t,n,r,i,o){var a=t.type;if(e.type!==a)ms(e,t,n,r,i);else{var s,l=e.dom,u=e.props,c=t.props,p=!1,f=!1;if(t.dom=l,i=i||(32&o)>0,u!==c){var h=u||xa;if((s=c||xa)!==xa)for(var d in(p=(448&o)>0)&&(f=Ka(s)),s){var m=h[d],v=s[d];m!==v&&ns(d,m,v,l,i,f,e)}if(h!==xa)for(var y in h)s.hasOwnProperty(y)||Xo(h[y])||ns(y,h[y],null,l,i,f,e)}var g=e.children,b=t.children,w=t.ref,_=e.className,x=t.className;sa(t),4096&o?function(e,t){e.textContent!==t.children&&(e.textContent=t.children)}(l,b):ys(e.childFlags,t.childFlags,g,b,l,r,i&&"foreignObject"!==a),p&&Xa(o,t,l,s,!1,f),_!==x&&(Xo(x)?l.removeAttribute("class"):i?l.setAttribute("class",x):l.className=x),Ko(w)&&e.ref!==w?fs(l,w):Zo(w)&&ta('string "refs" are not supported in Inferno 1.0. Use callback "refs" instead.')}}(e,t,n,r,i,o):14&o?function(e,t,n,r,i,o){var a=t.type,s=e.key,l=t.key;if(e.type!==a||s!==l)ms(e,t,n,r,i);else{var u=t.props||xa;if(o){var c=e.children;c.$UPD=!0,c.$V=t,gs(c,c.state,t,u,n,r,i,!1,!1),c.$UPD=!1}else{var p=!0,f=e.props,h=t.ref,d=!Xo(h),m=e.children;if(t.dom=e.dom,t.children=m,d&&Ko(h.onComponentShouldUpdate)&&(p=h.onComponentShouldUpdate(f,u)),!1!==p){d&&Ko(h.onComponentWillUpdate)&&h.onComponentWillUpdate(f,u);var v=a(u,r);v!==Wo&&(vs(m,v=os(v,t),n,r,i),t.children=v,t.dom=v.dom,d&&Ko(h.onComponentDidUpdate)&&h.onComponentDidUpdate(f,u))}else 14&m.flags&&(m.parentVNode=t)}}}(e,t,n,r,i,(4&o)>0):16&o?function(e,t){var n=t.children,r=e.dom;n!==e.children&&(r.nodeValue=n);t.dom=r}(e,t):512&o?t.dom=e.dom:function(e,t,n){var r=e.type,i=t.type,o=t.children;if(ys(e.childFlags,t.childFlags,e.children,o,r,n,!1),t.dom=e.dom,r!==i&&!Yo(o)){var a=o.dom;r.removeChild(a),i.appendChild(a)}}(e,t,r)}function ys(e,t,n,r,i,o,a){switch(e){case 2:switch(t){case 2:vs(n,r,i,o,a);break;case 1:Za(n,i);break;default:Za(n,i),us(r,i,o,a)}break;case 1:switch(t){case 2:as(r,i,o,a);break;case 1:break;default:us(r,i,o,a)}break;default:if(12&t){var s=n.length,l=r.length;0===s?l>0&&us(r,i,o,a):0===l?es(i,n):8===t&&8===e?function(e,t,n,r,i,o,a){var s,l,u=o-1,c=a-1,p=0,f=e[p],h=t[p];e:{for(;f.key===h.key;){if(h.dom&&(t[p]=h=da(h)),vs(f,h,n,r,i),e[p]=h,++p>u||p>c)break e;f=e[p],h=t[p]}for(f=e[u],h=t[c];f.key===h.key;){if(h.dom&&(t[c]=h=da(h)),vs(f,h,n,r,i),e[u]=h,c--,p>--u||p>c)break e;f=e[u],h=t[c]}}if(p>u){if(p<=c)for(var d=(l=c+1)<a?t[l].dom:null;p<=c;)(h=t[p]).dom&&(t[p]=h=da(h)),p++,Ca(n,as(h,null,r,i),d)}else if(p>c)for(;p<=u;)Za(e[p++],n);else{var m=p,v=p,y=u-p+1,g=c-p+1,b=[];for(s=0;s<g;s++)b.push(0);var w=y===o,_=!1,x=0,E=0;if(a<4||(y|g)<32)for(s=m;s<=u;s++)if(f=e[s],E<g){for(p=v;p<=c;p++)if(h=t[p],f.key===h.key){if(b[p-v]=s+1,w)for(w=!1;s>m;)Za(e[m++],n);x>p?_=!0:x=p,h.dom&&(t[p]=h=da(h)),vs(f,h,n,r,i),E++;break}!w&&p>c&&Za(f,n)}else w||Za(f,n);else{var k={};for(s=v;s<=c;s++)k[t[s].key]=s;for(s=m;s<=u;s++)if(f=e[s],E<g)if(void 0!==(p=k[f.key])){if(w)for(w=!1;s>m;)Za(e[m++],n);h=t[p],b[p-v]=s+1,x>p?_=!0:x=p,h.dom&&(t[p]=h=da(h)),vs(f,h,n,r,i),E++}else w||Za(f,n);else w||Za(f,n)}if(w)es(n,e),us(t,n,r,i);else if(_){var C=function(e){var t,n,r,i,o,a=e.slice(),s=[0],l=e.length;for(t=0;t<l;t++){var u=e[t];if(0!==u){if(e[n=s[s.length-1]]<u){a[t]=n,s.push(t);continue}for(r=0,i=s.length-1;r<i;)e[s[o=(r+i)/2|0]]<u?r=o+1:i=o;u<e[s[r]]&&(r>0&&(a[t]=s[r-1]),s[r]=t)}}r=s.length,i=s[r-1];for(;r-- >0;)s[r]=i,i=a[i];return s}(b);for(p=C.length-1,s=g-1;s>=0;s--)0===b[s]?((h=t[x=s+v]).dom&&(t[x]=h=da(h)),l=x+1,Ca(n,as(h,null,r,i),l<a?t[l].dom:null)):p<0||s!==C[p]?(l=(x=s+v)+1,Ca(n,(h=t[x]).dom,l<a?t[l].dom:null)):p--}else if(E!==g)for(s=g-1;s>=0;s--)0===b[s]&&((h=t[x=s+v]).dom&&(t[x]=h=da(h)),l=x+1,Ca(n,as(h,null,r,i),l<a?t[l].dom:null))}}(n,r,i,o,a,s,l):function(e,t,n,r,i,o,a){for(var s,l,u=o>a?a:o,c=0;c<u;c++)s=t[c],l=e[c],s.dom&&(s=t[c]=da(s)),vs(l,s,n,r,i),e[c]=s;if(o<a)for(c=u;c<a;c++)(s=t[c]).dom&&(s=t[c]=da(s)),as(s,n,r,i);else if(o>a)for(c=u;c<o;c++)Za(e[c],n)}(n,r,i,o,a,s,l)}else 1===t?es(i,n):2===t&&(es(i,n),as(r,i,o,a))}}function gs(e,t,n,r,i,o,a,s,l){var u,c=e.state,p=e.props;if(n.children=e,e.$UN)na("Inferno Error: Can only update a mounted or mounting component. This usually means you called setState() or forceUpdate() on an unmounted component. This is a no-op.");else{if(p!==r||r===xa){if(!l&&Ko(e.componentWillReceiveProps)){if(e.$BR=!0,e.componentWillReceiveProps(r,o),e.$UN)return;e.$BR=!1}e.$PSS&&(t=ra(t,e.$PS),e.$PSS=!1,e.$PS=null)}var f=Boolean(e.shouldComponentUpdate);if(s||!f||f&&e.shouldComponentUpdate(r,t,o)){Ko(e.componentWillUpdate)&&(e.$BS=!0,e.componentWillUpdate(r,t,o),e.$BS=!1),e.props=r,e.state=t,e.context=o,Ko(ga.beforeRender)&&ga.beforeRender(e),u=e.render(r,t,o),Ko(ga.afterRender)&&ga.afterRender(e);var h,d=u!==Wo;if(Ko(e.getChildContext)&&(h=e.getChildContext()),h=Xo(h)?o:ra(o,h),e.$CX=h,d){var m=e.$LI,v=os(u,n);vs(m,v,i,h,a),e.$LI=v,Ko(e.componentDidUpdate)&&e.componentDidUpdate(p,c)}}else e.props=r,e.state=t,e.context=o;n.dom=e.$LI.dom}}qo&&null===document.body&&na('Inferno warning: you cannot initialize inferno without "document.body". Wait on "DOMContentLoaded" event, add script to bottom of body, or use async/defer attributes on script tag.');var bs=qo?document.body:null;function ws(e,t,n){if(bs===t&&ta('you cannot render() to the "document.body". Use an empty element as a container instead.'),e!==Wo){var r=t.$V;return Xo(r)?Yo(e)||(e.dom&&(e=da(e)),Jo(t.firstChild)?(as(e,t,xa,!1),t.$V=e):function(e,t,n){var r=t.firstChild;if(!Jo(r))for(Yo(e)||ds(e,r,xa,!1),r=t.firstChild;r=r.nextSibling;)t.removeChild(r);Ea.length>0&&Sa(Ea),t.$V=e,Ko(n)&&n()}(e,t),r=e):Xo(e)?(Za(r,t),t.$V=null):(e.dom&&(e=da(e)),vs(r,e,t,xa,!1),r=t.$V=e),Ea.length>0&&Sa(Ea),Ko(n)&&n(),Ko(ga.renderComplete)&&ga.renderComplete(r),r&&14&r.flags?r.children:void 0}}var _s="undefined"==typeof Promise?null:Promise.resolve(),xs="undefined"==typeof requestAnimationFrame?setTimeout:requestAnimationFrame.bind(window);function Es(e,t,n,r){Ko(t)&&(t=t(e.state,e.props,e.context));var i,o=e.$PS;if(Xo(o))e.$PS=t;else for(var a in t)o[a]=t[a];if(e.$PSS||e.$BR)e.$PSS=!0,e.$BR&&Ko(n)&&Ea.push(n.bind(e));else if(e.$UPD){var s=e.$QU;Jo(s)&&(s=e.$QU=[],i=function(e,t){return function(){e.$QU=null,e.$UPD=!0,ks(e,!1,(function(){for(var n=0,r=t.length;n<r;n++)t[n].call(e)})),e.$UPD=!1}}(e,s),_s?_s.then(i):xs(i)),Ko(n)&&s.push(n)}else e.$PSS=!0,e.$UPD=!0,ks(e,r,n),e.$UPD=!1}function ks(e,t,n){if(!e.$UN){if(t||!e.$BR){e.$PSS=!1;var r=e.$PS,i=ra(e.state,r),o=e.props,a=e.context;e.$PS=null;var s=e.$V,l=e.$LI;if(gs(e,i,s,o,l.dom&&l.dom.parentNode,a,(32&s.flags)>0,t,!0),e.$UN)return;if(0==(1024&e.$LI.flags))for(var u=e.$LI.dom;!Jo(s=s.parentVNode);)(14&s.flags)>0&&(s.dom=u);Ea.length>0&&Sa(Ea)}else e.state=e.$PS,e.$PS=null;Ko(n)&&n.call(e)}}var Cs=function(e,t){this.state=null,this.$BR=!1,this.$BS=!0,this.$PSS=!1,this.$PS=null,this.$LI=null,this.$V=null,this.$UN=!1,this.$CX=null,this.$UPD=!0,this.$QU=null,this.props=e||xa,this.context=t||xa};Cs.prototype.forceUpdate=function(e){this.$UN||Es(this,{},e,!0)},Cs.prototype.setState=function(e,t){this.$UN||(this.$BS?ta("cannot update state via setState() in componentWillUpdate() or constructor."):Es(this,e,t,!1))},Cs.prototype.render=function(e,t,n){};var Os=function(){};console.info("Inferno is in development mode."),-1===(Os.name||Os.toString()).indexOf("testFn")&&na("It looks like you're using a minified copy of the development build of Inferno. When deploying Inferno apps to production, make sure to use the production build which skips development warnings and is faster. See http://infernojs.org for more details.");var Ss=function(e){s(n,e);var t=h(n);function n(e){var i;r(this,n);var o=(i=t.call(this,e))._injector=e.injector;i._sheet=o.get("sheet"),i._changeSupport=o.get("changeSupport"),i._components=o.get("components"),i._eventBus=o.get("eventBus");var a=o.get("throttle");return i.onElementsChanged=i.onElementsChanged.bind(p(i)),i.onScroll=a(i.onScroll.bind(p(i))),i}return o(n,[{key:"onElementsChanged",value:function(){this.forceUpdate()}},{key:"onScroll",value:function(){this._eventBus.fire("sheet.scroll")}},{key:"getChildContext",value:function(){return{changeSupport:this._changeSupport,components:this._components,injector:this._injector}}},{key:"componentWillMount",value:function(){var e=this._sheet.getRoot().id;this._changeSupport.onElementsChanged(e,this.onElementsChanged)}},{key:"componentWillUnmount",value:function(){var e=this._sheet.getRoot().id;this._changeSupport.offElementsChanged(e,this.onElementsChanged)}},{key:"render",value:function(){var e=this._sheet.getRoot(),t=e.rows,n=e.cols,r=this._components.getComponents("table.before"),i=this._components.getComponents("table.after"),o=this._components.getComponent("table.head"),a=this._components.getComponent("table.body"),s=this._components.getComponent("table.foot");return ca(1,"div","tjs-container",[r&&r.map((function(e,t){return pa(2,e,null,t)})),ca(1,"div","tjs-table-container",ca(1,"table","tjs-table",[o&&pa(2,o,{rows:t,cols:n}),a&&pa(2,a,{rows:t,cols:n}),s&&pa(2,s,{rows:t,cols:n})],0),2,{onScroll:this.onScroll}),i&&i.map((function(e,t){return pa(2,e,null,t)}))],0)}}]),n}(Cs),Ms=function(){function e(t,n,i,o,a){r(this,e);var s=i.container;this._container=s,o.on("root.added",(function(){ws(pa(2,Ss,{injector:a}),s)})),o.on("root.remove",(function(){ws(null,s)}))}return o(e,[{key:"getContainer",value:function(){return this._container}}]),e}();Ms.$inject=["changeSupport","components","config.renderer","eventBus","injector"];var js={__init__:["changeSupport","components","renderer"],changeSupport:["type",Uo],components:["type",Fo],renderer:["type",Ms]},Ns=function(){function e(t,n){var i=this;r(this,e),this._elementRegistry=t,this._eventBus=n,this._root=null,n.on("table.clear",(function(){i.setRoot(null)}))}return o(e,[{key:"setRoot",value:function(e){if(this._root){var t=this._root;this._eventBus.fire("root.remove",{root:t}),this._root=null,this._eventBus.fire("root.removed",{root:t})}e&&this._eventBus.fire("root.add",{root:e}),this._root=e,e&&this._eventBus.fire("root.added",{root:e})}},{key:"getRoot",value:function(){return this._root||this.setRoot({id:"__implicitroot",rows:[],cols:[]}),this._root}},{key:"addRow",value:function(e,t){var n=this,r=this.getRoot();if(r.cols.length!=e.cells.length)throw new Error("number of cells is not equal to number of cols");return void 0===t&&(t=r.rows.length),Ps(t,r.rows,e),e.root=r,this._elementRegistry.add(e),e.cells.forEach((function(i,o){n._elementRegistry.add(i),i.row=e,i.col=r.cols[o],Ps(t,r.cols[o].cells,i)})),this._eventBus.fire("row.add",{row:e}),e}},{key:"removeRow",value:function(e){var t=this,n=this.getRoot();"string"==typeof e&&(e=this._elementRegistry.get(e));var r=n.rows.indexOf(e);-1!==r&&(Ds(r,n.rows),e.root=void 0,this._elementRegistry.remove(e),e.cells.forEach((function(e,i){t._elementRegistry.remove(e),e.col=void 0,Ds(r,n.cols[i].cells)})),this._eventBus.fire("row.remove",{row:e}))}},{key:"addCol",value:function(e,t){var n=this,r=this.getRoot();if(this._elementRegistry.add(e),r.rows.length!=e.cells.length)throw new Error("number of cells is not equal to number of rows");return void 0===t&&(t=r.cols.length),Ps(t,r.cols,e),e.root=r,e.cells.forEach((function(i,o){n._elementRegistry.add(i),i.col=e,i.row=r.rows[o],Ps(t,r.rows[o].cells,i)})),this._eventBus.fire("col.add",{col:e}),e}},{key:"removeCol",value:function(e){var t=this,n=this.getRoot();"string"==typeof e&&(e=this._elementRegistry.get(e));var r=n.cols.indexOf(e);-1!==r&&(Ds(r,n.cols),e.root=void 0,this._elementRegistry.remove(e),e.cells.forEach((function(e,i){t._elementRegistry.remove(e),e.row=void 0,Ds(r,n.rows[i].cells)})),this._eventBus.fire("col.remove",{col:e}))}},{key:"resized",value:function(){this._eventBus.fire("sheet.resized")}}]),e}();function Ps(e,t,n){return t.splice(e,0,n)}function Ds(e,t){return t.splice(e,1)}function Rs(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t="number"==typeof e?e:e?300:0;return t?function(e){return B(e,t)}:function(e){return e}}Ns.$inject=["elementRegistry","eventBus"],Rs.$inject=["config.throttle"];var Ts={__depends__:[js],__init__:["elementFactory","sheet"],elementFactory:["type",$o],elementRegistry:["type",Vo],eventBus:["type",U],sheet:["type",Ns],throttle:["factory",Rs]},As=["modules"],Is=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};r(this,e);var n=t.injector;if(!n){var i=this._init(t),o=i.modules,a=i.config;n=Bs(a,o)}this.get=n.get,this.invoke=n.invoke,this.get("eventBus").fire("table.init"),this.get("eventBus").fire("diagram.init")}return o(e,[{key:"_init",value:function(e){return{modules:e.modules,config:c(e,As)}}},{key:"destroy",value:function(){var e=this.get("eventBus");e.fire("table.destroy"),e.fire("diagram.destroy")}},{key:"clear",value:function(){var e=this.get("eventBus");e.fire("table.clear"),e.fire("diagram.clear")}}]),e}();function Bs(e,t){var n=new Mn([{config:["value",e]},Ts].concat(t||[]));return n.init(),n}function Ls(e){if(!e)return"<null>";var t=e.id?' id="'.concat(e.id,'"'):"";return"<".concat(e.$type).concat(t," />")}function $s(e,t){function n(t,n,r){if(t.gfx)throw new Error("already rendered ".concat(Ls(t)));return e.element(t,n,r)}function r(e,t,r){N(e,(function(e){n(e,t,r)}))}function i(e,t,r){N(e,(function(e){n(e,t,r)}))}return{handleDecision:function(t){t.id||(t.id="decision");var o=t.decisionLogic;if(!o)throw new Error("no table for ".concat(Ls(t)));if(!o.output)throw new Error("missing output for ".concat(Ls(o)));var a,s,l,u,c=(u=o,e.table(u));o.input&&r(o.input,c,o),r(o.output,c,o),a=o.rule,s=c,l=o,N(a,(function(e){n(e,s,l),i(e.inputEntry,e),i(e.outputEntry,e)}))}}}function Vs(e,n){var r=e.elements,i=e.index;return i[n]?e:{elements:[].concat(v(r),[n]),index:t(t({},i),{},a({},n,!0))}}function zs(e,t){return e.elements.join(t)}function Us(){for(var e={elements:[],index:{}},t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];return r.forEach((function(t){var r=n(t);"string"===r&&t.length>0?e=Vs(e,t):"object"===r&&null!==t&&Object.keys(t).forEach((function(n){t[n]&&(e=Vs(e,n))}))})),zs(e," ")}function Fs(e){return Ws(e.constructor,e)}function Ws(e,t){var n=e.$inject;if(n){var r=t.context.injector,i=[].concat(v(n),[function(){for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];for(var o in r){var a=n[o],s=r[o];t[a]=s}}]);r.invoke(i)}}function qs(e,t){Object.keys(t).forEach((function(n){if("$inject"!==n&&"__init"!==n){var r=t[n];"constructor"===n&&r.call(e,e.props,e.context);var i=e[n];if(void 0!==i){if("function"!=typeof i)throw new Error("failed to mixin <".concat(n,">: cannot combine with non-fn component value"));e[n]=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return function(){for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];var o;return n.forEach((function(t){if(void 0!==(o=t.call.apply(t,[e].concat(r))))return!1})),o}.bind(e)}(e,i,r)}else e[n]=r.bind(e)}})),"$inject"in t&&Ws(t,e),"__init"in t&&t.__init.call(e,e.props,e.context)}var Gs={getSelectionClasses:function(){var e=this.state;return Us({selected:e.selected,"selected-secondary":e.selectedSecondary,focussed:e.focussed})},selectionChanged:function(e){this.setState(e)},componentWillUpdate:function(e){e.elementId!==this.props.elementId&&this.updateSelectionSubscription(!1)},componentDidUpdate:function(e){e.elementId!==this.props.elementId&&this.updateSelectionSubscription(!0)},componentDidMount:function(){this.updateSelectionSubscription(!0)},componentWillUnmount:function(){this.updateSelectionSubscription(!1)},updateSelectionSubscription:function(e){var t=this.props.elementId;t&&t&&this.eventBus[e?"on":"off"]("selection.".concat(t,".changed"),this.selectionChanged)}},Hs=Gs;Gs.$inject=["eventBus"];var Xs=["className","elementId","coords"],Ys=function(e){s(i,e);var n=h(i);function i(e,t){var o;return r(this,i),qs(p(o=n.call(this,e,t)),Hs),Fs(p(o)),o}return o(i,[{key:"getRenderProps",value:function(){for(var e=this.props,n=e.className,r=e.elementId,i=e.coords,o=c(e,Xs),a=arguments.length,s=new Array(a),l=0;l<a;l++)s[l]=arguments[l];var u={className:Us.apply(void 0,s.concat([this.getSelectionClasses(),n]))};return r&&(u["data-element-id"]=r),i&&(u["data-coords"]=i),t(t({},u),o)}}]),i}(Cs),Ks=function(e){s(i,e);var n=h(i);function i(e,t){var o;return r(this,i),(o=n.call(this,e,t)).state={},o}return o(i,[{key:"render",value:function(){return ha(ca(1,"td",null,this.props.children,0,t({},this.getRenderProps("cell"))))}}]),i}(Ys),Zs=["type","context"],Qs=["type","context"];function Js(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function el(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Js(Object(n),!0).forEach((function(t){tl(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Js(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function tl(e,t,r){return(t=function(e){var t=function(e,t){if("object"!==n(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!==n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===n(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function nl(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var rl={slotFill:function(e,t){var n=e.type,r=e.context,i=nl(e,Zs),o=this.components.getComponent(n,r)||t;return o?ha(pa(2,o,el(el({},r),i))):null},slotFills:function(e){var t=e.type,n=e.context,r=nl(e,Qs);return this.components.getComponents(t,n).map((function(e){return ha(pa(2,e,el(el({},n),r)))}))}};function il(e,t,r){return(t=function(e){var t=function(e,t){if("object"!==n(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!==n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===n(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}rl.$inject=["components"];var ol=function(e){s(n,e);var t=h(n);function n(e,i){var o;return r(this,n),il(p(o=t.call(this,e,i)),"onElementsChanged",(function(){o.forceUpdate()})),qs(p(o),rl),Fs(p(o)),o}return o(n,[{key:"componentDidMount",value:function(){this.changeSupport.onElementsChanged(this.getRoot(),this.onElementsChanged)}},{key:"componentWillUnmount",value:function(){this.changeSupport.offElementsChanged(this.getRoot(),this.onElementsChanged)}},{key:"getRoot",value:function(){return this.sheet.getRoot()}},{key:"render",value:function(){var e=(this.getRoot().businessObject.get("annotationsWidth")||400)+"px";return ca(1,"th","annotation header",[this.slotFills({type:"cell-inner",context:{cellType:"annotations",col:this.sheet.getRoot(),minWidth:400}}),this.translate("Annotations")],0,{style:{width:e}})}}]),n}(Cs);function al(e){var t=e.row.businessObject,n=t.id,r=t.description;return pa(2,Ks,{className:"annotation",elementId:n,children:r||"-"})}function sl(e){e.onGetComponent("cell",(function(e){var t=e.cellType;return"after-label-cells"===t?ol:"after-rule-cells"===t?al:void 0}))}ol.$inject=["changeSupport","sheet","translate"],sl.$inject=["components"];var ll={__init__:["annotationsProvider"],annotationsProvider:["type",sl]};function ul(e,t){return $({id:e.id,type:e.$type,businessObject:e},t)}var cl=function(){function e(t,n,i){r(this,e),this._elementFactory=t,this._eventBus=n,this._sheet=i}return o(e,[{key:"add",value:function(e){var t,n=this;if(Zr(e,"dmn:DecisionTable"))t=this._elementFactory.createRoot(ul(e)),this._sheet.setRoot(t);else if(Zr(e,"dmn:InputClause"))t=this._elementFactory.createCol(ul(e)),this._sheet.addCol(t);else if(Zr(e,"dmn:OutputClause"))t=this._elementFactory.createCol(ul(e)),this._sheet.addCol(t);else if(Zr(e,"dmn:DecisionRule")){e.inputEntry||(e.inputEntry=[]),e.outputEntry||(e.outputEntry=[]);var r=[].concat(v(e.inputEntry),v(e.outputEntry)).map((function(e){return n._elementFactory.createCell(ul(e))}));t=this._elementFactory.createRow($(ul(e),{cells:r})),this._sheet.addRow(t)}return this._eventBus.fire("dmnElement.added",{element:t}),t}}]),e}();cl.$inject=["elementFactory","eventBus","sheet"];var pl={__depends__:[{__depends__:[Ci],tableImporter:["type",cl]},js]};function fl(e,t,r){return(t=function(e){var t=function(e,t){if("object"!==n(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!==n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===n(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var hl=function(e){s(n,e);var t=h(n);function n(e,i){var o;return r(this,n),fl(p(o=t.call(this,e,i)),"onElementsChanged",(function(){o.forceUpdate()})),qs(p(o),rl),o._sheet=i.injector.get("sheet"),o._changeSupport=i.changeSupport,o}return o(n,[{key:"componentWillMount",value:function(){var e=this._sheet.getRoot();this._changeSupport.onElementsChanged(e.id,this.onElementsChanged)}},{key:"componentWillUnmount",value:function(){var e=this._sheet.getRoot();this._changeSupport.offElementsChanged(e.id,this.onElementsChanged)}},{key:"render",value:function(){var e=this,t=this._sheet.getRoot();if(!Zr(t,"dmn:DMNElement"))return null;var n=Qr(t),r=n.input,i=n.output;return ca(1,"thead",null,ca(1,"tr",null,[ca(1,"th","index-column"),this.slotFills({type:"cell",context:{cellType:"before-label-cells"}}),r&&r.map((function(t,n){var i=t.width||"192px";return e.slotFill({type:"cell",context:{cellType:"input-header",input:t,index:n,inputsLength:r.length,width:i},key:t.id},dl)})),i.map((function(t,n){return e.slotFill({type:"cell",context:{cellType:"output-header",output:t,index:n,outputsLength:i.length},key:t.id},ml)})),this.slotFills({type:"cell",context:{cellType:"after-label-cells"}})],0),2)}}]),n}(Cs);function dl(e,t){var n=e.input,r=e.className,i=e.index,o=n.label,a=n.inputExpression,s=n.inputValues,l=t.injector.get("translate");return ca(1,"th",(r||"")+" input-cell",[ca(1,"div","clause",l(0===i?"When":"And"),0),o?ca(1,"div","input-label",o,0,{title:l("Input Label: ")+o}):ca(1,"div","input-expression",a.text,0,{title:l("Input Expression: ")+a.text}),ca(1,"div","input-variable",s&&s.text||a.typeRef,0,{title:s&&s.text?l("Input Values"):l("Input Type")})],0,{"data-col-id":n.id},n.id)}function ml(e,t){var n=e.output,r=e.className,i=e.index,o=n.label,a=n.name,s=n.outputValues,l=n.typeRef,u=t.injector.get("translate");return ca(1,"th",(r||"")+" output-cell",[ca(1,"div","clause",u(0===i?"Then":"And"),0),o?ca(1,"div","output-label",o,0,{title:u("Output Label")}):ca(1,"div","output-name",a,0,{title:u("Output Name")}),ca(1,"div","output-variable",s&&s.text||l,0,{title:s&&s.text?u("Output Values"):u("Output Type")})],0,null,n.id)}function vl(e){e.onGetComponent("table.head",(function(){return hl}))}vl.$inject=["components"];var yl={__init__:["decisionTableHeadProvider"],decisionTableHeadProvider:["type",vl]},gl=function(e){s(n,e);var t=h(n);function n(e,i){var o;return r(this,n),(o=t.call(this,e,i))._translate=i.injector.get("translate"),Fs(p(o)),o}return o(n,[{key:"render",value:function(){var e=this.sheet.getRoot();if(!Zr(e,"dmn:DMNElement"))return null;var t=e.businessObject.$parent.name,n=this.components.getComponent("hit-policy")||bl;return ca(1,"div","decision-table-properties",[ca(1,"div","decision-table-name",t,0,{title:this._translate("Decision Name: ")+t}),ca(1,"div","decision-table-header-separator"),pa(2,n)],4)}}]),n}(Cs);function bl(){return null}gl.$inject=["sheet","components"];var wl=o((function e(t){r(this,e),t.onGetComponent("table.before",500,(function(){return gl}))}));wl.$inject=["components"];var _l={__init__:["decisionTableProperties"],decisionTableProperties:["type",wl]},xl=function(e){s(n,e);var t=h(n);function n(){return r(this,n),t.apply(this,arguments)}return o(n,[{key:"render",value:function(){var e=this.props,t=e.row,n=e.rowIndex,r=this.context.components.getComponents("cell-inner",{cellType:"rule-index",row:t,rowIndex:n});return ca(1,"td","rule-index",[r&&r.map((function(e){return pa(2,e,{row:t,rowIndex:n})})),n+1],0,{"data-element-id":t.id,"data-row-id":t.id})}}]),n}(Cs),El=o((function e(t){r(this,e),t.onGetComponent("cell",(function(e){if("before-rule-cells"===e.cellType)return xl}))}));El.$inject=["components"];var kl={__init__:["decisionRuleIndices"],decisionRuleIndices:["type",El]},Cl=[{label:"FEEL",value:"feel"}],Ol=function(){function e(t){r(this,e),this._injector=t;var n=t.get("config.expressionLanguages")||{};this._config={options:Cl,defaults:{editor:"feel"}},n.options&&(this._config.options=n.options);var i=this._getLegacyDefaults();$(this._config.defaults,i,n.defaults)}return o(e,[{key:"getDefault",value:function(e){var t=this._config.defaults,n=t[e]||t.editor;return this._getLanguageByValue(n)||this.getAll()[0]}},{key:"getLabel",value:function(e){var t=this._getLanguageByValue(e);return t?t.label:e}},{key:"getAll",value:function(){return this._config.options}},{key:"_getLegacyDefaults",value:function(){var e={},t=this._injector,n=t.get("config.defaultInputExpressionLanguage"),r=t.get("config.defaultOutputExpressionLanguage");return n&&(e.inputCell=n),r&&(e.outputCell=r),e}},{key:"_getLanguageByValue",value:function(e){return M(this.getAll(),(function(t){return e===t.value}))}}]),e}();Ol.$inject=["injector"];var Sl={__init__:["expressionLanguages"],expressionLanguages:["type",Ol]},Ml=function(e){s(n,e);var t=h(n);function n(){return r(this,n),t.apply(this,arguments)}return o(n,[{key:"render",value:function(e){var t=e.rows,n=e.cols,r=this.context.components;return ca(1,"tbody",null,t.map((function(e,t){var i=r.getComponent("row",{rowType:"rule"});return i&&pa(2,i,{row:e,rowIndex:t,cols:n},e.id)})),0)}}]),n}(Cs),jl=function(e){s(n,e);var t=h(n);function n(e,i){var o;return r(this,n),qs(p(o=t.call(this,e,i)),rl),o}return o(n,[{key:"render",value:function(){var e=this,t=this.props,n=t.row,r=t.rowIndex,i=t.cols,o=n.cells;return ca(1,"tr",null,[this.slotFills({type:"cell",context:{cellType:"before-rule-cells",row:n,rowIndex:r}}),o.map((function(t,o){return e.slotFill({type:"cell",context:{cellType:"rule",cell:t,rowIndex:r,colIndex:o},key:t.id,row:n,col:i[o]})})),this.slotFills({type:"cell",context:{cellType:"after-rule-cells",row:n,rowIndex:r}})],0)}}]),n}(Cs),Nl=function(e){s(n,e);var t=h(n);function n(){return r(this,n),t.apply(this,arguments)}return o(n,[{key:"render",value:function(){var e=this.props,t=e.cell,n=e.row,r=e.col;return Zr(t,"dmn:UnaryTests")?pa(2,Ks,{className:"input-cell",elementId:t.id,"data-row-id":n.id,"data-col-id":r.id,children:t.businessObject.text}):pa(2,Ks,{className:"output-cell",elementId:t.id,"data-row-id":n.id,"data-col-id":r.id,children:t.businessObject.text})}}]),n}(Cs),Pl=o((function e(t){r(this,e),t.onGetComponent("table.body",(function(){return Ml})),t.onGetComponent("row",(function(e){if("rule"===e.rowType)return jl})),t.onGetComponent("cell",(function(e){if("rule"===e.cellType)return Nl}))}));Pl.$inject=["components"];var Dl={__depends__:[Sl],__init__:["decisionRules"],decisionRules:["type",Pl]},Rl=[{label:"Unique",value:{hitPolicy:"UNIQUE",aggregation:void 0},explanation:"No overlap is possible and all rules are disjoint. Only a single rule can be matched"},{label:"First",value:{hitPolicy:"FIRST",aggregation:void 0},explanation:"Rules may overlap. The first matching rule will be chosen"},{label:"Priority",value:{hitPolicy:"PRIORITY",aggregation:void 0},explanation:"Rules may overlap. The one with the highest priority will be chosen"},{label:"Any",value:{hitPolicy:"ANY",aggregation:void 0},explanation:"Rules may overlap. Their output have to match"},{label:"Collect",value:{hitPolicy:"COLLECT",aggregation:void 0},explanation:"Collects the values of all matching rules"},{label:"Collect (Sum)",value:{hitPolicy:"COLLECT",aggregation:"SUM"},explanation:"Collects the values of all matching rules and sums up to a single value"},{label:"Collect (Min)",value:{hitPolicy:"COLLECT",aggregation:"MIN"},explanation:"Collects the values of all matching rules and uses the lowest value"},{label:"Collect (Max)",value:{hitPolicy:"COLLECT",aggregation:"MAX"},explanation:"Collects the values of all matching rules and uses the highest value"},{label:"Collect (Count)",value:{hitPolicy:"COLLECT",aggregation:"COUNT"},explanation:"Collects the values of all matching rules and counts the number of them"},{label:"Rule order",value:{hitPolicy:"RULE ORDER",aggregation:void 0},explanation:"Collects the values of all matching rules in rule order"},{label:"Output order",value:{hitPolicy:"OUTPUT ORDER",aggregation:void 0},explanation:"Collects the values of all matching rules in decreasing output priority order"}],Tl=function(e){s(n,e);var t=h(n);function n(e,i){var o;return r(this,n),(o=t.call(this,e,i))._translate=i.injector.get("translate"),Fs(p(o)),o}return o(n,[{key:"getRoot",value:function(){return this.sheet.getRoot()}},{key:"render",value:function(){var e=this.getRoot().businessObject,t=e.aggregation,n=e.hitPolicy,r=M(Rl,(function(e){return r=e.value,i={aggregation:t,hitPolicy:n},r.hitPolicy===i.hitPolicy&&r.aggregation===i.aggregation;var r,i}));return ca(1,"div","hit-policy header",[ca(1,"label","dms-label",this._translate("Hit Policy:"),0),ca(1,"span","hit-policy-value",this._translate(r.label),0)],4,{title:this._translate(r.explanation)})}}]),n}(Cs);function Al(e){e.onGetComponent("hit-policy",(function(){return Tl}))}Tl.$inject=["sheet"],Al.$inject=["components"];var Il={__init__:["hitPolicyProvider"],hitPolicyProvider:["type",Al]};function Bl(e,t,r){return(t=function(e){var t=function(e,t){if("object"!==n(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!==n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===n(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Ll=function(e){s(n,e);var t=h(n);function n(e,i){var o;r(this,n),Bl(p(o=t.call(this,e,i)),"onClick",(function(){o._eventBus.fire("showDrd")}));var a=i.injector;return o._translate=a.get("translate"),o._eventBus=a.get("eventBus"),o}return o(n,[{key:"render",value:function(){var e=this;return ca(1,"div","view-drd",ca(1,"button","view-drd-button",this._translate("View DRD"),0,{type:"button",onClick:this.onClick}),2,null,null,(function(t){return e.node=t}))}}]),n}(Cs),$l=function(){function e(t,n,i,o){var a=this;r(this,e),this._injector=i,this._sheet=o,t.onGetComponent("table.before",(function(){if(a.canViewDrd())return Ll})),n.on("showDrd",(function(){var e=i.get("_parent",!1),t=Vl(o.getRoot());if(t){var n=e.getView(t);e.open(n)}}))}return o(e,[{key:"canViewDrd",value:function(){var e=this._injector.get("_parent",!1);if(!e)return!1;var t=Vl(this._sheet.getRoot());return!!e.getView(t)}}]),e}();function Vl(e){var t=e.businessObject;if(t)return t.$parent.$parent}$l.$inject=["components","eventBus","injector","sheet"];var zl={__init__:["viewDrd"],viewDrd:["type",$l]};function Ul(){return ca(32,"svg",null,[ca(1,"path",null,null,1,{fill:"#000000",d:"M1.88.92v.14c0 .41-.13.68-.4.8.33.14.46.44.46.86v.33c0 .61-.33.95-.95.95H0V0h.95c.65 0 .93.3.93.92zM.63.57v1.06h.24c.24 0 .38-.1.38-.43V.98c0-.28-.1-.4-.32-.4zm0 1.63v1.22h.36c.2 0 .32-.1.32-.39v-.35c0-.37-.12-.48-.4-.48H.63zM4.18.99v.52c0 .64-.31.98-.94.98h-.3V4h-.62V0h.92c.63 0 .94.35.94.99zM2.94.57v1.35h.3c.2 0 .3-.09.3-.37v-.6c0-.29-.1-.38-.3-.38h-.3zm2.89 2.27L6.25 0h.88v4h-.6V1.12L6.1 3.99h-.6l-.46-2.82v2.82h-.55V0h.87zM8.14 1.1V4h-.56V0h.79L9 2.4V0h.56v4h-.64zm2.49 2.29v.6h-.6v-.6zM12.12 1c0-.63.33-1 .95-1 .61 0 .95.37.95 1v2.04c0 .64-.34 1-.95 1-.62 0-.95-.37-.95-1zm.62 2.08c0 .28.13.39.33.39s.32-.1.32-.4V.98c0-.29-.12-.4-.32-.4s-.33.11-.33.4z"}),ca(1,"path",null,null,1,{fill:"#000000",d:"M0 4.53h14.02v1.04H0zM11.08 0h.63v.62h-.63zm.63 4V1h-.63v2.98z"})],4,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 14.02 5.57",width:"53",height:"21",style:"vertical-align:middle"})}function Fl(e,t,r){return(t=function(e){var t=function(e,t){if("object"!==n(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!==n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===n(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Wl=function(e){s(n,e);var t=h(n);function n(e,i){var o;r(this,n),Fl(p(o=t.call(this,e,i)),"onClick",(function(){o._eventBus.fire("poweredBy.show")}));var a=i.injector;return o._eventBus=a.get("eventBus"),o}return o(n,[{key:"render",value:function(){var e=this;return ca(1,"div","powered-by",ca(1,"div","powered-by__logo",pa(2,Ul),2,{title:"Powered by bpmn.io",onClick:this.onClick},null,(function(t){return e.node=t})),2)}}]),n}(Cs),ql=function(e){s(n,e);var t=h(n);function n(e){var i;return r(this,n),(i=t.call(this,e)).state={show:!1},i.onClick=i.onClick.bind(p(i)),i.onShow=i.onShow.bind(p(i)),i}return o(n,[{key:"onClick",value:function(){this.setState({show:!1})}},{key:"onShow",value:function(){this.setState({show:!0})}},{key:"componentWillMount",value:function(){(this._eventBus=this.context.injector.get("eventBus")).on("poweredBy.show",this.onShow)}},{key:"componentWillUnmount",value:function(){this._eventBus.off("poweredBy.show",this.onShow)}},{key:"render",value:function(){return this.state.show&&ca(1,"div","powered-by-overlay",ca(1,"div","powered-by-overlay-content",[ca(1,"a","logo",pa(2,Ul),2,{href:"https://bpmn.io",target:"_blank",rel:"noopener"}),ca(1,"span",null,[fa("Web-based tooling for BPMN, DMN and CMMN diagrams powered by "),ca(1,"a",null,fa("bpmn.io"),2,{href:"http://bpmn.io",target:"_blank"}),fa(".")],4)],4,{onClick:function(e){return e.stopPropagation()}}),2,{onClick:this.onClick})}}]),n}(Cs),Gl=o((function e(t,n){r(this,e),t.onGetComponent("table.before",(function(){return Wl})),t.onGetComponent("table.before",(function(){return ql}))}));Gl.$inject=["components","eventBus"];var Hl={__init__:["poweredBy"],poweredBy:["type",Gl]},Xl=["modules","additionalModules"];function Yl(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var Kl=function(e){s(n,e);var t=h(n);function n(){var e;r(this,n);var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=n._createContainer();return(e=t.call(this,$(i,{renderer:{container:o}})))._container=o,e}return o(n,[{key:"open",value:function(e){var t=this;return new Promise((function(n,r){var i;try{return t._decision&&t.clear(),t._decision=e,function(e,t,n){var r=e.get("tableImporter"),i=e.get("eventBus"),o=e.get("sheet");e.get("modeling",!1);var a,s=[];i.fire("import.render.start",{decision:t});try{!function(e){new $s({create:function(e,t,n,i){return r.create(e,t,n,i)},table:function(e){return r.add(e)},element:function(e,t,n){return r.add(e,t,n)},error:function(e,t){s.push({message:e,context:t})}}).handleDecision(e)}(t)}catch(e){a=e}i.fire("import.render.complete",{error:a,warnings:s}),i.fire("elements.changed",{elements:[o.getRoot()]}),n(a,s)}(t,e,(function(e,t){e?(e.warnings=t||[],r(e)):n({warnings:t||[]})}))}catch(e){i=e}i?(i.warnings=i.warnings||[],r(i)):n({warnings:[]})}))}},{key:"_init",value:function(e){var t=e.modules,n=e.additionalModules,r=Yl(e,Xl),i=t||this.getModules(),o=n||[],a=[{decisionTable:["value",this]}];return{modules:[Hl].concat(v(i),v(o),a),config:r}}},{key:"on",value:function(e,t,n,r){return this.get("eventBus").on(e,t,n,r)}},{key:"off",value:function(e,t){this.get("eventBus").off(e,t)}},{key:"_emit",value:function(e,t){return this.get("eventBus").fire(e,t)}},{key:"attachTo",value:function(e){if(!e)throw new Error("parentNode required");this.detach();var t=this._container;e.appendChild(t),this._emit("attach",{})}},{key:"detach",value:function(){var e=this._container;e.parentNode&&(this._emit("detach",{}),sn(e))}},{key:"destroy",value:function(){m(l(n.prototype),"destroy",this).call(this),this.detach()}},{key:"getModules",value:function(){return n._getModules()}}],[{key:"_getModules",value:function(){return[ll,pl,Ci,yl,_l,kl,Dl,Il,zl]}},{key:"_createContainer",value:function(){return on('<div class="dmn-decision-table-container"></div>')}}]),n}(Is),Zl=function(){function e(t){var n=this;r(this,e),this._listeners={},t.on("elements.changed",(function(e){var t=e.elements;n.elementsChanged(t)})),t.on("element.updateId",(function(e){var t=e.element,r=e.newId;n.updateId(t.id,r)}))}return o(e,[{key:"elementsChanged",value:function(e){for(var t={},n=e.length,r=0;r<n;r++){var i=e[r].id;if(t[i])return;t[i]=!0;var o=this._listeners[i]&&this._listeners[i].length;if(o)for(var a=0;a<o;a++)this._listeners[i][a]&&this._listeners[i][a]()}}},{key:"onElementsChanged",value:function(e,t){this._listeners[e]||(this._listeners[e]=[]),this._listeners[e][this._listeners[e].length]=t}},{key:"offElementsChanged",value:function(e,t){if(this._listeners[e])if(t){var n=this._listeners[e].indexOf(t);-1!==n&&this._listeners[e].splice(n,1)}else this._listeners[e].length=0}},{key:"updateId",value:function(e,t){this._listeners[e]&&(this._listeners[t]=this._listeners[e],delete this._listeners[e])}}]),e}();Zl.$inject=["eventBus"];var Ql=function(){function e(){r(this,e),this._listeners={}}return o(e,[{key:"getComponent",value:function(e,t){var n=this._listeners[e];if(n){for(var r,i=0;i<n.length&&!(r=n[i].callback(t));i++);return r}}},{key:"getComponents",value:function(e,t){var n=this._listeners[e];if(n){for(var r=[],i=0;i<n.length;i++){var o=n[i].callback(t);o&&r.push(o)}if(r.length)return r}}},{key:"onGetComponent",value:function(e,t,n){if(C(t)&&(n=t,t=1e3),!k(t))throw new Error("priority must be a number");var r,i,o=this._getListeners(e),a={priority:t,callback:n};for(i=0;r=o[i];i++)if(r.priority<t)return void o.splice(i,0,a);o.push(a)}},{key:"offGetComponent",value:function(e,t){var n,r,i=this._getListeners(e);if(t)for(r=i.length-1;n=i[r];r--)n.callback===t&&i.splice(r,1);else i.length=0}},{key:"_getListeners",value:function(e){var t=this._listeners[e];return t||(this._listeners[e]=t=[]),t}}]),e}(),Jl=function(e){s(n,e);var t=h(n);function n(e){var i;r(this,n);var o=(i=t.call(this,e))._injector=e.injector;return i._changeSupport=o.get("changeSupport"),i._components=o.get("components"),i._renderer=o.get("renderer"),i}return o(n,[{key:"getChildContext",value:function(){return{changeSupport:this._changeSupport,components:this._components,renderer:this._renderer,injector:this._injector}}},{key:"render",value:function(){var e=this._components.getComponents("viewer");return ca(1,"div","viewer-container",e&&e.map((function(e,t){return pa(2,e,null,t)})),0)}}]),n}(Cs),eu=function(){function e(t,n,i,o,a){r(this,e);var s=i.container;this._container=s,o.on("renderer.mount",(function(){ws(pa(2,Jl,{injector:a}),s)})),o.on("renderer.unmount",(function(){ws(null,s)}))}return o(e,[{key:"getContainer",value:function(){return this._container}}]),e}();eu.$inject=["changeSupport","components","config.renderer","eventBus","injector"];var tu={__init__:["changeSupport","components","renderer"],changeSupport:["type",Zl],components:["type",Ql],eventBus:["type",U],renderer:["type",eu]},nu=["modules"];function ru(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var iu=function(){function e(){r(this,e);var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.injector;if(!n){var i=this._init(t),o=i.modules,a=i.config;n=ou(a,o)}this.get=n.get,this.invoke=n.invoke,this.get("eventBus").fire("viewer.init")}return o(e,[{key:"_init",value:function(e){return{modules:e.modules,config:ru(e,nu)}}},{key:"destroy",value:function(){this.get("eventBus").fire("viewer.destroy")}},{key:"clear",value:function(){this.get("eventBus").fire("viewer.clear")}}]),e}();function ou(e,t){var n=new Mn([{config:["value",e]},tu].concat(t||[]));return n.init(),n}var au=function(){function e(t,n){r(this,e),this._eventBus=n,this._viewer=t}return o(e,[{key:"getDecision",value:function(){return this._viewer.getDecision()}},{key:"updateId",value:function(e,t){if(e!==this.getDecision())throw new Error("element !== decision");this._eventBus.fire("element.updateId",{element:e,newId:t}),e.id=t}}]),e}();au.$inject=["viewer","eventBus"];var su={__init__:["elementRegistry"],elementRegistry:["type",au]},lu=function(e){s(n,e);var t=h(n);function n(e,i){var o;return r(this,n),(o=t.call(this,e,i))._viewer=i.injector.get("viewer"),o}return o(n,[{key:"render",value:function(){return ca(1,"div","decision-properties",ca(1,"h3","decision-name",this._viewer.getDecision().name,0),2)}}]),n}(Cs),uu=o((function e(t){r(this,e),t.onGetComponent("viewer",1500,(function(){return lu}))}));uu.$inject=["components"];var cu={__init__:["decisionProperties"],decisionProperties:["type",uu]},pu=function(e){s(n,e);var t=h(n);function n(e,i){var o;return r(this,n),(o=t.call(this,e,i))._translate=i.injector.get("translate"),o._viewer=i.injector.get("viewer"),o}return o(n,[{key:"render",value:function(){var e=this._viewer.getDecision(),t=e.decisionLogic,n=e.variable;return ca(1,"div","literal-expression-properties",ca(1,"table",null,[ca(1,"tr",null,[ca(1,"td",null,this._translate("Variable Name:"),0),ca(1,"td",null,ca(1,"span",null,n.name||"-",0),2)],4),ca(1,"tr",null,[ca(1,"td",null,this._translate("Variable Type:"),0),ca(1,"td",null,ca(1,"span",null,this._translate(n.typeRef||"")||"-",0),2)],4),ca(1,"tr",null,[ca(1,"td",null,this._translate("Expression Language:"),0),ca(1,"td",null,ca(1,"span",null,t.expressionLanguage||"-",0),2)],4)],4),2)}}]),n}(Cs),fu=o((function e(t){r(this,e),t.onGetComponent("viewer",500,(function(){return pu}))}));fu.$inject=["components"];var hu={__depends__:[],__init__:["literalExpressionProperties"],literalExpressionProperties:["type",fu]};function du(e,t,r){return(t=function(e){var t=function(e,t){if("object"!==n(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!==n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===n(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var mu=function(e){s(n,e);var t=h(n);function n(e,i){var o;r(this,n),du(p(o=t.call(this,e,i)),"onClick",(function(){o._eventBus.fire("poweredBy.show")}));var a=i.injector;return o._eventBus=a.get("eventBus"),o}return o(n,[{key:"render",value:function(){var e=this;return ca(1,"div","powered-by",ca(1,"div","powered-by__logo",pa(2,Ul),2),2,{onClick:this.onClick,title:"Powered by bpmn.io"},null,(function(t){return e.node=t}))}}]),n}(Cs),vu=function(e){s(n,e);var t=h(n);function n(e){var i;return r(this,n),(i=t.call(this,e)).state={show:!1},i.onClick=i.onClick.bind(p(i)),i.onShow=i.onShow.bind(p(i)),i}return o(n,[{key:"onClick",value:function(){this.setState({show:!1})}},{key:"onShow",value:function(){this.setState({show:!0})}},{key:"componentWillMount",value:function(){(this._eventBus=this.context.injector.get("eventBus")).on("poweredBy.show",this.onShow)}},{key:"componentWillUnmount",value:function(){this._eventBus.off("poweredBy.show",this.onShow)}},{key:"render",value:function(){return this.state.show&&ca(1,"div","powered-by-overlay",ca(1,"div","powered-by-overlay-content",[ca(1,"a","logo",pa(2,Ul),2,{href:"https://bpmn.io",target:"_blank",rel:"noopener"}),ca(1,"span",null,[fa("Web-based tooling for BPMN, DMN and CMMN diagrams powered by "),ca(1,"a",null,fa("bpmn.io"),2,{href:"http://bpmn.io",target:"_blank"}),fa(".")],4)],4,{onClick:function(e){return e.stopPropagation()}}),2,{onClick:this.onClick})}}]),n}(Cs),yu=o((function e(t,n){r(this,e),t.onGetComponent("viewer",2e3,(function(){return mu})),t.onGetComponent("viewer",(function(){return vu}))}));yu.$inject=["components","eventBus"];var gu={__init__:["poweredBy"],poweredBy:["type",yu]},bu=function(e){s(n,e);var t=h(n);function n(e,i){var o;return r(this,n),(o=t.call(this,e,i))._viewer=i.injector.get("viewer"),o}return o(n,[{key:"render",value:function(){return ca(1,"div","textarea",ca(1,"div","content",this._viewer.getDecision().decisionLogic.text,0),2)}}]),n}(Cs),wu=o((function e(t){r(this,e),t.onGetComponent("viewer",(function(){return bu}))}));wu.$inject=["components"];var _u={__init__:["textarea"],textarea:["type",wu]};function xu(e,t,r){return(t=function(e){var t=function(e,t){if("object"!==n(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!==n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===n(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Eu=function(e){s(n,e);var t=h(n);function n(e,i){var o;r(this,n),xu(p(o=t.call(this,e,i)),"onClick",(function(){o._eventBus.fire("showDrd")}));var a=i.injector;return o._translate=a.get("translate"),o._eventBus=a.get("eventBus"),o}return o(n,[{key:"render",value:function(){var e=this;return ca(1,"div","view-drd",ca(1,"button","view-drd-button",this._translate("View DRD"),0,{type:"button",onClick:this.onClick}),2,null,null,(function(t){return e.node=t}))}}]),n}(Cs);Eu.$inject=["translate"];var ku=function(){function e(t,n,i,o){var a=this;r(this,e),this._injector=o,this._viewer=n,t.onGetComponent("viewer",2e3,(function(){if(a.canViewDrd())return Eu})),i.on("showDrd",(function(){var e=o.get("_parent",!1),t=a.getDefinitions(),n=e.getView(t);e.open(n)}))}return o(e,[{key:"canViewDrd",value:function(){var e=this._injector.get("_parent",!1);if(e){var t=this.getDefinitions();return!!e.getView(t)}}},{key:"getDefinitions",value:function(){return this._viewer.getDecision().$parent}}]),e}();ku.$inject=["components","viewer","eventBus","injector"];var Cu={__init__:["viewDrd"],viewDrd:["type",ku]},Ou=["modules","additionalModules"];function Su(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var Mu=function(e){s(n,e);var t=h(n);function n(){var e;r(this,n);var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=n._createContainer();return(e=t.call(this,$(i,{renderer:{container:o}})))._container=o,e}return o(n,[{key:"open",value:function(e){var t=this;return new Promise((function(n,r){var i;try{t._decision&&(t.clear(),t.get("eventBus").fire("renderer.unmount")),t._decision=e,t.get("eventBus").fire("import",e),t.get("eventBus").fire("renderer.mount")}catch(e){i=e}i?(i.warnings=i.warnings||[],r(i)):n({warnings:[]})}))}},{key:"_init",value:function(e){var t=e.modules,n=e.additionalModules,r=Su(e,Ou),i=t||this.getModules(),o=n||[],a=[{viewer:["value",this]}];return{modules:[].concat(v(i),v(o),a),config:r}}},{key:"on",value:function(e,t,n,r){return this.get("eventBus").on(e,t,n,r)}},{key:"off",value:function(e,t){this.get("eventBus").off(e,t)}},{key:"_emit",value:function(e,t){return this.get("eventBus").fire(e,t)}},{key:"getDecision",value:function(){return this._decision}},{key:"attachTo",value:function(e){if(!e)throw new Error("parentNode required");this.detach(),e.appendChild(this._container),this._emit("attach",{})}},{key:"detach",value:function(){var e=this._container;e.parentNode&&(this._emit("detach",{}),sn(e))}},{key:"destroy",value:function(){m(l(n.prototype),"destroy",this).call(this),this.detach()}},{key:"getModules",value:function(){return n._getModules()}}],[{key:"_getModules",value:function(){return[su,Ci,cu,hu,gu,_u,Cu]}},{key:"_createContainer",value:function(){return on('<div class="dmn-literal-expression-container"></div>')}}]),n}(iu);var ju=function(e){s(n,e);var t=h(n);function n(){return r(this,n),t.apply(this,arguments)}return o(n,[{key:"_getViewProviders",value:function(){return[{id:"drd",constructor:To,opens:function(e){return Zr(e,"dmn:Definitions")&&((t=e).dmnDI&&t.dmnDI.diagrams&&t.dmnDI.diagrams[0]);var t}},{id:"decisionTable",constructor:Kl,opens:function(e){return Zr(e,"dmn:Decision")&&Zr(e.decisionLogic,"dmn:DecisionTable")}},{id:"literalExpression",constructor:Mu,opens:function(e){return Zr(e,"dmn:Decision")&&Zr(e.decisionLogic,"dmn:LiteralExpression")}}]}}]),n}(dn);return ju}));
17