Home
last modified time | relevance | path

Searched refs:serializeAttributes (Results 1 – 6 of 6) sorted by relevance

/plugin/bpmnio/vendor/bpmn-js/dist/
H A Dbpmn-viewer.production.min.js6 `,uc=/<|>|'|"|&|\n\r|\n/g,ha=/<|>|&/g;function ft(e){this.prefixMap={},this.uriMap={},this.used={},this.wellknown=[],this.custom=[],this.parent=e,this.defaultPrefixMap=e&&e.defaultPrefixMap||{}}ft.prototype.mapDefaultPrefixes=function(e){this.defaultPrefixMap=e};ft.prototype.defaultUriByPrefix=function(e){return this.defaultPrefixMap[e]};ft.prototype.byUri=function(e){return this.uriMap[e]||this.parent&&this.parent.byUri(e)};ft.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)};ft.prototype.uriByPrefix=function(e){return this.prefixMap[e||"xmlns"]||this.parent&&this.parent.uriByPrefix(e)};ft.prototype.mapPrefix=function(e,t){this.prefixMap[e||"xmlns"]=t};ft.prototype.getNSKey=function(e){return e.prefix!==void 0?e.uri+"|"+e.prefix:e.uri};ft.prototype.logUsed=function(e){var t=e.uri,n=this.getNSKey(e);this.used[n]=this.byUri(t),this.parent&&this.parent.logUsed(e)};ft.prototype.getUsed=function(e){var t=[].concat(this.wellknown,this.custom);return t.filter(n=>{var r=this.getNSKey(n);return this.used[r]})};function lc(e){return e.charAt(0).toLowerCase()+e.slice(1)}function cc(e,t){return la(t)?lc(e):e}function ma(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}function da(e){return De(e)?e:(e.prefix?e.prefix+":":"")+e.localName}function fc(e){return e.getUsed().filter(function(t){return t.prefix!=="xml"}).map(function(t){var n="xmlns"+(t.prefix?":"+t.prefix:"");return{name:n,value:t.uri}})}function pc(e,t){return t.isGeneric?M({localName:t.ns.localName},e):M({localName:cc(t.ns.localName,t.$pkg)},e)}function hc(e,t){return M({localName:t.ns.localName},e)}function mc(e){var t=e.$descriptor;return nt(t.properties,function(n){var r=n.name;if(n.isVirtual||!at(e,r))return!1;var i=e[r];return i===n.default||i===null?!1:n.isMany?i.length:!0})}var dc={"\n":"#10","\n\r":"#10",'"':"#34","'":"#39","<":"#60",">":"#62","&":"#38"},yc={"<":"lt",">":"gt","&":"amp"};function ya(e,t,n){return e=De(e)?e:""+e,e.replace(t,function(r){return"&"+n[r]+";"})}function gc(e){return ya(e,uc,dc)}function vc(e){return ya(e,ha,yc)}function Ec(e){return nt(e,function(t){return t.isAttr})}function bc(e){return nt(e,function(t){return!t.isAttr})}function Zr(e){this.tagName=e}Zr.prototype.build=function(e){return this.element=e,this};Zr.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"+this.element.id+"</"+this.tagName+">").appendNewLine()};function It(){}It.prototype.serializeValue=It.prototype.serializeTo=function(e){e.append(this.escape?vc(this.value):this.value)};It.prototype.build=function(e,t){return this.value=t,e.type==="String"&&t.search(ha)!==-1&&(this.escape=!0),this};function Qr(e){this.tagName=e}ma(Qr,It);Qr.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"),this.serializeValue(e),e.append("</"+this.tagName+">").appendNewLine()};function se(e,t){this.body=[],this.attrs=[],this.parent=e,this.propertyDescriptor=t}se.prototype.build=function(e){this.element=e;var t=e.$descriptor,n=this.propertyDescriptor,r,i,o=t.isGeneric;return o?r=this.parseGenericNsAttributes(e):r=this.parseNsAttributes(e),n?this.ns=this.nsPropertyTagName(n):this.ns=this.nsTagName(t),this.tagName=this.addTagName(this.ns),o?this.parseGenericContainments(e):(i=mc(e),this.parseAttributes(Ec(i)),this.parseContainments(bc(i))),this.parseGenericAttributes(e,r),this};se.prototype.nsTagName=function(e){var t=this.logNamespaceUsed(e.ns);return pc(t,e)};se.prototype.nsPropertyTagName=function(e){var t=this.logNamespaceUsed(e.ns);return hc(t,e)};se.prototype.isLocalNs=function(e){return e.uri===this.ns.uri};se.prototype.nsAttributeName=function(e){var t;if(De(e)?t=Re(e):t=e.ns,e.inherited)return{localName:t.localName};var n=this.logNamespaceUsed(t);return this.getNamespaces().logUsed(n),this.isLocalNs(n)?{localName:t.localName}:M({localName:t.localName},n)};se.prototype.parseGenericNsAttributes=function(e){return Object.entries(e).filter(([t,n])=>!t.startsWith("$")&&this.parseNsAttribute(e,t,n)).map(([t,n])=>({name:t,value:n}))};se.prototype.parseGenericContainments=function(e){var t=e.$body;t&&this.body.push(new It().build({type:"String"},t));var n=e.$children;n&&P(n,r=>{this.body.push(new se(this).build(r))})};se.prototype.parseNsAttribute=function(e,t,n){var r=e.$model,i=Re(t),o;if(i.prefix==="xmlns"&&(o={prefix:i.localName,uri:n}),!i.prefix&&i.localName==="xmlns"&&(o={uri:n}),!o)return{name:t,value:n};if(r&&r.getPackage(n))this.logNamespace(o,!0,!0);else{var a=this.logNamespaceUsed(o,!0);this.getNamespaces().logUsed(a)}};se.prototype.parseNsAttributes=function(e){var t=this,n=e.$attrs,r=[];return P(n,function(i,o){var a=t.parseNsAttribute(e,o,i);a&&r.push(a)}),r};se.prototype.parseGenericAttributes=function(e,t){var n=this;P(t,function(r){try{n.addAttribute(n.nsAttributeName(r.name),r.value)}catch(i){typeof console!="undefined"&&console.warn(`missing namespace information for <${r.name}=${r.value}> on`,e,i)}})};se.prototype.parseContainments=function(e){var t=this,n=this.body,r=this.element;P(e,function(i){var o=r.get(i.name),a=i.isReference,s=i.isMany;if(s||(o=[o]),i.isBody)n.push(new It().build(i,o[0]));else if(Hr(i.type))P(o,function(f){n.push(new Qr(t.addTagName(t.nsPropertyTagName(i))).build(i,f))});else if(a)P(o,function(f){n.push(new Zr(t.addTagName(t.nsPropertyTagName(i))).build(f))});else{var c=fa(i);P(o,function(f){var h;c?c===ca?h=new se(t,i):h=new ir(t,i,c):h=new se(t),n.push(h.build(f))})}})};se.prototype.getNamespaces=function(e){var t=this.namespaces,n=this.parent,r;return t||(r=n&&n.getNamespaces(),e||!r?this.namespaces=t=new ft(r):t=r),t};se.prototype.logNamespace=function(e,t,n){var r=this.getNamespaces(n),i=e.uri,o=e.prefix,a=r.byUri(i);return(!a||n)&&r.add(e,t),r.mapPrefix(o,i),e};se.prototype.logNamespaceUsed=function(e,t){var n=this.getNamespaces(t),r=e.prefix,i=e.uri,o,a,s;if(!r&&!i)return{localName:e.localName};if(s=n.defaultUriByPrefix(r),i=i||s||n.uriByPrefix(r),!i)throw new Error("no namespace uri given for prefix <"+r+">");if(e=n.byUri(i),!e&&!r&&(e=this.logNamespace({uri:i},s===i,!0)),!e){for(o=r,a=1;n.uriByPrefix(o);)o=r+"_"+a++;e=this.logNamespace({prefix:o,uri:i},s===i)}return r&&n.mapPrefix(r,i),e};se.prototype.parseAttributes=function(e){var t=this,n=this.element;P(e,function(r){var i=n.get(r.name);if(r.isReference)if(!r.isMany)i=i.id;else{var o=[];P(i,function(a){o.push(a.id)}),i=o.join(" ")}t.addAttribute(t.nsAttributeName(r),i)})};se.prototype.addTagName=function(e){var t=this.logNamespaceUsed(e);return this.getNamespaces().logUsed(t),da(e)};se.prototype.addAttribute=function(e,t){var n=this.attrs;De(t)&&(t=gc(t));var r=hr(n,function(o){return o.name.localName===e.localName&&o.name.uri===e.uri&&o.name.prefix===e.prefix}),i={name:e,value:t};r!==-1?n.splice(r,1,i):n.push(i)};se.prototype.serializeAttributes=function(e){var t=this.attrs,n=this.namespaces;n&&(t=fc(n).concat(t)),P(t,function(r){e.append(" ").append(da(r.name)).append('="').append(r.value).append('"')})};se.prototype.serializeTo=function(e){var t=this.body[0],n=t&&t.constructor!==It;e.appendIndent().append("<"+this.tagName),this.serializeAttributes(e),e.append(t?">":" />"),t&&(n&&e.appendNewLine().indent(),P(this.body,function(r){r.serializeTo(e)}),n&&e.unindent().appendIndent(),e.append("</"+this.tagName+">")),e.appendNewLine()};function ir(e,t,n){se.call(this,e,t),this.serialization=n}ma(ir,se);ir.prototype.parseNsAttributes=function(e){var t=se.prototype.parseNsAttributes.call(this,e).filter(a=>a.name!==this.serialization),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(this.serialization),(r.prefix?r.prefix+":":"")+o+n.ns.localName),t};ir.prototype.isLocalNs=function(e){return e.uri===(this.typeNs||this.ns).uri};function xc(){this.value="",this.write=function(e){this.value+=e}}function wc(e,t){var n=[""];this.append=function(r){return e.write(r),this},this.appendNewLine=function(){return t&&e.write(` method in oe
H A Dbpmn-modeler.production.min.js6 `,Bw=/<|>|'|"|&|\n\r|\n/g,oh=/<|>|&/g;function nr(e){this.prefixMap={},this.uriMap={},this.used={},this.wellknown=[],this.custom=[],this.parent=e,this.defaultPrefixMap=e&&e.defaultPrefixMap||{}}nr.prototype.mapDefaultPrefixes=function(e){this.defaultPrefixMap=e};nr.prototype.defaultUriByPrefix=function(e){return this.defaultPrefixMap[e]};nr.prototype.byUri=function(e){return this.uriMap[e]||this.parent&&this.parent.byUri(e)};nr.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)};nr.prototype.uriByPrefix=function(e){return this.prefixMap[e||"xmlns"]||this.parent&&this.parent.uriByPrefix(e)};nr.prototype.mapPrefix=function(e,t){this.prefixMap[e||"xmlns"]=t};nr.prototype.getNSKey=function(e){return e.prefix!==void 0?e.uri+"|"+e.prefix:e.uri};nr.prototype.logUsed=function(e){var t=e.uri,n=this.getNSKey(e);this.used[n]=this.byUri(t),this.parent&&this.parent.logUsed(e)};nr.prototype.getUsed=function(e){var t=[].concat(this.wellknown,this.custom);return t.filter(n=>{var r=this.getNSKey(n);return this.used[r]})};function Iw(e){return e.charAt(0).toLowerCase()+e.slice(1)}function Lw(e,t){return th(t)?Iw(e):e}function ah(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}function sh(e){return st(e)?e:(e.prefix?e.prefix+":":"")+e.localName}function jw(e){return e.getUsed().filter(function(t){return t.prefix!=="xml"}).map(function(t){var n="xmlns"+(t.prefix?":"+t.prefix:"");return{name:n,value:t.uri}})}function Fw(e,t){return t.isGeneric?C({localName:t.ns.localName},e):C({localName:Lw(t.ns.localName,t.$pkg)},e)}function Hw(e,t){return C({localName:t.ns.localName},e)}function $w(e){var t=e.$descriptor;return Q(t.properties,function(n){var r=n.name;if(n.isVirtual||!dt(e,r))return!1;var i=e[r];return i===n.default||i===null?!1:n.isMany?i.length:!0})}var zw={"\n":"#10","\n\r":"#10",'"':"#34","'":"#39","<":"#60",">":"#62","&":"#38"},Gw={"<":"lt",">":"gt","&":"amp"};function ch(e,t,n){return e=st(e)?e:""+e,e.replace(t,function(r){return"&"+n[r]+";"})}function Vw(e){return ch(e,Bw,zw)}function Ww(e){return ch(e,oh,Gw)}function Uw(e){return Q(e,function(t){return t.isAttr})}function qw(e){return Q(e,function(t){return!t.isAttr})}function ql(e){this.tagName=e}ql.prototype.build=function(e){return this.element=e,this};ql.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"+this.element.id+"</"+this.tagName+">").appendNewLine()};function Pi(){}Pi.prototype.serializeValue=Pi.prototype.serializeTo=function(e){e.append(this.escape?Ww(this.value):this.value)};Pi.prototype.build=function(e,t){return this.value=t,e.type==="String"&&t.search(oh)!==-1&&(this.escape=!0),this};function Kl(e){this.tagName=e}ah(Kl,Pi);Kl.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"),this.serializeValue(e),e.append("</"+this.tagName+">").appendNewLine()};function qe(e,t){this.body=[],this.attrs=[],this.parent=e,this.propertyDescriptor=t}qe.prototype.build=function(e){this.element=e;var t=e.$descriptor,n=this.propertyDescriptor,r,i,o=t.isGeneric;return o?r=this.parseGenericNsAttributes(e):r=this.parseNsAttributes(e),n?this.ns=this.nsPropertyTagName(n):this.ns=this.nsTagName(t),this.tagName=this.addTagName(this.ns),o?this.parseGenericContainments(e):(i=$w(e),this.parseAttributes(Uw(i)),this.parseContainments(qw(i))),this.parseGenericAttributes(e,r),this};qe.prototype.nsTagName=function(e){var t=this.logNamespaceUsed(e.ns);return Fw(t,e)};qe.prototype.nsPropertyTagName=function(e){var t=this.logNamespaceUsed(e.ns);return Hw(t,e)};qe.prototype.isLocalNs=function(e){return e.uri===this.ns.uri};qe.prototype.nsAttributeName=function(e){var t;if(st(e)?t=Tt(e):t=e.ns,e.inherited)return{localName:t.localName};var n=this.logNamespaceUsed(t);return this.getNamespaces().logUsed(n),this.isLocalNs(n)?{localName:t.localName}:C({localName:t.localName},n)};qe.prototype.parseGenericNsAttributes=function(e){return Object.entries(e).filter(([t,n])=>!t.startsWith("$")&&this.parseNsAttribute(e,t,n)).map(([t,n])=>({name:t,value:n}))};qe.prototype.parseGenericContainments=function(e){var t=e.$body;t&&this.body.push(new Pi().build({type:"String"},t));var n=e.$children;n&&E(n,r=>{this.body.push(new qe(this).build(r))})};qe.prototype.parseNsAttribute=function(e,t,n){var r=e.$model,i=Tt(t),o;if(i.prefix==="xmlns"&&(o={prefix:i.localName,uri:n}),!i.prefix&&i.localName==="xmlns"&&(o={uri:n}),!o)return{name:t,value:n};if(r&&r.getPackage(n))this.logNamespace(o,!0,!0);else{var a=this.logNamespaceUsed(o,!0);this.getNamespaces().logUsed(a)}};qe.prototype.parseNsAttributes=function(e){var t=this,n=e.$attrs,r=[];return E(n,function(i,o){var a=t.parseNsAttribute(e,o,i);a&&r.push(a)}),r};qe.prototype.parseGenericAttributes=function(e,t){var n=this;E(t,function(r){try{n.addAttribute(n.nsAttributeName(r.name),r.value)}catch(i){typeof console!="undefined"&&console.warn(`missing namespace information for <${r.name}=${r.value}> on`,e,i)}})};qe.prototype.parseContainments=function(e){var t=this,n=this.body,r=this.element;E(e,function(i){var o=r.get(i.name),a=i.isReference,s=i.isMany;if(s||(o=[o]),i.isBody)n.push(new Pi().build(i,o[0]));else if(Hl(i.type))E(o,function(u){n.push(new Kl(t.addTagName(t.nsPropertyTagName(i))).build(i,u))});else if(a)E(o,function(u){n.push(new ql(t.addTagName(t.nsPropertyTagName(i))).build(u))});else{var c=rh(i);E(o,function(u){var p;c?c===nh?p=new qe(t,i):p=new Dc(t,i,c):p=new qe(t),n.push(p.build(u))})}})};qe.prototype.getNamespaces=function(e){var t=this.namespaces,n=this.parent,r;return t||(r=n&&n.getNamespaces(),e||!r?this.namespaces=t=new nr(r):t=r),t};qe.prototype.logNamespace=function(e,t,n){var r=this.getNamespaces(n),i=e.uri,o=e.prefix,a=r.byUri(i);return(!a||n)&&r.add(e,t),r.mapPrefix(o,i),e};qe.prototype.logNamespaceUsed=function(e,t){var n=this.getNamespaces(t),r=e.prefix,i=e.uri,o,a,s;if(!r&&!i)return{localName:e.localName};if(s=n.defaultUriByPrefix(r),i=i||s||n.uriByPrefix(r),!i)throw new Error("no namespace uri given for prefix <"+r+">");if(e=n.byUri(i),!e&&!r&&(e=this.logNamespace({uri:i},s===i,!0)),!e){for(o=r,a=1;n.uriByPrefix(o);)o=r+"_"+a++;e=this.logNamespace({prefix:o,uri:i},s===i)}return r&&n.mapPrefix(r,i),e};qe.prototype.parseAttributes=function(e){var t=this,n=this.element;E(e,function(r){var i=n.get(r.name);if(r.isReference)if(!r.isMany)i=i.id;else{var o=[];E(i,function(a){o.push(a.id)}),i=o.join(" ")}t.addAttribute(t.nsAttributeName(r),i)})};qe.prototype.addTagName=function(e){var t=this.logNamespaceUsed(e);return this.getNamespaces().logUsed(t),sh(e)};qe.prototype.addAttribute=function(e,t){var n=this.attrs;st(t)&&(t=Vw(t));var r=Sa(n,function(o){return o.name.localName===e.localName&&o.name.uri===e.uri&&o.name.prefix===e.prefix}),i={name:e,value:t};r!==-1?n.splice(r,1,i):n.push(i)};qe.prototype.serializeAttributes=function(e){var t=this.attrs,n=this.namespaces;n&&(t=jw(n).concat(t)),E(t,function(r){e.append(" ").append(sh(r.name)).append('="').append(r.value).append('"')})};qe.prototype.serializeTo=function(e){var t=this.body[0],n=t&&t.constructor!==Pi;e.appendIndent().append("<"+this.tagName),this.serializeAttributes(e),e.append(t?">":" />"),t&&(n&&e.appendNewLine().indent(),E(this.body,function(r){r.serializeTo(e)}),n&&e.unindent().appendIndent(),e.append("</"+this.tagName+">")),e.appendNewLine()};function Dc(e,t,n){qe.call(this,e,t),this.serialization=n}ah(Dc,qe);Dc.prototype.parseNsAttributes=function(e){var t=qe.prototype.parseNsAttributes.call(this,e).filter(a=>a.name!==this.serialization),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(this.serialization),(r.prefix?r.prefix+":":"")+o+n.ns.localName),t};Dc.prototype.isLocalNs=function(e){return e.uri===(this.typeNs||this.ns).uri};function Kw(){this.value="",this.write=function(e){this.value+=e}}function Yw(e,t){var n=[""];this.append=function(r){return e.write(r),this},this.appendNewLine=function(){return t&&e.write(` method in $e
/plugin/bpmnio/vendor/dmn-js/dist/
H A Ddmn-viewer.production.min.js12 `,Zb=/<|>|'|"|&|\n\r|\n/g,ap=/<|>|&/g;function nn(n){this.prefixMap={},this.uriMap={},this.used={},this.wellknown=[],this.custom=[],this.parent=n,this.defaultPrefixMap=n&&n.defaultPrefixMap||{}}nn.prototype.mapDefaultPrefixes=function(n){this.defaultPrefixMap=n};nn.prototype.defaultUriByPrefix=function(n){return this.defaultPrefixMap[n]};nn.prototype.byUri=function(n){return this.uriMap[n]||this.parent&&this.parent.byUri(n)};nn.prototype.add=function(n,e){this.uriMap[n.uri]=n,e?this.wellknown.push(n):this.custom.push(n),this.mapPrefix(n.prefix,n.uri)};nn.prototype.uriByPrefix=function(n){return this.prefixMap[n||"xmlns"]||this.parent&&this.parent.uriByPrefix(n)};nn.prototype.mapPrefix=function(n,e){this.prefixMap[n||"xmlns"]=e};nn.prototype.getNSKey=function(n){return n.prefix!==void 0?n.uri+"|"+n.prefix:n.uri};nn.prototype.logUsed=function(n){var e=n.uri,t=this.getNSKey(n);this.used[t]=this.byUri(e),this.parent&&this.parent.logUsed(n)};nn.prototype.getUsed=function(n){var e=[].concat(this.wellknown,this.custom);return e.filter(t=>{var i=this.getNSKey(t);return this.used[i]})};function e1(n){return n.charAt(0).toLowerCase()+n.slice(1)}function t1(n,e){return ip(e)?e1(n):n}function lp(n,e){n.super_=e,n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}})}function cp(n){return tt(n)?n:(n.prefix?n.prefix+":":"")+n.localName}function n1(n){return n.getUsed().filter(function(e){return e.prefix!=="xml"}).map(function(e){var t="xmlns"+(e.prefix?":"+e.prefix:"");return{name:t,value:e.uri}})}function i1(n,e){return e.isGeneric?D({localName:e.ns.localName},n):D({localName:t1(e.ns.localName,e.$pkg)},n)}function r1(n,e){return D({localName:e.ns.localName},n)}function s1(n){var e=n.$descriptor;return Qn(e.properties,function(t){var i=t.name;if(t.isVirtual||!Ss(n,i))return!1;var r=n[i];return r===t.default||r===null?!1:t.isMany?r.length:!0})}var o1={"\n":"#10","\n\r":"#10",'"':"#34","'":"#39","<":"#60",">":"#62","&":"#38"},a1={"<":"lt",">":"gt","&":"amp"};function up(n,e,t){return n=tt(n)?n:""+n,n.replace(e,function(i){return"&"+t[i]+";"})}function l1(n){return up(n,Zb,o1)}function c1(n){return up(n,ap,a1)}function u1(n){return Qn(n,function(e){return e.isAttr})}function f1(n){return Qn(n,function(e){return!e.isAttr})}function $c(n){this.tagName=n}$c.prototype.build=function(n){return this.element=n,this};$c.prototype.serializeTo=function(n){n.appendIndent().append("<"+this.tagName+">"+this.element.id+"</"+this.tagName+">").appendNewLine()};function gi(){}gi.prototype.serializeValue=gi.prototype.serializeTo=function(n){n.append(this.escape?c1(this.value):this.value)};gi.prototype.build=function(n,e){return this.value=e,n.type==="String"&&e.search(ap)!==-1&&(this.escape=!0),this};function Lc(n){this.tagName=n}lp(Lc,gi);Lc.prototype.serializeTo=function(n){n.appendIndent().append("<"+this.tagName+">"),this.serializeValue(n),n.append("</"+this.tagName+">").appendNewLine()};function ae(n,e){this.body=[],this.attrs=[],this.parent=n,this.propertyDescriptor=e}ae.prototype.build=function(n){this.element=n;var e=n.$descriptor,t=this.propertyDescriptor,i,r,s=e.isGeneric;return s?i=this.parseGenericNsAttributes(n):i=this.parseNsAttributes(n),t?this.ns=this.nsPropertyTagName(t):this.ns=this.nsTagName(e),this.tagName=this.addTagName(this.ns),s?this.parseGenericContainments(n):(r=s1(n),this.parseAttributes(u1(r)),this.parseContainments(f1(r))),this.parseGenericAttributes(n,i),this};ae.prototype.nsTagName=function(n){var e=this.logNamespaceUsed(n.ns);return i1(e,n)};ae.prototype.nsPropertyTagName=function(n){var e=this.logNamespaceUsed(n.ns);return r1(e,n)};ae.prototype.isLocalNs=function(n){return n.uri===this.ns.uri};ae.prototype.nsAttributeName=function(n){var e;if(tt(n)?e=Te(n):e=n.ns,n.inherited)return{localName:e.localName};var t=this.logNamespaceUsed(e);return this.getNamespaces().logUsed(t),this.isLocalNs(t)?{localName:e.localName}:D({localName:e.localName},t)};ae.prototype.parseGenericNsAttributes=function(n){return Object.entries(n).filter(([e,t])=>!e.startsWith("$")&&this.parseNsAttribute(n,e,t)).map(([e,t])=>({name:e,value:t}))};ae.prototype.parseGenericContainments=function(n){var e=n.$body;e&&this.body.push(new gi().build({type:"String"},e));var t=n.$children;t&&B(t,i=>{this.body.push(new ae(this).build(i))})};ae.prototype.parseNsAttribute=function(n,e,t){var i=n.$model,r=Te(e),s;if(r.prefix==="xmlns"&&(s={prefix:r.localName,uri:t}),!r.prefix&&r.localName==="xmlns"&&(s={uri:t}),!s)return{name:e,value:t};if(i&&i.getPackage(t))this.logNamespace(s,!0,!0);else{var o=this.logNamespaceUsed(s,!0);this.getNamespaces().logUsed(o)}};ae.prototype.parseNsAttributes=function(n){var e=this,t=n.$attrs,i=[];return B(t,function(r,s){var o=e.parseNsAttribute(n,s,r);o&&i.push(o)}),i};ae.prototype.parseGenericAttributes=function(n,e){var t=this;B(e,function(i){try{t.addAttribute(t.nsAttributeName(i.name),i.value)}catch(r){typeof console!="undefined"&&console.warn(`missing namespace information for <${i.name}=${i.value}> on`,n,r)}})};ae.prototype.parseContainments=function(n){var e=this,t=this.body,i=this.element;B(n,function(r){var s=i.get(r.name),o=r.isReference,a=r.isMany;if(a||(s=[s]),r.isBody)t.push(new gi().build(r,s[0]));else if(Tc(r.type))B(s,function(c){t.push(new Lc(e.addTagName(e.nsPropertyTagName(r))).build(r,c))});else if(o)B(s,function(c){t.push(new $c(e.addTagName(e.nsPropertyTagName(r))).build(c))});else{var l=sp(r);B(s,function(c){var u;l?l===rp?u=new ae(e,r):u=new va(e,r,l):u=new ae(e),t.push(u.build(c))})}})};ae.prototype.getNamespaces=function(n){var e=this.namespaces,t=this.parent,i;return e||(i=t&&t.getNamespaces(),n||!i?this.namespaces=e=new nn(i):e=i),e};ae.prototype.logNamespace=function(n,e,t){var i=this.getNamespaces(t),r=n.uri,s=n.prefix,o=i.byUri(r);return(!o||t)&&i.add(n,e),i.mapPrefix(s,r),n};ae.prototype.logNamespaceUsed=function(n,e){var t=this.getNamespaces(e),i=n.prefix,r=n.uri,s,o,a;if(!i&&!r)return{localName:n.localName};if(a=t.defaultUriByPrefix(i),r=r||a||t.uriByPrefix(i),!r)throw new Error("no namespace uri given for prefix <"+i+">");if(n=t.byUri(r),!n&&!i&&(n=this.logNamespace({uri:r},a===r,!0)),!n){for(s=i,o=1;t.uriByPrefix(s);)s=i+"_"+o++;n=this.logNamespace({prefix:s,uri:r},a===r)}return i&&t.mapPrefix(i,r),n};ae.prototype.parseAttributes=function(n){var e=this,t=this.element;B(n,function(i){var r=t.get(i.name);if(i.isReference)if(!i.isMany)r=r.id;else{var s=[];B(r,function(o){s.push(o.id)}),r=s.join(" ")}e.addAttribute(e.nsAttributeName(i),r)})};ae.prototype.addTagName=function(n){var e=this.logNamespaceUsed(n);return this.getNamespaces().logUsed(e),cp(n)};ae.prototype.addAttribute=function(n,e){var t=this.attrs;tt(e)&&(e=l1(e));var i=Qd(t,function(s){return s.name.localName===n.localName&&s.name.uri===n.uri&&s.name.prefix===n.prefix}),r={name:n,value:e};i!==-1?t.splice(i,1,r):t.push(r)};ae.prototype.serializeAttributes=function(n){var e=this.attrs,t=this.namespaces;t&&(e=n1(t).concat(e)),B(e,function(i){n.append(" ").append(cp(i.name)).append('="').append(i.value).append('"')})};ae.prototype.serializeTo=function(n){var e=this.body[0],t=e&&e.constructor!==gi;n.appendIndent().append("<"+this.tagName),this.serializeAttributes(n),n.append(e?">":" />"),e&&(t&&n.appendNewLine().indent(),B(this.body,function(i){i.serializeTo(n)}),t&&n.unindent().appendIndent(),n.append("</"+this.tagName+">")),n.appendNewLine()};function va(n,e,t){ae.call(this,n,e),this.serialization=t}lp(va,ae);va.prototype.parseNsAttributes=function(n){var e=ae.prototype.parseNsAttributes.call(this,n).filter(o=>o.name!==this.serialization),t=n.$descriptor;if(t.name===this.propertyDescriptor.type)return e;var i=this.typeNs=this.nsTagName(t);this.getNamespaces().logUsed(this.typeNs);var r=n.$model.getPackage(i.uri),s=r.xml&&r.xml.typePrefix||"";return this.addAttribute(this.nsAttributeName(this.serialization),(i.prefix?i.prefix+":":"")+s+t.ns.localName),e};va.prototype.isLocalNs=function(n){return n.uri===(this.typeNs||this.ns).uri};function h1(){this.value="",this.write=function(n){this.value+=n}}function d1(n,e){var t=[""];this.append=function(i){return n.write(i),this},this.appendNewLine=function(){return e&&n.write(` method in ae
H A Ddmn-modeler.production.min.js12 `,pI=/<|>|'|"|&|\n\r|\n/g,Zw=/<|>|&/g;function Pi(n){this.prefixMap={},this.uriMap={},this.used={},this.wellknown=[],this.custom=[],this.parent=n,this.defaultPrefixMap=n&&n.defaultPrefixMap||{}}Pi.prototype.mapDefaultPrefixes=function(n){this.defaultPrefixMap=n};Pi.prototype.defaultUriByPrefix=function(n){return this.defaultPrefixMap[n]};Pi.prototype.byUri=function(n){return this.uriMap[n]||this.parent&&this.parent.byUri(n)};Pi.prototype.add=function(n,e){this.uriMap[n.uri]=n,e?this.wellknown.push(n):this.custom.push(n),this.mapPrefix(n.prefix,n.uri)};Pi.prototype.uriByPrefix=function(n){return this.prefixMap[n||"xmlns"]||this.parent&&this.parent.uriByPrefix(n)};Pi.prototype.mapPrefix=function(n,e){this.prefixMap[n||"xmlns"]=e};Pi.prototype.getNSKey=function(n){return n.prefix!==void 0?n.uri+"|"+n.prefix:n.uri};Pi.prototype.logUsed=function(n){var e=n.uri,t=this.getNSKey(n);this.used[t]=this.byUri(e),this.parent&&this.parent.logUsed(n)};Pi.prototype.getUsed=function(n){var e=[].concat(this.wellknown,this.custom);return e.filter(t=>{var i=this.getNSKey(t);return this.used[i]})};function mI(n){return n.charAt(0).toLowerCase()+n.slice(1)}function gI(n,e){return Kw(e)?mI(n):n}function Jw(n,e){n.super_=e,n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}})}function e1(n){return Ie(n)?n:(n.prefix?n.prefix+":":"")+n.localName}function yI(n){return n.getUsed().filter(function(e){return e.prefix!=="xml"}).map(function(e){var t="xmlns"+(e.prefix?":"+e.prefix:"");return{name:t,value:e.uri}})}function vI(n,e){return e.isGeneric?T({localName:e.ns.localName},n):T({localName:gI(e.ns.localName,e.$pkg)},n)}function xI(n,e){return T({localName:e.ns.localName},n)}function bI(n){var e=n.$descriptor;return Ee(e.properties,function(t){var i=t.name;if(t.isVirtual||!Zr(n,i))return!1;var r=n[i];return r===t.default||r===null?!1:t.isMany?r.length:!0})}var _I={"\n":"#10","\n\r":"#10",'"':"#34","'":"#39","<":"#60",">":"#62","&":"#38"},wI={"<":"lt",">":"gt","&":"amp"};function t1(n,e,t){return n=Ie(n)?n:""+n,n.replace(e,function(i){return"&"+t[i]+";"})}function CI(n){return t1(n,pI,_I)}function EI(n){return t1(n,Zw,wI)}function SI(n){return Ee(n,function(e){return e.isAttr})}function OI(n){return Ee(n,function(e){return!e.isAttr})}function av(n){this.tagName=n}av.prototype.build=function(n){return this.element=n,this};av.prototype.serializeTo=function(n){n.appendIndent().append("<"+this.tagName+">"+this.element.id+"</"+this.tagName+">").appendNewLine()};function ns(){}ns.prototype.serializeValue=ns.prototype.serializeTo=function(n){n.append(this.escape?EI(this.value):this.value)};ns.prototype.build=function(n,e){return this.value=e,n.type==="String"&&e.search(Zw)!==-1&&(this.escape=!0),this};function lv(n){this.tagName=n}Jw(lv,ns);lv.prototype.serializeTo=function(n){n.appendIndent().append("<"+this.tagName+">"),this.serializeValue(n),n.append("</"+this.tagName+">").appendNewLine()};function je(n,e){this.body=[],this.attrs=[],this.parent=n,this.propertyDescriptor=e}je.prototype.build=function(n){this.element=n;var e=n.$descriptor,t=this.propertyDescriptor,i,r,o=e.isGeneric;return o?i=this.parseGenericNsAttributes(n):i=this.parseNsAttributes(n),t?this.ns=this.nsPropertyTagName(t):this.ns=this.nsTagName(e),this.tagName=this.addTagName(this.ns),o?this.parseGenericContainments(n):(r=bI(n),this.parseAttributes(SI(r)),this.parseContainments(OI(r))),this.parseGenericAttributes(n,i),this};je.prototype.nsTagName=function(n){var e=this.logNamespaceUsed(n.ns);return vI(e,n)};je.prototype.nsPropertyTagName=function(n){var e=this.logNamespaceUsed(n.ns);return xI(e,n)};je.prototype.isLocalNs=function(n){return n.uri===this.ns.uri};je.prototype.nsAttributeName=function(n){var e;if(Ie(n)?e=Rt(n):e=n.ns,n.inherited)return{localName:e.localName};var t=this.logNamespaceUsed(e);return this.getNamespaces().logUsed(t),this.isLocalNs(t)?{localName:e.localName}:T({localName:e.localName},t)};je.prototype.parseGenericNsAttributes=function(n){return Object.entries(n).filter(([e,t])=>!e.startsWith("$")&&this.parseNsAttribute(n,e,t)).map(([e,t])=>({name:e,value:t}))};je.prototype.parseGenericContainments=function(n){var e=n.$body;e&&this.body.push(new ns().build({type:"String"},e));var t=n.$children;t&&k(t,i=>{this.body.push(new je(this).build(i))})};je.prototype.parseNsAttribute=function(n,e,t){var i=n.$model,r=Rt(e),o;if(r.prefix==="xmlns"&&(o={prefix:r.localName,uri:t}),!r.prefix&&r.localName==="xmlns"&&(o={uri:t}),!o)return{name:e,value:t};if(i&&i.getPackage(t))this.logNamespace(o,!0,!0);else{var s=this.logNamespaceUsed(o,!0);this.getNamespaces().logUsed(s)}};je.prototype.parseNsAttributes=function(n){var e=this,t=n.$attrs,i=[];return k(t,function(r,o){var s=e.parseNsAttribute(n,o,r);s&&i.push(s)}),i};je.prototype.parseGenericAttributes=function(n,e){var t=this;k(e,function(i){try{t.addAttribute(t.nsAttributeName(i.name),i.value)}catch(r){typeof console!="undefined"&&console.warn(`missing namespace information for <${i.name}=${i.value}> on`,n,r)}})};je.prototype.parseContainments=function(n){var e=this,t=this.body,i=this.element;k(n,function(r){var o=i.get(r.name),s=r.isReference,a=r.isMany;if(a||(o=[o]),r.isBody)t.push(new ns().build(r,o[0]));else if(ev(r.type))k(o,function(c){t.push(new lv(e.addTagName(e.nsPropertyTagName(r))).build(r,c))});else if(s)k(o,function(c){t.push(new av(e.addTagName(e.nsPropertyTagName(r))).build(c))});else{var l=Xw(r);k(o,function(c){var u;l?l===Gw?u=new je(e,r):u=new Xd(e,r,l):u=new je(e),t.push(u.build(c))})}})};je.prototype.getNamespaces=function(n){var e=this.namespaces,t=this.parent,i;return e||(i=t&&t.getNamespaces(),n||!i?this.namespaces=e=new Pi(i):e=i),e};je.prototype.logNamespace=function(n,e,t){var i=this.getNamespaces(t),r=n.uri,o=n.prefix,s=i.byUri(r);return(!s||t)&&i.add(n,e),i.mapPrefix(o,r),n};je.prototype.logNamespaceUsed=function(n,e){var t=this.getNamespaces(e),i=n.prefix,r=n.uri,o,s,a;if(!i&&!r)return{localName:n.localName};if(a=t.defaultUriByPrefix(i),r=r||a||t.uriByPrefix(i),!r)throw new Error("no namespace uri given for prefix <"+i+">");if(n=t.byUri(r),!n&&!i&&(n=this.logNamespace({uri:r},a===r,!0)),!n){for(o=i,s=1;t.uriByPrefix(o);)o=i+"_"+s++;n=this.logNamespace({prefix:o,uri:r},a===r)}return i&&t.mapPrefix(i,r),n};je.prototype.parseAttributes=function(n){var e=this,t=this.element;k(n,function(i){var r=t.get(i.name);if(i.isReference)if(!i.isMany)r=r.id;else{var o=[];k(r,function(s){o.push(s.id)}),r=o.join(" ")}e.addAttribute(e.nsAttributeName(i),r)})};je.prototype.addTagName=function(n){var e=this.logNamespaceUsed(n);return this.getNamespaces().logUsed(e),e1(n)};je.prototype.addAttribute=function(n,e){var t=this.attrs;Ie(e)&&(e=CI(e));var i=Iw(t,function(o){return o.name.localName===n.localName&&o.name.uri===n.uri&&o.name.prefix===n.prefix}),r={name:n,value:e};i!==-1?t.splice(i,1,r):t.push(r)};je.prototype.serializeAttributes=function(n){var e=this.attrs,t=this.namespaces;t&&(e=yI(t).concat(e)),k(e,function(i){n.append(" ").append(e1(i.name)).append('="').append(i.value).append('"')})};je.prototype.serializeTo=function(n){var e=this.body[0],t=e&&e.constructor!==ns;n.appendIndent().append("<"+this.tagName),this.serializeAttributes(n),n.append(e?">":" />"),e&&(t&&n.appendNewLine().indent(),k(this.body,function(i){i.serializeTo(n)}),t&&n.unindent().appendIndent(),n.append("</"+this.tagName+">")),n.appendNewLine()};function Xd(n,e,t){je.call(this,n,e),this.serialization=t}Jw(Xd,je);Xd.prototype.parseNsAttributes=function(n){var e=je.prototype.parseNsAttributes.call(this,n).filter(s=>s.name!==this.serialization),t=n.$descriptor;if(t.name===this.propertyDescriptor.type)return e;var i=this.typeNs=this.nsTagName(t);this.getNamespaces().logUsed(this.typeNs);var r=n.$model.getPackage(i.uri),o=r.xml&&r.xml.typePrefix||"";return this.addAttribute(this.nsAttributeName(this.serialization),(i.prefix?i.prefix+":":"")+o+t.ns.localName),e};Xd.prototype.isLocalNs=function(n){return n.uri===(this.typeNs||this.ns).uri};function kI(){this.value="",this.write=function(n){this.value+=n}}function RI(n,e){var t=[""];this.append=function(i){return n.write(i),this},this.appendNewLine=function(){return e&&n.write(` method in Be
[all...]
/plugin/bpmnioeditor/vendor/bpmnio-js/
Dbpmn-modeler.production.min.js7serializeAttributes=function(e){var t=this.attrs,n=this.namespaces;n&&(t=function(e){return e.getU… method in or
Dbpmn-modeler.development.js11026 ElementSerializer.prototype.serializeAttributes = function(writer) {
11049 this.serializeAttributes(writer);