uri-scheme 1.2.1 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/index.js +1 -1
- package/package.json +3 -3
package/build/index.js
CHANGED
|
@@ -27,4 +27,4 @@
|
|
|
27
27
|
*/function isSpecificValue(r){return r instanceof Buffer||r instanceof Date||r instanceof RegExp?true:false}function cloneSpecificValue(r){if(r instanceof Buffer){var i=Buffer.alloc?Buffer.alloc(r.length):new Buffer(r.length);r.copy(i);return i}else if(r instanceof Date){return new Date(r.getTime())}else if(r instanceof RegExp){return new RegExp(r)}else{throw new Error("Unexpected situation")}}function deepCloneArray(r){var o=[];r.forEach((function(r,a){if(typeof r==="object"&&r!==null){if(Array.isArray(r)){o[a]=deepCloneArray(r)}else if(isSpecificValue(r)){o[a]=cloneSpecificValue(r)}else{o[a]=i({},r)}}else{o[a]=r}}));return o}function safeGetProperty(r,i){return i==="__proto__"?undefined:r[i]}var i=r.exports=function(){if(arguments.length<1||typeof arguments[0]!=="object"){return false}if(arguments.length<2){return arguments[0]}var r=arguments[0];var o=Array.prototype.slice.call(arguments,1);var a,l,u;o.forEach((function(o){if(typeof o!=="object"||o===null||Array.isArray(o)){return}Object.keys(o).forEach((function(u){l=safeGetProperty(r,u);a=safeGetProperty(o,u);if(a===r){return}else if(typeof a!=="object"||a===null){r[u]=a;return}else if(Array.isArray(a)){r[u]=deepCloneArray(a);return}else if(isSpecificValue(a)){r[u]=cloneSpecificValue(a);return}else if(typeof l!=="object"||l===null||Array.isArray(l)){r[u]=i({},a);return}else{r[u]=i(l,a);return}}))}));return r}},8945:(r,i,o)=>{r.exports=realpath;realpath.realpath=realpath;realpath.sync=realpathSync;realpath.realpathSync=realpathSync;realpath.monkeypatch=monkeypatch;realpath.unmonkeypatch=unmonkeypatch;var a=o(7147);var l=a.realpath;var u=a.realpathSync;var c=process.version;var h=/^v[0-5]\./.test(c);var d=o(4403);function newError(r){return r&&r.syscall==="realpath"&&(r.code==="ELOOP"||r.code==="ENOMEM"||r.code==="ENAMETOOLONG")}function realpath(r,i,o){if(h){return l(r,i,o)}if(typeof i==="function"){o=i;i=null}l(r,i,(function(a,l){if(newError(a)){d.realpath(r,i,o)}else{o(a,l)}}))}function realpathSync(r,i){if(h){return u(r,i)}try{return u(r,i)}catch(o){if(newError(o)){return d.realpathSync(r,i)}else{throw o}}}function monkeypatch(){a.realpath=realpath;a.realpathSync=realpathSync}function unmonkeypatch(){a.realpath=l;a.realpathSync=u}},4403:(r,i,o)=>{var a=o(1017);var l=process.platform==="win32";var u=o(7147);var c=process.env.NODE_DEBUG&&/fs/.test(process.env.NODE_DEBUG);function rethrow(){var r;if(c){var i=new Error;r=debugCallback}else r=missingCallback;return r;function debugCallback(r){if(r){i.message=r.message;r=i;missingCallback(r)}}function missingCallback(r){if(r){if(process.throwDeprecation)throw r;else if(!process.noDeprecation){var i="fs: missing callback "+(r.stack||r.message);if(process.traceDeprecation)console.trace(i);else console.error(i)}}}}function maybeCallback(r){return typeof r==="function"?r:rethrow()}var h=a.normalize;if(l){var d=/(.*?)(?:[\/\\]+|$)/g}else{var d=/(.*?)(?:[\/]+|$)/g}if(l){var p=/^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/}else{var p=/^[\/]*/}i.realpathSync=function realpathSync(r,i){r=a.resolve(r);if(i&&Object.prototype.hasOwnProperty.call(i,r)){return i[r]}var o=r,c={},h={};var m;var g;var y;var v;start();function start(){var i=p.exec(r);m=i[0].length;g=i[0];y=i[0];v="";if(l&&!h[y]){u.lstatSync(y);h[y]=true}}while(m<r.length){d.lastIndex=m;var b=d.exec(r);v=g;g+=b[0];y=v+b[1];m=d.lastIndex;if(h[y]||i&&i[y]===y){continue}var w;if(i&&Object.prototype.hasOwnProperty.call(i,y)){w=i[y]}else{var M=u.lstatSync(y);if(!M.isSymbolicLink()){h[y]=true;if(i)i[y]=y;continue}var E=null;if(!l){var D=M.dev.toString(32)+":"+M.ino.toString(32);if(c.hasOwnProperty(D)){E=c[D]}}if(E===null){u.statSync(y);E=u.readlinkSync(y)}w=a.resolve(v,E);if(i)i[y]=w;if(!l)c[D]=E}r=a.resolve(w,r.slice(m));start()}if(i)i[o]=r;return r};i.realpath=function realpath(r,i,o){if(typeof o!=="function"){o=maybeCallback(i);i=null}r=a.resolve(r);if(i&&Object.prototype.hasOwnProperty.call(i,r)){return process.nextTick(o.bind(null,null,i[r]))}var c=r,h={},m={};var g;var y;var v;var b;start();function start(){var i=p.exec(r);g=i[0].length;y=i[0];v=i[0];b="";if(l&&!m[v]){u.lstat(v,(function(r){if(r)return o(r);m[v]=true;LOOP()}))}else{process.nextTick(LOOP)}}function LOOP(){if(g>=r.length){if(i)i[c]=r;return o(null,r)}d.lastIndex=g;var a=d.exec(r);b=y;y+=a[0];v=b+a[1];g=d.lastIndex;if(m[v]||i&&i[v]===v){return process.nextTick(LOOP)}if(i&&Object.prototype.hasOwnProperty.call(i,v)){return gotResolvedLink(i[v])}return u.lstat(v,gotStat)}function gotStat(r,a){if(r)return o(r);if(!a.isSymbolicLink()){m[v]=true;if(i)i[v]=v;return process.nextTick(LOOP)}if(!l){var c=a.dev.toString(32)+":"+a.ino.toString(32);if(h.hasOwnProperty(c)){return gotTarget(null,h[c],v)}}u.stat(v,(function(r){if(r)return o(r);u.readlink(v,(function(r,i){if(!l)h[c]=i;gotTarget(r,i)}))}))}function gotTarget(r,l,u){if(r)return o(r);var c=a.resolve(b,l);if(i)i[u]=c;gotResolvedLink(c)}function gotResolvedLink(i){r=a.resolve(i,r.slice(g));start()}}},7945:(r,i,o)=>{const a=o(3837);const l=o(7310);let u=false;let c=true;function _value(r,i){const o=process.env[r];if(o===undefined){if(i===undefined&&!c){return o}if(i===undefined){throw new Error("GetEnv.Nonexistent: "+r+" does not exist "+"and no fallback value provided.")}if(u){throw new Error("GetEnv.DisabledFallbacks: "+r+" relying on fallback "+"when fallbacks have been disabled")}return""+i}return o}const h={string:function(r){return""+r},int:function(r){const i=r.match(/^-?\d+$/);if(!i){throw new Error("GetEnv.NoInteger: "+r+" is not an integer.")}return+r},float:function(r){const i=+r===Infinity||+r===-Infinity;if(i){throw new Error("GetEnv.Infinity: "+r+" is set to +/-Infinity.")}const o=!(isNaN(r)||r==="");if(!o){throw new Error("GetEnv.NoFloat: "+r+" is not a number.")}return+r},bool:function(r){const i=r==="true"||r==="false";if(!i){throw new Error("GetEnv.NoBoolean: "+r+" is not a boolean.")}return r==="true"},boolish:function(r){try{return h.bool(r)}catch(i){const o=r==="1"||r==="0";if(!o){throw new Error("GetEnv.NoBoolean: "+r+" is not a boolean.")}return r==="1"}},url:l.parse};function converter(r){return function(i,o){if(typeof i=="string"){const a=_value(i,o);return h[r](a)}else{return d.multi(i)}}}const d=converter("string");Object.keys(h).forEach((function(r){d[r]=converter(r)}));d.array=function array(r,i,o){i=i||"string";if(Object.keys(h).indexOf(i)===-1){throw new Error("GetEnv.ArrayUndefinedType: Unknown array type "+i)}const a=_value(r,o);return a.split(/\s*,\s*/).map(h[i])};d.multi=function multi(r){const i={};for(let o in r){const l=r[o];if(a.isArray(l)){switch(l.length){case 1:case 2:i[o]=d(l[0],l[1]);break;case 3:i[o]=d[l[2]](l[0],l[1]);break;default:throw"getenv.multi(): invalid spec";break}}else{i[o]=d(l)}}return i};d.disableFallbacks=function(){u=true};d.enableFallbacks=function(){u=false};d.disableErrors=function(){c=false};d.enableErrors=function(){c=true};r.exports=d},6738:r=>{"use strict";r.exports=(r,i=process.argv)=>{const o=r.startsWith("-")?"":r.length===1?"-":"--";const a=i.indexOf(o+r);const l=i.indexOf("--");return a!==-1&&(l===-1||a<l)}},9442:(r,i,o)=>{var a=o(4586);var l=Object.create(null);var u=o(7197);r.exports=a(inflight);function inflight(r,i){if(l[r]){l[r].push(i);return null}else{l[r]=[i];return makeres(r)}}function makeres(r){return u((function RES(){var i=l[r];var o=i.length;var a=slice(arguments);try{for(var u=0;u<o;u++){i[u].apply(null,a)}}finally{if(i.length>o){i.splice(0,o);process.nextTick((function(){RES.apply(null,a)}))}else{delete l[r]}}}))}function slice(r){var i=r.length;var o=[];for(var a=0;a<i;a++)o[a]=r[a];return o}},6919:(r,i,o)=>{try{var a=o(3837);if(typeof a.inherits!=="function")throw"";r.exports=a.inherits}catch(i){r.exports=o(7526)}},7526:r=>{if(typeof Object.create==="function"){r.exports=function inherits(r,i){if(i){r.super_=i;r.prototype=Object.create(i.prototype,{constructor:{value:r,enumerable:false,writable:true,configurable:true}})}}}else{r.exports=function inherits(r,i){if(i){r.super_=i;var TempCtor=function(){};TempCtor.prototype=i.prototype;r.prototype=new TempCtor;r.prototype.constructor=r}}}},1923:(r,i)=>{i.parse=i.decode=decode;i.stringify=i.encode=encode;i.safe=safe;i.unsafe=unsafe;var o=typeof process!=="undefined"&&process.platform==="win32"?"\r\n":"\n";function encode(r,i){var a=[];var l="";if(typeof i==="string"){i={section:i,whitespace:false}}else{i=i||{};i.whitespace=i.whitespace===true}var u=i.whitespace?" = ":"=";Object.keys(r).forEach((function(i,c,h){var d=r[i];if(d&&Array.isArray(d)){d.forEach((function(r){l+=safe(i+"[]")+u+safe(r)+"\n"}))}else if(d&&typeof d==="object")a.push(i);else l+=safe(i)+u+safe(d)+o}));if(i.section&&l.length)l="["+safe(i.section)+"]"+o+l;a.forEach((function(a,u,c){var h=dotSplit(a).join("\\.");var d=(i.section?i.section+".":"")+h;var p=encode(r[a],{section:d,whitespace:i.whitespace});if(l.length&&p.length)l+=o;l+=p}));return l}function dotSplit(r){return r.replace(/\1/g,"LITERAL\\1LITERAL").replace(/\\\./g,"").split(/\./).map((function(r){return r.replace(/\1/g,"\\.").replace(/\2LITERAL\\1LITERAL\2/g,"")}))}function decode(r){var i={};var o=i;var a=null;var l=/^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i;var u=r.split(/[\r\n]+/g);u.forEach((function(r,u,c){if(!r||r.match(/^\s*[;#]/))return;var h=r.match(l);if(!h)return;if(h[1]!==undefined){a=unsafe(h[1]);if(a==="__proto__"){o={};return}o=i[a]=i[a]||{};return}var d=unsafe(h[2]);if(d==="__proto__")return;var p=h[3]?unsafe(h[4]):true;switch(p){case"true":case"false":case"null":p=JSON.parse(p)}if(d.length>2&&d.slice(-2)==="[]"){d=d.substring(0,d.length-2);if(d==="__proto__")return;if(!o[d])o[d]=[];else if(!Array.isArray(o[d]))o[d]=[o[d]]}if(Array.isArray(o[d]))o[d].push(p);else o[d]=p}));Object.keys(i).filter((function(r,o,a){if(!i[r]||typeof i[r]!=="object"||Array.isArray(i[r]))return false;var l=dotSplit(r);var u=i;var c=l.pop();var h=c.replace(/\\\./g,".");l.forEach((function(r,i,o){if(r==="__proto__")return;if(!u[r]||typeof u[r]!=="object")u[r]={};u=u[r]}));if(u===i&&h===c)return false;u[h]=i[r];return true})).forEach((function(r,o,a){delete i[r]}));return i}function isQuoted(r){return r.charAt(0)==='"'&&r.slice(-1)==='"'||r.charAt(0)==="'"&&r.slice(-1)==="'"}function safe(r){return typeof r!=="string"||r.match(/[=\r\n]/)||r.match(/^\[/)||r.length>1&&isQuoted(r)||r!==r.trim()?JSON.stringify(r):r.replace(/;/g,"\\;").replace(/#/g,"\\#")}function unsafe(r,i){r=(r||"").trim();if(isQuoted(r)){if(r.charAt(0)==="'")r=r.substr(1,r.length-2);try{r=JSON.parse(r)}catch(r){}}else{var o=false;var a="";for(var l=0,u=r.length;l<u;l++){var c=r.charAt(l);if(o){if("\\;#".indexOf(c)!==-1)a+=c;else a+="\\"+c;o=false}else if(";#".indexOf(c)!==-1)break;else if(c==="\\")o=true;else a+=c}if(o)a+="\\";return a.trim()}return r}},228:(r,i,o)=>{var a=o(7147);var l;if(process.platform==="win32"||global.TESTING_WINDOWS){l=o(7214)}else{l=o(5211)}r.exports=isexe;isexe.sync=sync;function isexe(r,i,o){if(typeof i==="function"){o=i;i={}}if(!o){if(typeof Promise!=="function"){throw new TypeError("callback not provided")}return new Promise((function(o,a){isexe(r,i||{},(function(r,i){if(r){a(r)}else{o(i)}}))}))}l(r,i||{},(function(r,a){if(r){if(r.code==="EACCES"||i&&i.ignoreErrors){r=null;a=false}}o(r,a)}))}function sync(r,i){try{return l.sync(r,i||{})}catch(r){if(i&&i.ignoreErrors||r.code==="EACCES"){return false}else{throw r}}}},5211:(r,i,o)=>{r.exports=isexe;isexe.sync=sync;var a=o(7147);function isexe(r,i,o){a.stat(r,(function(r,a){o(r,r?false:checkStat(a,i))}))}function sync(r,i){return checkStat(a.statSync(r),i)}function checkStat(r,i){return r.isFile()&&checkMode(r,i)}function checkMode(r,i){var o=r.mode;var a=r.uid;var l=r.gid;var u=i.uid!==undefined?i.uid:process.getuid&&process.getuid();var c=i.gid!==undefined?i.gid:process.getgid&&process.getgid();var h=parseInt("100",8);var d=parseInt("010",8);var p=parseInt("001",8);var m=h|d;var g=o&p||o&d&&l===c||o&h&&a===u||o&m&&u===0;return g}},7214:(r,i,o)=>{r.exports=isexe;isexe.sync=sync;var a=o(7147);function checkPathExt(r,i){var o=i.pathExt!==undefined?i.pathExt:process.env.PATHEXT;if(!o){return true}o=o.split(";");if(o.indexOf("")!==-1){return true}for(var a=0;a<o.length;a++){var l=o[a].toLowerCase();if(l&&r.substr(-l.length).toLowerCase()===l){return true}}return false}function checkStat(r,i,o){if(!r.isSymbolicLink()&&!r.isFile()){return false}return checkPathExt(i,o)}function isexe(r,i,o){a.stat(r,(function(a,l){o(a,a?false:checkStat(l,r,i))}))}function sync(r,i){return checkStat(a.statSync(r),r,i)}},9439:r=>{"use strict";const{FORCE_COLOR:i,NODE_DISABLE_COLORS:o,TERM:a}=process.env;const l={enabled:!o&&a!=="dumb"&&i!=="0",reset:init(0,0),bold:init(1,22),dim:init(2,22),italic:init(3,23),underline:init(4,24),inverse:init(7,27),hidden:init(8,28),strikethrough:init(9,29),black:init(30,39),red:init(31,39),green:init(32,39),yellow:init(33,39),blue:init(34,39),magenta:init(35,39),cyan:init(36,39),white:init(37,39),gray:init(90,39),grey:init(90,39),bgBlack:init(40,49),bgRed:init(41,49),bgGreen:init(42,49),bgYellow:init(43,49),bgBlue:init(44,49),bgMagenta:init(45,49),bgCyan:init(46,49),bgWhite:init(47,49)};function run(r,i){let o=0,a,l="",u="";for(;o<r.length;o++){a=r[o];l+=a.open;u+=a.close;if(i.includes(a.close)){i=i.replace(a.rgx,a.close+a.open)}}return l+i+u}function chain(r,i){let o={has:r,keys:i};o.reset=l.reset.bind(o);o.bold=l.bold.bind(o);o.dim=l.dim.bind(o);o.italic=l.italic.bind(o);o.underline=l.underline.bind(o);o.inverse=l.inverse.bind(o);o.hidden=l.hidden.bind(o);o.strikethrough=l.strikethrough.bind(o);o.black=l.black.bind(o);o.red=l.red.bind(o);o.green=l.green.bind(o);o.yellow=l.yellow.bind(o);o.blue=l.blue.bind(o);o.magenta=l.magenta.bind(o);o.cyan=l.cyan.bind(o);o.white=l.white.bind(o);o.gray=l.gray.bind(o);o.grey=l.grey.bind(o);o.bgBlack=l.bgBlack.bind(o);o.bgRed=l.bgRed.bind(o);o.bgGreen=l.bgGreen.bind(o);o.bgYellow=l.bgYellow.bind(o);o.bgBlue=l.bgBlue.bind(o);o.bgMagenta=l.bgMagenta.bind(o);o.bgCyan=l.bgCyan.bind(o);o.bgWhite=l.bgWhite.bind(o);return o}function init(r,i){let o={open:`[${r}m`,close:`[${i}m`,rgx:new RegExp(`\\x1b\\[${i}m`,"g")};return function(i){if(this!==void 0&&this.has!==void 0){this.has.includes(r)||(this.has.push(r),this.keys.push(o));return i===void 0?this:l.enabled?run(this.keys,i+""):i+""}return i===void 0?chain([r],[o]):l.enabled?run([o],i+""):i+""}}r.exports=l},9566:(r,i,o)=>{r.exports=minimatch;minimatch.Minimatch=Minimatch;var a=function(){try{return o(1017)}catch(r){}}()||{sep:"/"};minimatch.sep=a.sep;var l=minimatch.GLOBSTAR=Minimatch.GLOBSTAR={};var u=o(3197);var c={"!":{open:"(?:(?!(?:",close:"))[^/]*?)"},"?":{open:"(?:",close:")?"},"+":{open:"(?:",close:")+"},"*":{open:"(?:",close:")*"},"@":{open:"(?:",close:")"}};var h="[^/]";var d=h+"*?";var p="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?";var m="(?:(?!(?:\\/|^)\\.).)*?";var g=charSet("().*{}+?[]^$\\!");function charSet(r){return r.split("").reduce((function(r,i){r[i]=true;return r}),{})}var y=/\/+/;minimatch.filter=filter;function filter(r,i){i=i||{};return function(o,a,l){return minimatch(o,r,i)}}function ext(r,i){i=i||{};var o={};Object.keys(r).forEach((function(i){o[i]=r[i]}));Object.keys(i).forEach((function(r){o[r]=i[r]}));return o}minimatch.defaults=function(r){if(!r||typeof r!=="object"||!Object.keys(r).length){return minimatch}var i=minimatch;var o=function minimatch(o,a,l){return i(o,a,ext(r,l))};o.Minimatch=function Minimatch(o,a){return new i.Minimatch(o,ext(r,a))};o.Minimatch.defaults=function defaults(o){return i.defaults(ext(r,o)).Minimatch};o.filter=function filter(o,a){return i.filter(o,ext(r,a))};o.defaults=function defaults(o){return i.defaults(ext(r,o))};o.makeRe=function makeRe(o,a){return i.makeRe(o,ext(r,a))};o.braceExpand=function braceExpand(o,a){return i.braceExpand(o,ext(r,a))};o.match=function(o,a,l){return i.match(o,a,ext(r,l))};return o};Minimatch.defaults=function(r){return minimatch.defaults(r).Minimatch};function minimatch(r,i,o){assertValidPattern(i);if(!o)o={};if(!o.nocomment&&i.charAt(0)==="#"){return false}return new Minimatch(i,o).match(r)}function Minimatch(r,i){if(!(this instanceof Minimatch)){return new Minimatch(r,i)}assertValidPattern(r);if(!i)i={};r=r.trim();if(!i.allowWindowsEscape&&a.sep!=="/"){r=r.split(a.sep).join("/")}this.options=i;this.set=[];this.pattern=r;this.regexp=null;this.negate=false;this.comment=false;this.empty=false;this.partial=!!i.partial;this.make()}Minimatch.prototype.debug=function(){};Minimatch.prototype.make=make;function make(){var r=this.pattern;var i=this.options;if(!i.nocomment&&r.charAt(0)==="#"){this.comment=true;return}if(!r){this.empty=true;return}this.parseNegate();var o=this.globSet=this.braceExpand();if(i.debug)this.debug=function debug(){console.error.apply(console,arguments)};this.debug(this.pattern,o);o=this.globParts=o.map((function(r){return r.split(y)}));this.debug(this.pattern,o);o=o.map((function(r,i,o){return r.map(this.parse,this)}),this);this.debug(this.pattern,o);o=o.filter((function(r){return r.indexOf(false)===-1}));this.debug(this.pattern,o);this.set=o}Minimatch.prototype.parseNegate=parseNegate;function parseNegate(){var r=this.pattern;var i=false;var o=this.options;var a=0;if(o.nonegate)return;for(var l=0,u=r.length;l<u&&r.charAt(l)==="!";l++){i=!i;a++}if(a)this.pattern=r.substr(a);this.negate=i}minimatch.braceExpand=function(r,i){return braceExpand(r,i)};Minimatch.prototype.braceExpand=braceExpand;function braceExpand(r,i){if(!i){if(this instanceof Minimatch){i=this.options}else{i={}}}r=typeof r==="undefined"?this.pattern:r;assertValidPattern(r);if(i.nobrace||!/\{(?:(?!\{).)*\}/.test(r)){return[r]}return u(r)}var v=1024*64;var assertValidPattern=function(r){if(typeof r!=="string"){throw new TypeError("invalid pattern")}if(r.length>v){throw new TypeError("pattern is too long")}};Minimatch.prototype.parse=parse;var b={};function parse(r,i){assertValidPattern(r);var o=this.options;if(r==="**"){if(!o.noglobstar)return l;else r="*"}if(r==="")return"";var a="";var u=!!o.nocase;var p=false;var m=[];var y=[];var v;var w=false;var M=-1;var E=-1;var D=r.charAt(0)==="."?"":o.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)";var T=this;function clearStateChar(){if(v){switch(v){case"*":a+=d;u=true;break;case"?":a+=h;u=true;break;default:a+="\\"+v;break}T.debug("clearStateChar %j %j",v,a);v=false}}for(var x=0,O=r.length,N;x<O&&(N=r.charAt(x));x++){this.debug("%s\t%s %s %j",r,x,a,N);if(p&&g[N]){a+="\\"+N;p=false;continue}switch(N){case"/":{return false}case"\\":clearStateChar();p=true;continue;case"?":case"*":case"+":case"@":case"!":this.debug("%s\t%s %s %j <-- stateChar",r,x,a,N);if(w){this.debug(" in class");if(N==="!"&&x===E+1)N="^";a+=N;continue}T.debug("call clearStateChar %j",v);clearStateChar();v=N;if(o.noext)clearStateChar();continue;case"(":if(w){a+="(";continue}if(!v){a+="\\(";continue}m.push({type:v,start:x-1,reStart:a.length,open:c[v].open,close:c[v].close});a+=v==="!"?"(?:(?!(?:":"(?:";this.debug("plType %j %j",v,a);v=false;continue;case")":if(w||!m.length){a+="\\)";continue}clearStateChar();u=true;var _=m.pop();a+=_.close;if(_.type==="!"){y.push(_)}_.reEnd=a.length;continue;case"|":if(w||!m.length||p){a+="\\|";p=false;continue}clearStateChar();a+="|";continue;case"[":clearStateChar();if(w){a+="\\"+N;continue}w=true;E=x;M=a.length;a+=N;continue;case"]":if(x===E+1||!w){a+="\\"+N;p=false;continue}var A=r.substring(E+1,x);try{RegExp("["+A+"]")}catch(r){var I=this.parse(A,b);a=a.substr(0,M)+"\\["+I[0]+"\\]";u=u||I[1];w=false;continue}u=true;w=false;a+=N;continue;default:clearStateChar();if(p){p=false}else if(g[N]&&!(N==="^"&&w)){a+="\\"}a+=N}}if(w){A=r.substr(E+1);I=this.parse(A,b);a=a.substr(0,M)+"\\["+I[0];u=u||I[1]}for(_=m.pop();_;_=m.pop()){var L=a.slice(_.reStart+_.open.length);this.debug("setting tail",a,_);L=L.replace(/((?:\\{2}){0,64})(\\?)\|/g,(function(r,i,o){if(!o){o="\\"}return i+i+o+"|"}));this.debug("tail=%j\n %s",L,L,_,a);var S=_.type==="*"?d:_.type==="?"?h:"\\"+_.type;u=true;a=a.slice(0,_.reStart)+S+"\\("+L}clearStateChar();if(p){a+="\\\\"}var C=false;switch(a.charAt(0)){case"[":case".":case"(":C=true}for(var P=y.length-1;P>-1;P--){var X=y[P];var j=a.slice(0,X.reStart);var k=a.slice(X.reStart,X.reEnd-8);var R=a.slice(X.reEnd-8,X.reEnd);var B=a.slice(X.reEnd);R+=B;var $=j.split("(").length-1;var U=B;for(x=0;x<$;x++){U=U.replace(/\)[+*?]?/,"")}B=U;var V="";if(B===""&&i!==b){V="$"}var G=j+k+B+V+R;a=G}if(a!==""&&u){a="(?=.)"+a}if(C){a=D+a}if(i===b){return[a,u]}if(!u){return globUnescape(r)}var W=o.nocase?"i":"";try{var q=new RegExp("^"+a+"$",W)}catch(r){return new RegExp("$.")}q._glob=r;q._src=a;return q}minimatch.makeRe=function(r,i){return new Minimatch(r,i||{}).makeRe()};Minimatch.prototype.makeRe=makeRe;function makeRe(){if(this.regexp||this.regexp===false)return this.regexp;var r=this.set;if(!r.length){this.regexp=false;return this.regexp}var i=this.options;var o=i.noglobstar?d:i.dot?p:m;var a=i.nocase?"i":"";var u=r.map((function(r){return r.map((function(r){return r===l?o:typeof r==="string"?regExpEscape(r):r._src})).join("\\/")})).join("|");u="^(?:"+u+")$";if(this.negate)u="^(?!"+u+").*$";try{this.regexp=new RegExp(u,a)}catch(r){this.regexp=false}return this.regexp}minimatch.match=function(r,i,o){o=o||{};var a=new Minimatch(i,o);r=r.filter((function(r){return a.match(r)}));if(a.options.nonull&&!r.length){r.push(i)}return r};Minimatch.prototype.match=function match(r,i){if(typeof i==="undefined")i=this.partial;this.debug("match",r,this.pattern);if(this.comment)return false;if(this.empty)return r==="";if(r==="/"&&i)return true;var o=this.options;if(a.sep!=="/"){r=r.split(a.sep).join("/")}r=r.split(y);this.debug(this.pattern,"split",r);var l=this.set;this.debug(this.pattern,"set",l);var u;var c;for(c=r.length-1;c>=0;c--){u=r[c];if(u)break}for(c=0;c<l.length;c++){var h=l[c];var d=r;if(o.matchBase&&h.length===1){d=[u]}var p=this.matchOne(d,h,i);if(p){if(o.flipNegate)return true;return!this.negate}}if(o.flipNegate)return false;return this.negate};Minimatch.prototype.matchOne=function(r,i,o){var a=this.options;this.debug("matchOne",{this:this,file:r,pattern:i});this.debug("matchOne",r.length,i.length);for(var u=0,c=0,h=r.length,d=i.length;u<h&&c<d;u++,c++){this.debug("matchOne loop");var p=i[c];var m=r[u];this.debug(i,p,m);if(p===false)return false;if(p===l){this.debug("GLOBSTAR",[i,p,m]);var g=u;var y=c+1;if(y===d){this.debug("** at the end");for(;u<h;u++){if(r[u]==="."||r[u]===".."||!a.dot&&r[u].charAt(0)===".")return false}return true}while(g<h){var v=r[g];this.debug("\nglobstar while",r,g,i,y,v);if(this.matchOne(r.slice(g),i.slice(y),o)){this.debug("globstar found match!",g,h,v);return true}else{if(v==="."||v===".."||!a.dot&&v.charAt(0)==="."){this.debug("dot detected!",r,g,i,y);break}this.debug("globstar swallow a segment, and continue");g++}}if(o){this.debug("\n>>> no match, partial?",r,g,i,y);if(g===h)return true}return false}var b;if(typeof p==="string"){b=m===p;this.debug("string match",p,m,b)}else{b=m.match(p);this.debug("pattern match",p,m,b)}if(!b)return false}if(u===h&&c===d){return true}else if(u===h){return o}else if(c===d){return u===h-1&&r[u]===""}throw new Error("wtf?")};function globUnescape(r){return r.replace(/\\(.)/g,"$1")}function regExpEscape(r){return r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}},5912:r=>{"use strict";function hasKey(r,i){var o=r;i.slice(0,-1).forEach((function(r){o=o[r]||{}}));var a=i[i.length-1];return a in o}function isNumber(r){if(typeof r==="number"){return true}if(/^0x[0-9a-f]+$/i.test(r)){return true}return/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(r)}function isConstructorOrProto(r,i){return i==="constructor"&&typeof r[i]==="function"||i==="__proto__"}r.exports=function(r,i){if(!i){i={}}var o={bools:{},strings:{},unknownFn:null};if(typeof i.unknown==="function"){o.unknownFn=i.unknown}if(typeof i.boolean==="boolean"&&i.boolean){o.allBools=true}else{[].concat(i.boolean).filter(Boolean).forEach((function(r){o.bools[r]=true}))}var a={};function aliasIsBoolean(r){return a[r].some((function(r){return o.bools[r]}))}Object.keys(i.alias||{}).forEach((function(r){a[r]=[].concat(i.alias[r]);a[r].forEach((function(i){a[i]=[r].concat(a[r].filter((function(r){return i!==r})))}))}));[].concat(i.string).filter(Boolean).forEach((function(r){o.strings[r]=true;if(a[r]){[].concat(a[r]).forEach((function(r){o.strings[r]=true}))}}));var l=i.default||{};var u={_:[]};function argDefined(r,i){return o.allBools&&/^--[^=]+$/.test(i)||o.strings[r]||o.bools[r]||a[r]}function setKey(r,i,a){var l=r;for(var u=0;u<i.length-1;u++){var c=i[u];if(isConstructorOrProto(l,c)){return}if(l[c]===undefined){l[c]={}}if(l[c]===Object.prototype||l[c]===Number.prototype||l[c]===String.prototype){l[c]={}}if(l[c]===Array.prototype){l[c]=[]}l=l[c]}var h=i[i.length-1];if(isConstructorOrProto(l,h)){return}if(l===Object.prototype||l===Number.prototype||l===String.prototype){l={}}if(l===Array.prototype){l=[]}if(l[h]===undefined||o.bools[h]||typeof l[h]==="boolean"){l[h]=a}else if(Array.isArray(l[h])){l[h].push(a)}else{l[h]=[l[h],a]}}function setArg(r,i,l){if(l&&o.unknownFn&&!argDefined(r,l)){if(o.unknownFn(l)===false){return}}var c=!o.strings[r]&&isNumber(i)?Number(i):i;setKey(u,r.split("."),c);(a[r]||[]).forEach((function(r){setKey(u,r.split("."),c)}))}Object.keys(o.bools).forEach((function(r){setArg(r,l[r]===undefined?false:l[r])}));var c=[];if(r.indexOf("--")!==-1){c=r.slice(r.indexOf("--")+1);r=r.slice(0,r.indexOf("--"))}for(var h=0;h<r.length;h++){var d=r[h];var p;var m;if(/^--.+=/.test(d)){var g=d.match(/^--([^=]+)=([\s\S]*)$/);p=g[1];var y=g[2];if(o.bools[p]){y=y!=="false"}setArg(p,y,d)}else if(/^--no-.+/.test(d)){p=d.match(/^--no-(.+)/)[1];setArg(p,false,d)}else if(/^--.+/.test(d)){p=d.match(/^--(.+)/)[1];m=r[h+1];if(m!==undefined&&!/^(-|--)[^-]/.test(m)&&!o.bools[p]&&!o.allBools&&(a[p]?!aliasIsBoolean(p):true)){setArg(p,m,d);h+=1}else if(/^(true|false)$/.test(m)){setArg(p,m==="true",d);h+=1}else{setArg(p,o.strings[p]?"":true,d)}}else if(/^-[^-]+/.test(d)){var v=d.slice(1,-1).split("");var b=false;for(var w=0;w<v.length;w++){m=d.slice(w+2);if(m==="-"){setArg(v[w],m,d);continue}if(/[A-Za-z]/.test(v[w])&&m[0]==="="){setArg(v[w],m.slice(1),d);b=true;break}if(/[A-Za-z]/.test(v[w])&&/-?\d+(\.\d*)?(e-?\d+)?$/.test(m)){setArg(v[w],m,d);b=true;break}if(v[w+1]&&v[w+1].match(/\W/)){setArg(v[w],d.slice(w+2),d);b=true;break}else{setArg(v[w],o.strings[v[w]]?"":true,d)}}p=d.slice(-1)[0];if(!b&&p!=="-"){if(r[h+1]&&!/^(-|--)[^-]/.test(r[h+1])&&!o.bools[p]&&(a[p]?!aliasIsBoolean(p):true)){setArg(p,r[h+1],d);h+=1}else if(r[h+1]&&/^(true|false)$/.test(r[h+1])){setArg(p,r[h+1]==="true",d);h+=1}else{setArg(p,o.strings[p]?"":true,d)}}}else{if(!o.unknownFn||o.unknownFn(d)!==false){u._.push(o.strings._||!isNumber(d)?d:Number(d))}if(i.stopEarly){u._.push.apply(u._,r.slice(h+1));break}}}Object.keys(l).forEach((function(r){if(!hasKey(u,r.split("."))){setKey(u,r.split("."),l[r]);(a[r]||[]).forEach((function(i){setKey(u,i.split("."),l[r])}))}}));if(i["--"]){u["--"]=c.slice()}else{c.forEach((function(r){u._.push(r)}))}return u}},7197:(r,i,o)=>{var a=o(4586);r.exports=a(once);r.exports.strict=a(onceStrict);once.proto=once((function(){Object.defineProperty(Function.prototype,"once",{value:function(){return once(this)},configurable:true});Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return onceStrict(this)},configurable:true})}));function once(r){var f=function(){if(f.called)return f.value;f.called=true;return f.value=r.apply(this,arguments)};f.called=false;return f}function onceStrict(r){var f=function(){if(f.called)throw new Error(f.onceError);f.called=true;return f.value=r.apply(this,arguments)};var i=r.name||"Function wrapped with `once`";f.onceError=i+" shouldn't be called more than once";f.called=false;return f}},1323:r=>{"use strict";function posix(r){return r.charAt(0)==="/"}function win32(r){var i=/^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/;var o=i.exec(r);var a=o[1]||"";var l=Boolean(a&&a.charAt(1)!==":");return Boolean(o[2]||l)}r.exports=process.platform==="win32"?win32:posix;r.exports.posix=posix;r.exports.win32=win32},399:r=>{"use strict";class DatePart{constructor({token:r,date:i,parts:o,locales:a}){this.token=r;this.date=i||new Date;this.parts=o||[this];this.locales=a||{}}up(){}down(){}next(){const r=this.parts.indexOf(this);return this.parts.find(((i,o)=>o>r&&i instanceof DatePart))}setTo(r){}prev(){let r=[].concat(this.parts).reverse();const i=r.indexOf(this);return r.find(((r,o)=>o>i&&r instanceof DatePart))}toString(){return String(this.date)}}r.exports=DatePart},7967:(r,i,o)=>{"use strict";const a=o(399);const pos=r=>{r=r%10;return r===1?"st":r===2?"nd":r===3?"rd":"th"};class Day extends a{constructor(r={}){super(r)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(r){this.date.setDate(parseInt(r.substr(-2)))}toString(){let r=this.date.getDate();let i=this.date.getDay();return this.token==="DD"?String(r).padStart(2,"0"):this.token==="Do"?r+pos(r):this.token==="d"?i+1:this.token==="ddd"?this.locales.weekdaysShort[i]:this.token==="dddd"?this.locales.weekdays[i]:r}}r.exports=Day},4102:(r,i,o)=>{"use strict";const a=o(399);class Hours extends a{constructor(r={}){super(r)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(r){this.date.setHours(parseInt(r.substr(-2)))}toString(){let r=this.date.getHours();if(/h/.test(this.token))r=r%12||12;return this.token.length>1?String(r).padStart(2,"0"):r}}r.exports=Hours},7517:(r,i,o)=>{"use strict";r.exports={DatePart:o(399),Meridiem:o(5184),Day:o(7967),Hours:o(4102),Milliseconds:o(6945),Minutes:o(7829),Month:o(8608),Seconds:o(812),Year:o(5227)}},5184:(r,i,o)=>{"use strict";const a=o(399);class Meridiem extends a{constructor(r={}){super(r)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let r=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?r.toUpperCase():r}}r.exports=Meridiem},6945:(r,i,o)=>{"use strict";const a=o(399);class Milliseconds extends a{constructor(r={}){super(r)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(r){this.date.setMilliseconds(parseInt(r.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}}r.exports=Milliseconds},7829:(r,i,o)=>{"use strict";const a=o(399);class Minutes extends a{constructor(r={}){super(r)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(r){this.date.setMinutes(parseInt(r.substr(-2)))}toString(){let r=this.date.getMinutes();return this.token.length>1?String(r).padStart(2,"0"):r}}r.exports=Minutes},8608:(r,i,o)=>{"use strict";const a=o(399);class Month extends a{constructor(r={}){super(r)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(r){r=parseInt(r.substr(-2))-1;this.date.setMonth(r<0?0:r)}toString(){let r=this.date.getMonth();let i=this.token.length;return i===2?String(r+1).padStart(2,"0"):i===3?this.locales.monthsShort[r]:i===4?this.locales.months[r]:String(r+1)}}r.exports=Month},812:(r,i,o)=>{"use strict";const a=o(399);class Seconds extends a{constructor(r={}){super(r)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(r){this.date.setSeconds(parseInt(r.substr(-2)))}toString(){let r=this.date.getSeconds();return this.token.length>1?String(r).padStart(2,"0"):r}}r.exports=Seconds},5227:(r,i,o)=>{"use strict";const a=o(399);class Year extends a{constructor(r={}){super(r)}up(){this.date.setFullYear(this.date.getFullYear()+1)}down(){this.date.setFullYear(this.date.getFullYear()-1)}setTo(r){this.date.setFullYear(r.substr(-4))}toString(){let r=String(this.date.getFullYear()).padStart(4,"0");return this.token.length===2?r.substr(-2):r}}r.exports=Year},935:(r,i,o)=>{"use strict";function asyncGeneratorStep(r,i,o,a,l,u,c){try{var h=r[u](c);var d=h.value}catch(r){o(r);return}if(h.done){i(d)}else{Promise.resolve(d).then(a,l)}}function _asyncToGenerator(r){return function(){var i=this,o=arguments;return new Promise((function(a,l){var u=r.apply(i,o);function _next(r){asyncGeneratorStep(u,a,l,_next,_throw,"next",r)}function _throw(r){asyncGeneratorStep(u,a,l,_next,_throw,"throw",r)}_next(undefined)}))}}const a=o(9439);const l=o(5876);const u=o(332),c=u.erase,h=u.cursor;const d=o(7483),p=d.style,m=d.clear,g=d.figures,y=d.wrap,v=d.entriesToDisplay;const getVal=(r,i)=>r[i]&&(r[i].value||r[i].title||r[i]);const getTitle=(r,i)=>r[i]&&(r[i].title||r[i].value||r[i]);const getIndex=(r,i)=>{const o=r.findIndex((r=>r.value===i||r.title===i));return o>-1?o:undefined};class AutocompletePrompt extends l{constructor(r={}){super(r);this.msg=r.message;this.suggest=r.suggest;this.choices=r.choices;this.initial=typeof r.initial==="number"?r.initial:getIndex(r.choices,r.initial);this.select=this.initial||r.cursor||0;this.i18n={noMatches:r.noMatches||"no matches found"};this.fallback=r.fallback||this.initial;this.clearFirst=r.clearFirst||false;this.suggestions=[];this.input="";this.limit=r.limit||10;this.cursor=0;this.transform=p.render(r.style);this.scale=this.transform.scale;this.render=this.render.bind(this);this.complete=this.complete.bind(this);this.clear=m("",this.out.columns);this.complete(this.render);this.render()}set fallback(r){this._fb=Number.isSafeInteger(parseInt(r))?parseInt(r):r}get fallback(){let r;if(typeof this._fb==="number")r=this.choices[this._fb];else if(typeof this._fb==="string")r={title:this._fb};return r||this._fb||{title:this.i18n.noMatches}}moveSelect(r){this.select=r;if(this.suggestions.length>0)this.value=getVal(this.suggestions,r);else this.value=this.fallback.value;this.fire()}complete(r){var i=this;return _asyncToGenerator((function*(){const o=i.completing=i.suggest(i.input,i.choices);const a=yield o;if(i.completing!==o)return;i.suggestions=a.map(((r,i,o)=>({title:getTitle(o,i),value:getVal(o,i),description:r.description})));i.completing=false;const l=Math.max(a.length-1,0);i.moveSelect(Math.min(l,i.select));r&&r()}))()}reset(){this.input="";this.complete((()=>{this.moveSelect(this.initial!==void 0?this.initial:0);this.render()}));this.render()}exit(){if(this.clearFirst&&this.input.length>0){this.reset()}else{this.done=this.exited=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}}abort(){this.done=this.aborted=true;this.exited=false;this.fire();this.render();this.out.write("\n");this.close()}submit(){this.done=true;this.aborted=this.exited=false;this.fire();this.render();this.out.write("\n");this.close()}_(r,i){let o=this.input.slice(0,this.cursor);let a=this.input.slice(this.cursor);this.input=`${o}${r}${a}`;this.cursor=o.length+1;this.complete(this.render);this.render()}delete(){if(this.cursor===0)return this.bell();let r=this.input.slice(0,this.cursor-1);let i=this.input.slice(this.cursor);this.input=`${r}${i}`;this.complete(this.render);this.cursor=this.cursor-1;this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let r=this.input.slice(0,this.cursor);let i=this.input.slice(this.cursor+1);this.input=`${r}${i}`;this.complete(this.render);this.render()}first(){this.moveSelect(0);this.render()}last(){this.moveSelect(this.suggestions.length-1);this.render()}up(){if(this.select===0){this.moveSelect(this.suggestions.length-1)}else{this.moveSelect(this.select-1)}this.render()}down(){if(this.select===this.suggestions.length-1){this.moveSelect(0)}else{this.moveSelect(this.select+1)}this.render()}next(){if(this.select===this.suggestions.length-1){this.moveSelect(0)}else this.moveSelect(this.select+1);this.render()}nextPage(){this.moveSelect(Math.min(this.select+this.limit,this.suggestions.length-1));this.render()}prevPage(){this.moveSelect(Math.max(this.select-this.limit,0));this.render()}left(){if(this.cursor<=0)return this.bell();this.cursor=this.cursor-1;this.render()}right(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.cursor=this.cursor+1;this.render()}renderOption(r,i,o,l){let u;let c=o?g.arrowUp:l?g.arrowDown:" ";let h=i?a.cyan().underline(r.title):r.title;c=(i?a.cyan(g.pointer)+" ":" ")+c;if(r.description){u=` - ${r.description}`;if(c.length+h.length+u.length>=this.out.columns||r.description.split(/\r?\n/).length>1){u="\n"+y(r.description,{margin:3,width:this.out.columns})}}return c+" "+h+a.gray(u||"")}render(){if(this.closed)return;if(this.firstRender)this.out.write(h.hide);else this.out.write(m(this.outputText,this.out.columns));super.render();let r=v(this.select,this.choices.length,this.limit),i=r.startIndex,o=r.endIndex;this.outputText=[p.symbol(this.done,this.aborted,this.exited),a.bold(this.msg),p.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" ");if(!this.done){const r=this.suggestions.slice(i,o).map(((r,a)=>this.renderOption(r,this.select===a+i,a===0&&i>0,a+i===o-1&&o<this.choices.length))).join("\n");this.outputText+=`\n`+(r||a.gray(this.fallback.title))}this.out.write(c.line+h.to(0)+this.outputText)}}r.exports=AutocompletePrompt},2040:(r,i,o)=>{"use strict";const a=o(9439);const l=o(332),u=l.cursor;const c=o(4047);const h=o(7483),d=h.clear,p=h.style,m=h.figures;class AutocompleteMultiselectPrompt extends c{constructor(r={}){r.overrideRender=true;super(r);this.inputValue="";this.clear=d("",this.out.columns);this.filteredOptions=this.value;this.render()}last(){this.cursor=this.filteredOptions.length-1;this.render()}next(){this.cursor=(this.cursor+1)%this.filteredOptions.length;this.render()}up(){if(this.cursor===0){this.cursor=this.filteredOptions.length-1}else{this.cursor--}this.render()}down(){if(this.cursor===this.filteredOptions.length-1){this.cursor=0}else{this.cursor++}this.render()}left(){this.filteredOptions[this.cursor].selected=false;this.render()}right(){if(this.value.filter((r=>r.selected)).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=true;this.render()}delete(){if(this.inputValue.length){this.inputValue=this.inputValue.substr(0,this.inputValue.length-1);this.updateFilteredOptions()}}updateFilteredOptions(){const r=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter((r=>{if(this.inputValue){if(typeof r.title==="string"){if(r.title.toLowerCase().includes(this.inputValue.toLowerCase())){return true}}if(typeof r.value==="string"){if(r.value.toLowerCase().includes(this.inputValue.toLowerCase())){return true}}return false}return true}));const i=this.filteredOptions.findIndex((i=>i===r));this.cursor=i<0?0:i;this.render()}handleSpaceToggle(){const r=this.filteredOptions[this.cursor];if(r.selected){r.selected=false;this.render()}else if(r.disabled||this.value.filter((r=>r.selected)).length>=this.maxChoices){return this.bell()}else{r.selected=true;this.render()}}handleInputChange(r){this.inputValue=this.inputValue+r;this.updateFilteredOptions()}_(r,i){if(r===" "){this.handleSpaceToggle()}else{this.handleInputChange(r)}}renderInstructions(){if(this.instructions===undefined||this.instructions){if(typeof this.instructions==="string"){return this.instructions}return`\nInstructions:\n ${m.arrowUp}/${m.arrowDown}: Highlight option\n ${m.arrowLeft}/${m.arrowRight}/[space]: Toggle selection\n [a,b,c]/delete: Filter choices\n enter/return: Complete answer\n`}return""}renderCurrentInput(){return`\nFiltered results for: ${this.inputValue?this.inputValue:a.gray("Enter something to filter")}\n`}renderOption(r,i,o){let l;if(i.disabled)l=r===o?a.gray().underline(i.title):a.strikethrough().gray(i.title);else l=r===o?a.cyan().underline(i.title):i.title;return(i.selected?a.green(m.radioOn):m.radioOff)+" "+l}renderDoneOrInstructions(){if(this.done){return this.value.filter((r=>r.selected)).map((r=>r.title)).join(", ")}const r=[a.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];if(this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled){r.push(a.yellow(this.warn))}return r.join(" ")}render(){if(this.closed)return;if(this.firstRender)this.out.write(u.hide);super.render();let r=[p.symbol(this.done,this.aborted),a.bold(this.msg),p.delimiter(false),this.renderDoneOrInstructions()].join(" ");if(this.showMinError){r+=a.red(`You must select a minimum of ${this.minSelected} choices.`);this.showMinError=false}r+=this.renderOptions(this.filteredOptions);this.out.write(this.clear+r);this.clear=d(r,this.out.columns)}}r.exports=AutocompleteMultiselectPrompt},5680:(r,i,o)=>{"use strict";const a=o(9439);const l=o(5876);const u=o(7483),c=u.style,h=u.clear;const d=o(332),p=d.erase,m=d.cursor;class ConfirmPrompt extends l{constructor(r={}){super(r);this.msg=r.message;this.value=r.initial;this.initialValue=!!r.initial;this.yesMsg=r.yes||"yes";this.yesOption=r.yesOption||"(Y/n)";this.noMsg=r.no||"no";this.noOption=r.noOption||"(y/N)";this.render()}reset(){this.value=this.initialValue;this.fire();this.render()}exit(){this.abort()}abort(){this.done=this.aborted=true;this.fire();this.render();this.out.write("\n");this.close()}submit(){this.value=this.value||false;this.done=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}_(r,i){if(r.toLowerCase()==="y"){this.value=true;return this.submit()}if(r.toLowerCase()==="n"){this.value=false;return this.submit()}return this.bell()}render(){if(this.closed)return;if(this.firstRender)this.out.write(m.hide);else this.out.write(h(this.outputText,this.out.columns));super.render();this.outputText=[c.symbol(this.done,this.aborted),a.bold(this.msg),c.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:a.gray(this.initialValue?this.yesOption:this.noOption)].join(" ");this.out.write(p.line+m.to(0)+this.outputText)}}r.exports=ConfirmPrompt},3031:(r,i,o)=>{"use strict";function asyncGeneratorStep(r,i,o,a,l,u,c){try{var h=r[u](c);var d=h.value}catch(r){o(r);return}if(h.done){i(d)}else{Promise.resolve(d).then(a,l)}}function _asyncToGenerator(r){return function(){var i=this,o=arguments;return new Promise((function(a,l){var u=r.apply(i,o);function _next(r){asyncGeneratorStep(u,a,l,_next,_throw,"next",r)}function _throw(r){asyncGeneratorStep(u,a,l,_next,_throw,"throw",r)}_next(undefined)}))}}const a=o(9439);const l=o(5876);const u=o(7483),c=u.style,h=u.clear,d=u.figures;const p=o(332),m=p.erase,g=p.cursor;const y=o(7517),v=y.DatePart,b=y.Meridiem,w=y.Day,M=y.Hours,E=y.Milliseconds,D=y.Minutes,T=y.Month,x=y.Seconds,O=y.Year;const N=/\\(.)|"((?:\\["\\]|[^"])+)"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g;const _={1:({token:r})=>r.replace(/\\(.)/g,"$1"),2:r=>new w(r),3:r=>new T(r),4:r=>new O(r),5:r=>new b(r),6:r=>new M(r),7:r=>new D(r),8:r=>new x(r),9:r=>new E(r)};const A={months:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),monthsShort:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),weekdays:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),weekdaysShort:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(",")};class DatePrompt extends l{constructor(r={}){super(r);this.msg=r.message;this.cursor=0;this.typed="";this.locales=Object.assign(A,r.locales);this._date=r.initial||new Date;this.errorMsg=r.error||"Please Enter A Valid Value";this.validator=r.validate||(()=>true);this.mask=r.mask||"YYYY-MM-DD HH:mm:ss";this.clear=h("",this.out.columns);this.render()}get value(){return this.date}get date(){return this._date}set date(r){if(r)this._date.setTime(r.getTime())}set mask(r){let i;this.parts=[];while(i=N.exec(r)){let r=i.shift();let o=i.findIndex((r=>r!=null));this.parts.push(o in _?_[o]({token:i[o]||r,date:this.date,parts:this.parts,locales:this.locales}):i[o]||r)}let o=this.parts.reduce(((r,i)=>{if(typeof i==="string"&&typeof r[r.length-1]==="string")r[r.length-1]+=i;else r.push(i);return r}),[]);this.parts.splice(0);this.parts.push(...o);this.reset()}moveCursor(r){this.typed="";this.cursor=r;this.fire()}reset(){this.moveCursor(this.parts.findIndex((r=>r instanceof v)));this.fire();this.render()}exit(){this.abort()}abort(){this.done=this.aborted=true;this.error=false;this.fire();this.render();this.out.write("\n");this.close()}validate(){var r=this;return _asyncToGenerator((function*(){let i=yield r.validator(r.value);if(typeof i==="string"){r.errorMsg=i;i=false}r.error=!i}))()}submit(){var r=this;return _asyncToGenerator((function*(){yield r.validate();if(r.error){r.color="red";r.fire();r.render();return}r.done=true;r.aborted=false;r.fire();r.render();r.out.write("\n");r.close()}))()}up(){this.typed="";this.parts[this.cursor].up();this.render()}down(){this.typed="";this.parts[this.cursor].down();this.render()}left(){let r=this.parts[this.cursor].prev();if(r==null)return this.bell();this.moveCursor(this.parts.indexOf(r));this.render()}right(){let r=this.parts[this.cursor].next();if(r==null)return this.bell();this.moveCursor(this.parts.indexOf(r));this.render()}next(){let r=this.parts[this.cursor].next();this.moveCursor(r?this.parts.indexOf(r):this.parts.findIndex((r=>r instanceof v)));this.render()}_(r){if(/\d/.test(r)){this.typed+=r;this.parts[this.cursor].setTo(this.typed);this.render()}}render(){if(this.closed)return;if(this.firstRender)this.out.write(g.hide);else this.out.write(h(this.outputText,this.out.columns));super.render();this.outputText=[c.symbol(this.done,this.aborted),a.bold(this.msg),c.delimiter(false),this.parts.reduce(((r,i,o)=>r.concat(o===this.cursor&&!this.done?a.cyan().underline(i.toString()):i)),[]).join("")].join(" ");if(this.error){this.outputText+=this.errorMsg.split("\n").reduce(((r,i,o)=>r+`\n${o?` `:d.pointerSmall} ${a.red().italic(i)}`),``)}this.out.write(m.line+g.to(0)+this.outputText)}}r.exports=DatePrompt},9956:(r,i,o)=>{"use strict";r.exports={TextPrompt:o(5430),SelectPrompt:o(8856),TogglePrompt:o(9692),DatePrompt:o(3031),NumberPrompt:o(8831),MultiselectPrompt:o(4047),AutocompletePrompt:o(935),AutocompleteMultiselectPrompt:o(2040),ConfirmPrompt:o(5680)}},4047:(r,i,o)=>{"use strict";const a=o(9439);const l=o(332),u=l.cursor;const c=o(5876);const h=o(7483),d=h.clear,p=h.figures,m=h.style,g=h.wrap,y=h.entriesToDisplay;class MultiselectPrompt extends c{constructor(r={}){super(r);this.msg=r.message;this.cursor=r.cursor||0;this.scrollIndex=r.cursor||0;this.hint=r.hint||"";this.warn=r.warn||"- This option is disabled -";this.minSelected=r.min;this.showMinError=false;this.maxChoices=r.max;this.instructions=r.instructions;this.optionsPerPage=r.optionsPerPage||10;this.value=r.choices.map(((r,i)=>{if(typeof r==="string")r={title:r,value:i};return{title:r&&(r.title||r.value||r),description:r&&r.description,value:r&&(r.value===undefined?i:r.value),selected:r&&r.selected,disabled:r&&r.disabled}}));this.clear=d("",this.out.columns);if(!r.overrideRender){this.render()}}reset(){this.value.map((r=>!r.selected));this.cursor=0;this.fire();this.render()}selected(){return this.value.filter((r=>r.selected))}exit(){this.abort()}abort(){this.done=this.aborted=true;this.fire();this.render();this.out.write("\n");this.close()}submit(){const r=this.value.filter((r=>r.selected));if(this.minSelected&&r.length<this.minSelected){this.showMinError=true;this.render()}else{this.done=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}}first(){this.cursor=0;this.render()}last(){this.cursor=this.value.length-1;this.render()}next(){this.cursor=(this.cursor+1)%this.value.length;this.render()}up(){if(this.cursor===0){this.cursor=this.value.length-1}else{this.cursor--}this.render()}down(){if(this.cursor===this.value.length-1){this.cursor=0}else{this.cursor++}this.render()}left(){this.value[this.cursor].selected=false;this.render()}right(){if(this.value.filter((r=>r.selected)).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=true;this.render()}handleSpaceToggle(){const r=this.value[this.cursor];if(r.selected){r.selected=false;this.render()}else if(r.disabled||this.value.filter((r=>r.selected)).length>=this.maxChoices){return this.bell()}else{r.selected=true;this.render()}}toggleAll(){if(this.maxChoices!==undefined||this.value[this.cursor].disabled){return this.bell()}const r=!this.value[this.cursor].selected;this.value.filter((r=>!r.disabled)).forEach((i=>i.selected=r));this.render()}_(r,i){if(r===" "){this.handleSpaceToggle()}else if(r==="a"){this.toggleAll()}else{return this.bell()}}renderInstructions(){if(this.instructions===undefined||this.instructions){if(typeof this.instructions==="string"){return this.instructions}return"\nInstructions:\n"+` ${p.arrowUp}/${p.arrowDown}: Highlight option\n`+` ${p.arrowLeft}/${p.arrowRight}/[space]: Toggle selection\n`+(this.maxChoices===undefined?` a: Toggle all\n`:"")+` enter/return: Complete answer`}return""}renderOption(r,i,o,l){const u=(i.selected?a.green(p.radioOn):p.radioOff)+" "+l+" ";let c,h;if(i.disabled){c=r===o?a.gray().underline(i.title):a.strikethrough().gray(i.title)}else{c=r===o?a.cyan().underline(i.title):i.title;if(r===o&&i.description){h=` - ${i.description}`;if(u.length+c.length+h.length>=this.out.columns||i.description.split(/\r?\n/).length>1){h="\n"+g(i.description,{margin:u.length,width:this.out.columns})}}}return u+c+a.gray(h||"")}paginateOptions(r){if(r.length===0){return a.red("No matches for this query.")}let i=y(this.cursor,r.length,this.optionsPerPage),o=i.startIndex,l=i.endIndex;let u,c=[];for(let i=o;i<l;i++){if(i===o&&o>0){u=p.arrowUp}else if(i===l-1&&l<r.length){u=p.arrowDown}else{u=" "}c.push(this.renderOption(this.cursor,r[i],i,u))}return"\n"+c.join("\n")}renderOptions(r){if(!this.done){return this.paginateOptions(r)}return""}renderDoneOrInstructions(){if(this.done){return this.value.filter((r=>r.selected)).map((r=>r.title)).join(", ")}const r=[a.gray(this.hint),this.renderInstructions()];if(this.value[this.cursor].disabled){r.push(a.yellow(this.warn))}return r.join(" ")}render(){if(this.closed)return;if(this.firstRender)this.out.write(u.hide);super.render();let r=[m.symbol(this.done,this.aborted),a.bold(this.msg),m.delimiter(false),this.renderDoneOrInstructions()].join(" ");if(this.showMinError){r+=a.red(`You must select a minimum of ${this.minSelected} choices.`);this.showMinError=false}r+=this.renderOptions(this.value);this.out.write(this.clear+r);this.clear=d(r,this.out.columns)}}r.exports=MultiselectPrompt},8831:(r,i,o)=>{"use strict";function asyncGeneratorStep(r,i,o,a,l,u,c){try{var h=r[u](c);var d=h.value}catch(r){o(r);return}if(h.done){i(d)}else{Promise.resolve(d).then(a,l)}}function _asyncToGenerator(r){return function(){var i=this,o=arguments;return new Promise((function(a,l){var u=r.apply(i,o);function _next(r){asyncGeneratorStep(u,a,l,_next,_throw,"next",r)}function _throw(r){asyncGeneratorStep(u,a,l,_next,_throw,"throw",r)}_next(undefined)}))}}const a=o(9439);const l=o(5876);const u=o(332),c=u.cursor,h=u.erase;const d=o(7483),p=d.style,m=d.figures,g=d.clear,y=d.lines;const v=/[0-9]/;const isDef=r=>r!==undefined;const round=(r,i)=>{let o=Math.pow(10,i);return Math.round(r*o)/o};class NumberPrompt extends l{constructor(r={}){super(r);this.transform=p.render(r.style);this.msg=r.message;this.initial=isDef(r.initial)?r.initial:"";this.float=!!r.float;this.round=r.round||2;this.inc=r.increment||1;this.min=isDef(r.min)?r.min:-Infinity;this.max=isDef(r.max)?r.max:Infinity;this.errorMsg=r.error||`Please Enter A Valid Value`;this.validator=r.validate||(()=>true);this.color=`cyan`;this.value=``;this.typed=``;this.lastHit=0;this.render()}set value(r){if(!r&&r!==0){this.placeholder=true;this.rendered=a.gray(this.transform.render(`${this.initial}`));this._value=``}else{this.placeholder=false;this.rendered=this.transform.render(`${round(r,this.round)}`);this._value=round(r,this.round)}this.fire()}get value(){return this._value}parse(r){return this.float?parseFloat(r):parseInt(r)}valid(r){return r===`-`||r===`.`&&this.float||v.test(r)}reset(){this.typed=``;this.value=``;this.fire();this.render()}exit(){this.abort()}abort(){let r=this.value;this.value=r!==``?r:this.initial;this.done=this.aborted=true;this.error=false;this.fire();this.render();this.out.write(`\n`);this.close()}validate(){var r=this;return _asyncToGenerator((function*(){let i=yield r.validator(r.value);if(typeof i===`string`){r.errorMsg=i;i=false}r.error=!i}))()}submit(){var r=this;return _asyncToGenerator((function*(){yield r.validate();if(r.error){r.color=`red`;r.fire();r.render();return}let i=r.value;r.value=i!==``?i:r.initial;r.done=true;r.aborted=false;r.error=false;r.fire();r.render();r.out.write(`\n`);r.close()}))()}up(){this.typed=``;if(this.value===""){this.value=this.min-this.inc}if(this.value>=this.max)return this.bell();this.value+=this.inc;this.color=`cyan`;this.fire();this.render()}down(){this.typed=``;if(this.value===""){this.value=this.min+this.inc}if(this.value<=this.min)return this.bell();this.value-=this.inc;this.color=`cyan`;this.fire();this.render()}delete(){let r=this.value.toString();if(r.length===0)return this.bell();this.value=this.parse(r=r.slice(0,-1))||``;if(this.value!==""&&this.value<this.min){this.value=this.min}this.color=`cyan`;this.fire();this.render()}next(){this.value=this.initial;this.fire();this.render()}_(r,i){if(!this.valid(r))return this.bell();const o=Date.now();if(o-this.lastHit>1e3)this.typed=``;this.typed+=r;this.lastHit=o;this.color=`cyan`;if(r===`.`)return this.fire();this.value=Math.min(this.parse(this.typed),this.max);if(this.value>this.max)this.value=this.max;if(this.value<this.min)this.value=this.min;this.fire();this.render()}render(){if(this.closed)return;if(!this.firstRender){if(this.outputError)this.out.write(c.down(y(this.outputError,this.out.columns)-1)+g(this.outputError,this.out.columns));this.out.write(g(this.outputText,this.out.columns))}super.render();this.outputError="";this.outputText=[p.symbol(this.done,this.aborted),a.bold(this.msg),p.delimiter(this.done),!this.done||!this.done&&!this.placeholder?a[this.color]().underline(this.rendered):this.rendered].join(` `);if(this.error){this.outputError+=this.errorMsg.split(`\n`).reduce(((r,i,o)=>r+`\n${o?` `:m.pointerSmall} ${a.red().italic(i)}`),``)}this.out.write(h.line+c.to(0)+this.outputText+c.save+this.outputError+c.restore)}}r.exports=NumberPrompt},5876:(r,i,o)=>{"use strict";const a=o(4521);const l=o(7483),u=l.action;const c=o(2361);const h=o(332),d=h.beep,p=h.cursor;const m=o(9439);class Prompt extends c{constructor(r={}){super();this.firstRender=true;this.in=r.stdin||process.stdin;this.out=r.stdout||process.stdout;this.onRender=(r.onRender||(()=>void 0)).bind(this);const i=a.createInterface({input:this.in,escapeCodeTimeout:50});a.emitKeypressEvents(this.in,i);if(this.in.isTTY)this.in.setRawMode(true);const o=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1;const keypress=(r,i)=>{let a=u(i,o);if(a===false){this._&&this._(r,i)}else if(typeof this[a]==="function"){this[a](i)}else{this.bell()}};this.close=()=>{this.out.write(p.show);this.in.removeListener("keypress",keypress);if(this.in.isTTY)this.in.setRawMode(false);i.close();this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value);this.closed=true};this.in.on("keypress",keypress)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(d)}render(){this.onRender(m);if(this.firstRender)this.firstRender=false}}r.exports=Prompt},8856:(r,i,o)=>{"use strict";const a=o(9439);const l=o(5876);const u=o(7483),c=u.style,h=u.clear,d=u.figures,p=u.wrap,m=u.entriesToDisplay;const g=o(332),y=g.cursor;class SelectPrompt extends l{constructor(r={}){super(r);this.msg=r.message;this.hint=r.hint||"- Use arrow-keys. Return to submit.";this.warn=r.warn||"- This option is disabled";this.cursor=r.initial||0;this.choices=r.choices.map(((r,i)=>{if(typeof r==="string")r={title:r,value:i};return{title:r&&(r.title||r.value||r),value:r&&(r.value===undefined?i:r.value),description:r&&r.description,selected:r&&r.selected,disabled:r&&r.disabled}}));this.optionsPerPage=r.optionsPerPage||10;this.value=(this.choices[this.cursor]||{}).value;this.clear=h("",this.out.columns);this.render()}moveCursor(r){this.cursor=r;this.value=this.choices[r].value;this.fire()}reset(){this.moveCursor(0);this.fire();this.render()}exit(){this.abort()}abort(){this.done=this.aborted=true;this.fire();this.render();this.out.write("\n");this.close()}submit(){if(!this.selection.disabled){this.done=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}else this.bell()}first(){this.moveCursor(0);this.render()}last(){this.moveCursor(this.choices.length-1);this.render()}up(){if(this.cursor===0){this.moveCursor(this.choices.length-1)}else{this.moveCursor(this.cursor-1)}this.render()}down(){if(this.cursor===this.choices.length-1){this.moveCursor(0)}else{this.moveCursor(this.cursor+1)}this.render()}next(){this.moveCursor((this.cursor+1)%this.choices.length);this.render()}_(r,i){if(r===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;if(this.firstRender)this.out.write(y.hide);else this.out.write(h(this.outputText,this.out.columns));super.render();let r=m(this.cursor,this.choices.length,this.optionsPerPage),i=r.startIndex,o=r.endIndex;this.outputText=[c.symbol(this.done,this.aborted),a.bold(this.msg),c.delimiter(false),this.done?this.selection.title:this.selection.disabled?a.yellow(this.warn):a.gray(this.hint)].join(" ");if(!this.done){this.outputText+="\n";for(let r=i;r<o;r++){let l,u,c="",h=this.choices[r];if(r===i&&i>0){u=d.arrowUp}else if(r===o-1&&o<this.choices.length){u=d.arrowDown}else{u=" "}if(h.disabled){l=this.cursor===r?a.gray().underline(h.title):a.strikethrough().gray(h.title);u=(this.cursor===r?a.bold().gray(d.pointer)+" ":" ")+u}else{l=this.cursor===r?a.cyan().underline(h.title):h.title;u=(this.cursor===r?a.cyan(d.pointer)+" ":" ")+u;if(h.description&&this.cursor===r){c=` - ${h.description}`;if(u.length+l.length+c.length>=this.out.columns||h.description.split(/\r?\n/).length>1){c="\n"+p(h.description,{margin:3,width:this.out.columns})}}}this.outputText+=`${u} ${l}${a.gray(c)}\n`}}this.out.write(this.outputText)}}r.exports=SelectPrompt},5430:(r,i,o)=>{"use strict";function asyncGeneratorStep(r,i,o,a,l,u,c){try{var h=r[u](c);var d=h.value}catch(r){o(r);return}if(h.done){i(d)}else{Promise.resolve(d).then(a,l)}}function _asyncToGenerator(r){return function(){var i=this,o=arguments;return new Promise((function(a,l){var u=r.apply(i,o);function _next(r){asyncGeneratorStep(u,a,l,_next,_throw,"next",r)}function _throw(r){asyncGeneratorStep(u,a,l,_next,_throw,"throw",r)}_next(undefined)}))}}const a=o(9439);const l=o(5876);const u=o(332),c=u.erase,h=u.cursor;const d=o(7483),p=d.style,m=d.clear,g=d.lines,y=d.figures;class TextPrompt extends l{constructor(r={}){super(r);this.transform=p.render(r.style);this.scale=this.transform.scale;this.msg=r.message;this.initial=r.initial||``;this.validator=r.validate||(()=>true);this.value=``;this.errorMsg=r.error||`Please Enter A Valid Value`;this.cursor=Number(!!this.initial);this.cursorOffset=0;this.clear=m(``,this.out.columns);this.render()}set value(r){if(!r&&this.initial){this.placeholder=true;this.rendered=a.gray(this.transform.render(this.initial))}else{this.placeholder=false;this.rendered=this.transform.render(r)}this._value=r;this.fire()}get value(){return this._value}reset(){this.value=``;this.cursor=Number(!!this.initial);this.cursorOffset=0;this.fire();this.render()}exit(){this.abort()}abort(){this.value=this.value||this.initial;this.done=this.aborted=true;this.error=false;this.red=false;this.fire();this.render();this.out.write("\n");this.close()}validate(){var r=this;return _asyncToGenerator((function*(){let i=yield r.validator(r.value);if(typeof i===`string`){r.errorMsg=i;i=false}r.error=!i}))()}submit(){var r=this;return _asyncToGenerator((function*(){r.value=r.value||r.initial;r.cursorOffset=0;r.cursor=r.rendered.length;yield r.validate();if(r.error){r.red=true;r.fire();r.render();return}r.done=true;r.aborted=false;r.fire();r.render();r.out.write("\n");r.close()}))()}next(){if(!this.placeholder)return this.bell();this.value=this.initial;this.cursor=this.rendered.length;this.fire();this.render()}moveCursor(r){if(this.placeholder)return;this.cursor=this.cursor+r;this.cursorOffset+=r}_(r,i){let o=this.value.slice(0,this.cursor);let a=this.value.slice(this.cursor);this.value=`${o}${r}${a}`;this.red=false;this.cursor=this.placeholder?0:o.length+1;this.render()}delete(){if(this.isCursorAtStart())return this.bell();let r=this.value.slice(0,this.cursor-1);let i=this.value.slice(this.cursor);this.value=`${r}${i}`;this.red=false;if(this.isCursorAtStart()){this.cursorOffset=0}else{this.cursorOffset++;this.moveCursor(-1)}this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let r=this.value.slice(0,this.cursor);let i=this.value.slice(this.cursor+1);this.value=`${r}${i}`;this.red=false;if(this.isCursorAtEnd()){this.cursorOffset=0}else{this.cursorOffset++}this.render()}first(){this.cursor=0;this.render()}last(){this.cursor=this.value.length;this.render()}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1);this.render()}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1);this.render()}isCursorAtStart(){return this.cursor===0||this.placeholder&&this.cursor===1}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){if(this.closed)return;if(!this.firstRender){if(this.outputError)this.out.write(h.down(g(this.outputError,this.out.columns)-1)+m(this.outputError,this.out.columns));this.out.write(m(this.outputText,this.out.columns))}super.render();this.outputError="";this.outputText=[p.symbol(this.done,this.aborted),a.bold(this.msg),p.delimiter(this.done),this.red?a.red(this.rendered):this.rendered].join(` `);if(this.error){this.outputError+=this.errorMsg.split(`\n`).reduce(((r,i,o)=>r+`\n${o?" ":y.pointerSmall} ${a.red().italic(i)}`),``)}this.out.write(c.line+h.to(0)+this.outputText+h.save+this.outputError+h.restore+h.move(this.cursorOffset,0))}}r.exports=TextPrompt},9692:(r,i,o)=>{"use strict";const a=o(9439);const l=o(5876);const u=o(7483),c=u.style,h=u.clear;const d=o(332),p=d.cursor,m=d.erase;class TogglePrompt extends l{constructor(r={}){super(r);this.msg=r.message;this.value=!!r.initial;this.active=r.active||"on";this.inactive=r.inactive||"off";this.initialValue=this.value;this.render()}reset(){this.value=this.initialValue;this.fire();this.render()}exit(){this.abort()}abort(){this.done=this.aborted=true;this.fire();this.render();this.out.write("\n");this.close()}submit(){this.done=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}deactivate(){if(this.value===false)return this.bell();this.value=false;this.render()}activate(){if(this.value===true)return this.bell();this.value=true;this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value;this.fire();this.render()}_(r,i){if(r===" "){this.value=!this.value}else if(r==="1"){this.value=true}else if(r==="0"){this.value=false}else return this.bell();this.render()}render(){if(this.closed)return;if(this.firstRender)this.out.write(p.hide);else this.out.write(h(this.outputText,this.out.columns));super.render();this.outputText=[c.symbol(this.done,this.aborted),a.bold(this.msg),c.delimiter(this.done),this.value?this.inactive:a.cyan().underline(this.inactive),a.gray("/"),this.value?a.cyan().underline(this.active):this.active].join(" ");this.out.write(m.line+p.to(0)+this.outputText)}}r.exports=TogglePrompt},6598:(r,i,o)=>{"use strict";function ownKeys(r,i){var o=Object.keys(r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(r);if(i){a=a.filter((function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable}))}o.push.apply(o,a)}return o}function _objectSpread(r){for(var i=1;i<arguments.length;i++){var o=arguments[i]!=null?arguments[i]:{};if(i%2){ownKeys(Object(o),true).forEach((function(i){_defineProperty(r,i,o[i])}))}else if(Object.getOwnPropertyDescriptors){Object.defineProperties(r,Object.getOwnPropertyDescriptors(o))}else{ownKeys(Object(o)).forEach((function(i){Object.defineProperty(r,i,Object.getOwnPropertyDescriptor(o,i))}))}}return r}function _defineProperty(r,i,o){if(i in r){Object.defineProperty(r,i,{value:o,enumerable:true,configurable:true,writable:true})}else{r[i]=o}return r}function _createForOfIteratorHelper(r,i){var o=typeof Symbol!=="undefined"&&r[Symbol.iterator]||r["@@iterator"];if(!o){if(Array.isArray(r)||(o=_unsupportedIterableToArray(r))||i&&r&&typeof r.length==="number"){if(o)r=o;var a=0;var l=function F(){};return{s:l,n:function n(){if(a>=r.length)return{done:true};return{done:false,value:r[a++]}},e:function e(r){throw r},f:l}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var u=true,c=false,h;return{s:function s(){o=o.call(r)},n:function n(){var r=o.next();u=r.done;return r},e:function e(r){c=true;h=r},f:function f(){try{if(!u&&o.return!=null)o.return()}finally{if(c)throw h}}}}function _unsupportedIterableToArray(r,i){if(!r)return;if(typeof r==="string")return _arrayLikeToArray(r,i);var o=Object.prototype.toString.call(r).slice(8,-1);if(o==="Object"&&r.constructor)o=r.constructor.name;if(o==="Map"||o==="Set")return Array.from(r);if(o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return _arrayLikeToArray(r,i)}function _arrayLikeToArray(r,i){if(i==null||i>r.length)i=r.length;for(var o=0,a=new Array(i);o<i;o++)a[o]=r[o];return a}function asyncGeneratorStep(r,i,o,a,l,u,c){try{var h=r[u](c);var d=h.value}catch(r){o(r);return}if(h.done){i(d)}else{Promise.resolve(d).then(a,l)}}function _asyncToGenerator(r){return function(){var i=this,o=arguments;return new Promise((function(a,l){var u=r.apply(i,o);function _next(r){asyncGeneratorStep(u,a,l,_next,_throw,"next",r)}function _throw(r){asyncGeneratorStep(u,a,l,_next,_throw,"throw",r)}_next(undefined)}))}}const a=o(4591);const l=["suggest","format","onState","validate","onRender","type"];const noop=()=>{};function prompt(){return _prompt.apply(this,arguments)}function _prompt(){_prompt=_asyncToGenerator((function*(r=[],{onSubmit:i=noop,onCancel:o=noop}={}){const u={};const c=prompt._override||{};r=[].concat(r);let h,d,p,m,g,y;const v=function(){var r=_asyncToGenerator((function*(r,i,o=false){if(!o&&r.validate&&r.validate(i)!==true){return}return r.format?yield r.format(i,u):i}));return function getFormattedAnswer(i,o){return r.apply(this,arguments)}}();var b=_createForOfIteratorHelper(r),w;try{for(b.s();!(w=b.n()).done;){d=w.value;var M=d;m=M.name;g=M.type;if(typeof g==="function"){g=yield g(h,_objectSpread({},u),d);d["type"]=g}if(!g)continue;for(let r in d){if(l.includes(r))continue;let i=d[r];d[r]=typeof i==="function"?yield i(h,_objectSpread({},u),y):i}y=d;if(typeof d.message!=="string"){throw new Error("prompt message is required")}var E=d;m=E.name;g=E.type;if(a[g]===void 0){throw new Error(`prompt type (${g}) is not defined`)}if(c[d.name]!==undefined){h=yield v(d,c[d.name]);if(h!==undefined){u[m]=h;continue}}try{h=prompt._injected?getInjectedAnswer(prompt._injected,d.initial):yield a[g](d);u[m]=h=yield v(d,h,true);p=yield i(d,h,u)}catch(r){p=!(yield o(d,u))}if(p)return u}}catch(r){b.e(r)}finally{b.f()}return u}));return _prompt.apply(this,arguments)}function getInjectedAnswer(r,i){const o=r.shift();if(o instanceof Error){throw o}return o===undefined?i:o}function inject(r){prompt._injected=(prompt._injected||[]).concat(r)}function override(r){prompt._override=Object.assign({},r)}r.exports=Object.assign(prompt,{prompt:prompt,prompts:a,inject:inject,override:override})},4591:(r,i,o)=>{"use strict";const a=i;const l=o(9956);const noop=r=>r;function toPrompt(r,i,o={}){return new Promise(((a,u)=>{const c=new l[r](i);const h=o.onAbort||noop;const d=o.onSubmit||noop;const p=o.onExit||noop;c.on("state",i.onState||noop);c.on("submit",(r=>a(d(r))));c.on("exit",(r=>a(p(r))));c.on("abort",(r=>u(h(r))))}))}a.text=r=>toPrompt("TextPrompt",r);a.password=r=>{r.style="password";return a.text(r)};a.invisible=r=>{r.style="invisible";return a.text(r)};a.number=r=>toPrompt("NumberPrompt",r);a.date=r=>toPrompt("DatePrompt",r);a.confirm=r=>toPrompt("ConfirmPrompt",r);a.list=r=>{const i=r.separator||",";return toPrompt("TextPrompt",r,{onSubmit:r=>r.split(i).map((r=>r.trim()))})};a.toggle=r=>toPrompt("TogglePrompt",r);a.select=r=>toPrompt("SelectPrompt",r);a.multiselect=r=>{r.choices=[].concat(r.choices||[]);const toSelected=r=>r.filter((r=>r.selected)).map((r=>r.value));return toPrompt("MultiselectPrompt",r,{onAbort:toSelected,onSubmit:toSelected})};a.autocompleteMultiselect=r=>{r.choices=[].concat(r.choices||[]);const toSelected=r=>r.filter((r=>r.selected)).map((r=>r.value));return toPrompt("AutocompleteMultiselectPrompt",r,{onAbort:toSelected,onSubmit:toSelected})};const byTitle=(r,i)=>Promise.resolve(i.filter((i=>i.title.slice(0,r.length).toLowerCase()===r.toLowerCase())));a.autocomplete=r=>{r.suggest=r.suggest||byTitle;r.choices=[].concat(r.choices||[]);return toPrompt("AutocompletePrompt",r)}},8692:r=>{"use strict";r.exports=(r,i)=>{if(r.meta&&r.name!=="escape")return;if(r.ctrl){if(r.name==="a")return"first";if(r.name==="c")return"abort";if(r.name==="d")return"abort";if(r.name==="e")return"last";if(r.name==="g")return"reset"}if(i){if(r.name==="j")return"down";if(r.name==="k")return"up"}if(r.name==="return")return"submit";if(r.name==="enter")return"submit";if(r.name==="backspace")return"delete";if(r.name==="delete")return"deleteForward";if(r.name==="abort")return"abort";if(r.name==="escape")return"exit";if(r.name==="tab")return"next";if(r.name==="pagedown")return"nextPage";if(r.name==="pageup")return"prevPage";if(r.name==="home")return"home";if(r.name==="end")return"end";if(r.name==="up")return"up";if(r.name==="down")return"down";if(r.name==="right")return"right";if(r.name==="left")return"left";return false}},3513:(r,i,o)=>{"use strict";function _createForOfIteratorHelper(r,i){var o=typeof Symbol!=="undefined"&&r[Symbol.iterator]||r["@@iterator"];if(!o){if(Array.isArray(r)||(o=_unsupportedIterableToArray(r))||i&&r&&typeof r.length==="number"){if(o)r=o;var a=0;var l=function F(){};return{s:l,n:function n(){if(a>=r.length)return{done:true};return{done:false,value:r[a++]}},e:function e(r){throw r},f:l}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var u=true,c=false,h;return{s:function s(){o=o.call(r)},n:function n(){var r=o.next();u=r.done;return r},e:function e(r){c=true;h=r},f:function f(){try{if(!u&&o.return!=null)o.return()}finally{if(c)throw h}}}}function _unsupportedIterableToArray(r,i){if(!r)return;if(typeof r==="string")return _arrayLikeToArray(r,i);var o=Object.prototype.toString.call(r).slice(8,-1);if(o==="Object"&&r.constructor)o=r.constructor.name;if(o==="Map"||o==="Set")return Array.from(r);if(o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return _arrayLikeToArray(r,i)}function _arrayLikeToArray(r,i){if(i==null||i>r.length)i=r.length;for(var o=0,a=new Array(i);o<i;o++)a[o]=r[o];return a}const a=o(8760);const l=o(332),u=l.erase,c=l.cursor;const width=r=>[...a(r)].length;r.exports=function(r,i){if(!i)return u.line+c.to(0);let o=0;const a=r.split(/\r?\n/);var l=_createForOfIteratorHelper(a),h;try{for(l.s();!(h=l.n()).done;){let r=h.value;o+=1+Math.floor(Math.max(width(r)-1,0)/i)}}catch(r){l.e(r)}finally{l.f()}return u.lines(o)}},393:r=>{"use strict";r.exports=(r,i,o)=>{o=o||i;let a=Math.min(i-o,r-Math.floor(o/2));if(a<0)a=0;let l=Math.min(a+o,i);return{startIndex:a,endIndex:l}}},6217:r=>{"use strict";const i={arrowUp:"↑",arrowDown:"↓",arrowLeft:"←",arrowRight:"→",radioOn:"◉",radioOff:"◯",tick:"✔",cross:"✖",ellipsis:"…",pointerSmall:"›",line:"─",pointer:"❯"};const o={arrowUp:i.arrowUp,arrowDown:i.arrowDown,arrowLeft:i.arrowLeft,arrowRight:i.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"√",cross:"×",ellipsis:"...",pointerSmall:"»",line:"─",pointer:">"};const a=process.platform==="win32"?o:i;r.exports=a},7483:(r,i,o)=>{"use strict";r.exports={action:o(8692),clear:o(3513),style:o(5012),strip:o(8760),figures:o(6217),lines:o(1688),wrap:o(1705),entriesToDisplay:o(393)}},1688:(r,i,o)=>{"use strict";const a=o(8760);r.exports=function(r,i){let o=String(a(r)||"").split(/\r?\n/);if(!i)return o.length;return o.map((r=>Math.ceil(r.length/i))).reduce(((r,i)=>r+i))}},8760:r=>{"use strict";r.exports=r=>{const i=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|");const o=new RegExp(i,"g");return typeof r==="string"?r.replace(o,""):r}},5012:(r,i,o)=>{"use strict";const a=o(9439);const l=o(6217);const u=Object.freeze({password:{scale:1,render:r=>"*".repeat(r.length)},emoji:{scale:2,render:r=>"😃".repeat(r.length)},invisible:{scale:0,render:r=>""},default:{scale:1,render:r=>`${r}`}});const render=r=>u[r]||u.default;const c=Object.freeze({aborted:a.red(l.cross),done:a.green(l.tick),exited:a.yellow(l.cross),default:a.cyan("?")});const symbol=(r,i,o)=>i?c.aborted:o?c.exited:r?c.done:c.default;const delimiter=r=>a.gray(r?l.ellipsis:l.pointerSmall);const item=(r,i)=>a.gray(r?i?l.pointerSmall:"+":l.line);r.exports={styles:u,render:render,symbols:c,symbol:symbol,delimiter:delimiter,item:item}},1705:r=>{"use strict";r.exports=(r,i={})=>{const o=Number.isSafeInteger(parseInt(i.margin))?new Array(parseInt(i.margin)).fill(" ").join(""):i.margin||"";const a=i.width;return(r||"").split(/\r?\n/g).map((r=>r.split(/\s+/g).reduce(((r,i)=>{if(i.length+o.length>=a||r[r.length-1].length+i.length+1<a)r[r.length-1]+=` ${i}`;else r.push(`${o}${i}`);return r}),[o]).join("\n"))).join("\n")}},1112:(r,i,o)=>{function isNodeLT(r){r=(Array.isArray(r)?r:r.split(".")).map(Number);let i=0,o=process.versions.node.split(".").map(Number);for(;i<r.length;i++){if(o[i]>r[i])return false;if(r[i]>o[i])return true}return false}r.exports=isNodeLT("8.6.0")?o(6598):o(9590)},8994:r=>{"use strict";class DatePart{constructor({token:r,date:i,parts:o,locales:a}){this.token=r;this.date=i||new Date;this.parts=o||[this];this.locales=a||{}}up(){}down(){}next(){const r=this.parts.indexOf(this);return this.parts.find(((i,o)=>o>r&&i instanceof DatePart))}setTo(r){}prev(){let r=[].concat(this.parts).reverse();const i=r.indexOf(this);return r.find(((r,o)=>o>i&&r instanceof DatePart))}toString(){return String(this.date)}}r.exports=DatePart},5513:(r,i,o)=>{"use strict";const a=o(8994);const pos=r=>{r=r%10;return r===1?"st":r===2?"nd":r===3?"rd":"th"};class Day extends a{constructor(r={}){super(r)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(r){this.date.setDate(parseInt(r.substr(-2)))}toString(){let r=this.date.getDate();let i=this.date.getDay();return this.token==="DD"?String(r).padStart(2,"0"):this.token==="Do"?r+pos(r):this.token==="d"?i+1:this.token==="ddd"?this.locales.weekdaysShort[i]:this.token==="dddd"?this.locales.weekdays[i]:r}}r.exports=Day},9270:(r,i,o)=>{"use strict";const a=o(8994);class Hours extends a{constructor(r={}){super(r)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(r){this.date.setHours(parseInt(r.substr(-2)))}toString(){let r=this.date.getHours();if(/h/.test(this.token))r=r%12||12;return this.token.length>1?String(r).padStart(2,"0"):r}}r.exports=Hours},1190:(r,i,o)=>{"use strict";r.exports={DatePart:o(8994),Meridiem:o(8135),Day:o(5513),Hours:o(9270),Milliseconds:o(2397),Minutes:o(9246),Month:o(5763),Seconds:o(5579),Year:o(4191)}},8135:(r,i,o)=>{"use strict";const a=o(8994);class Meridiem extends a{constructor(r={}){super(r)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let r=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?r.toUpperCase():r}}r.exports=Meridiem},2397:(r,i,o)=>{"use strict";const a=o(8994);class Milliseconds extends a{constructor(r={}){super(r)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(r){this.date.setMilliseconds(parseInt(r.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}}r.exports=Milliseconds},9246:(r,i,o)=>{"use strict";const a=o(8994);class Minutes extends a{constructor(r={}){super(r)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(r){this.date.setMinutes(parseInt(r.substr(-2)))}toString(){let r=this.date.getMinutes();return this.token.length>1?String(r).padStart(2,"0"):r}}r.exports=Minutes},5763:(r,i,o)=>{"use strict";const a=o(8994);class Month extends a{constructor(r={}){super(r)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(r){r=parseInt(r.substr(-2))-1;this.date.setMonth(r<0?0:r)}toString(){let r=this.date.getMonth();let i=this.token.length;return i===2?String(r+1).padStart(2,"0"):i===3?this.locales.monthsShort[r]:i===4?this.locales.months[r]:String(r+1)}}r.exports=Month},5579:(r,i,o)=>{"use strict";const a=o(8994);class Seconds extends a{constructor(r={}){super(r)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(r){this.date.setSeconds(parseInt(r.substr(-2)))}toString(){let r=this.date.getSeconds();return this.token.length>1?String(r).padStart(2,"0"):r}}r.exports=Seconds},4191:(r,i,o)=>{"use strict";const a=o(8994);class Year extends a{constructor(r={}){super(r)}up(){this.date.setFullYear(this.date.getFullYear()+1)}down(){this.date.setFullYear(this.date.getFullYear()-1)}setTo(r){this.date.setFullYear(r.substr(-4))}toString(){let r=String(this.date.getFullYear()).padStart(4,"0");return this.token.length===2?r.substr(-2):r}}r.exports=Year},514:(r,i,o)=>{"use strict";const a=o(9439);const l=o(9126);const{erase:u,cursor:c}=o(332);const{style:h,clear:d,figures:p,wrap:m,entriesToDisplay:g}=o(9807);const getVal=(r,i)=>r[i]&&(r[i].value||r[i].title||r[i]);const getTitle=(r,i)=>r[i]&&(r[i].title||r[i].value||r[i]);const getIndex=(r,i)=>{const o=r.findIndex((r=>r.value===i||r.title===i));return o>-1?o:undefined};class AutocompletePrompt extends l{constructor(r={}){super(r);this.msg=r.message;this.suggest=r.suggest;this.choices=r.choices;this.initial=typeof r.initial==="number"?r.initial:getIndex(r.choices,r.initial);this.select=this.initial||r.cursor||0;this.i18n={noMatches:r.noMatches||"no matches found"};this.fallback=r.fallback||this.initial;this.clearFirst=r.clearFirst||false;this.suggestions=[];this.input="";this.limit=r.limit||10;this.cursor=0;this.transform=h.render(r.style);this.scale=this.transform.scale;this.render=this.render.bind(this);this.complete=this.complete.bind(this);this.clear=d("",this.out.columns);this.complete(this.render);this.render()}set fallback(r){this._fb=Number.isSafeInteger(parseInt(r))?parseInt(r):r}get fallback(){let r;if(typeof this._fb==="number")r=this.choices[this._fb];else if(typeof this._fb==="string")r={title:this._fb};return r||this._fb||{title:this.i18n.noMatches}}moveSelect(r){this.select=r;if(this.suggestions.length>0)this.value=getVal(this.suggestions,r);else this.value=this.fallback.value;this.fire()}async complete(r){const i=this.completing=this.suggest(this.input,this.choices);const o=await i;if(this.completing!==i)return;this.suggestions=o.map(((r,i,o)=>({title:getTitle(o,i),value:getVal(o,i),description:r.description})));this.completing=false;const a=Math.max(o.length-1,0);this.moveSelect(Math.min(a,this.select));r&&r()}reset(){this.input="";this.complete((()=>{this.moveSelect(this.initial!==void 0?this.initial:0);this.render()}));this.render()}exit(){if(this.clearFirst&&this.input.length>0){this.reset()}else{this.done=this.exited=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}}abort(){this.done=this.aborted=true;this.exited=false;this.fire();this.render();this.out.write("\n");this.close()}submit(){this.done=true;this.aborted=this.exited=false;this.fire();this.render();this.out.write("\n");this.close()}_(r,i){let o=this.input.slice(0,this.cursor);let a=this.input.slice(this.cursor);this.input=`${o}${r}${a}`;this.cursor=o.length+1;this.complete(this.render);this.render()}delete(){if(this.cursor===0)return this.bell();let r=this.input.slice(0,this.cursor-1);let i=this.input.slice(this.cursor);this.input=`${r}${i}`;this.complete(this.render);this.cursor=this.cursor-1;this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let r=this.input.slice(0,this.cursor);let i=this.input.slice(this.cursor+1);this.input=`${r}${i}`;this.complete(this.render);this.render()}first(){this.moveSelect(0);this.render()}last(){this.moveSelect(this.suggestions.length-1);this.render()}up(){if(this.select===0){this.moveSelect(this.suggestions.length-1)}else{this.moveSelect(this.select-1)}this.render()}down(){if(this.select===this.suggestions.length-1){this.moveSelect(0)}else{this.moveSelect(this.select+1)}this.render()}next(){if(this.select===this.suggestions.length-1){this.moveSelect(0)}else this.moveSelect(this.select+1);this.render()}nextPage(){this.moveSelect(Math.min(this.select+this.limit,this.suggestions.length-1));this.render()}prevPage(){this.moveSelect(Math.max(this.select-this.limit,0));this.render()}left(){if(this.cursor<=0)return this.bell();this.cursor=this.cursor-1;this.render()}right(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.cursor=this.cursor+1;this.render()}renderOption(r,i,o,l){let u;let c=o?p.arrowUp:l?p.arrowDown:" ";let h=i?a.cyan().underline(r.title):r.title;c=(i?a.cyan(p.pointer)+" ":" ")+c;if(r.description){u=` - ${r.description}`;if(c.length+h.length+u.length>=this.out.columns||r.description.split(/\r?\n/).length>1){u="\n"+m(r.description,{margin:3,width:this.out.columns})}}return c+" "+h+a.gray(u||"")}render(){if(this.closed)return;if(this.firstRender)this.out.write(c.hide);else this.out.write(d(this.outputText,this.out.columns));super.render();let{startIndex:r,endIndex:i}=g(this.select,this.choices.length,this.limit);this.outputText=[h.symbol(this.done,this.aborted,this.exited),a.bold(this.msg),h.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" ");if(!this.done){const o=this.suggestions.slice(r,i).map(((o,a)=>this.renderOption(o,this.select===a+r,a===0&&r>0,a+r===i-1&&i<this.choices.length))).join("\n");this.outputText+=`\n`+(o||a.gray(this.fallback.title))}this.out.write(u.line+c.to(0)+this.outputText)}}r.exports=AutocompletePrompt},7685:(r,i,o)=>{"use strict";const a=o(9439);const{cursor:l}=o(332);const u=o(92);const{clear:c,style:h,figures:d}=o(9807);class AutocompleteMultiselectPrompt extends u{constructor(r={}){r.overrideRender=true;super(r);this.inputValue="";this.clear=c("",this.out.columns);this.filteredOptions=this.value;this.render()}last(){this.cursor=this.filteredOptions.length-1;this.render()}next(){this.cursor=(this.cursor+1)%this.filteredOptions.length;this.render()}up(){if(this.cursor===0){this.cursor=this.filteredOptions.length-1}else{this.cursor--}this.render()}down(){if(this.cursor===this.filteredOptions.length-1){this.cursor=0}else{this.cursor++}this.render()}left(){this.filteredOptions[this.cursor].selected=false;this.render()}right(){if(this.value.filter((r=>r.selected)).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=true;this.render()}delete(){if(this.inputValue.length){this.inputValue=this.inputValue.substr(0,this.inputValue.length-1);this.updateFilteredOptions()}}updateFilteredOptions(){const r=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter((r=>{if(this.inputValue){if(typeof r.title==="string"){if(r.title.toLowerCase().includes(this.inputValue.toLowerCase())){return true}}if(typeof r.value==="string"){if(r.value.toLowerCase().includes(this.inputValue.toLowerCase())){return true}}return false}return true}));const i=this.filteredOptions.findIndex((i=>i===r));this.cursor=i<0?0:i;this.render()}handleSpaceToggle(){const r=this.filteredOptions[this.cursor];if(r.selected){r.selected=false;this.render()}else if(r.disabled||this.value.filter((r=>r.selected)).length>=this.maxChoices){return this.bell()}else{r.selected=true;this.render()}}handleInputChange(r){this.inputValue=this.inputValue+r;this.updateFilteredOptions()}_(r,i){if(r===" "){this.handleSpaceToggle()}else{this.handleInputChange(r)}}renderInstructions(){if(this.instructions===undefined||this.instructions){if(typeof this.instructions==="string"){return this.instructions}return`\nInstructions:\n ${d.arrowUp}/${d.arrowDown}: Highlight option\n ${d.arrowLeft}/${d.arrowRight}/[space]: Toggle selection\n [a,b,c]/delete: Filter choices\n enter/return: Complete answer\n`}return""}renderCurrentInput(){return`\nFiltered results for: ${this.inputValue?this.inputValue:a.gray("Enter something to filter")}\n`}renderOption(r,i,o){let l;if(i.disabled)l=r===o?a.gray().underline(i.title):a.strikethrough().gray(i.title);else l=r===o?a.cyan().underline(i.title):i.title;return(i.selected?a.green(d.radioOn):d.radioOff)+" "+l}renderDoneOrInstructions(){if(this.done){return this.value.filter((r=>r.selected)).map((r=>r.title)).join(", ")}const r=[a.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];if(this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled){r.push(a.yellow(this.warn))}return r.join(" ")}render(){if(this.closed)return;if(this.firstRender)this.out.write(l.hide);super.render();let r=[h.symbol(this.done,this.aborted),a.bold(this.msg),h.delimiter(false),this.renderDoneOrInstructions()].join(" ");if(this.showMinError){r+=a.red(`You must select a minimum of ${this.minSelected} choices.`);this.showMinError=false}r+=this.renderOptions(this.filteredOptions);this.out.write(this.clear+r);this.clear=c(r,this.out.columns)}}r.exports=AutocompleteMultiselectPrompt},3037:(r,i,o)=>{const a=o(9439);const l=o(9126);const{style:u,clear:c}=o(9807);const{erase:h,cursor:d}=o(332);class ConfirmPrompt extends l{constructor(r={}){super(r);this.msg=r.message;this.value=r.initial;this.initialValue=!!r.initial;this.yesMsg=r.yes||"yes";this.yesOption=r.yesOption||"(Y/n)";this.noMsg=r.no||"no";this.noOption=r.noOption||"(y/N)";this.render()}reset(){this.value=this.initialValue;this.fire();this.render()}exit(){this.abort()}abort(){this.done=this.aborted=true;this.fire();this.render();this.out.write("\n");this.close()}submit(){this.value=this.value||false;this.done=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}_(r,i){if(r.toLowerCase()==="y"){this.value=true;return this.submit()}if(r.toLowerCase()==="n"){this.value=false;return this.submit()}return this.bell()}render(){if(this.closed)return;if(this.firstRender)this.out.write(d.hide);else this.out.write(c(this.outputText,this.out.columns));super.render();this.outputText=[u.symbol(this.done,this.aborted),a.bold(this.msg),u.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:a.gray(this.initialValue?this.yesOption:this.noOption)].join(" ");this.out.write(h.line+d.to(0)+this.outputText)}}r.exports=ConfirmPrompt},5048:(r,i,o)=>{"use strict";const a=o(9439);const l=o(9126);const{style:u,clear:c,figures:h}=o(9807);const{erase:d,cursor:p}=o(332);const{DatePart:m,Meridiem:g,Day:y,Hours:v,Milliseconds:b,Minutes:w,Month:M,Seconds:E,Year:D}=o(1190);const T=/\\(.)|"((?:\\["\\]|[^"])+)"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g;const x={1:({token:r})=>r.replace(/\\(.)/g,"$1"),2:r=>new y(r),3:r=>new M(r),4:r=>new D(r),5:r=>new g(r),6:r=>new v(r),7:r=>new w(r),8:r=>new E(r),9:r=>new b(r)};const O={months:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),monthsShort:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),weekdays:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),weekdaysShort:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(",")};class DatePrompt extends l{constructor(r={}){super(r);this.msg=r.message;this.cursor=0;this.typed="";this.locales=Object.assign(O,r.locales);this._date=r.initial||new Date;this.errorMsg=r.error||"Please Enter A Valid Value";this.validator=r.validate||(()=>true);this.mask=r.mask||"YYYY-MM-DD HH:mm:ss";this.clear=c("",this.out.columns);this.render()}get value(){return this.date}get date(){return this._date}set date(r){if(r)this._date.setTime(r.getTime())}set mask(r){let i;this.parts=[];while(i=T.exec(r)){let r=i.shift();let o=i.findIndex((r=>r!=null));this.parts.push(o in x?x[o]({token:i[o]||r,date:this.date,parts:this.parts,locales:this.locales}):i[o]||r)}let o=this.parts.reduce(((r,i)=>{if(typeof i==="string"&&typeof r[r.length-1]==="string")r[r.length-1]+=i;else r.push(i);return r}),[]);this.parts.splice(0);this.parts.push(...o);this.reset()}moveCursor(r){this.typed="";this.cursor=r;this.fire()}reset(){this.moveCursor(this.parts.findIndex((r=>r instanceof m)));this.fire();this.render()}exit(){this.abort()}abort(){this.done=this.aborted=true;this.error=false;this.fire();this.render();this.out.write("\n");this.close()}async validate(){let r=await this.validator(this.value);if(typeof r==="string"){this.errorMsg=r;r=false}this.error=!r}async submit(){await this.validate();if(this.error){this.color="red";this.fire();this.render();return}this.done=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}up(){this.typed="";this.parts[this.cursor].up();this.render()}down(){this.typed="";this.parts[this.cursor].down();this.render()}left(){let r=this.parts[this.cursor].prev();if(r==null)return this.bell();this.moveCursor(this.parts.indexOf(r));this.render()}right(){let r=this.parts[this.cursor].next();if(r==null)return this.bell();this.moveCursor(this.parts.indexOf(r));this.render()}next(){let r=this.parts[this.cursor].next();this.moveCursor(r?this.parts.indexOf(r):this.parts.findIndex((r=>r instanceof m)));this.render()}_(r){if(/\d/.test(r)){this.typed+=r;this.parts[this.cursor].setTo(this.typed);this.render()}}render(){if(this.closed)return;if(this.firstRender)this.out.write(p.hide);else this.out.write(c(this.outputText,this.out.columns));super.render();this.outputText=[u.symbol(this.done,this.aborted),a.bold(this.msg),u.delimiter(false),this.parts.reduce(((r,i,o)=>r.concat(o===this.cursor&&!this.done?a.cyan().underline(i.toString()):i)),[]).join("")].join(" ");if(this.error){this.outputText+=this.errorMsg.split("\n").reduce(((r,i,o)=>r+`\n${o?` `:h.pointerSmall} ${a.red().italic(i)}`),``)}this.out.write(d.line+p.to(0)+this.outputText)}}r.exports=DatePrompt},6529:(r,i,o)=>{"use strict";r.exports={TextPrompt:o(1551),SelectPrompt:o(6515),TogglePrompt:o(181),DatePrompt:o(5048),NumberPrompt:o(3686),MultiselectPrompt:o(92),AutocompletePrompt:o(514),AutocompleteMultiselectPrompt:o(7685),ConfirmPrompt:o(3037)}},92:(r,i,o)=>{"use strict";const a=o(9439);const{cursor:l}=o(332);const u=o(9126);const{clear:c,figures:h,style:d,wrap:p,entriesToDisplay:m}=o(9807);class MultiselectPrompt extends u{constructor(r={}){super(r);this.msg=r.message;this.cursor=r.cursor||0;this.scrollIndex=r.cursor||0;this.hint=r.hint||"";this.warn=r.warn||"- This option is disabled -";this.minSelected=r.min;this.showMinError=false;this.maxChoices=r.max;this.instructions=r.instructions;this.optionsPerPage=r.optionsPerPage||10;this.value=r.choices.map(((r,i)=>{if(typeof r==="string")r={title:r,value:i};return{title:r&&(r.title||r.value||r),description:r&&r.description,value:r&&(r.value===undefined?i:r.value),selected:r&&r.selected,disabled:r&&r.disabled}}));this.clear=c("",this.out.columns);if(!r.overrideRender){this.render()}}reset(){this.value.map((r=>!r.selected));this.cursor=0;this.fire();this.render()}selected(){return this.value.filter((r=>r.selected))}exit(){this.abort()}abort(){this.done=this.aborted=true;this.fire();this.render();this.out.write("\n");this.close()}submit(){const r=this.value.filter((r=>r.selected));if(this.minSelected&&r.length<this.minSelected){this.showMinError=true;this.render()}else{this.done=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}}first(){this.cursor=0;this.render()}last(){this.cursor=this.value.length-1;this.render()}next(){this.cursor=(this.cursor+1)%this.value.length;this.render()}up(){if(this.cursor===0){this.cursor=this.value.length-1}else{this.cursor--}this.render()}down(){if(this.cursor===this.value.length-1){this.cursor=0}else{this.cursor++}this.render()}left(){this.value[this.cursor].selected=false;this.render()}right(){if(this.value.filter((r=>r.selected)).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=true;this.render()}handleSpaceToggle(){const r=this.value[this.cursor];if(r.selected){r.selected=false;this.render()}else if(r.disabled||this.value.filter((r=>r.selected)).length>=this.maxChoices){return this.bell()}else{r.selected=true;this.render()}}toggleAll(){if(this.maxChoices!==undefined||this.value[this.cursor].disabled){return this.bell()}const r=!this.value[this.cursor].selected;this.value.filter((r=>!r.disabled)).forEach((i=>i.selected=r));this.render()}_(r,i){if(r===" "){this.handleSpaceToggle()}else if(r==="a"){this.toggleAll()}else{return this.bell()}}renderInstructions(){if(this.instructions===undefined||this.instructions){if(typeof this.instructions==="string"){return this.instructions}return"\nInstructions:\n"+` ${h.arrowUp}/${h.arrowDown}: Highlight option\n`+` ${h.arrowLeft}/${h.arrowRight}/[space]: Toggle selection\n`+(this.maxChoices===undefined?` a: Toggle all\n`:"")+` enter/return: Complete answer`}return""}renderOption(r,i,o,l){const u=(i.selected?a.green(h.radioOn):h.radioOff)+" "+l+" ";let c,d;if(i.disabled){c=r===o?a.gray().underline(i.title):a.strikethrough().gray(i.title)}else{c=r===o?a.cyan().underline(i.title):i.title;if(r===o&&i.description){d=` - ${i.description}`;if(u.length+c.length+d.length>=this.out.columns||i.description.split(/\r?\n/).length>1){d="\n"+p(i.description,{margin:u.length,width:this.out.columns})}}}return u+c+a.gray(d||"")}paginateOptions(r){if(r.length===0){return a.red("No matches for this query.")}let{startIndex:i,endIndex:o}=m(this.cursor,r.length,this.optionsPerPage);let l,u=[];for(let a=i;a<o;a++){if(a===i&&i>0){l=h.arrowUp}else if(a===o-1&&o<r.length){l=h.arrowDown}else{l=" "}u.push(this.renderOption(this.cursor,r[a],a,l))}return"\n"+u.join("\n")}renderOptions(r){if(!this.done){return this.paginateOptions(r)}return""}renderDoneOrInstructions(){if(this.done){return this.value.filter((r=>r.selected)).map((r=>r.title)).join(", ")}const r=[a.gray(this.hint),this.renderInstructions()];if(this.value[this.cursor].disabled){r.push(a.yellow(this.warn))}return r.join(" ")}render(){if(this.closed)return;if(this.firstRender)this.out.write(l.hide);super.render();let r=[d.symbol(this.done,this.aborted),a.bold(this.msg),d.delimiter(false),this.renderDoneOrInstructions()].join(" ");if(this.showMinError){r+=a.red(`You must select a minimum of ${this.minSelected} choices.`);this.showMinError=false}r+=this.renderOptions(this.value);this.out.write(this.clear+r);this.clear=c(r,this.out.columns)}}r.exports=MultiselectPrompt},3686:(r,i,o)=>{const a=o(9439);const l=o(9126);const{cursor:u,erase:c}=o(332);const{style:h,figures:d,clear:p,lines:m}=o(9807);const g=/[0-9]/;const isDef=r=>r!==undefined;const round=(r,i)=>{let o=Math.pow(10,i);return Math.round(r*o)/o};class NumberPrompt extends l{constructor(r={}){super(r);this.transform=h.render(r.style);this.msg=r.message;this.initial=isDef(r.initial)?r.initial:"";this.float=!!r.float;this.round=r.round||2;this.inc=r.increment||1;this.min=isDef(r.min)?r.min:-Infinity;this.max=isDef(r.max)?r.max:Infinity;this.errorMsg=r.error||`Please Enter A Valid Value`;this.validator=r.validate||(()=>true);this.color=`cyan`;this.value=``;this.typed=``;this.lastHit=0;this.render()}set value(r){if(!r&&r!==0){this.placeholder=true;this.rendered=a.gray(this.transform.render(`${this.initial}`));this._value=``}else{this.placeholder=false;this.rendered=this.transform.render(`${round(r,this.round)}`);this._value=round(r,this.round)}this.fire()}get value(){return this._value}parse(r){return this.float?parseFloat(r):parseInt(r)}valid(r){return r===`-`||r===`.`&&this.float||g.test(r)}reset(){this.typed=``;this.value=``;this.fire();this.render()}exit(){this.abort()}abort(){let r=this.value;this.value=r!==``?r:this.initial;this.done=this.aborted=true;this.error=false;this.fire();this.render();this.out.write(`\n`);this.close()}async validate(){let r=await this.validator(this.value);if(typeof r===`string`){this.errorMsg=r;r=false}this.error=!r}async submit(){await this.validate();if(this.error){this.color=`red`;this.fire();this.render();return}let r=this.value;this.value=r!==``?r:this.initial;this.done=true;this.aborted=false;this.error=false;this.fire();this.render();this.out.write(`\n`);this.close()}up(){this.typed=``;if(this.value===""){this.value=this.min-this.inc}if(this.value>=this.max)return this.bell();this.value+=this.inc;this.color=`cyan`;this.fire();this.render()}down(){this.typed=``;if(this.value===""){this.value=this.min+this.inc}if(this.value<=this.min)return this.bell();this.value-=this.inc;this.color=`cyan`;this.fire();this.render()}delete(){let r=this.value.toString();if(r.length===0)return this.bell();this.value=this.parse(r=r.slice(0,-1))||``;if(this.value!==""&&this.value<this.min){this.value=this.min}this.color=`cyan`;this.fire();this.render()}next(){this.value=this.initial;this.fire();this.render()}_(r,i){if(!this.valid(r))return this.bell();const o=Date.now();if(o-this.lastHit>1e3)this.typed=``;this.typed+=r;this.lastHit=o;this.color=`cyan`;if(r===`.`)return this.fire();this.value=Math.min(this.parse(this.typed),this.max);if(this.value>this.max)this.value=this.max;if(this.value<this.min)this.value=this.min;this.fire();this.render()}render(){if(this.closed)return;if(!this.firstRender){if(this.outputError)this.out.write(u.down(m(this.outputError,this.out.columns)-1)+p(this.outputError,this.out.columns));this.out.write(p(this.outputText,this.out.columns))}super.render();this.outputError="";this.outputText=[h.symbol(this.done,this.aborted),a.bold(this.msg),h.delimiter(this.done),!this.done||!this.done&&!this.placeholder?a[this.color]().underline(this.rendered):this.rendered].join(` `);if(this.error){this.outputError+=this.errorMsg.split(`\n`).reduce(((r,i,o)=>r+`\n${o?` `:d.pointerSmall} ${a.red().italic(i)}`),``)}this.out.write(c.line+u.to(0)+this.outputText+u.save+this.outputError+u.restore)}}r.exports=NumberPrompt},9126:(r,i,o)=>{"use strict";const a=o(4521);const{action:l}=o(9807);const u=o(2361);const{beep:c,cursor:h}=o(332);const d=o(9439);class Prompt extends u{constructor(r={}){super();this.firstRender=true;this.in=r.stdin||process.stdin;this.out=r.stdout||process.stdout;this.onRender=(r.onRender||(()=>void 0)).bind(this);const i=a.createInterface({input:this.in,escapeCodeTimeout:50});a.emitKeypressEvents(this.in,i);if(this.in.isTTY)this.in.setRawMode(true);const o=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1;const keypress=(r,i)=>{let a=l(i,o);if(a===false){this._&&this._(r,i)}else if(typeof this[a]==="function"){this[a](i)}else{this.bell()}};this.close=()=>{this.out.write(h.show);this.in.removeListener("keypress",keypress);if(this.in.isTTY)this.in.setRawMode(false);i.close();this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value);this.closed=true};this.in.on("keypress",keypress)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(c)}render(){this.onRender(d);if(this.firstRender)this.firstRender=false}}r.exports=Prompt},6515:(r,i,o)=>{"use strict";const a=o(9439);const l=o(9126);const{style:u,clear:c,figures:h,wrap:d,entriesToDisplay:p}=o(9807);const{cursor:m}=o(332);class SelectPrompt extends l{constructor(r={}){super(r);this.msg=r.message;this.hint=r.hint||"- Use arrow-keys. Return to submit.";this.warn=r.warn||"- This option is disabled";this.cursor=r.initial||0;this.choices=r.choices.map(((r,i)=>{if(typeof r==="string")r={title:r,value:i};return{title:r&&(r.title||r.value||r),value:r&&(r.value===undefined?i:r.value),description:r&&r.description,selected:r&&r.selected,disabled:r&&r.disabled}}));this.optionsPerPage=r.optionsPerPage||10;this.value=(this.choices[this.cursor]||{}).value;this.clear=c("",this.out.columns);this.render()}moveCursor(r){this.cursor=r;this.value=this.choices[r].value;this.fire()}reset(){this.moveCursor(0);this.fire();this.render()}exit(){this.abort()}abort(){this.done=this.aborted=true;this.fire();this.render();this.out.write("\n");this.close()}submit(){if(!this.selection.disabled){this.done=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}else this.bell()}first(){this.moveCursor(0);this.render()}last(){this.moveCursor(this.choices.length-1);this.render()}up(){if(this.cursor===0){this.moveCursor(this.choices.length-1)}else{this.moveCursor(this.cursor-1)}this.render()}down(){if(this.cursor===this.choices.length-1){this.moveCursor(0)}else{this.moveCursor(this.cursor+1)}this.render()}next(){this.moveCursor((this.cursor+1)%this.choices.length);this.render()}_(r,i){if(r===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;if(this.firstRender)this.out.write(m.hide);else this.out.write(c(this.outputText,this.out.columns));super.render();let{startIndex:r,endIndex:i}=p(this.cursor,this.choices.length,this.optionsPerPage);this.outputText=[u.symbol(this.done,this.aborted),a.bold(this.msg),u.delimiter(false),this.done?this.selection.title:this.selection.disabled?a.yellow(this.warn):a.gray(this.hint)].join(" ");if(!this.done){this.outputText+="\n";for(let o=r;o<i;o++){let l,u,c="",p=this.choices[o];if(o===r&&r>0){u=h.arrowUp}else if(o===i-1&&i<this.choices.length){u=h.arrowDown}else{u=" "}if(p.disabled){l=this.cursor===o?a.gray().underline(p.title):a.strikethrough().gray(p.title);u=(this.cursor===o?a.bold().gray(h.pointer)+" ":" ")+u}else{l=this.cursor===o?a.cyan().underline(p.title):p.title;u=(this.cursor===o?a.cyan(h.pointer)+" ":" ")+u;if(p.description&&this.cursor===o){c=` - ${p.description}`;if(u.length+l.length+c.length>=this.out.columns||p.description.split(/\r?\n/).length>1){c="\n"+d(p.description,{margin:3,width:this.out.columns})}}}this.outputText+=`${u} ${l}${a.gray(c)}\n`}}this.out.write(this.outputText)}}r.exports=SelectPrompt},1551:(r,i,o)=>{const a=o(9439);const l=o(9126);const{erase:u,cursor:c}=o(332);const{style:h,clear:d,lines:p,figures:m}=o(9807);class TextPrompt extends l{constructor(r={}){super(r);this.transform=h.render(r.style);this.scale=this.transform.scale;this.msg=r.message;this.initial=r.initial||``;this.validator=r.validate||(()=>true);this.value=``;this.errorMsg=r.error||`Please Enter A Valid Value`;this.cursor=Number(!!this.initial);this.cursorOffset=0;this.clear=d(``,this.out.columns);this.render()}set value(r){if(!r&&this.initial){this.placeholder=true;this.rendered=a.gray(this.transform.render(this.initial))}else{this.placeholder=false;this.rendered=this.transform.render(r)}this._value=r;this.fire()}get value(){return this._value}reset(){this.value=``;this.cursor=Number(!!this.initial);this.cursorOffset=0;this.fire();this.render()}exit(){this.abort()}abort(){this.value=this.value||this.initial;this.done=this.aborted=true;this.error=false;this.red=false;this.fire();this.render();this.out.write("\n");this.close()}async validate(){let r=await this.validator(this.value);if(typeof r===`string`){this.errorMsg=r;r=false}this.error=!r}async submit(){this.value=this.value||this.initial;this.cursorOffset=0;this.cursor=this.rendered.length;await this.validate();if(this.error){this.red=true;this.fire();this.render();return}this.done=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}next(){if(!this.placeholder)return this.bell();this.value=this.initial;this.cursor=this.rendered.length;this.fire();this.render()}moveCursor(r){if(this.placeholder)return;this.cursor=this.cursor+r;this.cursorOffset+=r}_(r,i){let o=this.value.slice(0,this.cursor);let a=this.value.slice(this.cursor);this.value=`${o}${r}${a}`;this.red=false;this.cursor=this.placeholder?0:o.length+1;this.render()}delete(){if(this.isCursorAtStart())return this.bell();let r=this.value.slice(0,this.cursor-1);let i=this.value.slice(this.cursor);this.value=`${r}${i}`;this.red=false;if(this.isCursorAtStart()){this.cursorOffset=0}else{this.cursorOffset++;this.moveCursor(-1)}this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let r=this.value.slice(0,this.cursor);let i=this.value.slice(this.cursor+1);this.value=`${r}${i}`;this.red=false;if(this.isCursorAtEnd()){this.cursorOffset=0}else{this.cursorOffset++}this.render()}first(){this.cursor=0;this.render()}last(){this.cursor=this.value.length;this.render()}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1);this.render()}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1);this.render()}isCursorAtStart(){return this.cursor===0||this.placeholder&&this.cursor===1}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){if(this.closed)return;if(!this.firstRender){if(this.outputError)this.out.write(c.down(p(this.outputError,this.out.columns)-1)+d(this.outputError,this.out.columns));this.out.write(d(this.outputText,this.out.columns))}super.render();this.outputError="";this.outputText=[h.symbol(this.done,this.aborted),a.bold(this.msg),h.delimiter(this.done),this.red?a.red(this.rendered):this.rendered].join(` `);if(this.error){this.outputError+=this.errorMsg.split(`\n`).reduce(((r,i,o)=>r+`\n${o?" ":m.pointerSmall} ${a.red().italic(i)}`),``)}this.out.write(u.line+c.to(0)+this.outputText+c.save+this.outputError+c.restore+c.move(this.cursorOffset,0))}}r.exports=TextPrompt},181:(r,i,o)=>{const a=o(9439);const l=o(9126);const{style:u,clear:c}=o(9807);const{cursor:h,erase:d}=o(332);class TogglePrompt extends l{constructor(r={}){super(r);this.msg=r.message;this.value=!!r.initial;this.active=r.active||"on";this.inactive=r.inactive||"off";this.initialValue=this.value;this.render()}reset(){this.value=this.initialValue;this.fire();this.render()}exit(){this.abort()}abort(){this.done=this.aborted=true;this.fire();this.render();this.out.write("\n");this.close()}submit(){this.done=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}deactivate(){if(this.value===false)return this.bell();this.value=false;this.render()}activate(){if(this.value===true)return this.bell();this.value=true;this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value;this.fire();this.render()}_(r,i){if(r===" "){this.value=!this.value}else if(r==="1"){this.value=true}else if(r==="0"){this.value=false}else return this.bell();this.render()}render(){if(this.closed)return;if(this.firstRender)this.out.write(h.hide);else this.out.write(c(this.outputText,this.out.columns));super.render();this.outputText=[u.symbol(this.done,this.aborted),a.bold(this.msg),u.delimiter(this.done),this.value?this.inactive:a.cyan().underline(this.inactive),a.gray("/"),this.value?a.cyan().underline(this.active):this.active].join(" ");this.out.write(d.line+h.to(0)+this.outputText)}}r.exports=TogglePrompt},9590:(r,i,o)=>{"use strict";const a=o(4450);const l=["suggest","format","onState","validate","onRender","type"];const noop=()=>{};async function prompt(r=[],{onSubmit:i=noop,onCancel:o=noop}={}){const u={};const c=prompt._override||{};r=[].concat(r);let h,d,p,m,g,y;const getFormattedAnswer=async(r,i,o=false)=>{if(!o&&r.validate&&r.validate(i)!==true){return}return r.format?await r.format(i,u):i};for(d of r){({name:m,type:g}=d);if(typeof g==="function"){g=await g(h,{...u},d);d["type"]=g}if(!g)continue;for(let r in d){if(l.includes(r))continue;let i=d[r];d[r]=typeof i==="function"?await i(h,{...u},y):i}y=d;if(typeof d.message!=="string"){throw new Error("prompt message is required")}({name:m,type:g}=d);if(a[g]===void 0){throw new Error(`prompt type (${g}) is not defined`)}if(c[d.name]!==undefined){h=await getFormattedAnswer(d,c[d.name]);if(h!==undefined){u[m]=h;continue}}try{h=prompt._injected?getInjectedAnswer(prompt._injected,d.initial):await a[g](d);u[m]=h=await getFormattedAnswer(d,h,true);p=await i(d,h,u)}catch(r){p=!await o(d,u)}if(p)return u}return u}function getInjectedAnswer(r,i){const o=r.shift();if(o instanceof Error){throw o}return o===undefined?i:o}function inject(r){prompt._injected=(prompt._injected||[]).concat(r)}function override(r){prompt._override=Object.assign({},r)}r.exports=Object.assign(prompt,{prompt:prompt,prompts:a,inject:inject,override:override})},4450:(r,i,o)=>{"use strict";const a=i;const l=o(6529);const noop=r=>r;function toPrompt(r,i,o={}){return new Promise(((a,u)=>{const c=new l[r](i);const h=o.onAbort||noop;const d=o.onSubmit||noop;const p=o.onExit||noop;c.on("state",i.onState||noop);c.on("submit",(r=>a(d(r))));c.on("exit",(r=>a(p(r))));c.on("abort",(r=>u(h(r))))}))}a.text=r=>toPrompt("TextPrompt",r);a.password=r=>{r.style="password";return a.text(r)};a.invisible=r=>{r.style="invisible";return a.text(r)};a.number=r=>toPrompt("NumberPrompt",r);a.date=r=>toPrompt("DatePrompt",r);a.confirm=r=>toPrompt("ConfirmPrompt",r);a.list=r=>{const i=r.separator||",";return toPrompt("TextPrompt",r,{onSubmit:r=>r.split(i).map((r=>r.trim()))})};a.toggle=r=>toPrompt("TogglePrompt",r);a.select=r=>toPrompt("SelectPrompt",r);a.multiselect=r=>{r.choices=[].concat(r.choices||[]);const toSelected=r=>r.filter((r=>r.selected)).map((r=>r.value));return toPrompt("MultiselectPrompt",r,{onAbort:toSelected,onSubmit:toSelected})};a.autocompleteMultiselect=r=>{r.choices=[].concat(r.choices||[]);const toSelected=r=>r.filter((r=>r.selected)).map((r=>r.value));return toPrompt("AutocompleteMultiselectPrompt",r,{onAbort:toSelected,onSubmit:toSelected})};const byTitle=(r,i)=>Promise.resolve(i.filter((i=>i.title.slice(0,r.length).toLowerCase()===r.toLowerCase())));a.autocomplete=r=>{r.suggest=r.suggest||byTitle;r.choices=[].concat(r.choices||[]);return toPrompt("AutocompletePrompt",r)}},8573:r=>{"use strict";r.exports=(r,i)=>{if(r.meta&&r.name!=="escape")return;if(r.ctrl){if(r.name==="a")return"first";if(r.name==="c")return"abort";if(r.name==="d")return"abort";if(r.name==="e")return"last";if(r.name==="g")return"reset"}if(i){if(r.name==="j")return"down";if(r.name==="k")return"up"}if(r.name==="return")return"submit";if(r.name==="enter")return"submit";if(r.name==="backspace")return"delete";if(r.name==="delete")return"deleteForward";if(r.name==="abort")return"abort";if(r.name==="escape")return"exit";if(r.name==="tab")return"next";if(r.name==="pagedown")return"nextPage";if(r.name==="pageup")return"prevPage";if(r.name==="home")return"home";if(r.name==="end")return"end";if(r.name==="up")return"up";if(r.name==="down")return"down";if(r.name==="right")return"right";if(r.name==="left")return"left";return false}},6747:(r,i,o)=>{"use strict";const a=o(2714);const{erase:l,cursor:u}=o(332);const width=r=>[...a(r)].length;r.exports=function(r,i){if(!i)return l.line+u.to(0);let o=0;const a=r.split(/\r?\n/);for(let r of a){o+=1+Math.floor(Math.max(width(r)-1,0)/i)}return l.lines(o)}},3297:r=>{"use strict";r.exports=(r,i,o)=>{o=o||i;let a=Math.min(i-o,r-Math.floor(o/2));if(a<0)a=0;let l=Math.min(a+o,i);return{startIndex:a,endIndex:l}}},3034:r=>{"use strict";const i={arrowUp:"↑",arrowDown:"↓",arrowLeft:"←",arrowRight:"→",radioOn:"◉",radioOff:"◯",tick:"✔",cross:"✖",ellipsis:"…",pointerSmall:"›",line:"─",pointer:"❯"};const o={arrowUp:i.arrowUp,arrowDown:i.arrowDown,arrowLeft:i.arrowLeft,arrowRight:i.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"√",cross:"×",ellipsis:"...",pointerSmall:"»",line:"─",pointer:">"};const a=process.platform==="win32"?o:i;r.exports=a},9807:(r,i,o)=>{"use strict";r.exports={action:o(8573),clear:o(6747),style:o(7357),strip:o(2714),figures:o(3034),lines:o(4413),wrap:o(2492),entriesToDisplay:o(3297)}},4413:(r,i,o)=>{"use strict";const a=o(2714);r.exports=function(r,i){let o=String(a(r)||"").split(/\r?\n/);if(!i)return o.length;return o.map((r=>Math.ceil(r.length/i))).reduce(((r,i)=>r+i))}},2714:r=>{"use strict";r.exports=r=>{const i=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|");const o=new RegExp(i,"g");return typeof r==="string"?r.replace(o,""):r}},7357:(r,i,o)=>{"use strict";const a=o(9439);const l=o(3034);const u=Object.freeze({password:{scale:1,render:r=>"*".repeat(r.length)},emoji:{scale:2,render:r=>"😃".repeat(r.length)},invisible:{scale:0,render:r=>""},default:{scale:1,render:r=>`${r}`}});const render=r=>u[r]||u.default;const c=Object.freeze({aborted:a.red(l.cross),done:a.green(l.tick),exited:a.yellow(l.cross),default:a.cyan("?")});const symbol=(r,i,o)=>i?c.aborted:o?c.exited:r?c.done:c.default;const delimiter=r=>a.gray(r?l.ellipsis:l.pointerSmall);const item=(r,i)=>a.gray(r?i?l.pointerSmall:"+":l.line);r.exports={styles:u,render:render,symbols:c,symbol:symbol,delimiter:delimiter,item:item}},2492:r=>{"use strict";r.exports=(r,i={})=>{const o=Number.isSafeInteger(parseInt(i.margin))?new Array(parseInt(i.margin)).fill(" ").join(""):i.margin||"";const a=i.width;return(r||"").split(/\r?\n/g).map((r=>r.split(/\s+/g).reduce(((r,i)=>{if(i.length+o.length>=a||r[r.length-1].length+i.length+1<a)r[r.length-1]+=` ${i}`;else r.push(`${o}${i}`);return r}),[o]).join("\n"))).join("\n")}},8271:(r,i,o)=>{var a=o(7563);var l=o(1017).join;var u=o(5134);var c="/etc";var h=process.platform==="win32";var d=h?process.env.USERPROFILE:process.env.HOME;r.exports=function(r,i,p,m){if("string"!==typeof r)throw new Error("rc(name): name *must* be string");if(!p)p=o(5912)(process.argv.slice(2));i=("string"===typeof i?a.json(i):i)||{};m=m||a.parse;var g=a.env(r+"_");var y=[i];var v=[];function addConfigFile(r){if(v.indexOf(r)>=0)return;var i=a.file(r);if(i){y.push(m(i));v.push(r)}}if(!h)[l(c,r,"config"),l(c,r+"rc")].forEach(addConfigFile);if(d)[l(d,".config",r,"config"),l(d,".config",r),l(d,"."+r,"config"),l(d,"."+r+"rc")].forEach(addConfigFile);addConfigFile(a.find("."+r+"rc"));if(g.config)addConfigFile(g.config);if(p.config)addConfigFile(p.config);return u.apply(null,y.concat([g,p,v.length?{configs:v,config:v[v.length-1]}:undefined]))}},7563:(r,i,o)=>{"use strict";var a=o(7147);var l=o(1923);var u=o(1017);var c=o(6397);var h=i.parse=function(r){if(/^\s*{/.test(r))return JSON.parse(c(r));return l.parse(r)};var d=i.file=function(){var r=[].slice.call(arguments).filter((function(r){return r!=null}));for(var i in r)if("string"!==typeof r[i])return;var o=u.join.apply(null,r);var l;try{return a.readFileSync(o,"utf-8")}catch(r){return}};var p=i.json=function(){var r=d.apply(null,arguments);return r?h(r):null};var m=i.env=function(r,i){i=i||process.env;var o={};var a=r.length;for(var l in i){if(l.toLowerCase().indexOf(r.toLowerCase())===0){var u=l.substring(a).split("__");var c;while((c=u.indexOf(""))>-1){u.splice(c,1)}var h=o;u.forEach((function _buildSubObj(r,o){if(!r||typeof h!=="object")return;if(o===u.length-1)h[r]=i[l];if(h[r]===undefined)h[r]={};h=h[r]}))}}return o};var g=i.find=function(){var r=u.join.apply(null,[].slice.call(arguments));function find(r,i){var o=u.join(r,i);try{a.statSync(o);return o}catch(o){if(u.dirname(r)!==r)return find(u.dirname(r),i)}}return find(process.cwd(),r)}},6397:r=>{"use strict";var i=1;var o=2;function stripWithoutWhitespace(){return""}function stripWithWhitespace(r,i,o){return r.slice(i,o).replace(/\S/g," ")}r.exports=function(r,a){a=a||{};var l;var u;var c=false;var h=false;var d=0;var p="";var m=a.whitespace===false?stripWithoutWhitespace:stripWithWhitespace;for(var g=0;g<r.length;g++){l=r[g];u=r[g+1];if(!h&&l==='"'){var y=r[g-1]==="\\"&&r[g-2]!=="\\";if(!y){c=!c}}if(c){continue}if(!h&&l+u==="//"){p+=r.slice(d,g);d=g;h=i;g++}else if(h===i&&l+u==="\r\n"){g++;h=false;p+=m(r,d,g);d=g;continue}else if(h===i&&l==="\n"){h=false;p+=m(r,d,g);d=g}else if(!h&&l+u==="/*"){p+=r.slice(d,g);d=g;h=o;g++;continue}else if(h===o&&l+u==="*/"){g++;h=false;p+=m(r,d,g+1);d=g+1;continue}}return p+(h?m(r.substr(d)):r.substr(d))}},4955:(r,i,o)=>{const a=o(3118).Buffer;function decodeBase64(r){return a.from(r,"base64").toString("utf8")}function encodeBase64(r){return a.from(r,"utf8").toString("base64")}r.exports={decodeBase64:decodeBase64,encodeBase64:encodeBase64}},1384:(r,i,o)=>{var a=o(7310);var l=o(4955);var u=l.decodeBase64;var c=l.encodeBase64;var h=":_authToken";var d=":username";var p=":_password";r.exports=function(){var r;var i;if(arguments.length>=2){r=arguments[0];i=arguments[1]}else if(typeof arguments[0]==="string"){r=arguments[0]}else{i=arguments[0]}i=i||{};i.npmrc=i.npmrc||o(8271)("npm",{registry:"https://registry.npmjs.org/"});r=r||i.npmrc.registry;return getRegistryAuthInfo(r,i)||getLegacyAuthInfo(i.npmrc)};function getRegistryAuthInfo(r,i){var o=a.parse(r,false,true);var l;while(l!=="/"&&o.pathname!==l){l=o.pathname||"/";var u="//"+o.host+l.replace(/\/$/,"");var c=getAuthInfoForUrl(u,i.npmrc);if(c){return c}if(!i.recursive){return/\/$/.test(r)?undefined:getRegistryAuthInfo(a.resolve(r,"."),i)}o.pathname=a.resolve(normalizePath(l),"..")||"/"}return undefined}function getLegacyAuthInfo(r){if(r._auth){return{token:r._auth,type:"Basic"}}return undefined}function normalizePath(r){return r[r.length-1]==="/"?r:r+"/"}function getAuthInfoForUrl(r,i){var o=getBearerToken(i[r+h]||i[r+"/"+h]);if(o){return o}var a=i[r+d]||i[r+"/"+d];var l=i[r+p]||i[r+"/"+p];var u=getTokenForUsernameAndPassword(a,l);if(u){return u}return undefined}function getBearerToken(r){if(!r){return undefined}var i=r.replace(/^\$\{?([^}]*)\}?$/,(function(r,i){return process.env[i]}));return{token:i,type:"Bearer"}}function getTokenForUsernameAndPassword(r,i){if(!r||!i){return undefined}var o=u(i.replace(/^\$\{?([^}]*)\}?$/,(function(r,i){return process.env[i]})));var a=c(r+":"+o);return{token:a,type:"Basic",password:o,username:r}}},2447:(r,i,o)=>{"use strict";r.exports=function(r){var i=o(8271)("npm",{registry:"https://registry.npmjs.org/"});var a=i[r+":registry"]||i.registry;return a.slice(-1)==="/"?a:a+"/"}},3118:(r,i,o)=>{
|
|
28
28
|
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
29
29
|
var a=o(4300);var l=a.Buffer;function copyProps(r,i){for(var o in r){i[o]=r[o]}}if(l.from&&l.alloc&&l.allocUnsafe&&l.allocUnsafeSlow){r.exports=a}else{copyProps(a,i);i.Buffer=SafeBuffer}function SafeBuffer(r,i,o){return l(r,i,o)}SafeBuffer.prototype=Object.create(l.prototype);copyProps(l,SafeBuffer);SafeBuffer.from=function(r,i,o){if(typeof r==="number"){throw new TypeError("Argument must not be a number")}return l(r,i,o)};SafeBuffer.alloc=function(r,i,o){if(typeof r!=="number"){throw new TypeError("Argument must be a number")}var a=l(r);if(i!==undefined){if(typeof o==="string"){a.fill(i,o)}else{a.fill(i)}}else{a.fill(0)}return a};SafeBuffer.allocUnsafe=function(r){if(typeof r!=="number"){throw new TypeError("Argument must be a number")}return l(r)};SafeBuffer.allocUnsafeSlow=function(r){if(typeof r!=="number"){throw new TypeError("Argument must be a number")}return a.SlowBuffer(r)}},9746:(r,i,o)=>{(function(r){r.parser=function(r,i){return new SAXParser(r,i)};r.SAXParser=SAXParser;r.SAXStream=SAXStream;r.createStream=createStream;r.MAX_BUFFER_LENGTH=64*1024;var i=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];r.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"];function SAXParser(i,o){if(!(this instanceof SAXParser)){return new SAXParser(i,o)}var a=this;clearBuffers(a);a.q=a.c="";a.bufferCheckPosition=r.MAX_BUFFER_LENGTH;a.opt=o||{};a.opt.lowercase=a.opt.lowercase||a.opt.lowercasetags;a.looseCase=a.opt.lowercase?"toLowerCase":"toUpperCase";a.tags=[];a.closed=a.closedRoot=a.sawRoot=false;a.tag=a.error=null;a.strict=!!i;a.noscript=!!(i||a.opt.noscript);a.state=b.BEGIN;a.strictEntities=a.opt.strictEntities;a.ENTITIES=a.strictEntities?Object.create(r.XML_ENTITIES):Object.create(r.ENTITIES);a.attribList=[];if(a.opt.xmlns){a.ns=Object.create(p)}a.trackPosition=a.opt.position!==false;if(a.trackPosition){a.position=a.line=a.column=0}emit(a,"onready")}if(!Object.create){Object.create=function(r){function F(){}F.prototype=r;var i=new F;return i}}if(!Object.keys){Object.keys=function(r){var i=[];for(var o in r)if(r.hasOwnProperty(o))i.push(o);return i}}function checkBufferLength(o){var a=Math.max(r.MAX_BUFFER_LENGTH,10);var l=0;for(var u=0,c=i.length;u<c;u++){var h=o[i[u]].length;if(h>a){switch(i[u]){case"textNode":closeText(o);break;case"cdata":emitNode(o,"oncdata",o.cdata);o.cdata="";break;case"script":emitNode(o,"onscript",o.script);o.script="";break;default:error(o,"Max buffer length exceeded: "+i[u])}}l=Math.max(l,h)}var d=r.MAX_BUFFER_LENGTH-l;o.bufferCheckPosition=d+o.position}function clearBuffers(r){for(var o=0,a=i.length;o<a;o++){r[i[o]]=""}}function flushBuffers(r){closeText(r);if(r.cdata!==""){emitNode(r,"oncdata",r.cdata);r.cdata=""}if(r.script!==""){emitNode(r,"onscript",r.script);r.script=""}}SAXParser.prototype={end:function(){end(this)},write:write,resume:function(){this.error=null;return this},close:function(){return this.write(null)},flush:function(){flushBuffers(this)}};var a;try{a=o(2781).Stream}catch(r){a=function(){}}var l=r.EVENTS.filter((function(r){return r!=="error"&&r!=="end"}));function createStream(r,i){return new SAXStream(r,i)}function SAXStream(r,i){if(!(this instanceof SAXStream)){return new SAXStream(r,i)}a.apply(this);this._parser=new SAXParser(r,i);this.writable=true;this.readable=true;var o=this;this._parser.onend=function(){o.emit("end")};this._parser.onerror=function(r){o.emit("error",r);o._parser.error=null};this._decoder=null;l.forEach((function(r){Object.defineProperty(o,"on"+r,{get:function(){return o._parser["on"+r]},set:function(i){if(!i){o.removeAllListeners(r);o._parser["on"+r]=i;return i}o.on(r,i)},enumerable:true,configurable:false})}))}SAXStream.prototype=Object.create(a.prototype,{constructor:{value:SAXStream}});SAXStream.prototype.write=function(r){if(typeof Buffer==="function"&&typeof Buffer.isBuffer==="function"&&Buffer.isBuffer(r)){if(!this._decoder){var i=o(1576).StringDecoder;this._decoder=new i("utf8")}r=this._decoder.write(r)}this._parser.write(r.toString());this.emit("data",r);return true};SAXStream.prototype.end=function(r){if(r&&r.length){this.write(r)}this._parser.end();return true};SAXStream.prototype.on=function(r,i){var o=this;if(!o._parser["on"+r]&&l.indexOf(r)!==-1){o._parser["on"+r]=function(){var i=arguments.length===1?[arguments[0]]:Array.apply(null,arguments);i.splice(0,0,r);o.emit.apply(o,i)}}return a.prototype.on.call(o,r,i)};var u="[CDATA[";var c="DOCTYPE";var h="http://www.w3.org/XML/1998/namespace";var d="http://www.w3.org/2000/xmlns/";var p={xml:h,xmlns:d};var m=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/;var g=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;var y=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/;var v=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;function isWhitespace(r){return r===" "||r==="\n"||r==="\r"||r==="\t"}function isQuote(r){return r==='"'||r==="'"}function isAttribEnd(r){return r===">"||isWhitespace(r)}function isMatch(r,i){return r.test(i)}function notMatch(r,i){return!isMatch(r,i)}var b=0;r.STATE={BEGIN:b++,BEGIN_WHITESPACE:b++,TEXT:b++,TEXT_ENTITY:b++,OPEN_WAKA:b++,SGML_DECL:b++,SGML_DECL_QUOTED:b++,DOCTYPE:b++,DOCTYPE_QUOTED:b++,DOCTYPE_DTD:b++,DOCTYPE_DTD_QUOTED:b++,COMMENT_STARTING:b++,COMMENT:b++,COMMENT_ENDING:b++,COMMENT_ENDED:b++,CDATA:b++,CDATA_ENDING:b++,CDATA_ENDING_2:b++,PROC_INST:b++,PROC_INST_BODY:b++,PROC_INST_ENDING:b++,OPEN_TAG:b++,OPEN_TAG_SLASH:b++,ATTRIB:b++,ATTRIB_NAME:b++,ATTRIB_NAME_SAW_WHITE:b++,ATTRIB_VALUE:b++,ATTRIB_VALUE_QUOTED:b++,ATTRIB_VALUE_CLOSED:b++,ATTRIB_VALUE_UNQUOTED:b++,ATTRIB_VALUE_ENTITY_Q:b++,ATTRIB_VALUE_ENTITY_U:b++,CLOSE_TAG:b++,CLOSE_TAG_SAW_WHITE:b++,SCRIPT:b++,SCRIPT_ENDING:b++};r.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"};r.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830};Object.keys(r.ENTITIES).forEach((function(i){var o=r.ENTITIES[i];var a=typeof o==="number"?String.fromCharCode(o):o;r.ENTITIES[i]=a}));for(var w in r.STATE){r.STATE[r.STATE[w]]=w}b=r.STATE;function emit(r,i,o){r[i]&&r[i](o)}function emitNode(r,i,o){if(r.textNode)closeText(r);emit(r,i,o)}function closeText(r){r.textNode=textopts(r.opt,r.textNode);if(r.textNode)emit(r,"ontext",r.textNode);r.textNode=""}function textopts(r,i){if(r.trim)i=i.trim();if(r.normalize)i=i.replace(/\s+/g," ");return i}function error(r,i){closeText(r);if(r.trackPosition){i+="\nLine: "+r.line+"\nColumn: "+r.column+"\nChar: "+r.c}i=new Error(i);r.error=i;emit(r,"onerror",i);return r}function end(r){if(r.sawRoot&&!r.closedRoot)strictFail(r,"Unclosed root tag");if(r.state!==b.BEGIN&&r.state!==b.BEGIN_WHITESPACE&&r.state!==b.TEXT){error(r,"Unexpected end")}closeText(r);r.c="";r.closed=true;emit(r,"onend");SAXParser.call(r,r.strict,r.opt);return r}function strictFail(r,i){if(typeof r!=="object"||!(r instanceof SAXParser)){throw new Error("bad call to strictFail")}if(r.strict){error(r,i)}}function newTag(r){if(!r.strict)r.tagName=r.tagName[r.looseCase]();var i=r.tags[r.tags.length-1]||r;var o=r.tag={name:r.tagName,attributes:{}};if(r.opt.xmlns){o.ns=i.ns}r.attribList.length=0;emitNode(r,"onopentagstart",o)}function qname(r,i){var o=r.indexOf(":");var a=o<0?["",r]:r.split(":");var l=a[0];var u=a[1];if(i&&r==="xmlns"){l="xmlns";u=""}return{prefix:l,local:u}}function attrib(r){if(!r.strict){r.attribName=r.attribName[r.looseCase]()}if(r.attribList.indexOf(r.attribName)!==-1||r.tag.attributes.hasOwnProperty(r.attribName)){r.attribName=r.attribValue="";return}if(r.opt.xmlns){var i=qname(r.attribName,true);var o=i.prefix;var a=i.local;if(o==="xmlns"){if(a==="xml"&&r.attribValue!==h){strictFail(r,"xml: prefix must be bound to "+h+"\n"+"Actual: "+r.attribValue)}else if(a==="xmlns"&&r.attribValue!==d){strictFail(r,"xmlns: prefix must be bound to "+d+"\n"+"Actual: "+r.attribValue)}else{var l=r.tag;var u=r.tags[r.tags.length-1]||r;if(l.ns===u.ns){l.ns=Object.create(u.ns)}l.ns[a]=r.attribValue}}r.attribList.push([r.attribName,r.attribValue])}else{r.tag.attributes[r.attribName]=r.attribValue;emitNode(r,"onattribute",{name:r.attribName,value:r.attribValue})}r.attribName=r.attribValue=""}function openTag(r,i){if(r.opt.xmlns){var o=r.tag;var a=qname(r.tagName);o.prefix=a.prefix;o.local=a.local;o.uri=o.ns[a.prefix]||"";if(o.prefix&&!o.uri){strictFail(r,"Unbound namespace prefix: "+JSON.stringify(r.tagName));o.uri=a.prefix}var l=r.tags[r.tags.length-1]||r;if(o.ns&&l.ns!==o.ns){Object.keys(o.ns).forEach((function(i){emitNode(r,"onopennamespace",{prefix:i,uri:o.ns[i]})}))}for(var u=0,c=r.attribList.length;u<c;u++){var h=r.attribList[u];var d=h[0];var p=h[1];var m=qname(d,true);var g=m.prefix;var y=m.local;var v=g===""?"":o.ns[g]||"";var w={name:d,value:p,prefix:g,local:y,uri:v};if(g&&g!=="xmlns"&&!v){strictFail(r,"Unbound namespace prefix: "+JSON.stringify(g));w.uri=g}r.tag.attributes[d]=w;emitNode(r,"onattribute",w)}r.attribList.length=0}r.tag.isSelfClosing=!!i;r.sawRoot=true;r.tags.push(r.tag);emitNode(r,"onopentag",r.tag);if(!i){if(!r.noscript&&r.tagName.toLowerCase()==="script"){r.state=b.SCRIPT}else{r.state=b.TEXT}r.tag=null;r.tagName=""}r.attribName=r.attribValue="";r.attribList.length=0}function closeTag(r){if(!r.tagName){strictFail(r,"Weird empty close tag.");r.textNode+="</>";r.state=b.TEXT;return}if(r.script){if(r.tagName!=="script"){r.script+="</"+r.tagName+">";r.tagName="";r.state=b.SCRIPT;return}emitNode(r,"onscript",r.script);r.script=""}var i=r.tags.length;var o=r.tagName;if(!r.strict){o=o[r.looseCase]()}var a=o;while(i--){var l=r.tags[i];if(l.name!==a){strictFail(r,"Unexpected close tag")}else{break}}if(i<0){strictFail(r,"Unmatched closing tag: "+r.tagName);r.textNode+="</"+r.tagName+">";r.state=b.TEXT;return}r.tagName=o;var u=r.tags.length;while(u-- >i){var c=r.tag=r.tags.pop();r.tagName=r.tag.name;emitNode(r,"onclosetag",r.tagName);var h={};for(var d in c.ns){h[d]=c.ns[d]}var p=r.tags[r.tags.length-1]||r;if(r.opt.xmlns&&c.ns!==p.ns){Object.keys(c.ns).forEach((function(i){var o=c.ns[i];emitNode(r,"onclosenamespace",{prefix:i,uri:o})}))}}if(i===0)r.closedRoot=true;r.tagName=r.attribValue=r.attribName="";r.attribList.length=0;r.state=b.TEXT}function parseEntity(r){var i=r.entity;var o=i.toLowerCase();var a;var l="";if(r.ENTITIES[i]){return r.ENTITIES[i]}if(r.ENTITIES[o]){return r.ENTITIES[o]}i=o;if(i.charAt(0)==="#"){if(i.charAt(1)==="x"){i=i.slice(2);a=parseInt(i,16);l=a.toString(16)}else{i=i.slice(1);a=parseInt(i,10);l=a.toString(10)}}i=i.replace(/^0+/,"");if(isNaN(a)||l.toLowerCase()!==i){strictFail(r,"Invalid character entity");return"&"+r.entity+";"}return String.fromCodePoint(a)}function beginWhiteSpace(r,i){if(i==="<"){r.state=b.OPEN_WAKA;r.startTagPosition=r.position}else if(!isWhitespace(i)){strictFail(r,"Non-whitespace before first tag.");r.textNode=i;r.state=b.TEXT}}function charAt(r,i){var o="";if(i<r.length){o=r.charAt(i)}return o}function write(r){var i=this;if(this.error){throw this.error}if(i.closed){return error(i,"Cannot write after close. Assign an onready handler.")}if(r===null){return end(i)}if(typeof r==="object"){r=r.toString()}var o=0;var a="";while(true){a=charAt(r,o++);i.c=a;if(!a){break}if(i.trackPosition){i.position++;if(a==="\n"){i.line++;i.column=0}else{i.column++}}switch(i.state){case b.BEGIN:i.state=b.BEGIN_WHITESPACE;if(a==="\ufeff"){continue}beginWhiteSpace(i,a);continue;case b.BEGIN_WHITESPACE:beginWhiteSpace(i,a);continue;case b.TEXT:if(i.sawRoot&&!i.closedRoot){var l=o-1;while(a&&a!=="<"&&a!=="&"){a=charAt(r,o++);if(a&&i.trackPosition){i.position++;if(a==="\n"){i.line++;i.column=0}else{i.column++}}}i.textNode+=r.substring(l,o-1)}if(a==="<"&&!(i.sawRoot&&i.closedRoot&&!i.strict)){i.state=b.OPEN_WAKA;i.startTagPosition=i.position}else{if(!isWhitespace(a)&&(!i.sawRoot||i.closedRoot)){strictFail(i,"Text data outside of root node.")}if(a==="&"){i.state=b.TEXT_ENTITY}else{i.textNode+=a}}continue;case b.SCRIPT:if(a==="<"){i.state=b.SCRIPT_ENDING}else{i.script+=a}continue;case b.SCRIPT_ENDING:if(a==="/"){i.state=b.CLOSE_TAG}else{i.script+="<"+a;i.state=b.SCRIPT}continue;case b.OPEN_WAKA:if(a==="!"){i.state=b.SGML_DECL;i.sgmlDecl=""}else if(isWhitespace(a)){}else if(isMatch(m,a)){i.state=b.OPEN_TAG;i.tagName=a}else if(a==="/"){i.state=b.CLOSE_TAG;i.tagName=""}else if(a==="?"){i.state=b.PROC_INST;i.procInstName=i.procInstBody=""}else{strictFail(i,"Unencoded <");if(i.startTagPosition+1<i.position){var h=i.position-i.startTagPosition;a=new Array(h).join(" ")+a}i.textNode+="<"+a;i.state=b.TEXT}continue;case b.SGML_DECL:if((i.sgmlDecl+a).toUpperCase()===u){emitNode(i,"onopencdata");i.state=b.CDATA;i.sgmlDecl="";i.cdata=""}else if(i.sgmlDecl+a==="--"){i.state=b.COMMENT;i.comment="";i.sgmlDecl=""}else if((i.sgmlDecl+a).toUpperCase()===c){i.state=b.DOCTYPE;if(i.doctype||i.sawRoot){strictFail(i,"Inappropriately located doctype declaration")}i.doctype="";i.sgmlDecl=""}else if(a===">"){emitNode(i,"onsgmldeclaration",i.sgmlDecl);i.sgmlDecl="";i.state=b.TEXT}else if(isQuote(a)){i.state=b.SGML_DECL_QUOTED;i.sgmlDecl+=a}else{i.sgmlDecl+=a}continue;case b.SGML_DECL_QUOTED:if(a===i.q){i.state=b.SGML_DECL;i.q=""}i.sgmlDecl+=a;continue;case b.DOCTYPE:if(a===">"){i.state=b.TEXT;emitNode(i,"ondoctype",i.doctype);i.doctype=true}else{i.doctype+=a;if(a==="["){i.state=b.DOCTYPE_DTD}else if(isQuote(a)){i.state=b.DOCTYPE_QUOTED;i.q=a}}continue;case b.DOCTYPE_QUOTED:i.doctype+=a;if(a===i.q){i.q="";i.state=b.DOCTYPE}continue;case b.DOCTYPE_DTD:i.doctype+=a;if(a==="]"){i.state=b.DOCTYPE}else if(isQuote(a)){i.state=b.DOCTYPE_DTD_QUOTED;i.q=a}continue;case b.DOCTYPE_DTD_QUOTED:i.doctype+=a;if(a===i.q){i.state=b.DOCTYPE_DTD;i.q=""}continue;case b.COMMENT:if(a==="-"){i.state=b.COMMENT_ENDING}else{i.comment+=a}continue;case b.COMMENT_ENDING:if(a==="-"){i.state=b.COMMENT_ENDED;i.comment=textopts(i.opt,i.comment);if(i.comment){emitNode(i,"oncomment",i.comment)}i.comment=""}else{i.comment+="-"+a;i.state=b.COMMENT}continue;case b.COMMENT_ENDED:if(a!==">"){strictFail(i,"Malformed comment");i.comment+="--"+a;i.state=b.COMMENT}else{i.state=b.TEXT}continue;case b.CDATA:if(a==="]"){i.state=b.CDATA_ENDING}else{i.cdata+=a}continue;case b.CDATA_ENDING:if(a==="]"){i.state=b.CDATA_ENDING_2}else{i.cdata+="]"+a;i.state=b.CDATA}continue;case b.CDATA_ENDING_2:if(a===">"){if(i.cdata){emitNode(i,"oncdata",i.cdata)}emitNode(i,"onclosecdata");i.cdata="";i.state=b.TEXT}else if(a==="]"){i.cdata+="]"}else{i.cdata+="]]"+a;i.state=b.CDATA}continue;case b.PROC_INST:if(a==="?"){i.state=b.PROC_INST_ENDING}else if(isWhitespace(a)){i.state=b.PROC_INST_BODY}else{i.procInstName+=a}continue;case b.PROC_INST_BODY:if(!i.procInstBody&&isWhitespace(a)){continue}else if(a==="?"){i.state=b.PROC_INST_ENDING}else{i.procInstBody+=a}continue;case b.PROC_INST_ENDING:if(a===">"){emitNode(i,"onprocessinginstruction",{name:i.procInstName,body:i.procInstBody});i.procInstName=i.procInstBody="";i.state=b.TEXT}else{i.procInstBody+="?"+a;i.state=b.PROC_INST_BODY}continue;case b.OPEN_TAG:if(isMatch(g,a)){i.tagName+=a}else{newTag(i);if(a===">"){openTag(i)}else if(a==="/"){i.state=b.OPEN_TAG_SLASH}else{if(!isWhitespace(a)){strictFail(i,"Invalid character in tag name")}i.state=b.ATTRIB}}continue;case b.OPEN_TAG_SLASH:if(a===">"){openTag(i,true);closeTag(i)}else{strictFail(i,"Forward-slash in opening tag not followed by >");i.state=b.ATTRIB}continue;case b.ATTRIB:if(isWhitespace(a)){continue}else if(a===">"){openTag(i)}else if(a==="/"){i.state=b.OPEN_TAG_SLASH}else if(isMatch(m,a)){i.attribName=a;i.attribValue="";i.state=b.ATTRIB_NAME}else{strictFail(i,"Invalid attribute name")}continue;case b.ATTRIB_NAME:if(a==="="){i.state=b.ATTRIB_VALUE}else if(a===">"){strictFail(i,"Attribute without value");i.attribValue=i.attribName;attrib(i);openTag(i)}else if(isWhitespace(a)){i.state=b.ATTRIB_NAME_SAW_WHITE}else if(isMatch(g,a)){i.attribName+=a}else{strictFail(i,"Invalid attribute name")}continue;case b.ATTRIB_NAME_SAW_WHITE:if(a==="="){i.state=b.ATTRIB_VALUE}else if(isWhitespace(a)){continue}else{strictFail(i,"Attribute without value");i.tag.attributes[i.attribName]="";i.attribValue="";emitNode(i,"onattribute",{name:i.attribName,value:""});i.attribName="";if(a===">"){openTag(i)}else if(isMatch(m,a)){i.attribName=a;i.state=b.ATTRIB_NAME}else{strictFail(i,"Invalid attribute name");i.state=b.ATTRIB}}continue;case b.ATTRIB_VALUE:if(isWhitespace(a)){continue}else if(isQuote(a)){i.q=a;i.state=b.ATTRIB_VALUE_QUOTED}else{strictFail(i,"Unquoted attribute value");i.state=b.ATTRIB_VALUE_UNQUOTED;i.attribValue=a}continue;case b.ATTRIB_VALUE_QUOTED:if(a!==i.q){if(a==="&"){i.state=b.ATTRIB_VALUE_ENTITY_Q}else{i.attribValue+=a}continue}attrib(i);i.q="";i.state=b.ATTRIB_VALUE_CLOSED;continue;case b.ATTRIB_VALUE_CLOSED:if(isWhitespace(a)){i.state=b.ATTRIB}else if(a===">"){openTag(i)}else if(a==="/"){i.state=b.OPEN_TAG_SLASH}else if(isMatch(m,a)){strictFail(i,"No whitespace between attributes");i.attribName=a;i.attribValue="";i.state=b.ATTRIB_NAME}else{strictFail(i,"Invalid attribute name")}continue;case b.ATTRIB_VALUE_UNQUOTED:if(!isAttribEnd(a)){if(a==="&"){i.state=b.ATTRIB_VALUE_ENTITY_U}else{i.attribValue+=a}continue}attrib(i);if(a===">"){openTag(i)}else{i.state=b.ATTRIB}continue;case b.CLOSE_TAG:if(!i.tagName){if(isWhitespace(a)){continue}else if(notMatch(m,a)){if(i.script){i.script+="</"+a;i.state=b.SCRIPT}else{strictFail(i,"Invalid tagname in closing tag.")}}else{i.tagName=a}}else if(a===">"){closeTag(i)}else if(isMatch(g,a)){i.tagName+=a}else if(i.script){i.script+="</"+i.tagName;i.tagName="";i.state=b.SCRIPT}else{if(!isWhitespace(a)){strictFail(i,"Invalid tagname in closing tag")}i.state=b.CLOSE_TAG_SAW_WHITE}continue;case b.CLOSE_TAG_SAW_WHITE:if(isWhitespace(a)){continue}if(a===">"){closeTag(i)}else{strictFail(i,"Invalid characters in closing tag")}continue;case b.TEXT_ENTITY:case b.ATTRIB_VALUE_ENTITY_Q:case b.ATTRIB_VALUE_ENTITY_U:var d;var p;switch(i.state){case b.TEXT_ENTITY:d=b.TEXT;p="textNode";break;case b.ATTRIB_VALUE_ENTITY_Q:d=b.ATTRIB_VALUE_QUOTED;p="attribValue";break;case b.ATTRIB_VALUE_ENTITY_U:d=b.ATTRIB_VALUE_UNQUOTED;p="attribValue";break}if(a===";"){i[p]+=parseEntity(i);i.entity="";i.state=d}else if(isMatch(i.entity.length?v:y,a)){i.entity+=a}else{strictFail(i,"Invalid character in entity name");i[p]+="&"+i.entity+a;i.entity="";i.state=d}continue;default:throw new Error(i,"Unknown state: "+i.state)}}if(i.position>=i.bufferCheckPosition){checkBufferLength(i)}return i}
|
|
30
|
-
/*! http://mths.be/fromcodepoint v0.1.0 by @mathias */if(!String.fromCodePoint){(function(){var r=String.fromCharCode;var i=Math.floor;var fromCodePoint=function(){var o=16384;var a=[];var l;var u;var c=-1;var h=arguments.length;if(!h){return""}var d="";while(++c<h){var p=Number(arguments[c]);if(!isFinite(p)||p<0||p>1114111||i(p)!==p){throw RangeError("Invalid code point: "+p)}if(p<=65535){a.push(p)}else{p-=65536;l=(p>>10)+55296;u=p%1024+56320;a.push(l,u)}if(c+1===h||a.length>o){d+=r.apply(null,a);a.length=0}}return d};if(Object.defineProperty){Object.defineProperty(String,"fromCodePoint",{value:fromCodePoint,configurable:true,writable:true})}else{String.fromCodePoint=fromCodePoint}})()}})(false?0:i)},332:r=>{"use strict";const i="";const o=`${i}[`;const a="";const l={to(r,i){if(!i)return`${o}${r+1}G`;return`${o}${i+1};${r+1}H`},move(r,i){let a="";if(r<0)a+=`${o}${-r}D`;else if(r>0)a+=`${o}${r}C`;if(i<0)a+=`${o}${-i}A`;else if(i>0)a+=`${o}${i}B`;return a},up:(r=1)=>`${o}${r}A`,down:(r=1)=>`${o}${r}B`,forward:(r=1)=>`${o}${r}C`,backward:(r=1)=>`${o}${r}D`,nextLine:(r=1)=>`${o}E`.repeat(r),prevLine:(r=1)=>`${o}F`.repeat(r),left:`${o}G`,hide:`${o}?25l`,show:`${o}?25h`,save:`${i}7`,restore:`${i}8`};const u={up:(r=1)=>`${o}S`.repeat(r),down:(r=1)=>`${o}T`.repeat(r)};const c={screen:`${o}2J`,up:(r=1)=>`${o}1J`.repeat(r),down:(r=1)=>`${o}J`.repeat(r),line:`${o}2K`,lineEnd:`${o}K`,lineStart:`${o}1K`,lines(r){let i="";for(let o=0;o<r;o++)i+=this.line+(o<r-1?l.up():"");if(r)i+=l.left;return i}};r.exports={cursor:l,scroll:u,erase:c,beep:a}},395:(r,i,o)=>{"use strict";const a=o(2037);const l=o(6224);const u=o(6738);const{env:c}=process;let h;if(u("no-color")||u("no-colors")||u("color=false")||u("color=never")){h=0}else if(u("color")||u("colors")||u("color=true")||u("color=always")){h=1}if("FORCE_COLOR"in c){if(c.FORCE_COLOR==="true"){h=1}else if(c.FORCE_COLOR==="false"){h=0}else{h=c.FORCE_COLOR.length===0?1:Math.min(parseInt(c.FORCE_COLOR,10),3)}}function translateLevel(r){if(r===0){return false}return{level:r,hasBasic:true,has256:r>=2,has16m:r>=3}}function supportsColor(r,i){if(h===0){return 0}if(u("color=16m")||u("color=full")||u("color=truecolor")){return 3}if(u("color=256")){return 2}if(r&&!i&&h===undefined){return 0}const o=h||0;if(c.TERM==="dumb"){return o}if(process.platform==="win32"){const r=a.release().split(".");if(Number(r[0])>=10&&Number(r[2])>=10586){return Number(r[2])>=14931?3:2}return 1}if("CI"in c){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some((r=>r in c))||c.CI_NAME==="codeship"){return 1}return o}if("TEAMCITY_VERSION"in c){return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(c.TEAMCITY_VERSION)?1:0}if(c.COLORTERM==="truecolor"){return 3}if("TERM_PROGRAM"in c){const r=parseInt((c.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(c.TERM_PROGRAM){case"iTerm.app":return r>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(c.TERM)){return 2}if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(c.TERM)){return 1}if("COLORTERM"in c){return 1}return o}function getSupportLevel(r){const i=supportsColor(r,r&&r.isTTY);return translateLevel(i)}r.exports={supportsColor:getSupportLevel,stdout:translateLevel(supportsColor(true,l.isatty(1))),stderr:translateLevel(supportsColor(true,l.isatty(2)))}},5418:(r,i,o)=>{const{URL:a}=o(7310);const{join:l}=o(1017);const u=o(7147);const{promisify:c}=o(3837);const{tmpdir:h}=o(2037);const d=o(2447);const p=c(u.writeFile);const m=c(u.mkdir);const g=c(u.readFile);const compareVersions=(r,i)=>r.localeCompare(i,"en-US",{numeric:true});const encode=r=>encodeURIComponent(r).replace(/^%40/,"@");const getFile=async(r,i)=>{const o=h();const a=l(o,"update-check");if(!u.existsSync(a)){await m(a)}let c=`${r.name}-${i}.json`;if(r.scope){c=`${r.scope}-${c}`}return l(a,c)};const evaluateCache=async(r,i,o)=>{if(u.existsSync(r)){const a=await g(r,"utf8");const{lastUpdate:l,latest:u}=JSON.parse(a);const c=l+o;if(c>i){return{shouldCheck:false,latest:u}}}return{shouldCheck:true,latest:null}};const updateCache=async(r,i,o)=>{const a=JSON.stringify({latest:i,lastUpdate:o});await p(r,a,"utf8")};const loadPackage=(r,i)=>new Promise(((a,l)=>{const u={host:r.hostname,path:r.pathname,port:r.port,headers:{accept:"application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"},timeout:2e3};if(i){u.headers.authorization=`${i.type} ${i.token}`}const{get:c}=o(r.protocol==="https:"?5687:3685);c(u,(r=>{const{statusCode:i}=r;if(i!==200){const o=new Error(`Request failed with code ${i}`);o.code=i;l(o);r.resume();return}let o="";r.setEncoding("utf8");r.on("data",(r=>{o+=r}));r.on("end",(()=>{try{const r=JSON.parse(o);a(r)}catch(r){l(r)}}))})).on("error",l).on("timeout",l)}));const getMostRecent=async({full:r,scope:i},l)=>{const u=d(i);const c=new a(r,u);let h=null;try{h=await loadPackage(c)}catch(r){if(r.code&&String(r.code).startsWith(4)){const r=o(1384);const i=r(u,{recursive:true});h=await loadPackage(c,i)}else{throw r}}const p=h["dist-tags"][l];if(!p){throw new Error(`Distribution tag ${l} is not available`)}return p};const y={interval:36e5,distTag:"latest"};const getDetails=r=>{const i={full:encode(r)};if(r.includes("/")){const o=r.split("/");i.scope=o[0];i.name=o[1]}else{i.scope=null;i.name=r}return i};r.exports=async(r,i)=>{if(typeof r!=="object"){throw new Error("The first parameter should be your package.json file content")}const o=getDetails(r.name);const a=Date.now();const{distTag:l,interval:u}=Object.assign({},y,i);const c=await getFile(o,l);let h=null;let d=true;({shouldCheck:d,latest:h}=await evaluateCache(c,a,u));if(d){h=await getMostRecent(o,l);await updateCache(c,h,a)}const p=compareVersions(r.version,h);if(p===-1){return{latest:h,fromCache:!d}}return null}},4586:r=>{r.exports=wrappy;function wrappy(r,i){if(r&&i)return wrappy(r)(i);if(typeof r!=="function")throw new TypeError("need wrapper function");Object.keys(r).forEach((function(i){wrapper[i]=r[i]}));return wrapper;function wrapper(){var i=new Array(arguments.length);for(var o=0;o<i.length;o++){i[o]=arguments[o]}var a=r.apply(this,i);var l=i[i.length-1];if(typeof a==="function"&&a!==l){Object.keys(l).forEach((function(r){a[r]=l[r]}))}return a}}},4604:function(r,i){(function(){"use strict";i.stripBOM=function(r){if(r[0]==="\ufeff"){return r.substring(1)}else{return r}}}).call(this)},1002:function(r,i,o){(function(){"use strict";var r,a,l,u,c,h={}.hasOwnProperty;r=o(3131);a=o(9498).defaults;u=function(r){return typeof r==="string"&&(r.indexOf("&")>=0||r.indexOf(">")>=0||r.indexOf("<")>=0)};c=function(r){return"<![CDATA["+l(r)+"]]>"};l=function(r){return r.replace("]]>","]]]]><![CDATA[>")};i.Builder=function(){function Builder(r){var i,o,l;this.options={};o=a["0.2"];for(i in o){if(!h.call(o,i))continue;l=o[i];this.options[i]=l}for(i in r){if(!h.call(r,i))continue;l=r[i];this.options[i]=l}}Builder.prototype.buildObject=function(i){var o,l,d,p,m;o=this.options.attrkey;l=this.options.charkey;if(Object.keys(i).length===1&&this.options.rootName===a["0.2"].rootName){m=Object.keys(i)[0];i=i[m]}else{m=this.options.rootName}d=function(r){return function(i,a){var p,m,g,y,v,b;if(typeof a!=="object"){if(r.options.cdata&&u(a)){i.raw(c(a))}else{i.txt(a)}}else if(Array.isArray(a)){for(y in a){if(!h.call(a,y))continue;m=a[y];for(v in m){g=m[v];i=d(i.ele(v),g).up()}}}else{for(v in a){if(!h.call(a,v))continue;m=a[v];if(v===o){if(typeof m==="object"){for(p in m){b=m[p];i=i.att(p,b)}}}else if(v===l){if(r.options.cdata&&u(m)){i=i.raw(c(m))}else{i=i.txt(m)}}else if(Array.isArray(m)){for(y in m){if(!h.call(m,y))continue;g=m[y];if(typeof g==="string"){if(r.options.cdata&&u(g)){i=i.ele(v).raw(c(g)).up()}else{i=i.ele(v,g).up()}}else{i=d(i.ele(v),g).up()}}}else if(typeof m==="object"){i=d(i.ele(v),m).up()}else{if(typeof m==="string"&&r.options.cdata&&u(m)){i=i.ele(v).raw(c(m)).up()}else{if(m==null){m=""}i=i.ele(v,m.toString()).up()}}}}return i}}(this);p=r.create(m,this.options.xmldec,this.options.doctype,{headless:this.options.headless,allowSurrogateChars:this.options.allowSurrogateChars});return d(p,i).end(this.options.renderOpts)};return Builder}()}).call(this)},9498:function(r,i){(function(){i.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)},7426:function(r,i,o){(function(){"use strict";var r,a,l,u,c,h,d,p,m,bind=function(r,i){return function(){return r.apply(i,arguments)}},extend=function(r,i){for(var o in i){if(g.call(i,o))r[o]=i[o]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},g={}.hasOwnProperty;p=o(9746);l=o(2361);r=o(4604);d=o(9068);m=o(9512).setImmediate;a=o(9498).defaults;u=function(r){return typeof r==="object"&&r!=null&&Object.keys(r).length===0};c=function(r){return r!=="__proto__"&&r!=="constructor"&&r!=="prototype"};h=function(r,i,o){var a,l,u;for(a=0,l=r.length;a<l;a++){u=r[a];i=u(i,o)}return i};i.Parser=function(o){extend(Parser,o);function Parser(r){this.parseStringPromise=bind(this.parseStringPromise,this);this.parseString=bind(this.parseString,this);this.reset=bind(this.reset,this);this.assignOrPush=bind(this.assignOrPush,this);this.processAsync=bind(this.processAsync,this);var o,l,u;if(!(this instanceof i.Parser)){return new i.Parser(r)}this.options={};l=a["0.2"];for(o in l){if(!g.call(l,o))continue;u=l[o];this.options[o]=u}for(o in r){if(!g.call(r,o))continue;u=r[o];this.options[o]=u}if(this.options.xmlns){this.options.xmlnskey=this.options.attrkey+"ns"}if(this.options.normalizeTags){if(!this.options.tagNameProcessors){this.options.tagNameProcessors=[]}this.options.tagNameProcessors.unshift(d.normalize)}this.reset()}Parser.prototype.processAsync=function(){var r,i;try{if(this.remaining.length<=this.options.chunkSize){r=this.remaining;this.remaining="";this.saxParser=this.saxParser.write(r);return this.saxParser.close()}else{r=this.remaining.substr(0,this.options.chunkSize);this.remaining=this.remaining.substr(this.options.chunkSize,this.remaining.length);this.saxParser=this.saxParser.write(r);return m(this.processAsync)}}catch(r){i=r;if(!this.saxParser.errThrown){this.saxParser.errThrown=true;return this.emit(i)}}};Parser.prototype.assignOrPush=function(r,i,o){if(!c(i)){return}if(!(i in r)){if(!this.options.explicitArray){return r[i]=o}else{return r[i]=[o]}}else{if(!(r[i]instanceof Array)){r[i]=[r[i]]}return r[i].push(o)}};Parser.prototype.reset=function(){var r,i,o,a;this.removeAllListeners();this.saxParser=p.parser(this.options.strict,{trim:false,normalize:false,xmlns:this.options.xmlns});this.saxParser.errThrown=false;this.saxParser.onerror=function(r){return function(i){r.saxParser.resume();if(!r.saxParser.errThrown){r.saxParser.errThrown=true;return r.emit("error",i)}}}(this);this.saxParser.onend=function(r){return function(){if(!r.saxParser.ended){r.saxParser.ended=true;return r.emit("end",r.resultObject)}}}(this);this.saxParser.ended=false;this.EXPLICIT_CHARKEY=this.options.explicitCharkey;this.resultObject=null;a=[];r=this.options.attrkey;i=this.options.charkey;this.saxParser.onopentag=function(o){return function(l){var u,d,p,m,y;p={};p[i]="";if(!o.options.ignoreAttrs){y=l.attributes;for(u in y){if(!g.call(y,u))continue;if(!(r in p)&&!o.options.mergeAttrs){p[r]={}}d=o.options.attrValueProcessors?h(o.options.attrValueProcessors,l.attributes[u],u):l.attributes[u];m=o.options.attrNameProcessors?h(o.options.attrNameProcessors,u):u;if(c(m)){if(o.options.mergeAttrs){o.assignOrPush(p,m,d)}else{p[r][m]=d}}}}p["#name"]=o.options.tagNameProcessors?h(o.options.tagNameProcessors,l.name):l.name;if(o.options.xmlns){p[o.options.xmlnskey]={uri:l.uri,local:l.local}}return a.push(p)}}(this);this.saxParser.onclosetag=function(r){return function(){var o,l,d,p,m,y,v,b,w,M;y=a.pop();m=y["#name"];if(!r.options.explicitChildren||!r.options.preserveChildrenOrder){delete y["#name"]}if(y.cdata===true){o=y.cdata;delete y.cdata}w=a[a.length-1];if(y[i].match(/^\s*$/)&&!o){l=y[i];delete y[i]}else{if(r.options.trim){y[i]=y[i].trim()}if(r.options.normalize){y[i]=y[i].replace(/\s{2,}/g," ").trim()}y[i]=r.options.valueProcessors?h(r.options.valueProcessors,y[i],m):y[i];if(Object.keys(y).length===1&&i in y&&!r.EXPLICIT_CHARKEY){y=y[i]}}if(u(y)){if(typeof r.options.emptyTag==="function"){y=r.options.emptyTag()}else{y=r.options.emptyTag!==""?r.options.emptyTag:l}}if(r.options.validator!=null){M="/"+function(){var r,i,o;o=[];for(r=0,i=a.length;r<i;r++){p=a[r];o.push(p["#name"])}return o}().concat(m).join("/");(function(){var i;try{return y=r.options.validator(M,w&&w[m],y)}catch(o){i=o;return r.emit("error",i)}})()}if(r.options.explicitChildren&&!r.options.mergeAttrs&&typeof y==="object"){if(!r.options.preserveChildrenOrder){p={};if(r.options.attrkey in y){p[r.options.attrkey]=y[r.options.attrkey];delete y[r.options.attrkey]}if(!r.options.charsAsChildren&&r.options.charkey in y){p[r.options.charkey]=y[r.options.charkey];delete y[r.options.charkey]}if(Object.getOwnPropertyNames(y).length>0){p[r.options.childkey]=y}y=p}else if(w){w[r.options.childkey]=w[r.options.childkey]||[];v={};for(d in y){if(!g.call(y,d))continue;if(c(d)){v[d]=y[d]}}w[r.options.childkey].push(v);delete y["#name"];if(Object.keys(y).length===1&&i in y&&!r.EXPLICIT_CHARKEY){y=y[i]}}}if(a.length>0){return r.assignOrPush(w,m,y)}else{if(r.options.explicitRoot){b=y;y={};y[m]=b}r.resultObject=y;r.saxParser.ended=true;return r.emit("end",r.resultObject)}}}(this);o=function(r){return function(o){var l,u;u=a[a.length-1];if(u){u[i]+=o;if(r.options.explicitChildren&&r.options.preserveChildrenOrder&&r.options.charsAsChildren&&(r.options.includeWhiteChars||o.replace(/\\n/g,"").trim()!=="")){u[r.options.childkey]=u[r.options.childkey]||[];l={"#name":"__text__"};l[i]=o;if(r.options.normalize){l[i]=l[i].replace(/\s{2,}/g," ").trim()}u[r.options.childkey].push(l)}return u}}}(this);this.saxParser.ontext=o;return this.saxParser.oncdata=function(r){return function(r){var i;i=o(r);if(i){return i.cdata=true}}}(this)};Parser.prototype.parseString=function(i,o){var a;if(o!=null&&typeof o==="function"){this.on("end",(function(r){this.reset();return o(null,r)}));this.on("error",(function(r){this.reset();return o(r)}))}try{i=i.toString();if(i.trim()===""){this.emit("end",null);return true}i=r.stripBOM(i);if(this.options.async){this.remaining=i;m(this.processAsync);return this.saxParser}return this.saxParser.write(i).close()}catch(r){a=r;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(r){return new Promise(function(i){return function(o,a){return i.parseString(r,(function(r,i){if(r){return a(r)}else{return o(i)}}))}}(this))};return Parser}(l);i.parseString=function(r,o,a){var l,u,c;if(a!=null){if(typeof a==="function"){l=a}if(typeof o==="object"){u=o}}else{if(typeof o==="function"){l=o}u={}}c=new i.Parser(u);return c.parseString(r,l)};i.parseStringPromise=function(r,o){var a,l;if(typeof o==="object"){a=o}l=new i.Parser(a);return l.parseStringPromise(r)}}).call(this)},9068:function(r,i){(function(){"use strict";var r;r=new RegExp(/(?!xmlns)^.*:/);i.normalize=function(r){return r.toLowerCase()};i.firstCharLowerCase=function(r){return r.charAt(0).toLowerCase()+r.slice(1)};i.stripPrefix=function(i){return i.replace(r,"")};i.parseNumbers=function(r){if(!isNaN(r)){r=r%1===0?parseInt(r,10):parseFloat(r)}return r};i.parseBooleans=function(r){if(/^(?:true|false)$/i.test(r)){r=r.toLowerCase()==="true"}return r}}).call(this)},7013:function(r,i,o){(function(){"use strict";var r,a,l,u,extend=function(r,i){for(var o in i){if(c.call(i,o))r[o]=i[o]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},c={}.hasOwnProperty;a=o(9498);r=o(1002);l=o(7426);u=o(9068);i.defaults=a.defaults;i.processors=u;i.ValidationError=function(r){extend(ValidationError,r);function ValidationError(r){this.message=r}return ValidationError}(Error);i.Builder=r.Builder;i.Parser=l.Parser;i.parseString=l.parseString;i.parseStringPromise=l.parseStringPromise}).call(this)},2346:function(r){(function(){r.exports={Disconnected:1,Preceding:2,Following:4,Contains:8,ContainedBy:16,ImplementationSpecific:32}}).call(this)},4128:function(r){(function(){r.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)},2629:function(r){(function(){var i,o,a,l,u,c,h,d=[].slice,p={}.hasOwnProperty;i=function(){var r,i,o,a,l,c;c=arguments[0],l=2<=arguments.length?d.call(arguments,1):[];if(u(Object.assign)){Object.assign.apply(null,arguments)}else{for(r=0,o=l.length;r<o;r++){a=l[r];if(a!=null){for(i in a){if(!p.call(a,i))continue;c[i]=a[i]}}}}return c};u=function(r){return!!r&&Object.prototype.toString.call(r)==="[object Function]"};c=function(r){var i;return!!r&&((i=typeof r)==="function"||i==="object")};a=function(r){if(u(Array.isArray)){return Array.isArray(r)}else{return Object.prototype.toString.call(r)==="[object Array]"}};l=function(r){var i;if(a(r)){return!r.length}else{for(i in r){if(!p.call(r,i))continue;return false}return true}};h=function(r){var i,o;return c(r)&&(o=Object.getPrototypeOf(r))&&(i=o.constructor)&&typeof i==="function"&&i instanceof i&&Function.prototype.toString.call(i)===Function.prototype.toString.call(Object)};o=function(r){if(u(r.valueOf)){return r.valueOf()}else{return r}};r.exports.assign=i;r.exports.isFunction=u;r.exports.isObject=c;r.exports.isArray=a;r.exports.isEmpty=l;r.exports.isPlainObject=h;r.exports.getValue=o}).call(this)},8413:function(r){(function(){r.exports={None:0,OpenTag:1,InsideTag:2,CloseTag:3}}).call(this)},9525:function(r,i,o){(function(){var i,a,l;i=o(4128);l=o(8064);r.exports=a=function(){function XMLAttribute(r,o,a){this.parent=r;if(this.parent){this.options=this.parent.options;this.stringify=this.parent.stringify}if(o==null){throw new Error("Missing attribute name. "+this.debugInfo(o))}this.name=this.stringify.name(o);this.value=this.stringify.attValue(a);this.type=i.Attribute;this.isId=false;this.schemaTypeInfo=null}Object.defineProperty(XMLAttribute.prototype,"nodeType",{get:function(){return this.type}});Object.defineProperty(XMLAttribute.prototype,"ownerElement",{get:function(){return this.parent}});Object.defineProperty(XMLAttribute.prototype,"textContent",{get:function(){return this.value},set:function(r){return this.value=r||""}});Object.defineProperty(XMLAttribute.prototype,"namespaceURI",{get:function(){return""}});Object.defineProperty(XMLAttribute.prototype,"prefix",{get:function(){return""}});Object.defineProperty(XMLAttribute.prototype,"localName",{get:function(){return this.name}});Object.defineProperty(XMLAttribute.prototype,"specified",{get:function(){return true}});XMLAttribute.prototype.clone=function(){return Object.create(this)};XMLAttribute.prototype.toString=function(r){return this.options.writer.attribute(this,this.options.writer.filterOptions(r))};XMLAttribute.prototype.debugInfo=function(r){r=r||this.name;if(r==null){return"parent: <"+this.parent.name+">"}else{return"attribute: {"+r+"}, parent: <"+this.parent.name+">"}};XMLAttribute.prototype.isEqualNode=function(r){if(r.namespaceURI!==this.namespaceURI){return false}if(r.prefix!==this.prefix){return false}if(r.localName!==this.localName){return false}if(r.value!==this.value){return false}return true};return XMLAttribute}()}).call(this)},6789:function(r,i,o){(function(){var i,a,l,extend=function(r,i){for(var o in i){if(u.call(i,o))r[o]=i[o]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},u={}.hasOwnProperty;i=o(4128);l=o(3527);r.exports=a=function(r){extend(XMLCData,r);function XMLCData(r,o){XMLCData.__super__.constructor.call(this,r);if(o==null){throw new Error("Missing CDATA text. "+this.debugInfo())}this.name="#cdata-section";this.type=i.CData;this.value=this.stringify.cdata(o)}XMLCData.prototype.clone=function(){return Object.create(this)};XMLCData.prototype.toString=function(r){return this.options.writer.cdata(this,this.options.writer.filterOptions(r))};return XMLCData}(l)}).call(this)},3527:function(r,i,o){(function(){var i,a,extend=function(r,i){for(var o in i){if(l.call(i,o))r[o]=i[o]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},l={}.hasOwnProperty;a=o(8064);r.exports=i=function(r){extend(XMLCharacterData,r);function XMLCharacterData(r){XMLCharacterData.__super__.constructor.call(this,r);this.value=""}Object.defineProperty(XMLCharacterData.prototype,"data",{get:function(){return this.value},set:function(r){return this.value=r||""}});Object.defineProperty(XMLCharacterData.prototype,"length",{get:function(){return this.value.length}});Object.defineProperty(XMLCharacterData.prototype,"textContent",{get:function(){return this.value},set:function(r){return this.value=r||""}});XMLCharacterData.prototype.clone=function(){return Object.create(this)};XMLCharacterData.prototype.substringData=function(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLCharacterData.prototype.appendData=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLCharacterData.prototype.insertData=function(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLCharacterData.prototype.deleteData=function(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLCharacterData.prototype.replaceData=function(r,i,o){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLCharacterData.prototype.isEqualNode=function(r){if(!XMLCharacterData.__super__.isEqualNode.apply(this,arguments).isEqualNode(r)){return false}if(r.data!==this.data){return false}return true};return XMLCharacterData}(a)}).call(this)},4593:function(r,i,o){(function(){var i,a,l,extend=function(r,i){for(var o in i){if(u.call(i,o))r[o]=i[o]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},u={}.hasOwnProperty;i=o(4128);a=o(3527);r.exports=l=function(r){extend(XMLComment,r);function XMLComment(r,o){XMLComment.__super__.constructor.call(this,r);if(o==null){throw new Error("Missing comment text. "+this.debugInfo())}this.name="#comment";this.type=i.Comment;this.value=this.stringify.comment(o)}XMLComment.prototype.clone=function(){return Object.create(this)};XMLComment.prototype.toString=function(r){return this.options.writer.comment(this,this.options.writer.filterOptions(r))};return XMLComment}(a)}).call(this)},4196:function(r,i,o){(function(){var i,a,l;a=o(7850);l=o(5132);r.exports=i=function(){function XMLDOMConfiguration(){var r;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=r=Object.create(this.defaultParams)}Object.defineProperty(XMLDOMConfiguration.prototype,"parameterNames",{get:function(){return new l(Object.keys(this.defaultParams))}});XMLDOMConfiguration.prototype.getParameter=function(r){if(this.params.hasOwnProperty(r)){return this.params[r]}else{return null}};XMLDOMConfiguration.prototype.canSetParameter=function(r,i){return true};XMLDOMConfiguration.prototype.setParameter=function(r,i){if(i!=null){return this.params[r]=i}else{return delete this.params[r]}};return XMLDOMConfiguration}()}).call(this)},7850:function(r){(function(){var i;r.exports=i=function(){function XMLDOMErrorHandler(){}XMLDOMErrorHandler.prototype.handleError=function(r){throw new Error(r)};return XMLDOMErrorHandler}()}).call(this)},9490:function(r){(function(){var i;r.exports=i=function(){function XMLDOMImplementation(){}XMLDOMImplementation.prototype.hasFeature=function(r,i){return true};XMLDOMImplementation.prototype.createDocumentType=function(r,i,o){throw new Error("This DOM method is not implemented.")};XMLDOMImplementation.prototype.createDocument=function(r,i,o){throw new Error("This DOM method is not implemented.")};XMLDOMImplementation.prototype.createHTMLDocument=function(r){throw new Error("This DOM method is not implemented.")};XMLDOMImplementation.prototype.getFeature=function(r,i){throw new Error("This DOM method is not implemented.")};return XMLDOMImplementation}()}).call(this)},5132:function(r){(function(){var i;r.exports=i=function(){function XMLDOMStringList(r){this.arr=r||[]}Object.defineProperty(XMLDOMStringList.prototype,"length",{get:function(){return this.arr.length}});XMLDOMStringList.prototype.item=function(r){return this.arr[r]||null};XMLDOMStringList.prototype.contains=function(r){return this.arr.indexOf(r)!==-1};return XMLDOMStringList}()}).call(this)},1066:function(r,i,o){(function(){var i,a,l,extend=function(r,i){for(var o in i){if(u.call(i,o))r[o]=i[o]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},u={}.hasOwnProperty;l=o(8064);i=o(4128);r.exports=a=function(r){extend(XMLDTDAttList,r);function XMLDTDAttList(r,o,a,l,u,c){XMLDTDAttList.__super__.constructor.call(this,r);if(o==null){throw new Error("Missing DTD element name. "+this.debugInfo())}if(a==null){throw new Error("Missing DTD attribute name. "+this.debugInfo(o))}if(!l){throw new Error("Missing DTD attribute type. "+this.debugInfo(o))}if(!u){throw new Error("Missing DTD attribute default. "+this.debugInfo(o))}if(u.indexOf("#")!==0){u="#"+u}if(!u.match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/)){throw new Error("Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT. "+this.debugInfo(o))}if(c&&!u.match(/^(#FIXED|#DEFAULT)$/)){throw new Error("Default value only applies to #FIXED or #DEFAULT. "+this.debugInfo(o))}this.elementName=this.stringify.name(o);this.type=i.AttributeDeclaration;this.attributeName=this.stringify.name(a);this.attributeType=this.stringify.dtdAttType(l);if(c){this.defaultValue=this.stringify.dtdAttDefault(c)}this.defaultValueType=u}XMLDTDAttList.prototype.toString=function(r){return this.options.writer.dtdAttList(this,this.options.writer.filterOptions(r))};return XMLDTDAttList}(l)}).call(this)},3584:function(r,i,o){(function(){var i,a,l,extend=function(r,i){for(var o in i){if(u.call(i,o))r[o]=i[o]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},u={}.hasOwnProperty;l=o(8064);i=o(4128);r.exports=a=function(r){extend(XMLDTDElement,r);function XMLDTDElement(r,o,a){XMLDTDElement.__super__.constructor.call(this,r);if(o==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(o);this.type=i.ElementDeclaration;this.value=this.stringify.dtdElementValue(a)}XMLDTDElement.prototype.toString=function(r){return this.options.writer.dtdElement(this,this.options.writer.filterOptions(r))};return XMLDTDElement}(l)}).call(this)},9346:function(r,i,o){(function(){var i,a,l,u,extend=function(r,i){for(var o in i){if(c.call(i,o))r[o]=i[o]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},c={}.hasOwnProperty;u=o(2629).isObject;l=o(8064);i=o(4128);r.exports=a=function(r){extend(XMLDTDEntity,r);function XMLDTDEntity(r,o,a,l){XMLDTDEntity.__super__.constructor.call(this,r);if(a==null){throw new Error("Missing DTD entity name. "+this.debugInfo(a))}if(l==null){throw new Error("Missing DTD entity value. "+this.debugInfo(a))}this.pe=!!o;this.name=this.stringify.name(a);this.type=i.EntityDeclaration;if(!u(l)){this.value=this.stringify.dtdEntityValue(l);this.internal=true}else{if(!l.pubID&&!l.sysID){throw new Error("Public and/or system identifiers are required for an external entity. "+this.debugInfo(a))}if(l.pubID&&!l.sysID){throw new Error("System identifier is required for a public external entity. "+this.debugInfo(a))}this.internal=false;if(l.pubID!=null){this.pubID=this.stringify.dtdPubID(l.pubID)}if(l.sysID!=null){this.sysID=this.stringify.dtdSysID(l.sysID)}if(l.nData!=null){this.nData=this.stringify.dtdNData(l.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(r){return this.options.writer.dtdEntity(this,this.options.writer.filterOptions(r))};return XMLDTDEntity}(l)}).call(this)},853:function(r,i,o){(function(){var i,a,l,extend=function(r,i){for(var o in i){if(u.call(i,o))r[o]=i[o]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},u={}.hasOwnProperty;l=o(8064);i=o(4128);r.exports=a=function(r){extend(XMLDTDNotation,r);function XMLDTDNotation(r,o,a){XMLDTDNotation.__super__.constructor.call(this,r);if(o==null){throw new Error("Missing DTD notation name. "+this.debugInfo(o))}if(!a.pubID&&!a.sysID){throw new Error("Public or system identifiers are required for an external entity. "+this.debugInfo(o))}this.name=this.stringify.name(o);this.type=i.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(r){return this.options.writer.dtdNotation(this,this.options.writer.filterOptions(r))};return XMLDTDNotation}(l)}).call(this)},4972:function(r,i,o){(function(){var i,a,l,u,extend=function(r,i){for(var o in i){if(c.call(i,o))r[o]=i[o]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},c={}.hasOwnProperty;u=o(2629).isObject;l=o(8064);i=o(4128);r.exports=a=function(r){extend(XMLDeclaration,r);function XMLDeclaration(r,o,a,l){var c;XMLDeclaration.__super__.constructor.call(this,r);if(u(o)){c=o,o=c.version,a=c.encoding,l=c.standalone}if(!o){o="1.0"}this.type=i.Declaration;this.version=this.stringify.xmlVersion(o);if(a!=null){this.encoding=this.stringify.xmlEncoding(a)}if(l!=null){this.standalone=this.stringify.xmlStandalone(l)}}XMLDeclaration.prototype.toString=function(r){return this.options.writer.declaration(this,this.options.writer.filterOptions(r))};return XMLDeclaration}(l)}).call(this)},9025:function(r,i,o){(function(){var i,a,l,u,c,h,d,p,m,extend=function(r,i){for(var o in i){if(g.call(i,o))r[o]=i[o]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},g={}.hasOwnProperty;m=o(2629).isObject;p=o(8064);i=o(4128);a=o(1066);u=o(9346);l=o(3584);c=o(853);d=o(8339);r.exports=h=function(r){extend(XMLDocType,r);function XMLDocType(r,o,a){var l,u,c,h,d,p;XMLDocType.__super__.constructor.call(this,r);this.type=i.DocType;if(r.children){h=r.children;for(u=0,c=h.length;u<c;u++){l=h[u];if(l.type===i.Element){this.name=l.name;break}}}this.documentObject=r;if(m(o)){d=o,o=d.pubID,a=d.sysID}if(a==null){p=[o,a],a=p[0],o=p[1]}if(o!=null){this.pubID=this.stringify.dtdPubID(o)}if(a!=null){this.sysID=this.stringify.dtdSysID(a)}}Object.defineProperty(XMLDocType.prototype,"entities",{get:function(){var r,o,a,l,u;l={};u=this.children;for(o=0,a=u.length;o<a;o++){r=u[o];if(r.type===i.EntityDeclaration&&!r.pe){l[r.name]=r}}return new d(l)}});Object.defineProperty(XMLDocType.prototype,"notations",{get:function(){var r,o,a,l,u;l={};u=this.children;for(o=0,a=u.length;o<a;o++){r=u[o];if(r.type===i.NotationDeclaration){l[r.name]=r}}return new d(l)}});Object.defineProperty(XMLDocType.prototype,"publicId",{get:function(){return this.pubID}});Object.defineProperty(XMLDocType.prototype,"systemId",{get:function(){return this.sysID}});Object.defineProperty(XMLDocType.prototype,"internalSubset",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}});XMLDocType.prototype.element=function(r,i){var o;o=new l(this,r,i);this.children.push(o);return this};XMLDocType.prototype.attList=function(r,i,o,l,u){var c;c=new a(this,r,i,o,l,u);this.children.push(c);return this};XMLDocType.prototype.entity=function(r,i){var o;o=new u(this,false,r,i);this.children.push(o);return this};XMLDocType.prototype.pEntity=function(r,i){var o;o=new u(this,true,r,i);this.children.push(o);return this};XMLDocType.prototype.notation=function(r,i){var o;o=new c(this,r,i);this.children.push(o);return this};XMLDocType.prototype.toString=function(r){return this.options.writer.docType(this,this.options.writer.filterOptions(r))};XMLDocType.prototype.ele=function(r,i){return this.element(r,i)};XMLDocType.prototype.att=function(r,i,o,a,l){return this.attList(r,i,o,a,l)};XMLDocType.prototype.ent=function(r,i){return this.entity(r,i)};XMLDocType.prototype.pent=function(r,i){return this.pEntity(r,i)};XMLDocType.prototype.not=function(r,i){return this.notation(r,i)};XMLDocType.prototype.up=function(){return this.root()||this.documentObject};XMLDocType.prototype.isEqualNode=function(r){if(!XMLDocType.__super__.isEqualNode.apply(this,arguments).isEqualNode(r)){return false}if(r.name!==this.name){return false}if(r.publicId!==this.publicId){return false}if(r.systemId!==this.systemId){return false}return true};return XMLDocType}(p)}).call(this)},3315:function(r,i,o){(function(){var i,a,l,u,c,h,d,p,extend=function(r,i){for(var o in i){if(m.call(i,o))r[o]=i[o]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},m={}.hasOwnProperty;p=o(2629).isPlainObject;l=o(9490);a=o(4196);c=o(8064);i=o(4128);d=o(916);h=o(6939);r.exports=u=function(r){extend(XMLDocument,r);function XMLDocument(r){XMLDocument.__super__.constructor.call(this,null);this.name="#document";this.type=i.Document;this.documentURI=null;this.domConfig=new a;r||(r={});if(!r.writer){r.writer=new h}this.options=r;this.stringify=new d(r)}Object.defineProperty(XMLDocument.prototype,"implementation",{value:new l});Object.defineProperty(XMLDocument.prototype,"doctype",{get:function(){var r,o,a,l;l=this.children;for(o=0,a=l.length;o<a;o++){r=l[o];if(r.type===i.DocType){return r}}return null}});Object.defineProperty(XMLDocument.prototype,"documentElement",{get:function(){return this.rootObject||null}});Object.defineProperty(XMLDocument.prototype,"inputEncoding",{get:function(){return null}});Object.defineProperty(XMLDocument.prototype,"strictErrorChecking",{get:function(){return false}});Object.defineProperty(XMLDocument.prototype,"xmlEncoding",{get:function(){if(this.children.length!==0&&this.children[0].type===i.Declaration){return this.children[0].encoding}else{return null}}});Object.defineProperty(XMLDocument.prototype,"xmlStandalone",{get:function(){if(this.children.length!==0&&this.children[0].type===i.Declaration){return this.children[0].standalone==="yes"}else{return false}}});Object.defineProperty(XMLDocument.prototype,"xmlVersion",{get:function(){if(this.children.length!==0&&this.children[0].type===i.Declaration){return this.children[0].version}else{return"1.0"}}});Object.defineProperty(XMLDocument.prototype,"URL",{get:function(){return this.documentURI}});Object.defineProperty(XMLDocument.prototype,"origin",{get:function(){return null}});Object.defineProperty(XMLDocument.prototype,"compatMode",{get:function(){return null}});Object.defineProperty(XMLDocument.prototype,"characterSet",{get:function(){return null}});Object.defineProperty(XMLDocument.prototype,"contentType",{get:function(){return null}});XMLDocument.prototype.end=function(r){var i;i={};if(!r){r=this.options.writer}else if(p(r)){i=r;r=this.options.writer}return r.document(this,r.filterOptions(i))};XMLDocument.prototype.toString=function(r){return this.options.writer.document(this,this.options.writer.filterOptions(r))};XMLDocument.prototype.createElement=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createDocumentFragment=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createTextNode=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createComment=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createCDATASection=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createProcessingInstruction=function(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createAttribute=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createEntityReference=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.getElementsByTagName=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.importNode=function(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createElementNS=function(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createAttributeNS=function(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.getElementsByTagNameNS=function(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.getElementById=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.adoptNode=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.normalizeDocument=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.renameNode=function(r,i,o){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.getElementsByClassName=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createEvent=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createRange=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createNodeIterator=function(r,i,o){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createTreeWalker=function(r,i,o){throw new Error("This DOM method is not implemented."+this.debugInfo())};return XMLDocument}(c)}).call(this)},1523:function(r,i,o){(function(){var i,a,l,u,c,h,d,p,m,g,y,v,b,w,M,E,D,T,x,O,N,_,A,I,L={}.hasOwnProperty;I=o(2629),_=I.isObject,N=I.isFunction,A=I.isPlainObject,O=I.getValue;i=o(4128);v=o(3315);w=o(7370);u=o(6789);c=o(4593);E=o(363);x=o(8854);M=o(3234);g=o(4972);y=o(9025);h=o(1066);p=o(9346);d=o(3584);m=o(853);l=o(9525);T=o(916);D=o(6939);a=o(8413);r.exports=b=function(){function XMLDocumentCB(r,o,a){var l;this.name="?xml";this.type=i.Document;r||(r={});l={};if(!r.writer){r.writer=new D}else if(A(r.writer)){l=r.writer;r.writer=new D}this.options=r;this.writer=r.writer;this.writerOptions=this.writer.filterOptions(l);this.stringify=new T(r);this.onDataCallback=o||function(){};this.onEndCallback=a||function(){};this.currentNode=null;this.currentLevel=-1;this.openTags={};this.documentStarted=false;this.documentCompleted=false;this.root=null}XMLDocumentCB.prototype.createChildNode=function(r){var o,a,l,u,c,h,d,p;switch(r.type){case i.CData:this.cdata(r.value);break;case i.Comment:this.comment(r.value);break;case i.Element:l={};d=r.attribs;for(a in d){if(!L.call(d,a))continue;o=d[a];l[a]=o.value}this.node(r.name,l);break;case i.Dummy:this.dummy();break;case i.Raw:this.raw(r.value);break;case i.Text:this.text(r.value);break;case i.ProcessingInstruction:this.instruction(r.target,r.value);break;default:throw new Error("This XML node type is not supported in a JS object: "+r.constructor.name)}p=r.children;for(c=0,h=p.length;c<h;c++){u=p[c];this.createChildNode(u);if(u.type===i.Element){this.up()}}return this};XMLDocumentCB.prototype.dummy=function(){return this};XMLDocumentCB.prototype.node=function(r,i,o){var a;if(r==null){throw new Error("Missing node name.")}if(this.root&&this.currentLevel===-1){throw new Error("Document can only have one root node. "+this.debugInfo(r))}this.openCurrent();r=O(r);if(i==null){i={}}i=O(i);if(!_(i)){a=[i,o],o=a[0],i=a[1]}this.currentNode=new w(this,r,i);this.currentNode.children=false;this.currentLevel++;this.openTags[this.currentLevel]=this.currentNode;if(o!=null){this.text(o)}return this};XMLDocumentCB.prototype.element=function(r,o,a){var l,u,c,h,d,p;if(this.currentNode&&this.currentNode.type===i.DocType){this.dtdElement.apply(this,arguments)}else{if(Array.isArray(r)||_(r)||N(r)){h=this.options.noValidation;this.options.noValidation=true;p=new v(this.options).element("TEMP_ROOT");p.element(r);this.options.noValidation=h;d=p.children;for(u=0,c=d.length;u<c;u++){l=d[u];this.createChildNode(l);if(l.type===i.Element){this.up()}}}else{this.node(r,o,a)}}return this};XMLDocumentCB.prototype.attribute=function(r,i){var o,a;if(!this.currentNode||this.currentNode.children){throw new Error("att() can only be used immediately after an ele() call in callback mode. "+this.debugInfo(r))}if(r!=null){r=O(r)}if(_(r)){for(o in r){if(!L.call(r,o))continue;a=r[o];this.attribute(o,a)}}else{if(N(i)){i=i.apply()}if(this.options.keepNullAttributes&&i==null){this.currentNode.attribs[r]=new l(this,r,"")}else if(i!=null){this.currentNode.attribs[r]=new l(this,r,i)}}return this};XMLDocumentCB.prototype.text=function(r){var i;this.openCurrent();i=new x(this,r);this.onData(this.writer.text(i,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this};XMLDocumentCB.prototype.cdata=function(r){var i;this.openCurrent();i=new u(this,r);this.onData(this.writer.cdata(i,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this};XMLDocumentCB.prototype.comment=function(r){var i;this.openCurrent();i=new c(this,r);this.onData(this.writer.comment(i,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this};XMLDocumentCB.prototype.raw=function(r){var i;this.openCurrent();i=new E(this,r);this.onData(this.writer.raw(i,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this};XMLDocumentCB.prototype.instruction=function(r,i){var o,a,l,u,c;this.openCurrent();if(r!=null){r=O(r)}if(i!=null){i=O(i)}if(Array.isArray(r)){for(o=0,u=r.length;o<u;o++){a=r[o];this.instruction(a)}}else if(_(r)){for(a in r){if(!L.call(r,a))continue;l=r[a];this.instruction(a,l)}}else{if(N(i)){i=i.apply()}c=new M(this,r,i);this.onData(this.writer.processingInstruction(c,this.writerOptions,this.currentLevel+1),this.currentLevel+1)}return this};XMLDocumentCB.prototype.declaration=function(r,i,o){var a;this.openCurrent();if(this.documentStarted){throw new Error("declaration() must be the first node.")}a=new g(this,r,i,o);this.onData(this.writer.declaration(a,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this};XMLDocumentCB.prototype.doctype=function(r,i,o){this.openCurrent();if(r==null){throw new Error("Missing root node name.")}if(this.root){throw new Error("dtd() must come before the root node.")}this.currentNode=new y(this,i,o);this.currentNode.rootNodeName=r;this.currentNode.children=false;this.currentLevel++;this.openTags[this.currentLevel]=this.currentNode;return this};XMLDocumentCB.prototype.dtdElement=function(r,i){var o;this.openCurrent();o=new d(this,r,i);this.onData(this.writer.dtdElement(o,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this};XMLDocumentCB.prototype.attList=function(r,i,o,a,l){var u;this.openCurrent();u=new h(this,r,i,o,a,l);this.onData(this.writer.dtdAttList(u,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this};XMLDocumentCB.prototype.entity=function(r,i){var o;this.openCurrent();o=new p(this,false,r,i);this.onData(this.writer.dtdEntity(o,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this};XMLDocumentCB.prototype.pEntity=function(r,i){var o;this.openCurrent();o=new p(this,true,r,i);this.onData(this.writer.dtdEntity(o,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this};XMLDocumentCB.prototype.notation=function(r,i){var o;this.openCurrent();o=new m(this,r,i);this.onData(this.writer.dtdNotation(o,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this};XMLDocumentCB.prototype.up=function(){if(this.currentLevel<0){throw new Error("The document node has no parent.")}if(this.currentNode){if(this.currentNode.children){this.closeNode(this.currentNode)}else{this.openNode(this.currentNode)}this.currentNode=null}else{this.closeNode(this.openTags[this.currentLevel])}delete this.openTags[this.currentLevel];this.currentLevel--;return this};XMLDocumentCB.prototype.end=function(){while(this.currentLevel>=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(r){var o,l,u,c;if(!r.isOpen){if(!this.root&&this.currentLevel===0&&r.type===i.Element){this.root=r}l="";if(r.type===i.Element){this.writerOptions.state=a.OpenTag;l=this.writer.indent(r,this.writerOptions,this.currentLevel)+"<"+r.name;c=r.attribs;for(u in c){if(!L.call(c,u))continue;o=c[u];l+=this.writer.attribute(o,this.writerOptions,this.currentLevel)}l+=(r.children?">":"/>")+this.writer.endline(r,this.writerOptions,this.currentLevel);this.writerOptions.state=a.InsideTag}else{this.writerOptions.state=a.OpenTag;l=this.writer.indent(r,this.writerOptions,this.currentLevel)+"<!DOCTYPE "+r.rootNodeName;if(r.pubID&&r.sysID){l+=' PUBLIC "'+r.pubID+'" "'+r.sysID+'"'}else if(r.sysID){l+=' SYSTEM "'+r.sysID+'"'}if(r.children){l+=" [";this.writerOptions.state=a.InsideTag}else{this.writerOptions.state=a.CloseTag;l+=">"}l+=this.writer.endline(r,this.writerOptions,this.currentLevel)}this.onData(l,this.currentLevel);return r.isOpen=true}};XMLDocumentCB.prototype.closeNode=function(r){var o;if(!r.isClosed){o="";this.writerOptions.state=a.CloseTag;if(r.type===i.Element){o=this.writer.indent(r,this.writerOptions,this.currentLevel)+"</"+r.name+">"+this.writer.endline(r,this.writerOptions,this.currentLevel)}else{o=this.writer.indent(r,this.writerOptions,this.currentLevel)+"]>"+this.writer.endline(r,this.writerOptions,this.currentLevel)}this.writerOptions.state=a.None;this.onData(o,this.currentLevel);return r.isClosed=true}};XMLDocumentCB.prototype.onData=function(r,i){this.documentStarted=true;return this.onDataCallback(r,i+1)};XMLDocumentCB.prototype.onEnd=function(){this.documentCompleted=true;return this.onEndCallback()};XMLDocumentCB.prototype.debugInfo=function(r){if(r==null){return""}else{return"node: <"+r+">"}};XMLDocumentCB.prototype.ele=function(){return this.element.apply(this,arguments)};XMLDocumentCB.prototype.nod=function(r,i,o){return this.node(r,i,o)};XMLDocumentCB.prototype.txt=function(r){return this.text(r)};XMLDocumentCB.prototype.dat=function(r){return this.cdata(r)};XMLDocumentCB.prototype.com=function(r){return this.comment(r)};XMLDocumentCB.prototype.ins=function(r,i){return this.instruction(r,i)};XMLDocumentCB.prototype.dec=function(r,i,o){return this.declaration(r,i,o)};XMLDocumentCB.prototype.dtd=function(r,i,o){return this.doctype(r,i,o)};XMLDocumentCB.prototype.e=function(r,i,o){return this.element(r,i,o)};XMLDocumentCB.prototype.n=function(r,i,o){return this.node(r,i,o)};XMLDocumentCB.prototype.t=function(r){return this.text(r)};XMLDocumentCB.prototype.d=function(r){return this.cdata(r)};XMLDocumentCB.prototype.c=function(r){return this.comment(r)};XMLDocumentCB.prototype.r=function(r){return this.raw(r)};XMLDocumentCB.prototype.i=function(r,i){return this.instruction(r,i)};XMLDocumentCB.prototype.att=function(){if(this.currentNode&&this.currentNode.type===i.DocType){return this.attList.apply(this,arguments)}else{return this.attribute.apply(this,arguments)}};XMLDocumentCB.prototype.a=function(){if(this.currentNode&&this.currentNode.type===i.DocType){return this.attList.apply(this,arguments)}else{return this.attribute.apply(this,arguments)}};XMLDocumentCB.prototype.ent=function(r,i){return this.entity(r,i)};XMLDocumentCB.prototype.pent=function(r,i){return this.pEntity(r,i)};XMLDocumentCB.prototype.not=function(r,i){return this.notation(r,i)};return XMLDocumentCB}()}).call(this)},3288:function(r,i,o){(function(){var i,a,l,extend=function(r,i){for(var o in i){if(u.call(i,o))r[o]=i[o]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},u={}.hasOwnProperty;l=o(8064);i=o(4128);r.exports=a=function(r){extend(XMLDummy,r);function XMLDummy(r){XMLDummy.__super__.constructor.call(this,r);this.type=i.Dummy}XMLDummy.prototype.clone=function(){return Object.create(this)};XMLDummy.prototype.toString=function(r){return""};return XMLDummy}(l)}).call(this)},7370:function(r,i,o){(function(){var i,a,l,u,c,h,d,p,m,extend=function(r,i){for(var o in i){if(g.call(i,o))r[o]=i[o]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},g={}.hasOwnProperty;m=o(2629),p=m.isObject,d=m.isFunction,h=m.getValue;c=o(8064);i=o(4128);a=o(9525);u=o(8339);r.exports=l=function(r){extend(XMLElement,r);function XMLElement(r,o,a){var l,u,c,h;XMLElement.__super__.constructor.call(this,r);if(o==null){throw new Error("Missing element name. "+this.debugInfo())}this.name=this.stringify.name(o);this.type=i.Element;this.attribs={};this.schemaTypeInfo=null;if(a!=null){this.attribute(a)}if(r.type===i.Document){this.isRoot=true;this.documentObject=r;r.rootObject=this;if(r.children){h=r.children;for(u=0,c=h.length;u<c;u++){l=h[u];if(l.type===i.DocType){l.name=this.name;break}}}}}Object.defineProperty(XMLElement.prototype,"tagName",{get:function(){return this.name}});Object.defineProperty(XMLElement.prototype,"namespaceURI",{get:function(){return""}});Object.defineProperty(XMLElement.prototype,"prefix",{get:function(){return""}});Object.defineProperty(XMLElement.prototype,"localName",{get:function(){return this.name}});Object.defineProperty(XMLElement.prototype,"id",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}});Object.defineProperty(XMLElement.prototype,"className",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}});Object.defineProperty(XMLElement.prototype,"classList",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}});Object.defineProperty(XMLElement.prototype,"attributes",{get:function(){if(!this.attributeMap||!this.attributeMap.nodes){this.attributeMap=new u(this.attribs)}return this.attributeMap}});XMLElement.prototype.clone=function(){var r,i,o,a;o=Object.create(this);if(o.isRoot){o.documentObject=null}o.attribs={};a=this.attribs;for(i in a){if(!g.call(a,i))continue;r=a[i];o.attribs[i]=r.clone()}o.children=[];this.children.forEach((function(r){var i;i=r.clone();i.parent=o;return o.children.push(i)}));return o};XMLElement.prototype.attribute=function(r,i){var o,l;if(r!=null){r=h(r)}if(p(r)){for(o in r){if(!g.call(r,o))continue;l=r[o];this.attribute(o,l)}}else{if(d(i)){i=i.apply()}if(this.options.keepNullAttributes&&i==null){this.attribs[r]=new a(this,r,"")}else if(i!=null){this.attribs[r]=new a(this,r,i)}}return this};XMLElement.prototype.removeAttribute=function(r){var i,o,a;if(r==null){throw new Error("Missing attribute name. "+this.debugInfo())}r=h(r);if(Array.isArray(r)){for(o=0,a=r.length;o<a;o++){i=r[o];delete this.attribs[i]}}else{delete this.attribs[r]}return this};XMLElement.prototype.toString=function(r){return this.options.writer.element(this,this.options.writer.filterOptions(r))};XMLElement.prototype.att=function(r,i){return this.attribute(r,i)};XMLElement.prototype.a=function(r,i){return this.attribute(r,i)};XMLElement.prototype.getAttribute=function(r){if(this.attribs.hasOwnProperty(r)){return this.attribs[r].value}else{return null}};XMLElement.prototype.setAttribute=function(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.getAttributeNode=function(r){if(this.attribs.hasOwnProperty(r)){return this.attribs[r]}else{return null}};XMLElement.prototype.setAttributeNode=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.removeAttributeNode=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.getElementsByTagName=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.getAttributeNS=function(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.setAttributeNS=function(r,i,o){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.removeAttributeNS=function(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.getAttributeNodeNS=function(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.setAttributeNodeNS=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.getElementsByTagNameNS=function(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.hasAttribute=function(r){return this.attribs.hasOwnProperty(r)};XMLElement.prototype.hasAttributeNS=function(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.setIdAttribute=function(r,i){if(this.attribs.hasOwnProperty(r)){return this.attribs[r].isId}else{return i}};XMLElement.prototype.setIdAttributeNS=function(r,i,o){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.setIdAttributeNode=function(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.getElementsByTagName=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.getElementsByTagNameNS=function(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.getElementsByClassName=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.isEqualNode=function(r){var i,o,a;if(!XMLElement.__super__.isEqualNode.apply(this,arguments).isEqualNode(r)){return false}if(r.namespaceURI!==this.namespaceURI){return false}if(r.prefix!==this.prefix){return false}if(r.localName!==this.localName){return false}if(r.attribs.length!==this.attribs.length){return false}for(i=o=0,a=this.attribs.length-1;0<=a?o<=a:o>=a;i=0<=a?++o:--o){if(!this.attribs[i].isEqualNode(r.attribs[i])){return false}}return true};return XMLElement}(c)}).call(this)},8339:function(r){(function(){var i;r.exports=i=function(){function XMLNamedNodeMap(r){this.nodes=r}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(r){return this.nodes[r]};XMLNamedNodeMap.prototype.setNamedItem=function(r){var i;i=this.nodes[r.nodeName];this.nodes[r.nodeName]=r;return i||null};XMLNamedNodeMap.prototype.removeNamedItem=function(r){var i;i=this.nodes[r];delete this.nodes[r];return i||null};XMLNamedNodeMap.prototype.item=function(r){return this.nodes[Object.keys(this.nodes)[r]]||null};XMLNamedNodeMap.prototype.getNamedItemNS=function(r,i){throw new Error("This DOM method is not implemented.")};XMLNamedNodeMap.prototype.setNamedItemNS=function(r){throw new Error("This DOM method is not implemented.")};XMLNamedNodeMap.prototype.removeNamedItemNS=function(r,i){throw new Error("This DOM method is not implemented.")};return XMLNamedNodeMap}()}).call(this)},8064:function(r,i,o){(function(){var i,a,l,u,c,h,d,p,m,g,y,v,b,w,M,E,D,T,x,O={}.hasOwnProperty;x=o(2629),T=x.isObject,D=x.isFunction,E=x.isEmpty,M=x.getValue;p=null;l=null;u=null;c=null;h=null;b=null;w=null;v=null;d=null;a=null;y=null;m=null;i=null;r.exports=g=function(){function XMLNode(r){this.parent=r;if(this.parent){this.options=this.parent.options;this.stringify=this.parent.stringify}this.value=null;this.children=[];this.baseURI=null;if(!p){p=o(7370);l=o(6789);u=o(4593);c=o(4972);h=o(9025);b=o(363);w=o(8854);v=o(3234);d=o(3288);a=o(4128);y=o(7209);m=o(8339);i=o(2346)}}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 y(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 r;r=this.parent.children.indexOf(this);return this.parent.children[r-1]||null}});Object.defineProperty(XMLNode.prototype,"nextSibling",{get:function(){var r;r=this.parent.children.indexOf(this);return this.parent.children[r+1]||null}});Object.defineProperty(XMLNode.prototype,"ownerDocument",{get:function(){return this.document()||null}});Object.defineProperty(XMLNode.prototype,"textContent",{get:function(){var r,i,o,l,u;if(this.nodeType===a.Element||this.nodeType===a.DocumentFragment){u="";l=this.children;for(i=0,o=l.length;i<o;i++){r=l[i];if(r.textContent){u+=r.textContent}}return u}else{return null}},set:function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}});XMLNode.prototype.setParent=function(r){var i,o,a,l,u;this.parent=r;if(r){this.options=r.options;this.stringify=r.stringify}l=this.children;u=[];for(o=0,a=l.length;o<a;o++){i=l[o];u.push(i.setParent(this))}return u};XMLNode.prototype.element=function(r,i,o){var a,l,u,c,h,d,p,m,g,y,v;d=null;if(i===null&&o==null){g=[{},null],i=g[0],o=g[1]}if(i==null){i={}}i=M(i);if(!T(i)){y=[i,o],o=y[0],i=y[1]}if(r!=null){r=M(r)}if(Array.isArray(r)){for(u=0,p=r.length;u<p;u++){l=r[u];d=this.element(l)}}else if(D(r)){d=this.element(r.apply())}else if(T(r)){for(h in r){if(!O.call(r,h))continue;v=r[h];if(D(v)){v=v.apply()}if(!this.options.ignoreDecorators&&this.stringify.convertAttKey&&h.indexOf(this.stringify.convertAttKey)===0){d=this.attribute(h.substr(this.stringify.convertAttKey.length),v)}else if(!this.options.separateArrayItems&&Array.isArray(v)&&E(v)){d=this.dummy()}else if(T(v)&&E(v)){d=this.element(h)}else if(!this.options.keepNullNodes&&v==null){d=this.dummy()}else if(!this.options.separateArrayItems&&Array.isArray(v)){for(c=0,m=v.length;c<m;c++){l=v[c];a={};a[h]=l;d=this.element(a)}}else if(T(v)){if(!this.options.ignoreDecorators&&this.stringify.convertTextKey&&h.indexOf(this.stringify.convertTextKey)===0){d=this.element(v)}else{d=this.element(h);d.element(v)}}else{d=this.element(h,v)}}}else if(!this.options.keepNullNodes&&o===null){d=this.dummy()}else{if(!this.options.ignoreDecorators&&this.stringify.convertTextKey&&r.indexOf(this.stringify.convertTextKey)===0){d=this.text(o)}else if(!this.options.ignoreDecorators&&this.stringify.convertCDataKey&&r.indexOf(this.stringify.convertCDataKey)===0){d=this.cdata(o)}else if(!this.options.ignoreDecorators&&this.stringify.convertCommentKey&&r.indexOf(this.stringify.convertCommentKey)===0){d=this.comment(o)}else if(!this.options.ignoreDecorators&&this.stringify.convertRawKey&&r.indexOf(this.stringify.convertRawKey)===0){d=this.raw(o)}else if(!this.options.ignoreDecorators&&this.stringify.convertPIKey&&r.indexOf(this.stringify.convertPIKey)===0){d=this.instruction(r.substr(this.stringify.convertPIKey.length),o)}else{d=this.node(r,i,o)}}if(d==null){throw new Error("Could not create any elements with: "+r+". "+this.debugInfo())}return d};XMLNode.prototype.insertBefore=function(r,i,o){var a,l,u,c,h;if(r!=null?r.type:void 0){u=r;c=i;u.setParent(this);if(c){l=children.indexOf(c);h=children.splice(l);children.push(u);Array.prototype.push.apply(children,h)}else{children.push(u)}return u}else{if(this.isRoot){throw new Error("Cannot insert elements at root level. "+this.debugInfo(r))}l=this.parent.children.indexOf(this);h=this.parent.children.splice(l);a=this.parent.element(r,i,o);Array.prototype.push.apply(this.parent.children,h);return a}};XMLNode.prototype.insertAfter=function(r,i,o){var a,l,u;if(this.isRoot){throw new Error("Cannot insert elements at root level. "+this.debugInfo(r))}l=this.parent.children.indexOf(this);u=this.parent.children.splice(l+1);a=this.parent.element(r,i,o);Array.prototype.push.apply(this.parent.children,u);return a};XMLNode.prototype.remove=function(){var r,i;if(this.isRoot){throw new Error("Cannot remove the root element. "+this.debugInfo())}r=this.parent.children.indexOf(this);[].splice.apply(this.parent.children,[r,r-r+1].concat(i=[])),i;return this.parent};XMLNode.prototype.node=function(r,i,o){var a,l;if(r!=null){r=M(r)}i||(i={});i=M(i);if(!T(i)){l=[i,o],o=l[0],i=l[1]}a=new p(this,r,i);if(o!=null){a.text(o)}this.children.push(a);return a};XMLNode.prototype.text=function(r){var i;if(T(r)){this.element(r)}i=new w(this,r);this.children.push(i);return this};XMLNode.prototype.cdata=function(r){var i;i=new l(this,r);this.children.push(i);return this};XMLNode.prototype.comment=function(r){var i;i=new u(this,r);this.children.push(i);return this};XMLNode.prototype.commentBefore=function(r){var i,o,a;o=this.parent.children.indexOf(this);a=this.parent.children.splice(o);i=this.parent.comment(r);Array.prototype.push.apply(this.parent.children,a);return this};XMLNode.prototype.commentAfter=function(r){var i,o,a;o=this.parent.children.indexOf(this);a=this.parent.children.splice(o+1);i=this.parent.comment(r);Array.prototype.push.apply(this.parent.children,a);return this};XMLNode.prototype.raw=function(r){var i;i=new b(this,r);this.children.push(i);return this};XMLNode.prototype.dummy=function(){var r;r=new d(this);return r};XMLNode.prototype.instruction=function(r,i){var o,a,l,u,c;if(r!=null){r=M(r)}if(i!=null){i=M(i)}if(Array.isArray(r)){for(u=0,c=r.length;u<c;u++){o=r[u];this.instruction(o)}}else if(T(r)){for(o in r){if(!O.call(r,o))continue;a=r[o];this.instruction(o,a)}}else{if(D(i)){i=i.apply()}l=new v(this,r,i);this.children.push(l)}return this};XMLNode.prototype.instructionBefore=function(r,i){var o,a,l;a=this.parent.children.indexOf(this);l=this.parent.children.splice(a);o=this.parent.instruction(r,i);Array.prototype.push.apply(this.parent.children,l);return this};XMLNode.prototype.instructionAfter=function(r,i){var o,a,l;a=this.parent.children.indexOf(this);l=this.parent.children.splice(a+1);o=this.parent.instruction(r,i);Array.prototype.push.apply(this.parent.children,l);return this};XMLNode.prototype.declaration=function(r,i,o){var l,u;l=this.document();u=new c(l,r,i,o);if(l.children.length===0){l.children.unshift(u)}else if(l.children[0].type===a.Declaration){l.children[0]=u}else{l.children.unshift(u)}return l.root()||l};XMLNode.prototype.dtd=function(r,i){var o,l,u,c,d,p,m,g,y,v;l=this.document();u=new h(l,r,i);y=l.children;for(c=d=0,m=y.length;d<m;c=++d){o=y[c];if(o.type===a.DocType){l.children[c]=u;return u}}v=l.children;for(c=p=0,g=v.length;p<g;c=++p){o=v[c];if(o.isRoot){l.children.splice(c,0,u);return u}}l.children.push(u);return u};XMLNode.prototype.up=function(){if(this.isRoot){throw new Error("The root node has no parent. Use doc() if you need to get the document object.")}return this.parent};XMLNode.prototype.root=function(){var r;r=this;while(r){if(r.type===a.Document){return r.rootObject}else if(r.isRoot){return r}else{r=r.parent}}};XMLNode.prototype.document=function(){var r;r=this;while(r){if(r.type===a.Document){return r}else{r=r.parent}}};XMLNode.prototype.end=function(r){return this.document().end(r)};XMLNode.prototype.prev=function(){var r;r=this.parent.children.indexOf(this);if(r<1){throw new Error("Already at the first node. "+this.debugInfo())}return this.parent.children[r-1]};XMLNode.prototype.next=function(){var r;r=this.parent.children.indexOf(this);if(r===-1||r===this.parent.children.length-1){throw new Error("Already at the last node. "+this.debugInfo())}return this.parent.children[r+1]};XMLNode.prototype.importDocument=function(r){var i;i=r.root().clone();i.parent=this;i.isRoot=false;this.children.push(i);return this};XMLNode.prototype.debugInfo=function(r){var i,o;r=r||this.name;if(r==null&&!((i=this.parent)!=null?i.name:void 0)){return""}else if(r==null){return"parent: <"+this.parent.name+">"}else if(!((o=this.parent)!=null?o.name:void 0)){return"node: <"+r+">"}else{return"node: <"+r+">, parent: <"+this.parent.name+">"}};XMLNode.prototype.ele=function(r,i,o){return this.element(r,i,o)};XMLNode.prototype.nod=function(r,i,o){return this.node(r,i,o)};XMLNode.prototype.txt=function(r){return this.text(r)};XMLNode.prototype.dat=function(r){return this.cdata(r)};XMLNode.prototype.com=function(r){return this.comment(r)};XMLNode.prototype.ins=function(r,i){return this.instruction(r,i)};XMLNode.prototype.doc=function(){return this.document()};XMLNode.prototype.dec=function(r,i,o){return this.declaration(r,i,o)};XMLNode.prototype.e=function(r,i,o){return this.element(r,i,o)};XMLNode.prototype.n=function(r,i,o){return this.node(r,i,o)};XMLNode.prototype.t=function(r){return this.text(r)};XMLNode.prototype.d=function(r){return this.cdata(r)};XMLNode.prototype.c=function(r){return this.comment(r)};XMLNode.prototype.r=function(r){return this.raw(r)};XMLNode.prototype.i=function(r,i){return this.instruction(r,i)};XMLNode.prototype.u=function(){return this.up()};XMLNode.prototype.importXMLBuilder=function(r){return this.importDocument(r)};XMLNode.prototype.replaceChild=function(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.removeChild=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.appendChild=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.hasChildNodes=function(){return this.children.length!==0};XMLNode.prototype.cloneNode=function(r){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(r,i){return true};XMLNode.prototype.hasAttributes=function(){return this.attribs.length!==0};XMLNode.prototype.compareDocumentPosition=function(r){var o,a;o=this;if(o===r){return 0}else if(this.document()!==r.document()){a=i.Disconnected|i.ImplementationSpecific;if(Math.random()<.5){a|=i.Preceding}else{a|=i.Following}return a}else if(o.isAncestor(r)){return i.Contains|i.Preceding}else if(o.isDescendant(r)){return i.Contains|i.Following}else if(o.isPreceding(r)){return i.Preceding}else{return i.Following}};XMLNode.prototype.isSameNode=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.lookupPrefix=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.isDefaultNamespace=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.lookupNamespaceURI=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.isEqualNode=function(r){var i,o,a;if(r.nodeType!==this.nodeType){return false}if(r.children.length!==this.children.length){return false}for(i=o=0,a=this.children.length-1;0<=a?o<=a:o>=a;i=0<=a?++o:--o){if(!this.children[i].isEqualNode(r.children[i])){return false}}return true};XMLNode.prototype.getFeature=function(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.setUserData=function(r,i,o){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.getUserData=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.contains=function(r){if(!r){return false}return r===this||this.isDescendant(r)};XMLNode.prototype.isDescendant=function(r){var i,o,a,l,u;u=this.children;for(a=0,l=u.length;a<l;a++){i=u[a];if(r===i){return true}o=i.isDescendant(r);if(o){return true}}return false};XMLNode.prototype.isAncestor=function(r){return r.isDescendant(this)};XMLNode.prototype.isPreceding=function(r){var i,o;i=this.treePosition(r);o=this.treePosition(this);if(i===-1||o===-1){return false}else{return i<o}};XMLNode.prototype.isFollowing=function(r){var i,o;i=this.treePosition(r);o=this.treePosition(this);if(i===-1||o===-1){return false}else{return i>o}};XMLNode.prototype.treePosition=function(r){var i,o;o=0;i=false;this.foreachTreeNode(this.document(),(function(a){o++;if(!i&&a===r){return i=true}}));if(i){return o}else{return-1}};XMLNode.prototype.foreachTreeNode=function(r,i){var o,a,l,u,c;r||(r=this.document());u=r.children;for(a=0,l=u.length;a<l;a++){o=u[a];if(c=i(o)){return c}else{c=this.foreachTreeNode(o,i);if(c){return c}}}};return XMLNode}()}).call(this)},7209:function(r){(function(){var i;r.exports=i=function(){function XMLNodeList(r){this.nodes=r}Object.defineProperty(XMLNodeList.prototype,"length",{get:function(){return this.nodes.length||0}});XMLNodeList.prototype.clone=function(){return this.nodes=null};XMLNodeList.prototype.item=function(r){return this.nodes[r]||null};return XMLNodeList}()}).call(this)},3234:function(r,i,o){(function(){var i,a,l,extend=function(r,i){for(var o in i){if(u.call(i,o))r[o]=i[o]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},u={}.hasOwnProperty;i=o(4128);a=o(3527);r.exports=l=function(r){extend(XMLProcessingInstruction,r);function XMLProcessingInstruction(r,o,a){XMLProcessingInstruction.__super__.constructor.call(this,r);if(o==null){throw new Error("Missing instruction target. "+this.debugInfo())}this.type=i.ProcessingInstruction;this.target=this.stringify.insTarget(o);this.name=this.target;if(a){this.value=this.stringify.insValue(a)}}XMLProcessingInstruction.prototype.clone=function(){return Object.create(this)};XMLProcessingInstruction.prototype.toString=function(r){return this.options.writer.processingInstruction(this,this.options.writer.filterOptions(r))};XMLProcessingInstruction.prototype.isEqualNode=function(r){if(!XMLProcessingInstruction.__super__.isEqualNode.apply(this,arguments).isEqualNode(r)){return false}if(r.target!==this.target){return false}return true};return XMLProcessingInstruction}(a)}).call(this)},363:function(r,i,o){(function(){var i,a,l,extend=function(r,i){for(var o in i){if(u.call(i,o))r[o]=i[o]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},u={}.hasOwnProperty;i=o(4128);a=o(8064);r.exports=l=function(r){extend(XMLRaw,r);function XMLRaw(r,o){XMLRaw.__super__.constructor.call(this,r);if(o==null){throw new Error("Missing raw text. "+this.debugInfo())}this.type=i.Raw;this.value=this.stringify.raw(o)}XMLRaw.prototype.clone=function(){return Object.create(this)};XMLRaw.prototype.toString=function(r){return this.options.writer.raw(this,this.options.writer.filterOptions(r))};return XMLRaw}(a)}).call(this)},359:function(r,i,o){(function(){var i,a,l,u,extend=function(r,i){for(var o in i){if(c.call(i,o))r[o]=i[o]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},c={}.hasOwnProperty;i=o(4128);u=o(8126);a=o(8413);r.exports=l=function(r){extend(XMLStreamWriter,r);function XMLStreamWriter(r,i){this.stream=r;XMLStreamWriter.__super__.constructor.call(this,i)}XMLStreamWriter.prototype.endline=function(r,i,o){if(r.isLastRootNode&&i.state===a.CloseTag){return""}else{return XMLStreamWriter.__super__.endline.call(this,r,i,o)}};XMLStreamWriter.prototype.document=function(r,i){var o,a,l,u,c,h,d,p,m;d=r.children;for(a=l=0,c=d.length;l<c;a=++l){o=d[a];o.isLastRootNode=a===r.children.length-1}i=this.filterOptions(i);p=r.children;m=[];for(u=0,h=p.length;u<h;u++){o=p[u];m.push(this.writeChildNode(o,i,0))}return m};XMLStreamWriter.prototype.attribute=function(r,i,o){return this.stream.write(XMLStreamWriter.__super__.attribute.call(this,r,i,o))};XMLStreamWriter.prototype.cdata=function(r,i,o){return this.stream.write(XMLStreamWriter.__super__.cdata.call(this,r,i,o))};XMLStreamWriter.prototype.comment=function(r,i,o){return this.stream.write(XMLStreamWriter.__super__.comment.call(this,r,i,o))};XMLStreamWriter.prototype.declaration=function(r,i,o){return this.stream.write(XMLStreamWriter.__super__.declaration.call(this,r,i,o))};XMLStreamWriter.prototype.docType=function(r,i,o){var l,u,c,h;o||(o=0);this.openNode(r,i,o);i.state=a.OpenTag;this.stream.write(this.indent(r,i,o));this.stream.write("<!DOCTYPE "+r.root().name);if(r.pubID&&r.sysID){this.stream.write(' PUBLIC "'+r.pubID+'" "'+r.sysID+'"')}else if(r.sysID){this.stream.write(' SYSTEM "'+r.sysID+'"')}if(r.children.length>0){this.stream.write(" [");this.stream.write(this.endline(r,i,o));i.state=a.InsideTag;h=r.children;for(u=0,c=h.length;u<c;u++){l=h[u];this.writeChildNode(l,i,o+1)}i.state=a.CloseTag;this.stream.write("]")}i.state=a.CloseTag;this.stream.write(i.spaceBeforeSlash+">");this.stream.write(this.endline(r,i,o));i.state=a.None;return this.closeNode(r,i,o)};XMLStreamWriter.prototype.element=function(r,o,l){var u,h,d,p,m,g,y,v,b,w;l||(l=0);this.openNode(r,o,l);o.state=a.OpenTag;this.stream.write(this.indent(r,o,l)+"<"+r.name);b=r.attribs;for(y in b){if(!c.call(b,y))continue;u=b[y];this.attribute(u,o,l)}d=r.children.length;p=d===0?null:r.children[0];if(d===0||r.children.every((function(r){return(r.type===i.Text||r.type===i.Raw)&&r.value===""}))){if(o.allowEmpty){this.stream.write(">");o.state=a.CloseTag;this.stream.write("</"+r.name+">")}else{o.state=a.CloseTag;this.stream.write(o.spaceBeforeSlash+"/>")}}else if(o.pretty&&d===1&&(p.type===i.Text||p.type===i.Raw)&&p.value!=null){this.stream.write(">");o.state=a.InsideTag;o.suppressPrettyCount++;v=true;this.writeChildNode(p,o,l+1);o.suppressPrettyCount--;v=false;o.state=a.CloseTag;this.stream.write("</"+r.name+">")}else{this.stream.write(">"+this.endline(r,o,l));o.state=a.InsideTag;w=r.children;for(m=0,g=w.length;m<g;m++){h=w[m];this.writeChildNode(h,o,l+1)}o.state=a.CloseTag;this.stream.write(this.indent(r,o,l)+"</"+r.name+">")}this.stream.write(this.endline(r,o,l));o.state=a.None;return this.closeNode(r,o,l)};XMLStreamWriter.prototype.processingInstruction=function(r,i,o){return this.stream.write(XMLStreamWriter.__super__.processingInstruction.call(this,r,i,o))};XMLStreamWriter.prototype.raw=function(r,i,o){return this.stream.write(XMLStreamWriter.__super__.raw.call(this,r,i,o))};XMLStreamWriter.prototype.text=function(r,i,o){return this.stream.write(XMLStreamWriter.__super__.text.call(this,r,i,o))};XMLStreamWriter.prototype.dtdAttList=function(r,i,o){return this.stream.write(XMLStreamWriter.__super__.dtdAttList.call(this,r,i,o))};XMLStreamWriter.prototype.dtdElement=function(r,i,o){return this.stream.write(XMLStreamWriter.__super__.dtdElement.call(this,r,i,o))};XMLStreamWriter.prototype.dtdEntity=function(r,i,o){return this.stream.write(XMLStreamWriter.__super__.dtdEntity.call(this,r,i,o))};XMLStreamWriter.prototype.dtdNotation=function(r,i,o){return this.stream.write(XMLStreamWriter.__super__.dtdNotation.call(this,r,i,o))};return XMLStreamWriter}(u)}).call(this)},6939:function(r,i,o){(function(){var i,a,extend=function(r,i){for(var o in i){if(l.call(i,o))r[o]=i[o]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},l={}.hasOwnProperty;a=o(8126);r.exports=i=function(r){extend(XMLStringWriter,r);function XMLStringWriter(r){XMLStringWriter.__super__.constructor.call(this,r)}XMLStringWriter.prototype.document=function(r,i){var o,a,l,u,c;i=this.filterOptions(i);u="";c=r.children;for(a=0,l=c.length;a<l;a++){o=c[a];u+=this.writeChildNode(o,i,0)}if(i.pretty&&u.slice(-i.newline.length)===i.newline){u=u.slice(0,-i.newline.length)}return u};return XMLStringWriter}(a)}).call(this)},916:function(r){(function(){var i,bind=function(r,i){return function(){return r.apply(i,arguments)}},o={}.hasOwnProperty;r.exports=i=function(){function XMLStringifier(r){this.assertLegalName=bind(this.assertLegalName,this);this.assertLegalChar=bind(this.assertLegalChar,this);var i,a,l;r||(r={});this.options=r;if(!this.options.version){this.options.version="1.0"}a=r.stringify||{};for(i in a){if(!o.call(a,i))continue;l=a[i];this[i]=l}}XMLStringifier.prototype.name=function(r){if(this.options.noValidation){return r}return this.assertLegalName(""+r||"")};XMLStringifier.prototype.text=function(r){if(this.options.noValidation){return r}return this.assertLegalChar(this.textEscape(""+r||""))};XMLStringifier.prototype.cdata=function(r){if(this.options.noValidation){return r}r=""+r||"";r=r.replace("]]>","]]]]><![CDATA[>");return this.assertLegalChar(r)};XMLStringifier.prototype.comment=function(r){if(this.options.noValidation){return r}r=""+r||"";if(r.match(/--/)){throw new Error("Comment text cannot contain double-hypen: "+r)}return this.assertLegalChar(r)};XMLStringifier.prototype.raw=function(r){if(this.options.noValidation){return r}return""+r||""};XMLStringifier.prototype.attValue=function(r){if(this.options.noValidation){return r}return this.assertLegalChar(this.attEscape(r=""+r||""))};XMLStringifier.prototype.insTarget=function(r){if(this.options.noValidation){return r}return this.assertLegalChar(""+r||"")};XMLStringifier.prototype.insValue=function(r){if(this.options.noValidation){return r}r=""+r||"";if(r.match(/\?>/)){throw new Error("Invalid processing instruction value: "+r)}return this.assertLegalChar(r)};XMLStringifier.prototype.xmlVersion=function(r){if(this.options.noValidation){return r}r=""+r||"";if(!r.match(/1\.[0-9]+/)){throw new Error("Invalid version number: "+r)}return r};XMLStringifier.prototype.xmlEncoding=function(r){if(this.options.noValidation){return r}r=""+r||"";if(!r.match(/^[A-Za-z](?:[A-Za-z0-9._-])*$/)){throw new Error("Invalid encoding: "+r)}return this.assertLegalChar(r)};XMLStringifier.prototype.xmlStandalone=function(r){if(this.options.noValidation){return r}if(r){return"yes"}else{return"no"}};XMLStringifier.prototype.dtdPubID=function(r){if(this.options.noValidation){return r}return this.assertLegalChar(""+r||"")};XMLStringifier.prototype.dtdSysID=function(r){if(this.options.noValidation){return r}return this.assertLegalChar(""+r||"")};XMLStringifier.prototype.dtdElementValue=function(r){if(this.options.noValidation){return r}return this.assertLegalChar(""+r||"")};XMLStringifier.prototype.dtdAttType=function(r){if(this.options.noValidation){return r}return this.assertLegalChar(""+r||"")};XMLStringifier.prototype.dtdAttDefault=function(r){if(this.options.noValidation){return r}return this.assertLegalChar(""+r||"")};XMLStringifier.prototype.dtdEntityValue=function(r){if(this.options.noValidation){return r}return this.assertLegalChar(""+r||"")};XMLStringifier.prototype.dtdNData=function(r){if(this.options.noValidation){return r}return this.assertLegalChar(""+r||"")};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(r){var i,o;if(this.options.noValidation){return r}i="";if(this.options.version==="1.0"){i=/[\0-\x08\x0B\f\x0E-\x1F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;if(o=r.match(i)){throw new Error("Invalid character in string: "+r+" at index "+o.index)}}else if(this.options.version==="1.1"){i=/[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;if(o=r.match(i)){throw new Error("Invalid character in string: "+r+" at index "+o.index)}}return r};XMLStringifier.prototype.assertLegalName=function(r){var i;if(this.options.noValidation){return r}this.assertLegalChar(r);i=/^([: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(!r.match(i)){throw new Error("Invalid character in name")}return r};XMLStringifier.prototype.textEscape=function(r){var i;if(this.options.noValidation){return r}i=this.options.noDoubleEncoding?/(?!&\S+;)&/g:/&/g;return r.replace(i,"&").replace(/</g,"<").replace(/>/g,">").replace(/\r/g,"
")};XMLStringifier.prototype.attEscape=function(r){var i;if(this.options.noValidation){return r}i=this.options.noDoubleEncoding?/(?!&\S+;)&/g:/&/g;return r.replace(i,"&").replace(/</g,"<").replace(/"/g,""").replace(/\t/g,"	").replace(/\n/g,"
").replace(/\r/g,"
")};return XMLStringifier}()}).call(this)},8854:function(r,i,o){(function(){var i,a,l,extend=function(r,i){for(var o in i){if(u.call(i,o))r[o]=i[o]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},u={}.hasOwnProperty;i=o(4128);a=o(3527);r.exports=l=function(r){extend(XMLText,r);function XMLText(r,o){XMLText.__super__.constructor.call(this,r);if(o==null){throw new Error("Missing element text. "+this.debugInfo())}this.name="#text";this.type=i.Text;this.value=this.stringify.text(o)}Object.defineProperty(XMLText.prototype,"isElementContentWhitespace",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}});Object.defineProperty(XMLText.prototype,"wholeText",{get:function(){var r,i,o;o="";i=this.previousSibling;while(i){o=i.data+o;i=i.previousSibling}o+=this.data;r=this.nextSibling;while(r){o=o+r.data;r=r.nextSibling}return o}});XMLText.prototype.clone=function(){return Object.create(this)};XMLText.prototype.toString=function(r){return this.options.writer.text(this,this.options.writer.filterOptions(r))};XMLText.prototype.splitText=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLText.prototype.replaceWholeText=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};return XMLText}(a)}).call(this)},8126:function(r,i,o){(function(){var i,a,l,u,c,h,d,p,m,g,y,v,b,w,M,E,D,T={}.hasOwnProperty;D=o(2629).assign;i=o(4128);m=o(4972);g=o(9025);l=o(6789);u=o(4593);v=o(7370);w=o(363);M=o(8854);b=o(3234);y=o(3288);c=o(1066);h=o(3584);d=o(9346);p=o(853);a=o(8413);r.exports=E=function(){function XMLWriterBase(r){var i,o,a;r||(r={});this.options=r;o=r.writer||{};for(i in o){if(!T.call(o,i))continue;a=o[i];this["_"+i]=this[i];this[i]=a}}XMLWriterBase.prototype.filterOptions=function(r){var i,o,l,u,c,h,d,p;r||(r={});r=D({},this.options,r);i={writer:this};i.pretty=r.pretty||false;i.allowEmpty=r.allowEmpty||false;i.indent=(o=r.indent)!=null?o:" ";i.newline=(l=r.newline)!=null?l:"\n";i.offset=(u=r.offset)!=null?u:0;i.dontPrettyTextNodes=(c=(h=r.dontPrettyTextNodes)!=null?h:r.dontprettytextnodes)!=null?c:0;i.spaceBeforeSlash=(d=(p=r.spaceBeforeSlash)!=null?p:r.spacebeforeslash)!=null?d:"";if(i.spaceBeforeSlash===true){i.spaceBeforeSlash=" "}i.suppressPrettyCount=0;i.user={};i.state=a.None;return i};XMLWriterBase.prototype.indent=function(r,i,o){var a;if(!i.pretty||i.suppressPrettyCount){return""}else if(i.pretty){a=(o||0)+i.offset+1;if(a>0){return new Array(a).join(i.indent)}}return""};XMLWriterBase.prototype.endline=function(r,i,o){if(!i.pretty||i.suppressPrettyCount){return""}else{return i.newline}};XMLWriterBase.prototype.attribute=function(r,i,o){var a;this.openAttribute(r,i,o);a=" "+r.name+'="'+r.value+'"';this.closeAttribute(r,i,o);return a};XMLWriterBase.prototype.cdata=function(r,i,o){var l;this.openNode(r,i,o);i.state=a.OpenTag;l=this.indent(r,i,o)+"<![CDATA[";i.state=a.InsideTag;l+=r.value;i.state=a.CloseTag;l+="]]>"+this.endline(r,i,o);i.state=a.None;this.closeNode(r,i,o);return l};XMLWriterBase.prototype.comment=function(r,i,o){var l;this.openNode(r,i,o);i.state=a.OpenTag;l=this.indent(r,i,o)+"\x3c!-- ";i.state=a.InsideTag;l+=r.value;i.state=a.CloseTag;l+=" --\x3e"+this.endline(r,i,o);i.state=a.None;this.closeNode(r,i,o);return l};XMLWriterBase.prototype.declaration=function(r,i,o){var l;this.openNode(r,i,o);i.state=a.OpenTag;l=this.indent(r,i,o)+"<?xml";i.state=a.InsideTag;l+=' version="'+r.version+'"';if(r.encoding!=null){l+=' encoding="'+r.encoding+'"'}if(r.standalone!=null){l+=' standalone="'+r.standalone+'"'}i.state=a.CloseTag;l+=i.spaceBeforeSlash+"?>";l+=this.endline(r,i,o);i.state=a.None;this.closeNode(r,i,o);return l};XMLWriterBase.prototype.docType=function(r,i,o){var l,u,c,h,d;o||(o=0);this.openNode(r,i,o);i.state=a.OpenTag;h=this.indent(r,i,o);h+="<!DOCTYPE "+r.root().name;if(r.pubID&&r.sysID){h+=' PUBLIC "'+r.pubID+'" "'+r.sysID+'"'}else if(r.sysID){h+=' SYSTEM "'+r.sysID+'"'}if(r.children.length>0){h+=" [";h+=this.endline(r,i,o);i.state=a.InsideTag;d=r.children;for(u=0,c=d.length;u<c;u++){l=d[u];h+=this.writeChildNode(l,i,o+1)}i.state=a.CloseTag;h+="]"}i.state=a.CloseTag;h+=i.spaceBeforeSlash+">";h+=this.endline(r,i,o);i.state=a.None;this.closeNode(r,i,o);return h};XMLWriterBase.prototype.element=function(r,o,l){var u,c,h,d,p,m,g,y,v,b,w,M,E,D;l||(l=0);b=false;w="";this.openNode(r,o,l);o.state=a.OpenTag;w+=this.indent(r,o,l)+"<"+r.name;M=r.attribs;for(v in M){if(!T.call(M,v))continue;u=M[v];w+=this.attribute(u,o,l)}h=r.children.length;d=h===0?null:r.children[0];if(h===0||r.children.every((function(r){return(r.type===i.Text||r.type===i.Raw)&&r.value===""}))){if(o.allowEmpty){w+=">";o.state=a.CloseTag;w+="</"+r.name+">"+this.endline(r,o,l)}else{o.state=a.CloseTag;w+=o.spaceBeforeSlash+"/>"+this.endline(r,o,l)}}else if(o.pretty&&h===1&&(d.type===i.Text||d.type===i.Raw)&&d.value!=null){w+=">";o.state=a.InsideTag;o.suppressPrettyCount++;b=true;w+=this.writeChildNode(d,o,l+1);o.suppressPrettyCount--;b=false;o.state=a.CloseTag;w+="</"+r.name+">"+this.endline(r,o,l)}else{if(o.dontPrettyTextNodes){E=r.children;for(p=0,g=E.length;p<g;p++){c=E[p];if((c.type===i.Text||c.type===i.Raw)&&c.value!=null){o.suppressPrettyCount++;b=true;break}}}w+=">"+this.endline(r,o,l);o.state=a.InsideTag;D=r.children;for(m=0,y=D.length;m<y;m++){c=D[m];w+=this.writeChildNode(c,o,l+1)}o.state=a.CloseTag;w+=this.indent(r,o,l)+"</"+r.name+">";if(b){o.suppressPrettyCount--}w+=this.endline(r,o,l);o.state=a.None}this.closeNode(r,o,l);return w};XMLWriterBase.prototype.writeChildNode=function(r,o,a){switch(r.type){case i.CData:return this.cdata(r,o,a);case i.Comment:return this.comment(r,o,a);case i.Element:return this.element(r,o,a);case i.Raw:return this.raw(r,o,a);case i.Text:return this.text(r,o,a);case i.ProcessingInstruction:return this.processingInstruction(r,o,a);case i.Dummy:return"";case i.Declaration:return this.declaration(r,o,a);case i.DocType:return this.docType(r,o,a);case i.AttributeDeclaration:return this.dtdAttList(r,o,a);case i.ElementDeclaration:return this.dtdElement(r,o,a);case i.EntityDeclaration:return this.dtdEntity(r,o,a);case i.NotationDeclaration:return this.dtdNotation(r,o,a);default:throw new Error("Unknown XML node type: "+r.constructor.name)}};XMLWriterBase.prototype.processingInstruction=function(r,i,o){var l;this.openNode(r,i,o);i.state=a.OpenTag;l=this.indent(r,i,o)+"<?";i.state=a.InsideTag;l+=r.target;if(r.value){l+=" "+r.value}i.state=a.CloseTag;l+=i.spaceBeforeSlash+"?>";l+=this.endline(r,i,o);i.state=a.None;this.closeNode(r,i,o);return l};XMLWriterBase.prototype.raw=function(r,i,o){var l;this.openNode(r,i,o);i.state=a.OpenTag;l=this.indent(r,i,o);i.state=a.InsideTag;l+=r.value;i.state=a.CloseTag;l+=this.endline(r,i,o);i.state=a.None;this.closeNode(r,i,o);return l};XMLWriterBase.prototype.text=function(r,i,o){var l;this.openNode(r,i,o);i.state=a.OpenTag;l=this.indent(r,i,o);i.state=a.InsideTag;l+=r.value;i.state=a.CloseTag;l+=this.endline(r,i,o);i.state=a.None;this.closeNode(r,i,o);return l};XMLWriterBase.prototype.dtdAttList=function(r,i,o){var l;this.openNode(r,i,o);i.state=a.OpenTag;l=this.indent(r,i,o)+"<!ATTLIST";i.state=a.InsideTag;l+=" "+r.elementName+" "+r.attributeName+" "+r.attributeType;if(r.defaultValueType!=="#DEFAULT"){l+=" "+r.defaultValueType}if(r.defaultValue){l+=' "'+r.defaultValue+'"'}i.state=a.CloseTag;l+=i.spaceBeforeSlash+">"+this.endline(r,i,o);i.state=a.None;this.closeNode(r,i,o);return l};XMLWriterBase.prototype.dtdElement=function(r,i,o){var l;this.openNode(r,i,o);i.state=a.OpenTag;l=this.indent(r,i,o)+"<!ELEMENT";i.state=a.InsideTag;l+=" "+r.name+" "+r.value;i.state=a.CloseTag;l+=i.spaceBeforeSlash+">"+this.endline(r,i,o);i.state=a.None;this.closeNode(r,i,o);return l};XMLWriterBase.prototype.dtdEntity=function(r,i,o){var l;this.openNode(r,i,o);i.state=a.OpenTag;l=this.indent(r,i,o)+"<!ENTITY";i.state=a.InsideTag;if(r.pe){l+=" %"}l+=" "+r.name;if(r.value){l+=' "'+r.value+'"'}else{if(r.pubID&&r.sysID){l+=' PUBLIC "'+r.pubID+'" "'+r.sysID+'"'}else if(r.sysID){l+=' SYSTEM "'+r.sysID+'"'}if(r.nData){l+=" NDATA "+r.nData}}i.state=a.CloseTag;l+=i.spaceBeforeSlash+">"+this.endline(r,i,o);i.state=a.None;this.closeNode(r,i,o);return l};XMLWriterBase.prototype.dtdNotation=function(r,i,o){var l;this.openNode(r,i,o);i.state=a.OpenTag;l=this.indent(r,i,o)+"<!NOTATION";i.state=a.InsideTag;l+=" "+r.name;if(r.pubID&&r.sysID){l+=' PUBLIC "'+r.pubID+'" "'+r.sysID+'"'}else if(r.pubID){l+=' PUBLIC "'+r.pubID+'"'}else if(r.sysID){l+=' SYSTEM "'+r.sysID+'"'}i.state=a.CloseTag;l+=i.spaceBeforeSlash+">"+this.endline(r,i,o);i.state=a.None;this.closeNode(r,i,o);return l};XMLWriterBase.prototype.openNode=function(r,i,o){};XMLWriterBase.prototype.closeNode=function(r,i,o){};XMLWriterBase.prototype.openAttribute=function(r,i,o){};XMLWriterBase.prototype.closeAttribute=function(r,i,o){};return XMLWriterBase}()}).call(this)},3131:function(r,i,o){(function(){var i,a,l,u,c,h,d,p,m,g;g=o(2629),p=g.assign,m=g.isFunction;l=o(9490);u=o(3315);c=o(1523);d=o(6939);h=o(359);i=o(4128);a=o(8413);r.exports.create=function(r,i,o,a){var l,c;if(r==null){throw new Error("Root element needs a name.")}a=p({},i,o,a);l=new u(a);c=l.element(r);if(!a.headless){l.declaration(a);if(a.pubID!=null||a.sysID!=null){l.dtd(a)}}return c};r.exports.begin=function(r,i,o){var a;if(m(r)){a=[r,i],i=a[0],o=a[1];r={}}if(i){return new c(r,i,o)}else{return new u(r)}};r.exports.stringWriter=function(r){return new d(r)};r.exports.streamWriter=function(r,i){return new h(r,i)};r.exports.implementation=new l;r.exports.nodeType=i;r.exports.writerState=a}).call(this)},144:function(r){(function(){r.exports={Disconnected:1,Preceding:2,Following:4,Contains:8,ContainedBy:16,ImplementationSpecific:32}}).call(this)},7762:function(r){(function(){r.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)},983:function(r){(function(){var i,o,a,l,u,c,h,d={}.hasOwnProperty;i=function(r,...i){var o,a,l,c;if(u(Object.assign)){Object.assign.apply(null,arguments)}else{for(o=0,l=i.length;o<l;o++){c=i[o];if(c!=null){for(a in c){if(!d.call(c,a))continue;r[a]=c[a]}}}}return r};u=function(r){return!!r&&Object.prototype.toString.call(r)==="[object Function]"};c=function(r){var i;return!!r&&((i=typeof r)==="function"||i==="object")};a=function(r){if(u(Array.isArray)){return Array.isArray(r)}else{return Object.prototype.toString.call(r)==="[object Array]"}};l=function(r){var i;if(a(r)){return!r.length}else{for(i in r){if(!d.call(r,i))continue;return false}return true}};h=function(r){var i,o;return c(r)&&(o=Object.getPrototypeOf(r))&&(i=o.constructor)&&typeof i==="function"&&i instanceof i&&Function.prototype.toString.call(i)===Function.prototype.toString.call(Object)};o=function(r){if(u(r.valueOf)){return r.valueOf()}else{return r}};r.exports.assign=i;r.exports.isFunction=u;r.exports.isObject=c;r.exports.isArray=a;r.exports.isEmpty=l;r.exports.isPlainObject=h;r.exports.getValue=o}).call(this)},140:function(r){(function(){r.exports={None:0,OpenTag:1,InsideTag:2,CloseTag:3}}).call(this)},1395:function(r,i,o){(function(){var i,a,l;i=o(7762);l=o(5089);r.exports=a=function(){class XMLAttribute{constructor(r,o,a){this.parent=r;if(this.parent){this.options=this.parent.options;this.stringify=this.parent.stringify}if(o==null){throw new Error("Missing attribute name. "+this.debugInfo(o))}this.name=this.stringify.name(o);this.value=this.stringify.attValue(a);this.type=i.Attribute;this.isId=false;this.schemaTypeInfo=null}clone(){return Object.create(this)}toString(r){return this.options.writer.attribute(this,this.options.writer.filterOptions(r))}debugInfo(r){r=r||this.name;if(r==null){return"parent: <"+this.parent.name+">"}else{return"attribute: {"+r+"}, parent: <"+this.parent.name+">"}}isEqualNode(r){if(r.namespaceURI!==this.namespaceURI){return false}if(r.prefix!==this.prefix){return false}if(r.localName!==this.localName){return false}if(r.value!==this.value){return false}return true}}Object.defineProperty(XMLAttribute.prototype,"nodeType",{get:function(){return this.type}});Object.defineProperty(XMLAttribute.prototype,"ownerElement",{get:function(){return this.parent}});Object.defineProperty(XMLAttribute.prototype,"textContent",{get:function(){return this.value},set:function(r){return this.value=r||""}});Object.defineProperty(XMLAttribute.prototype,"namespaceURI",{get:function(){return""}});Object.defineProperty(XMLAttribute.prototype,"prefix",{get:function(){return""}});Object.defineProperty(XMLAttribute.prototype,"localName",{get:function(){return this.name}});Object.defineProperty(XMLAttribute.prototype,"specified",{get:function(){return true}});return XMLAttribute}.call(this)}).call(this)},5261:function(r,i,o){(function(){var i,a,l;i=o(7762);l=o(4765);r.exports=a=class XMLCData extends l{constructor(r,o){super(r);if(o==null){throw new Error("Missing CDATA text. "+this.debugInfo())}this.name="#cdata-section";this.type=i.CData;this.value=this.stringify.cdata(o)}clone(){return Object.create(this)}toString(r){return this.options.writer.cdata(this,this.options.writer.filterOptions(r))}}}).call(this)},4765:function(r,i,o){(function(){var i,a;a=o(5089);r.exports=i=function(){class XMLCharacterData extends a{constructor(r){super(r);this.value=""}clone(){return Object.create(this)}substringData(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())}appendData(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}insertData(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())}deleteData(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())}replaceData(r,i,o){throw new Error("This DOM method is not implemented."+this.debugInfo())}isEqualNode(r){if(!super.isEqualNode(r)){return false}if(r.data!==this.data){return false}return true}}Object.defineProperty(XMLCharacterData.prototype,"data",{get:function(){return this.value},set:function(r){return this.value=r||""}});Object.defineProperty(XMLCharacterData.prototype,"length",{get:function(){return this.value.length}});Object.defineProperty(XMLCharacterData.prototype,"textContent",{get:function(){return this.value},set:function(r){return this.value=r||""}});return XMLCharacterData}.call(this)}).call(this)},360:function(r,i,o){(function(){var i,a,l;i=o(7762);a=o(4765);r.exports=l=class XMLComment extends a{constructor(r,o){super(r);if(o==null){throw new Error("Missing comment text. "+this.debugInfo())}this.name="#comment";this.type=i.Comment;this.value=this.stringify.comment(o)}clone(){return Object.create(this)}toString(r){return this.options.writer.comment(this,this.options.writer.filterOptions(r))}}}).call(this)},5675:function(r,i,o){(function(){var i,a,l;a=o(121);l=o(8207);r.exports=i=function(){class XMLDOMConfiguration{constructor(){var r;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=r=Object.create(this.defaultParams)}getParameter(r){if(this.params.hasOwnProperty(r)){return this.params[r]}else{return null}}canSetParameter(r,i){return true}setParameter(r,i){if(i!=null){return this.params[r]=i}else{return delete this.params[r]}}}Object.defineProperty(XMLDOMConfiguration.prototype,"parameterNames",{get:function(){return new l(Object.keys(this.defaultParams))}});return XMLDOMConfiguration}.call(this)}).call(this)},121:function(r){(function(){var i;r.exports=i=class XMLDOMErrorHandler{constructor(){}handleError(r){throw new Error(r)}}}).call(this)},2692:function(r){(function(){var i;r.exports=i=class XMLDOMImplementation{hasFeature(r,i){return true}createDocumentType(r,i,o){throw new Error("This DOM method is not implemented.")}createDocument(r,i,o){throw new Error("This DOM method is not implemented.")}createHTMLDocument(r){throw new Error("This DOM method is not implemented.")}getFeature(r,i){throw new Error("This DOM method is not implemented.")}}}).call(this)},8207:function(r){(function(){var i;r.exports=i=function(){class XMLDOMStringList{constructor(r){this.arr=r||[]}item(r){return this.arr[r]||null}contains(r){return this.arr.indexOf(r)!==-1}}Object.defineProperty(XMLDOMStringList.prototype,"length",{get:function(){return this.arr.length}});return XMLDOMStringList}.call(this)}).call(this)},2529:function(r,i,o){(function(){var i,a,l;l=o(5089);i=o(7762);r.exports=a=class XMLDTDAttList extends l{constructor(r,o,a,l,u,c){super(r);if(o==null){throw new Error("Missing DTD element name. "+this.debugInfo())}if(a==null){throw new Error("Missing DTD attribute name. "+this.debugInfo(o))}if(!l){throw new Error("Missing DTD attribute type. "+this.debugInfo(o))}if(!u){throw new Error("Missing DTD attribute default. "+this.debugInfo(o))}if(u.indexOf("#")!==0){u="#"+u}if(!u.match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/)){throw new Error("Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT. "+this.debugInfo(o))}if(c&&!u.match(/^(#FIXED|#DEFAULT)$/)){throw new Error("Default value only applies to #FIXED or #DEFAULT. "+this.debugInfo(o))}this.elementName=this.stringify.name(o);this.type=i.AttributeDeclaration;this.attributeName=this.stringify.name(a);this.attributeType=this.stringify.dtdAttType(l);if(c){this.defaultValue=this.stringify.dtdAttDefault(c)}this.defaultValueType=u}toString(r){return this.options.writer.dtdAttList(this,this.options.writer.filterOptions(r))}}}).call(this)},7486:function(r,i,o){(function(){var i,a,l;l=o(5089);i=o(7762);r.exports=a=class XMLDTDElement extends l{constructor(r,o,a){super(r);if(o==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(o);this.type=i.ElementDeclaration;this.value=this.stringify.dtdElementValue(a)}toString(r){return this.options.writer.dtdElement(this,this.options.writer.filterOptions(r))}}}).call(this)},9252:function(r,i,o){(function(){var i,a,l,u;({isObject:u}=o(983));l=o(5089);i=o(7762);r.exports=a=function(){class XMLDTDEntity extends l{constructor(r,o,a,l){super(r);if(a==null){throw new Error("Missing DTD entity name. "+this.debugInfo(a))}if(l==null){throw new Error("Missing DTD entity value. "+this.debugInfo(a))}this.pe=!!o;this.name=this.stringify.name(a);this.type=i.EntityDeclaration;if(!u(l)){this.value=this.stringify.dtdEntityValue(l);this.internal=true}else{if(!l.pubID&&!l.sysID){throw new Error("Public and/or system identifiers are required for an external entity. "+this.debugInfo(a))}if(l.pubID&&!l.sysID){throw new Error("System identifier is required for a public external entity. "+this.debugInfo(a))}this.internal=false;if(l.pubID!=null){this.pubID=this.stringify.dtdPubID(l.pubID)}if(l.sysID!=null){this.sysID=this.stringify.dtdSysID(l.sysID)}if(l.nData!=null){this.nData=this.stringify.dtdNData(l.nData)}if(this.pe&&this.nData){throw new Error("Notation declaration is not allowed in a parameter entity. "+this.debugInfo(a))}}}toString(r){return this.options.writer.dtdEntity(this,this.options.writer.filterOptions(r))}}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}});return XMLDTDEntity}.call(this)}).call(this)},3353:function(r,i,o){(function(){var i,a,l;l=o(5089);i=o(7762);r.exports=a=function(){class XMLDTDNotation extends l{constructor(r,o,a){super(r);if(o==null){throw new Error("Missing DTD notation name. "+this.debugInfo(o))}if(!a.pubID&&!a.sysID){throw new Error("Public or system identifiers are required for an external entity. "+this.debugInfo(o))}this.name=this.stringify.name(o);this.type=i.NotationDeclaration;if(a.pubID!=null){this.pubID=this.stringify.dtdPubID(a.pubID)}if(a.sysID!=null){this.sysID=this.stringify.dtdSysID(a.sysID)}}toString(r){return this.options.writer.dtdNotation(this,this.options.writer.filterOptions(r))}}Object.defineProperty(XMLDTDNotation.prototype,"publicId",{get:function(){return this.pubID}});Object.defineProperty(XMLDTDNotation.prototype,"systemId",{get:function(){return this.sysID}});return XMLDTDNotation}.call(this)}).call(this)},6645:function(r,i,o){(function(){var i,a,l,u;({isObject:u}=o(983));l=o(5089);i=o(7762);r.exports=a=class XMLDeclaration extends l{constructor(r,o,a,l){super(r);if(u(o)){({version:o,encoding:a,standalone:l}=o)}if(!o){o="1.0"}this.type=i.Declaration;this.version=this.stringify.xmlVersion(o);if(a!=null){this.encoding=this.stringify.xmlEncoding(a)}if(l!=null){this.standalone=this.stringify.xmlStandalone(l)}}toString(r){return this.options.writer.declaration(this,this.options.writer.filterOptions(r))}}}).call(this)},8873:function(r,i,o){(function(){var i,a,l,u,c,h,d,p,m;({isObject:m}=o(983));p=o(5089);i=o(7762);a=o(2529);u=o(9252);l=o(7486);c=o(3353);d=o(2076);r.exports=h=function(){class XMLDocType extends p{constructor(r,o,a){var l,u,c,h;super(r);this.type=i.DocType;if(r.children){h=r.children;for(u=0,c=h.length;u<c;u++){l=h[u];if(l.type===i.Element){this.name=l.name;break}}}this.documentObject=r;if(m(o)){({pubID:o,sysID:a}=o)}if(a==null){[a,o]=[o,a]}if(o!=null){this.pubID=this.stringify.dtdPubID(o)}if(a!=null){this.sysID=this.stringify.dtdSysID(a)}}element(r,i){var o;o=new l(this,r,i);this.children.push(o);return this}attList(r,i,o,l,u){var c;c=new a(this,r,i,o,l,u);this.children.push(c);return this}entity(r,i){var o;o=new u(this,false,r,i);this.children.push(o);return this}pEntity(r,i){var o;o=new u(this,true,r,i);this.children.push(o);return this}notation(r,i){var o;o=new c(this,r,i);this.children.push(o);return this}toString(r){return this.options.writer.docType(this,this.options.writer.filterOptions(r))}ele(r,i){return this.element(r,i)}att(r,i,o,a,l){return this.attList(r,i,o,a,l)}ent(r,i){return this.entity(r,i)}pent(r,i){return this.pEntity(r,i)}not(r,i){return this.notation(r,i)}up(){return this.root()||this.documentObject}isEqualNode(r){if(!super.isEqualNode(r)){return false}if(r.name!==this.name){return false}if(r.publicId!==this.publicId){return false}if(r.systemId!==this.systemId){return false}return true}}Object.defineProperty(XMLDocType.prototype,"entities",{get:function(){var r,o,a,l,u;l={};u=this.children;for(o=0,a=u.length;o<a;o++){r=u[o];if(r.type===i.EntityDeclaration&&!r.pe){l[r.name]=r}}return new d(l)}});Object.defineProperty(XMLDocType.prototype,"notations",{get:function(){var r,o,a,l,u;l={};u=this.children;for(o=0,a=u.length;o<a;o++){r=u[o];if(r.type===i.NotationDeclaration){l[r.name]=r}}return new d(l)}});Object.defineProperty(XMLDocType.prototype,"publicId",{get:function(){return this.pubID}});Object.defineProperty(XMLDocType.prototype,"systemId",{get:function(){return this.sysID}});Object.defineProperty(XMLDocType.prototype,"internalSubset",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}});return XMLDocType}.call(this)}).call(this)},1582:function(r,i,o){(function(){var i,a,l,u,c,h,d,p;({isPlainObject:p}=o(983));l=o(2692);a=o(5675);c=o(5089);i=o(7762);d=o(645);h=o(7834);r.exports=u=function(){class XMLDocument extends c{constructor(r){super(null);this.name="#document";this.type=i.Document;this.documentURI=null;this.domConfig=new a;r||(r={});if(!r.writer){r.writer=new h}this.options=r;this.stringify=new d(r)}end(r){var i;i={};if(!r){r=this.options.writer}else if(p(r)){i=r;r=this.options.writer}return r.document(this,r.filterOptions(i))}toString(r){return this.options.writer.document(this,this.options.writer.filterOptions(r))}createElement(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}createDocumentFragment(){throw new Error("This DOM method is not implemented."+this.debugInfo())}createTextNode(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}createComment(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}createCDATASection(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}createProcessingInstruction(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())}createAttribute(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}createEntityReference(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}getElementsByTagName(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}importNode(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())}createElementNS(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())}createAttributeNS(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())}getElementsByTagNameNS(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())}getElementById(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}adoptNode(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}normalizeDocument(){throw new Error("This DOM method is not implemented."+this.debugInfo())}renameNode(r,i,o){throw new Error("This DOM method is not implemented."+this.debugInfo())}getElementsByClassName(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}createEvent(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}createRange(){throw new Error("This DOM method is not implemented."+this.debugInfo())}createNodeIterator(r,i,o){throw new Error("This DOM method is not implemented."+this.debugInfo())}createTreeWalker(r,i,o){throw new Error("This DOM method is not implemented."+this.debugInfo())}}Object.defineProperty(XMLDocument.prototype,"implementation",{value:new l});Object.defineProperty(XMLDocument.prototype,"doctype",{get:function(){var r,o,a,l;l=this.children;for(o=0,a=l.length;o<a;o++){r=l[o];if(r.type===i.DocType){return r}}return null}});Object.defineProperty(XMLDocument.prototype,"documentElement",{get:function(){return this.rootObject||null}});Object.defineProperty(XMLDocument.prototype,"inputEncoding",{get:function(){return null}});Object.defineProperty(XMLDocument.prototype,"strictErrorChecking",{get:function(){return false}});Object.defineProperty(XMLDocument.prototype,"xmlEncoding",{get:function(){if(this.children.length!==0&&this.children[0].type===i.Declaration){return this.children[0].encoding}else{return null}}});Object.defineProperty(XMLDocument.prototype,"xmlStandalone",{get:function(){if(this.children.length!==0&&this.children[0].type===i.Declaration){return this.children[0].standalone==="yes"}else{return false}}});Object.defineProperty(XMLDocument.prototype,"xmlVersion",{get:function(){if(this.children.length!==0&&this.children[0].type===i.Declaration){return this.children[0].version}else{return"1.0"}}});Object.defineProperty(XMLDocument.prototype,"URL",{get:function(){return this.documentURI}});Object.defineProperty(XMLDocument.prototype,"origin",{get:function(){return null}});Object.defineProperty(XMLDocument.prototype,"compatMode",{get:function(){return null}});Object.defineProperty(XMLDocument.prototype,"characterSet",{get:function(){return null}});Object.defineProperty(XMLDocument.prototype,"contentType",{get:function(){return null}});return XMLDocument}.call(this)}).call(this)},2871:function(r,i,o){(function(){var i,a,l,u,c,h,d,p,m,g,y,v,b,w,M,E,D,T,x,O,N,_,A,I={}.hasOwnProperty;({isObject:_,isFunction:N,isPlainObject:A,getValue:O}=o(983));i=o(7762);v=o(1582);w=o(6484);u=o(5261);c=o(360);E=o(8732);x=o(2275);M=o(8947);g=o(6645);y=o(8873);h=o(2529);p=o(9252);d=o(7486);m=o(3353);l=o(1395);T=o(645);D=o(7834);a=o(140);r.exports=b=class XMLDocumentCB{constructor(r,o,a){var l;this.name="?xml";this.type=i.Document;r||(r={});l={};if(!r.writer){r.writer=new D}else if(A(r.writer)){l=r.writer;r.writer=new D}this.options=r;this.writer=r.writer;this.writerOptions=this.writer.filterOptions(l);this.stringify=new T(r);this.onDataCallback=o||function(){};this.onEndCallback=a||function(){};this.currentNode=null;this.currentLevel=-1;this.openTags={};this.documentStarted=false;this.documentCompleted=false;this.root=null}createChildNode(r){var o,a,l,u,c,h,d,p;switch(r.type){case i.CData:this.cdata(r.value);break;case i.Comment:this.comment(r.value);break;case i.Element:l={};d=r.attribs;for(a in d){if(!I.call(d,a))continue;o=d[a];l[a]=o.value}this.node(r.name,l);break;case i.Dummy:this.dummy();break;case i.Raw:this.raw(r.value);break;case i.Text:this.text(r.value);break;case i.ProcessingInstruction:this.instruction(r.target,r.value);break;default:throw new Error("This XML node type is not supported in a JS object: "+r.constructor.name)}p=r.children;for(c=0,h=p.length;c<h;c++){u=p[c];this.createChildNode(u);if(u.type===i.Element){this.up()}}return this}dummy(){return this}node(r,i,o){if(r==null){throw new Error("Missing node name.")}if(this.root&&this.currentLevel===-1){throw new Error("Document can only have one root node. "+this.debugInfo(r))}this.openCurrent();r=O(r);if(i==null){i={}}i=O(i);if(!_(i)){[o,i]=[i,o]}this.currentNode=new w(this,r,i);this.currentNode.children=false;this.currentLevel++;this.openTags[this.currentLevel]=this.currentNode;if(o!=null){this.text(o)}return this}element(r,o,a){var l,u,c,h,d,p;if(this.currentNode&&this.currentNode.type===i.DocType){this.dtdElement(...arguments)}else{if(Array.isArray(r)||_(r)||N(r)){h=this.options.noValidation;this.options.noValidation=true;p=new v(this.options).element("TEMP_ROOT");p.element(r);this.options.noValidation=h;d=p.children;for(u=0,c=d.length;u<c;u++){l=d[u];this.createChildNode(l);if(l.type===i.Element){this.up()}}}else{this.node(r,o,a)}}return this}attribute(r,i){var o,a;if(!this.currentNode||this.currentNode.children){throw new Error("att() can only be used immediately after an ele() call in callback mode. "+this.debugInfo(r))}if(r!=null){r=O(r)}if(_(r)){for(o in r){if(!I.call(r,o))continue;a=r[o];this.attribute(o,a)}}else{if(N(i)){i=i.apply()}if(this.options.keepNullAttributes&&i==null){this.currentNode.attribs[r]=new l(this,r,"")}else if(i!=null){this.currentNode.attribs[r]=new l(this,r,i)}}return this}text(r){var i;this.openCurrent();i=new x(this,r);this.onData(this.writer.text(i,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this}cdata(r){var i;this.openCurrent();i=new u(this,r);this.onData(this.writer.cdata(i,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this}comment(r){var i;this.openCurrent();i=new c(this,r);this.onData(this.writer.comment(i,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this}raw(r){var i;this.openCurrent();i=new E(this,r);this.onData(this.writer.raw(i,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this}instruction(r,i){var o,a,l,u,c;this.openCurrent();if(r!=null){r=O(r)}if(i!=null){i=O(i)}if(Array.isArray(r)){for(o=0,u=r.length;o<u;o++){a=r[o];this.instruction(a)}}else if(_(r)){for(a in r){if(!I.call(r,a))continue;l=r[a];this.instruction(a,l)}}else{if(N(i)){i=i.apply()}c=new M(this,r,i);this.onData(this.writer.processingInstruction(c,this.writerOptions,this.currentLevel+1),this.currentLevel+1)}return this}declaration(r,i,o){var a;this.openCurrent();if(this.documentStarted){throw new Error("declaration() must be the first node.")}a=new g(this,r,i,o);this.onData(this.writer.declaration(a,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this}doctype(r,i,o){this.openCurrent();if(r==null){throw new Error("Missing root node name.")}if(this.root){throw new Error("dtd() must come before the root node.")}this.currentNode=new y(this,i,o);this.currentNode.rootNodeName=r;this.currentNode.children=false;this.currentLevel++;this.openTags[this.currentLevel]=this.currentNode;return this}dtdElement(r,i){var o;this.openCurrent();o=new d(this,r,i);this.onData(this.writer.dtdElement(o,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this}attList(r,i,o,a,l){var u;this.openCurrent();u=new h(this,r,i,o,a,l);this.onData(this.writer.dtdAttList(u,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this}entity(r,i){var o;this.openCurrent();o=new p(this,false,r,i);this.onData(this.writer.dtdEntity(o,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this}pEntity(r,i){var o;this.openCurrent();o=new p(this,true,r,i);this.onData(this.writer.dtdEntity(o,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this}notation(r,i){var o;this.openCurrent();o=new m(this,r,i);this.onData(this.writer.dtdNotation(o,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this}up(){if(this.currentLevel<0){throw new Error("The document node has no parent.")}if(this.currentNode){if(this.currentNode.children){this.closeNode(this.currentNode)}else{this.openNode(this.currentNode)}this.currentNode=null}else{this.closeNode(this.openTags[this.currentLevel])}delete this.openTags[this.currentLevel];this.currentLevel--;return this}end(){while(this.currentLevel>=0){this.up()}return this.onEnd()}openCurrent(){if(this.currentNode){this.currentNode.children=true;return this.openNode(this.currentNode)}}openNode(r){var o,l,u,c;if(!r.isOpen){if(!this.root&&this.currentLevel===0&&r.type===i.Element){this.root=r}l="";if(r.type===i.Element){this.writerOptions.state=a.OpenTag;l=this.writer.indent(r,this.writerOptions,this.currentLevel)+"<"+r.name;c=r.attribs;for(u in c){if(!I.call(c,u))continue;o=c[u];l+=this.writer.attribute(o,this.writerOptions,this.currentLevel)}l+=(r.children?">":"/>")+this.writer.endline(r,this.writerOptions,this.currentLevel);this.writerOptions.state=a.InsideTag}else{this.writerOptions.state=a.OpenTag;l=this.writer.indent(r,this.writerOptions,this.currentLevel)+"<!DOCTYPE "+r.rootNodeName;if(r.pubID&&r.sysID){l+=' PUBLIC "'+r.pubID+'" "'+r.sysID+'"'}else if(r.sysID){l+=' SYSTEM "'+r.sysID+'"'}if(r.children){l+=" [";this.writerOptions.state=a.InsideTag}else{this.writerOptions.state=a.CloseTag;l+=">"}l+=this.writer.endline(r,this.writerOptions,this.currentLevel)}this.onData(l,this.currentLevel);return r.isOpen=true}}closeNode(r){var o;if(!r.isClosed){o="";this.writerOptions.state=a.CloseTag;if(r.type===i.Element){o=this.writer.indent(r,this.writerOptions,this.currentLevel)+"</"+r.name+">"+this.writer.endline(r,this.writerOptions,this.currentLevel)}else{o=this.writer.indent(r,this.writerOptions,this.currentLevel)+"]>"+this.writer.endline(r,this.writerOptions,this.currentLevel)}this.writerOptions.state=a.None;this.onData(o,this.currentLevel);return r.isClosed=true}}onData(r,i){this.documentStarted=true;return this.onDataCallback(r,i+1)}onEnd(){this.documentCompleted=true;return this.onEndCallback()}debugInfo(r){if(r==null){return""}else{return"node: <"+r+">"}}ele(){return this.element(...arguments)}nod(r,i,o){return this.node(r,i,o)}txt(r){return this.text(r)}dat(r){return this.cdata(r)}com(r){return this.comment(r)}ins(r,i){return this.instruction(r,i)}dec(r,i,o){return this.declaration(r,i,o)}dtd(r,i,o){return this.doctype(r,i,o)}e(r,i,o){return this.element(r,i,o)}n(r,i,o){return this.node(r,i,o)}t(r){return this.text(r)}d(r){return this.cdata(r)}c(r){return this.comment(r)}r(r){return this.raw(r)}i(r,i){return this.instruction(r,i)}att(){if(this.currentNode&&this.currentNode.type===i.DocType){return this.attList(...arguments)}else{return this.attribute(...arguments)}}a(){if(this.currentNode&&this.currentNode.type===i.DocType){return this.attList(...arguments)}else{return this.attribute(...arguments)}}ent(r,i){return this.entity(r,i)}pent(r,i){return this.pEntity(r,i)}not(r,i){return this.notation(r,i)}}}).call(this)},706:function(r,i,o){(function(){var i,a,l;l=o(5089);i=o(7762);r.exports=a=class XMLDummy extends l{constructor(r){super(r);this.type=i.Dummy}clone(){return Object.create(this)}toString(r){return""}}}).call(this)},6484:function(r,i,o){(function(){var i,a,l,u,c,h,d,p,m={}.hasOwnProperty;({isObject:p,isFunction:d,getValue:h}=o(983));c=o(5089);i=o(7762);a=o(1395);u=o(2076);r.exports=l=function(){class XMLElement extends c{constructor(r,o,a){var l,u,c,h;super(r);if(o==null){throw new Error("Missing element name. "+this.debugInfo())}this.name=this.stringify.name(o);this.type=i.Element;this.attribs={};this.schemaTypeInfo=null;if(a!=null){this.attribute(a)}if(r.type===i.Document){this.isRoot=true;this.documentObject=r;r.rootObject=this;if(r.children){h=r.children;for(u=0,c=h.length;u<c;u++){l=h[u];if(l.type===i.DocType){l.name=this.name;break}}}}}clone(){var r,i,o,a;o=Object.create(this);if(o.isRoot){o.documentObject=null}o.attribs={};a=this.attribs;for(i in a){if(!m.call(a,i))continue;r=a[i];o.attribs[i]=r.clone()}o.children=[];this.children.forEach((function(r){var i;i=r.clone();i.parent=o;return o.children.push(i)}));return o}attribute(r,i){var o,l;if(r!=null){r=h(r)}if(p(r)){for(o in r){if(!m.call(r,o))continue;l=r[o];this.attribute(o,l)}}else{if(d(i)){i=i.apply()}if(this.options.keepNullAttributes&&i==null){this.attribs[r]=new a(this,r,"")}else if(i!=null){this.attribs[r]=new a(this,r,i)}}return this}removeAttribute(r){var i,o,a;if(r==null){throw new Error("Missing attribute name. "+this.debugInfo())}r=h(r);if(Array.isArray(r)){for(o=0,a=r.length;o<a;o++){i=r[o];delete this.attribs[i]}}else{delete this.attribs[r]}return this}toString(r){return this.options.writer.element(this,this.options.writer.filterOptions(r))}att(r,i){return this.attribute(r,i)}a(r,i){return this.attribute(r,i)}getAttribute(r){if(this.attribs.hasOwnProperty(r)){return this.attribs[r].value}else{return null}}setAttribute(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())}getAttributeNode(r){if(this.attribs.hasOwnProperty(r)){return this.attribs[r]}else{return null}}setAttributeNode(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}removeAttributeNode(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}getElementsByTagName(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}getAttributeNS(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())}setAttributeNS(r,i,o){throw new Error("This DOM method is not implemented."+this.debugInfo())}removeAttributeNS(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())}getAttributeNodeNS(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())}setAttributeNodeNS(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}getElementsByTagNameNS(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())}hasAttribute(r){return this.attribs.hasOwnProperty(r)}hasAttributeNS(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())}setIdAttribute(r,i){if(this.attribs.hasOwnProperty(r)){return this.attribs[r].isId}else{return i}}setIdAttributeNS(r,i,o){throw new Error("This DOM method is not implemented."+this.debugInfo())}setIdAttributeNode(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())}getElementsByTagName(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}getElementsByTagNameNS(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())}getElementsByClassName(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}isEqualNode(r){var i,o,a;if(!super.isEqualNode(r)){return false}if(r.namespaceURI!==this.namespaceURI){return false}if(r.prefix!==this.prefix){return false}if(r.localName!==this.localName){return false}if(r.attribs.length!==this.attribs.length){return false}for(i=o=0,a=this.attribs.length-1;0<=a?o<=a:o>=a;i=0<=a?++o:--o){if(!this.attribs[i].isEqualNode(r.attribs[i])){return false}}return true}}Object.defineProperty(XMLElement.prototype,"tagName",{get:function(){return this.name}});Object.defineProperty(XMLElement.prototype,"namespaceURI",{get:function(){return""}});Object.defineProperty(XMLElement.prototype,"prefix",{get:function(){return""}});Object.defineProperty(XMLElement.prototype,"localName",{get:function(){return this.name}});Object.defineProperty(XMLElement.prototype,"id",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}});Object.defineProperty(XMLElement.prototype,"className",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}});Object.defineProperty(XMLElement.prototype,"classList",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}});Object.defineProperty(XMLElement.prototype,"attributes",{get:function(){if(!this.attributeMap||!this.attributeMap.nodes){this.attributeMap=new u(this.attribs)}return this.attributeMap}});return XMLElement}.call(this)}).call(this)},2076:function(r){(function(){var i;r.exports=i=function(){class XMLNamedNodeMap{constructor(r){this.nodes=r}clone(){return this.nodes=null}getNamedItem(r){return this.nodes[r]}setNamedItem(r){var i;i=this.nodes[r.nodeName];this.nodes[r.nodeName]=r;return i||null}removeNamedItem(r){var i;i=this.nodes[r];delete this.nodes[r];return i||null}item(r){return this.nodes[Object.keys(this.nodes)[r]]||null}getNamedItemNS(r,i){throw new Error("This DOM method is not implemented.")}setNamedItemNS(r){throw new Error("This DOM method is not implemented.")}removeNamedItemNS(r,i){throw new Error("This DOM method is not implemented.")}}Object.defineProperty(XMLNamedNodeMap.prototype,"length",{get:function(){return Object.keys(this.nodes).length||0}});return XMLNamedNodeMap}.call(this)}).call(this)},5089:function(r,i,o){(function(){var i,a,l,u,c,h,d,p,m,g,y,v,b,w,M,E,D,T,x={}.hasOwnProperty,O=[].splice;({isObject:T,isFunction:D,isEmpty:E,getValue:M}=o(983));p=null;l=null;u=null;c=null;h=null;b=null;w=null;v=null;d=null;a=null;y=null;m=null;i=null;r.exports=g=function(){class XMLNode{constructor(r){this.parent=r;if(this.parent){this.options=this.parent.options;this.stringify=this.parent.stringify}this.value=null;this.children=[];this.baseURI=null;if(!p){p=o(6484);l=o(5261);u=o(360);c=o(6645);h=o(8873);b=o(8732);w=o(2275);v=o(8947);d=o(706);a=o(7762);y=o(9908);m=o(2076);i=o(144)}}setParent(r){var i,o,a,l,u;this.parent=r;if(r){this.options=r.options;this.stringify=r.stringify}l=this.children;u=[];for(o=0,a=l.length;o<a;o++){i=l[o];u.push(i.setParent(this))}return u}element(r,i,o){var a,l,u,c,h,d,p,m,g;d=null;if(i===null&&o==null){[i,o]=[{},null]}if(i==null){i={}}i=M(i);if(!T(i)){[o,i]=[i,o]}if(r!=null){r=M(r)}if(Array.isArray(r)){for(u=0,p=r.length;u<p;u++){l=r[u];d=this.element(l)}}else if(D(r)){d=this.element(r.apply())}else if(T(r)){for(h in r){if(!x.call(r,h))continue;g=r[h];if(D(g)){g=g.apply()}if(!this.options.ignoreDecorators&&this.stringify.convertAttKey&&h.indexOf(this.stringify.convertAttKey)===0){d=this.attribute(h.substr(this.stringify.convertAttKey.length),g)}else if(!this.options.separateArrayItems&&Array.isArray(g)&&E(g)){d=this.dummy()}else if(T(g)&&E(g)){d=this.element(h)}else if(!this.options.keepNullNodes&&g==null){d=this.dummy()}else if(!this.options.separateArrayItems&&Array.isArray(g)){for(c=0,m=g.length;c<m;c++){l=g[c];a={};a[h]=l;d=this.element(a)}}else if(T(g)){if(!this.options.ignoreDecorators&&this.stringify.convertTextKey&&h.indexOf(this.stringify.convertTextKey)===0){d=this.element(g)}else{d=this.element(h);d.element(g)}}else{d=this.element(h,g)}}}else if(!this.options.keepNullNodes&&o===null){d=this.dummy()}else{if(!this.options.ignoreDecorators&&this.stringify.convertTextKey&&r.indexOf(this.stringify.convertTextKey)===0){d=this.text(o)}else if(!this.options.ignoreDecorators&&this.stringify.convertCDataKey&&r.indexOf(this.stringify.convertCDataKey)===0){d=this.cdata(o)}else if(!this.options.ignoreDecorators&&this.stringify.convertCommentKey&&r.indexOf(this.stringify.convertCommentKey)===0){d=this.comment(o)}else if(!this.options.ignoreDecorators&&this.stringify.convertRawKey&&r.indexOf(this.stringify.convertRawKey)===0){d=this.raw(o)}else if(!this.options.ignoreDecorators&&this.stringify.convertPIKey&&r.indexOf(this.stringify.convertPIKey)===0){d=this.instruction(r.substr(this.stringify.convertPIKey.length),o)}else{d=this.node(r,i,o)}}if(d==null){throw new Error("Could not create any elements with: "+r+". "+this.debugInfo())}return d}insertBefore(r,i,o){var a,l,u,c,h;if(r!=null?r.type:void 0){u=r;c=i;u.setParent(this);if(c){l=children.indexOf(c);h=children.splice(l);children.push(u);Array.prototype.push.apply(children,h)}else{children.push(u)}return u}else{if(this.isRoot){throw new Error("Cannot insert elements at root level. "+this.debugInfo(r))}l=this.parent.children.indexOf(this);h=this.parent.children.splice(l);a=this.parent.element(r,i,o);Array.prototype.push.apply(this.parent.children,h);return a}}insertAfter(r,i,o){var a,l,u;if(this.isRoot){throw new Error("Cannot insert elements at root level. "+this.debugInfo(r))}l=this.parent.children.indexOf(this);u=this.parent.children.splice(l+1);a=this.parent.element(r,i,o);Array.prototype.push.apply(this.parent.children,u);return a}remove(){var r,i;if(this.isRoot){throw new Error("Cannot remove the root element. "+this.debugInfo())}r=this.parent.children.indexOf(this);O.apply(this.parent.children,[r,r-r+1].concat(i=[])),i;return this.parent}node(r,i,o){var a;if(r!=null){r=M(r)}i||(i={});i=M(i);if(!T(i)){[o,i]=[i,o]}a=new p(this,r,i);if(o!=null){a.text(o)}this.children.push(a);return a}text(r){var i;if(T(r)){this.element(r)}i=new w(this,r);this.children.push(i);return this}cdata(r){var i;i=new l(this,r);this.children.push(i);return this}comment(r){var i;i=new u(this,r);this.children.push(i);return this}commentBefore(r){var i,o,a;o=this.parent.children.indexOf(this);a=this.parent.children.splice(o);i=this.parent.comment(r);Array.prototype.push.apply(this.parent.children,a);return this}commentAfter(r){var i,o,a;o=this.parent.children.indexOf(this);a=this.parent.children.splice(o+1);i=this.parent.comment(r);Array.prototype.push.apply(this.parent.children,a);return this}raw(r){var i;i=new b(this,r);this.children.push(i);return this}dummy(){var r;r=new d(this);return r}instruction(r,i){var o,a,l,u,c;if(r!=null){r=M(r)}if(i!=null){i=M(i)}if(Array.isArray(r)){for(u=0,c=r.length;u<c;u++){o=r[u];this.instruction(o)}}else if(T(r)){for(o in r){if(!x.call(r,o))continue;a=r[o];this.instruction(o,a)}}else{if(D(i)){i=i.apply()}l=new v(this,r,i);this.children.push(l)}return this}instructionBefore(r,i){var o,a,l;a=this.parent.children.indexOf(this);l=this.parent.children.splice(a);o=this.parent.instruction(r,i);Array.prototype.push.apply(this.parent.children,l);return this}instructionAfter(r,i){var o,a,l;a=this.parent.children.indexOf(this);l=this.parent.children.splice(a+1);o=this.parent.instruction(r,i);Array.prototype.push.apply(this.parent.children,l);return this}declaration(r,i,o){var l,u;l=this.document();u=new c(l,r,i,o);if(l.children.length===0){l.children.unshift(u)}else if(l.children[0].type===a.Declaration){l.children[0]=u}else{l.children.unshift(u)}return l.root()||l}dtd(r,i){var o,l,u,c,d,p,m,g,y,v;l=this.document();u=new h(l,r,i);y=l.children;for(c=d=0,m=y.length;d<m;c=++d){o=y[c];if(o.type===a.DocType){l.children[c]=u;return u}}v=l.children;for(c=p=0,g=v.length;p<g;c=++p){o=v[c];if(o.isRoot){l.children.splice(c,0,u);return u}}l.children.push(u);return u}up(){if(this.isRoot){throw new Error("The root node has no parent. Use doc() if you need to get the document object.")}return this.parent}root(){var r;r=this;while(r){if(r.type===a.Document){return r.rootObject}else if(r.isRoot){return r}else{r=r.parent}}}document(){var r;r=this;while(r){if(r.type===a.Document){return r}else{r=r.parent}}}end(r){return this.document().end(r)}prev(){var r;r=this.parent.children.indexOf(this);if(r<1){throw new Error("Already at the first node. "+this.debugInfo())}return this.parent.children[r-1]}next(){var r;r=this.parent.children.indexOf(this);if(r===-1||r===this.parent.children.length-1){throw new Error("Already at the last node. "+this.debugInfo())}return this.parent.children[r+1]}importDocument(r){var i,o,l,u,c;o=r.root().clone();o.parent=this;o.isRoot=false;this.children.push(o);if(this.type===a.Document){o.isRoot=true;o.documentObject=this;this.rootObject=o;if(this.children){c=this.children;for(l=0,u=c.length;l<u;l++){i=c[l];if(i.type===a.DocType){i.name=o.name;break}}}}return this}debugInfo(r){var i,o;r=r||this.name;if(r==null&&!((i=this.parent)!=null?i.name:void 0)){return""}else if(r==null){return"parent: <"+this.parent.name+">"}else if(!((o=this.parent)!=null?o.name:void 0)){return"node: <"+r+">"}else{return"node: <"+r+">, parent: <"+this.parent.name+">"}}ele(r,i,o){return this.element(r,i,o)}nod(r,i,o){return this.node(r,i,o)}txt(r){return this.text(r)}dat(r){return this.cdata(r)}com(r){return this.comment(r)}ins(r,i){return this.instruction(r,i)}doc(){return this.document()}dec(r,i,o){return this.declaration(r,i,o)}e(r,i,o){return this.element(r,i,o)}n(r,i,o){return this.node(r,i,o)}t(r){return this.text(r)}d(r){return this.cdata(r)}c(r){return this.comment(r)}r(r){return this.raw(r)}i(r,i){return this.instruction(r,i)}u(){return this.up()}importXMLBuilder(r){return this.importDocument(r)}attribute(r,i){throw new Error("attribute() applies to element nodes only.")}att(r,i){return this.attribute(r,i)}a(r,i){return this.attribute(r,i)}removeAttribute(r){throw new Error("attribute() applies to element nodes only.")}replaceChild(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())}removeChild(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}appendChild(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}hasChildNodes(){return this.children.length!==0}cloneNode(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}normalize(){throw new Error("This DOM method is not implemented."+this.debugInfo())}isSupported(r,i){return true}hasAttributes(){return this.attribs.length!==0}compareDocumentPosition(r){var o,a;o=this;if(o===r){return 0}else if(this.document()!==r.document()){a=i.Disconnected|i.ImplementationSpecific;if(Math.random()<.5){a|=i.Preceding}else{a|=i.Following}return a}else if(o.isAncestor(r)){return i.Contains|i.Preceding}else if(o.isDescendant(r)){return i.Contains|i.Following}else if(o.isPreceding(r)){return i.Preceding}else{return i.Following}}isSameNode(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}lookupPrefix(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}isDefaultNamespace(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}lookupNamespaceURI(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}isEqualNode(r){var i,o,a;if(r.nodeType!==this.nodeType){return false}if(r.children.length!==this.children.length){return false}for(i=o=0,a=this.children.length-1;0<=a?o<=a:o>=a;i=0<=a?++o:--o){if(!this.children[i].isEqualNode(r.children[i])){return false}}return true}getFeature(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())}setUserData(r,i,o){throw new Error("This DOM method is not implemented."+this.debugInfo())}getUserData(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}contains(r){if(!r){return false}return r===this||this.isDescendant(r)}isDescendant(r){var i,o,a,l,u;u=this.children;for(a=0,l=u.length;a<l;a++){i=u[a];if(r===i){return true}o=i.isDescendant(r);if(o){return true}}return false}isAncestor(r){return r.isDescendant(this)}isPreceding(r){var i,o;i=this.treePosition(r);o=this.treePosition(this);if(i===-1||o===-1){return false}else{return i<o}}isFollowing(r){var i,o;i=this.treePosition(r);o=this.treePosition(this);if(i===-1||o===-1){return false}else{return i>o}}treePosition(r){var i,o;o=0;i=false;this.foreachTreeNode(this.document(),(function(a){o++;if(!i&&a===r){return i=true}}));if(i){return o}else{return-1}}foreachTreeNode(r,i){var o,a,l,u,c;r||(r=this.document());u=r.children;for(a=0,l=u.length;a<l;a++){o=u[a];if(c=i(o)){return c}else{c=this.foreachTreeNode(o,i);if(c){return c}}}}}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 y(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 r;r=this.parent.children.indexOf(this);return this.parent.children[r-1]||null}});Object.defineProperty(XMLNode.prototype,"nextSibling",{get:function(){var r;r=this.parent.children.indexOf(this);return this.parent.children[r+1]||null}});Object.defineProperty(XMLNode.prototype,"ownerDocument",{get:function(){return this.document()||null}});Object.defineProperty(XMLNode.prototype,"textContent",{get:function(){var r,i,o,l,u;if(this.nodeType===a.Element||this.nodeType===a.DocumentFragment){u="";l=this.children;for(i=0,o=l.length;i<o;i++){r=l[i];if(r.textContent){u+=r.textContent}}return u}else{return null}},set:function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}});return XMLNode}.call(this)}).call(this)},9908:function(r){(function(){var i;r.exports=i=function(){class XMLNodeList{constructor(r){this.nodes=r}clone(){return this.nodes=null}item(r){return this.nodes[r]||null}}Object.defineProperty(XMLNodeList.prototype,"length",{get:function(){return this.nodes.length||0}});return XMLNodeList}.call(this)}).call(this)},8947:function(r,i,o){(function(){var i,a,l;i=o(7762);a=o(4765);r.exports=l=class XMLProcessingInstruction extends a{constructor(r,o,a){super(r);if(o==null){throw new Error("Missing instruction target. "+this.debugInfo())}this.type=i.ProcessingInstruction;this.target=this.stringify.insTarget(o);this.name=this.target;if(a){this.value=this.stringify.insValue(a)}}clone(){return Object.create(this)}toString(r){return this.options.writer.processingInstruction(this,this.options.writer.filterOptions(r))}isEqualNode(r){if(!super.isEqualNode(r)){return false}if(r.target!==this.target){return false}return true}}}).call(this)},8732:function(r,i,o){(function(){var i,a,l;i=o(7762);a=o(5089);r.exports=l=class XMLRaw extends a{constructor(r,o){super(r);if(o==null){throw new Error("Missing raw text. "+this.debugInfo())}this.type=i.Raw;this.value=this.stringify.raw(o)}clone(){return Object.create(this)}toString(r){return this.options.writer.raw(this,this.options.writer.filterOptions(r))}}}).call(this)},5922:function(r,i,o){(function(){var i,a,l,u,c={}.hasOwnProperty;i=o(7762);u=o(6670);a=o(140);r.exports=l=class XMLStreamWriter extends u{constructor(r,i){super(i);this.stream=r}endline(r,i,o){if(r.isLastRootNode&&i.state===a.CloseTag){return""}else{return super.endline(r,i,o)}}document(r,i){var o,a,l,u,c,h,d,p,m;d=r.children;for(a=l=0,c=d.length;l<c;a=++l){o=d[a];o.isLastRootNode=a===r.children.length-1}i=this.filterOptions(i);p=r.children;m=[];for(u=0,h=p.length;u<h;u++){o=p[u];m.push(this.writeChildNode(o,i,0))}return m}cdata(r,i,o){return this.stream.write(super.cdata(r,i,o))}comment(r,i,o){return this.stream.write(super.comment(r,i,o))}declaration(r,i,o){return this.stream.write(super.declaration(r,i,o))}docType(r,i,o){var l,u,c,h;o||(o=0);this.openNode(r,i,o);i.state=a.OpenTag;this.stream.write(this.indent(r,i,o));this.stream.write("<!DOCTYPE "+r.root().name);if(r.pubID&&r.sysID){this.stream.write(' PUBLIC "'+r.pubID+'" "'+r.sysID+'"')}else if(r.sysID){this.stream.write(' SYSTEM "'+r.sysID+'"')}if(r.children.length>0){this.stream.write(" [");this.stream.write(this.endline(r,i,o));i.state=a.InsideTag;h=r.children;for(u=0,c=h.length;u<c;u++){l=h[u];this.writeChildNode(l,i,o+1)}i.state=a.CloseTag;this.stream.write("]")}i.state=a.CloseTag;this.stream.write(i.spaceBeforeSlash+">");this.stream.write(this.endline(r,i,o));i.state=a.None;return this.closeNode(r,i,o)}element(r,o,l){var u,h,d,p,m,g,y,v,b,w,M,E,D,T,x,O;l||(l=0);this.openNode(r,o,l);o.state=a.OpenTag;M=this.indent(r,o,l)+"<"+r.name;if(o.pretty&&o.width>0){y=M.length;D=r.attribs;for(b in D){if(!c.call(D,b))continue;u=D[b];E=this.attribute(u,o,l);h=E.length;if(y+h>o.width){O=this.indent(r,o,l+1)+E;M+=this.endline(r,o,l)+O;y=O.length}else{O=" "+E;M+=O;y+=O.length}}}else{T=r.attribs;for(b in T){if(!c.call(T,b))continue;u=T[b];M+=this.attribute(u,o,l)}}this.stream.write(M);p=r.children.length;m=p===0?null:r.children[0];if(p===0||r.children.every((function(r){return(r.type===i.Text||r.type===i.Raw)&&r.value===""}))){if(o.allowEmpty){this.stream.write(">");o.state=a.CloseTag;this.stream.write("</"+r.name+">")}else{o.state=a.CloseTag;this.stream.write(o.spaceBeforeSlash+"/>")}}else if(o.pretty&&p===1&&(m.type===i.Text||m.type===i.Raw)&&m.value!=null){this.stream.write(">");o.state=a.InsideTag;o.suppressPrettyCount++;w=true;this.writeChildNode(m,o,l+1);o.suppressPrettyCount--;w=false;o.state=a.CloseTag;this.stream.write("</"+r.name+">")}else{this.stream.write(">"+this.endline(r,o,l));o.state=a.InsideTag;x=r.children;for(g=0,v=x.length;g<v;g++){d=x[g];this.writeChildNode(d,o,l+1)}o.state=a.CloseTag;this.stream.write(this.indent(r,o,l)+"</"+r.name+">")}this.stream.write(this.endline(r,o,l));o.state=a.None;return this.closeNode(r,o,l)}processingInstruction(r,i,o){return this.stream.write(super.processingInstruction(r,i,o))}raw(r,i,o){return this.stream.write(super.raw(r,i,o))}text(r,i,o){return this.stream.write(super.text(r,i,o))}dtdAttList(r,i,o){return this.stream.write(super.dtdAttList(r,i,o))}dtdElement(r,i,o){return this.stream.write(super.dtdElement(r,i,o))}dtdEntity(r,i,o){return this.stream.write(super.dtdEntity(r,i,o))}dtdNotation(r,i,o){return this.stream.write(super.dtdNotation(r,i,o))}}}).call(this)},7834:function(r,i,o){(function(){var i,a;a=o(6670);r.exports=i=class XMLStringWriter extends a{constructor(r){super(r)}document(r,i){var o,a,l,u,c;i=this.filterOptions(i);u="";c=r.children;for(a=0,l=c.length;a<l;a++){o=c[a];u+=this.writeChildNode(o,i,0)}if(i.pretty&&u.slice(-i.newline.length)===i.newline){u=u.slice(0,-i.newline.length)}return u}}}).call(this)},645:function(r){(function(){var i,o={}.hasOwnProperty;r.exports=i=function(){class XMLStringifier{constructor(r){var i,a,l;this.assertLegalChar=this.assertLegalChar.bind(this);this.assertLegalName=this.assertLegalName.bind(this);r||(r={});this.options=r;if(!this.options.version){this.options.version="1.0"}a=r.stringify||{};for(i in a){if(!o.call(a,i))continue;l=a[i];this[i]=l}}name(r){if(this.options.noValidation){return r}return this.assertLegalName(""+r||"")}text(r){if(this.options.noValidation){return r}return this.assertLegalChar(this.textEscape(""+r||""))}cdata(r){if(this.options.noValidation){return r}r=""+r||"";r=r.replace("]]>","]]]]><![CDATA[>");return this.assertLegalChar(r)}comment(r){if(this.options.noValidation){return r}r=""+r||"";if(r.match(/--/)){throw new Error("Comment text cannot contain double-hypen: "+r)}return this.assertLegalChar(r)}raw(r){if(this.options.noValidation){return r}return""+r||""}attValue(r){if(this.options.noValidation){return r}return this.assertLegalChar(this.attEscape(r=""+r||""))}insTarget(r){if(this.options.noValidation){return r}return this.assertLegalChar(""+r||"")}insValue(r){if(this.options.noValidation){return r}r=""+r||"";if(r.match(/\?>/)){throw new Error("Invalid processing instruction value: "+r)}return this.assertLegalChar(r)}xmlVersion(r){if(this.options.noValidation){return r}r=""+r||"";if(!r.match(/1\.[0-9]+/)){throw new Error("Invalid version number: "+r)}return r}xmlEncoding(r){if(this.options.noValidation){return r}r=""+r||"";if(!r.match(/^[A-Za-z](?:[A-Za-z0-9._-])*$/)){throw new Error("Invalid encoding: "+r)}return this.assertLegalChar(r)}xmlStandalone(r){if(this.options.noValidation){return r}if(r){return"yes"}else{return"no"}}dtdPubID(r){if(this.options.noValidation){return r}return this.assertLegalChar(""+r||"")}dtdSysID(r){if(this.options.noValidation){return r}return this.assertLegalChar(""+r||"")}dtdElementValue(r){if(this.options.noValidation){return r}return this.assertLegalChar(""+r||"")}dtdAttType(r){if(this.options.noValidation){return r}return this.assertLegalChar(""+r||"")}dtdAttDefault(r){if(this.options.noValidation){return r}return this.assertLegalChar(""+r||"")}dtdEntityValue(r){if(this.options.noValidation){return r}return this.assertLegalChar(""+r||"")}dtdNData(r){if(this.options.noValidation){return r}return this.assertLegalChar(""+r||"")}assertLegalChar(r){var i,o;if(this.options.noValidation){return r}i="";if(this.options.version==="1.0"){i=/[\0-\x08\x0B\f\x0E-\x1F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;if(o=r.match(i)){throw new Error(`Invalid character in string: ${r} at index ${o.index}`)}}else if(this.options.version==="1.1"){i=/[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;if(o=r.match(i)){throw new Error(`Invalid character in string: ${r} at index ${o.index}`)}}return r}assertLegalName(r){var i;if(this.options.noValidation){return r}this.assertLegalChar(r);i=/^([: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(!r.match(i)){throw new Error("Invalid character in name")}return r}textEscape(r){var i;if(this.options.noValidation){return r}i=this.options.noDoubleEncoding?/(?!&\S+;)&/g:/&/g;return r.replace(i,"&").replace(/</g,"<").replace(/>/g,">").replace(/\r/g,"
")}attEscape(r){var i;if(this.options.noValidation){return r}i=this.options.noDoubleEncoding?/(?!&\S+;)&/g:/&/g;return r.replace(i,"&").replace(/</g,"<").replace(/"/g,""").replace(/\t/g,"	").replace(/\n/g,"
").replace(/\r/g,"
")}}XMLStringifier.prototype.convertAttKey="@";XMLStringifier.prototype.convertPIKey="?";XMLStringifier.prototype.convertTextKey="#text";XMLStringifier.prototype.convertCDataKey="#cdata";XMLStringifier.prototype.convertCommentKey="#comment";XMLStringifier.prototype.convertRawKey="#raw";return XMLStringifier}.call(this)}).call(this)},2275:function(r,i,o){(function(){var i,a,l;i=o(7762);a=o(4765);r.exports=l=function(){class XMLText extends a{constructor(r,o){super(r);if(o==null){throw new Error("Missing element text. "+this.debugInfo())}this.name="#text";this.type=i.Text;this.value=this.stringify.text(o)}clone(){return Object.create(this)}toString(r){return this.options.writer.text(this,this.options.writer.filterOptions(r))}splitText(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}replaceWholeText(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}}Object.defineProperty(XMLText.prototype,"isElementContentWhitespace",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}});Object.defineProperty(XMLText.prototype,"wholeText",{get:function(){var r,i,o;o="";i=this.previousSibling;while(i){o=i.data+o;i=i.previousSibling}o+=this.data;r=this.nextSibling;while(r){o=o+r.data;r=r.nextSibling}return o}});return XMLText}.call(this)}).call(this)},6670:function(r,i,o){(function(){var i,a,l,u,c,h,d,p,m,g,y,v,b,w,M,E,D,T={}.hasOwnProperty;({assign:D}=o(983));i=o(7762);m=o(6645);g=o(8873);l=o(5261);u=o(360);v=o(6484);w=o(8732);M=o(2275);b=o(8947);y=o(706);c=o(2529);h=o(7486);d=o(9252);p=o(3353);a=o(140);r.exports=E=class XMLWriterBase{constructor(r){var i,o,a;r||(r={});this.options=r;o=r.writer||{};for(i in o){if(!T.call(o,i))continue;a=o[i];this["_"+i]=this[i];this[i]=a}}filterOptions(r){var i,o,l,u,c,h,d,p,m;r||(r={});r=D({},this.options,r);i={writer:this};i.pretty=r.pretty||false;i.allowEmpty=r.allowEmpty||false;i.indent=(o=r.indent)!=null?o:" ";i.newline=(l=r.newline)!=null?l:"\n";i.offset=(u=r.offset)!=null?u:0;i.width=(c=r.width)!=null?c:0;i.dontPrettyTextNodes=(h=(d=r.dontPrettyTextNodes)!=null?d:r.dontprettytextnodes)!=null?h:0;i.spaceBeforeSlash=(p=(m=r.spaceBeforeSlash)!=null?m:r.spacebeforeslash)!=null?p:"";if(i.spaceBeforeSlash===true){i.spaceBeforeSlash=" "}i.suppressPrettyCount=0;i.user={};i.state=a.None;return i}indent(r,i,o){var a;if(!i.pretty||i.suppressPrettyCount){return""}else if(i.pretty){a=(o||0)+i.offset+1;if(a>0){return new Array(a).join(i.indent)}}return""}endline(r,i,o){if(!i.pretty||i.suppressPrettyCount){return""}else{return i.newline}}attribute(r,i,o){var a;this.openAttribute(r,i,o);if(i.pretty&&i.width>0){a=r.name+'="'+r.value+'"'}else{a=" "+r.name+'="'+r.value+'"'}this.closeAttribute(r,i,o);return a}cdata(r,i,o){var l;this.openNode(r,i,o);i.state=a.OpenTag;l=this.indent(r,i,o)+"<![CDATA[";i.state=a.InsideTag;l+=r.value;i.state=a.CloseTag;l+="]]>"+this.endline(r,i,o);i.state=a.None;this.closeNode(r,i,o);return l}comment(r,i,o){var l;this.openNode(r,i,o);i.state=a.OpenTag;l=this.indent(r,i,o)+"\x3c!-- ";i.state=a.InsideTag;l+=r.value;i.state=a.CloseTag;l+=" --\x3e"+this.endline(r,i,o);i.state=a.None;this.closeNode(r,i,o);return l}declaration(r,i,o){var l;this.openNode(r,i,o);i.state=a.OpenTag;l=this.indent(r,i,o)+"<?xml";i.state=a.InsideTag;l+=' version="'+r.version+'"';if(r.encoding!=null){l+=' encoding="'+r.encoding+'"'}if(r.standalone!=null){l+=' standalone="'+r.standalone+'"'}i.state=a.CloseTag;l+=i.spaceBeforeSlash+"?>";l+=this.endline(r,i,o);i.state=a.None;this.closeNode(r,i,o);return l}docType(r,i,o){var l,u,c,h,d;o||(o=0);this.openNode(r,i,o);i.state=a.OpenTag;h=this.indent(r,i,o);h+="<!DOCTYPE "+r.root().name;if(r.pubID&&r.sysID){h+=' PUBLIC "'+r.pubID+'" "'+r.sysID+'"'}else if(r.sysID){h+=' SYSTEM "'+r.sysID+'"'}if(r.children.length>0){h+=" [";h+=this.endline(r,i,o);i.state=a.InsideTag;d=r.children;for(u=0,c=d.length;u<c;u++){l=d[u];h+=this.writeChildNode(l,i,o+1)}i.state=a.CloseTag;h+="]"}i.state=a.CloseTag;h+=i.spaceBeforeSlash+">";h+=this.endline(r,i,o);i.state=a.None;this.closeNode(r,i,o);return h}element(r,o,l){var u,c,h,d,p,m,g,y,v,b,w,M,E,D,x,O,N,_,A;l||(l=0);M=false;this.openNode(r,o,l);o.state=a.OpenTag;E=this.indent(r,o,l)+"<"+r.name;if(o.pretty&&o.width>0){y=E.length;x=r.attribs;for(w in x){if(!T.call(x,w))continue;u=x[w];D=this.attribute(u,o,l);c=D.length;if(y+c>o.width){A=this.indent(r,o,l+1)+D;E+=this.endline(r,o,l)+A;y=A.length}else{A=" "+D;E+=A;y+=A.length}}}else{O=r.attribs;for(w in O){if(!T.call(O,w))continue;u=O[w];E+=this.attribute(u,o,l)}}d=r.children.length;p=d===0?null:r.children[0];if(d===0||r.children.every((function(r){return(r.type===i.Text||r.type===i.Raw)&&r.value===""}))){if(o.allowEmpty){E+=">";o.state=a.CloseTag;E+="</"+r.name+">"+this.endline(r,o,l)}else{o.state=a.CloseTag;E+=o.spaceBeforeSlash+"/>"+this.endline(r,o,l)}}else if(o.pretty&&d===1&&(p.type===i.Text||p.type===i.Raw)&&p.value!=null){E+=">";o.state=a.InsideTag;o.suppressPrettyCount++;M=true;E+=this.writeChildNode(p,o,l+1);o.suppressPrettyCount--;M=false;o.state=a.CloseTag;E+="</"+r.name+">"+this.endline(r,o,l)}else{if(o.dontPrettyTextNodes){N=r.children;for(m=0,v=N.length;m<v;m++){h=N[m];if((h.type===i.Text||h.type===i.Raw)&&h.value!=null){o.suppressPrettyCount++;M=true;break}}}E+=">"+this.endline(r,o,l);o.state=a.InsideTag;_=r.children;for(g=0,b=_.length;g<b;g++){h=_[g];E+=this.writeChildNode(h,o,l+1)}o.state=a.CloseTag;E+=this.indent(r,o,l)+"</"+r.name+">";if(M){o.suppressPrettyCount--}E+=this.endline(r,o,l);o.state=a.None}this.closeNode(r,o,l);return E}writeChildNode(r,o,a){switch(r.type){case i.CData:return this.cdata(r,o,a);case i.Comment:return this.comment(r,o,a);case i.Element:return this.element(r,o,a);case i.Raw:return this.raw(r,o,a);case i.Text:return this.text(r,o,a);case i.ProcessingInstruction:return this.processingInstruction(r,o,a);case i.Dummy:return"";case i.Declaration:return this.declaration(r,o,a);case i.DocType:return this.docType(r,o,a);case i.AttributeDeclaration:return this.dtdAttList(r,o,a);case i.ElementDeclaration:return this.dtdElement(r,o,a);case i.EntityDeclaration:return this.dtdEntity(r,o,a);case i.NotationDeclaration:return this.dtdNotation(r,o,a);default:throw new Error("Unknown XML node type: "+r.constructor.name)}}processingInstruction(r,i,o){var l;this.openNode(r,i,o);i.state=a.OpenTag;l=this.indent(r,i,o)+"<?";i.state=a.InsideTag;l+=r.target;if(r.value){l+=" "+r.value}i.state=a.CloseTag;l+=i.spaceBeforeSlash+"?>";l+=this.endline(r,i,o);i.state=a.None;this.closeNode(r,i,o);return l}raw(r,i,o){var l;this.openNode(r,i,o);i.state=a.OpenTag;l=this.indent(r,i,o);i.state=a.InsideTag;l+=r.value;i.state=a.CloseTag;l+=this.endline(r,i,o);i.state=a.None;this.closeNode(r,i,o);return l}text(r,i,o){var l;this.openNode(r,i,o);i.state=a.OpenTag;l=this.indent(r,i,o);i.state=a.InsideTag;l+=r.value;i.state=a.CloseTag;l+=this.endline(r,i,o);i.state=a.None;this.closeNode(r,i,o);return l}dtdAttList(r,i,o){var l;this.openNode(r,i,o);i.state=a.OpenTag;l=this.indent(r,i,o)+"<!ATTLIST";i.state=a.InsideTag;l+=" "+r.elementName+" "+r.attributeName+" "+r.attributeType;if(r.defaultValueType!=="#DEFAULT"){l+=" "+r.defaultValueType}if(r.defaultValue){l+=' "'+r.defaultValue+'"'}i.state=a.CloseTag;l+=i.spaceBeforeSlash+">"+this.endline(r,i,o);i.state=a.None;this.closeNode(r,i,o);return l}dtdElement(r,i,o){var l;this.openNode(r,i,o);i.state=a.OpenTag;l=this.indent(r,i,o)+"<!ELEMENT";i.state=a.InsideTag;l+=" "+r.name+" "+r.value;i.state=a.CloseTag;l+=i.spaceBeforeSlash+">"+this.endline(r,i,o);i.state=a.None;this.closeNode(r,i,o);return l}dtdEntity(r,i,o){var l;this.openNode(r,i,o);i.state=a.OpenTag;l=this.indent(r,i,o)+"<!ENTITY";i.state=a.InsideTag;if(r.pe){l+=" %"}l+=" "+r.name;if(r.value){l+=' "'+r.value+'"'}else{if(r.pubID&&r.sysID){l+=' PUBLIC "'+r.pubID+'" "'+r.sysID+'"'}else if(r.sysID){l+=' SYSTEM "'+r.sysID+'"'}if(r.nData){l+=" NDATA "+r.nData}}i.state=a.CloseTag;l+=i.spaceBeforeSlash+">"+this.endline(r,i,o);i.state=a.None;this.closeNode(r,i,o);return l}dtdNotation(r,i,o){var l;this.openNode(r,i,o);i.state=a.OpenTag;l=this.indent(r,i,o)+"<!NOTATION";i.state=a.InsideTag;l+=" "+r.name;if(r.pubID&&r.sysID){l+=' PUBLIC "'+r.pubID+'" "'+r.sysID+'"'}else if(r.pubID){l+=' PUBLIC "'+r.pubID+'"'}else if(r.sysID){l+=' SYSTEM "'+r.sysID+'"'}i.state=a.CloseTag;l+=i.spaceBeforeSlash+">"+this.endline(r,i,o);i.state=a.None;this.closeNode(r,i,o);return l}openNode(r,i,o){}closeNode(r,i,o){}openAttribute(r,i,o){}closeAttribute(r,i,o){}}}).call(this)},5769:function(r,i,o){(function(){var i,a,l,u,c,h,d,p,m;({assign:p,isFunction:m}=o(983));l=o(2692);u=o(1582);c=o(2871);d=o(7834);h=o(5922);i=o(7762);a=o(140);r.exports.create=function(r,i,o,a){var l,c;if(r==null){throw new Error("Root element needs a name.")}a=p({},i,o,a);l=new u(a);c=l.element(r);if(!a.headless){l.declaration(a);if(a.pubID!=null||a.sysID!=null){l.dtd(a)}}return c};r.exports.begin=function(r,i,o){if(m(r)){[i,o]=[r,i];r={}}if(i){return new c(r,i,o)}else{return new u(r)}};r.exports.stringWriter=function(r){return new d(r)};r.exports.streamWriter=function(r,i){return new h(r,i)};r.exports.implementation=new l;r.exports.nodeType=i;r.exports.writerState=a}).call(this)},4513:(r,i,o)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.addMetaDataItemToMainApplication=addMetaDataItemToMainApplication;i.addUsesLibraryItemToMainApplication=addUsesLibraryItemToMainApplication;i.ensureToolsAvailable=ensureToolsAvailable;i.findMetaDataItem=findMetaDataItem;i.findUsesLibraryItem=findUsesLibraryItem;i.getMainActivity=getMainActivity;i.getMainActivityOrThrow=getMainActivityOrThrow;i.getMainApplication=getMainApplication;i.getMainApplicationMetaDataValue=getMainApplicationMetaDataValue;i.getMainApplicationOrThrow=getMainApplicationOrThrow;i.getRunnableActivity=getRunnableActivity;i.prefixAndroidKeys=prefixAndroidKeys;i.readAndroidManifestAsync=readAndroidManifestAsync;i.removeMetaDataItemFromMainApplication=removeMetaDataItemFromMainApplication;i.removeUsesLibraryItemFromMainApplication=removeUsesLibraryItemFromMainApplication;i.writeAndroidManifestAsync=writeAndroidManifestAsync;function _assert(){const r=_interopRequireDefault(o(9491));_assert=function(){return r};return r}function _fs(){const r=_interopRequireDefault(o(7147));_fs=function(){return r};return r}function _path(){const r=_interopRequireDefault(o(1017));_path=function(){return r};return r}function XML(){const r=_interopRequireWildcard(o(8853));XML=function(){return r};return r}function _getRequireWildcardCache(r){if("function"!=typeof WeakMap)return null;var i=new WeakMap,o=new WeakMap;return(_getRequireWildcardCache=function(r){return r?o:i})(r)}function _interopRequireWildcard(r,i){if(!i&&r&&r.__esModule)return r;if(null===r||"object"!=typeof r&&"function"!=typeof r)return{default:r};var o=_getRequireWildcardCache(i);if(o&&o.has(r))return o.get(r);var a={__proto__:null},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in r)if("default"!==u&&Object.prototype.hasOwnProperty.call(r,u)){var c=l?Object.getOwnPropertyDescriptor(r,u):null;c&&(c.get||c.set)?Object.defineProperty(a,u,c):a[u]=r[u]}return a.default=r,o&&o.set(r,a),a}function _interopRequireDefault(r){return r&&r.__esModule?r:{default:r}}async function writeAndroidManifestAsync(r,i){const o=XML().format(i);await _fs().default.promises.mkdir(_path().default.dirname(r),{recursive:true});await _fs().default.promises.writeFile(r,o)}async function readAndroidManifestAsync(r){const i=await XML().readXMLAsync({path:r});if(!isManifest(i)){throw new Error("Invalid manifest found at: "+r)}return i}function isManifest(r){return!!r.manifest}function getMainApplication(r){return r?.manifest?.application?.filter((r=>r?.$?.["android:name"].endsWith(".MainApplication")))[0]??null}function getMainApplicationOrThrow(r){const i=getMainApplication(r);(0,_assert().default)(i,"AndroidManifest.xml is missing the required MainApplication element");return i}function getMainActivityOrThrow(r){const i=getMainActivity(r);(0,_assert().default)(i,"AndroidManifest.xml is missing the required MainActivity element");return i}function getRunnableActivity(r){const i=r?.manifest?.application?.[0]?.activity?.filter?.((r=>r.$["android:enabled"]!=="false"&&r.$["android:enabled"]!==false));if(!i){return null}for(const r of i){if(Array.isArray(r["intent-filter"])){for(const i of r["intent-filter"]){if(i.action?.find((r=>r.$["android:name"]==="android.intent.action.MAIN"))&&i.category?.find((r=>r.$["android:name"]==="android.intent.category.LAUNCHER"))){return r}}}}return null}function getMainActivity(r){const i=r?.manifest?.application?.[0]?.activity?.filter?.((r=>r.$["android:name"]===".MainActivity"));return i?.[0]??null}function addMetaDataItemToMainApplication(r,i,o,a="value"){let l;const u={$:prefixAndroidKeys({name:i,[a]:o})};if(r["meta-data"]){l=r["meta-data"].filter((r=>r.$["android:name"]===i));if(l.length){l[0].$[`android:${a}`]=o}else{r["meta-data"].push(u)}}else{r["meta-data"]=[u]}return r}function removeMetaDataItemFromMainApplication(r,i){const o=findMetaDataItem(r,i);if(r?.["meta-data"]&&o>-1){r["meta-data"].splice(o,1)}return r}function findApplicationSubItem(r,i,o){const a=r[i];if(Array.isArray(a)){const r=a.findIndex((r=>r.$["android:name"]===o));return r}return-1}function findMetaDataItem(r,i){return findApplicationSubItem(r,"meta-data",i)}function findUsesLibraryItem(r,i){return findApplicationSubItem(r,"uses-library",i)}function getMainApplicationMetaDataValue(r,i){const o=getMainApplication(r);if(o?.hasOwnProperty("meta-data")){const r=o?.["meta-data"]?.find((r=>r.$["android:name"]===i));return r?.$["android:value"]??null}return null}function addUsesLibraryItemToMainApplication(r,i){let o;const a={$:prefixAndroidKeys(i)};if(r["uses-library"]){o=r["uses-library"].filter((r=>r.$["android:name"]===i.name));if(o.length){o[0].$=a.$}else{r["uses-library"].push(a)}}else{r["uses-library"]=[a]}return r}function removeUsesLibraryItemFromMainApplication(r,i){const o=findUsesLibraryItem(r,i);if(r?.["uses-library"]&&o>-1){r["uses-library"].splice(o,1)}return r}function prefixAndroidKeys(r){return Object.entries(r).reduce(((r,[i,o])=>({...r,[`android:${i}`]:o})),{})}function ensureToolsAvailable(r){return ensureManifestHasNamespace(r,{namespace:"xmlns:tools",url:"http://schemas.android.com/tools"})}function ensureManifestHasNamespace(r,{namespace:i,url:o}){if(r?.manifest?.$?.[i]){return r}r.manifest.$[i]=o;return r}},365:(r,i,o)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.appendScheme=appendScheme;i.ensureManifestHasValidIntentFilter=ensureManifestHasValidIntentFilter;i.getScheme=getScheme;i.getSchemesFromManifest=getSchemesFromManifest;i.hasScheme=hasScheme;i.removeScheme=removeScheme;i.setScheme=setScheme;i.withScheme=void 0;function _androidPlugins(){const r=o(2636);_androidPlugins=function(){return r};return r}function _warnings(){const r=o(128);_warnings=function(){return r};return r}const a=i.withScheme=(0,_androidPlugins().createAndroidManifestPlugin)(setScheme,"withScheme");function getScheme(r){if(Array.isArray(r.scheme)){const validate=r=>typeof r==="string";return r.scheme.filter(validate)}else if(typeof r.scheme==="string"){return[r.scheme]}return[]}function setScheme(r,i){const o=[...getScheme(r),...getScheme(r.android??{})];if(r.android?.package){o.push(r.android.package)}if(o.length===0){return i}if(!ensureManifestHasValidIntentFilter(i)){(0,_warnings().addWarningAndroid)("scheme",`Cannot add schemes because the provided manifest does not have a valid Activity with \`android:launchMode="singleTask"\``,"https://expo.fyi/setup-android-uri-scheme");return i}const a=getSchemesFromManifest(i);for(const r of a){const i=o.indexOf(r);if(i>-1)o.splice(i,1)}for(const r of o){i=appendScheme(r,i)}return i}function isValidRedirectIntentFilter({actions:r,categories:i}){return r.includes("android.intent.action.VIEW")&&!i.includes("android.intent.category.LAUNCHER")}function propertiesFromIntentFilter(r){const i=r?.action?.map((r=>r?.$?.["android:name"]))??[];const o=r?.category?.map((r=>r?.$?.["android:name"]))??[];const a=r?.data?.filter((r=>r?.$?.["android:scheme"]))?.map((r=>({scheme:r?.$?.["android:scheme"],host:r?.$?.["android:host"]})))??[];return{actions:i,categories:o,data:a}}function getSingleTaskIntentFilters(r){if(!Array.isArray(r.manifest.application))return[];let i=[];for(const o of r.manifest.application){const{activity:r}=o;const a=Array.isArray(r)?r:[r];const l=a.filter((r=>r?.$?.["android:launchMode"]==="singleTask"));for(const r of l){const o=r["intent-filter"];i=i.concat(o)}}return i}function getSchemesFromManifest(r,i=null){const o=[];const a=getSingleTaskIntentFilters(r);for(const r of a){const a=propertiesFromIntentFilter(r);if(isValidRedirectIntentFilter(a)&&a.data){for(const{scheme:r,host:l}of a.data){if(i===null||!l||l===i){o.push(r)}}}}return o}function ensureManifestHasValidIntentFilter(r){if(!Array.isArray(r.manifest.application)){return false}for(const i of r.manifest.application){for(const r of i.activity||[]){if(r?.$?.["android:launchMode"]==="singleTask"){for(const i of r["intent-filter"]||[]){const r=propertiesFromIntentFilter(i);if(isValidRedirectIntentFilter(r)){return true}}if(!r["intent-filter"]){r["intent-filter"]=[]}r["intent-filter"].push({action:[{$:{"android:name":"android.intent.action.VIEW"}}],category:[{$:{"android:name":"android.intent.category.DEFAULT"}},{$:{"android:name":"android.intent.category.BROWSABLE"}}]});return true}}}return false}function hasScheme(r,i){const o=getSchemesFromManifest(i);return o.includes(r)}function appendScheme(r,i){if(!Array.isArray(i.manifest.application)){return i}for(const o of i.manifest.application){for(const i of o.activity||[]){if(i?.$?.["android:launchMode"]==="singleTask"){for(const o of i["intent-filter"]||[]){const i=propertiesFromIntentFilter(o);if(isValidRedirectIntentFilter(i)){if(!o.data)o.data=[];o.data.push({$:{"android:scheme":r}})}}break}}}return i}function removeScheme(r,i){if(!Array.isArray(i.manifest.application)){return i}for(const o of i.manifest.application){for(const i of o.activity||[]){if(i?.$?.["android:launchMode"]==="singleTask"){for(const o of i["intent-filter"]||[]){const i=propertiesFromIntentFilter(o);if(isValidRedirectIntentFilter(i)){for(const i in o?.data||[]){const a=o.data?.[i];if(a?.$?.["android:scheme"]===r){delete o.data?.[i]}}}}break}}}return i}},7903:(r,i,o)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.appendScheme=appendScheme;i.getScheme=getScheme;i.getSchemesFromPlist=getSchemesFromPlist;i.hasScheme=hasScheme;i.removeScheme=removeScheme;i.setScheme=setScheme;i.withScheme=void 0;function _iosPlugins(){const r=o(4797);_iosPlugins=function(){return r};return r}const a=i.withScheme=(0,_iosPlugins().createInfoPlistPluginWithPropertyGuard)(setScheme,{infoPlistProperty:"CFBundleURLTypes",expoConfigProperty:"scheme"},"withScheme");function getScheme(r){if(Array.isArray(r.scheme)){const validate=r=>typeof r==="string";return r.scheme.filter(validate)}else if(typeof r.scheme==="string"){return[r.scheme]}return[]}function setScheme(r,i){const o=[...getScheme(r),...getScheme(r.ios??{})];if(r.ios?.bundleIdentifier){o.push(r.ios.bundleIdentifier)}if(o.length===0){return i}return{...i,CFBundleURLTypes:[{CFBundleURLSchemes:o}]}}function appendScheme(r,i){if(!r){return i}const o=i.CFBundleURLTypes??[];if(o?.some((({CFBundleURLSchemes:i})=>i.includes(r)))){return i}return{...i,CFBundleURLTypes:[...o,{CFBundleURLSchemes:[r]}]}}function removeScheme(r,i){if(!r){return i}if(!i.CFBundleURLTypes){return i}i.CFBundleURLTypes=i.CFBundleURLTypes.map((i=>{const o=i.CFBundleURLSchemes.indexOf(r);if(o>-1){i.CFBundleURLSchemes.splice(o,1);if(i.CFBundleURLSchemes.length===0){return undefined}}return i})).filter(Boolean);return i}function hasScheme(r,i){const o=i.CFBundleURLTypes;if(!Array.isArray(o))return false;return o?.some((({CFBundleURLSchemes:i})=>Array.isArray(i)?i.includes(r):false))}function getSchemesFromPlist(r){if(Array.isArray(r.CFBundleURLTypes)){return r.CFBundleURLTypes.reduce(((r,{CFBundleURLSchemes:i})=>{if(Array.isArray(i)){return[...r,...i]}return r}),[])}return[]}},2636:(r,i,o)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.createAndroidManifestPlugin=createAndroidManifestPlugin;i.createStringsXmlPlugin=createStringsXmlPlugin;i.withStringsXml=i.withSettingsGradle=i.withProjectBuildGradle=i.withMainApplication=i.withMainActivity=i.withGradleProperties=i.withAppBuildGradle=i.withAndroidStyles=i.withAndroidManifest=i.withAndroidColorsNight=i.withAndroidColors=void 0;function _withMod(){const r=o(2932);_withMod=function(){return r};return r}function createAndroidManifestPlugin(r,i){const withUnknown=i=>withAndroidManifest(i,(async i=>{i.modResults=await r(i,i.modResults);return i}));if(i){Object.defineProperty(withUnknown,"name",{value:i})}return withUnknown}function createStringsXmlPlugin(r,i){const withUnknown=i=>withStringsXml(i,(async i=>{i.modResults=await r(i,i.modResults);return i}));if(i){Object.defineProperty(withUnknown,"name",{value:i})}return withUnknown}const withAndroidManifest=(r,i)=>(0,_withMod().withMod)(r,{platform:"android",mod:"manifest",action:i});i.withAndroidManifest=withAndroidManifest;const withStringsXml=(r,i)=>(0,_withMod().withMod)(r,{platform:"android",mod:"strings",action:i});i.withStringsXml=withStringsXml;const withAndroidColors=(r,i)=>(0,_withMod().withMod)(r,{platform:"android",mod:"colors",action:i});i.withAndroidColors=withAndroidColors;const withAndroidColorsNight=(r,i)=>(0,_withMod().withMod)(r,{platform:"android",mod:"colorsNight",action:i});i.withAndroidColorsNight=withAndroidColorsNight;const withAndroidStyles=(r,i)=>(0,_withMod().withMod)(r,{platform:"android",mod:"styles",action:i});i.withAndroidStyles=withAndroidStyles;const withMainActivity=(r,i)=>(0,_withMod().withMod)(r,{platform:"android",mod:"mainActivity",action:i});i.withMainActivity=withMainActivity;const withMainApplication=(r,i)=>(0,_withMod().withMod)(r,{platform:"android",mod:"mainApplication",action:i});i.withMainApplication=withMainApplication;const withProjectBuildGradle=(r,i)=>(0,_withMod().withMod)(r,{platform:"android",mod:"projectBuildGradle",action:i});i.withProjectBuildGradle=withProjectBuildGradle;const withAppBuildGradle=(r,i)=>(0,_withMod().withMod)(r,{platform:"android",mod:"appBuildGradle",action:i});i.withAppBuildGradle=withAppBuildGradle;const withSettingsGradle=(r,i)=>(0,_withMod().withMod)(r,{platform:"android",mod:"settingsGradle",action:i});i.withSettingsGradle=withSettingsGradle;const withGradleProperties=(r,i)=>(0,_withMod().withMod)(r,{platform:"android",mod:"gradleProperties",action:i});i.withGradleProperties=withGradleProperties},4797:(r,i,o)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.createEntitlementsPlugin=createEntitlementsPlugin;i.createInfoPlistPlugin=createInfoPlistPlugin;i.createInfoPlistPluginWithPropertyGuard=createInfoPlistPluginWithPropertyGuard;i.withXcodeProject=i.withPodfileProperties=i.withInfoPlist=i.withExpoPlist=i.withEntitlementsPlist=i.withAppDelegate=void 0;function _withMod(){const r=o(2932);_withMod=function(){return r};return r}function _obj(){const r=o(7324);_obj=function(){return r};return r}function _warnings(){const r=o(128);_warnings=function(){return r};return r}function createInfoPlistPlugin(r,i){const withUnknown=i=>withInfoPlist(i,(async i=>{i.modResults=await r(i,i.modResults);return i}));if(i){Object.defineProperty(withUnknown,"name",{value:i})}return withUnknown}function createInfoPlistPluginWithPropertyGuard(r,i,o){const withUnknown=o=>withInfoPlist(o,(async o=>{const a=i.expoPropertyGetter?i.expoPropertyGetter(o):(0,_obj().get)(o,i.expoConfigProperty);if(o.modRawConfig.ios?.infoPlist?.[i.infoPlistProperty]===undefined){o.modResults=await r(o,o.modResults)}else if(a!==undefined){(0,_warnings().addWarningIOS)(i.expoConfigProperty,`"ios.infoPlist.${i.infoPlistProperty}" is set in the config. Ignoring abstract property "${i.expoConfigProperty}": ${a}`)}return o}));if(o){Object.defineProperty(withUnknown,"name",{value:o})}return withUnknown}function createEntitlementsPlugin(r,i){const withUnknown=i=>withEntitlementsPlist(i,(async i=>{i.modResults=await r(i,i.modResults);return i}));if(i){Object.defineProperty(withUnknown,"name",{value:i})}return withUnknown}const withAppDelegate=(r,i)=>(0,_withMod().withMod)(r,{platform:"ios",mod:"appDelegate",action:i});i.withAppDelegate=withAppDelegate;const withInfoPlist=(r,i)=>(0,_withMod().withMod)(r,{platform:"ios",mod:"infoPlist",async action(r){r=await i(r);if(!r.ios){r.ios={}}r.ios.infoPlist=r.modResults;return r}});i.withInfoPlist=withInfoPlist;const withEntitlementsPlist=(r,i)=>(0,_withMod().withMod)(r,{platform:"ios",mod:"entitlements",async action(r){r=await i(r);if(!r.ios){r.ios={}}r.ios.entitlements=r.modResults;return r}});i.withEntitlementsPlist=withEntitlementsPlist;const withExpoPlist=(r,i)=>(0,_withMod().withMod)(r,{platform:"ios",mod:"expoPlist",action:i});i.withExpoPlist=withExpoPlist;const withXcodeProject=(r,i)=>(0,_withMod().withMod)(r,{platform:"ios",mod:"xcodeproj",action:i});i.withXcodeProject=withXcodeProject;const withPodfileProperties=(r,i)=>(0,_withMod().withMod)(r,{platform:"ios",mod:"podfileProperties",action:i});i.withPodfileProperties=withPodfileProperties},2932:(r,i,o)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.withBaseMod=withBaseMod;i.withMod=withMod;function _chalk(){const r=_interopRequireDefault(o(8746));_chalk=function(){return r};return r}function _getenv(){const r=o(7945);_getenv=function(){return r};return r}function _errors(){const r=o(3857);_errors=function(){return r};return r}function _interopRequireDefault(r){return r&&r.__esModule?r:{default:r}}const a=(0,_getenv().boolish)("EXPO_DEBUG",false);function withBaseMod(r,{platform:i,mod:o,action:l,skipEmptyMod:u,isProvider:c,isIntrospective:h,saveToInternal:d}){if(!r.mods){r.mods={}}if(!r.mods[i]){r.mods[i]={}}let p=r.mods[i][o];if(!p){if(u){return r}const noopMod=r=>r;p=noopMod}let m="";const g=r._internal?.isDebug??a;if(g){const r=(new Error).stack;m=getDebugPluginStackFromStackTrace(r);const a=_chalk().default.bold(`${i}.${o}`);m=`${a}: ${m}`}if(p.isProvider){if(c){throw new(_errors().PluginError)(`Cannot set provider mod for "${i}.${o}" because another is already being used.`,"CONFLICTING_PROVIDER")}else{throw new(_errors().PluginError)(`Cannot add mod to "${i}.${o}" because the provider has already been added. Provider must be the last mod added.`,"INVALID_MOD_ORDER")}}async function interceptingMod({modRequest:r,...a}){if(g){console.log(m)}const u=await l({...a,modRequest:{...r,nextMod:p}});if(d){saveToInternalObject(u,i,o,u.modResults)}return u}interceptingMod.isProvider=c;if(h){interceptingMod.isIntrospective=h}r.mods[i][o]=interceptingMod;return r}function saveToInternalObject(r,i,o,a){if(!r._internal)r._internal={};if(!r._internal.modResults)r._internal.modResults={};if(!r._internal.modResults[i])r._internal.modResults[i]={};r._internal.modResults[i][o]=a}function getDebugPluginStackFromStackTrace(r){if(!r){return""}const i=[];for(const o of r.split("\n")){const[r,a]=o.trim().split(" ");if(r==="at"){i.push(a)}}const o=i.map((r=>r?.match(/^(\bwith[A-Z].*?\b)/)?.[1]?.trim()??r?.match(/\.(\bwith[A-Z].*?\b)/)?.[1]?.trim()??null)).filter(Boolean).filter((r=>!["withMod","withBaseMod","withExtendedMod"].includes(r)));const a=["withPlugins","withRunOnce","withStaticPlugin"];return o.reverse().map(((r,i)=>{if(r.includes("BaseMod")){r=_chalk().default.bold(r)}if(r.toLowerCase().includes("dangerous")){r=_chalk().default.red(r)}if(i===0){return _chalk().default.blue(r)}else if(a.includes(r)){return _chalk().default.dim(r)}return r})).join(" ➜ ")}function withMod(r,{platform:i,mod:o,action:a}){return withBaseMod(r,{platform:i,mod:o,isProvider:false,async action({modRequest:{nextMod:r,...i},modResults:o,...l}){const u=await a({modRequest:i,modResults:o,...l});return r(u)}})}},8853:(r,i,o)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i._processAndroidXML=_processAndroidXML;i.escapeAndroidString=escapeAndroidString;i.format=format;i.parseXMLAsync=parseXMLAsync;i.readXMLAsync=readXMLAsync;i.unescapeAndroidString=unescapeAndroidString;i.writeXMLAsync=writeXMLAsync;function _fs(){const r=_interopRequireDefault(o(7147));_fs=function(){return r};return r}function _os(){const r=o(2037);_os=function(){return r};return r}function _path(){const r=_interopRequireDefault(o(1017));_path=function(){return r};return r}function _xml2js(){const r=o(7013);_xml2js=function(){return r};return r}function _interopRequireDefault(r){return r&&r.__esModule?r:{default:r}}async function writeXMLAsync(r){const i=format(r.xml);await _fs().default.promises.mkdir(_path().default.dirname(r.path),{recursive:true});await _fs().default.promises.writeFile(r.path,i)}async function readXMLAsync(r){let i="";try{i=await _fs().default.promises.readFile(r.path,{encoding:"utf8",flag:"r"})}catch{}const o=new(_xml2js().Parser);const a=await o.parseStringPromise(i||r.fallback||"");return _processAndroidXML(a)}function _processAndroidXML(r){if(Array.isArray(r?.resources?.string)){for(const i of r?.resources?.string){if(i.$.translatable==="false"||i.$.translatable===false){continue}i._=unescapeAndroidString(i._)}}return r}async function parseXMLAsync(r){const i=await(new(_xml2js().Parser)).parseStringPromise(r);return i}const stringTimesN=(r,i)=>Array(r+1).join(i);function format(r,{indentLevel:i=2,newline:o=_os().EOL}={}){let a;if(typeof r==="string"){a=r}else if(r.toString){const i=new(_xml2js().Builder)({headless:true});if(Array.isArray(r?.resources?.string)){for(const i of r?.resources?.string){if(i.$.translatable==="false"||i.$.translatable===false){continue}i._=escapeAndroidString(i._)}}a=i.buildObject(r);return a}else{throw new Error(`Invalid XML value passed in: ${r}`)}const l=stringTimesN(i," ");let u="";const c=/(>)(<)(\/*)/g;const h=a.replace(c,`$1${o}$2$3`);let d=0;h.split(/\r?\n/).map((r=>r.trim())).forEach((r=>{let i=0;if(r.match(/.+<\/\w[^>]*>$/)){i=0}else if(r.match(/^<\/\w/)){if(d!==0){d-=1}}else if(r.match(/^<\w([^>]*[^/])?>.*$/)){i=1}else{i=0}const a=stringTimesN(d,l);u+=a+r+o;d+=i}));return u.trim()}function escapeAndroidString(r){r=r.replace(/[\n\r\t'"@]/g,(r=>{switch(r){case'"':case"'":case"@":return"\\"+r;case"\n":return"\\n";case"\r":return"\\r";case"\t":return"\\t";default:throw new Error(`Cannot escape unhandled XML character: ${r}`)}}));if(r.match(/(^\s|\s$)/)){r='"'+r+'"'}return r}function unescapeAndroidString(r){return r.replace(/\\(.)/g,"$1")}},3857:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.UnexpectedError=i.PluginError=void 0;class UnexpectedError extends Error{name="UnexpectedError";constructor(r){super(`${r}\nPlease report this as an issue on https://github.com/expo/expo/issues`)}}i.UnexpectedError=UnexpectedError;class PluginError extends Error{name="PluginError";isPluginError=true;constructor(r,i,o){super(o?`${r}\n└─ Cause: ${o.name}: ${o.message}`:r);this.code=i;this.cause=o}}i.PluginError=PluginError},7324:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.get=get;function get(r,i){const o=i.split(".");let a=r;let l;while(l=o.shift()){if(!(l in a)){return undefined}a=a[l]}return a}},128:(r,i,o)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.addWarningAndroid=addWarningAndroid;i.addWarningForPlatform=addWarningForPlatform;i.addWarningIOS=addWarningIOS;function _chalk(){const r=_interopRequireDefault(o(8746));_chalk=function(){return r};return r}function _interopRequireDefault(r){return r&&r.__esModule?r:{default:r}}function addWarningAndroid(r,i,o){console.warn(formatWarning("android",r,i,o))}function addWarningIOS(r,i,o){console.warn(formatWarning("ios",r,i,o))}function addWarningForPlatform(r,i,o,a){console.warn(formatWarning(r,i,o,a))}function formatWarning(r,i,o,a){return _chalk().default.yellow`${"» "+_chalk().default.bold(r)}: ${i}: ${o}${a?_chalk().default.gray(" "+a):""}`}},2395:function(r,i,o){"use strict";var a=this&&this.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(i,"__esModule",{value:true});i.build=build;const l=a(o(2991));const u=a(o(5769));function ISODateString(r){function pad(r){return r<10?"0"+r:r}return r.getUTCFullYear()+"-"+pad(r.getUTCMonth()+1)+"-"+pad(r.getUTCDate())+"T"+pad(r.getUTCHours())+":"+pad(r.getUTCMinutes())+":"+pad(r.getUTCSeconds())+"Z"}const c=Object.prototype.toString;function type(r){const i=c.call(r).match(/\[object (.*)\]/);return i?i[1]:i}function build(r,i){const o={version:"1.0",encoding:"UTF-8"};const a={pubid:"-//Apple//DTD PLIST 1.0//EN",sysid:"http://www.apple.com/DTDs/PropertyList-1.0.dtd"};const l=u.default.create("plist");l.dec(o.version,o.encoding,o.standalone);l.dtd(a.pubid,a.sysid);l.att("version","1.0");walk_obj(r,l);if(!i)i={};i.pretty=i.pretty!==false;return l.end(i)}function walk_obj(r,i){let o,a,u;const c=type(r);if(c=="Undefined"){}else if(Array.isArray(r)){i=i.ele("array");for(a=0;a<r.length;a++){walk_obj(r[a],i)}}else if(Buffer.isBuffer(r)){i.ele("data").raw(r.toString("base64"))}else if(c=="Object"){i=i.ele("dict");for(u in r){if(r.hasOwnProperty(u)&&r[u]!==undefined){i.ele("key").txt(u);walk_obj(r[u],i)}}}else if(c=="Number"){o=r%1===0?"integer":"real";i.ele(o).txt(r.toString())}else if(c=="Date"){i.ele("date").txt(ISODateString(new Date(r)))}else if(c=="Boolean"){i.ele(r?"true":"false")}else if(c=="String"){i.ele("string").txt(r)}else if(c=="ArrayBuffer"){i.ele("data").raw(l.default.fromByteArray(r))}else if(r&&r.buffer&&type(r.buffer)=="ArrayBuffer"){i.ele("data").raw(l.default.fromByteArray(new Uint8Array(r.buffer)))}}},3681:(r,i,o)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});const a=o(2395);const l=o(6859);i["default"]={parse:l.parse,build:a.build}},6859:function(r,i,o){"use strict";var a=this&&this.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(i,"__esModule",{value:true});i.parse=parse;const l=o(1328);const u=a(o(9491));const c=3;const h=4;const d=8;function shouldIgnoreNode(r){return r.nodeType===c||r.nodeType===d||r.nodeType===h}function isEmptyNode(r){return!r.childNodes||r.childNodes.length===0}function parse(r){const i=new l.DOMParser({errorHandler(){}}).parseFromString(r);(0,u.default)(i.documentElement.nodeName==="plist","malformed document. First element should be <plist>");let o=parsePlistXML(i.documentElement);if(o.length==1)o=o[0];return o}function parsePlistXML(r){let i,o,a,l,d,p;if(!r)return null;if(r.nodeName==="plist"){l=[];if(isEmptyNode(r)){return l}for(i=0;i<r.childNodes.length;i++){if(!shouldIgnoreNode(r.childNodes[i])){l.push(parsePlistXML(r.childNodes[i]))}}return l}else if(r.nodeName==="dict"){o={};a=null;p=0;if(isEmptyNode(r)){return o}for(i=0;i<r.childNodes.length;i++){if(shouldIgnoreNode(r.childNodes[i]))continue;if(p%2===0){(0,u.default)(r.childNodes[i].nodeName==="key","Missing key while parsing <dict/>.");a=parsePlistXML(r.childNodes[i])}else{(0,u.default)(r.childNodes[i].nodeName!=="key",'Unexpected key "'+parsePlistXML(r.childNodes[i])+'" while parsing <dict/>.');o[a]=parsePlistXML(r.childNodes[i])}p+=1}if(p%2===1){throw new Error('Missing value for "'+a+'" while parsing <dict/>')}return o}else if(r.nodeName==="array"){l=[];if(isEmptyNode(r)){return l}for(i=0;i<r.childNodes.length;i++){if(!shouldIgnoreNode(r.childNodes[i])){d=parsePlistXML(r.childNodes[i]);if(d!=null)l.push(d)}}return l}else if(r.nodeName==="#text"){}else if(r.nodeName==="key"){if(isEmptyNode(r)){return""}return r.childNodes[0].nodeValue}else if(r.nodeName==="string"){d="";if(isEmptyNode(r)){return d}for(i=0;i<r.childNodes.length;i++){const o=r.childNodes[i].nodeType;if(o===c||o===h){d+=r.childNodes[i].nodeValue}}return d}else if(r.nodeName==="integer"){(0,u.default)(!isEmptyNode(r),'Cannot parse "" as integer.');return parseInt(r.childNodes[0].nodeValue,10)}else if(r.nodeName==="real"){(0,u.default)(!isEmptyNode(r),'Cannot parse "" as real.');d="";for(i=0;i<r.childNodes.length;i++){if(r.childNodes[i].nodeType===c){d+=r.childNodes[i].nodeValue}}return parseFloat(d)}else if(r.nodeName==="data"){d="";if(isEmptyNode(r)){return Buffer.from(d,"base64")}for(i=0;i<r.childNodes.length;i++){if(r.childNodes[i].nodeType===c){d+=r.childNodes[i].nodeValue.replace(/\s+/g,"")}}return Buffer.from(d,"base64")}else if(r.nodeName==="date"){(0,u.default)(!isEmptyNode(r),'Cannot parse "" as Date.');return new Date(r.childNodes[0].nodeValue)}else if(r.nodeName==="true"){return true}else if(r.nodeName==="false"){return false}}},9686:(r,i,o)=>{i.alphasort=alphasort;i.alphasorti=alphasorti;i.setopts=setopts;i.ownProp=ownProp;i.makeAbs=makeAbs;i.finish=finish;i.mark=mark;i.isIgnored=isIgnored;i.childrenIgnored=childrenIgnored;function ownProp(r,i){return Object.prototype.hasOwnProperty.call(r,i)}var a=o(1017);var l=o(9566);var u=o(1323);var c=l.Minimatch;function alphasorti(r,i){return r.toLowerCase().localeCompare(i.toLowerCase())}function alphasort(r,i){return r.localeCompare(i)}function setupIgnores(r,i){r.ignore=i.ignore||[];if(!Array.isArray(r.ignore))r.ignore=[r.ignore];if(r.ignore.length){r.ignore=r.ignore.map(ignoreMap)}}function ignoreMap(r){var i=null;if(r.slice(-3)==="/**"){var o=r.replace(/(\/\*\*)+$/,"");i=new c(o,{dot:true})}return{matcher:new c(r,{dot:true}),gmatcher:i}}function setopts(r,i,o){if(!o)o={};if(o.matchBase&&-1===i.indexOf("/")){if(o.noglobstar){throw new Error("base matching requires globstar")}i="**/"+i}r.silent=!!o.silent;r.pattern=i;r.strict=o.strict!==false;r.realpath=!!o.realpath;r.realpathCache=o.realpathCache||Object.create(null);r.follow=!!o.follow;r.dot=!!o.dot;r.mark=!!o.mark;r.nodir=!!o.nodir;if(r.nodir)r.mark=true;r.sync=!!o.sync;r.nounique=!!o.nounique;r.nonull=!!o.nonull;r.nosort=!!o.nosort;r.nocase=!!o.nocase;r.stat=!!o.stat;r.noprocess=!!o.noprocess;r.absolute=!!o.absolute;r.maxLength=o.maxLength||Infinity;r.cache=o.cache||Object.create(null);r.statCache=o.statCache||Object.create(null);r.symlinks=o.symlinks||Object.create(null);setupIgnores(r,o);r.changedCwd=false;var l=process.cwd();if(!ownProp(o,"cwd"))r.cwd=l;else{r.cwd=a.resolve(o.cwd);r.changedCwd=r.cwd!==l}r.root=o.root||a.resolve(r.cwd,"/");r.root=a.resolve(r.root);if(process.platform==="win32")r.root=r.root.replace(/\\/g,"/");r.cwdAbs=u(r.cwd)?r.cwd:makeAbs(r,r.cwd);if(process.platform==="win32")r.cwdAbs=r.cwdAbs.replace(/\\/g,"/");r.nomount=!!o.nomount;o.nonegate=true;o.nocomment=true;r.minimatch=new c(i,o);r.options=r.minimatch.options}function finish(r){var i=r.nounique;var o=i?[]:Object.create(null);for(var a=0,l=r.matches.length;a<l;a++){var u=r.matches[a];if(!u||Object.keys(u).length===0){if(r.nonull){var c=r.minimatch.globSet[a];if(i)o.push(c);else o[c]=true}}else{var h=Object.keys(u);if(i)o.push.apply(o,h);else h.forEach((function(r){o[r]=true}))}}if(!i)o=Object.keys(o);if(!r.nosort)o=o.sort(r.nocase?alphasorti:alphasort);if(r.mark){for(var a=0;a<o.length;a++){o[a]=r._mark(o[a])}if(r.nodir){o=o.filter((function(i){var o=!/\/$/.test(i);var a=r.cache[i]||r.cache[makeAbs(r,i)];if(o&&a)o=a!=="DIR"&&!Array.isArray(a);return o}))}}if(r.ignore.length)o=o.filter((function(i){return!isIgnored(r,i)}));r.found=o}function mark(r,i){var o=makeAbs(r,i);var a=r.cache[o];var l=i;if(a){var u=a==="DIR"||Array.isArray(a);var c=i.slice(-1)==="/";if(u&&!c)l+="/";else if(!u&&c)l=l.slice(0,-1);if(l!==i){var h=makeAbs(r,l);r.statCache[h]=r.statCache[o];r.cache[h]=r.cache[o]}}return l}function makeAbs(r,i){var o=i;if(i.charAt(0)==="/"){o=a.join(r.root,i)}else if(u(i)||i===""){o=i}else if(r.changedCwd){o=a.resolve(r.cwd,i)}else{o=a.resolve(i)}if(process.platform==="win32")o=o.replace(/\\/g,"/");return o}function isIgnored(r,i){if(!r.ignore.length)return false;return r.ignore.some((function(r){return r.matcher.match(i)||!!(r.gmatcher&&r.gmatcher.match(i))}))}function childrenIgnored(r,i){if(!r.ignore.length)return false;return r.ignore.some((function(r){return!!(r.gmatcher&&r.gmatcher.match(i))}))}},1104:(r,i,o)=>{r.exports=glob;var a=o(7147);var l=o(8945);var u=o(9566);var c=u.Minimatch;var h=o(6919);var d=o(2361).EventEmitter;var p=o(1017);var m=o(9491);var g=o(1323);var y=o(2231);var v=o(9686);var b=v.alphasort;var w=v.alphasorti;var M=v.setopts;var E=v.ownProp;var D=o(9442);var T=o(3837);var x=v.childrenIgnored;var O=v.isIgnored;var N=o(7197);function glob(r,i,o){if(typeof i==="function")o=i,i={};if(!i)i={};if(i.sync){if(o)throw new TypeError("callback provided to sync glob");return y(r,i)}return new Glob(r,i,o)}glob.sync=y;var _=glob.GlobSync=y.GlobSync;glob.glob=glob;function extend(r,i){if(i===null||typeof i!=="object"){return r}var o=Object.keys(i);var a=o.length;while(a--){r[o[a]]=i[o[a]]}return r}glob.hasMagic=function(r,i){var o=extend({},i);o.noprocess=true;var a=new Glob(r,o);var l=a.minimatch.set;if(!r)return false;if(l.length>1)return true;for(var u=0;u<l[0].length;u++){if(typeof l[0][u]!=="string")return true}return false};glob.Glob=Glob;h(Glob,d);function Glob(r,i,o){if(typeof i==="function"){o=i;i=null}if(i&&i.sync){if(o)throw new TypeError("callback provided to sync glob");return new _(r,i)}if(!(this instanceof Glob))return new Glob(r,i,o);M(this,r,i);this._didRealPath=false;var a=this.minimatch.set.length;this.matches=new Array(a);if(typeof o==="function"){o=N(o);this.on("error",o);this.on("end",(function(r){o(null,r)}))}var l=this;this._processing=0;this._emitQueue=[];this._processQueue=[];this.paused=false;if(this.noprocess)return this;if(a===0)return done();var u=true;for(var c=0;c<a;c++){this._process(this.minimatch.set[c],c,false,done)}u=false;function done(){--l._processing;if(l._processing<=0){if(u){process.nextTick((function(){l._finish()}))}else{l._finish()}}}}Glob.prototype._finish=function(){m(this instanceof Glob);if(this.aborted)return;if(this.realpath&&!this._didRealpath)return this._realpath();v.finish(this);this.emit("end",this.found)};Glob.prototype._realpath=function(){if(this._didRealpath)return;this._didRealpath=true;var r=this.matches.length;if(r===0)return this._finish();var i=this;for(var o=0;o<this.matches.length;o++)this._realpathSet(o,next);function next(){if(--r===0)i._finish()}};Glob.prototype._realpathSet=function(r,i){var o=this.matches[r];if(!o)return i();var a=Object.keys(o);var u=this;var c=a.length;if(c===0)return i();var h=this.matches[r]=Object.create(null);a.forEach((function(o,a){o=u._makeAbs(o);l.realpath(o,u.realpathCache,(function(a,l){if(!a)h[l]=true;else if(a.syscall==="stat")h[o]=true;else u.emit("error",a);if(--c===0){u.matches[r]=h;i()}}))}))};Glob.prototype._mark=function(r){return v.mark(this,r)};Glob.prototype._makeAbs=function(r){return v.makeAbs(this,r)};Glob.prototype.abort=function(){this.aborted=true;this.emit("abort")};Glob.prototype.pause=function(){if(!this.paused){this.paused=true;this.emit("pause")}};Glob.prototype.resume=function(){if(this.paused){this.emit("resume");this.paused=false;if(this._emitQueue.length){var r=this._emitQueue.slice(0);this._emitQueue.length=0;for(var i=0;i<r.length;i++){var o=r[i];this._emitMatch(o[0],o[1])}}if(this._processQueue.length){var a=this._processQueue.slice(0);this._processQueue.length=0;for(var i=0;i<a.length;i++){var l=a[i];this._processing--;this._process(l[0],l[1],l[2],l[3])}}}};Glob.prototype._process=function(r,i,o,a){m(this instanceof Glob);m(typeof a==="function");if(this.aborted)return;this._processing++;if(this.paused){this._processQueue.push([r,i,o,a]);return}var l=0;while(typeof r[l]==="string"){l++}var c;switch(l){case r.length:this._processSimple(r.join("/"),i,a);return;case 0:c=null;break;default:c=r.slice(0,l).join("/");break}var h=r.slice(l);var d;if(c===null)d=".";else if(g(c)||g(r.join("/"))){if(!c||!g(c))c="/"+c;d=c}else d=c;var p=this._makeAbs(d);if(x(this,d))return a();var y=h[0]===u.GLOBSTAR;if(y)this._processGlobStar(c,d,p,h,i,o,a);else this._processReaddir(c,d,p,h,i,o,a)};Glob.prototype._processReaddir=function(r,i,o,a,l,u,c){var h=this;this._readdir(o,u,(function(d,p){return h._processReaddir2(r,i,o,a,l,u,p,c)}))};Glob.prototype._processReaddir2=function(r,i,o,a,l,u,c,h){if(!c)return h();var d=a[0];var m=!!this.minimatch.negate;var g=d._glob;var y=this.dot||g.charAt(0)===".";var v=[];for(var b=0;b<c.length;b++){var w=c[b];if(w.charAt(0)!=="."||y){var M;if(m&&!r){M=!w.match(d)}else{M=w.match(d)}if(M)v.push(w)}}var E=v.length;if(E===0)return h();if(a.length===1&&!this.mark&&!this.stat){if(!this.matches[l])this.matches[l]=Object.create(null);for(var b=0;b<E;b++){var w=v[b];if(r){if(r!=="/")w=r+"/"+w;else w=r+w}if(w.charAt(0)==="/"&&!this.nomount){w=p.join(this.root,w)}this._emitMatch(l,w)}return h()}a.shift();for(var b=0;b<E;b++){var w=v[b];var D;if(r){if(r!=="/")w=r+"/"+w;else w=r+w}this._process([w].concat(a),l,u,h)}h()};Glob.prototype._emitMatch=function(r,i){if(this.aborted)return;if(O(this,i))return;if(this.paused){this._emitQueue.push([r,i]);return}var o=g(i)?i:this._makeAbs(i);if(this.mark)i=this._mark(i);if(this.absolute)i=o;if(this.matches[r][i])return;if(this.nodir){var a=this.cache[o];if(a==="DIR"||Array.isArray(a))return}this.matches[r][i]=true;var l=this.statCache[o];if(l)this.emit("stat",i,l);this.emit("match",i)};Glob.prototype._readdirInGlobStar=function(r,i){if(this.aborted)return;if(this.follow)return this._readdir(r,false,i);var o="lstat\0"+r;var l=this;var u=D(o,lstatcb_);if(u)a.lstat(r,u);function lstatcb_(o,a){if(o&&o.code==="ENOENT")return i();var u=a&&a.isSymbolicLink();l.symlinks[r]=u;if(!u&&a&&!a.isDirectory()){l.cache[r]="FILE";i()}else l._readdir(r,false,i)}};Glob.prototype._readdir=function(r,i,o){if(this.aborted)return;o=D("readdir\0"+r+"\0"+i,o);if(!o)return;if(i&&!E(this.symlinks,r))return this._readdirInGlobStar(r,o);if(E(this.cache,r)){var l=this.cache[r];if(!l||l==="FILE")return o();if(Array.isArray(l))return o(null,l)}var u=this;a.readdir(r,readdirCb(this,r,o))};function readdirCb(r,i,o){return function(a,l){if(a)r._readdirError(i,a,o);else r._readdirEntries(i,l,o)}}Glob.prototype._readdirEntries=function(r,i,o){if(this.aborted)return;if(!this.mark&&!this.stat){for(var a=0;a<i.length;a++){var l=i[a];if(r==="/")l=r+l;else l=r+"/"+l;this.cache[l]=true}}this.cache[r]=i;return o(null,i)};Glob.prototype._readdirError=function(r,i,o){if(this.aborted)return;switch(i.code){case"ENOTSUP":case"ENOTDIR":var a=this._makeAbs(r);this.cache[a]="FILE";if(a===this.cwdAbs){var l=new Error(i.code+" invalid cwd "+this.cwd);l.path=this.cwd;l.code=i.code;this.emit("error",l);this.abort()}break;case"ENOENT":case"ELOOP":case"ENAMETOOLONG":case"UNKNOWN":this.cache[this._makeAbs(r)]=false;break;default:this.cache[this._makeAbs(r)]=false;if(this.strict){this.emit("error",i);this.abort()}if(!this.silent)console.error("glob error",i);break}return o()};Glob.prototype._processGlobStar=function(r,i,o,a,l,u,c){var h=this;this._readdir(o,u,(function(d,p){h._processGlobStar2(r,i,o,a,l,u,p,c)}))};Glob.prototype._processGlobStar2=function(r,i,o,a,l,u,c,h){if(!c)return h();var d=a.slice(1);var p=r?[r]:[];var m=p.concat(d);this._process(m,l,false,h);var g=this.symlinks[o];var y=c.length;if(g&&u)return h();for(var v=0;v<y;v++){var b=c[v];if(b.charAt(0)==="."&&!this.dot)continue;var w=p.concat(c[v],d);this._process(w,l,true,h);var M=p.concat(c[v],a);this._process(M,l,true,h)}h()};Glob.prototype._processSimple=function(r,i,o){var a=this;this._stat(r,(function(l,u){a._processSimple2(r,i,l,u,o)}))};Glob.prototype._processSimple2=function(r,i,o,a,l){if(!this.matches[i])this.matches[i]=Object.create(null);if(!a)return l();if(r&&g(r)&&!this.nomount){var u=/[\/\\]$/.test(r);if(r.charAt(0)==="/"){r=p.join(this.root,r)}else{r=p.resolve(this.root,r);if(u)r+="/"}}if(process.platform==="win32")r=r.replace(/\\/g,"/");this._emitMatch(i,r);l()};Glob.prototype._stat=function(r,i){var o=this._makeAbs(r);var l=r.slice(-1)==="/";if(r.length>this.maxLength)return i();if(!this.stat&&E(this.cache,o)){var u=this.cache[o];if(Array.isArray(u))u="DIR";if(!l||u==="DIR")return i(null,u);if(l&&u==="FILE")return i()}var c;var h=this.statCache[o];if(h!==undefined){if(h===false)return i(null,h);else{var d=h.isDirectory()?"DIR":"FILE";if(l&&d==="FILE")return i();else return i(null,d,h)}}var p=this;var m=D("stat\0"+o,lstatcb_);if(m)a.lstat(o,m);function lstatcb_(l,u){if(u&&u.isSymbolicLink()){return a.stat(o,(function(a,l){if(a)p._stat2(r,o,null,u,i);else p._stat2(r,o,a,l,i)}))}else{p._stat2(r,o,l,u,i)}}};Glob.prototype._stat2=function(r,i,o,a,l){if(o&&(o.code==="ENOENT"||o.code==="ENOTDIR")){this.statCache[i]=false;return l()}var u=r.slice(-1)==="/";this.statCache[i]=a;if(i.slice(-1)==="/"&&a&&!a.isDirectory())return l(null,false,a);var c=true;if(a)c=a.isDirectory()?"DIR":"FILE";this.cache[i]=this.cache[i]||c;if(u&&c==="FILE")return l();return l(null,c,a)}},2231:(r,i,o)=>{r.exports=globSync;globSync.GlobSync=GlobSync;var a=o(7147);var l=o(8945);var u=o(9566);var c=u.Minimatch;var h=o(1104).Glob;var d=o(3837);var p=o(1017);var m=o(9491);var g=o(1323);var y=o(9686);var v=y.alphasort;var b=y.alphasorti;var w=y.setopts;var M=y.ownProp;var E=y.childrenIgnored;var D=y.isIgnored;function globSync(r,i){if(typeof i==="function"||arguments.length===3)throw new TypeError("callback provided to sync glob\n"+"See: https://github.com/isaacs/node-glob/issues/167");return new GlobSync(r,i).found}function GlobSync(r,i){if(!r)throw new Error("must provide pattern");if(typeof i==="function"||arguments.length===3)throw new TypeError("callback provided to sync glob\n"+"See: https://github.com/isaacs/node-glob/issues/167");if(!(this instanceof GlobSync))return new GlobSync(r,i);w(this,r,i);if(this.noprocess)return this;var o=this.minimatch.set.length;this.matches=new Array(o);for(var a=0;a<o;a++){this._process(this.minimatch.set[a],a,false)}this._finish()}GlobSync.prototype._finish=function(){m(this instanceof GlobSync);if(this.realpath){var r=this;this.matches.forEach((function(i,o){var a=r.matches[o]=Object.create(null);for(var u in i){try{u=r._makeAbs(u);var c=l.realpathSync(u,r.realpathCache);a[c]=true}catch(i){if(i.syscall==="stat")a[r._makeAbs(u)]=true;else throw i}}}))}y.finish(this)};GlobSync.prototype._process=function(r,i,o){m(this instanceof GlobSync);var a=0;while(typeof r[a]==="string"){a++}var l;switch(a){case r.length:this._processSimple(r.join("/"),i);return;case 0:l=null;break;default:l=r.slice(0,a).join("/");break}var c=r.slice(a);var h;if(l===null)h=".";else if(g(l)||g(r.join("/"))){if(!l||!g(l))l="/"+l;h=l}else h=l;var d=this._makeAbs(h);if(E(this,h))return;var p=c[0]===u.GLOBSTAR;if(p)this._processGlobStar(l,h,d,c,i,o);else this._processReaddir(l,h,d,c,i,o)};GlobSync.prototype._processReaddir=function(r,i,o,a,l,u){var c=this._readdir(o,u);if(!c)return;var h=a[0];var d=!!this.minimatch.negate;var m=h._glob;var g=this.dot||m.charAt(0)===".";var y=[];for(var v=0;v<c.length;v++){var b=c[v];if(b.charAt(0)!=="."||g){var w;if(d&&!r){w=!b.match(h)}else{w=b.match(h)}if(w)y.push(b)}}var M=y.length;if(M===0)return;if(a.length===1&&!this.mark&&!this.stat){if(!this.matches[l])this.matches[l]=Object.create(null);for(var v=0;v<M;v++){var b=y[v];if(r){if(r.slice(-1)!=="/")b=r+"/"+b;else b=r+b}if(b.charAt(0)==="/"&&!this.nomount){b=p.join(this.root,b)}this._emitMatch(l,b)}return}a.shift();for(var v=0;v<M;v++){var b=y[v];var E;if(r)E=[r,b];else E=[b];this._process(E.concat(a),l,u)}};GlobSync.prototype._emitMatch=function(r,i){if(D(this,i))return;var o=this._makeAbs(i);if(this.mark)i=this._mark(i);if(this.absolute){i=o}if(this.matches[r][i])return;if(this.nodir){var a=this.cache[o];if(a==="DIR"||Array.isArray(a))return}this.matches[r][i]=true;if(this.stat)this._stat(i)};GlobSync.prototype._readdirInGlobStar=function(r){if(this.follow)return this._readdir(r,false);var i;var o;var l;try{o=a.lstatSync(r)}catch(r){if(r.code==="ENOENT"){return null}}var u=o&&o.isSymbolicLink();this.symlinks[r]=u;if(!u&&o&&!o.isDirectory())this.cache[r]="FILE";else i=this._readdir(r,false);return i};GlobSync.prototype._readdir=function(r,i){var o;if(i&&!M(this.symlinks,r))return this._readdirInGlobStar(r);if(M(this.cache,r)){var l=this.cache[r];if(!l||l==="FILE")return null;if(Array.isArray(l))return l}try{return this._readdirEntries(r,a.readdirSync(r))}catch(i){this._readdirError(r,i);return null}};GlobSync.prototype._readdirEntries=function(r,i){if(!this.mark&&!this.stat){for(var o=0;o<i.length;o++){var a=i[o];if(r==="/")a=r+a;else a=r+"/"+a;this.cache[a]=true}}this.cache[r]=i;return i};GlobSync.prototype._readdirError=function(r,i){switch(i.code){case"ENOTSUP":case"ENOTDIR":var o=this._makeAbs(r);this.cache[o]="FILE";if(o===this.cwdAbs){var a=new Error(i.code+" invalid cwd "+this.cwd);a.path=this.cwd;a.code=i.code;throw a}break;case"ENOENT":case"ELOOP":case"ENAMETOOLONG":case"UNKNOWN":this.cache[this._makeAbs(r)]=false;break;default:this.cache[this._makeAbs(r)]=false;if(this.strict)throw i;if(!this.silent)console.error("glob error",i);break}};GlobSync.prototype._processGlobStar=function(r,i,o,a,l,u){var c=this._readdir(o,u);if(!c)return;var h=a.slice(1);var d=r?[r]:[];var p=d.concat(h);this._process(p,l,false);var m=c.length;var g=this.symlinks[o];if(g&&u)return;for(var y=0;y<m;y++){var v=c[y];if(v.charAt(0)==="."&&!this.dot)continue;var b=d.concat(c[y],h);this._process(b,l,true);var w=d.concat(c[y],a);this._process(w,l,true)}};GlobSync.prototype._processSimple=function(r,i){var o=this._stat(r);if(!this.matches[i])this.matches[i]=Object.create(null);if(!o)return;if(r&&g(r)&&!this.nomount){var a=/[\/\\]$/.test(r);if(r.charAt(0)==="/"){r=p.join(this.root,r)}else{r=p.resolve(this.root,r);if(a)r+="/"}}if(process.platform==="win32")r=r.replace(/\\/g,"/");this._emitMatch(i,r)};GlobSync.prototype._stat=function(r){var i=this._makeAbs(r);var o=r.slice(-1)==="/";if(r.length>this.maxLength)return false;if(!this.stat&&M(this.cache,i)){var l=this.cache[i];if(Array.isArray(l))l="DIR";if(!o||l==="DIR")return l;if(o&&l==="FILE")return false}var u;var c=this.statCache[i];if(!c){var h;try{h=a.lstatSync(i)}catch(r){if(r&&(r.code==="ENOENT"||r.code==="ENOTDIR")){this.statCache[i]=false;return false}}if(h&&h.isSymbolicLink()){try{c=a.statSync(i)}catch(r){c=h}}else{c=h}}this.statCache[i]=c;var l=true;if(c)l=c.isDirectory()?"DIR":"FILE";this.cache[i]=this.cache[i]||l;if(o&&l==="FILE")return false;return l};GlobSync.prototype._mark=function(r){return y.mark(this,r)};GlobSync.prototype._makeAbs=function(r){return y.makeAbs(this,r)}},208:function(r,i,o){"use strict";var a=this&&this.__createBinding||(Object.create?function(r,i,o,a){if(a===undefined)a=o;var l=Object.getOwnPropertyDescriptor(i,o);if(!l||("get"in l?!i.__esModule:l.writable||l.configurable)){l={enumerable:true,get:function(){return i[o]}}}Object.defineProperty(r,a,l)}:function(r,i,o,a){if(a===undefined)a=o;r[a]=i[o]});var l=this&&this.__setModuleDefault||(Object.create?function(r,i){Object.defineProperty(r,"default",{enumerable:true,value:i})}:function(r,i){r["default"]=i});var u=this&&this.__importStar||function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var o in r)if(o!=="default"&&Object.prototype.hasOwnProperty.call(r,o))a(i,r,o);l(i,r);return i};var c=this&&this.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(i,"__esModule",{value:true});i.getConfigPath=i.getProjectIdAsync=i.getAsync=i.openAsync=i.getAdbOutputAsync=i.removeAsync=i.addAsync=i.isAvailable=void 0;const h=o(4513);const d=u(o(365));const p=o(8853);const m=c(o(5642));const g=c(o(8746));const y=o(7147);const v=c(o(1017));const b=o(3329);const w="Activity not started, unable to resolve Intent";const M="error: ";function isAvailable(r){return(0,y.existsSync)(v.default.join(r,"android/app/src/main/AndroidManifest.xml"))||(0,y.existsSync)(v.default.join(r,"app/src/main/AndroidManifest.xml"))}i.isAvailable=isAvailable;async function addAsync({dryRun:r,uri:i,manifestPath:o,projectRoot:a}){const l=o??getConfigPath(a);let u=await readConfigAsync(l);if(!d.ensureManifestHasValidIntentFilter(u)){throw new b.CommandError(`Cannot add scheme "${i}" because the provided manifest does not have a valid Activity with \`android:launchMode="singleTask"\`.\nThis guide can help you get setup properly https://expo.fyi/setup-android-uri-scheme`,"add")}if(d.hasScheme(i,u)){console.log(g.default.yellow(`› Android: URI scheme "${i}" already exists in AndroidManifest.xml at: ${l}`));return false}u=d.appendScheme(i,u);if(r){console.log(g.default.magenta("Write manifest to: ",l));console.log((0,p.format)(u));return false}await writeConfigAsync(l,u);return true}i.addAsync=addAsync;async function removeAsync({dryRun:r,uri:i,manifestPath:o,projectRoot:a}){const l=o??getConfigPath(a);let u=await readConfigAsync(l);if(!d.ensureManifestHasValidIntentFilter(u)){throw new b.CommandError(`Cannot remove scheme "${i}" because the provided manifest does not have a valid Activity with \`android:launchMode="singleTask"\`.\nThis guide can help you get setup properly https://expo.fyi/setup-android-uri-scheme`,"remove")}if(!d.hasScheme(i,u)){console.log(g.default.yellow(`› Android: URI scheme "${i}" does not exist in AndroidManifest.xml at: ${l}`));return false}u=d.removeScheme(i,u);if(r){console.log(g.default.magenta("Write manifest to: ",l));console.log((0,p.format)(u));return false}await writeConfigAsync(l,u);return true}i.removeAsync=removeAsync;function whichADB(){if(process.env.ANDROID_HOME){return`${process.env.ANDROID_HOME}/platform-tools/adb`}return"adb"}async function getAdbOutputAsync(r){const i=whichADB();try{const o=await(0,m.default)(i,r);return o.stdout}catch(r){const i=r.stderr||r.stdout||"";let o=i.trim();if(o.startsWith(M)){o=o.substring(M.length)}throw new b.CommandError(o)}}i.getAdbOutputAsync=getAdbOutputAsync;async function openUrlAsync(...r){const i=await getAdbOutputAsync(["shell","am","start","-a","android.intent.action.VIEW","-d",...r.filter(Boolean)]);if(i.includes(w)){throw new b.CommandError(i.substring(i.indexOf("Error: ")))}return i}async function openAsync({uri:r,androidPackage:i}){return await openUrlAsync(r.replace(/&/g,String.raw`\&`),i??null)}i.openAsync=openAsync;async function getAsync({projectRoot:r,manifestPath:i}){const o=await readConfigAsync(i??getConfigPath(r));return await d.getSchemesFromManifest(o)}i.getAsync=getAsync;function getPackage(r){return r.manifest?.$?.package??null}async function getProjectIdAsync({projectRoot:r,manifestPath:i}){const o=i??getConfigPath(r);const a=await readConfigAsync(o);const l=getPackage(a);if(!l)throw new b.CommandError(`Android: Failed to resolve android package for Manifest at path: ${o}`);return l}i.getProjectIdAsync=getProjectIdAsync;function getConfigPath(r){const i=["android/app/src/main/AndroidManifest.xml","app/src/main/AndroidManifest.xml"].map((i=>v.default.join(r,i)));for(const r of i){if((0,y.existsSync)(r)){return r}}throw new Error(`Could not find AndroidManifest.xml, looked in: ${i.join(", ")}`)}i.getConfigPath=getConfigPath;async function readConfigAsync(r){return await(0,h.readAndroidManifestAsync)(r)}async function writeConfigAsync(r,i){await(0,h.writeAndroidManifestAsync)(r,i)}},5585:function(r,i,o){"use strict";var a=this&&this.__createBinding||(Object.create?function(r,i,o,a){if(a===undefined)a=o;var l=Object.getOwnPropertyDescriptor(i,o);if(!l||("get"in l?!i.__esModule:l.writable||l.configurable)){l={enumerable:true,get:function(){return i[o]}}}Object.defineProperty(r,a,l)}:function(r,i,o,a){if(a===undefined)a=o;r[a]=i[o]});var l=this&&this.__setModuleDefault||(Object.create?function(r,i){Object.defineProperty(r,"default",{enumerable:true,value:i})}:function(r,i){r["default"]=i});var u=this&&this.__importStar||function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var o in r)if(o!=="default"&&Object.prototype.hasOwnProperty.call(r,o))a(i,r,o);l(i,r);return i};var c=this&&this.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(i,"__esModule",{value:true});i.run=i.program=void 0;const h=c(o(8746));const d=o(8018);const p=o(1017);const m=u(o(208));const g=u(o(2194));const y=o(3329);const v=u(o(8522));const b=c(o(2586));const packageJson=()=>o(4147);i.program=new d.Command(packageJson().name).version(packageJson().version);function buildCommand(r,o=[]){return i.program.command(`${r} [uri-protocol]`).option("-a, --android","Apply action to Android").option("-i, --ios","Apply action to iOS ").on("--help",(()=>{if(!o.length)return;console.log();console.log("Examples:");console.log();for(const i of o){console.log(` $ uri-scheme ${r} ${i}`)}console.log()}))}buildCommand("add",["com.app","myapp"]).description("Add URI schemes to a native app").option("-n, --name <string>","Name to use on iOS.").option("-r, --role <string>","Role to use on iOS: Editor, Viewer").option("--manifest-path <string>","Custom path to use for an Android project's AndroidManifest.xml").option("--info-path <string>","Custom path to use for an iOS project's Info.plist").option("--dry-run","View the proposed change").action((async(r,i)=>{try{const o=await parseArgsAsync(r,i);await v.addAsync(o);(0,b.default)()}catch(r){commandDidThrowAsync(r)}}));buildCommand("remove",["com.app","myapp"]).description("Remove URI schemes from a native app").option("--manifest-path <string>","Custom path to use for an Android project's AndroidManifest.xml").option("--info-path <string>","Custom path to use for an iOS project's Info.plist").option("--dry-run","View the proposed change").action((async(r,i)=>{try{const o=await parseArgsAsync(r,i);await v.removeAsync(o);(0,b.default)()}catch(r){commandDidThrowAsync(r)}}));buildCommand("open",["com.app://oauth","http://expo.dev"]).description("Open a URI scheme in a running simulator or emulator").option("--package <string>","The Android package name to use when opening in an emulator").action((async(r,i)=>{try{if(!i.ios&&!i.android){throw new y.CommandError("Please provide a target platform with --ios or --android")}await v.openAsync({projectRoot:process.cwd(),...i,androidPackage:i["package"],uri:r});(0,b.default)()}catch(r){commandDidThrowAsync(r)}}));buildCommand("list").description("List the existing URI scheme prefixes for a native app").option("--manifest-path <string>","Custom path to use for an Android project's AndroidManifest.xml").option("--info-path <string>","Custom path to use for an iOS project's Info.plist").action((async(r,i)=>{try{const o=await parseArgsAsync(r,i);await v.listAsync(o);(0,b.default)()}catch(r){commandDidThrowAsync(r)}}));async function parseArgsAsync(r,i){const o=(0,p.resolve)(process.cwd());i.projectRoot=o;if(i.manifestPath)i.manifestPath=(0,p.resolve)(i.manifestPath);if(i.infoPath)i.infoPath=(0,p.resolve)(i.infoPath);const a=v.getAvailablePlatforms(i);let l=false;if(!i.android&&!i.ios){l=true;for(const r of a){i[r]=true}}else{if(i.android){if(!a.includes("android")){throw new y.CommandError(`Android project not found in directory "${o}".\nYou can manually select an AndroidManifest.xml with \`--manifest-path\``)}}if(i.ios){if(!a.includes("ios")){throw new y.CommandError(`iOS project not found in directory "${o}".\nYou can manually select an Info.plist with \`--info-path\``)}}}if(i.android&&!i.manifestPath){try{i.manifestPath=m.getConfigPath(o)}catch(r){if(l){delete i.android}else{throw r}}}if(i.ios&&!i.infoPath){try{i.infoPath=g.getConfigPath(o)}catch(r){if(l){delete i.ios}else{throw r}}}i.uri=r;return i}function run(){i.program.parse(process.argv)}i.run=run;async function commandDidThrowAsync(r){console.log();if(r.command){console.log(h.default.red(`› ${h.default.bold(`npx ${packageJson().name} ${r.command}`)} has failed.`));console.log()}if(r.origin==="uri-scheme"){console.log(h.default.black.bgRed(r.message))}else{console.log("Aborting run");console.log(h.default.black.bgRed`An unexpected error was encountered. Please report it as a bug:`);console.log(r)}console.log();await(0,b.default)();process.exit(1)}},2194:function(r,i,o){"use strict";var a=this&&this.__createBinding||(Object.create?function(r,i,o,a){if(a===undefined)a=o;var l=Object.getOwnPropertyDescriptor(i,o);if(!l||("get"in l?!i.__esModule:l.writable||l.configurable)){l={enumerable:true,get:function(){return i[o]}}}Object.defineProperty(r,a,l)}:function(r,i,o,a){if(a===undefined)a=o;r[a]=i[o]});var l=this&&this.__setModuleDefault||(Object.create?function(r,i){Object.defineProperty(r,"default",{enumerable:true,value:i})}:function(r,i){r["default"]=i});var u=this&&this.__importStar||function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var o in r)if(o!=="default"&&Object.prototype.hasOwnProperty.call(r,o))a(i,r,o);l(i,r);return i};var c=this&&this.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(i,"__esModule",{value:true});i.getConfigPath=i.getAsync=i.openAsync=i.removeAsync=i.addAsync=i.isAvailable=void 0;const h=u(o(7903));const d=c(o(3681));const p=c(o(5642));const m=c(o(8746));const g=c(o(7147));const y=o(1104);const v=u(o(1017));const b=o(3329);const w=["**/@(Carthage|Pods|vendor|node_modules)/**"];function isAvailable(r){const i=(0,y.sync)("ios/*.xcodeproj",{ignore:w,absolute:true,cwd:r});const o=(0,y.sync)("*.xcodeproj",{ignore:w,absolute:true,cwd:r});return!!o.length||!!i.length}i.isAvailable=isAvailable;async function addAsync({uri:r,infoPath:i,projectRoot:o,dryRun:a}){const l=i??getConfigPath(o);let u=readConfig(l);if(h.hasScheme(r,u)){console.log(m.default.yellow(`› iOS: URI scheme "${r}" already exists in Info.plist at: ${l}`));return false}u=h.appendScheme(r,u);if(a){console.log(m.default.magenta("Write plist to: ",l));console.log(formatConfig(u));return false}writeConfig(l,u);return true}i.addAsync=addAsync;async function removeAsync({uri:r,infoPath:i,projectRoot:o,dryRun:a}){const l=i??getConfigPath(o);let u=readConfig(l);if(!h.hasScheme(r,u)){console.log(m.default.yellow(`› iOS: URI scheme "${r}" does not exist in Info.plist at: ${l}`));return false}u=h.removeScheme(r,u);if(a){console.log(m.default.magenta("Write plist to: ",l));console.log(formatConfig(u));return false}writeConfig(l,u);return true}i.removeAsync=removeAsync;async function openAsync({uri:r}){await(0,p.default)("xcrun",["simctl","openurl","booted",r],{stdio:"inherit"})}i.openAsync=openAsync;async function getAsync({projectRoot:r,infoPath:i}){const o=i??getConfigPath(r);const a=g.default.readFileSync(o,"utf8");const l=d.default.parse(a);const u=h.getSchemesFromPlist(l);return u}i.getAsync=getAsync;function getInfoPlistsInDirectory(r){return(0,y.sync)("*/Info.plist",{ignore:w,absolute:true,cwd:r}).sort(((r,i)=>r.length-i.length))}function getConfigPath(r){const i=getInfoPlistsInDirectory(v.join(r,"ios"));if(i.length){return i[0]}const o=getInfoPlistsInDirectory(r);if(!o.length){throw new b.CommandError(`iOS: No Info.plist found for project at root: ${r}`)}return o[0]}i.getConfigPath=getConfigPath;function readConfig(r){const i=g.default.readFileSync(r,"utf8");return{...d.default.parse(i)}}function formatConfig(r){const i={pretty:true,indent:`\t`};const o=d.default.build(r,i);return o}function writeConfig(r,i){g.default.writeFileSync(r,formatConfig(i))}},3329:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.CommandError=void 0;class CommandError extends Error{command;origin="uri-scheme";constructor(r,i){super(r);this.command=i}}i.CommandError=CommandError},8522:function(r,i,o){"use strict";var a=this&&this.__createBinding||(Object.create?function(r,i,o,a){if(a===undefined)a=o;var l=Object.getOwnPropertyDescriptor(i,o);if(!l||("get"in l?!i.__esModule:l.writable||l.configurable)){l={enumerable:true,get:function(){return i[o]}}}Object.defineProperty(r,a,l)}:function(r,i,o,a){if(a===undefined)a=o;r[a]=i[o]});var l=this&&this.__setModuleDefault||(Object.create?function(r,i){Object.defineProperty(r,"default",{enumerable:true,value:i})}:function(r,i){r["default"]=i});var u=this&&this.__importStar||function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var o in r)if(o!=="default"&&Object.prototype.hasOwnProperty.call(r,o))a(i,r,o);l(i,r);return i};var c=this&&this.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(i,"__esModule",{value:true});i.listAsync=i.openAsync=i.removeAsync=i.addAsync=i.getAvailablePlatforms=void 0;const h=c(o(8746));const d=o(7147);const p=o(1017);const m=c(o(1112));const g=u(o(208));const y=u(o(2194));const v=o(3329);function fileExists(r){try{return(0,d.statSync)(r).isFile()}catch{return false}}function getAvailablePlatforms(r){const i=[];if(r.infoPath){if(!fileExists(r.infoPath)){throw new v.CommandError(`Custom Info.plist does not exist at path "${r.infoPath}"`)}i.push("ios")}else if(y.isAvailable(r.projectRoot)){i.push("ios")}if(r.manifestPath){if(!fileExists(r.manifestPath)){throw new v.CommandError(`Custom AndroidManifest.xml does not exist at path "${r.manifestPath}"`)}i.push("android")}else if(g.isAvailable(r.projectRoot)){i.push("android")}return i}i.getAvailablePlatforms=getAvailablePlatforms;function ensureUriString(r){if(!r){throw new v.CommandError("Please supply a URI protocol")}if(typeof r!=="string"){throw new v.CommandError(`URI protocol should be of type string. Instead got: ${typeof r}`)}return r.trim()}async function normalizeUriProtocolAsync(r){const i=ensureUriString(r);const[o]=i.split(":");const a=o.toLowerCase();if(a!==r){if(a){console.log(h.default.yellow(`› Supplied URI protocol "${i}" does not match normalized scheme "${a}".`));const{answer:r}=await(0,m.default)({type:"confirm",name:"answer",message:`Would you like to use "${a}" instead?`,initial:true});if(r)return a}else{throw new v.CommandError(`Supplied URI protocol "${i}" does not appear to be spec compliant: http://www.ietf.org/rfc/rfc2396.txt`)}}return i}async function addAsync(r){r.uri=await normalizeUriProtocolAsync(r.uri);const i=[];let o=false;if(r.ios){if(await y.addAsync(r)){o=true;logPlatformMessage("iOS",`Added URI protocol "${r.uri}" to project`);i.push("ios")}}if(r.android){if(await g.addAsync(r)){o=true;logPlatformMessage("Android",`Added URI protocol "${r.uri}" to project`);i.push("android")}}if(!o){console.log(h.default.yellow("No URI schemes could be added. Please ensure there is a native project available."))}return i}i.addAsync=addAsync;async function removeAsync(r){r.uri=ensureUriString(r.uri);const i=[];let o=false;if(r.ios){if(await y.removeAsync(r)){o=true;logPlatformMessage("iOS",`Removed URI protocol "${r.uri}" from project`);i.push("ios")}}if(r.android){if(await g.removeAsync(r)){o=true;logPlatformMessage("Android",`Removed URI protocol "${r.uri}" from project`);i.push("android")}}if(!o){console.log(h.default.yellow("No URI schemes could be removed. Please ensure there is a native project available."))}return i}i.removeAsync=removeAsync;async function openAsync(r){r.uri=ensureUriString(r.uri);if(r.ios){logPlatformMessage("iOS",`Opening URI "${r.uri}" in simulator`);await y.openAsync(r)}if(r.android){logPlatformMessage("Android",`Opening URI "${r.uri}" in emulator`);await g.openAsync(r)}}i.openAsync=openAsync;async function listAsync(r){let i=false;if(r.infoPath){i=true;const o=await y.getAsync(r);logPlatformMessage("iOS",`Schemes for config: ./${(0,p.relative)(r.projectRoot,r.infoPath)}`);logSchemes(o)}if(r.manifestPath){i=true;const o=await g.getAsync(r);logPlatformMessage("Android",`Schemes for config: ./${(0,p.relative)(r.projectRoot,r.manifestPath)}`);logSchemes(o)}if(!i){console.log(h.default.yellow("Could not find any native URI schemes to list."))}}i.listAsync=listAsync;function logPlatformMessage(r,i){console.log(h.default.magenta(`› ${h.default.bold(r)}: ${i}`))}function logSchemes(r){for(const i of r)console.log(`${h.default.dim("› ")}${i}${h.default.dim("://")}`);console.log("")}},2855:function(r,i,o){"use strict";var a=this&&this.__createBinding||(Object.create?function(r,i,o,a){if(a===undefined)a=o;var l=Object.getOwnPropertyDescriptor(i,o);if(!l||("get"in l?!i.__esModule:l.writable||l.configurable)){l={enumerable:true,get:function(){return i[o]}}}Object.defineProperty(r,a,l)}:function(r,i,o,a){if(a===undefined)a=o;r[a]=i[o]});var l=this&&this.__setModuleDefault||(Object.create?function(r,i){Object.defineProperty(r,"default",{enumerable:true,value:i})}:function(r,i){r["default"]=i});var u=this&&this.__importStar||function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var o in r)if(o!=="default"&&Object.prototype.hasOwnProperty.call(r,o))a(i,r,o);l(i,r);return i};Object.defineProperty(i,"__esModule",{value:true});i.URIScheme=i.Android=i.Ios=i.program=void 0;const c=u(o(208));i.Android=c;const h=u(o(2194));i.Ios=h;const d=u(o(8522));i.URIScheme=d;var p=o(5585);Object.defineProperty(i,"program",{enumerable:true,get:function(){return p.program}})},2586:function(r,i,o){"use strict";var a=this&&this.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(i,"__esModule",{value:true});const l=a(o(8746));const u=a(o(5418));async function shouldUpdate(){const packageJson=()=>o(4147);const r=(0,u.default)(packageJson()).catch((()=>null));try{const i=await r;if(i&&i.latest){const r=packageJson();console.log();console.log(l.default.yellow.bold(`A new version of \`${r.name}\` is available`));console.log("You can update by running: "+l.default.cyan(`npm i -g ${r.name}`));console.log()}}catch{}}i["default"]=shouldUpdate},9491:r=>{"use strict";r.exports=require("assert")},4300:r=>{"use strict";r.exports=require("buffer")},2081:r=>{"use strict";r.exports=require("child_process")},2361:r=>{"use strict";r.exports=require("events")},7147:r=>{"use strict";r.exports=require("fs")},3685:r=>{"use strict";r.exports=require("http")},5687:r=>{"use strict";r.exports=require("https")},2037:r=>{"use strict";r.exports=require("os")},1017:r=>{"use strict";r.exports=require("path")},4521:r=>{"use strict";r.exports=require("readline")},2781:r=>{"use strict";r.exports=require("stream")},1576:r=>{"use strict";r.exports=require("string_decoder")},9512:r=>{"use strict";r.exports=require("timers")},6224:r=>{"use strict";r.exports=require("tty")},7310:r=>{"use strict";r.exports=require("url")},3837:r=>{"use strict";r.exports=require("util")},4147:r=>{"use strict";r.exports=JSON.parse('{"name":"uri-scheme","version":"1.2.1","description":"Interact with native URI schemes","main":"build/index.js","keywords":["expo","ios","uri-scheme","android"],"repository":{"type":"git","url":"https://github.com/expo/expo.git","directory":"packages/uri-scheme"},"author":"Expo <support@expo.dev>","license":"MIT","bugs":{"url":"https://github.com/expo/expo/issues"},"homepage":"https://github.com/expo/expo/tree/main/packages/uri-scheme#readme","bin":"cli.js","files":["build","cli.js"],"scripts":{"build":"ncc build ./src/index.ts -o build/","build:prod":"ncc build ./src/index.ts -o build/ --minify --no-cache --no-source-map-register","clean":"expo-module clean","lint":"expo-module lint","prepare":"yarn run clean && yarn run build:prod","test":"expo-module test","typecheck":"expo-module typecheck","watch":"yarn run build --watch","prepublishOnly":"expo-module prepublishOnly"},"devDependencies":{"@expo/config-plugins":"^8.0.0-beta.0","@expo/plist":"^0.1.0","@expo/spawn-async":"^1.7.2","@types/prompts":"^2.0.6","chalk":"^4.0.0","commander":"2.20.0","expo-module-scripts":"^3.3.0","glob":"7.1.6","prompts":"^2.3.2","update-check":"^1.5.4"},"gitHead":"4165b8d72e1b9a1889c2767534cc619e21468110"}')}};var i={};function __nccwpck_require__(o){var a=i[o];if(a!==undefined){return a.exports}var l=i[o]={id:o,loaded:false,exports:{}};var u=true;try{r[o].call(l.exports,l,l.exports,__nccwpck_require__);u=false}finally{if(u)delete i[o]}l.loaded=true;return l.exports}(()=>{__nccwpck_require__.nmd=r=>{r.paths=[];if(!r.children)r.children=[];return r}})();if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var o=__nccwpck_require__(2855);module.exports=o})();
|
|
30
|
+
/*! http://mths.be/fromcodepoint v0.1.0 by @mathias */if(!String.fromCodePoint){(function(){var r=String.fromCharCode;var i=Math.floor;var fromCodePoint=function(){var o=16384;var a=[];var l;var u;var c=-1;var h=arguments.length;if(!h){return""}var d="";while(++c<h){var p=Number(arguments[c]);if(!isFinite(p)||p<0||p>1114111||i(p)!==p){throw RangeError("Invalid code point: "+p)}if(p<=65535){a.push(p)}else{p-=65536;l=(p>>10)+55296;u=p%1024+56320;a.push(l,u)}if(c+1===h||a.length>o){d+=r.apply(null,a);a.length=0}}return d};if(Object.defineProperty){Object.defineProperty(String,"fromCodePoint",{value:fromCodePoint,configurable:true,writable:true})}else{String.fromCodePoint=fromCodePoint}})()}})(false?0:i)},332:r=>{"use strict";const i="";const o=`${i}[`;const a="";const l={to(r,i){if(!i)return`${o}${r+1}G`;return`${o}${i+1};${r+1}H`},move(r,i){let a="";if(r<0)a+=`${o}${-r}D`;else if(r>0)a+=`${o}${r}C`;if(i<0)a+=`${o}${-i}A`;else if(i>0)a+=`${o}${i}B`;return a},up:(r=1)=>`${o}${r}A`,down:(r=1)=>`${o}${r}B`,forward:(r=1)=>`${o}${r}C`,backward:(r=1)=>`${o}${r}D`,nextLine:(r=1)=>`${o}E`.repeat(r),prevLine:(r=1)=>`${o}F`.repeat(r),left:`${o}G`,hide:`${o}?25l`,show:`${o}?25h`,save:`${i}7`,restore:`${i}8`};const u={up:(r=1)=>`${o}S`.repeat(r),down:(r=1)=>`${o}T`.repeat(r)};const c={screen:`${o}2J`,up:(r=1)=>`${o}1J`.repeat(r),down:(r=1)=>`${o}J`.repeat(r),line:`${o}2K`,lineEnd:`${o}K`,lineStart:`${o}1K`,lines(r){let i="";for(let o=0;o<r;o++)i+=this.line+(o<r-1?l.up():"");if(r)i+=l.left;return i}};r.exports={cursor:l,scroll:u,erase:c,beep:a}},395:(r,i,o)=>{"use strict";const a=o(2037);const l=o(6224);const u=o(6738);const{env:c}=process;let h;if(u("no-color")||u("no-colors")||u("color=false")||u("color=never")){h=0}else if(u("color")||u("colors")||u("color=true")||u("color=always")){h=1}if("FORCE_COLOR"in c){if(c.FORCE_COLOR==="true"){h=1}else if(c.FORCE_COLOR==="false"){h=0}else{h=c.FORCE_COLOR.length===0?1:Math.min(parseInt(c.FORCE_COLOR,10),3)}}function translateLevel(r){if(r===0){return false}return{level:r,hasBasic:true,has256:r>=2,has16m:r>=3}}function supportsColor(r,i){if(h===0){return 0}if(u("color=16m")||u("color=full")||u("color=truecolor")){return 3}if(u("color=256")){return 2}if(r&&!i&&h===undefined){return 0}const o=h||0;if(c.TERM==="dumb"){return o}if(process.platform==="win32"){const r=a.release().split(".");if(Number(r[0])>=10&&Number(r[2])>=10586){return Number(r[2])>=14931?3:2}return 1}if("CI"in c){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some((r=>r in c))||c.CI_NAME==="codeship"){return 1}return o}if("TEAMCITY_VERSION"in c){return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(c.TEAMCITY_VERSION)?1:0}if(c.COLORTERM==="truecolor"){return 3}if("TERM_PROGRAM"in c){const r=parseInt((c.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(c.TERM_PROGRAM){case"iTerm.app":return r>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(c.TERM)){return 2}if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(c.TERM)){return 1}if("COLORTERM"in c){return 1}return o}function getSupportLevel(r){const i=supportsColor(r,r&&r.isTTY);return translateLevel(i)}r.exports={supportsColor:getSupportLevel,stdout:translateLevel(supportsColor(true,l.isatty(1))),stderr:translateLevel(supportsColor(true,l.isatty(2)))}},5418:(r,i,o)=>{const{URL:a}=o(7310);const{join:l}=o(1017);const u=o(7147);const{promisify:c}=o(3837);const{tmpdir:h}=o(2037);const d=o(2447);const p=c(u.writeFile);const m=c(u.mkdir);const g=c(u.readFile);const compareVersions=(r,i)=>r.localeCompare(i,"en-US",{numeric:true});const encode=r=>encodeURIComponent(r).replace(/^%40/,"@");const getFile=async(r,i)=>{const o=h();const a=l(o,"update-check");if(!u.existsSync(a)){await m(a)}let c=`${r.name}-${i}.json`;if(r.scope){c=`${r.scope}-${c}`}return l(a,c)};const evaluateCache=async(r,i,o)=>{if(u.existsSync(r)){const a=await g(r,"utf8");const{lastUpdate:l,latest:u}=JSON.parse(a);const c=l+o;if(c>i){return{shouldCheck:false,latest:u}}}return{shouldCheck:true,latest:null}};const updateCache=async(r,i,o)=>{const a=JSON.stringify({latest:i,lastUpdate:o});await p(r,a,"utf8")};const loadPackage=(r,i)=>new Promise(((a,l)=>{const u={host:r.hostname,path:r.pathname,port:r.port,headers:{accept:"application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"},timeout:2e3};if(i){u.headers.authorization=`${i.type} ${i.token}`}const{get:c}=o(r.protocol==="https:"?5687:3685);c(u,(r=>{const{statusCode:i}=r;if(i!==200){const o=new Error(`Request failed with code ${i}`);o.code=i;l(o);r.resume();return}let o="";r.setEncoding("utf8");r.on("data",(r=>{o+=r}));r.on("end",(()=>{try{const r=JSON.parse(o);a(r)}catch(r){l(r)}}))})).on("error",l).on("timeout",l)}));const getMostRecent=async({full:r,scope:i},l)=>{const u=d(i);const c=new a(r,u);let h=null;try{h=await loadPackage(c)}catch(r){if(r.code&&String(r.code).startsWith(4)){const r=o(1384);const i=r(u,{recursive:true});h=await loadPackage(c,i)}else{throw r}}const p=h["dist-tags"][l];if(!p){throw new Error(`Distribution tag ${l} is not available`)}return p};const y={interval:36e5,distTag:"latest"};const getDetails=r=>{const i={full:encode(r)};if(r.includes("/")){const o=r.split("/");i.scope=o[0];i.name=o[1]}else{i.scope=null;i.name=r}return i};r.exports=async(r,i)=>{if(typeof r!=="object"){throw new Error("The first parameter should be your package.json file content")}const o=getDetails(r.name);const a=Date.now();const{distTag:l,interval:u}=Object.assign({},y,i);const c=await getFile(o,l);let h=null;let d=true;({shouldCheck:d,latest:h}=await evaluateCache(c,a,u));if(d){h=await getMostRecent(o,l);await updateCache(c,h,a)}const p=compareVersions(r.version,h);if(p===-1){return{latest:h,fromCache:!d}}return null}},4586:r=>{r.exports=wrappy;function wrappy(r,i){if(r&&i)return wrappy(r)(i);if(typeof r!=="function")throw new TypeError("need wrapper function");Object.keys(r).forEach((function(i){wrapper[i]=r[i]}));return wrapper;function wrapper(){var i=new Array(arguments.length);for(var o=0;o<i.length;o++){i[o]=arguments[o]}var a=r.apply(this,i);var l=i[i.length-1];if(typeof a==="function"&&a!==l){Object.keys(l).forEach((function(r){a[r]=l[r]}))}return a}}},4604:function(r,i){(function(){"use strict";i.stripBOM=function(r){if(r[0]==="\ufeff"){return r.substring(1)}else{return r}}}).call(this)},1002:function(r,i,o){(function(){"use strict";var r,a,l,u,c,h={}.hasOwnProperty;r=o(3131);a=o(9498).defaults;u=function(r){return typeof r==="string"&&(r.indexOf("&")>=0||r.indexOf(">")>=0||r.indexOf("<")>=0)};c=function(r){return"<![CDATA["+l(r)+"]]>"};l=function(r){return r.replace("]]>","]]]]><![CDATA[>")};i.Builder=function(){function Builder(r){var i,o,l;this.options={};o=a["0.2"];for(i in o){if(!h.call(o,i))continue;l=o[i];this.options[i]=l}for(i in r){if(!h.call(r,i))continue;l=r[i];this.options[i]=l}}Builder.prototype.buildObject=function(i){var o,l,d,p,m;o=this.options.attrkey;l=this.options.charkey;if(Object.keys(i).length===1&&this.options.rootName===a["0.2"].rootName){m=Object.keys(i)[0];i=i[m]}else{m=this.options.rootName}d=function(r){return function(i,a){var p,m,g,y,v,b;if(typeof a!=="object"){if(r.options.cdata&&u(a)){i.raw(c(a))}else{i.txt(a)}}else if(Array.isArray(a)){for(y in a){if(!h.call(a,y))continue;m=a[y];for(v in m){g=m[v];i=d(i.ele(v),g).up()}}}else{for(v in a){if(!h.call(a,v))continue;m=a[v];if(v===o){if(typeof m==="object"){for(p in m){b=m[p];i=i.att(p,b)}}}else if(v===l){if(r.options.cdata&&u(m)){i=i.raw(c(m))}else{i=i.txt(m)}}else if(Array.isArray(m)){for(y in m){if(!h.call(m,y))continue;g=m[y];if(typeof g==="string"){if(r.options.cdata&&u(g)){i=i.ele(v).raw(c(g)).up()}else{i=i.ele(v,g).up()}}else{i=d(i.ele(v),g).up()}}}else if(typeof m==="object"){i=d(i.ele(v),m).up()}else{if(typeof m==="string"&&r.options.cdata&&u(m)){i=i.ele(v).raw(c(m)).up()}else{if(m==null){m=""}i=i.ele(v,m.toString()).up()}}}}return i}}(this);p=r.create(m,this.options.xmldec,this.options.doctype,{headless:this.options.headless,allowSurrogateChars:this.options.allowSurrogateChars});return d(p,i).end(this.options.renderOpts)};return Builder}()}).call(this)},9498:function(r,i){(function(){i.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)},7426:function(r,i,o){(function(){"use strict";var r,a,l,u,c,h,d,p,m,bind=function(r,i){return function(){return r.apply(i,arguments)}},extend=function(r,i){for(var o in i){if(g.call(i,o))r[o]=i[o]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},g={}.hasOwnProperty;p=o(9746);l=o(2361);r=o(4604);d=o(9068);m=o(9512).setImmediate;a=o(9498).defaults;u=function(r){return typeof r==="object"&&r!=null&&Object.keys(r).length===0};c=function(r){return r!=="__proto__"&&r!=="constructor"&&r!=="prototype"};h=function(r,i,o){var a,l,u;for(a=0,l=r.length;a<l;a++){u=r[a];i=u(i,o)}return i};i.Parser=function(o){extend(Parser,o);function Parser(r){this.parseStringPromise=bind(this.parseStringPromise,this);this.parseString=bind(this.parseString,this);this.reset=bind(this.reset,this);this.assignOrPush=bind(this.assignOrPush,this);this.processAsync=bind(this.processAsync,this);var o,l,u;if(!(this instanceof i.Parser)){return new i.Parser(r)}this.options={};l=a["0.2"];for(o in l){if(!g.call(l,o))continue;u=l[o];this.options[o]=u}for(o in r){if(!g.call(r,o))continue;u=r[o];this.options[o]=u}if(this.options.xmlns){this.options.xmlnskey=this.options.attrkey+"ns"}if(this.options.normalizeTags){if(!this.options.tagNameProcessors){this.options.tagNameProcessors=[]}this.options.tagNameProcessors.unshift(d.normalize)}this.reset()}Parser.prototype.processAsync=function(){var r,i;try{if(this.remaining.length<=this.options.chunkSize){r=this.remaining;this.remaining="";this.saxParser=this.saxParser.write(r);return this.saxParser.close()}else{r=this.remaining.substr(0,this.options.chunkSize);this.remaining=this.remaining.substr(this.options.chunkSize,this.remaining.length);this.saxParser=this.saxParser.write(r);return m(this.processAsync)}}catch(r){i=r;if(!this.saxParser.errThrown){this.saxParser.errThrown=true;return this.emit(i)}}};Parser.prototype.assignOrPush=function(r,i,o){if(!c(i)){return}if(!(i in r)){if(!this.options.explicitArray){return r[i]=o}else{return r[i]=[o]}}else{if(!(r[i]instanceof Array)){r[i]=[r[i]]}return r[i].push(o)}};Parser.prototype.reset=function(){var r,i,o,a;this.removeAllListeners();this.saxParser=p.parser(this.options.strict,{trim:false,normalize:false,xmlns:this.options.xmlns});this.saxParser.errThrown=false;this.saxParser.onerror=function(r){return function(i){r.saxParser.resume();if(!r.saxParser.errThrown){r.saxParser.errThrown=true;return r.emit("error",i)}}}(this);this.saxParser.onend=function(r){return function(){if(!r.saxParser.ended){r.saxParser.ended=true;return r.emit("end",r.resultObject)}}}(this);this.saxParser.ended=false;this.EXPLICIT_CHARKEY=this.options.explicitCharkey;this.resultObject=null;a=[];r=this.options.attrkey;i=this.options.charkey;this.saxParser.onopentag=function(o){return function(l){var u,d,p,m,y;p={};p[i]="";if(!o.options.ignoreAttrs){y=l.attributes;for(u in y){if(!g.call(y,u))continue;if(!(r in p)&&!o.options.mergeAttrs){p[r]={}}d=o.options.attrValueProcessors?h(o.options.attrValueProcessors,l.attributes[u],u):l.attributes[u];m=o.options.attrNameProcessors?h(o.options.attrNameProcessors,u):u;if(c(m)){if(o.options.mergeAttrs){o.assignOrPush(p,m,d)}else{p[r][m]=d}}}}p["#name"]=o.options.tagNameProcessors?h(o.options.tagNameProcessors,l.name):l.name;if(o.options.xmlns){p[o.options.xmlnskey]={uri:l.uri,local:l.local}}return a.push(p)}}(this);this.saxParser.onclosetag=function(r){return function(){var o,l,d,p,m,y,v,b,w,M;y=a.pop();m=y["#name"];if(!r.options.explicitChildren||!r.options.preserveChildrenOrder){delete y["#name"]}if(y.cdata===true){o=y.cdata;delete y.cdata}w=a[a.length-1];if(y[i].match(/^\s*$/)&&!o){l=y[i];delete y[i]}else{if(r.options.trim){y[i]=y[i].trim()}if(r.options.normalize){y[i]=y[i].replace(/\s{2,}/g," ").trim()}y[i]=r.options.valueProcessors?h(r.options.valueProcessors,y[i],m):y[i];if(Object.keys(y).length===1&&i in y&&!r.EXPLICIT_CHARKEY){y=y[i]}}if(u(y)){if(typeof r.options.emptyTag==="function"){y=r.options.emptyTag()}else{y=r.options.emptyTag!==""?r.options.emptyTag:l}}if(r.options.validator!=null){M="/"+function(){var r,i,o;o=[];for(r=0,i=a.length;r<i;r++){p=a[r];o.push(p["#name"])}return o}().concat(m).join("/");(function(){var i;try{return y=r.options.validator(M,w&&w[m],y)}catch(o){i=o;return r.emit("error",i)}})()}if(r.options.explicitChildren&&!r.options.mergeAttrs&&typeof y==="object"){if(!r.options.preserveChildrenOrder){p={};if(r.options.attrkey in y){p[r.options.attrkey]=y[r.options.attrkey];delete y[r.options.attrkey]}if(!r.options.charsAsChildren&&r.options.charkey in y){p[r.options.charkey]=y[r.options.charkey];delete y[r.options.charkey]}if(Object.getOwnPropertyNames(y).length>0){p[r.options.childkey]=y}y=p}else if(w){w[r.options.childkey]=w[r.options.childkey]||[];v={};for(d in y){if(!g.call(y,d))continue;if(c(d)){v[d]=y[d]}}w[r.options.childkey].push(v);delete y["#name"];if(Object.keys(y).length===1&&i in y&&!r.EXPLICIT_CHARKEY){y=y[i]}}}if(a.length>0){return r.assignOrPush(w,m,y)}else{if(r.options.explicitRoot){b=y;y={};y[m]=b}r.resultObject=y;r.saxParser.ended=true;return r.emit("end",r.resultObject)}}}(this);o=function(r){return function(o){var l,u;u=a[a.length-1];if(u){u[i]+=o;if(r.options.explicitChildren&&r.options.preserveChildrenOrder&&r.options.charsAsChildren&&(r.options.includeWhiteChars||o.replace(/\\n/g,"").trim()!=="")){u[r.options.childkey]=u[r.options.childkey]||[];l={"#name":"__text__"};l[i]=o;if(r.options.normalize){l[i]=l[i].replace(/\s{2,}/g," ").trim()}u[r.options.childkey].push(l)}return u}}}(this);this.saxParser.ontext=o;return this.saxParser.oncdata=function(r){return function(r){var i;i=o(r);if(i){return i.cdata=true}}}(this)};Parser.prototype.parseString=function(i,o){var a;if(o!=null&&typeof o==="function"){this.on("end",(function(r){this.reset();return o(null,r)}));this.on("error",(function(r){this.reset();return o(r)}))}try{i=i.toString();if(i.trim()===""){this.emit("end",null);return true}i=r.stripBOM(i);if(this.options.async){this.remaining=i;m(this.processAsync);return this.saxParser}return this.saxParser.write(i).close()}catch(r){a=r;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(r){return new Promise(function(i){return function(o,a){return i.parseString(r,(function(r,i){if(r){return a(r)}else{return o(i)}}))}}(this))};return Parser}(l);i.parseString=function(r,o,a){var l,u,c;if(a!=null){if(typeof a==="function"){l=a}if(typeof o==="object"){u=o}}else{if(typeof o==="function"){l=o}u={}}c=new i.Parser(u);return c.parseString(r,l)};i.parseStringPromise=function(r,o){var a,l;if(typeof o==="object"){a=o}l=new i.Parser(a);return l.parseStringPromise(r)}}).call(this)},9068:function(r,i){(function(){"use strict";var r;r=new RegExp(/(?!xmlns)^.*:/);i.normalize=function(r){return r.toLowerCase()};i.firstCharLowerCase=function(r){return r.charAt(0).toLowerCase()+r.slice(1)};i.stripPrefix=function(i){return i.replace(r,"")};i.parseNumbers=function(r){if(!isNaN(r)){r=r%1===0?parseInt(r,10):parseFloat(r)}return r};i.parseBooleans=function(r){if(/^(?:true|false)$/i.test(r)){r=r.toLowerCase()==="true"}return r}}).call(this)},7013:function(r,i,o){(function(){"use strict";var r,a,l,u,extend=function(r,i){for(var o in i){if(c.call(i,o))r[o]=i[o]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},c={}.hasOwnProperty;a=o(9498);r=o(1002);l=o(7426);u=o(9068);i.defaults=a.defaults;i.processors=u;i.ValidationError=function(r){extend(ValidationError,r);function ValidationError(r){this.message=r}return ValidationError}(Error);i.Builder=r.Builder;i.Parser=l.Parser;i.parseString=l.parseString;i.parseStringPromise=l.parseStringPromise}).call(this)},2346:function(r){(function(){r.exports={Disconnected:1,Preceding:2,Following:4,Contains:8,ContainedBy:16,ImplementationSpecific:32}}).call(this)},4128:function(r){(function(){r.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)},2629:function(r){(function(){var i,o,a,l,u,c,h,d=[].slice,p={}.hasOwnProperty;i=function(){var r,i,o,a,l,c;c=arguments[0],l=2<=arguments.length?d.call(arguments,1):[];if(u(Object.assign)){Object.assign.apply(null,arguments)}else{for(r=0,o=l.length;r<o;r++){a=l[r];if(a!=null){for(i in a){if(!p.call(a,i))continue;c[i]=a[i]}}}}return c};u=function(r){return!!r&&Object.prototype.toString.call(r)==="[object Function]"};c=function(r){var i;return!!r&&((i=typeof r)==="function"||i==="object")};a=function(r){if(u(Array.isArray)){return Array.isArray(r)}else{return Object.prototype.toString.call(r)==="[object Array]"}};l=function(r){var i;if(a(r)){return!r.length}else{for(i in r){if(!p.call(r,i))continue;return false}return true}};h=function(r){var i,o;return c(r)&&(o=Object.getPrototypeOf(r))&&(i=o.constructor)&&typeof i==="function"&&i instanceof i&&Function.prototype.toString.call(i)===Function.prototype.toString.call(Object)};o=function(r){if(u(r.valueOf)){return r.valueOf()}else{return r}};r.exports.assign=i;r.exports.isFunction=u;r.exports.isObject=c;r.exports.isArray=a;r.exports.isEmpty=l;r.exports.isPlainObject=h;r.exports.getValue=o}).call(this)},8413:function(r){(function(){r.exports={None:0,OpenTag:1,InsideTag:2,CloseTag:3}}).call(this)},9525:function(r,i,o){(function(){var i,a,l;i=o(4128);l=o(8064);r.exports=a=function(){function XMLAttribute(r,o,a){this.parent=r;if(this.parent){this.options=this.parent.options;this.stringify=this.parent.stringify}if(o==null){throw new Error("Missing attribute name. "+this.debugInfo(o))}this.name=this.stringify.name(o);this.value=this.stringify.attValue(a);this.type=i.Attribute;this.isId=false;this.schemaTypeInfo=null}Object.defineProperty(XMLAttribute.prototype,"nodeType",{get:function(){return this.type}});Object.defineProperty(XMLAttribute.prototype,"ownerElement",{get:function(){return this.parent}});Object.defineProperty(XMLAttribute.prototype,"textContent",{get:function(){return this.value},set:function(r){return this.value=r||""}});Object.defineProperty(XMLAttribute.prototype,"namespaceURI",{get:function(){return""}});Object.defineProperty(XMLAttribute.prototype,"prefix",{get:function(){return""}});Object.defineProperty(XMLAttribute.prototype,"localName",{get:function(){return this.name}});Object.defineProperty(XMLAttribute.prototype,"specified",{get:function(){return true}});XMLAttribute.prototype.clone=function(){return Object.create(this)};XMLAttribute.prototype.toString=function(r){return this.options.writer.attribute(this,this.options.writer.filterOptions(r))};XMLAttribute.prototype.debugInfo=function(r){r=r||this.name;if(r==null){return"parent: <"+this.parent.name+">"}else{return"attribute: {"+r+"}, parent: <"+this.parent.name+">"}};XMLAttribute.prototype.isEqualNode=function(r){if(r.namespaceURI!==this.namespaceURI){return false}if(r.prefix!==this.prefix){return false}if(r.localName!==this.localName){return false}if(r.value!==this.value){return false}return true};return XMLAttribute}()}).call(this)},6789:function(r,i,o){(function(){var i,a,l,extend=function(r,i){for(var o in i){if(u.call(i,o))r[o]=i[o]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},u={}.hasOwnProperty;i=o(4128);l=o(3527);r.exports=a=function(r){extend(XMLCData,r);function XMLCData(r,o){XMLCData.__super__.constructor.call(this,r);if(o==null){throw new Error("Missing CDATA text. "+this.debugInfo())}this.name="#cdata-section";this.type=i.CData;this.value=this.stringify.cdata(o)}XMLCData.prototype.clone=function(){return Object.create(this)};XMLCData.prototype.toString=function(r){return this.options.writer.cdata(this,this.options.writer.filterOptions(r))};return XMLCData}(l)}).call(this)},3527:function(r,i,o){(function(){var i,a,extend=function(r,i){for(var o in i){if(l.call(i,o))r[o]=i[o]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},l={}.hasOwnProperty;a=o(8064);r.exports=i=function(r){extend(XMLCharacterData,r);function XMLCharacterData(r){XMLCharacterData.__super__.constructor.call(this,r);this.value=""}Object.defineProperty(XMLCharacterData.prototype,"data",{get:function(){return this.value},set:function(r){return this.value=r||""}});Object.defineProperty(XMLCharacterData.prototype,"length",{get:function(){return this.value.length}});Object.defineProperty(XMLCharacterData.prototype,"textContent",{get:function(){return this.value},set:function(r){return this.value=r||""}});XMLCharacterData.prototype.clone=function(){return Object.create(this)};XMLCharacterData.prototype.substringData=function(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLCharacterData.prototype.appendData=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLCharacterData.prototype.insertData=function(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLCharacterData.prototype.deleteData=function(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLCharacterData.prototype.replaceData=function(r,i,o){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLCharacterData.prototype.isEqualNode=function(r){if(!XMLCharacterData.__super__.isEqualNode.apply(this,arguments).isEqualNode(r)){return false}if(r.data!==this.data){return false}return true};return XMLCharacterData}(a)}).call(this)},4593:function(r,i,o){(function(){var i,a,l,extend=function(r,i){for(var o in i){if(u.call(i,o))r[o]=i[o]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},u={}.hasOwnProperty;i=o(4128);a=o(3527);r.exports=l=function(r){extend(XMLComment,r);function XMLComment(r,o){XMLComment.__super__.constructor.call(this,r);if(o==null){throw new Error("Missing comment text. "+this.debugInfo())}this.name="#comment";this.type=i.Comment;this.value=this.stringify.comment(o)}XMLComment.prototype.clone=function(){return Object.create(this)};XMLComment.prototype.toString=function(r){return this.options.writer.comment(this,this.options.writer.filterOptions(r))};return XMLComment}(a)}).call(this)},4196:function(r,i,o){(function(){var i,a,l;a=o(7850);l=o(5132);r.exports=i=function(){function XMLDOMConfiguration(){var r;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=r=Object.create(this.defaultParams)}Object.defineProperty(XMLDOMConfiguration.prototype,"parameterNames",{get:function(){return new l(Object.keys(this.defaultParams))}});XMLDOMConfiguration.prototype.getParameter=function(r){if(this.params.hasOwnProperty(r)){return this.params[r]}else{return null}};XMLDOMConfiguration.prototype.canSetParameter=function(r,i){return true};XMLDOMConfiguration.prototype.setParameter=function(r,i){if(i!=null){return this.params[r]=i}else{return delete this.params[r]}};return XMLDOMConfiguration}()}).call(this)},7850:function(r){(function(){var i;r.exports=i=function(){function XMLDOMErrorHandler(){}XMLDOMErrorHandler.prototype.handleError=function(r){throw new Error(r)};return XMLDOMErrorHandler}()}).call(this)},9490:function(r){(function(){var i;r.exports=i=function(){function XMLDOMImplementation(){}XMLDOMImplementation.prototype.hasFeature=function(r,i){return true};XMLDOMImplementation.prototype.createDocumentType=function(r,i,o){throw new Error("This DOM method is not implemented.")};XMLDOMImplementation.prototype.createDocument=function(r,i,o){throw new Error("This DOM method is not implemented.")};XMLDOMImplementation.prototype.createHTMLDocument=function(r){throw new Error("This DOM method is not implemented.")};XMLDOMImplementation.prototype.getFeature=function(r,i){throw new Error("This DOM method is not implemented.")};return XMLDOMImplementation}()}).call(this)},5132:function(r){(function(){var i;r.exports=i=function(){function XMLDOMStringList(r){this.arr=r||[]}Object.defineProperty(XMLDOMStringList.prototype,"length",{get:function(){return this.arr.length}});XMLDOMStringList.prototype.item=function(r){return this.arr[r]||null};XMLDOMStringList.prototype.contains=function(r){return this.arr.indexOf(r)!==-1};return XMLDOMStringList}()}).call(this)},1066:function(r,i,o){(function(){var i,a,l,extend=function(r,i){for(var o in i){if(u.call(i,o))r[o]=i[o]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},u={}.hasOwnProperty;l=o(8064);i=o(4128);r.exports=a=function(r){extend(XMLDTDAttList,r);function XMLDTDAttList(r,o,a,l,u,c){XMLDTDAttList.__super__.constructor.call(this,r);if(o==null){throw new Error("Missing DTD element name. "+this.debugInfo())}if(a==null){throw new Error("Missing DTD attribute name. "+this.debugInfo(o))}if(!l){throw new Error("Missing DTD attribute type. "+this.debugInfo(o))}if(!u){throw new Error("Missing DTD attribute default. "+this.debugInfo(o))}if(u.indexOf("#")!==0){u="#"+u}if(!u.match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/)){throw new Error("Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT. "+this.debugInfo(o))}if(c&&!u.match(/^(#FIXED|#DEFAULT)$/)){throw new Error("Default value only applies to #FIXED or #DEFAULT. "+this.debugInfo(o))}this.elementName=this.stringify.name(o);this.type=i.AttributeDeclaration;this.attributeName=this.stringify.name(a);this.attributeType=this.stringify.dtdAttType(l);if(c){this.defaultValue=this.stringify.dtdAttDefault(c)}this.defaultValueType=u}XMLDTDAttList.prototype.toString=function(r){return this.options.writer.dtdAttList(this,this.options.writer.filterOptions(r))};return XMLDTDAttList}(l)}).call(this)},3584:function(r,i,o){(function(){var i,a,l,extend=function(r,i){for(var o in i){if(u.call(i,o))r[o]=i[o]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},u={}.hasOwnProperty;l=o(8064);i=o(4128);r.exports=a=function(r){extend(XMLDTDElement,r);function XMLDTDElement(r,o,a){XMLDTDElement.__super__.constructor.call(this,r);if(o==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(o);this.type=i.ElementDeclaration;this.value=this.stringify.dtdElementValue(a)}XMLDTDElement.prototype.toString=function(r){return this.options.writer.dtdElement(this,this.options.writer.filterOptions(r))};return XMLDTDElement}(l)}).call(this)},9346:function(r,i,o){(function(){var i,a,l,u,extend=function(r,i){for(var o in i){if(c.call(i,o))r[o]=i[o]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},c={}.hasOwnProperty;u=o(2629).isObject;l=o(8064);i=o(4128);r.exports=a=function(r){extend(XMLDTDEntity,r);function XMLDTDEntity(r,o,a,l){XMLDTDEntity.__super__.constructor.call(this,r);if(a==null){throw new Error("Missing DTD entity name. "+this.debugInfo(a))}if(l==null){throw new Error("Missing DTD entity value. "+this.debugInfo(a))}this.pe=!!o;this.name=this.stringify.name(a);this.type=i.EntityDeclaration;if(!u(l)){this.value=this.stringify.dtdEntityValue(l);this.internal=true}else{if(!l.pubID&&!l.sysID){throw new Error("Public and/or system identifiers are required for an external entity. "+this.debugInfo(a))}if(l.pubID&&!l.sysID){throw new Error("System identifier is required for a public external entity. "+this.debugInfo(a))}this.internal=false;if(l.pubID!=null){this.pubID=this.stringify.dtdPubID(l.pubID)}if(l.sysID!=null){this.sysID=this.stringify.dtdSysID(l.sysID)}if(l.nData!=null){this.nData=this.stringify.dtdNData(l.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(r){return this.options.writer.dtdEntity(this,this.options.writer.filterOptions(r))};return XMLDTDEntity}(l)}).call(this)},853:function(r,i,o){(function(){var i,a,l,extend=function(r,i){for(var o in i){if(u.call(i,o))r[o]=i[o]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},u={}.hasOwnProperty;l=o(8064);i=o(4128);r.exports=a=function(r){extend(XMLDTDNotation,r);function XMLDTDNotation(r,o,a){XMLDTDNotation.__super__.constructor.call(this,r);if(o==null){throw new Error("Missing DTD notation name. "+this.debugInfo(o))}if(!a.pubID&&!a.sysID){throw new Error("Public or system identifiers are required for an external entity. "+this.debugInfo(o))}this.name=this.stringify.name(o);this.type=i.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(r){return this.options.writer.dtdNotation(this,this.options.writer.filterOptions(r))};return XMLDTDNotation}(l)}).call(this)},4972:function(r,i,o){(function(){var i,a,l,u,extend=function(r,i){for(var o in i){if(c.call(i,o))r[o]=i[o]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},c={}.hasOwnProperty;u=o(2629).isObject;l=o(8064);i=o(4128);r.exports=a=function(r){extend(XMLDeclaration,r);function XMLDeclaration(r,o,a,l){var c;XMLDeclaration.__super__.constructor.call(this,r);if(u(o)){c=o,o=c.version,a=c.encoding,l=c.standalone}if(!o){o="1.0"}this.type=i.Declaration;this.version=this.stringify.xmlVersion(o);if(a!=null){this.encoding=this.stringify.xmlEncoding(a)}if(l!=null){this.standalone=this.stringify.xmlStandalone(l)}}XMLDeclaration.prototype.toString=function(r){return this.options.writer.declaration(this,this.options.writer.filterOptions(r))};return XMLDeclaration}(l)}).call(this)},9025:function(r,i,o){(function(){var i,a,l,u,c,h,d,p,m,extend=function(r,i){for(var o in i){if(g.call(i,o))r[o]=i[o]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},g={}.hasOwnProperty;m=o(2629).isObject;p=o(8064);i=o(4128);a=o(1066);u=o(9346);l=o(3584);c=o(853);d=o(8339);r.exports=h=function(r){extend(XMLDocType,r);function XMLDocType(r,o,a){var l,u,c,h,d,p;XMLDocType.__super__.constructor.call(this,r);this.type=i.DocType;if(r.children){h=r.children;for(u=0,c=h.length;u<c;u++){l=h[u];if(l.type===i.Element){this.name=l.name;break}}}this.documentObject=r;if(m(o)){d=o,o=d.pubID,a=d.sysID}if(a==null){p=[o,a],a=p[0],o=p[1]}if(o!=null){this.pubID=this.stringify.dtdPubID(o)}if(a!=null){this.sysID=this.stringify.dtdSysID(a)}}Object.defineProperty(XMLDocType.prototype,"entities",{get:function(){var r,o,a,l,u;l={};u=this.children;for(o=0,a=u.length;o<a;o++){r=u[o];if(r.type===i.EntityDeclaration&&!r.pe){l[r.name]=r}}return new d(l)}});Object.defineProperty(XMLDocType.prototype,"notations",{get:function(){var r,o,a,l,u;l={};u=this.children;for(o=0,a=u.length;o<a;o++){r=u[o];if(r.type===i.NotationDeclaration){l[r.name]=r}}return new d(l)}});Object.defineProperty(XMLDocType.prototype,"publicId",{get:function(){return this.pubID}});Object.defineProperty(XMLDocType.prototype,"systemId",{get:function(){return this.sysID}});Object.defineProperty(XMLDocType.prototype,"internalSubset",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}});XMLDocType.prototype.element=function(r,i){var o;o=new l(this,r,i);this.children.push(o);return this};XMLDocType.prototype.attList=function(r,i,o,l,u){var c;c=new a(this,r,i,o,l,u);this.children.push(c);return this};XMLDocType.prototype.entity=function(r,i){var o;o=new u(this,false,r,i);this.children.push(o);return this};XMLDocType.prototype.pEntity=function(r,i){var o;o=new u(this,true,r,i);this.children.push(o);return this};XMLDocType.prototype.notation=function(r,i){var o;o=new c(this,r,i);this.children.push(o);return this};XMLDocType.prototype.toString=function(r){return this.options.writer.docType(this,this.options.writer.filterOptions(r))};XMLDocType.prototype.ele=function(r,i){return this.element(r,i)};XMLDocType.prototype.att=function(r,i,o,a,l){return this.attList(r,i,o,a,l)};XMLDocType.prototype.ent=function(r,i){return this.entity(r,i)};XMLDocType.prototype.pent=function(r,i){return this.pEntity(r,i)};XMLDocType.prototype.not=function(r,i){return this.notation(r,i)};XMLDocType.prototype.up=function(){return this.root()||this.documentObject};XMLDocType.prototype.isEqualNode=function(r){if(!XMLDocType.__super__.isEqualNode.apply(this,arguments).isEqualNode(r)){return false}if(r.name!==this.name){return false}if(r.publicId!==this.publicId){return false}if(r.systemId!==this.systemId){return false}return true};return XMLDocType}(p)}).call(this)},3315:function(r,i,o){(function(){var i,a,l,u,c,h,d,p,extend=function(r,i){for(var o in i){if(m.call(i,o))r[o]=i[o]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},m={}.hasOwnProperty;p=o(2629).isPlainObject;l=o(9490);a=o(4196);c=o(8064);i=o(4128);d=o(916);h=o(6939);r.exports=u=function(r){extend(XMLDocument,r);function XMLDocument(r){XMLDocument.__super__.constructor.call(this,null);this.name="#document";this.type=i.Document;this.documentURI=null;this.domConfig=new a;r||(r={});if(!r.writer){r.writer=new h}this.options=r;this.stringify=new d(r)}Object.defineProperty(XMLDocument.prototype,"implementation",{value:new l});Object.defineProperty(XMLDocument.prototype,"doctype",{get:function(){var r,o,a,l;l=this.children;for(o=0,a=l.length;o<a;o++){r=l[o];if(r.type===i.DocType){return r}}return null}});Object.defineProperty(XMLDocument.prototype,"documentElement",{get:function(){return this.rootObject||null}});Object.defineProperty(XMLDocument.prototype,"inputEncoding",{get:function(){return null}});Object.defineProperty(XMLDocument.prototype,"strictErrorChecking",{get:function(){return false}});Object.defineProperty(XMLDocument.prototype,"xmlEncoding",{get:function(){if(this.children.length!==0&&this.children[0].type===i.Declaration){return this.children[0].encoding}else{return null}}});Object.defineProperty(XMLDocument.prototype,"xmlStandalone",{get:function(){if(this.children.length!==0&&this.children[0].type===i.Declaration){return this.children[0].standalone==="yes"}else{return false}}});Object.defineProperty(XMLDocument.prototype,"xmlVersion",{get:function(){if(this.children.length!==0&&this.children[0].type===i.Declaration){return this.children[0].version}else{return"1.0"}}});Object.defineProperty(XMLDocument.prototype,"URL",{get:function(){return this.documentURI}});Object.defineProperty(XMLDocument.prototype,"origin",{get:function(){return null}});Object.defineProperty(XMLDocument.prototype,"compatMode",{get:function(){return null}});Object.defineProperty(XMLDocument.prototype,"characterSet",{get:function(){return null}});Object.defineProperty(XMLDocument.prototype,"contentType",{get:function(){return null}});XMLDocument.prototype.end=function(r){var i;i={};if(!r){r=this.options.writer}else if(p(r)){i=r;r=this.options.writer}return r.document(this,r.filterOptions(i))};XMLDocument.prototype.toString=function(r){return this.options.writer.document(this,this.options.writer.filterOptions(r))};XMLDocument.prototype.createElement=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createDocumentFragment=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createTextNode=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createComment=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createCDATASection=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createProcessingInstruction=function(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createAttribute=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createEntityReference=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.getElementsByTagName=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.importNode=function(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createElementNS=function(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createAttributeNS=function(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.getElementsByTagNameNS=function(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.getElementById=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.adoptNode=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.normalizeDocument=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.renameNode=function(r,i,o){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.getElementsByClassName=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createEvent=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createRange=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createNodeIterator=function(r,i,o){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createTreeWalker=function(r,i,o){throw new Error("This DOM method is not implemented."+this.debugInfo())};return XMLDocument}(c)}).call(this)},1523:function(r,i,o){(function(){var i,a,l,u,c,h,d,p,m,g,y,v,b,w,M,E,D,T,x,O,N,_,A,I,L={}.hasOwnProperty;I=o(2629),_=I.isObject,N=I.isFunction,A=I.isPlainObject,O=I.getValue;i=o(4128);v=o(3315);w=o(7370);u=o(6789);c=o(4593);E=o(363);x=o(8854);M=o(3234);g=o(4972);y=o(9025);h=o(1066);p=o(9346);d=o(3584);m=o(853);l=o(9525);T=o(916);D=o(6939);a=o(8413);r.exports=b=function(){function XMLDocumentCB(r,o,a){var l;this.name="?xml";this.type=i.Document;r||(r={});l={};if(!r.writer){r.writer=new D}else if(A(r.writer)){l=r.writer;r.writer=new D}this.options=r;this.writer=r.writer;this.writerOptions=this.writer.filterOptions(l);this.stringify=new T(r);this.onDataCallback=o||function(){};this.onEndCallback=a||function(){};this.currentNode=null;this.currentLevel=-1;this.openTags={};this.documentStarted=false;this.documentCompleted=false;this.root=null}XMLDocumentCB.prototype.createChildNode=function(r){var o,a,l,u,c,h,d,p;switch(r.type){case i.CData:this.cdata(r.value);break;case i.Comment:this.comment(r.value);break;case i.Element:l={};d=r.attribs;for(a in d){if(!L.call(d,a))continue;o=d[a];l[a]=o.value}this.node(r.name,l);break;case i.Dummy:this.dummy();break;case i.Raw:this.raw(r.value);break;case i.Text:this.text(r.value);break;case i.ProcessingInstruction:this.instruction(r.target,r.value);break;default:throw new Error("This XML node type is not supported in a JS object: "+r.constructor.name)}p=r.children;for(c=0,h=p.length;c<h;c++){u=p[c];this.createChildNode(u);if(u.type===i.Element){this.up()}}return this};XMLDocumentCB.prototype.dummy=function(){return this};XMLDocumentCB.prototype.node=function(r,i,o){var a;if(r==null){throw new Error("Missing node name.")}if(this.root&&this.currentLevel===-1){throw new Error("Document can only have one root node. "+this.debugInfo(r))}this.openCurrent();r=O(r);if(i==null){i={}}i=O(i);if(!_(i)){a=[i,o],o=a[0],i=a[1]}this.currentNode=new w(this,r,i);this.currentNode.children=false;this.currentLevel++;this.openTags[this.currentLevel]=this.currentNode;if(o!=null){this.text(o)}return this};XMLDocumentCB.prototype.element=function(r,o,a){var l,u,c,h,d,p;if(this.currentNode&&this.currentNode.type===i.DocType){this.dtdElement.apply(this,arguments)}else{if(Array.isArray(r)||_(r)||N(r)){h=this.options.noValidation;this.options.noValidation=true;p=new v(this.options).element("TEMP_ROOT");p.element(r);this.options.noValidation=h;d=p.children;for(u=0,c=d.length;u<c;u++){l=d[u];this.createChildNode(l);if(l.type===i.Element){this.up()}}}else{this.node(r,o,a)}}return this};XMLDocumentCB.prototype.attribute=function(r,i){var o,a;if(!this.currentNode||this.currentNode.children){throw new Error("att() can only be used immediately after an ele() call in callback mode. "+this.debugInfo(r))}if(r!=null){r=O(r)}if(_(r)){for(o in r){if(!L.call(r,o))continue;a=r[o];this.attribute(o,a)}}else{if(N(i)){i=i.apply()}if(this.options.keepNullAttributes&&i==null){this.currentNode.attribs[r]=new l(this,r,"")}else if(i!=null){this.currentNode.attribs[r]=new l(this,r,i)}}return this};XMLDocumentCB.prototype.text=function(r){var i;this.openCurrent();i=new x(this,r);this.onData(this.writer.text(i,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this};XMLDocumentCB.prototype.cdata=function(r){var i;this.openCurrent();i=new u(this,r);this.onData(this.writer.cdata(i,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this};XMLDocumentCB.prototype.comment=function(r){var i;this.openCurrent();i=new c(this,r);this.onData(this.writer.comment(i,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this};XMLDocumentCB.prototype.raw=function(r){var i;this.openCurrent();i=new E(this,r);this.onData(this.writer.raw(i,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this};XMLDocumentCB.prototype.instruction=function(r,i){var o,a,l,u,c;this.openCurrent();if(r!=null){r=O(r)}if(i!=null){i=O(i)}if(Array.isArray(r)){for(o=0,u=r.length;o<u;o++){a=r[o];this.instruction(a)}}else if(_(r)){for(a in r){if(!L.call(r,a))continue;l=r[a];this.instruction(a,l)}}else{if(N(i)){i=i.apply()}c=new M(this,r,i);this.onData(this.writer.processingInstruction(c,this.writerOptions,this.currentLevel+1),this.currentLevel+1)}return this};XMLDocumentCB.prototype.declaration=function(r,i,o){var a;this.openCurrent();if(this.documentStarted){throw new Error("declaration() must be the first node.")}a=new g(this,r,i,o);this.onData(this.writer.declaration(a,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this};XMLDocumentCB.prototype.doctype=function(r,i,o){this.openCurrent();if(r==null){throw new Error("Missing root node name.")}if(this.root){throw new Error("dtd() must come before the root node.")}this.currentNode=new y(this,i,o);this.currentNode.rootNodeName=r;this.currentNode.children=false;this.currentLevel++;this.openTags[this.currentLevel]=this.currentNode;return this};XMLDocumentCB.prototype.dtdElement=function(r,i){var o;this.openCurrent();o=new d(this,r,i);this.onData(this.writer.dtdElement(o,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this};XMLDocumentCB.prototype.attList=function(r,i,o,a,l){var u;this.openCurrent();u=new h(this,r,i,o,a,l);this.onData(this.writer.dtdAttList(u,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this};XMLDocumentCB.prototype.entity=function(r,i){var o;this.openCurrent();o=new p(this,false,r,i);this.onData(this.writer.dtdEntity(o,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this};XMLDocumentCB.prototype.pEntity=function(r,i){var o;this.openCurrent();o=new p(this,true,r,i);this.onData(this.writer.dtdEntity(o,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this};XMLDocumentCB.prototype.notation=function(r,i){var o;this.openCurrent();o=new m(this,r,i);this.onData(this.writer.dtdNotation(o,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this};XMLDocumentCB.prototype.up=function(){if(this.currentLevel<0){throw new Error("The document node has no parent.")}if(this.currentNode){if(this.currentNode.children){this.closeNode(this.currentNode)}else{this.openNode(this.currentNode)}this.currentNode=null}else{this.closeNode(this.openTags[this.currentLevel])}delete this.openTags[this.currentLevel];this.currentLevel--;return this};XMLDocumentCB.prototype.end=function(){while(this.currentLevel>=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(r){var o,l,u,c;if(!r.isOpen){if(!this.root&&this.currentLevel===0&&r.type===i.Element){this.root=r}l="";if(r.type===i.Element){this.writerOptions.state=a.OpenTag;l=this.writer.indent(r,this.writerOptions,this.currentLevel)+"<"+r.name;c=r.attribs;for(u in c){if(!L.call(c,u))continue;o=c[u];l+=this.writer.attribute(o,this.writerOptions,this.currentLevel)}l+=(r.children?">":"/>")+this.writer.endline(r,this.writerOptions,this.currentLevel);this.writerOptions.state=a.InsideTag}else{this.writerOptions.state=a.OpenTag;l=this.writer.indent(r,this.writerOptions,this.currentLevel)+"<!DOCTYPE "+r.rootNodeName;if(r.pubID&&r.sysID){l+=' PUBLIC "'+r.pubID+'" "'+r.sysID+'"'}else if(r.sysID){l+=' SYSTEM "'+r.sysID+'"'}if(r.children){l+=" [";this.writerOptions.state=a.InsideTag}else{this.writerOptions.state=a.CloseTag;l+=">"}l+=this.writer.endline(r,this.writerOptions,this.currentLevel)}this.onData(l,this.currentLevel);return r.isOpen=true}};XMLDocumentCB.prototype.closeNode=function(r){var o;if(!r.isClosed){o="";this.writerOptions.state=a.CloseTag;if(r.type===i.Element){o=this.writer.indent(r,this.writerOptions,this.currentLevel)+"</"+r.name+">"+this.writer.endline(r,this.writerOptions,this.currentLevel)}else{o=this.writer.indent(r,this.writerOptions,this.currentLevel)+"]>"+this.writer.endline(r,this.writerOptions,this.currentLevel)}this.writerOptions.state=a.None;this.onData(o,this.currentLevel);return r.isClosed=true}};XMLDocumentCB.prototype.onData=function(r,i){this.documentStarted=true;return this.onDataCallback(r,i+1)};XMLDocumentCB.prototype.onEnd=function(){this.documentCompleted=true;return this.onEndCallback()};XMLDocumentCB.prototype.debugInfo=function(r){if(r==null){return""}else{return"node: <"+r+">"}};XMLDocumentCB.prototype.ele=function(){return this.element.apply(this,arguments)};XMLDocumentCB.prototype.nod=function(r,i,o){return this.node(r,i,o)};XMLDocumentCB.prototype.txt=function(r){return this.text(r)};XMLDocumentCB.prototype.dat=function(r){return this.cdata(r)};XMLDocumentCB.prototype.com=function(r){return this.comment(r)};XMLDocumentCB.prototype.ins=function(r,i){return this.instruction(r,i)};XMLDocumentCB.prototype.dec=function(r,i,o){return this.declaration(r,i,o)};XMLDocumentCB.prototype.dtd=function(r,i,o){return this.doctype(r,i,o)};XMLDocumentCB.prototype.e=function(r,i,o){return this.element(r,i,o)};XMLDocumentCB.prototype.n=function(r,i,o){return this.node(r,i,o)};XMLDocumentCB.prototype.t=function(r){return this.text(r)};XMLDocumentCB.prototype.d=function(r){return this.cdata(r)};XMLDocumentCB.prototype.c=function(r){return this.comment(r)};XMLDocumentCB.prototype.r=function(r){return this.raw(r)};XMLDocumentCB.prototype.i=function(r,i){return this.instruction(r,i)};XMLDocumentCB.prototype.att=function(){if(this.currentNode&&this.currentNode.type===i.DocType){return this.attList.apply(this,arguments)}else{return this.attribute.apply(this,arguments)}};XMLDocumentCB.prototype.a=function(){if(this.currentNode&&this.currentNode.type===i.DocType){return this.attList.apply(this,arguments)}else{return this.attribute.apply(this,arguments)}};XMLDocumentCB.prototype.ent=function(r,i){return this.entity(r,i)};XMLDocumentCB.prototype.pent=function(r,i){return this.pEntity(r,i)};XMLDocumentCB.prototype.not=function(r,i){return this.notation(r,i)};return XMLDocumentCB}()}).call(this)},3288:function(r,i,o){(function(){var i,a,l,extend=function(r,i){for(var o in i){if(u.call(i,o))r[o]=i[o]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},u={}.hasOwnProperty;l=o(8064);i=o(4128);r.exports=a=function(r){extend(XMLDummy,r);function XMLDummy(r){XMLDummy.__super__.constructor.call(this,r);this.type=i.Dummy}XMLDummy.prototype.clone=function(){return Object.create(this)};XMLDummy.prototype.toString=function(r){return""};return XMLDummy}(l)}).call(this)},7370:function(r,i,o){(function(){var i,a,l,u,c,h,d,p,m,extend=function(r,i){for(var o in i){if(g.call(i,o))r[o]=i[o]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},g={}.hasOwnProperty;m=o(2629),p=m.isObject,d=m.isFunction,h=m.getValue;c=o(8064);i=o(4128);a=o(9525);u=o(8339);r.exports=l=function(r){extend(XMLElement,r);function XMLElement(r,o,a){var l,u,c,h;XMLElement.__super__.constructor.call(this,r);if(o==null){throw new Error("Missing element name. "+this.debugInfo())}this.name=this.stringify.name(o);this.type=i.Element;this.attribs={};this.schemaTypeInfo=null;if(a!=null){this.attribute(a)}if(r.type===i.Document){this.isRoot=true;this.documentObject=r;r.rootObject=this;if(r.children){h=r.children;for(u=0,c=h.length;u<c;u++){l=h[u];if(l.type===i.DocType){l.name=this.name;break}}}}}Object.defineProperty(XMLElement.prototype,"tagName",{get:function(){return this.name}});Object.defineProperty(XMLElement.prototype,"namespaceURI",{get:function(){return""}});Object.defineProperty(XMLElement.prototype,"prefix",{get:function(){return""}});Object.defineProperty(XMLElement.prototype,"localName",{get:function(){return this.name}});Object.defineProperty(XMLElement.prototype,"id",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}});Object.defineProperty(XMLElement.prototype,"className",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}});Object.defineProperty(XMLElement.prototype,"classList",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}});Object.defineProperty(XMLElement.prototype,"attributes",{get:function(){if(!this.attributeMap||!this.attributeMap.nodes){this.attributeMap=new u(this.attribs)}return this.attributeMap}});XMLElement.prototype.clone=function(){var r,i,o,a;o=Object.create(this);if(o.isRoot){o.documentObject=null}o.attribs={};a=this.attribs;for(i in a){if(!g.call(a,i))continue;r=a[i];o.attribs[i]=r.clone()}o.children=[];this.children.forEach((function(r){var i;i=r.clone();i.parent=o;return o.children.push(i)}));return o};XMLElement.prototype.attribute=function(r,i){var o,l;if(r!=null){r=h(r)}if(p(r)){for(o in r){if(!g.call(r,o))continue;l=r[o];this.attribute(o,l)}}else{if(d(i)){i=i.apply()}if(this.options.keepNullAttributes&&i==null){this.attribs[r]=new a(this,r,"")}else if(i!=null){this.attribs[r]=new a(this,r,i)}}return this};XMLElement.prototype.removeAttribute=function(r){var i,o,a;if(r==null){throw new Error("Missing attribute name. "+this.debugInfo())}r=h(r);if(Array.isArray(r)){for(o=0,a=r.length;o<a;o++){i=r[o];delete this.attribs[i]}}else{delete this.attribs[r]}return this};XMLElement.prototype.toString=function(r){return this.options.writer.element(this,this.options.writer.filterOptions(r))};XMLElement.prototype.att=function(r,i){return this.attribute(r,i)};XMLElement.prototype.a=function(r,i){return this.attribute(r,i)};XMLElement.prototype.getAttribute=function(r){if(this.attribs.hasOwnProperty(r)){return this.attribs[r].value}else{return null}};XMLElement.prototype.setAttribute=function(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.getAttributeNode=function(r){if(this.attribs.hasOwnProperty(r)){return this.attribs[r]}else{return null}};XMLElement.prototype.setAttributeNode=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.removeAttributeNode=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.getElementsByTagName=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.getAttributeNS=function(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.setAttributeNS=function(r,i,o){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.removeAttributeNS=function(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.getAttributeNodeNS=function(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.setAttributeNodeNS=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.getElementsByTagNameNS=function(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.hasAttribute=function(r){return this.attribs.hasOwnProperty(r)};XMLElement.prototype.hasAttributeNS=function(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.setIdAttribute=function(r,i){if(this.attribs.hasOwnProperty(r)){return this.attribs[r].isId}else{return i}};XMLElement.prototype.setIdAttributeNS=function(r,i,o){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.setIdAttributeNode=function(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.getElementsByTagName=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.getElementsByTagNameNS=function(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.getElementsByClassName=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.isEqualNode=function(r){var i,o,a;if(!XMLElement.__super__.isEqualNode.apply(this,arguments).isEqualNode(r)){return false}if(r.namespaceURI!==this.namespaceURI){return false}if(r.prefix!==this.prefix){return false}if(r.localName!==this.localName){return false}if(r.attribs.length!==this.attribs.length){return false}for(i=o=0,a=this.attribs.length-1;0<=a?o<=a:o>=a;i=0<=a?++o:--o){if(!this.attribs[i].isEqualNode(r.attribs[i])){return false}}return true};return XMLElement}(c)}).call(this)},8339:function(r){(function(){var i;r.exports=i=function(){function XMLNamedNodeMap(r){this.nodes=r}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(r){return this.nodes[r]};XMLNamedNodeMap.prototype.setNamedItem=function(r){var i;i=this.nodes[r.nodeName];this.nodes[r.nodeName]=r;return i||null};XMLNamedNodeMap.prototype.removeNamedItem=function(r){var i;i=this.nodes[r];delete this.nodes[r];return i||null};XMLNamedNodeMap.prototype.item=function(r){return this.nodes[Object.keys(this.nodes)[r]]||null};XMLNamedNodeMap.prototype.getNamedItemNS=function(r,i){throw new Error("This DOM method is not implemented.")};XMLNamedNodeMap.prototype.setNamedItemNS=function(r){throw new Error("This DOM method is not implemented.")};XMLNamedNodeMap.prototype.removeNamedItemNS=function(r,i){throw new Error("This DOM method is not implemented.")};return XMLNamedNodeMap}()}).call(this)},8064:function(r,i,o){(function(){var i,a,l,u,c,h,d,p,m,g,y,v,b,w,M,E,D,T,x,O={}.hasOwnProperty;x=o(2629),T=x.isObject,D=x.isFunction,E=x.isEmpty,M=x.getValue;p=null;l=null;u=null;c=null;h=null;b=null;w=null;v=null;d=null;a=null;y=null;m=null;i=null;r.exports=g=function(){function XMLNode(r){this.parent=r;if(this.parent){this.options=this.parent.options;this.stringify=this.parent.stringify}this.value=null;this.children=[];this.baseURI=null;if(!p){p=o(7370);l=o(6789);u=o(4593);c=o(4972);h=o(9025);b=o(363);w=o(8854);v=o(3234);d=o(3288);a=o(4128);y=o(7209);m=o(8339);i=o(2346)}}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 y(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 r;r=this.parent.children.indexOf(this);return this.parent.children[r-1]||null}});Object.defineProperty(XMLNode.prototype,"nextSibling",{get:function(){var r;r=this.parent.children.indexOf(this);return this.parent.children[r+1]||null}});Object.defineProperty(XMLNode.prototype,"ownerDocument",{get:function(){return this.document()||null}});Object.defineProperty(XMLNode.prototype,"textContent",{get:function(){var r,i,o,l,u;if(this.nodeType===a.Element||this.nodeType===a.DocumentFragment){u="";l=this.children;for(i=0,o=l.length;i<o;i++){r=l[i];if(r.textContent){u+=r.textContent}}return u}else{return null}},set:function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}});XMLNode.prototype.setParent=function(r){var i,o,a,l,u;this.parent=r;if(r){this.options=r.options;this.stringify=r.stringify}l=this.children;u=[];for(o=0,a=l.length;o<a;o++){i=l[o];u.push(i.setParent(this))}return u};XMLNode.prototype.element=function(r,i,o){var a,l,u,c,h,d,p,m,g,y,v;d=null;if(i===null&&o==null){g=[{},null],i=g[0],o=g[1]}if(i==null){i={}}i=M(i);if(!T(i)){y=[i,o],o=y[0],i=y[1]}if(r!=null){r=M(r)}if(Array.isArray(r)){for(u=0,p=r.length;u<p;u++){l=r[u];d=this.element(l)}}else if(D(r)){d=this.element(r.apply())}else if(T(r)){for(h in r){if(!O.call(r,h))continue;v=r[h];if(D(v)){v=v.apply()}if(!this.options.ignoreDecorators&&this.stringify.convertAttKey&&h.indexOf(this.stringify.convertAttKey)===0){d=this.attribute(h.substr(this.stringify.convertAttKey.length),v)}else if(!this.options.separateArrayItems&&Array.isArray(v)&&E(v)){d=this.dummy()}else if(T(v)&&E(v)){d=this.element(h)}else if(!this.options.keepNullNodes&&v==null){d=this.dummy()}else if(!this.options.separateArrayItems&&Array.isArray(v)){for(c=0,m=v.length;c<m;c++){l=v[c];a={};a[h]=l;d=this.element(a)}}else if(T(v)){if(!this.options.ignoreDecorators&&this.stringify.convertTextKey&&h.indexOf(this.stringify.convertTextKey)===0){d=this.element(v)}else{d=this.element(h);d.element(v)}}else{d=this.element(h,v)}}}else if(!this.options.keepNullNodes&&o===null){d=this.dummy()}else{if(!this.options.ignoreDecorators&&this.stringify.convertTextKey&&r.indexOf(this.stringify.convertTextKey)===0){d=this.text(o)}else if(!this.options.ignoreDecorators&&this.stringify.convertCDataKey&&r.indexOf(this.stringify.convertCDataKey)===0){d=this.cdata(o)}else if(!this.options.ignoreDecorators&&this.stringify.convertCommentKey&&r.indexOf(this.stringify.convertCommentKey)===0){d=this.comment(o)}else if(!this.options.ignoreDecorators&&this.stringify.convertRawKey&&r.indexOf(this.stringify.convertRawKey)===0){d=this.raw(o)}else if(!this.options.ignoreDecorators&&this.stringify.convertPIKey&&r.indexOf(this.stringify.convertPIKey)===0){d=this.instruction(r.substr(this.stringify.convertPIKey.length),o)}else{d=this.node(r,i,o)}}if(d==null){throw new Error("Could not create any elements with: "+r+". "+this.debugInfo())}return d};XMLNode.prototype.insertBefore=function(r,i,o){var a,l,u,c,h;if(r!=null?r.type:void 0){u=r;c=i;u.setParent(this);if(c){l=children.indexOf(c);h=children.splice(l);children.push(u);Array.prototype.push.apply(children,h)}else{children.push(u)}return u}else{if(this.isRoot){throw new Error("Cannot insert elements at root level. "+this.debugInfo(r))}l=this.parent.children.indexOf(this);h=this.parent.children.splice(l);a=this.parent.element(r,i,o);Array.prototype.push.apply(this.parent.children,h);return a}};XMLNode.prototype.insertAfter=function(r,i,o){var a,l,u;if(this.isRoot){throw new Error("Cannot insert elements at root level. "+this.debugInfo(r))}l=this.parent.children.indexOf(this);u=this.parent.children.splice(l+1);a=this.parent.element(r,i,o);Array.prototype.push.apply(this.parent.children,u);return a};XMLNode.prototype.remove=function(){var r,i;if(this.isRoot){throw new Error("Cannot remove the root element. "+this.debugInfo())}r=this.parent.children.indexOf(this);[].splice.apply(this.parent.children,[r,r-r+1].concat(i=[])),i;return this.parent};XMLNode.prototype.node=function(r,i,o){var a,l;if(r!=null){r=M(r)}i||(i={});i=M(i);if(!T(i)){l=[i,o],o=l[0],i=l[1]}a=new p(this,r,i);if(o!=null){a.text(o)}this.children.push(a);return a};XMLNode.prototype.text=function(r){var i;if(T(r)){this.element(r)}i=new w(this,r);this.children.push(i);return this};XMLNode.prototype.cdata=function(r){var i;i=new l(this,r);this.children.push(i);return this};XMLNode.prototype.comment=function(r){var i;i=new u(this,r);this.children.push(i);return this};XMLNode.prototype.commentBefore=function(r){var i,o,a;o=this.parent.children.indexOf(this);a=this.parent.children.splice(o);i=this.parent.comment(r);Array.prototype.push.apply(this.parent.children,a);return this};XMLNode.prototype.commentAfter=function(r){var i,o,a;o=this.parent.children.indexOf(this);a=this.parent.children.splice(o+1);i=this.parent.comment(r);Array.prototype.push.apply(this.parent.children,a);return this};XMLNode.prototype.raw=function(r){var i;i=new b(this,r);this.children.push(i);return this};XMLNode.prototype.dummy=function(){var r;r=new d(this);return r};XMLNode.prototype.instruction=function(r,i){var o,a,l,u,c;if(r!=null){r=M(r)}if(i!=null){i=M(i)}if(Array.isArray(r)){for(u=0,c=r.length;u<c;u++){o=r[u];this.instruction(o)}}else if(T(r)){for(o in r){if(!O.call(r,o))continue;a=r[o];this.instruction(o,a)}}else{if(D(i)){i=i.apply()}l=new v(this,r,i);this.children.push(l)}return this};XMLNode.prototype.instructionBefore=function(r,i){var o,a,l;a=this.parent.children.indexOf(this);l=this.parent.children.splice(a);o=this.parent.instruction(r,i);Array.prototype.push.apply(this.parent.children,l);return this};XMLNode.prototype.instructionAfter=function(r,i){var o,a,l;a=this.parent.children.indexOf(this);l=this.parent.children.splice(a+1);o=this.parent.instruction(r,i);Array.prototype.push.apply(this.parent.children,l);return this};XMLNode.prototype.declaration=function(r,i,o){var l,u;l=this.document();u=new c(l,r,i,o);if(l.children.length===0){l.children.unshift(u)}else if(l.children[0].type===a.Declaration){l.children[0]=u}else{l.children.unshift(u)}return l.root()||l};XMLNode.prototype.dtd=function(r,i){var o,l,u,c,d,p,m,g,y,v;l=this.document();u=new h(l,r,i);y=l.children;for(c=d=0,m=y.length;d<m;c=++d){o=y[c];if(o.type===a.DocType){l.children[c]=u;return u}}v=l.children;for(c=p=0,g=v.length;p<g;c=++p){o=v[c];if(o.isRoot){l.children.splice(c,0,u);return u}}l.children.push(u);return u};XMLNode.prototype.up=function(){if(this.isRoot){throw new Error("The root node has no parent. Use doc() if you need to get the document object.")}return this.parent};XMLNode.prototype.root=function(){var r;r=this;while(r){if(r.type===a.Document){return r.rootObject}else if(r.isRoot){return r}else{r=r.parent}}};XMLNode.prototype.document=function(){var r;r=this;while(r){if(r.type===a.Document){return r}else{r=r.parent}}};XMLNode.prototype.end=function(r){return this.document().end(r)};XMLNode.prototype.prev=function(){var r;r=this.parent.children.indexOf(this);if(r<1){throw new Error("Already at the first node. "+this.debugInfo())}return this.parent.children[r-1]};XMLNode.prototype.next=function(){var r;r=this.parent.children.indexOf(this);if(r===-1||r===this.parent.children.length-1){throw new Error("Already at the last node. "+this.debugInfo())}return this.parent.children[r+1]};XMLNode.prototype.importDocument=function(r){var i;i=r.root().clone();i.parent=this;i.isRoot=false;this.children.push(i);return this};XMLNode.prototype.debugInfo=function(r){var i,o;r=r||this.name;if(r==null&&!((i=this.parent)!=null?i.name:void 0)){return""}else if(r==null){return"parent: <"+this.parent.name+">"}else if(!((o=this.parent)!=null?o.name:void 0)){return"node: <"+r+">"}else{return"node: <"+r+">, parent: <"+this.parent.name+">"}};XMLNode.prototype.ele=function(r,i,o){return this.element(r,i,o)};XMLNode.prototype.nod=function(r,i,o){return this.node(r,i,o)};XMLNode.prototype.txt=function(r){return this.text(r)};XMLNode.prototype.dat=function(r){return this.cdata(r)};XMLNode.prototype.com=function(r){return this.comment(r)};XMLNode.prototype.ins=function(r,i){return this.instruction(r,i)};XMLNode.prototype.doc=function(){return this.document()};XMLNode.prototype.dec=function(r,i,o){return this.declaration(r,i,o)};XMLNode.prototype.e=function(r,i,o){return this.element(r,i,o)};XMLNode.prototype.n=function(r,i,o){return this.node(r,i,o)};XMLNode.prototype.t=function(r){return this.text(r)};XMLNode.prototype.d=function(r){return this.cdata(r)};XMLNode.prototype.c=function(r){return this.comment(r)};XMLNode.prototype.r=function(r){return this.raw(r)};XMLNode.prototype.i=function(r,i){return this.instruction(r,i)};XMLNode.prototype.u=function(){return this.up()};XMLNode.prototype.importXMLBuilder=function(r){return this.importDocument(r)};XMLNode.prototype.replaceChild=function(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.removeChild=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.appendChild=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.hasChildNodes=function(){return this.children.length!==0};XMLNode.prototype.cloneNode=function(r){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(r,i){return true};XMLNode.prototype.hasAttributes=function(){return this.attribs.length!==0};XMLNode.prototype.compareDocumentPosition=function(r){var o,a;o=this;if(o===r){return 0}else if(this.document()!==r.document()){a=i.Disconnected|i.ImplementationSpecific;if(Math.random()<.5){a|=i.Preceding}else{a|=i.Following}return a}else if(o.isAncestor(r)){return i.Contains|i.Preceding}else if(o.isDescendant(r)){return i.Contains|i.Following}else if(o.isPreceding(r)){return i.Preceding}else{return i.Following}};XMLNode.prototype.isSameNode=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.lookupPrefix=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.isDefaultNamespace=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.lookupNamespaceURI=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.isEqualNode=function(r){var i,o,a;if(r.nodeType!==this.nodeType){return false}if(r.children.length!==this.children.length){return false}for(i=o=0,a=this.children.length-1;0<=a?o<=a:o>=a;i=0<=a?++o:--o){if(!this.children[i].isEqualNode(r.children[i])){return false}}return true};XMLNode.prototype.getFeature=function(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.setUserData=function(r,i,o){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.getUserData=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.contains=function(r){if(!r){return false}return r===this||this.isDescendant(r)};XMLNode.prototype.isDescendant=function(r){var i,o,a,l,u;u=this.children;for(a=0,l=u.length;a<l;a++){i=u[a];if(r===i){return true}o=i.isDescendant(r);if(o){return true}}return false};XMLNode.prototype.isAncestor=function(r){return r.isDescendant(this)};XMLNode.prototype.isPreceding=function(r){var i,o;i=this.treePosition(r);o=this.treePosition(this);if(i===-1||o===-1){return false}else{return i<o}};XMLNode.prototype.isFollowing=function(r){var i,o;i=this.treePosition(r);o=this.treePosition(this);if(i===-1||o===-1){return false}else{return i>o}};XMLNode.prototype.treePosition=function(r){var i,o;o=0;i=false;this.foreachTreeNode(this.document(),(function(a){o++;if(!i&&a===r){return i=true}}));if(i){return o}else{return-1}};XMLNode.prototype.foreachTreeNode=function(r,i){var o,a,l,u,c;r||(r=this.document());u=r.children;for(a=0,l=u.length;a<l;a++){o=u[a];if(c=i(o)){return c}else{c=this.foreachTreeNode(o,i);if(c){return c}}}};return XMLNode}()}).call(this)},7209:function(r){(function(){var i;r.exports=i=function(){function XMLNodeList(r){this.nodes=r}Object.defineProperty(XMLNodeList.prototype,"length",{get:function(){return this.nodes.length||0}});XMLNodeList.prototype.clone=function(){return this.nodes=null};XMLNodeList.prototype.item=function(r){return this.nodes[r]||null};return XMLNodeList}()}).call(this)},3234:function(r,i,o){(function(){var i,a,l,extend=function(r,i){for(var o in i){if(u.call(i,o))r[o]=i[o]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},u={}.hasOwnProperty;i=o(4128);a=o(3527);r.exports=l=function(r){extend(XMLProcessingInstruction,r);function XMLProcessingInstruction(r,o,a){XMLProcessingInstruction.__super__.constructor.call(this,r);if(o==null){throw new Error("Missing instruction target. "+this.debugInfo())}this.type=i.ProcessingInstruction;this.target=this.stringify.insTarget(o);this.name=this.target;if(a){this.value=this.stringify.insValue(a)}}XMLProcessingInstruction.prototype.clone=function(){return Object.create(this)};XMLProcessingInstruction.prototype.toString=function(r){return this.options.writer.processingInstruction(this,this.options.writer.filterOptions(r))};XMLProcessingInstruction.prototype.isEqualNode=function(r){if(!XMLProcessingInstruction.__super__.isEqualNode.apply(this,arguments).isEqualNode(r)){return false}if(r.target!==this.target){return false}return true};return XMLProcessingInstruction}(a)}).call(this)},363:function(r,i,o){(function(){var i,a,l,extend=function(r,i){for(var o in i){if(u.call(i,o))r[o]=i[o]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},u={}.hasOwnProperty;i=o(4128);a=o(8064);r.exports=l=function(r){extend(XMLRaw,r);function XMLRaw(r,o){XMLRaw.__super__.constructor.call(this,r);if(o==null){throw new Error("Missing raw text. "+this.debugInfo())}this.type=i.Raw;this.value=this.stringify.raw(o)}XMLRaw.prototype.clone=function(){return Object.create(this)};XMLRaw.prototype.toString=function(r){return this.options.writer.raw(this,this.options.writer.filterOptions(r))};return XMLRaw}(a)}).call(this)},359:function(r,i,o){(function(){var i,a,l,u,extend=function(r,i){for(var o in i){if(c.call(i,o))r[o]=i[o]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},c={}.hasOwnProperty;i=o(4128);u=o(8126);a=o(8413);r.exports=l=function(r){extend(XMLStreamWriter,r);function XMLStreamWriter(r,i){this.stream=r;XMLStreamWriter.__super__.constructor.call(this,i)}XMLStreamWriter.prototype.endline=function(r,i,o){if(r.isLastRootNode&&i.state===a.CloseTag){return""}else{return XMLStreamWriter.__super__.endline.call(this,r,i,o)}};XMLStreamWriter.prototype.document=function(r,i){var o,a,l,u,c,h,d,p,m;d=r.children;for(a=l=0,c=d.length;l<c;a=++l){o=d[a];o.isLastRootNode=a===r.children.length-1}i=this.filterOptions(i);p=r.children;m=[];for(u=0,h=p.length;u<h;u++){o=p[u];m.push(this.writeChildNode(o,i,0))}return m};XMLStreamWriter.prototype.attribute=function(r,i,o){return this.stream.write(XMLStreamWriter.__super__.attribute.call(this,r,i,o))};XMLStreamWriter.prototype.cdata=function(r,i,o){return this.stream.write(XMLStreamWriter.__super__.cdata.call(this,r,i,o))};XMLStreamWriter.prototype.comment=function(r,i,o){return this.stream.write(XMLStreamWriter.__super__.comment.call(this,r,i,o))};XMLStreamWriter.prototype.declaration=function(r,i,o){return this.stream.write(XMLStreamWriter.__super__.declaration.call(this,r,i,o))};XMLStreamWriter.prototype.docType=function(r,i,o){var l,u,c,h;o||(o=0);this.openNode(r,i,o);i.state=a.OpenTag;this.stream.write(this.indent(r,i,o));this.stream.write("<!DOCTYPE "+r.root().name);if(r.pubID&&r.sysID){this.stream.write(' PUBLIC "'+r.pubID+'" "'+r.sysID+'"')}else if(r.sysID){this.stream.write(' SYSTEM "'+r.sysID+'"')}if(r.children.length>0){this.stream.write(" [");this.stream.write(this.endline(r,i,o));i.state=a.InsideTag;h=r.children;for(u=0,c=h.length;u<c;u++){l=h[u];this.writeChildNode(l,i,o+1)}i.state=a.CloseTag;this.stream.write("]")}i.state=a.CloseTag;this.stream.write(i.spaceBeforeSlash+">");this.stream.write(this.endline(r,i,o));i.state=a.None;return this.closeNode(r,i,o)};XMLStreamWriter.prototype.element=function(r,o,l){var u,h,d,p,m,g,y,v,b,w;l||(l=0);this.openNode(r,o,l);o.state=a.OpenTag;this.stream.write(this.indent(r,o,l)+"<"+r.name);b=r.attribs;for(y in b){if(!c.call(b,y))continue;u=b[y];this.attribute(u,o,l)}d=r.children.length;p=d===0?null:r.children[0];if(d===0||r.children.every((function(r){return(r.type===i.Text||r.type===i.Raw)&&r.value===""}))){if(o.allowEmpty){this.stream.write(">");o.state=a.CloseTag;this.stream.write("</"+r.name+">")}else{o.state=a.CloseTag;this.stream.write(o.spaceBeforeSlash+"/>")}}else if(o.pretty&&d===1&&(p.type===i.Text||p.type===i.Raw)&&p.value!=null){this.stream.write(">");o.state=a.InsideTag;o.suppressPrettyCount++;v=true;this.writeChildNode(p,o,l+1);o.suppressPrettyCount--;v=false;o.state=a.CloseTag;this.stream.write("</"+r.name+">")}else{this.stream.write(">"+this.endline(r,o,l));o.state=a.InsideTag;w=r.children;for(m=0,g=w.length;m<g;m++){h=w[m];this.writeChildNode(h,o,l+1)}o.state=a.CloseTag;this.stream.write(this.indent(r,o,l)+"</"+r.name+">")}this.stream.write(this.endline(r,o,l));o.state=a.None;return this.closeNode(r,o,l)};XMLStreamWriter.prototype.processingInstruction=function(r,i,o){return this.stream.write(XMLStreamWriter.__super__.processingInstruction.call(this,r,i,o))};XMLStreamWriter.prototype.raw=function(r,i,o){return this.stream.write(XMLStreamWriter.__super__.raw.call(this,r,i,o))};XMLStreamWriter.prototype.text=function(r,i,o){return this.stream.write(XMLStreamWriter.__super__.text.call(this,r,i,o))};XMLStreamWriter.prototype.dtdAttList=function(r,i,o){return this.stream.write(XMLStreamWriter.__super__.dtdAttList.call(this,r,i,o))};XMLStreamWriter.prototype.dtdElement=function(r,i,o){return this.stream.write(XMLStreamWriter.__super__.dtdElement.call(this,r,i,o))};XMLStreamWriter.prototype.dtdEntity=function(r,i,o){return this.stream.write(XMLStreamWriter.__super__.dtdEntity.call(this,r,i,o))};XMLStreamWriter.prototype.dtdNotation=function(r,i,o){return this.stream.write(XMLStreamWriter.__super__.dtdNotation.call(this,r,i,o))};return XMLStreamWriter}(u)}).call(this)},6939:function(r,i,o){(function(){var i,a,extend=function(r,i){for(var o in i){if(l.call(i,o))r[o]=i[o]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},l={}.hasOwnProperty;a=o(8126);r.exports=i=function(r){extend(XMLStringWriter,r);function XMLStringWriter(r){XMLStringWriter.__super__.constructor.call(this,r)}XMLStringWriter.prototype.document=function(r,i){var o,a,l,u,c;i=this.filterOptions(i);u="";c=r.children;for(a=0,l=c.length;a<l;a++){o=c[a];u+=this.writeChildNode(o,i,0)}if(i.pretty&&u.slice(-i.newline.length)===i.newline){u=u.slice(0,-i.newline.length)}return u};return XMLStringWriter}(a)}).call(this)},916:function(r){(function(){var i,bind=function(r,i){return function(){return r.apply(i,arguments)}},o={}.hasOwnProperty;r.exports=i=function(){function XMLStringifier(r){this.assertLegalName=bind(this.assertLegalName,this);this.assertLegalChar=bind(this.assertLegalChar,this);var i,a,l;r||(r={});this.options=r;if(!this.options.version){this.options.version="1.0"}a=r.stringify||{};for(i in a){if(!o.call(a,i))continue;l=a[i];this[i]=l}}XMLStringifier.prototype.name=function(r){if(this.options.noValidation){return r}return this.assertLegalName(""+r||"")};XMLStringifier.prototype.text=function(r){if(this.options.noValidation){return r}return this.assertLegalChar(this.textEscape(""+r||""))};XMLStringifier.prototype.cdata=function(r){if(this.options.noValidation){return r}r=""+r||"";r=r.replace("]]>","]]]]><![CDATA[>");return this.assertLegalChar(r)};XMLStringifier.prototype.comment=function(r){if(this.options.noValidation){return r}r=""+r||"";if(r.match(/--/)){throw new Error("Comment text cannot contain double-hypen: "+r)}return this.assertLegalChar(r)};XMLStringifier.prototype.raw=function(r){if(this.options.noValidation){return r}return""+r||""};XMLStringifier.prototype.attValue=function(r){if(this.options.noValidation){return r}return this.assertLegalChar(this.attEscape(r=""+r||""))};XMLStringifier.prototype.insTarget=function(r){if(this.options.noValidation){return r}return this.assertLegalChar(""+r||"")};XMLStringifier.prototype.insValue=function(r){if(this.options.noValidation){return r}r=""+r||"";if(r.match(/\?>/)){throw new Error("Invalid processing instruction value: "+r)}return this.assertLegalChar(r)};XMLStringifier.prototype.xmlVersion=function(r){if(this.options.noValidation){return r}r=""+r||"";if(!r.match(/1\.[0-9]+/)){throw new Error("Invalid version number: "+r)}return r};XMLStringifier.prototype.xmlEncoding=function(r){if(this.options.noValidation){return r}r=""+r||"";if(!r.match(/^[A-Za-z](?:[A-Za-z0-9._-])*$/)){throw new Error("Invalid encoding: "+r)}return this.assertLegalChar(r)};XMLStringifier.prototype.xmlStandalone=function(r){if(this.options.noValidation){return r}if(r){return"yes"}else{return"no"}};XMLStringifier.prototype.dtdPubID=function(r){if(this.options.noValidation){return r}return this.assertLegalChar(""+r||"")};XMLStringifier.prototype.dtdSysID=function(r){if(this.options.noValidation){return r}return this.assertLegalChar(""+r||"")};XMLStringifier.prototype.dtdElementValue=function(r){if(this.options.noValidation){return r}return this.assertLegalChar(""+r||"")};XMLStringifier.prototype.dtdAttType=function(r){if(this.options.noValidation){return r}return this.assertLegalChar(""+r||"")};XMLStringifier.prototype.dtdAttDefault=function(r){if(this.options.noValidation){return r}return this.assertLegalChar(""+r||"")};XMLStringifier.prototype.dtdEntityValue=function(r){if(this.options.noValidation){return r}return this.assertLegalChar(""+r||"")};XMLStringifier.prototype.dtdNData=function(r){if(this.options.noValidation){return r}return this.assertLegalChar(""+r||"")};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(r){var i,o;if(this.options.noValidation){return r}i="";if(this.options.version==="1.0"){i=/[\0-\x08\x0B\f\x0E-\x1F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;if(o=r.match(i)){throw new Error("Invalid character in string: "+r+" at index "+o.index)}}else if(this.options.version==="1.1"){i=/[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;if(o=r.match(i)){throw new Error("Invalid character in string: "+r+" at index "+o.index)}}return r};XMLStringifier.prototype.assertLegalName=function(r){var i;if(this.options.noValidation){return r}this.assertLegalChar(r);i=/^([: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(!r.match(i)){throw new Error("Invalid character in name")}return r};XMLStringifier.prototype.textEscape=function(r){var i;if(this.options.noValidation){return r}i=this.options.noDoubleEncoding?/(?!&\S+;)&/g:/&/g;return r.replace(i,"&").replace(/</g,"<").replace(/>/g,">").replace(/\r/g,"
")};XMLStringifier.prototype.attEscape=function(r){var i;if(this.options.noValidation){return r}i=this.options.noDoubleEncoding?/(?!&\S+;)&/g:/&/g;return r.replace(i,"&").replace(/</g,"<").replace(/"/g,""").replace(/\t/g,"	").replace(/\n/g,"
").replace(/\r/g,"
")};return XMLStringifier}()}).call(this)},8854:function(r,i,o){(function(){var i,a,l,extend=function(r,i){for(var o in i){if(u.call(i,o))r[o]=i[o]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},u={}.hasOwnProperty;i=o(4128);a=o(3527);r.exports=l=function(r){extend(XMLText,r);function XMLText(r,o){XMLText.__super__.constructor.call(this,r);if(o==null){throw new Error("Missing element text. "+this.debugInfo())}this.name="#text";this.type=i.Text;this.value=this.stringify.text(o)}Object.defineProperty(XMLText.prototype,"isElementContentWhitespace",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}});Object.defineProperty(XMLText.prototype,"wholeText",{get:function(){var r,i,o;o="";i=this.previousSibling;while(i){o=i.data+o;i=i.previousSibling}o+=this.data;r=this.nextSibling;while(r){o=o+r.data;r=r.nextSibling}return o}});XMLText.prototype.clone=function(){return Object.create(this)};XMLText.prototype.toString=function(r){return this.options.writer.text(this,this.options.writer.filterOptions(r))};XMLText.prototype.splitText=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLText.prototype.replaceWholeText=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};return XMLText}(a)}).call(this)},8126:function(r,i,o){(function(){var i,a,l,u,c,h,d,p,m,g,y,v,b,w,M,E,D,T={}.hasOwnProperty;D=o(2629).assign;i=o(4128);m=o(4972);g=o(9025);l=o(6789);u=o(4593);v=o(7370);w=o(363);M=o(8854);b=o(3234);y=o(3288);c=o(1066);h=o(3584);d=o(9346);p=o(853);a=o(8413);r.exports=E=function(){function XMLWriterBase(r){var i,o,a;r||(r={});this.options=r;o=r.writer||{};for(i in o){if(!T.call(o,i))continue;a=o[i];this["_"+i]=this[i];this[i]=a}}XMLWriterBase.prototype.filterOptions=function(r){var i,o,l,u,c,h,d,p;r||(r={});r=D({},this.options,r);i={writer:this};i.pretty=r.pretty||false;i.allowEmpty=r.allowEmpty||false;i.indent=(o=r.indent)!=null?o:" ";i.newline=(l=r.newline)!=null?l:"\n";i.offset=(u=r.offset)!=null?u:0;i.dontPrettyTextNodes=(c=(h=r.dontPrettyTextNodes)!=null?h:r.dontprettytextnodes)!=null?c:0;i.spaceBeforeSlash=(d=(p=r.spaceBeforeSlash)!=null?p:r.spacebeforeslash)!=null?d:"";if(i.spaceBeforeSlash===true){i.spaceBeforeSlash=" "}i.suppressPrettyCount=0;i.user={};i.state=a.None;return i};XMLWriterBase.prototype.indent=function(r,i,o){var a;if(!i.pretty||i.suppressPrettyCount){return""}else if(i.pretty){a=(o||0)+i.offset+1;if(a>0){return new Array(a).join(i.indent)}}return""};XMLWriterBase.prototype.endline=function(r,i,o){if(!i.pretty||i.suppressPrettyCount){return""}else{return i.newline}};XMLWriterBase.prototype.attribute=function(r,i,o){var a;this.openAttribute(r,i,o);a=" "+r.name+'="'+r.value+'"';this.closeAttribute(r,i,o);return a};XMLWriterBase.prototype.cdata=function(r,i,o){var l;this.openNode(r,i,o);i.state=a.OpenTag;l=this.indent(r,i,o)+"<![CDATA[";i.state=a.InsideTag;l+=r.value;i.state=a.CloseTag;l+="]]>"+this.endline(r,i,o);i.state=a.None;this.closeNode(r,i,o);return l};XMLWriterBase.prototype.comment=function(r,i,o){var l;this.openNode(r,i,o);i.state=a.OpenTag;l=this.indent(r,i,o)+"\x3c!-- ";i.state=a.InsideTag;l+=r.value;i.state=a.CloseTag;l+=" --\x3e"+this.endline(r,i,o);i.state=a.None;this.closeNode(r,i,o);return l};XMLWriterBase.prototype.declaration=function(r,i,o){var l;this.openNode(r,i,o);i.state=a.OpenTag;l=this.indent(r,i,o)+"<?xml";i.state=a.InsideTag;l+=' version="'+r.version+'"';if(r.encoding!=null){l+=' encoding="'+r.encoding+'"'}if(r.standalone!=null){l+=' standalone="'+r.standalone+'"'}i.state=a.CloseTag;l+=i.spaceBeforeSlash+"?>";l+=this.endline(r,i,o);i.state=a.None;this.closeNode(r,i,o);return l};XMLWriterBase.prototype.docType=function(r,i,o){var l,u,c,h,d;o||(o=0);this.openNode(r,i,o);i.state=a.OpenTag;h=this.indent(r,i,o);h+="<!DOCTYPE "+r.root().name;if(r.pubID&&r.sysID){h+=' PUBLIC "'+r.pubID+'" "'+r.sysID+'"'}else if(r.sysID){h+=' SYSTEM "'+r.sysID+'"'}if(r.children.length>0){h+=" [";h+=this.endline(r,i,o);i.state=a.InsideTag;d=r.children;for(u=0,c=d.length;u<c;u++){l=d[u];h+=this.writeChildNode(l,i,o+1)}i.state=a.CloseTag;h+="]"}i.state=a.CloseTag;h+=i.spaceBeforeSlash+">";h+=this.endline(r,i,o);i.state=a.None;this.closeNode(r,i,o);return h};XMLWriterBase.prototype.element=function(r,o,l){var u,c,h,d,p,m,g,y,v,b,w,M,E,D;l||(l=0);b=false;w="";this.openNode(r,o,l);o.state=a.OpenTag;w+=this.indent(r,o,l)+"<"+r.name;M=r.attribs;for(v in M){if(!T.call(M,v))continue;u=M[v];w+=this.attribute(u,o,l)}h=r.children.length;d=h===0?null:r.children[0];if(h===0||r.children.every((function(r){return(r.type===i.Text||r.type===i.Raw)&&r.value===""}))){if(o.allowEmpty){w+=">";o.state=a.CloseTag;w+="</"+r.name+">"+this.endline(r,o,l)}else{o.state=a.CloseTag;w+=o.spaceBeforeSlash+"/>"+this.endline(r,o,l)}}else if(o.pretty&&h===1&&(d.type===i.Text||d.type===i.Raw)&&d.value!=null){w+=">";o.state=a.InsideTag;o.suppressPrettyCount++;b=true;w+=this.writeChildNode(d,o,l+1);o.suppressPrettyCount--;b=false;o.state=a.CloseTag;w+="</"+r.name+">"+this.endline(r,o,l)}else{if(o.dontPrettyTextNodes){E=r.children;for(p=0,g=E.length;p<g;p++){c=E[p];if((c.type===i.Text||c.type===i.Raw)&&c.value!=null){o.suppressPrettyCount++;b=true;break}}}w+=">"+this.endline(r,o,l);o.state=a.InsideTag;D=r.children;for(m=0,y=D.length;m<y;m++){c=D[m];w+=this.writeChildNode(c,o,l+1)}o.state=a.CloseTag;w+=this.indent(r,o,l)+"</"+r.name+">";if(b){o.suppressPrettyCount--}w+=this.endline(r,o,l);o.state=a.None}this.closeNode(r,o,l);return w};XMLWriterBase.prototype.writeChildNode=function(r,o,a){switch(r.type){case i.CData:return this.cdata(r,o,a);case i.Comment:return this.comment(r,o,a);case i.Element:return this.element(r,o,a);case i.Raw:return this.raw(r,o,a);case i.Text:return this.text(r,o,a);case i.ProcessingInstruction:return this.processingInstruction(r,o,a);case i.Dummy:return"";case i.Declaration:return this.declaration(r,o,a);case i.DocType:return this.docType(r,o,a);case i.AttributeDeclaration:return this.dtdAttList(r,o,a);case i.ElementDeclaration:return this.dtdElement(r,o,a);case i.EntityDeclaration:return this.dtdEntity(r,o,a);case i.NotationDeclaration:return this.dtdNotation(r,o,a);default:throw new Error("Unknown XML node type: "+r.constructor.name)}};XMLWriterBase.prototype.processingInstruction=function(r,i,o){var l;this.openNode(r,i,o);i.state=a.OpenTag;l=this.indent(r,i,o)+"<?";i.state=a.InsideTag;l+=r.target;if(r.value){l+=" "+r.value}i.state=a.CloseTag;l+=i.spaceBeforeSlash+"?>";l+=this.endline(r,i,o);i.state=a.None;this.closeNode(r,i,o);return l};XMLWriterBase.prototype.raw=function(r,i,o){var l;this.openNode(r,i,o);i.state=a.OpenTag;l=this.indent(r,i,o);i.state=a.InsideTag;l+=r.value;i.state=a.CloseTag;l+=this.endline(r,i,o);i.state=a.None;this.closeNode(r,i,o);return l};XMLWriterBase.prototype.text=function(r,i,o){var l;this.openNode(r,i,o);i.state=a.OpenTag;l=this.indent(r,i,o);i.state=a.InsideTag;l+=r.value;i.state=a.CloseTag;l+=this.endline(r,i,o);i.state=a.None;this.closeNode(r,i,o);return l};XMLWriterBase.prototype.dtdAttList=function(r,i,o){var l;this.openNode(r,i,o);i.state=a.OpenTag;l=this.indent(r,i,o)+"<!ATTLIST";i.state=a.InsideTag;l+=" "+r.elementName+" "+r.attributeName+" "+r.attributeType;if(r.defaultValueType!=="#DEFAULT"){l+=" "+r.defaultValueType}if(r.defaultValue){l+=' "'+r.defaultValue+'"'}i.state=a.CloseTag;l+=i.spaceBeforeSlash+">"+this.endline(r,i,o);i.state=a.None;this.closeNode(r,i,o);return l};XMLWriterBase.prototype.dtdElement=function(r,i,o){var l;this.openNode(r,i,o);i.state=a.OpenTag;l=this.indent(r,i,o)+"<!ELEMENT";i.state=a.InsideTag;l+=" "+r.name+" "+r.value;i.state=a.CloseTag;l+=i.spaceBeforeSlash+">"+this.endline(r,i,o);i.state=a.None;this.closeNode(r,i,o);return l};XMLWriterBase.prototype.dtdEntity=function(r,i,o){var l;this.openNode(r,i,o);i.state=a.OpenTag;l=this.indent(r,i,o)+"<!ENTITY";i.state=a.InsideTag;if(r.pe){l+=" %"}l+=" "+r.name;if(r.value){l+=' "'+r.value+'"'}else{if(r.pubID&&r.sysID){l+=' PUBLIC "'+r.pubID+'" "'+r.sysID+'"'}else if(r.sysID){l+=' SYSTEM "'+r.sysID+'"'}if(r.nData){l+=" NDATA "+r.nData}}i.state=a.CloseTag;l+=i.spaceBeforeSlash+">"+this.endline(r,i,o);i.state=a.None;this.closeNode(r,i,o);return l};XMLWriterBase.prototype.dtdNotation=function(r,i,o){var l;this.openNode(r,i,o);i.state=a.OpenTag;l=this.indent(r,i,o)+"<!NOTATION";i.state=a.InsideTag;l+=" "+r.name;if(r.pubID&&r.sysID){l+=' PUBLIC "'+r.pubID+'" "'+r.sysID+'"'}else if(r.pubID){l+=' PUBLIC "'+r.pubID+'"'}else if(r.sysID){l+=' SYSTEM "'+r.sysID+'"'}i.state=a.CloseTag;l+=i.spaceBeforeSlash+">"+this.endline(r,i,o);i.state=a.None;this.closeNode(r,i,o);return l};XMLWriterBase.prototype.openNode=function(r,i,o){};XMLWriterBase.prototype.closeNode=function(r,i,o){};XMLWriterBase.prototype.openAttribute=function(r,i,o){};XMLWriterBase.prototype.closeAttribute=function(r,i,o){};return XMLWriterBase}()}).call(this)},3131:function(r,i,o){(function(){var i,a,l,u,c,h,d,p,m,g;g=o(2629),p=g.assign,m=g.isFunction;l=o(9490);u=o(3315);c=o(1523);d=o(6939);h=o(359);i=o(4128);a=o(8413);r.exports.create=function(r,i,o,a){var l,c;if(r==null){throw new Error("Root element needs a name.")}a=p({},i,o,a);l=new u(a);c=l.element(r);if(!a.headless){l.declaration(a);if(a.pubID!=null||a.sysID!=null){l.dtd(a)}}return c};r.exports.begin=function(r,i,o){var a;if(m(r)){a=[r,i],i=a[0],o=a[1];r={}}if(i){return new c(r,i,o)}else{return new u(r)}};r.exports.stringWriter=function(r){return new d(r)};r.exports.streamWriter=function(r,i){return new h(r,i)};r.exports.implementation=new l;r.exports.nodeType=i;r.exports.writerState=a}).call(this)},144:function(r){(function(){r.exports={Disconnected:1,Preceding:2,Following:4,Contains:8,ContainedBy:16,ImplementationSpecific:32}}).call(this)},7762:function(r){(function(){r.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)},983:function(r){(function(){var i,o,a,l,u,c,h,d={}.hasOwnProperty;i=function(r,...i){var o,a,l,c;if(u(Object.assign)){Object.assign.apply(null,arguments)}else{for(o=0,l=i.length;o<l;o++){c=i[o];if(c!=null){for(a in c){if(!d.call(c,a))continue;r[a]=c[a]}}}}return r};u=function(r){return!!r&&Object.prototype.toString.call(r)==="[object Function]"};c=function(r){var i;return!!r&&((i=typeof r)==="function"||i==="object")};a=function(r){if(u(Array.isArray)){return Array.isArray(r)}else{return Object.prototype.toString.call(r)==="[object Array]"}};l=function(r){var i;if(a(r)){return!r.length}else{for(i in r){if(!d.call(r,i))continue;return false}return true}};h=function(r){var i,o;return c(r)&&(o=Object.getPrototypeOf(r))&&(i=o.constructor)&&typeof i==="function"&&i instanceof i&&Function.prototype.toString.call(i)===Function.prototype.toString.call(Object)};o=function(r){if(u(r.valueOf)){return r.valueOf()}else{return r}};r.exports.assign=i;r.exports.isFunction=u;r.exports.isObject=c;r.exports.isArray=a;r.exports.isEmpty=l;r.exports.isPlainObject=h;r.exports.getValue=o}).call(this)},140:function(r){(function(){r.exports={None:0,OpenTag:1,InsideTag:2,CloseTag:3}}).call(this)},1395:function(r,i,o){(function(){var i,a,l;i=o(7762);l=o(5089);r.exports=a=function(){class XMLAttribute{constructor(r,o,a){this.parent=r;if(this.parent){this.options=this.parent.options;this.stringify=this.parent.stringify}if(o==null){throw new Error("Missing attribute name. "+this.debugInfo(o))}this.name=this.stringify.name(o);this.value=this.stringify.attValue(a);this.type=i.Attribute;this.isId=false;this.schemaTypeInfo=null}clone(){return Object.create(this)}toString(r){return this.options.writer.attribute(this,this.options.writer.filterOptions(r))}debugInfo(r){r=r||this.name;if(r==null){return"parent: <"+this.parent.name+">"}else{return"attribute: {"+r+"}, parent: <"+this.parent.name+">"}}isEqualNode(r){if(r.namespaceURI!==this.namespaceURI){return false}if(r.prefix!==this.prefix){return false}if(r.localName!==this.localName){return false}if(r.value!==this.value){return false}return true}}Object.defineProperty(XMLAttribute.prototype,"nodeType",{get:function(){return this.type}});Object.defineProperty(XMLAttribute.prototype,"ownerElement",{get:function(){return this.parent}});Object.defineProperty(XMLAttribute.prototype,"textContent",{get:function(){return this.value},set:function(r){return this.value=r||""}});Object.defineProperty(XMLAttribute.prototype,"namespaceURI",{get:function(){return""}});Object.defineProperty(XMLAttribute.prototype,"prefix",{get:function(){return""}});Object.defineProperty(XMLAttribute.prototype,"localName",{get:function(){return this.name}});Object.defineProperty(XMLAttribute.prototype,"specified",{get:function(){return true}});return XMLAttribute}.call(this)}).call(this)},5261:function(r,i,o){(function(){var i,a,l;i=o(7762);l=o(4765);r.exports=a=class XMLCData extends l{constructor(r,o){super(r);if(o==null){throw new Error("Missing CDATA text. "+this.debugInfo())}this.name="#cdata-section";this.type=i.CData;this.value=this.stringify.cdata(o)}clone(){return Object.create(this)}toString(r){return this.options.writer.cdata(this,this.options.writer.filterOptions(r))}}}).call(this)},4765:function(r,i,o){(function(){var i,a;a=o(5089);r.exports=i=function(){class XMLCharacterData extends a{constructor(r){super(r);this.value=""}clone(){return Object.create(this)}substringData(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())}appendData(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}insertData(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())}deleteData(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())}replaceData(r,i,o){throw new Error("This DOM method is not implemented."+this.debugInfo())}isEqualNode(r){if(!super.isEqualNode(r)){return false}if(r.data!==this.data){return false}return true}}Object.defineProperty(XMLCharacterData.prototype,"data",{get:function(){return this.value},set:function(r){return this.value=r||""}});Object.defineProperty(XMLCharacterData.prototype,"length",{get:function(){return this.value.length}});Object.defineProperty(XMLCharacterData.prototype,"textContent",{get:function(){return this.value},set:function(r){return this.value=r||""}});return XMLCharacterData}.call(this)}).call(this)},360:function(r,i,o){(function(){var i,a,l;i=o(7762);a=o(4765);r.exports=l=class XMLComment extends a{constructor(r,o){super(r);if(o==null){throw new Error("Missing comment text. "+this.debugInfo())}this.name="#comment";this.type=i.Comment;this.value=this.stringify.comment(o)}clone(){return Object.create(this)}toString(r){return this.options.writer.comment(this,this.options.writer.filterOptions(r))}}}).call(this)},5675:function(r,i,o){(function(){var i,a,l;a=o(121);l=o(8207);r.exports=i=function(){class XMLDOMConfiguration{constructor(){var r;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=r=Object.create(this.defaultParams)}getParameter(r){if(this.params.hasOwnProperty(r)){return this.params[r]}else{return null}}canSetParameter(r,i){return true}setParameter(r,i){if(i!=null){return this.params[r]=i}else{return delete this.params[r]}}}Object.defineProperty(XMLDOMConfiguration.prototype,"parameterNames",{get:function(){return new l(Object.keys(this.defaultParams))}});return XMLDOMConfiguration}.call(this)}).call(this)},121:function(r){(function(){var i;r.exports=i=class XMLDOMErrorHandler{constructor(){}handleError(r){throw new Error(r)}}}).call(this)},2692:function(r){(function(){var i;r.exports=i=class XMLDOMImplementation{hasFeature(r,i){return true}createDocumentType(r,i,o){throw new Error("This DOM method is not implemented.")}createDocument(r,i,o){throw new Error("This DOM method is not implemented.")}createHTMLDocument(r){throw new Error("This DOM method is not implemented.")}getFeature(r,i){throw new Error("This DOM method is not implemented.")}}}).call(this)},8207:function(r){(function(){var i;r.exports=i=function(){class XMLDOMStringList{constructor(r){this.arr=r||[]}item(r){return this.arr[r]||null}contains(r){return this.arr.indexOf(r)!==-1}}Object.defineProperty(XMLDOMStringList.prototype,"length",{get:function(){return this.arr.length}});return XMLDOMStringList}.call(this)}).call(this)},2529:function(r,i,o){(function(){var i,a,l;l=o(5089);i=o(7762);r.exports=a=class XMLDTDAttList extends l{constructor(r,o,a,l,u,c){super(r);if(o==null){throw new Error("Missing DTD element name. "+this.debugInfo())}if(a==null){throw new Error("Missing DTD attribute name. "+this.debugInfo(o))}if(!l){throw new Error("Missing DTD attribute type. "+this.debugInfo(o))}if(!u){throw new Error("Missing DTD attribute default. "+this.debugInfo(o))}if(u.indexOf("#")!==0){u="#"+u}if(!u.match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/)){throw new Error("Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT. "+this.debugInfo(o))}if(c&&!u.match(/^(#FIXED|#DEFAULT)$/)){throw new Error("Default value only applies to #FIXED or #DEFAULT. "+this.debugInfo(o))}this.elementName=this.stringify.name(o);this.type=i.AttributeDeclaration;this.attributeName=this.stringify.name(a);this.attributeType=this.stringify.dtdAttType(l);if(c){this.defaultValue=this.stringify.dtdAttDefault(c)}this.defaultValueType=u}toString(r){return this.options.writer.dtdAttList(this,this.options.writer.filterOptions(r))}}}).call(this)},7486:function(r,i,o){(function(){var i,a,l;l=o(5089);i=o(7762);r.exports=a=class XMLDTDElement extends l{constructor(r,o,a){super(r);if(o==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(o);this.type=i.ElementDeclaration;this.value=this.stringify.dtdElementValue(a)}toString(r){return this.options.writer.dtdElement(this,this.options.writer.filterOptions(r))}}}).call(this)},9252:function(r,i,o){(function(){var i,a,l,u;({isObject:u}=o(983));l=o(5089);i=o(7762);r.exports=a=function(){class XMLDTDEntity extends l{constructor(r,o,a,l){super(r);if(a==null){throw new Error("Missing DTD entity name. "+this.debugInfo(a))}if(l==null){throw new Error("Missing DTD entity value. "+this.debugInfo(a))}this.pe=!!o;this.name=this.stringify.name(a);this.type=i.EntityDeclaration;if(!u(l)){this.value=this.stringify.dtdEntityValue(l);this.internal=true}else{if(!l.pubID&&!l.sysID){throw new Error("Public and/or system identifiers are required for an external entity. "+this.debugInfo(a))}if(l.pubID&&!l.sysID){throw new Error("System identifier is required for a public external entity. "+this.debugInfo(a))}this.internal=false;if(l.pubID!=null){this.pubID=this.stringify.dtdPubID(l.pubID)}if(l.sysID!=null){this.sysID=this.stringify.dtdSysID(l.sysID)}if(l.nData!=null){this.nData=this.stringify.dtdNData(l.nData)}if(this.pe&&this.nData){throw new Error("Notation declaration is not allowed in a parameter entity. "+this.debugInfo(a))}}}toString(r){return this.options.writer.dtdEntity(this,this.options.writer.filterOptions(r))}}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}});return XMLDTDEntity}.call(this)}).call(this)},3353:function(r,i,o){(function(){var i,a,l;l=o(5089);i=o(7762);r.exports=a=function(){class XMLDTDNotation extends l{constructor(r,o,a){super(r);if(o==null){throw new Error("Missing DTD notation name. "+this.debugInfo(o))}if(!a.pubID&&!a.sysID){throw new Error("Public or system identifiers are required for an external entity. "+this.debugInfo(o))}this.name=this.stringify.name(o);this.type=i.NotationDeclaration;if(a.pubID!=null){this.pubID=this.stringify.dtdPubID(a.pubID)}if(a.sysID!=null){this.sysID=this.stringify.dtdSysID(a.sysID)}}toString(r){return this.options.writer.dtdNotation(this,this.options.writer.filterOptions(r))}}Object.defineProperty(XMLDTDNotation.prototype,"publicId",{get:function(){return this.pubID}});Object.defineProperty(XMLDTDNotation.prototype,"systemId",{get:function(){return this.sysID}});return XMLDTDNotation}.call(this)}).call(this)},6645:function(r,i,o){(function(){var i,a,l,u;({isObject:u}=o(983));l=o(5089);i=o(7762);r.exports=a=class XMLDeclaration extends l{constructor(r,o,a,l){super(r);if(u(o)){({version:o,encoding:a,standalone:l}=o)}if(!o){o="1.0"}this.type=i.Declaration;this.version=this.stringify.xmlVersion(o);if(a!=null){this.encoding=this.stringify.xmlEncoding(a)}if(l!=null){this.standalone=this.stringify.xmlStandalone(l)}}toString(r){return this.options.writer.declaration(this,this.options.writer.filterOptions(r))}}}).call(this)},8873:function(r,i,o){(function(){var i,a,l,u,c,h,d,p,m;({isObject:m}=o(983));p=o(5089);i=o(7762);a=o(2529);u=o(9252);l=o(7486);c=o(3353);d=o(2076);r.exports=h=function(){class XMLDocType extends p{constructor(r,o,a){var l,u,c,h;super(r);this.type=i.DocType;if(r.children){h=r.children;for(u=0,c=h.length;u<c;u++){l=h[u];if(l.type===i.Element){this.name=l.name;break}}}this.documentObject=r;if(m(o)){({pubID:o,sysID:a}=o)}if(a==null){[a,o]=[o,a]}if(o!=null){this.pubID=this.stringify.dtdPubID(o)}if(a!=null){this.sysID=this.stringify.dtdSysID(a)}}element(r,i){var o;o=new l(this,r,i);this.children.push(o);return this}attList(r,i,o,l,u){var c;c=new a(this,r,i,o,l,u);this.children.push(c);return this}entity(r,i){var o;o=new u(this,false,r,i);this.children.push(o);return this}pEntity(r,i){var o;o=new u(this,true,r,i);this.children.push(o);return this}notation(r,i){var o;o=new c(this,r,i);this.children.push(o);return this}toString(r){return this.options.writer.docType(this,this.options.writer.filterOptions(r))}ele(r,i){return this.element(r,i)}att(r,i,o,a,l){return this.attList(r,i,o,a,l)}ent(r,i){return this.entity(r,i)}pent(r,i){return this.pEntity(r,i)}not(r,i){return this.notation(r,i)}up(){return this.root()||this.documentObject}isEqualNode(r){if(!super.isEqualNode(r)){return false}if(r.name!==this.name){return false}if(r.publicId!==this.publicId){return false}if(r.systemId!==this.systemId){return false}return true}}Object.defineProperty(XMLDocType.prototype,"entities",{get:function(){var r,o,a,l,u;l={};u=this.children;for(o=0,a=u.length;o<a;o++){r=u[o];if(r.type===i.EntityDeclaration&&!r.pe){l[r.name]=r}}return new d(l)}});Object.defineProperty(XMLDocType.prototype,"notations",{get:function(){var r,o,a,l,u;l={};u=this.children;for(o=0,a=u.length;o<a;o++){r=u[o];if(r.type===i.NotationDeclaration){l[r.name]=r}}return new d(l)}});Object.defineProperty(XMLDocType.prototype,"publicId",{get:function(){return this.pubID}});Object.defineProperty(XMLDocType.prototype,"systemId",{get:function(){return this.sysID}});Object.defineProperty(XMLDocType.prototype,"internalSubset",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}});return XMLDocType}.call(this)}).call(this)},1582:function(r,i,o){(function(){var i,a,l,u,c,h,d,p;({isPlainObject:p}=o(983));l=o(2692);a=o(5675);c=o(5089);i=o(7762);d=o(645);h=o(7834);r.exports=u=function(){class XMLDocument extends c{constructor(r){super(null);this.name="#document";this.type=i.Document;this.documentURI=null;this.domConfig=new a;r||(r={});if(!r.writer){r.writer=new h}this.options=r;this.stringify=new d(r)}end(r){var i;i={};if(!r){r=this.options.writer}else if(p(r)){i=r;r=this.options.writer}return r.document(this,r.filterOptions(i))}toString(r){return this.options.writer.document(this,this.options.writer.filterOptions(r))}createElement(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}createDocumentFragment(){throw new Error("This DOM method is not implemented."+this.debugInfo())}createTextNode(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}createComment(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}createCDATASection(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}createProcessingInstruction(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())}createAttribute(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}createEntityReference(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}getElementsByTagName(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}importNode(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())}createElementNS(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())}createAttributeNS(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())}getElementsByTagNameNS(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())}getElementById(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}adoptNode(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}normalizeDocument(){throw new Error("This DOM method is not implemented."+this.debugInfo())}renameNode(r,i,o){throw new Error("This DOM method is not implemented."+this.debugInfo())}getElementsByClassName(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}createEvent(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}createRange(){throw new Error("This DOM method is not implemented."+this.debugInfo())}createNodeIterator(r,i,o){throw new Error("This DOM method is not implemented."+this.debugInfo())}createTreeWalker(r,i,o){throw new Error("This DOM method is not implemented."+this.debugInfo())}}Object.defineProperty(XMLDocument.prototype,"implementation",{value:new l});Object.defineProperty(XMLDocument.prototype,"doctype",{get:function(){var r,o,a,l;l=this.children;for(o=0,a=l.length;o<a;o++){r=l[o];if(r.type===i.DocType){return r}}return null}});Object.defineProperty(XMLDocument.prototype,"documentElement",{get:function(){return this.rootObject||null}});Object.defineProperty(XMLDocument.prototype,"inputEncoding",{get:function(){return null}});Object.defineProperty(XMLDocument.prototype,"strictErrorChecking",{get:function(){return false}});Object.defineProperty(XMLDocument.prototype,"xmlEncoding",{get:function(){if(this.children.length!==0&&this.children[0].type===i.Declaration){return this.children[0].encoding}else{return null}}});Object.defineProperty(XMLDocument.prototype,"xmlStandalone",{get:function(){if(this.children.length!==0&&this.children[0].type===i.Declaration){return this.children[0].standalone==="yes"}else{return false}}});Object.defineProperty(XMLDocument.prototype,"xmlVersion",{get:function(){if(this.children.length!==0&&this.children[0].type===i.Declaration){return this.children[0].version}else{return"1.0"}}});Object.defineProperty(XMLDocument.prototype,"URL",{get:function(){return this.documentURI}});Object.defineProperty(XMLDocument.prototype,"origin",{get:function(){return null}});Object.defineProperty(XMLDocument.prototype,"compatMode",{get:function(){return null}});Object.defineProperty(XMLDocument.prototype,"characterSet",{get:function(){return null}});Object.defineProperty(XMLDocument.prototype,"contentType",{get:function(){return null}});return XMLDocument}.call(this)}).call(this)},2871:function(r,i,o){(function(){var i,a,l,u,c,h,d,p,m,g,y,v,b,w,M,E,D,T,x,O,N,_,A,I={}.hasOwnProperty;({isObject:_,isFunction:N,isPlainObject:A,getValue:O}=o(983));i=o(7762);v=o(1582);w=o(6484);u=o(5261);c=o(360);E=o(8732);x=o(2275);M=o(8947);g=o(6645);y=o(8873);h=o(2529);p=o(9252);d=o(7486);m=o(3353);l=o(1395);T=o(645);D=o(7834);a=o(140);r.exports=b=class XMLDocumentCB{constructor(r,o,a){var l;this.name="?xml";this.type=i.Document;r||(r={});l={};if(!r.writer){r.writer=new D}else if(A(r.writer)){l=r.writer;r.writer=new D}this.options=r;this.writer=r.writer;this.writerOptions=this.writer.filterOptions(l);this.stringify=new T(r);this.onDataCallback=o||function(){};this.onEndCallback=a||function(){};this.currentNode=null;this.currentLevel=-1;this.openTags={};this.documentStarted=false;this.documentCompleted=false;this.root=null}createChildNode(r){var o,a,l,u,c,h,d,p;switch(r.type){case i.CData:this.cdata(r.value);break;case i.Comment:this.comment(r.value);break;case i.Element:l={};d=r.attribs;for(a in d){if(!I.call(d,a))continue;o=d[a];l[a]=o.value}this.node(r.name,l);break;case i.Dummy:this.dummy();break;case i.Raw:this.raw(r.value);break;case i.Text:this.text(r.value);break;case i.ProcessingInstruction:this.instruction(r.target,r.value);break;default:throw new Error("This XML node type is not supported in a JS object: "+r.constructor.name)}p=r.children;for(c=0,h=p.length;c<h;c++){u=p[c];this.createChildNode(u);if(u.type===i.Element){this.up()}}return this}dummy(){return this}node(r,i,o){if(r==null){throw new Error("Missing node name.")}if(this.root&&this.currentLevel===-1){throw new Error("Document can only have one root node. "+this.debugInfo(r))}this.openCurrent();r=O(r);if(i==null){i={}}i=O(i);if(!_(i)){[o,i]=[i,o]}this.currentNode=new w(this,r,i);this.currentNode.children=false;this.currentLevel++;this.openTags[this.currentLevel]=this.currentNode;if(o!=null){this.text(o)}return this}element(r,o,a){var l,u,c,h,d,p;if(this.currentNode&&this.currentNode.type===i.DocType){this.dtdElement(...arguments)}else{if(Array.isArray(r)||_(r)||N(r)){h=this.options.noValidation;this.options.noValidation=true;p=new v(this.options).element("TEMP_ROOT");p.element(r);this.options.noValidation=h;d=p.children;for(u=0,c=d.length;u<c;u++){l=d[u];this.createChildNode(l);if(l.type===i.Element){this.up()}}}else{this.node(r,o,a)}}return this}attribute(r,i){var o,a;if(!this.currentNode||this.currentNode.children){throw new Error("att() can only be used immediately after an ele() call in callback mode. "+this.debugInfo(r))}if(r!=null){r=O(r)}if(_(r)){for(o in r){if(!I.call(r,o))continue;a=r[o];this.attribute(o,a)}}else{if(N(i)){i=i.apply()}if(this.options.keepNullAttributes&&i==null){this.currentNode.attribs[r]=new l(this,r,"")}else if(i!=null){this.currentNode.attribs[r]=new l(this,r,i)}}return this}text(r){var i;this.openCurrent();i=new x(this,r);this.onData(this.writer.text(i,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this}cdata(r){var i;this.openCurrent();i=new u(this,r);this.onData(this.writer.cdata(i,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this}comment(r){var i;this.openCurrent();i=new c(this,r);this.onData(this.writer.comment(i,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this}raw(r){var i;this.openCurrent();i=new E(this,r);this.onData(this.writer.raw(i,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this}instruction(r,i){var o,a,l,u,c;this.openCurrent();if(r!=null){r=O(r)}if(i!=null){i=O(i)}if(Array.isArray(r)){for(o=0,u=r.length;o<u;o++){a=r[o];this.instruction(a)}}else if(_(r)){for(a in r){if(!I.call(r,a))continue;l=r[a];this.instruction(a,l)}}else{if(N(i)){i=i.apply()}c=new M(this,r,i);this.onData(this.writer.processingInstruction(c,this.writerOptions,this.currentLevel+1),this.currentLevel+1)}return this}declaration(r,i,o){var a;this.openCurrent();if(this.documentStarted){throw new Error("declaration() must be the first node.")}a=new g(this,r,i,o);this.onData(this.writer.declaration(a,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this}doctype(r,i,o){this.openCurrent();if(r==null){throw new Error("Missing root node name.")}if(this.root){throw new Error("dtd() must come before the root node.")}this.currentNode=new y(this,i,o);this.currentNode.rootNodeName=r;this.currentNode.children=false;this.currentLevel++;this.openTags[this.currentLevel]=this.currentNode;return this}dtdElement(r,i){var o;this.openCurrent();o=new d(this,r,i);this.onData(this.writer.dtdElement(o,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this}attList(r,i,o,a,l){var u;this.openCurrent();u=new h(this,r,i,o,a,l);this.onData(this.writer.dtdAttList(u,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this}entity(r,i){var o;this.openCurrent();o=new p(this,false,r,i);this.onData(this.writer.dtdEntity(o,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this}pEntity(r,i){var o;this.openCurrent();o=new p(this,true,r,i);this.onData(this.writer.dtdEntity(o,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this}notation(r,i){var o;this.openCurrent();o=new m(this,r,i);this.onData(this.writer.dtdNotation(o,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this}up(){if(this.currentLevel<0){throw new Error("The document node has no parent.")}if(this.currentNode){if(this.currentNode.children){this.closeNode(this.currentNode)}else{this.openNode(this.currentNode)}this.currentNode=null}else{this.closeNode(this.openTags[this.currentLevel])}delete this.openTags[this.currentLevel];this.currentLevel--;return this}end(){while(this.currentLevel>=0){this.up()}return this.onEnd()}openCurrent(){if(this.currentNode){this.currentNode.children=true;return this.openNode(this.currentNode)}}openNode(r){var o,l,u,c;if(!r.isOpen){if(!this.root&&this.currentLevel===0&&r.type===i.Element){this.root=r}l="";if(r.type===i.Element){this.writerOptions.state=a.OpenTag;l=this.writer.indent(r,this.writerOptions,this.currentLevel)+"<"+r.name;c=r.attribs;for(u in c){if(!I.call(c,u))continue;o=c[u];l+=this.writer.attribute(o,this.writerOptions,this.currentLevel)}l+=(r.children?">":"/>")+this.writer.endline(r,this.writerOptions,this.currentLevel);this.writerOptions.state=a.InsideTag}else{this.writerOptions.state=a.OpenTag;l=this.writer.indent(r,this.writerOptions,this.currentLevel)+"<!DOCTYPE "+r.rootNodeName;if(r.pubID&&r.sysID){l+=' PUBLIC "'+r.pubID+'" "'+r.sysID+'"'}else if(r.sysID){l+=' SYSTEM "'+r.sysID+'"'}if(r.children){l+=" [";this.writerOptions.state=a.InsideTag}else{this.writerOptions.state=a.CloseTag;l+=">"}l+=this.writer.endline(r,this.writerOptions,this.currentLevel)}this.onData(l,this.currentLevel);return r.isOpen=true}}closeNode(r){var o;if(!r.isClosed){o="";this.writerOptions.state=a.CloseTag;if(r.type===i.Element){o=this.writer.indent(r,this.writerOptions,this.currentLevel)+"</"+r.name+">"+this.writer.endline(r,this.writerOptions,this.currentLevel)}else{o=this.writer.indent(r,this.writerOptions,this.currentLevel)+"]>"+this.writer.endline(r,this.writerOptions,this.currentLevel)}this.writerOptions.state=a.None;this.onData(o,this.currentLevel);return r.isClosed=true}}onData(r,i){this.documentStarted=true;return this.onDataCallback(r,i+1)}onEnd(){this.documentCompleted=true;return this.onEndCallback()}debugInfo(r){if(r==null){return""}else{return"node: <"+r+">"}}ele(){return this.element(...arguments)}nod(r,i,o){return this.node(r,i,o)}txt(r){return this.text(r)}dat(r){return this.cdata(r)}com(r){return this.comment(r)}ins(r,i){return this.instruction(r,i)}dec(r,i,o){return this.declaration(r,i,o)}dtd(r,i,o){return this.doctype(r,i,o)}e(r,i,o){return this.element(r,i,o)}n(r,i,o){return this.node(r,i,o)}t(r){return this.text(r)}d(r){return this.cdata(r)}c(r){return this.comment(r)}r(r){return this.raw(r)}i(r,i){return this.instruction(r,i)}att(){if(this.currentNode&&this.currentNode.type===i.DocType){return this.attList(...arguments)}else{return this.attribute(...arguments)}}a(){if(this.currentNode&&this.currentNode.type===i.DocType){return this.attList(...arguments)}else{return this.attribute(...arguments)}}ent(r,i){return this.entity(r,i)}pent(r,i){return this.pEntity(r,i)}not(r,i){return this.notation(r,i)}}}).call(this)},706:function(r,i,o){(function(){var i,a,l;l=o(5089);i=o(7762);r.exports=a=class XMLDummy extends l{constructor(r){super(r);this.type=i.Dummy}clone(){return Object.create(this)}toString(r){return""}}}).call(this)},6484:function(r,i,o){(function(){var i,a,l,u,c,h,d,p,m={}.hasOwnProperty;({isObject:p,isFunction:d,getValue:h}=o(983));c=o(5089);i=o(7762);a=o(1395);u=o(2076);r.exports=l=function(){class XMLElement extends c{constructor(r,o,a){var l,u,c,h;super(r);if(o==null){throw new Error("Missing element name. "+this.debugInfo())}this.name=this.stringify.name(o);this.type=i.Element;this.attribs={};this.schemaTypeInfo=null;if(a!=null){this.attribute(a)}if(r.type===i.Document){this.isRoot=true;this.documentObject=r;r.rootObject=this;if(r.children){h=r.children;for(u=0,c=h.length;u<c;u++){l=h[u];if(l.type===i.DocType){l.name=this.name;break}}}}}clone(){var r,i,o,a;o=Object.create(this);if(o.isRoot){o.documentObject=null}o.attribs={};a=this.attribs;for(i in a){if(!m.call(a,i))continue;r=a[i];o.attribs[i]=r.clone()}o.children=[];this.children.forEach((function(r){var i;i=r.clone();i.parent=o;return o.children.push(i)}));return o}attribute(r,i){var o,l;if(r!=null){r=h(r)}if(p(r)){for(o in r){if(!m.call(r,o))continue;l=r[o];this.attribute(o,l)}}else{if(d(i)){i=i.apply()}if(this.options.keepNullAttributes&&i==null){this.attribs[r]=new a(this,r,"")}else if(i!=null){this.attribs[r]=new a(this,r,i)}}return this}removeAttribute(r){var i,o,a;if(r==null){throw new Error("Missing attribute name. "+this.debugInfo())}r=h(r);if(Array.isArray(r)){for(o=0,a=r.length;o<a;o++){i=r[o];delete this.attribs[i]}}else{delete this.attribs[r]}return this}toString(r){return this.options.writer.element(this,this.options.writer.filterOptions(r))}att(r,i){return this.attribute(r,i)}a(r,i){return this.attribute(r,i)}getAttribute(r){if(this.attribs.hasOwnProperty(r)){return this.attribs[r].value}else{return null}}setAttribute(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())}getAttributeNode(r){if(this.attribs.hasOwnProperty(r)){return this.attribs[r]}else{return null}}setAttributeNode(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}removeAttributeNode(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}getElementsByTagName(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}getAttributeNS(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())}setAttributeNS(r,i,o){throw new Error("This DOM method is not implemented."+this.debugInfo())}removeAttributeNS(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())}getAttributeNodeNS(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())}setAttributeNodeNS(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}getElementsByTagNameNS(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())}hasAttribute(r){return this.attribs.hasOwnProperty(r)}hasAttributeNS(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())}setIdAttribute(r,i){if(this.attribs.hasOwnProperty(r)){return this.attribs[r].isId}else{return i}}setIdAttributeNS(r,i,o){throw new Error("This DOM method is not implemented."+this.debugInfo())}setIdAttributeNode(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())}getElementsByTagName(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}getElementsByTagNameNS(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())}getElementsByClassName(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}isEqualNode(r){var i,o,a;if(!super.isEqualNode(r)){return false}if(r.namespaceURI!==this.namespaceURI){return false}if(r.prefix!==this.prefix){return false}if(r.localName!==this.localName){return false}if(r.attribs.length!==this.attribs.length){return false}for(i=o=0,a=this.attribs.length-1;0<=a?o<=a:o>=a;i=0<=a?++o:--o){if(!this.attribs[i].isEqualNode(r.attribs[i])){return false}}return true}}Object.defineProperty(XMLElement.prototype,"tagName",{get:function(){return this.name}});Object.defineProperty(XMLElement.prototype,"namespaceURI",{get:function(){return""}});Object.defineProperty(XMLElement.prototype,"prefix",{get:function(){return""}});Object.defineProperty(XMLElement.prototype,"localName",{get:function(){return this.name}});Object.defineProperty(XMLElement.prototype,"id",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}});Object.defineProperty(XMLElement.prototype,"className",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}});Object.defineProperty(XMLElement.prototype,"classList",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}});Object.defineProperty(XMLElement.prototype,"attributes",{get:function(){if(!this.attributeMap||!this.attributeMap.nodes){this.attributeMap=new u(this.attribs)}return this.attributeMap}});return XMLElement}.call(this)}).call(this)},2076:function(r){(function(){var i;r.exports=i=function(){class XMLNamedNodeMap{constructor(r){this.nodes=r}clone(){return this.nodes=null}getNamedItem(r){return this.nodes[r]}setNamedItem(r){var i;i=this.nodes[r.nodeName];this.nodes[r.nodeName]=r;return i||null}removeNamedItem(r){var i;i=this.nodes[r];delete this.nodes[r];return i||null}item(r){return this.nodes[Object.keys(this.nodes)[r]]||null}getNamedItemNS(r,i){throw new Error("This DOM method is not implemented.")}setNamedItemNS(r){throw new Error("This DOM method is not implemented.")}removeNamedItemNS(r,i){throw new Error("This DOM method is not implemented.")}}Object.defineProperty(XMLNamedNodeMap.prototype,"length",{get:function(){return Object.keys(this.nodes).length||0}});return XMLNamedNodeMap}.call(this)}).call(this)},5089:function(r,i,o){(function(){var i,a,l,u,c,h,d,p,m,g,y,v,b,w,M,E,D,T,x={}.hasOwnProperty,O=[].splice;({isObject:T,isFunction:D,isEmpty:E,getValue:M}=o(983));p=null;l=null;u=null;c=null;h=null;b=null;w=null;v=null;d=null;a=null;y=null;m=null;i=null;r.exports=g=function(){class XMLNode{constructor(r){this.parent=r;if(this.parent){this.options=this.parent.options;this.stringify=this.parent.stringify}this.value=null;this.children=[];this.baseURI=null;if(!p){p=o(6484);l=o(5261);u=o(360);c=o(6645);h=o(8873);b=o(8732);w=o(2275);v=o(8947);d=o(706);a=o(7762);y=o(9908);m=o(2076);i=o(144)}}setParent(r){var i,o,a,l,u;this.parent=r;if(r){this.options=r.options;this.stringify=r.stringify}l=this.children;u=[];for(o=0,a=l.length;o<a;o++){i=l[o];u.push(i.setParent(this))}return u}element(r,i,o){var a,l,u,c,h,d,p,m,g;d=null;if(i===null&&o==null){[i,o]=[{},null]}if(i==null){i={}}i=M(i);if(!T(i)){[o,i]=[i,o]}if(r!=null){r=M(r)}if(Array.isArray(r)){for(u=0,p=r.length;u<p;u++){l=r[u];d=this.element(l)}}else if(D(r)){d=this.element(r.apply())}else if(T(r)){for(h in r){if(!x.call(r,h))continue;g=r[h];if(D(g)){g=g.apply()}if(!this.options.ignoreDecorators&&this.stringify.convertAttKey&&h.indexOf(this.stringify.convertAttKey)===0){d=this.attribute(h.substr(this.stringify.convertAttKey.length),g)}else if(!this.options.separateArrayItems&&Array.isArray(g)&&E(g)){d=this.dummy()}else if(T(g)&&E(g)){d=this.element(h)}else if(!this.options.keepNullNodes&&g==null){d=this.dummy()}else if(!this.options.separateArrayItems&&Array.isArray(g)){for(c=0,m=g.length;c<m;c++){l=g[c];a={};a[h]=l;d=this.element(a)}}else if(T(g)){if(!this.options.ignoreDecorators&&this.stringify.convertTextKey&&h.indexOf(this.stringify.convertTextKey)===0){d=this.element(g)}else{d=this.element(h);d.element(g)}}else{d=this.element(h,g)}}}else if(!this.options.keepNullNodes&&o===null){d=this.dummy()}else{if(!this.options.ignoreDecorators&&this.stringify.convertTextKey&&r.indexOf(this.stringify.convertTextKey)===0){d=this.text(o)}else if(!this.options.ignoreDecorators&&this.stringify.convertCDataKey&&r.indexOf(this.stringify.convertCDataKey)===0){d=this.cdata(o)}else if(!this.options.ignoreDecorators&&this.stringify.convertCommentKey&&r.indexOf(this.stringify.convertCommentKey)===0){d=this.comment(o)}else if(!this.options.ignoreDecorators&&this.stringify.convertRawKey&&r.indexOf(this.stringify.convertRawKey)===0){d=this.raw(o)}else if(!this.options.ignoreDecorators&&this.stringify.convertPIKey&&r.indexOf(this.stringify.convertPIKey)===0){d=this.instruction(r.substr(this.stringify.convertPIKey.length),o)}else{d=this.node(r,i,o)}}if(d==null){throw new Error("Could not create any elements with: "+r+". "+this.debugInfo())}return d}insertBefore(r,i,o){var a,l,u,c,h;if(r!=null?r.type:void 0){u=r;c=i;u.setParent(this);if(c){l=children.indexOf(c);h=children.splice(l);children.push(u);Array.prototype.push.apply(children,h)}else{children.push(u)}return u}else{if(this.isRoot){throw new Error("Cannot insert elements at root level. "+this.debugInfo(r))}l=this.parent.children.indexOf(this);h=this.parent.children.splice(l);a=this.parent.element(r,i,o);Array.prototype.push.apply(this.parent.children,h);return a}}insertAfter(r,i,o){var a,l,u;if(this.isRoot){throw new Error("Cannot insert elements at root level. "+this.debugInfo(r))}l=this.parent.children.indexOf(this);u=this.parent.children.splice(l+1);a=this.parent.element(r,i,o);Array.prototype.push.apply(this.parent.children,u);return a}remove(){var r,i;if(this.isRoot){throw new Error("Cannot remove the root element. "+this.debugInfo())}r=this.parent.children.indexOf(this);O.apply(this.parent.children,[r,r-r+1].concat(i=[])),i;return this.parent}node(r,i,o){var a;if(r!=null){r=M(r)}i||(i={});i=M(i);if(!T(i)){[o,i]=[i,o]}a=new p(this,r,i);if(o!=null){a.text(o)}this.children.push(a);return a}text(r){var i;if(T(r)){this.element(r)}i=new w(this,r);this.children.push(i);return this}cdata(r){var i;i=new l(this,r);this.children.push(i);return this}comment(r){var i;i=new u(this,r);this.children.push(i);return this}commentBefore(r){var i,o,a;o=this.parent.children.indexOf(this);a=this.parent.children.splice(o);i=this.parent.comment(r);Array.prototype.push.apply(this.parent.children,a);return this}commentAfter(r){var i,o,a;o=this.parent.children.indexOf(this);a=this.parent.children.splice(o+1);i=this.parent.comment(r);Array.prototype.push.apply(this.parent.children,a);return this}raw(r){var i;i=new b(this,r);this.children.push(i);return this}dummy(){var r;r=new d(this);return r}instruction(r,i){var o,a,l,u,c;if(r!=null){r=M(r)}if(i!=null){i=M(i)}if(Array.isArray(r)){for(u=0,c=r.length;u<c;u++){o=r[u];this.instruction(o)}}else if(T(r)){for(o in r){if(!x.call(r,o))continue;a=r[o];this.instruction(o,a)}}else{if(D(i)){i=i.apply()}l=new v(this,r,i);this.children.push(l)}return this}instructionBefore(r,i){var o,a,l;a=this.parent.children.indexOf(this);l=this.parent.children.splice(a);o=this.parent.instruction(r,i);Array.prototype.push.apply(this.parent.children,l);return this}instructionAfter(r,i){var o,a,l;a=this.parent.children.indexOf(this);l=this.parent.children.splice(a+1);o=this.parent.instruction(r,i);Array.prototype.push.apply(this.parent.children,l);return this}declaration(r,i,o){var l,u;l=this.document();u=new c(l,r,i,o);if(l.children.length===0){l.children.unshift(u)}else if(l.children[0].type===a.Declaration){l.children[0]=u}else{l.children.unshift(u)}return l.root()||l}dtd(r,i){var o,l,u,c,d,p,m,g,y,v;l=this.document();u=new h(l,r,i);y=l.children;for(c=d=0,m=y.length;d<m;c=++d){o=y[c];if(o.type===a.DocType){l.children[c]=u;return u}}v=l.children;for(c=p=0,g=v.length;p<g;c=++p){o=v[c];if(o.isRoot){l.children.splice(c,0,u);return u}}l.children.push(u);return u}up(){if(this.isRoot){throw new Error("The root node has no parent. Use doc() if you need to get the document object.")}return this.parent}root(){var r;r=this;while(r){if(r.type===a.Document){return r.rootObject}else if(r.isRoot){return r}else{r=r.parent}}}document(){var r;r=this;while(r){if(r.type===a.Document){return r}else{r=r.parent}}}end(r){return this.document().end(r)}prev(){var r;r=this.parent.children.indexOf(this);if(r<1){throw new Error("Already at the first node. "+this.debugInfo())}return this.parent.children[r-1]}next(){var r;r=this.parent.children.indexOf(this);if(r===-1||r===this.parent.children.length-1){throw new Error("Already at the last node. "+this.debugInfo())}return this.parent.children[r+1]}importDocument(r){var i,o,l,u,c;o=r.root().clone();o.parent=this;o.isRoot=false;this.children.push(o);if(this.type===a.Document){o.isRoot=true;o.documentObject=this;this.rootObject=o;if(this.children){c=this.children;for(l=0,u=c.length;l<u;l++){i=c[l];if(i.type===a.DocType){i.name=o.name;break}}}}return this}debugInfo(r){var i,o;r=r||this.name;if(r==null&&!((i=this.parent)!=null?i.name:void 0)){return""}else if(r==null){return"parent: <"+this.parent.name+">"}else if(!((o=this.parent)!=null?o.name:void 0)){return"node: <"+r+">"}else{return"node: <"+r+">, parent: <"+this.parent.name+">"}}ele(r,i,o){return this.element(r,i,o)}nod(r,i,o){return this.node(r,i,o)}txt(r){return this.text(r)}dat(r){return this.cdata(r)}com(r){return this.comment(r)}ins(r,i){return this.instruction(r,i)}doc(){return this.document()}dec(r,i,o){return this.declaration(r,i,o)}e(r,i,o){return this.element(r,i,o)}n(r,i,o){return this.node(r,i,o)}t(r){return this.text(r)}d(r){return this.cdata(r)}c(r){return this.comment(r)}r(r){return this.raw(r)}i(r,i){return this.instruction(r,i)}u(){return this.up()}importXMLBuilder(r){return this.importDocument(r)}attribute(r,i){throw new Error("attribute() applies to element nodes only.")}att(r,i){return this.attribute(r,i)}a(r,i){return this.attribute(r,i)}removeAttribute(r){throw new Error("attribute() applies to element nodes only.")}replaceChild(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())}removeChild(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}appendChild(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}hasChildNodes(){return this.children.length!==0}cloneNode(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}normalize(){throw new Error("This DOM method is not implemented."+this.debugInfo())}isSupported(r,i){return true}hasAttributes(){return this.attribs.length!==0}compareDocumentPosition(r){var o,a;o=this;if(o===r){return 0}else if(this.document()!==r.document()){a=i.Disconnected|i.ImplementationSpecific;if(Math.random()<.5){a|=i.Preceding}else{a|=i.Following}return a}else if(o.isAncestor(r)){return i.Contains|i.Preceding}else if(o.isDescendant(r)){return i.Contains|i.Following}else if(o.isPreceding(r)){return i.Preceding}else{return i.Following}}isSameNode(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}lookupPrefix(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}isDefaultNamespace(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}lookupNamespaceURI(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}isEqualNode(r){var i,o,a;if(r.nodeType!==this.nodeType){return false}if(r.children.length!==this.children.length){return false}for(i=o=0,a=this.children.length-1;0<=a?o<=a:o>=a;i=0<=a?++o:--o){if(!this.children[i].isEqualNode(r.children[i])){return false}}return true}getFeature(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())}setUserData(r,i,o){throw new Error("This DOM method is not implemented."+this.debugInfo())}getUserData(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}contains(r){if(!r){return false}return r===this||this.isDescendant(r)}isDescendant(r){var i,o,a,l,u;u=this.children;for(a=0,l=u.length;a<l;a++){i=u[a];if(r===i){return true}o=i.isDescendant(r);if(o){return true}}return false}isAncestor(r){return r.isDescendant(this)}isPreceding(r){var i,o;i=this.treePosition(r);o=this.treePosition(this);if(i===-1||o===-1){return false}else{return i<o}}isFollowing(r){var i,o;i=this.treePosition(r);o=this.treePosition(this);if(i===-1||o===-1){return false}else{return i>o}}treePosition(r){var i,o;o=0;i=false;this.foreachTreeNode(this.document(),(function(a){o++;if(!i&&a===r){return i=true}}));if(i){return o}else{return-1}}foreachTreeNode(r,i){var o,a,l,u,c;r||(r=this.document());u=r.children;for(a=0,l=u.length;a<l;a++){o=u[a];if(c=i(o)){return c}else{c=this.foreachTreeNode(o,i);if(c){return c}}}}}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 y(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 r;r=this.parent.children.indexOf(this);return this.parent.children[r-1]||null}});Object.defineProperty(XMLNode.prototype,"nextSibling",{get:function(){var r;r=this.parent.children.indexOf(this);return this.parent.children[r+1]||null}});Object.defineProperty(XMLNode.prototype,"ownerDocument",{get:function(){return this.document()||null}});Object.defineProperty(XMLNode.prototype,"textContent",{get:function(){var r,i,o,l,u;if(this.nodeType===a.Element||this.nodeType===a.DocumentFragment){u="";l=this.children;for(i=0,o=l.length;i<o;i++){r=l[i];if(r.textContent){u+=r.textContent}}return u}else{return null}},set:function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}});return XMLNode}.call(this)}).call(this)},9908:function(r){(function(){var i;r.exports=i=function(){class XMLNodeList{constructor(r){this.nodes=r}clone(){return this.nodes=null}item(r){return this.nodes[r]||null}}Object.defineProperty(XMLNodeList.prototype,"length",{get:function(){return this.nodes.length||0}});return XMLNodeList}.call(this)}).call(this)},8947:function(r,i,o){(function(){var i,a,l;i=o(7762);a=o(4765);r.exports=l=class XMLProcessingInstruction extends a{constructor(r,o,a){super(r);if(o==null){throw new Error("Missing instruction target. "+this.debugInfo())}this.type=i.ProcessingInstruction;this.target=this.stringify.insTarget(o);this.name=this.target;if(a){this.value=this.stringify.insValue(a)}}clone(){return Object.create(this)}toString(r){return this.options.writer.processingInstruction(this,this.options.writer.filterOptions(r))}isEqualNode(r){if(!super.isEqualNode(r)){return false}if(r.target!==this.target){return false}return true}}}).call(this)},8732:function(r,i,o){(function(){var i,a,l;i=o(7762);a=o(5089);r.exports=l=class XMLRaw extends a{constructor(r,o){super(r);if(o==null){throw new Error("Missing raw text. "+this.debugInfo())}this.type=i.Raw;this.value=this.stringify.raw(o)}clone(){return Object.create(this)}toString(r){return this.options.writer.raw(this,this.options.writer.filterOptions(r))}}}).call(this)},5922:function(r,i,o){(function(){var i,a,l,u,c={}.hasOwnProperty;i=o(7762);u=o(6670);a=o(140);r.exports=l=class XMLStreamWriter extends u{constructor(r,i){super(i);this.stream=r}endline(r,i,o){if(r.isLastRootNode&&i.state===a.CloseTag){return""}else{return super.endline(r,i,o)}}document(r,i){var o,a,l,u,c,h,d,p,m;d=r.children;for(a=l=0,c=d.length;l<c;a=++l){o=d[a];o.isLastRootNode=a===r.children.length-1}i=this.filterOptions(i);p=r.children;m=[];for(u=0,h=p.length;u<h;u++){o=p[u];m.push(this.writeChildNode(o,i,0))}return m}cdata(r,i,o){return this.stream.write(super.cdata(r,i,o))}comment(r,i,o){return this.stream.write(super.comment(r,i,o))}declaration(r,i,o){return this.stream.write(super.declaration(r,i,o))}docType(r,i,o){var l,u,c,h;o||(o=0);this.openNode(r,i,o);i.state=a.OpenTag;this.stream.write(this.indent(r,i,o));this.stream.write("<!DOCTYPE "+r.root().name);if(r.pubID&&r.sysID){this.stream.write(' PUBLIC "'+r.pubID+'" "'+r.sysID+'"')}else if(r.sysID){this.stream.write(' SYSTEM "'+r.sysID+'"')}if(r.children.length>0){this.stream.write(" [");this.stream.write(this.endline(r,i,o));i.state=a.InsideTag;h=r.children;for(u=0,c=h.length;u<c;u++){l=h[u];this.writeChildNode(l,i,o+1)}i.state=a.CloseTag;this.stream.write("]")}i.state=a.CloseTag;this.stream.write(i.spaceBeforeSlash+">");this.stream.write(this.endline(r,i,o));i.state=a.None;return this.closeNode(r,i,o)}element(r,o,l){var u,h,d,p,m,g,y,v,b,w,M,E,D,T,x,O;l||(l=0);this.openNode(r,o,l);o.state=a.OpenTag;M=this.indent(r,o,l)+"<"+r.name;if(o.pretty&&o.width>0){y=M.length;D=r.attribs;for(b in D){if(!c.call(D,b))continue;u=D[b];E=this.attribute(u,o,l);h=E.length;if(y+h>o.width){O=this.indent(r,o,l+1)+E;M+=this.endline(r,o,l)+O;y=O.length}else{O=" "+E;M+=O;y+=O.length}}}else{T=r.attribs;for(b in T){if(!c.call(T,b))continue;u=T[b];M+=this.attribute(u,o,l)}}this.stream.write(M);p=r.children.length;m=p===0?null:r.children[0];if(p===0||r.children.every((function(r){return(r.type===i.Text||r.type===i.Raw)&&r.value===""}))){if(o.allowEmpty){this.stream.write(">");o.state=a.CloseTag;this.stream.write("</"+r.name+">")}else{o.state=a.CloseTag;this.stream.write(o.spaceBeforeSlash+"/>")}}else if(o.pretty&&p===1&&(m.type===i.Text||m.type===i.Raw)&&m.value!=null){this.stream.write(">");o.state=a.InsideTag;o.suppressPrettyCount++;w=true;this.writeChildNode(m,o,l+1);o.suppressPrettyCount--;w=false;o.state=a.CloseTag;this.stream.write("</"+r.name+">")}else{this.stream.write(">"+this.endline(r,o,l));o.state=a.InsideTag;x=r.children;for(g=0,v=x.length;g<v;g++){d=x[g];this.writeChildNode(d,o,l+1)}o.state=a.CloseTag;this.stream.write(this.indent(r,o,l)+"</"+r.name+">")}this.stream.write(this.endline(r,o,l));o.state=a.None;return this.closeNode(r,o,l)}processingInstruction(r,i,o){return this.stream.write(super.processingInstruction(r,i,o))}raw(r,i,o){return this.stream.write(super.raw(r,i,o))}text(r,i,o){return this.stream.write(super.text(r,i,o))}dtdAttList(r,i,o){return this.stream.write(super.dtdAttList(r,i,o))}dtdElement(r,i,o){return this.stream.write(super.dtdElement(r,i,o))}dtdEntity(r,i,o){return this.stream.write(super.dtdEntity(r,i,o))}dtdNotation(r,i,o){return this.stream.write(super.dtdNotation(r,i,o))}}}).call(this)},7834:function(r,i,o){(function(){var i,a;a=o(6670);r.exports=i=class XMLStringWriter extends a{constructor(r){super(r)}document(r,i){var o,a,l,u,c;i=this.filterOptions(i);u="";c=r.children;for(a=0,l=c.length;a<l;a++){o=c[a];u+=this.writeChildNode(o,i,0)}if(i.pretty&&u.slice(-i.newline.length)===i.newline){u=u.slice(0,-i.newline.length)}return u}}}).call(this)},645:function(r){(function(){var i,o={}.hasOwnProperty;r.exports=i=function(){class XMLStringifier{constructor(r){var i,a,l;this.assertLegalChar=this.assertLegalChar.bind(this);this.assertLegalName=this.assertLegalName.bind(this);r||(r={});this.options=r;if(!this.options.version){this.options.version="1.0"}a=r.stringify||{};for(i in a){if(!o.call(a,i))continue;l=a[i];this[i]=l}}name(r){if(this.options.noValidation){return r}return this.assertLegalName(""+r||"")}text(r){if(this.options.noValidation){return r}return this.assertLegalChar(this.textEscape(""+r||""))}cdata(r){if(this.options.noValidation){return r}r=""+r||"";r=r.replace("]]>","]]]]><![CDATA[>");return this.assertLegalChar(r)}comment(r){if(this.options.noValidation){return r}r=""+r||"";if(r.match(/--/)){throw new Error("Comment text cannot contain double-hypen: "+r)}return this.assertLegalChar(r)}raw(r){if(this.options.noValidation){return r}return""+r||""}attValue(r){if(this.options.noValidation){return r}return this.assertLegalChar(this.attEscape(r=""+r||""))}insTarget(r){if(this.options.noValidation){return r}return this.assertLegalChar(""+r||"")}insValue(r){if(this.options.noValidation){return r}r=""+r||"";if(r.match(/\?>/)){throw new Error("Invalid processing instruction value: "+r)}return this.assertLegalChar(r)}xmlVersion(r){if(this.options.noValidation){return r}r=""+r||"";if(!r.match(/1\.[0-9]+/)){throw new Error("Invalid version number: "+r)}return r}xmlEncoding(r){if(this.options.noValidation){return r}r=""+r||"";if(!r.match(/^[A-Za-z](?:[A-Za-z0-9._-])*$/)){throw new Error("Invalid encoding: "+r)}return this.assertLegalChar(r)}xmlStandalone(r){if(this.options.noValidation){return r}if(r){return"yes"}else{return"no"}}dtdPubID(r){if(this.options.noValidation){return r}return this.assertLegalChar(""+r||"")}dtdSysID(r){if(this.options.noValidation){return r}return this.assertLegalChar(""+r||"")}dtdElementValue(r){if(this.options.noValidation){return r}return this.assertLegalChar(""+r||"")}dtdAttType(r){if(this.options.noValidation){return r}return this.assertLegalChar(""+r||"")}dtdAttDefault(r){if(this.options.noValidation){return r}return this.assertLegalChar(""+r||"")}dtdEntityValue(r){if(this.options.noValidation){return r}return this.assertLegalChar(""+r||"")}dtdNData(r){if(this.options.noValidation){return r}return this.assertLegalChar(""+r||"")}assertLegalChar(r){var i,o;if(this.options.noValidation){return r}i="";if(this.options.version==="1.0"){i=/[\0-\x08\x0B\f\x0E-\x1F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;if(o=r.match(i)){throw new Error(`Invalid character in string: ${r} at index ${o.index}`)}}else if(this.options.version==="1.1"){i=/[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;if(o=r.match(i)){throw new Error(`Invalid character in string: ${r} at index ${o.index}`)}}return r}assertLegalName(r){var i;if(this.options.noValidation){return r}this.assertLegalChar(r);i=/^([: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(!r.match(i)){throw new Error("Invalid character in name")}return r}textEscape(r){var i;if(this.options.noValidation){return r}i=this.options.noDoubleEncoding?/(?!&\S+;)&/g:/&/g;return r.replace(i,"&").replace(/</g,"<").replace(/>/g,">").replace(/\r/g,"
")}attEscape(r){var i;if(this.options.noValidation){return r}i=this.options.noDoubleEncoding?/(?!&\S+;)&/g:/&/g;return r.replace(i,"&").replace(/</g,"<").replace(/"/g,""").replace(/\t/g,"	").replace(/\n/g,"
").replace(/\r/g,"
")}}XMLStringifier.prototype.convertAttKey="@";XMLStringifier.prototype.convertPIKey="?";XMLStringifier.prototype.convertTextKey="#text";XMLStringifier.prototype.convertCDataKey="#cdata";XMLStringifier.prototype.convertCommentKey="#comment";XMLStringifier.prototype.convertRawKey="#raw";return XMLStringifier}.call(this)}).call(this)},2275:function(r,i,o){(function(){var i,a,l;i=o(7762);a=o(4765);r.exports=l=function(){class XMLText extends a{constructor(r,o){super(r);if(o==null){throw new Error("Missing element text. "+this.debugInfo())}this.name="#text";this.type=i.Text;this.value=this.stringify.text(o)}clone(){return Object.create(this)}toString(r){return this.options.writer.text(this,this.options.writer.filterOptions(r))}splitText(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}replaceWholeText(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}}Object.defineProperty(XMLText.prototype,"isElementContentWhitespace",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}});Object.defineProperty(XMLText.prototype,"wholeText",{get:function(){var r,i,o;o="";i=this.previousSibling;while(i){o=i.data+o;i=i.previousSibling}o+=this.data;r=this.nextSibling;while(r){o=o+r.data;r=r.nextSibling}return o}});return XMLText}.call(this)}).call(this)},6670:function(r,i,o){(function(){var i,a,l,u,c,h,d,p,m,g,y,v,b,w,M,E,D,T={}.hasOwnProperty;({assign:D}=o(983));i=o(7762);m=o(6645);g=o(8873);l=o(5261);u=o(360);v=o(6484);w=o(8732);M=o(2275);b=o(8947);y=o(706);c=o(2529);h=o(7486);d=o(9252);p=o(3353);a=o(140);r.exports=E=class XMLWriterBase{constructor(r){var i,o,a;r||(r={});this.options=r;o=r.writer||{};for(i in o){if(!T.call(o,i))continue;a=o[i];this["_"+i]=this[i];this[i]=a}}filterOptions(r){var i,o,l,u,c,h,d,p,m;r||(r={});r=D({},this.options,r);i={writer:this};i.pretty=r.pretty||false;i.allowEmpty=r.allowEmpty||false;i.indent=(o=r.indent)!=null?o:" ";i.newline=(l=r.newline)!=null?l:"\n";i.offset=(u=r.offset)!=null?u:0;i.width=(c=r.width)!=null?c:0;i.dontPrettyTextNodes=(h=(d=r.dontPrettyTextNodes)!=null?d:r.dontprettytextnodes)!=null?h:0;i.spaceBeforeSlash=(p=(m=r.spaceBeforeSlash)!=null?m:r.spacebeforeslash)!=null?p:"";if(i.spaceBeforeSlash===true){i.spaceBeforeSlash=" "}i.suppressPrettyCount=0;i.user={};i.state=a.None;return i}indent(r,i,o){var a;if(!i.pretty||i.suppressPrettyCount){return""}else if(i.pretty){a=(o||0)+i.offset+1;if(a>0){return new Array(a).join(i.indent)}}return""}endline(r,i,o){if(!i.pretty||i.suppressPrettyCount){return""}else{return i.newline}}attribute(r,i,o){var a;this.openAttribute(r,i,o);if(i.pretty&&i.width>0){a=r.name+'="'+r.value+'"'}else{a=" "+r.name+'="'+r.value+'"'}this.closeAttribute(r,i,o);return a}cdata(r,i,o){var l;this.openNode(r,i,o);i.state=a.OpenTag;l=this.indent(r,i,o)+"<![CDATA[";i.state=a.InsideTag;l+=r.value;i.state=a.CloseTag;l+="]]>"+this.endline(r,i,o);i.state=a.None;this.closeNode(r,i,o);return l}comment(r,i,o){var l;this.openNode(r,i,o);i.state=a.OpenTag;l=this.indent(r,i,o)+"\x3c!-- ";i.state=a.InsideTag;l+=r.value;i.state=a.CloseTag;l+=" --\x3e"+this.endline(r,i,o);i.state=a.None;this.closeNode(r,i,o);return l}declaration(r,i,o){var l;this.openNode(r,i,o);i.state=a.OpenTag;l=this.indent(r,i,o)+"<?xml";i.state=a.InsideTag;l+=' version="'+r.version+'"';if(r.encoding!=null){l+=' encoding="'+r.encoding+'"'}if(r.standalone!=null){l+=' standalone="'+r.standalone+'"'}i.state=a.CloseTag;l+=i.spaceBeforeSlash+"?>";l+=this.endline(r,i,o);i.state=a.None;this.closeNode(r,i,o);return l}docType(r,i,o){var l,u,c,h,d;o||(o=0);this.openNode(r,i,o);i.state=a.OpenTag;h=this.indent(r,i,o);h+="<!DOCTYPE "+r.root().name;if(r.pubID&&r.sysID){h+=' PUBLIC "'+r.pubID+'" "'+r.sysID+'"'}else if(r.sysID){h+=' SYSTEM "'+r.sysID+'"'}if(r.children.length>0){h+=" [";h+=this.endline(r,i,o);i.state=a.InsideTag;d=r.children;for(u=0,c=d.length;u<c;u++){l=d[u];h+=this.writeChildNode(l,i,o+1)}i.state=a.CloseTag;h+="]"}i.state=a.CloseTag;h+=i.spaceBeforeSlash+">";h+=this.endline(r,i,o);i.state=a.None;this.closeNode(r,i,o);return h}element(r,o,l){var u,c,h,d,p,m,g,y,v,b,w,M,E,D,x,O,N,_,A;l||(l=0);M=false;this.openNode(r,o,l);o.state=a.OpenTag;E=this.indent(r,o,l)+"<"+r.name;if(o.pretty&&o.width>0){y=E.length;x=r.attribs;for(w in x){if(!T.call(x,w))continue;u=x[w];D=this.attribute(u,o,l);c=D.length;if(y+c>o.width){A=this.indent(r,o,l+1)+D;E+=this.endline(r,o,l)+A;y=A.length}else{A=" "+D;E+=A;y+=A.length}}}else{O=r.attribs;for(w in O){if(!T.call(O,w))continue;u=O[w];E+=this.attribute(u,o,l)}}d=r.children.length;p=d===0?null:r.children[0];if(d===0||r.children.every((function(r){return(r.type===i.Text||r.type===i.Raw)&&r.value===""}))){if(o.allowEmpty){E+=">";o.state=a.CloseTag;E+="</"+r.name+">"+this.endline(r,o,l)}else{o.state=a.CloseTag;E+=o.spaceBeforeSlash+"/>"+this.endline(r,o,l)}}else if(o.pretty&&d===1&&(p.type===i.Text||p.type===i.Raw)&&p.value!=null){E+=">";o.state=a.InsideTag;o.suppressPrettyCount++;M=true;E+=this.writeChildNode(p,o,l+1);o.suppressPrettyCount--;M=false;o.state=a.CloseTag;E+="</"+r.name+">"+this.endline(r,o,l)}else{if(o.dontPrettyTextNodes){N=r.children;for(m=0,v=N.length;m<v;m++){h=N[m];if((h.type===i.Text||h.type===i.Raw)&&h.value!=null){o.suppressPrettyCount++;M=true;break}}}E+=">"+this.endline(r,o,l);o.state=a.InsideTag;_=r.children;for(g=0,b=_.length;g<b;g++){h=_[g];E+=this.writeChildNode(h,o,l+1)}o.state=a.CloseTag;E+=this.indent(r,o,l)+"</"+r.name+">";if(M){o.suppressPrettyCount--}E+=this.endline(r,o,l);o.state=a.None}this.closeNode(r,o,l);return E}writeChildNode(r,o,a){switch(r.type){case i.CData:return this.cdata(r,o,a);case i.Comment:return this.comment(r,o,a);case i.Element:return this.element(r,o,a);case i.Raw:return this.raw(r,o,a);case i.Text:return this.text(r,o,a);case i.ProcessingInstruction:return this.processingInstruction(r,o,a);case i.Dummy:return"";case i.Declaration:return this.declaration(r,o,a);case i.DocType:return this.docType(r,o,a);case i.AttributeDeclaration:return this.dtdAttList(r,o,a);case i.ElementDeclaration:return this.dtdElement(r,o,a);case i.EntityDeclaration:return this.dtdEntity(r,o,a);case i.NotationDeclaration:return this.dtdNotation(r,o,a);default:throw new Error("Unknown XML node type: "+r.constructor.name)}}processingInstruction(r,i,o){var l;this.openNode(r,i,o);i.state=a.OpenTag;l=this.indent(r,i,o)+"<?";i.state=a.InsideTag;l+=r.target;if(r.value){l+=" "+r.value}i.state=a.CloseTag;l+=i.spaceBeforeSlash+"?>";l+=this.endline(r,i,o);i.state=a.None;this.closeNode(r,i,o);return l}raw(r,i,o){var l;this.openNode(r,i,o);i.state=a.OpenTag;l=this.indent(r,i,o);i.state=a.InsideTag;l+=r.value;i.state=a.CloseTag;l+=this.endline(r,i,o);i.state=a.None;this.closeNode(r,i,o);return l}text(r,i,o){var l;this.openNode(r,i,o);i.state=a.OpenTag;l=this.indent(r,i,o);i.state=a.InsideTag;l+=r.value;i.state=a.CloseTag;l+=this.endline(r,i,o);i.state=a.None;this.closeNode(r,i,o);return l}dtdAttList(r,i,o){var l;this.openNode(r,i,o);i.state=a.OpenTag;l=this.indent(r,i,o)+"<!ATTLIST";i.state=a.InsideTag;l+=" "+r.elementName+" "+r.attributeName+" "+r.attributeType;if(r.defaultValueType!=="#DEFAULT"){l+=" "+r.defaultValueType}if(r.defaultValue){l+=' "'+r.defaultValue+'"'}i.state=a.CloseTag;l+=i.spaceBeforeSlash+">"+this.endline(r,i,o);i.state=a.None;this.closeNode(r,i,o);return l}dtdElement(r,i,o){var l;this.openNode(r,i,o);i.state=a.OpenTag;l=this.indent(r,i,o)+"<!ELEMENT";i.state=a.InsideTag;l+=" "+r.name+" "+r.value;i.state=a.CloseTag;l+=i.spaceBeforeSlash+">"+this.endline(r,i,o);i.state=a.None;this.closeNode(r,i,o);return l}dtdEntity(r,i,o){var l;this.openNode(r,i,o);i.state=a.OpenTag;l=this.indent(r,i,o)+"<!ENTITY";i.state=a.InsideTag;if(r.pe){l+=" %"}l+=" "+r.name;if(r.value){l+=' "'+r.value+'"'}else{if(r.pubID&&r.sysID){l+=' PUBLIC "'+r.pubID+'" "'+r.sysID+'"'}else if(r.sysID){l+=' SYSTEM "'+r.sysID+'"'}if(r.nData){l+=" NDATA "+r.nData}}i.state=a.CloseTag;l+=i.spaceBeforeSlash+">"+this.endline(r,i,o);i.state=a.None;this.closeNode(r,i,o);return l}dtdNotation(r,i,o){var l;this.openNode(r,i,o);i.state=a.OpenTag;l=this.indent(r,i,o)+"<!NOTATION";i.state=a.InsideTag;l+=" "+r.name;if(r.pubID&&r.sysID){l+=' PUBLIC "'+r.pubID+'" "'+r.sysID+'"'}else if(r.pubID){l+=' PUBLIC "'+r.pubID+'"'}else if(r.sysID){l+=' SYSTEM "'+r.sysID+'"'}i.state=a.CloseTag;l+=i.spaceBeforeSlash+">"+this.endline(r,i,o);i.state=a.None;this.closeNode(r,i,o);return l}openNode(r,i,o){}closeNode(r,i,o){}openAttribute(r,i,o){}closeAttribute(r,i,o){}}}).call(this)},5769:function(r,i,o){(function(){var i,a,l,u,c,h,d,p,m;({assign:p,isFunction:m}=o(983));l=o(2692);u=o(1582);c=o(2871);d=o(7834);h=o(5922);i=o(7762);a=o(140);r.exports.create=function(r,i,o,a){var l,c;if(r==null){throw new Error("Root element needs a name.")}a=p({},i,o,a);l=new u(a);c=l.element(r);if(!a.headless){l.declaration(a);if(a.pubID!=null||a.sysID!=null){l.dtd(a)}}return c};r.exports.begin=function(r,i,o){if(m(r)){[i,o]=[r,i];r={}}if(i){return new c(r,i,o)}else{return new u(r)}};r.exports.stringWriter=function(r){return new d(r)};r.exports.streamWriter=function(r,i){return new h(r,i)};r.exports.implementation=new l;r.exports.nodeType=i;r.exports.writerState=a}).call(this)},4513:(r,i,o)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.addMetaDataItemToMainApplication=addMetaDataItemToMainApplication;i.addUsesLibraryItemToMainApplication=addUsesLibraryItemToMainApplication;i.ensureToolsAvailable=ensureToolsAvailable;i.findMetaDataItem=findMetaDataItem;i.findUsesLibraryItem=findUsesLibraryItem;i.getMainActivity=getMainActivity;i.getMainActivityOrThrow=getMainActivityOrThrow;i.getMainApplication=getMainApplication;i.getMainApplicationMetaDataValue=getMainApplicationMetaDataValue;i.getMainApplicationOrThrow=getMainApplicationOrThrow;i.getRunnableActivity=getRunnableActivity;i.prefixAndroidKeys=prefixAndroidKeys;i.readAndroidManifestAsync=readAndroidManifestAsync;i.removeMetaDataItemFromMainApplication=removeMetaDataItemFromMainApplication;i.removeUsesLibraryItemFromMainApplication=removeUsesLibraryItemFromMainApplication;i.writeAndroidManifestAsync=writeAndroidManifestAsync;function _assert(){const r=_interopRequireDefault(o(9491));_assert=function(){return r};return r}function _fs(){const r=_interopRequireDefault(o(7147));_fs=function(){return r};return r}function _path(){const r=_interopRequireDefault(o(1017));_path=function(){return r};return r}function XML(){const r=_interopRequireWildcard(o(8853));XML=function(){return r};return r}function _getRequireWildcardCache(r){if("function"!=typeof WeakMap)return null;var i=new WeakMap,o=new WeakMap;return(_getRequireWildcardCache=function(r){return r?o:i})(r)}function _interopRequireWildcard(r,i){if(!i&&r&&r.__esModule)return r;if(null===r||"object"!=typeof r&&"function"!=typeof r)return{default:r};var o=_getRequireWildcardCache(i);if(o&&o.has(r))return o.get(r);var a={__proto__:null},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in r)if("default"!==u&&Object.prototype.hasOwnProperty.call(r,u)){var c=l?Object.getOwnPropertyDescriptor(r,u):null;c&&(c.get||c.set)?Object.defineProperty(a,u,c):a[u]=r[u]}return a.default=r,o&&o.set(r,a),a}function _interopRequireDefault(r){return r&&r.__esModule?r:{default:r}}async function writeAndroidManifestAsync(r,i){const o=XML().format(i);await _fs().default.promises.mkdir(_path().default.dirname(r),{recursive:true});await _fs().default.promises.writeFile(r,o)}async function readAndroidManifestAsync(r){const i=await XML().readXMLAsync({path:r});if(!isManifest(i)){throw new Error("Invalid manifest found at: "+r)}return i}function isManifest(r){return!!r.manifest}function getMainApplication(r){return r?.manifest?.application?.filter((r=>r?.$?.["android:name"].endsWith(".MainApplication")))[0]??null}function getMainApplicationOrThrow(r){const i=getMainApplication(r);(0,_assert().default)(i,"AndroidManifest.xml is missing the required MainApplication element");return i}function getMainActivityOrThrow(r){const i=getMainActivity(r);(0,_assert().default)(i,"AndroidManifest.xml is missing the required MainActivity element");return i}function getRunnableActivity(r){const i=r?.manifest?.application?.[0]?.activity?.filter?.((r=>r.$["android:enabled"]!=="false"&&r.$["android:enabled"]!==false));if(!i){return null}for(const r of i){if(Array.isArray(r["intent-filter"])){for(const i of r["intent-filter"]){if(i.action?.find((r=>r.$["android:name"]==="android.intent.action.MAIN"))&&i.category?.find((r=>r.$["android:name"]==="android.intent.category.LAUNCHER"))){return r}}}}return null}function getMainActivity(r){const i=r?.manifest?.application?.[0]?.activity?.filter?.((r=>r.$["android:name"]===".MainActivity"));return i?.[0]??null}function addMetaDataItemToMainApplication(r,i,o,a="value"){let l;const u={$:prefixAndroidKeys({name:i,[a]:o})};if(r["meta-data"]){l=r["meta-data"].filter((r=>r.$["android:name"]===i));if(l.length){l[0].$[`android:${a}`]=o}else{r["meta-data"].push(u)}}else{r["meta-data"]=[u]}return r}function removeMetaDataItemFromMainApplication(r,i){const o=findMetaDataItem(r,i);if(r?.["meta-data"]&&o>-1){r["meta-data"].splice(o,1)}return r}function findApplicationSubItem(r,i,o){const a=r[i];if(Array.isArray(a)){const r=a.findIndex((r=>r.$["android:name"]===o));return r}return-1}function findMetaDataItem(r,i){return findApplicationSubItem(r,"meta-data",i)}function findUsesLibraryItem(r,i){return findApplicationSubItem(r,"uses-library",i)}function getMainApplicationMetaDataValue(r,i){const o=getMainApplication(r);if(o?.hasOwnProperty("meta-data")){const r=o?.["meta-data"]?.find((r=>r.$["android:name"]===i));return r?.$["android:value"]??null}return null}function addUsesLibraryItemToMainApplication(r,i){let o;const a={$:prefixAndroidKeys(i)};if(r["uses-library"]){o=r["uses-library"].filter((r=>r.$["android:name"]===i.name));if(o.length){o[0].$=a.$}else{r["uses-library"].push(a)}}else{r["uses-library"]=[a]}return r}function removeUsesLibraryItemFromMainApplication(r,i){const o=findUsesLibraryItem(r,i);if(r?.["uses-library"]&&o>-1){r["uses-library"].splice(o,1)}return r}function prefixAndroidKeys(r){return Object.entries(r).reduce(((r,[i,o])=>({...r,[`android:${i}`]:o})),{})}function ensureToolsAvailable(r){return ensureManifestHasNamespace(r,{namespace:"xmlns:tools",url:"http://schemas.android.com/tools"})}function ensureManifestHasNamespace(r,{namespace:i,url:o}){if(r?.manifest?.$?.[i]){return r}r.manifest.$[i]=o;return r}},365:(r,i,o)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.appendScheme=appendScheme;i.ensureManifestHasValidIntentFilter=ensureManifestHasValidIntentFilter;i.getScheme=getScheme;i.getSchemesFromManifest=getSchemesFromManifest;i.hasScheme=hasScheme;i.removeScheme=removeScheme;i.setScheme=setScheme;i.withScheme=void 0;function _androidPlugins(){const r=o(2636);_androidPlugins=function(){return r};return r}function _warnings(){const r=o(128);_warnings=function(){return r};return r}const a=i.withScheme=(0,_androidPlugins().createAndroidManifestPlugin)(setScheme,"withScheme");function getScheme(r){if(Array.isArray(r.scheme)){const validate=r=>typeof r==="string";return r.scheme.filter(validate)}else if(typeof r.scheme==="string"){return[r.scheme]}return[]}function setScheme(r,i){const o=[...getScheme(r),...getScheme(r.android??{})];if(r.android?.package){o.push(r.android.package)}if(o.length===0){return i}if(!ensureManifestHasValidIntentFilter(i)){(0,_warnings().addWarningAndroid)("scheme",`Cannot add schemes because the provided manifest does not have a valid Activity with \`android:launchMode="singleTask"\``,"https://expo.fyi/setup-android-uri-scheme");return i}const a=getSchemesFromManifest(i);for(const r of a){const i=o.indexOf(r);if(i>-1)o.splice(i,1)}for(const r of o){i=appendScheme(r,i)}return i}function isValidRedirectIntentFilter({actions:r,categories:i}){return r.includes("android.intent.action.VIEW")&&!i.includes("android.intent.category.LAUNCHER")}function propertiesFromIntentFilter(r){const i=r?.action?.map((r=>r?.$?.["android:name"]))??[];const o=r?.category?.map((r=>r?.$?.["android:name"]))??[];const a=r?.data?.filter((r=>r?.$?.["android:scheme"]))?.map((r=>({scheme:r?.$?.["android:scheme"],host:r?.$?.["android:host"]})))??[];return{actions:i,categories:o,data:a}}function getSingleTaskIntentFilters(r){if(!Array.isArray(r.manifest.application))return[];let i=[];for(const o of r.manifest.application){const{activity:r}=o;const a=Array.isArray(r)?r:[r];const l=a.filter((r=>r?.$?.["android:launchMode"]==="singleTask"));for(const r of l){const o=r["intent-filter"];i=i.concat(o)}}return i}function getSchemesFromManifest(r,i=null){const o=[];const a=getSingleTaskIntentFilters(r);for(const r of a){const a=propertiesFromIntentFilter(r);if(isValidRedirectIntentFilter(a)&&a.data){for(const{scheme:r,host:l}of a.data){if(i===null||!l||l===i){o.push(r)}}}}return o}function ensureManifestHasValidIntentFilter(r){if(!Array.isArray(r.manifest.application)){return false}for(const i of r.manifest.application){for(const r of i.activity||[]){if(r?.$?.["android:launchMode"]==="singleTask"){for(const i of r["intent-filter"]||[]){const r=propertiesFromIntentFilter(i);if(isValidRedirectIntentFilter(r)){return true}}if(!r["intent-filter"]){r["intent-filter"]=[]}r["intent-filter"].push({action:[{$:{"android:name":"android.intent.action.VIEW"}}],category:[{$:{"android:name":"android.intent.category.DEFAULT"}},{$:{"android:name":"android.intent.category.BROWSABLE"}}]});return true}}}return false}function hasScheme(r,i){const o=getSchemesFromManifest(i);return o.includes(r)}function appendScheme(r,i){if(!Array.isArray(i.manifest.application)){return i}for(const o of i.manifest.application){for(const i of o.activity||[]){if(i?.$?.["android:launchMode"]==="singleTask"){for(const o of i["intent-filter"]||[]){const i=propertiesFromIntentFilter(o);if(isValidRedirectIntentFilter(i)){if(!o.data)o.data=[];o.data.push({$:{"android:scheme":r}})}}break}}}return i}function removeScheme(r,i){if(!Array.isArray(i.manifest.application)){return i}for(const o of i.manifest.application){for(const i of o.activity||[]){if(i?.$?.["android:launchMode"]==="singleTask"){for(const o of i["intent-filter"]||[]){const i=propertiesFromIntentFilter(o);if(isValidRedirectIntentFilter(i)){for(const i in o?.data||[]){const a=o.data?.[i];if(a?.$?.["android:scheme"]===r){delete o.data?.[i]}}}}break}}}return i}},7903:(r,i,o)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.appendScheme=appendScheme;i.getScheme=getScheme;i.getSchemesFromPlist=getSchemesFromPlist;i.hasScheme=hasScheme;i.removeScheme=removeScheme;i.setScheme=setScheme;i.withScheme=void 0;function _iosPlugins(){const r=o(4797);_iosPlugins=function(){return r};return r}const a=i.withScheme=(0,_iosPlugins().createInfoPlistPluginWithPropertyGuard)(setScheme,{infoPlistProperty:"CFBundleURLTypes",expoConfigProperty:"scheme"},"withScheme");function getScheme(r){if(Array.isArray(r.scheme)){const validate=r=>typeof r==="string";return r.scheme.filter(validate)}else if(typeof r.scheme==="string"){return[r.scheme]}return[]}function setScheme(r,i){const o=[...getScheme(r),...getScheme(r.ios??{})];if(r.ios?.bundleIdentifier){o.push(r.ios.bundleIdentifier)}if(o.length===0){return i}return{...i,CFBundleURLTypes:[{CFBundleURLSchemes:o}]}}function appendScheme(r,i){if(!r){return i}const o=i.CFBundleURLTypes??[];if(o?.some((({CFBundleURLSchemes:i})=>i.includes(r)))){return i}return{...i,CFBundleURLTypes:[...o,{CFBundleURLSchemes:[r]}]}}function removeScheme(r,i){if(!r){return i}if(!i.CFBundleURLTypes){return i}i.CFBundleURLTypes=i.CFBundleURLTypes.map((i=>{const o=i.CFBundleURLSchemes.indexOf(r);if(o>-1){i.CFBundleURLSchemes.splice(o,1);if(i.CFBundleURLSchemes.length===0){return undefined}}return i})).filter(Boolean);return i}function hasScheme(r,i){const o=i.CFBundleURLTypes;if(!Array.isArray(o))return false;return o?.some((({CFBundleURLSchemes:i})=>Array.isArray(i)?i.includes(r):false))}function getSchemesFromPlist(r){if(Array.isArray(r.CFBundleURLTypes)){return r.CFBundleURLTypes.reduce(((r,{CFBundleURLSchemes:i})=>{if(Array.isArray(i)){return[...r,...i]}return r}),[])}return[]}},2636:(r,i,o)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.createAndroidManifestPlugin=createAndroidManifestPlugin;i.createStringsXmlPlugin=createStringsXmlPlugin;i.withStringsXml=i.withSettingsGradle=i.withProjectBuildGradle=i.withMainApplication=i.withMainActivity=i.withGradleProperties=i.withAppBuildGradle=i.withAndroidStyles=i.withAndroidManifest=i.withAndroidColorsNight=i.withAndroidColors=void 0;function _withMod(){const r=o(2932);_withMod=function(){return r};return r}function createAndroidManifestPlugin(r,i){const withUnknown=i=>withAndroidManifest(i,(async i=>{i.modResults=await r(i,i.modResults);return i}));if(i){Object.defineProperty(withUnknown,"name",{value:i})}return withUnknown}function createStringsXmlPlugin(r,i){const withUnknown=i=>withStringsXml(i,(async i=>{i.modResults=await r(i,i.modResults);return i}));if(i){Object.defineProperty(withUnknown,"name",{value:i})}return withUnknown}const withAndroidManifest=(r,i)=>(0,_withMod().withMod)(r,{platform:"android",mod:"manifest",action:i});i.withAndroidManifest=withAndroidManifest;const withStringsXml=(r,i)=>(0,_withMod().withMod)(r,{platform:"android",mod:"strings",action:i});i.withStringsXml=withStringsXml;const withAndroidColors=(r,i)=>(0,_withMod().withMod)(r,{platform:"android",mod:"colors",action:i});i.withAndroidColors=withAndroidColors;const withAndroidColorsNight=(r,i)=>(0,_withMod().withMod)(r,{platform:"android",mod:"colorsNight",action:i});i.withAndroidColorsNight=withAndroidColorsNight;const withAndroidStyles=(r,i)=>(0,_withMod().withMod)(r,{platform:"android",mod:"styles",action:i});i.withAndroidStyles=withAndroidStyles;const withMainActivity=(r,i)=>(0,_withMod().withMod)(r,{platform:"android",mod:"mainActivity",action:i});i.withMainActivity=withMainActivity;const withMainApplication=(r,i)=>(0,_withMod().withMod)(r,{platform:"android",mod:"mainApplication",action:i});i.withMainApplication=withMainApplication;const withProjectBuildGradle=(r,i)=>(0,_withMod().withMod)(r,{platform:"android",mod:"projectBuildGradle",action:i});i.withProjectBuildGradle=withProjectBuildGradle;const withAppBuildGradle=(r,i)=>(0,_withMod().withMod)(r,{platform:"android",mod:"appBuildGradle",action:i});i.withAppBuildGradle=withAppBuildGradle;const withSettingsGradle=(r,i)=>(0,_withMod().withMod)(r,{platform:"android",mod:"settingsGradle",action:i});i.withSettingsGradle=withSettingsGradle;const withGradleProperties=(r,i)=>(0,_withMod().withMod)(r,{platform:"android",mod:"gradleProperties",action:i});i.withGradleProperties=withGradleProperties},4797:(r,i,o)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.createEntitlementsPlugin=createEntitlementsPlugin;i.createInfoPlistPlugin=createInfoPlistPlugin;i.createInfoPlistPluginWithPropertyGuard=createInfoPlistPluginWithPropertyGuard;i.withXcodeProject=i.withPodfileProperties=i.withPodfile=i.withInfoPlist=i.withExpoPlist=i.withEntitlementsPlist=i.withAppDelegate=void 0;function _withMod(){const r=o(2932);_withMod=function(){return r};return r}function _obj(){const r=o(7324);_obj=function(){return r};return r}function _warnings(){const r=o(128);_warnings=function(){return r};return r}function createInfoPlistPlugin(r,i){const withUnknown=i=>withInfoPlist(i,(async i=>{i.modResults=await r(i,i.modResults);return i}));if(i){Object.defineProperty(withUnknown,"name",{value:i})}return withUnknown}function createInfoPlistPluginWithPropertyGuard(r,i,o){const withUnknown=o=>withInfoPlist(o,(async o=>{const a=i.expoPropertyGetter?i.expoPropertyGetter(o):(0,_obj().get)(o,i.expoConfigProperty);if(o.modRawConfig.ios?.infoPlist?.[i.infoPlistProperty]===undefined){o.modResults=await r(o,o.modResults)}else if(a!==undefined){(0,_warnings().addWarningIOS)(i.expoConfigProperty,`"ios.infoPlist.${i.infoPlistProperty}" is set in the config. Ignoring abstract property "${i.expoConfigProperty}": ${a}`)}return o}));if(o){Object.defineProperty(withUnknown,"name",{value:o})}return withUnknown}function createEntitlementsPlugin(r,i){const withUnknown=i=>withEntitlementsPlist(i,(async i=>{i.modResults=await r(i,i.modResults);return i}));if(i){Object.defineProperty(withUnknown,"name",{value:i})}return withUnknown}const withAppDelegate=(r,i)=>(0,_withMod().withMod)(r,{platform:"ios",mod:"appDelegate",action:i});i.withAppDelegate=withAppDelegate;const withInfoPlist=(r,i)=>(0,_withMod().withMod)(r,{platform:"ios",mod:"infoPlist",async action(r){r=await i(r);if(!r.ios){r.ios={}}r.ios.infoPlist=r.modResults;return r}});i.withInfoPlist=withInfoPlist;const withEntitlementsPlist=(r,i)=>(0,_withMod().withMod)(r,{platform:"ios",mod:"entitlements",async action(r){r=await i(r);if(!r.ios){r.ios={}}r.ios.entitlements=r.modResults;return r}});i.withEntitlementsPlist=withEntitlementsPlist;const withExpoPlist=(r,i)=>(0,_withMod().withMod)(r,{platform:"ios",mod:"expoPlist",action:i});i.withExpoPlist=withExpoPlist;const withXcodeProject=(r,i)=>(0,_withMod().withMod)(r,{platform:"ios",mod:"xcodeproj",action:i});i.withXcodeProject=withXcodeProject;const withPodfile=(r,i)=>(0,_withMod().withMod)(r,{platform:"ios",mod:"podfile",action:i});i.withPodfile=withPodfile;const withPodfileProperties=(r,i)=>(0,_withMod().withMod)(r,{platform:"ios",mod:"podfileProperties",action:i});i.withPodfileProperties=withPodfileProperties},2932:(r,i,o)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.withBaseMod=withBaseMod;i.withMod=withMod;function _chalk(){const r=_interopRequireDefault(o(8746));_chalk=function(){return r};return r}function _getenv(){const r=o(7945);_getenv=function(){return r};return r}function _errors(){const r=o(3857);_errors=function(){return r};return r}function _interopRequireDefault(r){return r&&r.__esModule?r:{default:r}}const a=(0,_getenv().boolish)("EXPO_DEBUG",false);function withBaseMod(r,{platform:i,mod:o,action:l,skipEmptyMod:u,isProvider:c,isIntrospective:h,saveToInternal:d}){if(!r.mods){r.mods={}}if(!r.mods[i]){r.mods[i]={}}let p=r.mods[i][o];if(!p){if(u){return r}const noopMod=r=>r;p=noopMod}let m="";const g=r._internal?.isDebug??a;if(g){const r=(new Error).stack;m=getDebugPluginStackFromStackTrace(r);const a=_chalk().default.bold(`${i}.${o}`);m=`${a}: ${m}`}if(p.isProvider){if(c){throw new(_errors().PluginError)(`Cannot set provider mod for "${i}.${o}" because another is already being used.`,"CONFLICTING_PROVIDER")}else{throw new(_errors().PluginError)(`Cannot add mod to "${i}.${o}" because the provider has already been added. Provider must be the last mod added.`,"INVALID_MOD_ORDER")}}async function interceptingMod({modRequest:r,...a}){if(g){console.log(m)}const u=await l({...a,modRequest:{...r,nextMod:p}});if(d){saveToInternalObject(u,i,o,u.modResults)}return u}interceptingMod.isProvider=c;if(h){interceptingMod.isIntrospective=h}r.mods[i][o]=interceptingMod;return r}function saveToInternalObject(r,i,o,a){if(!r._internal)r._internal={};if(!r._internal.modResults)r._internal.modResults={};if(!r._internal.modResults[i])r._internal.modResults[i]={};r._internal.modResults[i][o]=a}function getDebugPluginStackFromStackTrace(r){if(!r){return""}const i=[];for(const o of r.split("\n")){const[r,a]=o.trim().split(" ");if(r==="at"){i.push(a)}}const o=i.map((r=>r?.match(/^(\bwith[A-Z].*?\b)/)?.[1]?.trim()??r?.match(/\.(\bwith[A-Z].*?\b)/)?.[1]?.trim()??null)).filter(Boolean).filter((r=>!["withMod","withBaseMod","withExtendedMod"].includes(r)));const a=["withPlugins","withRunOnce","withStaticPlugin"];return o.reverse().map(((r,i)=>{if(r.includes("BaseMod")){r=_chalk().default.bold(r)}if(r.toLowerCase().includes("dangerous")){r=_chalk().default.red(r)}if(i===0){return _chalk().default.blue(r)}else if(a.includes(r)){return _chalk().default.dim(r)}return r})).join(" ➜ ")}function withMod(r,{platform:i,mod:o,action:a}){return withBaseMod(r,{platform:i,mod:o,isProvider:false,async action({modRequest:{nextMod:r,...i},modResults:o,...l}){const u=await a({modRequest:i,modResults:o,...l});return r(u)}})}},8853:(r,i,o)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i._processAndroidXML=_processAndroidXML;i.escapeAndroidString=escapeAndroidString;i.format=format;i.parseXMLAsync=parseXMLAsync;i.readXMLAsync=readXMLAsync;i.unescapeAndroidString=unescapeAndroidString;i.writeXMLAsync=writeXMLAsync;function _fs(){const r=_interopRequireDefault(o(7147));_fs=function(){return r};return r}function _os(){const r=o(2037);_os=function(){return r};return r}function _path(){const r=_interopRequireDefault(o(1017));_path=function(){return r};return r}function _xml2js(){const r=o(7013);_xml2js=function(){return r};return r}function _interopRequireDefault(r){return r&&r.__esModule?r:{default:r}}async function writeXMLAsync(r){const i=format(r.xml);await _fs().default.promises.mkdir(_path().default.dirname(r.path),{recursive:true});await _fs().default.promises.writeFile(r.path,i)}async function readXMLAsync(r){let i="";try{i=await _fs().default.promises.readFile(r.path,{encoding:"utf8",flag:"r"})}catch{}const o=new(_xml2js().Parser);const a=await o.parseStringPromise(i||r.fallback||"");return _processAndroidXML(a)}function _processAndroidXML(r){if(Array.isArray(r?.resources?.string)){for(const i of r?.resources?.string){if(i.$.translatable==="false"||i.$.translatable===false){continue}i._=unescapeAndroidString(i._)}}return r}async function parseXMLAsync(r){const i=await(new(_xml2js().Parser)).parseStringPromise(r);return i}const stringTimesN=(r,i)=>Array(r+1).join(i);function format(r,{indentLevel:i=2,newline:o=_os().EOL}={}){let a;if(typeof r==="string"){a=r}else if(r.toString){const i=new(_xml2js().Builder)({headless:true});if(Array.isArray(r?.resources?.string)){for(const i of r?.resources?.string){if(i.$.translatable==="false"||i.$.translatable===false){continue}i._=escapeAndroidString(i._)}}a=i.buildObject(r);return a}else{throw new Error(`Invalid XML value passed in: ${r}`)}const l=stringTimesN(i," ");let u="";const c=/(>)(<)(\/*)/g;const h=a.replace(c,`$1${o}$2$3`);let d=0;h.split(/\r?\n/).map((r=>r.trim())).forEach((r=>{let i=0;if(r.match(/.+<\/\w[^>]*>$/)){i=0}else if(r.match(/^<\/\w/)){if(d!==0){d-=1}}else if(r.match(/^<\w([^>]*[^/])?>.*$/)){i=1}else{i=0}const a=stringTimesN(d,l);u+=a+r+o;d+=i}));return u.trim()}function escapeAndroidString(r){r=r.replace(/[\n\r\t'"@]/g,(r=>{switch(r){case'"':case"'":case"@":return"\\"+r;case"\n":return"\\n";case"\r":return"\\r";case"\t":return"\\t";default:throw new Error(`Cannot escape unhandled XML character: ${r}`)}}));if(r.match(/(^\s|\s$)/)){r='"'+r+'"'}return r}function unescapeAndroidString(r){return r.replace(/\\(.)/g,"$1")}},3857:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.UnexpectedError=i.PluginError=void 0;class UnexpectedError extends Error{name="UnexpectedError";constructor(r){super(`${r}\nPlease report this as an issue on https://github.com/expo/expo/issues`)}}i.UnexpectedError=UnexpectedError;class PluginError extends Error{name="PluginError";isPluginError=true;constructor(r,i,o){super(o?`${r}\n└─ Cause: ${o.name}: ${o.message}`:r);this.code=i;this.cause=o}}i.PluginError=PluginError},7324:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.get=get;function get(r,i){const o=i.split(".");let a=r;let l;while(l=o.shift()){if(!(l in a)){return undefined}a=a[l]}return a}},128:(r,i,o)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.addWarningAndroid=addWarningAndroid;i.addWarningForPlatform=addWarningForPlatform;i.addWarningIOS=addWarningIOS;function _chalk(){const r=_interopRequireDefault(o(8746));_chalk=function(){return r};return r}function _interopRequireDefault(r){return r&&r.__esModule?r:{default:r}}function addWarningAndroid(r,i,o){console.warn(formatWarning("android",r,i,o))}function addWarningIOS(r,i,o){console.warn(formatWarning("ios",r,i,o))}function addWarningForPlatform(r,i,o,a){console.warn(formatWarning(r,i,o,a))}function formatWarning(r,i,o,a){return _chalk().default.yellow`${"» "+_chalk().default.bold(r)}: ${i}: ${o}${a?_chalk().default.gray(" "+a):""}`}},2395:function(r,i,o){"use strict";var a=this&&this.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(i,"__esModule",{value:true});i.build=void 0;const l=a(o(2991));const u=a(o(5769));function ISODateString(r){function pad(r){return r<10?"0"+r:r}return r.getUTCFullYear()+"-"+pad(r.getUTCMonth()+1)+"-"+pad(r.getUTCDate())+"T"+pad(r.getUTCHours())+":"+pad(r.getUTCMinutes())+":"+pad(r.getUTCSeconds())+"Z"}const c=Object.prototype.toString;function type(r){const i=c.call(r).match(/\[object (.*)\]/);return i?i[1]:i}function build(r,i){const o={version:"1.0",encoding:"UTF-8"};const a={pubid:"-//Apple//DTD PLIST 1.0//EN",sysid:"http://www.apple.com/DTDs/PropertyList-1.0.dtd"};const l=u.default.create("plist");l.dec(o.version,o.encoding,o.standalone);l.dtd(a.pubid,a.sysid);l.att("version","1.0");walk_obj(r,l);if(!i)i={};i.pretty=i.pretty!==false;return l.end(i)}i.build=build;function walk_obj(r,i){let o,a,u;const c=type(r);if(c=="Undefined"){}else if(Array.isArray(r)){i=i.ele("array");for(a=0;a<r.length;a++){walk_obj(r[a],i)}}else if(Buffer.isBuffer(r)){i.ele("data").raw(r.toString("base64"))}else if(c=="Object"){i=i.ele("dict");for(u in r){if(r.hasOwnProperty(u)&&r[u]!==undefined){i.ele("key").txt(u);walk_obj(r[u],i)}}}else if(c=="Number"){o=r%1===0?"integer":"real";i.ele(o).txt(r.toString())}else if(c=="Date"){i.ele("date").txt(ISODateString(new Date(r)))}else if(c=="Boolean"){i.ele(r?"true":"false")}else if(c=="String"){i.ele("string").txt(r)}else if(c=="ArrayBuffer"){i.ele("data").raw(l.default.fromByteArray(r))}else if(r&&r.buffer&&type(r.buffer)=="ArrayBuffer"){i.ele("data").raw(l.default.fromByteArray(new Uint8Array(r.buffer)))}}},3681:(r,i,o)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});const a=o(2395);const l=o(6859);i["default"]={parse:l.parse,build:a.build}},6859:function(r,i,o){"use strict";var a=this&&this.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(i,"__esModule",{value:true});i.parse=void 0;const l=o(1328);const u=a(o(9491));const c=3;const h=4;const d=8;function shouldIgnoreNode(r){return r.nodeType===c||r.nodeType===d||r.nodeType===h}function isEmptyNode(r){return!r.childNodes||r.childNodes.length===0}function parse(r){const i=new l.DOMParser({errorHandler(){}}).parseFromString(r);(0,u.default)(i.documentElement.nodeName==="plist","malformed document. First element should be <plist>");let o=parsePlistXML(i.documentElement);if(o.length==1)o=o[0];return o}i.parse=parse;function parsePlistXML(r){let i,o,a,l,d,p;if(!r)return null;if(r.nodeName==="plist"){l=[];if(isEmptyNode(r)){return l}for(i=0;i<r.childNodes.length;i++){if(!shouldIgnoreNode(r.childNodes[i])){l.push(parsePlistXML(r.childNodes[i]))}}return l}else if(r.nodeName==="dict"){o={};a=null;p=0;if(isEmptyNode(r)){return o}for(i=0;i<r.childNodes.length;i++){if(shouldIgnoreNode(r.childNodes[i]))continue;if(p%2===0){(0,u.default)(r.childNodes[i].nodeName==="key","Missing key while parsing <dict/>.");a=parsePlistXML(r.childNodes[i])}else{(0,u.default)(r.childNodes[i].nodeName!=="key",'Unexpected key "'+parsePlistXML(r.childNodes[i])+'" while parsing <dict/>.');o[a]=parsePlistXML(r.childNodes[i])}p+=1}if(p%2===1){throw new Error('Missing value for "'+a+'" while parsing <dict/>')}return o}else if(r.nodeName==="array"){l=[];if(isEmptyNode(r)){return l}for(i=0;i<r.childNodes.length;i++){if(!shouldIgnoreNode(r.childNodes[i])){d=parsePlistXML(r.childNodes[i]);if(d!=null)l.push(d)}}return l}else if(r.nodeName==="#text"){}else if(r.nodeName==="key"){if(isEmptyNode(r)){return""}return r.childNodes[0].nodeValue}else if(r.nodeName==="string"){d="";if(isEmptyNode(r)){return d}for(i=0;i<r.childNodes.length;i++){const o=r.childNodes[i].nodeType;if(o===c||o===h){d+=r.childNodes[i].nodeValue}}return d}else if(r.nodeName==="integer"){(0,u.default)(!isEmptyNode(r),'Cannot parse "" as integer.');return parseInt(r.childNodes[0].nodeValue,10)}else if(r.nodeName==="real"){(0,u.default)(!isEmptyNode(r),'Cannot parse "" as real.');d="";for(i=0;i<r.childNodes.length;i++){if(r.childNodes[i].nodeType===c){d+=r.childNodes[i].nodeValue}}return parseFloat(d)}else if(r.nodeName==="data"){d="";if(isEmptyNode(r)){return Buffer.from(d,"base64")}for(i=0;i<r.childNodes.length;i++){if(r.childNodes[i].nodeType===c){d+=r.childNodes[i].nodeValue.replace(/\s+/g,"")}}return Buffer.from(d,"base64")}else if(r.nodeName==="date"){(0,u.default)(!isEmptyNode(r),'Cannot parse "" as Date.');return new Date(r.childNodes[0].nodeValue)}else if(r.nodeName==="true"){return true}else if(r.nodeName==="false"){return false}}},9686:(r,i,o)=>{i.alphasort=alphasort;i.alphasorti=alphasorti;i.setopts=setopts;i.ownProp=ownProp;i.makeAbs=makeAbs;i.finish=finish;i.mark=mark;i.isIgnored=isIgnored;i.childrenIgnored=childrenIgnored;function ownProp(r,i){return Object.prototype.hasOwnProperty.call(r,i)}var a=o(1017);var l=o(9566);var u=o(1323);var c=l.Minimatch;function alphasorti(r,i){return r.toLowerCase().localeCompare(i.toLowerCase())}function alphasort(r,i){return r.localeCompare(i)}function setupIgnores(r,i){r.ignore=i.ignore||[];if(!Array.isArray(r.ignore))r.ignore=[r.ignore];if(r.ignore.length){r.ignore=r.ignore.map(ignoreMap)}}function ignoreMap(r){var i=null;if(r.slice(-3)==="/**"){var o=r.replace(/(\/\*\*)+$/,"");i=new c(o,{dot:true})}return{matcher:new c(r,{dot:true}),gmatcher:i}}function setopts(r,i,o){if(!o)o={};if(o.matchBase&&-1===i.indexOf("/")){if(o.noglobstar){throw new Error("base matching requires globstar")}i="**/"+i}r.silent=!!o.silent;r.pattern=i;r.strict=o.strict!==false;r.realpath=!!o.realpath;r.realpathCache=o.realpathCache||Object.create(null);r.follow=!!o.follow;r.dot=!!o.dot;r.mark=!!o.mark;r.nodir=!!o.nodir;if(r.nodir)r.mark=true;r.sync=!!o.sync;r.nounique=!!o.nounique;r.nonull=!!o.nonull;r.nosort=!!o.nosort;r.nocase=!!o.nocase;r.stat=!!o.stat;r.noprocess=!!o.noprocess;r.absolute=!!o.absolute;r.maxLength=o.maxLength||Infinity;r.cache=o.cache||Object.create(null);r.statCache=o.statCache||Object.create(null);r.symlinks=o.symlinks||Object.create(null);setupIgnores(r,o);r.changedCwd=false;var l=process.cwd();if(!ownProp(o,"cwd"))r.cwd=l;else{r.cwd=a.resolve(o.cwd);r.changedCwd=r.cwd!==l}r.root=o.root||a.resolve(r.cwd,"/");r.root=a.resolve(r.root);if(process.platform==="win32")r.root=r.root.replace(/\\/g,"/");r.cwdAbs=u(r.cwd)?r.cwd:makeAbs(r,r.cwd);if(process.platform==="win32")r.cwdAbs=r.cwdAbs.replace(/\\/g,"/");r.nomount=!!o.nomount;o.nonegate=true;o.nocomment=true;r.minimatch=new c(i,o);r.options=r.minimatch.options}function finish(r){var i=r.nounique;var o=i?[]:Object.create(null);for(var a=0,l=r.matches.length;a<l;a++){var u=r.matches[a];if(!u||Object.keys(u).length===0){if(r.nonull){var c=r.minimatch.globSet[a];if(i)o.push(c);else o[c]=true}}else{var h=Object.keys(u);if(i)o.push.apply(o,h);else h.forEach((function(r){o[r]=true}))}}if(!i)o=Object.keys(o);if(!r.nosort)o=o.sort(r.nocase?alphasorti:alphasort);if(r.mark){for(var a=0;a<o.length;a++){o[a]=r._mark(o[a])}if(r.nodir){o=o.filter((function(i){var o=!/\/$/.test(i);var a=r.cache[i]||r.cache[makeAbs(r,i)];if(o&&a)o=a!=="DIR"&&!Array.isArray(a);return o}))}}if(r.ignore.length)o=o.filter((function(i){return!isIgnored(r,i)}));r.found=o}function mark(r,i){var o=makeAbs(r,i);var a=r.cache[o];var l=i;if(a){var u=a==="DIR"||Array.isArray(a);var c=i.slice(-1)==="/";if(u&&!c)l+="/";else if(!u&&c)l=l.slice(0,-1);if(l!==i){var h=makeAbs(r,l);r.statCache[h]=r.statCache[o];r.cache[h]=r.cache[o]}}return l}function makeAbs(r,i){var o=i;if(i.charAt(0)==="/"){o=a.join(r.root,i)}else if(u(i)||i===""){o=i}else if(r.changedCwd){o=a.resolve(r.cwd,i)}else{o=a.resolve(i)}if(process.platform==="win32")o=o.replace(/\\/g,"/");return o}function isIgnored(r,i){if(!r.ignore.length)return false;return r.ignore.some((function(r){return r.matcher.match(i)||!!(r.gmatcher&&r.gmatcher.match(i))}))}function childrenIgnored(r,i){if(!r.ignore.length)return false;return r.ignore.some((function(r){return!!(r.gmatcher&&r.gmatcher.match(i))}))}},1104:(r,i,o)=>{r.exports=glob;var a=o(7147);var l=o(8945);var u=o(9566);var c=u.Minimatch;var h=o(6919);var d=o(2361).EventEmitter;var p=o(1017);var m=o(9491);var g=o(1323);var y=o(2231);var v=o(9686);var b=v.alphasort;var w=v.alphasorti;var M=v.setopts;var E=v.ownProp;var D=o(9442);var T=o(3837);var x=v.childrenIgnored;var O=v.isIgnored;var N=o(7197);function glob(r,i,o){if(typeof i==="function")o=i,i={};if(!i)i={};if(i.sync){if(o)throw new TypeError("callback provided to sync glob");return y(r,i)}return new Glob(r,i,o)}glob.sync=y;var _=glob.GlobSync=y.GlobSync;glob.glob=glob;function extend(r,i){if(i===null||typeof i!=="object"){return r}var o=Object.keys(i);var a=o.length;while(a--){r[o[a]]=i[o[a]]}return r}glob.hasMagic=function(r,i){var o=extend({},i);o.noprocess=true;var a=new Glob(r,o);var l=a.minimatch.set;if(!r)return false;if(l.length>1)return true;for(var u=0;u<l[0].length;u++){if(typeof l[0][u]!=="string")return true}return false};glob.Glob=Glob;h(Glob,d);function Glob(r,i,o){if(typeof i==="function"){o=i;i=null}if(i&&i.sync){if(o)throw new TypeError("callback provided to sync glob");return new _(r,i)}if(!(this instanceof Glob))return new Glob(r,i,o);M(this,r,i);this._didRealPath=false;var a=this.minimatch.set.length;this.matches=new Array(a);if(typeof o==="function"){o=N(o);this.on("error",o);this.on("end",(function(r){o(null,r)}))}var l=this;this._processing=0;this._emitQueue=[];this._processQueue=[];this.paused=false;if(this.noprocess)return this;if(a===0)return done();var u=true;for(var c=0;c<a;c++){this._process(this.minimatch.set[c],c,false,done)}u=false;function done(){--l._processing;if(l._processing<=0){if(u){process.nextTick((function(){l._finish()}))}else{l._finish()}}}}Glob.prototype._finish=function(){m(this instanceof Glob);if(this.aborted)return;if(this.realpath&&!this._didRealpath)return this._realpath();v.finish(this);this.emit("end",this.found)};Glob.prototype._realpath=function(){if(this._didRealpath)return;this._didRealpath=true;var r=this.matches.length;if(r===0)return this._finish();var i=this;for(var o=0;o<this.matches.length;o++)this._realpathSet(o,next);function next(){if(--r===0)i._finish()}};Glob.prototype._realpathSet=function(r,i){var o=this.matches[r];if(!o)return i();var a=Object.keys(o);var u=this;var c=a.length;if(c===0)return i();var h=this.matches[r]=Object.create(null);a.forEach((function(o,a){o=u._makeAbs(o);l.realpath(o,u.realpathCache,(function(a,l){if(!a)h[l]=true;else if(a.syscall==="stat")h[o]=true;else u.emit("error",a);if(--c===0){u.matches[r]=h;i()}}))}))};Glob.prototype._mark=function(r){return v.mark(this,r)};Glob.prototype._makeAbs=function(r){return v.makeAbs(this,r)};Glob.prototype.abort=function(){this.aborted=true;this.emit("abort")};Glob.prototype.pause=function(){if(!this.paused){this.paused=true;this.emit("pause")}};Glob.prototype.resume=function(){if(this.paused){this.emit("resume");this.paused=false;if(this._emitQueue.length){var r=this._emitQueue.slice(0);this._emitQueue.length=0;for(var i=0;i<r.length;i++){var o=r[i];this._emitMatch(o[0],o[1])}}if(this._processQueue.length){var a=this._processQueue.slice(0);this._processQueue.length=0;for(var i=0;i<a.length;i++){var l=a[i];this._processing--;this._process(l[0],l[1],l[2],l[3])}}}};Glob.prototype._process=function(r,i,o,a){m(this instanceof Glob);m(typeof a==="function");if(this.aborted)return;this._processing++;if(this.paused){this._processQueue.push([r,i,o,a]);return}var l=0;while(typeof r[l]==="string"){l++}var c;switch(l){case r.length:this._processSimple(r.join("/"),i,a);return;case 0:c=null;break;default:c=r.slice(0,l).join("/");break}var h=r.slice(l);var d;if(c===null)d=".";else if(g(c)||g(r.join("/"))){if(!c||!g(c))c="/"+c;d=c}else d=c;var p=this._makeAbs(d);if(x(this,d))return a();var y=h[0]===u.GLOBSTAR;if(y)this._processGlobStar(c,d,p,h,i,o,a);else this._processReaddir(c,d,p,h,i,o,a)};Glob.prototype._processReaddir=function(r,i,o,a,l,u,c){var h=this;this._readdir(o,u,(function(d,p){return h._processReaddir2(r,i,o,a,l,u,p,c)}))};Glob.prototype._processReaddir2=function(r,i,o,a,l,u,c,h){if(!c)return h();var d=a[0];var m=!!this.minimatch.negate;var g=d._glob;var y=this.dot||g.charAt(0)===".";var v=[];for(var b=0;b<c.length;b++){var w=c[b];if(w.charAt(0)!=="."||y){var M;if(m&&!r){M=!w.match(d)}else{M=w.match(d)}if(M)v.push(w)}}var E=v.length;if(E===0)return h();if(a.length===1&&!this.mark&&!this.stat){if(!this.matches[l])this.matches[l]=Object.create(null);for(var b=0;b<E;b++){var w=v[b];if(r){if(r!=="/")w=r+"/"+w;else w=r+w}if(w.charAt(0)==="/"&&!this.nomount){w=p.join(this.root,w)}this._emitMatch(l,w)}return h()}a.shift();for(var b=0;b<E;b++){var w=v[b];var D;if(r){if(r!=="/")w=r+"/"+w;else w=r+w}this._process([w].concat(a),l,u,h)}h()};Glob.prototype._emitMatch=function(r,i){if(this.aborted)return;if(O(this,i))return;if(this.paused){this._emitQueue.push([r,i]);return}var o=g(i)?i:this._makeAbs(i);if(this.mark)i=this._mark(i);if(this.absolute)i=o;if(this.matches[r][i])return;if(this.nodir){var a=this.cache[o];if(a==="DIR"||Array.isArray(a))return}this.matches[r][i]=true;var l=this.statCache[o];if(l)this.emit("stat",i,l);this.emit("match",i)};Glob.prototype._readdirInGlobStar=function(r,i){if(this.aborted)return;if(this.follow)return this._readdir(r,false,i);var o="lstat\0"+r;var l=this;var u=D(o,lstatcb_);if(u)a.lstat(r,u);function lstatcb_(o,a){if(o&&o.code==="ENOENT")return i();var u=a&&a.isSymbolicLink();l.symlinks[r]=u;if(!u&&a&&!a.isDirectory()){l.cache[r]="FILE";i()}else l._readdir(r,false,i)}};Glob.prototype._readdir=function(r,i,o){if(this.aborted)return;o=D("readdir\0"+r+"\0"+i,o);if(!o)return;if(i&&!E(this.symlinks,r))return this._readdirInGlobStar(r,o);if(E(this.cache,r)){var l=this.cache[r];if(!l||l==="FILE")return o();if(Array.isArray(l))return o(null,l)}var u=this;a.readdir(r,readdirCb(this,r,o))};function readdirCb(r,i,o){return function(a,l){if(a)r._readdirError(i,a,o);else r._readdirEntries(i,l,o)}}Glob.prototype._readdirEntries=function(r,i,o){if(this.aborted)return;if(!this.mark&&!this.stat){for(var a=0;a<i.length;a++){var l=i[a];if(r==="/")l=r+l;else l=r+"/"+l;this.cache[l]=true}}this.cache[r]=i;return o(null,i)};Glob.prototype._readdirError=function(r,i,o){if(this.aborted)return;switch(i.code){case"ENOTSUP":case"ENOTDIR":var a=this._makeAbs(r);this.cache[a]="FILE";if(a===this.cwdAbs){var l=new Error(i.code+" invalid cwd "+this.cwd);l.path=this.cwd;l.code=i.code;this.emit("error",l);this.abort()}break;case"ENOENT":case"ELOOP":case"ENAMETOOLONG":case"UNKNOWN":this.cache[this._makeAbs(r)]=false;break;default:this.cache[this._makeAbs(r)]=false;if(this.strict){this.emit("error",i);this.abort()}if(!this.silent)console.error("glob error",i);break}return o()};Glob.prototype._processGlobStar=function(r,i,o,a,l,u,c){var h=this;this._readdir(o,u,(function(d,p){h._processGlobStar2(r,i,o,a,l,u,p,c)}))};Glob.prototype._processGlobStar2=function(r,i,o,a,l,u,c,h){if(!c)return h();var d=a.slice(1);var p=r?[r]:[];var m=p.concat(d);this._process(m,l,false,h);var g=this.symlinks[o];var y=c.length;if(g&&u)return h();for(var v=0;v<y;v++){var b=c[v];if(b.charAt(0)==="."&&!this.dot)continue;var w=p.concat(c[v],d);this._process(w,l,true,h);var M=p.concat(c[v],a);this._process(M,l,true,h)}h()};Glob.prototype._processSimple=function(r,i,o){var a=this;this._stat(r,(function(l,u){a._processSimple2(r,i,l,u,o)}))};Glob.prototype._processSimple2=function(r,i,o,a,l){if(!this.matches[i])this.matches[i]=Object.create(null);if(!a)return l();if(r&&g(r)&&!this.nomount){var u=/[\/\\]$/.test(r);if(r.charAt(0)==="/"){r=p.join(this.root,r)}else{r=p.resolve(this.root,r);if(u)r+="/"}}if(process.platform==="win32")r=r.replace(/\\/g,"/");this._emitMatch(i,r);l()};Glob.prototype._stat=function(r,i){var o=this._makeAbs(r);var l=r.slice(-1)==="/";if(r.length>this.maxLength)return i();if(!this.stat&&E(this.cache,o)){var u=this.cache[o];if(Array.isArray(u))u="DIR";if(!l||u==="DIR")return i(null,u);if(l&&u==="FILE")return i()}var c;var h=this.statCache[o];if(h!==undefined){if(h===false)return i(null,h);else{var d=h.isDirectory()?"DIR":"FILE";if(l&&d==="FILE")return i();else return i(null,d,h)}}var p=this;var m=D("stat\0"+o,lstatcb_);if(m)a.lstat(o,m);function lstatcb_(l,u){if(u&&u.isSymbolicLink()){return a.stat(o,(function(a,l){if(a)p._stat2(r,o,null,u,i);else p._stat2(r,o,a,l,i)}))}else{p._stat2(r,o,l,u,i)}}};Glob.prototype._stat2=function(r,i,o,a,l){if(o&&(o.code==="ENOENT"||o.code==="ENOTDIR")){this.statCache[i]=false;return l()}var u=r.slice(-1)==="/";this.statCache[i]=a;if(i.slice(-1)==="/"&&a&&!a.isDirectory())return l(null,false,a);var c=true;if(a)c=a.isDirectory()?"DIR":"FILE";this.cache[i]=this.cache[i]||c;if(u&&c==="FILE")return l();return l(null,c,a)}},2231:(r,i,o)=>{r.exports=globSync;globSync.GlobSync=GlobSync;var a=o(7147);var l=o(8945);var u=o(9566);var c=u.Minimatch;var h=o(1104).Glob;var d=o(3837);var p=o(1017);var m=o(9491);var g=o(1323);var y=o(9686);var v=y.alphasort;var b=y.alphasorti;var w=y.setopts;var M=y.ownProp;var E=y.childrenIgnored;var D=y.isIgnored;function globSync(r,i){if(typeof i==="function"||arguments.length===3)throw new TypeError("callback provided to sync glob\n"+"See: https://github.com/isaacs/node-glob/issues/167");return new GlobSync(r,i).found}function GlobSync(r,i){if(!r)throw new Error("must provide pattern");if(typeof i==="function"||arguments.length===3)throw new TypeError("callback provided to sync glob\n"+"See: https://github.com/isaacs/node-glob/issues/167");if(!(this instanceof GlobSync))return new GlobSync(r,i);w(this,r,i);if(this.noprocess)return this;var o=this.minimatch.set.length;this.matches=new Array(o);for(var a=0;a<o;a++){this._process(this.minimatch.set[a],a,false)}this._finish()}GlobSync.prototype._finish=function(){m(this instanceof GlobSync);if(this.realpath){var r=this;this.matches.forEach((function(i,o){var a=r.matches[o]=Object.create(null);for(var u in i){try{u=r._makeAbs(u);var c=l.realpathSync(u,r.realpathCache);a[c]=true}catch(i){if(i.syscall==="stat")a[r._makeAbs(u)]=true;else throw i}}}))}y.finish(this)};GlobSync.prototype._process=function(r,i,o){m(this instanceof GlobSync);var a=0;while(typeof r[a]==="string"){a++}var l;switch(a){case r.length:this._processSimple(r.join("/"),i);return;case 0:l=null;break;default:l=r.slice(0,a).join("/");break}var c=r.slice(a);var h;if(l===null)h=".";else if(g(l)||g(r.join("/"))){if(!l||!g(l))l="/"+l;h=l}else h=l;var d=this._makeAbs(h);if(E(this,h))return;var p=c[0]===u.GLOBSTAR;if(p)this._processGlobStar(l,h,d,c,i,o);else this._processReaddir(l,h,d,c,i,o)};GlobSync.prototype._processReaddir=function(r,i,o,a,l,u){var c=this._readdir(o,u);if(!c)return;var h=a[0];var d=!!this.minimatch.negate;var m=h._glob;var g=this.dot||m.charAt(0)===".";var y=[];for(var v=0;v<c.length;v++){var b=c[v];if(b.charAt(0)!=="."||g){var w;if(d&&!r){w=!b.match(h)}else{w=b.match(h)}if(w)y.push(b)}}var M=y.length;if(M===0)return;if(a.length===1&&!this.mark&&!this.stat){if(!this.matches[l])this.matches[l]=Object.create(null);for(var v=0;v<M;v++){var b=y[v];if(r){if(r.slice(-1)!=="/")b=r+"/"+b;else b=r+b}if(b.charAt(0)==="/"&&!this.nomount){b=p.join(this.root,b)}this._emitMatch(l,b)}return}a.shift();for(var v=0;v<M;v++){var b=y[v];var E;if(r)E=[r,b];else E=[b];this._process(E.concat(a),l,u)}};GlobSync.prototype._emitMatch=function(r,i){if(D(this,i))return;var o=this._makeAbs(i);if(this.mark)i=this._mark(i);if(this.absolute){i=o}if(this.matches[r][i])return;if(this.nodir){var a=this.cache[o];if(a==="DIR"||Array.isArray(a))return}this.matches[r][i]=true;if(this.stat)this._stat(i)};GlobSync.prototype._readdirInGlobStar=function(r){if(this.follow)return this._readdir(r,false);var i;var o;var l;try{o=a.lstatSync(r)}catch(r){if(r.code==="ENOENT"){return null}}var u=o&&o.isSymbolicLink();this.symlinks[r]=u;if(!u&&o&&!o.isDirectory())this.cache[r]="FILE";else i=this._readdir(r,false);return i};GlobSync.prototype._readdir=function(r,i){var o;if(i&&!M(this.symlinks,r))return this._readdirInGlobStar(r);if(M(this.cache,r)){var l=this.cache[r];if(!l||l==="FILE")return null;if(Array.isArray(l))return l}try{return this._readdirEntries(r,a.readdirSync(r))}catch(i){this._readdirError(r,i);return null}};GlobSync.prototype._readdirEntries=function(r,i){if(!this.mark&&!this.stat){for(var o=0;o<i.length;o++){var a=i[o];if(r==="/")a=r+a;else a=r+"/"+a;this.cache[a]=true}}this.cache[r]=i;return i};GlobSync.prototype._readdirError=function(r,i){switch(i.code){case"ENOTSUP":case"ENOTDIR":var o=this._makeAbs(r);this.cache[o]="FILE";if(o===this.cwdAbs){var a=new Error(i.code+" invalid cwd "+this.cwd);a.path=this.cwd;a.code=i.code;throw a}break;case"ENOENT":case"ELOOP":case"ENAMETOOLONG":case"UNKNOWN":this.cache[this._makeAbs(r)]=false;break;default:this.cache[this._makeAbs(r)]=false;if(this.strict)throw i;if(!this.silent)console.error("glob error",i);break}};GlobSync.prototype._processGlobStar=function(r,i,o,a,l,u){var c=this._readdir(o,u);if(!c)return;var h=a.slice(1);var d=r?[r]:[];var p=d.concat(h);this._process(p,l,false);var m=c.length;var g=this.symlinks[o];if(g&&u)return;for(var y=0;y<m;y++){var v=c[y];if(v.charAt(0)==="."&&!this.dot)continue;var b=d.concat(c[y],h);this._process(b,l,true);var w=d.concat(c[y],a);this._process(w,l,true)}};GlobSync.prototype._processSimple=function(r,i){var o=this._stat(r);if(!this.matches[i])this.matches[i]=Object.create(null);if(!o)return;if(r&&g(r)&&!this.nomount){var a=/[\/\\]$/.test(r);if(r.charAt(0)==="/"){r=p.join(this.root,r)}else{r=p.resolve(this.root,r);if(a)r+="/"}}if(process.platform==="win32")r=r.replace(/\\/g,"/");this._emitMatch(i,r)};GlobSync.prototype._stat=function(r){var i=this._makeAbs(r);var o=r.slice(-1)==="/";if(r.length>this.maxLength)return false;if(!this.stat&&M(this.cache,i)){var l=this.cache[i];if(Array.isArray(l))l="DIR";if(!o||l==="DIR")return l;if(o&&l==="FILE")return false}var u;var c=this.statCache[i];if(!c){var h;try{h=a.lstatSync(i)}catch(r){if(r&&(r.code==="ENOENT"||r.code==="ENOTDIR")){this.statCache[i]=false;return false}}if(h&&h.isSymbolicLink()){try{c=a.statSync(i)}catch(r){c=h}}else{c=h}}this.statCache[i]=c;var l=true;if(c)l=c.isDirectory()?"DIR":"FILE";this.cache[i]=this.cache[i]||l;if(o&&l==="FILE")return false;return l};GlobSync.prototype._mark=function(r){return y.mark(this,r)};GlobSync.prototype._makeAbs=function(r){return y.makeAbs(this,r)}},208:function(r,i,o){"use strict";var a=this&&this.__createBinding||(Object.create?function(r,i,o,a){if(a===undefined)a=o;var l=Object.getOwnPropertyDescriptor(i,o);if(!l||("get"in l?!i.__esModule:l.writable||l.configurable)){l={enumerable:true,get:function(){return i[o]}}}Object.defineProperty(r,a,l)}:function(r,i,o,a){if(a===undefined)a=o;r[a]=i[o]});var l=this&&this.__setModuleDefault||(Object.create?function(r,i){Object.defineProperty(r,"default",{enumerable:true,value:i})}:function(r,i){r["default"]=i});var u=this&&this.__importStar||function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var o in r)if(o!=="default"&&Object.prototype.hasOwnProperty.call(r,o))a(i,r,o);l(i,r);return i};var c=this&&this.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(i,"__esModule",{value:true});i.getConfigPath=i.getProjectIdAsync=i.getAsync=i.openAsync=i.getAdbOutputAsync=i.removeAsync=i.addAsync=i.isAvailable=void 0;const h=o(4513);const d=u(o(365));const p=o(8853);const m=c(o(5642));const g=c(o(8746));const y=o(7147);const v=c(o(1017));const b=o(3329);const w="Activity not started, unable to resolve Intent";const M="error: ";function isAvailable(r){return(0,y.existsSync)(v.default.join(r,"android/app/src/main/AndroidManifest.xml"))||(0,y.existsSync)(v.default.join(r,"app/src/main/AndroidManifest.xml"))}i.isAvailable=isAvailable;async function addAsync({dryRun:r,uri:i,manifestPath:o,projectRoot:a}){const l=o??getConfigPath(a);let u=await readConfigAsync(l);if(!d.ensureManifestHasValidIntentFilter(u)){throw new b.CommandError(`Cannot add scheme "${i}" because the provided manifest does not have a valid Activity with \`android:launchMode="singleTask"\`.\nThis guide can help you get setup properly https://expo.fyi/setup-android-uri-scheme`,"add")}if(d.hasScheme(i,u)){console.log(g.default.yellow(`› Android: URI scheme "${i}" already exists in AndroidManifest.xml at: ${l}`));return false}u=d.appendScheme(i,u);if(r){console.log(g.default.magenta("Write manifest to: ",l));console.log((0,p.format)(u));return false}await writeConfigAsync(l,u);return true}i.addAsync=addAsync;async function removeAsync({dryRun:r,uri:i,manifestPath:o,projectRoot:a}){const l=o??getConfigPath(a);let u=await readConfigAsync(l);if(!d.ensureManifestHasValidIntentFilter(u)){throw new b.CommandError(`Cannot remove scheme "${i}" because the provided manifest does not have a valid Activity with \`android:launchMode="singleTask"\`.\nThis guide can help you get setup properly https://expo.fyi/setup-android-uri-scheme`,"remove")}if(!d.hasScheme(i,u)){console.log(g.default.yellow(`› Android: URI scheme "${i}" does not exist in AndroidManifest.xml at: ${l}`));return false}u=d.removeScheme(i,u);if(r){console.log(g.default.magenta("Write manifest to: ",l));console.log((0,p.format)(u));return false}await writeConfigAsync(l,u);return true}i.removeAsync=removeAsync;function whichADB(){if(process.env.ANDROID_HOME){return`${process.env.ANDROID_HOME}/platform-tools/adb`}return"adb"}async function getAdbOutputAsync(r){const i=whichADB();try{const o=await(0,m.default)(i,r);return o.stdout}catch(r){const i=r.stderr||r.stdout||"";let o=i.trim();if(o.startsWith(M)){o=o.substring(M.length)}throw new b.CommandError(o)}}i.getAdbOutputAsync=getAdbOutputAsync;async function openUrlAsync(...r){const i=await getAdbOutputAsync(["shell","am","start","-a","android.intent.action.VIEW","-d",...r.filter(Boolean)]);if(i.includes(w)){throw new b.CommandError(i.substring(i.indexOf("Error: ")))}return i}async function openAsync({uri:r,androidPackage:i}){return await openUrlAsync(r.replace(/&/g,String.raw`\&`),i??null)}i.openAsync=openAsync;async function getAsync({projectRoot:r,manifestPath:i}){const o=await readConfigAsync(i??getConfigPath(r));return await d.getSchemesFromManifest(o)}i.getAsync=getAsync;function getPackage(r){return r.manifest?.$?.package??null}async function getProjectIdAsync({projectRoot:r,manifestPath:i}){const o=i??getConfigPath(r);const a=await readConfigAsync(o);const l=getPackage(a);if(!l)throw new b.CommandError(`Android: Failed to resolve android package for Manifest at path: ${o}`);return l}i.getProjectIdAsync=getProjectIdAsync;function getConfigPath(r){const i=["android/app/src/main/AndroidManifest.xml","app/src/main/AndroidManifest.xml"].map((i=>v.default.join(r,i)));for(const r of i){if((0,y.existsSync)(r)){return r}}throw new Error(`Could not find AndroidManifest.xml, looked in: ${i.join(", ")}`)}i.getConfigPath=getConfigPath;async function readConfigAsync(r){return await(0,h.readAndroidManifestAsync)(r)}async function writeConfigAsync(r,i){await(0,h.writeAndroidManifestAsync)(r,i)}},5585:function(r,i,o){"use strict";var a=this&&this.__createBinding||(Object.create?function(r,i,o,a){if(a===undefined)a=o;var l=Object.getOwnPropertyDescriptor(i,o);if(!l||("get"in l?!i.__esModule:l.writable||l.configurable)){l={enumerable:true,get:function(){return i[o]}}}Object.defineProperty(r,a,l)}:function(r,i,o,a){if(a===undefined)a=o;r[a]=i[o]});var l=this&&this.__setModuleDefault||(Object.create?function(r,i){Object.defineProperty(r,"default",{enumerable:true,value:i})}:function(r,i){r["default"]=i});var u=this&&this.__importStar||function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var o in r)if(o!=="default"&&Object.prototype.hasOwnProperty.call(r,o))a(i,r,o);l(i,r);return i};var c=this&&this.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(i,"__esModule",{value:true});i.run=i.program=void 0;const h=c(o(8746));const d=o(8018);const p=o(1017);const m=u(o(208));const g=u(o(2194));const y=o(3329);const v=u(o(8522));const b=c(o(2586));const packageJson=()=>o(4147);i.program=new d.Command(packageJson().name).version(packageJson().version);function buildCommand(r,o=[]){return i.program.command(`${r} [uri-protocol]`).option("-a, --android","Apply action to Android").option("-i, --ios","Apply action to iOS ").on("--help",(()=>{if(!o.length)return;console.log();console.log("Examples:");console.log();for(const i of o){console.log(` $ uri-scheme ${r} ${i}`)}console.log()}))}buildCommand("add",["com.app","myapp"]).description("Add URI schemes to a native app").option("-n, --name <string>","Name to use on iOS.").option("-r, --role <string>","Role to use on iOS: Editor, Viewer").option("--manifest-path <string>","Custom path to use for an Android project's AndroidManifest.xml").option("--info-path <string>","Custom path to use for an iOS project's Info.plist").option("--dry-run","View the proposed change").action((async(r,i)=>{try{const o=await parseArgsAsync(r,i);await v.addAsync(o);(0,b.default)()}catch(r){commandDidThrowAsync(r)}}));buildCommand("remove",["com.app","myapp"]).description("Remove URI schemes from a native app").option("--manifest-path <string>","Custom path to use for an Android project's AndroidManifest.xml").option("--info-path <string>","Custom path to use for an iOS project's Info.plist").option("--dry-run","View the proposed change").action((async(r,i)=>{try{const o=await parseArgsAsync(r,i);await v.removeAsync(o);(0,b.default)()}catch(r){commandDidThrowAsync(r)}}));buildCommand("open",["com.app://oauth","http://expo.dev"]).description("Open a URI scheme in a running simulator or emulator").option("--package <string>","The Android package name to use when opening in an emulator").action((async(r,i)=>{try{if(!i.ios&&!i.android){throw new y.CommandError("Please provide a target platform with --ios or --android")}await v.openAsync({projectRoot:process.cwd(),...i,androidPackage:i["package"],uri:r});(0,b.default)()}catch(r){commandDidThrowAsync(r)}}));buildCommand("list").description("List the existing URI scheme prefixes for a native app").option("--manifest-path <string>","Custom path to use for an Android project's AndroidManifest.xml").option("--info-path <string>","Custom path to use for an iOS project's Info.plist").action((async(r,i)=>{try{const o=await parseArgsAsync(r,i);await v.listAsync(o);(0,b.default)()}catch(r){commandDidThrowAsync(r)}}));async function parseArgsAsync(r,i){const o=(0,p.resolve)(process.cwd());i.projectRoot=o;if(i.manifestPath)i.manifestPath=(0,p.resolve)(i.manifestPath);if(i.infoPath)i.infoPath=(0,p.resolve)(i.infoPath);const a=v.getAvailablePlatforms(i);let l=false;if(!i.android&&!i.ios){l=true;for(const r of a){i[r]=true}}else{if(i.android){if(!a.includes("android")){throw new y.CommandError(`Android project not found in directory "${o}".\nYou can manually select an AndroidManifest.xml with \`--manifest-path\``)}}if(i.ios){if(!a.includes("ios")){throw new y.CommandError(`iOS project not found in directory "${o}".\nYou can manually select an Info.plist with \`--info-path\``)}}}if(i.android&&!i.manifestPath){try{i.manifestPath=m.getConfigPath(o)}catch(r){if(l){delete i.android}else{throw r}}}if(i.ios&&!i.infoPath){try{i.infoPath=g.getConfigPath(o)}catch(r){if(l){delete i.ios}else{throw r}}}i.uri=r;return i}function run(){i.program.parse(process.argv)}i.run=run;async function commandDidThrowAsync(r){console.log();if(r.command){console.log(h.default.red(`› ${h.default.bold(`npx ${packageJson().name} ${r.command}`)} has failed.`));console.log()}if(r.origin==="uri-scheme"){console.log(h.default.black.bgRed(r.message))}else{console.log("Aborting run");console.log(h.default.black.bgRed`An unexpected error was encountered. Please report it as a bug:`);console.log(r)}console.log();await(0,b.default)();process.exit(1)}},2194:function(r,i,o){"use strict";var a=this&&this.__createBinding||(Object.create?function(r,i,o,a){if(a===undefined)a=o;var l=Object.getOwnPropertyDescriptor(i,o);if(!l||("get"in l?!i.__esModule:l.writable||l.configurable)){l={enumerable:true,get:function(){return i[o]}}}Object.defineProperty(r,a,l)}:function(r,i,o,a){if(a===undefined)a=o;r[a]=i[o]});var l=this&&this.__setModuleDefault||(Object.create?function(r,i){Object.defineProperty(r,"default",{enumerable:true,value:i})}:function(r,i){r["default"]=i});var u=this&&this.__importStar||function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var o in r)if(o!=="default"&&Object.prototype.hasOwnProperty.call(r,o))a(i,r,o);l(i,r);return i};var c=this&&this.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(i,"__esModule",{value:true});i.getConfigPath=i.getAsync=i.openAsync=i.removeAsync=i.addAsync=i.isAvailable=void 0;const h=u(o(7903));const d=c(o(3681));const p=c(o(5642));const m=c(o(8746));const g=c(o(7147));const y=o(1104);const v=u(o(1017));const b=o(3329);const w=["**/@(Carthage|Pods|vendor|node_modules)/**"];function isAvailable(r){const i=(0,y.sync)("ios/*.xcodeproj",{ignore:w,absolute:true,cwd:r});const o=(0,y.sync)("*.xcodeproj",{ignore:w,absolute:true,cwd:r});return!!o.length||!!i.length}i.isAvailable=isAvailable;async function addAsync({uri:r,infoPath:i,projectRoot:o,dryRun:a}){const l=i??getConfigPath(o);let u=readConfig(l);if(h.hasScheme(r,u)){console.log(m.default.yellow(`› iOS: URI scheme "${r}" already exists in Info.plist at: ${l}`));return false}u=h.appendScheme(r,u);if(a){console.log(m.default.magenta("Write plist to: ",l));console.log(formatConfig(u));return false}writeConfig(l,u);return true}i.addAsync=addAsync;async function removeAsync({uri:r,infoPath:i,projectRoot:o,dryRun:a}){const l=i??getConfigPath(o);let u=readConfig(l);if(!h.hasScheme(r,u)){console.log(m.default.yellow(`› iOS: URI scheme "${r}" does not exist in Info.plist at: ${l}`));return false}u=h.removeScheme(r,u);if(a){console.log(m.default.magenta("Write plist to: ",l));console.log(formatConfig(u));return false}writeConfig(l,u);return true}i.removeAsync=removeAsync;async function openAsync({uri:r}){await(0,p.default)("xcrun",["simctl","openurl","booted",r],{stdio:"inherit"})}i.openAsync=openAsync;async function getAsync({projectRoot:r,infoPath:i}){const o=i??getConfigPath(r);const a=g.default.readFileSync(o,"utf8");const l=d.default.parse(a);const u=h.getSchemesFromPlist(l);return u}i.getAsync=getAsync;function getInfoPlistsInDirectory(r){return(0,y.sync)("*/Info.plist",{ignore:w,absolute:true,cwd:r}).sort(((r,i)=>r.length-i.length))}function getConfigPath(r){const i=getInfoPlistsInDirectory(v.join(r,"ios"));if(i.length){return i[0]}const o=getInfoPlistsInDirectory(r);if(!o.length){throw new b.CommandError(`iOS: No Info.plist found for project at root: ${r}`)}return o[0]}i.getConfigPath=getConfigPath;function readConfig(r){const i=g.default.readFileSync(r,"utf8");return{...d.default.parse(i)}}function formatConfig(r){const i={pretty:true,indent:`\t`};const o=d.default.build(r,i);return o}function writeConfig(r,i){g.default.writeFileSync(r,formatConfig(i))}},3329:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.CommandError=void 0;class CommandError extends Error{command;origin="uri-scheme";constructor(r,i){super(r);this.command=i}}i.CommandError=CommandError},8522:function(r,i,o){"use strict";var a=this&&this.__createBinding||(Object.create?function(r,i,o,a){if(a===undefined)a=o;var l=Object.getOwnPropertyDescriptor(i,o);if(!l||("get"in l?!i.__esModule:l.writable||l.configurable)){l={enumerable:true,get:function(){return i[o]}}}Object.defineProperty(r,a,l)}:function(r,i,o,a){if(a===undefined)a=o;r[a]=i[o]});var l=this&&this.__setModuleDefault||(Object.create?function(r,i){Object.defineProperty(r,"default",{enumerable:true,value:i})}:function(r,i){r["default"]=i});var u=this&&this.__importStar||function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var o in r)if(o!=="default"&&Object.prototype.hasOwnProperty.call(r,o))a(i,r,o);l(i,r);return i};var c=this&&this.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(i,"__esModule",{value:true});i.listAsync=i.openAsync=i.removeAsync=i.addAsync=i.getAvailablePlatforms=void 0;const h=c(o(8746));const d=o(7147);const p=o(1017);const m=c(o(1112));const g=u(o(208));const y=u(o(2194));const v=o(3329);function fileExists(r){try{return(0,d.statSync)(r).isFile()}catch{return false}}function getAvailablePlatforms(r){const i=[];if(r.infoPath){if(!fileExists(r.infoPath)){throw new v.CommandError(`Custom Info.plist does not exist at path "${r.infoPath}"`)}i.push("ios")}else if(y.isAvailable(r.projectRoot)){i.push("ios")}if(r.manifestPath){if(!fileExists(r.manifestPath)){throw new v.CommandError(`Custom AndroidManifest.xml does not exist at path "${r.manifestPath}"`)}i.push("android")}else if(g.isAvailable(r.projectRoot)){i.push("android")}return i}i.getAvailablePlatforms=getAvailablePlatforms;function ensureUriString(r){if(!r){throw new v.CommandError("Please supply a URI protocol")}if(typeof r!=="string"){throw new v.CommandError(`URI protocol should be of type string. Instead got: ${typeof r}`)}return r.trim()}async function normalizeUriProtocolAsync(r){const i=ensureUriString(r);const[o]=i.split(":");const a=o.toLowerCase();if(a!==r){if(a){console.log(h.default.yellow(`› Supplied URI protocol "${i}" does not match normalized scheme "${a}".`));const{answer:r}=await(0,m.default)({type:"confirm",name:"answer",message:`Would you like to use "${a}" instead?`,initial:true});if(r)return a}else{throw new v.CommandError(`Supplied URI protocol "${i}" does not appear to be spec compliant: http://www.ietf.org/rfc/rfc2396.txt`)}}return i}async function addAsync(r){r.uri=await normalizeUriProtocolAsync(r.uri);const i=[];let o=false;if(r.ios){if(await y.addAsync(r)){o=true;logPlatformMessage("iOS",`Added URI protocol "${r.uri}" to project`);i.push("ios")}}if(r.android){if(await g.addAsync(r)){o=true;logPlatformMessage("Android",`Added URI protocol "${r.uri}" to project`);i.push("android")}}if(!o){console.log(h.default.yellow("No URI schemes could be added. Please ensure there is a native project available."))}return i}i.addAsync=addAsync;async function removeAsync(r){r.uri=ensureUriString(r.uri);const i=[];let o=false;if(r.ios){if(await y.removeAsync(r)){o=true;logPlatformMessage("iOS",`Removed URI protocol "${r.uri}" from project`);i.push("ios")}}if(r.android){if(await g.removeAsync(r)){o=true;logPlatformMessage("Android",`Removed URI protocol "${r.uri}" from project`);i.push("android")}}if(!o){console.log(h.default.yellow("No URI schemes could be removed. Please ensure there is a native project available."))}return i}i.removeAsync=removeAsync;async function openAsync(r){r.uri=ensureUriString(r.uri);if(r.ios){logPlatformMessage("iOS",`Opening URI "${r.uri}" in simulator`);await y.openAsync(r)}if(r.android){logPlatformMessage("Android",`Opening URI "${r.uri}" in emulator`);await g.openAsync(r)}}i.openAsync=openAsync;async function listAsync(r){let i=false;if(r.infoPath){i=true;const o=await y.getAsync(r);logPlatformMessage("iOS",`Schemes for config: ./${(0,p.relative)(r.projectRoot,r.infoPath)}`);logSchemes(o)}if(r.manifestPath){i=true;const o=await g.getAsync(r);logPlatformMessage("Android",`Schemes for config: ./${(0,p.relative)(r.projectRoot,r.manifestPath)}`);logSchemes(o)}if(!i){console.log(h.default.yellow("Could not find any native URI schemes to list."))}}i.listAsync=listAsync;function logPlatformMessage(r,i){console.log(h.default.magenta(`› ${h.default.bold(r)}: ${i}`))}function logSchemes(r){for(const i of r)console.log(`${h.default.dim("› ")}${i}${h.default.dim("://")}`);console.log("")}},2855:function(r,i,o){"use strict";var a=this&&this.__createBinding||(Object.create?function(r,i,o,a){if(a===undefined)a=o;var l=Object.getOwnPropertyDescriptor(i,o);if(!l||("get"in l?!i.__esModule:l.writable||l.configurable)){l={enumerable:true,get:function(){return i[o]}}}Object.defineProperty(r,a,l)}:function(r,i,o,a){if(a===undefined)a=o;r[a]=i[o]});var l=this&&this.__setModuleDefault||(Object.create?function(r,i){Object.defineProperty(r,"default",{enumerable:true,value:i})}:function(r,i){r["default"]=i});var u=this&&this.__importStar||function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var o in r)if(o!=="default"&&Object.prototype.hasOwnProperty.call(r,o))a(i,r,o);l(i,r);return i};Object.defineProperty(i,"__esModule",{value:true});i.URIScheme=i.Android=i.Ios=i.program=void 0;const c=u(o(208));i.Android=c;const h=u(o(2194));i.Ios=h;const d=u(o(8522));i.URIScheme=d;var p=o(5585);Object.defineProperty(i,"program",{enumerable:true,get:function(){return p.program}})},2586:function(r,i,o){"use strict";var a=this&&this.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(i,"__esModule",{value:true});const l=a(o(8746));const u=a(o(5418));async function shouldUpdate(){const packageJson=()=>o(4147);const r=(0,u.default)(packageJson()).catch((()=>null));try{const i=await r;if(i&&i.latest){const r=packageJson();console.log();console.log(l.default.yellow.bold(`A new version of \`${r.name}\` is available`));console.log("You can update by running: "+l.default.cyan(`npm i -g ${r.name}`));console.log()}}catch{}}i["default"]=shouldUpdate},9491:r=>{"use strict";r.exports=require("assert")},4300:r=>{"use strict";r.exports=require("buffer")},2081:r=>{"use strict";r.exports=require("child_process")},2361:r=>{"use strict";r.exports=require("events")},7147:r=>{"use strict";r.exports=require("fs")},3685:r=>{"use strict";r.exports=require("http")},5687:r=>{"use strict";r.exports=require("https")},2037:r=>{"use strict";r.exports=require("os")},1017:r=>{"use strict";r.exports=require("path")},4521:r=>{"use strict";r.exports=require("readline")},2781:r=>{"use strict";r.exports=require("stream")},1576:r=>{"use strict";r.exports=require("string_decoder")},9512:r=>{"use strict";r.exports=require("timers")},6224:r=>{"use strict";r.exports=require("tty")},7310:r=>{"use strict";r.exports=require("url")},3837:r=>{"use strict";r.exports=require("util")},4147:r=>{"use strict";r.exports=JSON.parse('{"name":"uri-scheme","version":"1.2.2","description":"Interact with native URI schemes","main":"build/index.js","keywords":["expo","ios","uri-scheme","android"],"repository":{"type":"git","url":"https://github.com/expo/expo.git","directory":"packages/uri-scheme"},"author":"Expo <support@expo.dev>","license":"MIT","bugs":{"url":"https://github.com/expo/expo/issues"},"homepage":"https://github.com/expo/expo/tree/main/packages/uri-scheme#readme","bin":"cli.js","files":["build","cli.js"],"scripts":{"build":"ncc build ./src/index.ts -o build/","build:prod":"ncc build ./src/index.ts -o build/ --minify --no-cache --no-source-map-register","clean":"expo-module clean","lint":"expo-module lint","prepare":"yarn run clean && yarn run build:prod","test":"expo-module test","typecheck":"expo-module typecheck","watch":"yarn run build --watch","prepublishOnly":"expo-module prepublishOnly"},"devDependencies":{"@expo/config-plugins":"^8.0.0","@expo/plist":"^0.1.0","@expo/spawn-async":"^1.7.2","@types/prompts":"^2.0.6","chalk":"^4.0.0","commander":"2.20.0","expo-module-scripts":"^3.3.0","glob":"7.1.6","prompts":"^2.3.2","update-check":"^1.5.4"},"gitHead":"979e9f1fc3cfa9c827700dcf99992e671cfdf63e"}')}};var i={};function __nccwpck_require__(o){var a=i[o];if(a!==undefined){return a.exports}var l=i[o]={id:o,loaded:false,exports:{}};var u=true;try{r[o].call(l.exports,l,l.exports,__nccwpck_require__);u=false}finally{if(u)delete i[o]}l.loaded=true;return l.exports}(()=>{__nccwpck_require__.nmd=r=>{r.paths=[];if(!r.children)r.children=[];return r}})();if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var o=__nccwpck_require__(2855);module.exports=o})();
|