jiek 0.4.7-alpha.14 → 0.4.7-alpha.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. package/bin/jiek.js +4 -7
  2. package/dist/{cli.d.cts → cli.d.mts} +0 -15
  3. package/dist/cli.d.mts.map +1 -0
  4. package/dist/cli.d.ts +0 -15
  5. package/dist/cli.d.ts.map +1 -0
  6. package/dist/cli.js +222 -4408
  7. package/dist/cli.js.map +1 -0
  8. package/dist/cli.min.js +1 -19
  9. package/dist/cli.min.js.map +1 -0
  10. package/dist/cli.min.mjs +1 -0
  11. package/dist/cli.min.mjs.map +1 -0
  12. package/dist/cli.mjs +803 -0
  13. package/dist/cli.mjs.map +1 -0
  14. package/dist/{index.d.cts → index.d.mts} +0 -15
  15. package/dist/index.d.mts.map +1 -0
  16. package/dist/index.d.ts +0 -15
  17. package/dist/index.d.ts.map +1 -0
  18. package/dist/index.js +3 -1
  19. package/dist/index.js.map +1 -0
  20. package/dist/index.min.js +1 -1
  21. package/dist/index.min.js.map +1 -0
  22. package/dist/index.min.mjs +1 -0
  23. package/dist/index.min.mjs.map +1 -0
  24. package/dist/index.mjs +3 -0
  25. package/dist/index.mjs.map +1 -0
  26. package/dist/rollup/index.d.mts.map +1 -0
  27. package/dist/rollup/index.d.ts.map +1 -0
  28. package/dist/rollup/index.js +69 -4189
  29. package/dist/rollup/index.js.map +1 -0
  30. package/dist/rollup/index.min.js +1 -19
  31. package/dist/rollup/index.min.js.map +1 -0
  32. package/dist/rollup/index.min.mjs +1 -0
  33. package/dist/rollup/index.min.mjs.map +1 -0
  34. package/dist/rollup/index.mjs +551 -0
  35. package/dist/rollup/index.mjs.map +1 -0
  36. package/package.json +19 -11
  37. package/src/commands/base.ts +2 -1
  38. package/src/commands/build.ts +2 -4
  39. package/src/commands/publish.ts +2 -16
  40. package/src/pkg.ts +1 -0
  41. package/src/rollup/index.ts +3 -5
  42. package/src/utils/filterSupport.ts +0 -2
  43. package/src/utils/getExports.ts +7 -11
  44. package/src/utils/tsRegister.ts +0 -4
  45. package/dist/cli.cjs +0 -5041
  46. package/dist/cli.min.cjs +0 -19
  47. package/dist/index.cjs +0 -5
  48. package/dist/index.min.cjs +0 -1
  49. package/dist/rollup/index.cjs +0 -4688
  50. package/dist/rollup/index.min.cjs +0 -19
  51. /package/dist/rollup/{index.d.cts → index.d.mts} +0 -0
@@ -1,19 +0,0 @@
1
- "use strict";var e=require("node:fs"),t=require("node:path"),r=require("@jiek/pkger/entrypoints"),n=require("@jiek/rollup-plugin-dts"),o=require("@jiek/utils/getWorkspaceDir"),s=require("@rollup/plugin-commonjs"),u=require("@rollup/plugin-json"),a=require("@rollup/plugin-node-resolve"),i=require("@rollup/plugin-terser"),p=require("execa"),l=require("jsonc-parser"),c=require("util"),f=require("path"),d=require("rollup-plugin-esbuild"),g=require("typescript"),A=require("commander"),h=require("js-yaml"),R=require("node:module");require("@pnpm/filter-workspace-packages");var _="undefined"!=typeof document?document.currentScript:null;function E(e){return e&&e.__esModule?e:{default:e}}var y,C,m,v,S,b,x,$,H,T,w,L,O,k,N,I,M,B,j,P=E(e),D=E(t),G=E(s),U=E(u),K=E(i),q=E(c),F=E(f),Q=E(d),W=E(g),X={};function Z(){return y||(y=1,function(e){e.isInteger=e=>"number"==typeof e?Number.isInteger(e):"string"==typeof e&&""!==e.trim()&&Number.isInteger(Number(e)),e.find=(e,t)=>e.nodes.find((e=>e.type===t)),e.exceedsLimit=(t,r,n=1,o)=>!1!==o&&(!(!e.isInteger(t)||!e.isInteger(r))&&(Number(r)-Number(t))/Number(n)>=o),e.escapeNode=(e,t=0,r)=>{let n=e.nodes[t];n&&(r&&n.type===r||"open"===n.type||"close"===n.type)&&!0!==n.escaped&&(n.value="\\"+n.value,n.escaped=!0)},e.encloseBrace=e=>"brace"===e.type&&(!(e.commas>>0+e.ranges)&&(e.invalid=!0,!0)),e.isInvalidBrace=e=>"brace"===e.type&&(!(!0!==e.invalid&&!e.dollar)||(e.commas>>0+e.ranges?(!0!==e.open||!0!==e.close)&&(e.invalid=!0,!0):(e.invalid=!0,!0))),e.isOpenOrClose=e=>"open"===e.type||"close"===e.type||(!0===e.open||!0===e.close),e.reduce=e=>e.reduce(((e,t)=>("text"===t.type&&e.push(t.value),"range"===t.type&&(t.type="text"),e)),[]),e.flatten=(...e)=>{const t=[],r=e=>{for(let n=0;n<e.length;n++){let o=e[n];Array.isArray(o)?r(o):void 0!==o&&t.push(o)}return t};return r(e),t}}(X)),X}function Y(){if(m)return C;m=1;const e=Z();return C=(t,r={})=>{let n=(t,o={})=>{let s=r.escapeInvalid&&e.isInvalidBrace(o),u=!0===t.invalid&&!0===r.escapeInvalid,a="";if(t.value)return(s||u)&&e.isOpenOrClose(t)?"\\"+t.value:t.value;if(t.value)return t.value;if(t.nodes)for(let e of t.nodes)a+=n(e);return a};return n(t)}}
2
- /*!
3
- * is-number <https://github.com/jonschlinkert/is-number>
4
- *
5
- * Copyright (c) 2014-present, Jon Schlinkert.
6
- * Released under the MIT License.
7
- */function V(){return S?v:(S=1,v=function(e){return"number"==typeof e?e-e==0:"string"==typeof e&&""!==e.trim()&&(Number.isFinite?Number.isFinite(+e):isFinite(+e))})}
8
- /*!
9
- * to-regex-range <https://github.com/micromatch/to-regex-range>
10
- *
11
- * Copyright (c) 2015-present, Jon Schlinkert.
12
- * Released under the MIT License.
13
- */function z(){if(x)return b;x=1;const e=V(),t=(r,s,u)=>{if(!1===e(r))throw new TypeError("toRegexRange: expected the first argument to be a number");if(void 0===s||r===s)return String(r);if(!1===e(s))throw new TypeError("toRegexRange: expected the second argument to be a number.");let a={relaxZeros:!0,...u};"boolean"==typeof a.strictZeros&&(a.relaxZeros=!1===a.strictZeros);let i=r+":"+s+"="+String(a.relaxZeros)+String(a.shorthand)+String(a.capture)+String(a.wrap);if(t.cache.hasOwnProperty(i))return t.cache[i].result;let p=Math.min(r,s),l=Math.max(r,s);if(1===Math.abs(p-l)){let e=r+"|"+s;return a.capture?`(${e})`:!1===a.wrap?e:`(?:${e})`}let f=c(r)||c(s),d={min:r,max:s,a:p,b:l},g=[],A=[];if(f&&(d.isPadded=f,d.maxLen=String(d.max).length),p<0){A=n(l<0?Math.abs(l):1,Math.abs(p),d,a),p=d.a=0}return l>=0&&(g=n(p,l,d,a)),d.negatives=A,d.positives=g,d.result=function(e,t,r){let n=o(e,t,"-",!1)||[],s=o(t,e,"",!1)||[],u=o(e,t,"-?",!0)||[];return n.concat(u).concat(s).join("|")}(A,g),!0===a.capture?d.result=`(${d.result})`:!1!==a.wrap&&g.length+A.length>1&&(d.result=`(?:${d.result})`),t.cache[i]=d,d.result};function r(e,t,r){if(e===t)return{pattern:e,count:[],digits:0};let n=function(e,t){let r=[];for(let n=0;n<e.length;n++)r.push([e[n],t[n]]);return r}(e,t),o=n.length,s="",u=0;for(let e=0;e<o;e++){let[t,r]=n[e];t===r?s+=t:"0"!==t||"9"!==r?s+=l(t,r):u++}return u&&(s+=!0===r.shorthand?"\\d":"[0-9]"),{pattern:s,count:[u],digits:o}}function n(e,t,n,o){let u,l=function(e,t){let r=1,n=1,o=a(e,r),u=new Set([t]);for(;e<=o&&o<=t;)u.add(o),r+=1,o=a(e,r);for(o=i(t+1,n)-1;e<o&&o<=t;)u.add(o),n+=1,o=i(t+1,n)-1;return u=[...u],u.sort(s),u}(e,t),c=[],d=e;for(let e=0;e<l.length;e++){let t=l[e],s=r(String(d),String(t),o),a="";n.isPadded||!u||u.pattern!==s.pattern?(n.isPadded&&(a=f(t,n,o)),s.string=a+s.pattern+p(s.count),c.push(s),d=t+1,u=s):(u.count.length>1&&u.count.pop(),u.count.push(s.count[0]),u.string=u.pattern+p(u.count),d=t+1)}return c}function o(e,t,r,n,o){let s=[];for(let o of e){let{string:e}=o;n||u(t,"string",e)||s.push(r+e),n&&u(t,"string",e)&&s.push(r+e)}return s}function s(e,t){return e>t?1:t>e?-1:0}function u(e,t,r){return e.some((e=>e[t]===r))}function a(e,t){return Number(String(e).slice(0,-t)+"9".repeat(t))}function i(e,t){return e-e%Math.pow(10,t)}function p(e){let[t=0,r=""]=e;return r||t>1?`{${t+(r?","+r:"")}}`:""}function l(e,t,r){return`[${e}${t-e==1?"":"-"}${t}]`}function c(e){return/^-?(0+)\d/.test(e)}function f(e,t,r){if(!t.isPadded)return e;let n=Math.abs(t.maxLen-String(e).length),o=!1!==r.relaxZeros;switch(n){case 0:return"";case 1:return o?"0?":"0";case 2:return o?"0{0,2}":"00";default:return o?`0{0,${n}}`:`0{${n}}`}}return t.cache={},t.clearCache=()=>t.cache={},b=t}
14
- /*!
15
- * fill-range <https://github.com/jonschlinkert/fill-range>
16
- *
17
- * Copyright (c) 2014-present, Jon Schlinkert.
18
- * Licensed under the MIT License.
19
- */function J(){if(H)return $;H=1;const e=q.default,t=z(),r=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),n=e=>"number"==typeof e||"string"==typeof e&&""!==e,o=e=>Number.isInteger(+e),s=e=>{let t=`${e}`,r=-1;if("-"===t[0]&&(t=t.slice(1)),"0"===t)return!1;for(;"0"===t[++r];);return r>0},u=(e,t,r)=>{if(t>0){let r="-"===e[0]?"-":"";r&&(e=e.slice(1)),e=r+e.padStart(r?t-1:t,"0")}return!1===r?String(e):e},a=(e,t)=>{let r="-"===e[0]?"-":"";for(r&&(e=e.slice(1),t--);e.length<t;)e="0"+e;return r?"-"+e:e},i=(e,r,n,o)=>{if(n)return t(e,r,{wrap:!1,...o});let s=String.fromCharCode(e);return e===r?s:`[${s}-${String.fromCharCode(r)}]`},p=(e,r,n)=>{if(Array.isArray(e)){let t=!0===n.wrap,r=n.capture?"":"?:";return t?`(${r}${e.join("|")})`:e.join("|")}return t(e,r,n)},l=(...t)=>new RangeError("Invalid range arguments: "+e.inspect(...t)),c=(e,t,r)=>{if(!0===r.strictRanges)throw l([e,t]);return[]},f=(e,t,r=1,n={})=>{let o=Number(e),c=Number(t);if(!Number.isInteger(o)||!Number.isInteger(c)){if(!0===n.strictRanges)throw l([e,t]);return[]}0===o&&(o=0),0===c&&(c=0);let f=o>c,d=String(e),g=String(t),A=String(r);r=Math.max(Math.abs(r),1);let h=s(d)||s(g)||s(A),R=h?Math.max(d.length,g.length,A.length):0,_=!1===h&&!1===((e,t,r)=>"string"==typeof e||"string"==typeof t||!0===r.stringify)(e,t,n),E=n.transform||(e=>t=>!0===e?Number(t):String(t))(_);if(n.toRegex&&1===r)return i(a(e,R),a(t,R),!0,n);let y={negatives:[],positives:[]},C=[],m=0;for(;f?o>=c:o<=c;)!0===n.toRegex&&r>1?y[(v=o)<0?"negatives":"positives"].push(Math.abs(v)):C.push(u(E(o,m),R,_)),o=f?o-r:o+r,m++;var v;return!0===n.toRegex?r>1?((e,t)=>{e.negatives.sort(((e,t)=>e<t?-1:e>t?1:0)),e.positives.sort(((e,t)=>e<t?-1:e>t?1:0));let r,n=t.capture?"":"?:",o="",s="";return e.positives.length&&(o=e.positives.join("|")),e.negatives.length&&(s=`-(${n}${e.negatives.join("|")})`),r=o&&s?`${o}|${s}`:o||s,t.wrap?`(${n}${r})`:r})(y,n):p(C,null,{wrap:!1,...n}):C},d=(e,t,s,u={})=>{if(null==t&&n(e))return[e];if(!n(e)||!n(t))return c(e,t,u);if("function"==typeof s)return d(e,t,1,{transform:s});if(r(s))return d(e,t,0,s);let a={...u};return!0===a.capture&&(a.wrap=!0),s=s||a.step||1,o(s)?o(e)&&o(t)?f(e,t,s,a):((e,t,r=1,n={})=>{if(!o(e)&&e.length>1||!o(t)&&t.length>1)return c(e,t,n);let s=n.transform||(e=>String.fromCharCode(e)),u=`${e}`.charCodeAt(0),a=`${t}`.charCodeAt(0),l=u>a,f=Math.min(u,a),d=Math.max(u,a);if(n.toRegex&&1===r)return i(f,d,!1,n);let g=[],A=0;for(;l?u>=a:u<=a;)g.push(s(u,A)),u=l?u-r:u+r,A++;return!0===n.toRegex?p(g,null,{wrap:!1,options:n}):g})(e,t,Math.max(Math.abs(s),1),a):null==s||r(s)?d(e,t,1,s):((e,t)=>{if(!0===t.strictRanges)throw new TypeError(`Expected step "${e}" to be a number`);return[]})(s,a)};return $=d}function ee(){if(M)return I;M=1;const e=Y(),{MAX_LENGTH:t,CHAR_BACKSLASH:r,CHAR_BACKTICK:n,CHAR_COMMA:o,CHAR_DOT:s,CHAR_LEFT_PARENTHESES:u,CHAR_RIGHT_PARENTHESES:a,CHAR_LEFT_CURLY_BRACE:i,CHAR_RIGHT_CURLY_BRACE:p,CHAR_LEFT_SQUARE_BRACKET:l,CHAR_RIGHT_SQUARE_BRACKET:c,CHAR_DOUBLE_QUOTE:f,CHAR_SINGLE_QUOTE:d,CHAR_NO_BREAK_SPACE:g,CHAR_ZERO_WIDTH_NOBREAK_SPACE:A}=N?k:(N=1,k={MAX_LENGTH:65536,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"A",CHAR_LOWERCASE_A:"a",CHAR_UPPERCASE_Z:"Z",CHAR_LOWERCASE_Z:"z",CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_ASTERISK:"*",CHAR_AMPERSAND:"&",CHAR_AT:"@",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:"\r",CHAR_CIRCUMFLEX_ACCENT:"^",CHAR_COLON:":",CHAR_COMMA:",",CHAR_DOLLAR:"$",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_EQUAL:"=",CHAR_EXCLAMATION_MARK:"!",CHAR_FORM_FEED:"\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:"\n",CHAR_NO_BREAK_SPACE:" ",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:"\t",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\ufeff"});return I=(h,R={})=>{if("string"!=typeof h)throw new TypeError("Expected a string");let _=R||{},E="number"==typeof _.maxLength?Math.min(t,_.maxLength):t;if(h.length>E)throw new SyntaxError(`Input length (${h.length}), exceeds max characters (${E})`);let y,C={type:"root",input:h,nodes:[]},m=[C],v=C,S=C,b=0,x=h.length,$=0,H=0;const T=()=>h[$++],w=e=>{if("text"===e.type&&"dot"===S.type&&(S.type="text"),!S||"text"!==S.type||"text"!==e.type)return v.nodes.push(e),e.parent=v,e.prev=S,S=e,e;S.value+=e.value};for(w({type:"bos"});$<x;)if(v=m[m.length-1],y=T(),y!==A&&y!==g)if(y!==r)if(y!==c)if(y!==l)if(y!==u)if(y!==a)if(y!==f&&y!==d&&y!==n)if(y!==i)if(y!==p)if(y===o&&H>0){if(v.ranges>0){v.ranges=0;let t=v.nodes.shift();v.nodes=[t,{type:"text",value:e(v)}]}w({type:"comma",value:y}),v.commas++}else if(y===s&&H>0&&0===v.commas){let e=v.nodes;if(0===H||0===e.length){w({type:"text",value:y});continue}if("dot"===S.type){if(v.range=[],S.value+=y,S.type="range",3!==v.nodes.length&&5!==v.nodes.length){v.invalid=!0,v.ranges=0,S.type="text";continue}v.ranges++,v.args=[];continue}if("range"===S.type){e.pop();let t=e[e.length-1];t.value+=S.value+y,S=t,v.ranges--;continue}w({type:"dot",value:y})}else w({type:"text",value:y});else{if("brace"!==v.type){w({type:"text",value:y});continue}let e="close";v=m.pop(),v.close=!0,w({type:e,value:y}),H--,v=m[m.length-1]}else{H++;let e=S.value&&"$"===S.value.slice(-1)||!0===v.dollar;v=w({type:"brace",open:!0,close:!1,dollar:e,depth:H,commas:0,ranges:0,nodes:[]}),m.push(v),w({type:"open",value:y})}else{let e,t=y;for(!0!==R.keepQuotes&&(y="");$<x&&(e=T());)if(e!==r){if(e===t){!0===R.keepQuotes&&(y+=e);break}y+=e}else y+=e+T();w({type:"text",value:y})}else{if("paren"!==v.type){w({type:"text",value:y});continue}v=m.pop(),w({type:"text",value:y}),v=m[m.length-1]}else v=w({type:"paren",nodes:[]}),m.push(v),w({type:"text",value:y});else{let e;for(b++;$<x&&(e=T());)if(y+=e,e!==l)if(e!==r){if(e===c&&(b--,0===b))break}else y+=T();else b++;w({type:"text",value:y})}else w({type:"text",value:"\\"+y});else w({type:"text",value:(R.keepEscaping?y:"")+T()});do{if(v=m.pop(),"root"!==v.type){v.nodes.forEach((e=>{e.nodes||("open"===e.type&&(e.isOpen=!0),"close"===e.type&&(e.isClose=!0),e.nodes||(e.type="text"),e.invalid=!0)}));let e=m[m.length-1],t=e.nodes.indexOf(v);e.nodes.splice(t,1,...v.nodes)}}while(m.length>0);return w({type:"eos"}),C},I}function te(){if(j)return B;j=1;const e=Y(),t=function(){if(w)return T;w=1;const e=J(),t=Z();return T=(r,n={})=>{let o=(r,s={})=>{let u=t.isInvalidBrace(s),a=!0===r.invalid&&!0===n.escapeInvalid,i=!0===u||!0===a,p=!0===n.escapeInvalid?"\\":"",l="";if(!0===r.isOpen)return p+r.value;if(!0===r.isClose)return p+r.value;if("open"===r.type)return i?p+r.value:"(";if("close"===r.type)return i?p+r.value:")";if("comma"===r.type)return"comma"===r.prev.type?"":i?r.value:"|";if(r.value)return r.value;if(r.nodes&&r.ranges>0){let o=t.reduce(r.nodes),s=e(...o,{...n,wrap:!1,toRegex:!0});if(0!==s.length)return o.length>1&&s.length>1?`(${s})`:s}if(r.nodes)for(let e of r.nodes)l+=o(e,r);return l};return o(r)}}(),r=function(){if(O)return L;O=1;const e=J(),t=Y(),r=Z(),n=(e="",t="",o=!1)=>{let s=[];if(e=[].concat(e),!(t=[].concat(t)).length)return e;if(!e.length)return o?r.flatten(t).map((e=>`{${e}}`)):t;for(let r of e)if(Array.isArray(r))for(let e of r)s.push(n(e,t,o));else for(let e of t)!0===o&&"string"==typeof e&&(e=`{${e}}`),s.push(Array.isArray(e)?n(r,e,o):r+e);return r.flatten(s)};return L=(o,s={})=>{let u=void 0===s.rangeLimit?1e3:s.rangeLimit,a=(o,i={})=>{o.queue=[];let p=i,l=i.queue;for(;"brace"!==p.type&&"root"!==p.type&&p.parent;)p=p.parent,l=p.queue;if(o.invalid||o.dollar)return void l.push(n(l.pop(),t(o,s)));if("brace"===o.type&&!0!==o.invalid&&2===o.nodes.length)return void l.push(n(l.pop(),["{}"]));if(o.nodes&&o.ranges>0){let a=r.reduce(o.nodes);if(r.exceedsLimit(...a,s.step,u))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let i=e(...a,s);return 0===i.length&&(i=t(o,s)),l.push(n(l.pop(),i)),void(o.nodes=[])}let c=r.encloseBrace(o),f=o.queue,d=o;for(;"brace"!==d.type&&"root"!==d.type&&d.parent;)d=d.parent,f=d.queue;for(let e=0;e<o.nodes.length;e++){let t=o.nodes[e];"comma"!==t.type||"brace"!==o.type?"close"!==t.type?t.value&&"open"!==t.type?f.push(n(f.pop(),t.value)):t.nodes&&a(t,o):l.push(n(l.pop(),f,c)):(1===e&&f.push(""),f.push(""))}return f};return r.flatten(a(o))}}(),n=ee(),o=(e,t={})=>{let r=[];if(Array.isArray(e))for(let n of e){let e=o.create(n,t);Array.isArray(e)?r.push(...e):r.push(e)}else r=[].concat(o.create(e,t));return t&&!0===t.expand&&!0===t.nodupes&&(r=[...new Set(r)]),r};return o.parse=(e,t={})=>n(e,t),o.stringify=(t,r={})=>e("string"==typeof t?o.parse(t,r):t,r),o.compile=(e,r={})=>("string"==typeof e&&(e=o.parse(e,r)),t(e,r)),o.expand=(e,t={})=>{"string"==typeof e&&(e=o.parse(e,t));let n=r(e,t);return!0===t.noempty&&(n=n.filter(Boolean)),!0===t.nodupes&&(n=[...new Set(n)]),n},o.create=(e,t={})=>""===e||e.length<3?[e]:!0!==t.expand?o.compile(e,t):o.expand(e,t),B=o}var re,ne,oe,se,ue,ae,ie,pe,le,ce,fe,de,ge,Ae={};function he(){if(ne)return re;ne=1;const e=F.default,t="\\\\/",r=`[^${t}]`,n="\\.",o="\\/",s="[^/]",u=`(?:${o}|$)`,a=`(?:^|${o})`,i=`${n}{1,2}${u}`,p={DOT_LITERAL:n,PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:o,ONE_CHAR:"(?=.)",QMARK:s,END_ANCHOR:u,DOTS_SLASH:i,NO_DOT:`(?!${n})`,NO_DOTS:`(?!${a}${i})`,NO_DOT_SLASH:`(?!${n}{0,1}${u})`,NO_DOTS_SLASH:`(?!${i})`,QMARK_NO_DOT:`[^.${o}]`,STAR:`${s}*?`,START_ANCHOR:a},l={...p,SLASH_LITERAL:`[${t}]`,QMARK:r,STAR:`${r}*?`,DOTS_SLASH:`${n}{1,2}(?:[${t}]|$)`,NO_DOT:`(?!${n})`,NO_DOTS:`(?!(?:^|[${t}])${n}{1,2}(?:[${t}]|$))`,NO_DOT_SLASH:`(?!${n}{0,1}(?:[${t}]|$))`,NO_DOTS_SLASH:`(?!${n}{1,2}(?:[${t}]|$))`,QMARK_NO_DOT:`[^.${t}]`,START_ANCHOR:`(?:^|[${t}])`,END_ANCHOR:`(?:[${t}]|$)`};return re={MAX_LENGTH:65536,POSIX_REGEX_SOURCE:{alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"},REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:e.sep,extglobChars:e=>({"!":{type:"negate",open:"(?:(?!(?:",close:`))${e.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}),globChars:e=>!0===e?l:p}}function Re(){return oe||(oe=1,function(e){const t=F.default,r="win32"===process.platform,{REGEX_BACKSLASH:n,REGEX_REMOVE_BACKSLASH:o,REGEX_SPECIAL_CHARS:s,REGEX_SPECIAL_CHARS_GLOBAL:u}=he();e.isObject=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),e.hasRegexChars=e=>s.test(e),e.isRegexChar=t=>1===t.length&&e.hasRegexChars(t),e.escapeRegex=e=>e.replace(u,"\\$1"),e.toPosixSlashes=e=>e.replace(n,"/"),e.removeBackslashes=e=>e.replace(o,(e=>"\\"===e?"":e)),e.supportsLookbehinds=()=>{const e=process.version.slice(1).split(".").map(Number);return 3===e.length&&e[0]>=9||8===e[0]&&e[1]>=10},e.isWindows=e=>e&&"boolean"==typeof e.windows?e.windows:!0===r||"\\"===t.sep,e.escapeLast=(t,r,n)=>{const o=t.lastIndexOf(r,n);return-1===o?t:"\\"===t[o-1]?e.escapeLast(t,r,o-1):`${t.slice(0,o)}\\${t.slice(o)}`},e.removePrefix=(e,t={})=>{let r=e;return r.startsWith("./")&&(r=r.slice(2),t.prefix="./"),r},e.wrapOutput=(e,t={},r={})=>{let n=`${r.contains?"":"^"}(?:${e})${r.contains?"":"$"}`;return!0===t.negated&&(n=`(?:^(?!${n}).*$)`),n}}(Ae)),Ae}function _e(){if(le)return pe;le=1;const e=F.default,t=function(){if(ue)return se;ue=1;const e=Re(),{CHAR_ASTERISK:t,CHAR_AT:r,CHAR_BACKWARD_SLASH:n,CHAR_COMMA:o,CHAR_DOT:s,CHAR_EXCLAMATION_MARK:u,CHAR_FORWARD_SLASH:a,CHAR_LEFT_CURLY_BRACE:i,CHAR_LEFT_PARENTHESES:p,CHAR_LEFT_SQUARE_BRACKET:l,CHAR_PLUS:c,CHAR_QUESTION_MARK:f,CHAR_RIGHT_CURLY_BRACE:d,CHAR_RIGHT_PARENTHESES:g,CHAR_RIGHT_SQUARE_BRACKET:A}=he(),h=e=>e===a||e===n,R=e=>{!0!==e.isPrefix&&(e.depth=e.isGlobstar?1/0:1)};return se=(_,E)=>{const y=E||{},C=_.length-1,m=!0===y.parts||!0===y.scanToEnd,v=[],S=[],b=[];let x,$,H=_,T=-1,w=0,L=0,O=!1,k=!1,N=!1,I=!1,M=!1,B=!1,j=!1,P=!1,D=!1,G=!1,U=0,K={value:"",depth:0,isGlob:!1};const q=()=>T>=C,F=()=>(x=$,H.charCodeAt(++T));for(;T<C;){let e;if($=F(),$!==n){if(!0===B||$===i){for(U++;!0!==q()&&($=F());)if($!==n)if($!==i){if(!0!==B&&$===s&&($=F())===s){if(O=K.isBrace=!0,N=K.isGlob=!0,G=!0,!0===m)continue;break}if(!0!==B&&$===o){if(O=K.isBrace=!0,N=K.isGlob=!0,G=!0,!0===m)continue;break}if($===d&&(U--,0===U)){B=!1,O=K.isBrace=!0,G=!0;break}}else U++;else j=K.backslashes=!0,F();if(!0===m)continue;break}if($!==a){if(!0!==y.noext&&!0==($===c||$===r||$===t||$===f||$===u)&&H.charCodeAt(T+1)===p){if(N=K.isGlob=!0,I=K.isExtglob=!0,G=!0,$===u&&T===w&&(D=!0),!0===m){for(;!0!==q()&&($=F());)if($!==n){if($===g){N=K.isGlob=!0,G=!0;break}}else j=K.backslashes=!0,$=F();continue}break}if($===t){if(x===t&&(M=K.isGlobstar=!0),N=K.isGlob=!0,G=!0,!0===m)continue;break}if($===f){if(N=K.isGlob=!0,G=!0,!0===m)continue;break}if($===l){for(;!0!==q()&&(e=F());)if(e!==n){if(e===A){k=K.isBracket=!0,N=K.isGlob=!0,G=!0;break}}else j=K.backslashes=!0,F();if(!0===m)continue;break}if(!0===y.nonegate||$!==u||T!==w){if(!0!==y.noparen&&$===p){if(N=K.isGlob=!0,!0===m){for(;!0!==q()&&($=F());)if($!==p){if($===g){G=!0;break}}else j=K.backslashes=!0,$=F();continue}break}if(!0===N){if(G=!0,!0===m)continue;break}}else P=K.negated=!0,w++}else{if(v.push(T),S.push(K),K={value:"",depth:0,isGlob:!1},!0===G)continue;if(x===s&&T===w+1){w+=2;continue}L=T+1}}else j=K.backslashes=!0,$=F(),$===i&&(B=!0)}!0===y.noext&&(I=!1,N=!1);let Q=H,W="",X="";w>0&&(W=H.slice(0,w),H=H.slice(w),L-=w),Q&&!0===N&&L>0?(Q=H.slice(0,L),X=H.slice(L)):!0===N?(Q="",X=H):Q=H,Q&&""!==Q&&"/"!==Q&&Q!==H&&h(Q.charCodeAt(Q.length-1))&&(Q=Q.slice(0,-1)),!0===y.unescape&&(X&&(X=e.removeBackslashes(X)),Q&&!0===j&&(Q=e.removeBackslashes(Q)));const Z={prefix:W,input:_,start:w,base:Q,glob:X,isBrace:O,isBracket:k,isGlob:N,isExtglob:I,isGlobstar:M,negated:P,negatedExtglob:D};if(!0===y.tokens&&(Z.maxDepth=0,h($)||S.push(K),Z.tokens=S),!0===y.parts||!0===y.tokens){let e;for(let t=0;t<v.length;t++){const r=e?e+1:w,n=v[t],o=_.slice(r,n);y.tokens&&(0===t&&0!==w?(S[t].isPrefix=!0,S[t].value=W):S[t].value=o,R(S[t]),Z.maxDepth+=S[t].depth),0===t&&""===o||b.push(o),e=n}if(e&&e+1<_.length){const t=_.slice(e+1);b.push(t),y.tokens&&(S[S.length-1].value=t,R(S[S.length-1]),Z.maxDepth+=S[S.length-1].depth)}Z.slashes=v,Z.parts=b}return Z}}(),r=function(){if(ie)return ae;ie=1;const e=he(),t=Re(),{MAX_LENGTH:r,POSIX_REGEX_SOURCE:n,REGEX_NON_SPECIAL_CHARS:o,REGEX_SPECIAL_CHARS_BACKREF:s,REPLACEMENTS:u}=e,a=(e,r)=>{if("function"==typeof r.expandRange)return r.expandRange(...e,r);e.sort();const n=`[${e.join("-")}]`;try{new RegExp(n)}catch(r){return e.map((e=>t.escapeRegex(e))).join("..")}return n},i=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,p=(l,c)=>{if("string"!=typeof l)throw new TypeError("Expected a string");l=u[l]||l;const f={...c},d="number"==typeof f.maxLength?Math.min(r,f.maxLength):r;let g=l.length;if(g>d)throw new SyntaxError(`Input length: ${g}, exceeds maximum allowed length: ${d}`);const A={type:"bos",value:"",output:f.prepend||""},h=[A],R=f.capture?"":"?:",_=t.isWindows(c),E=e.globChars(_),y=e.extglobChars(E),{DOT_LITERAL:C,PLUS_LITERAL:m,SLASH_LITERAL:v,ONE_CHAR:S,DOTS_SLASH:b,NO_DOT:x,NO_DOT_SLASH:$,NO_DOTS_SLASH:H,QMARK:T,QMARK_NO_DOT:w,STAR:L,START_ANCHOR:O}=E,k=e=>`(${R}(?:(?!${O}${e.dot?b:C}).)*?)`,N=f.dot?"":x,I=f.dot?T:w;let M=!0===f.bash?k(f):L;f.capture&&(M=`(${M})`),"boolean"==typeof f.noext&&(f.noextglob=f.noext);const B={input:l,index:-1,start:0,dot:!0===f.dot,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:h};l=t.removePrefix(l,B),g=l.length;const j=[],P=[],D=[];let G,U=A;const K=()=>B.index===g-1,q=B.peek=(e=1)=>l[B.index+e],F=B.advance=()=>l[++B.index]||"",Q=()=>l.slice(B.index+1),W=(e="",t=0)=>{B.consumed+=e,B.index+=t},X=e=>{B.output+=null!=e.output?e.output:e.value,W(e.value)},Z=()=>{let e=1;for(;"!"===q()&&("("!==q(2)||"?"===q(3));)F(),B.start++,e++;return e%2!=0&&(B.negated=!0,B.start++,!0)},Y=e=>{B[e]++,D.push(e)},V=e=>{B[e]--,D.pop()},z=e=>{if("globstar"===U.type){const t=B.braces>0&&("comma"===e.type||"brace"===e.type),r=!0===e.extglob||j.length&&("pipe"===e.type||"paren"===e.type);"slash"===e.type||"paren"===e.type||t||r||(B.output=B.output.slice(0,-U.output.length),U.type="star",U.value="*",U.output=M,B.output+=U.output)}if(j.length&&"paren"!==e.type&&(j[j.length-1].inner+=e.value),(e.value||e.output)&&X(e),U&&"text"===U.type&&"text"===e.type)return U.value+=e.value,void(U.output=(U.output||"")+e.value);e.prev=U,h.push(e),U=e},J=(e,t)=>{const r={...y[t],conditions:1,inner:""};r.prev=U,r.parens=B.parens,r.output=B.output;const n=(f.capture?"(":"")+r.open;Y("parens"),z({type:e,value:t,output:B.output?"":S}),z({type:"paren",extglob:!0,value:F(),output:n}),j.push(r)},ee=e=>{let t,r=e.close+(f.capture?")":"");if("negate"===e.type){let n=M;if(e.inner&&e.inner.length>1&&e.inner.includes("/")&&(n=k(f)),(n!==M||K()||/^\)+$/.test(Q()))&&(r=e.close=`)$))${n}`),e.inner.includes("*")&&(t=Q())&&/^\.[^\\/.]+$/.test(t)){const o=p(t,{...c,fastpaths:!1}).output;r=e.close=`)${o})${n})`}"bos"===e.prev.type&&(B.negatedExtglob=!0)}z({type:"paren",extglob:!0,value:G,output:r}),V("parens")};if(!1!==f.fastpaths&&!/(^[*!]|[/()[\]{}"])/.test(l)){let e=!1,r=l.replace(s,((t,r,n,o,s,u)=>"\\"===o?(e=!0,t):"?"===o?r?r+o+(s?T.repeat(s.length):""):0===u?I+(s?T.repeat(s.length):""):T.repeat(n.length):"."===o?C.repeat(n.length):"*"===o?r?r+o+(s?M:""):M:r?t:`\\${t}`));return!0===e&&(r=!0===f.unescape?r.replace(/\\/g,""):r.replace(/\\+/g,(e=>e.length%2==0?"\\\\":e?"\\":""))),r===l&&!0===f.contains?(B.output=l,B):(B.output=t.wrapOutput(r,B,c),B)}for(;!K();){if(G=F(),"\0"===G)continue;if("\\"===G){const e=q();if("/"===e&&!0!==f.bash)continue;if("."===e||";"===e)continue;if(!e){G+="\\",z({type:"text",value:G});continue}const t=/^\\+/.exec(Q());let r=0;if(t&&t[0].length>2&&(r=t[0].length,B.index+=r,r%2!=0&&(G+="\\")),!0===f.unescape?G=F():G+=F(),0===B.brackets){z({type:"text",value:G});continue}}if(B.brackets>0&&("]"!==G||"["===U.value||"[^"===U.value)){if(!1!==f.posix&&":"===G){const e=U.value.slice(1);if(e.includes("[")&&(U.posix=!0,e.includes(":"))){const e=U.value.lastIndexOf("["),t=U.value.slice(0,e),r=U.value.slice(e+2),o=n[r];if(o){U.value=t+o,B.backtrack=!0,F(),A.output||1!==h.indexOf(U)||(A.output=S);continue}}}("["===G&&":"!==q()||"-"===G&&"]"===q())&&(G=`\\${G}`),"]"!==G||"["!==U.value&&"[^"!==U.value||(G=`\\${G}`),!0===f.posix&&"!"===G&&"["===U.value&&(G="^"),U.value+=G,X({value:G});continue}if(1===B.quotes&&'"'!==G){G=t.escapeRegex(G),U.value+=G,X({value:G});continue}if('"'===G){B.quotes=1===B.quotes?0:1,!0===f.keepQuotes&&z({type:"text",value:G});continue}if("("===G){Y("parens"),z({type:"paren",value:G});continue}if(")"===G){if(0===B.parens&&!0===f.strictBrackets)throw new SyntaxError(i("opening","("));const e=j[j.length-1];if(e&&B.parens===e.parens+1){ee(j.pop());continue}z({type:"paren",value:G,output:B.parens?")":"\\)"}),V("parens");continue}if("["===G){if(!0!==f.nobracket&&Q().includes("]"))Y("brackets");else{if(!0!==f.nobracket&&!0===f.strictBrackets)throw new SyntaxError(i("closing","]"));G=`\\${G}`}z({type:"bracket",value:G});continue}if("]"===G){if(!0===f.nobracket||U&&"bracket"===U.type&&1===U.value.length){z({type:"text",value:G,output:`\\${G}`});continue}if(0===B.brackets){if(!0===f.strictBrackets)throw new SyntaxError(i("opening","["));z({type:"text",value:G,output:`\\${G}`});continue}V("brackets");const e=U.value.slice(1);if(!0===U.posix||"^"!==e[0]||e.includes("/")||(G=`/${G}`),U.value+=G,X({value:G}),!1===f.literalBrackets||t.hasRegexChars(e))continue;const r=t.escapeRegex(U.value);if(B.output=B.output.slice(0,-U.value.length),!0===f.literalBrackets){B.output+=r,U.value=r;continue}U.value=`(${R}${r}|${U.value})`,B.output+=U.value;continue}if("{"===G&&!0!==f.nobrace){Y("braces");const e={type:"brace",value:G,output:"(",outputIndex:B.output.length,tokensIndex:B.tokens.length};P.push(e),z(e);continue}if("}"===G){const e=P[P.length-1];if(!0===f.nobrace||!e){z({type:"text",value:G,output:G});continue}let t=")";if(!0===e.dots){const e=h.slice(),r=[];for(let t=e.length-1;t>=0&&(h.pop(),"brace"!==e[t].type);t--)"dots"!==e[t].type&&r.unshift(e[t].value);t=a(r,f),B.backtrack=!0}if(!0!==e.comma&&!0!==e.dots){const r=B.output.slice(0,e.outputIndex),n=B.tokens.slice(e.tokensIndex);e.value=e.output="\\{",G=t="\\}",B.output=r;for(const e of n)B.output+=e.output||e.value}z({type:"brace",value:G,output:t}),V("braces"),P.pop();continue}if("|"===G){j.length>0&&j[j.length-1].conditions++,z({type:"text",value:G});continue}if(","===G){let e=G;const t=P[P.length-1];t&&"braces"===D[D.length-1]&&(t.comma=!0,e="|"),z({type:"comma",value:G,output:e});continue}if("/"===G){if("dot"===U.type&&B.index===B.start+1){B.start=B.index+1,B.consumed="",B.output="",h.pop(),U=A;continue}z({type:"slash",value:G,output:v});continue}if("."===G){if(B.braces>0&&"dot"===U.type){"."===U.value&&(U.output=C);const e=P[P.length-1];U.type="dots",U.output+=G,U.value+=G,e.dots=!0;continue}if(B.braces+B.parens===0&&"bos"!==U.type&&"slash"!==U.type){z({type:"text",value:G,output:C});continue}z({type:"dot",value:G,output:C});continue}if("?"===G){if((!U||"("!==U.value)&&!0!==f.noextglob&&"("===q()&&"?"!==q(2)){J("qmark",G);continue}if(U&&"paren"===U.type){const e=q();let r=G;if("<"===e&&!t.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");("("===U.value&&!/[!=<:]/.test(e)||"<"===e&&!/<([!=]|\w+>)/.test(Q()))&&(r=`\\${G}`),z({type:"text",value:G,output:r});continue}if(!0!==f.dot&&("slash"===U.type||"bos"===U.type)){z({type:"qmark",value:G,output:w});continue}z({type:"qmark",value:G,output:T});continue}if("!"===G){if(!0!==f.noextglob&&"("===q()&&("?"!==q(2)||!/[!=<:]/.test(q(3)))){J("negate",G);continue}if(!0!==f.nonegate&&0===B.index){Z();continue}}if("+"===G){if(!0!==f.noextglob&&"("===q()&&"?"!==q(2)){J("plus",G);continue}if(U&&"("===U.value||!1===f.regex){z({type:"plus",value:G,output:m});continue}if(U&&("bracket"===U.type||"paren"===U.type||"brace"===U.type)||B.parens>0){z({type:"plus",value:G});continue}z({type:"plus",value:m});continue}if("@"===G){if(!0!==f.noextglob&&"("===q()&&"?"!==q(2)){z({type:"at",extglob:!0,value:G,output:""});continue}z({type:"text",value:G});continue}if("*"!==G){"$"!==G&&"^"!==G||(G=`\\${G}`);const e=o.exec(Q());e&&(G+=e[0],B.index+=e[0].length),z({type:"text",value:G});continue}if(U&&("globstar"===U.type||!0===U.star)){U.type="star",U.star=!0,U.value+=G,U.output=M,B.backtrack=!0,B.globstar=!0,W(G);continue}let e=Q();if(!0!==f.noextglob&&/^\([^?]/.test(e)){J("star",G);continue}if("star"===U.type){if(!0===f.noglobstar){W(G);continue}const t=U.prev,r=t.prev,n="slash"===t.type||"bos"===t.type,o=r&&("star"===r.type||"globstar"===r.type);if(!0===f.bash&&(!n||e[0]&&"/"!==e[0])){z({type:"star",value:G,output:""});continue}const s=B.braces>0&&("comma"===t.type||"brace"===t.type),u=j.length&&("pipe"===t.type||"paren"===t.type);if(!n&&"paren"!==t.type&&!s&&!u){z({type:"star",value:G,output:""});continue}for(;"/**"===e.slice(0,3);){const t=l[B.index+4];if(t&&"/"!==t)break;e=e.slice(3),W("/**",3)}if("bos"===t.type&&K()){U.type="globstar",U.value+=G,U.output=k(f),B.output=U.output,B.globstar=!0,W(G);continue}if("slash"===t.type&&"bos"!==t.prev.type&&!o&&K()){B.output=B.output.slice(0,-(t.output+U.output).length),t.output=`(?:${t.output}`,U.type="globstar",U.output=k(f)+(f.strictSlashes?")":"|$)"),U.value+=G,B.globstar=!0,B.output+=t.output+U.output,W(G);continue}if("slash"===t.type&&"bos"!==t.prev.type&&"/"===e[0]){const r=void 0!==e[1]?"|$":"";B.output=B.output.slice(0,-(t.output+U.output).length),t.output=`(?:${t.output}`,U.type="globstar",U.output=`${k(f)}${v}|${v}${r})`,U.value+=G,B.output+=t.output+U.output,B.globstar=!0,W(G+F()),z({type:"slash",value:"/",output:""});continue}if("bos"===t.type&&"/"===e[0]){U.type="globstar",U.value+=G,U.output=`(?:^|${v}|${k(f)}${v})`,B.output=U.output,B.globstar=!0,W(G+F()),z({type:"slash",value:"/",output:""});continue}B.output=B.output.slice(0,-U.output.length),U.type="globstar",U.output=k(f),U.value+=G,B.output+=U.output,B.globstar=!0,W(G);continue}const r={type:"star",value:G,output:M};!0!==f.bash?!U||"bracket"!==U.type&&"paren"!==U.type||!0!==f.regex?(B.index!==B.start&&"slash"!==U.type&&"dot"!==U.type||("dot"===U.type?(B.output+=$,U.output+=$):!0===f.dot?(B.output+=H,U.output+=H):(B.output+=N,U.output+=N),"*"!==q()&&(B.output+=S,U.output+=S)),z(r)):(r.output=G,z(r)):(r.output=".*?","bos"!==U.type&&"slash"!==U.type||(r.output=N+r.output),z(r))}for(;B.brackets>0;){if(!0===f.strictBrackets)throw new SyntaxError(i("closing","]"));B.output=t.escapeLast(B.output,"["),V("brackets")}for(;B.parens>0;){if(!0===f.strictBrackets)throw new SyntaxError(i("closing",")"));B.output=t.escapeLast(B.output,"("),V("parens")}for(;B.braces>0;){if(!0===f.strictBrackets)throw new SyntaxError(i("closing","}"));B.output=t.escapeLast(B.output,"{"),V("braces")}if(!0===f.strictSlashes||"star"!==U.type&&"bracket"!==U.type||z({type:"maybe_slash",value:"",output:`${v}?`}),!0===B.backtrack){B.output="";for(const e of B.tokens)B.output+=null!=e.output?e.output:e.value,e.suffix&&(B.output+=e.suffix)}return B};return p.fastpaths=(n,o)=>{const s={...o},a="number"==typeof s.maxLength?Math.min(r,s.maxLength):r,i=n.length;if(i>a)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${a}`);n=u[n]||n;const p=t.isWindows(o),{DOT_LITERAL:l,SLASH_LITERAL:c,ONE_CHAR:f,DOTS_SLASH:d,NO_DOT:g,NO_DOTS:A,NO_DOTS_SLASH:h,STAR:R,START_ANCHOR:_}=e.globChars(p),E=s.dot?A:g,y=s.dot?h:g,C=s.capture?"":"?:";let m=!0===s.bash?".*?":R;s.capture&&(m=`(${m})`);const v=e=>!0===e.noglobstar?m:`(${C}(?:(?!${_}${e.dot?d:l}).)*?)`,S=e=>{switch(e){case"*":return`${E}${f}${m}`;case".*":return`${l}${f}${m}`;case"*.*":return`${E}${m}${l}${f}${m}`;case"*/*":return`${E}${m}${c}${f}${y}${m}`;case"**":return E+v(s);case"**/*":return`(?:${E}${v(s)}${c})?${y}${f}${m}`;case"**/*.*":return`(?:${E}${v(s)}${c})?${y}${m}${l}${f}${m}`;case"**/.*":return`(?:${E}${v(s)}${c})?${l}${f}${m}`;default:{const t=/^(.*?)\.(\w+)$/.exec(e);if(!t)return;const r=S(t[1]);if(!r)return;return r+l+t[2]}}},b=t.removePrefix(n,{negated:!1,prefix:""});let x=S(b);return x&&!0!==s.strictSlashes&&(x+=`${c}?`),x},ae=p}(),n=Re(),o=he(),s=(e,t,r=!1)=>{if(Array.isArray(e)){const n=e.map((e=>s(e,t,r))),o=e=>{for(const t of n){const r=t(e);if(r)return r}return!1};return o}const o=(u=e)&&"object"==typeof u&&!Array.isArray(u)&&e.tokens&&e.input;var u;if(""===e||"string"!=typeof e&&!o)throw new TypeError("Expected pattern to be a non-empty string");const a=t||{},i=n.isWindows(t),p=o?s.compileRe(e,t):s.makeRe(e,t,!1,!0),l=p.state;delete p.state;let c=()=>!1;if(a.ignore){const e={...t,ignore:null,onMatch:null,onResult:null};c=s(a.ignore,e,r)}const f=(r,n=!1)=>{const{isMatch:o,match:u,output:f}=s.test(r,p,t,{glob:e,posix:i}),d={glob:e,state:l,regex:p,posix:i,input:r,output:f,match:u,isMatch:o};return"function"==typeof a.onResult&&a.onResult(d),!1===o?(d.isMatch=!1,!!n&&d):c(r)?("function"==typeof a.onIgnore&&a.onIgnore(d),d.isMatch=!1,!!n&&d):("function"==typeof a.onMatch&&a.onMatch(d),!n||d)};return r&&(f.state=l),f};return s.test=(e,t,r,{glob:o,posix:u}={})=>{if("string"!=typeof e)throw new TypeError("Expected input to be a string");if(""===e)return{isMatch:!1,output:""};const a=r||{},i=a.format||(u?n.toPosixSlashes:null);let p=e===o,l=p&&i?i(e):e;return!1===p&&(l=i?i(e):e,p=l===o),!1!==p&&!0!==a.capture||(p=!0===a.matchBase||!0===a.basename?s.matchBase(e,t,r,u):t.exec(l)),{isMatch:Boolean(p),match:p,output:l}},s.matchBase=(t,r,o,u=n.isWindows(o))=>(r instanceof RegExp?r:s.makeRe(r,o)).test(e.basename(t)),s.isMatch=(e,t,r)=>s(t,r)(e),s.parse=(e,t)=>Array.isArray(e)?e.map((e=>s.parse(e,t))):r(e,{...t,fastpaths:!1}),s.scan=(e,r)=>t(e,r),s.compileRe=(e,t,r=!1,n=!1)=>{if(!0===r)return e.output;const o=t||{},u=o.contains?"":"^",a=o.contains?"":"$";let i=`${u}(?:${e.output})${a}`;e&&!0===e.negated&&(i=`^(?!${i}).*$`);const p=s.toRegex(i,t);return!0===n&&(p.state=e),p},s.makeRe=(e,t={},n=!1,o=!1)=>{if(!e||"string"!=typeof e)throw new TypeError("Expected a non-empty string");let u={negated:!1,fastpaths:!0};return!1===t.fastpaths||"."!==e[0]&&"*"!==e[0]||(u.output=r.fastpaths(e,t)),u.output||(u=r(e,t)),s.compileRe(u,t,n,o)},s.toRegex=(e,t)=>{try{const r=t||{};return new RegExp(e,r.flags||(r.nocase?"i":""))}catch(e){if(t&&!0===t.debug)throw e;return/$^/}},s.constants=o,pe=s}function Ee(){return fe?ce:(fe=1,ce=_e())}var ye=function(){if(ge)return de;ge=1;const e=q.default,t=te(),r=Ee(),n=Re(),o=e=>""===e||"./"===e,s=(e,t,n)=>{t=[].concat(t),e=[].concat(e);let o=new Set,s=new Set,u=new Set,a=0,i=e=>{u.add(e.output),n&&n.onResult&&n.onResult(e)};for(let u=0;u<t.length;u++){let p=r(String(t[u]),{...n,onResult:i},!0),l=p.state.negated||p.state.negatedExtglob;l&&a++;for(let t of e){let e=p(t,!0);(l?!e.isMatch:e.isMatch)&&(l?o.add(e.output):(o.delete(e.output),s.add(e.output)))}}let p=(a===t.length?[...u]:[...s]).filter((e=>!o.has(e)));if(n&&0===p.length){if(!0===n.failglob)throw new Error(`No matches found for "${t.join(", ")}"`);if(!0===n.nonull||!0===n.nullglob)return n.unescape?t.map((e=>e.replace(/\\/g,""))):t}return p};return s.match=s,s.matcher=(e,t)=>r(e,t),s.any=s.isMatch=(e,t,n)=>r(t,n)(e),s.not=(e,t,r={})=>{t=[].concat(t).map(String);let n=new Set,o=[],u=new Set(s(e,t,{...r,onResult:e=>{r.onResult&&r.onResult(e),o.push(e.output)}}));for(let e of o)u.has(e)||n.add(e);return[...n]},s.contains=(t,r,n)=>{if("string"!=typeof t)throw new TypeError(`Expected a string: "${e.inspect(t)}"`);if(Array.isArray(r))return r.some((e=>s.contains(t,e,n)));if("string"==typeof r){if(o(t)||o(r))return!1;if(t.includes(r)||t.startsWith("./")&&t.slice(2).includes(r))return!0}return s.isMatch(t,r,{...n,contains:!0})},s.matchKeys=(e,t,r)=>{if(!n.isObject(e))throw new TypeError("Expected the first argument to be an object");let o=s(Object.keys(e),t,r),u={};for(let t of o)u[t]=e[t];return u},s.some=(e,t,n)=>{let o=[].concat(e);for(let e of[].concat(t)){let t=r(String(e),n);if(o.some((e=>t(e))))return!0}return!1},s.every=(e,t,n)=>{let o=[].concat(e);for(let e of[].concat(t)){let t=r(String(e),n);if(!o.every((e=>t(e))))return!1}return!0},s.all=(t,n,o)=>{if("string"!=typeof t)throw new TypeError(`Expected a string: "${e.inspect(t)}"`);return[].concat(n).every((e=>r(e,o)(t)))},s.capture=(e,t,o)=>{let s=n.isWindows(o),u=r.makeRe(String(e),{...o,capture:!0}).exec(s?n.toPosixSlashes(t):t);if(u)return u.slice(1).map((e=>void 0===e?"":e))},s.makeRe=(...e)=>r.makeRe(...e),s.scan=(...e)=>r.scan(...e),s.parse=(e,n)=>{let o=[];for(let s of[].concat(e||[]))for(let e of t(String(s),n))o.push(r.parse(e,n));return o},s.braces=(e,r)=>{if("string"!=typeof e)throw new TypeError("Expected a string");return r&&!0===r.nobrace||!/\{.*\}/.test(e)?[e]:t(e,r)},s.braceExpand=(e,t)=>{if("string"!=typeof e)throw new TypeError("Expected a string");return s.braces(e,{...t,expand:!0})},de=s}();const Ce=(e,t)=>new Set([...e].filter((e=>t.has(e))));let me;function ve(){if(me)return me;const e=A.program.getOptionValue("root");return me=e?D.default.isAbsolute(e)?e:D.default.resolve(process.cwd(),e):void 0,me}let Se,be="";try{R.createRequire("undefined"==typeof document?require("url").pathToFileURL(__filename).href:_&&_.src||new URL("index.min.cjs",document.baseURI).href).resolve("@pnpm/filter-workspace-packages"),be="pnpm"}catch{}""!==be&&A.program.option("-f, --filter <filter>","filter packages");let xe=!1;const $e=R.createRequire("undefined"==typeof document?require("url").pathToFileURL(__filename).href:_&&_.src||new URL("index.min.cjs",document.baseURI).href);function He(e){try{return $e.resolve(e),!0}catch(e){return!1}}let Te;const we=[process.env.JIEK_TS_REGISTER,"esbuild-register","@swc-node/register","ts-node/register"].filter(Boolean);for(const e of we)if(He(e)){Te=e;break}let Le="jiek.config";var Oe=(e={})=>{const{onEvent:t}=e;return{name:"progress",buildStart:()=>t?.("start","Start building..."),buildEnd:()=>t?.("end","Build completed!"),resolveId:{order:"post",handler:e=>t?.("resolve",`Resolving ${e}...`)},load:{order:"post",handler:e=>t?.("load",`Loading ${e}...`)},transform:{order:"post",handler:(e,r)=>t?.("transform",`Transforming ${r}...`)}}},ke=(e={})=>({name:"skip",load(t){if(e.patterns?.some((e=>"string"==typeof e?t.includes(e):e.test(t))))return""}});const{JIEK_ROOT:Ne,JIEK_ENTRIES:Ie}=process.env,Me=Ne??o.getWorkspaceDir(),Be={},je=[U.default()],Pe=function(e){const{wd:t}=function(){if(Se)return{wd:Se,notWorkspace:xe};const e=ve();if(void 0!==e){const t=o.isWorkspaceDir(e,be);return xe=!t,Se=e,{wd:Se,notWorkspace:xe}}try{Se=o.getWorkspaceDir(be)}catch(t){if(!("message"in t)||"workspace root not found"!==t.message)throw t;Se=e,xe=!0}return{wd:Se,notWorkspace:xe}}();let r=A.program.getOptionValue("configPath");if(r){if(!P.default.existsSync(r))throw new Error(`config file not found: ${r}`);D.default.isAbsolute(r)||(r=D.default.resolve(t,r))}else r=function(e,t){const r=!!Te;function n(r){const n=[D.default.resolve(process.cwd(),`${Le}.${r}`),D.default.resolve(process.cwd(),`.${Le}.${r}`),D.default.resolve(e,`${Le}.${r}`),D.default.resolve(e,`.${Le}.${r}`)];t&&n.unshift(D.default.resolve(t,`${Le}.${r}`),D.default.resolve(t,`.${Le}.${r}`));for(const e of n)if(P.default.existsSync(e)&&P.default.lstatSync(e).isFile())return e}return Le=n("js")??Le,Le=n("json")??Le,Le=n("yaml")??Le,r&&(Le=n("ts")??Le),D.default.resolve(e,Le)}(t,e);const n=D.default.extname(r);let s;switch(n){case".js":s=require(r);break;case".json":return require(r);case".yaml":return h.load(P.default.readFileSync(r,"utf-8"));case".ts":if(Te){require(Te),s=require(r);break}throw new Error("ts config file is not supported without ts register, please install esbuild-register or set JIEK_TS_REGISTER env for custom ts register");case".config":s={};break;default:throw new Error(`unsupported config file type: ${n}`)}if(!s)throw new Error("config file is empty");return s.default??s}()??{},{build:De={}}=Pe,Ge=`./${t.relative(process.cwd(),t.resolve(("object"==typeof De?.output?.dir?De.output.dir.js:De?.output?.dir)??"dist"))}`,Ue=/\.(css|s[ac]ss|less|styl)$/,Ke=e=>t.resolve(Me,e),qe=e=>e.replace(/[@|/-](\w)/g,((e,t)=>t.toUpperCase())).replace(/(?:^|-)(\w)/g,((e,t)=>t.toUpperCase())),Fe=(e,t=De?.output?.minify)=>!1===t?[e]:"only-minify"===t?[{...e,file:e.file?.replace(/(\.[cm]?js)$/,".min$1"),plugins:[...e.plugins??[],K.default()]}]:[e,{...e,file:e.file?.replace(/(\.[cm]?js)$/,".min$1"),plugins:[...e.plugins??[],K.default()]}],Qe=e=>{e=t.resolve(e);const r=t.dirname(e),{extends:n,...o}=(s=e,P.default.existsSync(s)&&P.default.statSync(s).isFile()?l.parse(P.default.readFileSync(s,"utf-8"),[],{allowTrailingComma:!0,allowEmptyContent:!0}):{});var s;const u=(a=n?Array.isArray(n)?n:[n]:[],a?.map((e=>t.resolve(r,e)))??[]);var a;return 0===u.length?o:u.map(Qe).concat(o).reduce(((e,{compilerOptions:t={},references:r,...n})=>({...e,...n,compilerOptions:{...e.compilerOptions,...t}})),{})},We=(e,r)=>{e=t.resolve(e),r=t.resolve(r);const n=t.dirname(e),o=Qe(e),[s,u,a,i]=[o.references?.map((({path:e})=>e)),o.files,o.include,o.exclude].map((e=>e?.map((e=>t.resolve(n,e)))??[]));if(i.length>0&&i.some((e=>ye.isMatch(r,e))))return;if(0===o.files?.length&&0===o.include?.length)return;let p=!1;if(p||(p=u.length>0&&u.includes(r)),p||(p=a.length>0&&a.some((e=>ye.isMatch(r,e)))),p)return o.compilerOptions??{};if(!(o.files&&o.files.length>0||o.include&&o.include.length>0)){s.reverse();for(const e of s){const t=We(e,r);if(t)return t}return o.compilerOptions}},Xe=({path:e,name:r,input:o,output:s,external:u,pkgIsModule:i,conditionals:l},c={})=>{const f=l.includes("import"),d=l.includes("require"),g=l.includes("browser");let A;[Ke("tsconfig.json"),Ke("tsconfig.dts.json")].forEach((e=>{P.default.existsSync(e)&&P.default.statSync(e).isFile()&&(A=e)}));let h={};if(A){const e=We(A,t.resolve(o)),{options:r,errors:n}=W.default.convertCompilerOptionsFromJson(e,t.dirname(A));if(n.length>0)throw new Error(n.map((e=>e.messageText)).join("\n"));h=r}const R=[...l,...h.customConditions??[]],_={type:"progress",data:{name:r,path:e,exportConditions:R,input:o}},E=c?.output?.dir;return[{input:o,external:u,output:[...Fe({file:s,name:r,interop:"auto",sourcemap:"object"==typeof c?.output?.sourcemap?c.output.sourcemap.js:c?.output?.sourcemap,format:f?"esm":d?"cjs":g?"umd":i?"esm":"cjs",strict:"object"==typeof c?.output?.strict?c.output.strict.js:c?.output?.strict})],plugins:[a.nodeResolve({exportConditions:R}),import("rollup-plugin-postcss").then((({default:e})=>e({extract:t.resolve(s.replace(/\.[cm]?js$/,".css")),minimize:!0}))).catch((()=>{})),Q.default(),G.default(),Oe({onEvent:(e,t)=>p.sendMessage({..._,data:{..._.data,event:e,message:t,tags:["js"]}})})]},{input:o,external:u,output:[{dir:t.resolve(("object"==typeof E?E.dts:E)??"dist"),sourcemap:"object"==typeof c?.output?.sourcemap?c.output.sourcemap.dts:c?.output?.sourcemap,entryFileNames:()=>s.replace(`${Ge}/`,"").replace(/(\.[cm]?)js$/,".d$1ts"),strict:"object"==typeof c?.output?.strict?c.output.strict.dts:c?.output?.strict}],plugins:[a.nodeResolve({exportConditions:R}),ke({patterns:[Ue]}),n.dts({respectExternal:!0,compilerOptions:h}),Oe({onEvent:(e,t)=>p.sendMessage({..._,data:{..._.data,event:e,message:t,tags:["dts"]}})})]}]};exports.template=function(e){const{name:n,type:o,exports:s}=e,u="module"===o;if(!n)throw new Error("package.json name is required");if(!s)throw new Error("package.json exports is required");const a=Ie?.split(",").map((e=>e.trim())).map((e=>({index:"."}[e]??e))),i=qe(n),l=function(e=process.cwd()){const t="string"==typeof e?P.default.existsSync(`${e}/package.json`)?JSON.parse(P.default.readFileSync(`${e}/package.json`,"utf-8")):{}:e,{dependencies:r={},peerDependencies:n={},optionalDependencies:o={}}=t;return Object.keys(r).concat(Object.keys(n)).concat(Object.keys(o)).map((e=>new RegExp(`^${e}(/.*)?$`))).concat([/^node:/])}(e),[c,f]=function({entrypoints:e,pkgIsModule:n,entries:o,config:s,dir:u,noFilter:a,isPublish:i}){const{build:p={},publish:{withSuffix:l=!1,withSource:c=!0}={}}=s??{},{crossModuleConvertor:f=!0}=p,d=`./${g=((...e)=>t.resolve(u??process.cwd(),...e))(("object"==typeof p?.output?.dir?p.output.dir.js:p?.output?.dir)??"dist"),t.relative(u??process.cwd(),g)}`;var g;const[,A]=r.resolveEntrypoints(e);o&&Object.entries(A).forEach((([e])=>{o.some((t=>ye.isMatch(e,t,{matchBase:!0})))||delete A[e]}));const h=a?A:r.filterLeafs(A,{skipValue:[/(^|\/)\.jk-noentry/,...r.DEFAULT_SKIP_VALUES]}),R=f?{import:e=>!n&&0===Ce(new Set(e.conditionals),new Set(["import","module"])).size&&e.dist.replace(/\.js$/,".mjs"),require:e=>!(!n||0!==Ce(new Set(e.conditionals),new Set(["require","node"])).size)&&e.dist.replace(/\.js$/,".cjs")}:{};return[h,r.entrypoints2Exports(h,{outdir:d,withSuffix:i?l:void 0,withSource:i?c:void 0,withConditional:{...R}})]}({entrypoints:s,pkgIsModule:u,entries:a,config:Pe}),d=new Map;r.getAllLeafs(c,(({keys:e,value:t})=>{if("string"==typeof t){const r=d.get(t)??[];d.set(t,r),r.push(e)}return!1}));const g=[];return d.forEach(((e,t)=>e.forEach((e=>{const[n,...o]=e,s=i+("."===n?"":qe(n)),a=((e,t)=>t.reduce(((e,t)=>{if("string"==typeof e)throw new Error("key not found in exports");if(!(t in e))throw new Error(`key ${t} not found in exports`);return e[t]}),e))(f,e),p={path:n,name:s,input:t,external:l,pkgIsModule:u};switch(typeof a){case"string":g.push(...Xe({...p,output:a,conditionals:o},De));break;case"object":r.getAllLeafs(a,(({keys:e,value:t})=>{const r=[...new Set([...o,...e])];return"string"==typeof t&&g.push(...Xe({...p,output:t,conditionals:r},De)),!1}))}})))),p.sendMessage({type:"init",data:{leafMap:d,targetsLength:g.length}}),g.map((e=>({...Be,...e,plugins:[...je,e.plugins]})))};
File without changes