@likec4/mcp 1.57.0 → 1.59.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.
Files changed (78) hide show
  1. package/dist/chunks/libs/@chevrotain/cst-dts-gen.mjs +1 -0
  2. package/dist/chunks/libs/@chevrotain/regexp-to-ast.mjs +1 -1
  3. package/dist/chunks/libs/@hono/mcp.mjs +6 -6
  4. package/dist/chunks/libs/@hono/node-server.mjs +3 -1
  5. package/dist/chunks/libs/@logtape/logtape.mjs +4 -3
  6. package/dist/chunks/libs/@modelcontextprotocol/sdk.mjs +4 -11
  7. package/dist/chunks/libs/@ts-graphviz/core.mjs +1 -1
  8. package/dist/chunks/libs/chevrotain-allstar.mjs +2 -2
  9. package/dist/chunks/libs/chevrotain.mjs +33 -33
  10. package/dist/chunks/libs/chokidar.mjs +2 -2
  11. package/dist/chunks/libs/chroma-js.mjs +2 -2
  12. package/dist/chunks/libs/eventemitter3.mjs +1 -1
  13. package/dist/chunks/libs/graphology-dag.mjs +1 -1
  14. package/dist/chunks/libs/graphology.mjs +1 -1
  15. package/dist/chunks/libs/hast-util-sanitize.mjs +1 -1
  16. package/dist/chunks/libs/hast-util-to-html.mjs +2 -2
  17. package/dist/chunks/libs/hono.mjs +1 -1
  18. package/dist/chunks/libs/immer.mjs +1 -1
  19. package/dist/chunks/libs/langium.mjs +9 -22
  20. package/dist/chunks/libs/markdown-table.mjs +1 -1
  21. package/dist/chunks/libs/mdast-util-find-and-replace.mjs +1 -1
  22. package/dist/chunks/libs/mdast-util-from-markdown.mjs +2 -2
  23. package/dist/chunks/libs/mdast-util-gfm.mjs +5 -5
  24. package/dist/chunks/libs/mdast-util-to-hast.mjs +2 -2
  25. package/dist/chunks/libs/merge-error-cause.mjs +2 -2
  26. package/dist/chunks/libs/micromark-extension-gfm.mjs +1 -1
  27. package/dist/chunks/libs/mnemonist.mjs +1 -1
  28. package/dist/chunks/libs/nano-spawn.mjs +2 -2
  29. package/dist/chunks/libs/p-queue.mjs +1 -1
  30. package/dist/chunks/libs/picomatch.mjs +1 -0
  31. package/dist/chunks/libs/pretty-ms.mjs +1 -1
  32. package/dist/chunks/libs/remark-github-blockquote-alert.mjs +1 -1
  33. package/dist/chunks/libs/remeda.mjs +1 -1
  34. package/dist/chunks/libs/ufo.mjs +1 -1
  35. package/dist/chunks/libs/unified.mjs +1 -1
  36. package/dist/chunks/libs/unstorage.mjs +1 -1
  37. package/dist/chunks/rolldown-runtime.mjs +1 -1
  38. package/dist/chunks/src.mjs +124 -104
  39. package/dist/cli.mjs +5 -1
  40. package/package.json +23 -23
  41. package/dist/chunks/libs/@chevrotain/gast.mjs +0 -1
  42. package/dist/chunks/libs/@chevrotain/utils.mjs +0 -1
  43. package/dist/chunks/libs/@lume/kiwi.mjs +0 -1
  44. package/dist/chunks/libs/bail.mjs +0 -1
  45. package/dist/chunks/libs/ccount.mjs +0 -1
  46. package/dist/chunks/libs/character-entities-html4.mjs +0 -1
  47. package/dist/chunks/libs/character-entities-legacy.mjs +0 -1
  48. package/dist/chunks/libs/citty.mjs +0 -5
  49. package/dist/chunks/libs/comma-separated-tokens.mjs +0 -1
  50. package/dist/chunks/libs/decode-named-character-reference.mjs +0 -1
  51. package/dist/chunks/libs/defu.mjs +0 -1
  52. package/dist/chunks/libs/destr.mjs +0 -1
  53. package/dist/chunks/libs/devlop.mjs +0 -1
  54. package/dist/chunks/libs/escape-string-regexp.mjs +0 -1
  55. package/dist/chunks/libs/extend.mjs +0 -1
  56. package/dist/chunks/libs/fdir.mjs +0 -1
  57. package/dist/chunks/libs/is-error-instance.mjs +0 -1
  58. package/dist/chunks/libs/is-plain-obj.mjs +0 -1
  59. package/dist/chunks/libs/isexe.mjs +0 -1
  60. package/dist/chunks/libs/json5.mjs +0 -14
  61. package/dist/chunks/libs/longest-streak.mjs +0 -1
  62. package/dist/chunks/libs/natural-compare-lite.mjs +0 -9
  63. package/dist/chunks/libs/ohash.mjs +0 -1
  64. package/dist/chunks/libs/p-limit.mjs +0 -1
  65. package/dist/chunks/libs/p-timeout.mjs +0 -1
  66. package/dist/chunks/libs/parse-ms.mjs +0 -1
  67. package/dist/chunks/libs/rehype-sanitize.mjs +0 -1
  68. package/dist/chunks/libs/rehype-stringify.mjs +0 -1
  69. package/dist/chunks/libs/remark-gfm.mjs +0 -1
  70. package/dist/chunks/libs/remark-parse.mjs +0 -1
  71. package/dist/chunks/libs/safe-stringify.mjs +0 -1
  72. package/dist/chunks/libs/strip-indent.mjs +0 -1
  73. package/dist/chunks/libs/tinyrainbow.mjs +0 -1
  74. package/dist/chunks/libs/trough.mjs +0 -1
  75. package/dist/chunks/libs/ts-graphviz.mjs +0 -1
  76. package/dist/chunks/libs/unctx.mjs +0 -1
  77. package/dist/chunks/libs/which.mjs +0 -1
  78. package/dist/chunks/libs/word-wrap.mjs +0 -12
@@ -1,2 +1,2 @@
1
- import{i as e}from"../rolldown-runtime.mjs";import{t}from"./is-plain-obj.mjs";import{t as n}from"./is-error-instance.mjs";const normalizeDescriptors=e=>{r.forEach(t=>{i(e,t)})},r=[`name`,`message`,`stack`,`cause`,`errors`],i=e((e,t)=>{let n=getDescriptor(e,t);if(n!==void 0){if(isReadonlyGetter(n)){a(e,t,e[t]);return}isInvalidDescriptor(n)&&setErrorDescriptor(e,t,n)}},`normalizeDescriptor`),getDescriptor=(e,t)=>{let n=Object.getOwnPropertyDescriptor(e,t);if(n!==void 0)return n;let r=Object.getPrototypeOf(e);return r===null?void 0:getDescriptor(r,t)},isReadonlyGetter=({get:e,set:t})=>e!==void 0&&t===void 0,isInvalidDescriptor=({enumerable:e,writable:t})=>e||!t,a=e((e,t,n)=>{setErrorDescriptor(e,t,{value:n})},`setErrorProperty`),setErrorDescriptor=(e,t,n)=>{Object.defineProperty(e,t,{...n,...`get`in n||`set`in n?{}:{writable:!0},enumerable:!1,configurable:!0})},normalizeAggregate=(e,t)=>{Array.isArray(e.errors)?a(e,`errors`,e.errors.filter(isDefined).map(t).filter(Boolean)):isAggregateError(e)?a(e,`errors`,[]):e.errors!==void 0&&deleteAggregateErrors(e)},isDefined=e=>e!==void 0,isAggregateError=e=>`AggregateError`in globalThis&&(e.name===`AggregateError`||e instanceof AggregateError),deleteAggregateErrors=e=>{delete e.errors,e.errors!==void 0&&a(e,`errors`,[])},normalizeCause=(e,t)=>{if(!(`cause`in e))return;let n=e.cause===void 0?e.cause:t(e.cause);n===void 0?delete e.cause:a(e,`cause`,n)},isNonModifiableError=e=>!Object.isExtensible(e)||r.some(t=>isNonConfigurableProp(e,t)||isThrowingProp(e,t)),isNonConfigurableProp=(e,t)=>{let n=Object.getOwnPropertyDescriptor(e,t);return n!==void 0&&!n.configurable},isThrowingProp=(e,t)=>{try{return e[t],!1}catch{return!0}},setStack=e=>{a(e,`stack`,o(e.message,e.name))},o=e((e=``,t=`Error`)=>{let{stack:n}=new(getErrorClass(t))(e);return typeof n==`string`&&n!==``?n:`${t}: ${e}`},`getStack`),getErrorClass=e=>{let t={value:e,enumerable:!1,writable:!0,configurable:!0},n=Object.defineProperty(class extends Error{},"name",t);return Object.defineProperty(n.prototype,"name",t),n},copyObject=e=>{let t={};for(let n of getPropsToCopy(e))try{let r=e[n],{enumerable:i,configurable:a,writable:o=!0}=getDescriptor(e,n);Object.defineProperty(t,n,{value:r,enumerable:i,configurable:a,writable:o})}catch{}return t},getPropsToCopy=e=>{let t=getOwnKeys(e);for(let n of r)isInheritedProp(e,n)&&t.push(n);return t},getOwnKeys=e=>{try{return Reflect.ownKeys(e)}catch{return[]}},isInheritedProp=(e,t)=>{try{return t in e&&!Object.hasOwn(e,t)}catch{return!1}},objectifyError=e=>{let{name:t,message:n,stack:r,cause:i,errors:a,...o}=copyObject(e),c=s(n,o),l=newError(t,c);return n===c&&assignObjectProps(l,o),Object.entries({name:t,stack:r,cause:i,errors:a}).forEach(([e,t])=>{setNewErrorProperty(l,e,t)}),r===void 0&&setStack(l),l},s=e((e,t)=>typeof e==`string`&&e!==``?e:truncateMessage(safeJsonStringify(t)),`getMessage`),safeJsonStringify=e=>{try{return JSON.stringify(e)}catch{return safeStringify(e)}},safeStringify=e=>{try{return String(e)}catch{return`Invalid error`}},truncateMessage=e=>e.length<c?e:`${e.slice(0,c)}...`,c=1e3,newError=(e,t)=>e===`AggregateError`&&`AggregateError`in globalThis?AggregateError([],t):e in l?new l[e](t):Error(t),l={Error,ReferenceError,TypeError,SyntaxError,RangeError,URIError,EvalError},assignObjectProps=(e,t)=>{for(let n in t)n in e||(e[n]=t[n])},setNewErrorProperty=(e,t,n)=>{n!==void 0&&a(e,t,n)},stringifyError=e=>{try{let t=Error(String(e));return setStack(t),t}catch(e){return e}},{toString:u}=Object.prototype,createError=e=>isErrorPlainObj(e)?objectifyError(e):n(e)?isInvalidError(e)?objectifyError(e):e:stringifyError(e),isErrorPlainObj=e=>{try{return t(e)}catch{return!1}},isInvalidError=e=>isProxy(e)||isNonModifiableError(e)||hasInvalidConstructor(e),isProxy=e=>{try{return u.call(e)===`[object Object]`}catch{return!0}},hasInvalidConstructor=e=>typeof e.constructor!=`function`||typeof e.constructor.name!=`string`||e.constructor.name===``||e.constructor.prototype!==Object.getPrototypeOf(e),normalizeException=(e,{shallow:t=!1}={})=>recurseException(e,[],t),recurseException=(e,t,n)=>{if(t.includes(e))return;let r=n?identity:r=>recurseException(r,[...t,e],n),i=createError(e);return normalizeProps(i,r),i},identity=e=>e,normalizeProps=(e,t)=>{normalizeName(e),normalizeMessage(e),normalizeStack(e),normalizeCause(e,t),normalizeAggregate(e,t),normalizeDescriptors(e)},normalizeName=e=>{if(d(e.name))return;let t=Object.getPrototypeOf(e).name;a(e,`name`,d(t)?t:e.constructor.name)},normalizeMessage=e=>{d(e.message)||a(e,`message`,``)},normalizeStack=e=>{d(e.stack)||setStack(e)},d=e(e=>typeof e==`string`&&e!==``,`isDefinedString`),f=e((e,t,n=e.name)=>{if(validateErrorClass(t),typeof n!=`string`)throw TypeError(`currentName must be a string: ${n}`);return n},`normalizeArgs`),validateErrorClass=e=>{if(!isClass(e))throw TypeError(`ErrorClass must be a class: ${e}`);if(!isErrorClass(e.prototype))throw TypeError(`ErrorClass must inherit from Error: ${e}`);if(!hasConstructor(e))throw TypeError(`ErrorClass must be have a valid constructor: ${e}`)},isClass=e=>typeof e==`function`&&typeof e.prototype==`object`&&e.prototype!==null,isErrorClass=e=>e!==null&&(e.name===`Error`||isErrorClass(Object.getPrototypeOf(e))),hasConstructor=e=>typeof e.prototype.constructor==`function`,p=e((e,t,n)=>{Object.defineProperty(e,t,{value:n,enumerable:!1,writable:!0,configurable:!0})},`setNonEnumProp`),updatePrototype=(e,t)=>{Object.getPrototypeOf(e)!==t.prototype&&(setPrototype(e,t),deleteOwnProperty(e,`constructor`),fixName(e,t))},setPrototype=(e,t)=>{Object.setPrototypeOf(e,t.prototype)},fixName=(e,t)=>{deleteOwnProperty(e,`name`);let n=getClassName(t.prototype);e.name!==n&&p(e,`name`,n)},getClassName=e=>getPrototypeName(e)??getConstructorName(e)??getClassName(Object.getPrototypeOf(e)),getPrototypeName=e=>Object.hasOwn(e,`name`)&&isDefinedString(e.name)?e.name:void 0,getConstructorName=e=>typeof e.constructor==`function`&&isDefinedString(e.constructor.name)?e.constructor.name:void 0,isDefinedString=e=>typeof e==`string`&&e!==``,deleteOwnProperty=(e,t)=>{Object.hasOwn(e,t)&&delete e[t]},m=e((e,t)=>{shouldUpdateStack(e,t)&&p(e,`stack`,g(e,t))},`updateStack`),shouldUpdateStack=(e,t)=>t!==e.name&&t!==``&&e.stack.includes(t)&&stackIncludesName(),stackIncludesName=()=>{class StackError extends Error{}let e={value:h,enumerable:!1,writable:!0,configurable:!0};Object.defineProperty(StackError,"name",e),Object.defineProperty(StackError.prototype,"name",e);let{stack:t}=new StackError(``);return typeof t==`string`&&t.includes(h)},h=`SetErrorClassError`,g=e(({name:e,stack:t},n)=>{if(t.startsWith(`${n}: `))return t.replace(n,e);let[r,i]=_(n,e).find(([e])=>t.includes(e));return t.replace(r,i)},`getStack`),_=e((e,t)=>[[`\n${e}: `,`\n${t}: `],[`${e}: `,`${t}: `],[`${e} `,`${t} `],[e,t]],`getReplacers`),setErrorClass=(e,t,n)=>{let r=normalizeException(e),i=f(r,t,n);return updatePrototype(r,t),m(r,i),r},mergeDescriptors=(e,t)=>t.configurable===!1?mergeNonConfig(e,t):mergeConfig(e,t),mergeNonConfig=(e,t)=>({...t,...getNonConfigWritable(e,t),...getNonConfigValue(e,t)}),getNonConfigWritable=(e,t)=>t.writable===!0&&e.writable===!1?{writable:!1}:{},getNonConfigValue=(e,t)=>e.hasValue&&`value`in t&&t.writable===!0?{value:e.value}:{},mergeConfig=(e,t)=>{let n=mergeDescriptor(e.enumerable,t.enumerable,!0),r=mergeDescriptor(e.writable,t.writable,!0),i=mergeDescriptor(e.configurable,t.configurable,!0);return{...mergeValue(e,t,r),enumerable:n,configurable:i}},mergeValue=(e,t,n)=>e.hasValue?{value:e.value,writable:n}:!hasGetSet(e)&&!hasGetSet(t)?{value:t.value,writable:n}:{get:mergeDescriptor(e.get,t.get),set:mergeDescriptor(e.set,t.set)},hasGetSet=({get:e,set:t})=>e!==void 0||t!==void 0,mergeDescriptor=(e,t,n)=>e??t??n,normalizeInput=(e,t,n)=>{if(!isAnyObj(e))throw TypeError(`Argument must be an object: ${e}`);if(!isValidKey(t))throw TypeError(`Property key must be a string, a symbol or an integer: ${t}`);return normalizeDescriptor(n)},isAnyObj=e=>typeof e==`object`&&!!e,isValidKey=e=>{let t=typeof e;return t===`string`||t===`symbol`||t===`number`},normalizeDescriptor=e=>{if(!t(e))throw TypeError(`Descriptor must be a plain object: ${e}`);let{enumerable:n,writable:r,configurable:i,value:a,get:o,set:s,...c}=e,l=`value`in e;return validateDescriptor({enumerable:n,writable:r,configurable:i,get:o,set:s,unknownProps:c,hasValue:l}),{enumerable:n,writable:r,configurable:i,value:a,get:o,set:s,hasValue:l}},validateDescriptor=({enumerable:e,writable:t,configurable:n,get:r,set:i,unknownProps:a,hasValue:o})=>{validateGetSet(o,r,`get`),validateGetSet(o,i,`set`),validateBoolean(e,`enumerable`),validateBoolean(t,`writable`),validateBoolean(n,`configurable`),validateUnknownProps(a)},validateGetSet=(e,t,n)=>{if(validateFunction(t,n),e&&t!==void 0)throw TypeError(`Descriptor property "value" and "${n}" must not both be defined: ${t}`)},validateFunction=(e,t)=>{if(e!==void 0&&typeof e!=`function`)throw TypeError(`Descriptor property "${t}" must be a function: ${e}`)},validateBoolean=(e,t)=>{if(e!==void 0&&typeof e!=`boolean`)throw TypeError(`Descriptor property "${t}" must be a boolean: ${e}`)},validateUnknownProps=e=>{let[t]=Object.keys(e);if(t!==void 0)throw TypeError(`Unknown descriptor property "${t}": ${e[t]}`)},redefineProperty=(e,t,n)=>(setProperty(e,t,mergeDescriptors(normalizeInput(e,t,n),getCurrentDescriptor(e,t))),e),getCurrentDescriptor=(e,t)=>{let n=Object.getOwnPropertyDescriptor(e,t);if(n!==void 0)return n;let r=Object.getPrototypeOf(e);return r===null?{}:getCurrentDescriptor(r,t)},setProperty=(e,t,n)=>{try{Object.defineProperty(e,t,n)}catch{}},assignProp=(e,t,n)=>{if(n!==void 0)return setProp(e,t,n);try{delete e[t]}catch{}if(e[t]!==void 0)return setProp(e,t)},setProp=(e,t,n)=>{redefineProperty(e,t,{value:n,...getNonEnum(t)})},getNonEnum=e=>typeof e==`string`&&e.startsWith(`_`)?{enumerable:!1}:{},normalizeOptions=(e,n,r={})=>{if(validateErrorOrObject(e,`First argument`),validateErrorOrObject(n,`Second argument`),!t(r))throw TypeError(`Options must be a plain object: ${r}`);let{soft:i=!1}=r;if(typeof i!=`boolean`)throw TypeError(`Option "soft" must be a boolean: ${i}`);return{soft:i}},validateErrorOrObject=(e,t)=>{if(e===void 0)throw TypeError(`${t} is required.`);if(!isErrorOrObject(e))throw TypeError(`${t} must be a plain object or an error: ${e}`)},isErrorOrObject=e=>t(e)||n(e),shouldSkipProp=({error:e,props:t,propName:n,soft:r})=>isIgnoredPropName(n)||!b.call(t,n)||r&&e[n]!==void 0,isIgnoredPropName=e=>e in v||y.has(e),v=Error(`check`),y=new Set([`prototype`,`errors`,`cause`]),{propertyIsEnumerable:b}=Object.prototype,setErrorProps=(e,t,n)=>{let{soft:r}=normalizeOptions(e,t,n);for(let n of Reflect.ownKeys(t))setErrorProp({error:e,props:t,propName:n,soft:r});return e},setErrorProp=({error:e,props:t,propName:n,soft:r})=>{shouldSkipProp({error:e,props:t,propName:n,soft:r})||assignProp(e,n,t[n])},setErrorProperty=(e,t,n)=>{Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!1,configurable:!0})},mergeAggregateCauses=(e,t)=>{e.errors!==void 0&&setErrorProperty(e,`errors`,e.errors.map(e=>t(e).error).filter(Boolean))},mergeAggregateErrors=({target:e,source:t,parent:n,child:r})=>{if(!hasErrors(e)){mergeSourceErrors(e,t);return}hasErrors(t)&&setErrorProperty(e,`errors`,[...r.errors,...n.errors])},mergeSourceErrors=(e,t)=>{t.errors!==void 0&&setErrorProperty(e,`errors`,t.errors)},hasErrors=e=>e.errors!==void 0&&e.errors.length!==0,normalizeArgs=(e,t,n=e.message)=>{if(typeof t!=`string`)throw TypeError(`newMessage must be a string: ${t}`);if(typeof n!=`string`)throw TypeError(`currentMessage must be a string: ${n}`);return n},x=e(({name:e,stack:t},n,r)=>r!==``&&t.includes(r)?replaceMessage({name:e,stack:t,newMessage:n,currentMessage:r}):insertMessage(e,t,n),`getStack`),replaceMessage=({name:e,stack:t,newMessage:n,currentMessage:r})=>{let[i,a]=getReplacers(e,n,r).find(([e])=>t.includes(e));return t.replace(i,a)},getReplacers=(e,t,n)=>[[`${e}: ${n}`,`${e}: ${t}`],[`: ${n}`,`: ${t}`],[`\n${n}`,`\n${t}`],[` ${n}`,` ${t}`],[n,t]],insertMessage=(e,t,n)=>{let r=`${e}: `,i=n.trimEnd();return t===e||t.startsWith(`${e}\n`)?t.replace(e,`${r}${i}`):t.startsWith(r)?t.replace(r,`${r}${i}\n`):`${r}${i}\n${t}`},setErrorMessage=(e,t,n)=>{let r=normalizeException(e),i=normalizeArgs(r,t,n);return setNonEnumProp(r,`message`,t),updateStack(r,t,i),r},updateStack=(e,t,n)=>{t===n||!stackIncludesMessage()||setNonEnumProp(e,`stack`,x(e,t,n))},stackIncludesMessage=()=>{let{stack:e}=Error(S);return typeof e==`string`&&e.includes(S)},S=`set-error-message test message`,setNonEnumProp=(e,t,n)=>{Object.defineProperty(e,t,{value:n,enumerable:!1,writable:!0,configurable:!0})},wrapErrorMessage=(e,t,n)=>{if(typeof t!=`string`)throw TypeError(`Second argument must be a message string: ${t}`);let r=normalizeException(e);return setErrorMessage(r,getMessage(t,r.message),n)},getMessage=(e,t)=>{let n=e.trim(),r=t.trim();return n===``?r:r===``?n:concatMessages(n,r,e)},concatMessages=(e,t,n)=>e.endsWith(C)?n.endsWith(w)?`${e}\n${t}`:`${e} ${t}`:`${t}\n${e}`,C=`:`,w=`
2
- `,mergeMessage=({parent:e,child:t,target:n,stackError:r})=>{let i=e.message,a=r.message;return n.message=t.message,wrapErrorMessage(n,i,a)},hasStack=(e,t)=>getStack(e)===t,getStack=e=>typeof e==`object`&&e?e.stack:void 0,mergeStack=({wrap:e,target:t,source:n,childHasStack:r})=>e===r?t:(setErrorProperty(t,`stack`,n.stack),n),getWrap=e=>{let{wrap:t,name:n}=e;return typeof t==`boolean`?(Object.hasOwn(e,`wrap`)&&delete e.wrap,t):n===`Error`},mergeErrorCause=e=>mergeError(e,[]).error,mergeError=(e,t)=>{if(t.includes(e))return{};let recurse=n=>mergeError(n,[...t,e]),n=getStack(e),r=normalizeException(e,{shallow:!0}),i=hasStack(r,n);mergeAggregateCauses(r,recurse);let{parent:a,childHasStack:o}=mergeCause(r,recurse);return{error:a,errorHasStack:i||o}},mergeCause=(e,t)=>{let n=getWrap(e);if(e.cause===void 0)return{parent:e,childHasStack:!1};let{error:r,errorHasStack:i}=t(e.cause);return delete e.cause,{parent:mergeChild({parent:e,child:r,childHasStack:i,wrap:n}),childHasStack:i}},mergeChild=({parent:e,child:t,childHasStack:n,wrap:r})=>{if(t===void 0)return e;let[i,a]=r?[t,e]:[e,t],o=mergeStack({wrap:r,target:i,source:a,childHasStack:n}),s=mergeMessage({parent:e,child:t,target:setErrorClass(i,i.constructor,o.name),stackError:o});return mergeAggregateErrors({target:s,source:a,parent:e,child:t}),setErrorProps(s,a,{soft:!r})};export{wrapErrorMessage as n,mergeErrorCause as t};
1
+ import{r as e}from"../rolldown-runtime.mjs";function isPlainObject(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}const normalizeDescriptors=e=>{t.forEach(t=>{n(e,t)})},t=[`name`,`message`,`stack`,`cause`,`errors`],n=e((e,t)=>{let n=getDescriptor(e,t);if(n!==void 0){if(isReadonlyGetter(n)){r(e,t,e[t]);return}isInvalidDescriptor(n)&&setErrorDescriptor(e,t,n)}},`normalizeDescriptor`),getDescriptor=(e,t)=>{let n=Object.getOwnPropertyDescriptor(e,t);if(n!==void 0)return n;let r=Object.getPrototypeOf(e);return r===null?void 0:getDescriptor(r,t)},isReadonlyGetter=({get:e,set:t})=>e!==void 0&&t===void 0,isInvalidDescriptor=({enumerable:e,writable:t})=>e||!t,r=e((e,t,n)=>{setErrorDescriptor(e,t,{value:n})},`setErrorProperty`),setErrorDescriptor=(e,t,n)=>{Object.defineProperty(e,t,{...n,...`get`in n||`set`in n?{}:{writable:!0},enumerable:!1,configurable:!0})},normalizeAggregate=(e,t)=>{Array.isArray(e.errors)?r(e,`errors`,e.errors.filter(isDefined).map(t).filter(Boolean)):isAggregateError(e)?r(e,`errors`,[]):e.errors!==void 0&&deleteAggregateErrors(e)},isDefined=e=>e!==void 0,isAggregateError=e=>`AggregateError`in globalThis&&(e.name===`AggregateError`||e instanceof AggregateError),deleteAggregateErrors=e=>{delete e.errors,e.errors!==void 0&&r(e,`errors`,[])},normalizeCause=(e,t)=>{if(!(`cause`in e))return;let n=e.cause===void 0?e.cause:t(e.cause);n===void 0?delete e.cause:r(e,`cause`,n)},isErrorInstance=e=>isInstanceOfError(e)||hasErrorTag(e),isInstanceOfError=e=>{try{return e instanceof Error}catch{return!1}},hasErrorTag=e=>{try{return i.has(Object.prototype.toString.call(e))}catch{return!1}},i=new Set([`[object Error]`,`[object DOMException]`,`[object DOMError]`,`[object Exception]`]),isNonModifiableError=e=>!Object.isExtensible(e)||t.some(t=>isNonConfigurableProp(e,t)||isThrowingProp(e,t)),isNonConfigurableProp=(e,t)=>{let n=Object.getOwnPropertyDescriptor(e,t);return n!==void 0&&!n.configurable},isThrowingProp=(e,t)=>{try{return e[t],!1}catch{return!0}},setStack=e=>{r(e,`stack`,a(e.message,e.name))},a=e((e=``,t=`Error`)=>{let{stack:n}=new(getErrorClass(t))(e);return typeof n==`string`&&n!==``?n:`${t}: ${e}`},`getStack`),getErrorClass=e=>{let t={value:e,enumerable:!1,writable:!0,configurable:!0},n=Object.defineProperty(class extends Error{},"name",t);return Object.defineProperty(n.prototype,"name",t),n},copyObject=e=>{let t={};for(let n of getPropsToCopy(e))try{let r=e[n],{enumerable:i,configurable:a,writable:o=!0}=getDescriptor(e,n);Object.defineProperty(t,n,{value:r,enumerable:i,configurable:a,writable:o})}catch{}return t},getPropsToCopy=e=>{let n=getOwnKeys(e);for(let r of t)isInheritedProp(e,r)&&n.push(r);return n},getOwnKeys=e=>{try{return Reflect.ownKeys(e)}catch{return[]}},isInheritedProp=(e,t)=>{try{return t in e&&!Object.hasOwn(e,t)}catch{return!1}},objectifyError=e=>{let{name:t,message:n,stack:r,cause:i,errors:a,...s}=copyObject(e),c=o(n,s),l=newError(t,c);return n===c&&assignObjectProps(l,s),Object.entries({name:t,stack:r,cause:i,errors:a}).forEach(([e,t])=>{setNewErrorProperty(l,e,t)}),r===void 0&&setStack(l),l},o=e((e,t)=>typeof e==`string`&&e!==``?e:truncateMessage(safeJsonStringify(t)),`getMessage`),safeJsonStringify=e=>{try{return JSON.stringify(e)}catch{return safeStringify(e)}},safeStringify=e=>{try{return String(e)}catch{return`Invalid error`}},truncateMessage=e=>e.length<s?e:`${e.slice(0,s)}...`,s=1e3,newError=(e,t)=>e===`AggregateError`&&`AggregateError`in globalThis?AggregateError([],t):e in c?new c[e](t):Error(t),c={Error,ReferenceError,TypeError,SyntaxError,RangeError,URIError,EvalError},assignObjectProps=(e,t)=>{for(let n in t)n in e||(e[n]=t[n])},setNewErrorProperty=(e,t,n)=>{n!==void 0&&r(e,t,n)},stringifyError=e=>{try{let t=Error(String(e));return setStack(t),t}catch(e){return e}},{toString:l}=Object.prototype,createError=e=>isErrorPlainObj(e)?objectifyError(e):isErrorInstance(e)?isInvalidError(e)?objectifyError(e):e:stringifyError(e),isErrorPlainObj=e=>{try{return isPlainObject(e)}catch{return!1}},isInvalidError=e=>isProxy(e)||isNonModifiableError(e)||hasInvalidConstructor(e),isProxy=e=>{try{return l.call(e)===`[object Object]`}catch{return!0}},hasInvalidConstructor=e=>typeof e.constructor!=`function`||typeof e.constructor.name!=`string`||e.constructor.name===``||e.constructor.prototype!==Object.getPrototypeOf(e),normalizeException=(e,{shallow:t=!1}={})=>recurseException(e,[],t),recurseException=(e,t,n)=>{if(t.includes(e))return;let r=n?identity:r=>recurseException(r,[...t,e],n),i=createError(e);return normalizeProps(i,r),i},identity=e=>e,normalizeProps=(e,t)=>{normalizeName(e),normalizeMessage(e),normalizeStack(e),normalizeCause(e,t),normalizeAggregate(e,t),normalizeDescriptors(e)},normalizeName=e=>{if(u(e.name))return;let t=Object.getPrototypeOf(e).name;r(e,`name`,u(t)?t:e.constructor.name)},normalizeMessage=e=>{u(e.message)||r(e,`message`,``)},normalizeStack=e=>{u(e.stack)||setStack(e)},u=e(e=>typeof e==`string`&&e!==``,`isDefinedString`),d=e((e,t,n=e.name)=>{if(validateErrorClass(t),typeof n!=`string`)throw TypeError(`currentName must be a string: ${n}`);return n},`normalizeArgs`),validateErrorClass=e=>{if(!isClass(e))throw TypeError(`ErrorClass must be a class: ${e}`);if(!isErrorClass(e.prototype))throw TypeError(`ErrorClass must inherit from Error: ${e}`);if(!hasConstructor(e))throw TypeError(`ErrorClass must be have a valid constructor: ${e}`)},isClass=e=>typeof e==`function`&&typeof e.prototype==`object`&&e.prototype!==null,isErrorClass=e=>e!==null&&(e.name===`Error`||isErrorClass(Object.getPrototypeOf(e))),hasConstructor=e=>typeof e.prototype.constructor==`function`,f=e((e,t,n)=>{Object.defineProperty(e,t,{value:n,enumerable:!1,writable:!0,configurable:!0})},`setNonEnumProp`),updatePrototype=(e,t)=>{Object.getPrototypeOf(e)!==t.prototype&&(setPrototype(e,t),deleteOwnProperty(e,`constructor`),fixName(e,t))},setPrototype=(e,t)=>{Object.setPrototypeOf(e,t.prototype)},fixName=(e,t)=>{deleteOwnProperty(e,`name`);let n=getClassName(t.prototype);e.name!==n&&f(e,`name`,n)},getClassName=e=>getPrototypeName(e)??getConstructorName(e)??getClassName(Object.getPrototypeOf(e)),getPrototypeName=e=>Object.hasOwn(e,`name`)&&isDefinedString(e.name)?e.name:void 0,getConstructorName=e=>typeof e.constructor==`function`&&isDefinedString(e.constructor.name)?e.constructor.name:void 0,isDefinedString=e=>typeof e==`string`&&e!==``,deleteOwnProperty=(e,t)=>{Object.hasOwn(e,t)&&delete e[t]},p=e((e,t)=>{shouldUpdateStack(e,t)&&f(e,`stack`,h(e,t))},`updateStack`),shouldUpdateStack=(e,t)=>t!==e.name&&t!==``&&e.stack.includes(t)&&stackIncludesName(),stackIncludesName=()=>{class StackError extends Error{}let e={value:m,enumerable:!1,writable:!0,configurable:!0};Object.defineProperty(StackError,"name",e),Object.defineProperty(StackError.prototype,"name",e);let{stack:t}=new StackError(``);return typeof t==`string`&&t.includes(m)},m=`SetErrorClassError`,h=e(({name:e,stack:t},n)=>{if(t.startsWith(`${n}: `))return t.replace(n,e);let[r,i]=g(n,e).find(([e])=>t.includes(e));return t.replace(r,i)},`getStack`),g=e((e,t)=>[[`\n${e}: `,`\n${t}: `],[`${e}: `,`${t}: `],[`${e} `,`${t} `],[e,t]],`getReplacers`),setErrorClass=(e,t,n)=>{let r=normalizeException(e),i=d(r,t,n);return updatePrototype(r,t),p(r,i),r},mergeDescriptors=(e,t)=>t.configurable===!1?mergeNonConfig(e,t):mergeConfig(e,t),mergeNonConfig=(e,t)=>({...t,...getNonConfigWritable(e,t),...getNonConfigValue(e,t)}),getNonConfigWritable=(e,t)=>t.writable===!0&&e.writable===!1?{writable:!1}:{},getNonConfigValue=(e,t)=>e.hasValue&&`value`in t&&t.writable===!0?{value:e.value}:{},mergeConfig=(e,t)=>{let n=mergeDescriptor(e.enumerable,t.enumerable,!0),r=mergeDescriptor(e.writable,t.writable,!0),i=mergeDescriptor(e.configurable,t.configurable,!0);return{...mergeValue(e,t,r),enumerable:n,configurable:i}},mergeValue=(e,t,n)=>e.hasValue?{value:e.value,writable:n}:!hasGetSet(e)&&!hasGetSet(t)?{value:t.value,writable:n}:{get:mergeDescriptor(e.get,t.get),set:mergeDescriptor(e.set,t.set)},hasGetSet=({get:e,set:t})=>e!==void 0||t!==void 0,mergeDescriptor=(e,t,n)=>e??t??n,normalizeInput=(e,t,n)=>{if(!isAnyObj(e))throw TypeError(`Argument must be an object: ${e}`);if(!isValidKey(t))throw TypeError(`Property key must be a string, a symbol or an integer: ${t}`);return normalizeDescriptor(n)},isAnyObj=e=>typeof e==`object`&&!!e,isValidKey=e=>{let t=typeof e;return t===`string`||t===`symbol`||t===`number`},normalizeDescriptor=e=>{if(!isPlainObject(e))throw TypeError(`Descriptor must be a plain object: ${e}`);let{enumerable:t,writable:n,configurable:r,value:i,get:a,set:o,...s}=e,c=`value`in e;return validateDescriptor({enumerable:t,writable:n,configurable:r,get:a,set:o,unknownProps:s,hasValue:c}),{enumerable:t,writable:n,configurable:r,value:i,get:a,set:o,hasValue:c}},validateDescriptor=({enumerable:e,writable:t,configurable:n,get:r,set:i,unknownProps:a,hasValue:o})=>{validateGetSet(o,r,`get`),validateGetSet(o,i,`set`),validateBoolean(e,`enumerable`),validateBoolean(t,`writable`),validateBoolean(n,`configurable`),validateUnknownProps(a)},validateGetSet=(e,t,n)=>{if(validateFunction(t,n),e&&t!==void 0)throw TypeError(`Descriptor property "value" and "${n}" must not both be defined: ${t}`)},validateFunction=(e,t)=>{if(e!==void 0&&typeof e!=`function`)throw TypeError(`Descriptor property "${t}" must be a function: ${e}`)},validateBoolean=(e,t)=>{if(e!==void 0&&typeof e!=`boolean`)throw TypeError(`Descriptor property "${t}" must be a boolean: ${e}`)},validateUnknownProps=e=>{let[t]=Object.keys(e);if(t!==void 0)throw TypeError(`Unknown descriptor property "${t}": ${e[t]}`)},redefineProperty=(e,t,n)=>{let r=mergeDescriptors(normalizeInput(e,t,n),getCurrentDescriptor(e,t));return setProperty(e,t,r),e},getCurrentDescriptor=(e,t)=>{let n=Object.getOwnPropertyDescriptor(e,t);if(n!==void 0)return n;let r=Object.getPrototypeOf(e);return r===null?{}:getCurrentDescriptor(r,t)},setProperty=(e,t,n)=>{try{Object.defineProperty(e,t,n)}catch{}},assignProp=(e,t,n)=>{if(n!==void 0)return setProp(e,t,n);try{delete e[t]}catch{}if(e[t]!==void 0)return setProp(e,t)},setProp=(e,t,n)=>{redefineProperty(e,t,{value:n,...getNonEnum(t)})},getNonEnum=e=>typeof e==`string`&&e.startsWith(`_`)?{enumerable:!1}:{},normalizeOptions=(e,t,n={})=>{if(validateErrorOrObject(e,`First argument`),validateErrorOrObject(t,`Second argument`),!isPlainObject(n))throw TypeError(`Options must be a plain object: ${n}`);let{soft:r=!1}=n;if(typeof r!=`boolean`)throw TypeError(`Option "soft" must be a boolean: ${r}`);return{soft:r}},validateErrorOrObject=(e,t)=>{if(e===void 0)throw TypeError(`${t} is required.`);if(!isErrorOrObject(e))throw TypeError(`${t} must be a plain object or an error: ${e}`)},isErrorOrObject=e=>isPlainObject(e)||isErrorInstance(e),shouldSkipProp=({error:e,props:t,propName:n,soft:r})=>isIgnoredPropName(n)||!y.call(t,n)||r&&e[n]!==void 0,isIgnoredPropName=e=>e in _||v.has(e),_=Error(`check`),v=new Set([`prototype`,`errors`,`cause`]),{propertyIsEnumerable:y}=Object.prototype,setErrorProps=(e,t,n)=>{let{soft:r}=normalizeOptions(e,t,n);for(let n of Reflect.ownKeys(t))setErrorProp({error:e,props:t,propName:n,soft:r});return e},setErrorProp=({error:e,props:t,propName:n,soft:r})=>{shouldSkipProp({error:e,props:t,propName:n,soft:r})||assignProp(e,n,t[n])},setErrorProperty=(e,t,n)=>{Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!1,configurable:!0})},mergeAggregateCauses=(e,t)=>{e.errors!==void 0&&setErrorProperty(e,`errors`,e.errors.map(e=>t(e).error).filter(Boolean))},mergeAggregateErrors=({target:e,source:t,parent:n,child:r})=>{if(!hasErrors(e)){mergeSourceErrors(e,t);return}hasErrors(t)&&setErrorProperty(e,`errors`,[...r.errors,...n.errors])},mergeSourceErrors=(e,t)=>{t.errors!==void 0&&setErrorProperty(e,`errors`,t.errors)},hasErrors=e=>e.errors!==void 0&&e.errors.length!==0,normalizeArgs=(e,t,n=e.message)=>{if(typeof t!=`string`)throw TypeError(`newMessage must be a string: ${t}`);if(typeof n!=`string`)throw TypeError(`currentMessage must be a string: ${n}`);return n},b=e(({name:e,stack:t},n,r)=>r!==``&&t.includes(r)?replaceMessage({name:e,stack:t,newMessage:n,currentMessage:r}):insertMessage(e,t,n),`getStack`),replaceMessage=({name:e,stack:t,newMessage:n,currentMessage:r})=>{let[i,a]=getReplacers(e,n,r).find(([e])=>t.includes(e));return t.replace(i,a)},getReplacers=(e,t,n)=>[[`${e}: ${n}`,`${e}: ${t}`],[`: ${n}`,`: ${t}`],[`\n${n}`,`\n${t}`],[` ${n}`,` ${t}`],[n,t]],insertMessage=(e,t,n)=>{let r=`${e}: `,i=n.trimEnd();return t===e||t.startsWith(`${e}\n`)?t.replace(e,`${r}${i}`):t.startsWith(r)?t.replace(r,`${r}${i}\n`):`${r}${i}\n${t}`},setErrorMessage=(e,t,n)=>{let r=normalizeException(e),i=normalizeArgs(r,t,n);return setNonEnumProp(r,`message`,t),updateStack(r,t,i),r},updateStack=(e,t,n)=>{if(t===n||!stackIncludesMessage())return;let r=b(e,t,n);setNonEnumProp(e,`stack`,r)},stackIncludesMessage=()=>{let{stack:e}=Error(x);return typeof e==`string`&&e.includes(x)},x=`set-error-message test message`,setNonEnumProp=(e,t,n)=>{Object.defineProperty(e,t,{value:n,enumerable:!1,writable:!0,configurable:!0})},wrapErrorMessage=(e,t,n)=>{if(typeof t!=`string`)throw TypeError(`Second argument must be a message string: ${t}`);let r=normalizeException(e);return setErrorMessage(r,getMessage(t,r.message),n)},getMessage=(e,t)=>{let n=e.trim(),r=t.trim();return n===``?r:r===``?n:concatMessages(n,r,e)},concatMessages=(e,t,n)=>e.endsWith(S)?n.endsWith(C)?`${e}\n${t}`:`${e} ${t}`:`${t}\n${e}`,S=`:`,C=`
2
+ `,mergeMessage=({parent:e,child:t,target:n,stackError:r})=>{let i=e.message,a=r.message;return n.message=t.message,wrapErrorMessage(n,i,a)},hasStack=(e,t)=>getStack(e)===t,getStack=e=>typeof e==`object`&&e?e.stack:void 0,mergeStack=({wrap:e,target:t,source:n,childHasStack:r})=>e===r?t:(setErrorProperty(t,`stack`,n.stack),n),getWrap=e=>{let{wrap:t,name:n}=e;return typeof t==`boolean`?(Object.hasOwn(e,`wrap`)&&delete e.wrap,t):n===`Error`},mergeErrorCause=e=>mergeError(e,[]).error,mergeError=(e,t)=>{if(t.includes(e))return{};let recurse=n=>mergeError(n,[...t,e]),n=getStack(e),r=normalizeException(e,{shallow:!0}),i=hasStack(r,n);mergeAggregateCauses(r,recurse);let{parent:a,childHasStack:o}=mergeCause(r,recurse);return{error:a,errorHasStack:i||o}},mergeCause=(e,t)=>{let n=getWrap(e);if(e.cause===void 0)return{parent:e,childHasStack:!1};let{error:r,errorHasStack:i}=t(e.cause);return delete e.cause,{parent:mergeChild({parent:e,child:r,childHasStack:i,wrap:n}),childHasStack:i}},mergeChild=({parent:e,child:t,childHasStack:n,wrap:r})=>{if(t===void 0)return e;let[i,a]=r?[t,e]:[e,t],o=mergeStack({wrap:r,target:i,source:a,childHasStack:n}),s=mergeMessage({parent:e,child:t,target:setErrorClass(i,i.constructor,o.name),stackError:o});return mergeAggregateErrors({target:s,source:a,parent:e,child:t}),setErrorProps(s,a,{soft:!r})};export{wrapErrorMessage as n,isPlainObject as r,mergeErrorCause as t};
@@ -1 +1 @@
1
- import"../rolldown-runtime.mjs";import{_ as e,a as t,d as n,f as r,g as i,h as a,i as o,l as s,m as c,o as l,p as u,r as d,s as f,u as p,v as m}from"./mdast-util-from-markdown.mjs";const h={tokenize:tokenizeWwwPrefix,partial:!0},g={tokenize:tokenizeDomain,partial:!0},_={tokenize:tokenizePath,partial:!0},v={tokenize:tokenizeTrail,partial:!0},y={tokenize:tokenizeEmailDomainDotTrail,partial:!0},b={name:`wwwAutolink`,tokenize:tokenizeWwwAutolink,previous:previousWww},x={name:`protocolAutolink`,tokenize:tokenizeProtocolAutolink,previous:previousProtocol},S={name:`emailAutolink`,tokenize:tokenizeEmailAutolink,previous:previousEmail},C={};function gfmAutolinkLiteral(){return{text:C}}let w=48;for(;w<123;)C[w]=S,w++,w===58?w=65:w===91&&(w=97);C[43]=S,C[45]=S,C[46]=S,C[95]=S,C[72]=[S,x],C[104]=[S,x],C[87]=[S,b],C[119]=[S,b];function tokenizeEmailAutolink(e,t,i){let a=this,o,s;return start;function start(t){return!gfmAtext(t)||!previousEmail.call(a,a.previous)||previousUnbalanced(a.events)?i(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),atext(t))}function atext(t){return gfmAtext(t)?(e.consume(t),atext):t===64?(e.consume(t),emailDomain):i(t)}function emailDomain(t){return t===46?e.check(y,emailDomainAfter,emailDomainDot)(t):t===45||t===95||r(t)?(s=!0,e.consume(t),emailDomain):emailDomainAfter(t)}function emailDomainDot(t){return e.consume(t),o=!0,emailDomain}function emailDomainAfter(r){return s&&o&&n(a.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(r)):i(r)}}function tokenizeWwwAutolink(e,t,n){let r=this;return wwwStart;function wwwStart(t){return t!==87&&t!==119||!previousWww.call(r,r.previous)||previousUnbalanced(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(h,e.attempt(g,e.attempt(_,wwwAfter),n),n)(t))}function wwwAfter(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function tokenizeProtocolAutolink(t,r,i){let o=this,s=``,c=!1;return protocolStart;function protocolStart(e){return(e===72||e===104)&&previousProtocol.call(o,o.previous)&&!previousUnbalanced(o.events)?(t.enter(`literalAutolink`),t.enter(`literalAutolinkHttp`),s+=String.fromCodePoint(e),t.consume(e),protocolPrefixInside):i(e)}function protocolPrefixInside(e){if(n(e)&&s.length<5)return s+=String.fromCodePoint(e),t.consume(e),protocolPrefixInside;if(e===58){let n=s.toLowerCase();if(n===`http`||n===`https`)return t.consume(e),protocolSlashesInside}return i(e)}function protocolSlashesInside(e){return e===47?(t.consume(e),c?afterProtocol:(c=!0,protocolSlashesInside)):i(e)}function afterProtocol(n){return n===null||u(n)||a(n)||m(n)||e(n)?i(n):t.attempt(g,t.attempt(_,protocolAfter),i)(n)}function protocolAfter(e){return t.exit(`literalAutolinkHttp`),t.exit(`literalAutolink`),r(e)}}function tokenizeWwwPrefix(e,t,n){let r=0;return wwwPrefixInside;function wwwPrefixInside(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),wwwPrefixInside):t===46&&r===3?(e.consume(t),wwwPrefixAfter):n(t)}function wwwPrefixAfter(e){return e===null?n(e):t(e)}}function tokenizeDomain(t,n,r){let i,o,s;return domainInside;function domainInside(n){return n===46||n===95?t.check(v,domainAfter,domainAtPunctuation)(n):n===null||a(n)||m(n)||n!==45&&e(n)?domainAfter(n):(s=!0,t.consume(n),domainInside)}function domainAtPunctuation(e){return e===95?i=!0:(o=i,i=void 0),t.consume(e),domainInside}function domainAfter(e){return o||i||!s?r(e):n(e)}}function tokenizePath(e,t){let n=0,r=0;return pathInside;function pathInside(i){return i===40?(n++,e.consume(i),pathInside):i===41&&r<n?pathAtPunctuation(i):i===33||i===34||i===38||i===39||i===41||i===42||i===44||i===46||i===58||i===59||i===60||i===63||i===93||i===95||i===126?e.check(v,t,pathAtPunctuation)(i):i===null||a(i)||m(i)?t(i):(e.consume(i),pathInside)}function pathAtPunctuation(t){return t===41&&r++,e.consume(t),pathInside}}function tokenizeTrail(e,t,r){return trail;function trail(n){return n===33||n===34||n===39||n===41||n===42||n===44||n===46||n===58||n===59||n===63||n===95||n===126?(e.consume(n),trail):n===38?(e.consume(n),trailCharacterReferenceStart):n===93?(e.consume(n),trailBracketAfter):n===60||n===null||a(n)||m(n)?t(n):r(n)}function trailBracketAfter(e){return e===null||e===40||e===91||a(e)||m(e)?t(e):trail(e)}function trailCharacterReferenceStart(e){return n(e)?trailCharacterReferenceInside(e):r(e)}function trailCharacterReferenceInside(t){return t===59?(e.consume(t),trail):n(t)?(e.consume(t),trailCharacterReferenceInside):r(t)}}function tokenizeEmailDomainDotTrail(e,t,n){return start;function start(t){return e.consume(t),after}function after(e){return r(e)?n(e):t(e)}}function previousWww(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||a(e)}function previousProtocol(e){return!n(e)}function previousEmail(e){return!(e===47||gfmAtext(e))}function gfmAtext(e){return e===43||e===45||e===46||e===95||r(e)}function previousUnbalanced(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const T={tokenize:tokenizeIndent,partial:!0};function gfmFootnote(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:tokenizeDefinitionStart,continuation:{tokenize:tokenizeDefinitionContinuation},exit:gfmFootnoteDefinitionEnd}},text:{91:{name:`gfmFootnoteCall`,tokenize:tokenizeGfmFootnoteCall},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:tokenizePotentialGfmFootnoteCall,resolveTo:resolveToPotentialGfmFootnoteCall}}}}function tokenizePotentialGfmFootnoteCall(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return start;function start(i){if(!o||!o._balanced)return n(i);let s=p(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function resolveToPotentialGfmFootnoteCall(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function tokenizeGfmFootnoteCall(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o=0,s;return start;function start(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),callStart}function callStart(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,callData):n(t)}function callData(c){if(o>999||c===93&&!s||c===null||c===91||a(c))return n(c);if(c===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(p(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(c),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(c)}return a(c)||(s=!0),o++,e.consume(c),c===92?callEscape:callData}function callEscape(t){return t===91||t===92||t===93?(e.consume(t),o++,callData):callData(t)}}function tokenizeDefinitionStart(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),s,c=0,l;return start;function start(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),labelAtMarker}function labelAtMarker(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,labelInside):n(t)}function labelInside(t){if(c>999||t===93&&!l||t===null||t===91||a(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return s=p(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),labelAfter}return a(t)||(l=!0),c++,e.consume(t),t===92?labelEscape:labelInside}function labelEscape(t){return t===91||t===92||t===93?(e.consume(t),c++,labelInside):labelInside(t)}function labelAfter(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(s)||i.push(s),o(e,whitespaceAfter,`gfmFootnoteDefinitionWhitespace`)):n(t)}function whitespaceAfter(e){return t(e)}}function tokenizeDefinitionContinuation(e,t,n){return e.check(d,t,e.attempt(T,t,n))}function gfmFootnoteDefinitionEnd(e){e.exit(`gfmFootnoteDefinition`)}function tokenizeIndent(e,t,n){let r=this;return o(e,afterPrefix,`gfmFootnoteDefinitionIndent`,5);function afterPrefix(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function gfmStrikethrough(e){let n=(e||{}).singleTilde,r={name:`strikethrough`,tokenize:tokenizeStrikethrough,resolveAll:resolveAllStrikethrough};return n??=!0,{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function resolveAllStrikethrough(e,n){let r=-1;for(;++r<e.length;)if(e[r][0]===`enter`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._close){let i=r;for(;i--;)if(e[i][0]===`exit`&&e[i][1].type===`strikethroughSequenceTemporary`&&e[i][1]._open&&e[r][1].end.offset-e[r][1].start.offset===e[i][1].end.offset-e[i][1].start.offset){e[r][1].type=`strikethroughSequence`,e[i][1].type=`strikethroughSequence`;let a={type:`strikethrough`,start:Object.assign({},e[i][1].start),end:Object.assign({},e[r][1].end)},o={type:`strikethroughText`,start:Object.assign({},e[i][1].end),end:Object.assign({},e[r][1].start)},s=[[`enter`,a,n],[`enter`,e[i][1],n],[`exit`,e[i][1],n],[`enter`,o,n]],c=n.parser.constructs.insideSpan.null;c&&f(s,s.length,0,t(c,e.slice(i+1,r),n)),f(s,s.length,0,[[`exit`,o,n],[`enter`,e[r][1],n],[`exit`,e[r][1],n],[`exit`,a,n]]),f(e,i-1,r-i+3,s),r=i+s.length-2;break}}for(r=-1;++r<e.length;)e[r][1].type===`strikethroughSequenceTemporary`&&(e[r][1].type=`data`);return e}function tokenizeStrikethrough(e,t,r){let i=this.previous,a=this.events,o=0;return start;function start(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),more(t))}function more(a){let c=s(i);if(a===126)return o>1?r(a):(e.consume(a),o++,more);if(o<2&&!n)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=s(a);return l._open=!u||u===2&&!!c,l._close=!c||c===2&&!!u,t(a)}}}var EditMap=class{constructor(){this.map=[]}add(e,t,n){addImplementation(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0}};function addImplementation(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function gfmTableAlign(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function gfmTable(){return{flow:{null:{name:`table`,tokenize:tokenizeTable,resolveAll:resolveTable}}}}function tokenizeTable(e,t,n){let r=this,s=0,l=0,u;return start;function start(e){let t=r.events.length-1;for(;t>-1;){let e=r.events[t][1].type;if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?bodyRowStart:headRowBefore;return a===bodyRowStart&&r.parser.lazy[r.now().line]?n(e):a(e)}function headRowBefore(t){return e.enter(`tableHead`),e.enter(`tableRow`),headRowStart(t)}function headRowStart(e){return e===124?headRowBreak(e):(u=!0,l+=1,headRowBreak(e))}function headRowBreak(t){return t===null?n(t):c(t)?l>1?(l=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),headDelimiterStart):n(t):i(t)?o(e,headRowBreak,`whitespace`)(t):(l+=1,u&&(u=!1,s+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),u=!0,headRowBreak):(e.enter(`data`),headRowData(t)))}function headRowData(t){return t===null||t===124||a(t)?(e.exit(`data`),headRowBreak(t)):(e.consume(t),t===92?headRowEscape:headRowData)}function headRowEscape(t){return t===92||t===124?(e.consume(t),headRowData):headRowData(t)}function headDelimiterStart(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),u=!1,i(t)?o(e,headDelimiterBefore,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):headDelimiterBefore(t))}function headDelimiterBefore(t){return t===45||t===58?headDelimiterValueBefore(t):t===124?(u=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),headDelimiterCellBefore):headDelimiterNok(t)}function headDelimiterCellBefore(t){return i(t)?o(e,headDelimiterValueBefore,`whitespace`)(t):headDelimiterValueBefore(t)}function headDelimiterValueBefore(t){return t===58?(l+=1,u=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),headDelimiterLeftAlignmentAfter):t===45?(l+=1,headDelimiterLeftAlignmentAfter(t)):t===null||c(t)?headDelimiterCellAfter(t):headDelimiterNok(t)}function headDelimiterLeftAlignmentAfter(t){return t===45?(e.enter(`tableDelimiterFiller`),headDelimiterFiller(t)):headDelimiterNok(t)}function headDelimiterFiller(t){return t===45?(e.consume(t),headDelimiterFiller):t===58?(u=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),headDelimiterRightAlignmentAfter):(e.exit(`tableDelimiterFiller`),headDelimiterRightAlignmentAfter(t))}function headDelimiterRightAlignmentAfter(t){return i(t)?o(e,headDelimiterCellAfter,`whitespace`)(t):headDelimiterCellAfter(t)}function headDelimiterCellAfter(n){return n===124?headDelimiterBefore(n):n===null||c(n)?!u||s!==l?headDelimiterNok(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):headDelimiterNok(n)}function headDelimiterNok(e){return n(e)}function bodyRowStart(t){return e.enter(`tableRow`),bodyRowBreak(t)}function bodyRowBreak(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),bodyRowBreak):n===null||c(n)?(e.exit(`tableRow`),t(n)):i(n)?o(e,bodyRowBreak,`whitespace`)(n):(e.enter(`data`),bodyRowData(n))}function bodyRowData(t){return t===null||t===124||a(t)?(e.exit(`data`),bodyRowBreak(t)):(e.consume(t),t===92?bodyRowEscape:bodyRowData)}function bodyRowEscape(t){return t===92||t===124?(e.consume(t),bodyRowData):bodyRowData(t)}}function resolveTable(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new EditMap;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(flushTableEnd(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=flushCell(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=flushCell(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=flushCell(f,t,o,i,n,d)):(o[0]=o[1],d=flushCell(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&flushTableEnd(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=gfmTableAlign(t.events,n))}return e}function flushCell(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},getPoint(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=getPoint(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=getPoint(t.events,n[2]),a=getPoint(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},getPoint(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function flushTableEnd(e,t,n,r,i){let a=[],o=getPoint(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function getPoint(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}const E={name:`tasklistCheck`,tokenize:tokenizeTasklistCheck};function gfmTaskListItem(){return{text:{91:E}}}function tokenizeTasklistCheck(e,t,n){let r=this;return open;function open(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),inside)}function inside(t){return a(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),close):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),close):n(t)}function close(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),after):n(t)}function after(r){return c(r)?t(r):i(r)?e.check({tokenize:spaceThenNonSpace},t,n)(r):n(r)}}function spaceThenNonSpace(e,t,n){return o(e,after,`whitespace`);function after(e){return e===null?n(e):t(e)}}function gfm(e){return l([gfmAutolinkLiteral(),gfmFootnote(),gfmStrikethrough(e),gfmTable(),gfmTaskListItem()])}export{gfm as t};
1
+ import"../rolldown-runtime.mjs";import{_ as e,a as t,d as n,f as r,g as i,h as a,i as o,l as s,m as c,o as l,p as u,r as d,s as f,u as p,v as m}from"./mdast-util-from-markdown.mjs";const h={tokenize:tokenizeWwwPrefix,partial:!0},g={tokenize:tokenizeDomain,partial:!0},_={tokenize:tokenizePath,partial:!0},v={tokenize:tokenizeTrail,partial:!0},y={tokenize:tokenizeEmailDomainDotTrail,partial:!0},b={name:`wwwAutolink`,tokenize:tokenizeWwwAutolink,previous:previousWww},x={name:`protocolAutolink`,tokenize:tokenizeProtocolAutolink,previous:previousProtocol},S={name:`emailAutolink`,tokenize:tokenizeEmailAutolink,previous:previousEmail},C={};function gfmAutolinkLiteral(){return{text:C}}let w=48;for(;w<123;)C[w]=S,w++,w===58?w=65:w===91&&(w=97);C[43]=S,C[45]=S,C[46]=S,C[95]=S,C[72]=[S,x],C[104]=[S,x],C[87]=[S,b],C[119]=[S,b];function tokenizeEmailAutolink(e,t,i){let a=this,o,s;return start;function start(t){return!gfmAtext(t)||!previousEmail.call(a,a.previous)||previousUnbalanced(a.events)?i(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),atext(t))}function atext(t){return gfmAtext(t)?(e.consume(t),atext):t===64?(e.consume(t),emailDomain):i(t)}function emailDomain(t){return t===46?e.check(y,emailDomainAfter,emailDomainDot)(t):t===45||t===95||r(t)?(s=!0,e.consume(t),emailDomain):emailDomainAfter(t)}function emailDomainDot(t){return e.consume(t),o=!0,emailDomain}function emailDomainAfter(r){return s&&o&&n(a.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(r)):i(r)}}function tokenizeWwwAutolink(e,t,n){let r=this;return wwwStart;function wwwStart(t){return t!==87&&t!==119||!previousWww.call(r,r.previous)||previousUnbalanced(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(h,e.attempt(g,e.attempt(_,wwwAfter),n),n)(t))}function wwwAfter(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function tokenizeProtocolAutolink(t,r,i){let o=this,s=``,c=!1;return protocolStart;function protocolStart(e){return(e===72||e===104)&&previousProtocol.call(o,o.previous)&&!previousUnbalanced(o.events)?(t.enter(`literalAutolink`),t.enter(`literalAutolinkHttp`),s+=String.fromCodePoint(e),t.consume(e),protocolPrefixInside):i(e)}function protocolPrefixInside(e){if(n(e)&&s.length<5)return s+=String.fromCodePoint(e),t.consume(e),protocolPrefixInside;if(e===58){let n=s.toLowerCase();if(n===`http`||n===`https`)return t.consume(e),protocolSlashesInside}return i(e)}function protocolSlashesInside(e){return e===47?(t.consume(e),c?afterProtocol:(c=!0,protocolSlashesInside)):i(e)}function afterProtocol(n){return n===null||u(n)||a(n)||m(n)||e(n)?i(n):t.attempt(g,t.attempt(_,protocolAfter),i)(n)}function protocolAfter(e){return t.exit(`literalAutolinkHttp`),t.exit(`literalAutolink`),r(e)}}function tokenizeWwwPrefix(e,t,n){let r=0;return wwwPrefixInside;function wwwPrefixInside(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),wwwPrefixInside):t===46&&r===3?(e.consume(t),wwwPrefixAfter):n(t)}function wwwPrefixAfter(e){return e===null?n(e):t(e)}}function tokenizeDomain(t,n,r){let i,o,s;return domainInside;function domainInside(n){return n===46||n===95?t.check(v,domainAfter,domainAtPunctuation)(n):n===null||a(n)||m(n)||n!==45&&e(n)?domainAfter(n):(s=!0,t.consume(n),domainInside)}function domainAtPunctuation(e){return e===95?i=!0:(o=i,i=void 0),t.consume(e),domainInside}function domainAfter(e){return o||i||!s?r(e):n(e)}}function tokenizePath(e,t){let n=0,r=0;return pathInside;function pathInside(i){return i===40?(n++,e.consume(i),pathInside):i===41&&r<n?pathAtPunctuation(i):i===33||i===34||i===38||i===39||i===41||i===42||i===44||i===46||i===58||i===59||i===60||i===63||i===93||i===95||i===126?e.check(v,t,pathAtPunctuation)(i):i===null||a(i)||m(i)?t(i):(e.consume(i),pathInside)}function pathAtPunctuation(t){return t===41&&r++,e.consume(t),pathInside}}function tokenizeTrail(e,t,r){return trail;function trail(n){return n===33||n===34||n===39||n===41||n===42||n===44||n===46||n===58||n===59||n===63||n===95||n===126?(e.consume(n),trail):n===38?(e.consume(n),trailCharacterReferenceStart):n===93?(e.consume(n),trailBracketAfter):n===60||n===null||a(n)||m(n)?t(n):r(n)}function trailBracketAfter(e){return e===null||e===40||e===91||a(e)||m(e)?t(e):trail(e)}function trailCharacterReferenceStart(e){return n(e)?trailCharacterReferenceInside(e):r(e)}function trailCharacterReferenceInside(t){return t===59?(e.consume(t),trail):n(t)?(e.consume(t),trailCharacterReferenceInside):r(t)}}function tokenizeEmailDomainDotTrail(e,t,n){return start;function start(t){return e.consume(t),after}function after(e){return r(e)?n(e):t(e)}}function previousWww(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||a(e)}function previousProtocol(e){return!n(e)}function previousEmail(e){return!(e===47||gfmAtext(e))}function gfmAtext(e){return e===43||e===45||e===46||e===95||r(e)}function previousUnbalanced(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const T={tokenize:tokenizeIndent,partial:!0};function gfmFootnote(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:tokenizeDefinitionStart,continuation:{tokenize:tokenizeDefinitionContinuation},exit:gfmFootnoteDefinitionEnd}},text:{91:{name:`gfmFootnoteCall`,tokenize:tokenizeGfmFootnoteCall},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:tokenizePotentialGfmFootnoteCall,resolveTo:resolveToPotentialGfmFootnoteCall}}}}function tokenizePotentialGfmFootnoteCall(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return start;function start(i){if(!o||!o._balanced)return n(i);let s=p(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function resolveToPotentialGfmFootnoteCall(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function tokenizeGfmFootnoteCall(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o=0,s;return start;function start(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),callStart}function callStart(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,callData):n(t)}function callData(c){if(o>999||c===93&&!s||c===null||c===91||a(c))return n(c);if(c===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(p(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(c),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(c)}return a(c)||(s=!0),o++,e.consume(c),c===92?callEscape:callData}function callEscape(t){return t===91||t===92||t===93?(e.consume(t),o++,callData):callData(t)}}function tokenizeDefinitionStart(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),s,c=0,l;return start;function start(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),labelAtMarker}function labelAtMarker(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,labelInside):n(t)}function labelInside(t){if(c>999||t===93&&!l||t===null||t===91||a(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return s=p(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),labelAfter}return a(t)||(l=!0),c++,e.consume(t),t===92?labelEscape:labelInside}function labelEscape(t){return t===91||t===92||t===93?(e.consume(t),c++,labelInside):labelInside(t)}function labelAfter(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(s)||i.push(s),o(e,whitespaceAfter,`gfmFootnoteDefinitionWhitespace`)):n(t)}function whitespaceAfter(e){return t(e)}}function tokenizeDefinitionContinuation(e,t,n){return e.check(d,t,e.attempt(T,t,n))}function gfmFootnoteDefinitionEnd(e){e.exit(`gfmFootnoteDefinition`)}function tokenizeIndent(e,t,n){let r=this;return o(e,afterPrefix,`gfmFootnoteDefinitionIndent`,5);function afterPrefix(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function gfmStrikethrough(e){let n=(e||{}).singleTilde,r={name:`strikethrough`,tokenize:tokenizeStrikethrough,resolveAll:resolveAllStrikethrough};return n??=!0,{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function resolveAllStrikethrough(e,n){let r=-1;for(;++r<e.length;)if(e[r][0]===`enter`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._close){let i=r;for(;i--;)if(e[i][0]===`exit`&&e[i][1].type===`strikethroughSequenceTemporary`&&e[i][1]._open&&e[r][1].end.offset-e[r][1].start.offset===e[i][1].end.offset-e[i][1].start.offset){e[r][1].type=`strikethroughSequence`,e[i][1].type=`strikethroughSequence`;let a={type:`strikethrough`,start:Object.assign({},e[i][1].start),end:Object.assign({},e[r][1].end)},o={type:`strikethroughText`,start:Object.assign({},e[i][1].end),end:Object.assign({},e[r][1].start)},s=[[`enter`,a,n],[`enter`,e[i][1],n],[`exit`,e[i][1],n],[`enter`,o,n]],c=n.parser.constructs.insideSpan.null;c&&f(s,s.length,0,t(c,e.slice(i+1,r),n)),f(s,s.length,0,[[`exit`,o,n],[`enter`,e[r][1],n],[`exit`,e[r][1],n],[`exit`,a,n]]),f(e,i-1,r-i+3,s),r=i+s.length-2;break}}for(r=-1;++r<e.length;)e[r][1].type===`strikethroughSequenceTemporary`&&(e[r][1].type=`data`);return e}function tokenizeStrikethrough(e,t,r){let i=this.previous,a=this.events,o=0;return start;function start(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),more(t))}function more(a){let c=s(i);if(a===126)return o>1?r(a):(e.consume(a),o++,more);if(o<2&&!n)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=s(a);return l._open=!u||u===2&&!!c,l._close=!c||c===2&&!!u,t(a)}}}var EditMap=class{constructor(){this.map=[]}add(e,t,n){addImplementation(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0}};function addImplementation(e,t,n,r){let i=0;if(n!==0||r.length!==0){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function gfmTableAlign(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function gfmTable(){return{flow:{null:{name:`table`,tokenize:tokenizeTable,resolveAll:resolveTable}}}}function tokenizeTable(e,t,n){let r=this,s=0,l=0,u;return start;function start(e){let t=r.events.length-1;for(;t>-1;){let e=r.events[t][1].type;if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?bodyRowStart:headRowBefore;return a===bodyRowStart&&r.parser.lazy[r.now().line]?n(e):a(e)}function headRowBefore(t){return e.enter(`tableHead`),e.enter(`tableRow`),headRowStart(t)}function headRowStart(e){return e===124?headRowBreak(e):(u=!0,l+=1,headRowBreak(e))}function headRowBreak(t){return t===null?n(t):c(t)?l>1?(l=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),headDelimiterStart):n(t):i(t)?o(e,headRowBreak,`whitespace`)(t):(l+=1,u&&(u=!1,s+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),u=!0,headRowBreak):(e.enter(`data`),headRowData(t)))}function headRowData(t){return t===null||t===124||a(t)?(e.exit(`data`),headRowBreak(t)):(e.consume(t),t===92?headRowEscape:headRowData)}function headRowEscape(t){return t===92||t===124?(e.consume(t),headRowData):headRowData(t)}function headDelimiterStart(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),u=!1,i(t)?o(e,headDelimiterBefore,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):headDelimiterBefore(t))}function headDelimiterBefore(t){return t===45||t===58?headDelimiterValueBefore(t):t===124?(u=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),headDelimiterCellBefore):headDelimiterNok(t)}function headDelimiterCellBefore(t){return i(t)?o(e,headDelimiterValueBefore,`whitespace`)(t):headDelimiterValueBefore(t)}function headDelimiterValueBefore(t){return t===58?(l+=1,u=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),headDelimiterLeftAlignmentAfter):t===45?(l+=1,headDelimiterLeftAlignmentAfter(t)):t===null||c(t)?headDelimiterCellAfter(t):headDelimiterNok(t)}function headDelimiterLeftAlignmentAfter(t){return t===45?(e.enter(`tableDelimiterFiller`),headDelimiterFiller(t)):headDelimiterNok(t)}function headDelimiterFiller(t){return t===45?(e.consume(t),headDelimiterFiller):t===58?(u=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),headDelimiterRightAlignmentAfter):(e.exit(`tableDelimiterFiller`),headDelimiterRightAlignmentAfter(t))}function headDelimiterRightAlignmentAfter(t){return i(t)?o(e,headDelimiterCellAfter,`whitespace`)(t):headDelimiterCellAfter(t)}function headDelimiterCellAfter(n){return n===124?headDelimiterBefore(n):n===null||c(n)?!u||s!==l?headDelimiterNok(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):headDelimiterNok(n)}function headDelimiterNok(e){return n(e)}function bodyRowStart(t){return e.enter(`tableRow`),bodyRowBreak(t)}function bodyRowBreak(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),bodyRowBreak):n===null||c(n)?(e.exit(`tableRow`),t(n)):i(n)?o(e,bodyRowBreak,`whitespace`)(n):(e.enter(`data`),bodyRowData(n))}function bodyRowData(t){return t===null||t===124||a(t)?(e.exit(`data`),bodyRowBreak(t)):(e.consume(t),t===92?bodyRowEscape:bodyRowData)}function bodyRowEscape(t){return t===92||t===124?(e.consume(t),bodyRowData):bodyRowData(t)}}function resolveTable(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new EditMap;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(flushTableEnd(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=flushCell(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=flushCell(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=flushCell(f,t,o,i,n,d)):(o[0]=o[1],d=flushCell(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&flushTableEnd(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=gfmTableAlign(t.events,n))}return e}function flushCell(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},getPoint(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=getPoint(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=getPoint(t.events,n[2]),a=getPoint(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},getPoint(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function flushTableEnd(e,t,n,r,i){let a=[],o=getPoint(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function getPoint(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}const E={name:`tasklistCheck`,tokenize:tokenizeTasklistCheck};function gfmTaskListItem(){return{text:{91:E}}}function tokenizeTasklistCheck(e,t,n){let r=this;return open;function open(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),inside)}function inside(t){return a(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),close):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),close):n(t)}function close(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),after):n(t)}function after(r){return c(r)?t(r):i(r)?e.check({tokenize:spaceThenNonSpace},t,n)(r):n(r)}}function spaceThenNonSpace(e,t,n){return o(e,after,`whitespace`);function after(e){return e===null?n(e):t(e)}}function gfm(e){return l([gfmAutolinkLiteral(),gfmFootnote(),gfmStrikethrough(e),gfmTable(),gfmTaskListItem()])}export{gfm as t};
@@ -1 +1 @@
1
- import{c as e,t}from"../rolldown-runtime.mjs";import{i as n,r}from"./graphology-dag.mjs";var i=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)}})),a=t((e=>{var DEFAULT_COMPARATOR=function(e,t){return e<t?-1:+(e>t)},DEFAULT_REVERSE_COMPARATOR=function(e,t){return e<t?1:e>t?-1:0};function reverseComparator(e){return function(t,n){return e(n,t)}}function createTupleComparator(e){return e===2?function(e,t){return e[0]<t[0]?-1:e[0]>t[0]?1:e[1]<t[1]?-1:+(e[1]>t[1])}:function(t,n){for(var r=0;r<e;){if(t[r]<n[r])return-1;if(t[r]>n[r])return 1;r++}return 0}}e.DEFAULT_COMPARATOR=DEFAULT_COMPARATOR,e.DEFAULT_REVERSE_COMPARATOR=DEFAULT_REVERSE_COMPARATOR,e.reverseComparator=reverseComparator,e.createTupleComparator=createTupleComparator})),o=t(((e,t)=>{var r=a(),i=n(),o=r.DEFAULT_COMPARATOR,s=r.reverseComparator;function FibonacciHeap(e){if(this.clear(),this.comparator=e||o,typeof this.comparator!=`function`)throw Error(`mnemonist/FibonacciHeap.constructor: given comparator should be a function.`)}FibonacciHeap.prototype.clear=function(){this.root=null,this.min=null,this.size=0};function createNode(e){return{item:e,degree:0}}function mergeWithRoot(e,t){e.root?(t.right=e.root.right,t.left=e.root,e.root.right.left=t,e.root.right=t):e.root=t}FibonacciHeap.prototype.push=function(e){var t=createNode(e);return t.left=t,t.right=t,mergeWithRoot(this,t),(!this.min||this.comparator(t.item,this.min.item)<=0)&&(this.min=t),++this.size},FibonacciHeap.prototype.peek=function(){return this.min?this.min.item:void 0};function consumeLinkedList(e){for(var t=[],n=e,r=!1;!(n===e&&r);)n===e&&(r=!0),t.push(n),n=n.right;return t}function removeFromRoot(e,t){e.root===t&&(e.root=t.right),t.left.right=t.right,t.right.left=t.left}function mergeWithChild(e,t){e.child?(t.right=e.child.right,t.left=e.child,e.child.right.left=t,e.child.right=t):e.child=t}function link(e,t,n){removeFromRoot(e,t),t.left=t,t.right=t,mergeWithChild(n,t),n.degree++,t.parent=n}function consolidate(e){var t=Array(e.size),n=consumeLinkedList(e.root),r,i,a,o,s,c;for(r=0,i=n.length;r<i;r++){for(a=n[r],s=a.degree;t[s];)o=t[s],e.comparator(a.item,o.item)>0&&(c=a,a=o,o=c),link(e,o,a),t[s]=null,s++;t[s]=a}for(r=0;r<e.size;r++)t[r]&&e.comparator(t[r].item,e.min.item)<=0&&(e.min=t[r])}FibonacciHeap.prototype.pop=function(){if(this.size){var e=this.min;if(e.child){var t=consumeLinkedList(e.child),n,r,i;for(r=0,i=t.length;r<i;r++)n=t[r],mergeWithRoot(this,n),delete n.parent}return removeFromRoot(this,e),e===e.right?(this.min=null,this.root=null):(this.min=e.right,consolidate(this)),this.size--,e.item}},FibonacciHeap.prototype.inspect=function(){var e={size:this.size};return this.min&&`item`in this.min&&(e.top=this.min.item),Object.defineProperty(e,"constructor",{value:FibonacciHeap,enumerable:!1}),e},typeof Symbol<`u`&&(FibonacciHeap.prototype[Symbol.for(`nodejs.util.inspect.custom`)]=FibonacciHeap.prototype.inspect);function MaxFibonacciHeap(e){if(this.clear(),this.comparator=e||o,typeof this.comparator!=`function`)throw Error(`mnemonist/FibonacciHeap.constructor: given comparator should be a function.`);this.comparator=s(this.comparator)}MaxFibonacciHeap.prototype=FibonacciHeap.prototype,FibonacciHeap.from=function(e,t){var n=new FibonacciHeap(t);return i(e,function(e){n.push(e)}),n},MaxFibonacciHeap.from=function(e,t){var n=new MaxFibonacciHeap(t);return i(e,function(e){n.push(e)}),n},FibonacciHeap.MinFibonacciHeap=FibonacciHeap,FibonacciHeap.MaxFibonacciHeap=MaxFibonacciHeap,t.exports=FibonacciHeap})),s=t((e=>{var t=2**8-1,n=2**16-1,r=2**32-1,i=2**7-1,a=2**15-1,o=2**31-1;e.getPointerArray=function(e){var i=e-1;if(i<=t)return Uint8Array;if(i<=n)return Uint16Array;if(i<=r)return Uint32Array;throw Error(`mnemonist: Pointer Array of size > 4294967295 is not supported.`)},e.getSignedPointerArray=function(e){var t=e-1;return t<=i?Int8Array:t<=a?Int16Array:t<=o?Int32Array:Float64Array},e.getNumberType=function(e){return e===(e|0)?Math.sign(e)===-1?e<=127&&e>=-128?Int8Array:e<=32767&&e>=-32768?Int16Array:Int32Array:e<=255?Uint8Array:e<=65535?Uint16Array:Uint32Array:Float64Array};var s={Uint8Array:1,Int8Array:2,Uint16Array:3,Int16Array:4,Uint32Array:5,Int32Array:6,Float32Array:7,Float64Array:8};e.getMinimalRepresentation=function(t,n){var r=null,i=0,a,o,c,l,u;for(l=0,u=t.length;l<u;l++)c=n?n(t[l]):t[l],o=e.getNumberType(c),a=s[o.name],a>i&&(i=a,r=o);return r},e.isTypedArray=function(e){return typeof ArrayBuffer<`u`&&ArrayBuffer.isView(e)},e.concat=function(){var e=0,t,n,r;for(t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var i=new arguments[0].constructor(e);for(t=0,n=0;t<r;t++)i.set(arguments[t],n),n+=arguments[t].length;return i},e.indices=function(t){for(var n=new(e.getPointerArray(t))(t),r=0;r<t;r++)n[r]=r;return n}})),c=t((e=>{var t=n(),r=s();function isArrayLike(e){return Array.isArray(e)||r.isTypedArray(e)}function guessLength(e){if(typeof e.length==`number`)return e.length;if(typeof e.size==`number`)return e.size}function toArray(e){var n=guessLength(e),r=typeof n==`number`?Array(n):[],i=0;return t(e,function(e){r[i++]=e}),r}function toArrayWithIndices(e){var n=guessLength(e),i=typeof n==`number`?r.getPointerArray(n):Array,a=typeof n==`number`?Array(n):[],o=typeof n==`number`?new i(n):[],s=0;return t(e,function(e){a[s]=e,o[s]=s++}),[a,o]}e.isArrayLike=isArrayLike,e.guessLength=guessLength,e.toArray=toArray,e.toArrayWithIndices=toArrayWithIndices})),l=t(((e,t)=>{var r=n(),i=a(),o=c(),s=i.DEFAULT_COMPARATOR,l=i.reverseComparator;function siftDown(e,t,n,r){for(var i=t[r],a,o;r>n;){if(a=r-1>>1,o=t[a],e(i,o)<0){t[r]=o,r=a;continue}break}t[r]=i}function siftUp(e,t,n){for(var r=t.length,i=n,a=t[n],o=2*n+1,s;o<r;)s=o+1,s<r&&e(t[o],t[s])>=0&&(o=s),t[n]=t[o],n=o,o=2*n+1;t[n]=a,siftDown(e,t,i,n)}function push(e,t,n){t.push(n),siftDown(e,t,0,t.length-1)}function pop(e,t){var n=t.pop();if(t.length!==0){var r=t[0];return t[0]=n,siftUp(e,t,0),r}return n}function replace(e,t,n){if(t.length===0)throw Error(`mnemonist/heap.replace: cannot pop an empty heap.`);var r=t[0];return t[0]=n,siftUp(e,t,0),r}function pushpop(e,t,n){var r;return t.length!==0&&e(t[0],n)<0&&(r=t[0],t[0]=n,n=r,siftUp(e,t,0)),n}function heapify(e,t){for(var n=t.length>>1;--n>=0;)siftUp(e,t,n)}function consume(e,t){for(var n=t.length,r=0,i=Array(n);r<n;)i[r++]=pop(e,t);return i}function nsmallest(e,t,n){arguments.length===2&&(n=t,t=e,e=s);var i=l(e),a,c,u,d=1/0,f;if(t===1){if(o.isArrayLike(n)){for(a=0,c=n.length;a<c;a++)u=n[a],(d===1/0||e(u,d)<0)&&(d=u);return f=new n.constructor(1),f[0]=d,f}return r(n,function(t){(d===1/0||e(t,d)<0)&&(d=t)}),[d]}if(o.isArrayLike(n)){if(t>=n.length)return n.slice().sort(e);for(f=n.slice(0,t),heapify(i,f),a=t,c=n.length;a<c;a++)i(n[a],f[0])>0&&replace(i,f,n[a]);return f.sort(e)}var p=o.guessLength(n);return p!==null&&p<t&&(t=p),f=Array(t),a=0,r(n,function(e){a<t?f[a]=e:(a===t&&heapify(i,f),i(e,f[0])>0&&replace(i,f,e)),a++}),f.length>a&&(f.length=a),f.sort(e)}function nlargest(e,t,n){arguments.length===2&&(n=t,t=e,e=s);var i=l(e),a,c,u,d=-1/0,f;if(t===1){if(o.isArrayLike(n)){for(a=0,c=n.length;a<c;a++)u=n[a],(d===-1/0||e(u,d)>0)&&(d=u);return f=new n.constructor(1),f[0]=d,f}return r(n,function(t){(d===-1/0||e(t,d)>0)&&(d=t)}),[d]}if(o.isArrayLike(n)){if(t>=n.length)return n.slice().sort(i);for(f=n.slice(0,t),heapify(e,f),a=t,c=n.length;a<c;a++)e(n[a],f[0])>0&&replace(e,f,n[a]);return f.sort(i)}var p=o.guessLength(n);return p!==null&&p<t&&(t=p),f=Array(t),a=0,r(n,function(n){a<t?f[a]=n:(a===t&&heapify(e,f),e(n,f[0])>0&&replace(e,f,n)),a++}),f.length>a&&(f.length=a),f.sort(i)}function Heap(e){if(this.clear(),this.comparator=e||s,typeof this.comparator!=`function`)throw Error(`mnemonist/Heap.constructor: given comparator should be a function.`)}Heap.prototype.clear=function(){this.items=[],this.size=0},Heap.prototype.push=function(e){return push(this.comparator,this.items,e),++this.size},Heap.prototype.peek=function(){return this.items[0]},Heap.prototype.pop=function(){return this.size!==0&&this.size--,pop(this.comparator,this.items)},Heap.prototype.replace=function(e){return replace(this.comparator,this.items,e)},Heap.prototype.pushpop=function(e){return pushpop(this.comparator,this.items,e)},Heap.prototype.consume=function(){return this.size=0,consume(this.comparator,this.items)},Heap.prototype.toArray=function(){return consume(this.comparator,this.items.slice())},Heap.prototype.inspect=function(){var e=this.toArray();return Object.defineProperty(e,"constructor",{value:Heap,enumerable:!1}),e},typeof Symbol<`u`&&(Heap.prototype[Symbol.for(`nodejs.util.inspect.custom`)]=Heap.prototype.inspect);function MaxHeap(e){if(this.clear(),this.comparator=e||s,typeof this.comparator!=`function`)throw Error(`mnemonist/MaxHeap.constructor: given comparator should be a function.`);this.comparator=l(this.comparator)}MaxHeap.prototype=Heap.prototype,Heap.from=function(e,t){var n=new Heap(t),r=o.isArrayLike(e)?e.slice():o.toArray(e);return heapify(n.comparator,r),n.items=r,n.size=r.length,n},MaxHeap.from=function(e,t){var n=new MaxHeap(t),r=o.isArrayLike(e)?e.slice():o.toArray(e);return heapify(n.comparator,r),n.items=r,n.size=r.length,n},Heap.siftUp=siftUp,Heap.siftDown=siftDown,Heap.push=push,Heap.pop=pop,Heap.replace=replace,Heap.pushpop=pushpop,Heap.heapify=heapify,Heap.consume=consume,Heap.nsmallest=nsmallest,Heap.nlargest=nlargest,Heap.MinHeap=Heap,Heap.MaxHeap=MaxHeap,t.exports=Heap})),u=t(((e,t)=>{var n=``;function sort(e,t,n){for(var r=t.length,i=[],a=r,o=-1,s,c=0,l;a--;)o=Math.max(e[t[a]+n],o);for(l=o>>24&&32||o>>16&&24||o>>8&&16||8;c<l;c+=4){for(a=16;a--;)i[a]=[];for(a=r;a--;)i[e[t[a]+n]>>c&15].push(t[a]);for(s=0;s<16;s++)for(o=i[s].length;o--;)t[++a]=i[s][o]}}function compare(e,t,n,r){return e[n]-e[r]||(n%3==2?e[n+1]-e[r+1]||t[n+2]-t[r+2]:t[n+1]-t[r+1])}function build(e,t){var n=[],r=[],i=2*t/3|0,a=t-i,o=i+1>>1,s=i,c=0,l,u=[],d=[];if(t===1)return[0];for(;s--;)n[s]=(s*3>>1)+1;for(s=3;s--;)sort(e,n,s);for(c=r[(n[0]/3|0)+(n[0]%3==1?0:o)]=1,s=1;s<i;s++)(e[n[s]]!==e[n[s-1]]||e[n[s]+1]!==e[n[s-1]+1]||e[n[s]+2]!==e[n[s-1]+2])&&c++,r[(n[s]/3|0)+(n[s]%3==1?0:o)]=c;if(c<i)for(r=build(r,i),s=i;s--;)n[s]=r[s]<o?r[s]*3+1:(r[s]-o)*3+2;for(s=i;s--;)u[n[s]]=s;for(u[t]=-1,u[t+1]=-2,r=t%3==1?[t-1]:[],s=0;s<i;s++)n[s]%3==1&&r.push(n[s]-1);for(sort(e,r,0),s=0,c=0,l=0;s<i&&c<a;)d[l++]=compare(e,u,n[s],r[c])<0?n[s++]:r[c++];for(;s<i;)d[l++]=n[s++];for(;c<a;)d[l++]=r[c++];return d}function convert(e){var t=e.length,n=t%3,r=Array(t+n),i,a;if(typeof e!=`string`){var o=Object.create(null);for(a=0;a<t;a++)o[e[a]]||(o[e[a]]=!0);var s=Object.create(null),c=Object.keys(o).sort();for(a=0,i=c.length;a<i;a++)s[c[a]]=a+1;for(a=0;a<t;a++)r[a]=s[e[a]]}else for(a=0;a<t;a++)r[a]=e.charCodeAt(a);for(a=t;a<t+n;a++)r[a]=0;return r}function SuffixArray(e){this.hasArbitrarySequence=typeof e!=`string`,this.string=e,this.length=e.length,this.array=build(convert(e),this.length)}SuffixArray.prototype.toString=function(){return this.array.join(`,`)},SuffixArray.prototype.toJSON=function(){return this.array},SuffixArray.prototype.inspect=function(){for(var e=Array(this.length),t=0;t<this.length;t++)e[t]=this.string.slice(this.array[t]);return Object.defineProperty(e,"constructor",{value:SuffixArray,enumerable:!1}),e},typeof Symbol<`u`&&(SuffixArray.prototype[Symbol.for(`nodejs.util.inspect.custom`)]=SuffixArray.prototype.inspect);function GeneralizedSuffixArray(e){if(this.hasArbitrarySequence=typeof e[0]!=`string`,this.size=e.length,this.hasArbitrarySequence){this.text=[];for(var t=0,r=this.size;t<r;t++)this.text.push.apply(this.text,e[t]),t<r-1&&this.text.push(n)}else this.text=e.join(n);this.firstLength=e[0].length,this.length=this.text.length,this.array=build(convert(this.text),this.length)}GeneralizedSuffixArray.prototype.longestCommonSubsequence=function(){var e=this.hasArbitrarySequence?[]:``,t,n,r,i,a;for(n=1;n<this.length;n++)if(i=this.array[n],a=this.array[n-1],!(i<this.firstLength&&a<this.firstLength)&&!(i>this.firstLength&&a>this.firstLength)){for(t=Math.min(this.length-i,this.length-a),r=0;r<t;r++)if(this.text[i+r]!==this.text[a+r]){t=r;break}t>e.length&&(e=this.text.slice(i,i+t))}return e},GeneralizedSuffixArray.prototype.toString=function(){return this.array.join(`,`)},GeneralizedSuffixArray.prototype.toJSON=function(){return this.array},GeneralizedSuffixArray.prototype.inspect=function(){for(var e=Array(this.length),t=0;t<this.length;t++)e[t]=this.text.slice(this.array[t]);return Object.defineProperty(e,"constructor",{value:GeneralizedSuffixArray,enumerable:!1}),e},typeof Symbol<`u`&&(GeneralizedSuffixArray.prototype[Symbol.for(`nodejs.util.inspect.custom`)]=GeneralizedSuffixArray.prototype.inspect),SuffixArray.GeneralizedSuffixArray=GeneralizedSuffixArray,t.exports=SuffixArray})),d=t(((e,t)=>{var i=r(),a=n(),o=c(),l=s(),DEFAULT_GROWING_POLICY=function(e){return Math.max(1,Math.ceil(e*1.5))},pointerArrayFactory=function(e){return new(l.getPointerArray(e))(e)};function Vector(e,t){if(arguments.length<1)throw Error(`mnemonist/vector: expecting at least a byte array constructor.`);var n=t||0,r=DEFAULT_GROWING_POLICY,i=0,a=!1;typeof t==`object`&&(n=t.initialCapacity||0,i=t.initialLength||0,r=t.policy||r,a=t.factory===!0),this.factory=a?e:null,this.ArrayClass=e,this.length=i,this.capacity=Math.max(i,n),this.policy=r,this.array=new e(this.capacity)}Vector.prototype.set=function(e,t){if(this.length<e)throw Error(`Vector(`+this.ArrayClass.name+`).set: index out of bounds.`);return this.array[e]=t,this},Vector.prototype.get=function(e){if(!(this.length<e))return this.array[e]},Vector.prototype.applyPolicy=function(e){var t=this.policy(e||this.capacity);if(typeof t!=`number`||t<0)throw Error(`mnemonist/vector.applyPolicy: policy returned an invalid value (expecting a positive integer).`);if(t<=this.capacity)throw Error(`mnemonist/vector.applyPolicy: policy returned a less or equal capacity to allocate.`);return t},Vector.prototype.reallocate=function(e){if(e===this.capacity)return this;var t=this.array;if(e<this.length&&(this.length=e),e>this.capacity)if(this.factory===null?this.array=new this.ArrayClass(e):this.array=this.factory(e),l.isTypedArray(this.array))this.array.set(t,0);else for(var n=0,r=this.length;n<r;n++)this.array[n]=t[n];else this.array=t.slice(0,e);return this.capacity=e,this},Vector.prototype.grow=function(e){var t;if(typeof e==`number`){if(this.capacity>=e)return this;for(t=this.capacity;t<e;)t=this.applyPolicy(t);return this.reallocate(t),this}return t=this.applyPolicy(),this.reallocate(t),this},Vector.prototype.resize=function(e){return e===this.length?this:e<this.length?(this.length=e,this):(this.length=e,this.reallocate(e),this)},Vector.prototype.push=function(e){return this.capacity===this.length&&this.grow(),this.array[this.length++]=e,this.length},Vector.prototype.pop=function(){if(this.length!==0)return this.array[--this.length]},Vector.prototype.values=function(){var e=this.array,t=this.length,n=0;return new i(function(){if(n>=t)return{done:!0};var r=e[n];return n++,{value:r,done:!1}})},Vector.prototype.entries=function(){var e=this.array,t=this.length,n=0;return new i(function(){if(n>=t)return{done:!0};var r=e[n];return{value:[n++,r],done:!1}})},typeof Symbol<`u`&&(Vector.prototype[Symbol.iterator]=Vector.prototype.values),Vector.prototype.inspect=function(){var e=this.array.slice(0,this.length);return e.type=this.array.constructor.name,e.items=this.length,e.capacity=this.capacity,Object.defineProperty(e,"constructor",{value:Vector,enumerable:!1}),e},typeof Symbol<`u`&&(Vector.prototype[Symbol.for(`nodejs.util.inspect.custom`)]=Vector.prototype.inspect),Vector.from=function(e,t,n){if(arguments.length<3&&(n=o.guessLength(e),typeof n!=`number`))throw Error(`mnemonist/vector.from: could not guess iterable length. Please provide desired capacity as last argument.`);var r=new Vector(t,n);return a(e,function(e){r.push(e)}),r};function subClass(e){var SubClass=function(t){Vector.call(this,e,t)};for(var t in Vector.prototype)Vector.prototype.hasOwnProperty(t)&&(SubClass.prototype[t]=Vector.prototype[t]);return SubClass.from=function(t,n){return Vector.from(t,e,n)},typeof Symbol<`u`&&(SubClass.prototype[Symbol.iterator]=SubClass.prototype.values),SubClass}Vector.Int8Vector=subClass(Int8Array),Vector.Uint8Vector=subClass(Uint8Array),Vector.Uint8ClampedVector=subClass(Uint8ClampedArray),Vector.Int16Vector=subClass(Int16Array),Vector.Uint16Vector=subClass(Uint16Array),Vector.Int32Vector=subClass(Int32Array),Vector.Uint32Vector=subClass(Uint32Array),Vector.Float32Vector=subClass(Float32Array),Vector.Float64Vector=subClass(Float64Array),Vector.PointerVector=subClass(pointerArrayFactory),t.exports=Vector})),f=t(((e,t)=>{function DefaultMap(e){if(typeof e!=`function`)throw Error(`mnemonist/DefaultMap.constructor: expecting a function.`);this.items=new Map,this.factory=e,this.size=0}DefaultMap.prototype.clear=function(){this.items.clear(),this.size=0},DefaultMap.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},DefaultMap.prototype.peek=function(e){return this.items.get(e)},DefaultMap.prototype.set=function(e,t){return this.items.set(e,t),this.size=this.items.size,this},DefaultMap.prototype.has=function(e){return this.items.has(e)},DefaultMap.prototype.delete=function(e){var t=this.items.delete(e);return this.size=this.items.size,t},DefaultMap.prototype.forEach=function(e,t){t=arguments.length>1?t:this,this.items.forEach(e,t)},DefaultMap.prototype.entries=function(){return this.items.entries()},DefaultMap.prototype.keys=function(){return this.items.keys()},DefaultMap.prototype.values=function(){return this.items.values()},typeof Symbol<`u`&&(DefaultMap.prototype[Symbol.iterator]=DefaultMap.prototype.entries),DefaultMap.prototype.inspect=function(){return this.items},typeof Symbol<`u`&&(DefaultMap.prototype[Symbol.for(`nodejs.util.inspect.custom`)]=DefaultMap.prototype.inspect),DefaultMap.autoIncrement=function(){var e=0;return function(){return e++}},t.exports=DefaultMap})),p=t(((e,t)=>{function DefaultWeakMap(e){if(typeof e!=`function`)throw Error(`mnemonist/DefaultWeakMap.constructor: expecting a function.`);this.items=new WeakMap,this.factory=e}DefaultWeakMap.prototype.clear=function(){this.items=new WeakMap},DefaultWeakMap.prototype.get=function(e){var t=this.items.get(e);return t===void 0&&(t=this.factory(e),this.items.set(e,t)),t},DefaultWeakMap.prototype.peek=function(e){return this.items.get(e)},DefaultWeakMap.prototype.set=function(e,t){return this.items.set(e,t),this},DefaultWeakMap.prototype.has=function(e){return this.items.has(e)},DefaultWeakMap.prototype.delete=function(e){return this.items.delete(e)},DefaultWeakMap.prototype.inspect=function(){return this.items},typeof Symbol<`u`&&(DefaultWeakMap.prototype[Symbol.for(`nodejs.util.inspect.custom`)]=DefaultWeakMap.prototype.inspect),t.exports=DefaultWeakMap})),m=t(((e,t)=>{var i=r(),a=n();function MultiMap(e){this.Container=e||Array,this.items=new Map,this.clear(),Object.defineProperty(this.items,"constructor",{value:MultiMap,enumerable:!1})}MultiMap.prototype.clear=function(){this.size=0,this.dimension=0,this.items.clear()},MultiMap.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},MultiMap.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},MultiMap.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},MultiMap.prototype.has=function(e){return this.items.has(e)},MultiMap.prototype.get=function(e){return this.items.get(e)},MultiMap.prototype.multiplicity=function(e){var t=this.items.get(e);return t===void 0?0:this.Container===Set?t.size:t.length},MultiMap.prototype.count=MultiMap.prototype.multiplicity,MultiMap.prototype.forEach=function(e,t){t=arguments.length>1?t:this;var n;function inner(r){e.call(t,r,n)}this.items.forEach(function(e,t){n=t,e.forEach(inner)})},MultiMap.prototype.forEachAssociation=function(e,t){t=arguments.length>1?t:this,this.items.forEach(e,t)},MultiMap.prototype.keys=function(){return this.items.keys()},MultiMap.prototype.values=function(){var e=this.items.values(),t=!1,n,r,a,o;return this.Container===Set?new i(function next(){if(!t){if(r=e.next(),r.done)return{done:!0};t=!0,n=r.value.values()}return r=n.next(),r.done?(t=!1,next()):{done:!1,value:r.value}}):new i(function next(){if(!t){if(r=e.next(),r.done)return{done:!0};t=!0,n=r.value,a=0,o=n.length}return a>=o?(t=!1,next()):{done:!1,value:n[a++]}})},MultiMap.prototype.entries=function(){var e=this.items.entries(),t=!1,n,r,a,o,s;return this.Container===Set?new i(function next(){if(!t){if(r=e.next(),r.done)return{done:!0};t=!0,a=r.value[0],n=r.value[1].values()}return r=n.next(),r.done?(t=!1,next()):{done:!1,value:[a,r.value]}}):new i(function next(){if(!t){if(r=e.next(),r.done)return{done:!0};t=!0,a=r.value[0],n=r.value[1],o=0,s=n.length}return o>=s?(t=!1,next()):{done:!1,value:[a,n[o++]]}})},MultiMap.prototype.containers=function(){return this.items.values()},MultiMap.prototype.associations=function(){return this.items.entries()},typeof Symbol<`u`&&(MultiMap.prototype[Symbol.iterator]=MultiMap.prototype.entries),MultiMap.prototype.inspect=function(){return this.items},typeof Symbol<`u`&&(MultiMap.prototype[Symbol.for(`nodejs.util.inspect.custom`)]=MultiMap.prototype.inspect),MultiMap.prototype.toJSON=function(){return this.items},MultiMap.from=function(e,t){var n=new MultiMap(t);return a(e,function(e,t){n.set(t,e)}),n},t.exports=MultiMap})),h=t(((e,t)=>{var i=r(),a=n();function LinkedList(){this.clear()}LinkedList.prototype.clear=function(){this.head=null,this.tail=null,this.size=0},LinkedList.prototype.first=function(){return this.head?this.head.item:void 0},LinkedList.prototype.peek=LinkedList.prototype.first,LinkedList.prototype.last=function(){return this.tail?this.tail.item:void 0},LinkedList.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},LinkedList.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},LinkedList.prototype.shift=function(){if(this.size){var e=this.head;return this.head=e.next,this.size--,e.item}},LinkedList.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++}},LinkedList.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},LinkedList.prototype.values=function(){var e=this.head;return new i(function(){if(!e)return{done:!0};var t=e.item;return e=e.next,{value:t,done:!1}})},LinkedList.prototype.entries=function(){var e=this.head,t=0;return new i(function(){if(!e)return{done:!0};var n=e.item;return e=e.next,t++,{value:[t-1,n],done:!1}})},typeof Symbol<`u`&&(LinkedList.prototype[Symbol.iterator]=LinkedList.prototype.values),LinkedList.prototype.toString=function(){return this.toArray().join(`,`)},LinkedList.prototype.toJSON=function(){return this.toArray()},LinkedList.prototype.inspect=function(){var e=this.toArray();return Object.defineProperty(e,"constructor",{value:LinkedList,enumerable:!1}),e},typeof Symbol<`u`&&(LinkedList.prototype[Symbol.for(`nodejs.util.inspect.custom`)]=LinkedList.prototype.inspect),LinkedList.from=function(e){var t=new LinkedList;return a(e,function(e){t.push(e)}),t},t.exports=LinkedList})),g=t(((e,t)=>{var i=r(),a=n(),o=s(),l=c();function LRUCache(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=o.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={}}LRUCache.prototype.clear=function(){this.size=0,this.head=0,this.tail=0,this.items={}},LRUCache.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},LRUCache.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},LRUCache.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})},LRUCache.prototype.has=function(e){return e in this.items},LRUCache.prototype.get=function(e){var t=this.items[e];if(t!==void 0)return this.splayOnTop(t),this.V[t]},LRUCache.prototype.peek=function(e){var t=this.items[e];if(t!==void 0)return this.V[t]},LRUCache.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++},LRUCache.prototype.keys=function(){var e=0,t=this.size,n=this.head,r=this.K,a=this.forward;return new i(function(){if(e>=t)return{done:!0};var i=r[n];return e++,e<t&&(n=a[n]),{done:!1,value:i}})},LRUCache.prototype.values=function(){var e=0,t=this.size,n=this.head,r=this.V,a=this.forward;return new i(function(){if(e>=t)return{done:!0};var i=r[n];return e++,e<t&&(n=a[n]),{done:!1,value:i}})},LRUCache.prototype.entries=function(){var e=0,t=this.size,n=this.head,r=this.K,a=this.V,o=this.forward;return new i(function(){if(e>=t)return{done:!0};var i=r[n],s=a[n];return e++,e<t&&(n=o[n]),{done:!1,value:[i,s]}})},typeof Symbol<`u`&&(LRUCache.prototype[Symbol.iterator]=LRUCache.prototype.entries),LRUCache.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:LRUCache,enumerable:!1}),e},typeof Symbol<`u`&&(LRUCache.prototype[Symbol.for(`nodejs.util.inspect.custom`)]=LRUCache.prototype.inspect),LRUCache.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 LRUCache(t,n,r);return a(e,function(e,t){i.set(t,e)}),i},t.exports=LRUCache})),_=t(((e,t)=>{var r=g(),i=n(),a=s(),o=c();function LRUMap(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=a.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}LRUMap.prototype.clear=function(){this.size=0,this.head=0,this.tail=0,this.items.clear()},LRUMap.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},LRUMap.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})},LRUMap.prototype.has=function(e){return this.items.has(e)},LRUMap.prototype.get=function(e){var t=this.items.get(e);if(t!==void 0)return this.splayOnTop(t),this.V[t]},LRUMap.prototype.peek=function(e){var t=this.items.get(e);if(t!==void 0)return this.V[t]},LRUMap.prototype.splayOnTop=r.prototype.splayOnTop,LRUMap.prototype.forEach=r.prototype.forEach,LRUMap.prototype.keys=r.prototype.keys,LRUMap.prototype.values=r.prototype.values,LRUMap.prototype.entries=r.prototype.entries,typeof Symbol<`u`&&(LRUMap.prototype[Symbol.iterator]=LRUMap.prototype.entries),LRUMap.prototype.inspect=r.prototype.inspect,LRUMap.from=function(e,t,n,r){if(arguments.length<2){if(r=o.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 a=new LRUMap(t,n,r);return i(e,function(e,t){a.set(t,e)}),a},t.exports=LRUMap})),v=t(((e,t)=>{var i=r(),a=n();function Stack(){this.clear()}Stack.prototype.clear=function(){this.items=[],this.size=0},Stack.prototype.push=function(e){return this.items.push(e),++this.size},Stack.prototype.pop=function(){if(this.size!==0)return this.size--,this.items.pop()},Stack.prototype.peek=function(){return this.items[this.size-1]},Stack.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)},Stack.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},Stack.prototype.values=function(){var e=this.items,t=e.length,n=0;return new i(function(){if(n>=t)return{done:!0};var r=e[t-n-1];return n++,{value:r,done:!1}})},Stack.prototype.entries=function(){var e=this.items,t=e.length,n=0;return new i(function(){if(n>=t)return{done:!0};var r=e[t-n-1];return{value:[n++,r],done:!1}})},typeof Symbol<`u`&&(Stack.prototype[Symbol.iterator]=Stack.prototype.values),Stack.prototype.toString=function(){return this.toArray().join(`,`)},Stack.prototype.toJSON=function(){return this.toArray()},Stack.prototype.inspect=function(){var e=this.toArray();return Object.defineProperty(e,"constructor",{value:Stack,enumerable:!1}),e},typeof Symbol<`u`&&(Stack.prototype[Symbol.for(`nodejs.util.inspect.custom`)]=Stack.prototype.inspect),Stack.from=function(e){var t=new Stack;return a(e,function(e){t.push(e)}),t},Stack.of=function(){return Stack.from(arguments)},t.exports=Stack})),y=e(i(),1),b=e(o(),1),x=e(l(),1),S=e(u(),1),C=e(d(),1),w=e(f(),1),T=e(p(),1),E=e(h(),1),D=e(_(),1),O=e(m(),1),k=e(v(),1);b.default.MinFibonacciHeap,b.default.MaxFibonacciHeap,x.default.MinHeap,x.default.MaxHeap,S.default.GeneralizedSuffixArray,C.default.Uint8Vector,C.default.Uint8ClampedVector,C.default.Int8Vector,C.default.Uint16Vector,C.default.Int16Vector,C.default.Uint32Vector,C.default.Int32Vector,C.default.Float32Vector,C.default.Float64Vector,C.default.PointerVector;export{O as a,D as i,T as n,y as o,E as r,k as s,w as t};
1
+ import{a as e,t}from"../rolldown-runtime.mjs";import{i as n,r}from"./graphology-dag.mjs";var i=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)}})),a=t((e=>{var t=2**16-1,n=2**32-1,r=2**7-1,i=2**15-1,a=2**31-1;e.getPointerArray=function(e){var r=e-1;if(r<=255)return Uint8Array;if(r<=t)return Uint16Array;if(r<=n)return Uint32Array;throw Error(`mnemonist: Pointer Array of size > 4294967295 is not supported.`)},e.getSignedPointerArray=function(e){var t=e-1;return t<=r?Int8Array:t<=i?Int16Array:t<=a?Int32Array:Float64Array},e.getNumberType=function(e){return e===(e|0)?Math.sign(e)===-1?e<=127&&e>=-128?Int8Array:e<=32767&&e>=-32768?Int16Array:Int32Array:e<=255?Uint8Array:e<=65535?Uint16Array:Uint32Array:Float64Array};var o={Uint8Array:1,Int8Array:2,Uint16Array:3,Int16Array:4,Uint32Array:5,Int32Array:6,Float32Array:7,Float64Array:8};e.getMinimalRepresentation=function(t,n){var r=null,i=0,a,s,c,l,u;for(l=0,u=t.length;l<u;l++)c=n?n(t[l]):t[l],s=e.getNumberType(c),a=o[s.name],a>i&&(i=a,r=s);return r},e.isTypedArray=function(e){return typeof ArrayBuffer<`u`&&ArrayBuffer.isView(e)},e.concat=function(){var e=0,t,n,r;for(t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var i=new arguments[0].constructor(e);for(t=0,n=0;t<r;t++)i.set(arguments[t],n),n+=arguments[t].length;return i},e.indices=function(t){for(var n=new(e.getPointerArray(t))(t),r=0;r<t;r++)n[r]=r;return n}})),o=t((e=>{var t=n(),r=a();function isArrayLike(e){return Array.isArray(e)||r.isTypedArray(e)}function guessLength(e){if(typeof e.length==`number`)return e.length;if(typeof e.size==`number`)return e.size}function toArray(e){var n=guessLength(e),r=typeof n==`number`?Array(n):[],i=0;return t(e,function(e){r[i++]=e}),r}function toArrayWithIndices(e){var n=guessLength(e),i=typeof n==`number`?r.getPointerArray(n):Array,a=typeof n==`number`?Array(n):[],o=typeof n==`number`?new i(n):[],s=0;return t(e,function(e){a[s]=e,o[s]=s++}),[a,o]}e.isArrayLike=isArrayLike,e.guessLength=guessLength,e.toArray=toArray,e.toArrayWithIndices=toArrayWithIndices})),s=t(((e,t)=>{function DefaultMap(e){if(typeof e!=`function`)throw Error(`mnemonist/DefaultMap.constructor: expecting a function.`);this.items=new Map,this.factory=e,this.size=0}DefaultMap.prototype.clear=function(){this.items.clear(),this.size=0},DefaultMap.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},DefaultMap.prototype.peek=function(e){return this.items.get(e)},DefaultMap.prototype.set=function(e,t){return this.items.set(e,t),this.size=this.items.size,this},DefaultMap.prototype.has=function(e){return this.items.has(e)},DefaultMap.prototype.delete=function(e){var t=this.items.delete(e);return this.size=this.items.size,t},DefaultMap.prototype.forEach=function(e,t){t=arguments.length>1?t:this,this.items.forEach(e,t)},DefaultMap.prototype.entries=function(){return this.items.entries()},DefaultMap.prototype.keys=function(){return this.items.keys()},DefaultMap.prototype.values=function(){return this.items.values()},typeof Symbol<`u`&&(DefaultMap.prototype[Symbol.iterator]=DefaultMap.prototype.entries),DefaultMap.prototype.inspect=function(){return this.items},typeof Symbol<`u`&&(DefaultMap.prototype[Symbol.for(`nodejs.util.inspect.custom`)]=DefaultMap.prototype.inspect),DefaultMap.autoIncrement=function(){var e=0;return function(){return e++}},t.exports=DefaultMap})),c=t(((e,t)=>{function DefaultWeakMap(e){if(typeof e!=`function`)throw Error(`mnemonist/DefaultWeakMap.constructor: expecting a function.`);this.items=new WeakMap,this.factory=e}DefaultWeakMap.prototype.clear=function(){this.items=new WeakMap},DefaultWeakMap.prototype.get=function(e){var t=this.items.get(e);return t===void 0&&(t=this.factory(e),this.items.set(e,t)),t},DefaultWeakMap.prototype.peek=function(e){return this.items.get(e)},DefaultWeakMap.prototype.set=function(e,t){return this.items.set(e,t),this},DefaultWeakMap.prototype.has=function(e){return this.items.has(e)},DefaultWeakMap.prototype.delete=function(e){return this.items.delete(e)},DefaultWeakMap.prototype.inspect=function(){return this.items},typeof Symbol<`u`&&(DefaultWeakMap.prototype[Symbol.for(`nodejs.util.inspect.custom`)]=DefaultWeakMap.prototype.inspect),t.exports=DefaultWeakMap})),l=t(((e,t)=>{var i=r(),a=n();function MultiMap(e){this.Container=e||Array,this.items=new Map,this.clear(),Object.defineProperty(this.items,"constructor",{value:MultiMap,enumerable:!1})}MultiMap.prototype.clear=function(){this.size=0,this.dimension=0,this.items.clear()},MultiMap.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},MultiMap.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},MultiMap.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},MultiMap.prototype.has=function(e){return this.items.has(e)},MultiMap.prototype.get=function(e){return this.items.get(e)},MultiMap.prototype.multiplicity=function(e){var t=this.items.get(e);return t===void 0?0:this.Container===Set?t.size:t.length},MultiMap.prototype.count=MultiMap.prototype.multiplicity,MultiMap.prototype.forEach=function(e,t){t=arguments.length>1?t:this;var n;function inner(r){e.call(t,r,n)}this.items.forEach(function(e,t){n=t,e.forEach(inner)})},MultiMap.prototype.forEachAssociation=function(e,t){t=arguments.length>1?t:this,this.items.forEach(e,t)},MultiMap.prototype.keys=function(){return this.items.keys()},MultiMap.prototype.values=function(){var e=this.items.values(),t=!1,n,r,a,o;return this.Container===Set?new i(function next(){if(!t){if(r=e.next(),r.done)return{done:!0};t=!0,n=r.value.values()}return r=n.next(),r.done?(t=!1,next()):{done:!1,value:r.value}}):new i(function next(){if(!t){if(r=e.next(),r.done)return{done:!0};t=!0,n=r.value,a=0,o=n.length}return a>=o?(t=!1,next()):{done:!1,value:n[a++]}})},MultiMap.prototype.entries=function(){var e=this.items.entries(),t=!1,n,r,a,o,s;return this.Container===Set?new i(function next(){if(!t){if(r=e.next(),r.done)return{done:!0};t=!0,a=r.value[0],n=r.value[1].values()}return r=n.next(),r.done?(t=!1,next()):{done:!1,value:[a,r.value]}}):new i(function next(){if(!t){if(r=e.next(),r.done)return{done:!0};t=!0,a=r.value[0],n=r.value[1],o=0,s=n.length}return o>=s?(t=!1,next()):{done:!1,value:[a,n[o++]]}})},MultiMap.prototype.containers=function(){return this.items.values()},MultiMap.prototype.associations=function(){return this.items.entries()},typeof Symbol<`u`&&(MultiMap.prototype[Symbol.iterator]=MultiMap.prototype.entries),MultiMap.prototype.inspect=function(){return this.items},typeof Symbol<`u`&&(MultiMap.prototype[Symbol.for(`nodejs.util.inspect.custom`)]=MultiMap.prototype.inspect),MultiMap.prototype.toJSON=function(){return this.items},MultiMap.from=function(e,t){var n=new MultiMap(t);return a(e,function(e,t){n.set(t,e)}),n},t.exports=MultiMap})),u=t(((e,t)=>{var i=r(),a=n();function LinkedList(){this.clear()}LinkedList.prototype.clear=function(){this.head=null,this.tail=null,this.size=0},LinkedList.prototype.first=function(){return this.head?this.head.item:void 0},LinkedList.prototype.peek=LinkedList.prototype.first,LinkedList.prototype.last=function(){return this.tail?this.tail.item:void 0},LinkedList.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},LinkedList.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},LinkedList.prototype.shift=function(){if(this.size){var e=this.head;return this.head=e.next,this.size--,e.item}},LinkedList.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++}},LinkedList.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},LinkedList.prototype.values=function(){var e=this.head;return new i(function(){if(!e)return{done:!0};var t=e.item;return e=e.next,{value:t,done:!1}})},LinkedList.prototype.entries=function(){var e=this.head,t=0;return new i(function(){if(!e)return{done:!0};var n=e.item;return e=e.next,t++,{value:[t-1,n],done:!1}})},typeof Symbol<`u`&&(LinkedList.prototype[Symbol.iterator]=LinkedList.prototype.values),LinkedList.prototype.toString=function(){return this.toArray().join(`,`)},LinkedList.prototype.toJSON=function(){return this.toArray()},LinkedList.prototype.inspect=function(){var e=this.toArray();return Object.defineProperty(e,"constructor",{value:LinkedList,enumerable:!1}),e},typeof Symbol<`u`&&(LinkedList.prototype[Symbol.for(`nodejs.util.inspect.custom`)]=LinkedList.prototype.inspect),LinkedList.from=function(e){var t=new LinkedList;return a(e,function(e){t.push(e)}),t},t.exports=LinkedList})),d=t(((e,t)=>{var i=r(),s=n(),c=a(),l=o();function LRUCache(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={}}LRUCache.prototype.clear=function(){this.size=0,this.head=0,this.tail=0,this.items={}},LRUCache.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},LRUCache.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},LRUCache.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})},LRUCache.prototype.has=function(e){return e in this.items},LRUCache.prototype.get=function(e){var t=this.items[e];if(t!==void 0)return this.splayOnTop(t),this.V[t]},LRUCache.prototype.peek=function(e){var t=this.items[e];if(t!==void 0)return this.V[t]},LRUCache.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++},LRUCache.prototype.keys=function(){var e=0,t=this.size,n=this.head,r=this.K,a=this.forward;return new i(function(){if(e>=t)return{done:!0};var i=r[n];return e++,e<t&&(n=a[n]),{done:!1,value:i}})},LRUCache.prototype.values=function(){var e=0,t=this.size,n=this.head,r=this.V,a=this.forward;return new i(function(){if(e>=t)return{done:!0};var i=r[n];return e++,e<t&&(n=a[n]),{done:!1,value:i}})},LRUCache.prototype.entries=function(){var e=0,t=this.size,n=this.head,r=this.K,a=this.V,o=this.forward;return new i(function(){if(e>=t)return{done:!0};var i=r[n],s=a[n];return e++,e<t&&(n=o[n]),{done:!1,value:[i,s]}})},typeof Symbol<`u`&&(LRUCache.prototype[Symbol.iterator]=LRUCache.prototype.entries),LRUCache.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:LRUCache,enumerable:!1}),e},typeof Symbol<`u`&&(LRUCache.prototype[Symbol.for(`nodejs.util.inspect.custom`)]=LRUCache.prototype.inspect),LRUCache.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 LRUCache(t,n,r);return s(e,function(e,t){i.set(t,e)}),i},t.exports=LRUCache})),f=t(((e,t)=>{var r=d(),i=n(),s=a(),c=o();function LRUMap(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}LRUMap.prototype.clear=function(){this.size=0,this.head=0,this.tail=0,this.items.clear()},LRUMap.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},LRUMap.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})},LRUMap.prototype.has=function(e){return this.items.has(e)},LRUMap.prototype.get=function(e){var t=this.items.get(e);if(t!==void 0)return this.splayOnTop(t),this.V[t]},LRUMap.prototype.peek=function(e){var t=this.items.get(e);if(t!==void 0)return this.V[t]},LRUMap.prototype.splayOnTop=r.prototype.splayOnTop,LRUMap.prototype.forEach=r.prototype.forEach,LRUMap.prototype.keys=r.prototype.keys,LRUMap.prototype.values=r.prototype.values,LRUMap.prototype.entries=r.prototype.entries,typeof Symbol<`u`&&(LRUMap.prototype[Symbol.iterator]=LRUMap.prototype.entries),LRUMap.prototype.inspect=r.prototype.inspect,LRUMap.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 a=new LRUMap(t,n,r);return i(e,function(e,t){a.set(t,e)}),a},t.exports=LRUMap})),p=t(((e,t)=>{var i=r(),a=n();function Stack(){this.clear()}Stack.prototype.clear=function(){this.items=[],this.size=0},Stack.prototype.push=function(e){return this.items.push(e),++this.size},Stack.prototype.pop=function(){if(this.size!==0)return this.size--,this.items.pop()},Stack.prototype.peek=function(){return this.items[this.size-1]},Stack.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)},Stack.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},Stack.prototype.values=function(){var e=this.items,t=e.length,n=0;return new i(function(){if(n>=t)return{done:!0};var r=e[t-n-1];return n++,{value:r,done:!1}})},Stack.prototype.entries=function(){var e=this.items,t=e.length,n=0;return new i(function(){if(n>=t)return{done:!0};var r=e[t-n-1];return{value:[n++,r],done:!1}})},typeof Symbol<`u`&&(Stack.prototype[Symbol.iterator]=Stack.prototype.values),Stack.prototype.toString=function(){return this.toArray().join(`,`)},Stack.prototype.toJSON=function(){return this.toArray()},Stack.prototype.inspect=function(){var e=this.toArray();return Object.defineProperty(e,"constructor",{value:Stack,enumerable:!1}),e},typeof Symbol<`u`&&(Stack.prototype[Symbol.for(`nodejs.util.inspect.custom`)]=Stack.prototype.inspect),Stack.from=function(e){var t=new Stack;return a(e,function(e){t.push(e)}),t},Stack.of=function(){return Stack.from(arguments)},t.exports=Stack})),m=e(i(),1),h=e(s(),1),g=e(c(),1),_=e(u(),1),v=e(f(),1),y=e(l(),1),b=e(p(),1);export{y as a,v as i,g as n,m as o,_ as r,b as s,h as t};
@@ -1,3 +1,3 @@
1
- import{i as e}from"../rolldown-runtime.mjs";import t from"node:path";import n from"node:process";import{fileURLToPath as r}from"node:url";import{stripVTControlCharacters as i}from"node:util";import{on as a,once as o}from"node:events";import{spawn as s}from"node:child_process";import c from"node:fs/promises";import{pipeline as l}from"node:stream/promises";import*as u from"node:readline/promises";const getContext=e=>({start:n.hrtime.bigint(),command:e.map(e=>getCommandPart(i(e))).join(` `),state:{stdout:``,stderr:``,output:``,isIterating:{},nonIterable:[!1,!1]}}),getCommandPart=e=>/[^\w./-]/.test(e)?`'${e.replaceAll(`'`,`'\\''`)}'`:e,getOptions=({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,p=o[0]?.string;return{...u,input:p,stdio:p===void 0?o:[`pipe`,...o.slice(1)],env:c?addLocalPath(f??n.env,d):f,cwd:d}},addLocalPath=({Path:e=``,PATH:n=e,...r},i)=>{let a=n.split(t.delimiter),o=getLocalPaths([],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)}},getLocalPaths=(e,n)=>e.at(-1)===n?e:getLocalPaths([...e,n],t.resolve(n,`..`)),applyForceShell=async(e,t,n)=>await shouldForceShell(e,n)?[escapeFile(e),t.map(e=>escapeArgument(e)),{...n,shell:!0}]:[e,t,n],shouldForceShell=async(e,{shell:t,cwd:r,env:i=n.env})=>n.platform===`win32`&&!t&&!await isExe(e,r,i),isExe=(e,t,{Path:n=``,PATH:r=n})=>m.some(t=>e.toLowerCase().endsWith(t))||p(e,t,r),d={},memoize=e=>(...t)=>d[t.join(`\0`)]??=e(...t),f=memoize(c.access),p=memoize(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=>m.map(r=>f(`${t.resolve(n,e)}${r}`))))}catch{return!1}return!0}),m=[`.exe`,`.com`],escapeArgument=e=>escapeFile(escapeFile(`"${e.replaceAll(/(\\*)"/g,`$1$1\\"`).replace(/(\\*)$/,`$1$1`)}"`)),escapeFile=e=>e.replaceAll(/([()\][%!^"`<>&|;, *?])/g,`^$1`),getResult=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=>onStreamError(e))]),checkFailure(n,getErrorOutput(r)),getOutputs(n)}catch(e){throw await Promise.allSettled([i]),getResultError(e,r,n)}},onStreamError=async e=>{for await(let[t]of a(e,`error`))if(![`ERR_STREAM_PREMATURE_CLOSE`,`EPIPE`].includes(t?.code))throw t},checkFailure=({command:e},{exitCode:t,signalName:n})=>{if(n!==void 0)throw new SubprocessError(`Command was terminated with ${n}: ${e}`);if(t!==void 0)throw new SubprocessError(`Command failed with exit code ${t}: ${e}`)},getResultError=(e,t,n)=>Object.assign(getErrorInstance(e,n),getErrorOutput(t),getOutputs(n)),getErrorInstance=(e,{command:t})=>e instanceof SubprocessError?e:new SubprocessError(`Command failed: ${t}`,{cause:e});var SubprocessError=class extends Error{name=`SubprocessError`};const getErrorOutput=({exitCode:e,signalCode:t})=>({...e<1?{}:{exitCode:e},...t===null?{}:{signalName:t}}),getOutputs=({state:{stdout:e,stderr:t,output:r},command:i,start:a})=>({stdout:getOutput(e),stderr:getOutput(t),output:getOutput(r),command:i,durationMs:Number(n.hrtime.bigint()-a)/1e6}),getOutput=e=>e.at(-1)===`
2
- `?e.slice(0,e.at(-2)===`\r`?-2:-1):e,spawnSubprocess=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 applyForceShell(e,t,r),[e,t,r]=concatenateShell(e,t,r);let a=s(e,t,r);return bufferOutput(a.stdout,i,`stdout`),bufferOutput(a.stderr,i,`stderr`),a.once(`error`,()=>{}),await o(a,`spawn`),a}catch(e){throw getResultError(e,{},i)}},concatenateShell=(e,t,n)=>n.shell&&t.length>0?[[e,...t].join(` `),[],n]:[e,t,n],bufferOutput=(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})))},handlePipe=async e=>{let[[t,n]]=await Promise.all([Promise.allSettled(e),pipeStreams(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}},pipeStreams=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.`);l(t,n).catch(()=>{})}catch(t){throw await Promise.allSettled(e.map(({nodeChildProcess:e})=>closeStdin(e))),t}},closeStdin=async e=>{let{stdin:t}=await e;t.end()},lineIterator=async function*(e,{state:t},n,r){if(t.isIterating[n]===!1)throw Error(`The subprocess must be iterated right away, for example:
1
+ import{r as e}from"../rolldown-runtime.mjs";import t from"node:path";import n from"node:process";import{fileURLToPath as r}from"node:url";import{stripVTControlCharacters as i}from"node:util";import{on as a,once as o}from"node:events";import{spawn as s}from"node:child_process";import c from"node:fs/promises";import{pipeline as l}from"node:stream/promises";import*as u from"node:readline/promises";const getContext=e=>({start:n.hrtime.bigint(),command:e.map(e=>getCommandPart(i(e))).join(` `),state:{stdout:``,stderr:``,output:``,isIterating:{},nonIterable:[!1,!1]}}),getCommandPart=e=>/[^\w./-]/.test(e)?`'${e.replaceAll(`'`,`'\\''`)}'`:e,getOptions=({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,p=o[0]?.string;return{...u,input:p,stdio:p===void 0?o:[`pipe`,...o.slice(1)],env:c?addLocalPath(f??n.env,d):f,cwd:d}},addLocalPath=({Path:e=``,PATH:n=e,...r},i)=>{let a=n.split(t.delimiter),o=getLocalPaths([],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)}},getLocalPaths=(e,n)=>e.at(-1)===n?e:getLocalPaths([...e,n],t.resolve(n,`..`)),applyForceShell=async(e,t,n)=>await shouldForceShell(e,n)?[escapeFile(e),t.map(e=>escapeArgument(e)),{...n,shell:!0}]:[e,t,n],shouldForceShell=async(e,{shell:t,cwd:r,env:i=n.env})=>n.platform===`win32`&&!t&&!await isExe(e,r,i),isExe=(e,t,{Path:n=``,PATH:r=n})=>m.some(t=>e.toLowerCase().endsWith(t))||p(e,t,r),d={},memoize=e=>(...t)=>d[t.join(`\0`)]??=e(...t),f=memoize(c.access),p=memoize(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=>m.map(r=>f(`${t.resolve(n,e)}${r}`))))}catch{return!1}return!0}),m=[`.exe`,`.com`],escapeArgument=e=>escapeFile(escapeFile(`"${e.replaceAll(/(\\*)"/g,`$1$1\\"`).replace(/(\\*)$/,`$1$1`)}"`)),escapeFile=e=>e.replaceAll(/([()\][%!^"`<>&|;, *?])/g,`^$1`),getResult=async(e,t,n)=>{let r=await e;t.input!==void 0&&r.stdin.end(t.input);let i=o(r,`close`);try{return await Promise.race([i,...r.stdio.filter(Boolean).map(e=>onStreamError(e))]),checkFailure(n,getErrorOutput(r)),getOutputs(n)}catch(e){throw await Promise.allSettled([i]),getResultError(e,r,n,t)}},onStreamError=async e=>{for await(let[t]of a(e,`error`))if(![`ERR_STREAM_PREMATURE_CLOSE`,`EPIPE`].includes(t?.code))throw t},checkFailure=({command:e},{exitCode:t,signalName:n})=>{if(n!==void 0)throw new SubprocessError(`Command was terminated with ${n}: ${e}`);if(t!==void 0)throw new SubprocessError(`Command failed with exit code ${t}: ${e}`)},getResultError=(e,t,n,{signal:r})=>Object.assign(getErrorInstance(e,n),getErrorOutput(t),{isCanceled:r?.aborted===!0},getOutputs(n)),getErrorInstance=(e,{command:t})=>e instanceof SubprocessError?e:new SubprocessError(`Command failed: ${t}`,{cause:e});var SubprocessError=class extends Error{name=`SubprocessError`};const getErrorOutput=({exitCode:e,signalCode:t})=>({...e<1?{}:{exitCode:e},...t===null?{}:{signalName:t}}),getOutputs=({state:{stdout:e,stderr:t,output:r},command:i,start:a})=>({stdout:getOutput(e),stderr:getOutput(t),output:getOutput(r),command:i,durationMs:Number(n.hrtime.bigint()-a)/1e6}),getOutput=e=>e.at(-1)===`
2
+ `?e.slice(0,e.at(-2)===`\r`?-2:-1):e,spawnSubprocess=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 applyForceShell(e,t,r),[e,t,r]=concatenateShell(e,t,r);let a=s(e,t,r);return bufferOutput(a.stdout,i,`stdout`),bufferOutput(a.stderr,i,`stderr`),a.once(`error`,()=>{}),await o(a,`spawn`),a}catch(e){throw getResultError(e,{},i,r)}},concatenateShell=(e,t,n)=>n.shell&&t.length>0?[[e,...t].join(` `),[],n]:[e,t,n],bufferOutput=(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})))},handlePipe=async e=>{let[[t,n]]=await Promise.all([Promise.allSettled(e),pipeStreams(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}},pipeStreams=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.`);l(t,n).catch(()=>{})}catch(t){throw await Promise.allSettled(e.map(({nodeChildProcess:e})=>closeStdin(e))),t}},closeStdin=async e=>{let{stdin:t}=await e;t.end()},lineIterator=async function*(e,{state:t},n,r){if(t.isIterating[n]===!1)throw Error(`The subprocess must be iterated right away, for example:
3
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'.`)}handleErrors(e),yield*u.createInterface({input:i})}finally{await e}},handleErrors=async e=>{try{await e}catch{}},combineAsyncIterators=async function*({state:e},...t){try{let n=[];for(;t.length>0;){n=t.map((t,r)=>n[r]??getNext(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()))}},getNext=async(e,t,{nonIterable:n})=>{try{return await e.next()}catch(r){return shouldIgnoreError(n,t)?e.return():e.throw(r)}},shouldIgnoreError=(e,t)=>e.every(Boolean)?t!==e.length-1:e[t];function spawn$1(e,t,n,r){let[i=[],a={}]=Array.isArray(t)?[t,n]:[[],t],o=getContext([e,...i]),s=getOptions(a),c=spawnSubprocess(e,i,s,o),l=getResult(c,s,o);Object.assign(l,{nodeChildProcess:c}),l=r?handlePipe([r,l]):l;let u=lineIterator(l,o,`stdout`,0),d=lineIterator(l,o,`stderr`,1);return Object.assign(l,{nodeChildProcess:c,stdout:u,stderr:d,[Symbol.asyncIterator]:()=>combineAsyncIterators(o,u,d),pipe:(e,t,n)=>spawn$1(e,t,n,l)})}e(spawn$1,`spawn`);export{SubprocessError as n,spawn$1 as t};
@@ -1 +1 @@
1
- import"../rolldown-runtime.mjs";import{t as e}from"./eventemitter3.mjs";var TimeoutError=class extends Error{constructor(e){super(e),this.name=`TimeoutError`}},AbortError=class extends Error{constructor(e){super(),this.name=`AbortError`,this.message=e}};const getDOMException=e=>globalThis.DOMException===void 0?new AbortError(e):new DOMException(e),getAbortedReason=e=>{let t=e.reason===void 0?getDOMException(`This operation was aborted.`):e.reason;return t instanceof Error?t:getDOMException(t)};function pTimeout(e,t){let{milliseconds:n,fallback:r,message:i,customTimers:a={setTimeout,clearTimeout}}=t,o,abortHandler,s=new Promise((s,c)=>{if(typeof n!=`number`||Math.sign(n)!==1)throw TypeError(`Expected \`milliseconds\` to be a positive number, got \`${n}\``);if(t.signal){let{signal:e}=t;e.aborted&&c(getAbortedReason(e)),abortHandler=()=>{c(getAbortedReason(e))},e.addEventListener(`abort`,abortHandler,{once:!0})}if(n===1/0){e.then(s,c);return}let l=new TimeoutError;o=a.setTimeout.call(void 0,()=>{if(r){try{s(r())}catch(e){c(e)}return}typeof e.cancel==`function`&&e.cancel(),i===!1?s():i instanceof Error?c(i):(l.message=i??`Promise timed out after ${n} milliseconds`,c(l))},n),(async()=>{try{s(await e)}catch(e){c(e)}})()}).finally(()=>{s.clear(),abortHandler&&t.signal&&t.signal.removeEventListener(`abort`,abortHandler)});return s.clear=()=>{a.clearTimeout.call(void 0,o),o=void 0},s}function lowerBound(e,t,n){let r=0,i=e.length;for(;i>0;){let a=Math.trunc(i/2),o=r+a;n(e[o],t)<=0?(r=++o,i-=a+1):i=a}return r}var PriorityQueue=class{#e=[];enqueue(e,t){t={priority:0,...t};let n={priority:t.priority,id:t.id,run:e};if(this.size===0||this.#e[this.size-1].priority>=t.priority){this.#e.push(n);return}let r=lowerBound(this.#e,n,(e,t)=>t.priority-e.priority);this.#e.splice(r,0,n)}setPriority(e,t){let n=this.#e.findIndex(t=>t.id===e);if(n===-1)throw ReferenceError(`No promise function with the id "${e}" exists in the queue.`);let[r]=this.#e.splice(n,1);this.enqueue(r.run,{priority:t,id:e})}dequeue(){return this.#e.shift()?.run}filter(e){return this.#e.filter(t=>t.priority===e.priority).map(e=>e.run)}get size(){return this.#e.length}},PQueue=class extends e.default{#e;#t;#n=0;#r;#i;#a=0;#o;#s;#c;#l;#u=0;#d;#f;#p;#m=1n;timeout;constructor(e){if(super(),e={carryoverConcurrencyCount:!1,intervalCap:1/0,interval:0,concurrency:1/0,autoStart:!0,queueClass:PriorityQueue,...e},!(typeof e.intervalCap==`number`&&e.intervalCap>=1))throw TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${e.intervalCap?.toString()??``}\` (${typeof e.intervalCap})`);if(e.interval===void 0||!(Number.isFinite(e.interval)&&e.interval>=0))throw TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${e.interval?.toString()??``}\` (${typeof e.interval})`);this.#e=e.carryoverConcurrencyCount,this.#t=e.intervalCap===1/0||e.interval===0,this.#r=e.intervalCap,this.#i=e.interval,this.#c=new e.queueClass,this.#l=e.queueClass,this.concurrency=e.concurrency,this.timeout=e.timeout,this.#p=e.throwOnTimeout===!0,this.#f=e.autoStart===!1}get#h(){return this.#t||this.#n<this.#r}get#g(){return this.#u<this.#d}#_(){this.#u--,this.#b(),this.emit(`next`)}#v(){this.#S(),this.#x(),this.#s=void 0}get#y(){let e=Date.now();if(this.#o===void 0){let t=this.#a-e;if(t<0)this.#n=this.#e?this.#u:0;else return this.#s===void 0&&(this.#s=setTimeout(()=>{this.#v()},t)),!0}return!1}#b(){if(this.#c.size===0)return this.#o&&clearInterval(this.#o),this.#o=void 0,this.emit(`empty`),this.#u===0&&this.emit(`idle`),!1;if(!this.#f){let e=!this.#y;if(this.#h&&this.#g){let t=this.#c.dequeue();return t?(this.emit(`active`),t(),e&&this.#x(),!0):!1}}return!1}#x(){this.#t||this.#o!==void 0||(this.#o=setInterval(()=>{this.#S()},this.#i),this.#a=Date.now()+this.#i)}#S(){this.#n===0&&this.#u===0&&this.#o&&(clearInterval(this.#o),this.#o=void 0),this.#n=this.#e?this.#u:0,this.#C()}#C(){for(;this.#b(););}get concurrency(){return this.#d}set concurrency(e){if(!(typeof e==`number`&&e>=1))throw TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${e}\` (${typeof e})`);this.#d=e,this.#C()}async#w(e){return new Promise((t,n)=>{e.addEventListener(`abort`,()=>{n(e.reason)},{once:!0})})}setPriority(e,t){this.#c.setPriority(e,t)}async add(e,t={}){return t.id??=(this.#m++).toString(),t={timeout:this.timeout,throwOnTimeout:this.#p,...t},new Promise((n,r)=>{this.#c.enqueue(async()=>{this.#u++;try{t.signal?.throwIfAborted(),this.#n++;let r=e({signal:t.signal});t.timeout&&(r=pTimeout(Promise.resolve(r),{milliseconds:t.timeout})),t.signal&&(r=Promise.race([r,this.#w(t.signal)]));let i=await r;n(i),this.emit(`completed`,i)}catch(e){if(e instanceof TimeoutError&&!t.throwOnTimeout){n();return}r(e),this.emit(`error`,e)}finally{this.#_()}},t),this.emit(`add`),this.#b()})}async addAll(e,t){return Promise.all(e.map(async e=>this.add(e,t)))}start(){return this.#f?(this.#f=!1,this.#C(),this):this}pause(){this.#f=!0}clear(){this.#c=new this.#l}async onEmpty(){this.#c.size!==0&&await this.#T(`empty`)}async onSizeLessThan(e){this.#c.size<e||await this.#T(`next`,()=>this.#c.size<e)}async onIdle(){this.#u===0&&this.#c.size===0||await this.#T(`idle`)}async#T(e,t){return new Promise(n=>{let listener=()=>{t&&!t()||(this.off(e,listener),n())};this.on(e,listener)})}get size(){return this.#c.size}sizeBy(e){return this.#c.filter(e).length}get pending(){return this.#u}get isPaused(){return this.#f}};export{PQueue as t};
1
+ import"../rolldown-runtime.mjs";import{t as e}from"./eventemitter3.mjs";var TimeoutError=class extends Error{constructor(e){super(e),this.name=`TimeoutError`}},AbortError=class extends Error{constructor(e){super(),this.name=`AbortError`,this.message=e}};const getDOMException=e=>globalThis.DOMException===void 0?new AbortError(e):new DOMException(e),getAbortedReason=e=>{let t=e.reason===void 0?getDOMException(`This operation was aborted.`):e.reason;return t instanceof Error?t:getDOMException(t)};function pTimeout(e,t){let{milliseconds:n,fallback:r,message:i,customTimers:a={setTimeout,clearTimeout}}=t,o,abortHandler,s=new Promise((s,c)=>{if(typeof n!=`number`||Math.sign(n)!==1)throw TypeError(`Expected \`milliseconds\` to be a positive number, got \`${n}\``);if(t.signal){let{signal:e}=t;e.aborted&&c(getAbortedReason(e)),abortHandler=()=>{c(getAbortedReason(e))},e.addEventListener(`abort`,abortHandler,{once:!0})}if(n===1/0){e.then(s,c);return}let l=new TimeoutError;o=a.setTimeout.call(void 0,()=>{if(r){try{s(r())}catch(e){c(e)}return}typeof e.cancel==`function`&&e.cancel(),i===!1?s():i instanceof Error?c(i):(l.message=i??`Promise timed out after ${n} milliseconds`,c(l))},n),(async()=>{try{s(await e)}catch(e){c(e)}})()}).finally(()=>{s.clear(),abortHandler&&t.signal&&t.signal.removeEventListener(`abort`,abortHandler)});return s.clear=()=>{a.clearTimeout.call(void 0,o),o=void 0},s}function lowerBound(e,t,n){let r=0,i=e.length;for(;i>0;){let a=Math.trunc(i/2),o=r+a;n(e[o],t)<=0?(r=++o,i-=a+1):i=a}return r}var PriorityQueue=class{#e=[];enqueue(e,t){t={priority:0,...t};let n={priority:t.priority,id:t.id,run:e};if(this.size===0||this.#e[this.size-1].priority>=t.priority){this.#e.push(n);return}let r=lowerBound(this.#e,n,(e,t)=>t.priority-e.priority);this.#e.splice(r,0,n)}setPriority(e,t){let n=this.#e.findIndex(t=>t.id===e);if(n===-1)throw ReferenceError(`No promise function with the id "${e}" exists in the queue.`);let[r]=this.#e.splice(n,1);this.enqueue(r.run,{priority:t,id:e})}dequeue(){return this.#e.shift()?.run}filter(e){return this.#e.filter(t=>t.priority===e.priority).map(e=>e.run)}get size(){return this.#e.length}},PQueue=class extends e.default{#e;#t;#n=0;#r;#i;#a=0;#o;#s;#c;#l;#u=0;#d;#f;#p;#m=1n;timeout;constructor(e){if(super(),e={carryoverConcurrencyCount:!1,intervalCap:1/0,interval:0,concurrency:1/0,autoStart:!0,queueClass:PriorityQueue,...e},!(typeof e.intervalCap==`number`&&e.intervalCap>=1))throw TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${e.intervalCap?.toString()??``}\` (${typeof e.intervalCap})`);if(e.interval===void 0||!(Number.isFinite(e.interval)&&e.interval>=0))throw TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${e.interval?.toString()??``}\` (${typeof e.interval})`);this.#e=e.carryoverConcurrencyCount,this.#t=e.intervalCap===1/0||e.interval===0,this.#r=e.intervalCap,this.#i=e.interval,this.#c=new e.queueClass,this.#l=e.queueClass,this.concurrency=e.concurrency,this.timeout=e.timeout,this.#p=e.throwOnTimeout===!0,this.#f=e.autoStart===!1}get#h(){return this.#t||this.#n<this.#r}get#g(){return this.#u<this.#d}#_(){this.#u--,this.#b(),this.emit(`next`)}#v(){this.#S(),this.#x(),this.#s=void 0}get#y(){let e=Date.now();if(this.#o===void 0){let t=this.#a-e;if(t<0)this.#n=this.#e?this.#u:0;else return this.#s===void 0&&(this.#s=setTimeout(()=>{this.#v()},t)),!0}return!1}#b(){if(this.#c.size===0)return this.#o&&clearInterval(this.#o),this.#o=void 0,this.emit(`empty`),this.#u===0&&this.emit(`idle`),!1;if(!this.#f){let e=!this.#y;if(this.#h&&this.#g){let t=this.#c.dequeue();return t?(this.emit(`active`),t(),e&&this.#x(),!0):!1}}return!1}#x(){this.#t||this.#o!==void 0||(this.#o=setInterval(()=>{this.#S()},this.#i),this.#a=Date.now()+this.#i)}#S(){this.#n===0&&this.#u===0&&this.#o&&(clearInterval(this.#o),this.#o=void 0),this.#n=this.#e?this.#u:0,this.#C()}#C(){for(;this.#b(););}get concurrency(){return this.#d}set concurrency(e){if(!(typeof e==`number`&&e>=1))throw TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${e}\` (${typeof e})`);this.#d=e,this.#C()}async#w(e){return new Promise((t,n)=>{e.addEventListener(`abort`,()=>{n(e.reason)},{once:!0})})}setPriority(e,t){this.#c.setPriority(e,t)}async add(e,t={}){return t.id??=(this.#m++).toString(),t={timeout:this.timeout,throwOnTimeout:this.#p,...t},new Promise((n,r)=>{this.#c.enqueue(async()=>{this.#u++;try{t.signal?.throwIfAborted(),this.#n++;let r=e({signal:t.signal});t.timeout&&(r=pTimeout(Promise.resolve(r),{milliseconds:t.timeout})),t.signal&&(r=Promise.race([r,this.#w(t.signal)]));let i=await r;n(i),this.emit(`completed`,i)}catch(e){if(e instanceof TimeoutError&&!t.throwOnTimeout){n();return}r(e),this.emit(`error`,e)}finally{this.#_()}},t),this.emit(`add`),this.#b()})}async addAll(e,t){return Promise.all(e.map(async e=>this.add(e,t)))}start(){return this.#f?(this.#f=!1,this.#C(),this):this}pause(){this.#f=!0}clear(){this.#c=new this.#l}async onEmpty(){this.#c.size!==0&&await this.#T(`empty`)}async onSizeLessThan(e){this.#c.size<e||await this.#T(`next`,()=>this.#c.size<e)}async onIdle(){(this.#u!==0||this.#c.size!==0)&&await this.#T(`idle`)}async#T(e,t){return new Promise(n=>{let listener=()=>{t&&!t()||(this.off(e,listener),n())};this.on(e,listener)})}get size(){return this.#c.size}sizeBy(e){return this.#c.filter(e).length}get pending(){return this.#u}get isPaused(){return this.#f}};export{PQueue as t};
@@ -0,0 +1 @@
1
+ import{t as e}from"../rolldown-runtime.mjs";var t=e(((e,t)=>{let n=`[^\\\\/]`,r=`[^/]`,i=`(?:\\/|$)`,a=`(?:^|\\/)`,o=`\\.{1,2}${i}`,s={DOT_LITERAL:`\\.`,PLUS_LITERAL:`\\+`,QMARK_LITERAL:`\\?`,SLASH_LITERAL:`\\/`,ONE_CHAR:`(?=.)`,QMARK:r,END_ANCHOR:i,DOTS_SLASH:o,NO_DOT:`(?!\\.)`,NO_DOTS:`(?!${a}${o})`,NO_DOT_SLASH:`(?!\\.{0,1}${i})`,NO_DOTS_SLASH:`(?!${o})`,QMARK_NO_DOT:`[^.\\/]`,STAR:`${r}*?`,START_ANCHOR:a,SEP:`/`},c={...s,SLASH_LITERAL:`[\\\\/]`,QMARK:n,STAR:`${n}*?`,DOTS_SLASH:`\\.{1,2}(?:[\\\\/]|$)`,NO_DOT:`(?!\\.)`,NO_DOTS:`(?!(?:^|[\\\\/])\\.{1,2}(?:[\\\\/]|$))`,NO_DOT_SLASH:`(?!\\.{0,1}(?:[\\\\/]|$))`,NO_DOTS_SLASH:`(?!\\.{1,2}(?:[\\\\/]|$))`,QMARK_NO_DOT:`[^.\\\\/]`,START_ANCHOR:`(?:^|[\\\\/])`,END_ANCHOR:`(?:[\\\\/]|$)`,SEP:`\\`};t.exports={DEFAULT_MAX_EXTGLOB_RECURSION:0,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:{__proto__:null,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:{__proto__:null,"***":`*`,"**/**":`**`,"**/**/**":`**`},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,extglobChars(e){return{"!":{type:`negate`,open:`(?:(?!(?:`,close:`))${e.STAR})`},"?":{type:`qmark`,open:`(?:`,close:`)?`},"+":{type:`plus`,open:`(?:`,close:`)+`},"*":{type:`star`,open:`(?:`,close:`)*`},"@":{type:`at`,open:`(?:`,close:`)`}}},globChars(e){return e===!0?c:s}}})),n=e((e=>{let{REGEX_BACKSLASH:n,REGEX_REMOVE_BACKSLASH:r,REGEX_SPECIAL_CHARS:i,REGEX_SPECIAL_CHARS_GLOBAL:a}=t();e.isObject=e=>typeof e==`object`&&!!e&&!Array.isArray(e),e.hasRegexChars=e=>i.test(e),e.isRegexChar=t=>t.length===1&&e.hasRegexChars(t),e.escapeRegex=e=>e.replace(a,`\\$1`),e.toPosixSlashes=e=>e.replace(n,`/`),e.isWindows=()=>{if(typeof navigator<`u`&&navigator.platform){let e=navigator.platform.toLowerCase();return e===`win32`||e===`windows`}return typeof process<`u`&&process.platform?process.platform===`win32`:!1},e.removeBackslashes=e=>e.replace(r,e=>e===`\\`?``:e),e.escapeLast=(t,n,r)=>{let i=t.lastIndexOf(n,r);return i===-1?t:t[i-1]===`\\`?e.escapeLast(t,n,i-1):`${t.slice(0,i)}\\${t.slice(i)}`},e.removePrefix=(e,t={})=>{let n=e;return n.startsWith(`./`)&&(n=n.slice(2),t.prefix=`./`),n},e.wrapOutput=(e,t={},n={})=>{let r=`${n.contains?``:`^`}(?:${e})${n.contains?``:`$`}`;return t.negated===!0&&(r=`(?:^(?!${r}).*$)`),r},e.basename=(e,{windows:t}={})=>{let n=e.split(t?/[\\/]/:`/`),r=n[n.length-1];return r===``?n[n.length-2]:r}})),r=e(((e,r)=>{let i=n(),{CHAR_ASTERISK:a,CHAR_AT:o,CHAR_BACKWARD_SLASH:s,CHAR_COMMA:c,CHAR_DOT:l,CHAR_EXCLAMATION_MARK:u,CHAR_FORWARD_SLASH:d,CHAR_LEFT_CURLY_BRACE:f,CHAR_LEFT_PARENTHESES:p,CHAR_LEFT_SQUARE_BRACKET:m,CHAR_PLUS:h,CHAR_QUESTION_MARK:g,CHAR_RIGHT_CURLY_BRACE:_,CHAR_RIGHT_PARENTHESES:v,CHAR_RIGHT_SQUARE_BRACKET:y}=t(),isPathSeparator=e=>e===d||e===s,depth=e=>{e.isPrefix!==!0&&(e.depth=e.isGlobstar?1/0:1)},scan=(e,t)=>{let n=t||{},r=e.length-1,b=n.parts===!0||n.scanToEnd===!0,x=[],S=[],C=[],w=e,T=-1,E=0,D=0,O=!1,k=!1,A=!1,j=!1,M=!1,N=!1,P=!1,F=!1,I=!1,L=!1,R=0,z,B,V={value:``,depth:0,isGlob:!1},eos=()=>T>=r,peek=()=>w.charCodeAt(T+1),advance=()=>(z=B,w.charCodeAt(++T));for(;T<r;){B=advance();let e;if(B===s){P=V.backslashes=!0,B=advance(),B===f&&(N=!0);continue}if(N===!0||B===f){for(R++;eos()!==!0&&(B=advance());){if(B===s){P=V.backslashes=!0,advance();continue}if(B===f){R++;continue}if(N!==!0&&B===l&&(B=advance())===l){if(O=V.isBrace=!0,A=V.isGlob=!0,L=!0,b===!0)continue;break}if(N!==!0&&B===c){if(O=V.isBrace=!0,A=V.isGlob=!0,L=!0,b===!0)continue;break}if(B===_&&(R--,R===0)){N=!1,O=V.isBrace=!0,L=!0;break}}if(b===!0)continue;break}if(B===d){if(x.push(T),S.push(V),V={value:``,depth:0,isGlob:!1},L===!0)continue;if(z===l&&T===E+1){E+=2;continue}D=T+1;continue}if(n.noext!==!0&&(B===h||B===o||B===a||B===g||B===u)&&peek()===p){if(A=V.isGlob=!0,j=V.isExtglob=!0,L=!0,B===u&&T===E&&(I=!0),b===!0){for(;eos()!==!0&&(B=advance());){if(B===s){P=V.backslashes=!0,B=advance();continue}if(B===v){A=V.isGlob=!0,L=!0;break}}continue}break}if(B===a){if(z===a&&(M=V.isGlobstar=!0),A=V.isGlob=!0,L=!0,b===!0)continue;break}if(B===g){if(A=V.isGlob=!0,L=!0,b===!0)continue;break}if(B===m){for(;eos()!==!0&&(e=advance());){if(e===s){P=V.backslashes=!0,advance();continue}if(e===y){k=V.isBracket=!0,A=V.isGlob=!0,L=!0;break}}if(b===!0)continue;break}if(n.nonegate!==!0&&B===u&&T===E){F=V.negated=!0,E++;continue}if(n.noparen!==!0&&B===p){if(A=V.isGlob=!0,b===!0){for(;eos()!==!0&&(B=advance());){if(B===p){P=V.backslashes=!0,B=advance();continue}if(B===v){L=!0;break}}continue}break}if(A===!0){if(L=!0,b===!0)continue;break}}n.noext===!0&&(j=!1,A=!1);let H=w,U=``,W=``;E>0&&(U=w.slice(0,E),w=w.slice(E),D-=E),H&&A===!0&&D>0?(H=w.slice(0,D),W=w.slice(D)):A===!0?(H=``,W=w):H=w,H&&H!==``&&H!==`/`&&H!==w&&isPathSeparator(H.charCodeAt(H.length-1))&&(H=H.slice(0,-1)),n.unescape===!0&&(W&&=i.removeBackslashes(W),H&&P===!0&&(H=i.removeBackslashes(H)));let G={prefix:U,input:e,start:E,base:H,glob:W,isBrace:O,isBracket:k,isGlob:A,isExtglob:j,isGlobstar:M,negated:F,negatedExtglob:I};if(n.tokens===!0&&(G.maxDepth=0,isPathSeparator(B)||S.push(V),G.tokens=S),n.parts===!0||n.tokens===!0){let t;for(let r=0;r<x.length;r++){let i=t?t+1:E,a=x[r],o=e.slice(i,a);n.tokens&&(r===0&&E!==0?(S[r].isPrefix=!0,S[r].value=U):S[r].value=o,depth(S[r]),G.maxDepth+=S[r].depth),(r!==0||o!==``)&&C.push(o),t=a}if(t&&t+1<e.length){let r=e.slice(t+1);C.push(r),n.tokens&&(S[S.length-1].value=r,depth(S[S.length-1]),G.maxDepth+=S[S.length-1].depth)}G.slashes=x,G.parts=C}return G};r.exports=scan})),i=e(((e,r)=>{let i=t(),a=n(),{MAX_LENGTH:o,POSIX_REGEX_SOURCE:s,REGEX_NON_SPECIAL_CHARS:c,REGEX_SPECIAL_CHARS_BACKREF:l,REPLACEMENTS:u}=i,expandRange=(e,t)=>{if(typeof t.expandRange==`function`)return t.expandRange(...e,t);e.sort();let n=`[${e.join(`-`)}]`;try{new RegExp(n)}catch{return e.map(e=>a.escapeRegex(e)).join(`..`)}return n},syntaxError=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,splitTopLevel=e=>{let t=[],n=0,r=0,i=0,a=``,o=!1;for(let s of e){if(o===!0){a+=s,o=!1;continue}if(s===`\\`){a+=s,o=!0;continue}if(s===`"`){i=i===1?0:1,a+=s;continue}if(i===0){if(s===`[`)n++;else if(s===`]`&&n>0)n--;else if(n===0){if(s===`(`)r++;else if(s===`)`&&r>0)r--;else if(s===`|`&&r===0){t.push(a),a=``;continue}}}a+=s}return t.push(a),t},isPlainBranch=e=>{let t=!1;for(let n of e){if(t===!0){t=!1;continue}if(n===`\\`){t=!0;continue}if(/[?*+@!()[\]{}]/.test(n))return!1}return!0},normalizeSimpleBranch=e=>{let t=e.trim(),n=!0;for(;n===!0;)n=!1,/^@\([^\\()[\]{}|]+\)$/.test(t)&&(t=t.slice(2,-1),n=!0);if(isPlainBranch(t))return t.replace(/\\(.)/g,`$1`)},hasRepeatedCharPrefixOverlap=e=>{let t=e.map(normalizeSimpleBranch).filter(Boolean);for(let e=0;e<t.length;e++)for(let n=e+1;n<t.length;n++){let r=t[e],i=t[n],a=r[0];if(!(!a||r!==a.repeat(r.length)||i!==a.repeat(i.length))&&(r===i||r.startsWith(i)||i.startsWith(r)))return!0}return!1},parseRepeatedExtglob=(e,t=!0)=>{if(e[0]!==`+`&&e[0]!==`*`||e[1]!==`(`)return;let n=0,r=0,i=0,a=!1;for(let o=1;o<e.length;o++){let s=e[o];if(a===!0){a=!1;continue}if(s===`\\`){a=!0;continue}if(s===`"`){i=i===1?0:1;continue}if(i!==1){if(s===`[`){n++;continue}if(s===`]`&&n>0){n--;continue}if(!(n>0)){if(s===`(`){r++;continue}if(s===`)`&&(r--,r===0))return t===!0&&o!==e.length-1?void 0:{type:e[0],body:e.slice(2,o),end:o}}}}},buildCharClassStar=e=>`${e.length===1?a.escapeRegex(e[0]):`[${e.map(e=>a.escapeRegex(e)).join(``)}]`}*`,getStarExtglobSequenceChars=e=>{let t=0,n=[];for(;t<e.length;){let r=parseRepeatedExtglob(e.slice(t),!1);if(!r||r.type!==`*`)return;let i=splitTopLevel(r.body).map(e=>e.trim());if(i.length!==1)return;let a=normalizeSimpleBranch(i[0]);if(!a||a.length!==1)return;n.push(a),t+=r.end+1}if(!(n.length<1))return n},repeatedExtglobRecursion=e=>{let t=0,n=e.trim(),r=parseRepeatedExtglob(n);for(;r;)t++,n=r.body.trim(),r=parseRepeatedExtglob(n);return t},analyzeRepeatedExtglob=(e,t)=>{if(t.maxExtglobRecursion===!1)return{risky:!1};let n=typeof t.maxExtglobRecursion==`number`?t.maxExtglobRecursion:i.DEFAULT_MAX_EXTGLOB_RECURSION,r=splitTopLevel(e).map(e=>e.trim());if(r.length>1&&(r.some(e=>e===``)||r.some(e=>/^[*?]+$/.test(e))||hasRepeatedCharPrefixOverlap(r)))return{risky:!0};let a=[],o=!1,s=!0;for(let e of r){let t=getStarExtglobSequenceChars(e);if(t){o=!0,a.push(...t);continue}let r=normalizeSimpleBranch(e);if(r&&r.length===1){a.push(r);continue}if(s=!1,repeatedExtglobRecursion(e)>n)return{risky:!0}}return o?s?{risky:!0,safeOutput:buildCharClassStar([...new Set(a)])}:{risky:!0}:{risky:!1}},parse=(e,t)=>{if(typeof e!=`string`)throw TypeError(`Expected a string`);e=u[e]||e;let n={...t},r=typeof n.maxLength==`number`?Math.min(o,n.maxLength):o,d=e.length;if(d>r)throw SyntaxError(`Input length: ${d}, exceeds maximum allowed length: ${r}`);let f={type:`bos`,value:``,output:n.prepend||``},p=[f],m=n.capture?``:`?:`,h=i.globChars(n.windows),g=i.extglobChars(h),{DOT_LITERAL:_,PLUS_LITERAL:v,SLASH_LITERAL:y,ONE_CHAR:b,DOTS_SLASH:x,NO_DOT:S,NO_DOT_SLASH:C,NO_DOTS_SLASH:w,QMARK:T,QMARK_NO_DOT:E,STAR:D,START_ANCHOR:O}=h,globstar=e=>`(${m}(?:(?!${O}${e.dot?x:_}).)*?)`,k=n.dot?``:S,A=n.dot?T:E,j=n.bash===!0?globstar(n):D;n.capture&&(j=`(${j})`),typeof n.noext==`boolean`&&(n.noextglob=n.noext);let M={input:e,index:-1,start:0,dot:n.dot===!0,consumed:``,output:``,prefix:``,backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:p};e=a.removePrefix(e,M),d=e.length;let N=[],P=[],F=[],I=f,L,eos=()=>M.index===d-1,R=M.peek=(t=1)=>e[M.index+t],z=M.advance=()=>e[++M.index]||``,remaining=()=>e.slice(M.index+1),consume=(e=``,t=0)=>{M.consumed+=e,M.index+=t},append=e=>{M.output+=e.output==null?e.value:e.output,consume(e.value)},negate=()=>{let e=1;for(;R()===`!`&&(R(2)!==`(`||R(3)===`?`);)z(),M.start++,e++;return e%2==0?!1:(M.negated=!0,M.start++,!0)},increment=e=>{M[e]++,F.push(e)},decrement=e=>{M[e]--,F.pop()},push=e=>{if(I.type===`globstar`){let t=M.braces>0&&(e.type===`comma`||e.type===`brace`),n=e.extglob===!0||N.length&&(e.type===`pipe`||e.type===`paren`);e.type!==`slash`&&e.type!==`paren`&&!t&&!n&&(M.output=M.output.slice(0,-I.output.length),I.type=`star`,I.value=`*`,I.output=j,M.output+=I.output)}if(N.length&&e.type!==`paren`&&(N[N.length-1].inner+=e.value),(e.value||e.output)&&append(e),I&&I.type===`text`&&e.type===`text`){I.output=(I.output||I.value)+e.value,I.value+=e.value;return}e.prev=I,p.push(e),I=e},extglobOpen=(e,t)=>{let r={...g[t],conditions:1,inner:``};r.prev=I,r.parens=M.parens,r.output=M.output,r.startIndex=M.index,r.tokensIndex=p.length;let i=(n.capture?`(`:``)+r.open;increment(`parens`),push({type:e,value:t,output:M.output?``:b}),push({type:`paren`,extglob:!0,value:z(),output:i}),N.push(r)},extglobClose=r=>{let i=e.slice(r.startIndex,M.index+1),o=e.slice(r.startIndex+2,M.index),s=analyzeRepeatedExtglob(o,n);if((r.type===`plus`||r.type===`star`)&&s.risky){let e=s.safeOutput?(r.output?``:b)+(n.capture?`(${s.safeOutput})`:s.safeOutput):void 0,t=p[r.tokensIndex];t.type=`text`,t.value=i,t.output=e||a.escapeRegex(i);for(let e=r.tokensIndex+1;e<p.length;e++)p[e].value=``,p[e].output=``,delete p[e].suffix;M.output=r.output+t.output,M.backtrack=!0,push({type:`paren`,extglob:!0,value:L,output:``}),decrement(`parens`);return}let c=r.close+(n.capture?`)`:``),l;if(r.type===`negate`){let e=j;r.inner&&r.inner.length>1&&r.inner.includes(`/`)&&(e=globstar(n)),(e!==j||eos()||/^\)+$/.test(remaining()))&&(c=r.close=`)$))${e}`),r.inner.includes(`*`)&&(l=remaining())&&/^\.[^\\/.]+$/.test(l)&&(c=r.close=`)${parse(l,{...t,fastpaths:!1}).output})${e})`),r.prev.type===`bos`&&(M.negatedExtglob=!0)}push({type:`paren`,extglob:!0,value:L,output:c}),decrement(`parens`)};if(n.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(e)){let r=!1,i=e.replace(l,(e,t,n,i,a,o)=>i===`\\`?(r=!0,e):i===`?`?t?t+i+(a?T.repeat(a.length):``):o===0?A+(a?T.repeat(a.length):``):T.repeat(n.length):i===`.`?_.repeat(n.length):i===`*`?t?t+i+(a?j:``):j:t?e:`\\${e}`);return r===!0&&(i=n.unescape===!0?i.replace(/\\/g,``):i.replace(/\\+/g,e=>e.length%2==0?`\\\\`:e?`\\`:``)),i===e&&n.contains===!0?(M.output=e,M):(M.output=a.wrapOutput(i,M,t),M)}for(;!eos();){if(L=z(),L===`\0`)continue;if(L===`\\`){let e=R();if(e===`/`&&n.bash!==!0||e===`.`||e===`;`)continue;if(!e){L+=`\\`,push({type:`text`,value:L});continue}let t=/^\\+/.exec(remaining()),r=0;if(t&&t[0].length>2&&(r=t[0].length,M.index+=r,r%2!=0&&(L+=`\\`)),n.unescape===!0?L=z():L+=z(),M.brackets===0){push({type:`text`,value:L});continue}}if(M.brackets>0&&(L!==`]`||I.value===`[`||I.value===`[^`)){if(n.posix!==!1&&L===`:`){let e=I.value.slice(1);if(e.includes(`[`)&&(I.posix=!0,e.includes(`:`))){let e=I.value.lastIndexOf(`[`),t=I.value.slice(0,e),n=I.value.slice(e+2),r=s[n];if(r){I.value=t+r,M.backtrack=!0,z(),!f.output&&p.indexOf(I)===1&&(f.output=b);continue}}}(L===`[`&&R()!==`:`||L===`-`&&R()===`]`)&&(L=`\\${L}`),L===`]`&&(I.value===`[`||I.value===`[^`)&&(L=`\\${L}`),n.posix===!0&&L===`!`&&I.value===`[`&&(L=`^`),I.value+=L,append({value:L});continue}if(M.quotes===1&&L!==`"`){L=a.escapeRegex(L),I.value+=L,append({value:L});continue}if(L===`"`){M.quotes=M.quotes===1?0:1,n.keepQuotes===!0&&push({type:`text`,value:L});continue}if(L===`(`){increment(`parens`),push({type:`paren`,value:L});continue}if(L===`)`){if(M.parens===0&&n.strictBrackets===!0)throw SyntaxError(syntaxError(`opening`,`(`));let e=N[N.length-1];if(e&&M.parens===e.parens+1){extglobClose(N.pop());continue}push({type:`paren`,value:L,output:M.parens?`)`:`\\)`}),decrement(`parens`);continue}if(L===`[`){if(n.nobracket===!0||!remaining().includes(`]`)){if(n.nobracket!==!0&&n.strictBrackets===!0)throw SyntaxError(syntaxError(`closing`,`]`));L=`\\${L}`}else increment(`brackets`);push({type:`bracket`,value:L});continue}if(L===`]`){if(n.nobracket===!0||I&&I.type===`bracket`&&I.value.length===1){push({type:`text`,value:L,output:`\\${L}`});continue}if(M.brackets===0){if(n.strictBrackets===!0)throw SyntaxError(syntaxError(`opening`,`[`));push({type:`text`,value:L,output:`\\${L}`});continue}decrement(`brackets`);let e=I.value.slice(1);if(I.posix!==!0&&e[0]===`^`&&!e.includes(`/`)&&(L=`/${L}`),I.value+=L,append({value:L}),n.literalBrackets===!1||a.hasRegexChars(e))continue;let t=a.escapeRegex(I.value);if(M.output=M.output.slice(0,-I.value.length),n.literalBrackets===!0){M.output+=t,I.value=t;continue}I.value=`(${m}${t}|${I.value})`,M.output+=I.value;continue}if(L===`{`&&n.nobrace!==!0){increment(`braces`);let e={type:`brace`,value:L,output:`(`,outputIndex:M.output.length,tokensIndex:M.tokens.length};P.push(e),push(e);continue}if(L===`}`){let e=P[P.length-1];if(n.nobrace===!0||!e){push({type:`text`,value:L,output:L});continue}let t=`)`;if(e.dots===!0){let e=p.slice(),r=[];for(let t=e.length-1;t>=0&&(p.pop(),e[t].type!==`brace`);t--)e[t].type!==`dots`&&r.unshift(e[t].value);t=expandRange(r,n),M.backtrack=!0}if(e.comma!==!0&&e.dots!==!0){let n=M.output.slice(0,e.outputIndex),r=M.tokens.slice(e.tokensIndex);e.value=e.output=`\\{`,L=t=`\\}`,M.output=n;for(let e of r)M.output+=e.output||e.value}push({type:`brace`,value:L,output:t}),decrement(`braces`),P.pop();continue}if(L===`|`){N.length>0&&N[N.length-1].conditions++,push({type:`text`,value:L});continue}if(L===`,`){let e=L,t=P[P.length-1];t&&F[F.length-1]===`braces`&&(t.comma=!0,e=`|`),push({type:`comma`,value:L,output:e});continue}if(L===`/`){if(I.type===`dot`&&M.index===M.start+1){M.start=M.index+1,M.consumed=``,M.output=``,p.pop(),I=f;continue}push({type:`slash`,value:L,output:y});continue}if(L===`.`){if(M.braces>0&&I.type===`dot`){I.value===`.`&&(I.output=_);let e=P[P.length-1];I.type=`dots`,I.output+=L,I.value+=L,e.dots=!0;continue}if(M.braces+M.parens===0&&I.type!==`bos`&&I.type!==`slash`){push({type:`text`,value:L,output:_});continue}push({type:`dot`,value:L,output:_});continue}if(L===`?`){if(!(I&&I.value===`(`)&&n.noextglob!==!0&&R()===`(`&&R(2)!==`?`){extglobOpen(`qmark`,L);continue}if(I&&I.type===`paren`){let e=R(),t=L;(I.value===`(`&&!/[!=<:]/.test(e)||e===`<`&&!/<([!=]|\w+>)/.test(remaining()))&&(t=`\\${L}`),push({type:`text`,value:L,output:t});continue}if(n.dot!==!0&&(I.type===`slash`||I.type===`bos`)){push({type:`qmark`,value:L,output:E});continue}push({type:`qmark`,value:L,output:T});continue}if(L===`!`){if(n.noextglob!==!0&&R()===`(`&&(R(2)!==`?`||!/[!=<:]/.test(R(3)))){extglobOpen(`negate`,L);continue}if(n.nonegate!==!0&&M.index===0){negate();continue}}if(L===`+`){if(n.noextglob!==!0&&R()===`(`&&R(2)!==`?`){extglobOpen(`plus`,L);continue}if(I&&I.value===`(`||n.regex===!1){push({type:`plus`,value:L,output:v});continue}if(I&&(I.type===`bracket`||I.type===`paren`||I.type===`brace`)||M.parens>0){push({type:`plus`,value:L});continue}push({type:`plus`,value:v});continue}if(L===`@`){if(n.noextglob!==!0&&R()===`(`&&R(2)!==`?`){push({type:`at`,extglob:!0,value:L,output:``});continue}push({type:`text`,value:L});continue}if(L!==`*`){(L===`$`||L===`^`)&&(L=`\\${L}`);let e=c.exec(remaining());e&&(L+=e[0],M.index+=e[0].length),push({type:`text`,value:L});continue}if(I&&(I.type===`globstar`||I.star===!0)){I.type=`star`,I.star=!0,I.value+=L,I.output=j,M.backtrack=!0,M.globstar=!0,consume(L);continue}let t=remaining();if(n.noextglob!==!0&&/^\([^?]/.test(t)){extglobOpen(`star`,L);continue}if(I.type===`star`){if(n.noglobstar===!0){consume(L);continue}let r=I.prev,i=r.prev,a=r.type===`slash`||r.type===`bos`,o=i&&(i.type===`star`||i.type===`globstar`);if(n.bash===!0&&(!a||t[0]&&t[0]!==`/`)){push({type:`star`,value:L,output:``});continue}let s=M.braces>0&&(r.type===`comma`||r.type===`brace`),c=N.length&&(r.type===`pipe`||r.type===`paren`);if(!a&&r.type!==`paren`&&!s&&!c){push({type:`star`,value:L,output:``});continue}for(;t.slice(0,3)===`/**`;){let n=e[M.index+4];if(n&&n!==`/`)break;t=t.slice(3),consume(`/**`,3)}if(r.type===`bos`&&eos()){I.type=`globstar`,I.value+=L,I.output=globstar(n),M.output=I.output,M.globstar=!0,consume(L);continue}if(r.type===`slash`&&r.prev.type!==`bos`&&!o&&eos()){M.output=M.output.slice(0,-(r.output+I.output).length),r.output=`(?:${r.output}`,I.type=`globstar`,I.output=globstar(n)+(n.strictSlashes?`)`:`|$)`),I.value+=L,M.globstar=!0,M.output+=r.output+I.output,consume(L);continue}if(r.type===`slash`&&r.prev.type!==`bos`&&t[0]===`/`){let e=t[1]===void 0?``:`|$`;M.output=M.output.slice(0,-(r.output+I.output).length),r.output=`(?:${r.output}`,I.type=`globstar`,I.output=`${globstar(n)}${y}|${y}${e})`,I.value+=L,M.output+=r.output+I.output,M.globstar=!0,consume(L+z()),push({type:`slash`,value:`/`,output:``});continue}if(r.type===`bos`&&t[0]===`/`){I.type=`globstar`,I.value+=L,I.output=`(?:^|${y}|${globstar(n)}${y})`,M.output=I.output,M.globstar=!0,consume(L+z()),push({type:`slash`,value:`/`,output:``});continue}M.output=M.output.slice(0,-I.output.length),I.type=`globstar`,I.output=globstar(n),I.value+=L,M.output+=I.output,M.globstar=!0,consume(L);continue}let r={type:`star`,value:L,output:j};if(n.bash===!0){r.output=`.*?`,(I.type===`bos`||I.type===`slash`)&&(r.output=k+r.output),push(r);continue}if(I&&(I.type===`bracket`||I.type===`paren`)&&n.regex===!0){r.output=L,push(r);continue}(M.index===M.start||I.type===`slash`||I.type===`dot`)&&(I.type===`dot`?(M.output+=C,I.output+=C):n.dot===!0?(M.output+=w,I.output+=w):(M.output+=k,I.output+=k),R()!==`*`&&(M.output+=b,I.output+=b)),push(r)}for(;M.brackets>0;){if(n.strictBrackets===!0)throw SyntaxError(syntaxError(`closing`,`]`));M.output=a.escapeLast(M.output,`[`),decrement(`brackets`)}for(;M.parens>0;){if(n.strictBrackets===!0)throw SyntaxError(syntaxError(`closing`,`)`));M.output=a.escapeLast(M.output,`(`),decrement(`parens`)}for(;M.braces>0;){if(n.strictBrackets===!0)throw SyntaxError(syntaxError(`closing`,`}`));M.output=a.escapeLast(M.output,`{`),decrement(`braces`)}if(n.strictSlashes!==!0&&(I.type===`star`||I.type===`bracket`)&&push({type:`maybe_slash`,value:``,output:`${y}?`}),M.backtrack===!0){M.output=``;for(let e of M.tokens)M.output+=e.output==null?e.value:e.output,e.suffix&&(M.output+=e.suffix)}return M};parse.fastpaths=(e,t)=>{let n={...t},r=typeof n.maxLength==`number`?Math.min(o,n.maxLength):o,s=e.length;if(s>r)throw SyntaxError(`Input length: ${s}, exceeds maximum allowed length: ${r}`);e=u[e]||e;let{DOT_LITERAL:c,SLASH_LITERAL:l,ONE_CHAR:d,DOTS_SLASH:f,NO_DOT:p,NO_DOTS:m,NO_DOTS_SLASH:h,STAR:g,START_ANCHOR:_}=i.globChars(n.windows),v=n.dot?m:p,y=n.dot?h:p,b=n.capture?``:`?:`,x={negated:!1,prefix:``},S=n.bash===!0?`.*?`:g;n.capture&&(S=`(${S})`);let globstar=e=>e.noglobstar===!0?S:`(${b}(?:(?!${_}${e.dot?f:c}).)*?)`,create=e=>{switch(e){case`*`:return`${v}${d}${S}`;case`.*`:return`${c}${d}${S}`;case`*.*`:return`${v}${S}${c}${d}${S}`;case`*/*`:return`${v}${S}${l}${d}${y}${S}`;case`**`:return v+globstar(n);case`**/*`:return`(?:${v}${globstar(n)}${l})?${y}${d}${S}`;case`**/*.*`:return`(?:${v}${globstar(n)}${l})?${y}${S}${c}${d}${S}`;case`**/.*`:return`(?:${v}${globstar(n)}${l})?${c}${d}${S}`;default:{let t=/^(.*?)\.(\w+)$/.exec(e);if(!t)return;let n=create(t[1]);return n?n+c+t[2]:void 0}}},C=create(a.removePrefix(e,x));return C&&n.strictSlashes!==!0&&(C+=`${l}?`),C},r.exports=parse})),a=e(((e,a)=>{let o=r(),s=i(),c=n(),l=t(),isObject=e=>e&&typeof e==`object`&&!Array.isArray(e),picomatch=(e,t,n=!1)=>{if(Array.isArray(e)){let r=e.map(e=>picomatch(e,t,n)),arrayMatcher=e=>{for(let t of r){let n=t(e);if(n)return n}return!1};return arrayMatcher}let r=isObject(e)&&e.tokens&&e.input;if(e===``||typeof e!=`string`&&!r)throw TypeError(`Expected pattern to be a non-empty string`);let i=t||{},a=i.windows,o=r?picomatch.compileRe(e,t):picomatch.makeRe(e,t,!1,!0),s=o.state;delete o.state;let isIgnored=()=>!1;if(i.ignore){let e={...t,ignore:null,onMatch:null,onResult:null};isIgnored=picomatch(i.ignore,e,n)}let matcher=(n,r=!1)=>{let{isMatch:c,match:l,output:u}=picomatch.test(n,o,t,{glob:e,posix:a}),d={glob:e,state:s,regex:o,posix:a,input:n,output:u,match:l,isMatch:c};return typeof i.onResult==`function`&&i.onResult(d),c===!1?(d.isMatch=!1,r?d:!1):isIgnored(n)?(typeof i.onIgnore==`function`&&i.onIgnore(d),d.isMatch=!1,r?d:!1):(typeof i.onMatch==`function`&&i.onMatch(d),!r||d)};return n&&(matcher.state=s),matcher};picomatch.test=(e,t,n,{glob:r,posix:i}={})=>{if(typeof e!=`string`)throw TypeError(`Expected input to be a string`);if(e===``)return{isMatch:!1,output:``};let a=n||{},o=a.format||(i?c.toPosixSlashes:null),s=e===r,l=s&&o?o(e):e;return s===!1&&(l=o?o(e):e,s=l===r),(s===!1||a.capture===!0)&&(s=a.matchBase===!0||a.basename===!0?picomatch.matchBase(e,t,n,i):t.exec(l)),{isMatch:!!s,match:s,output:l}},picomatch.matchBase=(e,t,n,r=n&&n.windows)=>(t instanceof RegExp?t:picomatch.makeRe(t,n)).test(c.basename(e,{windows:r})),picomatch.isMatch=(e,t,n)=>picomatch(t,n)(e),picomatch.parse=(e,t)=>Array.isArray(e)?e.map(e=>picomatch.parse(e,t)):s(e,{...t,fastpaths:!1}),picomatch.scan=(e,t)=>o(e,t),picomatch.compileRe=(e,t,n=!1,r=!1)=>{if(n===!0)return e.output;let i=t||{},a=i.contains?``:`^`,o=i.contains?``:`$`,s=`${a}(?:${e.output})${o}`;e&&e.negated===!0&&(s=`^(?!${s}).*$`);let c=picomatch.toRegex(s,t);return r===!0&&(c.state=e),c},picomatch.makeRe=(e,t={},n=!1,r=!1)=>{if(!e||typeof e!=`string`)throw TypeError(`Expected a non-empty string`);let i={negated:!1,fastpaths:!0};return t.fastpaths!==!1&&(e[0]===`.`||e[0]===`*`)&&(i.output=s.fastpaths(e,t)),i.output||(i=s(e,t)),picomatch.compileRe(i,t,n,r)},picomatch.toRegex=(e,t)=>{try{let n=t||{};return new RegExp(e,n.flags||(n.nocase?`i`:``))}catch(e){if(t&&t.debug===!0)throw e;return/$^/}},picomatch.constants=l,a.exports=picomatch})),o=e(((e,t)=>{let r=a(),i=n();function picomatch(e,t,n=!1){return t&&(t.windows===null||t.windows===void 0)&&(t={...t,windows:i.isWindows()}),r(e,t,n)}Object.assign(picomatch,r),t.exports=picomatch}));export{o as t};
@@ -1 +1 @@
1
- import"../rolldown-runtime.mjs";import{t as e}from"./parse-ms.mjs";const isZero=e=>e===0||e===0n,pluralize=(e,t)=>t===1||t===1n?e:`${e}s`,t=24n*60n*60n*1000n;function prettyMilliseconds(n,r){let i=typeof n==`bigint`;if(!i&&!Number.isFinite(n))throw TypeError(`Expected a finite number or bigint`);r={...r};let a=n<0?`-`:``;n=n<0?-n:n,r.colonNotation&&(r.compact=!1,r.formatSubMilliseconds=!1,r.separateMilliseconds=!1,r.verbose=!1),r.compact&&(r.unitCount=1,r.secondsDecimalDigits=0,r.millisecondsDecimalDigits=0);let o=[],floorDecimals=(e,t)=>{let n=Math.floor(e*10**t+1e-7);return(Math.round(n)/10**t).toFixed(t)},add=(e,t,n,i)=>{if(!((o.length===0||!r.colonNotation)&&isZero(e)&&!(r.colonNotation&&n===`m`))){if(i??=String(e),r.colonNotation){let e=i.includes(`.`)?i.split(`.`)[0].length:i.length,t=o.length>0?2:1;i=`0`.repeat(Math.max(0,t-e))+i}else i+=r.verbose?` `+pluralize(t,e):n;o.push(i)}},s=e(n),c=BigInt(s.days);if(r.hideYearAndDays?add(BigInt(c)*24n+BigInt(s.hours),`hour`,`h`):(r.hideYear?add(c,`day`,`d`):(add(c/365n,`year`,`y`),add(c%365n,`day`,`d`)),add(Number(s.hours),`hour`,`h`)),add(Number(s.minutes),`minute`,`m`),!r.hideSeconds)if(r.separateMilliseconds||r.formatSubMilliseconds||!r.colonNotation&&n<1e3&&!r.subSecondsAsDecimals){let e=Number(s.seconds),t=Number(s.milliseconds),n=Number(s.microseconds),i=Number(s.nanoseconds);if(add(e,`second`,`s`),r.formatSubMilliseconds)add(t,`millisecond`,`ms`),add(n,`microsecond`,`µs`),add(i,`nanosecond`,`ns`);else{let e=t+n/1e3+i/1e6,a=typeof r.millisecondsDecimalDigits==`number`?r.millisecondsDecimalDigits:0,o=a?e.toFixed(a):e>=1?Math.round(e):Math.ceil(e);add(Number.parseFloat(o),`millisecond`,`ms`,o)}}else{let e=floorDecimals((i?Number(n%t):n)/1e3%60,typeof r.secondsDecimalDigits==`number`?r.secondsDecimalDigits:1),a=r.keepDecimalsOnWholeSeconds?e:e.replace(/\.0+$/,``);add(Number.parseFloat(a),`second`,`s`,a)}if(o.length===0)return a+`0`+(r.verbose?` milliseconds`:`ms`);let l=r.colonNotation?`:`:` `;return typeof r.unitCount==`number`&&(o=o.slice(0,Math.max(r.unitCount,1))),a+o.join(l)}export{prettyMilliseconds as t};
1
+ import"../rolldown-runtime.mjs";const toZeroIfInfinity=e=>Number.isFinite(e)?e:0;function parseNumber(e){return{days:Math.trunc(e/864e5),hours:Math.trunc(e/36e5%24),minutes:Math.trunc(e/6e4%60),seconds:Math.trunc(e/1e3%60),milliseconds:Math.trunc(e%1e3),microseconds:Math.trunc(toZeroIfInfinity(e*1e3)%1e3),nanoseconds:Math.trunc(toZeroIfInfinity(e*1e6)%1e3)}}function parseBigint(e){return{days:e/86400000n,hours:e/3600000n%24n,minutes:e/60000n%60n,seconds:e/1000n%60n,milliseconds:e%1000n,microseconds:0n,nanoseconds:0n}}function parseMilliseconds(e){switch(typeof e){case`number`:if(Number.isFinite(e))return parseNumber(e);break;case`bigint`:return parseBigint(e)}throw TypeError(`Expected a finite number or bigint`)}const isZero=e=>e===0||e===0n,pluralize=(e,t)=>t===1||t===1n?e:`${e}s`,e=24n*60n*60n*1000n;function prettyMilliseconds(t,n){let r=typeof t==`bigint`;if(!r&&!Number.isFinite(t))throw TypeError(`Expected a finite number or bigint`);n={...n};let i=t<0?`-`:``;t=t<0?-t:t,n.colonNotation&&(n.compact=!1,n.formatSubMilliseconds=!1,n.separateMilliseconds=!1,n.verbose=!1),n.compact&&(n.unitCount=1,n.secondsDecimalDigits=0,n.millisecondsDecimalDigits=0);let a=[],floorDecimals=(e,t)=>{let n=Math.floor(e*10**t+1e-7);return(Math.round(n)/10**t).toFixed(t)},add=(e,t,r,i)=>{if(!((a.length===0||!n.colonNotation)&&isZero(e)&&!(n.colonNotation&&r===`m`))){if(i??=String(e),n.colonNotation){let e=i.includes(`.`)?i.split(`.`)[0].length:i.length,t=a.length>0?2:1;i=`0`.repeat(Math.max(0,t-e))+i}else i+=n.verbose?` `+pluralize(t,e):r;a.push(i)}},o=parseMilliseconds(t),s=BigInt(o.days);if(n.hideYearAndDays?add(BigInt(s)*24n+BigInt(o.hours),`hour`,`h`):(n.hideYear?add(s,`day`,`d`):(add(s/365n,`year`,`y`),add(s%365n,`day`,`d`)),add(Number(o.hours),`hour`,`h`)),add(Number(o.minutes),`minute`,`m`),!n.hideSeconds)if(n.separateMilliseconds||n.formatSubMilliseconds||!n.colonNotation&&t<1e3&&!n.subSecondsAsDecimals){let e=Number(o.seconds),t=Number(o.milliseconds),r=Number(o.microseconds),i=Number(o.nanoseconds);if(add(e,`second`,`s`),n.formatSubMilliseconds)add(t,`millisecond`,`ms`),add(r,`microsecond`,`µs`),add(i,`nanosecond`,`ns`);else{let e=t+r/1e3+i/1e6,a=typeof n.millisecondsDecimalDigits==`number`?n.millisecondsDecimalDigits:0,o=a?e.toFixed(a):e>=1?Math.round(e):Math.ceil(e);add(Number.parseFloat(o),`millisecond`,`ms`,o)}}else{let i=floorDecimals((r?Number(t%e):t)/1e3%60,typeof n.secondsDecimalDigits==`number`?n.secondsDecimalDigits:1),a=n.keepDecimalsOnWholeSeconds?i:i.replace(/\.0+$/,``);add(Number.parseFloat(a),`second`,`s`,a)}if(a.length===0)return i+`0`+(n.verbose?` milliseconds`:`ms`);let c=n.colonNotation?`:`:` `;return typeof n.unitCount==`number`&&(a=a.slice(0,Math.max(n.unitCount,1))),i+a.join(c)}export{prettyMilliseconds as t};
@@ -1,3 +1,3 @@
1
1
  import"../rolldown-runtime.mjs";import{r as e}from"./mdast-util-gfm.mjs";const t=/^\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)\]/i,n=/^\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)(\/.*)?\]/i,remarkAlert=({legacyTitle:r=!1,tagName:i=`div`}={})=>a=>{e(a,`blockquote`,(e,a,o)=>{let s=``,c=``,l=!0,u=e.children.map(e=>{if(l&&e.type===`paragraph`){let i=e.children[0],a=i.type===`text`?i.value:``,o=r?n:t,u=a.match(o);if(u&&(l=!1,s=u[1].toLocaleLowerCase(),c=r&&u[2]||s.toLocaleUpperCase(),a.includes(`
2
2
  `)&&(e.children[0]={type:`text`,value:a.replace(o,``).replace(/^\n+/,``)}),!a.includes(`
3
- `))){let t=[];e.children.forEach((e,n)=>{n!=0&&(n==1&&e.type===`break`||t.push(e))}),e.children=[...t]}}return e});s&&(e.data={hName:i,hProperties:{className:[`markdown-alert`,`markdown-alert-${s}`],dir:`auto`}},u.unshift({type:`paragraph`,children:[getAlertIcon(s),{type:`text`,value:c.replace(/^\//,``)}],data:{hProperties:{className:`markdown-alert-title`,dir:`auto`}}})),e.children=[...u]})};function getAlertIcon(e){return{type:`emphasis`,data:{hName:`svg`,hProperties:{className:[`octicon`],viewBox:`0 0 16 16`,width:`16`,height:`16`,ariaHidden:`true`}},children:[{type:`emphasis`,data:{hName:`path`,hProperties:{d:r[e]??``}},children:[]}]}}const r={note:`M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8Zm8-6.5a6.5 6.5 0 1 0 0 13 6.5 6.5 0 0 0 0-13ZM6.5 7.75A.75.75 0 0 1 7.25 7h1a.75.75 0 0 1 .75.75v2.75h.25a.75.75 0 0 1 0 1.5h-2a.75.75 0 0 1 0-1.5h.25v-2h-.25a.75.75 0 0 1-.75-.75ZM8 6a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z`,tip:`M8 1.5c-2.363 0-4 1.69-4 3.75 0 .984.424 1.625.984 2.304l.214.253c.223.264.47.556.673.848.284.411.537.896.621 1.49a.75.75 0 0 1-1.484.211c-.04-.282-.163-.547-.37-.847a8.456 8.456 0 0 0-.542-.68c-.084-.1-.173-.205-.268-.32C3.201 7.75 2.5 6.766 2.5 5.25 2.5 2.31 4.863 0 8 0s5.5 2.31 5.5 5.25c0 1.516-.701 2.5-1.328 3.259-.095.115-.184.22-.268.319-.207.245-.383.453-.541.681-.208.3-.33.565-.37.847a.751.751 0 0 1-1.485-.212c.084-.593.337-1.078.621-1.489.203-.292.45-.584.673-.848.075-.088.147-.173.213-.253.561-.679.985-1.32.985-2.304 0-2.06-1.637-3.75-4-3.75ZM5.75 12h4.5a.75.75 0 0 1 0 1.5h-4.5a.75.75 0 0 1 0-1.5ZM6 15.25a.75.75 0 0 1 .75-.75h2.5a.75.75 0 0 1 0 1.5h-2.5a.75.75 0 0 1-.75-.75Z`,important:`M0 1.75C0 .784.784 0 1.75 0h12.5C15.216 0 16 .784 16 1.75v9.5A1.75 1.75 0 0 1 14.25 13H8.06l-2.573 2.573A1.458 1.458 0 0 1 3 14.543V13H1.75A1.75 1.75 0 0 1 0 11.25Zm1.75-.25a.25.25 0 0 0-.25.25v9.5c0 .138.112.25.25.25h2a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h6.5a.25.25 0 0 0 .25-.25v-9.5a.25.25 0 0 0-.25-.25Zm7 2.25v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 9a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z`,warning:`M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z`,caution:`M4.47.22A.749.749 0 0 1 5 0h6c.199 0 .389.079.53.22l4.25 4.25c.141.14.22.331.22.53v6a.749.749 0 0 1-.22.53l-4.25 4.25A.749.749 0 0 1 11 16H5a.749.749 0 0 1-.53-.22L.22 11.53A.749.749 0 0 1 0 11V5c0-.199.079-.389.22-.53Zm.84 1.28L1.5 5.31v5.38l3.81 3.81h5.38l3.81-3.81V5.31L10.69 1.5ZM8 4a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 4Zm0 8a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z`};export{remarkAlert as t};
3
+ `))){let t=[];e.children.forEach((e,n)=>{n!=0&&(n!=1||e.type!==`break`)&&t.push(e)}),e.children=[...t]}}return e});s&&(e.data={hName:i,hProperties:{className:[`markdown-alert`,`markdown-alert-${s}`],dir:`auto`}},u.unshift({type:`paragraph`,children:[getAlertIcon(s),{type:`text`,value:c.replace(/^\//,``)}],data:{hProperties:{className:`markdown-alert-title`,dir:`auto`}}})),e.children=[...u]})};function getAlertIcon(e){return{type:`emphasis`,data:{hName:`svg`,hProperties:{className:[`octicon`],viewBox:`0 0 16 16`,width:`16`,height:`16`,ariaHidden:`true`}},children:[{type:`emphasis`,data:{hName:`path`,hProperties:{d:r[e]??``}},children:[]}]}}const r={note:`M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8Zm8-6.5a6.5 6.5 0 1 0 0 13 6.5 6.5 0 0 0 0-13ZM6.5 7.75A.75.75 0 0 1 7.25 7h1a.75.75 0 0 1 .75.75v2.75h.25a.75.75 0 0 1 0 1.5h-2a.75.75 0 0 1 0-1.5h.25v-2h-.25a.75.75 0 0 1-.75-.75ZM8 6a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z`,tip:`M8 1.5c-2.363 0-4 1.69-4 3.75 0 .984.424 1.625.984 2.304l.214.253c.223.264.47.556.673.848.284.411.537.896.621 1.49a.75.75 0 0 1-1.484.211c-.04-.282-.163-.547-.37-.847a8.456 8.456 0 0 0-.542-.68c-.084-.1-.173-.205-.268-.32C3.201 7.75 2.5 6.766 2.5 5.25 2.5 2.31 4.863 0 8 0s5.5 2.31 5.5 5.25c0 1.516-.701 2.5-1.328 3.259-.095.115-.184.22-.268.319-.207.245-.383.453-.541.681-.208.3-.33.565-.37.847a.751.751 0 0 1-1.485-.212c.084-.593.337-1.078.621-1.489.203-.292.45-.584.673-.848.075-.088.147-.173.213-.253.561-.679.985-1.32.985-2.304 0-2.06-1.637-3.75-4-3.75ZM5.75 12h4.5a.75.75 0 0 1 0 1.5h-4.5a.75.75 0 0 1 0-1.5ZM6 15.25a.75.75 0 0 1 .75-.75h2.5a.75.75 0 0 1 0 1.5h-2.5a.75.75 0 0 1-.75-.75Z`,important:`M0 1.75C0 .784.784 0 1.75 0h12.5C15.216 0 16 .784 16 1.75v9.5A1.75 1.75 0 0 1 14.25 13H8.06l-2.573 2.573A1.458 1.458 0 0 1 3 14.543V13H1.75A1.75 1.75 0 0 1 0 11.25Zm1.75-.25a.25.25 0 0 0-.25.25v9.5c0 .138.112.25.25.25h2a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h6.5a.25.25 0 0 0 .25-.25v-9.5a.25.25 0 0 0-.25-.25Zm7 2.25v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 9a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z`,warning:`M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z`,caution:`M4.47.22A.749.749 0 0 1 5 0h6c.199 0 .389.079.53.22l4.25 4.25c.141.14.22.331.22.53v6a.749.749 0 0 1-.22.53l-4.25 4.25A.749.749 0 0 1 11 16H5a.749.749 0 0 1-.53-.22L.22 11.53A.749.749 0 0 1 0 11V5c0-.199.079-.389.22-.53Zm.84 1.28L1.5 5.31v5.38l3.81 3.81h5.38l3.81-3.81V5.31L10.69 1.5ZM8 4a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 4Zm0 8a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z`};export{remarkAlert as t};
@@ -1 +1 @@
1
- import{i as o}from"../rolldown-runtime.mjs";function e$25(o,s,c){let r=c=>o(c,...s);return c===void 0?r:Object.assign(r,{lazy:c,lazyArgs:s})}o(e$25,`e`);function t$47(o,s,c){let l=o.length-s.length;if(l===0)return o(...s);if(l===1)return e$25(o,s,c);throw Error(`Wrong number of arguments`)}o(t$47,`t`);function t$46(...o){return t$47(s,o)}o(t$46,`t`);const s=o((o,s)=>s.every(s=>s(o)),`n`);function t$45(...o){return t$47(c,o)}o(t$45,`t`);const c=o((o,s)=>s.some(s=>s(o)),`n`);function t$44(...o){return t$47(n$42,o)}o(t$44,`t`);function n$42(o,s){if(s<1)throw RangeError(`chunk: A chunk size of '${s.toString()}' would result in an infinite array`);if(o.length===0)return[];if(s>=o.length)return[[...o]];let c=Math.ceil(o.length/s),l=Array(c);if(s===1)for(let[s,c]of o.entries())l[s]=[c];else for(let u=0;u<c;u+=1){let c=u*s;l[u]=o.slice(c,c+s)}return l}o(n$42,`n`);function t$43(...o){return t$47(l,o)}o(t$43,`t`);const l=o((o,{min:s,max:c})=>s!==void 0&&o<s?s:c!==void 0&&o>c?c:o,`n`);function t$42(...o){return t$47(u,o)}o(t$42,`t`);const u=o((o,s)=>[...o,...s],`n`);function e$24(o){return()=>o}o(e$24,`e`);const d={done:!0,hasNext:!1},h={done:!1,hasNext:!1},g=o(()=>d,`n`),_=o(o=>({hasNext:!0,next:o,done:!1}),`r`);function t$40(o,...s){let c=o,l=s.map(o=>`lazy`in o?r$16(o):void 0),u=0;for(;u<s.length;){if(l[u]===void 0||!i$9(c)){let o=s[u];c=o(c),u+=1;continue}let o=[];for(let c=u;c<s.length;c++){let s=l[c];if(s===void 0||(o.push(s),s.isSingle))break}let d=[];for(let s of c)if(n$38(s,d,o))break;let{isSingle:h}=o.at(-1);c=h?d[0]:d,u+=o.length}return c}o(t$40,`t`);function n$38(o,s,c){if(c.length===0)return s.push(o),!1;let l=o,u=h,d=!1;for(let[o,h]of c.entries()){let{index:g,items:_}=h;if(_.push(l),u=h(l,g,_),h.index+=1,u.hasNext){if(u.hasMany??!1){for(let l of u.next)if(n$38(l,s,c.slice(o+1)))return!0;return d}l=u.next}if(!u.hasNext)break;u.done&&(d=!0)}return u.hasNext&&s.push(l),d}o(n$38,`n`);function r$16(o){let{lazy:s,lazyArgs:c}=o,l=s(...c);return Object.assign(l,{isSingle:s.single??!1,index:0,items:[]})}o(r$16,`r`);function i$9(o){return typeof o==`string`||typeof o==`object`&&!!o&&Symbol.iterator in o}o(i$9,`i`);function t$39(o,s){let c=s.length-o.length;if(c===1){let[c,...l]=s;return t$40(c,{lazy:o,lazyArgs:l})}if(c===0){let c={lazy:o,lazyArgs:s};return Object.assign(o=>t$40(o,c),c)}throw Error(`Wrong number of arguments`)}o(t$39,`t`);function r$15(...o){return t$39(i$8,o)}o(r$15,`r`);function i$8(o){if(o.length===0)return _;let s=new Map;for(let c of o)s.set(c,(s.get(c)??0)+1);return o=>{let c=s.get(o);return c===void 0||c===0?{done:!1,hasNext:!0,next:o}:(s.set(o,c-1),h)}}o(i$8,`i`);function t$38(...o){return t$47(v,o)}o(t$38,`t`);const v=o((o,s)=>o.length>=s,`n`),y={asc:(o,s)=>o>s,desc:(o,s)=>o<s};function t$37(o,s){let[c,...l]=s;if(!i$7(c))return o(c,r$14(...l));let u=r$14(c,...l);return s=>o(s,u)}o(t$37,`t`);function r$14(o,s,...c){let l=typeof o==`function`?o:o[0],u=typeof o==`function`?`asc`:o[1],{[u]:d}=y,h=s===void 0?void 0:r$14(s,...c);return(o,s)=>{let c=l(o),u=l(s);return d(c,u)?1:d(u,c)?-1:h?.(o,s)??0}}o(r$14,`r`);function i$7(o){if(b(o))return!0;if(typeof o!=`object`||!Array.isArray(o))return!1;let[s,c,...l]=o;return b(s)&&typeof c==`string`&&c in y&&l.length===0}o(i$7,`i`);const b=o(o=>typeof o==`function`&&o.length===1,`a`);function t$36(...o){return t$47(n$36,o)}o(t$36,`t`);function n$36(o,s){for(let[c,l]of o.entries())if(!s(l,c,o))return o.slice(c);return[]}o(n$36,`n`);function t$35(...o){return t$47(Object.entries,o)}o(t$35,`t`);function n$35(...o){return t$47(x,o,S)}o(n$35,`n`);const x=o((o,s)=>o.filter(s),`r`),S=o(o=>(s,c,l)=>o(s,c,l)?{done:!1,hasNext:!0,next:s}:h,`i`),C=o(o=>Object.assign(o,{single:!0}),`e`);function r$12(...o){return t$47(w,o,C(T))}o(r$12,`r`);const w=o((o,s)=>o.find(s),`i`),T=o(o=>(s,c,l)=>o(s,c,l)?{done:!0,hasNext:!0,next:s}:h,`a`);function t$34(...o){return t$47(E,o)}o(t$34,`t`);const E=o((o,s)=>{for(let c=o.length-1;c>=0;c--){let l=o[c];if(s(l,c,o))return l}},`n`);function n$33(...o){return t$47(D,o,C(O))}o(n$33,`n`);const D=o(([o])=>o,`r`),O=o(()=>k,`i`),k=o(o=>({hasNext:!0,next:o,done:!0}),`a`);function n$32(o,s){return typeof o==`object`?A(o,s):e$25(A,o===void 0?[]:[o],j)}o(n$32,`n`);const A=o((o,s)=>s===void 0?o.flat():o.flat(s),`r`),j=o(o=>o===void 0||o===1?M:o<=0?_:s=>Array.isArray(s)?{next:s.flat(o-1),hasNext:!0,hasMany:!0,done:!1}:{next:s,hasNext:!0,done:!1},`i`),M=o(o=>Array.isArray(o)?{next:o,hasNext:!0,hasMany:!0,done:!1}:{next:o,hasNext:!0,done:!1},`a`);function t$33(...o){return t$47(N,o,P)}o(t$33,`t`);const N=o((o,s)=>o.flatMap(s),`n`),P=o(o=>(s,c,l)=>{let u=o(s,c,l);return Array.isArray(u)?{done:!1,hasNext:!0,hasMany:!0,next:u}:{done:!1,hasNext:!0,next:u}},`r`);function t$32(...o){return t$47(n$30,o,F)}o(t$32,`t`);function n$30(o,s){return o.forEach(s),o}o(n$30,`n`);const F=o(o=>(s,c,l)=>(o(s,c,l),{done:!1,hasNext:!0,next:s}),`r`);function t$31(...o){return t$47(n$29,o)}o(t$31,`t`);function n$29(o,s){for(let[c,l]of Object.entries(o))s(l,c,o);return o}o(n$29,`n`);const I=Symbol(`funnel/voidReducer`),L=o(()=>I,`t`);function n$28(o,{triggerAt:s=`end`,minQuietPeriodMs:c,maxBurstDurationMs:l,minGapMs:u,reducer:d=L}){let h,g,_,v,f=()=>{let s=_;s!==void 0&&(_=void 0,s===I?o():o(s),u!==void 0&&(g=setTimeout(p,u)))},p=()=>{clearTimeout(g),g=void 0,h===void 0&&f()},m=()=>{clearTimeout(h),h=void 0,v=void 0,g===void 0&&f()};return{call:(...o)=>{let y=h===void 0&&g===void 0;if((s!==`start`||y)&&(_=d(_,...o)),!(h===void 0&&!y)){if(c!==void 0||l!==void 0||u===void 0){clearTimeout(h);let o=Date.now();v??=o;let s=l===void 0?c??0:Math.min(c??l,Math.max(0,l-(o-v)));h=setTimeout(m,s)}s!==`end`&&y&&f()}},cancel:()=>{clearTimeout(h),h=void 0,v=void 0,clearTimeout(g),g=void 0,_=void 0},flush:()=>{m(),p()},get isIdle(){return h===void 0&&g===void 0}}}o(n$28,`n`);function t$29(...o){return t$47(R,o)}o(t$29,`t`);const R=o((o,s)=>{let c=Object.create(null);for(let l=0;l<o.length;l++){let u=o[l],d=s(u,l,o);if(d!==void 0){let o=c[d];o===void 0?c[d]=[u]:o.push(u)}}return Object.setPrototypeOf(c,Object.prototype),c},`n`);function t$28(...o){return t$47(n$26,o)}o(t$28,`t`);function n$26(o,s){let c=Object.create(null);for(let l of o){let o=l?.[s];if(o!==void 0){let s=c[o];s===void 0?c[o]=[l]:s.push(l)}}return Object.setPrototypeOf(c,Object.prototype),c}o(n$26,`n`);function t$27(...o){return t$47(n$25,o)}o(t$27,`t`);function n$25(o,s){if(o===s||Object.is(o,s))return!0;if(typeof o!=`object`||typeof s!=`object`||o===null||s===null||Object.getPrototypeOf(o)!==Object.getPrototypeOf(s))return!1;if(Array.isArray(o))return r$7(o,s);if(o instanceof Map)return i$2(o,s);if(o instanceof Set)return a(o,s);if(o instanceof Date)return o.getTime()===s.getTime();if(o instanceof RegExp)return o.toString()===s.toString();if(Object.keys(o).length!==Object.keys(s).length)return!1;for(let[c,l]of Object.entries(o))if(!(c in s)||!n$25(l,s[c]))return!1;return!0}o(n$25,`n`);function r$7(o,s){if(o.length!==s.length)return!1;for(let[c,l]of o.entries())if(!n$25(l,s[c]))return!1;return!0}o(r$7,`r`);function i$2(o,s){if(o.size!==s.size)return!1;for(let[c,l]of o.entries())if(!s.has(c)||!n$25(l,s.get(c)))return!1;return!0}o(i$2,`i`);function a(o,s){if(o.size!==s.size)return!1;let c=[...s];for(let s of o){let o=!1;for(let[l,u]of c.entries())if(n$25(s,u)){o=!0,c.splice(l,1);break}if(!o)return!1}return!0}function e$19(){return z}o(e$19,`e`);const z=o(o=>o,`t`);function t$25(...o){return t$47(n$24,o)}o(t$25,`t`);function n$24(o,s){let c={};for(let[l,u]of o.entries()){let d=s(u,l,o);c[d]=u}return c}o(n$24,`n`);function e$18(o){return Array.isArray(o)}o(e$18,`e`);function e$17(o){return typeof o==`boolean`}o(e$17,`e`);function e$16(o){return o!==void 0}o(e$16,`e`);function e$15(o){return o===``||o===void 0?!0:Array.isArray(o)?o.length===0:Object.keys(o).length===0}o(e$15,`e`);function e$14(o){if(o==null||o===``)return!0;if(typeof o!=`object`)return!1;if(`length`in o&&typeof o.length==`number`)return o.length===0;if(`size`in o&&typeof o.size==`number`)return o.size===0;for(let s in o)return!1;return Object.getOwnPropertySymbols(o).length===0}o(e$14,`e`);const B=o(o=>typeof o==`function`,`e`);function e$12(o){return o!=null}o(e$12,`e`);function e$11(o){return s=>!o(s)}o(e$11,`e`);function e$10(o){return o==null}o(e$10,`e`);function e$9(o){return typeof o==`number`&&!Number.isNaN(o)}o(e$9,`e`);function e$8(o){return typeof o==`object`&&!!o}o(e$8,`e`);function e$7(o){return o instanceof Promise}o(e$7,`e`);function t$24(...o){return t$47(n$23,o)}o(t$24,`t`);function n$23(o,s){if(o===s||Object.is(o,s))return!0;if(typeof o!=`object`||!o||typeof s!=`object`||!s)return!1;if(o instanceof Map&&s instanceof Map)return r$6(o,s);if(o instanceof Set&&s instanceof Set)return i$1(o,s);let c=Object.keys(o);if(c.length!==Object.keys(s).length)return!1;for(let l of c){if(!Object.hasOwn(s,l))return!1;let{[l]:c}=o,{[l]:u}=s;if(c!==u||!Object.is(c,u))return!1}return!0}o(n$23,`n`);function r$6(o,s){if(o.size!==s.size)return!1;for(let[c,l]of o){let o=s.get(c);if(l!==o||!Object.is(l,o))return!1}return!0}o(r$6,`r`);function i$1(o,s){if(o.size!==s.size)return!1;for(let c of o)if(!s.has(c))return!1;return!0}o(i$1,`i`);function e$6(o){return typeof o==`string`}o(e$6,`e`);function e$5(o){return!!o}o(e$5,`e`);function t$23(...o){return t$47(V,o)}o(t$23,`t`);const V=o((o,s)=>o.join(s),`n`);function t$22(...o){return t$47(Object.keys,o)}o(t$22,`t`);function t$21(...o){return t$47(H,o)}o(t$21,`t`);const H=o(o=>o.at(-1),`n`);function t$20(...o){return t$47(U,o,W)}o(t$20,`t`);const U=o((o,s)=>o.map(s),`n`),W=o(o=>(s,c,l)=>({done:!1,hasNext:!0,next:o(s,c,l)}),`r`);function t$19(...o){return t$47(n$19,o)}o(t$19,`t`);function n$19(o,s){let c={};for(let[l,u]of o.entries()){let[d,h]=s(u,l,o);c[d]=h}return c}o(n$19,`n`);function t$18(...o){return t$47(n$18,o)}o(t$18,`t`);function n$18(o,s){let c={};for(let[l,u]of Object.entries(o))c[l]=s(u,l,o);return c}o(n$18,`n`);function n$17(...o){return t$47(r$4,o)}o(n$17,`n`);function r$4(o,s){if(!t$38(s,1))return{...o};if(!t$38(s,2)){let{[s[0]]:c,...l}=o;return l}let c={...o};for(let o of s)delete c[o];return c}o(r$4,`r`);function t$17(...o){return t$47(n$16,o)}o(t$17,`t`);function n$16(o,s){let c={...o};for(let[l,u]of Object.entries(c))s(u,l,o)&&delete c[l];return c}o(n$16,`n`);function e$4(o){let s=!1,c;return()=>(s||=(c=o(),!0),c)}o(e$4,`e`);function t$16(...o){return t$47(G,o)}o(t$16,`t`);const G=o(o=>o.length===1?o[0]:void 0,`n`);function t$15(...o){return t$47(K,o)}o(t$15,`t`);const K=o((o,s)=>{let c=[[],[]];for(let[l,u]of o.entries())s(u,l,o)?c[0].push(u):c[1].push(u);return c},`n`);function t$14(...o){return t$47(n$13,o)}o(t$14,`t`);function n$13(o,s){let c={};for(let l of s)l in o&&(c[l]=o[l]);return c}o(n$13,`n`);function t$13(...o){return t$47(n$12,o)}o(t$13,`t`);function n$12(o,s){let c={};for(let[l,u]of Object.entries(o))s(u,l,o)&&(c[l]=u);return c}o(n$12,`n`);function t$12(...o){return s=>t$40(s,...o)}o(t$12,`t`);function e$3(o,...s){return typeof o==`string`||typeof o==`number`||typeof o==`symbol`?c=>t$11(c,o,...s):t$11(o,...s)}o(e$3,`e`);function t$11(o,...s){let c=o;for(let o of s){if(c==null)return;c=c[o]}return c}o(t$11,`t`);function t$10(...o){return t$47(n$11,o)}o(t$10,`t`);function n$11(o,s,c){let l={};for(let[u,d]of o.entries()){let h=s(d,u,o);l[h]=c(d,u,o)}return l}o(n$11,`n`);function e$2(o,s){let c=Math.ceil(o),l=Math.floor(s);if(l<c)throw RangeError(`randomInteger: The range [${o.toString()},${s.toString()}] contains no integer`);return Math.floor(Math.random()*(l-c+1)+c)}o(e$2,`e`);function t$9(...o){return t$47(n$10,o)}o(t$9,`t`);function n$10(o){let s=[];for(let c=0;c<o;c++){let o=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789`[Math.floor(Math.random()*62)];s.push(o)}return s.join(``)}o(n$10,`n`);function t$8(...o){return t$47(q,o)}o(t$8,`t`);const q=o((o,s,c)=>o.reduce(s,c),`n`);function t$7(...o){return t$47(n$8,o)}o(t$7,`t`);function n$8(o){return[...o].reverse()}o(n$8,`n`);function t$6(...o){return t$47(n$7,o)}o(t$6,`t`);function n$7(o,s){let c=[...o];return c.sort(s),c}o(n$7,`n`);function t$5(...o){return t$37(J,o)}o(t$5,`t`);const J=o((o,s)=>[...o].sort(s),`n`);function e$1(o,s,c){return typeof s==`number`||s===void 0?c=>c.split(o,s):o.split(s,c)}o(e$1,`e`);function n$5(...o){return t$47(Y,o,i)}o(n$5,`n`);const Y=o((o,s)=>s<0?[]:o.slice(0,s),`r`);function i(o){if(o<=0)return g;let s=o;return o=>(--s,{done:s<=0,hasNext:!0,next:o})}function t$4(...o){return t$47(n$4,o)}o(t$4,`t`);function n$4(o,s){let c=[];for(let[l,u]of o.entries()){if(!s(u,l,o))break;c.push(u)}return c}o(n$4,`n`);function t$3(...o){return t$47(n$3,o)}o(t$3,`t`);function n$3(o,s){return s(o),o}o(n$3,`n`);function n$2(...o){return t$39(r$2,o)}o(n$2,`n`);function r$2(){let o=new Set;return s=>o.has(s)?h:(o.add(s),{done:!1,hasNext:!0,next:s})}o(r$2,`r`);function n$1(...o){return t$39(r$1,o)}o(n$1,`n`);function r$1(o){let s=o,c=new Set;return(o,l,u)=>{let d=s(o,l,u);return c.has(d)?h:(c.add(d),{done:!1,hasNext:!0,next:o})}}o(r$1,`r`);function t$2(...o){return t$47(Object.values,o)}o(t$2,`t`);function e(...o){return o.length===2?(s,...c)=>X(s,...o,...c):X(...o)}const X=o((o,s,c,...l)=>s(o,...l)?typeof c==`function`?c(o,...l):c.onTrue(o,...l):typeof c==`function`?o:c.onFalse(o,...l),`t`);function t(...o){return t$47(n,o,r)}const n=(o,s)=>o.length<s.length?o.map((o,c)=>[o,s[c]]):s.map((s,c)=>[o[c],s]),r=o=>(s,c)=>({hasNext:!0,next:[s,o[c]],done:c>=o.length-1});export{t$31 as $,t$22 as A,e$12 as B,e$4 as C,t$19 as D,t$18 as E,e$7 as F,e$17 as G,e$14 as H,e$8 as I,e$19 as J,e$18 as K,e$9 as L,e$5 as M,e$6 as N,t$20 as O,t$24 as P,n$28 as Q,e$10 as R,t$16 as S,n$17 as T,e$15 as U,B as V,e$16 as W,t$28 as X,t$27 as Y,t$29 as Z,e$3 as _,t$46 as _t,n$2 as a,r$12 as at,t$14 as b,n$5 as c,t$36 as ct,t$6 as d,t$40 as dt,t$32 as et,t$7 as f,e$24 as ft,t$10 as g,t$45 as gt,e$2 as h,t$44 as ht,n$1 as i,t$34 as it,t$23 as j,t$21 as k,e$1 as l,t$38 as lt,t$9 as m,t$43 as mt,e as n,n$32 as nt,t$3 as o,n$35 as ot,t$8 as p,t$42 as pt,t$25 as q,t$2 as r,n$33 as rt,t$4 as s,t$35 as st,t,t$33 as tt,t$5 as u,r$15 as ut,t$12 as v,t$47 as vt,t$17 as w,t$15 as x,t$13 as y,e$11 as z};
1
+ import{r as s}from"../rolldown-runtime.mjs";function e$26(s,c,l){let r=l=>s(l,...c);return l===void 0?r:Object.assign(r,{lazy:l,lazyArgs:c})}s(e$26,`e`);function t$49(s,c,l){let u=s.length-c.length;if(u===0)return s(...c);if(u===1)return e$26(s,c,l);throw Error(`Wrong number of arguments`)}s(t$49,`t`);function t$48(...s){return t$49(c,s)}s(t$48,`t`);const c=s((s,c)=>c.every(c=>c(s)),`n`);function t$47(...s){return t$49(l,s)}s(t$47,`t`);const l=s((s,c)=>c.some(c=>c(s)),`n`);function t$46(...s){return t$49(n$44,s)}s(t$46,`t`);function n$44(s,c){if(c<1)throw RangeError(`chunk: A chunk size of '${c.toString()}' would result in an infinite array`);if(s.length===0)return[];if(c>=s.length)return[[...s]];let l=Math.ceil(s.length/c),u=Array(l);if(c===1)for(let[c,l]of s.entries())u[c]=[l];else for(let d=0;d<l;d+=1){let l=d*c;u[d]=s.slice(l,l+c)}return u}s(n$44,`n`);function t$45(...s){return t$49(u,s)}s(t$45,`t`);const u=s((s,{min:c,max:l})=>c!==void 0&&s<c?c:l!==void 0&&s>l?l:s,`n`);function t$44(...s){return t$49(d,s)}s(t$44,`t`);const d=s((s,c)=>[...s,...c],`n`);function e$25(s){return()=>s}s(e$25,`e`);const h={done:!0,hasNext:!1},g={done:!1,hasNext:!1},_=s(()=>h,`n`),v=s(s=>({hasNext:!0,next:s,done:!1}),`r`);function t$42(s,...c){let l=s,u=c.map(s=>`lazy`in s?r$17(s):void 0),d=0;for(;d<c.length;){if(u[d]===void 0||!i$9(l)){let s=c[d];l=s(l),d+=1;continue}let s=[];for(let l=d;l<c.length;l++){let c=u[l];if(c===void 0||(s.push(c),c.isSingle))break}let h=[];for(let c of l)if(n$40(c,h,s))break;let{isSingle:g}=s.at(-1);l=g?h[0]:h,d+=s.length}return l}s(t$42,`t`);function n$40(s,c,l){if(l.length===0)return c.push(s),!1;let u=s,d=g,h=!1;for(let[s,g]of l.entries()){let{index:_,items:v}=g;if(v.push(u),d=g(u,_,v),g.index+=1,d.hasNext){if(d.hasMany??!1){for(let u of d.next)if(n$40(u,c,l.slice(s+1)))return!0;return h}u=d.next}if(!d.hasNext)break;d.done&&(h=!0)}return d.hasNext&&c.push(u),h}s(n$40,`n`);function r$17(s){let{lazy:c,lazyArgs:l}=s,u=c(...l);return Object.assign(u,{isSingle:c.single??!1,index:0,items:[]})}s(r$17,`r`);function i$9(s){return typeof s==`string`||typeof s==`object`&&!!s&&Symbol.iterator in s}s(i$9,`i`);function t$41(s,c){let l=c.length-s.length;if(l===1){let[l,...u]=c;return t$42(l,{lazy:s,lazyArgs:u})}if(l===0){let l={lazy:s,lazyArgs:c};return Object.assign(s=>t$42(s,l),l)}throw Error(`Wrong number of arguments`)}s(t$41,`t`);function r$16(...s){return t$41(i$8,s)}s(r$16,`r`);function i$8(s){if(s.length===0)return v;let c=new Map;for(let l of s)c.set(l,(c.get(l)??0)+1);return s=>{let l=c.get(s);return l===void 0||l===0?{done:!1,hasNext:!0,next:s}:(c.set(s,l-1),g)}}s(i$8,`i`);function t$40(...s){return t$49(y,s)}s(t$40,`t`);const y=s((s,c)=>s.length>=c,`n`),b={asc:(s,c)=>s>c,desc:(s,c)=>s<c};function t$39(s,c){let[l,...u]=c;if(!i$7(l))return s(l,r$15(...u));let d=r$15(l,...u);return c=>s(c,d)}s(t$39,`t`);function r$15(s,c,...l){let u=typeof s==`function`?s:s[0],d=typeof s==`function`?`asc`:s[1],{[d]:h}=b,g=c===void 0?void 0:r$15(c,...l);return(s,c)=>{let l=u(s),d=u(c);return h(l,d)?1:h(d,l)?-1:g?.(s,c)??0}}s(r$15,`r`);function i$7(s){if(x(s))return!0;if(typeof s!=`object`||!Array.isArray(s))return!1;let[c,l,...u]=s;return x(c)&&typeof l==`string`&&l in b&&u.length===0}s(i$7,`i`);const x=s(s=>typeof s==`function`&&s.length===1,`a`);function t$38(...s){return t$49(n$38,s)}s(t$38,`t`);function n$38(s,c){for(let[l,u]of s.entries())if(!c(u,l,s))return s.slice(l);return[]}s(n$38,`n`);function t$37(...s){return t$49(Object.entries,s)}s(t$37,`t`);function n$37(...s){return t$49(S,s,C)}s(n$37,`n`);const S=s((s,c)=>s.filter(c),`r`),C=s(s=>(c,l,u)=>s(c,l,u)?{done:!1,hasNext:!0,next:c}:g,`i`),w=s(s=>Object.assign(s,{single:!0}),`e`);function r$13(...s){return t$49(T,s,w(E))}s(r$13,`r`);const T=s((s,c)=>s.find(c),`i`),E=s(s=>(c,l,u)=>s(c,l,u)?{done:!0,hasNext:!0,next:c}:g,`a`);function t$36(...s){return t$49(D,s)}s(t$36,`t`);const D=s((s,c)=>{for(let l=s.length-1;l>=0;l--){let u=s[l];if(c(u,l,s))return u}},`n`);function n$35(...s){return t$49(O,s,w(k))}s(n$35,`n`);const O=s(([s])=>s,`r`),k=s(()=>A,`i`),A=s(s=>({hasNext:!0,next:s,done:!0}),`a`);function n$34(...s){return t$39(r$11,s)}s(n$34,`n`);function r$11(s,c){if(!t$40(s,2))return s[0];let[l]=s,[,...u]=s;for(let s of u)c(s,l)<0&&(l=s);return l}s(r$11,`r`);function n$33(s,c){return typeof s==`object`?j(s,c):e$26(j,s===void 0?[]:[s],M)}s(n$33,`n`);const j=s((s,c)=>c===void 0?s.flat():s.flat(c),`r`),M=s(s=>s===void 0||s===1?N:s<=0?v:c=>Array.isArray(c)?{next:c.flat(s-1),hasNext:!0,hasMany:!0,done:!1}:{next:c,hasNext:!0,done:!1},`i`),N=s(s=>Array.isArray(s)?{next:s,hasNext:!0,hasMany:!0,done:!1}:{next:s,hasNext:!0,done:!1},`a`);function t$35(...s){return t$49(P,s,F)}s(t$35,`t`);const P=s((s,c)=>s.flatMap(c),`n`),F=s(s=>(c,l,u)=>{let d=s(c,l,u);return Array.isArray(d)?{done:!1,hasNext:!0,hasMany:!0,next:d}:{done:!1,hasNext:!0,next:d}},`r`);function t$34(...s){return t$49(n$31,s,I)}s(t$34,`t`);function n$31(s,c){return s.forEach(c),s}s(n$31,`n`);const I=s(s=>(c,l,u)=>(s(c,l,u),{done:!1,hasNext:!0,next:c}),`r`);function t$33(...s){return t$49(n$30,s)}s(t$33,`t`);function n$30(s,c){for(let[l,u]of Object.entries(s))c(u,l,s);return s}s(n$30,`n`);function t$32(...s){return t$49(Object.fromEntries,s)}s(t$32,`t`);function t$31(...s){return t$49(n$29,s)}s(t$31,`t`);function n$29(s,c){let l={};for(let[u,d]of s.entries())l[d]=c(d,u,s);return l}s(n$29,`n`);const L=Symbol(`funnel/voidReducer`),R=s(()=>L,`t`);function n$28(s,{triggerAt:c=`end`,minQuietPeriodMs:l,maxBurstDurationMs:u,minGapMs:d,reducer:h=R}){let g,_,v,y,f=()=>{let c=v;c!==void 0&&(v=void 0,c===L?s():s(c),d!==void 0&&(_=setTimeout(p,d)))},p=()=>{clearTimeout(_),_=void 0,g===void 0&&f()},m=()=>{clearTimeout(g),g=void 0,y=void 0,_===void 0&&f()};return{call:(...s)=>{let b=g===void 0&&_===void 0;if((c!==`start`||b)&&(v=h(v,...s)),!(g===void 0&&!b)){if(l!==void 0||u!==void 0||d===void 0){clearTimeout(g);let s=Date.now();y??=s;let c=u===void 0?l??0:Math.min(l??u,Math.max(0,u-(s-y)));g=setTimeout(m,c)}c!==`end`&&b&&f()}},cancel:()=>{clearTimeout(g),g=void 0,y=void 0,clearTimeout(_),_=void 0,v=void 0},flush:()=>{m(),p()},get isIdle(){return g===void 0&&_===void 0}}}s(n$28,`n`);function t$29(...s){return t$49(z,s)}s(t$29,`t`);const z=s((s,c)=>{let l=Object.create(null);for(let u=0;u<s.length;u++){let d=s[u],h=c(d,u,s);if(h!==void 0){let s=l[h];s===void 0?l[h]=[d]:s.push(d)}}return Object.setPrototypeOf(l,Object.prototype),l},`n`);function t$28(...s){return t$49(n$26,s)}s(t$28,`t`);function n$26(s,c){let l=Object.create(null);for(let u of s){let s=u?.[c];if(s!==void 0){let c=l[s];c===void 0?l[s]=[u]:c.push(u)}}return Object.setPrototypeOf(l,Object.prototype),l}s(n$26,`n`);function t$27(...s){return t$49(n$25,s)}s(t$27,`t`);function n$25(s,c){if(s===c||Object.is(s,c))return!0;if(typeof s!=`object`||typeof c!=`object`||s===null||c===null||!r$7(s,c))return!1;if(Array.isArray(s))return i$2(s,c);if(s instanceof Map)return a(s,c);if(s instanceof Set)return o(s,c);if(s instanceof Date)return s.getTime()===c.getTime();if(s instanceof RegExp)return s.toString()===c.toString();if(Object.keys(s).length!==Object.keys(c).length)return!1;for(let[l,u]of Object.entries(s))if(!(l in c)||!n$25(u,c[l]))return!1;return!0}s(n$25,`n`);function r$7(s,c){let l=Object.getPrototypeOf(s),u=Object.getPrototypeOf(c);return l===u?!0:l===null?u===Object.prototype:l===Object.prototype&&u===null}s(r$7,`r`);function i$2(s,c){if(s.length!==c.length)return!1;for(let[l,u]of s.entries())if(!n$25(u,c[l]))return!1;return!0}s(i$2,`i`);function a(s,c){if(s.size!==c.size)return!1;for(let[l,u]of s.entries())if(!c.has(l)||!n$25(u,c.get(l)))return!1;return!0}function o(s,c){if(s.size!==c.size)return!1;let l=[...c];for(let c of s){let s=!1;for(let[u,d]of l.entries())if(n$25(c,d)){s=!0,l.splice(u,1);break}if(!s)return!1}return!0}function e$20(){return B}s(e$20,`e`);const B=s(s=>s,`t`);function t$25(...s){return t$49(n$24,s)}s(t$25,`t`);function n$24(s,c){let l={};for(let[u,d]of s.entries()){let h=c(d,u,s);l[h]=d}return l}s(n$24,`n`);function e$19(s){return Array.isArray(s)}s(e$19,`e`);function e$18(s){return typeof s==`boolean`}s(e$18,`e`);function e$17(s){return s!==void 0}s(e$17,`e`);function e$16(s){return s===``||s===void 0?!0:Array.isArray(s)?s.length===0:Object.keys(s).length===0}s(e$16,`e`);function e$15(s){if(s==null||s===``)return!0;if(typeof s!=`object`)return!1;if(`length`in s&&typeof s.length==`number`)return s.length===0;if(`size`in s&&typeof s.size==`number`)return s.size===0;for(let c in s)return!1;return Object.getOwnPropertySymbols(s).length===0}s(e$15,`e`);const V=s(s=>typeof s==`function`,`e`);function e$13(s){return s!=null}s(e$13,`e`);function e$12(s){return c=>!s(c)}s(e$12,`e`);function e$11(s){return s==null}s(e$11,`e`);function e$10(s){return typeof s==`number`&&!Number.isNaN(s)}s(e$10,`e`);function e$9(s){return typeof s==`object`&&!!s}s(e$9,`e`);function e$8(s){if(typeof s!=`object`||!s)return!1;let c=Object.getPrototypeOf(s);return c===null||c===Object.prototype}s(e$8,`e`);function e$7(s){return s instanceof Promise}s(e$7,`e`);function t$24(...s){return t$49(n$23,s)}s(t$24,`t`);function n$23(s,c){if(s===c||Object.is(s,c))return!0;if(typeof s!=`object`||!s||typeof c!=`object`||!c)return!1;if(s instanceof Map&&c instanceof Map)return r$6(s,c);if(s instanceof Set&&c instanceof Set)return i$1(s,c);let l=Object.keys(s);if(l.length!==Object.keys(c).length)return!1;for(let u of l){if(!Object.hasOwn(c,u))return!1;let{[u]:l}=s,{[u]:d}=c;if(l!==d||!Object.is(l,d))return!1}return!0}s(n$23,`n`);function r$6(s,c){if(s.size!==c.size)return!1;for(let[l,u]of s){let s=c.get(l);if(u!==s||!Object.is(u,s))return!1}return!0}s(r$6,`r`);function i$1(s,c){if(s.size!==c.size)return!1;for(let l of s)if(!c.has(l))return!1;return!0}s(i$1,`i`);function e$6(s){return typeof s==`string`}s(e$6,`e`);function e$5(s){return!!s}s(e$5,`e`);function t$23(...s){return t$49(H,s)}s(t$23,`t`);const H=s((s,c)=>s.join(c),`n`);function t$22(...s){return t$49(Object.keys,s)}s(t$22,`t`);function t$21(...s){return t$49(U,s)}s(t$21,`t`);const U=s(s=>s.at(-1),`n`);function t$20(...s){return t$49(W,s,G)}s(t$20,`t`);const W=s((s,c)=>s.map(c),`n`),G=s(s=>(c,l,u)=>({done:!1,hasNext:!0,next:s(c,l,u)}),`r`);function t$19(...s){return t$49(n$19,s)}s(t$19,`t`);function n$19(s,c){let l={};for(let[u,d]of s.entries()){let[h,g]=c(d,u,s);l[h]=g}return l}s(n$19,`n`);function t$18(...s){return t$49(n$18,s)}s(t$18,`t`);function n$18(s,c){let l={};for(let[u,d]of Object.entries(s))l[u]=c(d,u,s);return l}s(n$18,`n`);function n$17(...s){return t$49(r$4,s)}s(n$17,`n`);function r$4(s,c){if(!t$40(c,1))return{...s};if(!t$40(c,2)){let{[c[0]]:l,...u}=s;return u}let l={...s};for(let s of c)delete l[s];return l}s(r$4,`r`);function t$17(...s){return t$49(n$16,s)}s(t$17,`t`);function n$16(s,c){let l={...s};for(let[u,d]of Object.entries(l))c(d,u,s)&&delete l[u];return l}s(n$16,`n`);function e$4(s){let c=!1,l;return()=>(c||=(l=s(),!0),l)}s(e$4,`e`);function t$16(...s){return t$49(K,s)}s(t$16,`t`);const K=s(s=>s.length===1?s[0]:void 0,`n`);function t$15(...s){return t$49(q,s)}s(t$15,`t`);const q=s((s,c)=>{let l=[[],[]];for(let[u,d]of s.entries())c(d,u,s)?l[0].push(d):l[1].push(d);return l},`n`);function t$14(...s){return t$49(n$13,s)}s(t$14,`t`);function n$13(s,c){let l={};for(let u of c)u in s&&(l[u]=s[u]);return l}s(n$13,`n`);function t$13(...s){return t$49(n$12,s)}s(t$13,`t`);function n$12(s,c){let l={};for(let[u,d]of Object.entries(s))c(d,u,s)&&(l[u]=d);return l}s(n$12,`n`);function t$12(...s){return c=>t$42(c,...s)}s(t$12,`t`);function e$3(s,...c){return typeof s==`string`||typeof s==`number`||typeof s==`symbol`?l=>t$11(l,s,...c):t$11(s,...c)}s(e$3,`e`);function t$11(s,...c){let l=s;for(let s of c){if(l==null)return;l=l[s]}return l}s(t$11,`t`);function t$10(...s){return t$49(n$11,s)}s(t$10,`t`);function n$11(s,c,l){let u={};for(let[d,h]of s.entries()){let g=c(h,d,s);u[g]=l(h,d,s)}return u}s(n$11,`n`);function e$2(s,c){let l=Math.ceil(s),u=Math.floor(c);if(u<l)throw RangeError(`randomInteger: The range [${s.toString()},${c.toString()}] contains no integer`);return Math.floor(Math.random()*(u-l+1)+l)}s(e$2,`e`);function t$9(...s){return t$49(n$10,s)}s(t$9,`t`);function n$10(s){let c=[];for(let l=0;l<s;l++){let s=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789`[Math.floor(Math.random()*62)];c.push(s)}return c.join(``)}s(n$10,`n`);function t$8(...s){return t$49(J,s)}s(t$8,`t`);const J=s((s,c,l)=>s.reduce(c,l),`n`);function t$7(...s){return t$49(n$8,s)}s(t$7,`t`);function n$8(s){return[...s].reverse()}s(n$8,`n`);function t$6(...s){return t$49(n$7,s)}s(t$6,`t`);function n$7(s,c){let l=[...s];return l.sort(c),l}s(n$7,`n`);function t$5(...s){return t$39(Y,s)}s(t$5,`t`);const Y=s((s,c)=>[...s].sort(c),`n`);function e$1(s,c,l){return typeof c==`number`||c===void 0?l=>l.split(s,c):s.split(c,l)}s(e$1,`e`);function n$5(...s){return t$49(X,s,i)}s(n$5,`n`);const X=s((s,c)=>c<0?[]:s.slice(0,c),`r`);function i(s){if(s<=0)return _;let c=s;return s=>(--c,{done:c<=0,hasNext:!0,next:s})}function t$4(...s){return t$49(n$4,s)}s(t$4,`t`);function n$4(s,c){let l=[];for(let[u,d]of s.entries()){if(!c(d,u,s))break;l.push(d)}return l}s(n$4,`n`);function t$3(...s){return t$49(n$3,s)}s(t$3,`t`);function n$3(s,c){return c(s),s}s(n$3,`n`);function n$2(...s){return t$41(r$2,s)}s(n$2,`n`);function r$2(){let s=new Set;return c=>s.has(c)?g:(s.add(c),{done:!1,hasNext:!0,next:c})}s(r$2,`r`);function n$1(...s){return t$41(r$1,s)}s(n$1,`n`);function r$1(s){let c=s,l=new Set;return(s,u,d)=>{let h=c(s,u,d);return l.has(h)?g:(l.add(h),{done:!1,hasNext:!0,next:s})}}s(r$1,`r`);function t$2(...s){return t$49(Object.values,s)}s(t$2,`t`);function e(...s){return s.length===2?(c,...l)=>Z(c,...s,...l):Z(...s)}const Z=s((s,c,l,...u)=>c(s,...u)?typeof l==`function`?l(s,...u):l.onTrue(s,...u):typeof l==`function`?s:l.onFalse(s,...u),`t`);function t(...s){return t$49(n,s,r)}const n=(s,c)=>s.length<c.length?s.map((s,l)=>[s,c[l]]):c.map((c,l)=>[s[l],c]),r=s=>(c,l)=>({hasNext:!0,next:[c,s[l]],done:l>=s.length-1});export{n$28 as $,t$22 as A,e$12 as B,e$4 as C,t$19 as D,t$18 as E,e$7 as F,e$17 as G,V as H,e$8 as I,t$25 as J,e$18 as K,e$9 as L,e$5 as M,e$6 as N,t$20 as O,t$24 as P,t$29 as Q,e$10 as R,t$16 as S,t$49 as St,n$17 as T,e$15 as U,e$13 as V,e$16 as W,t$27 as X,e$20 as Y,t$28 as Z,e$3 as _,t$44 as _t,n$2 as a,n$33 as at,t$14 as b,t$47 as bt,n$5 as c,t$36 as ct,t$6 as d,t$37 as dt,t$31 as et,t$7 as f,t$38 as ft,t$10 as g,e$25 as gt,e$2 as h,t$42 as ht,n$1 as i,t$35 as it,t$23 as j,t$21 as k,e$1 as l,r$13 as lt,t$9 as m,r$16 as mt,e as n,t$33 as nt,t$3 as o,n$34 as ot,t$8 as p,t$40 as pt,e$19 as q,t$2 as r,t$34 as rt,t$4 as s,n$35 as st,t,t$32 as tt,t$5 as u,n$37 as ut,t$12 as v,t$45 as vt,t$17 as w,t$15 as x,t$48 as xt,t$13 as y,t$46 as yt,e$11 as z};
@@ -1 +1 @@
1
- import"../rolldown-runtime.mjs";String.fromCharCode;const e=/^[\s\w\0+.-]{2,}:([/\\]{1,2})/,t=/^[\s\w\0+.-]{2,}:([/\\]{2})?/,n=/^([/\\]\s*){2,}[^/\\]/,r=/\/$|\/\?|\/#/,i=/^\.?\//;function isRelative(e){return[`./`,`../`].some(t=>e.startsWith(t))}function hasProtocol(r,i={}){return typeof i==`boolean`&&(i={acceptRelative:i}),i.strict?e.test(r):t.test(r)||(i.acceptRelative?n.test(r):!1)}function hasTrailingSlash(e=``,t){return t?r.test(e):e.endsWith(`/`)}function withoutTrailingSlash(e=``,t){if(!t)return(hasTrailingSlash(e)?e.slice(0,-1):e)||`/`;if(!hasTrailingSlash(e,!0))return e||`/`;let n=e,r=``,i=e.indexOf(`#`);i!==-1&&(n=e.slice(0,i),r=e.slice(i));let[a,...o]=n.split(`?`);return((a.endsWith(`/`)?a.slice(0,-1):a)||`/`)+(o.length>0?`?${o.join(`?`)}`:``)+r}function withTrailingSlash(e=``,t){if(!t)return e.endsWith(`/`)?e:e+`/`;if(hasTrailingSlash(e,!0))return e||`/`;let n=e,r=``,i=e.indexOf(`#`);if(i!==-1&&(n=e.slice(0,i),r=e.slice(i),!n))return r;let[a,...o]=n.split(`?`);return a+`/`+(o.length>0?`?${o.join(`?`)}`:``)+r}function hasLeadingSlash(e=``){return e.startsWith(`/`)}function withoutLeadingSlash(e=``){return(hasLeadingSlash(e)?e.slice(1):e)||`/`}function cleanDoubleSlashes(e=``){return e.split(`://`).map(e=>e.replace(/\/{2,}/g,`/`)).join(`://`)}function withoutBase(e,t){if(isEmptyURL(t))return e;let n=withoutTrailingSlash(t);if(!e.startsWith(n))return e;let r=e[n.length];if(r&&r!==`/`&&r!==`?`)return e;let i=e.slice(n.length);return i[0]===`/`?i:`/`+i}function isEmptyURL(e){return!e||e===`/`}function isNonEmptyURL(e){return e&&e!==`/`}function joinURL(e,...t){let n=e||``;for(let e of t.filter(e=>isNonEmptyURL(e)))if(n){let t=e.replace(i,``);n=withTrailingSlash(n)+t}else n=e;return n}function joinRelativeURL(...e){let t=/\/(?!\/)/,n=e.filter(Boolean),r=[],i=0;for(let e of n)if(!(!e||e===`/`)){for(let[n,a]of e.split(t).entries())if(!(!a||a===`.`)){if(a===`..`){if(r.length===1&&hasProtocol(r[0]))continue;r.pop(),i--;continue}if(n===1&&r[r.length-1]?.endsWith(`:/`)){r[r.length-1]+=`/`+a;continue}r.push(a),i++}}let a=r.join(`/`);return i>=0?n[0]?.startsWith(`/`)&&!a.startsWith(`/`)?a=`/`+a:n[0]?.startsWith(`./`)&&!a.startsWith(`./`)&&(a=`./`+a):a=`../`.repeat(-1*i)+a,n[n.length-1]?.endsWith(`/`)&&!a.endsWith(`/`)&&(a+=`/`),a}function withoutProtocol(e){return withProtocol(e,``)}function withProtocol(e,n){let r=e.match(t);return r||=e.match(/^\/{2,}/),r?n+e.slice(r[0].length):n+e}export{joinRelativeURL as a,withoutBase as c,withoutTrailingSlash as d,isRelative as i,withoutLeadingSlash as l,hasLeadingSlash as n,joinURL as o,hasProtocol as r,withTrailingSlash as s,cleanDoubleSlashes as t,withoutProtocol as u};
1
+ import"../rolldown-runtime.mjs";String.fromCharCode;const e=/^[\s\w\0+.-]{2,}:([/\\]{1,2})/,t=/^[\s\w\0+.-]{2,}:([/\\]{2})?/,n=/^([/\\]\s*){2,}[^/\\]/,r=/\/$|\/\?|\/#/,i=/^\.?\//;function isRelative(e){return[`./`,`../`].some(t=>e.startsWith(t))}function hasProtocol(r,i={}){return typeof i==`boolean`&&(i={acceptRelative:i}),i.strict?e.test(r):t.test(r)||(i.acceptRelative?n.test(r):!1)}function hasTrailingSlash(e=``,t){return t?r.test(e):e.endsWith(`/`)}function withoutTrailingSlash(e=``,t){if(!t)return(hasTrailingSlash(e)?e.slice(0,-1):e)||`/`;if(!hasTrailingSlash(e,!0))return e||`/`;let n=e,r=``,i=e.indexOf(`#`);i!==-1&&(n=e.slice(0,i),r=e.slice(i));let[a,...o]=n.split(`?`);return((a.endsWith(`/`)?a.slice(0,-1):a)||`/`)+(o.length>0?`?${o.join(`?`)}`:``)+r}function withTrailingSlash(e=``,t){if(!t)return e.endsWith(`/`)?e:e+`/`;if(hasTrailingSlash(e,!0))return e||`/`;let n=e,r=``,i=e.indexOf(`#`);if(i!==-1&&(n=e.slice(0,i),r=e.slice(i),!n))return r;let[a,...o]=n.split(`?`);return a+`/`+(o.length>0?`?${o.join(`?`)}`:``)+r}function hasLeadingSlash(e=``){return e.startsWith(`/`)}function withoutLeadingSlash(e=``){return(hasLeadingSlash(e)?e.slice(1):e)||`/`}function cleanDoubleSlashes(e=``){return e.split(`://`).map(e=>e.replace(/\/{2,}/g,`/`)).join(`://`)}function withoutBase(e,t){if(isEmptyURL(t))return e;let n=withoutTrailingSlash(t);if(!e.startsWith(n))return e;let r=e[n.length];return r&&r!==`/`&&r!==`?`?e:`/`+e.slice(n.length).replace(/^\/+/,``)}function isEmptyURL(e){return!e||e===`/`}function isNonEmptyURL(e){return e&&e!==`/`}function joinURL(e,...t){let n=e||``;for(let e of t.filter(e=>isNonEmptyURL(e)))if(n){let t=e.replace(i,``);n=withTrailingSlash(n)+t}else n=e;return n}function joinRelativeURL(...e){let t=/\/(?!\/)/,n=e.filter(Boolean),r=[],i=0;for(let e of n)if(!(!e||e===`/`)){for(let[n,a]of e.split(t).entries())if(!(!a||a===`.`)){if(a===`..`){if(r.length===1&&hasProtocol(r[0]))continue;r.pop(),i--;continue}if(n===1&&r[r.length-1]?.endsWith(`:/`)){r[r.length-1]+=`/`+a;continue}r.push(a),i++}}let a=r.join(`/`);return i>=0?n[0]?.startsWith(`/`)&&!a.startsWith(`/`)?a=`/`+a:n[0]?.startsWith(`./`)&&!a.startsWith(`./`)&&(a=`./`+a):a=`../`.repeat(-1*i)+a,n[n.length-1]?.endsWith(`/`)&&!a.endsWith(`/`)&&(a+=`/`),a}function withoutProtocol(e){return withProtocol(e,``)}function withProtocol(e,n){let r=e.match(t);return r||=e.match(/^\/{2,}/),r?n+e.slice(r[0].length):n+e}export{joinRelativeURL as a,withoutBase as c,withoutTrailingSlash as d,isRelative as i,withoutLeadingSlash as l,hasLeadingSlash as n,joinURL as o,hasProtocol as r,withTrailingSlash as s,cleanDoubleSlashes as t,withoutProtocol as u};