UNPKG

dmn-js

Version:

A dmn toolkit and web modeler

2 lines 502 kB
/*! dmn-js - dmn-viewer v17.5.0 | Copyright (c) 2014-present, camunda Services GmbH | bpmn.io/license */ !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";const e=Object.prototype.toString,t=Object.prototype.hasOwnProperty;function n(e){return void 0===e}function i(e){return void 0!==e}function r(e){return null==e}function o(t){return"[object Array]"===e.call(t)}function s(t){return"[object Object]"===e.call(t)}function a(t){return"[object Number]"===e.call(t)}function l(t){const n=e.call(t);return"[object Function]"===n||"[object AsyncFunction]"===n||"[object GeneratorFunction]"===n||"[object AsyncGeneratorFunction]"===n||"[object Proxy]"===n}function c(t){return"[object String]"===e.call(t)}function h(e,n){return!r(e)&&t.call(e,n)}function u(e,t){const n=y(t);let i;return d(e,(function(e,t){if(n(e,t))return i=e,!1})),i}function p(e,t){const n=y(t);let i=[];return d(e,(function(e,t){n(e,t)&&i.push(e)})),i}function d(e,t){let i,r;if(n(e))return;const s=o(e)?w:v;for(let n in e)if(h(e,n)&&(i=e[n],r=t(i,s(n)),!1===r))return i}function f(e,t,n){return d(e,(function(e,i){n=t(n,e,i)})),n}function g(e,t){return!!f(e,(function(e,n,i){return e&&t(n,i)}),!0)}function m(e){return function(t){return g(e,(function(e,n){return t[n]===e}))}}function y(e){return l(e)?e:t=>t===e}function v(e){return e}function w(e){return Number(e)}function b(e,t){let n,i,r,o;function s(n){let s=Date.now(),c=n?0:o+t-s;if(c>0)return a(c);e.apply(r,i),l()}function a(e){n=setTimeout(s,e)}function l(){n&&clearTimeout(n),n=o=i=r=void 0}function c(...e){o=Date.now(),i=e,r=this,n||a(t)}return c.flush=function(){n&&s(!0),l()},c.cancel=l,c}function x(e,t){return e.bind(t)}function k(e,...t){return Object.assign(e,...t)}var _="__fn",S=Array.prototype.slice;function C(){this._listeners={},this.on("diagram.destroy",1,this._destroy,this)}function E(){}function M(){}function A(e,t){this.model=e,this.properties=t}C.prototype.on=function(e,t,n,i){if(e=o(e)?e:[e],l(t)&&(i=n,n=t,t=1e3),!a(t))throw new Error("priority must be a number");var r=n;i&&((r=x(n,i))[_]=n[_]||n);var s=this;e.forEach((function(e){s._addListener(e,{priority:t,callback:r,next:null})}))},C.prototype.once=function(e,t,n,i){var r=this;if(l(t)&&(i=n,n=t,t=1e3),!a(t))throw new Error("priority must be a number");function o(){o.__isTomb=!0;var t=n.apply(i,arguments);return r.off(e,o),t}o[_]=n,this.on(e,t,o)},C.prototype.off=function(e,t){e=o(e)?e:[e];var n=this;e.forEach((function(e){n._removeListener(e,t)}))},C.prototype.createEvent=function(e){var t=new E;return t.init(e),t},C.prototype.fire=function(e,t){var n,i,r,o;if(o=S.call(arguments),"object"==typeof e&&(e=(t=e).type),!e)throw new Error("no event type specified");if(i=this._listeners[e]){n=t instanceof E?t:this.createEvent(t),o[0]=n;var s=n.type;e!==s&&(n.type=e);try{r=this._invokeListeners(n,o,i)}finally{e!==s&&(n.type=s)}return void 0===r&&n.defaultPrevented&&(r=!1),r}},C.prototype.handleError=function(e){return!1===this.fire("error",{error:e})},C.prototype._destroy=function(){this._listeners={}},C.prototype._invokeListeners=function(e,t,n){for(var i;n&&!e.cancelBubble;)i=this._invokeListener(e,t,n),n=n.next;return i},C.prototype._invokeListener=function(e,t,n){var i;if(n.callback.__isTomb)return i;try{i=function(e,t){return e.apply(null,t)}(n.callback,t),void 0!==i&&(e.returnValue=i,e.stopPropagation()),!1===i&&e.preventDefault()}catch(e){if(!this.handleError(e))throw console.error("unhandled error in event listener",e),e}return i},C.prototype._addListener=function(e,t){var n,i=this._getListeners(e);if(i){for(;i;){if(i.priority<t.priority)return t.next=i,void(n?n.next=t:this._setListeners(e,t));n=i,i=i.next}n.next=t}else this._setListeners(e,t)},C.prototype._getListeners=function(e){return this._listeners[e]},C.prototype._setListeners=function(e,t){this._listeners[e]=t},C.prototype._removeListener=function(e,t){var n,i,r,o=this._getListeners(e);if(t)for(;o;)n=o.next,(r=o.callback)!==t&&r[_]!==t||(i?i.next=n:this._setListeners(e,n)),i=o,o=n;else this._setListeners(e,null)},E.prototype.stopPropagation=function(){this.cancelBubble=!0},E.prototype.preventDefault=function(){this.defaultPrevented=!0},E.prototype.init=function(e){k(this,e||{})},M.prototype.get=function(e){return this.$model.properties.get(this,e)},M.prototype.set=function(e,t){this.$model.properties.set(this,e,t)},A.prototype.createType=function(e){var t=this.model,n=this.properties,i=Object.create(M.prototype);d(e.properties,(function(e){e.isMany||void 0===e.default||(i[e.name]=e.default)})),n.defineModel(i,t),n.defineDescriptor(i,e);var r=e.ns.name;function o(e){n.define(this,"$type",{value:r,enumerable:!0}),n.define(this,"$attrs",{value:{}}),n.define(this,"$parent",{writable:!0}),d(e,x((function(e,t){this.set(t,e)}),this))}return o.prototype=i,o.hasType=i.$instanceOf=this.model.hasType,n.defineModel(o,t),n.defineDescriptor(o,e),o};var T={String:!0,Boolean:!0,Integer:!0,Real:!0,Element:!0},R={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 D(e,t){var n=R[e];return n?n(t):t}function O(e){return!!T[e]}function N(e){return!!R[e]}function q(e,t){var n,i,r=e.split(/:/);if(1===r.length)n=e,i=t;else{if(2!==r.length)throw new Error("expected <prefix:localName> or <localName>, got "+e);n=r[1],i=r[0]}return{name:e=(i?i+":":"")+n,prefix:i,localName:n}}function B(e){this.ns=e,this.name=e.name,this.allTypes=[],this.allTypesByName={},this.properties=[],this.propertiesByName={}}function P(e,t){this.packageMap={},this.typeMap={},this.packages=[],this.properties=t,d(e,x(this.registerPackage,this))}function I(e,t,n){var i=t[n];if(i in e)throw new Error("package with "+n+" <"+i+"> already defined")}function L(e){this.model=e}function F(e,t,n){Object.defineProperty(e,t.name,{enumerable:!t.isReference,writable:!0,value:n,configurable:!0})}function j(e){return e.replace(/^:/,"")}function V(e,t={}){this.properties=new L(this),this.factory=new A(this,this.properties),this.registry=new P(e,this.properties),this.typeCache={},this.config=t}B.prototype.build=function(){return function(e,t){let n={},i=Object(e);return d(t,(function(t){t in i&&(n[t]=e[t])})),n}(this,["ns","name","allTypes","allTypesByName","properties","propertiesByName","bodyProperty","idProperty"])},B.prototype.addProperty=function(e,t,n){"boolean"==typeof t&&(n=t,t=void 0),this.addNamedProperty(e,!1!==n);var i=this.properties;void 0!==t?i.splice(t,0,e):i.push(e)},B.prototype.replaceProperty=function(e,t,n){var i=e.ns,r=this.properties,o=this.propertiesByName,s=e.name!==t.name;if(e.isId){if(!t.isId)throw new Error("property <"+t.ns.name+"> must be id property to refine <"+e.ns.name+">");this.setIdProperty(t,!1)}if(e.isBody){if(!t.isBody)throw new Error("property <"+t.ns.name+"> must be body property to refine <"+e.ns.name+">");this.setBodyProperty(t,!1)}var a=r.indexOf(e);if(-1===a)throw new Error("property <"+i.name+"> not found in property list");r.splice(a,1),this.addProperty(t,n?void 0:a,s),o[i.name]=o[i.localName]=t},B.prototype.redefineProperty=function(e,t,n){var i=e.ns.prefix,r=t.split("#"),o=q(r[0],i),s=q(r[1],o.prefix).name,a=this.propertiesByName[s];if(!a)throw new Error("refined property <"+s+"> not found");this.replaceProperty(a,e,n),delete e.redefines},B.prototype.addNamedProperty=function(e,t){var n=e.ns,i=this.propertiesByName;t&&(this.assertNotDefined(e,n.name),this.assertNotDefined(e,n.localName)),i[n.name]=i[n.localName]=e},B.prototype.removeNamedProperty=function(e){var t=e.ns,n=this.propertiesByName;delete n[t.name],delete n[t.localName]},B.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},B.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},B.prototype.assertNotTrait=function(e){if((e.extends||[]).length)throw new Error(`cannot create <${e.name}> extending <${e.extends}>`)},B.prototype.assertNotDefined=function(e,t){var n=e.name,i=this.propertiesByName[n];if(i)throw new Error("property <"+n+"> already defined; override of <"+i.definedBy.ns.name+"#"+i.ns.name+"> by <"+e.definedBy.ns.name+"#"+e.ns.name+"> not allowed without redefines")},B.prototype.hasProperty=function(e){return this.propertiesByName[e]},B.prototype.addTrait=function(e,t){t&&this.assertNotTrait(e);var n=this.allTypesByName,i=this.allTypes,r=e.name;r in n||(d(e.properties,x((function(n){n=k({},n,{name:n.ns.localName,inherited:t}),Object.defineProperty(n,"definedBy",{value:e});var i=n.replaces,r=n.redefines;i||r?this.redefineProperty(n,i||r,i):(n.isBody&&this.setBodyProperty(n),n.isId&&this.setIdProperty(n),this.addProperty(n))}),this)),i.push(e),n[r]=e)},P.prototype.getPackage=function(e){return this.packageMap[e]},P.prototype.getPackages=function(){return this.packages},P.prototype.registerPackage=function(e){e=k({},e);var t=this.packageMap;I(t,e,"prefix"),I(t,e,"uri"),d(e.types,x((function(t){this.registerType(t,e)}),this)),t[e.uri]=t[e.prefix]=e,this.packages.push(e)},P.prototype.registerType=function(e,t){var n=q((e=k({},e,{superClass:(e.superClass||[]).slice(),extends:(e.extends||[]).slice(),properties:(e.properties||[]).slice(),meta:k(e.meta||{})})).name,t.prefix),i=n.name,r={};d(e.properties,x((function(e){var t=q(e.name,n.prefix),i=t.name;O(e.type)||(e.type=q(e.type,t.prefix).name),k(e,{ns:t,name:i}),r[i]=e}),this)),k(e,{ns:n,name:i,propertiesByName:r}),d(e.extends,x((function(e){var t=q(e,n.prefix),r=this.typeMap[t.name];r.traits=r.traits||[],r.traits.push(i)}),this)),this.definePackage(e,t),this.typeMap[i]=e},P.prototype.mapTypes=function(e,t,n){var i=O(e.name)?{name:e.name}:this.typeMap[e.name],r=this;function o(n,i){var o=q(n,O(n)?"":e.prefix);r.mapTypes(o,t,i)}function s(e){return o(e,!0)}if(!i)throw new Error("unknown type <"+e.name+">");d(i.superClass,n?s:function(e){return o(e,!1)}),t(i,!n),d(i.traits,s)},P.prototype.getEffectiveDescriptor=function(e){var t=q(e),n=new B(t);this.mapTypes(t,(function(e,t){n.addTrait(e,t)}));var i=n.build();return this.definePackage(i,i.allTypes[i.allTypes.length-1].$pkg),i},P.prototype.definePackage=function(e,t){this.properties.define(e,"$pkg",{value:t})},L.prototype.set=function(e,t,n){if(!c(t)||!t.length)throw new TypeError("property name must be a non-empty string");var i=this.getProperty(e,t),r=i&&i.name;void 0===n?i?delete e[r]:delete e.$attrs[j(t)]:i?r in e?e[r]=n:F(e,i,n):e.$attrs[j(t)]=n},L.prototype.get=function(e,t){var n=this.getProperty(e,t);if(!n)return e.$attrs[j(t)];var i=n.name;return!e[i]&&n.isMany&&F(e,n,[]),e[i]},L.prototype.define=function(e,t,n){if(!n.writable){var i=n.value;delete(n=k({},n,{get:function(){return i}})).value}Object.defineProperty(e,t,n)},L.prototype.defineDescriptor=function(e,t){this.define(e,"$descriptor",{value:t})},L.prototype.defineModel=function(e,t){this.define(e,"$model",{value:t})},L.prototype.getProperty=function(e,t){var n=this.model,i=n.getPropertyDescriptor(e,t);if(i)return i;if(t.includes(":"))return null;const r=n.config.strict;if(void 0!==r){const n=new TypeError(`unknown property <${t}> on <${e.$type}>`);if(r)throw n;"undefined"!=typeof console&&console.warn(n)}return null},V.prototype.create=function(e,t){var n=this.getType(e);if(!n)throw new Error("unknown type <"+e+">");return new n(t)},V.prototype.getType=function(e){var t=this.typeCache,n=c(e)?e:e.ns.name,i=t[n];return i||(e=this.registry.getEffectiveDescriptor(n),i=t[n]=this.factory.createType(e)),i},V.prototype.createAny=function(e,t,o){var a=q(e),l={$type:e,$instanceOf:function(e){return e===this.$type},get:function(e){return this[e]},set:function(e,t){!function(e,t,o){let s=e;d(t,(function(e,a){if("number"!=typeof e&&"string"!=typeof e)throw new Error("illegal key type: "+typeof e+". Key should be of type number or string.");if("constructor"===e)throw new Error("illegal key: constructor");if("__proto__"===e)throw new Error("illegal key: __proto__");let l=t[a+1],c=s[e];i(l)&&r(c)&&(c=s[e]=isNaN(+l)?{}:[]),n(l)?n(o)?delete s[e]:s[e]=o:s=c}))}(this,[e],t)}},c={name:e,isGeneric:!0,ns:{prefix:a.prefix,localName:a.localName,uri:t}};return this.properties.defineDescriptor(l,c),this.properties.defineModel(l,this),this.properties.define(l,"get",{enumerable:!1,writable:!0}),this.properties.define(l,"set",{enumerable:!1,writable:!0}),this.properties.define(l,"$parent",{enumerable:!1,writable:!0}),this.properties.define(l,"$instanceOf",{enumerable:!1,writable:!0}),d(o,(function(e,t){s(e)&&void 0!==e.value?l[e.name]=e.value:l[t]=e})),l},V.prototype.getPackage=function(e){return this.registry.getPackage(e)},V.prototype.getPackages=function(){return this.registry.getPackages()},V.prototype.getElementDescriptor=function(e){return e.$descriptor},V.prototype.hasType=function(e,t){return void 0===t&&(t=e,e=this),t in e.$model.getElementDescriptor(e).allTypesByName},V.prototype.getPropertyDescriptor=function(e,t){return this.getElementDescriptor(e).propertiesByName[t]},V.prototype.getTypeDescriptor=function(e){return this.registry.typeMap[e]};var $=String.fromCharCode,W=Object.prototype.hasOwnProperty,z=/&#(\d+);|&#x([0-9a-f]+);|&(\w+);/gi,H={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'};function U(e,t,n,i){return i?W.call(H,i)?H[i]:"&"+i+";":$(t||parseInt(n,16))}function G(e){return e.length>3&&-1!==e.indexOf("&")?e.replace(z,U):e}Object.keys(H).forEach((function(e){H[e.toUpperCase()]=H[e]}));var K="non-whitespace outside of root node";function X(e){return new Error(e)}function J(e){return"missing namespace for prefix <"+e+">"}function Y(e){return{get:e,enumerable:!0}}function Q(e){var t,n={};for(t in e)n[t]=e[t];return n}function Z(e){return e+"$uri"}function ee(){return{line:0,column:0}}function te(e){throw e}function ne(e){if(!this)return new ne(e);var t,n,i,r,o,s,a,l,c,h=e&&e.proxy,u=te,p=ee,d=!1,f=!1,g=null,m=!1;function y(e){e instanceof Error||(e=X(e)),g=e,u(e,p)}function v(e){o&&(e instanceof Error||(e=X(e)),o(e,p))}this.on=function(e,c){if("function"!=typeof c)throw X("required args <name, cb>");switch(e){case"openTag":n=c;break;case"text":t=c;break;case"closeTag":i=c;break;case"error":u=c;break;case"warn":o=c;break;case"cdata":r=c;break;case"attention":l=c;break;case"question":a=c;break;case"comment":s=c;break;default:throw X("unsupported event: "+e)}return this},this.ns=function(e){if(void 0===e&&(e={}),"object"!=typeof e)throw X("required args <nsMap={}>");var t,n={};for(t in e)n[t]=e[t];return f=!0,c=n,this},this.parse=function(e){if("string"!=typeof e)throw X("required args <xml=string>");return g=null,function(e){var o,u,g,w,b,x,k,_,S,C,E,M=f?[]:null,A=f?function(e){var t,n,i={};for(t in e)i[n=e[t]]=n,i[Z(n)]=t;return i}(c):null,T=[],R=0,D=!1,O=!1,N=0,q=0,B="",P=0;function I(){if(null!==E)return E;var e,t,n,i,r,o,s,a,l,h,u,p=f&&A.xmlns,g=f&&d?[]:null,m=P,y=B,w=y.length,b={},x={};e:for(;m<w;m++)if(l=!1,!(32===(h=y.charCodeAt(m))||h<14&&h>8)){for((h<65||h>122||h>90&&h<97)&&95!==h&&58!==h&&(v("illegal first char attribute name"),l=!0),u=m+1;u<w;u++)if(!((h=y.charCodeAt(u))>96&&h<123||h>64&&h<91||h>47&&h<59||46===h||45===h||95===h)){if(32===h||h<14&&h>8){v("missing attribute value"),m=u;continue e}if(61===h)break;v("illegal attribute name char"),l=!0}if("xmlns:xmlns"===(a=y.substring(m,u))&&(v("illegal declaration of xmlns"),l=!0),34===(h=y.charCodeAt(u+1)))-1===(u=y.indexOf('"',m=u+2))&&-1!==(u=y.indexOf("'",m))&&(v("attribute value quote missmatch"),l=!0);else if(39===h)-1===(u=y.indexOf("'",m=u+2))&&-1!==(u=y.indexOf('"',m))&&(v("attribute value quote missmatch"),l=!0);else for(v("missing attribute value quotes"),l=!0,u+=1;u<w&&!(32===(h=y.charCodeAt(u+1))||h<14&&h>8);u++);for(-1===u&&(v("missing closing quotes"),u=w,l=!0),l||(o=y.substring(m,u)),m=u;u+1<w&&!(32===(h=y.charCodeAt(u+1))||h<14&&h>8);u++)m===u&&(v("illegal character after attribute end"),l=!0);if(m=u+1,!l)if(a in x)v("attribute <"+a+"> already defined");else if(x[a]=!0,f)if(d){if(null!==(r="xmlns"===a?"xmlns":120===a.charCodeAt(0)&&"xmlns:"===a.substr(0,6)?a.substr(6):null)){if(e=G(o),t=Z(r),!(s=c[e])){if("xmlns"===r||t in A&&A[t]!==e)do{s="ns"+R++}while(void 0!==A[s]);else s=r;c[e]=s}A[r]!==s&&(i||(A=Q(A),i=!0),A[r]=s,"xmlns"===r&&(A[Z(s)]=e,p=s),A[t]=e),b[a]=o;continue}g.push(a,o)}else-1!==(h=a.indexOf(":"))?(n=A[a.substring(0,h)])?b[a=p===n?a.substr(h+1):n+a.substr(h)]=o:v(J(a.substring(0,h))):b[a]=o;else b[a]=o}if(d)for(m=0,w=g.length;m<w;m++){if(a=g[m++],o=g[m],-1!==(h=a.indexOf(":"))){if(!(n=A[a.substring(0,h)])){v(J(a.substring(0,h)));continue}a=p===n?a.substr(h+1):n+a.substr(h)}b[a]=o}return E=b}function L(){for(var t,n,i=/(\r\n|\r|\n)/g,r=0,o=0,s=0,a=q;N>=s&&(t=i.exec(e))&&!((a=t[0].length+t.index)>N);)r+=1,s=a;return-1==N?(o=a,n=e.substring(q)):0===q?n=e.substring(q,N):(o=N-s,n=-1==q?e.substring(N):e.substring(N,q+1)),{data:n,line:r,column:o}}p=L,h&&(C=Object.create({},{name:Y((function(){return _})),originalName:Y((function(){return S})),attrs:Y(I),ns:Y((function(){return A}))}));for(;-1!==q;){if(-1===(N=60===e.charCodeAt(q)?q:e.indexOf("<",q)))return T.length?y("unexpected end of file"):0===q?y("missing start tag"):void(q<e.length&&e.substring(q).trim()&&v(K));if(q!==N)if(T.length){if(t&&(t(e.substring(q,N),G,p),m))return}else if(e.substring(q,N).trim()&&(v(K),m))return;if(33===(b=e.charCodeAt(N+1))){if(91===(w=e.charCodeAt(N+2))&&"CDATA["===e.substr(N+3,6)){if(-1===(q=e.indexOf("]]>",N)))return y("unclosed cdata");if(r&&(r(e.substring(N+9,q),p),m))return;q+=3;continue}if(45===w&&45===e.charCodeAt(N+3)){if(-1===(q=e.indexOf("--\x3e",N)))return y("unclosed comment");if(s&&(s(e.substring(N+4,q),G,p),m))return;q+=3;continue}}if(63!==b){for(u=N+1;;u++){if(x=e.charCodeAt(u),isNaN(x))return q=-1,y("unclosed tag");if(34===x)u=-1!==(w=e.indexOf('"',u+1))?w:u;else if(39===x)u=-1!==(w=e.indexOf("'",u+1))?w:u;else if(62===x){q=u;break}}if(33!==b){if(E={},47===b){if(D=!1,O=!0,!T.length)return y("missing open tag");if(u=_=T.pop(),w=N+2+u.length,e.substring(N+2,w)!==u)return y("closing tag mismatch");for(;w<q;w++)if(!(32===(b=e.charCodeAt(w))||b>8&&b<14))return y("close tag")}else{if(47===e.charCodeAt(q-1)?(u=_=e.substring(N+1,q-1),D=!0,O=!0):(u=_=e.substring(N+1,q),D=!0,O=!1),!(b>96&&b<123||b>64&&b<91||95===b||58===b))return y("illegal first char nodeName");for(w=1,g=u.length;w<g;w++)if(!((b=u.charCodeAt(w))>96&&b<123||b>64&&b<91||b>47&&b<59||45===b||95===b||46==b)){if(32===b||b<14&&b>8){_=u.substring(0,w),E=null;break}return y("invalid nodeName")}O||T.push(_)}if(f){if(o=A,D&&(O||M.push(o),null===E&&(d=-1!==u.indexOf("xmlns",w))&&(P=w,B=u,I(),d=!1)),S=_,-1!==(b=_.indexOf(":"))){if(!(k=A[_.substring(0,b)]))return y("missing namespace on <"+S+">");_=_.substr(b+1)}else k=A.xmlns;k&&(_=k+":"+_)}if(D&&(P=w,B=u,n&&(h?n(C,G,O,p):n(_,I,G,O,p),m)))return;if(O){if(i&&(i(h?C:_,G,D,p),m))return;f&&(A=D?o:M.pop())}q+=1}else{if(l&&(l(e.substring(N,q+1),G,p),m))return;q+=1}}else{if(-1===(q=e.indexOf("?>",N)))return y("unclosed question");if(a&&(a(e.substring(N,q+2),p),m))return;q+=2}}}(e),p=ee,m=!1,g},this.stop=function(){m=!0}}function ie(e){return e.xml&&"lowerCase"===e.xml.tagAlias}var re={xsi:"http://www.w3.org/2001/XMLSchema-instance",xml:"http://www.w3.org/XML/1998/namespace"},oe="property";function se(e){return e.xml&&e.xml.serialize}function ae(e,t){return ie(t)?e.prefix+":"+((n=e.localName).charAt(0).toUpperCase()+n.slice(1)):e.name;var n}function le(e){return new Error(e)}function ce(e){return e.$descriptor}function he(e){k(this,e),this.elementsById={},this.references=[],this.warnings=[],this.addReference=function(e){this.references.push(e)},this.addElement=function(e){if(!e)throw le("expected element");var t,n=this.elementsById,i=ce(e).idProperty;if(i&&(t=e.get(i.name))){if(!/^([a-z][\w-.]*:)?[a-z_][\w-.]*$/i.test(t))throw new Error("illegal ID <"+t+">");if(n[t])throw le("duplicate ID <"+t+">");n[t]=e}},this.addWarning=function(e){this.warnings.push(e)}}function ue(){}function pe(){}function de(){}function fe(e,t){this.property=e,this.context=t}function ge(e,t){this.element=t,this.propertyDesc=e}function me(){}function ye(e,t,n){this.model=e,this.type=e.getType(t),this.context=n}function ve(e,t,n){ye.call(this,e,t,n)}function we(e,t,n){this.model=e,this.context=n}function be(e){e instanceof V&&(e={model:e}),k(this,{lax:!1},e)}ue.prototype.handleEnd=function(){},ue.prototype.handleText=function(){},ue.prototype.handleNode=function(){},pe.prototype=Object.create(ue.prototype),pe.prototype.handleNode=function(){return this},de.prototype=Object.create(ue.prototype),de.prototype.handleText=function(e){this.body=(this.body||"")+e},fe.prototype=Object.create(de.prototype),fe.prototype.handleNode=function(e){if(this.element)throw le("expected no sub nodes");return this.element=this.createReference(e),this},fe.prototype.handleEnd=function(){this.element.id=this.body},fe.prototype.createReference=function(e){return{property:this.property.ns.name,id:""}},ge.prototype=Object.create(de.prototype),ge.prototype.handleEnd=function(){var e=this.body||"",t=this.element,n=this.propertyDesc;e=D(n.type,e),n.isMany?t.get(n.name).push(e):t.set(n.name,e)},me.prototype=Object.create(de.prototype),me.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},ye.prototype=Object.create(me.prototype),ye.prototype.addReference=function(e){this.context.addReference(e)},ye.prototype.handleText=function(e){if(!ce(this.element).bodyProperty)throw le("unexpected body text <"+e+">");de.prototype.handleText.call(this,e)},ye.prototype.handleEnd=function(){var e=this.body,t=this.element,n=ce(t).bodyProperty;n&&void 0!==e&&(e=D(n.type,e),t.set(n.name,e))},ye.prototype.createElement=function(e){var t,n=e.attributes,i=this.type,r=ce(i),o=this.context,s=new i({}),a=this.model;return d(n,(function(e,n){var i=r.propertiesByName[n];i&&i.isReference?i.isMany?d(e.split(" "),(function(e){o.addReference({element:s,property:i.ns.name,id:e})})):o.addReference({element:s,property:i.ns.name,id:e}):(i?e=D(i.type,e):"xmlns"===n?n=":"+n:(t=q(n,r.ns.prefix),a.getPackage(t.prefix)&&o.addWarning({message:"unknown attribute <"+n+">",element:s,property:n,value:e})),s.set(n,e))})),s},ye.prototype.getPropertyForNode=function(e){var t=q(e.name),n=this.type,i=this.model,r=ce(n),o=t.name,s=r.propertiesByName[o];if(s&&!s.isAttr){const t=function(e){const t=se(e);return t!==oe&&(t||null)}(s);if(t){const n=e.attributes[t];if(n){const t=function(e,t,n){const i=q(e,t.xmlns),r=q(`${t[i.prefix]||i.prefix}:${i.localName}`);return function(e,t){var n=e.name,i=e.localName,r=t&&t.xml&&t.xml.typePrefix;return r&&0===i.indexOf(r)?e.prefix+":"+i.slice(r.length):n}(r,n.getPackage(r.prefix))}(n,e.ns,i);return k({},s,{effectiveType:ce(i.getType(t)).name})}}return s}var a=i.getPackage(t.prefix);if(a){const e=ae(t,a),n=i.getType(e);if(s=u(r.properties,(function(e){return!e.isVirtual&&!e.isReference&&!e.isAttribute&&n.hasType(e.type)})))return k({},s,{effectiveType:ce(n).name})}else if(s=u(r.properties,(function(e){return!e.isReference&&!e.isAttribute&&"Element"===e.type})))return s;throw le("unrecognized element <"+t.name+">")},ye.prototype.toString=function(){return"ElementDescriptor["+ce(this.type).name+"]"},ye.prototype.valueHandler=function(e,t){return new ge(e,t)},ye.prototype.referenceHandler=function(e){return new fe(e,this.context)},ye.prototype.handler=function(e){return"Element"===e?new we(this.model,e,this.context):new ye(this.model,e,this.context)},ye.prototype.handleChild=function(e){var t,n,i,r;if(t=this.getPropertyForNode(e),i=this.element,N(n=t.effectiveType||t.type))return this.valueHandler(t,i);var o=(r=t.isReference?this.referenceHandler(t).handleNode(e):this.handler(n).handleNode(e)).element;return void 0!==o&&(t.isMany?i.get(t.name).push(o):i.set(t.name,o),t.isReference?(k(o,{element:i}),this.context.addReference(o)):o.$parent=i),r},ve.prototype=Object.create(ye.prototype),ve.prototype.createElement=function(e){var t=e.name,n=q(t),i=this.model,r=this.type,o=i.getPackage(n.prefix),s=o&&ae(n,o)||t;if(!r.hasType(s))throw le("unexpected element <"+e.originalName+">");return ye.prototype.createElement.call(this,e)},we.prototype=Object.create(me.prototype),we.prototype.createElement=function(e){var t=e.name,n=q(t).prefix,i=e.ns[n+"$uri"],r=e.attributes;return this.model.createAny(t,i,r)},we.prototype.handleChild=function(e){var t=new we(this.model,"Element",this.context).handleNode(e),n=this.element,i=t.element;return void 0!==i&&((n.$children=n.$children||[]).push(i),i.$parent=n),t},we.prototype.handleEnd=function(){this.body&&(this.element.$body=this.body)},be.prototype.fromXML=function(e,t,n){var i=t.rootHandler;t instanceof ye?(i=t,t={}):"string"==typeof t?(i=this.handler(t),t={}):"string"==typeof i&&(i=this.handler(i));var r=this.model,o=this.lax,s=new he(k({},t,{rootHandler:i})),a=new ne({proxy:!0}),l=function(){var e=[];return Object.defineProperty(e,"peek",{value:function(){return this[this.length-1]}}),e}();function c(e,t,n){var i=t(),r=i.line,o=i.column,a=i.data;"<"===a.charAt(0)&&-1!==a.indexOf(" ")&&(a=a.slice(0,a.indexOf(" "))+">");var l="unparsable content "+(a?a+" ":"")+"detected\n\tline: "+r+"\n\tcolumn: "+o+"\n\tnested error: "+e.message;if(n)return s.addWarning({message:l,error:e}),!0;throw le(l)}function h(e,t){return c(e,t,!0)}i.context=s,l.push(i);var u=/^<\?xml /i,p=/ encoding="([^"]+)"/i,d=/^utf-8$/i;function f(e,t){try{l.peek().handleText(e)}catch(e){h(e,t)}}var g=r.getPackages().reduce((function(e,t){return e[t.uri]=t.prefix,e}),Object.entries(re).reduce((function(e,[t,n]){return e[n]=t,e}),r.config&&r.config.nsMap||{}));return a.ns(g).on("openTag",(function(e,t,n,i){var r=e.attrs||{},s=Object.keys(r).reduce((function(e,n){var i=t(r[n]);return e[n]=i,e}),{});!function(e,t){var n=l.peek();try{l.push(n.handleNode(e))}catch(e){c(e,t,o)&&l.push(new pe)}}({name:e.name,originalName:e.originalName,attributes:s,ns:e.ns},i)})).on("question",(function(e){if(u.test(e)){var t=p.exec(e),n=t&&t[1];n&&!d.test(n)&&s.addWarning({message:"unsupported document encoding <"+n+">, falling back to UTF-8"})}})).on("closeTag",(function(){l.pop().handleEnd()})).on("cdata",f).on("text",(function(e,t,n){!function(e,t){e.trim()&&f(e,t)}(t(e),n)})).on("error",c).on("warn",h),new Promise((function(t,n){var r;try{a.parse(e),function(){var e,t,n=s.elementsById,i=s.references;for(e=0;t=i[e];e++){var r=t.element,o=n[t.id],a=ce(r).propertiesByName[t.property];if(o||s.addWarning({message:"unresolved reference <"+t.id+">",element:t.element,property:t.property,value:t.id}),a.isMany){var l=r.get(a.name),c=l.indexOf(t);-1===c&&(c=l.length),o?l[c]=o:l.splice(c,1)}else r.set(a.name,o)}}()}catch(e){r=e}var o=i.element;r||o||(r=le("failed to parse document as <"+i.type.$descriptor.name+">"));var l=s.warnings,c=s.references,h=s.elementsById;return r?(r.warnings=l,n(r)):t({rootElement:o,elementsById:h,references:c,warnings:l})}))},be.prototype.handler=function(e){return new ve(this.model,e)};var xe=/<|>|'|"|&|\n\r|\n/g,ke=/<|>|&/g;function _e(e){this.prefixMap={},this.uriMap={},this.used={},this.wellknown=[],this.custom=[],this.parent=e,this.defaultPrefixMap=e&&e.defaultPrefixMap||{}}function Se(e,t){return ie(t)?function(e){return e.charAt(0).toLowerCase()+e.slice(1)}(e):e}function Ce(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}function Ee(e){return c(e)?e:(e.prefix?e.prefix+":":"")+e.localName}_e.prototype.mapDefaultPrefixes=function(e){this.defaultPrefixMap=e},_e.prototype.defaultUriByPrefix=function(e){return this.defaultPrefixMap[e]},_e.prototype.byUri=function(e){return this.uriMap[e]||this.parent&&this.parent.byUri(e)},_e.prototype.add=function(e,t){this.uriMap[e.uri]=e,t?this.wellknown.push(e):this.custom.push(e),this.mapPrefix(e.prefix,e.uri)},_e.prototype.uriByPrefix=function(e){return this.prefixMap[e||"xmlns"]||this.parent&&this.parent.uriByPrefix(e)},_e.prototype.mapPrefix=function(e,t){this.prefixMap[e||"xmlns"]=t},_e.prototype.getNSKey=function(e){return void 0!==e.prefix?e.uri+"|"+e.prefix:e.uri},_e.prototype.logUsed=function(e){var t=e.uri,n=this.getNSKey(e);this.used[n]=this.byUri(t),this.parent&&this.parent.logUsed(e)},_e.prototype.getUsed=function(e){return[].concat(this.wellknown,this.custom).filter((e=>{var t=this.getNSKey(e);return this.used[t]}))};var Me={"\n":"#10","\n\r":"#10",'"':"#34","'":"#39","<":"#60",">":"#62","&":"#38"},Ae={"<":"lt",">":"gt","&":"amp"};function Te(e,t,n){return(e=c(e)?e:""+e).replace(t,(function(e){return"&"+n[e]+";"}))}function Re(e){this.tagName=e}function De(){}function Oe(e){this.tagName=e}function Ne(e,t){this.body=[],this.attrs=[],this.parent=e,this.propertyDescriptor=t}function qe(e,t,n){Ne.call(this,e,t),this.serialization=n}function Be(){this.value="",this.write=function(e){this.value+=e}}function Pe(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 Ie(e){return e=k({format:!1,preamble:!0},e||{}),{toXML:function(t,n){var i=n||new Be,r=new Pe(i,e.format);e.preamble&&r.append('<?xml version="1.0" encoding="UTF-8"?>\n');var o=new Ne,s=t.$model;if(o.getNamespaces().mapDefaultPrefixes(function(e){const t=e.config&&e.config.nsMap||{},n={};for(const e in re)n[e]=re[e];for(const e in t){n[t[e]]=e}for(const t of e.getPackages())n[t.prefix]=t.uri;return n}(s)),o.build(t).serializeTo(r),!n)return i.value}}}function Le(e,t){V.call(this,e,t)}Re.prototype.build=function(e){return this.element=e,this},Re.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"+this.element.id+"</"+this.tagName+">").appendNewLine()},De.prototype.serializeValue=De.prototype.serializeTo=function(e){e.append(this.escape?Te(this.value,ke,Ae):this.value)},De.prototype.build=function(e,t){return this.value=t,"String"===e.type&&-1!==t.search(ke)&&(this.escape=!0),this},Ce(Oe,De),Oe.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"),this.serializeValue(e),e.append("</"+this.tagName+">").appendNewLine()},Ne.prototype.build=function(e){this.element=e;var t,n,i=e.$descriptor,r=this.propertyDescriptor,o=i.isGeneric;return t=o?this.parseGenericNsAttributes(e):this.parseNsAttributes(e),this.ns=r?this.nsPropertyTagName(r):this.nsTagName(i),this.tagName=this.addTagName(this.ns),o?this.parseGenericContainments(e):(n=function(e){return p(e.$descriptor.properties,(function(t){var n=t.name;if(t.isVirtual)return!1;if(!h(e,n))return!1;var i=e[n];return i!==t.default&&null!==i&&(!t.isMany||i.length)}))}(e),this.parseAttributes(p(n,(function(e){return e.isAttr}))),this.parseContainments(function(e){return p(e,(function(e){return!e.isAttr}))}(n))),this.parseGenericAttributes(e,t),this},Ne.prototype.nsTagName=function(e){return function(e,t){return t.isGeneric?k({localName:t.ns.localName},e):k({localName:Se(t.ns.localName,t.$pkg)},e)}(this.logNamespaceUsed(e.ns),e)},Ne.prototype.nsPropertyTagName=function(e){return function(e,t){return k({localName:t.ns.localName},e)}(this.logNamespaceUsed(e.ns),e)},Ne.prototype.isLocalNs=function(e){return e.uri===this.ns.uri},Ne.prototype.nsAttributeName=function(e){var t;if(t=c(e)?q(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}:k({localName:t.localName},n)},Ne.prototype.parseGenericNsAttributes=function(e){return Object.entries(e).filter((([t,n])=>!t.startsWith("$")&&this.parseNsAttribute(e,t,n))).map((([e,t])=>({name:e,value:t})))},Ne.prototype.parseGenericContainments=function(e){var t=e.$body;t&&this.body.push((new De).build({type:"String"},t));var n=e.$children;n&&d(n,(e=>{this.body.push(new Ne(this).build(e))}))},Ne.prototype.parseNsAttribute=function(e,t,n){var i,r=e.$model,o=q(t);if("xmlns"===o.prefix&&(i={prefix:o.localName,uri:n}),o.prefix||"xmlns"!==o.localName||(i={uri:n}),!i)return{name:t,value:n};if(r&&r.getPackage(n))this.logNamespace(i,!0,!0);else{var s=this.logNamespaceUsed(i,!0);this.getNamespaces().logUsed(s)}},Ne.prototype.parseNsAttributes=function(e){var t=this,n=e.$attrs,i=[];return d(n,(function(n,r){var o=t.parseNsAttribute(e,r,n);o&&i.push(o)})),i},Ne.prototype.parseGenericAttributes=function(e,t){var n=this;d(t,(function(t){try{n.addAttribute(n.nsAttributeName(t.name),t.value)}catch(n){"undefined"!=typeof console&&console.warn(`missing namespace information for <${t.name}=${t.value}> on`,e,n)}}))},Ne.prototype.parseContainments=function(e){var t=this,n=this.body,i=this.element;d(e,(function(e){var r=i.get(e.name),o=e.isReference;if(e.isMany||(r=[r]),e.isBody)n.push((new De).build(e,r[0]));else if(N(e.type))d(r,(function(i){n.push(new Oe(t.addTagName(t.nsPropertyTagName(e))).build(e,i))}));else if(o)d(r,(function(i){n.push(new Re(t.addTagName(t.nsPropertyTagName(e))).build(i))}));else{var s=se(e);d(r,(function(i){var r;r=s?s===oe?new Ne(t,e):new qe(t,e,s):new Ne(t),n.push(r.build(i))}))}}))},Ne.prototype.getNamespaces=function(e){var t,n=this.namespaces,i=this.parent;return n||(t=i&&i.getNamespaces(),e||!t?this.namespaces=n=new _e(t):n=t),n},Ne.prototype.logNamespace=function(e,t,n){var i=this.getNamespaces(n),r=e.uri,o=e.prefix;return i.byUri(r)&&!n||i.add(e,t),i.mapPrefix(o,r),e},Ne.prototype.logNamespaceUsed=function(e,t){var n,i,r,o=this.getNamespaces(t),s=e.prefix,a=e.uri;if(!s&&!a)return{localName:e.localName};if(r=o.defaultUriByPrefix(s),!(a=a||r||o.uriByPrefix(s)))throw new Error("no namespace uri given for prefix <"+s+">");if((e=o.byUri(a))||s||(e=this.logNamespace({uri:a},r===a,!0)),!e){for(n=s,i=1;o.uriByPrefix(n);)n=s+"_"+i++;e=this.logNamespace({prefix:n,uri:a},r===a)}return s&&o.mapPrefix(s,a),e},Ne.prototype.parseAttributes=function(e){var t=this,n=this.element;d(e,(function(e){var i=n.get(e.name);if(e.isReference)if(e.isMany){var r=[];d(i,(function(e){r.push(e.id)})),i=r.join(" ")}else i=i.id;t.addAttribute(t.nsAttributeName(e),i)}))},Ne.prototype.addTagName=function(e){var t=this.logNamespaceUsed(e);return this.getNamespaces().logUsed(t),Ee(e)},Ne.prototype.addAttribute=function(e,t){var n=this.attrs;c(t)&&(t=Te(t,xe,Me));var i=function(e,t){const n=y(t);let i=o(e)?-1:void 0;return d(e,(function(e,t){if(n(e,t))return i=t,!1})),i}(n,(function(t){return t.name.localName===e.localName&&t.name.uri===e.uri&&t.name.prefix===e.prefix})),r={name:e,value:t};-1!==i?n.splice(i,1,r):n.push(r)},Ne.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)),d(t,(function(t){e.append(" ").append(Ee(t.name)).append('="').append(t.value).append('"')}))},Ne.prototype.serializeTo=function(e){var t=this.body[0],n=t&&t.constructor!==De;e.appendIndent().append("<"+this.tagName),this.serializeAttributes(e),e.append(t?">":" />"),t&&(n&&e.appendNewLine().indent(),d(this.body,(function(t){t.serializeTo(e)})),n&&e.unindent().appendIndent(),e.append("</"+this.tagName+">")),e.appendNewLine()},Ce(qe,Ne),qe.prototype.parseNsAttributes=function(e){var t=Ne.prototype.parseNsAttributes.call(this,e).filter((e=>e.name!==this.serialization)),n=e.$descriptor;if(n.name===this.propertyDescriptor.type)return t;var i=this.typeNs=this.nsTagName(n);this.getNamespaces().logUsed(this.typeNs);var r=e.$model.getPackage(i.uri),o=r.xml&&r.xml.typePrefix||"";return this.addAttribute(this.nsAttributeName(this.serialization),(i.prefix?i.prefix+":":"")+o+n.ns.localName),t},qe.prototype.isLocalNs=function(e){return e.uri===(this.typeNs||this.ns).uri},Le.prototype=Object.create(V.prototype),Le.prototype.fromXML=function(e,t,n){c(t)||(n=t,t="dmn:Definitions");var i=new be(k({model:this,lax:!0},n)),r=i.handler(t);return i.fromXML(e,r)},Le.prototype.toXML=function(e,t){var n=new Ie(t);return new Promise((function(t,i){try{return t({xml:n.toXML(e)})}catch(e){return i(e)}}))};var Fe={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