From 699db3d053518a9c88e0c2f798eb66c0dc2df63b Mon Sep 17 00:00:00 2001 From: MLSTRM <> Date: Fri, 15 Mar 2024 11:45:36 +0000 Subject: [PATCH] Support split dev dependency checking Based on dev dependency identification logic from the npm audit cli package --- README.md | 9 ++++ bundles/@yarnpkg/plugin-licenses-audit.js | 38 ++++++------- src/index.ts | 65 ++++++++++++++++++++--- 3 files changed, 87 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index f1d5edb..2a6e77b 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,15 @@ module.exports = { } ``` +or + +```js +module.exports = { + isValidLicense: new RegExp('\\b(mit|apache\\b.*2|bsd|isc|unlicense)\\b', 'i'), + // To apply a different matching rule to dev dependencies, use the isValidDevLicense property + isValidDevLicense: new RegExp('\\b(mit|apache\\b.*2|bsd|isc|unlicense|CC(0|-BY)-[\d.]+|LGPL-[\d.+]+)\\b', 'i'), +} +``` and then: diff --git a/bundles/@yarnpkg/plugin-licenses-audit.js b/bundles/@yarnpkg/plugin-licenses-audit.js index 9a512ad..972173e 100644 --- a/bundles/@yarnpkg/plugin-licenses-audit.js +++ b/bundles/@yarnpkg/plugin-licenses-audit.js @@ -3,36 +3,36 @@ module.exports = { name: "@yarnpkg/plugin-licenses-audit", factory: function (require) { -"use strict";var plugin=(()=>{var Vw=Object.create;var Bn=Object.defineProperty;var $w=Object.getOwnPropertyDescriptor;var Gw=Object.getOwnPropertyNames;var zw=Object.getPrototypeOf,Yw=Object.prototype.hasOwnProperty;var Gt=(i=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(i,{get:(f,D)=>(typeof require<"u"?require:f)[D]}):i)(function(i){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+i+'" is not supported')});var tt=(i,f)=>()=>(f||i((f={exports:{}}).exports,f),f.exports),Zw=(i,f)=>{for(var D in f)Bn(i,D,{get:f[D],enumerable:!0})},da=(i,f,D,v)=>{if(f&&typeof f=="object"||typeof f=="function")for(let h of Gw(f))!Yw.call(i,h)&&h!==D&&Bn(i,h,{get:()=>f[h],enumerable:!(v=$w(f,h))||v.enumerable});return i};var jw=(i,f,D)=>(D=i!=null?Vw(zw(i)):{},da(f||!i||!i.__esModule?Bn(D,"default",{value:i,enumerable:!0}):D,i)),Jw=i=>da(Bn({},"__esModule",{value:!0}),i);var xs=tt((gr,Wr)=>{(function(){var i,f="4.17.21",D=200,v="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",h="Expected a function",b="Invalid `variable` option passed into `_.template`",w="__lodash_hash_undefined__",E=500,T="__lodash_placeholder__",F=1,M=2,m=4,A=1,X=2,B=1,G=2,nt=4,Z=8,xt=16,p=32,d=64,O=128,a=256,x=512,C=30,l="...",I=800,S=16,k=1,z=2,j=3,pt=1/0,at=9007199254740991,it=17976931348623157e292,_t=0/0,St=4294967295,Je=St-1,Qe=St>>>1,yr=[["ary",O],["bind",B],["bindKey",G],["curry",Z],["curryRight",xt],["flip",x],["partial",p],["partialRight",d],["rearg",a]],ce="[object Arguments]",ie="[object Array]",tr="[object AsyncFunction]",_r="[object Boolean]",vr="[object Date]",oh="[object DOMException]",Gr="[object Error]",zr="[object Function]",Rs="[object GeneratorFunction]",se="[object Map]",br="[object Number]",ah="[object Null]",we="[object Object]",Fs="[object Promise]",fh="[object Proxy]",Dr="[object RegExp]",ue="[object Set]",Tr="[object String]",Yr="[object Symbol]",hh="[object Undefined]",Er="[object WeakMap]",lh="[object WeakSet]",xr="[object ArrayBuffer]",er="[object DataView]",ii="[object Float32Array]",si="[object Float64Array]",ui="[object Int8Array]",oi="[object Int16Array]",ai="[object Int32Array]",fi="[object Uint8Array]",hi="[object Uint8ClampedArray]",li="[object Uint16Array]",ci="[object Uint32Array]",ch=/\b__p \+= '';/g,dh=/\b(__p \+=) '' \+/g,ph=/(__e\(.*?\)|\b__t\)) \+\n'';/g,qs=/&(?:amp|lt|gt|quot|#39);/g,Xs=/[&<>"']/g,gh=RegExp(qs.source),mh=RegExp(Xs.source),wh=/<%-([\s\S]+?)%>/g,yh=/<%([\s\S]+?)%>/g,Bs=/<%=([\s\S]+?)%>/g,_h=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,vh=/^\w*$/,bh=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,di=/[\\^$.*+?()[\]{}|]/g,Dh=RegExp(di.source),pi=/^\s+/,Th=/\s/,Eh=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,xh=/\{\n\/\* \[wrapped with (.+)\] \*/,Ih=/,? & /,Oh=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Lh=/[()=,{}\[\]\/\s]/,Ch=/\\(\\)?/g,Mh=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Us=/\w*$/,Ah=/^[-+]0x[0-9a-f]+$/i,Nh=/^0b[01]+$/i,Sh=/^\[object .+?Constructor\]$/,Ph=/^0o[0-7]+$/i,Rh=/^(?:0|[1-9]\d*)$/,Fh=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Zr=/($^)/,qh=/['\n\r\u2028\u2029\\]/g,jr="\\ud800-\\udfff",Xh="\\u0300-\\u036f",Bh="\\ufe20-\\ufe2f",Uh="\\u20d0-\\u20ff",Ws=Xh+Bh+Uh,ks="\\u2700-\\u27bf",Ks="a-z\\xdf-\\xf6\\xf8-\\xff",Wh="\\xac\\xb1\\xd7\\xf7",kh="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Kh="\\u2000-\\u206f",Hh=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Hs="A-Z\\xc0-\\xd6\\xd8-\\xde",Vs="\\ufe0e\\ufe0f",$s=Wh+kh+Kh+Hh,gi="['\u2019]",Vh="["+jr+"]",Gs="["+$s+"]",Jr="["+Ws+"]",zs="\\d+",$h="["+ks+"]",Ys="["+Ks+"]",Zs="[^"+jr+$s+zs+ks+Ks+Hs+"]",mi="\\ud83c[\\udffb-\\udfff]",Gh="(?:"+Jr+"|"+mi+")",js="[^"+jr+"]",wi="(?:\\ud83c[\\udde6-\\uddff]){2}",yi="[\\ud800-\\udbff][\\udc00-\\udfff]",rr="["+Hs+"]",Js="\\u200d",Qs="(?:"+Ys+"|"+Zs+")",zh="(?:"+rr+"|"+Zs+")",tu="(?:"+gi+"(?:d|ll|m|re|s|t|ve))?",eu="(?:"+gi+"(?:D|LL|M|RE|S|T|VE))?",ru=Gh+"?",nu="["+Vs+"]?",Yh="(?:"+Js+"(?:"+[js,wi,yi].join("|")+")"+nu+ru+")*",Zh="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",jh="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",iu=nu+ru+Yh,Jh="(?:"+[$h,wi,yi].join("|")+")"+iu,Qh="(?:"+[js+Jr+"?",Jr,wi,yi,Vh].join("|")+")",tl=RegExp(gi,"g"),el=RegExp(Jr,"g"),_i=RegExp(mi+"(?="+mi+")|"+Qh+iu,"g"),rl=RegExp([rr+"?"+Ys+"+"+tu+"(?="+[Gs,rr,"$"].join("|")+")",zh+"+"+eu+"(?="+[Gs,rr+Qs,"$"].join("|")+")",rr+"?"+Qs+"+"+tu,rr+"+"+eu,jh,Zh,zs,Jh].join("|"),"g"),nl=RegExp("["+Js+jr+Ws+Vs+"]"),il=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,sl=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],ul=-1,gt={};gt[ii]=gt[si]=gt[ui]=gt[oi]=gt[ai]=gt[fi]=gt[hi]=gt[li]=gt[ci]=!0,gt[ce]=gt[ie]=gt[xr]=gt[_r]=gt[er]=gt[vr]=gt[Gr]=gt[zr]=gt[se]=gt[br]=gt[we]=gt[Dr]=gt[ue]=gt[Tr]=gt[Er]=!1;var dt={};dt[ce]=dt[ie]=dt[xr]=dt[er]=dt[_r]=dt[vr]=dt[ii]=dt[si]=dt[ui]=dt[oi]=dt[ai]=dt[se]=dt[br]=dt[we]=dt[Dr]=dt[ue]=dt[Tr]=dt[Yr]=dt[fi]=dt[hi]=dt[li]=dt[ci]=!0,dt[Gr]=dt[zr]=dt[Er]=!1;var ol={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},al={"&":"&","<":"<",">":">",'"':""","'":"'"},fl={"&":"&","<":"<",">":">",""":'"',"'":"'"},hl={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ll=parseFloat,cl=parseInt,su=typeof global=="object"&&global&&global.Object===Object&&global,dl=typeof self=="object"&&self&&self.Object===Object&&self,It=su||dl||Function("return this")(),vi=typeof gr=="object"&&gr&&!gr.nodeType&&gr,We=vi&&typeof Wr=="object"&&Wr&&!Wr.nodeType&&Wr,uu=We&&We.exports===vi,bi=uu&&su.process,Yt=function(){try{var y=We&&We.require&&We.require("util").types;return y||bi&&bi.binding&&bi.binding("util")}catch{}}(),ou=Yt&&Yt.isArrayBuffer,au=Yt&&Yt.isDate,fu=Yt&&Yt.isMap,hu=Yt&&Yt.isRegExp,lu=Yt&&Yt.isSet,cu=Yt&&Yt.isTypedArray;function Wt(y,N,L){switch(L.length){case 0:return y.call(N);case 1:return y.call(N,L[0]);case 2:return y.call(N,L[0],L[1]);case 3:return y.call(N,L[0],L[1],L[2])}return y.apply(N,L)}function pl(y,N,L,W){for(var Y=-1,ft=y==null?0:y.length;++Y-1}function Di(y,N,L){for(var W=-1,Y=y==null?0:y.length;++W-1;);return L}function vu(y,N){for(var L=y.length;L--&&nr(N,y[L],0)>-1;);return L}function Tl(y,N){for(var L=y.length,W=0;L--;)y[L]===N&&++W;return W}var El=Ii(ol),xl=Ii(al);function Il(y){return"\\"+hl[y]}function Ol(y,N){return y==null?i:y[N]}function ir(y){return nl.test(y)}function Ll(y){return il.test(y)}function Cl(y){for(var N,L=[];!(N=y.next()).done;)L.push(N.value);return L}function Mi(y){var N=-1,L=Array(y.size);return y.forEach(function(W,Y){L[++N]=[Y,W]}),L}function bu(y,N){return function(L){return y(N(L))}}function Ae(y,N){for(var L=-1,W=y.length,Y=0,ft=[];++L-1}function mc(t,e){var r=this.__data__,n=wn(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}ye.prototype.clear=cc,ye.prototype.delete=dc,ye.prototype.get=pc,ye.prototype.has=gc,ye.prototype.set=mc;function _e(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e=e?t:e)),t}function Qt(t,e,r,n,s,o){var c,g=e&F,_=e&M,P=e&m;if(r&&(c=s?r(t,n,s,o):r(t)),c!==i)return c;if(!wt(t))return t;var R=J(t);if(R){if(c=vd(t),!g)return qt(t,c)}else{var q=At(t),U=q==zr||q==Rs;if(Xe(t))return no(t,g);if(q==we||q==ce||U&&!s){if(c=_||U?{}:To(t),!g)return _?fd(t,Nc(c,t)):ad(t,Su(c,t))}else{if(!dt[q])return s?t:{};c=bd(t,q,g)}}o||(o=new ae);var K=o.get(t);if(K)return K;o.set(t,c),Jo(t)?t.forEach(function($){c.add(Qt($,e,r,$,t,o))}):Zo(t)&&t.forEach(function($,st){c.set(st,Qt($,e,r,st,t,o))});var V=P?_?rs:es:_?Bt:Ot,et=R?i:V(t);return Zt(et||t,function($,st){et&&(st=$,$=t[st]),Nr(c,st,Qt($,e,r,st,t,o))}),c}function Sc(t){var e=Ot(t);return function(r){return Pu(r,t,e)}}function Pu(t,e,r){var n=r.length;if(t==null)return!n;for(t=ct(t);n--;){var s=r[n],o=e[s],c=t[s];if(c===i&&!(s in t)||!o(c))return!1}return!0}function Ru(t,e,r){if(typeof t!="function")throw new jt(h);return Br(function(){t.apply(i,r)},e)}function Sr(t,e,r,n){var s=-1,o=Qr,c=!0,g=t.length,_=[],P=e.length;if(!g)return _;r&&(e=mt(e,kt(r))),n?(o=Di,c=!1):e.length>=D&&(o=Ir,c=!1,e=new He(e));t:for(;++ss?0:s+r),n=n===i||n>s?s:Q(n),n<0&&(n+=s),n=r>n?0:ta(n);r0&&r(g)?e>1?Lt(g,e-1,r,n,s):Me(s,g):n||(s[s.length]=g)}return s}var qi=fo(),Xu=fo(!0);function de(t,e){return t&&qi(t,e,Ot)}function Xi(t,e){return t&&Xu(t,e,Ot)}function _n(t,e){return Ce(e,function(r){return Ee(t[r])})}function $e(t,e){e=Fe(e,t);for(var r=0,n=e.length;t!=null&&re}function Fc(t,e){return t!=null&<.call(t,e)}function qc(t,e){return t!=null&&e in ct(t)}function Xc(t,e,r){return t>=Mt(e,r)&&t=120&&R.length>=120)?new He(c&&R):i}R=t[0];var q=-1,U=g[0];t:for(;++q-1;)g!==t&&hn.call(g,_,1),hn.call(t,_,1);return t}function Yu(t,e){for(var r=t?e.length:0,n=r-1;r--;){var s=e[r];if(r==n||s!==o){var o=s;Te(s)?hn.call(t,s,1):zi(t,s)}}return t}function Vi(t,e){return t+dn(Cu()*(e-t+1))}function jc(t,e,r,n){for(var s=-1,o=Et(cn((e-t)/(r||1)),0),c=L(o);o--;)c[n?o:++s]=t,t+=r;return c}function $i(t,e){var r="";if(!t||e<1||e>at)return r;do e%2&&(r+=t),e=dn(e/2),e&&(t+=t);while(e);return r}function rt(t,e){return fs(Io(t,e,Ut),t+"")}function Jc(t){return Nu(pr(t))}function Qc(t,e){var r=pr(t);return Mn(r,Ve(e,0,r.length))}function Fr(t,e,r,n){if(!wt(t))return t;e=Fe(e,t);for(var s=-1,o=e.length,c=o-1,g=t;g!=null&&++ss?0:s+e),r=r>s?s:r,r<0&&(r+=s),s=e>r?0:r-e>>>0,e>>>=0;for(var o=L(s);++n>>1,c=t[o];c!==null&&!Ht(c)&&(r?c<=e:c=D){var P=e?null:dd(t);if(P)return en(P);c=!1,s=Ir,_=new He}else _=e?[]:g;t:for(;++n=n?t:te(t,e,r)}var ro=Hl||function(t){return It.clearTimeout(t)};function no(t,e){if(e)return t.slice();var r=t.length,n=Eu?Eu(r):new t.constructor(r);return t.copy(n),n}function Ji(t){var e=new t.constructor(t.byteLength);return new an(e).set(new an(t)),e}function id(t,e){var r=e?Ji(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}function sd(t){var e=new t.constructor(t.source,Us.exec(t));return e.lastIndex=t.lastIndex,e}function ud(t){return Ar?ct(Ar.call(t)):{}}function io(t,e){var r=e?Ji(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}function so(t,e){if(t!==e){var r=t!==i,n=t===null,s=t===t,o=Ht(t),c=e!==i,g=e===null,_=e===e,P=Ht(e);if(!g&&!P&&!o&&t>e||o&&c&&_&&!g&&!P||n&&c&&_||!r&&_||!s)return 1;if(!n&&!o&&!P&&t=g)return _;var P=r[n];return _*(P=="desc"?-1:1)}}return t.index-e.index}function uo(t,e,r,n){for(var s=-1,o=t.length,c=r.length,g=-1,_=e.length,P=Et(o-c,0),R=L(_+P),q=!n;++g<_;)R[g]=e[g];for(;++s1?r[s-1]:i,c=s>2?r[2]:i;for(o=t.length>3&&typeof o=="function"?(s--,o):i,c&&Rt(r[0],r[1],c)&&(o=s<3?i:o,s=1),e=ct(e);++n-1?s[o?e[c]:c]:i}}function co(t){return De(function(e){var r=e.length,n=r,s=Jt.prototype.thru;for(t&&e.reverse();n--;){var o=e[n];if(typeof o!="function")throw new jt(h);if(s&&!c&&Ln(o)=="wrapper")var c=new Jt([],!0)}for(n=c?n:r;++n1&&ot.reverse(),R&&_g))return!1;var P=o.get(t),R=o.get(e);if(P&&R)return P==e&&R==t;var q=-1,U=!0,K=r&X?new He:i;for(o.set(t,e),o.set(e,t);++q1?"& ":"")+e[n],e=e.join(r>2?", ":" "),t.replace(Eh,`{ +"use strict";var plugin=(()=>{var Vw=Object.create;var Bn=Object.defineProperty;var $w=Object.getOwnPropertyDescriptor;var Gw=Object.getOwnPropertyNames;var zw=Object.getPrototypeOf,Yw=Object.prototype.hasOwnProperty;var Gt=(i=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(i,{get:(h,b)=>(typeof require<"u"?require:h)[b]}):i)(function(i){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+i+'" is not supported')});var tt=(i,h)=>()=>(h||i((h={exports:{}}).exports,h),h.exports),Zw=(i,h)=>{for(var b in h)Bn(i,b,{get:h[b],enumerable:!0})},da=(i,h,b,_)=>{if(h&&typeof h=="object"||typeof h=="function")for(let f of Gw(h))!Yw.call(i,f)&&f!==b&&Bn(i,f,{get:()=>h[f],enumerable:!(_=$w(h,f))||_.enumerable});return i};var Jw=(i,h,b)=>(b=i!=null?Vw(zw(i)):{},da(h||!i||!i.__esModule?Bn(b,"default",{value:i,enumerable:!0}):b,i)),jw=i=>da(Bn({},"__esModule",{value:!0}),i);var xs=tt((gr,Wr)=>{(function(){var i,h="4.17.21",b=200,_="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",f="Expected a function",D="Invalid `variable` option passed into `_.template`",w="__lodash_hash_undefined__",E=500,T="__lodash_placeholder__",F=1,M=2,m=4,A=1,X=2,B=1,K=2,et=4,V=8,_t=16,g=32,d=64,O=128,a=256,x=512,C=30,l="...",I=800,S=16,H=1,Y=2,J=3,pt=1/0,at=9007199254740991,it=17976931348623157e292,vt=0/0,St=4294967295,je=St-1,Qe=St>>>1,yr=[["ary",O],["bind",B],["bindKey",K],["curry",V],["curryRight",_t],["flip",x],["partial",g],["partialRight",d],["rearg",a]],ce="[object Arguments]",ie="[object Array]",tr="[object AsyncFunction]",_r="[object Boolean]",vr="[object Date]",of="[object DOMException]",Gr="[object Error]",zr="[object Function]",Rs="[object GeneratorFunction]",se="[object Map]",Dr="[object Number]",af="[object Null]",we="[object Object]",Fs="[object Promise]",hf="[object Proxy]",br="[object RegExp]",ue="[object Set]",Tr="[object String]",Yr="[object Symbol]",ff="[object Undefined]",Er="[object WeakMap]",lf="[object WeakSet]",xr="[object ArrayBuffer]",er="[object DataView]",ii="[object Float32Array]",si="[object Float64Array]",ui="[object Int8Array]",oi="[object Int16Array]",ai="[object Int32Array]",hi="[object Uint8Array]",fi="[object Uint8ClampedArray]",li="[object Uint16Array]",ci="[object Uint32Array]",cf=/\b__p \+= '';/g,df=/\b(__p \+=) '' \+/g,pf=/(__e\(.*?\)|\b__t\)) \+\n'';/g,qs=/&(?:amp|lt|gt|quot|#39);/g,Xs=/[&<>"']/g,gf=RegExp(qs.source),mf=RegExp(Xs.source),wf=/<%-([\s\S]+?)%>/g,yf=/<%([\s\S]+?)%>/g,Bs=/<%=([\s\S]+?)%>/g,_f=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,vf=/^\w*$/,Df=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,di=/[\\^$.*+?()[\]{}|]/g,bf=RegExp(di.source),pi=/^\s+/,Tf=/\s/,Ef=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,xf=/\{\n\/\* \[wrapped with (.+)\] \*/,If=/,? & /,Of=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Lf=/[()=,{}\[\]\/\s]/,Cf=/\\(\\)?/g,Mf=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Us=/\w*$/,Af=/^[-+]0x[0-9a-f]+$/i,Nf=/^0b[01]+$/i,Sf=/^\[object .+?Constructor\]$/,Pf=/^0o[0-7]+$/i,Rf=/^(?:0|[1-9]\d*)$/,Ff=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Zr=/($^)/,qf=/['\n\r\u2028\u2029\\]/g,Jr="\\ud800-\\udfff",Xf="\\u0300-\\u036f",Bf="\\ufe20-\\ufe2f",Uf="\\u20d0-\\u20ff",Ws=Xf+Bf+Uf,Hs="\\u2700-\\u27bf",ks="a-z\\xdf-\\xf6\\xf8-\\xff",Wf="\\xac\\xb1\\xd7\\xf7",Hf="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",kf="\\u2000-\\u206f",Kf=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ks="A-Z\\xc0-\\xd6\\xd8-\\xde",Vs="\\ufe0e\\ufe0f",$s=Wf+Hf+kf+Kf,gi="['\u2019]",Vf="["+Jr+"]",Gs="["+$s+"]",jr="["+Ws+"]",zs="\\d+",$f="["+Hs+"]",Ys="["+ks+"]",Zs="[^"+Jr+$s+zs+Hs+ks+Ks+"]",mi="\\ud83c[\\udffb-\\udfff]",Gf="(?:"+jr+"|"+mi+")",Js="[^"+Jr+"]",wi="(?:\\ud83c[\\udde6-\\uddff]){2}",yi="[\\ud800-\\udbff][\\udc00-\\udfff]",rr="["+Ks+"]",js="\\u200d",Qs="(?:"+Ys+"|"+Zs+")",zf="(?:"+rr+"|"+Zs+")",tu="(?:"+gi+"(?:d|ll|m|re|s|t|ve))?",eu="(?:"+gi+"(?:D|LL|M|RE|S|T|VE))?",ru=Gf+"?",nu="["+Vs+"]?",Yf="(?:"+js+"(?:"+[Js,wi,yi].join("|")+")"+nu+ru+")*",Zf="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Jf="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",iu=nu+ru+Yf,jf="(?:"+[$f,wi,yi].join("|")+")"+iu,Qf="(?:"+[Js+jr+"?",jr,wi,yi,Vf].join("|")+")",tl=RegExp(gi,"g"),el=RegExp(jr,"g"),_i=RegExp(mi+"(?="+mi+")|"+Qf+iu,"g"),rl=RegExp([rr+"?"+Ys+"+"+tu+"(?="+[Gs,rr,"$"].join("|")+")",zf+"+"+eu+"(?="+[Gs,rr+Qs,"$"].join("|")+")",rr+"?"+Qs+"+"+tu,rr+"+"+eu,Jf,Zf,zs,jf].join("|"),"g"),nl=RegExp("["+js+Jr+Ws+Vs+"]"),il=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,sl=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],ul=-1,gt={};gt[ii]=gt[si]=gt[ui]=gt[oi]=gt[ai]=gt[hi]=gt[fi]=gt[li]=gt[ci]=!0,gt[ce]=gt[ie]=gt[xr]=gt[_r]=gt[er]=gt[vr]=gt[Gr]=gt[zr]=gt[se]=gt[Dr]=gt[we]=gt[br]=gt[ue]=gt[Tr]=gt[Er]=!1;var dt={};dt[ce]=dt[ie]=dt[xr]=dt[er]=dt[_r]=dt[vr]=dt[ii]=dt[si]=dt[ui]=dt[oi]=dt[ai]=dt[se]=dt[Dr]=dt[we]=dt[br]=dt[ue]=dt[Tr]=dt[Yr]=dt[hi]=dt[fi]=dt[li]=dt[ci]=!0,dt[Gr]=dt[zr]=dt[Er]=!1;var ol={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},al={"&":"&","<":"<",">":">",'"':""","'":"'"},hl={"&":"&","<":"<",">":">",""":'"',"'":"'"},fl={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ll=parseFloat,cl=parseInt,su=typeof global=="object"&&global&&global.Object===Object&&global,dl=typeof self=="object"&&self&&self.Object===Object&&self,It=su||dl||Function("return this")(),vi=typeof gr=="object"&&gr&&!gr.nodeType&&gr,We=vi&&typeof Wr=="object"&&Wr&&!Wr.nodeType&&Wr,uu=We&&We.exports===vi,Di=uu&&su.process,Yt=function(){try{var y=We&&We.require&&We.require("util").types;return y||Di&&Di.binding&&Di.binding("util")}catch{}}(),ou=Yt&&Yt.isArrayBuffer,au=Yt&&Yt.isDate,hu=Yt&&Yt.isMap,fu=Yt&&Yt.isRegExp,lu=Yt&&Yt.isSet,cu=Yt&&Yt.isTypedArray;function Wt(y,N,L){switch(L.length){case 0:return y.call(N);case 1:return y.call(N,L[0]);case 2:return y.call(N,L[0],L[1]);case 3:return y.call(N,L[0],L[1],L[2])}return y.apply(N,L)}function pl(y,N,L,W){for(var Z=-1,ht=y==null?0:y.length;++Z-1}function bi(y,N,L){for(var W=-1,Z=y==null?0:y.length;++W-1;);return L}function vu(y,N){for(var L=y.length;L--&&nr(N,y[L],0)>-1;);return L}function Tl(y,N){for(var L=y.length,W=0;L--;)y[L]===N&&++W;return W}var El=Ii(ol),xl=Ii(al);function Il(y){return"\\"+fl[y]}function Ol(y,N){return y==null?i:y[N]}function ir(y){return nl.test(y)}function Ll(y){return il.test(y)}function Cl(y){for(var N,L=[];!(N=y.next()).done;)L.push(N.value);return L}function Mi(y){var N=-1,L=Array(y.size);return y.forEach(function(W,Z){L[++N]=[Z,W]}),L}function Du(y,N){return function(L){return y(N(L))}}function Ae(y,N){for(var L=-1,W=y.length,Z=0,ht=[];++L-1}function mc(t,e){var r=this.__data__,n=wn(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}ye.prototype.clear=cc,ye.prototype.delete=dc,ye.prototype.get=pc,ye.prototype.has=gc,ye.prototype.set=mc;function _e(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e=e?t:e)),t}function Qt(t,e,r,n,s,o){var c,p=e&F,v=e&M,P=e&m;if(r&&(c=s?r(t,n,s,o):r(t)),c!==i)return c;if(!wt(t))return t;var R=j(t);if(R){if(c=vd(t),!p)return qt(t,c)}else{var q=At(t),U=q==zr||q==Rs;if(Xe(t))return no(t,p);if(q==we||q==ce||U&&!s){if(c=v||U?{}:To(t),!p)return v?hd(t,Nc(c,t)):ad(t,Su(c,t))}else{if(!dt[q])return s?t:{};c=Dd(t,q,p)}}o||(o=new ae);var k=o.get(t);if(k)return k;o.set(t,c),jo(t)?t.forEach(function(z){c.add(Qt(z,e,r,z,t,o))}):Zo(t)&&t.forEach(function(z,st){c.set(st,Qt(z,e,r,st,t,o))});var G=P?v?rs:es:v?Bt:Ot,rt=R?i:G(t);return Zt(rt||t,function(z,st){rt&&(st=z,z=t[st]),Nr(c,st,Qt(z,e,r,st,t,o))}),c}function Sc(t){var e=Ot(t);return function(r){return Pu(r,t,e)}}function Pu(t,e,r){var n=r.length;if(t==null)return!n;for(t=ct(t);n--;){var s=r[n],o=e[s],c=t[s];if(c===i&&!(s in t)||!o(c))return!1}return!0}function Ru(t,e,r){if(typeof t!="function")throw new Jt(f);return Br(function(){t.apply(i,r)},e)}function Sr(t,e,r,n){var s=-1,o=Qr,c=!0,p=t.length,v=[],P=e.length;if(!p)return v;r&&(e=mt(e,Ht(r))),n?(o=bi,c=!1):e.length>=b&&(o=Ir,c=!1,e=new Ke(e));t:for(;++ss?0:s+r),n=n===i||n>s?s:Q(n),n<0&&(n+=s),n=r>n?0:ta(n);r0&&r(p)?e>1?Lt(p,e-1,r,n,s):Me(s,p):n||(s[s.length]=p)}return s}var qi=ho(),Xu=ho(!0);function de(t,e){return t&&qi(t,e,Ot)}function Xi(t,e){return t&&Xu(t,e,Ot)}function _n(t,e){return Ce(e,function(r){return Ee(t[r])})}function $e(t,e){e=Fe(e,t);for(var r=0,n=e.length;t!=null&&re}function Fc(t,e){return t!=null&<.call(t,e)}function qc(t,e){return t!=null&&e in ct(t)}function Xc(t,e,r){return t>=Mt(e,r)&&t=120&&R.length>=120)?new Ke(c&&R):i}R=t[0];var q=-1,U=p[0];t:for(;++q-1;)p!==t&&fn.call(p,v,1),fn.call(t,v,1);return t}function Yu(t,e){for(var r=t?e.length:0,n=r-1;r--;){var s=e[r];if(r==n||s!==o){var o=s;Te(s)?fn.call(t,s,1):zi(t,s)}}return t}function Vi(t,e){return t+dn(Cu()*(e-t+1))}function Jc(t,e,r,n){for(var s=-1,o=xt(cn((e-t)/(r||1)),0),c=L(o);o--;)c[n?o:++s]=t,t+=r;return c}function $i(t,e){var r="";if(!t||e<1||e>at)return r;do e%2&&(r+=t),e=dn(e/2),e&&(t+=t);while(e);return r}function nt(t,e){return hs(Io(t,e,Ut),t+"")}function jc(t){return Nu(pr(t))}function Qc(t,e){var r=pr(t);return Mn(r,Ve(e,0,r.length))}function Fr(t,e,r,n){if(!wt(t))return t;e=Fe(e,t);for(var s=-1,o=e.length,c=o-1,p=t;p!=null&&++ss?0:s+e),r=r>s?s:r,r<0&&(r+=s),s=e>r?0:r-e>>>0,e>>>=0;for(var o=L(s);++n>>1,c=t[o];c!==null&&!Kt(c)&&(r?c<=e:c=b){var P=e?null:dd(t);if(P)return en(P);c=!1,s=Ir,v=new Ke}else v=e?[]:p;t:for(;++n=n?t:te(t,e,r)}var ro=Kl||function(t){return It.clearTimeout(t)};function no(t,e){if(e)return t.slice();var r=t.length,n=Eu?Eu(r):new t.constructor(r);return t.copy(n),n}function ji(t){var e=new t.constructor(t.byteLength);return new an(e).set(new an(t)),e}function id(t,e){var r=e?ji(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}function sd(t){var e=new t.constructor(t.source,Us.exec(t));return e.lastIndex=t.lastIndex,e}function ud(t){return Ar?ct(Ar.call(t)):{}}function io(t,e){var r=e?ji(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}function so(t,e){if(t!==e){var r=t!==i,n=t===null,s=t===t,o=Kt(t),c=e!==i,p=e===null,v=e===e,P=Kt(e);if(!p&&!P&&!o&&t>e||o&&c&&v&&!p&&!P||n&&c&&v||!r&&v||!s)return 1;if(!n&&!o&&!P&&t=p)return v;var P=r[n];return v*(P=="desc"?-1:1)}}return t.index-e.index}function uo(t,e,r,n){for(var s=-1,o=t.length,c=r.length,p=-1,v=e.length,P=xt(o-c,0),R=L(v+P),q=!n;++p1?r[s-1]:i,c=s>2?r[2]:i;for(o=t.length>3&&typeof o=="function"?(s--,o):i,c&&Rt(r[0],r[1],c)&&(o=s<3?i:o,s=1),e=ct(e);++n-1?s[o?e[c]:c]:i}}function co(t){return be(function(e){var r=e.length,n=r,s=jt.prototype.thru;for(t&&e.reverse();n--;){var o=e[n];if(typeof o!="function")throw new Jt(f);if(s&&!c&&Ln(o)=="wrapper")var c=new jt([],!0)}for(n=c?n:r;++n1&&ot.reverse(),R&&vp))return!1;var P=o.get(t),R=o.get(e);if(P&&R)return P==e&&R==t;var q=-1,U=!0,k=r&X?new Ke:i;for(o.set(t,e),o.set(e,t);++q1?"& ":"")+e[n],e=e.join(r>2?", ":" "),t.replace(Ef,`{ /* [wrapped with `+e+`] */ -`)}function Td(t){return J(t)||Ye(t)||!!(Ou&&t&&t[Ou])}function Te(t,e){var r=typeof t;return e=e??at,!!e&&(r=="number"||r!="symbol"&&Rh.test(t))&&t>-1&&t%1==0&&t0){if(++e>=I)return arguments[0]}else e=0;return t.apply(i,arguments)}}function Mn(t,e){var r=-1,n=t.length,s=n-1;for(e=e===i?n:e;++r1?t[e-1]:i;return r=typeof r=="function"?(t.pop(),r):i,Xo(t,r)});function Bo(t){var e=u(t);return e.__chain__=!0,e}function Pp(t,e){return e(t),t}function An(t,e){return e(t)}var Rp=De(function(t){var e=t.length,r=e?t[0]:0,n=this.__wrapped__,s=function(o){return Fi(o,t)};return e>1||this.__actions__.length||!(n instanceof ut)||!Te(r)?this.thru(s):(n=n.slice(r,+r+(e?1:0)),n.__actions__.push({func:An,args:[s],thisArg:i}),new Jt(n,this.__chain__).thru(function(o){return e&&!o.length&&o.push(i),o}))});function Fp(){return Bo(this)}function qp(){return new Jt(this.value(),this.__chain__)}function Xp(){this.__values__===i&&(this.__values__=Qo(this.value()));var t=this.__index__>=this.__values__.length,e=t?i:this.__values__[this.__index__++];return{done:t,value:e}}function Bp(){return this}function Up(t){for(var e,r=this;r instanceof mn;){var n=No(r);n.__index__=0,n.__values__=i,e?s.__wrapped__=n:e=n;var s=n;r=r.__wrapped__}return s.__wrapped__=t,e}function Wp(){var t=this.__wrapped__;if(t instanceof ut){var e=t;return this.__actions__.length&&(e=new ut(this)),e=e.reverse(),e.__actions__.push({func:An,args:[hs],thisArg:i}),new Jt(e,this.__chain__)}return this.thru(hs)}function kp(){return to(this.__wrapped__,this.__actions__)}var Kp=Tn(function(t,e,r){lt.call(t,r)?++t[r]:ve(t,r,1)});function Hp(t,e,r){var n=J(t)?du:Pc;return r&&Rt(t,e,r)&&(e=i),n(t,H(e,3))}function Vp(t,e){var r=J(t)?Ce:qu;return r(t,H(e,3))}var $p=lo(So),Gp=lo(Po);function zp(t,e){return Lt(Nn(t,e),1)}function Yp(t,e){return Lt(Nn(t,e),pt)}function Zp(t,e,r){return r=r===i?1:Q(r),Lt(Nn(t,e),r)}function Uo(t,e){var r=J(t)?Zt:Pe;return r(t,H(e,3))}function Wo(t,e){var r=J(t)?gl:Fu;return r(t,H(e,3))}var jp=Tn(function(t,e,r){lt.call(t,r)?t[r].push(e):ve(t,r,[e])});function Jp(t,e,r,n){t=Xt(t)?t:pr(t),r=r&&!n?Q(r):0;var s=t.length;return r<0&&(r=Et(s+r,0)),qn(t)?r<=s&&t.indexOf(e,r)>-1:!!s&&nr(t,e,r)>-1}var Qp=rt(function(t,e,r){var n=-1,s=typeof e=="function",o=Xt(t)?L(t.length):[];return Pe(t,function(c){o[++n]=s?Wt(e,c,r):Pr(c,e,r)}),o}),tg=Tn(function(t,e,r){ve(t,r,e)});function Nn(t,e){var r=J(t)?mt:Ku;return r(t,H(e,3))}function eg(t,e,r,n){return t==null?[]:(J(e)||(e=e==null?[]:[e]),r=n?i:r,J(r)||(r=r==null?[]:[r]),Gu(t,e,r))}var rg=Tn(function(t,e,r){t[r?0:1].push(e)},function(){return[[],[]]});function ng(t,e,r){var n=J(t)?Ti:wu,s=arguments.length<3;return n(t,H(e,4),r,s,Pe)}function ig(t,e,r){var n=J(t)?ml:wu,s=arguments.length<3;return n(t,H(e,4),r,s,Fu)}function sg(t,e){var r=J(t)?Ce:qu;return r(t,Rn(H(e,3)))}function ug(t){var e=J(t)?Nu:Jc;return e(t)}function og(t,e,r){(r?Rt(t,e,r):e===i)?e=1:e=Q(e);var n=J(t)?Cc:Qc;return n(t,e)}function ag(t){var e=J(t)?Mc:ed;return e(t)}function fg(t){if(t==null)return 0;if(Xt(t))return qn(t)?sr(t):t.length;var e=At(t);return e==se||e==ue?t.size:ki(t).length}function hg(t,e,r){var n=J(t)?Ei:rd;return r&&Rt(t,e,r)&&(e=i),n(t,H(e,3))}var lg=rt(function(t,e){if(t==null)return[];var r=e.length;return r>1&&Rt(t,e[0],e[1])?e=[]:r>2&&Rt(e[0],e[1],e[2])&&(e=[e[0]]),Gu(t,Lt(e,1),[])}),Sn=Vl||function(){return It.Date.now()};function cg(t,e){if(typeof e!="function")throw new jt(h);return t=Q(t),function(){if(--t<1)return e.apply(this,arguments)}}function ko(t,e,r){return e=r?i:e,e=t&&e==null?t.length:e,be(t,O,i,i,i,i,e)}function Ko(t,e){var r;if(typeof e!="function")throw new jt(h);return t=Q(t),function(){return--t>0&&(r=e.apply(this,arguments)),t<=1&&(e=i),r}}var cs=rt(function(t,e,r){var n=B;if(r.length){var s=Ae(r,cr(cs));n|=p}return be(t,n,e,r,s)}),Ho=rt(function(t,e,r){var n=B|G;if(r.length){var s=Ae(r,cr(Ho));n|=p}return be(e,n,t,r,s)});function Vo(t,e,r){e=r?i:e;var n=be(t,Z,i,i,i,i,i,e);return n.placeholder=Vo.placeholder,n}function $o(t,e,r){e=r?i:e;var n=be(t,xt,i,i,i,i,i,e);return n.placeholder=$o.placeholder,n}function Go(t,e,r){var n,s,o,c,g,_,P=0,R=!1,q=!1,U=!0;if(typeof t!="function")throw new jt(h);e=re(e)||0,wt(r)&&(R=!!r.leading,q="maxWait"in r,o=q?Et(re(r.maxWait)||0,e):o,U="trailing"in r?!!r.trailing:U);function K(bt){var he=n,Ie=s;return n=s=i,P=bt,c=t.apply(Ie,he),c}function V(bt){return P=bt,g=Br(st,e),R?K(bt):c}function et(bt){var he=bt-_,Ie=bt-P,ca=e-he;return q?Mt(ca,o-Ie):ca}function $(bt){var he=bt-_,Ie=bt-P;return _===i||he>=e||he<0||q&&Ie>=o}function st(){var bt=Sn();if($(bt))return ot(bt);g=Br(st,et(bt))}function ot(bt){return g=i,U&&n?K(bt):(n=s=i,c)}function Vt(){g!==i&&ro(g),P=0,n=_=s=g=i}function Ft(){return g===i?c:ot(Sn())}function $t(){var bt=Sn(),he=$(bt);if(n=arguments,s=this,_=bt,he){if(g===i)return V(_);if(q)return ro(g),g=Br(st,e),K(_)}return g===i&&(g=Br(st,e)),c}return $t.cancel=Vt,$t.flush=Ft,$t}var dg=rt(function(t,e){return Ru(t,1,e)}),pg=rt(function(t,e,r){return Ru(t,re(e)||0,r)});function gg(t){return be(t,x)}function Pn(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new jt(h);var r=function(){var n=arguments,s=e?e.apply(this,n):n[0],o=r.cache;if(o.has(s))return o.get(s);var c=t.apply(this,n);return r.cache=o.set(s,c)||o,c};return r.cache=new(Pn.Cache||_e),r}Pn.Cache=_e;function Rn(t){if(typeof t!="function")throw new jt(h);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}function mg(t){return Ko(2,t)}var wg=nd(function(t,e){e=e.length==1&&J(e[0])?mt(e[0],kt(H())):mt(Lt(e,1),kt(H()));var r=e.length;return rt(function(n){for(var s=-1,o=Mt(n.length,r);++s=e}),Ye=Uu(function(){return arguments}())?Uu:function(t){return yt(t)&<.call(t,"callee")&&!Iu.call(t,"callee")},J=L.isArray,Ng=ou?kt(ou):Uc;function Xt(t){return t!=null&&Fn(t.length)&&!Ee(t)}function vt(t){return yt(t)&&Xt(t)}function Sg(t){return t===!0||t===!1||yt(t)&&Pt(t)==_r}var Xe=Gl||Es,Pg=au?kt(au):Wc;function Rg(t){return yt(t)&&t.nodeType===1&&!Ur(t)}function Fg(t){if(t==null)return!0;if(Xt(t)&&(J(t)||typeof t=="string"||typeof t.splice=="function"||Xe(t)||dr(t)||Ye(t)))return!t.length;var e=At(t);if(e==se||e==ue)return!t.size;if(Xr(t))return!ki(t).length;for(var r in t)if(lt.call(t,r))return!1;return!0}function qg(t,e){return Rr(t,e)}function Xg(t,e,r){r=typeof r=="function"?r:i;var n=r?r(t,e):i;return n===i?Rr(t,e,i,r):!!n}function ps(t){if(!yt(t))return!1;var e=Pt(t);return e==Gr||e==oh||typeof t.message=="string"&&typeof t.name=="string"&&!Ur(t)}function Bg(t){return typeof t=="number"&&Lu(t)}function Ee(t){if(!wt(t))return!1;var e=Pt(t);return e==zr||e==Rs||e==tr||e==fh}function Yo(t){return typeof t=="number"&&t==Q(t)}function Fn(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=at}function wt(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function yt(t){return t!=null&&typeof t=="object"}var Zo=fu?kt(fu):Kc;function Ug(t,e){return t===e||Wi(t,e,is(e))}function Wg(t,e,r){return r=typeof r=="function"?r:i,Wi(t,e,is(e),r)}function kg(t){return jo(t)&&t!=+t}function Kg(t){if(Id(t))throw new Y(v);return Wu(t)}function Hg(t){return t===null}function Vg(t){return t==null}function jo(t){return typeof t=="number"||yt(t)&&Pt(t)==br}function Ur(t){if(!yt(t)||Pt(t)!=we)return!1;var e=fn(t);if(e===null)return!0;var r=lt.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&sn.call(r)==Wl}var gs=hu?kt(hu):Hc;function $g(t){return Yo(t)&&t>=-at&&t<=at}var Jo=lu?kt(lu):Vc;function qn(t){return typeof t=="string"||!J(t)&&yt(t)&&Pt(t)==Tr}function Ht(t){return typeof t=="symbol"||yt(t)&&Pt(t)==Yr}var dr=cu?kt(cu):$c;function Gg(t){return t===i}function zg(t){return yt(t)&&At(t)==Er}function Yg(t){return yt(t)&&Pt(t)==lh}var Zg=On(Ki),jg=On(function(t,e){return t<=e});function Qo(t){if(!t)return[];if(Xt(t))return qn(t)?oe(t):qt(t);if(Or&&t[Or])return Cl(t[Or]());var e=At(t),r=e==se?Mi:e==ue?en:pr;return r(t)}function xe(t){if(!t)return t===0?t:0;if(t=re(t),t===pt||t===-pt){var e=t<0?-1:1;return e*it}return t===t?t:0}function Q(t){var e=xe(t),r=e%1;return e===e?r?e-r:e:0}function ta(t){return t?Ve(Q(t),0,St):0}function re(t){if(typeof t=="number")return t;if(Ht(t))return _t;if(wt(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=wt(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=yu(t);var r=Nh.test(t);return r||Ph.test(t)?cl(t.slice(2),r?2:8):Ah.test(t)?_t:+t}function ea(t){return pe(t,Bt(t))}function Jg(t){return t?Ve(Q(t),-at,at):t===0?t:0}function ht(t){return t==null?"":Kt(t)}var Qg=hr(function(t,e){if(Xr(e)||Xt(e)){pe(e,Ot(e),t);return}for(var r in e)lt.call(e,r)&&Nr(t,r,e[r])}),ra=hr(function(t,e){pe(e,Bt(e),t)}),Xn=hr(function(t,e,r,n){pe(e,Bt(e),t,n)}),tm=hr(function(t,e,r,n){pe(e,Ot(e),t,n)}),em=De(Fi);function rm(t,e){var r=fr(t);return e==null?r:Su(r,e)}var nm=rt(function(t,e){t=ct(t);var r=-1,n=e.length,s=n>2?e[2]:i;for(s&&Rt(e[0],e[1],s)&&(n=1);++r1),o}),pe(t,rs(t),r),n&&(r=Qt(r,F|M|m,pd));for(var s=e.length;s--;)zi(r,e[s]);return r});function bm(t,e){return ia(t,Rn(H(e)))}var Dm=De(function(t,e){return t==null?{}:Yc(t,e)});function ia(t,e){if(t==null)return{};var r=mt(rs(t),function(n){return[n]});return e=H(e),zu(t,r,function(n,s){return e(n,s[0])})}function Tm(t,e,r){e=Fe(e,t);var n=-1,s=e.length;for(s||(s=1,t=i);++ne){var n=t;t=e,e=n}if(r||t%1||e%1){var s=Cu();return Mt(t+s*(e-t+ll("1e-"+((s+"").length-1))),e)}return Vi(t,e)}var Pm=lr(function(t,e,r){return e=e.toLowerCase(),t+(r?oa(e):e)});function oa(t){return ys(ht(t).toLowerCase())}function aa(t){return t=ht(t),t&&t.replace(Fh,El).replace(el,"")}function Rm(t,e,r){t=ht(t),e=Kt(e);var n=t.length;r=r===i?n:Ve(Q(r),0,n);var s=r;return r-=e.length,r>=0&&t.slice(r,s)==e}function Fm(t){return t=ht(t),t&&mh.test(t)?t.replace(Xs,xl):t}function qm(t){return t=ht(t),t&&Dh.test(t)?t.replace(di,"\\$&"):t}var Xm=lr(function(t,e,r){return t+(r?"-":"")+e.toLowerCase()}),Bm=lr(function(t,e,r){return t+(r?" ":"")+e.toLowerCase()}),Um=ho("toLowerCase");function Wm(t,e,r){t=ht(t),e=Q(e);var n=e?sr(t):0;if(!e||n>=e)return t;var s=(e-n)/2;return In(dn(s),r)+t+In(cn(s),r)}function km(t,e,r){t=ht(t),e=Q(e);var n=e?sr(t):0;return e&&n>>0,r?(t=ht(t),t&&(typeof e=="string"||e!=null&&!gs(e))&&(e=Kt(e),!e&&ir(t))?qe(oe(t),0,r):t.split(e,r)):[]}var Ym=lr(function(t,e,r){return t+(r?" ":"")+ys(e)});function Zm(t,e,r){return t=ht(t),r=r==null?0:Ve(Q(r),0,t.length),e=Kt(e),t.slice(r,r+e.length)==e}function jm(t,e,r){var n=u.templateSettings;r&&Rt(t,e,r)&&(e=i),t=ht(t),e=Xn({},e,n,yo);var s=Xn({},e.imports,n.imports,yo),o=Ot(s),c=Ci(s,o),g,_,P=0,R=e.interpolate||Zr,q="__p += '",U=Ai((e.escape||Zr).source+"|"+R.source+"|"+(R===Bs?Mh:Zr).source+"|"+(e.evaluate||Zr).source+"|$","g"),K="//# sourceURL="+(lt.call(e,"sourceURL")?(e.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++ul+"]")+` -`;t.replace(U,function($,st,ot,Vt,Ft,$t){return ot||(ot=Vt),q+=t.slice(P,$t).replace(qh,Il),st&&(g=!0,q+=`' + +`)}function Td(t){return j(t)||Ye(t)||!!(Ou&&t&&t[Ou])}function Te(t,e){var r=typeof t;return e=e??at,!!e&&(r=="number"||r!="symbol"&&Rf.test(t))&&t>-1&&t%1==0&&t0){if(++e>=I)return arguments[0]}else e=0;return t.apply(i,arguments)}}function Mn(t,e){var r=-1,n=t.length,s=n-1;for(e=e===i?n:e;++r1?t[e-1]:i;return r=typeof r=="function"?(t.pop(),r):i,Xo(t,r)});function Bo(t){var e=u(t);return e.__chain__=!0,e}function Pp(t,e){return e(t),t}function An(t,e){return e(t)}var Rp=be(function(t){var e=t.length,r=e?t[0]:0,n=this.__wrapped__,s=function(o){return Fi(o,t)};return e>1||this.__actions__.length||!(n instanceof ut)||!Te(r)?this.thru(s):(n=n.slice(r,+r+(e?1:0)),n.__actions__.push({func:An,args:[s],thisArg:i}),new jt(n,this.__chain__).thru(function(o){return e&&!o.length&&o.push(i),o}))});function Fp(){return Bo(this)}function qp(){return new jt(this.value(),this.__chain__)}function Xp(){this.__values__===i&&(this.__values__=Qo(this.value()));var t=this.__index__>=this.__values__.length,e=t?i:this.__values__[this.__index__++];return{done:t,value:e}}function Bp(){return this}function Up(t){for(var e,r=this;r instanceof mn;){var n=No(r);n.__index__=0,n.__values__=i,e?s.__wrapped__=n:e=n;var s=n;r=r.__wrapped__}return s.__wrapped__=t,e}function Wp(){var t=this.__wrapped__;if(t instanceof ut){var e=t;return this.__actions__.length&&(e=new ut(this)),e=e.reverse(),e.__actions__.push({func:An,args:[fs],thisArg:i}),new jt(e,this.__chain__)}return this.thru(fs)}function Hp(){return to(this.__wrapped__,this.__actions__)}var kp=Tn(function(t,e,r){lt.call(t,r)?++t[r]:ve(t,r,1)});function Kp(t,e,r){var n=j(t)?du:Pc;return r&&Rt(t,e,r)&&(e=i),n(t,$(e,3))}function Vp(t,e){var r=j(t)?Ce:qu;return r(t,$(e,3))}var $p=lo(So),Gp=lo(Po);function zp(t,e){return Lt(Nn(t,e),1)}function Yp(t,e){return Lt(Nn(t,e),pt)}function Zp(t,e,r){return r=r===i?1:Q(r),Lt(Nn(t,e),r)}function Uo(t,e){var r=j(t)?Zt:Pe;return r(t,$(e,3))}function Wo(t,e){var r=j(t)?gl:Fu;return r(t,$(e,3))}var Jp=Tn(function(t,e,r){lt.call(t,r)?t[r].push(e):ve(t,r,[e])});function jp(t,e,r,n){t=Xt(t)?t:pr(t),r=r&&!n?Q(r):0;var s=t.length;return r<0&&(r=xt(s+r,0)),qn(t)?r<=s&&t.indexOf(e,r)>-1:!!s&&nr(t,e,r)>-1}var Qp=nt(function(t,e,r){var n=-1,s=typeof e=="function",o=Xt(t)?L(t.length):[];return Pe(t,function(c){o[++n]=s?Wt(e,c,r):Pr(c,e,r)}),o}),tg=Tn(function(t,e,r){ve(t,r,e)});function Nn(t,e){var r=j(t)?mt:ku;return r(t,$(e,3))}function eg(t,e,r,n){return t==null?[]:(j(e)||(e=e==null?[]:[e]),r=n?i:r,j(r)||(r=r==null?[]:[r]),Gu(t,e,r))}var rg=Tn(function(t,e,r){t[r?0:1].push(e)},function(){return[[],[]]});function ng(t,e,r){var n=j(t)?Ti:wu,s=arguments.length<3;return n(t,$(e,4),r,s,Pe)}function ig(t,e,r){var n=j(t)?ml:wu,s=arguments.length<3;return n(t,$(e,4),r,s,Fu)}function sg(t,e){var r=j(t)?Ce:qu;return r(t,Rn($(e,3)))}function ug(t){var e=j(t)?Nu:jc;return e(t)}function og(t,e,r){(r?Rt(t,e,r):e===i)?e=1:e=Q(e);var n=j(t)?Cc:Qc;return n(t,e)}function ag(t){var e=j(t)?Mc:ed;return e(t)}function hg(t){if(t==null)return 0;if(Xt(t))return qn(t)?sr(t):t.length;var e=At(t);return e==se||e==ue?t.size:Hi(t).length}function fg(t,e,r){var n=j(t)?Ei:rd;return r&&Rt(t,e,r)&&(e=i),n(t,$(e,3))}var lg=nt(function(t,e){if(t==null)return[];var r=e.length;return r>1&&Rt(t,e[0],e[1])?e=[]:r>2&&Rt(e[0],e[1],e[2])&&(e=[e[0]]),Gu(t,Lt(e,1),[])}),Sn=Vl||function(){return It.Date.now()};function cg(t,e){if(typeof e!="function")throw new Jt(f);return t=Q(t),function(){if(--t<1)return e.apply(this,arguments)}}function Ho(t,e,r){return e=r?i:e,e=t&&e==null?t.length:e,De(t,O,i,i,i,i,e)}function ko(t,e){var r;if(typeof e!="function")throw new Jt(f);return t=Q(t),function(){return--t>0&&(r=e.apply(this,arguments)),t<=1&&(e=i),r}}var cs=nt(function(t,e,r){var n=B;if(r.length){var s=Ae(r,cr(cs));n|=g}return De(t,n,e,r,s)}),Ko=nt(function(t,e,r){var n=B|K;if(r.length){var s=Ae(r,cr(Ko));n|=g}return De(e,n,t,r,s)});function Vo(t,e,r){e=r?i:e;var n=De(t,V,i,i,i,i,i,e);return n.placeholder=Vo.placeholder,n}function $o(t,e,r){e=r?i:e;var n=De(t,_t,i,i,i,i,i,e);return n.placeholder=$o.placeholder,n}function Go(t,e,r){var n,s,o,c,p,v,P=0,R=!1,q=!1,U=!0;if(typeof t!="function")throw new Jt(f);e=re(e)||0,wt(r)&&(R=!!r.leading,q="maxWait"in r,o=q?xt(re(r.maxWait)||0,e):o,U="trailing"in r?!!r.trailing:U);function k(bt){var fe=n,Ie=s;return n=s=i,P=bt,c=t.apply(Ie,fe),c}function G(bt){return P=bt,p=Br(st,e),R?k(bt):c}function rt(bt){var fe=bt-v,Ie=bt-P,ca=e-fe;return q?Mt(ca,o-Ie):ca}function z(bt){var fe=bt-v,Ie=bt-P;return v===i||fe>=e||fe<0||q&&Ie>=o}function st(){var bt=Sn();if(z(bt))return ot(bt);p=Br(st,rt(bt))}function ot(bt){return p=i,U&&n?k(bt):(n=s=i,c)}function Vt(){p!==i&&ro(p),P=0,n=v=s=p=i}function Ft(){return p===i?c:ot(Sn())}function $t(){var bt=Sn(),fe=z(bt);if(n=arguments,s=this,v=bt,fe){if(p===i)return G(v);if(q)return ro(p),p=Br(st,e),k(v)}return p===i&&(p=Br(st,e)),c}return $t.cancel=Vt,$t.flush=Ft,$t}var dg=nt(function(t,e){return Ru(t,1,e)}),pg=nt(function(t,e,r){return Ru(t,re(e)||0,r)});function gg(t){return De(t,x)}function Pn(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new Jt(f);var r=function(){var n=arguments,s=e?e.apply(this,n):n[0],o=r.cache;if(o.has(s))return o.get(s);var c=t.apply(this,n);return r.cache=o.set(s,c)||o,c};return r.cache=new(Pn.Cache||_e),r}Pn.Cache=_e;function Rn(t){if(typeof t!="function")throw new Jt(f);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}function mg(t){return ko(2,t)}var wg=nd(function(t,e){e=e.length==1&&j(e[0])?mt(e[0],Ht($())):mt(Lt(e,1),Ht($()));var r=e.length;return nt(function(n){for(var s=-1,o=Mt(n.length,r);++s=e}),Ye=Uu(function(){return arguments}())?Uu:function(t){return yt(t)&<.call(t,"callee")&&!Iu.call(t,"callee")},j=L.isArray,Ng=ou?Ht(ou):Uc;function Xt(t){return t!=null&&Fn(t.length)&&!Ee(t)}function Dt(t){return yt(t)&&Xt(t)}function Sg(t){return t===!0||t===!1||yt(t)&&Pt(t)==_r}var Xe=Gl||Es,Pg=au?Ht(au):Wc;function Rg(t){return yt(t)&&t.nodeType===1&&!Ur(t)}function Fg(t){if(t==null)return!0;if(Xt(t)&&(j(t)||typeof t=="string"||typeof t.splice=="function"||Xe(t)||dr(t)||Ye(t)))return!t.length;var e=At(t);if(e==se||e==ue)return!t.size;if(Xr(t))return!Hi(t).length;for(var r in t)if(lt.call(t,r))return!1;return!0}function qg(t,e){return Rr(t,e)}function Xg(t,e,r){r=typeof r=="function"?r:i;var n=r?r(t,e):i;return n===i?Rr(t,e,i,r):!!n}function ps(t){if(!yt(t))return!1;var e=Pt(t);return e==Gr||e==of||typeof t.message=="string"&&typeof t.name=="string"&&!Ur(t)}function Bg(t){return typeof t=="number"&&Lu(t)}function Ee(t){if(!wt(t))return!1;var e=Pt(t);return e==zr||e==Rs||e==tr||e==hf}function Yo(t){return typeof t=="number"&&t==Q(t)}function Fn(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=at}function wt(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function yt(t){return t!=null&&typeof t=="object"}var Zo=hu?Ht(hu):kc;function Ug(t,e){return t===e||Wi(t,e,is(e))}function Wg(t,e,r){return r=typeof r=="function"?r:i,Wi(t,e,is(e),r)}function Hg(t){return Jo(t)&&t!=+t}function kg(t){if(Id(t))throw new Z(_);return Wu(t)}function Kg(t){return t===null}function Vg(t){return t==null}function Jo(t){return typeof t=="number"||yt(t)&&Pt(t)==Dr}function Ur(t){if(!yt(t)||Pt(t)!=we)return!1;var e=hn(t);if(e===null)return!0;var r=lt.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&sn.call(r)==Wl}var gs=fu?Ht(fu):Kc;function $g(t){return Yo(t)&&t>=-at&&t<=at}var jo=lu?Ht(lu):Vc;function qn(t){return typeof t=="string"||!j(t)&&yt(t)&&Pt(t)==Tr}function Kt(t){return typeof t=="symbol"||yt(t)&&Pt(t)==Yr}var dr=cu?Ht(cu):$c;function Gg(t){return t===i}function zg(t){return yt(t)&&At(t)==Er}function Yg(t){return yt(t)&&Pt(t)==lf}var Zg=On(ki),Jg=On(function(t,e){return t<=e});function Qo(t){if(!t)return[];if(Xt(t))return qn(t)?oe(t):qt(t);if(Or&&t[Or])return Cl(t[Or]());var e=At(t),r=e==se?Mi:e==ue?en:pr;return r(t)}function xe(t){if(!t)return t===0?t:0;if(t=re(t),t===pt||t===-pt){var e=t<0?-1:1;return e*it}return t===t?t:0}function Q(t){var e=xe(t),r=e%1;return e===e?r?e-r:e:0}function ta(t){return t?Ve(Q(t),0,St):0}function re(t){if(typeof t=="number")return t;if(Kt(t))return vt;if(wt(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=wt(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=yu(t);var r=Nf.test(t);return r||Pf.test(t)?cl(t.slice(2),r?2:8):Af.test(t)?vt:+t}function ea(t){return pe(t,Bt(t))}function jg(t){return t?Ve(Q(t),-at,at):t===0?t:0}function ft(t){return t==null?"":kt(t)}var Qg=fr(function(t,e){if(Xr(e)||Xt(e)){pe(e,Ot(e),t);return}for(var r in e)lt.call(e,r)&&Nr(t,r,e[r])}),ra=fr(function(t,e){pe(e,Bt(e),t)}),Xn=fr(function(t,e,r,n){pe(e,Bt(e),t,n)}),tm=fr(function(t,e,r,n){pe(e,Ot(e),t,n)}),em=be(Fi);function rm(t,e){var r=hr(t);return e==null?r:Su(r,e)}var nm=nt(function(t,e){t=ct(t);var r=-1,n=e.length,s=n>2?e[2]:i;for(s&&Rt(e[0],e[1],s)&&(n=1);++r1),o}),pe(t,rs(t),r),n&&(r=Qt(r,F|M|m,pd));for(var s=e.length;s--;)zi(r,e[s]);return r});function Dm(t,e){return ia(t,Rn($(e)))}var bm=be(function(t,e){return t==null?{}:Yc(t,e)});function ia(t,e){if(t==null)return{};var r=mt(rs(t),function(n){return[n]});return e=$(e),zu(t,r,function(n,s){return e(n,s[0])})}function Tm(t,e,r){e=Fe(e,t);var n=-1,s=e.length;for(s||(s=1,t=i);++ne){var n=t;t=e,e=n}if(r||t%1||e%1){var s=Cu();return Mt(t+s*(e-t+ll("1e-"+((s+"").length-1))),e)}return Vi(t,e)}var Pm=lr(function(t,e,r){return e=e.toLowerCase(),t+(r?oa(e):e)});function oa(t){return ys(ft(t).toLowerCase())}function aa(t){return t=ft(t),t&&t.replace(Ff,El).replace(el,"")}function Rm(t,e,r){t=ft(t),e=kt(e);var n=t.length;r=r===i?n:Ve(Q(r),0,n);var s=r;return r-=e.length,r>=0&&t.slice(r,s)==e}function Fm(t){return t=ft(t),t&&mf.test(t)?t.replace(Xs,xl):t}function qm(t){return t=ft(t),t&&bf.test(t)?t.replace(di,"\\$&"):t}var Xm=lr(function(t,e,r){return t+(r?"-":"")+e.toLowerCase()}),Bm=lr(function(t,e,r){return t+(r?" ":"")+e.toLowerCase()}),Um=fo("toLowerCase");function Wm(t,e,r){t=ft(t),e=Q(e);var n=e?sr(t):0;if(!e||n>=e)return t;var s=(e-n)/2;return In(dn(s),r)+t+In(cn(s),r)}function Hm(t,e,r){t=ft(t),e=Q(e);var n=e?sr(t):0;return e&&n>>0,r?(t=ft(t),t&&(typeof e=="string"||e!=null&&!gs(e))&&(e=kt(e),!e&&ir(t))?qe(oe(t),0,r):t.split(e,r)):[]}var Ym=lr(function(t,e,r){return t+(r?" ":"")+ys(e)});function Zm(t,e,r){return t=ft(t),r=r==null?0:Ve(Q(r),0,t.length),e=kt(e),t.slice(r,r+e.length)==e}function Jm(t,e,r){var n=u.templateSettings;r&&Rt(t,e,r)&&(e=i),t=ft(t),e=Xn({},e,n,yo);var s=Xn({},e.imports,n.imports,yo),o=Ot(s),c=Ci(s,o),p,v,P=0,R=e.interpolate||Zr,q="__p += '",U=Ai((e.escape||Zr).source+"|"+R.source+"|"+(R===Bs?Mf:Zr).source+"|"+(e.evaluate||Zr).source+"|$","g"),k="//# sourceURL="+(lt.call(e,"sourceURL")?(e.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++ul+"]")+` +`;t.replace(U,function(z,st,ot,Vt,Ft,$t){return ot||(ot=Vt),q+=t.slice(P,$t).replace(qf,Il),st&&(p=!0,q+=`' + __e(`+st+`) + -'`),Ft&&(_=!0,q+=`'; +'`),Ft&&(v=!0,q+=`'; `+Ft+`; __p += '`),ot&&(q+=`' + ((__t = (`+ot+`)) == null ? '' : __t) + -'`),P=$t+$.length,$}),q+=`'; -`;var V=lt.call(e,"variable")&&e.variable;if(!V)q=`with (obj) { +'`),P=$t+z.length,z}),q+=`'; +`;var G=lt.call(e,"variable")&&e.variable;if(!G)q=`with (obj) { `+q+` } -`;else if(Lh.test(V))throw new Y(b);q=(_?q.replace(ch,""):q).replace(dh,"$1").replace(ph,"$1;"),q="function("+(V||"obj")+`) { -`+(V?"":`obj || (obj = {}); -`)+"var __t, __p = ''"+(g?", __e = _.escape":"")+(_?`, __j = Array.prototype.join; +`;else if(Lf.test(G))throw new Z(D);q=(v?q.replace(cf,""):q).replace(df,"$1").replace(pf,"$1;"),q="function("+(G||"obj")+`) { +`+(G?"":`obj || (obj = {}); +`)+"var __t, __p = ''"+(p?", __e = _.escape":"")+(v?`, __j = Array.prototype.join; function print() { __p += __j.call(arguments, '') } `:`; `)+q+`return __p -}`;var et=ha(function(){return ft(o,K+"return "+q).apply(i,c)});if(et.source=q,ps(et))throw et;return et}function Jm(t){return ht(t).toLowerCase()}function Qm(t){return ht(t).toUpperCase()}function tw(t,e,r){if(t=ht(t),t&&(r||e===i))return yu(t);if(!t||!(e=Kt(e)))return t;var n=oe(t),s=oe(e),o=_u(n,s),c=vu(n,s)+1;return qe(n,o,c).join("")}function ew(t,e,r){if(t=ht(t),t&&(r||e===i))return t.slice(0,Du(t)+1);if(!t||!(e=Kt(e)))return t;var n=oe(t),s=vu(n,oe(e))+1;return qe(n,0,s).join("")}function rw(t,e,r){if(t=ht(t),t&&(r||e===i))return t.replace(pi,"");if(!t||!(e=Kt(e)))return t;var n=oe(t),s=_u(n,oe(e));return qe(n,s).join("")}function nw(t,e){var r=C,n=l;if(wt(e)){var s="separator"in e?e.separator:s;r="length"in e?Q(e.length):r,n="omission"in e?Kt(e.omission):n}t=ht(t);var o=t.length;if(ir(t)){var c=oe(t);o=c.length}if(r>=o)return t;var g=r-sr(n);if(g<1)return n;var _=c?qe(c,0,g).join(""):t.slice(0,g);if(s===i)return _+n;if(c&&(g+=_.length-g),gs(s)){if(t.slice(g).search(s)){var P,R=_;for(s.global||(s=Ai(s.source,ht(Us.exec(s))+"g")),s.lastIndex=0;P=s.exec(R);)var q=P.index;_=_.slice(0,q===i?g:q)}}else if(t.indexOf(Kt(s),g)!=g){var U=_.lastIndexOf(s);U>-1&&(_=_.slice(0,U))}return _+n}function iw(t){return t=ht(t),t&&gh.test(t)?t.replace(qs,Sl):t}var sw=lr(function(t,e,r){return t+(r?" ":"")+e.toUpperCase()}),ys=ho("toUpperCase");function fa(t,e,r){return t=ht(t),e=r?i:e,e===i?Ll(t)?Fl(t):_l(t):t.match(e)||[]}var ha=rt(function(t,e){try{return Wt(t,i,e)}catch(r){return ps(r)?r:new Y(r)}}),uw=De(function(t,e){return Zt(e,function(r){r=ge(r),ve(t,r,cs(t[r],t))}),t});function ow(t){var e=t==null?0:t.length,r=H();return t=e?mt(t,function(n){if(typeof n[1]!="function")throw new jt(h);return[r(n[0]),n[1]]}):[],rt(function(n){for(var s=-1;++sat)return[];var r=St,n=Mt(t,St);e=H(e),t-=St;for(var s=Li(n,e);++r0||e<0)?new ut(r):(t<0?r=r.takeRight(-t):t&&(r=r.drop(t)),e!==i&&(e=Q(e),r=e<0?r.dropRight(-e):r.take(e-t)),r)},ut.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},ut.prototype.toArray=function(){return this.take(St)},de(ut.prototype,function(t,e){var r=/^(?:filter|find|map|reject)|While$/.test(e),n=/^(?:head|last)$/.test(e),s=u[n?"take"+(e=="last"?"Right":""):e],o=n||/^find/.test(e);!s||(u.prototype[e]=function(){var c=this.__wrapped__,g=n?[1]:arguments,_=c instanceof ut,P=g[0],R=_||J(c),q=function(st){var ot=s.apply(u,Me([st],g));return n&&U?ot[0]:ot};R&&r&&typeof P=="function"&&P.length!=1&&(_=R=!1);var U=this.__chain__,K=!!this.__actions__.length,V=o&&!U,et=_&&!K;if(!o&&R){c=et?c:new ut(this);var $=t.apply(c,g);return $.__actions__.push({func:An,args:[q],thisArg:i}),new Jt($,U)}return V&&et?t.apply(this,g):($=this.thru(q),V?n?$.value()[0]:$.value():$)})}),Zt(["pop","push","shift","sort","splice","unshift"],function(t){var e=rn[t],r=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",n=/^(?:pop|shift)$/.test(t);u.prototype[t]=function(){var s=arguments;if(n&&!this.__chain__){var o=this.value();return e.apply(J(o)?o:[],s)}return this[r](function(c){return e.apply(J(c)?c:[],s)})}}),de(ut.prototype,function(t,e){var r=u[e];if(r){var n=r.name+"";lt.call(ar,n)||(ar[n]=[]),ar[n].push({name:e,func:r})}}),ar[En(i,G).name]=[{name:"wrapper",func:i}],ut.prototype.clone=ic,ut.prototype.reverse=sc,ut.prototype.value=uc,u.prototype.at=Rp,u.prototype.chain=Fp,u.prototype.commit=qp,u.prototype.next=Xp,u.prototype.plant=Up,u.prototype.reverse=Wp,u.prototype.toJSON=u.prototype.valueOf=u.prototype.value=kp,u.prototype.first=u.prototype.head,Or&&(u.prototype[Or]=Bp),u},Ne=ql();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(It._=Ne,define(function(){return Ne})):We?((We.exports=Ne)._=Ne,vi._=Ne):It._=Ne}).call(gr)});var me=tt((wa,Be)=>{(function(){var i,f,D,v,h,b,w,E={}.hasOwnProperty;i=function(T,...F){var M,m,A,X;if(h(Object.assign))Object.assign.apply(null,arguments);else for(M=0,A=F.length;M{(function(){var i;_a.exports=i=class{hasFeature(D,v){return!0}createDocumentType(D,v,h){throw new Error("This DOM method is not implemented.")}createDocument(D,v,h){throw new Error("This DOM method is not implemented.")}createHTMLDocument(D){throw new Error("This DOM method is not implemented.")}getFeature(D,v){throw new Error("This DOM method is not implemented.")}}}).call(ya)});var Da=tt((va,ba)=>{(function(){var i;ba.exports=i=class{constructor(){}handleError(D){throw new Error(D)}}}).call(va)});var xa=tt((Ta,Ea)=>{(function(){var i;Ea.exports=i=function(){class f{constructor(v){this.arr=v||[]}item(v){return this.arr[v]||null}contains(v){return this.arr.indexOf(v)!==-1}}return Object.defineProperty(f.prototype,"length",{get:function(){return this.arr.length}}),f}.call(this)}).call(Ta)});var La=tt((Ia,Oa)=>{(function(){var i,f,D;f=Da(),D=xa(),Oa.exports=i=function(){class v{constructor(){var b;this.defaultParams={"canonical-form":!1,"cdata-sections":!1,comments:!1,"datatype-normalization":!1,"element-content-whitespace":!0,entities:!0,"error-handler":new f,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=b=Object.create(this.defaultParams)}getParameter(b){return this.params.hasOwnProperty(b)?this.params[b]:null}canSetParameter(b,w){return!0}setParameter(b,w){return w!=null?this.params[b]=w:delete this.params[b]}}return Object.defineProperty(v.prototype,"parameterNames",{get:function(){return new D(Object.keys(this.defaultParams))}}),v}.call(this)}).call(Ia)});var Dt=tt((Ca,Ma)=>{(function(){Ma.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(Ca)});var Os=tt((Aa,Na)=>{(function(){var i,f,D;i=Dt(),D=zt(),Na.exports=f=function(){class v{constructor(b,w,E){if(this.parent=b,this.parent&&(this.options=this.parent.options,this.stringify=this.parent.stringify),w==null)throw new Error("Missing attribute name. "+this.debugInfo(w));this.name=this.stringify.name(w),this.value=this.stringify.attValue(E),this.type=i.Attribute,this.isId=!1,this.schemaTypeInfo=null}clone(){return Object.create(this)}toString(b){return this.options.writer.attribute(this,this.options.writer.filterOptions(b))}debugInfo(b){return b=b||this.name,b==null?"parent: <"+this.parent.name+">":"attribute: {"+b+"}, parent: <"+this.parent.name+">"}isEqualNode(b){return!(b.namespaceURI!==this.namespaceURI||b.prefix!==this.prefix||b.localName!==this.localName||b.value!==this.value)}}return Object.defineProperty(v.prototype,"nodeType",{get:function(){return this.type}}),Object.defineProperty(v.prototype,"ownerElement",{get:function(){return this.parent}}),Object.defineProperty(v.prototype,"textContent",{get:function(){return this.value},set:function(h){return this.value=h||""}}),Object.defineProperty(v.prototype,"namespaceURI",{get:function(){return""}}),Object.defineProperty(v.prototype,"prefix",{get:function(){return""}}),Object.defineProperty(v.prototype,"localName",{get:function(){return this.name}}),Object.defineProperty(v.prototype,"specified",{get:function(){return!0}}),v}.call(this)}).call(Aa)});var Wn=tt((Sa,Pa)=>{(function(){var i;Pa.exports=i=function(){class f{constructor(v){this.nodes=v}clone(){return this.nodes=null}getNamedItem(v){return this.nodes[v]}setNamedItem(v){var h;return h=this.nodes[v.nodeName],this.nodes[v.nodeName]=v,h||null}removeNamedItem(v){var h;return h=this.nodes[v],delete this.nodes[v],h||null}item(v){return this.nodes[Object.keys(this.nodes)[v]]||null}getNamedItemNS(v,h){throw new Error("This DOM method is not implemented.")}setNamedItemNS(v){throw new Error("This DOM method is not implemented.")}removeNamedItemNS(v,h){throw new Error("This DOM method is not implemented.")}}return Object.defineProperty(f.prototype,"length",{get:function(){return Object.keys(this.nodes).length||0}}),f}.call(this)}).call(Sa)});var kn=tt((Ra,Fa)=>{(function(){var i,f,D,v,h,b,w,E,T={}.hasOwnProperty;({isObject:E,isFunction:w,getValue:b}=me()),h=zt(),i=Dt(),f=Os(),v=Wn(),Fa.exports=D=function(){class F extends h{constructor(m,A,X){var B,G,nt,Z;if(super(m),A==null)throw new Error("Missing element name. "+this.debugInfo());if(this.name=this.stringify.name(A),this.type=i.Element,this.attribs={},this.schemaTypeInfo=null,X!=null&&this.attribute(X),m.type===i.Document&&(this.isRoot=!0,this.documentObject=m,m.rootObject=this,m.children)){for(Z=m.children,G=0,nt=Z.length;G=B;A=0<=B?++X:--X)if(!this.attribs[A].isEqualNode(m.attribs[A]))return!1;return!0}}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 v(this.attribs)),this.attributeMap}}),F}.call(this)}).call(Ra)});var kr=tt((qa,Xa)=>{(function(){var i,f;f=zt(),Xa.exports=i=function(){class D extends f{constructor(h){super(h),this.value=""}clone(){return Object.create(this)}substringData(h,b){throw new Error("This DOM method is not implemented."+this.debugInfo())}appendData(h){throw new Error("This DOM method is not implemented."+this.debugInfo())}insertData(h,b){throw new Error("This DOM method is not implemented."+this.debugInfo())}deleteData(h,b){throw new Error("This DOM method is not implemented."+this.debugInfo())}replaceData(h,b,w){throw new Error("This DOM method is not implemented."+this.debugInfo())}isEqualNode(h){return!(!super.isEqualNode(h)||h.data!==this.data)}}return Object.defineProperty(D.prototype,"data",{get:function(){return this.value},set:function(v){return this.value=v||""}}),Object.defineProperty(D.prototype,"length",{get:function(){return this.value.length}}),Object.defineProperty(D.prototype,"textContent",{get:function(){return this.value},set:function(v){return this.value=v||""}}),D}.call(this)}).call(qa)});var Kn=tt((Ba,Ua)=>{(function(){var i,f,D;i=Dt(),D=kr(),Ua.exports=f=class extends D{constructor(h,b){if(super(h),b==null)throw new Error("Missing CDATA text. "+this.debugInfo());this.name="#cdata-section",this.type=i.CData,this.value=this.stringify.cdata(b)}clone(){return Object.create(this)}toString(h){return this.options.writer.cdata(this,this.options.writer.filterOptions(h))}}}).call(Ba)});var Hn=tt((Wa,ka)=>{(function(){var i,f,D;i=Dt(),f=kr(),ka.exports=D=class extends f{constructor(h,b){if(super(h),b==null)throw new Error("Missing comment text. "+this.debugInfo());this.name="#comment",this.type=i.Comment,this.value=this.stringify.comment(b)}clone(){return Object.create(this)}toString(h){return this.options.writer.comment(this,this.options.writer.filterOptions(h))}}}).call(Wa)});var Vn=tt((Ka,Ha)=>{(function(){var i,f,D,v;({isObject:v}=me()),D=zt(),i=Dt(),Ha.exports=f=class extends D{constructor(b,w,E,T){super(b),v(w)&&({version:w,encoding:E,standalone:T}=w),w||(w="1.0"),this.type=i.Declaration,this.version=this.stringify.xmlVersion(w),E!=null&&(this.encoding=this.stringify.xmlEncoding(E)),T!=null&&(this.standalone=this.stringify.xmlStandalone(T))}toString(b){return this.options.writer.declaration(this,this.options.writer.filterOptions(b))}}}).call(Ka)});var $n=tt((Va,$a)=>{(function(){var i,f,D;D=zt(),i=Dt(),$a.exports=f=class extends D{constructor(h,b,w,E,T,F){if(super(h),b==null)throw new Error("Missing DTD element name. "+this.debugInfo());if(w==null)throw new Error("Missing DTD attribute name. "+this.debugInfo(b));if(!E)throw new Error("Missing DTD attribute type. "+this.debugInfo(b));if(!T)throw new Error("Missing DTD attribute default. "+this.debugInfo(b));if(T.indexOf("#")!==0&&(T="#"+T),!T.match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/))throw new Error("Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT. "+this.debugInfo(b));if(F&&!T.match(/^(#FIXED|#DEFAULT)$/))throw new Error("Default value only applies to #FIXED or #DEFAULT. "+this.debugInfo(b));this.elementName=this.stringify.name(b),this.type=i.AttributeDeclaration,this.attributeName=this.stringify.name(w),this.attributeType=this.stringify.dtdAttType(E),F&&(this.defaultValue=this.stringify.dtdAttDefault(F)),this.defaultValueType=T}toString(h){return this.options.writer.dtdAttList(this,this.options.writer.filterOptions(h))}}}).call(Va)});var Gn=tt((Ga,za)=>{(function(){var i,f,D,v;({isObject:v}=me()),D=zt(),i=Dt(),za.exports=f=function(){class h extends D{constructor(w,E,T,F){if(super(w),T==null)throw new Error("Missing DTD entity name. "+this.debugInfo(T));if(F==null)throw new Error("Missing DTD entity value. "+this.debugInfo(T));if(this.pe=!!E,this.name=this.stringify.name(T),this.type=i.EntityDeclaration,!v(F))this.value=this.stringify.dtdEntityValue(F),this.internal=!0;else{if(!F.pubID&&!F.sysID)throw new Error("Public and/or system identifiers are required for an external entity. "+this.debugInfo(T));if(F.pubID&&!F.sysID)throw new Error("System identifier is required for a public external entity. "+this.debugInfo(T));if(this.internal=!1,F.pubID!=null&&(this.pubID=this.stringify.dtdPubID(F.pubID)),F.sysID!=null&&(this.sysID=this.stringify.dtdSysID(F.sysID)),F.nData!=null&&(this.nData=this.stringify.dtdNData(F.nData)),this.pe&&this.nData)throw new Error("Notation declaration is not allowed in a parameter entity. "+this.debugInfo(T))}}toString(w){return this.options.writer.dtdEntity(this,this.options.writer.filterOptions(w))}}return Object.defineProperty(h.prototype,"publicId",{get:function(){return this.pubID}}),Object.defineProperty(h.prototype,"systemId",{get:function(){return this.sysID}}),Object.defineProperty(h.prototype,"notationName",{get:function(){return this.nData||null}}),Object.defineProperty(h.prototype,"inputEncoding",{get:function(){return null}}),Object.defineProperty(h.prototype,"xmlEncoding",{get:function(){return null}}),Object.defineProperty(h.prototype,"xmlVersion",{get:function(){return null}}),h}.call(this)}).call(Ga)});var zn=tt((Ya,Za)=>{(function(){var i,f,D;D=zt(),i=Dt(),Za.exports=f=class extends D{constructor(h,b,w){if(super(h),b==null)throw new Error("Missing DTD element name. "+this.debugInfo());w||(w="(#PCDATA)"),Array.isArray(w)&&(w="("+w.join(",")+")"),this.name=this.stringify.name(b),this.type=i.ElementDeclaration,this.value=this.stringify.dtdElementValue(w)}toString(h){return this.options.writer.dtdElement(this,this.options.writer.filterOptions(h))}}}).call(Ya)});var Yn=tt((ja,Ja)=>{(function(){var i,f,D;D=zt(),i=Dt(),Ja.exports=f=function(){class v extends D{constructor(b,w,E){if(super(b),w==null)throw new Error("Missing DTD notation name. "+this.debugInfo(w));if(!E.pubID&&!E.sysID)throw new Error("Public or system identifiers are required for an external entity. "+this.debugInfo(w));this.name=this.stringify.name(w),this.type=i.NotationDeclaration,E.pubID!=null&&(this.pubID=this.stringify.dtdPubID(E.pubID)),E.sysID!=null&&(this.sysID=this.stringify.dtdSysID(E.sysID))}toString(b){return this.options.writer.dtdNotation(this,this.options.writer.filterOptions(b))}}return Object.defineProperty(v.prototype,"publicId",{get:function(){return this.pubID}}),Object.defineProperty(v.prototype,"systemId",{get:function(){return this.sysID}}),v}.call(this)}).call(ja)});var Zn=tt((Qa,tf)=>{(function(){var i,f,D,v,h,b,w,E,T;({isObject:T}=me()),E=zt(),i=Dt(),f=$n(),v=Gn(),D=zn(),h=Yn(),w=Wn(),tf.exports=b=function(){class F extends E{constructor(m,A,X){var B,G,nt,Z;if(super(m),this.type=i.DocType,m.children){for(Z=m.children,G=0,nt=Z.length;G{(function(){var i,f,D;i=Dt(),f=zt(),rf.exports=D=class extends f{constructor(h,b){if(super(h),b==null)throw new Error("Missing raw text. "+this.debugInfo());this.type=i.Raw,this.value=this.stringify.raw(b)}clone(){return Object.create(this)}toString(h){return this.options.writer.raw(this,this.options.writer.filterOptions(h))}}}).call(ef)});var Jn=tt((nf,sf)=>{(function(){var i,f,D;i=Dt(),f=kr(),sf.exports=D=function(){class v extends f{constructor(b,w){if(super(b),w==null)throw new Error("Missing element text. "+this.debugInfo());this.name="#text",this.type=i.Text,this.value=this.stringify.text(w)}clone(){return Object.create(this)}toString(b){return this.options.writer.text(this,this.options.writer.filterOptions(b))}splitText(b){throw new Error("This DOM method is not implemented."+this.debugInfo())}replaceWholeText(b){throw new Error("This DOM method is not implemented."+this.debugInfo())}}return Object.defineProperty(v.prototype,"isElementContentWhitespace",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),Object.defineProperty(v.prototype,"wholeText",{get:function(){var h,b,w;for(w="",b=this.previousSibling;b;)w=b.data+w,b=b.previousSibling;for(w+=this.data,h=this.nextSibling;h;)w=w+h.data,h=h.nextSibling;return w}}),v}.call(this)}).call(nf)});var Qn=tt((uf,of)=>{(function(){var i,f,D;i=Dt(),f=kr(),of.exports=D=class extends f{constructor(h,b,w){if(super(h),b==null)throw new Error("Missing instruction target. "+this.debugInfo());this.type=i.ProcessingInstruction,this.target=this.stringify.insTarget(b),this.name=this.target,w&&(this.value=this.stringify.insValue(w))}clone(){return Object.create(this)}toString(h){return this.options.writer.processingInstruction(this,this.options.writer.filterOptions(h))}isEqualNode(h){return!(!super.isEqualNode(h)||h.target!==this.target)}}}).call(uf)});var Ls=tt((af,ff)=>{(function(){var i,f,D;D=zt(),i=Dt(),ff.exports=f=class extends D{constructor(h){super(h),this.type=i.Dummy}clone(){return Object.create(this)}toString(h){return""}}}).call(af)});var cf=tt((hf,lf)=>{(function(){var i;lf.exports=i=function(){class f{constructor(v){this.nodes=v}clone(){return this.nodes=null}item(v){return this.nodes[v]||null}}return Object.defineProperty(f.prototype,"length",{get:function(){return this.nodes.length||0}}),f}.call(this)}).call(hf)});var gf=tt((df,pf)=>{(function(){pf.exports={Disconnected:1,Preceding:2,Following:4,Contains:8,ContainedBy:16,ImplementationSpecific:32}}).call(df)});var zt=tt((mf,wf)=>{(function(){var i,f,D,v,h,b,w,E,T,F,M,m,A,X,B,G,nt,Z,xt={}.hasOwnProperty,p=[].splice;({isObject:Z,isFunction:nt,isEmpty:G,getValue:B}=me()),E=null,D=null,v=null,h=null,b=null,A=null,X=null,m=null,w=null,f=null,M=null,T=null,i=null,wf.exports=F=function(){class d{constructor(a){this.parent=a,this.parent&&(this.options=this.parent.options,this.stringify=this.parent.stringify),this.value=null,this.children=[],this.baseURI=null,E||(E=kn(),D=Kn(),v=Hn(),h=Vn(),b=Zn(),A=jn(),X=Jn(),m=Qn(),w=Ls(),f=Dt(),M=cf(),T=Wn(),i=gf())}setParent(a){var x,C,l,I,S;for(this.parent=a,a&&(this.options=a.options,this.stringify=a.stringify),I=this.children,S=[],C=0,l=I.length;C":(C=this.parent)!=null&&C.name?"node: <"+a+">, parent: <"+this.parent.name+">":"node: <"+a+">"}ele(a,x,C){return this.element(a,x,C)}nod(a,x,C){return this.node(a,x,C)}txt(a){return this.text(a)}dat(a){return this.cdata(a)}com(a){return this.comment(a)}ins(a,x){return this.instruction(a,x)}doc(){return this.document()}dec(a,x,C){return this.declaration(a,x,C)}e(a,x,C){return this.element(a,x,C)}n(a,x,C){return this.node(a,x,C)}t(a){return this.text(a)}d(a){return this.cdata(a)}c(a){return this.comment(a)}r(a){return this.raw(a)}i(a,x){return this.instruction(a,x)}u(){return this.up()}importXMLBuilder(a){return this.importDocument(a)}attribute(a,x){throw new Error("attribute() applies to element nodes only.")}att(a,x){return this.attribute(a,x)}a(a,x){return this.attribute(a,x)}removeAttribute(a){throw new Error("attribute() applies to element nodes only.")}replaceChild(a,x){throw new Error("This DOM method is not implemented."+this.debugInfo())}removeChild(a){throw new Error("This DOM method is not implemented."+this.debugInfo())}appendChild(a){throw new Error("This DOM method is not implemented."+this.debugInfo())}hasChildNodes(){return this.children.length!==0}cloneNode(a){throw new Error("This DOM method is not implemented."+this.debugInfo())}normalize(){throw new Error("This DOM method is not implemented."+this.debugInfo())}isSupported(a,x){return!0}hasAttributes(){return this.attribs.length!==0}compareDocumentPosition(a){var x,C;return x=this,x===a?0:this.document()!==a.document()?(C=i.Disconnected|i.ImplementationSpecific,Math.random()<.5?C|=i.Preceding:C|=i.Following,C):x.isAncestor(a)?i.Contains|i.Preceding:x.isDescendant(a)?i.Contains|i.Following:x.isPreceding(a)?i.Preceding:i.Following}isSameNode(a){throw new Error("This DOM method is not implemented."+this.debugInfo())}lookupPrefix(a){throw new Error("This DOM method is not implemented."+this.debugInfo())}isDefaultNamespace(a){throw new Error("This DOM method is not implemented."+this.debugInfo())}lookupNamespaceURI(a){throw new Error("This DOM method is not implemented."+this.debugInfo())}isEqualNode(a){var x,C,l;if(a.nodeType!==this.nodeType||a.children.length!==this.children.length)return!1;for(x=C=0,l=this.children.length-1;0<=l?C<=l:C>=l;x=0<=l?++C:--C)if(!this.children[x].isEqualNode(a.children[x]))return!1;return!0}getFeature(a,x){throw new Error("This DOM method is not implemented."+this.debugInfo())}setUserData(a,x,C){throw new Error("This DOM method is not implemented."+this.debugInfo())}getUserData(a){throw new Error("This DOM method is not implemented."+this.debugInfo())}contains(a){return a?a===this||this.isDescendant(a):!1}isDescendant(a){var x,C,l,I,S;for(S=this.children,l=0,I=S.length;lC}treePosition(a){var x,C;return C=0,x=!1,this.foreachTreeNode(this.document(),function(l){if(C++,!x&&l===a)return x=!0}),x?C:-1}foreachTreeNode(a,x){var C,l,I,S,k;for(a||(a=this.document()),S=a.children,l=0,I=S.length;l{(function(){var i,f={}.hasOwnProperty;_f.exports=i=function(){class D{constructor(h){var b,w,E;this.assertLegalChar=this.assertLegalChar.bind(this),this.assertLegalName=this.assertLegalName.bind(this),h||(h={}),this.options=h,this.options.version||(this.options.version="1.0"),w=h.stringify||{};for(b in w)!f.call(w,b)||(E=w[b],this[b]=E)}name(h){return this.options.noValidation?h:this.assertLegalName(""+h||"")}text(h){return this.options.noValidation?h:this.assertLegalChar(this.textEscape(""+h||""))}cdata(h){return this.options.noValidation?h:(h=""+h||"",h=h.replace("]]>","]]]]>"),this.assertLegalChar(h))}comment(h){if(this.options.noValidation)return h;if(h=""+h||"",h.match(/--/))throw new Error("Comment text cannot contain double-hypen: "+h);return this.assertLegalChar(h)}raw(h){return this.options.noValidation?h:""+h||""}attValue(h){return this.options.noValidation?h:this.assertLegalChar(this.attEscape(h=""+h||""))}insTarget(h){return this.options.noValidation?h:this.assertLegalChar(""+h||"")}insValue(h){if(this.options.noValidation)return h;if(h=""+h||"",h.match(/\?>/))throw new Error("Invalid processing instruction value: "+h);return this.assertLegalChar(h)}xmlVersion(h){if(this.options.noValidation)return h;if(h=""+h||"",!h.match(/1\.[0-9]+/))throw new Error("Invalid version number: "+h);return h}xmlEncoding(h){if(this.options.noValidation)return h;if(h=""+h||"",!h.match(/^[A-Za-z](?:[A-Za-z0-9._-])*$/))throw new Error("Invalid encoding: "+h);return this.assertLegalChar(h)}xmlStandalone(h){return this.options.noValidation?h:h?"yes":"no"}dtdPubID(h){return this.options.noValidation?h:this.assertLegalChar(""+h||"")}dtdSysID(h){return this.options.noValidation?h:this.assertLegalChar(""+h||"")}dtdElementValue(h){return this.options.noValidation?h:this.assertLegalChar(""+h||"")}dtdAttType(h){return this.options.noValidation?h:this.assertLegalChar(""+h||"")}dtdAttDefault(h){return this.options.noValidation?h:this.assertLegalChar(""+h||"")}dtdEntityValue(h){return this.options.noValidation?h:this.assertLegalChar(""+h||"")}dtdNData(h){return this.options.noValidation?h:this.assertLegalChar(""+h||"")}assertLegalChar(h){var b,w;if(this.options.noValidation)return h;if(this.options.version==="1.0"){if(b=/[\0-\x08\x0B\f\x0E-\x1F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/g,this.options.invalidCharReplacement!==void 0)h=h.replace(b,this.options.invalidCharReplacement);else if(w=h.match(b))throw new Error(`Invalid character in string: ${h} at index ${w.index}`)}else if(this.options.version==="1.1"){if(b=/[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/g,this.options.invalidCharReplacement!==void 0)h=h.replace(b,this.options.invalidCharReplacement);else if(w=h.match(b))throw new Error(`Invalid character in string: ${h} at index ${w.index}`)}return h}assertLegalName(h){var b;if(this.options.noValidation)return h;if(h=this.assertLegalChar(h),b=/^([: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])*$/,!h.match(b))throw new Error(`Invalid character in name: ${h}`);return h}textEscape(h){var b;return this.options.noValidation?h:(b=this.options.noDoubleEncoding?/(?!&(lt|gt|amp|apos|quot);)&/g:/&/g,h.replace(b,"&").replace(//g,">").replace(/\r/g," "))}attEscape(h){var b;return this.options.noValidation?h:(b=this.options.noDoubleEncoding?/(?!&(lt|gt|amp|apos|quot);)&/g:/&/g,h.replace(b,"&").replace(/{(function(){bf.exports={None:0,OpenTag:1,InsideTag:2,CloseTag:3}}).call(vf)});var Ms=tt((Df,Tf)=>{(function(){var i,f,D,v,h,b,w,E,T,F,M,m,A,X,B,G,nt,Z={}.hasOwnProperty;({assign:nt}=me()),i=Dt(),T=Vn(),F=Zn(),D=Kn(),v=Hn(),m=kn(),X=jn(),B=Jn(),A=Qn(),M=Ls(),h=$n(),b=zn(),w=Gn(),E=Yn(),f=Kr(),Tf.exports=G=class{constructor(p){var d,O,a;p||(p={}),this.options=p,O=p.writer||{};for(d in O)!Z.call(O,d)||(a=O[d],this["_"+d]=this[d],this[d]=a)}filterOptions(p){var d,O,a,x,C,l,I,S,k;return p||(p={}),p=nt({},this.options,p),d={writer:this},d.pretty=p.pretty||!1,d.allowEmpty=p.allowEmpty||!1,d.indent=(O=p.indent)!=null?O:" ",d.newline=(a=p.newline)!=null?a:` -`,d.offset=(x=p.offset)!=null?x:0,d.width=(C=p.width)!=null?C:0,d.dontPrettyTextNodes=(l=(I=p.dontPrettyTextNodes)!=null?I:p.dontprettytextnodes)!=null?l:0,d.spaceBeforeSlash=(S=(k=p.spaceBeforeSlash)!=null?k:p.spacebeforeslash)!=null?S:"",d.spaceBeforeSlash===!0&&(d.spaceBeforeSlash=" "),d.suppressPrettyCount=0,d.user={},d.state=f.None,d}indent(p,d,O){var a;return!d.pretty||d.suppressPrettyCount?"":d.pretty&&(a=(O||0)+d.offset+1,a>0)?new Array(a).join(d.indent):""}endline(p,d,O){return!d.pretty||d.suppressPrettyCount?"":d.newline}attribute(p,d,O){var a;return this.openAttribute(p,d,O),d.pretty&&d.width>0?a=p.name+'="'+p.value+'"':a=" "+p.name+'="'+p.value+'"',this.closeAttribute(p,d,O),a}cdata(p,d,O){var a;return this.openNode(p,d,O),d.state=f.OpenTag,a=this.indent(p,d,O)+""+this.endline(p,d,O),d.state=f.None,this.closeNode(p,d,O),a}comment(p,d,O){var a;return this.openNode(p,d,O),d.state=f.OpenTag,a=this.indent(p,d,O)+""+this.endline(p,d,O),d.state=f.None,this.closeNode(p,d,O),a}declaration(p,d,O){var a;return this.openNode(p,d,O),d.state=f.OpenTag,a=this.indent(p,d,O)+"",a+=this.endline(p,d,O),d.state=f.None,this.closeNode(p,d,O),a}docType(p,d,O){var a,x,C,l,I;if(O||(O=0),this.openNode(p,d,O),d.state=f.OpenTag,l=this.indent(p,d,O),l+="0){for(l+=" [",l+=this.endline(p,d,O),d.state=f.InsideTag,I=p.children,x=0,C=I.length;x",l+=this.endline(p,d,O),d.state=f.None,this.closeNode(p,d,O),l}element(p,d,O){var a,x,C,l,I,S,k,z,j,pt,at,it,_t,St,Je,Qe,yr,ce,ie;if(O||(O=0),it=!1,this.openNode(p,d,O),d.state=f.OpenTag,_t=this.indent(p,d,O)+"<"+p.name,d.pretty&&d.width>0){z=_t.length,Je=p.attribs;for(at in Je)!Z.call(Je,at)||(a=Je[at],St=this.attribute(a,d,O),x=St.length,z+x>d.width?(ie=this.indent(p,d,O+1)+St,_t+=this.endline(p,d,O)+ie,z=ie.length):(ie=" "+St,_t+=ie,z+=ie.length))}else{Qe=p.attribs;for(at in Qe)!Z.call(Qe,at)||(a=Qe[at],_t+=this.attribute(a,d,O))}if(l=p.children.length,I=l===0?null:p.children[0],l===0||p.children.every(function(tr){return(tr.type===i.Text||tr.type===i.Raw||tr.type===i.CData)&&tr.value===""}))d.allowEmpty?(_t+=">",d.state=f.CloseTag,_t+=""+this.endline(p,d,O)):(d.state=f.CloseTag,_t+=d.spaceBeforeSlash+"/>"+this.endline(p,d,O));else if(d.pretty&&l===1&&(I.type===i.Text||I.type===i.Raw||I.type===i.CData)&&I.value!=null)_t+=">",d.state=f.InsideTag,d.suppressPrettyCount++,it=!0,_t+=this.writeChildNode(I,d,O+1),d.suppressPrettyCount--,it=!1,d.state=f.CloseTag,_t+=""+this.endline(p,d,O);else{if(d.dontPrettyTextNodes){for(yr=p.children,S=0,j=yr.length;S"+this.endline(p,d,O),d.state=f.InsideTag,ce=p.children,k=0,pt=ce.length;k",it&&d.suppressPrettyCount--,_t+=this.endline(p,d,O),d.state=f.None}return this.closeNode(p,d,O),_t}writeChildNode(p,d,O){switch(p.type){case i.CData:return this.cdata(p,d,O);case i.Comment:return this.comment(p,d,O);case i.Element:return this.element(p,d,O);case i.Raw:return this.raw(p,d,O);case i.Text:return this.text(p,d,O);case i.ProcessingInstruction:return this.processingInstruction(p,d,O);case i.Dummy:return"";case i.Declaration:return this.declaration(p,d,O);case i.DocType:return this.docType(p,d,O);case i.AttributeDeclaration:return this.dtdAttList(p,d,O);case i.ElementDeclaration:return this.dtdElement(p,d,O);case i.EntityDeclaration:return this.dtdEntity(p,d,O);case i.NotationDeclaration:return this.dtdNotation(p,d,O);default:throw new Error("Unknown XML node type: "+p.constructor.name)}}processingInstruction(p,d,O){var a;return this.openNode(p,d,O),d.state=f.OpenTag,a=this.indent(p,d,O)+"",a+=this.endline(p,d,O),d.state=f.None,this.closeNode(p,d,O),a}raw(p,d,O){var a;return this.openNode(p,d,O),d.state=f.OpenTag,a=this.indent(p,d,O),d.state=f.InsideTag,a+=p.value,d.state=f.CloseTag,a+=this.endline(p,d,O),d.state=f.None,this.closeNode(p,d,O),a}text(p,d,O){var a;return this.openNode(p,d,O),d.state=f.OpenTag,a=this.indent(p,d,O),d.state=f.InsideTag,a+=p.value,d.state=f.CloseTag,a+=this.endline(p,d,O),d.state=f.None,this.closeNode(p,d,O),a}dtdAttList(p,d,O){var a;return this.openNode(p,d,O),d.state=f.OpenTag,a=this.indent(p,d,O)+""+this.endline(p,d,O),d.state=f.None,this.closeNode(p,d,O),a}dtdElement(p,d,O){var a;return this.openNode(p,d,O),d.state=f.OpenTag,a=this.indent(p,d,O)+""+this.endline(p,d,O),d.state=f.None,this.closeNode(p,d,O),a}dtdEntity(p,d,O){var a;return this.openNode(p,d,O),d.state=f.OpenTag,a=this.indent(p,d,O)+""+this.endline(p,d,O),d.state=f.None,this.closeNode(p,d,O),a}dtdNotation(p,d,O){var a;return this.openNode(p,d,O),d.state=f.OpenTag,a=this.indent(p,d,O)+""+this.endline(p,d,O),d.state=f.None,this.closeNode(p,d,O),a}openNode(p,d,O){}closeNode(p,d,O){}openAttribute(p,d,O){}closeAttribute(p,d,O){}}}).call(Df)});var ti=tt((Ef,xf)=>{(function(){var i,f;f=Ms(),xf.exports=i=class extends f{constructor(v){super(v)}document(v,h){var b,w,E,T,F;for(h=this.filterOptions(h),T="",F=v.children,w=0,E=F.length;w{(function(){var i,f,D,v,h,b,w,E;({isPlainObject:E}=me()),D=Is(),f=La(),h=zt(),i=Dt(),w=Cs(),b=ti(),Of.exports=v=function(){class T extends h{constructor(M){super(null),this.name="#document",this.type=i.Document,this.documentURI=null,this.domConfig=new f,M||(M={}),M.writer||(M.writer=new b),this.options=M,this.stringify=new w(M)}end(M){var m;return m={},M?E(M)&&(m=M,M=this.options.writer):M=this.options.writer,M.document(this,M.filterOptions(m))}toString(M){return this.options.writer.document(this,this.options.writer.filterOptions(M))}createElement(M){throw new Error("This DOM method is not implemented."+this.debugInfo())}createDocumentFragment(){throw new Error("This DOM method is not implemented."+this.debugInfo())}createTextNode(M){throw new Error("This DOM method is not implemented."+this.debugInfo())}createComment(M){throw new Error("This DOM method is not implemented."+this.debugInfo())}createCDATASection(M){throw new Error("This DOM method is not implemented."+this.debugInfo())}createProcessingInstruction(M,m){throw new Error("This DOM method is not implemented."+this.debugInfo())}createAttribute(M){throw new Error("This DOM method is not implemented."+this.debugInfo())}createEntityReference(M){throw new Error("This DOM method is not implemented."+this.debugInfo())}getElementsByTagName(M){throw new Error("This DOM method is not implemented."+this.debugInfo())}importNode(M,m){throw new Error("This DOM method is not implemented."+this.debugInfo())}createElementNS(M,m){throw new Error("This DOM method is not implemented."+this.debugInfo())}createAttributeNS(M,m){throw new Error("This DOM method is not implemented."+this.debugInfo())}getElementsByTagNameNS(M,m){throw new Error("This DOM method is not implemented."+this.debugInfo())}getElementById(M){throw new Error("This DOM method is not implemented."+this.debugInfo())}adoptNode(M){throw new Error("This DOM method is not implemented."+this.debugInfo())}normalizeDocument(){throw new Error("This DOM method is not implemented."+this.debugInfo())}renameNode(M,m,A){throw new Error("This DOM method is not implemented."+this.debugInfo())}getElementsByClassName(M){throw new Error("This DOM method is not implemented."+this.debugInfo())}createEvent(M){throw new Error("This DOM method is not implemented."+this.debugInfo())}createRange(){throw new Error("This DOM method is not implemented."+this.debugInfo())}createNodeIterator(M,m,A){throw new Error("This DOM method is not implemented."+this.debugInfo())}createTreeWalker(M,m,A){throw new Error("This DOM method is not implemented."+this.debugInfo())}}return Object.defineProperty(T.prototype,"implementation",{value:new D}),Object.defineProperty(T.prototype,"doctype",{get:function(){var F,M,m,A;for(A=this.children,M=0,m=A.length;M{(function(){var i,f,D,v,h,b,w,E,T,F,M,m,A,X,B,G,nt,Z,xt,p,d,O,a,x={}.hasOwnProperty;({isObject:O,isFunction:d,isPlainObject:a,getValue:p}=me()),i=Dt(),m=As(),X=kn(),v=Kn(),h=Hn(),G=jn(),xt=Jn(),B=Qn(),F=Vn(),M=Zn(),b=$n(),E=Gn(),w=zn(),T=Yn(),D=Os(),Z=Cs(),nt=ti(),f=Kr(),Cf.exports=A=class{constructor(l,I,S){var k;this.name="?xml",this.type=i.Document,l||(l={}),k={},l.writer?a(l.writer)&&(k=l.writer,l.writer=new nt):l.writer=new nt,this.options=l,this.writer=l.writer,this.writerOptions=this.writer.filterOptions(k),this.stringify=new Z(l),this.onDataCallback=I||function(){},this.onEndCallback=S||function(){},this.currentNode=null,this.currentLevel=-1,this.openTags={},this.documentStarted=!1,this.documentCompleted=!1,this.root=null}createChildNode(l){var I,S,k,z,j,pt,at,it;switch(l.type){case i.CData:this.cdata(l.value);break;case i.Comment:this.comment(l.value);break;case i.Element:k={},at=l.attribs;for(S in at)!x.call(at,S)||(I=at[S],k[S]=I.value);this.node(l.name,k);break;case i.Dummy:this.dummy();break;case i.Raw:this.raw(l.value);break;case i.Text:this.text(l.value);break;case i.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(it=l.children,j=0,pt=it.length;j=0;)this.up();return this.onEnd()}openCurrent(){if(this.currentNode)return this.currentNode.children=!0,this.openNode(this.currentNode)}openNode(l){var I,S,k,z;if(!l.isOpen){if(!this.root&&this.currentLevel===0&&l.type===i.Element&&(this.root=l),S="",l.type===i.Element){this.writerOptions.state=f.OpenTag,S=this.writer.indent(l,this.writerOptions,this.currentLevel)+"<"+l.name,z=l.attribs;for(k in z)!x.call(z,k)||(I=z[k],S+=this.writer.attribute(I,this.writerOptions,this.currentLevel));S+=(l.children?">":"/>")+this.writer.endline(l,this.writerOptions,this.currentLevel),this.writerOptions.state=f.InsideTag}else this.writerOptions.state=f.OpenTag,S=this.writer.indent(l,this.writerOptions,this.currentLevel)+""),S+=this.writer.endline(l,this.writerOptions,this.currentLevel);return this.onData(S,this.currentLevel),l.isOpen=!0}}closeNode(l){var I;if(!l.isClosed)return I="",this.writerOptions.state=f.CloseTag,l.type===i.Element?I=this.writer.indent(l,this.writerOptions,this.currentLevel)+""+this.writer.endline(l,this.writerOptions,this.currentLevel):I=this.writer.indent(l,this.writerOptions,this.currentLevel)+"]>"+this.writer.endline(l,this.writerOptions,this.currentLevel),this.writerOptions.state=f.None,this.onData(I,this.currentLevel),l.isClosed=!0}onData(l,I){return this.documentStarted=!0,this.onDataCallback(l,I+1)}onEnd(){return this.documentCompleted=!0,this.onEndCallback()}debugInfo(l){return l==null?"":"node: <"+l+">"}ele(){return this.element(...arguments)}nod(l,I,S){return this.node(l,I,S)}txt(l){return this.text(l)}dat(l){return this.cdata(l)}com(l){return this.comment(l)}ins(l,I){return this.instruction(l,I)}dec(l,I,S){return this.declaration(l,I,S)}dtd(l,I,S){return this.doctype(l,I,S)}e(l,I,S){return this.element(l,I,S)}n(l,I,S){return this.node(l,I,S)}t(l){return this.text(l)}d(l){return this.cdata(l)}c(l){return this.comment(l)}r(l){return this.raw(l)}i(l,I){return this.instruction(l,I)}att(){return this.currentNode&&this.currentNode.type===i.DocType?this.attList(...arguments):this.attribute(...arguments)}a(){return this.currentNode&&this.currentNode.type===i.DocType?this.attList(...arguments):this.attribute(...arguments)}ent(l,I){return this.entity(l,I)}pent(l,I){return this.pEntity(l,I)}not(l,I){return this.notation(l,I)}}}).call(Lf)});var Sf=tt((Af,Nf)=>{(function(){var i,f,D,v,h={}.hasOwnProperty;i=Dt(),v=Ms(),f=Kr(),Nf.exports=D=class extends v{constructor(w,E){super(E),this.stream=w}endline(w,E,T){return w.isLastRootNode&&E.state===f.CloseTag?"":super.endline(w,E,T)}document(w,E){var T,F,M,m,A,X,B,G,nt;for(B=w.children,F=M=0,A=B.length;M0){for(this.stream.write(" ["),this.stream.write(this.endline(w,E,T)),E.state=f.InsideTag,A=w.children,M=0,m=A.length;M"),this.stream.write(this.endline(w,E,T)),E.state=f.None,this.closeNode(w,E,T)}element(w,E,T){var F,M,m,A,X,B,G,nt,Z,xt,p,d,O,a,x,C;if(T||(T=0),this.openNode(w,E,T),E.state=f.OpenTag,p=this.indent(w,E,T)+"<"+w.name,E.pretty&&E.width>0){G=p.length,O=w.attribs;for(Z in O)!h.call(O,Z)||(F=O[Z],d=this.attribute(F,E,T),M=d.length,G+M>E.width?(C=this.indent(w,E,T+1)+d,p+=this.endline(w,E,T)+C,G=C.length):(C=" "+d,p+=C,G+=C.length))}else{a=w.attribs;for(Z in a)!h.call(a,Z)||(F=a[Z],p+=this.attribute(F,E,T))}if(this.stream.write(p),A=w.children.length,X=A===0?null:w.children[0],A===0||w.children.every(function(l){return(l.type===i.Text||l.type===i.Raw||l.type===i.CData)&&l.value===""}))E.allowEmpty?(this.stream.write(">"),E.state=f.CloseTag,this.stream.write("")):(E.state=f.CloseTag,this.stream.write(E.spaceBeforeSlash+"/>"));else if(E.pretty&&A===1&&(X.type===i.Text||X.type===i.Raw||X.type===i.CData)&&X.value!=null)this.stream.write(">"),E.state=f.InsideTag,E.suppressPrettyCount++,xt=!0,this.writeChildNode(X,E,T+1),E.suppressPrettyCount--,xt=!1,E.state=f.CloseTag,this.stream.write("");else{for(this.stream.write(">"+this.endline(w,E,T)),E.state=f.InsideTag,x=w.children,B=0,nt=x.length;B")}return this.stream.write(this.endline(w,E,T)),E.state=f.None,this.closeNode(w,E,T)}processingInstruction(w,E,T){return this.stream.write(super.processingInstruction(w,E,T))}raw(w,E,T){return this.stream.write(super.raw(w,E,T))}text(w,E,T){return this.stream.write(super.text(w,E,T))}dtdAttList(w,E,T){return this.stream.write(super.dtdAttList(w,E,T))}dtdElement(w,E,T){return this.stream.write(super.dtdElement(w,E,T))}dtdEntity(w,E,T){return this.stream.write(super.dtdEntity(w,E,T))}dtdNotation(w,E,T){return this.stream.write(super.dtdNotation(w,E,T))}}}).call(Af)});var Rf=tt((Pf,Ue)=>{(function(){var i,f,D,v,h,b,w,E,T;({assign:E,isFunction:T}=me()),D=Is(),v=As(),h=Mf(),w=ti(),b=Sf(),i=Dt(),f=Kr(),Ue.exports.create=function(F,M,m,A){var X,B;if(F==null)throw new Error("Root element needs a name.");return A=E({},M,m,A),X=new v(A),B=X.element(F),A.headless||(X.declaration(A),(A.pubID!=null||A.sysID!=null)&&X.dtd(A)),B},Ue.exports.begin=function(F,M,m){return T(F)&&([M,m]=[F,M],F={}),M?new h(F,M,m):new v(F)},Ue.exports.stringWriter=function(F){return new w(F)},Ue.exports.streamWriter=function(F,M){return new b(F,M)},Ue.exports.implementation=new D,Ue.exports.nodeType=i,Ue.exports.writerState=f}).call(Pf)});var Wf=tt((Xy,Ns)=>{"use strict";var ei=Gt("fs"),Oe=Gt("path"),{promisify:Ff}=Gt("util"),ry=Gt("semver"),qf=ry.satisfies(process.version,">=10.12.0"),Xf=i=>{if(process.platform==="win32"&&/[<>:"|?*]/.test(i.replace(Oe.parse(i).root,""))){let D=new Error(`Path contains invalid characters: ${i}`);throw D.code="EINVAL",D}},Bf=i=>({...{mode:511,fs:ei},...i}),Uf=i=>{let f=new Error(`operation not permitted, mkdir '${i}'`);return f.code="EPERM",f.errno=-4048,f.path=i,f.syscall="mkdir",f},ny=async(i,f)=>{Xf(i),f=Bf(f);let D=Ff(f.fs.mkdir),v=Ff(f.fs.stat);if(qf&&f.fs.mkdir===ei.mkdir){let b=Oe.resolve(i);return await D(b,{mode:f.mode,recursive:!0}),b}let h=async b=>{try{return await D(b,f.mode),b}catch(w){if(w.code==="EPERM")throw w;if(w.code==="ENOENT"){if(Oe.dirname(b)===b)throw Uf(b);if(w.message.includes("null bytes"))throw w;return await h(Oe.dirname(b)),h(b)}try{if(!(await v(b)).isDirectory())throw new Error("The path is not a directory")}catch{throw w}return b}};return h(Oe.resolve(i))};Ns.exports=ny;Ns.exports.sync=(i,f)=>{if(Xf(i),f=Bf(f),qf&&f.fs.mkdirSync===ei.mkdirSync){let v=Oe.resolve(i);return ei.mkdirSync(v,{mode:f.mode,recursive:!0}),v}let D=v=>{try{f.fs.mkdirSync(v,f.mode)}catch(h){if(h.code==="EPERM")throw h;if(h.code==="ENOENT"){if(Oe.dirname(v)===v)throw Uf(v);if(h.message.includes("null bytes"))throw h;return D(Oe.dirname(v)),D(v)}try{if(!f.fs.statSync(v).isDirectory())throw new Error("The path is not a directory")}catch{throw h}}return v};return D(Oe.resolve(i))}});var Hf=tt((By,ne)=>{"use strict";function kf(i,f){for(var D=i.toString();D.length-1?h:b,E=Ze(f.getHours()),T=Ze(f.getMinutes()),F=Ze(f.getSeconds()),M=kf(f.getMilliseconds(),3),m=iy(f.getTimezoneOffset()),A=i.replace(/dd/g,D).replace(/MM/g,v).replace(/y{1,4}/g,w).replace(/hh/g,E).replace(/mm/g,T).replace(/ss/g,F).replace(/SSS/g,M).replace(/O/g,m);return A}function je(i,f,D,v){i["set"+(v?"":"UTC")+f](D)}function sy(i,f,D){var v=i.indexOf("O")<0,h=[{pattern:/y{1,4}/,regexp:"\\d{1,4}",fn:function(M,m){je(M,"FullYear",m,v)}},{pattern:/MM/,regexp:"\\d{1,2}",fn:function(M,m){je(M,"Month",m-1,v)}},{pattern:/dd/,regexp:"\\d{1,2}",fn:function(M,m){je(M,"Date",m,v)}},{pattern:/hh/,regexp:"\\d{1,2}",fn:function(M,m){je(M,"Hours",m,v)}},{pattern:/mm/,regexp:"\\d\\d",fn:function(M,m){je(M,"Minutes",m,v)}},{pattern:/ss/,regexp:"\\d\\d",fn:function(M,m){je(M,"Seconds",m,v)}},{pattern:/SSS/,regexp:"\\d\\d\\d",fn:function(M,m){je(M,"Milliseconds",m,v)}},{pattern:/O/,regexp:"[+-]\\d{1,2}:?\\d{2}?|Z",fn:function(M,m){m==="Z"?m=0:m=m.replace(":","");var A=Math.abs(m),X=(m>0?-1:1)*(A%100+Math.floor(A/100)*60);M.setUTCMinutes(M.getUTCMinutes()+X)}}],b=h.reduce(function(M,m){return m.pattern.test(M.regexp)?(m.index=M.regexp.match(m.pattern).index,M.regexp=M.regexp.replace(m.pattern,"("+m.regexp+")")):m.index=-1,M},{regexp:i,index:[]}),w=h.filter(function(M){return M.index>-1});w.sort(function(M,m){return M.index-m.index});var E=new RegExp(b.regexp),T=E.exec(f);if(T){var F=D||ne.exports.now();return w.forEach(function(M,m){M.fn(F,T[m+1])}),F}throw new Error("String '"+f+"' could not be parsed as '"+i+"'")}function uy(i,f,D){if(!i)throw new Error("pattern must be supplied");return sy(i,f,D)}function oy(){return new Date}ne.exports=Kf;ne.exports.asString=Kf;ne.exports.parse=uy;ne.exports.now=oy;ne.exports.ISO8601_FORMAT="yyyy-MM-ddThh:mm:ss.SSS";ne.exports.ISO8601_WITH_TZ_OFFSET_FORMAT="yyyy-MM-ddThh:mm:ss.SSSO";ne.exports.DATETIME_FORMAT="dd MM yyyy hh:mm:ss.SSS";ne.exports.ABSOLUTETIME_FORMAT="hh:mm:ss.SSS"});var Ss=tt((Uy,Vf)=>{var Hr=xs(),ay=Hf().asString;function le(i){this._factory=i,this._attributes={},this._testCases=[],this._properties=[]}le.prototype.name=function(i){return this._attributes.name=i,this};le.prototype.time=function(i){return this._attributes.time=i,this};le.prototype.timestamp=function(i){return Hr.isDate(i)?this._attributes.timestamp=ay("yyyy-MM-ddThh:mm:ss",i):this._attributes.timestamp=i,this};le.prototype.property=function(i,f){return this._properties.push({name:i,value:f}),this};le.prototype.testCase=function(){var i=this._factory.newTestCase();return this._testCases.push(i),i};le.prototype.getFailureCount=function(){return this._sumTestCaseCounts(function(i){return i.getFailureCount()})};le.prototype.getErrorCount=function(){return this._sumTestCaseCounts(function(i){return i.getErrorCount()})};le.prototype.getSkippedCount=function(){return this._sumTestCaseCounts(function(i){return i.getSkippedCount()})};le.prototype._sumTestCaseCounts=function(i){var f=Hr.map(this._testCases,i);return Hr.sum(f)};le.prototype.build=function(i){this._attributes.tests=this._testCases.length,this._attributes.failures=this.getFailureCount(),this._attributes.errors=this.getErrorCount(),this._attributes.skipped=this.getSkippedCount();var f=i.ele("testsuite",this._attributes);if(this._properties.length){var D=f.ele("properties");Hr.forEach(this._properties,function(v){D.ele("property",{name:v.name,value:v.value})})}Hr.forEach(this._testCases,function(v){v.build(f)})};Vf.exports=le});var Ps=tt((Wy,$f)=>{function Nt(){this._error=!1,this._failure=!1,this._skipped=!1,this._standardOutput=void 0,this._standardError=void 0,this._stacktrace=void 0,this._attributes={},this._errorAttributes={},this._failureAttributes={},this._errorAttachment=void 0,this._errorContent=void 0}Nt.prototype.className=function(i){return this._attributes.classname=i,this};Nt.prototype.name=function(i){return this._attributes.name=i,this};Nt.prototype.time=function(i){return this._attributes.time=i,this};Nt.prototype.file=function(i){return this._attributes.file=i,this};Nt.prototype.failure=function(i,f){return this._failure=!0,i&&(this._failureAttributes.message=i),f&&(this._failureAttributes.type=f),this};Nt.prototype.error=function(i,f,D){return this._error=!0,i&&(this._errorAttributes.message=i),f&&(this._errorAttributes.type=f),D&&(this._errorContent=D),this};Nt.prototype.stacktrace=function(i){return this._failure=!0,this._stacktrace=i,this};Nt.prototype.skipped=function(){return this._skipped=!0,this};Nt.prototype.standardOutput=function(i){return this._standardOutput=i,this};Nt.prototype.standardError=function(i){return this._standardError=i,this};Nt.prototype.getFailureCount=function(){return Number(this._failure)};Nt.prototype.getErrorCount=function(){return Number(this._error)};Nt.prototype.getSkippedCount=function(){return Number(this._skipped)};Nt.prototype.errorAttachment=function(i){return this._errorAttachment=i,this};Nt.prototype.build=function(i){var f=i.ele("testcase",this._attributes);if(this._failure){var D=f.ele("failure",this._failureAttributes);this._stacktrace&&D.cdata(this._stacktrace)}if(this._error){var v=f.ele("error",this._errorAttributes);this._errorContent&&v.cdata(this._errorContent)}this._skipped&&f.ele("skipped"),this._standardOutput&&f.ele("system-out").cdata(this._standardOutput);var h;this._standardError&&(h=f.ele("system-err").cdata(this._standardError),this._errorAttachment&&h.txt("[[ATTACHMENT|"+this._errorAttachment+"]]"))};$f.exports=Nt});var zf=tt((Hy,Gf)=>{var fy=xs(),hy=Rf(),ly=Gt("path"),cy=Wf(),dy=Gt("fs"),ky=Ss(),Ky=Ps();function mr(i){this._factory=i,this._testSuitesAndCases=[]}mr.prototype.writeTo=function(i){cy.sync(ly.dirname(i)),dy.writeFileSync(i,this.build(),"utf8")};mr.prototype.build=function(){var i=hy.create("testsuites",{encoding:"UTF-8",invalidCharReplacement:""});return fy.forEach(this._testSuitesAndCases,function(f){f.build(i)}),i.end({pretty:!0})};mr.prototype.testSuite=function(){var i=this._factory.newTestSuite();return this._testSuitesAndCases.push(i),i};mr.prototype.testCase=function(){var i=this._factory.newTestCase();return this._testSuitesAndCases.push(i),i};mr.prototype.newBuilder=function(){return this._factory.newBuilder()};Gf.exports=mr});var Zf=tt((Vy,Yf)=>{var py=zf(),gy=Ss(),my=Ps();function ri(){}ri.prototype.newBuilder=function(){return new py(this)};ri.prototype.newTestSuite=function(){return new gy(this)};ri.prototype.newTestCase=function(){return new my(this)};Yf.exports=ri});var Jf=tt(($y,jf)=>{var wy=Zf();jf.exports=new wy().newBuilder()});var by={};Zw(by,{default:()=>vy});var uh=Gt("stream"),Ct=Gt("@yarnpkg/core"),$r=Gt("@yarnpkg/fslib"),Le=Gt("clipanion");var Un=Gt("@yarnpkg/fslib"),Qw=["./LICENSE","./LICENCE"];function pa(i){let f=String(i);return typeof i=="string"||i===f?f:null}function ty(i){if(Array.isArray(i)){let D=i.reduce((v,h)=>{let b=pa(h.type);return b&&v.push(b),v},[]);return D.length>1?`(${D.join(" OR ")})`:D[0]??null}return i?.type??pa(i)}async function ga({manifest:i,packageFs:f,prefixPath:D,looseMode:v}){let h=ty(i.license??i.raw.licenses??i.raw.license)??"";if((!h||new RegExp("see license","i").test(h))&&v)for(let b of Qw)try{let w=Un.ppath.join(D,Un.npath.toPortablePath(b));return{licenseFile:await f.readFilePromise(w,"utf8")}}catch{}return{license:h}}async function ey({license:i}){return new RegExp("\\b(unknown|see license)\\b","i").test(i)}async function ma({license:i,isFile:f,isValidLicensePredicate:D}){return i&&!await ey({license:i})?D(i,f)?{pass:!0}:{pass:!1,reason:"incompatible"}:{reason:"missing",pass:!1}}var rh=Gt("fs"),ni=jw(Jf());var Qf=Gt("@yarnpkg/core"),th=i=>{let f=Qf.structUtils.stringifyLocator(i);return f.includes("::")?f.substring(0,f.indexOf("::")):f},wr=class{constructor(f){this._map=new Map,this._defaultValue=f}get(f){return this._map.has(f)||this._map.set(f,this._defaultValue),this._map.get(f)}set(f,D){this._map.set(f,D)}has(f){return this._map.has(f)}merge(f,D){let v=this.get(f);this.set(f,{...v,...D})}entries(){return this._map.entries()}get size(){return this._map.size}},eh=(i,f)=>{let D=i.shift();if(!D)return;i=i.sort((E,T)=>E[0].localeCompare(T[0])),i.unshift(D);let v=2,h=" ".repeat(v),b=D.map(E=>E.length);for(let E of i)E.forEach((T,F)=>{b[F]=Math.max(b[F],T.length)});let w=(E,T)=>E.padEnd(Math.max(0,b[T]));i.forEach(E=>f.write(`${E.map(w).join(h)} -`))};var yy={missing:"License could not be found.",incompatible:"License is incompatible."};async function nh({results:i,outputFile:f,stdout:D}){if(!f)return;let v=ni.default.testSuite().name("Dependency Licenses Audit");for(let[h,b]of[...i.pass.entries(),...i.fail.entries(),...i.ignored.entries()].sort()){let w=v.testCase().name(h);w.standardOutput(Object.entries(b).map(E=>E.join(": ")).join(` -`)),i.ignored.has(h)?w.skipped():b.reason&&w.failure(`License: ${b.license}. Reason: ${yy[b.reason]}`,b.reason)}f==="-"?D.write(`${ni.default.build()} -`):ni.default.writeTo(f)}async function ih({results:i,stdout:f,configFilename:D}){if(i.fail.size!==0){let h=[["Package","License","Reason","Repository","Home Page"]],b=[...i.fail.entries()].map(([w,E])=>[w,String(E.license||"?"),String(E.reason||"?"),String(E.repository||"?"),String(E.homepage||"?")]);h.push(...b),eh(h,f),D&&f.write(` -NOTE: For false positives, exceptions may be added to: ${D} +}`;var rt=fa(function(){return ht(o,k+"return "+q).apply(i,c)});if(rt.source=q,ps(rt))throw rt;return rt}function jm(t){return ft(t).toLowerCase()}function Qm(t){return ft(t).toUpperCase()}function tw(t,e,r){if(t=ft(t),t&&(r||e===i))return yu(t);if(!t||!(e=kt(e)))return t;var n=oe(t),s=oe(e),o=_u(n,s),c=vu(n,s)+1;return qe(n,o,c).join("")}function ew(t,e,r){if(t=ft(t),t&&(r||e===i))return t.slice(0,bu(t)+1);if(!t||!(e=kt(e)))return t;var n=oe(t),s=vu(n,oe(e))+1;return qe(n,0,s).join("")}function rw(t,e,r){if(t=ft(t),t&&(r||e===i))return t.replace(pi,"");if(!t||!(e=kt(e)))return t;var n=oe(t),s=_u(n,oe(e));return qe(n,s).join("")}function nw(t,e){var r=C,n=l;if(wt(e)){var s="separator"in e?e.separator:s;r="length"in e?Q(e.length):r,n="omission"in e?kt(e.omission):n}t=ft(t);var o=t.length;if(ir(t)){var c=oe(t);o=c.length}if(r>=o)return t;var p=r-sr(n);if(p<1)return n;var v=c?qe(c,0,p).join(""):t.slice(0,p);if(s===i)return v+n;if(c&&(p+=v.length-p),gs(s)){if(t.slice(p).search(s)){var P,R=v;for(s.global||(s=Ai(s.source,ft(Us.exec(s))+"g")),s.lastIndex=0;P=s.exec(R);)var q=P.index;v=v.slice(0,q===i?p:q)}}else if(t.indexOf(kt(s),p)!=p){var U=v.lastIndexOf(s);U>-1&&(v=v.slice(0,U))}return v+n}function iw(t){return t=ft(t),t&&gf.test(t)?t.replace(qs,Sl):t}var sw=lr(function(t,e,r){return t+(r?" ":"")+e.toUpperCase()}),ys=fo("toUpperCase");function ha(t,e,r){return t=ft(t),e=r?i:e,e===i?Ll(t)?Fl(t):_l(t):t.match(e)||[]}var fa=nt(function(t,e){try{return Wt(t,i,e)}catch(r){return ps(r)?r:new Z(r)}}),uw=be(function(t,e){return Zt(e,function(r){r=ge(r),ve(t,r,cs(t[r],t))}),t});function ow(t){var e=t==null?0:t.length,r=$();return t=e?mt(t,function(n){if(typeof n[1]!="function")throw new Jt(f);return[r(n[0]),n[1]]}):[],nt(function(n){for(var s=-1;++sat)return[];var r=St,n=Mt(t,St);e=$(e),t-=St;for(var s=Li(n,e);++r0||e<0)?new ut(r):(t<0?r=r.takeRight(-t):t&&(r=r.drop(t)),e!==i&&(e=Q(e),r=e<0?r.dropRight(-e):r.take(e-t)),r)},ut.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},ut.prototype.toArray=function(){return this.take(St)},de(ut.prototype,function(t,e){var r=/^(?:filter|find|map|reject)|While$/.test(e),n=/^(?:head|last)$/.test(e),s=u[n?"take"+(e=="last"?"Right":""):e],o=n||/^find/.test(e);!s||(u.prototype[e]=function(){var c=this.__wrapped__,p=n?[1]:arguments,v=c instanceof ut,P=p[0],R=v||j(c),q=function(st){var ot=s.apply(u,Me([st],p));return n&&U?ot[0]:ot};R&&r&&typeof P=="function"&&P.length!=1&&(v=R=!1);var U=this.__chain__,k=!!this.__actions__.length,G=o&&!U,rt=v&&!k;if(!o&&R){c=rt?c:new ut(this);var z=t.apply(c,p);return z.__actions__.push({func:An,args:[q],thisArg:i}),new jt(z,U)}return G&&rt?t.apply(this,p):(z=this.thru(q),G?n?z.value()[0]:z.value():z)})}),Zt(["pop","push","shift","sort","splice","unshift"],function(t){var e=rn[t],r=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",n=/^(?:pop|shift)$/.test(t);u.prototype[t]=function(){var s=arguments;if(n&&!this.__chain__){var o=this.value();return e.apply(j(o)?o:[],s)}return this[r](function(c){return e.apply(j(c)?c:[],s)})}}),de(ut.prototype,function(t,e){var r=u[e];if(r){var n=r.name+"";lt.call(ar,n)||(ar[n]=[]),ar[n].push({name:e,func:r})}}),ar[En(i,K).name]=[{name:"wrapper",func:i}],ut.prototype.clone=ic,ut.prototype.reverse=sc,ut.prototype.value=uc,u.prototype.at=Rp,u.prototype.chain=Fp,u.prototype.commit=qp,u.prototype.next=Xp,u.prototype.plant=Up,u.prototype.reverse=Wp,u.prototype.toJSON=u.prototype.valueOf=u.prototype.value=Hp,u.prototype.first=u.prototype.head,Or&&(u.prototype[Or]=Bp),u},Ne=ql();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(It._=Ne,define(function(){return Ne})):We?((We.exports=Ne)._=Ne,vi._=Ne):It._=Ne}).call(gr)});var me=tt((wa,Be)=>{(function(){var i,h,b,_,f,D,w,E={}.hasOwnProperty;i=function(T,...F){var M,m,A,X;if(f(Object.assign))Object.assign.apply(null,arguments);else for(M=0,A=F.length;M{(function(){var i;_a.exports=i=class{hasFeature(b,_){return!0}createDocumentType(b,_,f){throw new Error("This DOM method is not implemented.")}createDocument(b,_,f){throw new Error("This DOM method is not implemented.")}createHTMLDocument(b){throw new Error("This DOM method is not implemented.")}getFeature(b,_){throw new Error("This DOM method is not implemented.")}}}).call(ya)});var ba=tt((va,Da)=>{(function(){var i;Da.exports=i=class{constructor(){}handleError(b){throw new Error(b)}}}).call(va)});var xa=tt((Ta,Ea)=>{(function(){var i;Ea.exports=i=function(){class h{constructor(_){this.arr=_||[]}item(_){return this.arr[_]||null}contains(_){return this.arr.indexOf(_)!==-1}}return Object.defineProperty(h.prototype,"length",{get:function(){return this.arr.length}}),h}.call(this)}).call(Ta)});var La=tt((Ia,Oa)=>{(function(){var i,h,b;h=ba(),b=xa(),Oa.exports=i=function(){class _{constructor(){var D;this.defaultParams={"canonical-form":!1,"cdata-sections":!1,comments:!1,"datatype-normalization":!1,"element-content-whitespace":!0,entities:!0,"error-handler":new h,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=D=Object.create(this.defaultParams)}getParameter(D){return this.params.hasOwnProperty(D)?this.params[D]:null}canSetParameter(D,w){return!0}setParameter(D,w){return w!=null?this.params[D]=w:delete this.params[D]}}return Object.defineProperty(_.prototype,"parameterNames",{get:function(){return new b(Object.keys(this.defaultParams))}}),_}.call(this)}).call(Ia)});var Tt=tt((Ca,Ma)=>{(function(){Ma.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(Ca)});var Os=tt((Aa,Na)=>{(function(){var i,h,b;i=Tt(),b=zt(),Na.exports=h=function(){class _{constructor(D,w,E){if(this.parent=D,this.parent&&(this.options=this.parent.options,this.stringify=this.parent.stringify),w==null)throw new Error("Missing attribute name. "+this.debugInfo(w));this.name=this.stringify.name(w),this.value=this.stringify.attValue(E),this.type=i.Attribute,this.isId=!1,this.schemaTypeInfo=null}clone(){return Object.create(this)}toString(D){return this.options.writer.attribute(this,this.options.writer.filterOptions(D))}debugInfo(D){return D=D||this.name,D==null?"parent: <"+this.parent.name+">":"attribute: {"+D+"}, parent: <"+this.parent.name+">"}isEqualNode(D){return!(D.namespaceURI!==this.namespaceURI||D.prefix!==this.prefix||D.localName!==this.localName||D.value!==this.value)}}return Object.defineProperty(_.prototype,"nodeType",{get:function(){return this.type}}),Object.defineProperty(_.prototype,"ownerElement",{get:function(){return this.parent}}),Object.defineProperty(_.prototype,"textContent",{get:function(){return this.value},set:function(f){return this.value=f||""}}),Object.defineProperty(_.prototype,"namespaceURI",{get:function(){return""}}),Object.defineProperty(_.prototype,"prefix",{get:function(){return""}}),Object.defineProperty(_.prototype,"localName",{get:function(){return this.name}}),Object.defineProperty(_.prototype,"specified",{get:function(){return!0}}),_}.call(this)}).call(Aa)});var Wn=tt((Sa,Pa)=>{(function(){var i;Pa.exports=i=function(){class h{constructor(_){this.nodes=_}clone(){return this.nodes=null}getNamedItem(_){return this.nodes[_]}setNamedItem(_){var f;return f=this.nodes[_.nodeName],this.nodes[_.nodeName]=_,f||null}removeNamedItem(_){var f;return f=this.nodes[_],delete this.nodes[_],f||null}item(_){return this.nodes[Object.keys(this.nodes)[_]]||null}getNamedItemNS(_,f){throw new Error("This DOM method is not implemented.")}setNamedItemNS(_){throw new Error("This DOM method is not implemented.")}removeNamedItemNS(_,f){throw new Error("This DOM method is not implemented.")}}return Object.defineProperty(h.prototype,"length",{get:function(){return Object.keys(this.nodes).length||0}}),h}.call(this)}).call(Sa)});var Hn=tt((Ra,Fa)=>{(function(){var i,h,b,_,f,D,w,E,T={}.hasOwnProperty;({isObject:E,isFunction:w,getValue:D}=me()),f=zt(),i=Tt(),h=Os(),_=Wn(),Fa.exports=b=function(){class F extends f{constructor(m,A,X){var B,K,et,V;if(super(m),A==null)throw new Error("Missing element name. "+this.debugInfo());if(this.name=this.stringify.name(A),this.type=i.Element,this.attribs={},this.schemaTypeInfo=null,X!=null&&this.attribute(X),m.type===i.Document&&(this.isRoot=!0,this.documentObject=m,m.rootObject=this,m.children)){for(V=m.children,K=0,et=V.length;K=B;A=0<=B?++X:--X)if(!this.attribs[A].isEqualNode(m.attribs[A]))return!1;return!0}}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 _(this.attribs)),this.attributeMap}}),F}.call(this)}).call(Ra)});var Hr=tt((qa,Xa)=>{(function(){var i,h;h=zt(),Xa.exports=i=function(){class b extends h{constructor(f){super(f),this.value=""}clone(){return Object.create(this)}substringData(f,D){throw new Error("This DOM method is not implemented."+this.debugInfo())}appendData(f){throw new Error("This DOM method is not implemented."+this.debugInfo())}insertData(f,D){throw new Error("This DOM method is not implemented."+this.debugInfo())}deleteData(f,D){throw new Error("This DOM method is not implemented."+this.debugInfo())}replaceData(f,D,w){throw new Error("This DOM method is not implemented."+this.debugInfo())}isEqualNode(f){return!(!super.isEqualNode(f)||f.data!==this.data)}}return Object.defineProperty(b.prototype,"data",{get:function(){return this.value},set:function(_){return this.value=_||""}}),Object.defineProperty(b.prototype,"length",{get:function(){return this.value.length}}),Object.defineProperty(b.prototype,"textContent",{get:function(){return this.value},set:function(_){return this.value=_||""}}),b}.call(this)}).call(qa)});var kn=tt((Ba,Ua)=>{(function(){var i,h,b;i=Tt(),b=Hr(),Ua.exports=h=class extends b{constructor(f,D){if(super(f),D==null)throw new Error("Missing CDATA text. "+this.debugInfo());this.name="#cdata-section",this.type=i.CData,this.value=this.stringify.cdata(D)}clone(){return Object.create(this)}toString(f){return this.options.writer.cdata(this,this.options.writer.filterOptions(f))}}}).call(Ba)});var Kn=tt((Wa,Ha)=>{(function(){var i,h,b;i=Tt(),h=Hr(),Ha.exports=b=class extends h{constructor(f,D){if(super(f),D==null)throw new Error("Missing comment text. "+this.debugInfo());this.name="#comment",this.type=i.Comment,this.value=this.stringify.comment(D)}clone(){return Object.create(this)}toString(f){return this.options.writer.comment(this,this.options.writer.filterOptions(f))}}}).call(Wa)});var Vn=tt((ka,Ka)=>{(function(){var i,h,b,_;({isObject:_}=me()),b=zt(),i=Tt(),Ka.exports=h=class extends b{constructor(D,w,E,T){super(D),_(w)&&({version:w,encoding:E,standalone:T}=w),w||(w="1.0"),this.type=i.Declaration,this.version=this.stringify.xmlVersion(w),E!=null&&(this.encoding=this.stringify.xmlEncoding(E)),T!=null&&(this.standalone=this.stringify.xmlStandalone(T))}toString(D){return this.options.writer.declaration(this,this.options.writer.filterOptions(D))}}}).call(ka)});var $n=tt((Va,$a)=>{(function(){var i,h,b;b=zt(),i=Tt(),$a.exports=h=class extends b{constructor(f,D,w,E,T,F){if(super(f),D==null)throw new Error("Missing DTD element name. "+this.debugInfo());if(w==null)throw new Error("Missing DTD attribute name. "+this.debugInfo(D));if(!E)throw new Error("Missing DTD attribute type. "+this.debugInfo(D));if(!T)throw new Error("Missing DTD attribute default. "+this.debugInfo(D));if(T.indexOf("#")!==0&&(T="#"+T),!T.match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/))throw new Error("Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT. "+this.debugInfo(D));if(F&&!T.match(/^(#FIXED|#DEFAULT)$/))throw new Error("Default value only applies to #FIXED or #DEFAULT. "+this.debugInfo(D));this.elementName=this.stringify.name(D),this.type=i.AttributeDeclaration,this.attributeName=this.stringify.name(w),this.attributeType=this.stringify.dtdAttType(E),F&&(this.defaultValue=this.stringify.dtdAttDefault(F)),this.defaultValueType=T}toString(f){return this.options.writer.dtdAttList(this,this.options.writer.filterOptions(f))}}}).call(Va)});var Gn=tt((Ga,za)=>{(function(){var i,h,b,_;({isObject:_}=me()),b=zt(),i=Tt(),za.exports=h=function(){class f extends b{constructor(w,E,T,F){if(super(w),T==null)throw new Error("Missing DTD entity name. "+this.debugInfo(T));if(F==null)throw new Error("Missing DTD entity value. "+this.debugInfo(T));if(this.pe=!!E,this.name=this.stringify.name(T),this.type=i.EntityDeclaration,!_(F))this.value=this.stringify.dtdEntityValue(F),this.internal=!0;else{if(!F.pubID&&!F.sysID)throw new Error("Public and/or system identifiers are required for an external entity. "+this.debugInfo(T));if(F.pubID&&!F.sysID)throw new Error("System identifier is required for a public external entity. "+this.debugInfo(T));if(this.internal=!1,F.pubID!=null&&(this.pubID=this.stringify.dtdPubID(F.pubID)),F.sysID!=null&&(this.sysID=this.stringify.dtdSysID(F.sysID)),F.nData!=null&&(this.nData=this.stringify.dtdNData(F.nData)),this.pe&&this.nData)throw new Error("Notation declaration is not allowed in a parameter entity. "+this.debugInfo(T))}}toString(w){return this.options.writer.dtdEntity(this,this.options.writer.filterOptions(w))}}return Object.defineProperty(f.prototype,"publicId",{get:function(){return this.pubID}}),Object.defineProperty(f.prototype,"systemId",{get:function(){return this.sysID}}),Object.defineProperty(f.prototype,"notationName",{get:function(){return this.nData||null}}),Object.defineProperty(f.prototype,"inputEncoding",{get:function(){return null}}),Object.defineProperty(f.prototype,"xmlEncoding",{get:function(){return null}}),Object.defineProperty(f.prototype,"xmlVersion",{get:function(){return null}}),f}.call(this)}).call(Ga)});var zn=tt((Ya,Za)=>{(function(){var i,h,b;b=zt(),i=Tt(),Za.exports=h=class extends b{constructor(f,D,w){if(super(f),D==null)throw new Error("Missing DTD element name. "+this.debugInfo());w||(w="(#PCDATA)"),Array.isArray(w)&&(w="("+w.join(",")+")"),this.name=this.stringify.name(D),this.type=i.ElementDeclaration,this.value=this.stringify.dtdElementValue(w)}toString(f){return this.options.writer.dtdElement(this,this.options.writer.filterOptions(f))}}}).call(Ya)});var Yn=tt((Ja,ja)=>{(function(){var i,h,b;b=zt(),i=Tt(),ja.exports=h=function(){class _ extends b{constructor(D,w,E){if(super(D),w==null)throw new Error("Missing DTD notation name. "+this.debugInfo(w));if(!E.pubID&&!E.sysID)throw new Error("Public or system identifiers are required for an external entity. "+this.debugInfo(w));this.name=this.stringify.name(w),this.type=i.NotationDeclaration,E.pubID!=null&&(this.pubID=this.stringify.dtdPubID(E.pubID)),E.sysID!=null&&(this.sysID=this.stringify.dtdSysID(E.sysID))}toString(D){return this.options.writer.dtdNotation(this,this.options.writer.filterOptions(D))}}return Object.defineProperty(_.prototype,"publicId",{get:function(){return this.pubID}}),Object.defineProperty(_.prototype,"systemId",{get:function(){return this.sysID}}),_}.call(this)}).call(Ja)});var Zn=tt((Qa,th)=>{(function(){var i,h,b,_,f,D,w,E,T;({isObject:T}=me()),E=zt(),i=Tt(),h=$n(),_=Gn(),b=zn(),f=Yn(),w=Wn(),th.exports=D=function(){class F extends E{constructor(m,A,X){var B,K,et,V;if(super(m),this.type=i.DocType,m.children){for(V=m.children,K=0,et=V.length;K{(function(){var i,h,b;i=Tt(),h=zt(),rh.exports=b=class extends h{constructor(f,D){if(super(f),D==null)throw new Error("Missing raw text. "+this.debugInfo());this.type=i.Raw,this.value=this.stringify.raw(D)}clone(){return Object.create(this)}toString(f){return this.options.writer.raw(this,this.options.writer.filterOptions(f))}}}).call(eh)});var jn=tt((nh,ih)=>{(function(){var i,h,b;i=Tt(),h=Hr(),ih.exports=b=function(){class _ extends h{constructor(D,w){if(super(D),w==null)throw new Error("Missing element text. "+this.debugInfo());this.name="#text",this.type=i.Text,this.value=this.stringify.text(w)}clone(){return Object.create(this)}toString(D){return this.options.writer.text(this,this.options.writer.filterOptions(D))}splitText(D){throw new Error("This DOM method is not implemented."+this.debugInfo())}replaceWholeText(D){throw new Error("This DOM method is not implemented."+this.debugInfo())}}return Object.defineProperty(_.prototype,"isElementContentWhitespace",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),Object.defineProperty(_.prototype,"wholeText",{get:function(){var f,D,w;for(w="",D=this.previousSibling;D;)w=D.data+w,D=D.previousSibling;for(w+=this.data,f=this.nextSibling;f;)w=w+f.data,f=f.nextSibling;return w}}),_}.call(this)}).call(nh)});var Qn=tt((sh,uh)=>{(function(){var i,h,b;i=Tt(),h=Hr(),uh.exports=b=class extends h{constructor(f,D,w){if(super(f),D==null)throw new Error("Missing instruction target. "+this.debugInfo());this.type=i.ProcessingInstruction,this.target=this.stringify.insTarget(D),this.name=this.target,w&&(this.value=this.stringify.insValue(w))}clone(){return Object.create(this)}toString(f){return this.options.writer.processingInstruction(this,this.options.writer.filterOptions(f))}isEqualNode(f){return!(!super.isEqualNode(f)||f.target!==this.target)}}}).call(sh)});var Ls=tt((oh,ah)=>{(function(){var i,h,b;b=zt(),i=Tt(),ah.exports=h=class extends b{constructor(f){super(f),this.type=i.Dummy}clone(){return Object.create(this)}toString(f){return""}}}).call(oh)});var lh=tt((hh,fh)=>{(function(){var i;fh.exports=i=function(){class h{constructor(_){this.nodes=_}clone(){return this.nodes=null}item(_){return this.nodes[_]||null}}return Object.defineProperty(h.prototype,"length",{get:function(){return this.nodes.length||0}}),h}.call(this)}).call(hh)});var ph=tt((ch,dh)=>{(function(){dh.exports={Disconnected:1,Preceding:2,Following:4,Contains:8,ContainedBy:16,ImplementationSpecific:32}}).call(ch)});var zt=tt((gh,mh)=>{(function(){var i,h,b,_,f,D,w,E,T,F,M,m,A,X,B,K,et,V,_t={}.hasOwnProperty,g=[].splice;({isObject:V,isFunction:et,isEmpty:K,getValue:B}=me()),E=null,b=null,_=null,f=null,D=null,A=null,X=null,m=null,w=null,h=null,M=null,T=null,i=null,mh.exports=F=function(){class d{constructor(a){this.parent=a,this.parent&&(this.options=this.parent.options,this.stringify=this.parent.stringify),this.value=null,this.children=[],this.baseURI=null,E||(E=Hn(),b=kn(),_=Kn(),f=Vn(),D=Zn(),A=Jn(),X=jn(),m=Qn(),w=Ls(),h=Tt(),M=lh(),T=Wn(),i=ph())}setParent(a){var x,C,l,I,S;for(this.parent=a,a&&(this.options=a.options,this.stringify=a.stringify),I=this.children,S=[],C=0,l=I.length;C":(C=this.parent)!=null&&C.name?"node: <"+a+">, parent: <"+this.parent.name+">":"node: <"+a+">"}ele(a,x,C){return this.element(a,x,C)}nod(a,x,C){return this.node(a,x,C)}txt(a){return this.text(a)}dat(a){return this.cdata(a)}com(a){return this.comment(a)}ins(a,x){return this.instruction(a,x)}doc(){return this.document()}dec(a,x,C){return this.declaration(a,x,C)}e(a,x,C){return this.element(a,x,C)}n(a,x,C){return this.node(a,x,C)}t(a){return this.text(a)}d(a){return this.cdata(a)}c(a){return this.comment(a)}r(a){return this.raw(a)}i(a,x){return this.instruction(a,x)}u(){return this.up()}importXMLBuilder(a){return this.importDocument(a)}attribute(a,x){throw new Error("attribute() applies to element nodes only.")}att(a,x){return this.attribute(a,x)}a(a,x){return this.attribute(a,x)}removeAttribute(a){throw new Error("attribute() applies to element nodes only.")}replaceChild(a,x){throw new Error("This DOM method is not implemented."+this.debugInfo())}removeChild(a){throw new Error("This DOM method is not implemented."+this.debugInfo())}appendChild(a){throw new Error("This DOM method is not implemented."+this.debugInfo())}hasChildNodes(){return this.children.length!==0}cloneNode(a){throw new Error("This DOM method is not implemented."+this.debugInfo())}normalize(){throw new Error("This DOM method is not implemented."+this.debugInfo())}isSupported(a,x){return!0}hasAttributes(){return this.attribs.length!==0}compareDocumentPosition(a){var x,C;return x=this,x===a?0:this.document()!==a.document()?(C=i.Disconnected|i.ImplementationSpecific,Math.random()<.5?C|=i.Preceding:C|=i.Following,C):x.isAncestor(a)?i.Contains|i.Preceding:x.isDescendant(a)?i.Contains|i.Following:x.isPreceding(a)?i.Preceding:i.Following}isSameNode(a){throw new Error("This DOM method is not implemented."+this.debugInfo())}lookupPrefix(a){throw new Error("This DOM method is not implemented."+this.debugInfo())}isDefaultNamespace(a){throw new Error("This DOM method is not implemented."+this.debugInfo())}lookupNamespaceURI(a){throw new Error("This DOM method is not implemented."+this.debugInfo())}isEqualNode(a){var x,C,l;if(a.nodeType!==this.nodeType||a.children.length!==this.children.length)return!1;for(x=C=0,l=this.children.length-1;0<=l?C<=l:C>=l;x=0<=l?++C:--C)if(!this.children[x].isEqualNode(a.children[x]))return!1;return!0}getFeature(a,x){throw new Error("This DOM method is not implemented."+this.debugInfo())}setUserData(a,x,C){throw new Error("This DOM method is not implemented."+this.debugInfo())}getUserData(a){throw new Error("This DOM method is not implemented."+this.debugInfo())}contains(a){return a?a===this||this.isDescendant(a):!1}isDescendant(a){var x,C,l,I,S;for(S=this.children,l=0,I=S.length;lC}treePosition(a){var x,C;return C=0,x=!1,this.foreachTreeNode(this.document(),function(l){if(C++,!x&&l===a)return x=!0}),x?C:-1}foreachTreeNode(a,x){var C,l,I,S,H;for(a||(a=this.document()),S=a.children,l=0,I=S.length;l{(function(){var i,h={}.hasOwnProperty;yh.exports=i=function(){class b{constructor(f){var D,w,E;this.assertLegalChar=this.assertLegalChar.bind(this),this.assertLegalName=this.assertLegalName.bind(this),f||(f={}),this.options=f,this.options.version||(this.options.version="1.0"),w=f.stringify||{};for(D in w)!h.call(w,D)||(E=w[D],this[D]=E)}name(f){return this.options.noValidation?f:this.assertLegalName(""+f||"")}text(f){return this.options.noValidation?f:this.assertLegalChar(this.textEscape(""+f||""))}cdata(f){return this.options.noValidation?f:(f=""+f||"",f=f.replace("]]>","]]]]>"),this.assertLegalChar(f))}comment(f){if(this.options.noValidation)return f;if(f=""+f||"",f.match(/--/))throw new Error("Comment text cannot contain double-hypen: "+f);return this.assertLegalChar(f)}raw(f){return this.options.noValidation?f:""+f||""}attValue(f){return this.options.noValidation?f:this.assertLegalChar(this.attEscape(f=""+f||""))}insTarget(f){return this.options.noValidation?f:this.assertLegalChar(""+f||"")}insValue(f){if(this.options.noValidation)return f;if(f=""+f||"",f.match(/\?>/))throw new Error("Invalid processing instruction value: "+f);return this.assertLegalChar(f)}xmlVersion(f){if(this.options.noValidation)return f;if(f=""+f||"",!f.match(/1\.[0-9]+/))throw new Error("Invalid version number: "+f);return f}xmlEncoding(f){if(this.options.noValidation)return f;if(f=""+f||"",!f.match(/^[A-Za-z](?:[A-Za-z0-9._-])*$/))throw new Error("Invalid encoding: "+f);return this.assertLegalChar(f)}xmlStandalone(f){return this.options.noValidation?f:f?"yes":"no"}dtdPubID(f){return this.options.noValidation?f:this.assertLegalChar(""+f||"")}dtdSysID(f){return this.options.noValidation?f:this.assertLegalChar(""+f||"")}dtdElementValue(f){return this.options.noValidation?f:this.assertLegalChar(""+f||"")}dtdAttType(f){return this.options.noValidation?f:this.assertLegalChar(""+f||"")}dtdAttDefault(f){return this.options.noValidation?f:this.assertLegalChar(""+f||"")}dtdEntityValue(f){return this.options.noValidation?f:this.assertLegalChar(""+f||"")}dtdNData(f){return this.options.noValidation?f:this.assertLegalChar(""+f||"")}assertLegalChar(f){var D,w;if(this.options.noValidation)return f;if(this.options.version==="1.0"){if(D=/[\0-\x08\x0B\f\x0E-\x1F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/g,this.options.invalidCharReplacement!==void 0)f=f.replace(D,this.options.invalidCharReplacement);else if(w=f.match(D))throw new Error(`Invalid character in string: ${f} at index ${w.index}`)}else if(this.options.version==="1.1"){if(D=/[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/g,this.options.invalidCharReplacement!==void 0)f=f.replace(D,this.options.invalidCharReplacement);else if(w=f.match(D))throw new Error(`Invalid character in string: ${f} at index ${w.index}`)}return f}assertLegalName(f){var D;if(this.options.noValidation)return f;if(f=this.assertLegalChar(f),D=/^([: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])*$/,!f.match(D))throw new Error(`Invalid character in name: ${f}`);return f}textEscape(f){var D;return this.options.noValidation?f:(D=this.options.noDoubleEncoding?/(?!&(lt|gt|amp|apos|quot);)&/g:/&/g,f.replace(D,"&").replace(//g,">").replace(/\r/g," "))}attEscape(f){var D;return this.options.noValidation?f:(D=this.options.noDoubleEncoding?/(?!&(lt|gt|amp|apos|quot);)&/g:/&/g,f.replace(D,"&").replace(/{(function(){vh.exports={None:0,OpenTag:1,InsideTag:2,CloseTag:3}}).call(_h)});var Ms=tt((Dh,bh)=>{(function(){var i,h,b,_,f,D,w,E,T,F,M,m,A,X,B,K,et,V={}.hasOwnProperty;({assign:et}=me()),i=Tt(),T=Vn(),F=Zn(),b=kn(),_=Kn(),m=Hn(),X=Jn(),B=jn(),A=Qn(),M=Ls(),f=$n(),D=zn(),w=Gn(),E=Yn(),h=kr(),bh.exports=K=class{constructor(g){var d,O,a;g||(g={}),this.options=g,O=g.writer||{};for(d in O)!V.call(O,d)||(a=O[d],this["_"+d]=this[d],this[d]=a)}filterOptions(g){var d,O,a,x,C,l,I,S,H;return g||(g={}),g=et({},this.options,g),d={writer:this},d.pretty=g.pretty||!1,d.allowEmpty=g.allowEmpty||!1,d.indent=(O=g.indent)!=null?O:" ",d.newline=(a=g.newline)!=null?a:` +`,d.offset=(x=g.offset)!=null?x:0,d.width=(C=g.width)!=null?C:0,d.dontPrettyTextNodes=(l=(I=g.dontPrettyTextNodes)!=null?I:g.dontprettytextnodes)!=null?l:0,d.spaceBeforeSlash=(S=(H=g.spaceBeforeSlash)!=null?H:g.spacebeforeslash)!=null?S:"",d.spaceBeforeSlash===!0&&(d.spaceBeforeSlash=" "),d.suppressPrettyCount=0,d.user={},d.state=h.None,d}indent(g,d,O){var a;return!d.pretty||d.suppressPrettyCount?"":d.pretty&&(a=(O||0)+d.offset+1,a>0)?new Array(a).join(d.indent):""}endline(g,d,O){return!d.pretty||d.suppressPrettyCount?"":d.newline}attribute(g,d,O){var a;return this.openAttribute(g,d,O),d.pretty&&d.width>0?a=g.name+'="'+g.value+'"':a=" "+g.name+'="'+g.value+'"',this.closeAttribute(g,d,O),a}cdata(g,d,O){var a;return this.openNode(g,d,O),d.state=h.OpenTag,a=this.indent(g,d,O)+""+this.endline(g,d,O),d.state=h.None,this.closeNode(g,d,O),a}comment(g,d,O){var a;return this.openNode(g,d,O),d.state=h.OpenTag,a=this.indent(g,d,O)+""+this.endline(g,d,O),d.state=h.None,this.closeNode(g,d,O),a}declaration(g,d,O){var a;return this.openNode(g,d,O),d.state=h.OpenTag,a=this.indent(g,d,O)+"",a+=this.endline(g,d,O),d.state=h.None,this.closeNode(g,d,O),a}docType(g,d,O){var a,x,C,l,I;if(O||(O=0),this.openNode(g,d,O),d.state=h.OpenTag,l=this.indent(g,d,O),l+="0){for(l+=" [",l+=this.endline(g,d,O),d.state=h.InsideTag,I=g.children,x=0,C=I.length;x",l+=this.endline(g,d,O),d.state=h.None,this.closeNode(g,d,O),l}element(g,d,O){var a,x,C,l,I,S,H,Y,J,pt,at,it,vt,St,je,Qe,yr,ce,ie;if(O||(O=0),it=!1,this.openNode(g,d,O),d.state=h.OpenTag,vt=this.indent(g,d,O)+"<"+g.name,d.pretty&&d.width>0){Y=vt.length,je=g.attribs;for(at in je)!V.call(je,at)||(a=je[at],St=this.attribute(a,d,O),x=St.length,Y+x>d.width?(ie=this.indent(g,d,O+1)+St,vt+=this.endline(g,d,O)+ie,Y=ie.length):(ie=" "+St,vt+=ie,Y+=ie.length))}else{Qe=g.attribs;for(at in Qe)!V.call(Qe,at)||(a=Qe[at],vt+=this.attribute(a,d,O))}if(l=g.children.length,I=l===0?null:g.children[0],l===0||g.children.every(function(tr){return(tr.type===i.Text||tr.type===i.Raw||tr.type===i.CData)&&tr.value===""}))d.allowEmpty?(vt+=">",d.state=h.CloseTag,vt+=""+this.endline(g,d,O)):(d.state=h.CloseTag,vt+=d.spaceBeforeSlash+"/>"+this.endline(g,d,O));else if(d.pretty&&l===1&&(I.type===i.Text||I.type===i.Raw||I.type===i.CData)&&I.value!=null)vt+=">",d.state=h.InsideTag,d.suppressPrettyCount++,it=!0,vt+=this.writeChildNode(I,d,O+1),d.suppressPrettyCount--,it=!1,d.state=h.CloseTag,vt+=""+this.endline(g,d,O);else{if(d.dontPrettyTextNodes){for(yr=g.children,S=0,J=yr.length;S"+this.endline(g,d,O),d.state=h.InsideTag,ce=g.children,H=0,pt=ce.length;H",it&&d.suppressPrettyCount--,vt+=this.endline(g,d,O),d.state=h.None}return this.closeNode(g,d,O),vt}writeChildNode(g,d,O){switch(g.type){case i.CData:return this.cdata(g,d,O);case i.Comment:return this.comment(g,d,O);case i.Element:return this.element(g,d,O);case i.Raw:return this.raw(g,d,O);case i.Text:return this.text(g,d,O);case i.ProcessingInstruction:return this.processingInstruction(g,d,O);case i.Dummy:return"";case i.Declaration:return this.declaration(g,d,O);case i.DocType:return this.docType(g,d,O);case i.AttributeDeclaration:return this.dtdAttList(g,d,O);case i.ElementDeclaration:return this.dtdElement(g,d,O);case i.EntityDeclaration:return this.dtdEntity(g,d,O);case i.NotationDeclaration:return this.dtdNotation(g,d,O);default:throw new Error("Unknown XML node type: "+g.constructor.name)}}processingInstruction(g,d,O){var a;return this.openNode(g,d,O),d.state=h.OpenTag,a=this.indent(g,d,O)+"",a+=this.endline(g,d,O),d.state=h.None,this.closeNode(g,d,O),a}raw(g,d,O){var a;return this.openNode(g,d,O),d.state=h.OpenTag,a=this.indent(g,d,O),d.state=h.InsideTag,a+=g.value,d.state=h.CloseTag,a+=this.endline(g,d,O),d.state=h.None,this.closeNode(g,d,O),a}text(g,d,O){var a;return this.openNode(g,d,O),d.state=h.OpenTag,a=this.indent(g,d,O),d.state=h.InsideTag,a+=g.value,d.state=h.CloseTag,a+=this.endline(g,d,O),d.state=h.None,this.closeNode(g,d,O),a}dtdAttList(g,d,O){var a;return this.openNode(g,d,O),d.state=h.OpenTag,a=this.indent(g,d,O)+""+this.endline(g,d,O),d.state=h.None,this.closeNode(g,d,O),a}dtdElement(g,d,O){var a;return this.openNode(g,d,O),d.state=h.OpenTag,a=this.indent(g,d,O)+""+this.endline(g,d,O),d.state=h.None,this.closeNode(g,d,O),a}dtdEntity(g,d,O){var a;return this.openNode(g,d,O),d.state=h.OpenTag,a=this.indent(g,d,O)+""+this.endline(g,d,O),d.state=h.None,this.closeNode(g,d,O),a}dtdNotation(g,d,O){var a;return this.openNode(g,d,O),d.state=h.OpenTag,a=this.indent(g,d,O)+""+this.endline(g,d,O),d.state=h.None,this.closeNode(g,d,O),a}openNode(g,d,O){}closeNode(g,d,O){}openAttribute(g,d,O){}closeAttribute(g,d,O){}}}).call(Dh)});var ti=tt((Th,Eh)=>{(function(){var i,h;h=Ms(),Eh.exports=i=class extends h{constructor(_){super(_)}document(_,f){var D,w,E,T,F;for(f=this.filterOptions(f),T="",F=_.children,w=0,E=F.length;w{(function(){var i,h,b,_,f,D,w,E;({isPlainObject:E}=me()),b=Is(),h=La(),f=zt(),i=Tt(),w=Cs(),D=ti(),Ih.exports=_=function(){class T extends f{constructor(M){super(null),this.name="#document",this.type=i.Document,this.documentURI=null,this.domConfig=new h,M||(M={}),M.writer||(M.writer=new D),this.options=M,this.stringify=new w(M)}end(M){var m;return m={},M?E(M)&&(m=M,M=this.options.writer):M=this.options.writer,M.document(this,M.filterOptions(m))}toString(M){return this.options.writer.document(this,this.options.writer.filterOptions(M))}createElement(M){throw new Error("This DOM method is not implemented."+this.debugInfo())}createDocumentFragment(){throw new Error("This DOM method is not implemented."+this.debugInfo())}createTextNode(M){throw new Error("This DOM method is not implemented."+this.debugInfo())}createComment(M){throw new Error("This DOM method is not implemented."+this.debugInfo())}createCDATASection(M){throw new Error("This DOM method is not implemented."+this.debugInfo())}createProcessingInstruction(M,m){throw new Error("This DOM method is not implemented."+this.debugInfo())}createAttribute(M){throw new Error("This DOM method is not implemented."+this.debugInfo())}createEntityReference(M){throw new Error("This DOM method is not implemented."+this.debugInfo())}getElementsByTagName(M){throw new Error("This DOM method is not implemented."+this.debugInfo())}importNode(M,m){throw new Error("This DOM method is not implemented."+this.debugInfo())}createElementNS(M,m){throw new Error("This DOM method is not implemented."+this.debugInfo())}createAttributeNS(M,m){throw new Error("This DOM method is not implemented."+this.debugInfo())}getElementsByTagNameNS(M,m){throw new Error("This DOM method is not implemented."+this.debugInfo())}getElementById(M){throw new Error("This DOM method is not implemented."+this.debugInfo())}adoptNode(M){throw new Error("This DOM method is not implemented."+this.debugInfo())}normalizeDocument(){throw new Error("This DOM method is not implemented."+this.debugInfo())}renameNode(M,m,A){throw new Error("This DOM method is not implemented."+this.debugInfo())}getElementsByClassName(M){throw new Error("This DOM method is not implemented."+this.debugInfo())}createEvent(M){throw new Error("This DOM method is not implemented."+this.debugInfo())}createRange(){throw new Error("This DOM method is not implemented."+this.debugInfo())}createNodeIterator(M,m,A){throw new Error("This DOM method is not implemented."+this.debugInfo())}createTreeWalker(M,m,A){throw new Error("This DOM method is not implemented."+this.debugInfo())}}return Object.defineProperty(T.prototype,"implementation",{value:new b}),Object.defineProperty(T.prototype,"doctype",{get:function(){var F,M,m,A;for(A=this.children,M=0,m=A.length;M{(function(){var i,h,b,_,f,D,w,E,T,F,M,m,A,X,B,K,et,V,_t,g,d,O,a,x={}.hasOwnProperty;({isObject:O,isFunction:d,isPlainObject:a,getValue:g}=me()),i=Tt(),m=As(),X=Hn(),_=kn(),f=Kn(),K=Jn(),_t=jn(),B=Qn(),F=Vn(),M=Zn(),D=$n(),E=Gn(),w=zn(),T=Yn(),b=Os(),V=Cs(),et=ti(),h=kr(),Lh.exports=A=class{constructor(l,I,S){var H;this.name="?xml",this.type=i.Document,l||(l={}),H={},l.writer?a(l.writer)&&(H=l.writer,l.writer=new et):l.writer=new et,this.options=l,this.writer=l.writer,this.writerOptions=this.writer.filterOptions(H),this.stringify=new V(l),this.onDataCallback=I||function(){},this.onEndCallback=S||function(){},this.currentNode=null,this.currentLevel=-1,this.openTags={},this.documentStarted=!1,this.documentCompleted=!1,this.root=null}createChildNode(l){var I,S,H,Y,J,pt,at,it;switch(l.type){case i.CData:this.cdata(l.value);break;case i.Comment:this.comment(l.value);break;case i.Element:H={},at=l.attribs;for(S in at)!x.call(at,S)||(I=at[S],H[S]=I.value);this.node(l.name,H);break;case i.Dummy:this.dummy();break;case i.Raw:this.raw(l.value);break;case i.Text:this.text(l.value);break;case i.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(it=l.children,J=0,pt=it.length;J=0;)this.up();return this.onEnd()}openCurrent(){if(this.currentNode)return this.currentNode.children=!0,this.openNode(this.currentNode)}openNode(l){var I,S,H,Y;if(!l.isOpen){if(!this.root&&this.currentLevel===0&&l.type===i.Element&&(this.root=l),S="",l.type===i.Element){this.writerOptions.state=h.OpenTag,S=this.writer.indent(l,this.writerOptions,this.currentLevel)+"<"+l.name,Y=l.attribs;for(H in Y)!x.call(Y,H)||(I=Y[H],S+=this.writer.attribute(I,this.writerOptions,this.currentLevel));S+=(l.children?">":"/>")+this.writer.endline(l,this.writerOptions,this.currentLevel),this.writerOptions.state=h.InsideTag}else this.writerOptions.state=h.OpenTag,S=this.writer.indent(l,this.writerOptions,this.currentLevel)+""),S+=this.writer.endline(l,this.writerOptions,this.currentLevel);return this.onData(S,this.currentLevel),l.isOpen=!0}}closeNode(l){var I;if(!l.isClosed)return I="",this.writerOptions.state=h.CloseTag,l.type===i.Element?I=this.writer.indent(l,this.writerOptions,this.currentLevel)+""+this.writer.endline(l,this.writerOptions,this.currentLevel):I=this.writer.indent(l,this.writerOptions,this.currentLevel)+"]>"+this.writer.endline(l,this.writerOptions,this.currentLevel),this.writerOptions.state=h.None,this.onData(I,this.currentLevel),l.isClosed=!0}onData(l,I){return this.documentStarted=!0,this.onDataCallback(l,I+1)}onEnd(){return this.documentCompleted=!0,this.onEndCallback()}debugInfo(l){return l==null?"":"node: <"+l+">"}ele(){return this.element(...arguments)}nod(l,I,S){return this.node(l,I,S)}txt(l){return this.text(l)}dat(l){return this.cdata(l)}com(l){return this.comment(l)}ins(l,I){return this.instruction(l,I)}dec(l,I,S){return this.declaration(l,I,S)}dtd(l,I,S){return this.doctype(l,I,S)}e(l,I,S){return this.element(l,I,S)}n(l,I,S){return this.node(l,I,S)}t(l){return this.text(l)}d(l){return this.cdata(l)}c(l){return this.comment(l)}r(l){return this.raw(l)}i(l,I){return this.instruction(l,I)}att(){return this.currentNode&&this.currentNode.type===i.DocType?this.attList(...arguments):this.attribute(...arguments)}a(){return this.currentNode&&this.currentNode.type===i.DocType?this.attList(...arguments):this.attribute(...arguments)}ent(l,I){return this.entity(l,I)}pent(l,I){return this.pEntity(l,I)}not(l,I){return this.notation(l,I)}}}).call(Oh)});var Nh=tt((Mh,Ah)=>{(function(){var i,h,b,_,f={}.hasOwnProperty;i=Tt(),_=Ms(),h=kr(),Ah.exports=b=class extends _{constructor(w,E){super(E),this.stream=w}endline(w,E,T){return w.isLastRootNode&&E.state===h.CloseTag?"":super.endline(w,E,T)}document(w,E){var T,F,M,m,A,X,B,K,et;for(B=w.children,F=M=0,A=B.length;M0){for(this.stream.write(" ["),this.stream.write(this.endline(w,E,T)),E.state=h.InsideTag,A=w.children,M=0,m=A.length;M"),this.stream.write(this.endline(w,E,T)),E.state=h.None,this.closeNode(w,E,T)}element(w,E,T){var F,M,m,A,X,B,K,et,V,_t,g,d,O,a,x,C;if(T||(T=0),this.openNode(w,E,T),E.state=h.OpenTag,g=this.indent(w,E,T)+"<"+w.name,E.pretty&&E.width>0){K=g.length,O=w.attribs;for(V in O)!f.call(O,V)||(F=O[V],d=this.attribute(F,E,T),M=d.length,K+M>E.width?(C=this.indent(w,E,T+1)+d,g+=this.endline(w,E,T)+C,K=C.length):(C=" "+d,g+=C,K+=C.length))}else{a=w.attribs;for(V in a)!f.call(a,V)||(F=a[V],g+=this.attribute(F,E,T))}if(this.stream.write(g),A=w.children.length,X=A===0?null:w.children[0],A===0||w.children.every(function(l){return(l.type===i.Text||l.type===i.Raw||l.type===i.CData)&&l.value===""}))E.allowEmpty?(this.stream.write(">"),E.state=h.CloseTag,this.stream.write("")):(E.state=h.CloseTag,this.stream.write(E.spaceBeforeSlash+"/>"));else if(E.pretty&&A===1&&(X.type===i.Text||X.type===i.Raw||X.type===i.CData)&&X.value!=null)this.stream.write(">"),E.state=h.InsideTag,E.suppressPrettyCount++,_t=!0,this.writeChildNode(X,E,T+1),E.suppressPrettyCount--,_t=!1,E.state=h.CloseTag,this.stream.write("");else{for(this.stream.write(">"+this.endline(w,E,T)),E.state=h.InsideTag,x=w.children,B=0,et=x.length;B")}return this.stream.write(this.endline(w,E,T)),E.state=h.None,this.closeNode(w,E,T)}processingInstruction(w,E,T){return this.stream.write(super.processingInstruction(w,E,T))}raw(w,E,T){return this.stream.write(super.raw(w,E,T))}text(w,E,T){return this.stream.write(super.text(w,E,T))}dtdAttList(w,E,T){return this.stream.write(super.dtdAttList(w,E,T))}dtdElement(w,E,T){return this.stream.write(super.dtdElement(w,E,T))}dtdEntity(w,E,T){return this.stream.write(super.dtdEntity(w,E,T))}dtdNotation(w,E,T){return this.stream.write(super.dtdNotation(w,E,T))}}}).call(Mh)});var Ph=tt((Sh,Ue)=>{(function(){var i,h,b,_,f,D,w,E,T;({assign:E,isFunction:T}=me()),b=Is(),_=As(),f=Ch(),w=ti(),D=Nh(),i=Tt(),h=kr(),Ue.exports.create=function(F,M,m,A){var X,B;if(F==null)throw new Error("Root element needs a name.");return A=E({},M,m,A),X=new _(A),B=X.element(F),A.headless||(X.declaration(A),(A.pubID!=null||A.sysID!=null)&&X.dtd(A)),B},Ue.exports.begin=function(F,M,m){return T(F)&&([M,m]=[F,M],F={}),M?new f(F,M,m):new _(F)},Ue.exports.stringWriter=function(F){return new w(F)},Ue.exports.streamWriter=function(F,M){return new D(F,M)},Ue.exports.implementation=new b,Ue.exports.nodeType=i,Ue.exports.writerState=h}).call(Sh)});var Uh=tt((Xy,Ns)=>{"use strict";var ei=Gt("fs"),Oe=Gt("path"),{promisify:Rh}=Gt("util"),ry=Gt("semver"),Fh=ry.satisfies(process.version,">=10.12.0"),qh=i=>{if(process.platform==="win32"&&/[<>:"|?*]/.test(i.replace(Oe.parse(i).root,""))){let b=new Error(`Path contains invalid characters: ${i}`);throw b.code="EINVAL",b}},Xh=i=>({...{mode:511,fs:ei},...i}),Bh=i=>{let h=new Error(`operation not permitted, mkdir '${i}'`);return h.code="EPERM",h.errno=-4048,h.path=i,h.syscall="mkdir",h},ny=async(i,h)=>{qh(i),h=Xh(h);let b=Rh(h.fs.mkdir),_=Rh(h.fs.stat);if(Fh&&h.fs.mkdir===ei.mkdir){let D=Oe.resolve(i);return await b(D,{mode:h.mode,recursive:!0}),D}let f=async D=>{try{return await b(D,h.mode),D}catch(w){if(w.code==="EPERM")throw w;if(w.code==="ENOENT"){if(Oe.dirname(D)===D)throw Bh(D);if(w.message.includes("null bytes"))throw w;return await f(Oe.dirname(D)),f(D)}try{if(!(await _(D)).isDirectory())throw new Error("The path is not a directory")}catch{throw w}return D}};return f(Oe.resolve(i))};Ns.exports=ny;Ns.exports.sync=(i,h)=>{if(qh(i),h=Xh(h),Fh&&h.fs.mkdirSync===ei.mkdirSync){let _=Oe.resolve(i);return ei.mkdirSync(_,{mode:h.mode,recursive:!0}),_}let b=_=>{try{h.fs.mkdirSync(_,h.mode)}catch(f){if(f.code==="EPERM")throw f;if(f.code==="ENOENT"){if(Oe.dirname(_)===_)throw Bh(_);if(f.message.includes("null bytes"))throw f;return b(Oe.dirname(_)),b(_)}try{if(!h.fs.statSync(_).isDirectory())throw new Error("The path is not a directory")}catch{throw f}}return _};return b(Oe.resolve(i))}});var kh=tt((By,ne)=>{"use strict";function Wh(i,h){for(var b=i.toString();b.length-1?f:D,E=Ze(h.getHours()),T=Ze(h.getMinutes()),F=Ze(h.getSeconds()),M=Wh(h.getMilliseconds(),3),m=iy(h.getTimezoneOffset()),A=i.replace(/dd/g,b).replace(/MM/g,_).replace(/y{1,4}/g,w).replace(/hh/g,E).replace(/mm/g,T).replace(/ss/g,F).replace(/SSS/g,M).replace(/O/g,m);return A}function Je(i,h,b,_){i["set"+(_?"":"UTC")+h](b)}function sy(i,h,b){var _=i.indexOf("O")<0,f=[{pattern:/y{1,4}/,regexp:"\\d{1,4}",fn:function(M,m){Je(M,"FullYear",m,_)}},{pattern:/MM/,regexp:"\\d{1,2}",fn:function(M,m){Je(M,"Month",m-1,_)}},{pattern:/dd/,regexp:"\\d{1,2}",fn:function(M,m){Je(M,"Date",m,_)}},{pattern:/hh/,regexp:"\\d{1,2}",fn:function(M,m){Je(M,"Hours",m,_)}},{pattern:/mm/,regexp:"\\d\\d",fn:function(M,m){Je(M,"Minutes",m,_)}},{pattern:/ss/,regexp:"\\d\\d",fn:function(M,m){Je(M,"Seconds",m,_)}},{pattern:/SSS/,regexp:"\\d\\d\\d",fn:function(M,m){Je(M,"Milliseconds",m,_)}},{pattern:/O/,regexp:"[+-]\\d{1,2}:?\\d{2}?|Z",fn:function(M,m){m==="Z"?m=0:m=m.replace(":","");var A=Math.abs(m),X=(m>0?-1:1)*(A%100+Math.floor(A/100)*60);M.setUTCMinutes(M.getUTCMinutes()+X)}}],D=f.reduce(function(M,m){return m.pattern.test(M.regexp)?(m.index=M.regexp.match(m.pattern).index,M.regexp=M.regexp.replace(m.pattern,"("+m.regexp+")")):m.index=-1,M},{regexp:i,index:[]}),w=f.filter(function(M){return M.index>-1});w.sort(function(M,m){return M.index-m.index});var E=new RegExp(D.regexp),T=E.exec(h);if(T){var F=b||ne.exports.now();return w.forEach(function(M,m){M.fn(F,T[m+1])}),F}throw new Error("String '"+h+"' could not be parsed as '"+i+"'")}function uy(i,h,b){if(!i)throw new Error("pattern must be supplied");return sy(i,h,b)}function oy(){return new Date}ne.exports=Hh;ne.exports.asString=Hh;ne.exports.parse=uy;ne.exports.now=oy;ne.exports.ISO8601_FORMAT="yyyy-MM-ddThh:mm:ss.SSS";ne.exports.ISO8601_WITH_TZ_OFFSET_FORMAT="yyyy-MM-ddThh:mm:ss.SSSO";ne.exports.DATETIME_FORMAT="dd MM yyyy hh:mm:ss.SSS";ne.exports.ABSOLUTETIME_FORMAT="hh:mm:ss.SSS"});var Ss=tt((Uy,Kh)=>{var Kr=xs(),ay=kh().asString;function le(i){this._factory=i,this._attributes={},this._testCases=[],this._properties=[]}le.prototype.name=function(i){return this._attributes.name=i,this};le.prototype.time=function(i){return this._attributes.time=i,this};le.prototype.timestamp=function(i){return Kr.isDate(i)?this._attributes.timestamp=ay("yyyy-MM-ddThh:mm:ss",i):this._attributes.timestamp=i,this};le.prototype.property=function(i,h){return this._properties.push({name:i,value:h}),this};le.prototype.testCase=function(){var i=this._factory.newTestCase();return this._testCases.push(i),i};le.prototype.getFailureCount=function(){return this._sumTestCaseCounts(function(i){return i.getFailureCount()})};le.prototype.getErrorCount=function(){return this._sumTestCaseCounts(function(i){return i.getErrorCount()})};le.prototype.getSkippedCount=function(){return this._sumTestCaseCounts(function(i){return i.getSkippedCount()})};le.prototype._sumTestCaseCounts=function(i){var h=Kr.map(this._testCases,i);return Kr.sum(h)};le.prototype.build=function(i){this._attributes.tests=this._testCases.length,this._attributes.failures=this.getFailureCount(),this._attributes.errors=this.getErrorCount(),this._attributes.skipped=this.getSkippedCount();var h=i.ele("testsuite",this._attributes);if(this._properties.length){var b=h.ele("properties");Kr.forEach(this._properties,function(_){b.ele("property",{name:_.name,value:_.value})})}Kr.forEach(this._testCases,function(_){_.build(h)})};Kh.exports=le});var Ps=tt((Wy,Vh)=>{function Nt(){this._error=!1,this._failure=!1,this._skipped=!1,this._standardOutput=void 0,this._standardError=void 0,this._stacktrace=void 0,this._attributes={},this._errorAttributes={},this._failureAttributes={},this._errorAttachment=void 0,this._errorContent=void 0}Nt.prototype.className=function(i){return this._attributes.classname=i,this};Nt.prototype.name=function(i){return this._attributes.name=i,this};Nt.prototype.time=function(i){return this._attributes.time=i,this};Nt.prototype.file=function(i){return this._attributes.file=i,this};Nt.prototype.failure=function(i,h){return this._failure=!0,i&&(this._failureAttributes.message=i),h&&(this._failureAttributes.type=h),this};Nt.prototype.error=function(i,h,b){return this._error=!0,i&&(this._errorAttributes.message=i),h&&(this._errorAttributes.type=h),b&&(this._errorContent=b),this};Nt.prototype.stacktrace=function(i){return this._failure=!0,this._stacktrace=i,this};Nt.prototype.skipped=function(){return this._skipped=!0,this};Nt.prototype.standardOutput=function(i){return this._standardOutput=i,this};Nt.prototype.standardError=function(i){return this._standardError=i,this};Nt.prototype.getFailureCount=function(){return Number(this._failure)};Nt.prototype.getErrorCount=function(){return Number(this._error)};Nt.prototype.getSkippedCount=function(){return Number(this._skipped)};Nt.prototype.errorAttachment=function(i){return this._errorAttachment=i,this};Nt.prototype.build=function(i){var h=i.ele("testcase",this._attributes);if(this._failure){var b=h.ele("failure",this._failureAttributes);this._stacktrace&&b.cdata(this._stacktrace)}if(this._error){var _=h.ele("error",this._errorAttributes);this._errorContent&&_.cdata(this._errorContent)}this._skipped&&h.ele("skipped"),this._standardOutput&&h.ele("system-out").cdata(this._standardOutput);var f;this._standardError&&(f=h.ele("system-err").cdata(this._standardError),this._errorAttachment&&f.txt("[[ATTACHMENT|"+this._errorAttachment+"]]"))};Vh.exports=Nt});var Gh=tt((Ky,$h)=>{var hy=xs(),fy=Ph(),ly=Gt("path"),cy=Uh(),dy=Gt("fs"),Hy=Ss(),ky=Ps();function mr(i){this._factory=i,this._testSuitesAndCases=[]}mr.prototype.writeTo=function(i){cy.sync(ly.dirname(i)),dy.writeFileSync(i,this.build(),"utf8")};mr.prototype.build=function(){var i=fy.create("testsuites",{encoding:"UTF-8",invalidCharReplacement:""});return hy.forEach(this._testSuitesAndCases,function(h){h.build(i)}),i.end({pretty:!0})};mr.prototype.testSuite=function(){var i=this._factory.newTestSuite();return this._testSuitesAndCases.push(i),i};mr.prototype.testCase=function(){var i=this._factory.newTestCase();return this._testSuitesAndCases.push(i),i};mr.prototype.newBuilder=function(){return this._factory.newBuilder()};$h.exports=mr});var Yh=tt((Vy,zh)=>{var py=Gh(),gy=Ss(),my=Ps();function ri(){}ri.prototype.newBuilder=function(){return new py(this)};ri.prototype.newTestSuite=function(){return new gy(this)};ri.prototype.newTestCase=function(){return new my(this)};zh.exports=ri});var Jh=tt(($y,Zh)=>{var wy=Yh();Zh.exports=new wy().newBuilder()});var Dy={};Zw(Dy,{default:()=>vy});var uf=Gt("stream"),Ct=Gt("@yarnpkg/core"),$r=Gt("@yarnpkg/fslib"),Le=Gt("clipanion");var Un=Gt("@yarnpkg/fslib"),Qw=["./LICENSE","./LICENCE"];function pa(i){let h=String(i);return typeof i=="string"||i===h?h:null}function ty(i){if(Array.isArray(i)){let b=i.reduce((_,f)=>{let D=pa(f.type);return D&&_.push(D),_},[]);return b.length>1?`(${b.join(" OR ")})`:b[0]??null}return i?.type??pa(i)}async function ga({manifest:i,packageFs:h,prefixPath:b,looseMode:_}){let f=ty(i.license??i.raw.licenses??i.raw.license)??"";if((!f||new RegExp("see license","i").test(f))&&_)for(let D of Qw)try{let w=Un.ppath.join(b,Un.npath.toPortablePath(D));return{licenseFile:await h.readFilePromise(w,"utf8")}}catch{}return{license:f}}async function ey({license:i}){return new RegExp("\\b(unknown|see license)\\b","i").test(i)}async function ma({license:i,isFile:h,isValidLicensePredicate:b}){return i&&!await ey({license:i})?b(i,h)?{pass:!0}:{pass:!1,reason:"incompatible"}:{reason:"missing",pass:!1}}var ef=Gt("fs"),ni=Jw(Jh());var jh=Gt("@yarnpkg/core"),Qh=i=>{let h=jh.structUtils.stringifyLocator(i);return h.includes("::")?h.substring(0,h.indexOf("::")):h},wr=class{constructor(h){this._map=new Map,this._defaultValue=h}get(h){return this._map.has(h)||this._map.set(h,this._defaultValue),this._map.get(h)}set(h,b){this._map.set(h,b)}has(h){return this._map.has(h)}merge(h,b){let _=this.get(h);this.set(h,{..._,...b})}entries(){return this._map.entries()}get size(){return this._map.size}},tf=(i,h)=>{let b=i.shift();if(!b)return;i=i.sort((E,T)=>E[0].localeCompare(T[0])),i.unshift(b);let _=2,f=" ".repeat(_),D=b.map(E=>E.length);for(let E of i)E.forEach((T,F)=>{D[F]=Math.max(D[F],T.length)});let w=(E,T)=>E.padEnd(Math.max(0,D[T]));i.forEach(E=>h.write(`${E.map(w).join(f)} +`))};var yy={missing:"License could not be found.",incompatible:"License is incompatible."};async function rf({results:i,outputFile:h,stdout:b}){if(!h)return;let _=ni.default.testSuite().name("Dependency Licenses Audit");for(let[f,D]of[...i.pass.entries(),...i.fail.entries(),...i.ignored.entries()].sort()){let w=_.testCase().name(f);w.standardOutput(Object.entries(D).map(E=>E.join(": ")).join(` +`)),i.ignored.has(f)?w.skipped():D.reason&&w.failure(`License: ${D.license}. Reason: ${yy[D.reason]}`,D.reason)}h==="-"?b.write(`${ni.default.build()} +`):ni.default.writeTo(h)}async function nf({results:i,stdout:h,configFilename:b}){if(i.fail.size!==0){let f=[["Package","License","Reason","Repository","Home Page"]],D=[...i.fail.entries()].map(([w,E])=>[w,String(E.license||"?"),String(E.reason||"?"),String(E.repository||"?"),String(E.homepage||"?")]);f.push(...D),tf(f,h),b&&h.write(` +NOTE: For false positives, exceptions may be added to: ${b} -`)}else f.write(`All packages have compatible licenses. -`)}async function sh({results:i,outputFile:f,stdout:D}){let v=[],h=["name","license","homepage","repository"];v.push(h);for(let[w,E]of[...i.pass.entries(),...i.fail.entries(),...i.ignored.entries()].sort())v.push(h.map(T=>T==="name"?w:E[T]??"?"));let b=v.map(w=>w.map(E=>/[",\n\r\t]/.test(E)?`"${E.replace('"','""')}"`:E).join(",")).map(w=>`${w} -`).join("");f==="-"?D.write(b):f&&(0,rh.writeFileSync)(f,b,{encoding:"utf8"})}var Vr=class extends Le.Command{constructor(){super(...arguments);this.outputCsv=Le.Option.String("--output-csv",{required:!1});this.outputFile=Le.Option.String("--output-file",{required:!1});this.configFile=Le.Option.String("--config",{required:!1});this.summary=Le.Option.Boolean("--summary",!1);this.looseMode=Le.Option.Boolean("--loose",!1);this.ignorePackagesPredicate=()=>!1;this.isValidLicensePredicate=()=>!1}async execute(){try{let D=await Ct.Configuration.find(this.context.cwd,this.context.plugins),{project:v}=await Ct.Project.find(D,this.context.cwd);await v.restoreInstallState(),await this.parseConfigFile();let h=await this.collectResults({configuration:D,project:v,looseMode:this.looseMode});return await nh({results:h,outputFile:this.outputFile,stdout:this.context.stdout}),this.summary&&await ih({results:h,stdout:this.context.stdout,configFilename:this.configFile}),this.outputCsv&&await sh({results:h,stdout:this.context.stdout,outputFile:this.outputCsv}),h.fail.size===0?0:1}catch(D){return this.context.stderr.write(`${String(D)} -`),1}}async parseConfigFile(){if(!this.configFile)return;let D=$r.ppath.resolve($r.ppath.cwd(),$r.npath.toPortablePath(this.configFile)),v=Ct.miscUtils.dynamicRequire(D),h=v?.ignorePackages;if(h){if(typeof h=="function")this.ignorePackagesPredicate=h;else if(h instanceof RegExp)this.ignorePackagesPredicate=(w,E)=>h.test(E);else if(h instanceof Set||h instanceof Array){let w=new Set(h);this.ignorePackagesPredicate=(E,T)=>w.has(E)}}let b=v?.isValidLicense;if(b)if(typeof b=="function")this.isValidLicensePredicate=b;else if(b instanceof RegExp)this.isValidLicensePredicate=w=>b.test(w);else throw new Error("Invalid config option value: isValidLicense")}async collectResults({configuration:D,project:v,looseMode:h}){let b=await Ct.Cache.find(D),w=await D.makeFetcher(),E=new Ct.StreamReport({stdout:new uh.PassThrough,configuration:D}),T={pass:new wr({}),fail:new wr({}),ignored:new wr({})},F=Array.from(new Set(Ct.miscUtils.sortMap(v.storedResolutions.values(),[M=>{let m=v.storedPackages.get(M);return Ct.structUtils.stringifyLocator(m)}])));for(let M of F){let m=v.storedPackages.get(M);if(!m||Ct.structUtils.isVirtualLocator(m)||m.reference.startsWith("workspace:"))continue;let{packageFs:A,prefixPath:X}=await w.fetch(m,{project:v,fetcher:w,cache:b,cacheOptions:{mockedPackages:v.disabledLocators,unstablePackages:v.conditionalLocators},report:E,checksums:v.storedChecksums}),B=null;try{B=await Ct.Manifest.find(X,{baseFs:A})}catch{continue}try{let{license:G,licenseFile:nt}=await ga({manifest:B,packageFs:A,prefixPath:X,looseMode:h}),{reason:Z,pass:xt}=await ma({license:G||nt||null,isFile:Boolean(nt),isValidLicensePredicate:this.isValidLicensePredicate}),p={homepage:B.raw?.homepage,license:G||void 0,reason:Z,repository:B.raw?.repository?.url||void 0},d=Ct.structUtils.stringifyIdent(m),O=th(m);this.ignorePackagesPredicate(d,G||"unknown")?T.ignored.merge(O,p):xt?T.pass.merge(O,p):T.fail.merge(O,p)}catch{continue}}return T}};Vr.paths=[["licenses","audit"]],Vr.usage=Le.Command.Usage({description:"",details:"",examples:[]});var _y={hooks:{},commands:[Vr]},vy=_y;return Jw(by);})(); +`)}else h.write(`All packages have compatible licenses. +`)}async function sf({results:i,outputFile:h,stdout:b}){let _=[],f=["name","license","homepage","repository"];_.push(f);for(let[w,E]of[...i.pass.entries(),...i.fail.entries(),...i.ignored.entries()].sort())_.push(f.map(T=>T==="name"?w:E[T]??"?"));let D=_.map(w=>w.map(E=>/[",\n\r\t]/.test(E)?`"${E.replace('"','""')}"`:E).join(",")).map(w=>`${w} +`).join("");h==="-"?b.write(D):h&&(0,ef.writeFileSync)(h,D,{encoding:"utf8"})}var Vr=class extends Le.Command{constructor(){super(...arguments);this.outputCsv=Le.Option.String("--output-csv",{required:!1});this.outputFile=Le.Option.String("--output-file",{required:!1});this.configFile=Le.Option.String("--config",{required:!1});this.summary=Le.Option.Boolean("--summary",!1);this.looseMode=Le.Option.Boolean("--loose",!1);this.ignorePackagesPredicate=()=>!1;this.isValidLicensePredicate=()=>!1;this.isValidDevLicensePredicate=()=>!1}async execute(){try{let b=await Ct.Configuration.find(this.context.cwd,this.context.plugins),{project:_}=await Ct.Project.find(b,this.context.cwd);await _.restoreInstallState(),await this.parseConfigFile();let f=await this.collectResults({configuration:b,project:_,looseMode:this.looseMode});return await rf({results:f,outputFile:this.outputFile,stdout:this.context.stdout}),this.summary&&await nf({results:f,stdout:this.context.stdout,configFilename:this.configFile}),this.outputCsv&&await sf({results:f,stdout:this.context.stdout,outputFile:this.outputCsv}),f.fail.size===0?0:1}catch(b){return this.context.stderr.write(`${String(b)} +`),1}}async parseConfigFile(){if(!this.configFile)return;let b=$r.ppath.resolve($r.ppath.cwd(),$r.npath.toPortablePath(this.configFile)),_=Ct.miscUtils.dynamicRequire(b),f=_?.ignorePackages;if(f){if(typeof f=="function")this.ignorePackagesPredicate=f;else if(f instanceof RegExp)this.ignorePackagesPredicate=(E,T)=>f.test(T);else if(f instanceof Set||f instanceof Array){let E=new Set(f);this.ignorePackagesPredicate=(T,F)=>E.has(T)}}let D=_?.isValidLicense;if(D)if(typeof D=="function")this.isValidLicensePredicate=D;else if(D instanceof RegExp)this.isValidLicensePredicate=E=>D.test(E);else throw new Error("Invalid config option value: isValidLicense");let w=_?.isValidDevLicense;w?typeof w=="function"?this.isValidDevLicensePredicate=w:w instanceof RegExp?this.isValidDevLicensePredicate=E=>w.test(E):this.isValidDevLicensePredicate=this.isValidLicensePredicate:this.isValidDevLicensePredicate=this.isValidLicensePredicate}async collectResults({configuration:b,project:_,looseMode:f}){let D=await Ct.Cache.find(b),w=await b.makeFetcher(),E=new Ct.StreamReport({stdout:new uf.PassThrough,configuration:b}),T={pass:new wr({}),fail:new wr({}),ignored:new wr({})},F=[],M=[],m=new Set;for(let B of _.workspaces)for(let K of B.anchoredPackage.dependencies.values()){let et=B.manifest.devDependencies.has(K.identHash);if(m.add(K.identHash),!et){F.push(K.descriptorHash);let V=_.storedResolutions.get(K.descriptorHash),_t=_.storedPackages.get(V);M.push(..._t.dependencies.entries())}}for(;M.length>0;){let[B,K]=M.shift();if(!m.has(B)){m.add(B),F.push(K.descriptorHash);let et=_.storedResolutions.get(K.descriptorHash),V=_.storedPackages.get(et);M.push(...V.dependencies.entries())}}let A=[..._.storedResolutions.entries()].map(([B,K])=>({locatorHash:K,isDev:!F.includes(B)})),X=Array.from(new Set(Ct.miscUtils.sortMap(A,[B=>{let K=_.storedPackages.get(B.locatorHash);return Ct.structUtils.stringifyLocator(K)}])));for(let B of X){let{locatorHash:K,isDev:et}=B,V=_.storedPackages.get(K);if(!V||Ct.structUtils.isVirtualLocator(V)||V.reference.startsWith("workspace:"))continue;let{packageFs:_t,prefixPath:g}=await w.fetch(V,{project:_,fetcher:w,cache:D,cacheOptions:{mockedPackages:_.disabledLocators,unstablePackages:_.conditionalLocators},report:E,checksums:_.storedChecksums}),d=null;try{d=await Ct.Manifest.find(g,{baseFs:_t})}catch{continue}try{let{license:O,licenseFile:a}=await ga({manifest:d,packageFs:_t,prefixPath:g,looseMode:f}),{reason:x,pass:C}=await ma({license:O||a||null,isFile:Boolean(a),isValidLicensePredicate:et?this.isValidDevLicensePredicate:this.isValidLicensePredicate}),l={homepage:d.raw?.homepage,license:O||void 0,reason:x,repository:d.raw?.repository?.url||void 0},I=Ct.structUtils.stringifyIdent(V),S=Qh(V);this.ignorePackagesPredicate(I,O||"unknown")?T.ignored.merge(S,l):C?T.pass.merge(S,l):T.fail.merge(S,l)}catch{continue}}return T}};Vr.paths=[["licenses","audit"]],Vr.usage=Le.Command.Usage({description:"",details:"",examples:[]});var _y={hooks:{},commands:[Vr]},vy=_y;return jw(Dy);})(); /** * @license * Lodash diff --git a/src/index.ts b/src/index.ts index a138f1d..4a4eff6 100644 --- a/src/index.ts +++ b/src/index.ts @@ -5,6 +5,9 @@ import { type CommandContext, Configuration, type LocatorHash, + type DescriptorHash, + type IdentHash, + type Descriptor, Manifest, type Plugin, Project, @@ -44,6 +47,7 @@ class AuditLicensesCommand extends Command< ignorePackagesPredicate: PackageNamePredicate = () => false isValidLicensePredicate: LicensePredicate = () => false + isValidDevLicensePredicate: LicensePredicate = () => false async execute(): Promise { try { @@ -120,6 +124,20 @@ class AuditLicensesCommand extends Command< throw new Error('Invalid config option value: isValidLicense') } } + + const isValidDevLicensePredicate = config?.isValidDevLicense + if (isValidDevLicensePredicate) { + if (typeof isValidDevLicensePredicate === 'function') { + this.isValidDevLicensePredicate = isValidDevLicensePredicate + } else if (isValidDevLicensePredicate instanceof RegExp) { + this.isValidDevLicensePredicate = (license: string) => + isValidDevLicensePredicate.test(license) + } else { + this.isValidDevLicensePredicate = this.isValidLicensePredicate + } + } else { + this.isValidDevLicensePredicate = this.isValidLicensePredicate + } } async collectResults({ @@ -144,18 +162,53 @@ class AuditLicensesCommand extends Command< ignored: new ResultMap({}), } - const locatorHashes = Array.from( + const nonDevDependencies: Array = []; + + const depQueue: Array<[ IdentHash, Descriptor ]> = []; + const seen: Set = new Set(); + + // Starting from top level workspace definitions, recurse through the dependencies of non-dev + // dependencies to assign whether or not this is for production deployment. + // Based on logic from @yarnpkg/plugin-npm-cli/lib/npmAuditUtils + for (const workspace of project.workspaces) { + for (const dependency of workspace.anchoredPackage.dependencies.values()) { + const isDevDependency = workspace.manifest.devDependencies.has(dependency.identHash); + seen.add(dependency.identHash); + if (!isDevDependency) { + nonDevDependencies.push(dependency.descriptorHash); + const resolution = project.storedResolutions.get(dependency.descriptorHash); + const pkg = project.storedPackages.get(resolution!); + depQueue.push(...pkg!.dependencies.entries()); + } + } + } + + while (depQueue.length > 0) { + const [ ident, desc ] = depQueue.shift()!; + if (!seen.has(ident)) { + seen.add(ident); + nonDevDependencies.push(desc.descriptorHash); + const resolution = project.storedResolutions.get(desc.descriptorHash); + const pkg = project.storedPackages.get(resolution!); + depQueue.push(...pkg!.dependencies.entries()); + } + } + + const mappedResolutions = [ ...project.storedResolutions.entries() ].map(([ d, h ]) => ({ locatorHash: h, isDev: !nonDevDependencies.includes(d) })); + + const locatorHashes: { locatorHash: LocatorHash, isDev: boolean }[] = Array.from( new Set( - miscUtils.sortMap(project.storedResolutions.values(), [ - (locatorHash: LocatorHash) => { - const pkg = project.storedPackages.get(locatorHash)! + miscUtils.sortMap(mappedResolutions, [ + (entry: { locatorHash: LocatorHash, isDev: boolean }) => { + const pkg = project.storedPackages.get(entry.locatorHash)! return structUtils.stringifyLocator(pkg) }, ]), ), ) - for (const locatorHash of locatorHashes) { + for (const entry of locatorHashes) { + const { locatorHash, isDev } = entry; const pkg = project.storedPackages.get(locatorHash) if (!pkg) continue if (structUtils.isVirtualLocator(pkg)) continue @@ -191,7 +244,7 @@ class AuditLicensesCommand extends Command< const { reason, pass } = await isAllowableLicense({ license: license || licenseFile || null, isFile: Boolean(licenseFile), - isValidLicensePredicate: this.isValidLicensePredicate, + isValidLicensePredicate: isDev ? this.isValidDevLicensePredicate : this.isValidLicensePredicate, }) const result = { homepage: manifest.raw?.homepage,