@php-wasm/xdebug-bridge 3.1.4 → 3.1.8
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/cli.cjs +1 -1
- package/cli.js +1 -1
- package/index.cjs +1 -1
- package/index.js +1 -1
- package/package.json +7 -8
- package/{run-cli-BPGRvxlC.cjs → run-cli-DHPcno7N.cjs} +12 -12
- package/{run-cli-zDgiBumC.js → run-cli-EH0Eghg1.js} +584 -578
|
@@ -22,18 +22,18 @@
|
|
|
22
22
|
* @license
|
|
23
23
|
* Copyright (c) 2016, Contributors
|
|
24
24
|
* SPDX-License-Identifier: ISC
|
|
25
|
-
*/let Bt;class As{constructor(t){Bt=t}parse(t,e){const n=Object.assign({alias:void 0,array:void 0,boolean:void 0,config:void 0,configObjects:void 0,configuration:void 0,coerce:void 0,count:void 0,default:void 0,envPrefix:void 0,narg:void 0,normalize:void 0,string:void 0,number:void 0,__:void 0,key:void 0},e),s=Ps(t),i=typeof t=="string",r=Ms(Object.assign(Object.create(null),n.alias)),a=Object.assign({"boolean-negation":!0,"camel-case-expansion":!0,"combine-arrays":!1,"dot-notation":!0,"duplicate-arguments-array":!0,"flatten-duplicate-arrays":!0,"greedy-arrays":!0,"halt-at-non-option":!1,"nargs-eats-options":!1,"negation-prefix":"no-","parse-numbers":!0,"parse-positional-numbers":!0,"populate--":!1,"set-placeholder-key":!1,"short-option-groups":!0,"strip-aliased":!1,"strip-dashed":!1,"unknown-options-as-args":!1},n.configuration),c=Object.assign(Object.create(null),n.default),g=n.configObjects||[],p=n.envPrefix,f=a["populate--"],h=f?"--":"_",b=Object.create(null),O=Object.create(null),D=n.__||Bt.format,w={aliases:Object.create(null),arrays:Object.create(null),bools:Object.create(null),strings:Object.create(null),numbers:Object.create(null),counts:Object.create(null),normalize:Object.create(null),configs:Object.create(null),nargs:Object.create(null),coercions:Object.create(null),keys:[]},A=/^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/,C=new RegExp("^--"+a["negation-prefix"]+"(.+)");[].concat(n.array||[]).filter(Boolean).forEach(function(I){const v=typeof I=="object"?I.key:I,R=Object.keys(I).map(function(S){return{boolean:"bools",string:"strings",number:"numbers"}[S]}).filter(Boolean).pop();R&&(w[R][v]=!0),w.arrays[v]=!0,w.keys.push(v)}),[].concat(n.boolean||[]).filter(Boolean).forEach(function(I){w.bools[I]=!0,w.keys.push(I)}),[].concat(n.string||[]).filter(Boolean).forEach(function(I){w.strings[I]=!0,w.keys.push(I)}),[].concat(n.number||[]).filter(Boolean).forEach(function(I){w.numbers[I]=!0,w.keys.push(I)}),[].concat(n.count||[]).filter(Boolean).forEach(function(I){w.counts[I]=!0,w.keys.push(I)}),[].concat(n.normalize||[]).filter(Boolean).forEach(function(I){w.normalize[I]=!0,w.keys.push(I)}),typeof n.narg=="object"&&Object.entries(n.narg).forEach(([I,v])=>{typeof v=="number"&&(w.nargs[I]=v,w.keys.push(I))}),typeof n.coerce=="object"&&Object.entries(n.coerce).forEach(([I,v])=>{typeof v=="function"&&(w.coercions[I]=v,w.keys.push(I))}),typeof n.config<"u"&&(Array.isArray(n.config)||typeof n.config=="string"?[].concat(n.config).filter(Boolean).forEach(function(I){w.configs[I]=!0}):typeof n.config=="object"&&Object.entries(n.config).forEach(([I,v])=>{(typeof v=="boolean"||typeof v=="function")&&(w.configs[I]=v)})),Rt(n.key,r,n.default,w.arrays),Object.keys(c).forEach(function(I){(w.aliases[I]||[]).forEach(function(v){c[v]=c[I]})});let d=null;ht();let E=[];const T=Object.assign(Object.create(null),{_:[]}),F={};for(let I=0;I<s.length;I++){const v=s[I],R=v.replace(/^-{3,}/,"---");let S,x,W,$,z,pt;if(v!=="--"&&/^-/.test(v)&&l(v))U(v);else if(R.match(/^---+(=|$)/)){U(v);continue}else if(v.match(/^--.+=/)||!a["short-option-groups"]&&v.match(/^-.+=/))$=v.match(/^--?([^=]+)=([\s\S]*)$/),$!==null&&Array.isArray($)&&$.length>=3&&(Q($[1],w.arrays)?I=u(I,$[1],s,$[2]):Q($[1],w.nargs)!==!1?I=j(I,$[1],s,$[2]):M($[1],$[2],!0));else if(v.match(C)&&a["boolean-negation"])$=v.match(C),$!==null&&Array.isArray($)&&$.length>=2&&(x=$[1],M(x,Q(x,w.arrays)?[!1]:!1));else if(v.match(/^--.+/)||!a["short-option-groups"]&&v.match(/^-[^-]+/))$=v.match(/^--?(.+)/),$!==null&&Array.isArray($)&&$.length>=2&&(x=$[1],Q(x,w.arrays)?I=u(I,x,s):Q(x,w.nargs)!==!1?I=j(I,x,s):(z=s[I+1],z!==void 0&&(!z.match(/^-/)||z.match(A))&&!Q(x,w.bools)&&!Q(x,w.counts)||/^(true|false)$/.test(z)?(M(x,z),I++):M(x,_(x))));else if(v.match(/^-.\..+=/))$=v.match(/^-([^=]+)=([\s\S]*)$/),$!==null&&Array.isArray($)&&$.length>=3&&M($[1],$[2]);else if(v.match(/^-.\..+/)&&!v.match(A))z=s[I+1],$=v.match(/^-(.\..+)/),$!==null&&Array.isArray($)&&$.length>=2&&(x=$[1],z!==void 0&&!z.match(/^-/)&&!Q(x,w.bools)&&!Q(x,w.counts)?(M(x,z),I++):M(x,_(x)));else if(v.match(/^-[^-]+/)&&!v.match(A)){W=v.slice(1,-1).split(""),S=!1;for(let gt=0;gt<W.length;gt++){if(z=v.slice(gt+2),W[gt+1]&&W[gt+1]==="="){pt=v.slice(gt+3),x=W[gt],Q(x,w.arrays)?I=u(I,x,s,pt):Q(x,w.nargs)!==!1?I=j(I,x,s,pt):M(x,pt),S=!0;break}if(z==="-"){M(W[gt],z);continue}if(/[A-Za-z]/.test(W[gt])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(z)&&Q(z,w.bools)===!1){M(W[gt],z),S=!0;break}if(W[gt+1]&&W[gt+1].match(/\W/)){M(W[gt],z),S=!0;break}else M(W[gt],_(W[gt]))}x=v.slice(-1)[0],!S&&x!=="-"&&(Q(x,w.arrays)?I=u(I,x,s):Q(x,w.nargs)!==!1?I=j(I,x,s):(z=s[I+1],z!==void 0&&(!/^(-|--)[^-]/.test(z)||z.match(A))&&!Q(x,w.bools)&&!Q(x,w.counts)||/^(true|false)$/.test(z)?(M(x,z),I++):M(x,_(x))))}else if(v.match(/^-[0-9]$/)&&v.match(A)&&Q(v.slice(1),w.bools))x=v.slice(1),M(x,_(x));else if(v==="--"){E=s.slice(I+1);break}else if(a["halt-at-non-option"]){E=s.slice(I);break}else U(v)}q(T,!0),q(T,!1),X(T),k(),st(T,w.aliases,c,!0),at(T),a["set-placeholder-key"]&&Pt(T),Object.keys(w.counts).forEach(function(I){mt(T,I.split("."))||M(I,0)}),f&&E.length&&(T[h]=[]),E.forEach(function(I){T[h].push(I)}),a["camel-case-expansion"]&&a["strip-dashed"]&&Object.keys(T).filter(I=>I!=="--"&&I.includes("-")).forEach(I=>{delete T[I]}),a["strip-aliased"]&&[].concat(...Object.keys(r).map(I=>r[I])).forEach(I=>{a["camel-case-expansion"]&&I.includes("-")&&delete T[I.split(".").map(v=>fe(v)).join(".")],delete T[I]});function U(I){const v=B("_",I);(typeof v=="string"||typeof v=="number")&&T._.push(v)}function j(I,v,R,S){let x,W=Q(v,w.nargs);if(W=typeof W!="number"||isNaN(W)?1:W,W===0)return it(S)||(d=Error(D("Argument unexpected for: %s",v))),M(v,_(v)),I;let $=it(S)?0:1;if(a["nargs-eats-options"])R.length-(I+1)+$<W&&(d=Error(D("Not enough arguments following: %s",v))),$=W;else{for(x=I+1;x<R.length&&(!R[x].match(/^-[^0-9]/)||R[x].match(A)||l(R[x]));x++)$++;$<W&&(d=Error(D("Not enough arguments following: %s",v)))}let z=Math.min($,W);for(!it(S)&&z>0&&(M(v,S),z--),x=I+1;x<z+I+1;x++)M(v,R[x]);return I+z}function u(I,v,R,S){let x=[],W=S||R[I+1];const $=Q(v,w.nargs);if(Q(v,w.bools)&&!/^(true|false)$/.test(W))x.push(!0);else if(it(W)||it(S)&&/^-/.test(W)&&!A.test(W)&&!l(W)){if(c[v]!==void 0){const z=c[v];x=Array.isArray(z)?z:[z]}}else{it(S)||x.push(L(v,S,!0));for(let z=I+1;z<R.length&&!(!a["greedy-arrays"]&&x.length>0||$&&typeof $=="number"&&x.length>=$||(W=R[z],/^-/.test(W)&&!A.test(W)&&!l(W)));z++)I=z,x.push(L(v,W,i))}return typeof $=="number"&&($&&x.length<$||isNaN($)&&x.length===0)&&(d=Error(D("Not enough arguments following: %s",v))),M(v,x),I}function M(I,v,R=i){if(/-/.test(I)&&a["camel-case-expansion"]){const W=I.split(".").map(function($){return fe($)}).join(".");N(I,W)}const S=L(I,v,R),x=I.split(".");wt(T,x,S),w.aliases[I]&&w.aliases[I].forEach(function(W){const $=W.split(".");wt(T,$,S)}),x.length>1&&a["dot-notation"]&&(w.aliases[x[0]]||[]).forEach(function(W){let $=W.split(".");const z=[].concat(x);z.shift(),$=$.concat(z),(w.aliases[I]||[]).includes($.join("."))||wt(T,$,S)}),Q(I,w.normalize)&&!Q(I,w.arrays)&&[I].concat(w.aliases[I]||[]).forEach(function($){Object.defineProperty(F,$,{enumerable:!0,get(){return v},set(z){v=typeof z=="string"?Bt.normalize(z):z}})})}function N(I,v){w.aliases[I]&&w.aliases[I].length||(w.aliases[I]=[v],b[v]=!0),w.aliases[v]&&w.aliases[v].length||N(v,I)}function L(I,v,R){R&&(v=Ls(v)),(Q(I,w.bools)||Q(I,w.counts))&&typeof v=="string"&&(v=v==="true");let S=Array.isArray(v)?v.map(function(x){return B(I,x)}):B(I,v);return Q(I,w.counts)&&(it(S)||typeof S=="boolean")&&(S=Be()),Q(I,w.normalize)&&Q(I,w.arrays)&&(Array.isArray(v)?S=v.map(x=>Bt.normalize(x)):S=Bt.normalize(v)),S}function B(I,v){return!a["parse-positional-numbers"]&&I==="_"||!Q(I,w.strings)&&!Q(I,w.bools)&&!Array.isArray(v)&&(Xr(v)&&a["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${v}`)))||!it(v)&&Q(I,w.numbers))&&(v=Number(v)),v}function X(I){const v=Object.create(null);st(v,w.aliases,c),Object.keys(w.configs).forEach(function(R){const S=I[R]||v[R];if(S)try{let x=null;const W=Bt.resolve(Bt.cwd(),S),$=w.configs[R];if(typeof $=="function"){try{x=$(W)}catch(z){x=z}if(x instanceof Error){d=x;return}}else x=Bt.require(W);Y(x)}catch(x){x.name==="PermissionDenied"?d=x:I[R]&&(d=Error(D("Invalid JSON config file: %s",S)))}})}function Y(I,v){Object.keys(I).forEach(function(R){const S=I[R],x=v?v+"."+R:R;typeof S=="object"&&S!==null&&!Array.isArray(S)&&a["dot-notation"]?Y(S,x):(!mt(T,x.split("."))||Q(x,w.arrays)&&a["combine-arrays"])&&M(x,S)})}function k(){typeof g<"u"&&g.forEach(function(I){Y(I)})}function q(I,v){if(typeof p>"u")return;const R=typeof p=="string"?p:"",S=Bt.env();Object.keys(S).forEach(function(x){if(R===""||x.lastIndexOf(R,0)===0){const W=x.split("__").map(function($,z){return z===0&&($=$.substring(R.length)),fe($)});(v&&w.configs[W.join(".")]||!v)&&!mt(I,W)&&M(W.join("."),S[x])}})}function at(I){let v;const R=new Set;Object.keys(I).forEach(function(S){if(!R.has(S)&&(v=Q(S,w.coercions),typeof v=="function"))try{const x=B(S,v(I[S]));[].concat(w.aliases[S]||[],S).forEach(W=>{R.add(W),I[W]=x})}catch(x){d=x}})}function Pt(I){return w.keys.forEach(v=>{~v.indexOf(".")||typeof I[v]>"u"&&(I[v]=void 0)}),I}function st(I,v,R,S=!1){Object.keys(R).forEach(function(x){mt(I,x.split("."))||(wt(I,x.split("."),R[x]),S&&(O[x]=!0),(v[x]||[]).forEach(function(W){mt(I,W.split("."))||wt(I,W.split("."),R[x])}))})}function mt(I,v){let R=I;a["dot-notation"]||(v=[v.join(".")]),v.slice(0,-1).forEach(function(x){R=R[x]||{}});const S=v[v.length-1];return typeof R!="object"?!1:S in R}function wt(I,v,R){let S=I;a["dot-notation"]||(v=[v.join(".")]),v.slice(0,-1).forEach(function(pt){pt=fi(pt),typeof S=="object"&&S[pt]===void 0&&(S[pt]={}),typeof S[pt]!="object"||Array.isArray(S[pt])?(Array.isArray(S[pt])?S[pt].push({}):S[pt]=[S[pt],{}],S=S[pt][S[pt].length-1]):S=S[pt]});const x=fi(v[v.length-1]),W=Q(v.join("."),w.arrays),$=Array.isArray(R);let z=a["duplicate-arguments-array"];!z&&Q(x,w.nargs)&&(z=!0,(!it(S[x])&&w.nargs[x]===1||Array.isArray(S[x])&&S[x].length===w.nargs[x])&&(S[x]=void 0)),R===Be()?S[x]=Be(S[x]):Array.isArray(S[x])?z&&W&&$?S[x]=a["flatten-duplicate-arrays"]?S[x].concat(R):(Array.isArray(S[x][0])?S[x]:[S[x]]).concat([R]):!z&&!!W==!!$?S[x]=R:S[x]=S[x].concat([R]):S[x]===void 0&&W?S[x]=$?R:[R]:z&&!(S[x]===void 0||Q(x,w.counts)||Q(x,w.bools))?S[x]=[S[x],R]:S[x]=R}function Rt(...I){I.forEach(function(v){Object.keys(v||{}).forEach(function(R){w.aliases[R]||(w.aliases[R]=[].concat(r[R]||[]),w.aliases[R].concat(R).forEach(function(S){if(/-/.test(S)&&a["camel-case-expansion"]){const x=fe(S);x!==R&&w.aliases[R].indexOf(x)===-1&&(w.aliases[R].push(x),b[x]=!0)}}),w.aliases[R].concat(R).forEach(function(S){if(S.length>1&&/[A-Z]/.test(S)&&a["camel-case-expansion"]){const x=Ur(S,"-");x!==R&&w.aliases[R].indexOf(x)===-1&&(w.aliases[R].push(x),b[x]=!0)}}),w.aliases[R].forEach(function(S){w.aliases[S]=[R].concat(w.aliases[R].filter(function(x){return S!==x}))}))})})}function Q(I,v){const R=[].concat(w.aliases[I]||[],I),S=Object.keys(v),x=R.find(W=>S.includes(W));return x?v[x]:!1}function Ht(I){const v=Object.keys(w);return[].concat(v.map(S=>w[S])).some(function(S){return Array.isArray(S)?S.includes(I):S[I]})}function K(I,...v){return[].concat(...v).some(function(S){const x=I.match(S);return x&&Ht(x[1])})}function m(I){if(I.match(A)||!I.match(/^-[^-]+/))return!1;let v=!0,R;const S=I.slice(1).split("");for(let x=0;x<S.length;x++){if(R=I.slice(x+2),!Ht(S[x])){v=!1;break}if(S[x+1]&&S[x+1]==="="||R==="-"||/[A-Za-z]/.test(S[x])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(R)||S[x+1]&&S[x+1].match(/\W/))break}return v}function l(I){return a["unknown-options-as-args"]&&P(I)}function P(I){return I=I.replace(/^-{3,}/,"--"),I.match(A)||m(I)?!1:!K(I,/^-+([^=]+?)=[\s\S]*$/,C,/^-+([^=]+?)$/,/^-+([^=]+?)-$/,/^-+([^=]+?\d+)$/,/^-+([^=]+?)\W+.*$/)}function _(I){return!Q(I,w.bools)&&!Q(I,w.counts)&&`${I}`in c?c[I]:J(nt(I))}function J(I){return{[Mt.BOOLEAN]:!0,[Mt.STRING]:"",[Mt.NUMBER]:void 0,[Mt.ARRAY]:[]}[I]}function nt(I){let v=Mt.BOOLEAN;return Q(I,w.strings)?v=Mt.STRING:Q(I,w.numbers)?v=Mt.NUMBER:Q(I,w.bools)?v=Mt.BOOLEAN:Q(I,w.arrays)&&(v=Mt.ARRAY),v}function it(I){return I===void 0}function ht(){Object.keys(w.counts).find(I=>Q(I,w.arrays)?(d=Error(D("Invalid configuration: %s, opts.count excludes opts.array.",I)),!0):Q(I,w.nargs)?(d=Error(D("Invalid configuration: %s, opts.count excludes opts.narg.",I)),!0):!1)}return{aliases:Object.assign({},w.aliases),argv:Object.assign(F,T),configuration:a,defaulted:Object.assign({},O),error:d,newAliases:Object.assign({},b)}}}function Ms(o){const t=[],e=Object.create(null);let n=!0;for(Object.keys(o).forEach(function(s){t.push([].concat(o[s],s))});n;){n=!1;for(let s=0;s<t.length;s++)for(let i=s+1;i<t.length;i++)if(t[s].filter(function(a){return t[i].indexOf(a)!==-1}).length){t[s]=t[s].concat(t[i]),t.splice(i,1),n=!0;break}}return t.forEach(function(s){s=s.filter(function(r,a,c){return c.indexOf(r)===a});const i=s.pop();i!==void 0&&typeof i=="string"&&(e[i]=s)}),e}function Be(o){return o!==void 0?o+1:1}function fi(o){return o==="__proto__"?"___proto___":o}function Ls(o){return typeof o=="string"&&(o[0]==="'"||o[0]==='"')&&o[o.length-1]===o[0]?o.substring(1,o.length-1):o}/**
|
|
25
|
+
*/let Bt;class As{constructor(t){Bt=t}parse(t,e){const n=Object.assign({alias:void 0,array:void 0,boolean:void 0,config:void 0,configObjects:void 0,configuration:void 0,coerce:void 0,count:void 0,default:void 0,envPrefix:void 0,narg:void 0,normalize:void 0,string:void 0,number:void 0,__:void 0,key:void 0},e),s=Ps(t),i=typeof t=="string",r=Ms(Object.assign(Object.create(null),n.alias)),a=Object.assign({"boolean-negation":!0,"camel-case-expansion":!0,"combine-arrays":!1,"dot-notation":!0,"duplicate-arguments-array":!0,"flatten-duplicate-arrays":!0,"greedy-arrays":!0,"halt-at-non-option":!1,"nargs-eats-options":!1,"negation-prefix":"no-","parse-numbers":!0,"parse-positional-numbers":!0,"populate--":!1,"set-placeholder-key":!1,"short-option-groups":!0,"strip-aliased":!1,"strip-dashed":!1,"unknown-options-as-args":!1},n.configuration),c=Object.assign(Object.create(null),n.default),g=n.configObjects||[],p=n.envPrefix,f=a["populate--"],h=f?"--":"_",b=Object.create(null),O=Object.create(null),D=n.__||Bt.format,w={aliases:Object.create(null),arrays:Object.create(null),bools:Object.create(null),strings:Object.create(null),numbers:Object.create(null),counts:Object.create(null),normalize:Object.create(null),configs:Object.create(null),nargs:Object.create(null),coercions:Object.create(null),keys:[]},A=/^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/,C=new RegExp("^--"+a["negation-prefix"]+"(.+)");[].concat(n.array||[]).filter(Boolean).forEach(function(I){const v=typeof I=="object"?I.key:I,R=Object.keys(I).map(function(S){return{boolean:"bools",string:"strings",number:"numbers"}[S]}).filter(Boolean).pop();R&&(w[R][v]=!0),w.arrays[v]=!0,w.keys.push(v)}),[].concat(n.boolean||[]).filter(Boolean).forEach(function(I){w.bools[I]=!0,w.keys.push(I)}),[].concat(n.string||[]).filter(Boolean).forEach(function(I){w.strings[I]=!0,w.keys.push(I)}),[].concat(n.number||[]).filter(Boolean).forEach(function(I){w.numbers[I]=!0,w.keys.push(I)}),[].concat(n.count||[]).filter(Boolean).forEach(function(I){w.counts[I]=!0,w.keys.push(I)}),[].concat(n.normalize||[]).filter(Boolean).forEach(function(I){w.normalize[I]=!0,w.keys.push(I)}),typeof n.narg=="object"&&Object.entries(n.narg).forEach(([I,v])=>{typeof v=="number"&&(w.nargs[I]=v,w.keys.push(I))}),typeof n.coerce=="object"&&Object.entries(n.coerce).forEach(([I,v])=>{typeof v=="function"&&(w.coercions[I]=v,w.keys.push(I))}),typeof n.config<"u"&&(Array.isArray(n.config)||typeof n.config=="string"?[].concat(n.config).filter(Boolean).forEach(function(I){w.configs[I]=!0}):typeof n.config=="object"&&Object.entries(n.config).forEach(([I,v])=>{(typeof v=="boolean"||typeof v=="function")&&(w.configs[I]=v)})),Rt(n.key,r,n.default,w.arrays),Object.keys(c).forEach(function(I){(w.aliases[I]||[]).forEach(function(v){c[v]=c[I]})});let d=null;ht();let E=[];const T=Object.assign(Object.create(null),{_:[]}),F={};for(let I=0;I<s.length;I++){const v=s[I],R=v.replace(/^-{3,}/,"---");let S,x,W,$,z,pt;if(v!=="--"&&/^-/.test(v)&&u(v))U(v);else if(R.match(/^---+(=|$)/)){U(v);continue}else if(v.match(/^--.+=/)||!a["short-option-groups"]&&v.match(/^-.+=/))$=v.match(/^--?([^=]+)=([\s\S]*)$/),$!==null&&Array.isArray($)&&$.length>=3&&(Q($[1],w.arrays)?I=l(I,$[1],s,$[2]):Q($[1],w.nargs)!==!1?I=j(I,$[1],s,$[2]):M($[1],$[2],!0));else if(v.match(C)&&a["boolean-negation"])$=v.match(C),$!==null&&Array.isArray($)&&$.length>=2&&(x=$[1],M(x,Q(x,w.arrays)?[!1]:!1));else if(v.match(/^--.+/)||!a["short-option-groups"]&&v.match(/^-[^-]+/))$=v.match(/^--?(.+)/),$!==null&&Array.isArray($)&&$.length>=2&&(x=$[1],Q(x,w.arrays)?I=l(I,x,s):Q(x,w.nargs)!==!1?I=j(I,x,s):(z=s[I+1],z!==void 0&&(!z.match(/^-/)||z.match(A))&&!Q(x,w.bools)&&!Q(x,w.counts)||/^(true|false)$/.test(z)?(M(x,z),I++):M(x,_(x))));else if(v.match(/^-.\..+=/))$=v.match(/^-([^=]+)=([\s\S]*)$/),$!==null&&Array.isArray($)&&$.length>=3&&M($[1],$[2]);else if(v.match(/^-.\..+/)&&!v.match(A))z=s[I+1],$=v.match(/^-(.\..+)/),$!==null&&Array.isArray($)&&$.length>=2&&(x=$[1],z!==void 0&&!z.match(/^-/)&&!Q(x,w.bools)&&!Q(x,w.counts)?(M(x,z),I++):M(x,_(x)));else if(v.match(/^-[^-]+/)&&!v.match(A)){W=v.slice(1,-1).split(""),S=!1;for(let gt=0;gt<W.length;gt++){if(z=v.slice(gt+2),W[gt+1]&&W[gt+1]==="="){pt=v.slice(gt+3),x=W[gt],Q(x,w.arrays)?I=l(I,x,s,pt):Q(x,w.nargs)!==!1?I=j(I,x,s,pt):M(x,pt),S=!0;break}if(z==="-"){M(W[gt],z);continue}if(/[A-Za-z]/.test(W[gt])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(z)&&Q(z,w.bools)===!1){M(W[gt],z),S=!0;break}if(W[gt+1]&&W[gt+1].match(/\W/)){M(W[gt],z),S=!0;break}else M(W[gt],_(W[gt]))}x=v.slice(-1)[0],!S&&x!=="-"&&(Q(x,w.arrays)?I=l(I,x,s):Q(x,w.nargs)!==!1?I=j(I,x,s):(z=s[I+1],z!==void 0&&(!/^(-|--)[^-]/.test(z)||z.match(A))&&!Q(x,w.bools)&&!Q(x,w.counts)||/^(true|false)$/.test(z)?(M(x,z),I++):M(x,_(x))))}else if(v.match(/^-[0-9]$/)&&v.match(A)&&Q(v.slice(1),w.bools))x=v.slice(1),M(x,_(x));else if(v==="--"){E=s.slice(I+1);break}else if(a["halt-at-non-option"]){E=s.slice(I);break}else U(v)}q(T,!0),q(T,!1),X(T),k(),st(T,w.aliases,c,!0),at(T),a["set-placeholder-key"]&&Pt(T),Object.keys(w.counts).forEach(function(I){mt(T,I.split("."))||M(I,0)}),f&&E.length&&(T[h]=[]),E.forEach(function(I){T[h].push(I)}),a["camel-case-expansion"]&&a["strip-dashed"]&&Object.keys(T).filter(I=>I!=="--"&&I.includes("-")).forEach(I=>{delete T[I]}),a["strip-aliased"]&&[].concat(...Object.keys(r).map(I=>r[I])).forEach(I=>{a["camel-case-expansion"]&&I.includes("-")&&delete T[I.split(".").map(v=>fe(v)).join(".")],delete T[I]});function U(I){const v=B("_",I);(typeof v=="string"||typeof v=="number")&&T._.push(v)}function j(I,v,R,S){let x,W=Q(v,w.nargs);if(W=typeof W!="number"||isNaN(W)?1:W,W===0)return it(S)||(d=Error(D("Argument unexpected for: %s",v))),M(v,_(v)),I;let $=it(S)?0:1;if(a["nargs-eats-options"])R.length-(I+1)+$<W&&(d=Error(D("Not enough arguments following: %s",v))),$=W;else{for(x=I+1;x<R.length&&(!R[x].match(/^-[^0-9]/)||R[x].match(A)||u(R[x]));x++)$++;$<W&&(d=Error(D("Not enough arguments following: %s",v)))}let z=Math.min($,W);for(!it(S)&&z>0&&(M(v,S),z--),x=I+1;x<z+I+1;x++)M(v,R[x]);return I+z}function l(I,v,R,S){let x=[],W=S||R[I+1];const $=Q(v,w.nargs);if(Q(v,w.bools)&&!/^(true|false)$/.test(W))x.push(!0);else if(it(W)||it(S)&&/^-/.test(W)&&!A.test(W)&&!u(W)){if(c[v]!==void 0){const z=c[v];x=Array.isArray(z)?z:[z]}}else{it(S)||x.push(L(v,S,!0));for(let z=I+1;z<R.length&&!(!a["greedy-arrays"]&&x.length>0||$&&typeof $=="number"&&x.length>=$||(W=R[z],/^-/.test(W)&&!A.test(W)&&!u(W)));z++)I=z,x.push(L(v,W,i))}return typeof $=="number"&&($&&x.length<$||isNaN($)&&x.length===0)&&(d=Error(D("Not enough arguments following: %s",v))),M(v,x),I}function M(I,v,R=i){if(/-/.test(I)&&a["camel-case-expansion"]){const W=I.split(".").map(function($){return fe($)}).join(".");N(I,W)}const S=L(I,v,R),x=I.split(".");wt(T,x,S),w.aliases[I]&&w.aliases[I].forEach(function(W){const $=W.split(".");wt(T,$,S)}),x.length>1&&a["dot-notation"]&&(w.aliases[x[0]]||[]).forEach(function(W){let $=W.split(".");const z=[].concat(x);z.shift(),$=$.concat(z),(w.aliases[I]||[]).includes($.join("."))||wt(T,$,S)}),Q(I,w.normalize)&&!Q(I,w.arrays)&&[I].concat(w.aliases[I]||[]).forEach(function($){Object.defineProperty(F,$,{enumerable:!0,get(){return v},set(z){v=typeof z=="string"?Bt.normalize(z):z}})})}function N(I,v){w.aliases[I]&&w.aliases[I].length||(w.aliases[I]=[v],b[v]=!0),w.aliases[v]&&w.aliases[v].length||N(v,I)}function L(I,v,R){R&&(v=Ls(v)),(Q(I,w.bools)||Q(I,w.counts))&&typeof v=="string"&&(v=v==="true");let S=Array.isArray(v)?v.map(function(x){return B(I,x)}):B(I,v);return Q(I,w.counts)&&(it(S)||typeof S=="boolean")&&(S=Be()),Q(I,w.normalize)&&Q(I,w.arrays)&&(Array.isArray(v)?S=v.map(x=>Bt.normalize(x)):S=Bt.normalize(v)),S}function B(I,v){return!a["parse-positional-numbers"]&&I==="_"||!Q(I,w.strings)&&!Q(I,w.bools)&&!Array.isArray(v)&&(Xr(v)&&a["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${v}`)))||!it(v)&&Q(I,w.numbers))&&(v=Number(v)),v}function X(I){const v=Object.create(null);st(v,w.aliases,c),Object.keys(w.configs).forEach(function(R){const S=I[R]||v[R];if(S)try{let x=null;const W=Bt.resolve(Bt.cwd(),S),$=w.configs[R];if(typeof $=="function"){try{x=$(W)}catch(z){x=z}if(x instanceof Error){d=x;return}}else x=Bt.require(W);Y(x)}catch(x){x.name==="PermissionDenied"?d=x:I[R]&&(d=Error(D("Invalid JSON config file: %s",S)))}})}function Y(I,v){Object.keys(I).forEach(function(R){const S=I[R],x=v?v+"."+R:R;typeof S=="object"&&S!==null&&!Array.isArray(S)&&a["dot-notation"]?Y(S,x):(!mt(T,x.split("."))||Q(x,w.arrays)&&a["combine-arrays"])&&M(x,S)})}function k(){typeof g<"u"&&g.forEach(function(I){Y(I)})}function q(I,v){if(typeof p>"u")return;const R=typeof p=="string"?p:"",S=Bt.env();Object.keys(S).forEach(function(x){if(R===""||x.lastIndexOf(R,0)===0){const W=x.split("__").map(function($,z){return z===0&&($=$.substring(R.length)),fe($)});(v&&w.configs[W.join(".")]||!v)&&!mt(I,W)&&M(W.join("."),S[x])}})}function at(I){let v;const R=new Set;Object.keys(I).forEach(function(S){if(!R.has(S)&&(v=Q(S,w.coercions),typeof v=="function"))try{const x=B(S,v(I[S]));[].concat(w.aliases[S]||[],S).forEach(W=>{R.add(W),I[W]=x})}catch(x){d=x}})}function Pt(I){return w.keys.forEach(v=>{~v.indexOf(".")||typeof I[v]>"u"&&(I[v]=void 0)}),I}function st(I,v,R,S=!1){Object.keys(R).forEach(function(x){mt(I,x.split("."))||(wt(I,x.split("."),R[x]),S&&(O[x]=!0),(v[x]||[]).forEach(function(W){mt(I,W.split("."))||wt(I,W.split("."),R[x])}))})}function mt(I,v){let R=I;a["dot-notation"]||(v=[v.join(".")]),v.slice(0,-1).forEach(function(x){R=R[x]||{}});const S=v[v.length-1];return typeof R!="object"?!1:S in R}function wt(I,v,R){let S=I;a["dot-notation"]||(v=[v.join(".")]),v.slice(0,-1).forEach(function(pt){pt=fi(pt),typeof S=="object"&&S[pt]===void 0&&(S[pt]={}),typeof S[pt]!="object"||Array.isArray(S[pt])?(Array.isArray(S[pt])?S[pt].push({}):S[pt]=[S[pt],{}],S=S[pt][S[pt].length-1]):S=S[pt]});const x=fi(v[v.length-1]),W=Q(v.join("."),w.arrays),$=Array.isArray(R);let z=a["duplicate-arguments-array"];!z&&Q(x,w.nargs)&&(z=!0,(!it(S[x])&&w.nargs[x]===1||Array.isArray(S[x])&&S[x].length===w.nargs[x])&&(S[x]=void 0)),R===Be()?S[x]=Be(S[x]):Array.isArray(S[x])?z&&W&&$?S[x]=a["flatten-duplicate-arrays"]?S[x].concat(R):(Array.isArray(S[x][0])?S[x]:[S[x]]).concat([R]):!z&&!!W==!!$?S[x]=R:S[x]=S[x].concat([R]):S[x]===void 0&&W?S[x]=$?R:[R]:z&&!(S[x]===void 0||Q(x,w.counts)||Q(x,w.bools))?S[x]=[S[x],R]:S[x]=R}function Rt(...I){I.forEach(function(v){Object.keys(v||{}).forEach(function(R){w.aliases[R]||(w.aliases[R]=[].concat(r[R]||[]),w.aliases[R].concat(R).forEach(function(S){if(/-/.test(S)&&a["camel-case-expansion"]){const x=fe(S);x!==R&&w.aliases[R].indexOf(x)===-1&&(w.aliases[R].push(x),b[x]=!0)}}),w.aliases[R].concat(R).forEach(function(S){if(S.length>1&&/[A-Z]/.test(S)&&a["camel-case-expansion"]){const x=Ur(S,"-");x!==R&&w.aliases[R].indexOf(x)===-1&&(w.aliases[R].push(x),b[x]=!0)}}),w.aliases[R].forEach(function(S){w.aliases[S]=[R].concat(w.aliases[R].filter(function(x){return S!==x}))}))})})}function Q(I,v){const R=[].concat(w.aliases[I]||[],I),S=Object.keys(v),x=R.find(W=>S.includes(W));return x?v[x]:!1}function Ht(I){const v=Object.keys(w);return[].concat(v.map(S=>w[S])).some(function(S){return Array.isArray(S)?S.includes(I):S[I]})}function K(I,...v){return[].concat(...v).some(function(S){const x=I.match(S);return x&&Ht(x[1])})}function m(I){if(I.match(A)||!I.match(/^-[^-]+/))return!1;let v=!0,R;const S=I.slice(1).split("");for(let x=0;x<S.length;x++){if(R=I.slice(x+2),!Ht(S[x])){v=!1;break}if(S[x+1]&&S[x+1]==="="||R==="-"||/[A-Za-z]/.test(S[x])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(R)||S[x+1]&&S[x+1].match(/\W/))break}return v}function u(I){return a["unknown-options-as-args"]&&P(I)}function P(I){return I=I.replace(/^-{3,}/,"--"),I.match(A)||m(I)?!1:!K(I,/^-+([^=]+?)=[\s\S]*$/,C,/^-+([^=]+?)$/,/^-+([^=]+?)-$/,/^-+([^=]+?\d+)$/,/^-+([^=]+?)\W+.*$/)}function _(I){return!Q(I,w.bools)&&!Q(I,w.counts)&&`${I}`in c?c[I]:J(nt(I))}function J(I){return{[Mt.BOOLEAN]:!0,[Mt.STRING]:"",[Mt.NUMBER]:void 0,[Mt.ARRAY]:[]}[I]}function nt(I){let v=Mt.BOOLEAN;return Q(I,w.strings)?v=Mt.STRING:Q(I,w.numbers)?v=Mt.NUMBER:Q(I,w.bools)?v=Mt.BOOLEAN:Q(I,w.arrays)&&(v=Mt.ARRAY),v}function it(I){return I===void 0}function ht(){Object.keys(w.counts).find(I=>Q(I,w.arrays)?(d=Error(D("Invalid configuration: %s, opts.count excludes opts.array.",I)),!0):Q(I,w.nargs)?(d=Error(D("Invalid configuration: %s, opts.count excludes opts.narg.",I)),!0):!1)}return{aliases:Object.assign({},w.aliases),argv:Object.assign(F,T),configuration:a,defaulted:Object.assign({},O),error:d,newAliases:Object.assign({},b)}}}function Ms(o){const t=[],e=Object.create(null);let n=!0;for(Object.keys(o).forEach(function(s){t.push([].concat(o[s],s))});n;){n=!1;for(let s=0;s<t.length;s++)for(let i=s+1;i<t.length;i++)if(t[s].filter(function(a){return t[i].indexOf(a)!==-1}).length){t[s]=t[s].concat(t[i]),t.splice(i,1),n=!0;break}}return t.forEach(function(s){s=s.filter(function(r,a,c){return c.indexOf(r)===a});const i=s.pop();i!==void 0&&typeof i=="string"&&(e[i]=s)}),e}function Be(o){return o!==void 0?o+1:1}function fi(o){return o==="__proto__"?"___proto___":o}function Ls(o){return typeof o=="string"&&(o[0]==="'"||o[0]==='"')&&o[o.length-1]===o[0]?o.substring(1,o.length-1):o}/**
|
|
26
26
|
* @fileoverview Main entrypoint for libraries using yargs-parser in Node.js
|
|
27
27
|
* CJS and ESM environments.
|
|
28
28
|
*
|
|
29
29
|
* @license
|
|
30
30
|
* Copyright (c) 2016, Contributors
|
|
31
31
|
* SPDX-License-Identifier: ISC
|
|
32
|
-
*/var Ue,Xe,$e;const hi=process&&process.env&&process.env.YARGS_MIN_NODE_VERSION?Number(process.env.YARGS_MIN_NODE_VERSION):12,pi=(Xe=(Ue=process==null?void 0:process.versions)===null||Ue===void 0?void 0:Ue.node)!==null&&Xe!==void 0?Xe:($e=process==null?void 0:process.version)===null||$e===void 0?void 0:$e.slice(1);if(pi&&Number(pi.match(/^([^.]+)/)[1])<hi)throw Error(`yargs parser supports a minimum Node.js version of ${hi}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`);const Ss=process?process.env:{},$r=new As({cwd:process.cwd,env:()=>Ss,format:Xn.format,normalize:bt.normalize,resolve:bt.resolve,require:o=>{if(typeof require<"u")return require(o);if(o.match(/\.json$/))return JSON.parse(Ft.readFileSync(o,"utf8"));throw Error("only .json config files are supported in ESM")}}),we=function(t,e){return $r.parse(t.slice(),e).argv};we.detailed=function(o,t){return $r.parse(o.slice(),t)};we.camelCase=fe;we.decamelize=Ur;we.looksLikeNumber=Xr;function qr(){return js()?0:1}function js(){return Fs()&&!process.defaultApp}function Fs(){return!!process.versions.electron}function Rs(o){return o.slice(qr()+1)}function Bs(){return process.argv[qr()]}class ut extends Error{constructor(t){super(t||"yargs error"),this.name="YError",Error.captureStackTrace&&Error.captureStackTrace(this,ut)}}const Us={fs:{readFileSync:Ft.readFileSync,writeFile:Ft.writeFile},format:Xn.format,resolve:bt.resolve,exists:o=>{try{return Ft.statSync(o).isFile()}catch{return!1}}};let At;class Xs{constructor(t){t=t||{},this.directory=t.directory||"./locales",this.updateFiles=typeof t.updateFiles=="boolean"?t.updateFiles:!0,this.locale=t.locale||"en",this.fallbackToLanguage=typeof t.fallbackToLanguage=="boolean"?t.fallbackToLanguage:!0,this.cache=Object.create(null),this.writeQueue=[]}__(...t){if(typeof arguments[0]!="string")return this._taggedLiteral(arguments[0],...arguments);const e=t.shift();let n=function(){};return typeof t[t.length-1]=="function"&&(n=t.pop()),n=n||function(){},this.cache[this.locale]||this._readLocaleFile(),!this.cache[this.locale][e]&&this.updateFiles?(this.cache[this.locale][e]=e,this._enqueueWrite({directory:this.directory,locale:this.locale,cb:n})):n(),At.format.apply(At.format,[this.cache[this.locale][e]||e].concat(t))}__n(){const t=Array.prototype.slice.call(arguments),e=t.shift(),n=t.shift(),s=t.shift();let i=function(){};typeof t[t.length-1]=="function"&&(i=t.pop()),this.cache[this.locale]||this._readLocaleFile();let r=s===1?e:n;this.cache[this.locale][e]&&(r=this.cache[this.locale][e][s===1?"one":"other"]),!this.cache[this.locale][e]&&this.updateFiles?(this.cache[this.locale][e]={one:e,other:n},this._enqueueWrite({directory:this.directory,locale:this.locale,cb:i})):i();const a=[r];return~r.indexOf("%d")&&a.push(s),At.format.apply(At.format,a.concat(t))}setLocale(t){this.locale=t}getLocale(){return this.locale}updateLocale(t){this.cache[this.locale]||this._readLocaleFile();for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&(this.cache[this.locale][e]=t[e])}_taggedLiteral(t,...e){let n="";return t.forEach(function(s,i){const r=e[i+1];n+=s,typeof r<"u"&&(n+="%s")}),this.__.apply(this,[n].concat([].slice.call(e,1)))}_enqueueWrite(t){this.writeQueue.push(t),this.writeQueue.length===1&&this._processWriteQueue()}_processWriteQueue(){const t=this,e=this.writeQueue[0],n=e.directory,s=e.locale,i=e.cb,r=this._resolveLocaleFile(n,s),a=JSON.stringify(this.cache[s],null,2);At.fs.writeFile(r,a,"utf-8",function(c){t.writeQueue.shift(),t.writeQueue.length>0&&t._processWriteQueue(),i(c)})}_readLocaleFile(){let t={};const e=this._resolveLocaleFile(this.directory,this.locale);try{At.fs.readFileSync&&(t=JSON.parse(At.fs.readFileSync(e,"utf-8")))}catch(n){if(n instanceof SyntaxError&&(n.message="syntax error in "+e),n.code==="ENOENT")t={};else throw n}this.cache[this.locale]=t}_resolveLocaleFile(t,e){let n=At.resolve(t,"./",e+".json");if(this.fallbackToLanguage&&!this._fileExistsSync(n)&&~e.lastIndexOf("_")){const s=At.resolve(t,"./",e.split("_")[0]+".json");this._fileExistsSync(s)&&(n=s)}return n}_fileExistsSync(t){return At.exists(t)}}function $s(o,t){At=t;const e=new Xs(o);return{__:e.__.bind(e),__n:e.__n.bind(e),setLocale:e.setLocale.bind(e),getLocale:e.getLocale.bind(e),updateLocale:e.updateLocale.bind(e),locale:e.locale}}const qs=o=>$s(o,Us),Ws="require is not supported by ESM",di="loading a directory of commands is not supported yet for ESM";let ye;try{ye=es.fileURLToPath(typeof document>"u"?require("url").pathToFileURL(__filename).href:Re&&Re.tagName.toUpperCase()==="SCRIPT"&&Re.src||new URL("run-cli-BPGRvxlC.cjs",document.baseURI).href)}catch{ye=process.cwd()}const Vs=ye.substring(0,ye.lastIndexOf("node_modules")),Hs={assert:{notStrictEqual:si.notStrictEqual,strictEqual:si.strictEqual},cliui:xs,findUp:Ns,getEnv:o=>process.env[o],inspect:Xn.inspect,getCallerFile:()=>{throw new ut(di)},getProcessArgvBin:Bs,mainFilename:Vs||process.cwd(),Parser:we,path:{basename:bt.basename,dirname:bt.dirname,extname:bt.extname,relative:bt.relative,resolve:bt.resolve},process:{argv:()=>process.argv,cwd:process.cwd,emitWarning:(o,t)=>process.emitWarning(o,t),execPath:()=>process.execPath,exit:process.exit,nextTick:process.nextTick,stdColumns:typeof process.stdout.columns<"u"?process.stdout.columns:null},readFileSync:Ft.readFileSync,require:()=>{throw new ut(Ws)},requireDirectory:()=>{throw new ut(di)},stringWidth:o=>[...o].length,y18n:qs({directory:bt.resolve(ye,"../../../locales"),updateFiles:!1})};function Lt(o,t,e,n){e.assert.notStrictEqual(o,t,n)}function mi(o,t){t.assert.strictEqual(typeof o,"string")}function Le(o){return Object.keys(o)}function lt(o){return!!o&&!!o.then&&typeof o.then=="function"}function de(o){const e=o.replace(/\s{2,}/g," ").split(/\s+(?![^[]*]|[^<]*>)/),n=/\.*[\][<>]/g,s=e.shift();if(!s)throw new Error(`No command found in: ${o}`);const i={cmd:s.replace(n,""),demanded:[],optional:[]};return e.forEach((r,a)=>{let c=!1;r=r.replace(/\s/g,""),/\.+[\]>]/.test(r)&&a===e.length-1&&(c=!0),/^\[/.test(r)?i.optional.push({cmd:r.replace(n,"").split("|"),variadic:c}):i.demanded.push({cmd:r.replace(n,"").split("|"),variadic:c})}),i}const zs=["first","second","third","fourth","fifth","sixth"];function H(o,t,e){function n(){return typeof o=="object"?[{demanded:[],optional:[]},o,t]:[de(`cmd ${o}`),t,e]}try{let s=0;const[i,r,a]=n(),c=[].slice.call(r);for(;c.length&&c[c.length-1]===void 0;)c.pop();const g=a||c.length;if(g<i.demanded.length)throw new ut(`Not enough arguments provided. Expected ${i.demanded.length} but received ${c.length}.`);const p=i.demanded.length+i.optional.length;if(g>p)throw new ut(`Too many arguments provided. Expected max ${p} but received ${g}.`);i.demanded.forEach(f=>{const h=c.shift(),b=gi(h);f.cmd.filter(D=>D===b||D==="*").length===0&&yi(b,f.cmd,s),s+=1}),i.optional.forEach(f=>{if(c.length===0)return;const h=c.shift(),b=gi(h);f.cmd.filter(D=>D===b||D==="*").length===0&&yi(b,f.cmd,s),s+=1})}catch(s){console.warn(s.stack)}}function gi(o){return Array.isArray(o)?"array":o===null?"null":typeof o}function yi(o,t,e){throw new ut(`Invalid ${zs[e]||"manyith"} argument. Expected ${t.join(" or ")} but received ${o}.`)}class Gs{constructor(t){this.globalMiddleware=[],this.frozens=[],this.yargs=t}addMiddleware(t,e,n=!0,s=!1){if(H("<array|function> [boolean] [boolean] [boolean]",[t,e,n],arguments.length),Array.isArray(t)){for(let i=0;i<t.length;i++){if(typeof t[i]!="function")throw Error("middleware must be a function");const r=t[i];r.applyBeforeValidation=e,r.global=n}Array.prototype.push.apply(this.globalMiddleware,t)}else if(typeof t=="function"){const i=t;i.applyBeforeValidation=e,i.global=n,i.mutates=s,this.globalMiddleware.push(t)}return this.yargs}addCoerceMiddleware(t,e){const n=this.yargs.getAliases();return this.globalMiddleware=this.globalMiddleware.filter(s=>{const i=[...n[e]||[],e];return s.option?!i.includes(s.option):!0}),t.option=e,this.addMiddleware(t,!0,!0,!0)}getMiddleware(){return this.globalMiddleware}freeze(){this.frozens.push([...this.globalMiddleware])}unfreeze(){const t=this.frozens.pop();t!==void 0&&(this.globalMiddleware=t)}reset(){this.globalMiddleware=this.globalMiddleware.filter(t=>t.global)}}function Ys(o){return o?o.map(t=>(t.applyBeforeValidation=!1,t)):[]}function me(o,t,e,n){return e.reduce((s,i)=>{if(i.applyBeforeValidation!==n)return s;if(i.mutates){if(i.applied)return s;i.applied=!0}if(lt(s))return s.then(r=>Promise.all([r,i(r,t)])).then(([r,a])=>Object.assign(r,a));{const r=i(s,t);return lt(r)?r.then(a=>Object.assign(s,a)):Object.assign(s,r)}},o)}function ge(o,t,e=n=>{throw n}){try{const n=ks(o)?o():o;return lt(n)?n.then(s=>t(s)):t(n)}catch(n){return e(n)}}function ks(o){return typeof o=="function"}function Ks(o){if(typeof require>"u")return null;for(let t=0,e=Object.keys(require.cache),n;t<e.length;t++)if(n=require.cache[e[t]],n.exports===o)return n;return null}const ie=/(^\*)|(^\$0)/;class Qs{constructor(t,e,n,s){this.requireCache=new Set,this.handlers={},this.aliasMap={},this.frozens=[],this.shim=s,this.usage=t,this.globalMiddleware=n,this.validation=e}addDirectory(t,e,n,s){s=s||{},typeof s.recurse!="boolean"&&(s.recurse=!1),Array.isArray(s.extensions)||(s.extensions=["js"]);const i=typeof s.visit=="function"?s.visit:r=>r;s.visit=(r,a,c)=>{const g=i(r,a,c);if(g){if(this.requireCache.has(a))return g;this.requireCache.add(a),this.addHandler(g)}return g},this.shim.requireDirectory({require:e,filename:n},t,s)}addHandler(t,e,n,s,i,r){let a=[];const c=Ys(i);if(s=s||(()=>{}),Array.isArray(t))if(Zs(t))[t,...a]=t;else for(const g of t)this.addHandler(g);else if(eo(t)){let g=Array.isArray(t.command)||typeof t.command=="string"?t.command:this.moduleName(t);t.aliases&&(g=[].concat(g).concat(t.aliases)),this.addHandler(g,this.extractDesc(t),t.builder,t.handler,t.middlewares,t.deprecated);return}else if(bi(n)){this.addHandler([t].concat(a),e,n.builder,n.handler,n.middlewares,n.deprecated);return}if(typeof t=="string"){const g=de(t);a=a.map(h=>de(h).cmd);let p=!1;const f=[g.cmd].concat(a).filter(h=>ie.test(h)?(p=!0,!1):!0);f.length===0&&p&&f.push("$0"),p&&(g.cmd=f[0],a=f.slice(1),t=t.replace(ie,g.cmd)),a.forEach(h=>{this.aliasMap[h]=g.cmd}),e!==!1&&this.usage.command(t,e,p,a,r),this.handlers[g.cmd]={original:t,description:e,handler:s,builder:n||{},middlewares:c,deprecated:r,demanded:g.demanded,optional:g.optional},p&&(this.defaultCommand=this.handlers[g.cmd])}}getCommandHandlers(){return this.handlers}getCommands(){return Object.keys(this.handlers).concat(Object.keys(this.aliasMap))}hasDefaultCommand(){return!!this.defaultCommand}runCommand(t,e,n,s,i,r){const a=this.handlers[t]||this.handlers[this.aliasMap[t]]||this.defaultCommand,c=e.getInternalMethods().getContext(),g=c.commands.slice(),p=!t;t&&(c.commands.push(t),c.fullCommands.push(a.original));const f=this.applyBuilderUpdateUsageAndParse(p,a,e,n.aliases,g,s,i,r);return lt(f)?f.then(h=>this.applyMiddlewareAndGetResult(p,a,h.innerArgv,c,i,h.aliases,e)):this.applyMiddlewareAndGetResult(p,a,f.innerArgv,c,i,f.aliases,e)}applyBuilderUpdateUsageAndParse(t,e,n,s,i,r,a,c){const g=e.builder;let p=n;if(Rn(g)){n.getInternalMethods().getUsageInstance().freeze();const f=g(n.getInternalMethods().reset(s),c);if(lt(f))return f.then(h=>(p=bo(h)?h:n,this.parseAndUpdateUsage(t,e,p,i,r,a)))}else to(g)&&(n.getInternalMethods().getUsageInstance().freeze(),p=n.getInternalMethods().reset(s),Object.keys(e.builder).forEach(f=>{p.option(f,g[f])}));return this.parseAndUpdateUsage(t,e,p,i,r,a)}parseAndUpdateUsage(t,e,n,s,i,r){t&&n.getInternalMethods().getUsageInstance().unfreeze(!0),this.shouldUpdateUsage(n)&&n.getInternalMethods().getUsageInstance().usage(this.usageFromParentCommandsCommandHandler(s,e),e.description);const a=n.getInternalMethods().runYargsParserAndExecuteCommands(null,void 0,!0,i,r);return lt(a)?a.then(c=>({aliases:n.parsed.aliases,innerArgv:c})):{aliases:n.parsed.aliases,innerArgv:a}}shouldUpdateUsage(t){return!t.getInternalMethods().getUsageInstance().getUsageDisabled()&&t.getInternalMethods().getUsageInstance().getUsage().length===0}usageFromParentCommandsCommandHandler(t,e){const n=ie.test(e.original)?e.original.replace(ie,"").trim():e.original,s=t.filter(i=>!ie.test(i));return s.push(n),`$0 ${s.join(" ")}`}handleValidationAndGetResult(t,e,n,s,i,r,a,c){if(!r.getInternalMethods().getHasOutput()){const g=r.getInternalMethods().runValidation(i,c,r.parsed.error,t);n=ge(n,p=>(g(p),p))}if(e.handler&&!r.getInternalMethods().getHasOutput()){r.getInternalMethods().setHasOutput();const g=!!r.getOptions().configuration["populate--"];r.getInternalMethods().postProcess(n,g,!1,!1),n=me(n,r,a,!1),n=ge(n,p=>{const f=e.handler(p);return lt(f)?f.then(()=>p):p}),t||r.getInternalMethods().getUsageInstance().cacheHelpMessage(),lt(n)&&!r.getInternalMethods().hasParseCallback()&&n.catch(p=>{try{r.getInternalMethods().getUsageInstance().fail(null,p)}catch{}})}return t||(s.commands.pop(),s.fullCommands.pop()),n}applyMiddlewareAndGetResult(t,e,n,s,i,r,a){let c={};if(i)return n;a.getInternalMethods().getHasOutput()||(c=this.populatePositionals(e,n,s,a));const g=this.globalMiddleware.getMiddleware().slice(0).concat(e.middlewares),p=me(n,a,g,!0);return lt(p)?p.then(f=>this.handleValidationAndGetResult(t,e,f,s,r,a,g,c)):this.handleValidationAndGetResult(t,e,p,s,r,a,g,c)}populatePositionals(t,e,n,s){e._=e._.slice(n.commands.length);const i=t.demanded.slice(0),r=t.optional.slice(0),a={};for(this.validation.positionalCount(i.length,e._.length);i.length;){const c=i.shift();this.populatePositional(c,e,a)}for(;r.length;){const c=r.shift();this.populatePositional(c,e,a)}return e._=n.commands.concat(e._.map(c=>""+c)),this.postProcessPositionals(e,a,this.cmdToParseOptions(t.original),s),a}populatePositional(t,e,n){const s=t.cmd[0];t.variadic?n[s]=e._.splice(0).map(String):e._.length&&(n[s]=[String(e._.shift())])}cmdToParseOptions(t){const e={array:[],default:{},alias:{},demand:{}},n=de(t);return n.demanded.forEach(s=>{const[i,...r]=s.cmd;s.variadic&&(e.array.push(i),e.default[i]=[]),e.alias[i]=r,e.demand[i]=!0}),n.optional.forEach(s=>{const[i,...r]=s.cmd;s.variadic&&(e.array.push(i),e.default[i]=[]),e.alias[i]=r}),e}postProcessPositionals(t,e,n,s){const i=Object.assign({},s.getOptions());i.default=Object.assign(n.default,i.default);for(const g of Object.keys(n.alias))i.alias[g]=(i.alias[g]||[]).concat(n.alias[g]);i.array=i.array.concat(n.array),i.config={};const r=[];if(Object.keys(e).forEach(g=>{e[g].map(p=>{i.configuration["unknown-options-as-args"]&&(i.key[g]=!0),r.push(`--${g}`),r.push(p)})}),!r.length)return;const a=Object.assign({},i.configuration,{"populate--":!1}),c=this.shim.Parser.detailed(r,Object.assign({},i,{configuration:a}));if(c.error)s.getInternalMethods().getUsageInstance().fail(c.error.message,c.error);else{const g=Object.keys(e);Object.keys(e).forEach(p=>{g.push(...c.aliases[p])}),Object.keys(c.argv).forEach(p=>{g.includes(p)&&(e[p]||(e[p]=c.argv[p]),!this.isInConfigs(s,p)&&!this.isDefaulted(s,p)&&Object.prototype.hasOwnProperty.call(t,p)&&Object.prototype.hasOwnProperty.call(c.argv,p)&&(Array.isArray(t[p])||Array.isArray(c.argv[p]))?t[p]=[].concat(t[p],c.argv[p]):t[p]=c.argv[p])})}}isDefaulted(t,e){const{default:n}=t.getOptions();return Object.prototype.hasOwnProperty.call(n,e)||Object.prototype.hasOwnProperty.call(n,this.shim.Parser.camelCase(e))}isInConfigs(t,e){const{configObjects:n}=t.getOptions();return n.some(s=>Object.prototype.hasOwnProperty.call(s,e))||n.some(s=>Object.prototype.hasOwnProperty.call(s,this.shim.Parser.camelCase(e)))}runDefaultBuilderOn(t){if(!this.defaultCommand)return;if(this.shouldUpdateUsage(t)){const n=ie.test(this.defaultCommand.original)?this.defaultCommand.original:this.defaultCommand.original.replace(/^[^[\]<>]*/,"$0 ");t.getInternalMethods().getUsageInstance().usage(n,this.defaultCommand.description)}const e=this.defaultCommand.builder;if(Rn(e))return e(t,!0);bi(e)||Object.keys(e).forEach(n=>{t.option(n,e[n])})}moduleName(t){const e=Ks(t);if(!e)throw new Error(`No command name given for module: ${this.shim.inspect(t)}`);return this.commandFromFilename(e.filename)}commandFromFilename(t){return this.shim.path.basename(t,this.shim.path.extname(t))}extractDesc({describe:t,description:e,desc:n}){for(const s of[t,e,n]){if(typeof s=="string"||s===!1)return s;Lt(s,!0,this.shim)}return!1}freeze(){this.frozens.push({handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand})}unfreeze(){const t=this.frozens.pop();Lt(t,void 0,this.shim),{handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand}=t}reset(){return this.handlers={},this.aliasMap={},this.defaultCommand=void 0,this.requireCache=new Set,this}}function Js(o,t,e,n){return new Qs(o,t,e,n)}function bi(o){return typeof o=="object"&&!!o.builder&&typeof o.handler=="function"}function Zs(o){return o.every(t=>typeof t=="string")}function Rn(o){return typeof o=="function"}function to(o){return typeof o=="object"}function eo(o){return typeof o=="object"&&!Array.isArray(o)}function be(o={},t=()=>!0){const e={};return Le(o).forEach(n=>{t(n,o[n])&&(e[n]=o[n])}),e}function he(o){typeof process>"u"||[process.stdout,process.stderr].forEach(t=>{const e=t;e._handle&&e.isTTY&&typeof e._handle.setBlocking=="function"&&e._handle.setBlocking(o)})}function no(o){return typeof o=="boolean"}function io(o,t){const e=t.y18n.__,n={},s=[];n.failFn=function(L){s.push(L)};let i=null,r=null,a=!0;n.showHelpOnFail=function(L=!0,B){const[X,Y]=typeof L=="string"?[!0,L]:[L,B];return o.getInternalMethods().isGlobalContext()&&(r=Y),i=Y,a=X,n};let c=!1;n.fail=function(L,B){const X=o.getInternalMethods().getLoggerInstance();if(s.length)for(let Y=s.length-1;Y>=0;--Y){const k=s[Y];if(no(k)){if(B)throw B;if(L)throw Error(L)}else k(L,B,n)}else{if(o.getExitProcess()&&he(!0),!c){c=!0,a&&(o.showHelp("error"),X.error()),(L||B)&&X.error(L||B);const Y=i||r;Y&&((L||B)&&X.error(""),X.error(Y))}if(B=B||new ut(L),o.getExitProcess())return o.exit(1);if(o.getInternalMethods().hasParseCallback())return o.exit(1,B);throw B}};let g=[],p=!1;n.usage=(N,L)=>N===null?(p=!0,g=[],n):(p=!1,g.push([N,L||""]),n),n.getUsage=()=>g,n.getUsageDisabled=()=>p,n.getPositionalGroupName=()=>e("Positionals:");let f=[];n.example=(N,L)=>{f.push([N,L||""])};let h=[];n.command=function(L,B,X,Y,k=!1){X&&(h=h.map(q=>(q[2]=!1,q))),h.push([L,B||"",X,Y,k])},n.getCommands=()=>h;let b={};n.describe=function(L,B){Array.isArray(L)?L.forEach(X=>{n.describe(X,B)}):typeof L=="object"?Object.keys(L).forEach(X=>{n.describe(X,L[X])}):b[L]=B},n.getDescriptions=()=>b;let O=[];n.epilog=N=>{O.push(N)};let D=!1,w;n.wrap=N=>{D=!0,w=N},n.getWrap=()=>t.getEnv("YARGS_DISABLE_WRAP")?null:(D||(w=j(),D=!0),w);const A="__yargsString__:";n.deferY18nLookup=N=>A+N,n.help=function(){if(E)return E;d();const L=o.customScriptName?o.$0:t.path.basename(o.$0),B=o.getDemandedOptions(),X=o.getDemandedCommands(),Y=o.getDeprecatedOptions(),k=o.getGroups(),q=o.getOptions();let at=[];at=at.concat(Object.keys(b)),at=at.concat(Object.keys(B)),at=at.concat(Object.keys(X)),at=at.concat(Object.keys(q.default)),at=at.filter(F),at=Object.keys(at.reduce((K,m)=>(m!=="_"&&(K[m]=!0),K),{}));const Pt=n.getWrap(),st=t.cliui({width:Pt,wrap:!!Pt});if(!p){if(g.length)g.forEach(K=>{st.div({text:`${K[0].replace(/\$0/g,L)}`}),K[1]&&st.div({text:`${K[1]}`,padding:[1,0,0,0]})}),st.div();else if(h.length){let K=null;X._?K=`${L} <${e("command")}>
|
|
32
|
+
*/var Ue,Xe,$e;const hi=process&&process.env&&process.env.YARGS_MIN_NODE_VERSION?Number(process.env.YARGS_MIN_NODE_VERSION):12,pi=(Xe=(Ue=process==null?void 0:process.versions)===null||Ue===void 0?void 0:Ue.node)!==null&&Xe!==void 0?Xe:($e=process==null?void 0:process.version)===null||$e===void 0?void 0:$e.slice(1);if(pi&&Number(pi.match(/^([^.]+)/)[1])<hi)throw Error(`yargs parser supports a minimum Node.js version of ${hi}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`);const Ss=process?process.env:{},$r=new As({cwd:process.cwd,env:()=>Ss,format:Xn.format,normalize:bt.normalize,resolve:bt.resolve,require:o=>{if(typeof require<"u")return require(o);if(o.match(/\.json$/))return JSON.parse(Ft.readFileSync(o,"utf8"));throw Error("only .json config files are supported in ESM")}}),we=function(t,e){return $r.parse(t.slice(),e).argv};we.detailed=function(o,t){return $r.parse(o.slice(),t)};we.camelCase=fe;we.decamelize=Ur;we.looksLikeNumber=Xr;function qr(){return js()?0:1}function js(){return Fs()&&!process.defaultApp}function Fs(){return!!process.versions.electron}function Rs(o){return o.slice(qr()+1)}function Bs(){return process.argv[qr()]}class ut extends Error{constructor(t){super(t||"yargs error"),this.name="YError",Error.captureStackTrace&&Error.captureStackTrace(this,ut)}}const Us={fs:{readFileSync:Ft.readFileSync,writeFile:Ft.writeFile},format:Xn.format,resolve:bt.resolve,exists:o=>{try{return Ft.statSync(o).isFile()}catch{return!1}}};let At;class Xs{constructor(t){t=t||{},this.directory=t.directory||"./locales",this.updateFiles=typeof t.updateFiles=="boolean"?t.updateFiles:!0,this.locale=t.locale||"en",this.fallbackToLanguage=typeof t.fallbackToLanguage=="boolean"?t.fallbackToLanguage:!0,this.cache=Object.create(null),this.writeQueue=[]}__(...t){if(typeof arguments[0]!="string")return this._taggedLiteral(arguments[0],...arguments);const e=t.shift();let n=function(){};return typeof t[t.length-1]=="function"&&(n=t.pop()),n=n||function(){},this.cache[this.locale]||this._readLocaleFile(),!this.cache[this.locale][e]&&this.updateFiles?(this.cache[this.locale][e]=e,this._enqueueWrite({directory:this.directory,locale:this.locale,cb:n})):n(),At.format.apply(At.format,[this.cache[this.locale][e]||e].concat(t))}__n(){const t=Array.prototype.slice.call(arguments),e=t.shift(),n=t.shift(),s=t.shift();let i=function(){};typeof t[t.length-1]=="function"&&(i=t.pop()),this.cache[this.locale]||this._readLocaleFile();let r=s===1?e:n;this.cache[this.locale][e]&&(r=this.cache[this.locale][e][s===1?"one":"other"]),!this.cache[this.locale][e]&&this.updateFiles?(this.cache[this.locale][e]={one:e,other:n},this._enqueueWrite({directory:this.directory,locale:this.locale,cb:i})):i();const a=[r];return~r.indexOf("%d")&&a.push(s),At.format.apply(At.format,a.concat(t))}setLocale(t){this.locale=t}getLocale(){return this.locale}updateLocale(t){this.cache[this.locale]||this._readLocaleFile();for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&(this.cache[this.locale][e]=t[e])}_taggedLiteral(t,...e){let n="";return t.forEach(function(s,i){const r=e[i+1];n+=s,typeof r<"u"&&(n+="%s")}),this.__.apply(this,[n].concat([].slice.call(e,1)))}_enqueueWrite(t){this.writeQueue.push(t),this.writeQueue.length===1&&this._processWriteQueue()}_processWriteQueue(){const t=this,e=this.writeQueue[0],n=e.directory,s=e.locale,i=e.cb,r=this._resolveLocaleFile(n,s),a=JSON.stringify(this.cache[s],null,2);At.fs.writeFile(r,a,"utf-8",function(c){t.writeQueue.shift(),t.writeQueue.length>0&&t._processWriteQueue(),i(c)})}_readLocaleFile(){let t={};const e=this._resolveLocaleFile(this.directory,this.locale);try{At.fs.readFileSync&&(t=JSON.parse(At.fs.readFileSync(e,"utf-8")))}catch(n){if(n instanceof SyntaxError&&(n.message="syntax error in "+e),n.code==="ENOENT")t={};else throw n}this.cache[this.locale]=t}_resolveLocaleFile(t,e){let n=At.resolve(t,"./",e+".json");if(this.fallbackToLanguage&&!this._fileExistsSync(n)&&~e.lastIndexOf("_")){const s=At.resolve(t,"./",e.split("_")[0]+".json");this._fileExistsSync(s)&&(n=s)}return n}_fileExistsSync(t){return At.exists(t)}}function $s(o,t){At=t;const e=new Xs(o);return{__:e.__.bind(e),__n:e.__n.bind(e),setLocale:e.setLocale.bind(e),getLocale:e.getLocale.bind(e),updateLocale:e.updateLocale.bind(e),locale:e.locale}}const qs=o=>$s(o,Us),Ws="require is not supported by ESM",di="loading a directory of commands is not supported yet for ESM";let ye;try{ye=es.fileURLToPath(typeof document>"u"?require("url").pathToFileURL(__filename).href:Re&&Re.tagName.toUpperCase()==="SCRIPT"&&Re.src||new URL("run-cli-DHPcno7N.cjs",document.baseURI).href)}catch{ye=process.cwd()}const Vs=ye.substring(0,ye.lastIndexOf("node_modules")),Hs={assert:{notStrictEqual:si.notStrictEqual,strictEqual:si.strictEqual},cliui:xs,findUp:Ns,getEnv:o=>process.env[o],inspect:Xn.inspect,getCallerFile:()=>{throw new ut(di)},getProcessArgvBin:Bs,mainFilename:Vs||process.cwd(),Parser:we,path:{basename:bt.basename,dirname:bt.dirname,extname:bt.extname,relative:bt.relative,resolve:bt.resolve},process:{argv:()=>process.argv,cwd:process.cwd,emitWarning:(o,t)=>process.emitWarning(o,t),execPath:()=>process.execPath,exit:process.exit,nextTick:process.nextTick,stdColumns:typeof process.stdout.columns<"u"?process.stdout.columns:null},readFileSync:Ft.readFileSync,require:()=>{throw new ut(Ws)},requireDirectory:()=>{throw new ut(di)},stringWidth:o=>[...o].length,y18n:qs({directory:bt.resolve(ye,"../../../locales"),updateFiles:!1})};function Lt(o,t,e,n){e.assert.notStrictEqual(o,t,n)}function mi(o,t){t.assert.strictEqual(typeof o,"string")}function Le(o){return Object.keys(o)}function lt(o){return!!o&&!!o.then&&typeof o.then=="function"}function de(o){const e=o.replace(/\s{2,}/g," ").split(/\s+(?![^[]*]|[^<]*>)/),n=/\.*[\][<>]/g,s=e.shift();if(!s)throw new Error(`No command found in: ${o}`);const i={cmd:s.replace(n,""),demanded:[],optional:[]};return e.forEach((r,a)=>{let c=!1;r=r.replace(/\s/g,""),/\.+[\]>]/.test(r)&&a===e.length-1&&(c=!0),/^\[/.test(r)?i.optional.push({cmd:r.replace(n,"").split("|"),variadic:c}):i.demanded.push({cmd:r.replace(n,"").split("|"),variadic:c})}),i}const zs=["first","second","third","fourth","fifth","sixth"];function H(o,t,e){function n(){return typeof o=="object"?[{demanded:[],optional:[]},o,t]:[de(`cmd ${o}`),t,e]}try{let s=0;const[i,r,a]=n(),c=[].slice.call(r);for(;c.length&&c[c.length-1]===void 0;)c.pop();const g=a||c.length;if(g<i.demanded.length)throw new ut(`Not enough arguments provided. Expected ${i.demanded.length} but received ${c.length}.`);const p=i.demanded.length+i.optional.length;if(g>p)throw new ut(`Too many arguments provided. Expected max ${p} but received ${g}.`);i.demanded.forEach(f=>{const h=c.shift(),b=gi(h);f.cmd.filter(D=>D===b||D==="*").length===0&&yi(b,f.cmd,s),s+=1}),i.optional.forEach(f=>{if(c.length===0)return;const h=c.shift(),b=gi(h);f.cmd.filter(D=>D===b||D==="*").length===0&&yi(b,f.cmd,s),s+=1})}catch(s){console.warn(s.stack)}}function gi(o){return Array.isArray(o)?"array":o===null?"null":typeof o}function yi(o,t,e){throw new ut(`Invalid ${zs[e]||"manyith"} argument. Expected ${t.join(" or ")} but received ${o}.`)}class Gs{constructor(t){this.globalMiddleware=[],this.frozens=[],this.yargs=t}addMiddleware(t,e,n=!0,s=!1){if(H("<array|function> [boolean] [boolean] [boolean]",[t,e,n],arguments.length),Array.isArray(t)){for(let i=0;i<t.length;i++){if(typeof t[i]!="function")throw Error("middleware must be a function");const r=t[i];r.applyBeforeValidation=e,r.global=n}Array.prototype.push.apply(this.globalMiddleware,t)}else if(typeof t=="function"){const i=t;i.applyBeforeValidation=e,i.global=n,i.mutates=s,this.globalMiddleware.push(t)}return this.yargs}addCoerceMiddleware(t,e){const n=this.yargs.getAliases();return this.globalMiddleware=this.globalMiddleware.filter(s=>{const i=[...n[e]||[],e];return s.option?!i.includes(s.option):!0}),t.option=e,this.addMiddleware(t,!0,!0,!0)}getMiddleware(){return this.globalMiddleware}freeze(){this.frozens.push([...this.globalMiddleware])}unfreeze(){const t=this.frozens.pop();t!==void 0&&(this.globalMiddleware=t)}reset(){this.globalMiddleware=this.globalMiddleware.filter(t=>t.global)}}function Ys(o){return o?o.map(t=>(t.applyBeforeValidation=!1,t)):[]}function me(o,t,e,n){return e.reduce((s,i)=>{if(i.applyBeforeValidation!==n)return s;if(i.mutates){if(i.applied)return s;i.applied=!0}if(lt(s))return s.then(r=>Promise.all([r,i(r,t)])).then(([r,a])=>Object.assign(r,a));{const r=i(s,t);return lt(r)?r.then(a=>Object.assign(s,a)):Object.assign(s,r)}},o)}function ge(o,t,e=n=>{throw n}){try{const n=ks(o)?o():o;return lt(n)?n.then(s=>t(s)):t(n)}catch(n){return e(n)}}function ks(o){return typeof o=="function"}function Ks(o){if(typeof require>"u")return null;for(let t=0,e=Object.keys(require.cache),n;t<e.length;t++)if(n=require.cache[e[t]],n.exports===o)return n;return null}const ie=/(^\*)|(^\$0)/;class Qs{constructor(t,e,n,s){this.requireCache=new Set,this.handlers={},this.aliasMap={},this.frozens=[],this.shim=s,this.usage=t,this.globalMiddleware=n,this.validation=e}addDirectory(t,e,n,s){s=s||{},typeof s.recurse!="boolean"&&(s.recurse=!1),Array.isArray(s.extensions)||(s.extensions=["js"]);const i=typeof s.visit=="function"?s.visit:r=>r;s.visit=(r,a,c)=>{const g=i(r,a,c);if(g){if(this.requireCache.has(a))return g;this.requireCache.add(a),this.addHandler(g)}return g},this.shim.requireDirectory({require:e,filename:n},t,s)}addHandler(t,e,n,s,i,r){let a=[];const c=Ys(i);if(s=s||(()=>{}),Array.isArray(t))if(Zs(t))[t,...a]=t;else for(const g of t)this.addHandler(g);else if(eo(t)){let g=Array.isArray(t.command)||typeof t.command=="string"?t.command:this.moduleName(t);t.aliases&&(g=[].concat(g).concat(t.aliases)),this.addHandler(g,this.extractDesc(t),t.builder,t.handler,t.middlewares,t.deprecated);return}else if(bi(n)){this.addHandler([t].concat(a),e,n.builder,n.handler,n.middlewares,n.deprecated);return}if(typeof t=="string"){const g=de(t);a=a.map(h=>de(h).cmd);let p=!1;const f=[g.cmd].concat(a).filter(h=>ie.test(h)?(p=!0,!1):!0);f.length===0&&p&&f.push("$0"),p&&(g.cmd=f[0],a=f.slice(1),t=t.replace(ie,g.cmd)),a.forEach(h=>{this.aliasMap[h]=g.cmd}),e!==!1&&this.usage.command(t,e,p,a,r),this.handlers[g.cmd]={original:t,description:e,handler:s,builder:n||{},middlewares:c,deprecated:r,demanded:g.demanded,optional:g.optional},p&&(this.defaultCommand=this.handlers[g.cmd])}}getCommandHandlers(){return this.handlers}getCommands(){return Object.keys(this.handlers).concat(Object.keys(this.aliasMap))}hasDefaultCommand(){return!!this.defaultCommand}runCommand(t,e,n,s,i,r){const a=this.handlers[t]||this.handlers[this.aliasMap[t]]||this.defaultCommand,c=e.getInternalMethods().getContext(),g=c.commands.slice(),p=!t;t&&(c.commands.push(t),c.fullCommands.push(a.original));const f=this.applyBuilderUpdateUsageAndParse(p,a,e,n.aliases,g,s,i,r);return lt(f)?f.then(h=>this.applyMiddlewareAndGetResult(p,a,h.innerArgv,c,i,h.aliases,e)):this.applyMiddlewareAndGetResult(p,a,f.innerArgv,c,i,f.aliases,e)}applyBuilderUpdateUsageAndParse(t,e,n,s,i,r,a,c){const g=e.builder;let p=n;if(Rn(g)){n.getInternalMethods().getUsageInstance().freeze();const f=g(n.getInternalMethods().reset(s),c);if(lt(f))return f.then(h=>(p=bo(h)?h:n,this.parseAndUpdateUsage(t,e,p,i,r,a)))}else to(g)&&(n.getInternalMethods().getUsageInstance().freeze(),p=n.getInternalMethods().reset(s),Object.keys(e.builder).forEach(f=>{p.option(f,g[f])}));return this.parseAndUpdateUsage(t,e,p,i,r,a)}parseAndUpdateUsage(t,e,n,s,i,r){t&&n.getInternalMethods().getUsageInstance().unfreeze(!0),this.shouldUpdateUsage(n)&&n.getInternalMethods().getUsageInstance().usage(this.usageFromParentCommandsCommandHandler(s,e),e.description);const a=n.getInternalMethods().runYargsParserAndExecuteCommands(null,void 0,!0,i,r);return lt(a)?a.then(c=>({aliases:n.parsed.aliases,innerArgv:c})):{aliases:n.parsed.aliases,innerArgv:a}}shouldUpdateUsage(t){return!t.getInternalMethods().getUsageInstance().getUsageDisabled()&&t.getInternalMethods().getUsageInstance().getUsage().length===0}usageFromParentCommandsCommandHandler(t,e){const n=ie.test(e.original)?e.original.replace(ie,"").trim():e.original,s=t.filter(i=>!ie.test(i));return s.push(n),`$0 ${s.join(" ")}`}handleValidationAndGetResult(t,e,n,s,i,r,a,c){if(!r.getInternalMethods().getHasOutput()){const g=r.getInternalMethods().runValidation(i,c,r.parsed.error,t);n=ge(n,p=>(g(p),p))}if(e.handler&&!r.getInternalMethods().getHasOutput()){r.getInternalMethods().setHasOutput();const g=!!r.getOptions().configuration["populate--"];r.getInternalMethods().postProcess(n,g,!1,!1),n=me(n,r,a,!1),n=ge(n,p=>{const f=e.handler(p);return lt(f)?f.then(()=>p):p}),t||r.getInternalMethods().getUsageInstance().cacheHelpMessage(),lt(n)&&!r.getInternalMethods().hasParseCallback()&&n.catch(p=>{try{r.getInternalMethods().getUsageInstance().fail(null,p)}catch{}})}return t||(s.commands.pop(),s.fullCommands.pop()),n}applyMiddlewareAndGetResult(t,e,n,s,i,r,a){let c={};if(i)return n;a.getInternalMethods().getHasOutput()||(c=this.populatePositionals(e,n,s,a));const g=this.globalMiddleware.getMiddleware().slice(0).concat(e.middlewares),p=me(n,a,g,!0);return lt(p)?p.then(f=>this.handleValidationAndGetResult(t,e,f,s,r,a,g,c)):this.handleValidationAndGetResult(t,e,p,s,r,a,g,c)}populatePositionals(t,e,n,s){e._=e._.slice(n.commands.length);const i=t.demanded.slice(0),r=t.optional.slice(0),a={};for(this.validation.positionalCount(i.length,e._.length);i.length;){const c=i.shift();this.populatePositional(c,e,a)}for(;r.length;){const c=r.shift();this.populatePositional(c,e,a)}return e._=n.commands.concat(e._.map(c=>""+c)),this.postProcessPositionals(e,a,this.cmdToParseOptions(t.original),s),a}populatePositional(t,e,n){const s=t.cmd[0];t.variadic?n[s]=e._.splice(0).map(String):e._.length&&(n[s]=[String(e._.shift())])}cmdToParseOptions(t){const e={array:[],default:{},alias:{},demand:{}},n=de(t);return n.demanded.forEach(s=>{const[i,...r]=s.cmd;s.variadic&&(e.array.push(i),e.default[i]=[]),e.alias[i]=r,e.demand[i]=!0}),n.optional.forEach(s=>{const[i,...r]=s.cmd;s.variadic&&(e.array.push(i),e.default[i]=[]),e.alias[i]=r}),e}postProcessPositionals(t,e,n,s){const i=Object.assign({},s.getOptions());i.default=Object.assign(n.default,i.default);for(const g of Object.keys(n.alias))i.alias[g]=(i.alias[g]||[]).concat(n.alias[g]);i.array=i.array.concat(n.array),i.config={};const r=[];if(Object.keys(e).forEach(g=>{e[g].map(p=>{i.configuration["unknown-options-as-args"]&&(i.key[g]=!0),r.push(`--${g}`),r.push(p)})}),!r.length)return;const a=Object.assign({},i.configuration,{"populate--":!1}),c=this.shim.Parser.detailed(r,Object.assign({},i,{configuration:a}));if(c.error)s.getInternalMethods().getUsageInstance().fail(c.error.message,c.error);else{const g=Object.keys(e);Object.keys(e).forEach(p=>{g.push(...c.aliases[p])}),Object.keys(c.argv).forEach(p=>{g.includes(p)&&(e[p]||(e[p]=c.argv[p]),!this.isInConfigs(s,p)&&!this.isDefaulted(s,p)&&Object.prototype.hasOwnProperty.call(t,p)&&Object.prototype.hasOwnProperty.call(c.argv,p)&&(Array.isArray(t[p])||Array.isArray(c.argv[p]))?t[p]=[].concat(t[p],c.argv[p]):t[p]=c.argv[p])})}}isDefaulted(t,e){const{default:n}=t.getOptions();return Object.prototype.hasOwnProperty.call(n,e)||Object.prototype.hasOwnProperty.call(n,this.shim.Parser.camelCase(e))}isInConfigs(t,e){const{configObjects:n}=t.getOptions();return n.some(s=>Object.prototype.hasOwnProperty.call(s,e))||n.some(s=>Object.prototype.hasOwnProperty.call(s,this.shim.Parser.camelCase(e)))}runDefaultBuilderOn(t){if(!this.defaultCommand)return;if(this.shouldUpdateUsage(t)){const n=ie.test(this.defaultCommand.original)?this.defaultCommand.original:this.defaultCommand.original.replace(/^[^[\]<>]*/,"$0 ");t.getInternalMethods().getUsageInstance().usage(n,this.defaultCommand.description)}const e=this.defaultCommand.builder;if(Rn(e))return e(t,!0);bi(e)||Object.keys(e).forEach(n=>{t.option(n,e[n])})}moduleName(t){const e=Ks(t);if(!e)throw new Error(`No command name given for module: ${this.shim.inspect(t)}`);return this.commandFromFilename(e.filename)}commandFromFilename(t){return this.shim.path.basename(t,this.shim.path.extname(t))}extractDesc({describe:t,description:e,desc:n}){for(const s of[t,e,n]){if(typeof s=="string"||s===!1)return s;Lt(s,!0,this.shim)}return!1}freeze(){this.frozens.push({handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand})}unfreeze(){const t=this.frozens.pop();Lt(t,void 0,this.shim),{handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand}=t}reset(){return this.handlers={},this.aliasMap={},this.defaultCommand=void 0,this.requireCache=new Set,this}}function Js(o,t,e,n){return new Qs(o,t,e,n)}function bi(o){return typeof o=="object"&&!!o.builder&&typeof o.handler=="function"}function Zs(o){return o.every(t=>typeof t=="string")}function Rn(o){return typeof o=="function"}function to(o){return typeof o=="object"}function eo(o){return typeof o=="object"&&!Array.isArray(o)}function be(o={},t=()=>!0){const e={};return Le(o).forEach(n=>{t(n,o[n])&&(e[n]=o[n])}),e}function he(o){typeof process>"u"||[process.stdout,process.stderr].forEach(t=>{const e=t;e._handle&&e.isTTY&&typeof e._handle.setBlocking=="function"&&e._handle.setBlocking(o)})}function no(o){return typeof o=="boolean"}function io(o,t){const e=t.y18n.__,n={},s=[];n.failFn=function(L){s.push(L)};let i=null,r=null,a=!0;n.showHelpOnFail=function(L=!0,B){const[X,Y]=typeof L=="string"?[!0,L]:[L,B];return o.getInternalMethods().isGlobalContext()&&(r=Y),i=Y,a=X,n};let c=!1;n.fail=function(L,B){const X=o.getInternalMethods().getLoggerInstance();if(s.length)for(let Y=s.length-1;Y>=0;--Y){const k=s[Y];if(no(k)){if(B)throw B;if(L)throw Error(L)}else k(L,B,n)}else{if(o.getExitProcess()&&he(!0),!c){c=!0,a&&(o.showHelp("error"),X.error()),(L||B)&&X.error(L||B);const Y=i||r;Y&&((L||B)&&X.error(""),X.error(Y))}if(B=B||new ut(L),o.getExitProcess())return o.exit(1);if(o.getInternalMethods().hasParseCallback())return o.exit(1,B);throw B}};let g=[],p=!1;n.usage=(N,L)=>N===null?(p=!0,g=[],n):(p=!1,g.push([N,L||""]),n),n.getUsage=()=>g,n.getUsageDisabled=()=>p,n.getPositionalGroupName=()=>e("Positionals:");let f=[];n.example=(N,L)=>{f.push([N,L||""])};let h=[];n.command=function(L,B,X,Y,k=!1){X&&(h=h.map(q=>(q[2]=!1,q))),h.push([L,B||"",X,Y,k])},n.getCommands=()=>h;let b={};n.describe=function(L,B){Array.isArray(L)?L.forEach(X=>{n.describe(X,B)}):typeof L=="object"?Object.keys(L).forEach(X=>{n.describe(X,L[X])}):b[L]=B},n.getDescriptions=()=>b;let O=[];n.epilog=N=>{O.push(N)};let D=!1,w;n.wrap=N=>{D=!0,w=N},n.getWrap=()=>t.getEnv("YARGS_DISABLE_WRAP")?null:(D||(w=j(),D=!0),w);const A="__yargsString__:";n.deferY18nLookup=N=>A+N,n.help=function(){if(E)return E;d();const L=o.customScriptName?o.$0:t.path.basename(o.$0),B=o.getDemandedOptions(),X=o.getDemandedCommands(),Y=o.getDeprecatedOptions(),k=o.getGroups(),q=o.getOptions();let at=[];at=at.concat(Object.keys(b)),at=at.concat(Object.keys(B)),at=at.concat(Object.keys(X)),at=at.concat(Object.keys(q.default)),at=at.filter(F),at=Object.keys(at.reduce((K,m)=>(m!=="_"&&(K[m]=!0),K),{}));const Pt=n.getWrap(),st=t.cliui({width:Pt,wrap:!!Pt});if(!p){if(g.length)g.forEach(K=>{st.div({text:`${K[0].replace(/\$0/g,L)}`}),K[1]&&st.div({text:`${K[1]}`,padding:[1,0,0,0]})}),st.div();else if(h.length){let K=null;X._?K=`${L} <${e("command")}>
|
|
33
33
|
`:K=`${L} [${e("command")}]
|
|
34
|
-
`,st.div(`${K}`)}}if(h.length>1||h.length===1&&!h[0][2]){st.div(e("Commands:"));const K=o.getInternalMethods().getContext(),m=K.commands.length?`${K.commands.join(" ")} `:"";o.getInternalMethods().getParserConfiguration()["sort-commands"]===!0&&(h=h.sort((P,_)=>P[0].localeCompare(_[0])));const
|
|
34
|
+
`,st.div(`${K}`)}}if(h.length>1||h.length===1&&!h[0][2]){st.div(e("Commands:"));const K=o.getInternalMethods().getContext(),m=K.commands.length?`${K.commands.join(" ")} `:"";o.getInternalMethods().getParserConfiguration()["sort-commands"]===!0&&(h=h.sort((P,_)=>P[0].localeCompare(_[0])));const u=L?`${L} `:"";h.forEach(P=>{const _=`${u}${m}${P[0].replace(/^\$0 ?/,"")}`;st.span({text:_,padding:[0,2,0,2],width:C(h,Pt,`${L}${m}`)+4},{text:P[1]});const J=[];P[2]&&J.push(`[${e("default")}]`),P[3]&&P[3].length&&J.push(`[${e("aliases:")} ${P[3].join(", ")}]`),P[4]&&(typeof P[4]=="string"?J.push(`[${e("deprecated: %s",P[4])}]`):J.push(`[${e("deprecated")}]`)),J.length?st.div({text:J.join(" "),padding:[0,0,0,2],align:"right"}):st.div()}),st.div()}const mt=(Object.keys(q.alias)||[]).concat(Object.keys(o.parsed.newAliases)||[]);at=at.filter(K=>!o.parsed.newAliases[K]&&mt.every(m=>(q.alias[m]||[]).indexOf(K)===-1));const wt=e("Options:");k[wt]||(k[wt]=[]),T(at,q.alias,k,wt);const Rt=K=>/^--/.test(Oe(K)),Q=Object.keys(k).filter(K=>k[K].length>0).map(K=>{const m=k[K].filter(F).map(u=>{if(mt.includes(u))return u;for(let P=0,_;(_=mt[P])!==void 0;P++)if((q.alias[_]||[]).includes(u))return _;return u});return{groupName:K,normalizedKeys:m}}).filter(({normalizedKeys:K})=>K.length>0).map(({groupName:K,normalizedKeys:m})=>{const u=m.reduce((P,_)=>(P[_]=[_].concat(q.alias[_]||[]).map(J=>K===n.getPositionalGroupName()?J:(/^[0-9]$/.test(J)?q.boolean.includes(_)?"-":"--":J.length>1?"--":"-")+J).sort((J,nt)=>Rt(J)===Rt(nt)?0:Rt(J)?1:-1).join(", "),P),{});return{groupName:K,normalizedKeys:m,switches:u}});if(Q.filter(({groupName:K})=>K!==n.getPositionalGroupName()).some(({normalizedKeys:K,switches:m})=>!K.every(u=>Rt(m[u])))&&Q.filter(({groupName:K})=>K!==n.getPositionalGroupName()).forEach(({normalizedKeys:K,switches:m})=>{K.forEach(u=>{Rt(m[u])&&(m[u]=ro(m[u],4))})}),Q.forEach(({groupName:K,normalizedKeys:m,switches:u})=>{st.div(K),m.forEach(P=>{const _=u[P];let J=b[P]||"",nt=null;J.includes(A)&&(J=e(J.substring(A.length))),q.boolean.includes(P)&&(nt=`[${e("boolean")}]`),q.count.includes(P)&&(nt=`[${e("count")}]`),q.string.includes(P)&&(nt=`[${e("string")}]`),q.normalize.includes(P)&&(nt=`[${e("string")}]`),q.array.includes(P)&&(nt=`[${e("array")}]`),q.number.includes(P)&&(nt=`[${e("number")}]`);const it=v=>typeof v=="string"?`[${e("deprecated: %s",v)}]`:`[${e("deprecated")}]`,ht=[P in Y?it(Y[P]):null,nt,P in B?`[${e("required")}]`:null,q.choices&&q.choices[P]?`[${e("choices:")} ${n.stringifiedValues(q.choices[P])}]`:null,U(q.default[P],q.defaultDescription[P])].filter(Boolean).join(" ");st.span({text:Oe(_),padding:[0,2,0,2+wi(_)],width:C(u,Pt)+4},J);const I=o.getInternalMethods().getUsageConfiguration()["hide-types"]===!0;ht&&!I?st.div({text:ht,padding:[0,0,0,2],align:"right"}):st.div()}),st.div()}),f.length&&(st.div(e("Examples:")),f.forEach(K=>{K[0]=K[0].replace(/\$0/g,L)}),f.forEach(K=>{K[1]===""?st.div({text:K[0],padding:[0,2,0,2]}):st.div({text:K[0],padding:[0,2,0,2],width:C(f,Pt)+4},{text:K[1]})}),st.div()),O.length>0){const K=O.map(m=>m.replace(/\$0/g,L)).join(`
|
|
35
35
|
`);st.div(`${K}
|
|
36
|
-
`)}return st.toString().replace(/\s*$/,"")};function C(N,L,B){let X=0;return Array.isArray(N)||(N=Object.values(N).map(Y=>[Y])),N.forEach(Y=>{X=Math.max(t.stringWidth(B?`${B} ${Oe(Y[0])}`:Oe(Y[0]))+wi(Y[0]),X)}),L&&(X=Math.min(X,parseInt((L*.5).toString(),10))),X}function d(){const N=o.getDemandedOptions(),L=o.getOptions();(Object.keys(L.alias)||[]).forEach(B=>{L.alias[B].forEach(X=>{b[X]&&n.describe(B,b[X]),X in N&&o.demandOption(B,N[X]),L.boolean.includes(X)&&o.boolean(B),L.count.includes(X)&&o.count(B),L.string.includes(X)&&o.string(B),L.normalize.includes(X)&&o.normalize(B),L.array.includes(X)&&o.array(B),L.number.includes(X)&&o.number(B)})})}let E;n.cacheHelpMessage=function(){E=this.help()},n.clearCachedHelpMessage=function(){E=void 0},n.hasCachedHelpMessage=function(){return!!E};function T(N,L,B,X){let Y=[],k=null;return Object.keys(B).forEach(q=>{Y=Y.concat(B[q])}),N.forEach(q=>{k=[q].concat(L[q]),k.some(at=>Y.indexOf(at)!==-1)||B[X].push(q)}),Y}function F(N){return o.getOptions().hiddenOptions.indexOf(N)<0||o.parsed.argv[o.getOptions().showHiddenOpt]}n.showHelp=N=>{const L=o.getInternalMethods().getLoggerInstance();N||(N="error"),(typeof N=="function"?N:L[N])(n.help())},n.functionDescription=N=>["(",N.name?t.Parser.decamelize(N.name,"-"):e("generated-value"),")"].join(""),n.stringifiedValues=function(L,B){let X="";const Y=B||", ",k=[].concat(L);return!L||!k.length||k.forEach(q=>{X.length&&(X+=Y),X+=JSON.stringify(q)}),X};function U(N,L){let B=`[${e("default:")} `;if(N===void 0&&!L)return null;if(L)B+=L;else switch(typeof N){case"string":B+=`"${N}"`;break;case"object":B+=JSON.stringify(N);break;default:B+=N}return`${B}]`}function j(){return t.process.stdColumns?Math.min(80,t.process.stdColumns):80}let
|
|
36
|
+
`)}return st.toString().replace(/\s*$/,"")};function C(N,L,B){let X=0;return Array.isArray(N)||(N=Object.values(N).map(Y=>[Y])),N.forEach(Y=>{X=Math.max(t.stringWidth(B?`${B} ${Oe(Y[0])}`:Oe(Y[0]))+wi(Y[0]),X)}),L&&(X=Math.min(X,parseInt((L*.5).toString(),10))),X}function d(){const N=o.getDemandedOptions(),L=o.getOptions();(Object.keys(L.alias)||[]).forEach(B=>{L.alias[B].forEach(X=>{b[X]&&n.describe(B,b[X]),X in N&&o.demandOption(B,N[X]),L.boolean.includes(X)&&o.boolean(B),L.count.includes(X)&&o.count(B),L.string.includes(X)&&o.string(B),L.normalize.includes(X)&&o.normalize(B),L.array.includes(X)&&o.array(B),L.number.includes(X)&&o.number(B)})})}let E;n.cacheHelpMessage=function(){E=this.help()},n.clearCachedHelpMessage=function(){E=void 0},n.hasCachedHelpMessage=function(){return!!E};function T(N,L,B,X){let Y=[],k=null;return Object.keys(B).forEach(q=>{Y=Y.concat(B[q])}),N.forEach(q=>{k=[q].concat(L[q]),k.some(at=>Y.indexOf(at)!==-1)||B[X].push(q)}),Y}function F(N){return o.getOptions().hiddenOptions.indexOf(N)<0||o.parsed.argv[o.getOptions().showHiddenOpt]}n.showHelp=N=>{const L=o.getInternalMethods().getLoggerInstance();N||(N="error"),(typeof N=="function"?N:L[N])(n.help())},n.functionDescription=N=>["(",N.name?t.Parser.decamelize(N.name,"-"):e("generated-value"),")"].join(""),n.stringifiedValues=function(L,B){let X="";const Y=B||", ",k=[].concat(L);return!L||!k.length||k.forEach(q=>{X.length&&(X+=Y),X+=JSON.stringify(q)}),X};function U(N,L){let B=`[${e("default:")} `;if(N===void 0&&!L)return null;if(L)B+=L;else switch(typeof N){case"string":B+=`"${N}"`;break;case"object":B+=JSON.stringify(N);break;default:B+=N}return`${B}]`}function j(){return t.process.stdColumns?Math.min(80,t.process.stdColumns):80}let l=null;n.version=N=>{l=N},n.showVersion=N=>{const L=o.getInternalMethods().getLoggerInstance();N||(N="error"),(typeof N=="function"?N:L[N])(l)},n.reset=function(L){return i=null,c=!1,g=[],p=!1,O=[],f=[],h=[],b=be(b,B=>!L[B]),n};const M=[];return n.freeze=function(){M.push({failMessage:i,failureOutput:c,usages:g,usageDisabled:p,epilogs:O,examples:f,commands:h,descriptions:b})},n.unfreeze=function(L=!1){const B=M.pop();B&&(L?(b={...B.descriptions,...b},h=[...B.commands,...h],g=[...B.usages,...g],f=[...B.examples,...f],O=[...B.epilogs,...O]):{failMessage:i,failureOutput:c,usages:g,usageDisabled:p,epilogs:O,examples:f,commands:h,descriptions:b}=B)},n}function Wn(o){return typeof o=="object"}function ro(o,t){return Wn(o)?{text:o.text,indentation:o.indentation+t}:{text:o,indentation:t}}function wi(o){return Wn(o)?o.indentation:0}function Oe(o){return Wn(o)?o.text:o}const so=`###-begin-{{app_name}}-completions-###
|
|
37
37
|
#
|
|
38
38
|
# yargs command completion script
|
|
39
39
|
#
|
|
@@ -88,17 +88,17 @@ ${O.join(`
|
|
|
88
88
|
`),void 0,"versionWarning"),y(this,G,"f").key[t]=!0,e.alias&&this.alias(t,e.alias);const n=e.deprecate||e.deprecated;n&&this.deprecateOption(t,n);const s=e.demand||e.required||e.require;s&&this.demand(t,s),e.demandOption&&this.demandOption(t,typeof e.demandOption=="string"?e.demandOption:void 0),e.conflicts&&this.conflicts(t,e.conflicts),"default"in e&&this.default(t,e.default),e.implies!==void 0&&this.implies(t,e.implies),e.nargs!==void 0&&this.nargs(t,e.nargs),e.config&&this.config(t,e.configParser),e.normalize&&this.normalize(t),e.choices&&this.choices(t,e.choices),e.coerce&&this.coerce(t,e.coerce),e.group&&this.group(t,e.group),(e.boolean||e.type==="boolean")&&(this.boolean(t),e.alias&&this.boolean(e.alias)),(e.array||e.type==="array")&&(this.array(t),e.alias&&this.array(e.alias)),(e.number||e.type==="number")&&(this.number(t),e.alias&&this.number(e.alias)),(e.string||e.type==="string")&&(this.string(t),e.alias&&this.string(e.alias)),(e.count||e.type==="count")&&this.count(t),typeof e.global=="boolean"&&this.global(t,e.global),e.defaultDescription&&(y(this,G,"f").defaultDescription[t]=e.defaultDescription),e.skipValidation&&this.skipValidation(t);const i=e.describe||e.description||e.desc,r=y(this,tt,"f").getDescriptions();(!Object.prototype.hasOwnProperty.call(r,t)||typeof i=="string")&&this.describe(t,i),e.hidden&&this.hide(t),e.requiresArg&&this.requiresArg(t)}return this}options(t,e){return this.option(t,e)}parse(t,e,n){H("[string|array] [function|boolean|object] [function]",[t,e,n],arguments.length),this[Ii](),typeof t>"u"&&(t=y(this,Wt,"f")),typeof e=="object"&&(V(this,Yt,e,"f"),e=n),typeof e=="function"&&(V(this,Dt,e,"f"),e=!1),e||V(this,Wt,t,"f"),y(this,Dt,"f")&&V(this,_t,!1,"f");const s=this[le](t,!!e),i=this.parsed;return y(this,It,"f").setParsed(this.parsed),lt(s)?s.then(r=>(y(this,Dt,"f")&&y(this,Dt,"f").call(this,y(this,qt,"f"),r,y(this,dt,"f")),r)).catch(r=>{throw y(this,Dt,"f")&&y(this,Dt,"f")(r,this.parsed.argv,y(this,dt,"f")),r}).finally(()=>{this[ke](),this.parsed=i}):(y(this,Dt,"f")&&y(this,Dt,"f").call(this,y(this,qt,"f"),s,y(this,dt,"f")),this[ke](),this.parsed=i,s)}parseAsync(t,e,n){const s=this.parse(t,e,n);return lt(s)?s:Promise.resolve(s)}parseSync(t,e,n){const s=this.parse(t,e,n);if(lt(s))throw new ut(".parseSync() must not be used with asynchronous builders, handlers, or middleware");return s}parserConfiguration(t){return H("<object>",[t],arguments.length),V(this,Te,t,"f"),this}pkgConf(t,e){H("<string> [string]",[t,e],arguments.length);let n=null;const s=this[Ve](e||y(this,zt,"f"));return s[t]&&typeof s[t]=="object"&&(n=Un(s[t],e||y(this,zt,"f"),this[Zt]()["deep-merge-config"]||!1,y(this,Z,"f")),y(this,G,"f").configObjects=(y(this,G,"f").configObjects||[]).concat(n)),this}positional(t,e){H("<string> <object>",[t,e],arguments.length);const n=["default","defaultDescription","implies","normalize","choices","conflicts","coerce","type","describe","desc","description","alias"];e=be(e,(r,a)=>r==="type"&&!["string","number","boolean"].includes(a)?!1:n.includes(r));const s=y(this,ue,"f").fullCommands[y(this,ue,"f").fullCommands.length-1],i=s?y(this,ct,"f").cmdToParseOptions(s):{array:[],alias:{},default:{},demand:{}};return Le(i).forEach(r=>{const a=i[r];Array.isArray(a)?a.indexOf(t)!==-1&&(e[r]=!0):a[t]&&!(r in e)&&(e[r]=a[t])}),this.group(t,y(this,tt,"f").getPositionalGroupName()),this.option(t,e)}recommendCommands(t=!0){return H("[boolean]",[t],arguments.length),V(this,ve,t,"f"),this}required(t,e,n){return this.demand(t,e,n)}require(t,e,n){return this.demand(t,e,n)}requiresArg(t){return H("<array|string|object> [number]",[t],arguments.length),typeof t=="string"&&y(this,G,"f").narg[t]?this:(this[oe](this.requiresArg.bind(this),"narg",t,NaN),this)}showCompletionScript(t,e){return H("[string] [string]",[t,e],arguments.length),t=t||this.$0,y(this,re,"f").log(y(this,It,"f").generateCompletionScript(t,e||y(this,Ot,"f")||"completion")),this}showHelp(t){if(H("[string|function]",[t],arguments.length),V(this,Et,!0,"f"),!y(this,tt,"f").hasCachedHelpMessage()){if(!this.parsed){const n=this[le](y(this,Wt,"f"),void 0,void 0,0,!0);if(lt(n))return n.then(()=>{y(this,tt,"f").showHelp(t)}),this}const e=y(this,ct,"f").runDefaultBuilderOn(this);if(lt(e))return e.then(()=>{y(this,tt,"f").showHelp(t)}),this}return y(this,tt,"f").showHelp(t),this}scriptName(t){return this.customScriptName=!0,this.$0=t,this}showHelpOnFail(t,e){return H("[boolean|string] [string]",[t,e],arguments.length),y(this,tt,"f").showHelpOnFail(t,e),this}showVersion(t){return H("[string|function]",[t],arguments.length),y(this,tt,"f").showVersion(t),this}skipValidation(t){return H("<array|string>",[t],arguments.length),this[Vt]("skipValidation",t),this}strict(t){return H("[boolean]",[t],arguments.length),V(this,Kt,t!==!1,"f"),this}strictCommands(t){return H("[boolean]",[t],arguments.length),V(this,Qt,t!==!1,"f"),this}strictOptions(t){return H("[boolean]",[t],arguments.length),V(this,Jt,t!==!1,"f"),this}string(t){return H("<array|string>",[t],arguments.length),this[Vt]("string",t),this[ee](t),this}terminalWidth(){return H([],0),y(this,Z,"f").process.stdColumns}updateLocale(t){return this.updateStrings(t)}updateStrings(t){return H("<object>",[t],arguments.length),V(this,Gt,!1,"f"),y(this,Z,"f").y18n.updateLocale(t),this}usage(t,e,n,s){if(H("<string|null|undefined> [string|boolean] [function|object] [function]",[t,e,n,s],arguments.length),e!==void 0){if(Lt(t,null,y(this,Z,"f")),(t||"").match(/^\$0( |$)/))return this.command(t,e,n,s);throw new ut(".usage() description must start with $0 if being used as alias for .command()")}else return y(this,tt,"f").usage(t),this}usageConfiguration(t){return H("<object>",[t],arguments.length),V(this,xe,t,"f"),this}version(t,e,n){const s="version";if(H("[boolean|string] [string] [string]",[t,e,n],arguments.length),y(this,jt,"f")&&(this[qe](y(this,jt,"f")),y(this,tt,"f").version(void 0),V(this,jt,null,"f")),arguments.length===0)n=this[vi](),t=s;else if(arguments.length===1){if(t===!1)return this;n=t,t=s}else arguments.length===2&&(n=e,e=void 0);return V(this,jt,typeof t=="string"?t:s,"f"),e=e||y(this,tt,"f").deferY18nLookup("Show version number"),y(this,tt,"f").version(n||void 0),this.boolean(y(this,jt,"f")),this.describe(y(this,jt,"f"),e),this}wrap(t){return H("<number|null|undefined>",[t],arguments.length),y(this,tt,"f").wrap(t),this}[(ct=new WeakMap,zt=new WeakMap,ue=new WeakMap,It=new WeakMap,Ot=new WeakMap,Ee=new WeakMap,qt=new WeakMap,Gt=new WeakMap,De=new WeakMap,_t=new WeakMap,Ce=new WeakMap,Tt=new WeakMap,St=new WeakMap,Et=new WeakMap,vt=new WeakMap,Ie=new WeakMap,re=new WeakMap,dt=new WeakMap,G=new WeakMap,_e=new WeakMap,Te=new WeakMap,Dt=new WeakMap,Yt=new WeakMap,se=new WeakMap,kt=new WeakMap,Wt=new WeakMap,ve=new WeakMap,Z=new WeakMap,Kt=new WeakMap,Qt=new WeakMap,Jt=new WeakMap,tt=new WeakMap,xe=new WeakMap,jt=new WeakMap,ot=new WeakMap,Ei)](t){if(!t._||!t["--"])return t;t._.push.apply(t._,t["--"]);try{delete t["--"]}catch{}return t}[Di](){return{log:(...t)=>{this[Ne]()||console.log(...t),V(this,Et,!0,"f"),y(this,dt,"f").length&&V(this,dt,y(this,dt,"f")+`
|
|
89
89
|
`,"f"),V(this,dt,y(this,dt,"f")+t.join(" "),"f")},error:(...t)=>{this[Ne]()||console.error(...t),V(this,Et,!0,"f"),y(this,dt,"f").length&&V(this,dt,y(this,dt,"f")+`
|
|
90
90
|
`,"f"),V(this,dt,y(this,dt,"f")+t.join(" "),"f")}}}[qe](t){Le(y(this,G,"f")).forEach(e=>{if((s=>s==="configObjects")(e))return;const n=y(this,G,"f")[e];Array.isArray(n)?n.includes(t)&&n.splice(n.indexOf(t),1):typeof n=="object"&&delete n[t]}),delete y(this,tt,"f").getDescriptions()[t]}[Ci](t,e,n){y(this,De,"f")[n]||(y(this,Z,"f").process.emitWarning(t,e),y(this,De,"f")[n]=!0)}[Ii](){y(this,Ce,"f").push({options:y(this,G,"f"),configObjects:y(this,G,"f").configObjects.slice(0),exitProcess:y(this,_t,"f"),groups:y(this,St,"f"),strict:y(this,Kt,"f"),strictCommands:y(this,Qt,"f"),strictOptions:y(this,Jt,"f"),completionCommand:y(this,Ot,"f"),output:y(this,dt,"f"),exitError:y(this,qt,"f"),hasOutput:y(this,Et,"f"),parsed:this.parsed,parseFn:y(this,Dt,"f"),parseContext:y(this,Yt,"f")}),y(this,tt,"f").freeze(),y(this,ot,"f").freeze(),y(this,ct,"f").freeze(),y(this,Tt,"f").freeze()}[_i](){let t="",e;return/\b(node|iojs|electron)(\.exe)?$/.test(y(this,Z,"f").process.argv()[0])?e=y(this,Z,"f").process.argv().slice(1,2):e=y(this,Z,"f").process.argv().slice(0,1),t=e.map(n=>{const s=this[Bi](y(this,zt,"f"),n);return n.match(/^(\/|([a-zA-Z]:)?\\)/)&&s.length<n.length?s:n}).join(" ").trim(),y(this,Z,"f").getEnv("_")&&y(this,Z,"f").getProcessArgvBin()===y(this,Z,"f").getEnv("_")&&(t=y(this,Z,"f").getEnv("_").replace(`${y(this,Z,"f").path.dirname(y(this,Z,"f").process.execPath())}/`,"")),t}[Zt](){return y(this,Te,"f")}[Ti](){return y(this,xe,"f")}[We](){if(!y(this,Gt,"f"))return;const t=y(this,Z,"f").getEnv("LC_ALL")||y(this,Z,"f").getEnv("LC_MESSAGES")||y(this,Z,"f").getEnv("LANG")||y(this,Z,"f").getEnv("LANGUAGE")||"en_US";this.locale(t.replace(/[.:].*/,""))}[vi](){return this[Ve]().version||"unknown"}[xi](t){const e=t["--"]?t["--"]:t._;for(let n=0,s;(s=e[n])!==void 0;n++)y(this,Z,"f").Parser.looksLikeNumber(s)&&Number.isSafeInteger(Math.floor(parseFloat(`${s}`)))&&(e[n]=Number(s));return t}[Ve](t){const e=t||"*";if(y(this,se,"f")[e])return y(this,se,"f")[e];let n={};try{let s=t||y(this,Z,"f").mainFilename;!t&&y(this,Z,"f").path.extname(s)&&(s=y(this,Z,"f").path.dirname(s));const i=y(this,Z,"f").findUp(s,(r,a)=>{if(a.includes("package.json"))return"package.json"});Lt(i,void 0,y(this,Z,"f")),n=JSON.parse(y(this,Z,"f").readFileSync(i,"utf8"))}catch{}return y(this,se,"f")[e]=n||{},y(this,se,"f")[e]}[Vt](t,e){e=[].concat(e),e.forEach(n=>{n=this[Ge](n),y(this,G,"f")[t].push(n)})}[oe](t,e,n,s){this[ze](t,e,n,s,(i,r,a)=>{y(this,G,"f")[i][r]=a})}[He](t,e,n,s){this[ze](t,e,n,s,(i,r,a)=>{y(this,G,"f")[i][r]=(y(this,G,"f")[i][r]||[]).concat(a)})}[ze](t,e,n,s,i){if(Array.isArray(n))n.forEach(r=>{t(r,s)});else if((r=>typeof r=="object")(n))for(const r of Le(n))t(r,n[r]);else i(e,this[Ge](n),s)}[Ge](t){return t==="__proto__"?"___proto___":t}[Ye](t,e){return this[oe](this[Ye].bind(this),"key",t,e),this}[ke](){var t,e,n,s,i,r,a,c,g,p,f,h;const b=y(this,Ce,"f").pop();Lt(b,void 0,y(this,Z,"f"));let O;t=this,e=this,n=this,s=this,i=this,r=this,a=this,c=this,g=this,p=this,f=this,h=this,{options:{set value(D){V(t,G,D,"f")}}.value,configObjects:O,exitProcess:{set value(D){V(e,_t,D,"f")}}.value,groups:{set value(D){V(n,St,D,"f")}}.value,output:{set value(D){V(s,dt,D,"f")}}.value,exitError:{set value(D){V(i,qt,D,"f")}}.value,hasOutput:{set value(D){V(r,Et,D,"f")}}.value,parsed:this.parsed,strict:{set value(D){V(a,Kt,D,"f")}}.value,strictCommands:{set value(D){V(c,Qt,D,"f")}}.value,strictOptions:{set value(D){V(g,Jt,D,"f")}}.value,completionCommand:{set value(D){V(p,Ot,D,"f")}}.value,parseFn:{set value(D){V(f,Dt,D,"f")}}.value,parseContext:{set value(D){V(h,Yt,D,"f")}}.value}=b,y(this,G,"f").configObjects=O,y(this,tt,"f").unfreeze(),y(this,ot,"f").unfreeze(),y(this,ct,"f").unfreeze(),y(this,Tt,"f").unfreeze()}[Ni](t,e){return ge(e,n=>(t(n),n))}getInternalMethods(){return{getCommandInstance:this[Pi].bind(this),getContext:this[Ai].bind(this),getHasOutput:this[Mi].bind(this),getLoggerInstance:this[Li].bind(this),getParseContext:this[Si].bind(this),getParserConfiguration:this[Zt].bind(this),getUsageConfiguration:this[Ti].bind(this),getUsageInstance:this[ji].bind(this),getValidationInstance:this[Fi].bind(this),hasParseCallback:this[Ne].bind(this),isGlobalContext:this[Ri].bind(this),postProcess:this[te].bind(this),reset:this[Ke].bind(this),runValidation:this[Qe].bind(this),runYargsParserAndExecuteCommands:this[le].bind(this),setHasOutput:this[Ui].bind(this)}}[Pi](){return y(this,ct,"f")}[Ai](){return y(this,ue,"f")}[Mi](){return y(this,Et,"f")}[Li](){return y(this,re,"f")}[Si](){return y(this,Yt,"f")||{}}[ji](){return y(this,tt,"f")}[Fi](){return y(this,ot,"f")}[Ne](){return!!y(this,Dt,"f")}[Ri](){return y(this,Ie,"f")}[te](t,e,n,s){return n||lt(t)||(e||(t=this[Ei](t)),(this[Zt]()["parse-positional-numbers"]||this[Zt]()["parse-positional-numbers"]===void 0)&&(t=this[xi](t)),s&&(t=me(t,this,y(this,Tt,"f").getMiddleware(),!1))),t}[Ke](t={}){V(this,G,y(this,G,"f")||{},"f");const e={};e.local=y(this,G,"f").local||[],e.configObjects=y(this,G,"f").configObjects||[];const n={};e.local.forEach(r=>{n[r]=!0,(t[r]||[]).forEach(a=>{n[a]=!0})}),Object.assign(y(this,kt,"f"),Object.keys(y(this,St,"f")).reduce((r,a)=>{const c=y(this,St,"f")[a].filter(g=>!(g in n));return c.length>0&&(r[a]=c),r},{})),V(this,St,{},"f");const s=["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"],i=["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"];return s.forEach(r=>{e[r]=(y(this,G,"f")[r]||[]).filter(a=>!n[a])}),i.forEach(r=>{e[r]=be(y(this,G,"f")[r],a=>!n[a])}),e.envPrefix=y(this,G,"f").envPrefix,V(this,G,e,"f"),V(this,tt,y(this,tt,"f")?y(this,tt,"f").reset(n):io(this,y(this,Z,"f")),"f"),V(this,ot,y(this,ot,"f")?y(this,ot,"f").reset(n):ho(this,y(this,tt,"f"),y(this,Z,"f")),"f"),V(this,ct,y(this,ct,"f")?y(this,ct,"f").reset():Js(y(this,tt,"f"),y(this,ot,"f"),y(this,Tt,"f"),y(this,Z,"f")),"f"),y(this,It,"f")||V(this,It,co(this,y(this,tt,"f"),y(this,ct,"f"),y(this,Z,"f")),"f"),y(this,Tt,"f").reset(),V(this,Ot,null,"f"),V(this,dt,"","f"),V(this,qt,null,"f"),V(this,Et,!1,"f"),this.parsed=!1,this}[Bi](t,e){return y(this,Z,"f").path.relative(t,e)}[le](t,e,n,s=0,i=!1){let r=!!n||i;t=t||y(this,Wt,"f"),y(this,G,"f").__=y(this,Z,"f").y18n.__,y(this,G,"f").configuration=this[Zt]();const a=!!y(this,G,"f").configuration["populate--"],c=Object.assign({},y(this,G,"f").configuration,{"populate--":!0}),g=y(this,Z,"f").Parser.detailed(t,Object.assign({},y(this,G,"f"),{configuration:{"parse-positional-numbers":!1,...c}})),p=Object.assign(g.argv,y(this,Yt,"f"));let f;const h=g.aliases;let b=!1,O=!1;Object.keys(p).forEach(D=>{D===y(this,vt,"f")&&p[D]?b=!0:D===y(this,jt,"f")&&p[D]&&(O=!0)}),p.$0=this.$0,this.parsed=g,s===0&&y(this,tt,"f").clearCachedHelpMessage();try{if(this[We](),e)return this[te](p,a,!!n,!1);y(this,vt,"f")&&[y(this,vt,"f")].concat(h[y(this,vt,"f")]||[]).filter(d=>d.length>1).includes(""+p._[p._.length-1])&&(p._.pop(),b=!0),V(this,Ie,!1,"f");const D=y(this,ct,"f").getCommands(),w=y(this,It,"f").completionKey in p,A=b||w||i;if(p._.length){if(D.length){let C;for(let d=s||0,E;p._[d]!==void 0;d++)if(E=String(p._[d]),D.includes(E)&&E!==y(this,Ot,"f")){const T=y(this,ct,"f").runCommand(E,this,g,d+1,i,b||O||i);return this[te](T,a,!!n,!1)}else if(!C&&E!==y(this,Ot,"f")){C=E;break}!y(this,ct,"f").hasDefaultCommand()&&y(this,ve,"f")&&C&&!A&&y(this,ot,"f").recommendCommands(C,D)}y(this,Ot,"f")&&p._.includes(y(this,Ot,"f"))&&!w&&(y(this,_t,"f")&&he(!0),this.showCompletionScript(),this.exit(0))}if(y(this,ct,"f").hasDefaultCommand()&&!A){const C=y(this,ct,"f").runCommand(null,this,g,0,i,b||O||i);return this[te](C,a,!!n,!1)}if(w){y(this,_t,"f")&&he(!0),t=[].concat(t);const C=t.slice(t.indexOf(`--${y(this,It,"f").completionKey}`)+1);return y(this,It,"f").getCompletion(C,(d,E)=>{if(d)throw new ut(d.message);(E||[]).forEach(T=>{y(this,re,"f").log(T)}),this.exit(0)}),this[te](p,!a,!!n,!1)}if(y(this,Et,"f")||(b?(y(this,_t,"f")&&he(!0),r=!0,this.showHelp("log"),this.exit(0)):O&&(y(this,_t,"f")&&he(!0),r=!0,y(this,tt,"f").showVersion("log"),this.exit(0))),!r&&y(this,G,"f").skipValidation.length>0&&(r=Object.keys(p).some(C=>y(this,G,"f").skipValidation.indexOf(C)>=0&&p[C]===!0)),!r){if(g.error)throw new ut(g.error.message);if(!w){const C=this[Qe](h,{},g.error);n||(f=me(p,this,y(this,Tt,"f").getMiddleware(),!0)),f=this[Ni](C,f??p),lt(f)&&!n&&(f=f.then(()=>me(p,this,y(this,Tt,"f").getMiddleware(),!1)))}}}catch(D){if(D instanceof ut)y(this,tt,"f").fail(D.message,D);else throw D}return this[te](f??p,a,!!n,!0)}[Qe](t,e,n,s){const i={...this.getDemandedOptions()};return r=>{if(n)throw new ut(n.message);y(this,ot,"f").nonOptionCount(r),y(this,ot,"f").requiredArguments(r,i);let a=!1;y(this,Qt,"f")&&(a=y(this,ot,"f").unknownCommands(r)),y(this,Kt,"f")&&!a?y(this,ot,"f").unknownArguments(r,t,e,!!s):y(this,Jt,"f")&&y(this,ot,"f").unknownArguments(r,t,{},!1,!1),y(this,ot,"f").limitedChoices(r),y(this,ot,"f").implications(r),y(this,ot,"f").conflicting(r)}}[Ui](){V(this,Et,!0,"f")}[ee](t){if(typeof t=="string")y(this,G,"f").key[t]=!0;else for(const e of t)y(this,G,"f").key[e]=!0}}function bo(o){return!!o&&typeof o.getInternalMethods=="function"}const wo=go(Hs);var Je={},Xi;function Vn(){return Xi||(Xi=1,function(){Je.defaults={"0.1":{explicitCharkey:!1,trim:!0,normalize:!0,normalizeTags:!1,attrkey:"@",charkey:"#",explicitArray:!1,ignoreAttrs:!1,mergeAttrs:!1,explicitRoot:!1,validator:null,xmlns:!1,explicitChildren:!1,childkey:"@@",charsAsChildren:!1,includeWhiteChars:!1,async:!1,strict:!0,attrNameProcessors:null,attrValueProcessors:null,tagNameProcessors:null,valueProcessors:null,emptyTag:""},"0.2":{explicitCharkey:!1,trim:!1,normalize:!1,normalizeTags:!1,attrkey:"$",charkey:"_",explicitArray:!0,ignoreAttrs:!1,mergeAttrs:!1,explicitRoot:!0,validator:null,xmlns:!1,explicitChildren:!1,preserveChildrenOrder:!1,childkey:"$$",charsAsChildren:!1,includeWhiteChars:!1,async:!1,strict:!0,attrNameProcessors:null,attrValueProcessors:null,tagNameProcessors:null,valueProcessors:null,rootName:"root",xmldec:{version:"1.0",encoding:"UTF-8",standalone:!0},doctype:null,renderOpts:{pretty:!0,indent:" ",newline:`
|
|
91
|
-
`},headless:!1,chunkSize:1e4,emptyTag:"",cdata:!1}}}.call(et)),Je}var Ze={},Ut={},Xt={},$i;function $t(){return $i||($i=1,function(){var o,t,e,n,s,i,r,a=[].slice,c={}.hasOwnProperty;o=function(){var g,p,f,h,b,O;if(O=arguments[0],b=2<=arguments.length?a.call(arguments,1):[],s(Object.assign))Object.assign.apply(null,arguments);else for(g=0,f=b.length;g<f;g++)if(h=b[g],h!=null)for(p in h)c.call(h,p)&&(O[p]=h[p]);return O},s=function(g){return!!g&&Object.prototype.toString.call(g)==="[object Function]"},i=function(g){var p;return!!g&&((p=typeof g)=="function"||p==="object")},e=function(g){return s(Array.isArray)?Array.isArray(g):Object.prototype.toString.call(g)==="[object Array]"},n=function(g){var p;if(e(g))return!g.length;for(p in g)if(c.call(g,p))return!1;return!0},r=function(g){var p,f;return i(g)&&(f=Object.getPrototypeOf(g))&&(p=f.constructor)&&typeof p=="function"&&p instanceof p&&Function.prototype.toString.call(p)===Function.prototype.toString.call(Object)},t=function(g){return s(g.valueOf)?g.valueOf():g},Xt.assign=o,Xt.isFunction=s,Xt.isObject=i,Xt.isArray=e,Xt.isEmpty=n,Xt.isPlainObject=r,Xt.getValue=t}.call(et)),Xt}var tn={exports:{}},qi;function Vr(){return qi||(qi=1,function(){tn.exports=function(){function o(){}return o.prototype.hasFeature=function(t,e){return!0},o.prototype.createDocumentType=function(t,e,n){throw new Error("This DOM method is not implemented.")},o.prototype.createDocument=function(t,e,n){throw new Error("This DOM method is not implemented.")},o.prototype.createHTMLDocument=function(t){throw new Error("This DOM method is not implemented.")},o.prototype.getFeature=function(t,e){throw new Error("This DOM method is not implemented.")},o}()}.call(et)),tn.exports}var en={exports:{}},nn={exports:{}},rn={exports:{}},Wi;function Oo(){return Wi||(Wi=1,function(){rn.exports=function(){function o(){}return o.prototype.handleError=function(t){throw new Error(t)},o}()}.call(et)),rn.exports}var sn={exports:{}},Vi;function Eo(){return Vi||(Vi=1,function(){sn.exports=function(){function o(t){this.arr=t||[]}return Object.defineProperty(o.prototype,"length",{get:function(){return this.arr.length}}),o.prototype.item=function(t){return this.arr[t]||null},o.prototype.contains=function(t){return this.arr.indexOf(t)!==-1},o}()}.call(et)),sn.exports}var Hi;function Do(){return Hi||(Hi=1,function(){var o,t;o=Oo(),t=Eo(),nn.exports=function(){function e(){this.defaultParams={"canonical-form":!1,"cdata-sections":!1,comments:!1,"datatype-normalization":!1,"element-content-whitespace":!0,entities:!0,"error-handler":new o,infoset:!0,"validate-if-schema":!1,namespaces:!0,"namespace-declarations":!0,"normalize-characters":!1,"schema-location":"","schema-type":"","split-cdata-sections":!0,validate:!1,"well-formed":!0},this.params=Object.create(this.defaultParams)}return Object.defineProperty(e.prototype,"parameterNames",{get:function(){return new t(Object.keys(this.defaultParams))}}),e.prototype.getParameter=function(n){return this.params.hasOwnProperty(n)?this.params[n]:null},e.prototype.canSetParameter=function(n,s){return!0},e.prototype.setParameter=function(n,s){return s!=null?this.params[n]=s:delete this.params[n]},e}()}.call(et)),nn.exports}var on={exports:{}},an={exports:{}},cn={exports:{}},zi;function ft(){return zi||(zi=1,function(){cn.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(et)),cn.exports}var un={exports:{}},Gi;function Hr(){return Gi||(Gi=1,function(){var o;o=ft(),Nt(),un.exports=function(){function t(e,n,s){if(this.parent=e,this.parent&&(this.options=this.parent.options,this.stringify=this.parent.stringify),n==null)throw new Error("Missing attribute name. "+this.debugInfo(n));this.name=this.stringify.name(n),this.value=this.stringify.attValue(s),this.type=o.Attribute,this.isId=!1,this.schemaTypeInfo=null}return Object.defineProperty(t.prototype,"nodeType",{get:function(){return this.type}}),Object.defineProperty(t.prototype,"ownerElement",{get:function(){return this.parent}}),Object.defineProperty(t.prototype,"textContent",{get:function(){return this.value},set:function(e){return this.value=e||""}}),Object.defineProperty(t.prototype,"namespaceURI",{get:function(){return""}}),Object.defineProperty(t.prototype,"prefix",{get:function(){return""}}),Object.defineProperty(t.prototype,"localName",{get:function(){return this.name}}),Object.defineProperty(t.prototype,"specified",{get:function(){return!0}}),t.prototype.clone=function(){return Object.create(this)},t.prototype.toString=function(e){return this.options.writer.attribute(this,this.options.writer.filterOptions(e))},t.prototype.debugInfo=function(e){return e=e||this.name,e==null?"parent: <"+this.parent.name+">":"attribute: {"+e+"}, parent: <"+this.parent.name+">"},t.prototype.isEqualNode=function(e){return!(e.namespaceURI!==this.namespaceURI||e.prefix!==this.prefix||e.localName!==this.localName||e.value!==this.value)},t}()}.call(et)),un.exports}var ln={exports:{}},Yi;function Hn(){return Yi||(Yi=1,function(){ln.exports=function(){function o(t){this.nodes=t}return Object.defineProperty(o.prototype,"length",{get:function(){return Object.keys(this.nodes).length||0}}),o.prototype.clone=function(){return this.nodes=null},o.prototype.getNamedItem=function(t){return this.nodes[t]},o.prototype.setNamedItem=function(t){var e;return e=this.nodes[t.nodeName],this.nodes[t.nodeName]=t,e||null},o.prototype.removeNamedItem=function(t){var e;return e=this.nodes[t],delete this.nodes[t],e||null},o.prototype.item=function(t){return this.nodes[Object.keys(this.nodes)[t]]||null},o.prototype.getNamedItemNS=function(t,e){throw new Error("This DOM method is not implemented.")},o.prototype.setNamedItemNS=function(t){throw new Error("This DOM method is not implemented.")},o.prototype.removeNamedItemNS=function(t,e){throw new Error("This DOM method is not implemented.")},o}()}.call(et)),ln.exports}var ki;function zn(){return ki||(ki=1,function(){var o,t,e,n,s,i,r,a,c=function(p,f){for(var h in f)g.call(f,h)&&(p[h]=f[h]);function b(){this.constructor=p}return b.prototype=f.prototype,p.prototype=new b,p.__super__=f.prototype,p},g={}.hasOwnProperty;a=$t(),r=a.isObject,i=a.isFunction,s=a.getValue,n=Nt(),o=ft(),t=Hr(),e=Hn(),an.exports=function(p){c(f,p);function f(h,b,O){var D,w,A,C;if(f.__super__.constructor.call(this,h),b==null)throw new Error("Missing element name. "+this.debugInfo());if(this.name=this.stringify.name(b),this.type=o.Element,this.attribs={},this.schemaTypeInfo=null,O!=null&&this.attribute(O),h.type===o.Document&&(this.isRoot=!0,this.documentObject=h,h.rootObject=this,h.children)){for(C=h.children,w=0,A=C.length;w<A;w++)if(D=C[w],D.type===o.DocType){D.name=this.name;break}}}return Object.defineProperty(f.prototype,"tagName",{get:function(){return this.name}}),Object.defineProperty(f.prototype,"namespaceURI",{get:function(){return""}}),Object.defineProperty(f.prototype,"prefix",{get:function(){return""}}),Object.defineProperty(f.prototype,"localName",{get:function(){return this.name}}),Object.defineProperty(f.prototype,"id",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),Object.defineProperty(f.prototype,"className",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),Object.defineProperty(f.prototype,"classList",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),Object.defineProperty(f.prototype,"attributes",{get:function(){return(!this.attributeMap||!this.attributeMap.nodes)&&(this.attributeMap=new e(this.attribs)),this.attributeMap}}),f.prototype.clone=function(){var h,b,O,D;O=Object.create(this),O.isRoot&&(O.documentObject=null),O.attribs={},D=this.attribs;for(b in D)g.call(D,b)&&(h=D[b],O.attribs[b]=h.clone());return O.children=[],this.children.forEach(function(w){var A;return A=w.clone(),A.parent=O,O.children.push(A)}),O},f.prototype.attribute=function(h,b){var O,D;if(h!=null&&(h=s(h)),r(h))for(O in h)g.call(h,O)&&(D=h[O],this.attribute(O,D));else i(b)&&(b=b.apply()),this.options.keepNullAttributes&&b==null?this.attribs[h]=new t(this,h,""):b!=null&&(this.attribs[h]=new t(this,h,b));return this},f.prototype.removeAttribute=function(h){var b,O,D;if(h==null)throw new Error("Missing attribute name. "+this.debugInfo());if(h=s(h),Array.isArray(h))for(O=0,D=h.length;O<D;O++)b=h[O],delete this.attribs[b];else delete this.attribs[h];return this},f.prototype.toString=function(h){return this.options.writer.element(this,this.options.writer.filterOptions(h))},f.prototype.att=function(h,b){return this.attribute(h,b)},f.prototype.a=function(h,b){return this.attribute(h,b)},f.prototype.getAttribute=function(h){return this.attribs.hasOwnProperty(h)?this.attribs[h].value:null},f.prototype.setAttribute=function(h,b){throw new Error("This DOM method is not implemented."+this.debugInfo())},f.prototype.getAttributeNode=function(h){return this.attribs.hasOwnProperty(h)?this.attribs[h]:null},f.prototype.setAttributeNode=function(h){throw new Error("This DOM method is not implemented."+this.debugInfo())},f.prototype.removeAttributeNode=function(h){throw new Error("This DOM method is not implemented."+this.debugInfo())},f.prototype.getElementsByTagName=function(h){throw new Error("This DOM method is not implemented."+this.debugInfo())},f.prototype.getAttributeNS=function(h,b){throw new Error("This DOM method is not implemented."+this.debugInfo())},f.prototype.setAttributeNS=function(h,b,O){throw new Error("This DOM method is not implemented."+this.debugInfo())},f.prototype.removeAttributeNS=function(h,b){throw new Error("This DOM method is not implemented."+this.debugInfo())},f.prototype.getAttributeNodeNS=function(h,b){throw new Error("This DOM method is not implemented."+this.debugInfo())},f.prototype.setAttributeNodeNS=function(h){throw new Error("This DOM method is not implemented."+this.debugInfo())},f.prototype.getElementsByTagNameNS=function(h,b){throw new Error("This DOM method is not implemented."+this.debugInfo())},f.prototype.hasAttribute=function(h){return this.attribs.hasOwnProperty(h)},f.prototype.hasAttributeNS=function(h,b){throw new Error("This DOM method is not implemented."+this.debugInfo())},f.prototype.setIdAttribute=function(h,b){return this.attribs.hasOwnProperty(h)?this.attribs[h].isId:b},f.prototype.setIdAttributeNS=function(h,b,O){throw new Error("This DOM method is not implemented."+this.debugInfo())},f.prototype.setIdAttributeNode=function(h,b){throw new Error("This DOM method is not implemented."+this.debugInfo())},f.prototype.getElementsByTagName=function(h){throw new Error("This DOM method is not implemented."+this.debugInfo())},f.prototype.getElementsByTagNameNS=function(h,b){throw new Error("This DOM method is not implemented."+this.debugInfo())},f.prototype.getElementsByClassName=function(h){throw new Error("This DOM method is not implemented."+this.debugInfo())},f.prototype.isEqualNode=function(h){var b,O,D;if(!f.__super__.isEqualNode.apply(this,arguments).isEqualNode(h)||h.namespaceURI!==this.namespaceURI||h.prefix!==this.prefix||h.localName!==this.localName||h.attribs.length!==this.attribs.length)return!1;for(b=O=0,D=this.attribs.length-1;0<=D?O<=D:O>=D;b=0<=D?++O:--O)if(!this.attribs[b].isEqualNode(h.attribs[b]))return!1;return!0},f}(n)}.call(et)),an.exports}var fn={exports:{}},hn={exports:{}},Ki;function je(){return Ki||(Ki=1,function(){var o,t=function(n,s){for(var i in s)e.call(s,i)&&(n[i]=s[i]);function r(){this.constructor=n}return r.prototype=s.prototype,n.prototype=new r,n.__super__=s.prototype,n},e={}.hasOwnProperty;o=Nt(),hn.exports=function(n){t(s,n);function s(i){s.__super__.constructor.call(this,i),this.value=""}return Object.defineProperty(s.prototype,"data",{get:function(){return this.value},set:function(i){return this.value=i||""}}),Object.defineProperty(s.prototype,"length",{get:function(){return this.value.length}}),Object.defineProperty(s.prototype,"textContent",{get:function(){return this.value},set:function(i){return this.value=i||""}}),s.prototype.clone=function(){return Object.create(this)},s.prototype.substringData=function(i,r){throw new Error("This DOM method is not implemented."+this.debugInfo())},s.prototype.appendData=function(i){throw new Error("This DOM method is not implemented."+this.debugInfo())},s.prototype.insertData=function(i,r){throw new Error("This DOM method is not implemented."+this.debugInfo())},s.prototype.deleteData=function(i,r){throw new Error("This DOM method is not implemented."+this.debugInfo())},s.prototype.replaceData=function(i,r,a){throw new Error("This DOM method is not implemented."+this.debugInfo())},s.prototype.isEqualNode=function(i){return!(!s.__super__.isEqualNode.apply(this,arguments).isEqualNode(i)||i.data!==this.data)},s}(o)}.call(et)),hn.exports}var Qi;function Gn(){return Qi||(Qi=1,function(){var o,t,e=function(s,i){for(var r in i)n.call(i,r)&&(s[r]=i[r]);function a(){this.constructor=s}return a.prototype=i.prototype,s.prototype=new a,s.__super__=i.prototype,s},n={}.hasOwnProperty;o=ft(),t=je(),fn.exports=function(s){e(i,s);function i(r,a){if(i.__super__.constructor.call(this,r),a==null)throw new Error("Missing CDATA text. "+this.debugInfo());this.name="#cdata-section",this.type=o.CData,this.value=this.stringify.cdata(a)}return i.prototype.clone=function(){return Object.create(this)},i.prototype.toString=function(r){return this.options.writer.cdata(this,this.options.writer.filterOptions(r))},i}(t)}.call(et)),fn.exports}var pn={exports:{}},Ji;function Yn(){return Ji||(Ji=1,function(){var o,t,e=function(s,i){for(var r in i)n.call(i,r)&&(s[r]=i[r]);function a(){this.constructor=s}return a.prototype=i.prototype,s.prototype=new a,s.__super__=i.prototype,s},n={}.hasOwnProperty;o=ft(),t=je(),pn.exports=function(s){e(i,s);function i(r,a){if(i.__super__.constructor.call(this,r),a==null)throw new Error("Missing comment text. "+this.debugInfo());this.name="#comment",this.type=o.Comment,this.value=this.stringify.comment(a)}return i.prototype.clone=function(){return Object.create(this)},i.prototype.toString=function(r){return this.options.writer.comment(this,this.options.writer.filterOptions(r))},i}(t)}.call(et)),pn.exports}var dn={exports:{}},Zi;function kn(){return Zi||(Zi=1,function(){var o,t,e,n=function(i,r){for(var a in r)s.call(r,a)&&(i[a]=r[a]);function c(){this.constructor=i}return c.prototype=r.prototype,i.prototype=new c,i.__super__=r.prototype,i},s={}.hasOwnProperty;e=$t().isObject,t=Nt(),o=ft(),dn.exports=function(i){n(r,i);function r(a,c,g,p){var f;r.__super__.constructor.call(this,a),e(c)&&(f=c,c=f.version,g=f.encoding,p=f.standalone),c||(c="1.0"),this.type=o.Declaration,this.version=this.stringify.xmlVersion(c),g!=null&&(this.encoding=this.stringify.xmlEncoding(g)),p!=null&&(this.standalone=this.stringify.xmlStandalone(p))}return r.prototype.toString=function(a){return this.options.writer.declaration(this,this.options.writer.filterOptions(a))},r}(t)}.call(et)),dn.exports}var mn={exports:{}},gn={exports:{}},tr;function Kn(){return tr||(tr=1,function(){var o,t,e=function(s,i){for(var r in i)n.call(i,r)&&(s[r]=i[r]);function a(){this.constructor=s}return a.prototype=i.prototype,s.prototype=new a,s.__super__=i.prototype,s},n={}.hasOwnProperty;t=Nt(),o=ft(),gn.exports=function(s){e(i,s);function i(r,a,c,g,p,f){if(i.__super__.constructor.call(this,r),a==null)throw new Error("Missing DTD element name. "+this.debugInfo());if(c==null)throw new Error("Missing DTD attribute name. "+this.debugInfo(a));if(!g)throw new Error("Missing DTD attribute type. "+this.debugInfo(a));if(!p)throw new Error("Missing DTD attribute default. "+this.debugInfo(a));if(p.indexOf("#")!==0&&(p="#"+p),!p.match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/))throw new Error("Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT. "+this.debugInfo(a));if(f&&!p.match(/^(#FIXED|#DEFAULT)$/))throw new Error("Default value only applies to #FIXED or #DEFAULT. "+this.debugInfo(a));this.elementName=this.stringify.name(a),this.type=o.AttributeDeclaration,this.attributeName=this.stringify.name(c),this.attributeType=this.stringify.dtdAttType(g),f&&(this.defaultValue=this.stringify.dtdAttDefault(f)),this.defaultValueType=p}return i.prototype.toString=function(r){return this.options.writer.dtdAttList(this,this.options.writer.filterOptions(r))},i}(t)}.call(et)),gn.exports}var yn={exports:{}},er;function Qn(){return er||(er=1,function(){var o,t,e,n=function(i,r){for(var a in r)s.call(r,a)&&(i[a]=r[a]);function c(){this.constructor=i}return c.prototype=r.prototype,i.prototype=new c,i.__super__=r.prototype,i},s={}.hasOwnProperty;e=$t().isObject,t=Nt(),o=ft(),yn.exports=function(i){n(r,i);function r(a,c,g,p){if(r.__super__.constructor.call(this,a),g==null)throw new Error("Missing DTD entity name. "+this.debugInfo(g));if(p==null)throw new Error("Missing DTD entity value. "+this.debugInfo(g));if(this.pe=!!c,this.name=this.stringify.name(g),this.type=o.EntityDeclaration,!e(p))this.value=this.stringify.dtdEntityValue(p),this.internal=!0;else{if(!p.pubID&&!p.sysID)throw new Error("Public and/or system identifiers are required for an external entity. "+this.debugInfo(g));if(p.pubID&&!p.sysID)throw new Error("System identifier is required for a public external entity. "+this.debugInfo(g));if(this.internal=!1,p.pubID!=null&&(this.pubID=this.stringify.dtdPubID(p.pubID)),p.sysID!=null&&(this.sysID=this.stringify.dtdSysID(p.sysID)),p.nData!=null&&(this.nData=this.stringify.dtdNData(p.nData)),this.pe&&this.nData)throw new Error("Notation declaration is not allowed in a parameter entity. "+this.debugInfo(g))}}return Object.defineProperty(r.prototype,"publicId",{get:function(){return this.pubID}}),Object.defineProperty(r.prototype,"systemId",{get:function(){return this.sysID}}),Object.defineProperty(r.prototype,"notationName",{get:function(){return this.nData||null}}),Object.defineProperty(r.prototype,"inputEncoding",{get:function(){return null}}),Object.defineProperty(r.prototype,"xmlEncoding",{get:function(){return null}}),Object.defineProperty(r.prototype,"xmlVersion",{get:function(){return null}}),r.prototype.toString=function(a){return this.options.writer.dtdEntity(this,this.options.writer.filterOptions(a))},r}(t)}.call(et)),yn.exports}var bn={exports:{}},nr;function Jn(){return nr||(nr=1,function(){var o,t,e=function(s,i){for(var r in i)n.call(i,r)&&(s[r]=i[r]);function a(){this.constructor=s}return a.prototype=i.prototype,s.prototype=new a,s.__super__=i.prototype,s},n={}.hasOwnProperty;t=Nt(),o=ft(),bn.exports=function(s){e(i,s);function i(r,a,c){if(i.__super__.constructor.call(this,r),a==null)throw new Error("Missing DTD element name. "+this.debugInfo());c||(c="(#PCDATA)"),Array.isArray(c)&&(c="("+c.join(",")+")"),this.name=this.stringify.name(a),this.type=o.ElementDeclaration,this.value=this.stringify.dtdElementValue(c)}return i.prototype.toString=function(r){return this.options.writer.dtdElement(this,this.options.writer.filterOptions(r))},i}(t)}.call(et)),bn.exports}var wn={exports:{}},ir;function Zn(){return ir||(ir=1,function(){var o,t,e=function(s,i){for(var r in i)n.call(i,r)&&(s[r]=i[r]);function a(){this.constructor=s}return a.prototype=i.prototype,s.prototype=new a,s.__super__=i.prototype,s},n={}.hasOwnProperty;t=Nt(),o=ft(),wn.exports=function(s){e(i,s);function i(r,a,c){if(i.__super__.constructor.call(this,r),a==null)throw new Error("Missing DTD notation name. "+this.debugInfo(a));if(!c.pubID&&!c.sysID)throw new Error("Public or system identifiers are required for an external entity. "+this.debugInfo(a));this.name=this.stringify.name(a),this.type=o.NotationDeclaration,c.pubID!=null&&(this.pubID=this.stringify.dtdPubID(c.pubID)),c.sysID!=null&&(this.sysID=this.stringify.dtdSysID(c.sysID))}return Object.defineProperty(i.prototype,"publicId",{get:function(){return this.pubID}}),Object.defineProperty(i.prototype,"systemId",{get:function(){return this.sysID}}),i.prototype.toString=function(r){return this.options.writer.dtdNotation(this,this.options.writer.filterOptions(r))},i}(t)}.call(et)),wn.exports}var rr;function ti(){return rr||(rr=1,function(){var o,t,e,n,s,i,r,a,c=function(p,f){for(var h in f)g.call(f,h)&&(p[h]=f[h]);function b(){this.constructor=p}return b.prototype=f.prototype,p.prototype=new b,p.__super__=f.prototype,p},g={}.hasOwnProperty;a=$t().isObject,r=Nt(),o=ft(),t=Kn(),n=Qn(),e=Jn(),s=Zn(),i=Hn(),mn.exports=function(p){c(f,p);function f(h,b,O){var D,w,A,C,d,E;if(f.__super__.constructor.call(this,h),this.type=o.DocType,h.children){for(C=h.children,w=0,A=C.length;w<A;w++)if(D=C[w],D.type===o.Element){this.name=D.name;break}}this.documentObject=h,a(b)&&(d=b,b=d.pubID,O=d.sysID),O==null&&(E=[b,O],O=E[0],b=E[1]),b!=null&&(this.pubID=this.stringify.dtdPubID(b)),O!=null&&(this.sysID=this.stringify.dtdSysID(O))}return Object.defineProperty(f.prototype,"entities",{get:function(){var h,b,O,D,w;for(D={},w=this.children,b=0,O=w.length;b<O;b++)h=w[b],h.type===o.EntityDeclaration&&!h.pe&&(D[h.name]=h);return new i(D)}}),Object.defineProperty(f.prototype,"notations",{get:function(){var h,b,O,D,w;for(D={},w=this.children,b=0,O=w.length;b<O;b++)h=w[b],h.type===o.NotationDeclaration&&(D[h.name]=h);return new i(D)}}),Object.defineProperty(f.prototype,"publicId",{get:function(){return this.pubID}}),Object.defineProperty(f.prototype,"systemId",{get:function(){return this.sysID}}),Object.defineProperty(f.prototype,"internalSubset",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),f.prototype.element=function(h,b){var O;return O=new e(this,h,b),this.children.push(O),this},f.prototype.attList=function(h,b,O,D,w){var A;return A=new t(this,h,b,O,D,w),this.children.push(A),this},f.prototype.entity=function(h,b){var O;return O=new n(this,!1,h,b),this.children.push(O),this},f.prototype.pEntity=function(h,b){var O;return O=new n(this,!0,h,b),this.children.push(O),this},f.prototype.notation=function(h,b){var O;return O=new s(this,h,b),this.children.push(O),this},f.prototype.toString=function(h){return this.options.writer.docType(this,this.options.writer.filterOptions(h))},f.prototype.ele=function(h,b){return this.element(h,b)},f.prototype.att=function(h,b,O,D,w){return this.attList(h,b,O,D,w)},f.prototype.ent=function(h,b){return this.entity(h,b)},f.prototype.pent=function(h,b){return this.pEntity(h,b)},f.prototype.not=function(h,b){return this.notation(h,b)},f.prototype.up=function(){return this.root()||this.documentObject},f.prototype.isEqualNode=function(h){return!(!f.__super__.isEqualNode.apply(this,arguments).isEqualNode(h)||h.name!==this.name||h.publicId!==this.publicId||h.systemId!==this.systemId)},f}(r)}.call(et)),mn.exports}var On={exports:{}},sr;function ei(){return sr||(sr=1,function(){var o,t,e=function(s,i){for(var r in i)n.call(i,r)&&(s[r]=i[r]);function a(){this.constructor=s}return a.prototype=i.prototype,s.prototype=new a,s.__super__=i.prototype,s},n={}.hasOwnProperty;o=ft(),t=Nt(),On.exports=function(s){e(i,s);function i(r,a){if(i.__super__.constructor.call(this,r),a==null)throw new Error("Missing raw text. "+this.debugInfo());this.type=o.Raw,this.value=this.stringify.raw(a)}return i.prototype.clone=function(){return Object.create(this)},i.prototype.toString=function(r){return this.options.writer.raw(this,this.options.writer.filterOptions(r))},i}(t)}.call(et)),On.exports}var En={exports:{}},or;function ni(){return or||(or=1,function(){var o,t,e=function(s,i){for(var r in i)n.call(i,r)&&(s[r]=i[r]);function a(){this.constructor=s}return a.prototype=i.prototype,s.prototype=new a,s.__super__=i.prototype,s},n={}.hasOwnProperty;o=ft(),t=je(),En.exports=function(s){e(i,s);function i(r,a){if(i.__super__.constructor.call(this,r),a==null)throw new Error("Missing element text. "+this.debugInfo());this.name="#text",this.type=o.Text,this.value=this.stringify.text(a)}return Object.defineProperty(i.prototype,"isElementContentWhitespace",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),Object.defineProperty(i.prototype,"wholeText",{get:function(){var r,a,c;for(c="",a=this.previousSibling;a;)c=a.data+c,a=a.previousSibling;for(c+=this.data,r=this.nextSibling;r;)c=c+r.data,r=r.nextSibling;return c}}),i.prototype.clone=function(){return Object.create(this)},i.prototype.toString=function(r){return this.options.writer.text(this,this.options.writer.filterOptions(r))},i.prototype.splitText=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.replaceWholeText=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())},i}(t)}.call(et)),En.exports}var Dn={exports:{}},ar;function ii(){return ar||(ar=1,function(){var o,t,e=function(s,i){for(var r in i)n.call(i,r)&&(s[r]=i[r]);function a(){this.constructor=s}return a.prototype=i.prototype,s.prototype=new a,s.__super__=i.prototype,s},n={}.hasOwnProperty;o=ft(),t=je(),Dn.exports=function(s){e(i,s);function i(r,a,c){if(i.__super__.constructor.call(this,r),a==null)throw new Error("Missing instruction target. "+this.debugInfo());this.type=o.ProcessingInstruction,this.target=this.stringify.insTarget(a),this.name=this.target,c&&(this.value=this.stringify.insValue(c))}return i.prototype.clone=function(){return Object.create(this)},i.prototype.toString=function(r){return this.options.writer.processingInstruction(this,this.options.writer.filterOptions(r))},i.prototype.isEqualNode=function(r){return!(!i.__super__.isEqualNode.apply(this,arguments).isEqualNode(r)||r.target!==this.target)},i}(t)}.call(et)),Dn.exports}var Cn={exports:{}},cr;function zr(){return cr||(cr=1,function(){var o,t,e=function(s,i){for(var r in i)n.call(i,r)&&(s[r]=i[r]);function a(){this.constructor=s}return a.prototype=i.prototype,s.prototype=new a,s.__super__=i.prototype,s},n={}.hasOwnProperty;t=Nt(),o=ft(),Cn.exports=function(s){e(i,s);function i(r){i.__super__.constructor.call(this,r),this.type=o.Dummy}return i.prototype.clone=function(){return Object.create(this)},i.prototype.toString=function(r){return""},i}(t)}.call(et)),Cn.exports}var In={exports:{}},ur;function Co(){return ur||(ur=1,function(){In.exports=function(){function o(t){this.nodes=t}return Object.defineProperty(o.prototype,"length",{get:function(){return this.nodes.length||0}}),o.prototype.clone=function(){return this.nodes=null},o.prototype.item=function(t){return this.nodes[t]||null},o}()}.call(et)),In.exports}var _n={exports:{}},lr;function Io(){return lr||(lr=1,function(){_n.exports={Disconnected:1,Preceding:2,Following:4,Contains:8,ContainedBy:16,ImplementationSpecific:32}}.call(et)),_n.exports}var fr;function Nt(){return fr||(fr=1,function(){var o,t,e,n,s,i,r,a,c,g,p,f,h,b,O,D,w,A={}.hasOwnProperty;w=$t(),D=w.isObject,O=w.isFunction,b=w.isEmpty,h=w.getValue,a=null,e=null,n=null,s=null,i=null,p=null,f=null,g=null,r=null,t=null,c=null,o=null,on.exports=function(){function C(d){this.parent=d,this.parent&&(this.options=this.parent.options,this.stringify=this.parent.stringify),this.value=null,this.children=[],this.baseURI=null,a||(a=zn(),e=Gn(),n=Yn(),s=kn(),i=ti(),p=ei(),f=ni(),g=ii(),r=zr(),t=ft(),c=Co(),Hn(),o=Io())}return Object.defineProperty(C.prototype,"nodeName",{get:function(){return this.name}}),Object.defineProperty(C.prototype,"nodeType",{get:function(){return this.type}}),Object.defineProperty(C.prototype,"nodeValue",{get:function(){return this.value}}),Object.defineProperty(C.prototype,"parentNode",{get:function(){return this.parent}}),Object.defineProperty(C.prototype,"childNodes",{get:function(){return(!this.childNodeList||!this.childNodeList.nodes)&&(this.childNodeList=new c(this.children)),this.childNodeList}}),Object.defineProperty(C.prototype,"firstChild",{get:function(){return this.children[0]||null}}),Object.defineProperty(C.prototype,"lastChild",{get:function(){return this.children[this.children.length-1]||null}}),Object.defineProperty(C.prototype,"previousSibling",{get:function(){var d;return d=this.parent.children.indexOf(this),this.parent.children[d-1]||null}}),Object.defineProperty(C.prototype,"nextSibling",{get:function(){var d;return d=this.parent.children.indexOf(this),this.parent.children[d+1]||null}}),Object.defineProperty(C.prototype,"ownerDocument",{get:function(){return this.document()||null}}),Object.defineProperty(C.prototype,"textContent",{get:function(){var d,E,T,F,U;if(this.nodeType===t.Element||this.nodeType===t.DocumentFragment){for(U="",F=this.children,E=0,T=F.length;E<T;E++)d=F[E],d.textContent&&(U+=d.textContent);return U}else return null},set:function(d){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),C.prototype.setParent=function(d){var E,T,F,U,j;for(this.parent=d,d&&(this.options=d.options,this.stringify=d.stringify),U=this.children,j=[],T=0,F=U.length;T<F;T++)E=U[T],j.push(E.setParent(this));return j},C.prototype.element=function(d,E,T){var F,U,j,u,M,N,L,B,X,Y,k;if(N=null,E===null&&T==null&&(X=[{},null],E=X[0],T=X[1]),E==null&&(E={}),E=h(E),D(E)||(Y=[E,T],T=Y[0],E=Y[1]),d!=null&&(d=h(d)),Array.isArray(d))for(j=0,L=d.length;j<L;j++)U=d[j],N=this.element(U);else if(O(d))N=this.element(d.apply());else if(D(d)){for(M in d)if(A.call(d,M))if(k=d[M],O(k)&&(k=k.apply()),!this.options.ignoreDecorators&&this.stringify.convertAttKey&&M.indexOf(this.stringify.convertAttKey)===0)N=this.attribute(M.substr(this.stringify.convertAttKey.length),k);else if(!this.options.separateArrayItems&&Array.isArray(k)&&b(k))N=this.dummy();else if(D(k)&&b(k))N=this.element(M);else if(!this.options.keepNullNodes&&k==null)N=this.dummy();else if(!this.options.separateArrayItems&&Array.isArray(k))for(u=0,B=k.length;u<B;u++)U=k[u],F={},F[M]=U,N=this.element(F);else D(k)?!this.options.ignoreDecorators&&this.stringify.convertTextKey&&M.indexOf(this.stringify.convertTextKey)===0?N=this.element(k):(N=this.element(M),N.element(k)):N=this.element(M,k)}else!this.options.keepNullNodes&&T===null?N=this.dummy():!this.options.ignoreDecorators&&this.stringify.convertTextKey&&d.indexOf(this.stringify.convertTextKey)===0?N=this.text(T):!this.options.ignoreDecorators&&this.stringify.convertCDataKey&&d.indexOf(this.stringify.convertCDataKey)===0?N=this.cdata(T):!this.options.ignoreDecorators&&this.stringify.convertCommentKey&&d.indexOf(this.stringify.convertCommentKey)===0?N=this.comment(T):!this.options.ignoreDecorators&&this.stringify.convertRawKey&&d.indexOf(this.stringify.convertRawKey)===0?N=this.raw(T):!this.options.ignoreDecorators&&this.stringify.convertPIKey&&d.indexOf(this.stringify.convertPIKey)===0?N=this.instruction(d.substr(this.stringify.convertPIKey.length),T):N=this.node(d,E,T);if(N==null)throw new Error("Could not create any elements with: "+d+". "+this.debugInfo());return N},C.prototype.insertBefore=function(d,E,T){var F,U,j,u,M;if(d?.type)return j=d,u=E,j.setParent(this),u?(U=children.indexOf(u),M=children.splice(U),children.push(j),Array.prototype.push.apply(children,M)):children.push(j),j;if(this.isRoot)throw new Error("Cannot insert elements at root level. "+this.debugInfo(d));return U=this.parent.children.indexOf(this),M=this.parent.children.splice(U),F=this.parent.element(d,E,T),Array.prototype.push.apply(this.parent.children,M),F},C.prototype.insertAfter=function(d,E,T){var F,U,j;if(this.isRoot)throw new Error("Cannot insert elements at root level. "+this.debugInfo(d));return U=this.parent.children.indexOf(this),j=this.parent.children.splice(U+1),F=this.parent.element(d,E,T),Array.prototype.push.apply(this.parent.children,j),F},C.prototype.remove=function(){var d;if(this.isRoot)throw new Error("Cannot remove the root element. "+this.debugInfo());return d=this.parent.children.indexOf(this),[].splice.apply(this.parent.children,[d,d-d+1].concat([])),this.parent},C.prototype.node=function(d,E,T){var F,U;return d!=null&&(d=h(d)),E||(E={}),E=h(E),D(E)||(U=[E,T],T=U[0],E=U[1]),F=new a(this,d,E),T!=null&&F.text(T),this.children.push(F),F},C.prototype.text=function(d){var E;return D(d)&&this.element(d),E=new f(this,d),this.children.push(E),this},C.prototype.cdata=function(d){var E;return E=new e(this,d),this.children.push(E),this},C.prototype.comment=function(d){var E;return E=new n(this,d),this.children.push(E),this},C.prototype.commentBefore=function(d){var E,T;return E=this.parent.children.indexOf(this),T=this.parent.children.splice(E),this.parent.comment(d),Array.prototype.push.apply(this.parent.children,T),this},C.prototype.commentAfter=function(d){var E,T;return E=this.parent.children.indexOf(this),T=this.parent.children.splice(E+1),this.parent.comment(d),Array.prototype.push.apply(this.parent.children,T),this},C.prototype.raw=function(d){var E;return E=new p(this,d),this.children.push(E),this},C.prototype.dummy=function(){var d;return d=new r(this),d},C.prototype.instruction=function(d,E){var T,F,U,j,u;if(d!=null&&(d=h(d)),E!=null&&(E=h(E)),Array.isArray(d))for(j=0,u=d.length;j<u;j++)T=d[j],this.instruction(T);else if(D(d))for(T in d)A.call(d,T)&&(F=d[T],this.instruction(T,F));else O(E)&&(E=E.apply()),U=new g(this,d,E),this.children.push(U);return this},C.prototype.instructionBefore=function(d,E){var T,F;return T=this.parent.children.indexOf(this),F=this.parent.children.splice(T),this.parent.instruction(d,E),Array.prototype.push.apply(this.parent.children,F),this},C.prototype.instructionAfter=function(d,E){var T,F;return T=this.parent.children.indexOf(this),F=this.parent.children.splice(T+1),this.parent.instruction(d,E),Array.prototype.push.apply(this.parent.children,F),this},C.prototype.declaration=function(d,E,T){var F,U;return F=this.document(),U=new s(F,d,E,T),F.children.length===0?F.children.unshift(U):F.children[0].type===t.Declaration?F.children[0]=U:F.children.unshift(U),F.root()||F},C.prototype.dtd=function(d,E){var T,F,U,j,u,M,N,L,B,X;for(F=this.document(),U=new i(F,d,E),B=F.children,j=u=0,N=B.length;u<N;j=++u)if(T=B[j],T.type===t.DocType)return F.children[j]=U,U;for(X=F.children,j=M=0,L=X.length;M<L;j=++M)if(T=X[j],T.isRoot)return F.children.splice(j,0,U),U;return F.children.push(U),U},C.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},C.prototype.root=function(){var d;for(d=this;d;){if(d.type===t.Document)return d.rootObject;if(d.isRoot)return d;d=d.parent}},C.prototype.document=function(){var d;for(d=this;d;){if(d.type===t.Document)return d;d=d.parent}},C.prototype.end=function(d){return this.document().end(d)},C.prototype.prev=function(){var d;if(d=this.parent.children.indexOf(this),d<1)throw new Error("Already at the first node. "+this.debugInfo());return this.parent.children[d-1]},C.prototype.next=function(){var d;if(d=this.parent.children.indexOf(this),d===-1||d===this.parent.children.length-1)throw new Error("Already at the last node. "+this.debugInfo());return this.parent.children[d+1]},C.prototype.importDocument=function(d){var E;return E=d.root().clone(),E.parent=this,E.isRoot=!1,this.children.push(E),this},C.prototype.debugInfo=function(d){var E,T;return d=d||this.name,d==null&&!((E=this.parent)!=null&&E.name)?"":d==null?"parent: <"+this.parent.name+">":(T=this.parent)!=null&&T.name?"node: <"+d+">, parent: <"+this.parent.name+">":"node: <"+d+">"},C.prototype.ele=function(d,E,T){return this.element(d,E,T)},C.prototype.nod=function(d,E,T){return this.node(d,E,T)},C.prototype.txt=function(d){return this.text(d)},C.prototype.dat=function(d){return this.cdata(d)},C.prototype.com=function(d){return this.comment(d)},C.prototype.ins=function(d,E){return this.instruction(d,E)},C.prototype.doc=function(){return this.document()},C.prototype.dec=function(d,E,T){return this.declaration(d,E,T)},C.prototype.e=function(d,E,T){return this.element(d,E,T)},C.prototype.n=function(d,E,T){return this.node(d,E,T)},C.prototype.t=function(d){return this.text(d)},C.prototype.d=function(d){return this.cdata(d)},C.prototype.c=function(d){return this.comment(d)},C.prototype.r=function(d){return this.raw(d)},C.prototype.i=function(d,E){return this.instruction(d,E)},C.prototype.u=function(){return this.up()},C.prototype.importXMLBuilder=function(d){return this.importDocument(d)},C.prototype.replaceChild=function(d,E){throw new Error("This DOM method is not implemented."+this.debugInfo())},C.prototype.removeChild=function(d){throw new Error("This DOM method is not implemented."+this.debugInfo())},C.prototype.appendChild=function(d){throw new Error("This DOM method is not implemented."+this.debugInfo())},C.prototype.hasChildNodes=function(){return this.children.length!==0},C.prototype.cloneNode=function(d){throw new Error("This DOM method is not implemented."+this.debugInfo())},C.prototype.normalize=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},C.prototype.isSupported=function(d,E){return!0},C.prototype.hasAttributes=function(){return this.attribs.length!==0},C.prototype.compareDocumentPosition=function(d){var E,T;return E=this,E===d?0:this.document()!==d.document()?(T=o.Disconnected|o.ImplementationSpecific,Math.random()<.5?T|=o.Preceding:T|=o.Following,T):E.isAncestor(d)?o.Contains|o.Preceding:E.isDescendant(d)?o.Contains|o.Following:E.isPreceding(d)?o.Preceding:o.Following},C.prototype.isSameNode=function(d){throw new Error("This DOM method is not implemented."+this.debugInfo())},C.prototype.lookupPrefix=function(d){throw new Error("This DOM method is not implemented."+this.debugInfo())},C.prototype.isDefaultNamespace=function(d){throw new Error("This DOM method is not implemented."+this.debugInfo())},C.prototype.lookupNamespaceURI=function(d){throw new Error("This DOM method is not implemented."+this.debugInfo())},C.prototype.isEqualNode=function(d){var E,T,F;if(d.nodeType!==this.nodeType||d.children.length!==this.children.length)return!1;for(E=T=0,F=this.children.length-1;0<=F?T<=F:T>=F;E=0<=F?++T:--T)if(!this.children[E].isEqualNode(d.children[E]))return!1;return!0},C.prototype.getFeature=function(d,E){throw new Error("This DOM method is not implemented."+this.debugInfo())},C.prototype.setUserData=function(d,E,T){throw new Error("This DOM method is not implemented."+this.debugInfo())},C.prototype.getUserData=function(d){throw new Error("This DOM method is not implemented."+this.debugInfo())},C.prototype.contains=function(d){return d?d===this||this.isDescendant(d):!1},C.prototype.isDescendant=function(d){var E,T,F,U,j;for(j=this.children,F=0,U=j.length;F<U;F++)if(E=j[F],d===E||(T=E.isDescendant(d),T))return!0;return!1},C.prototype.isAncestor=function(d){return d.isDescendant(this)},C.prototype.isPreceding=function(d){var E,T;return E=this.treePosition(d),T=this.treePosition(this),E===-1||T===-1?!1:E<T},C.prototype.isFollowing=function(d){var E,T;return E=this.treePosition(d),T=this.treePosition(this),E===-1||T===-1?!1:E>T},C.prototype.treePosition=function(d){var E,T;return T=0,E=!1,this.foreachTreeNode(this.document(),function(F){if(T++,!E&&F===d)return E=!0}),E?T:-1},C.prototype.foreachTreeNode=function(d,E){var T,F,U,j,u;for(d||(d=this.document()),j=d.children,F=0,U=j.length;F<U;F++){if(T=j[F],u=E(T))return u;if(u=this.foreachTreeNode(T,E),u)return u}},C}()}.call(et)),on.exports}var Tn={exports:{}},hr;function Gr(){return hr||(hr=1,function(){var o=function(e,n){return function(){return e.apply(n,arguments)}},t={}.hasOwnProperty;Tn.exports=function(){function e(n){this.assertLegalName=o(this.assertLegalName,this),this.assertLegalChar=o(this.assertLegalChar,this);var s,i,r;n||(n={}),this.options=n,this.options.version||(this.options.version="1.0"),i=n.stringify||{};for(s in i)t.call(i,s)&&(r=i[s],this[s]=r)}return e.prototype.name=function(n){return this.options.noValidation?n:this.assertLegalName(""+n||"")},e.prototype.text=function(n){return this.options.noValidation?n:this.assertLegalChar(this.textEscape(""+n||""))},e.prototype.cdata=function(n){return this.options.noValidation?n:(n=""+n||"",n=n.replace("]]>","]]]]><![CDATA[>"),this.assertLegalChar(n))},e.prototype.comment=function(n){if(this.options.noValidation)return n;if(n=""+n||"",n.match(/--/))throw new Error("Comment text cannot contain double-hypen: "+n);return this.assertLegalChar(n)},e.prototype.raw=function(n){return this.options.noValidation?n:""+n||""},e.prototype.attValue=function(n){return this.options.noValidation?n:this.assertLegalChar(this.attEscape(n=""+n||""))},e.prototype.insTarget=function(n){return this.options.noValidation?n:this.assertLegalChar(""+n||"")},e.prototype.insValue=function(n){if(this.options.noValidation)return n;if(n=""+n||"",n.match(/\?>/))throw new Error("Invalid processing instruction value: "+n);return this.assertLegalChar(n)},e.prototype.xmlVersion=function(n){if(this.options.noValidation)return n;if(n=""+n||"",!n.match(/1\.[0-9]+/))throw new Error("Invalid version number: "+n);return n},e.prototype.xmlEncoding=function(n){if(this.options.noValidation)return n;if(n=""+n||"",!n.match(/^[A-Za-z](?:[A-Za-z0-9._-])*$/))throw new Error("Invalid encoding: "+n);return this.assertLegalChar(n)},e.prototype.xmlStandalone=function(n){return this.options.noValidation?n:n?"yes":"no"},e.prototype.dtdPubID=function(n){return this.options.noValidation?n:this.assertLegalChar(""+n||"")},e.prototype.dtdSysID=function(n){return this.options.noValidation?n:this.assertLegalChar(""+n||"")},e.prototype.dtdElementValue=function(n){return this.options.noValidation?n:this.assertLegalChar(""+n||"")},e.prototype.dtdAttType=function(n){return this.options.noValidation?n:this.assertLegalChar(""+n||"")},e.prototype.dtdAttDefault=function(n){return this.options.noValidation?n:this.assertLegalChar(""+n||"")},e.prototype.dtdEntityValue=function(n){return this.options.noValidation?n:this.assertLegalChar(""+n||"")},e.prototype.dtdNData=function(n){return this.options.noValidation?n:this.assertLegalChar(""+n||"")},e.prototype.convertAttKey="@",e.prototype.convertPIKey="?",e.prototype.convertTextKey="#text",e.prototype.convertCDataKey="#cdata",e.prototype.convertCommentKey="#comment",e.prototype.convertRawKey="#raw",e.prototype.assertLegalChar=function(n){var s,i;if(this.options.noValidation)return n;if(s="",this.options.version==="1.0"){if(s=/[\0-\x08\x0B\f\x0E-\x1F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,i=n.match(s))throw new Error("Invalid character in string: "+n+" at index "+i.index)}else if(this.options.version==="1.1"&&(s=/[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,i=n.match(s)))throw new Error("Invalid character in string: "+n+" at index "+i.index);return n},e.prototype.assertLegalName=function(n){var s;if(this.options.noValidation)return n;if(this.assertLegalChar(n),s=/^([: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])*$/,!n.match(s))throw new Error("Invalid character in name");return n},e.prototype.textEscape=function(n){var s;return this.options.noValidation?n:(s=this.options.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,n.replace(s,"&").replace(/</g,"<").replace(/>/g,">").replace(/\r/g,"
"))},e.prototype.attEscape=function(n){var s;return this.options.noValidation?n:(s=this.options.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,n.replace(s,"&").replace(/</g,"<").replace(/"/g,""").replace(/\t/g,"	").replace(/\n/g,"
").replace(/\r/g,"
"))},e}()}.call(et)),Tn.exports}var vn={exports:{}},xn={exports:{}},Nn={exports:{}},pr;function Fe(){return pr||(pr=1,function(){Nn.exports={None:0,OpenTag:1,InsideTag:2,CloseTag:3}}.call(et)),Nn.exports}var dr;function Yr(){return dr||(dr=1,function(){var o,t,e,n={}.hasOwnProperty;e=$t().assign,o=ft(),kn(),ti(),Gn(),Yn(),zn(),ei(),ni(),ii(),zr(),Kn(),Jn(),Qn(),Zn(),t=Fe(),xn.exports=function(){function s(i){var r,a,c;i||(i={}),this.options=i,a=i.writer||{};for(r in a)n.call(a,r)&&(c=a[r],this["_"+r]=this[r],this[r]=c)}return s.prototype.filterOptions=function(i){var r,a,c,g,p,f,h,b;return i||(i={}),i=e({},this.options,i),r={writer:this},r.pretty=i.pretty||!1,r.allowEmpty=i.allowEmpty||!1,r.indent=(a=i.indent)!=null?a:" ",r.newline=(c=i.newline)!=null?c:`
|
|
92
|
-
`,r.offset=(g=i.offset)!=null?g:0,r.dontPrettyTextNodes=(p=(f=i.dontPrettyTextNodes)!=null?f:i.dontprettytextnodes)!=null?p:0,r.spaceBeforeSlash=(h=(b=i.spaceBeforeSlash)!=null?b:i.spacebeforeslash)!=null?h:"",r.spaceBeforeSlash===!0&&(r.spaceBeforeSlash=" "),r.suppressPrettyCount=0,r.user={},r.state=t.None,r},s.prototype.indent=function(i,r,a){var c;return!r.pretty||r.suppressPrettyCount?"":r.pretty&&(c=(a||0)+r.offset+1,c>0)?new Array(c).join(r.indent):""},s.prototype.endline=function(i,r,a){return!r.pretty||r.suppressPrettyCount?"":r.newline},s.prototype.attribute=function(i,r,a){var c;return this.openAttribute(i,r,a),c=" "+i.name+'="'+i.value+'"',this.closeAttribute(i,r,a),c},s.prototype.cdata=function(i,r,a){var c;return this.openNode(i,r,a),r.state=t.OpenTag,c=this.indent(i,r,a)+"<![CDATA[",r.state=t.InsideTag,c+=i.value,r.state=t.CloseTag,c+="]]>"+this.endline(i,r,a),r.state=t.None,this.closeNode(i,r,a),c},s.prototype.comment=function(i,r,a){var c;return this.openNode(i,r,a),r.state=t.OpenTag,c=this.indent(i,r,a)+"<!-- ",r.state=t.InsideTag,c+=i.value,r.state=t.CloseTag,c+=" -->"+this.endline(i,r,a),r.state=t.None,this.closeNode(i,r,a),c},s.prototype.declaration=function(i,r,a){var c;return this.openNode(i,r,a),r.state=t.OpenTag,c=this.indent(i,r,a)+"<?xml",r.state=t.InsideTag,c+=' version="'+i.version+'"',i.encoding!=null&&(c+=' encoding="'+i.encoding+'"'),i.standalone!=null&&(c+=' standalone="'+i.standalone+'"'),r.state=t.CloseTag,c+=r.spaceBeforeSlash+"?>",c+=this.endline(i,r,a),r.state=t.None,this.closeNode(i,r,a),c},s.prototype.docType=function(i,r,a){var c,g,p,f,h;if(a||(a=0),this.openNode(i,r,a),r.state=t.OpenTag,f=this.indent(i,r,a),f+="<!DOCTYPE "+i.root().name,i.pubID&&i.sysID?f+=' PUBLIC "'+i.pubID+'" "'+i.sysID+'"':i.sysID&&(f+=' SYSTEM "'+i.sysID+'"'),i.children.length>0){for(f+=" [",f+=this.endline(i,r,a),r.state=t.InsideTag,h=i.children,g=0,p=h.length;g<p;g++)c=h[g],f+=this.writeChildNode(c,r,a+1);r.state=t.CloseTag,f+="]"}return r.state=t.CloseTag,f+=r.spaceBeforeSlash+">",f+=this.endline(i,r,a),r.state=t.None,this.closeNode(i,r,a),f},s.prototype.element=function(i,r,a){var c,g,p,f,h,b,O,D,w,A,C,d,E,T;a||(a=0),A=!1,C="",this.openNode(i,r,a),r.state=t.OpenTag,C+=this.indent(i,r,a)+"<"+i.name,d=i.attribs;for(w in d)n.call(d,w)&&(c=d[w],C+=this.attribute(c,r,a));if(p=i.children.length,f=p===0?null:i.children[0],p===0||i.children.every(function(F){return(F.type===o.Text||F.type===o.Raw)&&F.value===""}))r.allowEmpty?(C+=">",r.state=t.CloseTag,C+="</"+i.name+">"+this.endline(i,r,a)):(r.state=t.CloseTag,C+=r.spaceBeforeSlash+"/>"+this.endline(i,r,a));else if(r.pretty&&p===1&&(f.type===o.Text||f.type===o.Raw)&&f.value!=null)C+=">",r.state=t.InsideTag,r.suppressPrettyCount++,A=!0,C+=this.writeChildNode(f,r,a+1),r.suppressPrettyCount--,A=!1,r.state=t.CloseTag,C+="</"+i.name+">"+this.endline(i,r,a);else{if(r.dontPrettyTextNodes){for(E=i.children,h=0,O=E.length;h<O;h++)if(g=E[h],(g.type===o.Text||g.type===o.Raw)&&g.value!=null){r.suppressPrettyCount++,A=!0;break}}for(C+=">"+this.endline(i,r,a),r.state=t.InsideTag,T=i.children,b=0,D=T.length;b<D;b++)g=T[b],C+=this.writeChildNode(g,r,a+1);r.state=t.CloseTag,C+=this.indent(i,r,a)+"</"+i.name+">",A&&r.suppressPrettyCount--,C+=this.endline(i,r,a),r.state=t.None}return this.closeNode(i,r,a),C},s.prototype.writeChildNode=function(i,r,a){switch(i.type){case o.CData:return this.cdata(i,r,a);case o.Comment:return this.comment(i,r,a);case o.Element:return this.element(i,r,a);case o.Raw:return this.raw(i,r,a);case o.Text:return this.text(i,r,a);case o.ProcessingInstruction:return this.processingInstruction(i,r,a);case o.Dummy:return"";case o.Declaration:return this.declaration(i,r,a);case o.DocType:return this.docType(i,r,a);case o.AttributeDeclaration:return this.dtdAttList(i,r,a);case o.ElementDeclaration:return this.dtdElement(i,r,a);case o.EntityDeclaration:return this.dtdEntity(i,r,a);case o.NotationDeclaration:return this.dtdNotation(i,r,a);default:throw new Error("Unknown XML node type: "+i.constructor.name)}},s.prototype.processingInstruction=function(i,r,a){var c;return this.openNode(i,r,a),r.state=t.OpenTag,c=this.indent(i,r,a)+"<?",r.state=t.InsideTag,c+=i.target,i.value&&(c+=" "+i.value),r.state=t.CloseTag,c+=r.spaceBeforeSlash+"?>",c+=this.endline(i,r,a),r.state=t.None,this.closeNode(i,r,a),c},s.prototype.raw=function(i,r,a){var c;return this.openNode(i,r,a),r.state=t.OpenTag,c=this.indent(i,r,a),r.state=t.InsideTag,c+=i.value,r.state=t.CloseTag,c+=this.endline(i,r,a),r.state=t.None,this.closeNode(i,r,a),c},s.prototype.text=function(i,r,a){var c;return this.openNode(i,r,a),r.state=t.OpenTag,c=this.indent(i,r,a),r.state=t.InsideTag,c+=i.value,r.state=t.CloseTag,c+=this.endline(i,r,a),r.state=t.None,this.closeNode(i,r,a),c},s.prototype.dtdAttList=function(i,r,a){var c;return this.openNode(i,r,a),r.state=t.OpenTag,c=this.indent(i,r,a)+"<!ATTLIST",r.state=t.InsideTag,c+=" "+i.elementName+" "+i.attributeName+" "+i.attributeType,i.defaultValueType!=="#DEFAULT"&&(c+=" "+i.defaultValueType),i.defaultValue&&(c+=' "'+i.defaultValue+'"'),r.state=t.CloseTag,c+=r.spaceBeforeSlash+">"+this.endline(i,r,a),r.state=t.None,this.closeNode(i,r,a),c},s.prototype.dtdElement=function(i,r,a){var c;return this.openNode(i,r,a),r.state=t.OpenTag,c=this.indent(i,r,a)+"<!ELEMENT",r.state=t.InsideTag,c+=" "+i.name+" "+i.value,r.state=t.CloseTag,c+=r.spaceBeforeSlash+">"+this.endline(i,r,a),r.state=t.None,this.closeNode(i,r,a),c},s.prototype.dtdEntity=function(i,r,a){var c;return this.openNode(i,r,a),r.state=t.OpenTag,c=this.indent(i,r,a)+"<!ENTITY",r.state=t.InsideTag,i.pe&&(c+=" %"),c+=" "+i.name,i.value?c+=' "'+i.value+'"':(i.pubID&&i.sysID?c+=' PUBLIC "'+i.pubID+'" "'+i.sysID+'"':i.sysID&&(c+=' SYSTEM "'+i.sysID+'"'),i.nData&&(c+=" NDATA "+i.nData)),r.state=t.CloseTag,c+=r.spaceBeforeSlash+">"+this.endline(i,r,a),r.state=t.None,this.closeNode(i,r,a),c},s.prototype.dtdNotation=function(i,r,a){var c;return this.openNode(i,r,a),r.state=t.OpenTag,c=this.indent(i,r,a)+"<!NOTATION",r.state=t.InsideTag,c+=" "+i.name,i.pubID&&i.sysID?c+=' PUBLIC "'+i.pubID+'" "'+i.sysID+'"':i.pubID?c+=' PUBLIC "'+i.pubID+'"':i.sysID&&(c+=' SYSTEM "'+i.sysID+'"'),r.state=t.CloseTag,c+=r.spaceBeforeSlash+">"+this.endline(i,r,a),r.state=t.None,this.closeNode(i,r,a),c},s.prototype.openNode=function(i,r,a){},s.prototype.closeNode=function(i,r,a){},s.prototype.openAttribute=function(i,r,a){},s.prototype.closeAttribute=function(i,r,a){},s}()}.call(et)),xn.exports}var mr;function ri(){return mr||(mr=1,function(){var o,t=function(n,s){for(var i in s)e.call(s,i)&&(n[i]=s[i]);function r(){this.constructor=n}return r.prototype=s.prototype,n.prototype=new r,n.__super__=s.prototype,n},e={}.hasOwnProperty;o=Yr(),vn.exports=function(n){t(s,n);function s(i){s.__super__.constructor.call(this,i)}return s.prototype.document=function(i,r){var a,c,g,p,f;for(r=this.filterOptions(r),p="",f=i.children,c=0,g=f.length;c<g;c++)a=f[c],p+=this.writeChildNode(a,r,0);return r.pretty&&p.slice(-r.newline.length)===r.newline&&(p=p.slice(0,-r.newline.length)),p},s}(o)}.call(et)),vn.exports}var gr;function kr(){return gr||(gr=1,function(){var o,t,e,n,s,i,r,a=function(g,p){for(var f in p)c.call(p,f)&&(g[f]=p[f]);function h(){this.constructor=g}return h.prototype=p.prototype,g.prototype=new h,g.__super__=p.prototype,g},c={}.hasOwnProperty;r=$t().isPlainObject,e=Vr(),t=Do(),n=Nt(),o=ft(),i=Gr(),s=ri(),en.exports=function(g){a(p,g);function p(f){p.__super__.constructor.call(this,null),this.name="#document",this.type=o.Document,this.documentURI=null,this.domConfig=new t,f||(f={}),f.writer||(f.writer=new s),this.options=f,this.stringify=new i(f)}return Object.defineProperty(p.prototype,"implementation",{value:new e}),Object.defineProperty(p.prototype,"doctype",{get:function(){var f,h,b,O;for(O=this.children,h=0,b=O.length;h<b;h++)if(f=O[h],f.type===o.DocType)return f;return null}}),Object.defineProperty(p.prototype,"documentElement",{get:function(){return this.rootObject||null}}),Object.defineProperty(p.prototype,"inputEncoding",{get:function(){return null}}),Object.defineProperty(p.prototype,"strictErrorChecking",{get:function(){return!1}}),Object.defineProperty(p.prototype,"xmlEncoding",{get:function(){return this.children.length!==0&&this.children[0].type===o.Declaration?this.children[0].encoding:null}}),Object.defineProperty(p.prototype,"xmlStandalone",{get:function(){return this.children.length!==0&&this.children[0].type===o.Declaration?this.children[0].standalone==="yes":!1}}),Object.defineProperty(p.prototype,"xmlVersion",{get:function(){return this.children.length!==0&&this.children[0].type===o.Declaration?this.children[0].version:"1.0"}}),Object.defineProperty(p.prototype,"URL",{get:function(){return this.documentURI}}),Object.defineProperty(p.prototype,"origin",{get:function(){return null}}),Object.defineProperty(p.prototype,"compatMode",{get:function(){return null}}),Object.defineProperty(p.prototype,"characterSet",{get:function(){return null}}),Object.defineProperty(p.prototype,"contentType",{get:function(){return null}}),p.prototype.end=function(f){var h;return h={},f?r(f)&&(h=f,f=this.options.writer):f=this.options.writer,f.document(this,f.filterOptions(h))},p.prototype.toString=function(f){return this.options.writer.document(this,this.options.writer.filterOptions(f))},p.prototype.createElement=function(f){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.createDocumentFragment=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.createTextNode=function(f){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.createComment=function(f){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.createCDATASection=function(f){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.createProcessingInstruction=function(f,h){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.createAttribute=function(f){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.createEntityReference=function(f){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.getElementsByTagName=function(f){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.importNode=function(f,h){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.createElementNS=function(f,h){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.createAttributeNS=function(f,h){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.getElementsByTagNameNS=function(f,h){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.getElementById=function(f){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.adoptNode=function(f){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.normalizeDocument=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.renameNode=function(f,h,b){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.getElementsByClassName=function(f){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.createEvent=function(f){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.createRange=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.createNodeIterator=function(f,h,b){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.createTreeWalker=function(f,h,b){throw new Error("This DOM method is not implemented."+this.debugInfo())},p}(n)}.call(et)),en.exports}var Pn={exports:{}},yr;function _o(){return yr||(yr=1,function(){var o,t,e,n,s,i,r,a,c,g,p,f,h,b,O,D,w,A,C,d,E,T,F,U={}.hasOwnProperty;F=$t(),E=F.isObject,d=F.isFunction,T=F.isPlainObject,C=F.getValue,o=ft(),f=kr(),h=zn(),n=Gn(),s=Yn(),O=ei(),A=ni(),b=ii(),g=kn(),p=ti(),i=Kn(),a=Qn(),r=Jn(),c=Zn(),e=Hr(),w=Gr(),D=ri(),t=Fe(),Pn.exports=function(){function j(u,M,N){var L;this.name="?xml",this.type=o.Document,u||(u={}),L={},u.writer?T(u.writer)&&(L=u.writer,u.writer=new D):u.writer=new D,this.options=u,this.writer=u.writer,this.writerOptions=this.writer.filterOptions(L),this.stringify=new w(u),this.onDataCallback=M||function(){},this.onEndCallback=N||function(){},this.currentNode=null,this.currentLevel=-1,this.openTags={},this.documentStarted=!1,this.documentCompleted=!1,this.root=null}return j.prototype.createChildNode=function(u){var M,N,L,B,X,Y,k,q;switch(u.type){case o.CData:this.cdata(u.value);break;case o.Comment:this.comment(u.value);break;case o.Element:L={},k=u.attribs;for(N in k)U.call(k,N)&&(M=k[N],L[N]=M.value);this.node(u.name,L);break;case o.Dummy:this.dummy();break;case o.Raw:this.raw(u.value);break;case o.Text:this.text(u.value);break;case o.ProcessingInstruction:this.instruction(u.target,u.value);break;default:throw new Error("This XML node type is not supported in a JS object: "+u.constructor.name)}for(q=u.children,X=0,Y=q.length;X<Y;X++)B=q[X],this.createChildNode(B),B.type===o.Element&&this.up();return this},j.prototype.dummy=function(){return this},j.prototype.node=function(u,M,N){var L;if(u==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(u));return this.openCurrent(),u=C(u),M==null&&(M={}),M=C(M),E(M)||(L=[M,N],N=L[0],M=L[1]),this.currentNode=new h(this,u,M),this.currentNode.children=!1,this.currentLevel++,this.openTags[this.currentLevel]=this.currentNode,N!=null&&this.text(N),this},j.prototype.element=function(u,M,N){var L,B,X,Y,k,q;if(this.currentNode&&this.currentNode.type===o.DocType)this.dtdElement.apply(this,arguments);else if(Array.isArray(u)||E(u)||d(u))for(Y=this.options.noValidation,this.options.noValidation=!0,q=new f(this.options).element("TEMP_ROOT"),q.element(u),this.options.noValidation=Y,k=q.children,B=0,X=k.length;B<X;B++)L=k[B],this.createChildNode(L),L.type===o.Element&&this.up();else this.node(u,M,N);return this},j.prototype.attribute=function(u,M){var N,L;if(!this.currentNode||this.currentNode.children)throw new Error("att() can only be used immediately after an ele() call in callback mode. "+this.debugInfo(u));if(u!=null&&(u=C(u)),E(u))for(N in u)U.call(u,N)&&(L=u[N],this.attribute(N,L));else d(M)&&(M=M.apply()),this.options.keepNullAttributes&&M==null?this.currentNode.attribs[u]=new e(this,u,""):M!=null&&(this.currentNode.attribs[u]=new e(this,u,M));return this},j.prototype.text=function(u){var M;return this.openCurrent(),M=new A(this,u),this.onData(this.writer.text(M,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},j.prototype.cdata=function(u){var M;return this.openCurrent(),M=new n(this,u),this.onData(this.writer.cdata(M,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},j.prototype.comment=function(u){var M;return this.openCurrent(),M=new s(this,u),this.onData(this.writer.comment(M,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},j.prototype.raw=function(u){var M;return this.openCurrent(),M=new O(this,u),this.onData(this.writer.raw(M,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},j.prototype.instruction=function(u,M){var N,L,B,X,Y;if(this.openCurrent(),u!=null&&(u=C(u)),M!=null&&(M=C(M)),Array.isArray(u))for(N=0,X=u.length;N<X;N++)L=u[N],this.instruction(L);else if(E(u))for(L in u)U.call(u,L)&&(B=u[L],this.instruction(L,B));else d(M)&&(M=M.apply()),Y=new b(this,u,M),this.onData(this.writer.processingInstruction(Y,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this},j.prototype.declaration=function(u,M,N){var L;if(this.openCurrent(),this.documentStarted)throw new Error("declaration() must be the first node.");return L=new g(this,u,M,N),this.onData(this.writer.declaration(L,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},j.prototype.doctype=function(u,M,N){if(this.openCurrent(),u==null)throw new Error("Missing root node name.");if(this.root)throw new Error("dtd() must come before the root node.");return this.currentNode=new p(this,M,N),this.currentNode.rootNodeName=u,this.currentNode.children=!1,this.currentLevel++,this.openTags[this.currentLevel]=this.currentNode,this},j.prototype.dtdElement=function(u,M){var N;return this.openCurrent(),N=new r(this,u,M),this.onData(this.writer.dtdElement(N,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},j.prototype.attList=function(u,M,N,L,B){var X;return this.openCurrent(),X=new i(this,u,M,N,L,B),this.onData(this.writer.dtdAttList(X,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},j.prototype.entity=function(u,M){var N;return this.openCurrent(),N=new a(this,!1,u,M),this.onData(this.writer.dtdEntity(N,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},j.prototype.pEntity=function(u,M){var N;return this.openCurrent(),N=new a(this,!0,u,M),this.onData(this.writer.dtdEntity(N,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},j.prototype.notation=function(u,M){var N;return this.openCurrent(),N=new c(this,u,M),this.onData(this.writer.dtdNotation(N,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},j.prototype.up=function(){if(this.currentLevel<0)throw new Error("The document node has no parent.");return this.currentNode?(this.currentNode.children?this.closeNode(this.currentNode):this.openNode(this.currentNode),this.currentNode=null):this.closeNode(this.openTags[this.currentLevel]),delete this.openTags[this.currentLevel],this.currentLevel--,this},j.prototype.end=function(){for(;this.currentLevel>=0;)this.up();return this.onEnd()},j.prototype.openCurrent=function(){if(this.currentNode)return this.currentNode.children=!0,this.openNode(this.currentNode)},j.prototype.openNode=function(u){var M,N,L,B;if(!u.isOpen){if(!this.root&&this.currentLevel===0&&u.type===o.Element&&(this.root=u),N="",u.type===o.Element){this.writerOptions.state=t.OpenTag,N=this.writer.indent(u,this.writerOptions,this.currentLevel)+"<"+u.name,B=u.attribs;for(L in B)U.call(B,L)&&(M=B[L],N+=this.writer.attribute(M,this.writerOptions,this.currentLevel));N+=(u.children?">":"/>")+this.writer.endline(u,this.writerOptions,this.currentLevel),this.writerOptions.state=t.InsideTag}else this.writerOptions.state=t.OpenTag,N=this.writer.indent(u,this.writerOptions,this.currentLevel)+"<!DOCTYPE "+u.rootNodeName,u.pubID&&u.sysID?N+=' PUBLIC "'+u.pubID+'" "'+u.sysID+'"':u.sysID&&(N+=' SYSTEM "'+u.sysID+'"'),u.children?(N+=" [",this.writerOptions.state=t.InsideTag):(this.writerOptions.state=t.CloseTag,N+=">"),N+=this.writer.endline(u,this.writerOptions,this.currentLevel);return this.onData(N,this.currentLevel),u.isOpen=!0}},j.prototype.closeNode=function(u){var M;if(!u.isClosed)return M="",this.writerOptions.state=t.CloseTag,u.type===o.Element?M=this.writer.indent(u,this.writerOptions,this.currentLevel)+"</"+u.name+">"+this.writer.endline(u,this.writerOptions,this.currentLevel):M=this.writer.indent(u,this.writerOptions,this.currentLevel)+"]>"+this.writer.endline(u,this.writerOptions,this.currentLevel),this.writerOptions.state=t.None,this.onData(M,this.currentLevel),u.isClosed=!0},j.prototype.onData=function(u,M){return this.documentStarted=!0,this.onDataCallback(u,M+1)},j.prototype.onEnd=function(){return this.documentCompleted=!0,this.onEndCallback()},j.prototype.debugInfo=function(u){return u==null?"":"node: <"+u+">"},j.prototype.ele=function(){return this.element.apply(this,arguments)},j.prototype.nod=function(u,M,N){return this.node(u,M,N)},j.prototype.txt=function(u){return this.text(u)},j.prototype.dat=function(u){return this.cdata(u)},j.prototype.com=function(u){return this.comment(u)},j.prototype.ins=function(u,M){return this.instruction(u,M)},j.prototype.dec=function(u,M,N){return this.declaration(u,M,N)},j.prototype.dtd=function(u,M,N){return this.doctype(u,M,N)},j.prototype.e=function(u,M,N){return this.element(u,M,N)},j.prototype.n=function(u,M,N){return this.node(u,M,N)},j.prototype.t=function(u){return this.text(u)},j.prototype.d=function(u){return this.cdata(u)},j.prototype.c=function(u){return this.comment(u)},j.prototype.r=function(u){return this.raw(u)},j.prototype.i=function(u,M){return this.instruction(u,M)},j.prototype.att=function(){return this.currentNode&&this.currentNode.type===o.DocType?this.attList.apply(this,arguments):this.attribute.apply(this,arguments)},j.prototype.a=function(){return this.currentNode&&this.currentNode.type===o.DocType?this.attList.apply(this,arguments):this.attribute.apply(this,arguments)},j.prototype.ent=function(u,M){return this.entity(u,M)},j.prototype.pent=function(u,M){return this.pEntity(u,M)},j.prototype.not=function(u,M){return this.notation(u,M)},j}()}.call(et)),Pn.exports}var An={exports:{}},br;function To(){return br||(br=1,function(){var o,t,e,n=function(i,r){for(var a in r)s.call(r,a)&&(i[a]=r[a]);function c(){this.constructor=i}return c.prototype=r.prototype,i.prototype=new c,i.__super__=r.prototype,i},s={}.hasOwnProperty;o=ft(),e=Yr(),t=Fe(),An.exports=function(i){n(r,i);function r(a,c){this.stream=a,r.__super__.constructor.call(this,c)}return r.prototype.endline=function(a,c,g){return a.isLastRootNode&&c.state===t.CloseTag?"":r.__super__.endline.call(this,a,c,g)},r.prototype.document=function(a,c){var g,p,f,h,b,O,D,w,A;for(D=a.children,p=f=0,b=D.length;f<b;p=++f)g=D[p],g.isLastRootNode=p===a.children.length-1;for(c=this.filterOptions(c),w=a.children,A=[],h=0,O=w.length;h<O;h++)g=w[h],A.push(this.writeChildNode(g,c,0));return A},r.prototype.attribute=function(a,c,g){return this.stream.write(r.__super__.attribute.call(this,a,c,g))},r.prototype.cdata=function(a,c,g){return this.stream.write(r.__super__.cdata.call(this,a,c,g))},r.prototype.comment=function(a,c,g){return this.stream.write(r.__super__.comment.call(this,a,c,g))},r.prototype.declaration=function(a,c,g){return this.stream.write(r.__super__.declaration.call(this,a,c,g))},r.prototype.docType=function(a,c,g){var p,f,h,b;if(g||(g=0),this.openNode(a,c,g),c.state=t.OpenTag,this.stream.write(this.indent(a,c,g)),this.stream.write("<!DOCTYPE "+a.root().name),a.pubID&&a.sysID?this.stream.write(' PUBLIC "'+a.pubID+'" "'+a.sysID+'"'):a.sysID&&this.stream.write(' SYSTEM "'+a.sysID+'"'),a.children.length>0){for(this.stream.write(" ["),this.stream.write(this.endline(a,c,g)),c.state=t.InsideTag,b=a.children,f=0,h=b.length;f<h;f++)p=b[f],this.writeChildNode(p,c,g+1);c.state=t.CloseTag,this.stream.write("]")}return c.state=t.CloseTag,this.stream.write(c.spaceBeforeSlash+">"),this.stream.write(this.endline(a,c,g)),c.state=t.None,this.closeNode(a,c,g)},r.prototype.element=function(a,c,g){var p,f,h,b,O,D,w,A,C;g||(g=0),this.openNode(a,c,g),c.state=t.OpenTag,this.stream.write(this.indent(a,c,g)+"<"+a.name),A=a.attribs;for(w in A)s.call(A,w)&&(p=A[w],this.attribute(p,c,g));if(h=a.children.length,b=h===0?null:a.children[0],h===0||a.children.every(function(d){return(d.type===o.Text||d.type===o.Raw)&&d.value===""}))c.allowEmpty?(this.stream.write(">"),c.state=t.CloseTag,this.stream.write("</"+a.name+">")):(c.state=t.CloseTag,this.stream.write(c.spaceBeforeSlash+"/>"));else if(c.pretty&&h===1&&(b.type===o.Text||b.type===o.Raw)&&b.value!=null)this.stream.write(">"),c.state=t.InsideTag,c.suppressPrettyCount++,this.writeChildNode(b,c,g+1),c.suppressPrettyCount--,c.state=t.CloseTag,this.stream.write("</"+a.name+">");else{for(this.stream.write(">"+this.endline(a,c,g)),c.state=t.InsideTag,C=a.children,O=0,D=C.length;O<D;O++)f=C[O],this.writeChildNode(f,c,g+1);c.state=t.CloseTag,this.stream.write(this.indent(a,c,g)+"</"+a.name+">")}return this.stream.write(this.endline(a,c,g)),c.state=t.None,this.closeNode(a,c,g)},r.prototype.processingInstruction=function(a,c,g){return this.stream.write(r.__super__.processingInstruction.call(this,a,c,g))},r.prototype.raw=function(a,c,g){return this.stream.write(r.__super__.raw.call(this,a,c,g))},r.prototype.text=function(a,c,g){return this.stream.write(r.__super__.text.call(this,a,c,g))},r.prototype.dtdAttList=function(a,c,g){return this.stream.write(r.__super__.dtdAttList.call(this,a,c,g))},r.prototype.dtdElement=function(a,c,g){return this.stream.write(r.__super__.dtdElement.call(this,a,c,g))},r.prototype.dtdEntity=function(a,c,g){return this.stream.write(r.__super__.dtdEntity.call(this,a,c,g))},r.prototype.dtdNotation=function(a,c,g){return this.stream.write(r.__super__.dtdNotation.call(this,a,c,g))},r}(e)}.call(et)),An.exports}var wr;function vo(){return wr||(wr=1,function(){var o,t,e,n,s,i,r,a,c,g;g=$t(),a=g.assign,c=g.isFunction,e=Vr(),n=kr(),s=_o(),r=ri(),i=To(),o=ft(),t=Fe(),Ut.create=function(p,f,h,b){var O,D;if(p==null)throw new Error("Root element needs a name.");return b=a({},f,h,b),O=new n(b),D=O.element(p),b.headless||(O.declaration(b),(b.pubID!=null||b.sysID!=null)&&O.dtd(b)),D},Ut.begin=function(p,f,h){var b;return c(p)&&(b=[p,f],f=b[0],h=b[1],p={}),f?new s(p,f,h):new n(p)},Ut.stringWriter=function(p){return new r(p)},Ut.streamWriter=function(p,f){return new i(p,f)},Ut.implementation=new e,Ut.nodeType=o,Ut.writerState=t}.call(et)),Ut}var Or;function xo(){return Or||(Or=1,function(){var o,t,e,n,s,i={}.hasOwnProperty;o=vo(),t=Vn().defaults,n=function(r){return typeof r=="string"&&(r.indexOf("&")>=0||r.indexOf(">")>=0||r.indexOf("<")>=0)},s=function(r){return"<![CDATA["+e(r)+"]]>"},e=function(r){return r.replace("]]>","]]]]><![CDATA[>")},Ze.Builder=function(){function r(a){var c,g,p;this.options={},g=t["0.2"];for(c in g)i.call(g,c)&&(p=g[c],this.options[c]=p);for(c in a)i.call(a,c)&&(p=a[c],this.options[c]=p)}return r.prototype.buildObject=function(a){var c,g,p,f,h;return c=this.options.attrkey,g=this.options.charkey,Object.keys(a).length===1&&this.options.rootName===t["0.2"].rootName?(h=Object.keys(a)[0],a=a[h]):h=this.options.rootName,p=function(b){return function(O,D){var w,A,C,d,E,T;if(typeof D!="object")b.options.cdata&&n(D)?O.raw(s(D)):O.txt(D);else if(Array.isArray(D)){for(d in D)if(i.call(D,d)){A=D[d];for(E in A)C=A[E],O=p(O.ele(E),C).up()}}else for(E in D)if(i.call(D,E))if(A=D[E],E===c){if(typeof A=="object")for(w in A)T=A[w],O=O.att(w,T)}else if(E===g)b.options.cdata&&n(A)?O=O.raw(s(A)):O=O.txt(A);else if(Array.isArray(A))for(d in A)i.call(A,d)&&(C=A[d],typeof C=="string"?b.options.cdata&&n(C)?O=O.ele(E).raw(s(C)).up():O=O.ele(E,C).up():O=p(O.ele(E),C).up());else typeof A=="object"?O=p(O.ele(E),A).up():typeof A=="string"&&b.options.cdata&&n(A)?O=O.ele(E).raw(s(A)).up():(A==null&&(A=""),O=O.ele(E,A.toString()).up());return O}}(this),f=o.create(h,this.options.xmldec,this.options.doctype,{headless:this.options.headless,allowSurrogateChars:this.options.allowSurrogateChars}),p(f,a).end(this.options.renderOpts)},r}()}.call(et)),Ze}var Mn={},Ln={},Er;function No(){return Er||(Er=1,function(o){(function(t){t.parser=function(m,l){return new n(m,l)},t.SAXParser=n,t.SAXStream=p,t.createStream=g,t.MAX_BUFFER_LENGTH=64*1024;var e=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];t.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"];function n(m,l){if(!(this instanceof n))return new n(m,l);var P=this;i(P),P.q=P.c="",P.bufferCheckPosition=t.MAX_BUFFER_LENGTH,P.opt=l||{},P.opt.lowercase=P.opt.lowercase||P.opt.lowercasetags,P.looseCase=P.opt.lowercase?"toLowerCase":"toUpperCase",P.tags=[],P.closed=P.closedRoot=P.sawRoot=!1,P.tag=P.error=null,P.strict=!!m,P.noscript=!!(m||P.opt.noscript),P.state=u.BEGIN,P.strictEntities=P.opt.strictEntities,P.ENTITIES=P.strictEntities?Object.create(t.XML_ENTITIES):Object.create(t.ENTITIES),P.attribList=[],P.opt.xmlns&&(P.ns=Object.create(D)),P.opt.unquotedAttributeValues===void 0&&(P.opt.unquotedAttributeValues=!m),P.trackPosition=P.opt.position!==!1,P.trackPosition&&(P.position=P.line=P.column=0),N(P,"onready")}Object.create||(Object.create=function(m){function l(){}l.prototype=m;var P=new l;return P}),Object.keys||(Object.keys=function(m){var l=[];for(var P in m)m.hasOwnProperty(P)&&l.push(P);return l});function s(m){for(var l=Math.max(t.MAX_BUFFER_LENGTH,10),P=0,_=0,J=e.length;_<J;_++){var nt=m[e[_]].length;if(nt>l)switch(e[_]){case"textNode":B(m);break;case"cdata":L(m,"oncdata",m.cdata),m.cdata="";break;case"script":L(m,"onscript",m.script),m.script="";break;default:Y(m,"Max buffer length exceeded: "+e[_])}P=Math.max(P,nt)}var it=t.MAX_BUFFER_LENGTH-P;m.bufferCheckPosition=it+m.position}function i(m){for(var l=0,P=e.length;l<P;l++)m[e[l]]=""}function r(m){B(m),m.cdata!==""&&(L(m,"oncdata",m.cdata),m.cdata=""),m.script!==""&&(L(m,"onscript",m.script),m.script="")}n.prototype={end:function(){k(this)},write:K,resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){r(this)}};var a;try{a=require("stream").Stream}catch{a=function(){}}a||(a=function(){});var c=t.EVENTS.filter(function(m){return m!=="error"&&m!=="end"});function g(m,l){return new p(m,l)}function p(m,l){if(!(this instanceof p))return new p(m,l);a.apply(this),this._parser=new n(m,l),this.writable=!0,this.readable=!0;var P=this;this._parser.onend=function(){P.emit("end")},this._parser.onerror=function(_){P.emit("error",_),P._parser.error=null},this._decoder=null,c.forEach(function(_){Object.defineProperty(P,"on"+_,{get:function(){return P._parser["on"+_]},set:function(J){if(!J)return P.removeAllListeners(_),P._parser["on"+_]=J,J;P.on(_,J)},enumerable:!0,configurable:!1})})}p.prototype=Object.create(a.prototype,{constructor:{value:p}}),p.prototype.write=function(m){return typeof Buffer=="function"&&typeof Buffer.isBuffer=="function"&&Buffer.isBuffer(m)&&(this._decoder||(this._decoder=new TextDecoder("utf8")),m=this._decoder.decode(m,{stream:!0})),this._parser.write(m.toString()),this.emit("data",m),!0},p.prototype.end=function(m){if(m&&m.length&&this.write(m),this._decoder){var l=this._decoder.decode();l&&(this._parser.write(l),this.emit("data",l))}return this._parser.end(),!0},p.prototype.on=function(m,l){var P=this;return!P._parser["on"+m]&&c.indexOf(m)!==-1&&(P._parser["on"+m]=function(){var _=arguments.length===1?[arguments[0]]:Array.apply(null,arguments);_.splice(0,0,m),P.emit.apply(P,_)}),a.prototype.on.call(P,m,l)};var f="[CDATA[",h="DOCTYPE",b="http://www.w3.org/XML/1998/namespace",O="http://www.w3.org/2000/xmlns/",D={xml:b,xmlns:O},w=/[:_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]/,A=/[:_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-]/,C=/[#:_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]/,d=/[#:_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 E(m){return m===" "||m===`
|
|
93
|
-
`||m==="\r"||m===" "}function T(m){return m==='"'||m==="'"}function F(m){return m===">"||E(m)}function U(m,
|
|
91
|
+
`},headless:!1,chunkSize:1e4,emptyTag:"",cdata:!1}}}.call(et)),Je}var Ze={},Ut={},Xt={},$i;function $t(){return $i||($i=1,function(){var o,t,e,n,s,i,r,a=[].slice,c={}.hasOwnProperty;o=function(){var g,p,f,h,b,O;if(O=arguments[0],b=2<=arguments.length?a.call(arguments,1):[],s(Object.assign))Object.assign.apply(null,arguments);else for(g=0,f=b.length;g<f;g++)if(h=b[g],h!=null)for(p in h)c.call(h,p)&&(O[p]=h[p]);return O},s=function(g){return!!g&&Object.prototype.toString.call(g)==="[object Function]"},i=function(g){var p;return!!g&&((p=typeof g)=="function"||p==="object")},e=function(g){return s(Array.isArray)?Array.isArray(g):Object.prototype.toString.call(g)==="[object Array]"},n=function(g){var p;if(e(g))return!g.length;for(p in g)if(c.call(g,p))return!1;return!0},r=function(g){var p,f;return i(g)&&(f=Object.getPrototypeOf(g))&&(p=f.constructor)&&typeof p=="function"&&p instanceof p&&Function.prototype.toString.call(p)===Function.prototype.toString.call(Object)},t=function(g){return s(g.valueOf)?g.valueOf():g},Xt.assign=o,Xt.isFunction=s,Xt.isObject=i,Xt.isArray=e,Xt.isEmpty=n,Xt.isPlainObject=r,Xt.getValue=t}.call(et)),Xt}var tn={exports:{}},qi;function Vr(){return qi||(qi=1,function(){tn.exports=function(){function o(){}return o.prototype.hasFeature=function(t,e){return!0},o.prototype.createDocumentType=function(t,e,n){throw new Error("This DOM method is not implemented.")},o.prototype.createDocument=function(t,e,n){throw new Error("This DOM method is not implemented.")},o.prototype.createHTMLDocument=function(t){throw new Error("This DOM method is not implemented.")},o.prototype.getFeature=function(t,e){throw new Error("This DOM method is not implemented.")},o}()}.call(et)),tn.exports}var en={exports:{}},nn={exports:{}},rn={exports:{}},Wi;function Oo(){return Wi||(Wi=1,function(){rn.exports=function(){function o(){}return o.prototype.handleError=function(t){throw new Error(t)},o}()}.call(et)),rn.exports}var sn={exports:{}},Vi;function Eo(){return Vi||(Vi=1,function(){sn.exports=function(){function o(t){this.arr=t||[]}return Object.defineProperty(o.prototype,"length",{get:function(){return this.arr.length}}),o.prototype.item=function(t){return this.arr[t]||null},o.prototype.contains=function(t){return this.arr.indexOf(t)!==-1},o}()}.call(et)),sn.exports}var Hi;function Do(){return Hi||(Hi=1,function(){var o,t;o=Oo(),t=Eo(),nn.exports=function(){function e(){this.defaultParams={"canonical-form":!1,"cdata-sections":!1,comments:!1,"datatype-normalization":!1,"element-content-whitespace":!0,entities:!0,"error-handler":new o,infoset:!0,"validate-if-schema":!1,namespaces:!0,"namespace-declarations":!0,"normalize-characters":!1,"schema-location":"","schema-type":"","split-cdata-sections":!0,validate:!1,"well-formed":!0},this.params=Object.create(this.defaultParams)}return Object.defineProperty(e.prototype,"parameterNames",{get:function(){return new t(Object.keys(this.defaultParams))}}),e.prototype.getParameter=function(n){return this.params.hasOwnProperty(n)?this.params[n]:null},e.prototype.canSetParameter=function(n,s){return!0},e.prototype.setParameter=function(n,s){return s!=null?this.params[n]=s:delete this.params[n]},e}()}.call(et)),nn.exports}var on={exports:{}},an={exports:{}},cn={exports:{}},zi;function ft(){return zi||(zi=1,function(){cn.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(et)),cn.exports}var un={exports:{}},Gi;function Hr(){return Gi||(Gi=1,function(){var o;o=ft(),Nt(),un.exports=function(){function t(e,n,s){if(this.parent=e,this.parent&&(this.options=this.parent.options,this.stringify=this.parent.stringify),n==null)throw new Error("Missing attribute name. "+this.debugInfo(n));this.name=this.stringify.name(n),this.value=this.stringify.attValue(s),this.type=o.Attribute,this.isId=!1,this.schemaTypeInfo=null}return Object.defineProperty(t.prototype,"nodeType",{get:function(){return this.type}}),Object.defineProperty(t.prototype,"ownerElement",{get:function(){return this.parent}}),Object.defineProperty(t.prototype,"textContent",{get:function(){return this.value},set:function(e){return this.value=e||""}}),Object.defineProperty(t.prototype,"namespaceURI",{get:function(){return""}}),Object.defineProperty(t.prototype,"prefix",{get:function(){return""}}),Object.defineProperty(t.prototype,"localName",{get:function(){return this.name}}),Object.defineProperty(t.prototype,"specified",{get:function(){return!0}}),t.prototype.clone=function(){return Object.create(this)},t.prototype.toString=function(e){return this.options.writer.attribute(this,this.options.writer.filterOptions(e))},t.prototype.debugInfo=function(e){return e=e||this.name,e==null?"parent: <"+this.parent.name+">":"attribute: {"+e+"}, parent: <"+this.parent.name+">"},t.prototype.isEqualNode=function(e){return!(e.namespaceURI!==this.namespaceURI||e.prefix!==this.prefix||e.localName!==this.localName||e.value!==this.value)},t}()}.call(et)),un.exports}var ln={exports:{}},Yi;function Hn(){return Yi||(Yi=1,function(){ln.exports=function(){function o(t){this.nodes=t}return Object.defineProperty(o.prototype,"length",{get:function(){return Object.keys(this.nodes).length||0}}),o.prototype.clone=function(){return this.nodes=null},o.prototype.getNamedItem=function(t){return this.nodes[t]},o.prototype.setNamedItem=function(t){var e;return e=this.nodes[t.nodeName],this.nodes[t.nodeName]=t,e||null},o.prototype.removeNamedItem=function(t){var e;return e=this.nodes[t],delete this.nodes[t],e||null},o.prototype.item=function(t){return this.nodes[Object.keys(this.nodes)[t]]||null},o.prototype.getNamedItemNS=function(t,e){throw new Error("This DOM method is not implemented.")},o.prototype.setNamedItemNS=function(t){throw new Error("This DOM method is not implemented.")},o.prototype.removeNamedItemNS=function(t,e){throw new Error("This DOM method is not implemented.")},o}()}.call(et)),ln.exports}var ki;function zn(){return ki||(ki=1,function(){var o,t,e,n,s,i,r,a,c=function(p,f){for(var h in f)g.call(f,h)&&(p[h]=f[h]);function b(){this.constructor=p}return b.prototype=f.prototype,p.prototype=new b,p.__super__=f.prototype,p},g={}.hasOwnProperty;a=$t(),r=a.isObject,i=a.isFunction,s=a.getValue,n=Nt(),o=ft(),t=Hr(),e=Hn(),an.exports=function(p){c(f,p);function f(h,b,O){var D,w,A,C;if(f.__super__.constructor.call(this,h),b==null)throw new Error("Missing element name. "+this.debugInfo());if(this.name=this.stringify.name(b),this.type=o.Element,this.attribs={},this.schemaTypeInfo=null,O!=null&&this.attribute(O),h.type===o.Document&&(this.isRoot=!0,this.documentObject=h,h.rootObject=this,h.children)){for(C=h.children,w=0,A=C.length;w<A;w++)if(D=C[w],D.type===o.DocType){D.name=this.name;break}}}return Object.defineProperty(f.prototype,"tagName",{get:function(){return this.name}}),Object.defineProperty(f.prototype,"namespaceURI",{get:function(){return""}}),Object.defineProperty(f.prototype,"prefix",{get:function(){return""}}),Object.defineProperty(f.prototype,"localName",{get:function(){return this.name}}),Object.defineProperty(f.prototype,"id",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),Object.defineProperty(f.prototype,"className",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),Object.defineProperty(f.prototype,"classList",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),Object.defineProperty(f.prototype,"attributes",{get:function(){return(!this.attributeMap||!this.attributeMap.nodes)&&(this.attributeMap=new e(this.attribs)),this.attributeMap}}),f.prototype.clone=function(){var h,b,O,D;O=Object.create(this),O.isRoot&&(O.documentObject=null),O.attribs={},D=this.attribs;for(b in D)g.call(D,b)&&(h=D[b],O.attribs[b]=h.clone());return O.children=[],this.children.forEach(function(w){var A;return A=w.clone(),A.parent=O,O.children.push(A)}),O},f.prototype.attribute=function(h,b){var O,D;if(h!=null&&(h=s(h)),r(h))for(O in h)g.call(h,O)&&(D=h[O],this.attribute(O,D));else i(b)&&(b=b.apply()),this.options.keepNullAttributes&&b==null?this.attribs[h]=new t(this,h,""):b!=null&&(this.attribs[h]=new t(this,h,b));return this},f.prototype.removeAttribute=function(h){var b,O,D;if(h==null)throw new Error("Missing attribute name. "+this.debugInfo());if(h=s(h),Array.isArray(h))for(O=0,D=h.length;O<D;O++)b=h[O],delete this.attribs[b];else delete this.attribs[h];return this},f.prototype.toString=function(h){return this.options.writer.element(this,this.options.writer.filterOptions(h))},f.prototype.att=function(h,b){return this.attribute(h,b)},f.prototype.a=function(h,b){return this.attribute(h,b)},f.prototype.getAttribute=function(h){return this.attribs.hasOwnProperty(h)?this.attribs[h].value:null},f.prototype.setAttribute=function(h,b){throw new Error("This DOM method is not implemented."+this.debugInfo())},f.prototype.getAttributeNode=function(h){return this.attribs.hasOwnProperty(h)?this.attribs[h]:null},f.prototype.setAttributeNode=function(h){throw new Error("This DOM method is not implemented."+this.debugInfo())},f.prototype.removeAttributeNode=function(h){throw new Error("This DOM method is not implemented."+this.debugInfo())},f.prototype.getElementsByTagName=function(h){throw new Error("This DOM method is not implemented."+this.debugInfo())},f.prototype.getAttributeNS=function(h,b){throw new Error("This DOM method is not implemented."+this.debugInfo())},f.prototype.setAttributeNS=function(h,b,O){throw new Error("This DOM method is not implemented."+this.debugInfo())},f.prototype.removeAttributeNS=function(h,b){throw new Error("This DOM method is not implemented."+this.debugInfo())},f.prototype.getAttributeNodeNS=function(h,b){throw new Error("This DOM method is not implemented."+this.debugInfo())},f.prototype.setAttributeNodeNS=function(h){throw new Error("This DOM method is not implemented."+this.debugInfo())},f.prototype.getElementsByTagNameNS=function(h,b){throw new Error("This DOM method is not implemented."+this.debugInfo())},f.prototype.hasAttribute=function(h){return this.attribs.hasOwnProperty(h)},f.prototype.hasAttributeNS=function(h,b){throw new Error("This DOM method is not implemented."+this.debugInfo())},f.prototype.setIdAttribute=function(h,b){return this.attribs.hasOwnProperty(h)?this.attribs[h].isId:b},f.prototype.setIdAttributeNS=function(h,b,O){throw new Error("This DOM method is not implemented."+this.debugInfo())},f.prototype.setIdAttributeNode=function(h,b){throw new Error("This DOM method is not implemented."+this.debugInfo())},f.prototype.getElementsByTagName=function(h){throw new Error("This DOM method is not implemented."+this.debugInfo())},f.prototype.getElementsByTagNameNS=function(h,b){throw new Error("This DOM method is not implemented."+this.debugInfo())},f.prototype.getElementsByClassName=function(h){throw new Error("This DOM method is not implemented."+this.debugInfo())},f.prototype.isEqualNode=function(h){var b,O,D;if(!f.__super__.isEqualNode.apply(this,arguments).isEqualNode(h)||h.namespaceURI!==this.namespaceURI||h.prefix!==this.prefix||h.localName!==this.localName||h.attribs.length!==this.attribs.length)return!1;for(b=O=0,D=this.attribs.length-1;0<=D?O<=D:O>=D;b=0<=D?++O:--O)if(!this.attribs[b].isEqualNode(h.attribs[b]))return!1;return!0},f}(n)}.call(et)),an.exports}var fn={exports:{}},hn={exports:{}},Ki;function je(){return Ki||(Ki=1,function(){var o,t=function(n,s){for(var i in s)e.call(s,i)&&(n[i]=s[i]);function r(){this.constructor=n}return r.prototype=s.prototype,n.prototype=new r,n.__super__=s.prototype,n},e={}.hasOwnProperty;o=Nt(),hn.exports=function(n){t(s,n);function s(i){s.__super__.constructor.call(this,i),this.value=""}return Object.defineProperty(s.prototype,"data",{get:function(){return this.value},set:function(i){return this.value=i||""}}),Object.defineProperty(s.prototype,"length",{get:function(){return this.value.length}}),Object.defineProperty(s.prototype,"textContent",{get:function(){return this.value},set:function(i){return this.value=i||""}}),s.prototype.clone=function(){return Object.create(this)},s.prototype.substringData=function(i,r){throw new Error("This DOM method is not implemented."+this.debugInfo())},s.prototype.appendData=function(i){throw new Error("This DOM method is not implemented."+this.debugInfo())},s.prototype.insertData=function(i,r){throw new Error("This DOM method is not implemented."+this.debugInfo())},s.prototype.deleteData=function(i,r){throw new Error("This DOM method is not implemented."+this.debugInfo())},s.prototype.replaceData=function(i,r,a){throw new Error("This DOM method is not implemented."+this.debugInfo())},s.prototype.isEqualNode=function(i){return!(!s.__super__.isEqualNode.apply(this,arguments).isEqualNode(i)||i.data!==this.data)},s}(o)}.call(et)),hn.exports}var Qi;function Gn(){return Qi||(Qi=1,function(){var o,t,e=function(s,i){for(var r in i)n.call(i,r)&&(s[r]=i[r]);function a(){this.constructor=s}return a.prototype=i.prototype,s.prototype=new a,s.__super__=i.prototype,s},n={}.hasOwnProperty;o=ft(),t=je(),fn.exports=function(s){e(i,s);function i(r,a){if(i.__super__.constructor.call(this,r),a==null)throw new Error("Missing CDATA text. "+this.debugInfo());this.name="#cdata-section",this.type=o.CData,this.value=this.stringify.cdata(a)}return i.prototype.clone=function(){return Object.create(this)},i.prototype.toString=function(r){return this.options.writer.cdata(this,this.options.writer.filterOptions(r))},i}(t)}.call(et)),fn.exports}var pn={exports:{}},Ji;function Yn(){return Ji||(Ji=1,function(){var o,t,e=function(s,i){for(var r in i)n.call(i,r)&&(s[r]=i[r]);function a(){this.constructor=s}return a.prototype=i.prototype,s.prototype=new a,s.__super__=i.prototype,s},n={}.hasOwnProperty;o=ft(),t=je(),pn.exports=function(s){e(i,s);function i(r,a){if(i.__super__.constructor.call(this,r),a==null)throw new Error("Missing comment text. "+this.debugInfo());this.name="#comment",this.type=o.Comment,this.value=this.stringify.comment(a)}return i.prototype.clone=function(){return Object.create(this)},i.prototype.toString=function(r){return this.options.writer.comment(this,this.options.writer.filterOptions(r))},i}(t)}.call(et)),pn.exports}var dn={exports:{}},Zi;function kn(){return Zi||(Zi=1,function(){var o,t,e,n=function(i,r){for(var a in r)s.call(r,a)&&(i[a]=r[a]);function c(){this.constructor=i}return c.prototype=r.prototype,i.prototype=new c,i.__super__=r.prototype,i},s={}.hasOwnProperty;e=$t().isObject,t=Nt(),o=ft(),dn.exports=function(i){n(r,i);function r(a,c,g,p){var f;r.__super__.constructor.call(this,a),e(c)&&(f=c,c=f.version,g=f.encoding,p=f.standalone),c||(c="1.0"),this.type=o.Declaration,this.version=this.stringify.xmlVersion(c),g!=null&&(this.encoding=this.stringify.xmlEncoding(g)),p!=null&&(this.standalone=this.stringify.xmlStandalone(p))}return r.prototype.toString=function(a){return this.options.writer.declaration(this,this.options.writer.filterOptions(a))},r}(t)}.call(et)),dn.exports}var mn={exports:{}},gn={exports:{}},tr;function Kn(){return tr||(tr=1,function(){var o,t,e=function(s,i){for(var r in i)n.call(i,r)&&(s[r]=i[r]);function a(){this.constructor=s}return a.prototype=i.prototype,s.prototype=new a,s.__super__=i.prototype,s},n={}.hasOwnProperty;t=Nt(),o=ft(),gn.exports=function(s){e(i,s);function i(r,a,c,g,p,f){if(i.__super__.constructor.call(this,r),a==null)throw new Error("Missing DTD element name. "+this.debugInfo());if(c==null)throw new Error("Missing DTD attribute name. "+this.debugInfo(a));if(!g)throw new Error("Missing DTD attribute type. "+this.debugInfo(a));if(!p)throw new Error("Missing DTD attribute default. "+this.debugInfo(a));if(p.indexOf("#")!==0&&(p="#"+p),!p.match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/))throw new Error("Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT. "+this.debugInfo(a));if(f&&!p.match(/^(#FIXED|#DEFAULT)$/))throw new Error("Default value only applies to #FIXED or #DEFAULT. "+this.debugInfo(a));this.elementName=this.stringify.name(a),this.type=o.AttributeDeclaration,this.attributeName=this.stringify.name(c),this.attributeType=this.stringify.dtdAttType(g),f&&(this.defaultValue=this.stringify.dtdAttDefault(f)),this.defaultValueType=p}return i.prototype.toString=function(r){return this.options.writer.dtdAttList(this,this.options.writer.filterOptions(r))},i}(t)}.call(et)),gn.exports}var yn={exports:{}},er;function Qn(){return er||(er=1,function(){var o,t,e,n=function(i,r){for(var a in r)s.call(r,a)&&(i[a]=r[a]);function c(){this.constructor=i}return c.prototype=r.prototype,i.prototype=new c,i.__super__=r.prototype,i},s={}.hasOwnProperty;e=$t().isObject,t=Nt(),o=ft(),yn.exports=function(i){n(r,i);function r(a,c,g,p){if(r.__super__.constructor.call(this,a),g==null)throw new Error("Missing DTD entity name. "+this.debugInfo(g));if(p==null)throw new Error("Missing DTD entity value. "+this.debugInfo(g));if(this.pe=!!c,this.name=this.stringify.name(g),this.type=o.EntityDeclaration,!e(p))this.value=this.stringify.dtdEntityValue(p),this.internal=!0;else{if(!p.pubID&&!p.sysID)throw new Error("Public and/or system identifiers are required for an external entity. "+this.debugInfo(g));if(p.pubID&&!p.sysID)throw new Error("System identifier is required for a public external entity. "+this.debugInfo(g));if(this.internal=!1,p.pubID!=null&&(this.pubID=this.stringify.dtdPubID(p.pubID)),p.sysID!=null&&(this.sysID=this.stringify.dtdSysID(p.sysID)),p.nData!=null&&(this.nData=this.stringify.dtdNData(p.nData)),this.pe&&this.nData)throw new Error("Notation declaration is not allowed in a parameter entity. "+this.debugInfo(g))}}return Object.defineProperty(r.prototype,"publicId",{get:function(){return this.pubID}}),Object.defineProperty(r.prototype,"systemId",{get:function(){return this.sysID}}),Object.defineProperty(r.prototype,"notationName",{get:function(){return this.nData||null}}),Object.defineProperty(r.prototype,"inputEncoding",{get:function(){return null}}),Object.defineProperty(r.prototype,"xmlEncoding",{get:function(){return null}}),Object.defineProperty(r.prototype,"xmlVersion",{get:function(){return null}}),r.prototype.toString=function(a){return this.options.writer.dtdEntity(this,this.options.writer.filterOptions(a))},r}(t)}.call(et)),yn.exports}var bn={exports:{}},nr;function Jn(){return nr||(nr=1,function(){var o,t,e=function(s,i){for(var r in i)n.call(i,r)&&(s[r]=i[r]);function a(){this.constructor=s}return a.prototype=i.prototype,s.prototype=new a,s.__super__=i.prototype,s},n={}.hasOwnProperty;t=Nt(),o=ft(),bn.exports=function(s){e(i,s);function i(r,a,c){if(i.__super__.constructor.call(this,r),a==null)throw new Error("Missing DTD element name. "+this.debugInfo());c||(c="(#PCDATA)"),Array.isArray(c)&&(c="("+c.join(",")+")"),this.name=this.stringify.name(a),this.type=o.ElementDeclaration,this.value=this.stringify.dtdElementValue(c)}return i.prototype.toString=function(r){return this.options.writer.dtdElement(this,this.options.writer.filterOptions(r))},i}(t)}.call(et)),bn.exports}var wn={exports:{}},ir;function Zn(){return ir||(ir=1,function(){var o,t,e=function(s,i){for(var r in i)n.call(i,r)&&(s[r]=i[r]);function a(){this.constructor=s}return a.prototype=i.prototype,s.prototype=new a,s.__super__=i.prototype,s},n={}.hasOwnProperty;t=Nt(),o=ft(),wn.exports=function(s){e(i,s);function i(r,a,c){if(i.__super__.constructor.call(this,r),a==null)throw new Error("Missing DTD notation name. "+this.debugInfo(a));if(!c.pubID&&!c.sysID)throw new Error("Public or system identifiers are required for an external entity. "+this.debugInfo(a));this.name=this.stringify.name(a),this.type=o.NotationDeclaration,c.pubID!=null&&(this.pubID=this.stringify.dtdPubID(c.pubID)),c.sysID!=null&&(this.sysID=this.stringify.dtdSysID(c.sysID))}return Object.defineProperty(i.prototype,"publicId",{get:function(){return this.pubID}}),Object.defineProperty(i.prototype,"systemId",{get:function(){return this.sysID}}),i.prototype.toString=function(r){return this.options.writer.dtdNotation(this,this.options.writer.filterOptions(r))},i}(t)}.call(et)),wn.exports}var rr;function ti(){return rr||(rr=1,function(){var o,t,e,n,s,i,r,a,c=function(p,f){for(var h in f)g.call(f,h)&&(p[h]=f[h]);function b(){this.constructor=p}return b.prototype=f.prototype,p.prototype=new b,p.__super__=f.prototype,p},g={}.hasOwnProperty;a=$t().isObject,r=Nt(),o=ft(),t=Kn(),n=Qn(),e=Jn(),s=Zn(),i=Hn(),mn.exports=function(p){c(f,p);function f(h,b,O){var D,w,A,C,d,E;if(f.__super__.constructor.call(this,h),this.type=o.DocType,h.children){for(C=h.children,w=0,A=C.length;w<A;w++)if(D=C[w],D.type===o.Element){this.name=D.name;break}}this.documentObject=h,a(b)&&(d=b,b=d.pubID,O=d.sysID),O==null&&(E=[b,O],O=E[0],b=E[1]),b!=null&&(this.pubID=this.stringify.dtdPubID(b)),O!=null&&(this.sysID=this.stringify.dtdSysID(O))}return Object.defineProperty(f.prototype,"entities",{get:function(){var h,b,O,D,w;for(D={},w=this.children,b=0,O=w.length;b<O;b++)h=w[b],h.type===o.EntityDeclaration&&!h.pe&&(D[h.name]=h);return new i(D)}}),Object.defineProperty(f.prototype,"notations",{get:function(){var h,b,O,D,w;for(D={},w=this.children,b=0,O=w.length;b<O;b++)h=w[b],h.type===o.NotationDeclaration&&(D[h.name]=h);return new i(D)}}),Object.defineProperty(f.prototype,"publicId",{get:function(){return this.pubID}}),Object.defineProperty(f.prototype,"systemId",{get:function(){return this.sysID}}),Object.defineProperty(f.prototype,"internalSubset",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),f.prototype.element=function(h,b){var O;return O=new e(this,h,b),this.children.push(O),this},f.prototype.attList=function(h,b,O,D,w){var A;return A=new t(this,h,b,O,D,w),this.children.push(A),this},f.prototype.entity=function(h,b){var O;return O=new n(this,!1,h,b),this.children.push(O),this},f.prototype.pEntity=function(h,b){var O;return O=new n(this,!0,h,b),this.children.push(O),this},f.prototype.notation=function(h,b){var O;return O=new s(this,h,b),this.children.push(O),this},f.prototype.toString=function(h){return this.options.writer.docType(this,this.options.writer.filterOptions(h))},f.prototype.ele=function(h,b){return this.element(h,b)},f.prototype.att=function(h,b,O,D,w){return this.attList(h,b,O,D,w)},f.prototype.ent=function(h,b){return this.entity(h,b)},f.prototype.pent=function(h,b){return this.pEntity(h,b)},f.prototype.not=function(h,b){return this.notation(h,b)},f.prototype.up=function(){return this.root()||this.documentObject},f.prototype.isEqualNode=function(h){return!(!f.__super__.isEqualNode.apply(this,arguments).isEqualNode(h)||h.name!==this.name||h.publicId!==this.publicId||h.systemId!==this.systemId)},f}(r)}.call(et)),mn.exports}var On={exports:{}},sr;function ei(){return sr||(sr=1,function(){var o,t,e=function(s,i){for(var r in i)n.call(i,r)&&(s[r]=i[r]);function a(){this.constructor=s}return a.prototype=i.prototype,s.prototype=new a,s.__super__=i.prototype,s},n={}.hasOwnProperty;o=ft(),t=Nt(),On.exports=function(s){e(i,s);function i(r,a){if(i.__super__.constructor.call(this,r),a==null)throw new Error("Missing raw text. "+this.debugInfo());this.type=o.Raw,this.value=this.stringify.raw(a)}return i.prototype.clone=function(){return Object.create(this)},i.prototype.toString=function(r){return this.options.writer.raw(this,this.options.writer.filterOptions(r))},i}(t)}.call(et)),On.exports}var En={exports:{}},or;function ni(){return or||(or=1,function(){var o,t,e=function(s,i){for(var r in i)n.call(i,r)&&(s[r]=i[r]);function a(){this.constructor=s}return a.prototype=i.prototype,s.prototype=new a,s.__super__=i.prototype,s},n={}.hasOwnProperty;o=ft(),t=je(),En.exports=function(s){e(i,s);function i(r,a){if(i.__super__.constructor.call(this,r),a==null)throw new Error("Missing element text. "+this.debugInfo());this.name="#text",this.type=o.Text,this.value=this.stringify.text(a)}return Object.defineProperty(i.prototype,"isElementContentWhitespace",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),Object.defineProperty(i.prototype,"wholeText",{get:function(){var r,a,c;for(c="",a=this.previousSibling;a;)c=a.data+c,a=a.previousSibling;for(c+=this.data,r=this.nextSibling;r;)c=c+r.data,r=r.nextSibling;return c}}),i.prototype.clone=function(){return Object.create(this)},i.prototype.toString=function(r){return this.options.writer.text(this,this.options.writer.filterOptions(r))},i.prototype.splitText=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.replaceWholeText=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())},i}(t)}.call(et)),En.exports}var Dn={exports:{}},ar;function ii(){return ar||(ar=1,function(){var o,t,e=function(s,i){for(var r in i)n.call(i,r)&&(s[r]=i[r]);function a(){this.constructor=s}return a.prototype=i.prototype,s.prototype=new a,s.__super__=i.prototype,s},n={}.hasOwnProperty;o=ft(),t=je(),Dn.exports=function(s){e(i,s);function i(r,a,c){if(i.__super__.constructor.call(this,r),a==null)throw new Error("Missing instruction target. "+this.debugInfo());this.type=o.ProcessingInstruction,this.target=this.stringify.insTarget(a),this.name=this.target,c&&(this.value=this.stringify.insValue(c))}return i.prototype.clone=function(){return Object.create(this)},i.prototype.toString=function(r){return this.options.writer.processingInstruction(this,this.options.writer.filterOptions(r))},i.prototype.isEqualNode=function(r){return!(!i.__super__.isEqualNode.apply(this,arguments).isEqualNode(r)||r.target!==this.target)},i}(t)}.call(et)),Dn.exports}var Cn={exports:{}},cr;function zr(){return cr||(cr=1,function(){var o,t,e=function(s,i){for(var r in i)n.call(i,r)&&(s[r]=i[r]);function a(){this.constructor=s}return a.prototype=i.prototype,s.prototype=new a,s.__super__=i.prototype,s},n={}.hasOwnProperty;t=Nt(),o=ft(),Cn.exports=function(s){e(i,s);function i(r){i.__super__.constructor.call(this,r),this.type=o.Dummy}return i.prototype.clone=function(){return Object.create(this)},i.prototype.toString=function(r){return""},i}(t)}.call(et)),Cn.exports}var In={exports:{}},ur;function Co(){return ur||(ur=1,function(){In.exports=function(){function o(t){this.nodes=t}return Object.defineProperty(o.prototype,"length",{get:function(){return this.nodes.length||0}}),o.prototype.clone=function(){return this.nodes=null},o.prototype.item=function(t){return this.nodes[t]||null},o}()}.call(et)),In.exports}var _n={exports:{}},lr;function Io(){return lr||(lr=1,function(){_n.exports={Disconnected:1,Preceding:2,Following:4,Contains:8,ContainedBy:16,ImplementationSpecific:32}}.call(et)),_n.exports}var fr;function Nt(){return fr||(fr=1,function(){var o,t,e,n,s,i,r,a,c,g,p,f,h,b,O,D,w,A={}.hasOwnProperty;w=$t(),D=w.isObject,O=w.isFunction,b=w.isEmpty,h=w.getValue,a=null,e=null,n=null,s=null,i=null,p=null,f=null,g=null,r=null,t=null,c=null,o=null,on.exports=function(){function C(d){this.parent=d,this.parent&&(this.options=this.parent.options,this.stringify=this.parent.stringify),this.value=null,this.children=[],this.baseURI=null,a||(a=zn(),e=Gn(),n=Yn(),s=kn(),i=ti(),p=ei(),f=ni(),g=ii(),r=zr(),t=ft(),c=Co(),Hn(),o=Io())}return Object.defineProperty(C.prototype,"nodeName",{get:function(){return this.name}}),Object.defineProperty(C.prototype,"nodeType",{get:function(){return this.type}}),Object.defineProperty(C.prototype,"nodeValue",{get:function(){return this.value}}),Object.defineProperty(C.prototype,"parentNode",{get:function(){return this.parent}}),Object.defineProperty(C.prototype,"childNodes",{get:function(){return(!this.childNodeList||!this.childNodeList.nodes)&&(this.childNodeList=new c(this.children)),this.childNodeList}}),Object.defineProperty(C.prototype,"firstChild",{get:function(){return this.children[0]||null}}),Object.defineProperty(C.prototype,"lastChild",{get:function(){return this.children[this.children.length-1]||null}}),Object.defineProperty(C.prototype,"previousSibling",{get:function(){var d;return d=this.parent.children.indexOf(this),this.parent.children[d-1]||null}}),Object.defineProperty(C.prototype,"nextSibling",{get:function(){var d;return d=this.parent.children.indexOf(this),this.parent.children[d+1]||null}}),Object.defineProperty(C.prototype,"ownerDocument",{get:function(){return this.document()||null}}),Object.defineProperty(C.prototype,"textContent",{get:function(){var d,E,T,F,U;if(this.nodeType===t.Element||this.nodeType===t.DocumentFragment){for(U="",F=this.children,E=0,T=F.length;E<T;E++)d=F[E],d.textContent&&(U+=d.textContent);return U}else return null},set:function(d){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),C.prototype.setParent=function(d){var E,T,F,U,j;for(this.parent=d,d&&(this.options=d.options,this.stringify=d.stringify),U=this.children,j=[],T=0,F=U.length;T<F;T++)E=U[T],j.push(E.setParent(this));return j},C.prototype.element=function(d,E,T){var F,U,j,l,M,N,L,B,X,Y,k;if(N=null,E===null&&T==null&&(X=[{},null],E=X[0],T=X[1]),E==null&&(E={}),E=h(E),D(E)||(Y=[E,T],T=Y[0],E=Y[1]),d!=null&&(d=h(d)),Array.isArray(d))for(j=0,L=d.length;j<L;j++)U=d[j],N=this.element(U);else if(O(d))N=this.element(d.apply());else if(D(d)){for(M in d)if(A.call(d,M))if(k=d[M],O(k)&&(k=k.apply()),!this.options.ignoreDecorators&&this.stringify.convertAttKey&&M.indexOf(this.stringify.convertAttKey)===0)N=this.attribute(M.substr(this.stringify.convertAttKey.length),k);else if(!this.options.separateArrayItems&&Array.isArray(k)&&b(k))N=this.dummy();else if(D(k)&&b(k))N=this.element(M);else if(!this.options.keepNullNodes&&k==null)N=this.dummy();else if(!this.options.separateArrayItems&&Array.isArray(k))for(l=0,B=k.length;l<B;l++)U=k[l],F={},F[M]=U,N=this.element(F);else D(k)?!this.options.ignoreDecorators&&this.stringify.convertTextKey&&M.indexOf(this.stringify.convertTextKey)===0?N=this.element(k):(N=this.element(M),N.element(k)):N=this.element(M,k)}else!this.options.keepNullNodes&&T===null?N=this.dummy():!this.options.ignoreDecorators&&this.stringify.convertTextKey&&d.indexOf(this.stringify.convertTextKey)===0?N=this.text(T):!this.options.ignoreDecorators&&this.stringify.convertCDataKey&&d.indexOf(this.stringify.convertCDataKey)===0?N=this.cdata(T):!this.options.ignoreDecorators&&this.stringify.convertCommentKey&&d.indexOf(this.stringify.convertCommentKey)===0?N=this.comment(T):!this.options.ignoreDecorators&&this.stringify.convertRawKey&&d.indexOf(this.stringify.convertRawKey)===0?N=this.raw(T):!this.options.ignoreDecorators&&this.stringify.convertPIKey&&d.indexOf(this.stringify.convertPIKey)===0?N=this.instruction(d.substr(this.stringify.convertPIKey.length),T):N=this.node(d,E,T);if(N==null)throw new Error("Could not create any elements with: "+d+". "+this.debugInfo());return N},C.prototype.insertBefore=function(d,E,T){var F,U,j,l,M;if(d?.type)return j=d,l=E,j.setParent(this),l?(U=children.indexOf(l),M=children.splice(U),children.push(j),Array.prototype.push.apply(children,M)):children.push(j),j;if(this.isRoot)throw new Error("Cannot insert elements at root level. "+this.debugInfo(d));return U=this.parent.children.indexOf(this),M=this.parent.children.splice(U),F=this.parent.element(d,E,T),Array.prototype.push.apply(this.parent.children,M),F},C.prototype.insertAfter=function(d,E,T){var F,U,j;if(this.isRoot)throw new Error("Cannot insert elements at root level. "+this.debugInfo(d));return U=this.parent.children.indexOf(this),j=this.parent.children.splice(U+1),F=this.parent.element(d,E,T),Array.prototype.push.apply(this.parent.children,j),F},C.prototype.remove=function(){var d;if(this.isRoot)throw new Error("Cannot remove the root element. "+this.debugInfo());return d=this.parent.children.indexOf(this),[].splice.apply(this.parent.children,[d,d-d+1].concat([])),this.parent},C.prototype.node=function(d,E,T){var F,U;return d!=null&&(d=h(d)),E||(E={}),E=h(E),D(E)||(U=[E,T],T=U[0],E=U[1]),F=new a(this,d,E),T!=null&&F.text(T),this.children.push(F),F},C.prototype.text=function(d){var E;return D(d)&&this.element(d),E=new f(this,d),this.children.push(E),this},C.prototype.cdata=function(d){var E;return E=new e(this,d),this.children.push(E),this},C.prototype.comment=function(d){var E;return E=new n(this,d),this.children.push(E),this},C.prototype.commentBefore=function(d){var E,T;return E=this.parent.children.indexOf(this),T=this.parent.children.splice(E),this.parent.comment(d),Array.prototype.push.apply(this.parent.children,T),this},C.prototype.commentAfter=function(d){var E,T;return E=this.parent.children.indexOf(this),T=this.parent.children.splice(E+1),this.parent.comment(d),Array.prototype.push.apply(this.parent.children,T),this},C.prototype.raw=function(d){var E;return E=new p(this,d),this.children.push(E),this},C.prototype.dummy=function(){var d;return d=new r(this),d},C.prototype.instruction=function(d,E){var T,F,U,j,l;if(d!=null&&(d=h(d)),E!=null&&(E=h(E)),Array.isArray(d))for(j=0,l=d.length;j<l;j++)T=d[j],this.instruction(T);else if(D(d))for(T in d)A.call(d,T)&&(F=d[T],this.instruction(T,F));else O(E)&&(E=E.apply()),U=new g(this,d,E),this.children.push(U);return this},C.prototype.instructionBefore=function(d,E){var T,F;return T=this.parent.children.indexOf(this),F=this.parent.children.splice(T),this.parent.instruction(d,E),Array.prototype.push.apply(this.parent.children,F),this},C.prototype.instructionAfter=function(d,E){var T,F;return T=this.parent.children.indexOf(this),F=this.parent.children.splice(T+1),this.parent.instruction(d,E),Array.prototype.push.apply(this.parent.children,F),this},C.prototype.declaration=function(d,E,T){var F,U;return F=this.document(),U=new s(F,d,E,T),F.children.length===0?F.children.unshift(U):F.children[0].type===t.Declaration?F.children[0]=U:F.children.unshift(U),F.root()||F},C.prototype.dtd=function(d,E){var T,F,U,j,l,M,N,L,B,X;for(F=this.document(),U=new i(F,d,E),B=F.children,j=l=0,N=B.length;l<N;j=++l)if(T=B[j],T.type===t.DocType)return F.children[j]=U,U;for(X=F.children,j=M=0,L=X.length;M<L;j=++M)if(T=X[j],T.isRoot)return F.children.splice(j,0,U),U;return F.children.push(U),U},C.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},C.prototype.root=function(){var d;for(d=this;d;){if(d.type===t.Document)return d.rootObject;if(d.isRoot)return d;d=d.parent}},C.prototype.document=function(){var d;for(d=this;d;){if(d.type===t.Document)return d;d=d.parent}},C.prototype.end=function(d){return this.document().end(d)},C.prototype.prev=function(){var d;if(d=this.parent.children.indexOf(this),d<1)throw new Error("Already at the first node. "+this.debugInfo());return this.parent.children[d-1]},C.prototype.next=function(){var d;if(d=this.parent.children.indexOf(this),d===-1||d===this.parent.children.length-1)throw new Error("Already at the last node. "+this.debugInfo());return this.parent.children[d+1]},C.prototype.importDocument=function(d){var E;return E=d.root().clone(),E.parent=this,E.isRoot=!1,this.children.push(E),this},C.prototype.debugInfo=function(d){var E,T;return d=d||this.name,d==null&&!((E=this.parent)!=null&&E.name)?"":d==null?"parent: <"+this.parent.name+">":(T=this.parent)!=null&&T.name?"node: <"+d+">, parent: <"+this.parent.name+">":"node: <"+d+">"},C.prototype.ele=function(d,E,T){return this.element(d,E,T)},C.prototype.nod=function(d,E,T){return this.node(d,E,T)},C.prototype.txt=function(d){return this.text(d)},C.prototype.dat=function(d){return this.cdata(d)},C.prototype.com=function(d){return this.comment(d)},C.prototype.ins=function(d,E){return this.instruction(d,E)},C.prototype.doc=function(){return this.document()},C.prototype.dec=function(d,E,T){return this.declaration(d,E,T)},C.prototype.e=function(d,E,T){return this.element(d,E,T)},C.prototype.n=function(d,E,T){return this.node(d,E,T)},C.prototype.t=function(d){return this.text(d)},C.prototype.d=function(d){return this.cdata(d)},C.prototype.c=function(d){return this.comment(d)},C.prototype.r=function(d){return this.raw(d)},C.prototype.i=function(d,E){return this.instruction(d,E)},C.prototype.u=function(){return this.up()},C.prototype.importXMLBuilder=function(d){return this.importDocument(d)},C.prototype.replaceChild=function(d,E){throw new Error("This DOM method is not implemented."+this.debugInfo())},C.prototype.removeChild=function(d){throw new Error("This DOM method is not implemented."+this.debugInfo())},C.prototype.appendChild=function(d){throw new Error("This DOM method is not implemented."+this.debugInfo())},C.prototype.hasChildNodes=function(){return this.children.length!==0},C.prototype.cloneNode=function(d){throw new Error("This DOM method is not implemented."+this.debugInfo())},C.prototype.normalize=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},C.prototype.isSupported=function(d,E){return!0},C.prototype.hasAttributes=function(){return this.attribs.length!==0},C.prototype.compareDocumentPosition=function(d){var E,T;return E=this,E===d?0:this.document()!==d.document()?(T=o.Disconnected|o.ImplementationSpecific,Math.random()<.5?T|=o.Preceding:T|=o.Following,T):E.isAncestor(d)?o.Contains|o.Preceding:E.isDescendant(d)?o.Contains|o.Following:E.isPreceding(d)?o.Preceding:o.Following},C.prototype.isSameNode=function(d){throw new Error("This DOM method is not implemented."+this.debugInfo())},C.prototype.lookupPrefix=function(d){throw new Error("This DOM method is not implemented."+this.debugInfo())},C.prototype.isDefaultNamespace=function(d){throw new Error("This DOM method is not implemented."+this.debugInfo())},C.prototype.lookupNamespaceURI=function(d){throw new Error("This DOM method is not implemented."+this.debugInfo())},C.prototype.isEqualNode=function(d){var E,T,F;if(d.nodeType!==this.nodeType||d.children.length!==this.children.length)return!1;for(E=T=0,F=this.children.length-1;0<=F?T<=F:T>=F;E=0<=F?++T:--T)if(!this.children[E].isEqualNode(d.children[E]))return!1;return!0},C.prototype.getFeature=function(d,E){throw new Error("This DOM method is not implemented."+this.debugInfo())},C.prototype.setUserData=function(d,E,T){throw new Error("This DOM method is not implemented."+this.debugInfo())},C.prototype.getUserData=function(d){throw new Error("This DOM method is not implemented."+this.debugInfo())},C.prototype.contains=function(d){return d?d===this||this.isDescendant(d):!1},C.prototype.isDescendant=function(d){var E,T,F,U,j;for(j=this.children,F=0,U=j.length;F<U;F++)if(E=j[F],d===E||(T=E.isDescendant(d),T))return!0;return!1},C.prototype.isAncestor=function(d){return d.isDescendant(this)},C.prototype.isPreceding=function(d){var E,T;return E=this.treePosition(d),T=this.treePosition(this),E===-1||T===-1?!1:E<T},C.prototype.isFollowing=function(d){var E,T;return E=this.treePosition(d),T=this.treePosition(this),E===-1||T===-1?!1:E>T},C.prototype.treePosition=function(d){var E,T;return T=0,E=!1,this.foreachTreeNode(this.document(),function(F){if(T++,!E&&F===d)return E=!0}),E?T:-1},C.prototype.foreachTreeNode=function(d,E){var T,F,U,j,l;for(d||(d=this.document()),j=d.children,F=0,U=j.length;F<U;F++){if(T=j[F],l=E(T))return l;if(l=this.foreachTreeNode(T,E),l)return l}},C}()}.call(et)),on.exports}var Tn={exports:{}},hr;function Gr(){return hr||(hr=1,function(){var o=function(e,n){return function(){return e.apply(n,arguments)}},t={}.hasOwnProperty;Tn.exports=function(){function e(n){this.assertLegalName=o(this.assertLegalName,this),this.assertLegalChar=o(this.assertLegalChar,this);var s,i,r;n||(n={}),this.options=n,this.options.version||(this.options.version="1.0"),i=n.stringify||{};for(s in i)t.call(i,s)&&(r=i[s],this[s]=r)}return e.prototype.name=function(n){return this.options.noValidation?n:this.assertLegalName(""+n||"")},e.prototype.text=function(n){return this.options.noValidation?n:this.assertLegalChar(this.textEscape(""+n||""))},e.prototype.cdata=function(n){return this.options.noValidation?n:(n=""+n||"",n=n.replace("]]>","]]]]><![CDATA[>"),this.assertLegalChar(n))},e.prototype.comment=function(n){if(this.options.noValidation)return n;if(n=""+n||"",n.match(/--/))throw new Error("Comment text cannot contain double-hypen: "+n);return this.assertLegalChar(n)},e.prototype.raw=function(n){return this.options.noValidation?n:""+n||""},e.prototype.attValue=function(n){return this.options.noValidation?n:this.assertLegalChar(this.attEscape(n=""+n||""))},e.prototype.insTarget=function(n){return this.options.noValidation?n:this.assertLegalChar(""+n||"")},e.prototype.insValue=function(n){if(this.options.noValidation)return n;if(n=""+n||"",n.match(/\?>/))throw new Error("Invalid processing instruction value: "+n);return this.assertLegalChar(n)},e.prototype.xmlVersion=function(n){if(this.options.noValidation)return n;if(n=""+n||"",!n.match(/1\.[0-9]+/))throw new Error("Invalid version number: "+n);return n},e.prototype.xmlEncoding=function(n){if(this.options.noValidation)return n;if(n=""+n||"",!n.match(/^[A-Za-z](?:[A-Za-z0-9._-])*$/))throw new Error("Invalid encoding: "+n);return this.assertLegalChar(n)},e.prototype.xmlStandalone=function(n){return this.options.noValidation?n:n?"yes":"no"},e.prototype.dtdPubID=function(n){return this.options.noValidation?n:this.assertLegalChar(""+n||"")},e.prototype.dtdSysID=function(n){return this.options.noValidation?n:this.assertLegalChar(""+n||"")},e.prototype.dtdElementValue=function(n){return this.options.noValidation?n:this.assertLegalChar(""+n||"")},e.prototype.dtdAttType=function(n){return this.options.noValidation?n:this.assertLegalChar(""+n||"")},e.prototype.dtdAttDefault=function(n){return this.options.noValidation?n:this.assertLegalChar(""+n||"")},e.prototype.dtdEntityValue=function(n){return this.options.noValidation?n:this.assertLegalChar(""+n||"")},e.prototype.dtdNData=function(n){return this.options.noValidation?n:this.assertLegalChar(""+n||"")},e.prototype.convertAttKey="@",e.prototype.convertPIKey="?",e.prototype.convertTextKey="#text",e.prototype.convertCDataKey="#cdata",e.prototype.convertCommentKey="#comment",e.prototype.convertRawKey="#raw",e.prototype.assertLegalChar=function(n){var s,i;if(this.options.noValidation)return n;if(s="",this.options.version==="1.0"){if(s=/[\0-\x08\x0B\f\x0E-\x1F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,i=n.match(s))throw new Error("Invalid character in string: "+n+" at index "+i.index)}else if(this.options.version==="1.1"&&(s=/[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,i=n.match(s)))throw new Error("Invalid character in string: "+n+" at index "+i.index);return n},e.prototype.assertLegalName=function(n){var s;if(this.options.noValidation)return n;if(this.assertLegalChar(n),s=/^([: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])*$/,!n.match(s))throw new Error("Invalid character in name");return n},e.prototype.textEscape=function(n){var s;return this.options.noValidation?n:(s=this.options.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,n.replace(s,"&").replace(/</g,"<").replace(/>/g,">").replace(/\r/g,"
"))},e.prototype.attEscape=function(n){var s;return this.options.noValidation?n:(s=this.options.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,n.replace(s,"&").replace(/</g,"<").replace(/"/g,""").replace(/\t/g,"	").replace(/\n/g,"
").replace(/\r/g,"
"))},e}()}.call(et)),Tn.exports}var vn={exports:{}},xn={exports:{}},Nn={exports:{}},pr;function Fe(){return pr||(pr=1,function(){Nn.exports={None:0,OpenTag:1,InsideTag:2,CloseTag:3}}.call(et)),Nn.exports}var dr;function Yr(){return dr||(dr=1,function(){var o,t,e,n={}.hasOwnProperty;e=$t().assign,o=ft(),kn(),ti(),Gn(),Yn(),zn(),ei(),ni(),ii(),zr(),Kn(),Jn(),Qn(),Zn(),t=Fe(),xn.exports=function(){function s(i){var r,a,c;i||(i={}),this.options=i,a=i.writer||{};for(r in a)n.call(a,r)&&(c=a[r],this["_"+r]=this[r],this[r]=c)}return s.prototype.filterOptions=function(i){var r,a,c,g,p,f,h,b;return i||(i={}),i=e({},this.options,i),r={writer:this},r.pretty=i.pretty||!1,r.allowEmpty=i.allowEmpty||!1,r.indent=(a=i.indent)!=null?a:" ",r.newline=(c=i.newline)!=null?c:`
|
|
92
|
+
`,r.offset=(g=i.offset)!=null?g:0,r.dontPrettyTextNodes=(p=(f=i.dontPrettyTextNodes)!=null?f:i.dontprettytextnodes)!=null?p:0,r.spaceBeforeSlash=(h=(b=i.spaceBeforeSlash)!=null?b:i.spacebeforeslash)!=null?h:"",r.spaceBeforeSlash===!0&&(r.spaceBeforeSlash=" "),r.suppressPrettyCount=0,r.user={},r.state=t.None,r},s.prototype.indent=function(i,r,a){var c;return!r.pretty||r.suppressPrettyCount?"":r.pretty&&(c=(a||0)+r.offset+1,c>0)?new Array(c).join(r.indent):""},s.prototype.endline=function(i,r,a){return!r.pretty||r.suppressPrettyCount?"":r.newline},s.prototype.attribute=function(i,r,a){var c;return this.openAttribute(i,r,a),c=" "+i.name+'="'+i.value+'"',this.closeAttribute(i,r,a),c},s.prototype.cdata=function(i,r,a){var c;return this.openNode(i,r,a),r.state=t.OpenTag,c=this.indent(i,r,a)+"<![CDATA[",r.state=t.InsideTag,c+=i.value,r.state=t.CloseTag,c+="]]>"+this.endline(i,r,a),r.state=t.None,this.closeNode(i,r,a),c},s.prototype.comment=function(i,r,a){var c;return this.openNode(i,r,a),r.state=t.OpenTag,c=this.indent(i,r,a)+"<!-- ",r.state=t.InsideTag,c+=i.value,r.state=t.CloseTag,c+=" -->"+this.endline(i,r,a),r.state=t.None,this.closeNode(i,r,a),c},s.prototype.declaration=function(i,r,a){var c;return this.openNode(i,r,a),r.state=t.OpenTag,c=this.indent(i,r,a)+"<?xml",r.state=t.InsideTag,c+=' version="'+i.version+'"',i.encoding!=null&&(c+=' encoding="'+i.encoding+'"'),i.standalone!=null&&(c+=' standalone="'+i.standalone+'"'),r.state=t.CloseTag,c+=r.spaceBeforeSlash+"?>",c+=this.endline(i,r,a),r.state=t.None,this.closeNode(i,r,a),c},s.prototype.docType=function(i,r,a){var c,g,p,f,h;if(a||(a=0),this.openNode(i,r,a),r.state=t.OpenTag,f=this.indent(i,r,a),f+="<!DOCTYPE "+i.root().name,i.pubID&&i.sysID?f+=' PUBLIC "'+i.pubID+'" "'+i.sysID+'"':i.sysID&&(f+=' SYSTEM "'+i.sysID+'"'),i.children.length>0){for(f+=" [",f+=this.endline(i,r,a),r.state=t.InsideTag,h=i.children,g=0,p=h.length;g<p;g++)c=h[g],f+=this.writeChildNode(c,r,a+1);r.state=t.CloseTag,f+="]"}return r.state=t.CloseTag,f+=r.spaceBeforeSlash+">",f+=this.endline(i,r,a),r.state=t.None,this.closeNode(i,r,a),f},s.prototype.element=function(i,r,a){var c,g,p,f,h,b,O,D,w,A,C,d,E,T;a||(a=0),A=!1,C="",this.openNode(i,r,a),r.state=t.OpenTag,C+=this.indent(i,r,a)+"<"+i.name,d=i.attribs;for(w in d)n.call(d,w)&&(c=d[w],C+=this.attribute(c,r,a));if(p=i.children.length,f=p===0?null:i.children[0],p===0||i.children.every(function(F){return(F.type===o.Text||F.type===o.Raw)&&F.value===""}))r.allowEmpty?(C+=">",r.state=t.CloseTag,C+="</"+i.name+">"+this.endline(i,r,a)):(r.state=t.CloseTag,C+=r.spaceBeforeSlash+"/>"+this.endline(i,r,a));else if(r.pretty&&p===1&&(f.type===o.Text||f.type===o.Raw)&&f.value!=null)C+=">",r.state=t.InsideTag,r.suppressPrettyCount++,A=!0,C+=this.writeChildNode(f,r,a+1),r.suppressPrettyCount--,A=!1,r.state=t.CloseTag,C+="</"+i.name+">"+this.endline(i,r,a);else{if(r.dontPrettyTextNodes){for(E=i.children,h=0,O=E.length;h<O;h++)if(g=E[h],(g.type===o.Text||g.type===o.Raw)&&g.value!=null){r.suppressPrettyCount++,A=!0;break}}for(C+=">"+this.endline(i,r,a),r.state=t.InsideTag,T=i.children,b=0,D=T.length;b<D;b++)g=T[b],C+=this.writeChildNode(g,r,a+1);r.state=t.CloseTag,C+=this.indent(i,r,a)+"</"+i.name+">",A&&r.suppressPrettyCount--,C+=this.endline(i,r,a),r.state=t.None}return this.closeNode(i,r,a),C},s.prototype.writeChildNode=function(i,r,a){switch(i.type){case o.CData:return this.cdata(i,r,a);case o.Comment:return this.comment(i,r,a);case o.Element:return this.element(i,r,a);case o.Raw:return this.raw(i,r,a);case o.Text:return this.text(i,r,a);case o.ProcessingInstruction:return this.processingInstruction(i,r,a);case o.Dummy:return"";case o.Declaration:return this.declaration(i,r,a);case o.DocType:return this.docType(i,r,a);case o.AttributeDeclaration:return this.dtdAttList(i,r,a);case o.ElementDeclaration:return this.dtdElement(i,r,a);case o.EntityDeclaration:return this.dtdEntity(i,r,a);case o.NotationDeclaration:return this.dtdNotation(i,r,a);default:throw new Error("Unknown XML node type: "+i.constructor.name)}},s.prototype.processingInstruction=function(i,r,a){var c;return this.openNode(i,r,a),r.state=t.OpenTag,c=this.indent(i,r,a)+"<?",r.state=t.InsideTag,c+=i.target,i.value&&(c+=" "+i.value),r.state=t.CloseTag,c+=r.spaceBeforeSlash+"?>",c+=this.endline(i,r,a),r.state=t.None,this.closeNode(i,r,a),c},s.prototype.raw=function(i,r,a){var c;return this.openNode(i,r,a),r.state=t.OpenTag,c=this.indent(i,r,a),r.state=t.InsideTag,c+=i.value,r.state=t.CloseTag,c+=this.endline(i,r,a),r.state=t.None,this.closeNode(i,r,a),c},s.prototype.text=function(i,r,a){var c;return this.openNode(i,r,a),r.state=t.OpenTag,c=this.indent(i,r,a),r.state=t.InsideTag,c+=i.value,r.state=t.CloseTag,c+=this.endline(i,r,a),r.state=t.None,this.closeNode(i,r,a),c},s.prototype.dtdAttList=function(i,r,a){var c;return this.openNode(i,r,a),r.state=t.OpenTag,c=this.indent(i,r,a)+"<!ATTLIST",r.state=t.InsideTag,c+=" "+i.elementName+" "+i.attributeName+" "+i.attributeType,i.defaultValueType!=="#DEFAULT"&&(c+=" "+i.defaultValueType),i.defaultValue&&(c+=' "'+i.defaultValue+'"'),r.state=t.CloseTag,c+=r.spaceBeforeSlash+">"+this.endline(i,r,a),r.state=t.None,this.closeNode(i,r,a),c},s.prototype.dtdElement=function(i,r,a){var c;return this.openNode(i,r,a),r.state=t.OpenTag,c=this.indent(i,r,a)+"<!ELEMENT",r.state=t.InsideTag,c+=" "+i.name+" "+i.value,r.state=t.CloseTag,c+=r.spaceBeforeSlash+">"+this.endline(i,r,a),r.state=t.None,this.closeNode(i,r,a),c},s.prototype.dtdEntity=function(i,r,a){var c;return this.openNode(i,r,a),r.state=t.OpenTag,c=this.indent(i,r,a)+"<!ENTITY",r.state=t.InsideTag,i.pe&&(c+=" %"),c+=" "+i.name,i.value?c+=' "'+i.value+'"':(i.pubID&&i.sysID?c+=' PUBLIC "'+i.pubID+'" "'+i.sysID+'"':i.sysID&&(c+=' SYSTEM "'+i.sysID+'"'),i.nData&&(c+=" NDATA "+i.nData)),r.state=t.CloseTag,c+=r.spaceBeforeSlash+">"+this.endline(i,r,a),r.state=t.None,this.closeNode(i,r,a),c},s.prototype.dtdNotation=function(i,r,a){var c;return this.openNode(i,r,a),r.state=t.OpenTag,c=this.indent(i,r,a)+"<!NOTATION",r.state=t.InsideTag,c+=" "+i.name,i.pubID&&i.sysID?c+=' PUBLIC "'+i.pubID+'" "'+i.sysID+'"':i.pubID?c+=' PUBLIC "'+i.pubID+'"':i.sysID&&(c+=' SYSTEM "'+i.sysID+'"'),r.state=t.CloseTag,c+=r.spaceBeforeSlash+">"+this.endline(i,r,a),r.state=t.None,this.closeNode(i,r,a),c},s.prototype.openNode=function(i,r,a){},s.prototype.closeNode=function(i,r,a){},s.prototype.openAttribute=function(i,r,a){},s.prototype.closeAttribute=function(i,r,a){},s}()}.call(et)),xn.exports}var mr;function ri(){return mr||(mr=1,function(){var o,t=function(n,s){for(var i in s)e.call(s,i)&&(n[i]=s[i]);function r(){this.constructor=n}return r.prototype=s.prototype,n.prototype=new r,n.__super__=s.prototype,n},e={}.hasOwnProperty;o=Yr(),vn.exports=function(n){t(s,n);function s(i){s.__super__.constructor.call(this,i)}return s.prototype.document=function(i,r){var a,c,g,p,f;for(r=this.filterOptions(r),p="",f=i.children,c=0,g=f.length;c<g;c++)a=f[c],p+=this.writeChildNode(a,r,0);return r.pretty&&p.slice(-r.newline.length)===r.newline&&(p=p.slice(0,-r.newline.length)),p},s}(o)}.call(et)),vn.exports}var gr;function kr(){return gr||(gr=1,function(){var o,t,e,n,s,i,r,a=function(g,p){for(var f in p)c.call(p,f)&&(g[f]=p[f]);function h(){this.constructor=g}return h.prototype=p.prototype,g.prototype=new h,g.__super__=p.prototype,g},c={}.hasOwnProperty;r=$t().isPlainObject,e=Vr(),t=Do(),n=Nt(),o=ft(),i=Gr(),s=ri(),en.exports=function(g){a(p,g);function p(f){p.__super__.constructor.call(this,null),this.name="#document",this.type=o.Document,this.documentURI=null,this.domConfig=new t,f||(f={}),f.writer||(f.writer=new s),this.options=f,this.stringify=new i(f)}return Object.defineProperty(p.prototype,"implementation",{value:new e}),Object.defineProperty(p.prototype,"doctype",{get:function(){var f,h,b,O;for(O=this.children,h=0,b=O.length;h<b;h++)if(f=O[h],f.type===o.DocType)return f;return null}}),Object.defineProperty(p.prototype,"documentElement",{get:function(){return this.rootObject||null}}),Object.defineProperty(p.prototype,"inputEncoding",{get:function(){return null}}),Object.defineProperty(p.prototype,"strictErrorChecking",{get:function(){return!1}}),Object.defineProperty(p.prototype,"xmlEncoding",{get:function(){return this.children.length!==0&&this.children[0].type===o.Declaration?this.children[0].encoding:null}}),Object.defineProperty(p.prototype,"xmlStandalone",{get:function(){return this.children.length!==0&&this.children[0].type===o.Declaration?this.children[0].standalone==="yes":!1}}),Object.defineProperty(p.prototype,"xmlVersion",{get:function(){return this.children.length!==0&&this.children[0].type===o.Declaration?this.children[0].version:"1.0"}}),Object.defineProperty(p.prototype,"URL",{get:function(){return this.documentURI}}),Object.defineProperty(p.prototype,"origin",{get:function(){return null}}),Object.defineProperty(p.prototype,"compatMode",{get:function(){return null}}),Object.defineProperty(p.prototype,"characterSet",{get:function(){return null}}),Object.defineProperty(p.prototype,"contentType",{get:function(){return null}}),p.prototype.end=function(f){var h;return h={},f?r(f)&&(h=f,f=this.options.writer):f=this.options.writer,f.document(this,f.filterOptions(h))},p.prototype.toString=function(f){return this.options.writer.document(this,this.options.writer.filterOptions(f))},p.prototype.createElement=function(f){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.createDocumentFragment=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.createTextNode=function(f){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.createComment=function(f){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.createCDATASection=function(f){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.createProcessingInstruction=function(f,h){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.createAttribute=function(f){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.createEntityReference=function(f){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.getElementsByTagName=function(f){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.importNode=function(f,h){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.createElementNS=function(f,h){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.createAttributeNS=function(f,h){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.getElementsByTagNameNS=function(f,h){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.getElementById=function(f){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.adoptNode=function(f){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.normalizeDocument=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.renameNode=function(f,h,b){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.getElementsByClassName=function(f){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.createEvent=function(f){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.createRange=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.createNodeIterator=function(f,h,b){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.createTreeWalker=function(f,h,b){throw new Error("This DOM method is not implemented."+this.debugInfo())},p}(n)}.call(et)),en.exports}var Pn={exports:{}},yr;function _o(){return yr||(yr=1,function(){var o,t,e,n,s,i,r,a,c,g,p,f,h,b,O,D,w,A,C,d,E,T,F,U={}.hasOwnProperty;F=$t(),E=F.isObject,d=F.isFunction,T=F.isPlainObject,C=F.getValue,o=ft(),f=kr(),h=zn(),n=Gn(),s=Yn(),O=ei(),A=ni(),b=ii(),g=kn(),p=ti(),i=Kn(),a=Qn(),r=Jn(),c=Zn(),e=Hr(),w=Gr(),D=ri(),t=Fe(),Pn.exports=function(){function j(l,M,N){var L;this.name="?xml",this.type=o.Document,l||(l={}),L={},l.writer?T(l.writer)&&(L=l.writer,l.writer=new D):l.writer=new D,this.options=l,this.writer=l.writer,this.writerOptions=this.writer.filterOptions(L),this.stringify=new w(l),this.onDataCallback=M||function(){},this.onEndCallback=N||function(){},this.currentNode=null,this.currentLevel=-1,this.openTags={},this.documentStarted=!1,this.documentCompleted=!1,this.root=null}return j.prototype.createChildNode=function(l){var M,N,L,B,X,Y,k,q;switch(l.type){case o.CData:this.cdata(l.value);break;case o.Comment:this.comment(l.value);break;case o.Element:L={},k=l.attribs;for(N in k)U.call(k,N)&&(M=k[N],L[N]=M.value);this.node(l.name,L);break;case o.Dummy:this.dummy();break;case o.Raw:this.raw(l.value);break;case o.Text:this.text(l.value);break;case o.ProcessingInstruction:this.instruction(l.target,l.value);break;default:throw new Error("This XML node type is not supported in a JS object: "+l.constructor.name)}for(q=l.children,X=0,Y=q.length;X<Y;X++)B=q[X],this.createChildNode(B),B.type===o.Element&&this.up();return this},j.prototype.dummy=function(){return this},j.prototype.node=function(l,M,N){var L;if(l==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(l));return this.openCurrent(),l=C(l),M==null&&(M={}),M=C(M),E(M)||(L=[M,N],N=L[0],M=L[1]),this.currentNode=new h(this,l,M),this.currentNode.children=!1,this.currentLevel++,this.openTags[this.currentLevel]=this.currentNode,N!=null&&this.text(N),this},j.prototype.element=function(l,M,N){var L,B,X,Y,k,q;if(this.currentNode&&this.currentNode.type===o.DocType)this.dtdElement.apply(this,arguments);else if(Array.isArray(l)||E(l)||d(l))for(Y=this.options.noValidation,this.options.noValidation=!0,q=new f(this.options).element("TEMP_ROOT"),q.element(l),this.options.noValidation=Y,k=q.children,B=0,X=k.length;B<X;B++)L=k[B],this.createChildNode(L),L.type===o.Element&&this.up();else this.node(l,M,N);return this},j.prototype.attribute=function(l,M){var N,L;if(!this.currentNode||this.currentNode.children)throw new Error("att() can only be used immediately after an ele() call in callback mode. "+this.debugInfo(l));if(l!=null&&(l=C(l)),E(l))for(N in l)U.call(l,N)&&(L=l[N],this.attribute(N,L));else d(M)&&(M=M.apply()),this.options.keepNullAttributes&&M==null?this.currentNode.attribs[l]=new e(this,l,""):M!=null&&(this.currentNode.attribs[l]=new e(this,l,M));return this},j.prototype.text=function(l){var M;return this.openCurrent(),M=new A(this,l),this.onData(this.writer.text(M,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},j.prototype.cdata=function(l){var M;return this.openCurrent(),M=new n(this,l),this.onData(this.writer.cdata(M,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},j.prototype.comment=function(l){var M;return this.openCurrent(),M=new s(this,l),this.onData(this.writer.comment(M,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},j.prototype.raw=function(l){var M;return this.openCurrent(),M=new O(this,l),this.onData(this.writer.raw(M,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},j.prototype.instruction=function(l,M){var N,L,B,X,Y;if(this.openCurrent(),l!=null&&(l=C(l)),M!=null&&(M=C(M)),Array.isArray(l))for(N=0,X=l.length;N<X;N++)L=l[N],this.instruction(L);else if(E(l))for(L in l)U.call(l,L)&&(B=l[L],this.instruction(L,B));else d(M)&&(M=M.apply()),Y=new b(this,l,M),this.onData(this.writer.processingInstruction(Y,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this},j.prototype.declaration=function(l,M,N){var L;if(this.openCurrent(),this.documentStarted)throw new Error("declaration() must be the first node.");return L=new g(this,l,M,N),this.onData(this.writer.declaration(L,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},j.prototype.doctype=function(l,M,N){if(this.openCurrent(),l==null)throw new Error("Missing root node name.");if(this.root)throw new Error("dtd() must come before the root node.");return this.currentNode=new p(this,M,N),this.currentNode.rootNodeName=l,this.currentNode.children=!1,this.currentLevel++,this.openTags[this.currentLevel]=this.currentNode,this},j.prototype.dtdElement=function(l,M){var N;return this.openCurrent(),N=new r(this,l,M),this.onData(this.writer.dtdElement(N,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},j.prototype.attList=function(l,M,N,L,B){var X;return this.openCurrent(),X=new i(this,l,M,N,L,B),this.onData(this.writer.dtdAttList(X,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},j.prototype.entity=function(l,M){var N;return this.openCurrent(),N=new a(this,!1,l,M),this.onData(this.writer.dtdEntity(N,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},j.prototype.pEntity=function(l,M){var N;return this.openCurrent(),N=new a(this,!0,l,M),this.onData(this.writer.dtdEntity(N,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},j.prototype.notation=function(l,M){var N;return this.openCurrent(),N=new c(this,l,M),this.onData(this.writer.dtdNotation(N,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},j.prototype.up=function(){if(this.currentLevel<0)throw new Error("The document node has no parent.");return this.currentNode?(this.currentNode.children?this.closeNode(this.currentNode):this.openNode(this.currentNode),this.currentNode=null):this.closeNode(this.openTags[this.currentLevel]),delete this.openTags[this.currentLevel],this.currentLevel--,this},j.prototype.end=function(){for(;this.currentLevel>=0;)this.up();return this.onEnd()},j.prototype.openCurrent=function(){if(this.currentNode)return this.currentNode.children=!0,this.openNode(this.currentNode)},j.prototype.openNode=function(l){var M,N,L,B;if(!l.isOpen){if(!this.root&&this.currentLevel===0&&l.type===o.Element&&(this.root=l),N="",l.type===o.Element){this.writerOptions.state=t.OpenTag,N=this.writer.indent(l,this.writerOptions,this.currentLevel)+"<"+l.name,B=l.attribs;for(L in B)U.call(B,L)&&(M=B[L],N+=this.writer.attribute(M,this.writerOptions,this.currentLevel));N+=(l.children?">":"/>")+this.writer.endline(l,this.writerOptions,this.currentLevel),this.writerOptions.state=t.InsideTag}else this.writerOptions.state=t.OpenTag,N=this.writer.indent(l,this.writerOptions,this.currentLevel)+"<!DOCTYPE "+l.rootNodeName,l.pubID&&l.sysID?N+=' PUBLIC "'+l.pubID+'" "'+l.sysID+'"':l.sysID&&(N+=' SYSTEM "'+l.sysID+'"'),l.children?(N+=" [",this.writerOptions.state=t.InsideTag):(this.writerOptions.state=t.CloseTag,N+=">"),N+=this.writer.endline(l,this.writerOptions,this.currentLevel);return this.onData(N,this.currentLevel),l.isOpen=!0}},j.prototype.closeNode=function(l){var M;if(!l.isClosed)return M="",this.writerOptions.state=t.CloseTag,l.type===o.Element?M=this.writer.indent(l,this.writerOptions,this.currentLevel)+"</"+l.name+">"+this.writer.endline(l,this.writerOptions,this.currentLevel):M=this.writer.indent(l,this.writerOptions,this.currentLevel)+"]>"+this.writer.endline(l,this.writerOptions,this.currentLevel),this.writerOptions.state=t.None,this.onData(M,this.currentLevel),l.isClosed=!0},j.prototype.onData=function(l,M){return this.documentStarted=!0,this.onDataCallback(l,M+1)},j.prototype.onEnd=function(){return this.documentCompleted=!0,this.onEndCallback()},j.prototype.debugInfo=function(l){return l==null?"":"node: <"+l+">"},j.prototype.ele=function(){return this.element.apply(this,arguments)},j.prototype.nod=function(l,M,N){return this.node(l,M,N)},j.prototype.txt=function(l){return this.text(l)},j.prototype.dat=function(l){return this.cdata(l)},j.prototype.com=function(l){return this.comment(l)},j.prototype.ins=function(l,M){return this.instruction(l,M)},j.prototype.dec=function(l,M,N){return this.declaration(l,M,N)},j.prototype.dtd=function(l,M,N){return this.doctype(l,M,N)},j.prototype.e=function(l,M,N){return this.element(l,M,N)},j.prototype.n=function(l,M,N){return this.node(l,M,N)},j.prototype.t=function(l){return this.text(l)},j.prototype.d=function(l){return this.cdata(l)},j.prototype.c=function(l){return this.comment(l)},j.prototype.r=function(l){return this.raw(l)},j.prototype.i=function(l,M){return this.instruction(l,M)},j.prototype.att=function(){return this.currentNode&&this.currentNode.type===o.DocType?this.attList.apply(this,arguments):this.attribute.apply(this,arguments)},j.prototype.a=function(){return this.currentNode&&this.currentNode.type===o.DocType?this.attList.apply(this,arguments):this.attribute.apply(this,arguments)},j.prototype.ent=function(l,M){return this.entity(l,M)},j.prototype.pent=function(l,M){return this.pEntity(l,M)},j.prototype.not=function(l,M){return this.notation(l,M)},j}()}.call(et)),Pn.exports}var An={exports:{}},br;function To(){return br||(br=1,function(){var o,t,e,n=function(i,r){for(var a in r)s.call(r,a)&&(i[a]=r[a]);function c(){this.constructor=i}return c.prototype=r.prototype,i.prototype=new c,i.__super__=r.prototype,i},s={}.hasOwnProperty;o=ft(),e=Yr(),t=Fe(),An.exports=function(i){n(r,i);function r(a,c){this.stream=a,r.__super__.constructor.call(this,c)}return r.prototype.endline=function(a,c,g){return a.isLastRootNode&&c.state===t.CloseTag?"":r.__super__.endline.call(this,a,c,g)},r.prototype.document=function(a,c){var g,p,f,h,b,O,D,w,A;for(D=a.children,p=f=0,b=D.length;f<b;p=++f)g=D[p],g.isLastRootNode=p===a.children.length-1;for(c=this.filterOptions(c),w=a.children,A=[],h=0,O=w.length;h<O;h++)g=w[h],A.push(this.writeChildNode(g,c,0));return A},r.prototype.attribute=function(a,c,g){return this.stream.write(r.__super__.attribute.call(this,a,c,g))},r.prototype.cdata=function(a,c,g){return this.stream.write(r.__super__.cdata.call(this,a,c,g))},r.prototype.comment=function(a,c,g){return this.stream.write(r.__super__.comment.call(this,a,c,g))},r.prototype.declaration=function(a,c,g){return this.stream.write(r.__super__.declaration.call(this,a,c,g))},r.prototype.docType=function(a,c,g){var p,f,h,b;if(g||(g=0),this.openNode(a,c,g),c.state=t.OpenTag,this.stream.write(this.indent(a,c,g)),this.stream.write("<!DOCTYPE "+a.root().name),a.pubID&&a.sysID?this.stream.write(' PUBLIC "'+a.pubID+'" "'+a.sysID+'"'):a.sysID&&this.stream.write(' SYSTEM "'+a.sysID+'"'),a.children.length>0){for(this.stream.write(" ["),this.stream.write(this.endline(a,c,g)),c.state=t.InsideTag,b=a.children,f=0,h=b.length;f<h;f++)p=b[f],this.writeChildNode(p,c,g+1);c.state=t.CloseTag,this.stream.write("]")}return c.state=t.CloseTag,this.stream.write(c.spaceBeforeSlash+">"),this.stream.write(this.endline(a,c,g)),c.state=t.None,this.closeNode(a,c,g)},r.prototype.element=function(a,c,g){var p,f,h,b,O,D,w,A,C;g||(g=0),this.openNode(a,c,g),c.state=t.OpenTag,this.stream.write(this.indent(a,c,g)+"<"+a.name),A=a.attribs;for(w in A)s.call(A,w)&&(p=A[w],this.attribute(p,c,g));if(h=a.children.length,b=h===0?null:a.children[0],h===0||a.children.every(function(d){return(d.type===o.Text||d.type===o.Raw)&&d.value===""}))c.allowEmpty?(this.stream.write(">"),c.state=t.CloseTag,this.stream.write("</"+a.name+">")):(c.state=t.CloseTag,this.stream.write(c.spaceBeforeSlash+"/>"));else if(c.pretty&&h===1&&(b.type===o.Text||b.type===o.Raw)&&b.value!=null)this.stream.write(">"),c.state=t.InsideTag,c.suppressPrettyCount++,this.writeChildNode(b,c,g+1),c.suppressPrettyCount--,c.state=t.CloseTag,this.stream.write("</"+a.name+">");else{for(this.stream.write(">"+this.endline(a,c,g)),c.state=t.InsideTag,C=a.children,O=0,D=C.length;O<D;O++)f=C[O],this.writeChildNode(f,c,g+1);c.state=t.CloseTag,this.stream.write(this.indent(a,c,g)+"</"+a.name+">")}return this.stream.write(this.endline(a,c,g)),c.state=t.None,this.closeNode(a,c,g)},r.prototype.processingInstruction=function(a,c,g){return this.stream.write(r.__super__.processingInstruction.call(this,a,c,g))},r.prototype.raw=function(a,c,g){return this.stream.write(r.__super__.raw.call(this,a,c,g))},r.prototype.text=function(a,c,g){return this.stream.write(r.__super__.text.call(this,a,c,g))},r.prototype.dtdAttList=function(a,c,g){return this.stream.write(r.__super__.dtdAttList.call(this,a,c,g))},r.prototype.dtdElement=function(a,c,g){return this.stream.write(r.__super__.dtdElement.call(this,a,c,g))},r.prototype.dtdEntity=function(a,c,g){return this.stream.write(r.__super__.dtdEntity.call(this,a,c,g))},r.prototype.dtdNotation=function(a,c,g){return this.stream.write(r.__super__.dtdNotation.call(this,a,c,g))},r}(e)}.call(et)),An.exports}var wr;function vo(){return wr||(wr=1,function(){var o,t,e,n,s,i,r,a,c,g;g=$t(),a=g.assign,c=g.isFunction,e=Vr(),n=kr(),s=_o(),r=ri(),i=To(),o=ft(),t=Fe(),Ut.create=function(p,f,h,b){var O,D;if(p==null)throw new Error("Root element needs a name.");return b=a({},f,h,b),O=new n(b),D=O.element(p),b.headless||(O.declaration(b),(b.pubID!=null||b.sysID!=null)&&O.dtd(b)),D},Ut.begin=function(p,f,h){var b;return c(p)&&(b=[p,f],f=b[0],h=b[1],p={}),f?new s(p,f,h):new n(p)},Ut.stringWriter=function(p){return new r(p)},Ut.streamWriter=function(p,f){return new i(p,f)},Ut.implementation=new e,Ut.nodeType=o,Ut.writerState=t}.call(et)),Ut}var Or;function xo(){return Or||(Or=1,function(){var o,t,e,n,s,i={}.hasOwnProperty;o=vo(),t=Vn().defaults,n=function(r){return typeof r=="string"&&(r.indexOf("&")>=0||r.indexOf(">")>=0||r.indexOf("<")>=0)},s=function(r){return"<![CDATA["+e(r)+"]]>"},e=function(r){return r.replace("]]>","]]]]><![CDATA[>")},Ze.Builder=function(){function r(a){var c,g,p;this.options={},g=t["0.2"];for(c in g)i.call(g,c)&&(p=g[c],this.options[c]=p);for(c in a)i.call(a,c)&&(p=a[c],this.options[c]=p)}return r.prototype.buildObject=function(a){var c,g,p,f,h;return c=this.options.attrkey,g=this.options.charkey,Object.keys(a).length===1&&this.options.rootName===t["0.2"].rootName?(h=Object.keys(a)[0],a=a[h]):h=this.options.rootName,p=function(b){return function(O,D){var w,A,C,d,E,T;if(typeof D!="object")b.options.cdata&&n(D)?O.raw(s(D)):O.txt(D);else if(Array.isArray(D)){for(d in D)if(i.call(D,d)){A=D[d];for(E in A)C=A[E],O=p(O.ele(E),C).up()}}else for(E in D)if(i.call(D,E))if(A=D[E],E===c){if(typeof A=="object")for(w in A)T=A[w],O=O.att(w,T)}else if(E===g)b.options.cdata&&n(A)?O=O.raw(s(A)):O=O.txt(A);else if(Array.isArray(A))for(d in A)i.call(A,d)&&(C=A[d],typeof C=="string"?b.options.cdata&&n(C)?O=O.ele(E).raw(s(C)).up():O=O.ele(E,C).up():O=p(O.ele(E),C).up());else typeof A=="object"?O=p(O.ele(E),A).up():typeof A=="string"&&b.options.cdata&&n(A)?O=O.ele(E).raw(s(A)).up():(A==null&&(A=""),O=O.ele(E,A.toString()).up());return O}}(this),f=o.create(h,this.options.xmldec,this.options.doctype,{headless:this.options.headless,allowSurrogateChars:this.options.allowSurrogateChars}),p(f,a).end(this.options.renderOpts)},r}()}.call(et)),Ze}var Mn={},Ln={},Er;function No(){return Er||(Er=1,function(o){(function(t){t.parser=function(m,u){return new n(m,u)},t.SAXParser=n,t.SAXStream=p,t.createStream=g,t.MAX_BUFFER_LENGTH=64*1024;var e=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];t.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"];function n(m,u){if(!(this instanceof n))return new n(m,u);var P=this;i(P),P.q=P.c="",P.bufferCheckPosition=t.MAX_BUFFER_LENGTH,P.opt=u||{},P.opt.lowercase=P.opt.lowercase||P.opt.lowercasetags,P.looseCase=P.opt.lowercase?"toLowerCase":"toUpperCase",P.opt.maxEntityCount=P.opt.maxEntityCount||512,P.opt.maxEntityDepth=P.opt.maxEntityDepth||4,P.entityCount=P.entityDepth=0,P.tags=[],P.closed=P.closedRoot=P.sawRoot=!1,P.tag=P.error=null,P.strict=!!m,P.noscript=!!(m||P.opt.noscript),P.state=l.BEGIN,P.strictEntities=P.opt.strictEntities,P.ENTITIES=P.strictEntities?Object.create(t.XML_ENTITIES):Object.create(t.ENTITIES),P.attribList=[],P.opt.xmlns&&(P.ns=Object.create(D)),P.opt.unquotedAttributeValues===void 0&&(P.opt.unquotedAttributeValues=!m),P.trackPosition=P.opt.position!==!1,P.trackPosition&&(P.position=P.line=P.column=0),N(P,"onready")}Object.create||(Object.create=function(m){function u(){}u.prototype=m;var P=new u;return P}),Object.keys||(Object.keys=function(m){var u=[];for(var P in m)m.hasOwnProperty(P)&&u.push(P);return u});function s(m){for(var u=Math.max(t.MAX_BUFFER_LENGTH,10),P=0,_=0,J=e.length;_<J;_++){var nt=m[e[_]].length;if(nt>u)switch(e[_]){case"textNode":B(m);break;case"cdata":L(m,"oncdata",m.cdata),m.cdata="";break;case"script":L(m,"onscript",m.script),m.script="";break;default:Y(m,"Max buffer length exceeded: "+e[_])}P=Math.max(P,nt)}var it=t.MAX_BUFFER_LENGTH-P;m.bufferCheckPosition=it+m.position}function i(m){for(var u=0,P=e.length;u<P;u++)m[e[u]]=""}function r(m){B(m),m.cdata!==""&&(L(m,"oncdata",m.cdata),m.cdata=""),m.script!==""&&(L(m,"onscript",m.script),m.script="")}n.prototype={end:function(){k(this)},write:K,resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){r(this)}};var a;try{a=require("stream").Stream}catch{a=function(){}}a||(a=function(){});var c=t.EVENTS.filter(function(m){return m!=="error"&&m!=="end"});function g(m,u){return new p(m,u)}function p(m,u){if(!(this instanceof p))return new p(m,u);a.apply(this),this._parser=new n(m,u),this.writable=!0,this.readable=!0;var P=this;this._parser.onend=function(){P.emit("end")},this._parser.onerror=function(_){P.emit("error",_),P._parser.error=null},this._decoder=null,c.forEach(function(_){Object.defineProperty(P,"on"+_,{get:function(){return P._parser["on"+_]},set:function(J){if(!J)return P.removeAllListeners(_),P._parser["on"+_]=J,J;P.on(_,J)},enumerable:!0,configurable:!1})})}p.prototype=Object.create(a.prototype,{constructor:{value:p}}),p.prototype.write=function(m){return typeof Buffer=="function"&&typeof Buffer.isBuffer=="function"&&Buffer.isBuffer(m)&&(this._decoder||(this._decoder=new TextDecoder("utf8")),m=this._decoder.decode(m,{stream:!0})),this._parser.write(m.toString()),this.emit("data",m),!0},p.prototype.end=function(m){if(m&&m.length&&this.write(m),this._decoder){var u=this._decoder.decode();u&&(this._parser.write(u),this.emit("data",u))}return this._parser.end(),!0},p.prototype.on=function(m,u){var P=this;return!P._parser["on"+m]&&c.indexOf(m)!==-1&&(P._parser["on"+m]=function(){var _=arguments.length===1?[arguments[0]]:Array.apply(null,arguments);_.splice(0,0,m),P.emit.apply(P,_)}),a.prototype.on.call(P,m,u)};var f="[CDATA[",h="DOCTYPE",b="http://www.w3.org/XML/1998/namespace",O="http://www.w3.org/2000/xmlns/",D={xml:b,xmlns:O},w=/[:_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]/,A=/[:_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-]/,C=/[#:_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]/,d=/[#:_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 E(m){return m===" "||m===`
|
|
93
|
+
`||m==="\r"||m===" "}function T(m){return m==='"'||m==="'"}function F(m){return m===">"||E(m)}function U(m,u){return m.test(u)}function j(m,u){return!U(m,u)}var l=0;t.STATE={BEGIN:l++,BEGIN_WHITESPACE:l++,TEXT:l++,TEXT_ENTITY:l++,OPEN_WAKA:l++,SGML_DECL:l++,SGML_DECL_QUOTED:l++,DOCTYPE:l++,DOCTYPE_QUOTED:l++,DOCTYPE_DTD:l++,DOCTYPE_DTD_QUOTED:l++,COMMENT_STARTING:l++,COMMENT:l++,COMMENT_ENDING:l++,COMMENT_ENDED:l++,CDATA:l++,CDATA_ENDING:l++,CDATA_ENDING_2:l++,PROC_INST:l++,PROC_INST_BODY:l++,PROC_INST_ENDING:l++,OPEN_TAG:l++,OPEN_TAG_SLASH:l++,ATTRIB:l++,ATTRIB_NAME:l++,ATTRIB_NAME_SAW_WHITE:l++,ATTRIB_VALUE:l++,ATTRIB_VALUE_QUOTED:l++,ATTRIB_VALUE_CLOSED:l++,ATTRIB_VALUE_UNQUOTED:l++,ATTRIB_VALUE_ENTITY_Q:l++,ATTRIB_VALUE_ENTITY_U:l++,CLOSE_TAG:l++,CLOSE_TAG_SAW_WHITE:l++,SCRIPT:l++,SCRIPT_ENDING:l++},t.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},t.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(t.ENTITIES).forEach(function(m){var u=t.ENTITIES[m],P=typeof u=="number"?String.fromCharCode(u):u;t.ENTITIES[m]=P});for(var M in t.STATE)t.STATE[t.STATE[M]]=M;l=t.STATE;function N(m,u,P){m[u]&&m[u](P)}function L(m,u,P){m.textNode&&B(m),N(m,u,P)}function B(m){m.textNode=X(m.opt,m.textNode),m.textNode&&N(m,"ontext",m.textNode),m.textNode=""}function X(m,u){return m.trim&&(u=u.trim()),m.normalize&&(u=u.replace(/\s+/g," ")),u}function Y(m,u){return B(m),m.trackPosition&&(u+=`
|
|
94
94
|
Line: `+m.line+`
|
|
95
95
|
Column: `+m.column+`
|
|
96
|
-
Char: `+m.c),
|
|
96
|
+
Char: `+m.c),u=new Error(u),m.error=u,N(m,"onerror",u),m}function k(m){return m.sawRoot&&!m.closedRoot&&q(m,"Unclosed root tag"),m.state!==l.BEGIN&&m.state!==l.BEGIN_WHITESPACE&&m.state!==l.TEXT&&Y(m,"Unexpected end"),B(m),m.c="",m.closed=!0,N(m,"onend"),n.call(m,m.strict,m.opt),m}function q(m,u){if(typeof m!="object"||!(m instanceof n))throw new Error("bad call to strictFail");m.strict&&Y(m,u)}function at(m){m.strict||(m.tagName=m.tagName[m.looseCase]());var u=m.tags[m.tags.length-1]||m,P=m.tag={name:m.tagName,attributes:{}};m.opt.xmlns&&(P.ns=u.ns),m.attribList.length=0,L(m,"onopentagstart",P)}function Pt(m,u){var P=m.indexOf(":"),_=P<0?["",m]:m.split(":"),J=_[0],nt=_[1];return u&&m==="xmlns"&&(J="xmlns",nt=""),{prefix:J,local:nt}}function st(m){if(m.strict||(m.attribName=m.attribName[m.looseCase]()),m.attribList.indexOf(m.attribName)!==-1||m.tag.attributes.hasOwnProperty(m.attribName)){m.attribName=m.attribValue="";return}if(m.opt.xmlns){var u=Pt(m.attribName,!0),P=u.prefix,_=u.local;if(P==="xmlns")if(_==="xml"&&m.attribValue!==b)q(m,"xml: prefix must be bound to "+b+`
|
|
97
97
|
Actual: `+m.attribValue);else if(_==="xmlns"&&m.attribValue!==O)q(m,"xmlns: prefix must be bound to "+O+`
|
|
98
|
-
Actual: `+m.attribValue);else{var J=m.tag,nt=m.tags[m.tags.length-1]||m;J.ns===nt.ns&&(J.ns=Object.create(nt.ns)),J.ns[_]=m.attribValue}m.attribList.push([m.attribName,m.attribValue])}else m.tag.attributes[m.attribName]=m.attribValue,L(m,"onattribute",{name:m.attribName,value:m.attribValue});m.attribName=m.attribValue=""}function mt(m,
|
|
99
|
-
`?(
|
|
100
|
-
`?(
|
|
101
|
-
`?(l.line++,l.column=0):l.column++);l.cdata+=m.substring(nt,P-1),_==="]"&&(l.state=u.CDATA_ENDING);continue;case u.CDATA_ENDING:_==="]"?l.state=u.CDATA_ENDING_2:(l.cdata+="]"+_,l.state=u.CDATA);continue;case u.CDATA_ENDING_2:_===">"?(l.cdata&&L(l,"oncdata",l.cdata),L(l,"onclosecdata"),l.cdata="",l.state=u.TEXT):_==="]"?l.cdata+="]":(l.cdata+="]]"+_,l.state=u.CDATA);continue;case u.PROC_INST:_==="?"?l.state=u.PROC_INST_ENDING:E(_)?l.state=u.PROC_INST_BODY:l.procInstName+=_;continue;case u.PROC_INST_BODY:if(!l.procInstBody&&E(_))continue;_==="?"?l.state=u.PROC_INST_ENDING:l.procInstBody+=_;continue;case u.PROC_INST_ENDING:_===">"?(L(l,"onprocessinginstruction",{name:l.procInstName,body:l.procInstBody}),l.procInstName=l.procInstBody="",l.state=u.TEXT):(l.procInstBody+="?"+_,l.state=u.PROC_INST_BODY);continue;case u.OPEN_TAG:U(A,_)?l.tagName+=_:(at(l),_===">"?mt(l):_==="/"?l.state=u.OPEN_TAG_SLASH:(E(_)||q(l,"Invalid character in tag name"),l.state=u.ATTRIB));continue;case u.OPEN_TAG_SLASH:_===">"?(mt(l,!0),wt(l)):(q(l,"Forward-slash in opening tag not followed by >"),l.state=u.ATTRIB);continue;case u.ATTRIB:if(E(_))continue;_===">"?mt(l):_==="/"?l.state=u.OPEN_TAG_SLASH:U(w,_)?(l.attribName=_,l.attribValue="",l.state=u.ATTRIB_NAME):q(l,"Invalid attribute name");continue;case u.ATTRIB_NAME:_==="="?l.state=u.ATTRIB_VALUE:_===">"?(q(l,"Attribute without value"),l.attribValue=l.attribName,st(l),mt(l)):E(_)?l.state=u.ATTRIB_NAME_SAW_WHITE:U(A,_)?l.attribName+=_:q(l,"Invalid attribute name");continue;case u.ATTRIB_NAME_SAW_WHITE:if(_==="=")l.state=u.ATTRIB_VALUE;else{if(E(_))continue;q(l,"Attribute without value"),l.tag.attributes[l.attribName]="",l.attribValue="",L(l,"onattribute",{name:l.attribName,value:""}),l.attribName="",_===">"?mt(l):U(w,_)?(l.attribName=_,l.state=u.ATTRIB_NAME):(q(l,"Invalid attribute name"),l.state=u.ATTRIB)}continue;case u.ATTRIB_VALUE:if(E(_))continue;T(_)?(l.q=_,l.state=u.ATTRIB_VALUE_QUOTED):(l.opt.unquotedAttributeValues||Y(l,"Unquoted attribute value"),l.state=u.ATTRIB_VALUE_UNQUOTED,l.attribValue=_);continue;case u.ATTRIB_VALUE_QUOTED:if(_!==l.q){_==="&"?l.state=u.ATTRIB_VALUE_ENTITY_Q:l.attribValue+=_;continue}st(l),l.q="",l.state=u.ATTRIB_VALUE_CLOSED;continue;case u.ATTRIB_VALUE_CLOSED:E(_)?l.state=u.ATTRIB:_===">"?mt(l):_==="/"?l.state=u.OPEN_TAG_SLASH:U(w,_)?(q(l,"No whitespace between attributes"),l.attribName=_,l.attribValue="",l.state=u.ATTRIB_NAME):q(l,"Invalid attribute name");continue;case u.ATTRIB_VALUE_UNQUOTED:if(!F(_)){_==="&"?l.state=u.ATTRIB_VALUE_ENTITY_U:l.attribValue+=_;continue}st(l),_===">"?mt(l):l.state=u.ATTRIB;continue;case u.CLOSE_TAG:if(l.tagName)_===">"?wt(l):U(A,_)?l.tagName+=_:l.script?(l.script+="</"+l.tagName+_,l.tagName="",l.state=u.SCRIPT):(E(_)||q(l,"Invalid tagname in closing tag"),l.state=u.CLOSE_TAG_SAW_WHITE);else{if(E(_))continue;j(w,_)?l.script?(l.script+="</"+_,l.state=u.SCRIPT):q(l,"Invalid tagname in closing tag."):l.tagName=_}continue;case u.CLOSE_TAG_SAW_WHITE:if(E(_))continue;_===">"?wt(l):q(l,"Invalid characters in closing tag");continue;case u.TEXT_ENTITY:case u.ATTRIB_VALUE_ENTITY_Q:case u.ATTRIB_VALUE_ENTITY_U:var it,ht;switch(l.state){case u.TEXT_ENTITY:it=u.TEXT,ht="textNode";break;case u.ATTRIB_VALUE_ENTITY_Q:it=u.ATTRIB_VALUE_QUOTED,ht="attribValue";break;case u.ATTRIB_VALUE_ENTITY_U:it=u.ATTRIB_VALUE_UNQUOTED,ht="attribValue";break}if(_===";"){var I=Rt(l);l.opt.unparsedEntities&&!Object.values(t.XML_ENTITIES).includes(I)?(l.entity="",l.state=it,l.write(I)):(l[ht]+=I,l.entity="",l.state=it)}else U(l.entity.length?d:C,_)?l.entity+=_:(q(l,"Invalid character in entity name"),l[ht]+="&"+l.entity+_,l.entity="",l.state=it);continue;default:throw new Error(l,"Unknown state: "+l.state)}return l.position>=l.bufferCheckPosition&&s(l),l}/*! http://mths.be/fromcodepoint v0.1.0 by @mathias */String.fromCodePoint||function(){var m=String.fromCharCode,l=Math.floor,P=function(){var _=16384,J=[],nt,it,ht=-1,I=arguments.length;if(!I)return"";for(var v="";++ht<I;){var R=Number(arguments[ht]);if(!isFinite(R)||R<0||R>1114111||l(R)!==R)throw RangeError("Invalid code point: "+R);R<=65535?J.push(R):(R-=65536,nt=(R>>10)+55296,it=R%1024+56320,J.push(nt,it)),(ht+1===I||J.length>_)&&(v+=m.apply(null,J),J.length=0)}return v};Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:P,configurable:!0,writable:!0}):String.fromCodePoint=P}()})(o)}(Ln)),Ln}var Sn={},Dr;function Po(){return Dr||(Dr=1,function(){Sn.stripBOM=function(o){return o[0]==="\uFEFF"?o.substring(1):o}}.call(et)),Sn}var ne={},Cr;function Kr(){return Cr||(Cr=1,function(){var o;o=new RegExp(/(?!xmlns)^.*:/),ne.normalize=function(t){return t.toLowerCase()},ne.firstCharLowerCase=function(t){return t.charAt(0).toLowerCase()+t.slice(1)},ne.stripPrefix=function(t){return t.replace(o,"")},ne.parseNumbers=function(t){return isNaN(t)||(t=t%1===0?parseInt(t,10):parseFloat(t)),t},ne.parseBooleans=function(t){return/^(?:true|false)$/i.test(t)&&(t=t.toLowerCase()==="true"),t}}.call(et)),ne}var Ir;function Ao(){return Ir||(Ir=1,function(o){(function(){var t,e,n,s,i,r,a,c,g,p=function(b,O){return function(){return b.apply(O,arguments)}},f=function(b,O){for(var D in O)h.call(O,D)&&(b[D]=O[D]);function w(){this.constructor=b}return w.prototype=O.prototype,b.prototype=new w,b.__super__=O.prototype,b},h={}.hasOwnProperty;c=No(),s=qn,t=Po(),a=Kr(),g=ss.setImmediate,e=Vn().defaults,i=function(b){return typeof b=="object"&&b!=null&&Object.keys(b).length===0},r=function(b,O,D){var w,A,C;for(w=0,A=b.length;w<A;w++)C=b[w],O=C(O,D);return O},n=function(b,O,D){var w;return w=Object.create(null),w.value=D,w.writable=!0,w.enumerable=!0,w.configurable=!0,Object.defineProperty(b,O,w)},o.Parser=function(b){f(O,b);function O(D){this.parseStringPromise=p(this.parseStringPromise,this),this.parseString=p(this.parseString,this),this.reset=p(this.reset,this),this.assignOrPush=p(this.assignOrPush,this),this.processAsync=p(this.processAsync,this);var w,A,C;if(!(this instanceof o.Parser))return new o.Parser(D);this.options={},A=e["0.2"];for(w in A)h.call(A,w)&&(C=A[w],this.options[w]=C);for(w in D)h.call(D,w)&&(C=D[w],this.options[w]=C);this.options.xmlns&&(this.options.xmlnskey=this.options.attrkey+"ns"),this.options.normalizeTags&&(this.options.tagNameProcessors||(this.options.tagNameProcessors=[]),this.options.tagNameProcessors.unshift(a.normalize)),this.reset()}return O.prototype.processAsync=function(){var D,w;try{return this.remaining.length<=this.options.chunkSize?(D=this.remaining,this.remaining="",this.saxParser=this.saxParser.write(D),this.saxParser.close()):(D=this.remaining.substr(0,this.options.chunkSize),this.remaining=this.remaining.substr(this.options.chunkSize,this.remaining.length),this.saxParser=this.saxParser.write(D),g(this.processAsync))}catch(A){if(w=A,!this.saxParser.errThrown)return this.saxParser.errThrown=!0,this.emit(w)}},O.prototype.assignOrPush=function(D,w,A){return w in D?(D[w]instanceof Array||n(D,w,[D[w]]),D[w].push(A)):this.options.explicitArray?n(D,w,[A]):n(D,w,A)},O.prototype.reset=function(){var D,w,A,C;return this.removeAllListeners(),this.saxParser=c.parser(this.options.strict,{trim:!1,normalize:!1,xmlns:this.options.xmlns}),this.saxParser.errThrown=!1,this.saxParser.onerror=function(d){return function(E){if(d.saxParser.resume(),!d.saxParser.errThrown)return d.saxParser.errThrown=!0,d.emit("error",E)}}(this),this.saxParser.onend=function(d){return function(){if(!d.saxParser.ended)return d.saxParser.ended=!0,d.emit("end",d.resultObject)}}(this),this.saxParser.ended=!1,this.EXPLICIT_CHARKEY=this.options.explicitCharkey,this.resultObject=null,C=[],D=this.options.attrkey,w=this.options.charkey,this.saxParser.onopentag=function(d){return function(E){var T,F,U,j,u;if(U={},U[w]="",!d.options.ignoreAttrs){u=E.attributes;for(T in u)h.call(u,T)&&(!(D in U)&&!d.options.mergeAttrs&&(U[D]={}),F=d.options.attrValueProcessors?r(d.options.attrValueProcessors,E.attributes[T],T):E.attributes[T],j=d.options.attrNameProcessors?r(d.options.attrNameProcessors,T):T,d.options.mergeAttrs?d.assignOrPush(U,j,F):n(U[D],j,F))}return U["#name"]=d.options.tagNameProcessors?r(d.options.tagNameProcessors,E.name):E.name,d.options.xmlns&&(U[d.options.xmlnskey]={uri:E.uri,local:E.local}),C.push(U)}}(this),this.saxParser.onclosetag=function(d){return function(){var E,T,F,U,j,u,M,N,L,B;if(u=C.pop(),j=u["#name"],(!d.options.explicitChildren||!d.options.preserveChildrenOrder)&&delete u["#name"],u.cdata===!0&&(E=u.cdata,delete u.cdata),L=C[C.length-1],u[w].match(/^\s*$/)&&!E?(T=u[w],delete u[w]):(d.options.trim&&(u[w]=u[w].trim()),d.options.normalize&&(u[w]=u[w].replace(/\s{2,}/g," ").trim()),u[w]=d.options.valueProcessors?r(d.options.valueProcessors,u[w],j):u[w],Object.keys(u).length===1&&w in u&&!d.EXPLICIT_CHARKEY&&(u=u[w])),i(u)&&(typeof d.options.emptyTag=="function"?u=d.options.emptyTag():u=d.options.emptyTag!==""?d.options.emptyTag:T),d.options.validator!=null&&(B="/"+function(){var X,Y,k;for(k=[],X=0,Y=C.length;X<Y;X++)U=C[X],k.push(U["#name"]);return k}().concat(j).join("/"),function(){var X;try{return u=d.options.validator(B,L&&L[j],u)}catch(Y){return X=Y,d.emit("error",X)}}()),d.options.explicitChildren&&!d.options.mergeAttrs&&typeof u=="object"){if(!d.options.preserveChildrenOrder)U={},d.options.attrkey in u&&(U[d.options.attrkey]=u[d.options.attrkey],delete u[d.options.attrkey]),!d.options.charsAsChildren&&d.options.charkey in u&&(U[d.options.charkey]=u[d.options.charkey],delete u[d.options.charkey]),Object.getOwnPropertyNames(u).length>0&&(U[d.options.childkey]=u),u=U;else if(L){L[d.options.childkey]=L[d.options.childkey]||[],M={};for(F in u)h.call(u,F)&&n(M,F,u[F]);L[d.options.childkey].push(M),delete u["#name"],Object.keys(u).length===1&&w in u&&!d.EXPLICIT_CHARKEY&&(u=u[w])}}return C.length>0?d.assignOrPush(L,j,u):(d.options.explicitRoot&&(N=u,u={},n(u,j,N)),d.resultObject=u,d.saxParser.ended=!0,d.emit("end",d.resultObject))}}(this),A=function(d){return function(E){var T,F;if(F=C[C.length-1],F)return F[w]+=E,d.options.explicitChildren&&d.options.preserveChildrenOrder&&d.options.charsAsChildren&&(d.options.includeWhiteChars||E.replace(/\\n/g,"").trim()!=="")&&(F[d.options.childkey]=F[d.options.childkey]||[],T={"#name":"__text__"},T[w]=E,d.options.normalize&&(T[w]=T[w].replace(/\s{2,}/g," ").trim()),F[d.options.childkey].push(T)),F}}(this),this.saxParser.ontext=A,this.saxParser.oncdata=function(d){return function(E){var T;if(T=A(E),T)return T.cdata=!0}}()},O.prototype.parseString=function(D,w){var A;w!=null&&typeof w=="function"&&(this.on("end",function(C){return this.reset(),w(null,C)}),this.on("error",function(C){return this.reset(),w(C)}));try{return D=D.toString(),D.trim()===""?(this.emit("end",null),!0):(D=t.stripBOM(D),this.options.async?(this.remaining=D,g(this.processAsync),this.saxParser):this.saxParser.write(D).close())}catch(C){if(A=C,this.saxParser.errThrown||this.saxParser.ended){if(this.saxParser.ended)throw A}else return this.emit("error",A),this.saxParser.errThrown=!0}},O.prototype.parseStringPromise=function(D){return new Promise(function(w){return function(A,C){return w.parseString(D,function(d,E){return d?C(d):A(E)})}}(this))},O}(s),o.parseString=function(b,O,D){var w,A,C;return D!=null?(typeof D=="function"&&(w=D),typeof O=="object"&&(A=O)):(typeof O=="function"&&(w=O),A={}),C=new o.Parser(A),C.parseString(b,w)},o.parseStringPromise=function(b,O){var D,w;return typeof O=="object"&&(D=O),w=new o.Parser(D),w.parseStringPromise(b)}}).call(et)}(Mn)),Mn}var Qr;(function(){var o,t,e,n=function(i,r){for(var a in r)s.call(r,a)&&(i[a]=r[a]);function c(){this.constructor=i}return c.prototype=r.prototype,i.prototype=new c,i.__super__=r.prototype,i},s={}.hasOwnProperty;t=Vn(),o=xo(),e=Ao(),Kr(),t.defaults,function(i){n(r,i);function r(a){this.message=a}return r}(Error),o.Builder,e.Parser,e.parseString,Qr=e.parseStringPromise}).call(et);class Jr{constructor(t,e,n){this.nextTxnId=1,this.pendingCommands=new Map,this.breakpoints=new Map,this.scriptIdByUrl=new Map,this.nextScriptId=1,this.objectHandles=new Map,this.nextObjectId=1,this.callFramesMap=new Map,this.xdebugConnected=!1,this.dbgp=t,this.cdp=e,this.readPHPFile=n.getPHPFile,this.phpRoot=n.phpRoot||"";for(const s of n.knownScriptUrls)this.scriptIdByUrl.set(s,this.getOrCreateScriptId(s));this.breakOnFirstLine=n.breakOnFirstLine||!1}start(){this.dbgp.on("connected",()=>{this.xdebugConnected=!0,this.sendDbgpCommand("stdout","-c 1"),this.sendDbgpCommand("stderr","-c 1")}),this.dbgp.on("message",async t=>{try{const e=await Qr(t,{explicitArray:!1});await this.handleDbgpMessage(e)}catch{}}),this.dbgp.on("disconnected",()=>{this.xdebugConnected=!1,this.cdp.sendMessage({method:"Debugger.paused",params:{reason:"terminated",callFrames:[]}})}),this.cdp.on("message",t=>{this.handleCdpMessage(t)}),this.cdp.on("clientDisconnected",()=>{this.xdebugConnected&&this.sendDbgpCommand("detach")}),this.sendInitialScripts().then(()=>{if(!this.breakOnFirstLine){const t=this.scriptIdByUrl.entries().next().value;t&&(this.cdp.sendMessage({method:"Debugger.paused",params:{callFrames:[{location:{scriptId:t[1],lineNumber:0},scopeChain:[],this:{type:"undefined"}}],reason:"other"}}),setTimeout(()=>{this.cdp.sendMessage({method:"Debugger.resumed"})},50))}this.cdp.sendMessage({method:"Log.entryAdded",params:{entry:{source:"other",level:"info",text:`🎉 Welcome to WordPress Playground DevTools! 🎉
|
|
98
|
+
Actual: `+m.attribValue);else{var J=m.tag,nt=m.tags[m.tags.length-1]||m;J.ns===nt.ns&&(J.ns=Object.create(nt.ns)),J.ns[_]=m.attribValue}m.attribList.push([m.attribName,m.attribValue])}else m.tag.attributes[m.attribName]=m.attribValue,L(m,"onattribute",{name:m.attribName,value:m.attribValue});m.attribName=m.attribValue=""}function mt(m,u){if(m.opt.xmlns){var P=m.tag,_=Pt(m.tagName);P.prefix=_.prefix,P.local=_.local,P.uri=P.ns[_.prefix]||"",P.prefix&&!P.uri&&(q(m,"Unbound namespace prefix: "+JSON.stringify(m.tagName)),P.uri=_.prefix);var J=m.tags[m.tags.length-1]||m;P.ns&&J.ns!==P.ns&&Object.keys(P.ns).forEach(function(z){L(m,"onopennamespace",{prefix:z,uri:P.ns[z]})});for(var nt=0,it=m.attribList.length;nt<it;nt++){var ht=m.attribList[nt],I=ht[0],v=ht[1],R=Pt(I,!0),S=R.prefix,x=R.local,W=S===""?"":P.ns[S]||"",$={name:I,value:v,prefix:S,local:x,uri:W};S&&S!=="xmlns"&&!W&&(q(m,"Unbound namespace prefix: "+JSON.stringify(S)),$.uri=S),m.tag.attributes[I]=$,L(m,"onattribute",$)}m.attribList.length=0}m.tag.isSelfClosing=!!u,m.sawRoot=!0,m.tags.push(m.tag),L(m,"onopentag",m.tag),u||(!m.noscript&&m.tagName.toLowerCase()==="script"?m.state=l.SCRIPT:m.state=l.TEXT,m.tag=null,m.tagName=""),m.attribName=m.attribValue="",m.attribList.length=0}function wt(m){if(!m.tagName){q(m,"Weird empty close tag."),m.textNode+="</>",m.state=l.TEXT;return}if(m.script){if(m.tagName!=="script"){m.script+="</"+m.tagName+">",m.tagName="",m.state=l.SCRIPT;return}L(m,"onscript",m.script),m.script=""}var u=m.tags.length,P=m.tagName;m.strict||(P=P[m.looseCase]());for(var _=P;u--;){var J=m.tags[u];if(J.name!==_)q(m,"Unexpected close tag");else break}if(u<0){q(m,"Unmatched closing tag: "+m.tagName),m.textNode+="</"+m.tagName+">",m.state=l.TEXT;return}m.tagName=P;for(var nt=m.tags.length;nt-- >u;){var it=m.tag=m.tags.pop();m.tagName=m.tag.name,L(m,"onclosetag",m.tagName);var ht={};for(var I in it.ns)ht[I]=it.ns[I];var v=m.tags[m.tags.length-1]||m;m.opt.xmlns&&it.ns!==v.ns&&Object.keys(it.ns).forEach(function(R){var S=it.ns[R];L(m,"onclosenamespace",{prefix:R,uri:S})})}u===0&&(m.closedRoot=!0),m.tagName=m.attribValue=m.attribName="",m.attribList.length=0,m.state=l.TEXT}function Rt(m){var u=m.entity,P=u.toLowerCase(),_,J="";return m.ENTITIES[u]?m.ENTITIES[u]:m.ENTITIES[P]?m.ENTITIES[P]:(u=P,u.charAt(0)==="#"&&(u.charAt(1)==="x"?(u=u.slice(2),_=parseInt(u,16),J=_.toString(16)):(u=u.slice(1),_=parseInt(u,10),J=_.toString(10))),u=u.replace(/^0+/,""),isNaN(_)||J.toLowerCase()!==u||_<0||_>1114111?(q(m,"Invalid character entity"),"&"+m.entity+";"):String.fromCodePoint(_))}function Q(m,u){u==="<"?(m.state=l.OPEN_WAKA,m.startTagPosition=m.position):E(u)||(q(m,"Non-whitespace before first tag."),m.textNode=u,m.state=l.TEXT)}function Ht(m,u){var P="";return u<m.length&&(P=m.charAt(u)),P}function K(m){var u=this;if(this.error)throw this.error;if(u.closed)return Y(u,"Cannot write after close. Assign an onready handler.");if(m===null)return k(u);typeof m=="object"&&(m=m.toString());for(var P=0,_="";_=Ht(m,P++),u.c=_,!!_;)switch(u.trackPosition&&(u.position++,_===`
|
|
99
|
+
`?(u.line++,u.column=0):u.column++),u.state){case l.BEGIN:if(u.state=l.BEGIN_WHITESPACE,_==="\uFEFF")continue;Q(u,_);continue;case l.BEGIN_WHITESPACE:Q(u,_);continue;case l.TEXT:if(u.sawRoot&&!u.closedRoot){for(var nt=P-1;_&&_!=="<"&&_!=="&";)_=Ht(m,P++),_&&u.trackPosition&&(u.position++,_===`
|
|
100
|
+
`?(u.line++,u.column=0):u.column++);u.textNode+=m.substring(nt,P-1)}_==="<"&&!(u.sawRoot&&u.closedRoot&&!u.strict)?(u.state=l.OPEN_WAKA,u.startTagPosition=u.position):(!E(_)&&(!u.sawRoot||u.closedRoot)&&q(u,"Text data outside of root node."),_==="&"?u.state=l.TEXT_ENTITY:u.textNode+=_);continue;case l.SCRIPT:_==="<"?u.state=l.SCRIPT_ENDING:u.script+=_;continue;case l.SCRIPT_ENDING:_==="/"?u.state=l.CLOSE_TAG:(u.script+="<"+_,u.state=l.SCRIPT);continue;case l.OPEN_WAKA:if(_==="!")u.state=l.SGML_DECL,u.sgmlDecl="";else if(!E(_))if(U(w,_))u.state=l.OPEN_TAG,u.tagName=_;else if(_==="/")u.state=l.CLOSE_TAG,u.tagName="";else if(_==="?")u.state=l.PROC_INST,u.procInstName=u.procInstBody="";else{if(q(u,"Unencoded <"),u.startTagPosition+1<u.position){var J=u.position-u.startTagPosition;_=new Array(J).join(" ")+_}u.textNode+="<"+_,u.state=l.TEXT}continue;case l.SGML_DECL:if(u.sgmlDecl+_==="--"){u.state=l.COMMENT,u.comment="",u.sgmlDecl="";continue}u.doctype&&u.doctype!==!0&&u.sgmlDecl?(u.state=l.DOCTYPE_DTD,u.doctype+="<!"+u.sgmlDecl+_,u.sgmlDecl=""):(u.sgmlDecl+_).toUpperCase()===f?(L(u,"onopencdata"),u.state=l.CDATA,u.sgmlDecl="",u.cdata=""):(u.sgmlDecl+_).toUpperCase()===h?(u.state=l.DOCTYPE,(u.doctype||u.sawRoot)&&q(u,"Inappropriately located doctype declaration"),u.doctype="",u.sgmlDecl=""):_===">"?(L(u,"onsgmldeclaration",u.sgmlDecl),u.sgmlDecl="",u.state=l.TEXT):(T(_)&&(u.state=l.SGML_DECL_QUOTED),u.sgmlDecl+=_);continue;case l.SGML_DECL_QUOTED:_===u.q&&(u.state=l.SGML_DECL,u.q=""),u.sgmlDecl+=_;continue;case l.DOCTYPE:_===">"?(u.state=l.TEXT,L(u,"ondoctype",u.doctype),u.doctype=!0):(u.doctype+=_,_==="["?u.state=l.DOCTYPE_DTD:T(_)&&(u.state=l.DOCTYPE_QUOTED,u.q=_));continue;case l.DOCTYPE_QUOTED:u.doctype+=_,_===u.q&&(u.q="",u.state=l.DOCTYPE);continue;case l.DOCTYPE_DTD:_==="]"?(u.doctype+=_,u.state=l.DOCTYPE):_==="<"?(u.state=l.OPEN_WAKA,u.startTagPosition=u.position):T(_)?(u.doctype+=_,u.state=l.DOCTYPE_DTD_QUOTED,u.q=_):u.doctype+=_;continue;case l.DOCTYPE_DTD_QUOTED:u.doctype+=_,_===u.q&&(u.state=l.DOCTYPE_DTD,u.q="");continue;case l.COMMENT:_==="-"?u.state=l.COMMENT_ENDING:u.comment+=_;continue;case l.COMMENT_ENDING:_==="-"?(u.state=l.COMMENT_ENDED,u.comment=X(u.opt,u.comment),u.comment&&L(u,"oncomment",u.comment),u.comment=""):(u.comment+="-"+_,u.state=l.COMMENT);continue;case l.COMMENT_ENDED:_!==">"?(q(u,"Malformed comment"),u.comment+="--"+_,u.state=l.COMMENT):u.doctype&&u.doctype!==!0?u.state=l.DOCTYPE_DTD:u.state=l.TEXT;continue;case l.CDATA:for(var nt=P-1;_&&_!=="]";)_=Ht(m,P++),_&&u.trackPosition&&(u.position++,_===`
|
|
101
|
+
`?(u.line++,u.column=0):u.column++);u.cdata+=m.substring(nt,P-1),_==="]"&&(u.state=l.CDATA_ENDING);continue;case l.CDATA_ENDING:_==="]"?u.state=l.CDATA_ENDING_2:(u.cdata+="]"+_,u.state=l.CDATA);continue;case l.CDATA_ENDING_2:_===">"?(u.cdata&&L(u,"oncdata",u.cdata),L(u,"onclosecdata"),u.cdata="",u.state=l.TEXT):_==="]"?u.cdata+="]":(u.cdata+="]]"+_,u.state=l.CDATA);continue;case l.PROC_INST:_==="?"?u.state=l.PROC_INST_ENDING:E(_)?u.state=l.PROC_INST_BODY:u.procInstName+=_;continue;case l.PROC_INST_BODY:if(!u.procInstBody&&E(_))continue;_==="?"?u.state=l.PROC_INST_ENDING:u.procInstBody+=_;continue;case l.PROC_INST_ENDING:_===">"?(L(u,"onprocessinginstruction",{name:u.procInstName,body:u.procInstBody}),u.procInstName=u.procInstBody="",u.state=l.TEXT):(u.procInstBody+="?"+_,u.state=l.PROC_INST_BODY);continue;case l.OPEN_TAG:U(A,_)?u.tagName+=_:(at(u),_===">"?mt(u):_==="/"?u.state=l.OPEN_TAG_SLASH:(E(_)||q(u,"Invalid character in tag name"),u.state=l.ATTRIB));continue;case l.OPEN_TAG_SLASH:_===">"?(mt(u,!0),wt(u)):(q(u,"Forward-slash in opening tag not followed by >"),u.state=l.ATTRIB);continue;case l.ATTRIB:if(E(_))continue;_===">"?mt(u):_==="/"?u.state=l.OPEN_TAG_SLASH:U(w,_)?(u.attribName=_,u.attribValue="",u.state=l.ATTRIB_NAME):q(u,"Invalid attribute name");continue;case l.ATTRIB_NAME:_==="="?u.state=l.ATTRIB_VALUE:_===">"?(q(u,"Attribute without value"),u.attribValue=u.attribName,st(u),mt(u)):E(_)?u.state=l.ATTRIB_NAME_SAW_WHITE:U(A,_)?u.attribName+=_:q(u,"Invalid attribute name");continue;case l.ATTRIB_NAME_SAW_WHITE:if(_==="=")u.state=l.ATTRIB_VALUE;else{if(E(_))continue;q(u,"Attribute without value"),u.tag.attributes[u.attribName]="",u.attribValue="",L(u,"onattribute",{name:u.attribName,value:""}),u.attribName="",_===">"?mt(u):U(w,_)?(u.attribName=_,u.state=l.ATTRIB_NAME):(q(u,"Invalid attribute name"),u.state=l.ATTRIB)}continue;case l.ATTRIB_VALUE:if(E(_))continue;T(_)?(u.q=_,u.state=l.ATTRIB_VALUE_QUOTED):(u.opt.unquotedAttributeValues||Y(u,"Unquoted attribute value"),u.state=l.ATTRIB_VALUE_UNQUOTED,u.attribValue=_);continue;case l.ATTRIB_VALUE_QUOTED:if(_!==u.q){_==="&"?u.state=l.ATTRIB_VALUE_ENTITY_Q:u.attribValue+=_;continue}st(u),u.q="",u.state=l.ATTRIB_VALUE_CLOSED;continue;case l.ATTRIB_VALUE_CLOSED:E(_)?u.state=l.ATTRIB:_===">"?mt(u):_==="/"?u.state=l.OPEN_TAG_SLASH:U(w,_)?(q(u,"No whitespace between attributes"),u.attribName=_,u.attribValue="",u.state=l.ATTRIB_NAME):q(u,"Invalid attribute name");continue;case l.ATTRIB_VALUE_UNQUOTED:if(!F(_)){_==="&"?u.state=l.ATTRIB_VALUE_ENTITY_U:u.attribValue+=_;continue}st(u),_===">"?mt(u):u.state=l.ATTRIB;continue;case l.CLOSE_TAG:if(u.tagName)_===">"?wt(u):U(A,_)?u.tagName+=_:u.script?(u.script+="</"+u.tagName+_,u.tagName="",u.state=l.SCRIPT):(E(_)||q(u,"Invalid tagname in closing tag"),u.state=l.CLOSE_TAG_SAW_WHITE);else{if(E(_))continue;j(w,_)?u.script?(u.script+="</"+_,u.state=l.SCRIPT):q(u,"Invalid tagname in closing tag."):u.tagName=_}continue;case l.CLOSE_TAG_SAW_WHITE:if(E(_))continue;_===">"?wt(u):q(u,"Invalid characters in closing tag");continue;case l.TEXT_ENTITY:case l.ATTRIB_VALUE_ENTITY_Q:case l.ATTRIB_VALUE_ENTITY_U:var it,ht;switch(u.state){case l.TEXT_ENTITY:it=l.TEXT,ht="textNode";break;case l.ATTRIB_VALUE_ENTITY_Q:it=l.ATTRIB_VALUE_QUOTED,ht="attribValue";break;case l.ATTRIB_VALUE_ENTITY_U:it=l.ATTRIB_VALUE_UNQUOTED,ht="attribValue";break}if(_===";"){var I=Rt(u);u.opt.unparsedEntities&&!Object.values(t.XML_ENTITIES).includes(I)?((u.entityCount+=1)>u.opt.maxEntityCount&&Y(u,"Parsed entity count exceeds max entity count"),(u.entityDepth+=1)>u.opt.maxEntityDepth&&Y(u,"Parsed entity depth exceeds max entity depth"),u.entity="",u.state=it,u.write(I),u.entityDepth-=1):(u[ht]+=I,u.entity="",u.state=it)}else U(u.entity.length?d:C,_)?u.entity+=_:(q(u,"Invalid character in entity name"),u[ht]+="&"+u.entity+_,u.entity="",u.state=it);continue;default:throw new Error(u,"Unknown state: "+u.state)}return u.position>=u.bufferCheckPosition&&s(u),u}/*! http://mths.be/fromcodepoint v0.1.0 by @mathias */String.fromCodePoint||function(){var m=String.fromCharCode,u=Math.floor,P=function(){var _=16384,J=[],nt,it,ht=-1,I=arguments.length;if(!I)return"";for(var v="";++ht<I;){var R=Number(arguments[ht]);if(!isFinite(R)||R<0||R>1114111||u(R)!==R)throw RangeError("Invalid code point: "+R);R<=65535?J.push(R):(R-=65536,nt=(R>>10)+55296,it=R%1024+56320,J.push(nt,it)),(ht+1===I||J.length>_)&&(v+=m.apply(null,J),J.length=0)}return v};Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:P,configurable:!0,writable:!0}):String.fromCodePoint=P}()})(o)}(Ln)),Ln}var Sn={},Dr;function Po(){return Dr||(Dr=1,function(){Sn.stripBOM=function(o){return o[0]==="\uFEFF"?o.substring(1):o}}.call(et)),Sn}var ne={},Cr;function Kr(){return Cr||(Cr=1,function(){var o;o=new RegExp(/(?!xmlns)^.*:/),ne.normalize=function(t){return t.toLowerCase()},ne.firstCharLowerCase=function(t){return t.charAt(0).toLowerCase()+t.slice(1)},ne.stripPrefix=function(t){return t.replace(o,"")},ne.parseNumbers=function(t){return isNaN(t)||(t=t%1===0?parseInt(t,10):parseFloat(t)),t},ne.parseBooleans=function(t){return/^(?:true|false)$/i.test(t)&&(t=t.toLowerCase()==="true"),t}}.call(et)),ne}var Ir;function Ao(){return Ir||(Ir=1,function(o){(function(){var t,e,n,s,i,r,a,c,g,p=function(b,O){return function(){return b.apply(O,arguments)}},f=function(b,O){for(var D in O)h.call(O,D)&&(b[D]=O[D]);function w(){this.constructor=b}return w.prototype=O.prototype,b.prototype=new w,b.__super__=O.prototype,b},h={}.hasOwnProperty;c=No(),s=qn,t=Po(),a=Kr(),g=ss.setImmediate,e=Vn().defaults,i=function(b){return typeof b=="object"&&b!=null&&Object.keys(b).length===0},r=function(b,O,D){var w,A,C;for(w=0,A=b.length;w<A;w++)C=b[w],O=C(O,D);return O},n=function(b,O,D){var w;return w=Object.create(null),w.value=D,w.writable=!0,w.enumerable=!0,w.configurable=!0,Object.defineProperty(b,O,w)},o.Parser=function(b){f(O,b);function O(D){this.parseStringPromise=p(this.parseStringPromise,this),this.parseString=p(this.parseString,this),this.reset=p(this.reset,this),this.assignOrPush=p(this.assignOrPush,this),this.processAsync=p(this.processAsync,this);var w,A,C;if(!(this instanceof o.Parser))return new o.Parser(D);this.options={},A=e["0.2"];for(w in A)h.call(A,w)&&(C=A[w],this.options[w]=C);for(w in D)h.call(D,w)&&(C=D[w],this.options[w]=C);this.options.xmlns&&(this.options.xmlnskey=this.options.attrkey+"ns"),this.options.normalizeTags&&(this.options.tagNameProcessors||(this.options.tagNameProcessors=[]),this.options.tagNameProcessors.unshift(a.normalize)),this.reset()}return O.prototype.processAsync=function(){var D,w;try{return this.remaining.length<=this.options.chunkSize?(D=this.remaining,this.remaining="",this.saxParser=this.saxParser.write(D),this.saxParser.close()):(D=this.remaining.substr(0,this.options.chunkSize),this.remaining=this.remaining.substr(this.options.chunkSize,this.remaining.length),this.saxParser=this.saxParser.write(D),g(this.processAsync))}catch(A){if(w=A,!this.saxParser.errThrown)return this.saxParser.errThrown=!0,this.emit(w)}},O.prototype.assignOrPush=function(D,w,A){return w in D?(D[w]instanceof Array||n(D,w,[D[w]]),D[w].push(A)):this.options.explicitArray?n(D,w,[A]):n(D,w,A)},O.prototype.reset=function(){var D,w,A,C;return this.removeAllListeners(),this.saxParser=c.parser(this.options.strict,{trim:!1,normalize:!1,xmlns:this.options.xmlns}),this.saxParser.errThrown=!1,this.saxParser.onerror=function(d){return function(E){if(d.saxParser.resume(),!d.saxParser.errThrown)return d.saxParser.errThrown=!0,d.emit("error",E)}}(this),this.saxParser.onend=function(d){return function(){if(!d.saxParser.ended)return d.saxParser.ended=!0,d.emit("end",d.resultObject)}}(this),this.saxParser.ended=!1,this.EXPLICIT_CHARKEY=this.options.explicitCharkey,this.resultObject=null,C=[],D=this.options.attrkey,w=this.options.charkey,this.saxParser.onopentag=function(d){return function(E){var T,F,U,j,l;if(U={},U[w]="",!d.options.ignoreAttrs){l=E.attributes;for(T in l)h.call(l,T)&&(!(D in U)&&!d.options.mergeAttrs&&(U[D]={}),F=d.options.attrValueProcessors?r(d.options.attrValueProcessors,E.attributes[T],T):E.attributes[T],j=d.options.attrNameProcessors?r(d.options.attrNameProcessors,T):T,d.options.mergeAttrs?d.assignOrPush(U,j,F):n(U[D],j,F))}return U["#name"]=d.options.tagNameProcessors?r(d.options.tagNameProcessors,E.name):E.name,d.options.xmlns&&(U[d.options.xmlnskey]={uri:E.uri,local:E.local}),C.push(U)}}(this),this.saxParser.onclosetag=function(d){return function(){var E,T,F,U,j,l,M,N,L,B;if(l=C.pop(),j=l["#name"],(!d.options.explicitChildren||!d.options.preserveChildrenOrder)&&delete l["#name"],l.cdata===!0&&(E=l.cdata,delete l.cdata),L=C[C.length-1],l[w].match(/^\s*$/)&&!E?(T=l[w],delete l[w]):(d.options.trim&&(l[w]=l[w].trim()),d.options.normalize&&(l[w]=l[w].replace(/\s{2,}/g," ").trim()),l[w]=d.options.valueProcessors?r(d.options.valueProcessors,l[w],j):l[w],Object.keys(l).length===1&&w in l&&!d.EXPLICIT_CHARKEY&&(l=l[w])),i(l)&&(typeof d.options.emptyTag=="function"?l=d.options.emptyTag():l=d.options.emptyTag!==""?d.options.emptyTag:T),d.options.validator!=null&&(B="/"+function(){var X,Y,k;for(k=[],X=0,Y=C.length;X<Y;X++)U=C[X],k.push(U["#name"]);return k}().concat(j).join("/"),function(){var X;try{return l=d.options.validator(B,L&&L[j],l)}catch(Y){return X=Y,d.emit("error",X)}}()),d.options.explicitChildren&&!d.options.mergeAttrs&&typeof l=="object"){if(!d.options.preserveChildrenOrder)U={},d.options.attrkey in l&&(U[d.options.attrkey]=l[d.options.attrkey],delete l[d.options.attrkey]),!d.options.charsAsChildren&&d.options.charkey in l&&(U[d.options.charkey]=l[d.options.charkey],delete l[d.options.charkey]),Object.getOwnPropertyNames(l).length>0&&(U[d.options.childkey]=l),l=U;else if(L){L[d.options.childkey]=L[d.options.childkey]||[],M={};for(F in l)h.call(l,F)&&n(M,F,l[F]);L[d.options.childkey].push(M),delete l["#name"],Object.keys(l).length===1&&w in l&&!d.EXPLICIT_CHARKEY&&(l=l[w])}}return C.length>0?d.assignOrPush(L,j,l):(d.options.explicitRoot&&(N=l,l={},n(l,j,N)),d.resultObject=l,d.saxParser.ended=!0,d.emit("end",d.resultObject))}}(this),A=function(d){return function(E){var T,F;if(F=C[C.length-1],F)return F[w]+=E,d.options.explicitChildren&&d.options.preserveChildrenOrder&&d.options.charsAsChildren&&(d.options.includeWhiteChars||E.replace(/\\n/g,"").trim()!=="")&&(F[d.options.childkey]=F[d.options.childkey]||[],T={"#name":"__text__"},T[w]=E,d.options.normalize&&(T[w]=T[w].replace(/\s{2,}/g," ").trim()),F[d.options.childkey].push(T)),F}}(this),this.saxParser.ontext=A,this.saxParser.oncdata=function(d){return function(E){var T;if(T=A(E),T)return T.cdata=!0}}()},O.prototype.parseString=function(D,w){var A;w!=null&&typeof w=="function"&&(this.on("end",function(C){return this.reset(),w(null,C)}),this.on("error",function(C){return this.reset(),w(C)}));try{return D=D.toString(),D.trim()===""?(this.emit("end",null),!0):(D=t.stripBOM(D),this.options.async?(this.remaining=D,g(this.processAsync),this.saxParser):this.saxParser.write(D).close())}catch(C){if(A=C,this.saxParser.errThrown||this.saxParser.ended){if(this.saxParser.ended)throw A}else return this.emit("error",A),this.saxParser.errThrown=!0}},O.prototype.parseStringPromise=function(D){return new Promise(function(w){return function(A,C){return w.parseString(D,function(d,E){return d?C(d):A(E)})}}(this))},O}(s),o.parseString=function(b,O,D){var w,A,C;return D!=null?(typeof D=="function"&&(w=D),typeof O=="object"&&(A=O)):(typeof O=="function"&&(w=O),A={}),C=new o.Parser(A),C.parseString(b,w)},o.parseStringPromise=function(b,O){var D,w;return typeof O=="object"&&(D=O),w=new o.Parser(D),w.parseStringPromise(b)}}).call(et)}(Mn)),Mn}var Qr;(function(){var o,t,e,n=function(i,r){for(var a in r)s.call(r,a)&&(i[a]=r[a]);function c(){this.constructor=i}return c.prototype=r.prototype,i.prototype=new c,i.__super__=r.prototype,i},s={}.hasOwnProperty;t=Vn(),o=xo(),e=Ao(),Kr(),t.defaults,function(i){n(r,i);function r(a){this.message=a}return r}(Error),o.Builder,e.Parser,e.parseString,Qr=e.parseStringPromise}).call(et);class Jr{constructor(t,e,n){this.nextTxnId=1,this.pendingCommands=new Map,this.breakpoints=new Map,this.scriptIdByUrl=new Map,this.nextScriptId=1,this.objectHandles=new Map,this.nextObjectId=1,this.callFramesMap=new Map,this.xdebugConnected=!1,this.dbgp=t,this.cdp=e,this.readPHPFile=n.getPHPFile,this.phpRoot=n.phpRoot||"";for(const s of n.knownScriptUrls)this.scriptIdByUrl.set(s,this.getOrCreateScriptId(s));this.breakOnFirstLine=n.breakOnFirstLine||!1}start(){this.dbgp.on("connected",()=>{this.xdebugConnected=!0,this.sendDbgpCommand("stdout","-c 1"),this.sendDbgpCommand("stderr","-c 1")}),this.dbgp.on("message",async t=>{try{const e=await Qr(t,{explicitArray:!1});await this.handleDbgpMessage(e)}catch{}}),this.dbgp.on("disconnected",()=>{this.xdebugConnected=!1,this.cdp.sendMessage({method:"Debugger.paused",params:{reason:"terminated",callFrames:[]}})}),this.cdp.on("message",t=>{this.handleCdpMessage(t)}),this.cdp.on("clientDisconnected",()=>{this.xdebugConnected&&this.sendDbgpCommand("detach")}),this.sendInitialScripts().then(()=>{if(!this.breakOnFirstLine){const t=this.scriptIdByUrl.entries().next().value;t&&(this.cdp.sendMessage({method:"Debugger.paused",params:{callFrames:[{location:{scriptId:t[1],lineNumber:0},scopeChain:[],this:{type:"undefined"}}],reason:"other"}}),setTimeout(()=>{this.cdp.sendMessage({method:"Debugger.resumed"})},50))}this.cdp.sendMessage({method:"Log.entryAdded",params:{entry:{source:"other",level:"info",text:`🎉 Welcome to WordPress Playground DevTools! 🎉
|
|
102
102
|
‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
|
|
103
103
|
|
|
104
104
|
1. Add breakpoints in your files to start step debugging.
|