From d91ed79d41472e77d295b9d9b5a79b79069a9ff7 Mon Sep 17 00:00:00 2001 From: Dusan Figala Date: Tue, 20 Feb 2024 16:17:36 +0100 Subject: [PATCH] Check dep tree has deps key --- dist/index.js | 2 +- src/tree.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/index.js b/dist/index.js index 56203f9..b766156 100644 --- a/dist/index.js +++ b/dist/index.js @@ -25,7 +25,7 @@ e.exports=i(3765)},3583:(e,t,i)=>{"use strict"; * * MIT Licensed */ -const a=i(7147);const r=i(2037);const n=i(1017);const s=i(6113);const o={fs:a.constants,os:r.constants};const p=i(4959);const l="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",c=/XXXXXX/,d=3,u=(o.O_CREAT||o.fs.O_CREAT)|(o.O_EXCL||o.fs.O_EXCL)|(o.O_RDWR||o.fs.O_RDWR),m=r.platform()==="win32",h=o.EBADF||o.os.errno.EBADF,g=o.ENOENT||o.os.errno.ENOENT,y=448,v=384,b="exit",x=[],w=a.rmdirSync.bind(a),S=p.sync;let N=false;function tmpName(e,t){const i=_parseArguments(e,t),r=i[0],n=i[1];try{_assertAndSanitizeOptions(r)}catch(e){return n(e)}let s=r.tries;(function _getUniqueName(){try{const e=_generateTmpName(r);a.stat(e,(function(t){if(!t){if(s-- >0)return _getUniqueName();return n(new Error("Could not get a unique tmp filename, max tries reached "+e))}n(null,e)}))}catch(e){n(e)}})()}function tmpNameSync(e){const t=_parseArguments(e),i=t[0];_assertAndSanitizeOptions(i);let r=i.tries;do{const e=_generateTmpName(i);try{a.statSync(e)}catch(t){return e}}while(r-- >0);throw new Error("Could not get a unique tmp filename, max tries reached")}function file(e,t){const i=_parseArguments(e,t),r=i[0],n=i[1];tmpName(r,(function _tmpNameCreated(e,t){if(e)return n(e);a.open(t,u,r.mode||v,(function _fileCreated(e,i){if(e)return n(e);if(r.discardDescriptor){return a.close(i,(function _discardCallback(e){return n(e,t,undefined,_prepareTmpFileRemoveCallback(t,-1,r,false))}))}else{const e=r.discardDescriptor||r.detachDescriptor;n(null,t,i,_prepareTmpFileRemoveCallback(t,e?-1:i,r,false))}}))}))}function fileSync(e){const t=_parseArguments(e),i=t[0];const r=i.discardDescriptor||i.detachDescriptor;const n=tmpNameSync(i);var s=a.openSync(n,u,i.mode||v);if(i.discardDescriptor){a.closeSync(s);s=undefined}return{name:n,fd:s,removeCallback:_prepareTmpFileRemoveCallback(n,r?-1:s,i,true)}}function dir(e,t){const i=_parseArguments(e,t),r=i[0],n=i[1];tmpName(r,(function _tmpNameCreated(e,t){if(e)return n(e);a.mkdir(t,r.mode||y,(function _dirCreated(e){if(e)return n(e);n(null,t,_prepareTmpDirRemoveCallback(t,r,false))}))}))}function dirSync(e){const t=_parseArguments(e),i=t[0];const r=tmpNameSync(i);a.mkdirSync(r,i.mode||y);return{name:r,removeCallback:_prepareTmpDirRemoveCallback(r,i,true)}}function _removeFileAsync(e,t){const _handler=function(e){if(e&&!_isENOENT(e)){return t(e)}t()};if(0<=e[0])a.close(e[0],(function(){a.unlink(e[1],_handler)}));else a.unlink(e[1],_handler)}function _removeFileSync(e){let t=null;try{if(0<=e[0])a.closeSync(e[0])}catch(e){if(!_isEBADF(e)&&!_isENOENT(e))throw e}finally{try{a.unlinkSync(e[1])}catch(e){if(!_isENOENT(e))t=e}}if(t!==null){throw t}}function _prepareTmpFileRemoveCallback(e,t,i,a){const r=_prepareRemoveCallback(_removeFileSync,[t,e],a);const n=_prepareRemoveCallback(_removeFileAsync,[t,e],a,r);if(!i.keep)x.unshift(r);return a?r:n}function _prepareTmpDirRemoveCallback(e,t,i){const r=t.unsafeCleanup?p:a.rmdir.bind(a);const n=t.unsafeCleanup?S:w;const s=_prepareRemoveCallback(n,e,i);const o=_prepareRemoveCallback(r,e,i,s);if(!t.keep)x.unshift(s);return i?s:o}function _prepareRemoveCallback(e,t,i,a){let r=false;return function _cleanupCallback(n){if(!r){const s=a||_cleanupCallback;const o=x.indexOf(s);if(o>=0)x.splice(o,1);r=true;if(i||e===w||e===S){return e(t)}else{return e(t,n||function(){})}}}}function _garbageCollector(){if(!N)return;while(x.length){try{x[0]()}catch(e){}}}function _randomChars(e){let t=[],i=null;try{i=s.randomBytes(e)}catch(t){i=s.pseudoRandomBytes(e)}for(var a=0;a{e.exports=i(4219)},4219:(e,t,i)=>{"use strict";var a=i(1808);var r=i(4404);var n=i(3685);var s=i(5687);var o=i(2361);var p=i(9491);var l=i(3837);t.httpOverHttp=httpOverHttp;t.httpsOverHttp=httpsOverHttp;t.httpOverHttps=httpOverHttps;t.httpsOverHttps=httpsOverHttps;function httpOverHttp(e){var t=new TunnelingAgent(e);t.request=n.request;return t}function httpsOverHttp(e){var t=new TunnelingAgent(e);t.request=n.request;t.createSocket=createSecureSocket;t.defaultPort=443;return t}function httpOverHttps(e){var t=new TunnelingAgent(e);t.request=s.request;return t}function httpsOverHttps(e){var t=new TunnelingAgent(e);t.request=s.request;t.createSocket=createSecureSocket;t.defaultPort=443;return t}function TunnelingAgent(e){var t=this;t.options=e||{};t.proxyOptions=t.options.proxy||{};t.maxSockets=t.options.maxSockets||n.Agent.defaultMaxSockets;t.requests=[];t.sockets=[];t.on("free",(function onFree(e,i,a,r){var n=toOptions(i,a,r);for(var s=0,o=t.requests.length;s=this.maxSockets){r.requests.push(n);return}r.createSocket(n,(function(t){t.on("free",onFree);t.on("close",onCloseOrRemove);t.on("agentRemove",onCloseOrRemove);e.onSocket(t);function onFree(){r.emit("free",t,n)}function onCloseOrRemove(e){r.removeSocket(t);t.removeListener("free",onFree);t.removeListener("close",onCloseOrRemove);t.removeListener("agentRemove",onCloseOrRemove)}}))};TunnelingAgent.prototype.createSocket=function createSocket(e,t){var i=this;var a={};i.sockets.push(a);var r=mergeOptions({},i.proxyOptions,{method:"CONNECT",path:e.host+":"+e.port,agent:false,headers:{host:e.host+":"+e.port}});if(e.localAddress){r.localAddress=e.localAddress}if(r.proxyAuth){r.headers=r.headers||{};r.headers["Proxy-Authorization"]="Basic "+new Buffer(r.proxyAuth).toString("base64")}c("making CONNECT request");var n=i.request(r);n.useChunkedEncodingByDefault=false;n.once("response",onResponse);n.once("upgrade",onUpgrade);n.once("connect",onConnect);n.once("error",onError);n.end();function onResponse(e){e.upgrade=true}function onUpgrade(e,t,i){process.nextTick((function(){onConnect(e,t,i)}))}function onConnect(r,s,o){n.removeAllListeners();s.removeAllListeners();if(r.statusCode!==200){c("tunneling socket could not be established, statusCode=%d",r.statusCode);s.destroy();var p=new Error("tunneling socket could not be established, "+"statusCode="+r.statusCode);p.code="ECONNRESET";e.request.emit("error",p);i.removeSocket(a);return}if(o.length>0){c("got illegal response body from proxy");s.destroy();var p=new Error("got illegal response body from proxy");p.code="ECONNRESET";e.request.emit("error",p);i.removeSocket(a);return}c("tunneling connection has established");i.sockets[i.sockets.indexOf(a)]=s;return t(s)}function onError(t){n.removeAllListeners();c("tunneling socket could not be established, cause=%s\n",t.message,t.stack);var r=new Error("tunneling socket could not be established, "+"cause="+t.message);r.code="ECONNRESET";e.request.emit("error",r);i.removeSocket(a)}};TunnelingAgent.prototype.removeSocket=function removeSocket(e){var t=this.sockets.indexOf(e);if(t===-1){return}this.sockets.splice(t,1);var i=this.requests.shift();if(i){this.createSocket(i,(function(e){i.request.onSocket(e)}))}};function createSecureSocket(e,t){var i=this;TunnelingAgent.prototype.createSocket.call(i,e,(function(a){var n=e.request.getHeader("host");var s=mergeOptions({},i.options,{socket:a,servername:n?n.replace(/:.*$/,""):e.host});var o=r.connect(0,s);i.sockets[i.sockets.indexOf(a)]=o;t(o)}))}function toOptions(e,t,i){if(typeof e==="string"){return{host:e,port:t,localAddress:i}}return e}function mergeOptions(e){for(var t=1,i=arguments.length;t{"use strict";Object.defineProperty(t,"__esModule",{value:true});function getUserAgent(){if(typeof navigator==="object"&&"userAgent"in navigator){return navigator.userAgent}if(typeof process==="object"&&"version"in process){return`Node.js/${process.version.substr(1)} (${process.platform}; ${process.arch})`}return""}t.getUserAgent=getUserAgent},2155:(e,t,i)=>{var a=i(8749);var r=i(824);var n=r;n.v1=a;n.v4=r;e.exports=n},2707:e=>{var t=[];for(var i=0;i<256;++i){t[i]=(i+256).toString(16).substr(1)}function bytesToUuid(e,i){var a=i||0;var r=t;return[r[e[a++]],r[e[a++]],r[e[a++]],r[e[a++]],"-",r[e[a++]],r[e[a++]],"-",r[e[a++]],r[e[a++]],"-",r[e[a++]],r[e[a++]],"-",r[e[a++]],r[e[a++]],r[e[a++]],r[e[a++]],r[e[a++]],r[e[a++]]].join("")}e.exports=bytesToUuid},5859:(e,t,i)=>{var a=i(6113);e.exports=function nodeRNG(){return a.randomBytes(16)}},8749:(e,t,i)=>{var a=i(5859);var r=i(2707);var n;var s;var o=0;var p=0;function v1(e,t,i){var l=t&&i||0;var c=t||[];e=e||{};var d=e.node||n;var u=e.clockseq!==undefined?e.clockseq:s;if(d==null||u==null){var m=a();if(d==null){d=n=[m[0]|1,m[1],m[2],m[3],m[4],m[5]]}if(u==null){u=s=(m[6]<<8|m[7])&16383}}var h=e.msecs!==undefined?e.msecs:(new Date).getTime();var g=e.nsecs!==undefined?e.nsecs:p+1;var y=h-o+(g-p)/1e4;if(y<0&&e.clockseq===undefined){u=u+1&16383}if((y<0||h>o)&&e.nsecs===undefined){g=0}if(g>=1e4){throw new Error("uuid.v1(): Can't create more than 10M uuids/sec")}o=h;p=g;s=u;h+=122192928e5;var v=((h&268435455)*1e4+g)%4294967296;c[l++]=v>>>24&255;c[l++]=v>>>16&255;c[l++]=v>>>8&255;c[l++]=v&255;var b=h/4294967296*1e4&268435455;c[l++]=b>>>8&255;c[l++]=b&255;c[l++]=b>>>24&15|16;c[l++]=b>>>16&255;c[l++]=u>>>8|128;c[l++]=u&255;for(var x=0;x<6;++x){c[l+x]=d[x]}return t?t:r(c)}e.exports=v1},824:(e,t,i)=>{var a=i(5859);var r=i(2707);function v4(e,t,i){var n=t&&i||0;if(typeof e=="string"){t=e==="binary"?new Array(16):null;e=null}e=e||{};var s=e.random||(e.rng||a)();s[6]=s[6]&15|64;s[8]=s[8]&63|128;if(t){for(var o=0;o<16;++o){t[n+o]=s[o]}}return t||r(s)}e.exports=v4},2940:e=>{e.exports=wrappy;function wrappy(e,t){if(e&&t)return wrappy(e)(t);if(typeof e!=="function")throw new TypeError("need wrapper function");Object.keys(e).forEach((function(t){wrapper[t]=e[t]}));return wrapper;function wrapper(){var t=new Array(arguments.length);for(var i=0;i=0||e.indexOf(">")>=0||e.indexOf("<")>=0)};s=function(e){return""};r=function(e){return e.replace("]]>","]]]]>")};t.Builder=function(){function Builder(e){var t,i,r;this.options={};i=a["0.2"];for(t in i){if(!o.call(i,t))continue;r=i[t];this.options[t]=r}for(t in e){if(!o.call(e,t))continue;r=e[t];this.options[t]=r}}Builder.prototype.buildObject=function(t){var i,r,p,l,c;i=this.options.attrkey;r=this.options.charkey;if(Object.keys(t).length===1&&this.options.rootName===a["0.2"].rootName){c=Object.keys(t)[0];t=t[c]}else{c=this.options.rootName}p=function(e){return function(t,a){var l,c,d,u,m,h;if(typeof a!=="object"){if(e.options.cdata&&n(a)){t.raw(s(a))}else{t.txt(a)}}else if(Array.isArray(a)){for(u in a){if(!o.call(a,u))continue;c=a[u];for(m in c){d=c[m];t=p(t.ele(m),d).up()}}}else{for(m in a){if(!o.call(a,m))continue;c=a[m];if(m===i){if(typeof c==="object"){for(l in c){h=c[l];t=t.att(l,h)}}}else if(m===r){if(e.options.cdata&&n(c)){t=t.raw(s(c))}else{t=t.txt(c)}}else if(Array.isArray(c)){for(u in c){if(!o.call(c,u))continue;d=c[u];if(typeof d==="string"){if(e.options.cdata&&n(d)){t=t.ele(m).raw(s(d)).up()}else{t=t.ele(m,d).up()}}else{t=p(t.ele(m),d).up()}}}else if(typeof c==="object"){t=p(t.ele(m),c).up()}else{if(typeof c==="string"&&e.options.cdata&&n(c)){t=t.ele(m).raw(s(c)).up()}else{if(c==null){c=""}t=t.ele(m,c.toString()).up()}}}}return t}}(this);l=e.create(c,this.options.xmldec,this.options.doctype,{headless:this.options.headless,allowSurrogateChars:this.options.allowSurrogateChars});return p(l,t).end(this.options.renderOpts)};return Builder}()}).call(this)},7251:function(e,t){(function(){t.defaults={.1:{explicitCharkey:false,trim:true,normalize:true,normalizeTags:false,attrkey:"@",charkey:"#",explicitArray:false,ignoreAttrs:false,mergeAttrs:false,explicitRoot:false,validator:null,xmlns:false,explicitChildren:false,childkey:"@@",charsAsChildren:false,includeWhiteChars:false,async:false,strict:true,attrNameProcessors:null,attrValueProcessors:null,tagNameProcessors:null,valueProcessors:null,emptyTag:""},.2:{explicitCharkey:false,trim:false,normalize:false,normalizeTags:false,attrkey:"$",charkey:"_",explicitArray:true,ignoreAttrs:false,mergeAttrs:false,explicitRoot:true,validator:null,xmlns:false,explicitChildren:false,preserveChildrenOrder:false,childkey:"$$",charsAsChildren:false,includeWhiteChars:false,async:false,strict:true,attrNameProcessors:null,attrValueProcessors:null,tagNameProcessors:null,valueProcessors:null,rootName:"root",xmldec:{version:"1.0",encoding:"UTF-8",standalone:true},doctype:null,renderOpts:{pretty:true,indent:" ",newline:"\n"},headless:false,chunkSize:1e4,emptyTag:"",cdata:false}}}).call(this)},3314:function(e,t,i){(function(){"use strict";var e,a,r,n,s,o,p,l,bind=function(e,t){return function(){return e.apply(t,arguments)}},extend=function(e,t){for(var i in t){if(c.call(t,i))e[i]=t[i]}function ctor(){this.constructor=e}ctor.prototype=t.prototype;e.prototype=new ctor;e.__super__=t.prototype;return e},c={}.hasOwnProperty;p=i(2043);r=i(2361);e=i(2624);o=i(9236);l=i(9512).setImmediate;a=i(7251).defaults;n=function(e){return typeof e==="object"&&e!=null&&Object.keys(e).length===0};s=function(e,t,i){var a,r,n;for(a=0,r=e.length;a0){p[e.options.childkey]=d}d=p}else if(h){h[e.options.childkey]=h[e.options.childkey]||[];u=Object.create(null);for(o in d){if(!c.call(d,o))continue;u[o]=d[o]}h[e.options.childkey].push(u);delete d["#name"];if(Object.keys(d).length===1&&t in d&&!e.EXPLICIT_CHARKEY){d=d[t]}}}if(a.length>0){return e.assignOrPush(h,l,d)}else{if(e.options.explicitRoot){m=d;d=Object.create(null);d[l]=m}e.resultObject=d;e.saxParser.ended=true;return e.emit("end",e.resultObject)}}}(this);i=function(e){return function(i){var r,n;n=a[a.length-1];if(n){n[t]+=i;if(e.options.explicitChildren&&e.options.preserveChildrenOrder&&e.options.charsAsChildren&&(e.options.includeWhiteChars||i.replace(/\\n/g,"").trim()!=="")){n[e.options.childkey]=n[e.options.childkey]||[];r={"#name":"__text__"};r[t]=i;if(e.options.normalize){r[t]=r[t].replace(/\s{2,}/g," ").trim()}n[e.options.childkey].push(r)}return n}}}(this);this.saxParser.ontext=i;return this.saxParser.oncdata=function(e){return function(e){var t;t=i(e);if(t){return t.cdata=true}}}(this)};Parser.prototype.parseString=function(t,i){var a;if(i!=null&&typeof i==="function"){this.on("end",(function(e){this.reset();return i(null,e)}));this.on("error",(function(e){this.reset();return i(e)}))}try{t=t.toString();if(t.trim()===""){this.emit("end",null);return true}t=e.stripBOM(t);if(this.options.async){this.remaining=t;l(this.processAsync);return this.saxParser}return this.saxParser.write(t).close()}catch(e){a=e;if(!(this.saxParser.errThrown||this.saxParser.ended)){this.emit("error",a);return this.saxParser.errThrown=true}else if(this.saxParser.ended){throw a}}};Parser.prototype.parseStringPromise=function(e){return new Promise(function(t){return function(i,a){return t.parseString(e,(function(e,t){if(e){return a(e)}else{return i(t)}}))}}(this))};return Parser}(r);t.parseString=function(e,i,a){var r,n,s;if(a!=null){if(typeof a==="function"){r=a}if(typeof i==="object"){n=i}}else{if(typeof i==="function"){r=i}n={}}s=new t.Parser(n);return s.parseString(e,r)};t.parseStringPromise=function(e,i){var a,r;if(typeof i==="object"){a=i}r=new t.Parser(a);return r.parseStringPromise(e)}}).call(this)},9236:function(e,t){(function(){"use strict";var e;e=new RegExp(/(?!xmlns)^.*:/);t.normalize=function(e){return e.toLowerCase()};t.firstCharLowerCase=function(e){return e.charAt(0).toLowerCase()+e.slice(1)};t.stripPrefix=function(t){return t.replace(e,"")};t.parseNumbers=function(e){if(!isNaN(e)){e=e%1===0?parseInt(e,10):parseFloat(e)}return e};t.parseBooleans=function(e){if(/^(?:true|false)$/i.test(e)){e=e.toLowerCase()==="true"}return e}}).call(this)},6189:function(e,t,i){(function(){"use strict";var e,a,r,n,extend=function(e,t){for(var i in t){if(s.call(t,i))e[i]=t[i]}function ctor(){this.constructor=e}ctor.prototype=t.prototype;e.prototype=new ctor;e.__super__=t.prototype;return e},s={}.hasOwnProperty;a=i(7251);e=i(3337);r=i(3314);n=i(9236);t.defaults=a.defaults;t.processors=n;t.ValidationError=function(e){extend(ValidationError,e);function ValidationError(e){this.message=e}return ValidationError}(Error);t.Builder=e.Builder;t.Parser=r.Parser;t.parseString=r.parseString;t.parseStringPromise=r.parseStringPromise}).call(this)},2839:function(e){(function(){e.exports={Disconnected:1,Preceding:2,Following:4,Contains:8,ContainedBy:16,ImplementationSpecific:32}}).call(this)},9267:function(e){(function(){e.exports={Element:1,Attribute:2,Text:3,CData:4,EntityReference:5,EntityDeclaration:6,ProcessingInstruction:7,Comment:8,Document:9,DocType:10,DocumentFragment:11,NotationDeclaration:12,Declaration:201,Raw:202,AttributeDeclaration:203,ElementDeclaration:204,Dummy:205}}).call(this)},8229:function(e){(function(){var t,i,a,r,n,s,o,p=[].slice,l={}.hasOwnProperty;t=function(){var e,t,i,a,r,s;s=arguments[0],r=2<=arguments.length?p.call(arguments,1):[];if(n(Object.assign)){Object.assign.apply(null,arguments)}else{for(e=0,i=r.length;e"}else{return"attribute: {"+e+"}, parent: <"+this.parent.name+">"}};XMLAttribute.prototype.isEqualNode=function(e){if(e.namespaceURI!==this.namespaceURI){return false}if(e.prefix!==this.prefix){return false}if(e.localName!==this.localName){return false}if(e.value!==this.value){return false}return true};return XMLAttribute}()}).call(this)},333:function(e,t,i){(function(){var t,a,r,extend=function(e,t){for(var i in t){if(n.call(t,i))e[i]=t[i]}function ctor(){this.constructor=e}ctor.prototype=t.prototype;e.prototype=new ctor;e.__super__=t.prototype;return e},n={}.hasOwnProperty;t=i(9267);r=i(7709);e.exports=a=function(e){extend(XMLCData,e);function XMLCData(e,i){XMLCData.__super__.constructor.call(this,e);if(i==null){throw new Error("Missing CDATA text. "+this.debugInfo())}this.name="#cdata-section";this.type=t.CData;this.value=this.stringify.cdata(i)}XMLCData.prototype.clone=function(){return Object.create(this)};XMLCData.prototype.toString=function(e){return this.options.writer.cdata(this,this.options.writer.filterOptions(e))};return XMLCData}(r)}).call(this)},7709:function(e,t,i){(function(){var t,a,extend=function(e,t){for(var i in t){if(r.call(t,i))e[i]=t[i]}function ctor(){this.constructor=e}ctor.prototype=t.prototype;e.prototype=new ctor;e.__super__=t.prototype;return e},r={}.hasOwnProperty;a=i(7608);e.exports=t=function(e){extend(XMLCharacterData,e);function XMLCharacterData(e){XMLCharacterData.__super__.constructor.call(this,e);this.value=""}Object.defineProperty(XMLCharacterData.prototype,"data",{get:function(){return this.value},set:function(e){return this.value=e||""}});Object.defineProperty(XMLCharacterData.prototype,"length",{get:function(){return this.value.length}});Object.defineProperty(XMLCharacterData.prototype,"textContent",{get:function(){return this.value},set:function(e){return this.value=e||""}});XMLCharacterData.prototype.clone=function(){return Object.create(this)};XMLCharacterData.prototype.substringData=function(e,t){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLCharacterData.prototype.appendData=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLCharacterData.prototype.insertData=function(e,t){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLCharacterData.prototype.deleteData=function(e,t){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLCharacterData.prototype.replaceData=function(e,t,i){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLCharacterData.prototype.isEqualNode=function(e){if(!XMLCharacterData.__super__.isEqualNode.apply(this,arguments).isEqualNode(e)){return false}if(e.data!==this.data){return false}return true};return XMLCharacterData}(a)}).call(this)},4407:function(e,t,i){(function(){var t,a,r,extend=function(e,t){for(var i in t){if(n.call(t,i))e[i]=t[i]}function ctor(){this.constructor=e}ctor.prototype=t.prototype;e.prototype=new ctor;e.__super__=t.prototype;return e},n={}.hasOwnProperty;t=i(9267);a=i(7709);e.exports=r=function(e){extend(XMLComment,e);function XMLComment(e,i){XMLComment.__super__.constructor.call(this,e);if(i==null){throw new Error("Missing comment text. "+this.debugInfo())}this.name="#comment";this.type=t.Comment;this.value=this.stringify.comment(i)}XMLComment.prototype.clone=function(){return Object.create(this)};XMLComment.prototype.toString=function(e){return this.options.writer.comment(this,this.options.writer.filterOptions(e))};return XMLComment}(a)}).call(this)},7465:function(e,t,i){(function(){var t,a,r;a=i(6744);r=i(7028);e.exports=t=function(){function XMLDOMConfiguration(){var e;this.defaultParams={"canonical-form":false,"cdata-sections":false,comments:false,"datatype-normalization":false,"element-content-whitespace":true,entities:true,"error-handler":new a,infoset:true,"validate-if-schema":false,namespaces:true,"namespace-declarations":true,"normalize-characters":false,"schema-location":"","schema-type":"","split-cdata-sections":true,validate:false,"well-formed":true};this.params=e=Object.create(this.defaultParams)}Object.defineProperty(XMLDOMConfiguration.prototype,"parameterNames",{get:function(){return new r(Object.keys(this.defaultParams))}});XMLDOMConfiguration.prototype.getParameter=function(e){if(this.params.hasOwnProperty(e)){return this.params[e]}else{return null}};XMLDOMConfiguration.prototype.canSetParameter=function(e,t){return true};XMLDOMConfiguration.prototype.setParameter=function(e,t){if(t!=null){return this.params[e]=t}else{return delete this.params[e]}};return XMLDOMConfiguration}()}).call(this)},6744:function(e){(function(){var t;e.exports=t=function(){function XMLDOMErrorHandler(){}XMLDOMErrorHandler.prototype.handleError=function(e){throw new Error(e)};return XMLDOMErrorHandler}()}).call(this)},8310:function(e){(function(){var t;e.exports=t=function(){function XMLDOMImplementation(){}XMLDOMImplementation.prototype.hasFeature=function(e,t){return true};XMLDOMImplementation.prototype.createDocumentType=function(e,t,i){throw new Error("This DOM method is not implemented.")};XMLDOMImplementation.prototype.createDocument=function(e,t,i){throw new Error("This DOM method is not implemented.")};XMLDOMImplementation.prototype.createHTMLDocument=function(e){throw new Error("This DOM method is not implemented.")};XMLDOMImplementation.prototype.getFeature=function(e,t){throw new Error("This DOM method is not implemented.")};return XMLDOMImplementation}()}).call(this)},7028:function(e){(function(){var t;e.exports=t=function(){function XMLDOMStringList(e){this.arr=e||[]}Object.defineProperty(XMLDOMStringList.prototype,"length",{get:function(){return this.arr.length}});XMLDOMStringList.prototype.item=function(e){return this.arr[e]||null};XMLDOMStringList.prototype.contains=function(e){return this.arr.indexOf(e)!==-1};return XMLDOMStringList}()}).call(this)},1015:function(e,t,i){(function(){var t,a,r,extend=function(e,t){for(var i in t){if(n.call(t,i))e[i]=t[i]}function ctor(){this.constructor=e}ctor.prototype=t.prototype;e.prototype=new ctor;e.__super__=t.prototype;return e},n={}.hasOwnProperty;r=i(7608);t=i(9267);e.exports=a=function(e){extend(XMLDTDAttList,e);function XMLDTDAttList(e,i,a,r,n,s){XMLDTDAttList.__super__.constructor.call(this,e);if(i==null){throw new Error("Missing DTD element name. "+this.debugInfo())}if(a==null){throw new Error("Missing DTD attribute name. "+this.debugInfo(i))}if(!r){throw new Error("Missing DTD attribute type. "+this.debugInfo(i))}if(!n){throw new Error("Missing DTD attribute default. "+this.debugInfo(i))}if(n.indexOf("#")!==0){n="#"+n}if(!n.match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/)){throw new Error("Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT. "+this.debugInfo(i))}if(s&&!n.match(/^(#FIXED|#DEFAULT)$/)){throw new Error("Default value only applies to #FIXED or #DEFAULT. "+this.debugInfo(i))}this.elementName=this.stringify.name(i);this.type=t.AttributeDeclaration;this.attributeName=this.stringify.name(a);this.attributeType=this.stringify.dtdAttType(r);if(s){this.defaultValue=this.stringify.dtdAttDefault(s)}this.defaultValueType=n}XMLDTDAttList.prototype.toString=function(e){return this.options.writer.dtdAttList(this,this.options.writer.filterOptions(e))};return XMLDTDAttList}(r)}).call(this)},2421:function(e,t,i){(function(){var t,a,r,extend=function(e,t){for(var i in t){if(n.call(t,i))e[i]=t[i]}function ctor(){this.constructor=e}ctor.prototype=t.prototype;e.prototype=new ctor;e.__super__=t.prototype;return e},n={}.hasOwnProperty;r=i(7608);t=i(9267);e.exports=a=function(e){extend(XMLDTDElement,e);function XMLDTDElement(e,i,a){XMLDTDElement.__super__.constructor.call(this,e);if(i==null){throw new Error("Missing DTD element name. "+this.debugInfo())}if(!a){a="(#PCDATA)"}if(Array.isArray(a)){a="("+a.join(",")+")"}this.name=this.stringify.name(i);this.type=t.ElementDeclaration;this.value=this.stringify.dtdElementValue(a)}XMLDTDElement.prototype.toString=function(e){return this.options.writer.dtdElement(this,this.options.writer.filterOptions(e))};return XMLDTDElement}(r)}).call(this)},53:function(e,t,i){(function(){var t,a,r,n,extend=function(e,t){for(var i in t){if(s.call(t,i))e[i]=t[i]}function ctor(){this.constructor=e}ctor.prototype=t.prototype;e.prototype=new ctor;e.__super__=t.prototype;return e},s={}.hasOwnProperty;n=i(8229).isObject;r=i(7608);t=i(9267);e.exports=a=function(e){extend(XMLDTDEntity,e);function XMLDTDEntity(e,i,a,r){XMLDTDEntity.__super__.constructor.call(this,e);if(a==null){throw new Error("Missing DTD entity name. "+this.debugInfo(a))}if(r==null){throw new Error("Missing DTD entity value. "+this.debugInfo(a))}this.pe=!!i;this.name=this.stringify.name(a);this.type=t.EntityDeclaration;if(!n(r)){this.value=this.stringify.dtdEntityValue(r);this.internal=true}else{if(!r.pubID&&!r.sysID){throw new Error("Public and/or system identifiers are required for an external entity. "+this.debugInfo(a))}if(r.pubID&&!r.sysID){throw new Error("System identifier is required for a public external entity. "+this.debugInfo(a))}this.internal=false;if(r.pubID!=null){this.pubID=this.stringify.dtdPubID(r.pubID)}if(r.sysID!=null){this.sysID=this.stringify.dtdSysID(r.sysID)}if(r.nData!=null){this.nData=this.stringify.dtdNData(r.nData)}if(this.pe&&this.nData){throw new Error("Notation declaration is not allowed in a parameter entity. "+this.debugInfo(a))}}}Object.defineProperty(XMLDTDEntity.prototype,"publicId",{get:function(){return this.pubID}});Object.defineProperty(XMLDTDEntity.prototype,"systemId",{get:function(){return this.sysID}});Object.defineProperty(XMLDTDEntity.prototype,"notationName",{get:function(){return this.nData||null}});Object.defineProperty(XMLDTDEntity.prototype,"inputEncoding",{get:function(){return null}});Object.defineProperty(XMLDTDEntity.prototype,"xmlEncoding",{get:function(){return null}});Object.defineProperty(XMLDTDEntity.prototype,"xmlVersion",{get:function(){return null}});XMLDTDEntity.prototype.toString=function(e){return this.options.writer.dtdEntity(this,this.options.writer.filterOptions(e))};return XMLDTDEntity}(r)}).call(this)},2837:function(e,t,i){(function(){var t,a,r,extend=function(e,t){for(var i in t){if(n.call(t,i))e[i]=t[i]}function ctor(){this.constructor=e}ctor.prototype=t.prototype;e.prototype=new ctor;e.__super__=t.prototype;return e},n={}.hasOwnProperty;r=i(7608);t=i(9267);e.exports=a=function(e){extend(XMLDTDNotation,e);function XMLDTDNotation(e,i,a){XMLDTDNotation.__super__.constructor.call(this,e);if(i==null){throw new Error("Missing DTD notation name. "+this.debugInfo(i))}if(!a.pubID&&!a.sysID){throw new Error("Public or system identifiers are required for an external entity. "+this.debugInfo(i))}this.name=this.stringify.name(i);this.type=t.NotationDeclaration;if(a.pubID!=null){this.pubID=this.stringify.dtdPubID(a.pubID)}if(a.sysID!=null){this.sysID=this.stringify.dtdSysID(a.sysID)}}Object.defineProperty(XMLDTDNotation.prototype,"publicId",{get:function(){return this.pubID}});Object.defineProperty(XMLDTDNotation.prototype,"systemId",{get:function(){return this.sysID}});XMLDTDNotation.prototype.toString=function(e){return this.options.writer.dtdNotation(this,this.options.writer.filterOptions(e))};return XMLDTDNotation}(r)}).call(this)},6364:function(e,t,i){(function(){var t,a,r,n,extend=function(e,t){for(var i in t){if(s.call(t,i))e[i]=t[i]}function ctor(){this.constructor=e}ctor.prototype=t.prototype;e.prototype=new ctor;e.__super__=t.prototype;return e},s={}.hasOwnProperty;n=i(8229).isObject;r=i(7608);t=i(9267);e.exports=a=function(e){extend(XMLDeclaration,e);function XMLDeclaration(e,i,a,r){var s;XMLDeclaration.__super__.constructor.call(this,e);if(n(i)){s=i,i=s.version,a=s.encoding,r=s.standalone}if(!i){i="1.0"}this.type=t.Declaration;this.version=this.stringify.xmlVersion(i);if(a!=null){this.encoding=this.stringify.xmlEncoding(a)}if(r!=null){this.standalone=this.stringify.xmlStandalone(r)}}XMLDeclaration.prototype.toString=function(e){return this.options.writer.declaration(this,this.options.writer.filterOptions(e))};return XMLDeclaration}(r)}).call(this)},1801:function(e,t,i){(function(){var t,a,r,n,s,o,p,l,c,extend=function(e,t){for(var i in t){if(d.call(t,i))e[i]=t[i]}function ctor(){this.constructor=e}ctor.prototype=t.prototype;e.prototype=new ctor;e.__super__=t.prototype;return e},d={}.hasOwnProperty;c=i(8229).isObject;l=i(7608);t=i(9267);a=i(1015);n=i(53);r=i(2421);s=i(2837);p=i(4361);e.exports=o=function(e){extend(XMLDocType,e);function XMLDocType(e,i,a){var r,n,s,o,p,l;XMLDocType.__super__.constructor.call(this,e);this.type=t.DocType;if(e.children){o=e.children;for(n=0,s=o.length;n=0){this.up()}return this.onEnd()};XMLDocumentCB.prototype.openCurrent=function(){if(this.currentNode){this.currentNode.children=true;return this.openNode(this.currentNode)}};XMLDocumentCB.prototype.openNode=function(e){var i,r,n,s;if(!e.isOpen){if(!this.root&&this.currentLevel===0&&e.type===t.Element){this.root=e}r="";if(e.type===t.Element){this.writerOptions.state=a.OpenTag;r=this.writer.indent(e,this.writerOptions,this.currentLevel)+"<"+e.name;s=e.attribs;for(n in s){if(!O.call(s,n))continue;i=s[n];r+=this.writer.attribute(i,this.writerOptions,this.currentLevel)}r+=(e.children?">":"/>")+this.writer.endline(e,this.writerOptions,this.currentLevel);this.writerOptions.state=a.InsideTag}else{this.writerOptions.state=a.OpenTag;r=this.writer.indent(e,this.writerOptions,this.currentLevel)+""}r+=this.writer.endline(e,this.writerOptions,this.currentLevel)}this.onData(r,this.currentLevel);return e.isOpen=true}};XMLDocumentCB.prototype.closeNode=function(e){var i;if(!e.isClosed){i="";this.writerOptions.state=a.CloseTag;if(e.type===t.Element){i=this.writer.indent(e,this.writerOptions,this.currentLevel)+""+this.writer.endline(e,this.writerOptions,this.currentLevel)}else{i=this.writer.indent(e,this.writerOptions,this.currentLevel)+"]>"+this.writer.endline(e,this.writerOptions,this.currentLevel)}this.writerOptions.state=a.None;this.onData(i,this.currentLevel);return e.isClosed=true}};XMLDocumentCB.prototype.onData=function(e,t){this.documentStarted=true;return this.onDataCallback(e,t+1)};XMLDocumentCB.prototype.onEnd=function(){this.documentCompleted=true;return this.onEndCallback()};XMLDocumentCB.prototype.debugInfo=function(e){if(e==null){return""}else{return"node: <"+e+">"}};XMLDocumentCB.prototype.ele=function(){return this.element.apply(this,arguments)};XMLDocumentCB.prototype.nod=function(e,t,i){return this.node(e,t,i)};XMLDocumentCB.prototype.txt=function(e){return this.text(e)};XMLDocumentCB.prototype.dat=function(e){return this.cdata(e)};XMLDocumentCB.prototype.com=function(e){return this.comment(e)};XMLDocumentCB.prototype.ins=function(e,t){return this.instruction(e,t)};XMLDocumentCB.prototype.dec=function(e,t,i){return this.declaration(e,t,i)};XMLDocumentCB.prototype.dtd=function(e,t,i){return this.doctype(e,t,i)};XMLDocumentCB.prototype.e=function(e,t,i){return this.element(e,t,i)};XMLDocumentCB.prototype.n=function(e,t,i){return this.node(e,t,i)};XMLDocumentCB.prototype.t=function(e){return this.text(e)};XMLDocumentCB.prototype.d=function(e){return this.cdata(e)};XMLDocumentCB.prototype.c=function(e){return this.comment(e)};XMLDocumentCB.prototype.r=function(e){return this.raw(e)};XMLDocumentCB.prototype.i=function(e,t){return this.instruction(e,t)};XMLDocumentCB.prototype.att=function(){if(this.currentNode&&this.currentNode.type===t.DocType){return this.attList.apply(this,arguments)}else{return this.attribute.apply(this,arguments)}};XMLDocumentCB.prototype.a=function(){if(this.currentNode&&this.currentNode.type===t.DocType){return this.attList.apply(this,arguments)}else{return this.attribute.apply(this,arguments)}};XMLDocumentCB.prototype.ent=function(e,t){return this.entity(e,t)};XMLDocumentCB.prototype.pent=function(e,t){return this.pEntity(e,t)};XMLDocumentCB.prototype.not=function(e,t){return this.notation(e,t)};return XMLDocumentCB}()}).call(this)},3590:function(e,t,i){(function(){var t,a,r,extend=function(e,t){for(var i in t){if(n.call(t,i))e[i]=t[i]}function ctor(){this.constructor=e}ctor.prototype=t.prototype;e.prototype=new ctor;e.__super__=t.prototype;return e},n={}.hasOwnProperty;r=i(7608);t=i(9267);e.exports=a=function(e){extend(XMLDummy,e);function XMLDummy(e){XMLDummy.__super__.constructor.call(this,e);this.type=t.Dummy}XMLDummy.prototype.clone=function(){return Object.create(this)};XMLDummy.prototype.toString=function(e){return""};return XMLDummy}(r)}).call(this)},9437:function(e,t,i){(function(){var t,a,r,n,s,o,p,l,c,extend=function(e,t){for(var i in t){if(d.call(t,i))e[i]=t[i]}function ctor(){this.constructor=e}ctor.prototype=t.prototype;e.prototype=new ctor;e.__super__=t.prototype;return e},d={}.hasOwnProperty;c=i(8229),l=c.isObject,p=c.isFunction,o=c.getValue;s=i(7608);t=i(9267);a=i(8376);n=i(4361);e.exports=r=function(e){extend(XMLElement,e);function XMLElement(e,i,a){var r,n,s,o;XMLElement.__super__.constructor.call(this,e);if(i==null){throw new Error("Missing element name. "+this.debugInfo())}this.name=this.stringify.name(i);this.type=t.Element;this.attribs={};this.schemaTypeInfo=null;if(a!=null){this.attribute(a)}if(e.type===t.Document){this.isRoot=true;this.documentObject=e;e.rootObject=this;if(e.children){o=e.children;for(n=0,s=o.length;n=a;t=0<=a?++i:--i){if(!this.attribs[t].isEqualNode(e.attribs[t])){return false}}return true};return XMLElement}(s)}).call(this)},4361:function(e){(function(){var t;e.exports=t=function(){function XMLNamedNodeMap(e){this.nodes=e}Object.defineProperty(XMLNamedNodeMap.prototype,"length",{get:function(){return Object.keys(this.nodes).length||0}});XMLNamedNodeMap.prototype.clone=function(){return this.nodes=null};XMLNamedNodeMap.prototype.getNamedItem=function(e){return this.nodes[e]};XMLNamedNodeMap.prototype.setNamedItem=function(e){var t;t=this.nodes[e.nodeName];this.nodes[e.nodeName]=e;return t||null};XMLNamedNodeMap.prototype.removeNamedItem=function(e){var t;t=this.nodes[e];delete this.nodes[e];return t||null};XMLNamedNodeMap.prototype.item=function(e){return this.nodes[Object.keys(this.nodes)[e]]||null};XMLNamedNodeMap.prototype.getNamedItemNS=function(e,t){throw new Error("This DOM method is not implemented.")};XMLNamedNodeMap.prototype.setNamedItemNS=function(e){throw new Error("This DOM method is not implemented.")};XMLNamedNodeMap.prototype.removeNamedItemNS=function(e,t){throw new Error("This DOM method is not implemented.")};return XMLNamedNodeMap}()}).call(this)},7608:function(e,t,i){(function(){var t,a,r,n,s,o,p,l,c,d,u,m,h,g,y,v,b,x,w,S={}.hasOwnProperty;w=i(8229),x=w.isObject,b=w.isFunction,v=w.isEmpty,y=w.getValue;l=null;r=null;n=null;s=null;o=null;h=null;g=null;m=null;p=null;a=null;u=null;c=null;t=null;e.exports=d=function(){function XMLNode(e){this.parent=e;if(this.parent){this.options=this.parent.options;this.stringify=this.parent.stringify}this.value=null;this.children=[];this.baseURI=null;if(!l){l=i(9437);r=i(333);n=i(4407);s=i(6364);o=i(1801);h=i(6329);g=i(1318);m=i(6939);p=i(3590);a=i(9267);u=i(6768);c=i(4361);t=i(2839)}}Object.defineProperty(XMLNode.prototype,"nodeName",{get:function(){return this.name}});Object.defineProperty(XMLNode.prototype,"nodeType",{get:function(){return this.type}});Object.defineProperty(XMLNode.prototype,"nodeValue",{get:function(){return this.value}});Object.defineProperty(XMLNode.prototype,"parentNode",{get:function(){return this.parent}});Object.defineProperty(XMLNode.prototype,"childNodes",{get:function(){if(!this.childNodeList||!this.childNodeList.nodes){this.childNodeList=new u(this.children)}return this.childNodeList}});Object.defineProperty(XMLNode.prototype,"firstChild",{get:function(){return this.children[0]||null}});Object.defineProperty(XMLNode.prototype,"lastChild",{get:function(){return this.children[this.children.length-1]||null}});Object.defineProperty(XMLNode.prototype,"previousSibling",{get:function(){var e;e=this.parent.children.indexOf(this);return this.parent.children[e-1]||null}});Object.defineProperty(XMLNode.prototype,"nextSibling",{get:function(){var e;e=this.parent.children.indexOf(this);return this.parent.children[e+1]||null}});Object.defineProperty(XMLNode.prototype,"ownerDocument",{get:function(){return this.document()||null}});Object.defineProperty(XMLNode.prototype,"textContent",{get:function(){var e,t,i,r,n;if(this.nodeType===a.Element||this.nodeType===a.DocumentFragment){n="";r=this.children;for(t=0,i=r.length;t"}else if(!((i=this.parent)!=null?i.name:void 0)){return"node: <"+e+">"}else{return"node: <"+e+">, parent: <"+this.parent.name+">"}};XMLNode.prototype.ele=function(e,t,i){return this.element(e,t,i)};XMLNode.prototype.nod=function(e,t,i){return this.node(e,t,i)};XMLNode.prototype.txt=function(e){return this.text(e)};XMLNode.prototype.dat=function(e){return this.cdata(e)};XMLNode.prototype.com=function(e){return this.comment(e)};XMLNode.prototype.ins=function(e,t){return this.instruction(e,t)};XMLNode.prototype.doc=function(){return this.document()};XMLNode.prototype.dec=function(e,t,i){return this.declaration(e,t,i)};XMLNode.prototype.e=function(e,t,i){return this.element(e,t,i)};XMLNode.prototype.n=function(e,t,i){return this.node(e,t,i)};XMLNode.prototype.t=function(e){return this.text(e)};XMLNode.prototype.d=function(e){return this.cdata(e)};XMLNode.prototype.c=function(e){return this.comment(e)};XMLNode.prototype.r=function(e){return this.raw(e)};XMLNode.prototype.i=function(e,t){return this.instruction(e,t)};XMLNode.prototype.u=function(){return this.up()};XMLNode.prototype.importXMLBuilder=function(e){return this.importDocument(e)};XMLNode.prototype.replaceChild=function(e,t){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.removeChild=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.appendChild=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.hasChildNodes=function(){return this.children.length!==0};XMLNode.prototype.cloneNode=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.normalize=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.isSupported=function(e,t){return true};XMLNode.prototype.hasAttributes=function(){return this.attribs.length!==0};XMLNode.prototype.compareDocumentPosition=function(e){var i,a;i=this;if(i===e){return 0}else if(this.document()!==e.document()){a=t.Disconnected|t.ImplementationSpecific;if(Math.random()<.5){a|=t.Preceding}else{a|=t.Following}return a}else if(i.isAncestor(e)){return t.Contains|t.Preceding}else if(i.isDescendant(e)){return t.Contains|t.Following}else if(i.isPreceding(e)){return t.Preceding}else{return t.Following}};XMLNode.prototype.isSameNode=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.lookupPrefix=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.isDefaultNamespace=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.lookupNamespaceURI=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.isEqualNode=function(e){var t,i,a;if(e.nodeType!==this.nodeType){return false}if(e.children.length!==this.children.length){return false}for(t=i=0,a=this.children.length-1;0<=a?i<=a:i>=a;t=0<=a?++i:--i){if(!this.children[t].isEqualNode(e.children[t])){return false}}return true};XMLNode.prototype.getFeature=function(e,t){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.setUserData=function(e,t,i){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.getUserData=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.contains=function(e){if(!e){return false}return e===this||this.isDescendant(e)};XMLNode.prototype.isDescendant=function(e){var t,i,a,r,n;n=this.children;for(a=0,r=n.length;ai}};XMLNode.prototype.treePosition=function(e){var t,i;i=0;t=false;this.foreachTreeNode(this.document(),(function(a){i++;if(!t&&a===e){return t=true}}));if(t){return i}else{return-1}};XMLNode.prototype.foreachTreeNode=function(e,t){var i,a,r,n,s;e||(e=this.document());n=e.children;for(a=0,r=n.length;a0){this.stream.write(" [");this.stream.write(this.endline(e,t,i));t.state=a.InsideTag;o=e.children;for(n=0,s=o.length;n");this.stream.write(this.endline(e,t,i));t.state=a.None;return this.closeNode(e,t,i)};XMLStreamWriter.prototype.element=function(e,i,r){var n,o,p,l,c,d,u,m,h,g;r||(r=0);this.openNode(e,i,r);i.state=a.OpenTag;this.stream.write(this.indent(e,i,r)+"<"+e.name);h=e.attribs;for(u in h){if(!s.call(h,u))continue;n=h[u];this.attribute(n,i,r)}p=e.children.length;l=p===0?null:e.children[0];if(p===0||e.children.every((function(e){return(e.type===t.Text||e.type===t.Raw)&&e.value===""}))){if(i.allowEmpty){this.stream.write(">");i.state=a.CloseTag;this.stream.write("")}else{i.state=a.CloseTag;this.stream.write(i.spaceBeforeSlash+"/>")}}else if(i.pretty&&p===1&&(l.type===t.Text||l.type===t.Raw)&&l.value!=null){this.stream.write(">");i.state=a.InsideTag;i.suppressPrettyCount++;m=true;this.writeChildNode(l,i,r+1);i.suppressPrettyCount--;m=false;i.state=a.CloseTag;this.stream.write("")}else{this.stream.write(">"+this.endline(e,i,r));i.state=a.InsideTag;g=e.children;for(c=0,d=g.length;c")}this.stream.write(this.endline(e,i,r));i.state=a.None;return this.closeNode(e,i,r)};XMLStreamWriter.prototype.processingInstruction=function(e,t,i){return this.stream.write(XMLStreamWriter.__super__.processingInstruction.call(this,e,t,i))};XMLStreamWriter.prototype.raw=function(e,t,i){return this.stream.write(XMLStreamWriter.__super__.raw.call(this,e,t,i))};XMLStreamWriter.prototype.text=function(e,t,i){return this.stream.write(XMLStreamWriter.__super__.text.call(this,e,t,i))};XMLStreamWriter.prototype.dtdAttList=function(e,t,i){return this.stream.write(XMLStreamWriter.__super__.dtdAttList.call(this,e,t,i))};XMLStreamWriter.prototype.dtdElement=function(e,t,i){return this.stream.write(XMLStreamWriter.__super__.dtdElement.call(this,e,t,i))};XMLStreamWriter.prototype.dtdEntity=function(e,t,i){return this.stream.write(XMLStreamWriter.__super__.dtdEntity.call(this,e,t,i))};XMLStreamWriter.prototype.dtdNotation=function(e,t,i){return this.stream.write(XMLStreamWriter.__super__.dtdNotation.call(this,e,t,i))};return XMLStreamWriter}(n)}).call(this)},5913:function(e,t,i){(function(){var t,a,extend=function(e,t){for(var i in t){if(r.call(t,i))e[i]=t[i]}function ctor(){this.constructor=e}ctor.prototype=t.prototype;e.prototype=new ctor;e.__super__=t.prototype;return e},r={}.hasOwnProperty;a=i(6752);e.exports=t=function(e){extend(XMLStringWriter,e);function XMLStringWriter(e){XMLStringWriter.__super__.constructor.call(this,e)}XMLStringWriter.prototype.document=function(e,t){var i,a,r,n,s;t=this.filterOptions(t);n="";s=e.children;for(a=0,r=s.length;a","]]]]>");return this.assertLegalChar(e)};XMLStringifier.prototype.comment=function(e){if(this.options.noValidation){return e}e=""+e||"";if(e.match(/--/)){throw new Error("Comment text cannot contain double-hypen: "+e)}return this.assertLegalChar(e)};XMLStringifier.prototype.raw=function(e){if(this.options.noValidation){return e}return""+e||""};XMLStringifier.prototype.attValue=function(e){if(this.options.noValidation){return e}return this.assertLegalChar(this.attEscape(e=""+e||""))};XMLStringifier.prototype.insTarget=function(e){if(this.options.noValidation){return e}return this.assertLegalChar(""+e||"")};XMLStringifier.prototype.insValue=function(e){if(this.options.noValidation){return e}e=""+e||"";if(e.match(/\?>/)){throw new Error("Invalid processing instruction value: "+e)}return this.assertLegalChar(e)};XMLStringifier.prototype.xmlVersion=function(e){if(this.options.noValidation){return e}e=""+e||"";if(!e.match(/1\.[0-9]+/)){throw new Error("Invalid version number: "+e)}return e};XMLStringifier.prototype.xmlEncoding=function(e){if(this.options.noValidation){return e}e=""+e||"";if(!e.match(/^[A-Za-z](?:[A-Za-z0-9._-])*$/)){throw new Error("Invalid encoding: "+e)}return this.assertLegalChar(e)};XMLStringifier.prototype.xmlStandalone=function(e){if(this.options.noValidation){return e}if(e){return"yes"}else{return"no"}};XMLStringifier.prototype.dtdPubID=function(e){if(this.options.noValidation){return e}return this.assertLegalChar(""+e||"")};XMLStringifier.prototype.dtdSysID=function(e){if(this.options.noValidation){return e}return this.assertLegalChar(""+e||"")};XMLStringifier.prototype.dtdElementValue=function(e){if(this.options.noValidation){return e}return this.assertLegalChar(""+e||"")};XMLStringifier.prototype.dtdAttType=function(e){if(this.options.noValidation){return e}return this.assertLegalChar(""+e||"")};XMLStringifier.prototype.dtdAttDefault=function(e){if(this.options.noValidation){return e}return this.assertLegalChar(""+e||"")};XMLStringifier.prototype.dtdEntityValue=function(e){if(this.options.noValidation){return e}return this.assertLegalChar(""+e||"")};XMLStringifier.prototype.dtdNData=function(e){if(this.options.noValidation){return e}return this.assertLegalChar(""+e||"")};XMLStringifier.prototype.convertAttKey="@";XMLStringifier.prototype.convertPIKey="?";XMLStringifier.prototype.convertTextKey="#text";XMLStringifier.prototype.convertCDataKey="#cdata";XMLStringifier.prototype.convertCommentKey="#comment";XMLStringifier.prototype.convertRawKey="#raw";XMLStringifier.prototype.assertLegalChar=function(e){var t,i;if(this.options.noValidation){return e}t="";if(this.options.version==="1.0"){t=/[\0-\x08\x0B\f\x0E-\x1F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;if(i=e.match(t)){throw new Error("Invalid character in string: "+e+" at index "+i.index)}}else if(this.options.version==="1.1"){t=/[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;if(i=e.match(t)){throw new Error("Invalid character in string: "+e+" at index "+i.index)}}return e};XMLStringifier.prototype.assertLegalName=function(e){var t;if(this.options.noValidation){return e}this.assertLegalChar(e);t=/^([:A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])([\x2D\.0-:A-Z_a-z\xB7\xC0-\xD6\xD8-\xF6\xF8-\u037D\u037F-\u1FFF\u200C\u200D\u203F\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])*$/;if(!e.match(t)){throw new Error("Invalid character in name")}return e};XMLStringifier.prototype.textEscape=function(e){var t;if(this.options.noValidation){return e}t=this.options.noDoubleEncoding?/(?!&\S+;)&/g:/&/g;return e.replace(t,"&").replace(//g,">").replace(/\r/g," ")};XMLStringifier.prototype.attEscape=function(e){var t;if(this.options.noValidation){return e}t=this.options.noDoubleEncoding?/(?!&\S+;)&/g:/&/g;return e.replace(t,"&").replace(/0){return new Array(a).join(t.indent)}}return""};XMLWriterBase.prototype.endline=function(e,t,i){if(!t.pretty||t.suppressPrettyCount){return""}else{return t.newline}};XMLWriterBase.prototype.attribute=function(e,t,i){var a;this.openAttribute(e,t,i);a=" "+e.name+'="'+e.value+'"';this.closeAttribute(e,t,i);return a};XMLWriterBase.prototype.cdata=function(e,t,i){var r;this.openNode(e,t,i);t.state=a.OpenTag;r=this.indent(e,t,i)+""+this.endline(e,t,i);t.state=a.None;this.closeNode(e,t,i);return r};XMLWriterBase.prototype.comment=function(e,t,i){var r;this.openNode(e,t,i);t.state=a.OpenTag;r=this.indent(e,t,i)+"\x3c!-- ";t.state=a.InsideTag;r+=e.value;t.state=a.CloseTag;r+=" --\x3e"+this.endline(e,t,i);t.state=a.None;this.closeNode(e,t,i);return r};XMLWriterBase.prototype.declaration=function(e,t,i){var r;this.openNode(e,t,i);t.state=a.OpenTag;r=this.indent(e,t,i)+"";r+=this.endline(e,t,i);t.state=a.None;this.closeNode(e,t,i);return r};XMLWriterBase.prototype.docType=function(e,t,i){var r,n,s,o,p;i||(i=0);this.openNode(e,t,i);t.state=a.OpenTag;o=this.indent(e,t,i);o+="0){o+=" [";o+=this.endline(e,t,i);t.state=a.InsideTag;p=e.children;for(n=0,s=p.length;n";o+=this.endline(e,t,i);t.state=a.None;this.closeNode(e,t,i);return o};XMLWriterBase.prototype.element=function(e,i,r){var n,s,o,p,l,c,d,u,m,h,g,y,v,b;r||(r=0);h=false;g="";this.openNode(e,i,r);i.state=a.OpenTag;g+=this.indent(e,i,r)+"<"+e.name;y=e.attribs;for(m in y){if(!x.call(y,m))continue;n=y[m];g+=this.attribute(n,i,r)}o=e.children.length;p=o===0?null:e.children[0];if(o===0||e.children.every((function(e){return(e.type===t.Text||e.type===t.Raw)&&e.value===""}))){if(i.allowEmpty){g+=">";i.state=a.CloseTag;g+=""+this.endline(e,i,r)}else{i.state=a.CloseTag;g+=i.spaceBeforeSlash+"/>"+this.endline(e,i,r)}}else if(i.pretty&&o===1&&(p.type===t.Text||p.type===t.Raw)&&p.value!=null){g+=">";i.state=a.InsideTag;i.suppressPrettyCount++;h=true;g+=this.writeChildNode(p,i,r+1);i.suppressPrettyCount--;h=false;i.state=a.CloseTag;g+=""+this.endline(e,i,r)}else{if(i.dontPrettyTextNodes){v=e.children;for(l=0,d=v.length;l"+this.endline(e,i,r);i.state=a.InsideTag;b=e.children;for(c=0,u=b.length;c";if(h){i.suppressPrettyCount--}g+=this.endline(e,i,r);i.state=a.None}this.closeNode(e,i,r);return g};XMLWriterBase.prototype.writeChildNode=function(e,i,a){switch(e.type){case t.CData:return this.cdata(e,i,a);case t.Comment:return this.comment(e,i,a);case t.Element:return this.element(e,i,a);case t.Raw:return this.raw(e,i,a);case t.Text:return this.text(e,i,a);case t.ProcessingInstruction:return this.processingInstruction(e,i,a);case t.Dummy:return"";case t.Declaration:return this.declaration(e,i,a);case t.DocType:return this.docType(e,i,a);case t.AttributeDeclaration:return this.dtdAttList(e,i,a);case t.ElementDeclaration:return this.dtdElement(e,i,a);case t.EntityDeclaration:return this.dtdEntity(e,i,a);case t.NotationDeclaration:return this.dtdNotation(e,i,a);default:throw new Error("Unknown XML node type: "+e.constructor.name)}};XMLWriterBase.prototype.processingInstruction=function(e,t,i){var r;this.openNode(e,t,i);t.state=a.OpenTag;r=this.indent(e,t,i)+"";r+=this.endline(e,t,i);t.state=a.None;this.closeNode(e,t,i);return r};XMLWriterBase.prototype.raw=function(e,t,i){var r;this.openNode(e,t,i);t.state=a.OpenTag;r=this.indent(e,t,i);t.state=a.InsideTag;r+=e.value;t.state=a.CloseTag;r+=this.endline(e,t,i);t.state=a.None;this.closeNode(e,t,i);return r};XMLWriterBase.prototype.text=function(e,t,i){var r;this.openNode(e,t,i);t.state=a.OpenTag;r=this.indent(e,t,i);t.state=a.InsideTag;r+=e.value;t.state=a.CloseTag;r+=this.endline(e,t,i);t.state=a.None;this.closeNode(e,t,i);return r};XMLWriterBase.prototype.dtdAttList=function(e,t,i){var r;this.openNode(e,t,i);t.state=a.OpenTag;r=this.indent(e,t,i)+""+this.endline(e,t,i);t.state=a.None;this.closeNode(e,t,i);return r};XMLWriterBase.prototype.dtdElement=function(e,t,i){var r;this.openNode(e,t,i);t.state=a.OpenTag;r=this.indent(e,t,i)+""+this.endline(e,t,i);t.state=a.None;this.closeNode(e,t,i);return r};XMLWriterBase.prototype.dtdEntity=function(e,t,i){var r;this.openNode(e,t,i);t.state=a.OpenTag;r=this.indent(e,t,i)+""+this.endline(e,t,i);t.state=a.None;this.closeNode(e,t,i);return r};XMLWriterBase.prototype.dtdNotation=function(e,t,i){var r;this.openNode(e,t,i);t.state=a.OpenTag;r=this.indent(e,t,i)+""+this.endline(e,t,i);t.state=a.None;this.closeNode(e,t,i);return r};XMLWriterBase.prototype.openNode=function(e,t,i){};XMLWriterBase.prototype.closeNode=function(e,t,i){};XMLWriterBase.prototype.openAttribute=function(e,t,i){};XMLWriterBase.prototype.closeAttribute=function(e,t,i){};return XMLWriterBase}()}).call(this)},2958:function(e,t,i){(function(){var t,a,r,n,s,o,p,l,c,d;d=i(8229),l=d.assign,c=d.isFunction;r=i(8310);n=i(3730);s=i(7356);p=i(5913);o=i(8601);t=i(9267);a=i(9766);e.exports.create=function(e,t,i,a){var r,s;if(e==null){throw new Error("Root element needs a name.")}a=l({},t,i,a);r=new n(a);s=r.element(e);if(!a.headless){r.declaration(a);if(a.pubID!=null||a.sysID!=null){r.dtd(a)}}return s};e.exports.begin=function(e,t,i){var a;if(c(e)){a=[e,t],t=a[0],i=a[1];e={}}if(t){return new s(e,t,i)}else{return new n(e)}};e.exports.stringWriter=function(e){return new p(e)};e.exports.streamWriter=function(e,t){return new o(e,t)};e.exports.implementation=new r;e.exports.nodeType=t;e.exports.writerState=a}).call(this)},4091:e=>{"use strict";e.exports=function(e){e.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next){yield e.value}}}},665:(e,t,i)=>{"use strict";e.exports=Yallist;Yallist.Node=Node;Yallist.create=Yallist;function Yallist(e){var t=this;if(!(t instanceof Yallist)){t=new Yallist}t.tail=null;t.head=null;t.length=0;if(e&&typeof e.forEach==="function"){e.forEach((function(e){t.push(e)}))}else if(arguments.length>0){for(var i=0,a=arguments.length;i1){i=t}else if(this.head){a=this.head.next;i=this.head.value}else{throw new TypeError("Reduce of empty list with no initial value")}for(var r=0;a!==null;r++){i=e(i,a.value,r);a=a.next}return i};Yallist.prototype.reduceReverse=function(e,t){var i;var a=this.tail;if(arguments.length>1){i=t}else if(this.tail){a=this.tail.prev;i=this.tail.value}else{throw new TypeError("Reduce of empty list with no initial value")}for(var r=this.length-1;a!==null;r--){i=e(i,a.value,r);a=a.prev}return i};Yallist.prototype.toArray=function(){var e=new Array(this.length);for(var t=0,i=this.head;i!==null;t++){e[t]=i.value;i=i.next}return e};Yallist.prototype.toArrayReverse=function(){var e=new Array(this.length);for(var t=0,i=this.tail;i!==null;t++){e[t]=i.value;i=i.prev}return e};Yallist.prototype.slice=function(e,t){t=t||this.length;if(t<0){t+=this.length}e=e||0;if(e<0){e+=this.length}var i=new Yallist;if(tthis.length){t=this.length}for(var a=0,r=this.head;r!==null&&athis.length){t=this.length}for(var a=this.length,r=this.tail;r!==null&&a>t;a--){r=r.prev}for(;r!==null&&a>e;a--,r=r.prev){i.push(r.value)}return i};Yallist.prototype.splice=function(e,t,...i){if(e>this.length){e=this.length-1}if(e<0){e=this.length+e}for(var a=0,r=this.head;r!==null&&a{const{_:t}=(0,m.default)(e,{configuration:{"short-option-groups":false,"camel-case-expansion":false,"dot-notation":false,"parse-numbers":false,"parse-positional-numbers":false,"boolean-negation":false,"duplicate-arguments-array":false,"greedy-arrays":false,"unknown-options-as-args":true}});return t};t.parseOptions=parseOptions;const expandShellVariables=(e,t)=>{const i=Object.keys(e)[0];const a=[...e[i]];const r=[];a.forEach((e=>{const i=new RegExp("\\$\\{?(\\w+)\\}?","g");const a=[...e.matchAll(i)];a.forEach((i=>{const a=i[1];e=e.replace(new RegExp(`\\$\\{?${a}\\}?`),t[a])}));r.push(e)}));if(!(0,h.default)(r,a)){c.info(`==> Expanded shell variables in ${i}: ${r}`)}return r};const buildPackage=async(e,i,a,r,n,s,m,h,v,b,x,w,S,N,E,C,_)=>{c.startGroup(`Build ${e}`);const[,O]=e.split("/");try{let e;let P=[];if(O==="ecbundle"){const e=l.default.join(l.default.resolve(i));await(0,g.extendPaths)(w,e,O);c.endGroup();return true}if(n){return await ecbundleBuild(h,N,S,w,s,m,a,l.default.resolve(i),E,C)}if(r){e="cmake";P.push(`-DCMAKE_INSTALL_PREFIX=${a}`)}else if(O==="ecbuild"){e=l.default.join(l.default.resolve(i),"bin","ecbuild");P.push(`--prefix=${a}`)}else{e="ecbuild";P.push(`--prefix=${a}`)}c.info(`==> configurePath: ${e}`);const R=l.default.resolve(i);c.info(`==> srcDir: ${R}`);if(_&&p.default.existsSync(_)){P.push(`-DCMAKE_TOOLCHAIN_FILE=${_}`);c.info(`==> using toolchain file: ${_}`)}const T=l.default.join(R,".github",".cmake-options");const A=l.default.join(R,".github",".compiler-flags");if(p.default.existsSync(T)){const e=p.default.readFileSync(T).toString();c.info(`==> Found ${T}: ${e}`);P.push(...(0,t.parseOptions)(e))}else if(p.default.existsSync(A)){const e=p.default.readFileSync(A).toString();c.info(`==> Found ${A}: ${e}`);c.warning("Magic file path `.github/.compiler-flags` has been deprecated, please migrate to `.github/.cmake-options`");P.push(...(0,t.parseOptions)(e))}const D=h&&v&&b.startsWith("ubuntu")&&x.startsWith("gnu");if(D){c.info("==> Code coverage collection enabled, installing lcov...");c.info("==> Checking if lcov is installed...");const e=await d.exec("dpkg-query",["-W","lcov"],{ignoreReturnCode:true})==0;if(!e){c.info("==> lcov not found, installing...");let e=await d.exec("sudo",["apt-get","-y","-q","update"]);if((0,y.isError)(e,"Error updating apt repositories"))return false;e=await d.exec("sudo",["apt-get","-y","-q","install","lcov"]);if((0,y.isError)(e,"Error installing lcov"))return false}else{c.info("==> lcov is already installed")}const t="--coverage";P.push(`-DCMAKE_C_FLAGS='${t}'`);P.push(`-DCMAKE_CXX_FLAGS='${t}'`);P.push(`-DCMAKE_Fortran_FLAGS='--coverage'`)}else if(h&&v){c.info(`Skipping code coverage collection on unsupported platform: ${x}@${b}`)}if(s){P.push(...(0,t.parseOptions)(s))}c.info(`==> configureOptions: ${P}`);let I=[];if(m){I.push(...(0,t.parseOptions)(m));c.info(`==> testOptions: ${I}`)}const B=l.default.join(R,"build");c.info(`==> buildDir: ${B}`);await(0,u.mkdirP)(B);const L={cwd:B,env:{CMAKE_BUILD_PARALLEL_LEVEL:S,...h?{CTEST_OUTPUT_ON_FAILURE:"1"}:{},...h?{CTEST_PARALLEL_LEVEL:S}:{},...o.default.env,...w}};c.info(`==> options.env: ${JSON.stringify(L.env,null,4)}`);P=expandShellVariables({configureOptions:P},L.env);I=expandShellVariables({testOptions:I},L.env);await(0,u.mkdirP)(a);let M=await d.exec("env",[e,...P,R],L);if((0,y.isError)(M,"Error configuring package"))return false;M=await d.exec("env",["cmake","--build","."],L);if((0,y.isError)(M,"Error building package"))return false;M=await d.exec("env",["cmake","--install","."],L);if((0,y.isError)(M,"Error installing package"))return false;await(0,g.extendPaths)(w,a,O);if(h){M=await d.exec("env",["ctest",...I],L);if((0,y.isError)(M,"Error testing package"))return false;if(D){const e=`${B}/coverage.info`;const t=`${B}/coverage`;M=await d.exec("env",["lcov","--capture","--directory",B,"--output-file",e],L);if((0,y.isError)(M,"Error collecting code coverage"))return false;M=await d.exec("env",["lcov","--remove",e,"--output-file",e,"/usr/*",`${l.default.dirname(a)}/*`,`${B}/*`],L);if((0,y.isError)(M,"Error cleaning up code coverage"))return false;M=await d.exec("env",["lcov","--list",e],L);if((0,y.isError)(M,"Error listing code coverage text report"))return false;M=await d.exec("env",["genhtml",e,"--output-directory",t],L);if((0,y.isError)(M,"Error generating code coverage HTML report"))return false;w.COVERAGE_FILE=e;w.COVERAGE_DIR=t}}if(E){const e=await cpack(L,i,B,w,E,C);if((0,y.isError)(!e,"Error generating package."))return false}}catch(e){if(e instanceof Error)(0,y.isError)(true,e.message);return false}c.endGroup();return true};const ecbundleBuild=async(e,i,a,r,n,s,p,u,m,h)=>{const g={cwd:u,env:{CMAKE_BUILD_PARALLEL_LEVEL:a,...e?{CTEST_OUTPUT_ON_FAILURE:"1"}:{},...e?{CTEST_PARALLEL_LEVEL:a}:{},...o.default.env,...r}};let v=await d.exec("env",["ecbundle","create",`--github-token=${i}`,"--shallow",`--threads=${a}`],g);if((0,y.isError)(v,"Error creating bundle"))return false;let b=[];if(n){b.push(...(0,t.parseOptions)(n))}b=expandShellVariables({configureOptions:b},g.env);v=await d.exec("env",["ecbundle","build",`--install`,`--threads=${a}`,`--install-dir=${p}`,...b.length?[`--cmake="${b.join(" ")}"`]:[]],g);if((0,y.isError)(v,"Error building bundle"))return false;if(e){let e=[];if(s){e.push(...(0,t.parseOptions)(s));c.info(`==> testOptions: ${e}`)}e=expandShellVariables({testOptions:e},g.env);g.cwd=l.default.join(u,"build");v=await d.exec("env",["ctest",...e],g);if((0,y.isError)(v,"Error testing bundle"))return false}if(m){const e=await cpack(g,u,l.default.join(u,"build"),r,m,h);if((0,y.isError)(!e,"Error generating package."))return false}c.endGroup();return true};const cpack=async(e,i,a,r,n,s)=>{const o=[];if(s){o.push(...(0,t.parseOptions)(s));c.info(`==> cpackOptionsParsed: ${o}`)}e.cwd=a;const u=await d.exec("env",["cpack","-G",n.toUpperCase(),...o],e);if((0,y.isError)(u,"Error while generating package"))return false;const m=(0,y.getProjectVersion)(i);if((0,y.isError)(!m,"Error reading version number")){return false}const h=p.default.readdirSync(a).filter((e=>l.default.extname(e)===`.${n.toLowerCase()}`));if(h.length==1){r.PACKAGE_PATH=l.default.join(a,h[0])}else{(0,y.isError)(true,"Generated binary not found");return false}return true};t["default"]=buildPackage},602:function(e,t,i){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,t,i,a){if(a===undefined)a=i;var r=Object.getOwnPropertyDescriptor(t,i);if(!r||("get"in r?!t.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return t[i]}}}Object.defineProperty(e,a,r)}:function(e,t,i,a){if(a===undefined)a=i;e[a]=t[i]});var r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i))a(t,e,i);r(t,e);return t};var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.saveCache=t.restoreCache=t.getCacheKey=t.getCacheKeyHash=void 0;const o=n(i(2186));const p=i(7799);const l=i(6762);const c=s(i(6113));const d=i(3837);const u=s(i(7729));const m=i(4147);const h=i(3670);const g=i(8123);const y=i(4833);const v=i(6832);const getCacheKeyHash=(e,t,i,a,r,n,s={})=>{const p=[];if(r){p.push(...(0,y.parseOptions)(r));p.sort()}let l=`v=${m.version}${t}::cmake=${i.CMAKE_VERSION}::options=${p.join()}::${e}=${n}`;const d=(0,v.getDependenciesFromTree)(e,a,null);for(const[t,r]of Object.entries(i.DEPENDENCIES||{}).sort(((e,t)=>e[0]>t[0]?1:-1))){const[,i]=t.split("/");if(!d.includes(i)&&i in a){continue}if(i===e)continue;l+=`::${i}=${r}`;if(s[i]){const e=[];e.push(...(0,y.parseOptions)(s[i]));e.sort();l+=`::${i}-options=${e.join()}`}}o.info(`==> cacheKeyStr: ${l}`);const u=c.default.createHash("sha1").update(l).digest("hex");return u};t.getCacheKeyHash=getCacheKeyHash;const getCacheKey=async(e,i,a,r,n,s,p,c,d,u={})=>{o.startGroup(`Cache Key for ${e}`);const[m,h]=e.split("/");o.info(`==> Repository: ${m}/${h}`);let y;const v={};const b=new l.Octokit({auth:a});if(/^[0-9a-f]{40}$/i.test(i)){o.info(`==> Hash: ${i}`);v.headSha=i}else{if(/^refs\/tags\//.test(i)){i=i.replace(/^refs\/tags\//,"");y=`tags/${i}`}else{i=i.replace(/^refs\/heads\//,"");y=`heads/${i}`}o.info(`==> Branch: ${i}`);o.info(`==> Ref: ${y}`);try{const e=await b.request("GET /repos/{owner}/{repo}/git/ref/{ref}",{owner:m,repo:h,ref:y});(0,g.isError)(e.status!=200,`Wrong response code while fetching repository HEAD for ${h}: ${e.status}`);v.headSha=e.data.object.sha}catch(e){if(e instanceof Error)(0,g.isError)(true,`Error getting repository HEAD for ${h}: ${e.message}`)}}o.info(`==> result.headSha: ${v.headSha}`);const x=(0,t.getCacheKeyHash)(h,s,p,c,d,v.headSha,u);o.info(`==> cacheKeySha: ${x}`);v.cacheKey=`${r}-${n}-${h}-${x}`;o.info(`==> result.cacheKey: ${v.cacheKey}`);o.endGroup();return v};t.getCacheKey=getCacheKey;const restoreCache=async(e,i,a,r,n,s,l,c,d,u,m={})=>{const{cacheKey:y,headSha:v}=await(0,t.getCacheKey)(e,i,a,n,s,l,c,d,u,m);o.startGroup(`Restore ${e} Cache`);let b;try{b=Boolean(await(0,p.restoreCache)([r],y))}catch(t){if(t instanceof Error)(0,g.isError)(true,`Error restoring cache for ${e}: ${t.message}`);return false}o.info(`==> cacheHit: ${b}`);if(b){const[,t]=e.split("/");await(0,h.extendPaths)(c,r,t);await(0,h.extendDependencies)(c,e,v)}o.endGroup();return b};t.restoreCache=restoreCache;const saveCache=async(e,i,a,r,n,s,l,c,m,h,y={})=>{const{cacheKey:v}=await(0,t.getCacheKey)(e,i,a,n,s,l,c,m,h,y);o.startGroup(`Save ${e} Cache`);const b=(0,d.promisify)(u.default);const x=await b(r);if(!x){(0,g.isError)(true,`Empty target dir, skipping saving cache for ${e}`);return false}let w;try{w=Boolean(await(0,p.saveCache)([r],v))}catch(t){if(t instanceof Error)(0,g.isError)(true,`Error saving cache for ${e}: ${t.message}`);return false}o.info(`==> isSaved: ${w}`);o.endGroup();return w};t.saveCache=saveCache},9946:function(e,t,i){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,t,i,a){if(a===undefined)a=i;var r=Object.getOwnPropertyDescriptor(t,i);if(!r||("get"in r?!t.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return t[i]}}}Object.defineProperty(e,a,r)}:function(e,t,i,a){if(a===undefined)a=i;e[a]=t[i]});var r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i))a(t,e,i);r(t,e);return t};var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const o=s(i(7147));const p=s(i(1017));const l=i(4300);const c=n(i(2186));const d=i(7436);const u=i(6762);const m=s(i(6761));const h=i(4948);const g=s(i(4674));const y=i(3670);const v=i(8123);const b=i(602);const downloadArtifact=async(e,t,i,a,r,n,s,x,w,S,N,E={})=>{c.startGroup(`Download ${e} Artifact`);const[C,_]=e.split("/");c.info(`==> Repository: ${C}/${_}`);t=t.replace(/^refs\/heads\//,"");c.info(`==> Branch: ${t}`);const O=new u.Octokit({auth:i});let P;if(/^[0-9a-f]{40}$/i.test(t)){c.info(`==> Hash: ${t}`);P=t}else{try{const e=await O.request("GET /repos/{owner}/{repo}/git/ref/{ref}",{owner:C,repo:_,ref:`heads/${t}`});if((0,v.isError)(e.status!=200,`Wrong response code while fetching repository HEAD for ${_}: ${e.status}`))return false;P=e.data.object.sha}catch(e){if(e instanceof Error)(0,v.isError)(true,`Error getting repository HEAD for ${_}: ${e.message}`);return false}}c.info(`==> headSha: ${P}`);let R;if(_==="ecbuild"){R=`ecbuild-${n}-cmake-${x.CMAKE_VERSION}-${P}`}else{const{cacheKey:t}=await(0,b.getCacheKey)(e,P,i,n,s,S,x,w,N,E);R=t}let T;try{const e=await O.request("GET /repos/{owner}/{repo}/actions/artifacts",{owner:C,repo:_,name:R});if((0,v.isError)(e.status!=200,`Wrong response code while fetching artifacts for ${_}: ${e.status}`))return false;T=e.data.artifacts}catch(e){if(e instanceof Error)(0,v.isError)(true,`Error fetching artifacts for ${_}: ${e.message}`);return false}c.info(`==> Artifacts: ${T.length}`);if(!T.length){(0,v.isError)(true,`No workflow artifacts found for ${_}`);return false}T=T.filter((e=>e.name===R));if((0,v.isError)(!T.length,`No suitable artifact found: ${R}`))return false;const A=T.shift();c.info(`==> artifactName: ${R}`);c.info(`==> artifactId: ${A===null||A===void 0?void 0:A.id}`);let D;try{const e=await O.request("GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}",{owner:C,repo:_,artifact_id:A===null||A===void 0?void 0:A.id,archive_format:"zip"});if((0,v.isError)(e.status===302||e.status!==200,`Wrong response code while downloading workflow run artifact for ${_}: ${e.status}`))return false;D=e.data}catch(e){if(e instanceof Error)(0,v.isError)(true,`Error downloading workflow run artifact for ${_}: ${e.message}`);return false}const I=(0,h.filesize)(A===null||A===void 0?void 0:A.size_in_bytes);c.info(`==> Downloaded: ${A===null||A===void 0?void 0:A.name}.zip (${I})`);const B=p.default.resolve(p.default.join(a,A===null||A===void 0?void 0:A.name));await(0,d.mkdirP)(B);const L=new m.default(l.Buffer.from(D));L.getEntries().forEach((e=>{const t=e.isDirectory?"creating":"inflating";const i=`${B}/${e.entryName}`;c.info(` ${t}: ${i}`)}));L.extractAllTo(B,true);c.info(`==> Extracted artifact ZIP archive to ${B}`);const M=p.default.join(B,`${R}.tar`);const k=p.default.join(B,`${R}-dependencies.json`);if(o.default.existsSync(k)){const e=o.default.readFileSync(k).toString();c.info(`==> Found ${k}`);const t=JSON.parse(e);for(const[e,i]of Object.entries(t)){if(x.DEPENDENCIES&&x.DEPENDENCIES[e]&&x.DEPENDENCIES[e]!==i){o.default.unlinkSync(M);o.default.unlinkSync(k);(0,v.isError)(true,`Error matching dependency ${e} for ${_}: ${x.DEPENDENCIES[e]} !== ${i}`);return false}}o.default.unlinkSync(k)}(0,d.mkdirP)(r);try{await g.default.x({C:r,file:M})}catch(e){if(e instanceof Error)(0,v.isError)(true,`Error extracting artifact TAR for ${_}: ${e.message}`);return false}c.info(`==> Extracted artifact TAR to ${r}`);o.default.unlinkSync(M);await(0,y.extendPaths)(x,r,_);await(0,y.extendDependencies)(x,e,P);c.endGroup();return true};t["default"]=downloadArtifact},4718:function(e,t,i){"use strict";var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const r=a(i(7147));const n=i(6255);const downloadFile=(e,t)=>new Promise(((i,a)=>(new n.HttpClient).get(e).then((e=>{const n=r.default.createWriteStream(t);e.message.pipe(n).on("finish",(()=>{n.close((()=>{i(true)}))})).on("error",(e=>{r.default.unlink(t,(()=>{a(e.message)}))}))})).catch((e=>{a(e.message)}))));t["default"]=downloadFile},5769:function(e,t,i){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,t,i,a){if(a===undefined)a=i;var r=Object.getOwnPropertyDescriptor(t,i);if(!r||("get"in r?!t.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return t[i]}}}Object.defineProperty(e,a,r)}:function(e,t,i,a){if(a===undefined)a=i;e[a]=t[i]});var r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i))a(t,e,i);r(t,e);return t};var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const o=s(i(7147));const p=s(i(1017));const l=n(i(2186));const c=i(7436);const d=i(6762);const u=i(4948);const m=s(i(4674));const h=s(i(4718));const g=i(3670);const y=i(8123);const downloadRepository=async(e,t,i,a,r)=>{l.startGroup(`Download ${e} Repository`);const[n,s]=e.split("/");l.info(`==> Repository: ${n}/${s}`);let v;let b;const x=new d.Octokit({auth:i});if(/^[0-9a-f]{40}$/i.test(t)){l.info(`==> Hash: ${t}`);b=t;v=b}else{if(/^refs\/tags\//.test(t)){t=t.replace(/^refs\/tags\//,"");v=`tags/${t}`}else{t=t.replace(/^refs\/heads\//,"");v=`heads/${t}`}l.info(`==> Branch: ${t}`);l.info(`==> Ref: ${v}`);try{const e=await x.request("GET /repos/{owner}/{repo}/git/ref/{ref}",{owner:n,repo:s,ref:v});if((0,y.isError)(e.status!=200,`Wrong response code while fetching repository HEAD for ${s}: ${e.status}`))return false;b=e.data.object.sha}catch(e){if(e instanceof Error)(0,y.isError)(true,`Error getting repository HEAD for ${s}: ${e.message}`);return false}}let w;try{const e=await x.request("GET /repos/{owner}/{repo}/tarball/{ref}",{owner:n,repo:s,ref:v});if((0,y.isError)(e.status===302||e.status!==200,`Wrong response code while fetching repository download URL for ${s}: ${e.status}`))return false;w=e.url}catch(e){if(e instanceof Error)(0,y.isError)(true,`Error getting repository download URL for ${s}: ${e.message}`);return false}l.info(`==> URL: ${w}`);const S=`${s}.tar.gz`;try{await(0,h.default)(w,S)}catch(e){if(e instanceof Error)(0,y.isError)(true,`Error downloading repository archive for ${s}: ${e.message}`);return false}const N=o.default.statSync(S);if((0,y.isError)(!N.size,`Error determining size of repository archive for ${s}`))return false;const E=(0,u.filesize)(N.size);l.info(`==> Downloaded: ${S} (${E})`);const C=p.default.join(a,s);await(0,c.mkdirP)(C);try{await m.default.x({C:C,file:S,strip:1})}catch(e){if(e instanceof Error)(0,y.isError)(true,`Error extracting repository archive for ${s}: ${e.message}`);return false}l.info(`==> Extracted ${S} to ${C}`);o.default.unlinkSync(S);await(0,g.extendDependencies)(r,e,b);l.endGroup();return true};t["default"]=downloadRepository},3670:function(e,t,i){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,t,i,a){if(a===undefined)a=i;var r=Object.getOwnPropertyDescriptor(t,i);if(!r||("get"in r?!t.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return t[i]}}}Object.defineProperty(e,a,r)}:function(e,t,i,a){if(a===undefined)a=i;e[a]=t[i]});var r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i))a(t,e,i);r(t,e);return t};Object.defineProperty(t,"__esModule",{value:true});t.extendDependencies=t.extendPaths=t.setupEnv=void 0;const s=n(i(7282));const o=n(i(2186));const p=n(i(1514));const l=i(8123);const setupEnv=async(e,t,i,a)=>{o.startGroup("Setup Environment");const r={CC:t,CXX:i,FC:a};o.info(`==> Compiler env: ${JSON.stringify(r)}`);let n="{}";const s={listeners:{stdout:e=>{n=e.toString()}}};let c=await p.exec("env",["cmake","-E","capabilities"],s);if((0,l.isError)(c,"CMake capabilities command failed"))return r;let d;try{const e=JSON.parse(n);d=e.version.string}catch(e){if(e instanceof Error)(0,l.isError)(true,`CMake capabilities JSON parsing failed: ${e.message}`);return r}if((0,l.isError)(!d,"CMake version string not found"))return r;r.CMAKE_VERSION=d;o.info(`==> CMake version: ${r.CMAKE_VERSION}`);if(/^macos-/.test(e)){n="";c=await p.exec("env",["brew","--prefix","openssl"],s);if((0,l.isError)(c,"Homebrew command failed"))return r;if((0,l.isError)(!n,"Homebrew OpenSSL prefix not found"))return r;const e=n.replace(/\n$/,"");r.OPENSSL_ROOT_DIR=e;r.OPENSSL_INCLUDE_DIR=`${e}/include`;o.info(`==> OpenSSL prefix: ${r.OPENSSL_ROOT_DIR}`)}o.endGroup();return r};t.setupEnv=setupEnv;const extendPaths=async(e,t,i)=>{if(!e)return;if(e.PATH){e.PATH=`${t}/bin:${e.PATH}`}else if(s.env.PATH){e.PATH=`${t}/bin:${s.env.PATH}`}else{e.PATH=`${t}/bin`}o.info(`==> Extended local PATH variable to include ${t}/bin`);if(e.BIN_PATH){e.BIN_PATH=`${t}/bin:${e.BIN_PATH}`}else{e.BIN_PATH=`${t}/bin`}if(e.INCLUDE_PATH){e.INCLUDE_PATH=`${t}/include:${e.INCLUDE_PATH}`}else{e.INCLUDE_PATH=`${t}/include`}if(e.INSTALL_PATH){e.INSTALL_PATH=`${t}:${e.INSTALL_PATH}`}else{e.INSTALL_PATH=t}if(e.LIB_PATH){e.LIB_PATH=`${t}/lib:${t}/lib64:${e.LIB_PATH}`}else{e.LIB_PATH=`${t}/lib:${t}/lib64`}e[`${i}_DIR`]=t;e[`${i.toUpperCase()}_DIR`]=t;e[`${i.toUpperCase()}_PATH`]=t};t.extendPaths=extendPaths;const extendDependencies=async(e,t,i)=>{if(!e)return;if(e.DEPENDENCIES instanceof Object){Object.assign(e.DEPENDENCIES,{...e.DEPENDENCIES,[t]:i})}else{e.DEPENDENCIES={[t]:i}}o.info(`==> Extended list of dependencies to include ${t}: ${i}`)};t.extendDependencies=extendDependencies},8123:function(e,t,i){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,t,i,a){if(a===undefined)a=i;var r=Object.getOwnPropertyDescriptor(t,i);if(!r||("get"in r?!t.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return t[i]}}}Object.defineProperty(e,a,r)}:function(e,t,i,a){if(a===undefined)a=i;e[a]=t[i]});var r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i))a(t,e,i);r(t,e);return t};var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.getProjectVersion=t.isError=void 0;const o=n(i(2186));const p=s(i(7147));const l=s(i(1017));const isError=(e,t)=>{if(e){o.warning(t);o.endGroup();return true}return false};t.isError=isError;const getProjectVersion=e=>{const i=l.default.join(e,"VERSION");if(p.default.existsSync(i)){try{const e=p.default.readFileSync(i,"utf-8").trim();return e}catch(e){if(e instanceof Error)(0,t.isError)(true,`Error reading ${i}. Using VERSION is the preferred method.`)}}const a=l.default.join(e,"CMakeLists.txt");try{const e=p.default.readFileSync(a,"utf-8");const t=/project\([\s\w]+VERSION\s+((?:\d+)(?:.\d+){0,3})/;const i=e.match(t);if(i&&i[1]){return i[1]}return""}catch(e){if(e instanceof Error)(0,t.isError)(true,`Error loading data from ${a}`);return""}};t.getProjectVersion=getProjectVersion},6144:function(e,t,i){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,t,i,a){if(a===undefined)a=i;var r=Object.getOwnPropertyDescriptor(t,i);if(!r||("get"in r?!t.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return t[i]}}}Object.defineProperty(e,a,r)}:function(e,t,i,a){if(a===undefined)a=i;e[a]=t[i]});var r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i))a(t,e,i);r(t,e);return t};var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const o=n(i(2186));const p=s(i(399));(0,p.default)().then((e=>{o.startGroup("Set Outputs");o.info(`==> bin_path: ${e.bin_path}`);o.info(`==> include_path: ${e.include_path}`);o.info(`==> install_path: ${e.install_path}`);o.info(`==> lib_path: ${e.lib_path}`);if(e.coverage_file){o.info(`==> coverage_file: ${e.coverage_file}`)}if(e.package_path){o.info(`==> package_path: ${e.package_path}`)}o.setOutput("bin_path",e.bin_path);o.setOutput("include_path",e.include_path);o.setOutput("install_path",e.install_path);o.setOutput("lib_path",e.lib_path);if(e.coverage_file){o.setOutput("coverage_file",e.coverage_file)}if(e.package_path){o.setOutput("package_path",e.package_path)}o.endGroup()})).catch((e=>{o.setFailed(e)}))},399:function(e,t,i){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,t,i,a){if(a===undefined)a=i;var r=Object.getOwnPropertyDescriptor(t,i);if(!r||("get"in r?!t.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return t[i]}}}Object.defineProperty(e,a,r)}:function(e,t,i,a){if(a===undefined)a=i;e[a]=t[i]});var r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i))a(t,e,i);r(t,e);return t};var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const o=n(i(1017));const p=n(i(2186));const l=i(3670);const c=i(602);const d=s(i(9946));const u=s(i(8183));const m=s(i(5769));const h=s(i(4833));const g=i(6832);const main=async()=>{try{const e=p.getInput("workspace",{required:true});const t=p.getInput("repository",{required:true});const i=p.getInput("sha",{required:true});const a=p.getBooleanInput("cmake",{required:true});const r=p.getBooleanInput("ecbundle",{required:true});const n=p.getInput("cmake_options",{required:false});const s=p.getInput("ctest_options",{required:false});const y=p.getBooleanInput("self_build",{required:true});const v=p.getBooleanInput("self_test",{required:true});const b=p.getBooleanInput("self_coverage",{required:true});const x=p.getMultilineInput("dependencies",{required:false});const w=p.getInput("dependency_branch",{required:true});const S=p.getMultilineInput("dependency_cmake_options",{required:false})||[];const N=p.getBooleanInput("force_build",{required:true});const E=p.getInput("cache_suffix",{required:false})||"";const C=p.getBooleanInput("recreate_cache",{required:true});const _=p.getBooleanInput("save_cache",{required:true});const O=p.getInput("os",{required:true});const P=p.getInput("compiler",{required:false});const R=p.getInput("compiler_cc",{required:false});const T=p.getInput("compiler_cxx",{required:false});const A=p.getInput("compiler_fc",{required:false});const D=p.getInput("toolchain_file",{required:false});const I=p.getInput("github_token",{required:true});const B=p.getInput("install_dir",{required:true});const L=p.getInput("download_dir",{required:true});const M=p.getInput("parallelism_factor",{required:false});const k=p.getInput("cpack_generator",{required:false});const z=p.getInput("cpack_options",{required:false});const j=["DEB","RPM"];if(k&&!j.includes(k.toUpperCase())){return Promise.reject(`Invalid or unsupported cpack generator: ${k}`)}const q={};for(const e of S){const[t,i]=e.split(/:\s?(.+)/);if(!t||!i)return Promise.reject(`Unexpected CMake option, must be in 'owner/repo: option' format: ${e}`);q[t]=i.replace(/^['"]|['"]$/g,"")}const U=await(0,l.setupEnv)(O,R,T,A);if(!U)return Promise.reject("Error setting up build environment");const H=(0,g.loadTree)();if(!H)return Promise.reject("Error Loading dependency tree");for(const e of x){const[t,i]=e.split("@");const[n,s]=t.split("/");const p=q[t];if(!n||!s)return Promise.reject(`Unexpected dependency name, must be in 'owner/repo[@branch]' format: ${e}`);const l=i||w;if(!N&&s!=="ecbundle"){const e=await(0,d.default)(t,l,I,L,o.join(B,s),O,P,U,H,E,p);if(e)continue}if(!C&&s!=="ecbundle"){const e=await(0,c.restoreCache)(t,l,I,o.join(B,s),O,P,E,U,H,p);if(e)continue}const u=await(0,m.default)(t,l,I,L,U);if(!u)return Promise.reject("Error downloading repository");const g=await(0,h.default)(t,o.join(L,s),o.join(B,s),a,r,p,null,false,false,O,P,U,M,I,undefined,undefined,D);if(!g)return Promise.reject("Error building dependency");if(_&&s!=="ecbundle"){await(0,c.saveCache)(t,l,I,o.join(B,s),O,P,E,U,H,p)}}if(y){const[p,l]=t.split("@");const[,d]=p.split("/");const m=l||i;let g;if(!C&&!k){g=await(0,c.restoreCache)(p,m,I,o.join(B,d),O,P,E,U,H,n,q)}if(C||!g){const t=await(0,h.default)(p,e,o.join(B,d),a,r,n,s,v,b,O,P,U,M,I,k,z,D);if(!t)return Promise.reject("Error building package");if(_){await(0,c.saveCache)(p,m,I,o.join(B,d),O,P,E,U,H,n,q);await(0,u.default)(p,m,o.join(B,d),U.DEPENDENCIES,O,P,U,H,I,E,n,q)}if(b&&U.COVERAGE_DIR)await(0,u.default)(`coverage-${d}`,m,U.COVERAGE_DIR,null,O,P,U,H,I,E,n,q)}}const V={bin_path:U.BIN_PATH,include_path:U.INCLUDE_PATH,install_path:U.INSTALL_PATH,lib_path:U.LIB_PATH};if(b&&U.COVERAGE_FILE){V.coverage_file=U.COVERAGE_FILE}if(k&&U.PACKAGE_PATH){V.package_path=U.PACKAGE_PATH}return Promise.resolve(V)}catch(e){if(e instanceof Error)return Promise.reject(e.message);return Promise.reject()}};t["default"]=main},6832:function(e,t,i){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,t,i,a){if(a===undefined)a=i;var r=Object.getOwnPropertyDescriptor(t,i);if(!r||("get"in r?!t.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return t[i]}}}Object.defineProperty(e,a,r)}:function(e,t,i,a){if(a===undefined)a=i;e[a]=t[i]});var r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i))a(t,e,i);r(t,e);return t};var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.getDependenciesFromTree=t.loadTree=void 0;const o=n(i(1917));const p=i(8123);const l=n(i(2186));const c=s(i(7282));const loadTree=()=>{l.startGroup("Load dependency tree");if(!c.default.env.DEP_TREE){return{}}let e;try{e=o.load(c.default.env.DEP_TREE)}catch(e){if(e instanceof Error)(0,p.isError)(true,`Error loading dependency tree from $DEP_TREE`);return{}}l.info(`Dependency tree: ${JSON.stringify(e,null,4)}`);l.endGroup();return e};t.loadTree=loadTree;const getDependenciesFromTree=(e,i,a)=>{if(!a){a=[]}if(i[e]==null){return a}for(const r of i[e].deps){a.push(r);if(r in i){(0,t.getDependenciesFromTree)(r,i,a)}}return[...new Set(a)]};t.getDependenciesFromTree=getDependenciesFromTree},8183:function(e,t,i){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,t,i,a){if(a===undefined)a=i;var r=Object.getOwnPropertyDescriptor(t,i);if(!r||("get"in r?!t.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return t[i]}}}Object.defineProperty(e,a,r)}:function(e,t,i,a){if(a===undefined)a=i;e[a]=t[i]});var r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i))a(t,e,i);r(t,e);return t};var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const o=s(i(7147));const p=s(i(1017));const l=n(i(2186));const c=n(i(2605));const d=s(i(4674));const u=i(4948);const m=i(8123);const h=i(602);const uploadArtifact=async(e,t,i,a,r,n,s,g,y,v,b,x={})=>{l.startGroup(`Upload ${e} Artifact`);const[w]=e.split("/");let[,S]=e.split("/");if(!S)S=w;let N;if(S==="ecbuild"){N=`ecbuild-${r}-cmake-${s.CMAKE_VERSION}-${t}`}else{const{cacheKey:i}=await(0,h.getCacheKey)(e,t,y,r,n||"",v,s,g,b,x);N=i}const E=`${N}.tar`;const C=p.default.dirname(i);const _=p.default.join(C,E);try{await d.default.c({C:i,file:_,gzip:true},["."])}catch(e){if(e instanceof Error)(0,m.isError)(true,`Error creating artifact TAR for ${S}: ${e.message}`);return false}const O=o.default.statSync(_);if((0,m.isError)(!O.size,`Error determining size of artifact TAR for ${S}`))return false;const P=(0,u.filesize)(O.size);l.info(`==> Created artifact TAR: ${_} (${P})`);const R=[_];if(a){const e=`${N}-dependencies.json`;const t=p.default.join(C,e);const i=JSON.stringify(a);try{o.default.writeFileSync(t,i)}catch(e){if(e instanceof Error)(0,m.isError)(true,`Error writing dependencies file for ${S}: ${e.message}`);return false}l.info(`==> Created dependencies file: ${t}`);R.push(t)}const T=c.create();let A;try{A=await T.uploadArtifact(N,R,C,{continueOnError:true})}catch(e){if(e instanceof Error)(0,m.isError)(true,`Error uploading artifact for ${S}: ${e.message}`);return false}if((0,m.isError)(!A,`Error uploading artifact for ${S}`))return false;if((0,m.isError)(A&&A.failedItems&&A.failedItems.length,`Error uploading artifact for ${S}: ${A.failedItems}`)){return false}l.info(`==> Uploaded artifact: ${A.artifactName} (${(0,u.filesize)(A.size)})`);o.default.unlinkSync(_);l.endGroup();return true};t["default"]=uploadArtifact},2877:module=>{module.exports=eval("require")("encoding")},2941:module=>{module.exports=eval("require")("original-fs")},5670:e=>{function webpackEmptyContext(e){var t=new Error("Cannot find module '"+e+"'");t.code="MODULE_NOT_FOUND";throw t}webpackEmptyContext.keys=()=>[];webpackEmptyContext.resolve=webpackEmptyContext;webpackEmptyContext.id=5670;e.exports=webpackEmptyContext},9491:e=>{"use strict";e.exports=require("assert")},4300:e=>{"use strict";e.exports=require("buffer")},2081:e=>{"use strict";e.exports=require("child_process")},6113:e=>{"use strict";e.exports=require("crypto")},2361:e=>{"use strict";e.exports=require("events")},7147:e=>{"use strict";e.exports=require("fs")},3685:e=>{"use strict";e.exports=require("http")},5687:e=>{"use strict";e.exports=require("https")},1808:e=>{"use strict";e.exports=require("net")},2037:e=>{"use strict";e.exports=require("os")},1017:e=>{"use strict";e.exports=require("path")},4074:e=>{"use strict";e.exports=require("perf_hooks")},7282:e=>{"use strict";e.exports=require("process")},5477:e=>{"use strict";e.exports=require("punycode")},2781:e=>{"use strict";e.exports=require("stream")},1576:e=>{"use strict";e.exports=require("string_decoder")},9512:e=>{"use strict";e.exports=require("timers")},4404:e=>{"use strict";e.exports=require("tls")},7310:e=>{"use strict";e.exports=require("url")},3837:e=>{"use strict";e.exports=require("util")},9796:e=>{"use strict";e.exports=require("zlib")},4948:(e,t)=>{"use strict"; +const a=i(7147);const r=i(2037);const n=i(1017);const s=i(6113);const o={fs:a.constants,os:r.constants};const p=i(4959);const l="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",c=/XXXXXX/,d=3,u=(o.O_CREAT||o.fs.O_CREAT)|(o.O_EXCL||o.fs.O_EXCL)|(o.O_RDWR||o.fs.O_RDWR),m=r.platform()==="win32",h=o.EBADF||o.os.errno.EBADF,g=o.ENOENT||o.os.errno.ENOENT,y=448,v=384,b="exit",x=[],w=a.rmdirSync.bind(a),S=p.sync;let N=false;function tmpName(e,t){const i=_parseArguments(e,t),r=i[0],n=i[1];try{_assertAndSanitizeOptions(r)}catch(e){return n(e)}let s=r.tries;(function _getUniqueName(){try{const e=_generateTmpName(r);a.stat(e,(function(t){if(!t){if(s-- >0)return _getUniqueName();return n(new Error("Could not get a unique tmp filename, max tries reached "+e))}n(null,e)}))}catch(e){n(e)}})()}function tmpNameSync(e){const t=_parseArguments(e),i=t[0];_assertAndSanitizeOptions(i);let r=i.tries;do{const e=_generateTmpName(i);try{a.statSync(e)}catch(t){return e}}while(r-- >0);throw new Error("Could not get a unique tmp filename, max tries reached")}function file(e,t){const i=_parseArguments(e,t),r=i[0],n=i[1];tmpName(r,(function _tmpNameCreated(e,t){if(e)return n(e);a.open(t,u,r.mode||v,(function _fileCreated(e,i){if(e)return n(e);if(r.discardDescriptor){return a.close(i,(function _discardCallback(e){return n(e,t,undefined,_prepareTmpFileRemoveCallback(t,-1,r,false))}))}else{const e=r.discardDescriptor||r.detachDescriptor;n(null,t,i,_prepareTmpFileRemoveCallback(t,e?-1:i,r,false))}}))}))}function fileSync(e){const t=_parseArguments(e),i=t[0];const r=i.discardDescriptor||i.detachDescriptor;const n=tmpNameSync(i);var s=a.openSync(n,u,i.mode||v);if(i.discardDescriptor){a.closeSync(s);s=undefined}return{name:n,fd:s,removeCallback:_prepareTmpFileRemoveCallback(n,r?-1:s,i,true)}}function dir(e,t){const i=_parseArguments(e,t),r=i[0],n=i[1];tmpName(r,(function _tmpNameCreated(e,t){if(e)return n(e);a.mkdir(t,r.mode||y,(function _dirCreated(e){if(e)return n(e);n(null,t,_prepareTmpDirRemoveCallback(t,r,false))}))}))}function dirSync(e){const t=_parseArguments(e),i=t[0];const r=tmpNameSync(i);a.mkdirSync(r,i.mode||y);return{name:r,removeCallback:_prepareTmpDirRemoveCallback(r,i,true)}}function _removeFileAsync(e,t){const _handler=function(e){if(e&&!_isENOENT(e)){return t(e)}t()};if(0<=e[0])a.close(e[0],(function(){a.unlink(e[1],_handler)}));else a.unlink(e[1],_handler)}function _removeFileSync(e){let t=null;try{if(0<=e[0])a.closeSync(e[0])}catch(e){if(!_isEBADF(e)&&!_isENOENT(e))throw e}finally{try{a.unlinkSync(e[1])}catch(e){if(!_isENOENT(e))t=e}}if(t!==null){throw t}}function _prepareTmpFileRemoveCallback(e,t,i,a){const r=_prepareRemoveCallback(_removeFileSync,[t,e],a);const n=_prepareRemoveCallback(_removeFileAsync,[t,e],a,r);if(!i.keep)x.unshift(r);return a?r:n}function _prepareTmpDirRemoveCallback(e,t,i){const r=t.unsafeCleanup?p:a.rmdir.bind(a);const n=t.unsafeCleanup?S:w;const s=_prepareRemoveCallback(n,e,i);const o=_prepareRemoveCallback(r,e,i,s);if(!t.keep)x.unshift(s);return i?s:o}function _prepareRemoveCallback(e,t,i,a){let r=false;return function _cleanupCallback(n){if(!r){const s=a||_cleanupCallback;const o=x.indexOf(s);if(o>=0)x.splice(o,1);r=true;if(i||e===w||e===S){return e(t)}else{return e(t,n||function(){})}}}}function _garbageCollector(){if(!N)return;while(x.length){try{x[0]()}catch(e){}}}function _randomChars(e){let t=[],i=null;try{i=s.randomBytes(e)}catch(t){i=s.pseudoRandomBytes(e)}for(var a=0;a{e.exports=i(4219)},4219:(e,t,i)=>{"use strict";var a=i(1808);var r=i(4404);var n=i(3685);var s=i(5687);var o=i(2361);var p=i(9491);var l=i(3837);t.httpOverHttp=httpOverHttp;t.httpsOverHttp=httpsOverHttp;t.httpOverHttps=httpOverHttps;t.httpsOverHttps=httpsOverHttps;function httpOverHttp(e){var t=new TunnelingAgent(e);t.request=n.request;return t}function httpsOverHttp(e){var t=new TunnelingAgent(e);t.request=n.request;t.createSocket=createSecureSocket;t.defaultPort=443;return t}function httpOverHttps(e){var t=new TunnelingAgent(e);t.request=s.request;return t}function httpsOverHttps(e){var t=new TunnelingAgent(e);t.request=s.request;t.createSocket=createSecureSocket;t.defaultPort=443;return t}function TunnelingAgent(e){var t=this;t.options=e||{};t.proxyOptions=t.options.proxy||{};t.maxSockets=t.options.maxSockets||n.Agent.defaultMaxSockets;t.requests=[];t.sockets=[];t.on("free",(function onFree(e,i,a,r){var n=toOptions(i,a,r);for(var s=0,o=t.requests.length;s=this.maxSockets){r.requests.push(n);return}r.createSocket(n,(function(t){t.on("free",onFree);t.on("close",onCloseOrRemove);t.on("agentRemove",onCloseOrRemove);e.onSocket(t);function onFree(){r.emit("free",t,n)}function onCloseOrRemove(e){r.removeSocket(t);t.removeListener("free",onFree);t.removeListener("close",onCloseOrRemove);t.removeListener("agentRemove",onCloseOrRemove)}}))};TunnelingAgent.prototype.createSocket=function createSocket(e,t){var i=this;var a={};i.sockets.push(a);var r=mergeOptions({},i.proxyOptions,{method:"CONNECT",path:e.host+":"+e.port,agent:false,headers:{host:e.host+":"+e.port}});if(e.localAddress){r.localAddress=e.localAddress}if(r.proxyAuth){r.headers=r.headers||{};r.headers["Proxy-Authorization"]="Basic "+new Buffer(r.proxyAuth).toString("base64")}c("making CONNECT request");var n=i.request(r);n.useChunkedEncodingByDefault=false;n.once("response",onResponse);n.once("upgrade",onUpgrade);n.once("connect",onConnect);n.once("error",onError);n.end();function onResponse(e){e.upgrade=true}function onUpgrade(e,t,i){process.nextTick((function(){onConnect(e,t,i)}))}function onConnect(r,s,o){n.removeAllListeners();s.removeAllListeners();if(r.statusCode!==200){c("tunneling socket could not be established, statusCode=%d",r.statusCode);s.destroy();var p=new Error("tunneling socket could not be established, "+"statusCode="+r.statusCode);p.code="ECONNRESET";e.request.emit("error",p);i.removeSocket(a);return}if(o.length>0){c("got illegal response body from proxy");s.destroy();var p=new Error("got illegal response body from proxy");p.code="ECONNRESET";e.request.emit("error",p);i.removeSocket(a);return}c("tunneling connection has established");i.sockets[i.sockets.indexOf(a)]=s;return t(s)}function onError(t){n.removeAllListeners();c("tunneling socket could not be established, cause=%s\n",t.message,t.stack);var r=new Error("tunneling socket could not be established, "+"cause="+t.message);r.code="ECONNRESET";e.request.emit("error",r);i.removeSocket(a)}};TunnelingAgent.prototype.removeSocket=function removeSocket(e){var t=this.sockets.indexOf(e);if(t===-1){return}this.sockets.splice(t,1);var i=this.requests.shift();if(i){this.createSocket(i,(function(e){i.request.onSocket(e)}))}};function createSecureSocket(e,t){var i=this;TunnelingAgent.prototype.createSocket.call(i,e,(function(a){var n=e.request.getHeader("host");var s=mergeOptions({},i.options,{socket:a,servername:n?n.replace(/:.*$/,""):e.host});var o=r.connect(0,s);i.sockets[i.sockets.indexOf(a)]=o;t(o)}))}function toOptions(e,t,i){if(typeof e==="string"){return{host:e,port:t,localAddress:i}}return e}function mergeOptions(e){for(var t=1,i=arguments.length;t{"use strict";Object.defineProperty(t,"__esModule",{value:true});function getUserAgent(){if(typeof navigator==="object"&&"userAgent"in navigator){return navigator.userAgent}if(typeof process==="object"&&"version"in process){return`Node.js/${process.version.substr(1)} (${process.platform}; ${process.arch})`}return""}t.getUserAgent=getUserAgent},2155:(e,t,i)=>{var a=i(8749);var r=i(824);var n=r;n.v1=a;n.v4=r;e.exports=n},2707:e=>{var t=[];for(var i=0;i<256;++i){t[i]=(i+256).toString(16).substr(1)}function bytesToUuid(e,i){var a=i||0;var r=t;return[r[e[a++]],r[e[a++]],r[e[a++]],r[e[a++]],"-",r[e[a++]],r[e[a++]],"-",r[e[a++]],r[e[a++]],"-",r[e[a++]],r[e[a++]],"-",r[e[a++]],r[e[a++]],r[e[a++]],r[e[a++]],r[e[a++]],r[e[a++]]].join("")}e.exports=bytesToUuid},5859:(e,t,i)=>{var a=i(6113);e.exports=function nodeRNG(){return a.randomBytes(16)}},8749:(e,t,i)=>{var a=i(5859);var r=i(2707);var n;var s;var o=0;var p=0;function v1(e,t,i){var l=t&&i||0;var c=t||[];e=e||{};var d=e.node||n;var u=e.clockseq!==undefined?e.clockseq:s;if(d==null||u==null){var m=a();if(d==null){d=n=[m[0]|1,m[1],m[2],m[3],m[4],m[5]]}if(u==null){u=s=(m[6]<<8|m[7])&16383}}var h=e.msecs!==undefined?e.msecs:(new Date).getTime();var g=e.nsecs!==undefined?e.nsecs:p+1;var y=h-o+(g-p)/1e4;if(y<0&&e.clockseq===undefined){u=u+1&16383}if((y<0||h>o)&&e.nsecs===undefined){g=0}if(g>=1e4){throw new Error("uuid.v1(): Can't create more than 10M uuids/sec")}o=h;p=g;s=u;h+=122192928e5;var v=((h&268435455)*1e4+g)%4294967296;c[l++]=v>>>24&255;c[l++]=v>>>16&255;c[l++]=v>>>8&255;c[l++]=v&255;var b=h/4294967296*1e4&268435455;c[l++]=b>>>8&255;c[l++]=b&255;c[l++]=b>>>24&15|16;c[l++]=b>>>16&255;c[l++]=u>>>8|128;c[l++]=u&255;for(var x=0;x<6;++x){c[l+x]=d[x]}return t?t:r(c)}e.exports=v1},824:(e,t,i)=>{var a=i(5859);var r=i(2707);function v4(e,t,i){var n=t&&i||0;if(typeof e=="string"){t=e==="binary"?new Array(16):null;e=null}e=e||{};var s=e.random||(e.rng||a)();s[6]=s[6]&15|64;s[8]=s[8]&63|128;if(t){for(var o=0;o<16;++o){t[n+o]=s[o]}}return t||r(s)}e.exports=v4},2940:e=>{e.exports=wrappy;function wrappy(e,t){if(e&&t)return wrappy(e)(t);if(typeof e!=="function")throw new TypeError("need wrapper function");Object.keys(e).forEach((function(t){wrapper[t]=e[t]}));return wrapper;function wrapper(){var t=new Array(arguments.length);for(var i=0;i=0||e.indexOf(">")>=0||e.indexOf("<")>=0)};s=function(e){return""};r=function(e){return e.replace("]]>","]]]]>")};t.Builder=function(){function Builder(e){var t,i,r;this.options={};i=a["0.2"];for(t in i){if(!o.call(i,t))continue;r=i[t];this.options[t]=r}for(t in e){if(!o.call(e,t))continue;r=e[t];this.options[t]=r}}Builder.prototype.buildObject=function(t){var i,r,p,l,c;i=this.options.attrkey;r=this.options.charkey;if(Object.keys(t).length===1&&this.options.rootName===a["0.2"].rootName){c=Object.keys(t)[0];t=t[c]}else{c=this.options.rootName}p=function(e){return function(t,a){var l,c,d,u,m,h;if(typeof a!=="object"){if(e.options.cdata&&n(a)){t.raw(s(a))}else{t.txt(a)}}else if(Array.isArray(a)){for(u in a){if(!o.call(a,u))continue;c=a[u];for(m in c){d=c[m];t=p(t.ele(m),d).up()}}}else{for(m in a){if(!o.call(a,m))continue;c=a[m];if(m===i){if(typeof c==="object"){for(l in c){h=c[l];t=t.att(l,h)}}}else if(m===r){if(e.options.cdata&&n(c)){t=t.raw(s(c))}else{t=t.txt(c)}}else if(Array.isArray(c)){for(u in c){if(!o.call(c,u))continue;d=c[u];if(typeof d==="string"){if(e.options.cdata&&n(d)){t=t.ele(m).raw(s(d)).up()}else{t=t.ele(m,d).up()}}else{t=p(t.ele(m),d).up()}}}else if(typeof c==="object"){t=p(t.ele(m),c).up()}else{if(typeof c==="string"&&e.options.cdata&&n(c)){t=t.ele(m).raw(s(c)).up()}else{if(c==null){c=""}t=t.ele(m,c.toString()).up()}}}}return t}}(this);l=e.create(c,this.options.xmldec,this.options.doctype,{headless:this.options.headless,allowSurrogateChars:this.options.allowSurrogateChars});return p(l,t).end(this.options.renderOpts)};return Builder}()}).call(this)},7251:function(e,t){(function(){t.defaults={.1:{explicitCharkey:false,trim:true,normalize:true,normalizeTags:false,attrkey:"@",charkey:"#",explicitArray:false,ignoreAttrs:false,mergeAttrs:false,explicitRoot:false,validator:null,xmlns:false,explicitChildren:false,childkey:"@@",charsAsChildren:false,includeWhiteChars:false,async:false,strict:true,attrNameProcessors:null,attrValueProcessors:null,tagNameProcessors:null,valueProcessors:null,emptyTag:""},.2:{explicitCharkey:false,trim:false,normalize:false,normalizeTags:false,attrkey:"$",charkey:"_",explicitArray:true,ignoreAttrs:false,mergeAttrs:false,explicitRoot:true,validator:null,xmlns:false,explicitChildren:false,preserveChildrenOrder:false,childkey:"$$",charsAsChildren:false,includeWhiteChars:false,async:false,strict:true,attrNameProcessors:null,attrValueProcessors:null,tagNameProcessors:null,valueProcessors:null,rootName:"root",xmldec:{version:"1.0",encoding:"UTF-8",standalone:true},doctype:null,renderOpts:{pretty:true,indent:" ",newline:"\n"},headless:false,chunkSize:1e4,emptyTag:"",cdata:false}}}).call(this)},3314:function(e,t,i){(function(){"use strict";var e,a,r,n,s,o,p,l,bind=function(e,t){return function(){return e.apply(t,arguments)}},extend=function(e,t){for(var i in t){if(c.call(t,i))e[i]=t[i]}function ctor(){this.constructor=e}ctor.prototype=t.prototype;e.prototype=new ctor;e.__super__=t.prototype;return e},c={}.hasOwnProperty;p=i(2043);r=i(2361);e=i(2624);o=i(9236);l=i(9512).setImmediate;a=i(7251).defaults;n=function(e){return typeof e==="object"&&e!=null&&Object.keys(e).length===0};s=function(e,t,i){var a,r,n;for(a=0,r=e.length;a0){p[e.options.childkey]=d}d=p}else if(h){h[e.options.childkey]=h[e.options.childkey]||[];u=Object.create(null);for(o in d){if(!c.call(d,o))continue;u[o]=d[o]}h[e.options.childkey].push(u);delete d["#name"];if(Object.keys(d).length===1&&t in d&&!e.EXPLICIT_CHARKEY){d=d[t]}}}if(a.length>0){return e.assignOrPush(h,l,d)}else{if(e.options.explicitRoot){m=d;d=Object.create(null);d[l]=m}e.resultObject=d;e.saxParser.ended=true;return e.emit("end",e.resultObject)}}}(this);i=function(e){return function(i){var r,n;n=a[a.length-1];if(n){n[t]+=i;if(e.options.explicitChildren&&e.options.preserveChildrenOrder&&e.options.charsAsChildren&&(e.options.includeWhiteChars||i.replace(/\\n/g,"").trim()!=="")){n[e.options.childkey]=n[e.options.childkey]||[];r={"#name":"__text__"};r[t]=i;if(e.options.normalize){r[t]=r[t].replace(/\s{2,}/g," ").trim()}n[e.options.childkey].push(r)}return n}}}(this);this.saxParser.ontext=i;return this.saxParser.oncdata=function(e){return function(e){var t;t=i(e);if(t){return t.cdata=true}}}(this)};Parser.prototype.parseString=function(t,i){var a;if(i!=null&&typeof i==="function"){this.on("end",(function(e){this.reset();return i(null,e)}));this.on("error",(function(e){this.reset();return i(e)}))}try{t=t.toString();if(t.trim()===""){this.emit("end",null);return true}t=e.stripBOM(t);if(this.options.async){this.remaining=t;l(this.processAsync);return this.saxParser}return this.saxParser.write(t).close()}catch(e){a=e;if(!(this.saxParser.errThrown||this.saxParser.ended)){this.emit("error",a);return this.saxParser.errThrown=true}else if(this.saxParser.ended){throw a}}};Parser.prototype.parseStringPromise=function(e){return new Promise(function(t){return function(i,a){return t.parseString(e,(function(e,t){if(e){return a(e)}else{return i(t)}}))}}(this))};return Parser}(r);t.parseString=function(e,i,a){var r,n,s;if(a!=null){if(typeof a==="function"){r=a}if(typeof i==="object"){n=i}}else{if(typeof i==="function"){r=i}n={}}s=new t.Parser(n);return s.parseString(e,r)};t.parseStringPromise=function(e,i){var a,r;if(typeof i==="object"){a=i}r=new t.Parser(a);return r.parseStringPromise(e)}}).call(this)},9236:function(e,t){(function(){"use strict";var e;e=new RegExp(/(?!xmlns)^.*:/);t.normalize=function(e){return e.toLowerCase()};t.firstCharLowerCase=function(e){return e.charAt(0).toLowerCase()+e.slice(1)};t.stripPrefix=function(t){return t.replace(e,"")};t.parseNumbers=function(e){if(!isNaN(e)){e=e%1===0?parseInt(e,10):parseFloat(e)}return e};t.parseBooleans=function(e){if(/^(?:true|false)$/i.test(e)){e=e.toLowerCase()==="true"}return e}}).call(this)},6189:function(e,t,i){(function(){"use strict";var e,a,r,n,extend=function(e,t){for(var i in t){if(s.call(t,i))e[i]=t[i]}function ctor(){this.constructor=e}ctor.prototype=t.prototype;e.prototype=new ctor;e.__super__=t.prototype;return e},s={}.hasOwnProperty;a=i(7251);e=i(3337);r=i(3314);n=i(9236);t.defaults=a.defaults;t.processors=n;t.ValidationError=function(e){extend(ValidationError,e);function ValidationError(e){this.message=e}return ValidationError}(Error);t.Builder=e.Builder;t.Parser=r.Parser;t.parseString=r.parseString;t.parseStringPromise=r.parseStringPromise}).call(this)},2839:function(e){(function(){e.exports={Disconnected:1,Preceding:2,Following:4,Contains:8,ContainedBy:16,ImplementationSpecific:32}}).call(this)},9267:function(e){(function(){e.exports={Element:1,Attribute:2,Text:3,CData:4,EntityReference:5,EntityDeclaration:6,ProcessingInstruction:7,Comment:8,Document:9,DocType:10,DocumentFragment:11,NotationDeclaration:12,Declaration:201,Raw:202,AttributeDeclaration:203,ElementDeclaration:204,Dummy:205}}).call(this)},8229:function(e){(function(){var t,i,a,r,n,s,o,p=[].slice,l={}.hasOwnProperty;t=function(){var e,t,i,a,r,s;s=arguments[0],r=2<=arguments.length?p.call(arguments,1):[];if(n(Object.assign)){Object.assign.apply(null,arguments)}else{for(e=0,i=r.length;e"}else{return"attribute: {"+e+"}, parent: <"+this.parent.name+">"}};XMLAttribute.prototype.isEqualNode=function(e){if(e.namespaceURI!==this.namespaceURI){return false}if(e.prefix!==this.prefix){return false}if(e.localName!==this.localName){return false}if(e.value!==this.value){return false}return true};return XMLAttribute}()}).call(this)},333:function(e,t,i){(function(){var t,a,r,extend=function(e,t){for(var i in t){if(n.call(t,i))e[i]=t[i]}function ctor(){this.constructor=e}ctor.prototype=t.prototype;e.prototype=new ctor;e.__super__=t.prototype;return e},n={}.hasOwnProperty;t=i(9267);r=i(7709);e.exports=a=function(e){extend(XMLCData,e);function XMLCData(e,i){XMLCData.__super__.constructor.call(this,e);if(i==null){throw new Error("Missing CDATA text. "+this.debugInfo())}this.name="#cdata-section";this.type=t.CData;this.value=this.stringify.cdata(i)}XMLCData.prototype.clone=function(){return Object.create(this)};XMLCData.prototype.toString=function(e){return this.options.writer.cdata(this,this.options.writer.filterOptions(e))};return XMLCData}(r)}).call(this)},7709:function(e,t,i){(function(){var t,a,extend=function(e,t){for(var i in t){if(r.call(t,i))e[i]=t[i]}function ctor(){this.constructor=e}ctor.prototype=t.prototype;e.prototype=new ctor;e.__super__=t.prototype;return e},r={}.hasOwnProperty;a=i(7608);e.exports=t=function(e){extend(XMLCharacterData,e);function XMLCharacterData(e){XMLCharacterData.__super__.constructor.call(this,e);this.value=""}Object.defineProperty(XMLCharacterData.prototype,"data",{get:function(){return this.value},set:function(e){return this.value=e||""}});Object.defineProperty(XMLCharacterData.prototype,"length",{get:function(){return this.value.length}});Object.defineProperty(XMLCharacterData.prototype,"textContent",{get:function(){return this.value},set:function(e){return this.value=e||""}});XMLCharacterData.prototype.clone=function(){return Object.create(this)};XMLCharacterData.prototype.substringData=function(e,t){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLCharacterData.prototype.appendData=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLCharacterData.prototype.insertData=function(e,t){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLCharacterData.prototype.deleteData=function(e,t){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLCharacterData.prototype.replaceData=function(e,t,i){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLCharacterData.prototype.isEqualNode=function(e){if(!XMLCharacterData.__super__.isEqualNode.apply(this,arguments).isEqualNode(e)){return false}if(e.data!==this.data){return false}return true};return XMLCharacterData}(a)}).call(this)},4407:function(e,t,i){(function(){var t,a,r,extend=function(e,t){for(var i in t){if(n.call(t,i))e[i]=t[i]}function ctor(){this.constructor=e}ctor.prototype=t.prototype;e.prototype=new ctor;e.__super__=t.prototype;return e},n={}.hasOwnProperty;t=i(9267);a=i(7709);e.exports=r=function(e){extend(XMLComment,e);function XMLComment(e,i){XMLComment.__super__.constructor.call(this,e);if(i==null){throw new Error("Missing comment text. "+this.debugInfo())}this.name="#comment";this.type=t.Comment;this.value=this.stringify.comment(i)}XMLComment.prototype.clone=function(){return Object.create(this)};XMLComment.prototype.toString=function(e){return this.options.writer.comment(this,this.options.writer.filterOptions(e))};return XMLComment}(a)}).call(this)},7465:function(e,t,i){(function(){var t,a,r;a=i(6744);r=i(7028);e.exports=t=function(){function XMLDOMConfiguration(){var e;this.defaultParams={"canonical-form":false,"cdata-sections":false,comments:false,"datatype-normalization":false,"element-content-whitespace":true,entities:true,"error-handler":new a,infoset:true,"validate-if-schema":false,namespaces:true,"namespace-declarations":true,"normalize-characters":false,"schema-location":"","schema-type":"","split-cdata-sections":true,validate:false,"well-formed":true};this.params=e=Object.create(this.defaultParams)}Object.defineProperty(XMLDOMConfiguration.prototype,"parameterNames",{get:function(){return new r(Object.keys(this.defaultParams))}});XMLDOMConfiguration.prototype.getParameter=function(e){if(this.params.hasOwnProperty(e)){return this.params[e]}else{return null}};XMLDOMConfiguration.prototype.canSetParameter=function(e,t){return true};XMLDOMConfiguration.prototype.setParameter=function(e,t){if(t!=null){return this.params[e]=t}else{return delete this.params[e]}};return XMLDOMConfiguration}()}).call(this)},6744:function(e){(function(){var t;e.exports=t=function(){function XMLDOMErrorHandler(){}XMLDOMErrorHandler.prototype.handleError=function(e){throw new Error(e)};return XMLDOMErrorHandler}()}).call(this)},8310:function(e){(function(){var t;e.exports=t=function(){function XMLDOMImplementation(){}XMLDOMImplementation.prototype.hasFeature=function(e,t){return true};XMLDOMImplementation.prototype.createDocumentType=function(e,t,i){throw new Error("This DOM method is not implemented.")};XMLDOMImplementation.prototype.createDocument=function(e,t,i){throw new Error("This DOM method is not implemented.")};XMLDOMImplementation.prototype.createHTMLDocument=function(e){throw new Error("This DOM method is not implemented.")};XMLDOMImplementation.prototype.getFeature=function(e,t){throw new Error("This DOM method is not implemented.")};return XMLDOMImplementation}()}).call(this)},7028:function(e){(function(){var t;e.exports=t=function(){function XMLDOMStringList(e){this.arr=e||[]}Object.defineProperty(XMLDOMStringList.prototype,"length",{get:function(){return this.arr.length}});XMLDOMStringList.prototype.item=function(e){return this.arr[e]||null};XMLDOMStringList.prototype.contains=function(e){return this.arr.indexOf(e)!==-1};return XMLDOMStringList}()}).call(this)},1015:function(e,t,i){(function(){var t,a,r,extend=function(e,t){for(var i in t){if(n.call(t,i))e[i]=t[i]}function ctor(){this.constructor=e}ctor.prototype=t.prototype;e.prototype=new ctor;e.__super__=t.prototype;return e},n={}.hasOwnProperty;r=i(7608);t=i(9267);e.exports=a=function(e){extend(XMLDTDAttList,e);function XMLDTDAttList(e,i,a,r,n,s){XMLDTDAttList.__super__.constructor.call(this,e);if(i==null){throw new Error("Missing DTD element name. "+this.debugInfo())}if(a==null){throw new Error("Missing DTD attribute name. "+this.debugInfo(i))}if(!r){throw new Error("Missing DTD attribute type. "+this.debugInfo(i))}if(!n){throw new Error("Missing DTD attribute default. "+this.debugInfo(i))}if(n.indexOf("#")!==0){n="#"+n}if(!n.match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/)){throw new Error("Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT. "+this.debugInfo(i))}if(s&&!n.match(/^(#FIXED|#DEFAULT)$/)){throw new Error("Default value only applies to #FIXED or #DEFAULT. "+this.debugInfo(i))}this.elementName=this.stringify.name(i);this.type=t.AttributeDeclaration;this.attributeName=this.stringify.name(a);this.attributeType=this.stringify.dtdAttType(r);if(s){this.defaultValue=this.stringify.dtdAttDefault(s)}this.defaultValueType=n}XMLDTDAttList.prototype.toString=function(e){return this.options.writer.dtdAttList(this,this.options.writer.filterOptions(e))};return XMLDTDAttList}(r)}).call(this)},2421:function(e,t,i){(function(){var t,a,r,extend=function(e,t){for(var i in t){if(n.call(t,i))e[i]=t[i]}function ctor(){this.constructor=e}ctor.prototype=t.prototype;e.prototype=new ctor;e.__super__=t.prototype;return e},n={}.hasOwnProperty;r=i(7608);t=i(9267);e.exports=a=function(e){extend(XMLDTDElement,e);function XMLDTDElement(e,i,a){XMLDTDElement.__super__.constructor.call(this,e);if(i==null){throw new Error("Missing DTD element name. "+this.debugInfo())}if(!a){a="(#PCDATA)"}if(Array.isArray(a)){a="("+a.join(",")+")"}this.name=this.stringify.name(i);this.type=t.ElementDeclaration;this.value=this.stringify.dtdElementValue(a)}XMLDTDElement.prototype.toString=function(e){return this.options.writer.dtdElement(this,this.options.writer.filterOptions(e))};return XMLDTDElement}(r)}).call(this)},53:function(e,t,i){(function(){var t,a,r,n,extend=function(e,t){for(var i in t){if(s.call(t,i))e[i]=t[i]}function ctor(){this.constructor=e}ctor.prototype=t.prototype;e.prototype=new ctor;e.__super__=t.prototype;return e},s={}.hasOwnProperty;n=i(8229).isObject;r=i(7608);t=i(9267);e.exports=a=function(e){extend(XMLDTDEntity,e);function XMLDTDEntity(e,i,a,r){XMLDTDEntity.__super__.constructor.call(this,e);if(a==null){throw new Error("Missing DTD entity name. "+this.debugInfo(a))}if(r==null){throw new Error("Missing DTD entity value. "+this.debugInfo(a))}this.pe=!!i;this.name=this.stringify.name(a);this.type=t.EntityDeclaration;if(!n(r)){this.value=this.stringify.dtdEntityValue(r);this.internal=true}else{if(!r.pubID&&!r.sysID){throw new Error("Public and/or system identifiers are required for an external entity. "+this.debugInfo(a))}if(r.pubID&&!r.sysID){throw new Error("System identifier is required for a public external entity. "+this.debugInfo(a))}this.internal=false;if(r.pubID!=null){this.pubID=this.stringify.dtdPubID(r.pubID)}if(r.sysID!=null){this.sysID=this.stringify.dtdSysID(r.sysID)}if(r.nData!=null){this.nData=this.stringify.dtdNData(r.nData)}if(this.pe&&this.nData){throw new Error("Notation declaration is not allowed in a parameter entity. "+this.debugInfo(a))}}}Object.defineProperty(XMLDTDEntity.prototype,"publicId",{get:function(){return this.pubID}});Object.defineProperty(XMLDTDEntity.prototype,"systemId",{get:function(){return this.sysID}});Object.defineProperty(XMLDTDEntity.prototype,"notationName",{get:function(){return this.nData||null}});Object.defineProperty(XMLDTDEntity.prototype,"inputEncoding",{get:function(){return null}});Object.defineProperty(XMLDTDEntity.prototype,"xmlEncoding",{get:function(){return null}});Object.defineProperty(XMLDTDEntity.prototype,"xmlVersion",{get:function(){return null}});XMLDTDEntity.prototype.toString=function(e){return this.options.writer.dtdEntity(this,this.options.writer.filterOptions(e))};return XMLDTDEntity}(r)}).call(this)},2837:function(e,t,i){(function(){var t,a,r,extend=function(e,t){for(var i in t){if(n.call(t,i))e[i]=t[i]}function ctor(){this.constructor=e}ctor.prototype=t.prototype;e.prototype=new ctor;e.__super__=t.prototype;return e},n={}.hasOwnProperty;r=i(7608);t=i(9267);e.exports=a=function(e){extend(XMLDTDNotation,e);function XMLDTDNotation(e,i,a){XMLDTDNotation.__super__.constructor.call(this,e);if(i==null){throw new Error("Missing DTD notation name. "+this.debugInfo(i))}if(!a.pubID&&!a.sysID){throw new Error("Public or system identifiers are required for an external entity. "+this.debugInfo(i))}this.name=this.stringify.name(i);this.type=t.NotationDeclaration;if(a.pubID!=null){this.pubID=this.stringify.dtdPubID(a.pubID)}if(a.sysID!=null){this.sysID=this.stringify.dtdSysID(a.sysID)}}Object.defineProperty(XMLDTDNotation.prototype,"publicId",{get:function(){return this.pubID}});Object.defineProperty(XMLDTDNotation.prototype,"systemId",{get:function(){return this.sysID}});XMLDTDNotation.prototype.toString=function(e){return this.options.writer.dtdNotation(this,this.options.writer.filterOptions(e))};return XMLDTDNotation}(r)}).call(this)},6364:function(e,t,i){(function(){var t,a,r,n,extend=function(e,t){for(var i in t){if(s.call(t,i))e[i]=t[i]}function ctor(){this.constructor=e}ctor.prototype=t.prototype;e.prototype=new ctor;e.__super__=t.prototype;return e},s={}.hasOwnProperty;n=i(8229).isObject;r=i(7608);t=i(9267);e.exports=a=function(e){extend(XMLDeclaration,e);function XMLDeclaration(e,i,a,r){var s;XMLDeclaration.__super__.constructor.call(this,e);if(n(i)){s=i,i=s.version,a=s.encoding,r=s.standalone}if(!i){i="1.0"}this.type=t.Declaration;this.version=this.stringify.xmlVersion(i);if(a!=null){this.encoding=this.stringify.xmlEncoding(a)}if(r!=null){this.standalone=this.stringify.xmlStandalone(r)}}XMLDeclaration.prototype.toString=function(e){return this.options.writer.declaration(this,this.options.writer.filterOptions(e))};return XMLDeclaration}(r)}).call(this)},1801:function(e,t,i){(function(){var t,a,r,n,s,o,p,l,c,extend=function(e,t){for(var i in t){if(d.call(t,i))e[i]=t[i]}function ctor(){this.constructor=e}ctor.prototype=t.prototype;e.prototype=new ctor;e.__super__=t.prototype;return e},d={}.hasOwnProperty;c=i(8229).isObject;l=i(7608);t=i(9267);a=i(1015);n=i(53);r=i(2421);s=i(2837);p=i(4361);e.exports=o=function(e){extend(XMLDocType,e);function XMLDocType(e,i,a){var r,n,s,o,p,l;XMLDocType.__super__.constructor.call(this,e);this.type=t.DocType;if(e.children){o=e.children;for(n=0,s=o.length;n=0){this.up()}return this.onEnd()};XMLDocumentCB.prototype.openCurrent=function(){if(this.currentNode){this.currentNode.children=true;return this.openNode(this.currentNode)}};XMLDocumentCB.prototype.openNode=function(e){var i,r,n,s;if(!e.isOpen){if(!this.root&&this.currentLevel===0&&e.type===t.Element){this.root=e}r="";if(e.type===t.Element){this.writerOptions.state=a.OpenTag;r=this.writer.indent(e,this.writerOptions,this.currentLevel)+"<"+e.name;s=e.attribs;for(n in s){if(!O.call(s,n))continue;i=s[n];r+=this.writer.attribute(i,this.writerOptions,this.currentLevel)}r+=(e.children?">":"/>")+this.writer.endline(e,this.writerOptions,this.currentLevel);this.writerOptions.state=a.InsideTag}else{this.writerOptions.state=a.OpenTag;r=this.writer.indent(e,this.writerOptions,this.currentLevel)+""}r+=this.writer.endline(e,this.writerOptions,this.currentLevel)}this.onData(r,this.currentLevel);return e.isOpen=true}};XMLDocumentCB.prototype.closeNode=function(e){var i;if(!e.isClosed){i="";this.writerOptions.state=a.CloseTag;if(e.type===t.Element){i=this.writer.indent(e,this.writerOptions,this.currentLevel)+""+this.writer.endline(e,this.writerOptions,this.currentLevel)}else{i=this.writer.indent(e,this.writerOptions,this.currentLevel)+"]>"+this.writer.endline(e,this.writerOptions,this.currentLevel)}this.writerOptions.state=a.None;this.onData(i,this.currentLevel);return e.isClosed=true}};XMLDocumentCB.prototype.onData=function(e,t){this.documentStarted=true;return this.onDataCallback(e,t+1)};XMLDocumentCB.prototype.onEnd=function(){this.documentCompleted=true;return this.onEndCallback()};XMLDocumentCB.prototype.debugInfo=function(e){if(e==null){return""}else{return"node: <"+e+">"}};XMLDocumentCB.prototype.ele=function(){return this.element.apply(this,arguments)};XMLDocumentCB.prototype.nod=function(e,t,i){return this.node(e,t,i)};XMLDocumentCB.prototype.txt=function(e){return this.text(e)};XMLDocumentCB.prototype.dat=function(e){return this.cdata(e)};XMLDocumentCB.prototype.com=function(e){return this.comment(e)};XMLDocumentCB.prototype.ins=function(e,t){return this.instruction(e,t)};XMLDocumentCB.prototype.dec=function(e,t,i){return this.declaration(e,t,i)};XMLDocumentCB.prototype.dtd=function(e,t,i){return this.doctype(e,t,i)};XMLDocumentCB.prototype.e=function(e,t,i){return this.element(e,t,i)};XMLDocumentCB.prototype.n=function(e,t,i){return this.node(e,t,i)};XMLDocumentCB.prototype.t=function(e){return this.text(e)};XMLDocumentCB.prototype.d=function(e){return this.cdata(e)};XMLDocumentCB.prototype.c=function(e){return this.comment(e)};XMLDocumentCB.prototype.r=function(e){return this.raw(e)};XMLDocumentCB.prototype.i=function(e,t){return this.instruction(e,t)};XMLDocumentCB.prototype.att=function(){if(this.currentNode&&this.currentNode.type===t.DocType){return this.attList.apply(this,arguments)}else{return this.attribute.apply(this,arguments)}};XMLDocumentCB.prototype.a=function(){if(this.currentNode&&this.currentNode.type===t.DocType){return this.attList.apply(this,arguments)}else{return this.attribute.apply(this,arguments)}};XMLDocumentCB.prototype.ent=function(e,t){return this.entity(e,t)};XMLDocumentCB.prototype.pent=function(e,t){return this.pEntity(e,t)};XMLDocumentCB.prototype.not=function(e,t){return this.notation(e,t)};return XMLDocumentCB}()}).call(this)},3590:function(e,t,i){(function(){var t,a,r,extend=function(e,t){for(var i in t){if(n.call(t,i))e[i]=t[i]}function ctor(){this.constructor=e}ctor.prototype=t.prototype;e.prototype=new ctor;e.__super__=t.prototype;return e},n={}.hasOwnProperty;r=i(7608);t=i(9267);e.exports=a=function(e){extend(XMLDummy,e);function XMLDummy(e){XMLDummy.__super__.constructor.call(this,e);this.type=t.Dummy}XMLDummy.prototype.clone=function(){return Object.create(this)};XMLDummy.prototype.toString=function(e){return""};return XMLDummy}(r)}).call(this)},9437:function(e,t,i){(function(){var t,a,r,n,s,o,p,l,c,extend=function(e,t){for(var i in t){if(d.call(t,i))e[i]=t[i]}function ctor(){this.constructor=e}ctor.prototype=t.prototype;e.prototype=new ctor;e.__super__=t.prototype;return e},d={}.hasOwnProperty;c=i(8229),l=c.isObject,p=c.isFunction,o=c.getValue;s=i(7608);t=i(9267);a=i(8376);n=i(4361);e.exports=r=function(e){extend(XMLElement,e);function XMLElement(e,i,a){var r,n,s,o;XMLElement.__super__.constructor.call(this,e);if(i==null){throw new Error("Missing element name. "+this.debugInfo())}this.name=this.stringify.name(i);this.type=t.Element;this.attribs={};this.schemaTypeInfo=null;if(a!=null){this.attribute(a)}if(e.type===t.Document){this.isRoot=true;this.documentObject=e;e.rootObject=this;if(e.children){o=e.children;for(n=0,s=o.length;n=a;t=0<=a?++i:--i){if(!this.attribs[t].isEqualNode(e.attribs[t])){return false}}return true};return XMLElement}(s)}).call(this)},4361:function(e){(function(){var t;e.exports=t=function(){function XMLNamedNodeMap(e){this.nodes=e}Object.defineProperty(XMLNamedNodeMap.prototype,"length",{get:function(){return Object.keys(this.nodes).length||0}});XMLNamedNodeMap.prototype.clone=function(){return this.nodes=null};XMLNamedNodeMap.prototype.getNamedItem=function(e){return this.nodes[e]};XMLNamedNodeMap.prototype.setNamedItem=function(e){var t;t=this.nodes[e.nodeName];this.nodes[e.nodeName]=e;return t||null};XMLNamedNodeMap.prototype.removeNamedItem=function(e){var t;t=this.nodes[e];delete this.nodes[e];return t||null};XMLNamedNodeMap.prototype.item=function(e){return this.nodes[Object.keys(this.nodes)[e]]||null};XMLNamedNodeMap.prototype.getNamedItemNS=function(e,t){throw new Error("This DOM method is not implemented.")};XMLNamedNodeMap.prototype.setNamedItemNS=function(e){throw new Error("This DOM method is not implemented.")};XMLNamedNodeMap.prototype.removeNamedItemNS=function(e,t){throw new Error("This DOM method is not implemented.")};return XMLNamedNodeMap}()}).call(this)},7608:function(e,t,i){(function(){var t,a,r,n,s,o,p,l,c,d,u,m,h,g,y,v,b,x,w,S={}.hasOwnProperty;w=i(8229),x=w.isObject,b=w.isFunction,v=w.isEmpty,y=w.getValue;l=null;r=null;n=null;s=null;o=null;h=null;g=null;m=null;p=null;a=null;u=null;c=null;t=null;e.exports=d=function(){function XMLNode(e){this.parent=e;if(this.parent){this.options=this.parent.options;this.stringify=this.parent.stringify}this.value=null;this.children=[];this.baseURI=null;if(!l){l=i(9437);r=i(333);n=i(4407);s=i(6364);o=i(1801);h=i(6329);g=i(1318);m=i(6939);p=i(3590);a=i(9267);u=i(6768);c=i(4361);t=i(2839)}}Object.defineProperty(XMLNode.prototype,"nodeName",{get:function(){return this.name}});Object.defineProperty(XMLNode.prototype,"nodeType",{get:function(){return this.type}});Object.defineProperty(XMLNode.prototype,"nodeValue",{get:function(){return this.value}});Object.defineProperty(XMLNode.prototype,"parentNode",{get:function(){return this.parent}});Object.defineProperty(XMLNode.prototype,"childNodes",{get:function(){if(!this.childNodeList||!this.childNodeList.nodes){this.childNodeList=new u(this.children)}return this.childNodeList}});Object.defineProperty(XMLNode.prototype,"firstChild",{get:function(){return this.children[0]||null}});Object.defineProperty(XMLNode.prototype,"lastChild",{get:function(){return this.children[this.children.length-1]||null}});Object.defineProperty(XMLNode.prototype,"previousSibling",{get:function(){var e;e=this.parent.children.indexOf(this);return this.parent.children[e-1]||null}});Object.defineProperty(XMLNode.prototype,"nextSibling",{get:function(){var e;e=this.parent.children.indexOf(this);return this.parent.children[e+1]||null}});Object.defineProperty(XMLNode.prototype,"ownerDocument",{get:function(){return this.document()||null}});Object.defineProperty(XMLNode.prototype,"textContent",{get:function(){var e,t,i,r,n;if(this.nodeType===a.Element||this.nodeType===a.DocumentFragment){n="";r=this.children;for(t=0,i=r.length;t"}else if(!((i=this.parent)!=null?i.name:void 0)){return"node: <"+e+">"}else{return"node: <"+e+">, parent: <"+this.parent.name+">"}};XMLNode.prototype.ele=function(e,t,i){return this.element(e,t,i)};XMLNode.prototype.nod=function(e,t,i){return this.node(e,t,i)};XMLNode.prototype.txt=function(e){return this.text(e)};XMLNode.prototype.dat=function(e){return this.cdata(e)};XMLNode.prototype.com=function(e){return this.comment(e)};XMLNode.prototype.ins=function(e,t){return this.instruction(e,t)};XMLNode.prototype.doc=function(){return this.document()};XMLNode.prototype.dec=function(e,t,i){return this.declaration(e,t,i)};XMLNode.prototype.e=function(e,t,i){return this.element(e,t,i)};XMLNode.prototype.n=function(e,t,i){return this.node(e,t,i)};XMLNode.prototype.t=function(e){return this.text(e)};XMLNode.prototype.d=function(e){return this.cdata(e)};XMLNode.prototype.c=function(e){return this.comment(e)};XMLNode.prototype.r=function(e){return this.raw(e)};XMLNode.prototype.i=function(e,t){return this.instruction(e,t)};XMLNode.prototype.u=function(){return this.up()};XMLNode.prototype.importXMLBuilder=function(e){return this.importDocument(e)};XMLNode.prototype.replaceChild=function(e,t){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.removeChild=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.appendChild=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.hasChildNodes=function(){return this.children.length!==0};XMLNode.prototype.cloneNode=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.normalize=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.isSupported=function(e,t){return true};XMLNode.prototype.hasAttributes=function(){return this.attribs.length!==0};XMLNode.prototype.compareDocumentPosition=function(e){var i,a;i=this;if(i===e){return 0}else if(this.document()!==e.document()){a=t.Disconnected|t.ImplementationSpecific;if(Math.random()<.5){a|=t.Preceding}else{a|=t.Following}return a}else if(i.isAncestor(e)){return t.Contains|t.Preceding}else if(i.isDescendant(e)){return t.Contains|t.Following}else if(i.isPreceding(e)){return t.Preceding}else{return t.Following}};XMLNode.prototype.isSameNode=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.lookupPrefix=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.isDefaultNamespace=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.lookupNamespaceURI=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.isEqualNode=function(e){var t,i,a;if(e.nodeType!==this.nodeType){return false}if(e.children.length!==this.children.length){return false}for(t=i=0,a=this.children.length-1;0<=a?i<=a:i>=a;t=0<=a?++i:--i){if(!this.children[t].isEqualNode(e.children[t])){return false}}return true};XMLNode.prototype.getFeature=function(e,t){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.setUserData=function(e,t,i){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.getUserData=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.contains=function(e){if(!e){return false}return e===this||this.isDescendant(e)};XMLNode.prototype.isDescendant=function(e){var t,i,a,r,n;n=this.children;for(a=0,r=n.length;ai}};XMLNode.prototype.treePosition=function(e){var t,i;i=0;t=false;this.foreachTreeNode(this.document(),(function(a){i++;if(!t&&a===e){return t=true}}));if(t){return i}else{return-1}};XMLNode.prototype.foreachTreeNode=function(e,t){var i,a,r,n,s;e||(e=this.document());n=e.children;for(a=0,r=n.length;a0){this.stream.write(" [");this.stream.write(this.endline(e,t,i));t.state=a.InsideTag;o=e.children;for(n=0,s=o.length;n");this.stream.write(this.endline(e,t,i));t.state=a.None;return this.closeNode(e,t,i)};XMLStreamWriter.prototype.element=function(e,i,r){var n,o,p,l,c,d,u,m,h,g;r||(r=0);this.openNode(e,i,r);i.state=a.OpenTag;this.stream.write(this.indent(e,i,r)+"<"+e.name);h=e.attribs;for(u in h){if(!s.call(h,u))continue;n=h[u];this.attribute(n,i,r)}p=e.children.length;l=p===0?null:e.children[0];if(p===0||e.children.every((function(e){return(e.type===t.Text||e.type===t.Raw)&&e.value===""}))){if(i.allowEmpty){this.stream.write(">");i.state=a.CloseTag;this.stream.write("")}else{i.state=a.CloseTag;this.stream.write(i.spaceBeforeSlash+"/>")}}else if(i.pretty&&p===1&&(l.type===t.Text||l.type===t.Raw)&&l.value!=null){this.stream.write(">");i.state=a.InsideTag;i.suppressPrettyCount++;m=true;this.writeChildNode(l,i,r+1);i.suppressPrettyCount--;m=false;i.state=a.CloseTag;this.stream.write("")}else{this.stream.write(">"+this.endline(e,i,r));i.state=a.InsideTag;g=e.children;for(c=0,d=g.length;c")}this.stream.write(this.endline(e,i,r));i.state=a.None;return this.closeNode(e,i,r)};XMLStreamWriter.prototype.processingInstruction=function(e,t,i){return this.stream.write(XMLStreamWriter.__super__.processingInstruction.call(this,e,t,i))};XMLStreamWriter.prototype.raw=function(e,t,i){return this.stream.write(XMLStreamWriter.__super__.raw.call(this,e,t,i))};XMLStreamWriter.prototype.text=function(e,t,i){return this.stream.write(XMLStreamWriter.__super__.text.call(this,e,t,i))};XMLStreamWriter.prototype.dtdAttList=function(e,t,i){return this.stream.write(XMLStreamWriter.__super__.dtdAttList.call(this,e,t,i))};XMLStreamWriter.prototype.dtdElement=function(e,t,i){return this.stream.write(XMLStreamWriter.__super__.dtdElement.call(this,e,t,i))};XMLStreamWriter.prototype.dtdEntity=function(e,t,i){return this.stream.write(XMLStreamWriter.__super__.dtdEntity.call(this,e,t,i))};XMLStreamWriter.prototype.dtdNotation=function(e,t,i){return this.stream.write(XMLStreamWriter.__super__.dtdNotation.call(this,e,t,i))};return XMLStreamWriter}(n)}).call(this)},5913:function(e,t,i){(function(){var t,a,extend=function(e,t){for(var i in t){if(r.call(t,i))e[i]=t[i]}function ctor(){this.constructor=e}ctor.prototype=t.prototype;e.prototype=new ctor;e.__super__=t.prototype;return e},r={}.hasOwnProperty;a=i(6752);e.exports=t=function(e){extend(XMLStringWriter,e);function XMLStringWriter(e){XMLStringWriter.__super__.constructor.call(this,e)}XMLStringWriter.prototype.document=function(e,t){var i,a,r,n,s;t=this.filterOptions(t);n="";s=e.children;for(a=0,r=s.length;a","]]]]>");return this.assertLegalChar(e)};XMLStringifier.prototype.comment=function(e){if(this.options.noValidation){return e}e=""+e||"";if(e.match(/--/)){throw new Error("Comment text cannot contain double-hypen: "+e)}return this.assertLegalChar(e)};XMLStringifier.prototype.raw=function(e){if(this.options.noValidation){return e}return""+e||""};XMLStringifier.prototype.attValue=function(e){if(this.options.noValidation){return e}return this.assertLegalChar(this.attEscape(e=""+e||""))};XMLStringifier.prototype.insTarget=function(e){if(this.options.noValidation){return e}return this.assertLegalChar(""+e||"")};XMLStringifier.prototype.insValue=function(e){if(this.options.noValidation){return e}e=""+e||"";if(e.match(/\?>/)){throw new Error("Invalid processing instruction value: "+e)}return this.assertLegalChar(e)};XMLStringifier.prototype.xmlVersion=function(e){if(this.options.noValidation){return e}e=""+e||"";if(!e.match(/1\.[0-9]+/)){throw new Error("Invalid version number: "+e)}return e};XMLStringifier.prototype.xmlEncoding=function(e){if(this.options.noValidation){return e}e=""+e||"";if(!e.match(/^[A-Za-z](?:[A-Za-z0-9._-])*$/)){throw new Error("Invalid encoding: "+e)}return this.assertLegalChar(e)};XMLStringifier.prototype.xmlStandalone=function(e){if(this.options.noValidation){return e}if(e){return"yes"}else{return"no"}};XMLStringifier.prototype.dtdPubID=function(e){if(this.options.noValidation){return e}return this.assertLegalChar(""+e||"")};XMLStringifier.prototype.dtdSysID=function(e){if(this.options.noValidation){return e}return this.assertLegalChar(""+e||"")};XMLStringifier.prototype.dtdElementValue=function(e){if(this.options.noValidation){return e}return this.assertLegalChar(""+e||"")};XMLStringifier.prototype.dtdAttType=function(e){if(this.options.noValidation){return e}return this.assertLegalChar(""+e||"")};XMLStringifier.prototype.dtdAttDefault=function(e){if(this.options.noValidation){return e}return this.assertLegalChar(""+e||"")};XMLStringifier.prototype.dtdEntityValue=function(e){if(this.options.noValidation){return e}return this.assertLegalChar(""+e||"")};XMLStringifier.prototype.dtdNData=function(e){if(this.options.noValidation){return e}return this.assertLegalChar(""+e||"")};XMLStringifier.prototype.convertAttKey="@";XMLStringifier.prototype.convertPIKey="?";XMLStringifier.prototype.convertTextKey="#text";XMLStringifier.prototype.convertCDataKey="#cdata";XMLStringifier.prototype.convertCommentKey="#comment";XMLStringifier.prototype.convertRawKey="#raw";XMLStringifier.prototype.assertLegalChar=function(e){var t,i;if(this.options.noValidation){return e}t="";if(this.options.version==="1.0"){t=/[\0-\x08\x0B\f\x0E-\x1F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;if(i=e.match(t)){throw new Error("Invalid character in string: "+e+" at index "+i.index)}}else if(this.options.version==="1.1"){t=/[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;if(i=e.match(t)){throw new Error("Invalid character in string: "+e+" at index "+i.index)}}return e};XMLStringifier.prototype.assertLegalName=function(e){var t;if(this.options.noValidation){return e}this.assertLegalChar(e);t=/^([:A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])([\x2D\.0-:A-Z_a-z\xB7\xC0-\xD6\xD8-\xF6\xF8-\u037D\u037F-\u1FFF\u200C\u200D\u203F\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])*$/;if(!e.match(t)){throw new Error("Invalid character in name")}return e};XMLStringifier.prototype.textEscape=function(e){var t;if(this.options.noValidation){return e}t=this.options.noDoubleEncoding?/(?!&\S+;)&/g:/&/g;return e.replace(t,"&").replace(//g,">").replace(/\r/g," ")};XMLStringifier.prototype.attEscape=function(e){var t;if(this.options.noValidation){return e}t=this.options.noDoubleEncoding?/(?!&\S+;)&/g:/&/g;return e.replace(t,"&").replace(/0){return new Array(a).join(t.indent)}}return""};XMLWriterBase.prototype.endline=function(e,t,i){if(!t.pretty||t.suppressPrettyCount){return""}else{return t.newline}};XMLWriterBase.prototype.attribute=function(e,t,i){var a;this.openAttribute(e,t,i);a=" "+e.name+'="'+e.value+'"';this.closeAttribute(e,t,i);return a};XMLWriterBase.prototype.cdata=function(e,t,i){var r;this.openNode(e,t,i);t.state=a.OpenTag;r=this.indent(e,t,i)+""+this.endline(e,t,i);t.state=a.None;this.closeNode(e,t,i);return r};XMLWriterBase.prototype.comment=function(e,t,i){var r;this.openNode(e,t,i);t.state=a.OpenTag;r=this.indent(e,t,i)+"\x3c!-- ";t.state=a.InsideTag;r+=e.value;t.state=a.CloseTag;r+=" --\x3e"+this.endline(e,t,i);t.state=a.None;this.closeNode(e,t,i);return r};XMLWriterBase.prototype.declaration=function(e,t,i){var r;this.openNode(e,t,i);t.state=a.OpenTag;r=this.indent(e,t,i)+"";r+=this.endline(e,t,i);t.state=a.None;this.closeNode(e,t,i);return r};XMLWriterBase.prototype.docType=function(e,t,i){var r,n,s,o,p;i||(i=0);this.openNode(e,t,i);t.state=a.OpenTag;o=this.indent(e,t,i);o+="0){o+=" [";o+=this.endline(e,t,i);t.state=a.InsideTag;p=e.children;for(n=0,s=p.length;n";o+=this.endline(e,t,i);t.state=a.None;this.closeNode(e,t,i);return o};XMLWriterBase.prototype.element=function(e,i,r){var n,s,o,p,l,c,d,u,m,h,g,y,v,b;r||(r=0);h=false;g="";this.openNode(e,i,r);i.state=a.OpenTag;g+=this.indent(e,i,r)+"<"+e.name;y=e.attribs;for(m in y){if(!x.call(y,m))continue;n=y[m];g+=this.attribute(n,i,r)}o=e.children.length;p=o===0?null:e.children[0];if(o===0||e.children.every((function(e){return(e.type===t.Text||e.type===t.Raw)&&e.value===""}))){if(i.allowEmpty){g+=">";i.state=a.CloseTag;g+=""+this.endline(e,i,r)}else{i.state=a.CloseTag;g+=i.spaceBeforeSlash+"/>"+this.endline(e,i,r)}}else if(i.pretty&&o===1&&(p.type===t.Text||p.type===t.Raw)&&p.value!=null){g+=">";i.state=a.InsideTag;i.suppressPrettyCount++;h=true;g+=this.writeChildNode(p,i,r+1);i.suppressPrettyCount--;h=false;i.state=a.CloseTag;g+=""+this.endline(e,i,r)}else{if(i.dontPrettyTextNodes){v=e.children;for(l=0,d=v.length;l"+this.endline(e,i,r);i.state=a.InsideTag;b=e.children;for(c=0,u=b.length;c";if(h){i.suppressPrettyCount--}g+=this.endline(e,i,r);i.state=a.None}this.closeNode(e,i,r);return g};XMLWriterBase.prototype.writeChildNode=function(e,i,a){switch(e.type){case t.CData:return this.cdata(e,i,a);case t.Comment:return this.comment(e,i,a);case t.Element:return this.element(e,i,a);case t.Raw:return this.raw(e,i,a);case t.Text:return this.text(e,i,a);case t.ProcessingInstruction:return this.processingInstruction(e,i,a);case t.Dummy:return"";case t.Declaration:return this.declaration(e,i,a);case t.DocType:return this.docType(e,i,a);case t.AttributeDeclaration:return this.dtdAttList(e,i,a);case t.ElementDeclaration:return this.dtdElement(e,i,a);case t.EntityDeclaration:return this.dtdEntity(e,i,a);case t.NotationDeclaration:return this.dtdNotation(e,i,a);default:throw new Error("Unknown XML node type: "+e.constructor.name)}};XMLWriterBase.prototype.processingInstruction=function(e,t,i){var r;this.openNode(e,t,i);t.state=a.OpenTag;r=this.indent(e,t,i)+"";r+=this.endline(e,t,i);t.state=a.None;this.closeNode(e,t,i);return r};XMLWriterBase.prototype.raw=function(e,t,i){var r;this.openNode(e,t,i);t.state=a.OpenTag;r=this.indent(e,t,i);t.state=a.InsideTag;r+=e.value;t.state=a.CloseTag;r+=this.endline(e,t,i);t.state=a.None;this.closeNode(e,t,i);return r};XMLWriterBase.prototype.text=function(e,t,i){var r;this.openNode(e,t,i);t.state=a.OpenTag;r=this.indent(e,t,i);t.state=a.InsideTag;r+=e.value;t.state=a.CloseTag;r+=this.endline(e,t,i);t.state=a.None;this.closeNode(e,t,i);return r};XMLWriterBase.prototype.dtdAttList=function(e,t,i){var r;this.openNode(e,t,i);t.state=a.OpenTag;r=this.indent(e,t,i)+""+this.endline(e,t,i);t.state=a.None;this.closeNode(e,t,i);return r};XMLWriterBase.prototype.dtdElement=function(e,t,i){var r;this.openNode(e,t,i);t.state=a.OpenTag;r=this.indent(e,t,i)+""+this.endline(e,t,i);t.state=a.None;this.closeNode(e,t,i);return r};XMLWriterBase.prototype.dtdEntity=function(e,t,i){var r;this.openNode(e,t,i);t.state=a.OpenTag;r=this.indent(e,t,i)+""+this.endline(e,t,i);t.state=a.None;this.closeNode(e,t,i);return r};XMLWriterBase.prototype.dtdNotation=function(e,t,i){var r;this.openNode(e,t,i);t.state=a.OpenTag;r=this.indent(e,t,i)+""+this.endline(e,t,i);t.state=a.None;this.closeNode(e,t,i);return r};XMLWriterBase.prototype.openNode=function(e,t,i){};XMLWriterBase.prototype.closeNode=function(e,t,i){};XMLWriterBase.prototype.openAttribute=function(e,t,i){};XMLWriterBase.prototype.closeAttribute=function(e,t,i){};return XMLWriterBase}()}).call(this)},2958:function(e,t,i){(function(){var t,a,r,n,s,o,p,l,c,d;d=i(8229),l=d.assign,c=d.isFunction;r=i(8310);n=i(3730);s=i(7356);p=i(5913);o=i(8601);t=i(9267);a=i(9766);e.exports.create=function(e,t,i,a){var r,s;if(e==null){throw new Error("Root element needs a name.")}a=l({},t,i,a);r=new n(a);s=r.element(e);if(!a.headless){r.declaration(a);if(a.pubID!=null||a.sysID!=null){r.dtd(a)}}return s};e.exports.begin=function(e,t,i){var a;if(c(e)){a=[e,t],t=a[0],i=a[1];e={}}if(t){return new s(e,t,i)}else{return new n(e)}};e.exports.stringWriter=function(e){return new p(e)};e.exports.streamWriter=function(e,t){return new o(e,t)};e.exports.implementation=new r;e.exports.nodeType=t;e.exports.writerState=a}).call(this)},4091:e=>{"use strict";e.exports=function(e){e.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next){yield e.value}}}},665:(e,t,i)=>{"use strict";e.exports=Yallist;Yallist.Node=Node;Yallist.create=Yallist;function Yallist(e){var t=this;if(!(t instanceof Yallist)){t=new Yallist}t.tail=null;t.head=null;t.length=0;if(e&&typeof e.forEach==="function"){e.forEach((function(e){t.push(e)}))}else if(arguments.length>0){for(var i=0,a=arguments.length;i1){i=t}else if(this.head){a=this.head.next;i=this.head.value}else{throw new TypeError("Reduce of empty list with no initial value")}for(var r=0;a!==null;r++){i=e(i,a.value,r);a=a.next}return i};Yallist.prototype.reduceReverse=function(e,t){var i;var a=this.tail;if(arguments.length>1){i=t}else if(this.tail){a=this.tail.prev;i=this.tail.value}else{throw new TypeError("Reduce of empty list with no initial value")}for(var r=this.length-1;a!==null;r--){i=e(i,a.value,r);a=a.prev}return i};Yallist.prototype.toArray=function(){var e=new Array(this.length);for(var t=0,i=this.head;i!==null;t++){e[t]=i.value;i=i.next}return e};Yallist.prototype.toArrayReverse=function(){var e=new Array(this.length);for(var t=0,i=this.tail;i!==null;t++){e[t]=i.value;i=i.prev}return e};Yallist.prototype.slice=function(e,t){t=t||this.length;if(t<0){t+=this.length}e=e||0;if(e<0){e+=this.length}var i=new Yallist;if(tthis.length){t=this.length}for(var a=0,r=this.head;r!==null&&athis.length){t=this.length}for(var a=this.length,r=this.tail;r!==null&&a>t;a--){r=r.prev}for(;r!==null&&a>e;a--,r=r.prev){i.push(r.value)}return i};Yallist.prototype.splice=function(e,t,...i){if(e>this.length){e=this.length-1}if(e<0){e=this.length+e}for(var a=0,r=this.head;r!==null&&a{const{_:t}=(0,m.default)(e,{configuration:{"short-option-groups":false,"camel-case-expansion":false,"dot-notation":false,"parse-numbers":false,"parse-positional-numbers":false,"boolean-negation":false,"duplicate-arguments-array":false,"greedy-arrays":false,"unknown-options-as-args":true}});return t};t.parseOptions=parseOptions;const expandShellVariables=(e,t)=>{const i=Object.keys(e)[0];const a=[...e[i]];const r=[];a.forEach((e=>{const i=new RegExp("\\$\\{?(\\w+)\\}?","g");const a=[...e.matchAll(i)];a.forEach((i=>{const a=i[1];e=e.replace(new RegExp(`\\$\\{?${a}\\}?`),t[a])}));r.push(e)}));if(!(0,h.default)(r,a)){c.info(`==> Expanded shell variables in ${i}: ${r}`)}return r};const buildPackage=async(e,i,a,r,n,s,m,h,v,b,x,w,S,N,E,C,_)=>{c.startGroup(`Build ${e}`);const[,O]=e.split("/");try{let e;let P=[];if(O==="ecbundle"){const e=l.default.join(l.default.resolve(i));await(0,g.extendPaths)(w,e,O);c.endGroup();return true}if(n){return await ecbundleBuild(h,N,S,w,s,m,a,l.default.resolve(i),E,C)}if(r){e="cmake";P.push(`-DCMAKE_INSTALL_PREFIX=${a}`)}else if(O==="ecbuild"){e=l.default.join(l.default.resolve(i),"bin","ecbuild");P.push(`--prefix=${a}`)}else{e="ecbuild";P.push(`--prefix=${a}`)}c.info(`==> configurePath: ${e}`);const R=l.default.resolve(i);c.info(`==> srcDir: ${R}`);if(_&&p.default.existsSync(_)){P.push(`-DCMAKE_TOOLCHAIN_FILE=${_}`);c.info(`==> using toolchain file: ${_}`)}const T=l.default.join(R,".github",".cmake-options");const A=l.default.join(R,".github",".compiler-flags");if(p.default.existsSync(T)){const e=p.default.readFileSync(T).toString();c.info(`==> Found ${T}: ${e}`);P.push(...(0,t.parseOptions)(e))}else if(p.default.existsSync(A)){const e=p.default.readFileSync(A).toString();c.info(`==> Found ${A}: ${e}`);c.warning("Magic file path `.github/.compiler-flags` has been deprecated, please migrate to `.github/.cmake-options`");P.push(...(0,t.parseOptions)(e))}const D=h&&v&&b.startsWith("ubuntu")&&x.startsWith("gnu");if(D){c.info("==> Code coverage collection enabled, installing lcov...");c.info("==> Checking if lcov is installed...");const e=await d.exec("dpkg-query",["-W","lcov"],{ignoreReturnCode:true})==0;if(!e){c.info("==> lcov not found, installing...");let e=await d.exec("sudo",["apt-get","-y","-q","update"]);if((0,y.isError)(e,"Error updating apt repositories"))return false;e=await d.exec("sudo",["apt-get","-y","-q","install","lcov"]);if((0,y.isError)(e,"Error installing lcov"))return false}else{c.info("==> lcov is already installed")}const t="--coverage";P.push(`-DCMAKE_C_FLAGS='${t}'`);P.push(`-DCMAKE_CXX_FLAGS='${t}'`);P.push(`-DCMAKE_Fortran_FLAGS='--coverage'`)}else if(h&&v){c.info(`Skipping code coverage collection on unsupported platform: ${x}@${b}`)}if(s){P.push(...(0,t.parseOptions)(s))}c.info(`==> configureOptions: ${P}`);let I=[];if(m){I.push(...(0,t.parseOptions)(m));c.info(`==> testOptions: ${I}`)}const B=l.default.join(R,"build");c.info(`==> buildDir: ${B}`);await(0,u.mkdirP)(B);const L={cwd:B,env:{CMAKE_BUILD_PARALLEL_LEVEL:S,...h?{CTEST_OUTPUT_ON_FAILURE:"1"}:{},...h?{CTEST_PARALLEL_LEVEL:S}:{},...o.default.env,...w}};c.info(`==> options.env: ${JSON.stringify(L.env,null,4)}`);P=expandShellVariables({configureOptions:P},L.env);I=expandShellVariables({testOptions:I},L.env);await(0,u.mkdirP)(a);let M=await d.exec("env",[e,...P,R],L);if((0,y.isError)(M,"Error configuring package"))return false;M=await d.exec("env",["cmake","--build","."],L);if((0,y.isError)(M,"Error building package"))return false;M=await d.exec("env",["cmake","--install","."],L);if((0,y.isError)(M,"Error installing package"))return false;await(0,g.extendPaths)(w,a,O);if(h){M=await d.exec("env",["ctest",...I],L);if((0,y.isError)(M,"Error testing package"))return false;if(D){const e=`${B}/coverage.info`;const t=`${B}/coverage`;M=await d.exec("env",["lcov","--capture","--directory",B,"--output-file",e],L);if((0,y.isError)(M,"Error collecting code coverage"))return false;M=await d.exec("env",["lcov","--remove",e,"--output-file",e,"/usr/*",`${l.default.dirname(a)}/*`,`${B}/*`],L);if((0,y.isError)(M,"Error cleaning up code coverage"))return false;M=await d.exec("env",["lcov","--list",e],L);if((0,y.isError)(M,"Error listing code coverage text report"))return false;M=await d.exec("env",["genhtml",e,"--output-directory",t],L);if((0,y.isError)(M,"Error generating code coverage HTML report"))return false;w.COVERAGE_FILE=e;w.COVERAGE_DIR=t}}if(E){const e=await cpack(L,i,B,w,E,C);if((0,y.isError)(!e,"Error generating package."))return false}}catch(e){if(e instanceof Error)(0,y.isError)(true,e.message);return false}c.endGroup();return true};const ecbundleBuild=async(e,i,a,r,n,s,p,u,m,h)=>{const g={cwd:u,env:{CMAKE_BUILD_PARALLEL_LEVEL:a,...e?{CTEST_OUTPUT_ON_FAILURE:"1"}:{},...e?{CTEST_PARALLEL_LEVEL:a}:{},...o.default.env,...r}};let v=await d.exec("env",["ecbundle","create",`--github-token=${i}`,"--shallow",`--threads=${a}`],g);if((0,y.isError)(v,"Error creating bundle"))return false;let b=[];if(n){b.push(...(0,t.parseOptions)(n))}b=expandShellVariables({configureOptions:b},g.env);v=await d.exec("env",["ecbundle","build",`--install`,`--threads=${a}`,`--install-dir=${p}`,...b.length?[`--cmake="${b.join(" ")}"`]:[]],g);if((0,y.isError)(v,"Error building bundle"))return false;if(e){let e=[];if(s){e.push(...(0,t.parseOptions)(s));c.info(`==> testOptions: ${e}`)}e=expandShellVariables({testOptions:e},g.env);g.cwd=l.default.join(u,"build");v=await d.exec("env",["ctest",...e],g);if((0,y.isError)(v,"Error testing bundle"))return false}if(m){const e=await cpack(g,u,l.default.join(u,"build"),r,m,h);if((0,y.isError)(!e,"Error generating package."))return false}c.endGroup();return true};const cpack=async(e,i,a,r,n,s)=>{const o=[];if(s){o.push(...(0,t.parseOptions)(s));c.info(`==> cpackOptionsParsed: ${o}`)}e.cwd=a;const u=await d.exec("env",["cpack","-G",n.toUpperCase(),...o],e);if((0,y.isError)(u,"Error while generating package"))return false;const m=(0,y.getProjectVersion)(i);if((0,y.isError)(!m,"Error reading version number")){return false}const h=p.default.readdirSync(a).filter((e=>l.default.extname(e)===`.${n.toLowerCase()}`));if(h.length==1){r.PACKAGE_PATH=l.default.join(a,h[0])}else{(0,y.isError)(true,"Generated binary not found");return false}return true};t["default"]=buildPackage},602:function(e,t,i){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,t,i,a){if(a===undefined)a=i;var r=Object.getOwnPropertyDescriptor(t,i);if(!r||("get"in r?!t.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return t[i]}}}Object.defineProperty(e,a,r)}:function(e,t,i,a){if(a===undefined)a=i;e[a]=t[i]});var r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i))a(t,e,i);r(t,e);return t};var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.saveCache=t.restoreCache=t.getCacheKey=t.getCacheKeyHash=void 0;const o=n(i(2186));const p=i(7799);const l=i(6762);const c=s(i(6113));const d=i(3837);const u=s(i(7729));const m=i(4147);const h=i(3670);const g=i(8123);const y=i(4833);const v=i(6832);const getCacheKeyHash=(e,t,i,a,r,n,s={})=>{const p=[];if(r){p.push(...(0,y.parseOptions)(r));p.sort()}let l=`v=${m.version}${t}::cmake=${i.CMAKE_VERSION}::options=${p.join()}::${e}=${n}`;const d=(0,v.getDependenciesFromTree)(e,a,null);for(const[t,r]of Object.entries(i.DEPENDENCIES||{}).sort(((e,t)=>e[0]>t[0]?1:-1))){const[,i]=t.split("/");if(!d.includes(i)&&i in a){continue}if(i===e)continue;l+=`::${i}=${r}`;if(s[i]){const e=[];e.push(...(0,y.parseOptions)(s[i]));e.sort();l+=`::${i}-options=${e.join()}`}}o.info(`==> cacheKeyStr: ${l}`);const u=c.default.createHash("sha1").update(l).digest("hex");return u};t.getCacheKeyHash=getCacheKeyHash;const getCacheKey=async(e,i,a,r,n,s,p,c,d,u={})=>{o.startGroup(`Cache Key for ${e}`);const[m,h]=e.split("/");o.info(`==> Repository: ${m}/${h}`);let y;const v={};const b=new l.Octokit({auth:a});if(/^[0-9a-f]{40}$/i.test(i)){o.info(`==> Hash: ${i}`);v.headSha=i}else{if(/^refs\/tags\//.test(i)){i=i.replace(/^refs\/tags\//,"");y=`tags/${i}`}else{i=i.replace(/^refs\/heads\//,"");y=`heads/${i}`}o.info(`==> Branch: ${i}`);o.info(`==> Ref: ${y}`);try{const e=await b.request("GET /repos/{owner}/{repo}/git/ref/{ref}",{owner:m,repo:h,ref:y});(0,g.isError)(e.status!=200,`Wrong response code while fetching repository HEAD for ${h}: ${e.status}`);v.headSha=e.data.object.sha}catch(e){if(e instanceof Error)(0,g.isError)(true,`Error getting repository HEAD for ${h}: ${e.message}`)}}o.info(`==> result.headSha: ${v.headSha}`);const x=(0,t.getCacheKeyHash)(h,s,p,c,d,v.headSha,u);o.info(`==> cacheKeySha: ${x}`);v.cacheKey=`${r}-${n}-${h}-${x}`;o.info(`==> result.cacheKey: ${v.cacheKey}`);o.endGroup();return v};t.getCacheKey=getCacheKey;const restoreCache=async(e,i,a,r,n,s,l,c,d,u,m={})=>{const{cacheKey:y,headSha:v}=await(0,t.getCacheKey)(e,i,a,n,s,l,c,d,u,m);o.startGroup(`Restore ${e} Cache`);let b;try{b=Boolean(await(0,p.restoreCache)([r],y))}catch(t){if(t instanceof Error)(0,g.isError)(true,`Error restoring cache for ${e}: ${t.message}`);return false}o.info(`==> cacheHit: ${b}`);if(b){const[,t]=e.split("/");await(0,h.extendPaths)(c,r,t);await(0,h.extendDependencies)(c,e,v)}o.endGroup();return b};t.restoreCache=restoreCache;const saveCache=async(e,i,a,r,n,s,l,c,m,h,y={})=>{const{cacheKey:v}=await(0,t.getCacheKey)(e,i,a,n,s,l,c,m,h,y);o.startGroup(`Save ${e} Cache`);const b=(0,d.promisify)(u.default);const x=await b(r);if(!x){(0,g.isError)(true,`Empty target dir, skipping saving cache for ${e}`);return false}let w;try{w=Boolean(await(0,p.saveCache)([r],v))}catch(t){if(t instanceof Error)(0,g.isError)(true,`Error saving cache for ${e}: ${t.message}`);return false}o.info(`==> isSaved: ${w}`);o.endGroup();return w};t.saveCache=saveCache},9946:function(e,t,i){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,t,i,a){if(a===undefined)a=i;var r=Object.getOwnPropertyDescriptor(t,i);if(!r||("get"in r?!t.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return t[i]}}}Object.defineProperty(e,a,r)}:function(e,t,i,a){if(a===undefined)a=i;e[a]=t[i]});var r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i))a(t,e,i);r(t,e);return t};var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const o=s(i(7147));const p=s(i(1017));const l=i(4300);const c=n(i(2186));const d=i(7436);const u=i(6762);const m=s(i(6761));const h=i(4948);const g=s(i(4674));const y=i(3670);const v=i(8123);const b=i(602);const downloadArtifact=async(e,t,i,a,r,n,s,x,w,S,N,E={})=>{c.startGroup(`Download ${e} Artifact`);const[C,_]=e.split("/");c.info(`==> Repository: ${C}/${_}`);t=t.replace(/^refs\/heads\//,"");c.info(`==> Branch: ${t}`);const O=new u.Octokit({auth:i});let P;if(/^[0-9a-f]{40}$/i.test(t)){c.info(`==> Hash: ${t}`);P=t}else{try{const e=await O.request("GET /repos/{owner}/{repo}/git/ref/{ref}",{owner:C,repo:_,ref:`heads/${t}`});if((0,v.isError)(e.status!=200,`Wrong response code while fetching repository HEAD for ${_}: ${e.status}`))return false;P=e.data.object.sha}catch(e){if(e instanceof Error)(0,v.isError)(true,`Error getting repository HEAD for ${_}: ${e.message}`);return false}}c.info(`==> headSha: ${P}`);let R;if(_==="ecbuild"){R=`ecbuild-${n}-cmake-${x.CMAKE_VERSION}-${P}`}else{const{cacheKey:t}=await(0,b.getCacheKey)(e,P,i,n,s,S,x,w,N,E);R=t}let T;try{const e=await O.request("GET /repos/{owner}/{repo}/actions/artifacts",{owner:C,repo:_,name:R});if((0,v.isError)(e.status!=200,`Wrong response code while fetching artifacts for ${_}: ${e.status}`))return false;T=e.data.artifacts}catch(e){if(e instanceof Error)(0,v.isError)(true,`Error fetching artifacts for ${_}: ${e.message}`);return false}c.info(`==> Artifacts: ${T.length}`);if(!T.length){(0,v.isError)(true,`No workflow artifacts found for ${_}`);return false}T=T.filter((e=>e.name===R));if((0,v.isError)(!T.length,`No suitable artifact found: ${R}`))return false;const A=T.shift();c.info(`==> artifactName: ${R}`);c.info(`==> artifactId: ${A===null||A===void 0?void 0:A.id}`);let D;try{const e=await O.request("GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}",{owner:C,repo:_,artifact_id:A===null||A===void 0?void 0:A.id,archive_format:"zip"});if((0,v.isError)(e.status===302||e.status!==200,`Wrong response code while downloading workflow run artifact for ${_}: ${e.status}`))return false;D=e.data}catch(e){if(e instanceof Error)(0,v.isError)(true,`Error downloading workflow run artifact for ${_}: ${e.message}`);return false}const I=(0,h.filesize)(A===null||A===void 0?void 0:A.size_in_bytes);c.info(`==> Downloaded: ${A===null||A===void 0?void 0:A.name}.zip (${I})`);const B=p.default.resolve(p.default.join(a,A===null||A===void 0?void 0:A.name));await(0,d.mkdirP)(B);const L=new m.default(l.Buffer.from(D));L.getEntries().forEach((e=>{const t=e.isDirectory?"creating":"inflating";const i=`${B}/${e.entryName}`;c.info(` ${t}: ${i}`)}));L.extractAllTo(B,true);c.info(`==> Extracted artifact ZIP archive to ${B}`);const M=p.default.join(B,`${R}.tar`);const k=p.default.join(B,`${R}-dependencies.json`);if(o.default.existsSync(k)){const e=o.default.readFileSync(k).toString();c.info(`==> Found ${k}`);const t=JSON.parse(e);for(const[e,i]of Object.entries(t)){if(x.DEPENDENCIES&&x.DEPENDENCIES[e]&&x.DEPENDENCIES[e]!==i){o.default.unlinkSync(M);o.default.unlinkSync(k);(0,v.isError)(true,`Error matching dependency ${e} for ${_}: ${x.DEPENDENCIES[e]} !== ${i}`);return false}}o.default.unlinkSync(k)}(0,d.mkdirP)(r);try{await g.default.x({C:r,file:M})}catch(e){if(e instanceof Error)(0,v.isError)(true,`Error extracting artifact TAR for ${_}: ${e.message}`);return false}c.info(`==> Extracted artifact TAR to ${r}`);o.default.unlinkSync(M);await(0,y.extendPaths)(x,r,_);await(0,y.extendDependencies)(x,e,P);c.endGroup();return true};t["default"]=downloadArtifact},4718:function(e,t,i){"use strict";var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const r=a(i(7147));const n=i(6255);const downloadFile=(e,t)=>new Promise(((i,a)=>(new n.HttpClient).get(e).then((e=>{const n=r.default.createWriteStream(t);e.message.pipe(n).on("finish",(()=>{n.close((()=>{i(true)}))})).on("error",(e=>{r.default.unlink(t,(()=>{a(e.message)}))}))})).catch((e=>{a(e.message)}))));t["default"]=downloadFile},5769:function(e,t,i){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,t,i,a){if(a===undefined)a=i;var r=Object.getOwnPropertyDescriptor(t,i);if(!r||("get"in r?!t.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return t[i]}}}Object.defineProperty(e,a,r)}:function(e,t,i,a){if(a===undefined)a=i;e[a]=t[i]});var r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i))a(t,e,i);r(t,e);return t};var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const o=s(i(7147));const p=s(i(1017));const l=n(i(2186));const c=i(7436);const d=i(6762);const u=i(4948);const m=s(i(4674));const h=s(i(4718));const g=i(3670);const y=i(8123);const downloadRepository=async(e,t,i,a,r)=>{l.startGroup(`Download ${e} Repository`);const[n,s]=e.split("/");l.info(`==> Repository: ${n}/${s}`);let v;let b;const x=new d.Octokit({auth:i});if(/^[0-9a-f]{40}$/i.test(t)){l.info(`==> Hash: ${t}`);b=t;v=b}else{if(/^refs\/tags\//.test(t)){t=t.replace(/^refs\/tags\//,"");v=`tags/${t}`}else{t=t.replace(/^refs\/heads\//,"");v=`heads/${t}`}l.info(`==> Branch: ${t}`);l.info(`==> Ref: ${v}`);try{const e=await x.request("GET /repos/{owner}/{repo}/git/ref/{ref}",{owner:n,repo:s,ref:v});if((0,y.isError)(e.status!=200,`Wrong response code while fetching repository HEAD for ${s}: ${e.status}`))return false;b=e.data.object.sha}catch(e){if(e instanceof Error)(0,y.isError)(true,`Error getting repository HEAD for ${s}: ${e.message}`);return false}}let w;try{const e=await x.request("GET /repos/{owner}/{repo}/tarball/{ref}",{owner:n,repo:s,ref:v});if((0,y.isError)(e.status===302||e.status!==200,`Wrong response code while fetching repository download URL for ${s}: ${e.status}`))return false;w=e.url}catch(e){if(e instanceof Error)(0,y.isError)(true,`Error getting repository download URL for ${s}: ${e.message}`);return false}l.info(`==> URL: ${w}`);const S=`${s}.tar.gz`;try{await(0,h.default)(w,S)}catch(e){if(e instanceof Error)(0,y.isError)(true,`Error downloading repository archive for ${s}: ${e.message}`);return false}const N=o.default.statSync(S);if((0,y.isError)(!N.size,`Error determining size of repository archive for ${s}`))return false;const E=(0,u.filesize)(N.size);l.info(`==> Downloaded: ${S} (${E})`);const C=p.default.join(a,s);await(0,c.mkdirP)(C);try{await m.default.x({C:C,file:S,strip:1})}catch(e){if(e instanceof Error)(0,y.isError)(true,`Error extracting repository archive for ${s}: ${e.message}`);return false}l.info(`==> Extracted ${S} to ${C}`);o.default.unlinkSync(S);await(0,g.extendDependencies)(r,e,b);l.endGroup();return true};t["default"]=downloadRepository},3670:function(e,t,i){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,t,i,a){if(a===undefined)a=i;var r=Object.getOwnPropertyDescriptor(t,i);if(!r||("get"in r?!t.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return t[i]}}}Object.defineProperty(e,a,r)}:function(e,t,i,a){if(a===undefined)a=i;e[a]=t[i]});var r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i))a(t,e,i);r(t,e);return t};Object.defineProperty(t,"__esModule",{value:true});t.extendDependencies=t.extendPaths=t.setupEnv=void 0;const s=n(i(7282));const o=n(i(2186));const p=n(i(1514));const l=i(8123);const setupEnv=async(e,t,i,a)=>{o.startGroup("Setup Environment");const r={CC:t,CXX:i,FC:a};o.info(`==> Compiler env: ${JSON.stringify(r)}`);let n="{}";const s={listeners:{stdout:e=>{n=e.toString()}}};let c=await p.exec("env",["cmake","-E","capabilities"],s);if((0,l.isError)(c,"CMake capabilities command failed"))return r;let d;try{const e=JSON.parse(n);d=e.version.string}catch(e){if(e instanceof Error)(0,l.isError)(true,`CMake capabilities JSON parsing failed: ${e.message}`);return r}if((0,l.isError)(!d,"CMake version string not found"))return r;r.CMAKE_VERSION=d;o.info(`==> CMake version: ${r.CMAKE_VERSION}`);if(/^macos-/.test(e)){n="";c=await p.exec("env",["brew","--prefix","openssl"],s);if((0,l.isError)(c,"Homebrew command failed"))return r;if((0,l.isError)(!n,"Homebrew OpenSSL prefix not found"))return r;const e=n.replace(/\n$/,"");r.OPENSSL_ROOT_DIR=e;r.OPENSSL_INCLUDE_DIR=`${e}/include`;o.info(`==> OpenSSL prefix: ${r.OPENSSL_ROOT_DIR}`)}o.endGroup();return r};t.setupEnv=setupEnv;const extendPaths=async(e,t,i)=>{if(!e)return;if(e.PATH){e.PATH=`${t}/bin:${e.PATH}`}else if(s.env.PATH){e.PATH=`${t}/bin:${s.env.PATH}`}else{e.PATH=`${t}/bin`}o.info(`==> Extended local PATH variable to include ${t}/bin`);if(e.BIN_PATH){e.BIN_PATH=`${t}/bin:${e.BIN_PATH}`}else{e.BIN_PATH=`${t}/bin`}if(e.INCLUDE_PATH){e.INCLUDE_PATH=`${t}/include:${e.INCLUDE_PATH}`}else{e.INCLUDE_PATH=`${t}/include`}if(e.INSTALL_PATH){e.INSTALL_PATH=`${t}:${e.INSTALL_PATH}`}else{e.INSTALL_PATH=t}if(e.LIB_PATH){e.LIB_PATH=`${t}/lib:${t}/lib64:${e.LIB_PATH}`}else{e.LIB_PATH=`${t}/lib:${t}/lib64`}e[`${i}_DIR`]=t;e[`${i.toUpperCase()}_DIR`]=t;e[`${i.toUpperCase()}_PATH`]=t};t.extendPaths=extendPaths;const extendDependencies=async(e,t,i)=>{if(!e)return;if(e.DEPENDENCIES instanceof Object){Object.assign(e.DEPENDENCIES,{...e.DEPENDENCIES,[t]:i})}else{e.DEPENDENCIES={[t]:i}}o.info(`==> Extended list of dependencies to include ${t}: ${i}`)};t.extendDependencies=extendDependencies},8123:function(e,t,i){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,t,i,a){if(a===undefined)a=i;var r=Object.getOwnPropertyDescriptor(t,i);if(!r||("get"in r?!t.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return t[i]}}}Object.defineProperty(e,a,r)}:function(e,t,i,a){if(a===undefined)a=i;e[a]=t[i]});var r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i))a(t,e,i);r(t,e);return t};var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.getProjectVersion=t.isError=void 0;const o=n(i(2186));const p=s(i(7147));const l=s(i(1017));const isError=(e,t)=>{if(e){o.warning(t);o.endGroup();return true}return false};t.isError=isError;const getProjectVersion=e=>{const i=l.default.join(e,"VERSION");if(p.default.existsSync(i)){try{const e=p.default.readFileSync(i,"utf-8").trim();return e}catch(e){if(e instanceof Error)(0,t.isError)(true,`Error reading ${i}. Using VERSION is the preferred method.`)}}const a=l.default.join(e,"CMakeLists.txt");try{const e=p.default.readFileSync(a,"utf-8");const t=/project\([\s\w]+VERSION\s+((?:\d+)(?:.\d+){0,3})/;const i=e.match(t);if(i&&i[1]){return i[1]}return""}catch(e){if(e instanceof Error)(0,t.isError)(true,`Error loading data from ${a}`);return""}};t.getProjectVersion=getProjectVersion},6144:function(e,t,i){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,t,i,a){if(a===undefined)a=i;var r=Object.getOwnPropertyDescriptor(t,i);if(!r||("get"in r?!t.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return t[i]}}}Object.defineProperty(e,a,r)}:function(e,t,i,a){if(a===undefined)a=i;e[a]=t[i]});var r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i))a(t,e,i);r(t,e);return t};var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const o=n(i(2186));const p=s(i(399));(0,p.default)().then((e=>{o.startGroup("Set Outputs");o.info(`==> bin_path: ${e.bin_path}`);o.info(`==> include_path: ${e.include_path}`);o.info(`==> install_path: ${e.install_path}`);o.info(`==> lib_path: ${e.lib_path}`);if(e.coverage_file){o.info(`==> coverage_file: ${e.coverage_file}`)}if(e.package_path){o.info(`==> package_path: ${e.package_path}`)}o.setOutput("bin_path",e.bin_path);o.setOutput("include_path",e.include_path);o.setOutput("install_path",e.install_path);o.setOutput("lib_path",e.lib_path);if(e.coverage_file){o.setOutput("coverage_file",e.coverage_file)}if(e.package_path){o.setOutput("package_path",e.package_path)}o.endGroup()})).catch((e=>{o.setFailed(e)}))},399:function(e,t,i){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,t,i,a){if(a===undefined)a=i;var r=Object.getOwnPropertyDescriptor(t,i);if(!r||("get"in r?!t.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return t[i]}}}Object.defineProperty(e,a,r)}:function(e,t,i,a){if(a===undefined)a=i;e[a]=t[i]});var r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i))a(t,e,i);r(t,e);return t};var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const o=n(i(1017));const p=n(i(2186));const l=i(3670);const c=i(602);const d=s(i(9946));const u=s(i(8183));const m=s(i(5769));const h=s(i(4833));const g=i(6832);const main=async()=>{try{const e=p.getInput("workspace",{required:true});const t=p.getInput("repository",{required:true});const i=p.getInput("sha",{required:true});const a=p.getBooleanInput("cmake",{required:true});const r=p.getBooleanInput("ecbundle",{required:true});const n=p.getInput("cmake_options",{required:false});const s=p.getInput("ctest_options",{required:false});const y=p.getBooleanInput("self_build",{required:true});const v=p.getBooleanInput("self_test",{required:true});const b=p.getBooleanInput("self_coverage",{required:true});const x=p.getMultilineInput("dependencies",{required:false});const w=p.getInput("dependency_branch",{required:true});const S=p.getMultilineInput("dependency_cmake_options",{required:false})||[];const N=p.getBooleanInput("force_build",{required:true});const E=p.getInput("cache_suffix",{required:false})||"";const C=p.getBooleanInput("recreate_cache",{required:true});const _=p.getBooleanInput("save_cache",{required:true});const O=p.getInput("os",{required:true});const P=p.getInput("compiler",{required:false});const R=p.getInput("compiler_cc",{required:false});const T=p.getInput("compiler_cxx",{required:false});const A=p.getInput("compiler_fc",{required:false});const D=p.getInput("toolchain_file",{required:false});const I=p.getInput("github_token",{required:true});const B=p.getInput("install_dir",{required:true});const L=p.getInput("download_dir",{required:true});const M=p.getInput("parallelism_factor",{required:false});const k=p.getInput("cpack_generator",{required:false});const z=p.getInput("cpack_options",{required:false});const j=["DEB","RPM"];if(k&&!j.includes(k.toUpperCase())){return Promise.reject(`Invalid or unsupported cpack generator: ${k}`)}const q={};for(const e of S){const[t,i]=e.split(/:\s?(.+)/);if(!t||!i)return Promise.reject(`Unexpected CMake option, must be in 'owner/repo: option' format: ${e}`);q[t]=i.replace(/^['"]|['"]$/g,"")}const U=await(0,l.setupEnv)(O,R,T,A);if(!U)return Promise.reject("Error setting up build environment");const H=(0,g.loadTree)();if(!H)return Promise.reject("Error Loading dependency tree");for(const e of x){const[t,i]=e.split("@");const[n,s]=t.split("/");const p=q[t];if(!n||!s)return Promise.reject(`Unexpected dependency name, must be in 'owner/repo[@branch]' format: ${e}`);const l=i||w;if(!N&&s!=="ecbundle"){const e=await(0,d.default)(t,l,I,L,o.join(B,s),O,P,U,H,E,p);if(e)continue}if(!C&&s!=="ecbundle"){const e=await(0,c.restoreCache)(t,l,I,o.join(B,s),O,P,E,U,H,p);if(e)continue}const u=await(0,m.default)(t,l,I,L,U);if(!u)return Promise.reject("Error downloading repository");const g=await(0,h.default)(t,o.join(L,s),o.join(B,s),a,r,p,null,false,false,O,P,U,M,I,undefined,undefined,D);if(!g)return Promise.reject("Error building dependency");if(_&&s!=="ecbundle"){await(0,c.saveCache)(t,l,I,o.join(B,s),O,P,E,U,H,p)}}if(y){const[p,l]=t.split("@");const[,d]=p.split("/");const m=l||i;let g;if(!C&&!k){g=await(0,c.restoreCache)(p,m,I,o.join(B,d),O,P,E,U,H,n,q)}if(C||!g){const t=await(0,h.default)(p,e,o.join(B,d),a,r,n,s,v,b,O,P,U,M,I,k,z,D);if(!t)return Promise.reject("Error building package");if(_){await(0,c.saveCache)(p,m,I,o.join(B,d),O,P,E,U,H,n,q);await(0,u.default)(p,m,o.join(B,d),U.DEPENDENCIES,O,P,U,H,I,E,n,q)}if(b&&U.COVERAGE_DIR)await(0,u.default)(`coverage-${d}`,m,U.COVERAGE_DIR,null,O,P,U,H,I,E,n,q)}}const V={bin_path:U.BIN_PATH,include_path:U.INCLUDE_PATH,install_path:U.INSTALL_PATH,lib_path:U.LIB_PATH};if(b&&U.COVERAGE_FILE){V.coverage_file=U.COVERAGE_FILE}if(k&&U.PACKAGE_PATH){V.package_path=U.PACKAGE_PATH}return Promise.resolve(V)}catch(e){if(e instanceof Error)return Promise.reject(e.message);return Promise.reject()}};t["default"]=main},6832:function(e,t,i){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,t,i,a){if(a===undefined)a=i;var r=Object.getOwnPropertyDescriptor(t,i);if(!r||("get"in r?!t.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return t[i]}}}Object.defineProperty(e,a,r)}:function(e,t,i,a){if(a===undefined)a=i;e[a]=t[i]});var r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i))a(t,e,i);r(t,e);return t};var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.getDependenciesFromTree=t.loadTree=void 0;const o=n(i(1917));const p=i(8123);const l=n(i(2186));const c=s(i(7282));const loadTree=()=>{l.startGroup("Load dependency tree");if(!c.default.env.DEP_TREE){return{}}let e;try{e=o.load(c.default.env.DEP_TREE)}catch(e){if(e instanceof Error)(0,p.isError)(true,`Error loading dependency tree from $DEP_TREE`);return{}}l.info(`Dependency tree: ${JSON.stringify(e,null,4)}`);l.endGroup();return e};t.loadTree=loadTree;const getDependenciesFromTree=(e,i,a)=>{if(!a){a=[]}if(i[e]==null||!("deps"in i[e])){return a}for(const r of i[e].deps){a.push(r);if(r in i){(0,t.getDependenciesFromTree)(r,i,a)}}return[...new Set(a)]};t.getDependenciesFromTree=getDependenciesFromTree},8183:function(e,t,i){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,t,i,a){if(a===undefined)a=i;var r=Object.getOwnPropertyDescriptor(t,i);if(!r||("get"in r?!t.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return t[i]}}}Object.defineProperty(e,a,r)}:function(e,t,i,a){if(a===undefined)a=i;e[a]=t[i]});var r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i))a(t,e,i);r(t,e);return t};var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const o=s(i(7147));const p=s(i(1017));const l=n(i(2186));const c=n(i(2605));const d=s(i(4674));const u=i(4948);const m=i(8123);const h=i(602);const uploadArtifact=async(e,t,i,a,r,n,s,g,y,v,b,x={})=>{l.startGroup(`Upload ${e} Artifact`);const[w]=e.split("/");let[,S]=e.split("/");if(!S)S=w;let N;if(S==="ecbuild"){N=`ecbuild-${r}-cmake-${s.CMAKE_VERSION}-${t}`}else{const{cacheKey:i}=await(0,h.getCacheKey)(e,t,y,r,n||"",v,s,g,b,x);N=i}const E=`${N}.tar`;const C=p.default.dirname(i);const _=p.default.join(C,E);try{await d.default.c({C:i,file:_,gzip:true},["."])}catch(e){if(e instanceof Error)(0,m.isError)(true,`Error creating artifact TAR for ${S}: ${e.message}`);return false}const O=o.default.statSync(_);if((0,m.isError)(!O.size,`Error determining size of artifact TAR for ${S}`))return false;const P=(0,u.filesize)(O.size);l.info(`==> Created artifact TAR: ${_} (${P})`);const R=[_];if(a){const e=`${N}-dependencies.json`;const t=p.default.join(C,e);const i=JSON.stringify(a);try{o.default.writeFileSync(t,i)}catch(e){if(e instanceof Error)(0,m.isError)(true,`Error writing dependencies file for ${S}: ${e.message}`);return false}l.info(`==> Created dependencies file: ${t}`);R.push(t)}const T=c.create();let A;try{A=await T.uploadArtifact(N,R,C,{continueOnError:true})}catch(e){if(e instanceof Error)(0,m.isError)(true,`Error uploading artifact for ${S}: ${e.message}`);return false}if((0,m.isError)(!A,`Error uploading artifact for ${S}`))return false;if((0,m.isError)(A&&A.failedItems&&A.failedItems.length,`Error uploading artifact for ${S}: ${A.failedItems}`)){return false}l.info(`==> Uploaded artifact: ${A.artifactName} (${(0,u.filesize)(A.size)})`);o.default.unlinkSync(_);l.endGroup();return true};t["default"]=uploadArtifact},2877:module=>{module.exports=eval("require")("encoding")},2941:module=>{module.exports=eval("require")("original-fs")},5670:e=>{function webpackEmptyContext(e){var t=new Error("Cannot find module '"+e+"'");t.code="MODULE_NOT_FOUND";throw t}webpackEmptyContext.keys=()=>[];webpackEmptyContext.resolve=webpackEmptyContext;webpackEmptyContext.id=5670;e.exports=webpackEmptyContext},9491:e=>{"use strict";e.exports=require("assert")},4300:e=>{"use strict";e.exports=require("buffer")},2081:e=>{"use strict";e.exports=require("child_process")},6113:e=>{"use strict";e.exports=require("crypto")},2361:e=>{"use strict";e.exports=require("events")},7147:e=>{"use strict";e.exports=require("fs")},3685:e=>{"use strict";e.exports=require("http")},5687:e=>{"use strict";e.exports=require("https")},1808:e=>{"use strict";e.exports=require("net")},2037:e=>{"use strict";e.exports=require("os")},1017:e=>{"use strict";e.exports=require("path")},4074:e=>{"use strict";e.exports=require("perf_hooks")},7282:e=>{"use strict";e.exports=require("process")},5477:e=>{"use strict";e.exports=require("punycode")},2781:e=>{"use strict";e.exports=require("stream")},1576:e=>{"use strict";e.exports=require("string_decoder")},9512:e=>{"use strict";e.exports=require("timers")},4404:e=>{"use strict";e.exports=require("tls")},7310:e=>{"use strict";e.exports=require("url")},3837:e=>{"use strict";e.exports=require("util")},9796:e=>{"use strict";e.exports=require("zlib")},4948:(e,t)=>{"use strict"; /** * filesize * diff --git a/src/tree.ts b/src/tree.ts index 2efb3ef..779855a 100644 --- a/src/tree.ts +++ b/src/tree.ts @@ -30,7 +30,7 @@ export const getDependenciesFromTree = ( if (!dependencies) { dependencies = []; } - if (tree[repo] == null) { + if (tree[repo] == null || !("deps" in tree[repo])) { return dependencies; } for (const dep of tree[repo].deps) {