@likec4/mcp 1.49.0 → 1.50.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.
@@ -1 +1 @@
1
- import{s as e,t}from"../rolldown-runtime.mjs";import{a as n,i as r,o as i,r as a}from"./graphology-dag.mjs";var o=t(((e,t)=>{function n(e){if(typeof e!=`function`)throw Error(`mnemonist/DefaultMap.constructor: expecting a function.`);this.items=new Map,this.factory=e,this.size=0}n.prototype.clear=function(){this.items.clear(),this.size=0},n.prototype.get=function(e){var t=this.items.get(e);return t===void 0&&(t=this.factory(e,this.size),this.items.set(e,t),this.size++),t},n.prototype.peek=function(e){return this.items.get(e)},n.prototype.set=function(e,t){return this.items.set(e,t),this.size=this.items.size,this},n.prototype.has=function(e){return this.items.has(e)},n.prototype.delete=function(e){var t=this.items.delete(e);return this.size=this.items.size,t},n.prototype.forEach=function(e,t){t=arguments.length>1?t:this,this.items.forEach(e,t)},n.prototype.entries=function(){return this.items.entries()},n.prototype.keys=function(){return this.items.keys()},n.prototype.values=function(){return this.items.values()},typeof Symbol<`u`&&(n.prototype[Symbol.iterator]=n.prototype.entries),n.prototype.inspect=function(){return this.items},typeof Symbol<`u`&&(n.prototype[Symbol.for(`nodejs.util.inspect.custom`)]=n.prototype.inspect),n.autoIncrement=function(){var e=0;return function(){return e++}},t.exports=n})),s=t(((e,t)=>{function n(e){if(typeof e!=`function`)throw Error(`mnemonist/DefaultWeakMap.constructor: expecting a function.`);this.items=new WeakMap,this.factory=e}n.prototype.clear=function(){this.items=new WeakMap},n.prototype.get=function(e){var t=this.items.get(e);return t===void 0&&(t=this.factory(e),this.items.set(e,t)),t},n.prototype.peek=function(e){return this.items.get(e)},n.prototype.set=function(e,t){return this.items.set(e,t),this},n.prototype.has=function(e){return this.items.has(e)},n.prototype.delete=function(e){return this.items.delete(e)},n.prototype.inspect=function(){return this.items},typeof Symbol<`u`&&(n.prototype[Symbol.for(`nodejs.util.inspect.custom`)]=n.prototype.inspect),t.exports=n})),c=t(((e,t)=>{var r=n(),a=i();function o(){this.clear()}o.prototype.clear=function(){this.head=null,this.tail=null,this.size=0},o.prototype.first=function(){return this.head?this.head.item:void 0},o.prototype.peek=o.prototype.first,o.prototype.last=function(){return this.tail?this.tail.item:void 0},o.prototype.push=function(e){var t={item:e,next:null};return this.head?(this.tail.next=t,this.tail=t):(this.head=t,this.tail=t),this.size++,this.size},o.prototype.unshift=function(e){var t={item:e,next:null};return this.head?(this.head.next||(this.tail=this.head),t.next=this.head,this.head=t):(this.head=t,this.tail=t),this.size++,this.size},o.prototype.shift=function(){if(this.size){var e=this.head;return this.head=e.next,this.size--,e.item}},o.prototype.forEach=function(e,t){if(this.size){t=arguments.length>1?t:this;for(var n=this.head,r=0;n;)e.call(t,n.item,r,this),n=n.next,r++}},o.prototype.toArray=function(){if(!this.size)return[];for(var e=Array(this.size),t=0,n=this.size,r=this.head;t<n;t++)e[t]=r.item,r=r.next;return e},o.prototype.values=function(){var e=this.head;return new r(function(){if(!e)return{done:!0};var t=e.item;return e=e.next,{value:t,done:!1}})},o.prototype.entries=function(){var e=this.head,t=0;return new r(function(){if(!e)return{done:!0};var n=e.item;return e=e.next,t++,{value:[t-1,n],done:!1}})},typeof Symbol<`u`&&(o.prototype[Symbol.iterator]=o.prototype.values),o.prototype.toString=function(){return this.toArray().join(`,`)},o.prototype.toJSON=function(){return this.toArray()},o.prototype.inspect=function(){var e=this.toArray();return Object.defineProperty(e,`constructor`,{value:o,enumerable:!1}),e},typeof Symbol<`u`&&(o.prototype[Symbol.for(`nodejs.util.inspect.custom`)]=o.prototype.inspect),o.from=function(e){var t=new o;return a(e,function(e){t.push(e)}),t},t.exports=o})),l=t(((e,t)=>{var r=n(),a=i();function o(e){this.Container=e||Array,this.items=new Map,this.clear(),Object.defineProperty(this.items,`constructor`,{value:o,enumerable:!1})}o.prototype.clear=function(){this.size=0,this.dimension=0,this.items.clear()},o.prototype.set=function(e,t){var n=this.items.get(e),r;return n||(this.dimension++,n=new this.Container,this.items.set(e,n)),this.Container===Set?(r=n.size,n.add(t),r<n.size&&this.size++):(n.push(t),this.size++),this},o.prototype.delete=function(e){var t=this.items.get(e);return t?(this.size-=this.Container===Set?t.size:t.length,this.dimension--,this.items.delete(e),!0):!1},o.prototype.remove=function(e,t){var n=this.items.get(e),r,i;return n?this.Container===Set?(r=n.delete(t),r&&this.size--,n.size===0&&(this.items.delete(e),this.dimension--),r):(i=n.indexOf(t),i===-1?!1:(this.size--,n.length===1?(this.items.delete(e),this.dimension--,!0):(n.splice(i,1),!0))):!1},o.prototype.has=function(e){return this.items.has(e)},o.prototype.get=function(e){return this.items.get(e)},o.prototype.multiplicity=function(e){var t=this.items.get(e);return t===void 0?0:this.Container===Set?t.size:t.length},o.prototype.count=o.prototype.multiplicity,o.prototype.forEach=function(e,t){t=arguments.length>1?t:this;var n;function r(r){e.call(t,r,n)}this.items.forEach(function(e,t){n=t,e.forEach(r)})},o.prototype.forEachAssociation=function(e,t){t=arguments.length>1?t:this,this.items.forEach(e,t)},o.prototype.keys=function(){return this.items.keys()},o.prototype.values=function(){var e=this.items.values(),t=!1,n,i,a,o;return this.Container===Set?new r(function r(){if(!t){if(i=e.next(),i.done)return{done:!0};t=!0,n=i.value.values()}return i=n.next(),i.done?(t=!1,r()):{done:!1,value:i.value}}):new r(function r(){if(!t){if(i=e.next(),i.done)return{done:!0};t=!0,n=i.value,a=0,o=n.length}return a>=o?(t=!1,r()):{done:!1,value:n[a++]}})},o.prototype.entries=function(){var e=this.items.entries(),t=!1,n,i,a,o,s;return this.Container===Set?new r(function r(){if(!t){if(i=e.next(),i.done)return{done:!0};t=!0,a=i.value[0],n=i.value[1].values()}return i=n.next(),i.done?(t=!1,r()):{done:!1,value:[a,i.value]}}):new r(function r(){if(!t){if(i=e.next(),i.done)return{done:!0};t=!0,a=i.value[0],n=i.value[1],o=0,s=n.length}return o>=s?(t=!1,r()):{done:!1,value:[a,n[o++]]}})},o.prototype.containers=function(){return this.items.values()},o.prototype.associations=function(){return this.items.entries()},typeof Symbol<`u`&&(o.prototype[Symbol.iterator]=o.prototype.entries),o.prototype.inspect=function(){return this.items},typeof Symbol<`u`&&(o.prototype[Symbol.for(`nodejs.util.inspect.custom`)]=o.prototype.inspect),o.prototype.toJSON=function(){return this.items},o.from=function(e,t){var n=new o(t);return a(e,function(e,t){n.set(t,e)}),n},t.exports=o})),u=t(((e,t)=>{var o=n(),s=i(),c=r(),l=a();function u(e,t,n){if(arguments.length<2&&(n=e,e=null,t=null),this.capacity=n,typeof this.capacity!=`number`||this.capacity<=0)throw Error(`mnemonist/lru-cache: capacity should be positive number.`);if(!isFinite(this.capacity)||Math.floor(this.capacity)!==this.capacity)throw Error(`mnemonist/lru-cache: capacity should be a finite positive integer.`);var r=c.getPointerArray(n);this.forward=new r(n),this.backward=new r(n),this.K=typeof e==`function`?new e(n):Array(n),this.V=typeof t==`function`?new t(n):Array(n),this.size=0,this.head=0,this.tail=0,this.items={}}u.prototype.clear=function(){this.size=0,this.head=0,this.tail=0,this.items={}},u.prototype.splayOnTop=function(e){var t=this.head;if(this.head===e)return this;var n=this.backward[e],r=this.forward[e];return this.tail===e?this.tail=n:this.backward[r]=n,this.forward[n]=r,this.backward[t]=e,this.head=e,this.forward[e]=t,this},u.prototype.set=function(e,t){var n=this.items[e];if(n!==void 0){this.splayOnTop(n),this.V[n]=t;return}this.size<this.capacity?n=this.size++:(n=this.tail,this.tail=this.backward[n],delete this.items[this.K[n]]),this.items[e]=n,this.K[n]=e,this.V[n]=t,this.forward[n]=this.head,this.backward[this.head]=n,this.head=n},u.prototype.setpop=function(e,t){var n=null,r=null,i=this.items[e];return i===void 0?(this.size<this.capacity?i=this.size++:(i=this.tail,this.tail=this.backward[i],n=this.V[i],r=this.K[i],delete this.items[r]),this.items[e]=i,this.K[i]=e,this.V[i]=t,this.forward[i]=this.head,this.backward[this.head]=i,this.head=i,r?{evicted:!0,key:r,value:n}:null):(this.splayOnTop(i),n=this.V[i],this.V[i]=t,{evicted:!1,key:e,value:n})},u.prototype.has=function(e){return e in this.items},u.prototype.get=function(e){var t=this.items[e];if(t!==void 0)return this.splayOnTop(t),this.V[t]},u.prototype.peek=function(e){var t=this.items[e];if(t!==void 0)return this.V[t]},u.prototype.forEach=function(e,t){t=arguments.length>1?t:this;for(var n=0,r=this.size,i=this.head,a=this.K,o=this.V,s=this.forward;n<r;)e.call(t,o[i],a[i],this),i=s[i],n++},u.prototype.keys=function(){var e=0,t=this.size,n=this.head,r=this.K,i=this.forward;return new o(function(){if(e>=t)return{done:!0};var a=r[n];return e++,e<t&&(n=i[n]),{done:!1,value:a}})},u.prototype.values=function(){var e=0,t=this.size,n=this.head,r=this.V,i=this.forward;return new o(function(){if(e>=t)return{done:!0};var a=r[n];return e++,e<t&&(n=i[n]),{done:!1,value:a}})},u.prototype.entries=function(){var e=0,t=this.size,n=this.head,r=this.K,i=this.V,a=this.forward;return new o(function(){if(e>=t)return{done:!0};var o=r[n],s=i[n];return e++,e<t&&(n=a[n]),{done:!1,value:[o,s]}})},typeof Symbol<`u`&&(u.prototype[Symbol.iterator]=u.prototype.entries),u.prototype.inspect=function(){for(var e=new Map,t=this.entries(),n;n=t.next(),!n.done;)e.set(n.value[0],n.value[1]);return Object.defineProperty(e,`constructor`,{value:u,enumerable:!1}),e},typeof Symbol<`u`&&(u.prototype[Symbol.for(`nodejs.util.inspect.custom`)]=u.prototype.inspect),u.from=function(e,t,n,r){if(arguments.length<2){if(r=l.guessLength(e),typeof r!=`number`)throw Error(`mnemonist/lru-cache.from: could not guess iterable length. Please provide desired capacity as last argument.`)}else arguments.length===2&&(r=t,t=null,n=null);var i=new u(t,n,r);return s(e,function(e,t){i.set(t,e)}),i},t.exports=u})),d=t(((e,t)=>{var n=u(),o=i(),s=r(),c=a();function l(e,t,n){if(arguments.length<2&&(n=e,e=null,t=null),this.capacity=n,typeof this.capacity!=`number`||this.capacity<=0)throw Error(`mnemonist/lru-map: capacity should be positive number.`);if(!isFinite(this.capacity)||Math.floor(this.capacity)!==this.capacity)throw Error(`mnemonist/lru-map: capacity should be a finite positive integer.`);var r=s.getPointerArray(n);this.forward=new r(n),this.backward=new r(n),this.K=typeof e==`function`?new e(n):Array(n),this.V=typeof t==`function`?new t(n):Array(n),this.size=0,this.head=0,this.tail=0,this.items=new Map}l.prototype.clear=function(){this.size=0,this.head=0,this.tail=0,this.items.clear()},l.prototype.set=function(e,t){var n=this.items.get(e);if(n!==void 0){this.splayOnTop(n),this.V[n]=t;return}this.size<this.capacity?n=this.size++:(n=this.tail,this.tail=this.backward[n],this.items.delete(this.K[n])),this.items.set(e,n),this.K[n]=e,this.V[n]=t,this.forward[n]=this.head,this.backward[this.head]=n,this.head=n},l.prototype.setpop=function(e,t){var n=null,r=null,i=this.items.get(e);return i===void 0?(this.size<this.capacity?i=this.size++:(i=this.tail,this.tail=this.backward[i],n=this.V[i],r=this.K[i],this.items.delete(r)),this.items.set(e,i),this.K[i]=e,this.V[i]=t,this.forward[i]=this.head,this.backward[this.head]=i,this.head=i,r?{evicted:!0,key:r,value:n}:null):(this.splayOnTop(i),n=this.V[i],this.V[i]=t,{evicted:!1,key:e,value:n})},l.prototype.has=function(e){return this.items.has(e)},l.prototype.get=function(e){var t=this.items.get(e);if(t!==void 0)return this.splayOnTop(t),this.V[t]},l.prototype.peek=function(e){var t=this.items.get(e);if(t!==void 0)return this.V[t]},l.prototype.splayOnTop=n.prototype.splayOnTop,l.prototype.forEach=n.prototype.forEach,l.prototype.keys=n.prototype.keys,l.prototype.values=n.prototype.values,l.prototype.entries=n.prototype.entries,typeof Symbol<`u`&&(l.prototype[Symbol.iterator]=l.prototype.entries),l.prototype.inspect=n.prototype.inspect,l.from=function(e,t,n,r){if(arguments.length<2){if(r=c.guessLength(e),typeof r!=`number`)throw Error(`mnemonist/lru-cache.from: could not guess iterable length. Please provide desired capacity as last argument.`)}else arguments.length===2&&(r=t,t=null,n=null);var i=new l(t,n,r);return o(e,function(e,t){i.set(t,e)}),i},t.exports=l})),f=t((e=>{e.intersection=function(){if(arguments.length<2)throw Error(`mnemonist/Set.intersection: needs at least two arguments.`);var e=new Set,t=1/0,n=null,r,i,a=arguments.length;for(i=0;i<a;i++){if(r=arguments[i],r.size===0)return e;r.size<t&&(t=r.size,n=r)}for(var o=n.values(),s,c,l,u;s=o.next(),!s.done;){for(c=s.value,l=!0,i=0;i<a;i++)if(u=arguments[i],u!==n&&!u.has(c)){l=!1;break}l&&e.add(c)}return e},e.union=function(){if(arguments.length<2)throw Error(`mnemonist/Set.union: needs at least two arguments.`);var e=new Set,t,n=arguments.length,r,i;for(t=0;t<n;t++)for(r=arguments[t].values();i=r.next(),!i.done;)e.add(i.value);return e},e.difference=function(e,t){if(!e.size)return new Set;if(!t.size)return new Set(e);for(var n=new Set,r=e.values(),i;i=r.next(),!i.done;)t.has(i.value)||n.add(i.value);return n},e.symmetricDifference=function(e,t){for(var n=new Set,r=e.values(),i;i=r.next(),!i.done;)t.has(i.value)||n.add(i.value);for(r=t.values();i=r.next(),!i.done;)e.has(i.value)||n.add(i.value);return n},e.isSubset=function(e,t){var n=e.values(),r;if(e===t)return!0;if(e.size>t.size)return!1;for(;r=n.next(),!r.done;)if(!t.has(r.value))return!1;return!0},e.isSuperset=function(t,n){return e.isSubset(n,t)},e.add=function(e,t){for(var n=t.values(),r;r=n.next(),!r.done;)e.add(r.value)},e.subtract=function(e,t){for(var n=t.values(),r;r=n.next(),!r.done;)e.delete(r.value)},e.intersect=function(e,t){for(var n=e.values(),r;r=n.next(),!r.done;)t.has(r.value)||e.delete(r.value)},e.disjunct=function(e,t){for(var n=e.values(),r,i=[];r=n.next(),!r.done;)t.has(r.value)&&i.push(r.value);for(n=t.values();r=n.next(),!r.done;)e.has(r.value)||e.add(r.value);for(var a=0,o=i.length;a<o;a++)e.delete(i[a])},e.intersectionSize=function(e,t){var n;if(e.size>t.size&&(n=e,e=t,t=n),e.size===0)return 0;if(e===t)return e.size;for(var r=e.values(),i,a=0;i=r.next(),!i.done;)t.has(i.value)&&a++;return a},e.unionSize=function(t,n){var r=e.intersectionSize(t,n);return t.size+n.size-r},e.jaccard=function(t,n){var r=e.intersectionSize(t,n);return r===0?0:r/(t.size+n.size-r)},e.overlap=function(t,n){var r=e.intersectionSize(t,n);return r===0?0:r/Math.min(t.size,n.size)}})),p=t(((e,t)=>{var r=n(),a=i();function o(){this.clear()}o.prototype.clear=function(){this.items=[],this.size=0},o.prototype.push=function(e){return this.items.push(e),++this.size},o.prototype.pop=function(){if(this.size!==0)return this.size--,this.items.pop()},o.prototype.peek=function(){return this.items[this.size-1]},o.prototype.forEach=function(e,t){t=arguments.length>1?t:this;for(var n=0,r=this.items.length;n<r;n++)e.call(t,this.items[r-n-1],n,this)},o.prototype.toArray=function(){for(var e=Array(this.size),t=this.size-1,n=this.size;n--;)e[n]=this.items[t-n];return e},o.prototype.values=function(){var e=this.items,t=e.length,n=0;return new r(function(){if(n>=t)return{done:!0};var r=e[t-n-1];return n++,{value:r,done:!1}})},o.prototype.entries=function(){var e=this.items,t=e.length,n=0;return new r(function(){if(n>=t)return{done:!0};var r=e[t-n-1];return{value:[n++,r],done:!1}})},typeof Symbol<`u`&&(o.prototype[Symbol.iterator]=o.prototype.values),o.prototype.toString=function(){return this.toArray().join(`,`)},o.prototype.toJSON=function(){return this.toArray()},o.prototype.inspect=function(){var e=this.toArray();return Object.defineProperty(e,`constructor`,{value:o,enumerable:!1}),e},typeof Symbol<`u`&&(o.prototype[Symbol.for(`nodejs.util.inspect.custom`)]=o.prototype.inspect),o.from=function(e){var t=new o;return a(e,function(e){t.push(e)}),t},o.of=function(){return o.from(arguments)},t.exports=o})),m=e(o(),1),h=e(s(),1),g=e(c(),1),_=e(l(),1),v=e(d(),1),y=f(),b=e(p(),1);export{_ as a,v as i,h as n,y as o,g as r,b as s,m as t};
1
+ import{s as e,t}from"../rolldown-runtime.mjs";import{a as n,i as r,o as i,r as a}from"./graphology-dag.mjs";var o=t(((e,t)=>{var n=i();function r(e){this.size=0,this.items=new Map,this.inverse=e}function a(){this.size=0,this.items=new Map,this.inverse=new r(this)}function o(){this.size=0,this.items.clear(),this.inverse.items.clear()}a.prototype.clear=o,r.prototype.clear=o;function s(e,t){if(this.items.has(e)){var n=this.items.get(e);if(n===t)return this;this.inverse.items.delete(n)}if(this.inverse.items.has(t)){var r=this.inverse.items.get(t);if(r===e)return this;this.items.delete(r)}return this.items.set(e,t),this.inverse.items.set(t,e),this.size=this.items.size,this.inverse.size=this.inverse.items.size,this}a.prototype.set=s,r.prototype.set=s;function c(e){if(this.items.has(e)){var t=this.items.get(e);return this.items.delete(e),this.inverse.items.delete(t),this.size=this.items.size,this.inverse.size=this.inverse.items.size,!0}return!1}a.prototype.delete=c,r.prototype.delete=c,[`has`,`get`,`forEach`,`keys`,`values`,`entries`].forEach(function(e){a.prototype[e]=r.prototype[e]=function(){return Map.prototype[e].apply(this.items,arguments)}}),typeof Symbol<`u`&&(a.prototype[Symbol.iterator]=a.prototype.entries,r.prototype[Symbol.iterator]=r.prototype.entries),a.prototype.inspect=function(){var e={left:this.items,right:this.inverse.items};return Object.defineProperty(e,`constructor`,{value:a,enumerable:!1}),e},typeof Symbol<`u`&&(a.prototype[Symbol.for(`nodejs.util.inspect.custom`)]=a.prototype.inspect),r.prototype.inspect=function(){var e={left:this.inverse.items,right:this.items};return Object.defineProperty(e,`constructor`,{value:r,enumerable:!1}),e},typeof Symbol<`u`&&(r.prototype[Symbol.for(`nodejs.util.inspect.custom`)]=r.prototype.inspect),a.from=function(e){var t=new a;return n(e,function(e,n){t.set(n,e)}),t},t.exports=a})),s=t(((e,t)=>{function n(e){if(typeof e!=`function`)throw Error(`mnemonist/DefaultMap.constructor: expecting a function.`);this.items=new Map,this.factory=e,this.size=0}n.prototype.clear=function(){this.items.clear(),this.size=0},n.prototype.get=function(e){var t=this.items.get(e);return t===void 0&&(t=this.factory(e,this.size),this.items.set(e,t),this.size++),t},n.prototype.peek=function(e){return this.items.get(e)},n.prototype.set=function(e,t){return this.items.set(e,t),this.size=this.items.size,this},n.prototype.has=function(e){return this.items.has(e)},n.prototype.delete=function(e){var t=this.items.delete(e);return this.size=this.items.size,t},n.prototype.forEach=function(e,t){t=arguments.length>1?t:this,this.items.forEach(e,t)},n.prototype.entries=function(){return this.items.entries()},n.prototype.keys=function(){return this.items.keys()},n.prototype.values=function(){return this.items.values()},typeof Symbol<`u`&&(n.prototype[Symbol.iterator]=n.prototype.entries),n.prototype.inspect=function(){return this.items},typeof Symbol<`u`&&(n.prototype[Symbol.for(`nodejs.util.inspect.custom`)]=n.prototype.inspect),n.autoIncrement=function(){var e=0;return function(){return e++}},t.exports=n})),c=t(((e,t)=>{function n(e){if(typeof e!=`function`)throw Error(`mnemonist/DefaultWeakMap.constructor: expecting a function.`);this.items=new WeakMap,this.factory=e}n.prototype.clear=function(){this.items=new WeakMap},n.prototype.get=function(e){var t=this.items.get(e);return t===void 0&&(t=this.factory(e),this.items.set(e,t)),t},n.prototype.peek=function(e){return this.items.get(e)},n.prototype.set=function(e,t){return this.items.set(e,t),this},n.prototype.has=function(e){return this.items.has(e)},n.prototype.delete=function(e){return this.items.delete(e)},n.prototype.inspect=function(){return this.items},typeof Symbol<`u`&&(n.prototype[Symbol.for(`nodejs.util.inspect.custom`)]=n.prototype.inspect),t.exports=n})),l=t(((e,t)=>{var r=n(),a=i();function o(){this.clear()}o.prototype.clear=function(){this.head=null,this.tail=null,this.size=0},o.prototype.first=function(){return this.head?this.head.item:void 0},o.prototype.peek=o.prototype.first,o.prototype.last=function(){return this.tail?this.tail.item:void 0},o.prototype.push=function(e){var t={item:e,next:null};return this.head?(this.tail.next=t,this.tail=t):(this.head=t,this.tail=t),this.size++,this.size},o.prototype.unshift=function(e){var t={item:e,next:null};return this.head?(this.head.next||(this.tail=this.head),t.next=this.head,this.head=t):(this.head=t,this.tail=t),this.size++,this.size},o.prototype.shift=function(){if(this.size){var e=this.head;return this.head=e.next,this.size--,e.item}},o.prototype.forEach=function(e,t){if(this.size){t=arguments.length>1?t:this;for(var n=this.head,r=0;n;)e.call(t,n.item,r,this),n=n.next,r++}},o.prototype.toArray=function(){if(!this.size)return[];for(var e=Array(this.size),t=0,n=this.size,r=this.head;t<n;t++)e[t]=r.item,r=r.next;return e},o.prototype.values=function(){var e=this.head;return new r(function(){if(!e)return{done:!0};var t=e.item;return e=e.next,{value:t,done:!1}})},o.prototype.entries=function(){var e=this.head,t=0;return new r(function(){if(!e)return{done:!0};var n=e.item;return e=e.next,t++,{value:[t-1,n],done:!1}})},typeof Symbol<`u`&&(o.prototype[Symbol.iterator]=o.prototype.values),o.prototype.toString=function(){return this.toArray().join(`,`)},o.prototype.toJSON=function(){return this.toArray()},o.prototype.inspect=function(){var e=this.toArray();return Object.defineProperty(e,`constructor`,{value:o,enumerable:!1}),e},typeof Symbol<`u`&&(o.prototype[Symbol.for(`nodejs.util.inspect.custom`)]=o.prototype.inspect),o.from=function(e){var t=new o;return a(e,function(e){t.push(e)}),t},t.exports=o})),u=t(((e,t)=>{var r=n(),a=i();function o(e){this.Container=e||Array,this.items=new Map,this.clear(),Object.defineProperty(this.items,`constructor`,{value:o,enumerable:!1})}o.prototype.clear=function(){this.size=0,this.dimension=0,this.items.clear()},o.prototype.set=function(e,t){var n=this.items.get(e),r;return n||(this.dimension++,n=new this.Container,this.items.set(e,n)),this.Container===Set?(r=n.size,n.add(t),r<n.size&&this.size++):(n.push(t),this.size++),this},o.prototype.delete=function(e){var t=this.items.get(e);return t?(this.size-=this.Container===Set?t.size:t.length,this.dimension--,this.items.delete(e),!0):!1},o.prototype.remove=function(e,t){var n=this.items.get(e),r,i;return n?this.Container===Set?(r=n.delete(t),r&&this.size--,n.size===0&&(this.items.delete(e),this.dimension--),r):(i=n.indexOf(t),i===-1?!1:(this.size--,n.length===1?(this.items.delete(e),this.dimension--,!0):(n.splice(i,1),!0))):!1},o.prototype.has=function(e){return this.items.has(e)},o.prototype.get=function(e){return this.items.get(e)},o.prototype.multiplicity=function(e){var t=this.items.get(e);return t===void 0?0:this.Container===Set?t.size:t.length},o.prototype.count=o.prototype.multiplicity,o.prototype.forEach=function(e,t){t=arguments.length>1?t:this;var n;function r(r){e.call(t,r,n)}this.items.forEach(function(e,t){n=t,e.forEach(r)})},o.prototype.forEachAssociation=function(e,t){t=arguments.length>1?t:this,this.items.forEach(e,t)},o.prototype.keys=function(){return this.items.keys()},o.prototype.values=function(){var e=this.items.values(),t=!1,n,i,a,o;return this.Container===Set?new r(function r(){if(!t){if(i=e.next(),i.done)return{done:!0};t=!0,n=i.value.values()}return i=n.next(),i.done?(t=!1,r()):{done:!1,value:i.value}}):new r(function r(){if(!t){if(i=e.next(),i.done)return{done:!0};t=!0,n=i.value,a=0,o=n.length}return a>=o?(t=!1,r()):{done:!1,value:n[a++]}})},o.prototype.entries=function(){var e=this.items.entries(),t=!1,n,i,a,o,s;return this.Container===Set?new r(function r(){if(!t){if(i=e.next(),i.done)return{done:!0};t=!0,a=i.value[0],n=i.value[1].values()}return i=n.next(),i.done?(t=!1,r()):{done:!1,value:[a,i.value]}}):new r(function r(){if(!t){if(i=e.next(),i.done)return{done:!0};t=!0,a=i.value[0],n=i.value[1],o=0,s=n.length}return o>=s?(t=!1,r()):{done:!1,value:[a,n[o++]]}})},o.prototype.containers=function(){return this.items.values()},o.prototype.associations=function(){return this.items.entries()},typeof Symbol<`u`&&(o.prototype[Symbol.iterator]=o.prototype.entries),o.prototype.inspect=function(){return this.items},typeof Symbol<`u`&&(o.prototype[Symbol.for(`nodejs.util.inspect.custom`)]=o.prototype.inspect),o.prototype.toJSON=function(){return this.items},o.from=function(e,t){var n=new o(t);return a(e,function(e,t){n.set(t,e)}),n},t.exports=o})),d=t(((e,t)=>{var r=n(),a=i();function o(){this.clear()}o.prototype.clear=function(){this.items=[],this.offset=0,this.size=0},o.prototype.enqueue=function(e){return this.items.push(e),++this.size},o.prototype.dequeue=function(){if(this.size){var e=this.items[this.offset];return++this.offset*2>=this.items.length&&(this.items=this.items.slice(this.offset),this.offset=0),this.size--,e}},o.prototype.peek=function(){if(this.size)return this.items[this.offset]},o.prototype.forEach=function(e,t){t=arguments.length>1?t:this;for(var n=this.offset,r=0,i=this.items.length;n<i;n++,r++)e.call(t,this.items[n],r,this)},o.prototype.toArray=function(){return this.items.slice(this.offset)},o.prototype.values=function(){var e=this.items,t=this.offset;return new r(function(){if(t>=e.length)return{done:!0};var n=e[t];return t++,{value:n,done:!1}})},o.prototype.entries=function(){var e=this.items,t=this.offset,n=0;return new r(function(){if(t>=e.length)return{done:!0};var r=e[t];return t++,{value:[n++,r],done:!1}})},typeof Symbol<`u`&&(o.prototype[Symbol.iterator]=o.prototype.values),o.prototype.toString=function(){return this.toArray().join(`,`)},o.prototype.toJSON=function(){return this.toArray()},o.prototype.inspect=function(){var e=this.toArray();return Object.defineProperty(e,`constructor`,{value:o,enumerable:!1}),e},typeof Symbol<`u`&&(o.prototype[Symbol.for(`nodejs.util.inspect.custom`)]=o.prototype.inspect),o.from=function(e){var t=new o;return a(e,function(e){t.enqueue(e)}),t},o.of=function(){return o.from(arguments)},t.exports=o})),f=t(((e,t)=>{var o=n(),s=i(),c=r(),l=a();function u(e,t,n){if(arguments.length<2&&(n=e,e=null,t=null),this.capacity=n,typeof this.capacity!=`number`||this.capacity<=0)throw Error(`mnemonist/lru-cache: capacity should be positive number.`);if(!isFinite(this.capacity)||Math.floor(this.capacity)!==this.capacity)throw Error(`mnemonist/lru-cache: capacity should be a finite positive integer.`);var r=c.getPointerArray(n);this.forward=new r(n),this.backward=new r(n),this.K=typeof e==`function`?new e(n):Array(n),this.V=typeof t==`function`?new t(n):Array(n),this.size=0,this.head=0,this.tail=0,this.items={}}u.prototype.clear=function(){this.size=0,this.head=0,this.tail=0,this.items={}},u.prototype.splayOnTop=function(e){var t=this.head;if(this.head===e)return this;var n=this.backward[e],r=this.forward[e];return this.tail===e?this.tail=n:this.backward[r]=n,this.forward[n]=r,this.backward[t]=e,this.head=e,this.forward[e]=t,this},u.prototype.set=function(e,t){var n=this.items[e];if(n!==void 0){this.splayOnTop(n),this.V[n]=t;return}this.size<this.capacity?n=this.size++:(n=this.tail,this.tail=this.backward[n],delete this.items[this.K[n]]),this.items[e]=n,this.K[n]=e,this.V[n]=t,this.forward[n]=this.head,this.backward[this.head]=n,this.head=n},u.prototype.setpop=function(e,t){var n=null,r=null,i=this.items[e];return i===void 0?(this.size<this.capacity?i=this.size++:(i=this.tail,this.tail=this.backward[i],n=this.V[i],r=this.K[i],delete this.items[r]),this.items[e]=i,this.K[i]=e,this.V[i]=t,this.forward[i]=this.head,this.backward[this.head]=i,this.head=i,r?{evicted:!0,key:r,value:n}:null):(this.splayOnTop(i),n=this.V[i],this.V[i]=t,{evicted:!1,key:e,value:n})},u.prototype.has=function(e){return e in this.items},u.prototype.get=function(e){var t=this.items[e];if(t!==void 0)return this.splayOnTop(t),this.V[t]},u.prototype.peek=function(e){var t=this.items[e];if(t!==void 0)return this.V[t]},u.prototype.forEach=function(e,t){t=arguments.length>1?t:this;for(var n=0,r=this.size,i=this.head,a=this.K,o=this.V,s=this.forward;n<r;)e.call(t,o[i],a[i],this),i=s[i],n++},u.prototype.keys=function(){var e=0,t=this.size,n=this.head,r=this.K,i=this.forward;return new o(function(){if(e>=t)return{done:!0};var a=r[n];return e++,e<t&&(n=i[n]),{done:!1,value:a}})},u.prototype.values=function(){var e=0,t=this.size,n=this.head,r=this.V,i=this.forward;return new o(function(){if(e>=t)return{done:!0};var a=r[n];return e++,e<t&&(n=i[n]),{done:!1,value:a}})},u.prototype.entries=function(){var e=0,t=this.size,n=this.head,r=this.K,i=this.V,a=this.forward;return new o(function(){if(e>=t)return{done:!0};var o=r[n],s=i[n];return e++,e<t&&(n=a[n]),{done:!1,value:[o,s]}})},typeof Symbol<`u`&&(u.prototype[Symbol.iterator]=u.prototype.entries),u.prototype.inspect=function(){for(var e=new Map,t=this.entries(),n;n=t.next(),!n.done;)e.set(n.value[0],n.value[1]);return Object.defineProperty(e,`constructor`,{value:u,enumerable:!1}),e},typeof Symbol<`u`&&(u.prototype[Symbol.for(`nodejs.util.inspect.custom`)]=u.prototype.inspect),u.from=function(e,t,n,r){if(arguments.length<2){if(r=l.guessLength(e),typeof r!=`number`)throw Error(`mnemonist/lru-cache.from: could not guess iterable length. Please provide desired capacity as last argument.`)}else arguments.length===2&&(r=t,t=null,n=null);var i=new u(t,n,r);return s(e,function(e,t){i.set(t,e)}),i},t.exports=u})),p=t(((e,t)=>{var n=f(),o=i(),s=r(),c=a();function l(e,t,n){if(arguments.length<2&&(n=e,e=null,t=null),this.capacity=n,typeof this.capacity!=`number`||this.capacity<=0)throw Error(`mnemonist/lru-map: capacity should be positive number.`);if(!isFinite(this.capacity)||Math.floor(this.capacity)!==this.capacity)throw Error(`mnemonist/lru-map: capacity should be a finite positive integer.`);var r=s.getPointerArray(n);this.forward=new r(n),this.backward=new r(n),this.K=typeof e==`function`?new e(n):Array(n),this.V=typeof t==`function`?new t(n):Array(n),this.size=0,this.head=0,this.tail=0,this.items=new Map}l.prototype.clear=function(){this.size=0,this.head=0,this.tail=0,this.items.clear()},l.prototype.set=function(e,t){var n=this.items.get(e);if(n!==void 0){this.splayOnTop(n),this.V[n]=t;return}this.size<this.capacity?n=this.size++:(n=this.tail,this.tail=this.backward[n],this.items.delete(this.K[n])),this.items.set(e,n),this.K[n]=e,this.V[n]=t,this.forward[n]=this.head,this.backward[this.head]=n,this.head=n},l.prototype.setpop=function(e,t){var n=null,r=null,i=this.items.get(e);return i===void 0?(this.size<this.capacity?i=this.size++:(i=this.tail,this.tail=this.backward[i],n=this.V[i],r=this.K[i],this.items.delete(r)),this.items.set(e,i),this.K[i]=e,this.V[i]=t,this.forward[i]=this.head,this.backward[this.head]=i,this.head=i,r?{evicted:!0,key:r,value:n}:null):(this.splayOnTop(i),n=this.V[i],this.V[i]=t,{evicted:!1,key:e,value:n})},l.prototype.has=function(e){return this.items.has(e)},l.prototype.get=function(e){var t=this.items.get(e);if(t!==void 0)return this.splayOnTop(t),this.V[t]},l.prototype.peek=function(e){var t=this.items.get(e);if(t!==void 0)return this.V[t]},l.prototype.splayOnTop=n.prototype.splayOnTop,l.prototype.forEach=n.prototype.forEach,l.prototype.keys=n.prototype.keys,l.prototype.values=n.prototype.values,l.prototype.entries=n.prototype.entries,typeof Symbol<`u`&&(l.prototype[Symbol.iterator]=l.prototype.entries),l.prototype.inspect=n.prototype.inspect,l.from=function(e,t,n,r){if(arguments.length<2){if(r=c.guessLength(e),typeof r!=`number`)throw Error(`mnemonist/lru-cache.from: could not guess iterable length. Please provide desired capacity as last argument.`)}else arguments.length===2&&(r=t,t=null,n=null);var i=new l(t,n,r);return o(e,function(e,t){i.set(t,e)}),i},t.exports=l})),m=t(((e,t)=>{var n=p(),o=i(),s=r(),c=a();function l(e,t,r){arguments.length<2?n.call(this,e):n.call(this,e,t,r),this.deleted=new(s.getPointerArray(this.capacity))(this.capacity),this.deletedSize=0}for(var u in n.prototype)l.prototype[u]=n.prototype[u];typeof Symbol<`u`&&(l.prototype[Symbol.iterator]=n.prototype[Symbol.iterator]),l.prototype.clear=function(){n.prototype.clear.call(this),this.deletedSize=0},l.prototype.set=function(e,t){var n=this.items.get(e);if(n!==void 0){this.splayOnTop(n),this.V[n]=t;return}this.size<this.capacity?(n=this.deletedSize>0?this.deleted[--this.deletedSize]:this.size,this.size++):(n=this.tail,this.tail=this.backward[n],this.items.delete(this.K[n])),this.items.set(e,n),this.K[n]=e,this.V[n]=t,this.forward[n]=this.head,this.backward[this.head]=n,this.head=n},l.prototype.setpop=function(e,t){var n=null,r=null,i=this.items.get(e);return i===void 0?(this.size<this.capacity?(i=this.deletedSize>0?this.deleted[--this.deletedSize]:this.size,this.size++):(i=this.tail,this.tail=this.backward[i],n=this.V[i],r=this.K[i],this.items.delete(r)),this.items.set(e,i),this.K[i]=e,this.V[i]=t,this.forward[i]=this.head,this.backward[this.head]=i,this.head=i,r?{evicted:!0,key:r,value:n}:null):(this.splayOnTop(i),n=this.V[i],this.V[i]=t,{evicted:!1,key:e,value:n})},l.prototype.delete=function(e){var t=this.items.get(e);if(t===void 0)return!1;if(this.items.delete(e),this.size===1)return this.size=0,this.head=0,this.tail=0,this.deletedSize=0,!0;var n=this.backward[t],r=this.forward[t];return this.head===t&&(this.head=r),this.tail===t&&(this.tail=n),this.forward[n]=r,this.backward[r]=n,this.size--,this.deleted[this.deletedSize++]=t,!0},l.prototype.remove=function(e,t=void 0){var n=this.items.get(e);if(n===void 0)return t;var r=this.V[n];if(this.items.delete(e),this.size===1)return this.size=0,this.head=0,this.tail=0,this.deletedSize=0,r;var i=this.backward[n],a=this.forward[n];return this.head===n&&(this.head=a),this.tail===n&&(this.tail=i),this.forward[i]=a,this.backward[a]=i,this.size--,this.deleted[this.deletedSize++]=n,r},l.from=function(e,t,n,r){if(arguments.length<2){if(r=c.guessLength(e),typeof r!=`number`)throw Error(`mnemonist/lru-map.from: could not guess iterable length. Please provide desired capacity as last argument.`)}else arguments.length===2&&(r=t,t=null,n=null);var i=new l(t,n,r);return o(e,function(e,t){i.set(t,e)}),i},t.exports=l})),h=t((e=>{e.intersection=function(){if(arguments.length<2)throw Error(`mnemonist/Set.intersection: needs at least two arguments.`);var e=new Set,t=1/0,n=null,r,i,a=arguments.length;for(i=0;i<a;i++){if(r=arguments[i],r.size===0)return e;r.size<t&&(t=r.size,n=r)}for(var o=n.values(),s,c,l,u;s=o.next(),!s.done;){for(c=s.value,l=!0,i=0;i<a;i++)if(u=arguments[i],u!==n&&!u.has(c)){l=!1;break}l&&e.add(c)}return e},e.union=function(){if(arguments.length<2)throw Error(`mnemonist/Set.union: needs at least two arguments.`);var e=new Set,t,n=arguments.length,r,i;for(t=0;t<n;t++)for(r=arguments[t].values();i=r.next(),!i.done;)e.add(i.value);return e},e.difference=function(e,t){if(!e.size)return new Set;if(!t.size)return new Set(e);for(var n=new Set,r=e.values(),i;i=r.next(),!i.done;)t.has(i.value)||n.add(i.value);return n},e.symmetricDifference=function(e,t){for(var n=new Set,r=e.values(),i;i=r.next(),!i.done;)t.has(i.value)||n.add(i.value);for(r=t.values();i=r.next(),!i.done;)e.has(i.value)||n.add(i.value);return n},e.isSubset=function(e,t){var n=e.values(),r;if(e===t)return!0;if(e.size>t.size)return!1;for(;r=n.next(),!r.done;)if(!t.has(r.value))return!1;return!0},e.isSuperset=function(t,n){return e.isSubset(n,t)},e.add=function(e,t){for(var n=t.values(),r;r=n.next(),!r.done;)e.add(r.value)},e.subtract=function(e,t){for(var n=t.values(),r;r=n.next(),!r.done;)e.delete(r.value)},e.intersect=function(e,t){for(var n=e.values(),r;r=n.next(),!r.done;)t.has(r.value)||e.delete(r.value)},e.disjunct=function(e,t){for(var n=e.values(),r,i=[];r=n.next(),!r.done;)t.has(r.value)&&i.push(r.value);for(n=t.values();r=n.next(),!r.done;)e.has(r.value)||e.add(r.value);for(var a=0,o=i.length;a<o;a++)e.delete(i[a])},e.intersectionSize=function(e,t){var n;if(e.size>t.size&&(n=e,e=t,t=n),e.size===0)return 0;if(e===t)return e.size;for(var r=e.values(),i,a=0;i=r.next(),!i.done;)t.has(i.value)&&a++;return a},e.unionSize=function(t,n){var r=e.intersectionSize(t,n);return t.size+n.size-r},e.jaccard=function(t,n){var r=e.intersectionSize(t,n);return r===0?0:r/(t.size+n.size-r)},e.overlap=function(t,n){var r=e.intersectionSize(t,n);return r===0?0:r/Math.min(t.size,n.size)}})),g=t(((e,t)=>{var r=n(),a=i();function o(){this.clear()}o.prototype.clear=function(){this.items=[],this.size=0},o.prototype.push=function(e){return this.items.push(e),++this.size},o.prototype.pop=function(){if(this.size!==0)return this.size--,this.items.pop()},o.prototype.peek=function(){return this.items[this.size-1]},o.prototype.forEach=function(e,t){t=arguments.length>1?t:this;for(var n=0,r=this.items.length;n<r;n++)e.call(t,this.items[r-n-1],n,this)},o.prototype.toArray=function(){for(var e=Array(this.size),t=this.size-1,n=this.size;n--;)e[n]=this.items[t-n];return e},o.prototype.values=function(){var e=this.items,t=e.length,n=0;return new r(function(){if(n>=t)return{done:!0};var r=e[t-n-1];return n++,{value:r,done:!1}})},o.prototype.entries=function(){var e=this.items,t=e.length,n=0;return new r(function(){if(n>=t)return{done:!0};var r=e[t-n-1];return{value:[n++,r],done:!1}})},typeof Symbol<`u`&&(o.prototype[Symbol.iterator]=o.prototype.values),o.prototype.toString=function(){return this.toArray().join(`,`)},o.prototype.toJSON=function(){return this.toArray()},o.prototype.inspect=function(){var e=this.toArray();return Object.defineProperty(e,`constructor`,{value:o,enumerable:!1}),e},typeof Symbol<`u`&&(o.prototype[Symbol.for(`nodejs.util.inspect.custom`)]=o.prototype.inspect),o.from=function(e){var t=new o;return a(e,function(e){t.push(e)}),t},o.of=function(){return o.from(arguments)},t.exports=o}));o();var _=e(s(),1),v=e(c(),1),y=e(l(),1),b=e(u(),1);d();var x=e(p(),1);m();var S=h(),C=e(g(),1);export{b as a,x as i,v as n,S as o,y as r,C as s,_ as t};
@@ -0,0 +1,3 @@
1
+ import{stripVTControlCharacters as e}from"node:util";import t from"node:path";import n from"node:process";import{fileURLToPath as r}from"node:url";import i from"node:fs/promises";import{on as a,once as o}from"node:events";import{spawn as s}from"node:child_process";import{pipeline as c}from"node:stream/promises";import*as l from"node:readline/promises";const u=t=>({start:n.hrtime.bigint(),command:t.map(t=>d(e(t))).join(` `),state:{stdout:``,stderr:``,output:``,isIterating:{},nonIterable:[!1,!1]}}),d=e=>/[^\w./-]/.test(e)?`'${e.replaceAll(`'`,`'\\''`)}'`:e,f=({stdin:e,stdout:i,stderr:a,stdio:o=[e,i,a],env:s,preferLocal:c,cwd:l=`.`,...u})=>{let d=l instanceof URL?r(l):t.resolve(l),f=s?{...n.env,...s}:void 0,m=o[0]?.string;return{...u,input:m,stdio:m===void 0?o:[`pipe`,...o.slice(1)],env:c?p(f??n.env,d):f,cwd:d}},p=({Path:e=``,PATH:n=e,...r},i)=>{let a=n.split(t.delimiter),o=m([],t.resolve(i)).map(e=>t.join(e,`node_modules/.bin`)).filter(e=>!a.includes(e));return{...r,PATH:[...o,n].filter(Boolean).join(t.delimiter)}},m=(e,n)=>e.at(-1)===n?e:m([...e,n],t.resolve(n,`..`)),h=async(e,t,n)=>await g(e,n)?[w(e),t.map(e=>C(e)),{...n,shell:!0}]:[e,t,n],g=async(e,{shell:t,cwd:r,env:i=n.env})=>n.platform===`win32`&&!t&&!await _(e,r,i),_=(e,t,{Path:n=``,PATH:r=n})=>S.some(t=>e.toLowerCase().endsWith(t))||x(e,t,r),v={},y=e=>(...t)=>v[t.join(`\0`)]??=e(...t),b=y(i.access),x=y(async(e,n,r)=>{let i=r.split(t.delimiter).filter(Boolean).map(e=>e.replace(/^"(.*)"$/,`$1`));try{await Promise.any([n,...i].flatMap(n=>S.map(r=>b(`${t.resolve(n,e)}${r}`))))}catch{return!1}return!0}),S=[`.exe`,`.com`],C=e=>w(w(`"${e.replaceAll(/(\\*)"/g,`$1$1\\"`).replace(/(\\*)$/,`$1$1`)}"`)),w=e=>e.replaceAll(/([()\][%!^"`<>&|;, *?])/g,`^$1`),T=async(e,{input:t},n)=>{let r=await e;t!==void 0&&r.stdin.end(t);let i=o(r,`close`);try{return await Promise.race([i,...r.stdio.filter(Boolean).map(e=>E(e))]),D(n,j(r)),M(n)}catch(e){throw await Promise.allSettled([i]),O(e,r,n)}},E=async e=>{for await(let[t]of a(e,`error`))if(![`ERR_STREAM_PREMATURE_CLOSE`,`EPIPE`].includes(t?.code))throw t},D=({command:e},{exitCode:t,signalName:n})=>{if(n!==void 0)throw new A(`Command was terminated with ${n}: ${e}`);if(t!==void 0)throw new A(`Command failed with exit code ${t}: ${e}`)},O=(e,t,n)=>Object.assign(k(e,n),j(t),M(n)),k=(e,{command:t})=>e instanceof A?e:new A(`Command failed: ${t}`,{cause:e});var A=class extends Error{name=`SubprocessError`};const j=({exitCode:e,signalCode:t})=>({...e<1?{}:{exitCode:e},...t===null?{}:{signalName:t}}),M=({state:{stdout:e,stderr:t,output:r},command:i,start:a})=>({stdout:N(e),stderr:N(t),output:N(r),command:i,durationMs:Number(n.hrtime.bigint()-a)/1e6}),N=e=>e.at(-1)===`
2
+ `?e.slice(0,e.at(-2)===`\r`?-2:-1):e,P=async(e,t,r,i)=>{try{[`node`,`node.exe`].includes(e.toLowerCase())&&(e=n.execPath,t=[...n.execArgv.filter(e=>!e.startsWith(`--inspect`)),...t]),[e,t,r]=await h(e,t,r),[e,t,r]=F(e,t,r);let a=s(e,t,r);return I(a.stdout,i,`stdout`),I(a.stderr,i,`stderr`),a.once(`error`,()=>{}),await o(a,`spawn`),a}catch(e){throw O(e,{},i)}},F=(e,t,n)=>n.shell&&t.length>0?[[e,...t].join(` `),[],n]:[e,t,n],I=(e,{state:t},n)=>{e&&(e.setEncoding(`utf8`),t.isIterating[n]||(t.isIterating[n]=!1,e.on(`data`,e=>{t[n]+=e,t.output+=e})))},L=async e=>{let[[t,n]]=await Promise.all([Promise.allSettled(e),R(e)]);if(n.reason)throw n.reason.pipedFrom=t.reason??t.value,n.reason;if(t.reason)throw t.reason;return{...n.value,pipedFrom:t.value}},R=async e=>{try{let[{stdout:t},{stdin:n}]=await Promise.all(e.map(({nodeChildProcess:e})=>e));if(n===null)throw Error(`The "stdin" option must be set on the first "spawn()" call in the pipeline.`);if(t===null)throw Error(`The "stdout" option must be set on the last "spawn()" call in the pipeline.`);c(t,n).catch(()=>{})}catch(t){throw await Promise.allSettled(e.map(({nodeChildProcess:e})=>z(e))),t}},z=async e=>{let{stdin:t}=await e;t.end()},B=async function*(e,{state:t},n,r){if(t.isIterating[n]===!1)throw Error(`The subprocess must be iterated right away, for example:
3
+ for await (const line of spawn(...)) { ... }`);t.isIterating[n]=!0;try{let{[n]:i}=await e.nodeChildProcess;if(!i){t.nonIterable[r]=!0;let e=t.nonIterable.every(Boolean)?"either the option `stdout` or `stderr`":`the option \`${n}\``;throw TypeError(`The subprocess cannot be iterated unless ${e} is 'pipe'.`)}V(e),yield*l.createInterface({input:i})}finally{await e}},V=async e=>{try{await e}catch{}},H=async function*({state:e},...t){try{let n=[];for(;t.length>0;){n=t.map((t,r)=>n[r]??U(t,r,e));let[{value:r,done:i},a]=await Promise.race(n.map((e,t)=>Promise.all([e,t]))),[o]=t.splice(a,1);n.splice(a,1),i||(t.push(o),yield r)}}finally{await Promise.all(t.map(e=>e.return()))}},U=async(e,t,{nonIterable:n})=>{try{return await e.next()}catch(r){return W(n,t)?e.return():e.throw(r)}},W=(e,t)=>e.every(Boolean)?t!==e.length-1:e[t];function G(e,t,n,r){let[i=[],a={}]=Array.isArray(t)?[t,n]:[[],t],o=u([e,...i]),s=f(a),c=P(e,i,s,o),l=T(c,s,o);Object.assign(l,{nodeChildProcess:c}),l=r?L([r,l]):l;let d=B(l,o,`stdout`,0),p=B(l,o,`stderr`,1);return Object.assign(l,{nodeChildProcess:c,stdout:d,stderr:p,[Symbol.asyncIterator]:()=>H(o,d,p),pipe:(e,t,n)=>G(e,t,n,l)})}export{A as n,G as t};
@@ -1 +1,2 @@
1
- function e(e,t,n){let r=n=>e(n,...t);return n===void 0?r:Object.assign(r,{lazy:n,lazyArgs:t})}function t(t,n,r){let i=t.length-n.length;if(i===0)return t(...n);if(i===1)return e(t,n,r);throw Error(`Wrong number of arguments`)}function n(...e){return t(r,e)}const r=(e,t)=>t.every(t=>t(e));function i(...e){return t(a,e)}const a=(e,t)=>t.some(t=>t(e));function o(...e){return t(s,e)}function s(e,t){if(t<1)throw RangeError(`chunk: A chunk size of '${t.toString()}' would result in an infinite array`);if(e.length===0)return[];if(t>=e.length)return[[...e]];let n=Math.ceil(e.length/t),r=Array(n);if(t===1)for(let[t,n]of e.entries())r[t]=[n];else for(let i=0;i<n;i+=1){let n=i*t;r[i]=e.slice(n,n+t)}return r}function c(...e){return t(l,e)}const l=(e,{min:t,max:n})=>t!==void 0&&e<t?t:n!==void 0&&e>n?n:e;function u(...e){return t(d,e)}const d=(e,t)=>[...e,...t];function f(e){return()=>e}const ee={done:!0,hasNext:!1},p={done:!1,hasNext:!1},m=()=>ee,h=e=>({hasNext:!0,next:e,done:!1});function g(e,...t){let n=e,r=t.map(e=>`lazy`in e?te(e):void 0),i=0;for(;i<t.length;){if(r[i]===void 0||!ne(n)){let e=t[i];n=e(n),i+=1;continue}let e=[];for(let n=i;n<t.length;n++){let t=r[n];if(t===void 0||(e.push(t),t.isSingle))break}let a=[];for(let t of n)if(_(t,a,e))break;let{isSingle:o}=e.at(-1);n=o?a[0]:a,i+=e.length}return n}function _(e,t,n){if(n.length===0)return t.push(e),!1;let r=e,i=p,a=!1;for(let[e,o]of n.entries()){let{index:s,items:c}=o;if(c.push(r),i=o(r,s,c),o.index+=1,i.hasNext){if(i.hasMany??!1){for(let r of i.next)if(_(r,t,n.slice(e+1)))return!0;return a}r=i.next}if(!i.hasNext)break;i.done&&(a=!0)}return i.hasNext&&t.push(r),a}function te(e){let{lazy:t,lazyArgs:n}=e,r=t(...n);return Object.assign(r,{isSingle:t.single??!1,index:0,items:[]})}function ne(e){return typeof e==`string`||typeof e==`object`&&!!e&&Symbol.iterator in e}function v(e,t){let n=t.length-e.length;if(n===1){let[n,...r]=t;return g(n,{lazy:e,lazyArgs:r})}if(n===0){let n={lazy:e,lazyArgs:t};return Object.assign(e=>g(e,n),n)}throw Error(`Wrong number of arguments`)}function y(...e){return v(b,e)}function b(e){if(e.length===0)return h;let t=new Map;for(let n of e)t.set(n,(t.get(n)??0)+1);return e=>{let n=t.get(e);return n===void 0||n===0?{done:!1,hasNext:!0,next:e}:(t.set(e,n-1),p)}}function x(...e){return t(re,e)}const re=(e,t)=>e.length>=t,S={asc:(e,t)=>e>t,desc:(e,t)=>e<t};function ie(e,t){let[n,...r]=t;if(!ae(n))return e(n,C(...r));let i=C(n,...r);return t=>e(t,i)}function C(e,t,...n){let r=typeof e==`function`?e:e[0],i=typeof e==`function`?`asc`:e[1],{[i]:a}=S,o=t===void 0?void 0:C(t,...n);return(e,t)=>{let n=r(e),i=r(t);return a(n,i)?1:a(i,n)?-1:o?.(e,t)??0}}function ae(e){if(w(e))return!0;if(typeof e!=`object`||!Array.isArray(e))return!1;let[t,n,...r]=e;return w(t)&&typeof n==`string`&&n in S&&r.length===0}const w=e=>typeof e==`function`&&e.length===1;function T(...e){return t(E,e)}function E(e,t){for(let[n,r]of e.entries())if(!t(r,n,e))return e.slice(n);return[]}function D(...e){return t(Object.entries,e)}function O(...e){return t(k,e,A)}const k=(e,t)=>e.filter(t),A=e=>(t,n,r)=>e(t,n,r)?{done:!1,hasNext:!0,next:t}:p,j=e=>Object.assign(e,{single:!0});function M(...e){return t(N,e,j(P))}const N=(e,t)=>e.find(t),P=e=>(t,n,r)=>e(t,n,r)?{done:!0,hasNext:!0,next:t}:p;function F(...e){return t(I,e)}const I=(e,t)=>{for(let n=e.length-1;n>=0;n--){let r=e[n];if(t(r,n,e))return r}};function L(...e){return t(R,e,j(z))}const R=([e])=>e,z=()=>B,B=e=>({hasNext:!0,next:e,done:!0});function V(t,n){return typeof t==`object`?H(t,n):e(H,t===void 0?[]:[t],U)}const H=(e,t)=>t===void 0?e.flat():e.flat(t),U=e=>e===void 0||e===1?W:e<=0?h:t=>Array.isArray(t)?{next:t.flat(e-1),hasNext:!0,hasMany:!0,done:!1}:{next:t,hasNext:!0,done:!1},W=e=>Array.isArray(e)?{next:e,hasNext:!0,hasMany:!0,done:!1}:{next:e,hasNext:!0,done:!1};function G(...e){return t(K,e,q)}const K=(e,t)=>e.flatMap(t),q=e=>(t,n,r)=>{let i=e(t,n,r);return Array.isArray(i)?{done:!1,hasNext:!0,hasMany:!0,next:i}:{done:!1,hasNext:!0,next:i}};function J(...e){return t(oe,e,se)}function oe(e,t){return e.forEach(t),e}const se=e=>(t,n,r)=>(e(t,n,r),{done:!1,hasNext:!0,next:t});function ce(...e){return t(le,e)}function le(e,t){for(let[n,r]of Object.entries(e))t(r,n,e);return e}const Y=Symbol(`funnel/voidReducer`),ue=()=>Y;function de(e,{triggerAt:t=`end`,minQuietPeriodMs:n,maxBurstDurationMs:r,minGapMs:i,reducer:a=ue}){let o,s,c,l,u=()=>{let t=c;t!==void 0&&(c=void 0,t===Y?e():e(t),i!==void 0&&(s=setTimeout(d,i)))},d=()=>{clearTimeout(s),s=void 0,o===void 0&&u()},f=()=>{clearTimeout(o),o=void 0,l=void 0,s===void 0&&u()};return{call:(...e)=>{let d=o===void 0&&s===void 0;if((t!==`start`||d)&&(c=a(c,...e)),!(o===void 0&&!d)){if(n!==void 0||r!==void 0||i===void 0){clearTimeout(o);let e=Date.now();l??=e;let t=r===void 0?n??0:Math.min(n??r,Math.max(0,r-(e-l)));o=setTimeout(f,t)}t!==`end`&&d&&u()}},cancel:()=>{clearTimeout(o),o=void 0,l=void 0,clearTimeout(s),s=void 0,c=void 0},flush:()=>{f(),d()},get isIdle(){return o===void 0&&s===void 0}}}function fe(...e){return t(pe,e)}const pe=(e,t)=>{let n=Object.create(null);for(let r=0;r<e.length;r++){let i=e[r],a=t(i,r,e);if(a!==void 0){let e=n[a];e===void 0?n[a]=[i]:e.push(i)}}return Object.setPrototypeOf(n,Object.prototype),n};function me(...e){return t(he,e)}function he(e,t){let n=Object.create(null);for(let r of e){let e=r?.[t];if(e!==void 0){let t=n[e];t===void 0?n[e]=[r]:t.push(r)}}return Object.setPrototypeOf(n,Object.prototype),n}function ge(...e){return t(X,e)}function X(e,t){if(e===t||Object.is(e,t))return!0;if(typeof e!=`object`||typeof t!=`object`||e===null||t===null||Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1;if(Array.isArray(e))return _e(e,t);if(e instanceof Map)return ve(e,t);if(e instanceof Set)return ye(e,t);if(e instanceof Date)return e.getTime()===t.getTime();if(e instanceof RegExp)return e.toString()===t.toString();if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let[n,r]of Object.entries(e))if(!(n in t)||!X(r,t[n]))return!1;return!0}function _e(e,t){if(e.length!==t.length)return!1;for(let[n,r]of e.entries())if(!X(r,t[n]))return!1;return!0}function ve(e,t){if(e.size!==t.size)return!1;for(let[n,r]of e.entries())if(!t.has(n)||!X(r,t.get(n)))return!1;return!0}function ye(e,t){if(e.size!==t.size)return!1;let n=[...t];for(let t of e){let e=!1;for(let[r,i]of n.entries())if(X(t,i)){e=!0,n.splice(r,1);break}if(!e)return!1}return!0}function be(){return xe}const xe=e=>e;function Se(...e){return t(Ce,e)}function Ce(e,t){let n={};for(let[r,i]of e.entries()){let a=t(i,r,e);n[a]=i}return n}function we(e){return Array.isArray(e)}function Te(e){return typeof e==`boolean`}function Ee(e){return e!==void 0}function De(e){return e===``||e===void 0?!0:Array.isArray(e)?e.length===0:Object.keys(e).length===0}function Oe(e){if(e==null||e===``)return!0;if(typeof e!=`object`)return!1;if(`length`in e&&typeof e.length==`number`)return e.length===0;if(`size`in e&&typeof e.size==`number`)return e.size===0;for(let t in e)return!1;return Object.getOwnPropertySymbols(e).length===0}const ke=e=>typeof e==`function`;function Ae(e){return e!=null}function je(e){return t=>!e(t)}function Me(e){return e==null}function Ne(e){return typeof e==`number`&&!Number.isNaN(e)}function Pe(e){return e instanceof Promise}function Fe(...e){return t(Ie,e)}function Ie(e,t){if(e===t||Object.is(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;if(e instanceof Map&&t instanceof Map)return Le(e,t);if(e instanceof Set&&t instanceof Set)return Re(e,t);let n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let r of n){if(!Object.hasOwn(t,r))return!1;let{[r]:n}=e,{[r]:i}=t;if(n!==i||!Object.is(n,i))return!1}return!0}function Le(e,t){if(e.size!==t.size)return!1;for(let[n,r]of e){let e=t.get(n);if(r!==e||!Object.is(r,e))return!1}return!0}function Re(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function ze(e){return typeof e==`string`}function Be(e){return!!e}function Ve(...e){return t(Object.keys,e)}function He(...e){return t(Ue,e)}const Ue=e=>e.at(-1);function We(...e){return t(Ge,e,Ke)}const Ge=(e,t)=>e.map(t),Ke=e=>(t,n,r)=>({done:!1,hasNext:!0,next:e(t,n,r)});function qe(...e){return t(Je,e)}function Je(e,t){let n={};for(let[r,i]of e.entries()){let[a,o]=t(i,r,e);n[a]=o}return n}function Ye(...e){return t(Xe,e)}function Xe(e,t){let n={};for(let[r,i]of Object.entries(e))n[r]=t(i,r,e);return n}function Ze(...e){return t(Qe,e)}function Qe(e,t){if(!x(t,1))return{...e};if(!x(t,2)){let{[t[0]]:n,...r}=e;return r}let n={...e};for(let e of t)delete n[e];return n}function $e(...e){return t(et,e)}function et(e,t){let n={...e};for(let[r,i]of Object.entries(n))t(i,r,e)&&delete n[r];return n}function tt(e){let t=!1,n;return()=>(t||=(n=e(),!0),n)}function nt(...e){return t(rt,e)}const rt=e=>e.length===1?e[0]:void 0;function it(...e){return t(at,e)}const at=(e,t)=>{let n=[[],[]];for(let[r,i]of e.entries())t(i,r,e)?n[0].push(i):n[1].push(i);return n};function ot(...e){return t(st,e)}function st(e,t){let n={};for(let r of t)r in e&&(n[r]=e[r]);return n}function ct(...e){return t(lt,e)}function lt(e,t){let n={};for(let[r,i]of Object.entries(e))t(i,r,e)&&(n[r]=i);return n}function ut(...e){return t=>g(t,...e)}function dt(e,...t){return typeof e==`string`||typeof e==`number`||typeof e==`symbol`?n=>Z(n,e,...t):Z(e,...t)}function Z(e,...t){let n=e;for(let e of t){if(n==null)return;n=n[e]}return n}function ft(...e){return t(pt,e)}function pt(e,t,n){let r={};for(let[i,a]of e.entries()){let o=t(a,i,e);r[o]=n(a,i,e)}return r}function mt(e,t){let n=Math.ceil(e),r=Math.floor(t);if(r<n)throw RangeError(`randomInteger: The range [${e.toString()},${t.toString()}] contains no integer`);return Math.floor(Math.random()*(r-n+1)+n)}function ht(...e){return t(gt,e)}const gt=(e,t,n)=>e.reduce(t,n);function _t(...e){return t(vt,e)}function vt(e){return[...e].reverse()}function yt(...e){return t(bt,e)}function bt(e,t){let n=[...e];return n.sort(t),n}function xt(...e){return ie(St,e)}const St=(e,t)=>[...e].sort(t);function Ct(e,t,n){return typeof t==`number`||t===void 0?n=>n.split(e,t):e.split(t,n)}function wt(...e){return t(Tt,e,Et)}const Tt=(e,t)=>t<0?[]:e.slice(0,t);function Et(e){if(e<=0)return m;let t=e;return e=>(--t,{done:t<=0,hasNext:!0,next:e})}function Dt(...e){return t(Q,e)}function Q(e,t){let n=[];for(let[r,i]of e.entries()){if(!t(i,r,e))break;n.push(i)}return n}function Ot(...e){return t(kt,e)}function kt(e,t){return t(e),e}function At(...e){return v(jt,e)}function jt(){let e=new Set;return t=>e.has(t)?p:(e.add(t),{done:!1,hasNext:!0,next:t})}function Mt(...e){return v(Nt,e)}function Nt(e){let t=e,n=new Set;return(e,r,i)=>{let a=t(e,r,i);return n.has(a)?p:(n.add(a),{done:!1,hasNext:!0,next:e})}}function Pt(...e){return t(Object.values,e)}function Ft(...e){return e.length===2?(t,...n)=>$(t,...e,...n):$(...e)}const $=(e,t,n,...r)=>t(e,...r)?typeof n==`function`?n(e,...r):n.onTrue(e,...r):typeof n==`function`?e:n.onFalse(e,...r);function It(...e){return t(Lt,e,Rt)}const Lt=(e,t)=>e.length<t.length?e.map((e,n)=>[e,t[n]]):t.map((t,n)=>[e[n],t]),Rt=e=>(t,n)=>({hasNext:!0,next:[t,e[n]],done:n>=e.length-1});export{V as $,Be as A,De as B,$e as C,We as D,qe as E,Me as F,be as G,Te as H,je as I,fe as J,ge as K,Ae as L,Fe as M,Pe as N,He as O,Ne as P,G as Q,ke as R,tt as S,Ye as T,we as U,Ee as V,Se as W,ce as X,de as Y,J as Z,ut as _,At as a,T as at,it as b,wt as c,g as ct,yt as d,c as dt,L as et,_t as f,o as ft,dt as g,ft as h,t as ht,Mt as i,D as it,ze as j,Ve as k,Ct as l,f as lt,mt as m,n as mt,Ft as n,M as nt,Ot as o,x as ot,ht as p,i as pt,me as q,Pt as r,O as rt,Dt as s,y as st,It as t,F as tt,xt as u,u as ut,ct as v,Ze as w,nt as x,ot as y,Oe as z};
1
+ function e(e,t,n){let r=n=>e(n,...t);return n===void 0?r:Object.assign(r,{lazy:n,lazyArgs:t})}function t(t,n,r){let i=t.length-n.length;if(i===0)return t(...n);if(i===1)return e(t,n,r);throw Error(`Wrong number of arguments`)}function n(...e){return t(r,e)}const r=(e,t)=>t.every(t=>t(e));function i(...e){return t(a,e)}const a=(e,t)=>t.some(t=>t(e));function o(...e){return t(s,e)}function s(e,t){if(t<1)throw RangeError(`chunk: A chunk size of '${t.toString()}' would result in an infinite array`);if(e.length===0)return[];if(t>=e.length)return[[...e]];let n=Math.ceil(e.length/t),r=Array(n);if(t===1)for(let[t,n]of e.entries())r[t]=[n];else for(let i=0;i<n;i+=1){let n=i*t;r[i]=e.slice(n,n+t)}return r}function c(...e){return t(l,e)}const l=(e,{min:t,max:n})=>t!==void 0&&e<t?t:n!==void 0&&e>n?n:e;function u(...e){return t(d,e)}const d=(e,t)=>[...e,...t];function f(e){return()=>e}const ee={done:!0,hasNext:!1},p={done:!1,hasNext:!1},m=()=>ee,h=e=>({hasNext:!0,next:e,done:!1});function g(e,...t){let n=e,r=t.map(e=>`lazy`in e?te(e):void 0),i=0;for(;i<t.length;){if(r[i]===void 0||!ne(n)){let e=t[i];n=e(n),i+=1;continue}let e=[];for(let n=i;n<t.length;n++){let t=r[n];if(t===void 0||(e.push(t),t.isSingle))break}let a=[];for(let t of n)if(_(t,a,e))break;let{isSingle:o}=e.at(-1);n=o?a[0]:a,i+=e.length}return n}function _(e,t,n){if(n.length===0)return t.push(e),!1;let r=e,i=p,a=!1;for(let[e,o]of n.entries()){let{index:s,items:c}=o;if(c.push(r),i=o(r,s,c),o.index+=1,i.hasNext){if(i.hasMany??!1){for(let r of i.next)if(_(r,t,n.slice(e+1)))return!0;return a}r=i.next}if(!i.hasNext)break;i.done&&(a=!0)}return i.hasNext&&t.push(r),a}function te(e){let{lazy:t,lazyArgs:n}=e,r=t(...n);return Object.assign(r,{isSingle:t.single??!1,index:0,items:[]})}function ne(e){return typeof e==`string`||typeof e==`object`&&!!e&&Symbol.iterator in e}function v(e,t){let n=t.length-e.length;if(n===1){let[n,...r]=t;return g(n,{lazy:e,lazyArgs:r})}if(n===0){let n={lazy:e,lazyArgs:t};return Object.assign(e=>g(e,n),n)}throw Error(`Wrong number of arguments`)}function y(...e){return v(b,e)}function b(e){if(e.length===0)return h;let t=new Map;for(let n of e)t.set(n,(t.get(n)??0)+1);return e=>{let n=t.get(e);return n===void 0||n===0?{done:!1,hasNext:!0,next:e}:(t.set(e,n-1),p)}}function x(...e){return t(re,e)}const re=(e,t)=>e.length>=t,S={asc:(e,t)=>e>t,desc:(e,t)=>e<t};function ie(e,t){let[n,...r]=t;if(!ae(n))return e(n,C(...r));let i=C(n,...r);return t=>e(t,i)}function C(e,t,...n){let r=typeof e==`function`?e:e[0],i=typeof e==`function`?`asc`:e[1],{[i]:a}=S,o=t===void 0?void 0:C(t,...n);return(e,t)=>{let n=r(e),i=r(t);return a(n,i)?1:a(i,n)?-1:o?.(e,t)??0}}function ae(e){if(w(e))return!0;if(typeof e!=`object`||!Array.isArray(e))return!1;let[t,n,...r]=e;return w(t)&&typeof n==`string`&&n in S&&r.length===0}const w=e=>typeof e==`function`&&e.length===1;function T(...e){return t(E,e)}function E(e,t){for(let[n,r]of e.entries())if(!t(r,n,e))return e.slice(n);return[]}function D(...e){return t(Object.entries,e)}function O(...e){return t(k,e,A)}const k=(e,t)=>e.filter(t),A=e=>(t,n,r)=>e(t,n,r)?{done:!1,hasNext:!0,next:t}:p,j=e=>Object.assign(e,{single:!0});function M(...e){return t(N,e,j(P))}const N=(e,t)=>e.find(t),P=e=>(t,n,r)=>e(t,n,r)?{done:!0,hasNext:!0,next:t}:p;function F(...e){return t(I,e)}const I=(e,t)=>{for(let n=e.length-1;n>=0;n--){let r=e[n];if(t(r,n,e))return r}};function L(...e){return t(R,e,j(z))}const R=([e])=>e,z=()=>B,B=e=>({hasNext:!0,next:e,done:!0});function V(t,n){return typeof t==`object`?H(t,n):e(H,t===void 0?[]:[t],U)}const H=(e,t)=>t===void 0?e.flat():e.flat(t),U=e=>e===void 0||e===1?W:e<=0?h:t=>Array.isArray(t)?{next:t.flat(e-1),hasNext:!0,hasMany:!0,done:!1}:{next:t,hasNext:!0,done:!1},W=e=>Array.isArray(e)?{next:e,hasNext:!0,hasMany:!0,done:!1}:{next:e,hasNext:!0,done:!1};function G(...e){return t(K,e,q)}const K=(e,t)=>e.flatMap(t),q=e=>(t,n,r)=>{let i=e(t,n,r);return Array.isArray(i)?{done:!1,hasNext:!0,hasMany:!0,next:i}:{done:!1,hasNext:!0,next:i}};function J(...e){return t(oe,e,se)}function oe(e,t){return e.forEach(t),e}const se=e=>(t,n,r)=>(e(t,n,r),{done:!1,hasNext:!0,next:t});function ce(...e){return t(le,e)}function le(e,t){for(let[n,r]of Object.entries(e))t(r,n,e);return e}const Y=Symbol(`funnel/voidReducer`),ue=()=>Y;function de(e,{triggerAt:t=`end`,minQuietPeriodMs:n,maxBurstDurationMs:r,minGapMs:i,reducer:a=ue}){let o,s,c,l,u=()=>{let t=c;t!==void 0&&(c=void 0,t===Y?e():e(t),i!==void 0&&(s=setTimeout(d,i)))},d=()=>{clearTimeout(s),s=void 0,o===void 0&&u()},f=()=>{clearTimeout(o),o=void 0,l=void 0,s===void 0&&u()};return{call:(...e)=>{let d=o===void 0&&s===void 0;if((t!==`start`||d)&&(c=a(c,...e)),!(o===void 0&&!d)){if(n!==void 0||r!==void 0||i===void 0){clearTimeout(o);let e=Date.now();l??=e;let t=r===void 0?n??0:Math.min(n??r,Math.max(0,r-(e-l)));o=setTimeout(f,t)}t!==`end`&&d&&u()}},cancel:()=>{clearTimeout(o),o=void 0,l=void 0,clearTimeout(s),s=void 0,c=void 0},flush:()=>{f(),d()},get isIdle(){return o===void 0&&s===void 0}}}function fe(...e){return t(pe,e)}const pe=(e,t)=>{let n=Object.create(null);for(let r=0;r<e.length;r++){let i=e[r],a=t(i,r,e);if(a!==void 0){let e=n[a];e===void 0?n[a]=[i]:e.push(i)}}return Object.setPrototypeOf(n,Object.prototype),n};function me(...e){return t(he,e)}function he(e,t){let n=Object.create(null);for(let r of e){let e=r?.[t];if(e!==void 0){let t=n[e];t===void 0?n[e]=[r]:t.push(r)}}return Object.setPrototypeOf(n,Object.prototype),n}function ge(...e){return t(X,e)}function X(e,t){if(e===t||Object.is(e,t))return!0;if(typeof e!=`object`||typeof t!=`object`||e===null||t===null||Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1;if(Array.isArray(e))return _e(e,t);if(e instanceof Map)return ve(e,t);if(e instanceof Set)return ye(e,t);if(e instanceof Date)return e.getTime()===t.getTime();if(e instanceof RegExp)return e.toString()===t.toString();if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let[n,r]of Object.entries(e))if(!(n in t)||!X(r,t[n]))return!1;return!0}function _e(e,t){if(e.length!==t.length)return!1;for(let[n,r]of e.entries())if(!X(r,t[n]))return!1;return!0}function ve(e,t){if(e.size!==t.size)return!1;for(let[n,r]of e.entries())if(!t.has(n)||!X(r,t.get(n)))return!1;return!0}function ye(e,t){if(e.size!==t.size)return!1;let n=[...t];for(let t of e){let e=!1;for(let[r,i]of n.entries())if(X(t,i)){e=!0,n.splice(r,1);break}if(!e)return!1}return!0}function be(){return xe}const xe=e=>e;function Se(...e){return t(Ce,e)}function Ce(e,t){let n={};for(let[r,i]of e.entries()){let a=t(i,r,e);n[a]=i}return n}function we(e){return Array.isArray(e)}function Te(e){return typeof e==`boolean`}function Ee(e){return e!==void 0}function De(e){return e===``||e===void 0?!0:Array.isArray(e)?e.length===0:Object.keys(e).length===0}function Oe(e){if(e==null||e===``)return!0;if(typeof e!=`object`)return!1;if(`length`in e&&typeof e.length==`number`)return e.length===0;if(`size`in e&&typeof e.size==`number`)return e.size===0;for(let t in e)return!1;return Object.getOwnPropertySymbols(e).length===0}const ke=e=>typeof e==`function`;function Ae(e){return e!=null}function je(e){return t=>!e(t)}function Me(e){return e==null}function Ne(e){return typeof e==`number`&&!Number.isNaN(e)}function Pe(e){return e instanceof Promise}function Fe(...e){return t(Ie,e)}function Ie(e,t){if(e===t||Object.is(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;if(e instanceof Map&&t instanceof Map)return Le(e,t);if(e instanceof Set&&t instanceof Set)return Re(e,t);let n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let r of n){if(!Object.hasOwn(t,r))return!1;let{[r]:n}=e,{[r]:i}=t;if(n!==i||!Object.is(n,i))return!1}return!0}function Le(e,t){if(e.size!==t.size)return!1;for(let[n,r]of e){let e=t.get(n);if(r!==e||!Object.is(r,e))return!1}return!0}function Re(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function ze(e){return typeof e==`string`}function Be(e){return!!e}function Ve(...e){return t(Object.keys,e)}function He(...e){return t(Ue,e)}const Ue=e=>e.at(-1);function We(...e){return t(Ge,e,Ke)}const Ge=(e,t)=>e.map(t),Ke=e=>(t,n,r)=>({done:!1,hasNext:!0,next:e(t,n,r)});function qe(...e){return t(Je,e)}function Je(e,t){let n={};for(let[r,i]of e.entries()){let[a,o]=t(i,r,e);n[a]=o}return n}function Ye(...e){return t(Xe,e)}function Xe(e,t){let n={};for(let[r,i]of Object.entries(e))n[r]=t(i,r,e);return n}function Ze(...e){return t(Qe,e)}function Qe(e,t){if(!x(t,1))return{...e};if(!x(t,2)){let{[t[0]]:n,...r}=e;return r}let n={...e};for(let e of t)delete n[e];return n}function $e(...e){return t(et,e)}function et(e,t){let n={...e};for(let[r,i]of Object.entries(n))t(i,r,e)&&delete n[r];return n}function tt(e){let t=!1,n;return()=>(t||=(n=e(),!0),n)}function nt(...e){return t(rt,e)}const rt=e=>e.length===1?e[0]:void 0;function it(...e){return t(at,e)}const at=(e,t)=>{let n=[[],[]];for(let[r,i]of e.entries())t(i,r,e)?n[0].push(i):n[1].push(i);return n};function ot(...e){return t(st,e)}function st(e,t){let n={};for(let r of t)r in e&&(n[r]=e[r]);return n}function ct(...e){return t(lt,e)}function lt(e,t){let n={};for(let[r,i]of Object.entries(e))t(i,r,e)&&(n[r]=i);return n}function ut(...e){return t=>g(t,...e)}function dt(e,...t){return typeof e==`string`||typeof e==`number`||typeof e==`symbol`?n=>Z(n,e,...t):Z(e,...t)}function Z(e,...t){let n=e;for(let e of t){if(n==null)return;n=n[e]}return n}function ft(...e){return t(pt,e)}function pt(e,t,n){let r={};for(let[i,a]of e.entries()){let o=t(a,i,e);r[o]=n(a,i,e)}return r}function mt(e,t){let n=Math.ceil(e),r=Math.floor(t);if(r<n)throw RangeError(`randomInteger: The range [${e.toString()},${t.toString()}] contains no integer`);return Math.floor(Math.random()*(r-n+1)+n)}function ht(...e){return t(gt,e)}const gt=(e,t,n)=>e.reduce(t,n);function _t(...e){return t(vt,e)}function vt(e){return[...e].reverse()}function yt(...e){return t(bt,e)}function bt(e,t){let n=[...e];return n.sort(t),n}function xt(...e){return ie(St,e)}const St=(e,t)=>[...e].sort(t);function Ct(e,t,n){return typeof t==`number`||t===void 0?n=>n.split(e,t):e.split(t,n)}function wt(...e){return t(Tt,e,Et)}const Tt=(e,t)=>t<0?[]:e.slice(0,t);function Et(e){if(e<=0)return m;let t=e;return e=>(--t,{done:t<=0,hasNext:!0,next:e})}function Dt(...e){return t(Q,e)}function Q(e,t){let n=[];for(let[r,i]of e.entries()){if(!t(i,r,e))break;n.push(i)}return n}function Ot(...e){return t(kt,e)}function kt(e,t){return t(e),e}new Set([`-`,`_`,...` .
2
+ .\v.\f.\r. .….\xA0. . . . . . . . . . . . .\u2028.\u2029. . . .`.split(`.`)]);function At(...e){return v(jt,e)}function jt(){let e=new Set;return t=>e.has(t)?p:(e.add(t),{done:!1,hasNext:!0,next:t})}function Mt(...e){return v(Nt,e)}function Nt(e){let t=e,n=new Set;return(e,r,i)=>{let a=t(e,r,i);return n.has(a)?p:(n.add(a),{done:!1,hasNext:!0,next:e})}}function Pt(...e){return t(Object.values,e)}function Ft(...e){return e.length===2?(t,...n)=>$(t,...e,...n):$(...e)}const $=(e,t,n,...r)=>t(e,...r)?typeof n==`function`?n(e,...r):n.onTrue(e,...r):typeof n==`function`?e:n.onFalse(e,...r);function It(...e){return t(Lt,e,Rt)}const Lt=(e,t)=>e.length<t.length?e.map((e,n)=>[e,t[n]]):t.map((t,n)=>[e[n],t]),Rt=e=>(t,n)=>({hasNext:!0,next:[t,e[n]],done:n>=e.length-1});export{V as $,Be as A,De as B,$e as C,We as D,qe as E,Me as F,be as G,Te as H,je as I,fe as J,ge as K,Ae as L,Fe as M,Pe as N,He as O,Ne as P,G as Q,ke as R,tt as S,Ye as T,we as U,Ee as V,Se as W,ce as X,de as Y,J as Z,ut as _,At as a,T as at,it as b,wt as c,g as ct,yt as d,c as dt,L as et,_t as f,o as ft,dt as g,ft as h,t as ht,Mt as i,D as it,ze as j,Ve as k,Ct as l,f as lt,mt as m,n as mt,Ft as n,M as nt,Ot as o,x as ot,ht as p,i as pt,me as q,Pt as r,O as rt,Dt as s,y as st,It as t,F as tt,xt as u,u as ut,ct as v,Ze as w,nt as x,ot as y,Oe as z};
@@ -1 +1 @@
1
- import{s as e}from"../rolldown-runtime.mjs";import{t}from"./is-plain-obj.mjs";import{t as n}from"./devlop.mjs";import{n as r}from"./mdast-util-from-markdown.mjs";import{t as i}from"./bail.mjs";import{t as a}from"./extend.mjs";import{t as o}from"./trough.mjs";import s from"node:path";import c from"node:process";import{fileURLToPath as l}from"node:url";var u=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let i=``,a={},o=!1;if(t&&(a=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?i=e:!a.cause&&e&&(o=!0,i=e.message,a.cause=e),!a.ruleId&&!a.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?a.ruleId=n:(a.source=n.slice(0,e),a.ruleId=n.slice(e+1))}if(!a.place&&a.ancestors&&a.ancestors){let e=a.ancestors[a.ancestors.length-1];e&&(a.place=e.position)}let s=a.place&&`start`in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=s?s.column:void 0,this.fatal=void 0,this.file,this.message=i,this.line=s?s.line:void 0,this.name=r(a.place)||`1:1`,this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=o&&a.cause&&typeof a.cause.stack==`string`?a.cause.stack:``,this.actual,this.expected,this.note,this.url}};u.prototype.file=``,u.prototype.name=``,u.prototype.reason=``,u.prototype.message=``,u.prototype.stack=``,u.prototype.column=void 0,u.prototype.line=void 0,u.prototype.ancestors=void 0,u.prototype.cause=void 0,u.prototype.fatal=void 0,u.prototype.place=void 0,u.prototype.ruleId=void 0,u.prototype.source=void 0;function d(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}const f=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`];var p=class{constructor(e){let t;t=e?d(e)?{path:e}:typeof e==`string`||_(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:c.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<f.length;){let e=f[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)f.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?s.basename(this.path):void 0}set basename(e){h(e,`basename`),m(e,`basename`),this.path=s.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?s.dirname(this.path):void 0}set dirname(e){g(this.basename,`dirname`),this.path=s.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?s.extname(this.path):void 0}set extname(e){if(m(e,`extname`),g(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=s.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){d(e)&&(e=l(e)),h(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?s.basename(this.path,this.extname):void 0}set stem(e){h(e,`stem`),m(e,`stem`),this.path=s.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new u(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function m(e,t){if(e&&e.includes(s.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+s.sep+"`")}function h(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function g(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function _(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}const v=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r});var y=e(a(),1);const b={}.hasOwnProperty,x=new class e extends v{constructor(){super(`copy`),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=o()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,y.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(w(`data`,this.frozen),this.namespace[e]=t,this):b.call(this.namespace,e)&&this.namespace[e]||void 0:e?(w(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=D(e),n=this.parser||this.Parser;return S(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),S(`process`,this.parser||this.Parser),C(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=D(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);k(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),S(`processSync`,this.parser||this.Parser),C(`processSync`,this.compiler||this.Compiler),this.process(e,r),E(`processSync`,`process`,t),n;function r(e,r){t=!0,i(e),n=r}}run(e,t,n){T(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=D(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,a),E(`runSync`,`run`,n),r;function a(e,t){i(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=D(t),r=this.compiler||this.Compiler;return C(`stringify`,r),T(e),r(e,n)}use(e,...n){let r=this.attachers,i=this.namespace;if(w(`use`,this.frozen),e!=null)if(typeof e==`function`)c(e,n);else if(typeof e==`object`)Array.isArray(e)?s(e):o(e);else throw TypeError("Expected usable value, not `"+e+"`");return this;function a(e){if(typeof e==`function`)c(e,[]);else if(typeof e==`object`)if(Array.isArray(e)){let[t,...n]=e;c(t,n)}else o(e);else throw TypeError("Expected usable value, not `"+e+"`")}function o(e){if(!(`plugins`in e)&&!(`settings`in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");s(e.plugins),e.settings&&(i.settings=(0,y.default)(!0,i.settings,e.settings))}function s(e){let t=-1;if(e!=null)if(Array.isArray(e))for(;++t<e.length;){let n=e[t];a(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}function c(e,n){let i=-1,a=-1;for(;++i<r.length;)if(r[i][0]===e){a=i;break}if(a===-1)r.push([e,...n]);else if(n.length>0){let[i,...o]=n,s=r[a][1];t(s)&&t(i)&&(i=(0,y.default)(!0,s,i)),r[a]=[e,i,...o]}}}}().freeze();function S(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function C(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function w(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function T(e){if(!t(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function E(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function D(e){return O(e)?e:new p(e)}function O(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function k(e){return typeof e==`string`||A(e)}function A(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}export{x as t};
1
+ import{s as e}from"../rolldown-runtime.mjs";import{t}from"./is-plain-obj.mjs";import"./devlop.mjs";import{n}from"./mdast-util-from-markdown.mjs";import{t as r}from"./bail.mjs";import{t as i}from"./extend.mjs";import{t as a}from"./trough.mjs";import o from"node:path";import s from"node:process";import{fileURLToPath as c}from"node:url";var l=class extends Error{constructor(e,t,r){super(),typeof t==`string`&&(r=t,t=void 0);let i=``,a={},o=!1;if(t&&(a=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?i=e:!a.cause&&e&&(o=!0,i=e.message,a.cause=e),!a.ruleId&&!a.source&&typeof r==`string`){let e=r.indexOf(`:`);e===-1?a.ruleId=r:(a.source=r.slice(0,e),a.ruleId=r.slice(e+1))}if(!a.place&&a.ancestors&&a.ancestors){let e=a.ancestors[a.ancestors.length-1];e&&(a.place=e.position)}let s=a.place&&`start`in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=s?s.column:void 0,this.fatal=void 0,this.file,this.message=i,this.line=s?s.line:void 0,this.name=n(a.place)||`1:1`,this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=o&&a.cause&&typeof a.cause.stack==`string`?a.cause.stack:``,this.actual,this.expected,this.note,this.url}};l.prototype.file=``,l.prototype.name=``,l.prototype.reason=``,l.prototype.message=``,l.prototype.stack=``,l.prototype.column=void 0,l.prototype.line=void 0,l.prototype.ancestors=void 0,l.prototype.cause=void 0,l.prototype.fatal=void 0,l.prototype.place=void 0,l.prototype.ruleId=void 0,l.prototype.source=void 0;function u(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}const d=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`];var f=class{constructor(e){let t;t=e?u(e)?{path:e}:typeof e==`string`||g(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:s.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<d.length;){let e=d[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)d.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?o.basename(this.path):void 0}set basename(e){m(e,`basename`),p(e,`basename`),this.path=o.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?o.dirname(this.path):void 0}set dirname(e){h(this.basename,`dirname`),this.path=o.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?o.extname(this.path):void 0}set extname(e){if(p(e,`extname`),h(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=o.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){u(e)&&(e=c(e)),m(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?o.basename(this.path,this.extname):void 0}set stem(e){m(e,`stem`),p(e,`stem`),this.path=o.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new l(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function p(e,t){if(e&&e.includes(o.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+o.sep+"`")}function m(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function h(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function g(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}const _=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r});var v=e(i(),1);const y={}.hasOwnProperty,b=new class e extends _{constructor(){super(`copy`),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=a()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,v.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(C(`data`,this.frozen),this.namespace[e]=t,this):y.call(this.namespace,e)&&this.namespace[e]||void 0:e?(C(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=E(e),n=this.parser||this.Parser;return x(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),x(`process`,this.parser||this.Parser),S(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=E(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);O(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),x(`processSync`,this.parser||this.Parser),S(`processSync`,this.compiler||this.Compiler),this.process(e,i),T(`processSync`,`process`,t),n;function i(e,i){t=!0,r(e),n=i}}run(e,t,n){w(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=E(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,i;return this.run(e,t,a),T(`runSync`,`run`,n),i;function a(e,t){r(e),i=t,n=!0}}stringify(e,t){this.freeze();let n=E(t),r=this.compiler||this.Compiler;return S(`stringify`,r),w(e),r(e,n)}use(e,...n){let r=this.attachers,i=this.namespace;if(C(`use`,this.frozen),e!=null)if(typeof e==`function`)c(e,n);else if(typeof e==`object`)Array.isArray(e)?s(e):o(e);else throw TypeError("Expected usable value, not `"+e+"`");return this;function a(e){if(typeof e==`function`)c(e,[]);else if(typeof e==`object`)if(Array.isArray(e)){let[t,...n]=e;c(t,n)}else o(e);else throw TypeError("Expected usable value, not `"+e+"`")}function o(e){if(!(`plugins`in e)&&!(`settings`in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");s(e.plugins),e.settings&&(i.settings=(0,v.default)(!0,i.settings,e.settings))}function s(e){let t=-1;if(e!=null)if(Array.isArray(e))for(;++t<e.length;){let n=e[t];a(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}function c(e,n){let i=-1,a=-1;for(;++i<r.length;)if(r[i][0]===e){a=i;break}if(a===-1)r.push([e,...n]);else if(n.length>0){let[i,...o]=n,s=r[a][1];t(s)&&t(i)&&(i=(0,v.default)(!0,s,i)),r[a]=[e,i,...o]}}}}().freeze();function x(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function S(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function C(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function w(e){if(!t(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function T(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function E(e){return D(e)?e:new f(e)}function D(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function O(e){return typeof e==`string`||k(e)}function k(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}export{b as t};
@@ -0,0 +1 @@
1
+ import{a as e,o as t,t as n}from"../rolldown-runtime.mjs";import{n as r,t as i}from"./isexe.mjs";var a=n(((n,a)=>{let{isexe:o,sync:s}=(i(),t(r)),{join:c,delimiter:l,sep:u,posix:d}=e(`path`),f=process.platform===`win32`,p=new RegExp(`[${d.sep}${u===d.sep?``:u}]`.replace(/(\\)/g,`\\$1`)),m=RegExp(`^\\.${p.source}`),h=e=>Object.assign(Error(`not found: ${e}`),{code:`ENOENT`}),g=(e,{path:t=process.env.PATH,pathExt:n=process.env.PATHEXT,delimiter:r=l})=>{let i=e.match(p)?[``]:[...f?[process.cwd()]:[],...(t||``).split(r)];if(f){let t=n||[`.EXE`,`.CMD`,`.BAT`,`.COM`].join(r),a=t.split(r).flatMap(e=>[e,e.toLowerCase()]);return e.includes(`.`)&&a[0]!==``&&a.unshift(``),{pathEnv:i,pathExt:a,pathExtExe:t}}return{pathEnv:i,pathExt:[``]}},_=(e,t)=>{let n=/^".*"$/.test(e)?e.slice(1,-1):e;return(!n&&m.test(t)?t.slice(0,2):``)+c(n,t)},v=async(e,t={})=>{let{pathEnv:n,pathExt:r,pathExtExe:i}=g(e,t),a=[];for(let s of n){let n=_(s,e);for(let e of r){let r=n+e;if(await o(r,{pathExt:i,ignoreErrors:!0})){if(!t.all)return r;a.push(r)}}}if(t.all&&a.length)return a;if(t.nothrow)return null;throw h(e)};a.exports=v,v.sync=(e,t={})=>{let{pathEnv:n,pathExt:r,pathExtExe:i}=g(e,t),a=[];for(let o of n){let n=_(o,e);for(let e of r){let r=n+e;if(s(r,{pathExt:i,ignoreErrors:!0})){if(!t.all)return r;a.push(r)}}}if(t.all&&a.length)return a;if(t.nothrow)return null;throw h(e)}}));export{a as t};