@vitus-labs/tools-core 0.34.0 → 0.35.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/analysis/vitus-tools-core.js.html +2339 -210
- package/lib/analysis/vitus-tools-core.module.js.html +2339 -210
- package/package.json +6 -6
|
@@ -116,6 +116,7 @@ main {
|
|
|
116
116
|
|
|
117
117
|
.module-filters {
|
|
118
118
|
display: flex;
|
|
119
|
+
flex-grow: 1;
|
|
119
120
|
}
|
|
120
121
|
|
|
121
122
|
.module-filter {
|
|
@@ -144,7 +145,7 @@ main {
|
|
|
144
145
|
var drawChart = (function (exports) {
|
|
145
146
|
'use strict';
|
|
146
147
|
|
|
147
|
-
var n,l$1,u$1,t$1,o$2,r$1,f$1={},e$1=[],c$2=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function s(n,l){for(var u in l)n[u]=l[u];return n}function a$2(n){var l=n.parentNode;l&&l.removeChild(n);}function h$1(l,u,i){var t,o,r,f={};for(r in u)"key"==r?t=u[r]:"ref"==r?o=u[r]:f[r]=u[r];if(arguments.length>2&&(f.children=arguments.length>3?n.call(arguments,2):i),"function"==typeof l&&null!=l.defaultProps)for(r in l.defaultProps)void 0===f[r]&&(f[r]=l.defaultProps[r]);return v$1(l,f,t,o,null)}function v$1(n,i,t,o,r){var f={type:n,props:i,key:t,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==r?++u$1:r};return null==r&&null!=l$1.vnode&&l$1.vnode(f),f}function p$1(n){return n.children}function d$1(n,l){this.props=n,this.context=l;}function _$2(n,l){if(null==l)return n.__?_$2(n.__,n.__.__k.indexOf(n)+1):null;for(var u;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e)return u.__e;return "function"==typeof n.type?_$2(n):null}function k$1(n){var l,u;if(null!=(n=n.__)&&null!=n.__c){for(n.__e=n.__c.base=null,l=0;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e){n.__e=n.__c.base=u.__e;break}return k$1(n)}}function b$1(n){(!n.__d&&(n.__d=!0)&&t$1.push(n)&&!g$1.__r++||o$2!==l$1.debounceRendering)&&((o$2=l$1.debounceRendering)||setTimeout)(g$1);}function g$1(){for(var n;g$1.__r=t$1.length;)n=t$1.sort(function(n,l){return n.__v.__b-l.__v.__b}),t$1=[],n.some(function(n){var l,u,i,t,o,r;n.__d&&(o=(t=(l=n).__v).__e,(r=l.__P)&&(u=[],(i=s({},t)).__v=t.__v+1,j$1(r,t,i,l.__n,void 0!==r.ownerSVGElement,null!=t.__h?[o]:null,u,null==o?_$2(t):o,t.__h),z$1(u,t),t.__e!=o&&k$1(t)));});}function w$1(n,l,u,i,t,o,r,c,s,a){var h,y,d,k,b,g,w,x=i&&i.__k||e$1,C=x.length;for(u.__k=[],h=0;h<l.length;h++)if(null!=(k=u.__k[h]=null==(k=l[h])||"boolean"==typeof k?null:"string"==typeof k||"number"==typeof k||"bigint"==typeof k?v$1(null,k,null,null,k):Array.isArray(k)?v$1(p$1,{children:k},null,null,null):k.__b>0?v$1(k.type,k.props,k.key,k.ref?k.ref:null,k.__v):k)){if(k.__=u,k.__b=u.__b+1,null===(d=x[h])||d&&k.key==d.key&&k.type===d.type)x[h]=void 0;else for(y=0;y<C;y++){if((d=x[y])&&k.key==d.key&&k.type===d.type){x[y]=void 0;break}d=null;}j$1(n,k,d=d||f$1,t,o,r,c,s,a),b=k.__e,(y=k.ref)&&d.ref!=y&&(w||(w=[]),d.ref&&w.push(d.ref,null,k),w.push(y,k.__c||b,k)),null!=b?(null==g&&(g=b),"function"==typeof k.type&&k.__k===d.__k?k.__d=s=m$2(k,s,n):s=A$1(n,k,d,x,b,s),"function"==typeof u.type&&(u.__d=s)):s&&d.__e==s&&s.parentNode!=n&&(s=_$2(d));}for(u.__e=g,h=C;h--;)null!=x[h]&&N(x[h],x[h]);if(w)for(h=0;h<w.length;h++)M(w[h],w[++h],w[++h]);}function m$2(n,l,u){for(var i,t=n.__k,o=0;t&&o<t.length;o++)(i=t[o])&&(i.__=n,l="function"==typeof i.type?m$2(i,l,u):A$1(u,i,i,t,i.__e,l));return l}function A$1(n,l,u,i,t,o){var r,f,e;if(void 0!==l.__d)r=l.__d,l.__d=void 0;else if(null==u||t!=o||null==t.parentNode)n:if(null==o||o.parentNode!==n)n.appendChild(t),r=null;else {for(f=o,e=0;(f=f.nextSibling)&&e<i.length;e+=
|
|
148
|
+
var n,l$1,u$1,t$1,o$2,r$1,f$1={},e$1=[],c$2=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function s(n,l){for(var u in l)n[u]=l[u];return n}function a$2(n){var l=n.parentNode;l&&l.removeChild(n);}function h$1(l,u,i){var t,o,r,f={};for(r in u)"key"==r?t=u[r]:"ref"==r?o=u[r]:f[r]=u[r];if(arguments.length>2&&(f.children=arguments.length>3?n.call(arguments,2):i),"function"==typeof l&&null!=l.defaultProps)for(r in l.defaultProps)void 0===f[r]&&(f[r]=l.defaultProps[r]);return v$1(l,f,t,o,null)}function v$1(n,i,t,o,r){var f={type:n,props:i,key:t,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==r?++u$1:r};return null==r&&null!=l$1.vnode&&l$1.vnode(f),f}function p$1(n){return n.children}function d$1(n,l){this.props=n,this.context=l;}function _$2(n,l){if(null==l)return n.__?_$2(n.__,n.__.__k.indexOf(n)+1):null;for(var u;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e)return u.__e;return "function"==typeof n.type?_$2(n):null}function k$1(n){var l,u;if(null!=(n=n.__)&&null!=n.__c){for(n.__e=n.__c.base=null,l=0;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e){n.__e=n.__c.base=u.__e;break}return k$1(n)}}function b$1(n){(!n.__d&&(n.__d=!0)&&t$1.push(n)&&!g$1.__r++||o$2!==l$1.debounceRendering)&&((o$2=l$1.debounceRendering)||setTimeout)(g$1);}function g$1(){for(var n;g$1.__r=t$1.length;)n=t$1.sort(function(n,l){return n.__v.__b-l.__v.__b}),t$1=[],n.some(function(n){var l,u,i,t,o,r;n.__d&&(o=(t=(l=n).__v).__e,(r=l.__P)&&(u=[],(i=s({},t)).__v=t.__v+1,j$1(r,t,i,l.__n,void 0!==r.ownerSVGElement,null!=t.__h?[o]:null,u,null==o?_$2(t):o,t.__h),z$1(u,t),t.__e!=o&&k$1(t)));});}function w$1(n,l,u,i,t,o,r,c,s,a){var h,y,d,k,b,g,w,x=i&&i.__k||e$1,C=x.length;for(u.__k=[],h=0;h<l.length;h++)if(null!=(k=u.__k[h]=null==(k=l[h])||"boolean"==typeof k?null:"string"==typeof k||"number"==typeof k||"bigint"==typeof k?v$1(null,k,null,null,k):Array.isArray(k)?v$1(p$1,{children:k},null,null,null):k.__b>0?v$1(k.type,k.props,k.key,k.ref?k.ref:null,k.__v):k)){if(k.__=u,k.__b=u.__b+1,null===(d=x[h])||d&&k.key==d.key&&k.type===d.type)x[h]=void 0;else for(y=0;y<C;y++){if((d=x[y])&&k.key==d.key&&k.type===d.type){x[y]=void 0;break}d=null;}j$1(n,k,d=d||f$1,t,o,r,c,s,a),b=k.__e,(y=k.ref)&&d.ref!=y&&(w||(w=[]),d.ref&&w.push(d.ref,null,k),w.push(y,k.__c||b,k)),null!=b?(null==g&&(g=b),"function"==typeof k.type&&k.__k===d.__k?k.__d=s=m$2(k,s,n):s=A$1(n,k,d,x,b,s),"function"==typeof u.type&&(u.__d=s)):s&&d.__e==s&&s.parentNode!=n&&(s=_$2(d));}for(u.__e=g,h=C;h--;)null!=x[h]&&N(x[h],x[h]);if(w)for(h=0;h<w.length;h++)M(w[h],w[++h],w[++h]);}function m$2(n,l,u){for(var i,t=n.__k,o=0;t&&o<t.length;o++)(i=t[o])&&(i.__=n,l="function"==typeof i.type?m$2(i,l,u):A$1(u,i,i,t,i.__e,l));return l}function A$1(n,l,u,i,t,o){var r,f,e;if(void 0!==l.__d)r=l.__d,l.__d=void 0;else if(null==u||t!=o||null==t.parentNode)n:if(null==o||o.parentNode!==n)n.appendChild(t),r=null;else {for(f=o,e=0;(f=f.nextSibling)&&e<i.length;e+=1)if(f==t)break n;n.insertBefore(t,o),r=o;}return void 0!==r?r:t.nextSibling}function C$1(n,l,u,i,t){var o;for(o in u)"children"===o||"key"===o||o in l||H(n,o,null,u[o],i);for(o in l)t&&"function"!=typeof l[o]||"children"===o||"key"===o||"value"===o||"checked"===o||u[o]===l[o]||H(n,o,l[o],u[o],i);}function $(n,l,u){"-"===l[0]?n.setProperty(l,u):n[l]=null==u?"":"number"!=typeof u||c$2.test(l)?u:u+"px";}function H(n,l,u,i,t){var o;n:if("style"===l)if("string"==typeof u)n.style.cssText=u;else {if("string"==typeof i&&(n.style.cssText=i=""),i)for(l in i)u&&l in u||$(n.style,l,"");if(u)for(l in u)i&&u[l]===i[l]||$(n.style,l,u[l]);}else if("o"===l[0]&&"n"===l[1])o=l!==(l=l.replace(/Capture$/,"")),l=l.toLowerCase()in n?l.toLowerCase().slice(2):l.slice(2),n.l||(n.l={}),n.l[l+o]=u,u?i||n.addEventListener(l,o?T$1:I,o):n.removeEventListener(l,o?T$1:I,o);else if("dangerouslySetInnerHTML"!==l){if(t)l=l.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("href"!==l&&"list"!==l&&"form"!==l&&"tabIndex"!==l&&"download"!==l&&l in n)try{n[l]=null==u?"":u;break n}catch(n){}"function"==typeof u||(null==u||!1===u&&-1==l.indexOf("-")?n.removeAttribute(l):n.setAttribute(l,u));}}function I(n){this.l[n.type+!1](l$1.event?l$1.event(n):n);}function T$1(n){this.l[n.type+!0](l$1.event?l$1.event(n):n);}function j$1(n,u,i,t,o,r,f,e,c){var a,h,v,y,_,k,b,g,m,x,A,C,$,H,I,T=u.type;if(void 0!==u.constructor)return null;null!=i.__h&&(c=i.__h,e=u.__e=i.__e,u.__h=null,r=[e]),(a=l$1.__b)&&a(u);try{n:if("function"==typeof T){if(g=u.props,m=(a=T.contextType)&&t[a.__c],x=a?m?m.props.value:a.__:t,i.__c?b=(h=u.__c=i.__c).__=h.__E:("prototype"in T&&T.prototype.render?u.__c=h=new T(g,x):(u.__c=h=new d$1(g,x),h.constructor=T,h.render=O),m&&m.sub(h),h.props=g,h.state||(h.state={}),h.context=x,h.__n=t,v=h.__d=!0,h.__h=[],h._sb=[]),null==h.__s&&(h.__s=h.state),null!=T.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=s({},h.__s)),s(h.__s,T.getDerivedStateFromProps(g,h.__s))),y=h.props,_=h.state,v)null==T.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else {if(null==T.getDerivedStateFromProps&&g!==y&&null!=h.componentWillReceiveProps&&h.componentWillReceiveProps(g,x),!h.__e&&null!=h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(g,h.__s,x)||u.__v===i.__v){for(h.props=g,h.state=h.__s,u.__v!==i.__v&&(h.__d=!1),h.__v=u,u.__e=i.__e,u.__k=i.__k,u.__k.forEach(function(n){n&&(n.__=u);}),A=0;A<h._sb.length;A++)h.__h.push(h._sb[A]);h._sb=[],h.__h.length&&f.push(h);break n}null!=h.componentWillUpdate&&h.componentWillUpdate(g,h.__s,x),null!=h.componentDidUpdate&&h.__h.push(function(){h.componentDidUpdate(y,_,k);});}if(h.context=x,h.props=g,h.__v=u,h.__P=n,C=l$1.__r,$=0,"prototype"in T&&T.prototype.render){for(h.state=h.__s,h.__d=!1,C&&C(u),a=h.render(h.props,h.state,h.context),H=0;H<h._sb.length;H++)h.__h.push(h._sb[H]);h._sb=[];}else do{h.__d=!1,C&&C(u),a=h.render(h.props,h.state,h.context),h.state=h.__s;}while(h.__d&&++$<25);h.state=h.__s,null!=h.getChildContext&&(t=s(s({},t),h.getChildContext())),v||null==h.getSnapshotBeforeUpdate||(k=h.getSnapshotBeforeUpdate(y,_)),I=null!=a&&a.type===p$1&&null==a.key?a.props.children:a,w$1(n,Array.isArray(I)?I:[I],u,i,t,o,r,f,e,c),h.base=u.__e,u.__h=null,h.__h.length&&f.push(h),b&&(h.__E=h.__=null),h.__e=!1;}else null==r&&u.__v===i.__v?(u.__k=i.__k,u.__e=i.__e):u.__e=L(i.__e,u,i,t,o,r,f,c);(a=l$1.diffed)&&a(u);}catch(n){u.__v=null,(c||null!=r)&&(u.__e=e,u.__h=!!c,r[r.indexOf(e)]=null),l$1.__e(n,u,i);}}function z$1(n,u){l$1.__c&&l$1.__c(u,n),n.some(function(u){try{n=u.__h,u.__h=[],n.some(function(n){n.call(u);});}catch(n){l$1.__e(n,u.__v);}});}function L(l,u,i,t,o,r,e,c){var s,h,v,y=i.props,p=u.props,d=u.type,k=0;if("svg"===d&&(o=!0),null!=r)for(;k<r.length;k++)if((s=r[k])&&"setAttribute"in s==!!d&&(d?s.localName===d:3===s.nodeType)){l=s,r[k]=null;break}if(null==l){if(null===d)return document.createTextNode(p);l=o?document.createElementNS("http://www.w3.org/2000/svg",d):document.createElement(d,p.is&&p),r=null,c=!1;}if(null===d)y===p||c&&l.data===p||(l.data=p);else {if(r=r&&n.call(l.childNodes),h=(y=i.props||f$1).dangerouslySetInnerHTML,v=p.dangerouslySetInnerHTML,!c){if(null!=r)for(y={},k=0;k<l.attributes.length;k++)y[l.attributes[k].name]=l.attributes[k].value;(v||h)&&(v&&(h&&v.__html==h.__html||v.__html===l.innerHTML)||(l.innerHTML=v&&v.__html||""));}if(C$1(l,p,y,o,c),v)u.__k=[];else if(k=u.props.children,w$1(l,Array.isArray(k)?k:[k],u,i,t,o&&"foreignObject"!==d,r,e,r?r[0]:i.__k&&_$2(i,0),c),null!=r)for(k=r.length;k--;)null!=r[k]&&a$2(r[k]);c||("value"in p&&void 0!==(k=p.value)&&(k!==l.value||"progress"===d&&!k||"option"===d&&k!==y.value)&&H(l,"value",k,y.value,!1),"checked"in p&&void 0!==(k=p.checked)&&k!==l.checked&&H(l,"checked",k,y.checked,!1));}return l}function M(n,u,i){try{"function"==typeof n?n(u):n.current=u;}catch(n){l$1.__e(n,i);}}function N(n,u,i){var t,o;if(l$1.unmount&&l$1.unmount(n),(t=n.ref)&&(t.current&&t.current!==n.__e||M(t,null,u)),null!=(t=n.__c)){if(t.componentWillUnmount)try{t.componentWillUnmount();}catch(n){l$1.__e(n,u);}t.base=t.__P=null,n.__c=void 0;}if(t=n.__k)for(o=0;o<t.length;o++)t[o]&&N(t[o],u,i||"function"!=typeof n.type);i||null==n.__e||a$2(n.__e),n.__=n.__e=n.__d=void 0;}function O(n,l,u){return this.constructor(n,u)}function P(u,i,t){var o,r,e;l$1.__&&l$1.__(u,i),r=(o="function"==typeof t)?null:t&&t.__k||i.__k,e=[],j$1(i,u=(!o&&t||i).__k=h$1(p$1,null,[u]),r||f$1,f$1,void 0!==i.ownerSVGElement,!o&&t?[t]:r?null:i.firstChild?n.call(i.childNodes):null,e,!o&&t?t:r?r.__e:i.firstChild,o),z$1(e,u);}function B$2(n,l){var u={__c:l="__cC"+r$1++,__:n,Consumer:function(n,l){return n.children(l)},Provider:function(n){var u,i;return this.getChildContext||(u=[],(i={})[l]=this,this.getChildContext=function(){return i},this.shouldComponentUpdate=function(n){this.props.value!==n.value&&u.some(b$1);},this.sub=function(n){u.push(n);var l=n.componentWillUnmount;n.componentWillUnmount=function(){u.splice(u.indexOf(n),1),l&&l.call(n);};}),n.children}};return u.Provider.__=u.Consumer.contextType=u}n=e$1.slice,l$1={__e:function(n,l,u,i){for(var t,o,r;l=l.__;)if((t=l.__c)&&!t.__)try{if((o=t.constructor)&&null!=o.getDerivedStateFromError&&(t.setState(o.getDerivedStateFromError(n)),r=t.__d),null!=t.componentDidCatch&&(t.componentDidCatch(n,i||{}),r=t.__d),r)return t.__E=t}catch(l){n=l;}throw n}},u$1=0,d$1.prototype.setState=function(n,l){var u;u=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=s({},this.state),"function"==typeof n&&(n=n(s({},u),this.props)),n&&s(u,n),null!=n&&this.__v&&(l&&this._sb.push(l),b$1(this));},d$1.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),b$1(this));},d$1.prototype.render=p$1,t$1=[],g$1.__r=0,r$1=0;
|
|
148
149
|
|
|
149
150
|
var _$1=0;function o$1(o,e,n,t,f){var l,s,u={};for(s in e)"ref"==s?l=e[s]:u[s]=e[s];var a={type:o,props:u,key:n,ref:l,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:--_$1,__source:f,__self:t};if("function"==typeof o&&(l=o.defaultProps))for(s in l)void 0===u[s]&&(u[s]=l[s]);return l$1.vnode&&l$1.vnode(a),a}
|
|
150
151
|
|
|
@@ -164,7 +165,7 @@ var drawChart = (function (exports) {
|
|
|
164
165
|
return availableSizeProperties;
|
|
165
166
|
};
|
|
166
167
|
|
|
167
|
-
var t,r,u,i,o=0,f=[],c$1=[],e=l$1.__b,a$1=l$1.__r,v=l$1.diffed,l=l$1.__c,m$1=l$1.unmount;function d(t,u){l$1.__h&&l$1.__h(r,t,o||u),o=0;var i=r.__H||(r.__H={__:[],__h:[]});return t>=i.__.length&&i.__.push({__V:c$1}),i.__[t]}function p(n){return o=1,y$2(B$1,n)}function y$2(n,u,i){var o=d(t++,2);if(o.t=n,!o.__c&&(o.__=[i?i(u):B$1(void 0,u),function(n){var t=o.__N?o.__N[0]:o.__[0],r=o.t(t,n);t!==r&&(o.__N=[r,o.__[1]],o.__c.setState({}));}],o.__c=r,!r.u)){r.u=!0;var f=r.shouldComponentUpdate;r.shouldComponentUpdate=function(n,t,r){if(!o.__c.__H)return !0;var u=o.__c.__H.__.filter(function(n){return n.__c});if(u.every(function(n){return !n.__N}))return !f||f.call(this,n,t,r);var i=!1;return u.forEach(function(n){if(n.__N){var t=n.__[0];n.__=n.__N,n.__N=void 0,t!==n.__[0]&&(i=!0);}}),!(!i&&o.__c.props===n)&&(!f||f.call(this,n,t,r))};}return o.__N||o.__}function h(u,i){var o=d(t++,3);!l$1.__s&&z(o.__H,i)&&(o.__=u,o.i=i,r.__H.__h.push(o));}function _(n){return o=5,F(function(){return {current:n}},[])}function F(n,r){var u=d(t++,7);return z(u.__H,r)?(u.__V=n(),u.i=r,u.__h=n,u.__V):u.__}function q(n){var u=r.context[n.__c],i=d(t++,9);return i.c=n,u?(null==i.__&&(i.__=!0,u.sub(r)),u.props.value):n.__}function b(){for(var t;t=f.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(k),t.__H.__h.forEach(w),t.__H.__h=[];}catch(r){t.__H.__h=[],l$1.__e(r,t.__v);}}l$1.__b=function(n){
|
|
168
|
+
var t,r,u,i,o=0,f=[],c$1=[],e=l$1.__b,a$1=l$1.__r,v=l$1.diffed,l=l$1.__c,m$1=l$1.unmount;function d(t,u){l$1.__h&&l$1.__h(r,t,o||u),o=0;var i=r.__H||(r.__H={__:[],__h:[]});return t>=i.__.length&&i.__.push({__V:c$1}),i.__[t]}function p(n){return o=1,y$2(B$1,n)}function y$2(n,u,i){var o=d(t++,2);if(o.t=n,!o.__c&&(o.__=[i?i(u):B$1(void 0,u),function(n){var t=o.__N?o.__N[0]:o.__[0],r=o.t(t,n);t!==r&&(o.__N=[r,o.__[1]],o.__c.setState({}));}],o.__c=r,!r.u)){r.u=!0;var f=r.shouldComponentUpdate;r.shouldComponentUpdate=function(n,t,r){if(!o.__c.__H)return !0;var u=o.__c.__H.__.filter(function(n){return n.__c});if(u.every(function(n){return !n.__N}))return !f||f.call(this,n,t,r);var i=!1;return u.forEach(function(n){if(n.__N){var t=n.__[0];n.__=n.__N,n.__N=void 0,t!==n.__[0]&&(i=!0);}}),!(!i&&o.__c.props===n)&&(!f||f.call(this,n,t,r))};}return o.__N||o.__}function h(u,i){var o=d(t++,3);!l$1.__s&&z(o.__H,i)&&(o.__=u,o.i=i,r.__H.__h.push(o));}function _(n){return o=5,F(function(){return {current:n}},[])}function F(n,r){var u=d(t++,7);return z(u.__H,r)?(u.__V=n(),u.i=r,u.__h=n,u.__V):u.__}function T(n,t){return o=8,F(function(){return n},t)}function q(n){var u=r.context[n.__c],i=d(t++,9);return i.c=n,u?(null==i.__&&(i.__=!0,u.sub(r)),u.props.value):n.__}function b(){for(var t;t=f.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(k),t.__H.__h.forEach(w),t.__H.__h=[];}catch(r){t.__H.__h=[],l$1.__e(r,t.__v);}}l$1.__b=function(n){r=null,e&&e(n);},l$1.__r=function(n){a$1&&a$1(n),t=0;var i=(r=n.__c).__H;i&&(u===r?(i.__h=[],r.__h=[],i.__.forEach(function(n){n.__N&&(n.__=n.__N),n.__V=c$1,n.__N=n.i=void 0;})):(i.__h.forEach(k),i.__h.forEach(w),i.__h=[])),u=r;},l$1.diffed=function(t){v&&v(t);var o=t.__c;o&&o.__H&&(o.__H.__h.length&&(1!==f.push(o)&&i===l$1.requestAnimationFrame||((i=l$1.requestAnimationFrame)||j)(b)),o.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.__V!==c$1&&(n.__=n.__V),n.i=void 0,n.__V=c$1;})),u=r=null;},l$1.__c=function(t,r){r.some(function(t){try{t.__h.forEach(k),t.__h=t.__h.filter(function(n){return !n.__||w(n)});}catch(u){r.some(function(n){n.__h&&(n.__h=[]);}),r=[],l$1.__e(u,t.__v);}}),l&&l(t,r);},l$1.unmount=function(t){m$1&&m$1(t);var r,u=t.__c;u&&u.__H&&(u.__H.__.forEach(function(n){try{k(n);}catch(n){r=n;}}),u.__H=void 0,r&&l$1.__e(r,u.__v));};var g="function"==typeof requestAnimationFrame;function j(n){var t,r=function(){clearTimeout(u),g&&cancelAnimationFrame(t),setTimeout(n);},u=setTimeout(r,100);g&&(t=requestAnimationFrame(r));}function k(n){var t=r,u=n.__c;"function"==typeof u&&(n.__c=void 0,u()),r=t;}function w(n){var t=r;n.__c=n.__(),r=t;}function z(n,t){return !n||n.length!==t.length||t.some(function(t,r){return t!==n[r]})}function B$1(n,t){return "function"==typeof t?t(n):t}
|
|
168
169
|
|
|
169
170
|
function ascending(a, b) {
|
|
170
171
|
return a == null || b == null ? NaN : a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;
|
|
@@ -1221,7 +1222,7 @@ var drawChart = (function (exports) {
|
|
|
1221
1222
|
cubehelix(hue);
|
|
1222
1223
|
cubehelix(nogamma);
|
|
1223
1224
|
|
|
1224
|
-
function constants(x) {
|
|
1225
|
+
function constants$3(x) {
|
|
1225
1226
|
return function() {
|
|
1226
1227
|
return x;
|
|
1227
1228
|
};
|
|
@@ -1240,7 +1241,7 @@ var drawChart = (function (exports) {
|
|
|
1240
1241
|
function normalize(a, b) {
|
|
1241
1242
|
return (b -= (a = +a))
|
|
1242
1243
|
? function(x) { return (x - a) / b; }
|
|
1243
|
-
: constants(isNaN(b) ? NaN : 0.5);
|
|
1244
|
+
: constants$3(isNaN(b) ? NaN : 0.5);
|
|
1244
1245
|
}
|
|
1245
1246
|
|
|
1246
1247
|
function clamper(a, b) {
|
|
@@ -1803,47 +1804,46 @@ var drawChart = (function (exports) {
|
|
|
1803
1804
|
return pow.apply(null, arguments).exponent(0.5);
|
|
1804
1805
|
}
|
|
1805
1806
|
|
|
1806
|
-
|
|
1807
|
-
t1 = new Date;
|
|
1807
|
+
const t0 = new Date, t1 = new Date;
|
|
1808
1808
|
|
|
1809
|
-
function
|
|
1809
|
+
function timeInterval(floori, offseti, count, field) {
|
|
1810
1810
|
|
|
1811
1811
|
function interval(date) {
|
|
1812
1812
|
return floori(date = arguments.length === 0 ? new Date : new Date(+date)), date;
|
|
1813
1813
|
}
|
|
1814
1814
|
|
|
1815
|
-
interval.floor =
|
|
1815
|
+
interval.floor = (date) => {
|
|
1816
1816
|
return floori(date = new Date(+date)), date;
|
|
1817
1817
|
};
|
|
1818
1818
|
|
|
1819
|
-
interval.ceil =
|
|
1819
|
+
interval.ceil = (date) => {
|
|
1820
1820
|
return floori(date = new Date(date - 1)), offseti(date, 1), floori(date), date;
|
|
1821
1821
|
};
|
|
1822
1822
|
|
|
1823
|
-
interval.round =
|
|
1824
|
-
|
|
1825
|
-
d1 = interval.ceil(date);
|
|
1823
|
+
interval.round = (date) => {
|
|
1824
|
+
const d0 = interval(date), d1 = interval.ceil(date);
|
|
1826
1825
|
return date - d0 < d1 - date ? d0 : d1;
|
|
1827
1826
|
};
|
|
1828
1827
|
|
|
1829
|
-
interval.offset =
|
|
1828
|
+
interval.offset = (date, step) => {
|
|
1830
1829
|
return offseti(date = new Date(+date), step == null ? 1 : Math.floor(step)), date;
|
|
1831
1830
|
};
|
|
1832
1831
|
|
|
1833
|
-
interval.range =
|
|
1834
|
-
|
|
1832
|
+
interval.range = (start, stop, step) => {
|
|
1833
|
+
const range = [];
|
|
1835
1834
|
start = interval.ceil(start);
|
|
1836
1835
|
step = step == null ? 1 : Math.floor(step);
|
|
1837
1836
|
if (!(start < stop) || !(step > 0)) return range; // also handles Invalid Date
|
|
1837
|
+
let previous;
|
|
1838
1838
|
do range.push(previous = new Date(+start)), offseti(start, step), floori(start);
|
|
1839
1839
|
while (previous < start && start < stop);
|
|
1840
1840
|
return range;
|
|
1841
1841
|
};
|
|
1842
1842
|
|
|
1843
|
-
interval.filter =
|
|
1844
|
-
return
|
|
1843
|
+
interval.filter = (test) => {
|
|
1844
|
+
return timeInterval((date) => {
|
|
1845
1845
|
if (date >= date) while (floori(date), !test(date)) date.setTime(date - 1);
|
|
1846
|
-
},
|
|
1846
|
+
}, (date, step) => {
|
|
1847
1847
|
if (date >= date) {
|
|
1848
1848
|
if (step < 0) while (++step <= 0) {
|
|
1849
1849
|
while (offseti(date, -1), !test(date)) {} // eslint-disable-line no-empty
|
|
@@ -1855,46 +1855,47 @@ var drawChart = (function (exports) {
|
|
|
1855
1855
|
};
|
|
1856
1856
|
|
|
1857
1857
|
if (count) {
|
|
1858
|
-
interval.count =
|
|
1858
|
+
interval.count = (start, end) => {
|
|
1859
1859
|
t0.setTime(+start), t1.setTime(+end);
|
|
1860
1860
|
floori(t0), floori(t1);
|
|
1861
1861
|
return Math.floor(count(t0, t1));
|
|
1862
1862
|
};
|
|
1863
1863
|
|
|
1864
|
-
interval.every =
|
|
1864
|
+
interval.every = (step) => {
|
|
1865
1865
|
step = Math.floor(step);
|
|
1866
1866
|
return !isFinite(step) || !(step > 0) ? null
|
|
1867
1867
|
: !(step > 1) ? interval
|
|
1868
1868
|
: interval.filter(field
|
|
1869
|
-
?
|
|
1870
|
-
:
|
|
1869
|
+
? (d) => field(d) % step === 0
|
|
1870
|
+
: (d) => interval.count(0, d) % step === 0);
|
|
1871
1871
|
};
|
|
1872
1872
|
}
|
|
1873
1873
|
|
|
1874
1874
|
return interval;
|
|
1875
1875
|
}
|
|
1876
1876
|
|
|
1877
|
-
|
|
1877
|
+
const millisecond = timeInterval(() => {
|
|
1878
1878
|
// noop
|
|
1879
|
-
},
|
|
1879
|
+
}, (date, step) => {
|
|
1880
1880
|
date.setTime(+date + step);
|
|
1881
|
-
},
|
|
1881
|
+
}, (start, end) => {
|
|
1882
1882
|
return end - start;
|
|
1883
1883
|
});
|
|
1884
1884
|
|
|
1885
1885
|
// An optimized implementation for this simple case.
|
|
1886
|
-
millisecond.every =
|
|
1886
|
+
millisecond.every = (k) => {
|
|
1887
1887
|
k = Math.floor(k);
|
|
1888
1888
|
if (!isFinite(k) || !(k > 0)) return null;
|
|
1889
1889
|
if (!(k > 1)) return millisecond;
|
|
1890
|
-
return
|
|
1890
|
+
return timeInterval((date) => {
|
|
1891
1891
|
date.setTime(Math.floor(date / k) * k);
|
|
1892
|
-
},
|
|
1892
|
+
}, (date, step) => {
|
|
1893
1893
|
date.setTime(+date + step * k);
|
|
1894
|
-
},
|
|
1894
|
+
}, (start, end) => {
|
|
1895
1895
|
return (end - start) / k;
|
|
1896
1896
|
});
|
|
1897
1897
|
};
|
|
1898
|
+
|
|
1898
1899
|
millisecond.range;
|
|
1899
1900
|
|
|
1900
1901
|
const durationSecond = 1000;
|
|
@@ -1903,160 +1904,144 @@ var drawChart = (function (exports) {
|
|
|
1903
1904
|
const durationDay = durationHour * 24;
|
|
1904
1905
|
const durationWeek = durationDay * 7;
|
|
1905
1906
|
|
|
1906
|
-
|
|
1907
|
+
const second = timeInterval((date) => {
|
|
1907
1908
|
date.setTime(date - date.getMilliseconds());
|
|
1908
|
-
},
|
|
1909
|
+
}, (date, step) => {
|
|
1909
1910
|
date.setTime(+date + step * durationSecond);
|
|
1910
|
-
},
|
|
1911
|
+
}, (start, end) => {
|
|
1911
1912
|
return (end - start) / durationSecond;
|
|
1912
|
-
},
|
|
1913
|
+
}, (date) => {
|
|
1913
1914
|
return date.getUTCSeconds();
|
|
1914
1915
|
});
|
|
1916
|
+
|
|
1915
1917
|
second.range;
|
|
1916
1918
|
|
|
1917
|
-
|
|
1919
|
+
const timeMinute = timeInterval((date) => {
|
|
1918
1920
|
date.setTime(date - date.getMilliseconds() - date.getSeconds() * durationSecond);
|
|
1919
|
-
},
|
|
1921
|
+
}, (date, step) => {
|
|
1920
1922
|
date.setTime(+date + step * durationMinute);
|
|
1921
|
-
},
|
|
1923
|
+
}, (start, end) => {
|
|
1922
1924
|
return (end - start) / durationMinute;
|
|
1923
|
-
},
|
|
1925
|
+
}, (date) => {
|
|
1924
1926
|
return date.getMinutes();
|
|
1925
1927
|
});
|
|
1926
|
-
minute.range;
|
|
1927
1928
|
|
|
1928
|
-
|
|
1929
|
+
timeMinute.range;
|
|
1930
|
+
|
|
1931
|
+
const utcMinute = timeInterval((date) => {
|
|
1932
|
+
date.setUTCSeconds(0, 0);
|
|
1933
|
+
}, (date, step) => {
|
|
1934
|
+
date.setTime(+date + step * durationMinute);
|
|
1935
|
+
}, (start, end) => {
|
|
1936
|
+
return (end - start) / durationMinute;
|
|
1937
|
+
}, (date) => {
|
|
1938
|
+
return date.getUTCMinutes();
|
|
1939
|
+
});
|
|
1940
|
+
|
|
1941
|
+
utcMinute.range;
|
|
1942
|
+
|
|
1943
|
+
const timeHour = timeInterval((date) => {
|
|
1929
1944
|
date.setTime(date - date.getMilliseconds() - date.getSeconds() * durationSecond - date.getMinutes() * durationMinute);
|
|
1930
|
-
},
|
|
1945
|
+
}, (date, step) => {
|
|
1931
1946
|
date.setTime(+date + step * durationHour);
|
|
1932
|
-
},
|
|
1947
|
+
}, (start, end) => {
|
|
1933
1948
|
return (end - start) / durationHour;
|
|
1934
|
-
},
|
|
1949
|
+
}, (date) => {
|
|
1935
1950
|
return date.getHours();
|
|
1936
1951
|
});
|
|
1937
|
-
hour.range;
|
|
1938
1952
|
|
|
1939
|
-
|
|
1953
|
+
timeHour.range;
|
|
1954
|
+
|
|
1955
|
+
const utcHour = timeInterval((date) => {
|
|
1956
|
+
date.setUTCMinutes(0, 0, 0);
|
|
1957
|
+
}, (date, step) => {
|
|
1958
|
+
date.setTime(+date + step * durationHour);
|
|
1959
|
+
}, (start, end) => {
|
|
1960
|
+
return (end - start) / durationHour;
|
|
1961
|
+
}, (date) => {
|
|
1962
|
+
return date.getUTCHours();
|
|
1963
|
+
});
|
|
1964
|
+
|
|
1965
|
+
utcHour.range;
|
|
1966
|
+
|
|
1967
|
+
const timeDay = timeInterval(
|
|
1940
1968
|
date => date.setHours(0, 0, 0, 0),
|
|
1941
1969
|
(date, step) => date.setDate(date.getDate() + step),
|
|
1942
1970
|
(start, end) => (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationDay,
|
|
1943
1971
|
date => date.getDate() - 1
|
|
1944
1972
|
);
|
|
1945
|
-
day.range;
|
|
1946
1973
|
|
|
1947
|
-
|
|
1948
|
-
return newInterval(function(date) {
|
|
1949
|
-
date.setDate(date.getDate() - (date.getDay() + 7 - i) % 7);
|
|
1950
|
-
date.setHours(0, 0, 0, 0);
|
|
1951
|
-
}, function(date, step) {
|
|
1952
|
-
date.setDate(date.getDate() + step * 7);
|
|
1953
|
-
}, function(start, end) {
|
|
1954
|
-
return (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationWeek;
|
|
1955
|
-
});
|
|
1956
|
-
}
|
|
1974
|
+
timeDay.range;
|
|
1957
1975
|
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1976
|
+
const utcDay = timeInterval((date) => {
|
|
1977
|
+
date.setUTCHours(0, 0, 0, 0);
|
|
1978
|
+
}, (date, step) => {
|
|
1979
|
+
date.setUTCDate(date.getUTCDate() + step);
|
|
1980
|
+
}, (start, end) => {
|
|
1981
|
+
return (end - start) / durationDay;
|
|
1982
|
+
}, (date) => {
|
|
1983
|
+
return date.getUTCDate() - 1;
|
|
1984
|
+
});
|
|
1965
1985
|
|
|
1966
|
-
|
|
1967
|
-
monday.range;
|
|
1968
|
-
tuesday.range;
|
|
1969
|
-
wednesday.range;
|
|
1970
|
-
thursday.range;
|
|
1971
|
-
friday.range;
|
|
1972
|
-
saturday.range;
|
|
1986
|
+
utcDay.range;
|
|
1973
1987
|
|
|
1974
|
-
|
|
1975
|
-
date.
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
return date.getMonth();
|
|
1988
|
+
const unixDay = timeInterval((date) => {
|
|
1989
|
+
date.setUTCHours(0, 0, 0, 0);
|
|
1990
|
+
}, (date, step) => {
|
|
1991
|
+
date.setUTCDate(date.getUTCDate() + step);
|
|
1992
|
+
}, (start, end) => {
|
|
1993
|
+
return (end - start) / durationDay;
|
|
1994
|
+
}, (date) => {
|
|
1995
|
+
return Math.floor(date / durationDay);
|
|
1983
1996
|
});
|
|
1984
|
-
month.range;
|
|
1985
1997
|
|
|
1986
|
-
|
|
1987
|
-
date.setMonth(0, 1);
|
|
1988
|
-
date.setHours(0, 0, 0, 0);
|
|
1989
|
-
}, function(date, step) {
|
|
1990
|
-
date.setFullYear(date.getFullYear() + step);
|
|
1991
|
-
}, function(start, end) {
|
|
1992
|
-
return end.getFullYear() - start.getFullYear();
|
|
1993
|
-
}, function(date) {
|
|
1994
|
-
return date.getFullYear();
|
|
1995
|
-
});
|
|
1998
|
+
unixDay.range;
|
|
1996
1999
|
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
date.setFullYear(Math.floor(date.getFullYear() / k) * k);
|
|
2001
|
-
date.setMonth(0, 1);
|
|
2000
|
+
function timeWeekday(i) {
|
|
2001
|
+
return timeInterval((date) => {
|
|
2002
|
+
date.setDate(date.getDate() - (date.getDay() + 7 - i) % 7);
|
|
2002
2003
|
date.setHours(0, 0, 0, 0);
|
|
2003
|
-
},
|
|
2004
|
-
date.
|
|
2004
|
+
}, (date, step) => {
|
|
2005
|
+
date.setDate(date.getDate() + step * 7);
|
|
2006
|
+
}, (start, end) => {
|
|
2007
|
+
return (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationWeek;
|
|
2005
2008
|
});
|
|
2006
|
-
}
|
|
2007
|
-
year.range;
|
|
2008
|
-
|
|
2009
|
-
var utcMinute = newInterval(function(date) {
|
|
2010
|
-
date.setUTCSeconds(0, 0);
|
|
2011
|
-
}, function(date, step) {
|
|
2012
|
-
date.setTime(+date + step * durationMinute);
|
|
2013
|
-
}, function(start, end) {
|
|
2014
|
-
return (end - start) / durationMinute;
|
|
2015
|
-
}, function(date) {
|
|
2016
|
-
return date.getUTCMinutes();
|
|
2017
|
-
});
|
|
2018
|
-
utcMinute.range;
|
|
2009
|
+
}
|
|
2019
2010
|
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
return date.getUTCHours();
|
|
2028
|
-
});
|
|
2029
|
-
utcHour.range;
|
|
2011
|
+
const timeSunday = timeWeekday(0);
|
|
2012
|
+
const timeMonday = timeWeekday(1);
|
|
2013
|
+
const timeTuesday = timeWeekday(2);
|
|
2014
|
+
const timeWednesday = timeWeekday(3);
|
|
2015
|
+
const timeThursday = timeWeekday(4);
|
|
2016
|
+
const timeFriday = timeWeekday(5);
|
|
2017
|
+
const timeSaturday = timeWeekday(6);
|
|
2030
2018
|
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
return date.getUTCDate() - 1;
|
|
2039
|
-
});
|
|
2040
|
-
utcDay.range;
|
|
2019
|
+
timeSunday.range;
|
|
2020
|
+
timeMonday.range;
|
|
2021
|
+
timeTuesday.range;
|
|
2022
|
+
timeWednesday.range;
|
|
2023
|
+
timeThursday.range;
|
|
2024
|
+
timeFriday.range;
|
|
2025
|
+
timeSaturday.range;
|
|
2041
2026
|
|
|
2042
2027
|
function utcWeekday(i) {
|
|
2043
|
-
return
|
|
2028
|
+
return timeInterval((date) => {
|
|
2044
2029
|
date.setUTCDate(date.getUTCDate() - (date.getUTCDay() + 7 - i) % 7);
|
|
2045
2030
|
date.setUTCHours(0, 0, 0, 0);
|
|
2046
|
-
},
|
|
2031
|
+
}, (date, step) => {
|
|
2047
2032
|
date.setUTCDate(date.getUTCDate() + step * 7);
|
|
2048
|
-
},
|
|
2033
|
+
}, (start, end) => {
|
|
2049
2034
|
return (end - start) / durationWeek;
|
|
2050
2035
|
});
|
|
2051
2036
|
}
|
|
2052
2037
|
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2038
|
+
const utcSunday = utcWeekday(0);
|
|
2039
|
+
const utcMonday = utcWeekday(1);
|
|
2040
|
+
const utcTuesday = utcWeekday(2);
|
|
2041
|
+
const utcWednesday = utcWeekday(3);
|
|
2042
|
+
const utcThursday = utcWeekday(4);
|
|
2043
|
+
const utcFriday = utcWeekday(5);
|
|
2044
|
+
const utcSaturday = utcWeekday(6);
|
|
2060
2045
|
|
|
2061
2046
|
utcSunday.range;
|
|
2062
2047
|
utcMonday.range;
|
|
@@ -2066,39 +2051,78 @@ var drawChart = (function (exports) {
|
|
|
2066
2051
|
utcFriday.range;
|
|
2067
2052
|
utcSaturday.range;
|
|
2068
2053
|
|
|
2069
|
-
|
|
2054
|
+
const timeMonth = timeInterval((date) => {
|
|
2055
|
+
date.setDate(1);
|
|
2056
|
+
date.setHours(0, 0, 0, 0);
|
|
2057
|
+
}, (date, step) => {
|
|
2058
|
+
date.setMonth(date.getMonth() + step);
|
|
2059
|
+
}, (start, end) => {
|
|
2060
|
+
return end.getMonth() - start.getMonth() + (end.getFullYear() - start.getFullYear()) * 12;
|
|
2061
|
+
}, (date) => {
|
|
2062
|
+
return date.getMonth();
|
|
2063
|
+
});
|
|
2064
|
+
|
|
2065
|
+
timeMonth.range;
|
|
2066
|
+
|
|
2067
|
+
const utcMonth = timeInterval((date) => {
|
|
2070
2068
|
date.setUTCDate(1);
|
|
2071
2069
|
date.setUTCHours(0, 0, 0, 0);
|
|
2072
|
-
},
|
|
2070
|
+
}, (date, step) => {
|
|
2073
2071
|
date.setUTCMonth(date.getUTCMonth() + step);
|
|
2074
|
-
},
|
|
2072
|
+
}, (start, end) => {
|
|
2075
2073
|
return end.getUTCMonth() - start.getUTCMonth() + (end.getUTCFullYear() - start.getUTCFullYear()) * 12;
|
|
2076
|
-
},
|
|
2074
|
+
}, (date) => {
|
|
2077
2075
|
return date.getUTCMonth();
|
|
2078
2076
|
});
|
|
2077
|
+
|
|
2079
2078
|
utcMonth.range;
|
|
2080
2079
|
|
|
2081
|
-
|
|
2080
|
+
const timeYear = timeInterval((date) => {
|
|
2081
|
+
date.setMonth(0, 1);
|
|
2082
|
+
date.setHours(0, 0, 0, 0);
|
|
2083
|
+
}, (date, step) => {
|
|
2084
|
+
date.setFullYear(date.getFullYear() + step);
|
|
2085
|
+
}, (start, end) => {
|
|
2086
|
+
return end.getFullYear() - start.getFullYear();
|
|
2087
|
+
}, (date) => {
|
|
2088
|
+
return date.getFullYear();
|
|
2089
|
+
});
|
|
2090
|
+
|
|
2091
|
+
// An optimized implementation for this simple case.
|
|
2092
|
+
timeYear.every = (k) => {
|
|
2093
|
+
return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : timeInterval((date) => {
|
|
2094
|
+
date.setFullYear(Math.floor(date.getFullYear() / k) * k);
|
|
2095
|
+
date.setMonth(0, 1);
|
|
2096
|
+
date.setHours(0, 0, 0, 0);
|
|
2097
|
+
}, (date, step) => {
|
|
2098
|
+
date.setFullYear(date.getFullYear() + step * k);
|
|
2099
|
+
});
|
|
2100
|
+
};
|
|
2101
|
+
|
|
2102
|
+
timeYear.range;
|
|
2103
|
+
|
|
2104
|
+
const utcYear = timeInterval((date) => {
|
|
2082
2105
|
date.setUTCMonth(0, 1);
|
|
2083
2106
|
date.setUTCHours(0, 0, 0, 0);
|
|
2084
|
-
},
|
|
2107
|
+
}, (date, step) => {
|
|
2085
2108
|
date.setUTCFullYear(date.getUTCFullYear() + step);
|
|
2086
|
-
},
|
|
2109
|
+
}, (start, end) => {
|
|
2087
2110
|
return end.getUTCFullYear() - start.getUTCFullYear();
|
|
2088
|
-
},
|
|
2111
|
+
}, (date) => {
|
|
2089
2112
|
return date.getUTCFullYear();
|
|
2090
2113
|
});
|
|
2091
2114
|
|
|
2092
2115
|
// An optimized implementation for this simple case.
|
|
2093
|
-
utcYear.every =
|
|
2094
|
-
return !isFinite(k = Math.floor(k)) || !(k > 0) ? null :
|
|
2116
|
+
utcYear.every = (k) => {
|
|
2117
|
+
return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : timeInterval((date) => {
|
|
2095
2118
|
date.setUTCFullYear(Math.floor(date.getUTCFullYear() / k) * k);
|
|
2096
2119
|
date.setUTCMonth(0, 1);
|
|
2097
2120
|
date.setUTCHours(0, 0, 0, 0);
|
|
2098
|
-
},
|
|
2121
|
+
}, (date, step) => {
|
|
2099
2122
|
date.setUTCFullYear(date.getUTCFullYear() + step * k);
|
|
2100
2123
|
});
|
|
2101
2124
|
};
|
|
2125
|
+
|
|
2102
2126
|
utcYear.range;
|
|
2103
2127
|
|
|
2104
2128
|
function localDate(d) {
|
|
@@ -2289,7 +2313,7 @@ var drawChart = (function (exports) {
|
|
|
2289
2313
|
return function(string) {
|
|
2290
2314
|
var d = newDate(1900, undefined, 1),
|
|
2291
2315
|
i = parseSpecifier(d, specifier, string += "", 0),
|
|
2292
|
-
week, day
|
|
2316
|
+
week, day;
|
|
2293
2317
|
if (i != string.length) return null;
|
|
2294
2318
|
|
|
2295
2319
|
// If a UNIX timestamp is specified, return it.
|
|
@@ -2310,25 +2334,25 @@ var drawChart = (function (exports) {
|
|
|
2310
2334
|
if (d.V < 1 || d.V > 53) return null;
|
|
2311
2335
|
if (!("w" in d)) d.w = 1;
|
|
2312
2336
|
if ("Z" in d) {
|
|
2313
|
-
week = utcDate(newDate(d.y, 0, 1)), day
|
|
2314
|
-
week = day
|
|
2337
|
+
week = utcDate(newDate(d.y, 0, 1)), day = week.getUTCDay();
|
|
2338
|
+
week = day > 4 || day === 0 ? utcMonday.ceil(week) : utcMonday(week);
|
|
2315
2339
|
week = utcDay.offset(week, (d.V - 1) * 7);
|
|
2316
2340
|
d.y = week.getUTCFullYear();
|
|
2317
2341
|
d.m = week.getUTCMonth();
|
|
2318
2342
|
d.d = week.getUTCDate() + (d.w + 6) % 7;
|
|
2319
2343
|
} else {
|
|
2320
|
-
week = localDate(newDate(d.y, 0, 1)), day
|
|
2321
|
-
week = day
|
|
2322
|
-
week =
|
|
2344
|
+
week = localDate(newDate(d.y, 0, 1)), day = week.getDay();
|
|
2345
|
+
week = day > 4 || day === 0 ? timeMonday.ceil(week) : timeMonday(week);
|
|
2346
|
+
week = timeDay.offset(week, (d.V - 1) * 7);
|
|
2323
2347
|
d.y = week.getFullYear();
|
|
2324
2348
|
d.m = week.getMonth();
|
|
2325
2349
|
d.d = week.getDate() + (d.w + 6) % 7;
|
|
2326
2350
|
}
|
|
2327
2351
|
} else if ("W" in d || "U" in d) {
|
|
2328
2352
|
if (!("w" in d)) d.w = "u" in d ? d.u % 7 : "W" in d ? 1 : 0;
|
|
2329
|
-
day
|
|
2353
|
+
day = "Z" in d ? utcDate(newDate(d.y, 0, 1)).getUTCDay() : localDate(newDate(d.y, 0, 1)).getDay();
|
|
2330
2354
|
d.m = 0;
|
|
2331
|
-
d.d = "W" in d ? (d.w + 6) % 7 + d.W * 7 - (day
|
|
2355
|
+
d.d = "W" in d ? (d.w + 6) % 7 + d.W * 7 - (day + 5) % 7 : d.w + d.U * 7 - (day + 6) % 7;
|
|
2332
2356
|
}
|
|
2333
2357
|
|
|
2334
2358
|
// If a time zone is specified, all fields are interpreted as UTC and then
|
|
@@ -2612,7 +2636,7 @@ var drawChart = (function (exports) {
|
|
|
2612
2636
|
}
|
|
2613
2637
|
|
|
2614
2638
|
function formatDayOfYear(d, p) {
|
|
2615
|
-
return pad(1 +
|
|
2639
|
+
return pad(1 + timeDay.count(timeYear(d), d), p, 3);
|
|
2616
2640
|
}
|
|
2617
2641
|
|
|
2618
2642
|
function formatMilliseconds(d, p) {
|
|
@@ -2641,17 +2665,17 @@ var drawChart = (function (exports) {
|
|
|
2641
2665
|
}
|
|
2642
2666
|
|
|
2643
2667
|
function formatWeekNumberSunday(d, p) {
|
|
2644
|
-
return pad(
|
|
2668
|
+
return pad(timeSunday.count(timeYear(d) - 1, d), p, 2);
|
|
2645
2669
|
}
|
|
2646
2670
|
|
|
2647
2671
|
function dISO(d) {
|
|
2648
2672
|
var day = d.getDay();
|
|
2649
|
-
return (day >= 4 || day === 0) ?
|
|
2673
|
+
return (day >= 4 || day === 0) ? timeThursday(d) : timeThursday.ceil(d);
|
|
2650
2674
|
}
|
|
2651
2675
|
|
|
2652
2676
|
function formatWeekNumberISO(d, p) {
|
|
2653
2677
|
d = dISO(d);
|
|
2654
|
-
return pad(
|
|
2678
|
+
return pad(timeThursday.count(timeYear(d), d) + (timeYear(d).getDay() === 4), p, 2);
|
|
2655
2679
|
}
|
|
2656
2680
|
|
|
2657
2681
|
function formatWeekdayNumberSunday(d) {
|
|
@@ -2659,7 +2683,7 @@ var drawChart = (function (exports) {
|
|
|
2659
2683
|
}
|
|
2660
2684
|
|
|
2661
2685
|
function formatWeekNumberMonday(d, p) {
|
|
2662
|
-
return pad(
|
|
2686
|
+
return pad(timeMonday.count(timeYear(d) - 1, d), p, 2);
|
|
2663
2687
|
}
|
|
2664
2688
|
|
|
2665
2689
|
function formatYear(d, p) {
|
|
@@ -2677,7 +2701,7 @@ var drawChart = (function (exports) {
|
|
|
2677
2701
|
|
|
2678
2702
|
function formatFullYearISO(d, p) {
|
|
2679
2703
|
var day = d.getDay();
|
|
2680
|
-
d = (day >= 4 || day === 0) ?
|
|
2704
|
+
d = (day >= 4 || day === 0) ? timeThursday(d) : timeThursday.ceil(d);
|
|
2681
2705
|
return pad(d.getFullYear() % 10000, p, 4);
|
|
2682
2706
|
}
|
|
2683
2707
|
|
|
@@ -4075,56 +4099,2159 @@ var drawChart = (function (exports) {
|
|
|
4075
4099
|
|
|
4076
4100
|
const COLOR_BASE = "#cecece";
|
|
4077
4101
|
|
|
4078
|
-
|
|
4079
|
-
|
|
4080
|
-
|
|
4081
|
-
|
|
4082
|
-
|
|
4083
|
-
|
|
4084
|
-
|
|
4085
|
-
|
|
4086
|
-
|
|
4087
|
-
|
|
4102
|
+
function getDefaultExportFromCjs (x) {
|
|
4103
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
4104
|
+
}
|
|
4105
|
+
|
|
4106
|
+
var picomatchBrowserExports = {};
|
|
4107
|
+
var picomatchBrowser = {
|
|
4108
|
+
get exports(){ return picomatchBrowserExports; },
|
|
4109
|
+
set exports(v){ picomatchBrowserExports = v; },
|
|
4110
|
+
};
|
|
4111
|
+
|
|
4112
|
+
var utils$3 = {};
|
|
4113
|
+
|
|
4114
|
+
const WIN_SLASH = '\\\\/';
|
|
4115
|
+
const WIN_NO_SLASH = `[^${WIN_SLASH}]`;
|
|
4116
|
+
|
|
4117
|
+
/**
|
|
4118
|
+
* Posix glob regex
|
|
4119
|
+
*/
|
|
4120
|
+
|
|
4121
|
+
const DOT_LITERAL = '\\.';
|
|
4122
|
+
const PLUS_LITERAL = '\\+';
|
|
4123
|
+
const QMARK_LITERAL = '\\?';
|
|
4124
|
+
const SLASH_LITERAL = '\\/';
|
|
4125
|
+
const ONE_CHAR = '(?=.)';
|
|
4126
|
+
const QMARK = '[^/]';
|
|
4127
|
+
const END_ANCHOR = `(?:${SLASH_LITERAL}|$)`;
|
|
4128
|
+
const START_ANCHOR = `(?:^|${SLASH_LITERAL})`;
|
|
4129
|
+
const DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`;
|
|
4130
|
+
const NO_DOT = `(?!${DOT_LITERAL})`;
|
|
4131
|
+
const NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`;
|
|
4132
|
+
const NO_DOT_SLASH = `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`;
|
|
4133
|
+
const NO_DOTS_SLASH = `(?!${DOTS_SLASH})`;
|
|
4134
|
+
const QMARK_NO_DOT = `[^.${SLASH_LITERAL}]`;
|
|
4135
|
+
const STAR = `${QMARK}*?`;
|
|
4136
|
+
const SEP = '/';
|
|
4137
|
+
|
|
4138
|
+
const POSIX_CHARS = {
|
|
4139
|
+
DOT_LITERAL,
|
|
4140
|
+
PLUS_LITERAL,
|
|
4141
|
+
QMARK_LITERAL,
|
|
4142
|
+
SLASH_LITERAL,
|
|
4143
|
+
ONE_CHAR,
|
|
4144
|
+
QMARK,
|
|
4145
|
+
END_ANCHOR,
|
|
4146
|
+
DOTS_SLASH,
|
|
4147
|
+
NO_DOT,
|
|
4148
|
+
NO_DOTS,
|
|
4149
|
+
NO_DOT_SLASH,
|
|
4150
|
+
NO_DOTS_SLASH,
|
|
4151
|
+
QMARK_NO_DOT,
|
|
4152
|
+
STAR,
|
|
4153
|
+
START_ANCHOR,
|
|
4154
|
+
SEP
|
|
4155
|
+
};
|
|
4156
|
+
|
|
4157
|
+
/**
|
|
4158
|
+
* Windows glob regex
|
|
4159
|
+
*/
|
|
4160
|
+
|
|
4161
|
+
const WINDOWS_CHARS = {
|
|
4162
|
+
...POSIX_CHARS,
|
|
4163
|
+
|
|
4164
|
+
SLASH_LITERAL: `[${WIN_SLASH}]`,
|
|
4165
|
+
QMARK: WIN_NO_SLASH,
|
|
4166
|
+
STAR: `${WIN_NO_SLASH}*?`,
|
|
4167
|
+
DOTS_SLASH: `${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`,
|
|
4168
|
+
NO_DOT: `(?!${DOT_LITERAL})`,
|
|
4169
|
+
NO_DOTS: `(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
|
|
4170
|
+
NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`,
|
|
4171
|
+
NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
|
|
4172
|
+
QMARK_NO_DOT: `[^.${WIN_SLASH}]`,
|
|
4173
|
+
START_ANCHOR: `(?:^|[${WIN_SLASH}])`,
|
|
4174
|
+
END_ANCHOR: `(?:[${WIN_SLASH}]|$)`,
|
|
4175
|
+
SEP: '\\'
|
|
4176
|
+
};
|
|
4177
|
+
|
|
4178
|
+
/**
|
|
4179
|
+
* POSIX Bracket Regex
|
|
4180
|
+
*/
|
|
4181
|
+
|
|
4182
|
+
const POSIX_REGEX_SOURCE$1 = {
|
|
4183
|
+
alnum: 'a-zA-Z0-9',
|
|
4184
|
+
alpha: 'a-zA-Z',
|
|
4185
|
+
ascii: '\\x00-\\x7F',
|
|
4186
|
+
blank: ' \\t',
|
|
4187
|
+
cntrl: '\\x00-\\x1F\\x7F',
|
|
4188
|
+
digit: '0-9',
|
|
4189
|
+
graph: '\\x21-\\x7E',
|
|
4190
|
+
lower: 'a-z',
|
|
4191
|
+
print: '\\x20-\\x7E ',
|
|
4192
|
+
punct: '\\-!"#$%&\'()\\*+,./:;<=>?@[\\]^_`{|}~',
|
|
4193
|
+
space: ' \\t\\r\\n\\v\\f',
|
|
4194
|
+
upper: 'A-Z',
|
|
4195
|
+
word: 'A-Za-z0-9_',
|
|
4196
|
+
xdigit: 'A-Fa-f0-9'
|
|
4197
|
+
};
|
|
4198
|
+
|
|
4199
|
+
var constants$2 = {
|
|
4200
|
+
MAX_LENGTH: 1024 * 64,
|
|
4201
|
+
POSIX_REGEX_SOURCE: POSIX_REGEX_SOURCE$1,
|
|
4202
|
+
|
|
4203
|
+
// regular expressions
|
|
4204
|
+
REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g,
|
|
4205
|
+
REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/,
|
|
4206
|
+
REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/,
|
|
4207
|
+
REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g,
|
|
4208
|
+
REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g,
|
|
4209
|
+
REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g,
|
|
4210
|
+
|
|
4211
|
+
// Replace globs with equivalent patterns to reduce parsing time.
|
|
4212
|
+
REPLACEMENTS: {
|
|
4213
|
+
'***': '*',
|
|
4214
|
+
'**/**': '**',
|
|
4215
|
+
'**/**/**': '**'
|
|
4216
|
+
},
|
|
4217
|
+
|
|
4218
|
+
// Digits
|
|
4219
|
+
CHAR_0: 48, /* 0 */
|
|
4220
|
+
CHAR_9: 57, /* 9 */
|
|
4221
|
+
|
|
4222
|
+
// Alphabet chars.
|
|
4223
|
+
CHAR_UPPERCASE_A: 65, /* A */
|
|
4224
|
+
CHAR_LOWERCASE_A: 97, /* a */
|
|
4225
|
+
CHAR_UPPERCASE_Z: 90, /* Z */
|
|
4226
|
+
CHAR_LOWERCASE_Z: 122, /* z */
|
|
4227
|
+
|
|
4228
|
+
CHAR_LEFT_PARENTHESES: 40, /* ( */
|
|
4229
|
+
CHAR_RIGHT_PARENTHESES: 41, /* ) */
|
|
4230
|
+
|
|
4231
|
+
CHAR_ASTERISK: 42, /* * */
|
|
4232
|
+
|
|
4233
|
+
// Non-alphabetic chars.
|
|
4234
|
+
CHAR_AMPERSAND: 38, /* & */
|
|
4235
|
+
CHAR_AT: 64, /* @ */
|
|
4236
|
+
CHAR_BACKWARD_SLASH: 92, /* \ */
|
|
4237
|
+
CHAR_CARRIAGE_RETURN: 13, /* \r */
|
|
4238
|
+
CHAR_CIRCUMFLEX_ACCENT: 94, /* ^ */
|
|
4239
|
+
CHAR_COLON: 58, /* : */
|
|
4240
|
+
CHAR_COMMA: 44, /* , */
|
|
4241
|
+
CHAR_DOT: 46, /* . */
|
|
4242
|
+
CHAR_DOUBLE_QUOTE: 34, /* " */
|
|
4243
|
+
CHAR_EQUAL: 61, /* = */
|
|
4244
|
+
CHAR_EXCLAMATION_MARK: 33, /* ! */
|
|
4245
|
+
CHAR_FORM_FEED: 12, /* \f */
|
|
4246
|
+
CHAR_FORWARD_SLASH: 47, /* / */
|
|
4247
|
+
CHAR_GRAVE_ACCENT: 96, /* ` */
|
|
4248
|
+
CHAR_HASH: 35, /* # */
|
|
4249
|
+
CHAR_HYPHEN_MINUS: 45, /* - */
|
|
4250
|
+
CHAR_LEFT_ANGLE_BRACKET: 60, /* < */
|
|
4251
|
+
CHAR_LEFT_CURLY_BRACE: 123, /* { */
|
|
4252
|
+
CHAR_LEFT_SQUARE_BRACKET: 91, /* [ */
|
|
4253
|
+
CHAR_LINE_FEED: 10, /* \n */
|
|
4254
|
+
CHAR_NO_BREAK_SPACE: 160, /* \u00A0 */
|
|
4255
|
+
CHAR_PERCENT: 37, /* % */
|
|
4256
|
+
CHAR_PLUS: 43, /* + */
|
|
4257
|
+
CHAR_QUESTION_MARK: 63, /* ? */
|
|
4258
|
+
CHAR_RIGHT_ANGLE_BRACKET: 62, /* > */
|
|
4259
|
+
CHAR_RIGHT_CURLY_BRACE: 125, /* } */
|
|
4260
|
+
CHAR_RIGHT_SQUARE_BRACKET: 93, /* ] */
|
|
4261
|
+
CHAR_SEMICOLON: 59, /* ; */
|
|
4262
|
+
CHAR_SINGLE_QUOTE: 39, /* ' */
|
|
4263
|
+
CHAR_SPACE: 32, /* */
|
|
4264
|
+
CHAR_TAB: 9, /* \t */
|
|
4265
|
+
CHAR_UNDERSCORE: 95, /* _ */
|
|
4266
|
+
CHAR_VERTICAL_LINE: 124, /* | */
|
|
4267
|
+
CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279, /* \uFEFF */
|
|
4268
|
+
|
|
4269
|
+
/**
|
|
4270
|
+
* Create EXTGLOB_CHARS
|
|
4271
|
+
*/
|
|
4272
|
+
|
|
4273
|
+
extglobChars(chars) {
|
|
4274
|
+
return {
|
|
4275
|
+
'!': { type: 'negate', open: '(?:(?!(?:', close: `))${chars.STAR})` },
|
|
4276
|
+
'?': { type: 'qmark', open: '(?:', close: ')?' },
|
|
4277
|
+
'+': { type: 'plus', open: '(?:', close: ')+' },
|
|
4278
|
+
'*': { type: 'star', open: '(?:', close: ')*' },
|
|
4279
|
+
'@': { type: 'at', open: '(?:', close: ')' }
|
|
4088
4280
|
};
|
|
4281
|
+
},
|
|
4282
|
+
|
|
4283
|
+
/**
|
|
4284
|
+
* Create GLOB_CHARS
|
|
4285
|
+
*/
|
|
4286
|
+
|
|
4287
|
+
globChars(win32) {
|
|
4288
|
+
return win32 === true ? WINDOWS_CHARS : POSIX_CHARS;
|
|
4289
|
+
}
|
|
4089
4290
|
};
|
|
4090
|
-
|
|
4091
|
-
|
|
4092
|
-
|
|
4093
|
-
|
|
4094
|
-
|
|
4095
|
-
|
|
4096
|
-
|
|
4097
|
-
|
|
4098
|
-
|
|
4099
|
-
|
|
4100
|
-
|
|
4101
|
-
|
|
4291
|
+
|
|
4292
|
+
(function (exports) {
|
|
4293
|
+
|
|
4294
|
+
const {
|
|
4295
|
+
REGEX_BACKSLASH,
|
|
4296
|
+
REGEX_REMOVE_BACKSLASH,
|
|
4297
|
+
REGEX_SPECIAL_CHARS,
|
|
4298
|
+
REGEX_SPECIAL_CHARS_GLOBAL
|
|
4299
|
+
} = constants$2;
|
|
4300
|
+
|
|
4301
|
+
exports.isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val);
|
|
4302
|
+
exports.hasRegexChars = str => REGEX_SPECIAL_CHARS.test(str);
|
|
4303
|
+
exports.isRegexChar = str => str.length === 1 && exports.hasRegexChars(str);
|
|
4304
|
+
exports.escapeRegex = str => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, '\\$1');
|
|
4305
|
+
exports.toPosixSlashes = str => str.replace(REGEX_BACKSLASH, '/');
|
|
4306
|
+
|
|
4307
|
+
exports.removeBackslashes = str => {
|
|
4308
|
+
return str.replace(REGEX_REMOVE_BACKSLASH, match => {
|
|
4309
|
+
return match === '\\' ? '' : match;
|
|
4310
|
+
});
|
|
4311
|
+
};
|
|
4312
|
+
|
|
4313
|
+
exports.supportsLookbehinds = () => {
|
|
4314
|
+
const segs = process.version.slice(1).split('.').map(Number);
|
|
4315
|
+
if (segs.length === 3 && segs[0] >= 9 || (segs[0] === 8 && segs[1] >= 10)) {
|
|
4316
|
+
return true;
|
|
4317
|
+
}
|
|
4318
|
+
return false;
|
|
4319
|
+
};
|
|
4320
|
+
|
|
4321
|
+
exports.escapeLast = (input, char, lastIdx) => {
|
|
4322
|
+
const idx = input.lastIndexOf(char, lastIdx);
|
|
4323
|
+
if (idx === -1) return input;
|
|
4324
|
+
if (input[idx - 1] === '\\') return exports.escapeLast(input, char, idx - 1);
|
|
4325
|
+
return `${input.slice(0, idx)}\\${input.slice(idx)}`;
|
|
4326
|
+
};
|
|
4327
|
+
|
|
4328
|
+
exports.removePrefix = (input, state = {}) => {
|
|
4329
|
+
let output = input;
|
|
4330
|
+
if (output.startsWith('./')) {
|
|
4331
|
+
output = output.slice(2);
|
|
4332
|
+
state.prefix = './';
|
|
4333
|
+
}
|
|
4334
|
+
return output;
|
|
4335
|
+
};
|
|
4336
|
+
|
|
4337
|
+
exports.wrapOutput = (input, state = {}, options = {}) => {
|
|
4338
|
+
const prepend = options.contains ? '' : '^';
|
|
4339
|
+
const append = options.contains ? '' : '$';
|
|
4340
|
+
|
|
4341
|
+
let output = `${prepend}(?:${input})${append}`;
|
|
4342
|
+
if (state.negated === true) {
|
|
4343
|
+
output = `(?:^(?!${output}).*$)`;
|
|
4344
|
+
}
|
|
4345
|
+
return output;
|
|
4346
|
+
};
|
|
4347
|
+
|
|
4348
|
+
exports.basename = (path, { windows } = {}) => {
|
|
4349
|
+
if (windows) {
|
|
4350
|
+
return path.replace(/[\\/]$/, '').replace(/.*[\\/]/, '');
|
|
4351
|
+
} else {
|
|
4352
|
+
return path.replace(/\/$/, '').replace(/.*\//, '');
|
|
4353
|
+
}
|
|
4354
|
+
};
|
|
4355
|
+
} (utils$3));
|
|
4356
|
+
|
|
4357
|
+
const utils$2 = utils$3;
|
|
4358
|
+
const {
|
|
4359
|
+
CHAR_ASTERISK, /* * */
|
|
4360
|
+
CHAR_AT, /* @ */
|
|
4361
|
+
CHAR_BACKWARD_SLASH, /* \ */
|
|
4362
|
+
CHAR_COMMA, /* , */
|
|
4363
|
+
CHAR_DOT, /* . */
|
|
4364
|
+
CHAR_EXCLAMATION_MARK, /* ! */
|
|
4365
|
+
CHAR_FORWARD_SLASH, /* / */
|
|
4366
|
+
CHAR_LEFT_CURLY_BRACE, /* { */
|
|
4367
|
+
CHAR_LEFT_PARENTHESES, /* ( */
|
|
4368
|
+
CHAR_LEFT_SQUARE_BRACKET, /* [ */
|
|
4369
|
+
CHAR_PLUS, /* + */
|
|
4370
|
+
CHAR_QUESTION_MARK, /* ? */
|
|
4371
|
+
CHAR_RIGHT_CURLY_BRACE, /* } */
|
|
4372
|
+
CHAR_RIGHT_PARENTHESES, /* ) */
|
|
4373
|
+
CHAR_RIGHT_SQUARE_BRACKET /* ] */
|
|
4374
|
+
} = constants$2;
|
|
4375
|
+
|
|
4376
|
+
const isPathSeparator = code => {
|
|
4377
|
+
return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;
|
|
4378
|
+
};
|
|
4379
|
+
|
|
4380
|
+
const depth = token => {
|
|
4381
|
+
if (token.isPrefix !== true) {
|
|
4382
|
+
token.depth = token.isGlobstar ? Infinity : 1;
|
|
4383
|
+
}
|
|
4384
|
+
};
|
|
4385
|
+
|
|
4386
|
+
/**
|
|
4387
|
+
* Quickly scans a glob pattern and returns an object with a handful of
|
|
4388
|
+
* useful properties, like `isGlob`, `path` (the leading non-glob, if it exists),
|
|
4389
|
+
* `glob` (the actual pattern), and `negated` (true if the path starts with `!`).
|
|
4390
|
+
*
|
|
4391
|
+
* ```js
|
|
4392
|
+
* const pm = require('picomatch');
|
|
4393
|
+
* console.log(pm.scan('foo/bar/*.js'));
|
|
4394
|
+
* { isGlob: true, input: 'foo/bar/*.js', base: 'foo/bar', glob: '*.js' }
|
|
4395
|
+
* ```
|
|
4396
|
+
* @param {String} `str`
|
|
4397
|
+
* @param {Object} `options`
|
|
4398
|
+
* @return {Object} Returns an object with tokens and regex source string.
|
|
4399
|
+
* @api public
|
|
4400
|
+
*/
|
|
4401
|
+
|
|
4402
|
+
const scan$1 = (input, options) => {
|
|
4403
|
+
const opts = options || {};
|
|
4404
|
+
|
|
4405
|
+
const length = input.length - 1;
|
|
4406
|
+
const scanToEnd = opts.parts === true || opts.scanToEnd === true;
|
|
4407
|
+
const slashes = [];
|
|
4408
|
+
const tokens = [];
|
|
4409
|
+
const parts = [];
|
|
4410
|
+
|
|
4411
|
+
let str = input;
|
|
4412
|
+
let index = -1;
|
|
4413
|
+
let start = 0;
|
|
4414
|
+
let lastIndex = 0;
|
|
4415
|
+
let isBrace = false;
|
|
4416
|
+
let isBracket = false;
|
|
4417
|
+
let isGlob = false;
|
|
4418
|
+
let isExtglob = false;
|
|
4419
|
+
let isGlobstar = false;
|
|
4420
|
+
let braceEscaped = false;
|
|
4421
|
+
let backslashes = false;
|
|
4422
|
+
let negated = false;
|
|
4423
|
+
let finished = false;
|
|
4424
|
+
let braces = 0;
|
|
4425
|
+
let prev;
|
|
4426
|
+
let code;
|
|
4427
|
+
let token = { value: '', depth: 0, isGlob: false };
|
|
4428
|
+
|
|
4429
|
+
const eos = () => index >= length;
|
|
4430
|
+
const peek = () => str.charCodeAt(index + 1);
|
|
4431
|
+
const advance = () => {
|
|
4432
|
+
prev = code;
|
|
4433
|
+
return str.charCodeAt(++index);
|
|
4434
|
+
};
|
|
4435
|
+
|
|
4436
|
+
while (index < length) {
|
|
4437
|
+
code = advance();
|
|
4438
|
+
let next;
|
|
4439
|
+
|
|
4440
|
+
if (code === CHAR_BACKWARD_SLASH) {
|
|
4441
|
+
backslashes = token.backslashes = true;
|
|
4442
|
+
code = advance();
|
|
4443
|
+
|
|
4444
|
+
if (code === CHAR_LEFT_CURLY_BRACE) {
|
|
4445
|
+
braceEscaped = true;
|
|
4446
|
+
}
|
|
4447
|
+
continue;
|
|
4448
|
+
}
|
|
4449
|
+
|
|
4450
|
+
if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE) {
|
|
4451
|
+
braces++;
|
|
4452
|
+
|
|
4453
|
+
while (eos() !== true && (code = advance())) {
|
|
4454
|
+
if (code === CHAR_BACKWARD_SLASH) {
|
|
4455
|
+
backslashes = token.backslashes = true;
|
|
4456
|
+
advance();
|
|
4457
|
+
continue;
|
|
4102
4458
|
}
|
|
4103
|
-
|
|
4104
|
-
|
|
4459
|
+
|
|
4460
|
+
if (code === CHAR_LEFT_CURLY_BRACE) {
|
|
4461
|
+
braces++;
|
|
4462
|
+
continue;
|
|
4105
4463
|
}
|
|
4106
|
-
|
|
4107
|
-
|
|
4108
|
-
|
|
4109
|
-
|
|
4464
|
+
|
|
4465
|
+
if (braceEscaped !== true && code === CHAR_DOT && (code = advance()) === CHAR_DOT) {
|
|
4466
|
+
isBrace = token.isBrace = true;
|
|
4467
|
+
isGlob = token.isGlob = true;
|
|
4468
|
+
finished = true;
|
|
4469
|
+
|
|
4470
|
+
if (scanToEnd === true) {
|
|
4471
|
+
continue;
|
|
4472
|
+
}
|
|
4473
|
+
|
|
4474
|
+
break;
|
|
4110
4475
|
}
|
|
4111
|
-
|
|
4112
|
-
|
|
4113
|
-
|
|
4476
|
+
|
|
4477
|
+
if (braceEscaped !== true && code === CHAR_COMMA) {
|
|
4478
|
+
isBrace = token.isBrace = true;
|
|
4479
|
+
isGlob = token.isGlob = true;
|
|
4480
|
+
finished = true;
|
|
4481
|
+
|
|
4482
|
+
if (scanToEnd === true) {
|
|
4483
|
+
continue;
|
|
4484
|
+
}
|
|
4485
|
+
|
|
4486
|
+
break;
|
|
4114
4487
|
}
|
|
4115
|
-
|
|
4116
|
-
|
|
4488
|
+
|
|
4489
|
+
if (code === CHAR_RIGHT_CURLY_BRACE) {
|
|
4490
|
+
braces--;
|
|
4491
|
+
|
|
4492
|
+
if (braces === 0) {
|
|
4493
|
+
braceEscaped = false;
|
|
4494
|
+
isBrace = token.isBrace = true;
|
|
4495
|
+
finished = true;
|
|
4496
|
+
break;
|
|
4497
|
+
}
|
|
4117
4498
|
}
|
|
4118
|
-
|
|
4119
|
-
|
|
4120
|
-
|
|
4121
|
-
|
|
4122
|
-
|
|
4123
|
-
|
|
4499
|
+
}
|
|
4500
|
+
|
|
4501
|
+
if (scanToEnd === true) {
|
|
4502
|
+
continue;
|
|
4503
|
+
}
|
|
4504
|
+
|
|
4505
|
+
break;
|
|
4506
|
+
}
|
|
4507
|
+
|
|
4508
|
+
if (code === CHAR_FORWARD_SLASH) {
|
|
4509
|
+
slashes.push(index);
|
|
4510
|
+
tokens.push(token);
|
|
4511
|
+
token = { value: '', depth: 0, isGlob: false };
|
|
4512
|
+
|
|
4513
|
+
if (finished === true) continue;
|
|
4514
|
+
if (prev === CHAR_DOT && index === (start + 1)) {
|
|
4515
|
+
start += 2;
|
|
4516
|
+
continue;
|
|
4517
|
+
}
|
|
4518
|
+
|
|
4519
|
+
lastIndex = index + 1;
|
|
4520
|
+
continue;
|
|
4521
|
+
}
|
|
4522
|
+
|
|
4523
|
+
if (opts.noext !== true) {
|
|
4524
|
+
const isExtglobChar = code === CHAR_PLUS
|
|
4525
|
+
|| code === CHAR_AT
|
|
4526
|
+
|| code === CHAR_ASTERISK
|
|
4527
|
+
|| code === CHAR_QUESTION_MARK
|
|
4528
|
+
|| code === CHAR_EXCLAMATION_MARK;
|
|
4529
|
+
|
|
4530
|
+
if (isExtglobChar === true && peek() === CHAR_LEFT_PARENTHESES) {
|
|
4531
|
+
isGlob = token.isGlob = true;
|
|
4532
|
+
isExtglob = token.isExtglob = true;
|
|
4533
|
+
finished = true;
|
|
4534
|
+
|
|
4535
|
+
if (scanToEnd === true) {
|
|
4536
|
+
while (eos() !== true && (code = advance())) {
|
|
4537
|
+
if (code === CHAR_BACKWARD_SLASH) {
|
|
4538
|
+
backslashes = token.backslashes = true;
|
|
4539
|
+
code = advance();
|
|
4540
|
+
continue;
|
|
4124
4541
|
}
|
|
4125
|
-
|
|
4126
|
-
|
|
4127
|
-
|
|
4542
|
+
|
|
4543
|
+
if (code === CHAR_RIGHT_PARENTHESES) {
|
|
4544
|
+
isGlob = token.isGlob = true;
|
|
4545
|
+
finished = true;
|
|
4546
|
+
break;
|
|
4547
|
+
}
|
|
4548
|
+
}
|
|
4549
|
+
continue;
|
|
4550
|
+
}
|
|
4551
|
+
break;
|
|
4552
|
+
}
|
|
4553
|
+
}
|
|
4554
|
+
|
|
4555
|
+
if (code === CHAR_ASTERISK) {
|
|
4556
|
+
if (prev === CHAR_ASTERISK) isGlobstar = token.isGlobstar = true;
|
|
4557
|
+
isGlob = token.isGlob = true;
|
|
4558
|
+
finished = true;
|
|
4559
|
+
|
|
4560
|
+
if (scanToEnd === true) {
|
|
4561
|
+
continue;
|
|
4562
|
+
}
|
|
4563
|
+
break;
|
|
4564
|
+
}
|
|
4565
|
+
|
|
4566
|
+
if (code === CHAR_QUESTION_MARK) {
|
|
4567
|
+
isGlob = token.isGlob = true;
|
|
4568
|
+
finished = true;
|
|
4569
|
+
|
|
4570
|
+
if (scanToEnd === true) {
|
|
4571
|
+
continue;
|
|
4572
|
+
}
|
|
4573
|
+
break;
|
|
4574
|
+
}
|
|
4575
|
+
|
|
4576
|
+
if (code === CHAR_LEFT_SQUARE_BRACKET) {
|
|
4577
|
+
while (eos() !== true && (next = advance())) {
|
|
4578
|
+
if (next === CHAR_BACKWARD_SLASH) {
|
|
4579
|
+
backslashes = token.backslashes = true;
|
|
4580
|
+
advance();
|
|
4581
|
+
continue;
|
|
4582
|
+
}
|
|
4583
|
+
|
|
4584
|
+
if (next === CHAR_RIGHT_SQUARE_BRACKET) {
|
|
4585
|
+
isBracket = token.isBracket = true;
|
|
4586
|
+
isGlob = token.isGlob = true;
|
|
4587
|
+
finished = true;
|
|
4588
|
+
|
|
4589
|
+
if (scanToEnd === true) {
|
|
4590
|
+
continue;
|
|
4591
|
+
}
|
|
4592
|
+
break;
|
|
4593
|
+
}
|
|
4594
|
+
}
|
|
4595
|
+
}
|
|
4596
|
+
|
|
4597
|
+
if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) {
|
|
4598
|
+
negated = token.negated = true;
|
|
4599
|
+
start++;
|
|
4600
|
+
continue;
|
|
4601
|
+
}
|
|
4602
|
+
|
|
4603
|
+
if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES) {
|
|
4604
|
+
isGlob = token.isGlob = true;
|
|
4605
|
+
|
|
4606
|
+
if (scanToEnd === true) {
|
|
4607
|
+
while (eos() !== true && (code = advance())) {
|
|
4608
|
+
if (code === CHAR_LEFT_PARENTHESES) {
|
|
4609
|
+
backslashes = token.backslashes = true;
|
|
4610
|
+
code = advance();
|
|
4611
|
+
continue;
|
|
4612
|
+
}
|
|
4613
|
+
|
|
4614
|
+
if (code === CHAR_RIGHT_PARENTHESES) {
|
|
4615
|
+
finished = true;
|
|
4616
|
+
break;
|
|
4617
|
+
}
|
|
4618
|
+
}
|
|
4619
|
+
continue;
|
|
4620
|
+
}
|
|
4621
|
+
break;
|
|
4622
|
+
}
|
|
4623
|
+
|
|
4624
|
+
if (isGlob === true) {
|
|
4625
|
+
finished = true;
|
|
4626
|
+
|
|
4627
|
+
if (scanToEnd === true) {
|
|
4628
|
+
continue;
|
|
4629
|
+
}
|
|
4630
|
+
|
|
4631
|
+
break;
|
|
4632
|
+
}
|
|
4633
|
+
}
|
|
4634
|
+
|
|
4635
|
+
if (opts.noext === true) {
|
|
4636
|
+
isExtglob = false;
|
|
4637
|
+
isGlob = false;
|
|
4638
|
+
}
|
|
4639
|
+
|
|
4640
|
+
let base = str;
|
|
4641
|
+
let prefix = '';
|
|
4642
|
+
let glob = '';
|
|
4643
|
+
|
|
4644
|
+
if (start > 0) {
|
|
4645
|
+
prefix = str.slice(0, start);
|
|
4646
|
+
str = str.slice(start);
|
|
4647
|
+
lastIndex -= start;
|
|
4648
|
+
}
|
|
4649
|
+
|
|
4650
|
+
if (base && isGlob === true && lastIndex > 0) {
|
|
4651
|
+
base = str.slice(0, lastIndex);
|
|
4652
|
+
glob = str.slice(lastIndex);
|
|
4653
|
+
} else if (isGlob === true) {
|
|
4654
|
+
base = '';
|
|
4655
|
+
glob = str;
|
|
4656
|
+
} else {
|
|
4657
|
+
base = str;
|
|
4658
|
+
}
|
|
4659
|
+
|
|
4660
|
+
if (base && base !== '' && base !== '/' && base !== str) {
|
|
4661
|
+
if (isPathSeparator(base.charCodeAt(base.length - 1))) {
|
|
4662
|
+
base = base.slice(0, -1);
|
|
4663
|
+
}
|
|
4664
|
+
}
|
|
4665
|
+
|
|
4666
|
+
if (opts.unescape === true) {
|
|
4667
|
+
if (glob) glob = utils$2.removeBackslashes(glob);
|
|
4668
|
+
|
|
4669
|
+
if (base && backslashes === true) {
|
|
4670
|
+
base = utils$2.removeBackslashes(base);
|
|
4671
|
+
}
|
|
4672
|
+
}
|
|
4673
|
+
|
|
4674
|
+
const state = {
|
|
4675
|
+
prefix,
|
|
4676
|
+
input,
|
|
4677
|
+
start,
|
|
4678
|
+
base,
|
|
4679
|
+
glob,
|
|
4680
|
+
isBrace,
|
|
4681
|
+
isBracket,
|
|
4682
|
+
isGlob,
|
|
4683
|
+
isExtglob,
|
|
4684
|
+
isGlobstar,
|
|
4685
|
+
negated
|
|
4686
|
+
};
|
|
4687
|
+
|
|
4688
|
+
if (opts.tokens === true) {
|
|
4689
|
+
state.maxDepth = 0;
|
|
4690
|
+
if (!isPathSeparator(code)) {
|
|
4691
|
+
tokens.push(token);
|
|
4692
|
+
}
|
|
4693
|
+
state.tokens = tokens;
|
|
4694
|
+
}
|
|
4695
|
+
|
|
4696
|
+
if (opts.parts === true || opts.tokens === true) {
|
|
4697
|
+
let prevIndex;
|
|
4698
|
+
|
|
4699
|
+
for (let idx = 0; idx < slashes.length; idx++) {
|
|
4700
|
+
const n = prevIndex ? prevIndex + 1 : start;
|
|
4701
|
+
const i = slashes[idx];
|
|
4702
|
+
const value = input.slice(n, i);
|
|
4703
|
+
if (opts.tokens) {
|
|
4704
|
+
if (idx === 0 && start !== 0) {
|
|
4705
|
+
tokens[idx].isPrefix = true;
|
|
4706
|
+
tokens[idx].value = prefix;
|
|
4707
|
+
} else {
|
|
4708
|
+
tokens[idx].value = value;
|
|
4709
|
+
}
|
|
4710
|
+
depth(tokens[idx]);
|
|
4711
|
+
state.maxDepth += tokens[idx].depth;
|
|
4712
|
+
}
|
|
4713
|
+
if (idx !== 0 || value !== '') {
|
|
4714
|
+
parts.push(value);
|
|
4715
|
+
}
|
|
4716
|
+
prevIndex = i;
|
|
4717
|
+
}
|
|
4718
|
+
|
|
4719
|
+
if (prevIndex && prevIndex + 1 < input.length) {
|
|
4720
|
+
const value = input.slice(prevIndex + 1);
|
|
4721
|
+
parts.push(value);
|
|
4722
|
+
|
|
4723
|
+
if (opts.tokens) {
|
|
4724
|
+
tokens[tokens.length - 1].value = value;
|
|
4725
|
+
depth(tokens[tokens.length - 1]);
|
|
4726
|
+
state.maxDepth += tokens[tokens.length - 1].depth;
|
|
4727
|
+
}
|
|
4728
|
+
}
|
|
4729
|
+
|
|
4730
|
+
state.slashes = slashes;
|
|
4731
|
+
state.parts = parts;
|
|
4732
|
+
}
|
|
4733
|
+
|
|
4734
|
+
return state;
|
|
4735
|
+
};
|
|
4736
|
+
|
|
4737
|
+
var scan_1 = scan$1;
|
|
4738
|
+
|
|
4739
|
+
const constants$1 = constants$2;
|
|
4740
|
+
const utils$1 = utils$3;
|
|
4741
|
+
|
|
4742
|
+
/**
|
|
4743
|
+
* Constants
|
|
4744
|
+
*/
|
|
4745
|
+
|
|
4746
|
+
const {
|
|
4747
|
+
MAX_LENGTH,
|
|
4748
|
+
POSIX_REGEX_SOURCE,
|
|
4749
|
+
REGEX_NON_SPECIAL_CHARS,
|
|
4750
|
+
REGEX_SPECIAL_CHARS_BACKREF,
|
|
4751
|
+
REPLACEMENTS
|
|
4752
|
+
} = constants$1;
|
|
4753
|
+
|
|
4754
|
+
/**
|
|
4755
|
+
* Helpers
|
|
4756
|
+
*/
|
|
4757
|
+
|
|
4758
|
+
const expandRange = (args, options) => {
|
|
4759
|
+
if (typeof options.expandRange === 'function') {
|
|
4760
|
+
return options.expandRange(...args, options);
|
|
4761
|
+
}
|
|
4762
|
+
|
|
4763
|
+
args.sort();
|
|
4764
|
+
const value = `[${args.join('-')}]`;
|
|
4765
|
+
|
|
4766
|
+
try {
|
|
4767
|
+
/* eslint-disable-next-line no-new */
|
|
4768
|
+
new RegExp(value);
|
|
4769
|
+
} catch (ex) {
|
|
4770
|
+
return args.map(v => utils$1.escapeRegex(v)).join('..');
|
|
4771
|
+
}
|
|
4772
|
+
|
|
4773
|
+
return value;
|
|
4774
|
+
};
|
|
4775
|
+
|
|
4776
|
+
/**
|
|
4777
|
+
* Create the message for a syntax error
|
|
4778
|
+
*/
|
|
4779
|
+
|
|
4780
|
+
const syntaxError = (type, char) => {
|
|
4781
|
+
return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`;
|
|
4782
|
+
};
|
|
4783
|
+
|
|
4784
|
+
/**
|
|
4785
|
+
* Parse the given input string.
|
|
4786
|
+
* @param {String} input
|
|
4787
|
+
* @param {Object} options
|
|
4788
|
+
* @return {Object}
|
|
4789
|
+
*/
|
|
4790
|
+
|
|
4791
|
+
const parse$1 = (input, options) => {
|
|
4792
|
+
if (typeof input !== 'string') {
|
|
4793
|
+
throw new TypeError('Expected a string');
|
|
4794
|
+
}
|
|
4795
|
+
|
|
4796
|
+
input = REPLACEMENTS[input] || input;
|
|
4797
|
+
|
|
4798
|
+
const opts = { ...options };
|
|
4799
|
+
const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
|
|
4800
|
+
|
|
4801
|
+
let len = input.length;
|
|
4802
|
+
if (len > max) {
|
|
4803
|
+
throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
|
|
4804
|
+
}
|
|
4805
|
+
|
|
4806
|
+
const bos = { type: 'bos', value: '', output: opts.prepend || '' };
|
|
4807
|
+
const tokens = [bos];
|
|
4808
|
+
|
|
4809
|
+
const capture = opts.capture ? '' : '?:';
|
|
4810
|
+
|
|
4811
|
+
// create constants based on platform, for windows or posix
|
|
4812
|
+
const PLATFORM_CHARS = constants$1.globChars(opts.windows);
|
|
4813
|
+
const EXTGLOB_CHARS = constants$1.extglobChars(PLATFORM_CHARS);
|
|
4814
|
+
|
|
4815
|
+
const {
|
|
4816
|
+
DOT_LITERAL,
|
|
4817
|
+
PLUS_LITERAL,
|
|
4818
|
+
SLASH_LITERAL,
|
|
4819
|
+
ONE_CHAR,
|
|
4820
|
+
DOTS_SLASH,
|
|
4821
|
+
NO_DOT,
|
|
4822
|
+
NO_DOT_SLASH,
|
|
4823
|
+
NO_DOTS_SLASH,
|
|
4824
|
+
QMARK,
|
|
4825
|
+
QMARK_NO_DOT,
|
|
4826
|
+
STAR,
|
|
4827
|
+
START_ANCHOR
|
|
4828
|
+
} = PLATFORM_CHARS;
|
|
4829
|
+
|
|
4830
|
+
const globstar = (opts) => {
|
|
4831
|
+
return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
|
|
4832
|
+
};
|
|
4833
|
+
|
|
4834
|
+
const nodot = opts.dot ? '' : NO_DOT;
|
|
4835
|
+
const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT;
|
|
4836
|
+
let star = opts.bash === true ? globstar(opts) : STAR;
|
|
4837
|
+
|
|
4838
|
+
if (opts.capture) {
|
|
4839
|
+
star = `(${star})`;
|
|
4840
|
+
}
|
|
4841
|
+
|
|
4842
|
+
// minimatch options support
|
|
4843
|
+
if (typeof opts.noext === 'boolean') {
|
|
4844
|
+
opts.noextglob = opts.noext;
|
|
4845
|
+
}
|
|
4846
|
+
|
|
4847
|
+
const state = {
|
|
4848
|
+
input,
|
|
4849
|
+
index: -1,
|
|
4850
|
+
start: 0,
|
|
4851
|
+
dot: opts.dot === true,
|
|
4852
|
+
consumed: '',
|
|
4853
|
+
output: '',
|
|
4854
|
+
prefix: '',
|
|
4855
|
+
backtrack: false,
|
|
4856
|
+
negated: false,
|
|
4857
|
+
brackets: 0,
|
|
4858
|
+
braces: 0,
|
|
4859
|
+
parens: 0,
|
|
4860
|
+
quotes: 0,
|
|
4861
|
+
globstar: false,
|
|
4862
|
+
tokens
|
|
4863
|
+
};
|
|
4864
|
+
|
|
4865
|
+
input = utils$1.removePrefix(input, state);
|
|
4866
|
+
len = input.length;
|
|
4867
|
+
|
|
4868
|
+
const extglobs = [];
|
|
4869
|
+
const braces = [];
|
|
4870
|
+
const stack = [];
|
|
4871
|
+
let prev = bos;
|
|
4872
|
+
let value;
|
|
4873
|
+
|
|
4874
|
+
/**
|
|
4875
|
+
* Tokenizing helpers
|
|
4876
|
+
*/
|
|
4877
|
+
|
|
4878
|
+
const eos = () => state.index === len - 1;
|
|
4879
|
+
const peek = state.peek = (n = 1) => input[state.index + n];
|
|
4880
|
+
const advance = state.advance = () => input[++state.index];
|
|
4881
|
+
const remaining = () => input.slice(state.index + 1);
|
|
4882
|
+
const consume = (value = '', num = 0) => {
|
|
4883
|
+
state.consumed += value;
|
|
4884
|
+
state.index += num;
|
|
4885
|
+
};
|
|
4886
|
+
const append = token => {
|
|
4887
|
+
state.output += token.output != null ? token.output : token.value;
|
|
4888
|
+
consume(token.value);
|
|
4889
|
+
};
|
|
4890
|
+
|
|
4891
|
+
const negate = () => {
|
|
4892
|
+
let count = 1;
|
|
4893
|
+
|
|
4894
|
+
while (peek() === '!' && (peek(2) !== '(' || peek(3) === '?')) {
|
|
4895
|
+
advance();
|
|
4896
|
+
state.start++;
|
|
4897
|
+
count++;
|
|
4898
|
+
}
|
|
4899
|
+
|
|
4900
|
+
if (count % 2 === 0) {
|
|
4901
|
+
return false;
|
|
4902
|
+
}
|
|
4903
|
+
|
|
4904
|
+
state.negated = true;
|
|
4905
|
+
state.start++;
|
|
4906
|
+
return true;
|
|
4907
|
+
};
|
|
4908
|
+
|
|
4909
|
+
const increment = type => {
|
|
4910
|
+
state[type]++;
|
|
4911
|
+
stack.push(type);
|
|
4912
|
+
};
|
|
4913
|
+
|
|
4914
|
+
const decrement = type => {
|
|
4915
|
+
state[type]--;
|
|
4916
|
+
stack.pop();
|
|
4917
|
+
};
|
|
4918
|
+
|
|
4919
|
+
/**
|
|
4920
|
+
* Push tokens onto the tokens array. This helper speeds up
|
|
4921
|
+
* tokenizing by 1) helping us avoid backtracking as much as possible,
|
|
4922
|
+
* and 2) helping us avoid creating extra tokens when consecutive
|
|
4923
|
+
* characters are plain text. This improves performance and simplifies
|
|
4924
|
+
* lookbehinds.
|
|
4925
|
+
*/
|
|
4926
|
+
|
|
4927
|
+
const push = tok => {
|
|
4928
|
+
if (prev.type === 'globstar') {
|
|
4929
|
+
const isBrace = state.braces > 0 && (tok.type === 'comma' || tok.type === 'brace');
|
|
4930
|
+
const isExtglob = tok.extglob === true || (extglobs.length && (tok.type === 'pipe' || tok.type === 'paren'));
|
|
4931
|
+
|
|
4932
|
+
if (tok.type !== 'slash' && tok.type !== 'paren' && !isBrace && !isExtglob) {
|
|
4933
|
+
state.output = state.output.slice(0, -prev.output.length);
|
|
4934
|
+
prev.type = 'star';
|
|
4935
|
+
prev.value = '*';
|
|
4936
|
+
prev.output = star;
|
|
4937
|
+
state.output += prev.output;
|
|
4938
|
+
}
|
|
4939
|
+
}
|
|
4940
|
+
|
|
4941
|
+
if (extglobs.length && tok.type !== 'paren' && !EXTGLOB_CHARS[tok.value]) {
|
|
4942
|
+
extglobs[extglobs.length - 1].inner += tok.value;
|
|
4943
|
+
}
|
|
4944
|
+
|
|
4945
|
+
if (tok.value || tok.output) append(tok);
|
|
4946
|
+
if (prev && prev.type === 'text' && tok.type === 'text') {
|
|
4947
|
+
prev.value += tok.value;
|
|
4948
|
+
prev.output = (prev.output || '') + tok.value;
|
|
4949
|
+
return;
|
|
4950
|
+
}
|
|
4951
|
+
|
|
4952
|
+
tok.prev = prev;
|
|
4953
|
+
tokens.push(tok);
|
|
4954
|
+
prev = tok;
|
|
4955
|
+
};
|
|
4956
|
+
|
|
4957
|
+
const extglobOpen = (type, value) => {
|
|
4958
|
+
const token = { ...EXTGLOB_CHARS[value], conditions: 1, inner: '' };
|
|
4959
|
+
|
|
4960
|
+
token.prev = prev;
|
|
4961
|
+
token.parens = state.parens;
|
|
4962
|
+
token.output = state.output;
|
|
4963
|
+
const output = (opts.capture ? '(' : '') + token.open;
|
|
4964
|
+
|
|
4965
|
+
increment('parens');
|
|
4966
|
+
push({ type, value, output: state.output ? '' : ONE_CHAR });
|
|
4967
|
+
push({ type: 'paren', extglob: true, value: advance(), output });
|
|
4968
|
+
extglobs.push(token);
|
|
4969
|
+
};
|
|
4970
|
+
|
|
4971
|
+
const extglobClose = token => {
|
|
4972
|
+
let output = token.close + (opts.capture ? ')' : '');
|
|
4973
|
+
|
|
4974
|
+
if (token.type === 'negate') {
|
|
4975
|
+
let extglobStar = star;
|
|
4976
|
+
|
|
4977
|
+
if (token.inner && token.inner.length > 1 && token.inner.includes('/')) {
|
|
4978
|
+
extglobStar = globstar(opts);
|
|
4979
|
+
}
|
|
4980
|
+
|
|
4981
|
+
if (extglobStar !== star || eos() || /^\)+$/.test(remaining())) {
|
|
4982
|
+
output = token.close = `)$))${extglobStar}`;
|
|
4983
|
+
}
|
|
4984
|
+
|
|
4985
|
+
if (token.prev.type === 'bos' && eos()) {
|
|
4986
|
+
state.negatedExtglob = true;
|
|
4987
|
+
}
|
|
4988
|
+
}
|
|
4989
|
+
|
|
4990
|
+
push({ type: 'paren', extglob: true, value, output });
|
|
4991
|
+
decrement('parens');
|
|
4992
|
+
};
|
|
4993
|
+
|
|
4994
|
+
/**
|
|
4995
|
+
* Fast paths
|
|
4996
|
+
*/
|
|
4997
|
+
|
|
4998
|
+
if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) {
|
|
4999
|
+
let backslashes = false;
|
|
5000
|
+
|
|
5001
|
+
let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => {
|
|
5002
|
+
if (first === '\\') {
|
|
5003
|
+
backslashes = true;
|
|
5004
|
+
return m;
|
|
5005
|
+
}
|
|
5006
|
+
|
|
5007
|
+
if (first === '?') {
|
|
5008
|
+
if (esc) {
|
|
5009
|
+
return esc + first + (rest ? QMARK.repeat(rest.length) : '');
|
|
5010
|
+
}
|
|
5011
|
+
if (index === 0) {
|
|
5012
|
+
return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : '');
|
|
5013
|
+
}
|
|
5014
|
+
return QMARK.repeat(chars.length);
|
|
5015
|
+
}
|
|
5016
|
+
|
|
5017
|
+
if (first === '.') {
|
|
5018
|
+
return DOT_LITERAL.repeat(chars.length);
|
|
5019
|
+
}
|
|
5020
|
+
|
|
5021
|
+
if (first === '*') {
|
|
5022
|
+
if (esc) {
|
|
5023
|
+
return esc + first + (rest ? star : '');
|
|
5024
|
+
}
|
|
5025
|
+
return star;
|
|
5026
|
+
}
|
|
5027
|
+
return esc ? m : `\\${m}`;
|
|
5028
|
+
});
|
|
5029
|
+
|
|
5030
|
+
if (backslashes === true) {
|
|
5031
|
+
if (opts.unescape === true) {
|
|
5032
|
+
output = output.replace(/\\/g, '');
|
|
5033
|
+
} else {
|
|
5034
|
+
output = output.replace(/\\+/g, m => {
|
|
5035
|
+
return m.length % 2 === 0 ? '\\\\' : (m ? '\\' : '');
|
|
5036
|
+
});
|
|
5037
|
+
}
|
|
5038
|
+
}
|
|
5039
|
+
|
|
5040
|
+
if (output === input && opts.contains === true) {
|
|
5041
|
+
state.output = input;
|
|
5042
|
+
return state;
|
|
5043
|
+
}
|
|
5044
|
+
|
|
5045
|
+
state.output = utils$1.wrapOutput(output, state, options);
|
|
5046
|
+
return state;
|
|
5047
|
+
}
|
|
5048
|
+
|
|
5049
|
+
/**
|
|
5050
|
+
* Tokenize input until we reach end-of-string
|
|
5051
|
+
*/
|
|
5052
|
+
|
|
5053
|
+
while (!eos()) {
|
|
5054
|
+
value = advance();
|
|
5055
|
+
|
|
5056
|
+
if (value === '\u0000') {
|
|
5057
|
+
continue;
|
|
5058
|
+
}
|
|
5059
|
+
|
|
5060
|
+
/**
|
|
5061
|
+
* Escaped characters
|
|
5062
|
+
*/
|
|
5063
|
+
|
|
5064
|
+
if (value === '\\') {
|
|
5065
|
+
const next = peek();
|
|
5066
|
+
|
|
5067
|
+
if (next === '/' && opts.bash !== true) {
|
|
5068
|
+
continue;
|
|
5069
|
+
}
|
|
5070
|
+
|
|
5071
|
+
if (next === '.' || next === ';') {
|
|
5072
|
+
continue;
|
|
5073
|
+
}
|
|
5074
|
+
|
|
5075
|
+
if (!next) {
|
|
5076
|
+
value += '\\';
|
|
5077
|
+
push({ type: 'text', value });
|
|
5078
|
+
continue;
|
|
5079
|
+
}
|
|
5080
|
+
|
|
5081
|
+
// collapse slashes to reduce potential for exploits
|
|
5082
|
+
const match = /^\\+/.exec(remaining());
|
|
5083
|
+
let slashes = 0;
|
|
5084
|
+
|
|
5085
|
+
if (match && match[0].length > 2) {
|
|
5086
|
+
slashes = match[0].length;
|
|
5087
|
+
state.index += slashes;
|
|
5088
|
+
if (slashes % 2 !== 0) {
|
|
5089
|
+
value += '\\';
|
|
5090
|
+
}
|
|
5091
|
+
}
|
|
5092
|
+
|
|
5093
|
+
if (opts.unescape === true) {
|
|
5094
|
+
value = advance() || '';
|
|
5095
|
+
} else {
|
|
5096
|
+
value += advance() || '';
|
|
5097
|
+
}
|
|
5098
|
+
|
|
5099
|
+
if (state.brackets === 0) {
|
|
5100
|
+
push({ type: 'text', value });
|
|
5101
|
+
continue;
|
|
5102
|
+
}
|
|
5103
|
+
}
|
|
5104
|
+
|
|
5105
|
+
/**
|
|
5106
|
+
* If we're inside a regex character class, continue
|
|
5107
|
+
* until we reach the closing bracket.
|
|
5108
|
+
*/
|
|
5109
|
+
|
|
5110
|
+
if (state.brackets > 0 && (value !== ']' || prev.value === '[' || prev.value === '[^')) {
|
|
5111
|
+
if (opts.posix !== false && value === ':') {
|
|
5112
|
+
const inner = prev.value.slice(1);
|
|
5113
|
+
if (inner.includes('[')) {
|
|
5114
|
+
prev.posix = true;
|
|
5115
|
+
|
|
5116
|
+
if (inner.includes(':')) {
|
|
5117
|
+
const idx = prev.value.lastIndexOf('[');
|
|
5118
|
+
const pre = prev.value.slice(0, idx);
|
|
5119
|
+
const rest = prev.value.slice(idx + 2);
|
|
5120
|
+
const posix = POSIX_REGEX_SOURCE[rest];
|
|
5121
|
+
if (posix) {
|
|
5122
|
+
prev.value = pre + posix;
|
|
5123
|
+
state.backtrack = true;
|
|
5124
|
+
advance();
|
|
5125
|
+
|
|
5126
|
+
if (!bos.output && tokens.indexOf(prev) === 1) {
|
|
5127
|
+
bos.output = ONE_CHAR;
|
|
5128
|
+
}
|
|
5129
|
+
continue;
|
|
5130
|
+
}
|
|
5131
|
+
}
|
|
5132
|
+
}
|
|
5133
|
+
}
|
|
5134
|
+
|
|
5135
|
+
if ((value === '[' && peek() !== ':') || (value === '-' && peek() === ']')) {
|
|
5136
|
+
value = `\\${value}`;
|
|
5137
|
+
}
|
|
5138
|
+
|
|
5139
|
+
if (value === ']' && (prev.value === '[' || prev.value === '[^')) {
|
|
5140
|
+
value = `\\${value}`;
|
|
5141
|
+
}
|
|
5142
|
+
|
|
5143
|
+
if (opts.posix === true && value === '!' && prev.value === '[') {
|
|
5144
|
+
value = '^';
|
|
5145
|
+
}
|
|
5146
|
+
|
|
5147
|
+
prev.value += value;
|
|
5148
|
+
append({ value });
|
|
5149
|
+
continue;
|
|
5150
|
+
}
|
|
5151
|
+
|
|
5152
|
+
/**
|
|
5153
|
+
* If we're inside a quoted string, continue
|
|
5154
|
+
* until we reach the closing double quote.
|
|
5155
|
+
*/
|
|
5156
|
+
|
|
5157
|
+
if (state.quotes === 1 && value !== '"') {
|
|
5158
|
+
value = utils$1.escapeRegex(value);
|
|
5159
|
+
prev.value += value;
|
|
5160
|
+
append({ value });
|
|
5161
|
+
continue;
|
|
5162
|
+
}
|
|
5163
|
+
|
|
5164
|
+
/**
|
|
5165
|
+
* Double quotes
|
|
5166
|
+
*/
|
|
5167
|
+
|
|
5168
|
+
if (value === '"') {
|
|
5169
|
+
state.quotes = state.quotes === 1 ? 0 : 1;
|
|
5170
|
+
if (opts.keepQuotes === true) {
|
|
5171
|
+
push({ type: 'text', value });
|
|
5172
|
+
}
|
|
5173
|
+
continue;
|
|
5174
|
+
}
|
|
5175
|
+
|
|
5176
|
+
/**
|
|
5177
|
+
* Parentheses
|
|
5178
|
+
*/
|
|
5179
|
+
|
|
5180
|
+
if (value === '(') {
|
|
5181
|
+
increment('parens');
|
|
5182
|
+
push({ type: 'paren', value });
|
|
5183
|
+
continue;
|
|
5184
|
+
}
|
|
5185
|
+
|
|
5186
|
+
if (value === ')') {
|
|
5187
|
+
if (state.parens === 0 && opts.strictBrackets === true) {
|
|
5188
|
+
throw new SyntaxError(syntaxError('opening', '('));
|
|
5189
|
+
}
|
|
5190
|
+
|
|
5191
|
+
const extglob = extglobs[extglobs.length - 1];
|
|
5192
|
+
if (extglob && state.parens === extglob.parens + 1) {
|
|
5193
|
+
extglobClose(extglobs.pop());
|
|
5194
|
+
continue;
|
|
5195
|
+
}
|
|
5196
|
+
|
|
5197
|
+
push({ type: 'paren', value, output: state.parens ? ')' : '\\)' });
|
|
5198
|
+
decrement('parens');
|
|
5199
|
+
continue;
|
|
5200
|
+
}
|
|
5201
|
+
|
|
5202
|
+
/**
|
|
5203
|
+
* Square brackets
|
|
5204
|
+
*/
|
|
5205
|
+
|
|
5206
|
+
if (value === '[') {
|
|
5207
|
+
if (opts.nobracket === true || !remaining().includes(']')) {
|
|
5208
|
+
if (opts.nobracket !== true && opts.strictBrackets === true) {
|
|
5209
|
+
throw new SyntaxError(syntaxError('closing', ']'));
|
|
5210
|
+
}
|
|
5211
|
+
|
|
5212
|
+
value = `\\${value}`;
|
|
5213
|
+
} else {
|
|
5214
|
+
increment('brackets');
|
|
5215
|
+
}
|
|
5216
|
+
|
|
5217
|
+
push({ type: 'bracket', value });
|
|
5218
|
+
continue;
|
|
5219
|
+
}
|
|
5220
|
+
|
|
5221
|
+
if (value === ']') {
|
|
5222
|
+
if (opts.nobracket === true || (prev && prev.type === 'bracket' && prev.value.length === 1)) {
|
|
5223
|
+
push({ type: 'text', value, output: `\\${value}` });
|
|
5224
|
+
continue;
|
|
5225
|
+
}
|
|
5226
|
+
|
|
5227
|
+
if (state.brackets === 0) {
|
|
5228
|
+
if (opts.strictBrackets === true) {
|
|
5229
|
+
throw new SyntaxError(syntaxError('opening', '['));
|
|
5230
|
+
}
|
|
5231
|
+
|
|
5232
|
+
push({ type: 'text', value, output: `\\${value}` });
|
|
5233
|
+
continue;
|
|
5234
|
+
}
|
|
5235
|
+
|
|
5236
|
+
decrement('brackets');
|
|
5237
|
+
|
|
5238
|
+
const prevValue = prev.value.slice(1);
|
|
5239
|
+
if (prev.posix !== true && prevValue[0] === '^' && !prevValue.includes('/')) {
|
|
5240
|
+
value = `/${value}`;
|
|
5241
|
+
}
|
|
5242
|
+
|
|
5243
|
+
prev.value += value;
|
|
5244
|
+
append({ value });
|
|
5245
|
+
|
|
5246
|
+
// when literal brackets are explicitly disabled
|
|
5247
|
+
// assume we should match with a regex character class
|
|
5248
|
+
if (opts.literalBrackets === false || utils$1.hasRegexChars(prevValue)) {
|
|
5249
|
+
continue;
|
|
5250
|
+
}
|
|
5251
|
+
|
|
5252
|
+
const escaped = utils$1.escapeRegex(prev.value);
|
|
5253
|
+
state.output = state.output.slice(0, -prev.value.length);
|
|
5254
|
+
|
|
5255
|
+
// when literal brackets are explicitly enabled
|
|
5256
|
+
// assume we should escape the brackets to match literal characters
|
|
5257
|
+
if (opts.literalBrackets === true) {
|
|
5258
|
+
state.output += escaped;
|
|
5259
|
+
prev.value = escaped;
|
|
5260
|
+
continue;
|
|
5261
|
+
}
|
|
5262
|
+
|
|
5263
|
+
// when the user specifies nothing, try to match both
|
|
5264
|
+
prev.value = `(${capture}${escaped}|${prev.value})`;
|
|
5265
|
+
state.output += prev.value;
|
|
5266
|
+
continue;
|
|
5267
|
+
}
|
|
5268
|
+
|
|
5269
|
+
/**
|
|
5270
|
+
* Braces
|
|
5271
|
+
*/
|
|
5272
|
+
|
|
5273
|
+
if (value === '{' && opts.nobrace !== true) {
|
|
5274
|
+
increment('braces');
|
|
5275
|
+
|
|
5276
|
+
const open = {
|
|
5277
|
+
type: 'brace',
|
|
5278
|
+
value,
|
|
5279
|
+
output: '(',
|
|
5280
|
+
outputIndex: state.output.length,
|
|
5281
|
+
tokensIndex: state.tokens.length
|
|
5282
|
+
};
|
|
5283
|
+
|
|
5284
|
+
braces.push(open);
|
|
5285
|
+
push(open);
|
|
5286
|
+
continue;
|
|
5287
|
+
}
|
|
5288
|
+
|
|
5289
|
+
if (value === '}') {
|
|
5290
|
+
const brace = braces[braces.length - 1];
|
|
5291
|
+
|
|
5292
|
+
if (opts.nobrace === true || !brace) {
|
|
5293
|
+
push({ type: 'text', value, output: value });
|
|
5294
|
+
continue;
|
|
5295
|
+
}
|
|
5296
|
+
|
|
5297
|
+
let output = ')';
|
|
5298
|
+
|
|
5299
|
+
if (brace.dots === true) {
|
|
5300
|
+
const arr = tokens.slice();
|
|
5301
|
+
const range = [];
|
|
5302
|
+
|
|
5303
|
+
for (let i = arr.length - 1; i >= 0; i--) {
|
|
5304
|
+
tokens.pop();
|
|
5305
|
+
if (arr[i].type === 'brace') {
|
|
5306
|
+
break;
|
|
5307
|
+
}
|
|
5308
|
+
if (arr[i].type !== 'dots') {
|
|
5309
|
+
range.unshift(arr[i].value);
|
|
5310
|
+
}
|
|
5311
|
+
}
|
|
5312
|
+
|
|
5313
|
+
output = expandRange(range, opts);
|
|
5314
|
+
state.backtrack = true;
|
|
5315
|
+
}
|
|
5316
|
+
|
|
5317
|
+
if (brace.comma !== true && brace.dots !== true) {
|
|
5318
|
+
const out = state.output.slice(0, brace.outputIndex);
|
|
5319
|
+
const toks = state.tokens.slice(brace.tokensIndex);
|
|
5320
|
+
brace.value = brace.output = '\\{';
|
|
5321
|
+
value = output = '\\}';
|
|
5322
|
+
state.output = out;
|
|
5323
|
+
for (const t of toks) {
|
|
5324
|
+
state.output += (t.output || t.value);
|
|
5325
|
+
}
|
|
5326
|
+
}
|
|
5327
|
+
|
|
5328
|
+
push({ type: 'brace', value, output });
|
|
5329
|
+
decrement('braces');
|
|
5330
|
+
braces.pop();
|
|
5331
|
+
continue;
|
|
5332
|
+
}
|
|
5333
|
+
|
|
5334
|
+
/**
|
|
5335
|
+
* Pipes
|
|
5336
|
+
*/
|
|
5337
|
+
|
|
5338
|
+
if (value === '|') {
|
|
5339
|
+
if (extglobs.length > 0) {
|
|
5340
|
+
extglobs[extglobs.length - 1].conditions++;
|
|
5341
|
+
}
|
|
5342
|
+
push({ type: 'text', value });
|
|
5343
|
+
continue;
|
|
5344
|
+
}
|
|
5345
|
+
|
|
5346
|
+
/**
|
|
5347
|
+
* Commas
|
|
5348
|
+
*/
|
|
5349
|
+
|
|
5350
|
+
if (value === ',') {
|
|
5351
|
+
let output = value;
|
|
5352
|
+
|
|
5353
|
+
const brace = braces[braces.length - 1];
|
|
5354
|
+
if (brace && stack[stack.length - 1] === 'braces') {
|
|
5355
|
+
brace.comma = true;
|
|
5356
|
+
output = '|';
|
|
5357
|
+
}
|
|
5358
|
+
|
|
5359
|
+
push({ type: 'comma', value, output });
|
|
5360
|
+
continue;
|
|
5361
|
+
}
|
|
5362
|
+
|
|
5363
|
+
/**
|
|
5364
|
+
* Slashes
|
|
5365
|
+
*/
|
|
5366
|
+
|
|
5367
|
+
if (value === '/') {
|
|
5368
|
+
// if the beginning of the glob is "./", advance the start
|
|
5369
|
+
// to the current index, and don't add the "./" characters
|
|
5370
|
+
// to the state. This greatly simplifies lookbehinds when
|
|
5371
|
+
// checking for BOS characters like "!" and "." (not "./")
|
|
5372
|
+
if (prev.type === 'dot' && state.index === state.start + 1) {
|
|
5373
|
+
state.start = state.index + 1;
|
|
5374
|
+
state.consumed = '';
|
|
5375
|
+
state.output = '';
|
|
5376
|
+
tokens.pop();
|
|
5377
|
+
prev = bos; // reset "prev" to the first token
|
|
5378
|
+
continue;
|
|
5379
|
+
}
|
|
5380
|
+
|
|
5381
|
+
push({ type: 'slash', value, output: SLASH_LITERAL });
|
|
5382
|
+
continue;
|
|
5383
|
+
}
|
|
5384
|
+
|
|
5385
|
+
/**
|
|
5386
|
+
* Dots
|
|
5387
|
+
*/
|
|
5388
|
+
|
|
5389
|
+
if (value === '.') {
|
|
5390
|
+
if (state.braces > 0 && prev.type === 'dot') {
|
|
5391
|
+
if (prev.value === '.') prev.output = DOT_LITERAL;
|
|
5392
|
+
const brace = braces[braces.length - 1];
|
|
5393
|
+
prev.type = 'dots';
|
|
5394
|
+
prev.output += value;
|
|
5395
|
+
prev.value += value;
|
|
5396
|
+
brace.dots = true;
|
|
5397
|
+
continue;
|
|
5398
|
+
}
|
|
5399
|
+
|
|
5400
|
+
if ((state.braces + state.parens) === 0 && prev.type !== 'bos' && prev.type !== 'slash') {
|
|
5401
|
+
push({ type: 'text', value, output: DOT_LITERAL });
|
|
5402
|
+
continue;
|
|
5403
|
+
}
|
|
5404
|
+
|
|
5405
|
+
push({ type: 'dot', value, output: DOT_LITERAL });
|
|
5406
|
+
continue;
|
|
5407
|
+
}
|
|
5408
|
+
|
|
5409
|
+
/**
|
|
5410
|
+
* Question marks
|
|
5411
|
+
*/
|
|
5412
|
+
|
|
5413
|
+
if (value === '?') {
|
|
5414
|
+
const isGroup = prev && prev.value === '(';
|
|
5415
|
+
if (!isGroup && opts.noextglob !== true && peek() === '(' && peek(2) !== '?') {
|
|
5416
|
+
extglobOpen('qmark', value);
|
|
5417
|
+
continue;
|
|
5418
|
+
}
|
|
5419
|
+
|
|
5420
|
+
if (prev && prev.type === 'paren') {
|
|
5421
|
+
const next = peek();
|
|
5422
|
+
let output = value;
|
|
5423
|
+
|
|
5424
|
+
if (next === '<' && !utils$1.supportsLookbehinds()) {
|
|
5425
|
+
throw new Error('Node.js v10 or higher is required for regex lookbehinds');
|
|
5426
|
+
}
|
|
5427
|
+
|
|
5428
|
+
if ((prev.value === '(' && !/[!=<:]/.test(next)) || (next === '<' && !/<([!=]|\w+>)/.test(remaining()))) {
|
|
5429
|
+
output = `\\${value}`;
|
|
5430
|
+
}
|
|
5431
|
+
|
|
5432
|
+
push({ type: 'text', value, output });
|
|
5433
|
+
continue;
|
|
5434
|
+
}
|
|
5435
|
+
|
|
5436
|
+
if (opts.dot !== true && (prev.type === 'slash' || prev.type === 'bos')) {
|
|
5437
|
+
push({ type: 'qmark', value, output: QMARK_NO_DOT });
|
|
5438
|
+
continue;
|
|
5439
|
+
}
|
|
5440
|
+
|
|
5441
|
+
push({ type: 'qmark', value, output: QMARK });
|
|
5442
|
+
continue;
|
|
5443
|
+
}
|
|
5444
|
+
|
|
5445
|
+
/**
|
|
5446
|
+
* Exclamation
|
|
5447
|
+
*/
|
|
5448
|
+
|
|
5449
|
+
if (value === '!') {
|
|
5450
|
+
if (opts.noextglob !== true && peek() === '(') {
|
|
5451
|
+
if (peek(2) !== '?' || !/[!=<:]/.test(peek(3))) {
|
|
5452
|
+
extglobOpen('negate', value);
|
|
5453
|
+
continue;
|
|
5454
|
+
}
|
|
5455
|
+
}
|
|
5456
|
+
|
|
5457
|
+
if (opts.nonegate !== true && state.index === 0) {
|
|
5458
|
+
negate();
|
|
5459
|
+
continue;
|
|
5460
|
+
}
|
|
5461
|
+
}
|
|
5462
|
+
|
|
5463
|
+
/**
|
|
5464
|
+
* Plus
|
|
5465
|
+
*/
|
|
5466
|
+
|
|
5467
|
+
if (value === '+') {
|
|
5468
|
+
if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') {
|
|
5469
|
+
extglobOpen('plus', value);
|
|
5470
|
+
continue;
|
|
5471
|
+
}
|
|
5472
|
+
|
|
5473
|
+
if ((prev && prev.value === '(') || opts.regex === false) {
|
|
5474
|
+
push({ type: 'plus', value, output: PLUS_LITERAL });
|
|
5475
|
+
continue;
|
|
5476
|
+
}
|
|
5477
|
+
|
|
5478
|
+
if ((prev && (prev.type === 'bracket' || prev.type === 'paren' || prev.type === 'brace')) || state.parens > 0) {
|
|
5479
|
+
push({ type: 'plus', value });
|
|
5480
|
+
continue;
|
|
5481
|
+
}
|
|
5482
|
+
|
|
5483
|
+
push({ type: 'plus', value: PLUS_LITERAL });
|
|
5484
|
+
continue;
|
|
5485
|
+
}
|
|
5486
|
+
|
|
5487
|
+
/**
|
|
5488
|
+
* Plain text
|
|
5489
|
+
*/
|
|
5490
|
+
|
|
5491
|
+
if (value === '@') {
|
|
5492
|
+
if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') {
|
|
5493
|
+
push({ type: 'at', extglob: true, value, output: '' });
|
|
5494
|
+
continue;
|
|
5495
|
+
}
|
|
5496
|
+
|
|
5497
|
+
push({ type: 'text', value });
|
|
5498
|
+
continue;
|
|
5499
|
+
}
|
|
5500
|
+
|
|
5501
|
+
/**
|
|
5502
|
+
* Plain text
|
|
5503
|
+
*/
|
|
5504
|
+
|
|
5505
|
+
if (value !== '*') {
|
|
5506
|
+
if (value === '$' || value === '^') {
|
|
5507
|
+
value = `\\${value}`;
|
|
5508
|
+
}
|
|
5509
|
+
|
|
5510
|
+
const match = REGEX_NON_SPECIAL_CHARS.exec(remaining());
|
|
5511
|
+
if (match) {
|
|
5512
|
+
value += match[0];
|
|
5513
|
+
state.index += match[0].length;
|
|
5514
|
+
}
|
|
5515
|
+
|
|
5516
|
+
push({ type: 'text', value });
|
|
5517
|
+
continue;
|
|
5518
|
+
}
|
|
5519
|
+
|
|
5520
|
+
/**
|
|
5521
|
+
* Stars
|
|
5522
|
+
*/
|
|
5523
|
+
|
|
5524
|
+
if (prev && (prev.type === 'globstar' || prev.star === true)) {
|
|
5525
|
+
prev.type = 'star';
|
|
5526
|
+
prev.star = true;
|
|
5527
|
+
prev.value += value;
|
|
5528
|
+
prev.output = star;
|
|
5529
|
+
state.backtrack = true;
|
|
5530
|
+
state.globstar = true;
|
|
5531
|
+
consume(value);
|
|
5532
|
+
continue;
|
|
5533
|
+
}
|
|
5534
|
+
|
|
5535
|
+
let rest = remaining();
|
|
5536
|
+
if (opts.noextglob !== true && /^\([^?]/.test(rest)) {
|
|
5537
|
+
extglobOpen('star', value);
|
|
5538
|
+
continue;
|
|
5539
|
+
}
|
|
5540
|
+
|
|
5541
|
+
if (prev.type === 'star') {
|
|
5542
|
+
if (opts.noglobstar === true) {
|
|
5543
|
+
consume(value);
|
|
5544
|
+
continue;
|
|
5545
|
+
}
|
|
5546
|
+
|
|
5547
|
+
const prior = prev.prev;
|
|
5548
|
+
const before = prior.prev;
|
|
5549
|
+
const isStart = prior.type === 'slash' || prior.type === 'bos';
|
|
5550
|
+
const afterStar = before && (before.type === 'star' || before.type === 'globstar');
|
|
5551
|
+
|
|
5552
|
+
if (opts.bash === true && (!isStart || (rest[0] && rest[0] !== '/'))) {
|
|
5553
|
+
push({ type: 'star', value, output: '' });
|
|
5554
|
+
continue;
|
|
5555
|
+
}
|
|
5556
|
+
|
|
5557
|
+
const isBrace = state.braces > 0 && (prior.type === 'comma' || prior.type === 'brace');
|
|
5558
|
+
const isExtglob = extglobs.length && (prior.type === 'pipe' || prior.type === 'paren');
|
|
5559
|
+
if (!isStart && prior.type !== 'paren' && !isBrace && !isExtglob) {
|
|
5560
|
+
push({ type: 'star', value, output: '' });
|
|
5561
|
+
continue;
|
|
5562
|
+
}
|
|
5563
|
+
|
|
5564
|
+
// strip consecutive `/**/`
|
|
5565
|
+
while (rest.slice(0, 3) === '/**') {
|
|
5566
|
+
const after = input[state.index + 4];
|
|
5567
|
+
if (after && after !== '/') {
|
|
5568
|
+
break;
|
|
5569
|
+
}
|
|
5570
|
+
rest = rest.slice(3);
|
|
5571
|
+
consume('/**', 3);
|
|
5572
|
+
}
|
|
5573
|
+
|
|
5574
|
+
if (prior.type === 'bos' && eos()) {
|
|
5575
|
+
prev.type = 'globstar';
|
|
5576
|
+
prev.value += value;
|
|
5577
|
+
prev.output = globstar(opts);
|
|
5578
|
+
state.output = prev.output;
|
|
5579
|
+
state.globstar = true;
|
|
5580
|
+
consume(value);
|
|
5581
|
+
continue;
|
|
5582
|
+
}
|
|
5583
|
+
|
|
5584
|
+
if (prior.type === 'slash' && prior.prev.type !== 'bos' && !afterStar && eos()) {
|
|
5585
|
+
state.output = state.output.slice(0, -(prior.output + prev.output).length);
|
|
5586
|
+
prior.output = `(?:${prior.output}`;
|
|
5587
|
+
|
|
5588
|
+
prev.type = 'globstar';
|
|
5589
|
+
prev.output = globstar(opts) + (opts.strictSlashes ? ')' : '|$)');
|
|
5590
|
+
prev.value += value;
|
|
5591
|
+
state.globstar = true;
|
|
5592
|
+
state.output += prior.output + prev.output;
|
|
5593
|
+
consume(value);
|
|
5594
|
+
continue;
|
|
5595
|
+
}
|
|
5596
|
+
|
|
5597
|
+
if (prior.type === 'slash' && prior.prev.type !== 'bos' && rest[0] === '/') {
|
|
5598
|
+
const end = rest[1] !== void 0 ? '|$' : '';
|
|
5599
|
+
|
|
5600
|
+
state.output = state.output.slice(0, -(prior.output + prev.output).length);
|
|
5601
|
+
prior.output = `(?:${prior.output}`;
|
|
5602
|
+
|
|
5603
|
+
prev.type = 'globstar';
|
|
5604
|
+
prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`;
|
|
5605
|
+
prev.value += value;
|
|
5606
|
+
|
|
5607
|
+
state.output += prior.output + prev.output;
|
|
5608
|
+
state.globstar = true;
|
|
5609
|
+
|
|
5610
|
+
consume(value + advance());
|
|
5611
|
+
|
|
5612
|
+
push({ type: 'slash', value: '/', output: '' });
|
|
5613
|
+
continue;
|
|
5614
|
+
}
|
|
5615
|
+
|
|
5616
|
+
if (prior.type === 'bos' && rest[0] === '/') {
|
|
5617
|
+
prev.type = 'globstar';
|
|
5618
|
+
prev.value += value;
|
|
5619
|
+
prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`;
|
|
5620
|
+
state.output = prev.output;
|
|
5621
|
+
state.globstar = true;
|
|
5622
|
+
consume(value + advance());
|
|
5623
|
+
push({ type: 'slash', value: '/', output: '' });
|
|
5624
|
+
continue;
|
|
5625
|
+
}
|
|
5626
|
+
|
|
5627
|
+
// remove single star from output
|
|
5628
|
+
state.output = state.output.slice(0, -prev.output.length);
|
|
5629
|
+
|
|
5630
|
+
// reset previous token to globstar
|
|
5631
|
+
prev.type = 'globstar';
|
|
5632
|
+
prev.output = globstar(opts);
|
|
5633
|
+
prev.value += value;
|
|
5634
|
+
|
|
5635
|
+
// reset output with globstar
|
|
5636
|
+
state.output += prev.output;
|
|
5637
|
+
state.globstar = true;
|
|
5638
|
+
consume(value);
|
|
5639
|
+
continue;
|
|
5640
|
+
}
|
|
5641
|
+
|
|
5642
|
+
const token = { type: 'star', value, output: star };
|
|
5643
|
+
|
|
5644
|
+
if (opts.bash === true) {
|
|
5645
|
+
token.output = '.*?';
|
|
5646
|
+
if (prev.type === 'bos' || prev.type === 'slash') {
|
|
5647
|
+
token.output = nodot + token.output;
|
|
5648
|
+
}
|
|
5649
|
+
push(token);
|
|
5650
|
+
continue;
|
|
5651
|
+
}
|
|
5652
|
+
|
|
5653
|
+
if (prev && (prev.type === 'bracket' || prev.type === 'paren') && opts.regex === true) {
|
|
5654
|
+
token.output = value;
|
|
5655
|
+
push(token);
|
|
5656
|
+
continue;
|
|
5657
|
+
}
|
|
5658
|
+
|
|
5659
|
+
if (state.index === state.start || prev.type === 'slash' || prev.type === 'dot') {
|
|
5660
|
+
if (prev.type === 'dot') {
|
|
5661
|
+
state.output += NO_DOT_SLASH;
|
|
5662
|
+
prev.output += NO_DOT_SLASH;
|
|
5663
|
+
|
|
5664
|
+
} else if (opts.dot === true) {
|
|
5665
|
+
state.output += NO_DOTS_SLASH;
|
|
5666
|
+
prev.output += NO_DOTS_SLASH;
|
|
5667
|
+
|
|
5668
|
+
} else {
|
|
5669
|
+
state.output += nodot;
|
|
5670
|
+
prev.output += nodot;
|
|
5671
|
+
}
|
|
5672
|
+
|
|
5673
|
+
if (peek() !== '*') {
|
|
5674
|
+
state.output += ONE_CHAR;
|
|
5675
|
+
prev.output += ONE_CHAR;
|
|
5676
|
+
}
|
|
5677
|
+
}
|
|
5678
|
+
|
|
5679
|
+
push(token);
|
|
5680
|
+
}
|
|
5681
|
+
|
|
5682
|
+
while (state.brackets > 0) {
|
|
5683
|
+
if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ']'));
|
|
5684
|
+
state.output = utils$1.escapeLast(state.output, '[');
|
|
5685
|
+
decrement('brackets');
|
|
5686
|
+
}
|
|
5687
|
+
|
|
5688
|
+
while (state.parens > 0) {
|
|
5689
|
+
if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ')'));
|
|
5690
|
+
state.output = utils$1.escapeLast(state.output, '(');
|
|
5691
|
+
decrement('parens');
|
|
5692
|
+
}
|
|
5693
|
+
|
|
5694
|
+
while (state.braces > 0) {
|
|
5695
|
+
if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', '}'));
|
|
5696
|
+
state.output = utils$1.escapeLast(state.output, '{');
|
|
5697
|
+
decrement('braces');
|
|
5698
|
+
}
|
|
5699
|
+
|
|
5700
|
+
if (opts.strictSlashes !== true && (prev.type === 'star' || prev.type === 'bracket')) {
|
|
5701
|
+
push({ type: 'maybe_slash', value: '', output: `${SLASH_LITERAL}?` });
|
|
5702
|
+
}
|
|
5703
|
+
|
|
5704
|
+
// rebuild the output if we had to backtrack at any point
|
|
5705
|
+
if (state.backtrack === true) {
|
|
5706
|
+
state.output = '';
|
|
5707
|
+
|
|
5708
|
+
for (const token of state.tokens) {
|
|
5709
|
+
state.output += token.output != null ? token.output : token.value;
|
|
5710
|
+
|
|
5711
|
+
if (token.suffix) {
|
|
5712
|
+
state.output += token.suffix;
|
|
5713
|
+
}
|
|
5714
|
+
}
|
|
5715
|
+
}
|
|
5716
|
+
|
|
5717
|
+
return state;
|
|
5718
|
+
};
|
|
5719
|
+
|
|
5720
|
+
/**
|
|
5721
|
+
* Fast paths for creating regular expressions for common glob patterns.
|
|
5722
|
+
* This can significantly speed up processing and has very little downside
|
|
5723
|
+
* impact when none of the fast paths match.
|
|
5724
|
+
*/
|
|
5725
|
+
|
|
5726
|
+
parse$1.fastpaths = (input, options) => {
|
|
5727
|
+
const opts = { ...options };
|
|
5728
|
+
const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
|
|
5729
|
+
const len = input.length;
|
|
5730
|
+
if (len > max) {
|
|
5731
|
+
throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
|
|
5732
|
+
}
|
|
5733
|
+
|
|
5734
|
+
input = REPLACEMENTS[input] || input;
|
|
5735
|
+
|
|
5736
|
+
// create constants based on platform, for windows or posix
|
|
5737
|
+
const {
|
|
5738
|
+
DOT_LITERAL,
|
|
5739
|
+
SLASH_LITERAL,
|
|
5740
|
+
ONE_CHAR,
|
|
5741
|
+
DOTS_SLASH,
|
|
5742
|
+
NO_DOT,
|
|
5743
|
+
NO_DOTS,
|
|
5744
|
+
NO_DOTS_SLASH,
|
|
5745
|
+
STAR,
|
|
5746
|
+
START_ANCHOR
|
|
5747
|
+
} = constants$1.globChars(opts.windows);
|
|
5748
|
+
|
|
5749
|
+
const nodot = opts.dot ? NO_DOTS : NO_DOT;
|
|
5750
|
+
const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT;
|
|
5751
|
+
const capture = opts.capture ? '' : '?:';
|
|
5752
|
+
const state = { negated: false, prefix: '' };
|
|
5753
|
+
let star = opts.bash === true ? '.*?' : STAR;
|
|
5754
|
+
|
|
5755
|
+
if (opts.capture) {
|
|
5756
|
+
star = `(${star})`;
|
|
5757
|
+
}
|
|
5758
|
+
|
|
5759
|
+
const globstar = (opts) => {
|
|
5760
|
+
if (opts.noglobstar === true) return star;
|
|
5761
|
+
return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
|
|
5762
|
+
};
|
|
5763
|
+
|
|
5764
|
+
const create = str => {
|
|
5765
|
+
switch (str) {
|
|
5766
|
+
case '*':
|
|
5767
|
+
return `${nodot}${ONE_CHAR}${star}`;
|
|
5768
|
+
|
|
5769
|
+
case '.*':
|
|
5770
|
+
return `${DOT_LITERAL}${ONE_CHAR}${star}`;
|
|
5771
|
+
|
|
5772
|
+
case '*.*':
|
|
5773
|
+
return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
|
|
5774
|
+
|
|
5775
|
+
case '*/*':
|
|
5776
|
+
return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`;
|
|
5777
|
+
|
|
5778
|
+
case '**':
|
|
5779
|
+
return nodot + globstar(opts);
|
|
5780
|
+
|
|
5781
|
+
case '**/*':
|
|
5782
|
+
return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`;
|
|
5783
|
+
|
|
5784
|
+
case '**/*.*':
|
|
5785
|
+
return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
|
|
5786
|
+
|
|
5787
|
+
case '**/.*':
|
|
5788
|
+
return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`;
|
|
5789
|
+
|
|
5790
|
+
default: {
|
|
5791
|
+
const match = /^(.*?)\.(\w+)$/.exec(str);
|
|
5792
|
+
if (!match) return;
|
|
5793
|
+
|
|
5794
|
+
const source = create(match[1]);
|
|
5795
|
+
if (!source) return;
|
|
5796
|
+
|
|
5797
|
+
return source + DOT_LITERAL + match[2];
|
|
5798
|
+
}
|
|
5799
|
+
}
|
|
5800
|
+
};
|
|
5801
|
+
|
|
5802
|
+
const output = utils$1.removePrefix(input, state);
|
|
5803
|
+
let source = create(output);
|
|
5804
|
+
|
|
5805
|
+
if (source && opts.strictSlashes !== true) {
|
|
5806
|
+
source += `${SLASH_LITERAL}?`;
|
|
5807
|
+
}
|
|
5808
|
+
|
|
5809
|
+
return source;
|
|
5810
|
+
};
|
|
5811
|
+
|
|
5812
|
+
var parse_1 = parse$1;
|
|
5813
|
+
|
|
5814
|
+
const scan = scan_1;
|
|
5815
|
+
const parse = parse_1;
|
|
5816
|
+
const utils = utils$3;
|
|
5817
|
+
const constants = constants$2;
|
|
5818
|
+
const isObject = val => val && typeof val === 'object' && !Array.isArray(val);
|
|
5819
|
+
|
|
5820
|
+
/**
|
|
5821
|
+
* Creates a matcher function from one or more glob patterns. The
|
|
5822
|
+
* returned function takes a string to match as its first argument,
|
|
5823
|
+
* and returns true if the string is a match. The returned matcher
|
|
5824
|
+
* function also takes a boolean as the second argument that, when true,
|
|
5825
|
+
* returns an object with additional information.
|
|
5826
|
+
*
|
|
5827
|
+
* ```js
|
|
5828
|
+
* const picomatch = require('picomatch');
|
|
5829
|
+
* // picomatch(glob[, options]);
|
|
5830
|
+
*
|
|
5831
|
+
* const isMatch = picomatch('*.!(*a)');
|
|
5832
|
+
* console.log(isMatch('a.a')); //=> false
|
|
5833
|
+
* console.log(isMatch('a.b')); //=> true
|
|
5834
|
+
* ```
|
|
5835
|
+
* @name picomatch
|
|
5836
|
+
* @param {String|Array} `globs` One or more glob patterns.
|
|
5837
|
+
* @param {Object=} `options`
|
|
5838
|
+
* @return {Function=} Returns a matcher function.
|
|
5839
|
+
* @api public
|
|
5840
|
+
*/
|
|
5841
|
+
|
|
5842
|
+
const picomatch = (glob, options, returnState = false) => {
|
|
5843
|
+
if (Array.isArray(glob)) {
|
|
5844
|
+
const fns = glob.map(input => picomatch(input, options, returnState));
|
|
5845
|
+
const arrayMatcher = str => {
|
|
5846
|
+
for (const isMatch of fns) {
|
|
5847
|
+
const state = isMatch(str);
|
|
5848
|
+
if (state) return state;
|
|
5849
|
+
}
|
|
5850
|
+
return false;
|
|
5851
|
+
};
|
|
5852
|
+
return arrayMatcher;
|
|
5853
|
+
}
|
|
5854
|
+
|
|
5855
|
+
const isState = isObject(glob) && glob.tokens && glob.input;
|
|
5856
|
+
|
|
5857
|
+
if (glob === '' || (typeof glob !== 'string' && !isState)) {
|
|
5858
|
+
throw new TypeError('Expected pattern to be a non-empty string');
|
|
5859
|
+
}
|
|
5860
|
+
|
|
5861
|
+
const opts = options || {};
|
|
5862
|
+
const posix = opts.windows;
|
|
5863
|
+
const regex = isState
|
|
5864
|
+
? picomatch.compileRe(glob, options)
|
|
5865
|
+
: picomatch.makeRe(glob, options, false, true);
|
|
5866
|
+
|
|
5867
|
+
const state = regex.state;
|
|
5868
|
+
delete regex.state;
|
|
5869
|
+
|
|
5870
|
+
let isIgnored = () => false;
|
|
5871
|
+
if (opts.ignore) {
|
|
5872
|
+
const ignoreOpts = { ...options, ignore: null, onMatch: null, onResult: null };
|
|
5873
|
+
isIgnored = picomatch(opts.ignore, ignoreOpts, returnState);
|
|
5874
|
+
}
|
|
5875
|
+
|
|
5876
|
+
const matcher = (input, returnObject = false) => {
|
|
5877
|
+
const { isMatch, match, output } = picomatch.test(input, regex, options, { glob, posix });
|
|
5878
|
+
const result = { glob, state, regex, posix, input, output, match, isMatch };
|
|
5879
|
+
|
|
5880
|
+
if (typeof opts.onResult === 'function') {
|
|
5881
|
+
opts.onResult(result);
|
|
5882
|
+
}
|
|
5883
|
+
|
|
5884
|
+
if (isMatch === false) {
|
|
5885
|
+
result.isMatch = false;
|
|
5886
|
+
return returnObject ? result : false;
|
|
5887
|
+
}
|
|
5888
|
+
|
|
5889
|
+
if (isIgnored(input)) {
|
|
5890
|
+
if (typeof opts.onIgnore === 'function') {
|
|
5891
|
+
opts.onIgnore(result);
|
|
5892
|
+
}
|
|
5893
|
+
result.isMatch = false;
|
|
5894
|
+
return returnObject ? result : false;
|
|
5895
|
+
}
|
|
5896
|
+
|
|
5897
|
+
if (typeof opts.onMatch === 'function') {
|
|
5898
|
+
opts.onMatch(result);
|
|
5899
|
+
}
|
|
5900
|
+
return returnObject ? result : true;
|
|
5901
|
+
};
|
|
5902
|
+
|
|
5903
|
+
if (returnState) {
|
|
5904
|
+
matcher.state = state;
|
|
5905
|
+
}
|
|
5906
|
+
|
|
5907
|
+
return matcher;
|
|
5908
|
+
};
|
|
5909
|
+
|
|
5910
|
+
/**
|
|
5911
|
+
* Test `input` with the given `regex`. This is used by the main
|
|
5912
|
+
* `picomatch()` function to test the input string.
|
|
5913
|
+
*
|
|
5914
|
+
* ```js
|
|
5915
|
+
* const picomatch = require('picomatch');
|
|
5916
|
+
* // picomatch.test(input, regex[, options]);
|
|
5917
|
+
*
|
|
5918
|
+
* console.log(picomatch.test('foo/bar', /^(?:([^/]*?)\/([^/]*?))$/));
|
|
5919
|
+
* // { isMatch: true, match: [ 'foo/', 'foo', 'bar' ], output: 'foo/bar' }
|
|
5920
|
+
* ```
|
|
5921
|
+
* @param {String} `input` String to test.
|
|
5922
|
+
* @param {RegExp} `regex`
|
|
5923
|
+
* @return {Object} Returns an object with matching info.
|
|
5924
|
+
* @api public
|
|
5925
|
+
*/
|
|
5926
|
+
|
|
5927
|
+
picomatch.test = (input, regex, options, { glob, posix } = {}) => {
|
|
5928
|
+
if (typeof input !== 'string') {
|
|
5929
|
+
throw new TypeError('Expected input to be a string');
|
|
5930
|
+
}
|
|
5931
|
+
|
|
5932
|
+
if (input === '') {
|
|
5933
|
+
return { isMatch: false, output: '' };
|
|
5934
|
+
}
|
|
5935
|
+
|
|
5936
|
+
const opts = options || {};
|
|
5937
|
+
const format = opts.format || (posix ? utils.toPosixSlashes : null);
|
|
5938
|
+
let match = input === glob;
|
|
5939
|
+
let output = (match && format) ? format(input) : input;
|
|
5940
|
+
|
|
5941
|
+
if (match === false) {
|
|
5942
|
+
output = format ? format(input) : input;
|
|
5943
|
+
match = output === glob;
|
|
5944
|
+
}
|
|
5945
|
+
|
|
5946
|
+
if (match === false || opts.capture === true) {
|
|
5947
|
+
if (opts.matchBase === true || opts.basename === true) {
|
|
5948
|
+
match = picomatch.matchBase(input, regex, options, posix);
|
|
5949
|
+
} else {
|
|
5950
|
+
match = regex.exec(output);
|
|
5951
|
+
}
|
|
5952
|
+
}
|
|
5953
|
+
|
|
5954
|
+
return { isMatch: Boolean(match), match, output };
|
|
5955
|
+
};
|
|
5956
|
+
|
|
5957
|
+
/**
|
|
5958
|
+
* Match the basename of a filepath.
|
|
5959
|
+
*
|
|
5960
|
+
* ```js
|
|
5961
|
+
* const picomatch = require('picomatch');
|
|
5962
|
+
* // picomatch.matchBase(input, glob[, options]);
|
|
5963
|
+
* console.log(picomatch.matchBase('foo/bar.js', '*.js'); // true
|
|
5964
|
+
* ```
|
|
5965
|
+
* @param {String} `input` String to test.
|
|
5966
|
+
* @param {RegExp|String} `glob` Glob pattern or regex created by [.makeRe](#makeRe).
|
|
5967
|
+
* @return {Boolean}
|
|
5968
|
+
* @api public
|
|
5969
|
+
*/
|
|
5970
|
+
|
|
5971
|
+
picomatch.matchBase = (input, glob, options) => {
|
|
5972
|
+
const regex = glob instanceof RegExp ? glob : picomatch.makeRe(glob, options);
|
|
5973
|
+
return regex.test(utils.basename(input));
|
|
5974
|
+
};
|
|
5975
|
+
|
|
5976
|
+
/**
|
|
5977
|
+
* Returns true if **any** of the given glob `patterns` match the specified `string`.
|
|
5978
|
+
*
|
|
5979
|
+
* ```js
|
|
5980
|
+
* const picomatch = require('picomatch');
|
|
5981
|
+
* // picomatch.isMatch(string, patterns[, options]);
|
|
5982
|
+
*
|
|
5983
|
+
* console.log(picomatch.isMatch('a.a', ['b.*', '*.a'])); //=> true
|
|
5984
|
+
* console.log(picomatch.isMatch('a.a', 'b.*')); //=> false
|
|
5985
|
+
* ```
|
|
5986
|
+
* @param {String|Array} str The string to test.
|
|
5987
|
+
* @param {String|Array} patterns One or more glob patterns to use for matching.
|
|
5988
|
+
* @param {Object} [options] See available [options](#options).
|
|
5989
|
+
* @return {Boolean} Returns true if any patterns match `str`
|
|
5990
|
+
* @api public
|
|
5991
|
+
*/
|
|
5992
|
+
|
|
5993
|
+
picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str);
|
|
5994
|
+
|
|
5995
|
+
/**
|
|
5996
|
+
* Parse a glob pattern to create the source string for a regular
|
|
5997
|
+
* expression.
|
|
5998
|
+
*
|
|
5999
|
+
* ```js
|
|
6000
|
+
* const picomatch = require('picomatch');
|
|
6001
|
+
* const result = picomatch.parse(pattern[, options]);
|
|
6002
|
+
* ```
|
|
6003
|
+
* @param {String} `pattern`
|
|
6004
|
+
* @param {Object} `options`
|
|
6005
|
+
* @return {Object} Returns an object with useful properties and output to be used as a regex source string.
|
|
6006
|
+
* @api public
|
|
6007
|
+
*/
|
|
6008
|
+
|
|
6009
|
+
picomatch.parse = (pattern, options) => {
|
|
6010
|
+
if (Array.isArray(pattern)) return pattern.map(p => picomatch.parse(p, options));
|
|
6011
|
+
return parse(pattern, { ...options, fastpaths: false });
|
|
6012
|
+
};
|
|
6013
|
+
|
|
6014
|
+
/**
|
|
6015
|
+
* Scan a glob pattern to separate the pattern into segments.
|
|
6016
|
+
*
|
|
6017
|
+
* ```js
|
|
6018
|
+
* const picomatch = require('picomatch');
|
|
6019
|
+
* // picomatch.scan(input[, options]);
|
|
6020
|
+
*
|
|
6021
|
+
* const result = picomatch.scan('!./foo/*.js');
|
|
6022
|
+
* console.log(result);
|
|
6023
|
+
* { prefix: '!./',
|
|
6024
|
+
* input: '!./foo/*.js',
|
|
6025
|
+
* start: 3,
|
|
6026
|
+
* base: 'foo',
|
|
6027
|
+
* glob: '*.js',
|
|
6028
|
+
* isBrace: false,
|
|
6029
|
+
* isBracket: false,
|
|
6030
|
+
* isGlob: true,
|
|
6031
|
+
* isExtglob: false,
|
|
6032
|
+
* isGlobstar: false,
|
|
6033
|
+
* negated: true }
|
|
6034
|
+
* ```
|
|
6035
|
+
* @param {String} `input` Glob pattern to scan.
|
|
6036
|
+
* @param {Object} `options`
|
|
6037
|
+
* @return {Object} Returns an object with
|
|
6038
|
+
* @api public
|
|
6039
|
+
*/
|
|
6040
|
+
|
|
6041
|
+
picomatch.scan = (input, options) => scan(input, options);
|
|
6042
|
+
|
|
6043
|
+
/**
|
|
6044
|
+
* Create a regular expression from a parsed glob pattern.
|
|
6045
|
+
*
|
|
6046
|
+
* ```js
|
|
6047
|
+
* const picomatch = require('picomatch');
|
|
6048
|
+
* const state = picomatch.parse('*.js');
|
|
6049
|
+
* // picomatch.compileRe(state[, options]);
|
|
6050
|
+
*
|
|
6051
|
+
* console.log(picomatch.compileRe(state));
|
|
6052
|
+
* //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/
|
|
6053
|
+
* ```
|
|
6054
|
+
* @param {String} `state` The object returned from the `.parse` method.
|
|
6055
|
+
* @param {Object} `options`
|
|
6056
|
+
* @return {RegExp} Returns a regex created from the given pattern.
|
|
6057
|
+
* @api public
|
|
6058
|
+
*/
|
|
6059
|
+
|
|
6060
|
+
picomatch.compileRe = (parsed, options, returnOutput = false, returnState = false) => {
|
|
6061
|
+
if (returnOutput === true) {
|
|
6062
|
+
return parsed.output;
|
|
6063
|
+
}
|
|
6064
|
+
|
|
6065
|
+
const opts = options || {};
|
|
6066
|
+
const prepend = opts.contains ? '' : '^';
|
|
6067
|
+
const append = opts.contains ? '' : '$';
|
|
6068
|
+
|
|
6069
|
+
let source = `${prepend}(?:${parsed.output})${append}`;
|
|
6070
|
+
if (parsed && parsed.negated === true) {
|
|
6071
|
+
source = `^(?!${source}).*$`;
|
|
6072
|
+
}
|
|
6073
|
+
|
|
6074
|
+
const regex = picomatch.toRegex(source, options);
|
|
6075
|
+
if (returnState === true) {
|
|
6076
|
+
regex.state = parsed;
|
|
6077
|
+
}
|
|
6078
|
+
|
|
6079
|
+
return regex;
|
|
6080
|
+
};
|
|
6081
|
+
|
|
6082
|
+
picomatch.makeRe = (input, options, returnOutput = false, returnState = false) => {
|
|
6083
|
+
if (!input || typeof input !== 'string') {
|
|
6084
|
+
throw new TypeError('Expected a non-empty string');
|
|
6085
|
+
}
|
|
6086
|
+
|
|
6087
|
+
const opts = options || {};
|
|
6088
|
+
let parsed = { negated: false, fastpaths: true };
|
|
6089
|
+
let prefix = '';
|
|
6090
|
+
let output;
|
|
6091
|
+
|
|
6092
|
+
if (input.startsWith('./')) {
|
|
6093
|
+
input = input.slice(2);
|
|
6094
|
+
prefix = parsed.prefix = './';
|
|
6095
|
+
}
|
|
6096
|
+
|
|
6097
|
+
if (opts.fastpaths !== false && (input[0] === '.' || input[0] === '*')) {
|
|
6098
|
+
output = parse.fastpaths(input, options);
|
|
6099
|
+
}
|
|
6100
|
+
|
|
6101
|
+
if (output === undefined) {
|
|
6102
|
+
parsed = parse(input, options);
|
|
6103
|
+
parsed.prefix = prefix + (parsed.prefix || '');
|
|
6104
|
+
} else {
|
|
6105
|
+
parsed.output = output;
|
|
6106
|
+
}
|
|
6107
|
+
|
|
6108
|
+
return picomatch.compileRe(parsed, options, returnOutput, returnState);
|
|
6109
|
+
};
|
|
6110
|
+
|
|
6111
|
+
/**
|
|
6112
|
+
* Create a regular expression from the given regex source string.
|
|
6113
|
+
*
|
|
6114
|
+
* ```js
|
|
6115
|
+
* const picomatch = require('picomatch');
|
|
6116
|
+
* // picomatch.toRegex(source[, options]);
|
|
6117
|
+
*
|
|
6118
|
+
* const { output } = picomatch.parse('*.js');
|
|
6119
|
+
* console.log(picomatch.toRegex(output));
|
|
6120
|
+
* //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/
|
|
6121
|
+
* ```
|
|
6122
|
+
* @param {String} `source` Regular expression source string.
|
|
6123
|
+
* @param {Object} `options`
|
|
6124
|
+
* @return {RegExp}
|
|
6125
|
+
* @api public
|
|
6126
|
+
*/
|
|
6127
|
+
|
|
6128
|
+
picomatch.toRegex = (source, options) => {
|
|
6129
|
+
try {
|
|
6130
|
+
const opts = options || {};
|
|
6131
|
+
return new RegExp(source, opts.flags || (opts.nocase ? 'i' : ''));
|
|
6132
|
+
} catch (err) {
|
|
6133
|
+
if (options && options.debug === true) throw err;
|
|
6134
|
+
return /$^/;
|
|
6135
|
+
}
|
|
6136
|
+
};
|
|
6137
|
+
|
|
6138
|
+
/**
|
|
6139
|
+
* Picomatch constants.
|
|
6140
|
+
* @return {Object}
|
|
6141
|
+
*/
|
|
6142
|
+
|
|
6143
|
+
picomatch.constants = constants;
|
|
6144
|
+
|
|
6145
|
+
/**
|
|
6146
|
+
* Expose "picomatch"
|
|
6147
|
+
*/
|
|
6148
|
+
|
|
6149
|
+
var picomatch_1 = picomatch;
|
|
6150
|
+
|
|
6151
|
+
(function (module) {
|
|
6152
|
+
|
|
6153
|
+
module.exports = picomatch_1;
|
|
6154
|
+
} (picomatchBrowser));
|
|
6155
|
+
|
|
6156
|
+
var pm = /*@__PURE__*/getDefaultExportFromCjs(picomatchBrowserExports);
|
|
6157
|
+
|
|
6158
|
+
function isArray(arg) {
|
|
6159
|
+
return Array.isArray(arg);
|
|
6160
|
+
}
|
|
6161
|
+
function ensureArray(thing) {
|
|
6162
|
+
if (isArray(thing))
|
|
6163
|
+
return thing;
|
|
6164
|
+
if (thing == null)
|
|
6165
|
+
return [];
|
|
6166
|
+
return [thing];
|
|
6167
|
+
}
|
|
6168
|
+
const globToTest = (glob) => {
|
|
6169
|
+
const pattern = glob;
|
|
6170
|
+
const fn = pm(pattern, { dot: true });
|
|
6171
|
+
return {
|
|
6172
|
+
test: (what) => {
|
|
6173
|
+
const result = fn(what);
|
|
6174
|
+
return result;
|
|
6175
|
+
},
|
|
6176
|
+
};
|
|
6177
|
+
};
|
|
6178
|
+
const testTrue = {
|
|
6179
|
+
test: () => true,
|
|
6180
|
+
};
|
|
6181
|
+
const getMatcher = (filter) => {
|
|
6182
|
+
const bundleTest = "bundle" in filter && filter.bundle != null ? globToTest(filter.bundle) : testTrue;
|
|
6183
|
+
const fileTest = "file" in filter && filter.file != null ? globToTest(filter.file) : testTrue;
|
|
6184
|
+
return { bundleTest, fileTest };
|
|
6185
|
+
};
|
|
6186
|
+
const createFilter = (include, exclude) => {
|
|
6187
|
+
const includeMatchers = ensureArray(include).map(getMatcher);
|
|
6188
|
+
const excludeMatchers = ensureArray(exclude).map(getMatcher);
|
|
6189
|
+
return (bundleId, id) => {
|
|
6190
|
+
for (let i = 0; i < excludeMatchers.length; ++i) {
|
|
6191
|
+
const { bundleTest, fileTest } = excludeMatchers[i];
|
|
6192
|
+
if (bundleTest.test(bundleId) && fileTest.test(id))
|
|
6193
|
+
return false;
|
|
6194
|
+
}
|
|
6195
|
+
for (let i = 0; i < includeMatchers.length; ++i) {
|
|
6196
|
+
const { bundleTest, fileTest } = includeMatchers[i];
|
|
6197
|
+
if (bundleTest.test(bundleId) && fileTest.test(id))
|
|
6198
|
+
return true;
|
|
6199
|
+
}
|
|
6200
|
+
return !includeMatchers.length;
|
|
6201
|
+
};
|
|
6202
|
+
};
|
|
6203
|
+
|
|
6204
|
+
const throttleFilter = (callback, limit) => {
|
|
6205
|
+
let waiting = false;
|
|
6206
|
+
return (val) => {
|
|
6207
|
+
if (!waiting) {
|
|
6208
|
+
callback(val);
|
|
6209
|
+
waiting = true;
|
|
6210
|
+
setTimeout(() => {
|
|
6211
|
+
waiting = false;
|
|
6212
|
+
}, limit);
|
|
6213
|
+
}
|
|
6214
|
+
};
|
|
6215
|
+
};
|
|
6216
|
+
const prepareFilter = (filt) => {
|
|
6217
|
+
if (filt === "")
|
|
6218
|
+
return [];
|
|
6219
|
+
return (filt
|
|
6220
|
+
.split(",")
|
|
6221
|
+
// remove spaces before and after
|
|
6222
|
+
.map((entry) => entry.trim())
|
|
6223
|
+
// unquote "
|
|
6224
|
+
.map((entry) => entry.startsWith('"') && entry.endsWith('"') ? entry.substring(1, entry.length - 1) : entry)
|
|
6225
|
+
// unquote '
|
|
6226
|
+
.map((entry) => entry.startsWith("'") && entry.endsWith("'") ? entry.substring(1, entry.length - 1) : entry)
|
|
6227
|
+
// remove empty strings
|
|
6228
|
+
.filter((entry) => entry)
|
|
6229
|
+
// parse bundle:file
|
|
6230
|
+
.map((entry) => entry.split(":"))
|
|
6231
|
+
// normalize entry just in case
|
|
6232
|
+
.flatMap((entry) => {
|
|
6233
|
+
if (entry.length === 0)
|
|
6234
|
+
return [];
|
|
6235
|
+
let bundle = null;
|
|
6236
|
+
let file = null;
|
|
6237
|
+
if (entry.length === 1 && entry[0]) {
|
|
6238
|
+
file = entry[0];
|
|
6239
|
+
return [{ file, bundle }];
|
|
6240
|
+
}
|
|
6241
|
+
bundle = entry[0] || null;
|
|
6242
|
+
file = entry.slice(1).join(":") || null;
|
|
6243
|
+
return [{ bundle, file }];
|
|
6244
|
+
}));
|
|
6245
|
+
};
|
|
6246
|
+
const useFilter = () => {
|
|
6247
|
+
const [includeFilter, setIncludeFilter] = p("");
|
|
6248
|
+
const [excludeFilter, setExcludeFilter] = p("");
|
|
6249
|
+
const setIncludeFilterTrottled = F(() => throttleFilter(setIncludeFilter, 200), []);
|
|
6250
|
+
const setExcludeFilterTrottled = F(() => throttleFilter(setExcludeFilter, 200), []);
|
|
6251
|
+
const isIncluded = F(() => createFilter(prepareFilter(includeFilter), prepareFilter(excludeFilter)), [includeFilter, excludeFilter]);
|
|
6252
|
+
const getModuleFilterMultiplier = T((bundleId, data) => {
|
|
6253
|
+
return isIncluded(bundleId, data.id) ? 1 : 0;
|
|
6254
|
+
}, [isIncluded]);
|
|
4128
6255
|
return {
|
|
4129
6256
|
getModuleFilterMultiplier,
|
|
4130
6257
|
includeFilter,
|
|
@@ -4134,6 +6261,7 @@ var drawChart = (function (exports) {
|
|
|
4134
6261
|
};
|
|
4135
6262
|
};
|
|
4136
6263
|
|
|
6264
|
+
const PLACEHOLDER = "bundle-*:**/file/**,**/file**, bundle-*:";
|
|
4137
6265
|
const SideBar = ({ availableSizeProperties, sizeProperty, setSizeProperty, onExcludeChange, onIncludeChange, }) => {
|
|
4138
6266
|
const [includeValue, setIncludeValue] = p("");
|
|
4139
6267
|
const [excludeValue, setExcludeValue] = p("");
|
|
@@ -4156,7 +6284,7 @@ var drawChart = (function (exports) {
|
|
|
4156
6284
|
availableSizeProperties.map((sizeProp) => {
|
|
4157
6285
|
const id = `selector-${sizeProp}`;
|
|
4158
6286
|
return (o$1("div", Object.assign({ className: "size-selector" }, { children: [o$1("input", { type: "radio", id: id, checked: sizeProp === sizeProperty, onChange: handleSizePropertyChange(sizeProp) }), o$1("label", Object.assign({ htmlFor: id }, { children: LABELS[sizeProp] }))] }), sizeProp));
|
|
4159
|
-
}) })), o$1("div", Object.assign({ className: "module-filters" }, { children: [o$1("div", Object.assign({ className: "module-filter" }, { children: [o$1("label", Object.assign({ htmlFor: "module-filter-exclude" }, { children: "Exclude" })), o$1("input", { type: "text", id: "module-filter-exclude", value: excludeValue, onInput: handleExcludeChange, placeholder:
|
|
6287
|
+
}) })), o$1("div", Object.assign({ className: "module-filters" }, { children: [o$1("div", Object.assign({ className: "module-filter" }, { children: [o$1("label", Object.assign({ htmlFor: "module-filter-exclude" }, { children: "Exclude" })), o$1("input", { type: "text", id: "module-filter-exclude", value: excludeValue, onInput: handleExcludeChange, placeholder: PLACEHOLDER })] })), o$1("div", Object.assign({ className: "module-filter" }, { children: [o$1("label", Object.assign({ htmlFor: "module-filter-include" }, { children: "Include" })), o$1("input", { type: "text", id: "module-filter-include", value: includeValue, onInput: handleIncludeChange, placeholder: PLACEHOLDER })] }))] }))] })));
|
|
4160
6288
|
};
|
|
4161
6289
|
|
|
4162
6290
|
const Tooltip_marginX = 10;
|
|
@@ -4344,12 +6472,14 @@ var drawChart = (function (exports) {
|
|
|
4344
6472
|
}
|
|
4345
6473
|
};
|
|
4346
6474
|
const processedNodes = F(() => {
|
|
6475
|
+
var _a;
|
|
4347
6476
|
const newNodes = [];
|
|
4348
6477
|
for (const node of nodes) {
|
|
4349
6478
|
//if (node.renderedLength === 0) continue;
|
|
4350
6479
|
if (excludedNodes.includes(node.uid))
|
|
4351
6480
|
continue;
|
|
4352
|
-
const
|
|
6481
|
+
const bundleId = (_a = Object.entries(node.moduleParts).find(([bundleId, uid]) => uid == node.uid)) === null || _a === void 0 ? void 0 : _a[0];
|
|
6482
|
+
const filterMultiplier = getModuleFilterMultiplier(bundleId, node);
|
|
4353
6483
|
if (filterMultiplier === 0)
|
|
4354
6484
|
continue;
|
|
4355
6485
|
const nodeGroup = nodeGroups[node.uid];
|
|
@@ -4483,13 +6613,12 @@ var drawChart = (function (exports) {
|
|
|
4483
6613
|
return exports;
|
|
4484
6614
|
|
|
4485
6615
|
})({});
|
|
4486
|
-
//# sourceMappingURL=network.js.map
|
|
4487
6616
|
|
|
4488
6617
|
/*-->*/
|
|
4489
6618
|
</script>
|
|
4490
6619
|
<script>
|
|
4491
6620
|
/*<!--*/
|
|
4492
|
-
const data = {"version":2,"tree":{"name":"root","children":[{"name":"vitus-tools-core.module.js","children":[{"name":"src/index.ts","uid":"
|
|
6621
|
+
const data = {"version":2,"tree":{"name":"root","children":[{"name":"vitus-tools-core.module.js","children":[{"name":"src/index.ts","uid":"cbbb-6"}]}],"isRoot":true},"nodeParts":{"cbbb-6":{"renderedLength":3922,"gzipLength":1253,"brotliLength":0,"metaUid":"cbbb-5"}},"nodeMetas":{"cbbb-5":{"id":"/src/index.ts","moduleParts":{"vitus-tools-core.module.js":"cbbb-6"},"imported":[{"uid":"cbbb-7"},{"uid":"cbbb-8"},{"uid":"cbbb-9"}],"importedBy":[],"isEntry":true},"cbbb-7":{"id":"fs","moduleParts":{},"imported":[],"importedBy":[{"uid":"cbbb-5"}],"isExternal":true},"cbbb-8":{"id":"find-up","moduleParts":{},"imported":[],"importedBy":[{"uid":"cbbb-5"}],"isExternal":true},"cbbb-9":{"id":"lodash","moduleParts":{},"imported":[],"importedBy":[{"uid":"cbbb-5"}],"isExternal":true}},"env":{"rollup":"2.79.1"},"options":{"gzip":true,"brotli":false,"sourcemap":false}};
|
|
4493
6622
|
|
|
4494
6623
|
const run = () => {
|
|
4495
6624
|
const width = window.innerWidth;
|